diff --git a/frontend/src/lib/components/AgentActions.svelte b/frontend/src/lib/components/AgentActions.svelte
new file mode 100644
index 0000000000..3ff1be8ea2
--- /dev/null
+++ b/frontend/src/lib/components/AgentActions.svelte
@@ -0,0 +1,134 @@
+
+
+
+ {#each entries as entry, index (index)}
+ {#if entry.kind === 'assistant'}
+
+
+ {#if entry.sources}
+
+
+
+ {/if}
+
+ {:else if entry.kind === 'search'}
+
toggle(index, entry)}
+ >
+ {#if entry.sources}
+
+ {:else}
+
+ {/if}
+
+ {:else}
+ {@const job = jobOf(entry.jobId)}
+
toggle(index, entry)}
+ contentClass="space-y-3"
+ >
+ {#if entry.args}
+
+ {/if}
+ {#if job?.logs}
+
+ {/if}
+
+ {#if entry.resourcePath}
+
+
+ {entry.resourcePath}
+
+ {:else if entry.jobId}
+
+
+ Open job
+
+ {/if}
+
+ {/if}
+ {/each}
+
diff --git a/frontend/src/lib/components/AgentResultDisplay.svelte b/frontend/src/lib/components/AgentResultDisplay.svelte
index dab8865f16..80df9d530a 100644
--- a/frontend/src/lib/components/AgentResultDisplay.svelte
+++ b/frontend/src/lib/components/AgentResultDisplay.svelte
@@ -2,13 +2,13 @@
import type { Snippet } from 'svelte'
import { Badge } from '$lib/components/common'
import GfmMarkdown from './GfmMarkdown.svelte'
- import AgentTranscript from './AgentTranscript.svelte'
+ import AgentActions from './AgentActions.svelte'
import { formatTokenCount, summarizeAgentResult, type AgentResult } from './aiAgentResult'
interface Props {
result: AgentResult
- /** Answer or the conversation behind it; JSON is the viewer's own toggle. */
- view: 'answer' | 'transcript'
+ /** The answer, or what the agent did to get there; JSON is the viewer's own toggle. */
+ view: 'answer' | 'actions'
workspaceId?: string
/**
* How to render an answer that is not text. An `output_schema` makes `output`
@@ -27,8 +27,8 @@
- {#if view === 'transcript'}
-
+ {#if view === 'actions'}
+
{:else if textOutput !== undefined}
{#if textOutput === ''}
The agent returned no answer
diff --git a/frontend/src/lib/components/AgentTranscript.svelte b/frontend/src/lib/components/AgentTranscript.svelte
deleted file mode 100644
index cc9ac194c8..0000000000
--- a/frontend/src/lib/components/AgentTranscript.svelte
+++ /dev/null
@@ -1,164 +0,0 @@
-
-
-
- {#each entries as entry, index (index)}
- {#if entry.kind === 'user'}
-
-
- {:else if entry.kind === 'assistant'}
-
-
- {#if entry.sources}
-
-
-
- {/if}
-
- {:else if entry.kind === 'search'}
-
- toggle(index, entry)}
- >
- {#if entry.sources}
-
- {:else}
-
- {/if}
-
-
- {:else}
- {@const job = jobOf(entry.jobId)}
-
-
toggle(index, entry)}
- contentClass="space-y-3"
- >
- {#if entry.args}
-
- {/if}
- {#if job?.logs}
-
- {/if}
-
- {#if entry.resourcePath}
-
-
- {entry.resourcePath}
-
- {:else if entry.jobId}
-
-
- Open job
-
- {/if}
-
-
- {/if}
- {/each}
- {#if systemPrompt}
-
-
toggle(SYSTEM_PROMPT_KEY, systemPrompt)}
- >
- {systemPrompt.content}
-
-
- {/if}
-
diff --git a/frontend/src/lib/components/DisplayResult.svelte b/frontend/src/lib/components/DisplayResult.svelte
index 385d7f14b5..ed1bb9664d 100644
--- a/frontend/src/lib/components/DisplayResult.svelte
+++ b/frontend/src/lib/components/DisplayResult.svelte
@@ -20,7 +20,7 @@
Highlighter,
ArrowDownFromLine,
Bot,
- MessagesSquare,
+ ListTree,
Database,
Loader2
} from 'lucide-svelte'
@@ -58,7 +58,7 @@
import type { MarkupTrust } from './apps/markupTrust'
import AgentResultDisplay from './AgentResultDisplay.svelte'
import AgentStreamDisplay from './AgentStreamDisplay.svelte'
- import AgentTranscript from './AgentTranscript.svelte'
+ import AgentActions from './AgentActions.svelte'
import { isAgentStream, parseAgentErrorMessages, parseAgentResult } from './aiAgentResult'
const TABLE_MAX_SIZE = 5000000
@@ -165,7 +165,7 @@
}: Props = $props()
let s3FileDisplayRawMode = $state(false)
/** Which half of an agent result is showing; JSON is `forceJson`, as for any kind. */
- let agentView: 'answer' | 'transcript' = $state('answer')
+ let agentView: 'answer' | 'actions' = $state('answer')
/** The partial conversation a max-iterations failure carries, if this is one. */
let agentErrorMessages = $derived(parseAgentErrorMessages(result))
@@ -308,7 +308,7 @@
}
// Classified before the size caps below: an agent's answer stays small
- // however long its conversation grows, so a run with a big transcript
+ // however long its conversation grows, so a run with many actions
// must not fall back to the JSON tree that hides the answer inside it.
// `largeObject` is still set honestly, so switching to JSON gets the
// same too-big handling as any other oversized result.
@@ -818,15 +818,15 @@
{#if !hideAsJson && !['json', 's3object'].includes(resultKind ?? '') && typeof result === 'object'}
{
forceJson = ev.detail === 'json'
- if (ev.detail === 'transcript' || ev.detail === 'pretty') {
- agentView = ev.detail === 'transcript' ? 'transcript' : 'answer'
+ if (ev.detail === 'actions' || ev.detail === 'pretty') {
+ agentView = ev.detail === 'actions' ? 'actions' : 'answer'
}
}}
>
@@ -835,13 +835,7 @@
{:else if resultKind === 'aiagent'}
-
+
{:else}
{/if}
@@ -1024,12 +1018,12 @@
{#if agentErrorMessages}
+ returned. What it managed to do rides inside that error and is the
+ whole reason to look at such a run, so it is added under the error
+ rather than replacing it. -->