@linnlabs/linnkit 0.35.0 → 0.36.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.
- package/CHANGELOG.md +16 -0
- package/dist/cli.cjs +23 -5
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +23 -5
- package/dist/cli.js.map +1 -1
- package/dist/contracts/token-accounting.d.cts +8 -8
- package/dist/contracts/token-accounting.d.ts +8 -8
- package/dist/index.cjs +23 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -5
- package/dist/index.js.map +1 -1
- package/dist/quickstart.cjs +23 -5
- package/dist/quickstart.cjs.map +1 -1
- package/dist/quickstart.js +23 -5
- package/dist/quickstart.js.map +1 -1
- package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.cts +3 -1
- package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.ts +3 -1
- package/dist/runtime-kernel/run-supervisor/runSupervisor.d.cts +2 -2
- package/dist/runtime-kernel/run-supervisor/runSupervisor.d.ts +2 -2
- package/dist/runtime-kernel.cjs +23 -5
- package/dist/runtime-kernel.cjs.map +1 -1
- package/dist/runtime-kernel.js +23 -5
- package/dist/runtime-kernel.js.map +1 -1
- package/dist/testkit.cjs +23 -5
- package/dist/testkit.cjs.map +1 -1
- package/dist/testkit.js +23 -5
- package/dist/testkit.js.map +1 -1
- package/docs/integration/run-supervisor.md +2 -0
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -3085,13 +3085,21 @@ var GraphExecutor = class {
|
|
|
3085
3085
|
if (existing) {
|
|
3086
3086
|
throw new Error(`Graph checkpoint already exists: ${checkpointKey}`);
|
|
3087
3087
|
}
|
|
3088
|
-
this.
|
|
3088
|
+
const initialLocal = this.executionCheckpointPort ? {
|
|
3089
|
+
...local,
|
|
3090
|
+
executorLocal: {
|
|
3091
|
+
...isRecord4(local.executorLocal) ? local.executorLocal : {},
|
|
3092
|
+
stepCount: 0,
|
|
3093
|
+
maxSteps: options.maxSteps ?? this.config.maxSteps
|
|
3094
|
+
}
|
|
3095
|
+
} : local;
|
|
3096
|
+
this.ephemeralLocals.set(checkpointKey, { ...initialLocal });
|
|
3089
3097
|
await this.commitCheckpoint(checkpointKey, {
|
|
3090
3098
|
nodeId,
|
|
3091
3099
|
...this.executionCheckpointPort ? { executionStatus: "ready" } : {},
|
|
3092
3100
|
revision: 1,
|
|
3093
3101
|
schemaVersion: ENGINE_STATE_SCHEMA_VERSION,
|
|
3094
|
-
local: sanitizeCheckpointLocal(
|
|
3102
|
+
local: sanitizeCheckpointLocal(initialLocal)
|
|
3095
3103
|
});
|
|
3096
3104
|
return this.runUntilYieldQueued(
|
|
3097
3105
|
checkpointKey,
|
|
@@ -11935,7 +11943,7 @@ function createAwaitingUserWatcher(options) {
|
|
|
11935
11943
|
const onClose = () => {
|
|
11936
11944
|
dispose();
|
|
11937
11945
|
};
|
|
11938
|
-
eventBus.on("event", onEvent);
|
|
11946
|
+
if (options.stateOwner !== "host") eventBus.on("event", onEvent);
|
|
11939
11947
|
eventBus.on("close", onClose);
|
|
11940
11948
|
return dispose;
|
|
11941
11949
|
}
|
|
@@ -12411,6 +12419,7 @@ var DefaultRunSupervisor = class {
|
|
|
12411
12419
|
this.runSlotLimiter = createRunSlotLimiter({ maxActiveRuns: options.maxActiveRuns });
|
|
12412
12420
|
this.runConcurrencyKeys = createRunConcurrencyKeyRegistry();
|
|
12413
12421
|
this.awaitingUserWatcher = createAwaitingUserWatcher({
|
|
12422
|
+
stateOwner: options.awaitingUserStateOwner,
|
|
12414
12423
|
markAwaitingUser: (runId, patch) => this.getHandle(runId).markAwaitingUser(patch),
|
|
12415
12424
|
onDisposed: (runId) => {
|
|
12416
12425
|
this.eventWatchDisposers.delete(runId);
|
|
@@ -12607,8 +12616,17 @@ var DefaultRunSupervisor = class {
|
|
|
12607
12616
|
canRestoreRun: this.canRestoreRun
|
|
12608
12617
|
});
|
|
12609
12618
|
}
|
|
12610
|
-
async pause(runId, reason) {
|
|
12611
|
-
await this.withRunControlLock(runId, () =>
|
|
12619
|
+
async pause(runId, reason, expectedExecutionId) {
|
|
12620
|
+
await this.withRunControlLock(runId, async () => {
|
|
12621
|
+
const handle = this.getHandle(runId);
|
|
12622
|
+
if (expectedExecutionId !== void 0) {
|
|
12623
|
+
const record = await this.registryStore.load(runId);
|
|
12624
|
+
if (record?.metadata?.executionId !== expectedExecutionId) {
|
|
12625
|
+
throw new RunInteractionConflictError(runId, "pause execution ownership has changed");
|
|
12626
|
+
}
|
|
12627
|
+
}
|
|
12628
|
+
await handle.pause(reason);
|
|
12629
|
+
});
|
|
12612
12630
|
}
|
|
12613
12631
|
async resumePausedRun(input) {
|
|
12614
12632
|
return this.withRunControlLock(input.runId, async () => {
|