@bastani/atomic 0.9.16-alpha.8 → 0.9.16
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 +126 -0
- package/README.md +4 -4
- package/dist/builtin/intercom/CHANGELOG.md +42 -0
- package/dist/builtin/intercom/README.md +18 -17
- package/dist/builtin/intercom/broker/broker.ts +43 -18
- package/dist/builtin/intercom/broker/client.ts +138 -7
- package/dist/builtin/intercom/broker/group-isolation.ts +3 -3
- package/dist/builtin/intercom/broker/group-membership.ts +55 -0
- package/dist/builtin/intercom/broker/presence-handler.ts +62 -50
- package/dist/builtin/intercom/broker/send-handler.ts +2 -3
- package/dist/builtin/intercom/group.ts +40 -0
- package/dist/builtin/intercom/index.bundle.mjs +556 -185
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/intercom/skills/intercom/SKILL.md +16 -10
- package/dist/builtin/intercom/types.ts +24 -2
- package/dist/builtin/mcp/index.bundle.mjs +268 -54
- package/dist/builtin/mcp/package.json +2 -2
- package/dist/builtin/subagents/CHANGELOG.md +51 -0
- package/dist/builtin/subagents/README.md +3 -3
- package/dist/builtin/subagents/agents/code-simplifier.md +1 -1
- package/dist/builtin/subagents/agents/codebase-analyzer.md +1 -1
- package/dist/builtin/subagents/agents/codebase-locator.md +1 -1
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +1 -1
- package/dist/builtin/subagents/agents/codebase-pattern-finder.md +1 -1
- package/dist/builtin/subagents/agents/codebase-research-analyzer.md +1 -1
- package/dist/builtin/subagents/agents/codebase-research-locator.md +1 -1
- package/dist/builtin/subagents/agents/debugger.md +1 -1
- package/dist/builtin/subagents/agents/worker.md +1 -1
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +488 -142
- package/dist/builtin/web-access/index.bundle.mjs +268 -54
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +70 -0
- package/dist/builtin/workflows/README.md +2 -2
- package/dist/builtin/workflows/builtin/{chunk-zf28603f.js → chunk-3y1hmzw6.js} +36 -6
- package/dist/builtin/workflows/builtin/{chunk-nqr34qp3.js → chunk-6rbajjf5.js} +7 -1
- package/dist/builtin/workflows/builtin/{chunk-v04c5qmd.js → chunk-bz1c9732.js} +15 -3
- package/dist/builtin/workflows/builtin/{chunk-cdtd3m3w.js → chunk-dattsgxg.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-5n10x7j2.js → chunk-gdx0avpx.js} +421 -69
- package/dist/builtin/workflows/builtin/{chunk-hdpj1dkw.js → chunk-w9c7rkrk.js} +1 -1
- package/dist/builtin/workflows/builtin/goal.js +3 -3
- package/dist/builtin/workflows/builtin/index.js +5 -5
- package/dist/builtin/workflows/builtin/open-claude-design.js +2 -2
- package/dist/builtin/workflows/builtin/ralph.js +3 -3
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +597 -145
- package/dist/builtin/workflows/src/index.js +278 -74
- package/dist/cli/args.js +6 -6
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +2 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/session-picker.d.ts +2 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +3 -2
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +2 -1
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +1 -0
- 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-post-tool-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-post-tool-compaction.js +3 -6
- package/dist/core/agent-session-post-tool-compaction.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +3 -1
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +6 -3
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js +7 -5
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
- package/dist/core/agent-session-tool-hooks.js +37 -23
- package/dist/core/agent-session-tool-hooks.js.map +1 -1
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +9 -2
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session.d.ts +2 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +2 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/builtin-packages.d.ts +4 -0
- package/dist/core/builtin-packages.d.ts.map +1 -1
- package/dist/core/builtin-packages.js +22 -1
- package/dist/core/builtin-packages.js.map +1 -1
- package/dist/core/callback-activity.d.ts.map +1 -1
- package/dist/core/callback-activity.js +6 -3
- package/dist/core/callback-activity.js.map +1 -1
- package/dist/core/extensions/agent-events.d.ts +15 -0
- package/dist/core/extensions/agent-events.d.ts.map +1 -1
- package/dist/core/extensions/agent-events.js.map +1 -1
- package/dist/core/extensions/api-types.d.ts +3 -1
- package/dist/core/extensions/api-types.d.ts.map +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/event-types.d.ts +2 -2
- package/dist/core/extensions/event-types.d.ts.map +1 -1
- package/dist/core/extensions/event-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader-core.d.ts +1 -0
- package/dist/core/extensions/loader-core.d.ts.map +1 -1
- package/dist/core/extensions/loader-core.js +11 -1
- package/dist/core/extensions/loader-core.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +1 -1
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner-registries.d.ts.map +1 -1
- package/dist/core/extensions/runner-registries.js +9 -4
- package/dist/core/extensions/runner-registries.js.map +1 -1
- package/dist/core/extensions/runner-shortcuts.d.ts.map +1 -1
- package/dist/core/extensions/runner-shortcuts.js +1 -0
- package/dist/core/extensions/runner-shortcuts.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +6 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +65 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/keybindings.d.ts +5 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +4 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mandatory-resource-loader.d.ts +6 -0
- package/dist/core/mandatory-resource-loader.d.ts.map +1 -0
- package/dist/core/mandatory-resource-loader.js +94 -0
- package/dist/core/mandatory-resource-loader.js.map +1 -0
- package/dist/core/mandatory-runtime-tools.d.ts +10 -0
- package/dist/core/mandatory-runtime-tools.d.ts.map +1 -0
- package/dist/core/mandatory-runtime-tools.js +31 -0
- package/dist/core/mandatory-runtime-tools.js.map +1 -0
- package/dist/core/model-resolver-defaults.js +1 -1
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/resource-loader-reload.d.ts.map +1 -1
- package/dist/core/resource-loader-reload.js +24 -13
- package/dist/core/resource-loader-reload.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +2 -0
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager-ui-accessors.d.ts +4 -1
- package/dist/core/settings-manager-ui-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-ui-accessors.js +22 -0
- package/dist/core/settings-manager-ui-accessors.js.map +1 -1
- package/dist/core/settings-types.d.ts +4 -0
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/slash-commands.js +1 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/index-extensions.d.ts +1 -1
- package/dist/index-extensions.d.ts.map +1 -1
- package/dist/index-extensions.js.map +1 -1
- package/dist/main-session.d.ts.map +1 -1
- package/dist/main-session.js +3 -2
- package/dist/main-session.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +6 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/fast-mode-selector.js +2 -2
- package/dist/modes/interactive/components/fast-mode-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-handlers.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-handlers.js +3 -0
- package/dist/modes/interactive/components/settings-selector-handlers.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.js +7 -0
- package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +2 -1
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.js +1 -0
- package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +3 -0
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +15 -1
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +6 -1
- 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-selectors.js +6 -1
- package/dist/modes/interactive/interactive-selectors.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +3 -0
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.js +7 -12
- package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-tui.d.ts +1 -0
- package/dist/modes/interactive/interactive-tui.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-tui.js +16 -0
- package/dist/modes/interactive/interactive-tui.js.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.js +2 -0
- package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
- package/docs/compaction.md +1 -1
- package/docs/environment-variables.md +2 -0
- package/docs/extensions.md +20 -1
- package/docs/intercom.md +29 -24
- package/docs/keybindings.md +5 -2
- package/docs/packages.md +1 -1
- package/docs/providers.md +2 -2
- package/docs/sdk.md +9 -7
- package/docs/settings.md +9 -3
- package/docs/subagents.md +2 -2
- package/docs/usage.md +7 -6
- package/docs/workflows.md +11 -7
- package/npm-shrinkwrap.json +59 -77
- package/package.json +7 -7
|
@@ -9224,11 +9224,13 @@ function runSynchronousCallback(descriptor, callback) {
|
|
|
9224
9224
|
}
|
|
9225
9225
|
}
|
|
9226
9226
|
async function runCallback(descriptor, callback) {
|
|
9227
|
+
if (!reporter)
|
|
9228
|
+
return callback();
|
|
9229
|
+
await yieldToEventLoop();
|
|
9227
9230
|
const active = beginActivity(descriptor);
|
|
9228
9231
|
if (!active)
|
|
9229
9232
|
return callback();
|
|
9230
9233
|
try {
|
|
9231
|
-
await yieldToEventLoop();
|
|
9232
9234
|
return await callback();
|
|
9233
9235
|
} finally {
|
|
9234
9236
|
active.reporter.finished(active.activity.id);
|
|
@@ -11957,12 +11959,34 @@ var init_runner_events = __esm(() => {
|
|
|
11957
11959
|
init_callback_activity();
|
|
11958
11960
|
});
|
|
11959
11961
|
|
|
11962
|
+
// src/core/mandatory-runtime-tools.ts
|
|
11963
|
+
function isTrustedMandatoryRuntimeTool(registration) {
|
|
11964
|
+
return MANDATORY_TOOL_NAMES.has(registration.definition.name) && TRUSTED_MANDATORY_DEFINITIONS.has(registration.definition);
|
|
11965
|
+
}
|
|
11966
|
+
function isMandatoryRuntimeTool(name) {
|
|
11967
|
+
return MANDATORY_TOOL_NAMES.has(name);
|
|
11968
|
+
}
|
|
11969
|
+
function appendRegisteredMandatoryTools(tools, registry) {
|
|
11970
|
+
for (const name of MANDATORY_TOOL_NAMES) {
|
|
11971
|
+
const tool = registry.get(name);
|
|
11972
|
+
if (tool && !tools.some((candidate) => candidate.name === name))
|
|
11973
|
+
tools.push(tool);
|
|
11974
|
+
}
|
|
11975
|
+
return tools;
|
|
11976
|
+
}
|
|
11977
|
+
var MANDATORY_TOOL_NAMES, TRUSTED_MANDATORY_DEFINITIONS;
|
|
11978
|
+
var init_mandatory_runtime_tools = __esm(() => {
|
|
11979
|
+
MANDATORY_TOOL_NAMES = new Set(["intercom"]);
|
|
11980
|
+
TRUSTED_MANDATORY_DEFINITIONS = new WeakSet;
|
|
11981
|
+
});
|
|
11982
|
+
|
|
11960
11983
|
// src/core/extensions/runner-registries.ts
|
|
11961
11984
|
function collectRegisteredTools(extensions) {
|
|
11962
11985
|
const toolsByName = new Map;
|
|
11963
11986
|
for (const ext of extensions) {
|
|
11964
11987
|
for (const tool of ext.tools.values()) {
|
|
11965
|
-
|
|
11988
|
+
const existing = toolsByName.get(tool.definition.name);
|
|
11989
|
+
if (!existing || isMandatoryRuntimeTool(tool.definition.name) && isTrustedMandatoryRuntimeTool(tool)) {
|
|
11966
11990
|
toolsByName.set(tool.definition.name, tool);
|
|
11967
11991
|
}
|
|
11968
11992
|
}
|
|
@@ -11970,13 +11994,16 @@ function collectRegisteredTools(extensions) {
|
|
|
11970
11994
|
return Array.from(toolsByName.values());
|
|
11971
11995
|
}
|
|
11972
11996
|
function findToolDefinition(extensions, toolName) {
|
|
11997
|
+
let first;
|
|
11973
11998
|
for (const ext of extensions) {
|
|
11974
11999
|
const tool = ext.tools.get(toolName);
|
|
11975
|
-
if (tool)
|
|
12000
|
+
if (!tool)
|
|
12001
|
+
continue;
|
|
12002
|
+
first ??= tool;
|
|
12003
|
+
if (isMandatoryRuntimeTool(toolName) && isTrustedMandatoryRuntimeTool(tool))
|
|
11976
12004
|
return tool.definition;
|
|
11977
|
-
}
|
|
11978
12005
|
}
|
|
11979
|
-
return;
|
|
12006
|
+
return first?.definition;
|
|
11980
12007
|
}
|
|
11981
12008
|
function collectFlags(extensions) {
|
|
11982
12009
|
const allFlags = new Map;
|
|
@@ -12044,6 +12071,9 @@ function resolveRegisteredCommands(extensions) {
|
|
|
12044
12071
|
return { ...command, invocationName };
|
|
12045
12072
|
});
|
|
12046
12073
|
}
|
|
12074
|
+
var init_runner_registries = __esm(() => {
|
|
12075
|
+
init_mandatory_runtime_tools();
|
|
12076
|
+
});
|
|
12047
12077
|
|
|
12048
12078
|
// src/core/extensions/runner-shortcuts.ts
|
|
12049
12079
|
function resolveExtensionShortcuts(extensions, resolvedKeybindings, hasUI) {
|
|
@@ -12107,6 +12137,7 @@ var init_runner_shortcuts = __esm(() => {
|
|
|
12107
12137
|
"app.thinking.toggle",
|
|
12108
12138
|
"app.editor.external",
|
|
12109
12139
|
"app.message.followUp",
|
|
12140
|
+
"app.message.copy",
|
|
12110
12141
|
"tui.input.submit",
|
|
12111
12142
|
"tui.select.confirm",
|
|
12112
12143
|
"tui.select.cancel",
|
|
@@ -12233,6 +12264,8 @@ class ExtensionRunner {
|
|
|
12233
12264
|
shortcutDiagnostics = [];
|
|
12234
12265
|
commandDiagnostics = [];
|
|
12235
12266
|
staleMessage;
|
|
12267
|
+
uiPromptBinding = 0;
|
|
12268
|
+
activeUIPrompt;
|
|
12236
12269
|
constructor(extensions, runtime, cwd, sessionManager, modelRegistry, orchestrationContext, subagentPolicy) {
|
|
12237
12270
|
this.extensions = extensions;
|
|
12238
12271
|
this.runtime = runtime;
|
|
@@ -12327,9 +12360,71 @@ class ExtensionRunner {
|
|
|
12327
12360
|
this.reloadHandler = async () => {};
|
|
12328
12361
|
}
|
|
12329
12362
|
setUIContext(uiContext, mode = "print") {
|
|
12330
|
-
this.
|
|
12363
|
+
this.endActiveUIPrompt();
|
|
12364
|
+
const binding = ++this.uiPromptBinding;
|
|
12365
|
+
this.uiContext = uiContext ? this.wrapUIPromptContext(uiContext, binding) : noOpUIContext;
|
|
12331
12366
|
this.mode = mode;
|
|
12332
12367
|
}
|
|
12368
|
+
wrapUIPromptContext(ui, binding) {
|
|
12369
|
+
return {
|
|
12370
|
+
...ui,
|
|
12371
|
+
select: (title, options, opts) => this.withUIPrompt(binding, "select", title, () => ui.select(title, options, opts)),
|
|
12372
|
+
confirm: (title, message, opts) => this.withUIPrompt(binding, "confirm", title, () => ui.confirm(title, message, opts)),
|
|
12373
|
+
input: (title, placeholder, opts) => this.withUIPrompt(binding, "input", title, () => ui.input(title, placeholder, opts)),
|
|
12374
|
+
editor: (title, prefill, opts) => this.withUIPrompt(binding, "editor", title, () => ui.editor(title, prefill, opts)),
|
|
12375
|
+
custom: (factory, options) => this.withUIPrompt(binding, "custom", undefined, () => ui.custom(factory, options))
|
|
12376
|
+
};
|
|
12377
|
+
}
|
|
12378
|
+
withUIPrompt(binding, kind, title, run) {
|
|
12379
|
+
if (binding !== this.uiPromptBinding)
|
|
12380
|
+
return run();
|
|
12381
|
+
let prompt = this.activeUIPrompt;
|
|
12382
|
+
if (!prompt) {
|
|
12383
|
+
prompt = { depth: 0, kind, title };
|
|
12384
|
+
this.activeUIPrompt = prompt;
|
|
12385
|
+
this.emitUIPromptEvent({
|
|
12386
|
+
type: "ui_prompt_start",
|
|
12387
|
+
reason: "ui_prompt",
|
|
12388
|
+
kind,
|
|
12389
|
+
...title === undefined ? {} : { title }
|
|
12390
|
+
});
|
|
12391
|
+
}
|
|
12392
|
+
prompt.depth += 1;
|
|
12393
|
+
let finished = false;
|
|
12394
|
+
const finish = () => {
|
|
12395
|
+
if (finished)
|
|
12396
|
+
return;
|
|
12397
|
+
finished = true;
|
|
12398
|
+
if (this.activeUIPrompt !== prompt)
|
|
12399
|
+
return;
|
|
12400
|
+
prompt.depth -= 1;
|
|
12401
|
+
if (prompt.depth === 0)
|
|
12402
|
+
this.endActiveUIPrompt(prompt);
|
|
12403
|
+
};
|
|
12404
|
+
try {
|
|
12405
|
+
return run().finally(finish);
|
|
12406
|
+
} catch (error) {
|
|
12407
|
+
finish();
|
|
12408
|
+
throw error;
|
|
12409
|
+
}
|
|
12410
|
+
}
|
|
12411
|
+
endActiveUIPrompt(prompt = this.activeUIPrompt) {
|
|
12412
|
+
if (!prompt || this.activeUIPrompt !== prompt)
|
|
12413
|
+
return;
|
|
12414
|
+
this.activeUIPrompt = undefined;
|
|
12415
|
+
prompt.depth = 0;
|
|
12416
|
+
this.emitUIPromptEvent({
|
|
12417
|
+
type: "ui_prompt_end",
|
|
12418
|
+
reason: "ui_prompt",
|
|
12419
|
+
kind: prompt.kind,
|
|
12420
|
+
...prompt.title === undefined ? {} : { title: prompt.title }
|
|
12421
|
+
});
|
|
12422
|
+
}
|
|
12423
|
+
emitUIPromptEvent(event) {
|
|
12424
|
+
queueMicrotask(() => {
|
|
12425
|
+
this.emit(event);
|
|
12426
|
+
});
|
|
12427
|
+
}
|
|
12333
12428
|
getUIContext() {
|
|
12334
12429
|
return this.uiContext;
|
|
12335
12430
|
}
|
|
@@ -12506,6 +12601,7 @@ var init_runner = __esm(() => {
|
|
|
12506
12601
|
init_loader_runtime();
|
|
12507
12602
|
init_runner_context();
|
|
12508
12603
|
init_runner_events();
|
|
12604
|
+
init_runner_registries();
|
|
12509
12605
|
init_runner_shortcuts();
|
|
12510
12606
|
init_runner_ui();
|
|
12511
12607
|
init_stale_context();
|
|
@@ -14709,11 +14805,13 @@ async function _runAgentContinue() {
|
|
|
14709
14805
|
}
|
|
14710
14806
|
async function _continueQueuedAgentMessages() {
|
|
14711
14807
|
await this._agentEventQueue;
|
|
14712
|
-
while (!this._queuedMessagesPaused && this.agent.hasQueuedMessages()) {
|
|
14808
|
+
while (!this._stopAfterTurnBlockedContinuation && !this._queuedMessagesPaused && this.agent.hasQueuedMessages()) {
|
|
14713
14809
|
await this.agent.continue();
|
|
14714
14810
|
await this.waitForRetry();
|
|
14715
14811
|
await this._agentEventQueue;
|
|
14716
14812
|
}
|
|
14813
|
+
if (this._stopAfterTurnBlockedContinuation)
|
|
14814
|
+
return;
|
|
14717
14815
|
await answerAdmittedQueuedMessage(this);
|
|
14718
14816
|
}
|
|
14719
14817
|
async function answerAdmittedQueuedMessage(session) {
|
|
@@ -16104,14 +16202,13 @@ function getToolDefinition(name) {
|
|
|
16104
16202
|
}
|
|
16105
16203
|
function setActiveToolsByName(toolNames) {
|
|
16106
16204
|
const tools = [];
|
|
16107
|
-
const validToolNames = [];
|
|
16108
16205
|
for (const name of toolNames) {
|
|
16109
16206
|
const tool = this._toolRegistry.get(name);
|
|
16110
|
-
if (tool)
|
|
16207
|
+
if (tool)
|
|
16111
16208
|
tools.push(tool);
|
|
16112
|
-
validToolNames.push(name);
|
|
16113
|
-
}
|
|
16114
16209
|
}
|
|
16210
|
+
appendRegisteredMandatoryTools(tools, this._toolRegistry);
|
|
16211
|
+
const validToolNames = tools.map((tool) => tool.name);
|
|
16115
16212
|
this.agent.state.tools = tools;
|
|
16116
16213
|
this._baseSystemPrompt = this._rebuildSystemPrompt(validToolNames);
|
|
16117
16214
|
this.agent.state.systemPrompt = this._systemPromptOverride ?? this._baseSystemPrompt;
|
|
@@ -16168,7 +16265,7 @@ function _rebuildSystemPrompt(toolNames) {
|
|
|
16168
16265
|
customPrompt: loaderSystemPrompt,
|
|
16169
16266
|
appendSystemPrompt,
|
|
16170
16267
|
selectedTools: validToolNames,
|
|
16171
|
-
excludedTools: this._excludedToolNames ? Array.from(this._excludedToolNames) : undefined,
|
|
16268
|
+
excludedTools: this._excludedToolNames ? Array.from(this._excludedToolNames).filter((name) => !isMandatoryRuntimeTool(name)) : undefined,
|
|
16172
16269
|
toolSnippets,
|
|
16173
16270
|
promptGuidelines
|
|
16174
16271
|
};
|
|
@@ -16181,6 +16278,7 @@ function _refreshBaseSystemPromptFromActiveTools() {
|
|
|
16181
16278
|
}
|
|
16182
16279
|
var agentSessionStateMethods;
|
|
16183
16280
|
var init_agent_session_state = __esm(() => {
|
|
16281
|
+
init_mandatory_runtime_tools();
|
|
16184
16282
|
init_skill_catalog();
|
|
16185
16283
|
init_system_prompt();
|
|
16186
16284
|
agentSessionStateMethods = {
|
|
@@ -17208,6 +17306,17 @@ function _installAgentToolHooks() {
|
|
|
17208
17306
|
}
|
|
17209
17307
|
function _installAgentNextTurnRefresh() {
|
|
17210
17308
|
const previousPrepareNextTurnWithContext = this.agent.prepareNextTurnWithContext ?? (this.agent.prepareNextTurn ? async (_turn, signal) => await this.agent.prepareNextTurn?.(signal) : undefined);
|
|
17309
|
+
const previousShouldStopAfterTurn = this.agent.shouldStopAfterTurn;
|
|
17310
|
+
this.agent.shouldStopAfterTurn = async (turn, signal) => {
|
|
17311
|
+
const toolCallIds = turn.message.content.filter((part) => part.type === "toolCall").map((part) => part.id);
|
|
17312
|
+
const terminatingBatch = toolCallIds.length > 0 && toolCallIds.every((id) => this._terminatingToolCallIds.has(id));
|
|
17313
|
+
for (const id of toolCallIds)
|
|
17314
|
+
this._terminatingToolCallIds.delete(id);
|
|
17315
|
+
const shouldStop = await previousShouldStopAfterTurn?.(turn, signal) ?? false;
|
|
17316
|
+
this._stopAfterTurnBlockedContinuation = shouldStop;
|
|
17317
|
+
await settleFallbackAfterTurn(this, turn, terminatingBatch);
|
|
17318
|
+
return shouldStop;
|
|
17319
|
+
};
|
|
17211
17320
|
const previousTransformContext = this.agent.transformContext;
|
|
17212
17321
|
this.agent.transformContext = async (messages, signal) => {
|
|
17213
17322
|
const transformed = previousTransformContext ? await previousTransformContext(messages, signal) : messages;
|
|
@@ -17215,24 +17324,17 @@ function _installAgentNextTurnRefresh() {
|
|
|
17215
17324
|
assertToolPairingInvariant(guarded);
|
|
17216
17325
|
return guarded;
|
|
17217
17326
|
};
|
|
17218
|
-
|
|
17219
|
-
const
|
|
17220
|
-
const
|
|
17221
|
-
const
|
|
17222
|
-
const
|
|
17223
|
-
|
|
17224
|
-
this._terminatingToolCallIds.delete(id);
|
|
17225
|
-
const messages = turn.toolResults.length > 0 && !terminatingBatch ? await this._preflightPostToolContext(previousContext.messages, signal) : previousContext.messages;
|
|
17226
|
-
const preserveFallbackForFailure = turn.message.role === "assistant" && !this.agent.hasQueuedMessages() && (turn.message.stopReason === "length" || this._isEmptyCompletion?.(turn.message) === true || this._isSafetyRefusal?.(turn.message) === true);
|
|
17227
|
-
if (!preserveFallbackForFailure && (turn.toolResults.length === 0 || terminatingBatch)) {
|
|
17228
|
-
await this._agentEventQueue;
|
|
17229
|
-
await this._settleFallbackModelScope();
|
|
17230
|
-
}
|
|
17327
|
+
const prepareTurn = async (turn, signal) => {
|
|
17328
|
+
const compactedMessages = turn.toolResults.length > 0 ? await this._preflightPostToolContext(turn.context.messages, signal) : turn.context.messages;
|
|
17329
|
+
const compactedContext = compactedMessages === turn.context.messages ? turn.context : { ...turn.context, messages: compactedMessages };
|
|
17330
|
+
const preparedTurn = compactedContext === turn.context ? turn : { ...turn, context: compactedContext };
|
|
17331
|
+
const previousSnapshot = await previousPrepareNextTurnWithContext?.(preparedTurn, signal);
|
|
17332
|
+
const previousContext = previousSnapshot?.context ?? compactedContext;
|
|
17231
17333
|
return {
|
|
17232
17334
|
...previousSnapshot,
|
|
17233
17335
|
context: {
|
|
17234
17336
|
...previousContext,
|
|
17235
|
-
messages,
|
|
17337
|
+
messages: previousContext.messages,
|
|
17236
17338
|
systemPrompt: this._systemPromptOverride ?? this._baseSystemPrompt,
|
|
17237
17339
|
tools: this.agent.state.tools.slice()
|
|
17238
17340
|
},
|
|
@@ -17240,6 +17342,14 @@ function _installAgentNextTurnRefresh() {
|
|
|
17240
17342
|
thinkingLevel: this.agent.state.thinkingLevel
|
|
17241
17343
|
};
|
|
17242
17344
|
};
|
|
17345
|
+
this.agent.prepareNextTurnWithContext = prepareTurn;
|
|
17346
|
+
}
|
|
17347
|
+
async function settleFallbackAfterTurn(session, turn, terminatingBatch) {
|
|
17348
|
+
const preserveFallbackForFailure = turn.message.role === "assistant" && !session.agent.hasQueuedMessages() && (turn.message.stopReason === "length" || session._isEmptyCompletion?.(turn.message) === true || session._isSafetyRefusal?.(turn.message) === true);
|
|
17349
|
+
if (!preserveFallbackForFailure && (turn.toolResults.length === 0 || terminatingBatch)) {
|
|
17350
|
+
await session._agentEventQueue;
|
|
17351
|
+
await session._settleFallbackModelScope();
|
|
17352
|
+
}
|
|
17243
17353
|
}
|
|
17244
17354
|
var agentSessionToolHooksMethods;
|
|
17245
17355
|
var init_agent_session_tool_hooks = __esm(() => {
|
|
@@ -17337,6 +17447,7 @@ var init_loader_virtual_modules = __esm(() => {
|
|
|
17337
17447
|
});
|
|
17338
17448
|
|
|
17339
17449
|
// src/core/extensions/loader-core.ts
|
|
17450
|
+
var runtimeEventBuses;
|
|
17340
17451
|
var init_loader_core = __esm(() => {
|
|
17341
17452
|
init_event_loop();
|
|
17342
17453
|
init_paths();
|
|
@@ -17346,6 +17457,7 @@ var init_loader_core = __esm(() => {
|
|
|
17346
17457
|
init_loader_resources();
|
|
17347
17458
|
init_loader_runtime();
|
|
17348
17459
|
init_loader_virtual_modules();
|
|
17460
|
+
runtimeEventBuses = new WeakMap;
|
|
17349
17461
|
});
|
|
17350
17462
|
|
|
17351
17463
|
// src/core/package-manager-manifest.ts
|
|
@@ -22448,7 +22560,7 @@ class FastModeSelectorComponent {
|
|
|
22448
22560
|
}
|
|
22449
22561
|
invalidate() {}
|
|
22450
22562
|
render(width) {
|
|
22451
|
-
const lines = [truncateToWidth10(theme.bold(theme.fg("accent", "
|
|
22563
|
+
const lines = [truncateToWidth10(theme.bold(theme.fg("accent", "Fast mode")), width)];
|
|
22452
22564
|
for (const line of wrapTextWithAnsi3(DESCRIPTION, Math.max(20, width))) {
|
|
22453
22565
|
lines.push(theme.fg("muted", line));
|
|
22454
22566
|
}
|
|
@@ -22531,7 +22643,7 @@ class FastModeSelectorComponent {
|
|
|
22531
22643
|
return this.getFocusedRow() === row ? theme.fg("muted", text) : theme.fg("dim", text);
|
|
22532
22644
|
}
|
|
22533
22645
|
}
|
|
22534
|
-
var ROWS, LABEL_WIDTH = 16, DESCRIPTION = "
|
|
22646
|
+
var ROWS, LABEL_WIDTH = 16, DESCRIPTION = "Use faster routing for the selected model when supported by its provider.", ROW_DETAILS;
|
|
22535
22647
|
var init_fast_mode_selector = __esm(() => {
|
|
22536
22648
|
init_theme();
|
|
22537
22649
|
ROWS = ["chat", "workflow"];
|
|
@@ -23758,6 +23870,10 @@ var init_keybindings = __esm(() => {
|
|
|
23758
23870
|
defaultKeys: windowsKeybindings ? "alt+q" : "alt+up",
|
|
23759
23871
|
description: "Restore queued messages"
|
|
23760
23872
|
},
|
|
23873
|
+
"app.message.copy": {
|
|
23874
|
+
defaultKeys: "ctrl+x",
|
|
23875
|
+
description: "Copy fullscreen selection or last agent message"
|
|
23876
|
+
},
|
|
23761
23877
|
"app.clipboard.pasteImage": {
|
|
23762
23878
|
defaultKeys: windowsKeybindings ? "alt+v" : "ctrl+v",
|
|
23763
23879
|
description: "Paste image from clipboard (text fallback)"
|
|
@@ -25143,6 +25259,9 @@ function createSettingsChangeHandler(callbacks) {
|
|
|
25143
25259
|
case "fullscreen-exit-output":
|
|
25144
25260
|
callbacks.onFullscreenExitOutputChange(newValue);
|
|
25145
25261
|
break;
|
|
25262
|
+
case "fullscreen-copy-on-select":
|
|
25263
|
+
callbacks.onFullscreenCopyOnSelectChange(newValue === "true");
|
|
25264
|
+
break;
|
|
25146
25265
|
case "editor-padding":
|
|
25147
25266
|
callbacks.onEditorPaddingXChange(parseInt(newValue, 10));
|
|
25148
25267
|
break;
|
|
@@ -25530,6 +25649,13 @@ function insertUiToggles(items, config) {
|
|
|
25530
25649
|
values: ["transcript", "resume-hint"]
|
|
25531
25650
|
});
|
|
25532
25651
|
insertAfter(items, "fullscreen-exit-output", {
|
|
25652
|
+
id: "fullscreen-copy-on-select",
|
|
25653
|
+
label: "Fullscreen copy on select",
|
|
25654
|
+
description: "Copy selected transcript text automatically on mouse release",
|
|
25655
|
+
currentValue: config.fullscreenCopyOnSelect ? "true" : "false",
|
|
25656
|
+
values: ["true", "false"]
|
|
25657
|
+
});
|
|
25658
|
+
insertAfter(items, "fullscreen-copy-on-select", {
|
|
25533
25659
|
id: "editor-padding",
|
|
25534
25660
|
label: "Editor padding",
|
|
25535
25661
|
description: "Horizontal padding for input editor (0-3)",
|
|
@@ -38660,6 +38786,8 @@ function _refreshToolRegistry(options) {
|
|
|
38660
38786
|
const allowedToolNames = this._allowedToolNames;
|
|
38661
38787
|
const excludedToolNames = this._excludedToolNames;
|
|
38662
38788
|
const isExposedTool = (name) => {
|
|
38789
|
+
if (isMandatoryRuntimeTool(name))
|
|
38790
|
+
return true;
|
|
38663
38791
|
if (allowedToolNames && !allowedToolNames.has(name)) {
|
|
38664
38792
|
return false;
|
|
38665
38793
|
}
|
|
@@ -38668,10 +38796,10 @@ function _refreshToolRegistry(options) {
|
|
|
38668
38796
|
}
|
|
38669
38797
|
return true;
|
|
38670
38798
|
};
|
|
38671
|
-
const registeredTools = this._extensionRunner.getAllRegisteredTools();
|
|
38799
|
+
const registeredTools = this._extensionRunner.getAllRegisteredTools().filter((tool) => !isMandatoryRuntimeTool(tool.definition.name) || isTrustedMandatoryRuntimeTool(tool));
|
|
38672
38800
|
const allCustomTools = [
|
|
38673
38801
|
...registeredTools,
|
|
38674
|
-
...this._customTools.map((definition) => ({
|
|
38802
|
+
...this._customTools.filter((definition) => !isMandatoryRuntimeTool(definition.name)).map((definition) => ({
|
|
38675
38803
|
definition,
|
|
38676
38804
|
sourceInfo: createSyntheticSourceInfo(`<sdk:${definition.name}>`, { source: "sdk" })
|
|
38677
38805
|
}))
|
|
@@ -38792,6 +38920,7 @@ function _buildRuntime(options) {
|
|
|
38792
38920
|
var agentSessionToolRegistryMethods;
|
|
38793
38921
|
var init_agent_session_tool_registry = __esm(() => {
|
|
38794
38922
|
init_extensions();
|
|
38923
|
+
init_mandatory_runtime_tools();
|
|
38795
38924
|
init_model_registry();
|
|
38796
38925
|
init_tools();
|
|
38797
38926
|
init_session_temp_dir();
|
|
@@ -39634,6 +39763,7 @@ class AgentSessionBase {
|
|
|
39634
39763
|
_postToolCompactionPreflightError = undefined;
|
|
39635
39764
|
_pendingPostToolCompactionGuard = undefined;
|
|
39636
39765
|
_terminatingToolCallIds = new Set;
|
|
39766
|
+
_stopAfterTurnBlockedContinuation = false;
|
|
39637
39767
|
_disposed = false;
|
|
39638
39768
|
_branchSummaryAbortController = undefined;
|
|
39639
39769
|
_sessionSummaryAbortController = undefined;
|
|
@@ -39782,11 +39912,12 @@ var init_builtin_packages = __esm(() => {
|
|
|
39782
39912
|
{ packageName: "@bastani/subagents", workspaceDirName: "subagents", distDirName: "subagents" },
|
|
39783
39913
|
{ packageName: "@bastani/mcp", workspaceDirName: "mcp", distDirName: "mcp" },
|
|
39784
39914
|
{ packageName: "@bastani/web-access", workspaceDirName: "web-access", distDirName: "web-access" },
|
|
39785
|
-
{ packageName: "@bastani/intercom", workspaceDirName: "intercom", distDirName: "intercom" }
|
|
39915
|
+
{ packageName: "@bastani/intercom", workspaceDirName: "intercom", distDirName: "intercom", mandatory: true }
|
|
39786
39916
|
];
|
|
39787
39917
|
BUILTIN_PACKAGES = WORKSPACE_BUILTINS.map((spec) => ({
|
|
39788
39918
|
packageName: spec.packageName,
|
|
39789
39919
|
distDirName: spec.distDirName,
|
|
39920
|
+
mandatory: spec.mandatory === true,
|
|
39790
39921
|
requiredEntries: requiredEntriesForBuiltin(spec.distDirName),
|
|
39791
39922
|
sourceCandidates: ({ here, packageDir, isSourceCheckout }) => isSourceCheckout ? [join37(packageDir, "..", spec.workspaceDirName), join37(here, "..", "..", "..", spec.workspaceDirName)] : []
|
|
39792
39923
|
}));
|
|
@@ -43132,7 +43263,9 @@ var init_resource_loader_extensions = __esm(() => {
|
|
|
43132
43263
|
var init_resource_loader_reload = __esm(() => {
|
|
43133
43264
|
init_event_loop();
|
|
43134
43265
|
init_paths();
|
|
43266
|
+
init_builtin_packages();
|
|
43135
43267
|
init_loader();
|
|
43268
|
+
init_mandatory_runtime_tools();
|
|
43136
43269
|
init_resource_loader_assets();
|
|
43137
43270
|
init_resource_loader_context_files();
|
|
43138
43271
|
init_resource_loader_discovery();
|
|
@@ -44289,6 +44422,28 @@ var init_settings_manager_ui_accessors = __esm(() => {
|
|
|
44289
44422
|
state.markModified("fullscreenExitOutput");
|
|
44290
44423
|
state.save();
|
|
44291
44424
|
},
|
|
44425
|
+
getFullscreenCopyOnSelect() {
|
|
44426
|
+
return settingsInternals(this).settings.fullscreenCopyOnSelect !== false;
|
|
44427
|
+
},
|
|
44428
|
+
setFullscreenCopyOnSelect(enabled) {
|
|
44429
|
+
const state = settingsInternals(this);
|
|
44430
|
+
state.globalSettings.fullscreenCopyOnSelect = enabled;
|
|
44431
|
+
state.markModified("fullscreenCopyOnSelect");
|
|
44432
|
+
state.save();
|
|
44433
|
+
},
|
|
44434
|
+
getTerminalCapabilityOverrides() {
|
|
44435
|
+
const terminal = settingsInternals(this).settings.terminal;
|
|
44436
|
+
const overrides = {};
|
|
44437
|
+
if (typeof terminal?.hyperlinks === "boolean")
|
|
44438
|
+
overrides.hyperlinks = terminal.hyperlinks;
|
|
44439
|
+
if (terminal?.images === "kitty" || terminal?.images === "iterm2")
|
|
44440
|
+
overrides.images = terminal.images;
|
|
44441
|
+
else if (terminal?.images === false)
|
|
44442
|
+
overrides.images = null;
|
|
44443
|
+
if (typeof terminal?.trueColor === "boolean")
|
|
44444
|
+
overrides.trueColor = terminal.trueColor;
|
|
44445
|
+
return overrides;
|
|
44446
|
+
},
|
|
44292
44447
|
getEditorPaddingX() {
|
|
44293
44448
|
return settingsInternals(this).settings.editorPaddingX ?? 0;
|
|
44294
44449
|
},
|
|
@@ -44434,6 +44589,14 @@ var init_resource_loader = __esm(() => {
|
|
|
44434
44589
|
init_resource_loader_core();
|
|
44435
44590
|
init_skill_catalog();
|
|
44436
44591
|
});
|
|
44592
|
+
// src/core/mandatory-resource-loader.ts
|
|
44593
|
+
var init_mandatory_resource_loader = __esm(() => {
|
|
44594
|
+
init_builtin_packages();
|
|
44595
|
+
init_loader();
|
|
44596
|
+
init_mandatory_runtime_tools();
|
|
44597
|
+
init_skill_catalog();
|
|
44598
|
+
});
|
|
44599
|
+
|
|
44437
44600
|
// src/core/model-resolver-defaults.ts
|
|
44438
44601
|
function findPreferredAvailableModel(availableModels) {
|
|
44439
44602
|
for (const [provider, defaultId] of Object.entries(defaultModelPerProvider)) {
|
|
@@ -44474,7 +44637,7 @@ var init_model_resolver_defaults = __esm(() => {
|
|
|
44474
44637
|
huggingface: "moonshotai/Kimi-K2.6",
|
|
44475
44638
|
fireworks: "accounts/fireworks/models/kimi-k2p6",
|
|
44476
44639
|
together: "moonshotai/Kimi-K2.6",
|
|
44477
|
-
baseten: "zai-org/GLM-5.
|
|
44640
|
+
baseten: "zai-org/GLM-5.3",
|
|
44478
44641
|
opencode: "kimi-k2.6",
|
|
44479
44642
|
"opencode-go": "kimi-k2.6",
|
|
44480
44643
|
"kimi-coding": "kimi-for-coding",
|
|
@@ -45132,6 +45295,7 @@ var init_session_cwd = __esm(() => {
|
|
|
45132
45295
|
var init_agent_session_services = __esm(() => {
|
|
45133
45296
|
init_config();
|
|
45134
45297
|
init_paths();
|
|
45298
|
+
init_mandatory_resource_loader();
|
|
45135
45299
|
init_model_runtime();
|
|
45136
45300
|
init_resource_loader();
|
|
45137
45301
|
init_sdk();
|
|
@@ -45468,6 +45632,7 @@ var init_sdk = __esm(() => {
|
|
|
45468
45632
|
init_agent_session();
|
|
45469
45633
|
init_auth_guidance();
|
|
45470
45634
|
init_codex_fast_mode();
|
|
45635
|
+
init_mandatory_resource_loader();
|
|
45471
45636
|
init_messages();
|
|
45472
45637
|
init_model_resolver();
|
|
45473
45638
|
init_model_runtime();
|
|
@@ -45571,7 +45736,12 @@ var init_list_models = __esm(() => {
|
|
|
45571
45736
|
});
|
|
45572
45737
|
|
|
45573
45738
|
// src/cli/startup-ui.ts
|
|
45574
|
-
import {
|
|
45739
|
+
import {
|
|
45740
|
+
ProcessTerminal,
|
|
45741
|
+
setCapabilityOverrides,
|
|
45742
|
+
setKeybindings,
|
|
45743
|
+
TuiMainScreen
|
|
45744
|
+
} from "@earendil-works/pi-tui";
|
|
45575
45745
|
var init_startup_ui = __esm(() => {
|
|
45576
45746
|
init_config();
|
|
45577
45747
|
init_keybindings();
|
|
@@ -45659,7 +45829,7 @@ var init_main_first_time_setup = __esm(() => {
|
|
|
45659
45829
|
init_startup_ui();
|
|
45660
45830
|
});
|
|
45661
45831
|
// src/cli/session-picker.ts
|
|
45662
|
-
import { ProcessTerminal as ProcessTerminal2, setKeybindings as setKeybindings2, TuiMainScreen as TuiMainScreen2 } from "@earendil-works/pi-tui";
|
|
45832
|
+
import { ProcessTerminal as ProcessTerminal2, setCapabilityOverrides as setCapabilityOverrides2, setKeybindings as setKeybindings2, TuiMainScreen as TuiMainScreen2 } from "@earendil-works/pi-tui";
|
|
45663
45833
|
var init_session_picker = __esm(() => {
|
|
45664
45834
|
init_config();
|
|
45665
45835
|
init_keybindings();
|
|
@@ -45667,7 +45837,7 @@ var init_session_picker = __esm(() => {
|
|
|
45667
45837
|
});
|
|
45668
45838
|
|
|
45669
45839
|
// src/main-session.ts
|
|
45670
|
-
import { ProcessTerminal as ProcessTerminal3, setKeybindings as setKeybindings3, TuiMainScreen as TuiMainScreen3 } from "@earendil-works/pi-tui";
|
|
45840
|
+
import { ProcessTerminal as ProcessTerminal3, setCapabilityOverrides as setCapabilityOverrides3, setKeybindings as setKeybindings3, TuiMainScreen as TuiMainScreen3 } from "@earendil-works/pi-tui";
|
|
45671
45841
|
import chalk10 from "chalk";
|
|
45672
45842
|
var init_main_session = __esm(() => {
|
|
45673
45843
|
init_session_picker();
|
|
@@ -48485,7 +48655,7 @@ var init_slash_commands = __esm(() => {
|
|
|
48485
48655
|
{ name: "tree", description: "Navigate session tree (switch branches)" },
|
|
48486
48656
|
{ name: "thinking", description: "Set thinking level", argumentHint: "<level>" },
|
|
48487
48657
|
{ name: "scoped-models", description: "Enable/disable models for ctrl+p cycling" },
|
|
48488
|
-
{ name: "fast", description: "Configure
|
|
48658
|
+
{ name: "fast", description: "Configure fast mode for chat and workflows on supported models" },
|
|
48489
48659
|
{ name: "export", description: "Export session (HTML default, or specify path: .html/.jsonl)" },
|
|
48490
48660
|
{ name: "import", description: "Import and resume a session from a JSONL file" },
|
|
48491
48661
|
{ name: "share", description: "Share session as a secret GitHub gist" },
|
|
@@ -49111,6 +49281,7 @@ function createFullscreenTui(options) {
|
|
|
49111
49281
|
openUrl: openBrowser
|
|
49112
49282
|
}),
|
|
49113
49283
|
onRightClickPaste: options.onRightClickPaste,
|
|
49284
|
+
copyOnSelect: options.copyOnSelect,
|
|
49114
49285
|
copySelection: options.copySelection ?? copySelectionToHostClipboard
|
|
49115
49286
|
}, options.shouldHandleViewportInput, options.onOverlayUnhandledInput);
|
|
49116
49287
|
}
|
|
@@ -49152,7 +49323,7 @@ function createInteractiveTuiReference(getTui) {
|
|
|
49152
49323
|
getPrototypeOf: () => Reflect.getPrototypeOf(getTui())
|
|
49153
49324
|
});
|
|
49154
49325
|
}
|
|
49155
|
-
var viewportInputListeners, viewportInputGates, overlayUnhandledInputHandlers, viewportInputReplays, viewportInputSubscriptions, SGR_MOUSE_SEQUENCE, LEFT_MOUSE_MODIFIER_MASK, AtomicTuiAltScreen, AtomicTuiMainScreen;
|
|
49326
|
+
var viewportInputListeners, viewportInputGates, overlayUnhandledInputHandlers, viewportInputReplays, overlayOwnedSelections, viewportInputSubscriptions, SGR_MOUSE_SEQUENCE, LEFT_MOUSE_MODIFIER_MASK, AtomicTuiAltScreen, AtomicTuiMainScreen;
|
|
49156
49327
|
var init_interactive_tui = __esm(() => {
|
|
49157
49328
|
init_clipboard();
|
|
49158
49329
|
init_open_browser();
|
|
@@ -49161,6 +49332,7 @@ var init_interactive_tui = __esm(() => {
|
|
|
49161
49332
|
viewportInputGates = new WeakMap;
|
|
49162
49333
|
overlayUnhandledInputHandlers = new WeakMap;
|
|
49163
49334
|
viewportInputReplays = new WeakSet;
|
|
49335
|
+
overlayOwnedSelections = new WeakSet;
|
|
49164
49336
|
viewportInputSubscriptions = new WeakMap;
|
|
49165
49337
|
SGR_MOUSE_SEQUENCE = /^\x1b\[<(\d+);\d+;\d+([Mm])/;
|
|
49166
49338
|
LEFT_MOUSE_MODIFIER_MASK = 4 | 8 | 16;
|
|
@@ -49176,8 +49348,20 @@ var init_interactive_tui = __esm(() => {
|
|
|
49176
49348
|
deferral.shouldDeferViewportInputToOverlay = () => !viewportInputReplays.has(this) && deferToOverlay?.() === true;
|
|
49177
49349
|
}
|
|
49178
49350
|
applyLineResets(lines) {
|
|
49351
|
+
if (overlayOwnedSelections.has(this) && !this.isFocusedOverlay())
|
|
49352
|
+
this.clearOverlayOwnedSelection();
|
|
49179
49353
|
return stripOverlayActiveRowMarker(super.applyLineResets(lines));
|
|
49180
49354
|
}
|
|
49355
|
+
clearOverlayOwnedSelection() {
|
|
49356
|
+
const selection = this;
|
|
49357
|
+
selection.selectionAnchor = undefined;
|
|
49358
|
+
selection.selectionFocus = undefined;
|
|
49359
|
+
selection.selectionInitialRange = undefined;
|
|
49360
|
+
selection.selectionPressActive = false;
|
|
49361
|
+
selection.selectionDragged = false;
|
|
49362
|
+
selection.lastClick = undefined;
|
|
49363
|
+
overlayOwnedSelections.delete(this);
|
|
49364
|
+
}
|
|
49181
49365
|
isPiTuiMouseSequence(data) {
|
|
49182
49366
|
if (parseMouseSequences(data))
|
|
49183
49367
|
return true;
|
|
@@ -49254,6 +49438,7 @@ var init_interactive_tui = __esm(() => {
|
|
|
49254
49438
|
if (isLeftMouseButton(sequence))
|
|
49255
49439
|
viewportListener(sequence.data);
|
|
49256
49440
|
}
|
|
49441
|
+
overlayOwnedSelections.add(this);
|
|
49257
49442
|
}
|
|
49258
49443
|
replayViewportInput(viewportListener, data) {
|
|
49259
49444
|
viewportInputReplays.add(this);
|
|
@@ -49321,7 +49506,11 @@ var init_interactive_tui = __esm(() => {
|
|
|
49321
49506
|
});
|
|
49322
49507
|
|
|
49323
49508
|
// src/modes/interactive/interactive-mode-base.ts
|
|
49324
|
-
import {
|
|
49509
|
+
import {
|
|
49510
|
+
isKeyRelease as isKeyRelease3,
|
|
49511
|
+
isViewportTUI,
|
|
49512
|
+
setCapabilityOverrides as setCapabilityOverrides4
|
|
49513
|
+
} from "@earendil-works/pi-tui";
|
|
49325
49514
|
function isFullscreenViewportAction(data, keybindings) {
|
|
49326
49515
|
return FULLSCREEN_VIEWPORT_ACTIONS.some((action) => keybindings.matches(data, action));
|
|
49327
49516
|
}
|
|
@@ -49382,6 +49571,18 @@ class InteractiveModeBase {
|
|
|
49382
49571
|
return false;
|
|
49383
49572
|
return this.defaultEditor.handleInput(data);
|
|
49384
49573
|
}
|
|
49574
|
+
setFullscreenCopyOnSelect(enabled) {
|
|
49575
|
+
if (this.renderer.mode === "fullscreen")
|
|
49576
|
+
this.renderer.setCopyOnSelect(enabled);
|
|
49577
|
+
}
|
|
49578
|
+
getFullscreenCopyOnSelect() {
|
|
49579
|
+
return this.renderer.mode === "fullscreen" ? this.renderer.getCopyOnSelect() : undefined;
|
|
49580
|
+
}
|
|
49581
|
+
async copyActiveFullscreenSelection() {
|
|
49582
|
+
if (this.renderer.mode !== "fullscreen" || !this.renderer.hasActiveSelection())
|
|
49583
|
+
return;
|
|
49584
|
+
return this.renderer.copyActiveSelectionToClipboard();
|
|
49585
|
+
}
|
|
49385
49586
|
onRightClickPaste = () => {
|
|
49386
49587
|
this.handleRightClickPaste();
|
|
49387
49588
|
};
|
|
@@ -49581,11 +49782,13 @@ class InteractiveModeBase {
|
|
|
49581
49782
|
await this.rebindCurrentSession();
|
|
49582
49783
|
await this.themeController.applyFromSettings();
|
|
49583
49784
|
});
|
|
49785
|
+
setCapabilityOverrides4(this.settingsManager.getTerminalCapabilityOverrides());
|
|
49584
49786
|
this.version = VERSION;
|
|
49585
49787
|
this.renderer = createInteractiveTui({
|
|
49586
49788
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
49587
49789
|
logDirectory: runtimeHost.services.agentDir,
|
|
49588
49790
|
terminal: options.terminal,
|
|
49791
|
+
copyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
49589
49792
|
onRightClickPaste: this.onRightClickPaste,
|
|
49590
49793
|
shouldHandleViewportInput: this.shouldHandleViewportInput,
|
|
49591
49794
|
onOverlayUnhandledInput: this.onOverlayUnhandledInput,
|
|
@@ -50708,6 +50911,7 @@ var init_interactive_deferred_startup = __esm(() => {
|
|
|
50708
50911
|
try {
|
|
50709
50912
|
await this.bindCurrentSessionExtensions();
|
|
50710
50913
|
await this.session.reload({ reason: "startup" });
|
|
50914
|
+
this.applyRuntimeSettings();
|
|
50711
50915
|
this.rebuildChatFromMessages();
|
|
50712
50916
|
if (!this.promptTurnWorkingLoaderActive) {
|
|
50713
50917
|
this.stopWorkingLoader();
|
|
@@ -51396,6 +51600,7 @@ ${warningLines}`, 0, 0));
|
|
|
51396
51600
|
});
|
|
51397
51601
|
|
|
51398
51602
|
// src/modes/interactive/interactive-session-runtime.ts
|
|
51603
|
+
import { setCapabilityOverrides as setCapabilityOverrides5 } from "@earendil-works/pi-tui";
|
|
51399
51604
|
var init_interactive_session_runtime = __esm(() => {
|
|
51400
51605
|
init_interactive_mode_base();
|
|
51401
51606
|
init_interactive_mode_deps();
|
|
@@ -51482,6 +51687,8 @@ var init_interactive_session_runtime = __esm(() => {
|
|
|
51482
51687
|
}
|
|
51483
51688
|
};
|
|
51484
51689
|
InteractiveModeBase.prototype.applyRuntimeSettings = function() {
|
|
51690
|
+
setCapabilityOverrides5(this.settingsManager.getTerminalCapabilityOverrides());
|
|
51691
|
+
this.setFullscreenCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());
|
|
51485
51692
|
this.transcriptScrollView?.setScrollbar(this.settingsManager.getFullscreenScrollbar());
|
|
51486
51693
|
this.footer.setSession(this.session);
|
|
51487
51694
|
this.usageMeter.setSession(this.session);
|
|
@@ -51551,7 +51758,7 @@ var init_interactive_extension_runtime = __esm(() => {
|
|
|
51551
51758
|
if (shortcuts.size === 0)
|
|
51552
51759
|
return;
|
|
51553
51760
|
const createContext = () => ({
|
|
51554
|
-
ui:
|
|
51761
|
+
ui: extensionRunner.getUIContext(),
|
|
51555
51762
|
mode: "tui",
|
|
51556
51763
|
hasUI: true,
|
|
51557
51764
|
cwd: this.sessionManager.getCwd(),
|
|
@@ -52998,6 +53205,9 @@ var init_interactive_input_handling = __esm(() => {
|
|
|
52998
53205
|
});
|
|
52999
53206
|
this.defaultEditor.onAction("app.message.followUp", () => this.handleFollowUp());
|
|
53000
53207
|
this.defaultEditor.onAction("app.message.dequeue", () => this.handleDequeue());
|
|
53208
|
+
this.defaultEditor.onAction("app.message.copy", () => {
|
|
53209
|
+
this.handleCopyCommand({ preferSelection: true });
|
|
53210
|
+
});
|
|
53001
53211
|
this.defaultEditor.onAction("app.session.new", () => this.handleClearCommand());
|
|
53002
53212
|
this.defaultEditor.onAction("app.session.tree", () => this.showTreeSelector());
|
|
53003
53213
|
this.defaultEditor.onAction("app.session.fork", () => this.showUserMessageSelector());
|
|
@@ -53905,7 +54115,8 @@ var init_interactive_agent_events = __esm(() => {
|
|
|
53905
54115
|
} else if (event.reason === "manual") {
|
|
53906
54116
|
this.manualCompactionTakeoverPending = false;
|
|
53907
54117
|
}
|
|
53908
|
-
|
|
54118
|
+
const resumesActiveRun = event.midTurn && !event.aborted && !event.errorMessage && !manualTakeoverPending;
|
|
54119
|
+
if (!manualTakeoverPending && !resumesActiveRun && this.settingsManager.getShowTerminalProgress()) {
|
|
53909
54120
|
this.ui.terminal.setProgress(false);
|
|
53910
54121
|
}
|
|
53911
54122
|
if (!manualTakeoverPending && this.autoCompactionEscapeHandlerSaved) {
|
|
@@ -54921,7 +55132,7 @@ var init_interactive_selectors = __esm(() => {
|
|
|
54921
55132
|
};
|
|
54922
55133
|
InteractiveModeBase.prototype.showFastModeSelector = function() {
|
|
54923
55134
|
if (!this.hasCodexFastModeSupportedModels()) {
|
|
54924
|
-
this.showWarning("
|
|
55135
|
+
this.showWarning("Fast mode isn't available for any configured model.");
|
|
54925
55136
|
return;
|
|
54926
55137
|
}
|
|
54927
55138
|
this.showSelector((done) => {
|
|
@@ -54980,6 +55191,7 @@ var init_interactive_selectors = __esm(() => {
|
|
|
54980
55191
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
54981
55192
|
fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
|
|
54982
55193
|
fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
|
|
55194
|
+
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
54983
55195
|
editorPaddingX: this.settingsManager.getEditorPaddingX(),
|
|
54984
55196
|
outputPad: this.settingsManager.getOutputPad(),
|
|
54985
55197
|
showCacheMissNotices: this.settingsManager.getShowCacheMissNotices(),
|
|
@@ -55097,6 +55309,10 @@ var init_interactive_selectors = __esm(() => {
|
|
|
55097
55309
|
onFullscreenExitOutputChange: (output) => {
|
|
55098
55310
|
this.settingsManager.setFullscreenExitOutput(output);
|
|
55099
55311
|
},
|
|
55312
|
+
onFullscreenCopyOnSelectChange: (enabled) => {
|
|
55313
|
+
this.settingsManager.setFullscreenCopyOnSelect(enabled);
|
|
55314
|
+
this.setFullscreenCopyOnSelect(enabled);
|
|
55315
|
+
},
|
|
55100
55316
|
onEditorPaddingXChange: (padding) => {
|
|
55101
55317
|
this.settingsManager.setEditorPaddingX(padding);
|
|
55102
55318
|
this.defaultEditor.setPaddingX(padding);
|
|
@@ -56083,18 +56299,8 @@ var init_interactive_slash_commands = __esm(() => {
|
|
|
56083
56299
|
activeHeader.setExpanded(this.toolOutputExpanded);
|
|
56084
56300
|
}
|
|
56085
56301
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
56086
|
-
this.
|
|
56302
|
+
this.applyRuntimeSettings();
|
|
56087
56303
|
await this.themeController.applyFromSettings();
|
|
56088
|
-
const editorPaddingX = this.settingsManager.getEditorPaddingX();
|
|
56089
|
-
const autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();
|
|
56090
|
-
this.defaultEditor.setPaddingX(editorPaddingX);
|
|
56091
|
-
this.defaultEditor.setAutocompleteMaxVisible(autocompleteMaxVisible);
|
|
56092
|
-
if (this.editor !== this.defaultEditor) {
|
|
56093
|
-
this.editor.setPaddingX?.(editorPaddingX);
|
|
56094
|
-
this.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);
|
|
56095
|
-
}
|
|
56096
|
-
this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());
|
|
56097
|
-
this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
|
|
56098
56304
|
this.setupAutocompleteProvider();
|
|
56099
56305
|
const runner = this.session.extensionRunner;
|
|
56100
56306
|
this.setupExtensionShortcuts(runner);
|
|
@@ -56287,7 +56493,12 @@ Gist: ${hyperlink3(gistUrl, gistUrl)}`);
|
|
|
56287
56493
|
}
|
|
56288
56494
|
}
|
|
56289
56495
|
};
|
|
56290
|
-
InteractiveModeBase.prototype.handleCopyCommand = async function() {
|
|
56496
|
+
InteractiveModeBase.prototype.handleCopyCommand = async function(options = {}) {
|
|
56497
|
+
if (options.preferSelection && this.getFullscreenCopyOnSelect() === false) {
|
|
56498
|
+
const selectionCopied = await this.copyActiveFullscreenSelection();
|
|
56499
|
+
if (selectionCopied !== undefined)
|
|
56500
|
+
return;
|
|
56501
|
+
}
|
|
56291
56502
|
const text = this.session.getLastAssistantText();
|
|
56292
56503
|
if (!text) {
|
|
56293
56504
|
this.showError("No agent messages to copy yet.");
|
|
@@ -56834,6 +57045,7 @@ var init_rpc_extension_ui = __esm(() => {
|
|
|
56834
57045
|
});
|
|
56835
57046
|
|
|
56836
57047
|
// src/modes/rpc/rpc-session-binding.ts
|
|
57048
|
+
import { setCapabilityOverrides as setCapabilityOverrides6 } from "@earendil-works/pi-tui";
|
|
56837
57049
|
var init_rpc_session_binding = __esm(() => {
|
|
56838
57050
|
init_footer_data_provider();
|
|
56839
57051
|
init_output_guard();
|
|
@@ -56910,7 +57122,7 @@ var init_config_selector = __esm(() => {
|
|
|
56910
57122
|
});
|
|
56911
57123
|
|
|
56912
57124
|
// src/cli/config-selector.ts
|
|
56913
|
-
import { ProcessTerminal as ProcessTerminal6, TuiMainScreen as TuiMainScreen8 } from "@earendil-works/pi-tui";
|
|
57125
|
+
import { ProcessTerminal as ProcessTerminal6, setCapabilityOverrides as setCapabilityOverrides7, TuiMainScreen as TuiMainScreen8 } from "@earendil-works/pi-tui";
|
|
56914
57126
|
var init_config_selector2 = __esm(() => {
|
|
56915
57127
|
init_config_selector();
|
|
56916
57128
|
init_theme();
|
|
@@ -56957,6 +57169,7 @@ var init_package_manager_cli = __esm(() => {
|
|
|
56957
57169
|
});
|
|
56958
57170
|
|
|
56959
57171
|
// src/main.ts
|
|
57172
|
+
import { setCapabilityOverrides as setCapabilityOverrides8 } from "@earendil-works/pi-tui";
|
|
56960
57173
|
import chalk15 from "chalk";
|
|
56961
57174
|
var init_main = __esm(() => {
|
|
56962
57175
|
init_args();
|
|
@@ -56971,6 +57184,7 @@ var init_main = __esm(() => {
|
|
|
56971
57184
|
init_auth_storage();
|
|
56972
57185
|
init_builtin_packages();
|
|
56973
57186
|
init_http_dispatcher();
|
|
57187
|
+
init_mandatory_resource_loader();
|
|
56974
57188
|
init_model_resolver();
|
|
56975
57189
|
init_model_runtime();
|
|
56976
57190
|
init_output_guard();
|
|
@@ -63540,8 +63754,8 @@ class ScopedDurableBackend {
|
|
|
63540
63754
|
async recordAdditiveCheckpointBestEffort(checkpoint) {
|
|
63541
63755
|
return await this.inner.recordAdditiveCheckpointBestEffort(this.remap(checkpoint));
|
|
63542
63756
|
}
|
|
63543
|
-
flush() {
|
|
63544
|
-
return this.inner.flush();
|
|
63757
|
+
flush(workflowId) {
|
|
63758
|
+
return workflowId === undefined ? this.inner.flush() : this.inner.flush(this.scope.rootWorkflowId);
|
|
63545
63759
|
}
|
|
63546
63760
|
getToolOutput(_workflowId, argsHash) {
|
|
63547
63761
|
return this.inner.getToolOutput(this.scope.rootWorkflowId, this.scopeKey(argsHash));
|
|
@@ -67422,17 +67636,7 @@ function resolveStageGroup(stageOptions, workflowGroup) {
|
|
|
67422
67636
|
const trimmed = group.trim();
|
|
67423
67637
|
return trimmed.length > 0 ? trimmed : undefined;
|
|
67424
67638
|
}
|
|
67425
|
-
function stageHasIntercomAccess(
|
|
67426
|
-
if (!stageOptions)
|
|
67427
|
-
return true;
|
|
67428
|
-
if (stageOptions.noTools === "all")
|
|
67429
|
-
return false;
|
|
67430
|
-
const tools = stageOptions.tools;
|
|
67431
|
-
if (Array.isArray(tools) && !tools.includes("intercom"))
|
|
67432
|
-
return false;
|
|
67433
|
-
const excluded = stageOptions.excludedTools;
|
|
67434
|
-
if (Array.isArray(excluded) && excluded.includes("intercom"))
|
|
67435
|
-
return false;
|
|
67639
|
+
function stageHasIntercomAccess(_stageOptions) {
|
|
67436
67640
|
return true;
|
|
67437
67641
|
}
|
|
67438
67642
|
function stageCanUseWorkflowPendingStageRoute(stageOptions, workflowGroup) {
|
|
@@ -67888,11 +68092,11 @@ function wrapUiWithDurable(base, deps) {
|
|
|
67888
68092
|
};
|
|
67889
68093
|
const releasePending = async (identity, token) => {
|
|
67890
68094
|
releaseDurablePrompt(deps.backend, deps.workflowId, identity.hash, token);
|
|
67891
|
-
await deps.backend.flush();
|
|
68095
|
+
await deps.backend.flush(deps.workflowId);
|
|
67892
68096
|
};
|
|
67893
68097
|
const beginPending = (identity) => {
|
|
67894
68098
|
const token = reserveDurablePrompt(deps.backend, deps.workflowId, identity.hash);
|
|
67895
|
-
const write = deps.backend.flush();
|
|
68099
|
+
const write = deps.backend.flush(deps.workflowId);
|
|
67896
68100
|
return { token, write };
|
|
67897
68101
|
};
|
|
67898
68102
|
const waitForPendingWrite = async (identity, pending) => {
|
|
@@ -67903,7 +68107,7 @@ function wrapUiWithDurable(base, deps) {
|
|
|
67903
68107
|
} catch (error) {
|
|
67904
68108
|
releaseDurablePrompt(deps.backend, deps.workflowId, identity.hash, pending.token);
|
|
67905
68109
|
try {
|
|
67906
|
-
await deps.backend.flush();
|
|
68110
|
+
await deps.backend.flush(deps.workflowId);
|
|
67907
68111
|
} catch {}
|
|
67908
68112
|
throw error;
|
|
67909
68113
|
}
|
|
@@ -68251,7 +68455,7 @@ async function admitDurableRootRun(args) {
|
|
|
68251
68455
|
args.backend.setWorkflowStatus(args.runId, "running");
|
|
68252
68456
|
}
|
|
68253
68457
|
if (!args.isChildRun)
|
|
68254
|
-
await args.backend.flush();
|
|
68458
|
+
await args.backend.flush(args.runId);
|
|
68255
68459
|
}
|
|
68256
68460
|
|
|
68257
68461
|
// dist/builtin/workflows/src/shared/returned-run-status.ts
|
|
@@ -68375,7 +68579,7 @@ async function finalizeDurableTerminalStatus(input2) {
|
|
|
68375
68579
|
} : undefined;
|
|
68376
68580
|
input2.durableBackend.setWorkflowStatus(input2.runId, durableStatus, undefined, input2.runSnapshot.resumable, failure2);
|
|
68377
68581
|
}
|
|
68378
|
-
await input2.durableBackend.flush();
|
|
68582
|
+
await input2.durableBackend.flush(input2.runId);
|
|
68379
68583
|
}
|
|
68380
68584
|
function toDurableStatus(status) {
|
|
68381
68585
|
switch (status) {
|
|
@@ -74695,7 +74899,7 @@ async function run(def, inputs, opts = {}) {
|
|
|
74695
74899
|
const result = normalizeWorkflowRunOutput(def.name, rawResult);
|
|
74696
74900
|
assertWorkflowRunOutputs(def.name, result, def.outputs);
|
|
74697
74901
|
assertWorkflowCreatedExecution(runSnapshot);
|
|
74698
|
-
await durableBackend.flush();
|
|
74902
|
+
await durableBackend.flush(runId);
|
|
74699
74903
|
const returned = classifyReturnedRunStatus(result, runSnapshot);
|
|
74700
74904
|
const recorded = activeStore.recordRunEnd(runId, returned.status, result, returned.error, returned.metadata);
|
|
74701
74905
|
appendRunEndWhenRecorded(opts.persistence, recorded, {
|
|
@@ -74711,7 +74915,7 @@ async function run(def, inputs, opts = {}) {
|
|
|
74711
74915
|
if (opts.parentRun === undefined)
|
|
74712
74916
|
recordRunTimingCheckpoint(durableBackend, runSnapshot);
|
|
74713
74917
|
durableBackend.setWorkflowStatus(runId, returned.status, undefined, returned.metadata?.resumable);
|
|
74714
|
-
await durableBackend.flush();
|
|
74918
|
+
await durableBackend.flush(runId);
|
|
74715
74919
|
return reconcileTerminalRunResult(runId, runSnapshot, activeStore, { status: returned.status, result, error: returned.error }, opts.onRunEnd);
|
|
74716
74920
|
} catch (err) {
|
|
74717
74921
|
terminalEvents.selectFailure(err);
|