@mono-agent/agent-runtime 0.17.0 → 0.18.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/MIGRATION.md +35 -3
- package/README.md +93 -12
- package/package.json +7 -2
- package/src/ai/failure.js +8 -3
- package/src/ai/index.js +2 -0
- package/src/ai/providers/acp-client.js +1124 -0
- package/src/ai/providers/acp-privacy.js +124 -0
- package/src/ai/providers/acp-public.js +21 -0
- package/src/ai/providers/acp-session-tokens.js +129 -0
- package/src/ai/providers/acp-transport.js +259 -0
- package/src/ai/providers/acp.js +523 -0
- package/src/ai/runtime/capabilities.js +16 -0
- package/src/ai/runtime/model-refs.js +20 -1
- package/src/ai/runtime/registry.js +6 -0
- package/src/ai/runtime/router.js +4 -1
- package/src/ai/types.js +9 -5
- package/src/runtime.js +4 -2
- package/types/ai/failure.d.ts +2 -2
- package/types/ai/index.d.ts +2 -0
- package/types/ai/providers/acp-client.d.ts +223 -0
- package/types/ai/providers/acp-privacy.d.ts +25 -0
- package/types/ai/providers/acp-public.d.ts +7 -0
- package/types/ai/providers/acp-session-tokens.d.ts +34 -0
- package/types/ai/providers/acp-transport.d.ts +32 -0
- package/types/ai/providers/acp.d.ts +93 -0
- package/types/ai/runtime/capabilities.d.ts +21 -0
- package/types/ai/types.d.ts +29 -9
package/types/ai/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {"claude" | "pi" | "codex" | "opencode" | (string & {})} RuntimeSdkId
|
|
2
|
+
* @typedef {"claude" | "pi" | "codex" | "opencode" | "acp" | (string & {})} RuntimeSdkId
|
|
3
3
|
* Canonical active runtime id. See ACTIVE_RUNTIME_KINDS (model-refs.js) for
|
|
4
4
|
* the enforced-at-runtime vocabulary.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* @typedef {"claude" | "claude-code" | "codex-app" | "opencode-app" | "pi" | (string & {})} RuntimeBridgeId
|
|
7
|
+
* @typedef {"claude" | "claude-code" | "codex-app" | "opencode-app" | "pi" | "acp-stdio" | (string & {})} RuntimeBridgeId
|
|
8
8
|
* Registry bridge id (distinct from RuntimeSdkId: a single sdk can be served
|
|
9
9
|
* by more than one bridge, e.g. sdk "claude" is served by both the "claude"
|
|
10
10
|
* SDK bridge and the "claude-code" CLI bridge). See
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
* @typedef {Object} RuntimeRunOptions
|
|
105
105
|
* The options object a host passes to `createRuntime(host).run(systemPrompt, options)`.
|
|
106
106
|
* @property {RuntimeModelRef} model Resolved model reference; see parseRuntimeModelReference.
|
|
107
|
-
* @property {
|
|
107
|
+
* @property {"sdk"|"cli"|"acp"} [executionMode] "sdk" (default), "cli", or "acp"; selects which bridge variant handles the model.
|
|
108
108
|
* @property {string} [sessionId] Host conversation/session key for resumable bridges.
|
|
109
109
|
* @property {string} [providerSessionId] Provider-owned resume id for resumable bridges.
|
|
110
110
|
* @property {typeof import("@anthropic-ai/claude-agent-sdk").query} [claudeAgentQuery] Advanced programmatic/test seam for the Claude SDK route; omitted runs use the runtime's pinned SDK query implementation.
|
|
@@ -134,6 +134,8 @@
|
|
|
134
134
|
* @property {RuntimeToolLimits} [toolLimits] Typed per-run tool-output limits (supported replacement for the deprecated `settings` tool keys).
|
|
135
135
|
* @property {RuntimeCompactionPolicy} [compaction] Typed per-run compaction policy (supported replacement for the deprecated `settings` compaction keys).
|
|
136
136
|
* @property {RuntimePromptOverrides} [prompts] Per-run prompt-fragment overrides (run wins over the host default).
|
|
137
|
+
* @property {import('./providers/acp-client.js').AcpClientHostOptions["resolveAcpProfile"]} [resolveAcpProfile] Per-run ACP profile resolver; wins over the host default.
|
|
138
|
+
* @property {import('./providers/acp-client.js').AcpClientHostOptions["onAcpInteractionRequest"]} [onAcpInteractionRequest] Per-run ACP permission/elicitation callback; wins over the host default.
|
|
137
139
|
* @property {{backend?: "auto"|"searxng"|"keyless", endpoint?: string}} [webSearchConfig] Run-scoped WebSearch backend configuration.
|
|
138
140
|
* @property {{render?: "never"|"auto", browserCommand?: string}} [webFetchConfig] Run-scoped WebFetch extraction/render configuration.
|
|
139
141
|
* @property {"sequential"|"safe-parallel"} [piToolExecutionMode] Pi built-in tool scheduling mode. Safe parallelism is the default.
|
|
@@ -150,7 +152,7 @@
|
|
|
150
152
|
*/
|
|
151
153
|
/**
|
|
152
154
|
* @typedef {RuntimeRunOptions
|
|
153
|
-
* & Pick<AgentRuntimeHostOptions, "resolveCustomPricing" | "resolvePiApiKey" | "persistArtifact" | "onCompactionRecorded" | "onToolApprovalRequest" | "toolRiskTiers" | "approvalDefaultRiskTier" | "approvalTimeoutMs" | "approvalAlwaysAllowTools">
|
|
155
|
+
* & Pick<AgentRuntimeHostOptions, "resolveCustomPricing" | "resolvePiApiKey" | "resolveAcpProfile" | "onAcpInteractionRequest" | "persistArtifact" | "onCompactionRecorded" | "onToolApprovalRequest" | "toolRiskTiers" | "approvalDefaultRiskTier" | "approvalTimeoutMs" | "approvalAlwaysAllowTools">
|
|
154
156
|
* & {runtimeBrand: import('../runtime-brand.js').RuntimeBrand, toolContext?: import('../agent/tools/shared/tool-context.js').ToolContext, observerHub: {emit: (event: RuntimeEvent) => void, flush: () => Promise<void>}}
|
|
155
157
|
* } RuntimeRequest
|
|
156
158
|
* The request shape a bridge's `execute(systemPrompt, req)` receives as its
|
|
@@ -318,6 +320,8 @@
|
|
|
318
320
|
* @property {*} [runtimeBrand] See resolveRuntimeBrand (runtime-brand.js); accepts a partial RuntimeBrand.
|
|
319
321
|
* @property {(parsed: {sdk: (string|null), provider?: string, model: string}) => (import('./cost.js').NormalizedPricing|null)} [resolveCustomPricing] See resolvePricing (ai/cost.js).
|
|
320
322
|
* @property {import('../pi-auth.js').PiApiKeyResolver} [resolvePiApiKey] See createPiOAuthApiKeyResolver (pi-auth.js) for a ready-made implementation.
|
|
323
|
+
* @property {import('./providers/acp-client.js').AcpClientHostOptions["resolveAcpProfile"]} [resolveAcpProfile] Default ACP profile resolver; a per-run callback wins.
|
|
324
|
+
* @property {import('./providers/acp-client.js').AcpClientHostOptions["onAcpInteractionRequest"]} [onAcpInteractionRequest] Default ACP interaction callback; a per-run callback wins.
|
|
321
325
|
* @property {(artifact: {filename: string, buffer: Buffer, toolName: string, toolUseId: (string|null)}) => (string|null)} [persistArtifact]
|
|
322
326
|
* @property {(record: CompactionRecordedPayload) => void} [onCompactionRecorded]
|
|
323
327
|
* @property {(payload: ApprovalRequestPayload) => Promise<ApprovalDecision>} [onToolApprovalRequest]
|
|
@@ -355,14 +359,14 @@ export const PROVIDER_KIND_VALUES: string[];
|
|
|
355
359
|
* Canonical active runtime id. See ACTIVE_RUNTIME_KINDS (model-refs.js) for
|
|
356
360
|
* the enforced-at-runtime vocabulary.
|
|
357
361
|
*/
|
|
358
|
-
export type RuntimeSdkId = "claude" | "pi" | "codex" | "opencode" | (string & {});
|
|
362
|
+
export type RuntimeSdkId = "claude" | "pi" | "codex" | "opencode" | "acp" | (string & {});
|
|
359
363
|
/**
|
|
360
364
|
* Registry bridge id (distinct from RuntimeSdkId: a single sdk can be served
|
|
361
365
|
* by more than one bridge, e.g. sdk "claude" is served by both the "claude"
|
|
362
366
|
* SDK bridge and the "claude-code" CLI bridge). See
|
|
363
367
|
* src/ai/runtime/registry.js's builtinBridgeSpecs.
|
|
364
368
|
*/
|
|
365
|
-
export type RuntimeBridgeId = "claude" | "claude-code" | "codex-app" | "opencode-app" | "pi" | (string & {});
|
|
369
|
+
export type RuntimeBridgeId = "claude" | "claude-code" | "codex-app" | "opencode-app" | "pi" | "acp-stdio" | (string & {});
|
|
366
370
|
export type RuntimeModelRef = {
|
|
367
371
|
/**
|
|
368
372
|
* Canonical active runtime id.
|
|
@@ -535,9 +539,9 @@ export type RuntimeRunOptions = {
|
|
|
535
539
|
*/
|
|
536
540
|
model: RuntimeModelRef;
|
|
537
541
|
/**
|
|
538
|
-
* "sdk" (default) or "
|
|
542
|
+
* "sdk" (default), "cli", or "acp"; selects which bridge variant handles the model.
|
|
539
543
|
*/
|
|
540
|
-
executionMode?:
|
|
544
|
+
executionMode?: "sdk" | "cli" | "acp";
|
|
541
545
|
/**
|
|
542
546
|
* Host conversation/session key for resumable bridges.
|
|
543
547
|
*/
|
|
@@ -630,6 +634,14 @@ export type RuntimeRunOptions = {
|
|
|
630
634
|
* Per-run prompt-fragment overrides (run wins over the host default).
|
|
631
635
|
*/
|
|
632
636
|
prompts?: RuntimePromptOverrides;
|
|
637
|
+
/**
|
|
638
|
+
* Per-run ACP profile resolver; wins over the host default.
|
|
639
|
+
*/
|
|
640
|
+
resolveAcpProfile?: import("./providers/acp-client.js").AcpClientHostOptions["resolveAcpProfile"];
|
|
641
|
+
/**
|
|
642
|
+
* Per-run ACP permission/elicitation callback; wins over the host default.
|
|
643
|
+
*/
|
|
644
|
+
onAcpInteractionRequest?: import("./providers/acp-client.js").AcpClientHostOptions["onAcpInteractionRequest"];
|
|
633
645
|
/**
|
|
634
646
|
* Run-scoped WebSearch backend configuration.
|
|
635
647
|
*/
|
|
@@ -686,7 +698,7 @@ export type RuntimeRunOptions = {
|
|
|
686
698
|
* createRuntime), and the per-run observerHub (onEvent is overridden to the
|
|
687
699
|
* hub's emit). `systemPrompt` is passed positionally, not folded into this object.
|
|
688
700
|
*/
|
|
689
|
-
export type RuntimeRequest = RuntimeRunOptions & Pick<AgentRuntimeHostOptions, "resolveCustomPricing" | "resolvePiApiKey" | "persistArtifact" | "onCompactionRecorded" | "onToolApprovalRequest" | "toolRiskTiers" | "approvalDefaultRiskTier" | "approvalTimeoutMs" | "approvalAlwaysAllowTools"> & {
|
|
701
|
+
export type RuntimeRequest = RuntimeRunOptions & Pick<AgentRuntimeHostOptions, "resolveCustomPricing" | "resolvePiApiKey" | "resolveAcpProfile" | "onAcpInteractionRequest" | "persistArtifact" | "onCompactionRecorded" | "onToolApprovalRequest" | "toolRiskTiers" | "approvalDefaultRiskTier" | "approvalTimeoutMs" | "approvalAlwaysAllowTools"> & {
|
|
690
702
|
runtimeBrand: import("../runtime-brand.js").RuntimeBrand;
|
|
691
703
|
toolContext?: import("../agent/tools/shared/tool-context.js").ToolContext;
|
|
692
704
|
observerHub: {
|
|
@@ -955,6 +967,14 @@ export type AgentRuntimeHostOptions = {
|
|
|
955
967
|
* See createPiOAuthApiKeyResolver (pi-auth.js) for a ready-made implementation.
|
|
956
968
|
*/
|
|
957
969
|
resolvePiApiKey?: import("../pi-auth.js").PiApiKeyResolver;
|
|
970
|
+
/**
|
|
971
|
+
* Default ACP profile resolver; a per-run callback wins.
|
|
972
|
+
*/
|
|
973
|
+
resolveAcpProfile?: import("./providers/acp-client.js").AcpClientHostOptions["resolveAcpProfile"];
|
|
974
|
+
/**
|
|
975
|
+
* Default ACP interaction callback; a per-run callback wins.
|
|
976
|
+
*/
|
|
977
|
+
onAcpInteractionRequest?: import("./providers/acp-client.js").AcpClientHostOptions["onAcpInteractionRequest"];
|
|
958
978
|
persistArtifact?: (artifact: {
|
|
959
979
|
filename: string;
|
|
960
980
|
buffer: Buffer;
|