gaunt-sloth 2.0.0-alpha.19 → 2.0.0-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -39,7 +39,7 @@ This is the only package in the workspace that pulls in AI vendor dependencies d
39
39
  npm install -g gaunt-sloth
40
40
  ```
41
41
 
42
- For full usage documentation see the [root README](../../README.md) and [docs/COMMANDS.md](../../docs/COMMANDS.md).
42
+ For full usage documentation see the [root README](https://github.com/pukeko-robotics/gaunt-sloth/blob/main/README.md) and [docs/COMMANDS.md](https://github.com/pukeko-robotics/gaunt-sloth/blob/main/docs/COMMANDS.md).
43
43
 
44
44
  ## ACP server (editor integration)
45
45
 
@@ -92,7 +92,8 @@ the same `command` + `args` pair.
92
92
 
93
93
  ## Related packages
94
94
 
95
- - [`@gaunt-sloth/core`](../core) — Core utilities, config, and agent infrastructure
96
- - [`@gaunt-sloth/agent`](../agent) — Agent runtime, built-in tools, API/AG-UI/ACP server
97
- - [`@gaunt-sloth/review`](../review) — Review and Q&A modules with standalone CLI
98
- - [`gaunt-sloth`](../app) — Main CLI application (this package)
95
+ - [`@gaunt-sloth/core`](https://www.npmjs.com/package/@gaunt-sloth/core) — Core utilities, config, and agent infrastructure ([source](https://github.com/pukeko-robotics/gaunt-sloth/tree/main/packages/core))
96
+ - [`@gaunt-sloth/agent`](https://www.npmjs.com/package/@gaunt-sloth/agent) — Agent runtime, built-in tools, API/AG-UI/ACP server ([source](https://github.com/pukeko-robotics/gaunt-sloth/tree/main/packages/agent))
97
+ - [`@gaunt-sloth/review`](https://www.npmjs.com/package/@gaunt-sloth/review) — Review and Q&A modules with standalone CLI ([source](https://github.com/pukeko-robotics/gaunt-sloth/tree/main/packages/review))
98
+ - [`@gaunt-sloth/batch`](https://www.npmjs.com/package/@gaunt-sloth/batch) — Batch / eval / workflow runtime ([source](https://github.com/pukeko-robotics/gaunt-sloth/tree/main/packages/batch))
99
+ - [`gaunt-sloth`](https://www.npmjs.com/package/gaunt-sloth) — Main CLI application (this package) ([source](https://github.com/pukeko-robotics/gaunt-sloth/tree/main/packages/app))
package/dist/cli.js CHANGED
@@ -16,6 +16,7 @@ import { historyCommand } from '#src/commands/historyCommand.js';
16
16
  import { insightsCommand } from '#src/commands/insightsCommand.js';
17
17
  import { modelsCommand } from '#src/commands/modelsCommand.js';
18
18
  import { argv, getSlothVersion, readStdin } from '@gaunt-sloth/core/utils/systemUtils.js';
19
+ import { commandSkipsStdin, resolveInvokedCommandName } from '#src/utils/stdinPolicy.js';
19
20
  import { coerceBooleanOrString } from '@gaunt-sloth/core/utils/consoleUtils.js';
20
21
  const program = new Command();
21
22
  program
@@ -85,5 +86,16 @@ insightsCommand(program);
85
86
  // GS2-6 (B16) — model catalog: lists providers/models enriched with models.dev cost/limit metadata.
86
87
  // Read-only; enrichment never gates what `/v1/models` reports as callable.
87
88
  modelsCommand(program);
89
+ // BATCH-11 (#405 gotcha #5): `eval`/`batch` never consume piped stdin, so they must not block
90
+ // waiting for stdin EOF before dispatch — a scripted/CI `gth eval suite.yaml` inherits a non-TTY,
91
+ // non-closing stdin and would otherwise hang until EOF (or need `</dev/null`). Resolve the invoked
92
+ // subcommand from argv via commander's own operand parsing (so a `-c <path>` value or a file
93
+ // argument is never mistaken for the command name) and, for those commands, imply the existing
94
+ // `--no-pipe` fast path in readStdin. ask/review/pr etc. are untouched and still block-and-read a
95
+ // piped diff.
96
+ const invokedCommand = resolveInvokedCommandName(program.commands.map((command) => command.name()), program.parseOptions(argv).operands);
97
+ if (commandSkipsStdin(invokedCommand)) {
98
+ program.setOptionValue('nopipe', true);
99
+ }
88
100
  await readStdin(program);
89
101
  //# sourceMappingURL=cli.js.map
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAA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CAAC,IAAI,CAAC,CAAC,QAAQ,CACpC,CAAC;AACF,IAAI,iBAAiB,CAAC,cAAc,CAAC,EAAE,CAAC;IACtC,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * @module adkEvalRunner
3
+ * BATCH-14 — the ADK (A2A) target's production runner builders for `gth eval`. The eval runner
4
+ * ({@link @gaunt-sloth/batch#runEvalSuite}) is target-agnostic: it consumes an injected
5
+ * {@link RunCellFn} (single-shot) and {@link RunConversationFn} (multi-turn) and grades whatever
6
+ * `answer` they produce with the SAME assertion surface used for the `gth-agent` target. This module
7
+ * builds those two functions for an EXTERNAL Google ADK agent, driving it over the A2A protocol via
8
+ * {@link A2AClientWrapper} (the existing `@a2a-js/sdk` wrapper) — the analogue of `batchCommand.ts`'s
9
+ * `buildProductionRunCell`/`buildProductionRunConversation` for the in-process gth agent.
10
+ *
11
+ * The A2A client is INJECTABLE (like `RunCellFn`/`RunConversationFn` themselves) so unit tests drive
12
+ * these builders against a FAKE client with no network and no live ADK agent — the live end-to-end
13
+ * validation is a separate node (BATCH-16).
14
+ *
15
+ * Honest boundaries (BATCH-14 design point 4): A2A exposes text (and file/data) parts plus task
16
+ * status/artifact events, but NOT the agent's intermediate tool/function calls — so the ADK outcomes
17
+ * never populate `tools`, and `must_call`/`must_not_call` are rejected at suite-parse time rather
18
+ * than silently passed. A2A likewise carries no token accounting, so `tokensInput`/`tokensOutput`
19
+ * are left unset (undefined), unlike the gth-agent path.
20
+ */
21
+ import type { AdkAgentTarget, RunCellFn, RunConversationFn } from '@gaunt-sloth/batch';
22
+ /** One A2A turn's result as the ADK runner needs it: the answer text plus the continuity handles to
23
+ * thread into follow-up turns. */
24
+ export interface AdkA2AResponse {
25
+ text: string;
26
+ contextId?: string;
27
+ taskId?: string;
28
+ }
29
+ /**
30
+ * The minimal A2A client the ADK runner depends on — a single `sendMessage(text, context?)` that
31
+ * returns text + continuity handles. Production wraps {@link A2AClientWrapper.sendMessageWithContext};
32
+ * tests inject a fake implementing exactly this. Kept deliberately narrow so a fake is trivial and
33
+ * the runner never reaches into the full SDK surface.
34
+ */
35
+ export interface AdkA2AClient {
36
+ sendMessage(text: string, context?: {
37
+ contextId?: string;
38
+ taskId?: string;
39
+ }): Promise<AdkA2AResponse>;
40
+ }
41
+ /** Builds an {@link AdkA2AClient} for a target — the injection seam for tests. */
42
+ export type AdkClientFactory = (target: AdkAgentTarget) => AdkA2AClient;
43
+ /** Production factory: a real {@link A2AClientWrapper} over the target's A2A endpoint, adapted to the
44
+ * narrow {@link AdkA2AClient} shape via its context-threading {@link A2AClientWrapper.sendMessageWithContext}. */
45
+ export declare const defaultAdkClientFactory: AdkClientFactory;
46
+ /**
47
+ * Build the injectable single-shot {@link RunCellFn} that drives ONE ADK agent turn over A2A: send
48
+ * the cell's prompt as the A2A message text and return the agent's text as the cell `answer`. A
49
+ * transport/agent error is contained as a failed cell (`ok:false`) so one bad case can never take the
50
+ * whole suite down — matching `buildProductionRunCell`'s discipline for the gth-agent path.
51
+ *
52
+ * `tools`/tokens are intentionally unset (A2A exposes neither); content assertions grade the answer.
53
+ */
54
+ export declare function buildAdkRunCell(target: AdkAgentTarget, createClient?: AdkClientFactory): RunCellFn;
55
+ /**
56
+ * Build the injectable multi-turn {@link RunConversationFn} that drives a whole scripted conversation
57
+ * against the ADK agent over A2A, threading the A2A `contextId` across turns so turn N sees turn
58
+ * N-1's context (an ADK agent keeps conversational memory by `contextId`). ONE client is built for
59
+ * the conversation; the first turn sends no context, and each subsequent turn carries the `contextId`
60
+ * the previous response returned.
61
+ *
62
+ * Returns one {@link TurnRunOutcome} per turn attempted. A turn that throws is recorded as a failed
63
+ * turn and ABORTS the conversation (the returned array is short) — the runner fails the un-run turns
64
+ * with a clear reason, exactly as it does for a gth-agent conversation that ended early.
65
+ */
66
+ export declare function buildAdkRunConversation(target: AdkAgentTarget, createClient?: AdkClientFactory): RunConversationFn;
@@ -0,0 +1,69 @@
1
+ import { A2AClientWrapper } from '#src/modules/a2a/A2AClientWrapper.js';
2
+ /** Production factory: a real {@link A2AClientWrapper} over the target's A2A endpoint, adapted to the
3
+ * narrow {@link AdkA2AClient} shape via its context-threading {@link A2AClientWrapper.sendMessageWithContext}. */
4
+ export const defaultAdkClientFactory = (target) => {
5
+ const wrapper = new A2AClientWrapper({
6
+ agentId: target.agentId ?? 'adk-agent',
7
+ agentUrl: target.url,
8
+ });
9
+ return {
10
+ sendMessage: (text, context) => wrapper.sendMessageWithContext(text, context),
11
+ };
12
+ };
13
+ /**
14
+ * Build the injectable single-shot {@link RunCellFn} that drives ONE ADK agent turn over A2A: send
15
+ * the cell's prompt as the A2A message text and return the agent's text as the cell `answer`. A
16
+ * transport/agent error is contained as a failed cell (`ok:false`) so one bad case can never take the
17
+ * whole suite down — matching `buildProductionRunCell`'s discipline for the gth-agent path.
18
+ *
19
+ * `tools`/tokens are intentionally unset (A2A exposes neither); content assertions grade the answer.
20
+ */
21
+ export function buildAdkRunCell(target, createClient = defaultAdkClientFactory) {
22
+ return async (cell) => {
23
+ try {
24
+ const client = createClient(target);
25
+ const { text } = await client.sendMessage(cell.content);
26
+ return { ok: true, answer: text };
27
+ }
28
+ catch (error) {
29
+ return { ok: false, error: error instanceof Error ? error.message : String(error) };
30
+ }
31
+ };
32
+ }
33
+ /**
34
+ * Build the injectable multi-turn {@link RunConversationFn} that drives a whole scripted conversation
35
+ * against the ADK agent over A2A, threading the A2A `contextId` across turns so turn N sees turn
36
+ * N-1's context (an ADK agent keeps conversational memory by `contextId`). ONE client is built for
37
+ * the conversation; the first turn sends no context, and each subsequent turn carries the `contextId`
38
+ * the previous response returned.
39
+ *
40
+ * Returns one {@link TurnRunOutcome} per turn attempted. A turn that throws is recorded as a failed
41
+ * turn and ABORTS the conversation (the returned array is short) — the runner fails the un-run turns
42
+ * with a clear reason, exactly as it does for a gth-agent conversation that ended early.
43
+ */
44
+ export function buildAdkRunConversation(target, createClient = defaultAdkClientFactory) {
45
+ return async (userMessages) => {
46
+ const client = createClient(target);
47
+ const outcomes = [];
48
+ let contextId;
49
+ for (const message of userMessages) {
50
+ try {
51
+ const response = await client.sendMessage(message, contextId ? { contextId } : undefined);
52
+ // Carry the server's contextId forward so the next turn continues the same conversation.
53
+ if (response.contextId)
54
+ contextId = response.contextId;
55
+ outcomes.push({ ok: true, answer: response.text });
56
+ }
57
+ catch (error) {
58
+ outcomes.push({
59
+ ok: false,
60
+ error: error instanceof Error ? error.message : String(error),
61
+ });
62
+ // A failed turn aborts the conversation — the runner marks the remaining turns FAILed.
63
+ break;
64
+ }
65
+ }
66
+ return outcomes;
67
+ };
68
+ }
69
+ //# sourceMappingURL=adkEvalRunner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adkEvalRunner.js","sourceRoot":"","sources":["../../src/commands/adkEvalRunner.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AA0BxE;kHACkH;AAClH,MAAM,CAAC,MAAM,uBAAuB,GAAqB,CAAC,MAAM,EAAE,EAAE;IAClE,MAAM,OAAO,GAAG,IAAI,gBAAgB,CAAC;QACnC,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,WAAW;QACtC,QAAQ,EAAE,MAAM,CAAC,GAAG;KACrB,CAAC,CAAC;IACH,OAAO;QACL,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC;KAC9E,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAsB,EACtB,YAAY,GAAqB,uBAAuB;IAExD,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QACpB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CA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AC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;iBAC9D,CAAC,CAAC;gBACH,uFAAuF;gBACvF,MAAM;YACR,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,73 @@
1
+ import type { AgUiAgentTarget, RunCellFn, RunConversationFn } from '@gaunt-sloth/batch';
2
+ /** One AG-UI message as sent in the `RunAgentInput.messages` array. The eval only ever sends `user`
3
+ * turns and, for conversation continuity, the `assistant` answers it assembled — the minimal shape
4
+ * the reference server's `convertMessage` consumes (`{ id, role, content }`). */
5
+ export interface AgUiMessage {
6
+ id: string;
7
+ role: 'user' | 'assistant';
8
+ content: string;
9
+ }
10
+ /** The `RunAgentInput` fields the runner drives per request. `threadId` provides conversation
11
+ * continuity (stable across the turns of ONE conversation); `runId` is fresh per request. */
12
+ export interface AgUiRunInput {
13
+ threadId: string;
14
+ runId: string;
15
+ messages: AgUiMessage[];
16
+ }
17
+ /** One AG-UI run's decoded result: the answer assembled from `TEXT_MESSAGE_CONTENT` deltas and the
18
+ * tool names captured from `TOOL_CALL_START` events (empty array when the agent called no tools —
19
+ * NOT undefined, so `must_not_call` grades against a real, present trace). */
20
+ export interface AgUiRunResult {
21
+ answer: string;
22
+ tools: string[];
23
+ }
24
+ /**
25
+ * The minimal AG-UI client the runner depends on — a single `run(input)` that POSTs one
26
+ * `RunAgentInput` and returns the decoded answer + tools. Production wraps {@link createAgUiClient};
27
+ * tests inject a fake implementing exactly this. Kept deliberately narrow so a fake is trivial and
28
+ * the runner never reaches into transport details.
29
+ */
30
+ export interface AgUiClient {
31
+ run(input: AgUiRunInput): Promise<AgUiRunResult>;
32
+ }
33
+ /** Builds an {@link AgUiClient} for a target — the injection seam for tests. */
34
+ export type AgUiClientFactory = (target: AgUiAgentTarget) => AgUiClient;
35
+ /** The `fetch` seam — global `fetch` in production, a fake in tests (so the real POST-body
36
+ * construction + SSE decode are exercised with no network). */
37
+ export type FetchLike = typeof fetch;
38
+ /**
39
+ * Create a real {@link AgUiClient} that drives the target's AG-UI run endpoint over HTTP/SSE. Each
40
+ * `run` POSTs a `RunAgentInput` to `{url}/agents/{agentId}/run` and decodes the SSE response via
41
+ * {@link decodeAgUiStream}. A non-2xx response, an absent body, a `RUN_ERROR` event, or a truncated
42
+ * stream all throw — the runner builders contain that into a failed cell (`ok:false`).
43
+ *
44
+ * `fetchImpl` defaults to global `fetch`; tests pass a fake returning a synthetic SSE `Response` so
45
+ * the body construction + decode are exercised without a network or a live server.
46
+ */
47
+ export declare function createAgUiClient(target: AgUiAgentTarget, fetchImpl?: FetchLike): AgUiClient;
48
+ /** Production factory: a real HTTP/SSE {@link AgUiClient} over the target's AG-UI endpoint. */
49
+ export declare const defaultAgUiClientFactory: AgUiClientFactory;
50
+ /**
51
+ * Build the injectable single-shot {@link RunCellFn} that drives ONE AG-UI run: send the cell's
52
+ * prompt as the sole `user` message (fresh `threadId`/`runId`) and return the agent's assembled text
53
+ * as the cell `answer` plus the tool names captured from the stream as `tools`. A transport/stream
54
+ * error is contained as a failed cell (`ok:false`) so one bad case can never take the whole suite
55
+ * down — matching `buildProductionRunCell`'s discipline for the gth-agent path.
56
+ *
57
+ * `tools` is ALWAYS populated (possibly `[]`) — the AG-UI wire exposes the trace — so
58
+ * `must_call`/`must_not_call` grade normally, the key difference from the ADK target.
59
+ */
60
+ export declare function buildAgUiRunCell(target: AgUiAgentTarget, createClient?: AgUiClientFactory): RunCellFn;
61
+ /**
62
+ * Build the injectable multi-turn {@link RunConversationFn} that drives a whole scripted conversation
63
+ * against the AG-UI agent, threading continuity via the `messages` array + a STABLE `threadId` across
64
+ * the turns of ONE conversation: each turn appends its `user` message, POSTs the accumulated history
65
+ * under the same `threadId`, then appends the assistant's answer so the next turn's request carries
66
+ * it. ONE `threadId` for the whole conversation; a fresh `runId` per turn.
67
+ *
68
+ * Returns one {@link TurnRunOutcome} per turn attempted (answer + per-turn tool trace). A turn that
69
+ * throws is recorded as a failed turn and ABORTS the conversation (the returned array is short) — the
70
+ * runner fails the un-run turns with a clear reason, exactly as it does for a gth-agent conversation
71
+ * that ended early.
72
+ */
73
+ export declare function buildAgUiRunConversation(target: AgUiAgentTarget, createClient?: AgUiClientFactory): RunConversationFn;
@@ -0,0 +1,216 @@
1
+ /**
2
+ * @module agUiEvalRunner
3
+ * BATCH-15 — the AG-UI target's production runner builders for `gth eval`. The eval runner
4
+ * ({@link @gaunt-sloth/batch#runEvalSuite}) is target-agnostic: it consumes an injected
5
+ * {@link RunCellFn} (single-shot) and {@link RunConversationFn} (multi-turn) and grades whatever
6
+ * `answer` (and `tools`) they produce with the SAME assertion surface used for the `gth-agent`
7
+ * target. This module builds those two functions for an EXTERNAL agent exposed over the AG-UI
8
+ * protocol, driving its HTTP/SSE run endpoint — the analogue of `batchCommand.ts`'s
9
+ * `buildProductionRunCell`/`buildProductionRunConversation` (in-process gth agent) and of
10
+ * `adkEvalRunner.ts` (external ADK agent over A2A).
11
+ *
12
+ * The transport is INJECTABLE (like `RunCellFn`/`RunConversationFn` themselves) so unit tests drive
13
+ * these builders against a FAKE client — or the real decoder against a FAKE `fetch` — with no
14
+ * network and no live AG-UI server. The live end-to-end validation against a running `gth api ag-ui`
15
+ * server is a separate node (BATCH-17).
16
+ *
17
+ * KEY DIFFERENCE from the ADK (A2A) runner: the AG-UI wire DOES stream the agent's tool calls
18
+ * (`TOOL_CALL_START`). So this runner CAPTURES each `TOOL_CALL_START`'s `toolCallName` into the
19
+ * outcome's `tools`, and `must_call`/`must_not_call` grade normally — unlike the adk-agent target,
20
+ * where the tool trace is invisible and those assertions are rejected at parse time. AG-UI carries
21
+ * no token accounting either, so `tokensInput`/`tokensOutput` are left unset (undefined).
22
+ *
23
+ * The wire contract (see the reference endpoint, `@gaunt-sloth/api`'s `apiAgUiModule.ts`):
24
+ * - Request: `POST {url}/agents/{agentId}/run` with a `RunAgentInput` body
25
+ * `{ threadId, runId, messages, tools, forwardedProps }`.
26
+ * - Response: an SSE stream of AG-UI events. We decode `TEXT_MESSAGE_CONTENT` deltas into the
27
+ * `answer`, `TOOL_CALL_START` names into `tools`, and treat `RUN_ERROR` (or a non-200, or a stream
28
+ * that ends without the terminal `RUN_FINISHED`) as a failed run — a gradeable `ok:false`, never
29
+ * an uncaught throw that aborts the whole suite.
30
+ */
31
+ import { randomUUID } from 'node:crypto';
32
+ import { EventType } from '@ag-ui/core';
33
+ /**
34
+ * Decode an AG-UI SSE stream into an {@link AgUiRunResult}. The reference encoder frames each event
35
+ * as `data: <json>\n\n` (`@ag-ui/encoder`), so we split on the blank-line delimiter, JSON-parse each
36
+ * frame's `data:` payload, and fold the relevant event types:
37
+ * - `TEXT_MESSAGE_CONTENT` → append `delta` to the answer.
38
+ * - `TOOL_CALL_START` → capture `toolCallName` into `tools`.
39
+ * - `RUN_ERROR` → remember the message; the run FAILED.
40
+ * - `RUN_FINISHED` → the terminal success signal.
41
+ *
42
+ * Throws on `RUN_ERROR` OR on a stream that ends without a terminal `RUN_FINISHED` (a truncated /
43
+ * malformed stream is a failed run, not an "empty answer" success). Non-JSON frames (SSE comments /
44
+ * keep-alives) are ignored. The throw is contained by the runner builders below into `ok:false`.
45
+ */
46
+ async function decodeAgUiStream(body) {
47
+ const decoder = new TextDecoder();
48
+ let buffer = '';
49
+ let answer = '';
50
+ const tools = [];
51
+ let runError;
52
+ let sawRunFinished = false;
53
+ const handleFrame = (frame) => {
54
+ const payload = frame
55
+ .split(/\r?\n/)
56
+ .filter((line) => line.startsWith('data:'))
57
+ .map((line) => line.slice('data:'.length).trim())
58
+ .join('\n');
59
+ if (!payload)
60
+ return;
61
+ let event;
62
+ try {
63
+ event = JSON.parse(payload);
64
+ }
65
+ catch {
66
+ // Non-JSON frame (SSE comment / keep-alive) — ignore.
67
+ return;
68
+ }
69
+ switch (event.type) {
70
+ case EventType.TEXT_MESSAGE_CONTENT:
71
+ if (typeof event.delta === 'string')
72
+ answer += event.delta;
73
+ break;
74
+ case EventType.TOOL_CALL_START:
75
+ if (typeof event.toolCallName === 'string')
76
+ tools.push(event.toolCallName);
77
+ break;
78
+ case EventType.RUN_ERROR:
79
+ runError = typeof event.message === 'string' ? event.message : 'unknown run error';
80
+ break;
81
+ case EventType.RUN_FINISHED:
82
+ sawRunFinished = true;
83
+ break;
84
+ }
85
+ };
86
+ for await (const chunk of body) {
87
+ buffer += decoder.decode(chunk, { stream: true });
88
+ let sep;
89
+ while ((sep = buffer.indexOf('\n\n')) !== -1) {
90
+ handleFrame(buffer.slice(0, sep));
91
+ buffer = buffer.slice(sep + 2);
92
+ }
93
+ }
94
+ buffer += decoder.decode();
95
+ if (buffer.trim().length > 0)
96
+ handleFrame(buffer);
97
+ if (runError !== undefined) {
98
+ throw new Error(`AG-UI run error: ${runError}`);
99
+ }
100
+ if (!sawRunFinished) {
101
+ throw new Error('AG-UI stream ended without a terminal RUN_FINISHED event (truncated or malformed stream).');
102
+ }
103
+ return { answer, tools };
104
+ }
105
+ /**
106
+ * Create a real {@link AgUiClient} that drives the target's AG-UI run endpoint over HTTP/SSE. Each
107
+ * `run` POSTs a `RunAgentInput` to `{url}/agents/{agentId}/run` and decodes the SSE response via
108
+ * {@link decodeAgUiStream}. A non-2xx response, an absent body, a `RUN_ERROR` event, or a truncated
109
+ * stream all throw — the runner builders contain that into a failed cell (`ok:false`).
110
+ *
111
+ * `fetchImpl` defaults to global `fetch`; tests pass a fake returning a synthetic SSE `Response` so
112
+ * the body construction + decode are exercised without a network or a live server.
113
+ */
114
+ export function createAgUiClient(target, fetchImpl = fetch) {
115
+ const base = target.url.replace(/\/+$/, '');
116
+ const endpoint = `${base}/agents/${encodeURIComponent(target.agentId)}/run`;
117
+ return {
118
+ async run(input) {
119
+ const response = await fetchImpl(endpoint, {
120
+ method: 'POST',
121
+ headers: { 'Content-Type': 'application/json', Accept: 'text/event-stream' },
122
+ body: JSON.stringify({
123
+ threadId: input.threadId,
124
+ runId: input.runId,
125
+ messages: input.messages,
126
+ // The eval declares no client-fulfilled frontend tools; an empty array makes the server
127
+ // serve the run from its own statically-configured agent.
128
+ tools: [],
129
+ forwardedProps: {},
130
+ }),
131
+ });
132
+ if (!response.ok) {
133
+ throw new Error(`AG-UI server responded ${response.status} ${response.statusText || ''}`.trim());
134
+ }
135
+ if (!response.body) {
136
+ throw new Error('AG-UI server returned no response body to stream.');
137
+ }
138
+ return decodeAgUiStream(response.body);
139
+ },
140
+ };
141
+ }
142
+ /** Production factory: a real HTTP/SSE {@link AgUiClient} over the target's AG-UI endpoint. */
143
+ export const defaultAgUiClientFactory = (target) => createAgUiClient(target);
144
+ /**
145
+ * Build the injectable single-shot {@link RunCellFn} that drives ONE AG-UI run: send the cell's
146
+ * prompt as the sole `user` message (fresh `threadId`/`runId`) and return the agent's assembled text
147
+ * as the cell `answer` plus the tool names captured from the stream as `tools`. A transport/stream
148
+ * error is contained as a failed cell (`ok:false`) so one bad case can never take the whole suite
149
+ * down — matching `buildProductionRunCell`'s discipline for the gth-agent path.
150
+ *
151
+ * `tools` is ALWAYS populated (possibly `[]`) — the AG-UI wire exposes the trace — so
152
+ * `must_call`/`must_not_call` grade normally, the key difference from the ADK target.
153
+ */
154
+ export function buildAgUiRunCell(target, createClient = defaultAgUiClientFactory) {
155
+ return async (cell) => {
156
+ try {
157
+ const client = createClient(target);
158
+ const result = await client.run({
159
+ threadId: randomUUID(),
160
+ runId: randomUUID(),
161
+ messages: [{ id: randomUUID(), role: 'user', content: cell.content }],
162
+ });
163
+ return { ok: true, answer: result.answer, tools: result.tools };
164
+ }
165
+ catch (error) {
166
+ return { ok: false, error: error instanceof Error ? error.message : String(error) };
167
+ }
168
+ };
169
+ }
170
+ /**
171
+ * Build the injectable multi-turn {@link RunConversationFn} that drives a whole scripted conversation
172
+ * against the AG-UI agent, threading continuity via the `messages` array + a STABLE `threadId` across
173
+ * the turns of ONE conversation: each turn appends its `user` message, POSTs the accumulated history
174
+ * under the same `threadId`, then appends the assistant's answer so the next turn's request carries
175
+ * it. ONE `threadId` for the whole conversation; a fresh `runId` per turn.
176
+ *
177
+ * Returns one {@link TurnRunOutcome} per turn attempted (answer + per-turn tool trace). A turn that
178
+ * throws is recorded as a failed turn and ABORTS the conversation (the returned array is short) — the
179
+ * runner fails the un-run turns with a clear reason, exactly as it does for a gth-agent conversation
180
+ * that ended early.
181
+ */
182
+ export function buildAgUiRunConversation(target, createClient = defaultAgUiClientFactory) {
183
+ return async (userMessages) => {
184
+ const client = createClient(target);
185
+ const outcomes = [];
186
+ // One stable thread for the whole conversation (continuity), plus the accumulated history the
187
+ // server replays each turn (its `add_messages` reducer dedupes by id, so re-sending is safe).
188
+ const threadId = randomUUID();
189
+ const messages = [];
190
+ for (const userMessage of userMessages) {
191
+ messages.push({ id: randomUUID(), role: 'user', content: userMessage });
192
+ try {
193
+ const result = await client.run({
194
+ threadId,
195
+ runId: randomUUID(),
196
+ // Snapshot the history so the caller/test sees exactly what THIS turn sent, unaffected by
197
+ // later mutation.
198
+ messages: [...messages],
199
+ });
200
+ // Thread the assistant's answer into the history so the next turn carries it (memory).
201
+ messages.push({ id: randomUUID(), role: 'assistant', content: result.answer });
202
+ outcomes.push({ ok: true, answer: result.answer, tools: result.tools });
203
+ }
204
+ catch (error) {
205
+ outcomes.push({
206
+ ok: false,
207
+ error: error instanceof Error ? error.message : String(error),
208
+ });
209
+ // A failed turn aborts the conversation — the runner marks the remaining turns FAILed.
210
+ break;
211
+ }
212
+ }
213
+ return outcomes;
214
+ };
215
+ }
216
+ //# sourceMappingURL=agUiEvalRunner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agUiEvalRunner.js","sourceRoot":"","sources":["../../src/commands/agUiEvalRunner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAkDxC;;;;;;;;;;;;GAY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,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC;oBAC9B,QAAQ;oBACR,KAAK,EAAE,UAAU,EAAE;oBACnB,0FAA0F;oBAC1F,kBAAkB;oBAClB,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC;iBACxB,CAAC,CAAC;gBACH,uFAAuF;gBACvF,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;gBAC/E,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YAC1E,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,QAAQ,CAAC,IAAI,CAAC;oBACZ,EAAE,EAAE,KAAK;oBACT,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;iBAC9D,CAAC,CAAC;gBACH,uFAAuF;gBACvF,MAAM;YACR,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC"}
@@ -2,7 +2,7 @@ import { Command } from 'commander';
2
2
  import { CommandLineConfigOverrides } from '@gaunt-sloth/core/config.js';
3
3
  import type { GthConfig } from '@gaunt-sloth/core/config.js';
4
4
  import type { GthCommand } from '@gaunt-sloth/core/core/types.js';
5
- import type { RunCellFn } from '@gaunt-sloth/batch';
5
+ import type { RunCellFn, RunConversationFn } from '@gaunt-sloth/batch';
6
6
  /** Options for {@link buildProductionRunCell} — the bits that differ between `batch` (exec-mode,
7
7
  * script content) and `eval` (ask-mode, a case's user-message prompt); everything else about the
8
8
  * adapter (model-resolver cache, resolver cleanup, error handling) is shared. */
@@ -38,6 +38,23 @@ export interface ProductionRunCellOptions {
38
38
  * report `runSingleShot` would otherwise write is not wanted here.
39
39
  */
40
40
  export declare function buildProductionRunCell(baseConfig: GthConfig, preamble: string, commandLineConfigOverrides: CommandLineConfigOverrides, options: ProductionRunCellOptions): Promise<RunCellFn>;
41
+ /**
42
+ * BATCH-12 Task 2 — build the injectable {@link RunConversationFn} that adapts core's MULTI-TURN
43
+ * `runConversation` to `gth eval`'s conversation seam. The multi-turn analogue of
44
+ * {@link buildProductionRunCell}: same fresh-`createResolvers()` per conversation + cleanup-on-
45
+ * every-path discipline, but it runs a whole scripted conversation (agent/tools built ONCE, messages
46
+ * accumulated across turns) and returns one outcome per turn.
47
+ *
48
+ * No model axis (`gth eval` has no `--models`), so this takes the already-resolved SUT/identity
49
+ * `config` directly — mirroring how `evalCommand.ts` builds one config per identity and passes it in
50
+ * (it does NOT call `initConfig` here, so the command's `initConfig`-once-per-identity contract
51
+ * holds). `writeOutputToFile` is forced off (eval writes its own per-cell JSON via `writeEvalOutput`).
52
+ *
53
+ * A rare throw from `runConversation` (e.g. agent init failed) is deliberately NOT swallowed here:
54
+ * `runBatchMatrix` catches it as a failed cell and the runner surfaces the error on turn 1, which is
55
+ * more informative than an empty result. The `finally` still tears the resolvers down exactly once.
56
+ */
57
+ export declare function buildProductionRunConversation(config: GthConfig, preamble: string, options: ProductionRunCellOptions): Promise<RunConversationFn>;
41
58
  /** Parse `--models a,b,c` into a trimmed, non-empty list; `undefined` when the flag is absent. */
42
59
  export declare function parseModelsOption(models: string | undefined): string[] | undefined;
43
60
  /** Default output dir when `-o/--output` is omitted: a timestamped dir next to other gth reports. */
@@ -103,6 +103,61 @@ export async function buildProductionRunCell(baseConfig, preamble, commandLineCo
103
103
  }
104
104
  };
105
105
  }
106
+ /**
107
+ * BATCH-12 Task 2 — build the injectable {@link RunConversationFn} that adapts core's MULTI-TURN
108
+ * `runConversation` to `gth eval`'s conversation seam. The multi-turn analogue of
109
+ * {@link buildProductionRunCell}: same fresh-`createResolvers()` per conversation + cleanup-on-
110
+ * every-path discipline, but it runs a whole scripted conversation (agent/tools built ONCE, messages
111
+ * accumulated across turns) and returns one outcome per turn.
112
+ *
113
+ * No model axis (`gth eval` has no `--models`), so this takes the already-resolved SUT/identity
114
+ * `config` directly — mirroring how `evalCommand.ts` builds one config per identity and passes it in
115
+ * (it does NOT call `initConfig` here, so the command's `initConfig`-once-per-identity contract
116
+ * holds). `writeOutputToFile` is forced off (eval writes its own per-cell JSON via `writeEvalOutput`).
117
+ *
118
+ * A rare throw from `runConversation` (e.g. agent init failed) is deliberately NOT swallowed here:
119
+ * `runBatchMatrix` catches it as a failed cell and the runner surfaces the error on turn 1, which is
120
+ * more informative than an empty result. The `finally` still tears the resolvers down exactly once.
121
+ */
122
+ export async function buildProductionRunConversation(config, preamble, options) {
123
+ const { runConversation } = await import('@gaunt-sloth/core/runtime/conversation.js');
124
+ const { createResolvers } = await import('@gaunt-sloth/agent/resolvers.js');
125
+ const { resolveAgentFactory } = await import('@gaunt-sloth/agent/core/resolveAgentFactory.js');
126
+ const cellConfig = {
127
+ ...config,
128
+ canInterruptInferenceWithEsc: false,
129
+ writeOutputToFile: false,
130
+ };
131
+ return async (userMessages) => {
132
+ // Wrap each turn's user message the same way single-turn cells wrap their content, so a turn's
133
+ // framing matches an equivalent single-turn case exactly.
134
+ const wrapped = userMessages.map((message) => wrapContent(message, options.wrapBlockPrefix, options.wrapPrefix, true));
135
+ // Fresh resolvers (its own MCP client) per conversation, torn down once when the whole
136
+ // conversation ends — the agent/tools persist ACROSS the turns inside `runConversation`.
137
+ const resolvers = createResolvers();
138
+ try {
139
+ const turns = await runConversation(`${options.sourcePrefix}-conversation`, preamble, wrapped, cellConfig, resolvers, options.command, resolveAgentFactory(cellConfig, 'lean'));
140
+ return turns.map(({ ok, answer, tokensInput, tokensOutput, tools, error }) => ({
141
+ ok,
142
+ answer,
143
+ tokensInput,
144
+ tokensOutput,
145
+ tools,
146
+ error,
147
+ }));
148
+ }
149
+ finally {
150
+ try {
151
+ await resolvers.cleanupTools?.();
152
+ }
153
+ catch (cleanupError) {
154
+ // A cleanup failure must never mask the conversation's real result — warn only.
155
+ displayWarning(`Failed to clean up tools for conversation: ` +
156
+ `${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}`);
157
+ }
158
+ }
159
+ };
160
+ }
106
161
  /** Parse `--models a,b,c` into a trimmed, non-empty list; `undefined` when the flag is absent. */
107
162
  export function parseModelsOption(models) {
108
163
  if (!models)
@@ -1 +1 @@
1
- {"version":3,"file":"batchCommand.js","sourceRoot":"","sources":["../../src/commands/batchCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,+BAA+B,GAChC,MAAM,sCAAsC,CAAC;AAgB9C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAS,wBAAwB,CAC/B,UAAqB,EACrB,0BAAsD;IAEtD,MAAM,cAAc,GAAG,IAAI,GAAG,EAA8B,CAAC;IAE7D,OAAO,CAAC,KAAyB,EAAsB,EAAE;QACvD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC;QACD,IAAI,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,GAAG,UAAU,CAAC,EAAE,GAAG,0BAA0B,EAAE,KAAK,EAAE,CAAC,CAA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