@agentproto/driver-agent-cli 2.7.1 → 2.8.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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AgentCliHandle, a as AgentCliRuntime, b as AgentCliDefinition, c as AgentCliRuntimeSession, d as AgentCliClient, S as SetModelResult, e as AgentCliPrintConfig, R as RuntimeConfig, C as ContinuationStrategyId, f as AgentCliStartOptions, T as TurnContext, g as ContinuationKeyScope } from './schema-CKrBhnuF.js';
2
- export { h as AgentCliAuth, i as AgentCliCapabilities, j as AgentCliConnectOptions, k as AgentCliContinuation, l as AgentCliFrontmatter, m as AgentCliFsZones, n as AgentCliInstallMethod, o as AgentCliMcpBlock, p as AgentCliMode, q as AgentCliModelEntry, r as AgentCliModels, s as AgentCliOption, t as AgentCliOptionType, u as AgentCliPinnedSessionTuning, v as AgentCliPresetDeclaration, w as AgentCliProtocol, x as AgentCliRouteSelection, y as AgentCliSession, z as AgentCliSessionMode, B as AgentCliSetupPersist, D as AgentCliSetupSkipIf, E as AgentCliSetupStep, F as AgentCliVersionCheck, G as RuntimeConfigInput, H as SetEffortResult, I as SetSessionModeResult, J as SteerOutcome, K as agentCliFrontmatterSchema, L as runtimeConfigSchema } from './schema-CKrBhnuF.js';
1
+ import { A as AgentCliHandle, a as AgentCliRuntime, b as AgentCliDefinition, c as AgentCliRuntimeSession, d as AgentCliClient, S as SetModelResult, e as AgentCliPrintConfig, R as RuntimeConfig, C as ContinuationStrategyId, f as AgentCliStartOptions, T as TurnContext, g as ContinuationKeyScope } from './schema-DafVng6S.js';
2
+ export { h as AgentCliAuth, i as AgentCliCapabilities, j as AgentCliConnectOptions, k as AgentCliContinuation, l as AgentCliFrontmatter, m as AgentCliFsZones, n as AgentCliInstallMethod, o as AgentCliMcpBlock, p as AgentCliMode, q as AgentCliModelEntry, r as AgentCliModels, s as AgentCliOption, t as AgentCliOptionType, u as AgentCliPinnedSessionTuning, v as AgentCliPresetDeclaration, w as AgentCliProtocol, x as AgentCliRouteSelection, y as AgentCliSession, z as AgentCliSessionMode, B as AgentCliSetupPersist, D as AgentCliSetupSkipIf, E as AgentCliSetupStep, F as AgentCliVersionCheck, G as RuntimeConfigInput, H as SetEffortResult, I as SetSessionModeResult, J as SteerOutcome, K as agentCliFrontmatterSchema, L as runtimeConfigSchema } from './schema-DafVng6S.js';
3
3
  import { StreamEvent, AcpMcpServer } from '@agentproto/acp';
4
4
  export { StreamEvent } from '@agentproto/acp';
5
5
  import { ChildProcess } from 'node:child_process';
@@ -84,8 +84,15 @@ declare function applyModelCommand(arm: AgentCliClient, modelId: string): Promis
84
84
  * almost always has a more useful line ("npx claude-agent-acp: not
85
85
  * authenticated, run `claude login`"). Hosts read `error.data` when
86
86
  * present, falling back to `message` for older payloads.
87
+ *
88
+ * When `stderrTurnError` is supplied, a line it parses into a message
89
+ * (see {@link parseStderrStreamError}) is surfaced as THIS turn's error:
90
+ * the turn is cancelled and ended with `reason:"error"` instead of hanging
91
+ * forever on a `prompt` the server never resolves. Only armed for adapters
92
+ * whose transport retries silently (opencode); every other adapter keeps
93
+ * the exact prior behavior.
87
94
  */
88
- declare function promptTurn(arm: AgentCliClient, turnId: string, message: unknown): AsyncIterable<StreamEvent>;
95
+ declare function promptTurn(arm: AgentCliClient, turnId: string, message: unknown, stderrTurnError?: (line: string) => string | undefined): AsyncIterable<StreamEvent>;
89
96
 
90
97
  /**
91
98
  * Agent CLI as a model port — turn ANY AIP-45 agent CLI runtime into a generic
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { LEGACY_GATEWAY_MODE_IDS, LEGACY_POSTURE_MODE_IDS, RuntimeConfigError, agentCliFrontmatterSchema, agentCliSupportsHostContextIsolation, applyModelCommand, autoAllowPermissionHandler, composeSpawn, createAcpProtocolArm, createAgentCliRuntime, createArmSessionControls, createJcodeMapperState, createMastraMapperState, createPrintSession, createProprietaryProtocolArm, defineAgentCli, hostContextExcludes, inferLegacyModeKind, isLegacyExtractedModeId, isModelSwitchAcknowledgement, mapJcodeEvent, mapMastraEvent, parseModelSwitchCommand, planModePermissionHandler, promptTurn, resolveContinuationStrategy, runtimeConfigSchema, toFileBasedMcpServers } from './chunk-Y3FGLQ4R.mjs';
1
+ export { LEGACY_GATEWAY_MODE_IDS, LEGACY_POSTURE_MODE_IDS, RuntimeConfigError, agentCliFrontmatterSchema, agentCliSupportsHostContextIsolation, applyModelCommand, autoAllowPermissionHandler, composeSpawn, createAcpProtocolArm, createAgentCliRuntime, createArmSessionControls, createJcodeMapperState, createMastraMapperState, createPrintSession, createProprietaryProtocolArm, defineAgentCli, hostContextExcludes, inferLegacyModeKind, isLegacyExtractedModeId, isModelSwitchAcknowledgement, mapJcodeEvent, mapMastraEvent, parseModelSwitchCommand, planModePermissionHandler, promptTurn, resolveContinuationStrategy, runtimeConfigSchema, toFileBasedMcpServers } from './chunk-E45SX7GU.mjs';
2
2
 
3
3
  /**
4
4
  * @agentproto/driver-agent-cli v0.1.0-alpha
@@ -1,5 +1,5 @@
1
- import { l as AgentCliFrontmatter, A as AgentCliHandle } from '../schema-CKrBhnuF.js';
2
- export { K as agentCliFrontmatterSchema } from '../schema-CKrBhnuF.js';
1
+ import { l as AgentCliFrontmatter, A as AgentCliHandle } from '../schema-DafVng6S.js';
2
+ export { K as agentCliFrontmatterSchema } from '../schema-DafVng6S.js';
3
3
  import '@agentproto/acp';
4
4
  import '@agentproto/acp/client';
5
5
  import '@agentproto/command-sandbox';
@@ -1,5 +1,5 @@
1
- import { agentCliFrontmatterSchema, defineAgentCli } from '../chunk-Y3FGLQ4R.mjs';
2
- export { agentCliFrontmatterSchema } from '../chunk-Y3FGLQ4R.mjs';
1
+ import { agentCliFrontmatterSchema, defineAgentCli } from '../chunk-E45SX7GU.mjs';
2
+ export { agentCliFrontmatterSchema } from '../chunk-E45SX7GU.mjs';
3
3
  import matter from 'gray-matter';
4
4
 
5
5
  /**
@@ -321,6 +321,17 @@ interface AgentCliCapabilities {
321
321
  * session id is not a native TUI resume. Default false.
322
322
  */
323
323
  nativeTerminalResume?: boolean;
324
+ /**
325
+ * The harness itself defers mounted MCP tool schemas behind its own
326
+ * on-demand search tool (e.g. Claude Code's `ToolSearch`), so it never
327
+ * pays the full turn-0 `tools/list` payload of a large MCP server. The
328
+ * daemon uses this to default its own `/mcp` self-mount to EAGER for the
329
+ * session instead of stacking a second deferral layer (`tool_search`) on
330
+ * top, where a tool hidden by the daemon is invisible to the harness's
331
+ * native search. Declare it only when verified for the harness's default
332
+ * configuration; absent/false ⇒ the role / daemon default applies.
333
+ */
334
+ nativeToolSearch?: boolean;
324
335
  }
325
336
  /**
326
337
  * Support status for a declared mode. Absent ⇒ treated as `"active"`.
@@ -1070,6 +1081,16 @@ interface AgentCliClient {
1070
1081
  * Not part of the protocol; internal to the runner.
1071
1082
  */
1072
1083
  _stderrTail?: () => string;
1084
+ /**
1085
+ * Live stderr subscription — the push half of {@link _stderrTail}. Set by
1086
+ * the runner after spawn; `promptTurn` subscribes for the duration of a
1087
+ * turn to surface provider errors that exist ONLY on stderr. Some ACP
1088
+ * servers (opencode) treat a provider 429/usage-cap as retryable and loop
1089
+ * internally, logging the reason to stderr while `session/prompt` never
1090
+ * resolves — the stderr line is the only evidence. Returns an unsubscribe
1091
+ * function. Not part of the protocol; internal to the runner.
1092
+ */
1093
+ _onStderrLine?: (listener: (line: string) => void) => () => void;
1073
1094
  }
1074
1095
  /**
1075
1096
  * The runtime handle returned by `defineAgentCli` — call `.start()`
@@ -1751,6 +1772,7 @@ declare const agentCliFrontmatterSchema: z.ZodObject<{
1751
1772
  resumable: z.ZodOptional<z.ZodBoolean>;
1752
1773
  bidirectional: z.ZodOptional<z.ZodBoolean>;
1753
1774
  nativeTerminalResume: z.ZodOptional<z.ZodBoolean>;
1775
+ nativeToolSearch: z.ZodOptional<z.ZodBoolean>;
1754
1776
  file_attach: z.ZodOptional<z.ZodBoolean>;
1755
1777
  }, z.core.$strict>>;
1756
1778
  modes: z.ZodOptional<z.ZodArray<z.ZodObject<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentproto/driver-agent-cli",
3
- "version": "2.7.1",
3
+ "version": "2.8.0",
4
4
  "description": "@agentproto/driver-agent-cli — AIP-45 AGENT-CLI.md reference implementation. Multi-protocol runner that loads an AGENT-CLI.md manifest, spawns the binary, and dispatches turns through an ACP / MCP / proprietary arm. ACP arm delegates to @agentproto/acp; emits the canonical StreamEvent taxonomy regardless of underlying protocol.",
5
5
  "keywords": [
6
6
  "agentproto",