@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);
|
|
@@ -11957,12 +11959,34 @@ var init_runner_events = __esm(() => {
|
|
|
11957
11959
|
init_callback_activity();
|
|
11958
11960
|
});
|
|
11959
11961
|
|
|
11962
|
+
// src/core/mandatory-runtime-tools.ts
|
|
11963
|
+
function isTrustedMandatoryRuntimeTool(registration) {
|
|
11964
|
+
return MANDATORY_TOOL_NAMES.has(registration.definition.name) && TRUSTED_MANDATORY_DEFINITIONS.has(registration.definition);
|
|
11965
|
+
}
|
|
11966
|
+
function isMandatoryRuntimeTool(name) {
|
|
11967
|
+
return MANDATORY_TOOL_NAMES.has(name);
|
|
11968
|
+
}
|
|
11969
|
+
function appendRegisteredMandatoryTools(tools, registry) {
|
|
11970
|
+
for (const name of MANDATORY_TOOL_NAMES) {
|
|
11971
|
+
const tool = registry.get(name);
|
|
11972
|
+
if (tool && !tools.some((candidate) => candidate.name === name))
|
|
11973
|
+
tools.push(tool);
|
|
11974
|
+
}
|
|
11975
|
+
return tools;
|
|
11976
|
+
}
|
|
11977
|
+
var MANDATORY_TOOL_NAMES, TRUSTED_MANDATORY_DEFINITIONS;
|
|
11978
|
+
var init_mandatory_runtime_tools = __esm(() => {
|
|
11979
|
+
MANDATORY_TOOL_NAMES = new Set(["intercom"]);
|
|
11980
|
+
TRUSTED_MANDATORY_DEFINITIONS = new WeakSet;
|
|
11981
|
+
});
|
|
11982
|
+
|
|
11960
11983
|
// src/core/extensions/runner-registries.ts
|
|
11961
11984
|
function collectRegisteredTools(extensions) {
|
|
11962
11985
|
const toolsByName = new Map;
|
|
11963
11986
|
for (const ext of extensions) {
|
|
11964
11987
|
for (const tool of ext.tools.values()) {
|
|
11965
|
-
|
|
11988
|
+
const existing = toolsByName.get(tool.definition.name);
|
|
11989
|
+
if (!existing || isMandatoryRuntimeTool(tool.definition.name) && isTrustedMandatoryRuntimeTool(tool)) {
|
|
11966
11990
|
toolsByName.set(tool.definition.name, tool);
|
|
11967
11991
|
}
|
|
11968
11992
|
}
|
|
@@ -11970,13 +11994,16 @@ function collectRegisteredTools(extensions) {
|
|
|
11970
11994
|
return Array.from(toolsByName.values());
|
|
11971
11995
|
}
|
|
11972
11996
|
function findToolDefinition(extensions, toolName) {
|
|
11997
|
+
let first;
|
|
11973
11998
|
for (const ext of extensions) {
|
|
11974
11999
|
const tool = ext.tools.get(toolName);
|
|
11975
|
-
if (tool)
|
|
12000
|
+
if (!tool)
|
|
12001
|
+
continue;
|
|
12002
|
+
first ??= tool;
|
|
12003
|
+
if (isMandatoryRuntimeTool(toolName) && isTrustedMandatoryRuntimeTool(tool))
|
|
11976
12004
|
return tool.definition;
|
|
11977
|
-
}
|
|
11978
12005
|
}
|
|
11979
|
-
return;
|
|
12006
|
+
return first?.definition;
|
|
11980
12007
|
}
|
|
11981
12008
|
function collectFlags(extensions) {
|
|
11982
12009
|
const allFlags = new Map;
|
|
@@ -12044,6 +12071,9 @@ function resolveRegisteredCommands(extensions) {
|
|
|
12044
12071
|
return { ...command, invocationName };
|
|
12045
12072
|
});
|
|
12046
12073
|
}
|
|
12074
|
+
var init_runner_registries = __esm(() => {
|
|
12075
|
+
init_mandatory_runtime_tools();
|
|
12076
|
+
});
|
|
12047
12077
|
|
|
12048
12078
|
// src/core/extensions/runner-shortcuts.ts
|
|
12049
12079
|
function resolveExtensionShortcuts(extensions, resolvedKeybindings, hasUI) {
|
|
@@ -12107,6 +12137,7 @@ var init_runner_shortcuts = __esm(() => {
|
|
|
12107
12137
|
"app.thinking.toggle",
|
|
12108
12138
|
"app.editor.external",
|
|
12109
12139
|
"app.message.followUp",
|
|
12140
|
+
"app.message.copy",
|
|
12110
12141
|
"tui.input.submit",
|
|
12111
12142
|
"tui.select.confirm",
|
|
12112
12143
|
"tui.select.cancel",
|
|
@@ -12570,6 +12601,7 @@ var init_runner = __esm(() => {
|
|
|
12570
12601
|
init_loader_runtime();
|
|
12571
12602
|
init_runner_context();
|
|
12572
12603
|
init_runner_events();
|
|
12604
|
+
init_runner_registries();
|
|
12573
12605
|
init_runner_shortcuts();
|
|
12574
12606
|
init_runner_ui();
|
|
12575
12607
|
init_stale_context();
|
|
@@ -16170,14 +16202,13 @@ function getToolDefinition(name) {
|
|
|
16170
16202
|
}
|
|
16171
16203
|
function setActiveToolsByName(toolNames) {
|
|
16172
16204
|
const tools = [];
|
|
16173
|
-
const validToolNames = [];
|
|
16174
16205
|
for (const name of toolNames) {
|
|
16175
16206
|
const tool = this._toolRegistry.get(name);
|
|
16176
|
-
if (tool)
|
|
16207
|
+
if (tool)
|
|
16177
16208
|
tools.push(tool);
|
|
16178
|
-
validToolNames.push(name);
|
|
16179
|
-
}
|
|
16180
16209
|
}
|
|
16210
|
+
appendRegisteredMandatoryTools(tools, this._toolRegistry);
|
|
16211
|
+
const validToolNames = tools.map((tool) => tool.name);
|
|
16181
16212
|
this.agent.state.tools = tools;
|
|
16182
16213
|
this._baseSystemPrompt = this._rebuildSystemPrompt(validToolNames);
|
|
16183
16214
|
this.agent.state.systemPrompt = this._systemPromptOverride ?? this._baseSystemPrompt;
|
|
@@ -16234,7 +16265,7 @@ function _rebuildSystemPrompt(toolNames) {
|
|
|
16234
16265
|
customPrompt: loaderSystemPrompt,
|
|
16235
16266
|
appendSystemPrompt,
|
|
16236
16267
|
selectedTools: validToolNames,
|
|
16237
|
-
excludedTools: this._excludedToolNames ? Array.from(this._excludedToolNames) : undefined,
|
|
16268
|
+
excludedTools: this._excludedToolNames ? Array.from(this._excludedToolNames).filter((name) => !isMandatoryRuntimeTool(name)) : undefined,
|
|
16238
16269
|
toolSnippets,
|
|
16239
16270
|
promptGuidelines
|
|
16240
16271
|
};
|
|
@@ -16247,6 +16278,7 @@ function _refreshBaseSystemPromptFromActiveTools() {
|
|
|
16247
16278
|
}
|
|
16248
16279
|
var agentSessionStateMethods;
|
|
16249
16280
|
var init_agent_session_state = __esm(() => {
|
|
16281
|
+
init_mandatory_runtime_tools();
|
|
16250
16282
|
init_skill_catalog();
|
|
16251
16283
|
init_system_prompt();
|
|
16252
16284
|
agentSessionStateMethods = {
|
|
@@ -17275,31 +17307,14 @@ function _installAgentToolHooks() {
|
|
|
17275
17307
|
function _installAgentNextTurnRefresh() {
|
|
17276
17308
|
const previousPrepareNextTurnWithContext = this.agent.prepareNextTurnWithContext ?? (this.agent.prepareNextTurn ? async (_turn, signal) => await this.agent.prepareNextTurn?.(signal) : undefined);
|
|
17277
17309
|
const previousShouldStopAfterTurn = this.agent.shouldStopAfterTurn;
|
|
17278
|
-
let pendingStopResult;
|
|
17279
|
-
const pendingStopMatches = (turn) => {
|
|
17280
|
-
const pending = pendingStopResult;
|
|
17281
|
-
return pending?.message === turn.message && pending.toolResults === turn.toolResults && pending.newMessages === turn.newMessages;
|
|
17282
|
-
};
|
|
17283
|
-
const clearPendingStopResult = (turn) => {
|
|
17284
|
-
if (pendingStopMatches(turn))
|
|
17285
|
-
pendingStopResult = undefined;
|
|
17286
|
-
};
|
|
17287
17310
|
this.agent.shouldStopAfterTurn = async (turn, signal) => {
|
|
17288
|
-
const
|
|
17289
|
-
|
|
17290
|
-
|
|
17291
|
-
|
|
17292
|
-
}
|
|
17293
|
-
return await previousShouldStopAfterTurn?.(turn, signal) ?? false;
|
|
17294
|
-
};
|
|
17295
|
-
const cacheStopResult = async (turn, signal) => {
|
|
17311
|
+
const toolCallIds = turn.message.content.filter((part) => part.type === "toolCall").map((part) => part.id);
|
|
17312
|
+
const terminatingBatch = toolCallIds.length > 0 && toolCallIds.every((id) => this._terminatingToolCallIds.has(id));
|
|
17313
|
+
for (const id of toolCallIds)
|
|
17314
|
+
this._terminatingToolCallIds.delete(id);
|
|
17296
17315
|
const shouldStop = await previousShouldStopAfterTurn?.(turn, signal) ?? false;
|
|
17297
|
-
|
|
17298
|
-
|
|
17299
|
-
toolResults: turn.toolResults,
|
|
17300
|
-
newMessages: turn.newMessages,
|
|
17301
|
-
shouldStop
|
|
17302
|
-
};
|
|
17316
|
+
this._stopAfterTurnBlockedContinuation = shouldStop;
|
|
17317
|
+
await settleFallbackAfterTurn(this, turn, terminatingBatch);
|
|
17303
17318
|
return shouldStop;
|
|
17304
17319
|
};
|
|
17305
17320
|
const previousTransformContext = this.agent.transformContext;
|
|
@@ -17327,68 +17342,7 @@ function _installAgentNextTurnRefresh() {
|
|
|
17327
17342
|
thinkingLevel: this.agent.state.thinkingLevel
|
|
17328
17343
|
};
|
|
17329
17344
|
};
|
|
17330
|
-
|
|
17331
|
-
const prepareDeferredTurn = async (loopConfig) => {
|
|
17332
|
-
const deferred = deferredPreparation;
|
|
17333
|
-
if (!deferred)
|
|
17334
|
-
return;
|
|
17335
|
-
deferredPreparation = undefined;
|
|
17336
|
-
const snapshot = await prepareTurn(deferred.turn, deferred.signal);
|
|
17337
|
-
const nextContext = snapshot.context ?? deferred.turn.context;
|
|
17338
|
-
deferred.loopContext.systemPrompt = nextContext.systemPrompt;
|
|
17339
|
-
deferred.loopContext.messages = nextContext.messages;
|
|
17340
|
-
deferred.loopContext.tools = nextContext.tools;
|
|
17341
|
-
loopConfig.model = snapshot.model ?? loopConfig.model;
|
|
17342
|
-
loopConfig.reasoning = snapshot.thinkingLevel === undefined ? loopConfig.reasoning : snapshot.thinkingLevel === "off" ? undefined : snapshot.thinkingLevel;
|
|
17343
|
-
};
|
|
17344
|
-
const agentLoopDoor = this.agent;
|
|
17345
|
-
const previousCreateLoopConfig = agentLoopDoor.createLoopConfig.bind(this.agent);
|
|
17346
|
-
agentLoopDoor.createLoopConfig = (options) => {
|
|
17347
|
-
deferredPreparation = undefined;
|
|
17348
|
-
this._stopAfterTurnBlockedContinuation = false;
|
|
17349
|
-
const loopConfig = previousCreateLoopConfig(options);
|
|
17350
|
-
const wrapQueuePoll = (poll) => async function() {
|
|
17351
|
-
const messages = await poll?.() ?? [];
|
|
17352
|
-
if (messages.length > 0)
|
|
17353
|
-
await prepareDeferredTurn(this);
|
|
17354
|
-
return messages;
|
|
17355
|
-
};
|
|
17356
|
-
loopConfig.getSteeringMessages = wrapQueuePoll(loopConfig.getSteeringMessages);
|
|
17357
|
-
loopConfig.getFollowUpMessages = wrapQueuePoll(loopConfig.getFollowUpMessages);
|
|
17358
|
-
return loopConfig;
|
|
17359
|
-
};
|
|
17360
|
-
this.agent.prepareNextTurnWithContext = async (turn, signal) => {
|
|
17361
|
-
const toolCallIds = turn.message.content.filter((part) => part.type === "toolCall").map((part) => part.id);
|
|
17362
|
-
const terminatingBatch = toolCallIds.length > 0 && toolCallIds.every((id) => this._terminatingToolCallIds.has(id));
|
|
17363
|
-
for (const id of toolCallIds)
|
|
17364
|
-
this._terminatingToolCallIds.delete(id);
|
|
17365
|
-
const shouldStop = await cacheStopResult(turn, signal);
|
|
17366
|
-
try {
|
|
17367
|
-
if (shouldStop) {
|
|
17368
|
-
deferredPreparation = undefined;
|
|
17369
|
-
this._stopAfterTurnBlockedContinuation = true;
|
|
17370
|
-
await settleFallbackAfterTurn(this, turn, terminatingBatch);
|
|
17371
|
-
return;
|
|
17372
|
-
}
|
|
17373
|
-
if (turn.toolResults.length > 0 && !terminatingBatch) {
|
|
17374
|
-
deferredPreparation = undefined;
|
|
17375
|
-
const snapshot = await prepareTurn(turn, signal);
|
|
17376
|
-
await settleFallbackAfterTurn(this, turn, terminatingBatch);
|
|
17377
|
-
return snapshot;
|
|
17378
|
-
}
|
|
17379
|
-
await settleFallbackAfterTurn(this, turn, terminatingBatch);
|
|
17380
|
-
const loopContext = {
|
|
17381
|
-
...turn.context,
|
|
17382
|
-
messages: turn.context.messages.slice(),
|
|
17383
|
-
tools: turn.context.tools?.slice()
|
|
17384
|
-
};
|
|
17385
|
-
deferredPreparation = { turn, signal, loopContext };
|
|
17386
|
-
return { context: loopContext };
|
|
17387
|
-
} catch (error) {
|
|
17388
|
-
clearPendingStopResult(turn);
|
|
17389
|
-
throw error;
|
|
17390
|
-
}
|
|
17391
|
-
};
|
|
17345
|
+
this.agent.prepareNextTurnWithContext = prepareTurn;
|
|
17392
17346
|
}
|
|
17393
17347
|
async function settleFallbackAfterTurn(session, turn, terminatingBatch) {
|
|
17394
17348
|
const preserveFallbackForFailure = turn.message.role === "assistant" && !session.agent.hasQueuedMessages() && (turn.message.stopReason === "length" || session._isEmptyCompletion?.(turn.message) === true || session._isSafetyRefusal?.(turn.message) === true);
|
|
@@ -17493,6 +17447,7 @@ var init_loader_virtual_modules = __esm(() => {
|
|
|
17493
17447
|
});
|
|
17494
17448
|
|
|
17495
17449
|
// src/core/extensions/loader-core.ts
|
|
17450
|
+
var runtimeEventBuses;
|
|
17496
17451
|
var init_loader_core = __esm(() => {
|
|
17497
17452
|
init_event_loop();
|
|
17498
17453
|
init_paths();
|
|
@@ -17502,6 +17457,7 @@ var init_loader_core = __esm(() => {
|
|
|
17502
17457
|
init_loader_resources();
|
|
17503
17458
|
init_loader_runtime();
|
|
17504
17459
|
init_loader_virtual_modules();
|
|
17460
|
+
runtimeEventBuses = new WeakMap;
|
|
17505
17461
|
});
|
|
17506
17462
|
|
|
17507
17463
|
// src/core/package-manager-manifest.ts
|
|
@@ -22604,7 +22560,7 @@ class FastModeSelectorComponent {
|
|
|
22604
22560
|
}
|
|
22605
22561
|
invalidate() {}
|
|
22606
22562
|
render(width) {
|
|
22607
|
-
const lines = [truncateToWidth10(theme.bold(theme.fg("accent", "
|
|
22563
|
+
const lines = [truncateToWidth10(theme.bold(theme.fg("accent", "Fast mode")), width)];
|
|
22608
22564
|
for (const line of wrapTextWithAnsi3(DESCRIPTION, Math.max(20, width))) {
|
|
22609
22565
|
lines.push(theme.fg("muted", line));
|
|
22610
22566
|
}
|
|
@@ -22687,7 +22643,7 @@ class FastModeSelectorComponent {
|
|
|
22687
22643
|
return this.getFocusedRow() === row ? theme.fg("muted", text) : theme.fg("dim", text);
|
|
22688
22644
|
}
|
|
22689
22645
|
}
|
|
22690
|
-
var ROWS, LABEL_WIDTH = 16, DESCRIPTION = "
|
|
22646
|
+
var ROWS, LABEL_WIDTH = 16, DESCRIPTION = "Use faster routing for the selected model when supported by its provider.", ROW_DETAILS;
|
|
22691
22647
|
var init_fast_mode_selector = __esm(() => {
|
|
22692
22648
|
init_theme();
|
|
22693
22649
|
ROWS = ["chat", "workflow"];
|
|
@@ -23914,6 +23870,10 @@ var init_keybindings = __esm(() => {
|
|
|
23914
23870
|
defaultKeys: windowsKeybindings ? "alt+q" : "alt+up",
|
|
23915
23871
|
description: "Restore queued messages"
|
|
23916
23872
|
},
|
|
23873
|
+
"app.message.copy": {
|
|
23874
|
+
defaultKeys: "ctrl+x",
|
|
23875
|
+
description: "Copy fullscreen selection or last agent message"
|
|
23876
|
+
},
|
|
23917
23877
|
"app.clipboard.pasteImage": {
|
|
23918
23878
|
defaultKeys: windowsKeybindings ? "alt+v" : "ctrl+v",
|
|
23919
23879
|
description: "Paste image from clipboard (text fallback)"
|
|
@@ -25299,6 +25259,9 @@ function createSettingsChangeHandler(callbacks) {
|
|
|
25299
25259
|
case "fullscreen-exit-output":
|
|
25300
25260
|
callbacks.onFullscreenExitOutputChange(newValue);
|
|
25301
25261
|
break;
|
|
25262
|
+
case "fullscreen-copy-on-select":
|
|
25263
|
+
callbacks.onFullscreenCopyOnSelectChange(newValue === "true");
|
|
25264
|
+
break;
|
|
25302
25265
|
case "editor-padding":
|
|
25303
25266
|
callbacks.onEditorPaddingXChange(parseInt(newValue, 10));
|
|
25304
25267
|
break;
|
|
@@ -25686,6 +25649,13 @@ function insertUiToggles(items, config) {
|
|
|
25686
25649
|
values: ["transcript", "resume-hint"]
|
|
25687
25650
|
});
|
|
25688
25651
|
insertAfter(items, "fullscreen-exit-output", {
|
|
25652
|
+
id: "fullscreen-copy-on-select",
|
|
25653
|
+
label: "Fullscreen copy on select",
|
|
25654
|
+
description: "Copy selected transcript text automatically on mouse release",
|
|
25655
|
+
currentValue: config.fullscreenCopyOnSelect ? "true" : "false",
|
|
25656
|
+
values: ["true", "false"]
|
|
25657
|
+
});
|
|
25658
|
+
insertAfter(items, "fullscreen-copy-on-select", {
|
|
25689
25659
|
id: "editor-padding",
|
|
25690
25660
|
label: "Editor padding",
|
|
25691
25661
|
description: "Horizontal padding for input editor (0-3)",
|
|
@@ -38816,6 +38786,8 @@ function _refreshToolRegistry(options) {
|
|
|
38816
38786
|
const allowedToolNames = this._allowedToolNames;
|
|
38817
38787
|
const excludedToolNames = this._excludedToolNames;
|
|
38818
38788
|
const isExposedTool = (name) => {
|
|
38789
|
+
if (isMandatoryRuntimeTool(name))
|
|
38790
|
+
return true;
|
|
38819
38791
|
if (allowedToolNames && !allowedToolNames.has(name)) {
|
|
38820
38792
|
return false;
|
|
38821
38793
|
}
|
|
@@ -38824,10 +38796,10 @@ function _refreshToolRegistry(options) {
|
|
|
38824
38796
|
}
|
|
38825
38797
|
return true;
|
|
38826
38798
|
};
|
|
38827
|
-
const registeredTools = this._extensionRunner.getAllRegisteredTools();
|
|
38799
|
+
const registeredTools = this._extensionRunner.getAllRegisteredTools().filter((tool) => !isMandatoryRuntimeTool(tool.definition.name) || isTrustedMandatoryRuntimeTool(tool));
|
|
38828
38800
|
const allCustomTools = [
|
|
38829
38801
|
...registeredTools,
|
|
38830
|
-
...this._customTools.map((definition) => ({
|
|
38802
|
+
...this._customTools.filter((definition) => !isMandatoryRuntimeTool(definition.name)).map((definition) => ({
|
|
38831
38803
|
definition,
|
|
38832
38804
|
sourceInfo: createSyntheticSourceInfo(`<sdk:${definition.name}>`, { source: "sdk" })
|
|
38833
38805
|
}))
|
|
@@ -38948,6 +38920,7 @@ function _buildRuntime(options) {
|
|
|
38948
38920
|
var agentSessionToolRegistryMethods;
|
|
38949
38921
|
var init_agent_session_tool_registry = __esm(() => {
|
|
38950
38922
|
init_extensions();
|
|
38923
|
+
init_mandatory_runtime_tools();
|
|
38951
38924
|
init_model_registry();
|
|
38952
38925
|
init_tools();
|
|
38953
38926
|
init_session_temp_dir();
|
|
@@ -39939,11 +39912,12 @@ var init_builtin_packages = __esm(() => {
|
|
|
39939
39912
|
{ packageName: "@bastani/subagents", workspaceDirName: "subagents", distDirName: "subagents" },
|
|
39940
39913
|
{ packageName: "@bastani/mcp", workspaceDirName: "mcp", distDirName: "mcp" },
|
|
39941
39914
|
{ packageName: "@bastani/web-access", workspaceDirName: "web-access", distDirName: "web-access" },
|
|
39942
|
-
{ packageName: "@bastani/intercom", workspaceDirName: "intercom", distDirName: "intercom" }
|
|
39915
|
+
{ packageName: "@bastani/intercom", workspaceDirName: "intercom", distDirName: "intercom", mandatory: true }
|
|
39943
39916
|
];
|
|
39944
39917
|
BUILTIN_PACKAGES = WORKSPACE_BUILTINS.map((spec) => ({
|
|
39945
39918
|
packageName: spec.packageName,
|
|
39946
39919
|
distDirName: spec.distDirName,
|
|
39920
|
+
mandatory: spec.mandatory === true,
|
|
39947
39921
|
requiredEntries: requiredEntriesForBuiltin(spec.distDirName),
|
|
39948
39922
|
sourceCandidates: ({ here, packageDir, isSourceCheckout }) => isSourceCheckout ? [join37(packageDir, "..", spec.workspaceDirName), join37(here, "..", "..", "..", spec.workspaceDirName)] : []
|
|
39949
39923
|
}));
|
|
@@ -43289,7 +43263,9 @@ var init_resource_loader_extensions = __esm(() => {
|
|
|
43289
43263
|
var init_resource_loader_reload = __esm(() => {
|
|
43290
43264
|
init_event_loop();
|
|
43291
43265
|
init_paths();
|
|
43266
|
+
init_builtin_packages();
|
|
43292
43267
|
init_loader();
|
|
43268
|
+
init_mandatory_runtime_tools();
|
|
43293
43269
|
init_resource_loader_assets();
|
|
43294
43270
|
init_resource_loader_context_files();
|
|
43295
43271
|
init_resource_loader_discovery();
|
|
@@ -44446,6 +44422,28 @@ var init_settings_manager_ui_accessors = __esm(() => {
|
|
|
44446
44422
|
state.markModified("fullscreenExitOutput");
|
|
44447
44423
|
state.save();
|
|
44448
44424
|
},
|
|
44425
|
+
getFullscreenCopyOnSelect() {
|
|
44426
|
+
return settingsInternals(this).settings.fullscreenCopyOnSelect !== false;
|
|
44427
|
+
},
|
|
44428
|
+
setFullscreenCopyOnSelect(enabled) {
|
|
44429
|
+
const state = settingsInternals(this);
|
|
44430
|
+
state.globalSettings.fullscreenCopyOnSelect = enabled;
|
|
44431
|
+
state.markModified("fullscreenCopyOnSelect");
|
|
44432
|
+
state.save();
|
|
44433
|
+
},
|
|
44434
|
+
getTerminalCapabilityOverrides() {
|
|
44435
|
+
const terminal = settingsInternals(this).settings.terminal;
|
|
44436
|
+
const overrides = {};
|
|
44437
|
+
if (typeof terminal?.hyperlinks === "boolean")
|
|
44438
|
+
overrides.hyperlinks = terminal.hyperlinks;
|
|
44439
|
+
if (terminal?.images === "kitty" || terminal?.images === "iterm2")
|
|
44440
|
+
overrides.images = terminal.images;
|
|
44441
|
+
else if (terminal?.images === false)
|
|
44442
|
+
overrides.images = null;
|
|
44443
|
+
if (typeof terminal?.trueColor === "boolean")
|
|
44444
|
+
overrides.trueColor = terminal.trueColor;
|
|
44445
|
+
return overrides;
|
|
44446
|
+
},
|
|
44449
44447
|
getEditorPaddingX() {
|
|
44450
44448
|
return settingsInternals(this).settings.editorPaddingX ?? 0;
|
|
44451
44449
|
},
|
|
@@ -44591,6 +44589,14 @@ var init_resource_loader = __esm(() => {
|
|
|
44591
44589
|
init_resource_loader_core();
|
|
44592
44590
|
init_skill_catalog();
|
|
44593
44591
|
});
|
|
44592
|
+
// src/core/mandatory-resource-loader.ts
|
|
44593
|
+
var init_mandatory_resource_loader = __esm(() => {
|
|
44594
|
+
init_builtin_packages();
|
|
44595
|
+
init_loader();
|
|
44596
|
+
init_mandatory_runtime_tools();
|
|
44597
|
+
init_skill_catalog();
|
|
44598
|
+
});
|
|
44599
|
+
|
|
44594
44600
|
// src/core/model-resolver-defaults.ts
|
|
44595
44601
|
function findPreferredAvailableModel(availableModels) {
|
|
44596
44602
|
for (const [provider, defaultId] of Object.entries(defaultModelPerProvider)) {
|
|
@@ -45289,6 +45295,7 @@ var init_session_cwd = __esm(() => {
|
|
|
45289
45295
|
var init_agent_session_services = __esm(() => {
|
|
45290
45296
|
init_config();
|
|
45291
45297
|
init_paths();
|
|
45298
|
+
init_mandatory_resource_loader();
|
|
45292
45299
|
init_model_runtime();
|
|
45293
45300
|
init_resource_loader();
|
|
45294
45301
|
init_sdk();
|
|
@@ -45625,6 +45632,7 @@ var init_sdk = __esm(() => {
|
|
|
45625
45632
|
init_agent_session();
|
|
45626
45633
|
init_auth_guidance();
|
|
45627
45634
|
init_codex_fast_mode();
|
|
45635
|
+
init_mandatory_resource_loader();
|
|
45628
45636
|
init_messages();
|
|
45629
45637
|
init_model_resolver();
|
|
45630
45638
|
init_model_runtime();
|
|
@@ -45728,7 +45736,12 @@ var init_list_models = __esm(() => {
|
|
|
45728
45736
|
});
|
|
45729
45737
|
|
|
45730
45738
|
// src/cli/startup-ui.ts
|
|
45731
|
-
import {
|
|
45739
|
+
import {
|
|
45740
|
+
ProcessTerminal,
|
|
45741
|
+
setCapabilityOverrides,
|
|
45742
|
+
setKeybindings,
|
|
45743
|
+
TuiMainScreen
|
|
45744
|
+
} from "@earendil-works/pi-tui";
|
|
45732
45745
|
var init_startup_ui = __esm(() => {
|
|
45733
45746
|
init_config();
|
|
45734
45747
|
init_keybindings();
|
|
@@ -45816,7 +45829,7 @@ var init_main_first_time_setup = __esm(() => {
|
|
|
45816
45829
|
init_startup_ui();
|
|
45817
45830
|
});
|
|
45818
45831
|
// src/cli/session-picker.ts
|
|
45819
|
-
import { ProcessTerminal as ProcessTerminal2, setKeybindings as setKeybindings2, TuiMainScreen as TuiMainScreen2 } from "@earendil-works/pi-tui";
|
|
45832
|
+
import { ProcessTerminal as ProcessTerminal2, setCapabilityOverrides as setCapabilityOverrides2, setKeybindings as setKeybindings2, TuiMainScreen as TuiMainScreen2 } from "@earendil-works/pi-tui";
|
|
45820
45833
|
var init_session_picker = __esm(() => {
|
|
45821
45834
|
init_config();
|
|
45822
45835
|
init_keybindings();
|
|
@@ -45824,7 +45837,7 @@ var init_session_picker = __esm(() => {
|
|
|
45824
45837
|
});
|
|
45825
45838
|
|
|
45826
45839
|
// src/main-session.ts
|
|
45827
|
-
import { ProcessTerminal as ProcessTerminal3, setKeybindings as setKeybindings3, TuiMainScreen as TuiMainScreen3 } from "@earendil-works/pi-tui";
|
|
45840
|
+
import { ProcessTerminal as ProcessTerminal3, setCapabilityOverrides as setCapabilityOverrides3, setKeybindings as setKeybindings3, TuiMainScreen as TuiMainScreen3 } from "@earendil-works/pi-tui";
|
|
45828
45841
|
import chalk10 from "chalk";
|
|
45829
45842
|
var init_main_session = __esm(() => {
|
|
45830
45843
|
init_session_picker();
|
|
@@ -48642,7 +48655,7 @@ var init_slash_commands = __esm(() => {
|
|
|
48642
48655
|
{ name: "tree", description: "Navigate session tree (switch branches)" },
|
|
48643
48656
|
{ name: "thinking", description: "Set thinking level", argumentHint: "<level>" },
|
|
48644
48657
|
{ name: "scoped-models", description: "Enable/disable models for ctrl+p cycling" },
|
|
48645
|
-
{ name: "fast", description: "Configure
|
|
48658
|
+
{ name: "fast", description: "Configure fast mode for chat and workflows on supported models" },
|
|
48646
48659
|
{ name: "export", description: "Export session (HTML default, or specify path: .html/.jsonl)" },
|
|
48647
48660
|
{ name: "import", description: "Import and resume a session from a JSONL file" },
|
|
48648
48661
|
{ name: "share", description: "Share session as a secret GitHub gist" },
|
|
@@ -49268,6 +49281,7 @@ function createFullscreenTui(options) {
|
|
|
49268
49281
|
openUrl: openBrowser
|
|
49269
49282
|
}),
|
|
49270
49283
|
onRightClickPaste: options.onRightClickPaste,
|
|
49284
|
+
copyOnSelect: options.copyOnSelect,
|
|
49271
49285
|
copySelection: options.copySelection ?? copySelectionToHostClipboard
|
|
49272
49286
|
}, options.shouldHandleViewportInput, options.onOverlayUnhandledInput);
|
|
49273
49287
|
}
|
|
@@ -49309,7 +49323,7 @@ function createInteractiveTuiReference(getTui) {
|
|
|
49309
49323
|
getPrototypeOf: () => Reflect.getPrototypeOf(getTui())
|
|
49310
49324
|
});
|
|
49311
49325
|
}
|
|
49312
|
-
var viewportInputListeners, viewportInputGates, overlayUnhandledInputHandlers, viewportInputReplays, viewportInputSubscriptions, SGR_MOUSE_SEQUENCE, LEFT_MOUSE_MODIFIER_MASK, AtomicTuiAltScreen, AtomicTuiMainScreen;
|
|
49326
|
+
var viewportInputListeners, viewportInputGates, overlayUnhandledInputHandlers, viewportInputReplays, overlayOwnedSelections, viewportInputSubscriptions, SGR_MOUSE_SEQUENCE, LEFT_MOUSE_MODIFIER_MASK, AtomicTuiAltScreen, AtomicTuiMainScreen;
|
|
49313
49327
|
var init_interactive_tui = __esm(() => {
|
|
49314
49328
|
init_clipboard();
|
|
49315
49329
|
init_open_browser();
|
|
@@ -49318,6 +49332,7 @@ var init_interactive_tui = __esm(() => {
|
|
|
49318
49332
|
viewportInputGates = new WeakMap;
|
|
49319
49333
|
overlayUnhandledInputHandlers = new WeakMap;
|
|
49320
49334
|
viewportInputReplays = new WeakSet;
|
|
49335
|
+
overlayOwnedSelections = new WeakSet;
|
|
49321
49336
|
viewportInputSubscriptions = new WeakMap;
|
|
49322
49337
|
SGR_MOUSE_SEQUENCE = /^\x1b\[<(\d+);\d+;\d+([Mm])/;
|
|
49323
49338
|
LEFT_MOUSE_MODIFIER_MASK = 4 | 8 | 16;
|
|
@@ -49333,8 +49348,20 @@ var init_interactive_tui = __esm(() => {
|
|
|
49333
49348
|
deferral.shouldDeferViewportInputToOverlay = () => !viewportInputReplays.has(this) && deferToOverlay?.() === true;
|
|
49334
49349
|
}
|
|
49335
49350
|
applyLineResets(lines) {
|
|
49351
|
+
if (overlayOwnedSelections.has(this) && !this.isFocusedOverlay())
|
|
49352
|
+
this.clearOverlayOwnedSelection();
|
|
49336
49353
|
return stripOverlayActiveRowMarker(super.applyLineResets(lines));
|
|
49337
49354
|
}
|
|
49355
|
+
clearOverlayOwnedSelection() {
|
|
49356
|
+
const selection = this;
|
|
49357
|
+
selection.selectionAnchor = undefined;
|
|
49358
|
+
selection.selectionFocus = undefined;
|
|
49359
|
+
selection.selectionInitialRange = undefined;
|
|
49360
|
+
selection.selectionPressActive = false;
|
|
49361
|
+
selection.selectionDragged = false;
|
|
49362
|
+
selection.lastClick = undefined;
|
|
49363
|
+
overlayOwnedSelections.delete(this);
|
|
49364
|
+
}
|
|
49338
49365
|
isPiTuiMouseSequence(data) {
|
|
49339
49366
|
if (parseMouseSequences(data))
|
|
49340
49367
|
return true;
|
|
@@ -49411,6 +49438,7 @@ var init_interactive_tui = __esm(() => {
|
|
|
49411
49438
|
if (isLeftMouseButton(sequence))
|
|
49412
49439
|
viewportListener(sequence.data);
|
|
49413
49440
|
}
|
|
49441
|
+
overlayOwnedSelections.add(this);
|
|
49414
49442
|
}
|
|
49415
49443
|
replayViewportInput(viewportListener, data) {
|
|
49416
49444
|
viewportInputReplays.add(this);
|
|
@@ -49478,7 +49506,11 @@ var init_interactive_tui = __esm(() => {
|
|
|
49478
49506
|
});
|
|
49479
49507
|
|
|
49480
49508
|
// src/modes/interactive/interactive-mode-base.ts
|
|
49481
|
-
import {
|
|
49509
|
+
import {
|
|
49510
|
+
isKeyRelease as isKeyRelease3,
|
|
49511
|
+
isViewportTUI,
|
|
49512
|
+
setCapabilityOverrides as setCapabilityOverrides4
|
|
49513
|
+
} from "@earendil-works/pi-tui";
|
|
49482
49514
|
function isFullscreenViewportAction(data, keybindings) {
|
|
49483
49515
|
return FULLSCREEN_VIEWPORT_ACTIONS.some((action) => keybindings.matches(data, action));
|
|
49484
49516
|
}
|
|
@@ -49539,6 +49571,18 @@ class InteractiveModeBase {
|
|
|
49539
49571
|
return false;
|
|
49540
49572
|
return this.defaultEditor.handleInput(data);
|
|
49541
49573
|
}
|
|
49574
|
+
setFullscreenCopyOnSelect(enabled) {
|
|
49575
|
+
if (this.renderer.mode === "fullscreen")
|
|
49576
|
+
this.renderer.setCopyOnSelect(enabled);
|
|
49577
|
+
}
|
|
49578
|
+
getFullscreenCopyOnSelect() {
|
|
49579
|
+
return this.renderer.mode === "fullscreen" ? this.renderer.getCopyOnSelect() : undefined;
|
|
49580
|
+
}
|
|
49581
|
+
async copyActiveFullscreenSelection() {
|
|
49582
|
+
if (this.renderer.mode !== "fullscreen" || !this.renderer.hasActiveSelection())
|
|
49583
|
+
return;
|
|
49584
|
+
return this.renderer.copyActiveSelectionToClipboard();
|
|
49585
|
+
}
|
|
49542
49586
|
onRightClickPaste = () => {
|
|
49543
49587
|
this.handleRightClickPaste();
|
|
49544
49588
|
};
|
|
@@ -49738,11 +49782,13 @@ class InteractiveModeBase {
|
|
|
49738
49782
|
await this.rebindCurrentSession();
|
|
49739
49783
|
await this.themeController.applyFromSettings();
|
|
49740
49784
|
});
|
|
49785
|
+
setCapabilityOverrides4(this.settingsManager.getTerminalCapabilityOverrides());
|
|
49741
49786
|
this.version = VERSION;
|
|
49742
49787
|
this.renderer = createInteractiveTui({
|
|
49743
49788
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
49744
49789
|
logDirectory: runtimeHost.services.agentDir,
|
|
49745
49790
|
terminal: options.terminal,
|
|
49791
|
+
copyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
49746
49792
|
onRightClickPaste: this.onRightClickPaste,
|
|
49747
49793
|
shouldHandleViewportInput: this.shouldHandleViewportInput,
|
|
49748
49794
|
onOverlayUnhandledInput: this.onOverlayUnhandledInput,
|
|
@@ -50865,6 +50911,7 @@ var init_interactive_deferred_startup = __esm(() => {
|
|
|
50865
50911
|
try {
|
|
50866
50912
|
await this.bindCurrentSessionExtensions();
|
|
50867
50913
|
await this.session.reload({ reason: "startup" });
|
|
50914
|
+
this.applyRuntimeSettings();
|
|
50868
50915
|
this.rebuildChatFromMessages();
|
|
50869
50916
|
if (!this.promptTurnWorkingLoaderActive) {
|
|
50870
50917
|
this.stopWorkingLoader();
|
|
@@ -51553,6 +51600,7 @@ ${warningLines}`, 0, 0));
|
|
|
51553
51600
|
});
|
|
51554
51601
|
|
|
51555
51602
|
// src/modes/interactive/interactive-session-runtime.ts
|
|
51603
|
+
import { setCapabilityOverrides as setCapabilityOverrides5 } from "@earendil-works/pi-tui";
|
|
51556
51604
|
var init_interactive_session_runtime = __esm(() => {
|
|
51557
51605
|
init_interactive_mode_base();
|
|
51558
51606
|
init_interactive_mode_deps();
|
|
@@ -51639,6 +51687,8 @@ var init_interactive_session_runtime = __esm(() => {
|
|
|
51639
51687
|
}
|
|
51640
51688
|
};
|
|
51641
51689
|
InteractiveModeBase.prototype.applyRuntimeSettings = function() {
|
|
51690
|
+
setCapabilityOverrides5(this.settingsManager.getTerminalCapabilityOverrides());
|
|
51691
|
+
this.setFullscreenCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());
|
|
51642
51692
|
this.transcriptScrollView?.setScrollbar(this.settingsManager.getFullscreenScrollbar());
|
|
51643
51693
|
this.footer.setSession(this.session);
|
|
51644
51694
|
this.usageMeter.setSession(this.session);
|
|
@@ -53155,6 +53205,9 @@ var init_interactive_input_handling = __esm(() => {
|
|
|
53155
53205
|
});
|
|
53156
53206
|
this.defaultEditor.onAction("app.message.followUp", () => this.handleFollowUp());
|
|
53157
53207
|
this.defaultEditor.onAction("app.message.dequeue", () => this.handleDequeue());
|
|
53208
|
+
this.defaultEditor.onAction("app.message.copy", () => {
|
|
53209
|
+
this.handleCopyCommand({ preferSelection: true });
|
|
53210
|
+
});
|
|
53158
53211
|
this.defaultEditor.onAction("app.session.new", () => this.handleClearCommand());
|
|
53159
53212
|
this.defaultEditor.onAction("app.session.tree", () => this.showTreeSelector());
|
|
53160
53213
|
this.defaultEditor.onAction("app.session.fork", () => this.showUserMessageSelector());
|
|
@@ -55079,7 +55132,7 @@ var init_interactive_selectors = __esm(() => {
|
|
|
55079
55132
|
};
|
|
55080
55133
|
InteractiveModeBase.prototype.showFastModeSelector = function() {
|
|
55081
55134
|
if (!this.hasCodexFastModeSupportedModels()) {
|
|
55082
|
-
this.showWarning("
|
|
55135
|
+
this.showWarning("Fast mode isn't available for any configured model.");
|
|
55083
55136
|
return;
|
|
55084
55137
|
}
|
|
55085
55138
|
this.showSelector((done) => {
|
|
@@ -55138,6 +55191,7 @@ var init_interactive_selectors = __esm(() => {
|
|
|
55138
55191
|
showHardwareCursor: this.settingsManager.getShowHardwareCursor(),
|
|
55139
55192
|
fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
|
|
55140
55193
|
fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
|
|
55194
|
+
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
55141
55195
|
editorPaddingX: this.settingsManager.getEditorPaddingX(),
|
|
55142
55196
|
outputPad: this.settingsManager.getOutputPad(),
|
|
55143
55197
|
showCacheMissNotices: this.settingsManager.getShowCacheMissNotices(),
|
|
@@ -55255,6 +55309,10 @@ var init_interactive_selectors = __esm(() => {
|
|
|
55255
55309
|
onFullscreenExitOutputChange: (output) => {
|
|
55256
55310
|
this.settingsManager.setFullscreenExitOutput(output);
|
|
55257
55311
|
},
|
|
55312
|
+
onFullscreenCopyOnSelectChange: (enabled) => {
|
|
55313
|
+
this.settingsManager.setFullscreenCopyOnSelect(enabled);
|
|
55314
|
+
this.setFullscreenCopyOnSelect(enabled);
|
|
55315
|
+
},
|
|
55258
55316
|
onEditorPaddingXChange: (padding) => {
|
|
55259
55317
|
this.settingsManager.setEditorPaddingX(padding);
|
|
55260
55318
|
this.defaultEditor.setPaddingX(padding);
|
|
@@ -56241,18 +56299,8 @@ var init_interactive_slash_commands = __esm(() => {
|
|
|
56241
56299
|
activeHeader.setExpanded(this.toolOutputExpanded);
|
|
56242
56300
|
}
|
|
56243
56301
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
56244
|
-
this.
|
|
56302
|
+
this.applyRuntimeSettings();
|
|
56245
56303
|
await this.themeController.applyFromSettings();
|
|
56246
|
-
const editorPaddingX = this.settingsManager.getEditorPaddingX();
|
|
56247
|
-
const autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();
|
|
56248
|
-
this.defaultEditor.setPaddingX(editorPaddingX);
|
|
56249
|
-
this.defaultEditor.setAutocompleteMaxVisible(autocompleteMaxVisible);
|
|
56250
|
-
if (this.editor !== this.defaultEditor) {
|
|
56251
|
-
this.editor.setPaddingX?.(editorPaddingX);
|
|
56252
|
-
this.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);
|
|
56253
|
-
}
|
|
56254
|
-
this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());
|
|
56255
|
-
this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
|
|
56256
56304
|
this.setupAutocompleteProvider();
|
|
56257
56305
|
const runner = this.session.extensionRunner;
|
|
56258
56306
|
this.setupExtensionShortcuts(runner);
|
|
@@ -56445,7 +56493,12 @@ Gist: ${hyperlink3(gistUrl, gistUrl)}`);
|
|
|
56445
56493
|
}
|
|
56446
56494
|
}
|
|
56447
56495
|
};
|
|
56448
|
-
InteractiveModeBase.prototype.handleCopyCommand = async function() {
|
|
56496
|
+
InteractiveModeBase.prototype.handleCopyCommand = async function(options = {}) {
|
|
56497
|
+
if (options.preferSelection && this.getFullscreenCopyOnSelect() === false) {
|
|
56498
|
+
const selectionCopied = await this.copyActiveFullscreenSelection();
|
|
56499
|
+
if (selectionCopied !== undefined)
|
|
56500
|
+
return;
|
|
56501
|
+
}
|
|
56449
56502
|
const text = this.session.getLastAssistantText();
|
|
56450
56503
|
if (!text) {
|
|
56451
56504
|
this.showError("No agent messages to copy yet.");
|
|
@@ -56992,6 +57045,7 @@ var init_rpc_extension_ui = __esm(() => {
|
|
|
56992
57045
|
});
|
|
56993
57046
|
|
|
56994
57047
|
// src/modes/rpc/rpc-session-binding.ts
|
|
57048
|
+
import { setCapabilityOverrides as setCapabilityOverrides6 } from "@earendil-works/pi-tui";
|
|
56995
57049
|
var init_rpc_session_binding = __esm(() => {
|
|
56996
57050
|
init_footer_data_provider();
|
|
56997
57051
|
init_output_guard();
|
|
@@ -57068,7 +57122,7 @@ var init_config_selector = __esm(() => {
|
|
|
57068
57122
|
});
|
|
57069
57123
|
|
|
57070
57124
|
// src/cli/config-selector.ts
|
|
57071
|
-
import { ProcessTerminal as ProcessTerminal6, TuiMainScreen as TuiMainScreen8 } from "@earendil-works/pi-tui";
|
|
57125
|
+
import { ProcessTerminal as ProcessTerminal6, setCapabilityOverrides as setCapabilityOverrides7, TuiMainScreen as TuiMainScreen8 } from "@earendil-works/pi-tui";
|
|
57072
57126
|
var init_config_selector2 = __esm(() => {
|
|
57073
57127
|
init_config_selector();
|
|
57074
57128
|
init_theme();
|
|
@@ -57115,6 +57169,7 @@ var init_package_manager_cli = __esm(() => {
|
|
|
57115
57169
|
});
|
|
57116
57170
|
|
|
57117
57171
|
// src/main.ts
|
|
57172
|
+
import { setCapabilityOverrides as setCapabilityOverrides8 } from "@earendil-works/pi-tui";
|
|
57118
57173
|
import chalk15 from "chalk";
|
|
57119
57174
|
var init_main = __esm(() => {
|
|
57120
57175
|
init_args();
|
|
@@ -57129,6 +57184,7 @@ var init_main = __esm(() => {
|
|
|
57129
57184
|
init_auth_storage();
|
|
57130
57185
|
init_builtin_packages();
|
|
57131
57186
|
init_http_dispatcher();
|
|
57187
|
+
init_mandatory_resource_loader();
|
|
57132
57188
|
init_model_resolver();
|
|
57133
57189
|
init_model_runtime();
|
|
57134
57190
|
init_output_guard();
|
|
@@ -63698,8 +63754,8 @@ class ScopedDurableBackend {
|
|
|
63698
63754
|
async recordAdditiveCheckpointBestEffort(checkpoint) {
|
|
63699
63755
|
return await this.inner.recordAdditiveCheckpointBestEffort(this.remap(checkpoint));
|
|
63700
63756
|
}
|
|
63701
|
-
flush() {
|
|
63702
|
-
return this.inner.flush();
|
|
63757
|
+
flush(workflowId) {
|
|
63758
|
+
return workflowId === undefined ? this.inner.flush() : this.inner.flush(this.scope.rootWorkflowId);
|
|
63703
63759
|
}
|
|
63704
63760
|
getToolOutput(_workflowId, argsHash) {
|
|
63705
63761
|
return this.inner.getToolOutput(this.scope.rootWorkflowId, this.scopeKey(argsHash));
|
|
@@ -67580,17 +67636,7 @@ function resolveStageGroup(stageOptions, workflowGroup) {
|
|
|
67580
67636
|
const trimmed = group.trim();
|
|
67581
67637
|
return trimmed.length > 0 ? trimmed : undefined;
|
|
67582
67638
|
}
|
|
67583
|
-
function stageHasIntercomAccess(
|
|
67584
|
-
if (!stageOptions)
|
|
67585
|
-
return true;
|
|
67586
|
-
if (stageOptions.noTools === "all")
|
|
67587
|
-
return false;
|
|
67588
|
-
const tools = stageOptions.tools;
|
|
67589
|
-
if (Array.isArray(tools) && !tools.includes("intercom"))
|
|
67590
|
-
return false;
|
|
67591
|
-
const excluded = stageOptions.excludedTools;
|
|
67592
|
-
if (Array.isArray(excluded) && excluded.includes("intercom"))
|
|
67593
|
-
return false;
|
|
67639
|
+
function stageHasIntercomAccess(_stageOptions) {
|
|
67594
67640
|
return true;
|
|
67595
67641
|
}
|
|
67596
67642
|
function stageCanUseWorkflowPendingStageRoute(stageOptions, workflowGroup) {
|
|
@@ -68046,11 +68092,11 @@ function wrapUiWithDurable(base, deps) {
|
|
|
68046
68092
|
};
|
|
68047
68093
|
const releasePending = async (identity, token) => {
|
|
68048
68094
|
releaseDurablePrompt(deps.backend, deps.workflowId, identity.hash, token);
|
|
68049
|
-
await deps.backend.flush();
|
|
68095
|
+
await deps.backend.flush(deps.workflowId);
|
|
68050
68096
|
};
|
|
68051
68097
|
const beginPending = (identity) => {
|
|
68052
68098
|
const token = reserveDurablePrompt(deps.backend, deps.workflowId, identity.hash);
|
|
68053
|
-
const write = deps.backend.flush();
|
|
68099
|
+
const write = deps.backend.flush(deps.workflowId);
|
|
68054
68100
|
return { token, write };
|
|
68055
68101
|
};
|
|
68056
68102
|
const waitForPendingWrite = async (identity, pending) => {
|
|
@@ -68061,7 +68107,7 @@ function wrapUiWithDurable(base, deps) {
|
|
|
68061
68107
|
} catch (error) {
|
|
68062
68108
|
releaseDurablePrompt(deps.backend, deps.workflowId, identity.hash, pending.token);
|
|
68063
68109
|
try {
|
|
68064
|
-
await deps.backend.flush();
|
|
68110
|
+
await deps.backend.flush(deps.workflowId);
|
|
68065
68111
|
} catch {}
|
|
68066
68112
|
throw error;
|
|
68067
68113
|
}
|
|
@@ -68409,7 +68455,7 @@ async function admitDurableRootRun(args) {
|
|
|
68409
68455
|
args.backend.setWorkflowStatus(args.runId, "running");
|
|
68410
68456
|
}
|
|
68411
68457
|
if (!args.isChildRun)
|
|
68412
|
-
await args.backend.flush();
|
|
68458
|
+
await args.backend.flush(args.runId);
|
|
68413
68459
|
}
|
|
68414
68460
|
|
|
68415
68461
|
// dist/builtin/workflows/src/shared/returned-run-status.ts
|
|
@@ -68533,7 +68579,7 @@ async function finalizeDurableTerminalStatus(input2) {
|
|
|
68533
68579
|
} : undefined;
|
|
68534
68580
|
input2.durableBackend.setWorkflowStatus(input2.runId, durableStatus, undefined, input2.runSnapshot.resumable, failure2);
|
|
68535
68581
|
}
|
|
68536
|
-
await input2.durableBackend.flush();
|
|
68582
|
+
await input2.durableBackend.flush(input2.runId);
|
|
68537
68583
|
}
|
|
68538
68584
|
function toDurableStatus(status) {
|
|
68539
68585
|
switch (status) {
|
|
@@ -74853,7 +74899,7 @@ async function run(def, inputs, opts = {}) {
|
|
|
74853
74899
|
const result = normalizeWorkflowRunOutput(def.name, rawResult);
|
|
74854
74900
|
assertWorkflowRunOutputs(def.name, result, def.outputs);
|
|
74855
74901
|
assertWorkflowCreatedExecution(runSnapshot);
|
|
74856
|
-
await durableBackend.flush();
|
|
74902
|
+
await durableBackend.flush(runId);
|
|
74857
74903
|
const returned = classifyReturnedRunStatus(result, runSnapshot);
|
|
74858
74904
|
const recorded = activeStore.recordRunEnd(runId, returned.status, result, returned.error, returned.metadata);
|
|
74859
74905
|
appendRunEndWhenRecorded(opts.persistence, recorded, {
|
|
@@ -74869,7 +74915,7 @@ async function run(def, inputs, opts = {}) {
|
|
|
74869
74915
|
if (opts.parentRun === undefined)
|
|
74870
74916
|
recordRunTimingCheckpoint(durableBackend, runSnapshot);
|
|
74871
74917
|
durableBackend.setWorkflowStatus(runId, returned.status, undefined, returned.metadata?.resumable);
|
|
74872
|
-
await durableBackend.flush();
|
|
74918
|
+
await durableBackend.flush(runId);
|
|
74873
74919
|
return reconcileTerminalRunResult(runId, runSnapshot, activeStore, { status: returned.status, result, error: returned.error }, opts.onRunEnd);
|
|
74874
74920
|
} catch (err) {
|
|
74875
74921
|
terminalEvents.selectFailure(err);
|