@vshulcz/pi-deja 0.21.3 → 0.21.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.
Files changed (2) hide show
  1. package/index.ts +11 -3
  2. package/package.json +2 -2
package/index.ts CHANGED
@@ -124,7 +124,14 @@ export default function (pi: any) {
124
124
  pi.on("before_agent_start", async (event: any, ctx: any) => {
125
125
  try {
126
126
  if (!injected) {
127
- const { context: digest, receipt } = contextText(run(["hook-context"], ""));
127
+ // The session goes with it: hook-context marks the one starting as
128
+ // live, which keeps it out of its own MCP recall on this first turn
129
+ // (#4394, as #4246 and #4273 did for Hermes and opencode).
130
+ const key = sessionKey(event, ctx);
131
+ if (key) session = key;
132
+ const { context: digest, receipt } = contextText(
133
+ run(["hook-context"], JSON.stringify({ session_id: key, cwd: process.cwd() })),
134
+ );
128
135
  if (digest) {
129
136
  injected = true;
130
137
  ctx.ui.setStatus("deja", "");
@@ -195,7 +202,8 @@ export default function (pi: any) {
195
202
  return { content: parts.concat([{ type: "text", text: note }]) };
196
203
  }
197
204
  if (!event.isError) return;
198
- if (event.toolName !== "bash") return;
205
+ // The pi-coding-agent has a powershell tool beside bash (#4523).
206
+ if (event.toolName !== "bash" && event.toolName !== "powershell") return;
199
207
  const parts = Array.isArray(event.content) ? event.content : [];
200
208
  const output = parts
201
209
  .filter((p: any) => p && p.type === "text" && typeof p.text === "string")
@@ -205,7 +213,7 @@ export default function (pi: any) {
205
213
  const id = String(event.toolCallId || "");
206
214
  if (!(id in repaired)) {
207
215
  repaired[id] = run(["hook-tool-after", "--plain"], JSON.stringify({
208
- tool_name: "bash",
216
+ tool_name: event.toolName,
209
217
  tool_response: output,
210
218
  session_id: session,
211
219
  cwd: process.cwd(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vshulcz/pi-deja",
3
- "version": "0.21.3",
3
+ "version": "0.21.5",
4
4
  "description": "deja-vu memory for pi: the coding sessions already on this machine — pi, Claude Code, Codex, Cursor and 31 more — recalled at session start and on every prompt, searchable with /deja. A local index, no LLM.",
5
5
  "type": "module",
6
6
  "files": [
@@ -45,7 +45,7 @@
45
45
  "node": ">=18"
46
46
  },
47
47
  "dependencies": {
48
- "@vshulcz/deja-vu": "^0.21.3"
48
+ "@vshulcz/deja-vu": "^0.21.5"
49
49
  },
50
50
  "pi": {
51
51
  "extensions": [