universal-agent-protocol 0.5.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 (415) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +462 -0
  3. package/dist/analyzers/index.d.ts +3 -0
  4. package/dist/analyzers/index.d.ts.map +1 -0
  5. package/dist/analyzers/index.js +656 -0
  6. package/dist/analyzers/index.js.map +1 -0
  7. package/dist/bin/cli.d.ts +3 -0
  8. package/dist/bin/cli.d.ts.map +1 -0
  9. package/dist/bin/cli.js +506 -0
  10. package/dist/bin/cli.js.map +1 -0
  11. package/dist/bin/tool-calls.d.ts +3 -0
  12. package/dist/bin/tool-calls.d.ts.map +1 -0
  13. package/dist/bin/tool-calls.js +4 -0
  14. package/dist/bin/tool-calls.js.map +1 -0
  15. package/dist/cli/agent.d.ts +20 -0
  16. package/dist/cli/agent.d.ts.map +1 -0
  17. package/dist/cli/agent.js +434 -0
  18. package/dist/cli/agent.js.map +1 -0
  19. package/dist/cli/analyze.d.ts +7 -0
  20. package/dist/cli/analyze.d.ts.map +1 -0
  21. package/dist/cli/analyze.js +103 -0
  22. package/dist/cli/analyze.js.map +1 -0
  23. package/dist/cli/coord.d.ts +7 -0
  24. package/dist/cli/coord.d.ts.map +1 -0
  25. package/dist/cli/coord.js +138 -0
  26. package/dist/cli/coord.js.map +1 -0
  27. package/dist/cli/dashboard.d.ts +8 -0
  28. package/dist/cli/dashboard.d.ts.map +1 -0
  29. package/dist/cli/dashboard.js +704 -0
  30. package/dist/cli/dashboard.js.map +1 -0
  31. package/dist/cli/deploy.d.ts +19 -0
  32. package/dist/cli/deploy.d.ts.map +1 -0
  33. package/dist/cli/deploy.js +267 -0
  34. package/dist/cli/deploy.js.map +1 -0
  35. package/dist/cli/droids.d.ts +9 -0
  36. package/dist/cli/droids.d.ts.map +1 -0
  37. package/dist/cli/droids.js +227 -0
  38. package/dist/cli/droids.js.map +1 -0
  39. package/dist/cli/generate.d.ts +17 -0
  40. package/dist/cli/generate.d.ts.map +1 -0
  41. package/dist/cli/generate.js +432 -0
  42. package/dist/cli/generate.js.map +1 -0
  43. package/dist/cli/hooks.d.ts +9 -0
  44. package/dist/cli/hooks.d.ts.map +1 -0
  45. package/dist/cli/hooks.js +374 -0
  46. package/dist/cli/hooks.js.map +1 -0
  47. package/dist/cli/init.d.ts +11 -0
  48. package/dist/cli/init.d.ts.map +1 -0
  49. package/dist/cli/init.js +316 -0
  50. package/dist/cli/init.js.map +1 -0
  51. package/dist/cli/mcp-router.d.ts +16 -0
  52. package/dist/cli/mcp-router.d.ts.map +1 -0
  53. package/dist/cli/mcp-router.js +143 -0
  54. package/dist/cli/mcp-router.js.map +1 -0
  55. package/dist/cli/memory.d.ts +24 -0
  56. package/dist/cli/memory.d.ts.map +1 -0
  57. package/dist/cli/memory.js +877 -0
  58. package/dist/cli/memory.js.map +1 -0
  59. package/dist/cli/model.d.ts +15 -0
  60. package/dist/cli/model.d.ts.map +1 -0
  61. package/dist/cli/model.js +270 -0
  62. package/dist/cli/model.js.map +1 -0
  63. package/dist/cli/patterns.d.ts +26 -0
  64. package/dist/cli/patterns.d.ts.map +1 -0
  65. package/dist/cli/patterns.js +587 -0
  66. package/dist/cli/patterns.js.map +1 -0
  67. package/dist/cli/setup-mcp-router.d.ts +8 -0
  68. package/dist/cli/setup-mcp-router.d.ts.map +1 -0
  69. package/dist/cli/setup-mcp-router.js +163 -0
  70. package/dist/cli/setup-mcp-router.js.map +1 -0
  71. package/dist/cli/setup.d.ts +13 -0
  72. package/dist/cli/setup.d.ts.map +1 -0
  73. package/dist/cli/setup.js +146 -0
  74. package/dist/cli/setup.js.map +1 -0
  75. package/dist/cli/sync.d.ts +7 -0
  76. package/dist/cli/sync.d.ts.map +1 -0
  77. package/dist/cli/sync.js +26 -0
  78. package/dist/cli/sync.js.map +1 -0
  79. package/dist/cli/task.d.ts +33 -0
  80. package/dist/cli/task.d.ts.map +1 -0
  81. package/dist/cli/task.js +616 -0
  82. package/dist/cli/task.js.map +1 -0
  83. package/dist/cli/tool-calls.d.ts +8 -0
  84. package/dist/cli/tool-calls.d.ts.map +1 -0
  85. package/dist/cli/tool-calls.js +239 -0
  86. package/dist/cli/tool-calls.js.map +1 -0
  87. package/dist/cli/update.d.ts +10 -0
  88. package/dist/cli/update.d.ts.map +1 -0
  89. package/dist/cli/update.js +300 -0
  90. package/dist/cli/update.js.map +1 -0
  91. package/dist/cli/visualize.d.ts +77 -0
  92. package/dist/cli/visualize.d.ts.map +1 -0
  93. package/dist/cli/visualize.js +287 -0
  94. package/dist/cli/visualize.js.map +1 -0
  95. package/dist/cli/worktree.d.ts +9 -0
  96. package/dist/cli/worktree.d.ts.map +1 -0
  97. package/dist/cli/worktree.js +175 -0
  98. package/dist/cli/worktree.js.map +1 -0
  99. package/dist/coordination/capability-router.d.ts +79 -0
  100. package/dist/coordination/capability-router.d.ts.map +1 -0
  101. package/dist/coordination/capability-router.js +324 -0
  102. package/dist/coordination/capability-router.js.map +1 -0
  103. package/dist/coordination/database.d.ts +13 -0
  104. package/dist/coordination/database.d.ts.map +1 -0
  105. package/dist/coordination/database.js +131 -0
  106. package/dist/coordination/database.js.map +1 -0
  107. package/dist/coordination/deploy-batcher.d.ts +101 -0
  108. package/dist/coordination/deploy-batcher.d.ts.map +1 -0
  109. package/dist/coordination/deploy-batcher.js +565 -0
  110. package/dist/coordination/deploy-batcher.js.map +1 -0
  111. package/dist/coordination/index.d.ts +5 -0
  112. package/dist/coordination/index.d.ts.map +1 -0
  113. package/dist/coordination/index.js +5 -0
  114. package/dist/coordination/index.js.map +1 -0
  115. package/dist/coordination/service.d.ts +81 -0
  116. package/dist/coordination/service.d.ts.map +1 -0
  117. package/dist/coordination/service.js +603 -0
  118. package/dist/coordination/service.js.map +1 -0
  119. package/dist/generators/claude-md.d.ts +3 -0
  120. package/dist/generators/claude-md.d.ts.map +1 -0
  121. package/dist/generators/claude-md.js +977 -0
  122. package/dist/generators/claude-md.js.map +1 -0
  123. package/dist/generators/template-loader.d.ts +105 -0
  124. package/dist/generators/template-loader.d.ts.map +1 -0
  125. package/dist/generators/template-loader.js +291 -0
  126. package/dist/generators/template-loader.js.map +1 -0
  127. package/dist/index.d.ts +47 -0
  128. package/dist/index.d.ts.map +1 -0
  129. package/dist/index.js +59 -0
  130. package/dist/index.js.map +1 -0
  131. package/dist/mcp-router/config/parser.d.ts +9 -0
  132. package/dist/mcp-router/config/parser.d.ts.map +1 -0
  133. package/dist/mcp-router/config/parser.js +174 -0
  134. package/dist/mcp-router/config/parser.js.map +1 -0
  135. package/dist/mcp-router/executor/client.d.ts +31 -0
  136. package/dist/mcp-router/executor/client.d.ts.map +1 -0
  137. package/dist/mcp-router/executor/client.js +187 -0
  138. package/dist/mcp-router/executor/client.js.map +1 -0
  139. package/dist/mcp-router/index.d.ts +22 -0
  140. package/dist/mcp-router/index.d.ts.map +1 -0
  141. package/dist/mcp-router/index.js +18 -0
  142. package/dist/mcp-router/index.js.map +1 -0
  143. package/dist/mcp-router/output-compressor.d.ts +26 -0
  144. package/dist/mcp-router/output-compressor.d.ts.map +1 -0
  145. package/dist/mcp-router/output-compressor.js +236 -0
  146. package/dist/mcp-router/output-compressor.js.map +1 -0
  147. package/dist/mcp-router/search/fuzzy.d.ts +26 -0
  148. package/dist/mcp-router/search/fuzzy.d.ts.map +1 -0
  149. package/dist/mcp-router/search/fuzzy.js +94 -0
  150. package/dist/mcp-router/search/fuzzy.js.map +1 -0
  151. package/dist/mcp-router/server.d.ts +50 -0
  152. package/dist/mcp-router/server.d.ts.map +1 -0
  153. package/dist/mcp-router/server.js +229 -0
  154. package/dist/mcp-router/server.js.map +1 -0
  155. package/dist/mcp-router/session-stats.d.ts +37 -0
  156. package/dist/mcp-router/session-stats.d.ts.map +1 -0
  157. package/dist/mcp-router/session-stats.js +56 -0
  158. package/dist/mcp-router/session-stats.js.map +1 -0
  159. package/dist/mcp-router/tools/discover.d.ts +37 -0
  160. package/dist/mcp-router/tools/discover.d.ts.map +1 -0
  161. package/dist/mcp-router/tools/discover.js +65 -0
  162. package/dist/mcp-router/tools/discover.js.map +1 -0
  163. package/dist/mcp-router/tools/execute.d.ts +43 -0
  164. package/dist/mcp-router/tools/execute.d.ts.map +1 -0
  165. package/dist/mcp-router/tools/execute.js +103 -0
  166. package/dist/mcp-router/tools/execute.js.map +1 -0
  167. package/dist/mcp-router/types.d.ts +62 -0
  168. package/dist/mcp-router/types.d.ts.map +1 -0
  169. package/dist/mcp-router/types.js +6 -0
  170. package/dist/mcp-router/types.js.map +1 -0
  171. package/dist/memory/adaptive-context.d.ts +146 -0
  172. package/dist/memory/adaptive-context.d.ts.map +1 -0
  173. package/dist/memory/adaptive-context.js +1022 -0
  174. package/dist/memory/adaptive-context.js.map +1 -0
  175. package/dist/memory/agent-scoped-memory.d.ts +67 -0
  176. package/dist/memory/agent-scoped-memory.d.ts.map +1 -0
  177. package/dist/memory/agent-scoped-memory.js +126 -0
  178. package/dist/memory/agent-scoped-memory.js.map +1 -0
  179. package/dist/memory/backends/base.d.ts +18 -0
  180. package/dist/memory/backends/base.d.ts.map +1 -0
  181. package/dist/memory/backends/base.js +2 -0
  182. package/dist/memory/backends/base.js.map +1 -0
  183. package/dist/memory/backends/factory.d.ts +4 -0
  184. package/dist/memory/backends/factory.d.ts.map +1 -0
  185. package/dist/memory/backends/factory.js +53 -0
  186. package/dist/memory/backends/factory.js.map +1 -0
  187. package/dist/memory/backends/github.d.ts +22 -0
  188. package/dist/memory/backends/github.d.ts.map +1 -0
  189. package/dist/memory/backends/github.js +118 -0
  190. package/dist/memory/backends/github.js.map +1 -0
  191. package/dist/memory/backends/qdrant-cloud.d.ts +32 -0
  192. package/dist/memory/backends/qdrant-cloud.d.ts.map +1 -0
  193. package/dist/memory/backends/qdrant-cloud.js +168 -0
  194. package/dist/memory/backends/qdrant-cloud.js.map +1 -0
  195. package/dist/memory/context-compressor.d.ts +74 -0
  196. package/dist/memory/context-compressor.d.ts.map +1 -0
  197. package/dist/memory/context-compressor.js +289 -0
  198. package/dist/memory/context-compressor.js.map +1 -0
  199. package/dist/memory/correction-propagator.d.ts +44 -0
  200. package/dist/memory/correction-propagator.d.ts.map +1 -0
  201. package/dist/memory/correction-propagator.js +156 -0
  202. package/dist/memory/correction-propagator.js.map +1 -0
  203. package/dist/memory/daily-log.d.ts +67 -0
  204. package/dist/memory/daily-log.d.ts.map +1 -0
  205. package/dist/memory/daily-log.js +143 -0
  206. package/dist/memory/daily-log.js.map +1 -0
  207. package/dist/memory/dynamic-retrieval.d.ts +110 -0
  208. package/dist/memory/dynamic-retrieval.d.ts.map +1 -0
  209. package/dist/memory/dynamic-retrieval.js +688 -0
  210. package/dist/memory/dynamic-retrieval.js.map +1 -0
  211. package/dist/memory/embeddings.d.ts +116 -0
  212. package/dist/memory/embeddings.d.ts.map +1 -0
  213. package/dist/memory/embeddings.js +461 -0
  214. package/dist/memory/embeddings.js.map +1 -0
  215. package/dist/memory/hierarchical-memory.d.ts +141 -0
  216. package/dist/memory/hierarchical-memory.d.ts.map +1 -0
  217. package/dist/memory/hierarchical-memory.js +477 -0
  218. package/dist/memory/hierarchical-memory.js.map +1 -0
  219. package/dist/memory/memory-consolidator.d.ts +124 -0
  220. package/dist/memory/memory-consolidator.d.ts.map +1 -0
  221. package/dist/memory/memory-consolidator.js +514 -0
  222. package/dist/memory/memory-consolidator.js.map +1 -0
  223. package/dist/memory/memory-maintenance.d.ts +39 -0
  224. package/dist/memory/memory-maintenance.d.ts.map +1 -0
  225. package/dist/memory/memory-maintenance.js +305 -0
  226. package/dist/memory/memory-maintenance.js.map +1 -0
  227. package/dist/memory/model-router.d.ts +102 -0
  228. package/dist/memory/model-router.d.ts.map +1 -0
  229. package/dist/memory/model-router.js +448 -0
  230. package/dist/memory/model-router.js.map +1 -0
  231. package/dist/memory/multi-view-memory.d.ts +134 -0
  232. package/dist/memory/multi-view-memory.d.ts.map +1 -0
  233. package/dist/memory/multi-view-memory.js +420 -0
  234. package/dist/memory/multi-view-memory.js.map +1 -0
  235. package/dist/memory/prepopulate.d.ts +76 -0
  236. package/dist/memory/prepopulate.d.ts.map +1 -0
  237. package/dist/memory/prepopulate.js +815 -0
  238. package/dist/memory/prepopulate.js.map +1 -0
  239. package/dist/memory/semantic-compression.d.ts +77 -0
  240. package/dist/memory/semantic-compression.d.ts.map +1 -0
  241. package/dist/memory/semantic-compression.js +348 -0
  242. package/dist/memory/semantic-compression.js.map +1 -0
  243. package/dist/memory/serverless-qdrant.d.ts +102 -0
  244. package/dist/memory/serverless-qdrant.d.ts.map +1 -0
  245. package/dist/memory/serverless-qdrant.js +369 -0
  246. package/dist/memory/serverless-qdrant.js.map +1 -0
  247. package/dist/memory/short-term/factory.d.ts +26 -0
  248. package/dist/memory/short-term/factory.d.ts.map +1 -0
  249. package/dist/memory/short-term/factory.js +28 -0
  250. package/dist/memory/short-term/factory.js.map +1 -0
  251. package/dist/memory/short-term/indexeddb.d.ts +25 -0
  252. package/dist/memory/short-term/indexeddb.d.ts.map +1 -0
  253. package/dist/memory/short-term/indexeddb.js +64 -0
  254. package/dist/memory/short-term/indexeddb.js.map +1 -0
  255. package/dist/memory/short-term/schema.d.ts +6 -0
  256. package/dist/memory/short-term/schema.d.ts.map +1 -0
  257. package/dist/memory/short-term/schema.js +119 -0
  258. package/dist/memory/short-term/schema.js.map +1 -0
  259. package/dist/memory/short-term/sqlite.d.ts +50 -0
  260. package/dist/memory/short-term/sqlite.d.ts.map +1 -0
  261. package/dist/memory/short-term/sqlite.js +221 -0
  262. package/dist/memory/short-term/sqlite.js.map +1 -0
  263. package/dist/memory/speculative-cache.d.ts +111 -0
  264. package/dist/memory/speculative-cache.d.ts.map +1 -0
  265. package/dist/memory/speculative-cache.js +409 -0
  266. package/dist/memory/speculative-cache.js.map +1 -0
  267. package/dist/memory/task-classifier.d.ts +34 -0
  268. package/dist/memory/task-classifier.d.ts.map +1 -0
  269. package/dist/memory/task-classifier.js +300 -0
  270. package/dist/memory/task-classifier.js.map +1 -0
  271. package/dist/memory/terminal-bench-knowledge.d.ts +48 -0
  272. package/dist/memory/terminal-bench-knowledge.d.ts.map +1 -0
  273. package/dist/memory/terminal-bench-knowledge.js +399 -0
  274. package/dist/memory/terminal-bench-knowledge.js.map +1 -0
  275. package/dist/memory/write-gate.d.ts +39 -0
  276. package/dist/memory/write-gate.d.ts.map +1 -0
  277. package/dist/memory/write-gate.js +190 -0
  278. package/dist/memory/write-gate.js.map +1 -0
  279. package/dist/models/executor.d.ts +130 -0
  280. package/dist/models/executor.d.ts.map +1 -0
  281. package/dist/models/executor.js +383 -0
  282. package/dist/models/executor.js.map +1 -0
  283. package/dist/models/index.d.ts +15 -0
  284. package/dist/models/index.d.ts.map +1 -0
  285. package/dist/models/index.js +17 -0
  286. package/dist/models/index.js.map +1 -0
  287. package/dist/models/planner.d.ts +71 -0
  288. package/dist/models/planner.d.ts.map +1 -0
  289. package/dist/models/planner.js +344 -0
  290. package/dist/models/planner.js.map +1 -0
  291. package/dist/models/router.d.ts +75 -0
  292. package/dist/models/router.d.ts.map +1 -0
  293. package/dist/models/router.js +344 -0
  294. package/dist/models/router.js.map +1 -0
  295. package/dist/models/types.d.ts +370 -0
  296. package/dist/models/types.d.ts.map +1 -0
  297. package/dist/models/types.js +181 -0
  298. package/dist/models/types.js.map +1 -0
  299. package/dist/tasks/coordination.d.ts +74 -0
  300. package/dist/tasks/coordination.d.ts.map +1 -0
  301. package/dist/tasks/coordination.js +237 -0
  302. package/dist/tasks/coordination.js.map +1 -0
  303. package/dist/tasks/database.d.ts +14 -0
  304. package/dist/tasks/database.d.ts.map +1 -0
  305. package/dist/tasks/database.js +128 -0
  306. package/dist/tasks/database.js.map +1 -0
  307. package/dist/tasks/index.d.ts +5 -0
  308. package/dist/tasks/index.d.ts.map +1 -0
  309. package/dist/tasks/index.js +5 -0
  310. package/dist/tasks/index.js.map +1 -0
  311. package/dist/tasks/service.d.ts +39 -0
  312. package/dist/tasks/service.d.ts.map +1 -0
  313. package/dist/tasks/service.js +582 -0
  314. package/dist/tasks/service.js.map +1 -0
  315. package/dist/tasks/types.d.ts +224 -0
  316. package/dist/tasks/types.d.ts.map +1 -0
  317. package/dist/tasks/types.js +64 -0
  318. package/dist/tasks/types.js.map +1 -0
  319. package/dist/types/analysis.d.ts +82 -0
  320. package/dist/types/analysis.d.ts.map +1 -0
  321. package/dist/types/analysis.js +2 -0
  322. package/dist/types/analysis.js.map +1 -0
  323. package/dist/types/config.d.ts +3023 -0
  324. package/dist/types/config.d.ts.map +1 -0
  325. package/dist/types/config.js +292 -0
  326. package/dist/types/config.js.map +1 -0
  327. package/dist/types/coordination.d.ts +240 -0
  328. package/dist/types/coordination.d.ts.map +1 -0
  329. package/dist/types/coordination.js +43 -0
  330. package/dist/types/coordination.js.map +1 -0
  331. package/dist/types/index.d.ts +4 -0
  332. package/dist/types/index.d.ts.map +1 -0
  333. package/dist/types/index.js +4 -0
  334. package/dist/types/index.js.map +1 -0
  335. package/dist/utils/calculate-average.d.ts +15 -0
  336. package/dist/utils/calculate-average.d.ts.map +1 -0
  337. package/dist/utils/calculate-average.js +21 -0
  338. package/dist/utils/calculate-average.js.map +1 -0
  339. package/dist/utils/config-manager.d.ts +30 -0
  340. package/dist/utils/config-manager.d.ts.map +1 -0
  341. package/dist/utils/config-manager.js +41 -0
  342. package/dist/utils/config-manager.js.map +1 -0
  343. package/dist/utils/dijkstra.d.ts +17 -0
  344. package/dist/utils/dijkstra.d.ts.map +1 -0
  345. package/dist/utils/dijkstra.js +91 -0
  346. package/dist/utils/dijkstra.js.map +1 -0
  347. package/dist/utils/fetch-with-retry.d.ts +5 -0
  348. package/dist/utils/fetch-with-retry.d.ts.map +1 -0
  349. package/dist/utils/fetch-with-retry.js +61 -0
  350. package/dist/utils/fetch-with-retry.js.map +1 -0
  351. package/dist/utils/merge-claude-md.d.ts +28 -0
  352. package/dist/utils/merge-claude-md.d.ts.map +1 -0
  353. package/dist/utils/merge-claude-md.js +342 -0
  354. package/dist/utils/merge-claude-md.js.map +1 -0
  355. package/dist/utils/order-processor-refactored.d.ts +126 -0
  356. package/dist/utils/order-processor-refactored.d.ts.map +1 -0
  357. package/dist/utils/order-processor-refactored.js +165 -0
  358. package/dist/utils/order-processor-refactored.js.map +1 -0
  359. package/dist/utils/order-processor-strategy.d.ts +72 -0
  360. package/dist/utils/order-processor-strategy.d.ts.map +1 -0
  361. package/dist/utils/order-processor-strategy.js +158 -0
  362. package/dist/utils/order-processor-strategy.js.map +1 -0
  363. package/dist/utils/order-processor.d.ts +242 -0
  364. package/dist/utils/order-processor.d.ts.map +1 -0
  365. package/dist/utils/order-processor.js +370 -0
  366. package/dist/utils/order-processor.js.map +1 -0
  367. package/dist/utils/rate-limiter-simple.d.ts +58 -0
  368. package/dist/utils/rate-limiter-simple.d.ts.map +1 -0
  369. package/dist/utils/rate-limiter-simple.js +100 -0
  370. package/dist/utils/rate-limiter-simple.js.map +1 -0
  371. package/dist/utils/rate-limiter.d.ts +62 -0
  372. package/dist/utils/rate-limiter.d.ts.map +1 -0
  373. package/dist/utils/rate-limiter.js +150 -0
  374. package/dist/utils/rate-limiter.js.map +1 -0
  375. package/dist/utils/string-similarity.d.ts +37 -0
  376. package/dist/utils/string-similarity.d.ts.map +1 -0
  377. package/dist/utils/string-similarity.js +114 -0
  378. package/dist/utils/string-similarity.js.map +1 -0
  379. package/dist/utils/validate-json.d.ts +51 -0
  380. package/dist/utils/validate-json.d.ts.map +1 -0
  381. package/dist/utils/validate-json.js +99 -0
  382. package/dist/utils/validate-json.js.map +1 -0
  383. package/package.json +96 -0
  384. package/templates/CLAUDE.template.md +11 -0
  385. package/templates/CLAUDE_ARCHITECTURE.template.md +103 -0
  386. package/templates/CLAUDE_CODING.template.md +125 -0
  387. package/templates/CLAUDE_DROIDS.template.md +109 -0
  388. package/templates/CLAUDE_MEMORY.template.md +130 -0
  389. package/templates/CLAUDE_WORKFLOWS.template.md +136 -0
  390. package/templates/PROJECT.template.md +209 -0
  391. package/templates/SCHEMA.md +57 -0
  392. package/templates/archive/CLAUDE.template.root-v6.md +762 -0
  393. package/templates/archive/CLAUDE.template.v6.md +762 -0
  394. package/templates/hooks/pre-compact.sh +68 -0
  395. package/templates/hooks/session-start.sh +106 -0
  396. package/tools/agents/README.md +224 -0
  397. package/tools/agents/UAP/README.md +351 -0
  398. package/tools/agents/UAP/__init__.py +9 -0
  399. package/tools/agents/UAP/cli.py +675 -0
  400. package/tools/agents/UAP/version.py +2 -0
  401. package/tools/agents/benchmarks/benchmark_memory_systems.py +637 -0
  402. package/tools/agents/benchmarks/results/benchmark_20260106_064817.json +170 -0
  403. package/tools/agents/benchmarks/results/benchmark_20260106_064817.md +51 -0
  404. package/tools/agents/config/chat_template.jinja +172 -0
  405. package/tools/agents/docker-compose.qdrant.yml +24 -0
  406. package/tools/agents/migrations/apply.py +256 -0
  407. package/tools/agents/scripts/fix_qwen_chat_template.py +314 -0
  408. package/tools/agents/scripts/init_qdrant.py +151 -0
  409. package/tools/agents/scripts/memory_migration.py +518 -0
  410. package/tools/agents/scripts/migrate_memory_to_qdrant.py +113 -0
  411. package/tools/agents/scripts/query_memory.py +189 -0
  412. package/tools/agents/scripts/qwen_tool_call_test.py +419 -0
  413. package/tools/agents/scripts/qwen_tool_call_wrapper.py +517 -0
  414. package/tools/agents/scripts/start-services.sh +96 -0
  415. package/tools/agents/tests/test_uap_compliance.py +257 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Dammian Miller
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,462 @@
1
+ # Universal Agent Protocol (UAP)
2
+
3
+ [![npm version](https://img.shields.io/npm/v/universal-agent-protocol.svg)](https://www.npmjs.com/package/universal-agent-protocol)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ <div align="center">
7
+
8
+ ### AI agents that learn and remember
9
+
10
+ **Every lesson, every pattern, every memory preserved across sessions.**
11
+
12
+ _Not just in one conversation—but forever._
13
+
14
+ </div>
15
+
16
+ ---
17
+
18
+ ## Quick Start (30 seconds)
19
+
20
+ ```bash
21
+ # Install
22
+ npm install -g universal-agent-protocol
23
+
24
+ # Run complete setup (installs dependencies, git hooks, etc.)
25
+ npm run setup
26
+
27
+ # Initialize in your project
28
+ uap init
29
+ ```
30
+
31
+ That's it. Your AI now has persistent memory and follows proven workflows.
32
+
33
+ ---
34
+
35
+ ## Complete Setup
36
+
37
+ For a full installation with all features:
38
+
39
+ ```bash
40
+ # Install UAP CLI
41
+ npm install -g universal-agent-protocol
42
+
43
+ # Run comprehensive setup
44
+ npm run setup
45
+ # This will:
46
+ # ✓ Check and install dependencies
47
+ # ✓ Install npm packages
48
+ # ✓ Build TypeScript
49
+ # ✓ Configure git hooks (pre-commit, commit-msg, pre-push)
50
+ # ✓ Set up GitHub PR templates
51
+ ```
52
+
53
+ ### Requirements
54
+
55
+ **Required:**
56
+
57
+ - Node.js >= 18.0.0
58
+ - npm
59
+ - git
60
+ - npx
61
+
62
+ **Optional (recommended):**
63
+
64
+ - Docker - for local Qdrant semantic search
65
+ - Python 3 - for Pattern RAG indexing
66
+ - pre-commit - for advanced git hooks
67
+
68
+ ### Installing Dependencies
69
+
70
+ **macOS:**
71
+
72
+ ```bash
73
+ brew install node git python docker
74
+ ```
75
+
76
+ **Ubuntu/Debian:**
77
+
78
+ ```bash
79
+ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
80
+ sudo apt-get install -y nodejs python3 docker.io
81
+ ```
82
+
83
+ **Windows:**
84
+
85
+ ```powershell
86
+ winget install OpenJS.NodeJS.LTS
87
+ winget install Git.Git
88
+ winget install Python.Python.3.12
89
+ winget install Docker.DockerDesktop
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Recommended Platform: **opencode**
95
+
96
+ UAP is optimized for **[opencode](https://opencode.ai)** - the local AI coding platform that provides:
97
+
98
+ - **Persistent sessions** - Memory survives across sessions
99
+ - **Plugin architecture** - Pattern RAG, session hooks, and more
100
+ - **Local LLM support** - Run Qwen3.5 35B locally via llama.cpp
101
+ - **Built-in tooling** - File operations, bash, search, todo management
102
+
103
+ ### Setup opencode (Recommended)
104
+
105
+ ```bash
106
+ # Install opencode
107
+ npm install -g opencode
108
+
109
+ # Configure local LLM (optional, requires llama.cpp server)
110
+ # See: https://opencode.ai/docs/configuration
111
+
112
+ # Initialize UAP in your project
113
+ cd your-project
114
+ uap init
115
+ ```
116
+
117
+ The `opencode.json` configuration file automatically loads UAP plugins for:
118
+
119
+ - **Pattern RAG** - Context-aware pattern injection (~12K tokens saved)
120
+ - **Session hooks** - Pre-execution setup, memory preservation
121
+ - **Agent coordination** - Multi-agent workflows without conflicts
122
+
123
+ ### Other Supported Platforms
124
+
125
+ | Platform | Notes |
126
+ | --------------- | --------------------------------------- |
127
+ | **Factory.AI** | Works well, use `CLAUDE.md` for context |
128
+ | **Claude Code** | Desktop app, full UAP support |
129
+ | **VSCode** | Use with Claude Code extension |
130
+ | **claude.ai** | Web version, limited tooling |
131
+
132
+ ---
133
+
134
+ ## What UAP Gives You
135
+
136
+ ### 🧠 Persistent Memory
137
+
138
+ Your AI never forgets:
139
+
140
+ ```bash
141
+ # Store a lesson
142
+ uap memory store "Always validate CSRF tokens in auth flows"
143
+
144
+ # Query later (any agent, any session)
145
+ uap memory query "auth security"
146
+ ```
147
+
148
+ Memory persists in SQLite databases that travel with your code:
149
+
150
+ - `agents/data/memory/short_term.db` - Recent actions + session memories
151
+ - Semantic search via Qdrant (optional, `uap memory start`)
152
+
153
+ ### 🎯 Pattern Router
154
+
155
+ Before every task, UAP auto-selects relevant patterns:
156
+
157
+ ```
158
+ === PATTERN ROUTER ===
159
+ Task: Fix authentication bug
160
+ Classification: bug-fix
161
+ ACTIVE: P3, P12, P17
162
+ BLOCKING: [none]
163
+ === END ===
164
+ ```
165
+
166
+ **58 battle-tested patterns** from Terminal-Bench 2.0 analysis:
167
+
168
+ - **P12** - Verify outputs exist (fixes 37% of failures)
169
+ - **P17** - Extract hidden constraints ("exactly", "only", "single")
170
+ - **P3** - Backup before destructive actions
171
+ - **P20** - Attack mindset for security tasks
172
+
173
+ ### 🛡️ Completion Gates
174
+
175
+ Three mandatory checks before "done":
176
+
177
+ 1. **Output Existence** - All expected files exist
178
+ 2. **Constraint Compliance** - All requirements verified
179
+ 3. **Tests Pass** - `npm test` 100%
180
+
181
+ ### 🌳 Safe Worktrees
182
+
183
+ No more accidental commits to main:
184
+
185
+ ```bash
186
+ uap worktree create my-feature
187
+ # → Creates isolated branch in .worktrees/
188
+ # → All changes tracked
189
+ uap worktree pr <id>
190
+ # → Creates PR, triggers reviews
191
+ uap worktree cleanup <id>
192
+ # → Clean removal after merge
193
+ ```
194
+
195
+ ### 🤖 Expert Droids
196
+
197
+ Tasks automatically route to specialists:
198
+
199
+ | Task Type | Routed To |
200
+ | --------------- | ------------------------ |
201
+ | TypeScript/JS | `typescript-node-expert` |
202
+ | Security review | `security-auditor` |
203
+ | Performance | `performance-optimizer` |
204
+ | Documentation | `documentation-expert` |
205
+
206
+ ---
207
+
208
+ ## How It Works
209
+
210
+ 1. **Install & init** - `npm i -g universal-agent-protocol && uap init`
211
+ 2. **CLAUDE.md generated** - Auto-populated with project structure, commands, patterns
212
+ 3. **AI reads CLAUDE.md** - Follows embedded workflows automatically
213
+ 4. **Every task**:
214
+ - Pattern Router classifies task and selects patterns
215
+ - Adaptive context loads relevant memory
216
+ - Agent coordination checks for conflicts
217
+ - Worktree created for isolated changes
218
+ - Completion gates verify outputs, constraints, tests
219
+ - Learnings stored in memory
220
+
221
+ ---
222
+
223
+ ## Commands
224
+
225
+ ### Essential
226
+
227
+ | Command | Description |
228
+ | -------------- | ------------------------------------------------ |
229
+ | `uap init` | Initialize/update UAP (never loses data) |
230
+ | `uap generate` | Regenerate CLAUDE.md from project analysis |
231
+ | `uap update` | Update templates while preserving customizations |
232
+
233
+ ### Memory
234
+
235
+ | Command | Description |
236
+ | ---------------------------- | -------------------------------- |
237
+ | `uap memory status` | Check memory system status |
238
+ | `uap memory query <search>` | Search memories |
239
+ | `uap memory store <content>` | Store a learning |
240
+ | `uap memory start` | Start Qdrant for semantic search |
241
+
242
+ ### Tasks
243
+
244
+ | Command | Description |
245
+ | ----------------------- | -------------------------------------- |
246
+ | `uap task create` | Create tracked task |
247
+ | `uap task list` | List all tasks |
248
+ | `uap task claim <id>` | Claim task (announces to other agents) |
249
+ | `uap task release <id>` | Complete task |
250
+
251
+ ### Worktrees
252
+
253
+ | Command | Description |
254
+ | ---------------------------- | ----------------------- |
255
+ | `uap worktree create <name>` | Create isolated branch |
256
+ | `uap worktree pr <id>` | Create PR from worktree |
257
+ | `uap worktree cleanup <id>` | Remove worktree |
258
+
259
+ ### Droids
260
+
261
+ | Command | Description |
262
+ | ----------------------- | ---------------------------- |
263
+ | `uap droids list` | List available expert droids |
264
+ | `uap droids add <name>` | Create new expert droid |
265
+
266
+ ---
267
+
268
+ ## Architecture
269
+
270
+ ### 4-Layer Memory System
271
+
272
+ ```
273
+ ┌─────────────────────────────────────────────────────────────────┐
274
+ │ L1: WORKING │ Recent actions │ 50 max │ SQLite │
275
+ │ L2: SESSION │ Current session │ Per run │ SQLite │
276
+ │ L3: SEMANTIC │ Long-term learnings │ Qdrant │ Vectors │
277
+ │ L4: KNOWLEDGE │ Entity relationships │ SQLite │ Graph │
278
+ └─────────────────────────────────────────────────────────────────┘
279
+ ```
280
+
281
+ ### Hierarchical Memory (Hot/Warm/Cold)
282
+
283
+ - **HOT** (10 entries) - In-context, always included → <1ms access
284
+ - **WARM** (50 entries) - Cached, promoted on access → <5ms access
285
+ - **COLD** (500 entries) - Archived, semantic search → ~50ms access
286
+
287
+ ### Pattern RAG
288
+
289
+ Dynamically retrieves relevant patterns from Qdrant:
290
+
291
+ - Queries `agent_patterns` collection
292
+ - Injects ~2 patterns per task (saves ~12K tokens)
293
+ - Filters by similarity score (default 0.35)
294
+ - Avoids duplicate injections per session
295
+
296
+ ---
297
+
298
+ ## Configuration
299
+
300
+ ### opencode.json (Platform-specific)
301
+
302
+ ```json
303
+ {
304
+ "$schema": "https://opencode.ai/config.json",
305
+ "provider": {
306
+ "llama.cpp": {
307
+ "name": "llama-server (local)",
308
+ "options": {
309
+ "baseURL": "http://localhost:8080/v1",
310
+ "apiKey": "sk-qwen35b"
311
+ },
312
+ "models": {
313
+ "qwen35-a3b-iq4xs": {
314
+ "name": "Qwen3.5 35B A3B (IQ4_XS)",
315
+ "limit": {
316
+ "context": 262144,
317
+ "output": 16384
318
+ }
319
+ }
320
+ }
321
+ }
322
+ },
323
+ "model": "llama.cpp/qwen35-a3b-iq4xs"
324
+ }
325
+ ```
326
+
327
+ ### .uap.json (Project-specific)
328
+
329
+ ```json
330
+ {
331
+ "project": {
332
+ "name": "my-project",
333
+ "defaultBranch": "main"
334
+ },
335
+ "memory": {
336
+ "shortTerm": { "enabled": true, "path": "./agents/data/memory/short_term.db" },
337
+ "longTerm": { "enabled": true, "provider": "qdrant" }
338
+ },
339
+ "worktrees": {
340
+ "enabled": true,
341
+ "directory": ".worktrees"
342
+ }
343
+ }
344
+ ```
345
+
346
+ ---
347
+
348
+ ## Requirements
349
+
350
+ ### Required Dependencies
351
+
352
+ | Dependency | Version | Purpose |
353
+ | ---------- | ----------------- | --------------------------- |
354
+ | Node.js | >= 18.0.0 | Runtime environment |
355
+ | npm | Latest | Package manager |
356
+ | git | Latest | Version control (git hooks) |
357
+ | npx | Included with npm | Run CLI tools |
358
+
359
+ ### Optional Dependencies
360
+
361
+ | Dependency | Purpose | Installation |
362
+ | ---------- | -------------------------------- | ---------------------------------------------- |
363
+ | Docker | Local Qdrant for semantic search | [get.docker.com](https://get.docker.com) |
364
+ | Python 3 | Pattern RAG indexing | `brew install python` or `apt install python3` |
365
+ | pre-commit | Advanced git hooks | `pip install pre-commit` |
366
+
367
+ ### Platform-Specific Setup
368
+
369
+ **macOS:**
370
+
371
+ ```bash
372
+ brew install node@18 git python docker
373
+ ```
374
+
375
+ **Ubuntu/Debian:**
376
+
377
+ ```bash
378
+ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
379
+ sudo apt-get install -y nodejs python3 docker.io
380
+ ```
381
+
382
+ **Windows (PowerShell):**
383
+
384
+ ```powershell
385
+ winget install OpenJS.NodeJS.LTS
386
+ winget install Git.Git
387
+ winget install Python.Python.3.12
388
+ winget install Docker.DockerDesktop
389
+ ```
390
+
391
+ ---
392
+
393
+ ## Testing & Quality
394
+
395
+ ```bash
396
+ # Run tests
397
+ npm test
398
+
399
+ # Run linter
400
+ npm run lint
401
+
402
+ # Build TypeScript
403
+ npm run build
404
+ ```
405
+
406
+ ---
407
+
408
+ ## Documentation
409
+
410
+ ### Core CLAUDE.md Sections
411
+
412
+ | File | Purpose |
413
+ | ------------------------ | -------------------------------- |
414
+ | `CLAUDE_ARCHITECTURE.md` | Cluster topology, IaC rules |
415
+ | `CLAUDE_CODING.md` | Coding standards, security |
416
+ | `CLAUDE_WORKFLOWS.md` | Task workflows, completion gates |
417
+ | `CLAUDE_MEMORY.md` | Memory system, Pattern RAG |
418
+ | `CLAUDE_DROIDS.md` | Available droids/skills |
419
+
420
+ ### Deep Dive
421
+
422
+ | Document | Description |
423
+ | ---------------------------------------------------------------------- | -------------------------- |
424
+ | [`docs/UAP_OVERVIEW.md`](docs/UAP_OVERVIEW.md) | Full system architecture |
425
+ | [`docs/UAP_CLI_REFERENCE.md`](docs/UAP_CLI_REFERENCE.md) | Universal agent patterns |
426
+ | [`docs/BEHAVIORAL_PATTERNS.md`](docs/BEHAVIORAL_PATTERNS.md) | What works vs what doesn't |
427
+ | [`benchmark-results/`](benchmark-results/) | Terminal-Bench 2.0 results |
428
+
429
+ ---
430
+
431
+ ## What's Next
432
+
433
+ UAP v7.1.0 includes:
434
+
435
+ - ✅ **58 Optimizations** - Battle-tested from Terminal-Bench 2.0
436
+ - ✅ **Pattern Router** - Auto-selects optimal patterns per task
437
+ - ✅ **Completion Gates** - 3 mandatory checks before "done"
438
+ - ✅ **8 Expert Droids** - Specialized agents for common tasks
439
+ - ✅ **6 Skills** - Reusable capabilities (balls-mode, CLI design, etc.)
440
+ - ✅ **Pre-execution Hooks** - Task-specific setup before agent runs
441
+ - ✅ **Hierarchical Memory** - Hot/warm/cold tiering with auto-promotion
442
+ - ✅ **Pattern RAG** - Context-aware pattern injection (~12K tokens saved)
443
+ - ✅ **opencode Integration** - Plugin system for seamless integration
444
+ - ✅ **Model Router** - Per-model performance fingerprints
445
+
446
+ ---
447
+
448
+ ## Attribution
449
+
450
+ Code Field prompts based on research from [NeoVertex1/context-field](https://github.com/NeoVertex1/context-field).
451
+
452
+ Terminal-Bench patterns from [Terminal-Bench 2.0](https://github.com/aptx432/terminal-bench) benchmarking.
453
+
454
+ ---
455
+
456
+ <div align="center">
457
+
458
+ **[Documentation](docs/UAP_OVERVIEW.md)** · **[Issues](https://github.com/DammianMiller/universal-agent-protocol/issues)** · **[npm](https://www.npmjs.com/package/universal-agent-protocol)**
459
+
460
+ _Built for developers who want AI that learns._
461
+
462
+ </div>
@@ -0,0 +1,3 @@
1
+ import type { ProjectAnalysis } from '../types/index.js';
2
+ export declare function analyzeProject(cwd: string): Promise<ProjectAnalysis>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analyzers/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAgF1E"}