{#if target} {#key `${ws}:${target.path}`} {#if layout === 'modal'} true, (open) => !open && close()} kind="X" fillHeight enterConfirms={false} paginated title={shownPath ?? target.path} {trail} {description} {titleBadge} {levelBadge} {settings} class="w-[92vw] sm:w-[92vw] max-w-[1500px] sm:max-w-[1500px] h-[88vh]" > {@render body()} {:else if layout === 'pane'}
{@render agentSummary()} {@render agentHint()}
{@render settings()}
{@render body()}
{:else}
{@render body()}
{/if} {/key} {#snippet agentPathTrigger(pathLabel: Snippet, triggerClass: string)} {#if draft?.state} draft.state?.description ?? '', (v) => { if (draft.state) draft.state.description = v } } bind:path={ () => draft.state?.path ?? '', (v) => { if (draft.state) draft.state.path = v } } bind:snapshotPath={pathSnapshot} bind:error={() => host?.pathError(), (error) => host?.setPathError(error)} savedPath={draft?.noDeployed ? undefined : target?.path} kind="resource" workspaceId={ws} pathEditable={!readOnly} summaryEditable={!readOnly} /> {:else} {@render pathLabel()} {/if} {/snippet} {#snippet agentSummary()}
{#if draft?.state} {#snippet summaryText()} {emptyString(draft.state?.description) ? 'Add a summary...' : draft.state?.description} {/snippet} draft.state?.description ?? '', (v) => { if (draft.state) draft.state.description = v } } bind:path={ () => draft.state?.path ?? '', (v) => { if (draft.state) draft.state.path = v } } bind:snapshotPath={pathSnapshot} bind:error={() => host?.pathError(), (error) => host?.setPathError(error)} savedPath={draft?.noDeployed ? undefined : target?.path} kind="resource" workspaceId={ws} pathEditable={!readOnly} summaryEditable={!readOnly} penVisibility={emptyString(draft.state.description) ? 'always' : 'hover'} /> {/if} {@render titleBadge()}
{/snippet} {#snippet agentHint()} {#if description} {description} {/if} {/snippet} {#snippet titleBadge()} {#if version != undefined && !refused} v{version} {/if} {/snippet} {#snippet levelBadge()} {#if inEvals && !evalsLocation} Beta {/if} {/snippet} {#snippet settings()}
{#if !inEvals && !refused} {#if testPane?.mode && !inSettings} testPane?.mode, (mode) => { if (testPane) testPane.mode = mode } } noWFull > {#snippet children({ item })} {/snippet} {/if} {#if readOnly} Read only {/if} {#if !inSettings} {/if} {/if}
{/snippet} {#snippet body()}
draft?.deployed} getCurrent={() => draft?.state} onDiscard={() => draft?.sync.resetToDeployed(target?.path ?? '')} title="Deployed <> Unsaved agent changes" />
{/snippet} {#snippet agentPage()} showTool(id)} {onSaved} isNew={target?.isNew} /> {/snippet} {#snippet settingsFields()} {#if draft} host?.pathError(), (error) => host?.setPathError(error)} onRunAsChange={(runAs) => host?.setRunAs(runAs)} /> {/if} {/snippet} {#snippet settingsPage()}
{@render settingsFields()}
{/snippet} {#snippet evalsPage()}
{/snippet} {#if layout !== 'modal' && ws} {/if} settingsDrawer?.closeDrawer()}> {@render settingsFields()} versionDrawer?.closeDrawer()} noPadding> { versionDrawer?.closeDrawer() // A restore writes the resource as a deploy does, so the flow behind has to be told // the same way. Captured before closing, which drops the target this reads. const at = currentWriteTarget() // Close the editor too, as the generic resource editor does on a restore: it holds // a baseline captured before the restore, and any local draft on top of it, so // deploying from it afterwards would write the pre-restore value straight back over // the version just restored. close() if (at) reconcileQuietly(at, at.path) }} /> {/if}