@braidhq/server 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (401) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +134 -106
  3. package/dist/app.d.ts +7 -15
  4. package/dist/app.d.ts.map +1 -1
  5. package/dist/app.js +74 -45
  6. package/dist/app.js.map +1 -1
  7. package/dist/authMode.d.ts +39 -0
  8. package/dist/authMode.d.ts.map +1 -0
  9. package/dist/authMode.js +50 -0
  10. package/dist/authMode.js.map +1 -0
  11. package/dist/composeApp.d.ts +80 -0
  12. package/dist/composeApp.d.ts.map +1 -0
  13. package/dist/composeApp.js +137 -0
  14. package/dist/composeApp.js.map +1 -0
  15. package/dist/composeFsApp.d.ts +27 -0
  16. package/dist/composeFsApp.d.ts.map +1 -0
  17. package/dist/{composeFs.js → composeFsApp.js} +127 -126
  18. package/dist/composeFsApp.js.map +1 -0
  19. package/dist/index.d.ts +3 -2
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +3 -2
  22. package/dist/index.js.map +1 -1
  23. package/dist/infrastructure/_shared/env.d.ts +10 -0
  24. package/dist/infrastructure/_shared/env.d.ts.map +1 -0
  25. package/dist/infrastructure/{env.js → _shared/env.js} +5 -6
  26. package/dist/infrastructure/_shared/env.js.map +1 -0
  27. package/dist/infrastructure/_shared/frontmatter.d.ts +13 -0
  28. package/dist/infrastructure/_shared/frontmatter.d.ts.map +1 -0
  29. package/dist/infrastructure/{fs → _shared}/frontmatter.js +5 -5
  30. package/dist/infrastructure/_shared/frontmatter.js.map +1 -0
  31. package/dist/infrastructure/_shared/jsonFileStore.d.ts.map +1 -0
  32. package/dist/infrastructure/_shared/jsonFileStore.js.map +1 -0
  33. package/dist/infrastructure/{fs → _shared}/paths.d.ts +17 -10
  34. package/dist/infrastructure/_shared/paths.d.ts.map +1 -0
  35. package/dist/infrastructure/{fs → _shared}/paths.js +27 -20
  36. package/dist/infrastructure/_shared/paths.js.map +1 -0
  37. package/dist/infrastructure/auth/AccessPolicy.d.ts +33 -58
  38. package/dist/infrastructure/auth/AccessPolicy.d.ts.map +1 -1
  39. package/dist/infrastructure/auth/AccessPolicy.js +35 -42
  40. package/dist/infrastructure/auth/AccessPolicy.js.map +1 -1
  41. package/dist/infrastructure/auth/SessionStore.d.ts +22 -12
  42. package/dist/infrastructure/auth/SessionStore.d.ts.map +1 -1
  43. package/dist/infrastructure/auth/SessionStore.js +20 -20
  44. package/dist/infrastructure/auth/SessionStore.js.map +1 -1
  45. package/dist/infrastructure/batch/FsBatchPlanRepository.d.ts +14 -0
  46. package/dist/infrastructure/batch/FsBatchPlanRepository.d.ts.map +1 -0
  47. package/dist/infrastructure/{fs → batch}/FsBatchPlanRepository.js +9 -7
  48. package/dist/infrastructure/batch/FsBatchPlanRepository.js.map +1 -0
  49. package/dist/infrastructure/history/GitWorkspaceHistory.d.ts.map +1 -0
  50. package/dist/infrastructure/{git → history}/GitWorkspaceHistory.js +31 -24
  51. package/dist/infrastructure/history/GitWorkspaceHistory.js.map +1 -0
  52. package/dist/infrastructure/history/commitMessage.d.ts.map +1 -0
  53. package/dist/infrastructure/history/commitMessage.js +90 -0
  54. package/dist/infrastructure/history/commitMessage.js.map +1 -0
  55. package/dist/infrastructure/hitl/FsClarificationRepository.d.ts +13 -0
  56. package/dist/infrastructure/hitl/FsClarificationRepository.d.ts.map +1 -0
  57. package/dist/infrastructure/hitl/FsClarificationRepository.js +40 -0
  58. package/dist/infrastructure/hitl/FsClarificationRepository.js.map +1 -0
  59. package/dist/infrastructure/hitl/FsProposalRepository.d.ts.map +1 -0
  60. package/dist/infrastructure/{fs → hitl}/FsProposalRepository.js +8 -8
  61. package/dist/infrastructure/hitl/FsProposalRepository.js.map +1 -0
  62. package/dist/infrastructure/hitl/StatusedJsonStore.d.ts +30 -0
  63. package/dist/infrastructure/hitl/StatusedJsonStore.d.ts.map +1 -0
  64. package/dist/infrastructure/{fs/FsStatusedJsonRepository.js → hitl/StatusedJsonStore.js} +3 -3
  65. package/dist/infrastructure/hitl/StatusedJsonStore.js.map +1 -0
  66. package/dist/infrastructure/model/FsModelSerializer.d.ts +94 -0
  67. package/dist/infrastructure/model/FsModelSerializer.d.ts.map +1 -0
  68. package/dist/infrastructure/{fs/FsGraphSerializer.js → model/FsModelSerializer.js} +11 -11
  69. package/dist/infrastructure/model/FsModelSerializer.js.map +1 -0
  70. package/dist/infrastructure/oauth/GoogleOAuth.d.ts +20 -38
  71. package/dist/infrastructure/oauth/GoogleOAuth.d.ts.map +1 -1
  72. package/dist/infrastructure/oauth/GoogleOAuth.js +21 -22
  73. package/dist/infrastructure/oauth/GoogleOAuth.js.map +1 -1
  74. package/dist/infrastructure/reactor/FsReactorCycleRepository.d.ts +29 -0
  75. package/dist/infrastructure/reactor/FsReactorCycleRepository.d.ts.map +1 -0
  76. package/dist/infrastructure/reactor/FsReactorCycleRepository.js +94 -0
  77. package/dist/infrastructure/reactor/FsReactorCycleRepository.js.map +1 -0
  78. package/dist/infrastructure/secrets/SecretStore.d.ts +11 -14
  79. package/dist/infrastructure/secrets/SecretStore.d.ts.map +1 -1
  80. package/dist/infrastructure/secrets/SecretStore.js +4 -4
  81. package/dist/infrastructure/secrets/SecretStore.js.map +1 -1
  82. package/dist/infrastructure/{fs → skill}/FsRunRepository.d.ts +5 -3
  83. package/dist/infrastructure/skill/FsRunRepository.d.ts.map +1 -0
  84. package/dist/infrastructure/{fs → skill}/FsRunRepository.js +11 -9
  85. package/dist/infrastructure/skill/FsRunRepository.js.map +1 -0
  86. package/dist/infrastructure/{fs → skill}/FsSkillRegistry.d.ts +4 -13
  87. package/dist/infrastructure/skill/FsSkillRegistry.d.ts.map +1 -0
  88. package/dist/infrastructure/{fs → skill}/FsSkillRegistry.js +28 -20
  89. package/dist/infrastructure/skill/FsSkillRegistry.js.map +1 -0
  90. package/dist/infrastructure/skill/SubprocessSkillRunner.d.ts +52 -0
  91. package/dist/infrastructure/skill/SubprocessSkillRunner.d.ts.map +1 -0
  92. package/dist/infrastructure/{agent → skill}/SubprocessSkillRunner.js +107 -55
  93. package/dist/infrastructure/skill/SubprocessSkillRunner.js.map +1 -0
  94. package/dist/infrastructure/skill/asyncQueue.d.ts +20 -0
  95. package/dist/infrastructure/skill/asyncQueue.d.ts.map +1 -0
  96. package/dist/infrastructure/{agent → skill}/asyncQueue.js +2 -3
  97. package/dist/infrastructure/{agent → skill}/asyncQueue.js.map +1 -1
  98. package/dist/infrastructure/skill/lineBuffer.d.ts +15 -0
  99. package/dist/infrastructure/skill/lineBuffer.d.ts.map +1 -0
  100. package/dist/infrastructure/{agent/streamJsonParser.js → skill/lineBuffer.js} +5 -17
  101. package/dist/infrastructure/skill/lineBuffer.js.map +1 -0
  102. package/dist/infrastructure/skill/orphanReaper.d.ts +20 -0
  103. package/dist/infrastructure/skill/orphanReaper.d.ts.map +1 -0
  104. package/dist/infrastructure/{orphanReaper.js → skill/orphanReaper.js} +7 -5
  105. package/dist/infrastructure/skill/orphanReaper.js.map +1 -0
  106. package/dist/infrastructure/skill/subprocessEventStream.d.ts +16 -0
  107. package/dist/infrastructure/skill/subprocessEventStream.d.ts.map +1 -0
  108. package/dist/infrastructure/skill/subprocessEventStream.js +29 -0
  109. package/dist/infrastructure/skill/subprocessEventStream.js.map +1 -0
  110. package/dist/infrastructure/source/FsSourceUnitDigest.d.ts +19 -0
  111. package/dist/infrastructure/source/FsSourceUnitDigest.d.ts.map +1 -0
  112. package/dist/infrastructure/{fs → source}/FsSourceUnitDigest.js +9 -9
  113. package/dist/infrastructure/source/FsSourceUnitDigest.js.map +1 -0
  114. package/dist/infrastructure/source/FsSourceUnitObservationRepository.d.ts +31 -0
  115. package/dist/infrastructure/source/FsSourceUnitObservationRepository.d.ts.map +1 -0
  116. package/dist/infrastructure/{fs/FsSourceUnitStateRepository.js → source/FsSourceUnitObservationRepository.js} +18 -17
  117. package/dist/infrastructure/source/FsSourceUnitObservationRepository.js.map +1 -0
  118. package/dist/infrastructure/source/unitScan.d.ts +11 -0
  119. package/dist/infrastructure/source/unitScan.d.ts.map +1 -0
  120. package/dist/infrastructure/{fs/intentScan.js → source/unitScan.js} +36 -27
  121. package/dist/infrastructure/source/unitScan.js.map +1 -0
  122. package/dist/infrastructure/users/UserDirectoryFromRegistry.d.ts +2 -2
  123. package/dist/infrastructure/users/UserDirectoryFromRegistry.d.ts.map +1 -1
  124. package/dist/infrastructure/users/UserDirectoryFromRegistry.js +3 -2
  125. package/dist/infrastructure/users/UserDirectoryFromRegistry.js.map +1 -1
  126. package/dist/infrastructure/users/UserRegistryFile.d.ts +4 -5
  127. package/dist/infrastructure/users/UserRegistryFile.d.ts.map +1 -1
  128. package/dist/infrastructure/users/UserRegistryFile.js +6 -8
  129. package/dist/infrastructure/users/UserRegistryFile.js.map +1 -1
  130. package/dist/infrastructure/users/ensureWorkspaceOwners.d.ts +9 -6
  131. package/dist/infrastructure/users/ensureWorkspaceOwners.d.ts.map +1 -1
  132. package/dist/infrastructure/users/ensureWorkspaceOwners.js +10 -7
  133. package/dist/infrastructure/users/ensureWorkspaceOwners.js.map +1 -1
  134. package/dist/infrastructure/workspace/FsWorkspaceRepository.d.ts.map +1 -0
  135. package/dist/infrastructure/{fs → workspace}/FsWorkspaceRepository.js +7 -6
  136. package/dist/infrastructure/workspace/FsWorkspaceRepository.js.map +1 -0
  137. package/dist/infrastructure/workspace/WorkspaceDiscovery.d.ts +18 -0
  138. package/dist/infrastructure/workspace/WorkspaceDiscovery.d.ts.map +1 -0
  139. package/dist/infrastructure/{fs → workspace}/WorkspaceDiscovery.js +15 -11
  140. package/dist/infrastructure/workspace/WorkspaceDiscovery.js.map +1 -0
  141. package/dist/infrastructure/{fs → workspace}/WorkspaceRegistryFile.d.ts +10 -9
  142. package/dist/infrastructure/workspace/WorkspaceRegistryFile.d.ts.map +1 -0
  143. package/dist/infrastructure/{fs → workspace}/WorkspaceRegistryFile.js +15 -17
  144. package/dist/infrastructure/workspace/WorkspaceRegistryFile.js.map +1 -0
  145. package/dist/infrastructure/workspace/productManifestWriter.d.ts +24 -0
  146. package/dist/infrastructure/workspace/productManifestWriter.d.ts.map +1 -0
  147. package/dist/infrastructure/{fs → workspace}/productManifestWriter.js +14 -26
  148. package/dist/infrastructure/workspace/productManifestWriter.js.map +1 -0
  149. package/dist/middleware/auth.d.ts +27 -17
  150. package/dist/middleware/auth.d.ts.map +1 -1
  151. package/dist/middleware/auth.js +69 -53
  152. package/dist/middleware/auth.js.map +1 -1
  153. package/dist/middleware/cors.d.ts.map +1 -1
  154. package/dist/middleware/cors.js +4 -1
  155. package/dist/middleware/cors.js.map +1 -1
  156. package/dist/middleware/error.d.ts.map +1 -1
  157. package/dist/middleware/error.js +15 -13
  158. package/dist/middleware/error.js.map +1 -1
  159. package/dist/middleware/workspaceAccess.d.ts +23 -19
  160. package/dist/middleware/workspaceAccess.d.ts.map +1 -1
  161. package/dist/middleware/workspaceAccess.js +31 -26
  162. package/dist/middleware/workspaceAccess.js.map +1 -1
  163. package/dist/policy/CapabilityCheck.d.ts +5 -5
  164. package/dist/policy/PermissionRegistry.d.ts +11 -9
  165. package/dist/policy/PermissionRegistry.d.ts.map +1 -1
  166. package/dist/policy/PermissionRegistry.js +10 -8
  167. package/dist/policy/PermissionRegistry.js.map +1 -1
  168. package/dist/policy/ViewerContext.d.ts +13 -11
  169. package/dist/policy/ViewerContext.d.ts.map +1 -1
  170. package/dist/policy/checks.d.ts +9 -9
  171. package/dist/policy/checks.d.ts.map +1 -1
  172. package/dist/policy/checks.js +14 -11
  173. package/dist/policy/checks.js.map +1 -1
  174. package/dist/policy/defaultRegistry.d.ts +3 -4
  175. package/dist/policy/defaultRegistry.d.ts.map +1 -1
  176. package/dist/policy/defaultRegistry.js +3 -4
  177. package/dist/policy/defaultRegistry.js.map +1 -1
  178. package/dist/policy/index.d.ts +2 -2
  179. package/dist/policy/index.d.ts.map +1 -1
  180. package/dist/policy/index.js +1 -1
  181. package/dist/policy/index.js.map +1 -1
  182. package/dist/policy/resolveViewer.d.ts +9 -9
  183. package/dist/policy/resolveViewer.js +9 -9
  184. package/dist/routes/_shared.d.ts +93 -153
  185. package/dist/routes/_shared.d.ts.map +1 -1
  186. package/dist/routes/_shared.js +9 -5
  187. package/dist/routes/_shared.js.map +1 -1
  188. package/dist/routes/admin.d.ts +1 -1
  189. package/dist/routes/admin.d.ts.map +1 -1
  190. package/dist/routes/admin.js +13 -12
  191. package/dist/routes/admin.js.map +1 -1
  192. package/dist/routes/auth.d.ts +12 -10
  193. package/dist/routes/auth.d.ts.map +1 -1
  194. package/dist/routes/auth.js +32 -34
  195. package/dist/routes/auth.js.map +1 -1
  196. package/dist/routes/clarifications.d.ts +8 -0
  197. package/dist/routes/clarifications.d.ts.map +1 -0
  198. package/dist/routes/clarifications.js +246 -0
  199. package/dist/routes/clarifications.js.map +1 -0
  200. package/dist/routes/edges.d.ts.map +1 -1
  201. package/dist/routes/edges.js +2 -6
  202. package/dist/routes/edges.js.map +1 -1
  203. package/dist/routes/history.d.ts.map +1 -1
  204. package/dist/routes/history.js +12 -10
  205. package/dist/routes/history.js.map +1 -1
  206. package/dist/routes/nodes.d.ts.map +1 -1
  207. package/dist/routes/nodes.js +4 -8
  208. package/dist/routes/nodes.js.map +1 -1
  209. package/dist/routes/oauth.d.ts +6 -7
  210. package/dist/routes/oauth.d.ts.map +1 -1
  211. package/dist/routes/oauth.js +6 -7
  212. package/dist/routes/oauth.js.map +1 -1
  213. package/dist/routes/ontologies.d.ts +7 -0
  214. package/dist/routes/ontologies.d.ts.map +1 -0
  215. package/dist/routes/ontologies.js +29 -0
  216. package/dist/routes/ontologies.js.map +1 -0
  217. package/dist/routes/ontology.d.ts.map +1 -1
  218. package/dist/routes/ontology.js +2 -1
  219. package/dist/routes/ontology.js.map +1 -1
  220. package/dist/routes/proposals.d.ts +2 -2
  221. package/dist/routes/proposals.d.ts.map +1 -1
  222. package/dist/routes/proposals.js +35 -30
  223. package/dist/routes/proposals.js.map +1 -1
  224. package/dist/routes/reactorCycles.d.ts +7 -0
  225. package/dist/routes/reactorCycles.d.ts.map +1 -0
  226. package/dist/routes/reactorCycles.js +60 -0
  227. package/dist/routes/reactorCycles.js.map +1 -0
  228. package/dist/routes/runs.d.ts.map +1 -1
  229. package/dist/routes/runs.js +22 -19
  230. package/dist/routes/runs.js.map +1 -1
  231. package/dist/routes/skillInputOptions.d.ts +2 -2
  232. package/dist/routes/skillInputOptions.d.ts.map +1 -1
  233. package/dist/routes/skillInputOptions.js +53 -53
  234. package/dist/routes/skillInputOptions.js.map +1 -1
  235. package/dist/routes/skills.d.ts +19 -1
  236. package/dist/routes/skills.d.ts.map +1 -1
  237. package/dist/routes/skills.js +141 -7
  238. package/dist/routes/skills.js.map +1 -1
  239. package/dist/routes/sourceLoaders.d.ts.map +1 -1
  240. package/dist/routes/sourceLoaders.js +1 -0
  241. package/dist/routes/sourceLoaders.js.map +1 -1
  242. package/dist/routes/sourceUnitObservations.d.ts +20 -0
  243. package/dist/routes/sourceUnitObservations.d.ts.map +1 -0
  244. package/dist/routes/sourceUnitObservations.js +80 -0
  245. package/dist/routes/sourceUnitObservations.js.map +1 -0
  246. package/dist/routes/sourceWebhooks.d.ts +26 -0
  247. package/dist/routes/sourceWebhooks.d.ts.map +1 -0
  248. package/dist/routes/sourceWebhooks.js +301 -0
  249. package/dist/routes/sourceWebhooks.js.map +1 -0
  250. package/dist/routes/users.d.ts +0 -2
  251. package/dist/routes/users.d.ts.map +1 -1
  252. package/dist/routes/users.js +15 -33
  253. package/dist/routes/users.js.map +1 -1
  254. package/dist/routes/workspaceEvents.d.ts +5 -4
  255. package/dist/routes/workspaceEvents.d.ts.map +1 -1
  256. package/dist/routes/workspaceEvents.js +7 -6
  257. package/dist/routes/workspaceEvents.js.map +1 -1
  258. package/dist/routes/workspaceMembers.d.ts +1 -1
  259. package/dist/routes/workspaceMembers.d.ts.map +1 -1
  260. package/dist/routes/workspaceMembers.js +2 -2
  261. package/dist/routes/workspaceMembers.js.map +1 -1
  262. package/dist/routes/workspaces.d.ts +21 -10
  263. package/dist/routes/workspaces.d.ts.map +1 -1
  264. package/dist/routes/workspaces.js +95 -69
  265. package/dist/routes/workspaces.js.map +1 -1
  266. package/dist/server.js +6 -70
  267. package/dist/server.js.map +1 -1
  268. package/dist/serviceAccounts.d.ts +13 -0
  269. package/dist/serviceAccounts.d.ts.map +1 -0
  270. package/dist/serviceAccounts.js +26 -0
  271. package/dist/serviceAccounts.js.map +1 -0
  272. package/dist/startServer.d.ts +17 -0
  273. package/dist/startServer.d.ts.map +1 -0
  274. package/dist/startServer.js +81 -0
  275. package/dist/startServer.js.map +1 -0
  276. package/dist/startup.d.ts +28 -0
  277. package/dist/startup.d.ts.map +1 -0
  278. package/dist/startup.js +94 -0
  279. package/dist/startup.js.map +1 -0
  280. package/package.json +35 -40
  281. package/dist/composeFs.d.ts +0 -55
  282. package/dist/composeFs.d.ts.map +0 -1
  283. package/dist/composeFs.js.map +0 -1
  284. package/dist/composition.d.ts +0 -133
  285. package/dist/composition.d.ts.map +0 -1
  286. package/dist/composition.js +0 -113
  287. package/dist/composition.js.map +0 -1
  288. package/dist/infrastructure/agent/SubprocessSkillRunner.d.ts +0 -75
  289. package/dist/infrastructure/agent/SubprocessSkillRunner.d.ts.map +0 -1
  290. package/dist/infrastructure/agent/SubprocessSkillRunner.js.map +0 -1
  291. package/dist/infrastructure/agent/asyncQueue.d.ts +0 -22
  292. package/dist/infrastructure/agent/asyncQueue.d.ts.map +0 -1
  293. package/dist/infrastructure/agent/mcpConfig.d.ts +0 -38
  294. package/dist/infrastructure/agent/mcpConfig.d.ts.map +0 -1
  295. package/dist/infrastructure/agent/mcpConfig.js +0 -55
  296. package/dist/infrastructure/agent/mcpConfig.js.map +0 -1
  297. package/dist/infrastructure/agent/streamJsonParser.d.ts +0 -20
  298. package/dist/infrastructure/agent/streamJsonParser.d.ts.map +0 -1
  299. package/dist/infrastructure/agent/streamJsonParser.js.map +0 -1
  300. package/dist/infrastructure/agent/subprocessEventStream.d.ts +0 -26
  301. package/dist/infrastructure/agent/subprocessEventStream.d.ts.map +0 -1
  302. package/dist/infrastructure/agent/subprocessEventStream.js +0 -112
  303. package/dist/infrastructure/agent/subprocessEventStream.js.map +0 -1
  304. package/dist/infrastructure/auth/ensureApprovedEmails.d.ts +0 -16
  305. package/dist/infrastructure/auth/ensureApprovedEmails.d.ts.map +0 -1
  306. package/dist/infrastructure/auth/ensureApprovedEmails.js +0 -20
  307. package/dist/infrastructure/auth/ensureApprovedEmails.js.map +0 -1
  308. package/dist/infrastructure/env.d.ts +0 -11
  309. package/dist/infrastructure/env.d.ts.map +0 -1
  310. package/dist/infrastructure/env.js.map +0 -1
  311. package/dist/infrastructure/fs/FsBatchPlanRepository.d.ts +0 -300
  312. package/dist/infrastructure/fs/FsBatchPlanRepository.d.ts.map +0 -1
  313. package/dist/infrastructure/fs/FsBatchPlanRepository.js.map +0 -1
  314. package/dist/infrastructure/fs/FsClarifyTicketRepository.d.ts +0 -13
  315. package/dist/infrastructure/fs/FsClarifyTicketRepository.d.ts.map +0 -1
  316. package/dist/infrastructure/fs/FsClarifyTicketRepository.js +0 -39
  317. package/dist/infrastructure/fs/FsClarifyTicketRepository.js.map +0 -1
  318. package/dist/infrastructure/fs/FsDecisionRepository.d.ts +0 -13
  319. package/dist/infrastructure/fs/FsDecisionRepository.d.ts.map +0 -1
  320. package/dist/infrastructure/fs/FsDecisionRepository.js +0 -56
  321. package/dist/infrastructure/fs/FsDecisionRepository.js.map +0 -1
  322. package/dist/infrastructure/fs/FsGraphSerializer.d.ts +0 -629
  323. package/dist/infrastructure/fs/FsGraphSerializer.d.ts.map +0 -1
  324. package/dist/infrastructure/fs/FsGraphSerializer.js.map +0 -1
  325. package/dist/infrastructure/fs/FsProposalRepository.d.ts.map +0 -1
  326. package/dist/infrastructure/fs/FsProposalRepository.js.map +0 -1
  327. package/dist/infrastructure/fs/FsRunRepository.d.ts.map +0 -1
  328. package/dist/infrastructure/fs/FsRunRepository.js.map +0 -1
  329. package/dist/infrastructure/fs/FsSkillRegistry.d.ts.map +0 -1
  330. package/dist/infrastructure/fs/FsSkillRegistry.js.map +0 -1
  331. package/dist/infrastructure/fs/FsSourceUnitDigest.d.ts +0 -19
  332. package/dist/infrastructure/fs/FsSourceUnitDigest.d.ts.map +0 -1
  333. package/dist/infrastructure/fs/FsSourceUnitDigest.js.map +0 -1
  334. package/dist/infrastructure/fs/FsSourceUnitStateRepository.d.ts +0 -30
  335. package/dist/infrastructure/fs/FsSourceUnitStateRepository.d.ts.map +0 -1
  336. package/dist/infrastructure/fs/FsSourceUnitStateRepository.js.map +0 -1
  337. package/dist/infrastructure/fs/FsStatusedJsonRepository.d.ts +0 -35
  338. package/dist/infrastructure/fs/FsStatusedJsonRepository.d.ts.map +0 -1
  339. package/dist/infrastructure/fs/FsStatusedJsonRepository.js.map +0 -1
  340. package/dist/infrastructure/fs/FsWorkspaceRepository.d.ts.map +0 -1
  341. package/dist/infrastructure/fs/FsWorkspaceRepository.js.map +0 -1
  342. package/dist/infrastructure/fs/WorkspaceDiscovery.d.ts +0 -15
  343. package/dist/infrastructure/fs/WorkspaceDiscovery.d.ts.map +0 -1
  344. package/dist/infrastructure/fs/WorkspaceDiscovery.js.map +0 -1
  345. package/dist/infrastructure/fs/WorkspaceRegistryFile.d.ts.map +0 -1
  346. package/dist/infrastructure/fs/WorkspaceRegistryFile.js.map +0 -1
  347. package/dist/infrastructure/fs/frontmatter.d.ts +0 -13
  348. package/dist/infrastructure/fs/frontmatter.d.ts.map +0 -1
  349. package/dist/infrastructure/fs/frontmatter.js.map +0 -1
  350. package/dist/infrastructure/fs/intentScan.d.ts +0 -9
  351. package/dist/infrastructure/fs/intentScan.d.ts.map +0 -1
  352. package/dist/infrastructure/fs/intentScan.js.map +0 -1
  353. package/dist/infrastructure/fs/jsonFileStore.d.ts.map +0 -1
  354. package/dist/infrastructure/fs/jsonFileStore.js.map +0 -1
  355. package/dist/infrastructure/fs/paths.d.ts.map +0 -1
  356. package/dist/infrastructure/fs/paths.js.map +0 -1
  357. package/dist/infrastructure/fs/productManifestWriter.d.ts +0 -22
  358. package/dist/infrastructure/fs/productManifestWriter.d.ts.map +0 -1
  359. package/dist/infrastructure/fs/productManifestWriter.js.map +0 -1
  360. package/dist/infrastructure/git/GitWorkspaceHistory.d.ts.map +0 -1
  361. package/dist/infrastructure/git/GitWorkspaceHistory.js.map +0 -1
  362. package/dist/infrastructure/git/commitMessage.d.ts.map +0 -1
  363. package/dist/infrastructure/git/commitMessage.js +0 -71
  364. package/dist/infrastructure/git/commitMessage.js.map +0 -1
  365. package/dist/infrastructure/orphanReaper.d.ts +0 -18
  366. package/dist/infrastructure/orphanReaper.d.ts.map +0 -1
  367. package/dist/infrastructure/orphanReaper.js.map +0 -1
  368. package/dist/infrastructure/users/ensureLocalUser.d.ts +0 -15
  369. package/dist/infrastructure/users/ensureLocalUser.d.ts.map +0 -1
  370. package/dist/infrastructure/users/ensureLocalUser.js +0 -38
  371. package/dist/infrastructure/users/ensureLocalUser.js.map +0 -1
  372. package/dist/middleware/requireAdmin.d.ts +0 -10
  373. package/dist/middleware/requireAdmin.d.ts.map +0 -1
  374. package/dist/middleware/requireAdmin.js +0 -24
  375. package/dist/middleware/requireAdmin.js.map +0 -1
  376. package/dist/middleware/userId.d.ts +0 -16
  377. package/dist/middleware/userId.d.ts.map +0 -1
  378. package/dist/middleware/userId.js +0 -27
  379. package/dist/middleware/userId.js.map +0 -1
  380. package/dist/policy/Capability.d.ts +0 -12
  381. package/dist/policy/Capability.d.ts.map +0 -1
  382. package/dist/policy/Capability.js +0 -31
  383. package/dist/policy/Capability.js.map +0 -1
  384. package/dist/routes/clarify.d.ts +0 -9
  385. package/dist/routes/clarify.d.ts.map +0 -1
  386. package/dist/routes/clarify.js +0 -274
  387. package/dist/routes/clarify.js.map +0 -1
  388. package/dist/routes/decisions.d.ts +0 -7
  389. package/dist/routes/decisions.d.ts.map +0 -1
  390. package/dist/routes/decisions.js +0 -68
  391. package/dist/routes/decisions.js.map +0 -1
  392. package/dist/routes/sourceUnitStates.d.ts +0 -7
  393. package/dist/routes/sourceUnitStates.d.ts.map +0 -1
  394. package/dist/routes/sourceUnitStates.js +0 -45
  395. package/dist/routes/sourceUnitStates.js.map +0 -1
  396. /package/dist/infrastructure/{fs → _shared}/jsonFileStore.d.ts +0 -0
  397. /package/dist/infrastructure/{fs → _shared}/jsonFileStore.js +0 -0
  398. /package/dist/infrastructure/{git → history}/GitWorkspaceHistory.d.ts +0 -0
  399. /package/dist/infrastructure/{git → history}/commitMessage.d.ts +0 -0
  400. /package/dist/infrastructure/{fs → hitl}/FsProposalRepository.d.ts +0 -0
  401. /package/dist/infrastructure/{fs → workspace}/FsWorkspaceRepository.d.ts +0 -0
@@ -0,0 +1,26 @@
1
+ import { UserId } from '@braidhq/schema';
2
+ /** The autonomous source-sync reactor's service-account identity. */
3
+ export const REACTOR_USER_ID = UserId.parse('reactor');
4
+ /**
5
+ * Upsert a service account, idempotently. It is an admin,
6
+ * so its calls clear the workspace gate via the admin-to-owner rule.
7
+ * kind=service marks it non-human, and that kind rides onto its proposals,
8
+ * so the HITL views classify its pending without a read-time registry lookup.
9
+ * Each autonomous component seeds its own by calling this.
10
+ */
11
+ export async function ensureServiceAccount(userRegistry, id, displayName) {
12
+ const existing = await userRegistry.get(id);
13
+ if (existing) {
14
+ if (existing.kind !== 'service' || existing.serverRole !== 'admin')
15
+ await userRegistry.update(id, { kind: 'service', serverRole: 'admin' });
16
+ return;
17
+ }
18
+ await userRegistry.create({
19
+ id,
20
+ displayName,
21
+ serverRole: 'admin',
22
+ kind: 'service',
23
+ createdAt: new Date().toISOString(),
24
+ });
25
+ }
26
+ //# sourceMappingURL=serviceAccounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceAccounts.js","sourceRoot":"","sources":["../src/serviceAccounts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,qEAAqE;AACrE,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;AAEtD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,YAA8B,EAAE,EAAc,EAAE,WAAmB;IAC5G,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAC3C,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,UAAU,KAAK,OAAO;YAChE,MAAM,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAA;QACzE,OAAM;IACR,CAAC;IACD,MAAM,YAAY,CAAC,MAAM,CAAC;QACxB,EAAE;QACF,WAAW;QACX,UAAU,EAAE,OAAO;QACnB,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAe;KACjD,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Walk up from the working directory to the first `.env`, and load it,
3
+ * before anything reads process.env.
4
+ * A missing file is silent, production boots from real env, not dotfiles.
5
+ */
6
+ export declare function loadRootEnv(): void;
7
+ export interface StartServerOptions {
8
+ readonly port: number;
9
+ readonly onListen?: (url: string) => void;
10
+ }
11
+ /**
12
+ * Boot the coding-preset app and start serving, shared by the standalone
13
+ * entry and the cli `serve` command so both wire identically.
14
+ * Resolves once the socket is listening, then keeps running under signal handlers.
15
+ */
16
+ export declare function startServer(options: StartServerOptions): Promise<void>;
17
+ //# sourceMappingURL=startServer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startServer.d.ts","sourceRoot":"","sources":["../src/startServer.ts"],"names":[],"mappings":"AAYA;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAalC;AAYD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IAErB,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CAC1C;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB5E"}
@@ -0,0 +1,81 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ import process from 'node:process';
4
+ import { createLogger } from '@braidhq/core';
5
+ import { AgentEffort } from '@braidhq/schema';
6
+ import { serve } from '@hono/node-server';
7
+ import { createApp } from './app.js';
8
+ import { composeFsApp } from './composeFsApp.js';
9
+ import { startupAfterServe } from './startup.js';
10
+ /**
11
+ * Walk up from the working directory to the first `.env`, and load it,
12
+ * before anything reads process.env.
13
+ * A missing file is silent, production boots from real env, not dotfiles.
14
+ */
15
+ export function loadRootEnv() {
16
+ let dir = process.cwd();
17
+ for (;;) {
18
+ const candidate = join(dir, '.env');
19
+ if (existsSync(candidate)) {
20
+ process.loadEnvFile(candidate);
21
+ return;
22
+ }
23
+ const parent = dirname(dir);
24
+ if (parent === dir)
25
+ return;
26
+ dir = parent;
27
+ }
28
+ }
29
+ // The server's own env vars, read in one place so both entries agree.
30
+ // Each key is an optional override, an unset var falls to the preset default.
31
+ function fsOptionsFromEnv() {
32
+ return {
33
+ ...(process.env.BRAID_HOME ? { braidHome: process.env.BRAID_HOME } : {}),
34
+ ...(process.env.BRAID_AGENT_MODEL ? { agentModel: process.env.BRAID_AGENT_MODEL } : {}),
35
+ ...(process.env.BRAID_AGENT_EFFORT ? { agentEffort: AgentEffort.parse(process.env.BRAID_AGENT_EFFORT) } : {}),
36
+ };
37
+ }
38
+ /**
39
+ * Boot the coding-preset app and start serving, shared by the standalone
40
+ * entry and the cli `serve` command so both wire identically.
41
+ * Resolves once the socket is listening, then keeps running under signal handlers.
42
+ */
43
+ export async function startServer(options) {
44
+ const apiUrl = `http://localhost:${options.port}`;
45
+ const deps = await composeFsApp({ apiUrl, ...fsOptionsFromEnv() });
46
+ const app = createApp(deps, { apiUrl });
47
+ const log = createLogger('server');
48
+ const server = await new Promise((resolveBoot) => {
49
+ const handle = serve({ fetch: app.fetch, port: options.port }, ({ port }) => {
50
+ options.onListen?.(`http://localhost:${port}`);
51
+ resolveBoot(handle);
52
+ });
53
+ });
54
+ installShutdown(server, deps, log);
55
+ // Background recovery, after serve() so it never delays accepting requests.
56
+ void startupAfterServe(deps);
57
+ }
58
+ // Close the model repository on shutdown so the storage adapter flushes cleanly.
59
+ // Second signal force-quits in case close hangs.
60
+ function installShutdown(server, deps, log) {
61
+ let shuttingDown = false;
62
+ async function shutdown(signal) {
63
+ if (shuttingDown) {
64
+ log.warn({ signal }, 'received second shutdown signal, exiting now');
65
+ process.exit(1);
66
+ }
67
+ shuttingDown = true;
68
+ log.info({ signal }, 'shutting down');
69
+ server.close();
70
+ try {
71
+ await deps.modelRepository.close?.();
72
+ }
73
+ catch (err) {
74
+ log.error({ err }, 'modelRepository.close failed');
75
+ }
76
+ process.exit(0);
77
+ }
78
+ process.on('SIGINT', () => void shutdown('SIGINT'));
79
+ process.on('SIGTERM', () => void shutdown('SIGTERM'));
80
+ }
81
+ //# sourceMappingURL=startServer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startServer.js","sourceRoot":"","sources":["../src/startServer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,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AAA;QACd,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,CAAA;QACtC,CAAC;QACD,OAAO,GAAG,EAAE,CAAC;YACX,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,8BAA8B,CAAC,CAAA;QACpD,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IACD,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAA;IACnD,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAA;AACvD,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { AppDependencies } from './composeApp.js';
2
+ /**
3
+ * The blocking startup pass, run once after composition,
4
+ * before the server accepts requests.
5
+ * Per workspace it provisions the git repo and store,
6
+ * recovers in-flight state left by a killed process,
7
+ * subscribes the reactor when the workspace opts in,
8
+ * and fires a catch-up sync for missed webhook deliveries.
9
+ *
10
+ * This is the single home for per-workspace boot steps.
11
+ * A new one is added here,
12
+ * not scattered across composition and the server entry.
13
+ * Recovery that need not finish before serving,
14
+ * such as reaping orphan runs, runs after `serve()` in `server.ts`,
15
+ * so it never delays accepting requests.
16
+ *
17
+ * Per-workspace failures are logged and tolerated,
18
+ * so one bad directory does not block the rest of the boot.
19
+ */
20
+ export declare function startupBeforeServe(deps: AppDependencies): Promise<void>;
21
+ /**
22
+ * The background startup pass, run once after `serve()`,
23
+ * so it never delays accepting requests.
24
+ * Cosmetic recovery that need not finish before the first request lives here,
25
+ * not in the blocking `startupBeforeServe`.
26
+ */
27
+ export declare function startupAfterServe(deps: AppDependencies): Promise<void>;
28
+ //# sourceMappingURL=startup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startup.d.ts","sourceRoot":"","sources":["../src/startup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAMtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAkC7E;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB5E"}
@@ -0,0 +1,94 @@
1
+ import { spawn } from 'node:child_process';
2
+ import process from 'node:process';
3
+ import { createLogger } from '@braidhq/core';
4
+ import { reapOrphanRuns } from './infrastructure/skill/orphanReaper.js';
5
+ /**
6
+ * The blocking startup pass, run once after composition,
7
+ * before the server accepts requests.
8
+ * Per workspace it provisions the git repo and store,
9
+ * recovers in-flight state left by a killed process,
10
+ * subscribes the reactor when the workspace opts in,
11
+ * and fires a catch-up sync for missed webhook deliveries.
12
+ *
13
+ * This is the single home for per-workspace boot steps.
14
+ * A new one is added here,
15
+ * not scattered across composition and the server entry.
16
+ * Recovery that need not finish before serving,
17
+ * such as reaping orphan runs, runs after `serve()` in `server.ts`,
18
+ * so it never delays accepting requests.
19
+ *
20
+ * Per-workspace failures are logged and tolerated,
21
+ * so one bad directory does not block the rest of the boot.
22
+ */
23
+ export async function startupBeforeServe(deps) {
24
+ const log = createLogger('server').child({ mod: 'workspace-startup' });
25
+ for (const workspace of await deps.workspaceService.list()) {
26
+ try {
27
+ await deps.bootstrap?.ensure(workspace);
28
+ // Mark any batch plan left running by a previous process as failed,
29
+ // so the UI does not show a phantom spinner.
30
+ // Safe when there is no plan, or when it is already terminal.
31
+ await deps.batchService?.reconcileAfterBoot(workspace.id);
32
+ // Reactor opt-in is per workspace, subscribe only when PRODUCT.md sets it.
33
+ if (workspace.productManifest.reactor?.enabled)
34
+ await deps.reactorService?.start(workspace.id);
35
+ // Catch deliveries missed while the server was down.
36
+ // GitHub drops webhook retries after a few hours,
37
+ // so every boot fires one syncOne per loader source.
38
+ // Loaders carry a persisted cursor,
39
+ // so a caught-up source costs one empty round trip,
40
+ // a stale one fetches only the missed window.
41
+ // Fire-and-forget keeps boot fast, the reactor picks up the events.
42
+ for (const source of workspace.sources) {
43
+ if (source.kind !== 'filesystem' || !source.loader)
44
+ continue;
45
+ void deps.sourceLoaderRunner.syncOne(workspace, source.id).catch((err) => {
46
+ log.warn({ workspaceId: workspace.id, sourceId: source.id, err: err instanceof Error ? err.message : String(err) }, 'boot syncOne failed, will retry on next webhook or manual sync');
47
+ });
48
+ }
49
+ }
50
+ catch (err) {
51
+ log.warn({ err, workspaceId: workspace.id }, 'workspace startup failed, skipping');
52
+ }
53
+ }
54
+ }
55
+ /**
56
+ * The background startup pass, run once after `serve()`,
57
+ * so it never delays accepting requests.
58
+ * Cosmetic recovery that need not finish before the first request lives here,
59
+ * not in the blocking `startupBeforeServe`.
60
+ */
61
+ export async function startupAfterServe(deps) {
62
+ const log = createLogger('server').child({ mod: 'workspace-startup' });
63
+ try {
64
+ const { reaped } = await reapOrphanRuns({
65
+ workspaceRepository: deps.workspaceRepository,
66
+ runRepository: deps.runRepository,
67
+ clock: deps.clock,
68
+ });
69
+ if (reaped > 0)
70
+ log.info({ reaped }, `marked ${reaped} orphan run(s) as aborted`);
71
+ }
72
+ catch (err) {
73
+ log.error({ err }, 'orphan reaper failed');
74
+ }
75
+ // Warm the MCP gateway package so the first skill run's braid-core connects
76
+ // fast, rather than paying the uvx cold-start mid-conversation.
77
+ warmGateway();
78
+ }
79
+ // Pre-fetch the openapi-mcp-gateway package, the download that otherwise makes
80
+ // braid-core look slow to connect on the first run. Fire-and-forget and
81
+ // unref'd, a warm cache is best-effort and never gates the boot. A 30s kill
82
+ // guards a `--help` that hangs once the package is cached, and a missing uvx
83
+ // just errors out quietly. This lives in the after-serve pass, not composition,
84
+ // so it stays out of tests that build the app directly.
85
+ function warmGateway() {
86
+ const uvxBin = process.env.BRAID_UVX_BIN || 'uvx';
87
+ const child = spawn(uvxBin, ['openapi-mcp-gateway', '--help'], { stdio: 'ignore' });
88
+ child.once('error', () => { });
89
+ child.unref();
90
+ const timer = setTimeout(() => child.kill(), 30_000);
91
+ timer.unref();
92
+ child.once('exit', () => clearTimeout(timer));
93
+ }
94
+ //# sourceMappingURL=startup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startup.js","sourceRoot":"","sources":["../src/startup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAA;AAEvE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAqB;IAC5D,MAAM,GAAG,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,mBAAmB,EAAE,CAAC,CAAA;IACtE,KAAK,MAAM,SAAS,IAAI,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC;QAC3D,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,CAAA;YACvC,oEAAoE;YACpE,6CAA6C;YAC7C,8DAA8D;YAC9D,MAAM,IAAI,CAAC,YAAY,EAAE,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;YACzD,2EAA2E;YAC3E,IAAI,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,OAAO;gBAC5C,MAAM,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;YAChD,qDAAqD;YACrD,kDAAkD;YAClD,qDAAqD;YACrD,oCAAoC;YACpC,oDAAoD;YACpD,8CAA8C;YAC9C,oEAAoE;YACpE,KAAK,MAAM,MAAM,IAAI,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AAO,GAAG,EAAE,CAAC;QACX,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,sBAAsB,CAAC,CAAA;IAC5C,CAAC;IAED,4EAA4E;IAC5E,gEAAgE;IAChE,WAAW,EAAE,CAAA;AACf,CAAC;AAED,+EAA+E;AAC/E,wEAAwE;AACxE,4EAA4E;AAC5E,6EAA6E;AAC7E,gFAAgF;AAChF,wDAAwD;AACxD,SAAS,WAAW;IAClB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,KAAK,CAAA;IACjD,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,qBAAqB,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;IACnF,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;IAC7B,KAAK,CAAC,KAAK,EAAE,CAAA;IACb,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAA;IACpD,KAAK,CAAC,KAAK,EAAE,CAAA;IACb,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAA;AAC/C,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@braidhq/server",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.2.1",
5
5
  "description": "REST + SSE server for Braid.",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -10,57 +10,52 @@
10
10
  "directory": "packages/server"
11
11
  },
12
12
  "exports": {
13
- ".": "./src/index.ts"
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.js"
16
+ }
14
17
  },
15
- "main": "./src/index.ts",
16
- "types": "./src/index.ts",
18
+ "main": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
17
20
  "files": [
18
21
  "README.md",
19
22
  "dist"
20
23
  ],
21
- "scripts": {
22
- "build": "tsc -p tsconfig.json",
23
- "bundle": "node scripts/bundle.mjs",
24
- "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json",
25
- "test": "vitest run",
26
- "test:coverage": "vitest run --coverage",
27
- "dev": "tsx watch src/server.ts",
28
- "clean": "rm -rf dist bundle .turbo *.tsbuildinfo coverage"
29
- },
30
24
  "dependencies": {
31
- "@braidhq/agent-claude-code": "workspace:*",
32
- "@braidhq/core": "workspace:*",
33
- "@braidhq/ontology-ddd": "workspace:*",
34
- "@braidhq/schema": "workspace:*",
35
- "@braidhq/source-loader-gdrive": "workspace:*",
36
- "@braidhq/source-loader-git": "workspace:*",
37
- "@braidhq/source-loader-github": "workspace:*",
38
- "@braidhq/storage-kuzu": "workspace:*",
39
- "@hono/node-server": "^2.0.4",
40
- "@hono/zod-openapi": "^0.19.10",
41
- "@hono/zod-validator": "^0.8.0",
42
- "hono": "^4.12.25",
43
- "pino": "^9.5.0",
25
+ "@hono/node-server": "^2.0.12",
26
+ "@hono/zod-openapi": "^1.5.1",
27
+ "@hono/zod-validator": "^0.9.0",
28
+ "hono": "^4.12.32",
29
+ "pino": "^10.3.1",
44
30
  "simple-git": "^3.36.0",
45
31
  "yaml": "^2.9.0",
46
- "zod": "^3.24.0"
32
+ "zod": "^4.2.1",
33
+ "@braidhq/agent-claude-code": "0.2.1",
34
+ "@braidhq/core": "0.2.1",
35
+ "@braidhq/ontology-ddd": "0.2.1",
36
+ "@braidhq/source-loader-gdrive": "0.2.1",
37
+ "@braidhq/schema": "0.2.1",
38
+ "@braidhq/source-loader-git": "0.2.1",
39
+ "@braidhq/source-loader-github": "0.2.1",
40
+ "@braidhq/storage-kuzu": "0.2.1"
47
41
  },
48
42
  "devDependencies": {
49
- "@braidhq/test-utils": "workspace:*",
50
43
  "esbuild": "^0.28.1",
51
- "tsx": "^4.22.4",
44
+ "tsx": "^4.23.1",
52
45
  "typescript": "^6.0.3",
53
- "vitest": "^4.1.0"
46
+ "vitest": "^4.1.10",
47
+ "@braidhq/test-utils": "0.2.1"
54
48
  },
55
49
  "publishConfig": {
56
- "access": "public",
57
- "main": "./dist/index.js",
58
- "types": "./dist/index.d.ts",
59
- "exports": {
60
- ".": {
61
- "types": "./dist/index.d.ts",
62
- "default": "./dist/index.js"
63
- }
64
- }
50
+ "access": "public"
51
+ },
52
+ "scripts": {
53
+ "build": "tsc -p tsconfig.json",
54
+ "bundle": "node scripts/bundle.mjs",
55
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json",
56
+ "test": "vitest run",
57
+ "test:coverage": "vitest run --coverage",
58
+ "dev": "tsx watch src/server.ts",
59
+ "clean": "rm -rf dist bundle .turbo *.tsbuildinfo coverage"
65
60
  }
66
- }
61
+ }
@@ -1,55 +0,0 @@
1
- import type { AgentPlugin, OntologyPlugin, SourceLoaderPlugin, StoragePlugin } from '@braidhq/core';
2
- import type { AgentEffort, StorageKind } from '@braidhq/schema';
3
- import type { AppDependencies } from './composition.js';
4
- import { AgentKind } from '@braidhq/schema';
5
- export interface ComposeFsOptions {
6
- /** Where to persist registered workspace paths. Default `$BRAID_HOME` or `~/.braid`. */
7
- readonly braidHome?: string;
8
- /** URL the server reports to spawned subprocesses for REST callbacks. */
9
- readonly apiUrl?: string;
10
- /** Coding-agent model selection (default `opus`). */
11
- readonly agentModel?: string;
12
- /** Coding-agent effort tier (default `high`). */
13
- readonly agentEffort?: AgentEffort;
14
- /**
15
- * Graph storage backend kind. Resolved against the StoragePlugin
16
- * registry; default `kuzu`. Set via `BRAID_STORAGE_KIND` env to swap
17
- * (e.g. `neo4j` once `@braidhq/storage-neo4j` is registered).
18
- */
19
- readonly storageKind?: StorageKind;
20
- /** Coding-agent kind to spawn skill subprocesses with. Default `claude-code`. */
21
- readonly agentKind?: AgentKind;
22
- /**
23
- * Extra plugins to register alongside the defaults bundled with this
24
- * composition. The defaults bundle is:
25
- * - storage: `kuzuStoragePlugin`
26
- * - ontology: `dddOntology`
27
- * - source-loader: `gitLoader`, `createGithubLoader()`, `createGoogleDriveLoader()`
28
- * (gdrive throws an actionable error at ingest if OAuth env is missing;
29
- * github falls back to anonymous if `${GH_TOKEN}` is unset, subject to
30
- * the 60 req/h public rate limit)
31
- * - agent: `claudeCodeAgentPlugin`
32
- *
33
- * `composeFsApp` is the opinionated entry that ships with batteries.
34
- * Callers who want a different bundle should use `composeApp` directly
35
- * with their own pluginRegistry.
36
- */
37
- readonly extraStoragePlugins?: readonly StoragePlugin[];
38
- readonly extraOntologyPlugins?: readonly OntologyPlugin[];
39
- readonly extraSourceLoaderPlugins?: readonly SourceLoaderPlugin[];
40
- readonly extraAgentPlugins?: readonly AgentPlugin[];
41
- }
42
- /**
43
- * Opinionated production composition: real filesystem persistence for
44
- * workspaces / proposals / clarify / decisions, built-in skills loaded
45
- * from `@braidhq/core`, and a batteries-included plugin bundle (Kuzu
46
- * storage / DDD ontology / Git+GDrive source loaders / Claude Code
47
- * agent).
48
- *
49
- * To run with a different plugin set, either:
50
- * 1. Pass `extraXxxPlugins` to add alongside defaults + flip `storageKind`
51
- * / `agentKind` to pick a different active one, OR
52
- * 2. Call `composeApp` directly with a `pluginRegistry` you built yourself.
53
- */
54
- export declare function composeFsApp(options?: ComposeFsOptions): Promise<AppDependencies>;
55
- //# sourceMappingURL=composeFs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composeFs.d.ts","sourceRoot":"","sources":["../src/composeFs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AACnG,OAAO,KAAK,EAAgB,WAAW,EAAE,WAAW,EAAe,MAAM,iBAAiB,CAAA;AAC1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAiBvD,OAAO,EAAW,SAAS,EAA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AC,KAAyB;IACzC,IAAI,CAAC,KAAK;QACR,OAAO,SAAS,CAAA;IAClB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IAC3E,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;AAC7C,CAAC;AAED;;;;;;;GAOG;AACH,KAAK,UAAU,SAAS;IACtB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAA;IACxC,MAAM,OAAO,GAAG,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAA;IAC5D,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;QAChE,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAA;QAC7C,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;IACvE,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -1,133 +0,0 @@
1
- import type { BatchPlanRepository, ClarifyTicketRepository, Clock, DecisionRepository, GraphSerializer, IntentLister, ModelRepository, ProposalRepository, RunRepository, SkillRegistry, SkillRunner, SourceUnitDigest, SourceUnitStateRepository, UserDirectory, WorkspaceBootstrap, WorkspaceEventBus, WorkspaceHistory, WorkspaceRepository } from '@braidhq/core';
2
- import type { AbsolutePath } from '@braidhq/schema';
3
- import type { AccessPolicy } from './infrastructure/auth/AccessPolicy.js';
4
- import type { SessionStore } from './infrastructure/auth/SessionStore.js';
5
- import type { WorkspaceRegistryFile } from './infrastructure/fs/WorkspaceRegistryFile.js';
6
- import type { GoogleOAuth } from './infrastructure/oauth/GoogleOAuth.js';
7
- import type { SecretStore } from './infrastructure/secrets/SecretStore.js';
8
- import type { UserRegistryFile } from './infrastructure/users/UserRegistryFile.js';
9
- import { BatchService, HistoryService, HITLService, ModelService, PluginRegistry, SourceLoaderRunner, SourceUnitStateService, ValidationService, WorkspaceService } from '@braidhq/core';
10
- export interface AppDependencies {
11
- workspaceService: WorkspaceService;
12
- hitlService: HITLService;
13
- historyService?: HistoryService;
14
- batchService?: BatchService;
15
- sourceUnitStateService: SourceUnitStateService;
16
- modelService: ModelService;
17
- validationService: ValidationService;
18
- sourceLoaderRunner: SourceLoaderRunner;
19
- eventBus: WorkspaceEventBus;
20
- pluginRegistry: PluginRegistry;
21
- proposalRepository: ProposalRepository;
22
- clarifyRepository: ClarifyTicketRepository;
23
- decisionRepository: DecisionRepository;
24
- modelRepository: ModelRepository;
25
- workspaceRepository: WorkspaceRepository;
26
- skillRegistry: SkillRegistry | undefined;
27
- skillRunner: SkillRunner | undefined;
28
- runRepository: RunRepository;
29
- /**
30
- * Parent directory under which name-based workspaces are scaffolded.
31
- * `POST /workspaces/scaffold { name }` resolves to `<workspacesRoot>/<name>`.
32
- */
33
- workspacesRoot: AbsolutePath;
34
- bootstrap?: WorkspaceBootstrap;
35
- /** OAuth secret storage (file-based; pluggable for hosted deployments). */
36
- secretStore?: SecretStore;
37
- /**
38
- * Google OAuth client. Undefined when env vars aren't set; routes
39
- * respond with 503 in that case.
40
- */
41
- googleOAuth?: GoogleOAuth;
42
- /**
43
- * Server-side user roster (Phase A scaffolding). When absent the
44
- * `/users` route is not mounted; routes that read `c.get('userId')`
45
- * still work because `userIdMiddleware` falls back to `local-user`.
46
- */
47
- userRegistry?: UserRegistryFile;
48
- /**
49
- * Server-side workspace registry — backs the Phase C membership
50
- * model. Required to mount `workspaceAccessMiddleware` and the
51
- * `/workspaces/:id/members` routes; absent in pure in-memory tests
52
- * that don't need member-gating.
53
- */
54
- workspaceRegistry?: WorkspaceRegistryFile;
55
- /**
56
- * Phase B: Bearer-token session backing. Required to mount `/auth/*`
57
- * and the auth middleware. Absent in tests that want the pre-Phase-A
58
- * trusted-network shape (no auth gate).
59
- */
60
- sessionStore?: SessionStore;
61
- /**
62
- * Phase B: Gate-1 allowlist + invite list. Paired with `sessionStore`
63
- * to mount `/auth/*`.
64
- */
65
- accessPolicy?: AccessPolicy;
66
- /**
67
- * Phase B: URL the Studio bundle is served from. OAuth callback
68
- * redirects here with `#token=...` so the SPA can capture the
69
- * session. Defaults to the Vite dev origin in `composeFsApp`.
70
- */
71
- studioUrl?: string;
72
- /**
73
- * Phase B: when true (default in tests / local dev where Google
74
- * OAuth isn't configured), the auth middleware lets every request
75
- * through and `userIdMiddleware`'s fallback (`local-user`) takes
76
- * over. composeFs computes this from the presence of Google OAuth
77
- * env vars; production remote deployments end up with `false` and
78
- * an enforced Bearer-token gate.
79
- */
80
- localTrust: boolean;
81
- clock: Clock;
82
- }
83
- export interface ComposeOptions {
84
- clock?: Clock;
85
- proposalRepository?: ProposalRepository;
86
- clarifyRepository?: ClarifyTicketRepository;
87
- decisionRepository?: DecisionRepository;
88
- modelRepository?: ModelRepository;
89
- workspaceRepository?: WorkspaceRepository;
90
- pluginRegistry?: PluginRegistry;
91
- skillRegistry?: SkillRegistry;
92
- skillRunner?: SkillRunner;
93
- runRepository?: RunRepository;
94
- /**
95
- * Parent dir for name-based scaffold. composeFsApp sets this to
96
- * `<braidHome>/workspaces`; tests using composeApp directly can leave
97
- * it at the default unless they exercise the scaffold endpoint.
98
- */
99
- workspacesRoot?: AbsolutePath;
100
- /**
101
- * Pre-created event bus. Pass the same instance you wired into
102
- * `SubprocessSkillRunner` so subscribers see runner events. Defaults
103
- * to a fresh `InMemoryWorkspaceEventBus` for tests / in-memory boot.
104
- */
105
- eventBus?: WorkspaceEventBus;
106
- history?: WorkspaceHistory;
107
- graphSerializer?: GraphSerializer;
108
- bootstrap?: WorkspaceBootstrap;
109
- batchPlanRepository?: BatchPlanRepository;
110
- intentLister?: IntentLister;
111
- /**
112
- * Persistence for `SourceUnitState`. Defaults to an in-memory impl
113
- * so unit tests of unrelated services keep working without wiring;
114
- * `composeFsApp` swaps in the fs-backed repo.
115
- */
116
- sourceUnitStateRepository?: SourceUnitStateRepository;
117
- /**
118
- * Content fingerprinter for source units. Required for batch / reactor
119
- * / manual extract to record observations. Without it the
120
- * `SourceUnitStateService` falls back to a no-op stub digest that
121
- * throws on use, which is fine for tests that don't exercise observation
122
- * recording but would break production batches.
123
- */
124
- sourceUnitDigest?: SourceUnitDigest;
125
- /**
126
- * Optional read-only user lookup used by HITLService / HistoryService
127
- * to snapshot displayName + email into the git author when committing.
128
- * Tests skip this so the existing `Author: <userId>` shape is preserved.
129
- */
130
- userDirectory?: UserDirectory;
131
- }
132
- export declare function composeApp(options?: ComposeOptions): AppDependencies;
133
- //# sourceMappingURL=composition.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../src/composition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACvB,KAAK,EACL,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,K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