@tangle-network/agent-runtime 0.201.0 → 0.203.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/{activation-BPxs-Iu2.d.ts → activation-B_4qFpKR.d.ts} +2 -2
- package/dist/{activation-C_FN2aqK.js → activation-C8Ilw0IX.js} +2 -2
- package/dist/{activation-C_FN2aqK.js.map → activation-C8Ilw0IX.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/{coordination-driver-qdAwriPV.js → coordination-driver-B5TLsu_f.js} +2 -2
- package/dist/{coordination-driver-qdAwriPV.js.map → coordination-driver-B5TLsu_f.js.map} +1 -1
- package/dist/{delegate-BWHG-zZW.js → delegate-B8y9EvTY.js} +2 -2
- package/dist/{delegate-BWHG-zZW.js.map → delegate-B8y9EvTY.js.map} +1 -1
- package/dist/durable.d.ts +2 -2
- package/dist/durable.js +2 -2
- package/dist/{graph-cCqKhLqz.js → graph-C3WsOkdi.js} +3 -3
- package/dist/{graph-cCqKhLqz.js.map → graph-C3WsOkdi.js.map} +1 -1
- package/dist/{improvement-cycle-VH_ZGcIj.js → improvement-cycle-BVS0odHN.js} +76 -18
- package/dist/improvement-cycle-BVS0odHN.js.map +1 -0
- package/dist/{index-Br191WbE.d.ts → index-prZR0SAw.d.ts} +61 -27
- package/dist/index.d.ts +4 -4
- package/dist/index.js +7 -7
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +3 -3
- package/dist/kernel.d.ts +3 -3
- package/dist/kernel.js +9 -9
- package/dist/{loop-runner-bin-jQ8hXO9J.js → loop-runner-bin-CSMc1AQ5.js} +3 -3
- package/dist/{loop-runner-bin-jQ8hXO9J.js.map → loop-runner-bin-CSMc1AQ5.js.map} +1 -1
- package/dist/{loop-runner-bin-BNRdsDOn.d.ts → loop-runner-bin-CdLhMvhw.d.ts} +3 -3
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +4 -4
- package/dist/{provision-supervisor-BA2-GPth.js → provision-supervisor-hc_SOkP5.js} +3 -3
- package/dist/{provision-supervisor-BA2-GPth.js.map → provision-supervisor-hc_SOkP5.js.map} +1 -1
- package/dist/{redact-h-oaw11Q.js → redact-B5g0jY2n.js} +46 -6
- package/dist/redact-B5g0jY2n.js.map +1 -0
- package/dist/{runtime-DeqdBVeC.js → runtime-B4HhRqE8.js} +103 -26
- package/dist/runtime-B4HhRqE8.js.map +1 -0
- package/dist/{server-U_k9NUbk.js → server-BnsMo0dR.js} +3 -3
- package/dist/{server-U_k9NUbk.js.map → server-BnsMo0dR.js.map} +1 -1
- package/dist/{stream-agent-turn-CJWthifS.d.ts → stream-agent-turn-CAj0XcwD.d.ts} +8 -5
- package/dist/{structural-rollout-BcMmrpv4.js → structural-rollout-DPwqGLUp.js} +88 -51
- package/dist/structural-rollout-DPwqGLUp.js.map +1 -0
- package/dist/{supervise-DmFO50N6.js → supervise-CskGiJMk.js} +3 -3
- package/dist/{supervise-DmFO50N6.js.map → supervise-CskGiJMk.js.map} +1 -1
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +12 -12
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/package.json +6 -6
- package/dist/improvement-cycle-VH_ZGcIj.js.map +0 -1
- package/dist/redact-h-oaw11Q.js.map +0 -1
- package/dist/runtime-DeqdBVeC.js.map +0 -1
- package/dist/structural-rollout-BcMmrpv4.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { E as SandboxClient, J as AgentTaskStatus, U as AgentRuntimeEvent, Y as BackendErrorDetail, at as RuntimeStreamEvent, i as ExecCtx, k as Validator, v as LoopTokenUsage, y as LoopTraceEmitter } from "./types-Q0PMagdm.js";
|
|
2
2
|
import { l as RuntimeHooks } from "./runtime-hooks-Bj6wJHlH.js";
|
|
3
|
-
import { AgentExactRunControlRef, AgentInteractiveSession, AgentInteractiveSessionPromptAcknowledgement, AgentInteractiveSessionPromptCommand, AgentInteractiveSessionRef, AgentInteractiveSessionStart, AgentNativeContextContinuationOptions, AgentNativeContextContinuationResult, AgentProfile, AgentProfileMcpServer, AgentProfileValidationResult, AgentSessionStatus, ChildTaskEvent, ContextTransferRequest, HarnessType, InteractionAcknowledgement, InteractionRequest, InteractionResponseCommand, NativeContextBoundaryProof, NativeContextContinuationRequest, NativeContextContinuationTurn, ReasoningEffort, RuntimeEventEnvelope, Sha256Digest, StreamEvent } from "@tangle-network/agent-interface";
|
|
3
|
+
import { AgentExactRunControlRef, AgentInteractiveSession, AgentInteractiveSessionPromptAcknowledgement, AgentInteractiveSessionPromptCommand, AgentInteractiveSessionRef, AgentInteractiveSessionStart, AgentNativeContextContinuationOptions, AgentNativeContextContinuationResult, AgentProfile, AgentProfileMcpServer, AgentProfileValidationResult, AgentSessionStatus, AgentTurnResult, ChildTaskEvent, ContextTransferRequest, HarnessType, InteractionAcknowledgement, InteractionRequest, InteractionResponseCommand, NativeContextBoundaryProof, NativeContextContinuationRequest, NativeContextContinuationTurn, ReasoningEffort, RuntimeEventEnvelope, Sha256Digest, StreamEvent } from "@tangle-network/agent-interface";
|
|
4
4
|
import { ControlEvalResult, DefaultVerdict, KnowledgeReadinessReport, KnowledgeRequirement, ToolSpan } from "@tangle-network/agent-eval";
|
|
5
5
|
import { AgentRunOutcome } from "@tangle-network/sandbox/runtime";
|
|
6
6
|
import { ChildProcess } from "node:child_process";
|
|
7
7
|
import { WorkspacePlanReceipt } from "@tangle-network/agent-profile-materialize";
|
|
8
8
|
import { BackendType, CreateSandboxOptions, PromptOptions, Sandbox, SandboxEvent, SandboxInstance } from "@tangle-network/sandbox";
|
|
9
|
-
import { AgentEnvironment, AgentEnvironment as AgentEnvironment$1, AgentEnvironmentCapabilities, AgentEnvironmentCapabilities as AgentEnvironmentCapabilities$1, AgentEnvironmentEvent, AgentEnvironmentEvent as AgentEnvironmentEvent$1, AgentEnvironmentProvider, AgentEnvironmentProvider as AgentEnvironmentProvider$1, AgentEnvironmentQuery, AgentEnvironmentStatus, AgentEnvironmentSummary, AgentProfileRef, AgentProfileRef as AgentProfileRef$1, AgentSession, AgentSessionRef, AgentSessionStatus as AgentSessionStatus$1, AgentTurnInput, AgentTurnInput as AgentTurnInput$1, AgentTurnResult, AgentTurnResult as AgentTurnResult$
|
|
9
|
+
import { AgentEnvironment, AgentEnvironment as AgentEnvironment$1, AgentEnvironmentCapabilities, AgentEnvironmentCapabilities as AgentEnvironmentCapabilities$1, AgentEnvironmentEvent, AgentEnvironmentEvent as AgentEnvironmentEvent$1, AgentEnvironmentProvider, AgentEnvironmentProvider as AgentEnvironmentProvider$1, AgentEnvironmentQuery, AgentEnvironmentStatus, AgentEnvironmentSummary, AgentProfileRef, AgentProfileRef as AgentProfileRef$1, AgentSession, AgentSessionRef, AgentSessionStatus as AgentSessionStatus$1, AgentTurnInput, AgentTurnInput as AgentTurnInput$1, AgentTurnResult as AgentTurnResult$1, AgentTurnResult as AgentTurnResult$2, CheckpointRef, CheckpointRequest, CreateAgentEnvironmentInput, CreateAgentEnvironmentInput as CreateAgentEnvironmentInput$1, ExecRequest, ExecResult, ForkRequest, PlacementInfo, ResourceRequest, WorkspaceRequest } from "@tangle-network/agent-interface/environment-provider";
|
|
10
10
|
//#region src/runtime/retained-run-types.d.ts
|
|
11
11
|
/** Cursor plus runtime sequence needed to continue one ordered replay. @stable */
|
|
12
12
|
interface RetainedRunReplayPoint {
|
|
@@ -76,7 +76,7 @@ interface RetainedRunHandle {
|
|
|
76
76
|
signal?: AbortSignal;
|
|
77
77
|
}): Promise<RetainedRunSnapshot>;
|
|
78
78
|
events(options?: RetainedRunEventOptions): AsyncIterable<RuntimeEventEnvelope>;
|
|
79
|
-
result(): Promise<AgentTurnResult>;
|
|
79
|
+
result(): Promise<AgentTurnResult$1>;
|
|
80
80
|
respondToInteraction(command: InteractionResponseCommand, options?: {
|
|
81
81
|
signal?: AbortSignal;
|
|
82
82
|
}): Promise<InteractionAcknowledgement>;
|
|
@@ -1298,6 +1298,8 @@ interface ExecutorAccounting {
|
|
|
1298
1298
|
}
|
|
1299
1299
|
/** Terminal artifact of a one-shot `Executor.execute`. */
|
|
1300
1300
|
interface ExecutorResult<Out> {
|
|
1301
|
+
/** Explicit execution outcome; application output and scoring verdicts do not determine failure. */
|
|
1302
|
+
outcome?: Pick<AgentTurnResult, 'success' | 'error'>;
|
|
1301
1303
|
outRef: string;
|
|
1302
1304
|
out: Out;
|
|
1303
1305
|
verdict?: DefaultVerdict;
|
|
@@ -2134,6 +2136,7 @@ type SpawnEvent = {
|
|
|
2134
2136
|
} | {
|
|
2135
2137
|
/** Recoverable output committed before releasing its provider environment. */
|
|
2136
2138
|
kind: 'execution-result';
|
|
2139
|
+
outcome?: Pick<AgentTurnResult, 'success' | 'error'>;
|
|
2137
2140
|
id: NodeId;
|
|
2138
2141
|
outRef: string;
|
|
2139
2142
|
spent: Spend;
|
|
@@ -4629,5 +4632,5 @@ declare function streamAgentTurn(backend: AgentTurnBackend, input: AgentTurnInpu
|
|
|
4629
4632
|
*/
|
|
4630
4633
|
declare function collectAgentTurn(stream: AsyncIterable<RuntimeStreamEvent>): Promise<CollectedAgentTurn>;
|
|
4631
4634
|
//#endregion
|
|
4632
|
-
export { resolveSecretEnv as $, RetainedRunEnvironmentAdmission as $a, sanitizeAgentRuntimeEvent as $i, defaultRedactor as $n, SupervisorOpts as $r, WorktreeHarnessResult as $t, Inbox as A, RecoverRetainedInteractiveRunOptions as Aa, OtelExporter as Ai, AUTHORITY_MARKERS as An, ProviderModelAttemptEvidence as Ar, providerAsExecutor as At, createSandboxToolPartState as B, RecoverRetainedRunIntentOptions as Ba, loopEventToOtelSpan as Bi, PeerMailSendInput as Bn, Scope as Br, CodexRolloutStoreReader as Bt, createExecutorRegistry as C, DEFAULT_STALL_AFTER_MS as Ca, EvalRunGeneration as Ci, ToolSpec as Cn, MaterializedModelIdentity as Cr, ProviderExecutorOptions as Ct, SteerableSandboxSession as D, createActivityLog as Da, LoopSpanNode as Di, ToolLoopCompactionOptions as Dn, NodeSnapshot as Dr, SandboxClientProviderOptions as Dt, SteerableSandboxArgs as E, WorkerProgress as Ea, INTELLIGENCE_WIRE_VERSION as Ei, ToolLoopCompaction as En, NodeId as Er, ResourceRequest as Et, SandboxOutputMarker as F, StartRetainedInteractiveRunOptions as Fa, buildRuntimeEventOtelSpans as Fi, PeerMailKind as Fn, RootHandle as Fr, SandboxControlClient as Ft, sandboxEventServedBackend as G, RetainedInteractiveIntentAdmission as Ga, RuntimeStreamEventCollector as Gi, isPeerMailEnvelope as Gn, SpawnPrior as Gr, createCodexRolloutStoreReader as Gt, extractLlmCallEvent as H, RecoverRetainedRunResult as Ha, padTraceId as Hi, PeerMailboxOptions as Hn, SpawnEvent as Hr, CodexRolloutTurn as Ht, SandboxServedBackend as I, NativeContextContinuationExecution as Ia, createOpenInferenceFileExporter as Ii, PeerMailLimits as In, RootMaterialization as Ir, createTangleSandboxExactProcessProvider as It, KeyProvider as J, RetainedRunAdmissionHook as Ja, RuntimeTelemetryOptions as Ji, JsonRpcMessage as Jn, SpendChannel as Jr, HarnessUsage as Jt, sandboxProgressEvents as K, RetainedInteractiveStartedAdmission as Ka, RuntimeStreamEventSink as Ki, peerMailTools as Kn, SpawnRejection as Kr, harnessUsageIsEmpty as Kt, SandboxToolPartState as L, NativeContextContinuationHandle as La, createOtelExporter as Li, PeerMailOutcome as Ln, RootProviderModelEvidence as Lr, CodexForkBoundary as Lt, PeerInboxMessage as M, RetainedInteractiveEnvironmentInput as Ma, RuntimeEventOtelOptions as Mi, PEER_MAIL_WIRE_KEY as Mn, ResultBlobStore as Mr, resolveAgentEnvironmentProvider as Mt, createInbox as N, RetainedInteractiveRunHandle as Na, buildLoopOtelSpans as Ni, PeerMailEnvelope as Nn, ResumedKeyState as Nr, sandboxClientAsProvider as Nt, createSteerableSandboxSession as O, readWorkerProgress as Oa, OtelAttribute as Oi, ToolLoopMessageRecord as On, NodeStatus as Or, WorkspaceRequest as Ot, SandboxLeafOut as P, RetainedInteractiveStartMaterial as Pa, buildLoopSpanNodes as Pi, PeerMailEvent as Pn, ResumedWork as Pr, CreateTangleSandboxExactProcessProviderOptions as Pt, resolveMcpServerLaunch as Q, RetainedRunEffect as Qa, createRuntimeStreamEventCollector as Qi, Redactor as Qn, Supervisor as Qr, WorktreeCommandResult as Qt, SandboxUsageLedger as R, NativeContextContinuationInput as Ra, exportEvalRuns as Ri, PeerMailReadout as Rn, RootSignal as Rr, CodexRolloutIdentity as Rt, createExecutor as S, ActivityNote as Sa, EvalRunEvent as Si, RouterTransportConfig as Sn, MaterializedExecutionIdentity as Sr, ProviderAsSandboxClientOptions as St, SandboxSteeringOptions as T, ScopeProgressInput as Ta, EvalRunsExportResult as Ti, ToolLoopChat as Tn, NodeExecutionIdentity as Tr, ProviderPromptOptions as Tt, mapSandboxEvent as U, RetainedInteractiveAdmission as Ua, toOtelAttributes as Ui, claimsAuthority as Un, SpawnJournal as Ur, CodexStoreDelta as Ut, createSandboxUsageLedger as V, RecoverRetainedRunOptions as Va, padSpanId as Vi, PeerMailbox as Vn, Settled as Vr, CodexRolloutStoreRef as Vt, mapSandboxToolEvent as W, RetainedInteractiveEnvironmentAdmission as Wa, RuntimeEventCollector as Wi, createPeerMailbox as Wn, SpawnOpts as Wr, addHarnessUsage as Wt, envKeyProvider as X, RetainedRunCancellation as Xa, SanitizedKnowledgeRequirement as Xi, McpToolDescriptor as Xn, SteerableRootHandle as Xr, InPlaceHarnessResult as Xt, ResolvedMcpServerLaunch as Y, RetainedRunCancelOptions as Ya, SanitizedKnowledgeReadinessReport as Yi, JsonRpcResponse as Yn, SpendGap as Yr, decodeHarnessUsage as Yt, mcpSecretEnvMetadataKey as Z, RetainedRunDispatchedAdmission as Za, createRuntimeEventCollector as Zi, McpTransport as Zn, SupervisedResult as Zr, WorktreeCheckRunner as Zt, RouterSeam as _, TraceSource as _a, TraceContext as _i, RunLocalHarnessOptions as _n, ExecutorRegistry as _r, CreateAgentEnvironmentInput$1 as _t, StreamAgentTurnOptions as a, WaitProbeRegistry as aa, WaitOpts as ai, RemoveWorktreeOptions as an, RetainedRunStartMaterial as ao, DefaultVerdict as ar, AgentEnvironmentProviderRef as at, cliInPlaceExecutor as b, sandboxSessionTraceSource as ba, readTraceContextFromEnv as bi, parseCodexTokenUsage as bn, ExecutorToolCall as br, ForkRequest as bt, BridgeHarnessStore as c, createWaitProbes as ca, WorkerInteractiveUnavailableReason as ci, createWorktree as cn, StartRetainedRunOptions as co, ExecutorAccounting as cr, AgentEnvironmentStatus as ct, CliInPlaceSeam as d, timerAt as da, WorkerTraceResolver as di, CodexExecutionPolicy as dn, ExecutorContext as dr, AgentSession as dt, sanitizeKnowledgeReadinessReport as ea, TokenUsageProvenance as ei, WorktreeProfileMaterializationReceipt as en, RetainedRunEventOptions as eo, resolveRedactor as er, secretEnvOfMcpServer as et, CliSeam as f, validateWaitSpec as fa, WorkerTraceSeamCarrier as fi, CodexTokenUsage as fn, ExecutorExecutionBinding as fr, AgentSessionRef as ft, ProviderSeam as g, ToolStepInput as ga, workerTraceSeamKey as gi, LocalHarnessResult as gn, ExecutorProgressEvent as gr, CheckpointRequest as gt, ExecutorConfig as h, SessionTraceBox as ha, workerTraceHeaders as hi, LocalHarness as hn, ExecutorNodeContext as hr, CheckpointRef as ht, CollectedAgentTurn as i, WaitProbe as ia, UsageEvent as ii, GitRunner as in, RetainedRunSnapshot as io, Budget as ir, AgentEnvironmentProvider$1 as it, InboxMessage as j, RetainedInteractiveAdmissionHook as ja, OtelSpan as ji, DEFAULT_PEER_MAIL_LIMITS as jn, ProviderModelExecutionEvidence as jr, providerAsSandboxClient as jt, AuthorityInboxMessage as k, ReconnectRetainedInteractiveRunOptions as ka, OtelExportConfig as ki, ToolLoopToolCall as kn, ProfileMaterializationReceipt as kr, createAgentEnvironmentProviderRegistry as kt, BridgeModelCredential as l, isWaitOutcome as la, WorkerTraceEvidence as li, removeWorktree as ln, ExecutorCancellation as lr, AgentEnvironmentSummary as lt, CliWorktreeSeam as m, SessionMessageLike as ma, workerTraceEnv as mi, LOCAL_HARNESSES as mn, ExecutorMaterialization as mr, AgentTurnResult$
|
|
4633
|
-
//# sourceMappingURL=stream-agent-turn-
|
|
4635
|
+
export { resolveSecretEnv as $, RetainedRunEnvironmentAdmission as $a, sanitizeAgentRuntimeEvent as $i, defaultRedactor as $n, SupervisorOpts as $r, WorktreeHarnessResult as $t, Inbox as A, RecoverRetainedInteractiveRunOptions as Aa, OtelExporter as Ai, AUTHORITY_MARKERS as An, ProviderModelAttemptEvidence as Ar, providerAsExecutor as At, createSandboxToolPartState as B, RecoverRetainedRunIntentOptions as Ba, loopEventToOtelSpan as Bi, PeerMailSendInput as Bn, Scope as Br, CodexRolloutStoreReader as Bt, createExecutorRegistry as C, DEFAULT_STALL_AFTER_MS as Ca, EvalRunGeneration as Ci, ToolSpec as Cn, MaterializedModelIdentity as Cr, ProviderExecutorOptions as Ct, SteerableSandboxSession as D, createActivityLog as Da, LoopSpanNode as Di, ToolLoopCompactionOptions as Dn, NodeSnapshot as Dr, SandboxClientProviderOptions as Dt, SteerableSandboxArgs as E, WorkerProgress as Ea, INTELLIGENCE_WIRE_VERSION as Ei, ToolLoopCompaction as En, NodeId as Er, ResourceRequest as Et, SandboxOutputMarker as F, StartRetainedInteractiveRunOptions as Fa, buildRuntimeEventOtelSpans as Fi, PeerMailKind as Fn, RootHandle as Fr, SandboxControlClient as Ft, sandboxEventServedBackend as G, RetainedInteractiveIntentAdmission as Ga, RuntimeStreamEventCollector as Gi, isPeerMailEnvelope as Gn, SpawnPrior as Gr, createCodexRolloutStoreReader as Gt, extractLlmCallEvent as H, RecoverRetainedRunResult as Ha, padTraceId as Hi, PeerMailboxOptions as Hn, SpawnEvent as Hr, CodexRolloutTurn as Ht, SandboxServedBackend as I, NativeContextContinuationExecution as Ia, createOpenInferenceFileExporter as Ii, PeerMailLimits as In, RootMaterialization as Ir, createTangleSandboxExactProcessProvider as It, KeyProvider as J, RetainedRunAdmissionHook as Ja, RuntimeTelemetryOptions as Ji, JsonRpcMessage as Jn, SpendChannel as Jr, HarnessUsage as Jt, sandboxProgressEvents as K, RetainedInteractiveStartedAdmission as Ka, RuntimeStreamEventSink as Ki, peerMailTools as Kn, SpawnRejection as Kr, harnessUsageIsEmpty as Kt, SandboxToolPartState as L, NativeContextContinuationHandle as La, createOtelExporter as Li, PeerMailOutcome as Ln, RootProviderModelEvidence as Lr, CodexForkBoundary as Lt, PeerInboxMessage as M, RetainedInteractiveEnvironmentInput as Ma, RuntimeEventOtelOptions as Mi, PEER_MAIL_WIRE_KEY as Mn, ResultBlobStore as Mr, resolveAgentEnvironmentProvider as Mt, createInbox as N, RetainedInteractiveRunHandle as Na, buildLoopOtelSpans as Ni, PeerMailEnvelope as Nn, ResumedKeyState as Nr, sandboxClientAsProvider as Nt, createSteerableSandboxSession as O, readWorkerProgress as Oa, OtelAttribute as Oi, ToolLoopMessageRecord as On, NodeStatus as Or, WorkspaceRequest as Ot, SandboxLeafOut as P, RetainedInteractiveStartMaterial as Pa, buildLoopSpanNodes as Pi, PeerMailEvent as Pn, ResumedWork as Pr, CreateTangleSandboxExactProcessProviderOptions as Pt, resolveMcpServerLaunch as Q, RetainedRunEffect as Qa, createRuntimeStreamEventCollector as Qi, Redactor as Qn, Supervisor as Qr, WorktreeCommandResult as Qt, SandboxUsageLedger as R, NativeContextContinuationInput as Ra, exportEvalRuns as Ri, PeerMailReadout as Rn, RootSignal as Rr, CodexRolloutIdentity as Rt, createExecutor as S, ActivityNote as Sa, EvalRunEvent as Si, RouterTransportConfig as Sn, MaterializedExecutionIdentity as Sr, ProviderAsSandboxClientOptions as St, SandboxSteeringOptions as T, ScopeProgressInput as Ta, EvalRunsExportResult as Ti, ToolLoopChat as Tn, NodeExecutionIdentity as Tr, ProviderPromptOptions as Tt, mapSandboxEvent as U, RetainedInteractiveAdmission as Ua, toOtelAttributes as Ui, claimsAuthority as Un, SpawnJournal as Ur, CodexStoreDelta as Ut, createSandboxUsageLedger as V, RecoverRetainedRunOptions as Va, padSpanId as Vi, PeerMailbox as Vn, Settled as Vr, CodexRolloutStoreRef as Vt, mapSandboxToolEvent as W, RetainedInteractiveEnvironmentAdmission as Wa, RuntimeEventCollector as Wi, createPeerMailbox as Wn, SpawnOpts as Wr, addHarnessUsage as Wt, envKeyProvider as X, RetainedRunCancellation as Xa, SanitizedKnowledgeRequirement as Xi, McpToolDescriptor as Xn, SteerableRootHandle as Xr, InPlaceHarnessResult as Xt, ResolvedMcpServerLaunch as Y, RetainedRunCancelOptions as Ya, SanitizedKnowledgeReadinessReport as Yi, JsonRpcResponse as Yn, SpendGap as Yr, decodeHarnessUsage as Yt, mcpSecretEnvMetadataKey as Z, RetainedRunDispatchedAdmission as Za, createRuntimeEventCollector as Zi, McpTransport as Zn, SupervisedResult as Zr, WorktreeCheckRunner as Zt, RouterSeam as _, TraceSource as _a, TraceContext as _i, RunLocalHarnessOptions as _n, ExecutorRegistry as _r, CreateAgentEnvironmentInput$1 as _t, StreamAgentTurnOptions as a, WaitProbeRegistry as aa, WaitOpts as ai, RemoveWorktreeOptions as an, RetainedRunStartMaterial as ao, DefaultVerdict as ar, AgentEnvironmentProviderRef as at, cliInPlaceExecutor as b, sandboxSessionTraceSource as ba, readTraceContextFromEnv as bi, parseCodexTokenUsage as bn, ExecutorToolCall as br, ForkRequest as bt, BridgeHarnessStore as c, createWaitProbes as ca, WorkerInteractiveUnavailableReason as ci, createWorktree as cn, StartRetainedRunOptions as co, ExecutorAccounting as cr, AgentEnvironmentStatus as ct, CliInPlaceSeam as d, timerAt as da, WorkerTraceResolver as di, CodexExecutionPolicy as dn, ExecutorContext as dr, AgentSession as dt, sanitizeKnowledgeReadinessReport as ea, TokenUsageProvenance as ei, WorktreeProfileMaterializationReceipt as en, RetainedRunEventOptions as eo, resolveRedactor as er, secretEnvOfMcpServer as et, CliSeam as f, validateWaitSpec as fa, WorkerTraceSeamCarrier as fi, CodexTokenUsage as fn, ExecutorExecutionBinding as fr, AgentSessionRef as ft, ProviderSeam as g, ToolStepInput as ga, workerTraceSeamKey as gi, LocalHarnessResult as gn, ExecutorProgressEvent as gr, CheckpointRequest as gt, ExecutorConfig as h, SessionTraceBox as ha, workerTraceHeaders as hi, LocalHarness as hn, ExecutorNodeContext as hr, CheckpointRef as ht, CollectedAgentTurn as i, WaitProbe as ia, UsageEvent as ii, GitRunner as in, RetainedRunSnapshot as io, Budget as ir, AgentEnvironmentProvider$1 as it, InboxMessage as j, RetainedInteractiveAdmissionHook as ja, OtelSpan as ji, DEFAULT_PEER_MAIL_LIMITS as jn, ProviderModelExecutionEvidence as jr, providerAsSandboxClient as jt, AuthorityInboxMessage as k, ReconnectRetainedInteractiveRunOptions as ka, OtelExportConfig as ki, ToolLoopToolCall as kn, ProfileMaterializationReceipt as kr, createAgentEnvironmentProviderRegistry as kt, BridgeModelCredential as l, isWaitOutcome as la, WorkerTraceEvidence as li, removeWorktree as ln, ExecutorCancellation as lr, AgentEnvironmentSummary as lt, CliWorktreeSeam as m, SessionMessageLike as ma, workerTraceEnv as mi, LOCAL_HARNESSES as mn, ExecutorMaterialization as mr, AgentTurnResult$2 as mt, AgentTurnInput$1 as n, PendingWait as na, UnconfirmedTeardown as ni, DiffOptions as nn, RetainedRunIntentAdmission as no, AgentExecutionRef as nr, AgentEnvironmentCapabilities$1 as nt, collectAgentTurn as o, WaitRejection as oa, WidenGate as oi, WorktreeHandle as on, RetainedRunTurnInput as oo, ExecutionBindingReceipt as or, AgentEnvironmentProviderRegistry as ot, CliWorktreeBridgeSeam as p, waitUntil as pa, readWorkerTraceContext as pi, DEFAULT_LOCAL_HARNESS as pn, ExecutorFactory as pr, AgentSessionStatus$1 as pt, sumSandboxUsage as q, RetainedRunAdmission as qa, RuntimeStreamEventSummary as qi, peerMailVerbNames as qn, Spend as qr, readCodexRolloutSession as qt, AgentTurnUsage as r, WaitOutcome as ra, UnknownMaterializationReason as ri, DiffResult as rn, RetainedRunReplayPoint as ro, AgentSpec as rr, AgentEnvironmentEvent$1 as rt, streamAgentTurn as s, WaitSpec as sa, WorkerInteractiveSession as si, captureWorktreeDiff as sn, StartRetainedRunInEnvironmentOptions as so, Executor as sr, AgentEnvironmentQuery as st, AgentTurnBackend as t, sanitizeRuntimeStreamEvent as ta, TreeView as ti, CreateWorktreeOptions as tn, RetainedRunHandle as to, Agent as tr, AgentEnvironment$1 as tt, BridgeSeam as u, pollFor as ua, WorkerTraceUnavailableReason as ui, CodexExecutionEvidence as un, ExecutorCancellationRequest as ur, AgentProfileRef$1 as ut, RouterToolsSeam as v, createPushTraceSource as va, createPropagatingTraceEmitter as vi, harnessSupportsReasoningEffort as vn, ExecutorResult as vr, ExecRequest as vt, DEFAULT_SANDBOX_STEERING_MAX_TURNS as w, ExecutorProgress as wa, EvalRunsExportConfig as wi, ToolLoopCallContext as wn, NoWinnerError as wr, ProviderLeafOut as wt, cliWorktreeExecutor as x, ActivityLog as xa, traceContextToEnv as xi, runLocalHarness as xn, Handle as xr, PlacementInfo as xt, SandboxSeam as y, decodeToolPart as ya, mergeTraceEnv as yi, localHarnessExecutable as yn, ExecutorTeardownWarning as yr, ExecResult as yt, assertSandboxServedModel as z, ReconnectRetainedRunOptions as za, generateSpanId as zi, PeerMailRefusal as zn, Runtime as zr, CodexRolloutSession as zt };
|
|
4636
|
+
//# sourceMappingURL=stream-agent-turn-CAj0XcwD.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ai as promptFromAgentTurnInput, Mi as providerMessageText, Rt as InMemoryResultBlobStore, Si as mapSandboxToolEvent, Xr as knownExecutionBindingReceipt, Zr as knownMaterializationReceipt, _i as createSandboxToolPartState, a as createSupervisor, ai as runtimeOwnedPendingExecutorMaterialization, bi as isSandboxTerminalEvent, ci as unknownMaterializationReceipt, gi as canonicalStreamEventFromSandboxEvent, ji as promptOptionsFromAgentTurnInput, ki as awaitAbortable, li as executableAgentProfileSnapshot, m as withDriverExecutor, mi as readSandboxOutcome, ni as runtimeOwnedExecutorExecutionBinding, ot as createExecutor, pi as projectSandboxOutcome, pn as observedModelMatchesDeclared, qr as authoredProfileDigest, ri as runtimeOwnedExecutorMaterialization, rt as captureReusableExecutorConfig, si as unknownExecutionBindingReceipt, st as createExecutorRegistry, vi as createSandboxUsageLedger, xi as mapSandboxEvent, zt as InMemorySpawnJournal } from "./redact-
|
|
1
|
+
import { Ai as promptFromAgentTurnInput, Mi as providerMessageText, Rt as InMemoryResultBlobStore, Si as mapSandboxToolEvent, Xr as knownExecutionBindingReceipt, Zr as knownMaterializationReceipt, _i as createSandboxToolPartState, a as createSupervisor, ai as runtimeOwnedPendingExecutorMaterialization, bi as isSandboxTerminalEvent, ci as unknownMaterializationReceipt, gi as canonicalStreamEventFromSandboxEvent, ji as promptOptionsFromAgentTurnInput, ki as awaitAbortable, li as executableAgentProfileSnapshot, m as withDriverExecutor, mi as readSandboxOutcome, ni as runtimeOwnedExecutorExecutionBinding, ot as createExecutor, pi as projectSandboxOutcome, pn as observedModelMatchesDeclared, qr as authoredProfileDigest, ri as runtimeOwnedExecutorMaterialization, rt as captureReusableExecutorConfig, si as unknownExecutionBindingReceipt, st as createExecutorRegistry, vi as createSandboxUsageLedger, xi as mapSandboxEvent, zt as InMemorySpawnJournal } from "./redact-B5g0jY2n.js";
|
|
2
2
|
import { m as ValidationError, p as SessionMismatchError, r as BackendTransportError } from "./errors-DodWX-cb.js";
|
|
3
3
|
import { c as profileModelExecutionSettings, i as concreteModelId, l as profileProviderModel, o as enforceTokenLimits, s as profileBridgeWireModel, t as assertExecutableAgentProfile } from "./model-policy-DKDyr-fc.js";
|
|
4
4
|
import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, renderInputPartsAsText } from "@tangle-network/agent-interface";
|
|
@@ -1525,14 +1525,28 @@ function errorMessage(error) {
|
|
|
1525
1525
|
* - `learned` — durable facts written to the cross-run `Corpus` so the NEXT
|
|
1526
1526
|
* run starts smarter (the continuous half of "continuous self-improvement").
|
|
1527
1527
|
*
|
|
1528
|
-
*
|
|
1529
|
-
*
|
|
1528
|
+
* The default analyst produces production observations from execution evidence.
|
|
1529
|
+
* Injected analyses preserve their explicit proposal origins and evidence references.
|
|
1530
|
+
* The observer is harness-agnostic: it
|
|
1530
1531
|
* reads a trace + an output, so it watches opencode, codex, hermes, or a BYO
|
|
1531
1532
|
* agent identically.
|
|
1532
1533
|
*/
|
|
1533
1534
|
const observerId = "observe/trace";
|
|
1534
1535
|
/** The default observer instruction — exported so an optimizer can seed its population. */
|
|
1535
1536
|
const defaultAnalystInstruction = "You are a third-person OBSERVER watching an AI agent work. You see its TRACE (what it did), not its grader. From the trace, name SPECIFIC, behavior-grounded findings: wasted/duplicated tool calls, thrash/retries, token/cost waste, missing verification, failure patterns. For each, a concrete recommended_action, and whether the AGENT (fix its skills/prompt/tools) or the OPERATOR (fix framing/decomposition/config) should act. Only claim what the trace shows. No findings if the run was clean.";
|
|
1537
|
+
/** Analysis can fail after paid work; its measured subtotal must remain recoverable. */
|
|
1538
|
+
var ObservationError = class extends Error {
|
|
1539
|
+
usage;
|
|
1540
|
+
constructor(message, usage, options) {
|
|
1541
|
+
super(message, options);
|
|
1542
|
+
this.usage = usage;
|
|
1543
|
+
validateUsage(usage);
|
|
1544
|
+
this.name = "ObservationError";
|
|
1545
|
+
}
|
|
1546
|
+
};
|
|
1547
|
+
function validateUsage(usage) {
|
|
1548
|
+
if (!Number.isSafeInteger(usage.input) || usage.input < 0 || !Number.isSafeInteger(usage.output) || usage.output < 0 || typeof usage.known !== "boolean") throw new TypeError("observation usage requires nonnegative safe integer subtotals and explicit known status");
|
|
1549
|
+
}
|
|
1536
1550
|
/** Compact the trace into the lines the observer reasons over — tool calls,
|
|
1537
1551
|
* errors, and statuses, in order. Keeps the model call bounded + grounded. */
|
|
1538
1552
|
function summarizeTrace(trace, maxLines) {
|
|
@@ -1609,7 +1623,9 @@ const findingsSchema = {
|
|
|
1609
1623
|
}
|
|
1610
1624
|
};
|
|
1611
1625
|
/** The third-person trace analyst: read a worker's trace and produce steer findings for the next attempt plus durable `learned` facts for the cross-run corpus. */
|
|
1612
|
-
async function
|
|
1626
|
+
async function analyzeWithProfile(input, opts) {
|
|
1627
|
+
if (opts.proposalOrigin !== void 0 && !["production", "search"].includes(opts.proposalOrigin)) throw new TypeError("observer proposal origin must be production or search");
|
|
1628
|
+
for (const limit of [opts.maxTraceLines, opts.maxOutputChars]) if (limit !== void 0 && (!Number.isSafeInteger(limit) || limit < 0)) throw new TypeError("observer context limits must be nonnegative safe integers");
|
|
1613
1629
|
const traceSummary = summarizeTrace(input.trace, opts.maxTraceLines ?? 80);
|
|
1614
1630
|
const res = await profileChatClient({
|
|
1615
1631
|
profile: opts.profile,
|
|
@@ -1619,58 +1635,79 @@ async function observe(input, opts) {
|
|
|
1619
1635
|
jsonSchema: findingsSchema,
|
|
1620
1636
|
messages: [{
|
|
1621
1637
|
role: "user",
|
|
1622
|
-
content: `TASK: ${input.task}\n\nOUTCOME: ${input.outcome ?? "unknown"}\n\nFINAL OUTPUT
|
|
1638
|
+
content: `TASK: ${input.task}\n\nOUTCOME: ${input.outcome ?? "unknown"}\n\nFINAL OUTPUT:\n${input.output.slice(0, opts.maxOutputChars ?? 1200)}\n\nTRACE (in order; "xN" = repeated):\n${traceSummary}`
|
|
1623
1639
|
}]
|
|
1624
1640
|
}, { ...opts.signal ? { signal: opts.signal } : {} });
|
|
1625
|
-
const
|
|
1626
|
-
const
|
|
1627
|
-
const
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
proposal_origin: "production",
|
|
1637
|
-
metadata: { audience: f.audience },
|
|
1638
|
-
...input.runId ? { subject: input.runId } : {}
|
|
1639
|
-
})), "observe findings");
|
|
1640
|
-
const learned = [];
|
|
1641
|
-
if (opts.corpus) for (const f of findings) {
|
|
1642
|
-
const record = {
|
|
1643
|
-
schemaVersion: "1.0.0",
|
|
1644
|
-
id: f.finding_id,
|
|
1645
|
-
runId: input.runId ?? observerId,
|
|
1646
|
-
producedAt: f.produced_at ?? producedAt,
|
|
1641
|
+
const inputTokens = res.usage?.promptTokens;
|
|
1642
|
+
const outputTokens = res.usage?.completionTokens;
|
|
1643
|
+
const usage = {
|
|
1644
|
+
input: inputTokens ?? 0,
|
|
1645
|
+
output: outputTokens ?? 0,
|
|
1646
|
+
known: res.usage?.captured !== false && typeof inputTokens === "number" && typeof outputTokens === "number"
|
|
1647
|
+
};
|
|
1648
|
+
validateUsage(usage);
|
|
1649
|
+
try {
|
|
1650
|
+
const findings = assertProposalFindings(parseFindings(res.content).map((f) => makeProposalFinding({
|
|
1651
|
+
analyst_id: observerId,
|
|
1647
1652
|
area: f.area,
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1653
|
+
severity: f.severity,
|
|
1654
|
+
claim: f.claim,
|
|
1655
|
+
recommended_action: f.recommended_action,
|
|
1651
1656
|
confidence: f.confidence,
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
}
|
|
1657
|
+
evidence_refs: [...input.evidenceRefs ?? []],
|
|
1658
|
+
derived_from_judge: false,
|
|
1659
|
+
proposal_origin: opts.proposalOrigin ?? "production",
|
|
1660
|
+
metadata: { audience: f.audience },
|
|
1661
|
+
...input.runId ? { subject: input.runId } : {}
|
|
1662
|
+
})), "observe findings");
|
|
1663
|
+
return {
|
|
1664
|
+
findings: [...findings],
|
|
1665
|
+
report: renderReport(findings),
|
|
1666
|
+
usage
|
|
1656
1667
|
};
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
learned.push(record);
|
|
1668
|
+
} catch (cause) {
|
|
1669
|
+
throw new ObservationError(cause instanceof Error ? cause.message : String(cause), usage, { cause });
|
|
1660
1670
|
}
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1671
|
+
}
|
|
1672
|
+
/** Analyze through the selected implementation, then retain its validated findings in the corpus. */
|
|
1673
|
+
async function observe(input, opts) {
|
|
1674
|
+
opts.signal?.throwIfAborted();
|
|
1675
|
+
const analysis = opts.analysis ? await opts.analysis(input, { ...opts.signal ? { signal: opts.signal } : {} }) : await analyzeWithProfile(input, opts);
|
|
1676
|
+
validateUsage(analysis.usage);
|
|
1677
|
+
const learned = [];
|
|
1678
|
+
try {
|
|
1679
|
+
opts.signal?.throwIfAborted();
|
|
1680
|
+
const findings = assertProposalFindings(analysis.findings, "observe findings");
|
|
1681
|
+
const producedAt = input.runId ?? observerId;
|
|
1682
|
+
if (opts.corpus) for (const f of findings) {
|
|
1683
|
+
opts.signal?.throwIfAborted();
|
|
1684
|
+
const record = {
|
|
1685
|
+
schemaVersion: "1.0.0",
|
|
1686
|
+
id: f.finding_id,
|
|
1687
|
+
runId: input.runId ?? observerId,
|
|
1688
|
+
producedAt: f.produced_at ?? producedAt,
|
|
1689
|
+
area: f.area,
|
|
1690
|
+
claim: f.recommended_action ?? f.claim,
|
|
1691
|
+
...f.claim ? { rationale: f.claim } : {},
|
|
1692
|
+
tags: [...opts.tags ?? [], `audience:${f.metadata?.audience ?? "agent"}`],
|
|
1693
|
+
confidence: f.confidence,
|
|
1694
|
+
evidence: [{
|
|
1695
|
+
kind: "finding",
|
|
1696
|
+
uri: f.finding_id
|
|
1697
|
+
}, ...f.evidence_refs]
|
|
1698
|
+
};
|
|
1699
|
+
const r = await opts.corpus.append(record);
|
|
1700
|
+
if (!r.succeeded) throw new Error(`observe corpus append failed for '${record.id}' after storing ${learned.length}/${findings.length} findings: ${r.error}`);
|
|
1701
|
+
learned.push(record);
|
|
1672
1702
|
}
|
|
1673
|
-
|
|
1703
|
+
return {
|
|
1704
|
+
...analysis,
|
|
1705
|
+
findings: [...findings],
|
|
1706
|
+
learned
|
|
1707
|
+
};
|
|
1708
|
+
} catch (cause) {
|
|
1709
|
+
throw new ObservationError(cause instanceof Error ? cause.message : String(cause), analysis.usage, { cause });
|
|
1710
|
+
}
|
|
1674
1711
|
}
|
|
1675
1712
|
function parseFindings(content) {
|
|
1676
1713
|
let obj;
|
|
@@ -2803,6 +2840,6 @@ function structuralRollout(config = {}) {
|
|
|
2803
2840
|
});
|
|
2804
2841
|
}
|
|
2805
2842
|
//#endregion
|
|
2806
|
-
export {
|
|
2843
|
+
export { collectAgentTurn as A, defaultAnalystInstruction as C, profileOptimizerModelCall as D, profileChatClient as E, InMemoryRuntimeSessionStore as F, newRuntimeSession as I, nowIso as L, createIterableBackend as M, createSandboxPromptBackend as N, optimizerMethod as O, normalizeBackendStreamEvent as P, startOrResumeRuntimeSession as R, ObservationError as S, renderReport as T, depthStrategy as _, defaultStructuralRolloutPolicy as a, sample as b, officialChecksFromMeta as c, selectBestIndex as d, structuralRollout as f, defineStrategy as g, breadthStrategy as h, defaultExtractCandidate as i, streamAgentTurn as j, strategyAuthorMethod as k, resolveEntrySymbol as l, adaptiveRefine as m, compareCheckOutcomes as n, filterAuthoredAsserts as o, visibleCheckScore as p, composeCheckSources as r, modelAuthoredChecks as s, canDisplace as t, sandboxCheckRunner as u, refine as v, observe as w, sampleThenRefine as x, runAgentic as y, touchSession as z };
|
|
2807
2844
|
|
|
2808
|
-
//# sourceMappingURL=structural-rollout-
|
|
2845
|
+
//# sourceMappingURL=structural-rollout-DPwqGLUp.js.map
|