@averyyy/pi-coding-agent 1.3.0-piclient.5 → 1.4.0-piclient.10
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 +61 -1
- package/dist/bundle/chunks/anthropic-messages-3TZAX2CL.js +6 -0
- package/dist/bundle/chunks/azure-openai-responses-5OV6AS44.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +8 -8
- package/dist/bundle/chunks/{chunk-27EJF7XV.js → chunk-3EGEEHMN.js} +1 -1
- package/dist/bundle/chunks/{chunk-VBIW3SGN.js → chunk-3LTMO2WY.js} +1 -1
- package/dist/bundle/chunks/{chunk-PYGXRV27.js → chunk-3V45WARH.js} +1 -1
- package/dist/bundle/chunks/{chunk-S3GGRYIO.js → chunk-5AGIVGSV.js} +1 -1
- package/dist/bundle/chunks/{chunk-F5ZABL6Z.js → chunk-7CBJINYJ.js} +2 -2
- package/dist/bundle/chunks/{chunk-DRQDKNXA.js → chunk-7DDKXS2Q.js} +1 -1
- package/dist/bundle/chunks/{chunk-JBOKZR45.js → chunk-BRYV63PL.js} +2 -2
- package/dist/bundle/chunks/{chunk-H3QXYIF7.js → chunk-CF5GWZHW.js} +1 -1
- package/dist/bundle/chunks/chunk-D3OXAPLU.js +11 -0
- package/dist/bundle/chunks/{chunk-WALKIYXG.js → chunk-GA3MDGH3.js} +1 -1
- package/dist/bundle/chunks/chunk-H2AI7MFJ.js +9 -0
- package/dist/bundle/chunks/{chunk-XDNB4NV2.js → chunk-H2UJDH5M.js} +10 -9
- package/dist/bundle/chunks/chunk-H76KZMOI.js +2 -0
- package/dist/bundle/chunks/chunk-HZG4C6GI.js +2 -0
- package/dist/bundle/chunks/{chunk-WEGEKOLF.js → chunk-J5XSJ6CW.js} +1 -1
- package/dist/bundle/chunks/{chunk-4L3WN2XY.js → chunk-JXWJOIH4.js} +1 -1
- package/dist/bundle/chunks/{chunk-6CYCI3EJ.js → chunk-LVVZS2NO.js} +1 -1
- package/dist/bundle/chunks/{chunk-A5PVA2BG.js → chunk-MKWEYCNF.js} +4 -3
- package/dist/bundle/chunks/{chunk-PT5WCDHM.js → chunk-PG7P2LUM.js} +2 -2
- package/dist/bundle/chunks/chunk-TLSZ4DWU.js +16 -0
- package/dist/bundle/chunks/{chunk-ZBURYEWF.js → chunk-TMTOQ7H7.js} +1 -1
- package/dist/bundle/chunks/{chunk-22CYIUS4.js → chunk-UKVNB6C4.js} +1 -1
- package/dist/bundle/chunks/{chunk-6AK3I2ZG.js → chunk-UZLVOWHH.js} +44 -40
- package/dist/bundle/chunks/chunk-VHUVVKJM.js +2 -0
- package/dist/bundle/chunks/{chunk-32OQRHU5.js → chunk-VYYRESZJ.js} +1 -1
- package/dist/bundle/chunks/chunk-WVXVPMMO.js +2 -0
- package/dist/bundle/chunks/{cli-C7ZYV7NI.js → cli-QUNA6INU.js} +1 -1
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-QIIM6OB4.js +2 -0
- package/dist/bundle/chunks/{easter-egg-3d-JPU5ICBY.js → easter-egg-3d-4L2AVJKX.js} +1 -1
- package/dist/bundle/chunks/{execute-ZWI524ZI.js → execute-UNST3ORJ.js} +9 -3
- package/dist/bundle/chunks/google-antigravity-runtime.js +8 -7
- package/dist/bundle/chunks/google-generative-ai-PNRT4EAN.js +2 -0
- package/dist/bundle/chunks/google-vertex-ZLSXUSEM.js +2 -0
- package/dist/bundle/chunks/{https-proxy-agent-UDEHOBGS.js → https-proxy-agent-LVOO5TPL.js} +1 -1
- package/dist/bundle/chunks/{jiti-loader-C3NU2SDH.js → jiti-loader-GL4HJFAD.js} +1 -1
- package/dist/bundle/chunks/{jiti-static-loader-E6ANQD5T.js → jiti-static-loader-2RCDI6B4.js} +1 -1
- package/dist/bundle/chunks/{lib-TEDK3E5I.js → lib-4AVRLBHM.js} +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-FYN623RH.js → llama-cpp-classify-U4EH6TAM.js} +2 -2
- package/dist/bundle/chunks/{mistral-conversations-IDNVOMLP.js → mistral-conversations-OJFHLO4F.js} +1 -1
- package/dist/bundle/chunks/{multipart-parser-SQ6GDJL7.js → multipart-parser-FMGQ7342.js} +1 -1
- package/dist/bundle/chunks/{node-TWVVAGPO.js → node-AUOGOBCN.js} +1 -1
- package/dist/bundle/chunks/{node-N5BSDOA5.js → node-KCMANYC2.js} +1 -1
- package/dist/bundle/chunks/openai-codex-responses-UIB63WGM.js +10 -0
- package/dist/bundle/chunks/openai-completions-T5JB7LUM.js +7 -0
- package/dist/bundle/chunks/{openai-decisions-CWANEVXX.js → openai-decisions-Q46R33J3.js} +1 -1
- package/dist/bundle/chunks/openai-responses-FGTD6NDJ.js +4 -0
- package/dist/bundle/chunks/openrouter-images-WBAVKHHY.js +2 -0
- package/dist/bundle/chunks/pi-messages-S7RKCD5K.js +8 -0
- package/dist/bundle/chunks/{runtime-RTNZQVM5.js → runtime-SITSZTHV.js} +1 -1
- package/dist/bundle/chunks/{src-UK77SYZE.js → src-QKGKDFSU.js} +1 -1
- package/dist/bundle/chunks/typesafe-system-one-DFEHTLK5.js +2 -0
- package/dist/bundle/chunks/virtual-modules-G5A4RNVO.js +2 -0
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/core/agent-session.d.ts +5 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +42 -13
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/client-identity.d.ts +8 -0
- package/dist/core/client-identity.d.ts.map +1 -0
- package/dist/core/client-identity.js +15 -0
- package/dist/core/client-identity.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +2 -3
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +3 -3
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +35 -30
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +2 -0
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.html +1 -0
- package/dist/core/export-html/template.js +2 -1
- package/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
- package/dist/core/export-html/vendor/marked.min.js +30 -29
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +3 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/virtual-modules.js +3 -0
- package/dist/core/extensions/virtual-modules.js.map +1 -1
- package/dist/core/model-config.d.ts +915 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +48 -24
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver.js +2 -2
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +6 -3
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.js +2 -2
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-server-client.d.ts.map +1 -1
- package/dist/core/pi-server-client.js +4 -1
- package/dist/core/pi-server-client.js.map +1 -1
- package/dist/core/pi-server-observer.d.ts +7 -1
- package/dist/core/pi-server-observer.d.ts.map +1 -1
- package/dist/core/pi-server-observer.js +43 -4
- package/dist/core/pi-server-observer.js.map +1 -1
- package/dist/core/pi-server-subagents.d.ts +26 -0
- package/dist/core/pi-server-subagents.d.ts.map +1 -0
- package/dist/core/pi-server-subagents.js +112 -0
- package/dist/core/pi-server-subagents.js.map +1 -0
- package/dist/core/provider-composer.d.ts +2 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +7 -3
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/resource-loader.d.ts +2 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +3 -0
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +15 -10
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +3 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +99 -24
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/mcp/config.d.ts.map +1 -1
- package/dist/extensions/mcp/config.js +3 -2
- package/dist/extensions/mcp/config.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +11 -15
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +73 -115
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +2 -1
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts.map +1 -1
- package/dist/utils/clipboard-command.js +3 -0
- package/dist/utils/clipboard-command.js.map +1 -1
- package/dist/utils/pi-user-agent.d.ts +1 -0
- package/dist/utils/pi-user-agent.d.ts.map +1 -1
- package/dist/utils/pi-user-agent.js +3 -2
- package/dist/utils/pi-user-agent.js.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +45 -13
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +4 -3
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/codemode.md +2 -2
- package/docs/compaction.md +3 -3
- package/docs/custom-provider.md +53 -1
- package/docs/docs.json +4 -0
- package/docs/environment-variables.md +1 -0
- package/docs/extensions.md +133 -10
- package/docs/models-configuration.md +196 -0
- package/docs/models.md +21 -5
- package/docs/settings.md +1 -1
- package/docs/tui.md +70 -0
- package/docs/windows.md +16 -2
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +7 -6
- package/schemas/models.schema.json +83 -29
- package/dist/bundle/chunks/anthropic-messages-JKZEYO3X.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-CALHHRO4.js +0 -2
- package/dist/bundle/chunks/chunk-2TBKESBE.js +0 -2
- package/dist/bundle/chunks/chunk-3IAHLZM6.js +0 -2
- package/dist/bundle/chunks/chunk-KO7M2ZFM.js +0 -11
- package/dist/bundle/chunks/chunk-NAPMJL5U.js +0 -11
- package/dist/bundle/chunks/chunk-VZZDG22Y.js +0 -9
- package/dist/bundle/chunks/chunk-XIQJS2WK.js +0 -2
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-W3JVUOXV.js +0 -2
- package/dist/bundle/chunks/google-generative-ai-4YEPBKDH.js +0 -2
- package/dist/bundle/chunks/google-vertex-5HD3H47T.js +0 -2
- package/dist/bundle/chunks/openai-codex-responses-TWAB375R.js +0 -10
- package/dist/bundle/chunks/openai-completions-3LCSEI2J.js +0 -7
- package/dist/bundle/chunks/openai-responses-JEQACBMR.js +0 -3
- package/dist/bundle/chunks/openrouter-images-DUPG5DZO.js +0 -2
- package/dist/bundle/chunks/pi-messages-V27DSLVC.js +0 -8
- package/dist/bundle/chunks/typesafe-system-one-JJVDHYHL.js +0 -2
- package/dist/bundle/chunks/virtual-modules-2YGWEC7J.js +0 -2
- package/dist/core/provider-attribution.d.ts +0 -4
- package/dist/core/provider-attribution.d.ts.map +0 -1
- package/dist/core/provider-attribution.js +0 -72
- package/dist/core/provider-attribution.js.map +0 -1
|
@@ -325,9 +325,9 @@ export class InteractiveMode {
|
|
|
325
325
|
bugReportHintShown = false;
|
|
326
326
|
installChangeWarningShown = false;
|
|
327
327
|
// Extension UI state
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
328
|
+
// Extension dialogs shown in the editor slot (select, confirm, input, editor, inline custom).
|
|
329
|
+
// The last entry is visible; see pushExtensionDialog().
|
|
330
|
+
extensionDialogs = [];
|
|
331
331
|
extensionTerminalInputSubscriptions = new Set();
|
|
332
332
|
// Extension widgets (components rendered above/below the editor)
|
|
333
333
|
extensionWidgetsAbove = new Map();
|
|
@@ -1061,13 +1061,12 @@ export class InteractiveMode {
|
|
|
1061
1061
|
// Extension System
|
|
1062
1062
|
// =========================================================================
|
|
1063
1063
|
formatDisplayPath(p) {
|
|
1064
|
-
const home = os.homedir();
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
result = `~${result.slice(home.length)}`;
|
|
1064
|
+
const home = os.homedir().replace(/\\/g, "/").replace(/\/$/, "");
|
|
1065
|
+
const normalizedPath = p.replace(/\\/g, "/");
|
|
1066
|
+
if (normalizedPath === home || normalizedPath.startsWith(`${home}/`)) {
|
|
1067
|
+
return `~${normalizedPath.slice(home.length)}`;
|
|
1069
1068
|
}
|
|
1070
|
-
return
|
|
1069
|
+
return p;
|
|
1071
1070
|
}
|
|
1072
1071
|
formatExtensionDisplayPath(path) {
|
|
1073
1072
|
let result = this.formatDisplayPath(path);
|
|
@@ -1981,14 +1980,12 @@ export class InteractiveMode {
|
|
|
1981
1980
|
this.renderWidgets();
|
|
1982
1981
|
}
|
|
1983
1982
|
resetExtensionUI() {
|
|
1984
|
-
if (this.
|
|
1985
|
-
this.
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
this.
|
|
1989
|
-
|
|
1990
|
-
if (this.extensionEditor) {
|
|
1991
|
-
this.hideExtensionEditor();
|
|
1983
|
+
if (this.extensionDialogs.length > 0) {
|
|
1984
|
+
for (const dialog of this.extensionDialogs) {
|
|
1985
|
+
dialog.component.dispose?.();
|
|
1986
|
+
}
|
|
1987
|
+
this.extensionDialogs = [];
|
|
1988
|
+
this.showTopExtensionDialog();
|
|
1992
1989
|
}
|
|
1993
1990
|
this.ui.hideOverlay();
|
|
1994
1991
|
this.clearExtensionTerminalInputListeners();
|
|
@@ -2205,6 +2202,35 @@ export class InteractiveMode {
|
|
|
2205
2202
|
setToolsExpanded: (expanded) => this.setToolsExpanded(expanded),
|
|
2206
2203
|
};
|
|
2207
2204
|
}
|
|
2205
|
+
/**
|
|
2206
|
+
* Show an extension dialog in the editor slot.
|
|
2207
|
+
* Dialogs form a stack: a new dialog hides the visible one, and closing the visible dialog shows
|
|
2208
|
+
* the previous one again. Every dialog stays answerable, so no dialog promise is left pending,
|
|
2209
|
+
* and dialogs opened from inside another dialog (for example a confirm from a custom component) work.
|
|
2210
|
+
*/
|
|
2211
|
+
pushExtensionDialog(component, blocked) {
|
|
2212
|
+
this.disposeActiveSelector();
|
|
2213
|
+
this.extensionDialogs.push({ component, blocked });
|
|
2214
|
+
this.showTopExtensionDialog();
|
|
2215
|
+
}
|
|
2216
|
+
/** Remove an extension dialog. If it was visible, show the previous dialog or the editor. */
|
|
2217
|
+
removeExtensionDialog(component) {
|
|
2218
|
+
const index = this.extensionDialogs.findIndex((dialog) => dialog.component === component);
|
|
2219
|
+
if (index === -1)
|
|
2220
|
+
return;
|
|
2221
|
+
this.extensionDialogs.splice(index, 1);
|
|
2222
|
+
if (index === this.extensionDialogs.length)
|
|
2223
|
+
this.showTopExtensionDialog();
|
|
2224
|
+
}
|
|
2225
|
+
showTopExtensionDialog() {
|
|
2226
|
+
const top = this.extensionDialogs.at(-1);
|
|
2227
|
+
const component = top?.component ?? this.editor;
|
|
2228
|
+
this.editorContainer.clear();
|
|
2229
|
+
this.editorContainer.addChild(component);
|
|
2230
|
+
this.ui.setFocus(component);
|
|
2231
|
+
this.programStatus.setBlocked("extension-dialog", top?.blocked);
|
|
2232
|
+
this.ui.requestRender();
|
|
2233
|
+
}
|
|
2208
2234
|
/**
|
|
2209
2235
|
* Show a selector for extensions.
|
|
2210
2236
|
*/
|
|
@@ -2214,41 +2240,18 @@ export class InteractiveMode {
|
|
|
2214
2240
|
resolve(undefined);
|
|
2215
2241
|
return;
|
|
2216
2242
|
}
|
|
2217
|
-
const
|
|
2218
|
-
this.hideExtensionSelector();
|
|
2219
|
-
resolve(undefined);
|
|
2220
|
-
};
|
|
2221
|
-
opts?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
2222
|
-
this.extensionSelector = new ExtensionSelectorComponent(title, options, (option) => {
|
|
2243
|
+
const finish = (option) => {
|
|
2223
2244
|
opts?.signal?.removeEventListener("abort", onAbort);
|
|
2224
|
-
|
|
2245
|
+
selector.dispose();
|
|
2246
|
+
this.removeExtensionDialog(selector);
|
|
2225
2247
|
resolve(option);
|
|
2226
|
-
}
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
this.disposeActiveSelector();
|
|
2232
|
-
this.editorContainer.clear();
|
|
2233
|
-
this.editorContainer.addChild(this.extensionSelector);
|
|
2234
|
-
this.ui.setFocus(this.extensionSelector);
|
|
2235
|
-
// Extension dialogs share the editor slot: opening one replaces the status of a displaced one.
|
|
2236
|
-
this.programStatus.setBlocked("extension-dialog", blocked);
|
|
2237
|
-
this.ui.requestRender();
|
|
2248
|
+
};
|
|
2249
|
+
const onAbort = () => finish(undefined);
|
|
2250
|
+
opts?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
2251
|
+
const selector = new ExtensionSelectorComponent(title, options, (option) => finish(option), () => finish(undefined), { tui: this.ui, timeout: opts?.timeout, onToggleToolsExpanded: () => this.toggleToolOutputExpansion() });
|
|
2252
|
+
this.pushExtensionDialog(selector, blocked);
|
|
2238
2253
|
});
|
|
2239
2254
|
}
|
|
2240
|
-
/**
|
|
2241
|
-
* Hide the extension selector.
|
|
2242
|
-
*/
|
|
2243
|
-
hideExtensionSelector() {
|
|
2244
|
-
this.extensionSelector?.dispose();
|
|
2245
|
-
this.editorContainer.clear();
|
|
2246
|
-
this.editorContainer.addChild(this.editor);
|
|
2247
|
-
this.extensionSelector = undefined;
|
|
2248
|
-
this.programStatus.setBlocked("extension-dialog", undefined);
|
|
2249
|
-
this.ui.setFocus(this.editor);
|
|
2250
|
-
this.ui.requestRender();
|
|
2251
|
-
}
|
|
2252
2255
|
/**
|
|
2253
2256
|
* Show a confirmation dialog for extensions.
|
|
2254
2257
|
*/
|
|
@@ -2272,71 +2275,31 @@ export class InteractiveMode {
|
|
|
2272
2275
|
resolve(undefined);
|
|
2273
2276
|
return;
|
|
2274
2277
|
}
|
|
2275
|
-
const
|
|
2276
|
-
this.hideExtensionInput();
|
|
2277
|
-
resolve(undefined);
|
|
2278
|
-
};
|
|
2279
|
-
opts?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
2280
|
-
this.extensionInput = new ExtensionInputComponent(title, placeholder, (value) => {
|
|
2278
|
+
const finish = (value) => {
|
|
2281
2279
|
opts?.signal?.removeEventListener("abort", onAbort);
|
|
2282
|
-
|
|
2280
|
+
input.dispose();
|
|
2281
|
+
this.removeExtensionDialog(input);
|
|
2283
2282
|
resolve(value);
|
|
2284
|
-
}
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
this.disposeActiveSelector();
|
|
2290
|
-
this.editorContainer.clear();
|
|
2291
|
-
this.editorContainer.addChild(this.extensionInput);
|
|
2292
|
-
this.ui.setFocus(this.extensionInput);
|
|
2293
|
-
this.programStatus.setBlocked("extension-dialog", { kind: "question", message: title });
|
|
2294
|
-
this.ui.requestRender();
|
|
2283
|
+
};
|
|
2284
|
+
const onAbort = () => finish(undefined);
|
|
2285
|
+
opts?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
2286
|
+
const input = new ExtensionInputComponent(title, placeholder, (value) => finish(value), () => finish(undefined), { tui: this.ui, timeout: opts?.timeout });
|
|
2287
|
+
this.pushExtensionDialog(input, { kind: "question", message: title });
|
|
2295
2288
|
});
|
|
2296
2289
|
}
|
|
2297
|
-
/**
|
|
2298
|
-
* Hide the extension input.
|
|
2299
|
-
*/
|
|
2300
|
-
hideExtensionInput() {
|
|
2301
|
-
this.extensionInput?.dispose();
|
|
2302
|
-
this.editorContainer.clear();
|
|
2303
|
-
this.editorContainer.addChild(this.editor);
|
|
2304
|
-
this.extensionInput = undefined;
|
|
2305
|
-
this.programStatus.setBlocked("extension-dialog", undefined);
|
|
2306
|
-
this.ui.setFocus(this.editor);
|
|
2307
|
-
this.ui.requestRender();
|
|
2308
|
-
}
|
|
2309
2290
|
/**
|
|
2310
2291
|
* Show a multi-line editor for extensions (with Ctrl+G support).
|
|
2311
2292
|
*/
|
|
2312
2293
|
showExtensionEditor(title, prefill) {
|
|
2313
2294
|
return new Promise((resolve) => {
|
|
2314
|
-
|
|
2315
|
-
this.
|
|
2295
|
+
const finish = (value) => {
|
|
2296
|
+
this.removeExtensionDialog(editor);
|
|
2316
2297
|
resolve(value);
|
|
2317
|
-
}
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
}, undefined, this.settingsManager.getExternalEditorCommand());
|
|
2321
|
-
this.disposeActiveSelector();
|
|
2322
|
-
this.editorContainer.clear();
|
|
2323
|
-
this.editorContainer.addChild(this.extensionEditor);
|
|
2324
|
-
this.ui.setFocus(this.extensionEditor);
|
|
2325
|
-
this.programStatus.setBlocked("extension-dialog", { kind: "question", message: title });
|
|
2326
|
-
this.ui.requestRender();
|
|
2298
|
+
};
|
|
2299
|
+
const editor = new ExtensionEditorComponent(this.ui, this.keybindings, title, prefill, (value) => finish(value), () => finish(undefined), undefined, this.settingsManager.getExternalEditorCommand());
|
|
2300
|
+
this.pushExtensionDialog(editor, { kind: "question", message: title });
|
|
2327
2301
|
});
|
|
2328
2302
|
}
|
|
2329
|
-
/**
|
|
2330
|
-
* Hide the extension editor.
|
|
2331
|
-
*/
|
|
2332
|
-
hideExtensionEditor() {
|
|
2333
|
-
this.editorContainer.clear();
|
|
2334
|
-
this.editorContainer.addChild(this.editor);
|
|
2335
|
-
this.extensionEditor = undefined;
|
|
2336
|
-
this.programStatus.setBlocked("extension-dialog", undefined);
|
|
2337
|
-
this.ui.setFocus(this.editor);
|
|
2338
|
-
this.ui.requestRender();
|
|
2339
|
-
}
|
|
2340
2303
|
/**
|
|
2341
2304
|
* Set a custom editor component from an extension.
|
|
2342
2305
|
* Pass undefined to restore the default editor.
|
|
@@ -2426,17 +2389,16 @@ export class InteractiveMode {
|
|
|
2426
2389
|
async showExtensionCustom(factory, options) {
|
|
2427
2390
|
const savedText = this.editor.getText();
|
|
2428
2391
|
const isOverlay = options?.overlay ?? false;
|
|
2429
|
-
const restoreEditor = () => {
|
|
2430
|
-
this.editorContainer.clear();
|
|
2431
|
-
this.editorContainer.addChild(this.editor);
|
|
2432
|
-
this.editor.setText(savedText);
|
|
2433
|
-
this.ui.setFocus(this.editor);
|
|
2434
|
-
this.ui.requestRender();
|
|
2435
|
-
};
|
|
2436
2392
|
return new Promise((resolve, reject) => {
|
|
2437
2393
|
let component;
|
|
2438
2394
|
let overlayHandle;
|
|
2439
2395
|
let closed = false;
|
|
2396
|
+
const restoreEditor = () => {
|
|
2397
|
+
if (component)
|
|
2398
|
+
this.removeExtensionDialog(component);
|
|
2399
|
+
this.editor.setText(savedText);
|
|
2400
|
+
this.ui.requestRender();
|
|
2401
|
+
};
|
|
2440
2402
|
const close = (result) => {
|
|
2441
2403
|
if (closed)
|
|
2442
2404
|
return;
|
|
@@ -2470,19 +2432,15 @@ export class InteractiveMode {
|
|
|
2470
2432
|
return opts;
|
|
2471
2433
|
}
|
|
2472
2434
|
// Fallback: use component's width property if available
|
|
2473
|
-
const w =
|
|
2435
|
+
const w = c.width;
|
|
2474
2436
|
return w ? { width: w } : undefined;
|
|
2475
2437
|
};
|
|
2476
|
-
overlayHandle = this.ui.showOverlay(
|
|
2438
|
+
overlayHandle = this.ui.showOverlay(c, resolveOptions());
|
|
2477
2439
|
// Expose handle to caller for visibility control
|
|
2478
2440
|
options?.onHandle?.(overlayHandle);
|
|
2479
2441
|
}
|
|
2480
2442
|
else {
|
|
2481
|
-
this.
|
|
2482
|
-
this.editorContainer.clear();
|
|
2483
|
-
this.editorContainer.addChild(component);
|
|
2484
|
-
this.ui.setFocus(component);
|
|
2485
|
-
this.ui.requestRender();
|
|
2443
|
+
this.pushExtensionDialog(c);
|
|
2486
2444
|
}
|
|
2487
2445
|
})
|
|
2488
2446
|
.catch((err) => {
|