@ninjaxtools/slopdex 0.20.0 → 0.22.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.
package/README.md CHANGED
@@ -19,6 +19,8 @@ The main supported functions are
19
19
  <br/>find clusters of similar code/docs
20
20
  - `slopdex describe <query>`
21
21
  <br/>explain code relevant to a task
22
+ - `slopdex map [PATH]...`
23
+ <br/>show a map/skeleton of the code structure
22
24
 
23
25
  `search` does a vector searche of code, and markdown, and when enabled generated code descriptions.
24
26
 
@@ -26,6 +28,8 @@ The main supported functions are
26
28
 
27
29
  `describe` does a `search` first, then passes the result through the configured LLM model to create a tailored description.
28
30
 
31
+ `map` shows a map/skeleton of the code, excluding implementation details like function bodies. This can be helpful to get a concise map of the code to allow an LLM to explore the codebase incrementally.
32
+
29
33
  ## Installation
30
34
 
31
35
  Install from npm:
@@ -44,7 +48,8 @@ cargo install --path . --locked
44
48
 
45
49
  ## Getting started
46
50
 
47
- An embedding-provider API key is required. You can use either OpenAI or Jina.
51
+ Semantic search requires an embedding-provider API key from OpenAI or Jina. `slopdex map` doesn't
52
+ use vector search and works locally without a provider or API key.
48
53
 
49
54
  ```console
50
55
  $ export OPENAI_API_KEY="your-api-key"
@@ -54,6 +59,19 @@ $ slopdex search "validate an authenticated session"
54
59
 
55
60
  The index tracks the current git commit and is created or updated on every command and stored in `.slopdex/index.sqlite`. Add `.slopdex/` to your repository's `.gitignore` to prevent it from being committed.
56
61
 
62
+ ### Code map/skeleton
63
+
64
+ ```console
65
+ $ slopdex map src docs
66
+ $ slopdex map src -g '*.rs' -k fns -e 'refresh|search'
67
+ $ slopdex map -g '*.md' -e '^Guide\.Setup' -i --format json
68
+ $ slopdex map --no-reindex
69
+ ```
70
+
71
+ The `map` command can be used to generate a source code skeleton that strips most of the code implementation but retains many of the structurally useful information that can act as an index into the source code. The resulting index output is most useful to conserve tokens and improve the agentic programming experience.
72
+
73
+ See the [selector reference](docs/reference.md#shared-selectors).
74
+
57
75
  ### Search
58
76
 
59
77
  By default all available indexes are searched and ranked together.
@@ -179,8 +197,10 @@ $ slopdex cross-search --cross-file-only --cohesion --threshold 0.8
179
197
  Just put this in your `AGENTS.md` file, no skill required:
180
198
 
181
199
  ```
200
+ - use `slopdex map -g <glob> <files or directories...>` to obtain a compact structural code skeleton, and then perform targeted reads for implementation details. Line numbers are indicated in square brackets (e.g [5] means line 5, and [5-10] means lines 5 to 10). To filter for specific symbols, use `-e`. To only include specific kinds of symbols use `-k` with `imports`, `fns`, `consts`, `types`, or `classes`. For example: `slopdex map -g "*.ts" -i -e "manager|main" src`.
182
201
  - use semantic code search to find code with: `slopdex search "..." --threshold 0.5`
183
202
  - when reviewing uncommitted code avoid introducing duplicates by looking for related matches: `slopdex cross-search --uncommitted --threshold 0.8`
203
+ - don't use `*` as the glob since that circumvents the default ignore rules.
184
204
  ```
185
205
 
186
206
  Any other use, like doing a full `cross-search` is probably better done interactively with the agent, in which case you can just ask the agent to run `slopdex --help` to get usage information.
@@ -19,7 +19,7 @@
19
19
  "hasInstallScript": true,
20
20
  "license": "MIT",
21
21
  "name": "@ninjaxtools/slopdex",
22
- "version": "0.20.0"
22
+ "version": "0.22.0"
23
23
  },
24
24
  "node_modules/detect-libc": {
25
25
  "engines": {
@@ -48,5 +48,5 @@
48
48
  }
49
49
  },
50
50
  "requires": true,
51
- "version": "0.20.0"
51
+ "version": "0.22.0"
52
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "artifactDownloadUrls": [
3
- "https://github.com/ninjaxtools/slopdex/releases/download/v0.20.0"
3
+ "https://github.com/ninjaxtools/slopdex/releases/download/v0.22.0"
4
4
  ],
5
5
  "bin": {
6
6
  "slopdex": "run-slopdex.js"
@@ -80,7 +80,7 @@
80
80
  "zipExt": ".tar.xz"
81
81
  }
82
82
  },
83
- "version": "0.20.0",
83
+ "version": "0.22.0",
84
84
  "volta": {
85
85
  "node": "18.14.1",
86
86
  "npm": "9.5.0"