@m1khal3v/dsh-tool-codegraph 1.0.0 → 1.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.
package/README.md CHANGED
@@ -36,7 +36,7 @@
36
36
  ### 1. Install the plugin
37
37
 
38
38
  ```sh
39
- dsh plugin add @m1khal3v/dsh-tool-codegraph
39
+ dsh plugin add --profile web @m1khal3v/dsh-tool-codegraph
40
40
  ```
41
41
 
42
42
  ### 2. Check the wrapped CLI
@@ -46,7 +46,20 @@ codegraph status
46
46
  ```
47
47
 
48
48
  If the binary is missing, the tools reply with an install hint and the agent
49
- falls back to `bash`/`grep`.
49
+ falls back to `grep`-based search.
50
+
51
+ ### 3. Initialize the index — your call
52
+
53
+ There is deliberately **no init tool** in the set above: following the codegraph
54
+ project's own recommendation, indexing should be kicked off by the user, not by
55
+ an agent. When `codegraph status` reports a missing index, run it yourself:
56
+
57
+ ```sh
58
+ codegraph init
59
+ ```
60
+
61
+ Until you do, the tools report the missing index and the agent keeps working
62
+ with other search tools.
50
63
 
51
64
  ## 🧰 Tools
52
65
 
package/lib/index.d.ts CHANGED
@@ -11,9 +11,9 @@
11
11
  *
12
12
  * A system-prompt section teaches the model the orientation-first workflow:
13
13
  * status first; a missing index is the user's decision (the model tells the
14
- * user to run `codegraph init` and keeps working with bash/grep meanwhile);
14
+ * user to run `codegraph init` and keeps working with other tools meanwhile);
15
15
  * sync when stale; then lookups; callers/callees/impact are accelerators, not
16
- * exhaustive proofs — exhaustive searches fall back to bash/grep.
16
+ * exhaustive proofs — exhaustive searches fall back to grep.
17
17
  *
18
18
  * Execution follows the canonical-value flow: `execute` returns the structured
19
19
  * `CodegraphResult` validated against `CODEGRAPH_OUTPUT_SCHEMA`, and the
package/lib/index.js CHANGED
@@ -53,7 +53,7 @@ function extractModelText(result) {
53
53
  if (result.exitCode === 0) return (result.stdout.text.length > 0 ? result.stdout.text : NO_OUTPUT) + truncationMarker(result.stdout);
54
54
  const stderr = result.stderr.text;
55
55
  let text = stderr;
56
- if (detectBinaryNotFound(stderr, result.exitCode ?? 0)) text += "\n[Codegraph executable not found. Please install it or rely on bash/grep.]";
56
+ if (detectBinaryNotFound(stderr, result.exitCode ?? 0)) text += "\n[Codegraph executable not found. Please install it or rely on grep (or similar) instead.]";
57
57
  if (detectIndexMissing(stderr)) text += "\n[Codegraph error: Index missing. Run codegraph_init first.]";
58
58
  return text;
59
59
  }
@@ -207,9 +207,9 @@ const codegraphToolSpecs = [
207
207
  *
208
208
  * A system-prompt section teaches the model the orientation-first workflow:
209
209
  * status first; a missing index is the user's decision (the model tells the
210
- * user to run `codegraph init` and keeps working with bash/grep meanwhile);
210
+ * user to run `codegraph init` and keeps working with other tools meanwhile);
211
211
  * sync when stale; then lookups; callers/callees/impact are accelerators, not
212
- * exhaustive proofs — exhaustive searches fall back to bash/grep.
212
+ * exhaustive proofs — exhaustive searches fall back to grep.
213
213
  *
214
214
  * Execution follows the canonical-value flow: `execute` returns the structured
215
215
  * `CodegraphResult` validated against `CODEGRAPH_OUTPUT_SCHEMA`, and the
@@ -246,11 +246,11 @@ function canonicalPath(input) {
246
246
  }
247
247
  /** System-prompt section text, verbatim contract of the tool catalog workflow. */
248
248
  const CODEGRAPH_PROMPT = `CodeGraph Usage Rules:
249
- - Workflow: ALWAYS check \`codegraph_status\` once per session first. If the index is missing, do NOT build it yourself — indexing is the user's decision: tell the user to run \`codegraph init\`, and continue with bash/grep meanwhile. If stale, run \`codegraph_sync\`.
249
+ - Workflow: ALWAYS check \`codegraph_status\` once per session first. If the index is missing, do NOT build it yourself — indexing is the user's decision: tell the user to run \`codegraph init\`, and continue with other tools meanwhile. If stale, run \`codegraph_sync\`.
250
250
  - Orientation: Use \`codegraph_explore\` for mapping architecture or "how X works". Use \`codegraph_callers\` / \`codegraph_callees\` / \`codegraph_node\` for targeted lookups.
251
251
  - Subagents: For deep exploration, spawn a subagent and explicitly instruct it to use \`codegraph_explore\` — its verbatim source blocks are heavy, so keep them out of the main session.
252
252
  - DO NOT trust callers/callees/impact for completeness! They silently drop unresolved method/generic/trait-dispatch edges.
253
- - For exhaustive searches (e.g., finding ALL callers before a rename or signature change), you MUST use \`bash\` with \`grep\` or \`rg\`. Codegraph is only an accelerator.
253
+ - For 100% accuracy (e.g., finding ALL callers before a rename or signature change), use \`grep\` or similar. Codegraph is only an accelerator.
254
254
  - Overloaded names: Do not query overloaded names with bare callers/callees. Use \`codegraph_node\` on a specific symbol ID or use grep.`;
255
255
  /**
256
256
  * Output contract validated against every successful `execute` value. The
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m1khal3v/dsh-tool-codegraph",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "CodeGraph integration for DeepSeek Harness",
5
5
  "license": "MIT",
6
6
  "author": "m1khal3v",