devsmind-mcp 3.0.0 → 4.0.1

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 (46) hide show
  1. package/README.md +11 -20
  2. package/dist/cli/diff.js +1 -1
  3. package/dist/cli/diff.js.map +1 -1
  4. package/dist/cli/index.js +20 -9
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/cli/integrations/mcp.js +22 -1
  7. package/dist/cli/integrations/mcp.js.map +1 -1
  8. package/dist/cli/integrations/memory-topics.d.ts +21 -10
  9. package/dist/cli/integrations/memory-topics.js +32 -9
  10. package/dist/cli/integrations/memory-topics.js.map +1 -1
  11. package/dist/cli/integrations/memory.d.ts +14 -9
  12. package/dist/cli/integrations/memory.js +47 -229
  13. package/dist/cli/integrations/memory.js.map +1 -1
  14. package/dist/cli/integrations/registry.d.ts +27 -16
  15. package/dist/cli/integrations/registry.js +66 -34
  16. package/dist/cli/integrations/registry.js.map +1 -1
  17. package/dist/cli/rule.js +11 -16
  18. package/dist/cli/rule.js.map +1 -1
  19. package/dist/db/activity-graph.d.ts +55 -0
  20. package/dist/db/activity-graph.js +314 -0
  21. package/dist/db/activity-graph.js.map +1 -0
  22. package/dist/db/activity.d.ts +21 -0
  23. package/dist/db/activity.js +3 -2
  24. package/dist/db/activity.js.map +1 -1
  25. package/dist/db/database.d.ts +72 -4
  26. package/dist/db/database.js +89 -8
  27. package/dist/db/database.js.map +1 -1
  28. package/dist/db/index-build.d.ts +75 -0
  29. package/dist/db/index-build.js +177 -0
  30. package/dist/db/index-build.js.map +1 -0
  31. package/dist/db/revert.js +1 -1
  32. package/dist/db/revert.js.map +1 -1
  33. package/dist/db/schema.d.ts +2 -2
  34. package/dist/db/staging.d.ts +3 -2
  35. package/dist/db/staging.js +1 -1
  36. package/dist/db/staging.js.map +1 -1
  37. package/dist/mcp/server.d.ts +1 -1
  38. package/dist/mcp/server.js +215 -208
  39. package/dist/mcp/server.js.map +1 -1
  40. package/dist/utils/config.d.ts +15 -0
  41. package/dist/utils/config.js +27 -0
  42. package/dist/utils/config.js.map +1 -1
  43. package/dist/utils/scanner.d.ts +6 -4
  44. package/dist/utils/scanner.js +6 -4
  45. package/dist/utils/scanner.js.map +1 -1
  46. package/package.json +1 -1
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractFilesIntoGraph = extractFilesIntoGraph;
4
+ exports.pendingDescriptionNodes = pendingDescriptionNodes;
5
+ exports.resolveEdgesIncrementally = resolveEdgesIncrementally;
6
+ const indexer_1 = require("./indexer");
7
+ const ast_1 = require("../utils/ast");
8
+ const edges_1 = require("./edges");
9
+ /**
10
+ * How much of a node's code ships in an indexing batch response. Deliberately tighter than
11
+ * `describe.ts`'s 2000-char one-shot-LLM budget: the chat model driving in-chat indexing already
12
+ * has the surrounding conversation as context, so it needs less code per node to write a good
13
+ * description, and every char here is repeated once per node across a whole repo.
14
+ */
15
+ const CODE_CHARS_PER_NODE = 1200;
16
+ /** Default per-call extraction budgets — whichever trips first ends the batch. Files are always
17
+ * processed to completion once started, so `last_file_indexed` never points mid-file. */
18
+ const DEFAULT_FILE_BUDGET = 40;
19
+ const DEFAULT_NODE_BUDGET = 25;
20
+ const DEFAULT_CHAR_BUDGET = 30000;
21
+ /** Default wall-clock budget for one `resolveEdgesIncrementally` call. */
22
+ const DEFAULT_EDGE_TIME_BUDGET_MS = 25000;
23
+ /**
24
+ * Extracts structure from `files` deterministically via local AST — no LLM, so nothing is
25
+ * silently missed or hallucinated the way whole-file-to-an-LLM extraction could be. Writes each
26
+ * candidate straight to the graph (`upsertNode` + `updateHistory`, deliberately with no
27
+ * `code_before` — this is an index snapshot, not an edit, so it gets no diff/revert, exactly
28
+ * like `devsmind index --run`'s own Phase 1 write in `runner.ts:781-802`). Stops once ANY of the
29
+ * three budgets trips, but always finishes the file it's mid-way through first — the AI's cursor
30
+ * (`files_done`/`last_file_indexed`) must only ever advance past a FULLY extracted file, or a
31
+ * later `index_continue` silently skips whatever was left unprocessed in it.
32
+ *
33
+ * Node ids use the same `${repoRelPath}#${qualified}` formula as `runner.ts:778-779` and
34
+ * `staging.ts`'s `resolveEntryId` — required so a node created here is the same node an
35
+ * `edit_node` on the same symbol later resolves to, not a duplicate.
36
+ */
37
+ function extractFilesIntoGraph(db, files, opts = {}) {
38
+ const fileBudget = opts.fileBudget ?? DEFAULT_FILE_BUDGET;
39
+ const nodeBudget = opts.nodeBudget ?? DEFAULT_NODE_BUDGET;
40
+ const charBudget = opts.charBudget ?? DEFAULT_CHAR_BUDGET;
41
+ const codeCharsPerNode = opts.codeCharsPerNode ?? CODE_CHARS_PER_NODE;
42
+ const filesExtracted = [];
43
+ const nodes = [];
44
+ const fileImports = {};
45
+ let nodesCreated = 0;
46
+ let charsUsed = 0;
47
+ let cursor = null;
48
+ for (const filePath of files) {
49
+ if (filesExtracted.length > 0 &&
50
+ (filesExtracted.length >= fileBudget || nodes.length >= nodeBudget || charsUsed >= charBudget)) {
51
+ break;
52
+ }
53
+ // Never throws: returns [] for a non-parseable extension, an unreadable file, or a parse
54
+ // failure — all three are legitimate "nothing to extract here" outcomes, not batch-aborting
55
+ // errors. A file that yields nothing still counts as fully processed below.
56
+ const candidates = (0, ast_1.enumerateFileCandidates)(filePath);
57
+ const repoRelPath = db.toRepoRelativePath(filePath);
58
+ for (const c of candidates) {
59
+ const nodeId = `${repoRelPath}#${c.qualified}`;
60
+ db.upsertNode({ id: nodeId, name: c.name, type: c.type, file_path: filePath, signature: c.signature });
61
+ db.updateHistory({
62
+ node_id: nodeId,
63
+ code_snapshot: c.codeSnapshot,
64
+ reasoning: {
65
+ what_changed: 'Initial code extraction during in-chat indexing',
66
+ why: 'Initial index setup',
67
+ goal: 'Establish baseline codebase knowledge graph',
68
+ model: 'ast'
69
+ }
70
+ });
71
+ nodesCreated++;
72
+ const truncated = c.codeSnapshot.length > codeCharsPerNode;
73
+ const code = truncated ? c.codeSnapshot.slice(0, codeCharsPerNode) : c.codeSnapshot;
74
+ charsUsed += code.length;
75
+ nodes.push({
76
+ node_id: nodeId,
77
+ name: c.name,
78
+ type: c.type,
79
+ signature: c.signature,
80
+ file_path: filePath,
81
+ start_line: c.startLine,
82
+ end_line: c.endLine,
83
+ exported: c.isExported,
84
+ code,
85
+ code_truncated: truncated
86
+ });
87
+ }
88
+ if (candidates.length > 0) {
89
+ const imports = (0, ast_1.listFileImports)(filePath).map(i => i.moduleSpecifier);
90
+ if (imports.length > 0)
91
+ fileImports[repoRelPath] = [...new Set(imports)];
92
+ }
93
+ filesExtracted.push(filePath);
94
+ cursor = filePath;
95
+ }
96
+ return { filesExtracted, nodesCreated, nodes, fileImports, cursor };
97
+ }
98
+ /**
99
+ * Nodes with no description yet, oldest-created first — the same `WHERE description IS NULL`
100
+ * predicate `describe.ts:67`'s backlog-clearing loop uses. Re-served by `index_continue` ahead of
101
+ * a fresh batch so a still-undescribed node from an earlier batch is never silently dropped just
102
+ * because the AI moved on to the next one; it grows the visible backlog instead of losing it.
103
+ */
104
+ function pendingDescriptionNodes(db, limit) {
105
+ const pending = db.getAllNodes().filter(n => !n.deprecated && !n.description).slice(0, limit);
106
+ const nodes = [];
107
+ for (const n of pending) {
108
+ const latest = db.getLatestCode(n.id);
109
+ const full = latest?.code_snapshot ?? '';
110
+ const truncated = full.length > CODE_CHARS_PER_NODE;
111
+ nodes.push({
112
+ node_id: n.id,
113
+ name: n.name,
114
+ type: n.type,
115
+ signature: n.signature ?? null,
116
+ file_path: n.file_path,
117
+ code: truncated ? full.slice(0, CODE_CHARS_PER_NODE) : full,
118
+ code_truncated: truncated
119
+ });
120
+ }
121
+ return nodes;
122
+ }
123
+ /**
124
+ * Resumable, time-budgeted full-graph connection pass — the same `phase`/`nodes_done`/
125
+ * `nodes_total` state machine `runner.ts:834-839` and `runner.ts:604-661` already use for the
126
+ * CLI's Phase 2. A node extracted in an early batch can be the TARGET of a node extracted much
127
+ * later, so edges are never resolved per-batch during extraction — only here, once, over the
128
+ * WHOLE graph, exactly as `runner.ts:1223-1231` documents for the same reason.
129
+ *
130
+ * Persists `nodes_done` to the scratchpad after every node (not just on return), so a crash mid
131
+ * -pass loses at most one node's edges, not the whole call. Missing-node fill only runs once the
132
+ * WHOLE pass completes within a single call — a `resolve` that keeps expiring its time budget
133
+ * across many `index_complete` calls will still get every edge, just not missing-node fill until
134
+ * the pass that finally finishes; this is the same characteristic `devsmind index --run` itself
135
+ * has across a restarted process, not a new limitation introduced here.
136
+ */
137
+ function resolveEdgesIncrementally(db, devmindPath, pad, opts = {}) {
138
+ const deadline = Date.now() + (opts.timeBudgetMs ?? DEFAULT_EDGE_TIME_BUDGET_MS);
139
+ // Alias detection BEFORE the candidate pool is fetched, so this pass's own freshly-attached
140
+ // aliases (RTK Query generated hook names, etc.) are visible to the resolver below in the SAME
141
+ // pass rather than needing a second run — mirrors edges.ts's `resolveEdgesForNodes` ordering.
142
+ (0, edges_1.applyDeterministicAliases)(db, db.listNodes().map(n => n.id));
143
+ const allNodes = db.listNodes();
144
+ const allIds = new Set(allNodes.map(n => n.id));
145
+ if (pad.phase !== 2) {
146
+ pad.phase = 2;
147
+ pad.nodes_done = 0;
148
+ pad.nodes_total = allNodes.length;
149
+ pad.connections_created = 0;
150
+ }
151
+ else {
152
+ pad.nodes_total = allNodes.length;
153
+ }
154
+ const { missing, onMissing } = (0, edges_1.createMissingCollector)();
155
+ let i = pad.nodes_done;
156
+ for (; i < allNodes.length; i++) {
157
+ if (Date.now() > deadline)
158
+ break;
159
+ const node = allNodes[i];
160
+ const latest = db.getLatestCode(node.id);
161
+ if (latest?.code_snapshot && latest.code_snapshot.trim().length > 0) {
162
+ for (const targetId of (0, ast_1.resolveConnectionsLocally)(node.id, node.file_path, allNodes, devmindPath, onMissing)) {
163
+ if (allIds.has(targetId)) {
164
+ db.addConnection(node.id, targetId);
165
+ pad.connections_created++;
166
+ }
167
+ }
168
+ }
169
+ pad.nodes_done = i + 1;
170
+ pad.updated_at = new Date().toISOString();
171
+ (0, indexer_1.writeScratchpad)(devmindPath, pad);
172
+ }
173
+ const done = i >= allNodes.length;
174
+ const missingFilled = done ? (0, edges_1.finalizeMissingNodes)(devmindPath, db, missing, { writeReport: false, quiet: true }) : 0;
175
+ return { done, nodesDone: pad.nodes_done, nodesTotal: pad.nodes_total, edgesAdded: pad.connections_created, missingFilled };
176
+ }
177
+ //# sourceMappingURL=index-build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-build.js","sourceRoot":"","sources":["../../src/db/index-build.ts"],"names":[],"mappings":";;AAsDA,sDAyEC;AAQD,0DAkBC;AAgBD,8DAkDC;AA1ND,uCAA6D;AAC7D,sCAAmG;AACnG,mCAAkG;AAElG;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAEjC;0FAC0F;AAC1F,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAElC,0EAA0E;AAC1E,MAAM,2BAA2B,GAAG,KAAK,CAAC;AAoB1C;;;;;;;;;;;;;GAaG;AACH,SAAgB,qBAAqB,CACnC,EAAmB,EACnB,KAAe,EACf,OAAqG,EAAE;IAEvG,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,mBAAmB,CAAC;IAC1D,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,mBAAmB,CAAC;IAC1D,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,mBAAmB,CAAC;IAC1D,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,IAAI,mBAAmB,CAAC;IAEtE,MAAM,cAAc,GAAa,EAAE,CAAC;IACpC,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,MAAM,WAAW,GAA6B,EAAE,CAAC;IACjD,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,MA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H,CAAC;QACH,CAAC;QAED,GAAG,CAAC,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,GAAG,CAAC,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAA,yBAAe,EAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,IAAI,GAAG,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC;IAClC,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC,IAAA,4BAAoB,EAAC,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAErH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,CAAC,mBAAmB,EAAE,aAAa,EAAE,CAAC;AAC9H,CAAC"}
package/dist/db/revert.js CHANGED
@@ -52,7 +52,7 @@ function revertLastEdit(db, devmindPath, nodeId, expectedHistoryId) {
52
52
  if (!entry.edits.length) {
53
53
  return {
54
54
  ok: false,
55
- error: `The last change to ${resolvedId} was recorded without a before-state, so there is nothing to restore it to. Entries written before edit_node tracked diffs, and entries from stage_change (non-TS/JS files), are both like this. Use git to restore the file.`
55
+ error: `The last change to ${resolvedId} was recorded without a before-state, so there is nothing to restore it to. Entries written before edit_node tracked diffs, and legacy update_history / initial index snapshots, are both like this. Use git to restore the file.`
56
56
  };
57
57
  }
58
58
  const last = entry.edits[entry.edits.length - 1];
@@ -1 +1 @@
1
- {"version":3,"file":"revert.js","sourceRoot":"","sources":["../../src/db/revert.ts"],"names":[],"mappings":";;AAmCA,wCAmEC;AArGD,uCAA8D;AAC9D,wCAAkD;AAClD,sCAAoD;AAcpD;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,cAAc,CAAC,EA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AM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,uCAAuC,EAAE,CAAC;IAElF,MAAM,CAAC,GAAG,IAAA,wBAAiB,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAC1D,IAAI,CAAC,CAAC,CAAC,EAAE;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,qBAAqB,MAAM,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;IAClF,IAAA,0BAAoB,EAAC,MAAM,CAAC,CAAC;IAC7B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AACtB,CAAC"}
@@ -44,8 +44,8 @@ export interface DbHistory {
44
44
  reasoning: string;
45
45
  /**
46
46
  * Per-edit before/after trail, newest last. Lives only in the history JSON, never in SQLite —
47
- * same as code_snapshot. Empty for entries written before this existed, and for `stage_change`
48
- * entries, which have no before-state to record: both mean "no diff, no revert".
47
+ * same as code_snapshot. Empty for entries written before this existed, and for legacy
48
+ * `update_history` / initial index snapshots, which have no before-state to record: both mean "no diff, no revert".
49
49
  */
50
50
  edits: HistoryEdit[];
51
51
  }
@@ -6,8 +6,9 @@ export interface StagedEntry {
6
6
  code_snapshot: string;
7
7
  /**
8
8
  * The entity's text before this edit. Only `edit_node` can supply it (it holds the pre-edit
9
- * file); `stage_change` takes a snapshot with nothing to diff against and leaves it undefined.
10
- * Absent means the entry gets no diff and no revert.
9
+ * file); the legacy `update_history` path and an initial index snapshot both take a code
10
+ * snapshot with nothing to diff against and leave it undefined. Absent means the entry gets
11
+ * no diff and no revert.
11
12
  */
12
13
  code_before?: string | null;
13
14
  name?: string;
@@ -238,7 +238,7 @@ async function commitStagedChanges(db, devmindPath, entries, reasoning) {
238
238
  explicitEdges.push({ source: c.source_node_id || nodeId, target: c.target_node_id });
239
239
  }
240
240
  }
241
- // Batched, not per-entry — this is where a STAGED description (from stage_change, or from
241
+ // Batched, not per-entry — this is where a STAGED description (from edit_node, or from
242
242
  // add_description filling in a gate rejection) first has somewhere to actually store a vector.
243
243
  // No-op (embedTextsInt8 returns null) if the optional ONNX dependency is unavailable; those
244
244
  // nodes just fall into the `devsmind embed` queue like any other unembedded description.
@@ -1 +1 @@
1
- {"version":3,"file":"staging.js","sourceRoot":"","sources":["../../src/db/staging.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,gCAEC;AAED,kDAEC;AA2BD,8DAMC;AAOD,sDASC;AAGD,gCAMC;AAGD,sCAMC;AAQD,0CAKC;AAED,kCAKC;AASD,sDAYC;AAMD,wCAIC;AA2BD,kDAuEC;AAKD,kEAIC;AAjUD,uCAAyB;AACzB,2CAA6B;AAE7B,mCAA+C;AAC/C,yCAA6D;AAE7D,MAAM,YAAY,GAAG,yBAAyB,CAAC;AA0D/C,SAAS,WAAW,CAAC,WAAmB;IACtC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,UAAU,CAAC,WAAmB;IACrC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;QAC/D,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA2B,CAAC;QACtD,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACtD,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;YAC/D,UAAU,EAA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C,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,sBAAsB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC7F,CAAC"}
@@ -9,7 +9,7 @@ export declare const DEVSMIND_PORT = 4513;
9
9
  * `description` (resent every call), this is easy for a long session to lose
10
10
  * track of too, so it should carry only what's genuinely cross-cutting.
11
11
  */
12
- export declare const DEVSMIND_INSTRUCTIONS = "DevsMind is this team's persistent shared code memory \u2014 not a personal tool you reach for only when asked to search something. Every teammate's AI agent, in every session, reads from the SAME graph you are about to write to. There is no \"your copy.\"\n\nIf you skip recording a change, you are not skipping a formality. You are leaving the whole team's graph stale for every other AI agent that queries this code later \u2014 tomorrow, on a different task, in a different session. And the reasoning behind your change (why it was made, what ticket drove it, what was broken before, what you tried and rejected) exists ONLY in this conversation, right now. It is not in the diff. It is not in the commit message. If it isn't captured at commit_changes this turn, it is gone forever \u2014 no reindex, no log, no git blame can recover it later.\n\nNon-negotiable workflow:\n1. Call start_session once, before your first WRITE of the conversation (edit_node/stage_change/commit_changes and the other mutating tools). It mints a session_id that every write REQUIRES \u2014 it ties a request's edits together on the local Activity log and makes them revertable as a unit \u2014 and every response echoes it back so it stays in front of you, including after a context compaction. Read-only tools (search_nodes, get_node_code, list_nodes, and the other getters) do NOT need it: search and read freely from the very first call. Never invent a session_id yourself; if a write errors saying session_id is required, start_session was skipped \u2014 call it now, then retry. If you are resuming a conversation that already called start_session earlier (visible in the reloaded history), reuse that same session_id instead of starting a new one.\n2. Before any filesystem search, grep, or file read: call search_nodes FIRST \u2014 it is now the one call for both \"find this node\" AND \"find where X lives across files\", so you should not need an external grep. Two inputs, pass either or both: a natural-language query (a real phrase \u2014 drives meaning-matching, so \"authentication\" finds a node described only as \"sign-in\") and/or pattern, a REAL regex used exactly as you'd give it to grep (e.g. \"heartRed|onLikeTap|item.liked\" \u2014 nothing is re-escaped or split for you). Pattern-only is a precision mode: exact grep + code-body matches, no semantic blur. It returns two buckets: nodes (the indexed graph \u2014 the primary answer for \"which function/class\", with a true nodes_total before the top-20 cap) and files (a real grep of every repo, or just the path scope if given \u2014 the answer for things the graph does not index: CSS, JSON, config, .env, markup, wiring like \"where is CORS configured\" or \"what mounts this middleware\" \u2014 each sample line reports which function/class it falls inside, and files_total tells you honestly whether there's more than the page shown; pass a bigger offset for the next page). Triage by each node's confidence and relevance, NOT by which name looks right to you \u2014 confidence reflects how many independent layers corroborated the hit, which your own reading of a name cannot. Lockfiles and build artifacts are excluded by default, so what comes back is real source. If the response carries a compacted field, it was trimmed to fit and says exactly what was dropped \u2014 all counts stay exact, and compact:false gets you the untrimmed payload. It only returns real evidence \u2014 genuinely-absent things come back empty with a hint; if so, retry once with a different pattern/query before concluding it is not there. Only drop to a manual grep/read if search_nodes itself says truncated, or you need full file context after it points you at the file.\n3. To read one function/class: call get_node_code instead of opening the file, and do not follow it with a file read for context \u2014 this is the ONE node-read call, not a lean summary. It already includes the file's imports, the node's own name/type/signature/description, up to 20 named callers AND callees per direction (with exact uses/used_by counts even when the lists are capped), and up to 40 other declarations from the same file (file_outline \u2014 this is how you tell \"was this renamed?\" or \"what else lives here\" without opening the file). Reach further in the SAME call instead of a second tool: graph_depth + graph_direction walks the transitive graph past the direct neighbors already included (add graph_code:true for a whole call flow's source in one round trip \u2014 if some nodes' code doesn't fit the budget they are named in graph.code_omitted_node_ids, so fetch exactly those rather than re-running blind), and history:\"full\" returns every revision with diffable edits, pageable with history_limit/history_offset. Every capped section is honest about it (*_truncated, *_hint) \u2014 a hint means more is reachable in this same call, not a dead end.\n4. Before touching any function's signature: get_node_code already includes its direct callers by name (used_by_nodes) \u2014 for the FULL transitive blast radius, pass graph_direction:\"in\" with a graph_depth of 2-3 in that same call. Git shows you what changed; it never shows you what depends on it. Find out before you break something, not after.\n5. Before refactoring: get_node_code already includes the last 3 changes' reasoning by default \u2014 for the full revision trail with diffable before/after edits, pass history:\"full\" in that same call. Git blame tells you who and when; it never tells you why. The actual decision context only exists here.\n6. Write EVERY file with edit_node \u2014 .ts, .vue, .css, .json, .xml, .md, anything \u2014 and never your editor's own edit/write tools. It takes file_path + old_string + new_string exactly like an ordinary edit tool and never refuses a file type; to create a file that doesn't exist yet, pass old_string: \"\" and the whole file as new_string. Because it knows where your text landed, it works out which function/class you changed automatically: no node_id to look up, no code_snapshot to send back, and no stage_change call. It answers with every caller of what you changed. Writes landing outside any function (markup, config, an import) get no graph node \u2014 normal and expected, not a failure \u2014 but the whole-file change is still staged for the local activity log, so commit_changes makes it revertable there like any other edit.\n7. stage_change is now only for what no parser can read: a language with no AST support (.py, .go, .java, .cs, .rb, .php, .rs, .swift, .kt, .dart). edit_node still writes those files, and its response tells you when it couldn't trace one \u2014 so never guess. One call per node, not per file, never batched for later. On a long task, call commit_changes at natural checkpoints too (not only once at the very end) \u2014 waiting until the whole task is \"done\" is how staged work gets left uncommitted when a session runs long.\n8. Scope: the graph is source code only (functions/classes/logic). stage_change will be REJECTED for stylesheets, markup, JSON/config, docs, images, or any other non-code asset. Do not stage those files \u2014 they have no callers/callees to resolve and only bloat the graph.\n9. commit_changes REQUIRES a message AND a reasoning \u2014 the call fails without either. message is the user's request, verbatim, that led to this commit; it builds a local, private, never-pushed activity log (devsmind view \u2192 Activity) grouping your work by request and letting the user revert a request as a whole. Pass the exact same text again on a later commit that's still answering the same request \u2014 that merges them into one entry instead of splitting it. reasoning (what_changed/why/goal) is ONE object covering everything staged since the last commit \u2014 a commit is one logical change, so it gets one why, recorded against every node it touches, not one per edit_node/stage_change call.\n10. commit_changes also REFUSES any batch containing a brand-NEW node with no description \u2014 a description is what makes that node findable later by a natural-language search_nodes query instead of only by its exact identifier. If edit_node or stage_change just created a node, call add_description with it (1-3 sentences of what it does and the domain concepts involved \u2014 never a restatement of the name) before commit_changes will accept it. Nothing staged is lost by the refusal; retry the same commit_changes call once it's described. Existing nodes are never gated by this \u2014 only ones new this commit.\n11. A workflow is a named log of how ONE piece of functionality grew, across many sessions \u2014 read it to learn how the code got this way. start_session tells you if there is a recent one worth continuing; otherwise, when starting work that might belong to an existing multi-session feature, call workflow_list. If a description matches, ask the user before continuing it, then workflow_bind to attach THIS session. Binding is local to you: it never moves, pauses, or steals anyone else's workflow, and two sessions can work different ones at the same time.\n12. Once bound, commit_changes logs a step for you automatically \u2014 you do NOT need workflow_add_step for ordinary code work. Call it for the thing a commit cannot express: a DECISION OR RESEARCH FINDING THAT CHANGED NO CODE (\"evaluated X, rejected it because Y\"), attaching the docs behind it via doc_paths. That is the one kind of knowledge nothing else keeps \u2014 git has the diff, history has the per-node reasoning, but neither records what was considered and rejected. If you did work while unbound, or on the wrong workflow, workflow_sync attaches it afterwards from your local activity log: it previews first and only writes when you pass confirm:true, so nothing has to be got right in the moment.\n13. commit_changes also REQUIRES a feedback object (5 fields) \u2014 this is the only channel that improves DevsMind over time, so answer it for real, not as a formality. Before writing \"none\" on any field, actually check: did anything in THIS task take an extra tool call, a guess, a re-read, or a wrong turn? There almost always is something, even on an easy task \u2014 a specific one-line answer with evidence (file:line) is far more useful than a reflexive \"none\". \"none\" is correct only when you genuinely paid attention and nothing applies. Noticed something worth reporting but aren't committing right now (or don't want to wait until you are)? Call add_feedback directly \u2014 same 5 categories, but any one or more, nothing required, no commit needed. Passing evidence (file + snippet) on a graph_problem/edge_problem gets it verified fresh at call time and marked confirmed instead of suspected.";
12
+ export declare const DEVSMIND_INSTRUCTIONS = "DevsMind is this team's persistent shared code memory \u2014 not a personal tool you reach for only when asked to search something. Every teammate's AI agent, in every session, reads from the SAME graph you are about to write to. There is no \"your copy.\"\n\nIf you skip recording a change, you are not skipping a formality. You are leaving the whole team's graph stale for every other AI agent that queries this code later \u2014 tomorrow, on a different task, in a different session. And the reasoning behind your change (why it was made, what ticket drove it, what was broken before, what you tried and rejected) exists ONLY in this conversation, right now. It is not in the diff. It is not in the commit message. If it isn't captured at commit_changes this turn, it is gone forever \u2014 no reindex, no log, no git blame can recover it later.\n\nNon-negotiable workflow:\n1. Call start_session once, before your first WRITE of the conversation (edit_node/commit_changes and the other mutating tools). It mints a session_id that every write REQUIRES \u2014 it ties a request's edits together on the local Activity log and makes them revertable as a unit \u2014 and every response echoes it back so it stays in front of you, including after a context compaction. Read-only tools (search_nodes, get_node_code, list_nodes, and the other getters) do NOT need it: search and read freely from the very first call. Never invent a session_id yourself; if a write errors saying session_id is required, start_session was skipped \u2014 call it now, then retry. If you are resuming a conversation that already called start_session earlier (visible in the reloaded history), reuse that same session_id instead of starting a new one.\n2. Before any filesystem search, grep, or file read: call search_nodes FIRST \u2014 it is now the one call for both \"find this node\" AND \"find where X lives across files\", so you should not need an external grep. Two inputs, pass either or both: a natural-language query (a real phrase \u2014 drives meaning-matching, so \"authentication\" finds a node described only as \"sign-in\") and/or pattern, a REAL regex used exactly as you'd give it to grep (e.g. \"heartRed|onLikeTap|item.liked\" \u2014 nothing is re-escaped or split for you). Pattern-only is a precision mode: exact grep + code-body matches, no semantic blur. It returns two buckets: nodes (the indexed graph \u2014 the primary answer for \"which function/class\", with a true nodes_total before the top-20 cap) and files (a real grep of every repo, or just the path scope if given \u2014 the answer for things the graph does not index: CSS, JSON, config, .env, markup, wiring like \"where is CORS configured\" or \"what mounts this middleware\" \u2014 each sample line reports which function/class it falls inside, and files_total tells you honestly whether there's more than the page shown; pass a bigger offset for the next page). Triage by each node's confidence and relevance, NOT by which name looks right to you \u2014 confidence reflects how many independent layers corroborated the hit, which your own reading of a name cannot. Lockfiles and build artifacts are excluded by default, so what comes back is real source. If the response carries a compacted field, it was trimmed to fit and says exactly what was dropped \u2014 all counts stay exact, and compact:false gets you the untrimmed payload. It only returns real evidence \u2014 genuinely-absent things come back empty with a hint; if so, retry once with a different pattern/query before concluding it is not there. Only drop to a manual grep/read if search_nodes itself says truncated, or you need full file context after it points you at the file.\n3. To read one function/class: call get_node_code instead of opening the file, and do not follow it with a file read for context \u2014 this is the ONE node-read call, not a lean summary. It already includes the file's imports, the node's own name/type/signature/description, up to 20 named callers AND callees per direction (with exact uses/used_by counts even when the lists are capped), and up to 40 other declarations from the same file (file_outline \u2014 this is how you tell \"was this renamed?\" or \"what else lives here\" without opening the file). Reach further in the SAME call instead of a second tool: graph_depth + graph_direction walks the transitive graph past the direct neighbors already included (add graph_code:true for a whole call flow's source in one round trip \u2014 if some nodes' code doesn't fit the budget they are named in graph.code_omitted_node_ids, so fetch exactly those rather than re-running blind), and history:\"full\" returns every revision with diffable edits, pageable with history_limit/history_offset. Every capped section is honest about it (*_truncated, *_hint) \u2014 a hint means more is reachable in this same call, not a dead end.\n4. Before touching any function's signature: get_node_code already includes its direct callers by name (used_by_nodes) \u2014 for the FULL transitive blast radius, pass graph_direction:\"in\" with a graph_depth of 2-3 in that same call. Git shows you what changed; it never shows you what depends on it. Find out before you break something, not after.\n5. Before refactoring: get_node_code already includes the last 3 changes' reasoning by default \u2014 for the full revision trail with diffable before/after edits, pass history:\"full\" in that same call. Git blame tells you who and when; it never tells you why. The actual decision context only exists here.\n6. Write EVERY file with edit_node \u2014 .ts, .vue, .css, .json, .xml, .md, anything \u2014 and never your editor's own edit/write tools. There is no second write tool: edit_node is the only one. It takes file_path + old_string + new_string exactly like an ordinary edit tool and never refuses a file type; to create a file that doesn't exist yet, pass old_string: \"\" and the whole file as new_string. Because it knows where your text landed, it works out which function/class you changed automatically: no node_id to look up, no code_snapshot to send back. It answers with every caller of what you changed. The graph only ever holds source code (functions/classes/logic) though \u2014 writes landing outside any function (markup, config, an import) get no graph node, normal and expected, not a failure \u2014 but the whole-file change is still staged for the local activity log, so commit_changes makes it revertable there like any other edit.\n7. commit_changes REQUIRES a message AND a reasoning \u2014 the call fails without either. message is the user's request, verbatim, that led to this commit; it builds a local, private, never-pushed activity log (devsmind view \u2192 Activity) grouping your work by request and letting the user revert a request as a whole. Pass the exact same text again on a later commit that's still answering the same request \u2014 that merges them into one entry instead of splitting it. reasoning (what_changed/why/goal) is ONE object covering everything staged since the last commit \u2014 a commit is one logical change, so it gets one why, recorded against every node it touches, not one per edit_node call.\n8. commit_changes also REFUSES any batch containing a brand-NEW node with no description \u2014 a description is what makes that node findable later by a natural-language search_nodes query instead of only by its exact identifier. If edit_node just created a node, call add_description with it (1-3 sentences of what it does and the domain concepts involved \u2014 never a restatement of the name) before commit_changes will accept it. Nothing staged is lost by the refusal; retry the same commit_changes call once it's described. Existing nodes are never gated by this \u2014 only ones new this commit.\n9. A workflow is a named log of how ONE piece of functionality grew, across many sessions \u2014 read it to learn how the code got this way. start_session tells you if there is a recent one worth continuing; otherwise, when starting work that might belong to an existing multi-session feature, call workflow_list. If a description matches, ask the user before continuing it, then workflow_bind to attach THIS session. Binding is local to you: it never moves, pauses, or steals anyone else's workflow, and two sessions can work different ones at the same time.\n10. Once bound, commit_changes logs a step for you automatically \u2014 you do NOT need workflow_add_step for ordinary code work. Call it for the thing a commit cannot express: a DECISION OR RESEARCH FINDING THAT CHANGED NO CODE (\"evaluated X, rejected it because Y\"), attaching the docs behind it via doc_paths. That is the one kind of knowledge nothing else keeps \u2014 git has the diff, history has the per-node reasoning, but neither records what was considered and rejected. If you did work while unbound, or on the wrong workflow, workflow_sync attaches it afterwards from your local activity log: it previews first and only writes when you pass confirm:true, so nothing has to be got right in the moment.\n11. commit_changes also REQUIRES a feedback object (5 fields) \u2014 this is the only channel that improves DevsMind over time, so answer it for real, not as a formality. Before writing \"none\" on any field, actually check: did anything in THIS task take an extra tool call, a guess, a re-read, or a wrong turn? There almost always is something, even on an easy task \u2014 a specific one-line answer with evidence (file:line) is far more useful than a reflexive \"none\". \"none\" is correct only when you genuinely paid attention and nothing applies. Noticed something worth reporting but aren't committing right now (or don't want to wait until you are)? Call add_feedback directly \u2014 same 5 categories, but any one or more, nothing required, no commit needed. Passing evidence (file + snippet) on a graph_problem/edge_problem gets it verified fresh at call time and marked confirmed instead of suspected.";
13
13
  /** Binds this process to one project's `.devmind` dir. Called once at server startup. */
14
14
  export declare function bindDevmindPath(devmindPath: string): void;
15
15
  /** The bound project path, or null if this server is running unbound (tests / legacy). */