@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
|
@@ -9230,11 +9230,13 @@ function runSynchronousCallback(descriptor, callback) {
|
|
|
9230
9230
|
}
|
|
9231
9231
|
}
|
|
9232
9232
|
async function runCallback(descriptor, callback) {
|
|
9233
|
+
if (!reporter)
|
|
9234
|
+
return callback();
|
|
9235
|
+
await yieldToEventLoop();
|
|
9233
9236
|
const active = beginActivity(descriptor);
|
|
9234
9237
|
if (!active)
|
|
9235
9238
|
return callback();
|
|
9236
9239
|
try {
|
|
9237
|
-
await yieldToEventLoop();
|
|
9238
9240
|
return await callback();
|
|
9239
9241
|
} finally {
|
|
9240
9242
|
active.reporter.finished(active.activity.id);
|
|
@@ -11966,12 +11968,34 @@ var init_runner_events = __esm(() => {
|
|
|
11966
11968
|
init_callback_activity();
|
|
11967
11969
|
});
|
|
11968
11970
|
|
|
11971
|
+
// src/core/mandatory-runtime-tools.ts
|
|
11972
|
+
function isTrustedMandatoryRuntimeTool(registration) {
|
|
11973
|
+
return MANDATORY_TOOL_NAMES.has(registration.definition.name) && TRUSTED_MANDATORY_DEFINITIONS.has(registration.definition);
|
|
11974
|
+
}
|
|
11975
|
+
function isMandatoryRuntimeTool(name) {
|
|
11976
|
+
return MANDATORY_TOOL_NAMES.has(name);
|
|
11977
|
+
}
|
|
11978
|
+
function appendRegisteredMandatoryTools(tools, registry) {
|
|
11979
|
+
for (const name of MANDATORY_TOOL_NAMES) {
|
|
11980
|
+
const tool = registry.get(name);
|
|
11981
|
+
if (tool && !tools.some((candidate) => candidate.name === name))
|
|
11982
|
+
tools.push(tool);
|
|
11983
|
+
}
|
|
11984
|
+
return tools;
|
|
11985
|
+
}
|
|
11986
|
+
var MANDATORY_TOOL_NAMES, TRUSTED_MANDATORY_DEFINITIONS;
|
|
11987
|
+
var init_mandatory_runtime_tools = __esm(() => {
|
|
11988
|
+
MANDATORY_TOOL_NAMES = new Set(["intercom"]);
|
|
11989
|
+
TRUSTED_MANDATORY_DEFINITIONS = new WeakSet;
|
|
11990
|
+
});
|
|
11991
|
+
|
|
11969
11992
|
// src/core/extensions/runner-registries.ts
|
|
11970
11993
|
function collectRegisteredTools(extensions) {
|
|
11971
11994
|
const toolsByName = new Map;
|
|
11972
11995
|
for (const ext of extensions) {
|
|
11973
11996
|
for (const tool of ext.tools.values()) {
|
|
11974
|
-
|
|
11997
|
+
const existing = toolsByName.get(tool.definition.name);
|
|
11998
|
+
if (!existing || isMandatoryRuntimeTool(tool.definition.name) && isTrustedMandatoryRuntimeTool(tool)) {
|
|
11975
11999
|
toolsByName.set(tool.definition.name, tool);
|
|
11976
12000
|
}
|
|
11977
12001
|
}
|
|
@@ -11979,13 +12003,16 @@ function collectRegisteredTools(extensions) {
|
|
|
11979
12003
|
return Array.from(toolsByName.values());
|
|
11980
12004
|
}
|
|
11981
12005
|
function findToolDefinition(extensions, toolName) {
|
|
12006
|
+
let first;
|
|
11982
12007
|
for (const ext of extensions) {
|
|
11983
12008
|
const tool = ext.tools.get(toolName);
|
|
11984
|
-
if (tool)
|
|
12009
|
+
if (!tool)
|
|
12010
|
+
continue;
|
|
12011
|
+
first ??= tool;
|
|
12012
|
+
if (isMandatoryRuntimeTool(toolName) && isTrustedMandatoryRuntimeTool(tool))
|
|
11985
12013
|
return tool.definition;
|
|
11986
|
-
}
|
|
11987
12014
|
}
|
|
11988
|
-
return;
|
|
12015
|
+
return first?.definition;
|
|
11989
12016
|
}
|
|
11990
12017
|
function collectFlags(extensions) {
|
|
11991
12018
|
const allFlags = new Map;
|
|
@@ -12053,6 +12080,9 @@ function resolveRegisteredCommands(extensions) {
|
|
|
12053
12080
|
return { ...command, invocationName };
|
|
12054
12081
|
});
|
|
12055
12082
|
}
|
|
12083
|
+
var init_runner_registries = __esm(() => {
|
|
12084
|
+
init_mandatory_runtime_tools();
|
|
12085
|
+
});
|
|
12056
12086
|
|
|
12057
12087
|
// src/core/extensions/runner-shortcuts.ts
|
|
12058
12088
|
function resolveExtensionShortcuts(extensions, resolvedKeybindings, hasUI) {
|
|
@@ -12116,6 +12146,7 @@ var init_runner_shortcuts = __esm(() => {
|
|
|
12116
12146
|
"app.thinking.toggle",
|
|
12117
12147
|
"app.editor.external",
|
|
12118
12148
|
"app.message.followUp",
|
|
12149
|
+
"app.message.copy",
|
|
12119
12150
|
"tui.input.submit",
|
|
12120
12151
|
"tui.select.confirm",
|
|
12121
12152
|
"tui.select.cancel",
|
|
@@ -12242,6 +12273,8 @@ class ExtensionRunner {
|
|
|
12242
12273
|
shortcutDiagnostics = [];
|
|
12243
12274
|
commandDiagnostics = [];
|
|
12244
12275
|
staleMessage;
|
|
12276
|
+
uiPromptBinding = 0;
|
|
12277
|
+
activeUIPrompt;
|
|
12245
12278
|
constructor(extensions, runtime, cwd, sessionManager, modelRegistry, orchestrationContext, subagentPolicy) {
|
|
12246
12279
|
this.extensions = extensions;
|
|
12247
12280
|
this.runtime = runtime;
|
|
@@ -12336,9 +12369,71 @@ class ExtensionRunner {
|
|
|
12336
12369
|
this.reloadHandler = async () => {};
|
|
12337
12370
|
}
|
|
12338
12371
|
setUIContext(uiContext, mode = "print") {
|
|
12339
|
-
this.
|
|
12372
|
+
this.endActiveUIPrompt();
|
|
12373
|
+
const binding = ++this.uiPromptBinding;
|
|
12374
|
+
this.uiContext = uiContext ? this.wrapUIPromptContext(uiContext, binding) : noOpUIContext;
|
|
12340
12375
|
this.mode = mode;
|
|
12341
12376
|
}
|
|
12377
|
+
wrapUIPromptContext(ui, binding) {
|
|
12378
|
+
return {
|
|
12379
|
+
...ui,
|
|
12380
|
+
select: (title, options, opts) => this.withUIPrompt(binding, "select", title, () => ui.select(title, options, opts)),
|
|
12381
|
+
confirm: (title, message, opts) => this.withUIPrompt(binding, "confirm", title, () => ui.confirm(title, message, opts)),
|
|
12382
|
+
input: (title, placeholder, opts) => this.withUIPrompt(binding, "input", title, () => ui.input(title, placeholder, opts)),
|
|
12383
|
+
editor: (title, prefill, opts) => this.withUIPrompt(binding, "editor", title, () => ui.editor(title, prefill, opts)),
|
|
12384
|
+
custom: (factory, options) => this.withUIPrompt(binding, "custom", undefined, () => ui.custom(factory, options))
|
|
12385
|
+
};
|
|
12386
|
+
}
|
|
12387
|
+
withUIPrompt(binding, kind, title, run) {
|
|
12388
|
+
if (binding !== this.uiPromptBinding)
|
|
12389
|
+
return run();
|
|
12390
|
+
let prompt = this.activeUIPrompt;
|
|
12391
|
+
if (!prompt) {
|
|
12392
|
+
prompt = { depth: 0, kind, title };
|
|
12393
|
+
this.activeUIPrompt = prompt;
|
|
12394
|
+
this.emitUIPromptEvent({
|
|
12395
|
+
type: "ui_prompt_start",
|
|
12396
|
+
reason: "ui_prompt",
|
|
12397
|
+
kind,
|
|
12398
|
+
...title === undefined ? {} : { title }
|
|
12399
|
+
});
|
|
12400
|
+
}
|
|
12401
|
+
prompt.depth += 1;
|
|
12402
|
+
let finished = false;
|
|
12403
|
+
const finish = () => {
|
|
12404
|
+
if (finished)
|
|
12405
|
+
return;
|
|
12406
|
+
finished = true;
|
|
12407
|
+
if (this.activeUIPrompt !== prompt)
|
|
12408
|
+
return;
|
|
12409
|
+
prompt.depth -= 1;
|
|
12410
|
+
if (prompt.depth === 0)
|
|
12411
|
+
this.endActiveUIPrompt(prompt);
|
|
12412
|
+
};
|
|
12413
|
+
try {
|
|
12414
|
+
return run().finally(finish);
|
|
12415
|
+
} catch (error) {
|
|
12416
|
+
finish();
|
|
12417
|
+
throw error;
|
|
12418
|
+
}
|
|
12419
|
+
}
|
|
12420
|
+
endActiveUIPrompt(prompt = this.activeUIPrompt) {
|
|
12421
|
+
if (!prompt || this.activeUIPrompt !== prompt)
|
|
12422
|
+
return;
|
|
12423
|
+
this.activeUIPrompt = undefined;
|
|
12424
|
+
prompt.depth = 0;
|
|
12425
|
+
this.emitUIPromptEvent({
|
|
12426
|
+
type: "ui_prompt_end",
|
|
12427
|
+
reason: "ui_prompt",
|
|
12428
|
+
kind: prompt.kind,
|
|
12429
|
+
...prompt.title === undefined ? {} : { title: prompt.title }
|
|
12430
|
+
});
|
|
12431
|
+
}
|
|
12432
|
+
emitUIPromptEvent(event) {
|
|
12433
|
+
queueMicrotask(() => {
|
|
12434
|
+
this.emit(event);
|
|
12435
|
+
});
|
|
12436
|
+
}
|
|
12342
12437
|
getUIContext() {
|
|
12343
12438
|
return this.uiContext;
|
|
12344
12439
|
}
|
|
@@ -12515,6 +12610,7 @@ var init_runner = __esm(() => {
|
|
|
12515
12610
|
init_loader_runtime();
|
|
12516
12611
|
init_runner_context();
|
|
12517
12612
|
init_runner_events();
|
|
12613
|
+
init_runner_registries();
|
|
12518
12614
|
init_runner_shortcuts();
|
|
12519
12615
|
init_runner_ui();
|
|
12520
12616
|
init_stale_context();
|
|
@@ -14718,11 +14814,13 @@ async function _runAgentContinue() {
|
|
|
14718
14814
|
}
|
|
14719
14815
|
async function _continueQueuedAgentMessages() {
|
|
14720
14816
|
await this._agentEventQueue;
|
|
14721
|
-
while (!this._queuedMessagesPaused && this.agent.hasQueuedMessages()) {
|
|
14817
|
+
while (!this._stopAfterTurnBlockedContinuation && !this._queuedMessagesPaused && this.agent.hasQueuedMessages()) {
|
|
14722
14818
|
await this.agent.continue();
|
|
14723
14819
|
await this.waitForRetry();
|
|
14724
14820
|
await this._agentEventQueue;
|
|
14725
14821
|
}
|
|
14822
|
+
if (this._stopAfterTurnBlockedContinuation)
|
|
14823
|
+
return;
|
|
14726
14824
|
await answerAdmittedQueuedMessage(this);
|
|
14727
14825
|
}
|
|
14728
14826
|
async function answerAdmittedQueuedMessage(session) {
|
|
@@ -16113,14 +16211,13 @@ function getToolDefinition(name) {
|
|
|
16113
16211
|
}
|
|
16114
16212
|
function setActiveToolsByName(toolNames) {
|
|
16115
16213
|
const tools = [];
|
|
16116
|
-
const validToolNames = [];
|
|
16117
16214
|
for (const name of toolNames) {
|
|
16118
16215
|
const tool = this._toolRegistry.get(name);
|
|
16119
|
-
if (tool)
|
|
16216
|
+
if (tool)
|
|
16120
16217
|
tools.push(tool);
|
|
16121
|
-
validToolNames.push(name);
|
|
16122
|
-
}
|
|
16123
16218
|
}
|
|
16219
|
+
appendRegisteredMandatoryTools(tools, this._toolRegistry);
|
|
16220
|
+
const validToolNames = tools.map((tool) => tool.name);
|
|
16124
16221
|
this.agent.state.tools = tools;
|
|
16125
16222
|
this._baseSystemPrompt = this._rebuildSystemPrompt(validToolNames);
|
|
16126
16223
|
this.agent.state.systemPrompt = this._systemPromptOverride ?? this._baseSystemPrompt;
|
|
@@ -16177,7 +16274,7 @@ function _rebuildSystemPrompt(toolNames) {
|
|
|
16177
16274
|
customPrompt: loaderSystemPrompt,
|
|
16178
16275
|
appendSystemPrompt,
|
|
16179
16276
|
selectedTools: validToolNames,
|
|
16180
|
-
excludedTools: this._excludedToolNames ? Array.from(this._excludedToolNames) : undefined,
|
|
16277
|
+
excludedTools: this._excludedToolNames ? Array.from(this._excludedToolNames).filter((name) => !isMandatoryRuntimeTool(name)) : undefined,
|
|
16181
16278
|
toolSnippets,
|
|
16182
16279
|
promptGuidelines
|
|
16183
16280
|
};
|
|
@@ -16190,6 +16287,7 @@ function _refreshBaseSystemPromptFromActiveTools() {
|
|
|
16190
16287
|
}
|
|
16191
16288
|
var agentSessionStateMethods;
|
|
16192
16289
|
var init_agent_session_state = __esm(() => {
|
|
16290
|
+
init_mandatory_runtime_tools();
|
|
16193
16291
|
init_skill_catalog();
|
|
16194
16292
|
init_system_prompt();
|
|
16195
16293
|
agentSessionStateMethods = {
|
|
@@ -17217,6 +17315,17 @@ function _installAgentToolHooks() {
|
|
|
17217
17315
|
}
|
|
17218
17316
|
function _installAgentNextTurnRefresh() {
|
|
17219
17317
|
const previousPrepareNextTurnWithContext = this.agent.prepareNextTurnWithContext ?? (this.agent.prepareNextTurn ? async (_turn, signal) => await this.agent.prepareNextTurn?.(signal) : undefined);
|
|
17318
|
+
const previousShouldStopAfterTurn = this.agent.shouldStopAfterTurn;
|
|
17319
|
+
this.agent.shouldStopAfterTurn = async (turn, signal) => {
|
|
17320
|
+
const toolCallIds = turn.message.content.filter((part) => part.type === "toolCall").map((part) => part.id);
|
|
17321
|
+
const terminatingBatch = toolCallIds.length > 0 && toolCallIds.every((id) => this._terminatingToolCallIds.has(id));
|
|
17322
|
+
for (const id of toolCallIds)
|
|
17323
|
+
this._terminatingToolCallIds.delete(id);
|
|
17324
|
+
const shouldStop = await previousShouldStopAfterTurn?.(turn, signal) ?? false;
|
|
17325
|
+
this._stopAfterTurnBlockedContinuation = shouldStop;
|
|
17326
|
+
await settleFallbackAfterTurn(this, turn, terminatingBatch);
|
|
17327
|
+
return shouldStop;
|
|
17328
|
+
};
|
|
17220
17329
|
const previousTransformContext = this.agent.transformContext;
|
|
17221
17330
|
this.agent.transformContext = async (messages, signal) => {
|
|
17222
17331
|
const transformed = previousTransformContext ? await previousTransformContext(messages, signal) : messages;
|
|
@@ -17224,24 +17333,17 @@ function _installAgentNextTurnRefresh() {
|
|
|
17224
17333
|
assertToolPairingInvariant(guarded);
|
|
17225
17334
|
return guarded;
|
|
17226
17335
|
};
|
|
17227
|
-
|
|
17228
|
-
const
|
|
17229
|
-
const
|
|
17230
|
-
const
|
|
17231
|
-
const
|
|
17232
|
-
|
|
17233
|
-
this._terminatingToolCallIds.delete(id);
|
|
17234
|
-
const messages = turn.toolResults.length > 0 && !terminatingBatch ? await this._preflightPostToolContext(previousContext.messages, signal) : previousContext.messages;
|
|
17235
|
-
const preserveFallbackForFailure = turn.message.role === "assistant" && !this.agent.hasQueuedMessages() && (turn.message.stopReason === "length" || this._isEmptyCompletion?.(turn.message) === true || this._isSafetyRefusal?.(turn.message) === true);
|
|
17236
|
-
if (!preserveFallbackForFailure && (turn.toolResults.length === 0 || terminatingBatch)) {
|
|
17237
|
-
await this._agentEventQueue;
|
|
17238
|
-
await this._settleFallbackModelScope();
|
|
17239
|
-
}
|
|
17336
|
+
const prepareTurn = async (turn, signal) => {
|
|
17337
|
+
const compactedMessages = turn.toolResults.length > 0 ? await this._preflightPostToolContext(turn.context.messages, signal) : turn.context.messages;
|
|
17338
|
+
const compactedContext = compactedMessages === turn.context.messages ? turn.context : { ...turn.context, messages: compactedMessages };
|
|
17339
|
+
const preparedTurn = compactedContext === turn.context ? turn : { ...turn, context: compactedContext };
|
|
17340
|
+
const previousSnapshot = await previousPrepareNextTurnWithContext?.(preparedTurn, signal);
|
|
17341
|
+
const previousContext = previousSnapshot?.context ?? compactedContext;
|
|
17240
17342
|
return {
|
|
17241
17343
|
...previousSnapshot,
|
|
17242
17344
|
context: {
|
|
17243
17345
|
...previousContext,
|
|
17244
|
-
messages,
|
|
17346
|
+
messages: previousContext.messages,
|
|
17245
17347
|
systemPrompt: this._systemPromptOverride ?? this._baseSystemPrompt,
|
|
17246
17348
|
tools: this.agent.state.tools.slice()
|
|
17247
17349
|
},
|
|
@@ -17249,6 +17351,14 @@ function _installAgentNextTurnRefresh() {
|
|
|
17249
17351
|
thinkingLevel: this.agent.state.thinkingLevel
|
|
17250
17352
|
};
|
|
17251
17353
|
};
|
|
17354
|
+
this.agent.prepareNextTurnWithContext = prepareTurn;
|
|
17355
|
+
}
|
|
17356
|
+
async function settleFallbackAfterTurn(session, turn, terminatingBatch) {
|
|
17357
|
+
const preserveFallbackForFailure = turn.message.role === "assistant" && !session.agent.hasQueuedMessages() && (turn.message.stopReason === "length" || session._isEmptyCompletion?.(turn.message) === true || session._isSafetyRefusal?.(turn.message) === true);
|
|
17358
|
+
if (!preserveFallbackForFailure && (turn.toolResults.length === 0 || terminatingBatch)) {
|
|
17359
|
+
await session._agentEventQueue;
|
|
17360
|
+
await session._settleFallbackModelScope();
|
|
17361
|
+
}
|
|
17252
17362
|
}
|
|
17253
17363
|
var agentSessionToolHooksMethods;
|
|
17254
17364
|
var init_agent_session_tool_hooks = __esm(() => {
|
|
@@ -17331,6 +17441,7 @@ var init_loader_virtual_modules = __esm(() => {
|
|
|
17331
17441
|
});
|
|
17332
17442
|
|
|
17333
17443
|
// src/core/extensions/loader-core.ts
|
|
17444
|
+
var runtimeEventBuses;
|
|
17334
17445
|
var init_loader_core = __esm(() => {
|
|
17335
17446
|
init_event_loop();
|
|
17336
17447
|
init_paths();
|
|
@@ -17340,6 +17451,7 @@ var init_loader_core = __esm(() => {
|
|
|
17340
17451
|
init_loader_resources();
|
|
17341
17452
|
init_loader_runtime();
|
|
17342
17453
|
init_loader_virtual_modules();
|
|
17454
|
+
runtimeEventBuses = new WeakMap;
|
|
17343
17455
|
});
|
|
17344
17456
|
|
|
17345
17457
|
// src/core/package-manager-manifest.ts
|
|
@@ -22433,7 +22545,7 @@ class FastModeSelectorComponent {
|
|
|
22433
22545
|
}
|
|
22434
22546
|
invalidate() {}
|
|
22435
22547
|
render(width) {
|
|
22436
|
-
const lines = [truncateToWidth10(theme.bold(theme.fg("accent", "
|
|
22548
|
+
const lines = [truncateToWidth10(theme.bold(theme.fg("accent", "Fast mode")), width)];
|
|
22437
22549
|
for (const line of wrapTextWithAnsi3(DESCRIPTION, Math.max(20, width))) {
|
|
22438
22550
|
lines.push(theme.fg("muted", line));
|
|
22439
22551
|
}
|
|
@@ -22516,7 +22628,7 @@ class FastModeSelectorComponent {
|
|
|
22516
22628
|
return this.getFocusedRow() === row ? theme.fg("muted", text) : theme.fg("dim", text);
|
|
22517
22629
|
}
|
|
22518
22630
|
}
|
|
22519
|
-
var ROWS, LABEL_WIDTH = 16, DESCRIPTION = "
|
|
22631
|
+
var ROWS, LABEL_WIDTH = 16, DESCRIPTION = "Use faster routing for the selected model when supported by its provider.", ROW_DETAILS;
|
|
22520
22632
|
var init_fast_mode_selector = __esm(() => {
|
|
22521
22633
|
init_theme();
|
|
22522
22634
|
ROWS = ["chat", "workflow"];
|
|
@@ -23743,6 +23855,10 @@ var init_keybindings = __esm(() => {
|
|
|
23743
23855
|
defaultKeys: windowsKeybindings ? "alt+q" : "alt+up",
|
|
23744
23856
|
description: "Restore queued messages"
|
|
23745
23857
|
},
|
|
23858
|
+
"app.message.copy": {
|
|
23859
|
+
defaultKeys: "ctrl+x",
|
|
23860
|
+
description: "Copy fullscreen selection or last agent message"
|
|
23861
|
+
},
|
|
23746
23862
|
"app.clipboard.pasteImage": {
|
|
23747
23863
|
defaultKeys: windowsKeybindings ? "alt+v" : "ctrl+v",
|
|
23748
23864
|
description: "Paste image from clipboard (text fallback)"
|
|
@@ -25128,6 +25244,9 @@ function createSettingsChangeHandler(callbacks) {
|
|
|
25128
25244
|
case "fullscreen-exit-output":
|
|
25129
25245
|
callbacks.onFullscreenExitOutputChange(newValue);
|
|
25130
25246
|
break;
|
|
25247
|
+
case "fullscreen-copy-on-select":
|
|
25248
|
+
callbacks.onFullscreenCopyOnSelectChange(newValue === "true");
|
|
25249
|
+
break;
|
|
25131
25250
|
case "editor-padding":
|
|
25132
25251
|
callbacks.onEditorPaddingXChange(parseInt(newValue, 10));
|
|
25133
25252
|
break;
|
|
@@ -25515,6 +25634,13 @@ function insertUiToggles(items, config) {
|
|
|
25515
25634
|
values: ["transcript", "resume-hint"]
|
|
25516
25635
|
});
|
|
25517
25636
|
insertAfter(items, "fullscreen-exit-output", {
|
|
25637
|
+
id: "fullscreen-copy-on-select",
|
|
25638
|
+
label: "Fullscreen copy on select",
|
|
25639
|
+
description: "Copy selected transcript text automatically on mouse release",
|
|
25640
|
+
currentValue: config.fullscreenCopyOnSelect ? "true" : "false",
|
|
25641
|
+
values: ["true", "false"]
|
|
25642
|
+
});
|
|
25643
|
+
insertAfter(items, "fullscreen-copy-on-select", {
|
|
25518
25644
|
id: "editor-padding",
|
|
25519
25645
|
label: "Editor padding",
|
|
25520
25646
|
description: "Horizontal padding for input editor (0-3)",
|
|
@@ -38589,6 +38715,8 @@ function _refreshToolRegistry(options) {
|
|
|
38589
38715
|
const allowedToolNames = this._allowedToolNames;
|
|
38590
38716
|
const excludedToolNames = this._excludedToolNames;
|
|
38591
38717
|
const isExposedTool = (name) => {
|
|
38718
|
+
if (isMandatoryRuntimeTool(name))
|
|
38719
|
+
return true;
|
|
38592
38720
|
if (allowedToolNames && !allowedToolNames.has(name)) {
|
|
38593
38721
|
return false;
|
|
38594
38722
|
}
|
|
@@ -38597,10 +38725,10 @@ function _refreshToolRegistry(options) {
|
|
|
38597
38725
|
}
|
|
38598
38726
|
return true;
|
|
38599
38727
|
};
|
|
38600
|
-
const registeredTools = this._extensionRunner.getAllRegisteredTools();
|
|
38728
|
+
const registeredTools = this._extensionRunner.getAllRegisteredTools().filter((tool) => !isMandatoryRuntimeTool(tool.definition.name) || isTrustedMandatoryRuntimeTool(tool));
|
|
38601
38729
|
const allCustomTools = [
|
|
38602
38730
|
...registeredTools,
|
|
38603
|
-
...this._customTools.map((definition) => ({
|
|
38731
|
+
...this._customTools.filter((definition) => !isMandatoryRuntimeTool(definition.name)).map((definition) => ({
|
|
38604
38732
|
definition,
|
|
38605
38733
|
sourceInfo: createSyntheticSourceInfo(`<sdk:${definition.name}>`, { source: "sdk" })
|
|
38606
38734
|
}))
|
|
@@ -38721,6 +38849,7 @@ function _buildRuntime(options) {
|
|
|
38721
38849
|
var agentSessionToolRegistryMethods;
|
|
38722
38850
|
var init_agent_session_tool_registry = __esm(() => {
|
|
38723
38851
|
init_extensions();
|
|
38852
|
+
init_mandatory_runtime_tools();
|
|
38724
38853
|
init_model_registry();
|
|
38725
38854
|
init_tools();
|
|
38726
38855
|
init_session_temp_dir();
|
|
@@ -39563,6 +39692,7 @@ class AgentSessionBase {
|
|
|
39563
39692
|
_postToolCompactionPreflightError = undefined;
|
|
39564
39693
|
_pendingPostToolCompactionGuard = undefined;
|
|
39565
39694
|
_terminatingToolCallIds = new Set;
|
|
39695
|
+
_stopAfterTurnBlockedContinuation = false;
|
|
39566
39696
|
_disposed = false;
|
|
39567
39697
|
_branchSummaryAbortController = undefined;
|
|
39568
39698
|
_sessionSummaryAbortController = undefined;
|
|
@@ -39711,11 +39841,12 @@ var init_builtin_packages = __esm(() => {
|
|
|
39711
39841
|
{ packageName: "@bastani/subagents", workspaceDirName: "subagents", distDirName: "subagents" },
|
|
39712
39842
|
{ packageName: "@bastani/mcp", workspaceDirName: "mcp", distDirName: "mcp" },
|
|
39713
39843
|
{ packageName: "@bastani/web-access", workspaceDirName: "web-access", distDirName: "web-access" },
|
|
39714
|
-
{ packageName: "@bastani/intercom", workspaceDirName: "intercom", distDirName: "intercom" }
|
|
39844
|
+
{ packageName: "@bastani/intercom", workspaceDirName: "intercom", distDirName: "intercom", mandatory: true }
|
|
39715
39845
|
];
|
|
39716
39846
|
BUILTIN_PACKAGES = WORKSPACE_BUILTINS.map((spec) => ({
|
|
39717
39847
|
packageName: spec.packageName,
|
|
39718
39848
|
distDirName: spec.distDirName,
|
|
39849
|
+
mandatory: spec.mandatory === true,
|
|
39719
39850
|
requiredEntries: requiredEntriesForBuiltin(spec.distDirName),
|
|
39720
39851
|
sourceCandidates: ({ here, packageDir, isSourceCheckout }) => isSourceCheckout ? [join37(packageDir, "..", spec.workspaceDirName), join37(here, "..", "..", "..", spec.workspaceDirName)] : []
|
|
39721
39852
|
}));
|
|
@@ -43034,7 +43165,9 @@ var init_resource_loader_extensions = __esm(() => {
|
|
|
43034
43165
|
var init_resource_loader_reload = __esm(() => {
|
|
43035
43166
|
init_event_loop();
|
|
43036
43167
|
init_paths();
|
|
43168
|
+
init_builtin_packages();
|
|
43037
43169
|
init_loader();
|
|
43170
|
+
init_mandatory_runtime_tools();
|
|
43038
43171
|
init_resource_loader_assets();
|
|
43039
43172
|
init_resource_loader_context_files();
|
|
43040
43173
|
init_resource_loader_discovery();
|
|
@@ -44191,6 +44324,28 @@ var init_settings_manager_ui_accessors = __esm(() => {
|
|
|
44191
44324
|
state.markModified("fullscreenExitOutput");
|
|
44192
44325
|
state.save();
|
|
44193
44326
|
},
|
|
44327
|
+
getFullscreenCopyOnSelect() {
|
|
44328
|
+
return settingsInternals(this).settings.fullscreenCopyOnSelect !== false;
|
|
44329
|
+
},
|
|
44330
|
+
setFullscreenCopyOnSelect(enabled) {
|
|
44331
|
+
const state = settingsInternals(this);
|
|
44332
|
+
state.globalSettings.fullscreenCopyOnSelect = enabled;
|
|
44333
|
+
state.markModified("fullscreenCopyOnSelect");
|
|
44334
|
+
state.save();
|
|
44335
|
+
},
|
|
44336
|
+
getTerminalCapabilityOverrides() {
|
|
44337
|
+
const terminal = settingsInternals(this).settings.terminal;
|
|
44338
|
+
const overrides = {};
|
|
44339
|
+
if (typeof terminal?.hyperlinks === "boolean")
|
|
44340
|
+
overrides.hyperlinks = terminal.hyperlinks;
|
|
44341
|
+
if (terminal?.images === "kitty" || terminal?.images === "iterm2")
|
|
44342
|
+
overrides.images = terminal.images;
|
|
44343
|
+
else if (terminal?.images === false)
|
|
44344
|
+
overrides.images = null;
|
|
44345
|
+
if (typeof terminal?.trueColor === "boolean")
|
|
44346
|
+
overrides.trueColor = terminal.trueColor;
|
|
44347
|
+
return overrides;
|
|
44348
|
+
},
|
|
44194
44349
|
getEditorPaddingX() {
|
|
44195
44350
|
return settingsInternals(this).settings.editorPaddingX ?? 0;
|
|
44196
44351
|
},
|
|
@@ -44336,6 +44491,14 @@ var init_resource_loader = __esm(() => {
|
|
|
44336
44491
|
init_resource_loader_core();
|
|
44337
44492
|
init_skill_catalog();
|
|
44338
44493
|
});
|
|
44494
|
+
// src/core/mandatory-resource-loader.ts
|
|
44495
|
+
var init_mandatory_resource_loader = __esm(() => {
|
|
44496
|
+
init_builtin_packages();
|
|
44497
|
+
init_loader();
|
|
44498
|
+
init_mandatory_runtime_tools();
|
|
44499
|
+
init_skill_catalog();
|
|
44500
|
+
});
|
|
44501
|
+
|
|
44339
44502
|
// src/core/model-resolver-defaults.ts
|
|
44340
44503
|
function findPreferredAvailableModel(availableModels) {
|
|
44341
44504
|
for (const [provider, defaultId] of Object.entries(defaultModelPerProvider)) {
|
|
@@ -44376,7 +44539,7 @@ var init_model_resolver_defaults = __esm(() => {
|
|
|
44376
44539
|
huggingface: "moonshotai/Kimi-K2.6",
|
|
44377
44540
|
fireworks: "accounts/fireworks/models/kimi-k2p6",
|
|
44378
44541
|
together: "moonshotai/Kimi-K2.6",
|
|
44379
|
-
baseten: "zai-org/GLM-5.
|
|
44542
|
+
baseten: "zai-org/GLM-5.3",
|
|
44380
44543
|
opencode: "kimi-k2.6",
|
|
44381
44544
|
"opencode-go": "kimi-k2.6",
|
|
44382
44545
|
"kimi-coding": "kimi-for-coding",
|
|
@@ -45034,6 +45197,7 @@ var init_session_cwd = __esm(() => {
|
|
|
45034
45197
|
var init_agent_session_services = __esm(() => {
|
|
45035
45198
|
init_config();
|
|
45036
45199
|
init_paths();
|
|
45200
|
+
init_mandatory_resource_loader();
|
|
45037
45201
|
init_model_runtime();
|
|
45038
45202
|
init_resource_loader();
|
|
45039
45203
|
init_sdk();
|
|
@@ -45370,6 +45534,7 @@ var init_sdk = __esm(() => {
|
|
|
45370
45534
|
init_agent_session();
|
|
45371
45535
|
init_auth_guidance();
|
|
45372
45536
|
init_codex_fast_mode();
|
|
45537
|
+
init_mandatory_resource_loader();
|
|
45373
45538
|
init_messages();
|
|
45374
45539
|
init_model_resolver();
|
|
45375
45540
|
init_model_runtime();
|
|
@@ -45473,7 +45638,12 @@ var init_list_models = __esm(() => {
|
|
|
45473
45638
|
});
|
|
45474
45639
|
|
|
45475
45640
|
// src/cli/startup-ui.ts
|
|
45476
|
-
import {
|
|
45641
|
+
import {
|
|
45642
|
+
ProcessTerminal,
|
|
45643
|
+
setCapabilityOverrides,
|
|
45644
|
+
setKeybindings,
|
|
45645
|
+
TuiMainScreen
|
|
45646
|
+
} from "@earendil-works/pi-tui";
|
|
45477
45647
|
var init_startup_ui = __esm(() => {
|
|
45478
45648
|
init_config();
|
|
45479
45649
|
init_keybindings();
|
|
@@ -45561,7 +45731,7 @@ var init_main_first_time_setup = __esm(() => {
|
|
|
45561
45731
|
init_startup_ui();
|
|
45562
45732
|
});
|
|
45563
45733
|
// src/cli/session-picker.ts
|
|
45564
|
-
import { ProcessTerminal as ProcessTerminal2, setKeybindings as setKeybindings2, TuiMainScreen as TuiMainScreen2 } from "@earendil-works/pi-tui";
|
|
45734
|
+
import { ProcessTerminal as ProcessTerminal2, setCapabilityOverrides as setCapabilityOverrides2, setKeybindings as setKeybindings2, TuiMainScreen as TuiMainScreen2 } from "@earendil-works/pi-tui";
|
|
45565
45735
|
var init_session_picker = __esm(() => {
|
|
45566
45736
|
init_config();
|
|
45567
45737
|
init_keybindings();
|
|
@@ -45569,7 +45739,7 @@ var init_session_picker = __esm(() => {
|
|
|
45569
45739
|
});
|
|
45570
45740
|
|
|
45571
45741
|
// src/main-session.ts
|
|
45572
|
-
import { ProcessTerminal as ProcessTerminal3, setKeybindings as setKeybindings3, TuiMainScreen as TuiMainScreen3 } from "@earendil-works/pi-tui";
|
|
45742
|
+
import { ProcessTerminal as ProcessTerminal3, setCapabilityOverrides as setCapabilityOverrides3, setKeybindings as setKeybindings3, TuiMainScreen as TuiMainScreen3 } from "@earendil-works/pi-tui";
|
|
45573
45743
|
import chalk10 from "chalk";
|
|
45574
45744
|
var init_main_session = __esm(() => {
|
|
45575
45745
|
init_session_picker();
|
|
@@ -48387,7 +48557,7 @@ var init_slash_commands = __esm(() => {
|
|
|
48387
48557
|
{ name: "tree", description: "Navigate session tree (switch branches)" },
|
|
48388
48558
|
{ name: "thinking", description: "Set thinking level", argumentHint: "<level>" },
|
|
48389
48559
|
{ name: "scoped-models", description: "Enable/disable models for ctrl+p cycling" },
|
|
48390
|
-
{ name: "fast", description: "Configure
|
|
48560
|
+
{ name: "fast", description: "Configure fast mode for chat and workflows on supported models" },
|
|
48391
48561
|
{ name: "export", description: "Export session (HTML default, or specify path: .html/.jsonl)" },
|
|
48392
48562
|
{ name: "import", description: "Import and resume a session from a JSONL file" },
|
|
48393
48563
|
{ name: "share", description: "Share session as a secret GitHub gist" },
|
|
@@ -49013,6 +49183,7 @@ function createFullscreenTui(options) {
|
|
|
49013
49183
|
openUrl: openBrowser
|
|
49014
49184
|
}),
|
|
49015
49185
|
onRightClickPaste: options.onRightClickPaste,
|
|
49186
|
+
copyOnSelect: options.copyOnSelect,
|
|
49016
49187
|
copySelection: options.copySelection ?? copySelectionToHostClipboard
|
|
49017
49188
|
}, options.shouldHandleViewportInput, options.onOverlayUnhandledInput);
|
|
49018
49189
|
}
|
|
@@ -49054,7 +49225,7 @@ function createInteractiveTuiReference(getTui) {
|
|
|
49054
49225
|
getPrototypeOf: () => Reflect.getPrototypeOf(getTui())
|
|
49055
49226
|
});
|
|
49056
49227
|
}
|
|
49057
|
-
var viewportInputListeners, viewportInputGates, overlayUnhandledInputHandlers, viewportInputReplays, viewportInputSubscriptions, SGR_MOUSE_SEQUENCE, LEFT_MOUSE_MODIFIER_MASK, AtomicTuiAltScreen, AtomicTuiMainScreen;
|
|
49228
|
+
var viewportInputListeners, viewportInputGates, overlayUnhandledInputHandlers, viewportInputReplays, overlayOwnedSelections, viewportInputSubscriptions, SGR_MOUSE_SEQUENCE, LEFT_MOUSE_MODIFIER_MASK, AtomicTuiAltScreen, AtomicTuiMainScreen;
|
|
49058
49229
|
var init_interactive_tui = __esm(() => {
|
|
49059
49230
|
init_clipboard();
|
|
49060
49231
|
init_open_browser();
|
|
@@ -49063,6 +49234,7 @@ var init_interactive_tui = __esm(() => {
|
|
|
49063
49234
|
viewportInputGates = new WeakMap;
|
|
49064
49235
|
overlayUnhandledInputHandlers = new WeakMap;
|
|
49065
49236
|
viewportInputReplays = new WeakSet;
|
|
49237
|
+
overlayOwnedSelections = new WeakSet;
|
|
49066
49238
|
viewportInputSubscriptions = new WeakMap;
|
|
49067
49239
|
SGR_MOUSE_SEQUENCE = /^\x1b\[<(\d+);\d+;\d+([Mm])/;
|
|
49068
49240
|
LEFT_MOUSE_MODIFIER_MASK = 4 | 8 | 16;
|
|
@@ -49078,8 +49250,20 @@ var init_interactive_tui = __esm(() => {
|
|
|
49078
49250
|
deferral.shouldDeferViewportInputToOverlay = () => !viewportInputReplays.has(this) && deferToOverlay?.() === true;
|
|
49079
49251
|
}
|
|
49080
49252
|
applyLineResets(lines) {
|
|
49253
|
+
if (overlayOwnedSelections.has(this) && !this.isFocusedOverlay())
|
|
49254
|
+
this.clearOverlayOwnedSelection();
|
|
49081
49255
|
return stripOverlayActiveRowMarker(super.applyLineResets(lines));
|
|
49082
49256
|
}
|
|
49257
|
+
clearOverlayOwnedSelection() {
|
|
49258
|
+
const selection = this;
|
|
49259
|
+
selection.selectionAnchor = undefined;
|
|
49260
|
+
selection.selectionFocus = undefined;
|
|
49261
|
+
selection.selectionInitialRange = undefined;
|
|
49262
|
+
selection.selectionPressActive = false;
|
|
49263
|
+
selection.selectionDragged = false;
|
|
49264
|
+
selection.lastClick = undefined;
|
|
49265
|
+
overlayOwnedSelections.delete(this);
|
|
49266
|
+
}
|
|
49083
49267
|
isPiTuiMouseSequence(data) {
|
|
49084
49268
|
if (parseMouseSequences(data))
|
|
49085
49269
|
return true;
|
|
@@ -49156,6 +49340,7 @@ var init_interactive_tui = __esm(() => {
|
|
|
49156
49340
|
if (isLeftMouseButton(sequence))
|
|
49157
49341
|
viewportListener(sequence.data);
|
|
49158
49342
|
}
|
|
49343
|
+
overlayOwnedSelections.add(this);
|
|
49159
49344
|
}
|
|
49160
49345
|
replayViewportInput(viewportListener, data) {
|
|
49161
49346
|
viewportInputReplays.add(this);
|
|
@@ -49223,7 +49408,11 @@ var init_interactive_tui = __esm(() => {
|
|
|
49223
49408
|
});
|
|
49224
49409
|
|
|
49225
49410
|
// src/modes/interactive/interactive-mode-base.ts
|
|
49226
|
-
import {
|
|
49411
|
+
import {
|
|
49412
|
+
isKeyRelease as isKeyRelease3,
|
|
49413
|
+
isViewportTUI,
|
|
49414
|
+
setCapabilityOverrides as setCapabilityOverrides4
|
|
49415
|
+
} from "@earendil-works/pi-tui";
|
|
49227
49416
|
function isFullscreenViewportAction(data, keybindings) {
|
|
49228
49417
|
return FULLSCREEN_VIEWPORT_ACTIONS.some((action) => keybindings.matches(data, action));
|
|
49229
49418
|
}
|
|
@@ -49284,6 +49473,18 @@ class InteractiveModeBase {
|
|
|
49284
49473
|
return false;
|
|
49285
49474
|
return this.defaultEditor.handleInput(data);
|
|
49286
49475
|
}
|
|
49476
|
+
setFullscreenCopyOnSelect(enabled) {
|
|
49477
|
+
if (this.renderer.mode === "fullscreen")
|
|
49478
|
+
this.renderer.setCopyOnSelect(enabled);
|
|
49479
|
+
}
|
|
49480
|
+
getFullscreenCopyOnSelect() {
|
|
49481
|
+
return this.renderer.mode === "fullscreen" ? this.renderer.getCopyOnSelect() : undefined;
|
|
49482
|
+
}
|
|
49483
|
+
async copyActiveFullscreenSelection() {
|
|
49484
|
+
if (this.renderer.mode !== "fullscreen" || !this.renderer.hasActiveSelection())
|
|
49485
|
+
return;
|
|
49486
|
+
return this.renderer.copyActiveSelectionToClipboard();
|
|
49487
|
+
}
|
|
49287
49488
|
onRightClickPaste = () => {
|
|
49288
49489
|
this.handleRightClickPaste();
|
|
49289
49490
|
};
|
|
@@ -49483,11 +49684,13 @@ class InteractiveModeBase {
|
|
|
49483
49684
|
await this.rebindCurrentSession();
|
|
49484
49685
|
await this.themeController.applyFromSettings();
|
|
49485
49686
|
});
|
|
49687
|
+
setCapabilityOverrides4(this.settingsManager.getTerminalCapabilityOverrides());
|
|
49486
49688
|
this.version = VERSION;
|
|
49487
49689
|
this.renderer = createInteractiveTui({
|
|
49488
49690
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
49489
49691
|
logDirectory: runtimeHost.services.agentDir,
|
|
49490
49692
|
terminal: options.terminal,
|
|
49693
|
+
copyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
49491
49694
|
onRightClickPaste: this.onRightClickPaste,
|
|
49492
49695
|
shouldHandleViewportInput: this.shouldHandleViewportInput,
|
|
49493
49696
|
onOverlayUnhandledInput: this.onOverlayUnhandledInput,
|
|
@@ -50610,6 +50813,7 @@ var init_interactive_deferred_startup = __esm(() => {
|
|
|
50610
50813
|
try {
|
|
50611
50814
|
await this.bindCurrentSessionExtensions();
|
|
50612
50815
|
await this.session.reload({ reason: "startup" });
|
|
50816
|
+
this.applyRuntimeSettings();
|
|
50613
50817
|
this.rebuildChatFromMessages();
|
|
50614
50818
|
if (!this.promptTurnWorkingLoaderActive) {
|
|
50615
50819
|
this.stopWorkingLoader();
|
|
@@ -51298,6 +51502,7 @@ ${warningLines}`, 0, 0));
|
|
|
51298
51502
|
});
|
|
51299
51503
|
|
|
51300
51504
|
// src/modes/interactive/interactive-session-runtime.ts
|
|
51505
|
+
import { setCapabilityOverrides as setCapabilityOverrides5 } from "@earendil-works/pi-tui";
|
|
51301
51506
|
var init_interactive_session_runtime = __esm(() => {
|
|
51302
51507
|
init_interactive_mode_base();
|
|
51303
51508
|
init_interactive_mode_deps();
|
|
@@ -51384,6 +51589,8 @@ var init_interactive_session_runtime = __esm(() => {
|
|
|
51384
51589
|
}
|
|
51385
51590
|
};
|
|
51386
51591
|
InteractiveModeBase.prototype.applyRuntimeSettings = function() {
|
|
51592
|
+
setCapabilityOverrides5(this.settingsManager.getTerminalCapabilityOverrides());
|
|
51593
|
+
this.setFullscreenCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());
|
|
51387
51594
|
this.transcriptScrollView?.setScrollbar(this.settingsManager.getFullscreenScrollbar());
|
|
51388
51595
|
this.footer.setSession(this.session);
|
|
51389
51596
|
this.usageMeter.setSession(this.session);
|
|
@@ -51453,7 +51660,7 @@ var init_interactive_extension_runtime = __esm(() => {
|
|
|
51453
51660
|
if (shortcuts.size === 0)
|
|
51454
51661
|
return;
|
|
51455
51662
|
const createContext = () => ({
|
|
51456
|
-
ui:
|
|
51663
|
+
ui: extensionRunner.getUIContext(),
|
|
51457
51664
|
mode: "tui",
|
|
51458
51665
|
hasUI: true,
|
|
51459
51666
|
cwd: this.sessionManager.getCwd(),
|
|
@@ -52900,6 +53107,9 @@ var init_interactive_input_handling = __esm(() => {
|
|
|
52900
53107
|
});
|
|
52901
53108
|
this.defaultEditor.onAction("app.message.followUp", () => this.handleFollowUp());
|
|
52902
53109
|
this.defaultEditor.onAction("app.message.dequeue", () => this.handleDequeue());
|
|
53110
|
+
this.defaultEditor.onAction("app.message.copy", () => {
|
|
53111
|
+
this.handleCopyCommand({ preferSelection: true });
|
|
53112
|
+
});
|
|
52903
53113
|
this.defaultEditor.onAction("app.session.new", () => this.handleClearCommand());
|
|
52904
53114
|
this.defaultEditor.onAction("app.session.tree", () => this.showTreeSelector());
|
|
52905
53115
|
this.defaultEditor.onAction("app.session.fork", () => this.showUserMessageSelector());
|
|
@@ -53807,7 +54017,8 @@ var init_interactive_agent_events = __esm(() => {
|
|
|
53807
54017
|
} else if (event.reason === "manual") {
|
|
53808
54018
|
this.manualCompactionTakeoverPending = false;
|
|
53809
54019
|
}
|
|
53810
|
-
|
|
54020
|
+
const resumesActiveRun = event.midTurn && !event.aborted && !event.errorMessage && !manualTakeoverPending;
|
|
54021
|
+
if (!manualTakeoverPending && !resumesActiveRun && this.settingsManager.getShowTerminalProgress()) {
|
|
53811
54022
|
this.ui.terminal.setProgress(false);
|
|
53812
54023
|
}
|
|
53813
54024
|
if (!manualTakeoverPending && this.autoCompactionEscapeHandlerSaved) {
|
|
@@ -54823,7 +55034,7 @@ var init_interactive_selectors = __esm(() => {
|
|
|
54823
55034
|
};
|
|
54824
55035
|
InteractiveModeBase.prototype.showFastModeSelector = function() {
|
|
54825
55036
|
if (!this.hasCodexFastModeSupportedModels()) {
|
|
54826
|
-
this.showWarning("
|
|
55037
|
+
this.showWarning("Fast mode isn't available for any configured model.");
|
|
54827
55038
|
return;
|
|
54828
55039
|
}
|
|
54829
55040
|
this.showSelector((done) => {
|
|
@@ -54882,6 +55093,7 @@ var init_interactive_selectors = __esm(() => {
|
|
|
54882
55093
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
54883
55094
|
fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
|
|
54884
55095
|
fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
|
|
55096
|
+
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
54885
55097
|
editorPaddingX: this.settingsManager.getEditorPaddingX(),
|
|
54886
55098
|
outputPad: this.settingsManager.getOutputPad(),
|
|
54887
55099
|
showCacheMissNotices: this.settingsManager.getShowCacheMissNotices(),
|
|
@@ -54999,6 +55211,10 @@ var init_interactive_selectors = __esm(() => {
|
|
|
54999
55211
|
onFullscreenExitOutputChange: (output) => {
|
|
55000
55212
|
this.settingsManager.setFullscreenExitOutput(output);
|
|
55001
55213
|
},
|
|
55214
|
+
onFullscreenCopyOnSelectChange: (enabled) => {
|
|
55215
|
+
this.settingsManager.setFullscreenCopyOnSelect(enabled);
|
|
55216
|
+
this.setFullscreenCopyOnSelect(enabled);
|
|
55217
|
+
},
|
|
55002
55218
|
onEditorPaddingXChange: (padding) => {
|
|
55003
55219
|
this.settingsManager.setEditorPaddingX(padding);
|
|
55004
55220
|
this.defaultEditor.setPaddingX(padding);
|
|
@@ -55985,18 +56201,8 @@ var init_interactive_slash_commands = __esm(() => {
|
|
|
55985
56201
|
activeHeader.setExpanded(this.toolOutputExpanded);
|
|
55986
56202
|
}
|
|
55987
56203
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
55988
|
-
this.
|
|
56204
|
+
this.applyRuntimeSettings();
|
|
55989
56205
|
await this.themeController.applyFromSettings();
|
|
55990
|
-
const editorPaddingX = this.settingsManager.getEditorPaddingX();
|
|
55991
|
-
const autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();
|
|
55992
|
-
this.defaultEditor.setPaddingX(editorPaddingX);
|
|
55993
|
-
this.defaultEditor.setAutocompleteMaxVisible(autocompleteMaxVisible);
|
|
55994
|
-
if (this.editor !== this.defaultEditor) {
|
|
55995
|
-
this.editor.setPaddingX?.(editorPaddingX);
|
|
55996
|
-
this.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);
|
|
55997
|
-
}
|
|
55998
|
-
this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());
|
|
55999
|
-
this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
|
|
56000
56206
|
this.setupAutocompleteProvider();
|
|
56001
56207
|
const runner = this.session.extensionRunner;
|
|
56002
56208
|
this.setupExtensionShortcuts(runner);
|
|
@@ -56189,7 +56395,12 @@ Gist: ${hyperlink3(gistUrl, gistUrl)}`);
|
|
|
56189
56395
|
}
|
|
56190
56396
|
}
|
|
56191
56397
|
};
|
|
56192
|
-
InteractiveModeBase.prototype.handleCopyCommand = async function() {
|
|
56398
|
+
InteractiveModeBase.prototype.handleCopyCommand = async function(options = {}) {
|
|
56399
|
+
if (options.preferSelection && this.getFullscreenCopyOnSelect() === false) {
|
|
56400
|
+
const selectionCopied = await this.copyActiveFullscreenSelection();
|
|
56401
|
+
if (selectionCopied !== undefined)
|
|
56402
|
+
return;
|
|
56403
|
+
}
|
|
56193
56404
|
const text = this.session.getLastAssistantText();
|
|
56194
56405
|
if (!text) {
|
|
56195
56406
|
this.showError("No agent messages to copy yet.");
|
|
@@ -56736,6 +56947,7 @@ var init_rpc_extension_ui = __esm(() => {
|
|
|
56736
56947
|
});
|
|
56737
56948
|
|
|
56738
56949
|
// src/modes/rpc/rpc-session-binding.ts
|
|
56950
|
+
import { setCapabilityOverrides as setCapabilityOverrides6 } from "@earendil-works/pi-tui";
|
|
56739
56951
|
var init_rpc_session_binding = __esm(() => {
|
|
56740
56952
|
init_footer_data_provider();
|
|
56741
56953
|
init_output_guard();
|
|
@@ -56812,7 +57024,7 @@ var init_config_selector = __esm(() => {
|
|
|
56812
57024
|
});
|
|
56813
57025
|
|
|
56814
57026
|
// src/cli/config-selector.ts
|
|
56815
|
-
import { ProcessTerminal as ProcessTerminal6, TuiMainScreen as TuiMainScreen8 } from "@earendil-works/pi-tui";
|
|
57027
|
+
import { ProcessTerminal as ProcessTerminal6, setCapabilityOverrides as setCapabilityOverrides7, TuiMainScreen as TuiMainScreen8 } from "@earendil-works/pi-tui";
|
|
56816
57028
|
var init_config_selector2 = __esm(() => {
|
|
56817
57029
|
init_config_selector();
|
|
56818
57030
|
init_theme();
|
|
@@ -56859,6 +57071,7 @@ var init_package_manager_cli = __esm(() => {
|
|
|
56859
57071
|
});
|
|
56860
57072
|
|
|
56861
57073
|
// src/main.ts
|
|
57074
|
+
import { setCapabilityOverrides as setCapabilityOverrides8 } from "@earendil-works/pi-tui";
|
|
56862
57075
|
import chalk15 from "chalk";
|
|
56863
57076
|
var init_main = __esm(() => {
|
|
56864
57077
|
init_args();
|
|
@@ -56873,6 +57086,7 @@ var init_main = __esm(() => {
|
|
|
56873
57086
|
init_auth_storage();
|
|
56874
57087
|
init_builtin_packages();
|
|
56875
57088
|
init_http_dispatcher();
|
|
57089
|
+
init_mandatory_resource_loader();
|
|
56876
57090
|
init_model_resolver();
|
|
56877
57091
|
init_model_runtime();
|
|
56878
57092
|
init_output_guard();
|