@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/runtime-kernel.js
CHANGED
|
@@ -2990,13 +2990,21 @@ var GraphExecutor = class {
|
|
|
2990
2990
|
if (existing) {
|
|
2991
2991
|
throw new Error(`Graph checkpoint already exists: ${checkpointKey}`);
|
|
2992
2992
|
}
|
|
2993
|
-
this.
|
|
2993
|
+
const initialLocal = this.executionCheckpointPort ? {
|
|
2994
|
+
...local,
|
|
2995
|
+
executorLocal: {
|
|
2996
|
+
...isRecord4(local.executorLocal) ? local.executorLocal : {},
|
|
2997
|
+
stepCount: 0,
|
|
2998
|
+
maxSteps: options.maxSteps ?? this.config.maxSteps
|
|
2999
|
+
}
|
|
3000
|
+
} : local;
|
|
3001
|
+
this.ephemeralLocals.set(checkpointKey, { ...initialLocal });
|
|
2994
3002
|
await this.commitCheckpoint(checkpointKey, {
|
|
2995
3003
|
nodeId,
|
|
2996
3004
|
...this.executionCheckpointPort ? { executionStatus: "ready" } : {},
|
|
2997
3005
|
revision: 1,
|
|
2998
3006
|
schemaVersion: ENGINE_STATE_SCHEMA_VERSION,
|
|
2999
|
-
local: sanitizeCheckpointLocal(
|
|
3007
|
+
local: sanitizeCheckpointLocal(initialLocal)
|
|
3000
3008
|
});
|
|
3001
3009
|
return this.runUntilYieldQueued(
|
|
3002
3010
|
checkpointKey,
|
|
@@ -13297,7 +13305,7 @@ function createAwaitingUserWatcher(options) {
|
|
|
13297
13305
|
const onClose = () => {
|
|
13298
13306
|
dispose();
|
|
13299
13307
|
};
|
|
13300
|
-
eventBus.on("event", onEvent);
|
|
13308
|
+
if (options.stateOwner !== "host") eventBus.on("event", onEvent);
|
|
13301
13309
|
eventBus.on("close", onClose);
|
|
13302
13310
|
return dispose;
|
|
13303
13311
|
}
|
|
@@ -13773,6 +13781,7 @@ var DefaultRunSupervisor = class {
|
|
|
13773
13781
|
this.runSlotLimiter = createRunSlotLimiter({ maxActiveRuns: options.maxActiveRuns });
|
|
13774
13782
|
this.runConcurrencyKeys = createRunConcurrencyKeyRegistry();
|
|
13775
13783
|
this.awaitingUserWatcher = createAwaitingUserWatcher({
|
|
13784
|
+
stateOwner: options.awaitingUserStateOwner,
|
|
13776
13785
|
markAwaitingUser: (runId, patch) => this.getHandle(runId).markAwaitingUser(patch),
|
|
13777
13786
|
onDisposed: (runId) => {
|
|
13778
13787
|
this.eventWatchDisposers.delete(runId);
|
|
@@ -13969,8 +13978,17 @@ var DefaultRunSupervisor = class {
|
|
|
13969
13978
|
canRestoreRun: this.canRestoreRun
|
|
13970
13979
|
});
|
|
13971
13980
|
}
|
|
13972
|
-
async pause(runId, reason) {
|
|
13973
|
-
await this.withRunControlLock(runId, () =>
|
|
13981
|
+
async pause(runId, reason, expectedExecutionId) {
|
|
13982
|
+
await this.withRunControlLock(runId, async () => {
|
|
13983
|
+
const handle = this.getHandle(runId);
|
|
13984
|
+
if (expectedExecutionId !== void 0) {
|
|
13985
|
+
const record = await this.registryStore.load(runId);
|
|
13986
|
+
if (record?.metadata?.executionId !== expectedExecutionId) {
|
|
13987
|
+
throw new RunInteractionConflictError(runId, "pause execution ownership has changed");
|
|
13988
|
+
}
|
|
13989
|
+
}
|
|
13990
|
+
await handle.pause(reason);
|
|
13991
|
+
});
|
|
13974
13992
|
}
|
|
13975
13993
|
async resumePausedRun(input) {
|
|
13976
13994
|
return this.withRunControlLock(input.runId, async () => {
|