@cchistory/lite 0.8.3 → 0.9.1

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 (297) hide show
  1. package/INSTALL.md +1 -1
  2. package/apps/lite-cli/dist/agent-contract.d.ts.map +1 -1
  3. package/apps/lite-cli/dist/agent-contract.js +41 -2
  4. package/apps/lite-cli/dist/agent-contract.js.map +1 -1
  5. package/apps/lite-cli/dist/help.js +5 -5
  6. package/apps/lite-cli/dist/index.d.ts.map +1 -1
  7. package/apps/lite-cli/dist/index.js +148 -17
  8. package/apps/lite-cli/dist/index.js.map +1 -1
  9. package/apps/lite-cli/dist/index.test.js +114 -95
  10. package/apps/lite-cli/dist/index.test.js.map +1 -1
  11. package/apps/lite-cli/dist/inventory-and-git.test.d.ts +7 -0
  12. package/apps/lite-cli/dist/inventory-and-git.test.d.ts.map +1 -0
  13. package/apps/lite-cli/dist/inventory-and-git.test.js +776 -0
  14. package/apps/lite-cli/dist/inventory-and-git.test.js.map +1 -0
  15. package/apps/lite-cli/dist/inventory-command.d.ts +30 -0
  16. package/apps/lite-cli/dist/inventory-command.d.ts.map +1 -0
  17. package/apps/lite-cli/dist/inventory-command.js +265 -0
  18. package/apps/lite-cli/dist/inventory-command.js.map +1 -0
  19. package/apps/lite-cli/dist/json-v2.d.ts +2 -2
  20. package/apps/lite-cli/dist/json-v2.d.ts.map +1 -1
  21. package/apps/lite-cli/dist/json-v2.js +9 -3
  22. package/apps/lite-cli/dist/json-v2.js.map +1 -1
  23. package/apps/lite-cli/dist/project-git-command.d.ts +28 -0
  24. package/apps/lite-cli/dist/project-git-command.d.ts.map +1 -0
  25. package/apps/lite-cli/dist/project-git-command.js +288 -0
  26. package/apps/lite-cli/dist/project-git-command.js.map +1 -0
  27. package/apps/lite-cli/dist/startup-render.d.ts +10 -0
  28. package/apps/lite-cli/dist/startup-render.d.ts.map +1 -0
  29. package/apps/lite-cli/dist/startup-render.js +335 -0
  30. package/apps/lite-cli/dist/startup-render.js.map +1 -0
  31. package/apps/lite-cli/dist/version.d.ts +1 -1
  32. package/apps/lite-cli/dist/version.js +1 -1
  33. package/apps/lite-tui/dist/render.d.ts +1 -1
  34. package/apps/lite-tui/dist/version.d.ts +1 -1
  35. package/apps/lite-tui/dist/version.js +1 -1
  36. package/docs/guide/for-agents.md +14 -0
  37. package/docs/guide/lite.md +53 -2
  38. package/node_modules/@cchistory/canonical/dist/agent-inventory.d.ts +25 -0
  39. package/node_modules/@cchistory/canonical/dist/agent-inventory.d.ts.map +1 -0
  40. package/node_modules/@cchistory/canonical/dist/agent-inventory.js +345 -0
  41. package/node_modules/@cchistory/canonical/dist/agent-inventory.js.map +1 -0
  42. package/node_modules/@cchistory/canonical/dist/agent-inventory.test.d.ts +7 -0
  43. package/node_modules/@cchistory/canonical/dist/agent-inventory.test.d.ts.map +1 -0
  44. package/node_modules/@cchistory/canonical/dist/agent-inventory.test.js +231 -0
  45. package/node_modules/@cchistory/canonical/dist/agent-inventory.test.js.map +1 -0
  46. package/node_modules/@cchistory/canonical/dist/directory-scope.d.ts.map +1 -1
  47. package/node_modules/@cchistory/canonical/dist/directory-scope.js +4 -1
  48. package/node_modules/@cchistory/canonical/dist/directory-scope.js.map +1 -1
  49. package/node_modules/@cchistory/canonical/dist/index.d.ts +2 -0
  50. package/node_modules/@cchistory/canonical/dist/index.d.ts.map +1 -1
  51. package/node_modules/@cchistory/canonical/dist/index.js +2 -0
  52. package/node_modules/@cchistory/canonical/dist/index.js.map +1 -1
  53. package/node_modules/@cchistory/canonical/dist/project-merge.d.ts +42 -0
  54. package/node_modules/@cchistory/canonical/dist/project-merge.d.ts.map +1 -0
  55. package/node_modules/@cchistory/canonical/dist/project-merge.js +396 -0
  56. package/node_modules/@cchistory/canonical/dist/project-merge.js.map +1 -0
  57. package/node_modules/@cchistory/canonical/dist/project-merge.test.d.ts +7 -0
  58. package/node_modules/@cchistory/canonical/dist/project-merge.test.d.ts.map +1 -0
  59. package/node_modules/@cchistory/canonical/dist/project-merge.test.js +319 -0
  60. package/node_modules/@cchistory/canonical/dist/project-merge.test.js.map +1 -0
  61. package/node_modules/@cchistory/canonical/dist/query.js +1 -1
  62. package/node_modules/@cchistory/canonical/dist/query.js.map +1 -1
  63. package/node_modules/@cchistory/canonical/dist/session-interpreter.d.ts.map +1 -1
  64. package/node_modules/@cchistory/canonical/dist/session-interpreter.js +38 -0
  65. package/node_modules/@cchistory/canonical/dist/session-interpreter.js.map +1 -1
  66. package/node_modules/@cchistory/canonical/dist/tool-call-summary.d.ts.map +1 -1
  67. package/node_modules/@cchistory/canonical/dist/tool-call-summary.js +18 -2
  68. package/node_modules/@cchistory/canonical/dist/tool-call-summary.js.map +1 -1
  69. package/node_modules/@cchistory/canonical/dist/usage-anomalies.d.ts.map +1 -1
  70. package/node_modules/@cchistory/canonical/dist/usage-anomalies.js +2 -0
  71. package/node_modules/@cchistory/canonical/dist/usage-anomalies.js.map +1 -1
  72. package/node_modules/@cchistory/canonical/dist/usage-call-evaluation.d.ts.map +1 -1
  73. package/node_modules/@cchistory/canonical/dist/usage-call-evaluation.js +4 -1
  74. package/node_modules/@cchistory/canonical/dist/usage-call-evaluation.js.map +1 -1
  75. package/node_modules/@cchistory/canonical/dist/usage-trace.d.ts.map +1 -1
  76. package/node_modules/@cchistory/canonical/dist/usage-trace.js +3 -1
  77. package/node_modules/@cchistory/canonical/dist/usage-trace.js.map +1 -1
  78. package/node_modules/@cchistory/canonical/dist/usage-trace.test.js +73 -0
  79. package/node_modules/@cchistory/canonical/dist/usage-trace.test.js.map +1 -1
  80. package/node_modules/@cchistory/canonical/dist/usage.d.ts +1 -0
  81. package/node_modules/@cchistory/canonical/dist/usage.d.ts.map +1 -1
  82. package/node_modules/@cchistory/canonical/dist/usage.js +23 -17
  83. package/node_modules/@cchistory/canonical/dist/usage.js.map +1 -1
  84. package/node_modules/@cchistory/canonical/package.json +1 -1
  85. package/node_modules/@cchistory/domain/dist/agent-inventory.d.ts +146 -0
  86. package/node_modules/@cchistory/domain/dist/agent-inventory.d.ts.map +1 -0
  87. package/node_modules/@cchistory/domain/dist/agent-inventory.js +9 -0
  88. package/node_modules/@cchistory/domain/dist/agent-inventory.js.map +1 -0
  89. package/node_modules/@cchistory/domain/dist/agent-startup.d.ts +362 -0
  90. package/node_modules/@cchistory/domain/dist/agent-startup.d.ts.map +1 -0
  91. package/node_modules/@cchistory/domain/dist/agent-startup.js +8 -0
  92. package/node_modules/@cchistory/domain/dist/agent-startup.js.map +1 -0
  93. package/node_modules/@cchistory/domain/dist/index.d.ts +8 -1
  94. package/node_modules/@cchistory/domain/dist/index.d.ts.map +1 -1
  95. package/node_modules/@cchistory/domain/dist/index.js +3 -0
  96. package/node_modules/@cchistory/domain/dist/index.js.map +1 -1
  97. package/node_modules/@cchistory/domain/dist/index.test.js +27 -1
  98. package/node_modules/@cchistory/domain/dist/index.test.js.map +1 -1
  99. package/node_modules/@cchistory/domain/dist/project-git.d.ts +121 -0
  100. package/node_modules/@cchistory/domain/dist/project-git.d.ts.map +1 -0
  101. package/node_modules/@cchistory/domain/dist/project-git.js +93 -0
  102. package/node_modules/@cchistory/domain/dist/project-git.js.map +1 -0
  103. package/node_modules/@cchistory/domain/dist/token-evidence.d.ts.map +1 -1
  104. package/node_modules/@cchistory/domain/dist/token-evidence.js +3 -1
  105. package/node_modules/@cchistory/domain/dist/token-evidence.js.map +1 -1
  106. package/node_modules/@cchistory/domain/package.json +1 -1
  107. package/node_modules/@cchistory/live-runtime/dist/index.d.ts +4 -1
  108. package/node_modules/@cchistory/live-runtime/dist/index.d.ts.map +1 -1
  109. package/node_modules/@cchistory/live-runtime/dist/index.js +3 -1
  110. package/node_modules/@cchistory/live-runtime/dist/index.js.map +1 -1
  111. package/node_modules/@cchistory/live-runtime/dist/index.test.js +266 -38
  112. package/node_modules/@cchistory/live-runtime/dist/index.test.js.map +1 -1
  113. package/node_modules/@cchistory/live-runtime/dist/inventory-and-git.d.ts +35 -0
  114. package/node_modules/@cchistory/live-runtime/dist/inventory-and-git.d.ts.map +1 -0
  115. package/node_modules/@cchistory/live-runtime/dist/inventory-and-git.js +68 -0
  116. package/node_modules/@cchistory/live-runtime/dist/inventory-and-git.js.map +1 -0
  117. package/node_modules/@cchistory/live-runtime/package.json +1 -1
  118. package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.d.ts +3 -0
  119. package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.d.ts.map +1 -1
  120. package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.js.map +1 -1
  121. package/node_modules/@cchistory/source-adapters/dist/core/discovery.d.ts.map +1 -1
  122. package/node_modules/@cchistory/source-adapters/dist/core/discovery.js +60 -4
  123. package/node_modules/@cchistory/source-adapters/dist/core/discovery.js.map +1 -1
  124. package/node_modules/@cchistory/source-adapters/dist/core/git-project.d.ts +9 -0
  125. package/node_modules/@cchistory/source-adapters/dist/core/git-project.d.ts.map +1 -1
  126. package/node_modules/@cchistory/source-adapters/dist/core/git-project.js +130 -7
  127. package/node_modules/@cchistory/source-adapters/dist/core/git-project.js.map +1 -1
  128. package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts +1 -1
  129. package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts.map +1 -1
  130. package/node_modules/@cchistory/source-adapters/dist/core/parser.js +198 -1
  131. package/node_modules/@cchistory/source-adapters/dist/core/parser.js.map +1 -1
  132. package/node_modules/@cchistory/source-adapters/dist/core/probe.d.ts.map +1 -1
  133. package/node_modules/@cchistory/source-adapters/dist/core/probe.js +85 -5
  134. package/node_modules/@cchistory/source-adapters/dist/core/probe.js.map +1 -1
  135. package/node_modules/@cchistory/source-adapters/dist/core/registry.test.js +17 -1
  136. package/node_modules/@cchistory/source-adapters/dist/core/registry.test.js.map +1 -1
  137. package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.d.ts.map +1 -1
  138. package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.js +44 -0
  139. package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.js.map +1 -1
  140. package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts.map +1 -1
  141. package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js +12 -0
  142. package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js.map +1 -1
  143. package/node_modules/@cchistory/source-adapters/dist/index.d.ts +5 -0
  144. package/node_modules/@cchistory/source-adapters/dist/index.d.ts.map +1 -1
  145. package/node_modules/@cchistory/source-adapters/dist/index.js +5 -0
  146. package/node_modules/@cchistory/source-adapters/dist/index.js.map +1 -1
  147. package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts +6 -0
  148. package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts.map +1 -1
  149. package/node_modules/@cchistory/source-adapters/dist/index.test.js +6 -0
  150. package/node_modules/@cchistory/source-adapters/dist/index.test.js.map +1 -1
  151. package/node_modules/@cchistory/source-adapters/dist/inventory/agent-config-reader.d.ts +14 -0
  152. package/node_modules/@cchistory/source-adapters/dist/inventory/agent-config-reader.d.ts.map +1 -0
  153. package/node_modules/@cchistory/source-adapters/dist/inventory/agent-config-reader.js +397 -0
  154. package/node_modules/@cchistory/source-adapters/dist/inventory/agent-config-reader.js.map +1 -0
  155. package/node_modules/@cchistory/source-adapters/dist/inventory/agent-config-reader.test.d.ts +6 -0
  156. package/node_modules/@cchistory/source-adapters/dist/inventory/agent-config-reader.test.d.ts.map +1 -0
  157. package/node_modules/@cchistory/source-adapters/dist/inventory/agent-config-reader.test.js +106 -0
  158. package/node_modules/@cchistory/source-adapters/dist/inventory/agent-config-reader.test.js.map +1 -0
  159. package/node_modules/@cchistory/source-adapters/dist/inventory/config-io.d.ts +42 -0
  160. package/node_modules/@cchistory/source-adapters/dist/inventory/config-io.d.ts.map +1 -0
  161. package/node_modules/@cchistory/source-adapters/dist/inventory/config-io.js +368 -0
  162. package/node_modules/@cchistory/source-adapters/dist/inventory/config-io.js.map +1 -0
  163. package/node_modules/@cchistory/source-adapters/dist/inventory/redaction.d.ts +22 -0
  164. package/node_modules/@cchistory/source-adapters/dist/inventory/redaction.d.ts.map +1 -0
  165. package/node_modules/@cchistory/source-adapters/dist/inventory/redaction.js +195 -0
  166. package/node_modules/@cchistory/source-adapters/dist/inventory/redaction.js.map +1 -0
  167. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/antigravity-helpers.d.ts +23 -0
  168. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/antigravity-helpers.d.ts.map +1 -0
  169. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/antigravity-helpers.js +147 -0
  170. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/antigravity-helpers.js.map +1 -0
  171. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/antigravity.d.ts +11 -0
  172. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/antigravity.d.ts.map +1 -0
  173. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/antigravity.js +339 -0
  174. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/antigravity.js.map +1 -0
  175. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/claude-code-helpers.d.ts +70 -0
  176. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/claude-code-helpers.d.ts.map +1 -0
  177. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/claude-code-helpers.js +257 -0
  178. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/claude-code-helpers.js.map +1 -0
  179. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/claude-code.d.ts +11 -0
  180. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/claude-code.d.ts.map +1 -0
  181. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/claude-code.js +321 -0
  182. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/claude-code.js.map +1 -0
  183. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/codex.d.ts +12 -0
  184. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/codex.d.ts.map +1 -0
  185. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/codex.js +363 -0
  186. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/codex.js.map +1 -0
  187. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/deepseek-harness.d.ts +20 -0
  188. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/deepseek-harness.d.ts.map +1 -0
  189. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/deepseek-harness.js +408 -0
  190. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/deepseek-harness.js.map +1 -0
  191. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/index.d.ts +24 -0
  192. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/index.d.ts.map +1 -0
  193. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/index.js +225 -0
  194. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/index.js.map +1 -0
  195. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/opencode.d.ts +12 -0
  196. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/opencode.d.ts.map +1 -0
  197. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/opencode.js +372 -0
  198. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/opencode.js.map +1 -0
  199. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/shared.d.ts +62 -0
  200. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/shared.d.ts.map +1 -0
  201. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/shared.js +428 -0
  202. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/shared.js.map +1 -0
  203. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/startup.test.d.ts +7 -0
  204. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/startup.test.d.ts.map +1 -0
  205. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/startup.test.js +399 -0
  206. package/node_modules/@cchistory/source-adapters/dist/inventory/startup/startup.test.js.map +1 -0
  207. package/node_modules/@cchistory/source-adapters/dist/inventory/toml.d.ts +16 -0
  208. package/node_modules/@cchistory/source-adapters/dist/inventory/toml.d.ts.map +1 -0
  209. package/node_modules/@cchistory/source-adapters/dist/inventory/toml.js +478 -0
  210. package/node_modules/@cchistory/source-adapters/dist/inventory/toml.js.map +1 -0
  211. package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.js +2 -0
  212. package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.js.map +1 -1
  213. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/reader.d.ts +28 -0
  214. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/reader.d.ts.map +1 -0
  215. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/reader.js +443 -0
  216. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/reader.js.map +1 -0
  217. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/runtime.d.ts +4 -0
  218. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/runtime.d.ts.map +1 -0
  219. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/runtime.js +370 -0
  220. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/runtime.js.map +1 -0
  221. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.d.ts +3 -0
  222. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.d.ts.map +1 -0
  223. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.js +78 -0
  224. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.js.map +1 -0
  225. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.test.d.ts +2 -0
  226. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.test.d.ts.map +1 -0
  227. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.test.js +313 -0
  228. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.test.js.map +1 -0
  229. package/node_modules/@cchistory/source-adapters/dist/platforms/generic/runtime.d.ts.map +1 -1
  230. package/node_modules/@cchistory/source-adapters/dist/platforms/generic/runtime.js +14 -0
  231. package/node_modules/@cchistory/source-adapters/dist/platforms/generic/runtime.js.map +1 -1
  232. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/runtime.d.ts +4 -0
  233. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/runtime.d.ts.map +1 -0
  234. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/runtime.js +306 -0
  235. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/runtime.js.map +1 -0
  236. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/sqlite.d.ts +8 -0
  237. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/sqlite.d.ts.map +1 -0
  238. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/sqlite.js +499 -0
  239. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/sqlite.js.map +1 -0
  240. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.d.ts +9 -0
  241. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.d.ts.map +1 -0
  242. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.js +53 -0
  243. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.js.map +1 -0
  244. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.test.d.ts +2 -0
  245. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.test.d.ts.map +1 -0
  246. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.test.js +314 -0
  247. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.test.js.map +1 -0
  248. package/node_modules/@cchistory/source-adapters/dist/platforms/oh-my-pi.d.ts +9 -0
  249. package/node_modules/@cchistory/source-adapters/dist/platforms/oh-my-pi.d.ts.map +1 -0
  250. package/node_modules/@cchistory/source-adapters/dist/platforms/oh-my-pi.js +84 -0
  251. package/node_modules/@cchistory/source-adapters/dist/platforms/oh-my-pi.js.map +1 -0
  252. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite-records.d.ts +50 -0
  253. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite-records.d.ts.map +1 -0
  254. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite-records.js +291 -0
  255. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite-records.js.map +1 -0
  256. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite.d.ts +8 -0
  257. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite.d.ts.map +1 -0
  258. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite.js +321 -0
  259. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite.js.map +1 -0
  260. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode-sqlite.test.d.ts +2 -0
  261. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode-sqlite.test.d.ts.map +1 -0
  262. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode-sqlite.test.js +245 -0
  263. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode-sqlite.test.js.map +1 -0
  264. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.d.ts.map +1 -1
  265. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.js +30 -7
  266. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.js.map +1 -1
  267. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/reader.d.ts +44 -0
  268. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/reader.d.ts.map +1 -0
  269. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/reader.js +533 -0
  270. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/reader.js.map +1 -0
  271. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/runtime.d.ts +4 -0
  272. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/runtime.d.ts.map +1 -0
  273. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/runtime.js +375 -0
  274. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/runtime.js.map +1 -0
  275. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family.test.d.ts +2 -0
  276. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family.test.d.ts.map +1 -0
  277. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family.test.js +346 -0
  278. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family.test.js.map +1 -0
  279. package/node_modules/@cchistory/source-adapters/dist/platforms/pi.d.ts +8 -0
  280. package/node_modules/@cchistory/source-adapters/dist/platforms/pi.d.ts.map +1 -0
  281. package/node_modules/@cchistory/source-adapters/dist/platforms/pi.js +60 -0
  282. package/node_modules/@cchistory/source-adapters/dist/platforms/pi.js.map +1 -0
  283. package/node_modules/@cchistory/source-adapters/dist/platforms/registry.d.ts.map +1 -1
  284. package/node_modules/@cchistory/source-adapters/dist/platforms/registry.js +8 -0
  285. package/node_modules/@cchistory/source-adapters/dist/platforms/registry.js.map +1 -1
  286. package/node_modules/@cchistory/source-adapters/dist/platforms/types.d.ts +3 -1
  287. package/node_modules/@cchistory/source-adapters/dist/platforms/types.d.ts.map +1 -1
  288. package/node_modules/@cchistory/source-adapters/dist/platforms/types.js +5 -1
  289. package/node_modules/@cchistory/source-adapters/dist/platforms/types.js.map +1 -1
  290. package/node_modules/@cchistory/source-adapters/package.json +1 -1
  291. package/package.json +5 -5
  292. package/schemas/cchistory-lite-agent-v1.schema.json +3 -1
  293. package/schemas/cchistory-lite-envelope-v1.schema.json +33 -0
  294. package/schemas/cchistory-lite-inventory-v1.schema.json +94 -0
  295. package/schemas/cchistory-lite-merged-projects-v1.schema.json +44 -0
  296. package/schemas/cchistory-lite-v2.schema.json +22 -1
  297. package/skills/using-cchistory-lite/SKILL.md +17 -0
@@ -0,0 +1,225 @@
1
+ /**
2
+ * Role: Public dispatcher for per-tool native pre-launch startup context resolution.
3
+ * Computes the offline Git root and ancestor directory chain once, invokes the requested
4
+ * native resolvers (Claude Code, Codex, Google Antigravity, OpenCode, DeepSeek Harness),
5
+ * and returns explicit basic/unsupported entries for other adapter slots.
6
+ * Excludes history correlation, CLI rendering, and filesystem mutations.
7
+ */
8
+ import os from "node:os";
9
+ import path from "node:path";
10
+ import { listPlatformAdapters } from "../../platforms/registry.js";
11
+ import { resolveAntigravityStartup } from "./antigravity.js";
12
+ import { resolveClaudeCodeStartup } from "./claude-code.js";
13
+ import { resolveCodexStartup } from "./codex.js";
14
+ import { resolveDeepSeekHarnessStartup } from "./deepseek-harness.js";
15
+ import { resolveOpenCodeStartup } from "./opencode.js";
16
+ import { buildAncestorChainRootToCwd, resolveOfflineGitRoot, } from "./shared.js";
17
+ export const NATIVE_STARTUP_CLIENT_IDS = [
18
+ "claude_code",
19
+ "codex",
20
+ "antigravity",
21
+ "opencode",
22
+ "deepseek_harness",
23
+ ];
24
+ const BASIC_CONFIG_CLIENTS = {
25
+ gemini: "Gemini CLI",
26
+ grok: "Grok CLI",
27
+ };
28
+ const AGENT_REF_ALIASES = {
29
+ claude: "claude_code",
30
+ "claude-code": "claude_code",
31
+ claude_code: "claude_code",
32
+ codex: "codex",
33
+ antigravity: "antigravity",
34
+ agy: "antigravity",
35
+ opencode: "opencode",
36
+ "open-code": "opencode",
37
+ deepseek: "deepseek_harness",
38
+ dsh: "deepseek_harness",
39
+ "deepseek-harness": "deepseek_harness",
40
+ deepseek_harness: "deepseek_harness",
41
+ gemini: "gemini",
42
+ "gemini-cli": "gemini",
43
+ grok: "grok",
44
+ "grok-cli": "grok",
45
+ };
46
+ export function validateAgentStartupRefs(agentRefs) {
47
+ const registered = new Set(listPlatformAdapters().map((adapter) => adapter.platform));
48
+ const known = new Set([
49
+ ...NATIVE_STARTUP_CLIENT_IDS,
50
+ ...Object.keys(BASIC_CONFIG_CLIENTS),
51
+ ...registered,
52
+ ]);
53
+ const resolvedIds = [];
54
+ const unknownRefs = [];
55
+ const seen = new Set();
56
+ for (const raw of agentRefs ?? []) {
57
+ for (const part of raw.split(",")) {
58
+ const cleaned = part.trim().toLowerCase();
59
+ if (!cleaned)
60
+ continue;
61
+ if (cleaned === "all") {
62
+ for (const id of NATIVE_STARTUP_CLIENT_IDS) {
63
+ if (!seen.has(id)) {
64
+ seen.add(id);
65
+ resolvedIds.push(id);
66
+ }
67
+ }
68
+ continue;
69
+ }
70
+ const mapped = AGENT_REF_ALIASES[cleaned] ?? cleaned;
71
+ if (!known.has(mapped)) {
72
+ if (!unknownRefs.includes(part.trim()))
73
+ unknownRefs.push(part.trim());
74
+ continue;
75
+ }
76
+ if (!seen.has(mapped)) {
77
+ seen.add(mapped);
78
+ resolvedIds.push(mapped);
79
+ }
80
+ }
81
+ }
82
+ return { resolvedIds, unknownRefs };
83
+ }
84
+ export async function resolveAgentStartupContexts(options = {}) {
85
+ const homeDir = path.resolve(options.homeDir ?? os.homedir());
86
+ const isolatedHome = Boolean(options.homeDir);
87
+ const projectDir = options.projectDir ? path.resolve(options.projectDir) : null;
88
+ const env = options.env ?? process.env;
89
+ const gitRoot = await resolveOfflineGitRoot(projectDir);
90
+ const ancestorDirsRootToCwd = buildAncestorChainRootToCwd(projectDir, gitRoot);
91
+ const resolverInput = {
92
+ homeDir,
93
+ projectDir,
94
+ gitRoot,
95
+ ancestorDirsRootToCwd,
96
+ env,
97
+ isolatedHome,
98
+ };
99
+ const targetIds = normalizeRequestedAgents(options.agentRefs);
100
+ const registeredAdapters = new Set(listPlatformAdapters().map((adapter) => adapter.platform));
101
+ const results = [];
102
+ for (const clientId of targetIds) {
103
+ switch (clientId) {
104
+ case "claude_code":
105
+ results.push(await resolveClaudeCodeStartup(resolverInput));
106
+ break;
107
+ case "codex":
108
+ results.push(await resolveCodexStartup(resolverInput));
109
+ break;
110
+ case "antigravity":
111
+ results.push(await resolveAntigravityStartup(resolverInput));
112
+ break;
113
+ case "opencode":
114
+ results.push(await resolveOpenCodeStartup(resolverInput));
115
+ break;
116
+ case "deepseek_harness":
117
+ results.push(await resolveDeepSeekHarnessStartup(resolverInput));
118
+ break;
119
+ default: {
120
+ const basicDisplay = BASIC_CONFIG_CLIENTS[clientId];
121
+ if (basicDisplay) {
122
+ results.push({
123
+ client: clientId,
124
+ display_name: basicDisplay,
125
+ resolution_tier: "basic",
126
+ project_dir: projectDir,
127
+ git_root: gitRoot,
128
+ files_read: [],
129
+ mcp_servers: [],
130
+ diagnostics: [],
131
+ native: {
132
+ client: clientId,
133
+ supported: false,
134
+ reason: `${basicDisplay} currently reports machine-wide config inventory at tier=basic; ` +
135
+ "deep per-project startup resolution is not yet implemented.",
136
+ },
137
+ });
138
+ break;
139
+ }
140
+ if (registeredAdapters.has(clientId)) {
141
+ const registeredDisplay = formatPlatformDisplayName(clientId);
142
+ results.push({
143
+ client: clientId,
144
+ display_name: registeredDisplay,
145
+ resolution_tier: "unsupported",
146
+ project_dir: projectDir,
147
+ git_root: gitRoot,
148
+ files_read: [],
149
+ mcp_servers: [],
150
+ diagnostics: [],
151
+ native: {
152
+ client: clientId,
153
+ supported: false,
154
+ reason: `${registeredDisplay} is registered for history reading but does not yet have a ` +
155
+ "pre-launch startup context resolver.",
156
+ },
157
+ });
158
+ break;
159
+ }
160
+ results.push({
161
+ client: clientId,
162
+ display_name: clientId,
163
+ resolution_tier: "unsupported",
164
+ project_dir: projectDir,
165
+ git_root: gitRoot,
166
+ files_read: [],
167
+ mcp_servers: [],
168
+ diagnostics: [
169
+ {
170
+ code: "unknown_agent_ref",
171
+ severity: "warning",
172
+ client: clientId,
173
+ path: projectDir ?? homeDir,
174
+ detail: `Unknown agent identifier "${clientId}". Supported native startup resolvers: ${NATIVE_STARTUP_CLIENT_IDS.join(", ")}.`,
175
+ },
176
+ ],
177
+ native: {
178
+ client: clientId,
179
+ supported: false,
180
+ reason: `Unknown agent "${clientId}". Native startup resolvers support: ${NATIVE_STARTUP_CLIENT_IDS.join(", ")}.`,
181
+ },
182
+ });
183
+ break;
184
+ }
185
+ }
186
+ }
187
+ return results;
188
+ }
189
+ function normalizeRequestedAgents(agentRefs) {
190
+ if (!agentRefs || agentRefs.length === 0) {
191
+ return [...NATIVE_STARTUP_CLIENT_IDS];
192
+ }
193
+ const out = [];
194
+ const seen = new Set();
195
+ for (const raw of agentRefs) {
196
+ for (const part of raw.split(",")) {
197
+ const cleaned = part.trim().toLowerCase();
198
+ if (!cleaned)
199
+ continue;
200
+ if (cleaned === "all") {
201
+ for (const id of NATIVE_STARTUP_CLIENT_IDS) {
202
+ if (!seen.has(id)) {
203
+ seen.add(id);
204
+ out.push(id);
205
+ }
206
+ }
207
+ continue;
208
+ }
209
+ const mapped = AGENT_REF_ALIASES[cleaned] ?? cleaned;
210
+ if (!seen.has(mapped)) {
211
+ seen.add(mapped);
212
+ out.push(mapped);
213
+ }
214
+ }
215
+ }
216
+ return out.length > 0 ? out : [...NATIVE_STARTUP_CLIENT_IDS];
217
+ }
218
+ function formatPlatformDisplayName(platform) {
219
+ return platform
220
+ .split(/[_-]+/u)
221
+ .filter(Boolean)
222
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
223
+ .join(" ");
224
+ }
225
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/inventory/startup/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACL,2BAA2B,EAC3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CAAC;oBAC3C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;wBAClB,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;wBACb,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBACf,CAAC;gBACH,CAAC;gBACD,SAAS;YACX,CAAC;YACD,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC;YACrD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;gBACtB,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACjB,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACnB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,yBAAyB,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,yBAAyB,CAAC,QAAgB;IACjD,OAAO,QAAQ;SACZ,KAAK,CAAC,QAAQ,CAAC;SACf,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC3D,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Role: Native pre-launch startup context resolver for OpenCode.
3
+ * Resolves the 3-tier `opencode.json[c]` cascade (global < project root < project `.opencode/`),
4
+ * `AGENTS.md` + `CLAUDE.md` fallback (`OPENCODE_DISABLE_CLAUDE_CODE`), literal `instructions`
5
+ * entries, v1 (`mcp.<id>`) and v2 (`mcp.servers.<id>`) MCP configs, agents, skills, commands,
6
+ * and plugins.
7
+ * Excludes history correlation, CLI formatting, and secret value retention.
8
+ */
9
+ import type { AgentStartupResolution } from "@cchistory/domain";
10
+ import { type NativeStartupResolverInput } from "./shared.js";
11
+ export declare function resolveOpenCodeStartup(input: NativeStartupResolverInput): Promise<AgentStartupResolution>;
12
+ //# sourceMappingURL=opencode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../../src/inventory/startup/opencode.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EACV,sBAAsB,EAKvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAaL,KAAK,0BAA0B,EAEhC,MAAM,aAAa,CAAC;AAIrB,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,0BAA0B,GAChC,OAAO,CAAC,sBAAsB,CAAC,CAyLjC"}
@@ -0,0 +1,372 @@
1
+ /**
2
+ * Role: Native pre-launch startup context resolver for OpenCode.
3
+ * Resolves the 3-tier `opencode.json[c]` cascade (global < project root < project `.opencode/`),
4
+ * `AGENTS.md` + `CLAUDE.md` fallback (`OPENCODE_DISABLE_CLAUDE_CODE`), literal `instructions`
5
+ * entries, v1 (`mcp.<id>`) and v2 (`mcp.servers.<id>`) MCP configs, agents, skills, commands,
6
+ * and plugins.
7
+ * Excludes history correlation, CLI formatting, and secret value retention.
8
+ */
9
+ import path from "node:path";
10
+ import { asNonEmptyString, asRecord, buildRedactedMcpEntry, createReadTracker, estimateTokens, listSkillEntriesInDir, normalizeComparablePath, parseMarkdownFrontmatter, readTrackedJsonObject, readTrackedTextFile, safeReadDir, stripMcpResolutionFields, } from "./shared.js";
11
+ export async function resolveOpenCodeStartup(input) {
12
+ const tracker = createReadTracker("opencode");
13
+ const xdgConfigHome = input.env.XDG_CONFIG_HOME?.trim()
14
+ ? path.resolve(input.env.XDG_CONFIG_HOME.trim())
15
+ : path.join(input.homeDir, ".config");
16
+ const globalConfigDir = path.join(xdgConfigHome, "opencode");
17
+ const claudeMdFallbackDisabled = isEnvFlagTrue(input.env.OPENCODE_DISABLE_CLAUDE_CODE)
18
+ || isEnvFlagTrue(input.env.OPENCODE_DISABLE_CLAUDE_CODE_PROMPT);
19
+ const configFiles = [];
20
+ const loadedConfigs = [];
21
+ // 1. Global config cascade entry (`opencode.json` / `opencode.jsonc` + optional OPENCODE_CONFIG)
22
+ await loadConfigCandidates(tracker, globalConfigDir, "global", configFiles, loadedConfigs);
23
+ const envConfigPath = input.env.OPENCODE_CONFIG?.trim();
24
+ if (envConfigPath) {
25
+ const resolvedEnvPath = path.resolve(envConfigPath);
26
+ const data = await readTrackedJsonObject(tracker, resolvedEnvPath, "opencode_config", true);
27
+ if (data) {
28
+ configFiles.push({ path: resolvedEnvPath, layer: "global" });
29
+ loadedConfigs.push({ layer: "global", path: resolvedEnvPath, data });
30
+ }
31
+ }
32
+ // 2. Project root and `.opencode/` local configs across ancestor chain
33
+ for (let i = 0; i < input.ancestorDirsRootToCwd.length; i += 1) {
34
+ const dir = input.ancestorDirsRootToCwd[i];
35
+ const isRoot = i === 0;
36
+ const rootLayer = isRoot ? "project_root" : "project_local";
37
+ await loadConfigCandidates(tracker, dir, rootLayer, configFiles, loadedConfigs);
38
+ await loadConfigCandidates(tracker, path.join(dir, ".opencode"), "project_local", configFiles, loadedConfigs);
39
+ }
40
+ let effectiveModel;
41
+ let smallModel;
42
+ let defaultAgent;
43
+ const providerNames = new Set();
44
+ const instructionPatterns = [];
45
+ const instructionRefs = [];
46
+ const seenPattern = new Set();
47
+ const mcpById = new Map();
48
+ const mcpHistory = [];
49
+ const agentsByName = new Map();
50
+ const agentHistory = [];
51
+ const plugins = [];
52
+ for (const cfg of loadedConfigs) {
53
+ const model = asNonEmptyString(cfg.data.model);
54
+ if (model)
55
+ effectiveModel = model;
56
+ const small = asNonEmptyString(cfg.data.small_model);
57
+ if (small)
58
+ smallModel = small;
59
+ const defAgent = asNonEmptyString(cfg.data.default_agent);
60
+ if (defAgent)
61
+ defaultAgent = defAgent;
62
+ const providerObj = asRecord(cfg.data.provider) ?? asRecord(cfg.data.providers);
63
+ if (providerObj) {
64
+ for (const key of Object.keys(providerObj)) {
65
+ if (key.trim())
66
+ providerNames.add(key.trim());
67
+ }
68
+ }
69
+ if (Array.isArray(cfg.data.instructions)) {
70
+ const cfgDir = path.dirname(cfg.path);
71
+ for (const item of cfg.data.instructions) {
72
+ if (typeof item !== "string" || !item.trim())
73
+ continue;
74
+ const pat = item.trim();
75
+ instructionRefs.push({ pattern: pat, baseDir: cfgDir });
76
+ if (!seenPattern.has(pat)) {
77
+ seenPattern.add(pat);
78
+ instructionPatterns.push(pat);
79
+ }
80
+ }
81
+ }
82
+ const scope = cfg.layer === "global" ? "user" : "project";
83
+ extractConfigMcpServers(cfg.data, cfg.layer, scope, cfg.path, mcpById, mcpHistory);
84
+ extractConfigAgents(cfg.data, scope, cfg.path, agentsByName, agentHistory);
85
+ extractConfigPlugins(cfg.data, scope, cfg.path, plugins);
86
+ }
87
+ // Instructions: global AGENTS.md (or ~/.claude/CLAUDE.md fallback), project chain, literal patterns
88
+ const instructions = [];
89
+ const seenInstructions = new Set();
90
+ await tryAddInstruction(tracker, path.join(globalConfigDir, "AGENTS.md"), "global_agents_md", instructions, seenInstructions);
91
+ if (instructions.length === 0 && !claudeMdFallbackDisabled) {
92
+ await tryAddInstruction(tracker, path.join(input.homeDir, ".claude", "CLAUDE.md"), "claude_md_fallback", instructions, seenInstructions);
93
+ }
94
+ for (const dir of input.ancestorDirsRootToCwd) {
95
+ const addedAgentsMd = await tryAddInstruction(tracker, path.join(dir, "AGENTS.md"), "project_agents_md", instructions, seenInstructions);
96
+ if (!addedAgentsMd && !claudeMdFallbackDisabled) {
97
+ await tryAddInstruction(tracker, path.join(dir, "CLAUDE.md"), "claude_md_fallback", instructions, seenInstructions);
98
+ }
99
+ }
100
+ for (const ref of instructionRefs) {
101
+ if (/[*?{}]/u.test(ref.pattern) || /^[a-z]+:\/\//iu.test(ref.pattern))
102
+ continue;
103
+ const expanded = ref.pattern.startsWith("~/")
104
+ ? path.join(input.homeDir, ref.pattern.slice(2))
105
+ : path.isAbsolute(ref.pattern)
106
+ ? ref.pattern
107
+ : path.resolve(ref.baseDir, ref.pattern);
108
+ const added = await tryAddInstruction(tracker, expanded, "config_instructions", instructions, seenInstructions);
109
+ if (!added) {
110
+ const resolved = path.resolve(expanded);
111
+ const norm = normalizeComparablePath(resolved);
112
+ if (!seenInstructions.has(norm)) {
113
+ seenInstructions.add(norm);
114
+ instructions.push({ path: resolved, source: "config_instructions", exists: false, size_bytes: 0, estimated_tokens: 0 });
115
+ }
116
+ }
117
+ }
118
+ // Directory-based agents, skills, commands, plugins
119
+ await collectDirectoryAgents(tracker, globalConfigDir, "user", agentsByName, agentHistory);
120
+ for (const dir of input.ancestorDirsRootToCwd) {
121
+ await collectDirectoryAgents(tracker, path.join(dir, ".opencode"), "project", agentsByName, agentHistory);
122
+ }
123
+ const skillsByName = new Map();
124
+ const skillHistory = [];
125
+ await collectOpenCodeSkills(tracker, path.join(globalConfigDir, "skills"), "user", skillsByName, skillHistory);
126
+ await collectOpenCodeSkills(tracker, path.join(input.homeDir, ".agents", "skills"), "user", skillsByName, skillHistory);
127
+ for (const dir of input.ancestorDirsRootToCwd) {
128
+ await collectOpenCodeSkills(tracker, path.join(dir, ".opencode", "skills"), "project", skillsByName, skillHistory);
129
+ await collectOpenCodeSkills(tracker, path.join(dir, ".agents", "skills"), "project", skillsByName, skillHistory);
130
+ }
131
+ const commands = [];
132
+ await collectOpenCodeCommands(tracker, globalConfigDir, "user", commands);
133
+ for (const dir of input.ancestorDirsRootToCwd) {
134
+ await collectOpenCodeCommands(tracker, path.join(dir, ".opencode"), "project", commands);
135
+ }
136
+ await collectDirectoryPlugins(tracker, globalConfigDir, "user", plugins);
137
+ for (const dir of input.ancestorDirsRootToCwd) {
138
+ await collectDirectoryPlugins(tracker, path.join(dir, ".opencode"), "project", plugins);
139
+ }
140
+ const existingInstructions = instructions.filter((entry) => entry.exists !== false);
141
+ const instructionBytes = existingInstructions.reduce((sum, entry) => sum + entry.size_bytes, 0);
142
+ const instructionTokens = existingInstructions.reduce((sum, entry) => sum + entry.estimated_tokens, 0);
143
+ const effectiveMcp = mcpHistory
144
+ .filter((entry) => entry.status === "effective")
145
+ .map(stripMcpResolutionFields);
146
+ const native = {
147
+ client: "opencode",
148
+ config_cascade: {
149
+ files: configFiles,
150
+ ...(effectiveModel ? { effective_model: effectiveModel } : {}),
151
+ ...(smallModel ? { small_model: smallModel } : {}),
152
+ ...(defaultAgent ? { default_agent: defaultAgent } : {}),
153
+ claude_md_fallback_disabled: claudeMdFallbackDisabled,
154
+ configured_instruction_patterns: instructionPatterns,
155
+ provider_names: [...providerNames].sort((a, b) => a.localeCompare(b)),
156
+ },
157
+ instructions,
158
+ mcp_servers: mcpHistory,
159
+ agents: agentHistory,
160
+ skills: skillHistory,
161
+ commands,
162
+ plugins,
163
+ startup_footprint: {
164
+ instruction_bytes: instructionBytes,
165
+ instruction_estimated_tokens: instructionTokens,
166
+ instruction_file_count: existingInstructions.length,
167
+ },
168
+ };
169
+ return {
170
+ client: "opencode",
171
+ display_name: "OpenCode",
172
+ resolution_tier: "native",
173
+ project_dir: input.projectDir,
174
+ git_root: input.gitRoot,
175
+ files_read: tracker.filesRead,
176
+ mcp_servers: effectiveMcp,
177
+ diagnostics: tracker.diagnostics,
178
+ native,
179
+ };
180
+ }
181
+ async function loadConfigCandidates(tracker, dir, layer, filesOut, loadedOut) {
182
+ for (const filename of ["opencode.json", "opencode.jsonc"]) {
183
+ const filePath = path.resolve(dir, filename);
184
+ const data = await readTrackedJsonObject(tracker, filePath, `opencode_config:${layer}`, true);
185
+ if (!data)
186
+ continue;
187
+ filesOut.push({ path: filePath, layer });
188
+ loadedOut.push({ layer, path: filePath, data });
189
+ }
190
+ }
191
+ function extractConfigMcpServers(config, layer, scope, sourcePath, mcpById, history) {
192
+ const mcpRoot = asRecord(config.mcp);
193
+ if (!mcpRoot)
194
+ return;
195
+ // v2 shape: `mcp.servers.<id>`
196
+ const v2Servers = asRecord(mcpRoot.servers);
197
+ if (v2Servers) {
198
+ for (const [id, rawVal] of Object.entries(v2Servers)) {
199
+ const rec = asRecord(rawVal);
200
+ if (!rec || !id.trim())
201
+ continue;
202
+ registerMcpCandidate(id.trim(), rec, layer, scope, sourcePath, mcpById, history);
203
+ }
204
+ }
205
+ // v1 shape: `mcp.<id>` (skip `servers` container when v2 shape was used)
206
+ for (const [id, rawVal] of Object.entries(mcpRoot)) {
207
+ if (id === "servers" && v2Servers)
208
+ continue;
209
+ const rec = asRecord(rawVal);
210
+ if (!rec || !id.trim())
211
+ continue;
212
+ if (!("command" in rec || "url" in rec || "serverUrl" in rec || "type" in rec || "transport" in rec || "enabled" in rec)) {
213
+ continue;
214
+ }
215
+ registerMcpCandidate(id.trim(), rec, layer, scope, sourcePath, mcpById, history);
216
+ }
217
+ }
218
+ function registerMcpCandidate(serverId, rec, layer, scope, sourcePath, mcpById, history) {
219
+ const base = buildRedactedMcpEntry("opencode", scope, sourcePath, serverId, rec);
220
+ const existing = mcpById.get(serverId);
221
+ if (existing && existing.status === "effective") {
222
+ existing.status = "shadowed";
223
+ existing.shadowed_by = `${layer}:${sourcePath}`;
224
+ }
225
+ const state = {
226
+ ...base,
227
+ status: base.enabled ? "effective" : "disabled",
228
+ precedence_layer: layer,
229
+ ...(base.enabled ? {} : { disabled_reason: "disabled_in_config" }),
230
+ };
231
+ mcpById.set(serverId, state);
232
+ history.push(state);
233
+ }
234
+ function extractConfigAgents(config, scope, sourcePath, byName, history) {
235
+ const agentMap = asRecord(config.agent) ?? asRecord(config.agents);
236
+ if (!agentMap)
237
+ return;
238
+ for (const [name, rawVal] of Object.entries(agentMap)) {
239
+ const rec = asRecord(rawVal);
240
+ if (!rec || !name.trim())
241
+ continue;
242
+ addAgentEntry({
243
+ name: name.trim(),
244
+ source: "config",
245
+ scope,
246
+ path: sourcePath,
247
+ ...(asNonEmptyString(rec.mode) ? { mode: asNonEmptyString(rec.mode) } : {}),
248
+ ...(asNonEmptyString(rec.model) ? { model: asNonEmptyString(rec.model) } : {}),
249
+ ...(asNonEmptyString(rec.description) ? { description: asNonEmptyString(rec.description) } : {}),
250
+ status: "effective",
251
+ }, byName, history);
252
+ }
253
+ }
254
+ async function collectDirectoryAgents(tracker, baseDir, scope, byName, history) {
255
+ for (const sub of ["agent", "agents"]) {
256
+ const dir = path.join(baseDir, sub);
257
+ const entries = await safeReadDir(tracker, dir);
258
+ for (const entry of entries) {
259
+ if (!entry.isFile() || !/\.(?:md|markdown)$/iu.test(entry.name))
260
+ continue;
261
+ const fullPath = path.join(dir, entry.name);
262
+ const file = await readTrackedTextFile(tracker, fullPath, "opencode_agent");
263
+ const fm = file ? parseMarkdownFrontmatter(file.content) : undefined;
264
+ const name = fm?.scalars.name || entry.name.replace(/\.(?:md|markdown)$/iu, "");
265
+ addAgentEntry({
266
+ name,
267
+ source: "directory",
268
+ scope,
269
+ path: fullPath,
270
+ ...(fm?.scalars.mode ? { mode: fm.scalars.mode } : {}),
271
+ ...(fm?.scalars.model ? { model: fm.scalars.model } : {}),
272
+ ...(fm?.scalars.description ? { description: fm.scalars.description } : {}),
273
+ status: "effective",
274
+ }, byName, history);
275
+ }
276
+ }
277
+ }
278
+ function addAgentEntry(entry, byName, history) {
279
+ const prev = byName.get(entry.name);
280
+ if (prev && prev.status === "effective") {
281
+ prev.status = "shadowed";
282
+ prev.shadowed_by = entry.path;
283
+ }
284
+ byName.set(entry.name, entry);
285
+ history.push(entry);
286
+ }
287
+ async function collectOpenCodeSkills(tracker, dirPath, scope, byName, history) {
288
+ const found = await listSkillEntriesInDir(tracker, dirPath);
289
+ for (const item of found) {
290
+ const prev = byName.get(item.name);
291
+ if (prev && prev.status === "effective") {
292
+ prev.status = "shadowed";
293
+ prev.shadowed_by = item.path;
294
+ }
295
+ const entry = {
296
+ name: item.name,
297
+ path: item.path,
298
+ scope,
299
+ ...(item.description ? { description: item.description } : {}),
300
+ status: "effective",
301
+ };
302
+ byName.set(item.name, entry);
303
+ history.push(entry);
304
+ }
305
+ }
306
+ async function collectOpenCodeCommands(tracker, baseDir, scope, out) {
307
+ for (const sub of ["command", "commands"]) {
308
+ const dir = path.join(baseDir, sub);
309
+ const entries = await safeReadDir(tracker, dir);
310
+ for (const entry of entries) {
311
+ if (!entry.isFile() || !/\.(?:md|markdown)$/iu.test(entry.name))
312
+ continue;
313
+ out.push({
314
+ name: entry.name.replace(/\.(?:md|markdown)$/iu, ""),
315
+ path: path.join(dir, entry.name),
316
+ scope,
317
+ });
318
+ }
319
+ }
320
+ }
321
+ function extractConfigPlugins(config, scope, sourcePath, out) {
322
+ const raw = Array.isArray(config.plugin)
323
+ ? config.plugin
324
+ : Array.isArray(config.plugins)
325
+ ? config.plugins
326
+ : [];
327
+ for (const item of raw) {
328
+ if (typeof item === "string" && item.trim()) {
329
+ out.push({ name: item.trim(), source: "config", scope, path: sourcePath });
330
+ }
331
+ }
332
+ }
333
+ async function collectDirectoryPlugins(tracker, baseDir, scope, out) {
334
+ for (const sub of ["plugin", "plugins"]) {
335
+ const dir = path.join(baseDir, sub);
336
+ const entries = await safeReadDir(tracker, dir);
337
+ for (const entry of entries) {
338
+ if (entry.name.startsWith("."))
339
+ continue;
340
+ if (entry.isFile() || entry.isDirectory() || entry.isSymbolicLink()) {
341
+ out.push({
342
+ name: entry.name.replace(/\.(?:js|mjs|cjs|ts)$/iu, ""),
343
+ source: "directory",
344
+ scope,
345
+ path: path.join(dir, entry.name),
346
+ });
347
+ }
348
+ }
349
+ }
350
+ }
351
+ async function tryAddInstruction(tracker, filePath, source, out, seen) {
352
+ const resolved = path.resolve(filePath);
353
+ const norm = normalizeComparablePath(resolved);
354
+ if (seen.has(norm))
355
+ return true;
356
+ const file = await readTrackedTextFile(tracker, resolved, `opencode_instruction:${source}`);
357
+ if (!file)
358
+ return false;
359
+ seen.add(norm);
360
+ out.push({
361
+ path: resolved,
362
+ source,
363
+ size_bytes: file.sizeBytes,
364
+ estimated_tokens: estimateTokens(file.sizeBytes),
365
+ });
366
+ return true;
367
+ }
368
+ function isEnvFlagTrue(value) {
369
+ const v = value?.trim().toLowerCase();
370
+ return v === "1" || v === "true" || v === "yes";
371
+ }
372
+ //# sourceMappingURL=opencode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../../src/inventory/startup/opencode.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAQ7B,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,WAAW,EACX,wBAAwB,GAGzB,MAAM,aAAa,CAAC;AAIrB,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,KAAiC;IAEjC,MAAM,OAAO,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC9C,MAAM,aAAa,GAAG,KAAK,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,EAAE;QACrD,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;QAChD,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACxC,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAE7D,MAAM,wBAAwB,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,4BAA4B,CAAC;WACjF,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IAElE,MAAM,WAAW,GAAsD,EAAE,CAAC;IAC1E,MAAM,aAAa,GAA+E,EAAE,CAAC;IAErG,iGAAiG;IACjG,MAAM,oBAAoB,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,WAAW,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