@bastani/atomic 0.9.40-alpha.2 → 0.9.41-alpha.1
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 +80 -0
- package/README.md +1 -1
- package/dist/builtin/intercom/CHANGELOG.md +26 -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 +1 -1
- 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 +45 -0
- package/dist/builtin/subagents/README.md +14 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +99 -19
- package/dist/builtin/web-access/CHANGELOG.md +6 -0
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +44 -0
- package/dist/builtin/workflows/README.md +2 -0
- package/dist/builtin/workflows/package.json +1 -1
- 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 +441 -90
- package/dist/builtin/workflows/src/index.js +226 -34
- 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-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 +6 -5
- package/dist/core/provider-composer-internal.d.ts.map +1 -1
- package/dist/core/provider-composer-internal.js +13 -2
- 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/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/providers.md +3 -3
- 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/operations.md +2 -2
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
- 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
|
@@ -823,6 +823,13 @@ function registerRunJournalConformance(runner, name, open, observeRead) {
|
|
|
823
823
|
}
|
|
824
824
|
// dist/builtin/workflows/src/durable/journal/internal.ts
|
|
825
825
|
var JOURNAL_READ_PAGE_SIZE = 256;
|
|
826
|
+
var versionReaders = new WeakMap;
|
|
827
|
+
function registerRunJournalVersions(journal, versions) {
|
|
828
|
+
versionReaders.set(journal, versions);
|
|
829
|
+
}
|
|
830
|
+
function runJournalVersions(journal) {
|
|
831
|
+
return versionReaders.get(journal);
|
|
832
|
+
}
|
|
826
833
|
|
|
827
834
|
// dist/builtin/workflows/src/durable/journal/lease-expiry.ts
|
|
828
835
|
function isWorkflowLeaseExpired(renewedAt, staleAfterMs, now = Date.now()) {
|
|
@@ -1107,6 +1114,10 @@ var LEGACY_COLUMNS = {
|
|
|
1107
1114
|
var PENDING_LEGACY_RUNS = `SELECT ${JOURNAL_COLUMNS.runId}, ${JOURNAL_COLUMNS.headerJson}, ${JOURNAL_COLUMNS.status} FROM ${JOURNAL_TABLES.runs}
|
|
1108
1115
|
WHERE ${JOURNAL_COLUMNS.runId} NOT IN (SELECT ${JOURNAL_COLUMNS.runId} FROM ${CURRENT.runs})
|
|
1109
1116
|
AND ${JOURNAL_COLUMNS.runId} NOT IN (SELECT ${JOURNAL_COLUMNS.runId} FROM ${CURRENT.legacyDeleted})`;
|
|
1117
|
+
function latestEventColumns(events, runs) {
|
|
1118
|
+
const latest = (column) => `COALESCE((SELECT ${column} FROM ${events} AS latest WHERE latest.${JOURNAL_COLUMNS.runId} = ${runs}.${JOURNAL_COLUMNS.runId} ORDER BY latest.${JOURNAL_COLUMNS.seq} DESC LIMIT 1), 0) AS ${column}`;
|
|
1119
|
+
return `${latest(JOURNAL_COLUMNS.seq)}, ${latest(JOURNAL_COLUMNS.at)}`;
|
|
1120
|
+
}
|
|
1110
1121
|
async function hasLegacyTable(tx, table) {
|
|
1111
1122
|
const columns = await tx.all("SELECT name FROM pragma_table_info(?)", JOURNAL_TABLES[table]);
|
|
1112
1123
|
const names = new Set(columns.map((column) => column.name));
|
|
@@ -1140,6 +1151,9 @@ class LegacyJournalRuns {
|
|
|
1140
1151
|
async find(executor, runId) {
|
|
1141
1152
|
return executor.get(`${PENDING_LEGACY_RUNS} AND ${JOURNAL_COLUMNS.runId} = ?`, runId);
|
|
1142
1153
|
}
|
|
1154
|
+
async versions(executor) {
|
|
1155
|
+
return executor.all(`SELECT pending.${JOURNAL_COLUMNS.runId}, ${latestEventColumns(JOURNAL_TABLES.events, "pending")} FROM (${PENDING_LEGACY_RUNS}) AS pending`);
|
|
1156
|
+
}
|
|
1143
1157
|
async events(executor, runId, fromSeq, limit) {
|
|
1144
1158
|
return executor.all(`SELECT ${LEGACY_COLUMNS.events.join(", ")} FROM ${JOURNAL_TABLES.events} WHERE ${JOURNAL_COLUMNS.runId} = ? AND ${JOURNAL_COLUMNS.seq} >= ? ORDER BY ${JOURNAL_COLUMNS.seq} LIMIT ?`, runId, fromSeq, limit);
|
|
1145
1159
|
}
|
|
@@ -1190,6 +1204,10 @@ class SqlRunJournal {
|
|
|
1190
1204
|
this.database = database;
|
|
1191
1205
|
this.tables = tables;
|
|
1192
1206
|
this.legacy = legacy;
|
|
1207
|
+
registerRunJournalVersions(this, {
|
|
1208
|
+
changeToken: () => this.changeToken(),
|
|
1209
|
+
runVersions: () => this.runVersions()
|
|
1210
|
+
});
|
|
1193
1211
|
}
|
|
1194
1212
|
static async open(database, options = {}) {
|
|
1195
1213
|
const t = renderStorageIdentifiers2("journal", JOURNAL_TABLES, options.prefix);
|
|
@@ -1288,6 +1306,27 @@ class SqlRunJournal {
|
|
|
1288
1306
|
return [...rows, ...legacy].map((row) => ({ ...JSON.parse(row[JOURNAL_COLUMNS.headerJson]), status: row[JOURNAL_COLUMNS.status] })).sort((left, right) => left.runId < right.runId ? -1 : left.runId > right.runId ? 1 : 0);
|
|
1289
1307
|
});
|
|
1290
1308
|
}
|
|
1309
|
+
async changeToken() {
|
|
1310
|
+
this.assertOpen();
|
|
1311
|
+
return this.operation(async () => {
|
|
1312
|
+
const row = await this.database.get(`SELECT data_version, total_changes() AS changes,
|
|
1313
|
+
(SELECT count(*) FROM ${this.tables.runs}) AS runs,
|
|
1314
|
+
(SELECT max(rowid) FROM ${this.tables.events}) AS last_event
|
|
1315
|
+
FROM pragma_data_version`);
|
|
1316
|
+
return JSON.stringify(Object.values(row ?? {}).map(String));
|
|
1317
|
+
});
|
|
1318
|
+
}
|
|
1319
|
+
async runVersions() {
|
|
1320
|
+
this.assertOpen();
|
|
1321
|
+
return this.operation(async () => {
|
|
1322
|
+
const rows = await this.database.all(`SELECT runs.${JOURNAL_COLUMNS.runId}, ${latestEventColumns(this.tables.events, "runs")} FROM ${this.tables.runs} AS runs`);
|
|
1323
|
+
const legacy = await this.legacy?.versions(this.database) ?? [];
|
|
1324
|
+
return new Map([...rows, ...legacy].map((row) => [
|
|
1325
|
+
row[JOURNAL_COLUMNS.runId],
|
|
1326
|
+
{ seq: journalCounter(row[JOURNAL_COLUMNS.runId], "seq", row[JOURNAL_COLUMNS.seq]), at: Number(row[JOURNAL_COLUMNS.at]) }
|
|
1327
|
+
]));
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1291
1330
|
async requireRun(tx, runId) {
|
|
1292
1331
|
if (await tx.get(`SELECT ${JOURNAL_COLUMNS.runId} FROM ${this.tables.runs} WHERE ${JOURNAL_COLUMNS.runId} = ?`, runId))
|
|
1293
1332
|
return;
|
|
@@ -1669,6 +1708,7 @@ import { join as join3 } from "node:path";
|
|
|
1669
1708
|
import {
|
|
1670
1709
|
isStaleExtensionContextError,
|
|
1671
1710
|
ModelRuntime,
|
|
1711
|
+
noOpUIContext,
|
|
1672
1712
|
resolveRestoredModelReference
|
|
1673
1713
|
} from "@bastani/atomic";
|
|
1674
1714
|
|
|
@@ -4978,7 +5018,14 @@ function stripWorkflowOnlyOptions(options) {
|
|
|
4978
5018
|
if (!options)
|
|
4979
5019
|
return options;
|
|
4980
5020
|
const maybeWorkflowOptions = options;
|
|
4981
|
-
const {
|
|
5021
|
+
const {
|
|
5022
|
+
schema: _schema,
|
|
5023
|
+
schemaTimeoutMs: _schemaTimeoutMs,
|
|
5024
|
+
mcp: _mcp,
|
|
5025
|
+
fallbackModels,
|
|
5026
|
+
group: _group,
|
|
5027
|
+
...sessionOptions
|
|
5028
|
+
} = maybeWorkflowOptions;
|
|
4982
5029
|
return fallbackModels?.length === 0 ? { ...sessionOptions, fallbackModels: [] } : sessionOptions;
|
|
4983
5030
|
}
|
|
4984
5031
|
function emitLateIntercomRoute(pi, meta, messages, options, batch) {
|
|
@@ -5095,6 +5142,7 @@ function makeStageExtensionUiContext(ui, meta, broker, inheritedBindingRevision,
|
|
|
5095
5142
|
notify: ui.notify ?? (() => {
|
|
5096
5143
|
return;
|
|
5097
5144
|
}),
|
|
5145
|
+
requestRender: noOpUIContext.requestRender,
|
|
5098
5146
|
onTerminalInput: ui.onTerminalInput ?? (() => () => {
|
|
5099
5147
|
return;
|
|
5100
5148
|
}),
|
|
@@ -5154,7 +5202,7 @@ function makeStageExtensionUiContext(ui, meta, broker, inheritedBindingRevision,
|
|
|
5154
5202
|
getEditorComponent: ui.getEditorComponent ?? (() => {
|
|
5155
5203
|
return;
|
|
5156
5204
|
}),
|
|
5157
|
-
theme: ui.theme,
|
|
5205
|
+
theme: ui.theme ?? noOpUIContext.theme,
|
|
5158
5206
|
getAllThemes: ui.getAllThemes ?? (() => []),
|
|
5159
5207
|
getTheme: ui.getTheme ?? (() => {
|
|
5160
5208
|
return;
|
|
@@ -5164,9 +5212,8 @@ function makeStageExtensionUiContext(ui, meta, broker, inheritedBindingRevision,
|
|
|
5164
5212
|
setToolsExpanded: ui.setToolsExpanded ?? (() => {
|
|
5165
5213
|
return;
|
|
5166
5214
|
}),
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
})
|
|
5215
|
+
getFooterDataProvider: noOpUIContext.getFooterDataProvider,
|
|
5216
|
+
getChatRenderSettings: ui.getChatRenderSettings ?? noOpUIContext.getChatRenderSettings
|
|
5170
5217
|
};
|
|
5171
5218
|
}
|
|
5172
5219
|
function findStageModel(runtime, reference) {
|
|
@@ -6331,6 +6378,10 @@ function schemaIsRequired(schema) {
|
|
|
6331
6378
|
|
|
6332
6379
|
// dist/builtin/workflows/src/runs/shared/validate-inputs.ts
|
|
6333
6380
|
import { Value as Value2 } from "typebox/value";
|
|
6381
|
+
function firstSchemaError(def, value, kind) {
|
|
6382
|
+
const first = [...Value2.Errors(def, value)][0];
|
|
6383
|
+
return first === undefined ? `does not match ${kind} schema` : first.message;
|
|
6384
|
+
}
|
|
6334
6385
|
function validateInputs(schema, inputs) {
|
|
6335
6386
|
const errors = [];
|
|
6336
6387
|
for (const key of Object.keys(inputs)) {
|
|
@@ -6359,12 +6410,16 @@ function validateInputs(schema, inputs) {
|
|
|
6359
6410
|
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
6360
6411
|
errors.push({ key, reason: `expected finite number, got ${workflowSerializableTypeName(value)}` });
|
|
6361
6412
|
hasTypeError = true;
|
|
6413
|
+
} else if (!Value2.Check(def, value)) {
|
|
6414
|
+
errors.push({ key, reason: firstSchemaError(def, value, kind) });
|
|
6362
6415
|
}
|
|
6363
6416
|
break;
|
|
6364
6417
|
case "integer":
|
|
6365
6418
|
if (typeof value !== "number" || !Number.isInteger(value)) {
|
|
6366
6419
|
errors.push({ key, reason: `expected integer, got ${workflowSerializableTypeName(value)}` });
|
|
6367
6420
|
hasTypeError = true;
|
|
6421
|
+
} else if (!Value2.Check(def, value)) {
|
|
6422
|
+
errors.push({ key, reason: firstSchemaError(def, value, kind) });
|
|
6368
6423
|
}
|
|
6369
6424
|
break;
|
|
6370
6425
|
case "boolean":
|
|
@@ -9492,6 +9547,8 @@ class JournalDurableBackend {
|
|
|
9492
9547
|
persistent;
|
|
9493
9548
|
projection = createJournalProjection();
|
|
9494
9549
|
sequences = new Map;
|
|
9550
|
+
foldedAt = new Map;
|
|
9551
|
+
catalogToken;
|
|
9495
9552
|
leases = new Map;
|
|
9496
9553
|
executions = new Map;
|
|
9497
9554
|
executionContext = new AsyncLocalStorage2;
|
|
@@ -9535,7 +9592,7 @@ class JournalDurableBackend {
|
|
|
9535
9592
|
try {
|
|
9536
9593
|
this.ensureOpen();
|
|
9537
9594
|
if (requiresActiveExecution)
|
|
9538
|
-
this.assertExecutionActive(
|
|
9595
|
+
this.assertExecutionActive();
|
|
9539
9596
|
} catch (error) {
|
|
9540
9597
|
return Promise.reject(error);
|
|
9541
9598
|
}
|
|
@@ -9588,6 +9645,7 @@ class JournalDurableBackend {
|
|
|
9588
9645
|
this.projection.applyWorkflowSnapshot({ ...handle, pendingStageMessages: messages });
|
|
9589
9646
|
}
|
|
9590
9647
|
this.sequences.set(entry.runId, entry.seq);
|
|
9648
|
+
this.foldedAt.set(entry.runId, entry.at);
|
|
9591
9649
|
}
|
|
9592
9650
|
*entries(runId, fromSeq) {
|
|
9593
9651
|
return yield* invoke(async () => {
|
|
@@ -9601,6 +9659,7 @@ class JournalDurableBackend {
|
|
|
9601
9659
|
const entries = yield* this.entries(runId);
|
|
9602
9660
|
this.projection.deleteWorkflow(runId);
|
|
9603
9661
|
this.sequences.delete(runId);
|
|
9662
|
+
this.foldedAt.delete(runId);
|
|
9604
9663
|
this.prompts.delete(runId);
|
|
9605
9664
|
for (const entry of entries)
|
|
9606
9665
|
this.fold(entry);
|
|
@@ -9613,7 +9672,7 @@ class JournalDurableBackend {
|
|
|
9613
9672
|
}
|
|
9614
9673
|
*current(runId) {
|
|
9615
9674
|
this.ensureOpen();
|
|
9616
|
-
this.assertExecutionActive(
|
|
9675
|
+
this.assertExecutionActive(true);
|
|
9617
9676
|
yield* this.refresh(runId);
|
|
9618
9677
|
if (this.projection.getWorkflow(runId) === undefined)
|
|
9619
9678
|
return;
|
|
@@ -9632,14 +9691,14 @@ class JournalDurableBackend {
|
|
|
9632
9691
|
if (this.state === "closed" || this.state === "closing" && !this.mutationContext.getStore())
|
|
9633
9692
|
throw new JournalBackendClosedError;
|
|
9634
9693
|
}
|
|
9635
|
-
assertExecutionActive(
|
|
9694
|
+
assertExecutionActive(admitted = false) {
|
|
9636
9695
|
for (const [executionRunId, execution] of this.executionContext.getStore() ?? [])
|
|
9637
9696
|
if (execution.retired && !(admitted && this.mutationContext.getStore()?.has(execution)))
|
|
9638
|
-
throw new JournalExecutionRetiredError(
|
|
9697
|
+
throw new JournalExecutionRetiredError(executionRunId);
|
|
9639
9698
|
}
|
|
9640
9699
|
*ownership(runId) {
|
|
9641
9700
|
this.ensureOpen();
|
|
9642
|
-
this.assertExecutionActive(
|
|
9701
|
+
this.assertExecutionActive(true);
|
|
9643
9702
|
const lost = this.lost.get(runId);
|
|
9644
9703
|
if (lost)
|
|
9645
9704
|
throw lost;
|
|
@@ -9699,7 +9758,7 @@ class JournalDurableBackend {
|
|
|
9699
9758
|
return this.serialize(input.workflowId, () => this.register(input));
|
|
9700
9759
|
}
|
|
9701
9760
|
*register(input) {
|
|
9702
|
-
this.assertExecutionActive(
|
|
9761
|
+
this.assertExecutionActive(true);
|
|
9703
9762
|
this.ensureOpen();
|
|
9704
9763
|
const header = {
|
|
9705
9764
|
runId: input.workflowId,
|
|
@@ -9923,11 +9982,36 @@ class JournalDurableBackend {
|
|
|
9923
9982
|
}
|
|
9924
9983
|
hydrateResumableWorkflows() {
|
|
9925
9984
|
return this.serialize(this.catalogQueue, () => invoke(async () => {
|
|
9926
|
-
const
|
|
9927
|
-
|
|
9928
|
-
await this.
|
|
9985
|
+
const journal = runJournalVersions(this.journal);
|
|
9986
|
+
if (journal === undefined) {
|
|
9987
|
+
const runs = await this.journal.listRuns();
|
|
9988
|
+
for (const runId of new Set([...this.sequences.keys(), ...runs.map((run) => run.runId)]))
|
|
9989
|
+
await this.hydrateWorkflow(runId);
|
|
9990
|
+
return;
|
|
9991
|
+
}
|
|
9992
|
+
const token = await journal.changeToken();
|
|
9993
|
+
if (token === this.catalogToken)
|
|
9994
|
+
return;
|
|
9995
|
+
const versions = await journal.runVersions();
|
|
9996
|
+
for (const runId of new Set([...this.sequences.keys(), ...versions.keys()]))
|
|
9997
|
+
await this.serialize(runId, () => this.catchUp(runId, versions.get(runId)), false);
|
|
9998
|
+
this.catalogToken = token;
|
|
9929
9999
|
}));
|
|
9930
10000
|
}
|
|
10001
|
+
*catchUp(runId, version) {
|
|
10002
|
+
const folded = this.sequences.get(runId) ?? 0;
|
|
10003
|
+
if (version !== undefined && version.seq === folded && version.at === (this.foldedAt.get(runId) ?? 0))
|
|
10004
|
+
return;
|
|
10005
|
+
if (version !== undefined && folded > 0 && version.seq > folded) {
|
|
10006
|
+
const entries = yield* this.entries(runId, folded);
|
|
10007
|
+
if (entries[0]?.seq === folded && entries[0].at === this.foldedAt.get(runId)) {
|
|
10008
|
+
for (const entry of entries)
|
|
10009
|
+
this.fold(entry);
|
|
10010
|
+
return;
|
|
10011
|
+
}
|
|
10012
|
+
}
|
|
10013
|
+
yield* this.rebuild(runId);
|
|
10014
|
+
}
|
|
9931
10015
|
async prepareWorkflowCatalog() {
|
|
9932
10016
|
await this.hydrateResumableWorkflows();
|
|
9933
10017
|
return this.projection.prepareWorkflowCatalog();
|
|
@@ -9945,6 +10029,7 @@ class JournalDurableBackend {
|
|
|
9945
10029
|
}
|
|
9946
10030
|
this.leases.delete(runId);
|
|
9947
10031
|
this.sequences.delete(runId);
|
|
10032
|
+
this.foldedAt.delete(runId);
|
|
9948
10033
|
this.prompts.delete(runId);
|
|
9949
10034
|
this.projection.deleteWorkflow(runId);
|
|
9950
10035
|
}
|
|
@@ -10037,7 +10122,7 @@ class JournalDurableBackend {
|
|
|
10037
10122
|
}
|
|
10038
10123
|
async withWorkflowLease(runId, action) {
|
|
10039
10124
|
this.ensureOpen();
|
|
10040
|
-
this.assertExecutionActive(
|
|
10125
|
+
this.assertExecutionActive();
|
|
10041
10126
|
const context = this.executionContext.getStore();
|
|
10042
10127
|
const active = this.executions.get(runId);
|
|
10043
10128
|
if (active !== undefined && context?.get(runId) !== active)
|
|
@@ -10072,7 +10157,7 @@ class JournalDurableBackend {
|
|
|
10072
10157
|
return this.serialize(runId, () => this.release(runId, execution), false);
|
|
10073
10158
|
}
|
|
10074
10159
|
releaseWorkflow(runId) {
|
|
10075
|
-
this.assertExecutionActive(
|
|
10160
|
+
this.assertExecutionActive();
|
|
10076
10161
|
return this.serialize(runId, () => this.release(runId));
|
|
10077
10162
|
}
|
|
10078
10163
|
*release(runId, execution) {
|
|
@@ -12574,7 +12659,12 @@ async function mapParallelSteps(steps, concurrency, failFast, mapper, onFirstFai
|
|
|
12574
12659
|
if (selectedFailure !== undefined)
|
|
12575
12660
|
throw selectedFailure;
|
|
12576
12661
|
}
|
|
12577
|
-
|
|
12662
|
+
const aggregate = new AggregateError(failures.map((failure) => failure.error), `atomic-workflows: ${failures.length} parallel ${failures.length === 1 ? "step" : "steps"} failed`);
|
|
12663
|
+
if (failFastEnabled)
|
|
12664
|
+
throw aggregate;
|
|
12665
|
+
const failedIndexes = new Set(failures.map((failure) => failure.index));
|
|
12666
|
+
const partialResults = Array.from({ length: steps.length }, (_, index) => failedIndexes.has(index) ? undefined : results[index]);
|
|
12667
|
+
throw Object.assign(aggregate, { partialResults });
|
|
12578
12668
|
}
|
|
12579
12669
|
return results;
|
|
12580
12670
|
}
|
|
@@ -14374,13 +14464,24 @@ class ConcurrencyLimiter {
|
|
|
14374
14464
|
get queued() {
|
|
14375
14465
|
return this._queue.length;
|
|
14376
14466
|
}
|
|
14377
|
-
acquire() {
|
|
14467
|
+
acquire(signal) {
|
|
14468
|
+
if (signal?.aborted)
|
|
14469
|
+
return Promise.reject(signal.reason);
|
|
14378
14470
|
if (this._running < this.limit) {
|
|
14379
14471
|
this._running++;
|
|
14380
14472
|
return Promise.resolve();
|
|
14381
14473
|
}
|
|
14382
|
-
return new Promise((resolve) => {
|
|
14383
|
-
|
|
14474
|
+
return new Promise((resolve, reject) => {
|
|
14475
|
+
const grant = () => {
|
|
14476
|
+
signal?.removeEventListener("abort", onAbort);
|
|
14477
|
+
resolve();
|
|
14478
|
+
};
|
|
14479
|
+
const onAbort = () => {
|
|
14480
|
+
this._queue.splice(this._queue.indexOf(grant), 1);
|
|
14481
|
+
reject(signal?.reason);
|
|
14482
|
+
};
|
|
14483
|
+
this._queue.push(grant);
|
|
14484
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
14384
14485
|
});
|
|
14385
14486
|
}
|
|
14386
14487
|
release() {
|
|
@@ -14391,8 +14492,8 @@ class ConcurrencyLimiter {
|
|
|
14391
14492
|
this._running--;
|
|
14392
14493
|
}
|
|
14393
14494
|
}
|
|
14394
|
-
async run(fn) {
|
|
14395
|
-
await this.acquire();
|
|
14495
|
+
async run(fn, signal) {
|
|
14496
|
+
await this.acquire(signal);
|
|
14396
14497
|
try {
|
|
14397
14498
|
return await fn();
|
|
14398
14499
|
} finally {
|
|
@@ -15355,6 +15456,22 @@ function createChildWorkflowRunner(input) {
|
|
|
15355
15456
|
}
|
|
15356
15457
|
};
|
|
15357
15458
|
}
|
|
15459
|
+
// dist/builtin/workflows/src/shared/error-with-causes.ts
|
|
15460
|
+
var MAX_CAUSE_DEPTH = 5;
|
|
15461
|
+
function describeErrorWithCauses(error) {
|
|
15462
|
+
const messages = [];
|
|
15463
|
+
const visited = new Set;
|
|
15464
|
+
let current = error;
|
|
15465
|
+
for (let depth = 0;current !== undefined && depth < MAX_CAUSE_DEPTH && !visited.has(current); depth++) {
|
|
15466
|
+
visited.add(current);
|
|
15467
|
+
const message = current instanceof Error ? current.message : String(current);
|
|
15468
|
+
if (!messages.includes(message))
|
|
15469
|
+
messages.push(message);
|
|
15470
|
+
current = current instanceof Error ? current.cause : undefined;
|
|
15471
|
+
}
|
|
15472
|
+
return messages.join(": ");
|
|
15473
|
+
}
|
|
15474
|
+
|
|
15358
15475
|
// dist/builtin/workflows/src/shared/returned-run-status.ts
|
|
15359
15476
|
var RETURNED_BLOCKED_STATUSES = new Set([
|
|
15360
15477
|
"blocked",
|
|
@@ -15452,12 +15569,22 @@ function stringResultField(result, key) {
|
|
|
15452
15569
|
|
|
15453
15570
|
// dist/builtin/workflows/src/engine/run-durable-finalize.ts
|
|
15454
15571
|
async function finalizeDurableTerminalStatus(input) {
|
|
15572
|
+
try {
|
|
15573
|
+
await commitDurableTerminalStatus(input);
|
|
15574
|
+
} catch (error) {
|
|
15575
|
+
if (input.store !== undefined)
|
|
15576
|
+
recordDurableEndingFailure(input.store, input.runSnapshot, error);
|
|
15577
|
+
throw error;
|
|
15578
|
+
}
|
|
15579
|
+
}
|
|
15580
|
+
async function commitDurableTerminalStatus(input) {
|
|
15455
15581
|
if (!input.isRoot)
|
|
15456
15582
|
return;
|
|
15457
15583
|
const status = effectiveRunStatus(input.runSnapshot);
|
|
15458
15584
|
const isExitTerminal = input.runSnapshot.exited === true && status !== "running";
|
|
15459
15585
|
const isBlocked = status === "blocked" && (input.runSnapshot.endedAt !== undefined || input.runSnapshot.blockedAt !== undefined);
|
|
15460
|
-
|
|
15586
|
+
const isUncommittedCompletion = status === "completed" && input.terminalStatusCommitted === false;
|
|
15587
|
+
if (status !== "failed" && status !== "killed" && !isExitTerminal && !isBlocked && !isUncommittedCompletion)
|
|
15461
15588
|
return;
|
|
15462
15589
|
const durableStatus = toDurableStatus(status);
|
|
15463
15590
|
if (durableStatus !== undefined) {
|
|
@@ -15467,7 +15594,7 @@ async function finalizeDurableTerminalStatus(input) {
|
|
|
15467
15594
|
if (input.runSnapshot.result !== undefined)
|
|
15468
15595
|
throw error;
|
|
15469
15596
|
}
|
|
15470
|
-
if (durableStatus === "failed" || durableStatus === "blocked") {
|
|
15597
|
+
if (durableStatus === "failed" || durableStatus === "blocked" || isUncommittedCompletion) {
|
|
15471
15598
|
await recordRunTimingCheckpointAsync(input.durableBackend, input.runSnapshot);
|
|
15472
15599
|
}
|
|
15473
15600
|
const failure = durableStatus === "failed" ? {
|
|
@@ -15485,6 +15612,16 @@ async function finalizeDurableTerminalStatus(input) {
|
|
|
15485
15612
|
await input.durableBackend.commitWorkflowStatus(input.runId, durableStatus, undefined, input.runSnapshot.resumable, failure);
|
|
15486
15613
|
}
|
|
15487
15614
|
}
|
|
15615
|
+
function recordDurableEndingFailure(store, runSnapshot, error) {
|
|
15616
|
+
const detail = describeErrorWithCauses(error);
|
|
15617
|
+
store.recordNotice({
|
|
15618
|
+
id: `workflow-durable-ending-failed:${runSnapshot.id}`,
|
|
15619
|
+
runId: runSnapshot.id,
|
|
15620
|
+
level: "error",
|
|
15621
|
+
message: `Workflow "${runSnapshot.name}" ended ${runSnapshot.status}, but its final state could not be saved to the workflow journal: ${detail}. Readers of the journal may report it as crashed.`,
|
|
15622
|
+
createdAt: Date.now()
|
|
15623
|
+
});
|
|
15624
|
+
}
|
|
15488
15625
|
function toDurableStatus(status) {
|
|
15489
15626
|
switch (status) {
|
|
15490
15627
|
case "completed":
|
|
@@ -18760,7 +18897,9 @@ import { createStructuredOutputCapture, runCallback as runCallback2 } from "@bas
|
|
|
18760
18897
|
import {
|
|
18761
18898
|
AutoRoutingInferenceError,
|
|
18762
18899
|
convertToLlm,
|
|
18900
|
+
isExtensionStartupFailure,
|
|
18763
18901
|
isModelRoutingDebugEnabled,
|
|
18902
|
+
isTransientExtensionStartupFailure,
|
|
18764
18903
|
parseModelConstraints,
|
|
18765
18904
|
setsProviders
|
|
18766
18905
|
} from "@bastani/atomic";
|
|
@@ -19031,6 +19170,23 @@ class StageDeliveryActivity {
|
|
|
19031
19170
|
}
|
|
19032
19171
|
}
|
|
19033
19172
|
|
|
19173
|
+
// dist/builtin/workflows/src/runs/foreground/stage-routing.ts
|
|
19174
|
+
var STAGE_ROUTING_CONCURRENCY = 8;
|
|
19175
|
+
var STAGE_ROUTING_DEADLINE_MS = 300000;
|
|
19176
|
+
var routingLimiter = new ConcurrencyLimiter(STAGE_ROUTING_CONCURRENCY);
|
|
19177
|
+
async function routeStageModel(route, input) {
|
|
19178
|
+
const deadline = new AbortController;
|
|
19179
|
+
const timer = setTimeout(() => deadline.abort(new Error("stage routing deadline")), STAGE_ROUTING_DEADLINE_MS);
|
|
19180
|
+
try {
|
|
19181
|
+
return await route({
|
|
19182
|
+
...input,
|
|
19183
|
+
inference: { deadline: deadline.signal, limit: (run, signal) => routingLimiter.run(run, signal) }
|
|
19184
|
+
});
|
|
19185
|
+
} finally {
|
|
19186
|
+
clearTimeout(timer);
|
|
19187
|
+
}
|
|
19188
|
+
}
|
|
19189
|
+
|
|
19034
19190
|
// dist/builtin/workflows/src/runs/foreground/stage-runner-artifact-capture.ts
|
|
19035
19191
|
class StageArtifactCapture {
|
|
19036
19192
|
session;
|
|
@@ -19521,6 +19677,7 @@ async function stripWorkflowOnlyOptions2(options, defaultSessionDir, meta, pendi
|
|
|
19521
19677
|
}
|
|
19522
19678
|
const {
|
|
19523
19679
|
schema: _schema,
|
|
19680
|
+
schemaTimeoutMs: _schemaTimeoutMs,
|
|
19524
19681
|
mcp: _mcp,
|
|
19525
19682
|
fallbackModels,
|
|
19526
19683
|
modelConstraints: _modelConstraints,
|
|
@@ -19768,6 +19925,15 @@ class StageSessionReplacement {
|
|
|
19768
19925
|
this.previous = undefined;
|
|
19769
19926
|
await Promise.allSettled([...previous ? [disposeStageSession(previous)] : [], ...this.cleanups]);
|
|
19770
19927
|
}
|
|
19928
|
+
async disposeRetired() {
|
|
19929
|
+
const previous = this.previous;
|
|
19930
|
+
this.previous = undefined;
|
|
19931
|
+
if (!previous)
|
|
19932
|
+
return;
|
|
19933
|
+
await disposeStageSession(previous).catch((error) => {
|
|
19934
|
+
console.error("atomic-workflows: retired stage session disposal failed", error);
|
|
19935
|
+
});
|
|
19936
|
+
}
|
|
19771
19937
|
async disposeAfterIdle(session) {
|
|
19772
19938
|
const agent = session.agent;
|
|
19773
19939
|
if (typeof agent?.waitForIdle === "function")
|
|
@@ -19894,7 +20060,7 @@ class WorkflowStructuredOutputContractError extends Error {
|
|
|
19894
20060
|
}
|
|
19895
20061
|
}
|
|
19896
20062
|
function isStructuredOutputContractFailure(message) {
|
|
19897
|
-
return message.startsWith(STRUCTURED_OUTPUT_MISSING_ERROR) || message.startsWith('Validation failed for tool "structured_output":') || message.startsWith("Invalid structured output: response does not match the decision schema.") || message.startsWith("Invalid structured output: non-JSON decision.") || message.startsWith("Structured output requires one structured_output call.") || message.startsWith("Structured output requires exactly one structured_output call and no provider fallback.") || message === "Structured output requires complete judgment instructions." || message === "Structured output requires a nonempty named state object containing the task and relevant context text." || message === "Structured output inputs must be finite, acyclic JSON data." || message === "Structured output inputs must be plain JSON objects." || message === "structured_output tool call failed schema validation.";
|
|
20063
|
+
return message.startsWith(STRUCTURED_OUTPUT_MISSING_ERROR) || message.startsWith('Validation failed for tool "structured_output":') || message.startsWith("Invalid structured output: response does not match the decision schema.") || message.startsWith("Invalid structured output: non-JSON decision.") || message.startsWith("Invalid structured output: tool call arguments were not valid JSON.") || message.startsWith("Structured output requires one structured_output call.") || message.startsWith("Structured output requires exactly one structured_output call and no provider fallback.") || message === "Structured output requires complete judgment instructions." || message === "Structured output requires a nonempty named state object containing the task and relevant context text." || message === "Structured output inputs must be finite, acyclic JSON data." || message === "Structured output inputs must be plain JSON objects." || message === "structured_output tool call failed schema validation.";
|
|
19898
20064
|
}
|
|
19899
20065
|
var STRUCTURED_OUTPUT_TOOL_NAME = "structured_output";
|
|
19900
20066
|
function toolResultText(content) {
|
|
@@ -19946,7 +20112,8 @@ function stageOptionsWithStructuredOutput(options, capture, executionCapture) {
|
|
|
19946
20112
|
return options;
|
|
19947
20113
|
const structuredOutputTool = createStructuredOutputTool({
|
|
19948
20114
|
schema: options.schema,
|
|
19949
|
-
capture
|
|
20115
|
+
capture,
|
|
20116
|
+
...options.schemaTimeoutMs === undefined ? {} : { timeoutMs: options.schemaTimeoutMs }
|
|
19950
20117
|
});
|
|
19951
20118
|
const executeStructuredOutput = structuredOutputTool.execute;
|
|
19952
20119
|
const capturedStructuredOutputTool = {
|
|
@@ -20036,6 +20203,16 @@ function waitForStageStartup(operation, signal) {
|
|
|
20036
20203
|
// dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts
|
|
20037
20204
|
var WORKFLOW_STAGE_CLOSED_FOR_GOOD_STATE = "atomic:workflow-stage-closed-for-good";
|
|
20038
20205
|
var WORKFLOW_STAGE_END_CHILDREN_STATE = "atomic:workflow-stage-end-children";
|
|
20206
|
+
function isRetryableSameCandidateFailure(error) {
|
|
20207
|
+
if (isExtensionStartupFailure(error))
|
|
20208
|
+
return isTransientExtensionStartupFailure(error);
|
|
20209
|
+
return isRetryableSameModelFailure(error);
|
|
20210
|
+
}
|
|
20211
|
+
function mayAdvanceToNextCandidate(error) {
|
|
20212
|
+
if (isExtensionStartupFailure(error))
|
|
20213
|
+
return isTransientExtensionStartupFailure(error);
|
|
20214
|
+
return isRetryableModelFailure(error);
|
|
20215
|
+
}
|
|
20039
20216
|
function hasMeaningfulUsage(usage) {
|
|
20040
20217
|
if (usage === undefined)
|
|
20041
20218
|
return false;
|
|
@@ -20287,7 +20464,7 @@ class StageSessionController {
|
|
|
20287
20464
|
return;
|
|
20288
20465
|
if (!this.routingPromise) {
|
|
20289
20466
|
this.beginStartup();
|
|
20290
|
-
|
|
20467
|
+
const routing = (async () => {
|
|
20291
20468
|
const route = this.modelCatalog?.routeModel;
|
|
20292
20469
|
if (!route)
|
|
20293
20470
|
throw new Error("Workflow stage auto routing requires a routing-capable model catalog.");
|
|
@@ -20299,7 +20476,7 @@ class StageSessionController {
|
|
|
20299
20476
|
...thinking === undefined ? [] : [{ allowedEfforts: [thinking] }]
|
|
20300
20477
|
].filter((c) => c !== undefined);
|
|
20301
20478
|
try {
|
|
20302
|
-
this.modelRoute = await route
|
|
20479
|
+
this.modelRoute = await routeStageModel(route, {
|
|
20303
20480
|
task: text,
|
|
20304
20481
|
stageName: this.opts.stageName,
|
|
20305
20482
|
constraints,
|
|
@@ -20320,7 +20497,17 @@ class StageSessionController {
|
|
|
20320
20497
|
this.modelRoute.assertCurrent();
|
|
20321
20498
|
this.meta.stageOptions = { ...options, model: this.modelRoute.modelOverride };
|
|
20322
20499
|
this.opts.onModelFallbackMetaChange?.(this.currentModelFallbackMeta());
|
|
20323
|
-
})()
|
|
20500
|
+
})().catch((error) => {
|
|
20501
|
+
if (this.routingPromise === routing) {
|
|
20502
|
+
this.routingPromise = undefined;
|
|
20503
|
+
this.modelRoute = undefined;
|
|
20504
|
+
}
|
|
20505
|
+
if (this.startupWait.signal.aborted || this.opts.signal?.aborted)
|
|
20506
|
+
throw error;
|
|
20507
|
+
this.settleStartup(true);
|
|
20508
|
+
throw new Error(`atomic-workflows: stage "${this.opts.stageName}" failed during startup phase model-resolution: ${errorMessage2(error)}`);
|
|
20509
|
+
});
|
|
20510
|
+
this.routingPromise = routing;
|
|
20324
20511
|
}
|
|
20325
20512
|
await this.routingPromise;
|
|
20326
20513
|
}
|
|
@@ -21075,7 +21262,7 @@ class StageSessionController {
|
|
|
21075
21262
|
const errorSettingsManager = retrySettingsManagerFromError(error);
|
|
21076
21263
|
if (errorSettingsManager !== undefined)
|
|
21077
21264
|
this.sessionSettingsManager = errorSettingsManager;
|
|
21078
|
-
const decision = isWorkflowPendingStageDeliveryFailure(error) ? undefined : nextRetryDecision(this.retrySettings(), retryAttempt,
|
|
21265
|
+
const decision = isWorkflowPendingStageDeliveryFailure(error) ? undefined : nextRetryDecision(this.retrySettings(), retryAttempt, isRetryableSameCandidateFailure(error));
|
|
21079
21266
|
if (decision === undefined || this.disposed || this.opts.signal?.aborted === true || this.startupWait.signal.aborted || this.capturedStructuredOutputForAttempt()) {
|
|
21080
21267
|
throw error;
|
|
21081
21268
|
}
|
|
@@ -21487,10 +21674,11 @@ class StageSessionController {
|
|
|
21487
21674
|
...usage === undefined ? {} : { usage },
|
|
21488
21675
|
error: message
|
|
21489
21676
|
});
|
|
21490
|
-
if (this.opts.signal?.aborted || this.startupWait.signal.aborted || terminalStageDelivery || !
|
|
21677
|
+
if (this.opts.signal?.aborted || this.startupWait.signal.aborted || terminalStageDelivery || !mayAdvanceToNextCandidate(err) || index === candidates.length - 1) {
|
|
21491
21678
|
this.modelWarnings.push(...this.pendingFallbackWarnings);
|
|
21492
21679
|
this.pendingFallbackWarnings.length = 0;
|
|
21493
21680
|
this.notifyModelFallbackMetaChange();
|
|
21681
|
+
await this.replacement.disposeRetired();
|
|
21494
21682
|
return "throw";
|
|
21495
21683
|
}
|
|
21496
21684
|
const nextCandidate = candidates[index + 1];
|
|
@@ -22612,13 +22800,13 @@ class EngineRuntime {
|
|
|
22612
22800
|
|
|
22613
22801
|
// dist/builtin/workflows/src/engine/session-closed-error.ts
|
|
22614
22802
|
import { isStaleExtensionContextError as isStaleExtensionContextError2 } from "@bastani/atomic";
|
|
22615
|
-
var
|
|
22803
|
+
var MAX_CAUSE_DEPTH2 = 8;
|
|
22616
22804
|
function reportsClosedSession(error) {
|
|
22617
22805
|
return "code" in error && error.code === "SessionClosed" || isStaleExtensionContextError2(error);
|
|
22618
22806
|
}
|
|
22619
22807
|
function isSessionClosedError(error) {
|
|
22620
22808
|
let current = error;
|
|
22621
|
-
for (let depth = 0;depth <
|
|
22809
|
+
for (let depth = 0;depth < MAX_CAUSE_DEPTH2 && current !== undefined; depth++) {
|
|
22622
22810
|
try {
|
|
22623
22811
|
if (reportsClosedSession(current))
|
|
22624
22812
|
return true;
|
|
@@ -23255,6 +23443,7 @@ async function executeRun(def, resolvedInputs, opts) {
|
|
|
23255
23443
|
};
|
|
23256
23444
|
const runtimeSettled = Promise.withResolvers();
|
|
23257
23445
|
let durableRootAdmitted = false;
|
|
23446
|
+
let terminalStatusCommitted = false;
|
|
23258
23447
|
let pausePersistence;
|
|
23259
23448
|
let resumePersistence;
|
|
23260
23449
|
let controlSettlements = Promise.resolve();
|
|
@@ -23444,6 +23633,7 @@ async function executeRun(def, resolvedInputs, opts) {
|
|
|
23444
23633
|
await recordRunResultCheckpointAsync(durableBackend, runSnapshot);
|
|
23445
23634
|
}
|
|
23446
23635
|
await durableBackend.commitWorkflowStatus(runId, returned.status, undefined, returned.metadata?.resumable);
|
|
23636
|
+
terminalStatusCommitted = true;
|
|
23447
23637
|
await appendRunEndWhenRecorded(opts.persistence, recorded, {
|
|
23448
23638
|
runId,
|
|
23449
23639
|
status: returned.status,
|
|
@@ -23565,7 +23755,9 @@ async function executeRun(def, resolvedInputs, opts) {
|
|
|
23565
23755
|
runId,
|
|
23566
23756
|
runSnapshot,
|
|
23567
23757
|
isRoot: opts.parentRun === undefined,
|
|
23568
|
-
durableBackend
|
|
23758
|
+
durableBackend,
|
|
23759
|
+
terminalStatusCommitted,
|
|
23760
|
+
store: activeStore
|
|
23569
23761
|
});
|
|
23570
23762
|
}
|
|
23571
23763
|
} finally {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Workflow authoring primitives, stage/session contracts, and task option types. */
|
|
2
|
-
import type { AgentSession, AgentSessionEvent, ModelConstraints, ModelRoute, ModelRouterOutput, TaskNeeds } from "@bastani/atomic";
|
|
2
|
+
import type { AgentSession, AgentSessionEvent, ModelConstraints, ModelRoute, ModelRouterOutput, RoutingInferenceBounds, TaskNeeds } from "@bastani/atomic";
|
|
3
3
|
import type { Static, TSchema } from "typebox";
|
|
4
4
|
export type { Static, TSchema };
|
|
5
5
|
export type WorkflowSerializablePrimitive = string | number | boolean | null;
|
|
@@ -91,6 +91,8 @@ export interface WorkflowModelCatalogPort {
|
|
|
91
91
|
taskNeeds?: TaskNeeds;
|
|
92
92
|
/** The stage's own constraints set a provider list, replacing the user's provider settings. */
|
|
93
93
|
overrideProviderSettings?: boolean;
|
|
94
|
+
/** Deadline and concurrency limit the stage owns for routing inference. */
|
|
95
|
+
inference?: RoutingInferenceBounds;
|
|
94
96
|
}): Promise<ModelRoute>;
|
|
95
97
|
readonly currentModel?: WorkflowModelValue;
|
|
96
98
|
readonly preferredProvider?: string;
|
|
@@ -126,6 +128,13 @@ export interface WorkflowScopedModel {
|
|
|
126
128
|
export interface StageOptions<TSchemaDef extends TSchema | undefined = TSchema | undefined> extends WorkflowModelFallbackFields {
|
|
127
129
|
/** Optional structured final-answer schema. When set, the stage receives a schema-specific final-answer tool. */
|
|
128
130
|
readonly schema?: TSchemaDef;
|
|
131
|
+
/**
|
|
132
|
+
* Wall-clock limit in milliseconds for each `structured_output` decision of a schema-backed stage, covering
|
|
133
|
+
* every repair attempt, transport retry and model fallback together. Defaults to the session's
|
|
134
|
+
* `httpIdleTimeoutMs` setting (10 minutes unless changed). A decision that overruns fails with an error naming
|
|
135
|
+
* the deadline. Ignored without `schema`.
|
|
136
|
+
*/
|
|
137
|
+
readonly schemaTimeoutMs?: number;
|
|
129
138
|
readonly model?: WorkflowModelValue;
|
|
130
139
|
/** Hard restrictions for automatic model selection and its execution fallbacks. */
|
|
131
140
|
readonly modelConstraints?: ModelConstraints;
|
|
@@ -376,6 +385,13 @@ export interface WorkflowParallelOptions extends WorkflowSharedTaskDefaults {
|
|
|
376
385
|
/** Static discovery only: literal conservative stage names/globs for an otherwise opaque step array. */
|
|
377
386
|
readonly possibleStageNames?: readonly string[];
|
|
378
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* Error thrown by `ctx.parallel(..., { failFast: false })` after every step has settled and at least one
|
|
390
|
+
* failed. `partialResults` has one entry per step in step order; a step that failed or never ran is `undefined`.
|
|
391
|
+
*/
|
|
392
|
+
export interface WorkflowParallelFailure<TResult = WorkflowTaskResult> extends AggregateError {
|
|
393
|
+
readonly partialResults: readonly (TResult | undefined)[];
|
|
394
|
+
}
|
|
379
395
|
export type WorkflowTaskSessionOptions = StageOptions & WorkflowTaskSessionFields;
|
|
380
396
|
export interface WorkflowRunChildOptions<TInputs extends WorkflowInputValues = WorkflowInputValues> {
|
|
381
397
|
readonly inputs?: TInputs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-print.d.ts","sourceRoot":"","sources":["../../src/cli/credential-print.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,cAAc,CAAC;AAE7D,8EAA8E;AAC9E,eAAO,MAAM,kCAAkC,QAAc,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GACjC,OAAO,GACP,wBAAwB,GACxB,mBAAmB,GACnB,4BAA4B,GAC5B,eAAe,GACf,wBAAwB,GACxB,kBAAkB,GAClB,sBAAsB,GACtB,qBAAqB,CAAC;AAEzB;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,wBAAwB,EAAE,MAAM,CAU/D,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,wBAAwB,CAEtE,CAAC;AAEF,qBAAa,oBAAqB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,YAAY,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAKzF;CACD;AAED;;;;;;;;;;GAUG;AACH,qBAAa,MAAM;;IAGlB,YAAY,KAAK,EAAE,MAAM,EAExB;IAED,qEAAqE;IACrE,IAAI,IAAI,MAAM,CAOb;IAED,QAAQ,IAAI,KAAK,CAEhB;IAED,MAAM,IAAI,KAAK,CAEd;IAED,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,KAAK,CAE5B;IAED,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAEzB;CACD;AAED,iGAAiG;AACjG,MAAM,WAAW,oBAAoB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAmCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,oBAAoB,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAmChH;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,CAO3E;AA6BD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAiB5D;AAED,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,6BAA6B,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,qBAAqB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,oBAAoB,
|
|
1
|
+
{"version":3,"file":"credential-print.d.ts","sourceRoot":"","sources":["../../src/cli/credential-print.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,cAAc,CAAC;AAE7D,8EAA8E;AAC9E,eAAO,MAAM,kCAAkC,QAAc,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GACjC,OAAO,GACP,wBAAwB,GACxB,mBAAmB,GACnB,4BAA4B,GAC5B,eAAe,GACf,wBAAwB,GACxB,kBAAkB,GAClB,sBAAsB,GACtB,qBAAqB,CAAC;AAEzB;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,wBAAwB,EAAE,MAAM,CAU/D,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,wBAAwB,CAEtE,CAAC;AAEF,qBAAa,oBAAqB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,YAAY,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAKzF;CACD;AAED;;;;;;;;;;GAUG;AACH,qBAAa,MAAM;;IAGlB,YAAY,KAAK,EAAE,MAAM,EAExB;IAED,qEAAqE;IACrE,IAAI,IAAI,MAAM,CAOb;IAED,QAAQ,IAAI,KAAK,CAEhB;IAED,MAAM,IAAI,KAAK,CAEd;IAED,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,KAAK,CAE5B;IAED,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAEzB;CACD;AAED,iGAAiG;AACjG,MAAM,WAAW,oBAAoB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAmCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,oBAAoB,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAmChH;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,CAO3E;AA6BD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAiB5D;AAED,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,6BAA6B,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,qBAAqB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,oBAAoB,CAmB7E;AAiDD;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAC9C,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,mBAAmB,EACzB,WAAW,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CA6GjB"}
|
|
@@ -275,7 +275,7 @@ export function classifyOAuthFailure(error) {
|
|
|
275
275
|
return new CredentialPrintError("MinValidityUnreachable", `The provider refreshed the token but it still expires sooner than requested: ${detail}`, { cause: error });
|
|
276
276
|
}
|
|
277
277
|
if (error.message.startsWith(OAUTH_REFRESH_FAILED_PHRASE)) {
|
|
278
|
-
return new CredentialPrintError("RefreshFailed", `${detail} (the stored credential
|
|
278
|
+
return new CredentialPrintError("RefreshFailed", `${detail} (the stored credential changes only if the provider completes this refresh later)`, {
|
|
279
279
|
cause: error,
|
|
280
280
|
});
|
|
281
281
|
}
|