@namzu/cli 16.0.0 → 17.0.0
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 +34 -6
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +43 -8
- package/dist/cli.js.map +1 -1
- package/dist/commands/drain.d.ts.map +1 -1
- package/dist/commands/drain.js +23 -1
- package/dist/commands/drain.js.map +1 -1
- package/dist/commands/run-stream.d.ts +3 -2
- package/dist/commands/run-stream.d.ts.map +1 -1
- package/dist/commands/run-stream.js +32 -37
- package/dist/commands/run-stream.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +26 -24
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/state.d.ts +9 -0
- package/dist/commands/state.d.ts.map +1 -0
- package/dist/commands/state.js +110 -0
- package/dist/commands/state.js.map +1 -0
- package/dist/config/load.d.ts +1 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +3 -4
- package/dist/config/load.js.map +1 -1
- package/dist/doctor/checks/chain.d.ts +1 -1
- package/dist/doctor/checks/chain.d.ts.map +1 -1
- package/dist/doctor/checks/chain.js +2 -4
- package/dist/doctor/checks/chain.js.map +1 -1
- package/dist/integrations/files/attachment-store.d.ts.map +1 -1
- package/dist/integrations/files/attachment-store.js +3 -3
- package/dist/integrations/files/attachment-store.js.map +1 -1
- package/dist/integrations/plugins/runtime.d.ts.map +1 -1
- package/dist/integrations/plugins/runtime.js +4 -2
- package/dist/integrations/plugins/runtime.js.map +1 -1
- package/dist/integrations/providers/credential-store.d.ts.map +1 -1
- package/dist/integrations/providers/credential-store.js +13 -12
- package/dist/integrations/providers/credential-store.js.map +1 -1
- package/dist/integrations/providers/preferences.d.ts.map +1 -1
- package/dist/integrations/providers/preferences.js +5 -5
- package/dist/integrations/providers/preferences.js.map +1 -1
- package/dist/integrations/sessions/store.d.ts +31 -9
- package/dist/integrations/sessions/store.d.ts.map +1 -1
- package/dist/integrations/sessions/store.js +308 -63
- package/dist/integrations/sessions/store.js.map +1 -1
- package/dist/integrations/state/home.d.ts +25 -0
- package/dist/integrations/state/home.d.ts.map +1 -0
- package/dist/integrations/state/home.js +53 -0
- package/dist/integrations/state/home.js.map +1 -0
- package/dist/integrations/state/private-directory.d.ts +15 -0
- package/dist/integrations/state/private-directory.d.ts.map +1 -0
- package/dist/integrations/state/private-directory.js +41 -0
- package/dist/integrations/state/private-directory.js.map +1 -0
- package/dist/integrations/state/report.d.ts +129 -0
- package/dist/integrations/state/report.d.ts.map +1 -0
- package/dist/integrations/state/report.js +831 -0
- package/dist/integrations/state/report.js.map +1 -0
- package/dist/integrations/subagents/activity.d.ts +18 -0
- package/dist/integrations/subagents/activity.d.ts.map +1 -1
- package/dist/integrations/subagents/activity.js +64 -7
- package/dist/integrations/subagents/activity.js.map +1 -1
- package/dist/integrations/subagents/runtime.d.ts +3 -1
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.js +46 -7
- package/dist/integrations/subagents/runtime.js.map +1 -1
- package/dist/integrations/trust/store.d.ts.map +1 -1
- package/dist/integrations/trust/store.js +6 -6
- package/dist/integrations/trust/store.js.map +1 -1
- package/dist/memory/store.d.ts.map +1 -1
- package/dist/memory/store.js +7 -7
- package/dist/memory/store.js.map +1 -1
- package/dist/skills/store.d.ts +2 -1
- package/dist/skills/store.d.ts.map +1 -1
- package/dist/skills/store.js +11 -4
- package/dist/skills/store.js.map +1 -1
- package/dist/tui/AgentExplorer.d.ts +26 -5
- package/dist/tui/AgentExplorer.d.ts.map +1 -1
- package/dist/tui/AgentExplorer.js +125 -14
- package/dist/tui/AgentExplorer.js.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +263 -96
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/agent.d.ts +10 -2
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/agent.js +87 -21
- package/dist/tui/agent.js.map +1 -1
- package/dist/tui/slashCommands.d.ts +1 -1
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/slashCommands.js +2 -2
- package/dist/tui/slashCommands.js.map +1 -1
- package/dist/user-commands/store.d.ts.map +1 -1
- package/dist/user-commands/store.js +29 -7
- package/dist/user-commands/store.js.map +1 -1
- package/package.json +2 -2
package/dist/tui/agent.d.ts
CHANGED
|
@@ -65,6 +65,8 @@ export type AgentEvent = {
|
|
|
65
65
|
readonly toolName: string;
|
|
66
66
|
readonly isError: boolean;
|
|
67
67
|
readonly summary: string;
|
|
68
|
+
/** Kernel-measured execution time; independent of host event buffering. */
|
|
69
|
+
readonly durationMs?: number;
|
|
68
70
|
/** A successful result intentionally adds no second transcript row. */
|
|
69
71
|
readonly hidden?: boolean;
|
|
70
72
|
/** Output lines shown (collapsible) under the result. */
|
|
@@ -546,8 +548,8 @@ export interface AgentSessionOptions {
|
|
|
546
548
|
readonly scope?: RunScope;
|
|
547
549
|
/**
|
|
548
550
|
* The directory the agent works in: what every filesystem tool resolves a
|
|
549
|
-
* relative path against
|
|
550
|
-
*
|
|
551
|
+
* relative path against and where sub-agents run. Generated task and memory
|
|
552
|
+
* state follows {@link stateRoot}. Defaults to the process's own directory.
|
|
551
553
|
*
|
|
552
554
|
* Taken as an argument rather than read from `process.cwd()` at each of
|
|
553
555
|
* those four points, which is what let `--cwd` reach the session store and
|
|
@@ -556,6 +558,12 @@ export interface AgentSessionOptions {
|
|
|
556
558
|
* having looked in the wrong place.
|
|
557
559
|
*/
|
|
558
560
|
readonly cwd?: string;
|
|
561
|
+
/**
|
|
562
|
+
* Injected SDK hierarchy root for this host session. When present, runs use
|
|
563
|
+
* this exact path builder and generated memory/tasks live inside the scoped
|
|
564
|
+
* Project. Absent preserves the embedded API's historical cwd-local layout.
|
|
565
|
+
*/
|
|
566
|
+
readonly stateRoot?: string;
|
|
559
567
|
/**
|
|
560
568
|
* Operator-authored tool rules, already compiled to the kernel's vocabulary.
|
|
561
569
|
*
|
package/d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AAE,YAAY,GAAG,MAAM,CASxD"}
|
package/dist/tui/agent.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* `emptySession()` whose `send()` yields a single error event so the UI
|
|
21
21
|
* renders an actionable hint rather than crashing.
|
|
22
22
|
*/
|
|
23
|
-
import { BOOT_EVENT_NAMES, DiskMemoryStore, DiskTaskStore, EVENT_NAME_ATTRIBUTE, ProviderRegistry, SESSION_GOAL_TOOL_NAMES, SearchToolsTool, ToolRegistry, asProjectId, asRunId, asSessionId, asTenantId, asTopicId, buildMemoryTools, buildSessionGoalTools, compactNow, createComputerUseTool, createMemoryPromoter, createToolPresenter, generateRunId, getBuiltinTools, isTrustedReadOnly, query, resumeRun, withProviderFallback, } from '@namzu/sdk';
|
|
23
|
+
import { BOOT_EVENT_NAMES, DefaultPathBuilder, DiskMemoryStore, DiskTaskStore, EVENT_NAME_ATTRIBUTE, ProviderRegistry, SESSION_GOAL_TOOL_NAMES, SearchToolsTool, ToolRegistry, asProjectId, asRunId, asSessionId, asTenantId, asTopicId, buildMemoryTools, buildSessionGoalTools, compactNow, createComputerUseTool, createMemoryPromoter, createToolPresenter, generateRunId, getBuiltinTools, isTrustedReadOnly, query, resumeRun, withProviderFallback, } from '@namzu/sdk';
|
|
24
24
|
import { SubprocessComputerUseHost } from '@namzu/computer-use';
|
|
25
25
|
import { realpath, stat } from 'node:fs/promises';
|
|
26
26
|
import { join, parse, resolve } from 'node:path';
|
|
@@ -31,6 +31,7 @@ import { resolveSandbox, sandboxResolvedSeverity, } from '../context/sandbox.js'
|
|
|
31
31
|
import { connectMcpServers, } from '../integrations/mcp/servers.js';
|
|
32
32
|
import { createCliPluginRuntime } from '../integrations/plugins/runtime.js';
|
|
33
33
|
import { CredentialRefreshRejectedError, CredentialWithdrawnError, PROVIDER_REGISTRY, chainCapabilityDisagreements, chainPositionName, describeAcceptedMismatch, describeCapabilityRefusal, discoverProviders, ensureFreshAnthropicToken, ensureFreshStoredCodexCredential, ensureRegistered, findDetected, isAnthropicOAuthToken, isRegistered, missingCredentialMessage, primaryProvider, readCodexCredentialFile, readPreferences, readSubscriptionCredential, resolveChainCapabilities, sameOAuthCredential, unresolvedMembers, unsupportedProviderMessage, } from '../integrations/providers/index.js';
|
|
34
|
+
import { ensurePrivateStateDirectory } from '../integrations/state/private-directory.js';
|
|
34
35
|
import { createSubagentRuntime } from '../integrations/subagents/runtime.js';
|
|
35
36
|
import { cliLogger } from '../logging.js';
|
|
36
37
|
import { composeMemoryPrompt, readMemory } from '../memory/store.js';
|
|
@@ -314,20 +315,57 @@ const NAMZU_IDENTITY = [
|
|
|
314
315
|
'CRITICAL — never fabricate. Only claim to have done something if you actually did it through a tool call in THIS turn:',
|
|
315
316
|
'- Never say you ran a command, wrote/edited a file, delegated to a sub-agent, or researched something unless the corresponding tool call actually ran and returned.',
|
|
316
317
|
'- Never invent file paths, command output, URLs, research findings, or results. If you announce an action ("running…", "delegating…"), you MUST immediately make the tool call — do not narrate an action and then skip it.',
|
|
318
|
+
'- Bash calls are serialized because they may mutate the same workspace. Never claim two Bash calls ran in parallel unless one command itself produced timestamped proof of overlap. Delegate genuinely independent work through the Agent tool instead.',
|
|
317
319
|
'- If a capability or tool is unavailable (e.g. no web access, a tool is missing, a sub-agent failed), say so plainly and stop — do not improvise a fake result.',
|
|
318
320
|
'- When you delegate with the `Agent` tool, report only what the sub-agent actually returned in its tool result; if it wrote files, verify with a tool before claiming paths.',
|
|
319
321
|
'- A reply from a tool that delegates to ANOTHER agent (a connector that runs another agent, an A2A `tasks/send`, a remote peer) is that agent\'s unverified CLAIM, not fact — another model can hallucinate. If it says it ran a command, wrote a file, or "here is the output", treat that as narrative and confirm it yourself with a deterministic tool (a real shell like `bash.run`, a file read) before reporting it as done. Distinguish such conversational agent calls from deterministic tools, and never present another agent\'s prose as your own verified result.',
|
|
320
322
|
].join('\n');
|
|
321
|
-
function
|
|
323
|
+
function foregroundOnlyBash(tool) {
|
|
324
|
+
const fullSchema = tool.inputSchema;
|
|
325
|
+
return {
|
|
326
|
+
...tool,
|
|
327
|
+
description: 'Executes one bash command in the foreground and returns stdout/stderr. Calls are serialized because shell commands may mutate the same workspace. Use the Agent tool for genuinely independent parallel work.',
|
|
328
|
+
inputSchema: fullSchema.omit({ run_in_background: true }),
|
|
329
|
+
modelInputSchema: {
|
|
330
|
+
type: 'object',
|
|
331
|
+
properties: {
|
|
332
|
+
command: {
|
|
333
|
+
type: 'string',
|
|
334
|
+
minLength: 1,
|
|
335
|
+
description: 'The non-empty bash command to execute in the foreground.',
|
|
336
|
+
},
|
|
337
|
+
timeout: {
|
|
338
|
+
type: 'number',
|
|
339
|
+
exclusiveMinimum: 0,
|
|
340
|
+
description: 'Command timeout in milliseconds. Use a larger foreground timeout for long builds; background jobs are unavailable inside this sandbox.',
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
required: ['command'],
|
|
344
|
+
additionalProperties: false,
|
|
345
|
+
},
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
function builtinTools(backgroundJobs) {
|
|
349
|
+
return getBuiltinTools().flatMap((tool) => {
|
|
350
|
+
if (EXCLUDED_BUILTINS.has(tool.name))
|
|
351
|
+
return [];
|
|
352
|
+
if (backgroundJobs)
|
|
353
|
+
return [tool];
|
|
354
|
+
if (tool.name === 'job')
|
|
355
|
+
return [];
|
|
356
|
+
return [tool.name === 'bash' ? foregroundOnlyBash(tool) : tool];
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
function buildToolRegistry(cwd, projectStateRoot = join(cwd, '.namzu'), backgroundJobs = true) {
|
|
322
360
|
const registry = new ToolRegistry();
|
|
323
|
-
registry.register(
|
|
361
|
+
registry.register(builtinTools(backgroundJobs));
|
|
324
362
|
// SDK memory: the agent gets search_memory / read_memory / save_memory over
|
|
325
|
-
// a structured store
|
|
326
|
-
//
|
|
327
|
-
//
|
|
328
|
-
// why it sat on the no-prompt list; it writes into the user's project.
|
|
363
|
+
// a structured store in this Project's generated-state directory. CLI
|
|
364
|
+
// surfaces inject the central application-home hierarchy; embedded callers
|
|
365
|
+
// that omit it retain the historical `<cwd>/.namzu` layout.
|
|
329
366
|
// Separate from the user-curated MEMORY.md that is injected into the prompt.
|
|
330
|
-
|
|
367
|
+
ensurePrivateStateDirectory(projectStateRoot, 'memory');
|
|
368
|
+
const memoryStore = new DiskMemoryStore({ baseDir: projectStateRoot });
|
|
331
369
|
// Search through the store's async boundary. Its concrete index is lazy:
|
|
332
370
|
// handing `getIndex()` to the synchronous overload before the first store
|
|
333
371
|
// read makes a new process report every persisted memory as absent.
|
|
@@ -369,6 +407,24 @@ export async function createAgentSession(prefs, detected, options = {}) {
|
|
|
369
407
|
cwd === parse(cwd).root) {
|
|
370
408
|
return emptySession(`Working-directory sandboxing refuses filesystem root ${cwd}; choose a project directory so confinement has a boundary, or explicitly select an ephemeral workspace.`, 'invocation');
|
|
371
409
|
}
|
|
410
|
+
const hierarchyRoot = resolve(options.stateRoot ?? join(cwd, '.namzu'));
|
|
411
|
+
const pathBuilder = new DefaultPathBuilder(hierarchyRoot);
|
|
412
|
+
let projectStateRoot = hierarchyRoot;
|
|
413
|
+
try {
|
|
414
|
+
if (options.stateRoot) {
|
|
415
|
+
const projectsRoot = ensurePrivateStateDirectory(hierarchyRoot, 'projects');
|
|
416
|
+
projectStateRoot = ensurePrivateStateDirectory(projectsRoot, scope.projectId);
|
|
417
|
+
}
|
|
418
|
+
// Refuse an aliased or otherwise unsafe generated-state root before any
|
|
419
|
+
// provider, sandbox or plugin runtime is constructed. Project-authored
|
|
420
|
+
// `.namzu` content may coexist here, but generated memory must never be
|
|
421
|
+
// redirected outside the trusted working directory through an ancestor
|
|
422
|
+
// symlink.
|
|
423
|
+
ensurePrivateStateDirectory(projectStateRoot, 'memory');
|
|
424
|
+
}
|
|
425
|
+
catch (error) {
|
|
426
|
+
return emptySession(`Project state is unavailable: ${describeError(error)}`, 'environment');
|
|
427
|
+
}
|
|
372
428
|
// The head serves; the tail is fallen over to, in order, when it cannot.
|
|
373
429
|
const primary = primaryProvider(prefs);
|
|
374
430
|
const entry = PROVIDER_REGISTRY[primary.id];
|
|
@@ -654,7 +710,8 @@ export async function createAgentSession(prefs, detected, options = {}) {
|
|
|
654
710
|
[EVENT_NAME_ATTRIBUTE]: BOOT_EVENT_NAMES.SANDBOX_RESOLVED,
|
|
655
711
|
'namzu.sandbox.unconfined': sandbox.unconfined,
|
|
656
712
|
});
|
|
657
|
-
const
|
|
713
|
+
const backgroundJobs = sandbox.provider === undefined;
|
|
714
|
+
const { registry, memoryStore } = buildToolRegistry(cwd, projectStateRoot, backgroundJobs);
|
|
658
715
|
// Package presence is not tool reachability. The CLI used to probe and
|
|
659
716
|
// report @namzu/computer-use without ever constructing its host or mounting
|
|
660
717
|
// SDK's computer_use definition, so even an installed, healthy package was
|
|
@@ -745,6 +802,7 @@ export async function createAgentSession(prefs, detected, options = {}) {
|
|
|
745
802
|
const sub = await createSubagentRuntime({
|
|
746
803
|
cwd,
|
|
747
804
|
model,
|
|
805
|
+
pathBuilder: new DefaultPathBuilder(join(projectStateRoot, 'subagents')),
|
|
748
806
|
sandboxWorkspace,
|
|
749
807
|
resolveResumeHandler: (runId) => delegatedResumeHandlers.get(runId),
|
|
750
808
|
...(sandbox.provider ? { sandboxProvider: sandbox.provider } : {}),
|
|
@@ -785,7 +843,7 @@ export async function createAgentSession(prefs, detected, options = {}) {
|
|
|
785
843
|
// delegation, and a parent that delegated six times would leave
|
|
786
844
|
// seven accounts of one piece of work for the next run to read.
|
|
787
845
|
// The parent's settle is the one that speaks for the whole task.
|
|
788
|
-
return buildToolRegistry(cwd).registry;
|
|
846
|
+
return buildToolRegistry(cwd, projectStateRoot, backgroundJobs).registry;
|
|
789
847
|
},
|
|
790
848
|
authorizationGate: gateFor(options.rules),
|
|
791
849
|
});
|
|
@@ -817,8 +875,9 @@ export async function createAgentSession(prefs, detected, options = {}) {
|
|
|
817
875
|
// It is also why `toolNames` below reads the registry rather than a list
|
|
818
876
|
// captured on this line. The count at connect time is unchanged; what
|
|
819
877
|
// changes is that asking again later gets a later answer.
|
|
878
|
+
ensurePrivateStateDirectory(projectStateRoot, 'tenants');
|
|
820
879
|
const taskStore = new DiskTaskStore({
|
|
821
|
-
baseDir:
|
|
880
|
+
baseDir: projectStateRoot,
|
|
822
881
|
defaultRunId: asRunId('run_namzu-cli'),
|
|
823
882
|
tenantId: scope.tenantId,
|
|
824
883
|
});
|
|
@@ -1049,6 +1108,7 @@ export async function createAgentSession(prefs, detected, options = {}) {
|
|
|
1049
1108
|
skillRegistry: pluginRuntime?.skills,
|
|
1050
1109
|
skills: pluginSkills,
|
|
1051
1110
|
scope,
|
|
1111
|
+
pathBuilder,
|
|
1052
1112
|
workingDirectory: cwd,
|
|
1053
1113
|
sandboxWorkspace,
|
|
1054
1114
|
rules: options.rules,
|
|
@@ -1117,6 +1177,7 @@ export async function createAgentSession(prefs, detected, options = {}) {
|
|
|
1117
1177
|
authorizationGate: gateFor(options.rules),
|
|
1118
1178
|
compactionConfig: COMPACTION_CONFIG,
|
|
1119
1179
|
projectInstructionContext: projectInstructions.createRunContext(),
|
|
1180
|
+
pathBuilder,
|
|
1120
1181
|
...(sandbox.provider ? { sandboxProvider: sandbox.provider } : {}),
|
|
1121
1182
|
...(options.sandbox?.teardownTimeoutMs !== undefined
|
|
1122
1183
|
? { sandboxTeardownTimeoutMs: options.sandbox.teardownTimeoutMs }
|
|
@@ -1500,9 +1561,8 @@ function gateFor(rules) {
|
|
|
1500
1561
|
const COMPACTION_CONFIG = {
|
|
1501
1562
|
strategy: 'structured',
|
|
1502
1563
|
// On, and this is the CLI making a choice rather than taking a default.
|
|
1503
|
-
// A
|
|
1504
|
-
//
|
|
1505
|
-
// this costs is theirs to see and theirs to turn off.
|
|
1564
|
+
// A session's transcript is the only record of what was compacted away;
|
|
1565
|
+
// the size trade this costs is the operator's to see and turn off.
|
|
1506
1566
|
recordShedHistory: true,
|
|
1507
1567
|
triggerThreshold: 0.7,
|
|
1508
1568
|
resetThreshold: 0.4,
|
|
@@ -1527,7 +1587,7 @@ const COMPACTION_CONFIG = {
|
|
|
1527
1587
|
maxCharsPerRequirement: 300,
|
|
1528
1588
|
maxCharsPerTask: 400,
|
|
1529
1589
|
};
|
|
1530
|
-
async function* runTurn({ provider, fallbackProviders, model, tools, pluginManager, skillRegistry, skills, scope, workingDirectory, sandboxWorkspace, rules, reviewAnswer, maxAnswerReviews, promoteMemory, resumeHandler, taskStore, systemPrompt, messages, projectInstructionContext, opts, taskGateway, sandboxProvider, sandboxTeardownTimeoutMs, onRunEvent, }) {
|
|
1590
|
+
async function* runTurn({ provider, fallbackProviders, model, tools, pluginManager, skillRegistry, skills, scope, pathBuilder, workingDirectory, sandboxWorkspace, rules, reviewAnswer, maxAnswerReviews, promoteMemory, resumeHandler, taskStore, systemPrompt, messages, projectInstructionContext, opts, taskGateway, sandboxProvider, sandboxTeardownTimeoutMs, onRunEvent, }) {
|
|
1531
1591
|
const signal = opts?.signal;
|
|
1532
1592
|
// One presenter for the whole stream, built from the registry this scope
|
|
1533
1593
|
// already holds. Its absence HERE is what forced presentation to be name
|
|
@@ -1537,6 +1597,7 @@ async function* runTurn({ provider, fallbackProviders, model, tools, pluginManag
|
|
|
1537
1597
|
try {
|
|
1538
1598
|
const events = query({
|
|
1539
1599
|
provider,
|
|
1600
|
+
pathBuilder,
|
|
1540
1601
|
...(opts?.runId ? { runId: opts.runId } : {}),
|
|
1541
1602
|
// Omitted rather than empty when there is no tail. `query` treats the
|
|
1542
1603
|
// two the same, but an absent option reads as "this run has no chain"
|
|
@@ -1561,7 +1622,8 @@ async function* runTurn({ provider, fallbackProviders, model, tools, pluginManag
|
|
|
1561
1622
|
compactionConfig: COMPACTION_CONFIG,
|
|
1562
1623
|
// The CLI owns its process end to end, so it can safely hand the
|
|
1563
1624
|
// termination path to the kernel: a Ctrl-C mid-run now leaves a
|
|
1564
|
-
// dump under
|
|
1625
|
+
// dump under the injected hierarchy's emergency partition instead of
|
|
1626
|
+
// losing the turn.
|
|
1565
1627
|
emergencySave: true,
|
|
1566
1628
|
runConfig: {
|
|
1567
1629
|
model,
|
|
@@ -1818,12 +1880,16 @@ export function toAgentEvent(event, presenter) {
|
|
|
1818
1880
|
success: !event.isError,
|
|
1819
1881
|
output: event.result,
|
|
1820
1882
|
});
|
|
1883
|
+
const summary = firstLine(event.result);
|
|
1884
|
+
const detail = viewToLines(view);
|
|
1885
|
+
const withoutRepeatedSummary = view.kind === 'terminal' && detail?.[0] === summary ? detail.slice(1) : detail;
|
|
1821
1886
|
return {
|
|
1822
1887
|
kind: 'tool-end',
|
|
1823
1888
|
toolUseId: event.toolUseId,
|
|
1824
1889
|
toolName: event.toolName,
|
|
1825
1890
|
isError: event.isError,
|
|
1826
|
-
summary
|
|
1891
|
+
summary,
|
|
1892
|
+
...(event.durationMs !== undefined ? { durationMs: event.durationMs } : {}),
|
|
1827
1893
|
...(view.kind === 'generic' && view.visibility === 'hidden' ? { hidden: true } : {}),
|
|
1828
1894
|
// `tool_completed` carries no input, so the presenter gets an
|
|
1829
1895
|
// empty one. A tool whose result rendering depends on its
|
|
@@ -1831,7 +1897,9 @@ export function toAgentEvent(event, presenter) {
|
|
|
1831
1897
|
// through; none does yet, and inventing the plumbing for a
|
|
1832
1898
|
// caller that does not exist is the declaration this repo
|
|
1833
1899
|
// keeps deleting.
|
|
1834
|
-
|
|
1900
|
+
...(withoutRepeatedSummary && withoutRepeatedSummary.length > 0
|
|
1901
|
+
? { detail: withoutRepeatedSummary }
|
|
1902
|
+
: {}),
|
|
1835
1903
|
};
|
|
1836
1904
|
}
|
|
1837
1905
|
case 'token_usage_updated':
|
|
@@ -1942,9 +2010,7 @@ export function toAgentEvent(event, presenter) {
|
|
|
1942
2010
|
// so this one says what IT cost rather than claiming the total.
|
|
1943
2011
|
return {
|
|
1944
2012
|
kind: 'context',
|
|
1945
|
-
text: `cleared ${event.clearedCount} oversized tool result${event.clearedCount === 1 ? '' : 's'}
|
|
1946
|
-
` (~${event.reclaimedTokens.toLocaleString()} tokens)` +
|
|
1947
|
-
(event.reliefWasEnough ? '' : ' — not enough, compacting'),
|
|
2013
|
+
text: `cleared ${event.clearedCount} oversized tool result${event.clearedCount === 1 ? '' : 's'} (~${event.reclaimedTokens.toLocaleString()} tokens)${event.reliefWasEnough ? '' : ' — not enough, compacting'}`,
|
|
1948
2014
|
shed: true,
|
|
1949
2015
|
};
|
|
1950
2016
|
case 'compaction_failed':
|