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