@tangle-network/agent-runtime 0.133.8 → 0.134.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.
Files changed (99) hide show
  1. package/dist/{activation-CbgOt7bK.js → activation-BaxUkhEf.js} +3 -3
  2. package/dist/{activation-CbgOt7bK.js.map → activation-BaxUkhEf.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +2 -2
  5. package/dist/{analyst-loop-C189F6v8.js → analyst-loop-BKWqQhVI.js} +2 -2
  6. package/dist/{analyst-loop-C189F6v8.js.map → analyst-loop-BKWqQhVI.js.map} +1 -1
  7. package/dist/analyst-loop.js +1 -1
  8. package/dist/{authoring-DI2ZcORJ.js → authoring-BlbRLEOS.js} +2 -2
  9. package/dist/{authoring-DI2ZcORJ.js.map → authoring-BlbRLEOS.js.map} +1 -1
  10. package/dist/candidate-execution/index.js +4 -4
  11. package/dist/{candidate-execution-_u2HIWeX.js → candidate-execution-CJRP9CcZ.js} +4 -4
  12. package/dist/{candidate-execution-_u2HIWeX.js.map → candidate-execution-CJRP9CcZ.js.map} +1 -1
  13. package/dist/{conversation-kPowfA_A.js → conversation-CrWcNPQg.js} +4 -4
  14. package/dist/{conversation-kPowfA_A.js.map → conversation-CrWcNPQg.js.map} +1 -1
  15. package/dist/conversation.d.ts +1 -1
  16. package/dist/conversation.js +1 -1
  17. package/dist/{environment-provider-DTJA4ZiM.js → environment-provider-CwvY-Zeq.js} +2 -2
  18. package/dist/{environment-provider-DTJA4ZiM.js.map → environment-provider-CwvY-Zeq.js.map} +1 -1
  19. package/dist/{environment-provider-B-w9VYcF.d.ts → environment-provider-qDOhdE9M.d.ts} +2 -2
  20. package/dist/environment-provider.d.ts +1 -1
  21. package/dist/environment-provider.js +1 -1
  22. package/dist/{errors-DRoXIc7E.js → errors-CVIDr7GQ.js} +9 -1
  23. package/dist/errors-CVIDr7GQ.js.map +1 -0
  24. package/dist/{graph-CnLcp2Tl.js → graph-CKNenH2a.js} +4 -4
  25. package/dist/{graph-CnLcp2Tl.js.map → graph-CKNenH2a.js.map} +1 -1
  26. package/dist/{improvement-cycle-ekj_ODWY.js → improvement-cycle-CSBantKB.js} +9 -9
  27. package/dist/{improvement-cycle-ekj_ODWY.js.map → improvement-cycle-CSBantKB.js.map} +1 -1
  28. package/dist/{index-DqJa9jGF.d.ts → index-CgBJtAzI.d.ts} +2 -2
  29. package/dist/{index-CP8LBWD1.d.ts → index-Cz4qKBxm.d.ts} +4 -4
  30. package/dist/{index-Cgo-tyB8.d.ts → index-De10l_EU.d.ts} +27 -6
  31. package/dist/index.d.ts +7 -7
  32. package/dist/index.js +14 -14
  33. package/dist/intelligence.d.ts +4 -4
  34. package/dist/intelligence.js +6 -6
  35. package/dist/kernel.d.ts +6 -6
  36. package/dist/kernel.js +10 -10
  37. package/dist/{knowledge-BdJoVN9q.js → knowledge-B2C9t1Z4.js} +7 -7
  38. package/dist/{knowledge-BdJoVN9q.js.map → knowledge-B2C9t1Z4.js.map} +1 -1
  39. package/dist/knowledge.d.ts +1 -1
  40. package/dist/knowledge.js +1 -1
  41. package/dist/{loop-runner-bin-C1uQcY_O.js → loop-runner-bin-C0ymKYU7.js} +5 -5
  42. package/dist/{loop-runner-bin-C1uQcY_O.js.map → loop-runner-bin-C0ymKYU7.js.map} +1 -1
  43. package/dist/{loop-runner-bin-BX_266wJ.d.ts → loop-runner-bin-D-tgbSPx.d.ts} +3 -3
  44. package/dist/loop-runner-bin.d.ts +1 -1
  45. package/dist/loop-runner-bin.js +1 -1
  46. package/dist/{materialization-D2bdTfkK.js → materialization-BP5zspr2.js} +25 -10
  47. package/dist/materialization-BP5zspr2.js.map +1 -0
  48. package/dist/mcp/bin.js +4 -4
  49. package/dist/mcp/index.d.ts +3 -3
  50. package/dist/mcp/index.js +9 -9
  51. package/dist/mcp/memory-bin.js +1 -1
  52. package/dist/{memory-server-CblxrUKT.js → memory-server-Cdpy7Uu8.js} +3 -3
  53. package/dist/{memory-server-CblxrUKT.js.map → memory-server-Cdpy7Uu8.js.map} +1 -1
  54. package/dist/{model-policy-Bv1DU2fw.js → model-policy-UTTc9Z-A.js} +2 -2
  55. package/dist/{model-policy-Bv1DU2fw.js.map → model-policy-UTTc9Z-A.js.map} +1 -1
  56. package/dist/{openai-tools-BTznyT19.js → openai-tools-ClOkPIi0.js} +2 -2
  57. package/dist/{openai-tools-BTznyT19.js.map → openai-tools-ClOkPIi0.js.map} +1 -1
  58. package/dist/{prepare-DUbH3GD5.js → prepare-BXEtLOj9.js} +2 -2
  59. package/dist/{prepare-DUbH3GD5.js.map → prepare-BXEtLOj9.js.map} +1 -1
  60. package/dist/primeintellect/index.d.ts +1 -1
  61. package/dist/profiles.js +1 -1
  62. package/dist/{protected-model-port-DP7MS63a.js → protected-model-port-B7PAmTGi.js} +2 -2
  63. package/dist/{protected-model-port-DP7MS63a.js.map → protected-model-port-B7PAmTGi.js.map} +1 -1
  64. package/dist/{redact-BSD-nvTf.d.ts → redact-6UE6pdNi.d.ts} +3 -3
  65. package/dist/{researcher-BiWSFLi6.js → researcher-DBfKdnAz.js} +3 -3
  66. package/dist/{researcher-BiWSFLi6.js.map → researcher-DBfKdnAz.js.map} +1 -1
  67. package/dist/{runtime-Br49sl8u.js → runtime-Bisfbn3_.js} +29 -14
  68. package/dist/runtime-Bisfbn3_.js.map +1 -0
  69. package/dist/{runtime-D-26vxJt.d.ts → runtime-DlxoqEj2.d.ts} +27 -6
  70. package/dist/{snapshot-DY6VGliG.js → snapshot-BOIprwBk.js} +2 -2
  71. package/dist/{snapshot-DY6VGliG.js.map → snapshot-BOIprwBk.js.map} +1 -1
  72. package/dist/{spawn-journal-BX3-4WDm.js → spawn-journal-B856eA8e.js} +27 -11
  73. package/dist/spawn-journal-B856eA8e.js.map +1 -0
  74. package/dist/{stream-agent-turn-NFWCv1X1.d.ts → stream-agent-turn-CJog3ebs.d.ts} +2 -2
  75. package/dist/{stream-agent-turn-D8YHY0oO.js → stream-agent-turn-CdIcf-bn.js} +4 -4
  76. package/dist/{stream-agent-turn-D8YHY0oO.js.map → stream-agent-turn-CdIcf-bn.js.map} +1 -1
  77. package/dist/{structural-rollout-C4_mifPH.js → structural-rollout-DKEP5i__.js} +6 -6
  78. package/dist/{structural-rollout-C4_mifPH.js.map → structural-rollout-DKEP5i__.js.map} +1 -1
  79. package/dist/{supervise-BTwl4Cdi.js → supervise-DhghNvl6.js} +55 -37
  80. package/dist/supervise-DhghNvl6.js.map +1 -0
  81. package/dist/{supervisor-BA87pb7g.js → supervisor-CMlIOkJP.js} +65 -21
  82. package/dist/supervisor-CMlIOkJP.js.map +1 -0
  83. package/dist/testing.d.ts +2 -2
  84. package/dist/testing.js +12 -12
  85. package/dist/{tool-server-VvSK1K3X.js → tool-server-Dh-NcbHr.js} +2 -2
  86. package/dist/{tool-server-VvSK1K3X.js.map → tool-server-Dh-NcbHr.js.map} +1 -1
  87. package/dist/{types-DJ7k6vHE.d.ts → types-D4BfurNs.d.ts} +9 -2
  88. package/dist/{util-Dr--8wAL.js → util-DD8bRWPL.js} +21 -2
  89. package/dist/util-DD8bRWPL.js.map +1 -0
  90. package/dist/{workspace-archive-WEbaLREb.js → workspace-archive-B5oJu5mZ.js} +2 -2
  91. package/dist/{workspace-archive-WEbaLREb.js.map → workspace-archive-B5oJu5mZ.js.map} +1 -1
  92. package/package.json +1 -1
  93. package/dist/errors-DRoXIc7E.js.map +0 -1
  94. package/dist/materialization-D2bdTfkK.js.map +0 -1
  95. package/dist/runtime-Br49sl8u.js.map +0 -1
  96. package/dist/spawn-journal-BX3-4WDm.js.map +0 -1
  97. package/dist/supervise-BTwl4Cdi.js.map +0 -1
  98. package/dist/supervisor-BA87pb7g.js.map +0 -1
  99. package/dist/util-Dr--8wAL.js.map +0 -1
@@ -1,18 +1,18 @@
1
- import { c as RetainedRunAdmissionError, f as ValidationError, l as RetainedRunDispatchBindingError, n as AnalystError, s as PlannerError } from "./errors-DRoXIc7E.js";
2
- import "./stream-agent-turn-D8YHY0oO.js";
3
- import { S as contentAddress, i as InMemorySpawnJournal, r as InMemoryResultBlobStore, y as isTraceAnalysisStore } from "./spawn-journal-BX3-4WDm.js";
4
- import { a as isAbortError, i as hasCompleteCacheBreakdown, l as sleep, m as zeroTokenUsage, n as cloneTokenUsage, s as randomSuffix, t as addTokenUsage, u as stringifySafe } from "./util-Dr--8wAL.js";
1
+ import { c as RetainedRunAdmissionError, f as ValidationError, l as RetainedRunDispatchBindingError, n as AnalystError, s as PlannerError } from "./errors-CVIDr7GQ.js";
2
+ import "./stream-agent-turn-CdIcf-bn.js";
3
+ import { S as contentAddress, i as InMemorySpawnJournal, r as InMemoryResultBlobStore, y as isTraceAnalysisStore } from "./spawn-journal-B856eA8e.js";
4
+ import { a as hasCompleteCacheBreakdown, c as randomSuffix, d as stringifySafe, h as zeroTokenUsage, n as chargedTokens, o as isAbortError, r as cloneTokenUsage, t as addTokenUsage, u as sleep } from "./util-DD8bRWPL.js";
5
5
  import { i as redactProtectedValue, r as redactProtectedReason } from "./protected-redaction--F3v1oo8.js";
6
6
  import { a as notifySandboxEventObserver, c as parseCanonicalTransportEvent, s as extractTransportEventIdentity } from "./sandbox-events-vIwmuPdl.js";
7
- import { c as profileProviderModel, i as concreteModelId, s as profileModelExecutionSettings, t as assertExecutableAgentProfile } from "./model-policy-Bv1DU2fw.js";
8
- import { T as executableAgentSpecSnapshot, w as executableAgentProfileSnapshot } from "./materialization-D2bdTfkK.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
- import "./environment-provider-DTJA4ZiM.js";
7
+ import { c as profileProviderModel, i as concreteModelId, s as profileModelExecutionSettings, t as assertExecutableAgentProfile } from "./model-policy-UTTc9Z-A.js";
8
+ import { E as executableAgentSpecSnapshot, T as executableAgentProfileSnapshot } from "./materialization-BP5zspr2.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-CMlIOkJP.js";
10
+ import "./environment-provider-CwvY-Zeq.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-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";
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-DKEP5i__.js";
13
+ import { It as gateOnDeliverable, Lt as mapExecutorResult, n as supervise } from "./supervise-DhghNvl6.js";
14
+ import "./authoring-BlbRLEOS.js";
15
+ import "./graph-CKNenH2a.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";
@@ -1097,6 +1097,10 @@ function collectProviderModels(evidence, validate) {
1097
1097
  const canonical = /* @__PURE__ */ new Set();
1098
1098
  const observedRaw = /* @__PURE__ */ new Set();
1099
1099
  for (const attempt of evidence.attempts) {
1100
+ if (attempt.providerDispatch === "not_started") {
1101
+ if (attempt.observations.length > 0 || attempt.identityConflict === true) return { kind: "unknown" };
1102
+ continue;
1103
+ }
1100
1104
  if (attempt === null || typeof attempt !== "object" || !Array.isArray(attempt.observations) || attempt.observations.length === 0 || attempt.identityConflict === true) return { kind: "unknown" };
1101
1105
  let attemptBase;
1102
1106
  let attemptSnapshot;
@@ -3120,13 +3124,18 @@ async function trajectoryReport(journal, blobs, root, options = {}) {
3120
3124
  * within-tolerance when the per-channel spread (max − min across arms) over the median is
3121
3125
  * `≤ tolerance`. Pure over the reports — no I/O. Fails loud on an empty arm list (nothing to
3122
3126
  * compare) so a vacuous "equal" is never returned.
3127
+ *
3128
+ * The token channel uses `chargedTokens`, the same unit the conserved pool spends, so the cross-run
3129
+ * check and the within-run pool cannot disagree about what an arm cost. Charging the rolled-up
3130
+ * prompt total instead would rate an arm by how often it re-read a cached prefix: two arms given
3131
+ * identical work would read as unequal compute whenever their cache hit rates differed.
3123
3132
  */
3124
3133
  function equalKOnCost(arms, options = {}) {
3125
3134
  if (arms.length === 0) throw new Error("equalKOnCost: no arms to compare");
3126
3135
  const tolerance = options.tolerance ?? defaultEqualKTolerance;
3127
3136
  const armCosts = arms.map((arm) => ({
3128
3137
  label: arm.label,
3129
- tokens: arm.report.total.tokens.input + arm.report.total.tokens.output,
3138
+ tokens: chargedTokens(arm.report.total.tokens),
3130
3139
  usd: arm.report.total.usd,
3131
3140
  iterations: arm.report.total.iterations
3132
3141
  }));
@@ -3971,6 +3980,7 @@ async function startRetainedRunInEnvironment(options) {
3971
3980
  if (!environment) throw new Error(`provider "${options.provider.name}" no longer holds environment "${options.environment.id}"`);
3972
3981
  if (environment.id !== options.environment.id || environment.provider !== options.provider.name) throw new Error("provider reconstructed a different retained environment");
3973
3982
  if (!environment.dispatch || !environment.session) throw new Error(`provider "${options.provider.name}" does not expose detached session control`);
3983
+ await assertRetainedEnvironmentOwnership(options.provider, environment.id, options.environment.idempotencyKey);
3974
3984
  return dispatchRetainedRun({
3975
3985
  provider: options.provider,
3976
3986
  environment,
@@ -3982,6 +3992,11 @@ async function startRetainedRunInEnvironment(options) {
3982
3992
  now: options.now
3983
3993
  });
3984
3994
  }
3995
+ async function assertRetainedEnvironmentOwnership(provider, environmentId, idempotencyKey) {
3996
+ if (!provider.list) throw new Error(`provider "${provider.name}" cannot prove retained environment ownership by metadata`);
3997
+ const matches = (await provider.list({ metadata: { retainedIdempotencyKey: idempotencyKey } })).filter((summary) => summary.id === environmentId && summary.provider === provider.name);
3998
+ if (matches.length !== 1 || matches[0]?.metadata?.retainedIdempotencyKey !== idempotencyKey) throw new Error(`provider "${provider.name}" could not bind environment "${environmentId}" to its retained idempotency key`);
3999
+ }
3985
4000
  async function dispatchRetainedRun(options) {
3986
4001
  const { environment, identity } = options;
3987
4002
  await admitDurably(options.onAdmission, {
@@ -6654,4 +6669,4 @@ function tail(s) {
6654
6669
  //#endregion
6655
6670
  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 };
6656
6671
 
6657
- //# sourceMappingURL=runtime-Br49sl8u.js.map
6672
+ //# sourceMappingURL=runtime-Bisfbn3_.js.map