sift-light 1.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 (145) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/CONTRIBUTING.md +19 -0
  3. package/LICENSE +661 -0
  4. package/README.md +177 -0
  5. package/README.zh-CN.md +177 -0
  6. package/SECURITY.md +25 -0
  7. package/package.json +142 -0
  8. package/plugins/sift-light/.claude-plugin/plugin.json +10 -0
  9. package/plugins/sift-light/.codex-plugin/plugin.json +20 -0
  10. package/plugins/sift-light/.mcp.json +24 -0
  11. package/plugins/sift-light/LICENSE +661 -0
  12. package/plugins/sift-light/concept-worker.mjs +567 -0
  13. package/plugins/sift-light/hooks/THIRD_PARTY_NOTICES.txt +70 -0
  14. package/plugins/sift-light/hooks/hooks.json +16 -0
  15. package/plugins/sift-light/hooks/search-policy.mjs +4113 -0
  16. package/plugins/sift-light/hooks/tree-sitter-bash.wasm +0 -0
  17. package/plugins/sift-light/hooks/tree-sitter-powershell.wasm +0 -0
  18. package/plugins/sift-light/hooks/tree-sitter.wasm +0 -0
  19. package/plugins/sift-light/kimi.plugin.json +36 -0
  20. package/plugins/sift-light/mcp-server.mjs +1 -0
  21. package/plugins/sift-light/omp-extension.mjs +20914 -0
  22. package/plugins/sift-light/package.json +11 -0
  23. package/plugins/sift-light/syntax-worker.mjs +280 -0
  24. package/plugins/sift-light/syntax-worker.toml +2 -0
  25. package/src/analysis-evidence.ts +43 -0
  26. package/src/analysis-limits.ts +27 -0
  27. package/src/analysis-store.ts +559 -0
  28. package/src/analysis-term-pages.ts +73 -0
  29. package/src/analysis-types.ts +162 -0
  30. package/src/audit-search.ts +391 -0
  31. package/src/capped-lines.ts +112 -0
  32. package/src/concept-embedding-cache.ts +186 -0
  33. package/src/concept-inference.ts +218 -0
  34. package/src/concept-model.ts +96 -0
  35. package/src/concept-search.ts +577 -0
  36. package/src/concept-setup.ts +75 -0
  37. package/src/concept-source-generation.ts +268 -0
  38. package/src/concept-worker.mjs +567 -0
  39. package/src/concept-worker.ts +210 -0
  40. package/src/config-reader.ts +283 -0
  41. package/src/config.ts +37 -0
  42. package/src/context-budget.ts +26 -0
  43. package/src/discovery-errors.ts +2 -0
  44. package/src/errors.ts +95 -0
  45. package/src/evidence-candidates.ts +344 -0
  46. package/src/evidence-ranking.ts +48 -0
  47. package/src/evidence-service.ts +1047 -0
  48. package/src/evidence-validation.ts +466 -0
  49. package/src/evidence-validity.ts +33 -0
  50. package/src/excerpt.ts +53 -0
  51. package/src/file-discovery.ts +150 -0
  52. package/src/file-metadata-filter.ts +46 -0
  53. package/src/format.ts +407 -0
  54. package/src/git-diff.ts +195 -0
  55. package/src/git-process.ts +189 -0
  56. package/src/git-repository.ts +367 -0
  57. package/src/git-source.ts +385 -0
  58. package/src/historical-paths.ts +205 -0
  59. package/src/hybrid-search.ts +340 -0
  60. package/src/import-model.ts +611 -0
  61. package/src/import-navigation.ts +100 -0
  62. package/src/import-resolution.ts +240 -0
  63. package/src/index.ts +97 -0
  64. package/src/inspect-batch.ts +265 -0
  65. package/src/inspect.ts +271 -0
  66. package/src/language-capabilities.ts +157 -0
  67. package/src/language-capability-definitions.ts +204 -0
  68. package/src/literal-search.ts +25 -0
  69. package/src/mcp-cli.ts +21 -0
  70. package/src/mcp-model-output.ts +120 -0
  71. package/src/mcp-output.ts +9 -0
  72. package/src/mcp-semantic-judge.ts +39 -0
  73. package/src/mcp-server.mjs +14064 -0
  74. package/src/mcp-server.ts +157 -0
  75. package/src/mcp-stdio.ts +114 -0
  76. package/src/mcp.ts +631 -0
  77. package/src/model-error.ts +120 -0
  78. package/src/multi-term-search.ts +122 -0
  79. package/src/omp-index.ts +277 -0
  80. package/src/omp-marketplace-entry.ts +7 -0
  81. package/src/operation-lifecycle.ts +413 -0
  82. package/src/operation-output.ts +100 -0
  83. package/src/owned-parallel.ts +22 -0
  84. package/src/owned-process.ts +102 -0
  85. package/src/owned-task-queue.ts +38 -0
  86. package/src/package-version.ts +3 -0
  87. package/src/path-policy.ts +203 -0
  88. package/src/pi-search-policy.ts +33 -0
  89. package/src/prompt-guidelines.ts +54 -0
  90. package/src/python-outline.ts +231 -0
  91. package/src/record-value.ts +3 -0
  92. package/src/redaction.ts +95 -0
  93. package/src/request-contract-catalog.ts +215 -0
  94. package/src/request-contract-error.ts +96 -0
  95. package/src/request-contract.ts +481 -0
  96. package/src/request.ts +132 -0
  97. package/src/result-statistics.ts +178 -0
  98. package/src/rg.ts +574 -0
  99. package/src/ripgrep-diagnostics.ts +122 -0
  100. package/src/ripgrep-executable.ts +43 -0
  101. package/src/runtime.ts +53 -0
  102. package/src/scan-revisions.ts +148 -0
  103. package/src/script-runtime.ts +11 -0
  104. package/src/search-policy-commands.ts +170 -0
  105. package/src/search-policy-hook.ts +61 -0
  106. package/src/search-policy-recovery.ts +388 -0
  107. package/src/search-policy-shell.ts +280 -0
  108. package/src/search-policy.ts +102 -0
  109. package/src/search-retention.ts +77 -0
  110. package/src/semantic-judge-batches.ts +135 -0
  111. package/src/semantic-judge.ts +519 -0
  112. package/src/service.ts +945 -0
  113. package/src/session-summary.ts +100 -0
  114. package/src/snapshot-store.ts +203 -0
  115. package/src/source-access.ts +288 -0
  116. package/src/source-continuations.ts +168 -0
  117. package/src/source-document.ts +277 -0
  118. package/src/source-inspection.ts +731 -0
  119. package/src/source-pages.ts +112 -0
  120. package/src/source.ts +286 -0
  121. package/src/structural-search.ts +125 -0
  122. package/src/structure.ts +259 -0
  123. package/src/summary-previews.ts +96 -0
  124. package/src/summary.ts +79 -0
  125. package/src/syntax-facts.ts +464 -0
  126. package/src/syntax-fields.ts +161 -0
  127. package/src/syntax-search.ts +361 -0
  128. package/src/syntax-tree.ts +30 -0
  129. package/src/syntax-types.ts +72 -0
  130. package/src/syntax-worker.mjs +280 -0
  131. package/src/syntax-worker.toml +2 -0
  132. package/src/syntax-worker.ts +143 -0
  133. package/src/syntax.ts +259 -0
  134. package/src/test-navigation-facts.ts +261 -0
  135. package/src/test-navigation.ts +543 -0
  136. package/src/tool-schema.ts +321 -0
  137. package/src/tui/dashboard.ts +107 -0
  138. package/src/tui/layout.ts +291 -0
  139. package/src/tui/palette.ts +73 -0
  140. package/src/tui/presentation.ts +240 -0
  141. package/src/tui/renderers.ts +106 -0
  142. package/src/types.ts +368 -0
  143. package/src/validation-output.ts +148 -0
  144. package/src/validation-types.ts +48 -0
  145. package/src/workspace-files.ts +142 -0
package/README.md ADDED
@@ -0,0 +1,177 @@
1
+ # sift-light
2
+
3
+ English · [简体中文](README.zh-CN.md)
4
+
5
+ **sift-light — Evidence-first search for AI agents.**
6
+
7
+ **A general-purpose local search plugin that helps agents find files, documents, notes, logs and other text material.**
8
+
9
+ Think of a patient librarian: describe what you need, and it helps locate the shelf, open the relevant page and follow the next lead. A small search brings the passages straight to you. A broad search starts with a map so you can decide where to look first.
10
+
11
+ ## How it helps
12
+
13
+ ### Find a passage without opening every folder
14
+
15
+ Looking for an error message, a sentence or a name is like giving a librarian a keyword. When there are only a few matches, the plugin returns their text and locations directly, saving repeated file opening and scrolling.
16
+
17
+ ### Start with a map when the collection is large
18
+
19
+ “Which documents mention refunds?” can produce a lot of material. The plugin first presents matching files and snippets, like marking promising stops on a map. The agent can choose what to open before filling the conversation with entire documents.
20
+
21
+ ### Keep your bookmark for the next question
22
+
23
+ “Continue from where we stopped” can follow the existing result to its next page. The agent can also open the surrounding text of a match, like returning to a bookmarked passage to read what came before and after it.
24
+
25
+ ### Recover when the remembered wording is not exact
26
+
27
+ Use `mode: "hybrid"` with one natural-language `query` when a sentence may have been remembered with different wording. Hybrid always runs an exact literal search and the installed local Concept model under one owned request. Exact evidence appears first; semantic candidates are clearly labeled, ranked only by similarity and removed when they overlap an exact match. The initial page shares counts, coverage, source references, one inspection cursor and a compact preview instead of concatenating two complete responses. `conceptLimit` changes only the non-overlapping semantic supplement (default 3, maximum 20); it never displaces literal evidence. The returned matches request opens the same snapshot's complete exact-first pagination without rerunning either search.
28
+
29
+ Concept ranking covers every UTF-8 passage admitted by the request's documented source budget; it no longer samples a fixed prefix of the scope. Concept and hybrid searches automatically admit up to 2,000 files and process them sequentially in bounded 200-file batches, then merge every batch into one global ranking and one coverage result. Batches share the request's 32 MiB read budget, so raising the file ceiling does not multiply the content budget. Users do not need to plan or continue batches themselves. `maxFilesToParse` remains an optional advanced hard ceiling when a smaller scope is intentional. Passages that exceed the model token window are ranked through overlapping token-safe windows, so later text is not silently discarded. Offline embeddings are cached by content, model revision and chunking revision in a bounded 512 MiB local cache. Repeated content is reused, changed content misses naturally, and cache write or cleanup failures remain visible in the result.
30
+
31
+ Slow Concept and hybrid requests return within the default five-second wait window with `status: "waiting"` or `"running"`, an `operationId`, progress and an exact `nextRequest` such as `{ "mode": "await", "operationId": "..." }`. Copy that request unchanged: it resumes the same computation and never restarts the query or downgrades to a literal-only result. A final result remains available for stable re-fetch for 10 minutes, with up to 32 terminal results retained per service session, and `mode: "cancel"` stops the owned work and waits for cleanup. Each service session admits at most eight pending operations; an operation has one total deadline controlled by `SIFT_LIGHT_CONCEPT_TIMEOUT_MS` (integer milliseconds from 1000 through 3600000; default 600000) and a 120-second idle continuation lease. A real model, source or resource failure is returned as a failure with its diagnostic. Source generation is re-enumerated and re-verified before publication, so changes refresh the operation and mixed versions are never marked complete. Admission planning counts (`filesEnumerated`, `filesAdmitted`, `filesSkippedEmpty`, `filesUnavailable`, `passagesQueued`, `batchesPlanned`, `batchesCompleted`) stay visible. Empty files are a normal skip and do not mark the result partial.
32
+
33
+ ### Give several search conditions together
34
+
35
+ “Find files mentioning both the customer and a refund” works like selecting documents with two labels. “Any of these words will do” works like handing over a shortlist. Multiple conditions can be expressed together to reduce repeated searches.
36
+
37
+ ### Choose the drawer you want searched
38
+
39
+ Ask the agent to restrict a search to one folder when that is the scope you need. If you remember only part of a filename, start by finding the file and then inspect its contents—like narrowing a cabinet down to a shelf and then a document.
40
+
41
+ Multi-word `files` queries require each word literally in the path; a single abbreviation still supports fuzzy matching. Use `hybrid` or `concept` for business intent. Ordinary content searches retain their default zero-result expansion; use `scope: "strict"` to stay within an explicit path. Expansion is announced before returned evidence.
42
+
43
+ ### Know what has been shown
44
+
45
+ Long results arrive in pages with a way to continue. When the original material changes, the plugin asks for a fresh check. Like a careful research assistant, it distinguishes the passages already shown from the pages still to come.
46
+
47
+ A complete snapshot describes match retention, not complete source text. Truncated matching-line excerpts show their limit and an executable `inspectRequest`, which remains usable after the final match page. Follow pagination cursors instead of repeating the query with a different limit.
48
+ In Pi and OMP, the passive session status includes the loaded package version, counts returned new queries, distinguishes complete, partial and unfinished results, and reports non-cancelled failed calls. Cursor and operation continuations do not inflate the new-query count.
49
+
50
+ Ordinary searches keep repository ignore rules, but now report policy-filtered filesystem coverage instead of calling an absence exhaustive when ignored files exist. Use `mode: "audit"` with named literal `patterns` for one bounded receipt covering declared scope, enumerated/searched/skipped files, ignored-file policy, per-pattern `present`/`absent_with_complete_coverage`/`unknown` findings, and start/end source stability. Set `ignorePolicy: "include"` when an audit must include ignored configuration and generated files; `.git` internals and protected paths remain excluded.
51
+
52
+ ### Discover language capabilities before loading a provider
53
+
54
+ Use `mode: "capabilities"` with the project root for a compact, names-only inventory. JavaScript, TypeScript and TSX support AST structure, roles, outline, static imports and related-test candidates. Go supports AST structure and roles. Python supports bounded indentation-based outline. Swift and other languages remain available to ordinary content search, filename discovery and source inspection. Capability inventory does not start parsers or the Concept model.
55
+
56
+ Language-service navigation is out of scope. Asking for `definitions`, `references`, `implementations`, `callers`, `callees`, `dependencies`, `dependents`, `trace` or `impact` fails explicitly, because a text search dressed up as precise navigation would be a worse answer than a clear refusal. No language server runs while you work.
57
+
58
+ ### Check saved source evidence
59
+
60
+ Use `mode: "validate"` with a saved ordinary-search or analysis `cursor`, optionally selecting a `matchIndex`. Validation compares retained sources with the current worktree or their pinned Git objects, reports `current`, `stale` or `unknown`, and preserves incomplete search coverage. Structured metadata is under `details.validation` and `details.analysis.validation`; the removed graph fields and trace cursors are no longer supported. Validation checks sources on demand and does not run background watchers. It checks saved evidence, not whether new matching files have appeared since the search.
61
+
62
+ ### Narrow by file age or inspect code structure
63
+
64
+ Worktree searches can use `modifiedAfter` and `modifiedBefore` as Unix millisecond bounds. The lower bound is inclusive and the upper bound is exclusive, so a time window can be expressed without changing the search pattern. The same filter applies to content and filename searches; unavailable file metadata is reported as incomplete evidence rather than silently treated as a match.
65
+
66
+ Use `mode: "outline"` with a concrete JS/TS/TSX or Python file to see bounded symbol ranges. JS/TS/TSX use ast-grep; Python uses indentation-based class, function and method evidence. These ranges do not prove compiler bindings, runtime calls or test coverage. `mode: "tests"` provides JS/TS/TSX related-test candidates; unsupported language operations fail explicitly. Use ordinary search and `inspect` for Swift source.
67
+
68
+ The readable result keeps the main evidence compact. Per-item ranges, counts, coverage and continuation requests remain in structured `details`, so a client can use the structured fields without requiring a second search.
69
+
70
+ ## Common uses
71
+
72
+ Tell your agent what you need, for example:
73
+
74
+ - “Which documents mention the refund deadline?”
75
+ - “Find this error in the logs and show the surrounding messages.”
76
+ - “Find files containing both the customer name and the order number.”
77
+ - “List matches for any of these keywords.”
78
+ - “I remember part of the meeting-notes filename. Help me find it.”
79
+ - “Search only this folder; do not expand the scope.”
80
+ - “Show me which files contain relevant text, then open two of them.”
81
+ - “Continue from the previous page and show the remaining passages.”
82
+ - “Search files modified since this Unix millisecond timestamp.”
83
+ - “I may remember this sentence incorrectly; search exact and semantic evidence together.”
84
+ - “Show the Python classes and functions in this file, then inspect the method that matters.”
85
+ - “Find this function name in source, inspect the relevant occurrences, then validate the saved evidence after I edit the file.”
86
+
87
+ The plugin provides file locations and actual text so the agent can answer from the material and you can check the original yourself.
88
+
89
+ ## Install
90
+
91
+ MCP needs Node.js 22.19+. Pi needs Pi 0.84.3+ with Node.js 22.19+ or Bun 1.4+. The search engine ships with the package for each supported platform, so no system search tool, shell function or `PATH` setup is required, and a search never downloads anything. Install with optional dependencies enabled.
92
+
93
+ When upgrading from a release published under an earlier package identity, remove that earlier plugin and MCP registration before installing sift-light. This avoids loading two search tools or enforcement hooks in the same host.
94
+
95
+ To use your own ripgrep, set `SIFT_LIGHT_RG_PATH` to the absolute path of the executable in the MCP server or Pi process environment, then restart the host. It applies to content, filename and Git-source searches. Paths containing spaces work; aliases, shell functions, relative paths and `~` are not expanded. An unusable value fails explicitly instead of silently choosing another executable. If the bundled engine is missing, reinstall with optional dependencies enabled or point this setting at your own binary.
96
+
97
+ ### Pi
98
+
99
+ ```bash
100
+ pi install npm:sift-light
101
+ ```
102
+
103
+ Restart Pi after installing or updating. Pi uses this plugin for conventional searches by default; reads, edits, tests, builds and scripts remain available. `enforceSearch` accepts `"hard"` (the default), `"prefer"` (keep the dedicated tool and guidance without denying alternative searches), or `"off"`. Boolean values and unknown configuration fields are rejected. Configure it in `~/.pi/agent/sift-light.json`, then restart. Set `"locale": "zh-CN"` there for the Chinese interface.
104
+
105
+ ### OMP (Oh My Pi)
106
+
107
+ ```bash
108
+ omp install npm:sift-light@latest
109
+ ```
110
+
111
+ Restart OMP after installing or updating. The package declares its native OMP extension and registers `sift-light`. In the default hard mode it removes OMP's built-in `grep` and `glob` entries from the active tool set and blocks direct search commands while leaving reads, edits, tests, builds and other development tools available. Prefer mode keeps both the dedicated and alternative tools active, adds model guidance, and does not deny shell searches. OMP's active profile is respected; the default configuration file is `~/.omp/agent/sift-light.json`, and a named profile uses `~/.omp/profiles/<profile>/agent/sift-light.json`. Set `enforceSearch` to `"hard"` (default), `"prefer"`, or `"off"` in the active file, then restart OMP. Only these current string values are accepted; boolean values and unknown configuration fields are rejected. Set `"locale": "zh-CN"` to use the Chinese interface.
112
+
113
+ ### Optional semantic judge
114
+
115
+ Hybrid search remains local-only by default. An optional semantic judge can classify retained concept candidates and improve ordering, but it never replaces local matching, source inspection, pagination, or verification.
116
+
117
+ The feature is enabled only when `semanticJudge.enabled` is explicitly set to `true`. Merely defining the environment variable does not activate network access. Keep the credential in the process environment; do not put the credential value in this file:
118
+
119
+ ```json
120
+ {
121
+ "locale": "en",
122
+ "enforceSearch": "hard",
123
+ "semanticJudge": {
124
+ "enabled": false,
125
+ "provider": "jev",
126
+ "apiKeyEnv": "TYPESAFE_API_KEY",
127
+ "model": "jev-latest",
128
+ "timeoutMs": 120000,
129
+ "maxCandidates": 20,
130
+ "maxRetries": 2
131
+ }
132
+ }
133
+ ```
134
+
135
+ When enabled, the configured endpoint receives only the query and bounded candidate excerpts. Up to eight candidates and 64 KiB are sent per request. Independent batches run under the existing 20-candidate ceiling; an HTTP 413 response splits only that batch. If one batch fails, its candidates keep their local order while successful batches still contribute classifications, and the result reports partial coverage with judged/unjudged candidate and batch counts. A missing key still fails configuration explicitly, local candidates are never removed by a provider failure, and semantic classification is not runtime proof.
136
+
137
+ ### Claude Code or Codex: MCP connection
138
+
139
+ ```bash
140
+ claude mcp add sift-light -- npx -y --package sift-light@latest sift-light-mcp --stdio
141
+ ```
142
+
143
+ ```bash
144
+ codex mcp add sift-light -- npx -y --package sift-light@latest sift-light-mcp --stdio
145
+ ```
146
+
147
+ `@latest` follows the newest published version when MCP starts. Restart the host to load updates. The server searches the active project; `SIFT_LIGHT_MCP_CWD` can select a different root. An MCP-only connection adds the tool without disabling other search tools.
148
+
149
+ Pi and OMP load their host-scoped configuration by default. Set `SIFT_LIGHT_CONFIG` in the actual host process environment when all hosts should share one explicit file; it overrides the host-scoped path for Pi and OMP as well as MCP. Claude Code, Codex and Kimi all start the same standalone MCP server, so add this variable to each host's MCP `env` map rather than relying only on a shell startup file:
150
+
151
+ ```text
152
+ SIFT_LIGHT_CONFIG=/absolute/path/to/sift-light.json
153
+ ```
154
+
155
+ Keep `TYPESAFE_API_KEY` in the MCP process environment or its secret manager; never put the credential value in the configuration file or a checked-in host manifest. The standalone MCP server keeps semantic judging disabled when this path is absent, and fails at startup when an explicit path is missing or an enabled configuration has no key. It never silently claims that Jev ran. Startup diagnostics are written to stderr, and hybrid results expose `semanticJudge.status`; `judgedCandidates > 0` proves that at least one remote batch completed, `complete` means every considered candidate was judged, and `partial` keeps the remaining candidates locally ordered and explicitly unjudged.
156
+
157
+ MCP returns readable text plus structured evidence by default. If a host serializes both forms into the model context, set `SIFT_LIGHT_MCP_OUTPUT_MODE=model` in that MCP server's environment and restart it. Model mode omits `structuredContent` and its advertised output schema, advertises concise workflow guidance, and selects the smaller of the standard page and a compact view of the same retained analysis snapshot. Repeated paths and inspect requests are shared, hybrid does not concatenate separate literal and Concept bodies, and outline excerpts are deferred to version-checked inspection. Counts, coverage, partial status, reasons and continuation requests remain visible. Use `text` to omit structured output while preserving the complete standard text and full usage guidance, or retain the default `structured` mode for programmatic consumers and clients that expose only structured results. Any other value fails at startup. The bundled Claude Code, Codex and Kimi native plugins select `model`; direct MCP connections retain the structured default unless configured explicitly.
158
+
159
+ `paths` selects exact retained files from an existing cursor; a new search accepts one `path`. Split unrelated roots into separate requests rather than replacing them with a broader common parent. Markdown inspection uses a bounded line window and does not require Universal Ctags; missing structure providers remain visible when they affect code structure inspection.
160
+
161
+ ### Native plugins
162
+
163
+ For conventional search enforcement in other hosts:
164
+
165
+ - **Claude Code:** `/plugin marketplace add lightsifter/sift-light`, then `/plugin install sift-light@sift-light`.
166
+ - **Codex:** `codex plugin marketplace add lightsifter/sift-light`, then `codex plugin add sift-light@sift-light`; review and trust the hook in `/hooks`.
167
+ - **Kimi Code:** `/plugins install /absolute/path/plugins/sift-light` using the plugin directory from this repository or installed package, then confirm trust and run `/reload`.
168
+
169
+ Kimi Code's web mode can start plugin MCP servers from its installation directory. If relative MCP searches resolve to the wrong project, keep the native plugin for search enforcement and add a project-local `.kimi-code/mcp.json` entry with the same `sift-light` server and an explicit absolute `cwd` for that project.
170
+
171
+ Restart after installation. Native hooks use hard enforcement by default. To keep the native plugin, MCP tool and model guidance without denying conventional searches, start the host with `SIFT_LIGHT_ENFORCE_SEARCH=prefer`; use `off` to disable only hook enforcement. Accepted values are `hard`, `prefer`, and `off`; an unsupported value fails closed instead of silently allowing a search. The setting is inherited from the host process, so a project cannot lower a user's policy merely by committing a repository configuration file. You can still disable the complete integration through Claude Code `/plugin`, Codex `/hooks`, or Kimi `/plugins disable sift-light` followed by `/reload`.
172
+
173
+ In hard mode, a direct search such as `grep warning report.txt` is denied. A trailing filter such as `cat report.txt | grep warning` remains available because it filters output from a non-search producer; `find src | grep test` and `rg warning src | grep result` remain denied because their pipelines already contain a direct search producer. If one subcommand in a compound shell call is denied, the host executes none of that call. The denial identifies the detected search and tells the agent to retry non-search operations separately.
174
+
175
+ Local searches stay on your machine. Only grant access to files your agent is allowed to read. HTTP deployments need an authenticated gateway before public exposure; see [Security](SECURITY.md).
176
+
177
+ [Changelog](CHANGELOG.md) · [Contributing](CONTRIBUTING.md) · [AGPL-3.0-only license](LICENSE)
@@ -0,0 +1,177 @@
1
+ # sift-light
2
+
3
+ 简体中文 · [English](README.md)
4
+
5
+ **sift-light — Evidence-first search for AI agents.**
6
+
7
+ **一个通用的本地搜索插件,让 Agent 更方便地查找文件、文档、笔记、日志和各类文本资料。**
8
+
9
+ 它像一位耐心的图书管理员:你说想找什么,它帮你找到书架、翻到相关页面,再陪你沿着线索继续看。资料少时,直接把内容递给你;资料多时,先铺开一张地图,让你知道从哪里看起。
10
+
11
+ ## 它能帮上什么忙
12
+
13
+ ### 找一句话,不用翻完整个资料柜
14
+
15
+ 想找一条报错、一段说明或某个名字,就像告诉管理员一本书里的关键词。命中不多时,插件直接给出原文和所在位置,省去逐个文件打开、来回翻找的过程。
16
+
17
+ ### 资料很多,先给你地图
18
+
19
+ 问“哪些资料提到退款”,可能一下找到很多内容。它会先整理相关文件和片段,像在地图上标出有线索的地点;Agent 可以先判断哪些值得看,再打开其中的原文,而不是一开始就面对满桌散页。
20
+
21
+ ### 追问的时候,书签还在
22
+
23
+ 你说“接着刚才的结果看”,它能沿着上次的位置继续翻页。也可以从某一条命中打开附近原文,像把书签夹在那一页,随时回来补看前因后果。
24
+
25
+ ### 记得不完全准确,也能一次找回
26
+
27
+ 当一句话可能记错了措辞时,可以用一个自然语言 `query` 调用 `mode: "hybrid"`。Hybrid 会在同一个受控请求中始终执行精确字面搜索和已安装的本地 Concept 模型:精确证据固定排在前面,语义候选明确标注且只表示相似度,与精确命中范围重叠的候选会被去重。初始页面共享计数、覆盖状态、来源引用和一个检查游标,以紧凑预览代替拼接两份完整响应。`conceptLimit` 只调整不重叠的语义补充数量(默认 3,最大 20),不会挤占字面证据;返回的 matches 请求从同一个快照开始完整的精确优先分页,不会重新执行任一搜索。
28
+
29
+ Concept 排名会覆盖请求所声明源码预算内接纳的全部 UTF-8 段落,不再固定抽取范围开头的一小部分。Concept 和 hybrid 默认会自动接纳最多 2,000 个文件,在内部按每批 200 个文件顺序处理,再合并成一次全局排名和一份覆盖结果。所有批次共享同一个请求的 32 MiB 读取预算,扩大文件上限不会把内容预算成倍放大。用户不需要自己计算或续接批次;只有确实想主动缩小范围时,才需要把 `maxFilesToParse` 作为可选的高级硬上限。超过模型 token 窗口的段落会拆成带重叠、且保证不截断的窗口参与排名,后半段内容不会被静默丢弃。离线 embedding 按内容、模型版本和分段版本缓存在本地,缓存上限为 512 MiB;重复内容直接复用,内容变化自然失效,缓存写入或清理失败会在结果中明确显示。
30
+
31
+ Concept 或 hybrid 较慢时,会在默认五秒等待窗口内返回 `status: "waiting"` 或 `"running"`、`operationId`、进度和精确的 `nextRequest`,例如 `{ "mode": "await", "operationId": "..." }`。请原样复制这个请求:它会续接同一个计算,不会重启查询,也不会降级成只有字面的结果。最终结果可稳定复取十分钟;每个服务会话最多保留 32 个终态结果。`mode: "cancel"` 会停止自有任务并等待清理完成。每个服务会话最多同时接纳八个 pending operation;单个 operation 使用 `SIFT_LIGHT_CONCEPT_TIMEOUT_MS` 指定一个总执行时限(整数毫秒,1000–3600000,默认 600000),另有 120 秒无人续接租期。真实模型、来源或资源故障会以明确失败返回。发布结果前会重新枚举并校验同一来源 generation;源文件变化会刷新 operation,混合版本不会被标成 complete。接纳计划计数(`filesEnumerated`、`filesAdmitted`、`filesSkippedEmpty`、`filesUnavailable`、`passagesQueued`、`batchesPlanned`、`batchesCompleted`)会在结果里明确显示。空文件属于正常跳过,不会把结果标成 partial。
32
+
33
+ ### 几个条件,可以一起交代
34
+
35
+ “找同时提到客户和退款的文件”,就像请管理员挑出同时贴着两张标签的资料;“这几个词任意一个出现都算”,则像列出一张候选清单。可以一次表达多个查找条件,减少反复搜索。
36
+
37
+ ### 指定一个抽屉,就在里面找
38
+
39
+ 需要只查某个文件夹时,可以明确告诉 Agent 限定范围。只记得文件名的一部分,也可以先找文件,再看内容。像先确定资料柜的哪一层,再逐步缩小到要找的那一份。
40
+
41
+ `files` 多词查询要求每个词都在路径中按字面出现;单个缩写仍支持模糊匹配。业务意图使用 `hybrid` 或 `concept`。普通内容搜索保留零匹配后扩大范围的既有默认;需要限定目录时传 `scope: "strict"`。范围扩大的提示会先于证据显示。
42
+
43
+ ### 看到了多少,说得清楚
44
+
45
+ 一页装不下的内容会分批展示,并提供继续查看的入口。原文发生变化时,也会提醒重新确认。像一位认真整理资料的助手,会把“已经看到的”和“还需要往后翻的”交代清楚。
46
+
47
+ 完整快照表示匹配保留完整,不代表源码正文没有截断。长行摘录会明确标记限制,并给出最后一页之后仍可执行的 `inspectRequest`。需要更多结果时沿游标继续,不要仅为翻页而修改 limit 重搜。
48
+ Pi 和 OMP 的被动 session 状态会显示当前加载的包版本,统计已返回的新查询,区分完整、部分和未完成结果,并报告未取消的失败调用。cursor 与 operation 续接不会重复计入新查询。
49
+
50
+ 普通搜索继续遵循仓库 ignore 规则,但只要存在被忽略文件,就会明确说明文件系统覆盖受策略过滤,不再把“接纳文件里没找到”说成“整个目录绝对不存在”。需要发布前收口时,可以用 `mode: "audit"` 配合带名字的字面量 `patterns`,一次拿到声明范围、枚举/搜索/跳过文件、ignore 策略、每个模式的 `present`、`absent_with_complete_coverage` 或 `unknown` 结论,以及搜索前后的来源稳定性。审计必须包含被忽略的配置或生成文件时,设置 `ignorePolicy: "include"`;`.git` 内部和受保护路径仍然不会开放。
51
+
52
+ ### 先发现语言能力,再按需加载提供方
53
+
54
+ 使用 `mode: "capabilities"` 和项目根目录,可以获取紧凑的文件语言清单。JavaScript、TypeScript 和 TSX 支持 AST 结构、角色、outline、静态 imports 和关联测试候选;Go 支持 AST 结构和角色;Python 支持基于缩进的有界 outline。Swift 和其他语言仍可使用普通内容搜索、文件发现和源码 inspect。能力清单不会启动 parser 或 Concept 模型。
55
+
56
+ 语言服务导航不在范围内。请求 `definitions`、`references`、`implementations`、`callers`、`callees`、`dependencies`、`dependents`、`trace` 或 `impact` 都会明确报错——用文本搜索伪装精确导航,比直接说清楚更糟。使用期间不会启动任何语言服务。
57
+
58
+ ### 校验已保存的源码证据
59
+
60
+ 使用 `mode: "validate"` 加普通搜索或 analysis 的 `cursor`,可以按需传入 `matchIndex` 选择单项证据。校验将已保留源码与当前工作区或固定 Git 对象比较,报告 `current`、`stale` 或 `unknown`,并保留原搜索的不完整覆盖状态。结构化信息位于 `details.validation` 和 `details.analysis.validation`;旧关系图字段和 trace cursor 不再支持。校验按需读取源码,不启动后台监听;它验证已保存证据,不证明搜索后没有新增匹配文件。
61
+
62
+ ### 按文件时间缩小范围,也可以看代码结构
63
+
64
+ 工作区搜索支持用 Unix 毫秒时间戳传入 `modifiedAfter` 和 `modifiedBefore`。下界包含、上界不包含,因此可以准确表示一个时间窗口,不必改动搜索关键词。内容搜索和文件名搜索使用同一过滤条件;无法核验文件元数据时会明确报告证据不完整,不会静默当作命中。
65
+
66
+ 对具体的 JS/TS/TSX 或 Python 文件使用 `mode: "outline"`,可以查看有界符号范围。JS/TS/TSX 使用 ast-grep,Python 使用基于缩进的类、函数和方法范围;它们不证明编译器绑定、运行时调用或测试覆盖。`mode: "tests"` 提供 JS/TS/TSX 关联测试候选,不支持的语言操作会明确报错。Swift 源码可使用普通搜索和 `inspect`。
67
+
68
+ 可读正文会保持精简;每项证据的范围、计数、覆盖状态和继续请求仍保留在结构化 `details` 中,客户端无需为了拿到这些字段再次搜索。
69
+
70
+ ## 常见用法
71
+
72
+ 直接向 Agent 表达需求即可,例如:
73
+
74
+ - “帮我找一下,哪些文档提到了退款期限?”
75
+ - “这条报错在哪些日志里出现过?把附近的内容也给我看看。”
76
+ - “找同时包含客户名称和订单编号的文件。”
77
+ - “这几个关键词,任意一个出现都列出来。”
78
+ - “我只记得文件名里有会议记录,帮我找找。”
79
+ - “这次只查这个资料文件夹,不要扩大范围。”
80
+ - “先告诉我相关内容分布在哪些文件,再打开其中两份。”
81
+ - “接着刚才的位置继续看,把没展示完的部分找出来。”
82
+ - “按这个 Unix 毫秒时间戳之后修改过的文件搜索。”
83
+ - “这句话我可能记得不准确,把精确和语义证据一起找出来。”
84
+ - “列出这个 Python 文件里的类和函数,再打开需要看的方法。”
85
+ - “搜索这个函数名并查看相关源码;我修改文件后,再校验已保存的证据。”
86
+
87
+ 插件提供文件位置和实际文本,帮助 Agent 根据原文回答,也方便你回到资料中核对。
88
+
89
+ ## 安装
90
+
91
+ MCP 需要 Node.js 22.19+。Pi 需要 Pi 0.84.3+,以及 Node.js 22.19+ 或 Bun 1.4+。搜索引擎随包提供对应平台的版本,无需系统搜索工具、Shell 函数或额外设置 `PATH`,搜索过程也不会下载任何东西。安装时请保留可选依赖。
92
+
93
+ 如果你从更早的包身份升级,请先移除此前安装的插件和 MCP 注册,再安装 sift-light,避免同一宿主同时加载两套搜索工具或拦截钩子。
94
+
95
+ 如需使用自己的 ripgrep,在 MCP 服务或 Pi 进程的环境变量中设置 `SIFT_LIGHT_RG_PATH` 为可执行文件的绝对路径,然后重启宿主。该设置统一作用于内容、文件名和 Git 源文件搜索。路径中的空格可用;不支持别名、Shell 函数、相对路径或 `~` 展开。配置无效时明确报错,不会另选程序。随包引擎缺失时,请保留可选依赖重新安装,或把该项指向自己的二进制。
96
+
97
+ ### Pi
98
+
99
+ ```bash
100
+ pi install npm:sift-light
101
+ ```
102
+
103
+ 安装或更新后重启 Pi。Pi 默认让常规搜索使用本插件,读取、编辑、测试、构建和脚本仍可使用。`enforceSearch` 支持 `"hard"`(默认严格拦截)、`"prefer"`(保留专用工具和模型指引,但不拒绝其他搜索)和 `"off"`;布尔值及未知配置字段会直接报错。请在 `~/.pi/agent/sift-light.json` 中配置后重启;设置 `"locale": "zh-CN"` 可启用中文界面。
104
+
105
+ ### OMP(Oh My Pi)
106
+
107
+ ```bash
108
+ omp install npm:sift-light@latest
109
+ ```
110
+
111
+ 安装或更新后重启 OMP。安装包声明了 OMP 原生扩展并注册 `sift-light`。默认 hard 模式会从活动工具集中移除 OMP 内置的 `grep` 和 `glob`,并在执行前阻止直接搜索命令,同时保留读取、编辑、测试、构建和其他开发工具。prefer 模式会同时保留专用工具与其他搜索工具,加入模型指引,但不拒绝 shell 搜索。OMP 当前 profile 会被正确识别:默认配置文件是 `~/.omp/agent/sift-light.json`,命名 profile 使用 `~/.omp/profiles/<profile>/agent/sift-light.json`。在当前文件中将 `enforceSearch` 设置为 `"hard"`(默认)、`"prefer"` 或 `"off"` 后重启 OMP;布尔值及未知配置字段会直接报错。设置 `"locale": "zh-CN"` 可启用中文界面。
112
+
113
+ ### 可选语义判断
114
+
115
+ Hybrid 搜索默认只使用本地能力。可选的语义判断器可以对保留的概念候选进行分类并改善排序,但不会替代本地匹配、源码检查、分页或验证。
116
+
117
+ 只有在配置中明确设置 `semanticJudge.enabled` 为 `true` 时才会启用。仅定义环境变量不会激活网络请求。凭据应保留在进程环境变量中,不要把凭据值写进配置文件:
118
+
119
+ ```json
120
+ {
121
+ "locale": "zh-CN",
122
+ "enforceSearch": "hard",
123
+ "semanticJudge": {
124
+ "enabled": false,
125
+ "provider": "jev",
126
+ "apiKeyEnv": "TYPESAFE_API_KEY",
127
+ "model": "jev-latest",
128
+ "timeoutMs": 120000,
129
+ "maxCandidates": 20,
130
+ "maxRetries": 2
131
+ }
132
+ }
133
+ ```
134
+
135
+ 启用后,配置的端点只会收到查询和有界的候选摘录。每个请求最多包含八个候选和 64 KiB;独立批次仍受现有最多二十个候选的总上限约束,HTTP 413 只会拆分对应批次。某个批次失败时,其中的候选保持本地顺序,成功批次仍可提供分类;结果会明确标记为部分覆盖,并报告已判断/未判断候选及批次计数。缺少密钥仍会明确报配置错误,提供方失败绝不会删除本地候选,语义分类也不等同于运行时证明。
136
+
137
+ ### Claude Code 或 Codex:连接 MCP
138
+
139
+ ```bash
140
+ claude mcp add sift-light -- npx -y --package sift-light@latest sift-light-mcp --stdio
141
+ ```
142
+
143
+ ```bash
144
+ codex mcp add sift-light -- npx -y --package sift-light@latest sift-light-mcp --stdio
145
+ ```
146
+
147
+ `@latest` 会在 MCP 启动时跟随最新发布版本,更新后重启宿主即可加载。服务器默认搜索当前项目,可用 `SIFT_LIGHT_MCP_CWD` 指定其他根目录。仅连接 MCP 会添加工具,不会禁用其他搜索工具。
148
+
149
+ Pi 和 OMP 默认读取各自宿主的配置文件。如果希望所有宿主共用一份明确配置,可以在实际宿主进程环境中设置 `SIFT_LIGHT_CONFIG`;它会同时覆盖 Pi、OMP 和 MCP 的宿主默认路径。Claude Code、Codex 和 Kimi 都是启动同一个独立 MCP 服务,因此要把这个变量放进各自 MCP 条目的 `env` 中,不能只依赖 Shell 启动文件:
150
+
151
+ ```text
152
+ SIFT_LIGHT_CONFIG=/absolute/path/to/sift-light.json
153
+ ```
154
+
155
+ `TYPESAFE_API_KEY` 应保存在 MCP 进程环境或宿主的密钥管理中;不要把凭据值写进配置文件或提交到版本库的宿主清单。没有这个路径时,独立 MCP 会明确保持语义判断 disabled;路径被显式设置但文件不存在,或配置已启用但缺少 key 时,会在启动阶段失败,不会静默声称 Jev 已运行。启动诊断写入 stderr,hybrid 结果会暴露 `semanticJudge.status`;`judgedCandidates > 0` 证明至少一个远程批次已完成,`complete` 表示所有纳入判断的候选都已判断,`partial` 则会保留其余候选的本地顺序并明确标记为未判断。
156
+
157
+ MCP 默认同时返回可读文本和结构化证据。如果宿主会把两种形式一起序列化进模型上下文,请在该 MCP 服务的环境中设置 `SIFT_LIGHT_MCP_OUTPUT_MODE=model`,然后重启。模型模式不返回 `structuredContent`,也不声明结构化输出 schema;它会提供精简的工作流说明,并在标准页和同一个已保留分析快照的紧凑视图中选择较小者。紧凑视图共享重复路径和 inspect 请求,hybrid 不会拼接两份独立的 literal 与 Concept 正文,并把 outline 签名延后到版本校验过的源码检查。计数、覆盖范围、部分状态、原因和续读请求仍然可见。`text` 模式只省略结构化输出,逐字保留标准文本和完整兼容说明;程序消费者或只展示结构化结果的客户端应继续使用默认的 `structured` 模式。其他取值会在启动时明确失败。捆绑的 Claude Code、Codex 和 Kimi 原生插件会选择 `model`;直接 MCP 连接仍保留兼容默认值,除非显式配置。
158
+
159
+ `paths` 只用于从已有 cursor 中精确选择已保留文件;新搜索只接受一个 `path`。多个互不相干的根目录应拆成独立请求,不要自动改成范围更大的共同父目录。Markdown 检查直接使用有界行窗口,不依赖 Universal Ctags;代码结构检查真的受到 provider 缺失影响时仍会明确报告。
160
+
161
+ ### 原生插件
162
+
163
+ 如果希望在其他宿主中也强制常规搜索使用本插件:
164
+
165
+ - **Claude Code:** 先运行 `/plugin marketplace add lightsifter/sift-light`,再运行 `/plugin install sift-light@sift-light`。
166
+ - **Codex:** 先运行 `codex plugin marketplace add lightsifter/sift-light`,再运行 `codex plugin add sift-light@sift-light`,通过 `/hooks` 查看并信任钩子。
167
+ - **Kimi Code:** 使用本仓库或安装包中的插件目录,运行 `/plugins install /absolute/path/plugins/sift-light`,确认信任后执行 `/reload`。
168
+
169
+ Kimi Code 的 web 模式可能从安装目录启动插件 MCP 服务。如果相对路径搜索解析到了错误项目,请继续使用原生插件强制搜索,并在项目内的 `.kimi-code/mcp.json` 中配置同名 `sift-light` 服务,显式填写该项目的绝对 `cwd`。
170
+
171
+ 安装后重启。原生钩子默认使用严格模式。如需保留原生插件、MCP 工具和模型指引,但不硬性拒绝其他搜索,请使用 `SIFT_LIGHT_ENFORCE_SEARCH=prefer` 启动宿主;设置为 `off` 只关闭钩子强制策略。可用值为 `hard`、`prefer` 和 `off`,非法值会安全拒绝并明确报错,不会静默放行。该设置由宿主进程继承,因此项目不能仅靠提交仓库配置文件降低用户的全局策略。仍可通过 Claude Code `/plugin`、Codex `/hooks`,或 Kimi `/plugins disable sift-light` 后执行 `/reload` 来关闭整个集成。
172
+
173
+ 严格模式下,`grep warning report.txt` 这类直接搜索会被拒绝;`cat report.txt | grep warning` 仍可用,因为它只是过滤一个非搜索命令的输出。`find src | grep test` 和 `rg warning src | grep result` 仍会被拒绝,因为管道中已经包含直接搜索来源。复合 shell 调用中只要一个子命令被拒绝,宿主就不会执行其中任何操作;拒绝信息会指出检测到的搜索,并要求 Agent 单独重试非搜索操作。
174
+
175
+ 本地搜索在你的机器上进行。请只允许 Agent 读取已获授权的文件。HTTP 服务对外开放前需要认证网关,详见[安全说明](SECURITY.md)。
176
+
177
+ [更新记录](CHANGELOG.md) · [参与贡献](CONTRIBUTING.md) · [AGPL-3.0-only 许可证](LICENSE)
package/SECURITY.md ADDED
@@ -0,0 +1,25 @@
1
+ # Security Policy
2
+
3
+ ## Reporting vulnerabilities
4
+
5
+ Use this repository's GitHub private vulnerability reporting. Include the affected version, impact and reproduction steps with non-sensitive examples. Do not publish credentials, private source or exploit details in an issue.
6
+
7
+ Security fixes target the latest released version. An acknowledgement is normally provided within seven days; remediation depends on severity and reproducibility.
8
+
9
+ ## Access and privacy
10
+
11
+ The tool runs with the permissions of its host process. It is read-only, but it is not a filesystem sandbox. Explicit absolute paths and `..` can access other readable locations. `.git` internals and known external credential and special-system paths are blocked; these checks cannot identify every renamed, copied or custom-location secret. Hidden files inside the project remain searchable.
12
+
13
+ `redact: true` optionally masks common credential values in returned output. It does not change which files are searched and cannot guarantee removal of every sensitive value. Only connect the tool to repositories and paths that the agent is authorized to read.
14
+
15
+ Local searches have no telemetry and do not upload source or queries. Package installation can access npm. Explicit installation of the optional concept model downloads public assets; concept searches then run offline. Concept mode stores content-addressed embeddings, never source text or paths, beneath the configured local model root. The cache identity includes the pinned model and chunking revision, is bounded to 512 MiB, and can be deleted without losing source data or search correctness. Remote HTTP connections transmit requests and results to the configured server.
16
+
17
+ ## HTTP deployments
18
+
19
+ The HTTP server has no built-in authentication. Keep the default loopback binding or place it behind an authenticated gateway. Browser clients require an explicitly allowed origin; CORS is not authentication. Restrict the server account's filesystem permissions to the data intended for its clients.
20
+
21
+ ## Search enforcement
22
+
23
+ Version 1.2.0 enables conventional search enforcement by default in Pi. Claude Code, Codex and Kimi Code require the native plugin; MCP alone cannot disable other tools. Codex also requires the user to trust its hook.
24
+
25
+ Enforcement depends on an enabled, trusted, runnable host hook. Disabled hooks, process failures and host error handling can prevent interception. Custom programs can still search. The policy preserves ordinary reads, edits, directory browsing, tests, builds and scripts, and does not change the model, memory or existing host permissions. See the [README](README.md) for disabling it.
package/package.json ADDED
@@ -0,0 +1,142 @@
1
+ {
2
+ "name": "sift-light",
3
+ "version": "1.0.0",
4
+ "description": "Context-efficient local search for files, documents, notes and logs across Pi, OMP and MCP clients",
5
+ "keywords": [
6
+ "ai-agent",
7
+ "claude-code",
8
+ "code-navigation",
9
+ "codex",
10
+ "context-engineering",
11
+ "grep",
12
+ "mcp",
13
+ "oh-my-pi",
14
+ "omp",
15
+ "pi",
16
+ "pi-extension",
17
+ "pi-package",
18
+ "ripgrep",
19
+ "search",
20
+ "source-inspection"
21
+ ],
22
+ "homepage": "https://github.com/lightsifter/sift-light#readme",
23
+ "bugs": {
24
+ "url": "https://github.com/lightsifter/sift-light/issues"
25
+ },
26
+ "license": "AGPL-3.0-only",
27
+ "author": "baoer",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/lightsifter/sift-light.git"
31
+ },
32
+ "bin": {
33
+ "sift-light-mcp": "src/mcp-server.mjs",
34
+ "sift-light-model": "src/concept-worker.mjs"
35
+ },
36
+ "files": [
37
+ "src/**/*.ts",
38
+ "src/syntax-worker.mjs",
39
+ "src/mcp-server.mjs",
40
+ "src/syntax-worker.toml",
41
+ "README.md",
42
+ "README.zh-CN.md",
43
+ "CONTRIBUTING.md",
44
+ "LICENSE",
45
+ "CHANGELOG.md",
46
+ "SECURITY.md",
47
+ "src/concept-worker.mjs",
48
+ "plugins/sift-light/**"
49
+ ],
50
+ "type": "module",
51
+ "publishConfig": {
52
+ "access": "public",
53
+ "provenance": true,
54
+ "registry": "https://registry.npmjs.org"
55
+ },
56
+ "scripts": {
57
+ "build:worker": "bun run scripts/build-syntax-worker.ts",
58
+ "check:worker": "bun run doc/testing/scripts/check-syntax-worker.ts",
59
+ "build:mcp": "bun run scripts/build-mcp-server.ts",
60
+ "check:mcp": "bun run doc/testing/scripts/check-mcp-server.ts",
61
+ "format": "oxfmt --write .",
62
+ "format:check": "oxfmt --check .",
63
+ "lint": "oxlint --type-aware --deny-warnings --report-unused-disable-directives src scripts",
64
+ "typecheck": "tsc --noEmit",
65
+ "test": "bun test ./doc/testing/test",
66
+ "test:node": "bun run doc/testing/scripts/node-smoke.ts",
67
+ "benchmark": "bun run doc/testing/scripts/benchmark.ts",
68
+ "check": "bun run format:check && bun run lint && bun run typecheck && bun run build",
69
+ "pack:check": "bun pm pack --dry-run && bun run scripts/check-npm-publish.ts",
70
+ "setup:concept": "bun run src/concept-worker.mjs --install-model",
71
+ "build:concept-worker": "bun run scripts/build-concept-worker.ts",
72
+ "check:concept-worker": "bun run doc/testing/scripts/check-concept-worker.ts",
73
+ "test:concept": "bun run doc/testing/scripts/test-concept.ts",
74
+ "evaluate:investigations": "bun run doc/testing/scripts/investigation-eval.ts",
75
+ "build:search-plugin": "bun run scripts/build-search-plugin.ts",
76
+ "check:search-plugin": "bun run doc/testing/scripts/check-search-plugin.ts",
77
+ "test:mcp-hosts": "bun run doc/testing/scripts/mcp-host-verification.ts",
78
+ "build": "bun run build:worker && bun run build:concept-worker && bun run build:search-plugin && bun run build:mcp",
79
+ "format:local:check": "bun run doc/testing/scripts/format-local.ts --check",
80
+ "lint:local": "oxlint --no-ignore --type-aware --tsconfig doc/testing/tsconfig.json --deny-warnings --report-unused-disable-directives src scripts doc/testing/test doc/testing/scripts",
81
+ "typecheck:local": "tsc --noEmit --project doc/testing/tsconfig.json",
82
+ "check:local": "bun run format:check && bun run format:local:check && bun run check:search-plugin && bun run check:concept-worker && bun run check:worker && bun run check:mcp && bun run lint:local && bun run typecheck:local && bun run test && bun run test:node && bun run benchmark"
83
+ },
84
+ "dependencies": {
85
+ "@ast-grep/lang-go": "0.0.6",
86
+ "@ast-grep/napi": "0.45.2",
87
+ "@huggingface/transformers": "3.8.1",
88
+ "@modelcontextprotocol/sdk": "1.30.0",
89
+ "@vscode/ripgrep": "1.18.0",
90
+ "typebox": "1.3.19",
91
+ "web-tree-sitter": "0.25.10",
92
+ "zod": "4.5.4"
93
+ },
94
+ "devDependencies": {
95
+ "@earendil-works/pi-ai": "0.84.3",
96
+ "@earendil-works/pi-coding-agent": "0.84.3",
97
+ "@earendil-works/pi-tui": "0.84.3",
98
+ "@types/bun": "^1.4.0",
99
+ "oxfmt": "^0.65.0",
100
+ "oxlint": "^1.80.0",
101
+ "oxlint-tsgolint": "^7.0.2001",
102
+ "tree-sitter-bash": "0.25.1",
103
+ "tree-sitter-powershell": "0.26.4",
104
+ "typescript": "7.0.2"
105
+ },
106
+ "peerDependencies": {
107
+ "@earendil-works/pi-ai": "*",
108
+ "@earendil-works/pi-coding-agent": "*",
109
+ "@earendil-works/pi-tui": "*"
110
+ },
111
+ "peerDependenciesMeta": {
112
+ "@earendil-works/pi-ai": {
113
+ "optional": true
114
+ },
115
+ "@earendil-works/pi-coding-agent": {
116
+ "optional": true
117
+ },
118
+ "@earendil-works/pi-tui": {
119
+ "optional": true
120
+ }
121
+ },
122
+ "engines": {
123
+ "bun": ">=1.4.0",
124
+ "node": ">=22.19.0"
125
+ },
126
+ "packageManager": "bun@1.4.2",
127
+ "knip": {
128
+ "entry": [
129
+ "src/mcp-server.ts"
130
+ ]
131
+ },
132
+ "omp": {
133
+ "extensions": [
134
+ "./plugins/sift-light/omp-extension.mjs"
135
+ ]
136
+ },
137
+ "pi": {
138
+ "extensions": [
139
+ "./src/index.ts"
140
+ ]
141
+ }
142
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "sift-light",
3
+ "version": "1.0.0",
4
+ "description": "Require sift-light for conventional local searches while keeping development tools available.",
5
+ "author": {
6
+ "name": "baoer"
7
+ },
8
+ "homepage": "https://github.com/lightsifter/sift-light#readme",
9
+ "license": "AGPL-3.0-only"
10
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "sift-light",
3
+ "version": "1.0.0",
4
+ "description": "Require sift-light for conventional local searches while keeping development tools available.",
5
+ "author": {
6
+ "name": "baoer"
7
+ },
8
+ "homepage": "https://github.com/lightsifter/sift-light#readme",
9
+ "license": "AGPL-3.0-only",
10
+ "mcpServers": "./.mcp.json",
11
+ "interface": {
12
+ "displayName": "sift-light",
13
+ "shortDescription": "Enforced local code search",
14
+ "longDescription": "Require sift-light for conventional local searches while keeping development tools available.",
15
+ "defaultPrompt": "Search this project's code using sift-light.",
16
+ "developerName": "baoer",
17
+ "category": "Productivity",
18
+ "capabilities": []
19
+ }
20
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "mcpServers": {
3
+ "sift-light": {
4
+ "command": "npx",
5
+ "args": [
6
+ "--yes",
7
+ "--package",
8
+ "sift-light-runtime@npm:sift-light@1.0.0",
9
+ "sift-light-mcp",
10
+ "--stdio"
11
+ ],
12
+ "env": {
13
+ "npm_config_ignore_scripts": "true",
14
+ "ONNXRUNTIME_NODE_INSTALL_CUDA": "skip",
15
+ "SIFT_LIGHT_MCP_OUTPUT_MODE": "model"
16
+ },
17
+ "env_vars": [
18
+ "SIFT_LIGHT_CONFIG",
19
+ "TYPESAFE_API_KEY",
20
+ "SIFT_LIGHT_JEV_API_KEY"
21
+ ]
22
+ }
23
+ }
24
+ }