@bastani/atomic 0.9.38-alpha.2 → 0.9.38-alpha.4
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 +35 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +24 -0
- package/dist/builtin/workflows/README.md +5 -10
- package/dist/builtin/workflows/builtin/adversarial-verification.js +2 -2
- package/dist/builtin/workflows/builtin/{chunk-94f8zfz1.js → chunk-454hz1qt.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-wf876n16.js → chunk-4bwtzyjq.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-kb7s3gx2.js → chunk-5eh0brtd.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-r97ndfvt.js → chunk-bjva9j5k.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-x6az1sxp.js → chunk-h5fn47y5.js} +1 -1
- package/dist/builtin/workflows/builtin/chunk-na3wpwzh.js +3115 -0
- package/dist/builtin/workflows/builtin/{chunk-nkj4qhj6.js → chunk-q7dx7kh7.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-a1ar035d.js → chunk-qdd897wm.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-gyjck9z8.js → chunk-qjqn389g.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-ad83gc5p.js → chunk-qrrkfg9v.js} +5 -12
- package/dist/builtin/workflows/builtin/{chunk-632fxeb8.js → chunk-x0vvjyzg.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-3n2bnz64.js → chunk-xg7kkgf8.js} +2 -2
- package/dist/builtin/workflows/builtin/classify-and-act.js +2 -2
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +2 -2
- package/dist/builtin/workflows/builtin/generate-and-filter.js +2 -2
- package/dist/builtin/workflows/builtin/goal.js +3 -3
- package/dist/builtin/workflows/builtin/index.js +11 -11
- package/dist/builtin/workflows/builtin/loop-until-done.js +2 -2
- package/dist/builtin/workflows/builtin/open-claude-design.js +2 -2
- package/dist/builtin/workflows/builtin/ralph.js +3 -3
- package/dist/builtin/workflows/builtin/tournament.js +2 -2
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/authoring.d.ts +8 -6
- package/dist/builtin/workflows/src/durable/journal/conformance.d.ts +4 -0
- package/dist/builtin/workflows/src/durable/journal/memory-run-journal.d.ts +27 -0
- package/dist/builtin/workflows/src/durable/journal/node-sqlite.d.ts +20 -0
- package/dist/builtin/workflows/src/durable/journal/resolution.d.ts +21 -0
- package/dist/builtin/workflows/src/durable/journal/sqlite-run-journal.d.ts +49 -0
- package/dist/builtin/workflows/src/durable/journal/types.d.ts +200 -0
- package/dist/builtin/workflows/src/durable/journal/values.d.ts +3 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +51916 -88191
- package/dist/builtin/workflows/src/index.js +9393 -45371
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +0 -6
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +4 -6
- package/dist/bun/split-loader.js +0 -13
- package/dist/bun/split-loader.js.map +1 -1
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +1 -0
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +4 -0
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-tree.d.ts.map +1 -1
- package/dist/core/agent-session-tree.js +1 -0
- package/dist/core/agent-session-tree.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +2 -0
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +2 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +6 -6
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction-runner.d.ts +1 -0
- package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
- package/dist/core/compaction/compaction-runner.js +4 -1
- package/dist/core/compaction/compaction-runner.js.map +1 -1
- package/dist/core/compaction/pi-summary-fallback.d.ts +2 -1
- package/dist/core/compaction/pi-summary-fallback.d.ts.map +1 -1
- package/dist/core/compaction/pi-summary-fallback.js +5 -5
- package/dist/core/compaction/pi-summary-fallback.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +2 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +32 -7
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +2 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +8 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/workflow-events.d.ts +2 -0
- package/dist/core/extensions/workflow-events.d.ts.map +1 -1
- package/dist/core/extensions/workflow-events.js.map +1 -1
- package/dist/core/extensions/workflow-run-control.d.ts +3 -3
- package/dist/core/extensions/workflow-run-control.d.ts.map +1 -1
- package/dist/core/extensions/workflow-run-control.js +4 -4
- package/dist/core/extensions/workflow-run-control.js.map +1 -1
- package/dist/core/model-resolver-defaults.js +4 -4
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/session-manager-archive.d.ts.map +1 -1
- package/dist/core/session-manager-archive.js +3 -8
- package/dist/core/session-manager-archive.js.map +1 -1
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +14 -20
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-list.d.ts.map +1 -1
- package/dist/core/session-manager-list.js +4 -13
- package/dist/core/session-manager-list.js.map +1 -1
- package/dist/core/session-manager-storage.d.ts +1 -0
- package/dist/core/session-manager-storage.d.ts.map +1 -1
- package/dist/core/session-manager-storage.js +49 -24
- package/dist/core/session-manager-storage.js.map +1 -1
- package/dist/core/session-manager-types.d.ts +2 -2
- package/dist/core/session-manager-types.d.ts.map +1 -1
- package/dist/core/session-manager-types.js +2 -1
- package/dist/core/session-manager-types.js.map +1 -1
- package/dist/core/session-manager-validation.d.ts +3 -0
- package/dist/core/session-manager-validation.d.ts.map +1 -1
- package/dist/core/session-manager-validation.js +16 -0
- package/dist/core/session-manager-validation.js.map +1 -1
- package/dist/core/session-manager.d.ts +1 -2
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +1 -2
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +4 -0
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +9 -0
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/storage/database.d.ts +21 -0
- package/dist/core/storage/database.d.ts.map +1 -0
- package/dist/core/storage/database.js +2 -0
- package/dist/core/storage/database.js.map +1 -0
- package/dist/core/storage/errors.d.ts +63 -0
- package/dist/core/storage/errors.d.ts.map +1 -0
- package/dist/core/storage/errors.js +103 -0
- package/dist/core/storage/errors.js.map +1 -0
- package/dist/core/storage/index.d.ts +6 -0
- package/dist/core/storage/index.d.ts.map +1 -0
- package/dist/core/storage/index.js +5 -0
- package/dist/core/storage/index.js.map +1 -0
- package/dist/core/storage/node-sqlite.d.ts +5 -0
- package/dist/core/storage/node-sqlite.d.ts.map +1 -0
- package/dist/core/storage/node-sqlite.js +161 -0
- package/dist/core/storage/node-sqlite.js.map +1 -0
- package/dist/core/storage/prefix.d.ts +5 -0
- package/dist/core/storage/prefix.d.ts.map +1 -0
- package/dist/core/storage/prefix.js +15 -0
- package/dist/core/storage/prefix.js.map +1 -0
- package/dist/core/storage/schema.d.ts +3 -0
- package/dist/core/storage/schema.d.ts.map +1 -0
- package/dist/core/storage/schema.js +6 -0
- package/dist/core/storage/schema.js.map +1 -0
- package/dist/core/storage/session/conformance.d.ts +12 -0
- package/dist/core/storage/session/conformance.d.ts.map +1 -0
- package/dist/core/storage/session/conformance.js +674 -0
- package/dist/core/storage/session/conformance.js.map +1 -0
- package/dist/core/storage/session/entry-structure.d.ts +4 -0
- package/dist/core/storage/session/entry-structure.d.ts.map +1 -0
- package/dist/core/storage/session/entry-structure.js +83 -0
- package/dist/core/storage/session/entry-structure.js.map +1 -0
- package/dist/core/storage/session/errors.d.ts +54 -0
- package/dist/core/storage/session/errors.d.ts.map +1 -0
- package/dist/core/storage/session/errors.js +95 -0
- package/dist/core/storage/session/errors.js.map +1 -0
- package/dist/core/storage/session/jsonl-session-store.d.ts +57 -0
- package/dist/core/storage/session/jsonl-session-store.d.ts.map +1 -0
- package/dist/core/storage/session/jsonl-session-store.js +482 -0
- package/dist/core/storage/session/jsonl-session-store.js.map +1 -0
- package/dist/core/storage/session/memory-session-store.d.ts +31 -0
- package/dist/core/storage/session/memory-session-store.d.ts.map +1 -0
- package/dist/core/storage/session/memory-session-store.js +113 -0
- package/dist/core/storage/session/memory-session-store.js.map +1 -0
- package/dist/core/storage/session/scratch-directory.d.ts +2 -0
- package/dist/core/storage/session/scratch-directory.d.ts.map +1 -0
- package/dist/core/storage/session/scratch-directory.js +5 -0
- package/dist/core/storage/session/scratch-directory.js.map +1 -0
- package/dist/core/storage/session/session-summary.d.ts +24 -0
- package/dist/core/storage/session/session-summary.d.ts.map +1 -0
- package/dist/core/storage/session/session-summary.js +79 -0
- package/dist/core/storage/session/session-summary.js.map +1 -0
- package/dist/core/storage/session/sql-session-store.d.ts +46 -0
- package/dist/core/storage/session/sql-session-store.d.ts.map +1 -0
- package/dist/core/storage/session/sql-session-store.js +227 -0
- package/dist/core/storage/session/sql-session-store.js.map +1 -0
- package/dist/core/storage/session/types.d.ts +68 -0
- package/dist/core/storage/session/types.d.ts.map +1 -0
- package/dist/core/storage/session/types.js +2 -0
- package/dist/core/storage/session/types.js.map +1 -0
- package/dist/core/storage/session/validation.d.ts +7 -0
- package/dist/core/storage/session/validation.d.ts.map +1 -0
- package/dist/core/storage/session/validation.js +47 -0
- package/dist/core/storage/session/validation.js.map +1 -0
- package/dist/core/storage/testing.d.ts +13 -0
- package/dist/core/storage/testing.d.ts.map +1 -0
- package/dist/core/storage/testing.js +264 -0
- package/dist/core/storage/testing.js.map +1 -0
- package/dist/index-extensions.d.ts +1 -1
- package/dist/index-extensions.d.ts.map +1 -1
- package/dist/index-extensions.js +1 -1
- package/dist/index-extensions.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.js +8 -4
- package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +5 -4
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +2 -1
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-queueing.js +8 -5
- package/dist/modes/interactive/interactive-queueing.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +6 -0
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-tui.d.ts +1 -0
- package/dist/modes/interactive/interactive-tui.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-tui.js +9 -2
- package/dist/modes/interactive/interactive-tui.js.map +1 -1
- package/dist/modes/interactive/program-status-reporter.d.ts +4 -0
- package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -1
- package/dist/modes/interactive/program-status-reporter.js +45 -6
- package/dist/modes/interactive/program-status-reporter.js.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +2 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js +9 -1
- package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
- package/dist/modes/interactive-engine/protocol.d.ts +4 -0
- package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
- package/dist/modes/interactive-engine/protocol.js +39 -1
- package/dist/modes/interactive-engine/protocol.js.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.js +10 -0
- package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
- package/docs/docs.json +1 -0
- package/docs/getting-started/installation.md +1 -2
- package/docs/json.md +1 -1
- package/docs/packages/authoring.md +1 -1
- package/docs/sdk/reference.md +1 -1
- package/docs/sdk/web-server.md +5 -5
- package/docs/sdk.md +11 -25
- package/docs/session-format.md +4 -10
- package/docs/settings.md +5 -29
- package/docs/storage.md +43 -0
- package/docs/workflows/api-reference.md +17 -55
- package/docs/workflows/authoring.md +2 -1
- package/docs/workflows/operations.md +31 -175
- package/docs/workflows/reliable-design.md +1 -1
- package/npm-shrinkwrap.json +32 -448
- package/package.json +13 -6
- package/schemas/settings.schema.json +27 -0
- package/dist/builtin/workflows/builtin/chunk-ymwq372z.js +0 -11609
- package/dist/core/session-manager-migrations.d.ts +0 -11
- package/dist/core/session-manager-migrations.d.ts.map +0 -1
- package/dist/core/session-manager-migrations.js +0 -80
- package/dist/core/session-manager-migrations.js.map +0 -1
|
@@ -76,7 +76,7 @@ function isWorkflowAuthoringImplementationFrame(filePath) {
|
|
|
76
76
|
const normalized = filePath.replace(/\\/g, "/");
|
|
77
77
|
if (!/\/authoring\/workflow\.[cm]?[jt]sx?$/.test(normalized))
|
|
78
78
|
return false;
|
|
79
|
-
return normalized.includes("/packages/workflows/") || normalized.includes("/
|
|
79
|
+
return normalized.includes("/packages/workflows/") || normalized.includes("/dist/builtin/workflows/") || normalized.includes("/.atomic/agent/extensions/workflows/");
|
|
80
80
|
}
|
|
81
81
|
function workflowNameFromCaller() {
|
|
82
82
|
const stack = new Error().stack;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
workflow,
|
|
3
3
|
withBuiltinContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-qjqn389g.js";
|
|
5
5
|
import {
|
|
6
6
|
keepContext,
|
|
7
7
|
REVIEWER_CALIBRATION_RULES,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
parseFailureDiagnostics,
|
|
38
38
|
summarizeReviewConvergence,
|
|
39
39
|
reverify_consolidated_batch
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-na3wpwzh.js";
|
|
41
41
|
import {
|
|
42
42
|
VERIFICATION_SCALE
|
|
43
43
|
} from "./chunk-n1910xc4.js";
|
|
@@ -431,17 +431,10 @@ async function readExistingGoalLedger(ledgerPath) {
|
|
|
431
431
|
return;
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function isLegacyCheckpointInterruption(diagnostic) {
|
|
435
435
|
const failure = diagnostic.replace(/^(?:Orchestrator failed before producing a receipt|Reviewer execution failed before producing a decision|Reviewer execution failed while resolving its reads contract): /u, "");
|
|
436
436
|
return [
|
|
437
|
-
"
|
|
438
|
-
"Workflow database checkpoint timed out",
|
|
439
|
-
"Workflow database ownership generation changed",
|
|
440
|
-
"Managed PostgreSQL did not answer a health check in time",
|
|
441
|
-
"Managed PostgreSQL failed its live health check",
|
|
442
|
-
"managed PostgreSQL health-check failed",
|
|
443
|
-
"durable checkpoint timeout",
|
|
444
|
-
"lost DB connection"
|
|
437
|
+
"durable checkpoint timeout"
|
|
445
438
|
].some((prefix) => failure === prefix || failure.startsWith(`${prefix}.`) || failure.startsWith(`${prefix}:`) || failure.startsWith(`${prefix} `));
|
|
446
439
|
}
|
|
447
440
|
function recoverLegacyExecutionInterruption(ledger) {
|
|
@@ -453,7 +446,7 @@ function recoverLegacyExecutionInterruption(ledger) {
|
|
|
453
446
|
const diagnostic = decision.diagnostics[0];
|
|
454
447
|
if (decision.diagnostics.length !== 1 || diagnostic === undefined)
|
|
455
448
|
return false;
|
|
456
|
-
if (!
|
|
449
|
+
if (!isLegacyCheckpointInterruption(diagnostic))
|
|
457
450
|
return false;
|
|
458
451
|
const turnReviews = ledger.reviews.filter((record) => record.turn >= decision.turn);
|
|
459
452
|
const turnReceipts = ledger.receipts.filter((record) => record.turn >= decision.turn);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
workflow,
|
|
3
3
|
withBuiltinContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-qjqn389g.js";
|
|
5
5
|
import {
|
|
6
6
|
keepContext,
|
|
7
7
|
REVIEWER_CALIBRATION_RULES,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
reviewerFailureText,
|
|
40
40
|
summarizeReviewConvergence,
|
|
41
41
|
reverify_consolidated_batch
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-na3wpwzh.js";
|
|
43
43
|
import {
|
|
44
44
|
fold_usage
|
|
45
45
|
} from "./chunk-tgt0s5e5.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_ACTION_CATEGORIES2,
|
|
3
3
|
classify_and_act_default
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import"./chunk-
|
|
4
|
+
} from "./chunk-bjva9j5k.js";
|
|
5
|
+
import"./chunk-qjqn389g.js";
|
|
6
6
|
import"./chunk-9cm2ckq2.js";
|
|
7
7
|
export {
|
|
8
8
|
DEFAULT_ACTION_CATEGORIES2 as DEFAULT_ACTION_CATEGORIES,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate_and_filter_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5eh0brtd.js";
|
|
4
4
|
import"./chunk-2377r57g.js";
|
|
5
5
|
import"./chunk-n1910xc4.js";
|
|
6
|
-
import"./chunk-
|
|
6
|
+
import"./chunk-qjqn389g.js";
|
|
7
7
|
import"./chunk-9cm2ckq2.js";
|
|
8
8
|
export {
|
|
9
9
|
generate_and_filter_default as default
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
goal_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import"./chunk-
|
|
3
|
+
} from "./chunk-qrrkfg9v.js";
|
|
4
|
+
import"./chunk-na3wpwzh.js";
|
|
5
5
|
import"./chunk-2377r57g.js";
|
|
6
6
|
import"./chunk-z0d03ktm.js";
|
|
7
7
|
import"./chunk-n1910xc4.js";
|
|
8
|
-
import"./chunk-
|
|
8
|
+
import"./chunk-qjqn389g.js";
|
|
9
9
|
import"./chunk-9cm2ckq2.js";
|
|
10
10
|
export {
|
|
11
11
|
goal_default as default
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-qjqn389g.js";
|
|
2
2
|
import"./chunk-9cm2ckq2.js";
|
|
3
3
|
import"./chunk-n1910xc4.js";
|
|
4
4
|
import"./chunk-2377r57g.js";
|
|
5
5
|
import {
|
|
6
6
|
adversarial_verification_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-qdd897wm.js";
|
|
8
8
|
import {
|
|
9
9
|
classify_and_act_default
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-bjva9j5k.js";
|
|
11
11
|
import {
|
|
12
12
|
fan_out_and_synthesize_default
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-x0vvjyzg.js";
|
|
14
14
|
import {
|
|
15
15
|
generate_and_filter_default
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5eh0brtd.js";
|
|
17
17
|
import {
|
|
18
18
|
goal_default
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import"./chunk-
|
|
19
|
+
} from "./chunk-qrrkfg9v.js";
|
|
20
|
+
import"./chunk-na3wpwzh.js";
|
|
21
21
|
import"./chunk-z0d03ktm.js";
|
|
22
22
|
import {
|
|
23
23
|
open_claude_design_default
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-q7dx7kh7.js";
|
|
25
25
|
import {
|
|
26
26
|
loop_until_done_default
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-454hz1qt.js";
|
|
28
28
|
import {
|
|
29
29
|
ralph_default
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-xg7kkgf8.js";
|
|
31
31
|
import {
|
|
32
32
|
tournament_default
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-4bwtzyjq.js";
|
|
34
34
|
export {
|
|
35
35
|
adversarial_verification_default as adversarialVerification,
|
|
36
36
|
classify_and_act_default as classifyAndAct,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loop_until_done_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-454hz1qt.js";
|
|
4
4
|
import"./chunk-z0d03ktm.js";
|
|
5
5
|
import"./chunk-n1910xc4.js";
|
|
6
|
-
import"./chunk-
|
|
6
|
+
import"./chunk-qjqn389g.js";
|
|
7
7
|
import"./chunk-9cm2ckq2.js";
|
|
8
8
|
export {
|
|
9
9
|
loop_until_done_default as default
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ralph_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import"./chunk-
|
|
3
|
+
} from "./chunk-xg7kkgf8.js";
|
|
4
|
+
import"./chunk-na3wpwzh.js";
|
|
5
5
|
import"./chunk-2377r57g.js";
|
|
6
6
|
import"./chunk-z0d03ktm.js";
|
|
7
7
|
import"./chunk-n1910xc4.js";
|
|
8
|
-
import"./chunk-
|
|
8
|
+
import"./chunk-qjqn389g.js";
|
|
9
9
|
import"./chunk-9cm2ckq2.js";
|
|
10
10
|
export {
|
|
11
11
|
ralph_default as default
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tournament_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4bwtzyjq.js";
|
|
4
4
|
import"./chunk-2377r57g.js";
|
|
5
5
|
import"./chunk-n1910xc4.js";
|
|
6
|
-
import"./chunk-
|
|
6
|
+
import"./chunk-qjqn389g.js";
|
|
7
7
|
import"./chunk-9cm2ckq2.js";
|
|
8
8
|
export {
|
|
9
9
|
tournament_default as default
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { CreateAgentSessionOptions } from "@bastani/atomic";
|
|
2
2
|
import type { TSchema } from "typebox";
|
|
3
3
|
export type { Static, TSchema } from "typebox";
|
|
4
|
+
export type { OpenRunJournal, RunJournalConformanceRunner } from "./durable/journal/conformance.js";
|
|
5
|
+
export { registerRunJournalConformance } from "./durable/journal/conformance.js";
|
|
6
|
+
export { MemoryRunJournal } from "./durable/journal/memory-run-journal.js";
|
|
7
|
+
export type { RunJournalOption, RunJournalSettings } from "./durable/journal/resolution.js";
|
|
8
|
+
export { resolveRunJournal } from "./durable/journal/resolution.js";
|
|
9
|
+
export { SqliteRunJournal } from "./durable/journal/sqlite-run-journal.js";
|
|
10
|
+
export * from "./durable/journal/types.js";
|
|
4
11
|
export type { AgentSessionAdapter, CompleteAdapter, CompleteStageOpts, EffectiveBudget, GitWorktreeSetupOptions, GitWorktreeSetupResult, PromptAdapter, PromptOptions, ResolvedInputs, RunResult, RunStatus, StageAdapters, StageContext, StageExecutionMeta, StageMcpOptions, StageOptions, StageOutputOptions, StagePromptOptions, StageSendUserMessageOptions, StageSessionCreateOptions, StageSessionCreateResult, StageSessionEvent, StageSessionRuntime, StageSnapshot, StageStatus, StageUserMessageContent, StageUserMessageDelivery, ToolNodeSnapshot, WorkflowAction, WorkflowArtifact, WorkflowBudget, WorkflowChainOptions, WorkflowChildResult, WorkflowContextMode, WorkflowControlEvent, WorkflowCustomToolDefinition, WorkflowCustomUiComponent, WorkflowCustomUiFactory, WorkflowCustomUiKeybindings, WorkflowCustomUiOptions, WorkflowCustomUiOverlayHandle, WorkflowCustomUiOverlayOptions, WorkflowCustomUiTheme, WorkflowCustomUiTui, WorkflowDetails, WorkflowDetailsMode, WorkflowDetailsStatus, WorkflowDurability, WorkflowExecutionMode, WorkflowExecutionPolicy, WorkflowExitOptions, WorkflowExitStatus, WorkflowInputBindings, WorkflowInputSchema, WorkflowInputSchemaMap, WorkflowInputValues, WorkflowIntercomSummary, WorkflowMaxOutput, WorkflowMcpPort, WorkflowModelAttempt, WorkflowModelCatalogPort, WorkflowModelFallbackFields, WorkflowModelInfo, WorkflowModelUsage, WorkflowModelValue, WorkflowOutputMode, WorkflowOutputSchema, WorkflowOutputSchemaMap, WorkflowOutputValues, WorkflowParallelOptions, WorkflowPersistencePort, WorkflowProgressSummary, WorkflowRunChildArgs, WorkflowRunChildOptions, WorkflowRunChildOptionsArgument, WorkflowRunOutput, WorkflowRuntimeConfig, WorkflowSerializableObject, WorkflowSerializablePrimitive, WorkflowSerializableValue, WorkflowSharedTaskDefaults, WorkflowTaskContext, WorkflowTaskContextInput, WorkflowTaskOptions, WorkflowTaskResult, WorkflowTaskSessionFields, WorkflowTaskSessionOptions, WorkflowTaskStep, WorkflowThinkingLevel, WorkflowToolContext, WorkflowToolError, WorkflowToolFailure, WorkflowToolOptions, WorkflowToolOutcome, WorkflowToolPrimitive, WorkflowToolReturnOptions, WorkflowToolSuccess, WorkflowToolThrowOptions, WorkflowUIAdapter, WorkflowUIContext, WorkflowWorktreeInputBinding, } from "./shared/authoring-contract.js";
|
|
5
12
|
import type * as AuthoringContract from "./shared/authoring-contract.js";
|
|
6
13
|
import type { AuthoredWorkflowSpec as SharedAuthoredWorkflowSpec, WorkflowInputsFromSchemas, WorkflowOutputsFromSchemas, WorkflowProvidedInputsFromSchemas } from "./shared/workflow-authoring-types.js";
|
|
@@ -47,11 +54,6 @@ export interface WorkflowRegistry {
|
|
|
47
54
|
names(): string[];
|
|
48
55
|
all(): AnyWorkflowDefinition[];
|
|
49
56
|
}
|
|
50
|
-
/**
|
|
51
|
-
* @deprecated Removed imperative workflow API. This runtime value only throws
|
|
52
|
-
* a migration error; author workflows with workflow({...}).
|
|
53
|
-
*/
|
|
54
|
-
export declare const runWorkflow: never;
|
|
55
57
|
export declare function workflow<const TInputs extends WorkflowInputSchemaMap = Record<never, never>, const TOutputs extends WorkflowOutputSchemaMap = WorkflowOutputSchemaMap, TActualOutputs extends WorkflowOutputsFromSchemas<TOutputs> = WorkflowOutputsFromSchemas<TOutputs>>(spec: AuthoredWorkflowSpec<TInputs, TOutputs, TActualOutputs>): AuthoredWorkflowDefinition<TInputs, TOutputs>;
|
|
56
58
|
/**
|
|
57
59
|
* Wrap prompt text so compaction protects it verbatim, regardless of the compression ratio.
|
|
@@ -128,7 +130,7 @@ export interface RunSnapshot {
|
|
|
128
130
|
readonly status: RunStatus;
|
|
129
131
|
readonly stages: readonly StageSnapshot[];
|
|
130
132
|
/** First-class durable ctx.tool nodes; populated by the runtime. */
|
|
131
|
-
readonly toolNodes
|
|
133
|
+
readonly toolNodes: readonly import("./shared/authoring-contract.js").ToolNodeSnapshot[];
|
|
132
134
|
readonly startedAt: number;
|
|
133
135
|
readonly endedAt?: number;
|
|
134
136
|
readonly durationMs?: number;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type RunJournal } from "./types.js";
|
|
2
|
+
export type RunJournalConformanceRunner = (name: string, body: () => Promise<void>) => void;
|
|
3
|
+
export type OpenRunJournal = () => RunJournal | Promise<RunJournal>;
|
|
4
|
+
export declare function registerRunJournalConformance(runner: RunJournalConformanceRunner, name: string, open: OpenRunJournal): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type AppendOutcome, type JournalEntry, type Lease, type LeaseOutcome, type RunEvent, type RunHeader, type RunJournal, type RunSummary } from "./types.js";
|
|
2
|
+
export declare class MemoryRunJournal implements RunJournal {
|
|
3
|
+
private readonly runs;
|
|
4
|
+
private readonly leases;
|
|
5
|
+
private closed;
|
|
6
|
+
private ensureOpen;
|
|
7
|
+
createRun(header: RunHeader): Promise<"created" | "exists">;
|
|
8
|
+
listRuns(filter?: {
|
|
9
|
+
cwd?: string;
|
|
10
|
+
}): Promise<readonly RunSummary[]>;
|
|
11
|
+
private requireRun;
|
|
12
|
+
private grant;
|
|
13
|
+
acquire(runId: string, holderId: string): Promise<LeaseOutcome>;
|
|
14
|
+
takeover(runId: string, holderId: string, expectedHolder: string): Promise<LeaseOutcome>;
|
|
15
|
+
private checkLease;
|
|
16
|
+
renew(lease: Lease): Promise<void>;
|
|
17
|
+
release(lease: Lease): Promise<void>;
|
|
18
|
+
append(lease: Lease, event: RunEvent, options?: {
|
|
19
|
+
key?: string;
|
|
20
|
+
expectSeq?: number;
|
|
21
|
+
}): Promise<AppendOutcome>;
|
|
22
|
+
private copyEntry;
|
|
23
|
+
read(runId: string, fromSeq?: number): AsyncIterable<JournalEntry>;
|
|
24
|
+
readKey(runId: string, key: string): Promise<JournalEntry | undefined>;
|
|
25
|
+
deleteRun(runId: string): Promise<void>;
|
|
26
|
+
close(): Promise<void>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DatabaseSync } from "node:sqlite";
|
|
2
|
+
export type SqliteValue = string | number | null;
|
|
3
|
+
export type SqliteStoredValue = string | number | bigint | Uint8Array | null;
|
|
4
|
+
export declare function journalCounter(runId: string, field: "seq" | "epoch", value: number | bigint, reason?: "overflow" | "unsafe-integer"): number;
|
|
5
|
+
export declare function storageBoundary<T>(path: string, operation: () => T): T;
|
|
6
|
+
export declare class JournalDatabase {
|
|
7
|
+
private readonly database;
|
|
8
|
+
private readonly ownsDatabase;
|
|
9
|
+
readonly path: string;
|
|
10
|
+
constructor(source: string | DatabaseSync);
|
|
11
|
+
exec(sql: string): void;
|
|
12
|
+
get<Row>(sql: string, ...values: SqliteValue[]): Row | undefined;
|
|
13
|
+
all<Row>(sql: string, ...values: SqliteValue[]): Row[];
|
|
14
|
+
getWide<Row>(sql: string, ...values: SqliteValue[]): Row | undefined;
|
|
15
|
+
getCounters<Row>(runId: string, sql: string, ...values: SqliteValue[]): Row | undefined;
|
|
16
|
+
allCounters<Row>(runId: string, sql: string, ...values: SqliteValue[]): Row[];
|
|
17
|
+
run(sql: string, ...values: SqliteValue[]): number;
|
|
18
|
+
transaction<T>(operation: () => T): T;
|
|
19
|
+
close(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DatabaseSync } from "node:sqlite";
|
|
2
|
+
import { type RunJournal } from "./types.js";
|
|
3
|
+
export type RunJournalOption = {
|
|
4
|
+
path: string;
|
|
5
|
+
} | {
|
|
6
|
+
database: DatabaseSync;
|
|
7
|
+
} | {
|
|
8
|
+
memory: true;
|
|
9
|
+
} | RunJournal;
|
|
10
|
+
export interface RunJournalSettings {
|
|
11
|
+
workflows?: string[] | {
|
|
12
|
+
journal?: {
|
|
13
|
+
path?: string;
|
|
14
|
+
memory?: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare function resolveRunJournal(options?: {
|
|
19
|
+
journal?: RunJournalOption;
|
|
20
|
+
settings?: RunJournalSettings;
|
|
21
|
+
}): RunJournal;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { DatabaseSync } from "node:sqlite";
|
|
2
|
+
import { type AppendOutcome, type JournalEntry, type Lease, type LeaseOutcome, type RunEvent, type RunHeader, type RunJournal, type RunSummary, type SynchronousRunJournal } from "./types.js";
|
|
3
|
+
export declare const JOURNAL_READ_PAGE_SIZE = 256;
|
|
4
|
+
export declare function workflowJournalPath(): string;
|
|
5
|
+
export declare class SqliteRunJournal implements RunJournal, SynchronousRunJournal {
|
|
6
|
+
private readonly db;
|
|
7
|
+
private closed;
|
|
8
|
+
readonly path: string;
|
|
9
|
+
constructor(source?: string | DatabaseSync);
|
|
10
|
+
createRun(header: RunHeader): Promise<"created" | "exists">;
|
|
11
|
+
createRunSync(header: RunHeader): "created" | "exists";
|
|
12
|
+
listRuns(filter?: {
|
|
13
|
+
cwd?: string;
|
|
14
|
+
}): Promise<readonly RunSummary[]>;
|
|
15
|
+
listRunsSync(filter?: {
|
|
16
|
+
cwd?: string;
|
|
17
|
+
}): readonly RunSummary[];
|
|
18
|
+
private requireRun;
|
|
19
|
+
private leaseRow;
|
|
20
|
+
private grant;
|
|
21
|
+
acquire(runId: string, holderId: string): Promise<LeaseOutcome>;
|
|
22
|
+
acquireSync(runId: string, holderId: string): LeaseOutcome;
|
|
23
|
+
takeover(runId: string, holderId: string, expectedHolder: string): Promise<LeaseOutcome>;
|
|
24
|
+
leaseState(runId: string): (Lease & {
|
|
25
|
+
readonly renewedAt: number;
|
|
26
|
+
}) | undefined;
|
|
27
|
+
takeoverExpiredSync(runId: string, holderId: string, expiredBefore: number): LeaseOutcome;
|
|
28
|
+
private checkLease;
|
|
29
|
+
renew(lease: Lease): Promise<void>;
|
|
30
|
+
renewSync(lease: Lease): void;
|
|
31
|
+
release(lease: Lease): Promise<void>;
|
|
32
|
+
releaseSync(lease: Lease): void;
|
|
33
|
+
append(lease: Lease, event: RunEvent, options?: {
|
|
34
|
+
key?: string;
|
|
35
|
+
expectSeq?: number;
|
|
36
|
+
}): Promise<AppendOutcome>;
|
|
37
|
+
appendSync(lease: Lease, event: RunEvent, options?: {
|
|
38
|
+
key?: string;
|
|
39
|
+
expectSeq?: number;
|
|
40
|
+
}): AppendOutcome;
|
|
41
|
+
read(runId: string, fromSeq?: number): AsyncIterable<JournalEntry>;
|
|
42
|
+
readEntries(runId: string, fromSeq?: number): readonly JournalEntry[];
|
|
43
|
+
readKey(runId: string, key: string): Promise<JournalEntry | undefined>;
|
|
44
|
+
deleteRun(runId: string): Promise<void>;
|
|
45
|
+
deleteRunSync(runId: string): void;
|
|
46
|
+
deleteOwnedRunSync(lease: Lease, expectSeq?: number): void;
|
|
47
|
+
private deleteRunData;
|
|
48
|
+
close(): Promise<void>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import type { WorkflowSerializableValue } from "../../shared/authoring-contract-stage.js";
|
|
2
|
+
export declare const JOURNAL_SCHEMA_VERSION = 1;
|
|
3
|
+
export type JournalSchemaVersion = typeof JOURNAL_SCHEMA_VERSION;
|
|
4
|
+
export declare const JOURNAL_PAYLOAD_ENCODING = "json-text";
|
|
5
|
+
export type JournalPayloadEncoding = typeof JOURNAL_PAYLOAD_ENCODING;
|
|
6
|
+
export declare const JOURNAL_TABLES: {
|
|
7
|
+
readonly meta: "meta";
|
|
8
|
+
readonly runs: "runs";
|
|
9
|
+
readonly events: "events";
|
|
10
|
+
readonly leases: "leases";
|
|
11
|
+
};
|
|
12
|
+
export type JournalTable = (typeof JOURNAL_TABLES)[keyof typeof JOURNAL_TABLES];
|
|
13
|
+
export declare const JOURNAL_COLUMNS: {
|
|
14
|
+
readonly schemaVersion: "schema_version";
|
|
15
|
+
readonly runId: "run_id";
|
|
16
|
+
readonly name: "name";
|
|
17
|
+
readonly cwd: "cwd";
|
|
18
|
+
readonly createdAt: "created_at";
|
|
19
|
+
readonly status: "status";
|
|
20
|
+
readonly headerJson: "header_json";
|
|
21
|
+
readonly seq: "seq";
|
|
22
|
+
readonly epoch: "epoch";
|
|
23
|
+
readonly key: "key";
|
|
24
|
+
readonly type: "type";
|
|
25
|
+
readonly payload: "payload";
|
|
26
|
+
readonly at: "at";
|
|
27
|
+
readonly holderId: "holder_id";
|
|
28
|
+
readonly renewedAt: "renewed_at";
|
|
29
|
+
};
|
|
30
|
+
export type JournalColumn = (typeof JOURNAL_COLUMNS)[keyof typeof JOURNAL_COLUMNS];
|
|
31
|
+
export declare const JOURNAL_LEASE: {
|
|
32
|
+
readonly initialEpoch: 1;
|
|
33
|
+
readonly epochIncrement: 1;
|
|
34
|
+
readonly unheld: null;
|
|
35
|
+
readonly absentEpoch: 0;
|
|
36
|
+
};
|
|
37
|
+
export type JournalLeaseSemantics = typeof JOURNAL_LEASE;
|
|
38
|
+
export declare const RUN_EVENT_TYPES: {
|
|
39
|
+
readonly runStarted: "RunStarted";
|
|
40
|
+
readonly runFinished: "RunFinished";
|
|
41
|
+
readonly statusChanged: "StatusChanged";
|
|
42
|
+
readonly checkpointRecorded: "CheckpointRecorded";
|
|
43
|
+
readonly promptAsked: "PromptAsked";
|
|
44
|
+
readonly promptReleased: "PromptReleased";
|
|
45
|
+
readonly controlRequested: "ControlRequested";
|
|
46
|
+
readonly messageQueued: "MessageQueued";
|
|
47
|
+
readonly messageDelivered: "MessageDelivered";
|
|
48
|
+
readonly messageSettled: "MessageSettled";
|
|
49
|
+
readonly timerScheduled: "TimerScheduled";
|
|
50
|
+
readonly summaryRecorded: "SummaryRecorded";
|
|
51
|
+
};
|
|
52
|
+
export type RunEventType = (typeof RUN_EVENT_TYPES)[keyof typeof RUN_EVENT_TYPES];
|
|
53
|
+
export interface RunHeader {
|
|
54
|
+
readonly runId: string;
|
|
55
|
+
readonly name: string;
|
|
56
|
+
readonly cwd: string;
|
|
57
|
+
readonly createdAt: number;
|
|
58
|
+
readonly status: string;
|
|
59
|
+
readonly inputs?: WorkflowSerializableValue;
|
|
60
|
+
}
|
|
61
|
+
export type RunSummary = RunHeader;
|
|
62
|
+
type EventOf<Type extends string, Payload = WorkflowSerializableValue> = {
|
|
63
|
+
readonly type: Type;
|
|
64
|
+
readonly payload: Payload;
|
|
65
|
+
};
|
|
66
|
+
export type RunEvent = EventOf<typeof RUN_EVENT_TYPES.runStarted | typeof RUN_EVENT_TYPES.runFinished> | EventOf<typeof RUN_EVENT_TYPES.statusChanged, {
|
|
67
|
+
readonly status: string;
|
|
68
|
+
readonly [key: string]: WorkflowSerializableValue;
|
|
69
|
+
}> | EventOf<typeof RUN_EVENT_TYPES.checkpointRecorded, {
|
|
70
|
+
readonly kind: "tool" | "ui" | "stage" | "task" | "boundary";
|
|
71
|
+
readonly [key: string]: WorkflowSerializableValue;
|
|
72
|
+
}> | EventOf<typeof RUN_EVENT_TYPES.promptAsked | typeof RUN_EVENT_TYPES.promptReleased | typeof RUN_EVENT_TYPES.controlRequested> | EventOf<typeof RUN_EVENT_TYPES.messageQueued | typeof RUN_EVENT_TYPES.messageDelivered | typeof RUN_EVENT_TYPES.messageSettled | typeof RUN_EVENT_TYPES.timerScheduled | typeof RUN_EVENT_TYPES.summaryRecorded>;
|
|
73
|
+
export interface Lease {
|
|
74
|
+
readonly runId: string;
|
|
75
|
+
readonly holderId: string;
|
|
76
|
+
readonly epoch: number;
|
|
77
|
+
}
|
|
78
|
+
export type LeaseOutcome = {
|
|
79
|
+
readonly status: "acquired";
|
|
80
|
+
readonly lease: Lease;
|
|
81
|
+
} | {
|
|
82
|
+
readonly status: "held";
|
|
83
|
+
readonly holderId: string | null;
|
|
84
|
+
readonly epoch: number;
|
|
85
|
+
};
|
|
86
|
+
export interface JournalEntry {
|
|
87
|
+
readonly runId: string;
|
|
88
|
+
readonly seq: number;
|
|
89
|
+
readonly epoch: number;
|
|
90
|
+
readonly key?: string;
|
|
91
|
+
readonly event: RunEvent;
|
|
92
|
+
readonly at: number;
|
|
93
|
+
}
|
|
94
|
+
export interface JournalLeaseRow {
|
|
95
|
+
[JOURNAL_COLUMNS.holderId]: string | null;
|
|
96
|
+
[JOURNAL_COLUMNS.epoch]: number;
|
|
97
|
+
}
|
|
98
|
+
export interface JournalEventRow {
|
|
99
|
+
[JOURNAL_COLUMNS.runId]: string;
|
|
100
|
+
[JOURNAL_COLUMNS.seq]: number;
|
|
101
|
+
[JOURNAL_COLUMNS.epoch]: number;
|
|
102
|
+
[JOURNAL_COLUMNS.key]: string | null;
|
|
103
|
+
[JOURNAL_COLUMNS.type]: RunEventType;
|
|
104
|
+
[JOURNAL_COLUMNS.payload]: string;
|
|
105
|
+
[JOURNAL_COLUMNS.at]: number;
|
|
106
|
+
}
|
|
107
|
+
export type AppendOutcome = {
|
|
108
|
+
readonly status: "appended" | "exists";
|
|
109
|
+
readonly entry: JournalEntry;
|
|
110
|
+
};
|
|
111
|
+
export interface RunJournal {
|
|
112
|
+
createRun(header: RunHeader): Promise<"created" | "exists">;
|
|
113
|
+
listRuns(filter?: {
|
|
114
|
+
cwd?: string;
|
|
115
|
+
}): Promise<readonly RunSummary[]>;
|
|
116
|
+
acquire(runId: string, holderId: string): Promise<LeaseOutcome>;
|
|
117
|
+
takeover(runId: string, holderId: string, expectedHolder: string): Promise<LeaseOutcome>;
|
|
118
|
+
renew(lease: Lease): Promise<void>;
|
|
119
|
+
release(lease: Lease): Promise<void>;
|
|
120
|
+
append(lease: Lease, event: RunEvent, options?: {
|
|
121
|
+
key?: string;
|
|
122
|
+
expectSeq?: number;
|
|
123
|
+
}): Promise<AppendOutcome>;
|
|
124
|
+
read(runId: string, fromSeq?: number): AsyncIterable<JournalEntry>;
|
|
125
|
+
readKey(runId: string, key: string): Promise<JournalEntry | undefined>;
|
|
126
|
+
deleteRun(runId: string): Promise<void>;
|
|
127
|
+
close(): Promise<void>;
|
|
128
|
+
}
|
|
129
|
+
export interface SynchronousRunJournal {
|
|
130
|
+
createRunSync(header: RunHeader): "created" | "exists";
|
|
131
|
+
listRunsSync(filter?: {
|
|
132
|
+
cwd?: string;
|
|
133
|
+
}): readonly RunSummary[];
|
|
134
|
+
acquireSync(runId: string, holderId: string): LeaseOutcome;
|
|
135
|
+
takeoverExpiredSync(runId: string, holderId: string, expiredBefore: number): LeaseOutcome;
|
|
136
|
+
leaseState(runId: string): (Lease & {
|
|
137
|
+
readonly renewedAt: number;
|
|
138
|
+
}) | undefined;
|
|
139
|
+
renewSync(lease: Lease): void;
|
|
140
|
+
releaseSync(lease: Lease): void;
|
|
141
|
+
appendSync(lease: Lease, event: RunEvent, options?: {
|
|
142
|
+
key?: string;
|
|
143
|
+
expectSeq?: number;
|
|
144
|
+
}): AppendOutcome;
|
|
145
|
+
readEntries(runId: string, fromSeq?: number): readonly JournalEntry[];
|
|
146
|
+
deleteRunSync(runId: string): void;
|
|
147
|
+
deleteOwnedRunSync(lease: Lease, expectSeq?: number): void;
|
|
148
|
+
}
|
|
149
|
+
export declare class JournalError extends Error {
|
|
150
|
+
}
|
|
151
|
+
export declare class JournalConfigurationError extends JournalError {
|
|
152
|
+
readonly source: "settings";
|
|
153
|
+
readonly setting: "workflows.journal";
|
|
154
|
+
readonly reason: "path-and-memory";
|
|
155
|
+
constructor(source: "settings", setting: "workflows.journal", reason: "path-and-memory");
|
|
156
|
+
}
|
|
157
|
+
export declare class JournalInvalidTextError extends JournalError {
|
|
158
|
+
readonly field: "runId" | "holderId" | "expectedHolder" | "key" | "status" | "name" | "cwd";
|
|
159
|
+
readonly reason: "nul-character" | "ill-formed-unicode";
|
|
160
|
+
constructor(field: JournalInvalidTextError["field"], reason: JournalInvalidTextError["reason"]);
|
|
161
|
+
}
|
|
162
|
+
export declare class JournalMetaCorruptError extends JournalError {
|
|
163
|
+
readonly path: string;
|
|
164
|
+
readonly rowCount: number;
|
|
165
|
+
constructor(path: string, rowCount: number);
|
|
166
|
+
}
|
|
167
|
+
export declare class JournalCounterRangeError extends JournalError {
|
|
168
|
+
readonly runId: string;
|
|
169
|
+
readonly field: "seq" | "epoch";
|
|
170
|
+
readonly value: number;
|
|
171
|
+
readonly reason: "overflow" | "negative" | "unsafe-integer";
|
|
172
|
+
constructor(runId: string, field: JournalCounterRangeError["field"], value: number, reason: JournalCounterRangeError["reason"]);
|
|
173
|
+
}
|
|
174
|
+
export declare class StaleLeaseError extends JournalError {
|
|
175
|
+
readonly runId: string;
|
|
176
|
+
readonly heldEpoch: number;
|
|
177
|
+
readonly currentEpoch: number;
|
|
178
|
+
constructor(runId: string, heldEpoch: number, currentEpoch: number);
|
|
179
|
+
}
|
|
180
|
+
export declare class JournalCasConflictError extends JournalError {
|
|
181
|
+
readonly runId: string;
|
|
182
|
+
readonly expectedSeq: number;
|
|
183
|
+
readonly actualSeq: number;
|
|
184
|
+
constructor(runId: string, expectedSeq: number, actualSeq: number);
|
|
185
|
+
}
|
|
186
|
+
export declare class JournalSchemaVersionError extends JournalError {
|
|
187
|
+
readonly found: number | bigint | string | Uint8Array | null;
|
|
188
|
+
readonly supported: number;
|
|
189
|
+
constructor(found: JournalSchemaVersionError["found"], supported?: number);
|
|
190
|
+
}
|
|
191
|
+
export declare class RunNotFoundError extends JournalError {
|
|
192
|
+
readonly runId: string;
|
|
193
|
+
constructor(runId: string);
|
|
194
|
+
}
|
|
195
|
+
export declare class StorageUnavailableError extends JournalError {
|
|
196
|
+
readonly path: string;
|
|
197
|
+
readonly cause: Error;
|
|
198
|
+
constructor(path: string, cause: Error);
|
|
199
|
+
}
|
|
200
|
+
export {};
|