@tangle-network/agent-runtime 0.309.0 → 0.312.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 (69) hide show
  1. package/dist/{activation-BNGcdwKv.js → activation-CE5vCzYS.js} +3 -3
  2. package/dist/{activation-BNGcdwKv.js.map → activation-CE5vCzYS.js.map} +1 -1
  3. package/dist/{activation-CPlj7oAq.d.ts → activation-K-k4BRp9.d.ts} +2 -3
  4. package/dist/agent.d.ts +1 -2
  5. package/dist/agent.js +2 -2
  6. package/dist/{bundle-E6mbRX2P.js → bundle-BK3XBY6q.js} +2 -2
  7. package/dist/{bundle-E6mbRX2P.js.map → bundle-BK3XBY6q.js.map} +1 -1
  8. package/dist/candidate-execution/index.js +5 -5
  9. package/dist/{coordination-driver-nxGtWmJm.js → coordination-driver-Cp2z1zz6.js} +15 -15
  10. package/dist/coordination-driver-Cp2z1zz6.js.map +1 -0
  11. package/dist/{delegate-BH1mMsM-.js → delegate-DPkyIx3C.js} +2 -2
  12. package/dist/{delegate-BH1mMsM-.js.map → delegate-DPkyIx3C.js.map} +1 -1
  13. package/dist/durable.d.ts +1 -2
  14. package/dist/durable.js +4 -4
  15. package/dist/{graph-DEbRy7GI.js → graph-DP0X2bVC.js} +6 -4
  16. package/dist/graph-DP0X2bVC.js.map +1 -0
  17. package/dist/{improvement-cycle-D-GFP8a-.js → improvement-cycle-D5r4auxT.js} +6 -6
  18. package/dist/{improvement-cycle-D-GFP8a-.js.map → improvement-cycle-D5r4auxT.js.map} +1 -1
  19. package/dist/{index-B-VvfcHa.d.ts → index-BdIi1eIV.d.ts} +11281 -2505
  20. package/dist/index.d.ts +4 -6
  21. package/dist/index.js +9 -9
  22. package/dist/intelligence.d.ts +2 -3
  23. package/dist/intelligence.js +7 -7
  24. package/dist/kernel.d.ts +2 -4
  25. package/dist/kernel.js +10 -9
  26. package/dist/{loop-runner-bin-DxH6LwIB.js → loop-runner-bin-Cn7244xv.js} +3 -3
  27. package/dist/{loop-runner-bin-DxH6LwIB.js.map → loop-runner-bin-Cn7244xv.js.map} +1 -1
  28. package/dist/{loop-runner-bin-Bvd0J2OR.d.ts → loop-runner-bin-CoKHGqxE.d.ts} +2 -3
  29. package/dist/loop-runner-bin.d.ts +1 -1
  30. package/dist/loop-runner-bin.js +1 -1
  31. package/dist/mcp/bin.js +3 -3
  32. package/dist/mcp/index.d.ts +2 -5
  33. package/dist/mcp/index.js +5 -5
  34. package/dist/{openai-tools-CP1hPxJd.d.ts → openai-tools-C2GoLNjj.d.ts} +2 -2
  35. package/dist/{prepare-CulUz6Wm.js → prepare-8A1CAWG8.js} +3 -3
  36. package/dist/{prepare-CulUz6Wm.js.map → prepare-8A1CAWG8.js.map} +1 -1
  37. package/dist/{profile-DY9lT3gH.js → profile-BhQShsM1.js} +2 -2
  38. package/dist/{profile-DY9lT3gH.js.map → profile-BhQShsM1.js.map} +1 -1
  39. package/dist/profiles.d.ts +1 -1
  40. package/dist/{protected-model-port-BT2iYAsU.js → protected-model-port-ug52OmvB.js} +4 -4
  41. package/dist/{protected-model-port-BT2iYAsU.js.map → protected-model-port-ug52OmvB.js.map} +1 -1
  42. package/dist/{provision-supervisor-CLGUAePU.js → provision-supervisor-BahNK2L0.js} +4 -4
  43. package/dist/{provision-supervisor-CLGUAePU.js.map → provision-supervisor-BahNK2L0.js.map} +1 -1
  44. package/dist/{runtime-B0td3fc3.js → runtime-DRrpUP7n.js} +9 -9
  45. package/dist/{runtime-B0td3fc3.js.map → runtime-DRrpUP7n.js.map} +1 -1
  46. package/dist/{search-executor-DV-AfHq0.js → search-executor-BuwMU5TF.js} +3 -3
  47. package/dist/{search-executor-DV-AfHq0.js.map → search-executor-BuwMU5TF.js.map} +1 -1
  48. package/dist/{server-B5JWg4Oq.js → server-DMqPF86Y.js} +4 -4
  49. package/dist/{server-B5JWg4Oq.js.map → server-DMqPF86Y.js.map} +1 -1
  50. package/dist/{supervise-B5iHXeuw.js → supervise-CGMzXi_j.js} +64 -8
  51. package/dist/supervise-CGMzXi_j.js.map +1 -0
  52. package/dist/{supervisor-Cd39ZN4b.js → supervisor-DgcmBicU.js} +82 -5
  53. package/dist/supervisor-DgcmBicU.js.map +1 -0
  54. package/dist/testing.d.ts +1 -2
  55. package/dist/testing.js +14 -14
  56. package/dist/tui/index.d.ts +1 -1
  57. package/dist/tui/index.js +1 -1
  58. package/dist/{workspace-streams-DaQceg2p.js → workspace-streams-BEvSX97P.js} +13 -2
  59. package/dist/workspace-streams-BEvSX97P.js.map +1 -0
  60. package/package.json +2 -2
  61. package/skills/profile-authoring/SKILL.md +9 -13
  62. package/dist/coordination-driver-nxGtWmJm.js.map +0 -1
  63. package/dist/graph-DEbRy7GI.js.map +0 -1
  64. package/dist/stream-agent-turn-D-zmKgU2.d.ts +0 -2252
  65. package/dist/substrate-DQnwvsFT.d.ts +0 -284
  66. package/dist/supervise-B5iHXeuw.js.map +0 -1
  67. package/dist/supervisor-Cd39ZN4b.js.map +0 -1
  68. package/dist/types-CFGESVFO.d.ts +0 -6156
  69. package/dist/workspace-streams-DaQceg2p.js.map +0 -1
@@ -1,10 +1,10 @@
1
- import { $n as parseWorkerToolTraceArtifact, A as scopeOwnerExecutorNodeContext, Ai as worktreeCliProfileMaterialization, An as resolveAgentEnvironmentProvider, At as captureReusableExecutorConfig, B as consumeScopeRetainedOwnerResult, Bi as recordRuntimeOwnedDriveHarnessProviderEvidence, C as deriveNodeExecutionIdentity, Ct as createContinuationKeeper, D as recordScopeOwnerMaterialization, E as recordScopeOwnerDriverAttempt, Ei as renderUnsupported, F as seatExecutionProfile, Fi as inheritRuntimeOwnedExecutorAttestation, Fn as retainedExecutorSeamKey, Ft as snapshotExecutorConfig, G as scopeRetainedOwnerContext, Gi as runtimeOwnedPendingExecutorMaterialization, H as prepareScopeRetainedOwnerSeatSwitch, Hi as runtimeOwnedExecutorExecutionBinding, I as abandonScopeRetainedOwnerInvocation, J as scopeRetainedOwnerResourceReader, Jn as readCommittedJsonLines, Jt as createActivityLog, K as scopeRetainedOwnerJournalRoot, Ki as runtimeOwnedScopeOwnerRuntime, Kn as isNoEntError, Kr as generateSpanId, L as beginScopeRetainedOwnerDrive, M as SeatChain, Mi as attestRuntimeOwnedScopeOwner, Mr as contentAddress, N as SeatChainExhaustedError, Nt as createExecutor, O as recordScopeOwnerPause, Oi as unsupportedProfileDimensions, Or as persistHarnessTranscript, P as authoredSeatStages, Pn as registerRetainedExecutorPreparation, Qi as detachedSnapshot, R as bindScopeRetainedOwnerEnvironmentId, Si as promptModelProfileMaterialization, Sr as RunCancellationReason, St as checkVerdictOf, T as meterRuntimeOwnedProviderAttempt, Tr as runAbortable, U as prepareScopeRetainedOwnerTask, Ui as runtimeOwnedExecutorMaterialization, V as noteScopeRetainedOwnerCoordination, Vi as runtimeOwnedDriveHarnessProviderEvidence, Vt as WORKER_TRACE_PROPAGATION, W as reconcileScopeRetainedOwnerEnvironment, Wi as runtimeOwnedExecutorProviderEvidence, Wr as createOtelExporter, X as scopeRetainedOwnerResult, Xr as toOtelAttributes, Xt as createInbox, Y as scopeRetainedOwnerRestorePoint, Z as scopeRetainedOwnerTurnEnded, _ as isDriverSpec, _i as controlProfileMaterialization, an as isLiveNodeStatus, b as assertRecursiveReservationPolicy, bi as profileMaterializationAxes$1, c as runTree, cn as bridgeModelRouteRefusal, dr as bridgeStopSignalKey, f as runDriverWithRetry, fr as errMessage, g as driverExecutorFactory, gi as assertProfileMaterialization, gt as CONTINUATIONS_DIR, h as driverChild, i as bestDelivered, ir as assertValidBudget, it as providerVisibleProfile, k as restoreScopeOwnerAcceptedExecution, kr as readHarnessTranscript, kt as bindReusableExecutorExecutionId, lr as spendFromUsageTotals, mt as gateOnDeliverable, n as createRootHandle, nt as coordinationMcpAlias, or as meterUsageEvent, p as summarizeDriverAttempts, q as scopeRetainedOwnerPriorSpend, qn as prepareJsonlAppend, r as createSupervisor, rt as coordinationProfileToolPrefix, s as runFinalizer, sn as bridgeAdmissionRefusal, sr as newUsageTotals, tr as executorFailure, u as HarnessTurnFailedError, ur as bridgeRuntimeAttachmentsKey, vi as defineProfileMaterializationContract, vt as CheckUnavailableError, w as meterRuntimeOwnedAccounting, wn as routerBrain, wr as linkAbort, x as beginScopeOwnerAttempt, xi as promptControlProfileMaterialization, xt as bestComposite, yi as fullProfileMaterialization, yt as admitContinuationPolicy, z as bindScopeRetainedOwnerProvider, zi as providerAttemptEvidence, zt as createRouterTranscript } from "./supervisor-Cd39ZN4b.js";
1
+ import { $n as parseWorkerToolTraceArtifact, A as scopeOwnerExecutorNodeContext, Ai as worktreeCliProfileMaterialization, An as resolveAgentEnvironmentProvider, At as captureReusableExecutorConfig, B as consumeScopeRetainedOwnerResult, Bi as recordRuntimeOwnedDriveHarnessProviderEvidence, C as deriveNodeExecutionIdentity, Ct as createContinuationKeeper, D as recordScopeOwnerMaterialization, E as recordScopeOwnerDriverAttempt, Ei as renderUnsupported, F as seatExecutionProfile, Fi as inheritRuntimeOwnedExecutorAttestation, Fn as retainedExecutorSeamKey, Ft as snapshotExecutorConfig, G as scopeRetainedOwnerContext, Gi as runtimeOwnedPendingExecutorMaterialization, H as prepareScopeRetainedOwnerSeatSwitch, Hi as runtimeOwnedExecutorExecutionBinding, I as abandonScopeRetainedOwnerInvocation, J as scopeRetainedOwnerResourceReader, Jn as readCommittedJsonLines, Jt as createActivityLog, K as scopeRetainedOwnerJournalRoot, Ki as runtimeOwnedScopeOwnerRuntime, Kn as isNoEntError, Kr as generateSpanId, L as beginScopeRetainedOwnerDrive, M as SeatChain, Mi as attestRuntimeOwnedScopeOwner, Mr as contentAddress, N as SeatChainExhaustedError, Nt as createExecutor, O as recordScopeOwnerPause, Oi as unsupportedProfileDimensions, Or as persistHarnessTranscript, P as authoredSeatStages, Pn as registerRetainedExecutorPreparation, Qi as detachedSnapshot, R as bindScopeRetainedOwnerEnvironmentId, Si as promptModelProfileMaterialization, Sr as RunCancellationReason, St as checkVerdictOf, T as meterRuntimeOwnedProviderAttempt, Tr as runAbortable, U as prepareScopeRetainedOwnerTask, Ui as runtimeOwnedExecutorMaterialization, V as noteScopeRetainedOwnerCoordination, Vi as runtimeOwnedDriveHarnessProviderEvidence, Vt as WORKER_TRACE_PROPAGATION, W as reconcileScopeRetainedOwnerEnvironment, Wi as runtimeOwnedExecutorProviderEvidence, Wr as createOtelExporter, X as scopeRetainedOwnerResult, Xr as toOtelAttributes, Xt as createInbox, Y as scopeRetainedOwnerRestorePoint, Z as scopeRetainedOwnerTurnEnded, _ as isDriverSpec, _i as controlProfileMaterialization, an as isLiveNodeStatus, b as assertRecursiveReservationPolicy, bi as profileMaterializationAxes$1, c as runTree, cn as bridgeModelRouteRefusal, dr as bridgeStopSignalKey, f as runDriverWithRetry, fr as errMessage, g as driverExecutorFactory, gi as assertProfileMaterialization, gt as CONTINUATIONS_DIR, h as driverChild, i as bestDelivered, ir as assertValidBudget, it as providerVisibleProfile, k as restoreScopeOwnerAcceptedExecution, kr as readHarnessTranscript, kt as bindReusableExecutorExecutionId, lr as spendFromUsageTotals, mt as gateOnDeliverable, n as createRootHandle, nt as coordinationMcpAlias, or as meterUsageEvent, p as summarizeDriverAttempts, q as scopeRetainedOwnerPriorSpend, qn as prepareJsonlAppend, r as createSupervisor, rt as coordinationProfileToolPrefix, s as runFinalizer, sn as bridgeAdmissionRefusal, sr as newUsageTotals, tr as executorFailure, u as HarnessTurnFailedError, ur as bridgeRuntimeAttachmentsKey, vi as defineProfileMaterializationContract, vt as CheckUnavailableError, w as meterRuntimeOwnedAccounting, wn as routerBrain, wr as linkAbort, x as beginScopeOwnerAttempt, xi as promptControlProfileMaterialization, xt as bestComposite, yi as fullProfileMaterialization, yt as admitContinuationPolicy, z as bindScopeRetainedOwnerProvider, zi as providerAttemptEvidence, zt as createRouterTranscript } from "./supervisor-DgcmBicU.js";
2
2
  import { f as RuntimeRunStateError, i as ConfigError, m as ValidationError } from "./errors-DodWX-cb.js";
3
- import { G as errorMessage, St as teardownSurfaces, Y as isAsyncIterable$1, at as unmeteredSpend, dt as resourceTelemetry, ft as withBudgetResources, ht as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, lt as addResourceSpend, ot as withTimeout, st as zeroSpend, tt as sleep, xt as teardownExecutor, z as addSpend } from "./workspace-streams-DaQceg2p.js";
3
+ import { G as errorMessage, Tt as teardownSurfaces, Y as isAsyncIterable$1, _t as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, at as unmeteredSpend, dt as resourceTelemetry, ft as withBudgetResources, lt as addResourceSpend, ot as withTimeout, st as zeroSpend, tt as sleep, wt as teardownExecutor, z as addSpend } from "./workspace-streams-BEvSX97P.js";
4
4
  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";
5
5
  import { n as assertNoSymlinkDescendant } from "./durable-file-DWQA4ooo.js";
6
6
  import { t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
7
- import { C as createInMemoryRunContext, D as applyRunCancellation, M as coordinationVerbNames, O as watchRunCancellation, P as createCoordinationToolsForManager, S as createFileRunContext, c as resolveWakePolicy, f as createProgressTracker, h as progressStop, m as plateau, n as createSteerAcknowledger, o as composeWakeInput, r as driverAgent, s as deadlineWarningAt, t as createCancelAcknowledger, w as withRunContext } from "./coordination-driver-nxGtWmJm.js";
7
+ import { C as createInMemoryRunContext, D as applyRunCancellation, M as coordinationVerbNames, O as watchRunCancellation, P as createCoordinationToolsForManager, S as createFileRunContext, c as resolveWakePolicy, f as createProgressTracker, h as progressStop, m as plateau, n as createSteerAcknowledger, o as composeWakeInput, r as driverAgent, s as deadlineWarningAt, t as createCancelAcknowledger, w as withRunContext } from "./coordination-driver-Cp2z1zz6.js";
8
8
  import { r as createStdioToolServer, t as PROTOCOL_VERSION } from "./tool-server-Dqer2M4_.js";
9
9
  import { k as writeRunCancellation, o as readRunCancelRequest, s as readRunCancellation } from "./run-layout-DSCWdbX2.js";
10
10
  import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalCandidateJson, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
@@ -1808,7 +1808,7 @@ function buildSupervisorAgent(profile, deps, testBrain) {
1808
1808
  if (harness === null && deps.continuation !== void 0) throw new ValidationError("supervisorAgent: continuation applies to an EXTERNAL-harness supervisor only (profile.harness set). A router-brained supervisor runs its own turn loop in process, so the policy would be silently ignored.");
1809
1809
  if (deps.continuation !== void 0 && deps.deliverable === void 0) throw new ValidationError("supervisorAgent: continuation needs a `deliverable` completion check — with no check there is no contract that can be unmet");
1810
1810
  if (harness !== null && deps.deliverable !== void 0 && deps.continuation === void 0) throw new ValidationError("supervisorAgent: a manager with a completion check needs a continuation policy (deadline, maxBarren, the note profile and switches). Runtime supplies no default: how long to send a director back, and what to tell it, is the record's decision");
1811
- if (deps.deliverable !== void 0 && runtimeToolNames.includes("stop")) throw new ValidationError(`supervisorAgent: the profile grants ${coordinationProfileToolPrefix}stop to a manager with a completion check. Such a manager ends only through submit_result (the check passes) or report_blocked (a failed probe); remove stop from its tools`);
1811
+ if (deps.deliverable !== void 0 && runtimeToolNames.includes("stop")) throw new ValidationError(`supervisorAgent: the profile grants ${coordinationProfileToolPrefix}stop to a manager with a completion check. Such a manager ends only through submit_result (the check passes) or a bound (deadline, budget, cancellation, no progress); remove stop from its tools`);
1812
1812
  const continuationDeadlineMs = deps.continuation === void 0 ? void 0 : admitContinuationPolicy(deps.continuation, "supervisorAgent");
1813
1813
  if (harness === null) {
1814
1814
  assertRouterArmResourcePolicy(stableProfile);
@@ -2119,12 +2119,14 @@ function buildSupervisorAgent(profile, deps, testBrain) {
2119
2119
  const describe = deps.deliverable?.describe;
2120
2120
  const settleLoop = () => {
2121
2121
  const stopReason = controls.stopReason() ?? progressStopReason;
2122
- const closedBy = mcp.submittedResult() ? "result-accepted" : controls.blocked() !== void 0 ? "blocked" : mcp.isStopped() ? "stop" : progressStopReason !== void 0 ? "stop-rule" : void 0;
2122
+ const closedBy = mcp.submittedResult() ? "result-accepted" : mcp.isStopped() ? "stop" : progressStopReason !== void 0 ? "stop-rule" : void 0;
2123
+ const blocked = controls.blocked();
2123
2124
  deps.onDriverLoopSettled?.({
2124
2125
  ...summarizeDriverAttempts(loopRecords),
2125
2126
  environmentReplacements,
2126
2127
  workspaceRestores,
2127
2128
  ...closedBy === void 0 ? {} : { closedBy },
2129
+ ...blocked.length === 0 ? {} : { blocked },
2128
2130
  ...stopReason === void 0 ? {} : { stopReason },
2129
2131
  continuations: keeper?.entries() ?? []
2130
2132
  });
@@ -3727,6 +3729,7 @@ const superviseOptionKeySet = /* @__PURE__ */ new Set([
3727
3729
  "peerMail",
3728
3730
  "perWorker",
3729
3731
  "reservationPolicy",
3732
+ "deadlineCheckIn",
3730
3733
  "profileGuidance",
3731
3734
  "profileSecurity",
3732
3735
  "registry",
@@ -3739,6 +3742,7 @@ const superviseOptionKeySet = /* @__PURE__ */ new Set([
3739
3742
  "router",
3740
3743
  "runDir",
3741
3744
  "resume",
3745
+ "segment",
3742
3746
  "runContext",
3743
3747
  "runId",
3744
3748
  "signal",
@@ -4147,6 +4151,47 @@ function superviseRootProfile(profile, profileGuidance) {
4147
4151
  const compose = profileGuidanceComposer(profileGuidance);
4148
4152
  return freezeDetachedProfile(compose ? compose(parsedProfile.data) : parsedProfile.data);
4149
4153
  }
4154
+ /** What a root profile runs on, as a `root-segment` record names it. */
4155
+ function rootSegmentOf(profile) {
4156
+ return {
4157
+ ...profile.model?.provider === void 0 ? {} : { provider: profile.model.provider },
4158
+ ...profile.model?.default === void 0 ? {} : { model: profile.model.default },
4159
+ ...profile.model?.reasoningEffort === void 0 ? {} : { reasoningEffort: profile.model.reasoningEffort },
4160
+ ...profile.harness === void 0 ? {} : { harness: profile.harness }
4161
+ };
4162
+ }
4163
+ /** Refuse a segment that names nothing usable before any compute. */
4164
+ function admitSegment(segment) {
4165
+ if (typeof segment !== "object" || segment === null) throw new ValidationError("supervise: segment must be an object");
4166
+ for (const key of [
4167
+ "provider",
4168
+ "model",
4169
+ "harness"
4170
+ ]) {
4171
+ const value = segment[key];
4172
+ if (value !== void 0 && (typeof value !== "string" || value.trim().length === 0)) throw new ValidationError(`supervise: segment.${key} must name a ${key}`);
4173
+ }
4174
+ if (typeof segment.reason !== "string" || segment.reason.trim().length === 0) throw new ValidationError("supervise: segment.reason must say why the segment starts");
4175
+ if (segment.stack !== void 0) {
4176
+ if (typeof segment.stack !== "object" || segment.stack === null || Array.isArray(segment.stack)) throw new ValidationError("supervise: segment.stack must map package names to versions");
4177
+ for (const [name, version] of Object.entries(segment.stack)) if (typeof version !== "string" || version.length === 0) throw new ValidationError(`supervise: segment.stack.${name} must be a version string`);
4178
+ }
4179
+ }
4180
+ /** The recorded root profile with only its provider, model, reasoning effort and harness replaced
4181
+ * where the segment names them. */
4182
+ function withRootSegment(profile, segment) {
4183
+ if (segment.provider === void 0 && segment.model === void 0 && segment.reasoningEffort === void 0 && segment.harness === void 0) return profile;
4184
+ return superviseRootProfile({
4185
+ ...profile,
4186
+ ...segment.harness === void 0 ? {} : { harness: segment.harness },
4187
+ model: {
4188
+ ...profile.model,
4189
+ ...segment.provider === void 0 ? {} : { provider: segment.provider },
4190
+ ...segment.model === void 0 ? {} : { default: segment.model },
4191
+ ...segment.reasoningEffort === void 0 ? {} : { reasoningEffort: segment.reasoningEffort }
4192
+ }
4193
+ }, void 0);
4194
+ }
4150
4195
  function superviseWithContext(profile, task, opts, brain) {
4151
4196
  if (opts.runContext?.acquire === void 0) return superviseInternal(profile, task, opts, brain);
4152
4197
  const options = captureSuperviseOptions(opts);
@@ -4166,7 +4211,9 @@ function superviseInternal(profile, task, opts, testBrain) {
4166
4211
  }
4167
4212
  assertValidBudget(options.budget, "supervise budget");
4168
4213
  const composeSpawnProfile = profileGuidanceComposer(options.profileGuidance);
4169
- const canonicalProfile = superviseRootProfile(profile, options.profileGuidance);
4214
+ const registeredProfile = superviseRootProfile(profile, options.profileGuidance);
4215
+ if (options.segment !== void 0) admitSegment(options.segment);
4216
+ const canonicalProfile = options.segment === void 0 ? registeredProfile : withRootSegment(registeredProfile, options.segment);
4170
4217
  assertExecutableAgentProfile(canonicalProfile, "supervise root");
4171
4218
  if (authoredSeatStages(canonicalProfile) !== void 0 && options.selectSeat === void 0) throw new ValidationError("supervise: AgentProfile.seats requires selectSeat before execution");
4172
4219
  const canonicalTask = freezeDetached(task);
@@ -4185,7 +4232,7 @@ function superviseInternal(profile, task, opts, testBrain) {
4185
4232
  })));
4186
4233
  };
4187
4234
  };
4188
- const rootExecution = canonicalExecution(canonicalProfile, canonicalTask, options.execution, "supervise root");
4235
+ const rootExecution = canonicalExecution(registeredProfile, canonicalTask, options.execution, "supervise root");
4189
4236
  const backendModel = options.backend?.model;
4190
4237
  const driverBackendModel = options.driverBackend?.model;
4191
4238
  assertProfileModelsAllowed(canonicalProfile, options.allowedModels);
@@ -4598,6 +4645,14 @@ function superviseInternal(profile, task, opts, testBrain) {
4598
4645
  executors: ctx.executors,
4599
4646
  ...options.recoverExecutor ?? recoveryFactories.get(workerFactory) ? { recoverExecutor: options.recoverExecutor ?? recoveryFactories.get(workerFactory) } : {},
4600
4647
  rootIdentity: rootExecution.identity,
4648
+ ...options.segment === void 0 ? {} : { rootSegment: {
4649
+ registered: rootSegmentOf(registeredProfile),
4650
+ current: {
4651
+ ...rootSegmentOf(canonicalProfile),
4652
+ ...options.segment.stack === void 0 ? {} : { stack: { ...options.segment.stack } }
4653
+ },
4654
+ reason: options.segment.reason
4655
+ } },
4601
4656
  ...rootOwnerRuntime === void 0 ? {} : { rootMaterialization: {
4602
4657
  runtime: rootOwnerRuntime,
4603
4658
  declaration: "deferred",
@@ -4610,6 +4665,7 @@ function superviseInternal(profile, task, opts, testBrain) {
4610
4665
  ownerWorkspaceRetention: managerBackend?.backend === "provider" && managerBackend.workspaceRetention !== void 0,
4611
4666
  ...options.workerSlots !== void 0 ? { workerSlots: options.workerSlots } : {},
4612
4667
  ...options.reservationPolicy ? { reservationPolicy: options.reservationPolicy } : {},
4668
+ ...options.deadlineCheckIn === void 0 ? {} : { deadlineCheckIn: options.deadlineCheckIn },
4613
4669
  ...ctx.resume === true || options.runDir === void 0 && options.resume === true ? { resume: true } : {},
4614
4670
  ...options.now ? { now: options.now } : {},
4615
4671
  signal: options.signal ? AbortSignal.any([options.signal, durableCancellation.signal]) : durableCancellation.signal,
@@ -4688,4 +4744,4 @@ function rootProviderModelEvidenceFromExecution(evidence) {
4688
4744
  //#endregion
4689
4745
  export { readRootStreamReceipt as _, superviseWithTestBrain as a, createSupervisorSpanRecorder as b, resolveWorkerSpawnRetry as c, assertCoordinationBinding as d, resolveSupervisorProfile as f, readRootStream as g, ROOT_STREAM_FILE as h, superviseRootProfile as i, retryPreSpawnRefusals as l, supervisorAgentWithTestBrain as m, profileGuidanceComposer as n, workerFromBackend as o, supervisorAgent as p, supervise as r, isPreSpawnExecutorFailure as s, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, withWorkerSpawnRetry as u, UNPROVEN_CONTINUITY as v, serveCoordinationMcp as x, composeReentryTask as y };
4690
4746
 
4691
- //# sourceMappingURL=supervise-B5iHXeuw.js.map
4747
+ //# sourceMappingURL=supervise-CGMzXi_j.js.map