@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/testkit.cjs
CHANGED
|
@@ -3180,13 +3180,21 @@ var GraphExecutor = class {
|
|
|
3180
3180
|
if (existing) {
|
|
3181
3181
|
throw new Error(`Graph checkpoint already exists: ${checkpointKey}`);
|
|
3182
3182
|
}
|
|
3183
|
-
this.
|
|
3183
|
+
const initialLocal = this.executionCheckpointPort ? {
|
|
3184
|
+
...local,
|
|
3185
|
+
executorLocal: {
|
|
3186
|
+
...isRecord4(local.executorLocal) ? local.executorLocal : {},
|
|
3187
|
+
stepCount: 0,
|
|
3188
|
+
maxSteps: options.maxSteps ?? this.config.maxSteps
|
|
3189
|
+
}
|
|
3190
|
+
} : local;
|
|
3191
|
+
this.ephemeralLocals.set(checkpointKey, { ...initialLocal });
|
|
3184
3192
|
await this.commitCheckpoint(checkpointKey, {
|
|
3185
3193
|
nodeId,
|
|
3186
3194
|
...this.executionCheckpointPort ? { executionStatus: "ready" } : {},
|
|
3187
3195
|
revision: 1,
|
|
3188
3196
|
schemaVersion: ENGINE_STATE_SCHEMA_VERSION,
|
|
3189
|
-
local: sanitizeCheckpointLocal(
|
|
3197
|
+
local: sanitizeCheckpointLocal(initialLocal)
|
|
3190
3198
|
});
|
|
3191
3199
|
return this.runUntilYieldQueued(
|
|
3192
3200
|
checkpointKey,
|
|
@@ -13487,7 +13495,7 @@ function createAwaitingUserWatcher(options) {
|
|
|
13487
13495
|
const onClose = () => {
|
|
13488
13496
|
dispose();
|
|
13489
13497
|
};
|
|
13490
|
-
eventBus.on("event", onEvent);
|
|
13498
|
+
if (options.stateOwner !== "host") eventBus.on("event", onEvent);
|
|
13491
13499
|
eventBus.on("close", onClose);
|
|
13492
13500
|
return dispose;
|
|
13493
13501
|
}
|
|
@@ -13963,6 +13971,7 @@ var DefaultRunSupervisor = class {
|
|
|
13963
13971
|
this.runSlotLimiter = createRunSlotLimiter({ maxActiveRuns: options.maxActiveRuns });
|
|
13964
13972
|
this.runConcurrencyKeys = createRunConcurrencyKeyRegistry();
|
|
13965
13973
|
this.awaitingUserWatcher = createAwaitingUserWatcher({
|
|
13974
|
+
stateOwner: options.awaitingUserStateOwner,
|
|
13966
13975
|
markAwaitingUser: (runId, patch) => this.getHandle(runId).markAwaitingUser(patch),
|
|
13967
13976
|
onDisposed: (runId) => {
|
|
13968
13977
|
this.eventWatchDisposers.delete(runId);
|
|
@@ -14159,8 +14168,17 @@ var DefaultRunSupervisor = class {
|
|
|
14159
14168
|
canRestoreRun: this.canRestoreRun
|
|
14160
14169
|
});
|
|
14161
14170
|
}
|
|
14162
|
-
async pause(runId, reason) {
|
|
14163
|
-
await this.withRunControlLock(runId, () =>
|
|
14171
|
+
async pause(runId, reason, expectedExecutionId) {
|
|
14172
|
+
await this.withRunControlLock(runId, async () => {
|
|
14173
|
+
const handle = this.getHandle(runId);
|
|
14174
|
+
if (expectedExecutionId !== void 0) {
|
|
14175
|
+
const record = await this.registryStore.load(runId);
|
|
14176
|
+
if (record?.metadata?.executionId !== expectedExecutionId) {
|
|
14177
|
+
throw new RunInteractionConflictError(runId, "pause execution ownership has changed");
|
|
14178
|
+
}
|
|
14179
|
+
}
|
|
14180
|
+
await handle.pause(reason);
|
|
14181
|
+
});
|
|
14164
14182
|
}
|
|
14165
14183
|
async resumePausedRun(input) {
|
|
14166
14184
|
return this.withRunControlLock(input.runId, async () => {
|