@braidhq/server 0.0.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. package/README.md +164 -0
  2. package/dist/app.d.ts +12 -3
  3. package/dist/app.d.ts.map +1 -1
  4. package/dist/app.js +154 -9
  5. package/dist/app.js.map +1 -1
  6. package/dist/authMode.d.ts +39 -0
  7. package/dist/authMode.d.ts.map +1 -0
  8. package/dist/authMode.js +50 -0
  9. package/dist/authMode.js.map +1 -0
  10. package/dist/composeApp.d.ts +79 -0
  11. package/dist/composeApp.d.ts.map +1 -0
  12. package/dist/composeApp.js +136 -0
  13. package/dist/composeApp.js.map +1 -0
  14. package/dist/composeFsApp.d.ts +27 -0
  15. package/dist/composeFsApp.d.ts.map +1 -0
  16. package/dist/composeFsApp.js +309 -0
  17. package/dist/composeFsApp.js.map +1 -0
  18. package/dist/index.d.ts +3 -2
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +3 -2
  21. package/dist/index.js.map +1 -1
  22. package/dist/infrastructure/_shared/env.d.ts +10 -0
  23. package/dist/infrastructure/_shared/env.d.ts.map +1 -0
  24. package/dist/infrastructure/_shared/env.js +19 -0
  25. package/dist/infrastructure/_shared/env.js.map +1 -0
  26. package/dist/infrastructure/_shared/frontmatter.d.ts +13 -0
  27. package/dist/infrastructure/_shared/frontmatter.d.ts.map +1 -0
  28. package/dist/infrastructure/{fs → _shared}/frontmatter.js +5 -5
  29. package/dist/infrastructure/_shared/frontmatter.js.map +1 -0
  30. package/dist/infrastructure/_shared/jsonFileStore.d.ts.map +1 -0
  31. package/dist/infrastructure/_shared/jsonFileStore.js.map +1 -0
  32. package/dist/infrastructure/_shared/paths.d.ts +43 -0
  33. package/dist/infrastructure/_shared/paths.d.ts.map +1 -0
  34. package/dist/infrastructure/_shared/paths.js +96 -0
  35. package/dist/infrastructure/_shared/paths.js.map +1 -0
  36. package/dist/infrastructure/auth/AccessPolicy.d.ts +87 -0
  37. package/dist/infrastructure/auth/AccessPolicy.d.ts.map +1 -0
  38. package/dist/infrastructure/auth/AccessPolicy.js +177 -0
  39. package/dist/infrastructure/auth/AccessPolicy.js.map +1 -0
  40. package/dist/infrastructure/auth/SessionStore.d.ts +50 -0
  41. package/dist/infrastructure/auth/SessionStore.d.ts.map +1 -0
  42. package/dist/infrastructure/auth/SessionStore.js +104 -0
  43. package/dist/infrastructure/auth/SessionStore.js.map +1 -0
  44. package/dist/infrastructure/batch/FsBatchPlanRepository.d.ts +79 -0
  45. package/dist/infrastructure/batch/FsBatchPlanRepository.d.ts.map +1 -0
  46. package/dist/infrastructure/batch/FsBatchPlanRepository.js +42 -0
  47. package/dist/infrastructure/batch/FsBatchPlanRepository.js.map +1 -0
  48. package/dist/infrastructure/history/GitWorkspaceHistory.d.ts +18 -0
  49. package/dist/infrastructure/history/GitWorkspaceHistory.d.ts.map +1 -0
  50. package/dist/infrastructure/history/GitWorkspaceHistory.js +310 -0
  51. package/dist/infrastructure/history/GitWorkspaceHistory.js.map +1 -0
  52. package/dist/infrastructure/history/commitMessage.d.ts +4 -0
  53. package/dist/infrastructure/history/commitMessage.d.ts.map +1 -0
  54. package/dist/infrastructure/history/commitMessage.js +90 -0
  55. package/dist/infrastructure/history/commitMessage.js.map +1 -0
  56. package/dist/infrastructure/hitl/FsClarificationRepository.d.ts +13 -0
  57. package/dist/infrastructure/hitl/FsClarificationRepository.d.ts.map +1 -0
  58. package/dist/infrastructure/hitl/FsClarificationRepository.js +39 -0
  59. package/dist/infrastructure/hitl/FsClarificationRepository.js.map +1 -0
  60. package/dist/infrastructure/hitl/FsProposalRepository.d.ts.map +1 -0
  61. package/dist/infrastructure/{fs → hitl}/FsProposalRepository.js +10 -3
  62. package/dist/infrastructure/hitl/FsProposalRepository.js.map +1 -0
  63. package/dist/infrastructure/hitl/StatusedJsonStore.d.ts +30 -0
  64. package/dist/infrastructure/hitl/StatusedJsonStore.d.ts.map +1 -0
  65. package/dist/infrastructure/{fs/FsStatusedJsonRepository.js → hitl/StatusedJsonStore.js} +3 -3
  66. package/dist/infrastructure/hitl/StatusedJsonStore.js.map +1 -0
  67. package/dist/infrastructure/model/FsModelSerializer.d.ts +96 -0
  68. package/dist/infrastructure/model/FsModelSerializer.d.ts.map +1 -0
  69. package/dist/infrastructure/model/FsModelSerializer.js +60 -0
  70. package/dist/infrastructure/model/FsModelSerializer.js.map +1 -0
  71. package/dist/infrastructure/oauth/GoogleOAuth.d.ts +43 -14
  72. package/dist/infrastructure/oauth/GoogleOAuth.d.ts.map +1 -1
  73. package/dist/infrastructure/oauth/GoogleOAuth.js +78 -11
  74. package/dist/infrastructure/oauth/GoogleOAuth.js.map +1 -1
  75. package/dist/infrastructure/reactor/FsReactorCycleRepository.d.ts +29 -0
  76. package/dist/infrastructure/reactor/FsReactorCycleRepository.d.ts.map +1 -0
  77. package/dist/infrastructure/reactor/FsReactorCycleRepository.js +94 -0
  78. package/dist/infrastructure/reactor/FsReactorCycleRepository.js.map +1 -0
  79. package/dist/infrastructure/secrets/SecretStore.d.ts +11 -14
  80. package/dist/infrastructure/secrets/SecretStore.d.ts.map +1 -1
  81. package/dist/infrastructure/secrets/SecretStore.js +4 -4
  82. package/dist/infrastructure/secrets/SecretStore.js.map +1 -1
  83. package/dist/infrastructure/{fs → skill}/FsRunRepository.d.ts +9 -4
  84. package/dist/infrastructure/skill/FsRunRepository.d.ts.map +1 -0
  85. package/dist/infrastructure/skill/FsRunRepository.js +162 -0
  86. package/dist/infrastructure/skill/FsRunRepository.js.map +1 -0
  87. package/dist/infrastructure/{fs → skill}/FsSkillRegistry.d.ts +4 -13
  88. package/dist/infrastructure/skill/FsSkillRegistry.d.ts.map +1 -0
  89. package/dist/infrastructure/{fs → skill}/FsSkillRegistry.js +38 -18
  90. package/dist/infrastructure/skill/FsSkillRegistry.js.map +1 -0
  91. package/dist/infrastructure/{agent → skill}/SubprocessSkillRunner.d.ts +13 -15
  92. package/dist/infrastructure/skill/SubprocessSkillRunner.d.ts.map +1 -0
  93. package/dist/infrastructure/{agent → skill}/SubprocessSkillRunner.js +124 -40
  94. package/dist/infrastructure/skill/SubprocessSkillRunner.js.map +1 -0
  95. package/dist/infrastructure/skill/asyncQueue.d.ts +20 -0
  96. package/dist/infrastructure/skill/asyncQueue.d.ts.map +1 -0
  97. package/dist/infrastructure/{agent → skill}/asyncQueue.js +2 -3
  98. package/dist/infrastructure/{agent → skill}/asyncQueue.js.map +1 -1
  99. package/dist/infrastructure/skill/lineBuffer.d.ts +15 -0
  100. package/dist/infrastructure/skill/lineBuffer.d.ts.map +1 -0
  101. package/dist/infrastructure/{agent/streamJsonParser.js → skill/lineBuffer.js} +5 -17
  102. package/dist/infrastructure/skill/lineBuffer.js.map +1 -0
  103. package/dist/infrastructure/skill/orphanReaper.d.ts +20 -0
  104. package/dist/infrastructure/skill/orphanReaper.d.ts.map +1 -0
  105. package/dist/infrastructure/{orphanReaper.js → skill/orphanReaper.js} +7 -5
  106. package/dist/infrastructure/skill/orphanReaper.js.map +1 -0
  107. package/dist/infrastructure/skill/subprocessEventStream.d.ts +16 -0
  108. package/dist/infrastructure/skill/subprocessEventStream.d.ts.map +1 -0
  109. package/dist/infrastructure/skill/subprocessEventStream.js +29 -0
  110. package/dist/infrastructure/skill/subprocessEventStream.js.map +1 -0
  111. package/dist/infrastructure/source/FsSourceUnitDigest.d.ts +19 -0
  112. package/dist/infrastructure/source/FsSourceUnitDigest.d.ts.map +1 -0
  113. package/dist/infrastructure/source/FsSourceUnitDigest.js +58 -0
  114. package/dist/infrastructure/source/FsSourceUnitDigest.js.map +1 -0
  115. package/dist/infrastructure/source/FsSourceUnitObservationRepository.d.ts +31 -0
  116. package/dist/infrastructure/source/FsSourceUnitObservationRepository.d.ts.map +1 -0
  117. package/dist/infrastructure/source/FsSourceUnitObservationRepository.js +88 -0
  118. package/dist/infrastructure/source/FsSourceUnitObservationRepository.js.map +1 -0
  119. package/dist/infrastructure/source/intentScan.d.ts +13 -0
  120. package/dist/infrastructure/source/intentScan.d.ts.map +1 -0
  121. package/dist/infrastructure/source/intentScan.js +137 -0
  122. package/dist/infrastructure/source/intentScan.js.map +1 -0
  123. package/dist/infrastructure/users/UserDirectoryFromRegistry.d.ts +14 -0
  124. package/dist/infrastructure/users/UserDirectoryFromRegistry.d.ts.map +1 -0
  125. package/dist/infrastructure/users/UserDirectoryFromRegistry.js +21 -0
  126. package/dist/infrastructure/users/UserDirectoryFromRegistry.js.map +1 -0
  127. package/dist/infrastructure/users/UserRegistryFile.d.ts +22 -0
  128. package/dist/infrastructure/users/UserRegistryFile.d.ts.map +1 -0
  129. package/dist/infrastructure/users/UserRegistryFile.js +89 -0
  130. package/dist/infrastructure/users/UserRegistryFile.js.map +1 -0
  131. package/dist/infrastructure/users/ensureWorkspaceOwners.d.ts +12 -0
  132. package/dist/infrastructure/users/ensureWorkspaceOwners.d.ts.map +1 -0
  133. package/dist/infrastructure/users/ensureWorkspaceOwners.js +25 -0
  134. package/dist/infrastructure/users/ensureWorkspaceOwners.js.map +1 -0
  135. package/dist/infrastructure/workspace/FsWorkspaceRepository.d.ts.map +1 -0
  136. package/dist/infrastructure/{fs → workspace}/FsWorkspaceRepository.js +15 -5
  137. package/dist/infrastructure/workspace/FsWorkspaceRepository.js.map +1 -0
  138. package/dist/infrastructure/workspace/WorkspaceDiscovery.d.ts +18 -0
  139. package/dist/infrastructure/workspace/WorkspaceDiscovery.d.ts.map +1 -0
  140. package/dist/infrastructure/workspace/WorkspaceDiscovery.js +50 -0
  141. package/dist/infrastructure/workspace/WorkspaceDiscovery.js.map +1 -0
  142. package/dist/infrastructure/workspace/WorkspaceRegistryFile.d.ts +42 -0
  143. package/dist/infrastructure/workspace/WorkspaceRegistryFile.d.ts.map +1 -0
  144. package/dist/infrastructure/workspace/WorkspaceRegistryFile.js +160 -0
  145. package/dist/infrastructure/workspace/WorkspaceRegistryFile.js.map +1 -0
  146. package/dist/infrastructure/workspace/productManifestWriter.d.ts +24 -0
  147. package/dist/infrastructure/workspace/productManifestWriter.d.ts.map +1 -0
  148. package/dist/infrastructure/{fs → workspace}/productManifestWriter.js +14 -28
  149. package/dist/infrastructure/workspace/productManifestWriter.js.map +1 -0
  150. package/dist/middleware/auth.d.ts +39 -0
  151. package/dist/middleware/auth.d.ts.map +1 -0
  152. package/dist/middleware/auth.js +87 -0
  153. package/dist/middleware/auth.js.map +1 -0
  154. package/dist/middleware/cors.d.ts.map +1 -1
  155. package/dist/middleware/cors.js +5 -2
  156. package/dist/middleware/cors.js.map +1 -1
  157. package/dist/middleware/error.d.ts.map +1 -1
  158. package/dist/middleware/error.js +15 -13
  159. package/dist/middleware/error.js.map +1 -1
  160. package/dist/middleware/workspaceAccess.d.ts +51 -0
  161. package/dist/middleware/workspaceAccess.d.ts.map +1 -0
  162. package/dist/middleware/workspaceAccess.js +91 -0
  163. package/dist/middleware/workspaceAccess.js.map +1 -0
  164. package/dist/policy/CapabilityCheck.d.ts +14 -0
  165. package/dist/policy/CapabilityCheck.d.ts.map +1 -0
  166. package/dist/policy/CapabilityCheck.js +2 -0
  167. package/dist/policy/CapabilityCheck.js.map +1 -0
  168. package/dist/policy/PermissionRegistry.d.ts +25 -0
  169. package/dist/policy/PermissionRegistry.d.ts.map +1 -0
  170. package/dist/policy/PermissionRegistry.js +29 -0
  171. package/dist/policy/PermissionRegistry.js.map +1 -0
  172. package/dist/policy/ViewerContext.d.ts +29 -0
  173. package/dist/policy/ViewerContext.d.ts.map +1 -0
  174. package/dist/policy/ViewerContext.js +2 -0
  175. package/dist/policy/ViewerContext.js.map +1 -0
  176. package/dist/policy/checks.d.ts +15 -0
  177. package/dist/policy/checks.d.ts.map +1 -0
  178. package/dist/policy/checks.js +55 -0
  179. package/dist/policy/checks.js.map +1 -0
  180. package/dist/policy/defaultRegistry.d.ts +9 -0
  181. package/dist/policy/defaultRegistry.d.ts.map +1 -0
  182. package/dist/policy/defaultRegistry.js +15 -0
  183. package/dist/policy/defaultRegistry.js.map +1 -0
  184. package/dist/policy/index.d.ts +8 -0
  185. package/dist/policy/index.d.ts.map +1 -0
  186. package/dist/policy/index.js +5 -0
  187. package/dist/policy/index.js.map +1 -0
  188. package/dist/policy/resolveViewer.d.ts +16 -0
  189. package/dist/policy/resolveViewer.d.ts.map +1 -0
  190. package/dist/policy/resolveViewer.js +37 -0
  191. package/dist/policy/resolveViewer.js.map +1 -0
  192. package/dist/routes/_shared.d.ts +138 -0
  193. package/dist/routes/_shared.d.ts.map +1 -0
  194. package/dist/routes/_shared.js +33 -0
  195. package/dist/routes/_shared.js.map +1 -0
  196. package/dist/routes/admin.d.ts +13 -0
  197. package/dist/routes/admin.d.ts.map +1 -0
  198. package/dist/routes/admin.js +228 -0
  199. package/dist/routes/admin.js.map +1 -0
  200. package/dist/routes/auth.d.ts +35 -0
  201. package/dist/routes/auth.d.ts.map +1 -0
  202. package/dist/routes/auth.js +168 -0
  203. package/dist/routes/auth.js.map +1 -0
  204. package/dist/routes/batch.d.ts +7 -0
  205. package/dist/routes/batch.d.ts.map +1 -0
  206. package/dist/routes/batch.js +47 -0
  207. package/dist/routes/batch.js.map +1 -0
  208. package/dist/routes/clarifications.d.ts +8 -0
  209. package/dist/routes/clarifications.d.ts.map +1 -0
  210. package/dist/routes/clarifications.js +243 -0
  211. package/dist/routes/clarifications.js.map +1 -0
  212. package/dist/routes/edges.d.ts +2 -2
  213. package/dist/routes/edges.d.ts.map +1 -1
  214. package/dist/routes/edges.js +34 -16
  215. package/dist/routes/edges.js.map +1 -1
  216. package/dist/routes/health.d.ts +2 -2
  217. package/dist/routes/health.d.ts.map +1 -1
  218. package/dist/routes/health.js +21 -3
  219. package/dist/routes/health.js.map +1 -1
  220. package/dist/routes/history.d.ts +7 -0
  221. package/dist/routes/history.d.ts.map +1 -0
  222. package/dist/routes/history.js +90 -0
  223. package/dist/routes/history.js.map +1 -0
  224. package/dist/routes/model.d.ts +2 -2
  225. package/dist/routes/model.d.ts.map +1 -1
  226. package/dist/routes/model.js +20 -4
  227. package/dist/routes/model.js.map +1 -1
  228. package/dist/routes/nodes.d.ts +2 -2
  229. package/dist/routes/nodes.d.ts.map +1 -1
  230. package/dist/routes/nodes.js +77 -25
  231. package/dist/routes/nodes.js.map +1 -1
  232. package/dist/routes/oauth.d.ts +6 -7
  233. package/dist/routes/oauth.d.ts.map +1 -1
  234. package/dist/routes/oauth.js +6 -7
  235. package/dist/routes/oauth.js.map +1 -1
  236. package/dist/routes/ontology.d.ts +2 -2
  237. package/dist/routes/ontology.d.ts.map +1 -1
  238. package/dist/routes/ontology.js +22 -5
  239. package/dist/routes/ontology.js.map +1 -1
  240. package/dist/routes/proposals.d.ts +5 -4
  241. package/dist/routes/proposals.d.ts.map +1 -1
  242. package/dist/routes/proposals.js +176 -45
  243. package/dist/routes/proposals.js.map +1 -1
  244. package/dist/routes/reactorCycles.d.ts +7 -0
  245. package/dist/routes/reactorCycles.d.ts.map +1 -0
  246. package/dist/routes/reactorCycles.js +60 -0
  247. package/dist/routes/reactorCycles.js.map +1 -0
  248. package/dist/routes/runs.d.ts.map +1 -1
  249. package/dist/routes/runs.js +66 -12
  250. package/dist/routes/runs.js.map +1 -1
  251. package/dist/routes/skillInputOptions.d.ts +10 -0
  252. package/dist/routes/skillInputOptions.d.ts.map +1 -0
  253. package/dist/routes/skillInputOptions.js +159 -0
  254. package/dist/routes/skillInputOptions.js.map +1 -0
  255. package/dist/routes/skills.d.ts +21 -3
  256. package/dist/routes/skills.d.ts.map +1 -1
  257. package/dist/routes/skills.js +223 -21
  258. package/dist/routes/skills.js.map +1 -1
  259. package/dist/routes/sourceLoaders.d.ts +7 -0
  260. package/dist/routes/sourceLoaders.d.ts.map +1 -0
  261. package/dist/routes/sourceLoaders.js +30 -0
  262. package/dist/routes/sourceLoaders.js.map +1 -0
  263. package/dist/routes/sourceUnitObservations.d.ts +20 -0
  264. package/dist/routes/sourceUnitObservations.d.ts.map +1 -0
  265. package/dist/routes/sourceUnitObservations.js +80 -0
  266. package/dist/routes/sourceUnitObservations.js.map +1 -0
  267. package/dist/routes/sourceWebhooks.d.ts +26 -0
  268. package/dist/routes/sourceWebhooks.d.ts.map +1 -0
  269. package/dist/routes/sourceWebhooks.js +301 -0
  270. package/dist/routes/sourceWebhooks.js.map +1 -0
  271. package/dist/routes/users.d.ts +7 -0
  272. package/dist/routes/users.d.ts.map +1 -0
  273. package/dist/routes/users.js +109 -0
  274. package/dist/routes/users.js.map +1 -0
  275. package/dist/routes/workspaceEvents.d.ts +5 -4
  276. package/dist/routes/workspaceEvents.d.ts.map +1 -1
  277. package/dist/routes/workspaceEvents.js +7 -6
  278. package/dist/routes/workspaceEvents.js.map +1 -1
  279. package/dist/routes/workspaceMembers.d.ts +11 -0
  280. package/dist/routes/workspaceMembers.d.ts.map +1 -0
  281. package/dist/routes/workspaceMembers.js +81 -0
  282. package/dist/routes/workspaceMembers.js.map +1 -0
  283. package/dist/routes/workspaces.d.ts +30 -1
  284. package/dist/routes/workspaces.d.ts.map +1 -1
  285. package/dist/routes/workspaces.js +207 -63
  286. package/dist/routes/workspaces.js.map +1 -1
  287. package/dist/server.js +9 -29
  288. package/dist/server.js.map +1 -1
  289. package/dist/startServer.d.ts +17 -0
  290. package/dist/startServer.d.ts.map +1 -0
  291. package/dist/startServer.js +81 -0
  292. package/dist/startServer.js.map +1 -0
  293. package/dist/startup.d.ts +28 -0
  294. package/dist/startup.d.ts.map +1 -0
  295. package/dist/startup.js +94 -0
  296. package/dist/startup.js.map +1 -0
  297. package/package.json +49 -32
  298. package/LICENSE +0 -21
  299. package/dist/composeFs.d.ts +0 -20
  300. package/dist/composeFs.d.ts.map +0 -1
  301. package/dist/composeFs.js +0 -134
  302. package/dist/composeFs.js.map +0 -1
  303. package/dist/composition.d.ts +0 -49
  304. package/dist/composition.d.ts.map +0 -1
  305. package/dist/composition.js +0 -43
  306. package/dist/composition.js.map +0 -1
  307. package/dist/infrastructure/agent/ClaudeCodeAgentBinding.d.ts +0 -8
  308. package/dist/infrastructure/agent/ClaudeCodeAgentBinding.d.ts.map +0 -1
  309. package/dist/infrastructure/agent/ClaudeCodeAgentBinding.js +0 -62
  310. package/dist/infrastructure/agent/ClaudeCodeAgentBinding.js.map +0 -1
  311. package/dist/infrastructure/agent/SubprocessSkillRunner.d.ts.map +0 -1
  312. package/dist/infrastructure/agent/SubprocessSkillRunner.js.map +0 -1
  313. package/dist/infrastructure/agent/asyncQueue.d.ts +0 -22
  314. package/dist/infrastructure/agent/asyncQueue.d.ts.map +0 -1
  315. package/dist/infrastructure/agent/mcpConfig.d.ts +0 -18
  316. package/dist/infrastructure/agent/mcpConfig.d.ts.map +0 -1
  317. package/dist/infrastructure/agent/mcpConfig.js +0 -47
  318. package/dist/infrastructure/agent/mcpConfig.js.map +0 -1
  319. package/dist/infrastructure/agent/streamJsonParser.d.ts +0 -20
  320. package/dist/infrastructure/agent/streamJsonParser.d.ts.map +0 -1
  321. package/dist/infrastructure/agent/streamJsonParser.js.map +0 -1
  322. package/dist/infrastructure/agent/subprocessEventStream.d.ts +0 -26
  323. package/dist/infrastructure/agent/subprocessEventStream.d.ts.map +0 -1
  324. package/dist/infrastructure/agent/subprocessEventStream.js +0 -112
  325. package/dist/infrastructure/agent/subprocessEventStream.js.map +0 -1
  326. package/dist/infrastructure/fs/FsClarifyTicketRepository.d.ts +0 -13
  327. package/dist/infrastructure/fs/FsClarifyTicketRepository.d.ts.map +0 -1
  328. package/dist/infrastructure/fs/FsClarifyTicketRepository.js +0 -33
  329. package/dist/infrastructure/fs/FsClarifyTicketRepository.js.map +0 -1
  330. package/dist/infrastructure/fs/FsDecisionRepository.d.ts +0 -13
  331. package/dist/infrastructure/fs/FsDecisionRepository.d.ts.map +0 -1
  332. package/dist/infrastructure/fs/FsDecisionRepository.js +0 -56
  333. package/dist/infrastructure/fs/FsDecisionRepository.js.map +0 -1
  334. package/dist/infrastructure/fs/FsProposalRepository.d.ts.map +0 -1
  335. package/dist/infrastructure/fs/FsProposalRepository.js.map +0 -1
  336. package/dist/infrastructure/fs/FsRunRepository.d.ts.map +0 -1
  337. package/dist/infrastructure/fs/FsRunRepository.js +0 -88
  338. package/dist/infrastructure/fs/FsRunRepository.js.map +0 -1
  339. package/dist/infrastructure/fs/FsSkillRegistry.d.ts.map +0 -1
  340. package/dist/infrastructure/fs/FsSkillRegistry.js.map +0 -1
  341. package/dist/infrastructure/fs/FsStatusedJsonRepository.d.ts +0 -35
  342. package/dist/infrastructure/fs/FsStatusedJsonRepository.d.ts.map +0 -1
  343. package/dist/infrastructure/fs/FsStatusedJsonRepository.js.map +0 -1
  344. package/dist/infrastructure/fs/FsWorkspaceRepository.d.ts.map +0 -1
  345. package/dist/infrastructure/fs/FsWorkspaceRepository.js.map +0 -1
  346. package/dist/infrastructure/fs/WorkspaceRegistryFile.d.ts +0 -17
  347. package/dist/infrastructure/fs/WorkspaceRegistryFile.d.ts.map +0 -1
  348. package/dist/infrastructure/fs/WorkspaceRegistryFile.js +0 -58
  349. package/dist/infrastructure/fs/WorkspaceRegistryFile.js.map +0 -1
  350. package/dist/infrastructure/fs/frontmatter.d.ts +0 -13
  351. package/dist/infrastructure/fs/frontmatter.d.ts.map +0 -1
  352. package/dist/infrastructure/fs/frontmatter.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 +0 -22
  356. package/dist/infrastructure/fs/paths.d.ts.map +0 -1
  357. package/dist/infrastructure/fs/paths.js +0 -46
  358. package/dist/infrastructure/fs/paths.js.map +0 -1
  359. package/dist/infrastructure/fs/productManifestWriter.d.ts +0 -22
  360. package/dist/infrastructure/fs/productManifestWriter.d.ts.map +0 -1
  361. package/dist/infrastructure/fs/productManifestWriter.js.map +0 -1
  362. package/dist/infrastructure/orphanReaper.d.ts +0 -18
  363. package/dist/infrastructure/orphanReaper.d.ts.map +0 -1
  364. package/dist/infrastructure/orphanReaper.js.map +0 -1
  365. package/dist/routes/clarify.d.ts +0 -8
  366. package/dist/routes/clarify.d.ts.map +0 -1
  367. package/dist/routes/clarify.js +0 -84
  368. package/dist/routes/clarify.js.map +0 -1
  369. package/dist/routes/decisions.d.ts +0 -7
  370. package/dist/routes/decisions.d.ts.map +0 -1
  371. package/dist/routes/decisions.js +0 -30
  372. package/dist/routes/decisions.js.map +0 -1
  373. /package/dist/infrastructure/{fs → _shared}/jsonFileStore.d.ts +0 -0
  374. /package/dist/infrastructure/{fs → _shared}/jsonFileStore.js +0 -0
  375. /package/dist/infrastructure/{fs → hitl}/FsProposalRepository.d.ts +0 -0
  376. /package/dist/infrastructure/{fs → workspace}/FsWorkspaceRepository.d.ts +0 -0
@@ -0,0 +1,91 @@
1
+ import { ForbiddenError } from '@braidhq/core';
2
+ import { defaultPermissionRegistry, resolveViewer } from '../policy/index.js';
3
+ import { getUserId } from './auth.js';
4
+ import { getWorkspaceId } from './workspaceId.js';
5
+ /**
6
+ * Server-scope capability guard for actions without a workspace context,
7
+ * such as workspace creation.
8
+ * Builds a viewer with an absent member,
9
+ * so non-admin users resolve to a null effectiveRole,
10
+ * and fail every check by construction.
11
+ *
12
+ * Skips the gate when userRegistry is absent,
13
+ * so in-memory test compositions stay open.
14
+ * Production deployments always pass it.
15
+ */
16
+ export function requireServerCapability(capability, userRegistry) {
17
+ return async (context, next) => {
18
+ if (!userRegistry) {
19
+ await next();
20
+ return undefined;
21
+ }
22
+ const userId = getUserId(context);
23
+ const user = await userRegistry.get(userId);
24
+ if (!user)
25
+ return forbid(`Unknown user "${userId}".`);
26
+ const viewer = resolveViewer(user, undefined);
27
+ if (!defaultPermissionRegistry.can(capability, viewer))
28
+ return forbid(`Your role cannot perform "${capability}".`);
29
+ await next();
30
+ return undefined;
31
+ };
32
+ }
33
+ /**
34
+ * Resolves the caller's ViewerContext for this workspace,
35
+ * and stashes it on the Hono context for every downstream layer to read.
36
+ * Composes after `workspaceIdMiddleware` and `authMiddleware`.
37
+ * Outsiders get 403 here, meaning no member row and not a server admin.
38
+ *
39
+ * The actual policy decisions live in `policy/`.
40
+ * This middleware only builds the viewer,
41
+ * and rejects unauthenticated outsiders.
42
+ */
43
+ export function workspaceAccessMiddleware(options) {
44
+ return async (context, next) => {
45
+ const workspaceId = getWorkspaceId(context);
46
+ const userId = getUserId(context);
47
+ const user = await options.userRegistry.get(userId);
48
+ if (!user)
49
+ return forbid(`Unknown user "${userId}".`);
50
+ const workspace = await options.workspaceService.findById(workspaceId);
51
+ const member = await options.registry.getMember(workspace.rootPath, userId);
52
+ const viewer = resolveViewer(user, member);
53
+ if (viewer.effectiveRole === null)
54
+ return forbid(`You are not a member of workspace "${workspaceId}".`);
55
+ context.set('viewerContext', viewer);
56
+ await next();
57
+ return undefined;
58
+ };
59
+ }
60
+ export function getViewerContext(context) {
61
+ return context.get('viewerContext');
62
+ }
63
+ /**
64
+ * Mutation guard.
65
+ * Returns 403 when the viewer cannot perform the given capability.
66
+ * Optional `buildResource` lets a capability such as `skill.run`
67
+ * attach per-request data the check needs.
68
+ *
69
+ * Compositions that don't mount `workspaceAccessMiddleware`,
70
+ * such as in-memory tests or the headless server, skip the gate.
71
+ * Production deployments always mount it, so the gate is real.
72
+ */
73
+ export function requirePermission(capability, buildResource) {
74
+ return async (context, next) => {
75
+ const base = getViewerContext(context);
76
+ if (!base) {
77
+ await next();
78
+ return undefined;
79
+ }
80
+ const resource = buildResource ? await buildResource(context) : undefined;
81
+ const viewer = resource ? { ...base, resource } : base;
82
+ if (!defaultPermissionRegistry.can(capability, viewer))
83
+ return forbid(`Your role cannot perform "${capability}".`);
84
+ await next();
85
+ return undefined;
86
+ };
87
+ }
88
+ function forbid(detail) {
89
+ throw new ForbiddenError(detail);
90
+ }
91
+ //# sourceMappingURL=workspaceAccess.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceAccess.js","sourceRoot":"","sources":["../../src/middleware/workspaceAccess.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,uBAAuB,CACrC,UAAsB,EACtB,YAA0C;IAE1C,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC7B,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,EAAE,CAAA;YACZ,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;QACjC,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAC3C,IAAI,CAAC,IAAI;YACP,OAAO,MAAM,CAAC,iBAAiB,MAAM,IAAI,CAAC,CAAA;QAC5C,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC7C,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC;YACpD,OAAO,MAAM,CAAC,6BAA6B,UAAU,IAAI,CAAC,CAAA;QAC5D,MAAM,IAAI,EAAE,CAAA;QACZ,OAAO,SAAS,CAAA;IAClB,CAAC,CAAA;AACH,CAAC;AAcD;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAA+B;IACvE,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC7B,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,CAAA;QAC3C,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;QACjC,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACnD,IAAI,CAAC,IAAI;YACP,OAAO,MAAM,CAAC,iBAAiB,MAAM,IAAI,CAAC,CAAA;QAC5C,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;QACtE,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QAC3E,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QAC1C,IAAI,MAAM,CAAC,aAAa,KAAK,IAAI;YAC/B,OAAO,MAAM,CAAC,sCAAsC,WAAW,IAAI,CAAC,CAAA;QACtE,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,CAAA;QACpC,MAAM,IAAI,EAAE,CAAA;QACZ,OAAO,SAAS,CAAA;IAClB,CAAC,CAAA;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,OAAO,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;AACrC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAAsB,EACtB,aAAwE;IAExE,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC7B,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAA;QACtC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,EAAE,CAAA;YACZ,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACzE,MAAM,MAAM,GAAkB,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;QACrE,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC;YACpD,OAAO,MAAM,CAAC,6BAA6B,UAAU,IAAI,CAAC,CAAA;QAC5D,MAAM,IAAI,EAAE,CAAA;QACZ,OAAO,SAAS,CAAA;IAClB,CAAC,CAAA;AACH,CAAC;AAED,SAAS,MAAM,CAAC,MAAc;IAC5B,MAAM,IAAI,cAAc,CAAC,MAAM,CAAC,CAAA;AAClC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Capability } from '@braidhq/schema';
2
+ import type { ViewerContext } from './ViewerContext.js';
3
+ /**
4
+ * The Strategy interface, where each capability owns its decision logic.
5
+ * A stateless check is a const object, the first-party set lives in `checks.ts`.
6
+ *
7
+ * Implementations MUST be pure, with no I/O, clock, or randomness,
8
+ * so the same viewer always produces the same answer.
9
+ */
10
+ export interface CapabilityCheck {
11
+ readonly id: Capability;
12
+ evaluate: (viewer: ViewerContext) => boolean;
13
+ }
14
+ //# sourceMappingURL=CapabilityCheck.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CapabilityCheck.d.ts","sourceRoot":"","sources":["../../src/policy/CapabilityCheck.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAA;IACvB,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAA;CAC7C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CapabilityCheck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CapabilityCheck.js","sourceRoot":"","sources":["../../src/policy/CapabilityCheck.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import type { Capability } from '@braidhq/schema';
2
+ import type { CapabilityCheck } from './CapabilityCheck.js';
3
+ import type { ViewerContext } from './ViewerContext.js';
4
+ /**
5
+ * Open registry of capability strategies.
6
+ * A new capability arrives via `registry.register(new MyCheck())`,
7
+ * leaving existing checks untouched.
8
+ *
9
+ * Unknown capability ids resolve to `false`, a default deny.
10
+ * This makes a typo'd capability id safe,
11
+ * since the call denies rather than accidentally allowing.
12
+ */
13
+ export declare class PermissionRegistry {
14
+ private readonly checks;
15
+ register(check: CapabilityCheck): this;
16
+ has(capability: Capability): boolean;
17
+ /**
18
+ * Decide whether a viewer can perform a capability.
19
+ * The viewer already carries its own resource,
20
+ * such as the skill for skill.run,
21
+ * so the caller is responsible for building the right viewer.
22
+ */
23
+ can(capability: Capability, viewer: ViewerContext): boolean;
24
+ }
25
+ //# sourceMappingURL=PermissionRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PermissionRegistry.d.ts","sourceRoot":"","sources":["../../src/policy/PermissionRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD;;;;;;;;GAQG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAEhE,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAKtC,GAAG,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO;IAIpC;;;;;OAKG;IACH,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO;CAG5D"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Open registry of capability strategies.
3
+ * A new capability arrives via `registry.register(new MyCheck())`,
4
+ * leaving existing checks untouched.
5
+ *
6
+ * Unknown capability ids resolve to `false`, a default deny.
7
+ * This makes a typo'd capability id safe,
8
+ * since the call denies rather than accidentally allowing.
9
+ */
10
+ export class PermissionRegistry {
11
+ checks = new Map();
12
+ register(check) {
13
+ this.checks.set(check.id, check);
14
+ return this;
15
+ }
16
+ has(capability) {
17
+ return this.checks.has(capability);
18
+ }
19
+ /**
20
+ * Decide whether a viewer can perform a capability.
21
+ * The viewer already carries its own resource,
22
+ * such as the skill for skill.run,
23
+ * so the caller is responsible for building the right viewer.
24
+ */
25
+ can(capability, viewer) {
26
+ return this.checks.get(capability)?.evaluate(viewer) ?? false;
27
+ }
28
+ }
29
+ //# sourceMappingURL=PermissionRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PermissionRegistry.js","sourceRoot":"","sources":["../../src/policy/PermissionRegistry.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAkB;IACZ,MAAM,GAAG,IAAI,GAAG,EAA+B,CAAA;IAEhE,QAAQ,CAAC,KAAsB;QAC7B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,GAAG,CAAC,UAAsB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IACpC,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,UAAsB,EAAE,MAAqB;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAA;IAC/D,CAAC;CACF"}
@@ -0,0 +1,29 @@
1
+ import type { SkillFrontmatter, User, WorkspaceMember, WorkspaceRole } from '@braidhq/schema';
2
+ /**
3
+ * The single resolved-identity object that every capability check reads.
4
+ * Built once per request by `resolveViewer`,
5
+ * then passed unchanged into the registry.
6
+ *
7
+ * Permission gates read `effectiveRole`,
8
+ * where admins always land as owner regardless of any member row.
9
+ * `member` is the stored row when present,
10
+ * used for display and skillOverrides lookup,
11
+ * and stays independent of effectiveRole.
12
+ * An admin who joined as a guest has a guest member.role,
13
+ * yet an owner effectiveRole.
14
+ *
15
+ * `resource` is the per-action context the check needs.
16
+ * skill.run reads `skill`, the manifest, along with `skillId`.
17
+ * Future checks can extend it without breaking siblings.
18
+ */
19
+ export interface ViewerContext {
20
+ readonly user: User;
21
+ readonly member: WorkspaceMember | undefined;
22
+ readonly effectiveRole: WorkspaceRole | null;
23
+ readonly resource?: ViewerResource | undefined;
24
+ }
25
+ export interface ViewerResource {
26
+ readonly skill?: SkillFrontmatter;
27
+ readonly skillId?: string;
28
+ }
29
+ //# sourceMappingURL=ViewerContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewerContext.d.ts","sourceRoot":"","sources":["../../src/policy/ViewerContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE7F;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;IACnB,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,CAAA;IAC5C,QAAQ,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,CAAA;IAC5C,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,GAAG,SAAS,CAAA;CAC/C;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,gBAAgB,CAAA;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ViewerContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewerContext.js","sourceRoot":"","sources":["../../src/policy/ViewerContext.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import type { CapabilityCheck } from './CapabilityCheck.js';
2
+ /**
3
+ * First-party capability checks,
4
+ * mirrored byte-equivalent in `packages/studio/src/policy/checks.ts`.
5
+ * The server is the authoritative gate.
6
+ * The client copy lets Studio render locked affordances, without hitting a 403.
7
+ *
8
+ * Workspace-scope verbs collapse to read and write per resource.
9
+ * `workspace.create` is server-scope, resolved with no member.
10
+ * `skill.run` keeps its own verb for its three-step resolution,
11
+ * covering owner short-circuit, per-member override, allowedRoles,
12
+ * which does not fit a read or write pair.
13
+ */
14
+ export declare const checks: readonly CapabilityCheck[];
15
+ //# sourceMappingURL=checks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../src/policy/checks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,eAAe,EAyC5C,CAAA"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * First-party capability checks,
3
+ * mirrored byte-equivalent in `packages/studio/src/policy/checks.ts`.
4
+ * The server is the authoritative gate.
5
+ * The client copy lets Studio render locked affordances, without hitting a 403.
6
+ *
7
+ * Workspace-scope verbs collapse to read and write per resource.
8
+ * `workspace.create` is server-scope, resolved with no member.
9
+ * `skill.run` keeps its own verb for its three-step resolution,
10
+ * covering owner short-circuit, per-member override, allowedRoles,
11
+ * which does not fit a read or write pair.
12
+ */
13
+ export const checks = [
14
+ { id: 'workspace.create', evaluate: v => v.effectiveRole === 'owner' },
15
+ // Server admin reads serverRole directly, not effectiveRole,
16
+ // since a workspace owner also resolves to an owner effectiveRole.
17
+ { id: 'server.admin', evaluate: v => v.user.serverRole === 'admin' },
18
+ { id: 'workspace.read', evaluate: v => v.effectiveRole !== null },
19
+ { id: 'workspace.write', evaluate: v => v.effectiveRole === 'owner' },
20
+ {
21
+ id: 'proposal.read',
22
+ evaluate: v => v.effectiveRole === 'owner' || v.effectiveRole === 'maintainer',
23
+ },
24
+ {
25
+ id: 'proposal.write',
26
+ evaluate: v => v.effectiveRole === 'owner' || v.effectiveRole === 'maintainer',
27
+ },
28
+ {
29
+ id: 'clarification.read',
30
+ evaluate: v => v.effectiveRole === 'owner' || v.effectiveRole === 'maintainer',
31
+ },
32
+ {
33
+ id: 'clarification.write',
34
+ evaluate: v => v.effectiveRole === 'owner' || v.effectiveRole === 'maintainer',
35
+ },
36
+ { id: 'history.write', evaluate: v => v.effectiveRole === 'owner' },
37
+ {
38
+ id: 'skill.run',
39
+ evaluate: (v) => {
40
+ const skill = v.resource?.skill;
41
+ const skillId = v.resource?.skillId;
42
+ if (!skill || !skillId)
43
+ return false;
44
+ if (v.effectiveRole === null)
45
+ return false;
46
+ if (v.effectiveRole === 'owner')
47
+ return true;
48
+ const override = v.member?.skillOverrides?.[skillId];
49
+ if (override)
50
+ return override === 'allow';
51
+ return skill.braid.allowedRoles.includes(v.effectiveRole);
52
+ },
53
+ },
54
+ ];
55
+ //# sourceMappingURL=checks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checks.js","sourceRoot":"","sources":["../../src/policy/checks.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,MAAM,GAA+B;IAChD,EAAE,EAAE,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,OAAO,EAAE;IACtE,6DAA6D;IAC7D,mEAAmE;IACnE,EAAE,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,KAAK,OAAO,EAAE;IACpE,EAAE,EAAE,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,IAAI,EAAE;IACjE,EAAE,EAAE,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,OAAO,EAAE;IACrE;QACE,EAAE,EAAE,eAAe;QACnB,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,OAAO,IAAI,CAAC,CAAC,aAAa,KAAK,YAAY;KAC/E;IACD;QACE,EAAE,EAAE,gBAAgB;QACpB,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,OAAO,IAAI,CAAC,CAAC,aAAa,KAAK,YAAY;KAC/E;IACD;QACE,EAAE,EAAE,oBAAoB;QACxB,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,OAAO,IAAI,CAAC,CAAC,aAAa,KAAK,YAAY;KAC/E;IACD;QACE,EAAE,EAAE,qBAAqB;QACzB,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,OAAO,IAAI,CAAC,CAAC,aAAa,KAAK,YAAY;KAC/E;IACD,EAAE,EAAE,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,OAAO,EAAE;IACnE;QACE,EAAE,EAAE,WAAW;QACf,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YACd,MAAM,KAAK,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAA;YAC/B,MAAM,OAAO,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAA;YACnC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO;gBACpB,OAAO,KAAK,CAAA;YACd,IAAI,CAAC,CAAC,aAAa,KAAK,IAAI;gBAC1B,OAAO,KAAK,CAAA;YACd,IAAI,CAAC,CAAC,aAAa,KAAK,OAAO;gBAC7B,OAAO,IAAI,CAAA;YACb,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,OAA+C,CAAC,CAAA;YAC5F,IAAI,QAAQ;gBACV,OAAO,QAAQ,KAAK,OAAO,CAAA;YAC7B,OAAO,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAA;QAC3D,CAAC;KACF;CACF,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { PermissionRegistry } from './PermissionRegistry.js';
2
+ /**
3
+ * Default registry preloaded with the first-party capabilities.
4
+ * Plugins register their own checks, calling `register()` on this instance.
5
+ * Tests build a fresh `PermissionRegistry` instead, to inject mocks.
6
+ */
7
+ export declare function buildDefaultPermissionRegistry(): PermissionRegistry;
8
+ export declare const defaultPermissionRegistry: PermissionRegistry;
9
+ //# sourceMappingURL=defaultRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultRegistry.d.ts","sourceRoot":"","sources":["../../src/policy/defaultRegistry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D;;;;GAIG;AACH,wBAAgB,8BAA8B,IAAI,kBAAkB,CAKnE;AAED,eAAO,MAAM,yBAAyB,oBAAmC,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { checks } from './checks.js';
2
+ import { PermissionRegistry } from './PermissionRegistry.js';
3
+ /**
4
+ * Default registry preloaded with the first-party capabilities.
5
+ * Plugins register their own checks, calling `register()` on this instance.
6
+ * Tests build a fresh `PermissionRegistry` instead, to inject mocks.
7
+ */
8
+ export function buildDefaultPermissionRegistry() {
9
+ const registry = new PermissionRegistry();
10
+ for (const check of checks)
11
+ registry.register(check);
12
+ return registry;
13
+ }
14
+ export const defaultPermissionRegistry = buildDefaultPermissionRegistry();
15
+ //# sourceMappingURL=defaultRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultRegistry.js","sourceRoot":"","sources":["../../src/policy/defaultRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D;;;;GAIG;AACH,MAAM,UAAU,8BAA8B;IAC5C,MAAM,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAA;IACzC,KAAK,MAAM,KAAK,IAAI,MAAM;QACxB,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC1B,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG,8BAA8B,EAAE,CAAA"}
@@ -0,0 +1,8 @@
1
+ export type { CapabilityCheck } from './CapabilityCheck.js';
2
+ export { buildDefaultPermissionRegistry, defaultPermissionRegistry } from './defaultRegistry.js';
3
+ export { PermissionRegistry } from './PermissionRegistry.js';
4
+ export { resolveViewer } from './resolveViewer.js';
5
+ export type { ViewerContext, ViewerResource } from './ViewerContext.js';
6
+ export type { Capability } from '@braidhq/schema';
7
+ export { CAPABILITY_IDS } from '@braidhq/schema';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/policy/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACvE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export { buildDefaultPermissionRegistry, defaultPermissionRegistry } from './defaultRegistry.js';
2
+ export { PermissionRegistry } from './PermissionRegistry.js';
3
+ export { resolveViewer } from './resolveViewer.js';
4
+ export { CAPABILITY_IDS } from '@braidhq/schema';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/policy/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGlD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { User, WorkspaceMember } from '@braidhq/schema';
2
+ import type { ViewerContext, ViewerResource } from './ViewerContext.js';
3
+ /**
4
+ * The sole place server-admin promotion happens. Every other layer,
5
+ * including middleware, capability checks, and the Studio mirror,
6
+ * consumes the resulting `effectiveRole` and never re-derives it.
7
+ *
8
+ * Resolution runs in order:
9
+ * 1. An admin serverRole yields an owner effectiveRole.
10
+ * The stored member.role, if any, stays on `member` for display,
11
+ * yet gates ignore it.
12
+ * 2. A present member yields effectiveRole = member.role.
13
+ * 3. Otherwise effectiveRole is null, meaning no access.
14
+ */
15
+ export declare function resolveViewer(user: User, member: WorkspaceMember | undefined, resource?: ViewerResource): ViewerContext;
16
+ //# sourceMappingURL=resolveViewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveViewer.d.ts","sourceRoot":"","sources":["../../src/policy/resolveViewer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEvE;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,eAAe,GAAG,SAAS,EACnC,QAAQ,CAAC,EAAE,cAAc,GACxB,aAAa,CAuBf"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The sole place server-admin promotion happens. Every other layer,
3
+ * including middleware, capability checks, and the Studio mirror,
4
+ * consumes the resulting `effectiveRole` and never re-derives it.
5
+ *
6
+ * Resolution runs in order:
7
+ * 1. An admin serverRole yields an owner effectiveRole.
8
+ * The stored member.role, if any, stays on `member` for display,
9
+ * yet gates ignore it.
10
+ * 2. A present member yields effectiveRole = member.role.
11
+ * 3. Otherwise effectiveRole is null, meaning no access.
12
+ */
13
+ export function resolveViewer(user, member, resource) {
14
+ if (user.serverRole === 'admin') {
15
+ return {
16
+ user,
17
+ member,
18
+ effectiveRole: 'owner',
19
+ ...(resource ? { resource } : {}),
20
+ };
21
+ }
22
+ if (member) {
23
+ return {
24
+ user,
25
+ member,
26
+ effectiveRole: member.role,
27
+ ...(resource ? { resource } : {}),
28
+ };
29
+ }
30
+ return {
31
+ user,
32
+ member: undefined,
33
+ effectiveRole: null,
34
+ ...(resource ? { resource } : {}),
35
+ };
36
+ }
37
+ //# sourceMappingURL=resolveViewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveViewer.js","sourceRoot":"","sources":["../../src/policy/resolveViewer.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAC3B,IAAU,EACV,MAAmC,EACnC,QAAyB;IAEzB,IAAI,IAAI,CAAC,UAAU,KAAK,OAAO,EAAE,CAAC;QAChC,OAAO;YACL,IAAI;YACJ,MAAM;YACN,aAAa,EAAE,OAAO;YACtB,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClC,CAAA;IACH,CAAC;IACD,IAAI,MAAM,EAAE,CAAC;QACX,OAAO;YACL,IAAI;YACJ,MAAM;YACN,aAAa,EAAE,MAAM,CAAC,IAAI;YAC1B,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClC,CAAA;IACH,CAAC;IACD,OAAO;QACL,IAAI;QACJ,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,IAAI;QACnB,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClC,CAAA;AACH,CAAC"}
@@ -0,0 +1,138 @@
1
+ import { z } from '@hono/zod-openapi';
2
+ export declare const WorkspaceIdParam: z.ZodObject<{
3
+ workspaceId: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
4
+ }, z.core.$strip>;
5
+ export declare const ProblemJsonResponseContent: {
6
+ 'application/problem+json': {
7
+ schema: z.ZodObject<{
8
+ type: z.ZodString;
9
+ title: z.ZodString;
10
+ status: z.ZodNumber;
11
+ code: z.ZodEnum<{
12
+ "BRAID-VALIDATION": "BRAID-VALIDATION";
13
+ "BRAID-UNAUTHORIZED": "BRAID-UNAUTHORIZED";
14
+ "BRAID-NOT-FOUND": "BRAID-NOT-FOUND";
15
+ "BRAID-CONFLICT": "BRAID-CONFLICT";
16
+ "BRAID-FORBIDDEN": "BRAID-FORBIDDEN";
17
+ "BRAID-UNAVAILABLE": "BRAID-UNAVAILABLE";
18
+ "BRAID-INTERNAL": "BRAID-INTERNAL";
19
+ }>;
20
+ detail: z.ZodOptional<z.ZodString>;
21
+ issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
22
+ code: z.core.$ZodBranded<z.ZodString, "ValidationCode", "out">;
23
+ severity: z.ZodEnum<{
24
+ error: "error";
25
+ warning: "warning";
26
+ info: "info";
27
+ }>;
28
+ message: z.ZodString;
29
+ nodeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "NodeId", "out">>;
30
+ edgeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "EdgeId", "out">>;
31
+ path: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$strip>>>;
33
+ }, z.core.$strip>;
34
+ };
35
+ };
36
+ export declare const NotFoundResponse: {
37
+ readonly description: "The requested entity does not exist.";
38
+ readonly content: {
39
+ 'application/problem+json': {
40
+ schema: z.ZodObject<{
41
+ type: z.ZodString;
42
+ title: z.ZodString;
43
+ status: z.ZodNumber;
44
+ code: z.ZodEnum<{
45
+ "BRAID-VALIDATION": "BRAID-VALIDATION";
46
+ "BRAID-UNAUTHORIZED": "BRAID-UNAUTHORIZED";
47
+ "BRAID-NOT-FOUND": "BRAID-NOT-FOUND";
48
+ "BRAID-CONFLICT": "BRAID-CONFLICT";
49
+ "BRAID-FORBIDDEN": "BRAID-FORBIDDEN";
50
+ "BRAID-UNAVAILABLE": "BRAID-UNAVAILABLE";
51
+ "BRAID-INTERNAL": "BRAID-INTERNAL";
52
+ }>;
53
+ detail: z.ZodOptional<z.ZodString>;
54
+ issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
55
+ code: z.core.$ZodBranded<z.ZodString, "ValidationCode", "out">;
56
+ severity: z.ZodEnum<{
57
+ error: "error";
58
+ warning: "warning";
59
+ info: "info";
60
+ }>;
61
+ message: z.ZodString;
62
+ nodeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "NodeId", "out">>;
63
+ edgeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "EdgeId", "out">>;
64
+ path: z.ZodOptional<z.ZodString>;
65
+ }, z.core.$strip>>>;
66
+ }, z.core.$strip>;
67
+ };
68
+ };
69
+ };
70
+ export declare const ForbiddenResponse: {
71
+ readonly description: "The caller lacks permission for this action.";
72
+ readonly content: {
73
+ 'application/problem+json': {
74
+ schema: z.ZodObject<{
75
+ type: z.ZodString;
76
+ title: z.ZodString;
77
+ status: z.ZodNumber;
78
+ code: z.ZodEnum<{
79
+ "BRAID-VALIDATION": "BRAID-VALIDATION";
80
+ "BRAID-UNAUTHORIZED": "BRAID-UNAUTHORIZED";
81
+ "BRAID-NOT-FOUND": "BRAID-NOT-FOUND";
82
+ "BRAID-CONFLICT": "BRAID-CONFLICT";
83
+ "BRAID-FORBIDDEN": "BRAID-FORBIDDEN";
84
+ "BRAID-UNAVAILABLE": "BRAID-UNAVAILABLE";
85
+ "BRAID-INTERNAL": "BRAID-INTERNAL";
86
+ }>;
87
+ detail: z.ZodOptional<z.ZodString>;
88
+ issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
89
+ code: z.core.$ZodBranded<z.ZodString, "ValidationCode", "out">;
90
+ severity: z.ZodEnum<{
91
+ error: "error";
92
+ warning: "warning";
93
+ info: "info";
94
+ }>;
95
+ message: z.ZodString;
96
+ nodeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "NodeId", "out">>;
97
+ edgeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "EdgeId", "out">>;
98
+ path: z.ZodOptional<z.ZodString>;
99
+ }, z.core.$strip>>>;
100
+ }, z.core.$strip>;
101
+ };
102
+ };
103
+ };
104
+ export declare const ValidationFailureResponse: {
105
+ readonly description: "Request body or query failed validation.";
106
+ readonly content: {
107
+ 'application/problem+json': {
108
+ schema: z.ZodObject<{
109
+ type: z.ZodString;
110
+ title: z.ZodString;
111
+ status: z.ZodNumber;
112
+ code: z.ZodEnum<{
113
+ "BRAID-VALIDATION": "BRAID-VALIDATION";
114
+ "BRAID-UNAUTHORIZED": "BRAID-UNAUTHORIZED";
115
+ "BRAID-NOT-FOUND": "BRAID-NOT-FOUND";
116
+ "BRAID-CONFLICT": "BRAID-CONFLICT";
117
+ "BRAID-FORBIDDEN": "BRAID-FORBIDDEN";
118
+ "BRAID-UNAVAILABLE": "BRAID-UNAVAILABLE";
119
+ "BRAID-INTERNAL": "BRAID-INTERNAL";
120
+ }>;
121
+ detail: z.ZodOptional<z.ZodString>;
122
+ issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
123
+ code: z.core.$ZodBranded<z.ZodString, "ValidationCode", "out">;
124
+ severity: z.ZodEnum<{
125
+ error: "error";
126
+ warning: "warning";
127
+ info: "info";
128
+ }>;
129
+ message: z.ZodString;
130
+ nodeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "NodeId", "out">>;
131
+ edgeId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "EdgeId", "out">>;
132
+ path: z.ZodOptional<z.ZodString>;
133
+ }, z.core.$strip>>>;
134
+ }, z.core.$strip>;
135
+ };
136
+ };
137
+ };
138
+ //# sourceMappingURL=_shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_shared.d.ts","sourceRoot":"","sources":["../../src/routes/_shared.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAA;AAErC,eAAO,MAAM,gBAAgB;;iBAK3B,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEtC,CAAA;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGnB,CAAA;AAEV,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGpB,CAAA;AAEV,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAG5B,CAAA"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Shared OpenAPI building blocks used across workspace-scoped routes.
3
+ *
4
+ * Path parameters on parent app.route() mounts do not merge,
5
+ * into a child route's OpenAPI definitions.
6
+ * So each route under `/workspaces/:workspaceId/*` must re-declare it,
7
+ * naming `workspaceId` in its own `request.params`.
8
+ * Use `WorkspaceIdParam` to keep the declaration consistent.
9
+ */
10
+ import { BraidProblemJson, WorkspaceId } from '@braidhq/schema';
11
+ import { z } from '@hono/zod-openapi';
12
+ export const WorkspaceIdParam = z.object({
13
+ workspaceId: WorkspaceId.openapi({
14
+ param: { name: 'workspaceId', in: 'path' },
15
+ example: 'my-workspace',
16
+ }),
17
+ });
18
+ export const ProblemJsonResponseContent = {
19
+ 'application/problem+json': { schema: BraidProblemJson },
20
+ };
21
+ export const NotFoundResponse = {
22
+ description: 'The requested entity does not exist.',
23
+ content: ProblemJsonResponseContent,
24
+ };
25
+ export const ForbiddenResponse = {
26
+ description: 'The caller lacks permission for this action.',
27
+ content: ProblemJsonResponseContent,
28
+ };
29
+ export const ValidationFailureResponse = {
30
+ description: 'Request body or query failed validation.',
31
+ content: ProblemJsonResponseContent,
32
+ };
33
+ //# sourceMappingURL=_shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_shared.js","sourceRoot":"","sources":["../../src/routes/_shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAA;AAErC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC;QAC/B,KAAK,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,EAAE;QAC1C,OAAO,EAAE,cAAc;KACxB,CAAC;CACH,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,0BAA0B,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE;CACzD,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,WAAW,EAAE,sCAAsC;IACnD,OAAO,EAAE,0BAA0B;CAC3B,CAAA;AAEV,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,WAAW,EAAE,8CAA8C;IAC3D,OAAO,EAAE,0BAA0B;CAC3B,CAAA;AAEV,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,WAAW,EAAE,0CAA0C;IACvD,OAAO,EAAE,0BAA0B;CAC3B,CAAA"}
@@ -0,0 +1,13 @@
1
+ import type { WorkspaceService } from '@braidhq/core';
2
+ import type { AccessPolicy } from '../infrastructure/auth/AccessPolicy.js';
3
+ import type { UserRegistryFile } from '../infrastructure/users/UserRegistryFile.js';
4
+ import type { WorkspaceRegistryFile } from '../infrastructure/workspace/WorkspaceRegistryFile.js';
5
+ import { OpenAPIHono } from '@hono/zod-openapi';
6
+ export interface AdminRouterDeps {
7
+ userRegistry: UserRegistryFile;
8
+ accessPolicy: AccessPolicy;
9
+ workspaceRegistry: WorkspaceRegistryFile;
10
+ workspaceService: WorkspaceService;
11
+ }
12
+ export declare function createAdminRouter(deps: AdminRouterDeps): OpenAPIHono;
13
+ //# sourceMappingURL=admin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/routes/admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAA;AACnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAA;AAGjG,OAAO,EAAe,WAAW,EAAK,MAAM,mBAAmB,CAAA;AA6C/D,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,gBAAgB,CAAA;IAC9B,YAAY,EAAE,YAAY,CAAA;IAC1B,iBAAiB,EAAE,qBAAqB,CAAA;IACxC,gBAAgB,EAAE,gBAAgB,CAAA;CACnC;AAqHD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,GAAG,WAAW,CA2FpE"}