@namzu/cli 14.3.0 → 15.1.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.
Files changed (149) hide show
  1. package/README.md +117 -17
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +26 -26
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/acp.d.ts.map +1 -1
  6. package/dist/commands/acp.js +3 -2
  7. package/dist/commands/acp.js.map +1 -1
  8. package/dist/commands/doctor.d.ts.map +1 -1
  9. package/dist/commands/doctor.js +2 -0
  10. package/dist/commands/doctor.js.map +1 -1
  11. package/dist/commands/login.d.ts +2 -0
  12. package/dist/commands/login.d.ts.map +1 -1
  13. package/dist/commands/login.js +45 -7
  14. package/dist/commands/login.js.map +1 -1
  15. package/dist/commands/run.d.ts.map +1 -1
  16. package/dist/commands/run.js +36 -12
  17. package/dist/commands/run.js.map +1 -1
  18. package/dist/commands/{stubs.d.ts → serve.d.ts} +1 -10
  19. package/dist/commands/serve.d.ts.map +1 -0
  20. package/dist/commands/{stubs.js → serve.js} +1 -24
  21. package/dist/commands/serve.js.map +1 -0
  22. package/dist/commands/skills.d.ts +19 -0
  23. package/dist/commands/skills.d.ts.map +1 -0
  24. package/dist/commands/skills.js +107 -0
  25. package/dist/commands/skills.js.map +1 -0
  26. package/dist/integrations/mcp/servers.d.ts +7 -0
  27. package/dist/integrations/mcp/servers.d.ts.map +1 -1
  28. package/dist/integrations/mcp/servers.js +33 -8
  29. package/dist/integrations/mcp/servers.js.map +1 -1
  30. package/dist/integrations/sessions/store.d.ts +8 -0
  31. package/dist/integrations/sessions/store.d.ts.map +1 -1
  32. package/dist/integrations/sessions/store.js +15 -0
  33. package/dist/integrations/sessions/store.js.map +1 -1
  34. package/dist/integrations/subagents/runtime.d.ts +2 -0
  35. package/dist/integrations/subagents/runtime.d.ts.map +1 -1
  36. package/dist/integrations/subagents/runtime.js +86 -13
  37. package/dist/integrations/subagents/runtime.js.map +1 -1
  38. package/dist/integrations/updates.d.ts.map +1 -1
  39. package/dist/integrations/updates.js +29 -4
  40. package/dist/integrations/updates.js.map +1 -1
  41. package/dist/tui/App.d.ts +10 -1
  42. package/dist/tui/App.d.ts.map +1 -1
  43. package/dist/tui/App.js +1039 -252
  44. package/dist/tui/App.js.map +1 -1
  45. package/dist/tui/ChoicePicker.d.ts +2 -1
  46. package/dist/tui/ChoicePicker.d.ts.map +1 -1
  47. package/dist/tui/ChoicePicker.js +10 -6
  48. package/dist/tui/ChoicePicker.js.map +1 -1
  49. package/dist/tui/Composer.d.ts +19 -2
  50. package/dist/tui/Composer.d.ts.map +1 -1
  51. package/dist/tui/Composer.js +526 -70
  52. package/dist/tui/Composer.js.map +1 -1
  53. package/dist/tui/CopyPicker.d.ts.map +1 -1
  54. package/dist/tui/CopyPicker.js +3 -4
  55. package/dist/tui/CopyPicker.js.map +1 -1
  56. package/dist/tui/EditPromptPicker.d.ts.map +1 -1
  57. package/dist/tui/EditPromptPicker.js +3 -4
  58. package/dist/tui/EditPromptPicker.js.map +1 -1
  59. package/dist/tui/Markdown.d.ts +3 -1
  60. package/dist/tui/Markdown.d.ts.map +1 -1
  61. package/dist/tui/Markdown.js +11 -9
  62. package/dist/tui/Markdown.js.map +1 -1
  63. package/dist/tui/PermissionOverlay.d.ts +11 -6
  64. package/dist/tui/PermissionOverlay.d.ts.map +1 -1
  65. package/dist/tui/PermissionOverlay.js +13 -20
  66. package/dist/tui/PermissionOverlay.js.map +1 -1
  67. package/dist/tui/Picker.d.ts.map +1 -1
  68. package/dist/tui/Picker.js +47 -11
  69. package/dist/tui/Picker.js.map +1 -1
  70. package/dist/tui/ResumePicker.d.ts.map +1 -1
  71. package/dist/tui/ResumePicker.js +6 -1
  72. package/dist/tui/ResumePicker.js.map +1 -1
  73. package/dist/tui/StatusBar.js +3 -3
  74. package/dist/tui/StatusBar.js.map +1 -1
  75. package/dist/tui/TextPrompt.d.ts +21 -0
  76. package/dist/tui/TextPrompt.d.ts.map +1 -0
  77. package/dist/tui/TextPrompt.js +139 -0
  78. package/dist/tui/TextPrompt.js.map +1 -0
  79. package/dist/tui/Transcript.d.ts +9 -10
  80. package/dist/tui/Transcript.d.ts.map +1 -1
  81. package/dist/tui/Transcript.js +11 -12
  82. package/dist/tui/Transcript.js.map +1 -1
  83. package/dist/tui/agent.d.ts +57 -23
  84. package/dist/tui/agent.d.ts.map +1 -1
  85. package/dist/tui/agent.js +136 -86
  86. package/dist/tui/agent.js.map +1 -1
  87. package/dist/tui/exit-summary.d.ts.map +1 -1
  88. package/dist/tui/exit-summary.js +2 -1
  89. package/dist/tui/exit-summary.js.map +1 -1
  90. package/dist/tui/external-editor.d.ts +25 -0
  91. package/dist/tui/external-editor.d.ts.map +1 -0
  92. package/dist/tui/external-editor.js +169 -0
  93. package/dist/tui/external-editor.js.map +1 -0
  94. package/dist/tui/index.d.ts.map +1 -1
  95. package/dist/tui/index.js +4 -0
  96. package/dist/tui/index.js.map +1 -1
  97. package/dist/tui/live-window.d.ts +17 -11
  98. package/dist/tui/live-window.d.ts.map +1 -1
  99. package/dist/tui/live-window.js +64 -20
  100. package/dist/tui/live-window.js.map +1 -1
  101. package/dist/tui/login-prompt.d.ts +2 -0
  102. package/dist/tui/login-prompt.d.ts.map +1 -1
  103. package/dist/tui/login-prompt.js +8 -1
  104. package/dist/tui/login-prompt.js.map +1 -1
  105. package/dist/tui/mentions.d.ts +19 -0
  106. package/dist/tui/mentions.d.ts.map +1 -1
  107. package/dist/tui/mentions.js +96 -5
  108. package/dist/tui/mentions.js.map +1 -1
  109. package/dist/tui/permission-review.d.ts +59 -0
  110. package/dist/tui/permission-review.d.ts.map +1 -0
  111. package/dist/tui/permission-review.js +219 -0
  112. package/dist/tui/permission-review.js.map +1 -0
  113. package/dist/tui/run-interruption.d.ts +14 -0
  114. package/dist/tui/run-interruption.d.ts.map +1 -0
  115. package/dist/tui/run-interruption.js +67 -0
  116. package/dist/tui/run-interruption.js.map +1 -0
  117. package/dist/tui/selection-window.d.ts +18 -0
  118. package/dist/tui/selection-window.d.ts.map +1 -0
  119. package/dist/tui/selection-window.js +37 -0
  120. package/dist/tui/selection-window.js.map +1 -0
  121. package/dist/tui/slashCommands.d.ts +48 -8
  122. package/dist/tui/slashCommands.d.ts.map +1 -1
  123. package/dist/tui/slashCommands.js +129 -47
  124. package/dist/tui/slashCommands.js.map +1 -1
  125. package/dist/tui/terminal-hyperlinks.d.ts +20 -0
  126. package/dist/tui/terminal-hyperlinks.d.ts.map +1 -0
  127. package/dist/tui/terminal-hyperlinks.js +70 -0
  128. package/dist/tui/terminal-hyperlinks.js.map +1 -0
  129. package/dist/tui/types.d.ts +2 -0
  130. package/dist/tui/types.d.ts.map +1 -1
  131. package/dist/tui/use-selection-index.d.ts +8 -0
  132. package/dist/tui/use-selection-index.d.ts.map +1 -0
  133. package/dist/tui/use-selection-index.js +13 -0
  134. package/dist/tui/use-selection-index.js.map +1 -0
  135. package/dist/tui/workspace-review.d.ts +15 -0
  136. package/dist/tui/workspace-review.d.ts.map +1 -0
  137. package/dist/tui/workspace-review.js +67 -0
  138. package/dist/tui/workspace-review.js.map +1 -0
  139. package/dist/version.d.ts +10 -0
  140. package/dist/version.d.ts.map +1 -0
  141. package/dist/version.js +23 -0
  142. package/dist/version.js.map +1 -0
  143. package/package.json +8 -7
  144. package/dist/commands/stubs.d.ts.map +0 -1
  145. package/dist/commands/stubs.js.map +0 -1
  146. package/dist/tui/bottom-spacer.d.ts +0 -95
  147. package/dist/tui/bottom-spacer.d.ts.map +0 -1
  148. package/dist/tui/bottom-spacer.js +0 -83
  149. package/dist/tui/bottom-spacer.js.map +0 -1
@@ -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 { type AuthorizationRule, type CheckpointStore, type CompactionResult, type CostInfo, type DurableRunEntry, type FencingToken, type GoalRoundAuthority, type LLMProvider, type Message, type ModelInfo, type ProjectId, type ReasoningEffort, type ResumeHandler, type ResumeOutcome, type ReviewAnswer, type RunEvent, type RunId, type SessionGoalStore, type SessionId, type StopReason, type TenantId, type ToolCallSummary, type ToolCallView, type ToolPresenter, ToolRegistry, type TopicId } from '@namzu/sdk';
23
+ import { type AuthorizationRule, type CheckpointStore, type CompactionResult, type CostInfo, type DurableRunEntry, type FencingToken, type GoalRoundAuthority, type LLMProvider, type Message, type ModelInfo, type ProjectId, type ReasoningEffort, type ResumeHandler, type ResumeOutcome, type ReviewAnswer, type RunEvent, type RunId, type SessionGoalStore, type SessionId, type StopReason, type TenantId, type ToolCallSummary, type ToolCallView, type ToolPresenter, ToolRegistry, type ToolResultView, type TopicId } from '@namzu/sdk';
24
24
  import type { PluginConfig, SandboxConfig } from '../config/schema.js';
25
25
  import { type SandboxSummary } from '../context/sandbox.js';
26
26
  import { type ConnectedMcpServer, type FailedMcpServer, type McpServersConfig } from '../integrations/mcp/servers.js';
@@ -47,6 +47,8 @@ export type AgentEvent = {
47
47
  readonly toolUseId: string;
48
48
  readonly toolName: string;
49
49
  readonly summary: string;
50
+ /** The tool authored a complete activity label; do not wrap its registry name. */
51
+ readonly standalone?: boolean;
50
52
  /** Diff / content preview shown (collapsible) under the call. */
51
53
  readonly detail?: readonly string[];
52
54
  } | {
@@ -62,6 +64,8 @@ export type AgentEvent = {
62
64
  readonly toolName: string;
63
65
  readonly isError: boolean;
64
66
  readonly summary: string;
67
+ /** A successful result intentionally adds no second transcript row. */
68
+ readonly hidden?: boolean;
65
69
  /** Output lines shown (collapsible) under the result. */
66
70
  readonly detail?: readonly string[];
67
71
  } | {
@@ -136,6 +140,9 @@ export type AgentEvent = {
136
140
  readonly capability: Extract<RunEvent, {
137
141
  type: 'capability_warning';
138
142
  }>['capability'];
143
+ readonly contentSource?: Extract<RunEvent, {
144
+ type: 'capability_warning';
145
+ }>['contentSource'];
139
146
  readonly text: string;
140
147
  } | {
141
148
  readonly kind: 'history-repair';
@@ -161,18 +168,40 @@ export type AgentEvent = {
161
168
  | {
162
169
  readonly kind: 'done';
163
170
  readonly stopReason?: StopReason;
171
+ } | {
172
+ /** A recoverable run stopped with an addressable checkpoint. */
173
+ readonly kind: 'paused';
174
+ readonly checkpointId: string;
175
+ readonly reason: string;
176
+ readonly failure?: Extract<RunEvent, {
177
+ type: 'run_paused';
178
+ }>['failure'];
179
+ readonly providerError?: Extract<RunEvent, {
180
+ type: 'run_paused';
181
+ }>['providerError'];
182
+ readonly explanation?: Extract<RunEvent, {
183
+ type: 'run_paused';
184
+ }>['explanation'];
164
185
  } | {
165
186
  readonly kind: 'error';
166
187
  readonly message: string;
188
+ readonly failure?: Extract<RunEvent, {
189
+ type: 'run_failed';
190
+ }>['failure'];
191
+ readonly providerError?: Extract<RunEvent, {
192
+ type: 'run_failed';
193
+ }>['providerError'];
194
+ readonly explanation?: Extract<RunEvent, {
195
+ type: 'run_failed';
196
+ }>['explanation'];
167
197
  };
168
198
  /** A single tool the model wants to run, surfaced to the user for approval. */
169
199
  export interface PermissionToolCall {
170
200
  readonly id: string;
171
201
  readonly name: string;
172
- readonly summary: string;
202
+ /** Exact detached input the kernel prepared and the approval covers. */
203
+ readonly input: unknown;
173
204
  readonly isDestructive: boolean;
174
- /** Optional multi-line preview (e.g. content to write, edit diff). */
175
- readonly preview?: readonly string[];
176
205
  }
177
206
  export interface PermissionRequest {
178
207
  readonly toolCalls: readonly PermissionToolCall[];
@@ -271,6 +300,13 @@ export interface AgentSession {
271
300
  * always publishes the field.
272
301
  */
273
302
  readonly reasoningEffortLevels?: readonly ReasoningEffort[];
303
+ /**
304
+ * The exact level used when this model receives no explicit effort.
305
+ *
306
+ * Optional because some provider/model routes cannot publish one. A
307
+ * directional shortcut must not guess an anchor when it is absent.
308
+ */
309
+ readonly reasoningEffortDefault?: ReasoningEffort;
274
310
  /**
275
311
  * Every tool this session can call, by name, read at call time.
276
312
  *
@@ -348,16 +384,21 @@ export interface AgentSession {
348
384
  readonly path: string;
349
385
  readonly reason: string;
350
386
  }[];
351
- /** External tool servers that connected, and how many tools each brought. */
387
+ /** External tool servers whose transports are connected right now. */
352
388
  readonly mcpConnected: readonly ConnectedMcpServer[];
353
389
  /**
354
- * External tool servers that were configured and are NOT here, with why.
390
+ * External tool servers that are NOT available right now, with why.
355
391
  *
356
392
  * The hazard this feature carries is an operator who declares a server,
357
393
  * watches the agent run without its tools and concludes the model is bad at
358
394
  * the task. An empty tool list is not a signal; a named failure is.
359
395
  */
360
396
  readonly mcpFailed: readonly FailedMcpServer[];
397
+ /** One coherent present-tense view for operator surfaces such as `/mcp`. */
398
+ readonly mcpStatus?: () => {
399
+ readonly connected: readonly ConnectedMcpServer[];
400
+ readonly failed: readonly FailedMcpServer[];
401
+ };
361
402
  /**
362
403
  * Delegates this session can dispatch to. Empty when the subagent runtime
363
404
  * did not come up, which is non-fatal and leaves the session doing its own
@@ -564,6 +605,13 @@ export interface AgentSessionOptions {
564
605
  readonly onRunEvent?: (event: RunEvent) => void;
565
606
  /** Durable goal authority for the main TUI session; omitted on headless surfaces. */
566
607
  readonly sessionGoals?: SessionGoalStore;
608
+ /**
609
+ * Mount host desktop control for a surface that owns an interactive
610
+ * permission callback. False by default: `run`, `run-stream` and `drain`
611
+ * have no human prompt to guard pointer/keyboard input and must not inherit
612
+ * this capability merely because the package is installed.
613
+ */
614
+ readonly enableComputerUse?: boolean;
567
615
  }
568
616
  export declare function createAgentSession(prefs: Preferences, detected: readonly DetectedProvider[], options?: AgentSessionOptions): Promise<AgentSession>;
569
617
  export declare function constructProvider(id: ProviderId, det: DetectedProvider | null, model: string): LLMProvider;
@@ -661,14 +709,7 @@ export declare function makeResumeHandler(approval: {
661
709
  * handler stays testable without a registry — and so the answer comes from
662
710
  * the live roster at the moment of the call.
663
711
  */
664
- exempt?: (name: string, input: unknown) => boolean,
665
- /**
666
- * How a prompted call is described. Injected for the same reason
667
- * `exempt` is — this handler is unit-tested without a registry — and
668
- * defaulted to the generic view so a caller that has no registry still
669
- * gets the label the tool's arguments imply, rather than nothing.
670
- */
671
- presenter?: ToolPresenter): ResumeHandler;
712
+ exempt?: (name: string, input: unknown) => boolean): ResumeHandler;
672
713
  /**
673
714
  * Whether a call runs without asking: it declares itself read-only, or it is a
674
715
  * named exemption above.
@@ -710,19 +751,12 @@ export declare function toAgentEvent(event: RunEvent, presenter: ToolPresenter):
710
751
  * a truncated string. So a tool this host had never heard of — an MCP
711
752
  * server's, a plugin's — could not get a diff no matter what it did.
712
753
  *
713
- * The tool now says which of three shapes it wants, and this decides what
754
+ * The tool now says which admitted shape it wants, and this decides what
714
755
  * that looks like in a terminal. Clamping and the `STDOUT:`/`STDERR:`
715
756
  * cleanup stay here on purpose: how many rows fit and how a shell labels
716
757
  * its streams are properties of this surface, not of the tool.
717
758
  */
718
- export declare function viewToLines(view: ToolCallView): readonly string[] | undefined;
759
+ export declare function viewToLines(view: ToolResultView): readonly string[] | undefined;
719
760
  /** The `⏺` row: one line naming what the call is about. */
720
761
  export declare function viewToSummary(view: ToolCallView): string;
721
- /**
722
- * The permission overlay's preview: the same shapes, cut shorter.
723
- *
724
- * A user approving a call needs enough to recognise it, not the whole
725
- * file — the transcript shows that once it has run.
726
- */
727
- export declare function viewToPreview(view: ToolCallView): readonly string[] | undefined;
728
762
  //# sourceMappingURL=agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/tui/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACN,KAAK,iBAAiB,EAEtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EAGb,KAAK,eAAe,EAEpB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAEvB,KAAK,WAAW,EAEhB,KAAK,OAAO,EACZ,KAAK,SAAS,EAEd,KAAK,SAAS,EAKd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,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AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,GAAG,UAAU,GAAG,IAAI,CAqLzF;AAoHD;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,CA2B/E;AAED,2DAA2D;AAC3D,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CASxD"}
package/dist/tui/agent.js CHANGED
@@ -20,7 +20,8 @@
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, createMemoryPromoter, createToolPresenter, genericLabel, getBuiltinTools, isTrustedReadOnly, query, resumeRun, withProviderFallback, } from '@namzu/sdk';
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, genericLabel, getBuiltinTools, isTrustedReadOnly, query, resumeRun, withProviderFallback, } from '@namzu/sdk';
24
+ import { SubprocessComputerUseHost } from '@namzu/computer-use';
24
25
  import { join } from 'node:path';
25
26
  import { probeCapabilities } from '../context/capabilities.js';
26
27
  import { composeEnvironmentPrompt, readEnvironmentFacts } from '../context/environment.js';
@@ -636,6 +637,27 @@ export async function createAgentSession(prefs, detected, options = {}) {
636
637
  'namzu.sandbox.unconfined': sandbox.unconfined,
637
638
  });
638
639
  const { registry, memoryStore } = buildToolRegistry(cwd);
640
+ // Package presence is not tool reachability. The CLI used to probe and
641
+ // report @namzu/computer-use without ever constructing its host or mounting
642
+ // SDK's computer_use definition, so even an installed, healthy package was
643
+ // invisible to the model. Probe first to retain absent/broken diagnostics;
644
+ // only a successfully initialised adapter earns a schema in the registry.
645
+ const capabilities = await probeCapabilities();
646
+ const computerUsePackage = capabilities.find((probe) => probe.specifier === '@namzu/computer-use');
647
+ let computerUseHost;
648
+ let computerUseError;
649
+ if (options.enableComputerUse === true && computerUsePackage?.state === 'present') {
650
+ const candidate = new SubprocessComputerUseHost();
651
+ try {
652
+ await candidate.initialize();
653
+ registry.register(createComputerUseTool(candidate));
654
+ computerUseHost = candidate;
655
+ }
656
+ catch (error) {
657
+ computerUseError = error instanceof Error ? error : new Error(String(error));
658
+ await candidate.dispose().catch(() => { });
659
+ }
660
+ }
639
661
  // Registered only on the main session path. Sub-agents call
640
662
  // `buildToolRegistry` directly below, so they never receive these tools.
641
663
  // Per-send denial further keeps the schemas out of ordinary human turns.
@@ -676,11 +698,14 @@ export async function createAgentSession(prefs, detected, options = {}) {
676
698
  });
677
699
  }
678
700
  // Detected once per session, not per capability check an operator might
679
- // separately run via `namzu doctor` — same probe, same three-state
680
- // answer, so the boot narrative and the doctor report can never disagree
681
- // about whether @namzu/sandbox loaded.
682
- const capabilities = await probeCapabilities();
683
- logCapabilities(capabilities);
701
+ // separately run via `namzu doctor`. Package probes still supply optional
702
+ // package details; the aggregate overrides capabilities whose runtime
703
+ // admission has a more authoritative answer.
704
+ logCapabilities(capabilities, {
705
+ sandboxReady: sandbox.provider !== undefined,
706
+ computerUseReady: computerUseHost !== undefined,
707
+ ...(computerUseError ? { computerUseError } : {}),
708
+ });
684
709
  // This session passes a `taskStore` to query() below, which registers the
685
710
  // task tools deferred — so `search_tools` has something to find here.
686
711
  registry.register([SearchToolsTool]);
@@ -688,6 +713,7 @@ export async function createAgentSession(prefs, detected, options = {}) {
688
713
  // delegate a self-contained task to a fresh sub-agent (own context window).
689
714
  // Best-effort — if the runtime can't stand up, the chat still works.
690
715
  let subagentGateway;
716
+ let subagentRuntime;
691
717
  // Buffer of the in-flight sub-agent's tool steps. The gateway streams the
692
718
  // child's events here while the parent's `Agent` tool call blocks; runTurn
693
719
  // drains it onto the `Agent` result as a `├─/└─` tree. Scoped per `Agent`
@@ -749,11 +775,16 @@ export async function createAgentSession(prefs, detected, options = {}) {
749
775
  }
750
776
  },
751
777
  });
778
+ subagentRuntime = sub;
752
779
  registry.register([sub.agentTool]);
753
780
  subagentGateway = sub.gateway;
754
781
  allowedAgentIds = sub.allowedAgentIds;
755
782
  }
756
783
  catch (err) {
784
+ await subagentRuntime?.close().catch((closeError) => {
785
+ cliLogger().warn('sub-agent runtime cleanup failed after admission refusal', exceptionAttributes(closeError));
786
+ });
787
+ subagentRuntime = undefined;
757
788
  // Sub-agents unavailable this session — non-fatal: `allowedAgentIds`
758
789
  // stays empty and the chat still works. Silent until now, which was
759
790
  // the wrong kind of non-fatal — an operator who expected delegation
@@ -801,7 +832,7 @@ export async function createAgentSession(prefs, detected, options = {}) {
801
832
  pluginRuntime = await createCliPluginRuntime(options.plugins, registry, cwd);
802
833
  }
803
834
  catch (error) {
804
- await mcp.close();
835
+ await Promise.allSettled([mcp.close(), computerUseHost?.dispose()]);
805
836
  return emptySession(describeError(error));
806
837
  }
807
838
  if (pluginRuntime) {
@@ -823,7 +854,12 @@ export async function createAgentSession(prefs, detected, options = {}) {
823
854
  [EVENT_NAME_ATTRIBUTE]: BOOT_EVENT_NAMES.BOOT_READY,
824
855
  });
825
856
  const operations = new SessionOperationOwner(async () => {
826
- const results = await Promise.allSettled([pluginRuntime?.close(), mcp.close()]);
857
+ const results = await Promise.allSettled([
858
+ subagentRuntime?.close?.(),
859
+ pluginRuntime?.close(),
860
+ mcp.close(),
861
+ computerUseHost?.dispose(),
862
+ ]);
827
863
  const failures = results
828
864
  .filter((result) => result.status === 'rejected')
829
865
  .map((result) => result.reason);
@@ -831,6 +867,7 @@ export async function createAgentSession(prefs, detected, options = {}) {
831
867
  throw new AggregateError(failures, 'Session cleanup failed.');
832
868
  });
833
869
  let reasoningEffortLevels;
870
+ let reasoningEffortDefault;
834
871
  let effortNotice;
835
872
  try {
836
873
  const capabilityView = withProviderFallback([
@@ -841,9 +878,25 @@ export async function createAgentSession(prefs, detected, options = {}) {
841
878
  ? capabilityView.reasoningEffortLevelsFor(model)
842
879
  : capabilityView.effortLevelsFor?.(model);
843
880
  reasoningEffortLevels = offered === undefined ? undefined : Object.freeze([...offered]);
881
+ try {
882
+ const publishedDefault = capabilityView.reasoningEffortDefaultFor?.(model);
883
+ if (publishedDefault !== undefined &&
884
+ reasoningEffortLevels !== undefined &&
885
+ !reasoningEffortLevels.includes(publishedDefault)) {
886
+ effortNotice = `The provider published default effort "${publishedDefault}" outside its exact menu. Directional effort shortcuts require an explicit selection.`;
887
+ }
888
+ else {
889
+ reasoningEffortDefault = publishedDefault;
890
+ }
891
+ }
892
+ catch (error) {
893
+ effortNotice = `The default reasoning effort could not be established for this session: ${describeError(error)}`;
894
+ }
844
895
  }
845
896
  catch (error) {
846
- effortNotice = `Reasoning effort levels could not be established for this session: ${describeError(error)}.`;
897
+ reasoningEffortLevels = undefined;
898
+ reasoningEffortDefault = undefined;
899
+ effortNotice = `Reasoning effort levels could not be established for this session: ${describeError(error)}`;
847
900
  }
848
901
  return {
849
902
  hasProvider: true,
@@ -856,6 +909,7 @@ export async function createAgentSession(prefs, detected, options = {}) {
856
909
  providerSummary: entry.label,
857
910
  modelSummary: model,
858
911
  reasoningEffortLevels,
912
+ reasoningEffortDefault,
859
913
  compact: (messages) => operations.promise(undefined, async (signal) => {
860
914
  await prepareProviderCredential(signal);
861
915
  return compactNow({
@@ -880,11 +934,19 @@ export async function createAgentSession(prefs, detected, options = {}) {
880
934
  get skippedInstructionFiles() {
881
935
  return projectInstructions.skippedInstructionFiles;
882
936
  },
883
- mcpConnected: mcp.connected,
884
- mcpFailed: mcp.failed,
937
+ get mcpConnected() {
938
+ return mcp.connected;
939
+ },
940
+ get mcpFailed() {
941
+ return mcp.failed;
942
+ },
943
+ mcpStatus: () => mcp.current(),
885
944
  configNotices: [
886
945
  ...(capabilityNotice ? [capabilityNotice] : []),
887
946
  ...(effortNotice ? [effortNotice] : []),
947
+ ...(computerUseError
948
+ ? [`Computer use is unavailable on this device: ${describeError(computerUseError)}`]
949
+ : []),
888
950
  ...unresolvedNotice.map((line) => `Provider chain: capabilities could not be established for ${line}.`),
889
951
  ...fallbackPlan.notices,
890
952
  ],
@@ -1488,7 +1550,7 @@ async function* runTurn({ provider, fallbackProviders, model, tools, pluginManag
1488
1550
  // The exemption reads `tools` at decision time, so it sees the task
1489
1551
  // tools `query()` registers deferred below and any tool server that
1490
1552
  // connected after this session was built.
1491
- resumeHandler: makeResumeHandler(approval, opts?.onPermission, permissionMode, (name, input) => isPromptExempt(tools, name, input), presenter),
1553
+ resumeHandler: makeResumeHandler(approval, opts?.onPermission, permissionMode, (name, input) => isPromptExempt(tools, name, input)),
1492
1554
  signal,
1493
1555
  ...scope,
1494
1556
  });
@@ -1566,14 +1628,7 @@ export function makeResumeHandler(approval, onPermission, mode = onPermission ?
1566
1628
  * handler stays testable without a registry — and so the answer comes from
1567
1629
  * the live roster at the moment of the call.
1568
1630
  */
1569
- exempt = () => false,
1570
- /**
1571
- * How a prompted call is described. Injected for the same reason
1572
- * `exempt` is — this handler is unit-tested without a registry — and
1573
- * defaulted to the generic view so a caller that has no registry still
1574
- * gets the label the tool's arguments imply, rather than nothing.
1575
- */
1576
- presenter = GENERIC_PRESENTER) {
1631
+ exempt = () => false) {
1577
1632
  return async (request) => {
1578
1633
  if (request.type !== 'tool_review') {
1579
1634
  return request.type === 'plan_approval' ? { action: 'approve_plan' } : { action: 'continue' };
@@ -1599,10 +1654,7 @@ presenter = GENERIC_PRESENTER) {
1599
1654
  toolCalls: request.toolCalls.map((tc) => ({
1600
1655
  id: tc.id,
1601
1656
  name: tc.name,
1602
- ...(() => {
1603
- const view = presenter.presentCall(tc.name, tc.input);
1604
- return { summary: viewToSummary(view), preview: viewToPreview(view) };
1605
- })(),
1657
+ input: tc.input,
1606
1658
  isDestructive: tc.isDestructive,
1607
1659
  })),
1608
1660
  });
@@ -1717,7 +1769,13 @@ export function toAgentEvent(event, presenter) {
1717
1769
  toolName: event.toolName,
1718
1770
  ...(() => {
1719
1771
  const view = presenter.presentCall(event.toolName, event.input);
1720
- return { summary: viewToSummary(view), detail: viewToLines(view) };
1772
+ return {
1773
+ summary: viewToSummary(view),
1774
+ detail: viewToLines(view),
1775
+ ...(view.kind === 'generic' && view.presentation === 'activity'
1776
+ ? { standalone: true }
1777
+ : {}),
1778
+ };
1721
1779
  })(),
1722
1780
  };
1723
1781
  case 'tool_progress':
@@ -1728,24 +1786,27 @@ export function toAgentEvent(event, presenter) {
1728
1786
  message: event.message,
1729
1787
  ...(event.fraction !== undefined ? { fraction: event.fraction } : {}),
1730
1788
  };
1731
- case 'tool_completed':
1789
+ case 'tool_completed': {
1790
+ const view = presenter.presentResult(event.toolName, {}, {
1791
+ success: !event.isError,
1792
+ output: event.result,
1793
+ });
1732
1794
  return {
1733
1795
  kind: 'tool-end',
1734
1796
  toolUseId: event.toolUseId,
1735
1797
  toolName: event.toolName,
1736
1798
  isError: event.isError,
1737
1799
  summary: firstLine(event.result),
1800
+ ...(view.kind === 'generic' && view.visibility === 'hidden' ? { hidden: true } : {}),
1738
1801
  // `tool_completed` carries no input, so the presenter gets an
1739
1802
  // empty one. A tool whose result rendering depends on its
1740
1803
  // arguments would need the executing event's input threaded
1741
1804
  // through; none does yet, and inventing the plumbing for a
1742
1805
  // caller that does not exist is the declaration this repo
1743
1806
  // keeps deleting.
1744
- detail: viewToLines(presenter.presentResult(event.toolName, {}, {
1745
- success: !event.isError,
1746
- output: event.result,
1747
- })),
1807
+ detail: viewToLines(view),
1748
1808
  };
1809
+ }
1749
1810
  case 'token_usage_updated':
1750
1811
  // The context figures are forwarded, not recomputed. They were
1751
1812
  // dropped here for as long as the status gauge existed, which left
@@ -1773,6 +1834,7 @@ export function toAgentEvent(event, presenter) {
1773
1834
  return {
1774
1835
  kind: 'capability-warning',
1775
1836
  capability: event.capability,
1837
+ ...(event.contentSource ? { contentSource: event.contentSource } : {}),
1776
1838
  text: event.message,
1777
1839
  };
1778
1840
  case 'message_history_repaired': {
@@ -1809,6 +1871,19 @@ export function toAgentEvent(event, presenter) {
1809
1871
  return event.status === 'completed'
1810
1872
  ? { kind: 'task', subject: event.subject, status: event.status }
1811
1873
  : null;
1874
+ case 'run_paused':
1875
+ // A pause is not an error and not an invisible end. The checkpoint and
1876
+ // classification are the recovery surface; dropping this event made a
1877
+ // shell report success and let the interactive queue run on a premise
1878
+ // the SDK had explicitly stopped.
1879
+ return {
1880
+ kind: 'paused',
1881
+ checkpointId: event.checkpointId,
1882
+ reason: event.reason,
1883
+ ...(event.failure ? { failure: event.failure } : {}),
1884
+ ...(event.providerError ? { providerError: event.providerError } : {}),
1885
+ ...(event.explanation ? { explanation: event.explanation } : {}),
1886
+ };
1812
1887
  case 'run_completed':
1813
1888
  // Carried through rather than dropped: `run_failed` fires only from
1814
1889
  // the throw path, so this event is also how a budget stop, a
@@ -1820,13 +1895,16 @@ export function toAgentEvent(event, presenter) {
1820
1895
  ...(event.stopReason ? { stopReason: event.stopReason } : {}),
1821
1896
  };
1822
1897
  case 'run_failed':
1823
- // The classification is now carried on the event rather than
1824
- // having been flattened away upstream. Shown because "rate
1825
- // limited, retryable" and "your key is wrong" are the same
1826
- // sentence to a reader who only gets the message.
1898
+ // Keep the compatibility string and the structure. Prefixing the
1899
+ // message with only the coarse `provider_error` code discarded the
1900
+ // stable explanation, retry delay and first-hand provider detail while
1901
+ // still forcing every host to parse prose.
1827
1902
  return {
1828
1903
  kind: 'error',
1829
- message: event.failure ? `[${event.failure.code}] ${event.error}` : event.error,
1904
+ message: event.error,
1905
+ ...(event.failure ? { failure: event.failure } : {}),
1906
+ ...(event.providerError ? { providerError: event.providerError } : {}),
1907
+ ...(event.explanation ? { explanation: event.explanation } : {}),
1830
1908
  };
1831
1909
  case 'compaction_completed':
1832
1910
  return { kind: 'context', text: describeCompaction(event), shed: true };
@@ -1940,26 +2018,6 @@ function describeFallback(event) {
1940
2018
  function asTree(steps) {
1941
2019
  return steps.map((s, i) => `${i === steps.length - 1 ? '└─' : '├─'} ${s}`);
1942
2020
  }
1943
- /** Short, human-readable one-liner for a tool call (e.g. `ls -la`, path). */
1944
- /**
1945
- * The presenter a caller with no registry gets.
1946
- *
1947
- * `makeResumeHandler` is unit-tested without one, and a handler that
1948
- * described every prompted call as an empty string would make those tests
1949
- * pass while telling a real user nothing. This is the same fallback the
1950
- * registry-backed presenter uses when a tool has no opinion, which is what
1951
- * the four deleted functions did for every tool.
1952
- */
1953
- const GENERIC_PRESENTER = {
1954
- presentCall: (_name, input) => ({
1955
- kind: 'generic',
1956
- label: genericLabel(input),
1957
- }),
1958
- presentResult: (_name, _input, result) => ({
1959
- kind: 'terminal',
1960
- output: result.output ?? '',
1961
- }),
1962
- };
1963
2021
  /**
1964
2022
  * The one presentation function this host keeps.
1965
2023
  *
@@ -1968,7 +2026,7 @@ const GENERIC_PRESENTER = {
1968
2026
  * a truncated string. So a tool this host had never heard of — an MCP
1969
2027
  * server's, a plugin's — could not get a diff no matter what it did.
1970
2028
  *
1971
- * The tool now says which of three shapes it wants, and this decides what
2029
+ * The tool now says which admitted shape it wants, and this decides what
1972
2030
  * that looks like in a terminal. Clamping and the `STDOUT:`/`STDERR:`
1973
2031
  * cleanup stay here on purpose: how many rows fit and how a shell labels
1974
2032
  * its streams are properties of this surface, not of the tool.
@@ -2015,37 +2073,10 @@ export function viewToSummary(view) {
2015
2073
  return truncate(view.command ?? view.output.split('\n')[0] ?? '', 120);
2016
2074
  }
2017
2075
  }
2018
- /**
2019
- * The permission overlay's preview: the same shapes, cut shorter.
2020
- *
2021
- * A user approving a call needs enough to recognise it, not the whole
2022
- * file — the transcript shows that once it has run.
2023
- */
2024
- export function viewToPreview(view) {
2025
- if (view.kind !== 'diff')
2026
- return undefined;
2027
- if (view.before === '') {
2028
- const lines = previewLines(view.after, 8);
2029
- return lines.length > 0 ? lines : undefined;
2030
- }
2031
- const lines = [];
2032
- for (const line of previewLines(view.before, 4))
2033
- lines.push(`- ${line}`);
2034
- for (const line of previewLines(view.after, 4))
2035
- lines.push(`+ ${line}`);
2036
- return lines.length > 0 ? lines : undefined;
2037
- }
2038
2076
  function truncate(value, max) {
2039
2077
  const oneLine = value.replace(/\s+/g, ' ');
2040
2078
  return oneLine.length > max ? `${oneLine.slice(0, max - 1)}…` : oneLine;
2041
2079
  }
2042
- function previewLines(value, max) {
2043
- const lines = value.split('\n');
2044
- const head = lines.slice(0, max).map((l) => truncate(l, 100));
2045
- if (lines.length > max)
2046
- head.push(`… (+${lines.length - max} more lines)`);
2047
- return head;
2048
- }
2049
2080
  const MAX_DETAIL_LINES = 200;
2050
2081
  function clampLines(value) {
2051
2082
  const lines = value.replace(/\s+$/, '').split('\n');
@@ -2130,12 +2161,22 @@ function exceptionAttributes(err) {
2130
2161
  * `NamzuCliConfig` marks a capability required yet, so `broken` here is
2131
2162
  * always the "not required by config" case §6.5 describes — an optional
2132
2163
  * capability's failure degrades what this line SAYS, never whether
2133
- * `namzu.boot.ready` fires.
2164
+ * `namzu.boot.ready` fires. The aggregate's sandbox/computer-use answers are
2165
+ * runtime reachability, not package presence: both have a separate admission
2166
+ * step, and printing the package probe after that step produced contradictory
2167
+ * adjacent rows.
2134
2168
  */
2135
- function logCapabilities(probes) {
2169
+ function logCapabilities(probes, runtime) {
2136
2170
  const log = cliLogger();
2137
2171
  const summary = probes
2138
- .map((p) => `${p.specifier.split('/').pop()} ${p.state === 'present' ? 'yes' : 'no'}`)
2172
+ .map((p) => {
2173
+ const present = p.specifier === '@namzu/sandbox'
2174
+ ? runtime.sandboxReady
2175
+ : p.specifier === '@namzu/computer-use'
2176
+ ? runtime.computerUseReady
2177
+ : p.state === 'present';
2178
+ return `${p.specifier.split('/').pop()} ${present ? 'yes' : 'no'}`;
2179
+ })
2139
2180
  .join(' · ');
2140
2181
  log.info(summary, {
2141
2182
  [EVENT_NAME_ATTRIBUTE]: BOOT_EVENT_NAMES.CAPABILITY_DETECTED,
@@ -2157,6 +2198,15 @@ function logCapabilities(probes) {
2157
2198
  ...(probe.state === 'present' ? { 'namzu.capability.version': probe.version } : {}),
2158
2199
  });
2159
2200
  }
2201
+ if (runtime.computerUseError) {
2202
+ log.warn('Computer use adapter is unavailable', {
2203
+ [EVENT_NAME_ATTRIBUTE]: BOOT_EVENT_NAMES.CAPABILITY_DETECTED,
2204
+ 'namzu.capability.name': '@namzu/computer-use',
2205
+ 'namzu.capability.state': 'unavailable',
2206
+ 'namzu.capability.present': false,
2207
+ ...exceptionAttributes(runtime.computerUseError),
2208
+ });
2209
+ }
2160
2210
  }
2161
2211
  function emptySession(errorHint, errorKind = 'environment') {
2162
2212
  // Every path into this function is a boot refusal — `createAgentSession`