@dyyz1993/pi-coding-agent 0.69.26 → 0.70.0
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/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +14 -9
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +5 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +4 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/large-input.d.ts +8 -0
- package/dist/core/large-input.d.ts.map +1 -0
- package/dist/core/large-input.js +37 -0
- package/dist/core/large-input.js.map +1 -0
- package/dist/core/messages.d.ts +10 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +20 -0
- package/dist/core/messages.js.map +1 -1
- package/dist/core/session-manager.d.ts +9 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +29 -2
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +31 -5
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/index.d.ts +1 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +1 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/truncate.d.ts +1 -0
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +1 -0
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +3 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/package.json +7 -4
|
@@ -30,6 +30,7 @@ import { exportSessionToHtml } from "./export-html/index.js";
|
|
|
30
30
|
import { createToolHtmlRenderer } from "./export-html/tool-renderer.js";
|
|
31
31
|
import { ExtensionRunner, wrapRegisteredTools, } from "./extensions/index.js";
|
|
32
32
|
import { emitSessionShutdownEvent } from "./extensions/runner.js";
|
|
33
|
+
import { handleLargeInput } from "./large-input.js";
|
|
33
34
|
import { expandPromptTemplate } from "./prompt-templates.js";
|
|
34
35
|
import { CURRENT_SESSION_VERSION, getLatestCompactionEntry } from "./session-manager.js";
|
|
35
36
|
import { createSyntheticSourceInfo } from "./source-info.js";
|
|
@@ -737,11 +738,12 @@ export class AgentSession {
|
|
|
737
738
|
if (!options?.streamingBehavior) {
|
|
738
739
|
throw new Error("Agent is already processing. Specify streamingBehavior ('steer' or 'followUp') to queue the message.");
|
|
739
740
|
}
|
|
741
|
+
const { text: streamingText } = handleLargeInput(expandedText);
|
|
740
742
|
if (options.streamingBehavior === "followUp") {
|
|
741
|
-
await this._queueFollowUp(
|
|
743
|
+
await this._queueFollowUp(streamingText, currentImages);
|
|
742
744
|
}
|
|
743
745
|
else {
|
|
744
|
-
await this._queueSteer(
|
|
746
|
+
await this._queueSteer(streamingText, currentImages);
|
|
745
747
|
}
|
|
746
748
|
preflightResult?.(true);
|
|
747
749
|
return;
|
|
@@ -771,8 +773,10 @@ export class AgentSession {
|
|
|
771
773
|
}
|
|
772
774
|
// Build messages array (custom message if any, then user message)
|
|
773
775
|
messages = [];
|
|
776
|
+
// Handle large input: save to temp file and replace with preview
|
|
777
|
+
const { text: finalText } = handleLargeInput(expandedText);
|
|
774
778
|
// Add user message
|
|
775
|
-
const userContent = [{ type: "text", text:
|
|
779
|
+
const userContent = [{ type: "text", text: finalText }];
|
|
776
780
|
if (currentImages) {
|
|
777
781
|
userContent.push(...currentImages);
|
|
778
782
|
}
|
|
@@ -887,14 +891,13 @@ export class AgentSession {
|
|
|
887
891
|
* @throws Error if text is an extension command
|
|
888
892
|
*/
|
|
889
893
|
async steer(text, images) {
|
|
890
|
-
// Check for extension commands (cannot be queued)
|
|
891
894
|
if (text.startsWith("/")) {
|
|
892
895
|
this._throwIfExtensionCommand(text);
|
|
893
896
|
}
|
|
894
|
-
// Expand skill commands and prompt templates
|
|
895
897
|
let expandedText = this._expandSkillCommand(text);
|
|
896
898
|
expandedText = expandPromptTemplate(expandedText, [...this.promptTemplates]);
|
|
897
|
-
|
|
899
|
+
const { text: finalText } = handleLargeInput(expandedText);
|
|
900
|
+
await this._queueSteer(finalText, images);
|
|
898
901
|
}
|
|
899
902
|
/**
|
|
900
903
|
* Queue a follow-up message to be processed after the agent finishes.
|
|
@@ -904,14 +907,13 @@ export class AgentSession {
|
|
|
904
907
|
* @throws Error if text is an extension command
|
|
905
908
|
*/
|
|
906
909
|
async followUp(text, images) {
|
|
907
|
-
// Check for extension commands (cannot be queued)
|
|
908
910
|
if (text.startsWith("/")) {
|
|
909
911
|
this._throwIfExtensionCommand(text);
|
|
910
912
|
}
|
|
911
|
-
// Expand skill commands and prompt templates
|
|
912
913
|
let expandedText = this._expandSkillCommand(text);
|
|
913
914
|
expandedText = expandPromptTemplate(expandedText, [...this.promptTemplates]);
|
|
914
|
-
|
|
915
|
+
const { text: finalText } = handleLargeInput(expandedText);
|
|
916
|
+
await this._queueFollowUp(finalText, images);
|
|
915
917
|
}
|
|
916
918
|
/**
|
|
917
919
|
* Internal: Queue a steering message (already expanded, no extension command check).
|
|
@@ -1759,6 +1761,9 @@ export class AgentSession {
|
|
|
1759
1761
|
const id = this.sessionManager.appendCustomEntry(customType, data, options);
|
|
1760
1762
|
this._emit({ type: "custom_entry", customType, data, id, display: options?.display });
|
|
1761
1763
|
},
|
|
1764
|
+
foldEntry: (entryId, summary, originalTokens) => {
|
|
1765
|
+
this.sessionManager.appendFold(entryId, summary, originalTokens);
|
|
1766
|
+
},
|
|
1762
1767
|
setSessionName: (name) => {
|
|
1763
1768
|
const oldName = this.sessionManager.getSessionName();
|
|
1764
1769
|
const trimmed = name.trim();
|