homegraph 1.5.1 → 1.5.3

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 (382) hide show
  1. package/CHANGELOG.md +131 -0
  2. package/LICENSE +21 -21
  3. package/README.md +312 -305
  4. package/dist/arkui/index.d.ts +4 -0
  5. package/dist/arkui/index.d.ts.map +1 -0
  6. package/dist/arkui/index.js +23 -0
  7. package/dist/arkui/index.js.map +1 -0
  8. package/dist/arkui/migrate-passage.d.ts +28 -0
  9. package/dist/arkui/migrate-passage.d.ts.map +1 -0
  10. package/dist/arkui/migrate-passage.js +310 -0
  11. package/dist/arkui/migrate-passage.js.map +1 -0
  12. package/dist/arkui/migrate-semantics.d.ts +47 -0
  13. package/dist/arkui/migrate-semantics.d.ts.map +1 -0
  14. package/dist/arkui/migrate-semantics.js +229 -0
  15. package/dist/arkui/migrate-semantics.js.map +1 -0
  16. package/dist/arkui/migrate-snapshot.d.ts +79 -0
  17. package/dist/arkui/migrate-snapshot.d.ts.map +1 -0
  18. package/dist/arkui/migrate-snapshot.js +340 -0
  19. package/dist/arkui/migrate-snapshot.js.map +1 -0
  20. package/dist/bin/fatal-handler.js +2 -2
  21. package/dist/bin/homegraph.js +111 -162
  22. package/dist/bin/homegraph.js.map +1 -1
  23. package/dist/bin/node-version-check.d.ts +6 -15
  24. package/dist/bin/node-version-check.d.ts.map +1 -1
  25. package/dist/bin/node-version-check.js +8 -37
  26. package/dist/bin/node-version-check.js.map +1 -1
  27. package/dist/db/index.d.ts +36 -1
  28. package/dist/db/index.d.ts.map +1 -1
  29. package/dist/db/index.js +124 -38
  30. package/dist/db/index.js.map +1 -1
  31. package/dist/db/migrations.d.ts +1 -1
  32. package/dist/db/migrations.d.ts.map +1 -1
  33. package/dist/db/migrations.js +52 -38
  34. package/dist/db/migrations.js.map +1 -1
  35. package/dist/db/queries.d.ts +42 -0
  36. package/dist/db/queries.d.ts.map +1 -1
  37. package/dist/db/queries.js +330 -163
  38. package/dist/db/queries.js.map +1 -1
  39. package/dist/db/schema.sql +208 -203
  40. package/dist/db/sqlite-adapter.d.ts +8 -3
  41. package/dist/db/sqlite-adapter.d.ts.map +1 -1
  42. package/dist/db/sqlite-adapter.js +45 -3
  43. package/dist/db/sqlite-adapter.js.map +1 -1
  44. package/dist/directory.js +5 -5
  45. package/dist/extraction/extraction-version.d.ts +1 -1
  46. package/dist/extraction/extraction-version.js +1 -1
  47. package/dist/extraction/generated-detection.d.ts +42 -11
  48. package/dist/extraction/generated-detection.d.ts.map +1 -1
  49. package/dist/extraction/generated-detection.js +141 -20
  50. package/dist/extraction/generated-detection.js.map +1 -1
  51. package/dist/extraction/index.d.ts +43 -1
  52. package/dist/extraction/index.d.ts.map +1 -1
  53. package/dist/extraction/index.js +150 -43
  54. package/dist/extraction/index.js.map +1 -1
  55. package/dist/extraction/languages/arkts.d.ts +70 -6
  56. package/dist/extraction/languages/arkts.d.ts.map +1 -1
  57. package/dist/extraction/languages/arkts.js +958 -108
  58. package/dist/extraction/languages/arkts.js.map +1 -1
  59. package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
  60. package/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
  61. package/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
  62. package/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
  63. package/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
  64. package/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
  65. package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
  66. package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  67. package/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
  68. package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -1
  69. package/dist/extraction/wasm-runtime-flags.js +9 -6
  70. package/dist/extraction/wasm-runtime-flags.js.map +1 -1
  71. package/dist/graph-sources.d.ts +41 -0
  72. package/dist/graph-sources.d.ts.map +1 -0
  73. package/dist/graph-sources.js +82 -0
  74. package/dist/graph-sources.js.map +1 -0
  75. package/dist/index.d.ts +19 -1
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +80 -9
  78. package/dist/index.js.map +1 -1
  79. package/dist/installer/index.d.ts.map +1 -1
  80. package/dist/installer/index.js +0 -48
  81. package/dist/installer/index.js.map +1 -1
  82. package/dist/installer/instructions-template.js +9 -9
  83. package/dist/installer/targets/antigravity.js +1 -1
  84. package/dist/installer/targets/antigravity.js.map +1 -1
  85. package/dist/installer/targets/deveco.js +1 -1
  86. package/dist/installer/targets/deveco.js.map +1 -1
  87. package/dist/installer/targets/hermes.d.ts +1 -1
  88. package/dist/installer/targets/hermes.js +2 -2
  89. package/dist/installer/targets/hermes.js.map +1 -1
  90. package/dist/installer/targets/opencode.js +1 -1
  91. package/dist/installer/targets/opencode.js.map +1 -1
  92. package/dist/installer/targets/shared.js +1 -1
  93. package/dist/installer/targets/shared.js.map +1 -1
  94. package/dist/mcp/daemon-paths.d.ts +5 -4
  95. package/dist/mcp/daemon-paths.d.ts.map +1 -1
  96. package/dist/mcp/daemon-paths.js +28 -13
  97. package/dist/mcp/daemon-paths.js.map +1 -1
  98. package/dist/mcp/daemon-registry.d.ts.map +1 -1
  99. package/dist/mcp/daemon-registry.js +4 -1
  100. package/dist/mcp/daemon-registry.js.map +1 -1
  101. package/dist/mcp/daemon.d.ts +1 -1
  102. package/dist/mcp/daemon.js +1 -1
  103. package/dist/mcp/diff-impact.d.ts +131 -0
  104. package/dist/mcp/diff-impact.d.ts.map +1 -0
  105. package/dist/mcp/diff-impact.js +385 -0
  106. package/dist/mcp/diff-impact.js.map +1 -0
  107. package/dist/mcp/engine.d.ts.map +1 -1
  108. package/dist/mcp/engine.js +12 -3
  109. package/dist/mcp/engine.js.map +1 -1
  110. package/dist/mcp/explore-dedup.d.ts +137 -0
  111. package/dist/mcp/explore-dedup.d.ts.map +1 -0
  112. package/dist/mcp/explore-dedup.js +236 -0
  113. package/dist/mcp/explore-dedup.js.map +1 -0
  114. package/dist/mcp/explore-session-state.d.ts +217 -0
  115. package/dist/mcp/explore-session-state.d.ts.map +1 -0
  116. package/dist/mcp/explore-session-state.js +322 -0
  117. package/dist/mcp/explore-session-state.js.map +1 -0
  118. package/dist/mcp/index.d.ts.map +1 -1
  119. package/dist/mcp/index.js +4 -7
  120. package/dist/mcp/index.js.map +1 -1
  121. package/dist/mcp/liveness-watchdog.js +51 -51
  122. package/dist/mcp/proxy.d.ts.map +1 -1
  123. package/dist/mcp/proxy.js +5 -14
  124. package/dist/mcp/proxy.js.map +1 -1
  125. package/dist/mcp/query-worker.d.ts +1 -1
  126. package/dist/mcp/query-worker.js +1 -1
  127. package/dist/mcp/server-instructions.d.ts +7 -2
  128. package/dist/mcp/server-instructions.d.ts.map +1 -1
  129. package/dist/mcp/server-instructions.js +125 -47
  130. package/dist/mcp/server-instructions.js.map +1 -1
  131. package/dist/mcp/session.d.ts +14 -3
  132. package/dist/mcp/session.d.ts.map +1 -1
  133. package/dist/mcp/session.js +17 -14
  134. package/dist/mcp/session.js.map +1 -1
  135. package/dist/mcp/startup-handshake.d.ts +1 -1
  136. package/dist/mcp/startup-handshake.js +1 -1
  137. package/dist/mcp/tools.d.ts +138 -12
  138. package/dist/mcp/tools.d.ts.map +1 -1
  139. package/dist/mcp/tools.js +3279 -476
  140. package/dist/mcp/tools.js.map +1 -1
  141. package/dist/resolution/callback-synthesizer.d.ts +2 -1
  142. package/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  143. package/dist/resolution/callback-synthesizer.js +153 -53
  144. package/dist/resolution/callback-synthesizer.js.map +1 -1
  145. package/dist/resolution/frameworks/arkts-entry.d.ts.map +1 -1
  146. package/dist/resolution/frameworks/arkts-entry.js +20 -9
  147. package/dist/resolution/frameworks/arkts-entry.js.map +1 -1
  148. package/dist/resolution/frameworks/arkts-napi.d.ts +14 -0
  149. package/dist/resolution/frameworks/arkts-napi.d.ts.map +1 -1
  150. package/dist/resolution/frameworks/arkts-napi.js +169 -49
  151. package/dist/resolution/frameworks/arkts-napi.js.map +1 -1
  152. package/dist/resolution/index.d.ts.map +1 -1
  153. package/dist/resolution/index.js +1 -1
  154. package/dist/resolution/index.js.map +1 -1
  155. package/dist/resolution/memory-budget.d.ts +33 -0
  156. package/dist/resolution/memory-budget.d.ts.map +1 -1
  157. package/dist/resolution/memory-budget.js +58 -0
  158. package/dist/resolution/memory-budget.js.map +1 -1
  159. package/dist/resolution/resolver-pool.d.ts +2 -0
  160. package/dist/resolution/resolver-pool.d.ts.map +1 -1
  161. package/dist/resolution/resolver-pool.js +4 -0
  162. package/dist/resolution/resolver-pool.js.map +1 -1
  163. package/dist/search/query-utils.d.ts +116 -4
  164. package/dist/search/query-utils.d.ts.map +1 -1
  165. package/dist/search/query-utils.js +869 -60
  166. package/dist/search/query-utils.js.map +1 -1
  167. package/dist/spec/db/commit-node.js +4 -4
  168. package/dist/spec/db/fragment-node.js +10 -10
  169. package/dist/spec/db/fts.js +8 -8
  170. package/dist/spec/db/relations.js +88 -88
  171. package/dist/spec/db/schema.js +6 -6
  172. package/dist/spec/db/schema.sql +121 -121
  173. package/dist/spec/db/spec-node.js +4 -4
  174. package/dist/spec/llm/prompts.js +53 -53
  175. package/dist/types.d.ts +8 -0
  176. package/dist/types.d.ts.map +1 -1
  177. package/dist/ui/shimmer-progress.d.ts.map +1 -1
  178. package/dist/ui/shimmer-progress.js +4 -1
  179. package/dist/ui/shimmer-progress.js.map +1 -1
  180. package/dist/upgrade/index.d.ts +14 -26
  181. package/dist/upgrade/index.d.ts.map +1 -1
  182. package/dist/upgrade/index.js +28 -123
  183. package/dist/upgrade/index.js.map +1 -1
  184. package/dist/upgrade/remove-binary.d.ts +19 -19
  185. package/dist/upgrade/remove-binary.d.ts.map +1 -1
  186. package/dist/upgrade/remove-binary.js +20 -21
  187. package/dist/upgrade/remove-binary.js.map +1 -1
  188. package/dist/upgrade/update-check.d.ts +4 -3
  189. package/dist/upgrade/update-check.d.ts.map +1 -1
  190. package/dist/upgrade/update-check.js +4 -3
  191. package/dist/upgrade/update-check.js.map +1 -1
  192. package/package.json +65 -62
  193. package/dist/extraction/languages/arkts-viewtree.d.ts +0 -22
  194. package/dist/extraction/languages/arkts-viewtree.d.ts.map +0 -1
  195. package/dist/extraction/languages/arkts-viewtree.js +0 -133
  196. package/dist/extraction/languages/arkts-viewtree.js.map +0 -1
  197. package/dist/reasoning/config.d.ts +0 -45
  198. package/dist/reasoning/config.d.ts.map +0 -1
  199. package/dist/reasoning/config.js +0 -171
  200. package/dist/reasoning/config.js.map +0 -1
  201. package/dist/reasoning/credentials.d.ts +0 -5
  202. package/dist/reasoning/credentials.d.ts.map +0 -1
  203. package/dist/reasoning/credentials.js +0 -83
  204. package/dist/reasoning/credentials.js.map +0 -1
  205. package/dist/reasoning/login.d.ts +0 -21
  206. package/dist/reasoning/login.d.ts.map +0 -1
  207. package/dist/reasoning/login.js +0 -85
  208. package/dist/reasoning/login.js.map +0 -1
  209. package/dist/reasoning/reasoner.d.ts +0 -43
  210. package/dist/reasoning/reasoner.d.ts.map +0 -1
  211. package/dist/reasoning/reasoner.js +0 -308
  212. package/dist/reasoning/reasoner.js.map +0 -1
  213. package/dist/spec/evolve/llm-client.d.ts +0 -50
  214. package/dist/spec/evolve/llm-client.d.ts.map +0 -1
  215. package/dist/spec/evolve/llm-client.js +0 -176
  216. package/dist/spec/evolve/llm-client.js.map +0 -1
  217. package/dist/spec/evolve/logic-checker.d.ts +0 -12
  218. package/dist/spec/evolve/logic-checker.d.ts.map +0 -1
  219. package/dist/spec/evolve/logic-checker.js +0 -24
  220. package/dist/spec/evolve/logic-checker.js.map +0 -1
  221. package/dist/spec/llm/index.d.ts +0 -3
  222. package/dist/spec/llm/index.d.ts.map +0 -1
  223. package/dist/spec/llm/index.js +0 -11
  224. package/dist/spec/llm/index.js.map +0 -1
  225. package/dist/spec/mining/diff-parser.d.ts +0 -33
  226. package/dist/spec/mining/diff-parser.d.ts.map +0 -1
  227. package/dist/spec/mining/diff-parser.js +0 -166
  228. package/dist/spec/mining/diff-parser.js.map +0 -1
  229. package/dist/spec/mining/git-scanner.d.ts +0 -103
  230. package/dist/spec/mining/git-scanner.d.ts.map +0 -1
  231. package/dist/spec/mining/git-scanner.js +0 -307
  232. package/dist/spec/mining/git-scanner.js.map +0 -1
  233. package/dist/spec/mining/pipeline.d.ts +0 -53
  234. package/dist/spec/mining/pipeline.d.ts.map +0 -1
  235. package/dist/spec/mining/pipeline.js +0 -178
  236. package/dist/spec/mining/pipeline.js.map +0 -1
  237. package/dist/spec/mining/scope-resolver.d.ts +0 -45
  238. package/dist/spec/mining/scope-resolver.d.ts.map +0 -1
  239. package/dist/spec/mining/scope-resolver.js +0 -103
  240. package/dist/spec/mining/scope-resolver.js.map +0 -1
  241. package/dist/spec/mining/spec-extractor.d.ts +0 -69
  242. package/dist/spec/mining/spec-extractor.d.ts.map +0 -1
  243. package/dist/spec/mining/spec-extractor.js +0 -369
  244. package/dist/spec/mining/spec-extractor.js.map +0 -1
  245. package/dist/spec/utils.d.ts +0 -167
  246. package/dist/spec/utils.d.ts.map +0 -1
  247. package/dist/spec/utils.js +0 -463
  248. package/dist/spec/utils.js.map +0 -1
  249. package/dist/telemetry/index.d.ts +0 -143
  250. package/dist/telemetry/index.d.ts.map +0 -1
  251. package/dist/telemetry/index.js +0 -541
  252. package/dist/telemetry/index.js.map +0 -1
  253. package/scripts/_tmp-cfwk-resolve.log +0 -0
  254. package/scripts/_tmp-cfwk-sig.log +0 -0
  255. package/scripts/_tmp-cfwk-vt.log +0 -0
  256. package/scripts/add-lang/bench.sh +0 -60
  257. package/scripts/add-lang/check-grammar.mjs +0 -75
  258. package/scripts/add-lang/dump-ast.mjs +0 -103
  259. package/scripts/add-lang/verify-extraction.mjs +0 -70
  260. package/scripts/agent-eval/ab-adoption.sh +0 -91
  261. package/scripts/agent-eval/ab-hook.sh +0 -86
  262. package/scripts/agent-eval/ab-impl.sh +0 -78
  263. package/scripts/agent-eval/ab-new-vs-baseline.sh +0 -102
  264. package/scripts/agent-eval/ab-sufficiency.sh +0 -78
  265. package/scripts/agent-eval/arms-F.sh +0 -21
  266. package/scripts/agent-eval/arms-matrix.sh +0 -37
  267. package/scripts/agent-eval/audit.sh +0 -68
  268. package/scripts/agent-eval/bench-readme.sh +0 -28
  269. package/scripts/agent-eval/bench-why-repo.sh +0 -22
  270. package/scripts/agent-eval/block-read-hook.sh +0 -19
  271. package/scripts/agent-eval/hook-settings.json +0 -15
  272. package/scripts/agent-eval/itrun.sh +0 -120
  273. package/scripts/agent-eval/offload-eval-3arm.sh +0 -72
  274. package/scripts/agent-eval/offload-eval-cost.mjs +0 -133
  275. package/scripts/agent-eval/offload-eval-effort.mjs +0 -108
  276. package/scripts/agent-eval/offload-eval-frontload-matrix.sh +0 -25
  277. package/scripts/agent-eval/offload-eval-frontload.sh +0 -47
  278. package/scripts/agent-eval/offload-eval-ground-truth.json +0 -18
  279. package/scripts/agent-eval/offload-eval-hook.mjs +0 -84
  280. package/scripts/agent-eval/offload-eval-judge.mjs +0 -103
  281. package/scripts/agent-eval/offload-eval-matrix.sh +0 -20
  282. package/scripts/agent-eval/offload-eval-metrics.mjs +0 -94
  283. package/scripts/agent-eval/offload-eval-refs1.sh +0 -50
  284. package/scripts/agent-eval/offload-eval-setup.sh +0 -24
  285. package/scripts/agent-eval/offload-eval-styles.sh +0 -72
  286. package/scripts/agent-eval/offload-eval-summarize.mjs +0 -68
  287. package/scripts/agent-eval/offload-eval.md +0 -76
  288. package/scripts/agent-eval/parse-arms.mjs +0 -116
  289. package/scripts/agent-eval/parse-bench-readme.mjs +0 -84
  290. package/scripts/agent-eval/parse-run.mjs +0 -45
  291. package/scripts/agent-eval/parse-session.mjs +0 -93
  292. package/scripts/agent-eval/probe-context.mjs +0 -21
  293. package/scripts/agent-eval/probe-explore.mjs +0 -40
  294. package/scripts/agent-eval/probe-node.mjs +0 -20
  295. package/scripts/agent-eval/probe-sweep.mjs +0 -119
  296. package/scripts/agent-eval/probe-trace.mjs +0 -20
  297. package/scripts/agent-eval/redirect-read-hook.sh +0 -38
  298. package/scripts/agent-eval/repro-concurrent-explore.mjs +0 -119
  299. package/scripts/agent-eval/repro-daemon-clients.mjs +0 -125
  300. package/scripts/agent-eval/run-agent.sh +0 -34
  301. package/scripts/agent-eval/run-all.sh +0 -75
  302. package/scripts/agent-eval/run-arms.sh +0 -56
  303. package/scripts/agent-eval/seq-matrix.mjs +0 -137
  304. package/scripts/bench-arkts-init-rss.log +0 -0
  305. package/scripts/build-bundle.sh +0 -123
  306. package/scripts/exp_boundary_eval/README.md +0 -247
  307. package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-310.pyc +0 -0
  308. package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-38.pyc +0 -0
  309. package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-310.pyc +0 -0
  310. package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-38.pyc +0 -0
  311. package/scripts/exp_boundary_eval/__pycache__/deveco_arm.cpython-38.pyc +0 -0
  312. package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-310.pyc +0 -0
  313. package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-38.pyc +0 -0
  314. package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-310.pyc +0 -0
  315. package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-38.pyc +0 -0
  316. package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-310.pyc +0 -0
  317. package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-38.pyc +0 -0
  318. package/scripts/exp_boundary_eval/__pycache__/setup.cpython-310.pyc +0 -0
  319. package/scripts/exp_boundary_eval/__pycache__/setup.cpython-38.pyc +0 -0
  320. package/scripts/exp_boundary_eval/__pycache__/win_mcp_launcher.cpython-38.pyc +0 -0
  321. package/scripts/exp_boundary_eval/_test_mcp_chain.py +0 -78
  322. package/scripts/exp_boundary_eval/_test_stdin.py +0 -8
  323. package/scripts/exp_boundary_eval/_utils.py +0 -1116
  324. package/scripts/exp_boundary_eval/analyze.py +0 -1313
  325. package/scripts/exp_boundary_eval/deveco_arm.py +0 -519
  326. package/scripts/exp_boundary_eval/run_all.py +0 -378
  327. package/scripts/exp_boundary_eval/run_one.py +0 -165
  328. package/scripts/exp_boundary_eval/run_session.py +0 -158
  329. package/scripts/exp_boundary_eval/setup.py +0 -120
  330. package/scripts/exp_boundary_eval/win_mcp_launcher.py +0 -73
  331. package/scripts/exp_boundary_eval/win_mcp_stdio_wrap.js +0 -36
  332. package/scripts/exp_boundary_eval/win_node_launcher.py +0 -24
  333. package/scripts/extract-release-notes.mjs +0 -130
  334. package/scripts/local-install.sh +0 -41
  335. package/scripts/npm-sdk.js +0 -75
  336. package/scripts/npm-shim.js +0 -275
  337. package/scripts/ohos-sdk-publish.mjs +0 -133
  338. package/scripts/pack-npm.sh +0 -119
  339. package/scripts/prepare-release.mjs +0 -270
  340. package/scripts/probe-arkts-mem-why-run.log +0 -0
  341. package/scripts/probe-banner-livecard-ir.log +0 -0
  342. package/scripts/probe-cfwk-ast.stderr.log +0 -0
  343. package/scripts/probe-cfwk-ast.stdout.log +0 -0
  344. package/scripts/probe-cfwk-attr-shape.log +0 -0
  345. package/scripts/probe-cfwk-cfgdump.stderr.log +0 -0
  346. package/scripts/probe-cfwk-cfgdump.stdout.log +0 -0
  347. package/scripts/probe-cfwk-cvc.stderr.log +0 -0
  348. package/scripts/probe-cfwk-cvc.stdout.log +0 -0
  349. package/scripts/probe-cfwk-diag2.log +0 -0
  350. package/scripts/probe-cfwk-diag3.log +0 -0
  351. package/scripts/probe-cfwk-fedbg.stderr.log +0 -0
  352. package/scripts/probe-cfwk-fedbg.stdout.log +0 -0
  353. package/scripts/probe-cfwk-fileresult.log +0 -0
  354. package/scripts/probe-cfwk-fix.stderr.log +0 -0
  355. package/scripts/probe-cfwk-fix.stdout.log +0 -0
  356. package/scripts/probe-cfwk-fix2.stderr.log +0 -0
  357. package/scripts/probe-cfwk-fix2.stdout.log +0 -0
  358. package/scripts/probe-cfwk-fix3.stderr.log +0 -0
  359. package/scripts/probe-cfwk-fix3.stdout.log +0 -0
  360. package/scripts/probe-cfwk-foreach.log +0 -0
  361. package/scripts/probe-cfwk-getmethod-throw.log +0 -0
  362. package/scripts/probe-cfwk-hg-extract.log +0 -0
  363. package/scripts/probe-cfwk-pr1003-noprior.stderr.log +0 -0
  364. package/scripts/probe-cfwk-pr1003-noprior.stdout.log +0 -0
  365. package/scripts/probe-cfwk-pr1003.stderr.log +0 -0
  366. package/scripts/probe-cfwk-pr1003.stdout.log +0 -0
  367. package/scripts/probe-cfwk-preroot-noprior.stderr.log +0 -0
  368. package/scripts/probe-cfwk-preroot-noprior.stdout.log +0 -0
  369. package/scripts/probe-cfwk-preroot-prior.stderr.log +0 -0
  370. package/scripts/probe-cfwk-preroot-prior.stdout.log +0 -0
  371. package/scripts/probe-cfwk-preroot-skipstate.stderr.log +0 -0
  372. package/scripts/probe-cfwk-preroot-skipstate.stdout.log +0 -0
  373. package/scripts/probe-cfwk-resolve-sim.log +0 -0
  374. package/scripts/probe-cfwk-tree-shape.log +0 -0
  375. package/scripts/probe-cfwk-walk-abort.log +0 -0
  376. package/scripts/probe-cfwk.log +0 -0
  377. package/scripts/probe-force-index.log +0 -0
  378. package/scripts/probe-no-force-index.log +0 -0
  379. package/scripts/probe-samefile-ir.stderr.log +0 -0
  380. package/scripts/probe-samefile-ir.stdout.log +0 -224
  381. package/scripts/probe-sdk-vs-project.log +0 -0
  382. package/scripts/probe-viewtree-downgrade.log +0 -0
@@ -1,167 +0,0 @@
1
- /**
2
- * Spec utility functions — replaces `file_utils.py`, `meta.py`, and
3
- * `truncate.py` from Python Commit4Spec.
4
- *
5
- * Covers file I/O, meta.json read/write, text/diff truncation, and budget
6
- * computation. All functions are synchronous and use Node.js built-ins.
7
- *
8
- * @module spec/utils
9
- */
10
- export interface SpecEntry {
11
- specId: string;
12
- entryType: 'directory' | 'file';
13
- path: string;
14
- }
15
- export interface SpecMeta {
16
- repoPath: string;
17
- specStoragePath: string;
18
- currentCommitID?: string;
19
- createdAt?: string;
20
- updatedAt: string;
21
- }
22
- export interface BudgetProfile {
23
- tier: 'tiny' | 'small' | 'medium' | 'large' | 'vlarge';
24
- maxFragments: number;
25
- maxContents: number;
26
- contentBudget: number;
27
- }
28
- /** Root directory for spec data, relative to the repository root. */
29
- export declare const SPEC_DATA_DIR = ".homegraph/commit4spec";
30
- /**
31
- * Read a UTF-8 file synchronously.
32
- *
33
- * Returns `null` for ENOENT (not found), EISDIR (is a directory), or EACCES
34
- * (permission denied). Other errors propagate.
35
- */
36
- export declare function readFileContent(filePath: string): string | null;
37
- /**
38
- * Write a UTF-8 file synchronously, creating parent directories as needed.
39
- *
40
- * Parent directories are created with `fs.mkdirSync({ recursive: true })`.
41
- * If the parent exists but is not a directory the underlying error propagates.
42
- */
43
- export declare function writeFileContent(filePath: string, content: string): void;
44
- /**
45
- * Parse commit-info.md content for a commit hash.
46
- *
47
- * Searches line by line for one of:
48
- * - `commit: HASH`
49
- * - `commit-id: HASH`
50
- * - `commit_id: HASH`
51
- * - a bare 40-char hex hash on its own line
52
- *
53
- * Returns the first matched hash (7–40 hex chars), or `null` if no hash is
54
- * found. Empty or whitespace-only input returns `null`.
55
- */
56
- export declare function parseCommitInfoMd(content: string): string | null;
57
- /**
58
- * Discover specs in a storage directory.
59
- *
60
- * A "spec" is any `.md` file OR any subdirectory. For `.md` files the
61
- * `specId` is the basename without the extension. For subdirectories the
62
- * `specId` is the directory name.
63
- *
64
- * Returns an empty array when `specStoragePath` does not exist or is not a
65
- * directory.
66
- */
67
- export declare function discoverSpecs(specStoragePath: string): SpecEntry[];
68
- /**
69
- * Resolve the database path.
70
- *
71
- * Priority:
72
- * 1. If `explicitDbPath` is given, return it as-is (no side effects).
73
- * 2. If `repoPath` is given, default to `{repoPath}/${SPEC_DATA_DIR}/commit4spec.db`
74
- * and ensure `${SPEC_DATA_DIR}/.gitignore` exists containing `"*"`.
75
- * 3. If neither is given, return `"./commit4spec.db"`.
76
- */
77
- export declare function resolveDbPath(repoPath?: string, explicitDbPath?: string): string;
78
- /**
79
- * Read `${SPEC_DATA_DIR}/meta.json` from `repoPath`.
80
- *
81
- * Returns `null` when the file is missing, unreadable, or contains invalid
82
- * JSON or a JSON value that is not a plain object.
83
- */
84
- export declare function readMeta(repoPath: string): SpecMeta | null;
85
- /**
86
- * Write `${SPEC_DATA_DIR}/meta.json` to `repoPath`.
87
- *
88
- * If existing meta has a `createdAt` field it is preserved; otherwise a new
89
- * ISO-8601 timestamp is generated. `updatedAt` is always set to the current
90
- * time. The `${SPEC_DATA_DIR}` directory is created if it does not exist.
91
- *
92
- * Returns the full `SpecMeta` that was written.
93
- */
94
- export declare function writeMeta(repoPath: string, specStoragePath: string, currentCommitID?: string): SpecMeta;
95
- /**
96
- * Truncate a unified diff at a sensible boundary.
97
- *
98
- * The algorithm prefers semantic boundaries to keep diffs readable:
99
- *
100
- * 1. If the diff is shorter than `maxChars` (default 3800), return it unchanged.
101
- * 2. Try: find the **last** `@@` hunk header in the trailing 50% portion of
102
- * the diff and cut right before it.
103
- * 3. Fallback: find the **last** newline in the trailing 80% portion and cut
104
- * after it.
105
- * 4. Hard fallback: cut exactly at `maxChars`.
106
- *
107
- * Always appends `" …(truncated)"` when truncation occurs.
108
- *
109
- * @param diff - The unified diff text to truncate.
110
- * @param maxChars - Maximum allowed characters (including suffix). Default 3800.
111
- * @returns The (possibly truncated) diff text.
112
- */
113
- export declare function truncateCodeDiff(diff: string, maxChars?: number): string;
114
- /**
115
- * Truncate plain text with newline-awareness.
116
- *
117
- * When the text is longer than `maxChars`, it is cut at the last newline
118
- * found before `maxChars` (minus the suffix length). If no suitable newline
119
- * exists, a hard cut is made.
120
- *
121
- * The suffix `" …(truncated)"` is appended only when truncation occurs.
122
- *
123
- * @param text - The text to truncate.
124
- * @param maxChars - Maximum allowed characters (including suffix).
125
- * @returns The (possibly truncated) text.
126
- */
127
- export declare function truncateText(text: string, maxChars: number): string;
128
- /**
129
- * Truncate a subtitles array.
130
- *
131
- * 1. If the array has more than `maxEntries`, it is sliced to `maxEntries`.
132
- * 2. Each remaining entry that exceeds `maxChars` is individually truncated
133
- * via `truncateText`.
134
- *
135
- * Entries that already fit within both limits are left unchanged.
136
- *
137
- * @param subtitles - Array of subtitle strings.
138
- * @param maxChars - Maximum characters per entry (including suffix).
139
- * @param maxEntries - Maximum number of entries to keep.
140
- * @returns The truncated subtitles array (always a new array).
141
- */
142
- export declare function truncateSubtitles(subtitles: string[], maxChars: number, maxEntries: number): string[];
143
- /**
144
- * Compute a budget profile based on spec and optional fragment counts.
145
- *
146
- * The profile determines how many fragments, contents, and characters the
147
- * pipeline should budget when building LLM prompts. Higher counts produce
148
- * tighter budgets to keep prompts manageable.
149
- *
150
- * Thresholds (matching `truncate.py:38-57`):
151
- *
152
- * | specCount | tier | maxFragments | maxContents | contentBudget |
153
- * |-----------|---------|--------------|-------------|---------------|
154
- * | ≤ 3 | tiny | 12 | 16 | 48000 |
155
- * | ≤ 8 | small | 10 | 14 | 40000 |
156
- * | ≤ 15 | medium | 8 | 12 | 32000 |
157
- * | ≤ 30 | large | 6 | 10 | 24000 |
158
- * | > 30 | vlarge | 0 | 0 | 16000 |
159
- *
160
- * The `vlarge` tier disables fragment/contents inclusion entirely (0 values).
161
- *
162
- * @param specCount - Number of specs in the knowledge graph.
163
- * @param fragmentCount - (Unused) reserved for future per-fragment weighting.
164
- * @returns The budget profile for the given scale.
165
- */
166
- export declare function computeBudgetProfile(specCount: number, _fragmentCount?: number): BudgetProfile;
167
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/spec/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,WAAW,GAAG,MAAM,CAAC;IAChC,IAAI,EAAE,MAA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;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAa,GAAG,MAAM,CA6C9E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoBnE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EAAE,EACnB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,EAAE,CAMV;AAMD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,cAAc,CAAC,EAAE,MAAM,GACtB,aAAa,CAcf"}
@@ -1,463 +0,0 @@
1
- "use strict";
2
- /**
3
- * Spec utility functions — replaces `file_utils.py`, `meta.py`, and
4
- * `truncate.py` from Python Commit4Spec.
5
- *
6
- * Covers file I/O, meta.json read/write, text/diff truncation, and budget
7
- * computation. All functions are synchronous and use Node.js built-ins.
8
- *
9
- * @module spec/utils
10
- */
11
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
- if (k2 === undefined) k2 = k;
13
- var desc = Object.getOwnPropertyDescriptor(m, k);
14
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
- desc = { enumerable: true, get: function() { return m[k]; } };
16
- }
17
- Object.defineProperty(o, k2, desc);
18
- }) : (function(o, m, k, k2) {
19
- if (k2 === undefined) k2 = k;
20
- o[k2] = m[k];
21
- }));
22
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
- Object.defineProperty(o, "default", { enumerable: true, value: v });
24
- }) : function(o, v) {
25
- o["default"] = v;
26
- });
27
- var __importStar = (this && this.__importStar) || (function () {
28
- var ownKeys = function(o) {
29
- ownKeys = Object.getOwnPropertyNames || function (o) {
30
- var ar = [];
31
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
32
- return ar;
33
- };
34
- return ownKeys(o);
35
- };
36
- return function (mod) {
37
- if (mod && mod.__esModule) return mod;
38
- var result = {};
39
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
40
- __setModuleDefault(result, mod);
41
- return result;
42
- };
43
- })();
44
- Object.defineProperty(exports, "__esModule", { value: true });
45
- exports.SPEC_DATA_DIR = void 0;
46
- exports.readFileContent = readFileContent;
47
- exports.writeFileContent = writeFileContent;
48
- exports.parseCommitInfoMd = parseCommitInfoMd;
49
- exports.discoverSpecs = discoverSpecs;
50
- exports.resolveDbPath = resolveDbPath;
51
- exports.readMeta = readMeta;
52
- exports.writeMeta = writeMeta;
53
- exports.truncateCodeDiff = truncateCodeDiff;
54
- exports.truncateText = truncateText;
55
- exports.truncateSubtitles = truncateSubtitles;
56
- exports.computeBudgetProfile = computeBudgetProfile;
57
- const fs = __importStar(require("fs"));
58
- const path = __importStar(require("path"));
59
- const errors_1 = require("../errors");
60
- // =============================================================================
61
- // Constants
62
- // =============================================================================
63
- /** Root directory for spec data, relative to the repository root. */
64
- exports.SPEC_DATA_DIR = '.homegraph/commit4spec';
65
- const TRUNCATION_SUFFIX = ' …(truncated)';
66
- const TRUNCATION_SUFFIX_LENGTH = TRUNCATION_SUFFIX.length;
67
- // =============================================================================
68
- // File I/O
69
- // =============================================================================
70
- /**
71
- * Read a UTF-8 file synchronously.
72
- *
73
- * Returns `null` for ENOENT (not found), EISDIR (is a directory), or EACCES
74
- * (permission denied). Other errors propagate.
75
- */
76
- function readFileContent(filePath) {
77
- try {
78
- return fs.readFileSync(filePath, 'utf-8');
79
- }
80
- catch (err) {
81
- if (err.code === 'ENOENT' || err.code === 'EISDIR' || err.code === 'EACCES') {
82
- return null;
83
- }
84
- throw err;
85
- }
86
- }
87
- /**
88
- * Write a UTF-8 file synchronously, creating parent directories as needed.
89
- *
90
- * Parent directories are created with `fs.mkdirSync({ recursive: true })`.
91
- * If the parent exists but is not a directory the underlying error propagates.
92
- */
93
- function writeFileContent(filePath, content) {
94
- const dir = path.dirname(filePath);
95
- if (dir && dir !== '.') {
96
- fs.mkdirSync(dir, { recursive: true });
97
- }
98
- fs.writeFileSync(filePath, content, 'utf-8');
99
- }
100
- // =============================================================================
101
- // Commit-info.md parsing
102
- // =============================================================================
103
- /**
104
- * Regex matching commit-hash annotations in commit-info.md content.
105
- *
106
- * Matches lines like:
107
- * commit: abc123def456...
108
- * commit-id: abc123def456...
109
- * commit_id: abc123def456...
110
- * commit-id=abc123def456...
111
- * abc123def456789... (bare 40-char hex on its own line)
112
- */
113
- const COMMIT_HASH_RE = /^commit[-_ ]?(?:id)?[:= ]\s*([a-f0-9]{7,40})\s*$/i;
114
- const BARE_HASH_RE = /^([a-f0-9]{40})\s*$/i;
115
- /**
116
- * Parse commit-info.md content for a commit hash.
117
- *
118
- * Searches line by line for one of:
119
- * - `commit: HASH`
120
- * - `commit-id: HASH`
121
- * - `commit_id: HASH`
122
- * - a bare 40-char hex hash on its own line
123
- *
124
- * Returns the first matched hash (7–40 hex chars), or `null` if no hash is
125
- * found. Empty or whitespace-only input returns `null`.
126
- */
127
- function parseCommitInfoMd(content) {
128
- if (!content)
129
- return null;
130
- for (const line of content.split('\n')) {
131
- const trimmed = line.trim();
132
- if (!trimmed)
133
- continue;
134
- // Try annotated hash first
135
- const match = COMMIT_HASH_RE.exec(trimmed);
136
- if (match) {
137
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
138
- return match[1].toLowerCase();
139
- }
140
- // Try bare 40-char hex
141
- const bareMatch = BARE_HASH_RE.exec(trimmed);
142
- if (bareMatch) {
143
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
144
- return bareMatch[1].toLowerCase();
145
- }
146
- }
147
- return null;
148
- }
149
- // =============================================================================
150
- // Spec discovery
151
- // =============================================================================
152
- /**
153
- * Discover specs in a storage directory.
154
- *
155
- * A "spec" is any `.md` file OR any subdirectory. For `.md` files the
156
- * `specId` is the basename without the extension. For subdirectories the
157
- * `specId` is the directory name.
158
- *
159
- * Returns an empty array when `specStoragePath` does not exist or is not a
160
- * directory.
161
- */
162
- function discoverSpecs(specStoragePath) {
163
- let entries;
164
- try {
165
- entries = fs.readdirSync(specStoragePath, { withFileTypes: true });
166
- }
167
- catch (err) {
168
- // Non-existent or not a directory → empty list
169
- return [];
170
- }
171
- const result = [];
172
- for (const entry of entries) {
173
- if (entry.isDirectory()) {
174
- result.push({
175
- specId: entry.name,
176
- entryType: 'directory',
177
- path: path.join(specStoragePath, entry.name),
178
- });
179
- }
180
- else if (entry.isFile() && entry.name.endsWith('.md')) {
181
- result.push({
182
- specId: entry.name.slice(0, -3), // strip ".md"
183
- entryType: 'file',
184
- path: path.join(specStoragePath, entry.name),
185
- });
186
- }
187
- // Symlinks, other file types, and dot-files are silently skipped.
188
- }
189
- return result;
190
- }
191
- // =============================================================================
192
- // Database path resolution
193
- // =============================================================================
194
- /**
195
- * Resolve the database path.
196
- *
197
- * Priority:
198
- * 1. If `explicitDbPath` is given, return it as-is (no side effects).
199
- * 2. If `repoPath` is given, default to `{repoPath}/${SPEC_DATA_DIR}/commit4spec.db`
200
- * and ensure `${SPEC_DATA_DIR}/.gitignore` exists containing `"*"`.
201
- * 3. If neither is given, return `"./commit4spec.db"`.
202
- */
203
- function resolveDbPath(repoPath, explicitDbPath) {
204
- if (explicitDbPath) {
205
- return explicitDbPath;
206
- }
207
- if (repoPath) {
208
- const commit4specDir = path.join(repoPath, exports.SPEC_DATA_DIR);
209
- const gitignorePath = path.join(commit4specDir, '.gitignore');
210
- const dbPath = path.join(commit4specDir, 'commit4spec.db');
211
- // Ensure ${SPEC_DATA_DIR} directory exists
212
- try {
213
- fs.mkdirSync(commit4specDir, { recursive: true });
214
- }
215
- catch {
216
- // Directory may already exist; ok.
217
- }
218
- // Write .gitignore if it doesn't exist
219
- if (!fs.existsSync(gitignorePath)) {
220
- try {
221
- fs.writeFileSync(gitignorePath, '*\n', 'utf-8');
222
- }
223
- catch (err) {
224
- (0, errors_1.logWarn)(`Failed to write ${exports.SPEC_DATA_DIR}/.gitignore`, {
225
- path: gitignorePath,
226
- error: err instanceof Error ? err.message : String(err),
227
- });
228
- }
229
- }
230
- return dbPath;
231
- }
232
- return './commit4spec.db';
233
- }
234
- // =============================================================================
235
- // Meta read / write
236
- // =============================================================================
237
- /**
238
- * Read `${SPEC_DATA_DIR}/meta.json` from `repoPath`.
239
- *
240
- * Returns `null` when the file is missing, unreadable, or contains invalid
241
- * JSON or a JSON value that is not a plain object.
242
- */
243
- function readMeta(repoPath) {
244
- const metaPath = path.join(repoPath, exports.SPEC_DATA_DIR, 'meta.json');
245
- let raw;
246
- try {
247
- raw = fs.readFileSync(metaPath, 'utf-8');
248
- }
249
- catch {
250
- return null;
251
- }
252
- let parsed;
253
- try {
254
- parsed = JSON.parse(raw);
255
- }
256
- catch {
257
- (0, errors_1.logWarn)(`Ignoring ${exports.SPEC_DATA_DIR}/meta.json: not valid JSON`, {
258
- path: metaPath,
259
- });
260
- return null;
261
- }
262
- if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
263
- (0, errors_1.logWarn)(`Ignoring ${exports.SPEC_DATA_DIR}/meta.json: top-level value must be a JSON object`, { path: metaPath });
264
- return null;
265
- }
266
- const obj = parsed;
267
- // Validate required string fields
268
- if (typeof obj.repoPath !== 'string' || typeof obj.specStoragePath !== 'string') {
269
- (0, errors_1.logWarn)(`Ignoring ${exports.SPEC_DATA_DIR}/meta.json: repoPath and specStoragePath must be strings`, { path: metaPath });
270
- return null;
271
- }
272
- return {
273
- repoPath: obj.repoPath,
274
- specStoragePath: obj.specStoragePath,
275
- currentCommitID: typeof obj.currentCommitID === 'string' ? obj.currentCommitID : undefined,
276
- createdAt: typeof obj.createdAt === 'string' ? obj.createdAt : undefined,
277
- updatedAt: typeof obj.updatedAt === 'string' ? obj.updatedAt : new Date().toISOString(),
278
- };
279
- }
280
- /**
281
- * Write `${SPEC_DATA_DIR}/meta.json` to `repoPath`.
282
- *
283
- * If existing meta has a `createdAt` field it is preserved; otherwise a new
284
- * ISO-8601 timestamp is generated. `updatedAt` is always set to the current
285
- * time. The `${SPEC_DATA_DIR}` directory is created if it does not exist.
286
- *
287
- * Returns the full `SpecMeta` that was written.
288
- */
289
- function writeMeta(repoPath, specStoragePath, currentCommitID) {
290
- const metaDir = path.join(repoPath, exports.SPEC_DATA_DIR);
291
- const metaPath = path.join(metaDir, 'meta.json');
292
- const now = new Date().toISOString();
293
- // Preserve createdAt from existing meta if available
294
- let createdAt;
295
- const existing = readMeta(repoPath);
296
- if (existing && existing.createdAt) {
297
- createdAt = existing.createdAt;
298
- }
299
- const meta = {
300
- repoPath,
301
- specStoragePath,
302
- currentCommitID,
303
- createdAt,
304
- updatedAt: now,
305
- };
306
- fs.mkdirSync(metaDir, { recursive: true });
307
- fs.writeFileSync(metaPath, JSON.stringify(meta, null, 2) + '\n', 'utf-8');
308
- return meta;
309
- }
310
- // =============================================================================
311
- // Truncation utilities
312
- // =============================================================================
313
- /**
314
- * Truncate a unified diff at a sensible boundary.
315
- *
316
- * The algorithm prefers semantic boundaries to keep diffs readable:
317
- *
318
- * 1. If the diff is shorter than `maxChars` (default 3800), return it unchanged.
319
- * 2. Try: find the **last** `@@` hunk header in the trailing 50% portion of
320
- * the diff and cut right before it.
321
- * 3. Fallback: find the **last** newline in the trailing 80% portion and cut
322
- * after it.
323
- * 4. Hard fallback: cut exactly at `maxChars`.
324
- *
325
- * Always appends `" …(truncated)"` when truncation occurs.
326
- *
327
- * @param diff - The unified diff text to truncate.
328
- * @param maxChars - Maximum allowed characters (including suffix). Default 3800.
329
- * @returns The (possibly truncated) diff text.
330
- */
331
- function truncateCodeDiff(diff, maxChars = 3800) {
332
- if (diff.length <= maxChars) {
333
- return diff;
334
- }
335
- const suffix = TRUNCATION_SUFFIX;
336
- const effectiveMax = maxChars - TRUNCATION_SUFFIX_LENGTH;
337
- if (effectiveMax <= 0) {
338
- return diff.slice(0, Math.max(0, maxChars - 1)) + suffix;
339
- }
340
- // Step 2: find last "@@" hunk header in trailing 50%
341
- const halfPoint = Math.floor(diff.length * 0.5);
342
- // We search for "\n@@" or "@@" at the very start. Use a regex that
343
- // matches a line starting with "@@" (after optional leading whitespace in
344
- // some edge cases, but standard diffs have "@@" at column 0).
345
- const hunkHeaderRe = /(^|\n)@@/g;
346
- let lastHunkHeaderPos = -1;
347
- let match;
348
- // Reset lastIndex and scan from the beginning; we only accept matches whose
349
- // index is >= halfPoint.
350
- hunkHeaderRe.lastIndex = 0;
351
- while ((match = hunkHeaderRe.exec(diff)) !== null) {
352
- const cap = match[1]; // the newline-or-start anchor
353
- const pos = match.index + (cap ? cap.length : 0); // position of "@@"
354
- if (pos >= halfPoint && pos <= effectiveMax) {
355
- lastHunkHeaderPos = pos;
356
- }
357
- }
358
- if (lastHunkHeaderPos > 0) {
359
- return diff.slice(0, lastHunkHeaderPos) + suffix;
360
- }
361
- // Step 3: find last "\n" in trailing 80%
362
- const eightyPoint = Math.floor(diff.length * 0.2);
363
- for (let i = effectiveMax - 1; i >= eightyPoint; i--) {
364
- if (diff[i] === '\n' && i < effectiveMax) {
365
- return diff.slice(0, i + 1) + suffix;
366
- }
367
- }
368
- // Step 4: hard cut
369
- return diff.slice(0, effectiveMax) + suffix;
370
- }
371
- /**
372
- * Truncate plain text with newline-awareness.
373
- *
374
- * When the text is longer than `maxChars`, it is cut at the last newline
375
- * found before `maxChars` (minus the suffix length). If no suitable newline
376
- * exists, a hard cut is made.
377
- *
378
- * The suffix `" …(truncated)"` is appended only when truncation occurs.
379
- *
380
- * @param text - The text to truncate.
381
- * @param maxChars - Maximum allowed characters (including suffix).
382
- * @returns The (possibly truncated) text.
383
- */
384
- function truncateText(text, maxChars) {
385
- if (text.length <= maxChars) {
386
- return text;
387
- }
388
- const suffix = TRUNCATION_SUFFIX;
389
- const effectiveMax = maxChars - TRUNCATION_SUFFIX_LENGTH;
390
- if (effectiveMax <= 0) {
391
- return text.slice(0, Math.max(0, maxChars - 1)) + suffix;
392
- }
393
- // Try to find the last newline within the budget
394
- for (let i = effectiveMax - 1; i >= 0; i--) {
395
- if (text[i] === '\n') {
396
- return text.slice(0, i) + suffix;
397
- }
398
- }
399
- // Hard cut
400
- return text.slice(0, effectiveMax) + suffix;
401
- }
402
- /**
403
- * Truncate a subtitles array.
404
- *
405
- * 1. If the array has more than `maxEntries`, it is sliced to `maxEntries`.
406
- * 2. Each remaining entry that exceeds `maxChars` is individually truncated
407
- * via `truncateText`.
408
- *
409
- * Entries that already fit within both limits are left unchanged.
410
- *
411
- * @param subtitles - Array of subtitle strings.
412
- * @param maxChars - Maximum characters per entry (including suffix).
413
- * @param maxEntries - Maximum number of entries to keep.
414
- * @returns The truncated subtitles array (always a new array).
415
- */
416
- function truncateSubtitles(subtitles, maxChars, maxEntries) {
417
- // Cap entry count
418
- const capped = subtitles.length > maxEntries ? subtitles.slice(0, maxEntries) : [...subtitles];
419
- // Truncate each entry
420
- return capped.map((entry) => truncateText(entry, maxChars));
421
- }
422
- // =============================================================================
423
- // Budget profile
424
- // =============================================================================
425
- /**
426
- * Compute a budget profile based on spec and optional fragment counts.
427
- *
428
- * The profile determines how many fragments, contents, and characters the
429
- * pipeline should budget when building LLM prompts. Higher counts produce
430
- * tighter budgets to keep prompts manageable.
431
- *
432
- * Thresholds (matching `truncate.py:38-57`):
433
- *
434
- * | specCount | tier | maxFragments | maxContents | contentBudget |
435
- * |-----------|---------|--------------|-------------|---------------|
436
- * | ≤ 3 | tiny | 12 | 16 | 48000 |
437
- * | ≤ 8 | small | 10 | 14 | 40000 |
438
- * | ≤ 15 | medium | 8 | 12 | 32000 |
439
- * | ≤ 30 | large | 6 | 10 | 24000 |
440
- * | > 30 | vlarge | 0 | 0 | 16000 |
441
- *
442
- * The `vlarge` tier disables fragment/contents inclusion entirely (0 values).
443
- *
444
- * @param specCount - Number of specs in the knowledge graph.
445
- * @param fragmentCount - (Unused) reserved for future per-fragment weighting.
446
- * @returns The budget profile for the given scale.
447
- */
448
- function computeBudgetProfile(specCount, _fragmentCount) {
449
- if (specCount <= 3) {
450
- return { tier: 'tiny', maxFragments: 12, maxContents: 16, contentBudget: 48000 };
451
- }
452
- if (specCount <= 8) {
453
- return { tier: 'small', maxFragments: 10, maxContents: 14, contentBudget: 40000 };
454
- }
455
- if (specCount <= 15) {
456
- return { tier: 'medium', maxFragments: 8, maxContents: 12, contentBudget: 32000 };
457
- }
458
- if (specCount <= 30) {
459
- return { tier: 'large', maxFragments: 6, maxContents: 10, contentBudget: 24000 };
460
- }
461
- return { tier: 'vlarge', maxFragments: 0, maxContents: 0, contentBudget: 16000 };
462
- }
463
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/spec/utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDH,0CASC;AAQD,4CAMC;AA+BD,8CAuBC;AAgBD,sCA6BC;AAeD,sCAiCC;AAYD,4BA8CC;AAWD,8BA6BC;AAwBD,4CA6CC;AAeD,oCAoBC;AAgBD,8CAUC;AA6BD,oDAiBC;AA7eD,uCAAyB;AACzB,2CAA6B;AAC7B,sCAAoC;AA2BpC,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,qEAAqE;AACxD,QAAA,aAAa,GAAG,wBAAwB,CAAC;AAEtD,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAC3C,MAAM,wBAAwB,GAAG,iBAAiB,CAAC,MAAM,CAAC;AAE1D,gFAAgF;AAChF,WAAW;AACX,gFAAgF;AAEhF;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,QAAgB;IAC9C,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,GA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