Files
windmill/frontend/src/lib/components/FlowMetadata.svelte
T
hugocasaandClaude Opus 5.5 8dd46a4d14 feat: build, test and run standalone ai agents from ai sessions (#11954)
* feat: guidance for building standalone ai agents in ai sessions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: agent guidance for resource-only sessions, no flow tools

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: tell the user to deploy a drafted tool script with its agent

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: scope plain agent values, document tool_inputs, list agents in get_instructions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: test and run ai agents from ai sessions, open agents in their editor

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: full-bleed agent editor tabs, back to the run form for agent tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: describe read-and-run as running agents too, pin agent run links

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: host the agent editor natively in session tabs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: switch the agent editor to tabs below 900px

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: name an agent's session tab after its summary

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: show deployed agents in session tabs, open and run them from the chat

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: deploy agents from the chat, report agent tabs as the active editor

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: pick agents from the tab picker, name their tabs, scope the agent page to its workspace

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: leave open editors alone on agent writes, read the agent page's workspace user

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: refresh an agent's deployed page when the chat deploys or deletes it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: name agent tabs before they load, mark agents in the changes drawer, stay on a deleted agent's tab

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep a cleared agent summary out of its tab name

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep the resource drawer's json option that the resources list still passes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: open an agent in an AI session from its pages, fix review findings on agent tabs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: name the reserved agent tool names in the agent guidance

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: reload an agent's editor on a discard, open a new agent in a session

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: show agents as agents on compare and deploy, name a never-deployed one by its path

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep a deployed agent's type in its draft diff

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: link a fork row to the agent editor only on the side that holds the agent

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: guard agent page paths, mark drafted agents in the picker, side-aware agent rows on fork compare

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 10:46:43 +01:00

134 lines
4.5 KiB
Svelte

<script lang="ts">
import { type Job } from '$lib/gen'
import JobStatus from '$lib/components/JobStatus.svelte'
import { flowPathToHref } from '$lib/scripts'
import { agentRunHref } from '$lib/components/flows/conversations/agentEditorChat'
import { displayDate, truncateRev } from '$lib/utils'
import ScheduleEditor from '$lib/components/triggers/schedules/ScheduleEditor.svelte'
import TimeAgo from './TimeAgo.svelte'
import { workspaceStore } from '$lib/stores'
import Tooltip from './Tooltip.svelte'
import { Clock, MemoryStick, Calendar, Bot, User, Code2 } from 'lucide-svelte'
import BarsStaggered from '$lib/components/icons/BarsStaggered.svelte'
const SMALL_ICON_SIZE = 14
interface Props {
job: Job
scheduleEditor: ScheduleEditor
}
let { job, scheduleEditor }: Props = $props()
// An agent's run is a flow preview, linked to the agent it ran.
const agentHref = $derived(job ? agentRunHref(job, $workspaceStore) : undefined)
</script>
<div
class="rounded-md p-4 bg-surface-secondary overflow-x-auto text-xs text-primary font-normal flex flex-col gap-1"
style="min-height: 150px;"
>
<JobStatus {job} />
<div class="flex flex-row gap-2 items-center">
<Clock size={SMALL_ICON_SIZE} class="min-w-3.5" />
<span class="whitespace-nowrap">
{#if job['success'] != undefined}
Received job: {displayDate(job.created_at ?? '')}
{:else}
Received job <TimeAgo date={job.created_at ?? ''} />
{/if}
<Tooltip small>{job?.created_at}</Tooltip>
</span>
</div>
{#if job && 'started_at' in job && job.started_at}
<div class="flex flex-row gap-2 items-center">
<Clock size={SMALL_ICON_SIZE} class="min-w-3.5" />
<span class="whitespace-nowrap">
Started <TimeAgo agoOnlyIfRecent date={job.started_at ?? ''} />
<Tooltip small>{job?.started_at}</Tooltip>
</span>
</div>
{/if}
{#if job && job['mem_peak']}
<div class="flex flex-row gap-2 items-center">
<MemoryStick size={SMALL_ICON_SIZE} class="text-secondary min-w-3.5" />
<span> Mem peak: {(job['mem_peak'] / 1024).toPrecision(5)}MB</span>
</div>
{/if}
<div class="text-xs text-primary font-normal flex flex-col gap-1">
{#if job && job.parent_job}
{#if job.is_flow_step}
<div class="flex flex-row gap-2 items-center">
<BarsStaggered size={SMALL_ICON_SIZE} class="min-w-3.5" />
<span class="whitespace-nowrap">
Step of flow
<a href={`/run/${job.parent_job}?workspace=${$workspaceStore}`}>
{truncateRev(job.parent_job, 18)}
</a>
</span>
</div>
{:else}
<div class="flex flex-row gap-2 items-center">
<Bot size={SMALL_ICON_SIZE} class="min-w-3.5" />
<span class="whitespace-nowrap">
Triggered by parent
<a href={`/run/${job.parent_job}?workspace=${$workspaceStore}`}> {job.parent_job}</a>
</span>
</div>
{/if}
{:else if job && job.schedule_path}
<div class="flex flex-row gap-2 w-full items-center">
<Calendar size={SMALL_ICON_SIZE} class="min-w-3.5" />
<span class="whitespace-nowrap">
Schedule:
<!-- svelte-ignore a11y_invalid_attribute -->
<a
href="#"
class="break-words text-blue-600 font-normal"
onclick={() =>
scheduleEditor?.openEdit(job.schedule_path ?? '', job.job_kind == 'flow')}
>
{truncateRev(job.schedule_path, 40)}
</a>
</span>
</div>
{/if}
{#if (job && job.job_kind == 'flow') || job?.job_kind == 'script' || agentHref}
{@const stem = `${job?.job_kind}s`}
{@const isScript = job?.job_kind === 'script'}
{@const viewHref = isScript
? `/${stem}/get/${job?.script_hash}`
: (agentHref ?? flowPathToHref(job?.script_path ?? ''))}
<div class="flex flex-row gap-2 items-center">
{#if isScript}
<Code2 size={SMALL_ICON_SIZE} class="min-w-3.5" />
{:else}
<BarsStaggered size={SMALL_ICON_SIZE} />
{/if}
<span class="truncate">
<a href={viewHref}>{isScript ? job?.script_hash : job?.script_path}</a>
</span>
</div>
{/if}
<div class="flex items-center gap-2">
<User size={SMALL_ICON_SIZE} class="min-w-3.5" />
<span>
By {truncateRev(
job.created_by ?? 'unknown',
40
)}{#if (job?.created_by?.length ?? 0) > 40}<Tooltip small
><div class="break-all">{job.created_by}</div></Tooltip
>{/if}
{#if job.permissioned_as !== `u/${job.created_by}` && job.permissioned_as != job.created_by}
but permissioned as {job.permissioned_as}
{/if}
</span>
</div>
</div>
<div class="text-secondary text-2xs pt-2 whitespace-nowrap">
run id:
<a href={`/run/${job.id}?workspace=${job.workspace_id}`}> {job.id} </a>
</div>
</div>