@ninjaxtools/slopdex 0.26.0 → 0.28.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
@@ -22,7 +22,7 @@ The main supported functions are
22
22
  - `slopdex map [PATH]...`
23
23
  <br/>show a map/skeleton of the code structure
24
24
 
25
- `search` does a vector searche of code, and markdown, and when enabled generated code descriptions.
25
+ `search` does a vector search of code, configuration and markup files, and, when enabled, generated code descriptions.
26
26
 
27
27
  `cross-search` also does a vector search but compares all functions with each other (scope can be limited with additional options) and helps with finding duplicated code, or code that is not necessarily duplicated but spread out across the codebase (with `--cohesion`).
28
28
 
@@ -56,7 +56,7 @@ $ slopdex search "validate an authenticated session"
56
56
  ...
57
57
  ```
58
58
 
59
- 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.
59
+ The index tracks the current Git commit and is created or updated on every command that uses it. Index data is stored in the current user's cache folder and project settings are stored in `.slopdex/config.json` (add `.slopdex` to `.gitignore`). See also [cache configuration](docs/reference.md#shared-provider-artifacts).
60
60
 
61
61
  ### Code map/skeleton
62
62
 
@@ -70,7 +70,7 @@ $ slopdex map -g '*.md' -e '^Guide\.Setup' -i --format json
70
70
  $ slopdex map --no-reindex
71
71
  ```
72
72
 
73
- 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.
73
+ The `map` command can be used to generate a source code skeleton that strips most of the code implementation but retains structurally useful information that can act as an index into the source code, which improves context usage.
74
74
 
75
75
  See the [selector reference](docs/reference.md#shared-selectors).
76
76
 
@@ -112,21 +112,22 @@ $ export OPENAI_API_KEY="your-api-key"
112
112
  # Or
113
113
  # opencode auth login # use stored credentials instead of env variables
114
114
 
115
- $ slopdex descriptions enable
115
+ $ slopdex config set descriptionsEnabled true
116
116
  $ slopdex search-descriptions "keep the repository index synchronized"
117
117
  ```
118
118
 
119
119
  You can list and configure one of OpenCode's models like this (or use the interactive config):
120
120
 
121
121
  ```console
122
- $ slopdex models opencode-go
123
- $ slopdex config model opencode-go/gpt-5.6-luna
124
- $ slopdex config fallback-model opencode-go/muse-spark-1.3-contributor
122
+ $ slopdex help models opencode-go
123
+ $ slopdex config set descriptionProvider opencode-go
124
+ $ slopdex config set descriptionModel gpt-5.6-luna
125
+ $ slopdex config set descriptionFallbackModel muse-spark-1.3-contributor
125
126
  ```
126
127
 
127
128
  The fallback-model is used if the main model reports an error, and if the fallback-model reports an error the main model is tried again.
128
129
 
129
- File and function descriptions are cached. Function descriptions will only be regenerated when functions change. File descriptions need to be regenerated explcitily with the `reindex-files` command.
130
+ File and function descriptions are cached by source and description context, so renaming a file can reuse its descriptions. Function changes or a changed file-description context can require new callable descriptions. File descriptions after edits can be refreshed explicitly with `index reindex-files`.
130
131
 
131
132
  ### Interactive Config
132
133
 
@@ -144,7 +145,7 @@ The intention of the `describe` command is to use a low-cost model to summarise
144
145
  $ slopdex describe "I want to implement a new rpc endpoint"
145
146
  ```
146
147
 
147
- For the best matching files (configured with `--describe-full-file-threshold`, default `0.8`) the full file contents are used.
148
+ The LLM receives expanded text search results with indexed code from callers and callees up to two edges away by default; it does not receive whole-file source.
148
149
 
149
150
  ### Find duplicate code
150
151
 
@@ -213,26 +214,25 @@ $ slopdex cross-search --cross-file-only --cohesion --threshold 0.8
213
214
  ```
214
215
  ### Use with agents
215
216
 
216
- Just put this in your `AGENTS.md` file, no skill required:
217
+ Just put this in your `AGENTS.md` file and adjust as desired, no skill necessary:
217
218
 
218
219
  ```
219
- - 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`.
220
- - use semantic code search to find code with: `slopdex search "..." --threshold 0.5`
221
- - when reviewing uncommitted code avoid introducing duplicates by looking for related matches: `slopdex cross-search --uncommitted --threshold 0.8`
222
- - don't use `*` as the glob since that circumvents the default ignore rules.
220
+ - use `slopdex map -g "<glob>" -i -e "<regex>" <files or directories...>` to obtain a compact structural code skeleton, and then perform targeted reads using the line numbers for implementation details. To filter for specific symbols, use `-e`. To only include specific kinds of symbols use `-k` with `imports`, `fns`, `consts`, `types`, or `classes`.
221
+ - use semantic code search to find code with: `slopdex search "<query>" --threshold 0.5`; vary the search query if you get no results
222
+ - when reviewing uncommitted code avoid introducing duplicates by looking for related matches: `slopdex cross-search --uncommitted --cross-file-only --threshold 0.8`
223
+ - when tasked to do advanced codebase analysis, use `slopdex --help` first to see all options
223
224
  ```
224
225
 
225
- 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.
226
-
227
226
  ### Reranking
228
227
 
229
228
  Optionally a second-stage reranker can be enabled for all query-search commands:
230
229
 
231
230
  ```console
232
231
  $ export COHERE_API_KEY="your-api-key"
233
- $ slopdex config reranker cohere
234
- # Or: export JINA_API_KEY="your-api-key" && slopdex config reranker jina
235
- # Or use an LLM: export OPENAI_API_KEY="your-api-key" && slopdex config reranker openai
232
+ $ slopdex config set rerankerProvider cohere
233
+ $ slopdex config set rerankingEnabled true
234
+ # Or: export JINA_API_KEY="your-api-key" && slopdex config set rerankerProvider jina
235
+ # Or use an LLM: export OPENAI_API_KEY="your-api-key" && slopdex config set rerankerProvider openai
236
236
  ```
237
237
 
238
238
  ### Compare repositories
@@ -240,17 +240,19 @@ $ slopdex config reranker cohere
240
240
  ```console
241
241
  $ slopdex cross-search \
242
242
  --target-root /path/to/other/repo \
243
- --target-index /path/to/other/repo/.slopdex/index.sqlite \
243
+ --target-index /path/to/other/index.sqlite \
244
244
  --threshold 0.9
245
245
  ```
246
246
 
247
+ Pass the target's `indexPath` from `slopdex --root /path/to/other/repo --format json status` (or a custom `--index` path) as `--target-index`.
248
+
247
249
  ### Inspect index health
248
250
 
249
- If some functions can't be indexed a warning is printed. Index errors can be investigated and fixed with the `index-errors` command to ensure the index is complete.
251
+ If some functions can't be indexed a warning is printed. Index errors can be investigated and fixed with the `index errors` command to ensure the index is complete.
250
252
 
251
253
  ```console
252
254
  $ slopdex status
253
- $ slopdex index-errors --format summary
255
+ $ slopdex index errors --format summary
254
256
  $ slopdex --version
255
257
  ```
256
258
 
@@ -19,7 +19,7 @@
19
19
  "hasInstallScript": true,
20
20
  "license": "MIT",
21
21
  "name": "@ninjaxtools/slopdex",
22
- "version": "0.26.0"
22
+ "version": "0.28.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.26.0"
51
+ "version": "0.28.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.26.0"
3
+ "https://github.com/ninjaxtools/slopdex/releases/download/v0.28.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.26.0",
83
+ "version": "0.28.0",
84
84
  "volta": {
85
85
  "node": "18.14.1",
86
86
  "npm": "9.5.0"