@dyyz1993/pi-coding-agent 0.74.36 → 0.74.40
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 +2 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +17 -18
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/agent-types.d.ts.map +1 -1
- package/dist/core/agent-types.js +1 -0
- package/dist/core/agent-types.js.map +1 -1
- package/dist/extensions/agent-permissions/index.ts +32 -3
- package/dist/extensions/lsp/lsp/client/registry.ts +7 -0
- package/dist/extensions/lsp/lsp/client/runtime.ts +7 -0
- package/dist/extensions/lsp/lsp/diagnostics-refresh.test.ts +309 -0
- package/dist/extensions/lsp/lsp/hooks/diagnostics-mode.d.ts.map +1 -1
- package/dist/extensions/lsp/lsp/hooks/diagnostics-mode.js +1 -1
- package/dist/extensions/lsp/lsp/hooks/diagnostics-mode.js.map +1 -1
- package/dist/extensions/lsp/lsp/hooks/diagnostics-mode.ts +1 -1
- package/dist/extensions/lsp/lsp/hooks/writethrough.ts +1 -0
- package/dist/extensions/lsp/lsp/lsp.test.ts +6 -6
- package/dist/extensions/lsp/lsp/utils/diagnostics-wait.ts +9 -7
- package/dist/modes/rpc/rpc-client.d.ts +10 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +8 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +20 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +28 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -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/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 +4 -4
|
@@ -769,12 +769,9 @@ export class AgentSession {
|
|
|
769
769
|
this.setActiveToolsByName(agent.tools);
|
|
770
770
|
}
|
|
771
771
|
if (agent.systemPrompt) {
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
}
|
|
776
|
-
appendParts.push(agent.systemPrompt);
|
|
777
|
-
this._baseSystemPrompt = this._rebuildSystemPrompt(this.getActiveToolNames());
|
|
772
|
+
// Rebuild base prompt with filtered tools, then append agent-specific prompt
|
|
773
|
+
this._baseSystemPrompt = this._rebuildSystemPrompt(this.getActiveToolNames()) + "\n\n" + agent.systemPrompt;
|
|
774
|
+
this.agent.state.systemPrompt = this._baseSystemPrompt;
|
|
778
775
|
}
|
|
779
776
|
}
|
|
780
777
|
getCurrentAgent() {
|
|
@@ -2528,18 +2525,20 @@ export class AgentSession {
|
|
|
2528
2525
|
// Non-user message: leaf = selected node
|
|
2529
2526
|
newLeafId = targetId;
|
|
2530
2527
|
}
|
|
2531
|
-
// Safety guard: reject navigation that would eliminate ALL user messages
|
|
2532
|
-
//
|
|
2533
|
-
//
|
|
2534
|
-
//
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2528
|
+
// Safety guard: reject navigation that would eliminate ALL user messages
|
|
2529
|
+
// ONLY when file rollback is involved (skipFiles !== true).
|
|
2530
|
+
// When skipFiles=true (message-only rollback), going back to empty is valid —
|
|
2531
|
+
// the user wants to undo their mistaken message.
|
|
2532
|
+
if (options.skipFiles !== true) {
|
|
2533
|
+
const effectiveLeafId = summaryText ? newLeafId : newLeafId;
|
|
2534
|
+
const userMsgCount = this.sessionManager.countUserMessagesOnPath(effectiveLeafId);
|
|
2535
|
+
if (userMsgCount === 0) {
|
|
2536
|
+
return {
|
|
2537
|
+
cancelled: true,
|
|
2538
|
+
editorText: undefined,
|
|
2539
|
+
reason: `Navigation to "${targetId}" would remove all user messages and restore files to their pre-session state. Use message-only rollback (skipFiles: true) to undo without file changes.`,
|
|
2540
|
+
};
|
|
2541
|
+
}
|
|
2543
2542
|
}
|
|
2544
2543
|
// Switch leaf (with or without summary)
|
|
2545
2544
|
// Summary is attached at the navigation target position (newLeafId), not the old branch
|