@bastani/atomic 0.9.40 → 0.9.41-alpha.2
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 +75 -0
- package/README.md +1 -1
- package/dist/builtin/intercom/CHANGELOG.md +12 -0
- package/dist/builtin/intercom/README.md +1 -1
- package/dist/builtin/intercom/broker/broker.ts +24 -21
- package/dist/builtin/intercom/broker/client.ts +97 -6
- package/dist/builtin/intercom/broker/list-reply.ts +53 -0
- package/dist/builtin/intercom/index.bundle.mjs +278 -46
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/intercom/recoverable-disconnect.ts +27 -1
- package/dist/builtin/intercom/types.ts +8 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +14 -0
- package/dist/builtin/subagents/README.md +14 -0
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +99 -19
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +33 -0
- package/dist/builtin/workflows/README.md +2 -0
- package/dist/builtin/workflows/builtin/adversarial-verification.js +2 -2
- package/dist/builtin/workflows/builtin/{chunk-qjqn389g.js → chunk-2jfst7e4.js} +72 -10
- package/dist/builtin/workflows/builtin/{chunk-4bwtzyjq.js → chunk-49kkbdpr.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-qdd897wm.js → chunk-apagcs4r.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-454hz1qt.js → chunk-dcxscfnb.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-bjva9j5k.js → chunk-hx8v4p97.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-85mx6wcf.js → chunk-k5q3t7je.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-8kkv04hz.js → chunk-n2gkzkty.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-y45tkftg.js → chunk-txbc93t6.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-x0vvjyzg.js → chunk-w4xp1w1f.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-5eh0brtd.js → chunk-z3pajrfs.js} +1 -1
- 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 +2 -2
- package/dist/builtin/workflows/builtin/index.js +10 -10
- 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 +2 -2
- package/dist/builtin/workflows/builtin/tournament.js +2 -2
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/src/authoring.d.ts +1 -1
- package/dist/builtin/workflows/src/durable/journal/internal.d.ts +16 -0
- package/dist/builtin/workflows/src/durable/journal/legacy-journal-tables.d.ts +9 -0
- package/dist/builtin/workflows/src/durable/journal/sql-run-journal.d.ts +6 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +950 -116
- package/dist/builtin/workflows/src/index.js +806 -131
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +17 -1
- package/dist/cli/credential-print.d.ts.map +1 -1
- package/dist/cli/credential-print.js +1 -1
- package/dist/cli/credential-print.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts +2 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +33 -18
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +2 -1
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +114 -21
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +6 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-state.d.ts +19 -1
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js +41 -6
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/auth-storage-backends.d.ts +3 -1
- package/dist/core/auth-storage-backends.d.ts.map +1 -1
- package/dist/core/auth-storage-backends.js +79 -12
- package/dist/core/auth-storage-backends.js.map +1 -1
- package/dist/core/client-identity.d.ts +8 -0
- package/dist/core/client-identity.d.ts.map +1 -0
- package/dist/core/client-identity.js +16 -0
- package/dist/core/client-identity.js.map +1 -0
- package/dist/core/compaction/planner-outcome.d.ts.map +1 -1
- package/dist/core/compaction/planner-outcome.js +2 -1
- package/dist/core/compaction/planner-outcome.js.map +1 -1
- package/dist/core/execution-model-router.d.ts +18 -0
- package/dist/core/execution-model-router.d.ts.map +1 -1
- package/dist/core/execution-model-router.js +14 -8
- package/dist/core/execution-model-router.js.map +1 -1
- package/dist/core/extension-oauth-refresh-rejection.d.ts +12 -0
- package/dist/core/extension-oauth-refresh-rejection.d.ts.map +1 -0
- package/dist/core/extension-oauth-refresh-rejection.js +70 -0
- package/dist/core/extension-oauth-refresh-rejection.js.map +1 -0
- package/dist/core/extension-startup-failure.d.ts +30 -0
- package/dist/core/extension-startup-failure.d.ts.map +1 -0
- package/dist/core/extension-startup-failure.js +62 -0
- package/dist/core/extension-startup-failure.js.map +1 -0
- package/dist/core/extensions/context-types.d.ts +2 -0
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/provider-types.d.ts +2 -0
- package/dist/core/extensions/provider-types.d.ts.map +1 -1
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts +1 -0
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js +8 -0
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +3 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +1 -0
- package/dist/core/extensions/runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/extensions/workflow-run-control-hub.d.ts +1 -0
- package/dist/core/extensions/workflow-run-control-hub.d.ts.map +1 -1
- package/dist/core/extensions/workflow-run-control-hub.js +3 -0
- package/dist/core/extensions/workflow-run-control-hub.js.map +1 -1
- package/dist/core/extensions/workflow-run-control.d.ts +8 -0
- package/dist/core/extensions/workflow-run-control.d.ts.map +1 -1
- package/dist/core/extensions/workflow-run-control.js.map +1 -1
- package/dist/core/model-config.d.ts +28 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-fallback-failures.d.ts.map +1 -1
- package/dist/core/model-fallback-failures.js +12 -0
- package/dist/core/model-fallback-failures.js.map +1 -1
- package/dist/core/model-resolver-defaults.js +1 -1
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/model-runtime-streaming.d.ts.map +1 -1
- package/dist/core/model-runtime-streaming.js +9 -3
- package/dist/core/model-runtime-streaming.js.map +1 -1
- package/dist/core/model-runtime.d.ts +5 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +6 -0
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/provider-composer-internal.d.ts +8 -6
- package/dist/core/provider-composer-internal.d.ts.map +1 -1
- package/dist/core/provider-composer-internal.js +21 -8
- package/dist/core/provider-composer-internal.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +12 -4
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/storage/session/sql-session-store.d.ts +35 -0
- package/dist/core/storage/session/sql-session-store.d.ts.map +1 -1
- package/dist/core/storage/session/sql-session-store.js +158 -42
- package/dist/core/storage/session/sql-session-store.js.map +1 -1
- package/dist/core/structured-output/deadline.d.ts +40 -0
- package/dist/core/structured-output/deadline.d.ts.map +1 -0
- package/dist/core/structured-output/deadline.js +110 -0
- package/dist/core/structured-output/deadline.js.map +1 -0
- package/dist/core/structured-output/index.d.ts.map +1 -1
- package/dist/core/structured-output/index.js +103 -47
- package/dist/core/structured-output/index.js.map +1 -1
- package/dist/core/structured-output/rejection-detail.d.ts +9 -0
- package/dist/core/structured-output/rejection-detail.d.ts.map +1 -0
- package/dist/core/structured-output/rejection-detail.js +129 -0
- package/dist/core/structured-output/rejection-detail.js.map +1 -0
- package/dist/core/structured-output/types.d.ts +8 -1
- package/dist/core/structured-output/types.d.ts.map +1 -1
- package/dist/core/structured-output/types.js.map +1 -1
- package/dist/core/tasks/completion.d.ts +7 -1
- package/dist/core/tasks/completion.d.ts.map +1 -1
- package/dist/core/tasks/completion.js +28 -6
- package/dist/core/tasks/completion.js.map +1 -1
- package/dist/core/tasks/contracts.d.ts +6 -1
- package/dist/core/tasks/contracts.d.ts.map +1 -1
- package/dist/core/tasks/contracts.js.map +1 -1
- package/dist/core/tasks/pause.d.ts +2 -1
- package/dist/core/tasks/pause.d.ts.map +1 -1
- package/dist/core/tasks/pause.js +3 -2
- package/dist/core/tasks/pause.js.map +1 -1
- package/dist/core/tools/bash-pty-native.d.ts.map +1 -1
- package/dist/core/tools/bash-pty-native.js +10 -5
- package/dist/core/tools/bash-pty-native.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +16 -32
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/grep.js +1 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/kill.d.ts.map +1 -1
- package/dist/core/tools/kill.js +17 -3
- package/dist/core/tools/kill.js.map +1 -1
- package/dist/core/tools/shell-task-render.d.ts +55 -0
- package/dist/core/tools/shell-task-render.d.ts.map +1 -0
- package/dist/core/tools/shell-task-render.js +123 -0
- package/dist/core/tools/shell-task-render.js.map +1 -0
- package/dist/core/tools/shell-task-status.d.ts +52 -0
- package/dist/core/tools/shell-task-status.d.ts.map +1 -0
- package/dist/core/tools/shell-task-status.js +184 -0
- package/dist/core/tools/shell-task-status.js.map +1 -0
- package/dist/core/tools/structured-output.d.ts +5 -0
- package/dist/core/tools/structured-output.d.ts.map +1 -1
- package/dist/core/tools/structured-output.js +3 -0
- package/dist/core/tools/structured-output.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +134 -57
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/mcp/config.d.ts.map +1 -1
- package/dist/extensions/mcp/config.js +3 -2
- package/dist/extensions/mcp/config.js.map +1 -1
- package/dist/index-extensions.d.ts +1 -0
- package/dist/index-extensions.d.ts.map +1 -1
- package/dist/index-extensions.js +3 -0
- package/dist/index-extensions.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +19 -6
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/task-row.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-row.js +11 -1
- package/dist/modes/interactive/components/task-row.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.js +12 -10
- package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-custom-ui.js +20 -30
- package/dist/modes/interactive/interactive-extension-custom-ui.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-dialogs.js +23 -96
- package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +7 -8
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +27 -4
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +20 -10
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +40 -5
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +2 -4
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.d.ts +4 -1
- package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.js.map +1 -1
- package/dist/modes/interactive/interactive-prompt-restore.d.ts +3 -0
- package/dist/modes/interactive/interactive-prompt-restore.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-prompt-restore.js +9 -1
- package/dist/modes/interactive/interactive-prompt-restore.js.map +1 -1
- package/dist/modes/interactive/interactive-prompt-turn.js +30 -2
- package/dist/modes/interactive/interactive-prompt-turn.js.map +1 -1
- package/dist/modes/interactive/interactive-queueing.js +43 -8
- package/dist/modes/interactive/interactive-queueing.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +12 -3
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/theme/color-utils.d.ts +6 -1
- package/dist/modes/interactive/theme/color-utils.d.ts.map +1 -1
- package/dist/modes/interactive/theme/color-utils.js +39 -17
- package/dist/modes/interactive/theme/color-utils.js.map +1 -1
- package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-class.js +2 -2
- package/dist/modes/interactive/theme/theme-class.js.map +1 -1
- package/dist/modes/interactive/theme/theme-tokens.d.ts +6 -0
- package/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-tokens.js +7 -3
- package/dist/modes/interactive/theme/theme-tokens.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.d.ts +3 -0
- package/dist/modes/interactive-engine/isolated-auth.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.js +13 -1
- package/dist/modes/interactive-engine/isolated-auth.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +11 -2
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts +8 -0
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.js +54 -0
- package/dist/modes/interactive-engine/remote-model-catalog.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +4 -13
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-model-catalog.d.ts +9 -0
- package/dist/modes/rpc/rpc-model-catalog.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-model-catalog.js +19 -0
- package/dist/modes/rpc/rpc-model-catalog.js.map +1 -0
- package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js +2 -6
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +6 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/changelog.d.ts +6 -0
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +11 -0
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +4 -0
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +3 -2
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/background-tasks.md +5 -3
- package/docs/codemode.md +2 -2
- package/docs/custom-provider/oauth.md +42 -1
- package/docs/custom-provider/registration.md +2 -0
- package/docs/environment-variables.md +1 -0
- package/docs/extensions/api-reference.md +3 -4
- package/docs/extensions/authoring.md +1 -1
- package/docs/extensions/events.md +1 -1
- package/docs/models-configuration.md +9 -0
- package/docs/models.md +3 -1
- package/docs/providers.md +4 -4
- package/docs/rpc/protocol.md +4 -2
- package/docs/sdk/reference.md +2 -0
- package/docs/sdk/structured-decisions.md +7 -5
- package/docs/sdk.md +5 -2
- package/docs/settings.md +4 -2
- package/docs/subagents/reference.md +1 -1
- package/docs/subagents.md +15 -1
- package/docs/themes/reference.md +3 -1
- package/docs/usage.md +3 -1
- package/docs/workflows/api-reference.md +28 -0
- package/docs/workflows/authoring.md +1 -1
- package/docs/workflows/operations.md +2 -2
- package/npm-shrinkwrap.json +67 -54
- package/package.json +6 -6
- package/schemas/models.schema.json +21 -0
- package/dist/core/provider-attribution.d.ts +0 -4
- package/dist/core/provider-attribution.d.ts.map +0 -1
- package/dist/core/provider-attribution.js +0 -87
- package/dist/core/provider-attribution.js.map +0 -1
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// dist/builtin/workflows/src/authoring/workflow.ts
|
|
6
6
|
import { basename } from "node:path";
|
|
7
|
-
import { fileURLToPath } from "node:url";
|
|
7
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
8
8
|
|
|
9
9
|
// dist/builtin/workflows/src/shared/budget.ts
|
|
10
10
|
function validateWorkflowBudget(value, label = "budget") {
|
|
@@ -37,6 +37,59 @@ function assertWorkflowBudget(value, label = "budget") {
|
|
|
37
37
|
// dist/builtin/workflows/src/shared/workflow-heartbeat-contract.ts
|
|
38
38
|
var DEFAULT_WORKFLOW_HEARTBEAT_INTERVAL_MINUTES = 15;
|
|
39
39
|
|
|
40
|
+
// dist/builtin/workflows/src/runs/shared/prompt-callsite.ts
|
|
41
|
+
import { fileURLToPath } from "node:url";
|
|
42
|
+
var PACKAGED_WORKFLOW_RUNTIME_ROOTS = ["/dist/builtin/workflows/src/"];
|
|
43
|
+
function normalizeSlashes(path) {
|
|
44
|
+
return path.replace(/\\/g, "/");
|
|
45
|
+
}
|
|
46
|
+
function normalizeStackPath(framePath) {
|
|
47
|
+
let normalized = framePath;
|
|
48
|
+
if (normalized.startsWith("file://")) {
|
|
49
|
+
try {
|
|
50
|
+
normalized = fileURLToPath(normalized);
|
|
51
|
+
} catch {
|
|
52
|
+
try {
|
|
53
|
+
normalized = decodeURIComponent(new URL(normalized).pathname);
|
|
54
|
+
} catch {}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
normalized = normalizeSlashes(normalized).replace(/^\/([A-Za-z]:\/)/, "$1");
|
|
58
|
+
return normalized;
|
|
59
|
+
}
|
|
60
|
+
function currentModuleRuntimeRoot() {
|
|
61
|
+
const modulePath = normalizeStackPath(fileURLToPath(import.meta.url));
|
|
62
|
+
const markers = ["packages/workflows/src/", ...PACKAGED_WORKFLOW_RUNTIME_ROOTS.map((root) => root.slice(1))];
|
|
63
|
+
for (const marker of markers) {
|
|
64
|
+
const index = modulePath.indexOf(marker);
|
|
65
|
+
if (index >= 0)
|
|
66
|
+
return modulePath.slice(0, index + marker.length);
|
|
67
|
+
}
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
var CURRENT_WORKFLOW_RUNTIME_ROOT = currentModuleRuntimeRoot();
|
|
71
|
+
function isWorkflowRuntimeFrame(normalizedPath) {
|
|
72
|
+
const path = normalizeSlashes(normalizedPath);
|
|
73
|
+
if (path.startsWith("packages/workflows/src/"))
|
|
74
|
+
return true;
|
|
75
|
+
if (CURRENT_WORKFLOW_RUNTIME_ROOT !== undefined && path.startsWith(CURRENT_WORKFLOW_RUNTIME_ROOT)) {
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
const comparable = path.startsWith("/") ? path : `/${path}`;
|
|
79
|
+
return PACKAGED_WORKFLOW_RUNTIME_ROOTS.some((runtimeRoot) => comparable.includes(runtimeRoot));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// dist/builtin/workflows/src/shared/workflow-source.ts
|
|
83
|
+
var WORKFLOW_SOURCES = new WeakMap;
|
|
84
|
+
var OWN_MODULE_PATH = normalizeStackPath(import.meta.url);
|
|
85
|
+
function isWorkflowRuntimeModule(path) {
|
|
86
|
+
const normalized = normalizeStackPath(path);
|
|
87
|
+
return normalized === OWN_MODULE_PATH || isWorkflowRuntimeFrame(normalized);
|
|
88
|
+
}
|
|
89
|
+
function recordWorkflowSource(definition, path) {
|
|
90
|
+
WORKFLOW_SOURCES.set(definition, path);
|
|
91
|
+
}
|
|
92
|
+
|
|
40
93
|
// dist/builtin/workflows/src/workflows/identity.ts
|
|
41
94
|
function normalizeWorkflowName(name) {
|
|
42
95
|
if (!name || typeof name !== "string") {
|
|
@@ -67,7 +120,7 @@ function stackFilePath(line) {
|
|
|
67
120
|
if (!rawPath.startsWith("file://"))
|
|
68
121
|
return rawPath;
|
|
69
122
|
try {
|
|
70
|
-
return
|
|
123
|
+
return fileURLToPath2(rawPath);
|
|
71
124
|
} catch {
|
|
72
125
|
return;
|
|
73
126
|
}
|
|
@@ -78,8 +131,10 @@ function isWorkflowAuthoringImplementationFrame(filePath) {
|
|
|
78
131
|
return false;
|
|
79
132
|
return normalized.includes("/packages/workflows/") || normalized.includes("/dist/builtin/workflows/") || normalized.includes("/.atomic/agent/extensions/workflows/");
|
|
80
133
|
}
|
|
81
|
-
function
|
|
82
|
-
const
|
|
134
|
+
function callerSourcePath(entry) {
|
|
135
|
+
const capture = new Error;
|
|
136
|
+
Error.captureStackTrace(capture, entry);
|
|
137
|
+
const stack = capture.stack;
|
|
83
138
|
if (stack === undefined)
|
|
84
139
|
return;
|
|
85
140
|
for (const line of stack.split(`
|
|
@@ -89,14 +144,18 @@ function workflowNameFromCaller() {
|
|
|
89
144
|
continue;
|
|
90
145
|
if (isWorkflowAuthoringImplementationFrame(filePath))
|
|
91
146
|
continue;
|
|
92
|
-
|
|
93
|
-
if (base.length > 0)
|
|
94
|
-
return base;
|
|
147
|
+
return isWorkflowRuntimeModule(filePath) ? undefined : filePath;
|
|
95
148
|
}
|
|
96
149
|
return;
|
|
97
150
|
}
|
|
98
|
-
function
|
|
99
|
-
|
|
151
|
+
function workflowNameFromSourcePath(filePath) {
|
|
152
|
+
if (filePath === undefined)
|
|
153
|
+
return;
|
|
154
|
+
const base = basename(filePath.replace(/\\/g, "/")).replace(/\.[cm]?[jt]sx?$/, "");
|
|
155
|
+
return base.length > 0 ? base : undefined;
|
|
156
|
+
}
|
|
157
|
+
function resolveWorkflowName(name, sourcePath) {
|
|
158
|
+
const resolved = name ?? workflowNameFromSourcePath(sourcePath);
|
|
100
159
|
if (resolved === undefined) {
|
|
101
160
|
throw new TypeError("workflow: name must be provided when caller filename cannot be inferred");
|
|
102
161
|
}
|
|
@@ -132,7 +191,8 @@ function workflow(spec) {
|
|
|
132
191
|
throw new TypeError("workflow: heartbeatIntervalMinutes must be a non-negative finite number");
|
|
133
192
|
}
|
|
134
193
|
assertWorkflowBudget(spec.budget, "workflow: budget");
|
|
135
|
-
const
|
|
194
|
+
const source = callerSourcePath(workflow);
|
|
195
|
+
const name = resolveWorkflowName(spec.name, source);
|
|
136
196
|
const normalizedName = normalizeWorkflowName(name);
|
|
137
197
|
requireNonEmptyString(normalizedName, "normalized name");
|
|
138
198
|
const frozenInputs = freezeSchemaMap(spec.inputs ?? {});
|
|
@@ -154,6 +214,8 @@ function workflow(spec) {
|
|
|
154
214
|
run
|
|
155
215
|
};
|
|
156
216
|
const branded = stampWorkflowDefinition(definition);
|
|
217
|
+
if (source !== undefined)
|
|
218
|
+
recordWorkflowSource(branded, source);
|
|
157
219
|
return Object.freeze(branded);
|
|
158
220
|
}
|
|
159
221
|
|
|
@@ -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-hx8v4p97.js";
|
|
5
|
+
import"./chunk-2jfst7e4.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-z3pajrfs.js";
|
|
4
4
|
import"./chunk-2377r57g.js";
|
|
5
5
|
import"./chunk-n1910xc4.js";
|
|
6
|
-
import"./chunk-
|
|
6
|
+
import"./chunk-2jfst7e4.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-
|
|
3
|
+
} from "./chunk-txbc93t6.js";
|
|
4
4
|
import"./chunk-8x61e0s7.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-2jfst7e4.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-2jfst7e4.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-apagcs4r.js";
|
|
8
8
|
import {
|
|
9
9
|
classify_and_act_default
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-hx8v4p97.js";
|
|
11
11
|
import {
|
|
12
12
|
fan_out_and_synthesize_default
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-w4xp1w1f.js";
|
|
14
14
|
import {
|
|
15
15
|
generate_and_filter_default
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-z3pajrfs.js";
|
|
17
17
|
import {
|
|
18
18
|
goal_default
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-txbc93t6.js";
|
|
20
20
|
import"./chunk-8x61e0s7.js";
|
|
21
21
|
import"./chunk-z0d03ktm.js";
|
|
22
22
|
import {
|
|
23
23
|
open_claude_design_default
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-k5q3t7je.js";
|
|
25
25
|
import {
|
|
26
26
|
loop_until_done_default
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-dcxscfnb.js";
|
|
28
28
|
import {
|
|
29
29
|
ralph_default
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-n2gkzkty.js";
|
|
31
31
|
import {
|
|
32
32
|
tournament_default
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-49kkbdpr.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-dcxscfnb.js";
|
|
4
4
|
import"./chunk-z0d03ktm.js";
|
|
5
5
|
import"./chunk-n1910xc4.js";
|
|
6
|
-
import"./chunk-
|
|
6
|
+
import"./chunk-2jfst7e4.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-
|
|
3
|
+
} from "./chunk-n2gkzkty.js";
|
|
4
4
|
import"./chunk-8x61e0s7.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-2jfst7e4.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-49kkbdpr.js";
|
|
4
4
|
import"./chunk-2377r57g.js";
|
|
5
5
|
import"./chunk-n1910xc4.js";
|
|
6
|
-
import"./chunk-
|
|
6
|
+
import"./chunk-2jfst7e4.js";
|
|
7
7
|
import"./chunk-9cm2ckq2.js";
|
|
8
8
|
export {
|
|
9
9
|
tournament_default as default
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/workflows",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.41-alpha.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for multi-stage workflow authoring and execution.",
|
|
6
6
|
"contributors": [
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"@bastani/atomic": "*",
|
|
88
|
-
"@earendil-works/pi-tui": "^1.
|
|
88
|
+
"@earendil-works/pi-tui": "^1.4.0",
|
|
89
89
|
"typebox": "*"
|
|
90
90
|
},
|
|
91
91
|
"peerDependenciesMeta": {
|
|
@@ -8,7 +8,7 @@ export type { RunJournalOption, RunJournalSettings } from "./durable/journal/res
|
|
|
8
8
|
export { resolveRunJournal } from "./durable/journal/resolution.js";
|
|
9
9
|
export { openSqlRunJournal, SqlRunJournal } from "./durable/journal/sqlite-run-journal.js";
|
|
10
10
|
export * from "./durable/journal/types.js";
|
|
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, 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";
|
|
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, WorkflowExecutionMode, WorkflowExecutionPolicy, WorkflowExitOptions, WorkflowExitStatus, WorkflowInputBindings, WorkflowInputSchema, WorkflowInputSchemaMap, WorkflowInputValues, WorkflowIntercomSummary, WorkflowMaxOutput, WorkflowMcpPort, WorkflowModelAttempt, WorkflowModelCatalogPort, WorkflowModelFallbackFields, WorkflowModelInfo, WorkflowModelUsage, WorkflowModelValue, WorkflowOutputMode, WorkflowOutputSchema, WorkflowOutputSchemaMap, WorkflowOutputValues, WorkflowParallelFailure, 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";
|
|
12
12
|
import type * as AuthoringContract from "./shared/authoring-contract.js";
|
|
13
13
|
import type { AuthoredWorkflowSpec as SharedAuthoredWorkflowSpec, WorkflowInputsFromSchemas, WorkflowOutputsFromSchemas, WorkflowProvidedInputsFromSchemas } from "./shared/workflow-authoring-types.js";
|
|
14
14
|
export type { WorkflowInputsFromSchemas, WorkflowOutputsFromSchemas, WorkflowProvidedInputsFromSchemas, } from "./shared/workflow-authoring-types.js";
|
|
@@ -1 +1,17 @@
|
|
|
1
|
+
import type { RunJournal } from "./types.js";
|
|
1
2
|
export declare const JOURNAL_READ_PAGE_SIZE = 256;
|
|
3
|
+
/** A run's latest event. A run whose history was deleted and recorded again ends with a different event. */
|
|
4
|
+
export interface RunVersion {
|
|
5
|
+
readonly seq: number;
|
|
6
|
+
readonly at: number;
|
|
7
|
+
}
|
|
8
|
+
/** Lets a durable backend re-read only the runs that changed; kept off the public journal shape. */
|
|
9
|
+
export interface RunJournalVersions {
|
|
10
|
+
/** Moves whenever any connection, in this process or another, commits a change to the journal's store. */
|
|
11
|
+
changeToken(): Promise<string>;
|
|
12
|
+
/** Every listed run with its latest event; a run with no events has version `{ seq: 0, at: 0 }`. */
|
|
13
|
+
runVersions(): Promise<ReadonlyMap<string, RunVersion>>;
|
|
14
|
+
}
|
|
15
|
+
export declare function registerRunJournalVersions(journal: RunJournal, versions: RunJournalVersions): void;
|
|
16
|
+
/** Change tracking for a journal that registered it; other journals are re-read in full. */
|
|
17
|
+
export declare function runJournalVersions(journal: RunJournal): RunJournalVersions | undefined;
|
|
@@ -14,6 +14,13 @@ type LegacyEventRow = SqliteRow & {
|
|
|
14
14
|
[c.payload]: string;
|
|
15
15
|
[c.at]: number;
|
|
16
16
|
};
|
|
17
|
+
export type RunVersionRow = SqliteRow & {
|
|
18
|
+
[c.runId]: string;
|
|
19
|
+
[c.seq]: number;
|
|
20
|
+
[c.at]: number;
|
|
21
|
+
};
|
|
22
|
+
/** `seq` and `at` of the latest event of `${runs}.run_id`, through the `(run_id, seq)` primary key. */
|
|
23
|
+
export declare function latestEventColumns(events: string, runs: string): string;
|
|
17
24
|
/**
|
|
18
25
|
* Runs recorded before #3682, kept in the unprefixed `meta`/`runs`/`events`/`leases` tables.
|
|
19
26
|
*
|
|
@@ -32,6 +39,8 @@ export declare class LegacyJournalRuns {
|
|
|
32
39
|
cwd?: string;
|
|
33
40
|
}): Promise<LegacyRunRow[]>;
|
|
34
41
|
find(executor: SqliteExecutor, runId: string): Promise<LegacyRunRow | undefined>;
|
|
42
|
+
/** Latest event of each pending legacy run; the legacy tables are never modified. */
|
|
43
|
+
versions(executor: SqliteExecutor): Promise<RunVersionRow[]>;
|
|
35
44
|
/** Events of an unconverted legacy run, read in place. */
|
|
36
45
|
events(executor: SqliteExecutor, runId: string, fromSeq: number, limit: number): Promise<LegacyEventRow[]>;
|
|
37
46
|
eventByKey(executor: SqliteExecutor, runId: string, key: string): Promise<LegacyEventRow | undefined>;
|
|
@@ -22,6 +22,12 @@ export declare class SqlRunJournal implements RunJournal {
|
|
|
22
22
|
listRuns(filter?: {
|
|
23
23
|
cwd?: string;
|
|
24
24
|
}): Promise<readonly RunSummary[]>;
|
|
25
|
+
/**
|
|
26
|
+
* `data_version` moves when another connection commits and `total_changes()` when this one writes; the
|
|
27
|
+
* table aggregates also catch run changes if the adapter does not serve every statement from one connection.
|
|
28
|
+
*/
|
|
29
|
+
private changeToken;
|
|
30
|
+
private runVersions;
|
|
25
31
|
private requireRun;
|
|
26
32
|
/** Whether this run exists only in the legacy tables, whose events are then read in place. */
|
|
27
33
|
private isUnconvertedLegacyRun;
|