@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);
|
|
@@ -11960,12 +11962,34 @@ var init_runner_events = __esm(() => {
|
|
|
11960
11962
|
init_callback_activity();
|
|
11961
11963
|
});
|
|
11962
11964
|
|
|
11965
|
+
// src/core/mandatory-runtime-tools.ts
|
|
11966
|
+
function isTrustedMandatoryRuntimeTool(registration) {
|
|
11967
|
+
return MANDATORY_TOOL_NAMES.has(registration.definition.name) && TRUSTED_MANDATORY_DEFINITIONS.has(registration.definition);
|
|
11968
|
+
}
|
|
11969
|
+
function isMandatoryRuntimeTool(name) {
|
|
11970
|
+
return MANDATORY_TOOL_NAMES.has(name);
|
|
11971
|
+
}
|
|
11972
|
+
function appendRegisteredMandatoryTools(tools, registry) {
|
|
11973
|
+
for (const name of MANDATORY_TOOL_NAMES) {
|
|
11974
|
+
const tool = registry.get(name);
|
|
11975
|
+
if (tool && !tools.some((candidate) => candidate.name === name))
|
|
11976
|
+
tools.push(tool);
|
|
11977
|
+
}
|
|
11978
|
+
return tools;
|
|
11979
|
+
}
|
|
11980
|
+
var MANDATORY_TOOL_NAMES, TRUSTED_MANDATORY_DEFINITIONS;
|
|
11981
|
+
var init_mandatory_runtime_tools = __esm(() => {
|
|
11982
|
+
MANDATORY_TOOL_NAMES = new Set(["intercom"]);
|
|
11983
|
+
TRUSTED_MANDATORY_DEFINITIONS = new WeakSet;
|
|
11984
|
+
});
|
|
11985
|
+
|
|
11963
11986
|
// src/core/extensions/runner-registries.ts
|
|
11964
11987
|
function collectRegisteredTools(extensions) {
|
|
11965
11988
|
const toolsByName = new Map;
|
|
11966
11989
|
for (const ext of extensions) {
|
|
11967
11990
|
for (const tool of ext.tools.values()) {
|
|
11968
|
-
|
|
11991
|
+
const existing = toolsByName.get(tool.definition.name);
|
|
11992
|
+
if (!existing || isMandatoryRuntimeTool(tool.definition.name) && isTrustedMandatoryRuntimeTool(tool)) {
|
|
11969
11993
|
toolsByName.set(tool.definition.name, tool);
|
|
11970
11994
|
}
|
|
11971
11995
|
}
|
|
@@ -11973,13 +11997,16 @@ function collectRegisteredTools(extensions) {
|
|
|
11973
11997
|
return Array.from(toolsByName.values());
|
|
11974
11998
|
}
|
|
11975
11999
|
function findToolDefinition(extensions, toolName) {
|
|
12000
|
+
let first;
|
|
11976
12001
|
for (const ext of extensions) {
|
|
11977
12002
|
const tool = ext.tools.get(toolName);
|
|
11978
|
-
if (tool)
|
|
12003
|
+
if (!tool)
|
|
12004
|
+
continue;
|
|
12005
|
+
first ??= tool;
|
|
12006
|
+
if (isMandatoryRuntimeTool(toolName) && isTrustedMandatoryRuntimeTool(tool))
|
|
11979
12007
|
return tool.definition;
|
|
11980
|
-
}
|
|
11981
12008
|
}
|
|
11982
|
-
return;
|
|
12009
|
+
return first?.definition;
|
|
11983
12010
|
}
|
|
11984
12011
|
function collectFlags(extensions) {
|
|
11985
12012
|
const allFlags = new Map;
|
|
@@ -12047,6 +12074,9 @@ function resolveRegisteredCommands(extensions) {
|
|
|
12047
12074
|
return { ...command, invocationName };
|
|
12048
12075
|
});
|
|
12049
12076
|
}
|
|
12077
|
+
var init_runner_registries = __esm(() => {
|
|
12078
|
+
init_mandatory_runtime_tools();
|
|
12079
|
+
});
|
|
12050
12080
|
|
|
12051
12081
|
// src/core/extensions/runner-shortcuts.ts
|
|
12052
12082
|
function resolveExtensionShortcuts(extensions, resolvedKeybindings, hasUI) {
|
|
@@ -12110,6 +12140,7 @@ var init_runner_shortcuts = __esm(() => {
|
|
|
12110
12140
|
"app.thinking.toggle",
|
|
12111
12141
|
"app.editor.external",
|
|
12112
12142
|
"app.message.followUp",
|
|
12143
|
+
"app.message.copy",
|
|
12113
12144
|
"tui.input.submit",
|
|
12114
12145
|
"tui.select.confirm",
|
|
12115
12146
|
"tui.select.cancel",
|
|
@@ -12236,6 +12267,8 @@ class ExtensionRunner {
|
|
|
12236
12267
|
shortcutDiagnostics = [];
|
|
12237
12268
|
commandDiagnostics = [];
|
|
12238
12269
|
staleMessage;
|
|
12270
|
+
uiPromptBinding = 0;
|
|
12271
|
+
activeUIPrompt;
|
|
12239
12272
|
constructor(extensions, runtime, cwd, sessionManager, modelRegistry, orchestrationContext, subagentPolicy) {
|
|
12240
12273
|
this.extensions = extensions;
|
|
12241
12274
|
this.runtime = runtime;
|
|
@@ -12330,9 +12363,71 @@ class ExtensionRunner {
|
|
|
12330
12363
|
this.reloadHandler = async () => {};
|
|
12331
12364
|
}
|
|
12332
12365
|
setUIContext(uiContext, mode = "print") {
|
|
12333
|
-
this.
|
|
12366
|
+
this.endActiveUIPrompt();
|
|
12367
|
+
const binding = ++this.uiPromptBinding;
|
|
12368
|
+
this.uiContext = uiContext ? this.wrapUIPromptContext(uiContext, binding) : noOpUIContext;
|
|
12334
12369
|
this.mode = mode;
|
|
12335
12370
|
}
|
|
12371
|
+
wrapUIPromptContext(ui, binding) {
|
|
12372
|
+
return {
|
|
12373
|
+
...ui,
|
|
12374
|
+
select: (title, options, opts) => this.withUIPrompt(binding, "select", title, () => ui.select(title, options, opts)),
|
|
12375
|
+
confirm: (title, message, opts) => this.withUIPrompt(binding, "confirm", title, () => ui.confirm(title, message, opts)),
|
|
12376
|
+
input: (title, placeholder, opts) => this.withUIPrompt(binding, "input", title, () => ui.input(title, placeholder, opts)),
|
|
12377
|
+
editor: (title, prefill, opts) => this.withUIPrompt(binding, "editor", title, () => ui.editor(title, prefill, opts)),
|
|
12378
|
+
custom: (factory, options) => this.withUIPrompt(binding, "custom", undefined, () => ui.custom(factory, options))
|
|
12379
|
+
};
|
|
12380
|
+
}
|
|
12381
|
+
withUIPrompt(binding, kind, title, run) {
|
|
12382
|
+
if (binding !== this.uiPromptBinding)
|
|
12383
|
+
return run();
|
|
12384
|
+
let prompt = this.activeUIPrompt;
|
|
12385
|
+
if (!prompt) {
|
|
12386
|
+
prompt = { depth: 0, kind, title };
|
|
12387
|
+
this.activeUIPrompt = prompt;
|
|
12388
|
+
this.emitUIPromptEvent({
|
|
12389
|
+
type: "ui_prompt_start",
|
|
12390
|
+
reason: "ui_prompt",
|
|
12391
|
+
kind,
|
|
12392
|
+
...title === undefined ? {} : { title }
|
|
12393
|
+
});
|
|
12394
|
+
}
|
|
12395
|
+
prompt.depth += 1;
|
|
12396
|
+
let finished = false;
|
|
12397
|
+
const finish = () => {
|
|
12398
|
+
if (finished)
|
|
12399
|
+
return;
|
|
12400
|
+
finished = true;
|
|
12401
|
+
if (this.activeUIPrompt !== prompt)
|
|
12402
|
+
return;
|
|
12403
|
+
prompt.depth -= 1;
|
|
12404
|
+
if (prompt.depth === 0)
|
|
12405
|
+
this.endActiveUIPrompt(prompt);
|
|
12406
|
+
};
|
|
12407
|
+
try {
|
|
12408
|
+
return run().finally(finish);
|
|
12409
|
+
} catch (error) {
|
|
12410
|
+
finish();
|
|
12411
|
+
throw error;
|
|
12412
|
+
}
|
|
12413
|
+
}
|
|
12414
|
+
endActiveUIPrompt(prompt = this.activeUIPrompt) {
|
|
12415
|
+
if (!prompt || this.activeUIPrompt !== prompt)
|
|
12416
|
+
return;
|
|
12417
|
+
this.activeUIPrompt = undefined;
|
|
12418
|
+
prompt.depth = 0;
|
|
12419
|
+
this.emitUIPromptEvent({
|
|
12420
|
+
type: "ui_prompt_end",
|
|
12421
|
+
reason: "ui_prompt",
|
|
12422
|
+
kind: prompt.kind,
|
|
12423
|
+
...prompt.title === undefined ? {} : { title: prompt.title }
|
|
12424
|
+
});
|
|
12425
|
+
}
|
|
12426
|
+
emitUIPromptEvent(event) {
|
|
12427
|
+
queueMicrotask(() => {
|
|
12428
|
+
this.emit(event);
|
|
12429
|
+
});
|
|
12430
|
+
}
|
|
12336
12431
|
getUIContext() {
|
|
12337
12432
|
return this.uiContext;
|
|
12338
12433
|
}
|
|
@@ -12509,6 +12604,7 @@ var init_runner = __esm(() => {
|
|
|
12509
12604
|
init_loader_runtime();
|
|
12510
12605
|
init_runner_context();
|
|
12511
12606
|
init_runner_events();
|
|
12607
|
+
init_runner_registries();
|
|
12512
12608
|
init_runner_shortcuts();
|
|
12513
12609
|
init_runner_ui();
|
|
12514
12610
|
init_stale_context();
|
|
@@ -14712,11 +14808,13 @@ async function _runAgentContinue() {
|
|
|
14712
14808
|
}
|
|
14713
14809
|
async function _continueQueuedAgentMessages() {
|
|
14714
14810
|
await this._agentEventQueue;
|
|
14715
|
-
while (!this._queuedMessagesPaused && this.agent.hasQueuedMessages()) {
|
|
14811
|
+
while (!this._stopAfterTurnBlockedContinuation && !this._queuedMessagesPaused && this.agent.hasQueuedMessages()) {
|
|
14716
14812
|
await this.agent.continue();
|
|
14717
14813
|
await this.waitForRetry();
|
|
14718
14814
|
await this._agentEventQueue;
|
|
14719
14815
|
}
|
|
14816
|
+
if (this._stopAfterTurnBlockedContinuation)
|
|
14817
|
+
return;
|
|
14720
14818
|
await answerAdmittedQueuedMessage(this);
|
|
14721
14819
|
}
|
|
14722
14820
|
async function answerAdmittedQueuedMessage(session) {
|
|
@@ -16107,14 +16205,13 @@ function getToolDefinition(name) {
|
|
|
16107
16205
|
}
|
|
16108
16206
|
function setActiveToolsByName(toolNames) {
|
|
16109
16207
|
const tools = [];
|
|
16110
|
-
const validToolNames = [];
|
|
16111
16208
|
for (const name of toolNames) {
|
|
16112
16209
|
const tool = this._toolRegistry.get(name);
|
|
16113
|
-
if (tool)
|
|
16210
|
+
if (tool)
|
|
16114
16211
|
tools.push(tool);
|
|
16115
|
-
validToolNames.push(name);
|
|
16116
|
-
}
|
|
16117
16212
|
}
|
|
16213
|
+
appendRegisteredMandatoryTools(tools, this._toolRegistry);
|
|
16214
|
+
const validToolNames = tools.map((tool) => tool.name);
|
|
16118
16215
|
this.agent.state.tools = tools;
|
|
16119
16216
|
this._baseSystemPrompt = this._rebuildSystemPrompt(validToolNames);
|
|
16120
16217
|
this.agent.state.systemPrompt = this._systemPromptOverride ?? this._baseSystemPrompt;
|
|
@@ -16171,7 +16268,7 @@ function _rebuildSystemPrompt(toolNames) {
|
|
|
16171
16268
|
customPrompt: loaderSystemPrompt,
|
|
16172
16269
|
appendSystemPrompt,
|
|
16173
16270
|
selectedTools: validToolNames,
|
|
16174
|
-
excludedTools: this._excludedToolNames ? Array.from(this._excludedToolNames) : undefined,
|
|
16271
|
+
excludedTools: this._excludedToolNames ? Array.from(this._excludedToolNames).filter((name) => !isMandatoryRuntimeTool(name)) : undefined,
|
|
16175
16272
|
toolSnippets,
|
|
16176
16273
|
promptGuidelines
|
|
16177
16274
|
};
|
|
@@ -16184,6 +16281,7 @@ function _refreshBaseSystemPromptFromActiveTools() {
|
|
|
16184
16281
|
}
|
|
16185
16282
|
var agentSessionStateMethods;
|
|
16186
16283
|
var init_agent_session_state = __esm(() => {
|
|
16284
|
+
init_mandatory_runtime_tools();
|
|
16187
16285
|
init_skill_catalog();
|
|
16188
16286
|
init_system_prompt();
|
|
16189
16287
|
agentSessionStateMethods = {
|
|
@@ -17211,6 +17309,17 @@ function _installAgentToolHooks() {
|
|
|
17211
17309
|
}
|
|
17212
17310
|
function _installAgentNextTurnRefresh() {
|
|
17213
17311
|
const previousPrepareNextTurnWithContext = this.agent.prepareNextTurnWithContext ?? (this.agent.prepareNextTurn ? async (_turn, signal) => await this.agent.prepareNextTurn?.(signal) : undefined);
|
|
17312
|
+
const previousShouldStopAfterTurn = this.agent.shouldStopAfterTurn;
|
|
17313
|
+
this.agent.shouldStopAfterTurn = async (turn, signal) => {
|
|
17314
|
+
const toolCallIds = turn.message.content.filter((part) => part.type === "toolCall").map((part) => part.id);
|
|
17315
|
+
const terminatingBatch = toolCallIds.length > 0 && toolCallIds.every((id) => this._terminatingToolCallIds.has(id));
|
|
17316
|
+
for (const id of toolCallIds)
|
|
17317
|
+
this._terminatingToolCallIds.delete(id);
|
|
17318
|
+
const shouldStop = await previousShouldStopAfterTurn?.(turn, signal) ?? false;
|
|
17319
|
+
this._stopAfterTurnBlockedContinuation = shouldStop;
|
|
17320
|
+
await settleFallbackAfterTurn(this, turn, terminatingBatch);
|
|
17321
|
+
return shouldStop;
|
|
17322
|
+
};
|
|
17214
17323
|
const previousTransformContext = this.agent.transformContext;
|
|
17215
17324
|
this.agent.transformContext = async (messages, signal) => {
|
|
17216
17325
|
const transformed = previousTransformContext ? await previousTransformContext(messages, signal) : messages;
|
|
@@ -17218,24 +17327,17 @@ function _installAgentNextTurnRefresh() {
|
|
|
17218
17327
|
assertToolPairingInvariant(guarded);
|
|
17219
17328
|
return guarded;
|
|
17220
17329
|
};
|
|
17221
|
-
|
|
17222
|
-
const
|
|
17223
|
-
const
|
|
17224
|
-
const
|
|
17225
|
-
const
|
|
17226
|
-
|
|
17227
|
-
this._terminatingToolCallIds.delete(id);
|
|
17228
|
-
const messages = turn.toolResults.length > 0 && !terminatingBatch ? await this._preflightPostToolContext(previousContext.messages, signal) : previousContext.messages;
|
|
17229
|
-
const preserveFallbackForFailure = turn.message.role === "assistant" && !this.agent.hasQueuedMessages() && (turn.message.stopReason === "length" || this._isEmptyCompletion?.(turn.message) === true || this._isSafetyRefusal?.(turn.message) === true);
|
|
17230
|
-
if (!preserveFallbackForFailure && (turn.toolResults.length === 0 || terminatingBatch)) {
|
|
17231
|
-
await this._agentEventQueue;
|
|
17232
|
-
await this._settleFallbackModelScope();
|
|
17233
|
-
}
|
|
17330
|
+
const prepareTurn = async (turn, signal) => {
|
|
17331
|
+
const compactedMessages = turn.toolResults.length > 0 ? await this._preflightPostToolContext(turn.context.messages, signal) : turn.context.messages;
|
|
17332
|
+
const compactedContext = compactedMessages === turn.context.messages ? turn.context : { ...turn.context, messages: compactedMessages };
|
|
17333
|
+
const preparedTurn = compactedContext === turn.context ? turn : { ...turn, context: compactedContext };
|
|
17334
|
+
const previousSnapshot = await previousPrepareNextTurnWithContext?.(preparedTurn, signal);
|
|
17335
|
+
const previousContext = previousSnapshot?.context ?? compactedContext;
|
|
17234
17336
|
return {
|
|
17235
17337
|
...previousSnapshot,
|
|
17236
17338
|
context: {
|
|
17237
17339
|
...previousContext,
|
|
17238
|
-
messages,
|
|
17340
|
+
messages: previousContext.messages,
|
|
17239
17341
|
systemPrompt: this._systemPromptOverride ?? this._baseSystemPrompt,
|
|
17240
17342
|
tools: this.agent.state.tools.slice()
|
|
17241
17343
|
},
|
|
@@ -17243,6 +17345,14 @@ function _installAgentNextTurnRefresh() {
|
|
|
17243
17345
|
thinkingLevel: this.agent.state.thinkingLevel
|
|
17244
17346
|
};
|
|
17245
17347
|
};
|
|
17348
|
+
this.agent.prepareNextTurnWithContext = prepareTurn;
|
|
17349
|
+
}
|
|
17350
|
+
async function settleFallbackAfterTurn(session, turn, terminatingBatch) {
|
|
17351
|
+
const preserveFallbackForFailure = turn.message.role === "assistant" && !session.agent.hasQueuedMessages() && (turn.message.stopReason === "length" || session._isEmptyCompletion?.(turn.message) === true || session._isSafetyRefusal?.(turn.message) === true);
|
|
17352
|
+
if (!preserveFallbackForFailure && (turn.toolResults.length === 0 || terminatingBatch)) {
|
|
17353
|
+
await session._agentEventQueue;
|
|
17354
|
+
await session._settleFallbackModelScope();
|
|
17355
|
+
}
|
|
17246
17356
|
}
|
|
17247
17357
|
var agentSessionToolHooksMethods;
|
|
17248
17358
|
var init_agent_session_tool_hooks = __esm(() => {
|
|
@@ -17325,6 +17435,7 @@ var init_loader_virtual_modules = __esm(() => {
|
|
|
17325
17435
|
});
|
|
17326
17436
|
|
|
17327
17437
|
// src/core/extensions/loader-core.ts
|
|
17438
|
+
var runtimeEventBuses;
|
|
17328
17439
|
var init_loader_core = __esm(() => {
|
|
17329
17440
|
init_event_loop();
|
|
17330
17441
|
init_paths();
|
|
@@ -17334,6 +17445,7 @@ var init_loader_core = __esm(() => {
|
|
|
17334
17445
|
init_loader_resources();
|
|
17335
17446
|
init_loader_runtime();
|
|
17336
17447
|
init_loader_virtual_modules();
|
|
17448
|
+
runtimeEventBuses = new WeakMap;
|
|
17337
17449
|
});
|
|
17338
17450
|
|
|
17339
17451
|
// src/core/package-manager-manifest.ts
|
|
@@ -22427,7 +22539,7 @@ class FastModeSelectorComponent {
|
|
|
22427
22539
|
}
|
|
22428
22540
|
invalidate() {}
|
|
22429
22541
|
render(width) {
|
|
22430
|
-
const lines = [truncateToWidth10(theme.bold(theme.fg("accent", "
|
|
22542
|
+
const lines = [truncateToWidth10(theme.bold(theme.fg("accent", "Fast mode")), width)];
|
|
22431
22543
|
for (const line of wrapTextWithAnsi3(DESCRIPTION, Math.max(20, width))) {
|
|
22432
22544
|
lines.push(theme.fg("muted", line));
|
|
22433
22545
|
}
|
|
@@ -22510,7 +22622,7 @@ class FastModeSelectorComponent {
|
|
|
22510
22622
|
return this.getFocusedRow() === row ? theme.fg("muted", text) : theme.fg("dim", text);
|
|
22511
22623
|
}
|
|
22512
22624
|
}
|
|
22513
|
-
var ROWS, LABEL_WIDTH = 16, DESCRIPTION = "
|
|
22625
|
+
var ROWS, LABEL_WIDTH = 16, DESCRIPTION = "Use faster routing for the selected model when supported by its provider.", ROW_DETAILS;
|
|
22514
22626
|
var init_fast_mode_selector = __esm(() => {
|
|
22515
22627
|
init_theme();
|
|
22516
22628
|
ROWS = ["chat", "workflow"];
|
|
@@ -23737,6 +23849,10 @@ var init_keybindings = __esm(() => {
|
|
|
23737
23849
|
defaultKeys: windowsKeybindings ? "alt+q" : "alt+up",
|
|
23738
23850
|
description: "Restore queued messages"
|
|
23739
23851
|
},
|
|
23852
|
+
"app.message.copy": {
|
|
23853
|
+
defaultKeys: "ctrl+x",
|
|
23854
|
+
description: "Copy fullscreen selection or last agent message"
|
|
23855
|
+
},
|
|
23740
23856
|
"app.clipboard.pasteImage": {
|
|
23741
23857
|
defaultKeys: windowsKeybindings ? "alt+v" : "ctrl+v",
|
|
23742
23858
|
description: "Paste image from clipboard (text fallback)"
|
|
@@ -25122,6 +25238,9 @@ function createSettingsChangeHandler(callbacks) {
|
|
|
25122
25238
|
case "fullscreen-exit-output":
|
|
25123
25239
|
callbacks.onFullscreenExitOutputChange(newValue);
|
|
25124
25240
|
break;
|
|
25241
|
+
case "fullscreen-copy-on-select":
|
|
25242
|
+
callbacks.onFullscreenCopyOnSelectChange(newValue === "true");
|
|
25243
|
+
break;
|
|
25125
25244
|
case "editor-padding":
|
|
25126
25245
|
callbacks.onEditorPaddingXChange(parseInt(newValue, 10));
|
|
25127
25246
|
break;
|
|
@@ -25509,6 +25628,13 @@ function insertUiToggles(items, config) {
|
|
|
25509
25628
|
values: ["transcript", "resume-hint"]
|
|
25510
25629
|
});
|
|
25511
25630
|
insertAfter(items, "fullscreen-exit-output", {
|
|
25631
|
+
id: "fullscreen-copy-on-select",
|
|
25632
|
+
label: "Fullscreen copy on select",
|
|
25633
|
+
description: "Copy selected transcript text automatically on mouse release",
|
|
25634
|
+
currentValue: config.fullscreenCopyOnSelect ? "true" : "false",
|
|
25635
|
+
values: ["true", "false"]
|
|
25636
|
+
});
|
|
25637
|
+
insertAfter(items, "fullscreen-copy-on-select", {
|
|
25512
25638
|
id: "editor-padding",
|
|
25513
25639
|
label: "Editor padding",
|
|
25514
25640
|
description: "Horizontal padding for input editor (0-3)",
|
|
@@ -38583,6 +38709,8 @@ function _refreshToolRegistry(options) {
|
|
|
38583
38709
|
const allowedToolNames = this._allowedToolNames;
|
|
38584
38710
|
const excludedToolNames = this._excludedToolNames;
|
|
38585
38711
|
const isExposedTool = (name) => {
|
|
38712
|
+
if (isMandatoryRuntimeTool(name))
|
|
38713
|
+
return true;
|
|
38586
38714
|
if (allowedToolNames && !allowedToolNames.has(name)) {
|
|
38587
38715
|
return false;
|
|
38588
38716
|
}
|
|
@@ -38591,10 +38719,10 @@ function _refreshToolRegistry(options) {
|
|
|
38591
38719
|
}
|
|
38592
38720
|
return true;
|
|
38593
38721
|
};
|
|
38594
|
-
const registeredTools = this._extensionRunner.getAllRegisteredTools();
|
|
38722
|
+
const registeredTools = this._extensionRunner.getAllRegisteredTools().filter((tool) => !isMandatoryRuntimeTool(tool.definition.name) || isTrustedMandatoryRuntimeTool(tool));
|
|
38595
38723
|
const allCustomTools = [
|
|
38596
38724
|
...registeredTools,
|
|
38597
|
-
...this._customTools.map((definition) => ({
|
|
38725
|
+
...this._customTools.filter((definition) => !isMandatoryRuntimeTool(definition.name)).map((definition) => ({
|
|
38598
38726
|
definition,
|
|
38599
38727
|
sourceInfo: createSyntheticSourceInfo(`<sdk:${definition.name}>`, { source: "sdk" })
|
|
38600
38728
|
}))
|
|
@@ -38715,6 +38843,7 @@ function _buildRuntime(options) {
|
|
|
38715
38843
|
var agentSessionToolRegistryMethods;
|
|
38716
38844
|
var init_agent_session_tool_registry = __esm(() => {
|
|
38717
38845
|
init_extensions();
|
|
38846
|
+
init_mandatory_runtime_tools();
|
|
38718
38847
|
init_model_registry();
|
|
38719
38848
|
init_tools();
|
|
38720
38849
|
init_session_temp_dir();
|
|
@@ -39557,6 +39686,7 @@ class AgentSessionBase {
|
|
|
39557
39686
|
_postToolCompactionPreflightError = undefined;
|
|
39558
39687
|
_pendingPostToolCompactionGuard = undefined;
|
|
39559
39688
|
_terminatingToolCallIds = new Set;
|
|
39689
|
+
_stopAfterTurnBlockedContinuation = false;
|
|
39560
39690
|
_disposed = false;
|
|
39561
39691
|
_branchSummaryAbortController = undefined;
|
|
39562
39692
|
_sessionSummaryAbortController = undefined;
|
|
@@ -39705,11 +39835,12 @@ var init_builtin_packages = __esm(() => {
|
|
|
39705
39835
|
{ packageName: "@bastani/subagents", workspaceDirName: "subagents", distDirName: "subagents" },
|
|
39706
39836
|
{ packageName: "@bastani/mcp", workspaceDirName: "mcp", distDirName: "mcp" },
|
|
39707
39837
|
{ packageName: "@bastani/web-access", workspaceDirName: "web-access", distDirName: "web-access" },
|
|
39708
|
-
{ packageName: "@bastani/intercom", workspaceDirName: "intercom", distDirName: "intercom" }
|
|
39838
|
+
{ packageName: "@bastani/intercom", workspaceDirName: "intercom", distDirName: "intercom", mandatory: true }
|
|
39709
39839
|
];
|
|
39710
39840
|
BUILTIN_PACKAGES = WORKSPACE_BUILTINS.map((spec) => ({
|
|
39711
39841
|
packageName: spec.packageName,
|
|
39712
39842
|
distDirName: spec.distDirName,
|
|
39843
|
+
mandatory: spec.mandatory === true,
|
|
39713
39844
|
requiredEntries: requiredEntriesForBuiltin(spec.distDirName),
|
|
39714
39845
|
sourceCandidates: ({ here, packageDir, isSourceCheckout }) => isSourceCheckout ? [join37(packageDir, "..", spec.workspaceDirName), join37(here, "..", "..", "..", spec.workspaceDirName)] : []
|
|
39715
39846
|
}));
|
|
@@ -43174,7 +43305,9 @@ var init_resource_loader_extensions = __esm(() => {
|
|
|
43174
43305
|
var init_resource_loader_reload = __esm(() => {
|
|
43175
43306
|
init_event_loop();
|
|
43176
43307
|
init_paths();
|
|
43308
|
+
init_builtin_packages();
|
|
43177
43309
|
init_loader();
|
|
43310
|
+
init_mandatory_runtime_tools();
|
|
43178
43311
|
init_resource_loader_assets();
|
|
43179
43312
|
init_resource_loader_context_files();
|
|
43180
43313
|
init_resource_loader_discovery();
|
|
@@ -44331,6 +44464,28 @@ var init_settings_manager_ui_accessors = __esm(() => {
|
|
|
44331
44464
|
state.markModified("fullscreenExitOutput");
|
|
44332
44465
|
state.save();
|
|
44333
44466
|
},
|
|
44467
|
+
getFullscreenCopyOnSelect() {
|
|
44468
|
+
return settingsInternals(this).settings.fullscreenCopyOnSelect !== false;
|
|
44469
|
+
},
|
|
44470
|
+
setFullscreenCopyOnSelect(enabled) {
|
|
44471
|
+
const state = settingsInternals(this);
|
|
44472
|
+
state.globalSettings.fullscreenCopyOnSelect = enabled;
|
|
44473
|
+
state.markModified("fullscreenCopyOnSelect");
|
|
44474
|
+
state.save();
|
|
44475
|
+
},
|
|
44476
|
+
getTerminalCapabilityOverrides() {
|
|
44477
|
+
const terminal = settingsInternals(this).settings.terminal;
|
|
44478
|
+
const overrides = {};
|
|
44479
|
+
if (typeof terminal?.hyperlinks === "boolean")
|
|
44480
|
+
overrides.hyperlinks = terminal.hyperlinks;
|
|
44481
|
+
if (terminal?.images === "kitty" || terminal?.images === "iterm2")
|
|
44482
|
+
overrides.images = terminal.images;
|
|
44483
|
+
else if (terminal?.images === false)
|
|
44484
|
+
overrides.images = null;
|
|
44485
|
+
if (typeof terminal?.trueColor === "boolean")
|
|
44486
|
+
overrides.trueColor = terminal.trueColor;
|
|
44487
|
+
return overrides;
|
|
44488
|
+
},
|
|
44334
44489
|
getEditorPaddingX() {
|
|
44335
44490
|
return settingsInternals(this).settings.editorPaddingX ?? 0;
|
|
44336
44491
|
},
|
|
@@ -44476,6 +44631,14 @@ var init_resource_loader = __esm(() => {
|
|
|
44476
44631
|
init_resource_loader_core();
|
|
44477
44632
|
init_skill_catalog();
|
|
44478
44633
|
});
|
|
44634
|
+
// src/core/mandatory-resource-loader.ts
|
|
44635
|
+
var init_mandatory_resource_loader = __esm(() => {
|
|
44636
|
+
init_builtin_packages();
|
|
44637
|
+
init_loader();
|
|
44638
|
+
init_mandatory_runtime_tools();
|
|
44639
|
+
init_skill_catalog();
|
|
44640
|
+
});
|
|
44641
|
+
|
|
44479
44642
|
// src/core/model-resolver-defaults.ts
|
|
44480
44643
|
function findPreferredAvailableModel(availableModels) {
|
|
44481
44644
|
for (const [provider, defaultId] of Object.entries(defaultModelPerProvider)) {
|
|
@@ -44516,7 +44679,7 @@ var init_model_resolver_defaults = __esm(() => {
|
|
|
44516
44679
|
huggingface: "moonshotai/Kimi-K2.6",
|
|
44517
44680
|
fireworks: "accounts/fireworks/models/kimi-k2p6",
|
|
44518
44681
|
together: "moonshotai/Kimi-K2.6",
|
|
44519
|
-
baseten: "zai-org/GLM-5.
|
|
44682
|
+
baseten: "zai-org/GLM-5.3",
|
|
44520
44683
|
opencode: "kimi-k2.6",
|
|
44521
44684
|
"opencode-go": "kimi-k2.6",
|
|
44522
44685
|
"kimi-coding": "kimi-for-coding",
|
|
@@ -45174,6 +45337,7 @@ var init_session_cwd = __esm(() => {
|
|
|
45174
45337
|
var init_agent_session_services = __esm(() => {
|
|
45175
45338
|
init_config();
|
|
45176
45339
|
init_paths();
|
|
45340
|
+
init_mandatory_resource_loader();
|
|
45177
45341
|
init_model_runtime();
|
|
45178
45342
|
init_resource_loader();
|
|
45179
45343
|
init_sdk();
|
|
@@ -45510,6 +45674,7 @@ var init_sdk = __esm(() => {
|
|
|
45510
45674
|
init_agent_session();
|
|
45511
45675
|
init_auth_guidance();
|
|
45512
45676
|
init_codex_fast_mode();
|
|
45677
|
+
init_mandatory_resource_loader();
|
|
45513
45678
|
init_messages();
|
|
45514
45679
|
init_model_resolver();
|
|
45515
45680
|
init_model_runtime();
|
|
@@ -45613,7 +45778,12 @@ var init_list_models = __esm(() => {
|
|
|
45613
45778
|
});
|
|
45614
45779
|
|
|
45615
45780
|
// src/cli/startup-ui.ts
|
|
45616
|
-
import {
|
|
45781
|
+
import {
|
|
45782
|
+
ProcessTerminal,
|
|
45783
|
+
setCapabilityOverrides,
|
|
45784
|
+
setKeybindings,
|
|
45785
|
+
TuiMainScreen
|
|
45786
|
+
} from "@earendil-works/pi-tui";
|
|
45617
45787
|
var init_startup_ui = __esm(() => {
|
|
45618
45788
|
init_config();
|
|
45619
45789
|
init_keybindings();
|
|
@@ -45701,7 +45871,7 @@ var init_main_first_time_setup = __esm(() => {
|
|
|
45701
45871
|
init_startup_ui();
|
|
45702
45872
|
});
|
|
45703
45873
|
// src/cli/session-picker.ts
|
|
45704
|
-
import { ProcessTerminal as ProcessTerminal2, setKeybindings as setKeybindings2, TuiMainScreen as TuiMainScreen2 } from "@earendil-works/pi-tui";
|
|
45874
|
+
import { ProcessTerminal as ProcessTerminal2, setCapabilityOverrides as setCapabilityOverrides2, setKeybindings as setKeybindings2, TuiMainScreen as TuiMainScreen2 } from "@earendil-works/pi-tui";
|
|
45705
45875
|
var init_session_picker = __esm(() => {
|
|
45706
45876
|
init_config();
|
|
45707
45877
|
init_keybindings();
|
|
@@ -45709,7 +45879,7 @@ var init_session_picker = __esm(() => {
|
|
|
45709
45879
|
});
|
|
45710
45880
|
|
|
45711
45881
|
// src/main-session.ts
|
|
45712
|
-
import { ProcessTerminal as ProcessTerminal3, setKeybindings as setKeybindings3, TuiMainScreen as TuiMainScreen3 } from "@earendil-works/pi-tui";
|
|
45882
|
+
import { ProcessTerminal as ProcessTerminal3, setCapabilityOverrides as setCapabilityOverrides3, setKeybindings as setKeybindings3, TuiMainScreen as TuiMainScreen3 } from "@earendil-works/pi-tui";
|
|
45713
45883
|
import chalk10 from "chalk";
|
|
45714
45884
|
var init_main_session = __esm(() => {
|
|
45715
45885
|
init_session_picker();
|
|
@@ -48527,7 +48697,7 @@ var init_slash_commands = __esm(() => {
|
|
|
48527
48697
|
{ name: "tree", description: "Navigate session tree (switch branches)" },
|
|
48528
48698
|
{ name: "thinking", description: "Set thinking level", argumentHint: "<level>" },
|
|
48529
48699
|
{ name: "scoped-models", description: "Enable/disable models for ctrl+p cycling" },
|
|
48530
|
-
{ name: "fast", description: "Configure
|
|
48700
|
+
{ name: "fast", description: "Configure fast mode for chat and workflows on supported models" },
|
|
48531
48701
|
{ name: "export", description: "Export session (HTML default, or specify path: .html/.jsonl)" },
|
|
48532
48702
|
{ name: "import", description: "Import and resume a session from a JSONL file" },
|
|
48533
48703
|
{ name: "share", description: "Share session as a secret GitHub gist" },
|
|
@@ -49153,6 +49323,7 @@ function createFullscreenTui(options) {
|
|
|
49153
49323
|
openUrl: openBrowser
|
|
49154
49324
|
}),
|
|
49155
49325
|
onRightClickPaste: options.onRightClickPaste,
|
|
49326
|
+
copyOnSelect: options.copyOnSelect,
|
|
49156
49327
|
copySelection: options.copySelection ?? copySelectionToHostClipboard
|
|
49157
49328
|
}, options.shouldHandleViewportInput, options.onOverlayUnhandledInput);
|
|
49158
49329
|
}
|
|
@@ -49194,7 +49365,7 @@ function createInteractiveTuiReference(getTui) {
|
|
|
49194
49365
|
getPrototypeOf: () => Reflect.getPrototypeOf(getTui())
|
|
49195
49366
|
});
|
|
49196
49367
|
}
|
|
49197
|
-
var viewportInputListeners, viewportInputGates, overlayUnhandledInputHandlers, viewportInputReplays, viewportInputSubscriptions, SGR_MOUSE_SEQUENCE, LEFT_MOUSE_MODIFIER_MASK, AtomicTuiAltScreen, AtomicTuiMainScreen;
|
|
49368
|
+
var viewportInputListeners, viewportInputGates, overlayUnhandledInputHandlers, viewportInputReplays, overlayOwnedSelections, viewportInputSubscriptions, SGR_MOUSE_SEQUENCE, LEFT_MOUSE_MODIFIER_MASK, AtomicTuiAltScreen, AtomicTuiMainScreen;
|
|
49198
49369
|
var init_interactive_tui = __esm(() => {
|
|
49199
49370
|
init_clipboard();
|
|
49200
49371
|
init_open_browser();
|
|
@@ -49203,6 +49374,7 @@ var init_interactive_tui = __esm(() => {
|
|
|
49203
49374
|
viewportInputGates = new WeakMap;
|
|
49204
49375
|
overlayUnhandledInputHandlers = new WeakMap;
|
|
49205
49376
|
viewportInputReplays = new WeakSet;
|
|
49377
|
+
overlayOwnedSelections = new WeakSet;
|
|
49206
49378
|
viewportInputSubscriptions = new WeakMap;
|
|
49207
49379
|
SGR_MOUSE_SEQUENCE = /^\x1b\[<(\d+);\d+;\d+([Mm])/;
|
|
49208
49380
|
LEFT_MOUSE_MODIFIER_MASK = 4 | 8 | 16;
|
|
@@ -49218,8 +49390,20 @@ var init_interactive_tui = __esm(() => {
|
|
|
49218
49390
|
deferral.shouldDeferViewportInputToOverlay = () => !viewportInputReplays.has(this) && deferToOverlay?.() === true;
|
|
49219
49391
|
}
|
|
49220
49392
|
applyLineResets(lines) {
|
|
49393
|
+
if (overlayOwnedSelections.has(this) && !this.isFocusedOverlay())
|
|
49394
|
+
this.clearOverlayOwnedSelection();
|
|
49221
49395
|
return stripOverlayActiveRowMarker(super.applyLineResets(lines));
|
|
49222
49396
|
}
|
|
49397
|
+
clearOverlayOwnedSelection() {
|
|
49398
|
+
const selection = this;
|
|
49399
|
+
selection.selectionAnchor = undefined;
|
|
49400
|
+
selection.selectionFocus = undefined;
|
|
49401
|
+
selection.selectionInitialRange = undefined;
|
|
49402
|
+
selection.selectionPressActive = false;
|
|
49403
|
+
selection.selectionDragged = false;
|
|
49404
|
+
selection.lastClick = undefined;
|
|
49405
|
+
overlayOwnedSelections.delete(this);
|
|
49406
|
+
}
|
|
49223
49407
|
isPiTuiMouseSequence(data) {
|
|
49224
49408
|
if (parseMouseSequences(data))
|
|
49225
49409
|
return true;
|
|
@@ -49296,6 +49480,7 @@ var init_interactive_tui = __esm(() => {
|
|
|
49296
49480
|
if (isLeftMouseButton(sequence))
|
|
49297
49481
|
viewportListener(sequence.data);
|
|
49298
49482
|
}
|
|
49483
|
+
overlayOwnedSelections.add(this);
|
|
49299
49484
|
}
|
|
49300
49485
|
replayViewportInput(viewportListener, data) {
|
|
49301
49486
|
viewportInputReplays.add(this);
|
|
@@ -49363,7 +49548,11 @@ var init_interactive_tui = __esm(() => {
|
|
|
49363
49548
|
});
|
|
49364
49549
|
|
|
49365
49550
|
// src/modes/interactive/interactive-mode-base.ts
|
|
49366
|
-
import {
|
|
49551
|
+
import {
|
|
49552
|
+
isKeyRelease as isKeyRelease3,
|
|
49553
|
+
isViewportTUI,
|
|
49554
|
+
setCapabilityOverrides as setCapabilityOverrides4
|
|
49555
|
+
} from "@earendil-works/pi-tui";
|
|
49367
49556
|
function isFullscreenViewportAction(data, keybindings) {
|
|
49368
49557
|
return FULLSCREEN_VIEWPORT_ACTIONS.some((action) => keybindings.matches(data, action));
|
|
49369
49558
|
}
|
|
@@ -49424,6 +49613,18 @@ class InteractiveModeBase {
|
|
|
49424
49613
|
return false;
|
|
49425
49614
|
return this.defaultEditor.handleInput(data);
|
|
49426
49615
|
}
|
|
49616
|
+
setFullscreenCopyOnSelect(enabled) {
|
|
49617
|
+
if (this.renderer.mode === "fullscreen")
|
|
49618
|
+
this.renderer.setCopyOnSelect(enabled);
|
|
49619
|
+
}
|
|
49620
|
+
getFullscreenCopyOnSelect() {
|
|
49621
|
+
return this.renderer.mode === "fullscreen" ? this.renderer.getCopyOnSelect() : undefined;
|
|
49622
|
+
}
|
|
49623
|
+
async copyActiveFullscreenSelection() {
|
|
49624
|
+
if (this.renderer.mode !== "fullscreen" || !this.renderer.hasActiveSelection())
|
|
49625
|
+
return;
|
|
49626
|
+
return this.renderer.copyActiveSelectionToClipboard();
|
|
49627
|
+
}
|
|
49427
49628
|
onRightClickPaste = () => {
|
|
49428
49629
|
this.handleRightClickPaste();
|
|
49429
49630
|
};
|
|
@@ -49623,11 +49824,13 @@ class InteractiveModeBase {
|
|
|
49623
49824
|
await this.rebindCurrentSession();
|
|
49624
49825
|
await this.themeController.applyFromSettings();
|
|
49625
49826
|
});
|
|
49827
|
+
setCapabilityOverrides4(this.settingsManager.getTerminalCapabilityOverrides());
|
|
49626
49828
|
this.version = VERSION;
|
|
49627
49829
|
this.renderer = createInteractiveTui({
|
|
49628
49830
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
49629
49831
|
logDirectory: runtimeHost.services.agentDir,
|
|
49630
49832
|
terminal: options.terminal,
|
|
49833
|
+
copyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
49631
49834
|
onRightClickPaste: this.onRightClickPaste,
|
|
49632
49835
|
shouldHandleViewportInput: this.shouldHandleViewportInput,
|
|
49633
49836
|
onOverlayUnhandledInput: this.onOverlayUnhandledInput,
|
|
@@ -50750,6 +50953,7 @@ var init_interactive_deferred_startup = __esm(() => {
|
|
|
50750
50953
|
try {
|
|
50751
50954
|
await this.bindCurrentSessionExtensions();
|
|
50752
50955
|
await this.session.reload({ reason: "startup" });
|
|
50956
|
+
this.applyRuntimeSettings();
|
|
50753
50957
|
this.rebuildChatFromMessages();
|
|
50754
50958
|
if (!this.promptTurnWorkingLoaderActive) {
|
|
50755
50959
|
this.stopWorkingLoader();
|
|
@@ -51438,6 +51642,7 @@ ${warningLines}`, 0, 0));
|
|
|
51438
51642
|
});
|
|
51439
51643
|
|
|
51440
51644
|
// src/modes/interactive/interactive-session-runtime.ts
|
|
51645
|
+
import { setCapabilityOverrides as setCapabilityOverrides5 } from "@earendil-works/pi-tui";
|
|
51441
51646
|
var init_interactive_session_runtime = __esm(() => {
|
|
51442
51647
|
init_interactive_mode_base();
|
|
51443
51648
|
init_interactive_mode_deps();
|
|
@@ -51524,6 +51729,8 @@ var init_interactive_session_runtime = __esm(() => {
|
|
|
51524
51729
|
}
|
|
51525
51730
|
};
|
|
51526
51731
|
InteractiveModeBase.prototype.applyRuntimeSettings = function() {
|
|
51732
|
+
setCapabilityOverrides5(this.settingsManager.getTerminalCapabilityOverrides());
|
|
51733
|
+
this.setFullscreenCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());
|
|
51527
51734
|
this.transcriptScrollView?.setScrollbar(this.settingsManager.getFullscreenScrollbar());
|
|
51528
51735
|
this.footer.setSession(this.session);
|
|
51529
51736
|
this.usageMeter.setSession(this.session);
|
|
@@ -51593,7 +51800,7 @@ var init_interactive_extension_runtime = __esm(() => {
|
|
|
51593
51800
|
if (shortcuts.size === 0)
|
|
51594
51801
|
return;
|
|
51595
51802
|
const createContext = () => ({
|
|
51596
|
-
ui:
|
|
51803
|
+
ui: extensionRunner.getUIContext(),
|
|
51597
51804
|
mode: "tui",
|
|
51598
51805
|
hasUI: true,
|
|
51599
51806
|
cwd: this.sessionManager.getCwd(),
|
|
@@ -53040,6 +53247,9 @@ var init_interactive_input_handling = __esm(() => {
|
|
|
53040
53247
|
});
|
|
53041
53248
|
this.defaultEditor.onAction("app.message.followUp", () => this.handleFollowUp());
|
|
53042
53249
|
this.defaultEditor.onAction("app.message.dequeue", () => this.handleDequeue());
|
|
53250
|
+
this.defaultEditor.onAction("app.message.copy", () => {
|
|
53251
|
+
this.handleCopyCommand({ preferSelection: true });
|
|
53252
|
+
});
|
|
53043
53253
|
this.defaultEditor.onAction("app.session.new", () => this.handleClearCommand());
|
|
53044
53254
|
this.defaultEditor.onAction("app.session.tree", () => this.showTreeSelector());
|
|
53045
53255
|
this.defaultEditor.onAction("app.session.fork", () => this.showUserMessageSelector());
|
|
@@ -53947,7 +54157,8 @@ var init_interactive_agent_events = __esm(() => {
|
|
|
53947
54157
|
} else if (event.reason === "manual") {
|
|
53948
54158
|
this.manualCompactionTakeoverPending = false;
|
|
53949
54159
|
}
|
|
53950
|
-
|
|
54160
|
+
const resumesActiveRun = event.midTurn && !event.aborted && !event.errorMessage && !manualTakeoverPending;
|
|
54161
|
+
if (!manualTakeoverPending && !resumesActiveRun && this.settingsManager.getShowTerminalProgress()) {
|
|
53951
54162
|
this.ui.terminal.setProgress(false);
|
|
53952
54163
|
}
|
|
53953
54164
|
if (!manualTakeoverPending && this.autoCompactionEscapeHandlerSaved) {
|
|
@@ -54963,7 +55174,7 @@ var init_interactive_selectors = __esm(() => {
|
|
|
54963
55174
|
};
|
|
54964
55175
|
InteractiveModeBase.prototype.showFastModeSelector = function() {
|
|
54965
55176
|
if (!this.hasCodexFastModeSupportedModels()) {
|
|
54966
|
-
this.showWarning("
|
|
55177
|
+
this.showWarning("Fast mode isn't available for any configured model.");
|
|
54967
55178
|
return;
|
|
54968
55179
|
}
|
|
54969
55180
|
this.showSelector((done) => {
|
|
@@ -55022,6 +55233,7 @@ var init_interactive_selectors = __esm(() => {
|
|
|
55022
55233
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
55023
55234
|
fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
|
|
55024
55235
|
fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
|
|
55236
|
+
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
55025
55237
|
editorPaddingX: this.settingsManager.getEditorPaddingX(),
|
|
55026
55238
|
outputPad: this.settingsManager.getOutputPad(),
|
|
55027
55239
|
showCacheMissNotices: this.settingsManager.getShowCacheMissNotices(),
|
|
@@ -55139,6 +55351,10 @@ var init_interactive_selectors = __esm(() => {
|
|
|
55139
55351
|
onFullscreenExitOutputChange: (output) => {
|
|
55140
55352
|
this.settingsManager.setFullscreenExitOutput(output);
|
|
55141
55353
|
},
|
|
55354
|
+
onFullscreenCopyOnSelectChange: (enabled) => {
|
|
55355
|
+
this.settingsManager.setFullscreenCopyOnSelect(enabled);
|
|
55356
|
+
this.setFullscreenCopyOnSelect(enabled);
|
|
55357
|
+
},
|
|
55142
55358
|
onEditorPaddingXChange: (padding) => {
|
|
55143
55359
|
this.settingsManager.setEditorPaddingX(padding);
|
|
55144
55360
|
this.defaultEditor.setPaddingX(padding);
|
|
@@ -56125,18 +56341,8 @@ var init_interactive_slash_commands = __esm(() => {
|
|
|
56125
56341
|
activeHeader.setExpanded(this.toolOutputExpanded);
|
|
56126
56342
|
}
|
|
56127
56343
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
56128
|
-
this.
|
|
56344
|
+
this.applyRuntimeSettings();
|
|
56129
56345
|
await this.themeController.applyFromSettings();
|
|
56130
|
-
const editorPaddingX = this.settingsManager.getEditorPaddingX();
|
|
56131
|
-
const autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();
|
|
56132
|
-
this.defaultEditor.setPaddingX(editorPaddingX);
|
|
56133
|
-
this.defaultEditor.setAutocompleteMaxVisible(autocompleteMaxVisible);
|
|
56134
|
-
if (this.editor !== this.defaultEditor) {
|
|
56135
|
-
this.editor.setPaddingX?.(editorPaddingX);
|
|
56136
|
-
this.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);
|
|
56137
|
-
}
|
|
56138
|
-
this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());
|
|
56139
|
-
this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
|
|
56140
56346
|
this.setupAutocompleteProvider();
|
|
56141
56347
|
const runner = this.session.extensionRunner;
|
|
56142
56348
|
this.setupExtensionShortcuts(runner);
|
|
@@ -56329,7 +56535,12 @@ Gist: ${hyperlink3(gistUrl, gistUrl)}`);
|
|
|
56329
56535
|
}
|
|
56330
56536
|
}
|
|
56331
56537
|
};
|
|
56332
|
-
InteractiveModeBase.prototype.handleCopyCommand = async function() {
|
|
56538
|
+
InteractiveModeBase.prototype.handleCopyCommand = async function(options = {}) {
|
|
56539
|
+
if (options.preferSelection && this.getFullscreenCopyOnSelect() === false) {
|
|
56540
|
+
const selectionCopied = await this.copyActiveFullscreenSelection();
|
|
56541
|
+
if (selectionCopied !== undefined)
|
|
56542
|
+
return;
|
|
56543
|
+
}
|
|
56333
56544
|
const text = this.session.getLastAssistantText();
|
|
56334
56545
|
if (!text) {
|
|
56335
56546
|
this.showError("No agent messages to copy yet.");
|
|
@@ -56876,6 +57087,7 @@ var init_rpc_extension_ui = __esm(() => {
|
|
|
56876
57087
|
});
|
|
56877
57088
|
|
|
56878
57089
|
// src/modes/rpc/rpc-session-binding.ts
|
|
57090
|
+
import { setCapabilityOverrides as setCapabilityOverrides6 } from "@earendil-works/pi-tui";
|
|
56879
57091
|
var init_rpc_session_binding = __esm(() => {
|
|
56880
57092
|
init_footer_data_provider();
|
|
56881
57093
|
init_output_guard();
|
|
@@ -56952,7 +57164,7 @@ var init_config_selector = __esm(() => {
|
|
|
56952
57164
|
});
|
|
56953
57165
|
|
|
56954
57166
|
// src/cli/config-selector.ts
|
|
56955
|
-
import { ProcessTerminal as ProcessTerminal6, TuiMainScreen as TuiMainScreen8 } from "@earendil-works/pi-tui";
|
|
57167
|
+
import { ProcessTerminal as ProcessTerminal6, setCapabilityOverrides as setCapabilityOverrides7, TuiMainScreen as TuiMainScreen8 } from "@earendil-works/pi-tui";
|
|
56956
57168
|
var init_config_selector2 = __esm(() => {
|
|
56957
57169
|
init_config_selector();
|
|
56958
57170
|
init_theme();
|
|
@@ -56999,6 +57211,7 @@ var init_package_manager_cli = __esm(() => {
|
|
|
56999
57211
|
});
|
|
57000
57212
|
|
|
57001
57213
|
// src/main.ts
|
|
57214
|
+
import { setCapabilityOverrides as setCapabilityOverrides8 } from "@earendil-works/pi-tui";
|
|
57002
57215
|
import chalk15 from "chalk";
|
|
57003
57216
|
var init_main = __esm(() => {
|
|
57004
57217
|
init_args();
|
|
@@ -57013,6 +57226,7 @@ var init_main = __esm(() => {
|
|
|
57013
57226
|
init_auth_storage();
|
|
57014
57227
|
init_builtin_packages();
|
|
57015
57228
|
init_http_dispatcher();
|
|
57229
|
+
init_mandatory_resource_loader();
|
|
57016
57230
|
init_model_resolver();
|
|
57017
57231
|
init_model_runtime();
|
|
57018
57232
|
init_output_guard();
|