@bastani/atomic 0.9.16-alpha.10 → 0.9.16-alpha.11
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 +17 -0
- package/README.md +4 -4
- package/dist/builtin/intercom/CHANGELOG.md +6 -0
- package/dist/builtin/intercom/README.md +2 -5
- package/dist/builtin/intercom/index.bundle.mjs +176 -132
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/intercom/skills/intercom/SKILL.md +1 -1
- package/dist/builtin/mcp/index.bundle.mjs +176 -120
- package/dist/builtin/mcp/package.json +2 -2
- package/dist/builtin/subagents/CHANGELOG.md +11 -0
- package/dist/builtin/subagents/README.md +3 -3
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +396 -208
- package/dist/builtin/web-access/index.bundle.mjs +176 -120
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +11 -0
- package/dist/builtin/workflows/README.md +1 -1
- package/dist/builtin/workflows/builtin/{chunk-tr5kqhba.js → chunk-3y1hmzw6.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-xhrvz7wj.js → chunk-bz1c9732.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-1ryp6jxq.js → chunk-dattsgxg.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-peps7f1q.js → chunk-gdx0avpx.js} +329 -135
- package/dist/builtin/workflows/builtin/{chunk-5n8ras9g.js → chunk-w9c7rkrk.js} +1 -1
- package/dist/builtin/workflows/builtin/goal.js +3 -3
- package/dist/builtin/workflows/builtin/index.js +4 -4
- package/dist/builtin/workflows/builtin/open-claude-design.js +1 -1
- 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 +427 -196
- package/dist/builtin/workflows/src/index.js +186 -140
- 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-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 +9 -109
- 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/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/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/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/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/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-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-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/environment-variables.md +2 -0
- package/docs/extensions.md +1 -1
- package/docs/intercom.md +6 -7
- package/docs/keybindings.md +5 -2
- package/docs/packages.md +1 -1
- package/docs/providers.md +1 -1
- 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 +9 -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",
|
|
@@ -12573,6 +12604,7 @@ var init_runner = __esm(() => {
|
|
|
12573
12604
|
init_loader_runtime();
|
|
12574
12605
|
init_runner_context();
|
|
12575
12606
|
init_runner_events();
|
|
12607
|
+
init_runner_registries();
|
|
12576
12608
|
init_runner_shortcuts();
|
|
12577
12609
|
init_runner_ui();
|
|
12578
12610
|
init_stale_context();
|
|
@@ -16173,14 +16205,13 @@ function getToolDefinition(name) {
|
|
|
16173
16205
|
}
|
|
16174
16206
|
function setActiveToolsByName(toolNames) {
|
|
16175
16207
|
const tools = [];
|
|
16176
|
-
const validToolNames = [];
|
|
16177
16208
|
for (const name of toolNames) {
|
|
16178
16209
|
const tool = this._toolRegistry.get(name);
|
|
16179
|
-
if (tool)
|
|
16210
|
+
if (tool)
|
|
16180
16211
|
tools.push(tool);
|
|
16181
|
-
validToolNames.push(name);
|
|
16182
|
-
}
|
|
16183
16212
|
}
|
|
16213
|
+
appendRegisteredMandatoryTools(tools, this._toolRegistry);
|
|
16214
|
+
const validToolNames = tools.map((tool) => tool.name);
|
|
16184
16215
|
this.agent.state.tools = tools;
|
|
16185
16216
|
this._baseSystemPrompt = this._rebuildSystemPrompt(validToolNames);
|
|
16186
16217
|
this.agent.state.systemPrompt = this._systemPromptOverride ?? this._baseSystemPrompt;
|
|
@@ -16237,7 +16268,7 @@ function _rebuildSystemPrompt(toolNames) {
|
|
|
16237
16268
|
customPrompt: loaderSystemPrompt,
|
|
16238
16269
|
appendSystemPrompt,
|
|
16239
16270
|
selectedTools: validToolNames,
|
|
16240
|
-
excludedTools: this._excludedToolNames ? Array.from(this._excludedToolNames) : undefined,
|
|
16271
|
+
excludedTools: this._excludedToolNames ? Array.from(this._excludedToolNames).filter((name) => !isMandatoryRuntimeTool(name)) : undefined,
|
|
16241
16272
|
toolSnippets,
|
|
16242
16273
|
promptGuidelines
|
|
16243
16274
|
};
|
|
@@ -16250,6 +16281,7 @@ function _refreshBaseSystemPromptFromActiveTools() {
|
|
|
16250
16281
|
}
|
|
16251
16282
|
var agentSessionStateMethods;
|
|
16252
16283
|
var init_agent_session_state = __esm(() => {
|
|
16284
|
+
init_mandatory_runtime_tools();
|
|
16253
16285
|
init_skill_catalog();
|
|
16254
16286
|
init_system_prompt();
|
|
16255
16287
|
agentSessionStateMethods = {
|
|
@@ -17278,31 +17310,14 @@ function _installAgentToolHooks() {
|
|
|
17278
17310
|
function _installAgentNextTurnRefresh() {
|
|
17279
17311
|
const previousPrepareNextTurnWithContext = this.agent.prepareNextTurnWithContext ?? (this.agent.prepareNextTurn ? async (_turn, signal) => await this.agent.prepareNextTurn?.(signal) : undefined);
|
|
17280
17312
|
const previousShouldStopAfterTurn = this.agent.shouldStopAfterTurn;
|
|
17281
|
-
let pendingStopResult;
|
|
17282
|
-
const pendingStopMatches = (turn) => {
|
|
17283
|
-
const pending = pendingStopResult;
|
|
17284
|
-
return pending?.message === turn.message && pending.toolResults === turn.toolResults && pending.newMessages === turn.newMessages;
|
|
17285
|
-
};
|
|
17286
|
-
const clearPendingStopResult = (turn) => {
|
|
17287
|
-
if (pendingStopMatches(turn))
|
|
17288
|
-
pendingStopResult = undefined;
|
|
17289
|
-
};
|
|
17290
17313
|
this.agent.shouldStopAfterTurn = async (turn, signal) => {
|
|
17291
|
-
const
|
|
17292
|
-
|
|
17293
|
-
|
|
17294
|
-
|
|
17295
|
-
}
|
|
17296
|
-
return await previousShouldStopAfterTurn?.(turn, signal) ?? false;
|
|
17297
|
-
};
|
|
17298
|
-
const cacheStopResult = 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);
|
|
17299
17318
|
const shouldStop = await previousShouldStopAfterTurn?.(turn, signal) ?? false;
|
|
17300
|
-
|
|
17301
|
-
|
|
17302
|
-
toolResults: turn.toolResults,
|
|
17303
|
-
newMessages: turn.newMessages,
|
|
17304
|
-
shouldStop
|
|
17305
|
-
};
|
|
17319
|
+
this._stopAfterTurnBlockedContinuation = shouldStop;
|
|
17320
|
+
await settleFallbackAfterTurn(this, turn, terminatingBatch);
|
|
17306
17321
|
return shouldStop;
|
|
17307
17322
|
};
|
|
17308
17323
|
const previousTransformContext = this.agent.transformContext;
|
|
@@ -17330,68 +17345,7 @@ function _installAgentNextTurnRefresh() {
|
|
|
17330
17345
|
thinkingLevel: this.agent.state.thinkingLevel
|
|
17331
17346
|
};
|
|
17332
17347
|
};
|
|
17333
|
-
|
|
17334
|
-
const prepareDeferredTurn = async (loopConfig) => {
|
|
17335
|
-
const deferred = deferredPreparation;
|
|
17336
|
-
if (!deferred)
|
|
17337
|
-
return;
|
|
17338
|
-
deferredPreparation = undefined;
|
|
17339
|
-
const snapshot = await prepareTurn(deferred.turn, deferred.signal);
|
|
17340
|
-
const nextContext = snapshot.context ?? deferred.turn.context;
|
|
17341
|
-
deferred.loopContext.systemPrompt = nextContext.systemPrompt;
|
|
17342
|
-
deferred.loopContext.messages = nextContext.messages;
|
|
17343
|
-
deferred.loopContext.tools = nextContext.tools;
|
|
17344
|
-
loopConfig.model = snapshot.model ?? loopConfig.model;
|
|
17345
|
-
loopConfig.reasoning = snapshot.thinkingLevel === undefined ? loopConfig.reasoning : snapshot.thinkingLevel === "off" ? undefined : snapshot.thinkingLevel;
|
|
17346
|
-
};
|
|
17347
|
-
const agentLoopDoor = this.agent;
|
|
17348
|
-
const previousCreateLoopConfig = agentLoopDoor.createLoopConfig.bind(this.agent);
|
|
17349
|
-
agentLoopDoor.createLoopConfig = (options) => {
|
|
17350
|
-
deferredPreparation = undefined;
|
|
17351
|
-
this._stopAfterTurnBlockedContinuation = false;
|
|
17352
|
-
const loopConfig = previousCreateLoopConfig(options);
|
|
17353
|
-
const wrapQueuePoll = (poll) => async function() {
|
|
17354
|
-
const messages = await poll?.() ?? [];
|
|
17355
|
-
if (messages.length > 0)
|
|
17356
|
-
await prepareDeferredTurn(this);
|
|
17357
|
-
return messages;
|
|
17358
|
-
};
|
|
17359
|
-
loopConfig.getSteeringMessages = wrapQueuePoll(loopConfig.getSteeringMessages);
|
|
17360
|
-
loopConfig.getFollowUpMessages = wrapQueuePoll(loopConfig.getFollowUpMessages);
|
|
17361
|
-
return loopConfig;
|
|
17362
|
-
};
|
|
17363
|
-
this.agent.prepareNextTurnWithContext = async (turn, signal) => {
|
|
17364
|
-
const toolCallIds = turn.message.content.filter((part) => part.type === "toolCall").map((part) => part.id);
|
|
17365
|
-
const terminatingBatch = toolCallIds.length > 0 && toolCallIds.every((id) => this._terminatingToolCallIds.has(id));
|
|
17366
|
-
for (const id of toolCallIds)
|
|
17367
|
-
this._terminatingToolCallIds.delete(id);
|
|
17368
|
-
const shouldStop = await cacheStopResult(turn, signal);
|
|
17369
|
-
try {
|
|
17370
|
-
if (shouldStop) {
|
|
17371
|
-
deferredPreparation = undefined;
|
|
17372
|
-
this._stopAfterTurnBlockedContinuation = true;
|
|
17373
|
-
await settleFallbackAfterTurn(this, turn, terminatingBatch);
|
|
17374
|
-
return;
|
|
17375
|
-
}
|
|
17376
|
-
if (turn.toolResults.length > 0 && !terminatingBatch) {
|
|
17377
|
-
deferredPreparation = undefined;
|
|
17378
|
-
const snapshot = await prepareTurn(turn, signal);
|
|
17379
|
-
await settleFallbackAfterTurn(this, turn, terminatingBatch);
|
|
17380
|
-
return snapshot;
|
|
17381
|
-
}
|
|
17382
|
-
await settleFallbackAfterTurn(this, turn, terminatingBatch);
|
|
17383
|
-
const loopContext = {
|
|
17384
|
-
...turn.context,
|
|
17385
|
-
messages: turn.context.messages.slice(),
|
|
17386
|
-
tools: turn.context.tools?.slice()
|
|
17387
|
-
};
|
|
17388
|
-
deferredPreparation = { turn, signal, loopContext };
|
|
17389
|
-
return { context: loopContext };
|
|
17390
|
-
} catch (error) {
|
|
17391
|
-
clearPendingStopResult(turn);
|
|
17392
|
-
throw error;
|
|
17393
|
-
}
|
|
17394
|
-
};
|
|
17348
|
+
this.agent.prepareNextTurnWithContext = prepareTurn;
|
|
17395
17349
|
}
|
|
17396
17350
|
async function settleFallbackAfterTurn(session, turn, terminatingBatch) {
|
|
17397
17351
|
const preserveFallbackForFailure = turn.message.role === "assistant" && !session.agent.hasQueuedMessages() && (turn.message.stopReason === "length" || session._isEmptyCompletion?.(turn.message) === true || session._isSafetyRefusal?.(turn.message) === true);
|
|
@@ -17481,6 +17435,7 @@ var init_loader_virtual_modules = __esm(() => {
|
|
|
17481
17435
|
});
|
|
17482
17436
|
|
|
17483
17437
|
// src/core/extensions/loader-core.ts
|
|
17438
|
+
var runtimeEventBuses;
|
|
17484
17439
|
var init_loader_core = __esm(() => {
|
|
17485
17440
|
init_event_loop();
|
|
17486
17441
|
init_paths();
|
|
@@ -17490,6 +17445,7 @@ var init_loader_core = __esm(() => {
|
|
|
17490
17445
|
init_loader_resources();
|
|
17491
17446
|
init_loader_runtime();
|
|
17492
17447
|
init_loader_virtual_modules();
|
|
17448
|
+
runtimeEventBuses = new WeakMap;
|
|
17493
17449
|
});
|
|
17494
17450
|
|
|
17495
17451
|
// src/core/package-manager-manifest.ts
|
|
@@ -22583,7 +22539,7 @@ class FastModeSelectorComponent {
|
|
|
22583
22539
|
}
|
|
22584
22540
|
invalidate() {}
|
|
22585
22541
|
render(width) {
|
|
22586
|
-
const lines = [truncateToWidth10(theme.bold(theme.fg("accent", "
|
|
22542
|
+
const lines = [truncateToWidth10(theme.bold(theme.fg("accent", "Fast mode")), width)];
|
|
22587
22543
|
for (const line of wrapTextWithAnsi3(DESCRIPTION, Math.max(20, width))) {
|
|
22588
22544
|
lines.push(theme.fg("muted", line));
|
|
22589
22545
|
}
|
|
@@ -22666,7 +22622,7 @@ class FastModeSelectorComponent {
|
|
|
22666
22622
|
return this.getFocusedRow() === row ? theme.fg("muted", text) : theme.fg("dim", text);
|
|
22667
22623
|
}
|
|
22668
22624
|
}
|
|
22669
|
-
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;
|
|
22670
22626
|
var init_fast_mode_selector = __esm(() => {
|
|
22671
22627
|
init_theme();
|
|
22672
22628
|
ROWS = ["chat", "workflow"];
|
|
@@ -23893,6 +23849,10 @@ var init_keybindings = __esm(() => {
|
|
|
23893
23849
|
defaultKeys: windowsKeybindings ? "alt+q" : "alt+up",
|
|
23894
23850
|
description: "Restore queued messages"
|
|
23895
23851
|
},
|
|
23852
|
+
"app.message.copy": {
|
|
23853
|
+
defaultKeys: "ctrl+x",
|
|
23854
|
+
description: "Copy fullscreen selection or last agent message"
|
|
23855
|
+
},
|
|
23896
23856
|
"app.clipboard.pasteImage": {
|
|
23897
23857
|
defaultKeys: windowsKeybindings ? "alt+v" : "ctrl+v",
|
|
23898
23858
|
description: "Paste image from clipboard (text fallback)"
|
|
@@ -25278,6 +25238,9 @@ function createSettingsChangeHandler(callbacks) {
|
|
|
25278
25238
|
case "fullscreen-exit-output":
|
|
25279
25239
|
callbacks.onFullscreenExitOutputChange(newValue);
|
|
25280
25240
|
break;
|
|
25241
|
+
case "fullscreen-copy-on-select":
|
|
25242
|
+
callbacks.onFullscreenCopyOnSelectChange(newValue === "true");
|
|
25243
|
+
break;
|
|
25281
25244
|
case "editor-padding":
|
|
25282
25245
|
callbacks.onEditorPaddingXChange(parseInt(newValue, 10));
|
|
25283
25246
|
break;
|
|
@@ -25665,6 +25628,13 @@ function insertUiToggles(items, config) {
|
|
|
25665
25628
|
values: ["transcript", "resume-hint"]
|
|
25666
25629
|
});
|
|
25667
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", {
|
|
25668
25638
|
id: "editor-padding",
|
|
25669
25639
|
label: "Editor padding",
|
|
25670
25640
|
description: "Horizontal padding for input editor (0-3)",
|
|
@@ -38739,6 +38709,8 @@ function _refreshToolRegistry(options) {
|
|
|
38739
38709
|
const allowedToolNames = this._allowedToolNames;
|
|
38740
38710
|
const excludedToolNames = this._excludedToolNames;
|
|
38741
38711
|
const isExposedTool = (name) => {
|
|
38712
|
+
if (isMandatoryRuntimeTool(name))
|
|
38713
|
+
return true;
|
|
38742
38714
|
if (allowedToolNames && !allowedToolNames.has(name)) {
|
|
38743
38715
|
return false;
|
|
38744
38716
|
}
|
|
@@ -38747,10 +38719,10 @@ function _refreshToolRegistry(options) {
|
|
|
38747
38719
|
}
|
|
38748
38720
|
return true;
|
|
38749
38721
|
};
|
|
38750
|
-
const registeredTools = this._extensionRunner.getAllRegisteredTools();
|
|
38722
|
+
const registeredTools = this._extensionRunner.getAllRegisteredTools().filter((tool) => !isMandatoryRuntimeTool(tool.definition.name) || isTrustedMandatoryRuntimeTool(tool));
|
|
38751
38723
|
const allCustomTools = [
|
|
38752
38724
|
...registeredTools,
|
|
38753
|
-
...this._customTools.map((definition) => ({
|
|
38725
|
+
...this._customTools.filter((definition) => !isMandatoryRuntimeTool(definition.name)).map((definition) => ({
|
|
38754
38726
|
definition,
|
|
38755
38727
|
sourceInfo: createSyntheticSourceInfo(`<sdk:${definition.name}>`, { source: "sdk" })
|
|
38756
38728
|
}))
|
|
@@ -38871,6 +38843,7 @@ function _buildRuntime(options) {
|
|
|
38871
38843
|
var agentSessionToolRegistryMethods;
|
|
38872
38844
|
var init_agent_session_tool_registry = __esm(() => {
|
|
38873
38845
|
init_extensions();
|
|
38846
|
+
init_mandatory_runtime_tools();
|
|
38874
38847
|
init_model_registry();
|
|
38875
38848
|
init_tools();
|
|
38876
38849
|
init_session_temp_dir();
|
|
@@ -39862,11 +39835,12 @@ var init_builtin_packages = __esm(() => {
|
|
|
39862
39835
|
{ packageName: "@bastani/subagents", workspaceDirName: "subagents", distDirName: "subagents" },
|
|
39863
39836
|
{ packageName: "@bastani/mcp", workspaceDirName: "mcp", distDirName: "mcp" },
|
|
39864
39837
|
{ packageName: "@bastani/web-access", workspaceDirName: "web-access", distDirName: "web-access" },
|
|
39865
|
-
{ packageName: "@bastani/intercom", workspaceDirName: "intercom", distDirName: "intercom" }
|
|
39838
|
+
{ packageName: "@bastani/intercom", workspaceDirName: "intercom", distDirName: "intercom", mandatory: true }
|
|
39866
39839
|
];
|
|
39867
39840
|
BUILTIN_PACKAGES = WORKSPACE_BUILTINS.map((spec) => ({
|
|
39868
39841
|
packageName: spec.packageName,
|
|
39869
39842
|
distDirName: spec.distDirName,
|
|
39843
|
+
mandatory: spec.mandatory === true,
|
|
39870
39844
|
requiredEntries: requiredEntriesForBuiltin(spec.distDirName),
|
|
39871
39845
|
sourceCandidates: ({ here, packageDir, isSourceCheckout }) => isSourceCheckout ? [join37(packageDir, "..", spec.workspaceDirName), join37(here, "..", "..", "..", spec.workspaceDirName)] : []
|
|
39872
39846
|
}));
|
|
@@ -43192,7 +43166,9 @@ var init_resource_loader_extensions = __esm(() => {
|
|
|
43192
43166
|
var init_resource_loader_reload = __esm(() => {
|
|
43193
43167
|
init_event_loop();
|
|
43194
43168
|
init_paths();
|
|
43169
|
+
init_builtin_packages();
|
|
43195
43170
|
init_loader();
|
|
43171
|
+
init_mandatory_runtime_tools();
|
|
43196
43172
|
init_resource_loader_assets();
|
|
43197
43173
|
init_resource_loader_context_files();
|
|
43198
43174
|
init_resource_loader_discovery();
|
|
@@ -44349,6 +44325,28 @@ var init_settings_manager_ui_accessors = __esm(() => {
|
|
|
44349
44325
|
state.markModified("fullscreenExitOutput");
|
|
44350
44326
|
state.save();
|
|
44351
44327
|
},
|
|
44328
|
+
getFullscreenCopyOnSelect() {
|
|
44329
|
+
return settingsInternals(this).settings.fullscreenCopyOnSelect !== false;
|
|
44330
|
+
},
|
|
44331
|
+
setFullscreenCopyOnSelect(enabled) {
|
|
44332
|
+
const state = settingsInternals(this);
|
|
44333
|
+
state.globalSettings.fullscreenCopyOnSelect = enabled;
|
|
44334
|
+
state.markModified("fullscreenCopyOnSelect");
|
|
44335
|
+
state.save();
|
|
44336
|
+
},
|
|
44337
|
+
getTerminalCapabilityOverrides() {
|
|
44338
|
+
const terminal = settingsInternals(this).settings.terminal;
|
|
44339
|
+
const overrides = {};
|
|
44340
|
+
if (typeof terminal?.hyperlinks === "boolean")
|
|
44341
|
+
overrides.hyperlinks = terminal.hyperlinks;
|
|
44342
|
+
if (terminal?.images === "kitty" || terminal?.images === "iterm2")
|
|
44343
|
+
overrides.images = terminal.images;
|
|
44344
|
+
else if (terminal?.images === false)
|
|
44345
|
+
overrides.images = null;
|
|
44346
|
+
if (typeof terminal?.trueColor === "boolean")
|
|
44347
|
+
overrides.trueColor = terminal.trueColor;
|
|
44348
|
+
return overrides;
|
|
44349
|
+
},
|
|
44352
44350
|
getEditorPaddingX() {
|
|
44353
44351
|
return settingsInternals(this).settings.editorPaddingX ?? 0;
|
|
44354
44352
|
},
|
|
@@ -44494,6 +44492,14 @@ var init_resource_loader = __esm(() => {
|
|
|
44494
44492
|
init_resource_loader_core();
|
|
44495
44493
|
init_skill_catalog();
|
|
44496
44494
|
});
|
|
44495
|
+
// src/core/mandatory-resource-loader.ts
|
|
44496
|
+
var init_mandatory_resource_loader = __esm(() => {
|
|
44497
|
+
init_builtin_packages();
|
|
44498
|
+
init_loader();
|
|
44499
|
+
init_mandatory_runtime_tools();
|
|
44500
|
+
init_skill_catalog();
|
|
44501
|
+
});
|
|
44502
|
+
|
|
44497
44503
|
// src/core/model-resolver-defaults.ts
|
|
44498
44504
|
function findPreferredAvailableModel(availableModels) {
|
|
44499
44505
|
for (const [provider, defaultId] of Object.entries(defaultModelPerProvider)) {
|
|
@@ -45192,6 +45198,7 @@ var init_session_cwd = __esm(() => {
|
|
|
45192
45198
|
var init_agent_session_services = __esm(() => {
|
|
45193
45199
|
init_config();
|
|
45194
45200
|
init_paths();
|
|
45201
|
+
init_mandatory_resource_loader();
|
|
45195
45202
|
init_model_runtime();
|
|
45196
45203
|
init_resource_loader();
|
|
45197
45204
|
init_sdk();
|
|
@@ -45528,6 +45535,7 @@ var init_sdk = __esm(() => {
|
|
|
45528
45535
|
init_agent_session();
|
|
45529
45536
|
init_auth_guidance();
|
|
45530
45537
|
init_codex_fast_mode();
|
|
45538
|
+
init_mandatory_resource_loader();
|
|
45531
45539
|
init_messages();
|
|
45532
45540
|
init_model_resolver();
|
|
45533
45541
|
init_model_runtime();
|
|
@@ -45631,7 +45639,12 @@ var init_list_models = __esm(() => {
|
|
|
45631
45639
|
});
|
|
45632
45640
|
|
|
45633
45641
|
// src/cli/startup-ui.ts
|
|
45634
|
-
import {
|
|
45642
|
+
import {
|
|
45643
|
+
ProcessTerminal,
|
|
45644
|
+
setCapabilityOverrides,
|
|
45645
|
+
setKeybindings,
|
|
45646
|
+
TuiMainScreen
|
|
45647
|
+
} from "@earendil-works/pi-tui";
|
|
45635
45648
|
var init_startup_ui = __esm(() => {
|
|
45636
45649
|
init_config();
|
|
45637
45650
|
init_keybindings();
|
|
@@ -45719,7 +45732,7 @@ var init_main_first_time_setup = __esm(() => {
|
|
|
45719
45732
|
init_startup_ui();
|
|
45720
45733
|
});
|
|
45721
45734
|
// src/cli/session-picker.ts
|
|
45722
|
-
import { ProcessTerminal as ProcessTerminal2, setKeybindings as setKeybindings2, TuiMainScreen as TuiMainScreen2 } from "@earendil-works/pi-tui";
|
|
45735
|
+
import { ProcessTerminal as ProcessTerminal2, setCapabilityOverrides as setCapabilityOverrides2, setKeybindings as setKeybindings2, TuiMainScreen as TuiMainScreen2 } from "@earendil-works/pi-tui";
|
|
45723
45736
|
var init_session_picker = __esm(() => {
|
|
45724
45737
|
init_config();
|
|
45725
45738
|
init_keybindings();
|
|
@@ -45727,7 +45740,7 @@ var init_session_picker = __esm(() => {
|
|
|
45727
45740
|
});
|
|
45728
45741
|
|
|
45729
45742
|
// src/main-session.ts
|
|
45730
|
-
import { ProcessTerminal as ProcessTerminal3, setKeybindings as setKeybindings3, TuiMainScreen as TuiMainScreen3 } from "@earendil-works/pi-tui";
|
|
45743
|
+
import { ProcessTerminal as ProcessTerminal3, setCapabilityOverrides as setCapabilityOverrides3, setKeybindings as setKeybindings3, TuiMainScreen as TuiMainScreen3 } from "@earendil-works/pi-tui";
|
|
45731
45744
|
import chalk10 from "chalk";
|
|
45732
45745
|
var init_main_session = __esm(() => {
|
|
45733
45746
|
init_session_picker();
|
|
@@ -48545,7 +48558,7 @@ var init_slash_commands = __esm(() => {
|
|
|
48545
48558
|
{ name: "tree", description: "Navigate session tree (switch branches)" },
|
|
48546
48559
|
{ name: "thinking", description: "Set thinking level", argumentHint: "<level>" },
|
|
48547
48560
|
{ name: "scoped-models", description: "Enable/disable models for ctrl+p cycling" },
|
|
48548
|
-
{ name: "fast", description: "Configure
|
|
48561
|
+
{ name: "fast", description: "Configure fast mode for chat and workflows on supported models" },
|
|
48549
48562
|
{ name: "export", description: "Export session (HTML default, or specify path: .html/.jsonl)" },
|
|
48550
48563
|
{ name: "import", description: "Import and resume a session from a JSONL file" },
|
|
48551
48564
|
{ name: "share", description: "Share session as a secret GitHub gist" },
|
|
@@ -49171,6 +49184,7 @@ function createFullscreenTui(options) {
|
|
|
49171
49184
|
openUrl: openBrowser
|
|
49172
49185
|
}),
|
|
49173
49186
|
onRightClickPaste: options.onRightClickPaste,
|
|
49187
|
+
copyOnSelect: options.copyOnSelect,
|
|
49174
49188
|
copySelection: options.copySelection ?? copySelectionToHostClipboard
|
|
49175
49189
|
}, options.shouldHandleViewportInput, options.onOverlayUnhandledInput);
|
|
49176
49190
|
}
|
|
@@ -49212,7 +49226,7 @@ function createInteractiveTuiReference(getTui) {
|
|
|
49212
49226
|
getPrototypeOf: () => Reflect.getPrototypeOf(getTui())
|
|
49213
49227
|
});
|
|
49214
49228
|
}
|
|
49215
|
-
var viewportInputListeners, viewportInputGates, overlayUnhandledInputHandlers, viewportInputReplays, viewportInputSubscriptions, SGR_MOUSE_SEQUENCE, LEFT_MOUSE_MODIFIER_MASK, AtomicTuiAltScreen, AtomicTuiMainScreen;
|
|
49229
|
+
var viewportInputListeners, viewportInputGates, overlayUnhandledInputHandlers, viewportInputReplays, overlayOwnedSelections, viewportInputSubscriptions, SGR_MOUSE_SEQUENCE, LEFT_MOUSE_MODIFIER_MASK, AtomicTuiAltScreen, AtomicTuiMainScreen;
|
|
49216
49230
|
var init_interactive_tui = __esm(() => {
|
|
49217
49231
|
init_clipboard();
|
|
49218
49232
|
init_open_browser();
|
|
@@ -49221,6 +49235,7 @@ var init_interactive_tui = __esm(() => {
|
|
|
49221
49235
|
viewportInputGates = new WeakMap;
|
|
49222
49236
|
overlayUnhandledInputHandlers = new WeakMap;
|
|
49223
49237
|
viewportInputReplays = new WeakSet;
|
|
49238
|
+
overlayOwnedSelections = new WeakSet;
|
|
49224
49239
|
viewportInputSubscriptions = new WeakMap;
|
|
49225
49240
|
SGR_MOUSE_SEQUENCE = /^\x1b\[<(\d+);\d+;\d+([Mm])/;
|
|
49226
49241
|
LEFT_MOUSE_MODIFIER_MASK = 4 | 8 | 16;
|
|
@@ -49236,8 +49251,20 @@ var init_interactive_tui = __esm(() => {
|
|
|
49236
49251
|
deferral.shouldDeferViewportInputToOverlay = () => !viewportInputReplays.has(this) && deferToOverlay?.() === true;
|
|
49237
49252
|
}
|
|
49238
49253
|
applyLineResets(lines) {
|
|
49254
|
+
if (overlayOwnedSelections.has(this) && !this.isFocusedOverlay())
|
|
49255
|
+
this.clearOverlayOwnedSelection();
|
|
49239
49256
|
return stripOverlayActiveRowMarker(super.applyLineResets(lines));
|
|
49240
49257
|
}
|
|
49258
|
+
clearOverlayOwnedSelection() {
|
|
49259
|
+
const selection = this;
|
|
49260
|
+
selection.selectionAnchor = undefined;
|
|
49261
|
+
selection.selectionFocus = undefined;
|
|
49262
|
+
selection.selectionInitialRange = undefined;
|
|
49263
|
+
selection.selectionPressActive = false;
|
|
49264
|
+
selection.selectionDragged = false;
|
|
49265
|
+
selection.lastClick = undefined;
|
|
49266
|
+
overlayOwnedSelections.delete(this);
|
|
49267
|
+
}
|
|
49241
49268
|
isPiTuiMouseSequence(data) {
|
|
49242
49269
|
if (parseMouseSequences(data))
|
|
49243
49270
|
return true;
|
|
@@ -49314,6 +49341,7 @@ var init_interactive_tui = __esm(() => {
|
|
|
49314
49341
|
if (isLeftMouseButton(sequence))
|
|
49315
49342
|
viewportListener(sequence.data);
|
|
49316
49343
|
}
|
|
49344
|
+
overlayOwnedSelections.add(this);
|
|
49317
49345
|
}
|
|
49318
49346
|
replayViewportInput(viewportListener, data) {
|
|
49319
49347
|
viewportInputReplays.add(this);
|
|
@@ -49381,7 +49409,11 @@ var init_interactive_tui = __esm(() => {
|
|
|
49381
49409
|
});
|
|
49382
49410
|
|
|
49383
49411
|
// src/modes/interactive/interactive-mode-base.ts
|
|
49384
|
-
import {
|
|
49412
|
+
import {
|
|
49413
|
+
isKeyRelease as isKeyRelease3,
|
|
49414
|
+
isViewportTUI,
|
|
49415
|
+
setCapabilityOverrides as setCapabilityOverrides4
|
|
49416
|
+
} from "@earendil-works/pi-tui";
|
|
49385
49417
|
function isFullscreenViewportAction(data, keybindings) {
|
|
49386
49418
|
return FULLSCREEN_VIEWPORT_ACTIONS.some((action) => keybindings.matches(data, action));
|
|
49387
49419
|
}
|
|
@@ -49442,6 +49474,18 @@ class InteractiveModeBase {
|
|
|
49442
49474
|
return false;
|
|
49443
49475
|
return this.defaultEditor.handleInput(data);
|
|
49444
49476
|
}
|
|
49477
|
+
setFullscreenCopyOnSelect(enabled) {
|
|
49478
|
+
if (this.renderer.mode === "fullscreen")
|
|
49479
|
+
this.renderer.setCopyOnSelect(enabled);
|
|
49480
|
+
}
|
|
49481
|
+
getFullscreenCopyOnSelect() {
|
|
49482
|
+
return this.renderer.mode === "fullscreen" ? this.renderer.getCopyOnSelect() : undefined;
|
|
49483
|
+
}
|
|
49484
|
+
async copyActiveFullscreenSelection() {
|
|
49485
|
+
if (this.renderer.mode !== "fullscreen" || !this.renderer.hasActiveSelection())
|
|
49486
|
+
return;
|
|
49487
|
+
return this.renderer.copyActiveSelectionToClipboard();
|
|
49488
|
+
}
|
|
49445
49489
|
onRightClickPaste = () => {
|
|
49446
49490
|
this.handleRightClickPaste();
|
|
49447
49491
|
};
|
|
@@ -49641,11 +49685,13 @@ class InteractiveModeBase {
|
|
|
49641
49685
|
await this.rebindCurrentSession();
|
|
49642
49686
|
await this.themeController.applyFromSettings();
|
|
49643
49687
|
});
|
|
49688
|
+
setCapabilityOverrides4(this.settingsManager.getTerminalCapabilityOverrides());
|
|
49644
49689
|
this.version = VERSION;
|
|
49645
49690
|
this.renderer = createInteractiveTui({
|
|
49646
49691
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
49647
49692
|
logDirectory: runtimeHost.services.agentDir,
|
|
49648
49693
|
terminal: options.terminal,
|
|
49694
|
+
copyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
49649
49695
|
onRightClickPaste: this.onRightClickPaste,
|
|
49650
49696
|
shouldHandleViewportInput: this.shouldHandleViewportInput,
|
|
49651
49697
|
onOverlayUnhandledInput: this.onOverlayUnhandledInput,
|
|
@@ -50768,6 +50814,7 @@ var init_interactive_deferred_startup = __esm(() => {
|
|
|
50768
50814
|
try {
|
|
50769
50815
|
await this.bindCurrentSessionExtensions();
|
|
50770
50816
|
await this.session.reload({ reason: "startup" });
|
|
50817
|
+
this.applyRuntimeSettings();
|
|
50771
50818
|
this.rebuildChatFromMessages();
|
|
50772
50819
|
if (!this.promptTurnWorkingLoaderActive) {
|
|
50773
50820
|
this.stopWorkingLoader();
|
|
@@ -51456,6 +51503,7 @@ ${warningLines}`, 0, 0));
|
|
|
51456
51503
|
});
|
|
51457
51504
|
|
|
51458
51505
|
// src/modes/interactive/interactive-session-runtime.ts
|
|
51506
|
+
import { setCapabilityOverrides as setCapabilityOverrides5 } from "@earendil-works/pi-tui";
|
|
51459
51507
|
var init_interactive_session_runtime = __esm(() => {
|
|
51460
51508
|
init_interactive_mode_base();
|
|
51461
51509
|
init_interactive_mode_deps();
|
|
@@ -51542,6 +51590,8 @@ var init_interactive_session_runtime = __esm(() => {
|
|
|
51542
51590
|
}
|
|
51543
51591
|
};
|
|
51544
51592
|
InteractiveModeBase.prototype.applyRuntimeSettings = function() {
|
|
51593
|
+
setCapabilityOverrides5(this.settingsManager.getTerminalCapabilityOverrides());
|
|
51594
|
+
this.setFullscreenCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());
|
|
51545
51595
|
this.transcriptScrollView?.setScrollbar(this.settingsManager.getFullscreenScrollbar());
|
|
51546
51596
|
this.footer.setSession(this.session);
|
|
51547
51597
|
this.usageMeter.setSession(this.session);
|
|
@@ -53058,6 +53108,9 @@ var init_interactive_input_handling = __esm(() => {
|
|
|
53058
53108
|
});
|
|
53059
53109
|
this.defaultEditor.onAction("app.message.followUp", () => this.handleFollowUp());
|
|
53060
53110
|
this.defaultEditor.onAction("app.message.dequeue", () => this.handleDequeue());
|
|
53111
|
+
this.defaultEditor.onAction("app.message.copy", () => {
|
|
53112
|
+
this.handleCopyCommand({ preferSelection: true });
|
|
53113
|
+
});
|
|
53061
53114
|
this.defaultEditor.onAction("app.session.new", () => this.handleClearCommand());
|
|
53062
53115
|
this.defaultEditor.onAction("app.session.tree", () => this.showTreeSelector());
|
|
53063
53116
|
this.defaultEditor.onAction("app.session.fork", () => this.showUserMessageSelector());
|
|
@@ -54982,7 +55035,7 @@ var init_interactive_selectors = __esm(() => {
|
|
|
54982
55035
|
};
|
|
54983
55036
|
InteractiveModeBase.prototype.showFastModeSelector = function() {
|
|
54984
55037
|
if (!this.hasCodexFastModeSupportedModels()) {
|
|
54985
|
-
this.showWarning("
|
|
55038
|
+
this.showWarning("Fast mode isn't available for any configured model.");
|
|
54986
55039
|
return;
|
|
54987
55040
|
}
|
|
54988
55041
|
this.showSelector((done) => {
|
|
@@ -55041,6 +55094,7 @@ var init_interactive_selectors = __esm(() => {
|
|
|
55041
55094
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
55042
55095
|
fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
|
|
55043
55096
|
fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
|
|
55097
|
+
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
55044
55098
|
editorPaddingX: this.settingsManager.getEditorPaddingX(),
|
|
55045
55099
|
outputPad: this.settingsManager.getOutputPad(),
|
|
55046
55100
|
showCacheMissNotices: this.settingsManager.getShowCacheMissNotices(),
|
|
@@ -55158,6 +55212,10 @@ var init_interactive_selectors = __esm(() => {
|
|
|
55158
55212
|
onFullscreenExitOutputChange: (output) => {
|
|
55159
55213
|
this.settingsManager.setFullscreenExitOutput(output);
|
|
55160
55214
|
},
|
|
55215
|
+
onFullscreenCopyOnSelectChange: (enabled) => {
|
|
55216
|
+
this.settingsManager.setFullscreenCopyOnSelect(enabled);
|
|
55217
|
+
this.setFullscreenCopyOnSelect(enabled);
|
|
55218
|
+
},
|
|
55161
55219
|
onEditorPaddingXChange: (padding) => {
|
|
55162
55220
|
this.settingsManager.setEditorPaddingX(padding);
|
|
55163
55221
|
this.defaultEditor.setPaddingX(padding);
|
|
@@ -56144,18 +56202,8 @@ var init_interactive_slash_commands = __esm(() => {
|
|
|
56144
56202
|
activeHeader.setExpanded(this.toolOutputExpanded);
|
|
56145
56203
|
}
|
|
56146
56204
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
56147
|
-
this.
|
|
56205
|
+
this.applyRuntimeSettings();
|
|
56148
56206
|
await this.themeController.applyFromSettings();
|
|
56149
|
-
const editorPaddingX = this.settingsManager.getEditorPaddingX();
|
|
56150
|
-
const autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();
|
|
56151
|
-
this.defaultEditor.setPaddingX(editorPaddingX);
|
|
56152
|
-
this.defaultEditor.setAutocompleteMaxVisible(autocompleteMaxVisible);
|
|
56153
|
-
if (this.editor !== this.defaultEditor) {
|
|
56154
|
-
this.editor.setPaddingX?.(editorPaddingX);
|
|
56155
|
-
this.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);
|
|
56156
|
-
}
|
|
56157
|
-
this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());
|
|
56158
|
-
this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
|
|
56159
56207
|
this.setupAutocompleteProvider();
|
|
56160
56208
|
const runner = this.session.extensionRunner;
|
|
56161
56209
|
this.setupExtensionShortcuts(runner);
|
|
@@ -56348,7 +56396,12 @@ Gist: ${hyperlink3(gistUrl, gistUrl)}`);
|
|
|
56348
56396
|
}
|
|
56349
56397
|
}
|
|
56350
56398
|
};
|
|
56351
|
-
InteractiveModeBase.prototype.handleCopyCommand = async function() {
|
|
56399
|
+
InteractiveModeBase.prototype.handleCopyCommand = async function(options = {}) {
|
|
56400
|
+
if (options.preferSelection && this.getFullscreenCopyOnSelect() === false) {
|
|
56401
|
+
const selectionCopied = await this.copyActiveFullscreenSelection();
|
|
56402
|
+
if (selectionCopied !== undefined)
|
|
56403
|
+
return;
|
|
56404
|
+
}
|
|
56352
56405
|
const text = this.session.getLastAssistantText();
|
|
56353
56406
|
if (!text) {
|
|
56354
56407
|
this.showError("No agent messages to copy yet.");
|
|
@@ -56895,6 +56948,7 @@ var init_rpc_extension_ui = __esm(() => {
|
|
|
56895
56948
|
});
|
|
56896
56949
|
|
|
56897
56950
|
// src/modes/rpc/rpc-session-binding.ts
|
|
56951
|
+
import { setCapabilityOverrides as setCapabilityOverrides6 } from "@earendil-works/pi-tui";
|
|
56898
56952
|
var init_rpc_session_binding = __esm(() => {
|
|
56899
56953
|
init_footer_data_provider();
|
|
56900
56954
|
init_output_guard();
|
|
@@ -56971,7 +57025,7 @@ var init_config_selector = __esm(() => {
|
|
|
56971
57025
|
});
|
|
56972
57026
|
|
|
56973
57027
|
// src/cli/config-selector.ts
|
|
56974
|
-
import { ProcessTerminal as ProcessTerminal6, TuiMainScreen as TuiMainScreen8 } from "@earendil-works/pi-tui";
|
|
57028
|
+
import { ProcessTerminal as ProcessTerminal6, setCapabilityOverrides as setCapabilityOverrides7, TuiMainScreen as TuiMainScreen8 } from "@earendil-works/pi-tui";
|
|
56975
57029
|
var init_config_selector2 = __esm(() => {
|
|
56976
57030
|
init_config_selector();
|
|
56977
57031
|
init_theme();
|
|
@@ -57018,6 +57072,7 @@ var init_package_manager_cli = __esm(() => {
|
|
|
57018
57072
|
});
|
|
57019
57073
|
|
|
57020
57074
|
// src/main.ts
|
|
57075
|
+
import { setCapabilityOverrides as setCapabilityOverrides8 } from "@earendil-works/pi-tui";
|
|
57021
57076
|
import chalk15 from "chalk";
|
|
57022
57077
|
var init_main = __esm(() => {
|
|
57023
57078
|
init_args();
|
|
@@ -57032,6 +57087,7 @@ var init_main = __esm(() => {
|
|
|
57032
57087
|
init_auth_storage();
|
|
57033
57088
|
init_builtin_packages();
|
|
57034
57089
|
init_http_dispatcher();
|
|
57090
|
+
init_mandatory_resource_loader();
|
|
57035
57091
|
init_model_resolver();
|
|
57036
57092
|
init_model_runtime();
|
|
57037
57093
|
init_output_guard();
|
|
@@ -58815,12 +58871,6 @@ function loadConfig2() {
|
|
|
58815
58871
|
}
|
|
58816
58872
|
config.maxPendingAsks = Number(parsedConfig.maxPendingAsks);
|
|
58817
58873
|
}
|
|
58818
|
-
if (Object.hasOwn(parsedConfig, "enabled")) {
|
|
58819
|
-
if (typeof parsedConfig.enabled !== "boolean") {
|
|
58820
|
-
throw new Error(`"enabled" must be a boolean`);
|
|
58821
|
-
}
|
|
58822
|
-
config.enabled = parsedConfig.enabled;
|
|
58823
|
-
}
|
|
58824
58874
|
if (Object.hasOwn(parsedConfig, "replyHint")) {
|
|
58825
58875
|
if (typeof parsedConfig.replyHint !== "boolean") {
|
|
58826
58876
|
throw new Error(`"replyHint" must be a boolean`);
|
|
@@ -58857,7 +58907,6 @@ var init_config3 = __esm(() => {
|
|
|
58857
58907
|
brokerArgs: [...DEFAULT_BROKER_ARGS],
|
|
58858
58908
|
confirmSend: false,
|
|
58859
58909
|
maxPendingAsks: DEFAULT_MAX_PENDING_REPLY_WAITS,
|
|
58860
|
-
enabled: true,
|
|
58861
58910
|
replyHint: true
|
|
58862
58911
|
};
|
|
58863
58912
|
});
|
|
@@ -60693,8 +60742,6 @@ function registerIntercomLifecycle(pi, deps) {
|
|
|
60693
60742
|
deps.setSessionStartedAt(null);
|
|
60694
60743
|
}
|
|
60695
60744
|
pi.on("session_start", async (_event, ctx) => {
|
|
60696
|
-
if (!deps.config.enabled)
|
|
60697
|
-
return;
|
|
60698
60745
|
if (hasActiveSession)
|
|
60699
60746
|
await cleanupRuntime("Session replaced");
|
|
60700
60747
|
hasActiveSession = true;
|
|
@@ -62595,9 +62642,6 @@ function piIntercomExtension(pi, testOverrides = {}) {
|
|
|
62595
62642
|
await ensurePendingStageRouteClient(runId, { ...route, group: routeGroup });
|
|
62596
62643
|
}
|
|
62597
62644
|
async function ensureConnected(reason) {
|
|
62598
|
-
if (!config.enabled) {
|
|
62599
|
-
throw new Error("Intercom disabled");
|
|
62600
|
-
}
|
|
62601
62645
|
if (disposed || shuttingDown) {
|
|
62602
62646
|
throw new Error("Intercom shutting down");
|
|
62603
62647
|
}
|