@mono-agent/agent-runtime 0.20.11 → 0.20.14
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 +264 -25
- package/README.md +139 -448
- package/package.json +7 -43
- package/src/agent/tools/agent-tool.js +5 -5
- package/src/agent/tools/bash.js +1 -24
- package/src/agent/tools/codex-subscription-search.js +1 -1
- package/src/agent/tools/index.js +7 -0
- package/src/agent/tools/monitor.js +140 -0
- package/src/agent/tools/pi-bridge.js +92 -7
- package/src/agent/tools/shared/bash-environment.js +31 -0
- package/src/agent/tools/shared/monitors.js +274 -0
- package/src/agent/tools/shared/process-runner.js +23 -5
- package/src/ai/cost.js +13 -68
- package/src/ai/index.js +4 -17
- package/src/ai/pi-interop.js +65 -1
- package/src/ai/pi-oauth-compat.js +1 -1
- package/src/ai/providers/codex/app-server-client.js +592 -0
- package/src/ai/providers/pi-models.js +18 -10
- package/src/ai/providers/pi-native/compaction-driver.js +49 -21
- package/src/ai/providers/pi-native/harness-adapter.js +338 -0
- package/src/ai/providers/pi-native/result-builder.js +10 -10
- package/src/ai/providers/pi-native/session-lifecycle.js +95 -40
- package/src/ai/providers/pi-native/stream-subscriber.js +23 -5
- package/src/ai/providers/pi-native/turn-runner.js +34 -15
- package/src/ai/providers/pi-native.js +48 -22
- package/src/ai/runtime/capabilities.js +11 -56
- package/src/ai/runtime/model-refs.js +118 -153
- package/src/ai/runtime/registry.js +22 -56
- package/src/ai/runtime/router.js +48 -408
- package/src/ai/runtime/session-liveness.js +3 -4
- package/src/ai/runtime/sessions.js +4 -5
- package/src/ai/runtime/tool-policy.js +0 -2
- package/src/ai/types.js +12 -108
- package/src/index.js +0 -6
- package/src/runtime.js +8 -14
- package/types/agent/tools/agent-tool.d.ts +1 -2
- package/types/agent/tools/codex-subscription-search.d.ts +1 -1
- package/types/agent/tools/index.d.ts +1 -0
- package/types/agent/tools/monitor.d.ts +44 -0
- package/types/agent/tools/pi-bridge.d.ts +3 -2
- package/types/agent/tools/shared/bash-environment.d.ts +4 -0
- package/types/agent/tools/shared/monitors.d.ts +83 -0
- package/types/agent/tools/shared/process-runner.d.ts +11 -2
- package/types/ai/cost.d.ts +1 -2
- package/types/ai/index.d.ts +1 -4
- package/types/ai/pi-interop.d.ts +20 -0
- package/types/ai/providers/codex/app-server-client.d.ts +37 -0
- package/types/ai/providers/pi-native/harness-adapter.d.ts +56 -0
- package/types/ai/providers/pi-native/result-builder.d.ts +3 -3
- package/types/ai/providers/pi-native/session-lifecycle.d.ts +2 -1
- package/types/ai/providers/pi-native/stream-subscriber.d.ts +2 -2
- package/types/ai/providers/pi-native/turn-runner.d.ts +33 -6
- package/types/ai/providers/pi-native.d.ts +21 -4
- package/types/ai/runtime/capabilities.d.ts +21 -70
- package/types/ai/runtime/model-refs.d.ts +0 -24
- package/types/ai/runtime/router.d.ts +3 -10
- package/types/ai/runtime/tool-policy.d.ts +0 -2
- package/types/ai/types.d.ts +28 -250
- package/types/index.d.ts +0 -1
- package/src/ai/providers/acp-client.js +0 -1149
- package/src/ai/providers/acp-privacy.js +0 -124
- package/src/ai/providers/acp-public.js +0 -21
- package/src/ai/providers/acp-session-tokens.js +0 -282
- package/src/ai/providers/acp-transport.js +0 -356
- package/src/ai/providers/acp.js +0 -543
- package/src/ai/providers/claude-cli.js +0 -883
- package/src/ai/providers/claude-sandbox.js +0 -71
- package/src/ai/providers/claude-sdk-discovery-worker.js +0 -53
- package/src/ai/providers/claude-sdk-discovery.js +0 -352
- package/src/ai/providers/claude-sdk.js +0 -1127
- package/src/ai/providers/claude-subagent-activity.js +0 -719
- package/src/ai/providers/claude-subagents.js +0 -88
- package/src/ai/providers/codex-app.js +0 -2946
- package/src/ai/providers/opencode-app.js +0 -1109
- package/src/ai/providers/opencode-discovery.js +0 -39
- package/src/ai/providers/opencode-server.js +0 -508
- package/src/ai/runtime/context-windows.js +0 -46
- package/src/ai/runtime/fast-mode.js +0 -8
- package/src/ai/streaming/codex-events.js +0 -146
- package/src/ai/streaming/opencode-events.js +0 -59
- package/types/ai/providers/acp-client.d.ts +0 -227
- package/types/ai/providers/acp-privacy.d.ts +0 -25
- package/types/ai/providers/acp-public.d.ts +0 -7
- package/types/ai/providers/acp-session-tokens.d.ts +0 -41
- package/types/ai/providers/acp-transport.d.ts +0 -45
- package/types/ai/providers/acp.d.ts +0 -93
- package/types/ai/providers/claude-cli.d.ts +0 -305
- package/types/ai/providers/claude-sandbox.d.ts +0 -79
- package/types/ai/providers/claude-sdk-discovery-worker.d.ts +0 -1
- package/types/ai/providers/claude-sdk-discovery.d.ts +0 -97
- package/types/ai/providers/claude-sdk.d.ts +0 -138
- package/types/ai/providers/claude-subagent-activity.d.ts +0 -53
- package/types/ai/providers/claude-subagents.d.ts +0 -18
- package/types/ai/providers/codex-app.d.ts +0 -151
- package/types/ai/providers/opencode-app.d.ts +0 -96
- package/types/ai/providers/opencode-discovery.d.ts +0 -4
- package/types/ai/providers/opencode-server.d.ts +0 -20
- package/types/ai/runtime/context-windows.d.ts +0 -9
- package/types/ai/runtime/fast-mode.d.ts +0 -2
- package/types/ai/streaming/codex-events.d.ts +0 -40
- package/types/ai/streaming/opencode-events.d.ts +0 -42
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export function normalizedSensitiveName(name: any): string;
|
|
2
|
+
export function isSensitivePayloadField(name: any): boolean;
|
|
3
|
+
export function sensitiveEnvironmentValues(env: any): any[];
|
|
4
|
+
export function addOpaqueSensitiveValue(target: any, value: any, { splitCredentials }?: {
|
|
5
|
+
splitCredentials?: boolean;
|
|
6
|
+
}): void;
|
|
7
|
+
export function redactCodexDiagnostic(text: any, sensitiveValues: any, truncatedStart?: boolean): string;
|
|
8
|
+
export function utf8Head(text: any, limit: any): string;
|
|
9
|
+
export function sanitizeCodexDiagnostic(value: any, sensitiveValues: any, limit?: number): string;
|
|
10
|
+
export function redactCodexPayload(value: any, sensitiveValues: any, seen?: WeakSet<object>, depth?: number): any;
|
|
11
|
+
export function sanitizeCodexResponseError(error: any, sensitiveValues: any): any;
|
|
12
|
+
export function sanitizeCodexNotification(notification: any, sensitiveValues: any): any;
|
|
13
|
+
export function codexErrorMessage(error: any): any;
|
|
14
|
+
export function isCodexRequestTimeout(error: any, method?: any): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @param {{command?: string, args?: string[], cwd?: any, env?: any, redactionValues?: string[], onNotification?: (msg: any) => void, onServerRequest?: (msg: any) => Promise<any> | any, shutdownGraceMs?: number, killGraceMs?: number}} [options]
|
|
17
|
+
*/
|
|
18
|
+
export function createCodexAppServerClient({ command, args, cwd, env, redactionValues, onNotification, onServerRequest, shutdownGraceMs, killGraceMs, }?: {
|
|
19
|
+
command?: string;
|
|
20
|
+
args?: string[];
|
|
21
|
+
cwd?: any;
|
|
22
|
+
env?: any;
|
|
23
|
+
redactionValues?: string[];
|
|
24
|
+
onNotification?: (msg: any) => void;
|
|
25
|
+
onServerRequest?: (msg: any) => Promise<any> | any;
|
|
26
|
+
shutdownGraceMs?: number;
|
|
27
|
+
killGraceMs?: number;
|
|
28
|
+
}): {
|
|
29
|
+
request: (method: any, params: any, { timeoutMs }?: {
|
|
30
|
+
timeoutMs?: number;
|
|
31
|
+
}) => Promise<any>;
|
|
32
|
+
close: () => Promise<void>;
|
|
33
|
+
child: import("child_process").ChildProcessWithoutNullStreams;
|
|
34
|
+
closed: Promise<any>;
|
|
35
|
+
};
|
|
36
|
+
export const CODEX_APP_SERVER_ARGS: string[];
|
|
37
|
+
export const CODEX_APP_SERVER_ISOLATED_ARGS: string[];
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pi 0.85 no longer exports its session-context projector. Reproduce the
|
|
3
|
+
* public entry contract here so transcript accounting uses the same latest-
|
|
4
|
+
* compaction and failed-assistant filtering rules as the harness.
|
|
5
|
+
* @param {any[]} pathEntries
|
|
6
|
+
* @param {{includeFailed?: boolean}} [options]
|
|
7
|
+
*/
|
|
8
|
+
export function buildPiSessionContext(pathEntries: any[], { includeFailed }?: {
|
|
9
|
+
includeFailed?: boolean;
|
|
10
|
+
}): any[];
|
|
11
|
+
/**
|
|
12
|
+
* Give the surrounding bridge the small session surface it used before Pi
|
|
13
|
+
* moved branch operations onto AgentLane. The raw session remains available to
|
|
14
|
+
* AgentHarness.create(), while all transcript reads and writes use the attached
|
|
15
|
+
* main lane once the harness exists.
|
|
16
|
+
* @param {any} rawSession
|
|
17
|
+
*/
|
|
18
|
+
export function createPiSessionAdapter(rawSession: any): {
|
|
19
|
+
rawSession: any;
|
|
20
|
+
readonly metadata: any;
|
|
21
|
+
attach(nextHarness: any, nextLane: any): void;
|
|
22
|
+
buildContext(): Promise<{
|
|
23
|
+
messages: any[];
|
|
24
|
+
}>;
|
|
25
|
+
getEntries(): any;
|
|
26
|
+
getLeafId(): any;
|
|
27
|
+
appendMessage(message: any): any;
|
|
28
|
+
moveTo(targetId: any): Promise<any>;
|
|
29
|
+
getMetadata(): Promise<any>;
|
|
30
|
+
close(): any;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Attach Pi 0.85's harness to one session and expose the intentionally small
|
|
34
|
+
* surface consumed by mono-agent's turn runner.
|
|
35
|
+
* @param {any} session
|
|
36
|
+
* @param {any} options
|
|
37
|
+
*/
|
|
38
|
+
export function createPiHarnessAdapter(session: any, options: any): Promise<{
|
|
39
|
+
models: any;
|
|
40
|
+
getModel: () => any;
|
|
41
|
+
getThinkingLevel: () => any;
|
|
42
|
+
getActiveTools: () => any;
|
|
43
|
+
setActiveTools(names: any): Promise<void>;
|
|
44
|
+
setCompactionSettings(settings: any): Promise<void>;
|
|
45
|
+
appendMessage(message: any): Promise<any>;
|
|
46
|
+
prompt(text: any, promptOptions: any): Promise<any>;
|
|
47
|
+
steer(message: any): Promise<any>;
|
|
48
|
+
abort(): Promise<void>;
|
|
49
|
+
waitForIdle(): any;
|
|
50
|
+
compact(): Promise<any>;
|
|
51
|
+
on(type: any, handler: any): any;
|
|
52
|
+
subscribe(listener: any): () => void;
|
|
53
|
+
abortOpenOperations(): Promise<void>;
|
|
54
|
+
close(): Promise<void>;
|
|
55
|
+
}>;
|
|
56
|
+
export const PI_CONTEXT: import("@earendil-works/pi-agent-core").Context;
|
|
@@ -129,7 +129,7 @@ export function abortedResult({ resolved, options, events, runtimeWarnings, star
|
|
|
129
129
|
numTurns: number;
|
|
130
130
|
model: any;
|
|
131
131
|
effort: any;
|
|
132
|
-
sdk:
|
|
132
|
+
sdk: string;
|
|
133
133
|
cancelled: boolean;
|
|
134
134
|
error: any;
|
|
135
135
|
failureKind: any;
|
|
@@ -166,7 +166,7 @@ export function buildSuccessResult(params: object): {
|
|
|
166
166
|
numTurns: any;
|
|
167
167
|
model: any;
|
|
168
168
|
effort: any;
|
|
169
|
-
sdk:
|
|
169
|
+
sdk: string;
|
|
170
170
|
cancelled: any;
|
|
171
171
|
error: any;
|
|
172
172
|
errorDetails: any;
|
|
@@ -188,7 +188,7 @@ export function buildErrorResult(params: object): {
|
|
|
188
188
|
numTurns: any;
|
|
189
189
|
model: any;
|
|
190
190
|
effort: any;
|
|
191
|
-
sdk:
|
|
191
|
+
sdk: string;
|
|
192
192
|
cancelled: any;
|
|
193
193
|
error: any;
|
|
194
194
|
errorDetails: {
|
|
@@ -61,7 +61,8 @@ export function rollbackAbortedTurn(runState: any, { requestedSessionId, provide
|
|
|
61
61
|
* Outer-catch session cleanup: drop a just-created fresh durable session, drop a
|
|
62
62
|
* create-on-miss reservation placeholder, and roll a resumed session back to its
|
|
63
63
|
* pre-turn leaf for host/runtime-side throws that landed after the harness
|
|
64
|
-
* already mutated the live session.
|
|
64
|
+
* already mutated the live session. Resumed handles are always closed here so
|
|
65
|
+
* setup failures before a harness is returned cannot leave the repo wedged.
|
|
65
66
|
* @param {any} runState
|
|
66
67
|
* @param {{durableRepo: any}} params
|
|
67
68
|
*/
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
/**
|
|
17
17
|
* Build the harness subscribe handler. `harness` is passed for the maxTurns
|
|
18
|
-
* abort; it is already constructed when this is wired (subscribe follows
|
|
19
|
-
* AgentHarness
|
|
18
|
+
* abort; it is already constructed when this is wired (subscribe follows
|
|
19
|
+
* AgentHarness.create()).
|
|
20
20
|
* @param {StreamSubscriberState} runState
|
|
21
21
|
* @param {{onEvent: (event: any) => void, options: any, toolLimits: any, harness: any, sdk: string, model: string}} deps
|
|
22
22
|
* @returns {(event: any) => void}
|
|
@@ -45,7 +45,7 @@ export function thinkingLevelForEffort(effort: string, capabilities: any): strin
|
|
|
45
45
|
export function toolResultErrorOverride(details: any): {
|
|
46
46
|
isError: true;
|
|
47
47
|
} | undefined;
|
|
48
|
-
export function buildTurnHarness(runState: any, { session, piModels, model, thinkingLevel, systemPrompt, outputSchema, tools, transport, maxRetries, maxRetryDelayMs, steeringMode,
|
|
48
|
+
export function buildTurnHarness(runState: any, { session, piModels, model, thinkingLevel, systemPrompt, outputSchema, tools, transport, maxRetries, maxRetryDelayMs, steeringMode, options, }: {
|
|
49
49
|
session: any;
|
|
50
50
|
piModels: any;
|
|
51
51
|
model: any;
|
|
@@ -57,12 +57,40 @@ export function buildTurnHarness(runState: any, { session, piModels, model, thin
|
|
|
57
57
|
maxRetries: any;
|
|
58
58
|
maxRetryDelayMs: any;
|
|
59
59
|
steeringMode: any;
|
|
60
|
-
|
|
60
|
+
options: any;
|
|
61
|
+
}): Promise<{
|
|
62
|
+
models: any;
|
|
63
|
+
getModel: () => any;
|
|
64
|
+
getThinkingLevel: () => any;
|
|
65
|
+
getActiveTools: () => any;
|
|
66
|
+
setActiveTools(names: any): Promise<void>;
|
|
67
|
+
setCompactionSettings(settings: any): Promise<void>;
|
|
68
|
+
appendMessage(message: any): Promise<any>;
|
|
69
|
+
prompt(text: any, promptOptions: any): Promise<any>;
|
|
70
|
+
steer(message: any): Promise<any>;
|
|
71
|
+
abort(): Promise<void>;
|
|
72
|
+
waitForIdle(): any;
|
|
73
|
+
compact(): Promise<any>;
|
|
74
|
+
on(type: any, handler: any): any;
|
|
75
|
+
subscribe(listener: any): () => void;
|
|
76
|
+
abortOpenOperations(): Promise<void>;
|
|
77
|
+
close(): Promise<void>;
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* Subscribe only after prior history has been seeded. Pi emits message
|
|
81
|
+
* lifecycle events for manual appendMessage() calls; subscribing earlier makes
|
|
82
|
+
* restored assistant messages look like fresh output boundaries.
|
|
83
|
+
* @param {any} runState
|
|
84
|
+
* @param {{harness: any, onEvent: (event: any) => void, options: any, toolLimits: any, sdk: string, reference: string}} deps
|
|
85
|
+
*/
|
|
86
|
+
export function activateTurnHarness(runState: any, { harness, onEvent, options, toolLimits, sdk, reference, }: {
|
|
87
|
+
harness: any;
|
|
88
|
+
onEvent: (event: any) => void;
|
|
61
89
|
options: any;
|
|
62
90
|
toolLimits: any;
|
|
63
|
-
sdk:
|
|
64
|
-
reference:
|
|
65
|
-
}):
|
|
91
|
+
sdk: string;
|
|
92
|
+
reference: string;
|
|
93
|
+
}): void;
|
|
66
94
|
/**
|
|
67
95
|
* Start the live-input steering consumer. Consumes follow-up messages and steers
|
|
68
96
|
* the harness mid-run; the consumer is tied to run completion (an internal
|
|
@@ -90,4 +118,3 @@ export function startLiveInput({ harness, options, onEvent }: {
|
|
|
90
118
|
export function runHarnessPrompt(harness: any, promptText: string, promptImages: Array<any>): Promise<{
|
|
91
119
|
runError: any;
|
|
92
120
|
}>;
|
|
93
|
-
import { AgentHarness } from "@earendil-works/pi-agent-core";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Resolve mono-agent's programmatic mode once per run. Tool builders mark
|
|
3
|
+
* stateful/mutating tools sequential; the Pi 0.85 harness adapter promotes any
|
|
4
|
+
* such marker to its global toolExecution setting because mixed scheduling is
|
|
5
|
+
* no longer available upstream.
|
|
5
6
|
*/
|
|
6
7
|
export function resolvePiToolExecutionMode(options?: {}): {
|
|
7
8
|
mode: any;
|
|
@@ -24,7 +25,23 @@ export function generatePiNativeResponse(systemPrompt: any, options?: {}): Promi
|
|
|
24
25
|
export namespace piNativeRuntimeBridge {
|
|
25
26
|
export let id: string;
|
|
26
27
|
export let kind: string;
|
|
27
|
-
export let capabilities:
|
|
28
|
+
export let capabilities: {
|
|
29
|
+
kind: "pi";
|
|
30
|
+
} & {
|
|
31
|
+
supports_session_resume: boolean;
|
|
32
|
+
supports_native_subagents: boolean;
|
|
33
|
+
supports_request_tool_environment: boolean;
|
|
34
|
+
supports_mcp_apps: boolean;
|
|
35
|
+
tool_policy: "projected";
|
|
36
|
+
streaming: boolean;
|
|
37
|
+
structured_output: boolean;
|
|
38
|
+
native_runtime_config: any;
|
|
39
|
+
supports_mcp: boolean;
|
|
40
|
+
supports_skills: boolean;
|
|
41
|
+
supports_builtin_tools: boolean;
|
|
42
|
+
supports_live_input: boolean;
|
|
43
|
+
runtime: string;
|
|
44
|
+
};
|
|
28
45
|
export function supports(ref: any): boolean;
|
|
29
46
|
export { generatePiNativeResponse as execute };
|
|
30
47
|
}
|
|
@@ -1,84 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @param {*} [_legacySelection]
|
|
3
|
+
* @returns {{kind: "pi"} & typeof RUNTIME_CAPABILITIES.pi}
|
|
4
|
+
*/
|
|
5
|
+
export function runtimeCapabilities(_legacySelection?: any): {
|
|
6
|
+
kind: "pi";
|
|
7
|
+
} & typeof RUNTIME_CAPABILITIES.pi;
|
|
2
8
|
export namespace COMMON_CAPABILITIES {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export let supports_fast_mode: boolean;
|
|
15
|
-
export { TOOL_POLICY_PROJECTED as tool_policy };
|
|
9
|
+
let streaming: boolean;
|
|
10
|
+
let structured_output: boolean;
|
|
11
|
+
let supports_session_resume: boolean;
|
|
12
|
+
let native_runtime_config: any;
|
|
13
|
+
let supports_mcp: boolean;
|
|
14
|
+
let supports_mcp_apps: boolean;
|
|
15
|
+
let supports_skills: boolean;
|
|
16
|
+
let supports_builtin_tools: boolean;
|
|
17
|
+
let supports_live_input: boolean;
|
|
18
|
+
let supports_native_subagents: boolean;
|
|
19
|
+
let supports_request_tool_environment: boolean;
|
|
16
20
|
}
|
|
17
21
|
export namespace RUNTIME_CAPABILITIES {
|
|
18
|
-
namespace
|
|
22
|
+
namespace pi {
|
|
19
23
|
let supports_session_resume_1: boolean;
|
|
20
24
|
export { supports_session_resume_1 as supports_session_resume };
|
|
21
|
-
export let runtime: string;
|
|
22
|
-
}
|
|
23
|
-
namespace pi {
|
|
24
|
-
let supports_session_resume_2: boolean;
|
|
25
|
-
export { supports_session_resume_2 as supports_session_resume };
|
|
26
25
|
let supports_native_subagents_1: boolean;
|
|
27
26
|
export { supports_native_subagents_1 as supports_native_subagents };
|
|
28
27
|
let supports_request_tool_environment_1: boolean;
|
|
29
28
|
export { supports_request_tool_environment_1 as supports_request_tool_environment };
|
|
30
29
|
let supports_mcp_apps_1: boolean;
|
|
31
30
|
export { supports_mcp_apps_1 as supports_mcp_apps };
|
|
32
|
-
|
|
33
|
-
export
|
|
34
|
-
}
|
|
35
|
-
namespace codex {
|
|
36
|
-
let supports_session_resume_3: boolean;
|
|
37
|
-
export { supports_session_resume_3 as supports_session_resume };
|
|
38
|
-
let supports_fast_mode_1: boolean;
|
|
39
|
-
export { supports_fast_mode_1 as supports_fast_mode };
|
|
40
|
-
export { TOOL_POLICY_ALLOW_ALL_ONLY as tool_policy };
|
|
41
|
-
let runtime_2: string;
|
|
42
|
-
export { runtime_2 as runtime };
|
|
43
|
-
}
|
|
44
|
-
namespace opencode {
|
|
45
|
-
let structured_output_1: boolean;
|
|
46
|
-
export { structured_output_1 as structured_output };
|
|
47
|
-
let supports_session_resume_4: boolean;
|
|
48
|
-
export { supports_session_resume_4 as supports_session_resume };
|
|
49
|
-
let supports_mcp_1: boolean;
|
|
50
|
-
export { supports_mcp_1 as supports_mcp };
|
|
51
|
-
let supports_skills_1: boolean;
|
|
52
|
-
export { supports_skills_1 as supports_skills };
|
|
53
|
-
let supports_live_input_1: boolean;
|
|
54
|
-
export { supports_live_input_1 as supports_live_input };
|
|
55
|
-
let supports_native_subagents_2: boolean;
|
|
56
|
-
export { supports_native_subagents_2 as supports_native_subagents };
|
|
57
|
-
export { TOOL_POLICY_ALLOW_ALL_ONLY as tool_policy };
|
|
58
|
-
let runtime_3: string;
|
|
59
|
-
export { runtime_3 as runtime };
|
|
60
|
-
}
|
|
61
|
-
namespace acp {
|
|
62
|
-
let structured_output_2: boolean;
|
|
63
|
-
export { structured_output_2 as structured_output };
|
|
64
|
-
let supports_session_resume_5: boolean;
|
|
65
|
-
export { supports_session_resume_5 as supports_session_resume };
|
|
66
|
-
let supports_mcp_2: boolean;
|
|
67
|
-
export { supports_mcp_2 as supports_mcp };
|
|
68
|
-
let supports_skills_2: boolean;
|
|
69
|
-
export { supports_skills_2 as supports_skills };
|
|
70
|
-
let supports_builtin_tools_1: boolean;
|
|
71
|
-
export { supports_builtin_tools_1 as supports_builtin_tools };
|
|
72
|
-
let supports_live_input_2: boolean;
|
|
73
|
-
export { supports_live_input_2 as supports_live_input };
|
|
74
|
-
let supports_native_subagents_3: boolean;
|
|
75
|
-
export { supports_native_subagents_3 as supports_native_subagents };
|
|
76
|
-
let supports_request_tool_environment_2: boolean;
|
|
77
|
-
export { supports_request_tool_environment_2 as supports_request_tool_environment };
|
|
78
|
-
export { TOOL_POLICY_ALLOW_ALL_ONLY as tool_policy };
|
|
79
|
-
let runtime_4: string;
|
|
80
|
-
export { runtime_4 as runtime };
|
|
31
|
+
export { TOOL_POLICY_PROJECTED as tool_policy };
|
|
32
|
+
export let runtime: string;
|
|
81
33
|
}
|
|
82
34
|
}
|
|
83
35
|
import { TOOL_POLICY_PROJECTED } from "./tool-policy.js";
|
|
84
|
-
import { TOOL_POLICY_ALLOW_ALL_ONLY } from "./tool-policy.js";
|
|
@@ -1,35 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {string} value
|
|
3
|
-
* @returns {string}
|
|
4
|
-
*/
|
|
5
|
-
export function canonicalizeLegacyModelReference(value: string): string;
|
|
6
1
|
/**
|
|
7
2
|
* @param {string} value
|
|
8
3
|
* @returns {RuntimeModelRef}
|
|
9
4
|
*/
|
|
10
5
|
export function normalizeRuntimeModelReference(value: string): RuntimeModelRef;
|
|
11
|
-
/**
|
|
12
|
-
* @param {string} value
|
|
13
|
-
* @returns {RuntimeModelRef["sdk"]}
|
|
14
|
-
*/
|
|
15
|
-
export function sdkFromModelReference(value: string): RuntimeModelRef["sdk"];
|
|
16
6
|
/**
|
|
17
7
|
* @param {string} value
|
|
18
8
|
* @returns {RuntimeModelRef}
|
|
19
9
|
*/
|
|
20
10
|
export function parseRuntimeModelReference(value: string): RuntimeModelRef;
|
|
21
|
-
/**
|
|
22
|
-
* @param {string|RuntimeModelRef} modelRefOrParsed
|
|
23
|
-
* @param {string} executionMode
|
|
24
|
-
* @returns {string|null}
|
|
25
|
-
*/
|
|
26
|
-
export function executionModeIncompatibilityReason(modelRefOrParsed: string | RuntimeModelRef, executionMode: string): string | null;
|
|
27
|
-
/**
|
|
28
|
-
* @param {string|RuntimeModelRef} modelRefOrParsed
|
|
29
|
-
* @param {string} executionMode
|
|
30
|
-
* @returns {boolean}
|
|
31
|
-
*/
|
|
32
|
-
export function isModelCompatibleWithExecutionMode(modelRefOrParsed: string | RuntimeModelRef, executionMode: string): boolean;
|
|
33
|
-
export const ACTIVE_RUNTIME_KINDS: string[];
|
|
34
|
-
export const RESERVED_RUNTIME_KINDS: string[];
|
|
35
11
|
export type RuntimeModelRef = import("../types.js").RuntimeModelRef;
|
|
@@ -2,22 +2,18 @@
|
|
|
2
2
|
* @param {Object} [options]
|
|
3
3
|
* @param {AgentRuntimeHostOptions} [options.host]
|
|
4
4
|
* @param {ReadonlyArray<RuntimeModelRef|RouterChainEntryInput>} [options.chain]
|
|
5
|
-
* @param {
|
|
6
|
-
* @param {(input: {model: RuntimeModelRef, executionMode: string|null, attemptIndex: number, retryIndex: number, routeSafety: "uniform"|"per-route-native"}) => (RouterAttemptResolution|Promise<RouterAttemptResolution>)} [options.resolveAttempt]
|
|
5
|
+
* @param {(input: {model: RuntimeModelRef, attemptIndex: number, retryIndex: number}) => (RouterAttemptResolution|Promise<RouterAttemptResolution>)} [options.resolveAttempt]
|
|
7
6
|
* @param {Partial<RouterRetryPolicy>} [options.retry] Backoff shape for same-model
|
|
8
7
|
* retries. Per-route retry counts live on each chain entry's `attempts`.
|
|
9
8
|
* @returns {AgentRuntimeInstance & {chain: () => Array<RouterChainEntry>}}
|
|
10
9
|
*/
|
|
11
|
-
export function createRouterRuntime({ host, chain,
|
|
10
|
+
export function createRouterRuntime({ host, chain, resolveAttempt, retry }?: {
|
|
12
11
|
host?: AgentRuntimeHostOptions;
|
|
13
12
|
chain?: ReadonlyArray<RuntimeModelRef | RouterChainEntryInput>;
|
|
14
|
-
routeSafety?: "uniform" | "per-route-native";
|
|
15
13
|
resolveAttempt?: (input: {
|
|
16
14
|
model: RuntimeModelRef;
|
|
17
|
-
executionMode: string | null;
|
|
18
15
|
attemptIndex: number;
|
|
19
16
|
retryIndex: number;
|
|
20
|
-
routeSafety: "uniform" | "per-route-native";
|
|
21
17
|
}) => (RouterAttemptResolution | Promise<RouterAttemptResolution>);
|
|
22
18
|
retry?: Partial<RouterRetryPolicy>;
|
|
23
19
|
}): AgentRuntimeInstance & {
|
|
@@ -30,12 +26,10 @@ export type RuntimeRunOptions = import("../types.js").RuntimeRunOptions;
|
|
|
30
26
|
export type RuntimeResult = import("../types.js").RuntimeResult;
|
|
31
27
|
/**
|
|
32
28
|
* A chain entry as accepted by createRouterRuntime: either the shorthand bare
|
|
33
|
-
* RuntimeModelRef, or the full `{model,
|
|
34
|
-
* attempts?}` form.
|
|
29
|
+
* RuntimeModelRef, or the full `{model, effort?, requires?, attempts?}` form.
|
|
35
30
|
*/
|
|
36
31
|
export type RouterChainEntryInput = {
|
|
37
32
|
model: RuntimeModelRef;
|
|
38
|
-
executionMode?: string;
|
|
39
33
|
effort?: string | null;
|
|
40
34
|
requires?: {
|
|
41
35
|
[x: string]: any;
|
|
@@ -44,7 +38,6 @@ export type RouterChainEntryInput = {
|
|
|
44
38
|
};
|
|
45
39
|
export type RouterChainEntry = {
|
|
46
40
|
model: RuntimeModelRef;
|
|
47
|
-
executionMode: string | null;
|
|
48
41
|
effort: string | null | undefined;
|
|
49
42
|
requires: {
|
|
50
43
|
[x: string]: any;
|
|
@@ -11,5 +11,3 @@
|
|
|
11
11
|
export function isAllowAllToolPolicy(allowedTools: any, disallowedTools: any): boolean;
|
|
12
12
|
/** @type {"projected"} */
|
|
13
13
|
export const TOOL_POLICY_PROJECTED: "projected";
|
|
14
|
-
/** @type {"allow_all_only"} */
|
|
15
|
-
export const TOOL_POLICY_ALLOW_ALL_ONLY: "allow_all_only";
|