@tangle-network/agent-runtime 0.142.3 → 0.153.1
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 +32 -0
- package/dist/{activation-o7JKmtxi.js → activation-DKxQsHiO.js} +3 -3
- package/dist/{activation-o7JKmtxi.js.map → activation-DKxQsHiO.js.map} +1 -1
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +3 -3
- package/dist/{analyst-loop-GcX0BY75.js → analyst-loop-B2kTHKNh.js} +2 -2
- package/dist/{analyst-loop-GcX0BY75.js.map → analyst-loop-B2kTHKNh.js.map} +1 -1
- package/dist/analyst-loop.d.ts +1 -1
- package/dist/analyst-loop.js +1 -1
- package/dist/{authoring-Bm1WlGPv.js → authoring-Tk2xFys0.js} +2 -2
- package/dist/{authoring-Bm1WlGPv.js.map → authoring-Tk2xFys0.js.map} +1 -1
- package/dist/candidate-execution/index.js +4 -4
- package/dist/{candidate-execution-CD5PoNmC.js → candidate-execution-CB9RJbbJ.js} +4 -4
- package/dist/{candidate-execution-CD5PoNmC.js.map → candidate-execution-CB9RJbbJ.js.map} +1 -1
- package/dist/{conversation-DXKJHyqB.js → conversation-D64WyWrK.js} +4 -4
- package/dist/{conversation-DXKJHyqB.js.map → conversation-D64WyWrK.js.map} +1 -1
- package/dist/conversation.d.ts +1 -1
- package/dist/conversation.js +1 -1
- package/dist/durable.d.ts +102 -4
- package/dist/durable.js +259 -10
- package/dist/durable.js.map +1 -1
- package/dist/{environment-provider-BicwCDK5.d.ts → environment-provider-DJG0yIYl.d.ts} +3 -3
- package/dist/{environment-provider-DCEACNt9.js → environment-provider-D_MXw3jK.js} +88 -9
- package/dist/environment-provider-D_MXw3jK.js.map +1 -0
- package/dist/environment-provider.d.ts +1 -1
- package/dist/environment-provider.js +1 -1
- package/dist/executable-spec-BUcUcEPk.js +73 -0
- package/dist/executable-spec-BUcUcEPk.js.map +1 -0
- package/dist/{graph-DhrLuLOS.js → graph-M0Qr4863.js} +4 -4
- package/dist/{graph-DhrLuLOS.js.map → graph-M0Qr4863.js.map} +1 -1
- package/dist/{improvement-cycle-lcwlR6E2.js → improvement-cycle-CDxlGQGE.js} +7 -7
- package/dist/{improvement-cycle-lcwlR6E2.js.map → improvement-cycle-CDxlGQGE.js.map} +1 -1
- package/dist/{index-Bx3-tqG-.d.ts → index-BihHgUAI.d.ts} +4 -4
- package/dist/{index-D_aH0F4C.d.ts → index-Dlz7ejRx.d.ts} +342 -521
- package/dist/{index-CV1xRWy2.d.ts → index-LQfgFJoX.d.ts} +3 -3
- package/dist/index.d.ts +9 -9
- package/dist/index.js +13 -13
- package/dist/intelligence.d.ts +5 -5
- package/dist/intelligence.js +6 -6
- package/dist/kernel.d.ts +7 -7
- package/dist/kernel.js +13 -13
- package/dist/{knowledge-C9LlSJAR.js → knowledge-DM-i40b9.js} +10 -7
- package/dist/{knowledge-C9LlSJAR.js.map → knowledge-DM-i40b9.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-CctBy5-X.d.ts → loop-runner-bin-D-BW51yr.d.ts} +3 -3
- package/dist/{loop-runner-bin-DFo6Ss-1.js → loop-runner-bin-pD5WJuqJ.js} +4 -4
- package/dist/{loop-runner-bin-DFo6Ss-1.js.map → loop-runner-bin-pD5WJuqJ.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/{materialization-CrdcfWXp.js → materialization-Bo6j3Hg9.js} +261 -24
- package/dist/materialization-Bo6j3Hg9.js.map +1 -0
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +5 -5
- package/dist/mcp/index.js +6 -6
- package/dist/{model-policy-DgRJIJse.js → model-policy-Sw4ywhtL.js} +68 -6
- package/dist/model-policy-Sw4ywhtL.js.map +1 -0
- package/dist/{openai-tools-CSm460sC.js → openai-tools-CWBywy-e.js} +2 -2
- package/dist/{openai-tools-CSm460sC.js.map → openai-tools-CWBywy-e.js.map} +1 -1
- package/dist/{openai-tools-t5-6h5bj.d.ts → openai-tools-z-whdYNC.d.ts} +2 -2
- package/dist/{prepare-D3n7cA39.js → prepare-C3eFd3UA.js} +2 -2
- package/dist/{prepare-D3n7cA39.js.map → prepare-C3eFd3UA.js.map} +1 -1
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/profiles.js +1 -1
- package/dist/{protected-model-port-bq6bD9YX.js → protected-model-port-Dn2b6peS.js} +2 -2
- package/dist/{protected-model-port-bq6bD9YX.js.map → protected-model-port-Dn2b6peS.js.map} +1 -1
- package/dist/{redact-B0gDSTZO.d.ts → redact-NAptmqKw.d.ts} +3 -3
- package/dist/{researcher-CiSY6Wzb.js → researcher-BMFFPwKb.js} +2 -2
- package/dist/{researcher-CiSY6Wzb.js.map → researcher-BMFFPwKb.js.map} +1 -1
- package/dist/{run-layout-Be_Z0dF8.js → run-layout-C2jgwsCq.js} +111 -6
- package/dist/run-layout-C2jgwsCq.js.map +1 -0
- package/dist/{runtime-htqI3fKL.d.ts → runtime-B-5dp5Iz.d.ts} +223 -11
- package/dist/{runtime-DQs5xHdt.js → runtime-RY_rvv7t.js} +93 -84
- package/dist/runtime-RY_rvv7t.js.map +1 -0
- package/dist/{sandbox-events-BK-g19wx.js → sandbox-events-DMijDq2p.js} +53 -49
- package/dist/sandbox-events-DMijDq2p.js.map +1 -0
- package/dist/{spawn-journal-D2HKUImC.js → spawn-journal-CLguaA2A.js} +8 -43
- package/dist/spawn-journal-CLguaA2A.js.map +1 -0
- package/dist/{stream-agent-turn-Dfy12OjG.d.ts → stream-agent-turn-BGyszuPH.d.ts} +6 -3
- package/dist/{stream-agent-turn-BMHUIuQS.js → stream-agent-turn-D6HoaRPV.js} +140 -23
- package/dist/stream-agent-turn-D6HoaRPV.js.map +1 -0
- package/dist/{structural-rollout-CzZKDkmA.js → structural-rollout-P1YxFRfl.js} +11 -8
- package/dist/structural-rollout-P1YxFRfl.js.map +1 -0
- package/dist/{supervise-BEs5MB91.js → supervise-BezbzKiJ.js} +1550 -1186
- package/dist/supervise-BezbzKiJ.js.map +1 -0
- package/dist/{supervisor-B_0ISTFG.js → supervisor-DBVlPONC.js} +697 -230
- package/dist/supervisor-DBVlPONC.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +12 -12
- package/dist/{top-app-BMOSKK06.js → top-app-tKo9OrON.js} +189 -86
- package/dist/top-app-tKo9OrON.js.map +1 -0
- package/dist/tui/bin.js +1 -1
- package/dist/tui/index.d.ts +32 -4
- package/dist/tui/index.js +1 -1
- package/dist/{types-_7w24mMg.d.ts → types-BPQhQRrC.d.ts} +508 -11
- package/dist/{types-DZrBoBpN.d.ts → types-DeX8ibLc.d.ts} +4 -1
- package/dist/{util-C1bv6yog.js → util-Bncw0o_F.js} +41 -2
- package/dist/util-Bncw0o_F.js.map +1 -0
- package/dist/{workspace-archive-C52LjkeN.js → workspace-archive-Dm73lTfB.js} +2 -2
- package/dist/{workspace-archive-C52LjkeN.js.map → workspace-archive-Dm73lTfB.js.map} +1 -1
- package/package.json +6 -6
- package/dist/environment-provider-DCEACNt9.js.map +0 -1
- package/dist/materialization-CrdcfWXp.js.map +0 -1
- package/dist/model-policy-DgRJIJse.js.map +0 -1
- package/dist/retained-run-binding-Dp2e8xne.js +0 -268
- package/dist/retained-run-binding-Dp2e8xne.js.map +0 -1
- package/dist/run-layout-Be_Z0dF8.js.map +0 -1
- package/dist/runtime-DQs5xHdt.js.map +0 -1
- package/dist/sandbox-events-BK-g19wx.js.map +0 -1
- package/dist/spawn-journal-D2HKUImC.js.map +0 -1
- package/dist/stream-agent-turn-BMHUIuQS.js.map +0 -1
- package/dist/structural-rollout-CzZKDkmA.js.map +0 -1
- package/dist/supervise-BEs5MB91.js.map +0 -1
- package/dist/supervisor-B_0ISTFG.js.map +0 -1
- package/dist/top-app-BMOSKK06.js.map +0 -1
- package/dist/util-C1bv6yog.js.map +0 -1
|
@@ -1,8 +1,310 @@
|
|
|
1
|
-
import { J as AgentTaskStatus, U as AgentRuntimeEvent, at as RuntimeStreamEvent, v as LoopTokenUsage, y as LoopTraceEmitter } from "./types-
|
|
1
|
+
import { J as AgentTaskStatus, U as AgentRuntimeEvent, at as RuntimeStreamEvent, v as LoopTokenUsage, y as LoopTraceEmitter } from "./types-DeX8ibLc.js";
|
|
2
2
|
import { l as RuntimeHooks } from "./runtime-hooks-Bj6wJHlH.js";
|
|
3
|
-
import { AgentProfile, Sha256Digest } from "@tangle-network/agent-interface";
|
|
3
|
+
import { AgentExactRunControlRef, AgentInteractiveSession, AgentInteractiveSessionPromptAcknowledgement, AgentInteractiveSessionPromptCommand, AgentInteractiveSessionRef, AgentInteractiveSessionStart, AgentNativeContextContinuationOptions, AgentNativeContextContinuationResult, AgentProfile, AgentSessionStatus, ChildTaskEvent, InteractionAcknowledgement, InteractionRequest, InteractionResponseCommand, NativeContextBoundaryProof, NativeContextContinuationRequest, NativeContextContinuationTurn, RuntimeEventEnvelope, Sha256Digest } from "@tangle-network/agent-interface";
|
|
4
4
|
import { ControlEvalResult, DefaultVerdict, KnowledgeReadinessReport, KnowledgeRequirement, ToolSpan } from "@tangle-network/agent-eval";
|
|
5
5
|
import { BackendType } from "@tangle-network/sandbox";
|
|
6
|
+
import { AgentEnvironment, AgentEnvironmentCapabilities, AgentEnvironmentProvider, AgentTurnInput, AgentTurnResult, CreateAgentEnvironmentInput } from "@tangle-network/agent-interface/environment-provider";
|
|
7
|
+
//#region src/runtime/retained-run-types.d.ts
|
|
8
|
+
/** Cursor plus runtime sequence needed to continue one ordered replay. @stable */
|
|
9
|
+
interface RetainedRunReplayPoint {
|
|
10
|
+
readonly cursor: string;
|
|
11
|
+
readonly sequence: number;
|
|
12
|
+
}
|
|
13
|
+
/** Options for replaying canonical events strictly after a saved point. @stable */
|
|
14
|
+
interface RetainedRunEventOptions {
|
|
15
|
+
readonly after?: RetainedRunReplayPoint;
|
|
16
|
+
readonly signal?: AbortSignal;
|
|
17
|
+
}
|
|
18
|
+
/** Effect recorded for one retained control operation. @stable */
|
|
19
|
+
type RetainedRunEffect = 'cancel_requested' | 'cancelled' | 'not_live' | 'unknown';
|
|
20
|
+
/** Stable status snapshot for a retained run. @stable */
|
|
21
|
+
interface RetainedRunSnapshot {
|
|
22
|
+
readonly runId: string;
|
|
23
|
+
readonly controlRef: AgentExactRunControlRef;
|
|
24
|
+
readonly status: AgentSessionStatus | null;
|
|
25
|
+
readonly effect: RetainedRunEffect;
|
|
26
|
+
readonly observedAt: string;
|
|
27
|
+
readonly reason?: string;
|
|
28
|
+
readonly signal?: string;
|
|
29
|
+
}
|
|
30
|
+
/** Durable acknowledgement state for one retained control operation. @stable */
|
|
31
|
+
interface RetainedRunCancellation {
|
|
32
|
+
readonly operationId: string;
|
|
33
|
+
readonly requestDigest: Sha256Digest;
|
|
34
|
+
readonly status: 'accepted' | 'replayed' | 'conflict' | 'unknown';
|
|
35
|
+
readonly effect: RetainedRunEffect;
|
|
36
|
+
readonly snapshot: RetainedRunSnapshot;
|
|
37
|
+
readonly reason?: string;
|
|
38
|
+
readonly signal?: string;
|
|
39
|
+
}
|
|
40
|
+
/** Options for an idempotent retained cancellation. @stable */
|
|
41
|
+
interface RetainedRunCancelOptions {
|
|
42
|
+
readonly operationId: string;
|
|
43
|
+
readonly reason?: string;
|
|
44
|
+
readonly signal?: AbortSignal;
|
|
45
|
+
}
|
|
46
|
+
/** Runtime controls plus the exact user turn bound into a continuation request. @stable */
|
|
47
|
+
type NativeContextContinuationInput = NativeContextContinuationTurn & Omit<AgentNativeContextContinuationOptions, 'turn'>;
|
|
48
|
+
/** Result of one verified same-session continuation. @stable */
|
|
49
|
+
type NativeContextContinuationExecution = AgentNativeContextContinuationResult;
|
|
50
|
+
/** Reconstructable control of one provider-retained run. @stable */
|
|
51
|
+
interface RetainedRunHandle {
|
|
52
|
+
readonly controlRef: AgentExactRunControlRef;
|
|
53
|
+
/** Capabilities measured from the exact environment that owns this run. */
|
|
54
|
+
readonly capabilities: AgentEnvironmentCapabilities;
|
|
55
|
+
status(options?: {
|
|
56
|
+
waitMs?: number;
|
|
57
|
+
signal?: AbortSignal;
|
|
58
|
+
}): Promise<RetainedRunSnapshot>;
|
|
59
|
+
events(options?: RetainedRunEventOptions): AsyncIterable<RuntimeEventEnvelope>;
|
|
60
|
+
result(): Promise<AgentTurnResult>;
|
|
61
|
+
respondToInteraction(command: InteractionResponseCommand, options?: {
|
|
62
|
+
signal?: AbortSignal;
|
|
63
|
+
}): Promise<InteractionAcknowledgement>;
|
|
64
|
+
contextBoundary(options?: {
|
|
65
|
+
signal?: AbortSignal;
|
|
66
|
+
}): Promise<NativeContextBoundaryProof | null>;
|
|
67
|
+
continueNative(request: NativeContextContinuationRequest, turn: NativeContextContinuationInput): Promise<NativeContextContinuationExecution>;
|
|
68
|
+
cancel(options: RetainedRunCancelOptions): Promise<RetainedRunCancellation>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Sanitized headless intent durable before environment creation.
|
|
72
|
+
*
|
|
73
|
+
* The request digest binds the public create and turn material without
|
|
74
|
+
* retaining secret values. The original start material is required to replay
|
|
75
|
+
* this record after a process crash.
|
|
76
|
+
* @stable
|
|
77
|
+
*/
|
|
78
|
+
interface RetainedRunIntentAdmission {
|
|
79
|
+
readonly phase: 'intent';
|
|
80
|
+
readonly provider: string;
|
|
81
|
+
readonly idempotencyKey: string;
|
|
82
|
+
readonly turnId: string;
|
|
83
|
+
readonly sessionId: string;
|
|
84
|
+
readonly executionId: string;
|
|
85
|
+
readonly runId: string;
|
|
86
|
+
readonly requestedProfileDigest: Sha256Digest;
|
|
87
|
+
readonly requestDigest: Sha256Digest;
|
|
88
|
+
}
|
|
89
|
+
/** Recovery coordinates durable after environment creation and before dispatch. @stable */
|
|
90
|
+
interface RetainedRunEnvironmentAdmission {
|
|
91
|
+
readonly phase: 'environment';
|
|
92
|
+
readonly provider: string;
|
|
93
|
+
readonly environmentId: string;
|
|
94
|
+
readonly idempotencyKey: string;
|
|
95
|
+
readonly turnId: string;
|
|
96
|
+
/** Caller-supplied or runtime-minted; always the identity the dispatch will request. */
|
|
97
|
+
readonly sessionId: string;
|
|
98
|
+
/** Caller-supplied or runtime-minted; always the identity the dispatch will request. */
|
|
99
|
+
readonly executionId: string;
|
|
100
|
+
}
|
|
101
|
+
/** The verified exact reference, durable before the start promise resolves. @stable */
|
|
102
|
+
interface RetainedRunDispatchedAdmission {
|
|
103
|
+
readonly phase: 'dispatched';
|
|
104
|
+
readonly controlRef: AgentExactRunControlRef;
|
|
105
|
+
readonly idempotencyKey: string;
|
|
106
|
+
readonly turnId: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Sanitized intent durable before an interactive environment create begins.
|
|
110
|
+
*
|
|
111
|
+
* The digest covers the public start and create material without retaining that
|
|
112
|
+
* material. It never carries environment variables, secret values, or provider
|
|
113
|
+
* options. The replay input supplies private values after this check.
|
|
114
|
+
* @stable
|
|
115
|
+
*/
|
|
116
|
+
interface RetainedInteractiveIntentAdmission {
|
|
117
|
+
readonly phase: 'interactive_intent';
|
|
118
|
+
readonly provider: string;
|
|
119
|
+
readonly idempotencyKey: string;
|
|
120
|
+
readonly interactiveIdempotencyKey: string;
|
|
121
|
+
readonly sessionId: string;
|
|
122
|
+
readonly executionId: string;
|
|
123
|
+
readonly runId: string;
|
|
124
|
+
readonly requestedProfileDigest: Sha256Digest;
|
|
125
|
+
readonly requestDigest: Sha256Digest;
|
|
126
|
+
}
|
|
127
|
+
/** Exact interactive start request durable after environment creation. @stable */
|
|
128
|
+
interface RetainedInteractiveEnvironmentAdmission {
|
|
129
|
+
readonly phase: 'interactive_environment';
|
|
130
|
+
readonly provider: string;
|
|
131
|
+
readonly environmentId: string;
|
|
132
|
+
readonly idempotencyKey: string;
|
|
133
|
+
readonly interactiveIdempotencyKey: string;
|
|
134
|
+
readonly request: AgentInteractiveSessionStart;
|
|
135
|
+
}
|
|
136
|
+
/** Provider-issued interactive process reference durable before start returns. @stable */
|
|
137
|
+
interface RetainedInteractiveStartedAdmission {
|
|
138
|
+
readonly phase: 'interactive_started';
|
|
139
|
+
readonly idempotencyKey: string;
|
|
140
|
+
readonly interactiveIdempotencyKey: string;
|
|
141
|
+
readonly ref: AgentInteractiveSessionRef;
|
|
142
|
+
}
|
|
143
|
+
/** Durable records for one exact native coding-agent process. @stable */
|
|
144
|
+
type RetainedInteractiveAdmission = RetainedInteractiveIntentAdmission | RetainedInteractiveEnvironmentAdmission | RetainedInteractiveStartedAdmission;
|
|
145
|
+
/** One detached-run admission record the runtime persists before creation or dispatch proceeds. @stable */
|
|
146
|
+
type RetainedRunAdmission = RetainedRunIntentAdmission | RetainedRunEnvironmentAdmission | RetainedRunDispatchedAdmission;
|
|
147
|
+
/**
|
|
148
|
+
* Awaited durability hook for retained admission records.
|
|
149
|
+
*
|
|
150
|
+
* The runtime blocks after the pre-create intent, environment creation, and
|
|
151
|
+
* provider work until the hook resolves. No retained run becomes caller-visible
|
|
152
|
+
* before its exact recovery record is durable. A rejection keeps provider state
|
|
153
|
+
* for recovery when provider work has already started.
|
|
154
|
+
*
|
|
155
|
+
* @stable
|
|
156
|
+
*/
|
|
157
|
+
type RetainedRunAdmissionHook = (admission: RetainedRunAdmission) => Promise<void>;
|
|
158
|
+
/** Environment, turn, and optional identity needed to replay one retained start. @stable */
|
|
159
|
+
interface RetainedRunStartMaterial {
|
|
160
|
+
readonly environment: CreateAgentEnvironmentInput & {
|
|
161
|
+
idempotencyKey: string;
|
|
162
|
+
};
|
|
163
|
+
readonly turn: AgentTurnInput & {
|
|
164
|
+
turnId: string;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Explicit dispatch coordinates. When omitted, the runtime mints
|
|
168
|
+
* deterministic coordinates from `(environment.idempotencyKey, turn.turnId)`
|
|
169
|
+
* so every process derives the same values.
|
|
170
|
+
*/
|
|
171
|
+
readonly identity?: {
|
|
172
|
+
readonly sessionId: string;
|
|
173
|
+
readonly executionId: string;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/** A retained start is retry-safe only when environment and turn keys are explicit. @stable */
|
|
177
|
+
interface StartRetainedRunOptions extends RetainedRunStartMaterial {
|
|
178
|
+
readonly provider: AgentEnvironmentProvider;
|
|
179
|
+
/** A previously persisted intent used to replay the exact create operation. */
|
|
180
|
+
readonly intent?: RetainedRunIntentAdmission;
|
|
181
|
+
readonly onAdmission: RetainedRunAdmissionHook;
|
|
182
|
+
readonly now?: () => number;
|
|
183
|
+
}
|
|
184
|
+
/** A fresh retained session inside a provider environment that already exists. @stable */
|
|
185
|
+
interface StartRetainedRunInEnvironmentOptions {
|
|
186
|
+
readonly provider: AgentEnvironmentProvider;
|
|
187
|
+
readonly environment: {
|
|
188
|
+
/** Stable provider environment identifier used by `provider.get`. */
|
|
189
|
+
readonly id: string;
|
|
190
|
+
/** Original environment key. The provider must return the matching retained metadata. */
|
|
191
|
+
readonly idempotencyKey: string;
|
|
192
|
+
};
|
|
193
|
+
readonly turn: AgentTurnInput & {
|
|
194
|
+
turnId: string;
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Explicit fresh-session coordinates. When omitted, the runtime mints them
|
|
198
|
+
* from `(environment.idempotencyKey, turn.turnId)`.
|
|
199
|
+
*/
|
|
200
|
+
readonly identity?: {
|
|
201
|
+
readonly sessionId: string;
|
|
202
|
+
readonly executionId: string;
|
|
203
|
+
};
|
|
204
|
+
readonly onAdmission: RetainedRunAdmissionHook;
|
|
205
|
+
readonly now?: () => number;
|
|
206
|
+
}
|
|
207
|
+
/** Inputs sufficient to rebuild a control client in a new process. @stable */
|
|
208
|
+
interface ReconnectRetainedRunOptions {
|
|
209
|
+
readonly provider: AgentEnvironmentProvider;
|
|
210
|
+
readonly controlRef: AgentExactRunControlRef;
|
|
211
|
+
readonly now?: () => number;
|
|
212
|
+
}
|
|
213
|
+
/** Recover a headless start after its pre-create intent was persisted. @stable */
|
|
214
|
+
interface RecoverRetainedRunIntentOptions {
|
|
215
|
+
readonly provider: AgentEnvironmentProvider;
|
|
216
|
+
readonly admission: RetainedRunIntentAdmission;
|
|
217
|
+
/** The exact original environment, turn, and optional identity material. */
|
|
218
|
+
readonly replay: RetainedRunStartMaterial;
|
|
219
|
+
readonly onAdmission: RetainedRunAdmissionHook;
|
|
220
|
+
readonly now?: () => number;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Pre-dispatch admission coordinates for one recovery attempt.
|
|
224
|
+
*
|
|
225
|
+
* A `phase: 'environment'` admission record carries these fields, so a caller
|
|
226
|
+
* can pass that record after a crash before the dispatched record landed.
|
|
227
|
+
*
|
|
228
|
+
* @stable
|
|
229
|
+
*/
|
|
230
|
+
interface RecoverRetainedRunOptions {
|
|
231
|
+
readonly provider: AgentEnvironmentProvider;
|
|
232
|
+
readonly environmentId: string;
|
|
233
|
+
readonly sessionId: string;
|
|
234
|
+
readonly executionId: string;
|
|
235
|
+
readonly now?: () => number;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Outcome of one recovery attempt from pre-dispatch admission coordinates.
|
|
239
|
+
*
|
|
240
|
+
* `not_found`: the provider no longer holds the environment; nothing remains
|
|
241
|
+
* to destroy. `recovered`: the provider self-identified the session with a
|
|
242
|
+
* strict exact reference matching the recorded coordinates. `unverifiable`:
|
|
243
|
+
* the environment exists but the provider cannot self-identify the session;
|
|
244
|
+
* never destroy on this outcome — keep the environment, retry
|
|
245
|
+
* `reconnectRetainedRun` with a dispatched admission record, or inspect it
|
|
246
|
+
* with provider-native tools.
|
|
247
|
+
*
|
|
248
|
+
* @stable
|
|
249
|
+
*/
|
|
250
|
+
type RecoverRetainedRunResult = {
|
|
251
|
+
readonly outcome: 'recovered';
|
|
252
|
+
readonly handle: RetainedRunHandle;
|
|
253
|
+
} | {
|
|
254
|
+
readonly outcome: 'not_found';
|
|
255
|
+
} | {
|
|
256
|
+
readonly outcome: 'unverifiable';
|
|
257
|
+
readonly environment: AgentEnvironment;
|
|
258
|
+
};
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region src/runtime/retained-interactive-types.d.ts
|
|
261
|
+
/** Environment and exact AgentProfile used to start one native coding-agent process. @stable */
|
|
262
|
+
type RetainedInteractiveEnvironmentInput = Omit<CreateAgentEnvironmentInput, 'idempotencyKey' | 'profile' | 'signal'> & {
|
|
263
|
+
readonly idempotencyKey: string;
|
|
264
|
+
readonly profile: AgentProfile;
|
|
265
|
+
};
|
|
266
|
+
/** Material used to create and start one native coding-agent TUI. @stable */
|
|
267
|
+
interface RetainedInteractiveStartMaterial {
|
|
268
|
+
readonly environment: RetainedInteractiveEnvironmentInput;
|
|
269
|
+
readonly interactiveIdempotencyKey: string;
|
|
270
|
+
readonly initialPrompt?: string;
|
|
271
|
+
readonly cwd?: string;
|
|
272
|
+
readonly cols?: number;
|
|
273
|
+
readonly rows?: number;
|
|
274
|
+
}
|
|
275
|
+
/** Start one retry-safe native coding-agent TUI in a new environment. @stable */
|
|
276
|
+
interface StartRetainedInteractiveRunOptions extends RetainedInteractiveStartMaterial {
|
|
277
|
+
readonly provider: AgentEnvironmentProvider;
|
|
278
|
+
/** A previously persisted intent used to replay the exact create operation. */
|
|
279
|
+
readonly intent?: RetainedInteractiveIntentAdmission;
|
|
280
|
+
readonly onAdmission: RetainedInteractiveAdmissionHook;
|
|
281
|
+
readonly signal?: AbortSignal;
|
|
282
|
+
}
|
|
283
|
+
/** Persist each exact interactive record before the runtime proceeds. @stable */
|
|
284
|
+
type RetainedInteractiveAdmissionHook = (admission: RetainedInteractiveAdmission) => Promise<void>;
|
|
285
|
+
/** Reconstruct one exact provider-owned native coding-agent process. @stable */
|
|
286
|
+
interface ReconnectRetainedInteractiveRunOptions {
|
|
287
|
+
readonly provider: AgentEnvironmentProvider;
|
|
288
|
+
readonly ref: AgentInteractiveSessionRef;
|
|
289
|
+
readonly signal?: AbortSignal;
|
|
290
|
+
}
|
|
291
|
+
/** Recover a start after a pre-create crash or a lost provider response. @stable */
|
|
292
|
+
interface RecoverRetainedInteractiveRunOptions {
|
|
293
|
+
readonly provider: AgentEnvironmentProvider;
|
|
294
|
+
readonly admission: RetainedInteractiveIntentAdmission | RetainedInteractiveEnvironmentAdmission;
|
|
295
|
+
/** Required when recovering from an intent before an environment existed. */
|
|
296
|
+
readonly replay?: RetainedInteractiveStartMaterial;
|
|
297
|
+
readonly onAdmission: RetainedInteractiveAdmissionHook;
|
|
298
|
+
readonly signal?: AbortSignal;
|
|
299
|
+
}
|
|
300
|
+
/** Exact interactive process controls plus measured environment capabilities. @stable */
|
|
301
|
+
interface RetainedInteractiveRunHandle extends AgentInteractiveSession {
|
|
302
|
+
readonly capabilities: AgentEnvironmentCapabilities;
|
|
303
|
+
sendPrompt(command: AgentInteractiveSessionPromptCommand, options?: {
|
|
304
|
+
signal?: AbortSignal;
|
|
305
|
+
}): Promise<AgentInteractiveSessionPromptAcknowledgement>;
|
|
306
|
+
}
|
|
307
|
+
//#endregion
|
|
6
308
|
//#region src/runtime/supervise/progress.d.ts
|
|
7
309
|
/** How long a worker may produce no metered activity before a `progress()` read calls it stalled.
|
|
8
310
|
* Deliberately generous: a coding harness routinely spends minutes inside one tool call, and a
|
|
@@ -817,6 +1119,23 @@ interface Executor<Out> {
|
|
|
817
1119
|
* this runtime (the settle-time analyzers still work).
|
|
818
1120
|
*/
|
|
819
1121
|
traceSource?(): TraceSource | undefined;
|
|
1122
|
+
/**
|
|
1123
|
+
* The exact interactive process this worker runs in, when its execution was started in an
|
|
1124
|
+
* attachable terminal. Read through `Scope.interactive`; synchronous and side-effect free, and
|
|
1125
|
+
* it must not throw. Omitting it is the honest answer for every headless executor: omission
|
|
1126
|
+
* reads as `executor-exposes-no-interactive-session`, never as an empty handle.
|
|
1127
|
+
*/
|
|
1128
|
+
interactive?(): WorkerInteractiveSession;
|
|
1129
|
+
/**
|
|
1130
|
+
* Optional provider-neutral CANCELLATION, distinct from `teardown`: it asks the backend to stop
|
|
1131
|
+
* the work and reports what the backend acknowledged, so a caller never has to read a local
|
|
1132
|
+
* iterator abort as remote acceptance. `teardown` remains the resource verb — it releases what
|
|
1133
|
+
* this process holds and says nothing about remote compute or billing.
|
|
1134
|
+
*
|
|
1135
|
+
* An executor that cannot ask its backend anything omits this method; one whose backend has no
|
|
1136
|
+
* cancel operation implements it and answers `unknown` with the reason in `detail`.
|
|
1137
|
+
*/
|
|
1138
|
+
cancel?(request: ExecutorCancellationRequest): Promise<ExecutorCancellation>;
|
|
820
1139
|
/**
|
|
821
1140
|
* Tear the executor's resources down. `grace` mirrors the OTP shutdown spec
|
|
822
1141
|
* (`'brutalKill'` = immediate, a number = ms grace, `'infinity'` = await clean exit).
|
|
@@ -865,6 +1184,61 @@ type WorkerTraceEvidence = {
|
|
|
865
1184
|
readonly status: 'unavailable';
|
|
866
1185
|
readonly reason: WorkerTraceUnavailableReason;
|
|
867
1186
|
};
|
|
1187
|
+
/** Why Runtime cannot hand a caller the exact interactive process one worker runs in. */
|
|
1188
|
+
type WorkerInteractiveUnavailableReason =
|
|
1189
|
+
/** No child of this scope carries that node id. */
|
|
1190
|
+
'unknown-node' |
|
|
1191
|
+
/** The child settled, was cancelled, or is a wait-state node: there is no process to attach to. */
|
|
1192
|
+
'not-live' |
|
|
1193
|
+
/** The worker runs headless. Its executor exposes no interactive session, so there is no
|
|
1194
|
+
* terminal — a headless execution is never converted into an attachment. */
|
|
1195
|
+
'executor-exposes-no-interactive-session' |
|
|
1196
|
+
/** The executor is backed by a runner whose provider publishes no interactive-session contract
|
|
1197
|
+
* (the local CLI Bridge today), so no process can be attached to even though one is running. */
|
|
1198
|
+
'provider-has-no-interactive-contract' |
|
|
1199
|
+
/** The runner supports interactive sessions but this execution was not started in one. */
|
|
1200
|
+
'interactive-session-not-started';
|
|
1201
|
+
/**
|
|
1202
|
+
* One worker's attachable process, or the named reason there is none.
|
|
1203
|
+
*
|
|
1204
|
+
* `available` carries the exact `RetainedInteractiveRunHandle` bound to THAT child's admitted
|
|
1205
|
+
* execution: input, resize, ordered replay, detach, and an acknowledged close all check every
|
|
1206
|
+
* provider answer against the session reference, so a second process that merely resumes the same
|
|
1207
|
+
* conversation cannot present itself as this one. `unavailable` names why, and is never a handle.
|
|
1208
|
+
*/
|
|
1209
|
+
type WorkerInteractiveSession = {
|
|
1210
|
+
readonly status: 'available';
|
|
1211
|
+
readonly handle: RetainedInteractiveRunHandle;
|
|
1212
|
+
} | {
|
|
1213
|
+
readonly status: 'unavailable';
|
|
1214
|
+
readonly reason: WorkerInteractiveUnavailableReason;
|
|
1215
|
+
};
|
|
1216
|
+
/** One cancellation ask. `operationId` makes the request idempotent per attempt, exactly as the
|
|
1217
|
+
* worker and retained layers already key their cancellations. */
|
|
1218
|
+
interface ExecutorCancellationRequest {
|
|
1219
|
+
readonly operationId: string;
|
|
1220
|
+
readonly reason?: string;
|
|
1221
|
+
/** Deadline for the acknowledgement itself. Its expiry produces `unknown`, never a claim. */
|
|
1222
|
+
readonly signal?: AbortSignal;
|
|
1223
|
+
}
|
|
1224
|
+
/**
|
|
1225
|
+
* What a backend acknowledged about one cancellation ask.
|
|
1226
|
+
*
|
|
1227
|
+
* `status` is the backend's answer to the ASK; `effect` is what is now known about the RUN, in the
|
|
1228
|
+
* one cancellation vocabulary the worker and retained layers already use. A local abort with no
|
|
1229
|
+
* provider acknowledgement is `{ status: 'unknown', effect: 'cancel_requested' }` — never
|
|
1230
|
+
* `accepted`.
|
|
1231
|
+
*/
|
|
1232
|
+
interface ExecutorCancellation {
|
|
1233
|
+
readonly status: 'accepted' | 'rejected' | 'already-terminal' | 'unknown';
|
|
1234
|
+
readonly effect: RetainedRunEffect;
|
|
1235
|
+
/** When the acknowledgement was observed, ISO-8601. */
|
|
1236
|
+
readonly observedAt: string;
|
|
1237
|
+
/** Why the backend answered this way — required reading for `unknown`. */
|
|
1238
|
+
readonly detail?: string;
|
|
1239
|
+
/** Backend-native proof, persisted by digest only. */
|
|
1240
|
+
readonly evidence?: unknown;
|
|
1241
|
+
}
|
|
868
1242
|
/** Split used by a recursive executor when journaled child work differs from the full amount
|
|
869
1243
|
* reconciled against its parent reservation. */
|
|
870
1244
|
interface ExecutorAccounting {
|
|
@@ -888,6 +1262,52 @@ interface ExecutorResult<Out> {
|
|
|
888
1262
|
* therefore remains unknown through live metering and terminal reconciliation instead of becoming
|
|
889
1263
|
* a fabricated zero.
|
|
890
1264
|
*/
|
|
1265
|
+
/**
|
|
1266
|
+
* One tool call retained in an executor artifact. Every Runtime-owned executor reports this exact
|
|
1267
|
+
* shape, so `streamAgentTurn` projects terminal tool activity through one reader instead of a
|
|
1268
|
+
* per-backend parser. `arguments` holds the captured argument value; an empty object means the
|
|
1269
|
+
* source reported the call without its arguments.
|
|
1270
|
+
*/
|
|
1271
|
+
interface ExecutorToolCall {
|
|
1272
|
+
readonly id?: string;
|
|
1273
|
+
readonly name: string;
|
|
1274
|
+
readonly arguments: unknown;
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Live output observed while an executor runs, in Runtime's own vocabulary. It carries what the
|
|
1278
|
+
* backend produced — text, reasoning, tool activity, an interaction request — and never carries
|
|
1279
|
+
* accounting: tokens and dollars stay on the `tokens`/`cost` channels, so a progress event can
|
|
1280
|
+
* never meter a budget.
|
|
1281
|
+
*/
|
|
1282
|
+
type ExecutorProgressEvent = {
|
|
1283
|
+
readonly kind: 'text_delta';
|
|
1284
|
+
readonly text: string;
|
|
1285
|
+
} | {
|
|
1286
|
+
readonly kind: 'reasoning_delta';
|
|
1287
|
+
readonly text: string;
|
|
1288
|
+
} | {
|
|
1289
|
+
readonly kind: 'tool_call';
|
|
1290
|
+
readonly toolName: string;
|
|
1291
|
+
readonly toolCallId?: string;
|
|
1292
|
+
readonly args?: unknown;
|
|
1293
|
+
} | {
|
|
1294
|
+
readonly kind: 'tool_result';
|
|
1295
|
+
readonly toolName: string;
|
|
1296
|
+
readonly toolCallId?: string;
|
|
1297
|
+
readonly result?: unknown;
|
|
1298
|
+
} | {
|
|
1299
|
+
readonly kind: 'interaction';
|
|
1300
|
+
readonly request: InteractionRequest;
|
|
1301
|
+
} | {
|
|
1302
|
+
/**
|
|
1303
|
+
* One update of a provider-native child task — a subagent or delegated task the runner
|
|
1304
|
+
* started inside this run. It is the Interface event verbatim, so a client rebuilds the
|
|
1305
|
+
* child tree from provider identity (`childId`, `parentChildId`, `sourceEventId`) instead
|
|
1306
|
+
* of inferring children from tool names or transcript order.
|
|
1307
|
+
*/
|
|
1308
|
+
readonly kind: 'child_task';
|
|
1309
|
+
readonly event: ChildTaskEvent;
|
|
1310
|
+
};
|
|
891
1311
|
type UsageEvent = {
|
|
892
1312
|
kind: 'tokens';
|
|
893
1313
|
/** Known token subtotal. When false, these counts are only the observed/estimated floor. */
|
|
@@ -909,18 +1329,33 @@ type UsageEvent = {
|
|
|
909
1329
|
cacheBreakdownKnown?: false;
|
|
910
1330
|
} | {
|
|
911
1331
|
kind: 'cost';
|
|
912
|
-
/**
|
|
913
|
-
usdKnown
|
|
1332
|
+
/** A provider or billing receipt covers this amount in full. */
|
|
1333
|
+
usdKnown: true;
|
|
1334
|
+
usd: number;
|
|
1335
|
+
/** Which receipt proves it. A number without one of these cannot claim `usdKnown: true`. */
|
|
1336
|
+
provenance: 'provider-receipt' | 'billing-receipt';
|
|
1337
|
+
} | {
|
|
1338
|
+
kind: 'cost';
|
|
1339
|
+
/** No receipt covers this work, so `usd` is an observed floor, never the total charge. */
|
|
1340
|
+
usdKnown: false;
|
|
914
1341
|
usd: number;
|
|
915
1342
|
/**
|
|
916
1343
|
* The part of `usd` this runtime priced from a model catalog because no provider receipt
|
|
917
|
-
* covered the work.
|
|
918
|
-
*
|
|
1344
|
+
* covered the work. A catalog price approximates what a provider would bill and never
|
|
1345
|
+
* measures what it did.
|
|
919
1346
|
*
|
|
920
|
-
* Absence means this runtime priced nothing here, NOT that `usd` is a receipt.
|
|
921
|
-
* is what says whether a dollar figure is measured.
|
|
1347
|
+
* Absence means this runtime priced nothing here, NOT that `usd` is a receipt.
|
|
922
1348
|
*/
|
|
923
1349
|
usdEstimated?: number;
|
|
1350
|
+
/**
|
|
1351
|
+
* Why the amount is not measured: a local catalog price, or nothing captured at all —
|
|
1352
|
+
* including a provider that reported a number with no receipt behind it.
|
|
1353
|
+
*/
|
|
1354
|
+
provenance: 'catalog-estimate' | 'uncaptured';
|
|
1355
|
+
} | {
|
|
1356
|
+
/** Observed output, not accounting. Meters ignore it; the turn projection publishes it. */
|
|
1357
|
+
kind: 'progress';
|
|
1358
|
+
progress: ExecutorProgressEvent;
|
|
924
1359
|
} | {
|
|
925
1360
|
kind: 'iteration';
|
|
926
1361
|
};
|
|
@@ -1351,6 +1786,23 @@ interface Scope<Out> {
|
|
|
1351
1786
|
/** The live tool-call trace of one child when its executor exposes one (`Executor.traceSource`),
|
|
1352
1787
|
* for running the online detector panel over a RUNNING worker. `undefined` otherwise. */
|
|
1353
1788
|
traceSource(nodeId: NodeId): TraceSource | undefined;
|
|
1789
|
+
/**
|
|
1790
|
+
* Attach a human terminal to the exact process ONE child is running in.
|
|
1791
|
+
*
|
|
1792
|
+
* Returns that child's `RetainedInteractiveRunHandle` when its executor holds an interactive
|
|
1793
|
+
* session — the caller then types, resizes, detaches, reconnects, and closes against the same
|
|
1794
|
+
* admitted execution, with one ordered output history. Every other worker returns an explicit
|
|
1795
|
+
* `unavailable` reason: a headless run, a runner whose provider publishes no interactive
|
|
1796
|
+
* contract, and an unknown or settled node are each distinguishable, and none of them is ever
|
|
1797
|
+
* converted into a fake attachment.
|
|
1798
|
+
*/
|
|
1799
|
+
interactive(nodeId: NodeId): WorkerInteractiveSession;
|
|
1800
|
+
/**
|
|
1801
|
+
* Ask one child's backend to stop, and report what it acknowledged. It delegates to
|
|
1802
|
+
* `Executor.cancel` when the runtime has one; otherwise the child is aborted locally and the
|
|
1803
|
+
* answer is `unknown`, never `accepted`. Resource release still belongs to teardown.
|
|
1804
|
+
*/
|
|
1805
|
+
cancel(nodeId: NodeId, request: ExecutorCancellationRequest): Promise<ExecutorCancellation>;
|
|
1354
1806
|
/** This scope's abort signal — aborted when the run is cancelled, a breaker trips, the pool
|
|
1355
1807
|
* is exhausted, or a parent scope cascades. A long-running driver `act` over this scope reads
|
|
1356
1808
|
* it to break promptly (the conserved pool + driver-stop are the other bounds). A nested
|
|
@@ -1401,12 +1853,23 @@ interface Scope<Out> {
|
|
|
1401
1853
|
reservedTokens: number;
|
|
1402
1854
|
}>;
|
|
1403
1855
|
/** One tree-wide view of simultaneous spawned work. Every nested scope reads the same counter;
|
|
1404
|
-
* the root agent itself is not a spawned worker. `freeSlots` is `null` when no limit is set.
|
|
1856
|
+
* the root agent itself is not a spawned worker. `freeSlots` is `null` when no limit is set.
|
|
1857
|
+
* `unconfirmed` NAMES the settled children whose executor teardown was never acknowledged —
|
|
1858
|
+
* the nodes still holding a capacity slot. Empty on every healthy run. */
|
|
1405
1859
|
readonly workerCapacity: Readonly<{
|
|
1406
1860
|
live: number;
|
|
1407
1861
|
freeSlots: number | null;
|
|
1862
|
+
unconfirmed: ReadonlyArray<UnconfirmedTeardown>;
|
|
1408
1863
|
}>;
|
|
1409
1864
|
}
|
|
1865
|
+
/** One settled child whose executor teardown was never acknowledged: the run cannot prove the
|
|
1866
|
+
* resource is gone, so its capacity slot stays charged. Named so an operator can act on it. */
|
|
1867
|
+
interface UnconfirmedTeardown {
|
|
1868
|
+
readonly id: NodeId;
|
|
1869
|
+
readonly label: string;
|
|
1870
|
+
readonly runtime: Runtime;
|
|
1871
|
+
readonly status: NodeStatus;
|
|
1872
|
+
}
|
|
1410
1873
|
/**
|
|
1411
1874
|
* The committed work a resumed run inherits from its journal. `settled` is the replayed
|
|
1412
1875
|
* `Settled[]` (cursor-ordered, rehydrated from the blob store by `replaySpawnTree`); `view`
|
|
@@ -1510,6 +1973,11 @@ type SpawnEvent = {
|
|
|
1510
1973
|
ownedTreeRoot?: NodeId;
|
|
1511
1974
|
/** Exact profile/task digests plus trusted candidate/campaign attribution when available. */
|
|
1512
1975
|
identity?: NodeExecutionIdentity;
|
|
1976
|
+
/** `ResultBlobStore` key holding the AUTHORED child `AgentProfile` this spawn ran under.
|
|
1977
|
+
* Distinct from `identity.profileDigest`: that is the canonical AgentProfile digest, which
|
|
1978
|
+
* names the agent, while this is the blob store's own content address, which retrieves its
|
|
1979
|
+
* bytes. Absent on records written before the body was persisted. */
|
|
1980
|
+
profileRef?: string;
|
|
1513
1981
|
seq: number;
|
|
1514
1982
|
at: string;
|
|
1515
1983
|
} | {
|
|
@@ -1592,6 +2060,20 @@ type SpawnEvent = {
|
|
|
1592
2060
|
providerModel?: ProviderModelExecutionEvidence;
|
|
1593
2061
|
seq: number;
|
|
1594
2062
|
at: string;
|
|
2063
|
+
} | {
|
|
2064
|
+
/** A settled child whose executor teardown was never acknowledged: the run cannot prove the
|
|
2065
|
+
* resource is gone, so its capacity slot stays charged for the rest of the run. Recorded so
|
|
2066
|
+
* the leak is durable evidence about the EXECUTOR rather than a cause of run failure.
|
|
2067
|
+
* Informational: replay, `materializeTreeView`, and cost readers skip it, and its `seq` lives
|
|
2068
|
+
* outside the cursor-uniqueness namespace. */
|
|
2069
|
+
kind: 'teardown-unconfirmed';
|
|
2070
|
+
id: NodeId;
|
|
2071
|
+
label: string;
|
|
2072
|
+
runtime: Runtime;
|
|
2073
|
+
/** The node's terminal status when the barrier read it. */
|
|
2074
|
+
status: NodeStatus;
|
|
2075
|
+
seq: number;
|
|
2076
|
+
at: string;
|
|
1595
2077
|
} | {
|
|
1596
2078
|
/** One GRAPH-EDGE traversal (`runGraph`): what the runtime actually DELIVERED across a
|
|
1597
2079
|
* delegates/analyzes edge, with byte counts — the observability that makes an edge's
|
|
@@ -1820,6 +2302,11 @@ type SupervisedResult<Out> = {
|
|
|
1820
2302
|
readonly rootProviderModel?: RootProviderModelEvidence;
|
|
1821
2303
|
/** Runtime-owned provider evidence reduced across the complete journal forest. */
|
|
1822
2304
|
readonly providerModel?: ProviderModelExecutionEvidence;
|
|
2305
|
+
/** Settled children whose executor teardown was never acknowledged — the resources this run
|
|
2306
|
+
* could not prove destroyed. Their capacity slots stay charged for the rest of the run, and
|
|
2307
|
+
* each is journaled as a `teardown-unconfirmed` event. Present exactly when non-empty; a
|
|
2308
|
+
* healthy run never carries it. */
|
|
2309
|
+
teardownUnconfirmed?: ReadonlyArray<UnconfirmedTeardown>;
|
|
1823
2310
|
/** The journaled nodes whose usage accounting is incomplete — the named gaps behind a
|
|
1824
2311
|
* `false` `tokensKnown`/`usdKnown` on `spentTotal`. Present exactly when non-empty. */
|
|
1825
2312
|
spendGaps?: ReadonlyArray<SpendGap>;
|
|
@@ -1853,6 +2340,11 @@ type SupervisedResult<Out> = {
|
|
|
1853
2340
|
readonly rootProviderModel?: RootProviderModelEvidence;
|
|
1854
2341
|
/** Runtime-owned provider evidence reduced across the complete journal forest. */
|
|
1855
2342
|
readonly providerModel?: ProviderModelExecutionEvidence;
|
|
2343
|
+
/** Settled children whose executor teardown was never acknowledged — the resources this run
|
|
2344
|
+
* could not prove destroyed. Their capacity slots stay charged for the rest of the run, and
|
|
2345
|
+
* each is journaled as a `teardown-unconfirmed` event. Present exactly when non-empty; a
|
|
2346
|
+
* healthy run never carries it. */
|
|
2347
|
+
teardownUnconfirmed?: ReadonlyArray<UnconfirmedTeardown>;
|
|
1856
2348
|
/** The journaled nodes whose usage accounting is incomplete — the named gaps behind a
|
|
1857
2349
|
* `false` `tokensKnown`/`usdKnown` on `spentTotal`. Present exactly when non-empty. */
|
|
1858
2350
|
spendGaps?: ReadonlyArray<SpendGap>;
|
|
@@ -1880,6 +2372,11 @@ type SupervisedResult<Out> = {
|
|
|
1880
2372
|
readonly rootProviderModel?: RootProviderModelEvidence;
|
|
1881
2373
|
/** Runtime-owned provider evidence reduced across the complete journal forest. */
|
|
1882
2374
|
readonly providerModel?: ProviderModelExecutionEvidence;
|
|
2375
|
+
/** Settled children whose executor teardown was never acknowledged — the resources this run
|
|
2376
|
+
* could not prove destroyed. Their capacity slots stay charged for the rest of the run, and
|
|
2377
|
+
* each is journaled as a `teardown-unconfirmed` event. Present exactly when non-empty; a
|
|
2378
|
+
* healthy run never carries it. */
|
|
2379
|
+
teardownUnconfirmed?: ReadonlyArray<UnconfirmedTeardown>;
|
|
1883
2380
|
/** The journaled nodes whose usage accounting is incomplete — the named gaps behind a
|
|
1884
2381
|
* `false` `tokensKnown`/`usdKnown` on `spentTotal`. Present exactly when non-empty. */
|
|
1885
2382
|
spendGaps?: ReadonlyArray<SpendGap>;
|
|
@@ -1932,5 +2429,5 @@ interface WidenGate<Out> {
|
|
|
1932
2429
|
readonly judgeExempt?: boolean;
|
|
1933
2430
|
}
|
|
1934
2431
|
//#endregion
|
|
1935
|
-
export {
|
|
1936
|
-
//# sourceMappingURL=types-
|
|
2432
|
+
export { SupervisorOpts as $, RetainedRunHandle as $n, sanitizeKnowledgeReadinessReport as $t, ProviderModelExecutionEvidence as A, RetainedInteractiveAdmissionHook as An, OtelSpan as At, Scope as B, RecoverRetainedRunResult as Bn, padSpanId as Bt, NoWinnerError as C, ExecutorProgress as Cn, EvalRunsExportConfig as Ct, NodeStatus as D, readWorkerProgress as Dn, OtelAttribute as Dt, NodeSnapshot as E, createActivityLog as En, LoopSpanNode as Et, RootHandle as F, NativeContextContinuationExecution as Fn, createOpenInferenceFileExporter as Ft, SpawnPrior as G, RetainedRunAdmission as Gn, RuntimeStreamEventSink as Gt, SpawnEvent as H, RetainedInteractiveEnvironmentAdmission as Hn, toOtelAttributes as Ht, RootMaterialization as I, NativeContextContinuationInput as In, createOtelExporter as It, SpendChannel as J, RetainedRunCancellation as Jn, SanitizedKnowledgeReadinessReport as Jt, SpawnRejection as K, RetainedRunAdmissionHook as Kn, RuntimeStreamEventSummary as Kt, RootProviderModelEvidence as L, ReconnectRetainedRunOptions as Ln, exportEvalRuns as Lt, ResultBlobStore as M, RetainedInteractiveRunHandle as Mn, buildLoopOtelSpans as Mt, ResumedKeyState as N, RetainedInteractiveStartMaterial as Nn, buildLoopSpanNodes as Nt, ProfileMaterializationReceipt as O, ReconnectRetainedInteractiveRunOptions as On, OtelExportConfig as Ot, ResumedWork as P, StartRetainedInteractiveRunOptions as Pn, buildRuntimeEventOtelSpans as Pt, Supervisor as Q, RetainedRunEventOptions as Qn, sanitizeAgentRuntimeEvent as Qt, RootSignal as R, RecoverRetainedRunIntentOptions as Rn, generateSpanId as Rt, MaterializedModelIdentity as S, DEFAULT_STALL_AFTER_MS as Sn, EvalRunGeneration as St, NodeId as T, WorkerProgress as Tn, INTELLIGENCE_WIRE_VERSION as Tt, SpawnJournal as U, RetainedInteractiveIntentAdmission as Un, RuntimeEventCollector as Ut, Settled as V, RetainedInteractiveAdmission as Vn, padTraceId as Vt, SpawnOpts as W, RetainedInteractiveStartedAdmission as Wn, RuntimeStreamEventCollector as Wt, SteerableRootHandle as X, RetainedRunEffect as Xn, createRuntimeEventCollector as Xt, SpendGap as Y, RetainedRunDispatchedAdmission as Yn, SanitizedKnowledgeRequirement as Yt, SupervisedResult as Z, RetainedRunEnvironmentAdmission as Zn, createRuntimeStreamEventCollector as Zt, ExecutorRegistry as _, createPushTraceSource as _n, createPropagatingTraceEmitter as _t, DefaultVerdict as a, WaitRejection as an, StartRetainedRunOptions as ar, WidenGate as at, Handle as b, ActivityLog as bn, traceContextToEnv as bt, ExecutorAccounting as c, isWaitOutcome as cn, WorkerTraceEvidence as ct, ExecutorContext as d, validateWaitSpec as dn, WorkerTraceSeamCarrier as dt, sanitizeRuntimeStreamEvent as en, RetainedRunIntentAdmission as er, TreeView as et, ExecutorExecutionBinding as f, waitUntil as fn, readWorkerTraceContext as ft, ExecutorProgressEvent as g, TraceSource as gn, TraceContext as gt, ExecutorNodeContext as h, ToolStepInput as hn, workerTraceSeamKey as ht, Budget as i, WaitProbeRegistry as in, StartRetainedRunInEnvironmentOptions as ir, WaitOpts as it, Restart as j, RetainedInteractiveEnvironmentInput as jn, RuntimeEventOtelOptions as jt, ProviderModelAttemptEvidence as k, RecoverRetainedInteractiveRunOptions as kn, OtelExporter as kt, ExecutorCancellation as l, pollFor as ln, WorkerTraceUnavailableReason as lt, ExecutorMaterialization as m, SessionTraceBox as mn, workerTraceHeaders as mt, AgentExecutionRef as n, WaitOutcome as nn, RetainedRunSnapshot as nr, UnknownMaterializationReason as nt, ExecutionBindingReceipt as o, WaitSpec as on, WorkerInteractiveSession as ot, ExecutorFactory as p, SessionMessageLike as pn, workerTraceEnv as pt, Spend as q, RetainedRunCancelOptions as qn, RuntimeTelemetryOptions as qt, AgentSpec as r, WaitProbe as rn, RetainedRunStartMaterial as rr, UsageEvent as rt, Executor as s, createWaitProbes as sn, WorkerInteractiveUnavailableReason as st, Agent as t, PendingWait as tn, RetainedRunReplayPoint as tr, UnconfirmedTeardown as tt, ExecutorCancellationRequest as u, timerAt as un, WorkerTraceResolver as ut, ExecutorResult as v, decodeToolPart as vn, mergeTraceEnv as vt, NodeExecutionIdentity as w, ScopeProgressInput as wn, EvalRunsExportResult as wt, MaterializedExecutionIdentity as x, ActivityNote as xn, EvalRunEvent as xt, ExecutorToolCall as y, sandboxSessionTraceSource as yn, readTraceContextFromEnv as yt, Runtime as z, RecoverRetainedRunOptions as zn, loopEventToOtelSpan as zt };
|
|
2433
|
+
//# sourceMappingURL=types-BPQhQRrC.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { l as RuntimeHooks } from "./runtime-hooks-Bj6wJHlH.js";
|
|
2
2
|
import { AgentProfile, InputPart, RequestedInteractions, StreamEvent } from "@tangle-network/agent-interface";
|
|
3
3
|
import { ControlBudget, ControlDecision, ControlEvalResult, ControlRunResult, ControlStep, DataAcquisitionPlan, DefaultVerdict, KnowledgeReadinessReport, KnowledgeRequirement, RunRecord, TraceStore, UserQuestion } from "@tangle-network/agent-eval";
|
|
4
|
+
import { AgentRunOutcome } from "@tangle-network/sandbox/runtime";
|
|
4
5
|
import { CreateRequestOptions, CreateSandboxOptions, SandboxEvent, SandboxInstance } from "@tangle-network/sandbox";
|
|
5
6
|
//#region src/types.d.ts
|
|
6
7
|
/** @stable */
|
|
@@ -812,6 +813,8 @@ interface Iteration<Task, Output> {
|
|
|
812
813
|
output?: Output;
|
|
813
814
|
verdict?: DefaultVerdict;
|
|
814
815
|
error?: Error;
|
|
816
|
+
/** Public Sandbox outcome settled after the complete event stream. */
|
|
817
|
+
sandboxOutcome?: AgentRunOutcome;
|
|
815
818
|
/** Raw sandbox event stream collected for this iteration. Present on a failed iteration too,
|
|
816
819
|
* holding the events received before the failure — including the one that reported it. */
|
|
817
820
|
events: SandboxEvent[];
|
|
@@ -1228,4 +1231,4 @@ interface ExecCtx {
|
|
|
1228
1231
|
}
|
|
1229
1232
|
//#endregion
|
|
1230
1233
|
export { OpenAIChatToolChoice as $, RuntimeRunCompleteInput as A, AgentBackendInput as B, MountRecorder as C, SelectionReceipt as D, SandboxClient as E, RuntimeRunRow as F, AgentTaskContext as G, AgentKnowledgeProvider as H, RuntimeRunStatus as I, AgentTaskStatus as J, AgentTaskRunResult as K, startRuntimeRun as L, RuntimeRunHandle as M, RuntimeRunOptions as N, ValidationCtx as O, RuntimeRunPersistenceAdapter as P, OpenAIChatTool as Q, AgentAdapter as R, MountManifestEntry as S, RunProvenance as T, AgentRuntimeEvent as U, AgentExecutionBackend as V, AgentRuntimeEventSink as W, KnowledgeReadinessDecision as X, BackendErrorDetail as Y, OpenAIChatResponseFormat as Z, LoopTeardownFailedPayload as _, Iteration as a, RuntimeStreamEvent as at, LoopTraceEvent as b, LoopIterationDispatchPayload as c, LoopLineageOptions as d, RunAgentTaskOptions as et, LoopPlanDescription as f, LoopStartedPayload as g, LoopSandboxPlacement as h, ExecCtx as i, RuntimeSessionStore as it, RuntimeRunCost as j, Validator as k, LoopIterationEndedPayload as l, LoopResult as m, DefaultVerdict as n, RuntimeCanonicalStreamEvent as nt, LoopDecisionPayload as o, LoopPlanPayload as p, AgentTaskSpec as q, Driver as r, RuntimeSession as rt, LoopEndedPayload as s, AgentRunSpec as t, RunAgentTaskStreamOptions as tt, LoopIterationStartedPayload as u, LoopTokenUsage as v, OutputAdapter as w, LoopWinner as x, LoopTraceEmitter as y, AgentBackendContext as z };
|
|
1231
|
-
//# sourceMappingURL=types-
|
|
1234
|
+
//# sourceMappingURL=types-DeX8ibLc.d.ts.map
|