@dxos/plugin-github 0.7.4 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +102 -5
- package/PLUGIN.mdl +784 -0
- package/dist/lib/GitHubCapabilities.mjs +10 -0
- package/dist/lib/GitHubCapabilities.mjs.map +1 -0
- package/dist/lib/GitHubEvents.mjs +15 -0
- package/dist/lib/GitHubEvents.mjs.map +1 -0
- package/dist/lib/GitHubOperation.mjs +384 -0
- package/dist/lib/GitHubOperation.mjs.map +1 -0
- package/dist/lib/GitHubPlugin.mjs +16 -0
- package/dist/lib/GitHubPlugin.mjs.map +1 -0
- package/dist/lib/Walkthrough.mjs +59 -0
- package/dist/lib/Walkthrough.mjs.map +1 -0
- package/dist/lib/capabilities.browser.mjs +54 -0
- package/dist/lib/capabilities.browser.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +54 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/capabilities.node.mjs +30 -0
- package/dist/lib/capabilities.node.mjs.map +1 -0
- package/dist/lib/capabilities.tauri.mjs +54 -0
- package/dist/lib/capabilities.tauri.mjs.map +1 -0
- package/dist/lib/capabilities.workerd.mjs +30 -0
- package/dist/lib/capabilities.workerd.mjs.map +1 -0
- package/dist/lib/chunk-ImportPullRequestDialog.mjs +116 -0
- package/dist/lib/chunk-ImportPullRequestDialog.mjs.map +1 -0
- package/dist/lib/chunk-PLUGIN.mjs +6 -0
- package/dist/lib/chunk-PLUGIN.mjs.map +1 -0
- package/dist/lib/chunk-PullRequestArticle.mjs +1506 -0
- package/dist/lib/chunk-PullRequestArticle.mjs.map +1 -0
- package/dist/lib/chunk-PullRequestArticle2.mjs +2 -0
- package/dist/lib/chunk-PullRequestCardMenu.mjs +123 -0
- package/dist/lib/chunk-PullRequestCardMenu.mjs.map +1 -0
- package/dist/lib/chunk-PullRequestsArticle.mjs +594 -0
- package/dist/lib/chunk-PullRequestsArticle.mjs.map +1 -0
- package/dist/lib/chunk-WalkthroughArticle.mjs +26 -0
- package/dist/lib/chunk-WalkthroughArticle.mjs.map +1 -0
- package/dist/lib/chunk-add-pull-request-comment.mjs +19 -0
- package/dist/lib/chunk-add-pull-request-comment.mjs.map +1 -0
- package/dist/lib/chunk-add-pull-request-review-comment.mjs +25 -0
- package/dist/lib/chunk-add-pull-request-review-comment.mjs.map +1 -0
- package/dist/lib/chunk-app-graph-builder.mjs +39 -0
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
- package/dist/lib/chunk-connector.mjs +70 -0
- package/dist/lib/chunk-connector.mjs.map +1 -0
- package/dist/lib/chunk-constants.mjs +11 -0
- package/dist/lib/chunk-constants.mjs.map +1 -0
- package/dist/lib/chunk-errors.mjs +29 -0
- package/dist/lib/chunk-errors.mjs.map +1 -0
- package/dist/lib/chunk-generate-walkthrough.mjs +86 -0
- package/dist/lib/chunk-generate-walkthrough.mjs.map +1 -0
- package/dist/lib/chunk-generate.mjs +719 -0
- package/dist/lib/chunk-generate.mjs.map +1 -0
- package/dist/lib/chunk-get-pull-request-diff.mjs +25 -0
- package/dist/lib/chunk-get-pull-request-diff.mjs.map +1 -0
- package/dist/lib/chunk-get-pull-request-status.mjs +29 -0
- package/dist/lib/chunk-get-pull-request-status.mjs.map +1 -0
- package/dist/lib/chunk-get-repositories.mjs +32 -0
- package/dist/lib/chunk-get-repositories.mjs.map +1 -0
- package/dist/lib/chunk-github-api.mjs +375 -0
- package/dist/lib/chunk-github-api.mjs.map +1 -0
- package/dist/lib/chunk-github-link.mjs +59 -0
- package/dist/lib/chunk-github-link.mjs.map +1 -0
- package/dist/lib/chunk-import-pull-request-from-snapshot.mjs +25 -0
- package/dist/lib/chunk-import-pull-request-from-snapshot.mjs.map +1 -0
- package/dist/lib/chunk-import-pull-request.mjs +171 -0
- package/dist/lib/chunk-import-pull-request.mjs.map +1 -0
- package/dist/lib/chunk-link-resolver.mjs +109 -0
- package/dist/lib/chunk-link-resolver.mjs.map +1 -0
- package/dist/lib/chunk-markdown-extension.mjs +92 -0
- package/dist/lib/chunk-markdown-extension.mjs.map +1 -0
- package/dist/lib/chunk-materialize-target.mjs +36 -0
- package/dist/lib/chunk-materialize-target.mjs.map +1 -0
- package/dist/lib/chunk-operation-handler.mjs +12 -0
- package/dist/lib/chunk-operation-handler.mjs.map +1 -0
- package/dist/lib/chunk-page-action.mjs +22 -0
- package/dist/lib/chunk-page-action.mjs.map +1 -0
- package/dist/lib/chunk-pull-request.mjs +58 -0
- package/dist/lib/chunk-pull-request.mjs.map +1 -0
- package/dist/lib/chunk-pull-request2.mjs +110 -0
- package/dist/lib/chunk-pull-request2.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +233 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-refresh-pull-requests.mjs +49 -0
- package/dist/lib/chunk-refresh-pull-requests.mjs.map +1 -0
- package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
- package/dist/lib/chunk-schema.mjs +15 -0
- package/dist/lib/chunk-schema.mjs.map +1 -0
- package/dist/lib/chunk-skill-definition.mjs +10 -0
- package/dist/lib/chunk-skill-definition.mjs.map +1 -0
- package/dist/lib/chunk-submit-pull-request-approval.mjs +56 -0
- package/dist/lib/chunk-submit-pull-request-approval.mjs.map +1 -0
- package/dist/lib/chunk-sync-pull-request.mjs +26 -0
- package/dist/lib/chunk-sync-pull-request.mjs.map +1 -0
- package/dist/lib/chunk-sync.mjs +481 -0
- package/dist/lib/chunk-sync.mjs.map +1 -0
- package/dist/lib/chunk-useOpenObject.mjs +43 -0
- package/dist/lib/chunk-useOpenObject.mjs.map +1 -0
- package/dist/lib/extensions.mjs +132 -0
- package/dist/lib/extensions.mjs.map +1 -0
- package/dist/lib/index.mjs +4 -0
- package/dist/lib/meta.mjs +47 -0
- package/dist/lib/meta.mjs.map +1 -0
- package/dist/lib/ns/Extensions.mjs +18 -0
- package/dist/lib/ns/Extensions.mjs.map +1 -0
- package/dist/lib/operations.mjs +23 -0
- package/dist/lib/operations.mjs.map +1 -0
- package/dist/lib/plugin.mjs +9 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/skills.mjs +44 -0
- package/dist/lib/skills.mjs.map +1 -0
- package/dist/lib/testing.mjs +189 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/lib/translations.mjs +136 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +5 -0
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/Extensions.d.ts +2 -0
- package/dist/types/src/Extensions.d.ts.map +1 -0
- package/dist/types/src/GitHubPlugin.d.ts +37 -0
- package/dist/types/src/GitHubPlugin.d.ts.map +1 -0
- package/dist/types/src/GitHubPlugin.workerd.test.d.ts +2 -0
- package/dist/types/src/GitHubPlugin.workerd.test.d.ts.map +1 -0
- package/dist/types/src/approval.d.ts +21 -0
- package/dist/types/src/approval.d.ts.map +1 -0
- package/dist/types/src/approval.test.d.ts +2 -0
- package/dist/types/src/approval.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +9 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/connector.d.ts +17 -0
- package/dist/types/src/capabilities/connector.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/browser.d.ts +13 -0
- package/dist/types/src/capabilities/gen/browser.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/node.d.ts +13 -0
- package/dist/types/src/capabilities/gen/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/tauri.d.ts +13 -0
- package/dist/types/src/capabilities/gen/tauri.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts +13 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +13 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/link-resolver.d.ts +10 -0
- package/dist/types/src/capabilities/link-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/markdown-extension.d.ts +14 -0
- package/dist/types/src/capabilities/markdown-extension.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +5 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/page-action.d.ts +5 -0
- package/dist/types/src/capabilities/page-action.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema.d.ts +12 -0
- package/dist/types/src/capabilities/schema.d.ts.map +1 -0
- package/dist/types/src/capabilities/skill-definition.d.ts +5 -0
- package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -0
- package/dist/types/src/cards/GitHubCard.d.ts +11 -0
- package/dist/types/src/cards/GitHubCard.d.ts.map +1 -0
- package/dist/types/src/cards/GitHubCard.stories.d.ts +45 -0
- package/dist/types/src/cards/GitHubCard.stories.d.ts.map +1 -0
- package/dist/types/src/cards/PullRequestCard.d.ts +9 -0
- package/dist/types/src/cards/PullRequestCard.d.ts.map +1 -0
- package/dist/types/src/cards/index.d.ts +3 -0
- package/dist/types/src/cards/index.d.ts.map +1 -0
- package/dist/types/src/components/CommentComposer/CommentComposer.d.ts +30 -0
- package/dist/types/src/components/CommentComposer/CommentComposer.d.ts.map +1 -0
- package/dist/types/src/components/CommentComposer/index.d.ts +2 -0
- package/dist/types/src/components/CommentComposer/index.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/DiffStat.d.ts +8 -0
- package/dist/types/src/components/PullRequestFiles/DiffStat.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/FileTree.d.ts +17 -0
- package/dist/types/src/components/PullRequestFiles/FileTree.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/PullRequestFiles.d.ts +23 -0
- package/dist/types/src/components/PullRequestFiles/PullRequestFiles.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/files.d.ts +39 -0
- package/dist/types/src/components/PullRequestFiles/files.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/files.test.d.ts +2 -0
- package/dist/types/src/components/PullRequestFiles/files.test.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/index.d.ts +5 -0
- package/dist/types/src/components/PullRequestFiles/index.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/ArtifactPill.d.ts +21 -0
- package/dist/types/src/components/PullRequestOverview/ArtifactPill.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/CheckRunList.d.ts +18 -0
- package/dist/types/src/components/PullRequestOverview/CheckRunList.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/CheckRunList.test.d.ts +2 -0
- package/dist/types/src/components/PullRequestOverview/CheckRunList.test.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/PullRequestDetails.d.ts +10 -0
- package/dist/types/src/components/PullRequestOverview/PullRequestDetails.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/PullRequestOverview.d.ts +16 -0
- package/dist/types/src/components/PullRequestOverview/PullRequestOverview.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/RelatedCards.d.ts +28 -0
- package/dist/types/src/components/PullRequestOverview/RelatedCards.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/index.d.ts +6 -0
- package/dist/types/src/components/PullRequestOverview/index.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestStatus/PullRequestStatus.d.ts +20 -0
- package/dist/types/src/components/PullRequestStatus/PullRequestStatus.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestStatus/index.d.ts +2 -0
- package/dist/types/src/components/PullRequestStatus/index.d.ts.map +1 -0
- package/dist/types/src/components/WalkthroughView/WalkthroughView.d.ts +18 -0
- package/dist/types/src/components/WalkthroughView/WalkthroughView.d.ts.map +1 -0
- package/dist/types/src/components/WalkthroughView/extensions.d.ts +16 -0
- package/dist/types/src/components/WalkthroughView/extensions.d.ts.map +1 -0
- package/dist/types/src/components/WalkthroughView/index.d.ts +3 -0
- package/dist/types/src/components/WalkthroughView/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +5 -8
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +7 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.d.ts +6 -0
- package/dist/types/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.d.ts.map +1 -0
- package/dist/types/src/containers/ImportPullRequestDialog/index.d.ts +3 -0
- package/dist/types/src/containers/ImportPullRequestDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestArticle/PullRequestArticle.d.ts +15 -0
- package/dist/types/src/containers/PullRequestArticle/PullRequestArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestArticle/failure.d.ts +10 -0
- package/dist/types/src/containers/PullRequestArticle/failure.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestArticle/failure.test.d.ts +2 -0
- package/dist/types/src/containers/PullRequestArticle/failure.test.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PullRequestArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestCardMenu/PullRequestCardMenu.d.ts +14 -0
- package/dist/types/src/containers/PullRequestCardMenu/PullRequestCardMenu.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestCardMenu/index.d.ts +2 -0
- package/dist/types/src/containers/PullRequestCardMenu/index.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/PullRequestsArticle.d.ts +13 -0
- package/dist/types/src/containers/PullRequestsArticle/PullRequestsArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/arrange.d.ts +44 -0
- package/dist/types/src/containers/PullRequestsArticle/arrange.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/arrange.test.d.ts +2 -0
- package/dist/types/src/containers/PullRequestsArticle/arrange.test.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/format.d.ts +3 -0
- package/dist/types/src/containers/PullRequestsArticle/format.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PullRequestsArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/WalkthroughArticle/WalkthroughArticle.d.ts +13 -0
- package/dist/types/src/containers/WalkthroughArticle/WalkthroughArticle.d.ts.map +1 -0
- package/dist/types/src/containers/WalkthroughArticle/index.d.ts +2 -0
- package/dist/types/src/containers/WalkthroughArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +7 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/errors.d.ts +157 -0
- package/dist/types/src/errors.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +3 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -0
- package/dist/types/src/extensions/links.d.ts +21 -0
- package/dist/types/src/extensions/links.d.ts.map +1 -0
- package/dist/types/src/extensions/links.test.d.ts +2 -0
- package/dist/types/src/extensions/links.test.d.ts.map +1 -0
- package/dist/types/src/extensions/references.d.ts +23 -0
- package/dist/types/src/extensions/references.d.ts.map +1 -0
- package/dist/types/src/extensions/references.test.d.ts +2 -0
- package/dist/types/src/extensions/references.test.d.ts.map +1 -0
- package/dist/types/src/github-link.d.ts +29 -0
- package/dist/types/src/github-link.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +5 -2
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useOpenObject.d.ts +9 -0
- package/dist/types/src/hooks/useOpenObject.d.ts.map +1 -0
- package/dist/types/src/hooks/usePullRequestChecks.d.ts +10 -0
- package/dist/types/src/hooks/usePullRequestChecks.d.ts.map +1 -0
- package/dist/types/src/hooks/usePullRequestDiff.d.ts +12 -0
- package/dist/types/src/hooks/usePullRequestDiff.d.ts.map +1 -0
- package/dist/types/src/hooks/usePullRequestFiles.d.ts +22 -0
- package/dist/types/src/hooks/usePullRequestFiles.d.ts.map +1 -0
- package/dist/types/src/hooks/useSyncPullRequest.d.ts +10 -0
- package/dist/types/src/hooks/useSyncPullRequest.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +34 -11
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/add-pull-request-comment.d.ts +5 -0
- package/dist/types/src/operations/add-pull-request-comment.d.ts.map +1 -0
- package/dist/types/src/operations/add-pull-request-review-comment.d.ts +5 -0
- package/dist/types/src/operations/add-pull-request-review-comment.d.ts.map +1 -0
- package/dist/types/src/operations/generate-walkthrough.d.ts +11 -0
- package/dist/types/src/operations/generate-walkthrough.d.ts.map +1 -0
- package/dist/types/src/operations/get-pull-request-diff.d.ts +5 -0
- package/dist/types/src/operations/get-pull-request-diff.d.ts.map +1 -0
- package/dist/types/src/operations/get-pull-request-status.d.ts +5 -0
- package/dist/types/src/operations/get-pull-request-status.d.ts.map +1 -0
- package/dist/types/src/operations/get-repositories.d.ts +13 -0
- package/dist/types/src/operations/get-repositories.d.ts.map +1 -0
- package/dist/types/src/operations/import-pull-request-from-snapshot.d.ts +12 -0
- package/dist/types/src/operations/import-pull-request-from-snapshot.d.ts.map +1 -0
- package/dist/types/src/operations/import-pull-request.d.ts +63 -0
- package/dist/types/src/operations/import-pull-request.d.ts.map +1 -0
- package/dist/types/src/operations/import-pull-request.test.d.ts +2 -0
- package/dist/types/src/operations/import-pull-request.test.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/materialize-target.d.ts +12 -0
- package/dist/types/src/operations/materialize-target.d.ts.map +1 -0
- package/dist/types/src/operations/pull-request.d.ts +48 -0
- package/dist/types/src/operations/pull-request.d.ts.map +1 -0
- package/dist/types/src/operations/pull-request.test.d.ts +2 -0
- package/dist/types/src/operations/pull-request.test.d.ts.map +1 -0
- package/dist/types/src/operations/refresh-pull-requests.d.ts +5 -0
- package/dist/types/src/operations/refresh-pull-requests.d.ts.map +1 -0
- package/dist/types/src/operations/refresh.d.ts +37 -0
- package/dist/types/src/operations/refresh.d.ts.map +1 -0
- package/dist/types/src/operations/refresh.test.d.ts +2 -0
- package/dist/types/src/operations/refresh.test.d.ts.map +1 -0
- package/dist/types/src/operations/submit-pull-request-approval.d.ts +5 -0
- package/dist/types/src/operations/submit-pull-request-approval.d.ts.map +1 -0
- package/dist/types/src/operations/sync-pull-request.d.ts +5 -0
- package/dist/types/src/operations/sync-pull-request.d.ts.map +1 -0
- package/dist/types/src/operations/sync.d.ts +123 -0
- package/dist/types/src/operations/sync.d.ts.map +1 -0
- package/dist/types/src/operations/sync.test.d.ts +2 -0
- package/dist/types/src/operations/sync.test.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/plugin.test.d.ts +2 -0
- package/dist/types/src/plugin.test.d.ts.map +1 -0
- package/dist/types/src/pull-request-body.d.ts +37 -0
- package/dist/types/src/pull-request-body.d.ts.map +1 -0
- package/dist/types/src/pull-request-body.test.d.ts +2 -0
- package/dist/types/src/pull-request-body.test.d.ts.map +1 -0
- package/dist/types/src/pull-request.d.ts +28 -0
- package/dist/types/src/pull-request.d.ts.map +1 -0
- package/dist/types/src/pull-request.test.d.ts +2 -0
- package/dist/types/src/pull-request.test.d.ts.map +1 -0
- package/dist/types/src/services/github-api.d.ts +332 -0
- package/dist/types/src/services/github-api.d.ts.map +1 -0
- package/dist/types/src/services/index.d.ts +2 -0
- package/dist/types/src/services/index.d.ts.map +1 -0
- package/dist/types/src/skills/GitHubSkill.d.ts +12 -0
- package/dist/types/src/skills/GitHubSkill.d.ts.map +1 -0
- package/dist/types/src/skills/index.d.ts +2 -0
- package/dist/types/src/skills/index.d.ts.map +1 -0
- package/dist/types/src/stories/Generate.stories.d.ts +27 -0
- package/dist/types/src/stories/Generate.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Links.stories.d.ts +23 -0
- package/dist/types/src/stories/Links.stories.d.ts.map +1 -0
- package/dist/types/src/stories/PullRequestArticle.stories.d.ts +359 -0
- package/dist/types/src/stories/PullRequestArticle.stories.d.ts.map +1 -0
- package/dist/types/src/stories/PullRequestFiles.stories.d.ts +365 -0
- package/dist/types/src/stories/PullRequestFiles.stories.d.ts.map +1 -0
- package/dist/types/src/stories/PullRequestOverview.stories.d.ts +367 -0
- package/dist/types/src/stories/PullRequestOverview.stories.d.ts.map +1 -0
- package/dist/types/src/stories/PullRequestsArticle.stories.d.ts +357 -0
- package/dist/types/src/stories/PullRequestsArticle.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Walkthrough.stories.d.ts +380 -0
- package/dist/types/src/stories/Walkthrough.stories.d.ts.map +1 -0
- package/dist/types/src/stories/github.d.ts +23 -0
- package/dist/types/src/stories/github.d.ts.map +1 -0
- package/dist/types/src/stories/github.test.d.ts +2 -0
- package/dist/types/src/stories/github.test.d.ts.map +1 -0
- package/dist/types/src/stories/walkthrough-fixture.d.ts +8 -0
- package/dist/types/src/stories/walkthrough-fixture.d.ts.map +1 -0
- package/dist/types/src/testing/fixtures.d.ts +14 -0
- package/dist/types/src/testing/fixtures.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +4 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/plugin.d.ts +4 -0
- package/dist/types/src/testing/plugin.d.ts.map +1 -0
- package/dist/types/src/testing/pull-request-13348.d.ts +6 -0
- package/dist/types/src/testing/pull-request-13348.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +339 -53
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/GitHubCapabilities.d.ts +13 -0
- package/dist/types/src/types/GitHubCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/GitHubEvents.d.ts +8 -0
- package/dist/types/src/types/GitHubEvents.d.ts.map +1 -0
- package/dist/types/src/types/GitHubOperation.d.ts +281 -0
- package/dist/types/src/types/GitHubOperation.d.ts.map +1 -0
- package/dist/types/src/types/PullRequestsView.d.ts +35 -0
- package/dist/types/src/types/PullRequestsView.d.ts.map +1 -0
- package/dist/types/src/types/Walkthrough.d.ts +31 -0
- package/dist/types/src/types/Walkthrough.d.ts.map +1 -0
- package/dist/types/src/types/Walkthrough.test.d.ts +2 -0
- package/dist/types/src/types/Walkthrough.test.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +5 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/walkthrough/fill.d.ts +28 -0
- package/dist/types/src/walkthrough/fill.d.ts.map +1 -0
- package/dist/types/src/walkthrough/fill.test.d.ts +2 -0
- package/dist/types/src/walkthrough/fill.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/generate.d.ts +67 -0
- package/dist/types/src/walkthrough/generate.d.ts.map +1 -0
- package/dist/types/src/walkthrough/generate.test.d.ts +2 -0
- package/dist/types/src/walkthrough/generate.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/generated.d.ts +20 -0
- package/dist/types/src/walkthrough/generated.d.ts.map +1 -0
- package/dist/types/src/walkthrough/generated.test.d.ts +2 -0
- package/dist/types/src/walkthrough/generated.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/headings.d.ts +8 -0
- package/dist/types/src/walkthrough/headings.d.ts.map +1 -0
- package/dist/types/src/walkthrough/headings.test.d.ts +2 -0
- package/dist/types/src/walkthrough/headings.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/index.d.ts +9 -0
- package/dist/types/src/walkthrough/index.d.ts.map +1 -0
- package/dist/types/src/walkthrough/patch.d.ts +48 -0
- package/dist/types/src/walkthrough/patch.d.ts.map +1 -0
- package/dist/types/src/walkthrough/plan.d.ts +55 -0
- package/dist/types/src/walkthrough/plan.d.ts.map +1 -0
- package/dist/types/src/walkthrough/plan.test.d.ts +2 -0
- package/dist/types/src/walkthrough/plan.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/prompt.d.ts +33 -0
- package/dist/types/src/walkthrough/prompt.d.ts.map +1 -0
- package/dist/types/src/walkthrough/prompt.test.d.ts +2 -0
- package/dist/types/src/walkthrough/prompt.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/score.d.ts +43 -0
- package/dist/types/src/walkthrough/score.d.ts.map +1 -0
- package/dist/types/src/walkthrough/score.test.d.ts +2 -0
- package/dist/types/src/walkthrough/score.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/dx.config.ts +39 -0
- package/package.json +167 -48
- package/src/Extensions.ts +7 -0
- package/src/GitHubPlugin.ts +15 -0
- package/src/GitHubPlugin.workerd.test.ts +23 -0
- package/src/approval.test.ts +40 -0
- package/src/approval.ts +39 -0
- package/src/capabilities/app-graph-builder.ts +47 -0
- package/src/capabilities/connector.ts +95 -0
- package/src/capabilities/gen/browser.ts +82 -0
- package/src/capabilities/gen/node.ts +43 -0
- package/src/capabilities/gen/tauri.ts +82 -0
- package/src/capabilities/gen/workerd.ts +43 -0
- package/src/capabilities/index.ts +71 -0
- package/src/capabilities/link-resolver.ts +137 -0
- package/src/capabilities/markdown-extension.ts +146 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/page-action.ts +32 -0
- package/src/capabilities/react-surface.ts +98 -0
- package/src/capabilities/schema.ts +16 -0
- package/src/capabilities/skill-definition.ts +14 -0
- package/src/cards/GitHubCard.stories.tsx +165 -0
- package/src/cards/GitHubCard.tsx +93 -0
- package/src/cards/PullRequestCard.tsx +23 -0
- package/src/cards/index.ts +6 -0
- package/src/components/CommentComposer/CommentComposer.tsx +109 -0
- package/src/components/CommentComposer/index.ts +5 -0
- package/src/components/PullRequestFiles/DiffStat.tsx +15 -0
- package/src/components/PullRequestFiles/FileTree.tsx +102 -0
- package/src/components/PullRequestFiles/PullRequestFiles.tsx +87 -0
- package/src/components/PullRequestFiles/files.test.ts +59 -0
- package/src/components/PullRequestFiles/files.ts +115 -0
- package/src/components/PullRequestFiles/index.ts +8 -0
- package/src/components/PullRequestOverview/ArtifactPill.tsx +82 -0
- package/src/components/PullRequestOverview/CheckRunList.test.ts +29 -0
- package/src/components/PullRequestOverview/CheckRunList.tsx +141 -0
- package/src/components/PullRequestOverview/PullRequestDetails.tsx +15 -0
- package/src/components/PullRequestOverview/PullRequestOverview.tsx +110 -0
- package/src/components/PullRequestOverview/RelatedCards.tsx +147 -0
- package/src/components/PullRequestOverview/index.ts +9 -0
- package/src/components/PullRequestStatus/PullRequestStatus.tsx +84 -0
- package/src/components/PullRequestStatus/index.ts +5 -0
- package/src/components/WalkthroughView/WalkthroughView.tsx +62 -0
- package/src/components/WalkthroughView/extensions.ts +53 -0
- package/src/components/WalkthroughView/index.ts +6 -0
- package/src/components/index.ts +6 -9
- package/src/constants.ts +12 -0
- package/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.tsx +160 -0
- package/src/containers/ImportPullRequestDialog/index.ts +7 -0
- package/src/containers/PullRequestArticle/PullRequestArticle.tsx +573 -0
- package/src/containers/PullRequestArticle/failure.test.ts +42 -0
- package/src/containers/PullRequestArticle/failure.ts +16 -0
- package/src/containers/PullRequestArticle/index.ts +5 -0
- package/src/containers/PullRequestCardMenu/PullRequestCardMenu.tsx +134 -0
- package/src/containers/PullRequestCardMenu/index.ts +5 -0
- package/src/containers/PullRequestsArticle/PullRequestsArticle.tsx +361 -0
- package/src/containers/PullRequestsArticle/arrange.test.ts +122 -0
- package/src/containers/PullRequestsArticle/arrange.ts +245 -0
- package/src/containers/PullRequestsArticle/format.ts +31 -0
- package/src/containers/PullRequestsArticle/index.ts +5 -0
- package/src/containers/WalkthroughArticle/WalkthroughArticle.tsx +31 -0
- package/src/containers/WalkthroughArticle/index.ts +5 -0
- package/src/containers/index.ts +11 -0
- package/src/errors.ts +61 -0
- package/src/extensions/index.ts +6 -0
- package/src/extensions/links.test.ts +133 -0
- package/src/extensions/links.ts +91 -0
- package/src/extensions/references.test.ts +83 -0
- package/src/extensions/references.ts +100 -0
- package/src/github-link.ts +70 -0
- package/src/hooks/index.ts +6 -3
- package/src/hooks/useOpenObject.ts +48 -0
- package/src/hooks/usePullRequestChecks.ts +81 -0
- package/src/hooks/usePullRequestDiff.ts +57 -0
- package/src/hooks/usePullRequestFiles.ts +98 -0
- package/src/hooks/useSyncPullRequest.ts +51 -0
- package/src/index.ts +4 -6
- package/src/meta.ts +8 -13
- package/src/operations/add-pull-request-comment.ts +31 -0
- package/src/operations/add-pull-request-review-comment.ts +32 -0
- package/src/operations/generate-walkthrough.ts +124 -0
- package/src/operations/get-pull-request-diff.ts +37 -0
- package/src/operations/get-pull-request-status.ts +44 -0
- package/src/operations/get-repositories.ts +53 -0
- package/src/operations/import-pull-request-from-snapshot.ts +48 -0
- package/src/operations/import-pull-request.test.ts +151 -0
- package/src/operations/import-pull-request.ts +149 -0
- package/src/operations/index.ts +30 -0
- package/src/operations/materialize-target.ts +60 -0
- package/src/operations/pull-request.test.ts +120 -0
- package/src/operations/pull-request.ts +141 -0
- package/src/operations/refresh-pull-requests.ts +69 -0
- package/src/operations/refresh.test.ts +112 -0
- package/src/operations/refresh.ts +111 -0
- package/src/operations/submit-pull-request-approval.ts +41 -0
- package/src/operations/sync-pull-request.ts +34 -0
- package/src/operations/sync.test.ts +453 -0
- package/src/operations/sync.ts +807 -0
- package/src/plugin.test.ts +40 -0
- package/src/plugin.ts +37 -0
- package/src/pull-request-body.test.ts +61 -0
- package/src/pull-request-body.ts +144 -0
- package/src/pull-request.test.ts +67 -0
- package/src/pull-request.ts +80 -0
- package/src/services/github-api.ts +735 -0
- package/src/services/index.ts +5 -0
- package/src/skills/GitHubSkill.ts +46 -0
- package/src/skills/index.ts +5 -0
- package/src/stories/Generate.stories.tsx +152 -0
- package/src/stories/Links.stories.tsx +153 -0
- package/src/stories/PullRequestArticle.stories.tsx +107 -0
- package/src/stories/PullRequestFiles.stories.tsx +69 -0
- package/src/stories/PullRequestOverview.stories.tsx +114 -0
- package/src/stories/PullRequestsArticle.stories.tsx +170 -0
- package/src/stories/Walkthrough.stories.tsx +110 -0
- package/src/stories/github.test.ts +65 -0
- package/src/stories/github.ts +70 -0
- package/src/stories/walkthrough-fixture.ts +115 -0
- package/src/testing/fixtures.ts +99 -0
- package/src/testing/index.ts +7 -0
- package/src/testing/plugin.ts +25 -0
- package/src/testing/pull-request-13348.ts +104 -0
- package/src/testing/pull-request-13363.patch +2981 -0
- package/src/translations.ts +135 -63
- package/src/types/GitHubCapabilities.ts +27 -0
- package/src/types/GitHubEvents.ts +16 -0
- package/src/types/GitHubOperation.ts +397 -0
- package/src/types/PullRequestsView.ts +45 -0
- package/src/types/Walkthrough.test.ts +75 -0
- package/src/types/Walkthrough.ts +66 -0
- package/src/types/index.ts +8 -0
- package/src/vite-env.d.ts +15 -0
- package/src/walkthrough/fill.test.ts +337 -0
- package/src/walkthrough/fill.ts +246 -0
- package/src/walkthrough/generate.test.ts +219 -0
- package/src/walkthrough/generate.ts +248 -0
- package/src/walkthrough/generated.test.ts +70 -0
- package/src/walkthrough/generated.ts +70 -0
- package/src/walkthrough/headings.test.ts +40 -0
- package/src/walkthrough/headings.ts +39 -0
- package/src/walkthrough/index.ts +12 -0
- package/src/walkthrough/patch.ts +154 -0
- package/src/walkthrough/plan.test.ts +178 -0
- package/src/walkthrough/plan.ts +251 -0
- package/src/walkthrough/prompt.test.ts +100 -0
- package/src/walkthrough/prompt.ts +147 -0
- package/src/walkthrough/score.test.ts +272 -0
- package/src/walkthrough/score.ts +430 -0
- package/README.md +0 -15
- package/dist/lib/browser/chunk-S4MPSBA5.mjs +0 -21
- package/dist/lib/browser/chunk-S4MPSBA5.mjs.map +0 -7
- package/dist/lib/browser/index.css +0 -7
- package/dist/lib/browser/index.css.map +0 -7
- package/dist/lib/browser/index.mjs +0 -1535
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/meta.mjs +0 -11
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/types/src/GithubPlugin.d.ts +0 -4
- package/dist/types/src/GithubPlugin.d.ts.map +0 -1
- package/dist/types/src/components/EmbeddedMain/EmbeddedMain.d.ts +0 -4
- package/dist/types/src/components/EmbeddedMain/EmbeddedMain.d.ts.map +0 -1
- package/dist/types/src/components/EmbeddedMain/GfmPreview.d.ts +0 -9
- package/dist/types/src/components/EmbeddedMain/GfmPreview.d.ts.map +0 -1
- package/dist/types/src/components/EmbeddedMain/index.d.ts +0 -2
- package/dist/types/src/components/EmbeddedMain/index.d.ts.map +0 -1
- package/dist/types/src/components/ExportDialog.d.ts +0 -8
- package/dist/types/src/components/ExportDialog.d.ts.map +0 -1
- package/dist/types/src/components/GithubApiProviders/GitHubSettings.d.ts +0 -3
- package/dist/types/src/components/GithubApiProviders/GitHubSettings.d.ts.map +0 -1
- package/dist/types/src/components/GithubApiProviders/OctokitProvider.d.ts +0 -15
- package/dist/types/src/components/GithubApiProviders/OctokitProvider.d.ts.map +0 -1
- package/dist/types/src/components/GithubApiProviders/index.d.ts +0 -3
- package/dist/types/src/components/GithubApiProviders/index.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/DocumentTreeItem.d.ts +0 -6
- package/dist/types/src/components/GithubEchoResolverProviders/DocumentTreeItem.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverContext.d.ts +0 -7
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverContext.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverDialog.d.ts +0 -6
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverDialog.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverProps.d.ts +0 -16
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverProps.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverTree.d.ts +0 -3
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverTree.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.d.ts +0 -11
- package/dist/types/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/index.d.ts +0 -3
- package/dist/types/src/components/GithubEchoResolverProviders/index.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/spaceResolvers.d.ts +0 -6
- package/dist/types/src/components/GithubEchoResolverProviders/spaceResolvers.d.ts.map +0 -1
- package/dist/types/src/components/ImportDialog.d.ts +0 -7
- package/dist/types/src/components/ImportDialog.d.ts.map +0 -1
- package/dist/types/src/components/Issue.d.ts +0 -5
- package/dist/types/src/components/Issue.d.ts.map +0 -1
- package/dist/types/src/components/Loading/Loading.d.ts +0 -15
- package/dist/types/src/components/Loading/Loading.d.ts.map +0 -1
- package/dist/types/src/components/Loading/Loading.stories.d.ts +0 -40
- package/dist/types/src/components/Loading/Loading.stories.d.ts.map +0 -1
- package/dist/types/src/components/Loading/index.d.ts +0 -2
- package/dist/types/src/components/Loading/index.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownActions.d.ts +0 -7
- package/dist/types/src/components/MarkdownActions.d.ts.map +0 -1
- package/dist/types/src/components/UrlDialog.d.ts +0 -6
- package/dist/types/src/components/UrlDialog.d.ts.map +0 -1
- package/dist/types/src/hooks/useDocGhId.d.ts +0 -6
- package/dist/types/src/hooks/useDocGhId.d.ts.map +0 -1
- package/dist/types/src/hooks/useGhIdFromUrl.d.ts +0 -2
- package/dist/types/src/hooks/useGhIdFromUrl.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -30
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/GithubPlugin.tsx +0 -127
- package/src/components/EmbeddedMain/EmbeddedMain.tsx +0 -294
- package/src/components/EmbeddedMain/GfmPreview.tsx +0 -110
- package/src/components/EmbeddedMain/embedded.css +0 -3
- package/src/components/EmbeddedMain/index.ts +0 -5
- package/src/components/ExportDialog.tsx +0 -157
- package/src/components/GithubApiProviders/GitHubSettings.tsx +0 -72
- package/src/components/GithubApiProviders/OctokitProvider.tsx +0 -60
- package/src/components/GithubApiProviders/index.ts +0 -6
- package/src/components/GithubEchoResolverProviders/DocumentTreeItem.tsx +0 -26
- package/src/components/GithubEchoResolverProviders/ResolverContext.tsx +0 -137
- package/src/components/GithubEchoResolverProviders/ResolverDialog.tsx +0 -34
- package/src/components/GithubEchoResolverProviders/ResolverProps.ts +0 -23
- package/src/components/GithubEchoResolverProviders/ResolverTree.tsx +0 -86
- package/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.tsx +0 -105
- package/src/components/GithubEchoResolverProviders/index.ts +0 -6
- package/src/components/GithubEchoResolverProviders/spaceResolvers.ts +0 -86
- package/src/components/ImportDialog.tsx +0 -72
- package/src/components/Issue.tsx +0 -62
- package/src/components/Loading/Loading.stories.tsx +0 -32
- package/src/components/Loading/Loading.tsx +0 -70
- package/src/components/Loading/index.ts +0 -5
- package/src/components/MarkdownActions.tsx +0 -136
- package/src/components/UrlDialog.tsx +0 -52
- package/src/hooks/useDocGhId.ts +0 -38
- package/src/hooks/useGhIdFromUrl.ts +0 -26
- package/src/types.ts +0 -51
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { t as GITHUB_API_BASE } from "./chunk-constants.mjs";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { Database } from "@dxos/echo";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import * as Layer from "effect/Layer";
|
|
6
|
+
import * as Cause from "effect/Cause";
|
|
7
|
+
import * as Context from "effect/Context";
|
|
8
|
+
import * as HttpClient from "effect/http/HttpClient";
|
|
9
|
+
import * as HttpClientError from "effect/http/HttpClientError";
|
|
10
|
+
import * as HttpClientRequest from "effect/http/HttpClientRequest";
|
|
11
|
+
import * as Schedule from "effect/Schedule";
|
|
12
|
+
//#region src/services/github-api.ts
|
|
13
|
+
var ACCEPT = "application/vnd.github+json";
|
|
14
|
+
/** Serves a pull request as the unified diff git would produce, rather than as JSON. */
|
|
15
|
+
var DIFF_ACCEPT = "application/vnd.github.v3.diff";
|
|
16
|
+
var API_VERSION = "2022-11-28";
|
|
17
|
+
var USER_AGENT = "@dxos/plugin-github";
|
|
18
|
+
var GitHubUserSchema = Schema.Struct({
|
|
19
|
+
id: Schema.Number,
|
|
20
|
+
login: Schema.String,
|
|
21
|
+
name: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
22
|
+
email: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
23
|
+
avatar_url: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
24
|
+
html_url: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
25
|
+
bio: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
26
|
+
company: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
27
|
+
type: Schema.NullOr(Schema.String).pipe(Schema.optional)
|
|
28
|
+
});
|
|
29
|
+
var GitHubOrgSchema = Schema.Struct({
|
|
30
|
+
id: Schema.Number,
|
|
31
|
+
login: Schema.String,
|
|
32
|
+
description: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
33
|
+
name: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
34
|
+
blog: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
35
|
+
avatar_url: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
36
|
+
html_url: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
37
|
+
location: Schema.NullOr(Schema.String).pipe(Schema.optional)
|
|
38
|
+
});
|
|
39
|
+
var GitHubRepoSchema = Schema.Struct({
|
|
40
|
+
id: Schema.Number,
|
|
41
|
+
name: Schema.String,
|
|
42
|
+
full_name: Schema.String,
|
|
43
|
+
description: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
44
|
+
html_url: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
45
|
+
homepage: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
46
|
+
archived: Schema.Boolean.pipe(Schema.optional),
|
|
47
|
+
disabled: Schema.Boolean.pipe(Schema.optional),
|
|
48
|
+
fork: Schema.Boolean.pipe(Schema.optional),
|
|
49
|
+
default_branch: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
50
|
+
owner: Schema.Struct({
|
|
51
|
+
id: Schema.Number,
|
|
52
|
+
login: Schema.String
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
var GitHubLabelSchema = Schema.Struct({ name: Schema.String });
|
|
56
|
+
var GitHubPullRefSchema = Schema.Struct({
|
|
57
|
+
url: Schema.String,
|
|
58
|
+
merged_at: Schema.NullOr(Schema.String).pipe(Schema.optional)
|
|
59
|
+
});
|
|
60
|
+
var GitHubMilestoneSchema = Schema.Struct({
|
|
61
|
+
id: Schema.Number,
|
|
62
|
+
number: Schema.Number,
|
|
63
|
+
title: Schema.String,
|
|
64
|
+
description: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
65
|
+
state: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
66
|
+
/** ISO datetime, unlike the date-only shape the local model stores. */
|
|
67
|
+
due_on: Schema.NullOr(Schema.String).pipe(Schema.optional)
|
|
68
|
+
});
|
|
69
|
+
var GitHubIssueSchema = Schema.Struct({
|
|
70
|
+
id: Schema.Number,
|
|
71
|
+
number: Schema.Number,
|
|
72
|
+
title: Schema.String,
|
|
73
|
+
body: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
74
|
+
state: Schema.String,
|
|
75
|
+
state_reason: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
76
|
+
html_url: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
77
|
+
comments: Schema.Number.pipe(Schema.optional),
|
|
78
|
+
comments_url: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
79
|
+
created_at: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
80
|
+
updated_at: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
81
|
+
closed_at: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
82
|
+
user: Schema.NullOr(GitHubUserSchema).pipe(Schema.optional),
|
|
83
|
+
assignees: Schema.Array(GitHubUserSchema).pipe(Schema.optional),
|
|
84
|
+
labels: Schema.Array(GitHubLabelSchema).pipe(Schema.optional),
|
|
85
|
+
milestone: Schema.NullOr(GitHubMilestoneSchema).pipe(Schema.optional),
|
|
86
|
+
pull_request: Schema.NullOr(GitHubPullRefSchema).pipe(Schema.optional)
|
|
87
|
+
});
|
|
88
|
+
/** GET /repos/{owner}/{repo}/pulls/{number} — the pull-request view, which alone carries the diff size and merge state. */
|
|
89
|
+
var GitHubPullSchema = Schema.Struct({
|
|
90
|
+
id: Schema.Number,
|
|
91
|
+
number: Schema.Number,
|
|
92
|
+
title: Schema.String,
|
|
93
|
+
body: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
94
|
+
state: Schema.String,
|
|
95
|
+
draft: Schema.Boolean.pipe(Schema.optional),
|
|
96
|
+
merged: Schema.Boolean.pipe(Schema.optional),
|
|
97
|
+
merged_at: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
98
|
+
created_at: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
99
|
+
updated_at: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
100
|
+
html_url: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
101
|
+
user: Schema.NullOr(GitHubUserSchema).pipe(Schema.optional),
|
|
102
|
+
labels: Schema.Array(GitHubLabelSchema).pipe(Schema.optional),
|
|
103
|
+
additions: Schema.Number.pipe(Schema.optional),
|
|
104
|
+
deletions: Schema.Number.pipe(Schema.optional),
|
|
105
|
+
base: Schema.Struct({
|
|
106
|
+
ref: Schema.String,
|
|
107
|
+
sha: Schema.String.pipe(Schema.optional)
|
|
108
|
+
}).pipe(Schema.optional),
|
|
109
|
+
head: Schema.Struct({
|
|
110
|
+
ref: Schema.String,
|
|
111
|
+
sha: Schema.String.pipe(Schema.optional)
|
|
112
|
+
}).pipe(Schema.optional)
|
|
113
|
+
});
|
|
114
|
+
var GitHubCommentSchema = Schema.Struct({
|
|
115
|
+
id: Schema.Number,
|
|
116
|
+
body: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
117
|
+
user: Schema.NullOr(GitHubUserSchema).pipe(Schema.optional),
|
|
118
|
+
created_at: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
119
|
+
updated_at: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
120
|
+
html_url: Schema.NullOr(Schema.String).pipe(Schema.optional)
|
|
121
|
+
});
|
|
122
|
+
/**
|
|
123
|
+
* Layer-based credentials service. Mirrors `TrelloCredentials`: every API call
|
|
124
|
+
* pulls the token from this service rather than threading it through as an
|
|
125
|
+
* explicit parameter, so callers compose a single
|
|
126
|
+
* `Effect.provide(GitHubApi.fromConnection(ref))` at the
|
|
127
|
+
* operation boundary.
|
|
128
|
+
*
|
|
129
|
+
* Token sourcing: an operation invoked with a `Connection` composes
|
|
130
|
+
* `fromConnection(ref)`; one invoked with an external-sync cursor composes
|
|
131
|
+
* `fromAccessToken(cursor.spec.source)` directly (the cursor no longer relates
|
|
132
|
+
* to `Connection`).
|
|
133
|
+
*/
|
|
134
|
+
var GitHubCredentials = class extends Context.Service()("@dxos/plugin-github/GitHubCredentials") {};
|
|
135
|
+
/** Creates a credentials layer from an AccessToken ref. Loads it and returns its `token`. */
|
|
136
|
+
var fromAccessToken = (accessTokenRef) => Layer.effect(GitHubCredentials, Effect.gen(function* () {
|
|
137
|
+
return { token: (yield* Database.load(accessTokenRef)).token };
|
|
138
|
+
}));
|
|
139
|
+
/** Creates a credentials layer from a Connection ref. Loads its `accessToken` and returns its `token`. */
|
|
140
|
+
var fromConnection = (connectionRef) => Layer.effect(GitHubCredentials, Effect.gen(function* () {
|
|
141
|
+
const connection = yield* Database.load(connectionRef);
|
|
142
|
+
return { token: (yield* Database.load(connection.accessToken)).token };
|
|
143
|
+
}));
|
|
144
|
+
/**
|
|
145
|
+
* Decide whether a GitHub request failure is worth retrying.
|
|
146
|
+
* - Transport / encode failures: yes (transient by nature).
|
|
147
|
+
* - 429 / 5xx: yes — exactly the cases retry was designed for.
|
|
148
|
+
* - 4xx other than 429 (auth, validation, not-found): no — wastes time and
|
|
149
|
+
* may exacerbate rate limiting on the same token.
|
|
150
|
+
* - TimeoutException: yes.
|
|
151
|
+
* - Schema decode failures (`ParseError`): no — payload won't become valid on retry.
|
|
152
|
+
*/
|
|
153
|
+
var shouldRetry = (error) => {
|
|
154
|
+
if (error instanceof Schema.SchemaError) return false;
|
|
155
|
+
if (Cause.isTimeoutError(error)) return true;
|
|
156
|
+
if (error.reason._tag !== "StatusCodeError") return true;
|
|
157
|
+
const status = error.reason.response.status;
|
|
158
|
+
return status === 429 || status >= 500 && status <= 599;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* The status a failed GitHub request answered with, or `undefined` for a transport, timeout or
|
|
162
|
+
* decode failure. Callers branch on it to tell a dead credential (401) from an absent resource.
|
|
163
|
+
*/
|
|
164
|
+
var responseStatus = (error) => HttpClientError.isHttpClientError(error) && error.reason._tag === "StatusCodeError" ? error.reason.response.status : void 0;
|
|
165
|
+
/** Anonymous when the token is empty: a bare `Bearer` header is rejected where no header is rate-limited. */
|
|
166
|
+
var withAuth = (req, creds, accept = ACCEPT) => req.pipe((req) => creds.token ? HttpClientRequest.setHeader(req, "Authorization", `Bearer ${creds.token}`) : req, HttpClientRequest.setHeader("Accept", accept), HttpClientRequest.setHeader("X-GitHub-Api-Version", API_VERSION), HttpClientRequest.setHeader("User-Agent", USER_AGENT));
|
|
167
|
+
/**
|
|
168
|
+
* Build an unauthenticated GitHub API request, fetch + decode it as a single JSON
|
|
169
|
+
* response, and apply timeout + retry. `withAuth` is applied here so callers never
|
|
170
|
+
* have to remember to attach credentials (forgetting would silently 401).
|
|
171
|
+
*
|
|
172
|
+
* `filterStatusOk` converts non-2xx responses into a typed `ResponseError`
|
|
173
|
+
* (carrying `status` and the raw body) BEFORE we try to decode the body —
|
|
174
|
+
* otherwise GitHub error envelopes (`{ message, documentation_url }`) would
|
|
175
|
+
* blow up against the success schema with a `ParseError`, masking the real
|
|
176
|
+
* cause (e.g. a 403 from an integration token that lacks issue write).
|
|
177
|
+
*/
|
|
178
|
+
var githubRequest = (build, schema) => Effect.gen(function* () {
|
|
179
|
+
const creds = yield* GitHubCredentials;
|
|
180
|
+
return yield* (yield* HttpClient.HttpClient).pipe(HttpClient.transformResponse(Effect.provideService(HttpClient.TracerDisabledWhen, () => true)), HttpClient.filterStatusOk).execute(withAuth(build(), creds)).pipe(Effect.flatMap((res) => Effect.flatMap(res.json, Schema.decodeUnknownEffect(schema))), Effect.timeout("15 seconds"), Effect.retry({
|
|
181
|
+
schedule: Schedule.exponential("500 millis").pipe(Schedule.jittered, Schedule.upTo({ times: 3 })),
|
|
182
|
+
while: shouldRetry
|
|
183
|
+
}), Effect.scoped);
|
|
184
|
+
});
|
|
185
|
+
/**
|
|
186
|
+
* Fetch a response GitHub serves as text rather than JSON — the `diff` media type, which has no
|
|
187
|
+
* schema to decode against.
|
|
188
|
+
*
|
|
189
|
+
* The timeout is longer than `githubRequest`'s because a diff is the whole change rather than a
|
|
190
|
+
* summary of it. GitHub answers 406 rather than truncating when a pull request exceeds its own
|
|
191
|
+
* limits (roughly 300 files or 20k lines), which `filterStatusOk` surfaces as a typed failure.
|
|
192
|
+
*/
|
|
193
|
+
var githubText = (build, accept) => Effect.gen(function* () {
|
|
194
|
+
const creds = yield* GitHubCredentials;
|
|
195
|
+
return yield* (yield* HttpClient.HttpClient).pipe(HttpClient.transformResponse(Effect.provideService(HttpClient.TracerDisabledWhen, () => true)), HttpClient.filterStatusOk).execute(withAuth(build(), creds, accept)).pipe(Effect.flatMap((res) => res.text), Effect.timeout("60 seconds"), Effect.retry({
|
|
196
|
+
schedule: Schedule.exponential("500 millis").pipe(Schedule.jittered, Schedule.upTo({ times: 3 })),
|
|
197
|
+
while: shouldRetry
|
|
198
|
+
}), Effect.scoped);
|
|
199
|
+
});
|
|
200
|
+
/**
|
|
201
|
+
* Walk paginated GitHub list endpoints by following `Link: <…>; rel="next"`.
|
|
202
|
+
*
|
|
203
|
+
* Sets `per_page=100` automatically; aggregates pages into a single array.
|
|
204
|
+
* Returns the empty array if the first page is empty. Stops at `MAX_PAGES`
|
|
205
|
+
* to bound memory + traffic for very large orgs/repos — in v1 we accept that
|
|
206
|
+
* the very largest orgs may be partially synced and surface a TODO to add
|
|
207
|
+
* cursor support.
|
|
208
|
+
*/
|
|
209
|
+
var MAX_PAGES = 10;
|
|
210
|
+
var getNextLink = (header) => {
|
|
211
|
+
if (!header) return;
|
|
212
|
+
for (const part of header.split(",")) {
|
|
213
|
+
const match = part.trim().match(/^<([^>]+)>;\s*rel="([^"]+)"$/);
|
|
214
|
+
if (match && match[2] === "next") return match[1];
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Walks `rel="next"` to the end, decoding each page with `pageSchema` and taking its items through
|
|
219
|
+
* `select` — an endpoint that answers with an envelope rather than a bare array pages the same way.
|
|
220
|
+
*/
|
|
221
|
+
var githubPages = (buildInitial, pageSchema, select) => Effect.gen(function* () {
|
|
222
|
+
const httpClient = yield* HttpClient.HttpClient;
|
|
223
|
+
const creds = yield* GitHubCredentials;
|
|
224
|
+
const clientNoTracer = httpClient.pipe(HttpClient.transformResponse(Effect.provideService(HttpClient.TracerDisabledWhen, () => true)), HttpClient.filterStatusOk);
|
|
225
|
+
let nextUrl;
|
|
226
|
+
let request = withAuth(buildInitial(), creds).pipe(HttpClientRequest.appendUrlParam("per_page", "100"));
|
|
227
|
+
const out = [];
|
|
228
|
+
for (let page = 0; page < MAX_PAGES; page++) {
|
|
229
|
+
const result = yield* clientNoTracer.execute(request).pipe(Effect.flatMap((res) => Effect.gen(function* () {
|
|
230
|
+
const body = yield* res.json;
|
|
231
|
+
return {
|
|
232
|
+
decoded: yield* Schema.decodeUnknownEffect(pageSchema)(body),
|
|
233
|
+
link: res.headers["link"]
|
|
234
|
+
};
|
|
235
|
+
})), Effect.timeout("15 seconds"), Effect.retry({
|
|
236
|
+
schedule: Schedule.exponential("500 millis").pipe(Schedule.jittered, Schedule.upTo({ times: 3 })),
|
|
237
|
+
while: shouldRetry
|
|
238
|
+
}), Effect.scoped);
|
|
239
|
+
out.push(...select(result.decoded));
|
|
240
|
+
nextUrl = getNextLink(result.link);
|
|
241
|
+
if (!nextUrl) break;
|
|
242
|
+
request = withAuth(HttpClientRequest.get(nextUrl), creds);
|
|
243
|
+
}
|
|
244
|
+
return out;
|
|
245
|
+
});
|
|
246
|
+
var githubPaginated = (buildInitial, itemSchema) => githubPages(buildInitial, Schema.Array(itemSchema), (page) => page);
|
|
247
|
+
/** GET /user — authenticated user profile. */
|
|
248
|
+
var fetchUser = () => githubRequest(() => HttpClientRequest.get(`${GITHUB_API_BASE}/user`), GitHubUserSchema);
|
|
249
|
+
/**
|
|
250
|
+
* GET /user/repos — every repo the authenticated user can see.
|
|
251
|
+
*
|
|
252
|
+
* Includes owner, collaborator, and org-member affiliations. For a GitHub App
|
|
253
|
+
* user-to-server token this is intersected with the App's installation scope —
|
|
254
|
+
* admins control which repos are visible by choosing All / Selected at install
|
|
255
|
+
* time.
|
|
256
|
+
*/
|
|
257
|
+
var fetchUserRepos = () => githubPaginated(() => HttpClientRequest.get(`${GITHUB_API_BASE}/user/repos`), GitHubRepoSchema);
|
|
258
|
+
/** GET /orgs/{org} — full org metadata. */
|
|
259
|
+
var fetchOrg = (org) => githubRequest(() => HttpClientRequest.get(`${GITHUB_API_BASE}/orgs/${encodeURIComponent(org)}`), GitHubOrgSchema);
|
|
260
|
+
/** GET /orgs/{org}/members — public + private members (depends on token). */
|
|
261
|
+
var fetchOrgMembers = (org) => githubPaginated(() => HttpClientRequest.get(`${GITHUB_API_BASE}/orgs/${encodeURIComponent(org)}/members`), GitHubUserSchema);
|
|
262
|
+
/**
|
|
263
|
+
* GET /repos/{owner}/{repo}/issues — both issues AND pull requests.
|
|
264
|
+
*
|
|
265
|
+
* `state=all` includes closed. PRs are distinguishable by a non-null
|
|
266
|
+
* `pull_request` field. `since` is an optional ISO timestamp; when provided,
|
|
267
|
+
* GitHub returns only issues updated at or after that point — we use this
|
|
268
|
+
* for incremental syncs.
|
|
269
|
+
*/
|
|
270
|
+
var fetchRepoIssues = (owner, repo, options = {}) => githubPaginated(() => {
|
|
271
|
+
let req = HttpClientRequest.get(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues`).pipe(HttpClientRequest.appendUrlParam("state", "all"));
|
|
272
|
+
if (options.since) req = req.pipe(HttpClientRequest.appendUrlParam("since", options.since));
|
|
273
|
+
return req;
|
|
274
|
+
}, GitHubIssueSchema);
|
|
275
|
+
/** GET /repos/{owner}/{repo}. */
|
|
276
|
+
var fetchRepo = (owner, repo) => githubRequest(() => HttpClientRequest.get(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`), GitHubRepoSchema);
|
|
277
|
+
/** GET /repos/{owner}/{repo}/issues/{number} — an issue, or the issue view of a pull request. */
|
|
278
|
+
var fetchIssue = (owner, repo, number) => githubRequest(() => HttpClientRequest.get(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues/${number}`), GitHubIssueSchema);
|
|
279
|
+
/** GET /repos/{owner}/{repo}/pulls/{number}. */
|
|
280
|
+
var fetchPullRequest = (owner, repo, number) => githubRequest(() => HttpClientRequest.get(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}`), GitHubPullSchema);
|
|
281
|
+
/**
|
|
282
|
+
* GET /repos/{owner}/{repo}/pulls/{number} as a unified diff — the same bytes `git diff` would
|
|
283
|
+
* produce, which is what a generated walkthrough splices its chunks from.
|
|
284
|
+
*/
|
|
285
|
+
var fetchPullRequestDiff = (owner, repo, number) => githubText(() => HttpClientRequest.get(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}`), DIFF_ACCEPT);
|
|
286
|
+
/**
|
|
287
|
+
* GET /repos/{owner}/{repo}/milestones — `state=all` so closed milestones stay mirrored (the
|
|
288
|
+
* issues still assigned to them have to resolve to something).
|
|
289
|
+
*/
|
|
290
|
+
var fetchRepoMilestones = (owner, repo) => githubPaginated(() => HttpClientRequest.get(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/milestones`).pipe(HttpClientRequest.appendUrlParam("state", "all")), GitHubMilestoneSchema);
|
|
291
|
+
/**
|
|
292
|
+
* Write to a GitHub object (PATCH or POST, as `build` chooses). The shape mirrors {@link githubRequest} except the
|
|
293
|
+
* body is `application/json`. Failures are
|
|
294
|
+
* propagated unchanged; the caller is expected to surface them on the target
|
|
295
|
+
* row's `lastError`.
|
|
296
|
+
*
|
|
297
|
+
* Only PATCH retries (429 / 5xx retry, 4xx don't). A POST here creates a comment or a review, and
|
|
298
|
+
* GitHub can commit one before the response reaches us, so retrying a timeout would post it twice.
|
|
299
|
+
*/
|
|
300
|
+
var githubWrite = (build, body, schema) => Effect.gen(function* () {
|
|
301
|
+
const creds = yield* GitHubCredentials;
|
|
302
|
+
const clientNoTracer = (yield* HttpClient.HttpClient).pipe(HttpClient.transformResponse(Effect.provideService(HttpClient.TracerDisabledWhen, () => true)), HttpClient.filterStatusOk);
|
|
303
|
+
const request = withAuth(build(), creds).pipe(HttpClientRequest.bodyJsonUnsafe(body));
|
|
304
|
+
const attempt = clientNoTracer.execute(request).pipe(Effect.flatMap((res) => Effect.flatMap(res.json, Schema.decodeUnknownEffect(schema))), Effect.timeout("15 seconds"));
|
|
305
|
+
return yield* (request.method === "PATCH" ? attempt.pipe(Effect.retry({
|
|
306
|
+
schedule: Schedule.exponential("500 millis").pipe(Schedule.jittered, Schedule.upTo({ times: 3 })),
|
|
307
|
+
while: shouldRetry
|
|
308
|
+
})) : attempt).pipe(Effect.scoped);
|
|
309
|
+
});
|
|
310
|
+
/**
|
|
311
|
+
* PATCH /repos/{owner}/{repo}/issues/{number} — update title / body / state.
|
|
312
|
+
*
|
|
313
|
+
* GitHub conflates issues and PRs at this endpoint: the same PATCH works for
|
|
314
|
+
* both, but PR-specific fields (head/base/draft) must go through the
|
|
315
|
+
* `/pulls/{n}` endpoint. We only touch issue-mappable fields here.
|
|
316
|
+
*/
|
|
317
|
+
var updateIssue = (owner, repo, issueNumber, input) => githubWrite(() => HttpClientRequest.patch(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues/${issueNumber}`), input, GitHubIssueSchema);
|
|
318
|
+
/**
|
|
319
|
+
* PATCH /repos/{owner}/{repo} — update repo description and a small set of
|
|
320
|
+
* mapped metadata. Renames (`name`) are accepted by the API but we don't push
|
|
321
|
+
* them by default: a rename invalidates clones, breaks pinned URLs, and is
|
|
322
|
+
* almost never what a user wants from a sync mirror.
|
|
323
|
+
*/
|
|
324
|
+
var updateRepo = (owner, repo, input) => githubWrite(() => HttpClientRequest.patch(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`), input, GitHubRepoSchema);
|
|
325
|
+
var GitHubReviewSchema = Schema.Struct({
|
|
326
|
+
id: Schema.Number,
|
|
327
|
+
state: Schema.String,
|
|
328
|
+
html_url: Schema.NullOr(Schema.String).pipe(Schema.optional)
|
|
329
|
+
});
|
|
330
|
+
/** POST /repos/{owner}/{repo}/pulls/{number}/reviews with `event: APPROVE`. */
|
|
331
|
+
var approvePullRequest = (owner, repo, number, body) => githubWrite(() => HttpClientRequest.post(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}/reviews`), {
|
|
332
|
+
event: "APPROVE",
|
|
333
|
+
...body ? { body } : {}
|
|
334
|
+
}, GitHubReviewSchema);
|
|
335
|
+
var GitHubSubmittedReviewSchema = Schema.Struct({
|
|
336
|
+
id: Schema.Number,
|
|
337
|
+
/** `APPROVED`, `CHANGES_REQUESTED`, `COMMENTED`, `DISMISSED` or `PENDING`. */
|
|
338
|
+
state: Schema.String,
|
|
339
|
+
user: Schema.NullOr(Schema.Struct({ login: Schema.String })).pipe(Schema.optional),
|
|
340
|
+
submitted_at: Schema.NullOr(Schema.String).pipe(Schema.optional)
|
|
341
|
+
});
|
|
342
|
+
/**
|
|
343
|
+
* GET /repos/{owner}/{repo}/pulls/{number}/reviews — every page, oldest first, since a reviewer's
|
|
344
|
+
* standing verdict is their latest review and a truncated list could miss it.
|
|
345
|
+
*/
|
|
346
|
+
var fetchReviews = (owner, repo, number) => githubPages(() => HttpClientRequest.get(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}/reviews`), Schema.Array(GitHubSubmittedReviewSchema), (page) => page);
|
|
347
|
+
/** POST /repos/{owner}/{repo}/issues/{number}/comments — a conversation comment, which a pull request shares with issues. */
|
|
348
|
+
var createIssueComment = (owner, repo, issueNumber, body) => githubWrite(() => HttpClientRequest.post(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues/${issueNumber}/comments`), { body }, GitHubCommentSchema);
|
|
349
|
+
var GitHubCheckRunSchema = Schema.Struct({
|
|
350
|
+
name: Schema.String,
|
|
351
|
+
/** `queued`, `in_progress` or `completed`. */
|
|
352
|
+
status: Schema.String,
|
|
353
|
+
/** Set once `completed`: `success`, `failure`, `neutral`, `cancelled`, `skipped`, `timed_out`, `action_required`. */
|
|
354
|
+
conclusion: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
355
|
+
html_url: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
356
|
+
/** The provider's own page for the run (Depot, say), which GitHub's `html_url` only links back to. */
|
|
357
|
+
details_url: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
358
|
+
started_at: Schema.NullOr(Schema.String).pipe(Schema.optional),
|
|
359
|
+
completed_at: Schema.NullOr(Schema.String).pipe(Schema.optional)
|
|
360
|
+
});
|
|
361
|
+
var GitHubCheckRunsSchema = Schema.Struct({
|
|
362
|
+
total_count: Schema.Number,
|
|
363
|
+
check_runs: Schema.Array(GitHubCheckRunSchema)
|
|
364
|
+
});
|
|
365
|
+
/**
|
|
366
|
+
* GET /repos/{owner}/{repo}/commits/{sha}/check-runs — every page, since a truncated list would
|
|
367
|
+
* report a failing commit as green.
|
|
368
|
+
*/
|
|
369
|
+
var fetchCheckRuns = (owner, repo, sha) => githubPages(() => HttpClientRequest.get(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/commits/${encodeURIComponent(sha)}/check-runs`), GitHubCheckRunsSchema, ({ check_runs }) => check_runs);
|
|
370
|
+
/** POST /repos/{owner}/{repo}/pulls/{number}/comments — a review comment on one line of the diff. */
|
|
371
|
+
var createReviewComment = (owner, repo, number, input) => githubWrite(() => HttpClientRequest.post(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}/comments`), input, GitHubCommentSchema);
|
|
372
|
+
//#endregion
|
|
373
|
+
export { fromAccessToken as _, fetchCheckRuns as a, updateIssue as b, fetchOrgMembers as c, fetchRepo as d, fetchRepoIssues as f, fetchUserRepos as g, fetchUser as h, createReviewComment as i, fetchPullRequest as l, fetchReviews as m, approvePullRequest as n, fetchIssue as o, fetchRepoMilestones as p, createIssueComment as r, fetchOrg as s, GitHubCredentials as t, fetchPullRequestDiff as u, fromConnection as v, updateRepo as x, responseStatus as y };
|
|
374
|
+
|
|
375
|
+
//# sourceMappingURL=chunk-github-api.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-github-api.mjs","names":[],"sources":["../../src/services/github-api.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// TODO(wittjosiah): Refactor to use a dfx-style Effect-native client.\n\nimport * as Cause from 'effect/Cause';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as HttpClient from 'effect/http/HttpClient';\nimport * as HttpClientError from 'effect/http/HttpClientError';\nimport * as HttpClientRequest from 'effect/http/HttpClientRequest';\nimport * as Layer from 'effect/Layer';\nimport * as Schedule from 'effect/Schedule';\nimport * as Schema from 'effect/Schema';\n\nimport { Database, type Ref } from '@dxos/echo';\nimport { type AccessToken, Connection } from '@dxos/link';\n\nimport { GITHUB_API_BASE } from '../constants.ts';\n\n/** Stored as `AccessToken.token`; sent as `Authorization: Bearer <token>`. Empty means anonymous. */\ntype GitHubCredentialsValue = {\n token: string;\n};\n\nconst ACCEPT = 'application/vnd.github+json';\n/** Serves a pull request as the unified diff git would produce, rather than as JSON. */\nconst DIFF_ACCEPT = 'application/vnd.github.v3.diff';\nconst API_VERSION = '2022-11-28';\nconst USER_AGENT = '@dxos/plugin-github';\n\n//\n// Subset schemas for the responses we care about\n//\n\nconst GitHubUserSchema = Schema.Struct({\n id: Schema.Number,\n login: Schema.String,\n name: Schema.NullOr(Schema.String).pipe(Schema.optional),\n email: Schema.NullOr(Schema.String).pipe(Schema.optional),\n avatar_url: Schema.NullOr(Schema.String).pipe(Schema.optional),\n html_url: Schema.NullOr(Schema.String).pipe(Schema.optional),\n bio: Schema.NullOr(Schema.String).pipe(Schema.optional),\n company: Schema.NullOr(Schema.String).pipe(Schema.optional),\n type: Schema.NullOr(Schema.String).pipe(Schema.optional),\n});\nexport type GitHubUser = Schema.Schema.Type<typeof GitHubUserSchema>;\n\nconst GitHubOrgSchema = Schema.Struct({\n id: Schema.Number,\n login: Schema.String,\n description: Schema.NullOr(Schema.String).pipe(Schema.optional),\n name: Schema.NullOr(Schema.String).pipe(Schema.optional),\n blog: Schema.NullOr(Schema.String).pipe(Schema.optional),\n avatar_url: Schema.NullOr(Schema.String).pipe(Schema.optional),\n html_url: Schema.NullOr(Schema.String).pipe(Schema.optional),\n location: Schema.NullOr(Schema.String).pipe(Schema.optional),\n});\nexport type GitHubOrg = Schema.Schema.Type<typeof GitHubOrgSchema>;\n\nconst GitHubRepoSchema = Schema.Struct({\n id: Schema.Number,\n name: Schema.String,\n full_name: Schema.String,\n description: Schema.NullOr(Schema.String).pipe(Schema.optional),\n html_url: Schema.NullOr(Schema.String).pipe(Schema.optional),\n homepage: Schema.NullOr(Schema.String).pipe(Schema.optional),\n archived: Schema.Boolean.pipe(Schema.optional),\n disabled: Schema.Boolean.pipe(Schema.optional),\n fork: Schema.Boolean.pipe(Schema.optional),\n default_branch: Schema.NullOr(Schema.String).pipe(Schema.optional),\n owner: Schema.Struct({ id: Schema.Number, login: Schema.String }),\n});\nexport type GitHubRepo = Schema.Schema.Type<typeof GitHubRepoSchema>;\n\nconst GitHubLabelSchema = Schema.Struct({\n name: Schema.String,\n});\n\nconst GitHubPullRefSchema = Schema.Struct({\n url: Schema.String,\n merged_at: Schema.NullOr(Schema.String).pipe(Schema.optional),\n});\n\nconst GitHubMilestoneSchema = Schema.Struct({\n id: Schema.Number,\n number: Schema.Number,\n title: Schema.String,\n description: Schema.NullOr(Schema.String).pipe(Schema.optional),\n state: Schema.NullOr(Schema.String).pipe(Schema.optional),\n /** ISO datetime, unlike the date-only shape the local model stores. */\n due_on: Schema.NullOr(Schema.String).pipe(Schema.optional),\n});\nexport type GitHubMilestone = Schema.Schema.Type<typeof GitHubMilestoneSchema>;\n\nconst GitHubIssueSchema = Schema.Struct({\n id: Schema.Number,\n number: Schema.Number,\n title: Schema.String,\n body: Schema.NullOr(Schema.String).pipe(Schema.optional),\n state: Schema.String,\n state_reason: Schema.NullOr(Schema.String).pipe(Schema.optional),\n html_url: Schema.NullOr(Schema.String).pipe(Schema.optional),\n comments: Schema.Number.pipe(Schema.optional),\n comments_url: Schema.NullOr(Schema.String).pipe(Schema.optional),\n created_at: Schema.NullOr(Schema.String).pipe(Schema.optional),\n updated_at: Schema.NullOr(Schema.String).pipe(Schema.optional),\n closed_at: Schema.NullOr(Schema.String).pipe(Schema.optional),\n user: Schema.NullOr(GitHubUserSchema).pipe(Schema.optional),\n assignees: Schema.Array(GitHubUserSchema).pipe(Schema.optional),\n labels: Schema.Array(GitHubLabelSchema).pipe(Schema.optional),\n milestone: Schema.NullOr(GitHubMilestoneSchema).pipe(Schema.optional),\n pull_request: Schema.NullOr(GitHubPullRefSchema).pipe(Schema.optional),\n});\nexport type GitHubIssue = Schema.Schema.Type<typeof GitHubIssueSchema>;\n\n/** GET /repos/{owner}/{repo}/pulls/{number} — the pull-request view, which alone carries the diff size and merge state. */\nconst GitHubPullSchema = Schema.Struct({\n id: Schema.Number,\n number: Schema.Number,\n title: Schema.String,\n body: Schema.NullOr(Schema.String).pipe(Schema.optional),\n state: Schema.String,\n draft: Schema.Boolean.pipe(Schema.optional),\n merged: Schema.Boolean.pipe(Schema.optional),\n merged_at: Schema.NullOr(Schema.String).pipe(Schema.optional),\n created_at: Schema.NullOr(Schema.String).pipe(Schema.optional),\n updated_at: Schema.NullOr(Schema.String).pipe(Schema.optional),\n html_url: Schema.NullOr(Schema.String).pipe(Schema.optional),\n user: Schema.NullOr(GitHubUserSchema).pipe(Schema.optional),\n labels: Schema.Array(GitHubLabelSchema).pipe(Schema.optional),\n additions: Schema.Number.pipe(Schema.optional),\n deletions: Schema.Number.pipe(Schema.optional),\n // `sha` pins the commit a derived artefact (a generated walkthrough) describes; `ref` is a branch\n // name and moves under it.\n base: Schema.Struct({ ref: Schema.String, sha: Schema.String.pipe(Schema.optional) }).pipe(Schema.optional),\n head: Schema.Struct({ ref: Schema.String, sha: Schema.String.pipe(Schema.optional) }).pipe(Schema.optional),\n});\nexport type GitHubPull = Schema.Schema.Type<typeof GitHubPullSchema>;\n\nconst GitHubCommentSchema = Schema.Struct({\n id: Schema.Number,\n body: Schema.NullOr(Schema.String).pipe(Schema.optional),\n user: Schema.NullOr(GitHubUserSchema).pipe(Schema.optional),\n created_at: Schema.NullOr(Schema.String).pipe(Schema.optional),\n updated_at: Schema.NullOr(Schema.String).pipe(Schema.optional),\n html_url: Schema.NullOr(Schema.String).pipe(Schema.optional),\n});\nexport type GitHubComment = Schema.Schema.Type<typeof GitHubCommentSchema>;\n\n//\n// Credentials service\n//\n\n/**\n * Layer-based credentials service. Mirrors `TrelloCredentials`: every API call\n * pulls the token from this service rather than threading it through as an\n * explicit parameter, so callers compose a single\n * `Effect.provide(GitHubApi.fromConnection(ref))` at the\n * operation boundary.\n *\n * Token sourcing: an operation invoked with a `Connection` composes\n * `fromConnection(ref)`; one invoked with an external-sync cursor composes\n * `fromAccessToken(cursor.spec.source)` directly (the cursor no longer relates\n * to `Connection`).\n */\nexport class GitHubCredentials extends Context.Service<GitHubCredentials, GitHubCredentialsValue>()(\n '@dxos/plugin-github/GitHubCredentials',\n) {}\n\n/** Creates a credentials layer from an AccessToken ref. Loads it and returns its `token`. */\nexport const fromAccessToken = (accessTokenRef: Ref.Ref<AccessToken.AccessToken>) =>\n Layer.effect(\n GitHubCredentials,\n Effect.gen(function* () {\n const accessToken = yield* Database.load(accessTokenRef);\n return { token: accessToken.token };\n }),\n );\n\n/** Creates a credentials layer from a Connection ref. Loads its `accessToken` and returns its `token`. */\nexport const fromConnection = (connectionRef: Ref.Ref<Connection.Connection>) =>\n Layer.effect(\n GitHubCredentials,\n Effect.gen(function* () {\n const connection = yield* Database.load(connectionRef);\n const accessToken = yield* Database.load(connection.accessToken);\n return { token: accessToken.token };\n }),\n );\n\n//\n// Request pipeline\n//\n\nexport type GitHubEffect<T> = Effect.Effect<\n T,\n HttpClientError.HttpClientError | Schema.SchemaError | Cause.TimeoutError,\n HttpClient.HttpClient | GitHubCredentials\n>;\n\n/**\n * Decide whether a GitHub request failure is worth retrying.\n * - Transport / encode failures: yes (transient by nature).\n * - 429 / 5xx: yes — exactly the cases retry was designed for.\n * - 4xx other than 429 (auth, validation, not-found): no — wastes time and\n * may exacerbate rate limiting on the same token.\n * - TimeoutException: yes.\n * - Schema decode failures (`ParseError`): no — payload won't become valid on retry.\n */\nconst shouldRetry = (error: HttpClientError.HttpClientError | Schema.SchemaError | Cause.TimeoutError): boolean => {\n if (error instanceof Schema.SchemaError) {\n return false;\n }\n if (Cause.isTimeoutError(error)) {\n return true;\n }\n // v4 hangs the specific failure off `HttpClientError.reason`: a transport-level failure is always\n // worth retrying, and a response failure only on 429/5xx.\n if (error.reason._tag !== 'StatusCodeError') {\n return true;\n }\n const status = error.reason.response.status;\n return status === 429 || (status >= 500 && status <= 599);\n};\n\n/**\n * The status a failed GitHub request answered with, or `undefined` for a transport, timeout or\n * decode failure. Callers branch on it to tell a dead credential (401) from an absent resource.\n */\nexport const responseStatus = (error: unknown): number | undefined =>\n HttpClientError.isHttpClientError(error) && error.reason._tag === 'StatusCodeError'\n ? error.reason.response.status\n : undefined;\n\n/** Anonymous when the token is empty: a bare `Bearer` header is rejected where no header is rate-limited. */\nconst withAuth = (req: HttpClientRequest.HttpClientRequest, creds: GitHubCredentialsValue, accept = ACCEPT) =>\n req.pipe(\n (req) => (creds.token ? HttpClientRequest.setHeader(req, 'Authorization', `Bearer ${creds.token}`) : req),\n HttpClientRequest.setHeader('Accept', accept),\n HttpClientRequest.setHeader('X-GitHub-Api-Version', API_VERSION),\n HttpClientRequest.setHeader('User-Agent', USER_AGENT),\n );\n\n/**\n * Build an unauthenticated GitHub API request, fetch + decode it as a single JSON\n * response, and apply timeout + retry. `withAuth` is applied here so callers never\n * have to remember to attach credentials (forgetting would silently 401).\n *\n * `filterStatusOk` converts non-2xx responses into a typed `ResponseError`\n * (carrying `status` and the raw body) BEFORE we try to decode the body —\n * otherwise GitHub error envelopes (`{ message, documentation_url }`) would\n * blow up against the success schema with a `ParseError`, masking the real\n * cause (e.g. a 403 from an integration token that lacks issue write).\n */\nconst githubRequest = <T>(build: () => HttpClientRequest.HttpClientRequest, schema: Schema.Codec<T>): GitHubEffect<T> =>\n Effect.gen(function* () {\n const creds = yield* GitHubCredentials;\n const httpClient = yield* HttpClient.HttpClient;\n const clientNoTracer = httpClient.pipe(\n HttpClient.transformResponse(Effect.provideService(HttpClient.TracerDisabledWhen, () => true)),\n HttpClient.filterStatusOk,\n );\n return yield* clientNoTracer.execute(withAuth(build(), creds)).pipe(\n Effect.flatMap((res) => Effect.flatMap(res.json, Schema.decodeUnknownEffect(schema))),\n Effect.timeout('15 seconds'),\n Effect.retry({\n schedule: Schedule.exponential('500 millis').pipe(Schedule.jittered, Schedule.upTo({ times: 3 })),\n while: shouldRetry,\n }),\n Effect.scoped,\n );\n });\n\n/**\n * Fetch a response GitHub serves as text rather than JSON — the `diff` media type, which has no\n * schema to decode against.\n *\n * The timeout is longer than `githubRequest`'s because a diff is the whole change rather than a\n * summary of it. GitHub answers 406 rather than truncating when a pull request exceeds its own\n * limits (roughly 300 files or 20k lines), which `filterStatusOk` surfaces as a typed failure.\n */\nconst githubText = (build: () => HttpClientRequest.HttpClientRequest, accept: string): GitHubEffect<string> =>\n Effect.gen(function* () {\n const creds = yield* GitHubCredentials;\n const httpClient = yield* HttpClient.HttpClient;\n const clientNoTracer = httpClient.pipe(\n HttpClient.transformResponse(Effect.provideService(HttpClient.TracerDisabledWhen, () => true)),\n HttpClient.filterStatusOk,\n );\n return yield* clientNoTracer.execute(withAuth(build(), creds, accept)).pipe(\n Effect.flatMap((res) => res.text),\n Effect.timeout('60 seconds'),\n Effect.retry({\n schedule: Schedule.exponential('500 millis').pipe(Schedule.jittered, Schedule.upTo({ times: 3 })),\n while: shouldRetry,\n }),\n Effect.scoped,\n );\n });\n\n//\n// Pagination\n//\n\n/**\n * Walk paginated GitHub list endpoints by following `Link: <…>; rel=\"next\"`.\n *\n * Sets `per_page=100` automatically; aggregates pages into a single array.\n * Returns the empty array if the first page is empty. Stops at `MAX_PAGES`\n * to bound memory + traffic for very large orgs/repos — in v1 we accept that\n * the very largest orgs may be partially synced and surface a TODO to add\n * cursor support.\n */\nconst MAX_PAGES = 10;\n\nconst getNextLink = (header: string | undefined): string | undefined => {\n if (!header) {\n return undefined;\n }\n // Link: <url>; rel=\"next\", <url>; rel=\"last\", …\n for (const part of header.split(',')) {\n const match = part.trim().match(/^<([^>]+)>;\\s*rel=\"([^\"]+)\"$/);\n if (match && match[2] === 'next') {\n return match[1];\n }\n }\n return undefined;\n};\n\n/**\n * Walks `rel=\"next\"` to the end, decoding each page with `pageSchema` and taking its items through\n * `select` — an endpoint that answers with an envelope rather than a bare array pages the same way.\n */\nconst githubPages = <TPage, T>(\n buildInitial: () => HttpClientRequest.HttpClientRequest,\n pageSchema: Schema.Codec<TPage>,\n select: (page: TPage) => readonly T[],\n): GitHubEffect<readonly T[]> =>\n Effect.gen(function* () {\n const httpClient = yield* HttpClient.HttpClient;\n const creds = yield* GitHubCredentials;\n const clientNoTracer = httpClient.pipe(\n HttpClient.transformResponse(Effect.provideService(HttpClient.TracerDisabledWhen, () => true)),\n HttpClient.filterStatusOk,\n );\n\n let nextUrl: string | undefined;\n let request = withAuth(buildInitial(), creds).pipe(HttpClientRequest.appendUrlParam('per_page', '100'));\n const out: T[] = [];\n\n for (let page = 0; page < MAX_PAGES; page++) {\n const result = yield* clientNoTracer.execute(request).pipe(\n Effect.flatMap((res) =>\n Effect.gen(function* () {\n const body = yield* res.json;\n const decoded = yield* Schema.decodeUnknownEffect(pageSchema)(body);\n return { decoded, link: res.headers['link'] };\n }),\n ),\n Effect.timeout('15 seconds'),\n Effect.retry({\n schedule: Schedule.exponential('500 millis').pipe(Schedule.jittered, Schedule.upTo({ times: 3 })),\n while: shouldRetry,\n }),\n Effect.scoped,\n );\n\n out.push(...select(result.decoded));\n nextUrl = getNextLink(result.link);\n if (!nextUrl) {\n break;\n }\n request = withAuth(HttpClientRequest.get(nextUrl), creds);\n }\n\n return out;\n });\n\nconst githubPaginated = <T>(\n buildInitial: () => HttpClientRequest.HttpClientRequest,\n itemSchema: Schema.Codec<T>,\n): GitHubEffect<readonly T[]> => githubPages(buildInitial, Schema.Array(itemSchema), (page) => page);\n\n//\n// API surface\n//\n\n/** GET /user — authenticated user profile. */\nexport const fetchUser = (): GitHubEffect<GitHubUser> =>\n githubRequest(() => HttpClientRequest.get(`${GITHUB_API_BASE}/user`), GitHubUserSchema);\n\n/** GET /user/orgs — orgs visible to the authenticated user. */\nexport const fetchUserOrgs = (): GitHubEffect<readonly GitHubOrg[]> =>\n githubPaginated(() => HttpClientRequest.get(`${GITHUB_API_BASE}/user/orgs`), GitHubOrgSchema);\n\n/**\n * GET /user/repos — every repo the authenticated user can see.\n *\n * Includes owner, collaborator, and org-member affiliations. For a GitHub App\n * user-to-server token this is intersected with the App's installation scope —\n * admins control which repos are visible by choosing All / Selected at install\n * time.\n */\nexport const fetchUserRepos = (): GitHubEffect<readonly GitHubRepo[]> =>\n githubPaginated(() => HttpClientRequest.get(`${GITHUB_API_BASE}/user/repos`), GitHubRepoSchema);\n\n/** GET /orgs/{org} — full org metadata. */\nexport const fetchOrg = (org: string): GitHubEffect<GitHubOrg> =>\n githubRequest(() => HttpClientRequest.get(`${GITHUB_API_BASE}/orgs/${encodeURIComponent(org)}`), GitHubOrgSchema);\n\n/** GET /orgs/{org}/members — public + private members (depends on token). */\nexport const fetchOrgMembers = (org: string): GitHubEffect<readonly GitHubUser[]> =>\n githubPaginated(\n () => HttpClientRequest.get(`${GITHUB_API_BASE}/orgs/${encodeURIComponent(org)}/members`),\n GitHubUserSchema,\n );\n\n/** GET /users/{login} — full user profile (org members lists return a partial form). */\nexport const fetchUserByLogin = (login: string): GitHubEffect<GitHubUser> =>\n githubRequest(() => HttpClientRequest.get(`${GITHUB_API_BASE}/users/${encodeURIComponent(login)}`), GitHubUserSchema);\n\n/** GET /orgs/{org}/repos — repos owned by the org. */\nexport const fetchOrgRepos = (org: string): GitHubEffect<readonly GitHubRepo[]> =>\n githubPaginated(\n () => HttpClientRequest.get(`${GITHUB_API_BASE}/orgs/${encodeURIComponent(org)}/repos`),\n GitHubRepoSchema,\n );\n\n/**\n * GET /repos/{owner}/{repo}/issues — both issues AND pull requests.\n *\n * `state=all` includes closed. PRs are distinguishable by a non-null\n * `pull_request` field. `since` is an optional ISO timestamp; when provided,\n * GitHub returns only issues updated at or after that point — we use this\n * for incremental syncs.\n */\nexport const fetchRepoIssues = (\n owner: string,\n repo: string,\n options: { since?: string } = {},\n): GitHubEffect<readonly GitHubIssue[]> =>\n githubPaginated(() => {\n let req = HttpClientRequest.get(\n `${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues`,\n ).pipe(HttpClientRequest.appendUrlParam('state', 'all'));\n if (options.since) {\n req = req.pipe(HttpClientRequest.appendUrlParam('since', options.since));\n }\n return req;\n }, GitHubIssueSchema);\n\n/** GET /repos/{owner}/{repo}. */\nexport const fetchRepo = (owner: string, repo: string): GitHubEffect<GitHubRepo> =>\n githubRequest(\n () => HttpClientRequest.get(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`),\n GitHubRepoSchema,\n );\n\n/** GET /repos/{owner}/{repo}/issues/{number} — an issue, or the issue view of a pull request. */\nexport const fetchIssue = (owner: string, repo: string, number: number): GitHubEffect<GitHubIssue> =>\n githubRequest(\n () =>\n HttpClientRequest.get(\n `${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues/${number}`,\n ),\n GitHubIssueSchema,\n );\n\n/** GET /repos/{owner}/{repo}/pulls/{number}. */\nexport const fetchPullRequest = (owner: string, repo: string, number: number): GitHubEffect<GitHubPull> =>\n githubRequest(\n () =>\n HttpClientRequest.get(\n `${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}`,\n ),\n GitHubPullSchema,\n );\n\n/**\n * GET /repos/{owner}/{repo}/pulls/{number} as a unified diff — the same bytes `git diff` would\n * produce, which is what a generated walkthrough splices its chunks from.\n */\nexport const fetchPullRequestDiff = (owner: string, repo: string, number: number): GitHubEffect<string> =>\n githubText(\n () =>\n HttpClientRequest.get(\n `${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}`,\n ),\n DIFF_ACCEPT,\n );\n\n/**\n * GET /repos/{owner}/{repo}/milestones — `state=all` so closed milestones stay mirrored (the\n * issues still assigned to them have to resolve to something).\n */\nexport const fetchRepoMilestones = (owner: string, repo: string): GitHubEffect<readonly GitHubMilestone[]> =>\n githubPaginated(\n () =>\n HttpClientRequest.get(\n `${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/milestones`,\n ).pipe(HttpClientRequest.appendUrlParam('state', 'all')),\n GitHubMilestoneSchema,\n );\n\n/** GET /repos/{owner}/{repo}/issues/{number}/comments. */\nexport const fetchIssueComments = (\n owner: string,\n repo: string,\n issueNumber: number,\n): GitHubEffect<readonly GitHubComment[]> =>\n githubPaginated(\n () =>\n HttpClientRequest.get(\n `${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues/${issueNumber}/comments`,\n ),\n GitHubCommentSchema,\n );\n\n//\n// Mutations (push)\n//\n\n/**\n * Write to a GitHub object (PATCH or POST, as `build` chooses). The shape mirrors {@link githubRequest} except the\n * body is `application/json`. Failures are\n * propagated unchanged; the caller is expected to surface them on the target\n * row's `lastError`.\n *\n * Only PATCH retries (429 / 5xx retry, 4xx don't). A POST here creates a comment or a review, and\n * GitHub can commit one before the response reaches us, so retrying a timeout would post it twice.\n */\nconst githubWrite = <T>(\n build: () => HttpClientRequest.HttpClientRequest,\n body: Record<string, unknown>,\n schema: Schema.Codec<T>,\n): GitHubEffect<T> =>\n Effect.gen(function* () {\n const creds = yield* GitHubCredentials;\n const httpClient = yield* HttpClient.HttpClient;\n const clientNoTracer = httpClient.pipe(\n HttpClient.transformResponse(Effect.provideService(HttpClient.TracerDisabledWhen, () => true)),\n HttpClient.filterStatusOk,\n );\n const request = withAuth(build(), creds).pipe(HttpClientRequest.bodyJsonUnsafe(body));\n const attempt = clientNoTracer.execute(request).pipe(\n Effect.flatMap((res) => Effect.flatMap(res.json, Schema.decodeUnknownEffect(schema))),\n Effect.timeout('15 seconds'),\n );\n return yield* (\n request.method === 'PATCH'\n ? attempt.pipe(\n Effect.retry({\n schedule: Schedule.exponential('500 millis').pipe(Schedule.jittered, Schedule.upTo({ times: 3 })),\n while: shouldRetry,\n }),\n )\n : attempt\n ).pipe(Effect.scoped);\n });\n\nexport type IssueUpdateInput = {\n title?: string;\n body?: string;\n state?: 'open' | 'closed';\n state_reason?: 'completed' | 'not_planned' | 'reopened' | null;\n};\n\n/**\n * PATCH /repos/{owner}/{repo}/issues/{number} — update title / body / state.\n *\n * GitHub conflates issues and PRs at this endpoint: the same PATCH works for\n * both, but PR-specific fields (head/base/draft) must go through the\n * `/pulls/{n}` endpoint. We only touch issue-mappable fields here.\n */\nexport const updateIssue = (\n owner: string,\n repo: string,\n issueNumber: number,\n input: IssueUpdateInput,\n): GitHubEffect<GitHubIssue> =>\n githubWrite(\n () =>\n HttpClientRequest.patch(\n `${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues/${issueNumber}`,\n ),\n input as unknown as Record<string, unknown>,\n GitHubIssueSchema,\n );\n\nexport type RepoUpdateInput = {\n /** GitHub allows the owner of a repo to rename it; this is rare and risky and we currently don't push it. */\n name?: string;\n description?: string;\n homepage?: string;\n};\n\n/**\n * PATCH /repos/{owner}/{repo} — update repo description and a small set of\n * mapped metadata. Renames (`name`) are accepted by the API but we don't push\n * them by default: a rename invalidates clones, breaks pinned URLs, and is\n * almost never what a user wants from a sync mirror.\n */\nexport const updateRepo = (owner: string, repo: string, input: RepoUpdateInput): GitHubEffect<GitHubRepo> =>\n githubWrite(\n () => HttpClientRequest.patch(`${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`),\n input as unknown as Record<string, unknown>,\n GitHubRepoSchema,\n );\n\nconst GitHubReviewSchema = Schema.Struct({\n id: Schema.Number,\n state: Schema.String,\n html_url: Schema.NullOr(Schema.String).pipe(Schema.optional),\n});\nexport type GitHubReview = Schema.Schema.Type<typeof GitHubReviewSchema>;\n\n/** POST /repos/{owner}/{repo}/pulls/{number}/reviews with `event: APPROVE`. */\nexport const approvePullRequest = (\n owner: string,\n repo: string,\n number: number,\n body?: string,\n): GitHubEffect<GitHubReview> =>\n githubWrite(\n () =>\n HttpClientRequest.post(\n `${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}/reviews`,\n ),\n { event: 'APPROVE', ...(body ? { body } : {}) },\n GitHubReviewSchema,\n );\n\nconst GitHubSubmittedReviewSchema = Schema.Struct({\n id: Schema.Number,\n /** `APPROVED`, `CHANGES_REQUESTED`, `COMMENTED`, `DISMISSED` or `PENDING`. */\n state: Schema.String,\n user: Schema.NullOr(Schema.Struct({ login: Schema.String })).pipe(Schema.optional),\n submitted_at: Schema.NullOr(Schema.String).pipe(Schema.optional),\n});\nexport type GitHubSubmittedReview = Schema.Schema.Type<typeof GitHubSubmittedReviewSchema>;\n\n/**\n * GET /repos/{owner}/{repo}/pulls/{number}/reviews — every page, oldest first, since a reviewer's\n * standing verdict is their latest review and a truncated list could miss it.\n */\nexport const fetchReviews = (\n owner: string,\n repo: string,\n number: number,\n): GitHubEffect<readonly GitHubSubmittedReview[]> =>\n githubPages(\n () =>\n HttpClientRequest.get(\n `${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/pulls/${number}/reviews`,\n ),\n Schema.Array(GitHubSubmittedReviewSchema),\n (page) => page,\n );\n\n/** POST /repos/{owner}/{repo}/issues/{number}/comments — a conversation comment, which a pull request shares with issues. */\nexport const createIssueComment = (\n owner: string,\n repo: string,\n issueNumber: number,\n body: string,\n): GitHubEffect<GitHubComment> =>\n githubWrite(\n () =>\n HttpClientRequest.post(\n `${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/issues/${issueNumber}/comments`,\n ),\n { body },\n GitHubCommentSchema,\n );\n\nconst GitHubCheckRunSchema = Schema.Struct({\n name: Schema.String,\n /** `queued`, `in_progress` or `completed`. */\n status: Schema.String,\n /** Set once `completed`: `success`, `failure`, `neutral`, `cancelled`, `skipped`, `timed_out`, `action_required`. */\n conclusion: Schema.NullOr(Schema.String).pipe(Schema.optional),\n html_url: Schema.NullOr(Schema.String).pipe(Schema.optional),\n /** The provider's own page for the run (Depot, say), which GitHub's `html_url` only links back to. */\n details_url: Schema.NullOr(Schema.String).pipe(Schema.optional),\n started_at: Schema.NullOr(Schema.String).pipe(Schema.optional),\n completed_at: Schema.NullOr(Schema.String).pipe(Schema.optional),\n});\nexport type GitHubCheckRun = Schema.Schema.Type<typeof GitHubCheckRunSchema>;\n\nconst GitHubCheckRunsSchema = Schema.Struct({\n total_count: Schema.Number,\n check_runs: Schema.Array(GitHubCheckRunSchema),\n});\n\n/**\n * GET /repos/{owner}/{repo}/commits/{sha}/check-runs — every page, since a truncated list would\n * report a failing commit as green.\n */\nexport const fetchCheckRuns = (owner: string, repo: string, sha: string): GitHubEffect<readonly GitHubCheckRun[]> =>\n githubPages(\n () =>\n HttpClientRequest.get(\n `${GITHUB_API_BASE}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/commits/${encodeURIComponent(sha)}/check-runs`,\n ),\n GitHubCheckRunsSchema,\n ({ check_runs }) => check_runs,\n );\n\nexport type ReviewCommentInput = {\n body: string;\n /** Head SHA the line numbers refer to. */\n commit_id: string;\n path: string;\n line: number;\n /** `LEFT` is the base (removed) side, `RIGHT` the head (added or context) side. */\n side: 'LEFT' | 'RIGHT';\n};\n\n/** POST /repos/{owner}/{repo}/pulls/{number}/comments — a review comment on one line of the diff. */\nexport const createReviewComment = (\n owner: string,\n repo: string,\n number: number,\n input: ReviewCommentInput,\n): GitHubEffect<GitHubComment> =>\n githubWrite(\n () =>\n Htt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B,GAAG,EAAE,YACvH,GACF,wBACC,EAAE,iBAAiB,UACtB;;AAaF,IAAa,uBACX,OACA,MACA,QACA,UAEA,kBAEI,kBAAkB,KAChB,GAAG,gBAAgB,SAAS,mBAAmB,KAAK,EAAE,GAAG,mBAAmB,IAAI,EAAE,SAAS,OAAO,UACpG,GACF,OACA,mBACF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//#region src/github-link.ts
|
|
2
|
+
/**
|
|
3
|
+
* `https://github.com/owner/repo`, `/pull/123` or `/issues/123`, with an optional trailing slash,
|
|
4
|
+
* fragment or query. A path below the repository (`/blob/…`, `/actions`) is a page, not an object.
|
|
5
|
+
*/
|
|
6
|
+
var GITHUB_LINK = /^https:\/\/github\.com\/([^/\s?#]+)\/([^/\s?#]+)(?:\/(pull|issues)\/(\d+)(?:[/?#]\S*)?|\/?(?:[?#]\S*)?)$/;
|
|
7
|
+
/** The parts of a pull request or issue URL, or undefined for any other URL. */
|
|
8
|
+
var parseGitHubLink = (url) => {
|
|
9
|
+
const match = GITHUB_LINK.exec(url);
|
|
10
|
+
if (!match) return;
|
|
11
|
+
const [, owner, repo, kind, number] = match;
|
|
12
|
+
if (!kind) return {
|
|
13
|
+
owner,
|
|
14
|
+
repo,
|
|
15
|
+
kind: "repo",
|
|
16
|
+
url
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
owner,
|
|
20
|
+
repo,
|
|
21
|
+
kind: kind === "pull" ? "pull" : "issue",
|
|
22
|
+
number: Number(number),
|
|
23
|
+
url
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* `owner/repo#123` — how a pull request is written where a URL would be noise, and the one form a
|
|
28
|
+
* reviewer can type from memory.
|
|
29
|
+
*/
|
|
30
|
+
var PULL_REQUEST_SHORTHAND = /^([\w.-]+)\/([\w.-]+)#(\d+)$/;
|
|
31
|
+
/**
|
|
32
|
+
* The pull request a user's text names: a github.com URL or `owner/repo#123`.
|
|
33
|
+
*
|
|
34
|
+
* An `/issues/123` URL is accepted alongside `/pull/123` because GitHub itself serves a pull
|
|
35
|
+
* request under both, and a reader who copied the wrong one still means the same change.
|
|
36
|
+
*/
|
|
37
|
+
var parsePullRequestReference = (value) => {
|
|
38
|
+
const text = value.trim();
|
|
39
|
+
const shorthand = PULL_REQUEST_SHORTHAND.exec(text);
|
|
40
|
+
if (shorthand) {
|
|
41
|
+
const [, owner, repo, number] = shorthand;
|
|
42
|
+
return {
|
|
43
|
+
owner,
|
|
44
|
+
repo,
|
|
45
|
+
number: Number(number)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const link = parseGitHubLink(text);
|
|
49
|
+
if (!link || link.number === void 0) return;
|
|
50
|
+
return {
|
|
51
|
+
owner: link.owner,
|
|
52
|
+
repo: link.repo,
|
|
53
|
+
number: link.number
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { parseGitHubLink as n, parsePullRequestReference as r, GITHUB_LINK as t };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=chunk-github-link.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-github-link.mjs","names":[],"sources":["../../src/github-link.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// The shapes a GitHub reference takes, and nothing else: the operations that read one run in node\n// and workerd, where importing the editor's link widget would drag React into the plugin's entry\n// (`plugin-github:check-module-structure` fails on exactly that).\n\n/**\n * `https://github.com/owner/repo`, `/pull/123` or `/issues/123`, with an optional trailing slash,\n * fragment or query. A path below the repository (`/blob/…`, `/actions`) is a page, not an object.\n */\nexport const GITHUB_LINK =\n /^https:\\/\\/github\\.com\\/([^/\\s?#]+)\\/([^/\\s?#]+)(?:\\/(pull|issues)\\/(\\d+)(?:[/?#]\\S*)?|\\/?(?:[?#]\\S*)?)$/;\n\nexport type GitHubLink = {\n owner: string;\n repo: string;\n kind: 'repo' | 'pull' | 'issue';\n /** Absent for a repository. */\n number?: number;\n url: string;\n};\n\n/** The parts of a pull request or issue URL, or undefined for any other URL. */\nexport const parseGitHubLink = (url: string): GitHubLink | undefined => {\n const match = GITHUB_LINK.exec(url);\n if (!match) {\n return undefined;\n }\n const [, owner, repo, kind, number] = match;\n if (!kind) {\n return { owner, repo, kind: 'repo', url };\n }\n return { owner, repo, kind: kind === 'pull' ? 'pull' : 'issue', number: Number(number), url };\n};\n\n/**\n * `owner/repo#123` — how a pull request is written where a URL would be noise, and the one form a\n * reviewer can type from memory.\n */\nconst PULL_REQUEST_SHORTHAND = /^([\\w.-]+)\\/([\\w.-]+)#(\\d+)$/;\n\n/** A pull request named by its coordinates, however the user wrote it. */\nexport type PullRequestReference = {\n owner: string;\n repo: string;\n number: number;\n};\n\n/**\n * The pull request a user's text names: a github.com URL or `owner/repo#123`.\n *\n * An `/issues/123` URL is accepted alongside `/pull/123` because GitHub itself serves a pull\n * request under both, and a reader who copied the wrong one still means the same change.\n */\nexport const parsePullRequestReference = (value: string): PullRequestReference | undefined => {\n const text = value.trim();\n const shorthand = PULL_REQUEST_SHORTHAND.exec(text);\n if (shorthand) {\n const [, owner, repo, number] = shorthand;\n return { owner, repo, number: Number(number) };\n }\n\n const link = parseGitHubLink(text);\n if (!link || link.number === undefined) {\n return undefined;\n }\n return { owner: link.owner, repo: link.repo, number: link.number };\n};\n"],"mappings":";;;;;AAYA,IAAa,cACX;;AAYF,IAAa,mBAAmB,QAAwC;CACtE,MAAM,QAAQ,YAAY,KAAK,GAAG;CAClC,IAAI,CAAC,OACH;CAEF,MAAM,GAAG,OAAO,MAAM,MAAM,UAAU;CACtC,IAAI,CAAC,MACH,OAAO;EAAE;EAAO;EAAM,MAAM;EAAQ;CAAI;CAE1C,OAAO;EAAE;EAAO;EAAM,MAAM,SAAS,SAAS,SAAS;EAAS,QAAQ,OAAO,MAAM;EAAG;CAAI;AAC9F;;;;;AAMA,IAAM,yBAAyB;;;;;;;AAe/B,IAAa,6BAA6B,UAAoD;CAC5F,MAAM,OAAO,MAAM,KAAK;CACxB,MAAM,YAAY,uBAAuB,KAAK,IAAI;CAClD,IAAI,WAAW;EACb,MAAM,GAAG,OAAO,MAAM,UAAU;EAChC,OAAO;GAAE;GAAO;GAAM,QAAQ,OAAO,MAAM;EAAE;CAC/C;CAEA,MAAM,OAAO,gBAAgB,IAAI;CACjC,IAAI,CAAC,QAAQ,KAAK,WAAW,KAAA,GAC3B;CAEF,OAAO;EAAE,OAAO,KAAK;EAAO,MAAM,KAAK;EAAM,QAAQ,KAAK;CAAO;AACnE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { r as parsePullRequestReference } from "./chunk-github-link.mjs";
|
|
2
|
+
import { n as GitHubPullRequestReferenceError } from "./chunk-errors.mjs";
|
|
3
|
+
import { GitHubOperation } from "#types";
|
|
4
|
+
import * as Operation from "@dxos/compute/Operation";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
//#region src/operations/import-pull-request-from-snapshot.ts
|
|
7
|
+
/**
|
|
8
|
+
* Import the pull request the extension's page is showing.
|
|
9
|
+
*
|
|
10
|
+
* The snapshot is read for its URL alone — the page's DOM says nothing GitHub's API does not say
|
|
11
|
+
* better — and the import itself is delegated, so the anonymous fallback and the existing-object
|
|
12
|
+
* check stay in one place.
|
|
13
|
+
*/
|
|
14
|
+
var handler = GitHubOperation.ImportPullRequestFromSnapshot.pipe(Operation.withHandler(Effect.fn(function* ({ snapshot, target }) {
|
|
15
|
+
const reference = snapshot.source.url;
|
|
16
|
+
if (!parsePullRequestReference(reference)) return yield* Effect.die(new GitHubPullRequestReferenceError({ context: { reference } }));
|
|
17
|
+
const { pullRequest } = yield* Operation.invoke(GitHubOperation.ImportPullRequest, { reference }, { spaceId: target.spaceId });
|
|
18
|
+
const object = pullRequest.target;
|
|
19
|
+
if (!object) return yield* Effect.die(new GitHubPullRequestReferenceError({ context: { reference } }));
|
|
20
|
+
return { id: object.id };
|
|
21
|
+
})));
|
|
22
|
+
//#endregion
|
|
23
|
+
export { handler as default };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=chunk-import-pull-request-from-snapshot.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-import-pull-request-from-snapshot.mjs","names":[],"sources":["../../src/operations/import-pull-request-from-snapshot.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Operation from '@dxos/compute/Operation';\n\nimport { GitHubOperation } from '#types';\n\nimport { GitHubPullRequestReferenceError } from '../errors.ts';\nimport { parsePullRequestReference } from '../github-link.ts';\n\n/**\n * Import the pull request the extension's page is showing.\n *\n * The snapshot is read for its URL alone — the page's DOM says nothing GitHub's API does not say\n * better — and the import itself is delegated, so the anonymous fallback and the existing-object\n * check stay in one place.\n */\nconst handler: Operation.WithHandler<typeof GitHubOperation.ImportPullRequestFromSnapshot> =\n GitHubOperation.ImportPullRequestFromSnapshot.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ snapshot, target }) {\n const reference = snapshot.source.url;\n if (!parsePullRequestReference(reference)) {\n return yield* Effect.die(new GitHubPullRequestReferenceError({ context: { reference } }));\n }\n\n const { pullRequest } = yield* Operation.invoke(\n GitHubOperation.ImportPullRequest,\n { reference },\n { spaceId: target.spaceId },\n );\n\n // The extension acks with an object id so the page can open what it just imported; a ref\n // whose target did not resolve would ack success on nothing.\n const object = pullRequest.target;\n if (!object) {\n return yield* Effect.die(new GitHubPullRequestReferenceError({ context: { reference } }));\n }\n\n return { id: object.id };\n }),\n ),\n );\n\nexport default handler;\n"],"mappings":";;;;;;;;;;;;;AAoBA,IAAM,UACJ,gBAAgB,8BAA8B,KAC5C,UAAU,YACR,OAAO,GAAG,WAAW,EAAE,UAAU,UAAU;CACzC,MAAM,YAAY,SAAS,OAAO;CAClC,IAAI,CAAC,0BAA0B,SAAS,GACtC,OAAO,OAAO,OAAO,IAAI,IAAI,gCAAgC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;CAG1F,MAAM,EAAE,gBAAgB,OAAO,UAAU,OACvC,gBAAgB,mBAChB,EAAE,UAAU,GACZ,EAAE,SAAS,OAAO,QAAQ,CAC5B;CAIA,MAAM,SAAS,YAAY;CAC3B,IAAI,CAAC,QACH,OAAO,OAAO,OAAO,IAAI,IAAI,gCAAgC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;CAG1F,OAAO,EAAE,IAAI,OAAO,GAAG;AACzB,CAAC,CACH,CACF"}
|