@earendil-works/pi-coding-agent 0.79.9 → 0.79.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 +22 -0
- package/README.md +2 -1
- package/dist/config.d.ts +6 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +21 -13
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +3 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +10 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/types.d.ts +8 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +19 -11
- package/dist/core/tools/find.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +30 -24
- 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 +29 -16
- package/dist/package-manager-cli.js.map +1 -1
- package/docs/compaction.md +3 -1
- package/docs/extensions.md +6 -1
- package/docs/tui.md +3 -3
- package/docs/usage.md +3 -1
- 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/plan-mode/README.md +3 -2
- package/examples/extensions/plan-mode/index.ts +87 -37
- 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/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -240,7 +240,7 @@ export class InteractiveMode {
|
|
|
240
240
|
this.resetExtensionUI();
|
|
241
241
|
});
|
|
242
242
|
this.runtimeHost.setRebindSession(async () => {
|
|
243
|
-
await this.rebindCurrentSession();
|
|
243
|
+
await this.rebindCurrentSession({ renderBeforeBind: true });
|
|
244
244
|
});
|
|
245
245
|
this.version = VERSION;
|
|
246
246
|
this.ui = new TUI(new ProcessTerminal(), this.settingsManager.getShowHardwareCursor());
|
|
@@ -1157,12 +1157,7 @@ export class InteractiveMode {
|
|
|
1157
1157
|
}
|
|
1158
1158
|
this.statusContainer.clear();
|
|
1159
1159
|
try {
|
|
1160
|
-
|
|
1161
|
-
if (!result.cancelled) {
|
|
1162
|
-
this.renderCurrentSessionState();
|
|
1163
|
-
this.ui.requestRender();
|
|
1164
|
-
}
|
|
1165
|
-
return result;
|
|
1160
|
+
return await this.runtimeHost.newSession(options);
|
|
1166
1161
|
}
|
|
1167
1162
|
catch (error) {
|
|
1168
1163
|
return this.handleFatalRuntimeError("Failed to create session", error);
|
|
@@ -1172,7 +1167,6 @@ export class InteractiveMode {
|
|
|
1172
1167
|
try {
|
|
1173
1168
|
const result = await this.runtimeHost.fork(entryId, options);
|
|
1174
1169
|
if (!result.cancelled) {
|
|
1175
|
-
this.renderCurrentSessionState();
|
|
1176
1170
|
this.editor.setText(result.selectedText ?? "");
|
|
1177
1171
|
this.showStatus("Forked to new session");
|
|
1178
1172
|
}
|
|
@@ -1242,12 +1236,19 @@ export class InteractiveMode {
|
|
|
1242
1236
|
this.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);
|
|
1243
1237
|
}
|
|
1244
1238
|
}
|
|
1245
|
-
async rebindCurrentSession() {
|
|
1239
|
+
async rebindCurrentSession(options = {}) {
|
|
1246
1240
|
this.unsubscribe?.();
|
|
1247
1241
|
this.unsubscribe = undefined;
|
|
1248
1242
|
this.applyRuntimeSettings();
|
|
1249
|
-
|
|
1250
|
-
|
|
1243
|
+
if (options.renderBeforeBind) {
|
|
1244
|
+
this.renderCurrentSessionState();
|
|
1245
|
+
this.subscribeToAgent();
|
|
1246
|
+
await this.bindCurrentSessionExtensions();
|
|
1247
|
+
}
|
|
1248
|
+
else {
|
|
1249
|
+
await this.bindCurrentSessionExtensions();
|
|
1250
|
+
this.subscribeToAgent();
|
|
1251
|
+
}
|
|
1251
1252
|
await this.updateAvailableProviderCount();
|
|
1252
1253
|
this.updateEditorBorderColor();
|
|
1253
1254
|
this.updateTerminalTitle();
|
|
@@ -3056,7 +3057,7 @@ export class InteractiveMode {
|
|
|
3056
3057
|
const updateInstruction = theme.fg("muted", `New version ${release.version} is available. Run `) + action;
|
|
3057
3058
|
const changelogUrl = "https://pi.dev/changelog";
|
|
3058
3059
|
const changelogLink = getCapabilities().hyperlinks
|
|
3059
|
-
? hyperlink(theme.fg("accent",
|
|
3060
|
+
? hyperlink(theme.fg("accent", changelogUrl), changelogUrl)
|
|
3060
3061
|
: theme.fg("accent", changelogUrl);
|
|
3061
3062
|
const changelogLine = theme.fg("muted", "Changelog: ") + changelogLink;
|
|
3062
3063
|
const note = release.note?.trim();
|
|
@@ -3641,7 +3642,6 @@ export class InteractiveMode {
|
|
|
3641
3642
|
this.ui.requestRender();
|
|
3642
3643
|
return;
|
|
3643
3644
|
}
|
|
3644
|
-
this.renderCurrentSessionState();
|
|
3645
3645
|
this.editor.setText(result.selectedText ?? "");
|
|
3646
3646
|
done();
|
|
3647
3647
|
this.showStatus("Forked to new session");
|
|
@@ -3669,7 +3669,6 @@ export class InteractiveMode {
|
|
|
3669
3669
|
this.ui.requestRender();
|
|
3670
3670
|
return;
|
|
3671
3671
|
}
|
|
3672
|
-
this.renderCurrentSessionState();
|
|
3673
3672
|
this.editor.setText("");
|
|
3674
3673
|
this.showStatus("Cloned to new session");
|
|
3675
3674
|
}
|
|
@@ -3819,7 +3818,6 @@ export class InteractiveMode {
|
|
|
3819
3818
|
if (result.cancelled) {
|
|
3820
3819
|
return result;
|
|
3821
3820
|
}
|
|
3822
|
-
this.renderCurrentSessionState();
|
|
3823
3821
|
this.showStatus("Resumed session");
|
|
3824
3822
|
return result;
|
|
3825
3823
|
}
|
|
@@ -3838,7 +3836,6 @@ export class InteractiveMode {
|
|
|
3838
3836
|
if (result.cancelled) {
|
|
3839
3837
|
return result;
|
|
3840
3838
|
}
|
|
3841
|
-
this.renderCurrentSessionState();
|
|
3842
3839
|
this.showStatus("Resumed session in current cwd");
|
|
3843
3840
|
return result;
|
|
3844
3841
|
}
|
|
@@ -4198,8 +4195,19 @@ export class InteractiveMode {
|
|
|
4198
4195
|
this.ui.setFocus(editor);
|
|
4199
4196
|
this.ui.requestRender();
|
|
4200
4197
|
};
|
|
4198
|
+
let chatRestoredBeforeSessionStart = false;
|
|
4199
|
+
let reloadBoxDismissed = false;
|
|
4200
|
+
const restoreChatBeforeSessionStart = () => {
|
|
4201
|
+
if (chatRestoredBeforeSessionStart) {
|
|
4202
|
+
return;
|
|
4203
|
+
}
|
|
4204
|
+
this.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();
|
|
4205
|
+
this.rebuildChatFromMessages();
|
|
4206
|
+
chatRestoredBeforeSessionStart = true;
|
|
4207
|
+
};
|
|
4201
4208
|
try {
|
|
4202
|
-
await this.session.reload();
|
|
4209
|
+
await this.session.reload({ beforeSessionStart: restoreChatBeforeSessionStart });
|
|
4210
|
+
restoreChatBeforeSessionStart();
|
|
4203
4211
|
configureHttpDispatcher(this.settingsManager.getHttpIdleTimeoutMs());
|
|
4204
4212
|
this.keybindings.reload();
|
|
4205
4213
|
const activeHeader = this.customHeader ?? this.builtInHeader;
|
|
@@ -4207,7 +4215,6 @@ export class InteractiveMode {
|
|
|
4207
4215
|
activeHeader.setExpanded(this.toolOutputExpanded);
|
|
4208
4216
|
}
|
|
4209
4217
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
4210
|
-
this.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();
|
|
4211
4218
|
await this.themeController.applyFromSettings();
|
|
4212
4219
|
const editorPaddingX = this.settingsManager.getEditorPaddingX();
|
|
4213
4220
|
const autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();
|
|
@@ -4222,8 +4229,6 @@ export class InteractiveMode {
|
|
|
4222
4229
|
this.setupAutocompleteProvider();
|
|
4223
4230
|
const runner = this.session.extensionRunner;
|
|
4224
4231
|
this.setupExtensionShortcuts(runner);
|
|
4225
|
-
this.rebuildChatFromMessages();
|
|
4226
|
-
dismissReloadBox(this.editor);
|
|
4227
4232
|
this.showLoadedResources({
|
|
4228
4233
|
force: false,
|
|
4229
4234
|
showDiagnosticsWhenQuiet: true,
|
|
@@ -4236,9 +4241,13 @@ export class InteractiveMode {
|
|
|
4236
4241
|
this.showStatus(savedImplicitProjectTrust
|
|
4237
4242
|
? "Reloaded keybindings, extensions, skills, prompts, themes; saved project trust"
|
|
4238
4243
|
: "Reloaded keybindings, extensions, skills, prompts, themes");
|
|
4244
|
+
dismissReloadBox(this.editor);
|
|
4245
|
+
reloadBoxDismissed = true;
|
|
4239
4246
|
}
|
|
4240
4247
|
catch (error) {
|
|
4241
|
-
|
|
4248
|
+
if (!reloadBoxDismissed) {
|
|
4249
|
+
dismissReloadBox(previousEditor);
|
|
4250
|
+
}
|
|
4242
4251
|
this.showError(`Reload failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
4243
4252
|
}
|
|
4244
4253
|
}
|
|
@@ -4305,7 +4314,6 @@ export class InteractiveMode {
|
|
|
4305
4314
|
this.showStatus("Import cancelled");
|
|
4306
4315
|
return;
|
|
4307
4316
|
}
|
|
4308
|
-
this.renderCurrentSessionState();
|
|
4309
4317
|
this.showStatus(`Session imported from: ${inputPath}`);
|
|
4310
4318
|
}
|
|
4311
4319
|
catch (error) {
|
|
@@ -4320,7 +4328,6 @@ export class InteractiveMode {
|
|
|
4320
4328
|
this.showStatus("Import cancelled");
|
|
4321
4329
|
return;
|
|
4322
4330
|
}
|
|
4323
|
-
this.renderCurrentSessionState();
|
|
4324
4331
|
this.showStatus(`Session imported from: ${inputPath}`);
|
|
4325
4332
|
return;
|
|
4326
4333
|
}
|
|
@@ -4633,7 +4640,6 @@ export class InteractiveMode {
|
|
|
4633
4640
|
if (result.cancelled) {
|
|
4634
4641
|
return;
|
|
4635
4642
|
}
|
|
4636
|
-
this.renderCurrentSessionState();
|
|
4637
4643
|
this.chatContainer.addChild(new Spacer(1));
|
|
4638
4644
|
this.chatContainer.addChild(new Text(`${theme.fg("accent", "✓ New session started")}`, 1, 1));
|
|
4639
4645
|
this.ui.requestRender();
|