@knpkv/control-center 0.7.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/client/.vite/manifest.json +312 -255
  2. package/dist/client/assets/ActiveWorkPage-DKlotZGc.js +2 -0
  3. package/dist/client/assets/{ActiveWorkPage-BsaIr8ah.js.map → ActiveWorkPage-DKlotZGc.js.map} +1 -1
  4. package/dist/client/assets/AgentPage-Cxm1gj2C.js +6 -0
  5. package/dist/client/assets/{AgentPage-Cybynsnc.js.map → AgentPage-Cxm1gj2C.js.map} +1 -1
  6. package/dist/client/assets/{AtlassianOAuthCallbackPage-Du3pHuS9.js → AtlassianOAuthCallbackPage-fEFUJE2g.js} +2 -2
  7. package/dist/client/assets/{AtlassianOAuthCallbackPage-Du3pHuS9.js.map → AtlassianOAuthCallbackPage-fEFUJE2g.js.map} +1 -1
  8. package/dist/client/assets/AuthorizedSharePage-Dh7Y_gmJ.js +2 -0
  9. package/dist/client/assets/{AuthorizedSharePage-tfTdXNjt.js.map → AuthorizedSharePage-Dh7Y_gmJ.js.map} +1 -1
  10. package/dist/client/assets/BrowserCrypto-CoBR2WBd.js +2 -0
  11. package/dist/client/assets/{BrowserCrypto-DVxU0-Oc.js.map → BrowserCrypto-CoBR2WBd.js.map} +1 -1
  12. package/dist/client/assets/BrowserSessionHydrator-DkomS8Yl.js +2 -0
  13. package/dist/client/assets/{BrowserSessionHydrator-CvtvZstV.js.map → BrowserSessionHydrator-DkomS8Yl.js.map} +1 -1
  14. package/dist/client/assets/CommandSearch-nf16HEqz.js +2 -0
  15. package/dist/client/assets/{CommandSearch-Bf_oW_kD.js.map → CommandSearch-nf16HEqz.js.map} +1 -1
  16. package/dist/client/assets/Dialog-DSwimdwG-BeHnBpPp.js +42 -0
  17. package/dist/client/assets/Dialog-DSwimdwG-BeHnBpPp.js.map +1 -0
  18. package/dist/client/assets/Domain-cJ5aJFpE.js +2 -0
  19. package/dist/client/assets/Domain-cJ5aJFpE.js.map +1 -0
  20. package/dist/client/assets/ItemsPage-Bok8Vpy4.js +2 -0
  21. package/dist/client/assets/{ItemsPage-BmWEHinz.js.map → ItemsPage-Bok8Vpy4.js.map} +1 -1
  22. package/dist/client/assets/OpenPullRequestPage-DdL7PhKZ.js +2 -0
  23. package/dist/client/assets/OpenPullRequestPage-DdL7PhKZ.js.map +1 -0
  24. package/dist/client/assets/{Pages-BmZj4KzS.js → Pages-DrDuXLFH.js} +2 -2
  25. package/dist/client/assets/{Pages-BmZj4KzS.js.map → Pages-DrDuXLFH.js.map} +1 -1
  26. package/dist/client/assets/PairPage-BCtzYqK6.js +2 -0
  27. package/dist/client/assets/{PairPage-CLLUweYZ.js.map → PairPage-BCtzYqK6.js.map} +1 -1
  28. package/dist/client/assets/PortalProvider-CN_81Fy3-D_japesx.js +2 -0
  29. package/dist/client/assets/{PortalProvider-BpgZwSpw-nEH0TqWT.js.map → PortalProvider-CN_81Fy3-D_japesx.js.map} +1 -1
  30. package/dist/client/assets/PortfolioOverview-C-jqvYgQ.js +2 -0
  31. package/dist/client/assets/{PortfolioOverview-BBKSc-yI.js.map → PortfolioOverview-C-jqvYgQ.js.map} +1 -1
  32. package/dist/client/assets/{PullRequestReviewPanel-Boi0A6pq.js → PullRequestReviewPanel-DwVYuZ8Q.js} +5 -5
  33. package/dist/client/assets/{PullRequestReviewPanel-Boi0A6pq.js.map → PullRequestReviewPanel-DwVYuZ8Q.js.map} +1 -1
  34. package/dist/client/assets/ReleaseRoute-cuvP4ug5.js +2 -0
  35. package/dist/client/assets/{ReleaseRoute-D4CttCjC.js.map → ReleaseRoute-cuvP4ug5.js.map} +1 -1
  36. package/dist/client/assets/ReleaseWorkset-DImwmjS3.js +2 -0
  37. package/dist/client/assets/{ReleaseWorkset-Dt-ArwsN.js.map → ReleaseWorkset-DImwmjS3.js.map} +1 -1
  38. package/dist/client/assets/ReviewSuggestionPublicationSurface-BZIa-Vvc.js +2 -0
  39. package/dist/client/assets/{ReviewSuggestionPublicationSurface-N9Qwdh2n.js.map → ReviewSuggestionPublicationSurface-BZIa-Vvc.js.map} +1 -1
  40. package/dist/client/assets/ServicesPage-CrM8R820.js +2 -0
  41. package/dist/client/assets/{ServicesPage-D0ygZTFD.js.map → ServicesPage-CrM8R820.js.map} +1 -1
  42. package/dist/client/assets/TimelinePage-FrvepGa_.js +2 -0
  43. package/dist/client/assets/{TimelinePage-Bb2o9DGU.js.map → TimelinePage-FrvepGa_.js.map} +1 -1
  44. package/dist/client/assets/{WorkspaceEntityLink-Cw675wTN.js → WorkspaceEntityLink-CAj42f02.js} +2 -2
  45. package/dist/client/assets/{WorkspaceEntityLink-Cw675wTN.js.map → WorkspaceEntityLink-CAj42f02.js.map} +1 -1
  46. package/dist/client/assets/WorkspaceEntityRoute-rQ9ccetx.js +14 -0
  47. package/dist/client/assets/WorkspaceEntityRoute-rQ9ccetx.js.map +1 -0
  48. package/dist/client/assets/WorkspaceHomeLink-ObQ3AQVw.js +2 -0
  49. package/dist/client/assets/{WorkspaceHomeLink-FGslxXCu.js.map → WorkspaceHomeLink-ObQ3AQVw.js.map} +1 -1
  50. package/dist/client/assets/WorkspacePullRequestDetails-BhxoqR7V.js +3 -0
  51. package/dist/client/assets/{WorkspacePullRequestDetails-Dxg8argO.js.map → WorkspacePullRequestDetails-BhxoqR7V.js.map} +1 -1
  52. package/dist/client/assets/{WorkspaceReleaseLayout-BvEiZJEb.js → WorkspaceReleaseLayout-BWL66Fff.js} +2 -2
  53. package/dist/client/assets/{WorkspaceReleaseLayout-BvEiZJEb.js.map → WorkspaceReleaseLayout-BWL66Fff.js.map} +1 -1
  54. package/dist/client/assets/{WorkspaceRichText-CocmKQ4T.js → WorkspaceRichText-Beh64wsV.js} +2 -2
  55. package/dist/client/assets/{WorkspaceRichText-CocmKQ4T.js.map → WorkspaceRichText-Beh64wsV.js.map} +1 -1
  56. package/dist/client/assets/WorkspaceSettingsPage-DutfiGPe.js +2 -0
  57. package/dist/client/assets/{WorkspaceSettingsPage-iZhUs-pg.js.map → WorkspaceSettingsPage-DutfiGPe.js.map} +1 -1
  58. package/dist/client/assets/{agent-api-CzdQFCcD.js → agent-api-CUWP1qs8.js} +2 -2
  59. package/dist/client/assets/{agent-api-CzdQFCcD.js.map → agent-api-CUWP1qs8.js.map} +1 -1
  60. package/dist/client/assets/{atlassianOAuthSetupIntentStorage-BxsxmjSm.js → atlassianOAuthSetupIntentStorage-Cy1Gw639.js} +2 -2
  61. package/dist/client/assets/{atlassianOAuthSetupIntentStorage-BxsxmjSm.js.map → atlassianOAuthSetupIntentStorage-Cy1Gw639.js.map} +1 -1
  62. package/dist/client/assets/authenticatedMutationClient-Bc_-Jpbo.js +2 -0
  63. package/dist/client/assets/{authenticatedMutationClient-DUqEcJHu.js.map → authenticatedMutationClient-Bc_-Jpbo.js.map} +1 -1
  64. package/dist/client/assets/authorizedShareTransport-kkT3Jf6q.js +2 -0
  65. package/dist/client/assets/{authorizedShareTransport-7YCNH9l3.js.map → authorizedShareTransport-kkT3Jf6q.js.map} +1 -1
  66. package/dist/client/assets/client-D3WRV6yl.js +5 -0
  67. package/dist/client/assets/client-D3WRV6yl.js.map +1 -0
  68. package/dist/client/assets/{confluenceTasks-D9yrB-oV.js → confluenceTasks-By7BV0WN.js} +2 -2
  69. package/dist/client/assets/{confluenceTasks-D9yrB-oV.js.map → confluenceTasks-By7BV0WN.js.map} +1 -1
  70. package/dist/client/assets/connectionTestTransport-CRq7l9X0.js +2 -0
  71. package/dist/client/assets/{connectionTestTransport-D8tiZ4ym.js.map → connectionTestTransport-CRq7l9X0.js.map} +1 -1
  72. package/dist/client/assets/controlCenterRelayDock-CyYeXh75.js +3 -0
  73. package/dist/client/assets/controlCenterRelayDock-CyYeXh75.js.map +1 -0
  74. package/dist/client/assets/controlCenterRelayDockChrome-upgtq649.js +3 -0
  75. package/dist/client/assets/controlCenterRelayDockChrome-upgtq649.js.map +1 -0
  76. package/dist/client/assets/index-kmYFvwT0.js +11 -0
  77. package/dist/client/assets/index-kmYFvwT0.js.map +1 -0
  78. package/dist/client/assets/index-tjRpNCt_.css +1 -0
  79. package/dist/client/assets/openPullRequest-BMlmibLP.js +2 -0
  80. package/dist/client/assets/openPullRequest-BMlmibLP.js.map +1 -0
  81. package/dist/client/assets/patterns-DuFUSnJW.js +2 -0
  82. package/dist/client/assets/patterns-DuFUSnJW.js.map +1 -0
  83. package/dist/client/assets/{presentPortfolio-c8-wbodG.js → presentPortfolio-DVP-zqTg.js} +2 -2
  84. package/dist/client/assets/{presentPortfolio-c8-wbodG.js.map → presentPortfolio-DVP-zqTg.js.map} +1 -1
  85. package/dist/client/assets/{presentWorkspaceItems-DfhyQeSY.js → presentWorkspaceItems-BY8bmqjF.js} +2 -2
  86. package/dist/client/assets/{presentWorkspaceItems-DfhyQeSY.js.map → presentWorkspaceItems-BY8bmqjF.js.map} +1 -1
  87. package/dist/client/assets/primitives-DYGtIZqB-r-Glkv2i.js +2 -0
  88. package/dist/client/assets/primitives-DYGtIZqB-r-Glkv2i.js.map +1 -0
  89. package/dist/client/assets/pullRequestReviewFailures-CCNxSXP6.js +2 -0
  90. package/dist/client/assets/{pullRequestReviewFailures-QvtS729d.js.map → pullRequestReviewFailures-CCNxSXP6.js.map} +1 -1
  91. package/dist/client/assets/pullRequestReviewThreadReplay-eI3Y4i6s.js +2 -0
  92. package/dist/client/assets/{pullRequestReviewThreadReplay-CpPdYxQE.js.map → pullRequestReviewThreadReplay-eI3Y4i6s.js.map} +1 -1
  93. package/dist/client/assets/{releaseAgentTransport-BCQDYqZt.js → releaseAgentTransport-CJjWwE8y.js} +2 -2
  94. package/dist/client/assets/{releaseAgentTransport-BCQDYqZt.js.map → releaseAgentTransport-CJjWwE8y.js.map} +1 -1
  95. package/dist/client/assets/releaseRoutes-h4FVwFvJ.js +2 -0
  96. package/dist/client/assets/{releaseRoutes-CSP_eBj6.js.map → releaseRoutes-h4FVwFvJ.js.map} +1 -1
  97. package/dist/client/assets/{serviceOnboarding-B6v5VXTG.js → serviceOnboarding-F9Lj6a7y.js} +2 -2
  98. package/dist/client/assets/{serviceOnboarding-B6v5VXTG.js.map → serviceOnboarding-F9Lj6a7y.js.map} +1 -1
  99. package/dist/client/assets/useWorkspaceDefaultLanding-BmaR7aTj.js +3 -0
  100. package/dist/client/assets/{useWorkspaceDefaultLanding-C3PRrLgk.js.map → useWorkspaceDefaultLanding-BmaR7aTj.js.map} +1 -1
  101. package/dist/client/assets/useWorkspaceItems-6KWfmFtx.js +2 -0
  102. package/dist/client/assets/{useWorkspaceItems-CHYpfLmL.js.map → useWorkspaceItems-6KWfmFtx.js.map} +1 -1
  103. package/dist/client/assets/{workspaceEntityRoutes-CFPO-iFw.js → workspaceEntityRoutes-BHccxrFj.js} +2 -2
  104. package/dist/client/assets/{workspaceEntityRoutes-CFPO-iFw.js.map → workspaceEntityRoutes-BHccxrFj.js.map} +1 -1
  105. package/dist/client/assets/{workspaceScrollCapture-DUj-_YMd.js → workspaceScrollCapture-BzsNJoL7.js} +2 -2
  106. package/dist/client/assets/{workspaceScrollCapture-DUj-_YMd.js.map → workspaceScrollCapture-BzsNJoL7.js.map} +1 -1
  107. package/dist/client/assets/workspaceSettingsTransport-BwRQteEH.js +2 -0
  108. package/dist/client/assets/{workspaceSettingsTransport-Kq7lfPsC.js.map → workspaceSettingsTransport-BwRQteEH.js.map} +1 -1
  109. package/dist/client/build-graph.json +63 -0
  110. package/dist/client/index.html +3 -3
  111. package/dist/server/api/index.js +1 -1
  112. package/dist/server/assets/{BindConfig-hNWrGfu2.js → BindConfig-BG-FGtB5.js} +14 -5
  113. package/dist/server/assets/BindConfig-BG-FGtB5.js.map +1 -0
  114. package/dist/server/assets/{controlCenterApi-BcVWTP9F.js → controlCenterApi-WaKi6EUb.js} +2 -1
  115. package/dist/server/assets/controlCenterApi-WaKi6EUb.js.map +1 -0
  116. package/dist/server/index.js +1 -1
  117. package/dist/server/server/cli.js +1 -1
  118. package/dist/server/server/index.js +1 -1
  119. package/package.json +8 -7
  120. package/dist/client/assets/ActiveWorkPage-BsaIr8ah.js +0 -2
  121. package/dist/client/assets/AgentPage-Cybynsnc.js +0 -6
  122. package/dist/client/assets/AuthorizedSharePage-tfTdXNjt.js +0 -2
  123. package/dist/client/assets/BrowserCrypto-DVxU0-Oc.js +0 -2
  124. package/dist/client/assets/BrowserSessionHydrator-CvtvZstV.js +0 -2
  125. package/dist/client/assets/CommandSearch-Bf_oW_kD.js +0 -2
  126. package/dist/client/assets/Dialog-1WvU8GjA-C7r26HF0.js +0 -42
  127. package/dist/client/assets/Dialog-1WvU8GjA-C7r26HF0.js.map +0 -1
  128. package/dist/client/assets/ItemsPage-BmWEHinz.js +0 -2
  129. package/dist/client/assets/OpenPullRequestPage-DkCom6mf.js +0 -2
  130. package/dist/client/assets/OpenPullRequestPage-DkCom6mf.js.map +0 -1
  131. package/dist/client/assets/PairPage-CLLUweYZ.js +0 -2
  132. package/dist/client/assets/PortalProvider-BpgZwSpw-nEH0TqWT.js +0 -2
  133. package/dist/client/assets/PortfolioOverview-BBKSc-yI.js +0 -2
  134. package/dist/client/assets/ReleaseRoute-D4CttCjC.js +0 -2
  135. package/dist/client/assets/ReleaseWorkset-Dt-ArwsN.js +0 -2
  136. package/dist/client/assets/ReviewSuggestionPublicationSurface-N9Qwdh2n.js +0 -2
  137. package/dist/client/assets/ServicesPage-D0ygZTFD.js +0 -2
  138. package/dist/client/assets/TimelinePage-Bb2o9DGU.js +0 -2
  139. package/dist/client/assets/WorkspaceEntityRoute-rLRiaF8b.js +0 -14
  140. package/dist/client/assets/WorkspaceEntityRoute-rLRiaF8b.js.map +0 -1
  141. package/dist/client/assets/WorkspaceHomeLink-FGslxXCu.js +0 -2
  142. package/dist/client/assets/WorkspacePullRequestDetails-Dxg8argO.js +0 -3
  143. package/dist/client/assets/WorkspaceSettingsPage-iZhUs-pg.js +0 -2
  144. package/dist/client/assets/authenticatedMutationClient-DUqEcJHu.js +0 -2
  145. package/dist/client/assets/authorizedShareTransport-7YCNH9l3.js +0 -2
  146. package/dist/client/assets/client-D2F6HlDk.js +0 -5
  147. package/dist/client/assets/client-D2F6HlDk.js.map +0 -1
  148. package/dist/client/assets/connectionTestTransport-D8tiZ4ym.js +0 -2
  149. package/dist/client/assets/index-BWx9sNOT.js +0 -11
  150. package/dist/client/assets/index-BWx9sNOT.js.map +0 -1
  151. package/dist/client/assets/index-CIfiz7oF.css +0 -1
  152. package/dist/client/assets/patterns-CxMz8DKX-ByHwV03y.js +0 -2
  153. package/dist/client/assets/patterns-CxMz8DKX-ByHwV03y.js.map +0 -1
  154. package/dist/client/assets/primitives-CW89TsFB-BBLwFFPo.js +0 -2
  155. package/dist/client/assets/primitives-CW89TsFB-BBLwFFPo.js.map +0 -1
  156. package/dist/client/assets/pullRequestReviewFailures-QvtS729d.js +0 -2
  157. package/dist/client/assets/pullRequestReviewThreadReplay-CpPdYxQE.js +0 -2
  158. package/dist/client/assets/releaseRoutes-CSP_eBj6.js +0 -2
  159. package/dist/client/assets/useWorkspaceDefaultLanding-C3PRrLgk.js +0 -3
  160. package/dist/client/assets/useWorkspaceItems-CHYpfLmL.js +0 -2
  161. package/dist/client/assets/workspaceSettingsTransport-Kq7lfPsC.js +0 -2
  162. package/dist/server/assets/BindConfig-hNWrGfu2.js.map +0 -1
  163. package/dist/server/assets/controlCenterApi-BcVWTP9F.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-D2F6HlDk.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.Service","Context.getOrUndefined","Headers.merge","Headers.fromInput","Headers.remove","Effect.map","Effect.tryPromise","HttpClientError.HttpClientError","HttpClientError.TransportError","HttpClientResponse.fromWeb","Effect.flatMap","Stream.toReadableStreamEffect","Context.merge","Record.map","Context.add","make","Context.empty","HttpApiEndpoint.getSuccessSchemas","HttpApiSchema.getStatusSuccessSchema","HttpApiEndpoint.getErrorSchemas","HttpApiSchema.getStatusErrorSchema","HttpApiSchema.isWithHeaders","HttpApiSchema.isStreamSchema","Context.Service","Data.TaggedError","Channel.fromTransform","Effect.sync","Effect.flatMap","Effect.fail","Effect.void","Effect.suspend","Arr.isArrayNonEmpty","Effect.succeed","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.getStatusSuccessSchema","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","HttpApiSchema.isWithHeaders","HttpApiSchema.getWithHeadersAnnotation","Schema.decodeEffect","isWithHeaders","Schema.Struct","Schema.decodeTo","Schema.Unknown","Schema.toType","SchemaTransformation.transform","HttpApiSchema.withHeaders","MediaType.normalize","HttpApiSchema.isNoContent","HttpApiSchema.getResponseEncodingSchema","HttpClientError.DecodeError","HttpApiSchema.isStreamSchema","HttpApiSchema.isStreamUint8Array","Effect.map","Stream.provideContext","Schema.decodeUnknownEffect","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","HttpApiSchema.getResponseEncoding","SchemaAST.isNull","SchemaAST.toEncoded","UrlParams.schemaRecord","HttpBody.isHttpBody","HttpApiSchema.getPayloadEncoding","SchemaTransformation.transformOrFail","SchemaIssue.Forbidden","HttpBody.text","SchemaIssue.InvalidValue","Predicate.isObject","HttpBody.urlParams","UrlParams.fromInput","HttpBody.uint8Array"],"sources":["../../../../../node_modules/.pnpm/effect@4.0.0-rc.109/node_modules/effect/dist/ChannelSchema.js","../../../../../node_modules/.pnpm/effect@4.0.0-rc.109/node_modules/effect/dist/unstable/http/HttpClient.js","../../../../../node_modules/.pnpm/effect@4.0.0-rc.109/node_modules/effect/dist/unstable/http/FetchHttpClient.js","../../../../../node_modules/.pnpm/effect@4.0.0-rc.109/node_modules/effect/dist/unstable/httpapi/HttpApi.js","../../../../../node_modules/.pnpm/effect@4.0.0-rc.109/node_modules/effect/dist/unstable/encoding/Sse.js","../../../../../node_modules/.pnpm/effect@4.0.0-rc.109/node_modules/effect/dist/unstable/httpapi/HttpApiClient.js","../../../src/domain/plugins/discovery.ts","../../../src/domain/plugins/pipeline.ts","../../../src/api/codepipeline.ts","../../../../codecommit-core/src/Domain.ts","../../../src/domain/normalizedIssue.ts","../../../src/domain/normalizedPage.ts","../../../src/domain/deliveryGraph.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 HttpBody from \"./HttpBody.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\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\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 filtering\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 filtering\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 filtering\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 filtering\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 headerFilter = fiber.getRef(TracerHeaderFilter);\n const redactedHeaders = Headers.redact(request.headers, redactedHeaderNames);\n for (const name in redactedHeaders) {\n if (!headerFilter(name, \"request\")) continue;\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 if (!headerFilter(name, \"response\")) continue;\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\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\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\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\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 * **Gotchas**\n *\n * Automatic HTTP `429` retries are unlimited unless `times` is specified.\n * Disabling response inspection does not disable retries; set `times` to `0`\n * to return or fail with the first `429`.\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 headerNames = resolveRateLimiterHeaderNames(options.responseHeaders);\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, headerNames);\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, retries = 0) {\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 const canRetry = options.times === undefined || retries < options.times;\n function retry(retryAfter) {\n return retryAfter ? Effect.flatMap(Effect.sleep(retryAfter), () => loop(effect, request, retries + 1)) : loop(effect, request, retries + 1);\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, ...headerNames.retryAfter));\n if (retryAfter === undefined) {\n return Effect.succeed(undefined);\n }\n const delay = parseRateLimitWindow(clock, response.headers, headerNames) ?? 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 || !canRetry) 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 => canRetry ? retry(retryAfter) : Effect.fail(error));\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 resolveRateLimiterHeaderNames = responseHeaders => ({\n limit: responseHeaders?.limit === undefined ? [\"ratelimit-limit\", \"x-ratelimit-limit\"] : [responseHeaders.limit.toLowerCase()],\n remaining: responseHeaders?.remaining === undefined ? [\"ratelimit-remaining\", \"x-ratelimit-remaining\"] : [responseHeaders.remaining.toLowerCase()],\n reset: responseHeaders?.reset === undefined ? [\"ratelimit-reset\", \"x-ratelimit-reset\"] : [responseHeaders.reset.toLowerCase()],\n resetAfter: responseHeaders?.resetAfter === undefined ? [\"ratelimit-reset-after\", \"x-ratelimit-reset-after\"] : [responseHeaders.resetAfter.toLowerCase()],\n retryAfter: responseHeaders?.retryAfter === undefined ? [\"retry-after\"] : [responseHeaders.retryAfter.toLowerCase()]\n});\nconst parseRateLimiterState = (state, clock, headers, tokens, headerNames) => {\n const limit = parseRateLimitLimit(state, headers, tokens, headerNames) ?? state.limit;\n const window = parseRateLimitWindow(clock, headers, headerNames) ?? 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, headerNames) => {\n const raw = getHeader(headers, ...headerNames.limit);\n const value = parseNumberHeader(raw);\n if (value !== undefined && value > 0) {\n return value;\n }\n const remaining = parseRateLimitRemaining(headers, headerNames);\n if (remaining === undefined) {\n return undefined;\n }\n return state.initial ? remaining + tokens : Math.max(remaining + tokens, state.limit);\n};\nconst parseRateLimitRemaining = (headers, headerNames) => {\n const raw = getHeader(headers, ...headerNames.remaining);\n const value = parseNumberHeader(raw);\n return value !== undefined && value >= 0 ? value : undefined;\n};\nconst parseRateLimitWindow = (clock, headers, headerNames) => {\n const resetAfter = parseResetAfter(getHeader(headers, ...headerNames.resetAfter));\n if (resetAfter !== undefined) {\n return resetAfter;\n }\n return parseResetHeader(clock, getHeader(headers, ...headerNames.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 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 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 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 => {\n if (response.status < 300 || response.status >= 400 || !response.headers.location || redirects >= (maxRedirects ?? 10)) {\n return Effect.succeed(response);\n }\n const url = new URL(response.headers.location, response.request.url);\n let nextRequest = request;\n if ((response.status === 301 || response.status === 302) && request.method === \"POST\" || response.status === 303 && request.method !== \"GET\" && request.method !== \"HEAD\") {\n nextRequest = HttpClientRequest.setMethod(nextRequest, \"GET\");\n nextRequest = HttpClientRequest.setBody(nextRequest, HttpBody.empty);\n }\n if (url.origin !== new URL(response.request.url).origin) {\n nextRequest = HttpClientRequest.removeHeader(nextRequest, \"authorization\");\n nextRequest = HttpClientRequest.removeHeader(nextRequest, \"proxy-authorization\");\n nextRequest = HttpClientRequest.removeHeader(nextRequest, \"cookie\");\n }\n return loop(HttpClientRequest.setUrl(nextRequest, url), redirects + 1);\n });\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 services\n * @since 4.0.0\n */\nexport const TracerDisabledWhen = /*#__PURE__*/Context.Reference(\"effect/http/HttpClient/TracerDisabledWhen\", {\n defaultValue: () => constFalse\n});\n/**\n * Context reference for filtering request and response headers added to client spans.\n *\n * @category services\n * @since 4.0.0\n */\nexport const TracerHeaderFilter = /*#__PURE__*/Context.Reference(\"effect/http/HttpClient/TracerHeaderFilter\", {\n defaultValue: () => constTrue\n});\n/**\n * Context reference that controls whether outgoing client spans are propagated to request headers.\n *\n * @category services\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 services\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","/**\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 = Context.getOrUndefined(fiber.context, RequestInit) ?? {};\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 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.assignProperty(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 of Object.keys(api.groups)) {\n const group = api.groups[key];\n InternalRecord.assignProperty(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.getStatusSuccessSchema),\n errors: extractResponseContent(HttpApiEndpoint.getErrorSchemas(endpoint), HttpApiSchema.getStatusErrorSchema)\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 const body = HttpApiSchema.isWithHeaders(schema) ? schema.schema : schema;\n if (HttpApiSchema.isStreamSchema(body)) return;\n const status = getStatus(schema);\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\";\nconst SseErrorTypeId = \"~effect/encoding/Sse/SseError\";\n/**\n * Error reason raised when pending Server-Sent Events state exceeds the\n * configured maximum size.\n *\n * @category errors\n * @since 4.0.0\n */\nexport class EventTooLarge extends /*#__PURE__*/Data.TaggedError(\"EventTooLarge\") {\n get message() {\n return `Pending SSE event exceeded the maximum size of ${this.maxEventSize}`;\n }\n}\n/**\n * Error raised when decoding a Server-Sent Events stream fails.\n *\n * @category errors\n * @since 4.0.0\n */\nexport class SseError extends /*#__PURE__*/Data.TaggedError(\"SseError\") {\n /**\n * Marks this value as an SSE decoding error.\n *\n * @since 4.0.0\n */\n [SseErrorTypeId] = SseErrorTypeId;\n /**\n * Delegates the public message to the underlying SSE error reason.\n *\n * @since 4.0.0\n */\n get message() {\n return this.reason.message;\n }\n}\nconst defaultMaxEventSize = 10 * 1024 * 1024;\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 = options => 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 }, options);\n const pump = Effect.flatMap(upstream, arr => {\n for (let i = 0; i < arr.length; i++) {\n const error = parser.feed(arr[i]);\n if (error !== undefined) {\n return Effect.fail(error);\n }\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, options) => Channel.pipeTo(decode(options), 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, options) => {\n const eventSchema = Schema.Struct({\n ...EventEncoded.fields,\n data: Schema.fromJsonString(schema)\n });\n return Channel.pipeTo(decode(options), 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. `feed` returns\n * an `SseError` if the pending event exceeds `maxEventSize`.\n *\n * @category decoding\n * @since 4.0.0\n */\nexport function makeParser(onParse, options) {\n const maxEventSize = options?.maxEventSize ?? defaultMaxEventSize;\n // Processing state\n let isFirstChunk;\n let buffer;\n let startingPosition;\n let startingFieldLength;\n let discardTrailingNewline;\n // Event state\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 discardTrailingNewline = false;\n lastEventId = undefined;\n eventName = undefined;\n data = \"\";\n }\n function feed(chunk) {\n buffer = buffer ? buffer + chunk : chunk;\n // Strip any UTF-8 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 && buffer.startsWith(BOM)) {\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 // 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 if (buffer.length + data.length > maxEventSize) {\n const error = new SseError({\n reason: new EventTooLarge({\n maxEventSize\n })\n });\n reset();\n return error;\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: lastEventId,\n event: eventName || \"message\",\n data: data.slice(0, -1) // remove trailing newline\n });\n data = \"\";\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 lastEventId = value;\n } else if (field === \"retry\" && /^\\d+$/.test(value)) {\n const retry = parseInt(value, 10);\n onParse(new Retry({\n duration: Duration.millis(retry),\n lastEventId\n }));\n }\n }\n}\nconst BOM = \"\\uFEFF\";\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 data += `data: ${event.data.replace(/\\n/g, \"\\ndata: \")}\\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 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 const streamSchema = isWithHeadersStreamSuccess(streamSuccess) ? streamSuccess.schema : streamSuccess;\n addResponseAlternative(successAlternatives, HttpApiSchema.getStatusSuccessSchema(streamSuccess), streamSchema.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.assignProperty(client, group.identifier, {});\n },\n onEndpoint({\n endpoint,\n endpointFn,\n group\n }) {\n InternalRecord.assignProperty(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.assignProperty(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 import.meta.vitest\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 * }) // => \"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.assignProperty(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.assignProperty(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 hasWithHeaders = schemas.some(schema => HttpApiSchema.isWithHeaders(schema) || HttpApiSchema.getWithHeadersAnnotation(schema.ast) !== undefined);\n const codec = hasWithHeaders ? Schema.Union(schemas.map(toCodecArrayBufferWithHeaders)) : toCodecArrayBuffer(schemas);\n const decode = Schema.decodeEffect(codec);\n return response => Effect.flatMap(response.arrayBuffer, hasWithHeaders ? body => decode({\n body,\n headers: response.headers\n }) : decode);\n}\nfunction toCodecArrayBufferWithHeaders(schema) {\n const isWithHeaders = HttpApiSchema.isWithHeaders(schema);\n const annotation = HttpApiSchema.getWithHeadersAnnotation(schema.ast);\n if (annotation !== undefined) {\n return Schema.Struct({\n body: fromArrayBuffer(annotation.body),\n headers: annotation.headersCodec\n }).pipe(Schema.decodeTo(schema));\n }\n const body = isWithHeaders ? schema.schema : schema;\n return Schema.Struct({\n body: fromArrayBuffer(body).pipe(Schema.decodeTo(body)),\n headers: isWithHeaders ? schema.headers : Schema.Unknown\n }).pipe(Schema.decodeTo(isWithHeaders ? schema : Schema.toType(schema), SchemaTransformation.transform({\n decode: value => isWithHeaders ? HttpApiSchema.withHeaders(value) : value.body,\n encode: value => isWithHeaders ? value : {\n body: value,\n headers: undefined\n }\n })));\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 body = HttpApiSchema.isWithHeaders(schema) ? schema.schema : schema;\n const contentType = HttpApiSchema.isNoContent(body.ast) ? \"\" : MediaType.normalize(HttpApiSchema.getResponseEncodingSchema(schema).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\";\nconst isWithHeadersStreamSuccess = schema => HttpApiSchema.isWithHeaders(schema);\nfunction getStreamSuccessSchemas(endpoint) {\n const schemas = [];\n for (const schema of endpoint.success) {\n const body = HttpApiSchema.isWithHeaders(schema) ? schema.schema : schema;\n if (HttpApiSchema.isStreamSchema(body)) {\n schemas.push(schema);\n }\n }\n return schemas;\n}\nfunction streamToResponse(successSchema) {\n const isWithHeaders = isWithHeadersStreamSuccess(successSchema);\n const streamSchema = isWithHeaders ? successSchema.schema : successSchema;\n const sse = HttpApiSchema.isStreamUint8Array(streamSchema) ? undefined : {\n declaration: streamSchema,\n decoder: makeSseDecoder(streamSchema)\n };\n const toStream = response => Effect.map(Effect.context(), context => Stream.provideContext(sse === undefined ? response.stream : decodeSseStream(response.stream, sse.declaration, sse.decoder), context));\n if (!isWithHeaders) return toStream;\n const decodeHeaders = Schema.decodeUnknownEffect(successSchema.headers);\n return response => Effect.flatMap(decodeHeaders(response.headers), headers => Effect.map(toStream(response), body => HttpApiSchema.withHeaders({\n body,\n headers\n })));\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 return fromArrayBuffer(schema).pipe(Schema.decodeTo(schema));\n }\n}\nfunction fromArrayBuffer(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 encodedIsNull ? UnknownFromArrayBuffer.pipe(Schema.decodeTo(Schema.Unknown, SchemaTransformation.transform({\n decode: a => a === undefined ? null : a,\n encode: a => a === null ? undefined : a\n }))) : UnknownFromArrayBuffer;\n }\n case \"FormUrlEncoded\":\n return StringFromArrayBuffer.pipe(Schema.decodeTo(UrlParams.schemaRecord));\n case \"Uint8Array\":\n return Uint8ArrayFromArrayBuffer;\n case \"Text\":\n return StringFromArrayBuffer;\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(input, options) {\n return Effect.fail(new SchemaIssue.Forbidden({\n message: \"Encode only schema\"\n }, input, options));\n },\n encode(t, options) {\n switch (encoding._tag) {\n case \"Multipart\":\n return Effect.fail(new SchemaIssue.Forbidden({\n message: \"Payload must be a FormData\"\n }, t, options));\n case \"Json\":\n {\n try {\n const body = JSON.stringify(t);\n return Effect.succeed(HttpBody.text(body, encoding.contentType));\n } catch {\n return Effect.fail(new SchemaIssue.InvalidValue({\n expected: \"a JSON-serializable request body\"\n }, t, options));\n }\n }\n case \"Text\":\n {\n if (typeof t !== \"string\") {\n return Effect.fail(new SchemaIssue.InvalidValue({\n message: \"Expected a string\"\n }, t, options));\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({\n message: \"Expected a record\"\n }, t, options));\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({\n message: \"Expected a Uint8Array\"\n }, t, options));\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","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 artifactBytes = Schema.Uint8Array.pipe(\n HttpApiSchema.asUint8Array({ contentType: \"application/octet-stream\" })\n)\nconst artifact = HttpApiEndpoint.post(\"artifact\", \"/artifact\", {\n payload: CodePipelineArtifactReadRequest,\n success: [\n artifactBytes,\n artifactBytes.pipe(HttpApiSchema.status(206)),\n artifactBytes.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","/**\n * Domain models for CodeCommit operations.\n *\n * Provides branded types for compile-time ID safety, `Schema.Class` models\n * with computed properties, and `Schema.Literal` enumerations. Central types\n * include {@link PullRequest} (with approval rules, approver ARNs, and\n * review detection), {@link ApprovalRule} (per-PR rule with pool members\n * and satisfaction state), and {@link PersistentNotification} (including\n * approval_requested and review_reminder types).\n *\n * **Mental model**\n *\n * - ApprovalRule: per-PR rule with pool members (normalized names) + raw ARNs\n * - needsMyReview: standalone fn (not method) so it works with wire objects too\n * - PersistentNotificationType: includes approval_requested, review_reminder\n *\n * **Gotchas**\n *\n * - ApprovalRule uses `Schema.Class`, but instances round-trip as plain objects\n * through JSON without class instance checks\n *\n * **Common tasks**\n *\n * - Define approval rule: {@link ApprovalRule}\n * - Check review needed: {@link needsMyReview}\n * - PR console URL: {@link codecommitConsoleUrl}\n * - Notification types: {@link PersistentNotificationType}\n *\n * **Quickstart**\n *\n * ```ts\n * import { needsMyReview, PullRequest } from \"./Domain.js\"\n *\n * declare const pr: PullRequest\n * if (needsMyReview(pr, \"alice\")) {\n * console.log(`Review needed: ${pr.consoleUrl}`)\n * }\n * ```\n *\n * @category Domain\n * @module\n */\nimport { Data, Effect, Schema, SchemaGetter, SchemaIssue } from \"effect\"\n\n// ---------------------------------------------------------------------------\n// Branded Types\n// ---------------------------------------------------------------------------\n\n/**\n * Branded pull request identifier.\n *\n * @category Domain\n */\nexport const PullRequestId = Schema.String.pipe(Schema.brand(\"PullRequestId\"))\nexport type PullRequestId = typeof PullRequestId.Type\n\n/**\n * Branded repository name.\n *\n * @category Domain\n */\nexport const RepositoryName = Schema.String.pipe(Schema.brand(\"RepositoryName\"))\nexport type RepositoryName = typeof RepositoryName.Type\n\n/**\n * Branded AWS profile name.\n *\n * @category Domain\n */\nexport const AwsProfileName = Schema.String.pipe(Schema.brand(\"AwsProfileName\"))\nexport type AwsProfileName = typeof AwsProfileName.Type\n\n/**\n * Branded AWS region name.\n *\n * @category Domain\n */\nexport const AwsRegion = Schema.String.pipe(Schema.brand(\"AwsRegion\"))\nexport type AwsRegion = typeof AwsRegion.Type\n\n/**\n * Branded comment identifier.\n *\n * @category Domain\n */\nexport const CommentId = Schema.String.pipe(Schema.brand(\"CommentId\"))\nexport type CommentId = typeof CommentId.Type\n\n/**\n * Branded sandbox identifier.\n *\n * @category Domain\n */\nexport const SandboxId = Schema.String.pipe(Schema.brand(\"SandboxId\"))\nexport type SandboxId = typeof SandboxId.Type\n\n// ---------------------------------------------------------------------------\n// Enumerations\n// ---------------------------------------------------------------------------\n\n/**\n * Pull request status.\n *\n * @category Domain\n */\nexport const PullRequestStatus = Schema.Literals([\"OPEN\", \"CLOSED\", \"MERGED\"])\nexport type PullRequestStatus = typeof PullRequestStatus.Type\n\n/** Normalizes provider/cache account identifiers; blank values are unresolved, not identities. */\nexport const normalizeAccountId = (value: string | null | undefined): string | undefined => {\n const normalized = value?.trim()\n return normalized === undefined || normalized.length === 0 ? undefined : normalized\n}\n\n/**\n * Notification severity type.\n *\n * @category Domain\n */\nexport const NotificationType = Schema.Literals([\"error\", \"info\", \"warning\", \"success\"])\nexport type NotificationType = typeof NotificationType.Type\n\n/**\n * Application loading status.\n *\n * @category Domain\n */\nexport const AppStatus = Schema.Literals([\"idle\", \"loading\", \"error\"])\nexport type AppStatus = typeof AppStatus.Type\n\n/**\n * Sandbox lifecycle status.\n *\n * @category Domain\n */\nexport const SandboxStatus = Schema.Literals([\n \"creating\",\n \"cloning\",\n \"starting\",\n \"running\",\n \"stopping\",\n \"stopped\",\n \"error\"\n])\nexport type SandboxStatus = typeof SandboxStatus.Type\n\n// ---------------------------------------------------------------------------\n// Domain Models\n// ---------------------------------------------------------------------------\n\n/**\n * AWS account reference (profile + region).\n *\n * @category Domain\n */\nexport class Account extends Schema.Class<Account>(\"Account\")({\n profile: AwsProfileName,\n region: AwsRegion,\n awsAccountId: Schema.optional(Schema.String),\n repoAccountId: Schema.optional(Schema.String)\n}) {}\n\n/**\n * Approval rule attached to a pull request.\n *\n * @category Domain\n */\nexport class ApprovalRule extends Schema.Class<ApprovalRule>(\"ApprovalRule\")({\n ruleName: Schema.String,\n requiredApprovals: Schema.Number,\n poolMembers: Schema.Array(Schema.String),\n poolMemberArns: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultTypeKey(Effect.succeed([]))),\n satisfied: Schema.Boolean,\n fromTemplate: Schema.optional(Schema.String)\n}) {}\n\n/**\n * CodeCommit pull request.\n *\n * @category Domain\n */\nexport class PullRequest extends Schema.Class<PullRequest>(\"PullRequest\")({\n id: PullRequestId,\n title: Schema.String,\n description: Schema.optional(Schema.String),\n author: Schema.String,\n repositoryName: RepositoryName,\n creationDate: Schema.Date,\n lastModifiedDate: Schema.Date,\n link: Schema.String,\n account: Account,\n status: PullRequestStatus,\n sourceBranch: Schema.String,\n destinationBranch: Schema.String,\n isMergeable: Schema.Boolean,\n isApproved: Schema.Boolean,\n commentCount: Schema.optional(Schema.Number),\n healthScore: Schema.optional(Schema.Number),\n fetchedAt: Schema.optional(Schema.Date),\n approvedBy: Schema.Array(Schema.String),\n approvedByArns: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultTypeKey(Effect.succeed([]))),\n commentedBy: Schema.Array(Schema.String),\n filesChanged: Schema.optional(Schema.Number),\n approvalRules: Schema.Array(ApprovalRule).pipe(Schema.withDecodingDefaultTypeKey(Effect.succeed([])))\n}) {\n get consoleUrl(): string {\n return codecommitConsoleUrl(this.account.region, this.repositoryName, this.id)\n }\n}\n\n/**\n * Robust identity comparison for matching a caller against an author or\n * approval-pool member.\n *\n * Both sides normally arrive already normalised by `normalizeAuthor`\n * (ARN → trailing `/`-segment), so the happy path is a plain equality. Under\n * cross-account SSO / assumed-role setups the two strings can still diverge —\n * e.g. one side is a full ARN or `AWSReservedSSO_<perm>_<id>/<user>` form while\n * the other is the bare username, or they differ only in case. This is a\n * SUPERSET of exact match: it still matches when the strings are equal, and\n * additionally matches when, after case-folding and reducing each side to its\n * final `/`- or `:`-segment (the username), the username segments are equal.\n * It deliberately anchors on the username segment so unrelated users never match.\n *\n * @category Domain\n */\nexport const identityMatches = (callerUsername: string, prAuthor: string): boolean => {\n const norm = (s: string) => s.trim().toLowerCase()\n const tail = (s: string) => {\n const segments = norm(s).split(/[/:]/).filter((seg) => seg.length > 0)\n return segments[segments.length - 1] ?? \"\"\n }\n const a = norm(callerUsername)\n const b = norm(prAuthor)\n if (a === \"\" || b === \"\") return false\n if (a === b) return true\n const ta = tail(callerUsername)\n const tb = tail(prAuthor)\n return ta !== \"\" && ta === tb\n}\n\n/**\n * Check if a PR needs review from the given user.\n * Standalone function so it works with both Schema.Class instances and plain wire objects.\n *\n * Uses {@link identityMatches} (a superset of exact equality) for the\n * caller-vs-pool-member and caller-vs-approver comparisons so SSO/ARN identity\n * forms still match when they refer to the same user.\n */\nexport const needsMyReview = (\n pr: { readonly approvalRules: ReadonlyArray<ApprovalRule>; readonly approvedBy: ReadonlyArray<string> },\n currentUser: string | undefined\n): boolean => {\n if (currentUser === undefined || currentUser.length === 0) return false\n if (pr.approvedBy.some((approver) => identityMatches(currentUser, approver))) return false\n return pr.approvalRules.some(\n (rule) => !rule.satisfied && rule.poolMembers.some((member) => identityMatches(currentUser, member))\n )\n}\n\nconst consoleDomainForRegion = (region: string): string =>\n region.startsWith(\"cn-\")\n ? \"console.amazonaws.cn\"\n : region.startsWith(\"us-gov-\")\n ? \"console.amazonaws-us-gov.com\"\n : \"console.aws.amazon.com\"\n\nexport const codecommitConsoleUrl = (region: string, repo: string, prId: string): string =>\n `https://${region}.${\n consoleDomainForRegion(\n region\n )\n }/codesuite/codecommit/repositories/${repo}/pull-requests/${prId}?region=${region}`\n\nconst CodeCommitLocatorRegion = AwsRegion.check(\n Schema.isPattern(/^[a-z]{2}(?:-gov)?-[a-z0-9-]+-[0-9]+$/u)\n)\nconst CodeCommitLocatorRepositoryName = RepositoryName.check(\n Schema.isPattern(/^[A-Za-z0-9._-]{1,100}$/u)\n)\nconst CodeCommitLocatorPullRequestId = PullRequestId.check(\n Schema.isPattern(/^[0-9]{1,200}$/u)\n)\n\n/** Provider coordinates recovered from an AWS CodeCommit console pull-request URL. */\nexport const CodeCommitPullRequestLocator = Schema.Struct({\n region: CodeCommitLocatorRegion,\n repositoryName: CodeCommitLocatorRepositoryName,\n pullRequestId: CodeCommitLocatorPullRequestId\n})\nexport type CodeCommitPullRequestLocator = typeof CodeCommitPullRequestLocator.Type\n\nconst codeCommitConsoleHost =\n /^(?<region>[a-z]{2}(?:-gov)?-[a-z0-9-]+-\\d+)\\.(?<domain>console\\.aws\\.amazon\\.com|console\\.amazonaws\\.cn|console\\.amazonaws-us-gov\\.com)$/u\nconst codeCommitPullRequestPath =\n /^\\/codesuite\\/codecommit\\/repositories\\/(?<repositoryName>[A-Za-z0-9._-]{1,100})\\/pull-requests\\/(?<pullRequestId>[0-9]{1,200})(?:\\/(?<view>activity|changes|details))?$/u\n\nconst parseCodeCommitPullRequestUrl = (input: string): CodeCommitPullRequestLocator | null => {\n if (!URL.canParse(input)) return null\n const url = new URL(input)\n const host = codeCommitConsoleHost.exec(url.hostname)\n const path = codeCommitPullRequestPath.exec(url.pathname)\n const region = host?.groups?.region\n const domain = host?.groups?.domain\n const repositoryName = path?.groups?.repositoryName\n const pullRequestId = path?.groups?.pullRequestId\n const view = path?.groups?.view\n const queryRegions = url.searchParams.getAll(\"region\")\n if (\n url.protocol !== \"https:\" ||\n url.port.length > 0 ||\n url.username.length > 0 ||\n url.password.length > 0 ||\n (url.hash.length > 0 && view !== \"activity\") ||\n region === undefined ||\n domain === undefined ||\n repositoryName === undefined ||\n pullRequestId === undefined ||\n domain !== consoleDomainForRegion(region) ||\n queryRegions.length > 1 ||\n (queryRegions.length === 1 && queryRegions[0] !== region)\n ) return null\n return {\n region: AwsRegion.make(region),\n repositoryName: RepositoryName.make(repositoryName),\n pullRequestId: PullRequestId.make(pullRequestId)\n }\n}\n\n/**\n * Decodes a shared AWS Console PR link into provider coordinates.\n *\n * The URL does not identify an AWS account. Callers must resolve the locator\n * within their authenticated workspace and reject ambiguous matches.\n */\nexport const CodeCommitPullRequestUrl = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(2_048)\n).pipe(\n Schema.decodeTo(CodeCommitPullRequestLocator, {\n decode: SchemaGetter.transformOrFail((input, options) => {\n const locator = parseCodeCommitPullRequestUrl(input)\n return locator === null\n ? Effect.fail(\n new SchemaIssue.InvalidValue({ expected: \"an AWS CodeCommit pull-request console URL\" }, input, options)\n )\n : Effect.succeed(locator)\n }),\n encode: SchemaGetter.transform(({ pullRequestId, region, repositoryName }) =>\n codecommitConsoleUrl(region, repositoryName, pullRequestId)\n )\n })\n)\n\n/**\n * Code sandbox instance for a pull request.\n *\n * @category Domain\n */\nexport class Sandbox extends Schema.Class<Sandbox>(\"Sandbox\")({\n id: SandboxId,\n pullRequestId: PullRequestId,\n awsAccountId: Schema.String,\n repositoryName: RepositoryName,\n sourceBranch: Schema.String,\n containerId: Schema.optional(Schema.String),\n port: Schema.optional(Schema.Number),\n workspacePath: Schema.String,\n status: SandboxStatus,\n error: Schema.optional(Schema.String),\n createdAt: Schema.Date,\n lastActivityAt: Schema.Date\n}) {}\n\n/**\n * Comment on a pull request.\n *\n * @category Domain\n */\nexport class PRComment extends Schema.Class<PRComment>(\"PRComment\")({\n id: CommentId,\n content: Schema.String,\n author: Schema.String,\n creationDate: Schema.Date,\n inReplyTo: Schema.optional(CommentId),\n deleted: Schema.Boolean,\n filePath: Schema.optional(Schema.String),\n lineNumber: Schema.optional(Schema.Number)\n}) {}\n\n/**\n * Recursive comment thread (root comment + nested replies).\n *\n * @category Domain\n */\nexport interface CommentThread {\n readonly root: PRComment\n readonly replies: ReadonlyArray<CommentThread>\n}\n\n/** Provider-relative side of a pull-request file position. */\nexport const RelativeFileVersion = Schema.Literals([\"BEFORE\", \"AFTER\"])\nexport type RelativeFileVersion = typeof RelativeFileVersion.Type\n\n/**\n * Comments grouped by file location in a pull request.\n *\n * @category Domain\n */\nexport interface PRCommentLocation {\n readonly filePath?: string\n readonly beforeCommitId?: string\n readonly afterCommitId?: string\n readonly relativeFileVersion?: RelativeFileVersion\n readonly comments: ReadonlyArray<CommentThread>\n}\n\n// ---------------------------------------------------------------------------\n// JSON-safe comment schemas (for HTTP API wire format)\n// ---------------------------------------------------------------------------\n\nconst PRCommentJson = Schema.Struct({\n id: Schema.String,\n content: Schema.String,\n author: Schema.String,\n creationDate: Schema.String,\n inReplyTo: Schema.optional(Schema.String),\n deleted: Schema.Boolean,\n filePath: Schema.optional(Schema.String),\n lineNumber: Schema.optional(Schema.Number)\n})\n\nexport interface CommentThreadJsonEncoded {\n readonly root: typeof PRCommentJson.Type\n readonly replies: ReadonlyArray<CommentThreadJsonEncoded>\n}\n\nconst CommentThreadJson: Schema.Codec<CommentThreadJsonEncoded> = Schema.Struct({\n root: PRCommentJson,\n replies: Schema.Array(Schema.suspend((): Schema.Codec<CommentThreadJsonEncoded> => CommentThreadJson))\n})\n\n/**\n * JSON-safe schema for comment locations (HTTP wire format).\n * Dates are ISO strings, no branded types.\n *\n * @category Domain\n */\nexport const PRCommentLocationJson = Schema.Struct({\n filePath: Schema.optional(Schema.String),\n beforeCommitId: Schema.optional(Schema.String),\n afterCommitId: Schema.optional(Schema.String),\n relativeFileVersion: Schema.optional(RelativeFileVersion),\n comments: Schema.Array(CommentThreadJson)\n})\n\n// NOTE: replies of deleted root comments are omitted — matches UI behavior\n// (deleted comments hide their subtree).\nconst serializeThread = (t: CommentThread): CommentThreadJsonEncoded => ({\n root: {\n id: t.root.id,\n content: t.root.content,\n author: t.root.author,\n creationDate: t.root.creationDate.toISOString(),\n ...((t.root.inReplyTo != null) && { inReplyTo: t.root.inReplyTo }),\n deleted: t.root.deleted,\n ...((t.root.filePath != null) && { filePath: t.root.filePath }),\n ...((t.root.lineNumber != null) && { lineNumber: t.root.lineNumber })\n },\n replies: t.root.deleted ? [] : t.replies.map(serializeThread)\n})\n\n/**\n * Encode PRCommentLocations to JSON-safe format for HTTP responses.\n *\n * @category Domain\n */\nexport const encodeCommentLocations = (\n locations: ReadonlyArray<PRCommentLocation>\n): ReadonlyArray<typeof PRCommentLocationJson.Type> =>\n locations.map((loc) => ({\n ...((loc.filePath != null) && { filePath: loc.filePath }),\n ...((loc.beforeCommitId != null) && { beforeCommitId: loc.beforeCommitId }),\n ...((loc.afterCommitId != null) && { afterCommitId: loc.afterCommitId }),\n ...((loc.relativeFileVersion != null) && { relativeFileVersion: loc.relativeFileVersion }),\n comments: loc.comments.map(serializeThread)\n }))\n\n// ---------------------------------------------------------------------------\n// Persistent Notification Types\n// ---------------------------------------------------------------------------\n\nexport const PersistentNotificationType = Schema.Literals([\n \"new_comment\",\n \"comment_edited\",\n \"comment_deleted\",\n \"approval_changed\",\n \"approval_requested\",\n \"review_reminder\",\n \"merge_changed\",\n \"title_changed\",\n \"description_changed\",\n \"pr_merged\",\n \"pr_closed\",\n \"pr_reopened\"\n])\nexport type PersistentNotificationType = typeof PersistentNotificationType.Type\n\nexport class PersistentNotification extends Schema.Class<PersistentNotification>(\"PersistentNotification\")({\n id: Schema.Number,\n pullRequestId: PullRequestId,\n awsAccountId: Schema.String,\n type: PersistentNotificationType,\n message: Schema.String,\n createdAt: Schema.Date,\n read: Schema.Boolean\n}) {}\n\nexport type PRSyncStatus = Data.TaggedEnum<{\n readonly Cached: { readonly fetchedAt: Date }\n readonly Syncing: { readonly fetchedAt: Date }\n readonly UpToDate: { readonly fetchedAt: Date }\n readonly Failed: { readonly fetchedAt: Date; readonly error: string }\n}>\nexport const PRSyncStatus = Data.taggedEnum<PRSyncStatus>()\n\n// ---------------------------------------------------------------------------\n// State Models\n// ---------------------------------------------------------------------------\n\n/**\n * Notification item with timestamp.\n *\n * @category Domain\n */\nexport class NotificationItem extends Schema.Class<NotificationItem>(\"NotificationItem\")({\n type: NotificationType,\n title: Schema.String,\n message: Schema.String,\n timestamp: Schema.Date,\n profile: Schema.optionalKey(Schema.String)\n}) {}\n\n/**\n * Notification state container.\n *\n * @category Domain\n */\nexport interface NotificationsState {\n readonly items: ReadonlyArray<NotificationItem>\n}\n\n/**\n * Account configuration in app state.\n *\n * @category Domain\n */\nexport interface AccountState {\n readonly profile: AwsProfileName\n readonly region: AwsRegion\n readonly enabled: boolean\n}\n\n/** Account-region scope whose pull-request list completed in the latest refresh. */\nexport interface PullRequestRefreshScope {\n readonly profile: AwsProfileName\n readonly region: AwsRegion\n readonly awsAccountId: string\n}\n\n/**\n * Application state.\n *\n * @category Domain\n */\nexport interface AppState {\n readonly pullRequests: ReadonlyArray<PullRequest>\n readonly accounts: ReadonlyArray<AccountState>\n readonly status: AppStatus\n readonly statusDetail?: string | undefined\n readonly error?: string | undefined\n readonly lastUpdated?: Date\n readonly currentUser?: string\n readonly pendingReviewCount?: number\n /** Monotonic sequence incremented when a list refresh starts. */\n readonly refreshGeneration?: number\n readonly successfulRefreshScopes?: ReadonlyArray<PullRequestRefreshScope>\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 taskUpdatesSafe: Schema.optionalKey(Schema.Boolean),\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 = {\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} satisfies Readonly<\n Record<RelationshipKind, RelationshipEndpointRule>\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 { 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 CodeCommitDomain from \"@knpkv/codecommit-core/Domain.js\"\nimport * 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/** Browser-safe exact CodeCommit match returned by the server-side batch resolver. */\nexport const CodeCommitPullRequestCandidate = Schema.Struct({\n entityId: EntityId,\n accountLabel: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(500)),\n title: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(1_000))\n})\nexport type CodeCommitPullRequestCandidate = typeof CodeCommitPullRequestCandidate.Type\n\n/** Fail-closed result because shared console URLs contain no AWS account identity. */\nexport const CodeCommitPullRequestResolution = Schema.TaggedUnion({\n found: { candidate: CodeCommitPullRequestCandidate },\n ambiguous: {\n candidates: boundedArray(CodeCommitPullRequestCandidate, MAXIMUM_WORKSPACE_ENTITY_PROJECTIONS)\n },\n \"account-identity-unavailable\": {},\n \"not-found\": { indexTruncated: Schema.Boolean }\n})\nexport type CodeCommitPullRequestResolution = typeof CodeCommitPullRequestResolution.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 sourceSynchronizationAvailable: 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 resolveCodeCommitPullRequest = HttpApiEndpoint.post(\n \"resolveCodeCommitPullRequest\",\n \"/api/v1/codecommit/pull-requests/resolve\",\n {\n payload: CodeCommitDomain.CodeCommitPullRequestLocator,\n success: CodeCommitPullRequestResolution,\n error: readErrors\n }\n)\n .middleware(SessionCookieAuth)\n .middleware(SessionMutationAuth)\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 resolveCodeCommitPullRequest,\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":"2hEA+DA,IAAaA,GAAS,OAAgB,CACpC,IAAM,EAASC,GAAoBC,GAAqB,CAAM,CAAC,EAC/D,OAAOC,GAAuB,EAAU,IAAWC,EAAeC,EAAe,EAAU,GAAS,EAAO,CAAK,CAAC,CAAC,CAAC,CACrH,ECvCMC,GAAS,0BAmBF,GAA0B,GAAgB,mBAAmB,EA2E7D,GAAiC,GAAK,GAAI,EAAM,IAAMC,GAAS,GAAW,EAAE,EAAK,YAAY,CAAO,CAAC,EAAG,EAAK,UAAU,CAAC,EA8DxHA,IAAY,EAAa,IAAe,CACnD,IAAM,EAAO,OAAO,OAAOC,EAAK,EAMhC,MALA,GAAK,WAAa,EAClB,EAAK,YAAc,EACnB,EAAK,QAAU,SAAU,EAAS,CAChC,OAAO,EAAY,EAAW,CAAO,CAAC,CACxC,EACO,CACT,EACMA,GAAQ,EACXF,IAASA,GACV,MAAO,CACL,OAAO,GAAc,KAAM,SAAS,CACtC,EACA,GAAGG,GACH,QAAS,CACP,MAAO,CACL,IAAK,mBACP,CACF,EACA,GAAiB,OAAO,YAAyB,GAAoB,KAAK,CAAC,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