@tangle-network/agent-runtime 0.225.0 → 0.225.3

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 (54) hide show
  1. package/dist/{activation-CKlpXoDU.js → activation-C7i-w3kS.js} +2 -2
  2. package/dist/{activation-CKlpXoDU.js.map → activation-C7i-w3kS.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +2 -2
  5. package/dist/{coordination-driver-GFI-HzJX.js → coordination-driver-DcwOMS5C.js} +2 -2
  6. package/dist/{coordination-driver-GFI-HzJX.js.map → coordination-driver-DcwOMS5C.js.map} +1 -1
  7. package/dist/{delegate-DiH4-45Z.js → delegate-C9B_prgp.js} +2 -2
  8. package/dist/{delegate-DiH4-45Z.js.map → delegate-C9B_prgp.js.map} +1 -1
  9. package/dist/durable.d.ts +1 -1
  10. package/dist/durable.js +2 -2
  11. package/dist/{graph-CiGsa580.js → graph-B_6SZzlE.js} +4 -4
  12. package/dist/{graph-CiGsa580.js.map → graph-B_6SZzlE.js.map} +1 -1
  13. package/dist/{improvement-cycle-BFdb4lCd.js → improvement-cycle-DmuqSX6_.js} +4 -4
  14. package/dist/{improvement-cycle-BFdb4lCd.js.map → improvement-cycle-DmuqSX6_.js.map} +1 -1
  15. package/dist/{index-C2T1Z3jZ.d.ts → index-ClXIBpKe.d.ts} +2 -2
  16. package/dist/index.d.ts +2 -2
  17. package/dist/index.js +8 -8
  18. package/dist/intelligence.js +3 -3
  19. package/dist/kernel.d.ts +1 -1
  20. package/dist/kernel.js +9 -9
  21. package/dist/{loop-runner-bin-BMCpT2i0.d.ts → loop-runner-bin-BRfsk-9d.d.ts} +2 -2
  22. package/dist/{loop-runner-bin-3ERWSHxx.js → loop-runner-bin-Jxq-BUGo.js} +3 -3
  23. package/dist/{loop-runner-bin-3ERWSHxx.js.map → loop-runner-bin-Jxq-BUGo.js.map} +1 -1
  24. package/dist/loop-runner-bin.d.ts +1 -1
  25. package/dist/loop-runner-bin.js +1 -1
  26. package/dist/mcp/bin.js +3 -3
  27. package/dist/mcp/index.d.ts +1 -1
  28. package/dist/mcp/index.js +5 -5
  29. package/dist/{model-policy-DKDyr-fc.js → model-policy-BbSCSak0.js} +4 -4
  30. package/dist/model-policy-BbSCSak0.js.map +1 -0
  31. package/dist/profiles.js +1 -1
  32. package/dist/{provision-supervisor-DD9Xc1as.js → provision-supervisor-ChEnL5xX.js} +8 -35
  33. package/dist/provision-supervisor-ChEnL5xX.js.map +1 -0
  34. package/dist/{runtime-CL6nVSEt.js → runtime-BVV9PbmE.js} +24 -24
  35. package/dist/runtime-BVV9PbmE.js.map +1 -0
  36. package/dist/{server-BWDo2UNM.js → server-Cf0_J9nZ.js} +3 -3
  37. package/dist/{server-BWDo2UNM.js.map → server-Cf0_J9nZ.js.map} +1 -1
  38. package/dist/{structural-rollout-Bs6IfZ8d.js → structural-rollout-C_tpSY6Y.js} +6 -7
  39. package/dist/structural-rollout-C_tpSY6Y.js.map +1 -0
  40. package/dist/{supervise-DYZVP44H.js → supervise-Ah7kMn2p.js} +9 -15
  41. package/dist/supervise-Ah7kMn2p.js.map +1 -0
  42. package/dist/{supervisor-DBzsb6Qt.js → supervisor-0ksHf44Z.js} +230 -172
  43. package/dist/supervisor-0ksHf44Z.js.map +1 -0
  44. package/dist/testing.d.ts +1 -1
  45. package/dist/testing.js +12 -12
  46. package/dist/tui/index.d.ts +1 -1
  47. package/dist/tui/index.js +1 -1
  48. package/package.json +1 -1
  49. package/dist/model-policy-DKDyr-fc.js.map +0 -1
  50. package/dist/provision-supervisor-DD9Xc1as.js.map +0 -1
  51. package/dist/runtime-CL6nVSEt.js.map +0 -1
  52. package/dist/structural-rollout-Bs6IfZ8d.js.map +0 -1
  53. package/dist/supervise-DYZVP44H.js.map +0 -1
  54. package/dist/supervisor-DBzsb6Qt.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { $ as bindReusableExecutorExecutionId, $r as runtimeOwnedExecutorExecutionBinding, $t as bridgeModelRouteRefusal, An as retainedExecutorSeamKey, Bi as resourceTelemetry, C as scopeOwnerExecutorNodeContext, Cr as assertProfileMaterialization, Dr as profileMaterializationAxes$1, Er as fullProfileMaterialization, Et as assertValidBudget, F as scopeRetainedOwnerResult, Fr as unsupportedProfileDimensions, Ii as unmeteredSpend, Kr as inheritRuntimeOwnedExecutorAttestation, Li as withTimeout, Lr as worktreeCliProfileMaterialization, M as prepareScopeRetainedOwnerTask, Mt as WORKER_TRACE_PROPAGATION, N as scopeRetainedOwnerContext, Nr as renderUnsupported, Or as promptControlProfileMaterialization, Ot as meterUsageEvent, P as scopeRetainedOwnerPriorSpend, Pn as runAbortable, Q as teardownExecutor, Qn as createOtelExporter, Qr as runtimeOwnedDriveHarnessProviderEvidence, Qt as bridgeAdmissionRefusal, Ri as zeroSpend, S as restoreScopeOwnerAcceptedExecution, Tr as defineProfileMaterializationContract, Ur as attestRuntimeOwnedScopeOwner, Vi as withBudgetResources, Vt as createInbox, Xr as providerAttemptEvidence, Z as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, Zr as recordRuntimeOwnedDriveHarnessProviderEvidence, an as bridgeStopSignalKey, ar as toOtelAttributes, at as snapshotExecutorConfig, b as meterRuntimeOwnedProviderAttempt, d as runDriverWithRetry, ei as runtimeOwnedExecutorMaterialization, et as captureReusableExecutorConfig, f as driverChild, g as beginScopeOwnerAttempt, gn as routerBrain, in as bridgeRuntimeAttachmentsKey, j as consumeScopeRetainedOwnerResult, jn as RunCancellationReason, jt as spendFromUsageTotals, kn as registerRetainedExecutorPreparation, kr as promptModelProfileMaterialization, kt as newUsageTotals, li as detachedSnapshot, m as isDriverSpec, n as createSupervisor, ni as runtimeOwnedPendingExecutorMaterialization, o as runFinalizer, p as driverExecutorFactory, r as bestDelivered, ri as runtimeOwnedScopeOwnerRuntime, rt as createExecutor, s as runTree, t as createRootHandle, ti as runtimeOwnedExecutorProviderEvidence, tr as generateSpanId, u as defaultUnmetContractSteer, v as deriveNodeExecutionIdentity, wi as addSpend, wn as resolveAgentEnvironmentProvider, wr as controlProfileMaterialization, wt as contentAddress, x as recordScopeOwnerMaterialization, y as meterRuntimeOwnedAccounting, zi as addResourceSpend } from "./supervisor-DBzsb6Qt.js";
1
+ import { $n as generateSpanId, $r as runtimeOwnedExecutorProviderEvidence, Ai as sleep, At as WORKER_TRACE_PROPAGATION, C as scopeOwnerExecutorNodeContext, Cr as defineProfileMaterializationContract, Dn as registerRetainedExecutorPreparation, Dr as promptModelProfileMaterialization, Dt as newUsageTotals, Er as promptControlProfileMaterialization, Et as meterUsageEvent, F as scopeRetainedOwnerResult, Fi as withTimeout, Fr as worktreeCliProfileMaterialization, Gi as teardownExecutor, Ii as zeroSpend, Jr as providerAttemptEvidence, Li as addResourceSpend, M as prepareScopeRetainedOwnerTask, Mn as runAbortable, N as scopeRetainedOwnerContext, Nr as unsupportedProfileDimensions, On as retainedExecutorSeamKey, P as scopeRetainedOwnerPriorSpend, Pi as unmeteredSpend, Q as captureReusableExecutorConfig, Qr as runtimeOwnedExecutorMaterialization, Ri as resourceTelemetry, S as restoreScopeOwnerAcceptedExecution, Si as addSpend, Sn as resolveAgentEnvironmentProvider, Sr as controlProfileMaterialization, St as contentAddress, Tr as profileMaterializationAxes$1, Ui as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, Vr as attestRuntimeOwnedScopeOwner, Wr as inheritRuntimeOwnedExecutorAttestation, Xn as createOtelExporter, Xr as runtimeOwnedDriveHarnessProviderEvidence, Xt as bridgeAdmissionRefusal, Yr as recordRuntimeOwnedDriveHarnessProviderEvidence, Z as bindReusableExecutorExecutionId, Zr as runtimeOwnedExecutorExecutionBinding, Zt as bridgeModelRouteRefusal, b as meterRuntimeOwnedProviderAttempt, d as runDriverWithRetry, ei as runtimeOwnedPendingExecutorMaterialization, f as driverChild, g as beginScopeOwnerAttempt, j as consumeScopeRetainedOwnerResult, jr as renderUnsupported, kn as RunCancellationReason, kt as spendFromUsageTotals, m as isDriverSpec, mn as routerBrain, n as createSupervisor, nn as bridgeRuntimeAttachmentsKey, o as runFinalizer, p as driverExecutorFactory, r as bestDelivered, rn as bridgeStopSignalKey, rr as toOtelAttributes, rt as snapshotExecutorConfig, s as runTree, si as detachedSnapshot, t as createRootHandle, ti as runtimeOwnedScopeOwnerRuntime, tt as createExecutor, u as defaultUnmetContractSteer, v as deriveNodeExecutionIdentity, wr as fullProfileMaterialization, wt as assertValidBudget, x as recordScopeOwnerMaterialization, xr as assertProfileMaterialization, y as meterRuntimeOwnedAccounting, zi as withBudgetResources, zt as createInbox } from "./supervisor-0ksHf44Z.js";
2
2
  import { i as ConfigError, m as ValidationError } from "./errors-DodWX-cb.js";
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";
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-BbSCSak0.js";
4
4
  import { t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
5
5
  import { t as createStdioToolServer } from "./tool-server-BJbCPhoW.js";
6
- import { D as coordinationVerbNames, O as createCoordinationTools, S as watchRunCancellation, c as createProgressTracker, d as progressStop, r as driverAgent, v as createFileRunContext, w as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, x as applyRunCancellation, y as createInMemoryRunContext } from "./coordination-driver-GFI-HzJX.js";
6
+ import { D as coordinationVerbNames, O as createCoordinationTools, S as watchRunCancellation, c as createProgressTracker, d as progressStop, r as driverAgent, v as createFileRunContext, w as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, x as applyRunCancellation, y as createInMemoryRunContext } from "./coordination-driver-DcwOMS5C.js";
7
7
  import { k as writeRunCancellation, o as readRunCancelRequest, s as readRunCancellation } from "./run-layout-hZREkcfu.js";
8
8
  import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalCandidateJson, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
9
9
  import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
@@ -476,7 +476,7 @@ function assertCoordinationTransport(options) {
476
476
  if (!isLoopbackHost(options.host ?? "127.0.0.1") && !options.authentication) throw new ConfigError("coordination non-loopback address requires authentication; allowUnauthenticatedRemote is no longer supported");
477
477
  if (options.authentication !== void 0 && options.authentication !== true && (typeof options.authentication !== "object" || options.authentication === null || Array.isArray(options.authentication))) throw new ConfigError("coordination authentication must be true or a credential lifetime configuration");
478
478
  const ttl = typeof options.authentication === "object" ? options.authentication.ttlMs : void 0;
479
- if (ttl !== void 0 && (!Number.isSafeInteger(ttl) || ttl <= 0 || ttl > 864e5)) throw new ConfigError("coordination credential ttlMs must be a positive integer no greater than 24 hours");
479
+ if (ttl !== void 0 && (!Number.isSafeInteger(ttl) || ttl <= 0 || !Number.isSafeInteger(Date.now() + ttl))) throw new ConfigError("coordination credential ttlMs must be a positive safe integer with a safe expiry");
480
480
  if (options.publicUrl !== void 0 && !options.authentication) throw new ConfigError("coordination publicUrl requires authentication");
481
481
  const signingKeys = typeof options.authentication === "object" ? options.authentication.signingKeys : void 0;
482
482
  if (signingKeys !== void 0) {
@@ -526,9 +526,11 @@ async function serveCoordinationMcp(opts) {
526
526
  const rotateCredential = () => {
527
527
  if (!opts.authentication) throw new ConfigError("coordination authentication is not configured");
528
528
  if (closed) throw new ConfigError("coordination server is closed");
529
+ const expiresAt = Date.now() + (auth?.ttlMs ?? 9e5);
530
+ if (!Number.isSafeInteger(expiresAt)) throw new ConfigError("coordination credential expiry must remain a safe integer");
529
531
  for (const [credential, expiry] of revoked) if (expiry <= Date.now()) revoked.delete(credential);
530
532
  if (token) revoked.set(token.toString(), credentialExpiresAt);
531
- credentialExpiresAt = Date.now() + (auth?.ttlMs ?? 9e5);
533
+ credentialExpiresAt = expiresAt;
532
534
  const nonce = randomBytes(32).toString("base64url");
533
535
  let text = nonce;
534
536
  if (signingKeys) {
@@ -1788,15 +1790,7 @@ function isAsyncIterable$1(value) {
1788
1790
  * timer lets the process exit mid-backoff when nothing else is pending. */
1789
1791
  function defaultSleep(ms, signal) {
1790
1792
  if (ms <= 0 || signal?.aborted) return Promise.resolve();
1791
- return new Promise((resolve) => {
1792
- const done = () => {
1793
- clearTimeout(timer);
1794
- signal?.removeEventListener("abort", done);
1795
- resolve();
1796
- };
1797
- const timer = setTimeout(done, ms);
1798
- signal?.addEventListener("abort", done, { once: true });
1799
- });
1793
+ return sleep(ms, signal);
1800
1794
  }
1801
1795
  //#endregion
1802
1796
  //#region src/runtime/supervise/supervise.ts
@@ -3394,4 +3388,4 @@ function rootProviderModelEvidenceFromExecution(evidence) {
3394
3388
  //#endregion
3395
3389
  export { mapExecutorResult as _, isPreSpawnExecutorFailure as a, withWorkerSpawnRetry as c, resolveSupervisorProfile as d, supervisorAgent as f, gateOnDeliverable as g, serveCoordinationMcp as h, workerFromBackend as i, assertCoordinationBinding as l, createSupervisorSpanRecorder 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 };
3396
3390
 
3397
- //# sourceMappingURL=supervise-DYZVP44H.js.map
3391
+ //# sourceMappingURL=supervise-Ah7kMn2p.js.map