@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
@@ -1,113 +0,0 @@
1
- import { tmpdir } from 'node:os';
2
- import { join } from 'node:path';
3
- import { BatchService, HistoryService, HITLService, ModelService, PerWorkspaceLock, PluginRegistry, SourceLoaderRunner, SourceUnitStateService, SystemClock, ValidationService, WorkspaceService, } from '@braidhq/core';
4
- import { InMemoryClarifyTicketRepository, InMemoryDecisionRepository, InMemoryModelRepository, InMemoryProposalRepository, InMemorySourceUnitStateRepository, InMemoryWorkspaceEventBus, InMemoryWorkspaceRepository, noopRunRepository, } from '@braidhq/core/testing';
5
- export function composeApp(options = {}) {
6
- const clock = options.clock ?? new SystemClock();
7
- const proposalRepository = options.proposalRepository ?? new InMemoryProposalRepository();
8
- const clarifyRepository = options.clarifyRepository ?? new InMemoryClarifyTicketRepository();
9
- const decisionRepository = options.decisionRepository ?? new InMemoryDecisionRepository();
10
- const modelRepository = options.modelRepository ?? new InMemoryModelRepository();
11
- const workspaceRepository = options.workspaceRepository ?? new InMemoryWorkspaceRepository();
12
- const pluginRegistry = options.pluginRegistry ?? new PluginRegistry();
13
- const eventBus = options.eventBus ?? new InMemoryWorkspaceEventBus();
14
- const workspaceService = new WorkspaceService({ workspaceRepository });
15
- const modelService = new ModelService({ modelRepository });
16
- const validationService = new ValidationService({ pluginRegistry });
17
- const sourceLoaderRunner = new SourceLoaderRunner({ pluginRegistry, clock, eventBus });
18
- // Shared lock domain so HITL mutations and history restore exclude each other.
19
- const workspaceLock = new PerWorkspaceLock();
20
- const hitlService = new HITLService({
21
- proposalRepository,
22
- clarifyRepository,
23
- decisionRepository,
24
- modelRepository,
25
- validationService,
26
- workspaceService,
27
- clock,
28
- eventBus,
29
- workspaceLock,
30
- ...(options.history ? { history: options.history } : {}),
31
- ...(options.graphSerializer ? { graphSerializer: options.graphSerializer } : {}),
32
- ...(options.userDirectory ? { userDirectory: options.userDirectory } : {}),
33
- });
34
- const historyService = options.history && options.bootstrap
35
- ? new HistoryService({
36
- history: options.history,
37
- workspaceService,
38
- workspaceLock,
39
- bootstrap: options.bootstrap,
40
- runRepository: options.runRepository ?? noopRunRepository,
41
- ...(options.skillRunner ? { skillRunner: options.skillRunner } : {}),
42
- ...(options.userDirectory ? { userDirectory: options.userDirectory } : {}),
43
- eventBus,
44
- clock,
45
- })
46
- : undefined;
47
- const sourceUnitStateRepository = options.sourceUnitStateRepository ?? new InMemorySourceUnitStateRepository();
48
- const sourceUnitDigest = options.sourceUnitDigest ?? new FailingSourceUnitDigest();
49
- const sourceUnitStateService = new SourceUnitStateService({
50
- repository: sourceUnitStateRepository,
51
- digest: sourceUnitDigest,
52
- workspaceService,
53
- clock,
54
- });
55
- // Batch needs SkillRunner + HistoryService + BatchPlanRepository + intent lister; otherwise no batch surface.
56
- const batchService = historyService && options.skillRunner && options.batchPlanRepository && options.intentLister
57
- ? new BatchService({
58
- workspaceService,
59
- skillRunner: options.skillRunner,
60
- proposalRepository,
61
- clarifyRepository,
62
- historyService,
63
- hitlService,
64
- batchPlanRepository: options.batchPlanRepository,
65
- intentLister: options.intentLister,
66
- pluginRegistry,
67
- eventBus,
68
- workspaceLock,
69
- clock,
70
- sourceUnitStateService,
71
- })
72
- : undefined;
73
- return {
74
- workspaceService,
75
- hitlService,
76
- ...(historyService ? { historyService } : {}),
77
- ...(batchService ? { batchService } : {}),
78
- ...(options.bootstrap ? { bootstrap: options.bootstrap } : {}),
79
- sourceUnitStateService,
80
- modelService,
81
- validationService,
82
- sourceLoaderRunner,
83
- eventBus,
84
- pluginRegistry,
85
- proposalRepository,
86
- clarifyRepository,
87
- decisionRepository,
88
- modelRepository,
89
- workspaceRepository,
90
- skillRegistry: options.skillRegistry,
91
- skillRunner: options.skillRunner,
92
- runRepository: options.runRepository ?? noopRunRepository,
93
- workspacesRoot: options.workspacesRoot ?? join(tmpdir(), 'braid-workspaces'),
94
- // `composeApp` is the test / in-memory composition entry. It never
95
- // wires sessionStore, so the auth middleware in `createApp` is
96
- // skipped anyway — but explicit `localTrust: true` keeps the
97
- // contract honest if a test does happen to pass sessionStore.
98
- localTrust: true,
99
- clock,
100
- };
101
- }
102
- /**
103
- * Default `SourceUnitDigest` for in-memory `composeApp()` callers. Any
104
- * call throws — production must wire a real impl via `composeFsApp` or
105
- * pass one explicitly; tests that don't exercise observations stay
106
- * happy because the digest is never reached.
107
- */
108
- class FailingSourceUnitDigest {
109
- async computeSha() {
110
- throw new Error('SourceUnitDigest is not wired. Pass `sourceUnitDigest` to composeApp() (composeFsApp does this automatically).');
111
- }
112
- }
113
- //# sourceMappingURL=composition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composition.js","sourceRoot":"","sources":["../src/composition.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EACL,YAAY,EACZ,cAAc,EACd,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,+BAA+B,EAC/B,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,iCAAiC,EACjC,yBAAyB,EACzB,2BA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,+DAA+D;QAC/D,6DAA6D;QAC7D,8DAA8D;QAC9D,UAAU,EAAE,IAAI;QAChB,KAAK;KACN,CAAA;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,uBAAuB;IAC3B,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,KAAK,CACb,gHAAgH,CACjH,CAAA;IACH,CAAC;CACF"}
@@ -1,75 +0,0 @@
1
- import type { AgentBinding, RunRepository, SkillEventListener, SkillRegistry, SkillRunner, SkillRunOptions, SkillRunSubscription, Workspace, WorkspaceEventBus } from '@braidhq/core';
2
- import type { AbsolutePath, SkillId, SkillRunId } from '@braidhq/schema';
3
- import type { ChildProcess, SpawnOptions } from 'node:child_process';
4
- export type SpawnFn = (command: string, args: readonly string[], options: SpawnOptions) => ChildProcess;
5
- /**
6
- * Additional directories to expose under the session's `.claude/skills/`
7
- * tree. Typically used for non-skill reference content (e.g. `shared/`
8
- * that builtin SKILL.md files reference via `.claude/skills/shared/...`).
9
- */
10
- export interface SkillReferenceDir {
11
- readonly name: string;
12
- readonly path: AbsolutePath;
13
- }
14
- export interface SubprocessSkillRunnerDeps {
15
- readonly skillRegistry: SkillRegistry;
16
- readonly agentBinding: AgentBinding;
17
- readonly apiUrl: string;
18
- /** Required: runs persist their event log here as the source of truth for replays. */
19
- readonly runRepository: RunRepository;
20
- readonly spawn?: SpawnFn;
21
- readonly clock?: () => string;
22
- /** Extra directories symlinked alongside skills (e.g. shared reference docs). */
23
- readonly referenceDirs?: readonly SkillReferenceDir[];
24
- /** Delete the per-run session directory after the run. Default `true`. */
25
- readonly cleanupSession?: boolean;
26
- /**
27
- * Enables the built-in `braid-core` MCP gateway. When set, every
28
- * spawned skill receives a stdio MCP server entry that runs
29
- * `<uvxBin> openapi-mcp-gateway --spec <specUrl> --transport stdio`
30
- * — claude spawns the gateway as a per-session child, the gateway
31
- * fetches the OpenAPI spec from `specUrl`, and the REST surface is
32
- * exposed as MCP tools (`braid_search_nodes`,
33
- * `braid_submit_proposal`, …).
34
- *
35
- * `specUrl` is typically `${apiUrl}/openapi.json`. `uvxBin` defaults
36
- * to `'uvx'` (resolved against PATH); composeFs preflight-checks for
37
- * its presence at boot.
38
- *
39
- * Leave undefined to skip the entry entirely (skills with
40
- * `requiredMcpServers: ['braid-core']` will then surface as
41
- * not-ready via SkillManifest.readinessIssuesFor).
42
- */
43
- readonly coreGateway?: {
44
- readonly specUrl: string;
45
- readonly uvxBin?: string;
46
- };
47
- /**
48
- * Optional pub/sub for workspace-scoped notifications. Used by Studio
49
- * to invalidate run / proposal lists in real time without polling.
50
- * Tests can leave this undefined.
51
- */
52
- readonly eventBus?: WorkspaceEventBus;
53
- }
54
- export declare class SubprocessSkillRunner implements SkillRunner {
55
- private readonly deps;
56
- private readonly running;
57
- /** sessionId → cwd for resuming. claude needs the same cwd between turns. */
58
- private readonly sessionDirs;
59
- private readonly subscribers;
60
- /** How many events have been emitted (and persisted) per run so far. */
61
- private readonly positions;
62
- constructor(deps: SubprocessSkillRunnerDeps);
63
- start(workspace: Workspace, skillId: SkillId, args: string, options?: SkillRunOptions): Promise<SkillRunId>;
64
- subscribe(runId: SkillRunId, listener: SkillEventListener): SkillRunSubscription;
65
- isActive(runId: SkillRunId): boolean;
66
- cancel(runId: SkillRunId): Promise<void>;
67
- forgetSession(sessionId: string): Promise<void>;
68
- private drain;
69
- private emit;
70
- private resolveSessionDir;
71
- private recoverSessionDir;
72
- private buildSessionDir;
73
- private now;
74
- }
75
- //# sourceMappingURL=SubprocessSkillRunner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SubprocessSkillRunner.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/agent/SubprocessSkillRunner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,SAAS,EACT,iBAAiB,EAClB,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,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,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAA;IAChE,CAAC;CACF;AAED,KAAK,UAAU,YAAY;IACzB,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC9C,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,OAAO,CAAC,CAAA;AAC3E,CAAC"}
@@ -1,22 +0,0 @@
1
- /**
2
- * Single-producer / single-consumer async queue backing an `AsyncIterable`.
3
- *
4
- * Used to bridge node `EventEmitter`-style callbacks (which fire whenever
5
- * subprocess stdout / stderr / close events arrive) into `for await … of`
6
- * consumers (Hono's SSE writer, vitest assertions) without buffering every
7
- * event until the producer is done.
8
- *
9
- * Contract:
10
- * - `push(item)` enqueues an item and wakes a pending consumer.
11
- * - `end()` signals that no more items are coming; the iterator finishes
12
- * once it has drained the queue.
13
- * - `iterate()` returns a single-use async generator. Calling it more than
14
- * once is undefined.
15
- */
16
- export interface AsyncQueue<T> {
17
- push: (item: T) => void;
18
- end: () => void;
19
- iterate: () => AsyncGenerator<T>;
20
- }
21
- export declare function createAsyncQueue<T>(): AsyncQueue<T>;
22
- //# sourceMappingURL=asyncQueue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"asyncQueue.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/agent/asyncQueue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAA;IACvB,GAAG,EAAE,MAAM,IAAI,CAAA;IACf,OAAO,EAAE,MAAM,cAAc,CAAC,CAAC,CAAC,CAAA;CACjC;AAED,wBAAgB,gBAAgB,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CA2CnD"}
@@ -1,38 +0,0 @@
1
- import type { Workspace } from '@braidhq/core';
2
- import type { McpServerConfig } from '@braidhq/schema';
3
- export interface McpConfigFile {
4
- readonly mcpServers: Readonly<Record<string, McpServerEntry>>;
5
- }
6
- /**
7
- * Shape claude expects in `--mcp-config <file>`.
8
- *
9
- * The Streamable HTTP transport is `type: 'http'` (the claude CLI's
10
- * legacy name; predates the rename in the MCP 2025-06-18 spec). We
11
- * use the new name in PRODUCT.md to match the spec and emit the
12
- * legacy name here so claude understands.
13
- */
14
- interface McpStreamableHttpEntry {
15
- readonly type: 'http';
16
- readonly url: string;
17
- readonly headers?: Record<string, string>;
18
- }
19
- interface McpStdioEntry {
20
- readonly type: 'stdio';
21
- readonly command: string;
22
- readonly args?: readonly string[];
23
- readonly env?: Record<string, string>;
24
- }
25
- type McpServerEntry = McpStreamableHttpEntry | McpStdioEntry;
26
- export interface BuildMcpConfigOptions {
27
- /**
28
- * Extra MCP server entries injected on top of the workspace's own
29
- * `mcpServers`. Used to wire the built-in `braid-core` gateway —
30
- * see `SubprocessSkillRunner`. Workspace entries with the same id
31
- * take precedence (so a workspace can override a built-in).
32
- */
33
- extraServers?: readonly McpServerConfig[];
34
- }
35
- export declare function buildMcpConfig(workspace: Workspace, options?: BuildMcpConfigOptions): McpConfigFile;
36
- export declare function writeMcpConfigFile(workspace: Workspace, targetDir: string, options?: BuildMcpConfigOptions): Promise<string>;
37
- export {};
38
- //# sourceMappingURL=mcpConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcpConfig.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/agent/mcpConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAKtD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAA;CAC9D;AAED;;;;;;;GAOG;AACH,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC1C;AAED,UAAU,aAAa;IACrB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACtC;AAED,KAAK,cAAc,GAAG,sBAAsB,GAAG,aAAa,CAAA;AAE5D,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,eAAe,EAAE,CAAA;CAC1C;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,GAAE,qBAA0B,GAAG,aAAa,CASvG;AAED,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,MAAM,CAAC,CAMjB"}
@@ -1,55 +0,0 @@
1
- import { mkdir, writeFile } from 'node:fs/promises';
2
- import { dirname, join } from 'node:path';
3
- import process from 'node:process';
4
- export function buildMcpConfig(workspace, options = {}) {
5
- const entries = {};
6
- for (const server of options.extraServers ?? []) {
7
- entries[server.id] = toEntry(server);
8
- }
9
- for (const server of workspace.mcpServers) {
10
- entries[server.id] = toEntry(server);
11
- }
12
- return { mcpServers: entries };
13
- }
14
- export async function writeMcpConfigFile(workspace, targetDir, options = {}) {
15
- const config = buildMcpConfig(workspace, options);
16
- const targetPath = join(targetDir, `.braid-mcp-${workspace.id}.json`);
17
- await mkdir(dirname(targetPath), { recursive: true });
18
- await writeFile(targetPath, `${JSON.stringify(config, null, 2)}\n`, 'utf-8');
19
- return targetPath;
20
- }
21
- function toEntry(server) {
22
- if (server.transport === 'stdio') {
23
- return {
24
- type: 'stdio',
25
- command: server.command,
26
- ...(server.args ? { args: [...server.args] } : {}),
27
- ...(server.env ? { env: resolveEnv(server.env) } : {}),
28
- };
29
- }
30
- return {
31
- type: 'http',
32
- url: server.url,
33
- ...(server.headers ? { headers: resolveEnv(server.headers) } : {}),
34
- };
35
- }
36
- /**
37
- * Replace `${VAR}` references in header / env values with the matching
38
- * parent-process env var. Throws if a referenced var is missing so the
39
- * user gets a clear error at config-write time rather than a confusing
40
- * 401 from the MCP server or a silently-misconfigured subprocess.
41
- */
42
- function resolveEnv(values) {
43
- const out = {};
44
- for (const [name, value] of Object.entries(values)) {
45
- out[name] = value.replace(/\$\{([A-Z_][A-Z0-9_]*)\}/g, (_match, varName) => {
46
- const resolved = process.env[varName];
47
- if (resolved === undefined) {
48
- throw new Error(`MCP entry "${name}": environment variable "${varName}" is not set`);
49
- }
50
- return resolved;
51
- });
52
- }
53
- return out;
54
- }
55
- //# sourceMappingURL=mcpConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcpConfig.js","sourceRoot":"","sources":["../../../src/infrastructure/agent/mcpConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,OAAO,MAAM,cAAc,CAAA;AAuClC,MAAM,UAAU,cAAc,CAAC,SAAoB,EAAE,UAAiC,EAAE;IACtF,MAAM,OAAO,GAAmC,EAAE,CAAA;IAClD,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,YAAY,IAAI,EAAE,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AAC,CAAC,CAAC,EAAE,CAAC;SACvD,CAAA;IACH,CAAC;IACD,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnE,CAAA;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,UAAU,CAAC,MAA8B;IAChD,MAAM,GAAG,GAA2B,EAAE,CAAA;IACtC,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,2BAA2B,EAAE,CAAC,MAAM,EAAE,OAAe,EAAE,EAAE;YACjF,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YACrC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC3B,MAAM,IAAI,KAAK,CAAC,cAAc,IAAI,4BAA4B,OAAO,cAAc,CAAC,CAAA;YACtF,CAAC;YACD,OAAO,QAAQ,CAAA;QACjB,CAAC,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
@@ -1,20 +0,0 @@
1
- export type LineHandler = (line: string) => void;
2
- /**
3
- * Splits a chunked text stream into newline-delimited lines, invoking the
4
- * handler exactly once per complete line. Partial lines are buffered until
5
- * the next chunk completes them. Call `flush()` after the source closes to
6
- * release any trailing line without a terminator.
7
- */
8
- export declare class LineBuffer {
9
- private readonly onLine;
10
- private buffer;
11
- constructor(onLine: LineHandler);
12
- append(chunk: string): void;
13
- flush(): void;
14
- }
15
- export interface StreamJsonEvent {
16
- readonly type: string;
17
- readonly [key: string]: unknown;
18
- }
19
- export declare function parseJsonLine(line: string): StreamJsonEvent | undefined;
20
- //# sourceMappingURL=streamJsonParser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"streamJsonParser.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/agent/streamJsonParser.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;AAEhD;;;;;GAKG;AACH,qBAAa,UAAU;IAGT,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,MAAM,CAAK;gBAEU,MAAM,EAAE,WAAW;IAEhD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAY3B,KAAK,IAAI,IAAI;CAOd;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAChC;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAWvE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"streamJsonParser.js","sourceRoot":"","sources":["../../../src/infrastructure/agent/streamJsonParser.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,OAAO,UAAU;IAGQ;IAFrB,MAAM,GAAG,EAAE,CAAA;IAEnB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,MAAM,CAAC,KAAa;QAClB,IAAI,CAAC,MAAM,IAAI,KAAK,CAAA;QACpB,IAAI,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC5C,OAAO,YAAY,IAAI,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAA;YAC/C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,CAAA;YACjD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;gBACjB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YACnB,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC1C,CAAC;IACH,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YAC1B,OAAM;QACR,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAA;QAC7B,IAAI,CAAC,MAAM,GAAG,EAAE,CAAA;QAChB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IACxB,CAAC;CACF;AAOD,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IAC3B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QACtB,OAAO,SAAS,CAAA;IAClB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAoB,CAAA;QACrD,OAAO,MAAM,CAAA;IACf,CAAC;IACD,MAAM,CAAC;QACL,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC"}
@@ -1,26 +0,0 @@
1
- import type { SkillEvent } from '@braidhq/schema';
2
- import type { ChildProcess } from 'node:child_process';
3
- interface RawEvent {
4
- readonly type: string;
5
- readonly [key: string]: unknown;
6
- }
7
- /**
8
- * Wires a child's stdout / stderr to a single SkillEvent callback.
9
- * Returns `flush` so callers can drain the final un-terminated line on
10
- * `close`.
11
- */
12
- export declare function attachOutputBuffers(child: ChildProcess, onEvent: (event: SkillEvent) => void, now: () => string): {
13
- flush: () => void;
14
- };
15
- /**
16
- * Maps a single `claude --output-format stream-json` line into zero or more
17
- * `SkillEvent`s. Claude emits these envelope shapes today: `system` (init
18
- * meta, ignored except for `session_id`), `assistant` (text / tool_use
19
- * content parts), `user` (echoed tool_result, only `is_error` surfaced),
20
- * `rate_limit_*` (ignored), `result` (final outcome). Legacy flat shapes
21
- * (`text`, `tool_use`, `artifact-written`, `error`) are kept for tests and
22
- * older tools.
23
- */
24
- export declare function mapSubprocessEvents(raw: RawEvent, now: string): SkillEvent[];
25
- export {};
26
- //# sourceMappingURL=subprocessEventStream.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subprocessEventStream.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/agent/subprocessEventStream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAItD,UAAU,QAAQ;IAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE;AAG7E;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,EACpC,GAAG,EAAE,MAAM,MAAM,GAChB;IAAE,KAAK,EAAE,MAAM,IAAI,CAAA;CAAE,CAyBvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,EAAE,CAyE5E"}
@@ -1,112 +0,0 @@
1
- import { SkillEvent as SkillEventSchema } from '@braidhq/schema';
2
- import { LineBuffer, parseJsonLine } from './streamJsonParser.js';
3
- /**
4
- * Wires a child's stdout / stderr to a single SkillEvent callback.
5
- * Returns `flush` so callers can drain the final un-terminated line on
6
- * `close`.
7
- */
8
- export function attachOutputBuffers(child, onEvent, now) {
9
- const stdout = new LineBuffer((line) => {
10
- const parsed = parseJsonLine(line);
11
- if (parsed === undefined)
12
- return;
13
- for (const event of mapSubprocessEvents(parsed, now()))
14
- onEvent(event);
15
- });
16
- // stderr is wrapped verbatim into a `[stderr]` message event so it
17
- // shows up in the transcript alongside model output.
18
- const stderr = new LineBuffer((line) => {
19
- onEvent(SkillEventSchema.parse({ type: 'message', text: `[stderr] ${line}` }));
20
- });
21
- child.stdout?.setEncoding('utf-8');
22
- child.stdout?.on('data', (chunk) => stdout.append(chunk));
23
- child.stderr?.setEncoding('utf-8');
24
- child.stderr?.on('data', (chunk) => stderr.append(chunk));
25
- return {
26
- flush: () => {
27
- stdout.flush();
28
- stderr.flush();
29
- },
30
- };
31
- }
32
- /**
33
- * Maps a single `claude --output-format stream-json` line into zero or more
34
- * `SkillEvent`s. Claude emits these envelope shapes today: `system` (init
35
- * meta, ignored except for `session_id`), `assistant` (text / tool_use
36
- * content parts), `user` (echoed tool_result, only `is_error` surfaced),
37
- * `rate_limit_*` (ignored), `result` (final outcome). Legacy flat shapes
38
- * (`text`, `tool_use`, `artifact-written`, `error`) are kept for tests and
39
- * older tools.
40
- */
41
- export function mapSubprocessEvents(raw, now) {
42
- const out = [];
43
- if (raw.type === 'system' && raw.subtype === 'init' && typeof raw.session_id === 'string') {
44
- out.push(SkillEventSchema.parse({ type: 'session-started', sessionId: raw.session_id }));
45
- return out;
46
- }
47
- if (raw.type === 'assistant') {
48
- for (const part of readContent(raw)) {
49
- if (part?.type === 'text' && typeof part.text === 'string' && part.text.length > 0) {
50
- out.push(SkillEventSchema.parse({ type: 'message', text: part.text }));
51
- }
52
- else if (part?.type === 'tool_use' && typeof part.name === 'string') {
53
- const event = {
54
- type: 'tool-call',
55
- tool: part.name,
56
- args: part.input ?? null,
57
- };
58
- if (typeof part.id === 'string' && part.id.length > 0)
59
- event.toolCallId = part.id;
60
- out.push(SkillEventSchema.parse(event));
61
- }
62
- }
63
- return out;
64
- }
65
- if (raw.type === 'user') {
66
- for (const part of readContent(raw)) {
67
- if (part?.type === 'tool_result' && typeof part.tool_use_id === 'string') {
68
- const output = typeof part.content === 'string'
69
- ? part.content
70
- : JSON.stringify(part.content ?? '');
71
- out.push(SkillEventSchema.parse({
72
- type: 'tool-result',
73
- toolCallId: part.tool_use_id,
74
- output,
75
- isError: part.is_error === true,
76
- }));
77
- }
78
- }
79
- return out;
80
- }
81
- if (raw.type === 'result') {
82
- const isError = raw.is_error === true;
83
- const text = typeof raw.result === 'string' ? raw.result : '';
84
- if (isError)
85
- out.push(SkillEventSchema.parse({ type: 'error', message: text || 'skill run failed', at: now }));
86
- else if (text.length > 0)
87
- out.push(SkillEventSchema.parse({ type: 'message', text }));
88
- return out;
89
- }
90
- if (raw.type === 'text' && typeof raw.text === 'string')
91
- return [SkillEventSchema.parse({ type: 'message', text: raw.text })];
92
- if (raw.type === 'tool_use' && typeof raw.name === 'string')
93
- return [SkillEventSchema.parse({ type: 'tool-call', tool: raw.name, args: raw.input ?? null })];
94
- if (raw.type === 'artifact-written' && typeof raw.artifactKind === 'string') {
95
- return [SkillEventSchema.parse({
96
- type: 'artifact-written',
97
- artifactKind: raw.artifactKind,
98
- artifactId: raw.artifactId,
99
- path: raw.path,
100
- })];
101
- }
102
- if (raw.type === 'error' && typeof raw.message === 'string')
103
- return [SkillEventSchema.parse({ type: 'error', message: raw.message, at: now })];
104
- return out;
105
- }
106
- function readContent(raw) {
107
- const message = raw.message;
108
- if (!message || !Array.isArray(message.content))
109
- return [];
110
- return message.content;
111
- }
112
- //# sourceMappingURL=subprocessEventStream.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subprocessEventStream.js","sourceRoot":"","sources":["../../../src/infrastructure/agent/subprocessEventStream.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAKjE;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAmB,EACnB,OAAoC,EACpC,GAAiB;IAEjB,MAAM,MAAM,GAAG,IAAI,UAAU,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C,OAAO,CAAC,OAAO,CAAC;QAC7C,OAAO,EAAE,CAAA;IACX,OAAO,OAAO,CAAC,OAA2B,CAAA;AAC5C,CAAC"}
@@ -1,16 +0,0 @@
1
- import type { UserRegistryFile } from '../users/UserRegistryFile.js';
2
- import type { AccessPolicy } from './AccessPolicy.js';
3
- /**
4
- * Back-fills `approvedEmails` from existing users.json entries.
5
- *
6
- * Without this, accounts created before the approvedEmails feature
7
- * existed (or while the invite-was-consumed bug was live) would be
8
- * stuck behind Gate-1 even though they hold a valid user record. Every
9
- * email we see in the registry must be persistently approved going
10
- * forward; this is the one-shot reconciliation.
11
- *
12
- * Idempotent: AccessPolicy.approveEmail no-ops when the email is
13
- * already there, so re-running on every boot is cheap.
14
- */
15
- export declare function ensureApprovedEmails(userRegistry: UserRegistryFile, accessPolicy: AccessPolicy): Promise<void>;
16
- //# sourceMappingURL=ensureApprovedEmails.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ensureApprovedEmails.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/auth/ensureApprovedEmails.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,IAAI,CAAC,CAMf"}
@@ -1,20 +0,0 @@
1
- /**
2
- * Back-fills `approvedEmails` from existing users.json entries.
3
- *
4
- * Without this, accounts created before the approvedEmails feature
5
- * existed (or while the invite-was-consumed bug was live) would be
6
- * stuck behind Gate-1 even though they hold a valid user record. Every
7
- * email we see in the registry must be persistently approved going
8
- * forward; this is the one-shot reconciliation.
9
- *
10
- * Idempotent: AccessPolicy.approveEmail no-ops when the email is
11
- * already there, so re-running on every boot is cheap.
12
- */
13
- export async function ensureApprovedEmails(userRegistry, accessPolicy) {
14
- const users = await userRegistry.list();
15
- for (const user of users) {
16
- if (user.email)
17
- await accessPolicy.approveEmail(user.email);
18
- }
19
- }
20
- //# sourceMappingURL=ensureApprovedEmails.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ensureApprovedEmails.js","sourceRoot":"","sources":["../../../src/infrastructure/auth/ensureApprovedEmails.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,YAA8B,EAC9B,YAA0B;IAE1B,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,CAAA;IACvC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,KAAK;YACZ,MAAM,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC/C,CAAC;AACH,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Parse a boolean env var. Canonical form is `true` / `false`; we also
3
- * accept the common YAML / shell idioms (`yes` / `no`, `on` / `off`,
4
- * `1` / `0`) so existing `.env` files don't break on the rename.
5
- *
6
- * Returns `defaultValue` when the variable is unset or the literal is
7
- * unrecognised (silent fall-through — we don't want a typo in env to
8
- * crash the server boot).
9
- */
10
- export declare function parseBoolEnv(value: string | undefined, defaultValue: boolean): boolean;
11
- //# sourceMappingURL=env.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/infrastructure/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAStF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/infrastructure/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,KAAyB,EAAE,YAAqB;IAC3E,IAAI,KAAK,KAAK,SAAS;QACrB,OAAO,YAAY,CAAA;IACrB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IACxC,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,IAAI;QACxE,OAAO,IAAI,CAAA;IACb,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK;QACzE,OAAO,KAAK,CAAA;IACd,OAAO,YAAY,CAAA;AACrB,CAAC"}