@tangle-network/agent-runtime 10.0.0 → 10.0.2

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 (76) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/{activation-CEGkyzEG.js → activation-B0DHGRtB.js} +2 -2
  3. package/dist/{activation-CEGkyzEG.js.map → activation-B0DHGRtB.js.map} +1 -1
  4. package/dist/{activation-CDlOqX5a.d.ts → activation-D0Sp7wMc.d.ts} +2 -2
  5. package/dist/agent.d.ts +1 -1
  6. package/dist/agent.js +3 -3
  7. package/dist/{delegate-V2Nz8GgO.js → delegate-Co5iUyS0.js} +2 -2
  8. package/dist/{delegate-V2Nz8GgO.js.map → delegate-Co5iUyS0.js.map} +1 -1
  9. package/dist/{driver-control-acknowledgers-CJDYLJmW.js → driver-control-acknowledgers-B1Qx2JUz.js} +68 -12
  10. package/dist/driver-control-acknowledgers-B1Qx2JUz.js.map +1 -0
  11. package/dist/durable.d.ts +1 -1
  12. package/dist/durable.js +9 -9
  13. package/dist/{failure-cause-BI7cfDWx.js → failure-cause-DoCCGLDH.js} +30 -18
  14. package/dist/{failure-cause-BI7cfDWx.js.map → failure-cause-DoCCGLDH.js.map} +1 -1
  15. package/dist/{graph-wJOMQ1kC.js → graph-uc4eT1wR.js} +7 -7
  16. package/dist/{graph-wJOMQ1kC.js.map → graph-uc4eT1wR.js.map} +1 -1
  17. package/dist/{improve-DOjywiPq.js → improve-BM0HlzMi.js} +6 -6
  18. package/dist/{improve-DOjywiPq.js.map → improve-BM0HlzMi.js.map} +1 -1
  19. package/dist/index.d.ts +3 -3
  20. package/dist/index.js +11 -11
  21. package/dist/intelligence.d.ts +2 -2
  22. package/dist/intelligence.js +4 -4
  23. package/dist/kernel.d.ts +2 -2
  24. package/dist/kernel.js +15 -15
  25. package/dist/{loop-runner-CPTOzSol.js → loop-runner-CRC-RE4D.js} +2 -2
  26. package/dist/{loop-runner-CPTOzSol.js.map → loop-runner-CRC-RE4D.js.map} +1 -1
  27. package/dist/loop-runner-bin.d.ts +1 -1
  28. package/dist/loop-runner-bin.js +1 -1
  29. package/dist/{loop-runner-DwxZbYW5.d.ts → loop-runner-npLkvCU5.d.ts} +2 -2
  30. package/dist/mcp/bin.js +3 -3
  31. package/dist/mcp/index.d.ts +1 -1
  32. package/dist/mcp/index.js +7 -7
  33. package/dist/mcp/memory-bin.js +1 -1
  34. package/dist/{model-policy-CqDuBTq-.js → model-policy-DZnL8Yj9.js} +13 -2
  35. package/dist/{model-policy-CqDuBTq-.js.map → model-policy-DZnL8Yj9.js.map} +1 -1
  36. package/dist/profiles.d.ts +1 -1
  37. package/dist/profiles.js +1 -1
  38. package/dist/{provision-supervisor-B1_Kow9m.js → provision-supervisor-CJrMGyZW.js} +6 -6
  39. package/dist/{provision-supervisor-B1_Kow9m.js.map → provision-supervisor-CJrMGyZW.js.map} +1 -1
  40. package/dist/{run-cancellation-D5m6JHPH.js → run-cancellation-CBP3Bmad.js} +2 -2
  41. package/dist/{run-cancellation-D5m6JHPH.js.map → run-cancellation-CBP3Bmad.js.map} +1 -1
  42. package/dist/{run-state-DKOXe08H.js → run-state-BnhCVbTY.js} +5 -5
  43. package/dist/{run-state-DKOXe08H.js.map → run-state-BnhCVbTY.js.map} +1 -1
  44. package/dist/{runtime-C5cWSMqU.js → runtime-BqSaWTEY.js} +14 -14
  45. package/dist/{runtime-C5cWSMqU.js.map → runtime-BqSaWTEY.js.map} +1 -1
  46. package/dist/{search-executor-CA6fTYWz.js → search-executor-C9TN-KgI.js} +5 -5
  47. package/dist/{search-executor-CA6fTYWz.js.map → search-executor-C9TN-KgI.js.map} +1 -1
  48. package/dist/{server-C8Z3vYdI.js → server-CcMa8Lt9.js} +4 -4
  49. package/dist/{server-C8Z3vYdI.js.map → server-CcMa8Lt9.js.map} +1 -1
  50. package/dist/{settle-record-BDxPAO4m.js → settle-record-BtjYZabI.js} +2 -2
  51. package/dist/{settle-record-BDxPAO4m.js.map → settle-record-BtjYZabI.js.map} +1 -1
  52. package/dist/{structural-rollout-B0HPcP9G.js → structural-rollout-2oRJjwyM.js} +5 -5
  53. package/dist/{structural-rollout-B0HPcP9G.js.map → structural-rollout-2oRJjwyM.js.map} +1 -1
  54. package/dist/{supervise-Dvj-8S6D.js → supervise-BrgtzJf3.js} +47 -15
  55. package/dist/supervise-BrgtzJf3.js.map +1 -0
  56. package/dist/{supervision-discovery-CbrwcgJy.js → supervision-discovery-DLMm3UOr.js} +3 -3
  57. package/dist/{supervision-discovery-CbrwcgJy.js.map → supervision-discovery-DLMm3UOr.js.map} +1 -1
  58. package/dist/{supervisor-DwdeUC2l.js → supervisor-ACffs_W4.js} +248 -49
  59. package/dist/supervisor-ACffs_W4.js.map +1 -0
  60. package/dist/{supervisor-accounting-C48Yo9QC.js → supervisor-accounting-BlJqoP3k.js} +43 -12
  61. package/dist/supervisor-accounting-BlJqoP3k.js.map +1 -0
  62. package/dist/testing.d.ts +1 -1
  63. package/dist/testing.js +11 -11
  64. package/dist/{tool-server-DsCeBr-C.js → tool-server-DQCdu3am.js} +2 -2
  65. package/dist/{tool-server-DsCeBr-C.js.map → tool-server-DQCdu3am.js.map} +1 -1
  66. package/dist/{top-web-CTOq4psb.js → top-web-PYyzBMsK.js} +6 -6
  67. package/dist/{top-web-CTOq4psb.js.map → top-web-PYyzBMsK.js.map} +1 -1
  68. package/dist/tui/bin.js +3 -3
  69. package/dist/tui/index.d.ts +1 -1
  70. package/dist/tui/index.js +2 -2
  71. package/dist/{types-lnF0wIJW.d.ts → types-DX1OGeHE.d.ts} +5736 -5692
  72. package/package.json +5 -5
  73. package/dist/driver-control-acknowledgers-CJDYLJmW.js.map +0 -1
  74. package/dist/supervise-Dvj-8S6D.js.map +0 -1
  75. package/dist/supervisor-DwdeUC2l.js.map +0 -1
  76. package/dist/supervisor-accounting-C48Yo9QC.js.map +0 -1
@@ -1,18 +1,18 @@
1
1
  import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError } from "./errors-DG8yufqX.js";
2
- import { c as budgetOverspendText, f as createFileRunContext, i as createCoordinationToolsForManager, l as coordinationVerbNames, m as withRunContext, n as createSteerAcknowledger, p as createInMemoryRunContext, r as createCoordinationTools, t as createCancelAcknowledger, u as normalizeAnalyzeOnSettle } from "./driver-control-acknowledgers-CJDYLJmW.js";
3
- import { B as toolResultText, Bt as assertProfileMaterialization, C as captureReusableExecutorConfig, Ct as bridgeModelRouteRefusal, Gt as profileMaterializationAxes$1, H as routerBrain, Ht as controlProfileMaterialization, I as codeModeArguments, Jt as renderUnsupported, Kt as promptControlProfileMaterialization, L as codeModeModelOutput, Mt as bridgeRuntimeEnvKey, Nt as bridgeStopSignalKey, Qt as worktreeCliProfileMaterialization, R as createCodeModeTools, S as bindReusableExecutorExecutionId, St as bridgeAdmissionRefusal, T as snapshotExecutorConfig, Ut as defineProfileMaterializationContract, V as createRouterTranscript, W as resolveAgentEnvironmentProvider, Wt as fullProfileMaterialization, X as INBOX_RECEIPT_KEY, Xt as sandboxProfileMaterialization, Z as createInbox, Zt as unsupportedProfileDimensions, _ as isDriverSpec, _t as CheckUnavailableError, a as assertRunParking, ct as DriverAttemptsExhaustedError, d as bestDelivered, dt as classifyDriverFailure, f as runFinalizer, ft as summarizeDriverAttempts, g as driverExecutorFactory, gt as preflightPublicCoordination, h as driverChild, ht as upstreamUnavailableSignal, i as RunParkedError, it as isPeerMailEnvelope, jt as bridgeRuntimeAttachmentsKey, l as sleepScopeWait, lt as HarnessTurnFailedError, m as createRootHandle, mt as undispatchedCredentialExit, n as createSupervisor, o as bindScopeParkingDrain, p as runTree, pt as transientFailureKind, qt as promptModelProfileMaterialization, s as isRunParked, tt as PEER_MAIL_WIRE_KEY, u as withRunParking, ut as abandonablePending, vt as gateFactoryOnDeliverable, w as createExecutor } from "./supervisor-DwdeUC2l.js";
4
- import { _ as workerAssignmentNamespace, c as writeRunCancellation, d as coordinationEventId, f as externalExecutionId, g as supervisionRunNamespace, h as rootCoordinationOwner, i as readRunCancellation, l as canonicalExecution, m as freezeDetachedProfile, p as freezeDetached, r as readRunCancelRequest, s as watchRunCancellation, t as applyRunCancellation, u as childCoordinationOwner } from "./run-cancellation-D5m6JHPH.js";
2
+ import { c as budgetOverspendText, f as createFileRunContext, i as createCoordinationToolsForManager, l as coordinationVerbNames, m as withRunContext, n as createSteerAcknowledger, p as createInMemoryRunContext, r as createCoordinationTools, t as createCancelAcknowledger, u as normalizeAnalyzeOnSettle } from "./driver-control-acknowledgers-B1Qx2JUz.js";
3
+ import { $t as worktreeCliProfileMaterialization, B as toolResultText, C as captureReusableExecutorConfig, Ct as bridgeAdmissionRefusal, Gt as fullProfileMaterialization, H as routerBrain, I as codeModeArguments, Jt as promptModelProfileMaterialization, K as providerOutputOptions, Kt as profileMaterializationAxes$1, L as codeModeModelOutput, Mt as bridgeRuntimeAttachmentsKey, Nt as bridgeRuntimeEnvKey, Pt as bridgeStopSignalKey, Q as createInbox, Qt as unsupportedProfileDimensions, R as createCodeModeTools, S as bindReusableExecutorExecutionId, T as snapshotExecutorConfig, Ut as controlProfileMaterialization, V as createRouterTranscript, Vt as assertProfileMaterialization, W as resolveAgentEnvironmentProvider, Wt as defineProfileMaterializationContract, Yt as renderUnsupported, Z as INBOX_RECEIPT_KEY, Zt as sandboxProfileMaterialization, _ as isDriverSpec, _t as preflightPublicCoordination, a as assertRunParking, at as isPeerMailEnvelope, d as bestDelivered, dt as abandonablePending, f as runFinalizer, ft as classifyDriverFailure, g as driverExecutorFactory, gt as upstreamUnavailableSignal, h as driverChild, ht as undispatchedCredentialExit, i as RunParkedError, l as sleepScopeWait, lt as DriverAttemptsExhaustedError, m as createRootHandle, mt as transientFailureKind, n as createSupervisor, nt as PEER_MAIL_WIRE_KEY, o as bindScopeParkingDrain, p as runTree, pt as summarizeDriverAttempts, qt as promptControlProfileMaterialization, s as isRunParked, u as withRunParking, ut as HarnessTurnFailedError, vt as CheckUnavailableError, w as createExecutor, wt as bridgeModelRouteRefusal, yt as gateFactoryOnDeliverable } from "./supervisor-ACffs_W4.js";
4
+ import { _ as workerAssignmentNamespace, c as writeRunCancellation, d as coordinationEventId, f as externalExecutionId, g as supervisionRunNamespace, h as rootCoordinationOwner, i as readRunCancellation, l as canonicalExecution, m as freezeDetachedProfile, p as freezeDetached, r as readRunCancelRequest, s as watchRunCancellation, t as applyRunCancellation, u as childCoordinationOwner } from "./run-cancellation-CBP3Bmad.js";
5
5
  import { a as errMessage, c as errorStack, i as causeChain, l as errorText, n as detachedSnapshot, o as errorHttpStatus, u as defaultRedactor } from "./snapshot-BKI_w3JD.js";
6
6
  import { t as composeRuntimeHooks } from "./runtime-hooks-CsW2pfFk.js";
7
- import { $t as owners, Ar as authoredAgentIdentity, At as beginScopeOwnerAttempt, Bt as coordinationProfileToolPrefix, Cr as authoredSeatStages, Dt as prepareScopeRetainedOwnerTask, Et as consumeScopeRetainedOwnerResult, F as parseWorkerToolTraceArtifact, Ft as recordScopeOwnerMaterialization, Gr as runtimeOwnedExecutorMaterialization, Gt as scopeRetainedOwnerTurnEnded, Ht as runtimeGraphMetadataKey, It as restoreScopeOwnerAcceptedExecution, Jt as scopeRetainedOwnerRestorePoint, Kr as runtimeOwnedExecutorProviderEvidence, Kt as assertRetainedOwnerCoordinationRekey, Ln as WORKER_TRACE_PROPAGATION, Lr as providerAttemptEvidence, Lt as scopeOwnerExecutionObservation, Mt as holdScopeOwnerTranscript, Nt as noteScopeOwnerPlannedExecution, Ot as scopeRetainedOwnerPriorSpend, Pt as recordScopeOwnerHarnessTranscript, Qt as bindScopeRetainedOwnerProvider, Rr as recordRuntimeOwnedDriveHarnessProviderEvidence, Rt as scopeOwnerExecutorNodeContext, Sr as SeatPauseError, Tt as abandonScopeRetainedOwnerInvocation, Ur as runtimeOwnedDriveHarnessProviderEvidence, Ut as beginScopeRetainedOwnerDrive, Vt as providerVisibleProfile, Wr as runtimeOwnedExecutorExecutionBinding, X as assertRecursiveReservationPolicy, Yn as generateSpanId, Yr as runtimeOwnedScopeOwnerRuntime, Yt as noteScopeRetainedOwnerCoordination, Zt as bindScopeRetainedOwnerEnvironmentId, a as createRootStreamSink, at as meterRuntimeOwnedAccounting, br as SEAT_RECHECK_MS, bt as releaseScopeRetainedOwnerForSeatPause, cr as readHarnessTranscript, ct as recordScopeOwnerBarrenPause, ei as isRuntimeFlowBrain, hr as createActivityLog, i as ROOT_STREAM_FILE, kr as attestRuntimeOwnedScopeOwner, kt as scopeRetainedOwnerResult, lr as settleHarnessTranscript, lt as recordScopeOwnerDriverAttempt, mn as executorObservationSeamKey, ni as runtimeFlowAgent, nn as scopeRetainedOwnerJournalRoot, ot as meterRuntimeOwnedProviderAttempt, qn as createOtelExporter, qr as runtimeOwnedPendingExecutorMaterialization, qt as reconcileScopeRetainedOwnerEnvironment, ri as runtimeFlowBrain, s as readRootStream, sr as persistHarnessTranscript, st as pauseScopeSeatAdmission, tn as scopeRetainedOwnerContext, ut as recordScopeOwnerPause, vr as isLiveNodeStatus, wr as seatExecutionProfile, xr as SeatChain, xt as scopeRetainedOwnerResourceReader, yr as isTerminalNodeStatus, yt as prepareScopeRetainedOwnerSeatSwitch, zt as coordinationMcpAlias } from "./supervisor-accounting-C48Yo9QC.js";
7
+ import { $t as owners, Ar as authoredAgentIdentity, At as beginScopeOwnerAttempt, Bt as coordinationProfileToolPrefix, Cr as authoredSeatStages, Dt as prepareScopeRetainedOwnerTask, Et as consumeScopeRetainedOwnerResult, F as parseWorkerToolTraceArtifact, Ft as recordScopeOwnerMaterialization, Gr as runtimeOwnedExecutorMaterialization, Gt as scopeRetainedOwnerTurnEnded, Ht as runtimeGraphMetadataKey, It as restoreScopeOwnerAcceptedExecution, Jt as scopeRetainedOwnerRestorePoint, Kr as runtimeOwnedExecutorProviderEvidence, Kt as assertRetainedOwnerCoordinationRekey, Ln as WORKER_TRACE_PROPAGATION, Lr as providerAttemptEvidence, Lt as scopeOwnerExecutionObservation, Mt as holdScopeOwnerTranscript, Nt as noteScopeOwnerPlannedExecution, Ot as scopeRetainedOwnerPriorSpend, Pt as recordScopeOwnerHarnessTranscript, Qt as bindScopeRetainedOwnerProvider, Rr as recordRuntimeOwnedDriveHarnessProviderEvidence, Rt as scopeOwnerExecutorNodeContext, Sr as SeatPauseError, Tt as abandonScopeRetainedOwnerInvocation, Ur as runtimeOwnedDriveHarnessProviderEvidence, Ut as beginScopeRetainedOwnerDrive, Vt as providerVisibleProfile, Wr as runtimeOwnedExecutorExecutionBinding, X as assertRecursiveReservationPolicy, Yn as generateSpanId, Yr as runtimeOwnedScopeOwnerRuntime, Yt as noteScopeRetainedOwnerCoordination, Zt as bindScopeRetainedOwnerEnvironmentId, a as createRootStreamSink, at as meterRuntimeOwnedAccounting, br as SEAT_RECHECK_MS, bt as releaseScopeRetainedOwnerForSeatPause, cr as readHarnessTranscript, ct as recordScopeOwnerBarrenPause, ei as isRuntimeFlowBrain, hr as createActivityLog, i as ROOT_STREAM_FILE, kr as attestRuntimeOwnedScopeOwner, kt as scopeRetainedOwnerResult, lr as settleHarnessTranscript, lt as recordScopeOwnerDriverAttempt, mn as executorObservationSeamKey, ni as runtimeFlowAgent, nn as scopeRetainedOwnerJournalRoot, ot as meterRuntimeOwnedProviderAttempt, qn as createOtelExporter, qr as runtimeOwnedPendingExecutorMaterialization, qt as reconcileScopeRetainedOwnerEnvironment, ri as runtimeFlowBrain, s as readRootStream, sr as persistHarnessTranscript, st as pauseScopeSeatAdmission, tn as scopeRetainedOwnerContext, ut as recordScopeOwnerPause, vr as isLiveNodeStatus, wr as seatExecutionProfile, xr as SeatChain, xt as scopeRetainedOwnerResourceReader, yr as isTerminalNodeStatus, yt as prepareScopeRetainedOwnerSeatSwitch, zt as coordinationMcpAlias } from "./supervisor-accounting-BlJqoP3k.js";
8
8
  import { m as runAbortable, p as linkAbort, u as RunCancellationReason } from "./jsonl-file-BhuxeejY.js";
9
9
  import { a as createContinuationKeeper, i as checkVerdictOf, n as admitContinuationPolicy, r as bestComposite, t as CONTINUATIONS_DIR } from "./continuation-CZaeHEzQ.js";
10
- import { B as turnFailurePolicy, C as cappedDoublingMs, D as unavailablePauseMs, Dt as recordValue, E as reportedResetAt, F as executorFailure, N as contentAddress, O as unavailableResumeAt, Q as newUsageTotals, R as harnessProcessDied, Z as meterUsageEvent, _ as registerRetainedExecutorPreparation, b as RATE_LIMIT_SIGNALS, et as spendFromUsageTotals, tt as assertValidBudget, u as RetainedExecutionPendingError, w as jitteredMs, y as retainedExecutorSeamKey, z as turnFailureOf } from "./failure-cause-BI7cfDWx.js";
10
+ import { $ as newUsageTotals, B as turnFailurePolicy, C as jitteredMs, D as unavailableResumeAt, E as unavailablePauseMs, L as harnessProcessDied, M as contentAddress, Ot as recordValue, P as executorFailure, Q as meterUsageEvent, S as cappedDoublingMs, T as reportedResetAt, g as registerRetainedExecutorPreparation, l as RetainedExecutionPendingError, nt as assertValidBudget, tt as spendFromUsageTotals, v as retainedExecutorSeamKey, y as RATE_LIMIT_SIGNALS, z as turnFailureOf } from "./failure-cause-DoCCGLDH.js";
11
11
  import { o as safeJsonText } from "./coordination-map-routing-XZXTlCmn.js";
12
- import { n as createStdioToolServer } from "./tool-server-DsCeBr-C.js";
12
+ import { n as createStdioToolServer } from "./tool-server-DQCdu3am.js";
13
13
  import { A as withBudgetResources, D as addResourceSpend, S as unmeteredSpend, T as zeroSpend, c as errorMessage, f as isAsyncIterable, i as chargedTokens, k as resourceTelemetry, m as promptCacheTokenClasses, n as addSpend, v as sleep, w as withTimeout } from "./util-qsH5cC9S.js";
14
14
  import { d as teardownExecutor, i as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, l as isDeadlineAbortReason, o as armDeadlineTimer } from "./deadline-CySmJ_0S.js";
15
- import { a as concreteProfileModel, c as profileModelExecutionSettings, l as profileProviderModel, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile, v as agentHarness, y as harnessRunsAgent } from "./model-policy-CqDuBTq-.js";
15
+ import { a as concreteProfileModel, c as profileModelExecutionSettings, l as profileProviderModel, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile, v as agentHarness, y as harnessRunsAgent } from "./model-policy-DZnL8Yj9.js";
16
16
  import { a as graphRegistry, c as loadGraph } from "./graph-registry-j9t9J0KT.js";
17
17
  import { ATTR, LINK_KIND_ATTR, agentIdentityAttributes } from "@tangle-network/agent-trace-contract";
18
18
  import { ProxySecretScopeSchema, ProxySecretsSchema, agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalCandidateJson, mergeProxySecretBindings, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
@@ -2245,12 +2245,14 @@ function createCoordinationCredentials(input) {
2245
2245
  staged = void 0;
2246
2246
  };
2247
2247
  let installing = false;
2248
- const rotate = () => {
2248
+ const rotate = (managerOnly = false) => {
2249
2249
  if (installing) throw new ConfigError("coordination credential replacement is pending");
2250
2250
  if (staged) revoked.set(staged.token.toString(), staged.expiresAt);
2251
2251
  commit(issue());
2252
- readerToken = randomToken();
2253
- controllerToken = randomToken();
2252
+ if (!managerOnly) {
2253
+ readerToken = randomToken();
2254
+ controllerToken = randomToken();
2255
+ }
2254
2256
  };
2255
2257
  const replace = async (install) => {
2256
2258
  if (installing) throw new ConfigError("coordination credential replacement is pending");
@@ -3061,6 +3063,9 @@ async function serveCoordinationMcpForManager(opts, lifetime) {
3061
3063
  };
3062
3064
  let stopCredentialBinding;
3063
3065
  let refreshBoundCredential;
3066
+ let rotateManagerCredential = async () => {
3067
+ credentials.rotate(true);
3068
+ };
3064
3069
  const bindCredential = async (install) => {
3065
3070
  if (stopCredentialBinding) throw new ConfigError("coordination already has a credential holder");
3066
3071
  let active = true, cancelTimer;
@@ -3095,6 +3100,16 @@ async function serveCoordinationMcpForManager(opts, lifetime) {
3095
3100
  cancelTimer?.();
3096
3101
  renew();
3097
3102
  };
3103
+ rotateManagerCredential = async () => {
3104
+ cancelTimer?.();
3105
+ await pending;
3106
+ cancelTimer?.();
3107
+ if (stopped()) throw new ConfigError("coordination credential holder stopped");
3108
+ credentials.rotate(true);
3109
+ pending = credentials.replace(install);
3110
+ await pending;
3111
+ schedule();
3112
+ };
3098
3113
  try {
3099
3114
  pending = credentials.replace(install);
3100
3115
  await pending;
@@ -3139,6 +3154,7 @@ async function serveCoordinationMcpForManager(opts, lifetime) {
3139
3154
  credentials.rotate();
3140
3155
  refreshBoundCredential?.();
3141
3156
  },
3157
+ rotateManagerCredential: () => rotateManagerCredential(),
3142
3158
  bindCredential,
3143
3159
  settled: () => coord.settled(),
3144
3160
  submittedResult: () => coord.submittedResult(),
@@ -4957,6 +4973,7 @@ function serveManagerCoordination(config, state, context, priorCoordination, nod
4957
4973
  actorId: context.ownerId
4958
4974
  } } : {},
4959
4975
  ...deps.deliverable ? { deliverable: deps.deliverable } : {},
4976
+ ...config.driveHarness.withFileOutput ? { withFileOutput: config.driveHarness.withFileOutput } : {},
4960
4977
  ...deps.continuation ? { readContinuation: (n) => state.keeper?.read(n) ?? {
4961
4978
  found: false,
4962
4979
  reason: "no continuation has been sent"
@@ -6264,6 +6281,10 @@ async function invokeManagerHarness(loop, attempt, carried, input) {
6264
6281
  state.harnessInvocationActive = true;
6265
6282
  let completed = false;
6266
6283
  try {
6284
+ if (driveHarness.withFileOutput) {
6285
+ if (!mcp.rotateManagerCredential) throw new Error("file output requires invocation-bound coordination credentials");
6286
+ await mcp.rotateManagerCredential();
6287
+ }
6267
6288
  await driveHarness({
6268
6289
  profile: loop.providerProfile,
6269
6290
  authoredProfile: config.profile,
@@ -8517,6 +8538,11 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
8517
8538
  });
8518
8539
  };
8519
8540
  drive.resultArtifact = () => state.managerArtifact;
8541
+ if (backend.backend === "provider" && backend.outputFile !== void 0) drive.withFileOutput = (submission, accept) => {
8542
+ const executor = state.activeExecutor;
8543
+ if (!executor?.withFileOutput) return Promise.reject(new ValidationError("file submission has no active provider invocation"));
8544
+ return executor.withFileOutput(submission, accept);
8545
+ };
8520
8546
  drive.deliver = (message) => {
8521
8547
  const deliver = state.activeExecutor?.deliver;
8522
8548
  if (!deliver) return false;
@@ -8626,9 +8652,14 @@ function managerHarnessResolver(source) {
8626
8652
  const { options, managerBackend } = source;
8627
8653
  const claimDriveHarness = driveHarnessClaims();
8628
8654
  return (context) => {
8629
- if (options.resolveDriveHarness) return claimDriveHarness(options.resolveDriveHarness(context), context.ownerId);
8630
- if (options.driveHarness) return claimDriveHarness(options.driveHarness, context.ownerId);
8631
- return managerBackend && source.automaticDriver ? driveHarnessFromBackend(managerBackend, externalExecutionId("supervised-manager", {
8655
+ if (options.resolveDriveHarness) return claimDriveHarness(options.resolveDriveHarness(context), context.ownerId, context.profile.outputFile !== void 0);
8656
+ if (options.driveHarness) return claimDriveHarness(options.driveHarness, context.ownerId, context.profile.outputFile !== void 0);
8657
+ const selectedBackend = managerBackend?.backend === "provider" ? {
8658
+ ...managerBackend,
8659
+ ...providerOutputOptions(context.profile, managerBackend)
8660
+ } : managerBackend;
8661
+ if (context.profile.outputFile !== void 0 && selectedBackend?.backend !== "provider") throw new ValidationError("profile outputFile requires a retained provider backend");
8662
+ return selectedBackend && source.automaticDriver ? driveHarnessFromBackend(selectedBackend, externalExecutionId("supervised-manager", {
8632
8663
  runNamespace: source.runNamespace,
8633
8664
  ownerId: context.ownerId
8634
8665
  }), options.now ?? Date.now, options.maxTurns, context.depth === 0 ? source.rootStreamSink : void 0, options.selectSeat === void 0 ? void 0 : {
@@ -8667,9 +8698,10 @@ function emitSeatEvent(source, nodeId, id, payload) {
8667
8698
  /** A harness claimed by one manager owner. A steerable harness binds to exactly one owner. */
8668
8699
  function driveHarnessClaims() {
8669
8700
  const harnessClaims = /* @__PURE__ */ new WeakMap();
8670
- return (rawHarness, ownerId) => {
8701
+ return (rawHarness, ownerId, fileOutput) => {
8671
8702
  if (typeof rawHarness !== "function") throw new ValidationError("supervise: resolveDriveHarness must return a DriveHarness function");
8672
8703
  const harness = rawHarness;
8704
+ if (fileOutput && typeof harness.withFileOutput !== "function") throw new ValidationError("profile outputFile requires a harness with retained file submission support");
8673
8705
  const deliver = harness.deliver;
8674
8706
  if (deliver !== void 0 && typeof deliver !== "function") throw new ValidationError("supervise: driveHarness.deliver must be a function when provided");
8675
8707
  const deliverReady = harness.deliverReady;
@@ -9460,4 +9492,4 @@ function superviseWithContext(profile, task, opts, brain) {
9460
9492
  }
9461
9493
  export { analyzesFindingsReportPrompt as A, anyOf as B, flowRootProfile as C, defaultEdgeTraversalCap as D, validateFlowGraph as E, formatPromptHandle as F, bestSoFar as G, plateau as H, kernelPromptRegistry as I, createSupervisorSpanRecorder as J, plateauLength as K, naiveContinuationPrompt as L, delegatesWorkerBriefPrompt as M, dumbContinuationFailPrompt as N, graphRootProfile as O, dumbContinuationPassPrompt as P, promptHandle as R, createFlowRun as S, routeFlowOf as T, anytimeReport as U, noProgressFor as V, areaUnderCurve as W, profileGuidanceComposer as _, supervisorAgent as a, coordinationControlToolNames as b, ASSISTANT_TEXT_SPAN as c, UNPROVEN_CONTINUITY as d, composeReentryTask as f, graphFlowSpawnProfile as g, createGraphOverlay as h, workerFromBackend as i, createPromptRegistry as j, validateGraphTopology as k, rootStreamToolSpans as l, runBrainLoop as m, superviseFleetCapabilities as n, supervisorAgentWithTestBrain as o, driverAgent as p, renderAnytimeTable as q, superviseWithTestBrain as r, ASSISTANT_REASONING_SPAN as s, supervise as t, runToolSpans as u, superviseRootProfile as v, journaledGateDecider as w, GraphRouteError as x, serveCoordinationMcp as y, allWorkersStalled as z };
9462
9494
 
9463
- //# sourceMappingURL=supervise-Dvj-8S6D.js.map
9495
+ //# sourceMappingURL=supervise-BrgtzJf3.js.map