@tangle-network/agent-runtime 0.133.6 → 0.133.8

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.
Files changed (49) hide show
  1. package/dist/{activation-yW1CcPiM.js → activation-CbgOt7bK.js} +2 -2
  2. package/dist/{activation-yW1CcPiM.js.map → activation-CbgOt7bK.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +2 -2
  5. package/dist/{authoring-Cbz3BYqD.js → authoring-DI2ZcORJ.js} +2 -2
  6. package/dist/{authoring-Cbz3BYqD.js.map → authoring-DI2ZcORJ.js.map} +1 -1
  7. package/dist/candidate-execution/index.js +1 -1
  8. package/dist/{candidate-execution-y946fuY1.js → candidate-execution-_u2HIWeX.js} +27 -2
  9. package/dist/candidate-execution-_u2HIWeX.js.map +1 -0
  10. package/dist/{graph-BcwxFLW_.js → graph-CnLcp2Tl.js} +2 -2
  11. package/dist/{graph-BcwxFLW_.js.map → graph-CnLcp2Tl.js.map} +1 -1
  12. package/dist/{improvement-cycle-DJQqqICz.js → improvement-cycle-ekj_ODWY.js} +3 -3
  13. package/dist/{improvement-cycle-DJQqqICz.js.map → improvement-cycle-ekj_ODWY.js.map} +1 -1
  14. package/dist/{index-DLjXduyp.d.ts → index-CP8LBWD1.d.ts} +2 -2
  15. package/dist/{index-kMp8g-jT.d.ts → index-Cgo-tyB8.d.ts} +41 -2
  16. package/dist/index.d.ts +3 -3
  17. package/dist/index.js +8 -8
  18. package/dist/intelligence.js +3 -3
  19. package/dist/kernel.d.ts +2 -2
  20. package/dist/kernel.js +7 -7
  21. package/dist/{knowledge-CD5Xx1J3.js → knowledge-BdJoVN9q.js} +3 -3
  22. package/dist/{knowledge-CD5Xx1J3.js.map → knowledge-BdJoVN9q.js.map} +1 -1
  23. package/dist/knowledge.d.ts +1 -1
  24. package/dist/knowledge.js +1 -1
  25. package/dist/{loop-runner-bin-CC5c39zY.d.ts → loop-runner-bin-BX_266wJ.d.ts} +2 -2
  26. package/dist/{loop-runner-bin-BrF0g950.js → loop-runner-bin-C1uQcY_O.js} +3 -3
  27. package/dist/{loop-runner-bin-BrF0g950.js.map → loop-runner-bin-C1uQcY_O.js.map} +1 -1
  28. package/dist/loop-runner-bin.d.ts +1 -1
  29. package/dist/loop-runner-bin.js +1 -1
  30. package/dist/mcp/bin.js +3 -3
  31. package/dist/mcp/index.d.ts +1 -1
  32. package/dist/mcp/index.js +4 -4
  33. package/dist/{openai-tools-BEeoh5i0.js → openai-tools-BTznyT19.js} +2 -2
  34. package/dist/{openai-tools-BEeoh5i0.js.map → openai-tools-BTznyT19.js.map} +1 -1
  35. package/dist/{runtime-BX5c47Qm.js → runtime-Br49sl8u.js} +79 -17
  36. package/dist/runtime-Br49sl8u.js.map +1 -0
  37. package/dist/{structural-rollout-CHq3qJau.js → structural-rollout-C4_mifPH.js} +2 -2
  38. package/dist/{structural-rollout-CHq3qJau.js.map → structural-rollout-C4_mifPH.js.map} +1 -1
  39. package/dist/{supervise-D-e9RIuG.js → supervise-BTwl4Cdi.js} +19 -5
  40. package/dist/supervise-BTwl4Cdi.js.map +1 -0
  41. package/dist/{supervisor-GBIOnjUo.js → supervisor-BA87pb7g.js} +39 -3
  42. package/dist/supervisor-BA87pb7g.js.map +1 -0
  43. package/dist/testing.d.ts +1 -1
  44. package/dist/testing.js +11 -11
  45. package/package.json +1 -1
  46. package/dist/candidate-execution-y946fuY1.js.map +0 -1
  47. package/dist/runtime-BX5c47Qm.js.map +0 -1
  48. package/dist/supervise-D-e9RIuG.js.map +0 -1
  49. package/dist/supervisor-GBIOnjUo.js.map +0 -1
@@ -6,13 +6,13 @@ import { i as redactProtectedValue, r as redactProtectedReason } from "./protect
6
6
  import { a as notifySandboxEventObserver, c as parseCanonicalTransportEvent, s as extractTransportEventIdentity } from "./sandbox-events-vIwmuPdl.js";
7
7
  import { c as profileProviderModel, i as concreteModelId, s as profileModelExecutionSettings, t as assertExecutableAgentProfile } from "./model-policy-Bv1DU2fw.js";
8
8
  import { T as executableAgentSpecSnapshot, w as executableAgentProfileSnapshot } from "./materialization-D2bdTfkK.js";
9
- import { $ as defaultSelectWinner, F as createExecutorRegistry, G as createPushTraceSource, L as createWorktreeCliExecutor, P as createExecutor, T as rollingDispatch, at as runBrainLoop, et as runAgentRounds, h as settledToIteration, it as routerBrain, l as withDriverExecutor, n as createSupervisor, nt as probeSandboxCapabilities, ot as canonicalObservedModel, tt as createSandboxLineage } from "./supervisor-GBIOnjUo.js";
9
+ import { F as createExecutor, I as createExecutorRegistry, K as createPushTraceSource, R as createWorktreeCliExecutor, T as rollingDispatch, at as routerBrain, et as defaultSelectWinner, h as settledToIteration, l as withDriverExecutor, n as createSupervisor, nt as createSandboxLineage, ot as runBrainLoop, rt as probeSandboxCapabilities, st as canonicalObservedModel, tt as runAgentRounds } from "./supervisor-BA87pb7g.js";
10
10
  import "./environment-provider-DTJA4ZiM.js";
11
11
  import { i as notifyRuntimeHookEvent } from "./runtime-hooks-C7iJOWm3.js";
12
- import { C as observe, O as strategyAuthorMethod, T as profileChatClient, b as sample, v as refine, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-CHq3qJau.js";
13
- import { It as gateOnDeliverable, Lt as mapExecutorResult, n as supervise } from "./supervise-D-e9RIuG.js";
14
- import "./authoring-Cbz3BYqD.js";
15
- import "./graph-BcwxFLW_.js";
12
+ import { C as observe, O as strategyAuthorMethod, T as profileChatClient, b as sample, v as refine, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-C4_mifPH.js";
13
+ import { It as gateOnDeliverable, Lt as mapExecutorResult, n as supervise } from "./supervise-BTwl4Cdi.js";
14
+ import "./authoring-DI2ZcORJ.js";
15
+ import "./graph-CnLcp2Tl.js";
16
16
  import { CODING_HARNESSES, InMemoryTraceStore, OUTPUT_VALUE, benjaminiHochberg, buildTrajectory, computeFindingId as computeFindingId$1, confidenceInterval, expandProfileAxes, makeFinding as makeFinding$1, pairedBootstrap, paretoFrontier, wilcoxonSignedRank, wilson } from "@tangle-network/agent-eval";
17
17
  import { heldoutSignificance, runProfileMatrix } from "@tangle-network/agent-eval/campaign";
18
18
  import { AgentEnvironmentCapabilitiesSchema, AgentExactRunControlRefSchema, AgentNativeContextContinuationResultSchema, AgentRunCancellationAcknowledgementSchema, AgentRunCancellationRequestSchema, AgentTurnResultSchema, InteractionAcknowledgementSchema, InteractionResponseCommandSchema, NativeContextBoundaryProofSchema, NativeContextContinuationRequestSchema, RuntimeEventEnvelopeSchema, agentNativeContextContinuationResultMatchesRequest, agentProfileSchema, agentRunCancellationAcknowledgementMatchesRequest, agentRunCancellationRequestDigest, canonicalAgentProfileDigest, canonicalCandidateDigest, nativeContextContinuationTurnDigest, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
@@ -3596,15 +3596,28 @@ async function exactSessionResult(session) {
3596
3596
  return session.result();
3597
3597
  }
3598
3598
  function assertEventBinding(source, controlRef) {
3599
- const values = [
3600
- isRecord(source) ? source : void 0,
3601
- isRecord(source.data) ? source.data : void 0,
3602
- isRecord(source.providerEvent) ? source.providerEvent : void 0
3603
- ].filter((value) => value !== void 0);
3604
- for (const value of values) {
3599
+ const transport = isRecord(source) ? source : void 0;
3600
+ const payload = isRecord(source.data) ? source.data : void 0;
3601
+ const providerEvent = isRecord(source.providerEvent) ? source.providerEvent : void 0;
3602
+ const bindings = [
3603
+ {
3604
+ value: transport,
3605
+ checkSessionId: true
3606
+ },
3607
+ {
3608
+ value: payload,
3609
+ checkSessionId: source.type !== "session.updated"
3610
+ },
3611
+ {
3612
+ value: providerEvent,
3613
+ checkSessionId: true
3614
+ }
3615
+ ];
3616
+ for (const { value, checkSessionId } of bindings) {
3617
+ if (value === void 0) continue;
3605
3618
  if (value.runId !== void 0 && value.runId !== controlRef.runId) throw new Error("provider returned an event for another retained run");
3606
3619
  if (value.executionId !== void 0 && value.executionId !== controlRef.executionId) throw new Error("provider returned an event for another retained execution");
3607
- if (value.sessionId !== void 0 && value.sessionId !== controlRef.sessionId) throw new Error("provider returned an event for another retained session");
3620
+ if (checkSessionId && value.sessionId !== void 0 && value.sessionId !== controlRef.sessionId) throw new Error("provider returned an event for another retained session");
3608
3621
  }
3609
3622
  }
3610
3623
  function isRecord(value) {
@@ -3922,11 +3935,60 @@ async function startRetainedRun(options) {
3922
3935
  }
3923
3936
  throw new Error(`provider "${options.provider.name}" does not expose detached session control`);
3924
3937
  }
3938
+ return dispatchRetainedRun({
3939
+ provider: options.provider,
3940
+ environment,
3941
+ environmentIdempotencyKey: options.environment.idempotencyKey,
3942
+ turn: options.turn,
3943
+ identity,
3944
+ onAdmission: options.onAdmission,
3945
+ capabilities,
3946
+ now: options.now
3947
+ });
3948
+ }
3949
+ /**
3950
+ * Dispatch a fresh retained session inside an existing provider environment.
3951
+ *
3952
+ * This operation reuses only the environment. It does not append to a prior
3953
+ * harness chat and does not claim native conversation continuity. The caller
3954
+ * must use `RetainedRunHandle.continueNative` for a verified same-chat turn.
3955
+ *
3956
+ * @stable
3957
+ */
3958
+ async function startRetainedRunInEnvironment(options) {
3959
+ assertStableText(options.environment.id, "retained environment id");
3960
+ assertStableText(options.environment.idempotencyKey, "environment idempotency key");
3961
+ assertStableText(options.turn.turnId, "turn idempotency key");
3962
+ if (options.identity !== void 0) {
3963
+ assertStableText(options.identity.sessionId, "retained session id");
3964
+ assertStableText(options.identity.executionId, "retained execution id");
3965
+ }
3966
+ if (typeof options.onAdmission !== "function") throw new Error("startRetainedRunInEnvironment requires an awaited onAdmission durability hook");
3967
+ const identity = options.identity ?? mintRetainedIdentity(options.environment.idempotencyKey, options.turn.turnId);
3968
+ const capabilities = await assertRetainedCapabilities(options.provider);
3969
+ if (!options.provider.get) throw new Error(`provider "${options.provider.name}" cannot reconstruct an environment by id`);
3970
+ const environment = await options.provider.get(options.environment.id);
3971
+ if (!environment) throw new Error(`provider "${options.provider.name}" no longer holds environment "${options.environment.id}"`);
3972
+ if (environment.id !== options.environment.id || environment.provider !== options.provider.name) throw new Error("provider reconstructed a different retained environment");
3973
+ if (!environment.dispatch || !environment.session) throw new Error(`provider "${options.provider.name}" does not expose detached session control`);
3974
+ return dispatchRetainedRun({
3975
+ provider: options.provider,
3976
+ environment,
3977
+ environmentIdempotencyKey: options.environment.idempotencyKey,
3978
+ turn: options.turn,
3979
+ identity,
3980
+ onAdmission: options.onAdmission,
3981
+ capabilities,
3982
+ now: options.now
3983
+ });
3984
+ }
3985
+ async function dispatchRetainedRun(options) {
3986
+ const { environment, identity } = options;
3925
3987
  await admitDurably(options.onAdmission, {
3926
3988
  phase: "environment",
3927
3989
  provider: options.provider.name,
3928
3990
  environmentId: environment.id,
3929
- idempotencyKey: options.environment.idempotencyKey,
3991
+ idempotencyKey: options.environmentIdempotencyKey,
3930
3992
  turnId: options.turn.turnId,
3931
3993
  sessionId: identity.sessionId,
3932
3994
  executionId: identity.executionId
@@ -3962,10 +4024,10 @@ async function startRetainedRun(options) {
3962
4024
  await admitDurably(options.onAdmission, {
3963
4025
  phase: "dispatched",
3964
4026
  controlRef: freezeControlRef(exact.controlRef),
3965
- idempotencyKey: options.environment.idempotencyKey,
4027
+ idempotencyKey: options.environmentIdempotencyKey,
3966
4028
  turnId: options.turn.turnId
3967
4029
  });
3968
- return createRetainedRunHandle(environment, exact.session, exact.controlRef, capabilities, options.now);
4030
+ return createRetainedRunHandle(environment, exact.session, exact.controlRef, options.capabilities, options.now);
3969
4031
  }
3970
4032
  /**
3971
4033
  * Await one admission record through the caller's durability hook. A rejection
@@ -6590,6 +6652,6 @@ function tail(s) {
6590
6652
  return s.slice(-400);
6591
6653
  }
6592
6654
  //#endregion
6593
- export { InMemoryCorpus as $, pickChampion as A, renderLeaderboardSvg as At, runBenchmark as B, mcpSecretEnvMetadataKey as Bt, analyzeTrace as C, deterministicCompletion as Ct, chatWorkerSeam as D, pairwiseSignificance as Dt, chatTransportExecutor as E, leaderboard as Et, strategyAuthorContract as F, connectStdioMcp as Ft, equalKOnCost as G, recoverRetainedRun as H, resolveSecretEnv as Ht, strategyAuthorSystemPrompt as I, materializeLocalMcp as It, runPersonified as J, trajectoryReport as K, SandboxRunAbortError as L, createMcpEnvironment as Lt, selectChampion as M, auditIntent as Mt, assertStrategyContract as N, defaultAuditorInstruction as Nt, createChatSessionStore as O, renderLeaderboardHtml as Ot, authorStrategy as P, McpSpawnFault as Pt, FileCorpus as Q, openSandboxRun as R, sanitizeMcpToolSchema as Rt, withUntrackedArtifacts as S, completionAuthorizes as St, runCoderChecks as T, stopSentinel as Tt, startRetainedRun as U, secretEnvOfMcpServer as Ut, reconnectRetainedRun as V, resolveMcpServerLaunch as Vt, promotionGate as W, createShapeRegistry as X, builtinShapes as Y, registerShape as Z, VERIFY_TAIL_CHARS as _, localSandboxClient as _t, localShell as a, pipeline as at, settledWorkerOut as b, loopDispatch as bt, createVerifierEnvironment as c, widen as ct, harvestSurfaceDiffs as d, createScopeAnalyst as dt, renderCorpusToInstructions as et, failuresAnalyst as f, registryScopeAnalyst as ft, NOTE_MAX_CHARS as g, resolveSandboxClient as gt, EVIDENCE_MAX_CHARS as h, defineLeaderboard as ht, jjWorkspace as i, panel as it, runStrategyEvolution as j, renderPairwiseMarkdown as jt, discriminatingMeans as k, renderLeaderboardMarkdown as kt, boxSurfaceReader as l, assertTraceDerivedFindings as lt, worktreeFanout as m, harvestCorpus as mt, makeFinding$1 as n, flatWidenGate as nt, runInWorkspace as o, selectValidWinner as ot, superviseSurface as p, inProcessSandboxClient as pt, definePersona as q, gitWorkspace as r, loopUntil as rt, createWaterfallCollector as s, verify as st, computeFindingId$1 as t, fanout as tt, fsSurfaceReader as u, buildSteerContext as ut, closingWorkerNote as v, inlineSandboxClient as vt, patchDelivered as w, sentinelCompletion as wt, copyUntrackedIntoClone as x, superviseDispatch as xt, composeWorkerEvidence as y, loopCampaignDispatch as yt, printBenchmarkReport as z, envKeyProvider as zt };
6655
+ export { FileCorpus as $, pickChampion as A, renderLeaderboardMarkdown as At, runBenchmark as B, envKeyProvider as Bt, analyzeTrace as C, completionAuthorizes as Ct, chatWorkerSeam as D, leaderboard as Dt, chatTransportExecutor as E, stopSentinel as Et, strategyAuthorContract as F, McpSpawnFault as Ft, promotionGate as G, recoverRetainedRun as H, resolveMcpServerLaunch as Ht, strategyAuthorSystemPrompt as I, connectStdioMcp as It, definePersona as J, equalKOnCost as K, SandboxRunAbortError as L, materializeLocalMcp as Lt, selectChampion as M, renderPairwiseMarkdown as Mt, assertStrategyContract as N, auditIntent as Nt, createChatSessionStore as O, pairwiseSignificance as Ot, authorStrategy as P, defaultAuditorInstruction as Pt, registerShape as Q, openSandboxRun as R, createMcpEnvironment as Rt, withUntrackedArtifacts as S, superviseDispatch as St, runCoderChecks as T, sentinelCompletion as Tt, startRetainedRun as U, resolveSecretEnv as Ut, reconnectRetainedRun as V, mcpSecretEnvMetadataKey as Vt, startRetainedRunInEnvironment as W, secretEnvOfMcpServer as Wt, builtinShapes as X, runPersonified as Y, createShapeRegistry as Z, VERIFY_TAIL_CHARS as _, resolveSandboxClient as _t, localShell as a, panel as at, settledWorkerOut as b, loopCampaignDispatch as bt, createVerifierEnvironment as c, verify as ct, harvestSurfaceDiffs as d, buildSteerContext as dt, InMemoryCorpus as et, failuresAnalyst as f, createScopeAnalyst as ft, NOTE_MAX_CHARS as g, defineLeaderboard as gt, EVIDENCE_MAX_CHARS as h, harvestCorpus as ht, jjWorkspace as i, loopUntil as it, runStrategyEvolution as j, renderLeaderboardSvg as jt, discriminatingMeans as k, renderLeaderboardHtml as kt, boxSurfaceReader as l, widen as lt, worktreeFanout as m, inProcessSandboxClient as mt, makeFinding$1 as n, fanout as nt, runInWorkspace as o, pipeline as ot, superviseSurface as p, registryScopeAnalyst as pt, trajectoryReport as q, gitWorkspace as r, flatWidenGate as rt, createWaterfallCollector as s, selectValidWinner as st, computeFindingId$1 as t, renderCorpusToInstructions as tt, fsSurfaceReader as u, assertTraceDerivedFindings as ut, closingWorkerNote as v, localSandboxClient as vt, patchDelivered as w, deterministicCompletion as wt, copyUntrackedIntoClone as x, loopDispatch as xt, composeWorkerEvidence as y, inlineSandboxClient as yt, printBenchmarkReport as z, sanitizeMcpToolSchema as zt };
6594
6656
 
6595
- //# sourceMappingURL=runtime-BX5c47Qm.js.map
6657
+ //# sourceMappingURL=runtime-Br49sl8u.js.map