@tangle-network/agent-runtime 0.290.1 → 0.291.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.
Files changed (55) hide show
  1. package/dist/{activation-BdvuHbTG.js → activation-BPZL1WCG.js} +2 -2
  2. package/dist/{activation-BdvuHbTG.js.map → activation-BPZL1WCG.js.map} +1 -1
  3. package/dist/{activation-qNAqp9BD.d.ts → activation-D8DOMMZc.d.ts} +2 -2
  4. package/dist/agent.d.ts +1 -1
  5. package/dist/agent.js +2 -2
  6. package/dist/{coordination-driver-CTw92HIk.js → coordination-driver-CUnF7gfN.js} +3 -2
  7. package/dist/coordination-driver-CUnF7gfN.js.map +1 -0
  8. package/dist/{delegate-DhAvvPIP.js → delegate-B0j4915d.js} +2 -2
  9. package/dist/{delegate-DhAvvPIP.js.map → delegate-B0j4915d.js.map} +1 -1
  10. package/dist/durable.d.ts +1 -1
  11. package/dist/durable.js +2 -2
  12. package/dist/{graph-2Iea0PDT.js → graph-ByPZb_xc.js} +5 -5
  13. package/dist/{graph-2Iea0PDT.js.map → graph-ByPZb_xc.js.map} +1 -1
  14. package/dist/{improvement-cycle-CdT1IClg.js → improvement-cycle-DipoyAM3.js} +4 -4
  15. package/dist/{improvement-cycle-CdT1IClg.js.map → improvement-cycle-DipoyAM3.js.map} +1 -1
  16. package/dist/{index-CNHHOhRS.d.ts → index-D-5e8mss.d.ts} +10 -2
  17. package/dist/index.d.ts +4 -4
  18. package/dist/index.js +8 -8
  19. package/dist/intelligence.d.ts +2 -2
  20. package/dist/intelligence.js +4 -4
  21. package/dist/kernel.d.ts +3 -3
  22. package/dist/kernel.js +9 -9
  23. package/dist/{loop-runner-bin-liVnm-Gi.d.ts → loop-runner-bin-Bkw-_LkG.d.ts} +2 -2
  24. package/dist/{loop-runner-bin-BuEFaR7Z.js → loop-runner-bin-DhPBdCux.js} +3 -3
  25. package/dist/{loop-runner-bin-BuEFaR7Z.js.map → loop-runner-bin-DhPBdCux.js.map} +1 -1
  26. package/dist/loop-runner-bin.d.ts +1 -1
  27. package/dist/loop-runner-bin.js +1 -1
  28. package/dist/mcp/bin.js +3 -3
  29. package/dist/mcp/index.d.ts +2 -2
  30. package/dist/mcp/index.js +5 -5
  31. package/dist/{model-policy-CA5d1YUP.js → model-policy-DydyWTQg.js} +186 -2
  32. package/dist/model-policy-DydyWTQg.js.map +1 -0
  33. package/dist/profiles.js +1 -1
  34. package/dist/{provision-supervisor-Cm2-dL4F.js → provision-supervisor-DvEpuocs.js} +4 -4
  35. package/dist/{provision-supervisor-Cm2-dL4F.js.map → provision-supervisor-DvEpuocs.js.map} +1 -1
  36. package/dist/{runtime-DJ_ISfL-.js → runtime-Ba7oK4M1.js} +9 -9
  37. package/dist/{runtime-DJ_ISfL-.js.map → runtime-Ba7oK4M1.js.map} +1 -1
  38. package/dist/{search-method-Q7X92VD3.js → search-method-Cs6SLt8I.js} +3 -3
  39. package/dist/{search-method-Q7X92VD3.js.map → search-method-Cs6SLt8I.js.map} +1 -1
  40. package/dist/{server-CRTAzqiD.js → server-CVRFM3ZF.js} +3 -3
  41. package/dist/{server-CRTAzqiD.js.map → server-CVRFM3ZF.js.map} +1 -1
  42. package/dist/{stream-agent-turn-kseOD-Ma.d.ts → stream-agent-turn-n3kOukD_.d.ts} +19 -2
  43. package/dist/{supervise-CClk-m6Y.js → supervise-dYioyGT-.js} +27 -7
  44. package/dist/supervise-dYioyGT-.js.map +1 -0
  45. package/dist/{supervisor-CQFcQhlo.js → supervisor-DpUCJtKC.js} +117 -152
  46. package/dist/supervisor-DpUCJtKC.js.map +1 -0
  47. package/dist/testing.d.ts +2 -2
  48. package/dist/testing.js +12 -12
  49. package/dist/tui/index.d.ts +1 -1
  50. package/dist/tui/index.js +1 -1
  51. package/package.json +5 -5
  52. package/dist/coordination-driver-CTw92HIk.js.map +0 -1
  53. package/dist/model-policy-CA5d1YUP.js.map +0 -1
  54. package/dist/supervise-CClk-m6Y.js.map +0 -1
  55. package/dist/supervisor-CQFcQhlo.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { A as driverExecutorFactory, Aa as addResourceSpend, Ai as prepareJsonlAppend, Ar as contentAddress, B as recordScopeOwnerDriverAttempt, Bn as registerRetainedExecutorPreparation, Bt as WORKER_TRACE_PROPAGATION, C as createContinuationKeeper, Ca as sleep, Da as unmeteredSpend, Ei as unsupportedProfileDimensions, En as routerBrain, F as beginScopeOwnerAttempt, Gi as runtimeOwnedExecutorMaterialization, H as recordScopeOwnerPause, Hi as recordRuntimeOwnedDriveHarnessProviderEvidence, Hr as createOtelExporter, Ia as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, Ji as runtimeOwnedScopeOwnerRuntime, Jr as toOtelAttributes, Ki as runtimeOwnedExecutorProviderEvidence, L as deriveNodeExecutionIdentity, Li as inheritRuntimeOwnedExecutorAttestation, Ma as withBudgetResources, Mt as createExecutor, Oa as withTimeout, Oi as worktreeCliProfileMaterialization, Or as persistHarnessTranscript, Ot as bindReusableExecutorExecutionId, P as assertRecursiveReservationPolicy, Pi as attestRuntimeOwnedScopeOwner, Pn as resolveAgentEnvironmentProvider, Pt as snapshotExecutorConfig, R as meterRuntimeOwnedAccounting, Ra as teardownExecutor, Rt as createRouterTranscript, Sr as RunCancellationReason, Tr as runAbortable, U as restoreScopeOwnerAcceptedExecution, Ui as runtimeOwnedDriveHarnessProviderEvidence, V as recordScopeOwnerMaterialization, Vi as providerAttemptEvidence, Vn as retainedExecutorSeamKey, W as scopeOwnerExecutorNodeContext, Wi as runtimeOwnedExecutorExecutionBinding, Wr as generateSpanId, Yt as createInbox, _ as CheckUnavailableError, _i as fullProfileMaterialization, ar as executorFailure, at as reconcileScopeRetainedOwnerEnvironment, b as bestComposite, bi as promptModelProfileMaterialization, c as runTree, cr as assertValidBudget, ct as scopeRetainedOwnerResourceReader, dr as newUsageTotals, ea as detachedSnapshot, et as bindScopeRetainedOwnerEnvironmentId, f as runDriverWithRetry, fn as bridgeRuntimeAttachmentsKey, gi as defineProfileMaterializationContract, h as CONTINUATIONS_DIR, ha as addSpend, hi as controlProfileMaterialization, i as bestDelivered, it as prepareScopeRetainedOwnerTask, j as isDriverSpec, ja as resourceTelemetry, ji as readCommittedJsonLines, k as driverChild, ka as zeroSpend, ki as isNoEntError, kr as readHarnessTranscript, kt as captureReusableExecutorConfig, lt as scopeRetainedOwnerRestorePoint, mi as assertProfileMaterialization, mr as errMessage, n as createRootHandle, nt as consumeScopeRetainedOwnerResult, on as bridgeAdmissionRefusal, ot as scopeRetainedOwnerContext, p as summarizeDriverAttempts, pn as bridgeStopSignalKey, pr as spendFromUsageTotals, qi as runtimeOwnedPendingExecutorMaterialization, r as createSupervisor, rr as parseWorkerToolTraceArtifact, rt as noteScopeRetainedOwnerCoordination, s as runFinalizer, sn as bridgeModelRouteRefusal, st as scopeRetainedOwnerPriorSpend, tt as bindScopeRetainedOwnerProvider, u as HarnessTurnFailedError, ur as meterUsageEvent, ut as scopeRetainedOwnerResult, v as admitContinuationPolicy, vi as profileMaterializationAxes$1, wi as renderUnsupported, wr as linkAbort, x as checkVerdictOf, yi as promptControlProfileMaterialization, z as meterRuntimeOwnedProviderAttempt, za as teardownSurfaces } from "./supervisor-CQFcQhlo.js";
1
+ import { A as driverExecutorFactory, Aa as withBudgetResources, B as recordScopeOwnerDriverAttempt, Bi as recordRuntimeOwnedDriveHarnessProviderEvidence, Br as createOtelExporter, Bt as WORKER_TRACE_PROPAGATION, C as createContinuationKeeper, Cr as runAbortable, Da as zeroSpend, Di as isNoEntError, Dr as readHarnessTranscript, Ea as withTimeout, Ei as worktreeCliProfileMaterialization, En as routerBrain, Er as persistHarnessTranscript, F as beginScopeOwnerAttempt, Fi as inheritRuntimeOwnedExecutorAttestation, Gi as runtimeOwnedPendingExecutorMaterialization, H as recordScopeOwnerPause, Hi as runtimeOwnedExecutorExecutionBinding, Hr as generateSpanId, Ia as teardownExecutor, Ki as runtimeOwnedScopeOwnerRuntime, Kr as toOtelAttributes, L as deriveNodeExecutionIdentity, La as teardownSurfaces, Mi as attestRuntimeOwnedScopeOwner, Mn as resolveAgentEnvironmentProvider, Mt as createExecutor, Oa as addResourceSpend, Oi as prepareJsonlAppend, Or as contentAddress, Ot as bindReusableExecutorExecutionId, P as assertRecursiveReservationPolicy, Pa as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, Pt as snapshotExecutorConfig, Qi as detachedSnapshot, R as meterRuntimeOwnedAccounting, Rn as registerRetainedExecutorPreparation, Rt as createRouterTranscript, Si as renderUnsupported, Sr as linkAbort, Ta as unmeteredSpend, U as restoreScopeOwnerAcceptedExecution, Ui as runtimeOwnedExecutorMaterialization, V as recordScopeOwnerMaterialization, Vi as runtimeOwnedDriveHarnessProviderEvidence, W as scopeOwnerExecutorNodeContext, Wi as runtimeOwnedExecutorProviderEvidence, Yt as createInbox, _ as CheckUnavailableError, _i as promptControlProfileMaterialization, at as reconcileScopeRetainedOwnerEnvironment, b as bestComposite, br as RunCancellationReason, c as runTree, cr as meterUsageEvent, ct as scopeRetainedOwnerResourceReader, dr as spendFromUsageTotals, et as bindScopeRetainedOwnerEnvironmentId, f as runDriverWithRetry, fi as assertProfileMaterialization, fn as bridgeRuntimeAttachmentsKey, fr as errMessage, gi as profileMaterializationAxes$1, h as CONTINUATIONS_DIR, hi as fullProfileMaterialization, i as bestDelivered, it as prepareScopeRetainedOwnerTask, j as isDriverSpec, k as driverChild, ka as resourceTelemetry, ki as readCommittedJsonLines, kt as captureReusableExecutorConfig, lr as newUsageTotals, lt as scopeRetainedOwnerRestorePoint, mi as defineProfileMaterializationContract, n as createRootHandle, nt as consumeScopeRetainedOwnerResult, on as bridgeAdmissionRefusal, or as assertValidBudget, ot as scopeRetainedOwnerContext, p as summarizeDriverAttempts, pa as addSpend, pi as controlProfileMaterialization, pn as bridgeStopSignalKey, r as createSupervisor, rr as executorFailure, rt as noteScopeRetainedOwnerCoordination, s as runFinalizer, sn as bridgeModelRouteRefusal, st as scopeRetainedOwnerPriorSpend, tr as parseWorkerToolTraceArtifact, tt as bindScopeRetainedOwnerProvider, u as HarnessTurnFailedError, ut as scopeRetainedOwnerResult, v as admitContinuationPolicy, vi as promptModelProfileMaterialization, wi as unsupportedProfileDimensions, x as checkVerdictOf, xa as sleep, z as meterRuntimeOwnedProviderAttempt, zi as providerAttemptEvidence, zn as retainedExecutorSeamKey } from "./supervisor-DpUCJtKC.js";
2
2
  import { f as RuntimeRunStateError, 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-CA5d1YUP.js";
3
+ import { _ as agentHarness, a as concreteProfileModel, c as profileModelExecutionSettings, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile, v as harnessRunsAgent } from "./model-policy-DydyWTQg.js";
4
4
  import { n as assertNoSymlinkDescendant } from "./durable-file-DWQA4ooo.js";
5
5
  import { t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
6
- import { C as applyRunCancellation, E as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, b as withRunContext, c as createProgressTracker, d as progressStop, j as createCoordinationToolsForManager, k as coordinationVerbNames, n as createSteerAcknowledger, r as driverAgent, t as createCancelAcknowledger, u as plateau, v as createFileRunContext, w as watchRunCancellation, y as createInMemoryRunContext } from "./coordination-driver-CTw92HIk.js";
6
+ import { C as applyRunCancellation, E as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, b as withRunContext, c as createProgressTracker, d as progressStop, j as createCoordinationToolsForManager, k as coordinationVerbNames, n as createSteerAcknowledger, r as driverAgent, t as createCancelAcknowledger, u as plateau, v as createFileRunContext, w as watchRunCancellation, y as createInMemoryRunContext } from "./coordination-driver-CUnF7gfN.js";
7
7
  import { r as createStdioToolServer, t as PROTOCOL_VERSION } from "./tool-server-Dqer2M4_.js";
8
8
  import { k as writeRunCancellation, o as readRunCancelRequest, s as readRunCancellation } from "./run-layout-DSCWdbX2.js";
9
9
  import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalCandidateJson, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
@@ -1746,7 +1746,7 @@ function observeWorkerControls(options) {
1746
1746
  * relay or tunnel. The harness IS the brain.
1747
1747
  *
1748
1748
  * Both arms spawn children through the SAME `makeWorkerAgent` seam and apply the SAME independent
1749
- * deliverable check to direct submissions. Raw driver prose is never eligible.
1749
+ * deliverable check to direct submissions. Raw driver prose is never quality-accepted.
1750
1750
  */
1751
1751
  /** Runtime-owned coordination is mounted under this MCP alias. */
1752
1752
  const coordinationMcpAlias = "agent-runtime-coordination";
@@ -2324,7 +2324,15 @@ function buildSupervisorAgent(profile, deps, testBrain) {
2324
2324
  deps.onAcceptedSubmission?.(submitted.result);
2325
2325
  return submitted.result;
2326
2326
  }
2327
- return contractDeclared ? candidate : await finalize();
2327
+ if (contractDeclared) return candidate;
2328
+ const finalized = await finalize();
2329
+ if (finalized !== void 0) return finalized;
2330
+ const harnessResult = driveHarness.resultArtifact?.();
2331
+ if (nodeContextSeed !== void 0 && nodeContextSeed.depth > 0 && harnessResult?.out !== void 0 && harnessResult.out !== null) {
2332
+ deps.onUnassessedOutput?.(harnessResult.out);
2333
+ return harnessResult.out;
2334
+ }
2335
+ return;
2328
2336
  } finally {
2329
2337
  coordinationLifetime.abort(/* @__PURE__ */ new Error("supervisor manager stopped"));
2330
2338
  try {
@@ -3080,7 +3088,9 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
3080
3088
  const ownerRuntime = boundBackend.backend === "provider" ? boundBackend.runtime ?? resolveAgentEnvironmentProvider(boundBackend.provider, boundBackend.registry).name : "cli";
3081
3089
  let activeExecutor;
3082
3090
  let managerTranscript;
3091
+ let managerArtifact;
3083
3092
  const drive = async ({ profile, authoredProfile, task, scope, coordinationMcpUrl, coordinationMcpHeaders, stopSignal, coordinationTools, reentry }) => {
3093
+ managerArtifact = void 0;
3084
3094
  const retainedOwner = boundBackend.backend === "provider" ? scopeRetainedOwnerContext(scope) : void 0;
3085
3095
  if (retainedOwner && boundBackend.backend === "provider") {
3086
3096
  bindScopeRetainedOwnerProvider(scope, resolveAgentEnvironmentProvider(boundBackend.provider, boundBackend.registry));
@@ -3103,6 +3113,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
3103
3113
  consumeScopeRetainedOwnerResult(scope);
3104
3114
  const replayedFailure = executorFailure(acceptedOwner);
3105
3115
  if (replayedFailure !== void 0) throw new HarnessTurnFailedError(ownerRuntime, replayedFailure);
3116
+ managerArtifact = acceptedOwner;
3106
3117
  return;
3107
3118
  }
3108
3119
  const initialBudget = scope.budget;
@@ -3259,6 +3270,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
3259
3270
  let failed = false;
3260
3271
  let failure;
3261
3272
  let turnFailure;
3273
+ let terminalArtifact;
3262
3274
  let ownerMaterializationPublished = false;
3263
3275
  const ownerDeclaration = (exactDeclaration) => ({
3264
3276
  ...exactDeclaration,
@@ -3335,6 +3347,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
3335
3347
  else pendingUsage.push(event);
3336
3348
  await meterPending();
3337
3349
  const artifact = executor.resultArtifact();
3350
+ terminalArtifact = artifact;
3338
3351
  const terminalResources = withBudgetResources({
3339
3352
  ...artifact.spent,
3340
3353
  ...resourceTelemetry(observedOwnerSpend, artifact.spent)
@@ -3364,6 +3377,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
3364
3377
  if (reported !== void 0) turnFailure = new HarnessTurnFailedError(executor.runtime, reported);
3365
3378
  } else {
3366
3379
  const artifact = await run;
3380
+ terminalArtifact = artifact;
3367
3381
  await meterRuntimeOwnedProviderAttempt(scope, withBudgetResources({
3368
3382
  ...artifact.spent,
3369
3383
  iterations: 0
@@ -3449,7 +3463,9 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
3449
3463
  }
3450
3464
  if (failed) throw failure;
3451
3465
  if (turnFailure !== void 0) throw turnFailure;
3466
+ managerArtifact = terminalArtifact;
3452
3467
  };
3468
+ drive.resultArtifact = () => managerArtifact;
3453
3469
  drive.deliver = (message) => {
3454
3470
  const deliver = activeExecutor?.deliver;
3455
3471
  if (!deliver) return false;
@@ -4231,8 +4247,12 @@ function superviseInternal(profile, task, opts, testBrain) {
4231
4247
  const nestedPerWorker = defaultPerWorker(spawnContext.budget, ownerShare);
4232
4248
  const authorizeNestedMessage = authorizeDownFor(authorized, depth + 1);
4233
4249
  let acceptedSubmission = false;
4250
+ let unassessedOutput = false;
4234
4251
  return driverChild(authorized, supervisorAgent(authorized, {
4235
4252
  blobs,
4253
+ onUnassessedOutput: () => {
4254
+ unassessedOutput = true;
4255
+ },
4236
4256
  ...spawnResourceRoot === void 0 ? {} : { spawnResourceRoot },
4237
4257
  makeWorkerAgent: childFactory,
4238
4258
  ...authorizeNestedMessage ? { authorizeDownMessage: authorizeNestedMessage } : {},
@@ -4291,7 +4311,7 @@ function superviseInternal(profile, task, opts, testBrain) {
4291
4311
  },
4292
4312
  ...options.steerDir === void 0 ? {} : { steerDir: resolve(options.steerDir) },
4293
4313
  ...options.runDir === void 0 && options.steerDir === void 0 ? {} : { controlScope: "subtree" }
4294
- }), journal, childExecution.ref, () => acceptedSubmission, recoveryFactories.get(childFactory));
4314
+ }), journal, childExecution.ref, () => acceptedSubmission, recoveryFactories.get(childFactory), () => unassessedOutput);
4295
4315
  };
4296
4316
  if (options.makeLeafAgent === void 0 && options.backend?.backend === "provider" && !options.backend.steering) {
4297
4317
  const factory = registerRetainedExecutorPreparation(createExecutor(options.backend), ({ spawned, profile, task }) => {
@@ -4522,4 +4542,4 @@ function rootProviderModelEvidenceFromExecution(evidence) {
4522
4542
  //#endregion
4523
4543
  export { gateOnDeliverable as C, serveCoordinationMcp as S, readRootStream as _, superviseWithTestBrain as a, composeReentryTask as b, resolveWorkerSpawnRetry as c, assertCoordinationBinding as d, coordinationProfileToolPrefix as f, ROOT_STREAM_FILE as g, supervisorAgentWithTestBrain as h, superviseRootProfile as i, retryPreSpawnRefusals as l, supervisorAgent as m, profileGuidanceComposer as n, workerFromBackend as o, resolveSupervisorProfile as p, supervise as r, isPreSpawnExecutorFailure as s, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, withWorkerSpawnRetry as u, readRootStreamReceipt as v, mapExecutorResult as w, createSupervisorSpanRecorder as x, UNPROVEN_CONTINUITY as y };
4524
4544
 
4525
- //# sourceMappingURL=supervise-CClk-m6Y.js.map
4545
+ //# sourceMappingURL=supervise-dYioyGT-.js.map