devsmind-mcp 2.4.0 → 4.0.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.
Files changed (135) hide show
  1. package/README.md +317 -234
  2. package/dist/cli/activity.d.ts +9 -0
  3. package/dist/cli/activity.js +69 -0
  4. package/dist/cli/activity.js.map +1 -0
  5. package/dist/cli/describe.d.ts +31 -0
  6. package/dist/cli/describe.js +201 -0
  7. package/dist/cli/describe.js.map +1 -0
  8. package/dist/cli/diff.d.ts +14 -0
  9. package/dist/cli/diff.js +161 -0
  10. package/dist/cli/diff.js.map +1 -0
  11. package/dist/cli/embed.d.ts +6 -0
  12. package/dist/cli/embed.js +109 -0
  13. package/dist/cli/embed.js.map +1 -0
  14. package/dist/cli/extract-agent.d.ts +66 -0
  15. package/dist/cli/extract-agent.js +192 -0
  16. package/dist/cli/extract-agent.js.map +1 -0
  17. package/dist/cli/feedback.d.ts +11 -0
  18. package/dist/cli/feedback.js +90 -0
  19. package/dist/cli/feedback.js.map +1 -0
  20. package/dist/cli/index.js +139 -9
  21. package/dist/cli/index.js.map +1 -1
  22. package/dist/cli/init.d.ts +30 -0
  23. package/dist/cli/init.js +89 -18
  24. package/dist/cli/init.js.map +1 -1
  25. package/dist/cli/integrations/memory-topics.d.ts +55 -0
  26. package/dist/cli/integrations/memory-topics.js +318 -0
  27. package/dist/cli/integrations/memory-topics.js.map +1 -0
  28. package/dist/cli/integrations/memory.d.ts +17 -6
  29. package/dist/cli/integrations/memory.js +52 -139
  30. package/dist/cli/integrations/memory.js.map +1 -1
  31. package/dist/cli/integrations/prompt.d.ts +8 -0
  32. package/dist/cli/integrations/prompt.js +24 -3
  33. package/dist/cli/integrations/prompt.js.map +1 -1
  34. package/dist/cli/integrations/registry.d.ts +26 -9
  35. package/dist/cli/integrations/registry.js +61 -30
  36. package/dist/cli/integrations/registry.js.map +1 -1
  37. package/dist/cli/llm-client.d.ts +116 -0
  38. package/dist/cli/llm-client.js +322 -0
  39. package/dist/cli/llm-client.js.map +1 -0
  40. package/dist/cli/rule.d.ts +22 -2
  41. package/dist/cli/rule.js +110 -34
  42. package/dist/cli/rule.js.map +1 -1
  43. package/dist/cli/runner.d.ts +21 -0
  44. package/dist/cli/runner.js +94 -276
  45. package/dist/cli/runner.js.map +1 -1
  46. package/dist/cli/sync-progress.d.ts +9 -0
  47. package/dist/cli/sync-progress.js +41 -0
  48. package/dist/cli/sync-progress.js.map +1 -0
  49. package/dist/cli/sync.js +5 -2
  50. package/dist/cli/sync.js.map +1 -1
  51. package/dist/cli/view.js +3 -2
  52. package/dist/cli/view.js.map +1 -1
  53. package/dist/cli/workflow.js +26 -20
  54. package/dist/cli/workflow.js.map +1 -1
  55. package/dist/db/activity-graph.d.ts +55 -0
  56. package/dist/db/activity-graph.js +314 -0
  57. package/dist/db/activity-graph.js.map +1 -0
  58. package/dist/db/activity.d.ts +221 -0
  59. package/dist/db/activity.js +348 -0
  60. package/dist/db/activity.js.map +1 -0
  61. package/dist/db/analyze.js +18 -6
  62. package/dist/db/analyze.js.map +1 -1
  63. package/dist/db/database.d.ts +654 -102
  64. package/dist/db/database.js +1911 -558
  65. package/dist/db/database.js.map +1 -1
  66. package/dist/db/edges.d.ts +24 -0
  67. package/dist/db/edges.js +84 -0
  68. package/dist/db/edges.js.map +1 -1
  69. package/dist/db/embedder.d.ts +39 -0
  70. package/dist/db/embedder.js +0 -0
  71. package/dist/db/embedder.js.map +1 -0
  72. package/dist/db/feedback.d.ts +128 -0
  73. package/dist/db/feedback.js +182 -0
  74. package/dist/db/feedback.js.map +1 -0
  75. package/dist/db/file-diff.d.ts +32 -0
  76. package/dist/db/file-diff.js +110 -0
  77. package/dist/db/file-diff.js.map +1 -0
  78. package/dist/db/grep.d.ts +78 -0
  79. package/dist/db/grep.js +475 -0
  80. package/dist/db/grep.js.map +1 -0
  81. package/dist/db/index-build.d.ts +75 -0
  82. package/dist/db/index-build.js +177 -0
  83. package/dist/db/index-build.js.map +1 -0
  84. package/dist/db/message-revert.d.ts +63 -0
  85. package/dist/db/message-revert.js +258 -0
  86. package/dist/db/message-revert.js.map +1 -0
  87. package/dist/db/revert.d.ts +31 -0
  88. package/dist/db/revert.js +108 -0
  89. package/dist/db/revert.js.map +1 -0
  90. package/dist/db/schema.d.ts +49 -4
  91. package/dist/db/schema.js +125 -73
  92. package/dist/db/schema.js.map +1 -1
  93. package/dist/db/search-index.d.ts +65 -0
  94. package/dist/db/search-index.js +74 -0
  95. package/dist/db/search-index.js.map +1 -0
  96. package/dist/db/staging.d.ts +91 -5
  97. package/dist/db/staging.js +148 -22
  98. package/dist/db/staging.js.map +1 -1
  99. package/dist/mcp/server.d.ts +29 -7
  100. package/dist/mcp/server.js +2637 -878
  101. package/dist/mcp/server.js.map +1 -1
  102. package/dist/mcp/vendor/3d-force-graph.min.js +5 -0
  103. package/dist/mcp/vendor/force-graph.min.js +5 -0
  104. package/dist/mcp/vendor/model/model_int8.onnx +0 -0
  105. package/dist/mcp/vendor/model/vocab.txt +30522 -0
  106. package/dist/mcp/vendor/three.min.js +7 -0
  107. package/dist/mcp/view.css +419 -0
  108. package/dist/mcp/view.html +161 -0
  109. package/dist/mcp/view.js +245 -0
  110. package/dist/mcp/view_chat.js +382 -0
  111. package/dist/mcp/view_graph.js +576 -0
  112. package/dist/mcp/visualizer.d.ts +25 -2
  113. package/dist/mcp/visualizer.js +31 -4
  114. package/dist/mcp/visualizer.js.map +1 -1
  115. package/dist/utils/ast.d.ts +89 -0
  116. package/dist/utils/ast.js +378 -10
  117. package/dist/utils/ast.js.map +1 -1
  118. package/dist/utils/diff.d.ts +44 -0
  119. package/dist/utils/diff.js +78 -0
  120. package/dist/utils/diff.js.map +1 -0
  121. package/dist/utils/edit.d.ts +6 -0
  122. package/dist/utils/edit.js +47 -14
  123. package/dist/utils/edit.js.map +1 -1
  124. package/dist/utils/scanner.d.ts +6 -4
  125. package/dist/utils/scanner.js +18 -8
  126. package/dist/utils/scanner.js.map +1 -1
  127. package/dist/utils/tokenize.d.ts +45 -0
  128. package/dist/utils/tokenize.js +129 -0
  129. package/dist/utils/tokenize.js.map +1 -0
  130. package/dist/utils/version.d.ts +14 -0
  131. package/dist/utils/version.js +61 -0
  132. package/dist/utils/version.js.map +1 -0
  133. package/package.json +18 -5
  134. package/dist/mcp/visualizer_2d.html +0 -635
  135. package/dist/mcp/visualizer_3d.html +0 -613
package/dist/cli/rule.js CHANGED
@@ -34,23 +34,33 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.buildRule = buildRule;
37
+ exports.buildKickoffPrompt = buildKickoffPrompt;
37
38
  exports.handleRule = handleRule;
38
39
  const fs = __importStar(require("fs"));
39
40
  const path = __importStar(require("path"));
40
41
  const config_1 = require("../utils/config");
41
42
  const prompt_1 = require("./integrations/prompt");
42
43
  const registry_1 = require("./integrations/registry");
43
- const scanner_1 = require("../utils/scanner");
44
44
  /**
45
45
  * Build the ready-to-paste DevsMind workspace rule from a project's config.
46
46
  * Pure string builder — no I/O — so it can be printed or written to a file.
47
+ *
48
+ * `workflowStyle` picks which of two rules gets built:
49
+ * - `'automatic'` (default): the AI stages, commits, and tracks every edit without being asked —
50
+ * the original, still-recommended default for a team's shared graph.
51
+ * - `'manual'`: the AI uses DevsMind's search/read tools freely (that part is never optional —
52
+ * it's why the tool exists) but never stages or commits on its own initiative; the developer
53
+ * stays the one deciding what reaches the graph and when. `session_id` (on writes) and `message`
54
+ * are still mechanically required by the protocol either way — that's not something a rule can
55
+ * opt out of, only WHEN commit_changes gets called is a style choice.
47
56
  */
48
- function buildRule(config, devmindDir) {
57
+ function buildRule(config, devmindDir, workflowStyle = 'automatic') {
49
58
  const projectName = config.project_name;
50
59
  const mode = config.mode;
51
60
  const notes = config.notes;
52
61
  const tech = config.tech_stack;
53
62
  const repos = config.repos;
63
+ const manual = workflowStyle === 'manual';
54
64
  const repoLines = repos
55
65
  .map(r => ('relative_path' in r ? `${r.name} → ${r.relative_path}` : `${r.name} → env:${r.path_key}`))
56
66
  .join(', ');
@@ -60,63 +70,114 @@ function buildRule(config, devmindDir) {
60
70
  const timeout = config.session_timeout_minutes ?? 60;
61
71
  const safeDevmindDir = devmindDir.replace(/\\/g, '/');
62
72
  const bt = '`';
73
+ const whatThisIs = manual
74
+ ? `DevsMind is this team's shared code graph — every teammate's AI agent reads the same graph, there is no "your copy." ${bt}get_node_code${bt} shows what git can't (live callers/callees by name already included; ${bt}graph_depth${bt}+${bt}graph_direction:"in"${bt} for the full blast radius before you break a signature). Its ${bt}history:"full"${bt} option shows what git blame can't (why a change was made, not just who/when). Reading from it is never optional — check it before you touch code. **Writing to it is the developer's call, not yours: this project is set to MANUAL — only stage or commit when explicitly asked to.**`
75
+ : `DevsMind is this team's shared code graph — every teammate's AI agent reads the same graph you write to, there is no "your copy." ${bt}get_node_code${bt} shows what git can't (live callers/callees by name already included; ${bt}graph_depth${bt}+${bt}graph_direction:"in"${bt} for the full blast radius before you break a signature). Its ${bt}history:"full"${bt} option shows what git blame can't (why a change was made, not just who/when). Both are worthless if changes stop getting recorded — so recording is not optional, it's the product.`;
76
+ const editRow = manual
77
+ ? `| Editing a file | ${bt}edit_node${bt} (${bt}file_path${bt} + ${bt}old_string${bt} + ${bt}new_string${bt}) is a safe drop-in for your own edit tool and traces automatically if you ever do commit — but it's optional here, your own editor's edit tool is equally fine |`
78
+ : `| ANY edit to ANY file — ${bt}.ts${bt}, ${bt}.vue${bt}, ${bt}.css${bt}, ${bt}.json${bt}, ${bt}.xml${bt}, anything | ${bt}edit_node${bt} (${bt}file_path${bt} + ${bt}old_string${bt} + ${bt}new_string${bt}) — never your own edit tool. It never refuses a file type, and traces what you changed for you |`;
79
+ const createRow = manual
80
+ ? `| Creating a NEW file | ${bt}edit_node${bt} with ${bt}old_string: ""${bt} works the same way |`
81
+ : `| Create a NEW file | ${bt}edit_node${bt} with ${bt}old_string: ""${bt} and the whole file as ${bt}new_string${bt} — never your own write tool |`;
82
+ const commitRow = manual
83
+ ? `| The developer explicitly asks you to commit/save/record this to DevsMind | ${bt}commit_changes${bt} — never on your own initiative |`
84
+ : `| Checkpoints during a long task, and before ending any turn with staged work | ${bt}commit_changes${bt} |`;
85
+ const recordingHeader = manual
86
+ ? '### Recording Changes — Manual: Only When Asked'
87
+ : '### Recording Changes — Per Node, Not Per File, Not At The End';
88
+ const recordingBody = manual ? [
89
+ `This project is set to **MANUAL**. Search/read tools (${bt}search_nodes${bt}, ${bt}get_node_code${bt}) stay always-on — use them before reading a raw file or guessing at impact, same as automatic mode. What's different is the write side:`,
90
+ '',
91
+ `1. Do **not** call ${bt}commit_changes${bt} on your own initiative — not after an edit, not at a "natural checkpoint," not because a turn is ending. The developer decides what reaches the graph and when.`,
92
+ `2. If the developer explicitly asks you to commit/save/record something ("commit this", "save that to devsmind", "record what we just did"), then follow the normal automatic-mode mechanics: ${bt}edit_node${bt} already staged whatever it traced; call ${bt}commit_changes${bt} with ${bt}message${bt} set to their request verbatim, ONE ${bt}reasoning${bt} (what_changed/why/goal) covering everything staged, and ${bt}feedback${bt} (5 strings: ${bt}graph_problems${bt}, ${bt}edge_problems${bt}, ${bt}tools_used${bt}, ${bt}dropped_and_why${bt}, ${bt}devsmind_better${bt} — each must be answered, ${bt}"none"${bt} is fine where nothing applies). All three are REQUIRED by the tool itself, not a style choice. If anything staged is a brand-NEW node, ${bt}commit_changes${bt} also requires a ${bt}description${bt} for it first (pass it on the ${bt}edit_node${bt} call that created it, or call ${bt}add_description${bt}) — enforced by the tool regardless of workflow style, not something MANUAL mode opts out of.`,
93
+ `3. ${bt}session_id${bt} is also mechanically required on every DevsMind WRITE regardless of mode (see above) — that's the protocol, not a recording obligation. Calling ${bt}start_session${bt} and carrying its id doesn't mean anything is being tracked; it's just what makes a write succeed at all. Read-only tools (${bt}search_nodes${bt}, ${bt}get_node_code${bt}, ${bt}get_activity_log${bt}, etc.) do NOT need it — search and read freely before ${bt}start_session${bt} has even run.`,
94
+ `4. Don't narrate that you skipped staging/committing — silence is the expected default here. Only bring up DevsMind's state when it's relevant or the developer asks.`,
95
+ ] : [
96
+ `1. ${bt}edit_node${bt} is the write path for **every** file — never your own edit/write tool, whatever the extension. Pass ${bt}file_path${bt} + ${bt}old_string${bt} + ${bt}new_string${bt}, exactly like an ordinary edit tool; to create a file, pass ${bt}old_string: ""${bt} and the whole file as ${bt}new_string${bt}. It traces where your text landed to the function/class you actually changed, and answers with that node's callers. No ${bt}node_id${bt} to look up, no ${bt}code_snapshot${bt} to send back. Writes landing outside any function (markup, config, imports) get no graph node — expected, not a failure — but the whole-file change is still staged for the local activity log, so ${bt}commit_changes${bt} makes it revertable there too.`,
97
+ `2. Call ${bt}commit_changes${bt} at natural checkpoints (a batch of related nodes, a context switch) — not saved for a single end-of-task call that's easy to skip when the task runs long. ${bt}edit_node${bt} only stages; it never writes to the graph on its own. Always commit before ending a turn with anything staged.`,
98
+ `3. ${bt}message${bt}, ${bt}reasoning${bt} AND ${bt}feedback${bt} are all REQUIRED on ${bt}commit_changes${bt} — the call fails without any one of them. ${bt}message${bt} is the user's request, verbatim, that led to this commit; it builds a local activity log (${bt}devsmind view${bt} → Activity, never pushed) grouping your work by request and letting the user revert one as a whole. Pass the exact same text again on a later commit that's still answering the same request — that merges them into one entry instead of splitting it. ${bt}reasoning${bt} (${bt}what_changed${bt}/${bt}why${bt}/${bt}goal${bt}) is ONE object covering **everything staged since the last commit** — not one per edit_node call, one per commit — and gets recorded against every node that commit touches.`,
99
+ `4. ${bt}feedback${bt} is the third required field: 5 strings (${bt}graph_problems${bt}, ${bt}edge_problems${bt}, ${bt}tools_used${bt}, ${bt}dropped_and_why${bt}, ${bt}devsmind_better${bt}). Every field must be ANSWERED, but none has to contain a problem — ${bt}"none"${bt} is a valid answer everywhere. It's the only channel that improves DevsMind instead of leaving it frozen at index time, so before writing "none", actually check whether one moment in THIS task took an extra tool call, a guess, a re-read, or a wrong turn; one specific sentence with evidence (${bt}file:line${bt}) beats a reflexive "none". Never invent an issue to fill a field. ${bt}graph_problems${bt}/${bt}edge_problems${bt} feed a local graph-fix queue (${bt}read_graph_feedback${bt}); the rest feed a product log. Both are local and gitignored — ${bt}devsmind feedback${bt} shows them.`,
100
+ `5. Every brand-NEW node needs a ${bt}description${bt} before ${bt}commit_changes${bt} will accept it — 1-3 sentences of what it does and its domain concepts, in words a teammate might search by later, never a restatement of the name. If an ${bt}edit_node${bt} call creates exactly ONE new function/class, pass ${bt}description${bt} on that same call — you already know what you just wrote, so there's no reason to wait for the refusal and a separate round trip. Otherwise call ${bt}add_description${bt} for whatever ${bt}edit_node${bt} traced as new (its response tells you when). Write it while the code is still in front of you — commit_changes will otherwise refuse the batch and hand back exactly which node_ids need one.`,
101
+ `6. Don't print node/history data as text instead of calling the tools — that looks done but records nothing.`
102
+ ];
63
103
  const lines = [
64
104
  '## DevsMind — AI Brain',
65
105
  '',
66
106
  `**DEVMIND_PATH**: ${bt}${safeDevmindDir}${bt}`,
67
107
  `**Project**: ${projectName} | **Mode**: ${mode} | **Tech**: ${techLine} | **Session timeout**: ${timeout}min`,
68
108
  `**Repos**: ${repoLines}`,
109
+ `**Workflow style**: ${manual ? 'MANUAL — DevsMind is for search & context here; the AI stages/commits only when explicitly asked' : 'AUTOMATIC — the AI stages, commits, and tracks every edit without being asked'}`,
69
110
  notes ? `**Notes**: ${notes}` : '',
70
111
  '',
71
112
  '### What This Is',
72
113
  '',
73
- `DevsMind is this team's shared code graph — every teammate's AI agent reads the same graph you write to, there is no "your copy." ${bt}get_node_graph${bt} shows what git can't (live callers/callees, before you break a signature). ${bt}get_node_history${bt} shows what git blame can't (why a change was made, not just who/when). Both are worthless if changes stop getting recorded — so recording is not optional, it's the product.`,
114
+ whatThisIs,
115
+ '',
116
+ `**${bt}session_id${bt} is required on every DevsMind WRITE** (${bt}edit_node${bt}, ${bt}commit_changes${bt}, and the other mutating calls) **— read-only tools do not need it.** Call ${bt}start_session${bt} before your first write, then pass the ${bt}session_id${bt} it returns on every later write this conversation — every response echoes it back so it stays in front of you even across a long or compacted conversation. Never invent one. This applies in both workflow styles — it's the protocol, not a recording obligation. ${bt}get_activity_log${bt} additionally accepts ${bt}session_id${bt} as its own OPTIONAL filter ("just this session's activity") — don't pass your own conversation's id there by default, or you'll silently narrow an otherwise-broad query to one session.`,
74
117
  '',
75
118
  '### Tool Triggers',
76
119
  '',
77
120
  '| Situation | Tool |',
78
121
  '|-----------|------|',
79
- `| Searching for a module, feature, concept, or code fragment | ${bt}search_nodes${bt} (name/reasoning match, auto-falls-back to code-content search)never start with grep |`,
80
- `| List/discover all nodes for a component or directory | ${bt}list_nodes${bt} |`,
81
- `| Read the code of ONE function/class | ${bt}get_node_code${bt} (live-parsed, cheaper than opening the file) |`,
82
- `| Trace a flow through MULTIPLE functions | ${bt}get_node_graph${bt} ${bt}direction:"out"${bt} + ${bt}include_code:true${bt} in ONE call don't chain ${bt}get_node_code${bt} per function |`,
83
- `| What would break if I change this? | ${bt}get_node_graph${bt} ${bt}direction:"in"${bt} (every caller) |`,
84
- `| Before refactoring a function | ${bt}get_node_history${bt} first |`,
85
- `| ANY edit to ANY file — ${bt}.ts${bt}, ${bt}.vue${bt}, ${bt}.css${bt}, ${bt}.json${bt}, ${bt}.xml${bt}, anything | ${bt}edit_node${bt} (${bt}file_path${bt} + ${bt}old_string${bt} + ${bt}new_string${bt} + ${bt}reasoning${bt}) never your own edit tool. It never refuses a file type, and records what you changed for you |`,
86
- `| Create a NEW file | ${bt}edit_node${bt} with ${bt}old_string: ""${bt} and the whole file as ${bt}new_string${bt} — never your own write tool |`,
87
- `| You wrote a language with no parser (${bt}.py${bt}, ${bt}.go${bt}, ${bt}.java${bt}, …) | ${bt}stage_change${bt} for that node — immediately, not batched (${bt}edit_node${bt}'s response tells you when) |`,
88
- `| Checkpoints during a long task, and before ending any turn with staged work | ${bt}commit_changes${bt} |`,
122
+ `| **Before your first WRITE this conversation** | ${bt}start_session${bt} — mints a ${bt}session_id${bt}. Every WRITE tool call (not reads) REQUIRES that exact ${bt}session_id${bt}; a write without one errors. On a resumed conversation that already called ${bt}start_session${bt} earlier (visible in the reloaded history), reuse that same iddon't start a new one |`,
123
+ `| Searching for a module, feature, concept, or code fragment — AND for config/CSS/markup the graph doesn't index | ${bt}search_nodes${bt}, passing ${bt}query${bt} (a natural-language phrase — drives meaning-matching) and/or ${bt}pattern${bt} (a real regex, used exactly as you'd give grep — e.g. an identifier or "item\.liked", not re-escaped or split). Pattern-only skips semantic ranking for exact matches. It answers with ${bt}nodes${bt} (the graph — triage on the ${bt}confidence${bt} and ${bt}relevance${bt} each node now leads with, NOT on which name reads plausibly to you; ${bt}nodes_total${bt} is the true count before the cap) AND ${bt}files${bt} (a real grep of every repo, or just ${bt}path${bt} if scoped; ${bt}files_total${bt} tells you honestly if there's more than the page shown). Lockfiles and build artifacts are excluded by default, so what comes back is real source. An oversized response is trimmed automatically and a ${bt}compacted${bt} field says what was dropped — counts stay exact, and ${bt}compact:false${bt} gets you all of it. Never start with your own grep; retry once with a different pattern/query before giving up on it |`,
124
+ `| List/discover all nodes for a component or directory | ${bt}list_nodes${bt} — paged. It answers ${bt}{nodes, total, offset}${bt}; ${bt}total${bt} is the true match count and ${bt}nodes${bt} is one page (default 100). A ${bt}truncated${bt} flag plus a ${bt}hint${bt} name the next call — never read a short page as everything. Narrow with ${bt}type${bt}/${bt}file_path${bt} rather than paging a whole repo |`,
125
+ `| Read the code of ONE function/class | ${bt}get_node_code${bt} — the ONE node-read call, live-parsed, cheaper than opening the file. Already includes ${bt}imports${bt}, ${bt}name${bt}/${bt}type${bt}/${bt}signature${bt}/${bt}description${bt}, up to 20 named callers AND callees per direction (${bt}uses_nodes${bt}/${bt}used_by_nodes${bt}, exact counts even when capped), up to 40 other declarations from the same file (${bt}file_outline${bt}), and up to 3 ${bt}recent_history${bt} summaries — a raw file read shouldn't be needed afterward for any of that |`,
126
+ `| Trace a flow through MULTIPLE functions | ${bt}get_node_code${bt} with ${bt}graph_depth:3${bt} + ${bt}graph_direction:"out"${bt} + ${bt}graph_code:true${bt} in ONE call — don't chain per-function calls. If some nodes' code didn't fit the budget they're named in ${bt}graph.code_omitted_node_ids${bt}; fetch exactly those, or re-issue with a larger ${bt}graph_code_budget${bt} |`,
127
+ `| What would break if I change this? | Direct callers are already in ${bt}used_by_nodes${bt} on the plain ${bt}get_node_code${bt} call; for the FULL transitive blast radius add ${bt}graph_depth:2-3${bt} + ${bt}graph_direction:"in"${bt} in that same call |`,
128
+ `| Before refactoring a function | ${bt}get_node_code${bt} with ${bt}history:"full"${bt} — every revision, with diffable before/after edits |`,
129
+ `| "What changed recently?" / "which files did you touch?" / everything done for a ticket | ${bt}get_activity_log${bt} filters compose (${bt}developer${bt}, ${bt}session_id${bt}, ${bt}since_hours${bt}/${bt}since${bt}/${bt}until${bt}, ${bt}requirement_contains${bt}), and every entry lists the actual ${bt}files${bt} that commit touched, plus an ${bt}all_files${bt} union and ${bt}total_matched${bt} (the pre-${bt}limit${bt} count). ${bt}source${bt} defaults to ${bt}"auto"${bt}: the local gitignored log, falling back to shared graph history when it's empty so a fresh clone still gets an answer |`,
130
+ `| What did a TEAMMATE change? / anything on a machine that isn't this one | ${bt}get_activity_log${bt} with ${bt}source:"both"${bt} ${bt}"auto"${bt} stops at the local log the moment it has anything of your own, so it never surfaces other developers' work. Graph-backed entries come with a ${bt}caveats${bt} array (no revert status, ${bt}request${bt} degrades to the reasoning's Requirement) read it before acting on them |`,
131
+ editRow,
132
+ createRow,
133
+ commitRow,
89
134
  `| Function/class renamed | ${bt}rename_node${bt} |`,
90
135
  `| Function/class removed | ${bt}deprecate_node${bt} (never delete — history is lost otherwise) |`,
91
136
  '',
92
- '### Recording Changes — Per Node, Not Per File, Not At The End',
93
- '',
94
- `${bt}stage_change${bt} is source code only (${Array.from(scanner_1.INDEXABLE_EXTENSIONS).sort().join(', ')}) — skip stylesheets, markup, config, docs, images.`,
137
+ recordingHeader,
95
138
  '',
96
- `1. ${bt}edit_node${bt} is the write path for **every** file — never your own edit/write tool, whatever the extension. Pass ${bt}file_path${bt} + ${bt}old_string${bt} + ${bt}new_string${bt} + ${bt}reasoning${bt}, exactly like an ordinary edit tool; to create a file, pass ${bt}old_string: ""${bt} and the whole file as ${bt}new_string${bt}. It traces where your text landed, records your reasoning against the function/class you actually changed, and answers with that node's callers. No ${bt}node_id${bt} to look up, no ${bt}code_snapshot${bt} to send back, no ${bt}stage_change${bt} call. Writes landing outside any function (markup, config, imports) record nothing — expected, not a failure.`,
97
- `2. ${bt}stage_change${bt} is only for what no parser can read: a language with no AST support (${bt}.py${bt}, ${bt}.go${bt}, ${bt}.java${bt}, …). ${bt}edit_node${bt} still writes those files and tells you when it couldn't trace one. One call per **node**, the moment you finish it — a file with 3 changed functions is 3 calls, not saved up. Pass ${bt}node_id${bt}, ${bt}file_path${bt}, ${bt}code_snapshot${bt}, ${bt}reasoning${bt}. Never hand-guess connections — ${bt}commit_changes${bt} resolves them via AST.`,
98
- `3. Call ${bt}commit_changes${bt} at natural checkpoints (a batch of related nodes, a context switch) — not saved for a single end-of-task call that's easy to skip when the task runs long. ${bt}edit_node${bt} and ${bt}stage_change${bt} both only stage; neither writes to the graph on its own. Always commit before ending a turn with anything staged.`,
99
- `4. Don't print node/history data as text instead of calling the tools — that looks done but records nothing.`,
139
+ ...recordingBody,
100
140
  '',
101
141
  '### Other Rules',
102
142
  '',
103
143
  `1. **No external scripts for indexing.** Use ${bt}index_start${bt} / ${bt}index_checkpoint${bt} / ${bt}index_continue${bt} / ${bt}index_complete${bt} natively so progress survives a context reset.`,
104
144
  `2. **Don't pause mid-index** for confirmation — keep going until the workspace is indexed or the context limit is hit.`,
105
- `3. **Drift signals** — ${bt}get_node_code${bt} returning ${bt}snapshot_outdated:true${bt} means the graph disagrees with disk. If you're about to edit that node anyway, an ${bt}edit_node${bt} call re-syncs it as a side effect — nothing extra to do. To force a resync with NO real code change, ${bt}edit_node${bt} can't help (it requires ${bt}old_string${bt} to actually differ from ${bt}new_string${bt}) — use ${bt}stage_change${bt} instead, passing the current on-disk code as ${bt}code_snapshot${bt}, then ${bt}commit_changes${bt}. ${bt}source:"cached"${bt} means the symbol wasn't found (renamed/moved/deleted) — verify, then ${bt}rename_node${bt} or ${bt}deprecate_node${bt}.`,
106
- `4. **Before multi-day work**, call ${bt}workflow_list${bt} — if a paused workflow matches, offer to resume it (${bt}workflow_resume${bt} + ${bt}workflow_get_context${bt}) instead of starting fresh. While a workflow is active, ${bt}commit_changes${bt} auto-logs a step from what you staged — call ${bt}workflow_add_step${bt} directly only for something a commit doesn't cover (a decision with no code change, or a ${bt}pending_tasks${bt} note).`,
145
+ `3. **Drift signals** — ${bt}get_node_code${bt} returning ${bt}snapshot_outdated:true${bt} means the graph disagrees with disk. If you're about to edit that node anyway, an ${bt}edit_node${bt} call re-syncs it as a side effect — nothing extra to do. To force a resync with NO real code change, ${bt}edit_node${bt} can't help (it requires ${bt}old_string${bt} to actually differ from ${bt}new_string${bt}) — run ${bt}devsmind reindex${bt} instead (incremental parsing of modified/new files). ${bt}source:"cached"${bt} means the symbol wasn't found (renamed/moved/deleted) — verify, then ${bt}rename_node${bt} or ${bt}deprecate_node${bt}.`,
146
+ `4. **Before multi-day work**, call ${bt}workflow_list${bt} — a workflow is a named log of how one piece of functionality grew. If a description matches, offer to continue it (${bt}workflow_bind${bt} + ${bt}workflow_get_context${bt}) rather than starting fresh. Binding is local to your session: it never moves or pauses anyone else's. Once bound, ${bt}commit_changes${bt} auto-logs a step — call ${bt}workflow_add_step${bt} only for what a commit can't express, a decision or research finding that changed no code, with its docs via ${bt}doc_paths${bt}.`,
107
147
  '',
108
148
  '### A Few Less-Obvious Tools',
109
149
  '',
110
150
  `Every tool's own name/schema/description is already sent to you automatically by the MCP server — no need to list them all here. Just the ones worth knowing about ahead of time:`,
111
151
  '',
112
- `* ${bt}get_orphaned_nodes${bt} / ${bt}recheck_graph${bt} / ${bt}analyze_graph${bt} — maintenance, not day-to-day lookup. ${bt}analyze_graph${bt} is a zero-token local health check (god entities, cycles, dangling edges, renames); ${bt}fix:true${bt} applies only the safe automatic fixes.`,
113
- `* ${bt}workflow_get_context${bt} — call right after ${bt}workflow_resume${bt} to load that workflow's full timeline + artifacts in one shot.`,
114
- `* ${bt}workflow_sync_retroactive${bt} — backfills a workflow's timeline after a whole session went by without a step being recorded; takes already-extracted steps, not raw transcript text.`,
115
- `* ${bt}workflow_import${bt} — turns existing flow/architecture docs into paused, resumable workflows.`,
152
+ `* ${bt}recheck_graph${bt} / ${bt}analyze_graph${bt} — maintenance, not day-to-day lookup. ${bt}analyze_graph${bt} is a zero-token local health check (god entities, cycles, dangling edges, renames, AND orphaned nodes — no separate orphan lookup needed); ${bt}fix:true${bt} applies only the safe automatic fixes.`,
153
+ `* Want the decision but don't know which node made it? ${bt}search_nodes${bt} already searches reasoning text from EVERY history revision, not just the latest no separate decisions-only search needed (${bt}get_node_code${bt} ${bt}history:"full"${bt} is the same thing scoped to one node you've already found).`,
154
+ `* ${bt}add_feedback${bt} — the same 5 ${bt}commit_changes${bt} feedback categories, callable ON DEMAND instead of waiting for a commit: pass any one or more, nothing required. Evidence (${bt}file${bt} + ${bt}snippet${bt}) on a ${bt}graph_problem${bt}/${bt}edge_problem${bt} is verified fresh at call time — a fabricated or stale claim is rejected outright, not silently downgraded.`,
155
+ `* ${bt}read_graph_feedback${bt} → fix → ${bt}mark_graph_feedback_processed${bt} the supervised loop that drains what ${bt}commit_changes${bt}'/${bt}add_feedback${bt}'s ${bt}graph_problem${bt}/${bt}edge_problem${bt} collected, clustered by frequency. Re-verify each cluster against current code first: ${bt}confidence${bt} is a priority signal, not proof, and reports go stale. Mark entries processed even when you decide they don't apply, or the queue never drains. ${bt}flag_indexer_rule${bt} notes a recurring pattern worth turning into a permanent detector.`,
156
+ `* ${bt}record_alias${bt} / ${bt}link_nodes${bt} / ${bt}merge_nodes${bt} / ${bt}split_node${bt} / ${bt}create_missing_node${bt} — the structural fixers that loop reaches for: a symbol known by another name, a real connection no AST could prove (dynamic dispatch, generated bindings), a node wrongly split or lumped together, something the indexer never picked up.`,
157
+ `* ${bt}get_visualizer_url${bt} — the local URL for the interactive graph view: one page, Chat + Graph tabs, with a 2D/3D toggle inside the Graph tab (same thing ${bt}devsmind view${bt} opens).`,
158
+ `* ${bt}workflow_get_context${bt} — call right after ${bt}workflow_bind${bt} to read that workflow's story: its steps in order, each with the reasoning and the nodes it touched. Paged, so ${bt}last_n${bt} is how you catch up on a long one.`,
159
+ `* ${bt}workflow_sync${bt} — attaches work you already did onto a workflow, for when you were unbound or on the wrong one. Reads your local activity log and previews first; it only writes when you pass ${bt}confirm:true${bt}, and re-running it is a no-op.`,
160
+ `* ${bt}workflow_archive${bt} — retires a workflow from the list without deleting anything. Deliberately not "complete": a feature is never finished, it just stops being worked on.`,
161
+ `* ${bt}workflow_import${bt} — turns existing flow/architecture docs into workflows.`,
116
162
  ];
117
163
  return lines.filter(l => l !== null).join('\n');
118
164
  }
119
- function printRuleBanner(rule, projectName, tip) {
165
+ /**
166
+ * A short block meant to be pasted at the START of a fresh AI chat — deliberately separate from
167
+ * the persistent rule file above. The rule file only helps once the agent actually reads it, and
168
+ * a long session can lose track of something it read once at the very beginning; this is the
169
+ * human's manual lever to make a brand-new conversation commit to the rule from its first move,
170
+ * rather than drifting into using DevsMind slowly (or not at all) over the first few turns.
171
+ */
172
+ function buildKickoffPrompt(workflowStyle = 'automatic') {
173
+ const manual = workflowStyle === 'manual';
174
+ const base = "Before doing anything else in this session: call DevsMind's `start_session` and carry the `session_id` it returns on every DevsMind call for the rest of this conversation — every tool requires it. Follow this project's DevsMind workspace rule exactly, not as a suggestion, even for edits that feel too small to bother with.";
175
+ const styleLine = manual
176
+ ? ' Use `search_nodes` (`query` and/or `pattern`, a real regex) / `get_node_code` (already includes named callers/callees and recent history; add `graph_depth`/`graph_direction` or `history:"full"` for more) before you read a file or guess at impact — that part is always on. Do NOT stage or commit anything to DevsMind on your own initiative; only do it if I explicitly ask you to record, save, or commit it.'
177
+ : ' Search with `search_nodes` (`query` and/or `pattern`, a real regex) before any grep, write every file with `edit_node` rather than your own editor tool, and call `commit_changes` (with `message` set to my actual request, one `reasoning` covering everything staged, and `feedback` — all three are required) at natural checkpoints — never leave work uncommitted at the end of a turn.';
178
+ return base + styleLine;
179
+ }
180
+ function printRuleBanner(rule, kickoff, projectName, tip) {
120
181
  const divider = '═'.repeat(70);
121
182
  console.log(`\n${divider}`);
122
183
  console.log(` DevsMind Workspace Rule — "${projectName}"`);
@@ -132,12 +193,22 @@ function printRuleBanner(rule, projectName, tip) {
132
193
  console.log(` or paste directly into your IDE's AI rules/instructions panel.`);
133
194
  }
134
195
  console.log(`${divider}\n`);
196
+ printKickoffBlock(kickoff);
197
+ }
198
+ function printKickoffBlock(kickoff) {
199
+ const thin = '─'.repeat(70);
200
+ console.log(` 🚀 Session kickoff — paste this at the start of a NEW chat so the agent`);
201
+ console.log(` commits to the rule immediately instead of drifting into it slowly:`);
202
+ console.log(`${thin}\n`);
203
+ console.log(kickoff);
204
+ console.log(`\n${thin}\n`);
135
205
  }
136
206
  /**
137
207
  * `devsmind rule` — print the workspace rule and, interactively, help place it
138
208
  * in the chosen tool's native rules file (manual snippet or automatic write).
139
209
  * Falls back to plain printing when piped/non-TTY or when `--print` is passed,
140
- * preserving `devsmind rule > file` usage.
210
+ * preserving `devsmind rule > file` usage. `--manual` picks the manual workflow
211
+ * style non-interactively (the fallback path has no prompt to ask with).
141
212
  */
142
213
  async function handleRule(opts) {
143
214
  const devmindDir = (0, config_1.resolveDevmindDir)(opts.path);
@@ -156,16 +227,20 @@ async function handleRule(opts) {
156
227
  process.exit(1);
157
228
  return;
158
229
  }
159
- const rule = buildRule(config, devmindDir);
160
230
  const projectName = config.project_name;
161
- // Backward-compat: piped/redirected output or explicit --print → plain print.
231
+ // Backward-compat: piped/redirected output or explicit --print → plain print, no prompts.
162
232
  if (opts.print || !process.stdout.isTTY) {
163
- printRuleBanner(rule, projectName);
233
+ const workflowStyle = opts.manual ? 'manual' : 'automatic';
234
+ const rule = buildRule(config, devmindDir, workflowStyle);
235
+ printRuleBanner(rule, buildKickoffPrompt(workflowStyle), projectName);
164
236
  return;
165
237
  }
166
238
  const workspaceRoot = path.dirname(devmindDir);
167
239
  try {
168
240
  const target = await (0, prompt_1.pickTarget)();
241
+ const workflowStyle = await (0, prompt_1.pickWorkflowStyle)();
242
+ const rule = buildRule(config, devmindDir, workflowStyle);
243
+ const kickoff = buildKickoffPrompt(workflowStyle);
169
244
  const mode = await (0, prompt_1.pickMode)();
170
245
  if (mode === 'manual') {
171
246
  const scope = target.rules.scopes[0];
@@ -173,10 +248,10 @@ async function handleRule(opts) {
173
248
  const noteFrontmatter = target.rules.wrap
174
249
  ? '\n (this file needs frontmatter — automatic mode adds it for you)'
175
250
  : '';
176
- printRuleBanner(rule, projectName, ` 💡 Save this to ${file.replace(/\\/g, '/')}${noteFrontmatter}`);
251
+ printRuleBanner(rule, kickoff, projectName, ` 💡 Save this to ${file.replace(/\\/g, '/')}${noteFrontmatter}`);
177
252
  return;
178
253
  }
179
- // Automatic mode.
254
+ // Automatic mode (install method — writes the rule file for you).
180
255
  const scope = await (0, prompt_1.pickRuleScope)(target);
181
256
  let filePath;
182
257
  if (scope.scope === 'project') {
@@ -200,7 +275,8 @@ async function handleRule(opts) {
200
275
  return;
201
276
  }
202
277
  (0, prompt_1.writeConfigFile)(filePath, merged.content);
203
- console.log(`\n✅ DevsMind rule written to ${filePath.replace(/\\/g, '/')} for ${target.label}.`);
278
+ console.log(`\n✅ DevsMind rule written to ${filePath.replace(/\\/g, '/')} for ${target.label}.\n`);
279
+ printKickoffBlock(kickoff);
204
280
  }
205
281
  catch (err) {
206
282
  if (err instanceof prompt_1.CancelledError) {
@@ -1 +1 @@
1
- {"version":3,"file":"rule.js","sourceRoot":"","sources":["../../src/cli/rule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,8BA4EC;AAyBD,gCAqFC;AA9MD,uCAAyB;AACzB,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Ac,CAAC,CAAC;YAC5B,OAAO;QACT,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -1,3 +1,14 @@
1
+ /** Exported for reuse by `src/cli/llm-client.ts` (the `devsmind describe` backfill) — plain
2
+ * request/response, nothing indexing-specific about it. */
3
+ export declare function makeHttpRequest(urlStr: string, method: string, headers: Record<string, string>, body: string): Promise<string>;
4
+ export declare function sleep(ms: number): Promise<void>;
5
+ export declare function throttleRpm(rpm?: number): Promise<void>;
6
+ export declare function getAccessTokenFromServiceAccount(sa: {
7
+ client_email: string;
8
+ private_key: string;
9
+ token_uri?: string;
10
+ }): Promise<string>;
11
+ export declare function getVertexTokenCached(saData: any): Promise<string>;
1
12
  export declare function runBackgroundIndexing(opts: {
2
13
  devmindPath: string;
3
14
  provider: 'gemini' | 'vertex' | 'ollama';
@@ -14,6 +25,16 @@ export declare function runBackgroundIndexing(opts: {
14
25
  repos?: string[];
15
26
  yes?: boolean;
16
27
  rpm?: number;
28
+ /**
29
+ * Phase 3, after node extraction + connection resolution: backfill descriptions for every
30
+ * node this run just created, reusing the SAME credentials already resolved for extraction
31
+ * (no separate `--key`/`--provider` setup). Runs the identical logic `devsmind describe` uses
32
+ * standalone (see describe.ts's `describePendingNodes`) — this just saves a second invocation
33
+ * right after a fresh index, since every node `runBackgroundIndexing` creates starts out
34
+ * undescribed (Phase 1's extraction is structure-only, no description field).
35
+ */
36
+ describe?: boolean;
37
+ describeBatchSize?: number;
17
38
  }): Promise<void>;
18
39
  export declare function runBackgroundReindexing(opts: {
19
40
  devmindPath: string;