@soleri/core 2.12.0 → 8.0.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 (430) hide show
  1. package/data/flows/build.flow.yaml +128 -0
  2. package/data/flows/deliver.flow.yaml +110 -0
  3. package/data/flows/design.flow.yaml +108 -0
  4. package/data/flows/enhance.flow.yaml +90 -0
  5. package/data/flows/explore.flow.yaml +84 -0
  6. package/data/flows/fix.flow.yaml +90 -0
  7. package/data/flows/plan.flow.yaml +87 -0
  8. package/data/flows/review.flow.yaml +90 -0
  9. package/dist/agency/agency-manager.d.ts +27 -1
  10. package/dist/agency/agency-manager.d.ts.map +1 -1
  11. package/dist/agency/agency-manager.js +180 -9
  12. package/dist/agency/agency-manager.js.map +1 -1
  13. package/dist/agency/default-rules.d.ts +7 -0
  14. package/dist/agency/default-rules.d.ts.map +1 -0
  15. package/dist/agency/default-rules.js +79 -0
  16. package/dist/agency/default-rules.js.map +1 -0
  17. package/dist/agency/types.d.ts +48 -0
  18. package/dist/agency/types.d.ts.map +1 -1
  19. package/dist/brain/brain.d.ts +17 -2
  20. package/dist/brain/brain.d.ts.map +1 -1
  21. package/dist/brain/brain.js +118 -8
  22. package/dist/brain/brain.js.map +1 -1
  23. package/dist/brain/intelligence.d.ts.map +1 -1
  24. package/dist/brain/intelligence.js +16 -2
  25. package/dist/brain/intelligence.js.map +1 -1
  26. package/dist/brain/knowledge-synthesizer.d.ts +37 -0
  27. package/dist/brain/knowledge-synthesizer.d.ts.map +1 -0
  28. package/dist/brain/knowledge-synthesizer.js +161 -0
  29. package/dist/brain/knowledge-synthesizer.js.map +1 -0
  30. package/dist/brain/learning-radar.d.ts +96 -0
  31. package/dist/brain/learning-radar.d.ts.map +1 -0
  32. package/dist/brain/learning-radar.js +202 -0
  33. package/dist/brain/learning-radar.js.map +1 -0
  34. package/dist/brain/types.d.ts +15 -0
  35. package/dist/brain/types.d.ts.map +1 -1
  36. package/dist/capabilities/chain-mapping.d.ts +21 -0
  37. package/dist/capabilities/chain-mapping.d.ts.map +1 -0
  38. package/dist/capabilities/chain-mapping.js +86 -0
  39. package/dist/capabilities/chain-mapping.js.map +1 -0
  40. package/dist/capabilities/index.d.ts +10 -0
  41. package/dist/capabilities/index.d.ts.map +1 -0
  42. package/dist/capabilities/index.js +8 -0
  43. package/dist/capabilities/index.js.map +1 -0
  44. package/dist/capabilities/registry.d.ts +95 -0
  45. package/dist/capabilities/registry.d.ts.map +1 -0
  46. package/dist/capabilities/registry.js +227 -0
  47. package/dist/capabilities/registry.js.map +1 -0
  48. package/dist/capabilities/types.d.ts +106 -0
  49. package/dist/capabilities/types.d.ts.map +1 -0
  50. package/dist/capabilities/types.js +12 -0
  51. package/dist/capabilities/types.js.map +1 -0
  52. package/dist/context/context-engine.d.ts.map +1 -1
  53. package/dist/context/context-engine.js +82 -17
  54. package/dist/context/context-engine.js.map +1 -1
  55. package/dist/context/types.d.ts +5 -0
  56. package/dist/context/types.d.ts.map +1 -1
  57. package/dist/control/intent-router.d.ts +12 -1
  58. package/dist/control/intent-router.d.ts.map +1 -1
  59. package/dist/control/intent-router.js +126 -2
  60. package/dist/control/intent-router.js.map +1 -1
  61. package/dist/control/types.d.ts +17 -0
  62. package/dist/control/types.d.ts.map +1 -1
  63. package/dist/curator/classifier.d.ts +18 -0
  64. package/dist/curator/classifier.d.ts.map +1 -0
  65. package/dist/curator/classifier.js +61 -0
  66. package/dist/curator/classifier.js.map +1 -0
  67. package/dist/curator/quality-gate.d.ts +29 -0
  68. package/dist/curator/quality-gate.d.ts.map +1 -0
  69. package/dist/curator/quality-gate.js +88 -0
  70. package/dist/curator/quality-gate.js.map +1 -0
  71. package/dist/domain-packs/index.d.ts +8 -0
  72. package/dist/domain-packs/index.d.ts.map +1 -0
  73. package/dist/domain-packs/index.js +8 -0
  74. package/dist/domain-packs/index.js.map +1 -0
  75. package/dist/domain-packs/inject-rules.d.ts +24 -0
  76. package/dist/domain-packs/inject-rules.d.ts.map +1 -0
  77. package/dist/domain-packs/inject-rules.js +65 -0
  78. package/dist/domain-packs/inject-rules.js.map +1 -0
  79. package/dist/domain-packs/knowledge-installer.d.ts +27 -0
  80. package/dist/domain-packs/knowledge-installer.d.ts.map +1 -0
  81. package/dist/domain-packs/knowledge-installer.js +89 -0
  82. package/dist/domain-packs/knowledge-installer.js.map +1 -0
  83. package/dist/domain-packs/loader.d.ts +28 -0
  84. package/dist/domain-packs/loader.d.ts.map +1 -0
  85. package/dist/domain-packs/loader.js +105 -0
  86. package/dist/domain-packs/loader.js.map +1 -0
  87. package/dist/domain-packs/pack-runtime.d.ts +80 -0
  88. package/dist/domain-packs/pack-runtime.d.ts.map +1 -0
  89. package/dist/domain-packs/pack-runtime.js +36 -0
  90. package/dist/domain-packs/pack-runtime.js.map +1 -0
  91. package/dist/domain-packs/skills-installer.d.ts +21 -0
  92. package/dist/domain-packs/skills-installer.d.ts.map +1 -0
  93. package/dist/domain-packs/skills-installer.js +38 -0
  94. package/dist/domain-packs/skills-installer.js.map +1 -0
  95. package/dist/domain-packs/token-resolver.d.ts +37 -0
  96. package/dist/domain-packs/token-resolver.d.ts.map +1 -0
  97. package/dist/domain-packs/token-resolver.js +109 -0
  98. package/dist/domain-packs/token-resolver.js.map +1 -0
  99. package/dist/domain-packs/types.d.ts +91 -0
  100. package/dist/domain-packs/types.d.ts.map +1 -0
  101. package/dist/domain-packs/types.js +122 -0
  102. package/dist/domain-packs/types.js.map +1 -0
  103. package/dist/engine/bin/soleri-engine.d.ts +12 -0
  104. package/dist/engine/bin/soleri-engine.d.ts.map +1 -0
  105. package/dist/engine/bin/soleri-engine.js +184 -0
  106. package/dist/engine/bin/soleri-engine.js.map +1 -0
  107. package/dist/engine/core-ops.d.ts +27 -0
  108. package/dist/engine/core-ops.d.ts.map +1 -0
  109. package/dist/engine/core-ops.js +159 -0
  110. package/dist/engine/core-ops.js.map +1 -0
  111. package/dist/engine/index.d.ts +19 -0
  112. package/dist/engine/index.d.ts.map +1 -0
  113. package/dist/engine/index.js +17 -0
  114. package/dist/engine/index.js.map +1 -0
  115. package/dist/engine/register-engine.d.ts +54 -0
  116. package/dist/engine/register-engine.d.ts.map +1 -0
  117. package/dist/engine/register-engine.js +270 -0
  118. package/dist/engine/register-engine.js.map +1 -0
  119. package/dist/engine/test-helpers.d.ts +30 -0
  120. package/dist/engine/test-helpers.d.ts.map +1 -0
  121. package/dist/engine/test-helpers.js +59 -0
  122. package/dist/engine/test-helpers.js.map +1 -0
  123. package/dist/events/event-bus.d.ts +30 -0
  124. package/dist/events/event-bus.d.ts.map +1 -0
  125. package/dist/events/event-bus.js +51 -0
  126. package/dist/events/event-bus.js.map +1 -0
  127. package/dist/flows/chain-runner.d.ts +46 -0
  128. package/dist/flows/chain-runner.d.ts.map +1 -0
  129. package/dist/flows/chain-runner.js +271 -0
  130. package/dist/flows/chain-runner.js.map +1 -0
  131. package/dist/flows/chain-types.d.ts +103 -0
  132. package/dist/flows/chain-types.d.ts.map +1 -0
  133. package/dist/flows/chain-types.js +23 -0
  134. package/dist/flows/chain-types.js.map +1 -0
  135. package/dist/flows/context-router.d.ts +39 -0
  136. package/dist/flows/context-router.d.ts.map +1 -0
  137. package/dist/flows/context-router.js +206 -0
  138. package/dist/flows/context-router.js.map +1 -0
  139. package/dist/flows/dispatch-registry.d.ts +24 -0
  140. package/dist/flows/dispatch-registry.d.ts.map +1 -0
  141. package/dist/flows/dispatch-registry.js +70 -0
  142. package/dist/flows/dispatch-registry.js.map +1 -0
  143. package/dist/flows/epilogue.d.ts +24 -0
  144. package/dist/flows/epilogue.d.ts.map +1 -0
  145. package/dist/flows/epilogue.js +52 -0
  146. package/dist/flows/epilogue.js.map +1 -0
  147. package/dist/flows/executor.d.ts +25 -0
  148. package/dist/flows/executor.d.ts.map +1 -0
  149. package/dist/flows/executor.js +153 -0
  150. package/dist/flows/executor.js.map +1 -0
  151. package/dist/flows/gate-evaluator.d.ts +26 -0
  152. package/dist/flows/gate-evaluator.d.ts.map +1 -0
  153. package/dist/flows/gate-evaluator.js +162 -0
  154. package/dist/flows/gate-evaluator.js.map +1 -0
  155. package/dist/flows/index.d.ts +14 -0
  156. package/dist/flows/index.d.ts.map +1 -0
  157. package/dist/flows/index.js +20 -0
  158. package/dist/flows/index.js.map +1 -0
  159. package/dist/flows/loader.d.ts +17 -0
  160. package/dist/flows/loader.d.ts.map +1 -0
  161. package/dist/flows/loader.js +61 -0
  162. package/dist/flows/loader.js.map +1 -0
  163. package/dist/flows/plan-builder.d.ts +40 -0
  164. package/dist/flows/plan-builder.d.ts.map +1 -0
  165. package/dist/flows/plan-builder.js +213 -0
  166. package/dist/flows/plan-builder.js.map +1 -0
  167. package/dist/flows/probes.d.ts +11 -0
  168. package/dist/flows/probes.d.ts.map +1 -0
  169. package/dist/flows/probes.js +62 -0
  170. package/dist/flows/probes.js.map +1 -0
  171. package/dist/flows/types.d.ts +950 -0
  172. package/dist/flows/types.d.ts.map +1 -0
  173. package/dist/flows/types.js +105 -0
  174. package/dist/flows/types.js.map +1 -0
  175. package/dist/health/doctor-checks.d.ts +15 -0
  176. package/dist/health/doctor-checks.d.ts.map +1 -0
  177. package/dist/health/doctor-checks.js +98 -0
  178. package/dist/health/doctor-checks.js.map +1 -0
  179. package/dist/index.d.ts +11 -1
  180. package/dist/index.d.ts.map +1 -1
  181. package/dist/index.js +10 -1
  182. package/dist/index.js.map +1 -1
  183. package/dist/intake/text-ingester.d.ts +52 -0
  184. package/dist/intake/text-ingester.d.ts.map +1 -0
  185. package/dist/intake/text-ingester.js +181 -0
  186. package/dist/intake/text-ingester.js.map +1 -0
  187. package/dist/intelligence/loader.d.ts +19 -0
  188. package/dist/intelligence/loader.d.ts.map +1 -1
  189. package/dist/intelligence/loader.js +35 -0
  190. package/dist/intelligence/loader.js.map +1 -1
  191. package/dist/intelligence/types.d.ts +1 -0
  192. package/dist/intelligence/types.d.ts.map +1 -1
  193. package/dist/llm/llm-client.d.ts.map +1 -1
  194. package/dist/llm/llm-client.js +37 -1
  195. package/dist/llm/llm-client.js.map +1 -1
  196. package/dist/llm/oauth-discovery.d.ts +26 -0
  197. package/dist/llm/oauth-discovery.d.ts.map +1 -0
  198. package/dist/llm/oauth-discovery.js +149 -0
  199. package/dist/llm/oauth-discovery.js.map +1 -0
  200. package/dist/packs/types.d.ts +58 -19
  201. package/dist/packs/types.d.ts.map +1 -1
  202. package/dist/packs/types.js +14 -0
  203. package/dist/packs/types.js.map +1 -1
  204. package/dist/planning/evidence-collector.d.ts +41 -0
  205. package/dist/planning/evidence-collector.d.ts.map +1 -0
  206. package/dist/planning/evidence-collector.js +194 -0
  207. package/dist/planning/evidence-collector.js.map +1 -0
  208. package/dist/planning/planner.d.ts +4 -0
  209. package/dist/planning/planner.d.ts.map +1 -1
  210. package/dist/planning/planner.js +11 -0
  211. package/dist/planning/planner.js.map +1 -1
  212. package/dist/playbooks/generic/onboarding.d.ts +9 -0
  213. package/dist/playbooks/generic/onboarding.d.ts.map +1 -0
  214. package/dist/playbooks/generic/onboarding.js +74 -0
  215. package/dist/playbooks/generic/onboarding.js.map +1 -0
  216. package/dist/playbooks/playbook-registry.d.ts.map +1 -1
  217. package/dist/playbooks/playbook-registry.js +2 -0
  218. package/dist/playbooks/playbook-registry.js.map +1 -1
  219. package/dist/queue/job-queue.d.ts +92 -0
  220. package/dist/queue/job-queue.d.ts.map +1 -0
  221. package/dist/queue/job-queue.js +180 -0
  222. package/dist/queue/job-queue.js.map +1 -0
  223. package/dist/queue/pipeline-runner.d.ts +62 -0
  224. package/dist/queue/pipeline-runner.d.ts.map +1 -0
  225. package/dist/queue/pipeline-runner.js +126 -0
  226. package/dist/queue/pipeline-runner.js.map +1 -0
  227. package/dist/runtime/admin-extra-ops.d.ts.map +1 -1
  228. package/dist/runtime/admin-extra-ops.js +15 -9
  229. package/dist/runtime/admin-extra-ops.js.map +1 -1
  230. package/dist/runtime/admin-ops.js +4 -4
  231. package/dist/runtime/admin-ops.js.map +1 -1
  232. package/dist/runtime/admin-setup-ops.d.ts +20 -0
  233. package/dist/runtime/admin-setup-ops.d.ts.map +1 -0
  234. package/dist/runtime/admin-setup-ops.js +583 -0
  235. package/dist/runtime/admin-setup-ops.js.map +1 -0
  236. package/dist/runtime/capture-ops.d.ts.map +1 -1
  237. package/dist/runtime/capture-ops.js +33 -1
  238. package/dist/runtime/capture-ops.js.map +1 -1
  239. package/dist/runtime/chain-ops.d.ts +9 -0
  240. package/dist/runtime/chain-ops.d.ts.map +1 -0
  241. package/dist/runtime/chain-ops.js +107 -0
  242. package/dist/runtime/chain-ops.js.map +1 -0
  243. package/dist/runtime/claude-md-helpers.d.ts +65 -0
  244. package/dist/runtime/claude-md-helpers.d.ts.map +1 -0
  245. package/dist/runtime/claude-md-helpers.js +173 -0
  246. package/dist/runtime/claude-md-helpers.js.map +1 -0
  247. package/dist/runtime/curator-extra-ops.d.ts +3 -2
  248. package/dist/runtime/curator-extra-ops.d.ts.map +1 -1
  249. package/dist/runtime/curator-extra-ops.js +81 -3
  250. package/dist/runtime/curator-extra-ops.js.map +1 -1
  251. package/dist/runtime/domain-ops.d.ts +21 -5
  252. package/dist/runtime/domain-ops.d.ts.map +1 -1
  253. package/dist/runtime/domain-ops.js +64 -6
  254. package/dist/runtime/domain-ops.js.map +1 -1
  255. package/dist/runtime/facades/admin-facade.d.ts.map +1 -1
  256. package/dist/runtime/facades/admin-facade.js +4 -0
  257. package/dist/runtime/facades/admin-facade.js.map +1 -1
  258. package/dist/runtime/facades/agency-facade.d.ts.map +1 -1
  259. package/dist/runtime/facades/agency-facade.js +64 -0
  260. package/dist/runtime/facades/agency-facade.js.map +1 -1
  261. package/dist/runtime/facades/brain-facade.d.ts.map +1 -1
  262. package/dist/runtime/facades/brain-facade.js +122 -1
  263. package/dist/runtime/facades/brain-facade.js.map +1 -1
  264. package/dist/runtime/facades/cognee-facade.d.ts.map +1 -1
  265. package/dist/runtime/facades/cognee-facade.js +3 -1
  266. package/dist/runtime/facades/cognee-facade.js.map +1 -1
  267. package/dist/runtime/facades/control-facade.d.ts.map +1 -1
  268. package/dist/runtime/facades/control-facade.js +42 -0
  269. package/dist/runtime/facades/control-facade.js.map +1 -1
  270. package/dist/runtime/facades/index.d.ts.map +1 -1
  271. package/dist/runtime/facades/index.js +10 -6
  272. package/dist/runtime/facades/index.js.map +1 -1
  273. package/dist/runtime/facades/memory-facade.d.ts.map +1 -1
  274. package/dist/runtime/facades/memory-facade.js +20 -2
  275. package/dist/runtime/facades/memory-facade.js.map +1 -1
  276. package/dist/runtime/facades/plan-facade.d.ts.map +1 -1
  277. package/dist/runtime/facades/plan-facade.js +2 -0
  278. package/dist/runtime/facades/plan-facade.js.map +1 -1
  279. package/dist/runtime/facades/vault-facade.d.ts.map +1 -1
  280. package/dist/runtime/facades/vault-facade.js +27 -5
  281. package/dist/runtime/facades/vault-facade.js.map +1 -1
  282. package/dist/runtime/intake-ops.d.ts +7 -5
  283. package/dist/runtime/intake-ops.d.ts.map +1 -1
  284. package/dist/runtime/intake-ops.js +98 -5
  285. package/dist/runtime/intake-ops.js.map +1 -1
  286. package/dist/runtime/memory-extra-ops.d.ts +6 -3
  287. package/dist/runtime/memory-extra-ops.d.ts.map +1 -1
  288. package/dist/runtime/memory-extra-ops.js +292 -4
  289. package/dist/runtime/memory-extra-ops.js.map +1 -1
  290. package/dist/runtime/orchestrate-ops.d.ts +8 -7
  291. package/dist/runtime/orchestrate-ops.d.ts.map +1 -1
  292. package/dist/runtime/orchestrate-ops.js +217 -61
  293. package/dist/runtime/orchestrate-ops.js.map +1 -1
  294. package/dist/runtime/planning-extra-ops.d.ts.map +1 -1
  295. package/dist/runtime/planning-extra-ops.js +85 -0
  296. package/dist/runtime/planning-extra-ops.js.map +1 -1
  297. package/dist/runtime/playbook-ops.js +1 -1
  298. package/dist/runtime/playbook-ops.js.map +1 -1
  299. package/dist/runtime/runtime.d.ts.map +1 -1
  300. package/dist/runtime/runtime.js +165 -18
  301. package/dist/runtime/runtime.js.map +1 -1
  302. package/dist/runtime/session-briefing.d.ts +23 -0
  303. package/dist/runtime/session-briefing.d.ts.map +1 -0
  304. package/dist/runtime/session-briefing.js +140 -0
  305. package/dist/runtime/session-briefing.js.map +1 -0
  306. package/dist/runtime/types.d.ts +29 -2
  307. package/dist/runtime/types.d.ts.map +1 -1
  308. package/dist/runtime/vault-linking-ops.d.ts +13 -0
  309. package/dist/runtime/vault-linking-ops.d.ts.map +1 -0
  310. package/dist/runtime/vault-linking-ops.js +365 -0
  311. package/dist/runtime/vault-linking-ops.js.map +1 -0
  312. package/dist/vault/linking.d.ts +46 -0
  313. package/dist/vault/linking.d.ts.map +1 -0
  314. package/dist/vault/linking.js +275 -0
  315. package/dist/vault/linking.js.map +1 -0
  316. package/dist/vault/vault-types.d.ts +37 -0
  317. package/dist/vault/vault-types.d.ts.map +1 -1
  318. package/dist/vault/vault.d.ts +37 -0
  319. package/dist/vault/vault.d.ts.map +1 -1
  320. package/dist/vault/vault.js +152 -9
  321. package/dist/vault/vault.js.map +1 -1
  322. package/package.json +4 -1
  323. package/src/__tests__/admin-extra-ops.test.ts +1 -1
  324. package/src/__tests__/admin-ops.test.ts +2 -1
  325. package/src/__tests__/admin-setup-ops.test.ts +355 -0
  326. package/src/__tests__/async-infrastructure.test.ts +307 -0
  327. package/src/__tests__/cognee-client-gaps.test.ts +474 -0
  328. package/src/__tests__/cognee-hybrid-search.test.ts +492 -0
  329. package/src/__tests__/cognee-sync-manager-deep.test.ts +654 -0
  330. package/src/__tests__/cognee-sync-manager.test.ts +1 -0
  331. package/src/__tests__/core-ops.test.ts +9 -61
  332. package/src/__tests__/curator-extra-ops.test.ts +6 -2
  333. package/src/__tests__/curator-pipeline-e2e.test.ts +358 -0
  334. package/src/__tests__/domain-packs.test.ts +421 -0
  335. package/src/__tests__/flows.test.ts +604 -0
  336. package/src/__tests__/memory-extra-ops.test.ts +2 -2
  337. package/src/__tests__/planning-extra-ops.test.ts +2 -2
  338. package/src/__tests__/playbook-registry.test.ts +2 -2
  339. package/src/__tests__/playbook-seeder.test.ts +8 -8
  340. package/src/__tests__/playbook.test.ts +5 -5
  341. package/src/__tests__/second-brain-features.test.ts +583 -0
  342. package/src/__tests__/token-resolver.test.ts +79 -0
  343. package/src/agency/agency-manager.ts +217 -9
  344. package/src/agency/default-rules.ts +83 -0
  345. package/src/agency/types.ts +61 -0
  346. package/src/brain/brain.ts +110 -8
  347. package/src/brain/intelligence.ts +21 -2
  348. package/src/brain/knowledge-synthesizer.ts +218 -0
  349. package/src/brain/learning-radar.ts +340 -0
  350. package/src/brain/types.ts +16 -0
  351. package/src/capabilities/chain-mapping.ts +93 -0
  352. package/src/capabilities/index.ts +21 -0
  353. package/src/capabilities/registry.ts +290 -0
  354. package/src/capabilities/types.ts +143 -0
  355. package/src/context/context-engine.ts +114 -15
  356. package/src/context/types.ts +5 -0
  357. package/src/control/intent-router.ts +153 -2
  358. package/src/control/types.ts +10 -0
  359. package/src/curator/classifier.ts +88 -0
  360. package/src/curator/quality-gate.ts +129 -0
  361. package/src/domain-packs/index.ts +27 -0
  362. package/src/domain-packs/inject-rules.ts +74 -0
  363. package/src/domain-packs/knowledge-installer.ts +116 -0
  364. package/src/domain-packs/loader.ts +124 -0
  365. package/src/domain-packs/pack-runtime.ts +99 -0
  366. package/src/domain-packs/skills-installer.ts +56 -0
  367. package/src/domain-packs/token-resolver.ts +126 -0
  368. package/src/domain-packs/types.ts +229 -0
  369. package/src/engine/__tests__/register-engine.test.ts +104 -0
  370. package/src/engine/bin/soleri-engine.ts +218 -0
  371. package/src/engine/core-ops.ts +178 -0
  372. package/src/engine/index.ts +19 -0
  373. package/src/engine/register-engine.ts +385 -0
  374. package/src/engine/test-helpers.ts +83 -0
  375. package/src/events/event-bus.ts +58 -0
  376. package/src/flows/chain-runner.ts +369 -0
  377. package/src/flows/chain-types.ts +57 -0
  378. package/src/flows/context-router.ts +257 -0
  379. package/src/flows/dispatch-registry.ts +80 -0
  380. package/src/flows/epilogue.ts +65 -0
  381. package/src/flows/executor.ts +182 -0
  382. package/src/flows/gate-evaluator.ts +171 -0
  383. package/src/flows/index.ts +52 -0
  384. package/src/flows/loader.ts +63 -0
  385. package/src/flows/plan-builder.ts +250 -0
  386. package/src/flows/probes.ts +70 -0
  387. package/src/flows/types.ts +217 -0
  388. package/src/health/doctor-checks.ts +115 -0
  389. package/src/index.ts +68 -1
  390. package/src/intake/text-ingester.ts +234 -0
  391. package/src/intelligence/loader.ts +38 -0
  392. package/src/intelligence/types.ts +1 -0
  393. package/src/llm/llm-client.ts +38 -1
  394. package/src/llm/oauth-discovery.ts +169 -0
  395. package/src/packs/types.ts +19 -0
  396. package/src/planning/evidence-collector.ts +247 -0
  397. package/src/planning/planner.ts +11 -0
  398. package/src/playbooks/generic/onboarding.ts +79 -0
  399. package/src/playbooks/playbook-registry.ts +2 -0
  400. package/src/queue/job-queue.ts +281 -0
  401. package/src/queue/pipeline-runner.ts +149 -0
  402. package/src/runtime/admin-extra-ops.ts +14 -8
  403. package/src/runtime/admin-ops.ts +4 -4
  404. package/src/runtime/admin-setup-ops.ts +664 -0
  405. package/src/runtime/capture-ops.ts +40 -1
  406. package/src/runtime/chain-ops.ts +121 -0
  407. package/src/runtime/claude-md-helpers.ts +236 -0
  408. package/src/runtime/curator-extra-ops.ts +86 -3
  409. package/src/runtime/domain-ops.ts +71 -5
  410. package/src/runtime/facades/admin-facade.ts +4 -0
  411. package/src/runtime/facades/agency-facade.ts +68 -0
  412. package/src/runtime/facades/brain-facade.ts +142 -1
  413. package/src/runtime/facades/cognee-facade.ts +3 -1
  414. package/src/runtime/facades/control-facade.ts +45 -0
  415. package/src/runtime/facades/index.ts +12 -6
  416. package/src/runtime/facades/memory-facade.ts +20 -2
  417. package/src/runtime/facades/plan-facade.ts +2 -0
  418. package/src/runtime/facades/vault-facade.ts +30 -5
  419. package/src/runtime/intake-ops.ts +107 -5
  420. package/src/runtime/memory-extra-ops.ts +312 -4
  421. package/src/runtime/orchestrate-ops.ts +261 -65
  422. package/src/runtime/planning-extra-ops.ts +94 -0
  423. package/src/runtime/playbook-ops.ts +1 -1
  424. package/src/runtime/runtime.ts +164 -19
  425. package/src/runtime/session-briefing.ts +161 -0
  426. package/src/runtime/types.ts +29 -2
  427. package/src/runtime/vault-linking-ops.ts +452 -0
  428. package/src/vault/linking.ts +333 -0
  429. package/src/vault/vault-types.ts +46 -0
  430. package/src/vault/vault.ts +173 -11
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Tests for the direct engine registration (replaces facade factory).
3
+ *
4
+ * Validates that registerEngine() produces the same tools and behavior
5
+ * as the old createSemanticFacades() + registerAllFacades() pattern.
6
+ */
7
+
8
+ import { describe, it, expect, beforeAll, afterAll } from 'vitest';
9
+ import { createAgentRuntime } from '../../runtime/runtime.js';
10
+ import { captureOps, executeOp } from '../test-helpers.js';
11
+ import { createVaultFacadeOps } from '../../runtime/facades/vault-facade.js';
12
+ import { createBrainFacadeOps } from '../../runtime/facades/brain-facade.js';
13
+ import { createPlanFacadeOps } from '../../runtime/facades/plan-facade.js';
14
+ import { createCuratorFacadeOps } from '../../runtime/facades/curator-facade.js';
15
+ import { createLoopFacadeOps } from '../../runtime/facades/loop-facade.js';
16
+ import type { AgentRuntime } from '../../runtime/types.js';
17
+
18
+ let runtime: AgentRuntime;
19
+
20
+ beforeAll(() => {
21
+ runtime = createAgentRuntime({
22
+ agentId: 'test-engine',
23
+ vaultPath: ':memory:',
24
+ });
25
+ });
26
+
27
+ afterAll(() => {
28
+ runtime.close();
29
+ });
30
+
31
+ describe('Direct op execution (no facade factory)', () => {
32
+ it('vault ops work without facade dispatch', async () => {
33
+ const ops = captureOps(createVaultFacadeOps(runtime));
34
+
35
+ // Capture a pattern
36
+ const captureResult = await executeOp(ops, 'capture_enriched', {
37
+ projectPath: '.',
38
+ title: 'Test Pattern',
39
+ description: 'A test pattern for engine registration',
40
+ type: 'pattern',
41
+ category: 'testing',
42
+ severity: 'suggestion',
43
+ tags: ['test'],
44
+ });
45
+ expect(captureResult.success).toBe(true);
46
+
47
+ // Search for it
48
+ const searchResult = await executeOp(ops, 'search', {
49
+ query: 'test pattern engine',
50
+ });
51
+ expect(searchResult.success).toBe(true);
52
+ expect(searchResult.data).toBeDefined();
53
+ });
54
+
55
+ it('brain ops work without facade dispatch', async () => {
56
+ const ops = captureOps(createBrainFacadeOps(runtime));
57
+
58
+ const statsResult = await executeOp(ops, 'brain_stats', {});
59
+ expect(statsResult.success).toBe(true);
60
+ expect(statsResult.data).toBeDefined();
61
+ });
62
+
63
+ it('plan ops work without facade dispatch', async () => {
64
+ const ops = captureOps(createPlanFacadeOps(runtime));
65
+
66
+ const createResult = await executeOp(ops, 'create_plan', {
67
+ objective: 'Test objective',
68
+ scope: 'Test scope',
69
+ });
70
+ expect(createResult.success).toBe(true);
71
+ expect(createResult.data).toBeDefined();
72
+ });
73
+
74
+ it('curator ops work without facade dispatch', async () => {
75
+ const ops = captureOps(createCuratorFacadeOps(runtime));
76
+
77
+ const statusResult = await executeOp(ops, 'curator_status', {});
78
+ expect(statusResult.success).toBe(true);
79
+ });
80
+
81
+ it('loop ops work without facade dispatch', async () => {
82
+ const ops = captureOps(createLoopFacadeOps(runtime));
83
+
84
+ const statusResult = await executeOp(ops, 'loop_status', {});
85
+ expect(statusResult.success).toBe(true);
86
+ });
87
+
88
+ it('returns error for unknown ops', async () => {
89
+ const ops = captureOps(createVaultFacadeOps(runtime));
90
+
91
+ const result = await executeOp(ops, 'nonexistent_op', {});
92
+ expect(result.success).toBe(false);
93
+ expect(result.error).toContain('Unknown operation');
94
+ });
95
+
96
+ it('response envelope matches old format', async () => {
97
+ const ops = captureOps(createVaultFacadeOps(runtime));
98
+
99
+ const result = await executeOp(ops, 'vault_stats', {}, 'test_vault');
100
+ expect(result).toHaveProperty('success');
101
+ expect(result).toHaveProperty('op', 'vault_stats');
102
+ expect(result).toHaveProperty('facade', 'test_vault');
103
+ });
104
+ });
@@ -0,0 +1,218 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Soleri Knowledge Engine — MCP Server
4
+ *
5
+ * Reads agent.yaml, boots the runtime, registers all tools, connects stdio.
6
+ *
7
+ * Usage:
8
+ * npx @soleri/engine --agent ./agent.yaml
9
+ * node dist/engine/bin/soleri-engine.js --agent ./agent.yaml
10
+ */
11
+
12
+ import { readFileSync, existsSync } from 'node:fs';
13
+ import { resolve, dirname, join } from 'node:path';
14
+ import { homedir } from 'node:os';
15
+ import { parse as parseYaml } from 'yaml';
16
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
17
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
18
+ import { createAgentRuntime } from '../../runtime/runtime.js';
19
+ import { registerEngine } from '../register-engine.js';
20
+ import { createCoreOps } from '../core-ops.js';
21
+ import { seedDefaultPlaybooks } from '../../playbooks/playbook-seeder.js';
22
+ import type { AgentIdentityConfig } from '../core-ops.js';
23
+
24
+ // ─── Parse CLI args ───────────────────────────────────────────────────
25
+
26
+ function parseArgs(): { agentYamlPath: string } {
27
+ const args = process.argv.slice(2);
28
+ let agentYamlPath: string | undefined;
29
+
30
+ for (let i = 0; i < args.length; i++) {
31
+ if (args[i] === '--agent' && args[i + 1]) {
32
+ agentYamlPath = resolve(args[i + 1]);
33
+ break;
34
+ }
35
+ }
36
+
37
+ if (!agentYamlPath) {
38
+ // Default: look for agent.yaml in cwd
39
+ agentYamlPath = resolve('agent.yaml');
40
+ }
41
+
42
+ if (!existsSync(agentYamlPath)) {
43
+ console.error(`[soleri-engine] agent.yaml not found: ${agentYamlPath}`);
44
+ console.error('Usage: soleri-engine --agent ./agent.yaml');
45
+ process.exit(1);
46
+ }
47
+
48
+ return { agentYamlPath };
49
+ }
50
+
51
+ // ─── Main ─────────────────────────────────────────────────────────────
52
+
53
+ async function main(): Promise<void> {
54
+ const { agentYamlPath } = parseArgs();
55
+ const agentDir = dirname(agentYamlPath);
56
+
57
+ // 1. Read agent.yaml
58
+ const raw = readFileSync(agentYamlPath, 'utf-8');
59
+ const config = parseYaml(raw) as Record<string, unknown>;
60
+
61
+ const agentId = config.id as string;
62
+ const tag = `[${agentId}]`;
63
+
64
+ console.error(`${tag} Starting Soleri Knowledge Engine...`);
65
+ console.error(`${tag} Agent: ${config.name} (${agentId})`);
66
+ console.error(`${tag} Format: file-tree`);
67
+
68
+ // 2. Resolve vault path
69
+ const engineConfig = (config.engine ?? {}) as Record<string, unknown>;
70
+ const vaultPath = engineConfig.vault
71
+ ? resolve((engineConfig.vault as string).replace(/^~/, homedir()))
72
+ : join(homedir(), `.${agentId}`, 'vault.db');
73
+
74
+ // 3. Create runtime
75
+ const runtime = createAgentRuntime({
76
+ agentId,
77
+ vaultPath,
78
+ agentDir,
79
+ cognee: (engineConfig.cognee as boolean) ?? false,
80
+ });
81
+
82
+ console.error(`${tag} Vault: ${vaultPath}`);
83
+ console.error(`${tag} Vault entries: ${runtime.vault.stats().totalEntries}`);
84
+
85
+ // 4. Connect linked vaults
86
+ const vaults = (config.vaults ?? []) as Array<{ name: string; path: string; priority?: number }>;
87
+ for (const vault of vaults) {
88
+ try {
89
+ const vaultAbsPath = resolve(vault.path.replace(/^~/, homedir()));
90
+ runtime.vaultManager.connect(vault.name, vaultAbsPath, vault.priority ?? 0.5);
91
+ console.error(`${tag} Linked vault: ${vault.name} (${vaultAbsPath})`);
92
+ } catch (err) {
93
+ console.error(
94
+ `${tag} Warning: failed to connect vault "${vault.name}": ${err instanceof Error ? err.message : String(err)}`,
95
+ );
96
+ }
97
+ }
98
+
99
+ // 5. Seed intelligence data from knowledge/ directory
100
+ const knowledgeDir = join(agentDir, 'knowledge');
101
+ if (existsSync(knowledgeDir)) {
102
+ const { readdirSync } = await import('node:fs');
103
+ const files = readdirSync(knowledgeDir).filter((f: string) => f.endsWith('.json'));
104
+ for (const file of files) {
105
+ try {
106
+ const bundle = JSON.parse(readFileSync(join(knowledgeDir, file), 'utf-8'));
107
+ if (bundle.entries && Array.isArray(bundle.entries) && bundle.entries.length > 0) {
108
+ const seeded = runtime.vault.seed(bundle.entries);
109
+ console.error(`${tag} Seeded ${seeded} entries from ${file}`);
110
+ }
111
+ } catch {
112
+ // Skip invalid bundles
113
+ }
114
+ }
115
+ }
116
+
117
+ // 6. Seed default playbooks
118
+ seedDefaultPlaybooks(runtime.vault);
119
+
120
+ // 7. Load domain packs
121
+ const packs = (config.packs ?? []) as Array<{ name: string; package: string; version?: string }>;
122
+ const loadedPacks: Array<{ name: string; facades?: Array<{ name: string; ops: unknown[] }> }> =
123
+ [];
124
+
125
+ if (packs.length > 0) {
126
+ try {
127
+ const { loadDomainPacksFromConfig } = await import('../../domain-packs/loader.js');
128
+ const refs = packs.map((p) => ({ name: p.name, package: p.package, version: p.version }));
129
+ const manifests = await loadDomainPacksFromConfig(refs);
130
+
131
+ // Packs activate sequentially — order may matter for dependencies
132
+ for (const manifest of manifests) {
133
+ if (manifest.onActivate) {
134
+ await manifest.onActivate(runtime); // eslint-disable-line no-await-in-loop
135
+ }
136
+ loadedPacks.push(manifest);
137
+ console.error(`${tag} Domain pack: ${manifest.name}`);
138
+ }
139
+ } catch (err) {
140
+ console.error(
141
+ `${tag} Warning: domain pack loading failed: ${err instanceof Error ? err.message : String(err)}`,
142
+ );
143
+ }
144
+ }
145
+
146
+ // 8. Build identity config from agent.yaml
147
+ const identity: AgentIdentityConfig = {
148
+ id: agentId,
149
+ name: config.name as string,
150
+ role: config.role as string,
151
+ description: config.description as string,
152
+ domains: (config.domains ?? []) as string[],
153
+ principles: (config.principles ?? []) as string[],
154
+ tone: (config.tone as string) ?? 'pragmatic',
155
+ greeting: config.greeting as string | undefined,
156
+ };
157
+
158
+ // 9. Create core ops
159
+ const coreOps = createCoreOps(runtime, identity);
160
+
161
+ // 10. Create MCP server
162
+ const server = new McpServer({
163
+ name: `${agentId}-engine`,
164
+ version: '1.0.0',
165
+ });
166
+
167
+ // 11. Register persona prompt
168
+ server.prompt('persona', 'Get agent persona and principles', () => ({
169
+ messages: [
170
+ {
171
+ role: 'user' as const,
172
+ content: {
173
+ type: 'text' as const,
174
+ text: `You are ${identity.name}. ${identity.role}.\n\nPrinciples:\n${identity.principles.map((p) => `- ${p}`).join('\n')}\n\nTone: ${identity.tone}`,
175
+ },
176
+ },
177
+ ],
178
+ }));
179
+
180
+ // 12. Register all engine tools
181
+ const { tools, totalOps } = registerEngine(server, runtime, {
182
+ agentId,
183
+ coreOps,
184
+ domains: identity.domains,
185
+ domainPacks: loadedPacks as Parameters<typeof registerEngine>[2]['domainPacks'],
186
+ hotOps: [
187
+ 'search_intelligent',
188
+ 'capture_knowledge',
189
+ 'orchestrate_plan',
190
+ 'orchestrate_execute',
191
+ 'orchestrate_complete',
192
+ ],
193
+ authPolicy: () => runtime.authPolicy,
194
+ });
195
+
196
+ console.error(`${tag} Registered ${tools.length} tools (${totalOps} ops)`);
197
+
198
+ // 13. Connect stdio transport
199
+ const transport = new StdioServerTransport();
200
+ await server.connect(transport);
201
+
202
+ console.error(`${tag} Engine ready — listening on stdio`);
203
+
204
+ // 14. Graceful shutdown
205
+ const shutdown = () => {
206
+ console.error(`${tag} Shutting down...`);
207
+ runtime.close();
208
+ process.exit(0);
209
+ };
210
+
211
+ process.on('SIGTERM', shutdown);
212
+ process.on('SIGINT', shutdown);
213
+ }
214
+
215
+ main().catch((err) => {
216
+ console.error('[soleri-engine] Fatal:', err);
217
+ process.exit(1);
218
+ });
@@ -0,0 +1,178 @@
1
+ /**
2
+ * Soleri v7 — Agent Core Ops
3
+ *
4
+ * Generates the agent-specific ops (health, identity, activate, setup)
5
+ * from agent.yaml config, without generated TypeScript.
6
+ *
7
+ * These ops were previously hardcoded in the Forge entry-point template.
8
+ * Now they're created dynamically by the engine at startup.
9
+ */
10
+
11
+ import { z } from 'zod';
12
+ import type { OpDefinition } from '../facades/types.js';
13
+ import type { AgentRuntime } from '../runtime/types.js';
14
+
15
+ export interface AgentIdentityConfig {
16
+ id: string;
17
+ name: string;
18
+ role: string;
19
+ description: string;
20
+ domains: string[];
21
+ principles: string[];
22
+ tone: string;
23
+ greeting?: string;
24
+ }
25
+
26
+ /**
27
+ * Create agent-specific core ops from identity config.
28
+ * These are registered under `{agentId}_core`.
29
+ */
30
+ export function createCoreOps(
31
+ runtime: AgentRuntime,
32
+ identity: AgentIdentityConfig,
33
+ ): OpDefinition[] {
34
+ return [
35
+ {
36
+ name: 'health',
37
+ description: 'Health check — vault status and agent info.',
38
+ auth: 'read',
39
+ handler: async () => {
40
+ const s = runtime.vault.stats();
41
+ return {
42
+ status: 'ok',
43
+ agent: { name: identity.name, role: identity.role, format: 'filetree' },
44
+ vault: { entries: s.totalEntries, domains: Object.keys(s.byDomain) },
45
+ };
46
+ },
47
+ },
48
+ {
49
+ name: 'identity',
50
+ description: 'Get agent identity — name, role, principles.',
51
+ auth: 'read',
52
+ handler: async () => {
53
+ // Check IdentityManager first (may have evolved via updates)
54
+ const managed = runtime.identityManager?.getIdentity(identity.id);
55
+ if (managed) return managed;
56
+
57
+ return {
58
+ name: identity.name,
59
+ role: identity.role,
60
+ description: identity.description,
61
+ domains: identity.domains,
62
+ principles: identity.principles,
63
+ tone: identity.tone,
64
+ };
65
+ },
66
+ },
67
+ {
68
+ name: 'activate',
69
+ description: `Activate agent persona. Say "Hello, ${identity.name}!" to trigger.`,
70
+ auth: 'read',
71
+ schema: z.object({
72
+ projectPath: z.string().optional().default('.'),
73
+ deactivate: z.boolean().optional(),
74
+ }),
75
+ handler: async (params) => {
76
+ if (params.deactivate) {
77
+ return { deactivated: true, agent: identity.id };
78
+ }
79
+
80
+ // Seed identity on first activation
81
+ if (runtime.identityManager && !runtime.identityManager.getIdentity(identity.id)) {
82
+ runtime.identityManager.setIdentity(identity.id, {
83
+ name: identity.name,
84
+ role: identity.role,
85
+ description: identity.description,
86
+ personality: identity.principles,
87
+ changedBy: 'system',
88
+ changeReason: 'Initial identity seeded from agent.yaml',
89
+ });
90
+ }
91
+
92
+ // Register project if project registry available
93
+ const projectPath = (params.projectPath as string) ?? '.';
94
+ if (runtime.projectRegistry) {
95
+ try {
96
+ runtime.projectRegistry.register(projectPath);
97
+ } catch {
98
+ // Project may already be registered
99
+ }
100
+ }
101
+
102
+ // Build activation context
103
+ const s = runtime.vault.stats();
104
+ return {
105
+ activated: true,
106
+ agent: {
107
+ id: identity.id,
108
+ name: identity.name,
109
+ role: identity.role,
110
+ description: identity.description,
111
+ format: 'filetree',
112
+ },
113
+ persona: {
114
+ tone: identity.tone,
115
+ principles: identity.principles,
116
+ greeting: identity.greeting ?? `Hello! I am ${identity.name}.`,
117
+ },
118
+ vault: {
119
+ connected: true,
120
+ entries: s.totalEntries,
121
+ domains: Object.keys(s.byDomain),
122
+ },
123
+ domains: identity.domains,
124
+ };
125
+ },
126
+ },
127
+ {
128
+ name: 'register',
129
+ description: 'Register a project for context tracking.',
130
+ auth: 'write',
131
+ schema: z.object({
132
+ projectPath: z.string().default('.'),
133
+ }),
134
+ handler: async (params) => {
135
+ const projectPath = (params.projectPath as string) ?? '.';
136
+ if (runtime.projectRegistry) {
137
+ try {
138
+ const project = runtime.projectRegistry.register(projectPath);
139
+ return { registered: true, project };
140
+ } catch {
141
+ return { registered: false, reason: 'Already registered or error' };
142
+ }
143
+ }
144
+ return { registered: false, reason: 'Project registry not available' };
145
+ },
146
+ },
147
+ {
148
+ name: 'setup',
149
+ description: 'Check setup status — vault entries, engine health, domain packs.',
150
+ auth: 'read',
151
+ handler: async () => {
152
+ const s = runtime.vault.stats();
153
+ return {
154
+ agent: {
155
+ id: identity.id,
156
+ name: identity.name,
157
+ format: 'filetree',
158
+ },
159
+ vault: {
160
+ entries: s.totalEntries,
161
+ domains: Object.keys(s.byDomain),
162
+ byType: s.byType,
163
+ },
164
+ engine: {
165
+ cognee: runtime.cognee !== null && runtime.cognee !== undefined,
166
+ brain: true,
167
+ curator: true,
168
+ planner: true,
169
+ },
170
+ recommendations:
171
+ s.totalEntries === 0
172
+ ? ['Vault is empty — capture knowledge to start building intelligence']
173
+ : [],
174
+ };
175
+ },
176
+ },
177
+ ];
178
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Soleri Knowledge Engine — MCP Server Entry Point
3
+ *
4
+ * This is the standalone knowledge engine that file-tree agents connect to.
5
+ * It reads agent.yaml, initializes the runtime, and registers all tools.
6
+ *
7
+ * Usage:
8
+ * npx @soleri/engine --agent ./agent.yaml
9
+ *
10
+ * Or in .mcp.json:
11
+ * { "command": "npx", "args": ["@soleri/engine", "--agent", "./agent.yaml"] }
12
+ *
13
+ * Binary entry point: ./bin/soleri-engine.ts
14
+ */
15
+
16
+ export { registerEngine } from './register-engine.js';
17
+ export type { EngineRegistrationOptions, EngineRegistrationResult } from './register-engine.js';
18
+ export { createCoreOps } from './core-ops.js';
19
+ export type { AgentIdentityConfig } from './core-ops.js';