devsmind-mcp 2.3.0 → 3.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 (130) hide show
  1. package/README.md +326 -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 +128 -5
  21. package/dist/cli/index.js.map +1 -1
  22. package/dist/cli/init.d.ts +30 -0
  23. package/dist/cli/init.js +98 -18
  24. package/dist/cli/init.js.map +1 -1
  25. package/dist/cli/integrations/memory-topics.d.ts +44 -0
  26. package/dist/cli/integrations/memory-topics.js +295 -0
  27. package/dist/cli/integrations/memory-topics.js.map +1 -0
  28. package/dist/cli/integrations/memory.d.ts +11 -5
  29. package/dist/cli/integrations/memory.js +132 -36
  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 +19 -5
  35. package/dist/cli/integrations/registry.js +23 -13
  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/prune.js +4 -3
  41. package/dist/cli/prune.js.map +1 -1
  42. package/dist/cli/rule.d.ts +22 -2
  43. package/dist/cli/rule.js +116 -56
  44. package/dist/cli/rule.js.map +1 -1
  45. package/dist/cli/runner.d.ts +21 -0
  46. package/dist/cli/runner.js +94 -276
  47. package/dist/cli/runner.js.map +1 -1
  48. package/dist/cli/sync-progress.d.ts +9 -0
  49. package/dist/cli/sync-progress.js +41 -0
  50. package/dist/cli/sync-progress.js.map +1 -0
  51. package/dist/cli/sync.js +5 -2
  52. package/dist/cli/sync.js.map +1 -1
  53. package/dist/cli/view.js +3 -2
  54. package/dist/cli/view.js.map +1 -1
  55. package/dist/cli/workflow.js +26 -20
  56. package/dist/cli/workflow.js.map +1 -1
  57. package/dist/db/activity.d.ts +200 -0
  58. package/dist/db/activity.js +347 -0
  59. package/dist/db/activity.js.map +1 -0
  60. package/dist/db/analyze.js +25 -9
  61. package/dist/db/analyze.js.map +1 -1
  62. package/dist/db/database.d.ts +607 -79
  63. package/dist/db/database.js +1936 -488
  64. package/dist/db/database.js.map +1 -1
  65. package/dist/db/edges.d.ts +24 -0
  66. package/dist/db/edges.js +84 -0
  67. package/dist/db/edges.js.map +1 -1
  68. package/dist/db/embedder.d.ts +39 -0
  69. package/dist/db/embedder.js +0 -0
  70. package/dist/db/embedder.js.map +1 -0
  71. package/dist/db/feedback.d.ts +128 -0
  72. package/dist/db/feedback.js +182 -0
  73. package/dist/db/feedback.js.map +1 -0
  74. package/dist/db/file-diff.d.ts +32 -0
  75. package/dist/db/file-diff.js +110 -0
  76. package/dist/db/file-diff.js.map +1 -0
  77. package/dist/db/grep.d.ts +78 -0
  78. package/dist/db/grep.js +475 -0
  79. package/dist/db/grep.js.map +1 -0
  80. package/dist/db/message-revert.d.ts +63 -0
  81. package/dist/db/message-revert.js +258 -0
  82. package/dist/db/message-revert.js.map +1 -0
  83. package/dist/db/revert.d.ts +31 -0
  84. package/dist/db/revert.js +108 -0
  85. package/dist/db/revert.js.map +1 -0
  86. package/dist/db/schema.d.ts +49 -4
  87. package/dist/db/schema.js +125 -73
  88. package/dist/db/schema.js.map +1 -1
  89. package/dist/db/search-index.d.ts +65 -0
  90. package/dist/db/search-index.js +74 -0
  91. package/dist/db/search-index.js.map +1 -0
  92. package/dist/db/staging.d.ts +90 -5
  93. package/dist/db/staging.js +148 -22
  94. package/dist/db/staging.js.map +1 -1
  95. package/dist/mcp/server.d.ts +29 -7
  96. package/dist/mcp/server.js +2755 -745
  97. package/dist/mcp/server.js.map +1 -1
  98. package/dist/mcp/vendor/3d-force-graph.min.js +5 -0
  99. package/dist/mcp/vendor/force-graph.min.js +5 -0
  100. package/dist/mcp/vendor/model/model_int8.onnx +0 -0
  101. package/dist/mcp/vendor/model/vocab.txt +30522 -0
  102. package/dist/mcp/vendor/three.min.js +7 -0
  103. package/dist/mcp/view.css +419 -0
  104. package/dist/mcp/view.html +161 -0
  105. package/dist/mcp/view.js +245 -0
  106. package/dist/mcp/view_chat.js +382 -0
  107. package/dist/mcp/view_graph.js +576 -0
  108. package/dist/mcp/visualizer.d.ts +25 -2
  109. package/dist/mcp/visualizer.js +31 -4
  110. package/dist/mcp/visualizer.js.map +1 -1
  111. package/dist/utils/ast.d.ts +187 -0
  112. package/dist/utils/ast.js +640 -20
  113. package/dist/utils/ast.js.map +1 -1
  114. package/dist/utils/diff.d.ts +44 -0
  115. package/dist/utils/diff.js +78 -0
  116. package/dist/utils/diff.js.map +1 -0
  117. package/dist/utils/edit.d.ts +47 -0
  118. package/dist/utils/edit.js +196 -0
  119. package/dist/utils/edit.js.map +1 -0
  120. package/dist/utils/scanner.js +12 -4
  121. package/dist/utils/scanner.js.map +1 -1
  122. package/dist/utils/tokenize.d.ts +45 -0
  123. package/dist/utils/tokenize.js +129 -0
  124. package/dist/utils/tokenize.js.map +1 -0
  125. package/dist/utils/version.d.ts +14 -0
  126. package/dist/utils/version.js +61 -0
  127. package/dist/utils/version.js.map +1 -0
  128. package/package.json +18 -5
  129. package/dist/mcp/visualizer_2d.html +0 -635
  130. package/dist/mcp/visualizer_3d.html +0 -613
package/dist/cli/rule.js CHANGED
@@ -34,6 +34,7 @@ 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"));
@@ -44,13 +45,23 @@ const scanner_1 = require("../utils/scanner");
44
45
  /**
45
46
  * Build the ready-to-paste DevsMind workspace rule from a project's config.
46
47
  * Pure string builder — no I/O — so it can be printed or written to a file.
48
+ *
49
+ * `workflowStyle` picks which of two rules gets built:
50
+ * - `'automatic'` (default): the AI stages, commits, and tracks every edit without being asked —
51
+ * the original, still-recommended default for a team's shared graph.
52
+ * - `'manual'`: the AI uses DevsMind's search/read tools freely (that part is never optional —
53
+ * it's why the tool exists) but never stages or commits on its own initiative; the developer
54
+ * stays the one deciding what reaches the graph and when. `session_id` (on writes) and `message`
55
+ * are still mechanically required by the protocol either way — that's not something a rule can
56
+ * opt out of, only WHEN commit_changes gets called is a style choice.
47
57
  */
48
- function buildRule(config, devmindDir) {
58
+ function buildRule(config, devmindDir, workflowStyle = 'automatic') {
49
59
  const projectName = config.project_name;
50
60
  const mode = config.mode;
51
61
  const notes = config.notes;
52
62
  const tech = config.tech_stack;
53
63
  const repos = config.repos;
64
+ const manual = workflowStyle === 'manual';
54
65
  const repoLines = repos
55
66
  .map(r => ('relative_path' in r ? `${r.name} → ${r.relative_path}` : `${r.name} → env:${r.path_key}`))
56
67
  .join(', ');
@@ -60,84 +71,118 @@ function buildRule(config, devmindDir) {
60
71
  const timeout = config.session_timeout_minutes ?? 60;
61
72
  const safeDevmindDir = devmindDir.replace(/\\/g, '/');
62
73
  const bt = '`';
74
+ const whatThisIs = manual
75
+ ? `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.**`
76
+ : `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.`;
77
+ const editRow = manual
78
+ ? `| 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 |`
79
+ : `| 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 |`;
80
+ const createRow = manual
81
+ ? `| Creating a NEW file | ${bt}edit_node${bt} with ${bt}old_string: ""${bt} works the same way |`
82
+ : `| 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 |`;
83
+ const commitRow = manual
84
+ ? `| The developer explicitly asks you to commit/save/record this to DevsMind | ${bt}commit_changes${bt} — never on your own initiative |`
85
+ : `| Checkpoints during a long task, and before ending any turn with staged work | ${bt}commit_changes${bt} |`;
86
+ const recordingHeader = manual
87
+ ? '### Recording Changes — Manual: Only When Asked'
88
+ : '### Recording Changes — Per Node, Not Per File, Not At The End';
89
+ const recordingBody = manual ? [
90
+ `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:`,
91
+ '',
92
+ `1. Do **not** call ${bt}stage_change${bt} or ${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.`,
93
+ `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.`,
94
+ `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.`,
95
+ `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.`,
96
+ `5. ${bt}stage_change${bt}, when it is used, is source code only (${Array.from(scanner_1.INDEXABLE_EXTENSIONS).sort().join(', ')}) — skip stylesheets, markup, config, docs, images.`
97
+ ] : [
98
+ `${bt}stage_change${bt} is source code only (${Array.from(scanner_1.INDEXABLE_EXTENSIONS).sort().join(', ')}) — skip stylesheets, markup, config, docs, images.`,
99
+ '',
100
+ `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, no ${bt}stage_change${bt} call. 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.`,
101
+ `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}. Never hand-guess connections — ${bt}commit_changes${bt} resolves them via AST.`,
102
+ `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.`,
103
+ `4. ${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/stage_change call, one per commit — and gets recorded against every node that commit touches.`,
104
+ `5. ${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.`,
105
+ `6. 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 pass it on ${bt}stage_change${bt}, or 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.`,
106
+ `7. Don't print node/history data as text instead of calling the tools — that looks done but records nothing.`
107
+ ];
63
108
  const lines = [
64
109
  '## DevsMind — AI Brain',
65
110
  '',
66
111
  `**DEVMIND_PATH**: ${bt}${safeDevmindDir}${bt}`,
67
112
  `**Project**: ${projectName} | **Mode**: ${mode} | **Tech**: ${techLine} | **Session timeout**: ${timeout}min`,
68
113
  `**Repos**: ${repoLines}`,
114
+ `**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
115
  notes ? `**Notes**: ${notes}` : '',
70
116
  '',
71
117
  '### What This Is',
72
118
  '',
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.`,
119
+ whatThisIs,
120
+ '',
121
+ `**${bt}session_id${bt} is required on every DevsMind WRITE** (${bt}edit_node${bt}, ${bt}stage_change${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
122
  '',
75
123
  '### Tool Triggers',
76
124
  '',
77
125
  '| Situation | Tool |',
78
126
  '|-----------|------|',
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
- `| The moment you finish editing one node | ${bt}stage_change${bt} for that node immediately, not batched |`,
86
- `| Checkpoints during a long task, and before ending any turn with staged work | ${bt}commit_changes${bt} |`,
127
+ `| **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 |`,
128
+ `| 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 |`,
129
+ `| 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 |`,
130
+ `| 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 |`,
131
+ `| 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} |`,
132
+ `| 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 |`,
133
+ `| Before refactoring a function | ${bt}get_node_code${bt} with ${bt}history:"full"${bt}every revision, with diffable before/after edits |`,
134
+ `| "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 across matches. Local and gitignored — this machine only, never the shared graph |`,
135
+ editRow,
136
+ createRow,
137
+ `| You wrote a language with no parser (${bt}.py${bt}, ${bt}.go${bt}, ${bt}.java${bt}, …)${manual ? ' and were asked to record it' : ''} | ${bt}stage_change${bt} for that node${manual ? '' : ' — immediately, not batched'} (${bt}edit_node${bt}'s response tells you when) |`,
138
+ commitRow,
87
139
  `| Function/class renamed | ${bt}rename_node${bt} |`,
88
140
  `| Function/class removed | ${bt}deprecate_node${bt} (never delete — history is lost otherwise) |`,
89
141
  '',
90
- '### Recording Changes — Per Node, Not Per File, Not At The End',
142
+ recordingHeader,
91
143
  '',
92
- `${bt}stage_change${bt} is source code only (${Array.from(scanner_1.INDEXABLE_EXTENSIONS).sort().join(', ')}) — skip stylesheets, markup, config, docs, images.`,
93
- '',
94
- `1. Call ${bt}stage_change${bt} once per touched **node** the moment you finish it — a file with 3 changed functions is 3 calls, made as you go, 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.`,
95
- `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. Staging alone writes nothing; always commit before ending a turn with anything staged.`,
96
- `3. Don't print node/history data as text instead of calling the tools — that looks done but records nothing.`,
144
+ ...recordingBody,
97
145
  '',
98
146
  '### Other Rules',
99
147
  '',
100
148
  `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.`,
101
149
  `2. **Don't pause mid-index** for confirmation — keep going until the workspace is indexed or the context limit is hit.`,
102
- `3. **Drift signals** — ${bt}get_node_code${bt} returning ${bt}snapshot_outdated:true${bt} means re-record via ${bt}stage_change${bt}+${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}.`,
103
- `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).`,
150
+ `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}.`,
151
+ `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}.`,
104
152
  '',
105
- '### Available Tools',
153
+ '### A Few Less-Obvious Tools',
106
154
  '',
107
- '| Tool | Use when |',
108
- '|------|----------|',
109
- `| ${bt}search_nodes${bt} | Find code by name, keyword, or reasoning text — auto-falls-back to a regex/string code-content search if nothing matches |`,
110
- `| ${bt}list_nodes${bt} | List nodes in the graph with optional filters (type, file path, etc.) |`,
111
- `| ${bt}get_node_summary${bt} | Get file location, connection count, history count for a node |`,
112
- `| ${bt}get_node_code${bt} | Get ONE node's current source, parsed live from its file (use instead of reading the file) |`,
113
- `| ${bt}get_node_graph${bt} | See a node's callers/dependencies. With ${bt}direction:"out"${bt} + ${bt}include_code:true${bt}, returns an entire call flow WITH source code in a single call |`,
114
- `| ${bt}get_node_history${bt} | Read all past snapshots and reasoning logs for a node |`,
115
- `| ${bt}stage_change${bt} | Buffer one touched node after a code change (code + reasoning only; no edge reasoning) |`,
116
- `| ${bt}commit_changes${bt} | Flush all staged changes: create nodes, save history, resolve all connections via AST |`,
117
- `| ${bt}rename_node${bt} | Rename a node ID and update all its connections/history |`,
118
- `| ${bt}deprecate_node${bt} | Mark a removed function/class as deprecated (preserves history) |`,
119
- `| ${bt}get_recent_changes${bt} | List nodes modified in the last N hours across the project |`,
120
- `| ${bt}get_developer_activity${bt} | List recent changes made by a specific developer |`,
121
- `| ${bt}get_changes_by_requirement${bt} | Find all changes linked to a ticket or requirement ID |`,
122
- `| ${bt}search_decisions${bt} | Search architectural reasoning and decision logs by keyword |`,
123
- `| ${bt}get_orphaned_nodes${bt} | Find nodes with no connections (dead code / stale entries) |`,
124
- `| ${bt}recheck_graph${bt} | Scan files, deprecate nodes for deleted files, clean primitives |`,
125
- `| ${bt}analyze_graph${bt} | Local, zero-token graph health check — god entities, cycles, orphans, dangling edges, renames, and more. ${bt}fix:true${bt} applies safe automatic fixes |`,
126
- `| ${bt}get_visualizer_url${bt} | Get URL to open the interactive 2D/3D graph visualizer |`,
127
- `| ${bt}workflow_list${bt} | List persistent feature workflows — check before starting work that might relate to a paused one |`,
128
- `| ${bt}workflow_create${bt} | Start a new cross-session workflow for a multi-day feature |`,
129
- `| ${bt}workflow_add_step${bt} | Record progress in the active (or a given) workflow's timeline |`,
130
- `| ${bt}workflow_pause${bt} / ${bt}workflow_resume${bt} | Pause the active workflow, or resume a paused one |`,
131
- `| ${bt}workflow_get_context${bt} | Get a workflow's full timeline + artifacts in one call — call right after resuming |`,
132
- `| ${bt}workflow_add_artifact${bt} | Save reference material (spec, ticket, doc excerpt) into a workflow |`,
133
- `| ${bt}workflow_sync_retroactive${bt} | Backfill a workflow's timeline after a session that skipped ${bt}workflow_add_step${bt} |`,
134
- `| ${bt}workflow_import${bt} | Import existing flow/architecture docs as paused, resumable workflows |`,
155
+ `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:`,
135
156
  '',
136
- '> All tool argument schemas are exposed automatically by the MCP server.'
157
+ `* ${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.`,
158
+ `* 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).`,
159
+ `* ${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.`,
160
+ `* ${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.`,
161
+ `* ${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.`,
162
+ `* ${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).`,
163
+ `* ${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.`,
164
+ `* ${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.`,
165
+ `* ${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.`,
166
+ `* ${bt}workflow_import${bt} — turns existing flow/architecture docs into workflows.`,
137
167
  ];
138
168
  return lines.filter(l => l !== null).join('\n');
139
169
  }
140
- function printRuleBanner(rule, projectName, tip) {
170
+ /**
171
+ * A short block meant to be pasted at the START of a fresh AI chat — deliberately separate from
172
+ * the persistent rule file above. The rule file only helps once the agent actually reads it, and
173
+ * a long session can lose track of something it read once at the very beginning; this is the
174
+ * human's manual lever to make a brand-new conversation commit to the rule from its first move,
175
+ * rather than drifting into using DevsMind slowly (or not at all) over the first few turns.
176
+ */
177
+ function buildKickoffPrompt(workflowStyle = 'automatic') {
178
+ const manual = workflowStyle === 'manual';
179
+ 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.";
180
+ const styleLine = manual
181
+ ? ' 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.'
182
+ : ' 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.';
183
+ return base + styleLine;
184
+ }
185
+ function printRuleBanner(rule, kickoff, projectName, tip) {
141
186
  const divider = '═'.repeat(70);
142
187
  console.log(`\n${divider}`);
143
188
  console.log(` DevsMind Workspace Rule — "${projectName}"`);
@@ -153,12 +198,22 @@ function printRuleBanner(rule, projectName, tip) {
153
198
  console.log(` or paste directly into your IDE's AI rules/instructions panel.`);
154
199
  }
155
200
  console.log(`${divider}\n`);
201
+ printKickoffBlock(kickoff);
202
+ }
203
+ function printKickoffBlock(kickoff) {
204
+ const thin = '─'.repeat(70);
205
+ console.log(` 🚀 Session kickoff — paste this at the start of a NEW chat so the agent`);
206
+ console.log(` commits to the rule immediately instead of drifting into it slowly:`);
207
+ console.log(`${thin}\n`);
208
+ console.log(kickoff);
209
+ console.log(`\n${thin}\n`);
156
210
  }
157
211
  /**
158
212
  * `devsmind rule` — print the workspace rule and, interactively, help place it
159
213
  * in the chosen tool's native rules file (manual snippet or automatic write).
160
214
  * Falls back to plain printing when piped/non-TTY or when `--print` is passed,
161
- * preserving `devsmind rule > file` usage.
215
+ * preserving `devsmind rule > file` usage. `--manual` picks the manual workflow
216
+ * style non-interactively (the fallback path has no prompt to ask with).
162
217
  */
163
218
  async function handleRule(opts) {
164
219
  const devmindDir = (0, config_1.resolveDevmindDir)(opts.path);
@@ -177,16 +232,20 @@ async function handleRule(opts) {
177
232
  process.exit(1);
178
233
  return;
179
234
  }
180
- const rule = buildRule(config, devmindDir);
181
235
  const projectName = config.project_name;
182
- // Backward-compat: piped/redirected output or explicit --print → plain print.
236
+ // Backward-compat: piped/redirected output or explicit --print → plain print, no prompts.
183
237
  if (opts.print || !process.stdout.isTTY) {
184
- printRuleBanner(rule, projectName);
238
+ const workflowStyle = opts.manual ? 'manual' : 'automatic';
239
+ const rule = buildRule(config, devmindDir, workflowStyle);
240
+ printRuleBanner(rule, buildKickoffPrompt(workflowStyle), projectName);
185
241
  return;
186
242
  }
187
243
  const workspaceRoot = path.dirname(devmindDir);
188
244
  try {
189
245
  const target = await (0, prompt_1.pickTarget)();
246
+ const workflowStyle = await (0, prompt_1.pickWorkflowStyle)();
247
+ const rule = buildRule(config, devmindDir, workflowStyle);
248
+ const kickoff = buildKickoffPrompt(workflowStyle);
190
249
  const mode = await (0, prompt_1.pickMode)();
191
250
  if (mode === 'manual') {
192
251
  const scope = target.rules.scopes[0];
@@ -194,10 +253,10 @@ async function handleRule(opts) {
194
253
  const noteFrontmatter = target.rules.wrap
195
254
  ? '\n (this file needs frontmatter — automatic mode adds it for you)'
196
255
  : '';
197
- printRuleBanner(rule, projectName, ` 💡 Save this to ${file.replace(/\\/g, '/')}${noteFrontmatter}`);
256
+ printRuleBanner(rule, kickoff, projectName, ` 💡 Save this to ${file.replace(/\\/g, '/')}${noteFrontmatter}`);
198
257
  return;
199
258
  }
200
- // Automatic mode.
259
+ // Automatic mode (install method — writes the rule file for you).
201
260
  const scope = await (0, prompt_1.pickRuleScope)(target);
202
261
  let filePath;
203
262
  if (scope.scope === 'project') {
@@ -221,7 +280,8 @@ async function handleRule(opts) {
221
280
  return;
222
281
  }
223
282
  (0, prompt_1.writeConfigFile)(filePath, merged.content);
224
- console.log(`\n✅ DevsMind rule written to ${filePath.replace(/\\/g, '/')} for ${target.label}.`);
283
+ console.log(`\n✅ DevsMind rule written to ${filePath.replace(/\\/g, '/')} for ${target.label}.\n`);
284
+ printKickoffBlock(kickoff);
225
285
  }
226
286
  catch (err) {
227
287
  if (err instanceof prompt_1.CancelledError) {
@@ -1 +1 @@
1
- {"version":3,"file":"rule.js","sourceRoot":"","sources":["../../src/cli/rule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,8BAiGC;AAyBD,gCAqFC;AAnOD,uCAAyB;AACzB,2CAA6B;AAC7B,4CAAmE;AACnE,kDAS+B;AAC/B,sDAA0E;AAC1E,8CAAwD;AAExD;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAqB,EAAE,UAAkB;IACjE,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC;IACxC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACzB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;IAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAE3B,MAAM,SAAS,GAAG,KAAK;SACpB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,eAAe,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;SACrG,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,QAAQ,GAAG,IAAI;QACnB,CAAC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H,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;