@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
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { Workspace } from '@braidhq/core';
|
|
2
|
-
import type { McpServerConfig } from '@braidhq/schema';
|
|
3
|
-
export interface McpConfigFile {
|
|
4
|
-
readonly mcpServers: Readonly<Record<string, McpServerEntry>>;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Shape claude expects in `--mcp-config <file>`.
|
|
8
|
-
*
|
|
9
|
-
* The Streamable HTTP transport is `type: 'http'` (the claude CLI's
|
|
10
|
-
* legacy name; predates the rename in the MCP 2025-06-18 spec). We
|
|
11
|
-
* use the new name in PRODUCT.md to match the spec and emit the
|
|
12
|
-
* legacy name here so claude understands.
|
|
13
|
-
*/
|
|
14
|
-
interface McpStreamableHttpEntry {
|
|
15
|
-
readonly type: 'http';
|
|
16
|
-
readonly url: string;
|
|
17
|
-
readonly headers?: Record<string, string>;
|
|
18
|
-
}
|
|
19
|
-
interface McpStdioEntry {
|
|
20
|
-
readonly type: 'stdio';
|
|
21
|
-
readonly command: string;
|
|
22
|
-
readonly args?: readonly string[];
|
|
23
|
-
readonly env?: Record<string, string>;
|
|
24
|
-
}
|
|
25
|
-
type McpServerEntry = McpStreamableHttpEntry | McpStdioEntry;
|
|
26
|
-
export interface BuildMcpConfigOptions {
|
|
27
|
-
/**
|
|
28
|
-
* Extra MCP server entries injected on top of the workspace's own
|
|
29
|
-
* `mcpServers`. Used to wire the built-in `braid-core` gateway —
|
|
30
|
-
* see `SubprocessSkillRunner`. Workspace entries with the same id
|
|
31
|
-
* take precedence (so a workspace can override a built-in).
|
|
32
|
-
*/
|
|
33
|
-
extraServers?: readonly McpServerConfig[];
|
|
34
|
-
}
|
|
35
|
-
export declare function buildMcpConfig(workspace: Workspace, options?: BuildMcpConfigOptions): McpConfigFile;
|
|
36
|
-
export declare function writeMcpConfigFile(workspace: Workspace, targetDir: string, options?: BuildMcpConfigOptions): Promise<string>;
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=mcpConfig.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcpConfig.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/agent/mcpConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAKtD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAA;CAC9D;AAED;;;;;;;GAOG;AACH,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC1C;AAED,UAAU,aAAa;IACrB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACtC;AAED,KAAK,cAAc,GAAG,sBAAsB,GAAG,aAAa,CAAA;AAE5D,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,eAAe,EAAE,CAAA;CAC1C;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,GAAE,qBAA0B,GAAG,aAAa,CASvG;AAED,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,MAAM,CAAC,CAMjB"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { mkdir, writeFile } from 'node:fs/promises';
|
|
2
|
-
import { dirname, join } from 'node:path';
|
|
3
|
-
import process from 'node:process';
|
|
4
|
-
export function buildMcpConfig(workspace, options = {}) {
|
|
5
|
-
const entries = {};
|
|
6
|
-
for (const server of options.extraServers ?? []) {
|
|
7
|
-
entries[server.id] = toEntry(server);
|
|
8
|
-
}
|
|
9
|
-
for (const server of workspace.mcpServers) {
|
|
10
|
-
entries[server.id] = toEntry(server);
|
|
11
|
-
}
|
|
12
|
-
return { mcpServers: entries };
|
|
13
|
-
}
|
|
14
|
-
export async function writeMcpConfigFile(workspace, targetDir, options = {}) {
|
|
15
|
-
const config = buildMcpConfig(workspace, options);
|
|
16
|
-
const targetPath = join(targetDir, `.braid-mcp-${workspace.id}.json`);
|
|
17
|
-
await mkdir(dirname(targetPath), { recursive: true });
|
|
18
|
-
await writeFile(targetPath, `${JSON.stringify(config, null, 2)}\n`, 'utf-8');
|
|
19
|
-
return targetPath;
|
|
20
|
-
}
|
|
21
|
-
function toEntry(server) {
|
|
22
|
-
if (server.transport === 'stdio') {
|
|
23
|
-
return {
|
|
24
|
-
type: 'stdio',
|
|
25
|
-
command: server.command,
|
|
26
|
-
...(server.args ? { args: [...server.args] } : {}),
|
|
27
|
-
...(server.env ? { env: resolveEnv(server.env) } : {}),
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
type: 'http',
|
|
32
|
-
url: server.url,
|
|
33
|
-
...(server.headers ? { headers: resolveEnv(server.headers) } : {}),
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Replace `${VAR}` references in header / env values with the matching
|
|
38
|
-
* parent-process env var. Throws if a referenced var is missing so the
|
|
39
|
-
* user gets a clear error at config-write time rather than a confusing
|
|
40
|
-
* 401 from the MCP server or a silently-misconfigured subprocess.
|
|
41
|
-
*/
|
|
42
|
-
function resolveEnv(values) {
|
|
43
|
-
const out = {};
|
|
44
|
-
for (const [name, value] of Object.entries(values)) {
|
|
45
|
-
out[name] = value.replace(/\$\{([A-Z_][A-Z0-9_]*)\}/g, (_match, varName) => {
|
|
46
|
-
const resolved = process.env[varName];
|
|
47
|
-
if (resolved === undefined) {
|
|
48
|
-
throw new Error(`MCP entry "${name}": environment variable "${varName}" is not set`);
|
|
49
|
-
}
|
|
50
|
-
return resolved;
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
return out;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=mcpConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mcpConfig.js","sourceRoot":"","sources":["../../../src/infrastructure/agent/mcpConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,OAAO,MAAM,cAAc,CAAA;AAuClC,MAAM,UAAU,cAAc,CAAC,SAAoB,EAAE,UAAiC,EAAE;IACtF,MAAM,OAAO,GAAmC,EAAE,CAAA;IAClD,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,YAAY,IAAI,EAAE,EAAE,CAAC;QAChD,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IACtC,CAAC;IACD,KAAK,MAAM,MAAM,IAAI,SAAS,CAAC,UAAU,EAAE,CAAC;QAC1C,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,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CAAC,CAAC,CAAC,EAAE,CAAC;KACnE,CAAA;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,UAAU,CAAC,MAA8B;IAChD,MAAM,GAAG,GAA2B,EAAE,CAAA;IACtC,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,2BAA2B,EAAE,CAAC,MAAM,EAAE,OAAe,EAAE,EAAE;YACjF,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YACrC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC3B,MAAM,IAAI,KAAK,CAAC,cAAc,IAAI,4BAA4B,OAAO,cAAc,CAAC,CAAA;YACtF,CAAC;YACD,OAAO,QAAQ,CAAA;QACjB,CAAC,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type LineHandler = (line: string) => void;
|
|
2
|
-
/**
|
|
3
|
-
* Splits a chunked text stream into newline-delimited lines, invoking the
|
|
4
|
-
* handler exactly once per complete line. Partial lines are buffered until
|
|
5
|
-
* the next chunk completes them. Call `flush()` after the source closes to
|
|
6
|
-
* release any trailing line without a terminator.
|
|
7
|
-
*/
|
|
8
|
-
export declare class LineBuffer {
|
|
9
|
-
private readonly onLine;
|
|
10
|
-
private buffer;
|
|
11
|
-
constructor(onLine: LineHandler);
|
|
12
|
-
append(chunk: string): void;
|
|
13
|
-
flush(): void;
|
|
14
|
-
}
|
|
15
|
-
export interface StreamJsonEvent {
|
|
16
|
-
readonly type: string;
|
|
17
|
-
readonly [key: string]: unknown;
|
|
18
|
-
}
|
|
19
|
-
export declare function parseJsonLine(line: string): StreamJsonEvent | undefined;
|
|
20
|
-
//# sourceMappingURL=streamJsonParser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"streamJsonParser.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/agent/streamJsonParser.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;AAEhD;;;;;GAKG;AACH,qBAAa,UAAU;IAGT,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,MAAM,CAAK;gBAEU,MAAM,EAAE,WAAW;IAEhD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAY3B,KAAK,IAAI,IAAI;CAOd;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAChC;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAWvE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"streamJsonParser.js","sourceRoot":"","sources":["../../../src/infrastructure/agent/streamJsonParser.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,OAAO,UAAU;IAGQ;IAFrB,MAAM,GAAG,EAAE,CAAA;IAEnB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,MAAM,CAAC,KAAa;QAClB,IAAI,CAAC,MAAM,IAAI,KAAK,CAAA;QACpB,IAAI,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC5C,OAAO,YAAY,IAAI,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAA;YAC/C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,CAAA;YACjD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;gBACjB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YACnB,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC1C,CAAC;IACH,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YAC1B,OAAM;QACR,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAA;QAC7B,IAAI,CAAC,MAAM,GAAG,EAAE,CAAA;QAChB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IACxB,CAAC;CACF;AAOD,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IAC3B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QACtB,OAAO,SAAS,CAAA;IAClB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAoB,CAAA;QACrD,OAAO,MAAM,CAAA;IACf,CAAC;IACD,MAAM,CAAC;QACL,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { SkillEvent } from '@braidhq/schema';
|
|
2
|
-
import type { ChildProcess } from 'node:child_process';
|
|
3
|
-
interface RawEvent {
|
|
4
|
-
readonly type: string;
|
|
5
|
-
readonly [key: string]: unknown;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Wires a child's stdout / stderr to a single SkillEvent callback.
|
|
9
|
-
* Returns `flush` so callers can drain the final un-terminated line on
|
|
10
|
-
* `close`.
|
|
11
|
-
*/
|
|
12
|
-
export declare function attachOutputBuffers(child: ChildProcess, onEvent: (event: SkillEvent) => void, now: () => string): {
|
|
13
|
-
flush: () => void;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Maps a single `claude --output-format stream-json` line into zero or more
|
|
17
|
-
* `SkillEvent`s. Claude emits these envelope shapes today: `system` (init
|
|
18
|
-
* meta, ignored except for `session_id`), `assistant` (text / tool_use
|
|
19
|
-
* content parts), `user` (echoed tool_result, only `is_error` surfaced),
|
|
20
|
-
* `rate_limit_*` (ignored), `result` (final outcome). Legacy flat shapes
|
|
21
|
-
* (`text`, `tool_use`, `artifact-written`, `error`) are kept for tests and
|
|
22
|
-
* older tools.
|
|
23
|
-
*/
|
|
24
|
-
export declare function mapSubprocessEvents(raw: RawEvent, now: string): SkillEvent[];
|
|
25
|
-
export {};
|
|
26
|
-
//# sourceMappingURL=subprocessEventStream.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subprocessEventStream.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/agent/subprocessEventStream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAItD,UAAU,QAAQ;IAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE;AAG7E;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,EACpC,GAAG,EAAE,MAAM,MAAM,GAChB;IAAE,KAAK,EAAE,MAAM,IAAI,CAAA;CAAE,CAyBvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,EAAE,CAyE5E"}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { SkillEvent as SkillEventSchema } from '@braidhq/schema';
|
|
2
|
-
import { LineBuffer, parseJsonLine } from './streamJsonParser.js';
|
|
3
|
-
/**
|
|
4
|
-
* Wires a child's stdout / stderr to a single SkillEvent callback.
|
|
5
|
-
* Returns `flush` so callers can drain the final un-terminated line on
|
|
6
|
-
* `close`.
|
|
7
|
-
*/
|
|
8
|
-
export function attachOutputBuffers(child, onEvent, now) {
|
|
9
|
-
const stdout = new LineBuffer((line) => {
|
|
10
|
-
const parsed = parseJsonLine(line);
|
|
11
|
-
if (parsed === undefined)
|
|
12
|
-
return;
|
|
13
|
-
for (const event of mapSubprocessEvents(parsed, now()))
|
|
14
|
-
onEvent(event);
|
|
15
|
-
});
|
|
16
|
-
// stderr is wrapped verbatim into a `[stderr]` message event so it
|
|
17
|
-
// shows up in the transcript alongside model output.
|
|
18
|
-
const stderr = new LineBuffer((line) => {
|
|
19
|
-
onEvent(SkillEventSchema.parse({ type: 'message', text: `[stderr] ${line}` }));
|
|
20
|
-
});
|
|
21
|
-
child.stdout?.setEncoding('utf-8');
|
|
22
|
-
child.stdout?.on('data', (chunk) => stdout.append(chunk));
|
|
23
|
-
child.stderr?.setEncoding('utf-8');
|
|
24
|
-
child.stderr?.on('data', (chunk) => stderr.append(chunk));
|
|
25
|
-
return {
|
|
26
|
-
flush: () => {
|
|
27
|
-
stdout.flush();
|
|
28
|
-
stderr.flush();
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Maps a single `claude --output-format stream-json` line into zero or more
|
|
34
|
-
* `SkillEvent`s. Claude emits these envelope shapes today: `system` (init
|
|
35
|
-
* meta, ignored except for `session_id`), `assistant` (text / tool_use
|
|
36
|
-
* content parts), `user` (echoed tool_result, only `is_error` surfaced),
|
|
37
|
-
* `rate_limit_*` (ignored), `result` (final outcome). Legacy flat shapes
|
|
38
|
-
* (`text`, `tool_use`, `artifact-written`, `error`) are kept for tests and
|
|
39
|
-
* older tools.
|
|
40
|
-
*/
|
|
41
|
-
export function mapSubprocessEvents(raw, now) {
|
|
42
|
-
const out = [];
|
|
43
|
-
if (raw.type === 'system' && raw.subtype === 'init' && typeof raw.session_id === 'string') {
|
|
44
|
-
out.push(SkillEventSchema.parse({ type: 'session-started', sessionId: raw.session_id }));
|
|
45
|
-
return out;
|
|
46
|
-
}
|
|
47
|
-
if (raw.type === 'assistant') {
|
|
48
|
-
for (const part of readContent(raw)) {
|
|
49
|
-
if (part?.type === 'text' && typeof part.text === 'string' && part.text.length > 0) {
|
|
50
|
-
out.push(SkillEventSchema.parse({ type: 'message', text: part.text }));
|
|
51
|
-
}
|
|
52
|
-
else if (part?.type === 'tool_use' && typeof part.name === 'string') {
|
|
53
|
-
const event = {
|
|
54
|
-
type: 'tool-call',
|
|
55
|
-
tool: part.name,
|
|
56
|
-
args: part.input ?? null,
|
|
57
|
-
};
|
|
58
|
-
if (typeof part.id === 'string' && part.id.length > 0)
|
|
59
|
-
event.toolCallId = part.id;
|
|
60
|
-
out.push(SkillEventSchema.parse(event));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return out;
|
|
64
|
-
}
|
|
65
|
-
if (raw.type === 'user') {
|
|
66
|
-
for (const part of readContent(raw)) {
|
|
67
|
-
if (part?.type === 'tool_result' && typeof part.tool_use_id === 'string') {
|
|
68
|
-
const output = typeof part.content === 'string'
|
|
69
|
-
? part.content
|
|
70
|
-
: JSON.stringify(part.content ?? '');
|
|
71
|
-
out.push(SkillEventSchema.parse({
|
|
72
|
-
type: 'tool-result',
|
|
73
|
-
toolCallId: part.tool_use_id,
|
|
74
|
-
output,
|
|
75
|
-
isError: part.is_error === true,
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return out;
|
|
80
|
-
}
|
|
81
|
-
if (raw.type === 'result') {
|
|
82
|
-
const isError = raw.is_error === true;
|
|
83
|
-
const text = typeof raw.result === 'string' ? raw.result : '';
|
|
84
|
-
if (isError)
|
|
85
|
-
out.push(SkillEventSchema.parse({ type: 'error', message: text || 'skill run failed', at: now }));
|
|
86
|
-
else if (text.length > 0)
|
|
87
|
-
out.push(SkillEventSchema.parse({ type: 'message', text }));
|
|
88
|
-
return out;
|
|
89
|
-
}
|
|
90
|
-
if (raw.type === 'text' && typeof raw.text === 'string')
|
|
91
|
-
return [SkillEventSchema.parse({ type: 'message', text: raw.text })];
|
|
92
|
-
if (raw.type === 'tool_use' && typeof raw.name === 'string')
|
|
93
|
-
return [SkillEventSchema.parse({ type: 'tool-call', tool: raw.name, args: raw.input ?? null })];
|
|
94
|
-
if (raw.type === 'artifact-written' && typeof raw.artifactKind === 'string') {
|
|
95
|
-
return [SkillEventSchema.parse({
|
|
96
|
-
type: 'artifact-written',
|
|
97
|
-
artifactKind: raw.artifactKind,
|
|
98
|
-
artifactId: raw.artifactId,
|
|
99
|
-
path: raw.path,
|
|
100
|
-
})];
|
|
101
|
-
}
|
|
102
|
-
if (raw.type === 'error' && typeof raw.message === 'string')
|
|
103
|
-
return [SkillEventSchema.parse({ type: 'error', message: raw.message, at: now })];
|
|
104
|
-
return out;
|
|
105
|
-
}
|
|
106
|
-
function readContent(raw) {
|
|
107
|
-
const message = raw.message;
|
|
108
|
-
if (!message || !Array.isArray(message.content))
|
|
109
|
-
return [];
|
|
110
|
-
return message.content;
|
|
111
|
-
}
|
|
112
|
-
//# sourceMappingURL=subprocessEventStream.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subprocessEventStream.js","sourceRoot":"","sources":["../../../src/infrastructure/agent/subprocessEventStream.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAKjE;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAmB,EACnB,OAAoC,EACpC,GAAiB;IAEjB,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE;QACrC,MAAM,MAAM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AAA;IACX,OAAO,OAAO,CAAC,OAA2B,CAAA;AAC5C,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { UserRegistryFile } from '../users/UserRegistryFile.js';
|
|
2
|
-
import type { AccessPolicy } from './AccessPolicy.js';
|
|
3
|
-
/**
|
|
4
|
-
* Back-fills `approvedEmails` from existing users.json entries.
|
|
5
|
-
*
|
|
6
|
-
* Without this, accounts created before the approvedEmails feature
|
|
7
|
-
* existed (or while the invite-was-consumed bug was live) would be
|
|
8
|
-
* stuck behind Gate-1 even though they hold a valid user record. Every
|
|
9
|
-
* email we see in the registry must be persistently approved going
|
|
10
|
-
* forward; this is the one-shot reconciliation.
|
|
11
|
-
*
|
|
12
|
-
* Idempotent: AccessPolicy.approveEmail no-ops when the email is
|
|
13
|
-
* already there, so re-running on every boot is cheap.
|
|
14
|
-
*/
|
|
15
|
-
export declare function ensureApprovedEmails(userRegistry: UserRegistryFile, accessPolicy: AccessPolicy): Promise<void>;
|
|
16
|
-
//# sourceMappingURL=ensureApprovedEmails.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ensureApprovedEmails.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/auth/ensureApprovedEmails.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,IAAI,CAAC,CAMf"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Back-fills `approvedEmails` from existing users.json entries.
|
|
3
|
-
*
|
|
4
|
-
* Without this, accounts created before the approvedEmails feature
|
|
5
|
-
* existed (or while the invite-was-consumed bug was live) would be
|
|
6
|
-
* stuck behind Gate-1 even though they hold a valid user record. Every
|
|
7
|
-
* email we see in the registry must be persistently approved going
|
|
8
|
-
* forward; this is the one-shot reconciliation.
|
|
9
|
-
*
|
|
10
|
-
* Idempotent: AccessPolicy.approveEmail no-ops when the email is
|
|
11
|
-
* already there, so re-running on every boot is cheap.
|
|
12
|
-
*/
|
|
13
|
-
export async function ensureApprovedEmails(userRegistry, accessPolicy) {
|
|
14
|
-
const users = await userRegistry.list();
|
|
15
|
-
for (const user of users) {
|
|
16
|
-
if (user.email)
|
|
17
|
-
await accessPolicy.approveEmail(user.email);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=ensureApprovedEmails.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ensureApprovedEmails.js","sourceRoot":"","sources":["../../../src/infrastructure/auth/ensureApprovedEmails.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,YAA8B,EAC9B,YAA0B;IAE1B,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,CAAA;IACvC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,KAAK;YACZ,MAAM,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC/C,CAAC;AACH,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parse a boolean env var. Canonical form is `true` / `false`; we also
|
|
3
|
-
* accept the common YAML / shell idioms (`yes` / `no`, `on` / `off`,
|
|
4
|
-
* `1` / `0`) so existing `.env` files don't break on the rename.
|
|
5
|
-
*
|
|
6
|
-
* Returns `defaultValue` when the variable is unset or the literal is
|
|
7
|
-
* unrecognised (silent fall-through — we don't want a typo in env to
|
|
8
|
-
* crash the server boot).
|
|
9
|
-
*/
|
|
10
|
-
export declare function parseBoolEnv(value: string | undefined, defaultValue: boolean): boolean;
|
|
11
|
-
//# sourceMappingURL=env.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/infrastructure/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAStF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/infrastructure/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,KAAyB,EAAE,YAAqB;IAC3E,IAAI,KAAK,KAAK,SAAS;QACrB,OAAO,YAAY,CAAA;IACrB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IACxC,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,IAAI;QACxE,OAAO,IAAI,CAAA;IACb,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK;QACzE,OAAO,KAAK,CAAA;IACd,OAAO,YAAY,CAAA;AACrB,CAAC"}
|