@knpkv/control-center 0.3.0 → 0.4.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 +52 -9
- package/dist/client/.vite/manifest.json +183 -170
- package/dist/client/assets/{ActiveWorkPage-DJQgGZeV.js → ActiveWorkPage-Dd1mxPrq.js} +2 -2
- package/dist/client/assets/{ActiveWorkPage-DJQgGZeV.js.map → ActiveWorkPage-Dd1mxPrq.js.map} +1 -1
- package/dist/client/assets/AgentPage-C3LThgPZ.js +3 -0
- package/dist/client/assets/AgentPage-C3LThgPZ.js.map +1 -0
- package/dist/client/assets/{AtlassianOAuthCallbackPage-D1F1xE_2.js → AtlassianOAuthCallbackPage-BPoF6oKf.js} +2 -2
- package/dist/client/assets/{AtlassianOAuthCallbackPage-D1F1xE_2.js.map → AtlassianOAuthCallbackPage-BPoF6oKf.js.map} +1 -1
- package/dist/client/assets/AuthorizedSharePage-jjqu6W_f.js +2 -0
- package/dist/client/assets/AuthorizedSharePage-jjqu6W_f.js.map +1 -0
- package/dist/client/assets/BrowserCrypto-BMbjhcvP.js +2 -0
- package/dist/client/assets/{BrowserCrypto-DVWR7DFd.js.map → BrowserCrypto-BMbjhcvP.js.map} +1 -1
- package/dist/client/assets/BrowserSessionHydrator-BC1ymLkL.js +2 -0
- package/dist/client/assets/BrowserSessionHydrator-BC1ymLkL.js.map +1 -0
- package/dist/client/assets/CommandSearch-WwAVDrD9.js +2 -0
- package/dist/client/assets/{CommandSearch-CP_QCbkm.js.map → CommandSearch-WwAVDrD9.js.map} +1 -1
- package/dist/client/assets/ItemsPage-CKK_KkJ2.js +2 -0
- package/dist/client/assets/{ItemsPage-BGFUkRL2.js.map → ItemsPage-CKK_KkJ2.js.map} +1 -1
- package/dist/client/assets/{PairPage-DIgzx0K2.js → PairPage-DA6cmyqF.js} +2 -2
- package/dist/client/assets/{PairPage-DIgzx0K2.js.map → PairPage-DA6cmyqF.js.map} +1 -1
- package/dist/client/assets/PortfolioOverview-CEI4gpXi.js +2 -0
- package/dist/client/assets/PortfolioOverview-CEI4gpXi.js.map +1 -0
- package/dist/client/assets/PullRequestReviewPanel-D7AKnwL-.js +6 -0
- package/dist/client/assets/PullRequestReviewPanel-D7AKnwL-.js.map +1 -0
- package/dist/client/assets/ReleaseRoute-CbPW3qUT.js +2 -0
- package/dist/client/assets/{ReleaseRoute-DXJ8Jg60.js.map → ReleaseRoute-CbPW3qUT.js.map} +1 -1
- package/dist/client/assets/ReleaseWorkset-BluAe7Sq.js +2 -0
- package/dist/client/assets/{ReleaseWorkset-Dtzalmji.js.map → ReleaseWorkset-BluAe7Sq.js.map} +1 -1
- package/dist/client/assets/ServicesPage-_B89DAvG.js +2 -0
- package/dist/client/assets/ServicesPage-_B89DAvG.js.map +1 -0
- package/dist/client/assets/TimelinePage-DvpgD8AY.js +2 -0
- package/dist/client/assets/TimelinePage-DvpgD8AY.js.map +1 -0
- package/dist/client/assets/WorkspaceEntityLink-DPj6MKI2.js +2 -0
- package/dist/client/assets/{WorkspaceEntityLink-AdZ_T-Wk.js.map → WorkspaceEntityLink-DPj6MKI2.js.map} +1 -1
- package/dist/client/assets/WorkspaceEntityRoute-B01fxxB3.js +3 -0
- package/dist/client/assets/WorkspaceEntityRoute-B01fxxB3.js.map +1 -0
- package/dist/client/assets/{WorkspaceHomeLink-XbKSPths.js → WorkspaceHomeLink-CkJfzO25.js} +2 -2
- package/dist/client/assets/{WorkspaceHomeLink-XbKSPths.js.map → WorkspaceHomeLink-CkJfzO25.js.map} +1 -1
- package/dist/client/assets/WorkspacePullRequestDetails-HwDgp12e.js +3 -0
- package/dist/client/assets/WorkspacePullRequestDetails-HwDgp12e.js.map +1 -0
- package/dist/client/assets/{WorkspaceReleaseLayout-cfboC5Qh.js → WorkspaceReleaseLayout-CGHi8eoo.js} +2 -2
- package/dist/client/assets/{WorkspaceReleaseLayout-cfboC5Qh.js.map → WorkspaceReleaseLayout-CGHi8eoo.js.map} +1 -1
- package/dist/client/assets/{WorkspaceSettingsPage-Fy7Wx8Y2.js → WorkspaceSettingsPage-DyoGiGJG.js} +2 -2
- package/dist/client/assets/{WorkspaceSettingsPage-Fy7Wx8Y2.js.map → WorkspaceSettingsPage-DyoGiGJG.js.map} +1 -1
- package/dist/client/assets/agent-api-CeONl_8w.js +19 -0
- package/dist/client/assets/agent-api-CeONl_8w.js.map +1 -0
- package/dist/client/assets/authenticatedMutationClient-DYaieXUe.js +2 -0
- package/dist/client/assets/{authenticatedMutationClient-Ccwguc3i.js.map → authenticatedMutationClient-DYaieXUe.js.map} +1 -1
- package/dist/client/assets/authorizedShareTransport-cxBoQzQ2.js +2 -0
- package/dist/client/assets/{authorizedShareTransport-DZHgFEkh.js.map → authorizedShareTransport-cxBoQzQ2.js.map} +1 -1
- package/dist/client/assets/client-DKS82kT_.js +5 -0
- package/dist/client/assets/client-DKS82kT_.js.map +1 -0
- package/dist/client/assets/connectionTestTransport-I_Ga9UNs.js +2 -0
- package/dist/client/assets/{connectionTestTransport-BQ55d6Me.js.map → connectionTestTransport-I_Ga9UNs.js.map} +1 -1
- package/dist/client/assets/index-C7_FDTU7.js +11 -0
- package/dist/client/assets/index-C7_FDTU7.js.map +1 -0
- package/dist/client/assets/{patterns-5N-j-AD2-BwypFm-e.js → patterns-5N-j-AD2-B9qgekXA.js} +2 -2
- package/dist/client/assets/{patterns-5N-j-AD2-BwypFm-e.js.map → patterns-5N-j-AD2-B9qgekXA.js.map} +1 -1
- package/dist/client/assets/{presentPortfolio-D3ZIcnqt.js → presentPortfolio-C_JsoSWg.js} +2 -2
- package/dist/client/assets/presentPortfolio-C_JsoSWg.js.map +1 -0
- package/dist/client/assets/{presentWorkspaceItems-Bmh4oEbH.js → presentWorkspaceItems-DboAfwGc.js} +2 -2
- package/dist/client/assets/{presentWorkspaceItems-Bmh4oEbH.js.map → presentWorkspaceItems-DboAfwGc.js.map} +1 -1
- package/dist/client/assets/{pullRequestReviewFailures-S74M-fOk.js → pullRequestReviewFailures-DHmYwffV.js} +2 -2
- package/dist/client/assets/{pullRequestReviewFailures-S74M-fOk.js.map → pullRequestReviewFailures-DHmYwffV.js.map} +1 -1
- package/dist/client/assets/pullRequestReviewThreadReplay-Vy1k53qE.js +2 -0
- package/dist/client/assets/pullRequestReviewThreadReplay-Vy1k53qE.js.map +1 -0
- package/dist/client/assets/releaseRoutes-t9uCfs5T.js +2 -0
- package/dist/client/assets/{releaseRoutes-BCuIdZyA.js.map → releaseRoutes-t9uCfs5T.js.map} +1 -1
- package/dist/client/assets/serviceOnboarding-DLINCon7.js +2 -0
- package/dist/client/assets/{serviceOnboarding-Jg_0yNjf.js.map → serviceOnboarding-DLINCon7.js.map} +1 -1
- package/dist/client/assets/{useWorkspaceDefaultLanding-CzlDdEF-.js → useWorkspaceDefaultLanding-CC5ImHkL.js} +3 -3
- package/dist/client/assets/{useWorkspaceDefaultLanding-CzlDdEF-.js.map → useWorkspaceDefaultLanding-CC5ImHkL.js.map} +1 -1
- package/dist/client/assets/{useWorkspaceItems-Cd3MPke2.js → useWorkspaceItems-B1X-JNwq.js} +2 -2
- package/dist/client/assets/{useWorkspaceItems-Cd3MPke2.js.map → useWorkspaceItems-B1X-JNwq.js.map} +1 -1
- package/dist/client/assets/workspaceEntityRoutes-2TejMrzb.js +2 -0
- package/dist/client/assets/workspaceEntityRoutes-2TejMrzb.js.map +1 -0
- package/dist/client/assets/workspaceScrollCapture-BsjcWVsk.js +2 -0
- package/dist/client/assets/workspaceScrollCapture-BsjcWVsk.js.map +1 -0
- package/dist/client/assets/workspaceSettingsTransport-Dw2hueXv.js +2 -0
- package/dist/client/assets/{workspaceSettingsTransport-CZWYL5T7.js.map → workspaceSettingsTransport-Dw2hueXv.js.map} +1 -1
- package/dist/client/build-graph.json +17 -0
- package/dist/client/index.html +1 -1
- package/dist/server/api/agent.d.ts +563 -44
- package/dist/server/api/agent.d.ts.map +1 -1
- package/dist/server/api/deliveryGraph.d.ts +454 -454
- package/dist/server/api/index.d.ts +1 -1
- package/dist/server/api/index.d.ts.map +1 -1
- package/dist/server/api/index.js +4 -4
- package/dist/server/api/liveEvents.d.ts +20 -0
- package/dist/server/api/liveEvents.d.ts.map +1 -1
- package/dist/server/api/portfolio.d.ts +23 -0
- package/dist/server/api/portfolio.d.ts.map +1 -1
- package/dist/server/api/shares.d.ts +2 -2
- package/dist/server/assets/{BindConfig-DIsf2Rnh.js → BindConfig-Bj282xDC.js} +2094 -290
- package/dist/server/assets/BindConfig-Bj282xDC.js.map +1 -0
- package/dist/server/assets/{CodePipelineStateDecoder-CVf1A2zG.js → CodePipelineStateDecoder-CNiFRgSi.js} +2 -2
- package/dist/server/assets/{CodePipelineStateDecoder-CVf1A2zG.js.map → CodePipelineStateDecoder-CNiFRgSi.js.map} +1 -1
- package/dist/server/assets/{agent-CyZ40zs1.js → agent-ZvwskOQu.js} +160 -10
- package/dist/server/assets/agent-ZvwskOQu.js.map +1 -0
- package/dist/server/assets/{controlCenterApi-ZUX3Y-LE.js → controlCenterApi-5j3gOXgE.js} +5 -5
- package/dist/server/assets/{controlCenterApi-ZUX3Y-LE.js.map → controlCenterApi-5j3gOXgE.js.map} +1 -1
- package/dist/server/assets/{descriptor-CKtTnhef.js → descriptor-CCvNzSZL.js} +10 -10
- package/dist/server/assets/{descriptor-CKtTnhef.js.map → descriptor-CCvNzSZL.js.map} +1 -1
- package/dist/server/assets/{failures-mgYDkUZy.js → failures-CesHLYbN.js} +2 -2
- package/dist/server/assets/{failures-mgYDkUZy.js.map → failures-CesHLYbN.js.map} +1 -1
- package/dist/server/assets/{firstPartyServices-D7b8BOek.js → firstPartyServices-Cdzjcs2H.js} +2 -2
- package/dist/server/assets/{firstPartyServices-D7b8BOek.js.map → firstPartyServices-Cdzjcs2H.js.map} +1 -1
- package/dist/server/assets/{manualPluginSynchronization-DFlhKvav.js → manualPluginSynchronization-CzIhZ_Dw.js} +5 -5
- package/dist/server/assets/{manualPluginSynchronization-DFlhKvav.js.map → manualPluginSynchronization-CzIhZ_Dw.js.map} +1 -1
- package/dist/server/assets/{plugins-D__oMDpI.js → plugins-DiPrfzV8.js} +2 -2
- package/dist/server/assets/{plugins-D__oMDpI.js.map → plugins-DiPrfzV8.js.map} +1 -1
- package/dist/server/assets/{readiness-BhA-Nr9c.js → readiness-BtntBhDj.js} +3 -3
- package/dist/server/assets/{readiness-BhA-Nr9c.js.map → readiness-BtntBhDj.js.map} +1 -1
- package/dist/server/assets/{relationshipInferenceMaterialization-DYBcaWhQ.js → relationshipInferenceMaterialization-CR6xyMNL.js} +1121 -159
- package/dist/server/assets/relationshipInferenceMaterialization-CR6xyMNL.js.map +1 -0
- package/dist/server/assets/{workspaceSettings-BE713Oe8.js → workspaceSettings-C2Zsk6RI.js} +2784 -2700
- package/dist/server/assets/workspaceSettings-C2Zsk6RI.js.map +1 -0
- package/dist/server/build-graph.json +117 -4
- package/dist/server/domain/actors.d.ts +12 -12
- package/dist/server/domain/deliveryGraph.d.ts +49 -49
- package/dist/server/domain/governedAction/bindings.d.ts +24 -12
- package/dist/server/domain/governedAction/bindings.d.ts.map +1 -1
- package/dist/server/domain/governedAction/lifecycle.d.ts +8 -8
- package/dist/server/domain/governedAction/model.d.ts +39 -18
- package/dist/server/domain/governedAction/model.d.ts.map +1 -1
- package/dist/server/domain/governedAction/stateMachine.d.ts +34 -34
- package/dist/server/domain/index.js +6 -6
- package/dist/server/domain/normalizedIssue.d.ts +1 -1
- package/dist/server/domain/prReview.d.ts +38 -0
- package/dist/server/domain/prReview.d.ts.map +1 -1
- package/dist/server/domain/prReviewReconciliation.d.ts +56 -0
- package/dist/server/domain/prReviewReconciliation.d.ts.map +1 -0
- package/dist/server/domain/prReviewRevision.d.ts +1 -0
- package/dist/server/domain/prReviewRevision.d.ts.map +1 -1
- package/dist/server/domain/readiness/model.d.ts +3 -3
- package/dist/server/domain/release.d.ts +3 -3
- package/dist/server/domain/releasePublication.d.ts +4 -0
- package/dist/server/domain/releasePublication.d.ts.map +1 -0
- package/dist/server/index.js +8 -8
- package/dist/server/server/agent/AgentJobWorker.d.ts +10 -1
- package/dist/server/server/agent/AgentJobWorker.d.ts.map +1 -1
- package/dist/server/server/agent/ReleaseAgentPrompt.d.ts.map +1 -1
- package/dist/server/server/agent/internal/AgentJobTaskExecutor.d.ts +4 -3
- package/dist/server/server/agent/internal/AgentJobTaskExecutor.d.ts.map +1 -1
- package/dist/server/server/agent/internal/PrReviewSandboxSession.d.ts +17 -1
- package/dist/server/server/agent/internal/PrReviewSandboxSession.d.ts.map +1 -1
- package/dist/server/server/agent/internal/PrReviewTaskExecutor.d.ts +76 -2
- package/dist/server/server/agent/internal/PrReviewTaskExecutor.d.ts.map +1 -1
- package/dist/server/server/agent/internal/PrReviewTelemetry.d.ts +27 -0
- package/dist/server/server/agent/internal/PrReviewTelemetry.d.ts.map +1 -0
- package/dist/server/server/api/ApplicationServices.d.ts +39 -5
- package/dist/server/server/api/ApplicationServices.d.ts.map +1 -1
- package/dist/server/server/api/Handlers.d.ts.map +1 -1
- package/dist/server/server/api/RequestBoundary.d.ts.map +1 -1
- package/dist/server/server/application/GovernedReviewSuggestionPublicationGateway.d.ts.map +1 -1
- package/dist/server/server/application/ReviewSuggestionPublicationGateway.d.ts +4 -0
- package/dist/server/server/application/ReviewSuggestionPublicationGateway.d.ts.map +1 -1
- package/dist/server/server/application/index.d.ts +1 -0
- package/dist/server/server/application/index.d.ts.map +1 -1
- package/dist/server/server/application/liveEvents.d.ts.map +1 -1
- package/dist/server/server/application/pipelineExecutionProjection.d.ts +6 -6
- package/dist/server/server/application/portfolioSnapshots.d.ts +2014 -4
- package/dist/server/server/application/portfolioSnapshots.d.ts.map +1 -1
- package/dist/server/server/application/pullRequestReviews.d.ts.map +1 -1
- package/dist/server/server/application/releaseAgent.d.ts +11 -3
- package/dist/server/server/application/releaseAgent.d.ts.map +1 -1
- package/dist/server/server/application/releasePublicationIntent.d.ts +7 -0
- package/dist/server/server/application/releasePublicationIntent.d.ts.map +1 -0
- package/dist/server/server/application/releasePublicationMetadata.d.ts +61 -0
- package/dist/server/server/application/releasePublicationMetadata.d.ts.map +1 -0
- package/dist/server/server/application/releasePublicationSubmissions.d.ts +3699 -0
- package/dist/server/server/application/releasePublicationSubmissions.d.ts.map +1 -0
- package/dist/server/server/application/releaseSynchronization.d.ts.map +1 -1
- package/dist/server/server/cli.js +8 -8
- package/dist/server/server/cli.js.map +1 -1
- package/dist/server/server/governance/governedActionDigests.d.ts +233 -218
- package/dist/server/server/governance/governedActionDigests.d.ts.map +1 -1
- package/dist/server/server/governance/internal/GovernedActionExecutionEngine.d.ts +3 -4
- package/dist/server/server/governance/internal/GovernedActionExecutionEngine.d.ts.map +1 -1
- package/dist/server/server/governance/internal/execution-store/begin.d.ts.map +1 -1
- package/dist/server/server/governance/internal/execution-store/dispatch-inbox.d.ts +1 -1
- package/dist/server/server/governance/internal/execution-store/dispatch-outcome.d.ts +8 -8
- package/dist/server/server/governance/internal/execution-store/provider-outcome-fold.d.ts +2 -2
- package/dist/server/server/governance/internal/execution-store/reconciliation-inbox.d.ts +1 -1
- package/dist/server/server/governance/internal/execution-store/recovery-claim.d.ts +36 -30
- package/dist/server/server/governance/internal/execution-store/recovery-claim.d.ts.map +1 -1
- package/dist/server/server/index.js +5 -5
- package/dist/server/server/internal/codepipeline-state-probe.js +1 -1
- package/dist/server/server/persistence/Database.d.ts +1 -1
- package/dist/server/server/persistence/Database.d.ts.map +1 -1
- package/dist/server/server/persistence/Persistence.d.ts +1539 -577
- package/dist/server/server/persistence/Persistence.d.ts.map +1 -1
- package/dist/server/server/persistence/backup/BackupArchive.d.ts.map +1 -1
- package/dist/server/server/persistence/repositories/agentJobModels.d.ts +345 -8
- package/dist/server/server/persistence/repositories/agentJobModels.d.ts.map +1 -1
- package/dist/server/server/persistence/repositories/agentJobRepository.d.ts +654 -192
- package/dist/server/server/persistence/repositories/agentJobRepository.d.ts.map +1 -1
- package/dist/server/server/persistence/repositories/delivery-graph/contract.d.ts +138 -138
- package/dist/server/server/persistence/repositories/delivery-graph/decode.d.ts +25 -25
- package/dist/server/server/persistence/repositories/delivery-graph/read.d.ts +111 -111
- package/dist/server/server/persistence/repositories/delivery-graph/rows.d.ts +27 -27
- package/dist/server/server/persistence/repositories/delivery-graph/write.d.ts +48 -48
- package/dist/server/server/persistence/repositories/deliveryGraphRepository.d.ts +111 -111
- package/dist/server/server/persistence/repositories/governed-action/codec.d.ts +255 -234
- package/dist/server/server/persistence/repositories/governed-action/codec.d.ts.map +1 -1
- package/dist/server/server/persistence/repositories/governed-action/contract.d.ts +66 -46
- package/dist/server/server/persistence/repositories/governed-action/contract.d.ts.map +1 -1
- package/dist/server/server/persistence/repositories/governed-action/read.d.ts +664 -190
- package/dist/server/server/persistence/repositories/governed-action/read.d.ts.map +1 -1
- package/dist/server/server/persistence/repositories/governed-action/transaction.d.ts +676 -206
- package/dist/server/server/persistence/repositories/governed-action/transaction.d.ts.map +1 -1
- package/dist/server/server/persistence/repositories/governed-action/write-preparation.d.ts +37 -31
- package/dist/server/server/persistence/repositories/governed-action/write-preparation.d.ts.map +1 -1
- package/dist/server/server/persistence/repositories/governed-action/write-replay.d.ts +44 -32
- package/dist/server/server/persistence/repositories/governed-action/write-replay.d.ts.map +1 -1
- package/dist/server/server/persistence/repositories/governed-action/write.d.ts +44 -32
- package/dist/server/server/persistence/repositories/governed-action/write.d.ts.map +1 -1
- package/dist/server/server/persistence/repositories/governedActionRepository.d.ts +674 -205
- package/dist/server/server/persistence/repositories/governedActionRepository.d.ts.map +1 -1
- package/dist/server/server/persistence/repositories/internal/reviewSuggestionRevisions.d.ts +85 -4
- package/dist/server/server/persistence/repositories/internal/reviewSuggestionRevisions.d.ts.map +1 -1
- package/dist/server/server/persistence/repositories/models.d.ts +9 -9
- package/dist/server/server/persistence/repositories/peopleRepository.d.ts +36 -36
- package/dist/server/server/persistence/repositories/providerAccountRepository.d.ts +1 -1
- package/dist/server/server/persistence/repositories/readiness/assessments.d.ts +6 -6
- package/dist/server/server/persistence/repositories/readiness/contract.d.ts +450 -450
- package/dist/server/server/persistence/repositories/readiness/queue.d.ts +14 -14
- package/dist/server/server/persistence/repositories/readinessRepository.d.ts +7 -7
- package/dist/server/server/persistence/repositories/releaseRepository.d.ts +18 -18
- package/dist/server/server/persistence/repositories/retentionRepository.d.ts.map +1 -1
- package/dist/server/server/persistence/repositories/timelineRepository.d.ts +4 -4
- package/dist/server/server/plugins/atlassian/AtlassianOAuthGrants.d.ts.map +1 -1
- package/dist/server/server/plugins/atlassian/AtlassianOAuthScopes.d.ts +9 -0
- package/dist/server/server/plugins/atlassian/AtlassianOAuthScopes.d.ts.map +1 -0
- package/dist/server/server/plugins/atlassian/AtlassianProfiles.d.ts.map +1 -1
- package/dist/server/server/plugins/codecommit/CodeCommitPluginDefinition.d.ts.map +1 -1
- package/dist/server/server/plugins/jira/JiraReadPlugin.d.ts +2 -2
- package/dist/server/server/plugins/jira/JiraReadPlugin.d.ts.map +1 -1
- package/dist/server/server/plugins/jira/JiraReadProvider.d.ts.map +1 -1
- package/dist/server/server/plugins/jira/JiraReleaseVersionLimits.d.ts +8 -0
- package/dist/server/server/plugins/jira/JiraReleaseVersionLimits.d.ts.map +1 -0
- package/dist/server/server/plugins/jira/index.d.ts +1 -1
- package/dist/server/server/plugins/jira/index.d.ts.map +1 -1
- package/dist/server/server/runtime/Bootstrap.d.ts +1 -1
- package/dist/server/server/runtime/Bootstrap.d.ts.map +1 -1
- package/dist/server/server/runtime/ControlCenterServer.d.ts +3 -3
- package/dist/server/server/runtime/ControlCenterServer.d.ts.map +1 -1
- package/dist/server/server/runtime/PrReviewWorkerStartup.d.ts +11 -1
- package/dist/server/server/runtime/PrReviewWorkerStartup.d.ts.map +1 -1
- package/dist/server/server/runtime/RetentionStartup.d.ts.map +1 -1
- package/dist/server/server/runtime/ServerLifecycle.d.ts.map +1 -1
- package/dist/server/server/secrets/SecretStore.d.ts.map +1 -1
- package/package.json +9 -8
- package/dist/client/assets/AgentPage-DGL93TJU.js +0 -3
- package/dist/client/assets/AgentPage-DGL93TJU.js.map +0 -1
- package/dist/client/assets/AuthorizedSharePage-DCQUFY2I.js +0 -2
- package/dist/client/assets/AuthorizedSharePage-DCQUFY2I.js.map +0 -1
- package/dist/client/assets/BrowserCrypto-DVWR7DFd.js +0 -2
- package/dist/client/assets/BrowserSessionHydrator-DE46feEX.js +0 -2
- package/dist/client/assets/BrowserSessionHydrator-DE46feEX.js.map +0 -1
- package/dist/client/assets/CommandSearch-CP_QCbkm.js +0 -2
- package/dist/client/assets/ItemsPage-BGFUkRL2.js +0 -2
- package/dist/client/assets/PortfolioOverview-D45rk8Hl.js +0 -2
- package/dist/client/assets/PortfolioOverview-D45rk8Hl.js.map +0 -1
- package/dist/client/assets/PullRequestReviewPanel-CqPtjhVW.js +0 -6
- package/dist/client/assets/PullRequestReviewPanel-CqPtjhVW.js.map +0 -1
- package/dist/client/assets/ReleaseRoute-DXJ8Jg60.js +0 -2
- package/dist/client/assets/ReleaseWorkset-Dtzalmji.js +0 -2
- package/dist/client/assets/ServicesPage-DGcUjd2H.js +0 -2
- package/dist/client/assets/ServicesPage-DGcUjd2H.js.map +0 -1
- package/dist/client/assets/TimelinePage-Bq1RTQlP.js +0 -2
- package/dist/client/assets/TimelinePage-Bq1RTQlP.js.map +0 -1
- package/dist/client/assets/WorkspaceEntityLink-AdZ_T-Wk.js +0 -2
- package/dist/client/assets/WorkspaceEntityRoute-Bxxnc8us.js +0 -3
- package/dist/client/assets/WorkspaceEntityRoute-Bxxnc8us.js.map +0 -1
- package/dist/client/assets/WorkspacePullRequestDetails-BErJ5bk8.js +0 -3
- package/dist/client/assets/WorkspacePullRequestDetails-BErJ5bk8.js.map +0 -1
- package/dist/client/assets/agent-api-QVqt4a0O.js +0 -19
- package/dist/client/assets/agent-api-QVqt4a0O.js.map +0 -1
- package/dist/client/assets/authenticatedMutationClient-Ccwguc3i.js +0 -2
- package/dist/client/assets/authorizedShareTransport-DZHgFEkh.js +0 -2
- package/dist/client/assets/client-D27unen8.js +0 -5
- package/dist/client/assets/client-D27unen8.js.map +0 -1
- package/dist/client/assets/connectionTestTransport-BQ55d6Me.js +0 -2
- package/dist/client/assets/index-j5ze816l.js +0 -11
- package/dist/client/assets/index-j5ze816l.js.map +0 -1
- package/dist/client/assets/presentPortfolio-D3ZIcnqt.js.map +0 -1
- package/dist/client/assets/pullRequestReviewThreadReplay-oljKM7Xz.js +0 -2
- package/dist/client/assets/pullRequestReviewThreadReplay-oljKM7Xz.js.map +0 -1
- package/dist/client/assets/releaseRoutes-BCuIdZyA.js +0 -2
- package/dist/client/assets/serviceOnboarding-Jg_0yNjf.js +0 -2
- package/dist/client/assets/workspaceScrollCapture-CJ4QUptr.js +0 -2
- package/dist/client/assets/workspaceScrollCapture-CJ4QUptr.js.map +0 -1
- package/dist/client/assets/workspaceSettingsTransport-CZWYL5T7.js +0 -2
- package/dist/server/assets/BindConfig-DIsf2Rnh.js.map +0 -1
- package/dist/server/assets/agent-CyZ40zs1.js.map +0 -1
- package/dist/server/assets/relationshipInferenceMaterialization-DYBcaWhQ.js.map +0 -1
- package/dist/server/assets/workspaceSettings-BE713Oe8.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client-D27unen8.js","names":["decode","Schema.decodeEffect","Schema.NonEmptyArray","Channel.fromTransform","Effect.succeed","Effect.flatMap","TypeId","makeWith","Proto","Inspectable.BaseProto","HttpClientRequest.make","make","Effect.flatMap","Effect.withFiber","Url.make","Option.getOrUndefined","Result.isFailure","Effect.fail","Error.HttpClientError","Error.InvalidUrlError","Tracer.DisablePropagation","Effect.uninterruptibleMask","Effect.matchCauseEffect","Effect.succeed","Cause.hasInterrupts","Effect.failCause","Effect.useSpan","Headers.CurrentRedactedNames","Headers.redact","HttpClientRequest.setHeaders","TraceContext.toHeaders","Effect.withParentSpan","Effect.map","Layer.effect","Effect.contextWith","effect","Effect.updateContext","Context.merge","HttpClientResponse.TypeId","HttpIncomingMessage.TypeId","Effect.suspend","Effect.onInterrupt","Effect.sync","Stream.suspend","Stream.ensuring","Inspectable.NodeInspectSymbol","Context.merge","Record.map","Context.add","make","Context.empty","HttpApiEndpoint.getSuccessSchemas","HttpApiSchema.getStatusSuccess","HttpApiEndpoint.getErrorSchemas","HttpApiSchema.getStatusError","HttpApiSchema.isStreamSchema","Context.Service","Channel.fromTransform","Effect.sync","Effect.flatMap","Effect.void","Effect.suspend","Arr.isArrayNonEmpty","Effect.succeed","Effect.fail","Channel.pipeTo","ChannelSchema.decode","Schema.decodeTo","Duration.millis","Schema.String","Data.TaggedClass","Result.succeed","Result.fail","Effect.gen","Effect.context","HttpClient.mapRequest","HttpClientRequest.prependUrl","HttpClientResponse.matchStatus","Effect.flatMap","Effect.catchCause","Effect.failCause","Cause.combine","Cause.fail","HttpClientError.HttpClientError","HttpClientError.StatusCodeError","Effect.fail","HttpApiSchema.getStatusStream","UndefinedOr.map","Schema.encodeUnknownEffect","HttpApiEndpoint.getPayloadSchemas","Arr.isArrayNonEmpty","HttpMethod.hasBody","Schema.Union","Effect.fnUntraced","HttpClientRequest.make","HttpClientRequest.setUrl","HttpClientRequest.bodyFormData","HttpClientRequest.setBody","HttpClientRequest.appendUrlParams","HttpClientRequest.setHeaders","HttpClient.HttpClient","Effect.as","Schema.decodeEffect","MediaType.normalize","HttpApiSchema.isNoContent","HttpApiSchema.getResponseEncoding","HttpClientError.DecodeError","HttpApiSchema.isStreamSchema","HttpApiSchema.isStreamUint8Array","Effect.map","Stream.provideContext","Schema.Struct","Schema.Literal","Schema.fromJsonString","Schema.toCodecJson","Schema.Cause","Schema.Defect","Sse.decodeSchema","Stream.transformPull","Stream.decodeText","Stream.pipeThroughChannel","Effect.sync","Effect.suspend","Cause.isCause","Effect.succeed","Stream.map","Schema.Uint8Array","Schema.String","Schema.Undefined","Schema.UnknownFromJsonString","SchemaAST.isNull","SchemaAST.toEncoded","Schema.decodeTo","SchemaTransformation.transform","UrlParams.schemaRecord","HttpBody.isHttpBody","HttpApiSchema.getPayloadEncoding","SchemaTransformation.transformOrFail","SchemaIssue.Forbidden","Option.some","HttpBody.text","SchemaIssue.InvalidValue","Predicate.isObject","HttpBody.urlParams","UrlParams.fromInput","HttpBody.uint8Array","Context.Service","Headers.merge","Headers.fromInput","Headers.remove","Effect.map","Effect.tryPromise","HttpClientError.HttpClientError","HttpClientError.TransportError","HttpClientResponse.fromWeb","Effect.flatMap","Stream.toReadableStreamEffect"],"sources":["../../../../../node_modules/.pnpm/effect@4.0.0-beta.98/node_modules/effect/dist/ChannelSchema.js","../../../../../node_modules/.pnpm/effect@4.0.0-beta.98/node_modules/effect/dist/unstable/http/HttpClient.js","../../../../../node_modules/.pnpm/effect@4.0.0-beta.98/node_modules/effect/dist/unstable/httpapi/HttpApi.js","../../../../../node_modules/.pnpm/effect@4.0.0-beta.98/node_modules/effect/dist/unstable/encoding/Sse.js","../../../../../node_modules/.pnpm/effect@4.0.0-beta.98/node_modules/effect/dist/unstable/httpapi/HttpApiClient.js","../../../../../node_modules/.pnpm/effect@4.0.0-beta.98/node_modules/effect/dist/unstable/http/FetchHttpClient.js","../../../src/domain/plugins/discovery.ts","../../../src/domain/plugins/pipeline.ts","../../../src/api/codepipeline.ts","../../../src/domain/normalizedIssue.ts","../../../src/domain/normalizedPage.ts","../../../src/domain/deliveryGraph.ts","../../../src/domain/domainEvent.ts","../../../src/domain/governedAction/model.ts","../../../src/domain/governedAction/bindings.ts","../../../src/domain/governedAction/stateMachine.ts","../../../src/domain/governedAction/lifecycle.ts","../../../src/domain/relationshipRepair.ts","../../../src/domain/timeline.ts","../../../src/api/deliveryGraph.ts","../../../src/api/diff.ts","../../../src/api/liveEvents.ts","../../../src/api/media.ts","../../../src/api/shares.ts","../../../src/api/timeline.ts","../../../src/domain/workspaceSettings.ts","../../../src/api/workspaceSettings.ts","../../../src/api/controlCenterApi.ts","../../../src/api/client.ts"],"sourcesContent":["import * as Channel from \"./Channel.js\";\nimport * as Effect from \"./Effect.js\";\nimport { dual } from \"./Function.js\";\nimport * as Schema from \"./Schema.js\";\n/**\n * Creates a channel that encodes non-empty chunks of schema values into the\n * schema's encoded representation.\n *\n * **When to use**\n *\n * Use to encode typed channel input into the schema's encoded representation\n * before passing chunks to an encoded downstream boundary.\n *\n * **Details**\n *\n * Encoding failures are emitted as `SchemaError`, and any encoding services\n * required by the schema become channel requirements.\n *\n * @see {@link encodeUnknown} for encoded output chunks that should be typed as `unknown`\n * @see {@link decode} for the inverse channel that decodes encoded chunks into schema values\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const encode = schema => () => {\n const encode = Schema.encodeEffect(Schema.NonEmptyArray(schema));\n return Channel.fromTransform((upstream, _scope) => Effect.succeed(Effect.flatMap(upstream, chunk => encode(chunk))));\n};\n/**\n * Creates an `encode` channel variant whose encoded output chunks are typed as\n * `unknown`.\n *\n * **When to use**\n *\n * Use when a channel boundary should encode typed input chunks while the encoded\n * output representation is intentionally untyped.\n *\n * @see {@link encode} for the variant that preserves the schema encoded type\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const encodeUnknown = encode;\n/**\n * Creates a channel that decodes non-empty chunks from the schema's encoded\n * representation into schema values.\n *\n * **When to use**\n *\n * Use to validate and decode encoded channel output into typed schema values\n * before application code consumes it.\n *\n * **Details**\n *\n * Decoding failures are emitted as `SchemaError`, and any decoding services\n * required by the schema become channel requirements.\n *\n * @see {@link decodeUnknown} for boundaries where the encoded input side is intentionally untyped\n * @see {@link encode} for the inverse adapter that encodes typed schema values\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const decode = schema => () => {\n const decode = Schema.decodeEffect(Schema.NonEmptyArray(schema));\n return Channel.fromTransform((upstream, _scope) => Effect.succeed(Effect.flatMap(upstream, chunk => decode(chunk))));\n};\n/**\n * Creates a `decode` channel variant for schema-decoding channel boundaries.\n *\n * **When to use**\n *\n * Use when you need an intentionally unknown or untyped encoded input while\n * keeping only the decoded output statically typed according to the schema.\n *\n * **Details**\n *\n * The channel decodes non-empty encoded chunks into schema values, emits\n * `SchemaError` when decoding fails, and requires the schema's decoding\n * services.\n *\n * @see {@link decode} for the typed variant that preserves the schema's encoded type\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const decodeUnknown = decode;\n/**\n * Wraps a channel so callers work with typed input and output chunks while the\n * wrapped channel uses encoded chunks.\n *\n * **When to use**\n *\n * Use to expose typed input and output at a bidirectional channel boundary\n * while the wrapped channel continues to operate on schema-encoded chunks.\n *\n * **Details**\n *\n * Values sent into the resulting channel are encoded with `inputSchema` before\n * reaching the wrapped channel. Values emitted by the wrapped channel are\n * decoded with `outputSchema` before they are emitted downstream. Schema\n * failures are surfaced as `SchemaError`.\n *\n * @see {@link duplexUnknown} for the variant whose encoded side is intentionally untyped\n * @see {@link encode} for encoding typed chunks at one-way channel boundaries\n * @see {@link decode} for decoding encoded chunks at one-way channel boundaries\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const duplex = /*#__PURE__*/dual(2, (self, options) => encode(options.inputSchema)().pipe(Channel.pipeTo(self), Channel.pipeTo(decode(options.outputSchema)())));\n/**\n * Wraps a bidirectional channel whose encoded chunks are typed as `unknown`.\n *\n * **When to use**\n *\n * Use when you need a bidirectional channel to cross an encoded boundary whose\n * chunk types are intentionally erased, while callers send and receive\n * schema-typed chunks.\n *\n * **Details**\n *\n * The resulting channel accepts typed input chunks, encodes them with\n * `inputSchema`, decodes unknown output chunks with `outputSchema`, and\n * surfaces schema failures as `SchemaError`.\n *\n * @see {@link duplex} for the variant that preserves the schema encoded types on the wrapped channel\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const duplexUnknown = duplex;\n//# sourceMappingURL=ChannelSchema.js.map","import * as Cause from \"../../Cause.js\";\nimport { Clock } from \"../../Clock.js\";\nimport * as Context from \"../../Context.js\";\nimport * as Duration from \"../../Duration.js\";\nimport * as Effect from \"../../Effect.js\";\nimport * as Fiber from \"../../Fiber.js\";\nimport { constant, constFalse, constTrue, dual, flow, identity } from \"../../Function.js\";\nimport * as Inspectable from \"../../Inspectable.js\";\nimport * as Layer from \"../../Layer.js\";\nimport * as Option from \"../../Option.js\";\nimport { pipeArguments } from \"../../Pipeable.js\";\nimport * as Predicate from \"../../Predicate.js\";\nimport * as Ref from \"../../Ref.js\";\nimport * as Result from \"../../Result.js\";\nimport * as Schedule from \"../../Schedule.js\";\nimport * as Stream from \"../../Stream.js\";\nimport * as Tracer from \"../../Tracer.js\";\nimport * as Cookies from \"./Cookies.js\";\nimport * as Headers from \"./Headers.js\";\nimport * as Error from \"./HttpClientError.js\";\nimport * as HttpClientRequest from \"./HttpClientRequest.js\";\nimport * as HttpClientResponse from \"./HttpClientResponse.js\";\nimport * as HttpIncomingMessage from \"./HttpIncomingMessage.js\";\nimport * as HttpMethod from \"./HttpMethod.js\";\nimport * as TraceContext from \"./HttpTraceContext.js\";\nimport * as Url from \"./Url.js\";\nconst TypeId = \"~effect/http/HttpClient\";\n/**\n * Returns `true` if the provided value is an `HttpClient`.\n *\n * @category guards\n * @since 4.0.0\n */\nexport const isHttpClient = u => Predicate.hasProperty(u, TypeId);\n/**\n * Service tag for the default outgoing HTTP client service.\n *\n * **When to use**\n *\n * Use to provide the default outgoing HTTP client service used by request\n * accessors such as `execute`, `get`, and `post`.\n *\n * @category services\n * @since 4.0.0\n */\nexport const HttpClient = /*#__PURE__*/Context.Service(\"effect/HttpClient\");\nconst accessor = method => (...args) => Effect.flatMap(HttpClient, client => client[method](...args));\n/**\n * Executes a prebuilt `HttpClientRequest` using the `HttpClient` service from the environment.\n *\n * @category accessors\n * @since 4.0.0\n */\nexport const execute = /*#__PURE__*/accessor(\"execute\");\n/**\n * Executes a `GET` request using the `HttpClient` service from the environment.\n *\n * @category accessors\n * @since 4.0.0\n */\nexport const get = /*#__PURE__*/accessor(\"get\");\n/**\n * Executes a `HEAD` request using the `HttpClient` service from the environment.\n *\n * @category accessors\n * @since 4.0.0\n */\nexport const head = /*#__PURE__*/accessor(\"head\");\n/**\n * Executes a `POST` request using the `HttpClient` service from the environment.\n *\n * @category accessors\n * @since 4.0.0\n */\nexport const post = /*#__PURE__*/accessor(\"post\");\n/**\n * Executes a `PATCH` request using the `HttpClient` service from the environment.\n *\n * @category accessors\n * @since 4.0.0\n */\nexport const patch = /*#__PURE__*/accessor(\"patch\");\n/**\n * Executes a `PUT` request using the `HttpClient` service from the environment.\n *\n * @category accessors\n * @since 4.0.0\n */\nexport const put = /*#__PURE__*/accessor(\"put\");\n/**\n * Executes a `DELETE` request using the `HttpClient` service from the environment.\n *\n * @category accessors\n * @since 4.0.0\n */\nexport const del = /*#__PURE__*/accessor(\"del\");\n/**\n * Executes an `OPTIONS` request using the `HttpClient` service from the environment.\n *\n * @category accessors\n * @since 4.0.0\n */\nexport const options = /*#__PURE__*/accessor(\"options\");\n/**\n * Transforms a client by wrapping the response effect for each request.\n *\n * **Details**\n *\n * The transformation receives both the response effect and the original request, allowing it to change success, error, and environment behavior.\n *\n * @category mapping & sequencing\n * @since 4.0.0\n */\nexport const transform = /*#__PURE__*/dual(2, (self, f) => makeWith(Effect.flatMap(request => f(self.postprocess(Effect.succeed(request)), request)), self.preprocess));\n/**\n * Transforms a client by applying an effectful transformation to each response effect.\n *\n * @category mapping & sequencing\n * @since 4.0.0\n */\nexport const transformResponse = /*#__PURE__*/dual(2, (self, f) => makeWith(request => f(self.postprocess(request)), self.preprocess));\nconst catch_ = /*#__PURE__*/dual(2, (self, f) => transformResponse(self, Effect.catch(f)));\nexport {\n/**\n * Handles all client failures with an effectful recovery function and returns a transformed client.\n *\n * @category error handling\n * @since 4.0.0\n */\ncatch_ as catch };\n/**\n * Handles client failures with one or more matching `_tag` values and returns a transformed client.\n *\n * @category error handling\n * @since 4.0.0\n */\nexport const catchTag = /*#__PURE__*/dual(3, (self, tag, f) => transformResponse(self, effect => Effect.catchTag(effect, tag, f)));\n/**\n * Handles client failures by matching their `_tag` values against a case map.\n *\n * @category error handling\n * @since 4.0.0\n */\nexport const catchTags = /*#__PURE__*/dual(2, (self, cases) => transformResponse(self, Effect.catchTags(cases)));\n/**\n * Filters the result of a response, or runs an alternative effect if the predicate fails.\n *\n * @category filters\n * @since 4.0.0\n */\nexport const filterOrElse = /*#__PURE__*/dual(3, (self, f, orElse) => transformResponse(self, Effect.filterOrElse(f, orElse)));\n/**\n * Filters successful responses, or fails with the error produced by `orFailWith` when the predicate does not match.\n *\n * @category filters\n * @since 4.0.0\n */\nexport const filterOrFail = /*#__PURE__*/dual(3, (self, f, orFailWith) => transformResponse(self, Effect.filterOrFail(f, orFailWith)));\n/**\n * Filters responses by HTTP status code.\n *\n * @category filters\n * @since 4.0.0\n */\nexport const filterStatus = /*#__PURE__*/dual(2, (self, f) => transformResponse(self, Effect.flatMap(HttpClientResponse.filterStatus(f))));\n/**\n * Filters responses that return a 2xx status code.\n *\n * @category filters\n * @since 4.0.0\n */\nexport const filterStatusOk = /*#__PURE__*/transformResponse(/*#__PURE__*/Effect.flatMap(HttpClientResponse.filterStatusOk));\n/**\n * Constructs an `HttpClient.With` from a preprocessing function and a postprocessing function.\n *\n * **Details**\n *\n * `execute` applies preprocessing to the request and then passes the resulting request effect to postprocessing.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const makeWith = (postprocess, preprocess) => {\n const self = Object.create(Proto);\n self.preprocess = preprocess;\n self.postprocess = postprocess;\n self.execute = function (request) {\n return postprocess(preprocess(request));\n };\n return self;\n};\nconst Proto = {\n [TypeId]: TypeId,\n pipe() {\n return pipeArguments(this, arguments);\n },\n ...Inspectable.BaseProto,\n toJSON() {\n return {\n _id: \"effect/HttpClient\"\n };\n },\n ... /*#__PURE__*/Object.fromEntries(/*#__PURE__*/HttpMethod.allShort.map(([fullMethod, method]) => [method, function (url, options) {\n return this.execute(HttpClientRequest.make(fullMethod)(url, options));\n }]))\n};\n/**\n * Constructs an `HttpClient` from a low-level request runner.\n *\n * **Details**\n *\n * The runner receives the request, resolved URL, abort signal, and current fiber. The client wrapper handles URL construction failures, tracing and propagation, header redaction, and aborting non-scoped requests on interruption.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const make = f => makeWith(effect => Effect.flatMap(effect, request => Effect.withFiber(fiber => {\n const scopedController = scopedRequests.get(request);\n const controller = scopedController ?? new AbortController();\n const urlResult = Url.make(request.url, request.urlParams, Option.getOrUndefined(request.hash));\n if (Result.isFailure(urlResult)) {\n return Effect.fail(new Error.HttpClientError({\n reason: new Error.InvalidUrlError({\n request,\n cause: urlResult.failure\n })\n }));\n }\n const url = urlResult.success;\n const tracerDisabled = fiber.getRef(Tracer.DisablePropagation) || fiber.getRef(TracerDisabledWhen)(request);\n if (tracerDisabled) {\n const effect = f(request, url, controller.signal, fiber);\n if (scopedController) return effect;\n return Effect.uninterruptibleMask(restore => Effect.matchCauseEffect(restore(effect), {\n onSuccess(response) {\n responseRegistry.register(response, controller);\n return Effect.succeed(new InterruptibleResponse(response, controller));\n },\n onFailure(cause) {\n if (Cause.hasInterrupts(cause)) {\n controller.abort();\n }\n return Effect.failCause(cause);\n }\n }));\n }\n return Effect.useSpan(fiber.getRef(SpanNameGenerator)(request), {\n kind: \"client\"\n }, span => {\n span.attribute(\"http.request.method\", request.method);\n span.attribute(\"server.address\", url.origin);\n if (url.port !== \"\") {\n span.attribute(\"server.port\", +url.port);\n }\n span.attribute(\"url.full\", url.toString());\n span.attribute(\"url.path\", url.pathname);\n span.attribute(\"url.scheme\", url.protocol.slice(0, -1));\n const query = url.search.slice(1);\n if (query !== \"\") {\n span.attribute(\"url.query\", query);\n }\n const redactedHeaderNames = fiber.getRef(Headers.CurrentRedactedNames);\n const redactedHeaders = Headers.redact(request.headers, redactedHeaderNames);\n for (const name in redactedHeaders) {\n span.attribute(`http.request.header.${name}`, String(redactedHeaders[name]));\n }\n request = fiber.getRef(TracerPropagationEnabled) ? HttpClientRequest.setHeaders(request, TraceContext.toHeaders(span)) : request;\n return Effect.uninterruptibleMask(restore => restore(f(request, url, controller.signal, fiber)).pipe(Effect.withParentSpan(span, {\n captureStackTrace: false\n }), Effect.matchCauseEffect({\n onSuccess: response => {\n span.attribute(\"http.response.status_code\", response.status);\n const redactedHeaders = Headers.redact(response.headers, redactedHeaderNames);\n for (const name in redactedHeaders) {\n span.attribute(`http.response.header.${name}`, String(redactedHeaders[name]));\n }\n if (scopedController) return Effect.succeed(response);\n responseRegistry.register(response, controller);\n return Effect.succeed(new InterruptibleResponse(response, controller));\n },\n onFailure(cause) {\n if (!scopedController && Cause.hasInterrupts(cause)) {\n controller.abort();\n }\n return Effect.failCause(cause);\n }\n })));\n });\n})), Effect.succeed);\n/**\n * Appends a transformation of the request object before sending it.\n *\n * @category mapping & sequencing\n * @since 4.0.0\n */\nexport const mapRequest = /*#__PURE__*/dual(2, (self, f) => makeWith(self.postprocess, request => Effect.map(self.preprocess(request), f)));\n/**\n * Appends an effectful transformation of the request object before sending it.\n *\n * @category mapping & sequencing\n * @since 4.0.0\n */\nexport const mapRequestEffect = /*#__PURE__*/dual(2, (self, f) => makeWith(self.postprocess, request => Effect.flatMap(self.preprocess(request), f)));\n/**\n * Prepends a transformation of the request object before sending it.\n *\n * @category mapping & sequencing\n * @since 4.0.0\n */\nexport const mapRequestInput = /*#__PURE__*/dual(2, (self, f) => makeWith(self.postprocess, request => self.preprocess(f(request))));\n/**\n * Prepends an effectful transformation of the request object before sending it.\n *\n * @category mapping & sequencing\n * @since 4.0.0\n */\nexport const mapRequestInputEffect = /*#__PURE__*/dual(2, (self, f) => makeWith(self.postprocess, request => Effect.flatMap(f(request), self.preprocess)));\n/**\n * Retries the request based on a provided schedule or policy.\n *\n * @category error handling\n * @since 4.0.0\n */\nexport const retry = /*#__PURE__*/dual(2, (self, policy) => transformResponse(self, Effect.retry(policy)));\n/**\n * Retries common transient errors, such as rate limiting, timeouts or network issues.\n *\n * **When to use**\n *\n * Use to focus on retrying errors, transient responses, or both.\n *\n * **Details**\n *\n * Specifying a `while` predicate allows you to consider other errors as\n * transient, and is ignored in \"response-only\" mode.\n *\n * @category error handling\n * @since 4.0.0\n */\nexport const retryTransient = /*#__PURE__*/dual(2, (self, options) => {\n const isOnlySchedule = Schedule.isSchedule(options);\n const retryOn = isOnlySchedule ? \"errors-and-responses\" : options.retryOn ?? \"errors-and-responses\";\n const schedule = isOnlySchedule ? options : options.schedule;\n const passthroughSchedule = schedule && Schedule.passthrough(schedule);\n const times = isOnlySchedule ? undefined : options.times;\n return transformResponse(self, flow(retryOn === \"errors-only\" ? identity : Effect.repeat({\n schedule: passthroughSchedule,\n times,\n while: isTransientResponse\n }), retryOn === \"response-only\" ? identity : Effect.retry({\n while: isOnlySchedule || options.while === undefined ? isTransientError : Predicate.or(isTransientError, options.while),\n schedule,\n times\n })));\n});\n/**\n * Applies request rate limiting using the `RateLimiter` service.\n *\n * **Details**\n *\n * It can update limits by inspecting common rate limit response headers and\n * automatically retries HTTP `429` responses (or `HttpClientError` values\n * wrapping a `429` response) by forcing the retry back through the limiter.\n *\n * @category rate limiting\n * @since 4.0.0\n */\nexport const withRateLimiter = /*#__PURE__*/dual(2, (self, options) => {\n const initialState = {\n initial: true,\n limit: options.limit,\n window: Duration.max(Duration.fromInputUnsafe(options.window), Duration.millis(1))\n };\n const states = new Map();\n const keyOption = options.key;\n const resolveKey = typeof keyOption === \"function\" ? keyOption : constant(keyOption);\n const tokensOption = options.tokens;\n const resolveTokens = typeof tokensOption === \"function\" ? tokensOption : constant(tokensOption ?? 1);\n const adaptiveLearningEnabled = !options.disableAdaptiveLearning;\n const getState = key => {\n const current = states.get(key);\n if (current !== undefined) {\n return current;\n }\n states.set(key, initialState);\n return initialState;\n };\n const onResponse = options.disableResponseInspection ? undefined : (clock, key, headers, tokens) => {\n const current = getState(key);\n const next = parseRateLimiterState(current, clock, headers, tokens);\n if (next.limit !== current.limit || !Duration.equals(next.window, current.window)) {\n states.set(key, next);\n }\n };\n return transform(self, function loop(effect, request) {\n const fiber = Fiber.getCurrent();\n const clock = fiber.getRef(Clock);\n const key = resolveKey(request);\n const tokens = Math.max(resolveTokens(request), 1);\n const current = getState(key);\n function retry(retryAfter) {\n if (options.disableResponseInspection) return loop(effect, request);\n return retryAfter ? Effect.flatMap(Effect.sleep(retryAfter), () => loop(effect, request)) : loop(effect, request);\n }\n const inspectResponse = (response, adaptive) => {\n onResponse?.(clock, key, response.headers, tokens);\n if (options.disableResponseInspection || response.status !== 429) {\n return Effect.succeed(undefined);\n }\n const retryAfter = parseRetryAfter(clock, getHeader(response.headers, \"retry-after\"));\n if (retryAfter === undefined) {\n return Effect.succeed(undefined);\n }\n const delay = parseRateLimitWindow(clock, response.headers) ?? retryAfter;\n if (adaptive === undefined) {\n return Effect.succeed(delay);\n }\n return Effect.as(options.limiter.adaptiveFeedback({\n key,\n epoch: adaptive.epoch,\n tokens,\n status: response.status,\n retryAfter: delay\n }), delay);\n };\n return Effect.flatMap(options.limiter.consume({\n algorithm: options.algorithm,\n onExceeded: \"delay\",\n key,\n limit: current.limit,\n window: current.window,\n tokens\n }), ({\n delay\n }) => {\n const runAdaptive = () => {\n const runRequest = adaptive => {\n const request = Effect.matchEffect(effect, {\n onSuccess(response) {\n return Effect.flatMap(inspectResponse(response, adaptive), retryAfter => {\n if (response.status !== 429) return Effect.succeed(response);\n return retry(retryAfter);\n });\n },\n onFailure(error) {\n if (isTooManyRequestsHttpClientError(error)) {\n return Effect.flatMap(inspectResponse(error.reason.response, adaptive), retryAfter => retry(retryAfter));\n }\n return Effect.fail(error);\n }\n });\n return adaptive === undefined || Duration.isZero(adaptive.delay) ? request : Effect.delay(request, adaptive.delay);\n };\n if (!adaptiveLearningEnabled) {\n return runRequest(undefined);\n }\n return Effect.flatMap(options.limiter.adaptiveConsume({\n key,\n tokens,\n fallbackLimit: current.limit,\n fallbackWindow: current.window\n }), adaptive => {\n if (!Duration.isZero(adaptive.delay) && adaptive.phase === \"cooldown\") {\n return Effect.flatMap(Effect.sleep(adaptive.delay), runAdaptive);\n }\n return runRequest(adaptive);\n });\n };\n return Duration.isZero(delay) ? runAdaptive() : Effect.flatMap(Effect.sleep(delay), runAdaptive);\n });\n });\n});\nconst parseRateLimiterState = (state, clock, headers, tokens) => {\n const limit = parseRateLimitLimit(state, headers, tokens) ?? state.limit;\n const window = parseRateLimitWindow(clock, headers) ?? state.window;\n if (limit === state.limit && Duration.equals(window, state.window)) {\n return state;\n }\n return {\n limit,\n window,\n initial: false\n };\n};\nconst parseRateLimitLimit = (state, headers, tokens) => {\n const raw = getHeader(headers, \"ratelimit-limit\", \"x-ratelimit-limit\");\n const value = parseNumberHeader(raw);\n if (value !== undefined && value > 0) {\n return value;\n }\n const remaining = parseRateLimitRemaining(headers);\n if (remaining === undefined) {\n return undefined;\n }\n return state.initial ? remaining + tokens : Math.max(remaining + tokens, state.limit);\n};\nconst parseRateLimitRemaining = headers => {\n const raw = getHeader(headers, \"ratelimit-remaining\", \"x-ratelimit-remaining\");\n const value = parseNumberHeader(raw);\n return value !== undefined && value >= 0 ? value : undefined;\n};\nconst parseRateLimitWindow = (clock, headers) => {\n const resetAfter = parseResetAfter(getHeader(headers, \"ratelimit-reset-after\", \"x-ratelimit-reset-after\"));\n if (resetAfter !== undefined) {\n return resetAfter;\n }\n return parseResetHeader(clock, getHeader(headers, \"ratelimit-reset\", \"x-ratelimit-reset\"));\n};\nconst parseRetryAfter = (clock, value) => {\n if (value === undefined) {\n return undefined;\n }\n const numeric = parseNumberHeader(value);\n if (numeric !== undefined) {\n return Duration.max(Duration.seconds(numeric), Duration.millis(1));\n }\n const parsedDate = Date.parse(value);\n if (Number.isNaN(parsedDate)) {\n return undefined;\n }\n const millis = parsedDate - clock.currentTimeMillisUnsafe();\n if (millis <= 0) {\n return Duration.millis(1);\n }\n return Duration.millis(millis);\n};\nconst parseResetAfter = value => {\n const numeric = parseNumberHeader(value);\n if (numeric === undefined || numeric <= 0) {\n return undefined;\n }\n return Duration.max(Duration.seconds(numeric), Duration.millis(1));\n};\nconst parseResetHeader = (clock, value) => {\n const numeric = parseNumberHeader(value);\n if (numeric === undefined || numeric <= 0) {\n return undefined;\n }\n const nowMillis = clock.currentTimeMillisUnsafe();\n if (numeric > 1_000_000_000_000) {\n return Duration.millis(Math.max(numeric - nowMillis, 1));\n }\n if (numeric > 1_000_000_000) {\n return Duration.millis(Math.max(numeric * 1_000 - nowMillis, 1));\n }\n return Duration.max(Duration.seconds(numeric), Duration.millis(1));\n};\nconst parseNumberHeader = value => {\n if (value === undefined) {\n return undefined;\n }\n const match = /-?\\d+(?:\\.\\d+)?/.exec(value);\n if (match === null) {\n return undefined;\n }\n const parsed = Number(match[0]);\n return Number.isFinite(parsed) ? parsed : undefined;\n};\nconst getHeader = (headers, ...keys) => {\n for (let i = 0; i < keys.length; i++) {\n const value = headers[keys[i]];\n if (value !== undefined) {\n return value;\n }\n }\n return undefined;\n};\n/**\n * Performs an additional effect after a successful request.\n *\n * @category mapping & sequencing\n * @since 4.0.0\n */\nexport const tap = /*#__PURE__*/dual(2, (self, f) => transformResponse(self, Effect.tap(f)));\n/**\n * Performs an additional effect after an unsuccessful request.\n *\n * @category mapping & sequencing\n * @since 4.0.0\n */\nexport const tapError = /*#__PURE__*/dual(2, (self, f) => transformResponse(self, Effect.tapError(f)));\n/**\n * Performs an additional effect on the request before sending it.\n *\n * @category mapping & sequencing\n * @since 4.0.0\n */\nexport const tapRequest = /*#__PURE__*/dual(2, (self, f) => makeWith(self.postprocess, request => Effect.tap(self.preprocess(request), f)));\n/**\n * Adds a `Ref` of cookies to the client for handling cookies across requests.\n *\n * **When to use**\n *\n * Use to add shared cookie storage to a client so response cookies are retained\n * and sent by later requests.\n *\n * @category cookies\n * @since 4.0.0\n */\nexport const withCookiesRef = /*#__PURE__*/dual(2, (self, ref) => makeWith(request => Effect.tap(self.postprocess(request), response => Ref.update(ref, cookies => Cookies.merge(cookies, response.cookies))), request => Effect.flatMap(self.preprocess(request), request => Effect.map(Ref.get(ref), cookies => Cookies.isEmpty(cookies) ? request : HttpClientRequest.setHeader(request, \"cookie\", Cookies.toCookieHeader(cookies))))));\n/**\n * Attaches the lifetime of the `HttpClientRequest` to a `Scope`.\n *\n * @category resource management\n * @since 4.0.0\n */\nexport const withScope = self => transform(self, (effect, request) => {\n const controller = new AbortController();\n scopedRequests.set(request, controller);\n return Effect.andThen(Effect.addFinalizer(() => Effect.sync(() => controller.abort())), effect);\n});\n/**\n * Enables following HTTP redirects up to a specified number of times.\n *\n * @category redirects\n * @since 4.0.0\n */\nexport const followRedirects = /*#__PURE__*/dual(args => isHttpClient(args[0]), (self, maxRedirects) => makeWith(request => {\n const loop = (request, redirects) => Effect.flatMap(self.postprocess(Effect.succeed(request)), response => response.status >= 300 && response.status < 400 && response.headers.location && redirects < (maxRedirects ?? 10) ? loop(HttpClientRequest.setUrl(request, new URL(response.headers.location, response.request.url)), redirects + 1) : Effect.succeed(response));\n return Effect.flatMap(request, request => loop(request, 0));\n}, self.preprocess));\n/**\n * Context reference for a predicate that disables client-side tracing for matching outgoing requests.\n *\n * @category references\n * @since 4.0.0\n */\nexport const TracerDisabledWhen = /*#__PURE__*/Context.Reference(\"effect/http/HttpClient/TracerDisabledWhen\", {\n defaultValue: () => constFalse\n});\n/**\n * Context reference that controls whether outgoing client spans are propagated to request headers.\n *\n * @category references\n * @since 4.0.0\n */\nexport const TracerPropagationEnabled = /*#__PURE__*/Context.Reference(\"effect/HttpClient/TracerPropagationEnabled\", {\n defaultValue: constTrue\n});\n/**\n * Context reference for generating the span name used for outgoing client request spans.\n *\n * @category references\n * @since 4.0.0\n */\nexport const SpanNameGenerator = /*#__PURE__*/Context.Reference(\"effect/http/HttpClient/SpanNameGenerator\", {\n defaultValue: () => request => `http.client ${request.method}`\n});\n/**\n * Creates an `HttpClient` layer and merges the layer construction context into client response effects.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layerMergedContext = effect => Layer.effect(HttpClient)(Effect.contextWith(context => Effect.map(effect, client => transformResponse(client, Effect.updateContext(input => Context.merge(context, input))))));\n// -----------------------------------------------------------------------------\n// internal\n// -----------------------------------------------------------------------------\nconst responseRegistry = /*#__PURE__*/(() => {\n if (\"FinalizationRegistry\" in globalThis && globalThis.FinalizationRegistry) {\n const registry = /*#__PURE__*/new FinalizationRegistry(controller => {\n controller.abort();\n });\n return {\n register(response, controller) {\n registry.register(response, controller, response);\n },\n unregister(response) {\n registry.unregister(response);\n }\n };\n }\n const timers = /*#__PURE__*/new Map();\n return {\n register(response, controller) {\n timers.set(response, setTimeout(() => controller.abort(), 5000));\n },\n unregister(response) {\n const timer = timers.get(response);\n if (timer === undefined) return;\n clearTimeout(timer);\n timers.delete(response);\n }\n };\n})();\nconst scopedRequests = /*#__PURE__*/new WeakMap();\nclass InterruptibleResponse {\n original;\n controller;\n constructor(original, controller) {\n this.original = original;\n this.controller = controller;\n }\n [HttpClientResponse.TypeId] = HttpClientResponse.TypeId;\n [HttpIncomingMessage.TypeId] = HttpIncomingMessage.TypeId;\n applyInterrupt(effect) {\n return Effect.suspend(() => {\n responseRegistry.unregister(this.original);\n return Effect.onInterrupt(effect, () => Effect.sync(() => {\n this.controller.abort();\n }));\n });\n }\n get request() {\n return this.original.request;\n }\n get status() {\n return this.original.status;\n }\n get headers() {\n return this.original.headers;\n }\n get cookies() {\n return this.original.cookies;\n }\n get remoteAddress() {\n return this.original.remoteAddress;\n }\n get formData() {\n return this.applyInterrupt(this.original.formData);\n }\n get text() {\n return this.applyInterrupt(this.original.text);\n }\n get json() {\n return this.applyInterrupt(this.original.json);\n }\n get urlParamsBody() {\n return this.applyInterrupt(this.original.urlParamsBody);\n }\n get arrayBuffer() {\n return this.applyInterrupt(this.original.arrayBuffer);\n }\n get stream() {\n return Stream.suspend(() => {\n responseRegistry.unregister(this.original);\n return Stream.ensuring(this.original.stream, Effect.sync(() => {\n this.controller.abort();\n }));\n });\n }\n toJSON() {\n return this.original.toJSON();\n }\n [Inspectable.NodeInspectSymbol]() {\n return this.original[Inspectable.NodeInspectSymbol]();\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\nconst isTransientError = error => Cause.isTimeoutError(error) || isTransientHttpError(error);\nconst isTransientHttpError = error => Error.isHttpClientError(error) && (error.reason._tag === \"TransportError\" || error.reason._tag === \"StatusCodeError\" && isTransientResponse(error.reason.response));\nconst isTooManyRequestsHttpClientError = error => Error.isHttpClientError(error) && error.reason._tag === \"StatusCodeError\" && error.reason.response.status === 429;\nconst isTransientResponse = response => response.status === 408 || response.status === 429 || response.status === 500 || response.status === 502 || response.status === 503 || response.status === 504;\n//# sourceMappingURL=HttpClient.js.map","import * as Context from \"../../Context.js\";\nimport * as internalRecord from \"../../internal/record.js\";\nimport { pipeArguments } from \"../../Pipeable.js\";\nimport * as Predicate from \"../../Predicate.js\";\nimport * as Record from \"../../Record.js\";\nimport * as HttpApiEndpoint from \"./HttpApiEndpoint.js\";\nimport * as HttpApiSchema from \"./HttpApiSchema.js\";\nconst TypeId = \"~effect/httpapi/HttpApi\";\n/**\n * Returns `true` when a value is an `HttpApi`.\n *\n * @category guards\n * @since 4.0.0\n */\nexport const isHttpApi = u => Predicate.hasProperty(u, TypeId);\nconst Proto = {\n [TypeId]: TypeId,\n pipe() {\n return pipeArguments(this, arguments);\n },\n add(...toAdd) {\n const groups = {\n ...this.groups\n };\n for (const group of toAdd) {\n internalRecord.set(groups, group.identifier, group);\n }\n return makeProto({\n ...optionsFromApi(this),\n groups\n });\n },\n addHttpApi(api) {\n const newGroups = {\n ...this.groups\n };\n for (const key in api.groups) {\n const group = api.groups[key];\n internalRecord.set(newGroups, key, group.annotateMerge(Context.merge(api.annotations, group.annotations)));\n }\n return makeProto({\n ...optionsFromApi(this),\n groups: newGroups\n });\n },\n prefix(prefix) {\n return makeProto({\n ...optionsFromApi(this),\n groups: Record.map(this.groups, group => group.prefix(prefix))\n });\n },\n middleware(tag) {\n return makeProto({\n ...optionsFromApi(this),\n groups: Record.map(this.groups, group => group.middleware(tag))\n });\n },\n annotate(key, value) {\n return makeProto({\n ...optionsFromApi(this),\n annotations: Context.add(this.annotations, key, value)\n });\n },\n annotateMerge(annotations) {\n return makeProto({\n ...optionsFromApi(this),\n annotations: Context.merge(this.annotations, annotations)\n });\n }\n};\nconst optionsFromApi = api => ({\n identifier: api.identifier,\n groups: api.groups,\n annotations: api.annotations\n});\nconst makeProto = options => {\n function HttpApi() {}\n Object.setPrototypeOf(HttpApi, Proto);\n return Object.assign(HttpApi, options);\n};\n/**\n * Creates an empty `HttpApi` with the supplied identifier.\n *\n * **When to use**\n *\n * Use when you need to start defining an HTTP API, add groups with `add` or\n * `addHttpApi`, provide endpoint implementations with `HttpApiBuilder.group`,\n * and register the API with `HttpApiBuilder.layer`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const make = identifier => makeProto({\n identifier,\n groups: {},\n annotations: Context.empty()\n});\n/**\n * Describes the groups and endpoints in an `HttpApi`.\n *\n * **Details**\n *\n * The callbacks receive each group or endpoint with merged annotations, endpoint\n * middleware, and response schemas grouped by HTTP status.\n *\n * @category reflection\n * @since 4.0.0\n */\nexport const reflect = (self, options) => {\n const groups = Object.values(self.groups);\n for (const group of groups) {\n const groupAnnotations = Context.merge(self.annotations, group.annotations);\n options.onGroup({\n group,\n mergedAnnotations: groupAnnotations\n });\n const endpoints = Object.values(group.endpoints);\n for (const endpoint of endpoints) {\n if (options.predicate && !options.predicate({\n endpoint,\n group\n })) continue;\n options.onEndpoint({\n group,\n endpoint,\n middleware: endpoint.middlewares,\n mergedAnnotations: Context.merge(groupAnnotations, endpoint.annotations),\n successes: extractResponseContent(HttpApiEndpoint.getSuccessSchemas(endpoint), HttpApiSchema.getStatusSuccess),\n errors: extractResponseContent(HttpApiEndpoint.getErrorSchemas(endpoint), HttpApiSchema.getStatusError)\n });\n }\n }\n};\n// -------------------------------------------------------------------------------------\nconst extractResponseContent = (schemas, getStatus) => {\n const map = new Map();\n schemas.forEach(add);\n return map;\n function add(schema) {\n if (HttpApiSchema.isStreamSchema(schema)) return;\n const ast = schema.ast;\n const status = getStatus(ast);\n const schemas = map.get(status);\n if (schemas === undefined) {\n map.set(status, [schema]);\n } else {\n schemas.push(schema);\n }\n }\n};\n/**\n * Adds additional schemas to components/schemas.\n * The provided schemas must have a `identifier` annotation.\n *\n * @category services\n * @since 4.0.0\n */\nexport class AdditionalSchemas extends /*#__PURE__*/Context.Service()(\"effect/httpapi/HttpApi/AdditionalSchemas\") {}\n//# sourceMappingURL=HttpApi.js.map","import * as Arr from \"../../Array.js\";\nimport * as Cause from \"../../Cause.js\";\nimport * as Channel from \"../../Channel.js\";\nimport * as ChannelSchema from \"../../ChannelSchema.js\";\nimport * as Data from \"../../Data.js\";\nimport * as Duration from \"../../Duration.js\";\nimport * as Effect from \"../../Effect.js\";\nimport { hasProperty } from \"../../Predicate.js\";\nimport * as Pull from \"../../Pull.js\";\nimport * as Result from \"../../Result.js\";\nimport * as Schema from \"../../Schema.js\";\nimport * as SchemaTransformation from \"../../SchemaTransformation.js\";\n/**\n * Creates a channel that parses Server-Sent Events text chunks into `Event` values.\n *\n * **Details**\n *\n * SSE `retry` directives are emitted as `Retry` failures so callers can\n * reconnect with the requested delay.\n *\n * @category decoding\n * @since 4.0.0\n */\nexport const decode = () => Channel.fromTransform((upstream, _scope) => Effect.sync(() => {\n let buffer = [];\n let retry;\n const parser = makeParser(event => {\n if (event._tag === \"Retry\") {\n retry = event;\n } else {\n buffer.push(event);\n }\n });\n const pump = Effect.flatMap(upstream, arr => {\n for (let i = 0; i < arr.length; i++) {\n parser.feed(arr[i]);\n }\n return Effect.void;\n });\n return Effect.suspend(function loop() {\n if (Arr.isArrayNonEmpty(buffer)) {\n const out = buffer;\n buffer = [];\n return Effect.succeed(out);\n } else if (retry) {\n return Effect.fail(retry);\n }\n return Effect.flatMap(pump, loop);\n });\n}));\n/**\n * Creates an SSE decoder channel that decodes each parsed event with a schema.\n *\n * **Details**\n *\n * The schema receives the untagged event shape containing `id`, `event`, and\n * string `data`.\n *\n * @category decoding\n * @since 4.0.0\n */\nexport const decodeSchema = schema => Channel.pipeTo(decode(), ChannelSchema.decode(EventEncoded.pipe(Schema.decodeTo(schema)))());\n/**\n * Creates an SSE decoder channel that JSON-decodes each event `data` field with a schema.\n *\n * **Details**\n *\n * The output preserves the SSE `event` name and optional `id` while replacing\n * `data` with the decoded value.\n *\n * @category decoding\n * @since 4.0.0\n */\nexport const decodeDataSchema = schema => {\n const eventSchema = Schema.Struct({\n ...EventEncoded.fields,\n data: Schema.fromJsonString(schema)\n });\n return Channel.pipeTo(decode(), Channel.map(ChannelSchema.decode(eventSchema)(), Arr.map(event => ({\n ...event,\n id: event.id\n }))));\n};\n/**\n * Creates a stateful Server-Sent Events parser.\n *\n * **Details**\n *\n * Call `feed` with text chunks to parse `Event` and `Retry` values through the\n * callback, and call `reset` to clear any buffered event state.\n *\n * @category decoding\n * @since 4.0.0\n */\nexport function makeParser(onParse) {\n // Processing state\n let isFirstChunk;\n let buffer;\n let startingPosition;\n let startingFieldLength;\n // Event state\n let eventId;\n let lastEventId;\n let eventName;\n let data;\n reset();\n return {\n feed,\n reset\n };\n function reset() {\n isFirstChunk = true;\n buffer = \"\";\n startingPosition = 0;\n startingFieldLength = -1;\n eventId = undefined;\n eventName = undefined;\n data = \"\";\n }\n function feed(chunk) {\n buffer = buffer ? buffer + chunk : chunk;\n // Strip any UTF8 byte order mark (BOM) at the start of the stream.\n // Note that we do not strip any non - UTF8 BOM, as eventsource streams are\n // always decoded as UTF8 as per the specification.\n if (isFirstChunk && hasBom(buffer)) {\n buffer = buffer.slice(BOM.length);\n }\n isFirstChunk = false;\n // Set up chunk-specific processing state\n const length = buffer.length;\n let position = 0;\n let discardTrailingNewline = false;\n // Read the current buffer byte by byte\n while (position < length) {\n // EventSource allows for carriage return + line feed, which means we\n // need to ignore a linefeed character if the previous character was a\n // carriage return\n // @todo refactor to reduce nesting, consider checking previous byte?\n // @todo but consider multiple chunks etc\n if (discardTrailingNewline) {\n if (buffer[position] === \"\\n\") {\n ++position;\n }\n discardTrailingNewline = false;\n }\n let lineLength = -1;\n let fieldLength = startingFieldLength;\n let character;\n for (let index = startingPosition; lineLength < 0 && index < length; ++index) {\n character = buffer[index];\n if (character === \":\" && fieldLength < 0) {\n fieldLength = index - position;\n } else if (character === \"\\r\") {\n discardTrailingNewline = true;\n lineLength = index - position;\n } else if (character === \"\\n\") {\n lineLength = index - position;\n }\n }\n if (lineLength < 0) {\n startingPosition = length - position;\n startingFieldLength = fieldLength;\n break;\n } else {\n startingPosition = 0;\n startingFieldLength = -1;\n }\n parseEventStreamLine(buffer, position, fieldLength, lineLength);\n position += lineLength + 1;\n }\n if (position === length) {\n // If we consumed the entire buffer to read the event, reset the buffer\n buffer = \"\";\n } else if (position > 0) {\n // If there are bytes left to process, set the buffer to the unprocessed\n // portion of the buffer only\n buffer = buffer.slice(position);\n }\n }\n function parseEventStreamLine(lineBuffer, index, fieldLength, lineLength) {\n if (lineLength === 0) {\n // We reached the last line of this event\n if (data.length > 0) {\n onParse({\n _tag: \"Event\",\n id: eventId,\n event: eventName ?? \"message\",\n data: data.slice(0, -1) // remove trailing newline\n });\n data = \"\";\n eventId = undefined;\n }\n eventName = undefined;\n return;\n }\n const noValue = fieldLength < 0;\n const field = lineBuffer.slice(index, index + (noValue ? lineLength : fieldLength));\n let step = 0;\n if (noValue) {\n step = lineLength;\n } else if (lineBuffer[index + fieldLength + 1] === \" \") {\n step = fieldLength + 2;\n } else {\n step = fieldLength + 1;\n }\n const position = index + step;\n const valueLength = lineLength - step;\n const value = lineBuffer.slice(position, position + valueLength).toString();\n if (field === \"data\") {\n data += value ? `${value}\\n` : \"\\n\";\n } else if (field === \"event\") {\n eventName = value;\n } else if (field === \"id\" && !value.includes(\"\\u0000\")) {\n eventId = value;\n lastEventId = value;\n } else if (field === \"retry\") {\n const retry = parseInt(value, 10);\n if (!Number.isNaN(retry)) {\n onParse(new Retry({\n duration: Duration.millis(retry),\n lastEventId\n }));\n }\n }\n }\n}\nconst BOM = [239, 187, 191];\nfunction hasBom(buffer) {\n return BOM.every((charCode, index) => buffer.charCodeAt(index) === charCode);\n}\n/**\n * Creates a channel that encodes `Event` values as Server-Sent Events text.\n *\n * **Details**\n *\n * If the upstream channel fails with `Retry`, the retry directive is written and\n * the encoder completes.\n *\n * @category encoding\n * @since 4.0.0\n */\nexport const encode = () => Channel.fromTransform((upstream, _scope) => Effect.sync(() => {\n let done = false;\n const pull = upstream.pipe(Effect.map(Arr.map(encoder.write)), Effect.catchFilter(Retry.filter, retry => {\n done = true;\n return Effect.succeed(Arr.of(encoder.write(retry)));\n }), Pull.catchDone(() => Cause.done()));\n return Effect.suspend(() => done ? Cause.done() : pull);\n}));\n/**\n * Creates an SSE encoder channel for values accepted by a schema.\n *\n * **Details**\n *\n * Values are schema-encoded to the untagged SSE event shape, transformed to\n * `Event`, and then written as Server-Sent Events text.\n *\n * @category encoding\n * @since 4.0.0\n */\nexport const encodeSchema = schema => ChannelSchema.encode(Event.pipe(Schema.decodeTo(schema, transformEvent)))().pipe(Channel.pipeTo(encode()));\n/**\n * Schema for the untagged Server-Sent Events payload shape containing an optional `id`, `event`, and string `data` fields.\n *\n * @category models\n * @since 4.0.0\n */\nexport const EventEncoded = /*#__PURE__*/Schema.Struct({\n id: /*#__PURE__*/Schema.optional(Schema.String),\n event: Schema.String,\n data: Schema.String\n});\n/**\n * Schema for the tagged Server-Sent Events message model that adds `_tag: \"Event\"` to the event name, optional event ID, and string data payload.\n *\n * @category models\n * @since 4.0.0\n */\nexport const Event = /*#__PURE__*/Schema.Struct({\n _tag: /*#__PURE__*/Schema.tag(\"Event\"),\n id: /*#__PURE__*/Schema.UndefinedOr(Schema.String),\n event: Schema.String,\n data: Schema.String\n});\n/**\n * Schema for transforming untagged SSE event payloads into tagged `Event`\n * models.\n *\n * @category models\n * @since 4.0.0\n */\nexport const transformEvent = /*#__PURE__*/SchemaTransformation.transform({\n decode: event => event,\n encode: event => ({\n _tag: \"Event\",\n id: event.id,\n event: event.event ?? \"message\",\n data: event.data\n })\n});\nconst RetryTypeId = \"~effect/encoding/Sse/Retry\";\n/**\n * Represents a Server-Sent Events retry directive.\n *\n * **Details**\n *\n * Decoders surface this value as a failure to request reconnection after\n * `duration`; encoders serialize an upstream `Retry` failure as a `retry:` line.\n *\n * @category models\n * @since 4.0.0\n */\nexport class Retry extends /*#__PURE__*/Data.TaggedClass(\"Retry\") {\n /**\n * Marks this value as an SSE retry directive for runtime guards.\n *\n * @since 4.0.0\n */\n [RetryTypeId] = RetryTypeId;\n /**\n * Returns `true` when the value is an SSE retry directive.\n *\n * @since 4.0.0\n */\n static is(u) {\n return hasProperty(u, RetryTypeId);\n }\n /**\n * Separates SSE retry directives from regular event values.\n *\n * @since 4.0.0\n */\n static filter(u) {\n return Retry.is(u) ? Result.succeed(u) : Result.fail(u);\n }\n}\n/**\n * Default Server-Sent Events encoder.\n *\n * **Details**\n *\n * It renders `Event` values as `id`, `event`, and `data` lines and renders\n * `Retry` values as `retry:` directives.\n *\n * @category encoding\n * @since 4.0.0\n */\nexport const encoder = {\n write(event) {\n switch (event._tag) {\n case \"Event\":\n {\n let data = \"\";\n if (event.id !== undefined) {\n data += `id: ${event.id}\\n`;\n }\n if (event.event !== \"message\") {\n data += `event: ${event.event}\\n`;\n }\n if (event.data !== \"\") {\n data += `data: ${event.data.replace(/\\n/g, \"\\ndata: \")}\\n`;\n }\n return data + \"\\n\";\n }\n case \"Retry\":\n {\n return `retry: ${Duration.toMillis(event.duration)}\\n\\n`;\n }\n }\n }\n};\n//# sourceMappingURL=Sse.js.map","/**\n * Builds HTTP clients from `HttpApi` declarations.\n *\n * The client methods are derived from the groups and endpoints in an `HttpApi`\n * and run through an `HttpClient`. They use the same schema-driven contract as\n * the server: request parts are encoded from endpoint schemas, client\n * middleware is applied, the HTTP request is executed, and declared success or\n * error responses are decoded. This module also includes helpers for building a\n * client for only one group, one endpoint, or only the encoded URL.\n *\n * @since 4.0.0\n */\nimport * as Arr from \"../../Array.js\";\nimport * as Cause from \"../../Cause.js\";\nimport * as Effect from \"../../Effect.js\";\nimport { identity } from \"../../Function.js\";\nimport * as internalRecord from \"../../internal/record.js\";\nimport * as Option from \"../../Option.js\";\nimport * as Predicate from \"../../Predicate.js\";\nimport * as Schema from \"../../Schema.js\";\nimport * as SchemaAST from \"../../SchemaAST.js\";\nimport * as SchemaIssue from \"../../SchemaIssue.js\";\nimport * as SchemaTransformation from \"../../SchemaTransformation.js\";\nimport * as Stream from \"../../Stream.js\";\nimport * as UndefinedOr from \"../../UndefinedOr.js\";\nimport * as Sse from \"../encoding/Sse.js\";\nimport * as HttpBody from \"../http/HttpBody.js\";\nimport * as HttpClient from \"../http/HttpClient.js\";\nimport * as HttpClientError from \"../http/HttpClientError.js\";\nimport * as HttpClientRequest from \"../http/HttpClientRequest.js\";\nimport * as HttpClientResponse from \"../http/HttpClientResponse.js\";\nimport * as HttpMethod from \"../http/HttpMethod.js\";\nimport * as UrlParams from \"../http/UrlParams.js\";\nimport * as HttpApi from \"./HttpApi.js\";\nimport * as HttpApiEndpoint from \"./HttpApiEndpoint.js\";\nimport * as HttpApiSchema from \"./HttpApiSchema.js\";\nimport * as MediaType from \"./internal/mediaType.js\";\n/** @internal */\nexport const makeClient = (api, options) => Effect.gen(function* () {\n const services = yield* Effect.context();\n const httpClient = options.httpClient.pipe(options?.baseUrl === undefined ? identity : HttpClient.mapRequest(HttpClientRequest.prependUrl(options.baseUrl.toString())));\n function executeMiddleware(group, endpoint, request, middlewareKeys, index) {\n if (index === -1) {\n return httpClient.execute(request);\n }\n const middleware = services.mapUnsafe.get(middlewareKeys[index]);\n if (middleware === undefined) {\n return executeMiddleware(group, endpoint, request, middlewareKeys, index - 1);\n }\n return middleware({\n endpoint,\n group,\n request,\n next(request) {\n return executeMiddleware(group, endpoint, request, middlewareKeys, index - 1);\n }\n });\n }\n HttpApi.reflect(api, {\n predicate: options?.predicate,\n onGroup(onGroupOptions) {\n options.onGroup?.(onGroupOptions);\n },\n onEndpoint(onEndpointOptions) {\n const {\n group,\n endpoint,\n errors,\n successes\n } = onEndpointOptions;\n const makeUrl = compilePath(endpoint.path);\n const decodeMap = {\n orElse: statusOrElse\n };\n const decodeResponse = HttpClientResponse.matchStatus(decodeMap);\n const errorAlternatives = new Map();\n for (const [status, schemas] of errors.entries()) {\n const grouped = groupSchemasByContentType(schemas);\n for (const [contentType, schemas] of grouped.entries()) {\n addResponseAlternative(errorAlternatives, status, contentType, schemasToResponse(schemas));\n }\n }\n for (const [status, alternatives] of errorAlternatives.entries()) {\n const decode = makeResponseDecoder(alternatives);\n decodeMap[status] = response => Effect.flatMap(Effect.catchCause(decode(response), cause => Effect.failCause(Cause.combine(Cause.fail(new HttpClientError.HttpClientError({\n reason: new HttpClientError.StatusCodeError({\n request: response.request,\n response\n })\n })), cause))), Effect.fail);\n }\n const successAlternatives = new Map();\n for (const [status, schemas] of successes.entries()) {\n const grouped = groupSchemasByContentType(schemas);\n for (const [contentType, schemas] of grouped.entries()) {\n addResponseAlternative(successAlternatives, status, contentType, schemasToResponse(schemas));\n }\n }\n for (const streamSuccess of getStreamSuccessSchemas(endpoint)) {\n addResponseAlternative(successAlternatives, HttpApiSchema.getStatusStream(streamSuccess), streamSuccess.contentType, streamToResponse(streamSuccess));\n }\n for (const [status, alternatives] of successAlternatives.entries()) {\n decodeMap[status] = makeResponseDecoder(alternatives);\n }\n // encoders\n const encodeParams = UndefinedOr.map(endpoint.params, Schema.encodeUnknownEffect);\n const payloadSchemas = HttpApiEndpoint.getPayloadSchemas(endpoint);\n const encodePayload = Arr.isArrayNonEmpty(payloadSchemas) ? HttpMethod.hasBody(endpoint.method) ? Schema.encodeUnknownEffect(getEncodePayloadSchema(payloadSchemas, endpoint.method)) : Schema.encodeUnknownEffect(Schema.Union(payloadSchemas)) : undefined;\n const encodeHeaders = UndefinedOr.map(endpoint.headers, Schema.encodeUnknownEffect);\n const encodeQuery = UndefinedOr.map(endpoint.query, Schema.encodeUnknownEffect);\n const middlewareKeys = Array.from(onEndpointOptions.middleware, tag => `${tag.key}/Client`);\n const endpointFn = Effect.fnUntraced(function* (request) {\n let httpRequest = HttpClientRequest.make(endpoint.method)(endpoint.path);\n if (request !== undefined) {\n // params\n if (encodeParams !== undefined) {\n const params = yield* encodeParams(request.params);\n httpRequest = HttpClientRequest.setUrl(httpRequest, makeUrl(params));\n }\n // payload\n if (encodePayload !== undefined) {\n if (HttpMethod.hasBody(endpoint.method)) {\n if (request.payload instanceof FormData) {\n httpRequest = HttpClientRequest.bodyFormData(httpRequest, request.payload);\n } else {\n const body = yield* encodePayload(request.payload);\n httpRequest = HttpClientRequest.setBody(httpRequest, body);\n }\n } else {\n const urlParams = yield* encodePayload(request.payload);\n httpRequest = HttpClientRequest.appendUrlParams(httpRequest, urlParams);\n }\n }\n // headers\n if (encodeHeaders !== undefined) {\n const headers = yield* encodeHeaders(request.headers);\n httpRequest = HttpClientRequest.setHeaders(httpRequest, headers);\n }\n // query\n if (encodeQuery !== undefined) {\n const query = yield* encodeQuery(request.query);\n httpRequest = HttpClientRequest.appendUrlParams(httpRequest, query);\n }\n }\n const response = yield* executeMiddleware(group, endpoint, httpRequest, middlewareKeys, middlewareKeys.length - 1);\n if (request?.responseMode === \"response-only\") {\n return response;\n }\n const value = yield* options.transformResponse === undefined ? decodeResponse(response) : options.transformResponse(decodeResponse(response));\n return request?.responseMode === \"decoded-and-response\" ? [value, response] : value;\n });\n options.onEndpoint({\n ...onEndpointOptions,\n endpointFn\n });\n }\n });\n});\n/**\n * Constructs a type-safe client for an HTTP API using the `HttpClient` service,\n * endpoint schemas, middleware, and optional client or response transformations.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const make = (api, options) => Effect.flatMap(HttpClient.HttpClient, httpClient => makeWith(api, {\n ...options,\n httpClient: options?.transformClient ? options.transformClient(httpClient) : httpClient\n}));\n/**\n * Constructs a type-safe client for an HTTP API from the supplied `HttpClient`,\n * using the API metadata to encode requests, execute middleware, and decode\n * responses.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const makeWith = (api, options) => {\n const client = {};\n return makeClient(api, {\n ...options,\n onGroup({\n group\n }) {\n if (group.topLevel) return;\n internalRecord.set(client, group.identifier, {});\n },\n onEndpoint({\n endpoint,\n endpointFn,\n group\n }) {\n internalRecord.set(group.topLevel ? client : client[group.identifier], endpoint.identifier, endpointFn);\n }\n }).pipe(Effect.as(client));\n};\n/**\n * Builds a typed client object for a single API group from the supplied\n * `HttpClient`, filtering the API to that group.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const group = (api, options) => {\n const client = {};\n return makeClient(api, {\n ...options,\n predicate: ({\n group\n }) => group.identifier === options.group,\n onEndpoint({\n endpoint,\n endpointFn\n }) {\n internalRecord.set(client, endpoint.identifier, endpointFn);\n }\n }).pipe(Effect.map(() => client));\n};\n/**\n * Builds the typed client method for one endpoint in one API group, using the\n * supplied `HttpClient` and endpoint metadata.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const endpoint = (api, options) => {\n let client = undefined;\n return makeClient(api, {\n ...options,\n httpClient: options.transformClient ? options.transformClient(options.httpClient) : options.httpClient,\n predicate: ({\n endpoint,\n group\n }) => group.identifier === options.group && endpoint.identifier === options.endpoint,\n onEndpoint({\n endpointFn\n }) {\n client = endpointFn;\n }\n }).pipe(Effect.map(() => client));\n};\n/**\n * Creates a type-safe URL builder that mirrors `HttpApiClient.make`.\n *\n * **Example** (Building typed URLs)\n *\n * ```ts\n * import { Schema } from \"effect\"\n * import { HttpApi, HttpApiClient, HttpApiEndpoint, HttpApiGroup } from \"effect/unstable/httpapi\"\n *\n * const Api = HttpApi.make(\"Api\").add(\n * HttpApiGroup.make(\"users\").add(\n * HttpApiEndpoint.get(\"getUser\", \"/users/:id\", {\n * params: { id: Schema.String }\n * })\n * )\n * )\n *\n * const buildUrl = HttpApiClient.urlBuilder(Api, {\n * baseUrl: \"https://api.example.com\"\n * })\n *\n * buildUrl.users.getUser({\n * params: { id: \"123\" }\n * })\n * //=> \"https://api.example.com/users/123\"\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const urlBuilder = (api, options) => {\n const builder = {};\n HttpApi.reflect(api, {\n onGroup({\n group\n }) {\n if (group.topLevel) return;\n internalRecord.set(builder, group.identifier, {});\n },\n onEndpoint({\n group,\n endpoint\n }) {\n const makeUrl = compilePath(endpoint.path);\n const encodeParams = endpoint.params === undefined ? undefined : Schema.encodeSync(endpoint.params);\n const encodeQuery = endpoint.query === undefined ? undefined : Schema.encodeSync(endpoint.query);\n const endpointBuilder = request => {\n const params = request?.params;\n const path = params === undefined ? endpoint.path : makeUrl(encodeParams === undefined ? params : encodeParams(params));\n const queryInput = request?.query === undefined ? undefined : encodeQuery === undefined ? request.query : encodeQuery(request.query);\n const query = queryInput === undefined ? \"\" : UrlParams.toString(UrlParams.fromInput(queryInput));\n const url = query === \"\" ? path : `${path}?${query}`;\n return options?.baseUrl === undefined ? url : new URL(url, options.baseUrl.toString()).toString();\n };\n internalRecord.set(group.topLevel ? builder : builder[group.identifier], endpoint.identifier, endpointBuilder);\n }\n });\n return builder;\n};\n// ----------------------------------------------------------------------------\nconst paramsRegExp = /(\\/?):(\\w+)(\\?)?/g;\nconst compilePath = path => {\n if (!paramsRegExp.test(path)) {\n return _ => path;\n }\n paramsRegExp.lastIndex = 0;\n return params => {\n paramsRegExp.lastIndex = 0;\n return path.replace(paramsRegExp, (_, slash, key, optional) => {\n const value = params[key];\n if (value === undefined) {\n if (optional !== undefined) {\n return \"\";\n }\n throw new Error(`Missing path parameter: ${key}`);\n }\n return `${slash}${encodeURIComponent(value)}`;\n });\n };\n};\nfunction schemasToResponse(schemas) {\n const codec = toCodecArrayBuffer(schemas);\n const decode = Schema.decodeEffect(codec);\n return response => Effect.flatMap(response.arrayBuffer, decode);\n}\nfunction addResponseAlternative(map, status, contentType, decode) {\n const normalizedContentType = MediaType.normalize(contentType);\n const alternatives = map.get(status);\n if (alternatives === undefined) {\n map.set(status, [{\n contentType: normalizedContentType,\n decode\n }]);\n } else {\n alternatives.push({\n contentType: normalizedContentType,\n decode\n });\n }\n}\nfunction makeResponseDecoder(alternatives) {\n const first = alternatives[0];\n if (alternatives.length === 1 && first !== undefined) {\n return first.decode;\n }\n return response => {\n const contentType = MediaType.normalize(response.headers[\"content-type\"] ?? \"\");\n const alternative = alternatives.find(alternative => alternative.contentType === contentType);\n return alternative === undefined ? failUnsupportedContentType(response, contentType, alternatives) : alternative.decode(response);\n };\n}\nfunction groupSchemasByContentType(schemas) {\n const grouped = new Map();\n for (const schema of schemas) {\n const contentType = HttpApiSchema.isNoContent(schema.ast) ? \"\" : MediaType.normalize(HttpApiSchema.getResponseEncoding(schema.ast).contentType);\n const existing = grouped.get(contentType);\n if (existing === undefined) {\n grouped.set(contentType, [schema]);\n } else {\n existing.push(schema);\n }\n }\n return grouped;\n}\nfunction failUnsupportedContentType(response, contentType, alternatives) {\n const expected = Array.from(new Set(alternatives.map(alternative => alternative.contentType))).join(\", \");\n return Effect.fail(new HttpClientError.HttpClientError({\n reason: new HttpClientError.DecodeError({\n request: response.request,\n response,\n description: `Unsupported response content-type for status ${response.status}: ${contentType || \"<missing>\"}. Expected one of: ${expected}`\n })\n }));\n}\nconst reservedStreamFailureEvent = \"effect/httpapi/stream/failure\";\nfunction getStreamSuccessSchemas(endpoint) {\n const schemas = [];\n for (const schema of endpoint.success) {\n if (HttpApiSchema.isStreamSchema(schema)) {\n schemas.push(schema);\n }\n }\n return schemas;\n}\nfunction streamToResponse(streamSchema) {\n const sse = HttpApiSchema.isStreamUint8Array(streamSchema) ? undefined : {\n declaration: streamSchema,\n decoder: makeSseDecoder(streamSchema)\n };\n return response => Effect.map(Effect.context(), context => Stream.provideContext(sse === undefined ? response.stream : decodeSseStream(response.stream, sse.declaration, sse.decoder), context));\n}\nfunction makeSseDecoder(declaration) {\n const Event = Schema.Union([Schema.Struct({\n event: Schema.Literal(reservedStreamFailureEvent),\n data: Schema.fromJsonString(Schema.toCodecJson(Schema.Cause(declaration.error, Schema.Defect())))\n }), declaration.events]);\n return Sse.decodeSchema(Event);\n}\nfunction decodeSseStream(stream, declaration, decoder) {\n const events = Stream.transformPull(stream.pipe(Stream.decodeText, Stream.pipeThroughChannel(decoder)), pull => Effect.sync(() => {\n let pendingFailureCause = undefined;\n return Effect.suspend(() => {\n if (pendingFailureCause !== undefined) {\n return Effect.failCause(pendingFailureCause);\n }\n return Effect.flatMap(pull, events => {\n for (let i = 0; i < events.length; i++) {\n const event = events[i];\n if (event.event === reservedStreamFailureEvent && Cause.isCause(event.data)) {\n if (i === 0) {\n return Effect.failCause(event.data);\n }\n pendingFailureCause = event.data;\n events = events.slice(0, i);\n break;\n }\n }\n return Effect.succeed(events);\n });\n });\n }));\n if (declaration.sseMode === \"data\") {\n return Stream.map(events, event => event.data);\n }\n return events;\n}\nconst ArrayBuffer = /*#__PURE__*/Schema.instanceOf(globalThis.ArrayBuffer, {\n expected: \"ArrayBuffer\"\n});\n// _tag: Uint8Array\nconst Uint8ArrayFromArrayBuffer = /*#__PURE__*/ArrayBuffer.pipe(/*#__PURE__*/Schema.decodeTo(Schema.Uint8Array, /*#__PURE__*/SchemaTransformation.transform({\n decode(fromA) {\n return new Uint8Array(fromA);\n },\n encode(arr) {\n return arr.byteLength === arr.buffer.byteLength ? arr.buffer : arr.buffer.slice(arr.byteOffset, arr.byteOffset + arr.byteLength);\n }\n})));\n// _tag: Text\nconst StringFromArrayBuffer = /*#__PURE__*/ArrayBuffer.pipe(/*#__PURE__*/Schema.decodeTo(Schema.String, /*#__PURE__*/SchemaTransformation.transform({\n decode(fromA) {\n return new TextDecoder().decode(fromA);\n },\n encode(toI) {\n const arr = new TextEncoder().encode(toI);\n return arr.byteLength === arr.buffer.byteLength ? arr.buffer : arr.buffer.slice(arr.byteOffset, arr.byteOffset + arr.byteLength);\n }\n})));\n// _tag: Json\nconst UnknownFromArrayBuffer = /*#__PURE__*/StringFromArrayBuffer.pipe(/*#__PURE__*/Schema.decodeTo(/*#__PURE__*/Schema.Union([\n/*#__PURE__*/\n// Handle No Content\nSchema.Literal(\"\").pipe(/*#__PURE__*/Schema.decodeTo(Schema.Undefined, /*#__PURE__*/SchemaTransformation.transform({\n decode: () => undefined,\n encode: () => \"\"\n}))), Schema.UnknownFromJsonString])));\nfunction toCodecArrayBuffer(schemas) {\n return Schema.Union(schemas.map(onSchema));\n function onSchema(schema) {\n const encoding = HttpApiSchema.getResponseEncoding(schema.ast);\n switch (encoding._tag) {\n case \"Json\":\n {\n // handle json codecs that transform void schemas to null\n const encodedIsNull = SchemaAST.isNull(SchemaAST.toEncoded(schema.ast));\n return UnknownFromArrayBuffer.pipe(Schema.decodeTo(schema, encodedIsNull ? SchemaTransformation.transform({\n decode: a => a === undefined ? null : a,\n encode: a => a === null ? undefined : a\n }) : undefined));\n }\n case \"FormUrlEncoded\":\n return StringFromArrayBuffer.pipe(Schema.decodeTo(UrlParams.schemaRecord), Schema.decodeTo(schema));\n case \"Uint8Array\":\n return Uint8ArrayFromArrayBuffer.pipe(Schema.decodeTo(schema));\n case \"Text\":\n return StringFromArrayBuffer.pipe(Schema.decodeTo(schema));\n }\n }\n}\nconst statusOrElse = response => Effect.fail(new HttpClientError.HttpClientError({\n reason: new HttpClientError.DecodeError({\n request: response.request,\n response\n })\n}));\nconst $HttpBody = /*#__PURE__*/Schema.declare(HttpBody.isHttpBody);\nfunction getEncodePayloadSchema(schemas, method) {\n return Schema.Union(schemas.map(s => getEncodePayloadSchemaFromBody(s, method)));\n}\nconst bodyFromPayloadCache = /*#__PURE__*/new WeakMap();\nfunction getEncodePayloadSchemaFromBody(schema, method) {\n const ast = schema.ast;\n const cached = bodyFromPayloadCache.get(ast);\n if (cached !== undefined) {\n return cached;\n }\n const encoding = HttpApiSchema.getPayloadEncoding(ast, method);\n const out = $HttpBody.pipe(Schema.decodeTo(schema, SchemaTransformation.transformOrFail({\n decode(httpBody) {\n return Effect.fail(new SchemaIssue.Forbidden(Option.some(httpBody), {\n message: \"Encode only schema\"\n }));\n },\n encode(t) {\n switch (encoding._tag) {\n case \"Multipart\":\n return Effect.fail(new SchemaIssue.Forbidden(Option.some(t), {\n message: \"Payload must be a FormData\"\n }));\n case \"Json\":\n {\n try {\n const body = JSON.stringify(t);\n return Effect.succeed(HttpBody.text(body, encoding.contentType));\n } catch (error) {\n return Effect.fail(new SchemaIssue.InvalidValue(Option.some(t), {\n message: globalThis.String(error)\n }));\n }\n }\n case \"Text\":\n {\n if (typeof t !== \"string\") {\n return Effect.fail(new SchemaIssue.InvalidValue(Option.some(t), {\n message: \"Expected a string\"\n }));\n }\n return Effect.succeed(HttpBody.text(t, encoding.contentType));\n }\n case \"FormUrlEncoded\":\n {\n if (!Predicate.isObject(t)) {\n return Effect.fail(new SchemaIssue.InvalidValue(Option.some(t), {\n message: \"Expected a record\"\n }));\n }\n return Effect.succeed(HttpBody.urlParams(UrlParams.fromInput(t), encoding.contentType));\n }\n case \"Uint8Array\":\n {\n if (!(t instanceof Uint8Array)) {\n return Effect.fail(new SchemaIssue.InvalidValue(Option.some(t), {\n message: \"Expected a Uint8Array\"\n }));\n }\n return Effect.succeed(HttpBody.uint8Array(t, encoding.contentType));\n }\n }\n }\n })));\n bodyFromPayloadCache.set(ast, out);\n return out;\n}\n//# sourceMappingURL=HttpApiClient.js.map","/**\n * Fetch-based implementation of the Effect HTTP client service.\n *\n * This module provides an `HttpClient` layer that executes requests through a\n * Web Fetch API implementation. It is the transport to use in browsers, edge\n * runtimes, and Node.js environments where `globalThis.fetch` is available, or\n * anywhere a compatible fetch function can be supplied.\n *\n * @since 4.0.0\n */\nimport * as Context from \"../../Context.js\";\nimport * as Effect from \"../../Effect.js\";\nimport * as Stream from \"../../Stream.js\";\nimport * as Headers from \"./Headers.js\";\nimport * as HttpClient from \"./HttpClient.js\";\nimport * as HttpClientError from \"./HttpClientError.js\";\nimport * as HttpClientResponse from \"./HttpClientResponse.js\";\n/**\n * Context reference for the `fetch` implementation used by the fetch-based HTTP client.\n *\n * **Details**\n *\n * Defaults to `globalThis.fetch`.\n *\n * @category services\n * @since 4.0.0\n */\nexport const Fetch = /*#__PURE__*/Context.Reference(\"effect/http/FetchHttpClient/Fetch\", {\n defaultValue: () => globalThis.fetch\n});\n/**\n * Service that contains default fetch options for the fetch-based HTTP client.\n *\n * **When to use**\n *\n * Use to provide default credentials, cache, redirect, integrity, or other\n * fetch options for outgoing HTTP requests.\n *\n * **Details**\n *\n * Request-specific method, headers, body, and abort signal are supplied by the client when a request is executed.\n *\n * @category services\n * @since 4.0.0\n */\nexport class RequestInit extends /*#__PURE__*/Context.Service()(\"effect/http/FetchHttpClient/RequestInit\") {}\nconst fetch = /*#__PURE__*/HttpClient.make((request, url, signal, fiber) => {\n const fetch = fiber.getRef(Fetch);\n const options = fiber.context.mapUnsafe.get(RequestInit.key) ?? {};\n let headers = options.headers ? Headers.merge(Headers.fromInput(options.headers), request.headers) : request.headers;\n if (headers[\"content-length\"]) {\n headers = Headers.remove(headers, \"content-length\");\n }\n const send = body => Effect.map(Effect.tryPromise({\n try: () => fetch(url, {\n ...options,\n method: request.method,\n headers,\n body,\n duplex: request.body._tag === \"Stream\" ? \"half\" : undefined,\n signal\n }),\n catch: cause => new HttpClientError.HttpClientError({\n reason: new HttpClientError.TransportError({\n request,\n cause\n })\n })\n }), response => HttpClientResponse.fromWeb(request, response));\n switch (request.body._tag) {\n case \"Raw\":\n case \"Uint8Array\":\n return send(request.body.body);\n case \"FormData\":\n return send(request.body.formData);\n case \"Stream\":\n return Effect.flatMap(Stream.toReadableStreamEffect(request.body.stream), send);\n }\n return send(undefined);\n});\n/**\n * Layer that provides an `HttpClient` implementation backed by the configured\n * `Fetch` function.\n *\n * **When to use**\n *\n * Use when an Effect program should execute `HttpClient` requests through the\n * platform `fetch` implementation, especially in browser, edge, or Node.js\n * runtimes with `globalThis.fetch`.\n *\n * **Details**\n *\n * The layer uses the current `Fetch` reference and optional `RequestInit`\n * service for each request. Request-specific method, headers, body, and abort\n * signal are supplied by the client and override matching `RequestInit` fields.\n *\n * **Gotchas**\n *\n * Fetch behavior comes from the runtime's implementation, so CORS, cookies,\n * redirects, abort handling, and streaming support can vary by platform. Stream\n * request bodies are sent as Web streams with `duplex: \"half\"`, and any\n * `content-length` header is removed before calling `fetch`.\n *\n * @see {@link Fetch} for supplying the fetch implementation used by this layer\n * @see {@link RequestInit} for default `RequestInit` options applied before request-specific fields\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = /*#__PURE__*/HttpClient.layerMergedContext(/*#__PURE__*/Effect.succeed(fetch));\n//# sourceMappingURL=FetchHttpClient.js.map","import * as Effect from \"effect/Effect\"\nimport * as Schema from \"effect/Schema\"\nimport * as SchemaGetter from \"effect/SchemaGetter\"\n\nimport { SourceUrl } from \"../sourceRevision.js\"\nimport { UtcTimestamp } from \"../utcTimestamp.js\"\n\nconst SafeProviderIdentifier = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(512)\n)\nconst SafeProviderLabel = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(200)\n)\nconst SafeDiscoveryEndpointUrl = SourceUrl.pipe(\n Schema.check(\n Schema.makeFilter(\n ({ hash, search }) => hash.length === 0 && search.length === 0,\n { expected: \"a provider endpoint URL without query parameters or fragments\" }\n )\n )\n)\n\nconst ProviderContainer = Schema.Struct({\n providerImmutableId: SafeProviderIdentifier,\n displayName: SafeProviderLabel\n})\nconst NullableProviderContainer = Schema.NullOr(ProviderContainer)\n\n/** Secret-free provider endpoint advertised during connection discovery. */\nexport const PluginDiscoveryEndpointV1 = Schema.Struct({\n kind: Schema.Literals([\"api\", \"web\", \"graphql\", \"webhook\"]),\n url: SafeDiscoveryEndpointUrl,\n label: Schema.NullOr(SafeProviderLabel)\n})\n\n/** Decoded safe provider endpoint metadata. */\nexport type PluginDiscoveryEndpointV1 = typeof PluginDiscoveryEndpointV1.Type\n\n/**\n * Safe connection metadata discovered from the provider.\n * Credentials, raw headers, and provider response bodies are deliberately absent.\n */\nexport const PluginDiscoveryV1 = Schema.Struct({\n account: NullableProviderContainer,\n workspace: NullableProviderContainer,\n resource: Schema.optional(NullableProviderContainer).pipe(\n Schema.decodeTo(Schema.toType(NullableProviderContainer), {\n decode: SchemaGetter.withDefault(Effect.succeed<typeof NullableProviderContainer.Type>(null)),\n encode: SchemaGetter.required()\n })\n ),\n endpoints: Schema.Array(PluginDiscoveryEndpointV1).check(\n Schema.makeFilter(\n (endpoints) => endpoints.length <= 20,\n { expected: \"at most 20 safe provider endpoints\" }\n )\n ),\n discoveredAt: UtcTimestamp\n}).annotate({ identifier: \"PluginDiscoveryV1\" })\n\n/** Decoded secret-free connection discovery metadata. */\nexport type PluginDiscoveryV1 = typeof PluginDiscoveryV1.Type\n","import * as Encoding from \"effect/Encoding\"\nimport * as Result from \"effect/Result\"\nimport * as Schema from \"effect/Schema\"\n\nimport { Revision } from \"../sourceRevision.js\"\nimport { UtcTimestamp } from \"../utcTimestamp.js\"\nimport { PluginEntityReferenceV1 } from \"./events.js\"\n\nconst boundedOpaque = (name: string, maximum: number) =>\n Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(maximum)).pipe(Schema.brand(name))\n\nconst NonNegativeInteger = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))\nconst PositiveInteger = Schema.Int.check(Schema.isGreaterThan(0))\nconst MaximumArtifactRangeBytes = 1024 * 1024\nconst MaximumArtifactRangeBase64Characters = 4 * Math.ceil(MaximumArtifactRangeBytes / 3)\nconst MaximumLogPageBytes = 1024 * 1024\nconst utf8Encoder = new TextEncoder()\nconst Utf8BoundedLogMessage = Schema.String.check(\n Schema.makeFilter(\n (message) => utf8Encoder.encode(message).byteLength <= MaximumLogPageBytes,\n { expected: `at most ${MaximumLogPageBytes} UTF-8 log message bytes` }\n )\n)\n\n/** Exact provider action selected for a bounded pipeline evidence read. */\nexport const PluginPipelineActionReferenceV1 = Schema.Struct({\n entity: PluginEntityReferenceV1,\n executionId: boundedOpaque(\"PluginPipelineExecutionId\", 256),\n actionExecutionId: boundedOpaque(\"PluginPipelineActionExecutionId\", 256),\n expectedRevision: Revision\n})\n\n/** Decoded exact pipeline action identity. */\nexport type PluginPipelineActionReferenceV1 = typeof PluginPipelineActionReferenceV1.Type\n\n/** Bounded request for one page of pipeline action log events. */\nexport const PluginPipelineLogPageRequestV1 = Schema.Struct({\n action: PluginPipelineActionReferenceV1,\n cursor: Schema.NullOr(boundedOpaque(\"PluginPipelineLogCursor\", 4_096)),\n limit: PositiveInteger.check(Schema.isLessThanOrEqualTo(100))\n})\n\n/** One browser-safe provider log event. */\nexport const PluginPipelineLogEventV1 = Schema.Struct({\n timestamp: UtcTimestamp,\n ingestionTimestamp: Schema.NullOr(UtcTimestamp),\n message: Utf8BoundedLogMessage\n})\n\n/** Bounded pipeline action log page with an opaque continuation cursor. */\nexport const PluginPipelineLogPageV1 = Schema.Struct({\n events: Schema.Array(PluginPipelineLogEventV1).check(\n Schema.makeFilter((events) => events.length <= 100, { expected: \"at most 100 pipeline log events\" }),\n Schema.makeFilter(\n (events) =>\n events.reduce((total, event) => total + utf8Encoder.encode(event.message).byteLength, 0) <=\n MaximumLogPageBytes,\n { expected: `at most ${MaximumLogPageBytes} UTF-8 log message bytes` }\n )\n ),\n nextCursor: Schema.NullOr(boundedOpaque(\"PluginPipelineLogCursor\", 4_096))\n})\n\n/** Bounded request for one action artifact byte range. */\nexport const PluginPipelineArtifactRangeRequestV1 = Schema.Struct({\n action: PluginPipelineActionReferenceV1,\n direction: Schema.Literals([\"input\", \"output\"]),\n artifactName: boundedOpaque(\"PluginPipelineArtifactName\", 256),\n offset: NonNegativeInteger,\n length: PositiveInteger.check(Schema.isLessThanOrEqualTo(MaximumArtifactRangeBytes))\n})\n\n/** Browser-safe artifact bytes; provider storage coordinates are deliberately absent. */\nexport const PluginPipelineArtifactRangeV1 = Schema.Struct({\n bytesBase64: Schema.String.check(\n Schema.isMaxLength(MaximumArtifactRangeBase64Characters),\n Schema.isBase64(),\n Schema.makeFilter((value) => {\n const decoded = Encoding.decodeBase64(value)\n return Result.isSuccess(decoded) && decoded.success.byteLength <= MaximumArtifactRangeBytes\n }, { expected: `at most ${MaximumArtifactRangeBytes} base64-decoded bytes` })\n ),\n totalBytes: NonNegativeInteger,\n contentType: Schema.Literal(\"application/octet-stream\"),\n filename: Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(255),\n Schema.isPattern(/^[^\"\\\\/\\r\\n]+$/u, { expected: \"a safe attachment filename\" })\n )\n})\n\nexport type PluginPipelineLogPageRequestV1 = typeof PluginPipelineLogPageRequestV1.Type\nexport type PluginPipelineLogPageV1 = typeof PluginPipelineLogPageV1.Type\nexport type PluginPipelineArtifactRangeRequestV1 = typeof PluginPipelineArtifactRangeRequestV1.Type\nexport type PluginPipelineArtifactRangeV1 = typeof PluginPipelineArtifactRangeV1.Type\n","import * as Schema from \"effect/Schema\"\nimport { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from \"effect/unstable/httpapi\"\n\nimport { PluginConnectionId } from \"../domain/identifiers.js\"\nimport {\n PluginPipelineArtifactRangeRequestV1,\n PluginPipelineLogPageRequestV1,\n PluginPipelineLogPageV1\n} from \"../domain/plugins/index.js\"\nimport {\n ConflictApiError,\n ForbiddenApiError,\n NotFoundApiError,\n RateLimitedApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError,\n UnauthorizedApiError\n} from \"./errors.js\"\nimport { SessionCookieAuth } from \"./session.js\"\n\n/** Workspace-scoped request for one bounded CodePipeline action log page. */\nexport const CodePipelineLogReadRequest = Schema.Struct({\n pluginConnectionId: PluginConnectionId,\n request: PluginPipelineLogPageRequestV1\n})\n\n/** Workspace-scoped request for one bounded CodePipeline action artifact range. */\nexport const CodePipelineArtifactReadRequest = Schema.Struct({\n pluginConnectionId: PluginConnectionId,\n request: PluginPipelineArtifactRangeRequestV1\n})\n\nconst readErrors = [\n UnauthorizedApiError,\n ForbiddenApiError,\n NotFoundApiError,\n ConflictApiError,\n RateLimitedApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError\n]\n\nconst logs = HttpApiEndpoint.post(\"logs\", \"/logs\", {\n payload: CodePipelineLogReadRequest,\n success: PluginPipelineLogPageV1,\n error: readErrors\n}).middleware(SessionCookieAuth)\n\nconst artifactStream = HttpApiSchema.StreamUint8Array({ contentType: \"application/octet-stream\" })\nconst artifact = HttpApiEndpoint.post(\"artifact\", \"/artifact\", {\n payload: CodePipelineArtifactReadRequest,\n success: [\n artifactStream,\n artifactStream.pipe(HttpApiSchema.status(206)),\n artifactStream.pipe(HttpApiSchema.status(416))\n ],\n error: readErrors\n}).middleware(SessionCookieAuth)\n\n/** Authenticated workspace-scoped CodePipeline evidence proxy. */\nexport class CodePipelineApiGroup extends HttpApiGroup.make(\"codepipeline\")\n .add(logs)\n .add(artifact)\n .prefix(\"/api/v1/codepipeline\")\n{}\n","import * as Result from \"effect/Result\"\nimport * as Schema from \"effect/Schema\"\n\nimport { SourceUrl } from \"./sourceRevision.js\"\n\nconst boundedText = (maximum: number, identifier: string) =>\n Schema.String.check(Schema.isMaxLength(maximum)).annotate({ identifier })\n\nconst boundedNonEmptyText = (maximum: number, identifier: string) =>\n boundedText(maximum, identifier).check(Schema.isTrimmed(), Schema.isNonEmpty())\n\nconst boundedArray = <T, E, RD, RE>(schema: Schema.Codec<T, E, RD, RE>, maximum: number) =>\n Schema.Array(schema).check(Schema.isMaxLength(maximum))\n\nexport const MAXIMUM_NORMALIZED_ISSUE_LABELS = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_COMPONENTS = 100\n// One issue, its activity evidence, 200 people, and three events per fix version must fit one 500-event page.\nexport const MAXIMUM_NORMALIZED_ISSUE_FIX_VERSIONS = 99\nexport const MAXIMUM_NORMALIZED_ISSUE_SUBTASKS = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_COLLABORATORS = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_COMMENTS = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_HISTORY = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_HISTORY_CHANGES = 100\n\nconst SourceObjectId = boundedNonEmptyText(512, \"NormalizedIssueSourceObjectId\")\nconst SourcePersonId = boundedNonEmptyText(512, \"NormalizedIssueSourcePersonId\")\nconst ShortText = boundedText(255, \"NormalizedIssueShortText\")\nconst RichText = boundedText(16_000, \"NormalizedIssueRichText\")\nconst TimestampText = boundedNonEmptyText(100, \"NormalizedIssueTimestamp\")\nconst AvatarUrl = boundedNonEmptyText(2_048, \"NormalizedIssueAvatarUrl\").check(\n Schema.makeFilter((value) => Result.isSuccess(Schema.decodeUnknownResult(SourceUrl)(value)), {\n expected: \"an HTTP(S) source URL without embedded credentials\"\n })\n)\n\n/** Provider-neutral named source object retained with a bounded source identity. */\nexport const NormalizedIssueNamedValue = Schema.Struct({\n sourceId: Schema.NullOr(SourceObjectId),\n name: Schema.NullOr(ShortText)\n}).annotate({ identifier: \"NormalizedIssueNamedValue\" })\n\n/** Provider-neutral project identity and presentation retained from an issue source. */\nexport const NormalizedIssueProject = Schema.Struct({\n sourceId: Schema.NullOr(SourceObjectId),\n key: Schema.NullOr(boundedNonEmptyText(100, \"NormalizedIssueProjectKey\")),\n name: Schema.NullOr(ShortText)\n}).annotate({ identifier: \"NormalizedIssueProject\" })\n\n/** Provider-neutral release/version reference retained from an issue source. */\nexport const NormalizedIssueFixVersion = Schema.Struct({\n sourceId: Schema.NullOr(SourceObjectId),\n name: Schema.NullOr(ShortText),\n released: Schema.Boolean,\n releaseDate: Schema.NullOr(TimestampText)\n}).annotate({ identifier: \"NormalizedIssueFixVersion\" })\n\n/** Provider-neutral parent or subtask reference retained from an issue source. */\nexport const NormalizedRelatedIssue = Schema.Struct({\n sourceId: Schema.NullOr(SourceObjectId),\n key: Schema.NullOr(boundedNonEmptyText(100, \"NormalizedRelatedIssueKey\")),\n summary: Schema.NullOr(boundedText(500, \"NormalizedRelatedIssueSummary\")),\n status: Schema.NullOr(NormalizedIssueNamedValue)\n}).annotate({ identifier: \"NormalizedRelatedIssue\" })\n\n/** Bounded source collaborator used for attribution without provider response types. */\nexport const NormalizedIssueCollaborator = Schema.Struct({\n sourcePersonId: SourcePersonId,\n displayName: boundedNonEmptyText(200, \"NormalizedIssueCollaboratorDisplayName\"),\n avatarUrl: Schema.NullOr(AvatarUrl),\n active: Schema.Boolean,\n roles: boundedArray(boundedNonEmptyText(100, \"NormalizedIssueCollaboratorRole\"), 16).check(Schema.isUnique())\n}).annotate({ identifier: \"NormalizedIssueCollaborator\" })\n\n/** Bounded provider-neutral issue comment. */\nexport const NormalizedIssueComment = Schema.Struct({\n sourceId: SourceObjectId,\n authorSourcePersonId: Schema.NullOr(SourcePersonId),\n updateAuthorSourcePersonId: Schema.NullOr(SourcePersonId),\n body: Schema.NullOr(RichText),\n createdAt: Schema.NullOr(TimestampText),\n updatedAt: Schema.NullOr(TimestampText)\n}).annotate({ identifier: \"NormalizedIssueComment\" })\n\n/** One bounded provider-neutral field transition. */\nexport const NormalizedIssueHistoryChange = Schema.Struct({\n field: boundedNonEmptyText(255, \"NormalizedIssueHistoryField\"),\n from: Schema.NullOr(boundedText(1_000, \"NormalizedIssueHistoryValue\")),\n to: Schema.NullOr(boundedText(1_000, \"NormalizedIssueHistoryValue\"))\n}).annotate({ identifier: \"NormalizedIssueHistoryChange\" })\n\n/** Bounded provider-neutral issue history entry. */\nexport const NormalizedIssueHistoryEntry = Schema.Struct({\n sourceId: SourceObjectId,\n authorSourcePersonId: Schema.NullOr(SourcePersonId),\n createdAt: Schema.NullOr(TimestampText),\n changes: boundedArray(NormalizedIssueHistoryChange, MAXIMUM_NORMALIZED_ISSUE_HISTORY_CHANGES)\n}).annotate({ identifier: \"NormalizedIssueHistoryEntry\" })\n\n/** Fields whose source material may be deliberately reduced to remain within synchronization bounds. */\nexport const NormalizedIssueTruncatedField = Schema.Literals([\n \"acceptanceCriteria\",\n \"collaborators\",\n \"comments\",\n \"components\",\n \"description\",\n \"environment\",\n \"fixVersions\",\n \"history\",\n \"issueType\",\n \"key\",\n \"labels\",\n \"parent\",\n \"priority\",\n \"project\",\n \"resolution\",\n \"summary\",\n \"status\",\n \"subtasks\",\n \"updatedAt\",\n \"createdAt\",\n \"dueDate\",\n \"resolvedAt\"\n])\n\n/**\n * Shared provider-neutral issue detail accepted from normalized plugins.\n *\n * The original compact key/status/priority/estimate fields remain required.\n * Rich fields are optional so older normalized plugins and persisted projections\n * remain valid; first-party Jira synchronization always supplies every rich field.\n */\nexport const NormalizedIssueAttributes = Schema.Struct({\n key: boundedNonEmptyText(100, \"NormalizedIssueKey\"),\n status: boundedNonEmptyText(100, \"NormalizedIssueStatus\"),\n priority: Schema.NullOr(boundedNonEmptyText(100, \"NormalizedIssuePriority\")),\n estimatePoints: Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n summary: Schema.optionalKey(boundedText(500, \"NormalizedIssueSummary\")),\n description: Schema.optionalKey(Schema.NullOr(RichText)),\n acceptanceCriteria: Schema.optionalKey(Schema.NullOr(RichText)),\n environment: Schema.optionalKey(Schema.NullOr(RichText)),\n issueType: Schema.optionalKey(Schema.NullOr(NormalizedIssueNamedValue)),\n project: Schema.optionalKey(Schema.NullOr(NormalizedIssueProject)),\n resolution: Schema.optionalKey(Schema.NullOr(NormalizedIssueNamedValue)),\n labels: Schema.optionalKey(\n boundedArray(boundedNonEmptyText(255, \"NormalizedIssueLabel\"), MAXIMUM_NORMALIZED_ISSUE_LABELS)\n ),\n components: Schema.optionalKey(boundedArray(NormalizedIssueNamedValue, MAXIMUM_NORMALIZED_ISSUE_COMPONENTS)),\n fixVersions: Schema.optionalKey(boundedArray(NormalizedIssueFixVersion, MAXIMUM_NORMALIZED_ISSUE_FIX_VERSIONS)),\n createdAt: Schema.optionalKey(Schema.NullOr(TimestampText)),\n updatedAt: Schema.optionalKey(Schema.NullOr(TimestampText)),\n dueDate: Schema.optionalKey(Schema.NullOr(TimestampText)),\n resolvedAt: Schema.optionalKey(Schema.NullOr(TimestampText)),\n parent: Schema.optionalKey(Schema.NullOr(NormalizedRelatedIssue)),\n subtasks: Schema.optionalKey(boundedArray(NormalizedRelatedIssue, MAXIMUM_NORMALIZED_ISSUE_SUBTASKS)),\n assigneeSourcePersonId: Schema.optionalKey(Schema.NullOr(SourcePersonId)),\n reporterSourcePersonId: Schema.optionalKey(Schema.NullOr(SourcePersonId)),\n creatorSourcePersonId: Schema.optionalKey(Schema.NullOr(SourcePersonId)),\n collaborators: Schema.optionalKey(boundedArray(NormalizedIssueCollaborator, MAXIMUM_NORMALIZED_ISSUE_COLLABORATORS)),\n comments: Schema.optionalKey(boundedArray(NormalizedIssueComment, MAXIMUM_NORMALIZED_ISSUE_COMMENTS)),\n commentTotal: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n commentsTruncated: Schema.optionalKey(Schema.Boolean),\n commentBodiesTruncated: Schema.optionalKey(Schema.Boolean),\n history: Schema.optionalKey(boundedArray(NormalizedIssueHistoryEntry, MAXIMUM_NORMALIZED_ISSUE_HISTORY)),\n historyTotal: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n historyTruncated: Schema.optionalKey(Schema.Boolean),\n truncatedFields: Schema.optionalKey(boundedArray(NormalizedIssueTruncatedField, 32).check(Schema.isUnique()))\n}).annotate({ identifier: \"NormalizedIssueAttributes\" })\n\n/** Decoded provider-neutral normalized issue detail. */\nexport type NormalizedIssueAttributes = typeof NormalizedIssueAttributes.Type\n","import * as Schema from \"effect/Schema\"\n\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\nconst boundedText = (maximum: number, identifier: string) =>\n Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(maximum)).annotate({ identifier })\n\n/** Safely converted document content. Raw provider markup and media are never retained here. */\nexport const NormalizedPageContent = Schema.Struct({\n representation: Schema.Literal(\"safe-markdown\"),\n markdown: Schema.String.check(Schema.isMaxLength(262_144))\n})\n\n/** One immutable revision in the bounded page history. */\nexport const NormalizedPageVersion = Schema.Struct({\n number: Schema.Int.check(Schema.isGreaterThan(0)),\n createdAt: UtcTimestamp,\n message: Schema.NullOr(Schema.String.check(Schema.isMaxLength(2_000))),\n minorEdit: Schema.Boolean,\n authorSourcePersonId: Schema.NullOr(boundedText(512, \"PageVersionAuthorSourcePersonId\"))\n})\n\n/** One provider identity associated with a page and its document role. */\nexport const NormalizedPageContributor = Schema.Struct({\n sourcePersonId: boundedText(512, \"PageContributorSourcePersonId\"),\n displayName: boundedText(200, \"PageContributorDisplayName\"),\n active: Schema.Boolean,\n external: Schema.Boolean,\n resolved: Schema.Boolean,\n roles: Schema.Array(Schema.Literals([\"owner\", \"author\", \"contributor\", \"watcher\"])).check(\n Schema.isNonEmpty(),\n Schema.isUnique()\n )\n})\n\n/** Attachment metadata only. Bytes remain behind the authenticated provider boundary. */\nexport const NormalizedPageAttachment = Schema.Struct({\n id: boundedText(512, \"PageAttachmentId\"),\n title: boundedText(500, \"PageAttachmentTitle\"),\n createdAt: UtcTimestamp,\n mediaType: Schema.NullOr(Schema.String.check(Schema.isTrimmed(), Schema.isMaxLength(255))),\n fileSize: Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n version: Schema.NullOr(Schema.Int.check(Schema.isGreaterThan(0)))\n})\n\nconst BoundedInventory = Schema.Struct({\n complete: Schema.Boolean,\n pagesFetched: Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 5 }))\n})\n\n/** Optional rich document fields added to the provider-neutral page projection. */\nexport const NormalizedPageAttributes = Schema.Struct({\n sourceSpaceId: Schema.optionalKey(boundedText(512, \"PageSourceSpaceId\")),\n parentSourceId: Schema.optionalKey(Schema.NullOr(boundedText(512, \"PageParentSourceId\"))),\n createdAt: Schema.optionalKey(UtcTimestamp),\n updatedAt: Schema.optionalKey(UtcTimestamp),\n content: Schema.optionalKey(Schema.NullOr(NormalizedPageContent)),\n contentState: Schema.optionalKey(Schema.Literals([\"loaded\", \"lazy\"])),\n versions: Schema.optionalKey(Schema.Array(NormalizedPageVersion).check(Schema.isMaxLength(500))),\n versionHistory: Schema.optionalKey(BoundedInventory),\n contributors: Schema.optionalKey(Schema.Array(NormalizedPageContributor).check(Schema.isMaxLength(502))),\n attachments: Schema.optionalKey(Schema.Array(NormalizedPageAttachment).check(Schema.isMaxLength(50))),\n attachmentInventory: Schema.optionalKey(BoundedInventory),\n watcherInventory: Schema.optionalKey(BoundedInventory)\n})\n\n/** Decoded provider-neutral rich page fields. */\nexport type NormalizedPageAttributes = typeof NormalizedPageAttributes.Type\n","import * as DateTime from \"effect/DateTime\"\nimport * as Schema from \"effect/Schema\"\n\nimport { Freshness } from \"./freshness.js\"\nimport {\n AgentId,\n EntityId,\n EnvironmentId,\n EvidenceClaimId,\n EvidenceId,\n GraphNodeId,\n PersonId,\n PluginConnectionId,\n RelationshipId,\n ReleaseId,\n WorkspaceId\n} from \"./identifiers.js\"\nimport { NormalizedIssueAttributes } from \"./normalizedIssue.js\"\nimport { NormalizedPageAttributes } from \"./normalizedPage.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\nconst boundedText = (maximum: number, identifier: string) =>\n Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(maximum)\n ).annotate({ identifier })\n\n/** Provider-neutral kind of an object participating in delivery. */\nexport const DeliveryEntityKind = Schema.Literals([\n \"issue\",\n \"pull-request\",\n \"page\",\n \"pipeline-execution\",\n \"deployment\",\n \"time-entry\"\n])\n\n/** Decoded normalized entity kind. */\nexport type DeliveryEntityKind = typeof DeliveryEntityKind.Type\n\n/** Connected service responsible for a normalized delivery entity. */\nexport const DeliveryEntityService = Schema.Literals([\n \"jira\",\n \"codecommit\",\n \"confluence\",\n \"codepipeline\",\n \"clockify\"\n])\n\n/** Decoded connected delivery service. */\nexport type DeliveryEntityService = typeof DeliveryEntityService.Type\n\n/** Coarse cross-provider lifecycle used by workspace item search. */\nexport const DeliveryEntityStatusGroup = Schema.Literals([\"active\", \"done\", \"failed\"])\n\n/** Decoded cross-provider lifecycle group. */\nexport type DeliveryEntityStatusGroup = typeof DeliveryEntityStatusGroup.Type\n\n/** Canonical semantic kind recorded for either endpoint of a relationship. */\nexport const RelationshipEndpointKind = Schema.Union([\n DeliveryEntityKind,\n Schema.Literals([\"release\", \"environment\"])\n])\n\n/** Decoded semantic relationship endpoint kind. */\nexport type RelationshipEndpointKind = typeof RelationshipEndpointKind.Type\n\n/** Positive immutable revision of a normalized entity or relationship. */\nexport const LedgerRevision = Schema.Int.check(Schema.isGreaterThan(0)).pipe(\n Schema.brand(\"LedgerRevision\")\n)\n\n/** Decoded ledger revision. */\nexport type LedgerRevision = typeof LedgerRevision.Type\n\nconst IssueDetails = Schema.TaggedStruct(\"issue\", {\n ...NormalizedIssueAttributes.fields\n})\n\nconst PullRequestDetails = Schema.TaggedStruct(\"pull-request\", {\n repository: boundedText(200, \"RepositoryName\"),\n sourceBranch: boundedText(500, \"SourceBranch\"),\n targetBranch: boundedText(500, \"TargetBranch\"),\n headRevision: boundedText(512, \"HeadRevision\"),\n reviewState: Schema.Literals([\"not-requested\", \"requested\", \"changes-requested\", \"approved\", \"merged\"]),\n lifecycle: Schema.optionalKey(Schema.NullOr(Schema.Literals([\"open\", \"closed\", \"merged\"]))),\n description: Schema.optionalKey(Schema.NullOr(Schema.String.check(Schema.isMaxLength(50_000)))),\n authorReference: Schema.optionalKey(Schema.NullOr(boundedText(512, \"PullRequestAuthorReference\"))),\n baseRevision: Schema.optionalKey(Schema.NullOr(boundedText(512, \"BaseRevision\"))),\n mergeBaseRevision: Schema.optionalKey(Schema.NullOr(boundedText(512, \"MergeBaseRevision\"))),\n createdAt: Schema.optionalKey(Schema.NullOr(boundedText(64, \"PullRequestCreatedAt\"))),\n updatedAt: Schema.optionalKey(Schema.NullOr(boundedText(64, \"PullRequestUpdatedAt\")))\n})\n\nconst PageDetails = Schema.TaggedStruct(\"page\", {\n ...NormalizedPageAttributes.fields,\n spaceKey: boundedText(100, \"SpaceKey\"),\n revision: boundedText(512, \"PageRevision\"),\n status: Schema.Literals([\"draft\", \"current\", \"superseded\"]),\n linkedIssueKeys: Schema.optional(\n Schema.Array(boundedText(100, \"LinkedIssueKey\")).check(Schema.isUnique(), Schema.isMaxLength(100))\n ),\n linkedReleaseVersions: Schema.optional(\n Schema.Array(boundedText(100, \"LinkedReleaseVersion\")).check(Schema.isUnique(), Schema.isMaxLength(100))\n )\n})\n\nconst PipelineExecutionStatus = Schema.Literals([\"queued\", \"running\", \"succeeded\", \"failed\", \"stopped\"])\n\nconst PipelineSourceRevision = Schema.Struct({\n actionName: boundedText(200, \"PipelineSourceActionName\"),\n revisionId: Schema.NullOr(boundedText(512, \"PipelineSourceRevisionId\")),\n revisionSummary: Schema.NullOr(boundedText(500, \"PipelineSourceRevisionSummary\"))\n})\n\nconst PipelineStage = Schema.Struct({\n name: boundedText(200, \"PipelineStageName\"),\n status: PipelineExecutionStatus,\n actionCount: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n actionsTruncated: Schema.Boolean\n})\n\nconst PipelineActionArtifact = Schema.Struct({\n name: boundedText(200, \"PipelineActionArtifactName\"),\n direction: Schema.Literals([\"input\", \"output\"]),\n access: Schema.Literal(\"proxy-required\")\n})\n\nconst PipelineAction = Schema.Struct({\n actionExecutionId: boundedText(512, \"PipelineActionExecutionId\"),\n stageName: boundedText(200, \"PipelineActionStageName\"),\n actionName: boundedText(200, \"PipelineActionName\"),\n status: PipelineExecutionStatus,\n startedAt: Schema.NullOr(UtcTimestamp),\n updatedAt: Schema.NullOr(UtcTimestamp),\n updatedBy: Schema.NullOr(boundedText(512, \"PipelineActionActor\")),\n category: Schema.NullOr(boundedText(100, \"PipelineActionCategory\")),\n provider: Schema.NullOr(boundedText(100, \"PipelineActionProvider\")),\n owner: Schema.NullOr(boundedText(100, \"PipelineActionOwner\")),\n version: Schema.NullOr(boundedText(100, \"PipelineActionVersion\")),\n region: Schema.NullOr(boundedText(100, \"PipelineActionRegion\")),\n externalExecutionSummary: Schema.NullOr(boundedText(500, \"PipelineExternalExecutionSummary\")),\n errorCode: Schema.NullOr(boundedText(200, \"PipelineActionErrorCode\")),\n errorMessage: Schema.NullOr(boundedText(500, \"PipelineActionErrorMessage\")),\n artifacts: Schema.Array(PipelineActionArtifact).check(Schema.isMaxLength(100))\n})\n\nconst PipelineSourceArtifact = Schema.Struct({\n name: boundedText(200, \"PipelineSourceArtifactName\"),\n revisionId: Schema.NullOr(boundedText(512, \"PipelineSourceArtifactRevisionId\")),\n revisionSummary: Schema.NullOr(boundedText(500, \"PipelineSourceArtifactRevisionSummary\")),\n createdAt: Schema.NullOr(UtcTimestamp),\n access: Schema.Literal(\"proxy-required\")\n})\n\nconst PipelineDetails = Schema.TaggedStruct(\"pipeline-execution\", {\n pipelineName: boundedText(200, \"PipelineName\"),\n executionId: boundedText(512, \"PipelineExecutionId\"),\n status: PipelineExecutionStatus,\n triggerRevision: boundedText(512, \"PipelineTriggerRevision\"),\n pipelineVersion: Schema.optionalKey(Schema.NullOr(Schema.Int.check(Schema.isGreaterThan(0)))),\n statusSummary: Schema.optionalKey(Schema.NullOr(boundedText(500, \"PipelineStatusSummary\"))),\n startedAt: Schema.optionalKey(Schema.NullOr(UtcTimestamp)),\n updatedAt: Schema.optionalKey(Schema.NullOr(UtcTimestamp)),\n triggerType: Schema.optionalKey(Schema.NullOr(boundedText(100, \"PipelineTriggerType\"))),\n triggerDetail: Schema.optionalKey(Schema.NullOr(boundedText(500, \"PipelineTriggerDetail\"))),\n executionMode: Schema.optionalKey(Schema.NullOr(boundedText(100, \"PipelineExecutionMode\"))),\n executionType: Schema.optionalKey(Schema.NullOr(boundedText(100, \"PipelineExecutionType\"))),\n rollbackTargetExecutionId: Schema.optionalKey(\n Schema.NullOr(boundedText(512, \"PipelineRollbackTargetExecutionId\"))\n ),\n sourceRevisions: Schema.optionalKey(\n Schema.Array(PipelineSourceRevision).check(\n Schema.makeFilter(\n (revisions) => new Set(revisions.map((revision) => revision.actionName)).size === revisions.length,\n { expected: \"unique pipeline source action names\" }\n ),\n Schema.isMaxLength(100)\n )\n ),\n stages: Schema.optionalKey(\n Schema.Array(PipelineStage).check(\n Schema.makeFilter(\n (stages) => new Set(stages.map((stage) => stage.name)).size === stages.length,\n { expected: \"unique pipeline stage names\" }\n ),\n Schema.isMaxLength(100)\n )\n ),\n actions: Schema.optionalKey(\n Schema.Array(PipelineAction).check(\n Schema.makeFilter(\n (actions) => new Set(actions.map((action) => action.actionExecutionId)).size === actions.length,\n { expected: \"unique pipeline action execution identifiers\" }\n ),\n Schema.isMaxLength(200)\n )\n ),\n actionCount: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n actionsTruncated: Schema.optionalKey(Schema.Boolean),\n actionPagesRead: Schema.optionalKey(Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 5 }))),\n sourceArtifacts: Schema.optionalKey(\n Schema.Array(PipelineSourceArtifact).check(Schema.isMaxLength(100))\n )\n})\n\nconst DeploymentDetails = Schema.TaggedStruct(\"deployment\", {\n environmentId: EnvironmentId,\n revision: boundedText(512, \"DeploymentRevision\"),\n status: Schema.Literals([\"pending\", \"deploying\", \"succeeded\", \"failed\", \"rolled-back\"])\n})\n\nconst TimeEntryDetails = Schema.TaggedStruct(\"time-entry\", {\n durationMinutes: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n billable: Schema.Boolean,\n approvalState: Schema.Literals([\"pending\", \"approved\", \"rejected\", \"not-required\"]),\n locked: Schema.optionalKey(Schema.Boolean),\n description: Schema.optionalKey(Schema.NullOr(boundedText(4_000, \"ClockifyTimeEntryDescription\"))),\n projectId: Schema.optionalKey(Schema.NullOr(boundedText(512, \"ClockifyProjectId\"))),\n userId: Schema.optionalKey(boundedText(512, \"ClockifyUserId\")),\n startedAt: Schema.optionalKey(UtcTimestamp),\n endedAt: Schema.optionalKey(Schema.NullOr(UtcTimestamp))\n})\n\n/** Provider-neutral entity extension decoded before graph persistence. */\nexport const DeliveryEntityDetails = Schema.Union([\n IssueDetails,\n PullRequestDetails,\n PageDetails,\n PipelineDetails,\n DeploymentDetails,\n TimeEntryDetails\n]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded provider-neutral entity details. */\nexport type DeliveryEntityDetails = typeof DeliveryEntityDetails.Type\n\n/** Immutable normalized projection for one exact entity source revision. */\nexport const DeliveryEntityProjection = Schema.Struct({\n workspaceId: WorkspaceId,\n entityId: EntityId,\n projectionRevision: LedgerRevision,\n sourceEntityRevision: LedgerRevision,\n supersedesProjectionRevision: Schema.NullOr(LedgerRevision),\n projectionSchemaVersion: Schema.Int.check(Schema.isGreaterThan(0)),\n entityState: Schema.Literals([\"present\", \"deleted\"]),\n entityType: DeliveryEntityKind,\n displayKey: boundedText(200, \"EntityDisplayKey\"),\n title: boundedText(500, \"EntityTitle\"),\n details: DeliveryEntityDetails\n}).check(\n Schema.makeFilter(\n ({ details, entityType }) => details._tag === entityType,\n { expected: \"entity details whose tag matches the entity kind\" }\n ),\n Schema.makeFilter(\n ({ projectionRevision, supersedesProjectionRevision }) =>\n projectionRevision === 1\n ? supersedesProjectionRevision === null\n : supersedesProjectionRevision === projectionRevision - 1,\n { expected: \"entity projection to supersede its exact preceding revision\" }\n )\n)\n\n/** Decoded normalized entity projection. */\nexport type DeliveryEntityProjection = typeof DeliveryEntityProjection.Type\n\n/** Resolved graph target with an exact canonical object identity. */\nexport const ResolvedDeliveryNode = Schema.TaggedUnion({\n entity: { entityId: EntityId, entityKind: DeliveryEntityKind },\n environment: { environmentId: EnvironmentId, releaseId: ReleaseId },\n release: { releaseId: ReleaseId }\n})\n\n/** Resolved or intentionally missing node stored as trusted graph state. */\nexport const DeliveryNode = Schema.Struct({\n workspaceId: WorkspaceId,\n nodeId: GraphNodeId,\n endpointKind: RelationshipEndpointKind,\n resolution: Schema.TaggedUnion({\n resolved: { target: ResolvedDeliveryNode },\n missing: {\n expectedKind: Schema.Literals([\"entity\", \"release\", \"environment\"]),\n expectedEntityKind: Schema.NullOr(DeliveryEntityKind),\n missingKey: boundedText(512, \"MissingDeliveryNodeKey\")\n }\n }),\n createdAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ resolution }) =>\n resolution._tag !== \"missing\" ||\n (resolution.expectedKind === \"entity\") === (resolution.expectedEntityKind !== null),\n { expected: \"only missing entity nodes to carry an expected entity kind\" }\n ),\n Schema.makeFilter(\n ({ endpointKind, resolution }) => {\n if (resolution._tag === \"missing\") {\n return resolution.expectedKind === \"entity\"\n ? endpointKind === resolution.expectedEntityKind\n : endpointKind === resolution.expectedKind\n }\n\n return resolution.target._tag === \"entity\"\n ? endpointKind === resolution.target.entityKind\n : endpointKind === resolution.target._tag\n },\n { expected: \"graph node endpoint kind to match its resolved or expected target kind\" }\n )\n)\n\n/** Decoded graph node. */\nexport type DeliveryNode = typeof DeliveryNode.Type\n\n/** Semantic relationship between delivery nodes. Direction is significant. */\nexport const RelationshipKind = Schema.Literals([\n \"contains\",\n \"implements\",\n \"depends-on\",\n \"verified-by\",\n \"delivered-by\",\n \"documented-by\",\n \"tracks-time-for\"\n])\n\n/** Decoded relationship kind. */\nexport type RelationshipKind = typeof RelationshipKind.Type\n\nconst ALL_RELATIONSHIP_ENDPOINT_KINDS: ReadonlyArray<RelationshipEndpointKind> = [\n \"issue\",\n \"pull-request\",\n \"page\",\n \"pipeline-execution\",\n \"deployment\",\n \"time-entry\",\n \"release\",\n \"environment\"\n]\n\nconst ALL_ENTITY_ENDPOINT_KINDS: ReadonlyArray<RelationshipEndpointKind> = [\n \"issue\",\n \"pull-request\",\n \"page\",\n \"pipeline-execution\",\n \"deployment\",\n \"time-entry\"\n]\n\ntype RelationshipEndpointRule = Readonly<{\n source: ReadonlyArray<RelationshipEndpointKind>\n target: ReadonlyArray<RelationshipEndpointKind>\n}>\n\n/**\n * Version-one canonical direction matrix. Passive relationship names read from\n * source to target: for example, a pull request is `delivered-by` a pipeline\n * execution. `depends-on` is intentionally the one generic graph edge.\n */\nexport const RELATIONSHIP_ENDPOINT_MATRIX_V1: Readonly<\n Record<RelationshipKind, RelationshipEndpointRule>\n> = {\n \"contains\": { source: [\"release\"], target: ALL_ENTITY_ENDPOINT_KINDS },\n \"implements\": { source: [\"pull-request\"], target: [\"issue\"] },\n \"depends-on\": {\n source: ALL_RELATIONSHIP_ENDPOINT_KINDS,\n target: ALL_RELATIONSHIP_ENDPOINT_KINDS\n },\n \"verified-by\": { source: [\"pull-request\"], target: [\"pipeline-execution\"] },\n \"delivered-by\": { source: [\"pull-request\"], target: [\"pipeline-execution\"] },\n \"documented-by\": { source: [\"issue\", \"release\"], target: [\"page\"] },\n \"tracks-time-for\": { source: [\"time-entry\"], target: [\"issue\"] }\n}\n\nconst relationshipEndpointIsAllowed = (\n kind: RelationshipKind,\n sourceNodeKind: RelationshipEndpointKind,\n targetNodeKind: RelationshipEndpointKind\n): boolean => {\n const rule: RelationshipEndpointRule = RELATIONSHIP_ENDPOINT_MATRIX_V1[kind]\n return rule.source.some((candidate) => candidate === sourceNodeKind) &&\n rule.target.some((candidate) => candidate === targetNodeKind)\n}\n\n/** Explainable confidence; inferred links can never masquerade as confirmed. */\nexport const RelationshipConfidence = Schema.TaggedUnion({\n unknown: { rationale: boundedText(1_000, \"UnknownRelationshipConfidenceRationale\") },\n confirmed: {},\n inferred: {\n score: Schema.Number.check(Schema.isBetween({ minimum: 0, maximum: 1 })),\n rationale: boundedText(1_000, \"RelationshipConfidenceRationale\")\n }\n})\n\n/** Decoded relationship confidence. */\nexport type RelationshipConfidence = typeof RelationshipConfidence.Type\n\n/** Attribution for creation of a relationship revision. */\nexport const RelationshipProvenance = Schema.TaggedUnion({\n plugin: {\n pluginConnectionId: PluginConnectionId,\n sourceEntityId: EntityId,\n sourceEntityRevision: LedgerRevision\n },\n human: { personId: PersonId, rationale: boundedText(1_000, \"HumanRelationshipRationale\") },\n agent: { agentId: AgentId, rationale: boundedText(1_000, \"AgentRelationshipRationale\") },\n rule: {\n ruleId: boundedText(200, \"RelationshipRuleId\"),\n ruleVersion: Schema.Int.check(Schema.isGreaterThan(0)),\n rationale: boundedText(1_000, \"RuleRelationshipRationale\")\n }\n})\n\n/** Decoded relationship provenance. */\nexport type RelationshipProvenance = typeof RelationshipProvenance.Type\n\n/** Lifecycle of one relationship revision. Prior revisions remain immutable. */\nexport const RelationshipLifecycle = Schema.TaggedUnion({\n missing: { effectiveAt: UtcTimestamp, reason: boundedText(1_000, \"MissingRelationshipReason\") },\n inferred: { effectiveAt: UtcTimestamp },\n proposed: { effectiveAt: UtcTimestamp },\n verified: { effectiveAt: UtcTimestamp },\n governed: { effectiveAt: UtcTimestamp },\n rejected: { effectiveAt: UtcTimestamp, reason: boundedText(1_000, \"RejectionReason\") },\n superseded: { effectiveAt: UtcTimestamp, reason: boundedText(1_000, \"SupersessionReason\") }\n})\n\n/** Decoded relationship lifecycle. */\nexport type RelationshipLifecycle = typeof RelationshipLifecycle.Type\n\n/** Exact release or environment slice in which a relationship is evaluated. */\nexport const RelationshipScope = Schema.NullOr(\n Schema.TaggedUnion({\n release: { releaseId: ReleaseId },\n environment: { releaseId: ReleaseId, environmentId: EnvironmentId }\n })\n)\n\n/** Human, agent, or system that appended an immutable ledger revision. */\nexport const LedgerActor = Schema.TaggedUnion({\n human: { personId: PersonId },\n agent: { agentId: AgentId },\n system: { component: boundedText(200, \"LedgerSystemComponent\") }\n})\n\n/** Immutable relationship ledger revision. */\nexport const DeliveryRelationship = Schema.Struct({\n workspaceId: WorkspaceId,\n relationshipId: RelationshipId,\n relationshipSchemaVersion: Schema.Literal(1),\n revision: LedgerRevision,\n supersedesRevision: Schema.NullOr(LedgerRevision),\n kind: RelationshipKind,\n sourceNodeId: GraphNodeId,\n sourceNodeKind: RelationshipEndpointKind,\n targetNodeId: GraphNodeId,\n targetNodeKind: RelationshipEndpointKind,\n scope: RelationshipScope,\n lifecycle: RelationshipLifecycle,\n confidence: RelationshipConfidence,\n provenance: RelationshipProvenance,\n recordedBy: LedgerActor,\n evidenceClaimIds: Schema.Array(EvidenceClaimId).check(Schema.isMaxLength(128)),\n recordedAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ evidenceClaimIds }) => new Set(evidenceClaimIds).size === evidenceClaimIds.length,\n { expected: \"relationship evidence references to be unique\" }\n ),\n Schema.makeFilter(\n ({ confidence, evidenceClaimIds }) => confidence._tag !== \"confirmed\" || evidenceClaimIds.length > 0,\n { expected: \"confirmed relationship confidence to reference immutable evidence\" }\n ),\n Schema.makeFilter(\n ({ sourceNodeId, targetNodeId }) => sourceNodeId !== targetNodeId,\n { expected: \"relationship source and target to differ\" }\n ),\n Schema.makeFilter(\n ({ kind, sourceNodeKind, targetNodeKind }) => relationshipEndpointIsAllowed(kind, sourceNodeKind, targetNodeKind),\n { expected: \"relationship endpoints to follow the canonical version-one direction matrix\" }\n ),\n Schema.makeFilter(\n ({ kind, scope }) => kind !== \"contains\" || scope !== null,\n { expected: \"release containment to carry an explicit release or environment scope\" }\n ),\n Schema.makeFilter(\n ({ confidence, lifecycle }) => lifecycle._tag !== \"inferred\" || confidence._tag !== \"confirmed\",\n { expected: \"an inferred relationship lifecycle not to claim confirmed confidence\" }\n ),\n Schema.makeFilter(\n ({ revision, supersedesRevision }) =>\n revision === 1 ? supersedesRevision === null : supersedesRevision === revision - 1,\n { expected: \"relationship to supersede its exact preceding revision\" }\n )\n)\n\n/** Decoded relationship ledger revision. */\nexport type DeliveryRelationship = typeof DeliveryRelationship.Type\n\n/** Closed assertion vocabulary used by immutable evidence claims. */\nexport const EvidencePredicate = Schema.Literals([\n \"relationship-observed\",\n \"status-observed\",\n \"approval-recorded\",\n \"check-observed\",\n \"execution-observed\",\n \"deployment-observed\",\n \"documentation-observed\",\n \"time-observed\"\n])\n\n/** Decoded evidence predicate. */\nexport type EvidencePredicate = typeof EvidencePredicate.Type\n\n/** Bounded, provider-neutral evidence value. */\nexport const EvidenceValue = Schema.TaggedUnion({\n flag: { value: Schema.Boolean },\n state: { value: boundedText(500, \"EvidenceState\") },\n revision: { value: boundedText(512, \"EvidenceRevision\") },\n reference: { targetNodeId: GraphNodeId }\n})\n\n/** Decoded evidence value. */\nexport type EvidenceValue = typeof EvidenceValue.Type\n\n/** Exact actor or source revision responsible for an evidence claim. */\nexport const EvidenceAttribution = Schema.TaggedUnion({\n plugin: {\n pluginConnectionId: PluginConnectionId,\n sourceEntityId: EntityId,\n sourceEntityRevision: LedgerRevision\n },\n human: { personId: PersonId },\n agent: { agentId: AgentId },\n system: { component: boundedText(200, \"EvidenceSystemComponent\") }\n})\n\n/** Decoded evidence attribution. */\nexport type EvidenceAttribution = typeof EvidenceAttribution.Type\n\n/** Explicit retention policy attached when evidence is recorded. */\nexport const EvidenceRetention = Schema.Struct({\n classification: Schema.Literals([\"audit\", \"evidence\", \"normalized-cache\"]),\n retainUntil: Schema.NullOr(UtcTimestamp),\n legalHold: Schema.Boolean\n})\n\n/** Decoded evidence retention metadata. */\nexport type EvidenceRetention = typeof EvidenceRetention.Type\n\n/** Independent verification of an evidence observation. */\nexport const EvidenceVerifier = Schema.TaggedUnion({\n human: { personId: PersonId },\n agent: { agentId: AgentId },\n system: { component: boundedText(200, \"EvidenceVerifierComponent\") }\n})\n\n/** Immutable observation envelope with provenance, validity, and retention. */\nexport const EvidenceItem = Schema.Struct({\n workspaceId: WorkspaceId,\n evidenceId: EvidenceId,\n schemaVersion: Schema.Int.check(Schema.isGreaterThan(0)),\n attribution: EvidenceAttribution,\n verifier: EvidenceVerifier,\n observedAt: UtcTimestamp,\n recordedAt: UtcTimestamp,\n validUntil: Schema.NullOr(UtcTimestamp),\n freshness: Freshness,\n retention: EvidenceRetention\n}).check(\n Schema.makeFilter(\n ({ attribution, freshness }) => {\n if (attribution._tag !== \"plugin\") return true\n\n return freshness.provenance._tag !== \"none\" &&\n attribution.pluginConnectionId === freshness.provenance.sourceRevision.pluginConnectionId\n },\n { expected: \"plugin evidence attribution to carry its exact freshness source revision\" }\n ),\n Schema.makeFilter(\n ({ observedAt, recordedAt }) => DateTime.Order(observedAt, recordedAt) <= 0,\n { expected: \"evidence observation time not to follow recording time\" }\n ),\n Schema.makeFilter(\n ({ observedAt, validUntil }) => validUntil === null || DateTime.Order(observedAt, validUntil) < 0,\n { expected: \"evidence validity to end after observation\" }\n ),\n Schema.makeFilter(\n ({ recordedAt, retention }) =>\n retention.retainUntil === null || DateTime.Order(recordedAt, retention.retainUntil) <= 0,\n { expected: \"evidence retention not to end before recording\" }\n )\n)\n\n/** Decoded immutable evidence observation. */\nexport type EvidenceItem = typeof EvidenceItem.Type\n\n/** One immutable normalized claim derived from an evidence observation. */\nexport const EvidenceClaim = Schema.Struct({\n workspaceId: WorkspaceId,\n evidenceClaimId: EvidenceClaimId,\n evidenceId: EvidenceId,\n subjectNodeId: GraphNodeId,\n predicate: EvidencePredicate,\n value: EvidenceValue,\n recordedAt: UtcTimestamp,\n supersedesEvidenceClaimId: Schema.NullOr(EvidenceClaimId)\n}).check(\n Schema.makeFilter(\n ({ evidenceClaimId, supersedesEvidenceClaimId }) => evidenceClaimId !== supersedesEvidenceClaimId,\n { expected: \"evidence not to supersede itself\" }\n )\n)\n\n/** Decoded immutable evidence claim. */\nexport type EvidenceClaim = typeof EvidenceClaim.Type\n\n/** Independent source availability and validity dimensions for an evidence item. */\nexport type EvidenceFreshnessAssessment = Readonly<{\n source: \"current\" | \"stale\" | \"missing\" | \"unavailable\"\n validity: \"valid\" | \"expired\"\n}>\n\nconst sourceFreshnessAt = (\n freshness: Freshness,\n at: DateTime.DateTime\n): EvidenceFreshnessAssessment[\"source\"] => {\n if (freshness._tag !== \"current\") return freshness._tag\n\n const ageMilliseconds = DateTime.toEpochMillis(at) - DateTime.toEpochMillis(freshness.sourceObservedAt)\n return ageMilliseconds < freshness.staleAfterSeconds * 1_000 ? \"current\" : \"stale\"\n}\n\n/** Determine source freshness and evidence validity at an injected instant. */\nexport const evidenceFreshnessAt = (\n evidence: EvidenceItem,\n at: DateTime.DateTime\n): EvidenceFreshnessAssessment => ({\n source: sourceFreshnessAt(evidence.freshness, at),\n validity: evidence.validUntil === null || DateTime.Order(at, evidence.validUntil) < 0\n ? \"valid\"\n : \"expired\"\n})\n\n/** Determine whether retained evidence bytes are eligible for governed cleanup. */\nexport const evidenceRetentionEligibilityAt = (\n evidence: EvidenceItem,\n at: DateTime.DateTime\n): \"retain\" | \"eligible\" =>\n !evidence.retention.legalHold &&\n evidence.retention.retainUntil !== null &&\n DateTime.Order(evidence.retention.retainUntil, at) <= 0\n ? \"eligible\"\n : \"retain\"\n","import * as Schema from \"effect/Schema\"\n\nimport {\n DomainEventId,\n EntityId,\n EventCursor,\n JobId,\n PluginConnectionId,\n ReleaseId,\n WorkspaceId\n} from \"./identifiers.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\nconst jsonEncoder = new TextEncoder()\nconst hasMaximumJsonBytes = (maximumBytes: number) =>\n Schema.makeFilter(\n (value: unknown) => {\n const serialized = JSON.stringify(value)\n return serialized !== undefined && jsonEncoder.encode(serialized).byteLength <= maximumBytes\n },\n { expected: `JSON encoded as at most ${maximumBytes} UTF-8 bytes` }\n )\nconst PersistedEventCursor = EventCursor.check(Schema.isGreaterThan(0))\n\n/** Maximum decoded JSON carried by one durable domain event. */\nexport const MaximumDomainEventPayloadBytes = 65_536\n\n/** Bounded trace identifier safe to persist independently of the HTTP API. */\nexport const DomainEventCorrelationId = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(128),\n Schema.isPattern(/^[A-Za-z0-9._:-]+$/u, { expected: \"a domain-safe correlation identifier\" })\n).pipe(Schema.brand(\"DomainEventCorrelationId\"))\n\n/** Decoded durable event correlation identifier. */\nexport type DomainEventCorrelationId = typeof DomainEventCorrelationId.Type\n\n/** Optional normalized identities explaining which portfolio facts changed. */\nexport const DomainEventMetadataV1 = Schema.Struct({\n releaseId: Schema.optionalKey(ReleaseId),\n pluginConnectionId: Schema.optionalKey(PluginConnectionId),\n entityId: Schema.optionalKey(EntityId),\n jobId: Schema.optionalKey(JobId)\n}).annotate({ identifier: \"DomainEventMetadataV1\" })\n\n/** Decoded optional identities attached to a v1 domain event. */\nexport type DomainEventMetadataV1 = typeof DomainEventMetadataV1.Type\n\n/** Portfolio projection that must be refreshed after a durable invalidation. */\nexport const PortfolioInvalidationReason = Schema.Literals([\"release-projection\", \"plugin-health\"])\n\n/** Decoded reason for invalidating an authoritative portfolio projection. */\nexport type PortfolioInvalidationReason = typeof PortfolioInvalidationReason.Type\n\n/** Bounded typed payload persisted with a portfolio invalidation. */\nexport const PortfolioInvalidatedPayloadV1 = Schema.Struct({\n reason: PortfolioInvalidationReason\n}).check(hasMaximumJsonBytes(MaximumDomainEventPayloadBytes)).annotate({ identifier: \"PortfolioInvalidatedPayloadV1\" })\n\n/** Decoded bounded v1 portfolio-invalidation payload. */\nexport type PortfolioInvalidatedPayloadV1 = typeof PortfolioInvalidatedPayloadV1.Type\n\n/** Durable workspace-local event declaring that the authoritative portfolio changed. */\nexport const PortfolioInvalidatedEventV1 = Schema.Struct({\n schemaVersion: Schema.Literal(1),\n eventId: DomainEventId,\n eventCursor: PersistedEventCursor,\n workspaceId: WorkspaceId,\n eventType: Schema.Literal(\"portfolio-invalidated\"),\n occurredAt: UtcTimestamp,\n ingestedAt: UtcTimestamp,\n causationId: Schema.NullOr(DomainEventId),\n correlationId: Schema.NullOr(DomainEventCorrelationId),\n metadata: DomainEventMetadataV1,\n payload: PortfolioInvalidatedPayloadV1\n}).annotate({ identifier: \"PortfolioInvalidatedEventV1\" })\n\n/** Decoded durable v1 portfolio-invalidation event. */\nexport type PortfolioInvalidatedEventV1 = typeof PortfolioInvalidatedEventV1.Type\n","import * as DateTime from \"effect/DateTime\"\nimport * as Schema from \"effect/Schema\"\n\nimport { AgentActor, HumanActor, Role } from \"../actors.js\"\nimport { DomainEventCorrelationId } from \"../domainEvent.js\"\nimport {\n DomainEventId,\n EntityId,\n EvidenceClaimId,\n EvidenceId,\n GovernedActionAttemptId,\n GovernedActionAuthorizationId,\n GovernedActionId,\n JobId,\n PluginConnectionId,\n SessionId,\n WorkspaceId\n} from \"../identifiers.js\"\nimport { PluginActionPayloadDigest, PluginActionProposalV1, ReadyPluginActionPreflightV1 } from \"../plugins/actions.js\"\nimport { PluginId, SemanticVersion } from \"../plugins/descriptor.js\"\nimport { PluginEntityType } from \"../plugins/events.js\"\nimport { ProviderId, Revision, SourceRevision } from \"../sourceRevision.js\"\nimport { UtcTimestamp } from \"../utcTimestamp.js\"\n\nconst PositiveInteger = Schema.Int.check(Schema.isGreaterThan(0))\nconst boundedIdentifier = (name: string, maximumLength: number) =>\n Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(maximumLength),\n Schema.isPattern(/^[A-Za-z0-9._:/-]+$/u, { expected: \"a bounded action identifier\" })\n ).pipe(Schema.brand(name))\nconst sha256Digest = (name: string) =>\n Schema.String.check(\n Schema.isPattern(/^sha256:[0-9a-f]{64}$/u, { expected: \"a lowercase SHA-256 digest\" })\n ).pipe(Schema.brand(name))\nconst compareText = (left: string, right: string): number => left < right ? -1 : left > right ? 1 : 0\nconst isCanonicalText = (values: ReadonlyArray<string>): boolean =>\n values.every((value, index) => index === 0 || compareText(values[index - 1] ?? \"\", value) < 0)\n\n/** Digest of every immutable field in a governed action envelope. */\nexport const GovernedActionEnvelopeDigest = sha256Digest(\"GovernedActionEnvelopeDigest\")\n\n/** Decoded governed-action envelope digest. */\nexport type GovernedActionEnvelopeDigest = typeof GovernedActionEnvelopeDigest.Type\n\n/** Digest of the canonical evidence-reference set bound to an action. */\nexport const GovernedActionEvidenceSetDigest = sha256Digest(\"GovernedActionEvidenceSetDigest\")\n\n/** Decoded governed-action evidence-set digest. */\nexport type GovernedActionEvidenceSetDigest = typeof GovernedActionEvidenceSetDigest.Type\n\n/** Digest of a fresh policy evaluation persisted with one exact dispatch attempt. */\nexport const GovernedActionPolicyEvaluationDigest = sha256Digest(\"GovernedActionPolicyEvaluationDigest\")\n\n/** Decoded fresh-policy evaluation digest. */\nexport type GovernedActionPolicyEvaluationDigest = typeof GovernedActionPolicyEvaluationDigest.Type\n\n/** Digest of every immutable field in one human action authorization. */\nexport const GovernedActionAuthorizationDigest = sha256Digest(\"GovernedActionAuthorizationDigest\")\n\n/** Decoded governed-action authorization digest. */\nexport type GovernedActionAuthorizationDigest = typeof GovernedActionAuthorizationDigest.Type\n\n/** Digest of every immutable field in one durable dispatch attempt. */\nexport const GovernedActionAttemptDigest = sha256Digest(\"GovernedActionAttemptDigest\")\n\n/** Decoded governed-action attempt digest. */\nexport type GovernedActionAttemptDigest = typeof GovernedActionAttemptDigest.Type\n\n/** Digest of the exact versioned policy snapshot used for authorization. */\nexport const GovernedActionPolicyDigest = sha256Digest(\"GovernedActionPolicyDigest\")\n\n/** Decoded governed-action policy digest. */\nexport type GovernedActionPolicyDigest = typeof GovernedActionPolicyDigest.Type\n\n/** Stable identity of one governed-action policy family. */\nexport const GovernedActionPolicyId = boundedIdentifier(\"GovernedActionPolicyId\", 200)\n\n/** Decoded governed-action policy identity. */\nexport type GovernedActionPolicyId = typeof GovernedActionPolicyId.Type\n\n/** Workspace-connection scoped key that deduplicates one governed provider mutation. */\nexport const GovernedActionIdempotencyKey = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(512)\n).pipe(Schema.brand(\"GovernedActionIdempotencyKey\"))\n\n/** Decoded governed-action idempotency key. */\nexport type GovernedActionIdempotencyKey = typeof GovernedActionIdempotencyKey.Type\n\n/** Optimistic revision of the exact configured plugin connection authorized for dispatch. */\nexport const GovernedActionPluginConnectionRevision = PositiveInteger.pipe(\n Schema.brand(\"GovernedActionPluginConnectionRevision\")\n)\n\n/** Decoded configured-connection revision bound to a governed action. */\nexport type GovernedActionPluginConnectionRevision = typeof GovernedActionPluginConnectionRevision.Type\n\n/** Non-secret digest that changes with configuration, credentials, or resolved provider account. */\nexport const GovernedActionPluginConnectionAuthorityDigest = sha256Digest(\n \"GovernedActionPluginConnectionAuthorityDigest\"\n)\n\n/** Decoded configured-connection authority generation. */\nexport type GovernedActionPluginConnectionAuthorityDigest = typeof GovernedActionPluginConnectionAuthorityDigest.Type\n\n/** Versioned policy and permission snapshot bound into an action proposal. */\nexport const GovernedActionPolicyBinding = Schema.Struct({\n policyId: GovernedActionPolicyId,\n policyVersion: PositiveInteger,\n policyDigest: GovernedActionPolicyDigest,\n requiredPermission: Role\n})\n\n/** Decoded governed-action policy binding. */\nexport type GovernedActionPolicyBinding = typeof GovernedActionPolicyBinding.Type\n\n/** Fresh policy result recomputed immediately before a provider mutation may dispatch. */\nexport const GovernedActionPolicyEvaluationV1 = Schema.Struct({\n schemaVersion: Schema.Literal(1),\n actionId: GovernedActionId,\n workspaceId: WorkspaceId,\n policy: GovernedActionPolicyBinding,\n payloadDigest: PluginActionPayloadDigest,\n evidenceSetDigest: GovernedActionEvidenceSetDigest,\n expectedRevision: Revision,\n decision: Schema.Literals([\"allowed\", \"denied\"]),\n evaluatedAt: UtcTimestamp\n})\n\n/** Decoded fresh policy evaluation for one exact governed action. */\nexport type GovernedActionPolicyEvaluationV1 = typeof GovernedActionPolicyEvaluationV1.Type\n\n/** Current normalized target and exact provider provenance checked before dispatch. */\nexport const GovernedActionTargetSnapshotV1 = Schema.Struct({\n workspaceId: WorkspaceId,\n entityId: EntityId,\n entityType: PluginEntityType,\n sourceRevision: SourceRevision\n})\n\n/** Decoded current target snapshot used by governed-action authority. */\nexport type GovernedActionTargetSnapshotV1 = typeof GovernedActionTargetSnapshotV1.Type\n\n/** Exact immutable evidence state considered by policy at proposal time. */\nexport const GovernedActionEvidenceReference = Schema.Struct({\n workspaceId: WorkspaceId,\n evidenceId: EvidenceId,\n evidenceClaimIds: Schema.Array(EvidenceClaimId).check(\n Schema.isUnique(),\n Schema.makeFilter(isCanonicalText, { expected: \"evidence claim identities in canonical order\" }),\n Schema.makeFilter((evidenceClaimIds) => evidenceClaimIds.length <= 100, {\n expected: \"at most 100 evidence claims per evidence item\"\n })\n ),\n observedAt: UtcTimestamp,\n validUntil: Schema.NullOr(UtcTimestamp),\n currentUntil: Schema.NullOr(UtcTimestamp),\n evaluatedAt: UtcTimestamp,\n source: Schema.Literals([\"current\", \"stale\", \"missing\", \"unavailable\"]),\n validity: Schema.Literals([\"valid\", \"expired\"])\n}).check(\n Schema.makeFilter(\n ({ evaluatedAt, observedAt }) => DateTime.Order(observedAt, evaluatedAt) <= 0,\n { expected: \"evidence evaluation not to precede observation\" }\n ),\n Schema.makeFilter(\n ({ observedAt, validUntil }) => validUntil === null || DateTime.Order(observedAt, validUntil) < 0,\n { expected: \"evidence validity to end after observation\" }\n ),\n Schema.makeFilter(\n ({ currentUntil, observedAt }) => currentUntil === null || DateTime.Order(observedAt, currentUntil) < 0,\n { expected: \"evidence freshness to end after observation\" }\n ),\n Schema.makeFilter(\n ({ currentUntil, evaluatedAt, source }) => {\n if (source === \"current\") return currentUntil === null || DateTime.Order(evaluatedAt, currentUntil) < 0\n if (source === \"stale\") return currentUntil !== null && DateTime.Order(evaluatedAt, currentUntil) >= 0\n return currentUntil === null\n },\n { expected: \"evidence source state to match its evaluation and freshness window\" }\n ),\n Schema.makeFilter(\n ({ evaluatedAt, validUntil, validity }) => {\n const expectedValidity = validUntil === null || DateTime.Order(evaluatedAt, validUntil) < 0\n ? \"valid\"\n : \"expired\"\n return validity === expectedValidity\n },\n { expected: \"evidence validity to match its evaluation and validity window\" }\n )\n)\n\n/** Decoded immutable evidence reference. */\nexport type GovernedActionEvidenceReference = typeof GovernedActionEvidenceReference.Type\n\n/** Human or agent provenance for a proposal; neither form grants execution authority. */\nexport const GovernedActionProposalOrigin = Schema.TaggedUnion({\n human: {\n actor: HumanActor,\n sessionId: SessionId\n },\n agent: {\n actor: AgentActor,\n jobId: JobId,\n initiatingSessionId: Schema.NullOr(SessionId)\n }\n})\n\n/** Decoded governed-action proposal provenance. */\nexport type GovernedActionProposalOrigin = typeof GovernedActionProposalOrigin.Type\n\nconst canonicalEvidenceReferences = Schema.makeFilter(\n (evidence: ReadonlyArray<GovernedActionEvidenceReference>) =>\n isCanonicalText(evidence.map(({ evidenceId }) => evidenceId)),\n { expected: \"unique evidence references in canonical evidence-id order\" }\n)\n\n/** Bounded canonical set of immutable evidence references used by action authority. */\nexport const GovernedActionEvidenceSet = Schema.Array(GovernedActionEvidenceReference).check(\n Schema.makeFilter((evidence) => evidence.length <= 100, { expected: \"at most 100 evidence references\" }),\n canonicalEvidenceReferences\n)\n\n/** Decoded governed-action evidence set. */\nexport type GovernedActionEvidenceSet = typeof GovernedActionEvidenceSet.Type\n\nconst governedActionEnvelopeMaterialFields = {\n schemaVersion: Schema.Literal(1),\n actionId: GovernedActionId,\n idempotencyKey: GovernedActionIdempotencyKey,\n workspaceId: WorkspaceId,\n pluginConnectionId: PluginConnectionId,\n pluginConnectionRevision: GovernedActionPluginConnectionRevision,\n pluginConnectionAuthorityDigest: GovernedActionPluginConnectionAuthorityDigest,\n pluginId: PluginId,\n pluginContractVersion: SemanticVersion,\n pluginAdapterVersion: SemanticVersion,\n providerId: ProviderId,\n capability: Schema.Struct({\n capabilityId: Schema.Literal(\"action.execute\"),\n version: PositiveInteger\n }),\n targetEntityId: EntityId,\n proposal: PluginActionProposalV1,\n evidence: GovernedActionEvidenceSet,\n evidenceSetDigest: GovernedActionEvidenceSetDigest,\n policy: GovernedActionPolicyBinding,\n origin: GovernedActionProposalOrigin,\n proposalExpiresAt: UtcTimestamp,\n causationId: Schema.NullOr(DomainEventId),\n correlationId: Schema.NullOr(DomainEventCorrelationId)\n}\n\n/** Complete digest-free material used to derive an immutable action envelope identity. */\nexport const GovernedActionEnvelopeMaterialV1 = Schema.Struct(governedActionEnvelopeMaterialFields).check(\n Schema.makeFilter(\n ({ capability, proposal }) => capability.version === proposal.capabilityVersion,\n { expected: \"envelope capability version to match the proposal capability version\" }\n ),\n Schema.makeFilter(\n ({ proposal, proposalExpiresAt }) => DateTime.Order(proposal.proposedAt, proposalExpiresAt) < 0,\n { expected: \"action proposal to expire after it is created\" }\n ),\n Schema.makeFilter(\n ({ evidence, workspaceId }) => evidence.every((reference) => reference.workspaceId === workspaceId),\n { expected: \"every governed-action evidence reference to belong to the action workspace\" }\n )\n)\n\n/** Decoded digest-free V1 governed-action envelope material. */\nexport type GovernedActionEnvelopeMaterialV1 = typeof GovernedActionEnvelopeMaterialV1.Type\n\n/** Immutable, versioned host authority for one proposed provider mutation. */\nexport const GovernedActionEnvelopeV1 = Schema.Struct({\n ...governedActionEnvelopeMaterialFields,\n envelopeDigest: GovernedActionEnvelopeDigest\n}).check(\n Schema.makeFilter(\n ({ capability, proposal }) => capability.version === proposal.capabilityVersion,\n { expected: \"envelope capability version to match the proposal capability version\" }\n ),\n Schema.makeFilter(\n ({ proposal, proposalExpiresAt }) => DateTime.Order(proposal.proposedAt, proposalExpiresAt) < 0,\n { expected: \"action proposal to expire after it is created\" }\n ),\n Schema.makeFilter(\n ({ evidence, workspaceId }) => evidence.every((reference) => reference.workspaceId === workspaceId),\n { expected: \"every governed-action evidence reference to belong to the action workspace\" }\n )\n)\n\n/** Decoded immutable V1 governed-action envelope. */\nexport type GovernedActionEnvelopeV1 = typeof GovernedActionEnvelopeV1.Type\n\n/** Human authorization bound to the complete immutable action and policy inputs. */\nexport const GovernedActionAuthorizationV1 = Schema.Struct({\n schemaVersion: Schema.Literal(1),\n authorizationId: GovernedActionAuthorizationId,\n actionId: GovernedActionId,\n workspaceId: WorkspaceId,\n pluginConnectionId: PluginConnectionId,\n pluginConnectionRevision: GovernedActionPluginConnectionRevision,\n pluginConnectionAuthorityDigest: GovernedActionPluginConnectionAuthorityDigest,\n actionEnvelopeDigest: GovernedActionEnvelopeDigest,\n idempotencyKey: GovernedActionIdempotencyKey,\n payloadDigest: PluginActionPayloadDigest,\n evidenceSetDigest: GovernedActionEvidenceSetDigest,\n policyDigest: GovernedActionPolicyDigest,\n expectedRevision: Revision,\n capabilityVersion: PositiveInteger,\n actor: HumanActor,\n sessionId: SessionId,\n sessionPermission: Role,\n sessionExpiresAt: UtcTimestamp,\n requiredPermission: Role,\n authorizedAt: UtcTimestamp,\n expiresAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ authorizedAt, expiresAt }) => DateTime.Order(authorizedAt, expiresAt) < 0,\n { expected: \"governed-action authorization to expire after it is issued\" }\n ),\n Schema.makeFilter(\n ({ expiresAt, sessionExpiresAt }) => DateTime.Order(expiresAt, sessionExpiresAt) <= 0,\n { expected: \"governed-action authorization not to outlive its authenticated session\" }\n )\n)\n\n/** Decoded immutable human authorization. */\nexport type GovernedActionAuthorizationV1 = typeof GovernedActionAuthorizationV1.Type\n\n/** Durable dispatch intent created only after an exact ready preflight. */\nexport const GovernedActionAttemptV1 = Schema.Struct({\n schemaVersion: Schema.Literal(1),\n attemptId: GovernedActionAttemptId,\n authorizationId: GovernedActionAuthorizationId,\n actionId: GovernedActionId,\n workspaceId: WorkspaceId,\n pluginConnectionId: PluginConnectionId,\n idempotencyKey: GovernedActionIdempotencyKey,\n attemptNumber: Schema.Literal(1),\n actionEnvelopeDigest: GovernedActionEnvelopeDigest,\n expectedRevision: Revision,\n policyEvaluationDigest: GovernedActionPolicyEvaluationDigest,\n preflight: ReadyPluginActionPreflightV1,\n startedAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ expectedRevision, preflight }) => expectedRevision === preflight.checkedRevision,\n { expected: \"dispatch intent revision to match the ready preflight revision\" }\n ),\n Schema.makeFilter(\n ({ preflight, startedAt }) => DateTime.Order(preflight.checkedAt, startedAt) <= 0,\n { expected: \"dispatch intent not to precede its ready preflight\" }\n )\n)\n\n/** Decoded immutable dispatch intent. */\nexport type GovernedActionAttemptV1 = typeof GovernedActionAttemptV1.Type\n","import * as DateTime from \"effect/DateTime\"\nimport * as Schema from \"effect/Schema\"\n\nimport type { Role } from \"../actors.js\"\nimport { UtcTimestamp } from \"../utcTimestamp.js\"\nimport { GovernedActionAttemptV1, GovernedActionAuthorizationV1, GovernedActionEnvelopeV1 } from \"./model.js\"\nimport type { GovernedActionTransitionV1 } from \"./stateMachine.js\"\n\n/** Closed reasons why durable authorization or dispatch intent does not match its action. */\nexport const GovernedActionAuthorityMismatch = Schema.Literals([\n \"authorization-action-mismatch\",\n \"authorization-workspace-mismatch\",\n \"authorization-connection-mismatch\",\n \"authorization-connection-revision-mismatch\",\n \"authorization-connection-authority-mismatch\",\n \"authorization-envelope-mismatch\",\n \"authorization-idempotency-mismatch\",\n \"authorization-payload-mismatch\",\n \"authorization-evidence-mismatch\",\n \"authorization-policy-mismatch\",\n \"authorization-revision-mismatch\",\n \"authorization-capability-mismatch\",\n \"authorization-permission-mismatch\",\n \"authorization-outside-proposal-window\",\n \"authorization-expired\",\n \"authorization-session-expired\",\n \"evidence-not-current\",\n \"evidence-set-changed\",\n \"evidence-workspace-mismatch\",\n \"session-id-mismatch\",\n \"session-actor-mismatch\",\n \"session-workspace-mismatch\",\n \"session-permission-mismatch\",\n \"session-revoked\",\n \"authorization-session-chronology\",\n \"current-plugin-connection-mismatch\",\n \"current-plugin-workspace-mismatch\",\n \"current-plugin-provider-mismatch\",\n \"current-plugin-revision-mismatch\",\n \"current-plugin-authority-mismatch\",\n \"current-plugin-unavailable\",\n \"current-plugin-mismatch\",\n \"current-capability-unavailable\",\n \"current-capability-version-mismatch\",\n \"current-policy-denied\",\n \"current-policy-mismatch\",\n \"current-target-workspace-mismatch\",\n \"current-target-entity-mismatch\",\n \"current-target-type-mismatch\",\n \"current-target-source-mismatch\",\n \"current-target-revision-mismatch\",\n \"attempt-action-mismatch\",\n \"attempt-authorization-mismatch\",\n \"attempt-workspace-mismatch\",\n \"attempt-connection-mismatch\",\n \"attempt-envelope-mismatch\",\n \"attempt-idempotency-mismatch\",\n \"attempt-policy-evaluation-mismatch\",\n \"attempt-revision-mismatch\",\n \"attempt-outside-authorization-window\"\n])\n\n/** Decoded governed-action authority mismatch. */\nexport type GovernedActionAuthorityMismatch = typeof GovernedActionAuthorityMismatch.Type\n\n/** Complete aggregate authority checked immediately before durable dispatch intent. */\nexport const GovernedActionAuthorityBindingInput = Schema.Struct({\n envelope: GovernedActionEnvelopeV1,\n authorization: GovernedActionAuthorizationV1,\n attempt: GovernedActionAttemptV1,\n evaluatedAt: UtcTimestamp\n})\n\n/** Decoded aggregate authority inputs checked immediately before dispatch. */\nexport type GovernedActionAuthorityBindingInput = typeof GovernedActionAuthorityBindingInput.Type\n\n/** Immutable authorization inputs that can be verified before a dispatch attempt exists. */\nexport const GovernedActionAuthorizationBindingInput = Schema.Struct({\n envelope: GovernedActionEnvelopeV1,\n authorization: GovernedActionAuthorizationV1\n})\n\n/** Decoded authorization-only binding inputs. */\nexport type GovernedActionAuthorizationBindingInput = typeof GovernedActionAuthorizationBindingInput.Type\n\n/** Explicit V1 permission implication: workspace owner or an exact scoped role. */\nexport const governedActionPermissionGrants = (sessionPermission: Role, requiredPermission: Role): boolean =>\n sessionPermission === \"workspace-owner\" || sessionPermission === requiredPermission\n\n/** Return every fail-closed mismatch between an envelope and its human grant. */\nexport const governedActionAuthorizationMismatches = ({\n authorization,\n envelope\n}: GovernedActionAuthorizationBindingInput): ReadonlyArray<GovernedActionAuthorityMismatch> => {\n const mismatches: Array<GovernedActionAuthorityMismatch> = []\n const addMismatch = (condition: boolean, mismatch: GovernedActionAuthorityMismatch): void => {\n if (condition) mismatches.push(mismatch)\n }\n\n addMismatch(authorization.actionId !== envelope.actionId, \"authorization-action-mismatch\")\n addMismatch(authorization.workspaceId !== envelope.workspaceId, \"authorization-workspace-mismatch\")\n addMismatch(\n authorization.pluginConnectionId !== envelope.pluginConnectionId,\n \"authorization-connection-mismatch\"\n )\n addMismatch(\n authorization.pluginConnectionRevision !== envelope.pluginConnectionRevision,\n \"authorization-connection-revision-mismatch\"\n )\n addMismatch(\n authorization.pluginConnectionAuthorityDigest !== envelope.pluginConnectionAuthorityDigest,\n \"authorization-connection-authority-mismatch\"\n )\n addMismatch(\n authorization.actionEnvelopeDigest !== envelope.envelopeDigest,\n \"authorization-envelope-mismatch\"\n )\n addMismatch(authorization.idempotencyKey !== envelope.idempotencyKey, \"authorization-idempotency-mismatch\")\n addMismatch(\n authorization.payloadDigest !== envelope.proposal.payloadDigest,\n \"authorization-payload-mismatch\"\n )\n addMismatch(\n authorization.evidenceSetDigest !== envelope.evidenceSetDigest,\n \"authorization-evidence-mismatch\"\n )\n addMismatch(authorization.policyDigest !== envelope.policy.policyDigest, \"authorization-policy-mismatch\")\n addMismatch(\n authorization.expectedRevision !== envelope.proposal.request.expectedRevision,\n \"authorization-revision-mismatch\"\n )\n addMismatch(\n authorization.capabilityVersion !== envelope.capability.version,\n \"authorization-capability-mismatch\"\n )\n addMismatch(\n authorization.requiredPermission !== envelope.policy.requiredPermission,\n \"authorization-permission-mismatch\"\n )\n addMismatch(\n !governedActionPermissionGrants(authorization.sessionPermission, authorization.requiredPermission),\n \"authorization-permission-mismatch\"\n )\n addMismatch(\n DateTime.Order(authorization.authorizedAt, envelope.proposal.proposedAt) < 0 ||\n DateTime.Order(authorization.authorizedAt, envelope.proposalExpiresAt) >= 0 ||\n DateTime.Order(authorization.expiresAt, envelope.proposalExpiresAt) > 0,\n \"authorization-outside-proposal-window\"\n )\n\n return mismatches\n}\n\n/** Whether a human grant is attributable to its exact immutable authorize transition. */\nexport const governedActionAuthorizationMatchesTransition = (\n authorization: GovernedActionAuthorizationV1,\n transition: GovernedActionTransitionV1\n): boolean =>\n transition.command._tag === \"authorize\" &&\n transition.command.authorizationId === authorization.authorizationId &&\n transition.actionId === authorization.actionId &&\n transition.workspaceId === authorization.workspaceId &&\n transition.actionEnvelopeDigest === authorization.actionEnvelopeDigest &&\n DateTime.Order(transition.occurredAt, authorization.authorizedAt) === 0 &&\n transition.cause._tag === \"human\" &&\n transition.cause.actor.personId === authorization.actor.personId &&\n transition.cause.sessionId === authorization.sessionId\n\n/** Return every fail-closed mismatch between an envelope, human grant, and dispatch intent. */\nexport const governedActionAuthorityMismatches = ({\n attempt,\n authorization,\n envelope,\n evaluatedAt\n}: GovernedActionAuthorityBindingInput): ReadonlyArray<GovernedActionAuthorityMismatch> => {\n const mismatches: Array<GovernedActionAuthorityMismatch> = [\n ...governedActionAuthorizationMismatches({ authorization, envelope })\n ]\n const addMismatch = (condition: boolean, mismatch: GovernedActionAuthorityMismatch): void => {\n if (condition) mismatches.push(mismatch)\n }\n\n addMismatch(\n DateTime.Order(evaluatedAt, authorization.expiresAt) >= 0 ||\n DateTime.Order(evaluatedAt, envelope.proposalExpiresAt) >= 0,\n \"authorization-expired\"\n )\n addMismatch(\n DateTime.Order(evaluatedAt, authorization.sessionExpiresAt) >= 0,\n \"authorization-session-expired\"\n )\n addMismatch(\n envelope.evidence.some(({ currentUntil, source, validUntil }) =>\n source !== \"current\" ||\n (currentUntil !== null && DateTime.Order(evaluatedAt, currentUntil) >= 0) ||\n (validUntil !== null && DateTime.Order(evaluatedAt, validUntil) >= 0)\n ),\n \"evidence-not-current\"\n )\n\n addMismatch(attempt.actionId !== envelope.actionId, \"attempt-action-mismatch\")\n addMismatch(attempt.authorizationId !== authorization.authorizationId, \"attempt-authorization-mismatch\")\n addMismatch(attempt.workspaceId !== envelope.workspaceId, \"attempt-workspace-mismatch\")\n addMismatch(attempt.pluginConnectionId !== envelope.pluginConnectionId, \"attempt-connection-mismatch\")\n addMismatch(attempt.actionEnvelopeDigest !== envelope.envelopeDigest, \"attempt-envelope-mismatch\")\n addMismatch(attempt.idempotencyKey !== envelope.idempotencyKey, \"attempt-idempotency-mismatch\")\n addMismatch(attempt.expectedRevision !== envelope.proposal.request.expectedRevision, \"attempt-revision-mismatch\")\n addMismatch(\n DateTime.Order(attempt.preflight.checkedAt, authorization.authorizedAt) < 0 ||\n DateTime.Order(attempt.startedAt, authorization.authorizedAt) < 0 ||\n DateTime.Order(attempt.startedAt, authorization.expiresAt) >= 0 ||\n DateTime.Order(attempt.startedAt, envelope.proposalExpiresAt) >= 0 ||\n DateTime.Order(attempt.startedAt, evaluatedAt) > 0,\n \"attempt-outside-authorization-window\"\n )\n\n return mismatches\n}\n","import * as Schema from \"effect/Schema\"\n\nimport { AgentActor, HumanActor } from \"../actors.js\"\nimport { DomainEventCorrelationId } from \"../domainEvent.js\"\nimport {\n DomainEventId,\n GovernedActionAttemptId,\n GovernedActionAuthorizationId,\n GovernedActionId,\n GovernedActionTransitionId,\n JobId,\n SessionId,\n WorkspaceId\n} from \"../identifiers.js\"\nimport {\n PluginAcceptedProviderReceiptV1,\n PluginActionReconciliationKey,\n PluginProviderOperationId,\n PluginTerminalProviderReceiptV1\n} from \"../plugins/actions.js\"\nimport { UtcTimestamp } from \"../utcTimestamp.js\"\nimport { GovernedActionEnvelopeDigest } from \"./model.js\"\n\nconst PositiveInteger = Schema.Int.check(Schema.isGreaterThan(0))\nconst SafeReason = Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(1_000))\nconst boundedIdentifier = (name: string, maximumLength: number) =>\n Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(maximumLength),\n Schema.isPattern(/^[A-Za-z0-9._:/-]+$/u, { expected: \"a bounded action identifier\" })\n ).pipe(Schema.brand(name))\n\n/** Complete persisted lifecycle states for a governed action. */\nexport const GovernedActionState = Schema.Literals([\n \"proposed\",\n \"authorized\",\n \"denied\",\n \"expired\",\n \"cancelled\",\n \"started\",\n \"cancel-requested\",\n \"cancel-requested-unknown\",\n \"succeeded\",\n \"failed\",\n \"unknown\"\n])\n\n/** Decoded governed-action lifecycle state. */\nexport type GovernedActionState = typeof GovernedActionState.Type\n\n/** Stable identity supplied by a caller to deduplicate one lifecycle command. */\nexport const GovernedActionCommandId = boundedIdentifier(\"GovernedActionCommandId\", 512)\n\n/** Decoded governed-action command identity. */\nexport type GovernedActionCommandId = typeof GovernedActionCommandId.Type\n\n/** Digest of one canonical transition command used to reject changed command retries. */\nexport const GovernedActionCommandDigest = Schema.String.check(\n Schema.isPattern(/^sha256:[0-9a-f]{64}$/u, { expected: \"a lowercase SHA-256 digest\" })\n).pipe(Schema.brand(\"GovernedActionCommandDigest\"))\n\n/** Decoded governed-action command digest. */\nexport type GovernedActionCommandDigest = typeof GovernedActionCommandDigest.Type\n\n/** Digest of every immutable field in one governed-action transition. */\nexport const GovernedActionTransitionDigest = Schema.String.check(\n Schema.isPattern(/^sha256:[0-9a-f]{64}$/u, { expected: \"a lowercase SHA-256 digest\" })\n).pipe(Schema.brand(\"GovernedActionTransitionDigest\"))\n\n/** Decoded governed-action transition digest. */\nexport type GovernedActionTransitionDigest = typeof GovernedActionTransitionDigest.Type\n\n/** Closed reason why authorization or preflight failed without calling a provider. */\nexport const GovernedActionDenialReason = Schema.Literals([\n \"revision-changed\",\n \"evidence-stale\",\n \"evidence-invalid\",\n \"policy-denied\",\n \"session-invalid\",\n \"capability-changed\",\n \"plugin-unavailable\",\n \"preflight-blocked\"\n])\n\n/** Decoded governed-action denial reason. */\nexport type GovernedActionDenialReason = typeof GovernedActionDenialReason.Type\n\n/** Unknown provider outcome that is either safely reconcilable or explicitly manual. */\nexport const GovernedActionUnknownOutcome = Schema.TaggedUnion({\n reconcilable: {\n reconciliationKey: PluginActionReconciliationKey,\n observedAt: UtcTimestamp,\n safeSummary: SafeReason\n },\n manual: {\n observedAt: UtcTimestamp,\n safeSummary: SafeReason,\n reason: Schema.Literals([\n \"dispatch-deadline-exceeded\",\n \"interrupted-after-intent\",\n \"provider-defect-after-intent\",\n \"malformed-provider-result\",\n \"receipt-persistence-failed\",\n \"missing-reconciliation-locator\"\n ])\n }\n})\n\n/** Decoded truthful unknown-outcome detail. */\nexport type GovernedActionUnknownOutcome = typeof GovernedActionUnknownOutcome.Type\n\nconst SucceededReceipt = PluginTerminalProviderReceiptV1.check(\n Schema.makeFilter(({ status }) => status === \"succeeded\", { expected: \"a succeeded provider receipt\" })\n)\nconst FailedReceipt = PluginTerminalProviderReceiptV1.check(\n Schema.makeFilter(({ status }) => status === \"failed\", { expected: \"a failed provider receipt\" })\n)\nconst CancelledReceipt = PluginTerminalProviderReceiptV1.check(\n Schema.makeFilter(({ status }) => status === \"cancelled\", { expected: \"a cancelled provider receipt\" })\n)\n\n/** Whether a terminal receipt came from dispatch or reconciliation by provider/idempotency identity. */\nexport const GovernedActionOutcomeSource = Schema.TaggedUnion({\n direct: {},\n providerOperation: { providerOperationId: PluginProviderOperationId },\n reconciliation: { reconciliationKey: Schema.NullOr(PluginActionReconciliationKey) }\n})\n\n/** Decoded terminal provider-outcome source. */\nexport type GovernedActionOutcomeSource = typeof GovernedActionOutcomeSource.Type\n\n/** Closed commands that may append one governed-action lifecycle transition. */\nexport const GovernedActionTransitionCommand = Schema.TaggedUnion({\n propose: {},\n authorize: { authorizationId: GovernedActionAuthorizationId },\n deny: {\n reason: GovernedActionDenialReason,\n safeSummary: SafeReason\n },\n expire: {\n reason: Schema.Literals([\"proposal-expired\", \"authorization-expired\"])\n },\n cancel: { safeSummary: SafeReason },\n start: { attemptId: GovernedActionAttemptId },\n requestCancellation: { safeSummary: SafeReason },\n recordAccepted: { receipt: PluginAcceptedProviderReceiptV1 },\n recordSucceeded: { receipt: SucceededReceipt, source: GovernedActionOutcomeSource },\n recordFailed: { receipt: FailedReceipt, source: GovernedActionOutcomeSource },\n recordUnknown: { outcome: GovernedActionUnknownOutcome },\n recordCancelled: { receipt: CancelledReceipt, source: GovernedActionOutcomeSource },\n reconciliationPending: {\n checkedAt: UtcTimestamp,\n reconciliationKey: Schema.NullOr(PluginActionReconciliationKey)\n }\n})\n\n/** Decoded governed-action lifecycle command. */\nexport type GovernedActionTransitionCommand = typeof GovernedActionTransitionCommand.Type\n\n/** Attributable human, agent, or internal component responsible for a transition. */\nexport const GovernedActionTransitionCause = Schema.TaggedUnion({\n human: {\n actor: HumanActor,\n sessionId: SessionId\n },\n agent: {\n actor: AgentActor,\n jobId: JobId\n },\n system: {\n component: boundedIdentifier(\"GovernedActionSystemComponent\", 200)\n }\n})\n\n/** Decoded governed-action transition attribution. */\nexport type GovernedActionTransitionCause = typeof GovernedActionTransitionCause.Type\n\nconst canRecordTerminalOutcome = (\n currentState: GovernedActionState | null,\n source: GovernedActionOutcomeSource\n): boolean =>\n currentState === \"started\" ||\n currentState === \"cancel-requested\" ||\n ((currentState === \"unknown\" || currentState === \"cancel-requested-unknown\") &&\n source._tag === \"reconciliation\")\n\n/**\n * Resolve a lifecycle command without side effects.\n * A null result means the command is not legal from the supplied state.\n */\nexport const reduceGovernedActionState = (\n currentState: GovernedActionState | null,\n command: GovernedActionTransitionCommand\n): GovernedActionState | null => {\n switch (command._tag) {\n case \"propose\":\n return currentState === null ? \"proposed\" : null\n case \"authorize\":\n return currentState === \"proposed\" ? \"authorized\" : null\n case \"deny\":\n return currentState === \"proposed\" || currentState === \"authorized\" ? \"denied\" : null\n case \"expire\":\n return currentState === \"proposed\" || currentState === \"authorized\" ? \"expired\" : null\n case \"cancel\":\n return currentState === \"proposed\" || currentState === \"authorized\" ? \"cancelled\" : null\n case \"start\":\n return currentState === \"authorized\" ? \"started\" : null\n case \"requestCancellation\":\n return currentState === \"started\"\n ? \"cancel-requested\"\n : currentState === \"unknown\"\n ? \"cancel-requested-unknown\"\n : null\n case \"recordAccepted\":\n return currentState === \"started\" || currentState === \"cancel-requested\" ? currentState : null\n case \"recordUnknown\":\n return currentState === \"started\"\n ? \"unknown\"\n : currentState === \"cancel-requested\"\n ? \"cancel-requested-unknown\"\n : null\n case \"recordSucceeded\":\n return canRecordTerminalOutcome(currentState, command.source) ? \"succeeded\" : null\n case \"recordFailed\":\n return canRecordTerminalOutcome(currentState, command.source) ? \"failed\" : null\n case \"recordCancelled\":\n return canRecordTerminalOutcome(currentState, command.source) ? \"cancelled\" : null\n case \"reconciliationPending\":\n return currentState === \"started\" ||\n currentState === \"cancel-requested\" ||\n currentState === \"unknown\" ||\n currentState === \"cancel-requested-unknown\"\n ? currentState\n : null\n }\n}\n\n/** Whether a governed action has reached a state that cannot execute more provider work. */\nexport const isGovernedActionTerminalState = (state: GovernedActionState): boolean =>\n state === \"denied\" ||\n state === \"expired\" ||\n state === \"cancelled\" ||\n state === \"succeeded\" ||\n state === \"failed\"\n\nconst commandCauseIsAllowed = (\n command: GovernedActionTransitionCommand,\n cause: GovernedActionTransitionCause\n): boolean => {\n switch (cause._tag) {\n case \"agent\":\n return command._tag === \"propose\"\n case \"human\":\n return command._tag === \"propose\" ||\n command._tag === \"authorize\" ||\n command._tag === \"deny\" ||\n command._tag === \"cancel\" ||\n command._tag === \"requestCancellation\"\n case \"system\":\n return command._tag === \"deny\" ||\n command._tag === \"expire\" ||\n command._tag === \"cancel\" ||\n command._tag === \"start\" ||\n command._tag === \"requestCancellation\" ||\n command._tag === \"recordAccepted\" ||\n command._tag === \"recordSucceeded\" ||\n command._tag === \"recordFailed\" ||\n command._tag === \"recordUnknown\" ||\n command._tag === \"recordCancelled\" ||\n command._tag === \"reconciliationPending\"\n }\n}\n\nconst governedActionTransitionMaterialFields = {\n schemaVersion: Schema.Literal(1),\n transitionId: GovernedActionTransitionId,\n previousTransitionId: Schema.NullOr(GovernedActionTransitionId),\n commandId: GovernedActionCommandId,\n actionId: GovernedActionId,\n workspaceId: WorkspaceId,\n sequence: PositiveInteger,\n fromState: Schema.NullOr(GovernedActionState),\n toState: GovernedActionState,\n actionEnvelopeDigest: GovernedActionEnvelopeDigest,\n command: GovernedActionTransitionCommand,\n cause: GovernedActionTransitionCause,\n occurredAt: UtcTimestamp,\n causationId: Schema.NullOr(DomainEventId),\n correlationId: Schema.NullOr(DomainEventCorrelationId)\n}\n\n/** Digest-free transition fields used only by the trusted transition constructor. */\nexport const GovernedActionTransitionMaterialV1 = Schema.Struct(\n governedActionTransitionMaterialFields\n).check(\n Schema.makeFilter(\n ({ command, fromState, toState }) => reduceGovernedActionState(fromState, command) === toState,\n { expected: \"a legal governed-action state transition\" }\n ),\n Schema.makeFilter(\n ({ cause, command }) => commandCauseIsAllowed(command, cause),\n { expected: \"transition cause to have authority for the command\" }\n ),\n Schema.makeFilter(\n ({ fromState, previousTransitionId, sequence }) =>\n sequence === 1\n ? fromState === null && previousTransitionId === null\n : fromState !== null && previousTransitionId !== null,\n { expected: \"the first transition to be the only transition without a predecessor\" }\n )\n)\n\n/** Decoded digest-free governed-action transition material. */\nexport type GovernedActionTransitionMaterialV1 = typeof GovernedActionTransitionMaterialV1.Type\n\n/** Immutable append-only audit record for one legal lifecycle command. */\nexport const GovernedActionTransitionV1 = Schema.Struct({\n ...governedActionTransitionMaterialFields,\n commandDigest: GovernedActionCommandDigest\n}).check(\n Schema.makeFilter(\n ({ command, fromState, toState }) => reduceGovernedActionState(fromState, command) === toState,\n { expected: \"a legal governed-action state transition\" }\n ),\n Schema.makeFilter(\n ({ cause, command }) => commandCauseIsAllowed(command, cause),\n { expected: \"transition cause to have authority for the command\" }\n ),\n Schema.makeFilter(\n ({ fromState, previousTransitionId, sequence }) =>\n sequence === 1\n ? fromState === null && previousTransitionId === null\n : fromState !== null && previousTransitionId !== null,\n { expected: \"the first transition to be the only transition without a predecessor\" }\n )\n)\n\n/** Decoded immutable governed-action transition. */\nexport type GovernedActionTransitionV1 = typeof GovernedActionTransitionV1.Type\n","import * as Schema from \"effect/Schema\"\n\nimport {\n PluginAcceptedProviderReceiptV1,\n PluginActionReconciliationKey,\n PluginProviderOperationId,\n PluginTerminalProviderReceiptV1\n} from \"../plugins/actions.js\"\nimport {\n GovernedActionState,\n type GovernedActionState as GovernedActionStateType,\n type GovernedActionTransitionCommand,\n reduceGovernedActionState\n} from \"./stateMachine.js\"\n\n/** Provider identity retained by the durable action head across async and ambiguous work. */\nexport const GovernedActionProviderLineage = Schema.TaggedUnion({\n none: {},\n accepted: { receipt: PluginAcceptedProviderReceiptV1 },\n reconcilable: {\n providerOperationId: Schema.NullOr(PluginProviderOperationId),\n reconciliationKey: PluginActionReconciliationKey\n },\n manual: {\n providerOperationId: Schema.NullOr(PluginProviderOperationId)\n },\n terminal: { receipt: PluginTerminalProviderReceiptV1 }\n})\n\n/** Decoded provider lineage retained by a governed-action lifecycle head. */\nexport type GovernedActionProviderLineage = typeof GovernedActionProviderLineage.Type\n\nconst stateMatchesLineage = (\n state: GovernedActionStateType,\n lineage: GovernedActionProviderLineage\n): boolean => {\n switch (state) {\n case \"proposed\":\n case \"authorized\":\n case \"denied\":\n case \"expired\":\n return lineage._tag === \"none\"\n case \"cancelled\":\n return lineage._tag === \"none\" || (lineage._tag === \"terminal\" && lineage.receipt.status === \"cancelled\")\n case \"started\":\n case \"cancel-requested\":\n return lineage._tag === \"none\" || lineage._tag === \"accepted\"\n case \"unknown\":\n case \"cancel-requested-unknown\":\n return lineage._tag === \"reconcilable\" || lineage._tag === \"manual\"\n case \"succeeded\":\n return lineage._tag === \"terminal\" && lineage.receipt.status === \"succeeded\"\n case \"failed\":\n return lineage._tag === \"terminal\" && lineage.receipt.status === \"failed\"\n }\n}\n\n/** Durable lifecycle state plus the exact provider identity needed for safe recovery. */\nexport const GovernedActionLifecycleHeadV1 = Schema.Struct({\n state: GovernedActionState,\n lineage: GovernedActionProviderLineage\n}).check(\n Schema.makeFilter(\n ({ lineage, state }) => stateMatchesLineage(state, lineage),\n { expected: \"governed-action state and provider lineage to agree\" }\n )\n)\n\n/** Decoded governed-action lifecycle head. */\nexport type GovernedActionLifecycleHeadV1 = typeof GovernedActionLifecycleHeadV1.Type\n\nconst providerOperationIdFromLineage = (\n lineage: GovernedActionProviderLineage\n): PluginProviderOperationId | null => {\n switch (lineage._tag) {\n case \"accepted\":\n return lineage.receipt.providerOperationId\n case \"reconcilable\":\n case \"manual\":\n return lineage.providerOperationId\n case \"none\":\n case \"terminal\":\n return null\n }\n}\n\nconst reconciliationKeyFromLineage = (\n lineage: GovernedActionProviderLineage\n): PluginActionReconciliationKey | null => {\n switch (lineage._tag) {\n case \"accepted\":\n return lineage.receipt.reconciliationKey\n case \"reconcilable\":\n return lineage.reconciliationKey\n case \"none\":\n case \"manual\":\n case \"terminal\":\n return null\n }\n}\n\nconst unknownLineage = (\n current: GovernedActionProviderLineage,\n command: Extract<GovernedActionTransitionCommand, { readonly _tag: \"recordUnknown\" }>\n): GovernedActionProviderLineage => {\n const providerOperationId = providerOperationIdFromLineage(current)\n if (command.outcome._tag === \"reconcilable\") {\n return {\n _tag: \"reconcilable\",\n providerOperationId,\n reconciliationKey: command.outcome.reconciliationKey\n }\n }\n const retainedReconciliationKey = reconciliationKeyFromLineage(current)\n return retainedReconciliationKey === null\n ? { _tag: \"manual\", providerOperationId }\n : { _tag: \"reconcilable\", providerOperationId, reconciliationKey: retainedReconciliationKey }\n}\n\nconst acceptedReceiptMatches = (\n lineage: GovernedActionProviderLineage,\n command: Extract<GovernedActionTransitionCommand, { readonly _tag: \"recordAccepted\" }>\n): boolean =>\n lineage._tag === \"none\" ||\n (lineage._tag === \"accepted\" &&\n lineage.receipt.providerOperationId === command.receipt.providerOperationId &&\n lineage.receipt.reconciliationKey === command.receipt.reconciliationKey)\n\n/** Null is the action envelope's immutable idempotency identity, never a missing provider key. */\nconst reconciliationLocatorMatches = (\n lineage: GovernedActionProviderLineage,\n reconciliationKey: PluginActionReconciliationKey | null\n): boolean =>\n reconciliationKey === null\n ? lineage._tag === \"none\" || lineage._tag === \"manual\"\n : reconciliationKeyFromLineage(lineage) === reconciliationKey\n\nconst terminalSourceMatches = (\n lineage: GovernedActionProviderLineage,\n command: Extract<\n GovernedActionTransitionCommand,\n { readonly _tag: \"recordSucceeded\" | \"recordFailed\" | \"recordCancelled\" }\n >\n): boolean => {\n const providerOperationId = providerOperationIdFromLineage(lineage)\n switch (command.source._tag) {\n case \"direct\":\n return lineage._tag === \"none\"\n case \"providerOperation\":\n return providerOperationId !== null &&\n command.source.providerOperationId === providerOperationId &&\n command.receipt.providerOperationId === providerOperationId\n case \"reconciliation\":\n return reconciliationLocatorMatches(lineage, command.source.reconciliationKey) &&\n (providerOperationId === null || command.receipt.providerOperationId === providerOperationId)\n }\n}\n\nconst reconciliationPendingMatches = (\n lineage: GovernedActionProviderLineage,\n command: Extract<GovernedActionTransitionCommand, { readonly _tag: \"reconciliationPending\" }>\n): boolean => reconciliationLocatorMatches(lineage, command.reconciliationKey)\n\n/**\n * Advance a durable lifecycle head while retaining and matching opaque provider identity.\n * A null result rejects illegal edges, fabricated locators, and unrelated receipts.\n */\nexport const advanceGovernedActionLifecycle = (\n current: GovernedActionLifecycleHeadV1 | null,\n command: GovernedActionTransitionCommand\n): GovernedActionLifecycleHeadV1 | null => {\n const nextState = reduceGovernedActionState(current?.state ?? null, command)\n if (nextState === null) return null\n const currentLineage: GovernedActionProviderLineage = current?.lineage ?? { _tag: \"none\" }\n\n switch (command._tag) {\n case \"recordAccepted\":\n return acceptedReceiptMatches(currentLineage, command)\n ? { state: nextState, lineage: { _tag: \"accepted\", receipt: command.receipt } }\n : null\n case \"recordUnknown\":\n return { state: nextState, lineage: unknownLineage(currentLineage, command) }\n case \"recordSucceeded\":\n case \"recordFailed\":\n case \"recordCancelled\":\n return terminalSourceMatches(currentLineage, command)\n ? { state: nextState, lineage: { _tag: \"terminal\", receipt: command.receipt } }\n : null\n case \"reconciliationPending\":\n return reconciliationPendingMatches(currentLineage, command)\n ? { state: nextState, lineage: currentLineage }\n : null\n case \"propose\":\n case \"authorize\":\n case \"deny\":\n case \"expire\":\n case \"cancel\":\n case \"start\":\n case \"requestCancellation\":\n return { state: nextState, lineage: currentLineage }\n }\n}\n","import * as Schema from \"effect/Schema\"\n\nimport { Actor } from \"./actors.js\"\nimport { LedgerRevision } from \"./deliveryGraph.js\"\nimport {\n EnvironmentId,\n RelationshipId,\n RelationshipRepairProposalId,\n RelationshipRepairReviewId,\n ReleaseId,\n SessionId,\n WorkspaceId\n} from \"./identifiers.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\n/** Explicit decision proposed for an incomplete delivery relationship. */\nexport const RelationshipRepairDisposition = Schema.Literals([\"link\", \"verify\", \"reject\"])\n\n/** Decoded relationship-repair disposition. */\nexport type RelationshipRepairDisposition = typeof RelationshipRepairDisposition.Type\n\n/** Bounded human-readable justification stored with a repair proposal. */\nexport const RelationshipRepairRationale = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(1_000)\n).annotate({ identifier: \"RelationshipRepairRationale\" })\n\n/** Decoded relationship-repair rationale. */\nexport type RelationshipRepairRationale = typeof RelationshipRepairRationale.Type\n\n/** Authenticated origin retained for proposal review and later audit. */\nexport const RelationshipRepairProposalOrigin = Schema.Struct({\n actor: Actor,\n sessionId: SessionId\n})\n\n/** Decoded relationship-repair proposal origin. */\nexport type RelationshipRepairProposalOrigin = typeof RelationshipRepairProposalOrigin.Type\n\n/** Final reviewer decision over one exact proposal. */\nexport const RelationshipRepairReviewDecision = Schema.Literals([\"approved\", \"rejected\"])\n\n/** Decoded relationship-repair review decision. */\nexport type RelationshipRepairReviewDecision = typeof RelationshipRepairReviewDecision.Type\n\n/** Immutable review evidence retained with a finalized proposal. */\nexport const RelationshipRepairReview = Schema.Struct({\n reviewId: RelationshipRepairReviewId,\n decision: RelationshipRepairReviewDecision,\n rationale: RelationshipRepairRationale,\n origin: RelationshipRepairProposalOrigin,\n reviewedAt: UtcTimestamp\n}).annotate({ identifier: \"RelationshipRepairReview\" })\n\n/** Decoded relationship-repair review. */\nexport type RelationshipRepairReview = typeof RelationshipRepairReview.Type\n\n/** Immutable evidence that one approved proposal appended an exact ledger revision. */\nexport const RelationshipRepairApplication = Schema.Struct({\n proposalId: RelationshipRepairProposalId,\n relationshipId: RelationshipId,\n appliedRevision: LedgerRevision,\n origin: RelationshipRepairProposalOrigin,\n appliedAt: UtcTimestamp\n}).annotate({ identifier: \"RelationshipRepairApplication\" })\n\n/** Decoded relationship-repair application evidence. */\nexport type RelationshipRepairApplication = typeof RelationshipRepairApplication.Type\n\n/** Durable proposal bound to one exact immutable relationship revision. */\nexport const RelationshipRepairProposal = Schema.Struct({\n schemaVersion: Schema.Literal(2),\n proposalId: RelationshipRepairProposalId,\n workspaceId: WorkspaceId,\n releaseId: ReleaseId,\n environmentId: Schema.NullOr(EnvironmentId),\n relationshipId: RelationshipId,\n expectedRevision: LedgerRevision,\n disposition: RelationshipRepairDisposition,\n rationale: RelationshipRepairRationale,\n origin: RelationshipRepairProposalOrigin,\n status: Schema.Literals([\"pending\", \"approved\", \"rejected\"]),\n proposedAt: UtcTimestamp,\n review: Schema.NullOr(RelationshipRepairReview)\n}).annotate({ identifier: \"RelationshipRepairProposal\" })\n\n/** Decoded durable relationship-repair proposal. */\nexport type RelationshipRepairProposal = typeof RelationshipRepairProposal.Type\n","import * as Schema from \"effect/Schema\"\n\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\n/** Actor classes that can contribute durable activity to a workspace Timeline. */\nexport const TimelineActorKind = Schema.Literals([\"agent\", \"human\", \"plugin\", \"system\"])\n\n/** Decoded Timeline actor class. */\nexport type TimelineActorKind = typeof TimelineActorKind.Type\n\n/** Durable source streams merged by the Timeline projection. */\nexport const TimelineSourceKind = Schema.Literals([\"action\", \"plugin-sync\", \"relationship\", \"system\"])\n\n/** Decoded Timeline source stream. */\nexport type TimelineSourceKind = typeof TimelineSourceKind.Type\n\n/** Connected provider identity retained when a durable event has provenance. */\nexport const TimelineService = Schema.Literals([\"codecommit\", \"codepipeline\", \"jira\", \"confluence\", \"clockify\"])\n\n/** Decoded connected provider identity. */\nexport type TimelineService = typeof TimelineService.Type\n\n/** Stable cursor for newest-first Timeline pagination. */\nexport const TimelineCursor = Schema.Struct({\n eventKey: Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(1_024)),\n occurredAt: UtcTimestamp\n}).annotate({ identifier: \"TimelineCursor\" })\n\n/** Decoded stable Timeline cursor. */\nexport type TimelineCursor = typeof TimelineCursor.Type\n\n/** Default-redacted, human-readable event from one durable workspace source. */\nexport const TimelineEvent = Schema.Struct({\n eventKey: TimelineCursor.fields.eventKey,\n occurredAt: UtcTimestamp,\n actor: Schema.Struct({\n kind: TimelineActorKind,\n label: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(200))\n }),\n sourceKind: TimelineSourceKind,\n service: Schema.NullOr(TimelineService),\n eventType: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(200)),\n title: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(300)),\n href: Schema.NullOr(Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(2_048)))\n}).annotate({ identifier: \"TimelineEvent\" })\n\n/** Decoded Timeline event. */\nexport type TimelineEvent = typeof TimelineEvent.Type\n\nconst TimelineRawIdentifier = Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(2_048))\n\n/** Owner-visible durable identifiers for one exact Timeline event. */\nexport const TimelineEventIdentifiers = Schema.Struct({\n actorId: Schema.NullOr(TimelineRawIdentifier),\n actionId: Schema.NullOr(TimelineRawIdentifier),\n relationshipId: Schema.NullOr(TimelineRawIdentifier),\n pluginConnectionId: Schema.NullOr(TimelineRawIdentifier),\n releaseId: Schema.NullOr(TimelineRawIdentifier),\n entityId: Schema.NullOr(TimelineRawIdentifier)\n}).annotate({ identifier: \"TimelineEventIdentifiers\" })\n\n/** Decoded owner-visible Timeline identifiers. */\nexport type TimelineEventIdentifiers = typeof TimelineEventIdentifiers.Type\n\n/** Owner-visible reference to the local agent job attributable to an event. */\nexport const TimelineAgentJobDetail = Schema.Struct({\n jobId: TimelineRawIdentifier\n}).annotate({ identifier: \"TimelineAgentJobDetail\" })\n\n/** Decoded Timeline agent-job reference. */\nexport type TimelineAgentJobDetail = typeof TimelineAgentJobDetail.Type\n\n/** Deliberate owner-only expansion of one otherwise redacted Timeline event. */\nexport const TimelineEventDetail = Schema.Struct({\n event: TimelineEvent,\n identifiers: TimelineEventIdentifiers,\n agentJob: Schema.NullOr(TimelineAgentJobDetail)\n}).annotate({ identifier: \"TimelineEventDetail\" })\n\n/** Decoded owner-only Timeline event expansion. */\nexport type TimelineEventDetail = typeof TimelineEventDetail.Type\n\n/** One bounded Timeline page. */\nexport const TimelinePage = Schema.Struct({\n events: Schema.Array(TimelineEvent).check(\n Schema.makeFilter((events) => events.length <= 100, { expected: \"at most 100 Timeline events\" })\n ),\n nextCursor: Schema.NullOr(TimelineCursor)\n}).annotate({ identifier: \"TimelinePage\" })\n\n/** Decoded bounded Timeline page. */\nexport type TimelinePage = typeof TimelinePage.Type\n","import * as Effect from \"effect/Effect\"\nimport * as Schema from \"effect/Schema\"\nimport { HttpApiEndpoint, HttpApiGroup } from \"effect/unstable/httpapi\"\n\nimport { PersonSourceIdentity, Role } from \"../domain/actors.js\"\nimport {\n DeliveryEntityKind,\n DeliveryEntityProjection,\n DeliveryEntityService,\n DeliveryEntityStatusGroup,\n DeliveryNode,\n DeliveryRelationship,\n EvidenceClaim,\n EvidenceItem,\n LedgerRevision\n} from \"../domain/deliveryGraph.js\"\nimport { Freshness } from \"../domain/freshness.js\"\nimport { GovernedActionState } from \"../domain/governedAction/index.js\"\nimport {\n EntityId,\n EnvironmentId,\n EvidenceId,\n GovernedActionId,\n PersonId,\n RelationshipId,\n RelationshipRepairProposalId,\n RelationshipRepairReviewId,\n ReleaseId\n} from \"../domain/identifiers.js\"\nimport {\n RelationshipRepairApplication,\n RelationshipRepairDisposition,\n RelationshipRepairProposal,\n RelationshipRepairRationale,\n RelationshipRepairReviewDecision\n} from \"../domain/relationshipRepair.js\"\nimport { Revision, SourceRevision } from \"../domain/sourceRevision.js\"\nimport { TimelineEvent } from \"../domain/timeline.js\"\nimport { UtcTimestamp } from \"../domain/utcTimestamp.js\"\nimport {\n ConflictApiError,\n ForbiddenApiError,\n InvalidRequestApiError,\n NotFoundApiError,\n PayloadTooLargeApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError,\n UnauthorizedApiError\n} from \"./errors.js\"\nimport { SessionCookieAuth, SessionMutationAuth } from \"./session.js\"\nimport { CanonicalNonNegativeIntegerFromString } from \"./wire.js\"\n\nexport const MAXIMUM_RELEASE_SLICE_RECORDS = 500\nexport const MAXIMUM_WORKSPACE_ENTITY_PROJECTIONS = 500\nexport const MAXIMUM_WORKSPACE_ENTITY_RELEASES = 500\nexport const MAXIMUM_WORKSPACE_ENTITY_OWNERS = 20\nexport const MAXIMUM_WORKSPACE_OWNER_OPTIONS = 200\nexport const MAXIMUM_WORKSPACE_OWNER_ROLES = 16\nexport const MAXIMUM_WORKSPACE_ENTITY_RELATIONSHIPS = 100\nexport const MAXIMUM_WORKSPACE_ENTITY_ACTIVITY = 20\nconst MAXIMUM_RELATIONSHIP_HISTORY = 200\nconst MAXIMUM_EVIDENCE_CLAIMS = 200\nexport const MAXIMUM_REPAIR_PROPOSALS = 128\n\nconst boundedArray = <T, E, RD, RE>(schema: Schema.Codec<T, E, RD, RE>, maximum: number) =>\n Schema.Array(schema).check(Schema.isMaxLength(maximum))\n\n/** One persisted entity projection with its ledger observation time. */\nexport const InspectedEntityProjection = Schema.Struct({\n projection: DeliveryEntityProjection,\n recordedAt: UtcTimestamp\n}).annotate({ identifier: \"InspectedEntityProjection\" })\n\n/** Bounded deterministic graph prefix; `truncated` explicitly reports incomplete material. */\nexport const ReleaseDeliveryGraphInspection = Schema.Struct({\n releaseId: ReleaseId,\n environmentId: Schema.NullOr(EnvironmentId),\n truncated: Schema.Boolean,\n nodes: boundedArray(DeliveryNode, MAXIMUM_RELEASE_SLICE_RECORDS),\n entityProjections: boundedArray(InspectedEntityProjection, MAXIMUM_RELEASE_SLICE_RECORDS),\n relationships: boundedArray(DeliveryRelationship, MAXIMUM_RELEASE_SLICE_RECORDS),\n evidenceClaims: boundedArray(EvidenceClaim, MAXIMUM_RELEASE_SLICE_RECORDS),\n evidenceItems: boundedArray(EvidenceItem, MAXIMUM_RELEASE_SLICE_RECORDS)\n}).annotate({ identifier: \"ReleaseDeliveryGraphInspection\" })\n\n/** Decoded release delivery-graph inspection. */\nexport type ReleaseDeliveryGraphInspection = typeof ReleaseDeliveryGraphInspection.Type\n\nconst WorkspaceEntityReleaseIds = Schema.Array(ReleaseId).check(\n Schema.isUnique(),\n Schema.isMaxLength(MAXIMUM_WORKSPACE_ENTITY_RELEASES),\n Schema.makeFilter(\n (releaseIds) =>\n releaseIds.every((releaseId, index) => {\n const previous = releaseIds[index - 1]\n return index === 0 || (previous !== undefined && previous < releaseId)\n }),\n { expected: \"sorted workspace entity release identifiers\" }\n )\n)\n\n/** Compact canonical human identity assigned to one current workspace entity. */\nexport const WorkspaceEntityOwner = Schema.Struct({\n avatarFallback: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(4)),\n displayName: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(200)),\n personId: PersonId,\n roles: boundedArray(Role, MAXIMUM_WORKSPACE_OWNER_ROLES).check(Schema.isMinLength(1)),\n sourceIdentities: Schema.optionalKey(boundedArray(PersonSourceIdentity, MAXIMUM_WORKSPACE_OWNER_ROLES))\n}).annotate({ identifier: \"WorkspaceEntityOwner\" })\n\n/** Decoded entity owner identity. */\nexport type WorkspaceEntityOwner = typeof WorkspaceEntityOwner.Type\n\nconst WorkspaceEntityOwners = boundedArray(WorkspaceEntityOwner, MAXIMUM_WORKSPACE_ENTITY_OWNERS)\nconst WorkspaceOwnerOptions = boundedArray(WorkspaceEntityOwner, MAXIMUM_WORKSPACE_OWNER_OPTIONS)\n\n/** One current workspace entity projection and every bounded current release membership. */\nexport const WorkspaceEntityProjection = Schema.Struct({\n canonicalReleaseId: Schema.NullOr(ReleaseId),\n owners: WorkspaceEntityOwners,\n ownersTruncated: Schema.Boolean,\n releaseIds: WorkspaceEntityReleaseIds,\n releaseMembershipsTruncated: Schema.Boolean,\n projection: DeliveryEntityProjection,\n recordedAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ canonicalReleaseId, releaseIds }) => canonicalReleaseId === (releaseIds[0] ?? null),\n { expected: \"canonical release identifier to be the first current release membership\" }\n ),\n Schema.makeFilter(\n ({ releaseIds, releaseMembershipsTruncated }) =>\n !releaseMembershipsTruncated || releaseIds.length === MAXIMUM_WORKSPACE_ENTITY_RELEASES,\n { expected: \"truncated workspace release memberships to contain the complete bounded prefix\" }\n ),\n Schema.makeFilter(\n ({ owners, ownersTruncated }) => !ownersTruncated || owners.length === MAXIMUM_WORKSPACE_ENTITY_OWNERS,\n { expected: \"truncated workspace owners to contain the complete bounded prefix\" }\n )\n).annotate({ identifier: \"WorkspaceEntityProjection\" })\n\n/** Bounded workspace-wide index of current present normalized entities. */\nexport const WorkspaceEntityProjectionIndex = Schema.Struct({\n matchedCount: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n ownerOptions: WorkspaceOwnerOptions,\n ownerOptionsTruncated: Schema.Boolean,\n totalCount: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n truncated: Schema.Boolean,\n items: boundedArray(WorkspaceEntityProjection, MAXIMUM_WORKSPACE_ENTITY_PROJECTIONS)\n}).check(\n Schema.makeFilter(\n ({ ownerOptions, ownerOptionsTruncated }) =>\n !ownerOptionsTruncated || ownerOptions.length === MAXIMUM_WORKSPACE_OWNER_OPTIONS,\n { expected: \"truncated workspace owner options to contain the complete bounded prefix\" }\n )\n).annotate({ identifier: \"WorkspaceEntityProjectionIndex\" })\n\n/** Decoded workspace-wide current entity index. */\nexport type WorkspaceEntityProjectionIndex = typeof WorkspaceEntityProjectionIndex.Type\n\n/** Complete bounded graph closure surrounding one exact normalized entity. */\nexport const WorkspaceEntityGraph = Schema.Struct({\n truncated: Schema.Boolean,\n nodes: boundedArray(DeliveryNode, MAXIMUM_WORKSPACE_ENTITY_RELATIONSHIPS * 2),\n relatedEntityProjections: boundedArray(\n InspectedEntityProjection,\n MAXIMUM_WORKSPACE_ENTITY_RELATIONSHIPS\n ),\n relationships: boundedArray(DeliveryRelationship, MAXIMUM_WORKSPACE_ENTITY_RELATIONSHIPS),\n evidenceClaims: boundedArray(EvidenceClaim, MAXIMUM_WORKSPACE_ENTITY_RELATIONSHIPS * 2),\n evidenceItems: boundedArray(EvidenceItem, MAXIMUM_WORKSPACE_ENTITY_RELATIONSHIPS * 2)\n}).annotate({ identifier: \"WorkspaceEntityGraph\" })\n\n/** Decoded exact entity graph closure. */\nexport type WorkspaceEntityGraph = typeof WorkspaceEntityGraph.Type\n\n/** Bounded attributable activity for one exact normalized entity. */\nexport const WorkspaceEntityActivity = Schema.Struct({\n truncated: Schema.Boolean,\n events: boundedArray(TimelineEvent, MAXIMUM_WORKSPACE_ENTITY_ACTIVITY)\n}).annotate({ identifier: \"WorkspaceEntityActivity\" })\n\n/** Decoded exact entity activity. */\nexport type WorkspaceEntityActivity = typeof WorkspaceEntityActivity.Type\n\n/** Current revision-scoped Control Center approval for a Clockify entry. */\nexport const ClockifyApproval = Schema.Struct({\n actionId: GovernedActionId,\n decision: Schema.Literals([\"approved\", \"rejected\"]),\n rationale: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(1_000)),\n decidedAt: UtcTimestamp\n}).annotate({ identifier: \"ClockifyApproval\" })\n\n/** Decoded browser-safe Clockify approval projection. */\nexport type ClockifyApproval = typeof ClockifyApproval.Type\n\n/** Canonical provider-neutral full-page read model for one workspace entity. */\nexport const WorkspaceEntityInspection = Schema.Struct({\n entity: WorkspaceEntityProjection,\n source: SourceRevision,\n isSourceCurrent: Schema.Boolean,\n sourceActionsAvailable: Schema.Boolean.pipe(\n Schema.withDecodingDefaultTypeKey(Effect.succeed(false))\n ),\n freshness: Schema.NullOr(Freshness),\n clockifyApproval: Schema.NullOr(ClockifyApproval).pipe(\n Schema.withDecodingDefaultTypeKey(Effect.succeed(null))\n ),\n graph: WorkspaceEntityGraph,\n activity: WorkspaceEntityActivity\n}).annotate({ identifier: \"WorkspaceEntityInspection\" })\n\n/** Decoded canonical workspace entity read model. */\nexport type WorkspaceEntityInspection = typeof WorkspaceEntityInspection.Type\n\n/** Bounded immutable lifecycle history for one relationship, newest first. */\nexport const RelationshipHistoryInspection = Schema.Struct({\n relationshipId: RelationshipId,\n revisions: boundedArray(DeliveryRelationship, MAXIMUM_RELATIONSHIP_HISTORY)\n}).annotate({ identifier: \"RelationshipHistoryInspection\" })\n\n/** Decoded relationship lifecycle history. */\nexport type RelationshipHistoryInspection = typeof RelationshipHistoryInspection.Type\n\n/** One immutable evidence item and every bounded claim attributed to it. */\nexport const EvidenceInspection = Schema.Struct({\n evidence: EvidenceItem,\n claims: boundedArray(EvidenceClaim, MAXIMUM_EVIDENCE_CLAIMS)\n}).annotate({ identifier: \"EvidenceInspection\" })\n\n/** Decoded evidence inspection. */\nexport type EvidenceInspection = typeof EvidenceInspection.Type\n\n/** Read-only repair suggestion derived from one current incomplete relationship. */\nexport const RelationshipRepairCandidate = Schema.Struct({\n relationship: DeliveryRelationship,\n suggestedDisposition: Schema.Literals([\"link\", \"verify\", \"reject\"]),\n explanation: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(1_000)),\n impact: Schema.Struct({\n releaseId: ReleaseId,\n environmentId: Schema.NullOr(EnvironmentId)\n }),\n requiredPermission: Schema.Literal(\"workspace-owner\")\n}).annotate({ identifier: \"RelationshipRepairCandidate\" })\n\n/** Decoded read-only relationship repair suggestion. */\nexport type RelationshipRepairCandidate = typeof RelationshipRepairCandidate.Type\n\n/** Bounded candidate discovery result; discovery never mutates the relationship ledger. */\nexport const RelationshipRepairCandidates = Schema.Struct({\n releaseId: ReleaseId,\n environmentId: Schema.NullOr(EnvironmentId),\n truncated: Schema.Boolean,\n candidates: boundedArray(RelationshipRepairCandidate, MAXIMUM_RELEASE_SLICE_RECORDS)\n}).annotate({ identifier: \"RelationshipRepairCandidates\" })\n\n/** Decoded relationship repair candidate discovery result. */\nexport type RelationshipRepairCandidates = typeof RelationshipRepairCandidates.Type\n\n/** Non-mutating proposal input with the optimistic precondition required by a future apply step. */\nexport const RelationshipRepairProposalDraft = Schema.Struct({\n candidate: RelationshipRepairCandidate,\n precondition: Schema.Struct({\n relationshipId: RelationshipId,\n expectedRevision: LedgerRevision\n }),\n proposal: Schema.Struct({\n disposition: Schema.Literals([\"link\", \"verify\", \"reject\"]),\n rationale: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(1_000))\n })\n}).annotate({ identifier: \"RelationshipRepairProposalDraft\" })\n\n/** Decoded read-only relationship repair proposal draft. */\nexport type RelationshipRepairProposalDraft = typeof RelationshipRepairProposalDraft.Type\n\n/** Idempotent intent for creating a durable proposal from one exact repair candidate. */\nexport const CreateRelationshipRepairProposalRequest = Schema.Struct({\n proposalId: RelationshipRepairProposal.fields.proposalId,\n environmentId: RelationshipRepairProposal.fields.environmentId,\n expectedRevision: RelationshipRepairProposal.fields.expectedRevision,\n disposition: RelationshipRepairDisposition,\n rationale: RelationshipRepairRationale\n}).annotate({ identifier: \"CreateRelationshipRepairProposalRequest\" })\n\n/** Decoded relationship-repair proposal creation request. */\nexport type CreateRelationshipRepairProposalRequest = typeof CreateRelationshipRepairProposalRequest.Type\n\n/** Bounded newest-first proposal page for one release/environment scope. */\nexport const RelationshipRepairProposalList = Schema.Struct({\n releaseId: ReleaseId,\n environmentId: Schema.NullOr(EnvironmentId),\n status: Schema.NullOr(RelationshipRepairProposal.fields.status),\n truncated: Schema.Boolean,\n proposals: boundedArray(RelationshipRepairProposal, MAXIMUM_REPAIR_PROPOSALS),\n applications: boundedArray(RelationshipRepairApplication, MAXIMUM_REPAIR_PROPOSALS)\n}).annotate({ identifier: \"RelationshipRepairProposalList\" })\n\n/** Decoded bounded relationship-repair proposal page. */\nexport type RelationshipRepairProposalList = typeof RelationshipRepairProposalList.Type\n\n/** Idempotent immutable review command for one pending proposal. */\nexport const ReviewRelationshipRepairProposalRequest = Schema.Struct({\n reviewId: RelationshipRepairReviewId,\n decision: RelationshipRepairReviewDecision,\n rationale: RelationshipRepairRationale\n}).annotate({ identifier: \"ReviewRelationshipRepairProposalRequest\" })\n\n/** Decoded relationship-repair review request. */\nexport type ReviewRelationshipRepairProposalRequest = typeof ReviewRelationshipRepairProposalRequest.Type\n\n/** Applied proposal together with the immutable relationship revision it appended. */\nexport const ApplyRelationshipRepairProposalResponse = Schema.Struct({\n application: RelationshipRepairApplication,\n relationship: DeliveryRelationship\n}).annotate({ identifier: \"ApplyRelationshipRepairProposalResponse\" })\n\n/** Decoded approved-proposal application response. */\nexport type ApplyRelationshipRepairProposalResponse = typeof ApplyRelationshipRepairProposalResponse.Type\n\nconst readErrors = [\n UnauthorizedApiError,\n ForbiddenApiError,\n NotFoundApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError\n]\n\nconst releaseSlice = HttpApiEndpoint.get(\"releaseSlice\", \"/api/v1/relationships/releases/:releaseId\", {\n params: { releaseId: ReleaseId },\n query: { environmentId: Schema.optionalKey(EnvironmentId) },\n success: ReleaseDeliveryGraphInspection,\n error: readErrors\n}).middleware(SessionCookieAuth)\n\nconst workspaceEntityProjections = HttpApiEndpoint.get(\n \"workspaceEntityProjections\",\n \"/api/v1/items\",\n {\n query: {\n q: Schema.optionalKey(\n Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(200))\n ),\n owner: Schema.optionalKey(PersonId),\n service: Schema.optionalKey(DeliveryEntityService),\n status: Schema.optionalKey(DeliveryEntityStatusGroup),\n type: Schema.optionalKey(DeliveryEntityKind)\n },\n success: WorkspaceEntityProjectionIndex,\n error: readErrors\n }\n).middleware(SessionCookieAuth)\n\nconst workspaceEntity = HttpApiEndpoint.get(\"workspaceEntity\", \"/api/v1/items/:entityId\", {\n params: { entityId: EntityId },\n success: WorkspaceEntityInspection,\n error: readErrors\n}).middleware(SessionCookieAuth)\n\n/** Human-confirmed governed action against one exact Clockify source revision. */\nexport const SubmitClockifyActionRequest = Schema.TaggedUnion({\n \"correct-association\": {\n expectedRevision: Revision,\n jiraIssueKey: Schema.String.check(\n Schema.isTrimmed(),\n Schema.isPattern(/^[A-Z][A-Z0-9]*-[1-9][0-9]*$/u),\n Schema.isMaxLength(100)\n )\n },\n \"record-approval\": {\n expectedRevision: Revision,\n decision: Schema.Literals([\"approved\", \"rejected\"]),\n rationale: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(1_000))\n }\n})\nexport type SubmitClockifyActionRequest = typeof SubmitClockifyActionRequest.Type\n\n/** Durable identity and resulting lifecycle state of a submitted Clockify action. */\nexport const SubmitClockifyActionResponse = Schema.Struct({\n actionId: GovernedActionId,\n state: GovernedActionState\n})\nexport type SubmitClockifyActionResponse = typeof SubmitClockifyActionResponse.Type\n\nconst submitClockifyAction = HttpApiEndpoint.post(\n \"submitClockifyAction\",\n \"/api/v1/items/:entityId/clockify-actions\",\n {\n params: { entityId: EntityId },\n payload: SubmitClockifyActionRequest,\n success: SubmitClockifyActionResponse,\n error: [\n ...readErrors,\n InvalidRequestApiError,\n ConflictApiError\n ]\n }\n)\n .middleware(SessionCookieAuth)\n .middleware(SessionMutationAuth)\n\nconst relationship = HttpApiEndpoint.get(\"relationship\", \"/api/v1/relationships/:relationshipId\", {\n params: { relationshipId: RelationshipId },\n query: {\n revision: Schema.optionalKey(CanonicalNonNegativeIntegerFromString.pipe(Schema.decodeTo(LedgerRevision)))\n },\n success: DeliveryRelationship,\n error: readErrors\n}).middleware(SessionCookieAuth)\n\nconst repairCandidates = HttpApiEndpoint.get(\n \"repairCandidates\",\n \"/api/v1/relationships/releases/:releaseId/repair-candidates\",\n {\n params: { releaseId: ReleaseId },\n query: { environmentId: Schema.optionalKey(EnvironmentId) },\n success: RelationshipRepairCandidates,\n error: readErrors\n }\n).middleware(SessionCookieAuth)\n\nconst repairProposalDraft = HttpApiEndpoint.get(\n \"repairProposalDraft\",\n \"/api/v1/relationships/releases/:releaseId/repair-candidates/:relationshipId/proposal-draft\",\n {\n params: { releaseId: ReleaseId, relationshipId: RelationshipId },\n query: {\n environmentId: Schema.optionalKey(EnvironmentId),\n revision: CanonicalNonNegativeIntegerFromString.pipe(Schema.decodeTo(LedgerRevision))\n },\n success: RelationshipRepairProposalDraft,\n error: readErrors\n }\n).middleware(SessionCookieAuth)\n\nconst createRepairProposal = HttpApiEndpoint.post(\n \"createRepairProposal\",\n \"/api/v1/relationships/releases/:releaseId/repair-candidates/:relationshipId/proposals\",\n {\n params: { releaseId: ReleaseId, relationshipId: RelationshipId },\n payload: CreateRelationshipRepairProposalRequest,\n success: RelationshipRepairProposal,\n error: [\n ...readErrors,\n InvalidRequestApiError,\n ConflictApiError,\n PayloadTooLargeApiError\n ]\n }\n)\n .middleware(SessionCookieAuth)\n .middleware(SessionMutationAuth)\n\nconst listRepairProposals = HttpApiEndpoint.get(\n \"listRepairProposals\",\n \"/api/v1/relationships/releases/:releaseId/repair-proposals\",\n {\n params: { releaseId: ReleaseId },\n query: {\n environmentId: Schema.optionalKey(EnvironmentId),\n status: Schema.optionalKey(RelationshipRepairProposal.fields.status)\n },\n success: RelationshipRepairProposalList,\n error: readErrors\n }\n).middleware(SessionCookieAuth)\n\nconst getRepairProposal = HttpApiEndpoint.get(\n \"getRepairProposal\",\n \"/api/v1/relationships/repair-proposals/:proposalId\",\n {\n params: { proposalId: RelationshipRepairProposalId },\n success: RelationshipRepairProposal,\n error: readErrors\n }\n).middleware(SessionCookieAuth)\n\nconst reviewRepairProposal = HttpApiEndpoint.post(\n \"reviewRepairProposal\",\n \"/api/v1/relationships/repair-proposals/:proposalId/reviews\",\n {\n params: { proposalId: RelationshipRepairProposalId },\n payload: ReviewRelationshipRepairProposalRequest,\n success: RelationshipRepairProposal,\n error: [\n ...readErrors,\n InvalidRequestApiError,\n ConflictApiError,\n PayloadTooLargeApiError\n ]\n }\n)\n .middleware(SessionCookieAuth)\n .middleware(SessionMutationAuth)\n\nconst applyRepairProposal = HttpApiEndpoint.post(\n \"applyRepairProposal\",\n \"/api/v1/relationships/repair-proposals/:proposalId/applications\",\n {\n params: { proposalId: RelationshipRepairProposalId },\n success: ApplyRelationshipRepairProposalResponse,\n error: [\n ...readErrors,\n InvalidRequestApiError,\n ConflictApiError\n ]\n }\n)\n .middleware(SessionCookieAuth)\n .middleware(SessionMutationAuth)\n\nconst relationshipHistory = HttpApiEndpoint.get(\n \"relationshipHistory\",\n \"/api/v1/relationships/:relationshipId/history\",\n {\n params: { relationshipId: RelationshipId },\n success: RelationshipHistoryInspection,\n error: readErrors\n }\n).middleware(SessionCookieAuth)\n\nconst evidence = HttpApiEndpoint.get(\"evidence\", \"/api/v1/evidence/:evidenceId\", {\n params: { evidenceId: EvidenceId },\n success: EvidenceInspection,\n error: readErrors\n}).middleware(SessionCookieAuth)\n\n/** Authenticated, workspace-safe delivery relationship and evidence inspection. */\nexport class DeliveryGraphApiGroup extends HttpApiGroup.make(\"deliveryGraph\")\n .add(\n workspaceEntityProjections,\n workspaceEntity,\n submitClockifyAction,\n releaseSlice,\n repairCandidates,\n repairProposalDraft,\n createRepairProposal,\n listRepairProposals,\n getRepairProposal,\n reviewRepairProposal,\n applyRepairProposal,\n relationship,\n relationshipHistory,\n evidence\n )\n{}\n","import * as Schema from \"effect/Schema\"\nimport { HttpApiEndpoint, HttpApiGroup } from \"effect/unstable/httpapi\"\n\nimport { PluginConnectionId } from \"../domain/identifiers.js\"\nimport { PluginDiffInventoryEntryV1 } from \"../domain/plugins/events.js\"\nimport { Revision, VendorImmutableId } from \"../domain/sourceRevision.js\"\nimport {\n ConflictApiError,\n ForbiddenApiError,\n InvalidRequestApiError,\n NotFoundApiError,\n PayloadTooLargeApiError,\n RateLimitedApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError,\n UnauthorizedApiError\n} from \"./errors.js\"\nimport { SessionCookieAuth } from \"./session.js\"\n\nconst MaximumCompleteDiffFiles = 500\n\n/** Lowercase SHA-256 digest of canonical exact-revision diff-file identity. */\nexport const DiffFileAnchor = Schema.String.check(\n Schema.isPattern(/^sha256:[0-9a-f]{64}$/u, { expected: \"a lowercase SHA-256 diff-file anchor\" })\n).pipe(Schema.brand(\"DiffFileAnchor\"))\n\n/** Decoded stable diff-file anchor. */\nexport type DiffFileAnchor = typeof DiffFileAnchor.Type\n\n/** One file from a completely indexed immutable pull-request revision. */\nexport const CompleteDiffInventoryEntry = Schema.Struct({\n ...PluginDiffInventoryEntryV1.fields,\n anchor: DiffFileAnchor\n}).annotate({ identifier: \"CompleteDiffInventoryEntry\" })\n\n/** Decoded complete-inventory entry. */\nexport type CompleteDiffInventoryEntry = typeof CompleteDiffInventoryEntry.Type\n\n/** Complete bounded inventory; `ready` is emitted only after pagination ends. */\nexport const CompleteDiffInventory = Schema.Struct({\n entries: Schema.Array(CompleteDiffInventoryEntry).check(\n Schema.makeFilter((entries) => entries.length <= MaximumCompleteDiffFiles, {\n expected: `at most ${MaximumCompleteDiffFiles} changed files`\n })\n ),\n ready: Schema.Literal(true)\n}).annotate({ identifier: \"CompleteDiffInventory\" })\n\n/** Decoded complete immutable inventory. */\nexport type CompleteDiffInventory = typeof CompleteDiffInventory.Type\n\nconst BoundedOffset = Schema.Int.pipe(\n Schema.check(Schema.isGreaterThanOrEqualTo(0)),\n Schema.check(Schema.isLessThanOrEqualTo(1_048_576))\n)\nconst BoundedLength = Schema.Int.pipe(\n Schema.check(Schema.isBetween({ minimum: 1, maximum: 1_048_576 }))\n)\nconst DiffPath = PluginDiffInventoryEntryV1.fields.path\n\n/** Browser-safe lazy content result for one immutable side and range. */\nexport const CompleteDiffContentRange = Schema.Struct({\n bytesBase64: Schema.NullOr(Schema.String.check(Schema.isMaxLength(1_398_104))),\n totalBytes: Schema.NullOr(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n unavailableReason: Schema.NullOr(\n Schema.Literals([\"binary\", \"generated\", \"oversized\", \"missing\", \"provider-unavailable\"])\n )\n})\n .check(\n Schema.makeFilter(\n ({ bytesBase64, totalBytes, unavailableReason }) =>\n unavailableReason === null ? bytesBase64 !== null && totalBytes !== null : bytesBase64 === null,\n { expected: \"available bounded content or an explicit unavailable reason\" }\n )\n )\n .annotate({ identifier: \"CompleteDiffContentRange\" })\n\n/** Decoded lazy content response. */\nexport type CompleteDiffContentRange = typeof CompleteDiffContentRange.Type\n\nconst diffReadErrors = [\n InvalidRequestApiError,\n UnauthorizedApiError,\n ForbiddenApiError,\n NotFoundApiError,\n ConflictApiError,\n RateLimitedApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError\n]\n\nconst inventory = HttpApiEndpoint.get(\"inventory\", \"/:pluginConnectionId/pull-requests/:vendorImmutableId/inventory\", {\n params: Schema.Struct({ pluginConnectionId: PluginConnectionId, vendorImmutableId: VendorImmutableId }),\n query: Schema.Struct({ revision: Revision }),\n success: CompleteDiffInventory,\n error: diffReadErrors\n}).middleware(SessionCookieAuth)\n\nexport const CompleteDiffContentRequest = Schema.Struct({\n revision: Revision,\n anchor: DiffFileAnchor,\n path: DiffPath,\n previousPath: Schema.NullOr(DiffPath),\n status: PluginDiffInventoryEntryV1.fields.status,\n side: Schema.Literals([\"before\", \"after\"]),\n offset: BoundedOffset,\n length: BoundedLength\n}).annotate({ identifier: \"CompleteDiffContentRequest\" })\n\n/** Decoded bounded content-read payload. */\nexport type CompleteDiffContentRequest = typeof CompleteDiffContentRequest.Type\n\nconst content = HttpApiEndpoint.post(\"content\", \"/:pluginConnectionId/pull-requests/:vendorImmutableId/content\", {\n params: Schema.Struct({ pluginConnectionId: PluginConnectionId, vendorImmutableId: VendorImmutableId }),\n payload: CompleteDiffContentRequest,\n success: CompleteDiffContentRange,\n error: [...diffReadErrors, PayloadTooLargeApiError]\n}).middleware(SessionCookieAuth)\n\n/** Authenticated, workspace-scoped, bounded complete-diff reads. */\nexport class DiffApiGroup extends HttpApiGroup.make(\"diff\").add(inventory).add(content).prefix(\"/api/v1/diffs\") {}\n","import * as Schema from \"effect/Schema\"\nimport { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from \"effect/unstable/httpapi\"\n\nimport { PortfolioInvalidatedEventV1 } from \"../domain/domainEvent.js\"\nimport { EventCursor } from \"../domain/identifiers.js\"\nimport { UtcTimestamp } from \"../domain/utcTimestamp.js\"\nimport {\n ForbiddenApiError,\n InvalidRequestApiError,\n RateLimitedApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError,\n UnauthorizedApiError\n} from \"./errors.js\"\nimport { PortfolioSnapshot } from \"./portfolio.js\"\nimport { SessionCookieAuth } from \"./session.js\"\nimport { CanonicalNonNegativeIntegerFromString } from \"./wire.js\"\n\n/** URL/header representation of a nonnegative workspace event cursor. */\nexport const EventCursorFromString = CanonicalNonNegativeIntegerFromString.pipe(Schema.decodeTo(EventCursor))\n\n/** Replay boundary telling a client to replace local state with an authoritative snapshot. */\nexport const StreamResetRequired = Schema.Struct({\n reason: Schema.Literals([\"retention\", \"cursor-ahead\", \"gap\", \"replay-budget\"]),\n requestedCursor: EventCursor,\n headCursor: EventCursor,\n prunedThroughCursor: EventCursor\n}).annotate({ identifier: \"StreamResetRequired\" })\n\n/** Decoded reset instruction carried by the live event stream. */\nexport type StreamResetRequired = typeof StreamResetRequired.Type\n\n/** Keepalive payload that reports the latest durable cursor without advancing EventSource state. */\nexport const StreamHeartbeat = Schema.Struct({\n eventCursor: EventCursor,\n sentAt: UtcTimestamp\n}).annotate({ identifier: \"StreamHeartbeat\" })\n\n/** Decoded keepalive payload carried by the live event stream. */\nexport type StreamHeartbeat = typeof StreamHeartbeat.Type\n\n/** Authoritative portfolio replacement emitted first and after replay reset. */\nexport const PortfolioSnapshotLiveEvent = Schema.Struct({\n id: EventCursorFromString,\n event: Schema.Literal(\"portfolio.snapshot\"),\n data: Schema.fromJsonString(PortfolioSnapshot)\n}).annotate({ identifier: \"PortfolioSnapshotLiveEvent\" })\n\n/** Decoded authoritative portfolio stream event. */\nexport type PortfolioSnapshotLiveEvent = typeof PortfolioSnapshotLiveEvent.Type\n\n/** Durable notification that a browser should refresh its portfolio projection. */\nexport const PortfolioInvalidatedLiveEvent = Schema.Struct({\n id: EventCursorFromString,\n event: Schema.Literal(\"portfolio.invalidated\"),\n data: Schema.fromJsonString(PortfolioInvalidatedEventV1)\n}).annotate({ identifier: \"PortfolioInvalidatedLiveEvent\" })\n\n/** Decoded portfolio invalidation stream event. */\nexport type PortfolioInvalidatedLiveEvent = typeof PortfolioInvalidatedLiveEvent.Type\n\n/** Replay-gap instruction; it deliberately has no SSE ID so it cannot advance resume state. */\nexport const StreamResetRequiredLiveEvent = Schema.Struct({\n id: Schema.optionalKey(Schema.Undefined),\n event: Schema.Literal(\"stream.reset-required\"),\n data: Schema.fromJsonString(StreamResetRequired)\n}).annotate({ identifier: \"StreamResetRequiredLiveEvent\" })\n\n/** Decoded replay-gap stream event. */\nexport type StreamResetRequiredLiveEvent = typeof StreamResetRequiredLiveEvent.Type\n\n/** Keepalive event; it deliberately has no SSE ID so it cannot advance resume state. */\nexport const StreamHeartbeatLiveEvent = Schema.Struct({\n id: Schema.optionalKey(Schema.Undefined),\n event: Schema.Literal(\"stream.heartbeat\"),\n data: Schema.fromJsonString(StreamHeartbeat)\n}).annotate({ identifier: \"StreamHeartbeatLiveEvent\" })\n\n/** Decoded keepalive stream event. */\nexport type StreamHeartbeatLiveEvent = typeof StreamHeartbeatLiveEvent.Type\n\n/** Closed browser-safe union emitted by the authenticated live event stream. */\nexport const ControlCenterLiveEvent = Schema.Union([\n PortfolioSnapshotLiveEvent,\n PortfolioInvalidatedLiveEvent,\n StreamResetRequiredLiveEvent,\n StreamHeartbeatLiveEvent\n]).annotate({ identifier: \"ControlCenterLiveEvent\" })\n\n/** Decoded browser-safe live event. */\nexport type ControlCenterLiveEvent = typeof ControlCenterLiveEvent.Type\n\nconst stream = HttpApiEndpoint.get(\"stream\", \"/api/v1/events\", {\n query: {\n after: Schema.optionalKey(EventCursorFromString)\n },\n headers: {\n \"last-event-id\": Schema.optionalKey(EventCursorFromString)\n },\n success: HttpApiSchema.StreamSse({ events: ControlCenterLiveEvent }),\n error: [\n InvalidRequestApiError,\n UnauthorizedApiError,\n ForbiddenApiError,\n RateLimitedApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError\n ]\n}).middleware(SessionCookieAuth)\n\n/** Authenticated resumable stream of workspace-local Control Center events. */\nexport class LiveEventsApiGroup extends HttpApiGroup.make(\"liveEvents\").add(stream) {}\n","import * as Schema from \"effect/Schema\"\nimport { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from \"effect/unstable/httpapi\"\n\nimport {\n CorrelationId,\n ForbiddenApiError,\n NotFoundApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError,\n UnauthorizedApiError\n} from \"./errors.js\"\nimport { SessionCookieAuth } from \"./session.js\"\nimport { CanonicalNonNegativeIntegerFromString } from \"./wire.js\"\n\n/** Workspace-scoped opaque media reference that reveals neither provider URLs nor local storage keys. */\nexport const OpaqueMediaId = Schema.String.check(\n Schema.isPattern(/^media_[0-9a-f]{64}$/u, { expected: \"an opaque SHA-256 media identifier\" })\n).pipe(Schema.brand(\"OpaqueMediaId\"))\n\n/** Decoded opaque media identifier. */\nexport type OpaqueMediaId = typeof OpaqueMediaId.Type\n\n/** Closed set of inert raster formats accepted at the authenticated media boundary. */\nexport const SafeMediaContentType = Schema.Literals([\n \"image/avif\",\n \"image/jpeg\",\n \"image/png\",\n \"image/webp\"\n])\n\n/** Decoded safe raster media content type. */\nexport type SafeMediaContentType = typeof SafeMediaContentType.Type\n\n/** Security and metadata headers required on authenticated opaque media responses. */\nexport const MediaResponseHeaders = Schema.Struct({\n \"x-correlation-id\": CorrelationId,\n \"content-type\": SafeMediaContentType,\n \"content-length\": CanonicalNonNegativeIntegerFromString,\n \"cache-control\": Schema.Literal(\"private, no-store\"),\n \"x-content-type-options\": Schema.Literal(\"nosniff\")\n}).annotate({ identifier: \"MediaResponseHeaders\" })\n\n/** Decoded opaque media response headers. */\nexport type MediaResponseHeaders = typeof MediaResponseHeaders.Type\n\nconst read = HttpApiEndpoint.get(\"read\", \"/:mediaId\", {\n params: Schema.Struct({ mediaId: OpaqueMediaId }),\n success: HttpApiSchema.StreamUint8Array({ contentType: \"application/octet-stream\" }),\n error: [\n UnauthorizedApiError,\n ForbiddenApiError,\n NotFoundApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError\n ]\n}).middleware(SessionCookieAuth)\n\n/** Authenticated, workspace-resolved opaque media contract. */\nexport class MediaApiGroup extends HttpApiGroup.make(\"media\").add(read).prefix(\"/api/v1/media\") {}\n","import * as Schema from \"effect/Schema\"\nimport { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from \"effect/unstable/httpapi\"\n\nimport { EntityId, PersonId, ShareId, WorkspaceId } from \"../domain/identifiers.js\"\nimport { UtcTimestamp } from \"../domain/utcTimestamp.js\"\nimport { InspectedEntityProjection } from \"./deliveryGraph.js\"\nimport {\n ConflictApiError,\n ForbiddenApiError,\n InvalidRequestApiError,\n NotFoundApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError,\n UnauthorizedApiError\n} from \"./errors.js\"\nimport { SessionCookieAuth, SessionMutationAuth } from \"./session.js\"\n\n/** Owner-authored intent for one exact entity share grant. */\nexport const CreateAuthorizedShareRequest = Schema.Struct({\n shareId: ShareId,\n entityId: EntityId,\n granteePersonId: PersonId,\n expiresAt: UtcTimestamp\n})\n\n/** Decoded authorized-share creation request. */\nexport type CreateAuthorizedShareRequest = typeof CreateAuthorizedShareRequest.Type\n\n/** Secret-free grant metadata returned to authenticated callers. */\nexport const AuthorizedShareSummary = Schema.Struct({\n shareId: ShareId,\n entityId: EntityId,\n granteePersonId: PersonId,\n createdAt: UtcTimestamp,\n expiresAt: UtcTimestamp,\n revokedAt: Schema.NullOr(UtcTimestamp)\n}).annotate({ identifier: \"AuthorizedShareSummary\" })\n\n/** Decoded secret-free authorized-share metadata. */\nexport type AuthorizedShareSummary = typeof AuthorizedShareSummary.Type\n\n/** Exact current entity projection resolved without relationships or release context. */\nexport const AuthorizedShareResolution = Schema.Struct({\n share: AuthorizedShareSummary,\n item: InspectedEntityProjection\n}).annotate({ identifier: \"AuthorizedShareResolution\" })\n\n/** Decoded authorized-share resolution. */\nexport type AuthorizedShareResolution = typeof AuthorizedShareResolution.Type\n\nconst authenticatedErrors = [\n UnauthorizedApiError,\n ForbiddenApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError\n]\n\nconst create = HttpApiEndpoint.post(\"create\", \"/\", {\n payload: CreateAuthorizedShareRequest,\n success: AuthorizedShareSummary,\n error: [...authenticatedErrors, InvalidRequestApiError, NotFoundApiError, ConflictApiError]\n})\n .middleware(SessionCookieAuth)\n .middleware(SessionMutationAuth)\n\nconst resolve = HttpApiEndpoint.get(\"resolve\", \"/:workspaceId/:shareId\", {\n params: Schema.Struct({ workspaceId: WorkspaceId, shareId: ShareId }),\n success: AuthorizedShareResolution,\n error: [...authenticatedErrors, NotFoundApiError]\n}).middleware(SessionCookieAuth)\n\nconst revoke = HttpApiEndpoint.delete(\"revoke\", \"/:workspaceId/:shareId\", {\n params: Schema.Struct({ workspaceId: WorkspaceId, shareId: ShareId }),\n success: HttpApiSchema.NoContent,\n error: [...authenticatedErrors, NotFoundApiError]\n})\n .middleware(SessionCookieAuth)\n .middleware(SessionMutationAuth)\n\n/** Exact-scope authenticated entity-share contract. */\nexport class SharesApiGroup extends HttpApiGroup.make(\"shares\")\n .add(create, resolve, revoke)\n .prefix(\"/api/v1/shares\")\n{}\n","import * as Schema from \"effect/Schema\"\nimport { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from \"effect/unstable/httpapi\"\n\nimport { TimelineActorKind, TimelineCursor, TimelineEventDetail, TimelinePage } from \"../domain/timeline.js\"\nimport { UtcTimestamp } from \"../domain/utcTimestamp.js\"\nimport {\n ForbiddenApiError,\n InvalidRequestApiError,\n NotFoundApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError,\n UnauthorizedApiError\n} from \"./errors.js\"\nimport { SessionCookieAuth } from \"./session.js\"\nimport { CanonicalNonNegativeIntegerFromString } from \"./wire.js\"\n\nconst TimelinePageSizeFromString = CanonicalNonNegativeIntegerFromString.pipe(\n Schema.check(Schema.isGreaterThanOrEqualTo(1), Schema.isLessThanOrEqualTo(100))\n)\n\n/** Hard caller-selected event bound for one Timeline download. */\nexport const TimelineExportLimitFromString = CanonicalNonNegativeIntegerFromString.pipe(\n Schema.check(Schema.isGreaterThanOrEqualTo(1), Schema.isLessThanOrEqualTo(1_000))\n)\n\n/** Content types emitted by the bounded Timeline download endpoints. */\nexport const TimelineExportContentType = Schema.Literals([\n \"application/json; charset=utf-8\",\n \"text/csv; charset=utf-8\"\n])\n\n/** Security, download, and truncation headers on a Timeline export response. */\nexport const TimelineExportResponseHeaders = Schema.Struct({\n \"cache-control\": Schema.Literal(\"private, no-store\"),\n \"content-disposition\": Schema.Literals([\n \"attachment; filename=\\\"timeline-export.csv\\\"\",\n \"attachment; filename=\\\"timeline-export.json\\\"\"\n ]),\n \"content-type\": TimelineExportContentType,\n \"x-content-type-options\": Schema.Literal(\"nosniff\"),\n \"x-timeline-export-count\": CanonicalNonNegativeIntegerFromString,\n \"x-timeline-export-limit\": TimelineExportLimitFromString,\n \"x-timeline-export-truncated\": Schema.Literals([\"false\", \"true\"])\n}).annotate({ identifier: \"TimelineExportResponseHeaders\" })\n\nconst exportQuery = {\n actor: Schema.optionalKey(TimelineActorKind),\n from: Schema.optionalKey(UtcTimestamp),\n limit: TimelineExportLimitFromString,\n to: Schema.optionalKey(UtcTimestamp)\n}\n\nconst timelineErrors: readonly [\n typeof InvalidRequestApiError,\n typeof UnauthorizedApiError,\n typeof ForbiddenApiError,\n typeof RequestTimedOutApiError,\n typeof ServiceUnavailableApiError\n] = [\n InvalidRequestApiError,\n UnauthorizedApiError,\n ForbiddenApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError\n]\n\nconst page = HttpApiEndpoint.get(\"page\", \"/api/v1/timeline\", {\n query: {\n actor: Schema.optionalKey(TimelineActorKind),\n beforeEventKey: Schema.optionalKey(Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(1_024))),\n beforeOccurredAt: Schema.optionalKey(UtcTimestamp),\n from: Schema.optionalKey(UtcTimestamp),\n limit: Schema.optionalKey(TimelinePageSizeFromString),\n to: Schema.optionalKey(UtcTimestamp)\n },\n success: TimelinePage,\n error: timelineErrors\n}).middleware(SessionCookieAuth)\n\nconst detail = HttpApiEndpoint.get(\"detail\", \"/api/v1/timeline/events/:eventKey\", {\n params: { eventKey: TimelineCursor.fields.eventKey },\n success: TimelineEventDetail,\n error: [\n InvalidRequestApiError,\n UnauthorizedApiError,\n ForbiddenApiError,\n NotFoundApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError\n ]\n}).middleware(SessionCookieAuth)\n\nconst exportCsv = HttpApiEndpoint.get(\"exportCsv\", \"/api/v1/timeline/export.csv\", {\n query: exportQuery,\n success: HttpApiSchema.StreamUint8Array({ contentType: \"text/csv; charset=utf-8\" }),\n error: timelineErrors\n}).middleware(SessionCookieAuth)\n\nconst exportJson = HttpApiEndpoint.get(\"exportJson\", \"/api/v1/timeline/export.json\", {\n query: exportQuery,\n success: HttpApiSchema.StreamUint8Array({ contentType: \"application/json; charset=utf-8\" }),\n error: timelineErrors\n}).middleware(SessionCookieAuth)\n\n/** Authenticated, workspace-scoped durable activity Timeline. */\nexport class TimelineApiGroup extends HttpApiGroup.make(\"timeline\")\n .add(page)\n .add(detail)\n .add(exportCsv)\n .add(exportJson)\n{}\n","import * as Schema from \"effect/Schema\"\n\nimport { AgentProviderIdentifier } from \"./agentProviderIdentifier.js\"\n\nconst boundedInteger = (minimum: number, maximum: number) => Schema.Int.check(Schema.isBetween({ minimum, maximum }))\n\nconst AgentModelIdentifier = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(200),\n Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/u, {\n expected: \"a bounded agent model identifier\"\n })\n)\n\nconst canonicalText = Schema.makeFilter(\n (values: ReadonlyArray<string>) => values.every((value, index) => index === 0 || (values[index - 1] ?? \"\") < value),\n { expected: \"values in canonical ascending order\" }\n)\n\n/** Every independently editable section in the workspace settings document. */\nexport const WorkspaceSettingsSection = Schema.Literals([\n \"agent\",\n \"inference\",\n \"investigation\",\n \"jira\",\n \"pipeline\",\n \"presentation\",\n \"retention\",\n \"synchronization\"\n])\n\n/** Decoded workspace-settings section name. */\nexport type WorkspaceSettingsSection = typeof WorkspaceSettingsSection.Type\n\n/** Canonical set of changed settings sections retained by one immutable audit. */\nexport const WorkspaceSettingsSections = Schema.Array(WorkspaceSettingsSection).check(\n Schema.isUnique(),\n canonicalText,\n Schema.makeFilter((sections) => sections.length <= 8, {\n expected: \"at most eight workspace settings sections\"\n })\n)\n\n/** Decoded canonical changed-section set. */\nexport type WorkspaceSettingsSections = typeof WorkspaceSettingsSections.Type\n\n/** Sections whose changes alter authorization, provider-write, or retention policy. */\nexport const GovernedWorkspaceSettingsSection = Schema.Literals([\n \"agent\",\n \"jira\",\n \"pipeline\",\n \"retention\"\n])\n\n/** Decoded governed workspace-settings section name. */\nexport type GovernedWorkspaceSettingsSection = typeof GovernedWorkspaceSettingsSection.Type\n\n/** Canonical exact set of governed sections acknowledged by one mutation. */\nexport const GovernedWorkspaceSettingsSections = Schema.Array(\n GovernedWorkspaceSettingsSection\n).check(\n Schema.isUnique(),\n canonicalText,\n Schema.makeFilter((sections) => sections.length <= 4, {\n expected: \"at most four governed settings sections\"\n })\n)\n\n/** Decoded canonical governed-section acknowledgement. */\nexport type GovernedWorkspaceSettingsSections = typeof GovernedWorkspaceSettingsSections.Type\n\n/** Version-one server-owned workspace settings. */\nexport const WorkspaceSettingsV1 = Schema.Struct({\n schemaVersion: Schema.Literal(1),\n inference: Schema.Struct({\n enabled: Schema.Boolean,\n minimumConfidencePercent: boundedInteger(0, 100)\n }),\n // The cadence is the shared policy input for the scheduled lifecycle work\n // tracked separately from this concurrency/settings slice. The existing\n // owner-triggered synchronization remains manual until that worker exists.\n synchronization: Schema.Struct({\n cadence: Schema.Literals([\"manual\", \"interval\"]),\n intervalMinutes: Schema.NullOr(boundedInteger(5, 10_080)),\n staleAfterMinutes: boundedInteger(5, 43_200)\n }).check(\n Schema.makeFilter(\n ({ cadence, intervalMinutes }) => cadence === \"manual\" ? intervalMinutes === null : intervalMinutes !== null,\n { expected: \"an interval only for interval synchronization\" }\n )\n ),\n retention: Schema.Struct({\n evidenceDays: boundedInteger(1, 3_650),\n // Final durable-class sweeps are lifecycle operations. These settings\n // record their governed workspace policy without weakening immutable\n // audit tables in the settings persistence boundary.\n contentDays: boundedInteger(1, 3_650),\n auditDays: boundedInteger(1, 3_650),\n agentActivityDays: boundedInteger(1, 365),\n sandboxArtifactDays: boundedInteger(1, 30)\n }).check(\n Schema.makeFilter(\n ({ auditDays, evidenceDays }) => auditDays >= evidenceDays,\n { expected: \"audit retention not shorter than evidence retention\" }\n ),\n Schema.makeFilter(\n ({ agentActivityDays, sandboxArtifactDays }) => agentActivityDays >= sandboxArtifactDays,\n { expected: \"agent activity retention not shorter than sandbox artifact retention\" }\n )\n ),\n investigation: Schema.Struct({\n // Investigation automation is a separate application subsystem; this\n // document owns its concurrency-safe policy, not incident creation.\n mode: Schema.Literals([\"manual\", \"automatic\"]),\n consecutiveFailureThreshold: boundedInteger(1, 20)\n }),\n jira: Schema.Struct({\n commentMode: Schema.Literals([\"manual-only\", \"confirm-before-publish\"]),\n includeControlCenterAttribution: Schema.Boolean\n }),\n pipeline: Schema.Struct({\n retryMode: Schema.Literals([\"manual-only\", \"confirm-before-retry\"]),\n maximumAttempts: boundedInteger(1, 10)\n }),\n agent: Schema.Struct({\n allowedProviders: Schema.Array(AgentProviderIdentifier).check(\n Schema.isUnique(),\n canonicalText,\n Schema.makeFilter((providers) => providers.length <= 16, {\n expected: \"at most sixteen allowed agent providers\"\n })\n ),\n defaultProvider: Schema.NullOr(AgentProviderIdentifier),\n defaultModel: Schema.NullOr(AgentModelIdentifier),\n toolPolicy: Schema.Literals([\"read-only\", \"review-sandbox\"]),\n profilePolicy: Schema.Literals([\"isolated\", \"local-profile\"])\n }).check(\n Schema.makeFilter(\n ({ allowedProviders, defaultProvider }) => defaultProvider === null || allowedProviders.includes(defaultProvider),\n { expected: \"the default agent provider to be allowed\" }\n ),\n Schema.makeFilter(\n ({ defaultModel, defaultProvider }) => defaultModel === null || defaultProvider !== null,\n { expected: \"a default provider when a default model is configured\" }\n )\n ),\n presentation: Schema.Struct({\n density: Schema.Literals([\"comfortable\", \"compact\"]),\n defaultLanding: Schema.Literals([\"overview\", \"active-work\"])\n })\n}).annotate({ identifier: \"WorkspaceSettingsV1\" })\n\n/** Decoded version-one workspace settings. */\nexport type WorkspaceSettingsV1 = typeof WorkspaceSettingsV1.Type\n\n/** Canonical defaults installed for every existing or newly created workspace. */\nexport const DEFAULT_WORKSPACE_SETTINGS = WorkspaceSettingsV1.make({\n schemaVersion: 1,\n inference: {\n enabled: true,\n minimumConfidencePercent: 80\n },\n synchronization: {\n cadence: \"manual\",\n intervalMinutes: null,\n staleAfterMinutes: 1_440\n },\n retention: {\n evidenceDays: 365,\n contentDays: 90,\n auditDays: 365,\n agentActivityDays: 30,\n sandboxArtifactDays: 7\n },\n investigation: {\n mode: \"manual\",\n consecutiveFailureThreshold: 3\n },\n jira: {\n commentMode: \"manual-only\",\n includeControlCenterAttribution: true\n },\n pipeline: {\n retryMode: \"manual-only\",\n maximumAttempts: 1\n },\n agent: {\n allowedProviders: [],\n defaultProvider: null,\n defaultModel: null,\n toolPolicy: \"read-only\",\n profilePolicy: \"isolated\"\n },\n presentation: {\n density: \"comfortable\",\n defaultLanding: \"overview\"\n }\n})\n\nconst agentSettingsEqual = Schema.toEquivalence(WorkspaceSettingsV1.fields.agent)\nconst inferenceSettingsEqual = Schema.toEquivalence(WorkspaceSettingsV1.fields.inference)\nconst investigationSettingsEqual = Schema.toEquivalence(WorkspaceSettingsV1.fields.investigation)\nconst jiraSettingsEqual = Schema.toEquivalence(WorkspaceSettingsV1.fields.jira)\nconst pipelineSettingsEqual = Schema.toEquivalence(WorkspaceSettingsV1.fields.pipeline)\nconst presentationSettingsEqual = Schema.toEquivalence(WorkspaceSettingsV1.fields.presentation)\nconst retentionSettingsEqual = Schema.toEquivalence(WorkspaceSettingsV1.fields.retention)\nconst synchronizationSettingsEqual = Schema.toEquivalence(WorkspaceSettingsV1.fields.synchronization)\n\nconst orderedSections: ReadonlyArray<WorkspaceSettingsSection> = WorkspaceSettingsSection.literals\n\nconst workspaceSettingsSectionChanged = (\n section: WorkspaceSettingsSection,\n current: WorkspaceSettingsV1,\n candidate: WorkspaceSettingsV1\n): boolean => {\n switch (section) {\n case \"agent\":\n return !agentSettingsEqual(current.agent, candidate.agent)\n case \"inference\":\n return !inferenceSettingsEqual(current.inference, candidate.inference)\n case \"investigation\":\n return !investigationSettingsEqual(current.investigation, candidate.investigation)\n case \"jira\":\n return !jiraSettingsEqual(current.jira, candidate.jira)\n case \"pipeline\":\n return !pipelineSettingsEqual(current.pipeline, candidate.pipeline)\n case \"presentation\":\n return !presentationSettingsEqual(current.presentation, candidate.presentation)\n case \"retention\":\n return !retentionSettingsEqual(current.retention, candidate.retention)\n case \"synchronization\":\n return !synchronizationSettingsEqual(current.synchronization, candidate.synchronization)\n }\n}\n\n/** Determine the canonical set of sections changed by a complete settings replacement. */\nexport const changedWorkspaceSettingsSections = (\n current: WorkspaceSettingsV1,\n candidate: WorkspaceSettingsV1\n): ReadonlyArray<WorkspaceSettingsSection> =>\n orderedSections.filter((section) => workspaceSettingsSectionChanged(section, current, candidate))\n\n/** Narrow one settings section to the subset that requires governed acknowledgement. */\nexport const isGovernedWorkspaceSettingsSection = (\n section: WorkspaceSettingsSection\n): section is GovernedWorkspaceSettingsSection => Schema.is(GovernedWorkspaceSettingsSection)(section)\n","import * as Schema from \"effect/Schema\"\nimport { HttpApiEndpoint, HttpApiGroup } from \"effect/unstable/httpapi\"\n\nimport { PersonId, WorkspaceId, WorkspaceSettingsMutationId } from \"../domain/identifiers.js\"\nimport { UtcTimestamp } from \"../domain/utcTimestamp.js\"\nimport { GovernedWorkspaceSettingsSections, WorkspaceSettingsV1 } from \"../domain/workspaceSettings.js\"\nimport {\n ConflictApiError,\n ForbiddenApiError,\n InvalidRequestApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError,\n UnauthorizedApiError\n} from \"./errors.js\"\nimport { SessionCookieAuth, SessionMutationAuth } from \"./session.js\"\n\n/** Positive optimistic-concurrency revision of the workspace settings aggregate. */\nexport const WorkspaceSettingsRevision = Schema.Int.check(\n Schema.isGreaterThan(0)\n).pipe(Schema.brand(\"WorkspaceSettingsRevision\"))\n\n/** Decoded workspace-settings revision. */\nexport type WorkspaceSettingsRevision = typeof WorkspaceSettingsRevision.Type\n\n/** Strong browser-visible validator for one exact settings revision. */\nexport const WorkspaceSettingsEtag = Schema.String.check(\n Schema.isPattern(/^\"workspace-settings-v1-[1-9][0-9]*\"$/u, {\n expected: \"a strong version-one workspace-settings ETag\"\n })\n).pipe(Schema.brand(\"WorkspaceSettingsEtag\"))\n\n/** Decoded workspace-settings ETag. */\nexport type WorkspaceSettingsEtag = typeof WorkspaceSettingsEtag.Type\n\n/** Construct the strong validator returned with one settings revision. */\nexport const workspaceSettingsEtag = (\n revision: WorkspaceSettingsRevision\n): WorkspaceSettingsEtag => WorkspaceSettingsEtag.make(`\"workspace-settings-v1-${String(revision)}\"`)\n\n/** Server-authoritative settings document returned to authenticated workspace sessions. */\nexport const WorkspaceSettingsReadModel = Schema.Struct({\n workspaceId: WorkspaceId,\n revision: WorkspaceSettingsRevision,\n etag: WorkspaceSettingsEtag,\n settings: WorkspaceSettingsV1,\n createdAt: UtcTimestamp,\n updatedAt: UtcTimestamp,\n updatedByPersonId: Schema.NullOr(PersonId)\n}).annotate({ identifier: \"WorkspaceSettingsReadModel\" })\n\n/** Decoded workspace-settings read model. */\nexport type WorkspaceSettingsReadModel = typeof WorkspaceSettingsReadModel.Type\n\n/** Safe workspace presentation defaults shared with every authenticated collaborator. */\nexport const WorkspacePresentationReadModel = Schema.Struct({\n workspaceId: WorkspaceId,\n revision: WorkspaceSettingsRevision,\n presentation: WorkspaceSettingsV1.fields.presentation\n}).annotate({ identifier: \"WorkspacePresentationReadModel\" })\n\n/** Decoded collaborator-safe workspace presentation projection. */\nexport type WorkspacePresentationReadModel = typeof WorkspacePresentationReadModel.Type\n\n/** Complete compare-and-swap replacement of one workspace settings document. */\nexport const UpdateWorkspaceSettingsRequest = Schema.Struct({\n mutationId: WorkspaceSettingsMutationId,\n expectedRevision: WorkspaceSettingsRevision,\n settings: WorkspaceSettingsV1,\n acknowledgedGovernedSections: GovernedWorkspaceSettingsSections\n}).annotate({ identifier: \"UpdateWorkspaceSettingsRequest\" })\n\n/** Decoded workspace-settings replacement request. */\nexport type UpdateWorkspaceSettingsRequest = typeof UpdateWorkspaceSettingsRequest.Type\n\nconst authenticatedErrors = [\n UnauthorizedApiError,\n ForbiddenApiError,\n RequestTimedOutApiError,\n ServiceUnavailableApiError\n]\n\nconst read = HttpApiEndpoint.get(\"read\", \"/\", {\n success: WorkspaceSettingsReadModel,\n error: authenticatedErrors\n}).middleware(SessionCookieAuth)\n\nconst readPresentation = HttpApiEndpoint.get(\"readPresentation\", \"/presentation\", {\n success: WorkspacePresentationReadModel,\n error: authenticatedErrors\n}).middleware(SessionCookieAuth)\n\nconst update = HttpApiEndpoint.put(\"update\", \"/\", {\n payload: UpdateWorkspaceSettingsRequest,\n success: WorkspaceSettingsReadModel,\n error: [...authenticatedErrors, InvalidRequestApiError, ConflictApiError]\n})\n .middleware(SessionCookieAuth)\n .middleware(SessionMutationAuth)\n\n/** Authenticated workspace settings read and concurrency-safe mutation contract. */\nexport class WorkspaceSettingsApiGroup extends HttpApiGroup.make(\"workspaceSettings\")\n .add(read, readPresentation, update)\n .prefix(\"/api/v1/settings\")\n{}\n","import { HttpApi } from \"effect/unstable/httpapi\"\n\nimport { AgentApiGroup } from \"./agent.js\"\nimport { CodePipelineApiGroup } from \"./codepipeline.js\"\nimport { DeliveryGraphApiGroup } from \"./deliveryGraph.js\"\nimport { DiffApiGroup } from \"./diff.js\"\nimport { LiveEventsApiGroup } from \"./liveEvents.js\"\nimport { MediaApiGroup } from \"./media.js\"\nimport { PluginsApiGroup } from \"./plugins.js\"\nimport { PortfolioApiGroup } from \"./portfolio.js\"\nimport { SessionApiGroup } from \"./session.js\"\nimport { SharesApiGroup } from \"./shares.js\"\nimport { TimelineApiGroup } from \"./timeline.js\"\nimport { WorkspaceSettingsApiGroup } from \"./workspaceSettings.js\"\n\n/** Browser-safe authenticated HTTP contract shared by the generated client and server implementation. */\nexport class ControlCenterApi extends HttpApi.make(\"ControlCenterApi\")\n .add(SessionApiGroup)\n .add(SharesApiGroup)\n .add(PluginsApiGroup)\n .add(PortfolioApiGroup)\n .add(DeliveryGraphApiGroup)\n .add(DiffApiGroup)\n .add(CodePipelineApiGroup)\n .add(MediaApiGroup)\n .add(LiveEventsApiGroup)\n .add(TimelineApiGroup)\n .add(WorkspaceSettingsApiGroup)\n .add(AgentApiGroup)\n{}\n","import type * as Effect from \"effect/Effect\"\nimport type * as HttpClient from \"effect/unstable/http/HttpClient\"\nimport { HttpApiClient } from \"effect/unstable/httpapi\"\n\nimport { ControlCenterApi } from \"./controlCenterApi.js\"\n\n/** Generated browser-client shape for every public Control Center API group. */\nexport type ControlCenterApiClient = HttpApiClient.ForApi<typeof ControlCenterApi>\n\n/** Browser-safe generated-client construction options. */\nexport interface ControlCenterApiClientOptions {\n readonly baseUrl?: URL | string\n readonly transformClient?: (client: HttpClient.HttpClient) => HttpClient.HttpClient\n readonly transformResponse?: (\n response: Effect.Effect<unknown, unknown, unknown>\n ) => Effect.Effect<unknown, unknown, unknown>\n}\n\n/** Construct the generated client using the caller-provided Effect `HttpClient`. */\nexport const makeControlCenterApiClient = (\n options?: ControlCenterApiClientOptions\n): Effect.Effect<ControlCenterApiClient, never, HttpClient.HttpClient> => HttpApiClient.make(ControlCenterApi, options)\n\n/** Construct a type-safe URL builder without requiring an HTTP runtime. */\nexport const makeControlCenterApiUrls = (\n options?: Pick<ControlCenterApiClientOptions, \"baseUrl\">\n): HttpApiClient.UrlBuilder<typeof ControlCenterApi> => HttpApiClient.urlBuilder(ControlCenterApi, options)\n"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":"qjEA+DA,IAAaA,GAAS,OAAgB,CACpC,IAAM,EAASC,GAAoBC,GAAqB,CAAM,CAAC,EAC/D,OAAOC,IAAuB,EAAU,IAAWC,EAAeC,EAAe,EAAU,GAAS,EAAO,C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