dsh-deja 0.20.7 → 0.20.9

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 (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +17 -4
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -6,7 +6,7 @@ DeepSeek Harness can already search its own sessions — that is what the built-
6
6
  `session-query` subsystem does. This plugin answers the other question: what you
7
7
  did in the *other* agents on this machine.
8
8
 
9
- deja indexes the session files that twenty-four other coding agents — Claude Code,
9
+ deja indexes the session files that thirty-two other coding agents — Claude Code,
10
10
  Codex, Cursor, opencode, Antigravity, Grok Build, Kimi, Cline and Zed among
11
11
  them — already write to disk. Nothing has to have been recorded ahead of time: the history is already
12
12
  there, including the months before deja was installed. If you moved to dsh last
package/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  //
3
3
  // dsh answers questions about its own sessions through the built-in
4
4
  // session-query subsystem. This plugin answers the other question: what you did
5
- // in Claude Code, Codex, Cursor, opencode and twenty-one more agents, on this
5
+ // in Claude Code, Codex, Cursor, opencode and twenty-nine more agents, on this
6
6
  // machine, before dsh existed. The index is deja's; this file is the seam.
7
7
 
8
8
  import { createRequire } from "node:module";
@@ -280,7 +280,7 @@ function autoDigest(ctx) {
280
280
  if (sid) seen.add(sid);
281
281
  return run(
282
282
  ["hook-context", "--plain"],
283
- JSON.stringify({ session_id: sid, cwd: process.cwd(), source: "startup", deja_once: true }),
283
+ JSON.stringify({ session_id: sid, cwd: sessionCwd(agent), source: "startup", deja_once: true }),
284
284
  );
285
285
  },
286
286
  }),
@@ -291,8 +291,18 @@ function sessionId(agent) {
291
291
  return (agent && (agent.sessionId || (agent.session && agent.session.id))) || "";
292
292
  }
293
293
 
294
+ // The workspace a session belongs to. One web or tui process serves sessions
295
+ // from every workspace and never changes directory, so process.cwd() is only
296
+ // where dsh was launched; the session header carries the directory the session
297
+ // was opened in.
298
+ function sessionCwd(agent) {
299
+ const header = agent && agent.session && agent.session.header;
300
+ return (header && header.cwd) || process.cwd();
301
+ }
302
+
294
303
  function autoRecall(ctx) {
295
304
  let asked = "";
305
+ let askedIn = "";
296
306
  let recalled = "";
297
307
 
298
308
  guarded(() =>
@@ -304,9 +314,12 @@ function autoRecall(ctx) {
304
314
  if (!agent) return "";
305
315
  const prompt = lastHumanText(agent);
306
316
  if (!prompt) return "";
307
- if (prompt !== asked) {
317
+ const cwd = sessionCwd(agent);
318
+ // The same question asked in another workspace is a different question.
319
+ if (prompt !== asked || cwd !== askedIn) {
308
320
  asked = prompt;
309
- recalled = run(["hook-prompt", "--plain"], JSON.stringify({ prompt, cwd: process.cwd() }));
321
+ askedIn = cwd;
322
+ recalled = run(["hook-prompt", "--plain"], JSON.stringify({ prompt, cwd }));
310
323
  }
311
324
  // Silence is the common case: this speaks only when the history answers.
312
325
  return recalled;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-deja",
3
- "version": "0.20.7",
4
- "description": "deja-vu memory for DeepSeek Harness: the session history of twenty-four other coding agents, searchable and recalled before each step — a local index, no LLM.",
3
+ "version": "0.20.9",
4
+ "description": "deja-vu memory for DeepSeek Harness: the session history of thirty-two other coding agents, searchable and recalled before each step — a local index, no LLM.",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "exports": {
@@ -50,7 +50,7 @@
50
50
  }
51
51
  },
52
52
  "dependencies": {
53
- "@vshulcz/deja-vu": "^0.20.0"
53
+ "@vshulcz/deja-vu": "^0.20.2"
54
54
  },
55
55
  "scripts": {
56
56
  "test": "node --test test/*.test.js"