@hyperspaceng/neural-coding-agent 0.63.0 → 0.63.2
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 +71 -0
- package/README.md +2 -2
- package/dist/core/agent-session.d.ts +9 -6
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +98 -54
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +3 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +5 -2
- 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 +3 -3
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +27 -26
- 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 +5 -4
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/extensions/types.d.ts +7 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-registry.d.ts +18 -2
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +83 -69
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +4 -4
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +88 -24
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts +6 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +37 -5
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +13 -22
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager.d.ts +2 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +3 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/timings.d.ts +1 -0
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +6 -0
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +23 -1
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +150 -57
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts +18 -6
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +108 -59
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
- package/dist/core/tools/file-mutation-queue.js +4 -4
- package/dist/core/tools/file-mutation-queue.js.map +1 -1
- package/dist/core/tools/index.d.ts +12 -4
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +28 -10
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +0 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +18 -5
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +0 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +2 -7
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +0 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +28 -65
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/print-mode.d.ts +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +83 -71
- package/dist/modes/print-mode.js.map +1 -1
- package/docs/development.md +3 -1
- package/docs/extensions.md +13 -2
- package/docs/models.md +6 -0
- package/docs/rpc.md +11 -2
- package/docs/settings.md +12 -0
- package/docs/skills.md +3 -2
- package/examples/extensions/custom-compaction.ts +17 -4
- 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/custom-provider-qwen-cli/package.json +1 -1
- package/examples/extensions/handoff.ts +5 -2
- package/examples/extensions/qna.ts +5 -2
- package/examples/extensions/summarize.ts +15 -4
- package/examples/extensions/trigger-compact.ts +11 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +5 -4
|
@@ -312,7 +312,8 @@ export class InteractiveMode {
|
|
|
312
312
|
hint("app.clipboard.pasteImage", "to paste image"),
|
|
313
313
|
rawKeyHint("drop files", "to attach"),
|
|
314
314
|
].join("\n");
|
|
315
|
-
|
|
315
|
+
const onboarding = theme.fg("dim", `Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.`);
|
|
316
|
+
this.builtInHeader = new Text(`${logo}\n${instructions}\n\n${onboarding}`, 1, 0);
|
|
316
317
|
// Setup UI layout
|
|
317
318
|
this.headerContainer.addChild(new Spacer(1));
|
|
318
319
|
this.headerContainer.addChild(this.builtInHeader);
|
|
@@ -999,10 +1000,8 @@ export class InteractiveMode {
|
|
|
999
1000
|
compact: (options) => {
|
|
1000
1001
|
void (async () => {
|
|
1001
1002
|
try {
|
|
1002
|
-
const result = await this.
|
|
1003
|
-
|
|
1004
|
-
options?.onComplete?.(result);
|
|
1005
|
-
}
|
|
1003
|
+
const result = await this.session.compact(options?.customInstructions);
|
|
1004
|
+
options?.onComplete?.(result);
|
|
1006
1005
|
}
|
|
1007
1006
|
catch (error) {
|
|
1008
1007
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
@@ -1965,54 +1964,54 @@ export class InteractiveMode {
|
|
|
1965
1964
|
await this.checkShutdownRequested();
|
|
1966
1965
|
this.ui.requestRender();
|
|
1967
1966
|
break;
|
|
1968
|
-
case "
|
|
1967
|
+
case "compaction_start": {
|
|
1969
1968
|
// Keep editor active; submissions are queued during compaction.
|
|
1970
|
-
// Set up escape to abort auto-compaction
|
|
1971
1969
|
this.autoCompactionEscapeHandler = this.defaultEditor.onEscape;
|
|
1972
1970
|
this.defaultEditor.onEscape = () => {
|
|
1973
1971
|
this.session.abortCompaction();
|
|
1974
1972
|
};
|
|
1975
|
-
// Show compacting indicator with reason
|
|
1976
1973
|
this.statusContainer.clear();
|
|
1977
|
-
const
|
|
1978
|
-
|
|
1974
|
+
const cancelHint = `(${keyText("app.interrupt")} to cancel)`;
|
|
1975
|
+
const label = event.reason === "manual"
|
|
1976
|
+
? `Compacting context... ${cancelHint}`
|
|
1977
|
+
: `${event.reason === "overflow" ? "Context overflow detected, " : ""}Auto-compacting... ${cancelHint}`;
|
|
1978
|
+
this.autoCompactionLoader = new Loader(this.ui, (spinner) => theme.fg("accent", spinner), (text) => theme.fg("muted", text), label);
|
|
1979
1979
|
this.statusContainer.addChild(this.autoCompactionLoader);
|
|
1980
1980
|
this.ui.requestRender();
|
|
1981
1981
|
break;
|
|
1982
1982
|
}
|
|
1983
|
-
case "
|
|
1984
|
-
// Restore escape handler
|
|
1983
|
+
case "compaction_end": {
|
|
1985
1984
|
if (this.autoCompactionEscapeHandler) {
|
|
1986
1985
|
this.defaultEditor.onEscape = this.autoCompactionEscapeHandler;
|
|
1987
1986
|
this.autoCompactionEscapeHandler = undefined;
|
|
1988
1987
|
}
|
|
1989
|
-
// Stop loader
|
|
1990
1988
|
if (this.autoCompactionLoader) {
|
|
1991
1989
|
this.autoCompactionLoader.stop();
|
|
1992
1990
|
this.autoCompactionLoader = undefined;
|
|
1993
1991
|
this.statusContainer.clear();
|
|
1994
1992
|
}
|
|
1995
|
-
// Handle result
|
|
1996
1993
|
if (event.aborted) {
|
|
1997
|
-
|
|
1994
|
+
if (event.reason === "manual") {
|
|
1995
|
+
this.showError("Compaction cancelled");
|
|
1996
|
+
}
|
|
1997
|
+
else {
|
|
1998
|
+
this.showStatus("Auto-compaction cancelled");
|
|
1999
|
+
}
|
|
1998
2000
|
}
|
|
1999
2001
|
else if (event.result) {
|
|
2000
|
-
// Rebuild chat to show compacted state
|
|
2001
2002
|
this.chatContainer.clear();
|
|
2002
2003
|
this.rebuildChatFromMessages();
|
|
2003
|
-
|
|
2004
|
-
this.addMessageToChat({
|
|
2005
|
-
role: "compactionSummary",
|
|
2006
|
-
tokensBefore: event.result.tokensBefore,
|
|
2007
|
-
summary: event.result.summary,
|
|
2008
|
-
timestamp: Date.now(),
|
|
2009
|
-
});
|
|
2004
|
+
this.addMessageToChat(createCompactionSummaryMessage(event.result.summary, event.result.tokensBefore, new Date().toISOString()));
|
|
2010
2005
|
this.footer.invalidate();
|
|
2011
2006
|
}
|
|
2012
2007
|
else if (event.errorMessage) {
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2008
|
+
if (event.reason === "manual") {
|
|
2009
|
+
this.showError(event.errorMessage);
|
|
2010
|
+
}
|
|
2011
|
+
else {
|
|
2012
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
2013
|
+
this.chatContainer.addChild(new Text(theme.fg("error", event.errorMessage), 1, 0));
|
|
2014
|
+
}
|
|
2016
2015
|
}
|
|
2017
2016
|
void this.flushCompactionQueue({ willRetry: event.willRetry });
|
|
2018
2017
|
this.ui.requestRender();
|
|
@@ -3852,53 +3851,17 @@ export class InteractiveMode {
|
|
|
3852
3851
|
this.showWarning("Nothing to compact (no messages yet)");
|
|
3853
3852
|
return;
|
|
3854
3853
|
}
|
|
3855
|
-
await this.executeCompaction(customInstructions, false);
|
|
3856
|
-
}
|
|
3857
|
-
async executeCompaction(customInstructions, isAuto = false) {
|
|
3858
|
-
// Stop loading animation
|
|
3859
3854
|
if (this.loadingAnimation) {
|
|
3860
3855
|
this.loadingAnimation.stop();
|
|
3861
3856
|
this.loadingAnimation = undefined;
|
|
3862
3857
|
}
|
|
3863
3858
|
this.statusContainer.clear();
|
|
3864
|
-
// Set up escape handler during compaction
|
|
3865
|
-
const originalOnEscape = this.defaultEditor.onEscape;
|
|
3866
|
-
this.defaultEditor.onEscape = () => {
|
|
3867
|
-
this.session.abortCompaction();
|
|
3868
|
-
};
|
|
3869
|
-
// Show compacting status
|
|
3870
|
-
this.chatContainer.addChild(new Spacer(1));
|
|
3871
|
-
const cancelHint = `(${keyText("app.interrupt")} to cancel)`;
|
|
3872
|
-
const label = isAuto ? `Auto-compacting context... ${cancelHint}` : `Compacting context... ${cancelHint}`;
|
|
3873
|
-
const compactingLoader = new Loader(this.ui, (spinner) => theme.fg("accent", spinner), (text) => theme.fg("muted", text), label);
|
|
3874
|
-
this.statusContainer.addChild(compactingLoader);
|
|
3875
|
-
this.ui.requestRender();
|
|
3876
|
-
let result;
|
|
3877
3859
|
try {
|
|
3878
|
-
|
|
3879
|
-
// Rebuild UI
|
|
3880
|
-
this.rebuildChatFromMessages();
|
|
3881
|
-
// Add compaction component at bottom so user sees it without scrolling
|
|
3882
|
-
const msg = createCompactionSummaryMessage(result.summary, result.tokensBefore, new Date().toISOString());
|
|
3883
|
-
this.addMessageToChat(msg);
|
|
3884
|
-
this.footer.invalidate();
|
|
3885
|
-
}
|
|
3886
|
-
catch (error) {
|
|
3887
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
3888
|
-
if (message === "Compaction cancelled" || (error instanceof Error && error.name === "AbortError")) {
|
|
3889
|
-
this.showError("Compaction cancelled");
|
|
3890
|
-
}
|
|
3891
|
-
else {
|
|
3892
|
-
this.showError(`Compaction failed: ${message}`);
|
|
3893
|
-
}
|
|
3860
|
+
await this.session.compact(customInstructions);
|
|
3894
3861
|
}
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
this.statusContainer.clear();
|
|
3898
|
-
this.defaultEditor.onEscape = originalOnEscape;
|
|
3862
|
+
catch {
|
|
3863
|
+
// Ignore, will be emitted as an event
|
|
3899
3864
|
}
|
|
3900
|
-
void this.flushCompactionQueue({ willRetry: false });
|
|
3901
|
-
return result;
|
|
3902
3865
|
}
|
|
3903
3866
|
stop() {
|
|
3904
3867
|
if (this.loadingAnimation) {
|