@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
package/dx.config.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Config2 } from '@dxos/app-framework/config';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
7
|
+
|
|
8
|
+
export default Config2.make({
|
|
9
|
+
plugin: {
|
|
10
|
+
key: 'org.dxos.plugin.github',
|
|
11
|
+
name: 'GitHub',
|
|
12
|
+
author: 'DXOS',
|
|
13
|
+
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-github',
|
|
14
|
+
spec: 'PLUGIN.mdl',
|
|
15
|
+
description: trim`
|
|
16
|
+
Connect GitHub to your Composer workspace so organizations, repositories,
|
|
17
|
+
issues, and pull requests stay available alongside everything else you're
|
|
18
|
+
working on.
|
|
19
|
+
|
|
20
|
+
Authenticate with a GitHub OAuth App or GitHub App and select the
|
|
21
|
+
repositories you want to track. On each sync pass the plugin pulls
|
|
22
|
+
organizations and their members into ECHO as Organization and Person
|
|
23
|
+
objects, and mirrors every repository as a Project and every issue or
|
|
24
|
+
pull request as a Task — with open mapping to "todo" and closed mapping
|
|
25
|
+
to "done".
|
|
26
|
+
|
|
27
|
+
Edits made locally to issue title, description, or open/closed status
|
|
28
|
+
are pushed back to GitHub via a snapshot-diff reconciliation step, so
|
|
29
|
+
changes flow in both directions. Pull request status is deliberately
|
|
30
|
+
pull-only to avoid accidental closes; repo renames are similarly guarded.
|
|
31
|
+
|
|
32
|
+
All GitHub data is stored in ECHO and replicated to other peers in the
|
|
33
|
+
space, giving the whole team a shared, local-first view of the project
|
|
34
|
+
without requiring each member to hold their own GitHub token.
|
|
35
|
+
`,
|
|
36
|
+
icon: { key: 'ph--github-logo--regular', hue: 'purple' },
|
|
37
|
+
tags: ['labs', 'connector'],
|
|
38
|
+
},
|
|
39
|
+
});
|
package/package.json
CHANGED
|
@@ -1,76 +1,195 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-github",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "DXOS
|
|
3
|
+
"version": "0.14.0",
|
|
4
|
+
"description": "DXOS plugin that integrates GitHub as a sync source via the generic Integration mechanism.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
-
"
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
|
-
"sideEffects":
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": {
|
|
17
|
+
"source": {
|
|
18
|
+
"workerd": "./src/capabilities/gen/workerd.ts",
|
|
19
|
+
"node": "./src/capabilities/gen/node.ts",
|
|
20
|
+
"tauri": "./src/capabilities/gen/tauri.ts",
|
|
21
|
+
"browser": "./src/capabilities/gen/browser.ts"
|
|
22
|
+
},
|
|
23
|
+
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
24
|
+
"workerd": "./dist/lib/capabilities.workerd.mjs",
|
|
25
|
+
"node": "./dist/lib/capabilities.node.mjs",
|
|
26
|
+
"tauri": "./dist/lib/capabilities.tauri.mjs",
|
|
27
|
+
"browser": "./dist/lib/capabilities.browser.mjs"
|
|
28
|
+
},
|
|
29
|
+
"#meta": {
|
|
30
|
+
"source": "./src/meta.ts",
|
|
31
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
32
|
+
"default": "./dist/lib/meta.mjs"
|
|
33
|
+
},
|
|
34
|
+
"#operations": {
|
|
35
|
+
"source": "./src/operations/index.ts",
|
|
36
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
37
|
+
"default": "./dist/lib/operations.mjs"
|
|
38
|
+
},
|
|
39
|
+
"#plugin": {
|
|
40
|
+
"source": "./src/plugin.ts",
|
|
41
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
42
|
+
"default": "./dist/lib/plugin.mjs"
|
|
43
|
+
},
|
|
44
|
+
"#skills": {
|
|
45
|
+
"source": "./src/skills/index.ts",
|
|
46
|
+
"types": "./dist/types/src/skills/index.d.ts",
|
|
47
|
+
"default": "./dist/lib/skills.mjs"
|
|
48
|
+
},
|
|
49
|
+
"#translations": {
|
|
50
|
+
"source": "./src/translations.ts",
|
|
51
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
52
|
+
"default": "./dist/lib/translations.mjs"
|
|
53
|
+
},
|
|
54
|
+
"#types": {
|
|
55
|
+
"source": "./src/types/index.ts",
|
|
56
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
57
|
+
"default": "./dist/lib/types.mjs"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
10
60
|
"exports": {
|
|
11
61
|
".": {
|
|
62
|
+
"source": "./src/index.ts",
|
|
12
63
|
"types": "./dist/types/src/index.d.ts",
|
|
13
|
-
"
|
|
64
|
+
"import": "./dist/lib/index.mjs"
|
|
14
65
|
},
|
|
15
|
-
"./
|
|
16
|
-
|
|
17
|
-
"
|
|
66
|
+
"./assets/PLUGIN.mdl": "./PLUGIN.mdl",
|
|
67
|
+
"./Extensions": {
|
|
68
|
+
"source": "./src/Extensions.ts",
|
|
69
|
+
"types": "./dist/types/src/Extensions.d.ts",
|
|
70
|
+
"import": "./dist/lib/ns/Extensions.mjs"
|
|
71
|
+
},
|
|
72
|
+
"./GitHubCapabilities": {
|
|
73
|
+
"source": "./src/types/GitHubCapabilities.ts",
|
|
74
|
+
"types": "./dist/types/src/types/GitHubCapabilities.d.ts",
|
|
75
|
+
"import": "./dist/lib/GitHubCapabilities.mjs"
|
|
76
|
+
},
|
|
77
|
+
"./GitHubEvents": {
|
|
78
|
+
"source": "./src/types/GitHubEvents.ts",
|
|
79
|
+
"types": "./dist/types/src/types/GitHubEvents.d.ts",
|
|
80
|
+
"import": "./dist/lib/GitHubEvents.mjs"
|
|
81
|
+
},
|
|
82
|
+
"./GitHubOperation": {
|
|
83
|
+
"source": "./src/types/GitHubOperation.ts",
|
|
84
|
+
"types": "./dist/types/src/types/GitHubOperation.d.ts",
|
|
85
|
+
"import": "./dist/lib/GitHubOperation.mjs"
|
|
86
|
+
},
|
|
87
|
+
"./GitHubPlugin": {
|
|
88
|
+
"source": "./src/GitHubPlugin.ts",
|
|
89
|
+
"types": "./dist/types/src/GitHubPlugin.d.ts",
|
|
90
|
+
"import": "./dist/lib/GitHubPlugin.mjs"
|
|
91
|
+
},
|
|
92
|
+
"./package.json": "./package.json",
|
|
93
|
+
"./testing": {
|
|
94
|
+
"source": "./src/testing/index.ts",
|
|
95
|
+
"types": "./dist/types/src/testing/index.d.ts",
|
|
96
|
+
"import": "./dist/lib/testing.mjs"
|
|
97
|
+
},
|
|
98
|
+
"./translations": {
|
|
99
|
+
"source": "./src/translations.ts",
|
|
100
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
101
|
+
"import": "./dist/lib/translations.mjs"
|
|
102
|
+
},
|
|
103
|
+
"./Walkthrough": {
|
|
104
|
+
"source": "./src/types/Walkthrough.ts",
|
|
105
|
+
"types": "./dist/types/src/types/Walkthrough.d.ts",
|
|
106
|
+
"import": "./dist/lib/Walkthrough.mjs"
|
|
18
107
|
}
|
|
19
108
|
},
|
|
20
109
|
"types": "dist/types/src/index.d.ts",
|
|
21
110
|
"typesVersions": {
|
|
22
111
|
"*": {
|
|
23
|
-
"
|
|
24
|
-
"dist/types/src/
|
|
112
|
+
"GitHubEvents": [
|
|
113
|
+
"dist/types/src/types/GitHubEvents.d.ts"
|
|
114
|
+
],
|
|
115
|
+
"GitHubOperation": [
|
|
116
|
+
"dist/types/src/types/GitHubOperation.d.ts"
|
|
117
|
+
],
|
|
118
|
+
"GitHubCapabilities": [
|
|
119
|
+
"dist/types/src/types/GitHubCapabilities.d.ts"
|
|
120
|
+
],
|
|
121
|
+
"Walkthrough": [
|
|
122
|
+
"dist/types/src/types/Walkthrough.d.ts"
|
|
25
123
|
]
|
|
26
124
|
}
|
|
27
125
|
},
|
|
28
126
|
"files": [
|
|
29
127
|
"dist",
|
|
30
|
-
"
|
|
128
|
+
"dx.config.ts",
|
|
129
|
+
"src",
|
|
130
|
+
"PLUGIN.mdl"
|
|
31
131
|
],
|
|
32
132
|
"dependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"@dxos/app-
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
133
|
+
"@codemirror/language": "^6.12.4",
|
|
134
|
+
"@codemirror/state": "^6.7.6",
|
|
135
|
+
"@codemirror/view": "^6.43.13",
|
|
136
|
+
"effect": "4.0.0",
|
|
137
|
+
"@dxos/ai": "0.14.0",
|
|
138
|
+
"@dxos/app-framework": "0.14.0",
|
|
139
|
+
"@dxos/app-graph": "0.14.0",
|
|
140
|
+
"@dxos/app-toolkit": "0.14.0",
|
|
141
|
+
"@dxos/compute": "0.14.0",
|
|
142
|
+
"@dxos/echo": "0.14.0",
|
|
143
|
+
"@dxos/echo-query": "0.14.0",
|
|
144
|
+
"@dxos/echo-react": "0.14.0",
|
|
145
|
+
"@dxos/effect": "0.14.0",
|
|
146
|
+
"@dxos/errors": "0.14.0",
|
|
147
|
+
"@dxos/graph": "0.14.0",
|
|
148
|
+
"@dxos/keys": "0.14.0",
|
|
149
|
+
"@dxos/link": "0.14.0",
|
|
150
|
+
"@dxos/lit-ui": "0.14.0",
|
|
151
|
+
"@dxos/log": "0.14.0",
|
|
152
|
+
"@dxos/plugin-connector": "0.14.0",
|
|
153
|
+
"@dxos/plugin-crx": "0.14.0",
|
|
154
|
+
"@dxos/plugin-markdown": "0.14.0",
|
|
155
|
+
"@dxos/plugin-preview": "0.14.0",
|
|
156
|
+
"@dxos/plugin-space": "0.14.0",
|
|
157
|
+
"@dxos/protocols": "0.14.0",
|
|
158
|
+
"@dxos/react-client": "0.14.0",
|
|
159
|
+
"@dxos/react-ui": "0.14.0",
|
|
160
|
+
"@dxos/react-ui-attention": "0.14.0",
|
|
161
|
+
"@dxos/react-ui-components": "0.14.0",
|
|
162
|
+
"@dxos/react-ui-editor": "0.14.0",
|
|
163
|
+
"@dxos/react-ui-form": "0.14.0",
|
|
164
|
+
"@dxos/react-ui-list": "0.14.0",
|
|
165
|
+
"@dxos/react-ui-markdown": "0.14.0",
|
|
166
|
+
"@dxos/react-ui-menu": "0.14.0",
|
|
167
|
+
"@dxos/react-ui-masonry": "0.14.0",
|
|
168
|
+
"@dxos/react-ui-query": "0.14.0",
|
|
169
|
+
"@dxos/types": "0.14.0",
|
|
170
|
+
"@dxos/ui-editor": "0.14.0",
|
|
171
|
+
"@dxos/ui-types": "0.14.0",
|
|
172
|
+
"@dxos/util": "0.14.0"
|
|
53
173
|
},
|
|
54
174
|
"devDependencies": {
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@types/
|
|
58
|
-
"@types/
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
175
|
+
"@effect/atom-react": "4.0.0",
|
|
176
|
+
"@storybook/react-vite": "^10.6.0",
|
|
177
|
+
"@types/react": "~19.2.17",
|
|
178
|
+
"@types/react-dom": "~19.2.3",
|
|
179
|
+
"react": "~19.2.7",
|
|
180
|
+
"react-dom": "~19.2.7",
|
|
181
|
+
"vite": "^8.2.2",
|
|
182
|
+
"@dxos/echo-client": "0.14.0",
|
|
183
|
+
"@dxos/plugin-client": "0.14.0",
|
|
184
|
+
"@dxos/plugin-testing": "0.14.0",
|
|
185
|
+
"@dxos/random": "0.14.0",
|
|
186
|
+
"@dxos/react-ui-editor": "0.14.0"
|
|
67
187
|
},
|
|
68
188
|
"peerDependencies": {
|
|
69
|
-
"@
|
|
70
|
-
"
|
|
71
|
-
"react
|
|
72
|
-
"
|
|
73
|
-
"@dxos/react-ui-theme": "0.7.4"
|
|
189
|
+
"@effect/atom-react": "4.0.0",
|
|
190
|
+
"effect": "4.0.0",
|
|
191
|
+
"react": "~19.2.7",
|
|
192
|
+
"react-dom": "~19.2.7"
|
|
74
193
|
},
|
|
75
194
|
"publishConfig": {
|
|
76
195
|
"access": "public"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Plugin from '@dxos/app-framework/Plugin';
|
|
8
|
+
|
|
9
|
+
import { meta as pluginMeta } from '#meta';
|
|
10
|
+
|
|
11
|
+
/** Plugin metadata, available without loading the plugin body. */
|
|
12
|
+
export const meta = pluginMeta;
|
|
13
|
+
|
|
14
|
+
/** Constructs the plugin; the body loads on first enable. */
|
|
15
|
+
export const make = Plugin.lazy(meta, () => import('#plugin'));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { activateHeadlessPlugins } from '@dxos/app-toolkit/testing';
|
|
8
|
+
import { Type } from '@dxos/echo';
|
|
9
|
+
import { PullRequest } from '@dxos/types';
|
|
10
|
+
|
|
11
|
+
import { GitHubOperation, Walkthrough } from '#types';
|
|
12
|
+
|
|
13
|
+
import * as GitHubPlugin from './GitHubPlugin.ts';
|
|
14
|
+
|
|
15
|
+
describe('GitHubPlugin in workerd', () => {
|
|
16
|
+
test('activates headless and contributes its operations and types', async ({ expect }) => {
|
|
17
|
+
const { failures, operationKeys, typenames } = await activateHeadlessPlugins([GitHubPlugin.make()]);
|
|
18
|
+
expect(failures).toEqual([]);
|
|
19
|
+
expect(operationKeys).toContain(String(GitHubOperation.ImportPullRequest.meta.key));
|
|
20
|
+
expect(typenames).toContain(Type.getTypename(PullRequest.PullRequest));
|
|
21
|
+
expect(typenames).toContain(Type.getTypename(Walkthrough.Walkthrough));
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as HttpClientError from 'effect/http/HttpClientError';
|
|
6
|
+
import * as HttpClientRequest from 'effect/http/HttpClientRequest';
|
|
7
|
+
import * as HttpClientResponse from 'effect/http/HttpClientResponse';
|
|
8
|
+
import { describe, expect, test } from 'vitest';
|
|
9
|
+
|
|
10
|
+
import { APPROVAL_MARKER, approvalCommentBody, isApprovalComment, isApprovalRefused } from './approval.ts';
|
|
11
|
+
|
|
12
|
+
const statusError = (status: number) => {
|
|
13
|
+
const request = HttpClientRequest.post('https://api.github.com/repos/dxos/dxos/pulls/1/reviews');
|
|
14
|
+
return new HttpClientError.HttpClientError({
|
|
15
|
+
reason: new HttpClientError.StatusCodeError({
|
|
16
|
+
request,
|
|
17
|
+
response: HttpClientResponse.fromWeb(request, new Response(null, { status })),
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
describe('approval fallback', () => {
|
|
23
|
+
test('the comment carries the marker, and the reviewer summary above it', () => {
|
|
24
|
+
expect(isApprovalComment(approvalCommentBody())).toBe(true);
|
|
25
|
+
expect(approvalCommentBody('Looks good.').startsWith('Looks good.')).toBe(true);
|
|
26
|
+
expect(approvalCommentBody('Looks good.').endsWith(APPROVAL_MARKER)).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test('an ordinary comment is not an approval', () => {
|
|
30
|
+
expect(isApprovalComment('Approved — good to land.')).toBe(false);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('only a refusal to review falls back', () => {
|
|
34
|
+
expect(isApprovalRefused(statusError(422))).toBe(true);
|
|
35
|
+
expect(isApprovalRefused(statusError(403))).toBe(true);
|
|
36
|
+
// A rejected credential is the user's to fix and must surface as a failure.
|
|
37
|
+
expect(isApprovalRefused(statusError(401))).toBe(false);
|
|
38
|
+
expect(isApprovalRefused(new Error('offline'))).toBe(false);
|
|
39
|
+
});
|
|
40
|
+
});
|
package/src/approval.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { GitHubApi } from './services/index.ts';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Machine-readable marker carried by an approval posted as a comment.
|
|
9
|
+
*
|
|
10
|
+
* An HTML comment renders as nothing on GitHub, so the marker is invisible to a human reader while
|
|
11
|
+
* remaining an exact string for an agent polling the conversation — which is the point: a comment
|
|
12
|
+
* fallback has to be as detectable as the review state it stands in for.
|
|
13
|
+
*/
|
|
14
|
+
export const APPROVAL_MARKER = '<!-- dxos:approval state=approved -->';
|
|
15
|
+
|
|
16
|
+
/** Prose shown above the marker; states why the approval is a comment rather than a review. */
|
|
17
|
+
const APPROVAL_TEXT =
|
|
18
|
+
'Approved — good to land.\n\n' +
|
|
19
|
+
'_GitHub declined an approving review from this connection (a pull request cannot be approved by ' +
|
|
20
|
+
'its own author, and some tokens carry no review permission), so the approval is recorded here._';
|
|
21
|
+
|
|
22
|
+
/** Body of the fallback comment: the reviewer's own summary, the standing text, and the marker. */
|
|
23
|
+
export const approvalCommentBody = (body?: string): string =>
|
|
24
|
+
[body?.trim(), APPROVAL_TEXT, APPROVAL_MARKER].filter(Boolean).join('\n\n');
|
|
25
|
+
|
|
26
|
+
/** Whether a comment body records an approval — the detector an agent runs over a PR's comments. */
|
|
27
|
+
export const isApprovalComment = (body: string): boolean => body.includes(APPROVAL_MARKER);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Whether an approving review failed for a reason a comment can stand in for.
|
|
31
|
+
*
|
|
32
|
+
* `422` is GitHub's answer to approving one's own pull request, `403` to a token without review
|
|
33
|
+
* permission on the repository. Anything else (a rejected credential, a deleted pull request, a
|
|
34
|
+
* network fault) is a real failure and must surface rather than turn into a comment.
|
|
35
|
+
*/
|
|
36
|
+
export const isApprovalRefused = (error: unknown): boolean => {
|
|
37
|
+
const status = GitHubApi.responseStatus(error);
|
|
38
|
+
return status === 403 || status === 422;
|
|
39
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
8
|
+
import * as AppGraphBuilder from '@dxos/app-graph/AppGraphBuilder';
|
|
9
|
+
import * as AppGraphNode from '@dxos/app-graph/AppGraphNode';
|
|
10
|
+
import * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';
|
|
11
|
+
import * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';
|
|
12
|
+
import * as Operation from '@dxos/compute/Operation';
|
|
13
|
+
import * as GraphNodeMatcher from '@dxos/graph/GraphNodeMatcher';
|
|
14
|
+
|
|
15
|
+
import { IMPORT_PULL_REQUEST_DIALOG, meta } from '#meta';
|
|
16
|
+
import { GitHubOperation } from '#types';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Contributes "Import pull request" to the root, so the commands dialog carries it: a reviewer who
|
|
20
|
+
* has a link in hand should not have to sync a repository to read the change.
|
|
21
|
+
*/
|
|
22
|
+
export default Capability.makeModule(
|
|
23
|
+
Effect.fnUntraced(function* () {
|
|
24
|
+
const extensions = yield* AppGraphBuilder.createExtension({
|
|
25
|
+
id: 'importPullRequest',
|
|
26
|
+
match: GraphNodeMatcher.whenRoot,
|
|
27
|
+
actions: () =>
|
|
28
|
+
Effect.succeed([
|
|
29
|
+
AppGraphNode.makeAction({
|
|
30
|
+
id: GitHubOperation.ImportPullRequest.meta.key,
|
|
31
|
+
data: Effect.fnUntraced(function* () {
|
|
32
|
+
yield* Operation.invoke(LayoutOperation.UpdateDialog, {
|
|
33
|
+
subject: IMPORT_PULL_REQUEST_DIALOG,
|
|
34
|
+
blockAlign: 'start',
|
|
35
|
+
});
|
|
36
|
+
}),
|
|
37
|
+
properties: {
|
|
38
|
+
label: ['import-pull-request.label', { ns: meta.profile.key }],
|
|
39
|
+
icon: 'ph--git-pull-request--regular',
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
]),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return Capability.contribute(AppCapabilities.AppGraphBuilder, extensions);
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Layer from 'effect/Layer';
|
|
7
|
+
|
|
8
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
9
|
+
import * as Credential from '@dxos/compute/Credential';
|
|
10
|
+
import { Obj } from '@dxos/echo';
|
|
11
|
+
import * as ConnectorError from '@dxos/plugin-connector/ConnectorError';
|
|
12
|
+
import * as ConnectorSpec from '@dxos/plugin-connector/ConnectorSpec';
|
|
13
|
+
import { OAuthProvider } from '@dxos/protocols';
|
|
14
|
+
|
|
15
|
+
import { GitHubOperation } from '#types';
|
|
16
|
+
|
|
17
|
+
import { GITHUB_PROVIDER_ID, GITHUB_SOURCE } from '../constants.ts';
|
|
18
|
+
import { GitHubApi } from '../services/index.ts';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Service-specific token-created hook for GitHub.
|
|
22
|
+
*
|
|
23
|
+
* Calls GitHub's `/user` to populate `accessToken.account` with the
|
|
24
|
+
* authenticated user's login (falling back to email). Failures are elevated
|
|
25
|
+
* with {@link Effect.orDie}; plugin-connector logs defects from the runner
|
|
26
|
+
* and continues so a failed `/user` cannot block the Connection already
|
|
27
|
+
* created.
|
|
28
|
+
*/
|
|
29
|
+
const onTokenCreated: ConnectorSpec.OnTokenCreated = ({ accessToken }) =>
|
|
30
|
+
Effect.gen(function* () {
|
|
31
|
+
if (accessToken.account) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const token = yield* Credential.getApiKeyValue({ accessTokenId: accessToken.id });
|
|
35
|
+
const user = yield* GitHubApi.fetchUser().pipe(
|
|
36
|
+
Effect.provide(Layer.succeed(GitHubApi.GitHubCredentials, { token })),
|
|
37
|
+
);
|
|
38
|
+
Obj.update(accessToken, (accessToken) => {
|
|
39
|
+
accessToken.account = user.login ?? user.email;
|
|
40
|
+
});
|
|
41
|
+
}).pipe(Effect.orDie);
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* GitHub `testConnection`: `GET /user` with the stored token. A rejected token
|
|
45
|
+
* (401/403 on a revoked grant) or transport failure surfaces as a user-facing
|
|
46
|
+
* error so the connection UI can offer to reauthenticate.
|
|
47
|
+
*/
|
|
48
|
+
const testConnection: ConnectorSpec.TestConnection = ({ accessToken }) =>
|
|
49
|
+
Effect.flatMap(Credential.getApiKeyValue({ accessTokenId: accessToken.id }), (token) =>
|
|
50
|
+
GitHubApi.fetchUser().pipe(Effect.provide(Layer.succeed(GitHubApi.GitHubCredentials, { token }))),
|
|
51
|
+
).pipe(
|
|
52
|
+
Effect.asVoid,
|
|
53
|
+
Effect.mapError(
|
|
54
|
+
() =>
|
|
55
|
+
new ConnectorError.ConnectionTestError({
|
|
56
|
+
message: 'GitHub rejected the credential. Reauthenticate to continue syncing.',
|
|
57
|
+
}),
|
|
58
|
+
),
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Contributes a single `ConnectorSpec.Connector` entry that wires GitHub's two operations,
|
|
63
|
+
* its target materializer, and the token-created hook to the `'github.com'`
|
|
64
|
+
* source. plugin-connector routes by `connectorId`.
|
|
65
|
+
*
|
|
66
|
+
* Sync targets are repositories, not organizations — orgs and their members
|
|
67
|
+
* are auto-pulled as a side effect of syncing any repo they own.
|
|
68
|
+
*
|
|
69
|
+
* `scopes` is intentionally empty: this is a GitHub *App* (not a classic
|
|
70
|
+
* OAuth App), so permissions are declared in the App's settings on github.com
|
|
71
|
+
* and OAuth scope strings are ignored on the user-authorization flow.
|
|
72
|
+
*/
|
|
73
|
+
export default Capability.makeModule(
|
|
74
|
+
Effect.fnUntraced(function* () {
|
|
75
|
+
return Capability.contribute(ConnectorSpec.Connector, [
|
|
76
|
+
{
|
|
77
|
+
id: GITHUB_PROVIDER_ID,
|
|
78
|
+
source: GITHUB_SOURCE,
|
|
79
|
+
label: 'GitHub',
|
|
80
|
+
oauth: {
|
|
81
|
+
provider: OAuthProvider.GITHUB,
|
|
82
|
+
scopes: [],
|
|
83
|
+
},
|
|
84
|
+
sync: {
|
|
85
|
+
operation: GitHubOperation.SyncGitHubRepositories,
|
|
86
|
+
getTargets: GitHubOperation.GetGitHubRepositories,
|
|
87
|
+
materializeTarget: GitHubOperation.MaterializeGitHubTarget,
|
|
88
|
+
optionsSchema: GitHubOperation.SyncOptions,
|
|
89
|
+
},
|
|
90
|
+
onTokenCreated,
|
|
91
|
+
testConnection,
|
|
92
|
+
},
|
|
93
|
+
]);
|
|
94
|
+
}),
|
|
95
|
+
);
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'browser' condition.
|
|
6
|
+
|
|
7
|
+
import * as ActivationEvents from '@dxos/app-framework/ActivationEvents';
|
|
8
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
9
|
+
import * as AppCapability from '@dxos/app-toolkit/AppCapability';
|
|
10
|
+
import * as ConnectorEvents from '@dxos/plugin-connector/ConnectorEvents';
|
|
11
|
+
import * as ConnectorSpec from '@dxos/plugin-connector/ConnectorSpec';
|
|
12
|
+
import * as CrxCapabilities from '@dxos/plugin-crx/CrxCapabilities';
|
|
13
|
+
import * as CrxEvents from '@dxos/plugin-crx/CrxEvents';
|
|
14
|
+
import * as MarkdownCapabilities from '@dxos/plugin-markdown/MarkdownCapabilities';
|
|
15
|
+
import * as MarkdownEvents from '@dxos/plugin-markdown/MarkdownEvents';
|
|
16
|
+
import * as PreviewCapabilities from '@dxos/plugin-preview/PreviewCapabilities';
|
|
17
|
+
import * as PreviewEvents from '@dxos/plugin-preview/PreviewEvents';
|
|
18
|
+
|
|
19
|
+
import { meta } from '#meta';
|
|
20
|
+
import { translations } from '#translations';
|
|
21
|
+
|
|
22
|
+
import pluginSpec from '../../../PLUGIN.mdl?raw';
|
|
23
|
+
|
|
24
|
+
export const Connector = Capability.lazyModule(
|
|
25
|
+
'GitHubConnector',
|
|
26
|
+
{ provides: [ConnectorSpec.Connector], activatesOn: ConnectorEvents.Start },
|
|
27
|
+
() => import('../connector.ts'),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
// Browser-only: the editor it decorates and the popover it answers render nowhere else.
|
|
31
|
+
export const MarkdownExtension = Capability.lazyModule(
|
|
32
|
+
'MarkdownExtension',
|
|
33
|
+
{
|
|
34
|
+
provides: [MarkdownCapabilities.ExtensionProvider],
|
|
35
|
+
activatesOn: MarkdownEvents.Start,
|
|
36
|
+
environments: ['browser', 'tauri'],
|
|
37
|
+
},
|
|
38
|
+
() => import('../markdown-extension.ts'),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export const LinkResolver = Capability.lazyModule(
|
|
42
|
+
'LinkResolver',
|
|
43
|
+
{
|
|
44
|
+
provides: [PreviewCapabilities.LinkResolver],
|
|
45
|
+
activatesOn: PreviewEvents.Start,
|
|
46
|
+
environments: ['browser', 'tauri'],
|
|
47
|
+
},
|
|
48
|
+
() => import('../link-resolver.ts'),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// Narrower than the `appGraphBuilder` family default: the action opens a dialog, which means
|
|
52
|
+
// nothing without an app shell.
|
|
53
|
+
export const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('../app-graph-builder.ts'), {
|
|
54
|
+
environments: ['browser', 'tauri'],
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export const PageActionProvider = Capability.lazyModule(
|
|
58
|
+
'PageActionProvider',
|
|
59
|
+
{ provides: [CrxCapabilities.PageAction], activatesOn: CrxEvents.Start },
|
|
60
|
+
() => import('../page-action.ts'),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler.ts'), {
|
|
64
|
+
activatesOn: ActivationEvents.Idle,
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export const Schema = AppCapability.schema(() => import('../schema.ts'));
|
|
68
|
+
|
|
69
|
+
export const SkillDefinition = AppCapability.skillDefinition(() => import('../skill-definition.ts'));
|
|
70
|
+
|
|
71
|
+
export const ReactSurface = AppCapability.surface(() => import('../react-surface.ts'), {
|
|
72
|
+
roles: ['org.dxos.role.cardContent', 'org.dxos.role.cardMenu', 'org.dxos.role.article', 'org.dxos.role.dialog'],
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export const PluginAsset = AppCapability.pluginAsset({
|
|
76
|
+
pluginId: meta.profile.key,
|
|
77
|
+
path: 'PLUGIN.mdl',
|
|
78
|
+
content: pluginSpec,
|
|
79
|
+
mimeType: 'application/x-mdl',
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export const Translations = AppCapability.translations(translations);
|