symbiote-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (451) hide show
  1. package/LICENSE +21 -0
  2. package/dist/bin/symbiote.d.ts +3 -0
  3. package/dist/bin/symbiote.d.ts.map +1 -0
  4. package/dist/bin/symbiote.js +202 -0
  5. package/dist/bin/symbiote.js.map +1 -0
  6. package/dist/bin/synapse.d.ts +3 -0
  7. package/dist/bin/synapse.d.ts.map +1 -0
  8. package/dist/bin/synapse.js +369 -0
  9. package/dist/bin/synapse.js.map +1 -0
  10. package/dist/src/brain/embeddings.d.ts +9 -0
  11. package/dist/src/brain/embeddings.d.ts.map +1 -0
  12. package/dist/src/brain/embeddings.js +24 -0
  13. package/dist/src/brain/embeddings.js.map +1 -0
  14. package/dist/src/brain/health/constraint-checker.d.ts +16 -0
  15. package/dist/src/brain/health/constraint-checker.d.ts.map +1 -0
  16. package/dist/src/brain/health/constraint-checker.js +93 -0
  17. package/dist/src/brain/health/constraint-checker.js.map +1 -0
  18. package/dist/src/brain/health/coupling-analyzer.d.ts +9 -0
  19. package/dist/src/brain/health/coupling-analyzer.d.ts.map +1 -0
  20. package/dist/src/brain/health/coupling-analyzer.js +105 -0
  21. package/dist/src/brain/health/coupling-analyzer.js.map +1 -0
  22. package/dist/src/brain/health/cycle-detector.d.ts +12 -0
  23. package/dist/src/brain/health/cycle-detector.d.ts.map +1 -0
  24. package/dist/src/brain/health/cycle-detector.js +79 -0
  25. package/dist/src/brain/health/cycle-detector.js.map +1 -0
  26. package/dist/src/brain/health/dead-code-detector.d.ts +9 -0
  27. package/dist/src/brain/health/dead-code-detector.d.ts.map +1 -0
  28. package/dist/src/brain/health/dead-code-detector.js +72 -0
  29. package/dist/src/brain/health/dead-code-detector.js.map +1 -0
  30. package/dist/src/brain/health/history.d.ts +21 -0
  31. package/dist/src/brain/health/history.d.ts.map +1 -0
  32. package/dist/src/brain/health/history.js +35 -0
  33. package/dist/src/brain/health/history.js.map +1 -0
  34. package/dist/src/brain/health/index.d.ts +25 -0
  35. package/dist/src/brain/health/index.d.ts.map +1 -0
  36. package/dist/src/brain/health/index.js +76 -0
  37. package/dist/src/brain/health/index.js.map +1 -0
  38. package/dist/src/brain/health/scorer.d.ts +19 -0
  39. package/dist/src/brain/health/scorer.d.ts.map +1 -0
  40. package/dist/src/brain/health/scorer.js +47 -0
  41. package/dist/src/brain/health/scorer.js.map +1 -0
  42. package/dist/src/brain/health/types.d.ts +67 -0
  43. package/dist/src/brain/health/types.d.ts.map +1 -0
  44. package/dist/src/brain/health/types.js +2 -0
  45. package/dist/src/brain/health/types.js.map +1 -0
  46. package/dist/src/brain/health.d.ts +30 -0
  47. package/dist/src/brain/health.d.ts.map +1 -0
  48. package/dist/src/brain/health.js +147 -0
  49. package/dist/src/brain/health.js.map +1 -0
  50. package/dist/src/brain/index.d.ts +3 -0
  51. package/dist/src/brain/index.d.ts.map +1 -0
  52. package/dist/src/brain/index.js +3 -0
  53. package/dist/src/brain/index.js.map +1 -0
  54. package/dist/src/brain/intent.d.ts +31 -0
  55. package/dist/src/brain/intent.d.ts.map +1 -0
  56. package/dist/src/brain/intent.js +120 -0
  57. package/dist/src/brain/intent.js.map +1 -0
  58. package/dist/src/commands/dna.d.ts +2 -0
  59. package/dist/src/commands/dna.d.ts.map +1 -0
  60. package/dist/src/commands/dna.js +128 -0
  61. package/dist/src/commands/dna.js.map +1 -0
  62. package/dist/src/commands/hooks.d.ts +6 -0
  63. package/dist/src/commands/hooks.d.ts.map +1 -0
  64. package/dist/src/commands/hooks.js +210 -0
  65. package/dist/src/commands/hooks.js.map +1 -0
  66. package/dist/src/commands/impact.d.ts +2 -0
  67. package/dist/src/commands/impact.d.ts.map +1 -0
  68. package/dist/src/commands/impact.js +50 -0
  69. package/dist/src/commands/impact.js.map +1 -0
  70. package/dist/src/commands/index.d.ts +9 -0
  71. package/dist/src/commands/index.d.ts.map +1 -0
  72. package/dist/src/commands/index.js +9 -0
  73. package/dist/src/commands/index.js.map +1 -0
  74. package/dist/src/commands/init.d.ts +2 -0
  75. package/dist/src/commands/init.d.ts.map +1 -0
  76. package/dist/src/commands/init.js +132 -0
  77. package/dist/src/commands/init.js.map +1 -0
  78. package/dist/src/commands/install.d.ts +2 -0
  79. package/dist/src/commands/install.d.ts.map +1 -0
  80. package/dist/src/commands/install.js +67 -0
  81. package/dist/src/commands/install.js.map +1 -0
  82. package/dist/src/commands/mcp.d.ts +2 -0
  83. package/dist/src/commands/mcp.d.ts.map +1 -0
  84. package/dist/src/commands/mcp.js +51 -0
  85. package/dist/src/commands/mcp.js.map +1 -0
  86. package/dist/src/commands/scan.d.ts +2 -0
  87. package/dist/src/commands/scan.d.ts.map +1 -0
  88. package/dist/src/commands/scan.js +46 -0
  89. package/dist/src/commands/scan.js.map +1 -0
  90. package/dist/src/commands/serve.d.ts +2 -0
  91. package/dist/src/commands/serve.d.ts.map +1 -0
  92. package/dist/src/commands/serve.js +93 -0
  93. package/dist/src/commands/serve.js.map +1 -0
  94. package/dist/src/commands/shared.d.ts +11 -0
  95. package/dist/src/commands/shared.d.ts.map +1 -0
  96. package/dist/src/commands/shared.js +137 -0
  97. package/dist/src/commands/shared.js.map +1 -0
  98. package/dist/src/commands/unbond.d.ts +2 -0
  99. package/dist/src/commands/unbond.d.ts.map +1 -0
  100. package/dist/src/commands/unbond.js +29 -0
  101. package/dist/src/commands/unbond.js.map +1 -0
  102. package/dist/src/core/algorithms.d.ts +19 -0
  103. package/dist/src/core/algorithms.d.ts.map +1 -0
  104. package/dist/src/core/algorithms.js +98 -0
  105. package/dist/src/core/algorithms.js.map +1 -0
  106. package/dist/src/core/embeddings.d.ts +12 -0
  107. package/dist/src/core/embeddings.d.ts.map +1 -0
  108. package/dist/src/core/embeddings.js +64 -0
  109. package/dist/src/core/embeddings.js.map +1 -0
  110. package/dist/src/core/git-impact.d.ts +25 -0
  111. package/dist/src/core/git-impact.d.ts.map +1 -0
  112. package/dist/src/core/git-impact.js +97 -0
  113. package/dist/src/core/git-impact.js.map +1 -0
  114. package/dist/src/core/graph-builder.d.ts +5 -0
  115. package/dist/src/core/graph-builder.d.ts.map +1 -0
  116. package/dist/src/core/graph-builder.js +88 -0
  117. package/dist/src/core/graph-builder.js.map +1 -0
  118. package/dist/src/core/graph.d.ts +34 -0
  119. package/dist/src/core/graph.d.ts.map +1 -0
  120. package/dist/src/core/graph.js +95 -0
  121. package/dist/src/core/graph.js.map +1 -0
  122. package/dist/src/core/impact.d.ts +22 -0
  123. package/dist/src/core/impact.d.ts.map +1 -0
  124. package/dist/src/core/impact.js +68 -0
  125. package/dist/src/core/impact.js.map +1 -0
  126. package/dist/src/core/languages.d.ts +4 -0
  127. package/dist/src/core/languages.d.ts.map +1 -0
  128. package/dist/src/core/languages.js +59 -0
  129. package/dist/src/core/languages.js.map +1 -0
  130. package/dist/src/core/parser.d.ts +16 -0
  131. package/dist/src/core/parser.d.ts.map +1 -0
  132. package/dist/src/core/parser.js +689 -0
  133. package/dist/src/core/parser.js.map +1 -0
  134. package/dist/src/core/scanner.d.ts +26 -0
  135. package/dist/src/core/scanner.d.ts.map +1 -0
  136. package/dist/src/core/scanner.js +87 -0
  137. package/dist/src/core/scanner.js.map +1 -0
  138. package/dist/src/core/search.d.ts +34 -0
  139. package/dist/src/core/search.d.ts.map +1 -0
  140. package/dist/src/core/search.js +146 -0
  141. package/dist/src/core/search.js.map +1 -0
  142. package/dist/src/core/types.d.ts +29 -0
  143. package/dist/src/core/types.d.ts.map +1 -0
  144. package/dist/src/core/types.js +12 -0
  145. package/dist/src/core/types.js.map +1 -0
  146. package/dist/src/cortex/engine.d.ts +10 -0
  147. package/dist/src/cortex/engine.d.ts.map +1 -0
  148. package/dist/src/cortex/engine.js +93 -0
  149. package/dist/src/cortex/engine.js.map +1 -0
  150. package/dist/src/cortex/index.d.ts +13 -0
  151. package/dist/src/cortex/index.d.ts.map +1 -0
  152. package/dist/src/cortex/index.js +12 -0
  153. package/dist/src/cortex/index.js.map +1 -0
  154. package/dist/src/cortex/patterns.d.ts +63 -0
  155. package/dist/src/cortex/patterns.d.ts.map +1 -0
  156. package/dist/src/cortex/patterns.js +242 -0
  157. package/dist/src/cortex/patterns.js.map +1 -0
  158. package/dist/src/cortex/pgq-queries.d.ts +11 -0
  159. package/dist/src/cortex/pgq-queries.d.ts.map +1 -0
  160. package/dist/src/cortex/pgq-queries.js +23 -0
  161. package/dist/src/cortex/pgq-queries.js.map +1 -0
  162. package/dist/src/cortex/pgq.d.ts +5 -0
  163. package/dist/src/cortex/pgq.d.ts.map +1 -0
  164. package/dist/src/cortex/pgq.js +54 -0
  165. package/dist/src/cortex/pgq.js.map +1 -0
  166. package/dist/src/cortex/real-time-enrichment.d.ts +20 -0
  167. package/dist/src/cortex/real-time-enrichment.d.ts.map +1 -0
  168. package/dist/src/cortex/real-time-enrichment.js +96 -0
  169. package/dist/src/cortex/real-time-enrichment.js.map +1 -0
  170. package/dist/src/cortex/repository.d.ts +231 -0
  171. package/dist/src/cortex/repository.d.ts.map +1 -0
  172. package/dist/src/cortex/repository.js +1078 -0
  173. package/dist/src/cortex/repository.js.map +1 -0
  174. package/dist/src/cortex/schema.d.ts +9 -0
  175. package/dist/src/cortex/schema.d.ts.map +1 -0
  176. package/dist/src/cortex/schema.js +364 -0
  177. package/dist/src/cortex/schema.js.map +1 -0
  178. package/dist/src/cortex/stage-0-structure.d.ts +7 -0
  179. package/dist/src/cortex/stage-0-structure.d.ts.map +1 -0
  180. package/dist/src/cortex/stage-0-structure.js +119 -0
  181. package/dist/src/cortex/stage-0-structure.js.map +1 -0
  182. package/dist/src/cortex/stage-1-symbols.d.ts +7 -0
  183. package/dist/src/cortex/stage-1-symbols.d.ts.map +1 -0
  184. package/dist/src/cortex/stage-1-symbols.js +605 -0
  185. package/dist/src/cortex/stage-1-symbols.js.map +1 -0
  186. package/dist/src/cortex/stage-2-resolution.d.ts +7 -0
  187. package/dist/src/cortex/stage-2-resolution.d.ts.map +1 -0
  188. package/dist/src/cortex/stage-2-resolution.js +469 -0
  189. package/dist/src/cortex/stage-2-resolution.js.map +1 -0
  190. package/dist/src/cortex/stage-3-callgraph.d.ts +7 -0
  191. package/dist/src/cortex/stage-3-callgraph.d.ts.map +1 -0
  192. package/dist/src/cortex/stage-3-callgraph.js +323 -0
  193. package/dist/src/cortex/stage-3-callgraph.js.map +1 -0
  194. package/dist/src/cortex/stage-4-types.d.ts +7 -0
  195. package/dist/src/cortex/stage-4-types.d.ts.map +1 -0
  196. package/dist/src/cortex/stage-4-types.js +462 -0
  197. package/dist/src/cortex/stage-4-types.js.map +1 -0
  198. package/dist/src/cortex/stage-5-flow.d.ts +7 -0
  199. package/dist/src/cortex/stage-5-flow.d.ts.map +1 -0
  200. package/dist/src/cortex/stage-5-flow.js +702 -0
  201. package/dist/src/cortex/stage-5-flow.js.map +1 -0
  202. package/dist/src/cortex/stage-6-topology.d.ts +15 -0
  203. package/dist/src/cortex/stage-6-topology.d.ts.map +1 -0
  204. package/dist/src/cortex/stage-6-topology.js +382 -0
  205. package/dist/src/cortex/stage-6-topology.js.map +1 -0
  206. package/dist/src/cortex/stage-7-intelligence.d.ts +34 -0
  207. package/dist/src/cortex/stage-7-intelligence.d.ts.map +1 -0
  208. package/dist/src/cortex/stage-7-intelligence.js +258 -0
  209. package/dist/src/cortex/stage-7-intelligence.js.map +1 -0
  210. package/dist/src/cortex/topology-types.d.ts +78 -0
  211. package/dist/src/cortex/topology-types.d.ts.map +1 -0
  212. package/dist/src/cortex/topology-types.js +2 -0
  213. package/dist/src/cortex/topology-types.js.map +1 -0
  214. package/dist/src/cortex/types.d.ts +250 -0
  215. package/dist/src/cortex/types.d.ts.map +1 -0
  216. package/dist/src/cortex/types.js +2 -0
  217. package/dist/src/cortex/types.js.map +1 -0
  218. package/dist/src/dna/embeddings.d.ts +10 -0
  219. package/dist/src/dna/embeddings.d.ts.map +1 -0
  220. package/dist/src/dna/embeddings.js +46 -0
  221. package/dist/src/dna/embeddings.js.map +1 -0
  222. package/dist/src/dna/engine.d.ts +30 -0
  223. package/dist/src/dna/engine.d.ts.map +1 -0
  224. package/dist/src/dna/engine.js +254 -0
  225. package/dist/src/dna/engine.js.map +1 -0
  226. package/dist/src/dna/index.d.ts +5 -0
  227. package/dist/src/dna/index.d.ts.map +1 -0
  228. package/dist/src/dna/index.js +5 -0
  229. package/dist/src/dna/index.js.map +1 -0
  230. package/dist/src/dna/storage.d.ts +19 -0
  231. package/dist/src/dna/storage.d.ts.map +1 -0
  232. package/dist/src/dna/storage.js +112 -0
  233. package/dist/src/dna/storage.js.map +1 -0
  234. package/dist/src/dna/types.d.ts +38 -0
  235. package/dist/src/dna/types.d.ts.map +1 -0
  236. package/dist/src/dna/types.js +114 -0
  237. package/dist/src/dna/types.js.map +1 -0
  238. package/dist/src/events/bus.d.ts +10 -0
  239. package/dist/src/events/bus.d.ts.map +1 -0
  240. package/dist/src/events/bus.js +36 -0
  241. package/dist/src/events/bus.js.map +1 -0
  242. package/dist/src/events/ipc.d.ts +3 -0
  243. package/dist/src/events/ipc.d.ts.map +1 -0
  244. package/dist/src/events/ipc.js +25 -0
  245. package/dist/src/events/ipc.js.map +1 -0
  246. package/dist/src/events/session.d.ts +21 -0
  247. package/dist/src/events/session.d.ts.map +1 -0
  248. package/dist/src/events/session.js +39 -0
  249. package/dist/src/events/session.js.map +1 -0
  250. package/dist/src/events/types.d.ts +15 -0
  251. package/dist/src/events/types.d.ts.map +1 -0
  252. package/dist/src/events/types.js +26 -0
  253. package/dist/src/events/types.js.map +1 -0
  254. package/dist/src/hooks/attention.d.ts +26 -0
  255. package/dist/src/hooks/attention.d.ts.map +1 -0
  256. package/dist/src/hooks/attention.js +90 -0
  257. package/dist/src/hooks/attention.js.map +1 -0
  258. package/dist/src/hooks/handlers/post-tool-use-failure.d.ts +20 -0
  259. package/dist/src/hooks/handlers/post-tool-use-failure.d.ts.map +1 -0
  260. package/dist/src/hooks/handlers/post-tool-use-failure.js +60 -0
  261. package/dist/src/hooks/handlers/post-tool-use-failure.js.map +1 -0
  262. package/dist/src/hooks/handlers/post-tool-use.d.ts +22 -0
  263. package/dist/src/hooks/handlers/post-tool-use.d.ts.map +1 -0
  264. package/dist/src/hooks/handlers/post-tool-use.js +96 -0
  265. package/dist/src/hooks/handlers/post-tool-use.js.map +1 -0
  266. package/dist/src/hooks/handlers/pre-compact.d.ts +17 -0
  267. package/dist/src/hooks/handlers/pre-compact.d.ts.map +1 -0
  268. package/dist/src/hooks/handlers/pre-compact.js +28 -0
  269. package/dist/src/hooks/handlers/pre-compact.js.map +1 -0
  270. package/dist/src/hooks/handlers/pre-tool-use.d.ts +32 -0
  271. package/dist/src/hooks/handlers/pre-tool-use.d.ts.map +1 -0
  272. package/dist/src/hooks/handlers/pre-tool-use.js +219 -0
  273. package/dist/src/hooks/handlers/pre-tool-use.js.map +1 -0
  274. package/dist/src/hooks/handlers/session-end.d.ts +18 -0
  275. package/dist/src/hooks/handlers/session-end.d.ts.map +1 -0
  276. package/dist/src/hooks/handlers/session-end.js +42 -0
  277. package/dist/src/hooks/handlers/session-end.js.map +1 -0
  278. package/dist/src/hooks/handlers/session-start.d.ts +25 -0
  279. package/dist/src/hooks/handlers/session-start.d.ts.map +1 -0
  280. package/dist/src/hooks/handlers/session-start.js +61 -0
  281. package/dist/src/hooks/handlers/session-start.js.map +1 -0
  282. package/dist/src/hooks/handlers/stop.d.ts +21 -0
  283. package/dist/src/hooks/handlers/stop.d.ts.map +1 -0
  284. package/dist/src/hooks/handlers/stop.js +40 -0
  285. package/dist/src/hooks/handlers/stop.js.map +1 -0
  286. package/dist/src/hooks/handlers/subagent-start.d.ts +17 -0
  287. package/dist/src/hooks/handlers/subagent-start.d.ts.map +1 -0
  288. package/dist/src/hooks/handlers/subagent-start.js +48 -0
  289. package/dist/src/hooks/handlers/subagent-start.js.map +1 -0
  290. package/dist/src/hooks/handlers/user-prompt-submit.d.ts +12 -0
  291. package/dist/src/hooks/handlers/user-prompt-submit.d.ts.map +1 -0
  292. package/dist/src/hooks/handlers/user-prompt-submit.js +31 -0
  293. package/dist/src/hooks/handlers/user-prompt-submit.js.map +1 -0
  294. package/dist/src/hooks/index.d.ts +14 -0
  295. package/dist/src/hooks/index.d.ts.map +1 -0
  296. package/dist/src/hooks/index.js +13 -0
  297. package/dist/src/hooks/index.js.map +1 -0
  298. package/dist/src/hooks/post-tool-use.d.ts +12 -0
  299. package/dist/src/hooks/post-tool-use.d.ts.map +1 -0
  300. package/dist/src/hooks/post-tool-use.js +33 -0
  301. package/dist/src/hooks/post-tool-use.js.map +1 -0
  302. package/dist/src/hooks/pre-tool-use.d.ts +24 -0
  303. package/dist/src/hooks/pre-tool-use.d.ts.map +1 -0
  304. package/dist/src/hooks/pre-tool-use.js +117 -0
  305. package/dist/src/hooks/pre-tool-use.js.map +1 -0
  306. package/dist/src/hooks/session-store.d.ts +55 -0
  307. package/dist/src/hooks/session-store.d.ts.map +1 -0
  308. package/dist/src/hooks/session-store.js +69 -0
  309. package/dist/src/hooks/session-store.js.map +1 -0
  310. package/dist/src/hooks/types.d.ts +67 -0
  311. package/dist/src/hooks/types.d.ts.map +1 -0
  312. package/dist/src/hooks/types.js +28 -0
  313. package/dist/src/hooks/types.js.map +1 -0
  314. package/dist/src/index.d.ts +16 -0
  315. package/dist/src/index.d.ts.map +1 -0
  316. package/dist/src/index.js +16 -0
  317. package/dist/src/index.js.map +1 -0
  318. package/dist/src/init/agent-connector.d.ts +43 -0
  319. package/dist/src/init/agent-connector.d.ts.map +1 -0
  320. package/dist/src/init/agent-connector.js +338 -0
  321. package/dist/src/init/agent-connector.js.map +1 -0
  322. package/dist/src/init/dna-bootstrap.d.ts +10 -0
  323. package/dist/src/init/dna-bootstrap.d.ts.map +1 -0
  324. package/dist/src/init/dna-bootstrap.js +32 -0
  325. package/dist/src/init/dna-bootstrap.js.map +1 -0
  326. package/dist/src/init/index.d.ts +29 -0
  327. package/dist/src/init/index.d.ts.map +1 -0
  328. package/dist/src/init/index.js +81 -0
  329. package/dist/src/init/index.js.map +1 -0
  330. package/dist/src/init/overview-generator.d.ts +5 -0
  331. package/dist/src/init/overview-generator.d.ts.map +1 -0
  332. package/dist/src/init/overview-generator.js +85 -0
  333. package/dist/src/init/overview-generator.js.map +1 -0
  334. package/dist/src/init/parsers/eslint-config.d.ts +10 -0
  335. package/dist/src/init/parsers/eslint-config.d.ts.map +1 -0
  336. package/dist/src/init/parsers/eslint-config.js +50 -0
  337. package/dist/src/init/parsers/eslint-config.js.map +1 -0
  338. package/dist/src/init/parsers/markdown-rules.d.ts +3 -0
  339. package/dist/src/init/parsers/markdown-rules.d.ts.map +1 -0
  340. package/dist/src/init/parsers/markdown-rules.js +90 -0
  341. package/dist/src/init/parsers/markdown-rules.js.map +1 -0
  342. package/dist/src/init/parsers/package-json.d.ts +17 -0
  343. package/dist/src/init/parsers/package-json.d.ts.map +1 -0
  344. package/dist/src/init/parsers/package-json.js +75 -0
  345. package/dist/src/init/parsers/package-json.js.map +1 -0
  346. package/dist/src/init/parsers/prettier-config.d.ts +16 -0
  347. package/dist/src/init/parsers/prettier-config.d.ts.map +1 -0
  348. package/dist/src/init/parsers/prettier-config.js +30 -0
  349. package/dist/src/init/parsers/prettier-config.js.map +1 -0
  350. package/dist/src/init/parsers/tsconfig.d.ts +32 -0
  351. package/dist/src/init/parsers/tsconfig.d.ts.map +1 -0
  352. package/dist/src/init/parsers/tsconfig.js +64 -0
  353. package/dist/src/init/parsers/tsconfig.js.map +1 -0
  354. package/dist/src/init/parsers/types.d.ts +27 -0
  355. package/dist/src/init/parsers/types.d.ts.map +1 -0
  356. package/dist/src/init/parsers/types.js +2 -0
  357. package/dist/src/init/parsers/types.js.map +1 -0
  358. package/dist/src/init/project-analyzer.d.ts +3 -0
  359. package/dist/src/init/project-analyzer.d.ts.map +1 -0
  360. package/dist/src/init/project-analyzer.js +102 -0
  361. package/dist/src/init/project-analyzer.js.map +1 -0
  362. package/dist/src/init/rule-importer.d.ts +3 -0
  363. package/dist/src/init/rule-importer.d.ts.map +1 -0
  364. package/dist/src/init/rule-importer.js +101 -0
  365. package/dist/src/init/rule-importer.js.map +1 -0
  366. package/dist/src/mcp/context.d.ts +43 -0
  367. package/dist/src/mcp/context.d.ts.map +1 -0
  368. package/dist/src/mcp/context.js +167 -0
  369. package/dist/src/mcp/context.js.map +1 -0
  370. package/dist/src/mcp/http-api.d.ts +10 -0
  371. package/dist/src/mcp/http-api.d.ts.map +1 -0
  372. package/dist/src/mcp/http-api.js +580 -0
  373. package/dist/src/mcp/http-api.js.map +1 -0
  374. package/dist/src/mcp/index.d.ts +8 -0
  375. package/dist/src/mcp/index.d.ts.map +1 -0
  376. package/dist/src/mcp/index.js +8 -0
  377. package/dist/src/mcp/index.js.map +1 -0
  378. package/dist/src/mcp/resources.d.ts +5 -0
  379. package/dist/src/mcp/resources.d.ts.map +1 -0
  380. package/dist/src/mcp/resources.js +78 -0
  381. package/dist/src/mcp/resources.js.map +1 -0
  382. package/dist/src/mcp/server.d.ts +6 -0
  383. package/dist/src/mcp/server.d.ts.map +1 -0
  384. package/dist/src/mcp/server.js +265 -0
  385. package/dist/src/mcp/server.js.map +1 -0
  386. package/dist/src/mcp/tool-response.d.ts +6 -0
  387. package/dist/src/mcp/tool-response.d.ts.map +1 -0
  388. package/dist/src/mcp/tool-response.js +19 -0
  389. package/dist/src/mcp/tool-response.js.map +1 -0
  390. package/dist/src/mcp/tools/architecture-tools.d.ts +15 -0
  391. package/dist/src/mcp/tools/architecture-tools.d.ts.map +1 -0
  392. package/dist/src/mcp/tools/architecture-tools.js +56 -0
  393. package/dist/src/mcp/tools/architecture-tools.js.map +1 -0
  394. package/dist/src/mcp/tools/dna-tools.d.ts +21 -0
  395. package/dist/src/mcp/tools/dna-tools.d.ts.map +1 -0
  396. package/dist/src/mcp/tools/dna-tools.js +15 -0
  397. package/dist/src/mcp/tools/dna-tools.js.map +1 -0
  398. package/dist/src/mcp/tools/graph-tools.d.ts +49 -0
  399. package/dist/src/mcp/tools/graph-tools.d.ts.map +1 -0
  400. package/dist/src/mcp/tools/graph-tools.js +45 -0
  401. package/dist/src/mcp/tools/graph-tools.js.map +1 -0
  402. package/dist/src/mcp/tools/health-tools.d.ts +5 -0
  403. package/dist/src/mcp/tools/health-tools.d.ts.map +1 -0
  404. package/dist/src/mcp/tools/health-tools.js +7 -0
  405. package/dist/src/mcp/tools/health-tools.js.map +1 -0
  406. package/dist/src/mcp/tools/impact-tools.d.ts +21 -0
  407. package/dist/src/mcp/tools/impact-tools.d.ts.map +1 -0
  408. package/dist/src/mcp/tools/impact-tools.js +23 -0
  409. package/dist/src/mcp/tools/impact-tools.js.map +1 -0
  410. package/dist/src/mcp/tools/intent-tools.d.ts +32 -0
  411. package/dist/src/mcp/tools/intent-tools.d.ts.map +1 -0
  412. package/dist/src/mcp/tools/intent-tools.js +77 -0
  413. package/dist/src/mcp/tools/intent-tools.js.map +1 -0
  414. package/dist/src/mcp/tools/project-tools.d.ts +53 -0
  415. package/dist/src/mcp/tools/project-tools.d.ts.map +1 -0
  416. package/dist/src/mcp/tools/project-tools.js +91 -0
  417. package/dist/src/mcp/tools/project-tools.js.map +1 -0
  418. package/dist/src/mcp/tools/rename-tool.d.ts +25 -0
  419. package/dist/src/mcp/tools/rename-tool.d.ts.map +1 -0
  420. package/dist/src/mcp/tools/rename-tool.js +106 -0
  421. package/dist/src/mcp/tools/rename-tool.js.map +1 -0
  422. package/dist/src/mcp/tools/trace-tools.d.ts +4 -0
  423. package/dist/src/mcp/tools/trace-tools.d.ts.map +1 -0
  424. package/dist/src/mcp/tools/trace-tools.js +268 -0
  425. package/dist/src/mcp/tools/trace-tools.js.map +1 -0
  426. package/dist/src/storage/db.d.ts +13 -0
  427. package/dist/src/storage/db.d.ts.map +1 -0
  428. package/dist/src/storage/db.js +230 -0
  429. package/dist/src/storage/db.js.map +1 -0
  430. package/dist/src/storage/repository.d.ts +54 -0
  431. package/dist/src/storage/repository.d.ts.map +1 -0
  432. package/dist/src/storage/repository.js +257 -0
  433. package/dist/src/storage/repository.js.map +1 -0
  434. package/dist/src/utils/config.d.ts +18 -0
  435. package/dist/src/utils/config.d.ts.map +1 -0
  436. package/dist/src/utils/config.js +93 -0
  437. package/dist/src/utils/config.js.map +1 -0
  438. package/dist/src/utils/files.d.ts +3 -0
  439. package/dist/src/utils/files.d.ts.map +1 -0
  440. package/dist/src/utils/files.js +52 -0
  441. package/dist/src/utils/files.js.map +1 -0
  442. package/dist/src/utils/strings.d.ts +2 -0
  443. package/dist/src/utils/strings.d.ts.map +1 -0
  444. package/dist/src/utils/strings.js +11 -0
  445. package/dist/src/utils/strings.js.map +1 -0
  446. package/dist/tsconfig.tsbuildinfo +1 -0
  447. package/hooks/post-tool-use.sh +37 -0
  448. package/hooks/pre-tool-use.sh +43 -0
  449. package/hooks/session-start.sh +67 -0
  450. package/package.json +103 -0
  451. package/skills/symbiote-init/SKILL.md +104 -0
@@ -0,0 +1,43 @@
1
+ #!/bin/bash
2
+
3
+ INPUT=$(cat)
4
+
5
+ CWD=$(echo "$INPUT" | python3 -c "import sys,json; print(json.load(sys.stdin).get('cwd',''))" 2>/dev/null) || exit 0
6
+ TOOL=$(echo "$INPUT" | python3 -c "import sys,json; print(json.load(sys.stdin).get('tool_name',''))" 2>/dev/null) || exit 0
7
+ FILE=$(echo "$INPUT" | python3 -c "import sys,json; print(json.load(sys.stdin).get('tool_input',{}).get('file_path',''))" 2>/dev/null) || exit 0
8
+
9
+ [ -z "$CWD" ] && exit 0
10
+
11
+ BRAIN_DIR="$CWD/.brain"
12
+ [ -d "$BRAIN_DIR" ] || exit 0
13
+
14
+ case "$TOOL" in
15
+ Read|Edit|Write) ;;
16
+ *) exit 0 ;;
17
+ esac
18
+
19
+ [ -z "$FILE" ] && exit 0
20
+
21
+ PORT_FILE="$BRAIN_DIR/port"
22
+ [ -f "$PORT_FILE" ] || exit 0
23
+ PORT=$(cat "$PORT_FILE" 2>/dev/null | tr -d '[:space:]')
24
+ [ -z "$PORT" ] && exit 0
25
+
26
+ ENCODED_FILE=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$FILE" 2>/dev/null) || exit 0
27
+ ENCODED_TOOL=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$TOOL" 2>/dev/null) || exit 0
28
+ ENCODED_ROOT=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$CWD" 2>/dev/null) || exit 0
29
+
30
+ RESULT=$(curl -s --max-time 3 "http://127.0.0.1:${PORT}/internal/hook-context?file=${ENCODED_FILE}&tool=${ENCODED_TOOL}&root=${ENCODED_ROOT}" 2>/dev/null) || exit 0
31
+
32
+ CONTEXT=$(echo "$RESULT" | python3 -c "import sys,json; d=json.load(sys.stdin); c=d.get('additionalContext',''); print(c) if c else sys.exit(1)" 2>/dev/null) || exit 0
33
+
34
+ python3 -c "
35
+ import json,sys
36
+ print(json.dumps({
37
+ 'hookSpecificOutput': {
38
+ 'hookEventName': 'PreToolUse',
39
+ 'additionalContext': sys.argv[1]
40
+ }
41
+ }))
42
+ " "$CONTEXT"
43
+ exit 0
@@ -0,0 +1,67 @@
1
+ #!/bin/bash
2
+ # Symbiote SessionStart hook for Claude Code
3
+ # Fires on session startup. Stdout is injected into Claude's context.
4
+
5
+ dir="$PWD"
6
+ found=false
7
+ for i in 1 2 3 4 5; do
8
+ if [ -d "$dir/.brain" ]; then
9
+ found=true
10
+ break
11
+ fi
12
+ parent="$(dirname "$dir")"
13
+ [ "$parent" = "$dir" ] && break
14
+ dir="$parent"
15
+ done
16
+
17
+ if [ "$found" = false ]; then
18
+ exit 0
19
+ fi
20
+
21
+ # Auto-start symbiote serve if not already running
22
+ port_file="$dir/.brain/port"
23
+ if [ -f "$port_file" ]; then
24
+ port=$(cat "$port_file" | tr -d '[:space:]')
25
+ # Check if the server is actually responding
26
+ if ! curl -sf --max-time 1 "http://127.0.0.1:$port/internal/health" > /dev/null 2>&1; then
27
+ # Port file exists but server is dead — clean up and restart
28
+ rm -f "$port_file"
29
+ nohup npx symbiote-cli serve --no-open > /dev/null 2>&1 &
30
+ sleep 1
31
+ fi
32
+ else
33
+ # No port file — start the server
34
+ nohup npx symbiote-cli serve --no-open > /dev/null 2>&1 &
35
+ sleep 1
36
+ fi
37
+
38
+ cat << 'EOF'
39
+ ## Symbiote — Project Brain Active
40
+
41
+ This codebase is indexed by Symbiote, providing a living knowledge graph with code structure, dependencies, impact analysis, and developer DNA.
42
+
43
+ **Before making changes, use these MCP tools:**
44
+ - `get_context_for_file` — Dependencies, dependents, constraints for any file (use BEFORE editing)
45
+ - `get_developer_dna` — The developer's coding style and preferences (use to match their conventions)
46
+ - `query_graph` — Search symbols, trace call chains, find dependents
47
+ - `semantic_search` — Natural language search over the codebase
48
+ - `get_health` — Dead code, circular deps, coupling hotspots, constraint violations
49
+ - `get_impact` — Blast radius analysis: what breaks if you change a symbol
50
+ - `detect_changes` — Git diff mapped to affected graph nodes
51
+ - `get_constraints` — Active project rules (enforce these)
52
+ - `get_decisions` — Architectural decisions with rationale
53
+
54
+ **IMPORTANT — When the developer corrects you or states a preference:**
55
+ You MUST call the `record_instruction` MCP tool to capture it in Symbiote's DNA system. This is how Symbiote learns across sessions and tools. Do this IN ADDITION to any other memory you save. Examples of when to call it:
56
+ - "don't use semicolons" → call `record_instruction` with instruction="Don't use semicolons"
57
+ - "prefer early returns" → call `record_instruction` with instruction="Prefer early returns over nested conditions"
58
+ - "no, use X instead of Y" → call `record_instruction` with the correction
59
+
60
+ **Workflow:**
61
+ 1. Start with `get_developer_dna` to understand the developer's style
62
+ 2. Use `get_context_for_file` before reading or editing any file
63
+ 3. Use `get_constraints` to know what rules to follow
64
+ 4. When the developer corrects you, ALWAYS call `record_instruction` with their feedback
65
+ EOF
66
+
67
+ exit 0
package/package.json ADDED
@@ -0,0 +1,103 @@
1
+ {
2
+ "name": "symbiote-cli",
3
+ "version": "0.1.0",
4
+ "description": "Symbiote bonds with your AI tools — giving them memory, context, and your coding DNA.",
5
+ "type": "module",
6
+ "imports": {
7
+ "#storage/*": "./dist/src/storage/*",
8
+ "#core/*": "./dist/src/core/*",
9
+ "#cortex/*": "./dist/src/cortex/*",
10
+ "#dna/*": "./dist/src/dna/*",
11
+ "#brain/*": "./dist/src/brain/*",
12
+ "#events/*": "./dist/src/events/*",
13
+ "#mcp/*": "./dist/src/mcp/*",
14
+ "#utils/*": "./dist/src/utils/*",
15
+ "#commands/*": "./dist/src/commands/*",
16
+ "#hooks/*": "./dist/src/hooks/*",
17
+ "#init/*": "./dist/src/init/*"
18
+ },
19
+ "bin": {
20
+ "symbiote": "dist/bin/symbiote.js"
21
+ },
22
+ "main": "./dist/src/index.js",
23
+ "types": "./dist/src/index.d.ts",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/src/index.d.ts",
27
+ "import": "./dist/src/index.js"
28
+ }
29
+ },
30
+ "files": [
31
+ "dist/",
32
+ "skills/",
33
+ "hooks/",
34
+ "README.md",
35
+ "LICENSE"
36
+ ],
37
+ "engines": {
38
+ "node": ">=20"
39
+ },
40
+ "scripts": {
41
+ "build": "tsc",
42
+ "dev": "tsc --watch",
43
+ "test": "vitest run",
44
+ "test:watch": "vitest",
45
+ "type-check": "tsc --noEmit",
46
+ "prepublishOnly": "npm run build"
47
+ },
48
+ "dependencies": {
49
+ "@clack/prompts": "^0.10.0",
50
+ "@duckdb/node-api": "1.5.0-r.1",
51
+ "@huggingface/transformers": "^3.8.1",
52
+ "@modelcontextprotocol/sdk": "^1.27.1",
53
+ "chokidar": "^4.0.0",
54
+ "glob": "^11.0.0",
55
+ "graphology": "^0.25.4",
56
+ "graphology-communities-louvain": "^2.0.1",
57
+ "graphology-metrics": "^2.3.0",
58
+ "picocolors": "^1.1.0",
59
+ "tree-sitter": "^0.22.0",
60
+ "tree-sitter-c": "^0.23.0",
61
+ "tree-sitter-cpp": "^0.23.0",
62
+ "tree-sitter-go": "^0.23.0",
63
+ "tree-sitter-java": "^0.23.0",
64
+ "tree-sitter-javascript": "^0.23.0",
65
+ "tree-sitter-php": "^0.23.0",
66
+ "tree-sitter-python": "^0.23.0",
67
+ "tree-sitter-ruby": "^0.23.0",
68
+ "tree-sitter-rust": "^0.23.0",
69
+ "tree-sitter-typescript": "^0.23.0",
70
+ "zod": "^4.3.6"
71
+ },
72
+ "devDependencies": {
73
+ "@types/node": "^22.0.0",
74
+ "typescript": "^5.7.0",
75
+ "vite-tsconfig-paths": "^6.1.1",
76
+ "vitest": "^3.0.0"
77
+ },
78
+ "keywords": [
79
+ "ai",
80
+ "mcp",
81
+ "mcp-server",
82
+ "ai-coding",
83
+ "claude",
84
+ "cursor",
85
+ "copilot",
86
+ "windsurf",
87
+ "code-context",
88
+ "code-intelligence",
89
+ "tree-sitter",
90
+ "knowledge-graph",
91
+ "developer-tools"
92
+ ],
93
+ "author": {
94
+ "name": "Mohamed Ashraf",
95
+ "email": "cupo.ashraf@gmail.com"
96
+ },
97
+ "license": "MIT",
98
+ "repository": {
99
+ "type": "git",
100
+ "url": "git+https://github.com/MohmmedAshraf/symbiote.git"
101
+ },
102
+ "homepage": "https://github.com/MohmmedAshraf/symbiote"
103
+ }
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: symbiote-init
3
+ description: Initialize Symbiote for the current project. Scans the codebase and extracts developer DNA (coding preferences), project constraints, and architectural decisions from the current context. Use when the developer runs /symbiote-init, asks to "initialize symbiote", "set up symbiote", or "scan my project". Requires symbiote-cli to be installed (npx symbiote-cli install).
4
+ ---
5
+
6
+ # Symbiote Project Init
7
+
8
+ Initialize Symbiote for the current project — scan codebase and extract DNA + intent.
9
+
10
+ MCP server is already registered globally by `symbiote install`. This skill only scans and extracts.
11
+
12
+ ## Process
13
+
14
+ 1. Scan the codebase
15
+ 2. Build extraction lists from context
16
+ 3. Dispatch subagent to record everything
17
+ 4. Print one-line summary
18
+
19
+ ## Step 1: Scan
20
+
21
+ ```bash
22
+ npx symbiote-cli scan
23
+ ```
24
+
25
+ ## Step 2: Build Extraction Lists
26
+
27
+ Read your context (CLAUDE.md, memories, rule files) and build three separate lists:
28
+
29
+ ### DNA (coding preferences) → `record_instruction`
30
+
31
+ Extract how the developer writes code:
32
+
33
+ - Formatting (indentation, quotes, semicolons, line length)
34
+ - Language conventions (strict TypeScript, ESM, etc.)
35
+ - Code structure (early returns, composition, small functions)
36
+ - Anti-patterns (no `any`, no dead code, no comments)
37
+ - Testing preferences (TDD, isolation, framework)
38
+ - Workflow (conventional commits, small commits)
39
+
40
+ ### Constraints (project rules) → `propose_constraint`
41
+
42
+ Extract rules the project enforces:
43
+
44
+ - "All mutations through server actions"
45
+ - "Validate external input with Zod at boundaries"
46
+ - "Tests must mirror src/ structure"
47
+
48
+ ### Decisions (architectural choices) → `propose_decision`
49
+
50
+ Extract choices with rationale:
51
+
52
+ - "Chose Vitest over Jest for native ESM support"
53
+ - "Using DuckDB for graph storage — local-first, no external deps"
54
+ - "Switched to Drizzle for better type safety"
55
+
56
+ ### What to Skip (applies to all three)
57
+
58
+ - File paths or directory descriptions
59
+ - Tool/product feature lists
60
+ - Author identity
61
+ - CLI commands or usage examples
62
+ - Anything describing WHAT the project IS rather than rules/choices/preferences
63
+
64
+ ### Formatting Rules (applies to all three)
65
+
66
+ Each entry must be:
67
+
68
+ - One clear, grammatically correct sentence
69
+ - Self-contained — understandable without context
70
+ - Specific — not vague or overly broad
71
+
72
+ ## Step 3: Dispatch Subagent
73
+
74
+ Launch a single Agent to record everything. Pass it all three lists.
75
+
76
+ **Agent prompt template:**
77
+
78
+ ```
79
+ Record the following Symbiote entries using MCP tools. Call tools in parallel where possible.
80
+
81
+ **DNA entries** — use `record_instruction` with `isExplicit: true` for each:
82
+ 1. [instruction]
83
+ 2. [instruction]
84
+
85
+ **Constraints** — use `propose_constraint` for each with `scope: "global"` and a slugified `id`:
86
+ 1. [constraint]
87
+ 2. [constraint]
88
+
89
+ **Decisions** — use `propose_decision` for each with `scope: "global"` and a slugified `id`:
90
+ 1. [decision]
91
+ 2. [decision]
92
+
93
+ Return counts: { dna: N, constraints: N, decisions: N, failed: N }
94
+ ```
95
+
96
+ ## Step 4: Output
97
+
98
+ One line, nothing more:
99
+
100
+ ```
101
+ Symbiote initialized — scanned 350 files, recorded 18 DNA entries, 5 constraints, 3 decisions.
102
+ ```
103
+
104
+ Do NOT render tables, lists, or per-entry details.