@earendil-works/pi-coding-agent 0.79.3 → 0.79.5
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 +60 -0
- package/dist/bun/restore-sandbox-env.d.ts +4 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -1
- package/dist/bun/restore-sandbox-env.js +4 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +19 -14
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +14 -3
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +10 -7
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +5 -0
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +8 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +2 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +2 -2
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +2 -2
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +10 -10
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/export-html/vendor/marked.min.js +75 -3
- package/dist/core/http-dispatcher.d.ts +1 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +7 -0
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/model-registry.d.ts +1 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +12 -61
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/package-manager.d.ts +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +31 -17
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/provider-attribution.d.ts.map +1 -1
- package/dist/core/provider-attribution.js +10 -0
- package/dist/core/provider-attribution.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts +7 -8
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +19 -23
- package/dist/core/resolve-config-value.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.d.ts +1 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +4 -0
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +17 -4
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +1 -123
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +4 -0
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +0 -1
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +0 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +0 -5
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +87 -12
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +38 -18
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +12 -8
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +19 -41
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/utils/child-process.d.ts +7 -4
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js +23 -5
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +4 -27
- package/dist/utils/version-check.js.map +1 -1
- package/docs/containerization.md +35 -35
- package/docs/extensions.md +11 -5
- package/docs/index.md +1 -1
- package/docs/models.md +1 -3
- package/docs/providers.md +22 -4
- package/docs/security.md +1 -1
- package/docs/settings.md +12 -0
- 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/question.ts +39 -18
- package/examples/extensions/questionnaire.ts +49 -28
- 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 +30 -17
- package/package.json +6 -4
|
@@ -63,7 +63,7 @@ import { TreeSelectorComponent } from "./components/tree-selector.js";
|
|
|
63
63
|
import { TrustSelectorComponent } from "./components/trust-selector.js";
|
|
64
64
|
import { UserMessageComponent } from "./components/user-message.js";
|
|
65
65
|
import { UserMessageSelectorComponent } from "./components/user-message-selector.js";
|
|
66
|
-
import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, initTheme, onThemeChange, setRegisteredThemes, setTheme, setThemeInstance, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
66
|
+
import { detectTerminalBackgroundTheme, getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, initTheme, onThemeChange, setRegisteredThemes, setTheme, setThemeInstance, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
67
67
|
function isExpandable(obj) {
|
|
68
68
|
return typeof obj === "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded === "function";
|
|
69
69
|
}
|
|
@@ -268,6 +268,22 @@ export class InteractiveMode {
|
|
|
268
268
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
269
269
|
initTheme(this.settingsManager.getTheme(), true);
|
|
270
270
|
}
|
|
271
|
+
async detectThemeIfUnset() {
|
|
272
|
+
if (this.settingsManager.getTheme()) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const detection = await detectTerminalBackgroundTheme({ ui: this.ui, timeoutMs: 100 });
|
|
276
|
+
const result = setTheme(detection.theme, true);
|
|
277
|
+
if (!result.success) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
if (detection.confidence === "high") {
|
|
281
|
+
this.settingsManager.setTheme(detection.theme);
|
|
282
|
+
await this.settingsManager.flush();
|
|
283
|
+
}
|
|
284
|
+
this.updateEditorBorderColor();
|
|
285
|
+
this.ui.requestRender();
|
|
286
|
+
}
|
|
271
287
|
getAutocompleteSourceTag(sourceInfo) {
|
|
272
288
|
if (!sourceInfo) {
|
|
273
289
|
return undefined;
|
|
@@ -435,8 +451,23 @@ export class InteractiveMode {
|
|
|
435
451
|
: "";
|
|
436
452
|
console.log(theme.fg("dim", `Model scope: ${modelList}${cycleHint}`));
|
|
437
453
|
}
|
|
438
|
-
// Add header container as first child
|
|
454
|
+
// Add header container as first child. Populate it after detectThemeIfUnset.
|
|
439
455
|
this.ui.addChild(this.headerContainer);
|
|
456
|
+
this.ui.addChild(this.chatContainer);
|
|
457
|
+
this.ui.addChild(this.pendingMessagesContainer);
|
|
458
|
+
this.ui.addChild(this.statusContainer);
|
|
459
|
+
this.renderWidgets(); // Initialize with default spacer
|
|
460
|
+
this.ui.addChild(this.widgetContainerAbove);
|
|
461
|
+
this.ui.addChild(this.editorContainer);
|
|
462
|
+
this.ui.addChild(this.widgetContainerBelow);
|
|
463
|
+
this.ui.addChild(this.footer);
|
|
464
|
+
this.ui.setFocus(this.editor);
|
|
465
|
+
this.setupKeyHandlers();
|
|
466
|
+
this.setupEditorSubmitHandler();
|
|
467
|
+
// Start the UI before initializing extensions so session_start handlers can use interactive dialogs
|
|
468
|
+
this.ui.start();
|
|
469
|
+
this.isInitialized = true;
|
|
470
|
+
await this.detectThemeIfUnset();
|
|
440
471
|
// Add header with keybindings from config (unless silenced)
|
|
441
472
|
if (this.options.verbose || !this.settingsManager.getQuietStartup()) {
|
|
442
473
|
const logo = theme.bold(theme.fg("accent", APP_NAME)) + theme.fg("dim", ` v${this.version}`);
|
|
@@ -483,20 +514,7 @@ export class InteractiveMode {
|
|
|
483
514
|
this.builtInHeader = new Text("", 0, 0);
|
|
484
515
|
this.headerContainer.addChild(this.builtInHeader);
|
|
485
516
|
}
|
|
486
|
-
this.ui.
|
|
487
|
-
this.ui.addChild(this.pendingMessagesContainer);
|
|
488
|
-
this.ui.addChild(this.statusContainer);
|
|
489
|
-
this.renderWidgets(); // Initialize with default spacer
|
|
490
|
-
this.ui.addChild(this.widgetContainerAbove);
|
|
491
|
-
this.ui.addChild(this.editorContainer);
|
|
492
|
-
this.ui.addChild(this.widgetContainerBelow);
|
|
493
|
-
this.ui.addChild(this.footer);
|
|
494
|
-
this.ui.setFocus(this.editor);
|
|
495
|
-
this.setupKeyHandlers();
|
|
496
|
-
this.setupEditorSubmitHandler();
|
|
497
|
-
// Start the UI before initializing extensions so session_start handlers can use interactive dialogs
|
|
498
|
-
this.ui.start();
|
|
499
|
-
this.isInitialized = true;
|
|
517
|
+
this.ui.requestRender();
|
|
500
518
|
// Initialize extensions first so resources are shown before messages
|
|
501
519
|
await this.rebindCurrentSession();
|
|
502
520
|
// Render initial messages AFTER showing loaded resources
|
|
@@ -2719,7 +2737,9 @@ export class InteractiveMode {
|
|
|
2719
2737
|
if (this.isShuttingDown)
|
|
2720
2738
|
return;
|
|
2721
2739
|
this.isShuttingDown = true;
|
|
2722
|
-
|
|
2740
|
+
// Keep signal handlers registered until terminal cleanup has completed.
|
|
2741
|
+
// `signal-exit` checks the listener list during the same SIGTERM/SIGHUP
|
|
2742
|
+
// dispatch and re-sends the signal if only its own listeners remain.
|
|
2723
2743
|
if (options?.fromSignal) {
|
|
2724
2744
|
// Signal-triggered shutdown (SIGTERM/SIGHUP). Emit extension cleanup
|
|
2725
2745
|
// (session_shutdown) BEFORE touching the terminal. Extension teardown
|
|
@@ -4781,7 +4801,6 @@ export class InteractiveMode {
|
|
|
4781
4801
|
}
|
|
4782
4802
|
}
|
|
4783
4803
|
stop() {
|
|
4784
|
-
this.unregisterSignalHandlers();
|
|
4785
4804
|
if (this.settingsManager.getShowTerminalProgress()) {
|
|
4786
4805
|
this.ui.terminal.setProgress(false);
|
|
4787
4806
|
}
|
|
@@ -4799,6 +4818,7 @@ export class InteractiveMode {
|
|
|
4799
4818
|
this.ui.stop();
|
|
4800
4819
|
this.isInitialized = false;
|
|
4801
4820
|
}
|
|
4821
|
+
this.unregisterSignalHandlers();
|
|
4802
4822
|
}
|
|
4803
4823
|
}
|
|
4804
4824
|
//# sourceMappingURL=interactive-mode.js.map
|