@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/quickstart.cjs
CHANGED
|
@@ -3201,13 +3201,21 @@ var GraphExecutor = class {
|
|
|
3201
3201
|
if (existing) {
|
|
3202
3202
|
throw new Error(`Graph checkpoint already exists: ${checkpointKey}`);
|
|
3203
3203
|
}
|
|
3204
|
-
this.
|
|
3204
|
+
const initialLocal = this.executionCheckpointPort ? {
|
|
3205
|
+
...local,
|
|
3206
|
+
executorLocal: {
|
|
3207
|
+
...isRecord4(local.executorLocal) ? local.executorLocal : {},
|
|
3208
|
+
stepCount: 0,
|
|
3209
|
+
maxSteps: options.maxSteps ?? this.config.maxSteps
|
|
3210
|
+
}
|
|
3211
|
+
} : local;
|
|
3212
|
+
this.ephemeralLocals.set(checkpointKey, { ...initialLocal });
|
|
3205
3213
|
await this.commitCheckpoint(checkpointKey, {
|
|
3206
3214
|
nodeId,
|
|
3207
3215
|
...this.executionCheckpointPort ? { executionStatus: "ready" } : {},
|
|
3208
3216
|
revision: 1,
|
|
3209
3217
|
schemaVersion: ENGINE_STATE_SCHEMA_VERSION,
|
|
3210
|
-
local: sanitizeCheckpointLocal(
|
|
3218
|
+
local: sanitizeCheckpointLocal(initialLocal)
|
|
3211
3219
|
});
|
|
3212
3220
|
return this.runUntilYieldQueued(
|
|
3213
3221
|
checkpointKey,
|
|
@@ -12051,7 +12059,7 @@ function createAwaitingUserWatcher(options) {
|
|
|
12051
12059
|
const onClose = () => {
|
|
12052
12060
|
dispose();
|
|
12053
12061
|
};
|
|
12054
|
-
eventBus.on("event", onEvent);
|
|
12062
|
+
if (options.stateOwner !== "host") eventBus.on("event", onEvent);
|
|
12055
12063
|
eventBus.on("close", onClose);
|
|
12056
12064
|
return dispose;
|
|
12057
12065
|
}
|
|
@@ -12527,6 +12535,7 @@ var DefaultRunSupervisor = class {
|
|
|
12527
12535
|
this.runSlotLimiter = createRunSlotLimiter({ maxActiveRuns: options.maxActiveRuns });
|
|
12528
12536
|
this.runConcurrencyKeys = createRunConcurrencyKeyRegistry();
|
|
12529
12537
|
this.awaitingUserWatcher = createAwaitingUserWatcher({
|
|
12538
|
+
stateOwner: options.awaitingUserStateOwner,
|
|
12530
12539
|
markAwaitingUser: (runId, patch) => this.getHandle(runId).markAwaitingUser(patch),
|
|
12531
12540
|
onDisposed: (runId) => {
|
|
12532
12541
|
this.eventWatchDisposers.delete(runId);
|
|
@@ -12723,8 +12732,17 @@ var DefaultRunSupervisor = class {
|
|
|
12723
12732
|
canRestoreRun: this.canRestoreRun
|
|
12724
12733
|
});
|
|
12725
12734
|
}
|
|
12726
|
-
async pause(runId, reason) {
|
|
12727
|
-
await this.withRunControlLock(runId, () =>
|
|
12735
|
+
async pause(runId, reason, expectedExecutionId) {
|
|
12736
|
+
await this.withRunControlLock(runId, async () => {
|
|
12737
|
+
const handle = this.getHandle(runId);
|
|
12738
|
+
if (expectedExecutionId !== void 0) {
|
|
12739
|
+
const record = await this.registryStore.load(runId);
|
|
12740
|
+
if (record?.metadata?.executionId !== expectedExecutionId) {
|
|
12741
|
+
throw new RunInteractionConflictError(runId, "pause execution ownership has changed");
|
|
12742
|
+
}
|
|
12743
|
+
}
|
|
12744
|
+
await handle.pause(reason);
|
|
12745
|
+
});
|
|
12728
12746
|
}
|
|
12729
12747
|
async resumePausedRun(input) {
|
|
12730
12748
|
return this.withRunControlLock(input.runId, async () => {
|