@tangle-network/agent-runtime 0.196.0 → 0.198.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 (102) hide show
  1. package/README.md +1 -2
  2. package/dist/{activation-BxMZybuo.js → activation-CwdO0ml2.js} +2 -2
  3. package/dist/{activation-BxMZybuo.js.map → activation-CwdO0ml2.js.map} +1 -1
  4. package/dist/{improve-DZs0KXhK.d.ts → activation-DFRTurvU.d.ts} +99 -5
  5. package/dist/agent.d.ts +1 -1
  6. package/dist/agent.js +2 -2
  7. package/dist/candidate-execution/index.d.ts +370 -2
  8. package/dist/candidate-execution/index.js +828 -4
  9. package/dist/candidate-execution/index.js.map +1 -0
  10. package/dist/{coordination-driver-zkCrfEbS.js → coordination-driver-Cf638-6q.js} +2 -5
  11. package/dist/{coordination-driver-zkCrfEbS.js.map → coordination-driver-Cf638-6q.js.map} +1 -1
  12. package/dist/{delegate-D7sonS78.js → delegate-Bez07Dlh.js} +2 -2
  13. package/dist/{delegate-D7sonS78.js.map → delegate-Bez07Dlh.js.map} +1 -1
  14. package/dist/durable.d.ts +110 -6
  15. package/dist/durable.js +404 -47
  16. package/dist/durable.js.map +1 -1
  17. package/dist/{graph-BuS-NxXD.js → graph-DBk3Unto.js} +3 -3
  18. package/dist/{graph-BuS-NxXD.js.map → graph-DBk3Unto.js.map} +1 -1
  19. package/dist/{improvement-cycle-Tw5nYT5R.js → improvement-cycle-Bma8TJs-.js} +8 -10
  20. package/dist/{improvement-cycle-Tw5nYT5R.js.map → improvement-cycle-Bma8TJs-.js.map} +1 -1
  21. package/dist/{index-CYOJsxSg.d.ts → index-D8LWK3Ha.d.ts} +6 -7
  22. package/dist/index.d.ts +694 -16
  23. package/dist/index.js +1780 -17
  24. package/dist/index.js.map +1 -1
  25. package/dist/intelligence.d.ts +3 -7
  26. package/dist/intelligence.js +5 -6
  27. package/dist/intelligence.js.map +1 -1
  28. package/dist/kernel.d.ts +2 -5
  29. package/dist/kernel.js +8 -10
  30. package/dist/{loop-runner-bin-XKMc3Ld-.js → loop-runner-bin-Bd3dHQuw.js} +3 -3
  31. package/dist/{loop-runner-bin-XKMc3Ld-.js.map → loop-runner-bin-Bd3dHQuw.js.map} +1 -1
  32. package/dist/{loop-runner-bin-DwrSB04m.d.ts → loop-runner-bin-Bn-0o_4k.d.ts} +3 -3
  33. package/dist/loop-runner-bin.d.ts +1 -1
  34. package/dist/loop-runner-bin.js +1 -1
  35. package/dist/mcp/bin.js +3 -3
  36. package/dist/mcp/index.d.ts +2 -3
  37. package/dist/mcp/index.js +4 -5
  38. package/dist/mcp/index.js.map +1 -1
  39. package/dist/{prepare-DDGp0-rW.js → prepare-CAO1yXov.js} +2407 -2407
  40. package/dist/prepare-CAO1yXov.js.map +1 -0
  41. package/dist/{protected-model-port-DxFN8DLS.js → protected-model-port-B5avcRiQ.js} +2 -2
  42. package/dist/{protected-model-port-DxFN8DLS.js.map → protected-model-port-B5avcRiQ.js.map} +1 -1
  43. package/dist/{provision-supervisor-CpMMShE_.js → provision-supervisor-C97q5NN_.js} +3 -6
  44. package/dist/{provision-supervisor-CpMMShE_.js.map → provision-supervisor-C97q5NN_.js.map} +1 -1
  45. package/dist/{redact-Cbl2O-4N.js → redact-CVyxp2AU.js} +5232 -2525
  46. package/dist/redact-CVyxp2AU.js.map +1 -0
  47. package/dist/{runtime-DqRieJ6e.js → runtime-BrTBBSfC.js} +427 -23
  48. package/dist/runtime-BrTBBSfC.js.map +1 -0
  49. package/dist/{server-BjB6ay4N.js → server-CO4bvAwe.js} +4 -4
  50. package/dist/{server-BjB6ay4N.js.map → server-CO4bvAwe.js.map} +1 -1
  51. package/dist/{types-DFLZMaeh.d.ts → stream-agent-turn-CLOQr497.d.ts} +1986 -6
  52. package/dist/{structural-rollout-DPbZWgEm.js → structural-rollout-D__lmWXe.js} +1101 -8
  53. package/dist/structural-rollout-D__lmWXe.js.map +1 -0
  54. package/dist/{supervise-D9aNi8_f.js → supervise-KSe4JEcg.js} +30 -7
  55. package/dist/supervise-KSe4JEcg.js.map +1 -0
  56. package/dist/testing.d.ts +2 -2
  57. package/dist/testing.js +13 -13
  58. package/dist/tui/index.d.ts +1 -1
  59. package/dist/tui/index.js +1 -1
  60. package/dist/{workspace-archive-Ybomp7AN.js → workspace-archive-BMOnloFf.js} +3 -3
  61. package/dist/{workspace-archive-Ybomp7AN.js.map → workspace-archive-BMOnloFf.js.map} +1 -1
  62. package/package.json +4 -31
  63. package/dist/activation-DyWB0K6E.d.ts +0 -98
  64. package/dist/authored-code-URmkdgjv.js +0 -37
  65. package/dist/authored-code-URmkdgjv.js.map +0 -1
  66. package/dist/candidate-execution-nvqVIMyS.js +0 -829
  67. package/dist/candidate-execution-nvqVIMyS.js.map +0 -1
  68. package/dist/conversation-BxJ0SIBM.js +0 -1363
  69. package/dist/conversation-BxJ0SIBM.js.map +0 -1
  70. package/dist/conversation.d.ts +0 -2
  71. package/dist/conversation.js +0 -2
  72. package/dist/environment-provider-1fKZh2zl.js +0 -2281
  73. package/dist/environment-provider-1fKZh2zl.js.map +0 -1
  74. package/dist/environment-provider-B-I2jlQy.d.ts +0 -143
  75. package/dist/environment-provider.d.ts +0 -2
  76. package/dist/environment-provider.js +0 -2
  77. package/dist/graph.d.ts +0 -753
  78. package/dist/graph.js +0 -2111
  79. package/dist/graph.js.map +0 -1
  80. package/dist/index-CUosKU4N.d.ts +0 -372
  81. package/dist/index-D9mb6fn2.d.ts +0 -691
  82. package/dist/index-ZnxSe6iK.d.ts +0 -138
  83. package/dist/jsonl-file-BEpaEYjT.js +0 -141
  84. package/dist/jsonl-file-BEpaEYjT.js.map +0 -1
  85. package/dist/knowledge-CPzT_Ve7.js +0 -428
  86. package/dist/knowledge-CPzT_Ve7.js.map +0 -1
  87. package/dist/knowledge.d.ts +0 -2
  88. package/dist/knowledge.js +0 -2
  89. package/dist/materialization-Cy0oM8tb.js +0 -672
  90. package/dist/materialization-Cy0oM8tb.js.map +0 -1
  91. package/dist/prepare-DDGp0-rW.js.map +0 -1
  92. package/dist/primeintellect/index.d.ts +0 -218
  93. package/dist/primeintellect/index.js +0 -739
  94. package/dist/primeintellect/index.js.map +0 -1
  95. package/dist/redact-Cbl2O-4N.js.map +0 -1
  96. package/dist/runtime-0xNaV6TJ.d.ts +0 -1699
  97. package/dist/runtime-DqRieJ6e.js.map +0 -1
  98. package/dist/stream-agent-turn-Dt5mZpc3.js +0 -1103
  99. package/dist/stream-agent-turn-Dt5mZpc3.js.map +0 -1
  100. package/dist/stream-agent-turn-urHpmO_Z.d.ts +0 -160
  101. package/dist/structural-rollout-DPbZWgEm.js.map +0 -1
  102. package/dist/supervise-D9aNi8_f.js.map +0 -1
@@ -1,10 +1,8 @@
1
- import { C as runtimeOwnedScopeOwnerRuntime, D as detachedSnapshot, S as runtimeOwnedPendingExecutorMaterialization, b as runtimeOwnedExecutorMaterialization, d as providerAttemptEvidence, f as recordRuntimeOwnedDriveHarnessProviderEvidence, i as attestRuntimeOwnedScopeOwner, s as inheritRuntimeOwnedExecutorAttestation, v as runtimeOwnedDriveHarnessProviderEvidence, x as runtimeOwnedExecutorProviderEvidence, y as runtimeOwnedExecutorExecutionBinding } from "./materialization-Cy0oM8tb.js";
1
+ import { $ as bridgeAdmissionRefusal, Ar as worktreeCliProfileMaterialization, Ct as createInbox, Er as renderUnsupported, Gn as createOtelExporter, Gr as runtimeOwnedDriveHarnessProviderEvidence, Ir as attestRuntimeOwnedScopeOwner, J as teardownExecutor, Jn as generateSpanId, Jr as runtimeOwnedExecutorProviderEvidence, Kr as runtimeOwnedExecutorExecutionBinding, On as unmeteredSpend, Or as unsupportedProfileDimensions, Q as bindReusableExecutorExecutionId, Qn as toOtelAttributes, Sr as promptModelProfileMaterialization, Ur as providerAttemptEvidence, Wr as recordRuntimeOwnedDriveHarnessProviderEvidence, Xr as runtimeOwnedScopeOwnerRuntime, Xt as contentAddress, Y as assertValidBudget, Yr as runtimeOwnedPendingExecutorMaterialization, Z as spendFromUsageEvents, _ as meterRuntimeOwnedProviderAttempt, _r as controlProfileMaterialization, a as createSupervisor, br as profileMaterializationAxes$1, ct as snapshotExecutorConfig, d as driverChild, et as bridgeModelRouteRefusal, g as meterRuntimeOwnedAccounting, gr as assertProfileMaterialization, h as deriveNodeExecutionIdentity, i as createRootHandle, kn as zeroSpend, l as runFinalizer, ni as detachedSnapshot, nt as bridgeStopSignalKey, o as bestDelivered, ot as createExecutor, p as beginScopeOwnerAttempt, q as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, qr as runtimeOwnedExecutorMaterialization, rt as captureReusableExecutorConfig, sn as routerBrain, tt as bridgeRuntimeAttachmentsKey, u as runTree, ut as WORKER_TRACE_PROPAGATION, v as recordScopeOwnerMaterialization, vr as defineProfileMaterializationContract, xr as promptControlProfileMaterialization, y as scopeOwnerExecutorNodeContext, yr as fullProfileMaterialization, zr as inheritRuntimeOwnedExecutorAttestation } from "./redact-CVyxp2AU.js";
2
2
  import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError, r as BackendTransportError, t as AgentEvalError } from "./errors-DodWX-cb.js";
3
3
  import { a as concreteProfileModel, c as profileModelExecutionSettings, d as agentHarness, f as harnessRunsAgent, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile } from "./model-policy-DKDyr-fc.js";
4
- import { $n as assertProfileMaterialization, Et as createInbox, Fn as toOtelAttributes, On as createOtelExporter, Q as assertValidBudget, S as scopeOwnerExecutorNodeContext, X as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, Z as teardownExecutor, a as createSupervisor, ar as promptModelProfileMaterialization, at as bridgeStopSignalKey, b as meterRuntimeOwnedProviderAttempt, dn as routerBrain, dr as unsupportedProfileDimensions, dt as snapshotExecutorConfig, en as contentAddress, er as controlProfileMaterialization, et as spendFromUsageEvents, f as runFinalizer, g as beginScopeOwnerAttempt, i as createRootHandle, ir as promptControlProfileMaterialization, it as bridgeRuntimeAttachmentsKey, jn as generateSpanId, l as bestDelivered, lr as renderUnsupported, lt as createExecutor, m as driverChild, nr as fullProfileMaterialization, nt as bridgeAdmissionRefusal, ot as captureReusableExecutorConfig, p as runTree, pr as worktreeCliProfileMaterialization, pt as WORKER_TRACE_PROPAGATION, rr as profileMaterializationAxes$1, rt as bridgeModelRouteRefusal, tr as defineProfileMaterializationContract, tt as bindReusableExecutorExecutionId, v as deriveNodeExecutionIdentity, x as recordScopeOwnerMaterialization, y as meterRuntimeOwnedAccounting } from "./redact-Cbl2O-4N.js";
5
- import { E as zeroSpend, w as unmeteredSpend } from "./environment-provider-1fKZh2zl.js";
6
4
  import { t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
7
- import { C as createCoordinationTools, M as createInMemoryRunContext, S as coordinationVerbNames, c as createProgressTracker, d as progressStop, j as createFileRunContext, r as driverAgent } from "./coordination-driver-zkCrfEbS.js";
5
+ import { C as createCoordinationTools, M as createInMemoryRunContext, S as coordinationVerbNames, c as createProgressTracker, d as progressStop, j as createFileRunContext, r as driverAgent } from "./coordination-driver-Cf638-6q.js";
8
6
  import { k as writeRunCancellation, o as readRunCancelRequest, s as readRunCancellation } from "./run-layout-B8I_LXN-.js";
9
7
  import { t as createStdioToolServer } from "./tool-server-BJbCPhoW.js";
10
8
  import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
@@ -2040,6 +2038,30 @@ function profileToolSpawnPreflight(runtimeOwnsManager, canResolveProductTools) {
2040
2038
  };
2041
2039
  };
2042
2040
  }
2041
+ /**
2042
+ * Refuse a harness-brained child that declares Runtime coordination tools when nothing can carry
2043
+ * the coordination server to it. Such a child runs as a nested manager through `driveHarness`, and
2044
+ * the automatic driver reaches Runtime's loopback coordination MCP only through the bridge's
2045
+ * runtime-attachments seam (`automaticDriverBackendSupported`). The worker factory throws the same
2046
+ * fault, but only after a live-worker permit and a budget reservation were taken and as an unnamed
2047
+ * tool error; here it is a pre-flight cause the manager can re-author against, and neither an
2048
+ * environment nor a reservation exists yet. A router-brained child holds the same tools in-process
2049
+ * and needs no channel.
2050
+ */
2051
+ function coordinationChannelSpawnPreflight(runtimeOwnsManager, hasCustomDriveHarness, managerBackend) {
2052
+ if (!runtimeOwnsManager || hasCustomDriveHarness) return void 0;
2053
+ if (managerBackend !== void 0 && automaticDriverBackendSupported(managerBackend)) return;
2054
+ const missingChannel = managerBackend === void 0 ? "this run has no driverBackend" : `the '${managerBackend.backend}' backend has no coordination channel`;
2055
+ return async (profile) => {
2056
+ if (!isExternalSupervisor(profile)) return void 0;
2057
+ const declared = declaredRuntimeToolNames(profile);
2058
+ if (declared.length === 0) return void 0;
2059
+ return {
2060
+ cause: "unmountable-tool",
2061
+ detail: `the profile declares ${declared.map((name) => JSON.stringify(`${coordinationProfileToolPrefix}${name}`)).join(", ")} with harness ${JSON.stringify(profile.harness)}, but ${missingChannel}: Runtime's coordination MCP binds host loopback and reaches a harness only through the 'bridge' backend's runtime-attachments seam. Drive managers through a bridge driverBackend, or supply driveHarness/resolveDriveHarness with a relay this child can reach`
2062
+ };
2063
+ };
2064
+ }
2043
2065
  function composeSpawnPreflights(...preflights) {
2044
2066
  const active = preflights.filter((preflight) => preflight !== void 0);
2045
2067
  if (active.length === 0) return void 0;
@@ -2723,9 +2745,10 @@ function superviseInternal(profile, task, opts, testBrain) {
2723
2745
  await options.onCoordinationEvent?.(context, coordinationEventId(context, event), record);
2724
2746
  } : void 0;
2725
2747
  const managerBackend = options.driverBackend ?? (options.rootDriverFromBackend === false ? void 0 : options.backend);
2726
- const spawnPreflight = composeSpawnPreflights(profileToolSpawnPreflight(options.makeWorkerAgent === void 0, options.resolveSupervisorTools !== void 0), options.backend?.backend === "bridge" ? bridgeSpawnPreflight(options.backend) : void 0);
2727
2748
  if (options.driveHarness && options.resolveDriveHarness) throw new ValidationError("supervise: provide driveHarness or resolveDriveHarness, not both");
2728
- const driverMaterialization = Boolean(options.driveHarness || options.resolveDriveHarness) ? options.driveHarnessMaterialization ?? fullProfileMaterialization : managerBackend && automaticDriverBackendSupported(managerBackend) ? backendProfileMaterialization(managerBackend) : void 0;
2749
+ const hasCustomDriveHarness = Boolean(options.driveHarness || options.resolveDriveHarness);
2750
+ const spawnPreflight = composeSpawnPreflights(profileToolSpawnPreflight(options.makeWorkerAgent === void 0, options.resolveSupervisorTools !== void 0), coordinationChannelSpawnPreflight(options.makeWorkerAgent === void 0, hasCustomDriveHarness, managerBackend), options.backend?.backend === "bridge" ? bridgeSpawnPreflight(options.backend) : void 0);
2751
+ const driverMaterialization = hasCustomDriveHarness ? options.driveHarnessMaterialization ?? fullProfileMaterialization : managerBackend && automaticDriverBackendSupported(managerBackend) ? backendProfileMaterialization(managerBackend) : void 0;
2729
2752
  if (isExternalSupervisor(canonicalProfile) && !options.driveHarness && !options.resolveDriveHarness && (!managerBackend || !automaticDriverBackendSupported(managerBackend))) throw new ValidationError(`supervise: external supervisor profile.harness=${JSON.stringify(canonicalProfile.harness)} requires a local bridge driverBackend, an explicit driveHarness, or resolveDriveHarness with reachable coordination transport`);
2730
2753
  const harnessClaims = /* @__PURE__ */ new WeakMap();
2731
2754
  const claimDriveHarness = (rawHarness, ownerId) => {
@@ -3036,4 +3059,4 @@ function rootProviderModelEvidenceFromExecution(evidence) {
3036
3059
  //#endregion
3037
3060
  export { serveCoordinationMcp as _, isPreSpawnExecutorFailure as a, mapExecutorResult as b, withWorkerSpawnRetry as c, resolveSupervisorProfile as d, supervisorAgent as f, defaultUnmetContractSteer as g, classifyDriverFailure as h, workerFromBackend as i, assertCoordinationBinding as l, DriverAttemptsExhaustedError as m, supervise as n, resolveWorkerSpawnRetry as o, supervisorAgentWithTestBrain as p, superviseWithTestBrain as r, retryPreSpawnRefusals as s, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, coordinationProfileToolPrefix as u, createSupervisorSpanRecorder as v, gateOnDeliverable as y };
3038
3061
 
3039
- //# sourceMappingURL=supervise-D9aNi8_f.js.map
3062
+ //# sourceMappingURL=supervise-KSe4JEcg.js.map