@tangle-network/agent-runtime 10.0.17 → 10.0.19
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.
- package/CHANGELOG.md +12 -0
- package/dist/{activation-BSyIPZNw.d.ts → activation-BudDVuT6.d.ts} +2 -2
- package/dist/{activation-CxTZHC70.js → activation-DLnZJab0.js} +2 -2
- package/dist/{activation-CxTZHC70.js.map → activation-DLnZJab0.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +3 -3
- package/dist/{delegate-DGeAiukN.js → delegate-9b8qGlXp.js} +2 -2
- package/dist/{delegate-DGeAiukN.js.map → delegate-9b8qGlXp.js.map} +1 -1
- package/dist/{driver-control-acknowledgers-Q4c0RMoG.js → driver-control-acknowledgers-b5MsXxR5.js} +7 -7
- package/dist/{driver-control-acknowledgers-Q4c0RMoG.js.map → driver-control-acknowledgers-b5MsXxR5.js.map} +1 -1
- package/dist/durable-writer-thread.js +2 -2
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +15 -15
- package/dist/durable.js.map +1 -1
- package/dist/{failure-cause-DeSINrKC.js → failure-cause-C96rzF-d.js} +12 -2
- package/dist/{failure-cause-DeSINrKC.js.map → failure-cause-C96rzF-d.js.map} +1 -1
- package/dist/{graph-qm8N8-Jg.js → graph--n31XKWJ.js} +6 -6
- package/dist/{graph-qm8N8-Jg.js.map → graph--n31XKWJ.js.map} +1 -1
- package/dist/{improve-BIgddUb2.js → improve-sIZhpXqE.js} +5 -5
- package/dist/{improve-BIgddUb2.js.map → improve-sIZhpXqE.js.map} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -10
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +4 -4
- package/dist/kernel.d.ts +1 -1
- package/dist/kernel.js +15 -15
- package/dist/{loop-runner-CG8rMjSU.d.ts → loop-runner-Bn7lFuQZ.d.ts} +2 -2
- package/dist/{loop-runner-CARBEmJ-.js → loop-runner-Dt7I2oMa.js} +2 -2
- package/dist/{loop-runner-CARBEmJ-.js.map → loop-runner-Dt7I2oMa.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +6 -6
- package/dist/mcp/memory-bin.js +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/{provision-supervisor-bnP_5YKO.js → provision-supervisor-DfDAdtqb.js} +5 -5
- package/dist/{provision-supervisor-bnP_5YKO.js.map → provision-supervisor-DfDAdtqb.js.map} +1 -1
- package/dist/{result-blob-store-hfSuzvWt.js → result-blob-store-Dke805sV.js} +2 -2
- package/dist/{result-blob-store-hfSuzvWt.js.map → result-blob-store-Dke805sV.js.map} +1 -1
- package/dist/{run-cancellation-3JALg48v.js → run-cancellation-B0SgcidY.js} +2 -2
- package/dist/{run-cancellation-3JALg48v.js.map → run-cancellation-B0SgcidY.js.map} +1 -1
- package/dist/{run-reopen-CrlP610D.js → run-reopen-B7TN2aQQ.js} +6 -6
- package/dist/{run-reopen-CrlP610D.js.map → run-reopen-B7TN2aQQ.js.map} +1 -1
- package/dist/{run-state-CdmftIyV.js → run-state-BNBUy2uK.js} +5 -5
- package/dist/{run-state-CdmftIyV.js.map → run-state-BNBUy2uK.js.map} +1 -1
- package/dist/{runtime-BJfxfru1.js → runtime-DXeWY00j.js} +15 -15
- package/dist/{runtime-BJfxfru1.js.map → runtime-DXeWY00j.js.map} +1 -1
- package/dist/{search-executor-B0XqNpI1.js → search-executor-BoQHI2Tz.js} +4 -4
- package/dist/{search-executor-B0XqNpI1.js.map → search-executor-BoQHI2Tz.js.map} +1 -1
- package/dist/{server-BL1KHd0N.js → server-Xkgobp5y.js} +4 -4
- package/dist/{server-BL1KHd0N.js.map → server-Xkgobp5y.js.map} +1 -1
- package/dist/{settle-record-CWixHcZl.js → settle-record-B5OpVDnC.js} +2 -2
- package/dist/{settle-record-CWixHcZl.js.map → settle-record-B5OpVDnC.js.map} +1 -1
- package/dist/{structural-rollout-PkvuJbEk.js → structural-rollout-BSF5tzUm.js} +4 -4
- package/dist/{structural-rollout-PkvuJbEk.js.map → structural-rollout-BSF5tzUm.js.map} +1 -1
- package/dist/{supervise-CPMm88sh.js → supervise-Drc1Pj1d.js} +67 -39
- package/dist/supervise-Drc1Pj1d.js.map +1 -0
- package/dist/{supervise-identity-BAOmWwLn.js → supervise-identity-Cz-Hzg9s.js} +2 -2
- package/dist/{supervise-identity-BAOmWwLn.js.map → supervise-identity-Cz-Hzg9s.js.map} +1 -1
- package/dist/{supervision-discovery-B6fyGpHe.js → supervision-discovery-DdRd1lsz.js} +3 -3
- package/dist/{supervision-discovery-B6fyGpHe.js.map → supervision-discovery-DdRd1lsz.js.map} +1 -1
- package/dist/{supervisor-BOYyb8eL.js → supervisor-CwUD7dsm.js} +6 -6
- package/dist/{supervisor-BOYyb8eL.js.map → supervisor-CwUD7dsm.js.map} +1 -1
- package/dist/{supervisor-accounting-BmY9xWOW.js → supervisor-accounting-CPDPG8mH.js} +1785 -1728
- package/dist/supervisor-accounting-CPDPG8mH.js.map +1 -0
- package/dist/{supervisor-root-contract-DIMbL04L.js → supervisor-root-contract-Uw2q3nvG.js} +3 -3
- package/dist/{supervisor-root-contract-DIMbL04L.js.map → supervisor-root-contract-Uw2q3nvG.js.map} +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +11 -11
- package/dist/{tool-server--58hhIKE.js → tool-server-BhsyVDj2.js} +2 -2
- package/dist/{tool-server--58hhIKE.js.map → tool-server-BhsyVDj2.js.map} +1 -1
- package/dist/{top-web-CPzT4hJX.js → top-web-5ThvdyD0.js} +7 -7
- package/dist/{top-web-CPzT4hJX.js.map → top-web-5ThvdyD0.js.map} +1 -1
- package/dist/tui/bin.js +3 -3
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +2 -2
- package/dist/{types-C477vlPv.d.ts → types-BLhsL4qy.d.ts} +44 -35
- package/package.json +2 -2
- package/dist/supervise-CPMm88sh.js.map +0 -1
- package/dist/supervisor-accounting-BmY9xWOW.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
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-
|
|
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 awaitRootWake, 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 assertRunParking, 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, r as RunParkedError, s as isRunParked, u as withRunParking, ut as HarnessTurnFailedError, vt as CheckUnavailableError, w as createExecutor, wt as bridgeModelRouteRefusal, yt as gateFactoryOnDeliverable } from "./supervisor-
|
|
4
|
-
import { a as freezeDetached, c as supervisionRunNamespace, i as externalExecutionId, l as workerAssignmentNamespace, n as childCoordinationOwner, o as freezeDetachedProfile, r as coordinationEventId, s as rootCoordinationOwner, t as canonicalExecution } from "./supervise-identity-
|
|
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-b5MsXxR5.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 awaitRootWake, 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 assertRunParking, 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, r as RunParkedError, s as isRunParked, u as withRunParking, ut as HarnessTurnFailedError, vt as CheckUnavailableError, w as createExecutor, wt as bridgeModelRouteRefusal, yt as gateFactoryOnDeliverable } from "./supervisor-CwUD7dsm.js";
|
|
4
|
+
import { a as freezeDetached, c as supervisionRunNamespace, i as externalExecutionId, l as workerAssignmentNamespace, n as childCoordinationOwner, o as freezeDetachedProfile, r as coordinationEventId, s as rootCoordinationOwner, t as canonicalExecution } from "./supervise-identity-Cz-Hzg9s.js";
|
|
5
5
|
import { a as errMessage, c as errorStack, f as defaultRedactor, i as causeChain, l as errorText, n as detachedSnapshot, o as errorHttpStatus, u as providerTraceId } from "./snapshot-BKLziJ5K.js";
|
|
6
6
|
import { t as composeRuntimeHooks } from "./runtime-hooks-CsW2pfFk.js";
|
|
7
|
-
import { $n as generateSpanId, $r as runtimeOwnedScopeOwnerRuntime, $t as reconcileScopeRetainedOwnerEnvironment, Bt as recordScopeOwnerHarnessTranscript, Cr as isTerminalNodeStatus, Dr as authoredSeatStages, Dt as scopeRetainedOwnerResourceReader, Er as SeatPauseError, Et as releaseScopeRetainedOwnerForSeatPause, Ft as scopeRetainedOwnerResult, Gt as coordinationMcpAlias, Hr as recordRuntimeOwnedDriveHarnessProviderEvidence, Ht as restoreScopeOwnerAcceptedExecution, It as beginScopeOwnerAttempt, Jr as runtimeOwnedExecutorExecutionBinding, Jt as runtimeGraphMetadataKey, Kt as coordinationProfileToolPrefix, Mt as consumeScopeRetainedOwnerResult, Nr as attestRuntimeOwnedScopeOwner, Nt as prepareScopeRetainedOwnerTask, Or as seatExecutionProfile, Pr as authoredAgentIdentity, Pt as scopeRetainedOwnerPriorSpend, Qt as assertRetainedOwnerCoordinationRekey, Rt as holdScopeOwnerTranscript, Sr as isLiveNodeStatus, Tr as SeatChain, Tt as prepareScopeRetainedOwnerSeatSwitch, Ut as scopeOwnerExecutionObservation, V as parseWorkerToolTraceArtifact, Vn as WORKER_TRACE_PROPAGATION, Vr as providerAttemptEvidence, Vt as recordScopeOwnerMaterialization, Wt as scopeOwnerExecutorNodeContext, Xr as runtimeOwnedExecutorProviderEvidence, Yr as runtimeOwnedExecutorMaterialization, Yt as beginScopeRetainedOwnerDrive, Zn as createOtelExporter, Zr as runtimeOwnedPendingExecutorMaterialization, Zt as scopeRetainedOwnerTurnEnded, an as owners, cn as scopeRetainedOwnerJournalRoot, dr as persistHarnessTranscript, dt as meterRuntimeOwnedAccounting, en as scopeRetainedOwnerRestorePoint, fr as readHarnessTranscript, ft as meterRuntimeOwnedProviderAttempt, gt as recordScopeOwnerPause, ht as recordScopeOwnerDriverAttempt, i as ROOT_STREAM_FILE, ii as isRuntimeFlowBrain, in as bindScopeRetainedOwnerProvider, jt as abandonScopeRetainedOwnerInvocation, l as readRootStream, mt as recordScopeOwnerBarrenPause, nt as assertRecursiveReservationPolicy, o as createRootStreamSink, oi as runtimeFlowAgent, pr as settleHarnessTranscript, pt as pauseScopeSeatAdmission, qr as runtimeOwnedDriveHarnessProviderEvidence, qt as providerVisibleProfile, rn as bindScopeRetainedOwnerEnvironmentId, si as runtimeFlowBrain, sn as scopeRetainedOwnerContext, tn as noteScopeRetainedOwnerCoordination, vn as executorObservationSeamKey, wr as SEAT_RECHECK_MS, yr as createActivityLog, zt as noteScopeOwnerPlannedExecution } from "./supervisor-accounting-
|
|
7
|
+
import { $n as generateSpanId, $r as runtimeOwnedScopeOwnerRuntime, $t as reconcileScopeRetainedOwnerEnvironment, Bt as recordScopeOwnerHarnessTranscript, Cr as isTerminalNodeStatus, Dr as authoredSeatStages, Dt as scopeRetainedOwnerResourceReader, Er as SeatPauseError, Et as releaseScopeRetainedOwnerForSeatPause, Ft as scopeRetainedOwnerResult, Gt as coordinationMcpAlias, Hr as recordRuntimeOwnedDriveHarnessProviderEvidence, Ht as restoreScopeOwnerAcceptedExecution, It as beginScopeOwnerAttempt, Jr as runtimeOwnedExecutorExecutionBinding, Jt as runtimeGraphMetadataKey, Kt as coordinationProfileToolPrefix, Mt as consumeScopeRetainedOwnerResult, Nr as attestRuntimeOwnedScopeOwner, Nt as prepareScopeRetainedOwnerTask, Or as seatExecutionProfile, Pr as authoredAgentIdentity, Pt as scopeRetainedOwnerPriorSpend, Qt as assertRetainedOwnerCoordinationRekey, Rt as holdScopeOwnerTranscript, Sr as isLiveNodeStatus, Tr as SeatChain, Tt as prepareScopeRetainedOwnerSeatSwitch, Ut as scopeOwnerExecutionObservation, V as parseWorkerToolTraceArtifact, Vn as WORKER_TRACE_PROPAGATION, Vr as providerAttemptEvidence, Vt as recordScopeOwnerMaterialization, Wt as scopeOwnerExecutorNodeContext, Xr as runtimeOwnedExecutorProviderEvidence, Yr as runtimeOwnedExecutorMaterialization, Yt as beginScopeRetainedOwnerDrive, Zn as createOtelExporter, Zr as runtimeOwnedPendingExecutorMaterialization, Zt as scopeRetainedOwnerTurnEnded, an as owners, cn as scopeRetainedOwnerJournalRoot, dr as persistHarnessTranscript, dt as meterRuntimeOwnedAccounting, en as scopeRetainedOwnerRestorePoint, fr as readHarnessTranscript, ft as meterRuntimeOwnedProviderAttempt, gt as recordScopeOwnerPause, ht as recordScopeOwnerDriverAttempt, i as ROOT_STREAM_FILE, ii as isRuntimeFlowBrain, in as bindScopeRetainedOwnerProvider, jt as abandonScopeRetainedOwnerInvocation, l as readRootStream, mt as recordScopeOwnerBarrenPause, nt as assertRecursiveReservationPolicy, o as createRootStreamSink, oi as runtimeFlowAgent, pr as settleHarnessTranscript, pt as pauseScopeSeatAdmission, qr as runtimeOwnedDriveHarnessProviderEvidence, qt as providerVisibleProfile, rn as bindScopeRetainedOwnerEnvironmentId, si as runtimeFlowBrain, sn as scopeRetainedOwnerContext, tn as noteScopeRetainedOwnerCoordination, vn as executorObservationSeamKey, wr as SEAT_RECHECK_MS, yr as createActivityLog, zt as noteScopeOwnerPlannedExecution } from "./supervisor-accounting-CPDPG8mH.js";
|
|
8
8
|
import { _ as runAbortable, g as linkAbort, p as RunCancellationReason } from "./jsonl-file-B8xfYz9M.js";
|
|
9
9
|
import { a as createContinuationKeeper, i as checkVerdictOf, n as admitContinuationPolicy, r as bestComposite, t as CONTINUATIONS_DIR } from "./continuation-CDdjAkpk.js";
|
|
10
|
-
import {
|
|
11
|
-
import { a as readRunCancelRequest, d as writeRunCancellationAsync, l as watchRunCancellation, n as applyRunCancellationAsync, o as readRunCancellation, t as applyRunCancellation } from "./run-cancellation-
|
|
10
|
+
import { A as unavailableResumeAt, B as harnessProcessDied, F as contentAddress, H as turnFailureOf, L as executorFailure, O as reportedResetAt, T as jitteredMs, U as turnFailurePolicy, _ as registerRetainedExecutorPreparation, at as assertValidBudget, b as PLACEMENT_SIGNALS, g as refusedBeforeItRan, it as spendFromUsageTotals, jt as recordValue, k as unavailablePauseMs, l as RetainedExecutionPendingError, nt as newUsageTotals, tt as meterUsageEvent, v as retainedExecutorContext, w as cappedDoublingMs, x as RATE_LIMIT_SIGNALS, y as retainedExecutorSeamKey } from "./failure-cause-C96rzF-d.js";
|
|
11
|
+
import { a as readRunCancelRequest, d as writeRunCancellationAsync, l as watchRunCancellation, n as applyRunCancellationAsync, o as readRunCancellation, t as applyRunCancellation } from "./run-cancellation-B0SgcidY.js";
|
|
12
12
|
import { o as safeJsonText } from "./coordination-map-routing-DovTCk1Y.js";
|
|
13
|
-
import { n as createStdioToolServer } from "./tool-server
|
|
13
|
+
import { n as createStdioToolServer } from "./tool-server-BhsyVDj2.js";
|
|
14
14
|
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";
|
|
15
15
|
import { d as teardownExecutor, i as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, l as isDeadlineAbortReason, o as armDeadlineTimer } from "./deadline-CySmJ_0S.js";
|
|
16
16
|
import { a as concreteProfileModel, b as harnessRunsAgent, c as profileModelExecutionSettings, l as profileProviderModel, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile, v as agentHarness } from "./model-policy-DFuhCC0-.js";
|
|
@@ -5264,14 +5264,7 @@ var DriverRetryLoop = class {
|
|
|
5264
5264
|
retryInMs: pauseMs,
|
|
5265
5265
|
resumeAt: new Date(pausedAt + pauseMs).toISOString()
|
|
5266
5266
|
});
|
|
5267
|
-
|
|
5268
|
-
const wait = AbortSignal.any([run.signal, steered.signal]);
|
|
5269
|
-
steering.steered(wait).then(() => steered.abort());
|
|
5270
|
-
try {
|
|
5271
|
-
await limits.sleep(pauseMs, wait);
|
|
5272
|
-
} finally {
|
|
5273
|
-
steered.abort();
|
|
5274
|
-
}
|
|
5267
|
+
await this.sleepUntilSteered(steering, pauseMs);
|
|
5275
5268
|
const ended = run.signal.aborted ? abortStop(run.signal) : limits.now() >= this.deadlineAt() ? "deadline" : void 0;
|
|
5276
5269
|
if (ended !== void 0) {
|
|
5277
5270
|
await this.emit({
|
|
@@ -5505,8 +5498,25 @@ var DriverRetryLoop = class {
|
|
|
5505
5498
|
barren
|
|
5506
5499
|
};
|
|
5507
5500
|
}
|
|
5501
|
+
/**
|
|
5502
|
+
* Sleep through a pause that a cancel or a root steer ends early; true when a steer ended it. A
|
|
5503
|
+
* steer ends every pause, a budget or barren pause included: it is how an operator changes a live
|
|
5504
|
+
* run. `steered` answers each steer once, so a pool still spent pauses again on its ladder.
|
|
5505
|
+
*/
|
|
5506
|
+
async sleepUntilSteered(steering, pauseMs) {
|
|
5507
|
+
const steered = new AbortController();
|
|
5508
|
+
const wait = AbortSignal.any([this.run.signal, steered.signal]);
|
|
5509
|
+
steering.steered(wait).then(() => steered.abort());
|
|
5510
|
+
try {
|
|
5511
|
+
await this.limits.sleep(pauseMs, wait);
|
|
5512
|
+
return steered.signal.aborted && !this.run.signal.aborted;
|
|
5513
|
+
} finally {
|
|
5514
|
+
steered.abort();
|
|
5515
|
+
}
|
|
5516
|
+
}
|
|
5508
5517
|
/** A barren streak at `maxBarren` paces the run and never ends it: journal the pause and sleep
|
|
5509
|
-
* through it, never past the earlier deadline; the caller reads the bounds again after.
|
|
5518
|
+
* through it, never past the earlier deadline; the caller reads the bounds again after. An
|
|
5519
|
+
* opted-in root's steer ends the pause, and the next turn is told the time it actually waited. */
|
|
5510
5520
|
async barrenPause(policy, attempt) {
|
|
5511
5521
|
if (this.barrenReentries < policy.maxBarren) return void 0;
|
|
5512
5522
|
const { run } = this;
|
|
@@ -5520,10 +5530,17 @@ var DriverRetryLoop = class {
|
|
|
5520
5530
|
lastProgressAt: new Date(this.lastProgressAt).toISOString()
|
|
5521
5531
|
};
|
|
5522
5532
|
await run.onBarrenPause?.(pause);
|
|
5523
|
-
|
|
5533
|
+
if (run.stopPause === void 0) {
|
|
5534
|
+
await this.limits.sleep(pauseMs, run.signal);
|
|
5535
|
+
return {
|
|
5536
|
+
streak: this.barrenReentries,
|
|
5537
|
+
pausedMs: pauseMs
|
|
5538
|
+
};
|
|
5539
|
+
}
|
|
5540
|
+
const pausedMs = await this.sleepUntilSteered(run.stopPause, pauseMs) ? Math.max(0, this.limits.now() - pausedAt) : pauseMs;
|
|
5524
5541
|
return {
|
|
5525
5542
|
streak: this.barrenReentries,
|
|
5526
|
-
pausedMs
|
|
5543
|
+
pausedMs
|
|
5527
5544
|
};
|
|
5528
5545
|
}
|
|
5529
5546
|
/** Read a completed drive: wait, continue, or end the loop. True re-enters the driver. */
|
|
@@ -8096,23 +8113,25 @@ var DriverExecutionAttempt = class {
|
|
|
8096
8113
|
}
|
|
8097
8114
|
async meterUnmeteredAttempts() {
|
|
8098
8115
|
const { scope, executor } = this;
|
|
8116
|
+
const refused = refusedBeforeItRan(this.failure);
|
|
8099
8117
|
for (;;) {
|
|
8100
8118
|
const evidence = runtimeOwnedExecutorProviderEvidence(executor);
|
|
8101
8119
|
if ((evidence?.attempts.length ?? 0) <= this.meteredProviderAttempts) break;
|
|
8102
|
-
const
|
|
8120
|
+
const attempt = evidence?.attempts[this.meteredProviderAttempts];
|
|
8121
|
+
const providerDispatchDidNotStart = attempt?.providerDispatch === "not_started" || refused && attempt?.observations.length === 0 && attempt.identityConflict !== true;
|
|
8103
8122
|
await meterRuntimeOwnedProviderAttempt(scope, withBudgetResources(providerDispatchDidNotStart ? zeroSpend() : unmeteredSpend(0), scope.budget, providerDispatchDidNotStart), this.nextProviderEvidence(), {
|
|
8104
8123
|
role: "driver",
|
|
8105
8124
|
runtime: executor.runtime,
|
|
8106
8125
|
telemetry: providerDispatchDidNotStart ? "known-zero-before-dispatch" : "unknown-after-failure"
|
|
8107
8126
|
});
|
|
8108
8127
|
}
|
|
8109
|
-
if (this.meteredProviderAttempts === 0) await meterRuntimeOwnedProviderAttempt(scope, withBudgetResources(unmeteredSpend(0), scope.budget), this.nextProviderEvidence(), {
|
|
8128
|
+
if (this.meteredProviderAttempts === 0) await meterRuntimeOwnedProviderAttempt(scope, withBudgetResources(refused ? zeroSpend() : unmeteredSpend(0), scope.budget, refused), this.nextProviderEvidence(), {
|
|
8110
8129
|
role: "driver",
|
|
8111
8130
|
runtime: executor.runtime,
|
|
8112
|
-
telemetry: "unknown-after-failure"
|
|
8131
|
+
telemetry: refused ? "known-zero-before-dispatch" : "unknown-after-failure"
|
|
8113
8132
|
});
|
|
8114
8133
|
const attempts = runtimeOwnedExecutorProviderEvidence(executor)?.attempts;
|
|
8115
|
-
const provenNotStarted = attempts !== void 0 && attempts.length > 0 && attempts.every((attempt) => attempt.providerDispatch === "not_started");
|
|
8134
|
+
const provenNotStarted = refused || attempts !== void 0 && attempts.length > 0 && attempts.every((attempt) => attempt.providerDispatch === "not_started");
|
|
8116
8135
|
if (scope.budget.resources !== void 0 && !provenNotStarted) await meterRuntimeOwnedAccounting(scope, withBudgetResources(zeroSpend(), scope.budget), {
|
|
8117
8136
|
role: "driver",
|
|
8118
8137
|
runtime: executor.runtime,
|
|
@@ -8242,8 +8261,9 @@ var ManagerDriveSession = class {
|
|
|
8242
8261
|
const seatJournalRoot = scopeRetainedOwnerJournalRoot(scope) ?? seatSelection.rootId;
|
|
8243
8262
|
this.seatChain ??= new SeatChain(authoredProfile, scope.view.root, seatJournalRoot, seatSelection.journal, seatSelection.select, now, (segment, phase) => seatSelection.onSegment(scope.view.root, segment, phase), async (selection, previous) => {
|
|
8244
8263
|
if (!previous || previous.seat === selection.seat) return;
|
|
8245
|
-
const sameEnvironment = previous.provider === selection.stage.provider && previous.harness === selection.stage.harness;
|
|
8264
|
+
const sameEnvironment = selection.nativeTurnGrant === true && previous.provider === selection.stage.provider && previous.harness === selection.stage.harness;
|
|
8246
8265
|
try {
|
|
8266
|
+
if (!sameEnvironment && (await reconcileScopeRetainedOwnerEnvironment(scope, "running")).state === "lost") return;
|
|
8247
8267
|
const checkpointAt = await prepareScopeRetainedOwnerSeatSwitch(scope, sameEnvironment ? "same-environment" : "replace-environment");
|
|
8248
8268
|
if (!sameEnvironment) this.switchedProviderCheckpointAt = checkpointAt;
|
|
8249
8269
|
} catch (error) {
|
|
@@ -8547,7 +8567,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns,
|
|
|
8547
8567
|
const priorCommittedArtifact = state.managerArtifact;
|
|
8548
8568
|
state.managerArtifact = void 0;
|
|
8549
8569
|
manager.switchedProviderCheckpointAt = void 0;
|
|
8550
|
-
await bindDriveRetainedOwner(manager, args);
|
|
8570
|
+
if (await bindDriveRetainedOwner(manager, args) !== void 0 && args.reentry?.reason.reason === "run-reentered") await reconcileScopeRetainedOwnerEnvironment(scope, "released");
|
|
8551
8571
|
await manager.selectSeat(args, seatSelection, executionId, now);
|
|
8552
8572
|
const retainedOwner = await bindDriveRetainedOwner(manager, args);
|
|
8553
8573
|
const driveTask = args.reentry === void 0 ? args.task : await reentryDriveTask(manager, args, args.reentry, retainedOwner !== void 0, priorCommittedArtifact);
|
|
@@ -8630,13 +8650,13 @@ async function bindDriveRetainedOwner(manager, { scope }) {
|
|
|
8630
8650
|
}
|
|
8631
8651
|
async function reentryDriveTask(manager, { scope, session }, reentry, retainedOwner, priorCommittedArtifact) {
|
|
8632
8652
|
const { activeSeat, switchedProviderCheckpointAt } = manager;
|
|
8633
|
-
const proven = reentry.reason.reason === "run-reentered" ?
|
|
8653
|
+
const proven = reentry.reason.reason === "run-reentered" ? await recoveredContinuity(manager.state.boundBackend, scope, retainedOwner) : switchedProviderCheckpointAt === void 0 ? await reentryContinuity(manager.state.boundBackend, scope, retainedOwner) : {
|
|
8634
8654
|
session: "new",
|
|
8635
8655
|
environment: "replaced",
|
|
8636
8656
|
workspace: "restored",
|
|
8637
8657
|
checkpointAt: switchedProviderCheckpointAt
|
|
8638
8658
|
};
|
|
8639
|
-
if (activeSeat?.previous && activeSeat.previous.seat !== activeSeat.seat && activeSeat.previous.provider === activeSeat.stage.provider && activeSeat.previous.harness === activeSeat.stage.harness && (proven.session !== "continued" || proven.environment !== "same")) throw new ValidationError("same-provider seat continuation lost its native environment");
|
|
8659
|
+
if (activeSeat?.nativeTurnGrant === true && activeSeat.previous && activeSeat.previous.seat !== activeSeat.seat && activeSeat.previous.provider === activeSeat.stage.provider && activeSeat.previous.harness === activeSeat.stage.harness && (proven.session !== "continued" || proven.environment !== "same")) throw new ValidationError("same-provider seat continuation lost its native environment");
|
|
8640
8660
|
const continuity = session === "fresh" && proven.session === "continued" ? {
|
|
8641
8661
|
...proven,
|
|
8642
8662
|
session: "new"
|
|
@@ -8682,20 +8702,28 @@ async function reentryContinuity(backend, scope, retainedOwner) {
|
|
|
8682
8702
|
environmentId: environment.environmentId,
|
|
8683
8703
|
workspace: "kept"
|
|
8684
8704
|
};
|
|
8685
|
-
if (environment.state === "lost")
|
|
8686
|
-
const restorePoint = await scopeRetainedOwnerRestorePoint(scope);
|
|
8687
|
-
return {
|
|
8688
|
-
session: "new",
|
|
8689
|
-
environment: "replaced",
|
|
8690
|
-
previousEnvironmentId: environment.environmentId,
|
|
8691
|
-
...restorePoint === void 0 ? { workspace: "lost" } : {
|
|
8692
|
-
workspace: "restored",
|
|
8693
|
-
checkpointAt: restorePoint.takenAt
|
|
8694
|
-
}
|
|
8695
|
-
};
|
|
8696
|
-
}
|
|
8705
|
+
if (environment.state === "lost") return replacedContinuity(scope, environment.environmentId);
|
|
8697
8706
|
return UNPROVEN_CONTINUITY;
|
|
8698
8707
|
}
|
|
8708
|
+
/** A restarted run proves only a loss: its own recovery decides whether anything else continues. */
|
|
8709
|
+
async function recoveredContinuity(backend, scope, retainedOwner) {
|
|
8710
|
+
if (backend.backend !== "provider" || !retainedOwner) return UNPROVEN_CONTINUITY;
|
|
8711
|
+
const environment = await reconcileScopeRetainedOwnerEnvironment(scope, "released");
|
|
8712
|
+
return environment.state === "lost" ? replacedContinuity(scope, environment.environmentId) : UNPROVEN_CONTINUITY;
|
|
8713
|
+
}
|
|
8714
|
+
/** The replacement starts from the lost environment's latest checkpoint when there is one. */
|
|
8715
|
+
async function replacedContinuity(scope, previousEnvironmentId) {
|
|
8716
|
+
const restorePoint = await scopeRetainedOwnerRestorePoint(scope);
|
|
8717
|
+
return {
|
|
8718
|
+
session: "new",
|
|
8719
|
+
environment: "replaced",
|
|
8720
|
+
previousEnvironmentId,
|
|
8721
|
+
...restorePoint === void 0 ? { workspace: "lost" } : {
|
|
8722
|
+
workspace: "restored",
|
|
8723
|
+
checkpointAt: restorePoint.takenAt
|
|
8724
|
+
}
|
|
8725
|
+
};
|
|
8726
|
+
}
|
|
8699
8727
|
// src/runtime/supervise/supervise-manager-harness.ts
|
|
8700
8728
|
/**
|
|
8701
8729
|
* Resolve the harness that drives each manager owner: the caller's resolver or harness, claimed
|
|
@@ -9545,4 +9573,4 @@ function superviseWithContext(profile, task, opts, brain) {
|
|
|
9545
9573
|
}
|
|
9546
9574
|
export { validateGraphTopology as A, allWorkersStalled as B, createFlowRun as C, validateFlowGraph as D, routeFlowOf as E, dumbContinuationPassPrompt as F, areaUnderCurve as G, noProgressFor as H, formatPromptHandle as I, renderAnytimeTable as J, bestSoFar as K, kernelPromptRegistry as L, createPromptRegistry as M, delegatesWorkerBriefPrompt as N, defaultEdgeTraversalCap as O, dumbContinuationFailPrompt as P, naiveContinuationPrompt as R, GraphRouteError as S, journaledGateDecider as T, plateau as U, anyOf as V, anytimeReport as W, createSupervisorSpanRecorder as Y, graphFlowSpawnProfile as _, bridgeProfileRefusal as a, serveCoordinationMcp as b, ASSISTANT_REASONING_SPAN as c, runToolSpans as d, UNPROVEN_CONTINUITY as f, createGraphOverlay as g, runBrainLoop as h, workerFromBackend as i, analyzesFindingsReportPrompt as j, graphRootProfile as k, ASSISTANT_TEXT_SPAN as l, driverAgent as m, superviseFleetCapabilities as n, supervisorAgent as o, composeReentryTask as p, plateauLength as q, superviseWithTestBrain as r, supervisorAgentWithTestBrain as s, supervise as t, rootStreamToolSpans as u, profileGuidanceComposer as v, flowRootProfile as w, coordinationControlToolNames as x, superviseRootProfile as y, promptHandle as z };
|
|
9547
9575
|
|
|
9548
|
-
//# sourceMappingURL=supervise-
|
|
9576
|
+
//# sourceMappingURL=supervise-Drc1Pj1d.js.map
|