@braidhq/server 0.1.0 → 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.
- package/README.md +134 -106
- package/dist/app.d.ts +7 -15
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +72 -45
- package/dist/app.js.map +1 -1
- package/dist/authMode.d.ts +39 -0
- package/dist/authMode.d.ts.map +1 -0
- package/dist/authMode.js +50 -0
- package/dist/authMode.js.map +1 -0
- package/dist/composeApp.d.ts +79 -0
- package/dist/composeApp.d.ts.map +1 -0
- package/dist/composeApp.js +136 -0
- package/dist/composeApp.js.map +1 -0
- package/dist/composeFsApp.d.ts +27 -0
- package/dist/composeFsApp.d.ts.map +1 -0
- package/dist/{composeFs.js → composeFsApp.js} +118 -125
- package/dist/composeFsApp.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/_shared/env.d.ts +10 -0
- package/dist/infrastructure/_shared/env.d.ts.map +1 -0
- package/dist/infrastructure/{env.js → _shared/env.js} +5 -6
- package/dist/infrastructure/_shared/env.js.map +1 -0
- package/dist/infrastructure/_shared/frontmatter.d.ts +13 -0
- package/dist/infrastructure/_shared/frontmatter.d.ts.map +1 -0
- package/dist/infrastructure/{fs → _shared}/frontmatter.js +5 -5
- package/dist/infrastructure/_shared/frontmatter.js.map +1 -0
- package/dist/infrastructure/_shared/jsonFileStore.d.ts.map +1 -0
- package/dist/infrastructure/_shared/jsonFileStore.js.map +1 -0
- package/dist/infrastructure/{fs → _shared}/paths.d.ts +17 -10
- package/dist/infrastructure/_shared/paths.d.ts.map +1 -0
- package/dist/infrastructure/{fs → _shared}/paths.js +27 -20
- package/dist/infrastructure/_shared/paths.js.map +1 -0
- package/dist/infrastructure/auth/AccessPolicy.d.ts +33 -58
- package/dist/infrastructure/auth/AccessPolicy.d.ts.map +1 -1
- package/dist/infrastructure/auth/AccessPolicy.js +35 -42
- package/dist/infrastructure/auth/AccessPolicy.js.map +1 -1
- package/dist/infrastructure/auth/SessionStore.d.ts +22 -12
- package/dist/infrastructure/auth/SessionStore.d.ts.map +1 -1
- package/dist/infrastructure/auth/SessionStore.js +15 -18
- package/dist/infrastructure/auth/SessionStore.js.map +1 -1
- package/dist/infrastructure/batch/FsBatchPlanRepository.d.ts +79 -0
- package/dist/infrastructure/batch/FsBatchPlanRepository.d.ts.map +1 -0
- package/dist/infrastructure/{fs → batch}/FsBatchPlanRepository.js +1 -1
- package/dist/infrastructure/batch/FsBatchPlanRepository.js.map +1 -0
- package/dist/infrastructure/history/GitWorkspaceHistory.d.ts.map +1 -0
- package/dist/infrastructure/{git → history}/GitWorkspaceHistory.js +31 -24
- package/dist/infrastructure/history/GitWorkspaceHistory.js.map +1 -0
- package/dist/infrastructure/history/commitMessage.d.ts.map +1 -0
- package/dist/infrastructure/history/commitMessage.js +90 -0
- package/dist/infrastructure/history/commitMessage.js.map +1 -0
- package/dist/infrastructure/hitl/FsClarificationRepository.d.ts +13 -0
- package/dist/infrastructure/hitl/FsClarificationRepository.d.ts.map +1 -0
- package/dist/infrastructure/{fs/FsClarifyTicketRepository.js → hitl/FsClarificationRepository.js} +15 -15
- package/dist/infrastructure/hitl/FsClarificationRepository.js.map +1 -0
- package/dist/infrastructure/hitl/FsProposalRepository.d.ts.map +1 -0
- package/dist/infrastructure/{fs → hitl}/FsProposalRepository.js +7 -8
- package/dist/infrastructure/hitl/FsProposalRepository.js.map +1 -0
- package/dist/infrastructure/hitl/StatusedJsonStore.d.ts +30 -0
- package/dist/infrastructure/hitl/StatusedJsonStore.d.ts.map +1 -0
- package/dist/infrastructure/{fs/FsStatusedJsonRepository.js → hitl/StatusedJsonStore.js} +3 -3
- package/dist/infrastructure/hitl/StatusedJsonStore.js.map +1 -0
- package/dist/infrastructure/model/FsModelSerializer.d.ts +96 -0
- package/dist/infrastructure/model/FsModelSerializer.d.ts.map +1 -0
- package/dist/infrastructure/{fs/FsGraphSerializer.js → model/FsModelSerializer.js} +11 -11
- package/dist/infrastructure/model/FsModelSerializer.js.map +1 -0
- package/dist/infrastructure/oauth/GoogleOAuth.d.ts +20 -38
- package/dist/infrastructure/oauth/GoogleOAuth.d.ts.map +1 -1
- package/dist/infrastructure/oauth/GoogleOAuth.js +21 -22
- package/dist/infrastructure/oauth/GoogleOAuth.js.map +1 -1
- package/dist/infrastructure/reactor/FsReactorCycleRepository.d.ts +29 -0
- package/dist/infrastructure/reactor/FsReactorCycleRepository.d.ts.map +1 -0
- package/dist/infrastructure/reactor/FsReactorCycleRepository.js +94 -0
- package/dist/infrastructure/reactor/FsReactorCycleRepository.js.map +1 -0
- package/dist/infrastructure/secrets/SecretStore.d.ts +11 -14
- package/dist/infrastructure/secrets/SecretStore.d.ts.map +1 -1
- package/dist/infrastructure/secrets/SecretStore.js +4 -4
- package/dist/infrastructure/secrets/SecretStore.js.map +1 -1
- package/dist/infrastructure/{fs → skill}/FsRunRepository.d.ts +5 -3
- package/dist/infrastructure/skill/FsRunRepository.d.ts.map +1 -0
- package/dist/infrastructure/{fs → skill}/FsRunRepository.js +11 -9
- package/dist/infrastructure/skill/FsRunRepository.js.map +1 -0
- package/dist/infrastructure/{fs → skill}/FsSkillRegistry.d.ts +4 -13
- package/dist/infrastructure/skill/FsSkillRegistry.d.ts.map +1 -0
- package/dist/infrastructure/{fs → skill}/FsSkillRegistry.js +28 -20
- package/dist/infrastructure/skill/FsSkillRegistry.js.map +1 -0
- package/dist/infrastructure/skill/SubprocessSkillRunner.d.ts +52 -0
- package/dist/infrastructure/skill/SubprocessSkillRunner.d.ts.map +1 -0
- package/dist/infrastructure/{agent → skill}/SubprocessSkillRunner.js +107 -55
- package/dist/infrastructure/skill/SubprocessSkillRunner.js.map +1 -0
- package/dist/infrastructure/skill/asyncQueue.d.ts +20 -0
- package/dist/infrastructure/skill/asyncQueue.d.ts.map +1 -0
- package/dist/infrastructure/{agent → skill}/asyncQueue.js +2 -3
- package/dist/infrastructure/{agent → skill}/asyncQueue.js.map +1 -1
- package/dist/infrastructure/skill/lineBuffer.d.ts +15 -0
- package/dist/infrastructure/skill/lineBuffer.d.ts.map +1 -0
- package/dist/infrastructure/{agent/streamJsonParser.js → skill/lineBuffer.js} +5 -17
- package/dist/infrastructure/skill/lineBuffer.js.map +1 -0
- package/dist/infrastructure/skill/orphanReaper.d.ts +20 -0
- package/dist/infrastructure/skill/orphanReaper.d.ts.map +1 -0
- package/dist/infrastructure/{orphanReaper.js → skill/orphanReaper.js} +7 -5
- package/dist/infrastructure/skill/orphanReaper.js.map +1 -0
- package/dist/infrastructure/skill/subprocessEventStream.d.ts +16 -0
- package/dist/infrastructure/skill/subprocessEventStream.d.ts.map +1 -0
- package/dist/infrastructure/skill/subprocessEventStream.js +29 -0
- package/dist/infrastructure/skill/subprocessEventStream.js.map +1 -0
- package/dist/infrastructure/source/FsSourceUnitDigest.d.ts +19 -0
- package/dist/infrastructure/source/FsSourceUnitDigest.d.ts.map +1 -0
- package/dist/infrastructure/{fs → source}/FsSourceUnitDigest.js +9 -9
- package/dist/infrastructure/source/FsSourceUnitDigest.js.map +1 -0
- package/dist/infrastructure/source/FsSourceUnitObservationRepository.d.ts +31 -0
- package/dist/infrastructure/source/FsSourceUnitObservationRepository.d.ts.map +1 -0
- package/dist/infrastructure/{fs/FsSourceUnitStateRepository.js → source/FsSourceUnitObservationRepository.js} +18 -17
- package/dist/infrastructure/source/FsSourceUnitObservationRepository.js.map +1 -0
- package/dist/infrastructure/{fs → source}/intentScan.d.ts +4 -0
- package/dist/infrastructure/source/intentScan.d.ts.map +1 -0
- package/dist/infrastructure/{fs → source}/intentScan.js +18 -16
- package/dist/infrastructure/source/intentScan.js.map +1 -0
- package/dist/infrastructure/users/UserDirectoryFromRegistry.d.ts +2 -2
- package/dist/infrastructure/users/UserDirectoryFromRegistry.js +2 -2
- package/dist/infrastructure/users/UserRegistryFile.d.ts +4 -5
- package/dist/infrastructure/users/UserRegistryFile.d.ts.map +1 -1
- package/dist/infrastructure/users/UserRegistryFile.js +6 -8
- package/dist/infrastructure/users/UserRegistryFile.js.map +1 -1
- package/dist/infrastructure/users/ensureWorkspaceOwners.d.ts +9 -6
- package/dist/infrastructure/users/ensureWorkspaceOwners.d.ts.map +1 -1
- package/dist/infrastructure/users/ensureWorkspaceOwners.js +10 -7
- package/dist/infrastructure/users/ensureWorkspaceOwners.js.map +1 -1
- package/dist/infrastructure/workspace/FsWorkspaceRepository.d.ts.map +1 -0
- package/dist/infrastructure/{fs → workspace}/FsWorkspaceRepository.js +7 -6
- package/dist/infrastructure/workspace/FsWorkspaceRepository.js.map +1 -0
- package/dist/infrastructure/workspace/WorkspaceDiscovery.d.ts +18 -0
- package/dist/infrastructure/workspace/WorkspaceDiscovery.d.ts.map +1 -0
- package/dist/infrastructure/{fs → workspace}/WorkspaceDiscovery.js +15 -11
- package/dist/infrastructure/workspace/WorkspaceDiscovery.js.map +1 -0
- package/dist/infrastructure/{fs → workspace}/WorkspaceRegistryFile.d.ts +10 -9
- package/dist/infrastructure/workspace/WorkspaceRegistryFile.d.ts.map +1 -0
- package/dist/infrastructure/{fs → workspace}/WorkspaceRegistryFile.js +15 -17
- package/dist/infrastructure/workspace/WorkspaceRegistryFile.js.map +1 -0
- package/dist/infrastructure/workspace/productManifestWriter.d.ts +24 -0
- package/dist/infrastructure/workspace/productManifestWriter.d.ts.map +1 -0
- package/dist/infrastructure/{fs → workspace}/productManifestWriter.js +14 -26
- package/dist/infrastructure/workspace/productManifestWriter.js.map +1 -0
- package/dist/middleware/auth.d.ts +27 -17
- package/dist/middleware/auth.d.ts.map +1 -1
- package/dist/middleware/auth.js +59 -53
- package/dist/middleware/auth.js.map +1 -1
- package/dist/middleware/cors.d.ts.map +1 -1
- package/dist/middleware/cors.js +4 -1
- package/dist/middleware/cors.js.map +1 -1
- package/dist/middleware/error.d.ts.map +1 -1
- package/dist/middleware/error.js +15 -13
- package/dist/middleware/error.js.map +1 -1
- package/dist/middleware/workspaceAccess.d.ts +23 -19
- package/dist/middleware/workspaceAccess.d.ts.map +1 -1
- package/dist/middleware/workspaceAccess.js +31 -26
- package/dist/middleware/workspaceAccess.js.map +1 -1
- package/dist/policy/CapabilityCheck.d.ts +5 -5
- package/dist/policy/PermissionRegistry.d.ts +11 -9
- package/dist/policy/PermissionRegistry.d.ts.map +1 -1
- package/dist/policy/PermissionRegistry.js +10 -8
- package/dist/policy/PermissionRegistry.js.map +1 -1
- package/dist/policy/ViewerContext.d.ts +13 -11
- package/dist/policy/ViewerContext.d.ts.map +1 -1
- package/dist/policy/checks.d.ts +9 -9
- package/dist/policy/checks.d.ts.map +1 -1
- package/dist/policy/checks.js +14 -11
- package/dist/policy/checks.js.map +1 -1
- package/dist/policy/defaultRegistry.d.ts +3 -4
- package/dist/policy/defaultRegistry.d.ts.map +1 -1
- package/dist/policy/defaultRegistry.js +3 -4
- package/dist/policy/defaultRegistry.js.map +1 -1
- package/dist/policy/index.d.ts +2 -2
- package/dist/policy/index.d.ts.map +1 -1
- package/dist/policy/index.js +1 -1
- package/dist/policy/index.js.map +1 -1
- package/dist/policy/resolveViewer.d.ts +9 -9
- package/dist/policy/resolveViewer.js +9 -9
- package/dist/routes/_shared.d.ts +93 -153
- package/dist/routes/_shared.d.ts.map +1 -1
- package/dist/routes/_shared.js +9 -5
- package/dist/routes/_shared.js.map +1 -1
- package/dist/routes/admin.d.ts +1 -1
- package/dist/routes/admin.d.ts.map +1 -1
- package/dist/routes/admin.js +13 -12
- package/dist/routes/admin.js.map +1 -1
- package/dist/routes/auth.d.ts +12 -10
- package/dist/routes/auth.d.ts.map +1 -1
- package/dist/routes/auth.js +32 -34
- package/dist/routes/auth.js.map +1 -1
- package/dist/routes/clarifications.d.ts +8 -0
- package/dist/routes/clarifications.d.ts.map +1 -0
- package/dist/routes/clarifications.js +243 -0
- package/dist/routes/clarifications.js.map +1 -0
- package/dist/routes/edges.d.ts.map +1 -1
- package/dist/routes/edges.js +2 -6
- package/dist/routes/edges.js.map +1 -1
- package/dist/routes/history.d.ts.map +1 -1
- package/dist/routes/history.js +12 -10
- package/dist/routes/history.js.map +1 -1
- package/dist/routes/nodes.d.ts.map +1 -1
- package/dist/routes/nodes.js +4 -8
- package/dist/routes/nodes.js.map +1 -1
- package/dist/routes/oauth.d.ts +6 -7
- package/dist/routes/oauth.d.ts.map +1 -1
- package/dist/routes/oauth.js +6 -7
- package/dist/routes/oauth.js.map +1 -1
- package/dist/routes/proposals.d.ts +2 -2
- package/dist/routes/proposals.d.ts.map +1 -1
- package/dist/routes/proposals.js +30 -28
- package/dist/routes/proposals.js.map +1 -1
- package/dist/routes/reactorCycles.d.ts +7 -0
- package/dist/routes/reactorCycles.d.ts.map +1 -0
- package/dist/routes/reactorCycles.js +60 -0
- package/dist/routes/reactorCycles.js.map +1 -0
- package/dist/routes/runs.d.ts.map +1 -1
- package/dist/routes/runs.js +22 -19
- package/dist/routes/runs.js.map +1 -1
- package/dist/routes/skillInputOptions.d.ts +2 -2
- package/dist/routes/skillInputOptions.d.ts.map +1 -1
- package/dist/routes/skillInputOptions.js +43 -45
- package/dist/routes/skillInputOptions.js.map +1 -1
- package/dist/routes/skills.d.ts +19 -1
- package/dist/routes/skills.d.ts.map +1 -1
- package/dist/routes/skills.js +139 -7
- package/dist/routes/skills.js.map +1 -1
- package/dist/routes/sourceLoaders.d.ts.map +1 -1
- package/dist/routes/sourceLoaders.js +1 -0
- package/dist/routes/sourceLoaders.js.map +1 -1
- package/dist/routes/sourceUnitObservations.d.ts +20 -0
- package/dist/routes/sourceUnitObservations.d.ts.map +1 -0
- package/dist/routes/sourceUnitObservations.js +80 -0
- package/dist/routes/sourceUnitObservations.js.map +1 -0
- package/dist/routes/sourceWebhooks.d.ts +26 -0
- package/dist/routes/sourceWebhooks.d.ts.map +1 -0
- package/dist/routes/sourceWebhooks.js +301 -0
- package/dist/routes/sourceWebhooks.js.map +1 -0
- package/dist/routes/users.d.ts +0 -2
- package/dist/routes/users.d.ts.map +1 -1
- package/dist/routes/users.js +15 -33
- package/dist/routes/users.js.map +1 -1
- package/dist/routes/workspaceEvents.d.ts +5 -4
- package/dist/routes/workspaceEvents.d.ts.map +1 -1
- package/dist/routes/workspaceEvents.js +7 -6
- package/dist/routes/workspaceEvents.js.map +1 -1
- package/dist/routes/workspaceMembers.d.ts +1 -1
- package/dist/routes/workspaceMembers.d.ts.map +1 -1
- package/dist/routes/workspaceMembers.js +2 -2
- package/dist/routes/workspaceMembers.js.map +1 -1
- package/dist/routes/workspaces.d.ts +21 -10
- package/dist/routes/workspaces.d.ts.map +1 -1
- package/dist/routes/workspaces.js +97 -69
- package/dist/routes/workspaces.js.map +1 -1
- package/dist/server.js +6 -70
- package/dist/server.js.map +1 -1
- package/dist/startServer.d.ts +17 -0
- package/dist/startServer.d.ts.map +1 -0
- package/dist/startServer.js +81 -0
- package/dist/startServer.js.map +1 -0
- package/dist/startup.d.ts +28 -0
- package/dist/startup.d.ts.map +1 -0
- package/dist/startup.js +94 -0
- package/dist/startup.js.map +1 -0
- package/package.json +9 -9
- package/dist/composeFs.d.ts +0 -55
- package/dist/composeFs.d.ts.map +0 -1
- package/dist/composeFs.js.map +0 -1
- package/dist/composition.d.ts +0 -133
- package/dist/composition.d.ts.map +0 -1
- package/dist/composition.js +0 -113
- package/dist/composition.js.map +0 -1
- package/dist/infrastructure/agent/SubprocessSkillRunner.d.ts +0 -75
- package/dist/infrastructure/agent/SubprocessSkillRunner.d.ts.map +0 -1
- package/dist/infrastructure/agent/SubprocessSkillRunner.js.map +0 -1
- package/dist/infrastructure/agent/asyncQueue.d.ts +0 -22
- package/dist/infrastructure/agent/asyncQueue.d.ts.map +0 -1
- package/dist/infrastructure/agent/mcpConfig.d.ts +0 -38
- package/dist/infrastructure/agent/mcpConfig.d.ts.map +0 -1
- package/dist/infrastructure/agent/mcpConfig.js +0 -55
- package/dist/infrastructure/agent/mcpConfig.js.map +0 -1
- package/dist/infrastructure/agent/streamJsonParser.d.ts +0 -20
- package/dist/infrastructure/agent/streamJsonParser.d.ts.map +0 -1
- package/dist/infrastructure/agent/streamJsonParser.js.map +0 -1
- package/dist/infrastructure/agent/subprocessEventStream.d.ts +0 -26
- package/dist/infrastructure/agent/subprocessEventStream.d.ts.map +0 -1
- package/dist/infrastructure/agent/subprocessEventStream.js +0 -112
- package/dist/infrastructure/agent/subprocessEventStream.js.map +0 -1
- package/dist/infrastructure/auth/ensureApprovedEmails.d.ts +0 -16
- package/dist/infrastructure/auth/ensureApprovedEmails.d.ts.map +0 -1
- package/dist/infrastructure/auth/ensureApprovedEmails.js +0 -20
- package/dist/infrastructure/auth/ensureApprovedEmails.js.map +0 -1
- package/dist/infrastructure/env.d.ts +0 -11
- package/dist/infrastructure/env.d.ts.map +0 -1
- package/dist/infrastructure/env.js.map +0 -1
- package/dist/infrastructure/fs/FsBatchPlanRepository.d.ts +0 -300
- package/dist/infrastructure/fs/FsBatchPlanRepository.d.ts.map +0 -1
- package/dist/infrastructure/fs/FsBatchPlanRepository.js.map +0 -1
- package/dist/infrastructure/fs/FsClarifyTicketRepository.d.ts +0 -13
- package/dist/infrastructure/fs/FsClarifyTicketRepository.d.ts.map +0 -1
- package/dist/infrastructure/fs/FsClarifyTicketRepository.js.map +0 -1
- package/dist/infrastructure/fs/FsDecisionRepository.d.ts +0 -13
- package/dist/infrastructure/fs/FsDecisionRepository.d.ts.map +0 -1
- package/dist/infrastructure/fs/FsDecisionRepository.js +0 -56
- package/dist/infrastructure/fs/FsDecisionRepository.js.map +0 -1
- package/dist/infrastructure/fs/FsGraphSerializer.d.ts +0 -629
- package/dist/infrastructure/fs/FsGraphSerializer.d.ts.map +0 -1
- package/dist/infrastructure/fs/FsGraphSerializer.js.map +0 -1
- package/dist/infrastructure/fs/FsProposalRepository.d.ts.map +0 -1
- package/dist/infrastructure/fs/FsProposalRepository.js.map +0 -1
- package/dist/infrastructure/fs/FsRunRepository.d.ts.map +0 -1
- package/dist/infrastructure/fs/FsRunRepository.js.map +0 -1
- package/dist/infrastructure/fs/FsSkillRegistry.d.ts.map +0 -1
- package/dist/infrastructure/fs/FsSkillRegistry.js.map +0 -1
- package/dist/infrastructure/fs/FsSourceUnitDigest.d.ts +0 -19
- package/dist/infrastructure/fs/FsSourceUnitDigest.d.ts.map +0 -1
- package/dist/infrastructure/fs/FsSourceUnitDigest.js.map +0 -1
- package/dist/infrastructure/fs/FsSourceUnitStateRepository.d.ts +0 -30
- package/dist/infrastructure/fs/FsSourceUnitStateRepository.d.ts.map +0 -1
- package/dist/infrastructure/fs/FsSourceUnitStateRepository.js.map +0 -1
- package/dist/infrastructure/fs/FsStatusedJsonRepository.d.ts +0 -35
- package/dist/infrastructure/fs/FsStatusedJsonRepository.d.ts.map +0 -1
- package/dist/infrastructure/fs/FsStatusedJsonRepository.js.map +0 -1
- package/dist/infrastructure/fs/FsWorkspaceRepository.d.ts.map +0 -1
- package/dist/infrastructure/fs/FsWorkspaceRepository.js.map +0 -1
- package/dist/infrastructure/fs/WorkspaceDiscovery.d.ts +0 -15
- package/dist/infrastructure/fs/WorkspaceDiscovery.d.ts.map +0 -1
- package/dist/infrastructure/fs/WorkspaceDiscovery.js.map +0 -1
- package/dist/infrastructure/fs/WorkspaceRegistryFile.d.ts.map +0 -1
- package/dist/infrastructure/fs/WorkspaceRegistryFile.js.map +0 -1
- package/dist/infrastructure/fs/frontmatter.d.ts +0 -13
- package/dist/infrastructure/fs/frontmatter.d.ts.map +0 -1
- package/dist/infrastructure/fs/frontmatter.js.map +0 -1
- package/dist/infrastructure/fs/intentScan.d.ts.map +0 -1
- package/dist/infrastructure/fs/intentScan.js.map +0 -1
- package/dist/infrastructure/fs/jsonFileStore.d.ts.map +0 -1
- package/dist/infrastructure/fs/jsonFileStore.js.map +0 -1
- package/dist/infrastructure/fs/paths.d.ts.map +0 -1
- package/dist/infrastructure/fs/paths.js.map +0 -1
- package/dist/infrastructure/fs/productManifestWriter.d.ts +0 -22
- package/dist/infrastructure/fs/productManifestWriter.d.ts.map +0 -1
- package/dist/infrastructure/fs/productManifestWriter.js.map +0 -1
- package/dist/infrastructure/git/GitWorkspaceHistory.d.ts.map +0 -1
- package/dist/infrastructure/git/GitWorkspaceHistory.js.map +0 -1
- package/dist/infrastructure/git/commitMessage.d.ts.map +0 -1
- package/dist/infrastructure/git/commitMessage.js +0 -71
- package/dist/infrastructure/git/commitMessage.js.map +0 -1
- package/dist/infrastructure/orphanReaper.d.ts +0 -18
- package/dist/infrastructure/orphanReaper.d.ts.map +0 -1
- package/dist/infrastructure/orphanReaper.js.map +0 -1
- package/dist/infrastructure/users/ensureLocalUser.d.ts +0 -15
- package/dist/infrastructure/users/ensureLocalUser.d.ts.map +0 -1
- package/dist/infrastructure/users/ensureLocalUser.js +0 -38
- package/dist/infrastructure/users/ensureLocalUser.js.map +0 -1
- package/dist/middleware/requireAdmin.d.ts +0 -10
- package/dist/middleware/requireAdmin.d.ts.map +0 -1
- package/dist/middleware/requireAdmin.js +0 -24
- package/dist/middleware/requireAdmin.js.map +0 -1
- package/dist/middleware/userId.d.ts +0 -16
- package/dist/middleware/userId.d.ts.map +0 -1
- package/dist/middleware/userId.js +0 -27
- package/dist/middleware/userId.js.map +0 -1
- package/dist/policy/Capability.d.ts +0 -12
- package/dist/policy/Capability.d.ts.map +0 -1
- package/dist/policy/Capability.js +0 -31
- package/dist/policy/Capability.js.map +0 -1
- package/dist/routes/clarify.d.ts +0 -9
- package/dist/routes/clarify.d.ts.map +0 -1
- package/dist/routes/clarify.js +0 -274
- package/dist/routes/clarify.js.map +0 -1
- package/dist/routes/decisions.d.ts +0 -7
- package/dist/routes/decisions.d.ts.map +0 -1
- package/dist/routes/decisions.js +0 -68
- package/dist/routes/decisions.js.map +0 -1
- package/dist/routes/sourceUnitStates.d.ts +0 -7
- package/dist/routes/sourceUnitStates.d.ts.map +0 -1
- package/dist/routes/sourceUnitStates.js +0 -45
- package/dist/routes/sourceUnitStates.js.map +0 -1
- /package/dist/infrastructure/{fs → _shared}/jsonFileStore.d.ts +0 -0
- /package/dist/infrastructure/{fs → _shared}/jsonFileStore.js +0 -0
- /package/dist/infrastructure/{git → history}/GitWorkspaceHistory.d.ts +0 -0
- /package/dist/infrastructure/{git → history}/commitMessage.d.ts +0 -0
- /package/dist/infrastructure/{fs → hitl}/FsProposalRepository.d.ts +0 -0
- /package/dist/infrastructure/{fs → workspace}/FsWorkspaceRepository.d.ts +0 -0
|
@@ -2,15 +2,18 @@ import { readdir, stat } from 'node:fs/promises';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { createLogger } from '@braidhq/core';
|
|
4
4
|
/**
|
|
5
|
-
* Walk `<workspacesRoot>/*` and register
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* Walk `<workspacesRoot>/*` and register with the WorkspaceService,
|
|
6
|
+
* every subdirectory that owns a `PRODUCT.md`.
|
|
7
|
+
* It is idempotent,
|
|
8
|
+
* an already-registered workspace is a no-op against the FS registry.
|
|
9
|
+
* We run it on server boot,
|
|
10
|
+
* so CLI-created or hand-copied workspaces surface in Studio,
|
|
11
|
+
* without any explicit `register` step.
|
|
10
12
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
13
|
+
* A per-entry error, a corrupt PRODUCT.md or bad permissions,
|
|
14
|
+
* is logged and skipped.
|
|
15
|
+
* The server must still come up,
|
|
16
|
+
* so the user can fix the outlier and re-boot.
|
|
14
17
|
*/
|
|
15
18
|
export async function discoverCanonicalWorkspaces(workspacesRoot, workspaceService) {
|
|
16
19
|
const log = createLogger('server').child({ mod: 'workspace-discovery' });
|
|
@@ -19,9 +22,10 @@ export async function discoverCanonicalWorkspaces(workspacesRoot, workspaceServi
|
|
|
19
22
|
entries = await readdir(workspacesRoot);
|
|
20
23
|
}
|
|
21
24
|
catch (err) {
|
|
22
|
-
// ENOENT on first boot is expected
|
|
23
|
-
// the
|
|
24
|
-
//
|
|
25
|
+
// ENOENT on first boot is expected,
|
|
26
|
+
// the dir is created lazily by the first scaffold.
|
|
27
|
+
// Any other error, such as bad permissions, we log and continue.
|
|
28
|
+
// The server still boots.
|
|
25
29
|
if (err.code !== 'ENOENT')
|
|
26
30
|
log.warn({ err, workspacesRoot }, 'failed to read workspaces root');
|
|
27
31
|
return;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceDiscovery.js","sourceRoot":"","sources":["../../../src/infrastructure/workspace/WorkspaceDiscovery.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,cAA4B,EAC5B,gBAAkC;IAElC,MAAM,GAAG,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,qBAAqB,EAAE,CAAC,CAAA;IACxE,IAAI,OAAiB,CAAA;IACrB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,GAAG,EAAE,CAAC;QACX,oCAAoC;QACpC,mDAAmD;QACnD,iEAAiE;QACjE,0BAA0B;QAC1B,IAAK,GAA6B,CAAC,IAAI,KAAK,QAAQ;YAClD,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE,gCAAgC,CAAC,CAAA;QACrE,OAAM;IACR,CAAC;IAED,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,EAAE,KAAK,CAAiB,CAAA;QAC5D,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAA;YACpC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;gBACxB,SAAQ;YACV,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;YACpF,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE;gBACzB,SAAQ;YACV,MAAM,SAAS,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YACvD,MAAM,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QACxC,CAAC;QACD,OAAO,GAAG,EAAE,CAAC;YACX,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,mCAAmC,CAAC,CAAA;QAClE,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AbsolutePath, UserId, WorkspaceMember, WorkspaceRole } from '@braidhq/schema';
|
|
2
2
|
/**
|
|
3
3
|
* Persists the list of registered workspace rootPaths to a JSON file.
|
|
4
|
-
* Default location is `${BRAID_HOME}/workspaces.json
|
|
5
|
-
* Acts as the source of truth across server restarts
|
|
6
|
-
* `FsWorkspaceRepository` cache
|
|
4
|
+
* Default location is `${BRAID_HOME}/workspaces.json`, set by the caller.
|
|
5
|
+
* Acts as the source of truth across server restarts,
|
|
6
|
+
* the in-memory `FsWorkspaceRepository` cache rebuilds from it on cold start.
|
|
7
7
|
*/
|
|
8
8
|
export declare class WorkspaceRegistryFile {
|
|
9
9
|
private readonly filePath;
|
|
@@ -13,8 +13,8 @@ export declare class WorkspaceRegistryFile {
|
|
|
13
13
|
remove(rootPath: AbsolutePath): Promise<void>;
|
|
14
14
|
listMembers(rootPath: AbsolutePath): Promise<WorkspaceMember[]>;
|
|
15
15
|
/**
|
|
16
|
-
* All entries with their members in one read.
|
|
17
|
-
* to user
|
|
16
|
+
* All entries with their members in one read. An admin view can then,
|
|
17
|
+
* invert to a user-to-workspaces map, with no N+1 reads of the file.
|
|
18
18
|
*/
|
|
19
19
|
listAllWithMembers(): Promise<ReadonlyArray<{
|
|
20
20
|
rootPath: AbsolutePath;
|
|
@@ -28,10 +28,11 @@ export declare class WorkspaceRegistryFile {
|
|
|
28
28
|
}): Promise<WorkspaceMember>;
|
|
29
29
|
removeMember(rootPath: AbsolutePath, userId: UserId): Promise<void>;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
31
|
+
* In one atomic write, demote the current owner to maintainer,
|
|
32
|
+
* and promote `newOwnerId` to owner.
|
|
33
|
+
* If the target is not yet a maintainer here, this throws.
|
|
34
|
+
* We never auto-add the target,
|
|
35
|
+
* so the caller must add them first when that is needed.
|
|
35
36
|
*/
|
|
36
37
|
transferOwnership(rootPath: AbsolutePath, newOwnerId: UserId): Promise<void>;
|
|
37
38
|
private requireEntry;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceRegistryFile.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/workspace/WorkspaceRegistryFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AA2B3F;;;;;GAKG;AACH,qBAAa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,MAAM;IAEvC,IAAI,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAK/B,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAW1E,MAAM,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ7C,WAAW,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAKrE;;;OAGG;IACG,kBAAkB,IAAI,OAAO,CAAC,aAAa,CAAC;QAAE,QAAQ,EAAE,YAAY,CAAC;QAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAA;KAAE,CAAC,CAAC;IAK7G,SAAS,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAKvF,SAAS,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAazE,YAAY,CAChB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,aAAa,CAAC;QAAC,cAAc,CAAC,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAA;KAAE,GAClF,OAAO,CAAC,eAAe,CAAC;IAoBrB,YAAY,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAczE;;;;;;OAMG;IACG,iBAAiB,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAiBpE,YAAY;YAQZ,IAAI;YAgBJ,KAAK;CAIpB"}
|
|
@@ -3,14 +3,11 @@ import { dirname } from 'node:path';
|
|
|
3
3
|
import { NotFoundError, ValidationError } from '@braidhq/core';
|
|
4
4
|
import { AbsolutePath as AbsolutePathSchema, WorkspaceMember as WorkspaceMemberSchema, } from '@braidhq/schema';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* owner so the single-tenant install keeps working without manual
|
|
12
|
-
* migration.
|
|
13
|
-
*/
|
|
6
|
+
// The registry stores a per-workspace `members[]` list alongside `rootPath`.
|
|
7
|
+
// Old shapes carrying only `rootPath` are accepted by `.default([])`,
|
|
8
|
+
// then lazily upgraded on the next write.
|
|
9
|
+
// `ensureWorkspaceOwners` in `composeFsApp` seeds the default owner,
|
|
10
|
+
// so the single-tenant install keeps working without any manual migration.
|
|
14
11
|
const RegistryEntry = z.object({
|
|
15
12
|
rootPath: AbsolutePathSchema,
|
|
16
13
|
members: z.array(WorkspaceMemberSchema).default([]),
|
|
@@ -20,9 +17,9 @@ const RegistryContent = z.object({
|
|
|
20
17
|
});
|
|
21
18
|
/**
|
|
22
19
|
* Persists the list of registered workspace rootPaths to a JSON file.
|
|
23
|
-
* Default location is `${BRAID_HOME}/workspaces.json
|
|
24
|
-
* Acts as the source of truth across server restarts
|
|
25
|
-
* `FsWorkspaceRepository` cache
|
|
20
|
+
* Default location is `${BRAID_HOME}/workspaces.json`, set by the caller.
|
|
21
|
+
* Acts as the source of truth across server restarts,
|
|
22
|
+
* the in-memory `FsWorkspaceRepository` cache rebuilds from it on cold start.
|
|
26
23
|
*/
|
|
27
24
|
export class WorkspaceRegistryFile {
|
|
28
25
|
filePath;
|
|
@@ -55,8 +52,8 @@ export class WorkspaceRegistryFile {
|
|
|
55
52
|
return entry.members;
|
|
56
53
|
}
|
|
57
54
|
/**
|
|
58
|
-
* All entries with their members in one read.
|
|
59
|
-
* to user
|
|
55
|
+
* All entries with their members in one read. An admin view can then,
|
|
56
|
+
* invert to a user-to-workspaces map, with no N+1 reads of the file.
|
|
60
57
|
*/
|
|
61
58
|
async listAllWithMembers() {
|
|
62
59
|
const content = await this.read();
|
|
@@ -111,10 +108,11 @@ export class WorkspaceRegistryFile {
|
|
|
111
108
|
await this.write(content);
|
|
112
109
|
}
|
|
113
110
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
111
|
+
* In one atomic write, demote the current owner to maintainer,
|
|
112
|
+
* and promote `newOwnerId` to owner.
|
|
113
|
+
* If the target is not yet a maintainer here, this throws.
|
|
114
|
+
* We never auto-add the target,
|
|
115
|
+
* so the caller must add them first when that is needed.
|
|
118
116
|
*/
|
|
119
117
|
async transferOwnership(rootPath, newOwnerId) {
|
|
120
118
|
const content = await this.read();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceRegistryFile.js","sourceRoot":"","sources":["../../../src/infrastructure/workspace/WorkspaceRegistryFile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,EACL,YAAY,IAAI,kBAAkB,EAClC,eAAe,IAAI,qBAAqB,GACzC,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,6EAA6E;AAC7E,sEAAsE;AACtE,0CAA0C;AAC1C,qEAAqE;AACrE,2EAA2E;AAC3E,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,QAAQ,EAAE,kBAAkB;IAC5B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CACpD,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAC/C,CAAC,CAAA;AAKF;;;;;GAKG;AACH,MAAM,OAAO,qBAAqB;IACH;IAA7B,YAA6B,QAAgB;QAAhB,aAAQ,GAAR,QAAQ,CAAQ;IAAG,CAAC;IAEjD,KAAK,CAAC,IAAI;QACR,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;QACjC,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAA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Q;gBACpD,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,CAAA;YAC3B,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,KAAK,CAAC,OAAwB;QAC1C,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QACxD,MAAM,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAClF,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ProductManifest, ProductManifestCreate } from '@braidhq/schema';
|
|
2
|
+
/**
|
|
3
|
+
* Take a user-provided `ProductManifestCreate` and fill in the structure,
|
|
4
|
+
* such as the storage block, so the result is a complete `ProductManifest`,
|
|
5
|
+
* that Zod will accept.
|
|
6
|
+
* Throws if the user's own input is inconsistent.
|
|
7
|
+
*/
|
|
8
|
+
export declare function fillManifestDefaults(draft: ProductManifestCreate): ProductManifest;
|
|
9
|
+
/**
|
|
10
|
+
* Render a `ProductManifest` as YAML-frontmatter markdown,
|
|
11
|
+
* then write it to `<workspaceRoot>/PRODUCT.md`.
|
|
12
|
+
* A missing parent directory is created first,
|
|
13
|
+
* and an existing PRODUCT.md is overwritten.
|
|
14
|
+
*/
|
|
15
|
+
export declare function writeProductManifest(workspaceRoot: string, manifest: ProductManifest, bodyTitle?: string): Promise<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Replace the YAML frontmatter of an existing PRODUCT.md,
|
|
18
|
+
* preserving the markdown body underneath.
|
|
19
|
+
* Workspace mutation endpoints call this,
|
|
20
|
+
* so user prose below the frontmatter survives an update.
|
|
21
|
+
* The file must exist, otherwise this throws.
|
|
22
|
+
*/
|
|
23
|
+
export declare function updateProductManifest(workspaceRoot: string, manifest: ProductManifest): Promise<string>;
|
|
24
|
+
//# sourceMappingURL=productManifestWriter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productManifestWriter.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/workspace/productManifestWriter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EAGtB,MAAM,iBAAiB,CAAA;AAcxB;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,qBAAqB,GAAG,eAAe,CAWlF;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAShI;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ7G"}
|
|
@@ -2,29 +2,17 @@ import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { OntologyId, ProductManifest as ProductManifestSchema } from '@braidhq/schema';
|
|
4
4
|
import { stringify as stringifyYaml } from 'yaml';
|
|
5
|
-
import { parseMarkdownFrontmatter } from '
|
|
5
|
+
import { parseMarkdownFrontmatter } from '../_shared/frontmatter.js';
|
|
6
6
|
const FRONTMATTER_DELIMITER = '---';
|
|
7
|
-
const DEFAULT_AGENT_BINDING = {
|
|
8
|
-
id: 'claude-default',
|
|
9
|
-
kind: 'claude-code',
|
|
10
|
-
model: 'opus',
|
|
11
|
-
effort: 'high',
|
|
12
|
-
extraArgs: [],
|
|
13
|
-
env: {},
|
|
14
|
-
};
|
|
15
|
-
const DEFAULT_AGENTS = {
|
|
16
|
-
default: 'claude-default',
|
|
17
|
-
tasks: {},
|
|
18
|
-
};
|
|
19
7
|
const DEFAULT_STORAGE = {
|
|
20
8
|
kind: 'kuzu',
|
|
21
9
|
config: {},
|
|
22
10
|
};
|
|
23
11
|
/**
|
|
24
|
-
* Take a user-provided `
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* inconsistent.
|
|
12
|
+
* Take a user-provided `ProductManifestCreate` and fill in the structure,
|
|
13
|
+
* such as the storage block, so the result is a complete `ProductManifest`,
|
|
14
|
+
* that Zod will accept.
|
|
15
|
+
* Throws if the user's own input is inconsistent.
|
|
28
16
|
*/
|
|
29
17
|
export function fillManifestDefaults(draft) {
|
|
30
18
|
const manifest = {
|
|
@@ -34,16 +22,15 @@ export function fillManifestDefaults(draft) {
|
|
|
34
22
|
ontologyId: draft.ontologyId ?? OntologyId.parse('ddd'),
|
|
35
23
|
sources: draft.sources,
|
|
36
24
|
mcpServers: draft.mcpServers,
|
|
37
|
-
agents: draft.agents ?? DEFAULT_AGENTS,
|
|
38
|
-
agentBindings: draft.agentBindings ?? [DEFAULT_AGENT_BINDING],
|
|
39
25
|
storage: draft.storage ?? DEFAULT_STORAGE,
|
|
40
26
|
};
|
|
41
27
|
return ProductManifestSchema.parse(manifest);
|
|
42
28
|
}
|
|
43
29
|
/**
|
|
44
|
-
* Render a `ProductManifest` as YAML-frontmatter markdown
|
|
45
|
-
* to `<workspaceRoot>/PRODUCT.md`.
|
|
46
|
-
* missing
|
|
30
|
+
* Render a `ProductManifest` as YAML-frontmatter markdown,
|
|
31
|
+
* then write it to `<workspaceRoot>/PRODUCT.md`.
|
|
32
|
+
* A missing parent directory is created first,
|
|
33
|
+
* and an existing PRODUCT.md is overwritten.
|
|
47
34
|
*/
|
|
48
35
|
export async function writeProductManifest(workspaceRoot, manifest, bodyTitle) {
|
|
49
36
|
await mkdir(workspaceRoot, { recursive: true });
|
|
@@ -56,10 +43,11 @@ export async function writeProductManifest(workspaceRoot, manifest, bodyTitle) {
|
|
|
56
43
|
return path;
|
|
57
44
|
}
|
|
58
45
|
/**
|
|
59
|
-
* Replace the YAML frontmatter of an existing PRODUCT.md
|
|
60
|
-
* markdown body underneath.
|
|
61
|
-
*
|
|
62
|
-
*
|
|
46
|
+
* Replace the YAML frontmatter of an existing PRODUCT.md,
|
|
47
|
+
* preserving the markdown body underneath.
|
|
48
|
+
* Workspace mutation endpoints call this,
|
|
49
|
+
* so user prose below the frontmatter survives an update.
|
|
50
|
+
* The file must exist, otherwise this throws.
|
|
63
51
|
*/
|
|
64
52
|
export async function updateProductManifest(workspaceRoot, manifest) {
|
|
65
53
|
const path = join(workspaceRoot, 'PRODUCT.md');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productManifestWriter.js","sourceRoot":"","sources":["../../../src/infrastructure/workspace/productManifestWriter.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACtF,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAA;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AAEpE,MAAM,qBAAqB,GAAG,KAAK,CAAA;AAEnC,MAAM,eAAe,GAAsB;IACzC,IAAI,EAAE,MAAqB;IAC3B,MAAM,EAAE,EAAE;CACX,CAAA;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAA4B;IAC/D,MAAM,QAAQ,GAAG;QACf,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,OAAO;QACjC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,UAAU,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EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAA;IACzE,MAAM,OAAO,GAAG,GAAG,qBAAqB,KAAK,IAAI,KAAK,qBAAqB,KAAK,IAAI,EAAE,CAAA;IACtF,MAAM,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;IACvC,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1,29 +1,39 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UserId as UserIdType } from '@braidhq/schema';
|
|
2
|
+
import type { Context, MiddlewareHandler } from 'hono';
|
|
2
3
|
import type { SessionStore } from '../infrastructure/auth/SessionStore.js';
|
|
4
|
+
declare module 'hono' {
|
|
5
|
+
interface ContextVariableMap {
|
|
6
|
+
userId: UserIdType;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
3
9
|
export interface AuthMiddlewareOptions {
|
|
4
|
-
readonly sessionStore
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* fallback (local-user via env / header) take over. The Tauri
|
|
8
|
-
* embedded sidecar sets this so the local install keeps working
|
|
9
|
-
* without an OAuth round trip; a remote deployment leaves it false
|
|
10
|
-
* so anonymous traffic is rejected.
|
|
11
|
-
*
|
|
12
|
-
* Resolution: explicit option > `BRAID_LOCAL_TRUST=true` env var.
|
|
13
|
-
* Defaults to `false` when neither is set — composeFs flips this
|
|
14
|
-
* to `true` for local development.
|
|
15
|
-
*/
|
|
16
|
-
readonly localTrust?: boolean;
|
|
10
|
+
readonly sessionStore?: SessionStore;
|
|
11
|
+
readonly requireAuth: boolean;
|
|
12
|
+
readonly defaultPrincipal: UserIdType | null;
|
|
17
13
|
}
|
|
18
14
|
/**
|
|
19
|
-
* Pull a Bearer token off the request,
|
|
20
|
-
* header is missing
|
|
21
|
-
*
|
|
15
|
+
* Pull a Bearer token off the request,
|
|
16
|
+
* returning `undefined` when the header is missing or malformed.
|
|
17
|
+
* Route handlers use this to forward the caller's identity,
|
|
18
|
+
* reaching spawned skill subprocesses without reparsing.
|
|
22
19
|
*/
|
|
23
20
|
export declare function extractBearerToken(context: {
|
|
24
21
|
req: {
|
|
25
22
|
header: (name: string) => string | undefined;
|
|
26
23
|
};
|
|
27
24
|
}): string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Establish the caller's identity, and gate when auth is enforced.
|
|
27
|
+
* The single place a request's `userId` is resolved.
|
|
28
|
+
*
|
|
29
|
+
* Under local trust, identity comes from `X-Braid-User`, else the default
|
|
30
|
+
* principal, on every path so public routes like `/auth/whoami` see the caller.
|
|
31
|
+
* Nothing is rejected.
|
|
32
|
+
*
|
|
33
|
+
* When auth is enforced, identity comes only from a valid Bearer session, and a
|
|
34
|
+
* missing or invalid token on a non-public route is a 401. The header is never
|
|
35
|
+
* read here, so it cannot impersonate an authenticated caller.
|
|
36
|
+
*/
|
|
28
37
|
export declare function authMiddleware(options: AuthMiddlewareOptions): MiddlewareHandler;
|
|
38
|
+
export declare function getUserId(context: Context): UserIdType;
|
|
29
39
|
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/middleware/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/middleware/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAI1E,OAAO,QAAQ,MAAM,CAAC;IACpB,UAAU,kBAAkB;QAC1B,MAAM,EAAE,UAAU,CAAA;KACnB;CACF;AAoBD,MAAM,WAAW,qBAAqB;IAEpC,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAA;IAEpC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAE7B,QAAQ,CAAC,gBAAgB,EAAE,UAAU,GAAG,IAAI,CAAA;CAC7C;AAWD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAAE,GAAG,EAAE;QAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAA;KAAE,CAAA;CAAE,GAAG,MAAM,GAAG,SAAS,CAMzH;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,iBAAiB,CAkChF;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,CAEtD"}
|
package/dist/middleware/auth.js
CHANGED
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
//
|
|
20
|
-
//
|
|
1
|
+
import { UnauthorizedError } from '@braidhq/core';
|
|
2
|
+
import { UserId } from '@braidhq/schema';
|
|
3
|
+
// Routes the auth middleware never gates,
|
|
4
|
+
// since bootstrapping the login flow needs anonymous access.
|
|
5
|
+
// `/openapi.json` follows the convention that OpenAPI reads publicly,
|
|
6
|
+
// honored by Swagger UI, codegen, and MCP gateways.
|
|
7
|
+
// It documents shape and not data, so exposing it to anonymous callers is safe.
|
|
8
|
+
const PUBLIC_EXACT_PATHS = new Set(['/openapi.json']);
|
|
9
|
+
// Each `/webhooks/<provider>/` prefix is anonymous,
|
|
10
|
+
// because the provider authenticates via a per-source HMAC,
|
|
11
|
+
// checked inside the handler rather than via a Bearer token.
|
|
12
|
+
// Listing providers one by one, rather than the broad `/webhooks/`,
|
|
13
|
+
// keeps a future admin or metrics webhook from inheriting the bypass.
|
|
14
|
+
const PUBLIC_PATH_PREFIXES = ['/auth/', '/health', '/webhooks/github/'];
|
|
15
|
+
// Header naming the caller under local trust, a dev and multi-persona convenience.
|
|
16
|
+
// Read only when auth is not enforced, never on an authenticated deployment,
|
|
17
|
+
// so it can never impersonate a caller behind real auth.
|
|
18
|
+
const USER_HEADER = 'X-Braid-User';
|
|
19
|
+
// EventSource (browser SSE) cannot send custom Authorization headers,
|
|
20
|
+
// so live-update endpoints also accept a `token` query parameter,
|
|
21
|
+
// treated as a Bearer token.
|
|
22
|
+
// Limited to paths ending in `/events`,
|
|
23
|
+
// so the lenient path never applies to mutating routes.
|
|
21
24
|
function isSseEventsPath(path) {
|
|
22
25
|
return path.endsWith('/events');
|
|
23
26
|
}
|
|
24
27
|
/**
|
|
25
|
-
* Pull a Bearer token off the request,
|
|
26
|
-
* header is missing
|
|
27
|
-
*
|
|
28
|
+
* Pull a Bearer token off the request,
|
|
29
|
+
* returning `undefined` when the header is missing or malformed.
|
|
30
|
+
* Route handlers use this to forward the caller's identity,
|
|
31
|
+
* reaching spawned skill subprocesses without reparsing.
|
|
28
32
|
*/
|
|
29
33
|
export function extractBearerToken(context) {
|
|
30
34
|
const header = context.req.header('Authorization');
|
|
@@ -33,49 +37,51 @@ export function extractBearerToken(context) {
|
|
|
33
37
|
const token = header.slice('Bearer '.length).trim();
|
|
34
38
|
return token.length > 0 ? token : undefined;
|
|
35
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Establish the caller's identity, and gate when auth is enforced.
|
|
42
|
+
* The single place a request's `userId` is resolved.
|
|
43
|
+
*
|
|
44
|
+
* Under local trust, identity comes from `X-Braid-User`, else the default
|
|
45
|
+
* principal, on every path so public routes like `/auth/whoami` see the caller.
|
|
46
|
+
* Nothing is rejected.
|
|
47
|
+
*
|
|
48
|
+
* When auth is enforced, identity comes only from a valid Bearer session, and a
|
|
49
|
+
* missing or invalid token on a non-public route is a 401. The header is never
|
|
50
|
+
* read here, so it cannot impersonate an authenticated caller.
|
|
51
|
+
*/
|
|
36
52
|
export function authMiddleware(options) {
|
|
37
|
-
const localTrust = options.localTrust ?? parseBoolEnv(process.env.BRAID_LOCAL_TRUST, false);
|
|
38
53
|
return async (context, next) => {
|
|
39
54
|
const path = context.req.path;
|
|
40
|
-
if (
|
|
55
|
+
if (!options.requireAuth) {
|
|
56
|
+
const header = context.req.header(USER_HEADER);
|
|
57
|
+
const fromHeader = header && header.length > 0 ? UserId.parse(header) : null;
|
|
58
|
+
const resolved = fromHeader ?? options.defaultPrincipal;
|
|
59
|
+
if (resolved)
|
|
60
|
+
context.set('userId', resolved);
|
|
41
61
|
await next();
|
|
42
62
|
return undefined;
|
|
43
63
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// dev). The auth layer has no opinion here.
|
|
64
|
+
// Public routes bootstrap the login flow, so pass them through ungated,
|
|
65
|
+
// and without reading the header, they must never carry a caller.
|
|
66
|
+
if (PUBLIC_EXACT_PATHS.has(path) || PUBLIC_PATH_PREFIXES.some(prefix => path.startsWith(prefix))) {
|
|
48
67
|
await next();
|
|
49
68
|
return undefined;
|
|
50
69
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (!token
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
token = queryToken;
|
|
58
|
-
}
|
|
59
|
-
if (!token) {
|
|
60
|
-
return context.json({
|
|
61
|
-
type: 'about:blank',
|
|
62
|
-
title: 'Unauthorized',
|
|
63
|
-
status: 401,
|
|
64
|
-
detail: 'Missing or invalid Authorization header. Sign in to continue.',
|
|
65
|
-
}, 401, { 'Content-Type': 'application/problem+json' });
|
|
66
|
-
}
|
|
70
|
+
let token = extractBearerToken(context);
|
|
71
|
+
if (!token && isSseEventsPath(path))
|
|
72
|
+
token = context.req.query('token') || undefined;
|
|
73
|
+
if (!token)
|
|
74
|
+
throw new UnauthorizedError('Missing or invalid Authorization header. Sign in to continue.');
|
|
75
|
+
// The composition root always wires sessionStore alongside requireAuth.
|
|
67
76
|
const session = await options.sessionStore.resolve(token);
|
|
68
|
-
if (!session)
|
|
69
|
-
|
|
70
|
-
type: 'about:blank',
|
|
71
|
-
title: 'Unauthorized',
|
|
72
|
-
status: 401,
|
|
73
|
-
detail: 'Session expired or revoked. Sign in again.',
|
|
74
|
-
}, 401, { 'Content-Type': 'application/problem+json' });
|
|
75
|
-
}
|
|
77
|
+
if (!session)
|
|
78
|
+
throw new UnauthorizedError('Session expired or revoked. Sign in again.');
|
|
76
79
|
context.set('userId', session.userId);
|
|
77
80
|
await next();
|
|
78
81
|
return undefined;
|
|
79
82
|
};
|
|
80
83
|
}
|
|
84
|
+
export function getUserId(context) {
|
|
85
|
+
return context.get('userId');
|
|
86
|
+
}
|
|
81
87
|
//# sourceMappingURL=auth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/middleware/auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/middleware/auth.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAQxC,0CAA0C;AAC1C,6DAA6D;AAC7D,sEAAsE;AACtE,oDAAoD;AACpD,gFAAgF;AAChF,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,eAAe,CAAC,CAAC,CAAA;AACrD,oDAAoD;AACpD,4DAA4D;AAC5D,6DAA6D;AAC7D,oEAAoE;AACpE,sEAAsE;AACtE,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,mBAAmB,CAAC,CAAA;AAEvE,mFAAmF;AACnF,6EAA6E;AAC7E,yDAAyD;AACzD,MAAM,WA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":"","sources":["../../src/middleware/cors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAA;AAW7C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC5C;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,WAAgB,GAAG,iBAAiB,CAkB3E"}
|
package/dist/middleware/cors.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
// Vite dev (5173) and preview (4173) ports, on both loopback hostnames,
|
|
2
|
+
// which browsers treat as distinct origins.
|
|
1
3
|
const DEFAULT_DEV_ORIGINS = [
|
|
2
|
-
'http://localhost:5173',
|
|
3
4
|
'http://localhost:4173',
|
|
5
|
+
'http://localhost:5173',
|
|
6
|
+
'http://127.0.0.1:4173',
|
|
4
7
|
'http://127.0.0.1:5173',
|
|
5
8
|
];
|
|
6
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cors.js","sourceRoot":"","sources":["../../src/middleware/cors.ts"],"names":[],"mappings":"AAEA,MAAM,mBAAmB,GAAG;IAC1B,uBAAuB;IACvB,uBAAuB;IACvB,uBAAuB;CACxB,CAAA;AAMD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,UAAuB,EAAE;IACtD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,cAAc,IAAI,mBAAmB,CAAC,CAAA;IACtE,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC7B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QAC3C,IAAI,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,OAAO,CAAC,MAAM,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAA;YACrD,OAAO,CAAC,MAAM,CA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,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QAClC,CAAC;QACD,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YACrC,OAAO,CAAC,MAAM,CAAC,8BAA8B,EAAE,wCAAwC,CAAC,CAAA;YACxF,OAAO,CAAC,MAAM,CAAC,8BAA8B,EAAE,2CAA2C,CAAC,CAAA;YAC3F,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAA;YACjD,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QAChC,CAAC;QACD,MAAM,IAAI,EAAE,CAAA;QACZ,OAAO,SAAS,CAAA;IAClB,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/middleware/error.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/middleware/error.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AA4CxC,eAAO,MAAM,YAAY,EAAE,YAkB1B,CAAA"}
|
package/dist/middleware/error.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { BraidError,
|
|
1
|
+
import { BraidError, ValidationError } from '@braidhq/core';
|
|
2
2
|
import { ZodError } from 'zod';
|
|
3
3
|
const PROBLEM_BASE_URL = 'https://braid.dev/errors';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
// The HTTP status per error code, keyed by the closed BraidErrorCode enum,
|
|
5
|
+
// so a new code fails to compile until it is mapped here.
|
|
6
|
+
const STATUS_BY_CODE = {
|
|
7
|
+
'BRAID-VALIDATION': 400,
|
|
8
|
+
'BRAID-UNAUTHORIZED': 401,
|
|
9
|
+
'BRAID-NOT-FOUND': 404,
|
|
10
|
+
'BRAID-CONFLICT': 409,
|
|
11
|
+
'BRAID-FORBIDDEN': 403,
|
|
12
|
+
'BRAID-UNAVAILABLE': 503,
|
|
13
|
+
'BRAID-INTERNAL': 500,
|
|
14
|
+
};
|
|
13
15
|
function problemFromBraidError(error) {
|
|
14
16
|
const problem = {
|
|
15
17
|
type: `${PROBLEM_BASE_URL}/${error.code.toLowerCase()}`,
|
|
16
18
|
title: error.name,
|
|
17
|
-
status:
|
|
19
|
+
status: STATUS_BY_CODE[error.code],
|
|
18
20
|
code: error.code,
|
|
19
21
|
detail: error.message,
|
|
20
22
|
};
|
|
@@ -24,10 +26,10 @@ function problemFromBraidError(error) {
|
|
|
24
26
|
}
|
|
25
27
|
function problemFromZodError(error) {
|
|
26
28
|
return {
|
|
27
|
-
type: `${PROBLEM_BASE_URL}/braid-
|
|
29
|
+
type: `${PROBLEM_BASE_URL}/braid-validation`,
|
|
28
30
|
title: 'ValidationError',
|
|
29
31
|
status: 400,
|
|
30
|
-
code: 'BRAID-
|
|
32
|
+
code: 'BRAID-VALIDATION',
|
|
31
33
|
detail: error.issues.map(issue => `${issue.path.join('.')}: ${issue.message}`).join('; '),
|
|
32
34
|
};
|
|
33
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/middleware/error.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/middleware/error.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAE9B,MAAM,gBAAgB,GAAG,0BAA0B,CAAA;AAEnD,2EAA2E;AAC3E,0DAA0D;AAC1D,MAAM,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