@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,43 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'node' 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
|
+
|
|
15
|
+
import { translations } from '#translations';
|
|
16
|
+
|
|
17
|
+
export const Connector = Capability.lazyModule(
|
|
18
|
+
'GitHubConnector',
|
|
19
|
+
{ provides: [ConnectorSpec.Connector], activatesOn: ConnectorEvents.Start },
|
|
20
|
+
() => import('../connector.ts'),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const PageActionProvider = Capability.lazyModule(
|
|
24
|
+
'PageActionProvider',
|
|
25
|
+
{ provides: [CrxCapabilities.PageAction], activatesOn: CrxEvents.Start },
|
|
26
|
+
() => import('../page-action.ts'),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler.ts'), {
|
|
30
|
+
activatesOn: ActivationEvents.Idle,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const Schema = AppCapability.schema(() => import('../schema.ts'));
|
|
34
|
+
|
|
35
|
+
export const SkillDefinition = AppCapability.skillDefinition(() => import('../skill-definition.ts'));
|
|
36
|
+
|
|
37
|
+
export const Translations = AppCapability.translations(translations);
|
|
38
|
+
|
|
39
|
+
export const AppGraphBuilder = undefined;
|
|
40
|
+
export const LinkResolver = undefined;
|
|
41
|
+
export const MarkdownExtension = undefined;
|
|
42
|
+
export const PluginAsset = undefined;
|
|
43
|
+
export const ReactSurface = undefined;
|
|
@@ -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 'tauri' 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);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'workerd' 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
|
+
|
|
15
|
+
import { translations } from '#translations';
|
|
16
|
+
|
|
17
|
+
export const Connector = Capability.lazyModule(
|
|
18
|
+
'GitHubConnector',
|
|
19
|
+
{ provides: [ConnectorSpec.Connector], activatesOn: ConnectorEvents.Start },
|
|
20
|
+
() => import('../connector.ts'),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const PageActionProvider = Capability.lazyModule(
|
|
24
|
+
'PageActionProvider',
|
|
25
|
+
{ provides: [CrxCapabilities.PageAction], activatesOn: CrxEvents.Start },
|
|
26
|
+
() => import('../page-action.ts'),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export const OperationHandler = AppCapability.operationHandler(() => import('../operation-handler.ts'), {
|
|
30
|
+
activatesOn: ActivationEvents.Idle,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const Schema = AppCapability.schema(() => import('../schema.ts'));
|
|
34
|
+
|
|
35
|
+
export const SkillDefinition = AppCapability.skillDefinition(() => import('../skill-definition.ts'));
|
|
36
|
+
|
|
37
|
+
export const Translations = AppCapability.translations(translations);
|
|
38
|
+
|
|
39
|
+
export const AppGraphBuilder = undefined;
|
|
40
|
+
export const LinkResolver = undefined;
|
|
41
|
+
export const MarkdownExtension = undefined;
|
|
42
|
+
export const PluginAsset = undefined;
|
|
43
|
+
export const ReactSurface = undefined;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as ActivationEvents from '@dxos/app-framework/ActivationEvents';
|
|
6
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
7
|
+
import * as AppCapability from '@dxos/app-toolkit/AppCapability';
|
|
8
|
+
import * as ConnectorEvents from '@dxos/plugin-connector/ConnectorEvents';
|
|
9
|
+
import * as ConnectorSpec from '@dxos/plugin-connector/ConnectorSpec';
|
|
10
|
+
import * as CrxCapabilities from '@dxos/plugin-crx/CrxCapabilities';
|
|
11
|
+
import * as CrxEvents from '@dxos/plugin-crx/CrxEvents';
|
|
12
|
+
import * as MarkdownCapabilities from '@dxos/plugin-markdown/MarkdownCapabilities';
|
|
13
|
+
import * as MarkdownEvents from '@dxos/plugin-markdown/MarkdownEvents';
|
|
14
|
+
import * as PreviewCapabilities from '@dxos/plugin-preview/PreviewCapabilities';
|
|
15
|
+
import * as PreviewEvents from '@dxos/plugin-preview/PreviewEvents';
|
|
16
|
+
|
|
17
|
+
import { meta } from '#meta';
|
|
18
|
+
import { translations } from '#translations';
|
|
19
|
+
|
|
20
|
+
// eslint-disable-next-line import/no-relative-packages
|
|
21
|
+
import pluginSpec from '../../PLUGIN.mdl?raw';
|
|
22
|
+
|
|
23
|
+
export const Connector = Capability.lazyModule(
|
|
24
|
+
'GitHubConnector',
|
|
25
|
+
{ provides: [ConnectorSpec.Connector], activatesOn: ConnectorEvents.Start },
|
|
26
|
+
() => import('./connector.ts'),
|
|
27
|
+
);
|
|
28
|
+
// Browser-only: the editor it decorates and the popover it answers render nowhere else.
|
|
29
|
+
export const MarkdownExtension = Capability.lazyModule(
|
|
30
|
+
'MarkdownExtension',
|
|
31
|
+
{
|
|
32
|
+
provides: [MarkdownCapabilities.ExtensionProvider],
|
|
33
|
+
activatesOn: MarkdownEvents.Start,
|
|
34
|
+
environments: ['browser', 'tauri'],
|
|
35
|
+
},
|
|
36
|
+
() => import('./markdown-extension.ts'),
|
|
37
|
+
);
|
|
38
|
+
export const LinkResolver = Capability.lazyModule(
|
|
39
|
+
'LinkResolver',
|
|
40
|
+
{
|
|
41
|
+
provides: [PreviewCapabilities.LinkResolver],
|
|
42
|
+
activatesOn: PreviewEvents.Start,
|
|
43
|
+
environments: ['browser', 'tauri'],
|
|
44
|
+
},
|
|
45
|
+
() => import('./link-resolver.ts'),
|
|
46
|
+
);
|
|
47
|
+
// Narrower than the `appGraphBuilder` family default: the action opens a dialog, which means
|
|
48
|
+
// nothing without an app shell.
|
|
49
|
+
export const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('./app-graph-builder.ts'), {
|
|
50
|
+
environments: ['browser', 'tauri'],
|
|
51
|
+
});
|
|
52
|
+
export const PageActionProvider = Capability.lazyModule(
|
|
53
|
+
'PageActionProvider',
|
|
54
|
+
{ provides: [CrxCapabilities.PageAction], activatesOn: CrxEvents.Start },
|
|
55
|
+
() => import('./page-action.ts'),
|
|
56
|
+
);
|
|
57
|
+
export const OperationHandler = AppCapability.operationHandler(() => import('./operation-handler.ts'), {
|
|
58
|
+
activatesOn: ActivationEvents.Idle,
|
|
59
|
+
});
|
|
60
|
+
export const Schema = AppCapability.schema(() => import('./schema.ts'));
|
|
61
|
+
export const SkillDefinition = AppCapability.skillDefinition(() => import('./skill-definition.ts'));
|
|
62
|
+
export const ReactSurface = AppCapability.surface(() => import('./react-surface.ts'), {
|
|
63
|
+
roles: ['org.dxos.role.cardContent', 'org.dxos.role.cardMenu', 'org.dxos.role.article', 'org.dxos.role.dialog'],
|
|
64
|
+
});
|
|
65
|
+
export const PluginAsset = AppCapability.pluginAsset({
|
|
66
|
+
pluginId: meta.profile.key,
|
|
67
|
+
path: 'PLUGIN.mdl',
|
|
68
|
+
content: pluginSpec,
|
|
69
|
+
mimeType: 'application/x-mdl',
|
|
70
|
+
});
|
|
71
|
+
export const Translations = AppCapability.translations(translations);
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as FetchHttpClient from 'effect/http/FetchHttpClient';
|
|
7
|
+
import * as Layer from 'effect/Layer';
|
|
8
|
+
|
|
9
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
10
|
+
import { Database, Filter } from '@dxos/echo';
|
|
11
|
+
import { Connection } from '@dxos/link';
|
|
12
|
+
import { log } from '@dxos/log';
|
|
13
|
+
import * as PreviewCapabilities from '@dxos/plugin-preview/PreviewCapabilities';
|
|
14
|
+
import { Issue, PullRequest, Repo } from '@dxos/types';
|
|
15
|
+
|
|
16
|
+
import { GitHubCapabilities } from '#types';
|
|
17
|
+
|
|
18
|
+
import { GITHUB_PROVIDER_ID } from '../constants.ts';
|
|
19
|
+
import { type GitHubLink, githubLinkIcon, parseGitHubLink } from '../extensions/index.ts';
|
|
20
|
+
import { toPullRequestProps } from '../pull-request.ts';
|
|
21
|
+
import { GitHubApi } from '../services/index.ts';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Resolves a GitHub repository, pull-request or issue URL to an in-memory `Repo`, `PullRequest` or
|
|
25
|
+
* `Issue` for the preview popover. The object comes from the contributed `LinkSource` when a host provides one and
|
|
26
|
+
* from the GitHub API otherwise; either way it is built, not stored — a preview is not a sync.
|
|
27
|
+
*/
|
|
28
|
+
export default Capability.makeModule(
|
|
29
|
+
Effect.fnUntraced(function* () {
|
|
30
|
+
const capabilities = yield* Capability.Service;
|
|
31
|
+
return Capability.contribute(PreviewCapabilities.LinkResolver, [
|
|
32
|
+
{
|
|
33
|
+
match: (url) => parseGitHubLink(url) !== undefined,
|
|
34
|
+
// How GitHub itself shortens a bare reference: the number, or the repository's full name.
|
|
35
|
+
label: (url) => {
|
|
36
|
+
const link = parseGitHubLink(url);
|
|
37
|
+
return link && (link.number !== undefined ? `#${link.number}` : `${link.owner}/${link.repo}`);
|
|
38
|
+
},
|
|
39
|
+
icon: githubLinkIcon,
|
|
40
|
+
resolve: ({ eid }, context) =>
|
|
41
|
+
Effect.gen(function* () {
|
|
42
|
+
const link = parseGitHubLink(eid);
|
|
43
|
+
if (!link) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
const [source = fetchFromGitHub] = capabilities.getAll(GitHubCapabilities.LinkSource);
|
|
47
|
+
const object = yield* source(link, context);
|
|
48
|
+
return (
|
|
49
|
+
object && { label: Repo.instanceOf(object) ? Repo.fullName(object) : Issue.reference(object), object }
|
|
50
|
+
);
|
|
51
|
+
}),
|
|
52
|
+
},
|
|
53
|
+
]);
|
|
54
|
+
}),
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The default source: each of the space's GitHub connection tokens in turn — a space can hold
|
|
59
|
+
* several, and only some may reach a private repository — then anonymous, which reaches a public one.
|
|
60
|
+
*/
|
|
61
|
+
const fetchFromGitHub: GitHubCapabilities.GitHubLinkSource = (link, { db }) =>
|
|
62
|
+
Effect.gen(function* () {
|
|
63
|
+
const tokens = db ? yield* connectionTokens(db) : [];
|
|
64
|
+
for (const token of [...tokens, '']) {
|
|
65
|
+
const object = yield* fetchLink(link).pipe(
|
|
66
|
+
Effect.provide(Layer.succeed(GitHubApi.GitHubCredentials, { token })),
|
|
67
|
+
Effect.tapError((error) => Effect.sync(() => log.warn('github link preview failed', { url: link.url, error }))),
|
|
68
|
+
Effect.catch(() => Effect.succeed(undefined)),
|
|
69
|
+
);
|
|
70
|
+
if (object) {
|
|
71
|
+
return object;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
}).pipe(
|
|
76
|
+
Effect.provide(FetchHttpClient.layer),
|
|
77
|
+
Effect.catch(() => Effect.succeed(undefined)),
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
/** The tokens of the space's GitHub connections, in query order. */
|
|
81
|
+
const connectionTokens = (db: NonNullable<PreviewCapabilities.PreviewLinkContext['db']>) =>
|
|
82
|
+
Effect.gen(function* () {
|
|
83
|
+
const connections = yield* Database.query(Filter.type(Connection.Connection)).run;
|
|
84
|
+
const tokens: string[] = [];
|
|
85
|
+
for (const connection of connections) {
|
|
86
|
+
if (connection.connectorId !== GITHUB_PROVIDER_ID) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const accessToken = yield* Database.load(connection.accessToken);
|
|
90
|
+
tokens.push(accessToken.token);
|
|
91
|
+
}
|
|
92
|
+
return tokens;
|
|
93
|
+
}).pipe(Effect.provide(Database.layer(db)));
|
|
94
|
+
|
|
95
|
+
const fetchLink = (link: GitHubLink) =>
|
|
96
|
+
Effect.gen(function* () {
|
|
97
|
+
const { owner, repo, number } = link;
|
|
98
|
+
if (link.kind === 'repo' || number === undefined) {
|
|
99
|
+
return toRepo(link, yield* GitHubApi.fetchRepo(owner, repo));
|
|
100
|
+
}
|
|
101
|
+
if (link.kind === 'pull') {
|
|
102
|
+
return toPullRequest(link, yield* GitHubApi.fetchPullRequest(owner, repo, number));
|
|
103
|
+
}
|
|
104
|
+
const issue = yield* GitHubApi.fetchIssue(owner, repo, number);
|
|
105
|
+
// The issue endpoint answers for a pull request's number too; only the pull endpoint has its diff.
|
|
106
|
+
if (issue.pull_request) {
|
|
107
|
+
return toPullRequest(link, yield* GitHubApi.fetchPullRequest(owner, repo, number));
|
|
108
|
+
}
|
|
109
|
+
return toIssue(link, issue);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const toRepo = ({ owner, url }: GitHubLink, repo: GitHubApi.GitHubRepo): Repo.Repo =>
|
|
113
|
+
Repo.make({
|
|
114
|
+
owner,
|
|
115
|
+
name: repo.name,
|
|
116
|
+
url: repo.html_url ?? url,
|
|
117
|
+
description: repo.description ?? undefined,
|
|
118
|
+
defaultBranch: repo.default_branch ?? undefined,
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
const toIssue = ({ owner, repo, number = 0, url }: GitHubLink, issue: GitHubApi.GitHubIssue): Issue.Issue =>
|
|
122
|
+
Issue.make({
|
|
123
|
+
owner,
|
|
124
|
+
repo,
|
|
125
|
+
number,
|
|
126
|
+
title: issue.title,
|
|
127
|
+
url: issue.html_url ?? url,
|
|
128
|
+
state: issue.state === 'closed' ? 'closed' : 'open',
|
|
129
|
+
author: issue.user?.login,
|
|
130
|
+
description: issue.body ?? undefined,
|
|
131
|
+
labels: issue.labels?.map((label) => label.name),
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
const toPullRequest = (
|
|
135
|
+
{ owner, repo, number = 0, url }: GitHubLink,
|
|
136
|
+
pull: GitHubApi.GitHubPull,
|
|
137
|
+
): PullRequest.PullRequest => PullRequest.make(toPullRequestProps({ owner, repo, number, url }, pull));
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { ViewPlugin } from '@codemirror/view';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
|
|
8
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
9
|
+
import * as Project from '@dxos/compute/Project';
|
|
10
|
+
import { type Database, Filter, Obj, Query } from '@dxos/echo';
|
|
11
|
+
import * as MarkdownCapabilities from '@dxos/plugin-markdown/MarkdownCapabilities';
|
|
12
|
+
import { Repo, TaskSet } from '@dxos/types';
|
|
13
|
+
|
|
14
|
+
import { GITHUB_SOURCE } from '../constants.ts';
|
|
15
|
+
import { githubLinks, githubReferences, referenceUrl } from '../extensions/index.ts';
|
|
16
|
+
|
|
17
|
+
/** `owner/repo` — what `sync` writes as the name of the TaskSet mirroring a repository. */
|
|
18
|
+
const REPO_NAME = /^[\w.-]+\/[\w.-]+$/;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* `#123` in a document resolves against the repository the document's project names: this plugin
|
|
22
|
+
* owns that knowledge, so the decoration is contributed rather than built into the editor. A full
|
|
23
|
+
* pull-request or issue URL needs no repository and becomes a chip whose popover this plugin's
|
|
24
|
+
* link resolver answers.
|
|
25
|
+
*
|
|
26
|
+
* Ambiguity is answered by declining. A space with several repositories and no project naming one
|
|
27
|
+
* has no single meaning for a bare number, so the reference is left as text rather than guessed at.
|
|
28
|
+
*/
|
|
29
|
+
export default Capability.makeModule(
|
|
30
|
+
Effect.fnUntraced(function* () {
|
|
31
|
+
return Capability.contribute(MarkdownCapabilities.ExtensionProvider, [
|
|
32
|
+
({ document: doc, subject, viewMode }) => {
|
|
33
|
+
// Source view shows the document's own text; a decoration there would hide what it is.
|
|
34
|
+
if (viewMode === 'source') {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// A full URL needs no object: a task's description or an outline gets the chip too. A bare
|
|
39
|
+
// `#123` resolves against the repository of the project owning the edited object, so it
|
|
40
|
+
// needs one — the document, or whatever else the editor edits.
|
|
41
|
+
const object = doc ?? subject;
|
|
42
|
+
const db = object && Obj.getDatabase(object);
|
|
43
|
+
if (!object || !db) {
|
|
44
|
+
return [githubLinks()];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Nearest binding first: the project that owns the object names its repository explicitly,
|
|
48
|
+
// and only a space with exactly one mirrored repository can answer for an object that
|
|
49
|
+
// belongs to no project.
|
|
50
|
+
const mirrored = watchMirroredRepos(db);
|
|
51
|
+
return [
|
|
52
|
+
githubLinks(),
|
|
53
|
+
githubReferences({
|
|
54
|
+
resolve: (number) => {
|
|
55
|
+
const repo = projectRepo(db, object) ?? mirrored.single();
|
|
56
|
+
return repo ? referenceUrl(repo, number) : undefined;
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
// Held per mounted view: the provider's result can be mounted in several editors or none,
|
|
60
|
+
// so each view acquires its own hold rather than all of them releasing one subscription.
|
|
61
|
+
ViewPlugin.define(() => ({ destroy: mirrored.acquire() })),
|
|
62
|
+
];
|
|
63
|
+
},
|
|
64
|
+
]);
|
|
65
|
+
}),
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
/** The `repo` of the project owning `object`, else the repository its adopted task set mirrors. */
|
|
69
|
+
const projectRepo = (db: Database.Database, object: Obj.Unknown): string | undefined => {
|
|
70
|
+
const project = owningProject(object);
|
|
71
|
+
if (!project) {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const repo = project.repo?.target;
|
|
76
|
+
if (repo && Repo.instanceOf(repo)) {
|
|
77
|
+
return Repo.fullName(repo);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// A project mirroring a repository adopts its synced task set, whose name is `owner/repo`.
|
|
81
|
+
const taskSet = project.taskSet?.target;
|
|
82
|
+
return taskSet && isMirrored(taskSet) ? repoName(taskSet) : undefined;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** Walks the ECHO parent edge: a project's outline, instructions and artifacts all cascade from it. */
|
|
86
|
+
const owningProject = (object: Obj.Unknown): Project.Project | undefined => {
|
|
87
|
+
let current: Obj.Unknown | undefined = object;
|
|
88
|
+
// Bounded: a malformed parent cycle must not hang the editor's decoration pass.
|
|
89
|
+
for (let depth = 0; current && depth < 8; depth++) {
|
|
90
|
+
if (Obj.instanceOf(Project.Project, current)) {
|
|
91
|
+
return current;
|
|
92
|
+
}
|
|
93
|
+
current = Obj.getParent(current);
|
|
94
|
+
}
|
|
95
|
+
return undefined;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The repositories this space mirrors, as `owner/name`. Read synchronously from a decoration pass,
|
|
100
|
+
* where a fresh `runSync()` would answer with whatever the tab has loaded so far; the subscription
|
|
101
|
+
* brings the set to the complete answer and keeps it there while any editor holds it.
|
|
102
|
+
*/
|
|
103
|
+
const watchMirroredRepos = (db: Database.Database) => {
|
|
104
|
+
const names = new Set<string>();
|
|
105
|
+
let holds = 0;
|
|
106
|
+
let stop: (() => void) | undefined;
|
|
107
|
+
return {
|
|
108
|
+
/** The one mirrored repository, or undefined when there is none or more than one. */
|
|
109
|
+
single: () => (names.size === 1 ? [...names][0] : undefined),
|
|
110
|
+
/** Starts watching on the first hold; the returned release is safe to call more than once. */
|
|
111
|
+
acquire: (): (() => void) => {
|
|
112
|
+
if (holds++ === 0) {
|
|
113
|
+
stop = db.query(Query.select(Filter.type(TaskSet.TaskSet))).subscribe(
|
|
114
|
+
(result) => {
|
|
115
|
+
names.clear();
|
|
116
|
+
for (const name of result.results.filter(isMirrored).map(repoName)) {
|
|
117
|
+
if (name) {
|
|
118
|
+
names.add(name);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{ fire: true },
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
let released = false;
|
|
127
|
+
return () => {
|
|
128
|
+
if (released) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
released = true;
|
|
132
|
+
if (--holds === 0) {
|
|
133
|
+
stop?.();
|
|
134
|
+
stop = undefined;
|
|
135
|
+
names.clear();
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const isMirrored = (taskSet: TaskSet.TaskSet): boolean =>
|
|
143
|
+
Obj.getMeta(taskSet).keys.some(({ source }) => source === GITHUB_SOURCE);
|
|
144
|
+
|
|
145
|
+
const repoName = (taskSet: TaskSet.TaskSet): string | undefined =>
|
|
146
|
+
taskSet.name && REPO_NAME.test(taskSet.name) ? taskSet.name : undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import * as Capabilities from '@dxos/app-framework/Capabilities';
|
|
8
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
9
|
+
|
|
10
|
+
import { GitHubOperationHandlerSet } from '#operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contribute(Capabilities.OperationHandler, GitHubOperationHandlerSet);
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
@@ -0,0 +1,32 @@
|
|
|
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 CrxCapabilities from '@dxos/plugin-crx/CrxCapabilities';
|
|
9
|
+
import type * as PageAction from '@dxos/plugin-crx/PageAction';
|
|
10
|
+
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import { GitHubOperation } from '#types';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule(() =>
|
|
15
|
+
Effect.sync(() => {
|
|
16
|
+
// Typed array so the contribution is checked against CrxCapabilities.PageAction's value type.
|
|
17
|
+
const actions: PageAction.PageAction[] = [
|
|
18
|
+
{
|
|
19
|
+
id: `${meta.profile.key}/page-action/open-pull-request`,
|
|
20
|
+
label: 'Open PR in Composer',
|
|
21
|
+
icon: 'ph--git-pull-request--regular',
|
|
22
|
+
// `/pull/123` and anything below it (`/files`, `/commits`), which GitHub serves as the same
|
|
23
|
+
// pull request.
|
|
24
|
+
urlPatterns: ['https://github.com/*/*/pull/*'],
|
|
25
|
+
extractor: { name: 'snapshot' },
|
|
26
|
+
contexts: ['popup', 'picker'],
|
|
27
|
+
operation: GitHubOperation.ImportPullRequestFromSnapshot,
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
return Capability.contribute(CrxCapabilities.PageAction, actions);
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import * as Capabilities from '@dxos/app-framework/Capabilities';
|
|
8
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
9
|
+
import * as Surface from '@dxos/app-framework/Surface';
|
|
10
|
+
import * as AppSurface from '@dxos/app-toolkit/AppSurface';
|
|
11
|
+
import { Type } from '@dxos/echo';
|
|
12
|
+
import { isSpace } from '@dxos/react-client/echo';
|
|
13
|
+
import { Issue, PullRequest, Repo } from '@dxos/types';
|
|
14
|
+
import * as Position from '@dxos/util/Position';
|
|
15
|
+
|
|
16
|
+
import { IMPORT_PULL_REQUEST_DIALOG } from '#meta';
|
|
17
|
+
import { Walkthrough } from '#types';
|
|
18
|
+
|
|
19
|
+
import { GitHubCard, PullRequestCard } from '../cards/index.ts';
|
|
20
|
+
import {
|
|
21
|
+
ImportPullRequestDialog,
|
|
22
|
+
PullRequestArticle,
|
|
23
|
+
PullRequestCardMenu,
|
|
24
|
+
PullRequestsArticle,
|
|
25
|
+
WalkthroughArticle,
|
|
26
|
+
} from '../containers/index.ts';
|
|
27
|
+
|
|
28
|
+
export default Capability.makeModule(() =>
|
|
29
|
+
Effect.succeed(
|
|
30
|
+
Capability.contribute(Capabilities.ReactSurface, [
|
|
31
|
+
Surface.create({
|
|
32
|
+
id: 'repoCard',
|
|
33
|
+
position: Position.first,
|
|
34
|
+
filter: AppSurface.object(AppSurface.CardContent, Repo.Repo),
|
|
35
|
+
component: GitHubCard,
|
|
36
|
+
props: ({ role, data: { subject } }) => ({ role, subject }),
|
|
37
|
+
}),
|
|
38
|
+
Surface.create({
|
|
39
|
+
id: 'issueCard',
|
|
40
|
+
position: Position.first,
|
|
41
|
+
filter: AppSurface.object(AppSurface.CardContent, Issue.Issue),
|
|
42
|
+
component: GitHubCard,
|
|
43
|
+
props: ({ role, data: { subject } }) => ({ role, subject }),
|
|
44
|
+
}),
|
|
45
|
+
Surface.create({
|
|
46
|
+
id: 'pullRequestCard',
|
|
47
|
+
position: Position.first,
|
|
48
|
+
filter: AppSurface.object(AppSurface.CardContent, PullRequest.PullRequest),
|
|
49
|
+
component: PullRequestCard,
|
|
50
|
+
props: ({ role, data: { subject } }) => ({ role, subject }),
|
|
51
|
+
}),
|
|
52
|
+
Surface.create({
|
|
53
|
+
id: 'pullRequestCardMenu',
|
|
54
|
+
filter: AppSurface.object(AppSurface.CardMenu, PullRequest.PullRequest),
|
|
55
|
+
component: PullRequestCardMenu,
|
|
56
|
+
props: ({ data: { subject, menu } }) => ({ subject, menu }),
|
|
57
|
+
}),
|
|
58
|
+
// The pull request is the article's subject, and the walkthrough it may have is something the
|
|
59
|
+
// article renders — so a pull request with no narration yet still opens, and offers to write one.
|
|
60
|
+
Surface.create({
|
|
61
|
+
id: 'pullRequestArticle',
|
|
62
|
+
filter: AppSurface.object(AppSurface.Article, PullRequest.PullRequest),
|
|
63
|
+
component: PullRequestArticle,
|
|
64
|
+
props: ({ role, data }) => ({ role, ...data }),
|
|
65
|
+
}),
|
|
66
|
+
// The pull request type's node (the space's Database section) opens as the triage list rather
|
|
67
|
+
// than the generic type collection, which knows nothing of checks, tasks or relevance.
|
|
68
|
+
Surface.create({
|
|
69
|
+
id: 'pullRequestsArticle',
|
|
70
|
+
position: Position.first,
|
|
71
|
+
filter: AppSurface.subject(AppSurface.Article, isPullRequestType),
|
|
72
|
+
component: PullRequestsArticle,
|
|
73
|
+
props: ({ role, data: { attendableId, properties } }) => ({
|
|
74
|
+
role,
|
|
75
|
+
attendableId,
|
|
76
|
+
db: isSpace(properties?.space) ? properties.space.db : undefined,
|
|
77
|
+
}),
|
|
78
|
+
}),
|
|
79
|
+
// A walkthrough opened by id (an older link, a search result) resolves to the same review.
|
|
80
|
+
Surface.create({
|
|
81
|
+
id: 'walkthroughArticle',
|
|
82
|
+
filter: AppSurface.object(AppSurface.Article, Walkthrough.Walkthrough),
|
|
83
|
+
component: WalkthroughArticle,
|
|
84
|
+
props: ({ role, data }) => ({ role, ...data }),
|
|
85
|
+
}),
|
|
86
|
+
Surface.create({
|
|
87
|
+
id: IMPORT_PULL_REQUEST_DIALOG,
|
|
88
|
+
filter: AppSurface.component(AppSurface.Dialog, IMPORT_PULL_REQUEST_DIALOG),
|
|
89
|
+
component: ImportPullRequestDialog,
|
|
90
|
+
}),
|
|
91
|
+
]),
|
|
92
|
+
),
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const PULL_REQUEST_TYPENAME = Type.getTypename(PullRequest.PullRequest);
|
|
96
|
+
|
|
97
|
+
const isPullRequestType = (subject: unknown): subject is Type.AnyEntity =>
|
|
98
|
+
Type.isType(subject) && Type.getTypename(subject) === PULL_REQUEST_TYPENAME;
|