yandecode 0.1.1 → 0.2.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 (226) hide show
  1. package/dist/bin.js +14 -8
  2. package/dist/bin.js.map +7 -1
  3. package/dist/chunks/chunk-23DG7PZZ.js +58 -0
  4. package/dist/chunks/chunk-23DG7PZZ.js.map +7 -0
  5. package/dist/chunks/chunk-2S6B3DDQ.js +1769 -0
  6. package/dist/chunks/chunk-2S6B3DDQ.js.map +7 -0
  7. package/dist/chunks/chunk-6J5CZVCJ.js +120 -0
  8. package/dist/chunks/chunk-6J5CZVCJ.js.map +7 -0
  9. package/dist/chunks/chunk-7L6DD2VD.js +768 -0
  10. package/dist/chunks/chunk-7L6DD2VD.js.map +7 -0
  11. package/dist/chunks/chunk-DWD37AI2.js +39 -0
  12. package/dist/chunks/chunk-DWD37AI2.js.map +7 -0
  13. package/dist/chunks/chunk-KPDBXQ62.js +62 -0
  14. package/dist/chunks/chunk-KPDBXQ62.js.map +7 -0
  15. package/dist/chunks/chunk-KVBKQXTU.js +351 -0
  16. package/dist/chunks/chunk-KVBKQXTU.js.map +7 -0
  17. package/dist/chunks/chunk-L2DDIZPI.js +53 -0
  18. package/dist/chunks/chunk-L2DDIZPI.js.map +7 -0
  19. package/dist/chunks/chunk-OIAMKDTQ.js +27 -0
  20. package/dist/chunks/chunk-OIAMKDTQ.js.map +7 -0
  21. package/dist/chunks/chunk-PUWSEWX3.js +61 -0
  22. package/dist/chunks/chunk-PUWSEWX3.js.map +7 -0
  23. package/dist/chunks/chunk-QCQC73WX.js +122 -0
  24. package/dist/chunks/chunk-QCQC73WX.js.map +7 -0
  25. package/dist/chunks/chunk-TYLH4NIC.js +39 -0
  26. package/dist/chunks/chunk-TYLH4NIC.js.map +7 -0
  27. package/dist/chunks/chunk-VKVJGBNJ.js +72 -0
  28. package/dist/chunks/chunk-VKVJGBNJ.js.map +7 -0
  29. package/dist/chunks/chunk-Y2MIXROU.js +20072 -0
  30. package/dist/chunks/chunk-Y2MIXROU.js.map +7 -0
  31. package/dist/chunks/cli-V6PJTDLM.js +3464 -0
  32. package/dist/chunks/cli-V6PJTDLM.js.map +7 -0
  33. package/dist/chunks/doctor-LLDVEPWL.js +184 -0
  34. package/dist/chunks/doctor-LLDVEPWL.js.map +7 -0
  35. package/dist/chunks/entry-YAOEX3EB.js +187 -0
  36. package/dist/chunks/entry-YAOEX3EB.js.map +7 -0
  37. package/dist/chunks/init-4ZJFCKIJ.js +46 -0
  38. package/dist/chunks/init-4ZJFCKIJ.js.map +7 -0
  39. package/dist/chunks/mcp-serve-KWKMUGWZ.js +22575 -0
  40. package/dist/chunks/mcp-serve-KWKMUGWZ.js.map +7 -0
  41. package/dist/chunks/modules-CJB5IKUJ.js +121 -0
  42. package/dist/chunks/modules-CJB5IKUJ.js.map +7 -0
  43. package/dist/chunks/runtime-3E4NIFAL.js +208 -0
  44. package/dist/chunks/runtime-3E4NIFAL.js.map +7 -0
  45. package/dist/chunks/runtime-7CRR63B5.js +395 -0
  46. package/dist/chunks/runtime-7CRR63B5.js.map +7 -0
  47. package/dist/chunks/runtime-CKMVHAU4.js +64 -0
  48. package/dist/chunks/runtime-CKMVHAU4.js.map +7 -0
  49. package/dist/chunks/runtime-CVZMWIJO.js +318 -0
  50. package/dist/chunks/runtime-CVZMWIJO.js.map +7 -0
  51. package/dist/chunks/runtime-DBNXBOAL.js +295 -0
  52. package/dist/chunks/runtime-DBNXBOAL.js.map +7 -0
  53. package/dist/chunks/runtime-EKHO2JXB.js +197 -0
  54. package/dist/chunks/runtime-EKHO2JXB.js.map +7 -0
  55. package/dist/chunks/runtime-EY6SVZYP.js +539 -0
  56. package/dist/chunks/runtime-EY6SVZYP.js.map +7 -0
  57. package/dist/chunks/runtime-UB2O2HUN.js +212 -0
  58. package/dist/chunks/runtime-UB2O2HUN.js.map +7 -0
  59. package/dist/chunks/runtime-WAFQWW4M.js +755 -0
  60. package/dist/chunks/runtime-WAFQWW4M.js.map +7 -0
  61. package/dist/chunks/runtime-ZGGF6RVA.js +271 -0
  62. package/dist/chunks/runtime-ZGGF6RVA.js.map +7 -0
  63. package/dist/chunks/status-SPIESL4F.js +38 -0
  64. package/dist/chunks/status-SPIESL4F.js.map +7 -0
  65. package/dist/chunks/uninstall-J2OWCX4A.js +54 -0
  66. package/dist/chunks/uninstall-J2OWCX4A.js.map +7 -0
  67. package/dist/chunks/update-OX5MZYQY.js +34 -0
  68. package/dist/chunks/update-OX5MZYQY.js.map +7 -0
  69. package/dist/content/agents/yandecode-reviewer.md +22 -0
  70. package/dist/content/agents/yandecode-security-reviewer.md +23 -0
  71. package/dist/content/skills/NOTICE.md +29 -0
  72. package/dist/content/skills/yandecode-code-review/SKILL.md +37 -0
  73. package/dist/content/skills/yandecode-debugging/SKILL.md +33 -0
  74. package/dist/content/skills/yandecode-instructions/SKILL.md +26 -0
  75. package/dist/content/skills/yandecode-memory/SKILL.md +36 -0
  76. package/dist/content/skills/yandecode-security-review/SKILL.md +24 -0
  77. package/dist/content/skills/yandecode-tdd/SKILL.md +38 -0
  78. package/dist/content/skills/yandecode-verification/SKILL.md +29 -0
  79. package/dist/content/skills/yandecode-workflow/SKILL.md +50 -0
  80. package/package.json +25 -19
  81. package/dist/bin.d.ts +0 -3
  82. package/dist/bin.d.ts.map +0 -1
  83. package/dist/claude-bin.d.ts +0 -2
  84. package/dist/claude-bin.d.ts.map +0 -1
  85. package/dist/claude-bin.js +0 -4
  86. package/dist/claude-bin.js.map +0 -1
  87. package/dist/cli.d.ts +0 -6
  88. package/dist/cli.d.ts.map +0 -1
  89. package/dist/cli.js +0 -21
  90. package/dist/cli.js.map +0 -1
  91. package/dist/commands/doctor.d.ts +0 -2
  92. package/dist/commands/doctor.d.ts.map +0 -1
  93. package/dist/commands/doctor.js +0 -19
  94. package/dist/commands/doctor.js.map +0 -1
  95. package/dist/commands/hook.d.ts +0 -2
  96. package/dist/commands/hook.d.ts.map +0 -1
  97. package/dist/commands/hook.js +0 -23
  98. package/dist/commands/hook.js.map +0 -1
  99. package/dist/commands/index-cmd.d.ts +0 -2
  100. package/dist/commands/index-cmd.d.ts.map +0 -1
  101. package/dist/commands/index-cmd.js +0 -47
  102. package/dist/commands/index-cmd.js.map +0 -1
  103. package/dist/commands/index.d.ts +0 -13
  104. package/dist/commands/index.d.ts.map +0 -1
  105. package/dist/commands/index.js +0 -15
  106. package/dist/commands/index.js.map +0 -1
  107. package/dist/commands/init.d.ts +0 -2
  108. package/dist/commands/init.d.ts.map +0 -1
  109. package/dist/commands/init.js +0 -22
  110. package/dist/commands/init.js.map +0 -1
  111. package/dist/commands/mcp.d.ts +0 -2
  112. package/dist/commands/mcp.d.ts.map +0 -1
  113. package/dist/commands/mcp.js +0 -71
  114. package/dist/commands/mcp.js.map +0 -1
  115. package/dist/commands/rag.d.ts +0 -2
  116. package/dist/commands/rag.d.ts.map +0 -1
  117. package/dist/commands/rag.js +0 -27
  118. package/dist/commands/rag.js.map +0 -1
  119. package/dist/commands/start.d.ts +0 -5
  120. package/dist/commands/start.d.ts.map +0 -1
  121. package/dist/commands/start.js +0 -74
  122. package/dist/commands/start.js.map +0 -1
  123. package/dist/commands/status.d.ts +0 -2
  124. package/dist/commands/status.d.ts.map +0 -1
  125. package/dist/commands/status.js +0 -29
  126. package/dist/commands/status.js.map +0 -1
  127. package/dist/commands/statusline.d.ts +0 -2
  128. package/dist/commands/statusline.d.ts.map +0 -1
  129. package/dist/commands/statusline.js +0 -90
  130. package/dist/commands/statusline.js.map +0 -1
  131. package/dist/commands/swarm.d.ts +0 -4
  132. package/dist/commands/swarm.d.ts.map +0 -1
  133. package/dist/commands/swarm.js +0 -48
  134. package/dist/commands/swarm.js.map +0 -1
  135. package/dist/commands/uninstall.d.ts +0 -2
  136. package/dist/commands/uninstall.d.ts.map +0 -1
  137. package/dist/commands/uninstall.js +0 -16
  138. package/dist/commands/uninstall.js.map +0 -1
  139. package/dist/context.d.ts +0 -13
  140. package/dist/context.d.ts.map +0 -1
  141. package/dist/context.js +0 -31
  142. package/dist/context.js.map +0 -1
  143. package/dist/doctor/checks.d.ts +0 -18
  144. package/dist/doctor/checks.d.ts.map +0 -1
  145. package/dist/doctor/checks.js +0 -270
  146. package/dist/doctor/checks.js.map +0 -1
  147. package/dist/hooks/handlers.d.ts +0 -21
  148. package/dist/hooks/handlers.d.ts.map +0 -1
  149. package/dist/hooks/handlers.js +0 -191
  150. package/dist/hooks/handlers.js.map +0 -1
  151. package/dist/index.d.ts +0 -10
  152. package/dist/index.d.ts.map +0 -1
  153. package/dist/index.js +0 -10
  154. package/dist/index.js.map +0 -1
  155. package/dist/integration/claude-md.d.ts +0 -6
  156. package/dist/integration/claude-md.d.ts.map +0 -1
  157. package/dist/integration/claude-md.js +0 -30
  158. package/dist/integration/claude-md.js.map +0 -1
  159. package/dist/integration/gitignore.d.ts +0 -3
  160. package/dist/integration/gitignore.d.ts.map +0 -1
  161. package/dist/integration/gitignore.js +0 -13
  162. package/dist/integration/gitignore.js.map +0 -1
  163. package/dist/integration/init.d.ts +0 -17
  164. package/dist/integration/init.d.ts.map +0 -1
  165. package/dist/integration/init.js +0 -86
  166. package/dist/integration/init.js.map +0 -1
  167. package/dist/integration/json-utils.d.ts +0 -13
  168. package/dist/integration/json-utils.d.ts.map +0 -1
  169. package/dist/integration/json-utils.js +0 -33
  170. package/dist/integration/json-utils.js.map +0 -1
  171. package/dist/integration/manifest.d.ts +0 -17
  172. package/dist/integration/manifest.d.ts.map +0 -1
  173. package/dist/integration/manifest.js +0 -26
  174. package/dist/integration/manifest.js.map +0 -1
  175. package/dist/integration/materialize.d.ts +0 -9
  176. package/dist/integration/materialize.d.ts.map +0 -1
  177. package/dist/integration/materialize.js +0 -21
  178. package/dist/integration/materialize.js.map +0 -1
  179. package/dist/integration/mcp-config.d.ts +0 -4
  180. package/dist/integration/mcp-config.d.ts.map +0 -1
  181. package/dist/integration/mcp-config.js +0 -11
  182. package/dist/integration/mcp-config.js.map +0 -1
  183. package/dist/integration/settings.d.ts +0 -7
  184. package/dist/integration/settings.d.ts.map +0 -1
  185. package/dist/integration/settings.js +0 -70
  186. package/dist/integration/settings.js.map +0 -1
  187. package/dist/integration/uninstall.d.ts +0 -10
  188. package/dist/integration/uninstall.d.ts.map +0 -1
  189. package/dist/integration/uninstall.js +0 -71
  190. package/dist/integration/uninstall.js.map +0 -1
  191. package/dist/launcher.d.ts +0 -8
  192. package/dist/launcher.d.ts.map +0 -1
  193. package/dist/launcher.js +0 -18
  194. package/dist/launcher.js.map +0 -1
  195. package/dist/mcp/server.d.ts +0 -27
  196. package/dist/mcp/server.d.ts.map +0 -1
  197. package/dist/mcp/server.js +0 -311
  198. package/dist/mcp/server.js.map +0 -1
  199. package/dist/plugin-content.d.ts +0 -21
  200. package/dist/plugin-content.d.ts.map +0 -1
  201. package/dist/plugin-content.js +0 -67
  202. package/dist/plugin-content.js.map +0 -1
  203. package/dist/rag/format.d.ts +0 -3
  204. package/dist/rag/format.d.ts.map +0 -1
  205. package/dist/rag/format.js +0 -12
  206. package/dist/rag/format.js.map +0 -1
  207. package/dist/retrieval-runtime.d.ts +0 -21
  208. package/dist/retrieval-runtime.d.ts.map +0 -1
  209. package/dist/retrieval-runtime.js +0 -47
  210. package/dist/retrieval-runtime.js.map +0 -1
  211. package/dist/status-line/git.d.ts +0 -3
  212. package/dist/status-line/git.d.ts.map +0 -1
  213. package/dist/status-line/git.js +0 -34
  214. package/dist/status-line/git.js.map +0 -1
  215. package/dist/status-line/render.d.ts +0 -29
  216. package/dist/status-line/render.d.ts.map +0 -1
  217. package/dist/status-line/render.js +0 -72
  218. package/dist/status-line/render.js.map +0 -1
  219. package/dist/swarm-runtime.d.ts +0 -11
  220. package/dist/swarm-runtime.d.ts.map +0 -1
  221. package/dist/swarm-runtime.js +0 -76
  222. package/dist/swarm-runtime.js.map +0 -1
  223. package/dist/version.d.ts +0 -2
  224. package/dist/version.d.ts.map +0 -1
  225. package/dist/version.js +0 -5
  226. package/dist/version.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/commands/update.ts"],
4
+ "sourcesContent": ["import type { Io } from '@cli/io';\nimport { requireWorkspace } from '@cli/modules/host';\nimport { printApplyReport, saveSelectionAndApply, type SetupDeps } from './setup';\n\n/**\n * Re-materializes the integration for the installed yandecode version and writes the config in\n * the current format (v0 configs are migrated in memory on every load; this persists it).\n */\nexport function runUpdate(\n cwd: string,\n flags: { force?: boolean },\n io: Io,\n deps: SetupDeps = {},\n): number {\n const ws = requireWorkspace(cwd);\n const { config, added, report } = saveSelectionAndApply(\n ws.root,\n ws.config.modules,\n deps,\n flags.force ? { force: true } : {},\n );\n io.out(`yandecode.json is at version ${config.version}\\n`);\n printApplyReport(io, config.modules, added, report);\n return 0;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAQO,SAAS,UACd,KACA,OACA,IACA,OAAkB,CAAC,GACX;AACR,QAAM,KAAK,iBAAiB,GAAG;AAC/B,QAAM,EAAE,QAAQ,OAAO,OAAO,IAAI;AAAA,IAChC,GAAG;AAAA,IACH,GAAG,OAAO;AAAA,IACV;AAAA,IACA,MAAM,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;AAAA,EACnC;AACA,KAAG,IAAI,gCAAgC,OAAO,OAAO;AAAA,CAAI;AACzD,mBAAiB,IAAI,OAAO,SAAS,OAAO,MAAM;AAClD,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: yandecode-reviewer
3
+ description: Reviews a given diff scope for real bugs and violations of the project's written rules, scoring each finding and returning only those with confidence ≥ 80. Dispatch from the yandecode-code-review skill with the exact scope (e.g. "git diff main...HEAD") and the paths of the applicable CLAUDE.md/AGENTS.md files.
4
+ tools: Read, Grep, Glob, Bash, mcp__yandecode__code_search, mcp__yandecode__code_definition, mcp__yandecode__code_references, mcp__yandecode__code_symbols, mcp__yandecode__knowledge_search
5
+ ---
6
+
7
+ You review one change. You do not edit files.
8
+
9
+ 1. Get the diff for the scope you were given (`git diff …`). Read the listed rule files.
10
+ 2. For each hunk, ask: can this break at runtime (wrong condition, missed null/empty case, off-by-one, unhandled rejection, race, resource leak, wrong API use)? Does it violate a rule written in the rule files? Check callers and callees with `code_references` / `code_definition` rather than reading whole files. Check `knowledge_search` for recorded decisions the change may contradict.
11
+ 3. Score each candidate 0–100 (80+ = verified and will matter). Drop everything below 80, pre-existing issues, formatter/linter territory and style preferences not in the rules.
12
+
13
+ Return, and nothing else:
14
+
15
+ ```
16
+ FINDINGS (confidence ≥ 80)
17
+ - [score] path:line — problem; when it happens; smallest fix
18
+ CHECKED
19
+ - one line per area you verified
20
+ ```
21
+
22
+ If there are no findings, return `FINDINGS: none` and the CHECKED list.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: yandecode-security-reviewer
3
+ description: Security review of a given diff scope — traces untrusted input to dangerous sinks (shell, SQL, HTML, paths, fetch, deserialization, CI) and returns only traced findings with confidence ≥ 80. Dispatch from the yandecode-code-review or yandecode-security-review skill with the exact scope.
4
+ tools: Read, Grep, Glob, Bash, mcp__yandecode__code_search, mcp__yandecode__code_definition, mcp__yandecode__code_references
5
+ ---
6
+
7
+ You review one change for security. You do not edit files.
8
+
9
+ 1. Get the diff for the scope you were given.
10
+ 2. Identify untrusted sources the change reads (request data, CLI args, files, env, webhook/issue text) and dangerous sinks it reaches (shell, SQL, HTML, filesystem paths, outbound URLs, deserializers, `eval`, CI `run:` steps). Follow the data with `code_references` / `code_definition`.
11
+ 3. Also check: authn/authz on new entry points, secrets in code or logs, disabled TLS, weak hashes for security purposes, overly broad permissions.
12
+ 4. Keep only findings with a concrete source → sink path and confidence ≥ 80.
13
+
14
+ Return, and nothing else:
15
+
16
+ ```
17
+ SECURITY FINDINGS (confidence ≥ 80)
18
+ - [score] path:line — source → sink; impact; fix
19
+ QUESTIONS (need a human decision)
20
+ - …
21
+ CHECKED
22
+ - one line per sink/area verified
23
+ ```
@@ -0,0 +1,29 @@
1
+ # Third-party notices for bundled skills
2
+
3
+ The workflow skills (`yandecode-workflow`, `yandecode-tdd`, `yandecode-debugging`, `yandecode-verification`) are condensed adaptations of skills from **obra/superpowers** (commit 8ca22db), used under the MIT License:
4
+
5
+ ```
6
+ MIT License
7
+
8
+ Copyright (c) 2025 Jesse Vincent
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ ```
28
+
29
+ The change-folder format used by `yandecode-workflow` follows **Fission-AI/OpenSpec** (MIT, commit 79b6aa9); no OpenSpec code is included.
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: yandecode-code-review
3
+ description: Review a change (working tree, branch or PR) for real bugs and project-rule violations with a confidence filter. Use when asked to review code, before claiming a non-trivial change is done, or before opening a pull request.
4
+ ---
5
+
6
+ # Code review
7
+
8
+ Goal: few findings, each real and actionable. A review that lists ten maybes is worse than one that lists two certain bugs.
9
+
10
+ ## 1. Scope the change
11
+
12
+ - Default scope: `git diff` (unstaged) plus `git diff --cached`; for a branch, `git diff $(git merge-base HEAD main)...HEAD`; for a PR, `gh pr diff <n>`.
13
+ - List changed files and read the project rules that apply to them: root `CLAUDE.md`/`AGENTS.md` and any in the changed directories.
14
+ - Run `quality_check` first. Do not report what the compiler, linter or tests already report — fix or mention the failing step instead.
15
+
16
+ ## 2. Review in parallel
17
+
18
+ Dispatch the `yandecode-reviewer` agent (bugs + project rules) and, when the change touches input handling, auth, crypto, files, processes, SQL, HTML or CI, the `yandecode-security-reviewer` agent. Give each the exact diff scope and the rule files. Reviewers use `code_definition` / `code_references` to check callers instead of reading whole files.
19
+
20
+ ## 3. Score and filter
21
+
22
+ Each finding gets a confidence score:
23
+
24
+ | score | meaning |
25
+ | ------ | ---------------------------------------------------------------------- |
26
+ | 0–25 | probably a false positive or pre-existing |
27
+ | 26–50 | nitpick not required by the project rules |
28
+ | 51–79 | real but minor, or unverified |
29
+ | 80–100 | verified bug, security issue or explicit rule violation that will bite |
30
+
31
+ Report only findings scoring **≥ 80**. Before reporting, re-read the code path once more to confirm.
32
+
33
+ Not findings: pre-existing issues, style a formatter owns, things silenced on purpose (lint-ignore comments), speculative performance, "consider adding tests" unless the rules require them.
34
+
35
+ ## 4. Report
36
+
37
+ For each finding: `path:line` — what breaks, when, and the smallest fix. Group by severity. If nothing survives the filter, say so plainly ("no issues at ≥ 80 confidence") and list what was checked.
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: yandecode-debugging
3
+ description: Systematic debugging — find the root cause with evidence before changing code. Use for any bug, failing test, build failure, flaky behaviour or performance regression, especially when a quick fix seems obvious or earlier fixes did not work.
4
+ ---
5
+
6
+ # Systematic debugging
7
+
8
+ **No fix without a root cause.** Symptom patches create the next bug.
9
+
10
+ ## 1. Investigate
11
+
12
+ - Read the whole error and stack trace; note files, lines, codes.
13
+ - Reproduce reliably. Capture noisy runs with `ctx_run(command, intent="first failure")` and read exact lines with `ctx_get`; don't re-run to scroll.
14
+ - Check what changed: `git log -n 20 --stat`, `git diff`, dependency and config changes.
15
+ - Check memory: `knowledge_search("<error or component>")` — the same failure may already be recorded.
16
+ - In multi-component paths (CI → build → deploy, API → service → DB) log what enters and leaves each boundary once, to see _where_ it breaks.
17
+ - Trace the bad value backwards (`code_references`, `code_definition`) to where it originates.
18
+
19
+ ## 2. Compare
20
+
21
+ Find similar code that works; list every difference between working and broken, however small.
22
+
23
+ ## 3. Hypothesis → minimal test
24
+
25
+ State one hypothesis ("X is null because Y runs before Z"). Change one thing to test it. If it is wrong, form a new hypothesis — do not stack fixes. After three failed hypotheses, stop and question the design with the user.
26
+
27
+ ## 4. Fix
28
+
29
+ Write a failing test that reproduces the root cause (`yandecode-tdd`), fix at the source, run the suite. Record the root cause with `memory_write(kind: "failure", sources: [...])` when it could bite again.
30
+
31
+ ---
32
+
33
+ Adapted from obra/superpowers `systematic-debugging` (MIT); see NOTICE.md in the yandecode content directory.
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: yandecode-instructions
3
+ description: Write and maintain CLAUDE.md / AGENTS.md so they stay short, true and useful. Use when creating or editing agent instruction files, when the user corrects you about a project convention, or when instructions_audit reports issues.
4
+ ---
5
+
6
+ # Project instructions
7
+
8
+ Instruction files load into every session, so each line costs tokens every time. Keep what an agent cannot discover quickly and would get wrong without being told.
9
+
10
+ ## What belongs
11
+
12
+ - How to build, test, lint and run the project — exact commands (`instructions_audit` lists the detected ones).
13
+ - Non-obvious conventions and constraints ("migrations are append-only", "never import across packages except via the index").
14
+ - Where things are when the layout is surprising.
15
+ - Workflow rules the team actually enforces (branching, commit style, review).
16
+
17
+ ## What does not
18
+
19
+ - Things the code or `package.json` already say, generic advice ("write clean code"), long tutorials (move them to a skill or `docs/`), history of past decisions (use `memory_write` / ADRs).
20
+
21
+ ## Maintaining
22
+
23
+ 1. Edit the smallest relevant file: root `CLAUDE.md` for project-wide rules, a nested `CLAUDE.md`/`AGENTS.md` for one directory.
24
+ 2. When the user corrects you on a convention, add the rule in one line, with the reason if it is not obvious.
25
+ 3. Run `instructions_audit`; fix missing paths, unknown commands and duplicates it reports; keep each file under ~2 000 tokens.
26
+ 4. Leave the `<!-- yandecode:start -->` block alone — YandeCode regenerates it from the enabled modules.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: yandecode-memory
3
+ description: When and how to record project knowledge with memory_write and read it back with knowledge_search / knowledge_get. Use when you make or discover a decision, a non-obvious convention, a gotcha, or the root cause of a failure worth remembering in later sessions.
4
+ ---
5
+
6
+ # Project memory
7
+
8
+ Memory is for knowledge a future session would otherwise have to rediscover. It is stored as Markdown files (one per memory) and injected at session start as titles only.
9
+
10
+ ## Read before re-deriving
11
+
12
+ 1. `knowledge_search(query)` returns ids and titles (memories) and `path:lines § heading` (docs). It is cheap.
13
+ 2. `knowledge_get([ids])` returns full bodies with their sources. Only fetch what you need.
14
+ 3. Treat a memory flagged **stale** (its source file is gone) as a lead to verify, not a fact.
15
+
16
+ ## Write when it will matter later
17
+
18
+ Record with `memory_write`:
19
+
20
+ | kind | write it when | example title |
21
+ | -------- | --------------------------------------------------------------- | ----------------------------------------------- |
22
+ | decision | a choice was made, with its reason | "Sessions use opaque tokens, not JWT" |
23
+ | pattern | a convention the code follows that is not obvious from one file | "Repositories return null, services throw" |
24
+ | fact | an environmental truth that cost time to learn | "Integration tests need `docker compose up db`" |
25
+ | failure | a bug's root cause and the fix | "Flaky auth test: clock skew in token expiry" |
26
+ | note | anything else short-lived (use `durability: "ephemeral"`) | "Waiting on API key from ops" |
27
+
28
+ Rules:
29
+
30
+ - One idea per memory. Title = the claim; body = why and how to apply it, a few lines.
31
+ - Always cite `sources` (paths with `:line`, commit ids, URLs, ctx handles) so the memory can be verified and invalidated.
32
+ - Do not store what the repository already records (code structure, git history, README content).
33
+ - When knowledge changes, write the new memory with `supersedes: [old id]`; do not leave contradictions. Use `memory_forget` only for memories that were wrong.
34
+ - Near-duplicates of the same kind are merged automatically; rewriting a memory with a better statement is fine.
35
+
36
+ Session summaries (`kind: session`) are recorded automatically and expire; do not write them yourself.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: yandecode-security-review
3
+ description: Security-focused review of a change — injection, auth, secrets, unsafe deserialization, SSRF, path traversal, CI workflow injection. Use when a change handles untrusted input, credentials, processes, files, network or CI, or when the user asks for a security review.
4
+ ---
5
+
6
+ # Security review
7
+
8
+ Trace untrusted data from where it enters (HTTP params, CLI args, files, env, webhooks, issue/PR text in CI) to where it is used (shell, SQL, HTML, file paths, URLs fetched, deserializers, `eval`). A finding needs a concrete source → sink path.
9
+
10
+ ## Checklist per sink
11
+
12
+ - **Shell**: arguments passed as an array (`execFile`, `spawn`, `subprocess.run([...])`), never interpolated into a command string.
13
+ - **SQL**: parameters/placeholders only.
14
+ - **HTML**: text rendering or a vetted sanitizer; no `innerHTML` / `dangerouslySetInnerHTML` with input.
15
+ - **Paths**: resolved and checked to stay inside the intended root (no `..` escape, symlinks considered).
16
+ - **URLs fetched server-side**: allowlist host/scheme (SSRF), no internal addresses.
17
+ - **Deserialization**: JSON / `yaml.safe_load`; never `pickle`, `yaml.load`, `torch.load` without `weights_only` on untrusted data.
18
+ - **Auth**: every new endpoint/handler checks authentication _and_ authorization for the specific resource; tokens compared in constant time; secrets from the environment, never in code or logs.
19
+ - **Crypto**: no MD5/SHA-1 for security, no custom crypto, TLS verification on.
20
+ - **CI (GitHub Actions)**: event data (`github.event.*.title/body/...`) reaches `run:` only through `env:` and quoted variables; `pull_request_target` never checks out untrusted code with secrets.
21
+
22
+ ## Report
23
+
24
+ Only findings with a traced path and confidence ≥ 80 (same scale as yandecode-code-review). For each: `path:line`, source → sink, impact, and the fix. Mention anything that needs a human decision (e.g. threat model) separately, as a question.
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: yandecode-tdd
3
+ description: Test-driven development — write a failing test for the behaviour, watch it fail for the right reason, write the minimum code, watch it pass, refactor. Use when implementing any feature or bug fix before writing production code.
4
+ ---
5
+
6
+ # Test-driven development
7
+
8
+ **No production code without a failing test that demands it.**
9
+
10
+ ## Cycle
11
+
12
+ 1. **Red** — write one test for the next behaviour (or the bug's reproduction). Run it (`ctx_run("<test command> <file>", intent="failure reason")`). It must fail, and fail _because the behaviour is missing_ — not from a typo, import error or wrong fixture. If it passes, the test is wrong or the behaviour already exists.
13
+ 2. **Green** — write the simplest code that makes it pass. No extra options, no speculative generality.
14
+ 3. **Run everything relevant** — the new test and the suite around it. All green.
15
+ 4. **Refactor** — remove duplication, improve names, keep behaviour. Re-run.
16
+ 5. Next behaviour.
17
+
18
+ ## Good tests
19
+
20
+ - Test behaviour through public interfaces, not private helpers or call counts.
21
+ - One behaviour per test; the name states it ("rejects an expired token").
22
+ - Cover the failure cases the acceptance criteria name, not only the happy path.
23
+ - Real code over mocks; mock only true boundaries (network, clock, randomness) and keep the mock faithful.
24
+ - Deterministic: no sleeps, fixed clocks, isolated temp directories.
25
+
26
+ ## Bugs
27
+
28
+ Reproduce the bug as a failing test first (see `yandecode-debugging` for finding the root cause). The fix is done when that test passes and the suite is green.
29
+
30
+ ## When you catch yourself
31
+
32
+ - wrote code before the test → keep it aside, write the test, watch it fail against the old code, then bring the code back;
33
+ - a test passed on the first run → make it fail deliberately once to prove it can;
34
+ - "too simple to test" → the test takes a minute; write it.
35
+
36
+ ---
37
+
38
+ Adapted from obra/superpowers `test-driven-development` (MIT); see NOTICE.md in the yandecode content directory.
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: yandecode-verification
3
+ description: Evidence before claims — run the command that proves a claim and read its output before saying work is done, fixed, passing or ready. Use before reporting completion, checking a task, committing, or opening a PR.
4
+ ---
5
+
6
+ # Verification before completion
7
+
8
+ **No completion claim without fresh evidence from this turn.**
9
+
10
+ ## Gate
11
+
12
+ 1. Identify the command that proves the claim (tests, typecheck, lint, build, a reproduction).
13
+ 2. Run it now — `quality_check` for the project's standard checks, `ctx_run` for anything else.
14
+ 3. Read the result: exit code, failure count, the failing lines.
15
+ 4. Claim only what the output shows, and quote the evidence ("vitest: 214 passed, 0 failed").
16
+
17
+ | claim | evidence required | not enough |
18
+ | ----------------- | --------------------------------- | ----------------------------- |
19
+ | tests pass | fresh run, 0 failures | an earlier run, "should pass" |
20
+ | bug fixed | the reproduction now passes | code changed |
21
+ | build works | build exit 0 | lint passing |
22
+ | subagent finished | its diff reviewed | its report |
23
+ | requirement met | each acceptance criterion checked | tests green |
24
+
25
+ Words like "should", "probably", "looks good" before running the check mean: run the check. When `work_check` marks a task done, pass the evidence you just saw.
26
+
27
+ ---
28
+
29
+ Adapted from obra/superpowers `verification-before-completion` (MIT); see NOTICE.md in the yandecode content directory.
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: yandecode-workflow
3
+ description: How to take non-trivial work from idea to verified change with resumable state — clarify, write a change folder (proposal/design/specs/tasks), then implement task by task with TDD and evidence. Use when asked to build a feature, change behaviour across files, or run a multi-step task that may be interrupted.
4
+ ---
5
+
6
+ # Workflow: idea → verified change
7
+
8
+ State lives in files, not in the conversation: any session (or loop iteration) resumes with `work_status` and `work_next`.
9
+
10
+ ## 0. Size the work
11
+
12
+ - **Question / spike** — answer it; no change folder.
13
+ - **Bounded** (one flow that already exists, a few files) — agree a short design in chat, then implement with `yandecode-tdd`. A change folder is optional.
14
+ - **Architectural** (new subsystem, interface others depend on, several steps) — full flow below.
15
+
16
+ When unsure, take the heavier path.
17
+
18
+ ## 1. Understand before designing
19
+
20
+ Search first: `knowledge_search` (past decisions), `code_search` / `repo_map` (where things live). Ask the user one question at a time about purpose, constraints and success criteria; prefer multiple choice. Write back your understanding and let them correct it.
21
+
22
+ ## 2. Change folder
23
+
24
+ `work_new(title, why, what)` creates `<changes>/<id>/proposal.md`. Then, as needed:
25
+
26
+ - `design.md` — context, decisions (with rejected alternatives), migration plan, risks.
27
+ - `specs/<capability>/spec.md` — requirements as `### Requirement:` with `#### Scenario:` (GIVEN/WHEN/THEN).
28
+ - `tasks.md` — the plan:
29
+
30
+ ```markdown
31
+ - [ ] T1 Parse the new config field
32
+ - AC: missing field → default 30 s
33
+ - AC: negative value → error naming the field
34
+ - Files: src/config/schema.ts, test/config.test.ts
35
+ - [ ] T2 …
36
+ ```
37
+
38
+ Tasks are small (one commit each), ordered by dependency, with acceptance criteria a test can check. Get the user's approval on the plan before implementing architectural work.
39
+
40
+ ## 3. Implement
41
+
42
+ Loop: `work_next(id)` → implement with `yandecode-tdd` → verify with `yandecode-verification` (`quality_check`) → `work_check(id, task_id, evidence)` → commit. Independent tasks may go to parallel subagents with the full task text and acceptance criteria; review their diff before checking the task.
43
+
44
+ ## 4. Finish
45
+
46
+ All tasks checked → run the full `quality_check`, review with `yandecode-code-review`, record decisions worth keeping with `memory_write`, then `work_archive(id)`.
47
+
48
+ ---
49
+
50
+ Adapted from obra/superpowers (MIT) and the OpenSpec change format (MIT); see NOTICE.md in the yandecode content directory.
package/package.json CHANGED
@@ -1,43 +1,49 @@
1
1
  {
2
2
  "name": "yandecode",
3
- "version": "0.1.1",
4
- "description": "YandeCode CLI — local-first agent harness for Claude Code",
3
+ "version": "0.2.0",
4
+ "description": "YandeCode \u2014 modular context harness for Claude Code: code navigation, context isolation, memory, workflows and guards, installed once and chosen per project",
5
5
  "license": "MIT",
6
+ "author": "Yande Labs",
6
7
  "type": "module",
8
+ "keywords": [
9
+ "claude-code",
10
+ "mcp",
11
+ "context",
12
+ "code-navigation",
13
+ "retrieval",
14
+ "developer-tools",
15
+ "ai",
16
+ "agents"
17
+ ],
7
18
  "engines": {
8
19
  "node": ">=22"
9
20
  },
10
21
  "bin": {
11
22
  "yandecode": "./dist/bin.js"
12
23
  },
13
- "main": "./dist/index.js",
14
- "types": "./dist/index.d.ts",
15
- "exports": {
16
- ".": {
17
- "types": "./dist/index.d.ts",
18
- "default": "./dist/index.js"
19
- }
20
- },
21
24
  "files": [
22
25
  "dist"
23
26
  ],
24
27
  "repository": {
25
28
  "type": "git",
26
- "url": "https://github.com/whoisclebs/yandecode.git",
29
+ "url": "https://github.com/yandelabs/yandecode.git",
27
30
  "directory": "packages/cli"
28
31
  },
29
- "homepage": "https://github.com/whoisclebs/yandecode",
30
- "scripts": {
31
- "build": "tsc -b",
32
- "typecheck": "tsc --noEmit"
32
+ "homepage": "https://github.com/yandelabs/yandecode#readme",
33
+ "bugs": {
34
+ "url": "https://github.com/yandelabs/yandecode/issues"
35
+ },
36
+ "publishConfig": {
37
+ "access": "public"
33
38
  },
39
+ "scripts": {},
34
40
  "dependencies": {
35
41
  "@modelcontextprotocol/sdk": "^1.30.0",
36
- "@yandecode/core": "0.1.1",
37
- "@yandecode/plugin": "0.1.1",
38
- "@yandecode/retrieval": "0.1.1",
39
- "@yandecode/swarm": "0.1.1",
42
+ "better-sqlite3": "^13.0.3",
40
43
  "commander": "^15.0.0",
44
+ "ignore": "^7.0.9",
45
+ "tree-sitter-wasms": "0.1.13",
46
+ "web-tree-sitter": "0.20.8",
41
47
  "zod": "^4.6.5"
42
48
  }
43
49
  }
package/dist/bin.d.ts DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import './commands/index.js';
3
- //# sourceMappingURL=bin.d.ts.map
package/dist/bin.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,qBAAqB,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function resolveClaudeBin(): string;
2
- //# sourceMappingURL=claude-bin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude-bin.d.ts","sourceRoot":"","sources":["../src/claude-bin.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC"}
@@ -1,4 +0,0 @@
1
- export function resolveClaudeBin() {
2
- return process.env.YANDECODE_CLAUDE_BIN ?? 'claude';
3
- }
4
- //# sourceMappingURL=claude-bin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude-bin.js","sourceRoot":"","sources":["../src/claude-bin.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB;IAC9B,OAAO,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,QAAQ,CAAC;AACtD,CAAC"}
package/dist/cli.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { Command } from 'commander';
2
- export type CommandRegistrar = (program: Command) => void;
3
- export declare function registerCommand(registrar: CommandRegistrar): void;
4
- export declare function buildProgram(): Command;
5
- export declare function main(argv: string[]): Promise<void>;
6
- //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAI1D,wBAAgB,eAAe,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAEjE;AAED,wBAAgB,YAAY,IAAI,OAAO,CAStC;AAED,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAExD"}
package/dist/cli.js DELETED
@@ -1,21 +0,0 @@
1
- import { Command } from 'commander';
2
- import { VERSION } from './version.js';
3
- const registrars = [];
4
- export function registerCommand(registrar) {
5
- registrars.push(registrar);
6
- }
7
- export function buildProgram() {
8
- const program = new Command();
9
- program
10
- .name('yandecode')
11
- .description('YandeCode — local-first agent harness for Claude Code')
12
- .version(VERSION, '-v, --version')
13
- .showHelpAfterError();
14
- for (const register of registrars)
15
- register(program);
16
- return program;
17
- }
18
- export async function main(argv) {
19
- await buildProgram().parseAsync(argv);
20
- }
21
- //# sourceMappingURL=cli.js.map
package/dist/cli.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,MAAM,UAAU,GAAuB,EAAE,CAAC;AAE1C,MAAM,UAAU,eAAe,CAAC,SAA2B;IACzD,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,OAAO;SACJ,IAAI,CAAC,WAAW,CAAC;SACjB,WAAW,CAAC,uDAAuD,CAAC;SACpE,OAAO,CAAC,OAAO,EAAE,eAAe,CAAC;SACjC,kBAAkB,EAAE,CAAC;IACxB,KAAK,MAAM,QAAQ,IAAI,UAAU;QAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IACrD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,IAAc;IACvC,MAAM,YAAY,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=doctor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":""}
@@ -1,19 +0,0 @@
1
- import { registerCommand } from '../cli.js';
2
- import { defaultProbeVersion, doctorExitCode, formatDoctor, runDoctor } from '../doctor/checks.js';
3
- import { VERSION } from '../version.js';
4
- registerCommand((program) => {
5
- program
6
- .command('doctor')
7
- .description('Check the YandeCode installation and this project')
8
- .action(() => {
9
- const results = runDoctor({
10
- cwd: process.cwd(),
11
- probeVersion: defaultProbeVersion,
12
- nodeVersion: process.version,
13
- yandecodeVersion: VERSION,
14
- });
15
- process.stdout.write(formatDoctor(results));
16
- process.exitCode = doctorExitCode(results);
17
- });
18
- });
19
- //# sourceMappingURL=doctor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,eAAe,CAAC,CAAC,OAAO,EAAE,EAAE;IAC1B,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,mDAAmD,CAAC;SAChE,MAAM,CAAC,GAAG,EAAE;QACX,MAAM,OAAO,GAAG,SAAS,CAAC;YACxB,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;YAClB,YAAY,EAAE,mBAAmB;YACjC,WAAW,EAAE,OAAO,CAAC,OAAO;YAC5B,gBAAgB,EAAE,OAAO;SAC1B,CAAC,CAAC;QACH,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;QAC5C,OAAO,CAAC,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=hook.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/commands/hook.ts"],"names":[],"mappings":""}
@@ -1,23 +0,0 @@
1
- import { registerCommand } from '../cli.js';
2
- import { runHookCommand } from '../hooks/handlers.js';
3
- async function readStdin() {
4
- if (process.stdin.isTTY)
5
- return '';
6
- const chunks = [];
7
- for await (const chunk of process.stdin)
8
- chunks.push(Buffer.from(chunk));
9
- return Buffer.concat(chunks).toString('utf8');
10
- }
11
- registerCommand((program) => {
12
- program
13
- .command('hook <event>')
14
- .description('Claude Code hook entry point (reads the hook JSON from stdin)')
15
- .action(async (event) => {
16
- const stdinText = await readStdin();
17
- const result = await runHookCommand(event, stdinText, process.cwd());
18
- if (result.stdout)
19
- process.stdout.write(result.stdout);
20
- process.exitCode = result.exitCode;
21
- });
22
- });
23
- //# sourceMappingURL=hook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hook.js","sourceRoot":"","sources":["../../src/commands/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,KAAK,UAAU,SAAS;IACtB,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACnC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,OAAO,CAAC,KAAK;QAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAe,CAAC,CAAC,CAAC;IACnF,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAED,eAAe,CAAC,CAAC,OAAO,EAAE,EAAE;IAC1B,OAAO;SACJ,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,+DAA+D,CAAC;SAC5E,MAAM,CAAC,KAAK,EAAE,KAAa,EAAE,EAAE;QAC9B,MAAM,SAAS,GAAG,MAAM,SAAS,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACrE,IAAI,MAAM,CAAC,MAAM;YAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACvD,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACrC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index-cmd.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-cmd.d.ts","sourceRoot":"","sources":["../../src/commands/index-cmd.ts"],"names":[],"mappings":""}
@@ -1,47 +0,0 @@
1
- import { registerCommand } from '../cli.js';
2
- import { openRuntime } from '../context.js';
3
- import { createRetrieval } from '../retrieval-runtime.js';
4
- function printStatus(status) {
5
- process.stdout.write(`documents ${status.documents}, chunks ${status.chunks}, dirty ${status.dirtyFiles}, generation ${status.generation}, vectors ${status.vectorCount}, inSync ${status.inSync}\n`);
6
- }
7
- registerCommand((program) => {
8
- program
9
- .command('index')
10
- .description('Build or update the local RAG index for this repository')
11
- .option('--full', 'reprocess every file from scratch, bumping the index generation')
12
- .option('--rebuild-vectors', 'rebuild the vector index from stored embeddings without re-embedding')
13
- .option('--status', 'print index status and exit without indexing')
14
- .action(async (options) => {
15
- const rt = openRuntime(process.cwd());
16
- const retrieval = createRetrieval(rt);
17
- try {
18
- if (options.status) {
19
- printStatus(retrieval.indexing.status());
20
- return;
21
- }
22
- const mode = options.rebuildVectors
23
- ? 'rebuild-vectors'
24
- : options.full
25
- ? 'full'
26
- : 'incremental';
27
- const report = await retrieval.indexing.run({
28
- mode,
29
- onProgress: (p) => {
30
- process.stdout.write(`\r${p.phase.padEnd(8)} ${p.done}/${p.total}${p.path ? ` ${p.path}` : ''}${' '.repeat(20)}`);
31
- },
32
- });
33
- process.stdout.write('\n');
34
- process.stdout.write(`added ${report.added}, changed ${report.changed}, removed ${report.removed}, unchanged ${report.unchanged}, chunks ${report.chunks}, generation ${report.generation}, ${report.durationMs}ms\n`);
35
- const status = retrieval.indexing.status();
36
- if (!status.inSync) {
37
- process.stderr.write('index is out of sync after the run; try "yandecode index --rebuild-vectors"\n');
38
- process.exitCode = 1;
39
- }
40
- }
41
- finally {
42
- await retrieval.dispose();
43
- rt.close();
44
- }
45
- });
46
- });
47
- //# sourceMappingURL=index-cmd.js.map