@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,170 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { expect, waitFor, within } from 'storybook/test';
|
|
9
|
+
|
|
10
|
+
import * as Capabilities from '@dxos/app-framework/Capabilities';
|
|
11
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
12
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
13
|
+
import * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';
|
|
14
|
+
import * as Operation from '@dxos/compute/Operation';
|
|
15
|
+
import * as OperationHandlerSet from '@dxos/compute/OperationHandlerSet';
|
|
16
|
+
import { Ref } from '@dxos/echo';
|
|
17
|
+
import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
|
|
18
|
+
import * as CorePlugins from '@dxos/plugin-testing/CorePlugins';
|
|
19
|
+
import { type Space, useSpaces } from '@dxos/react-client/echo';
|
|
20
|
+
import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
21
|
+
import { PullRequest, Task } from '@dxos/types';
|
|
22
|
+
|
|
23
|
+
import { translations } from '#translations';
|
|
24
|
+
import { GitHubOperation } from '#types';
|
|
25
|
+
|
|
26
|
+
import { PullRequestsArticle } from '../containers/PullRequestsArticle/PullRequestsArticle.tsx';
|
|
27
|
+
|
|
28
|
+
const DAY = 24 * 60 * 60_000;
|
|
29
|
+
const daysAgo = (days: number) => new Date(Date.now() - days * DAY).toISOString();
|
|
30
|
+
|
|
31
|
+
/** Number → the live standing the fixture answers with; absent numbers report no CI. */
|
|
32
|
+
const STATUS: Record<number, { ci: GitHubOperation.CiState; review: GitHubOperation.ReviewState }> = {
|
|
33
|
+
13410: { ci: 'failure', review: 'none' },
|
|
34
|
+
13402: { ci: 'success', review: 'approved' },
|
|
35
|
+
13398: { ci: 'pending', review: 'none' },
|
|
36
|
+
412: { ci: 'success', review: 'changes_requested' },
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** Answers each row's status read from fixtures, so the story needs no connection or network. */
|
|
40
|
+
const handlers = OperationHandlerSet.make(
|
|
41
|
+
Operation.withHandler(GitHubOperation.GetPullRequestStatus, ({ pullRequest }) =>
|
|
42
|
+
Effect.gen(function* () {
|
|
43
|
+
const target = yield* Effect.promise(() => pullRequest.load());
|
|
44
|
+
const { ci, review } = STATUS[target.number] ?? { ci: 'none' as const, review: 'none' as const };
|
|
45
|
+
const total = ci === 'none' ? 0 : 12;
|
|
46
|
+
return {
|
|
47
|
+
state: target.state,
|
|
48
|
+
title: target.title,
|
|
49
|
+
ci,
|
|
50
|
+
checks: {
|
|
51
|
+
total,
|
|
52
|
+
passed: ci === 'success' ? total : ci === 'failure' ? total - 2 : total - 3,
|
|
53
|
+
failed: ci === 'failure' ? 2 : 0,
|
|
54
|
+
pending: ci === 'pending' ? 3 : 0,
|
|
55
|
+
},
|
|
56
|
+
runs: [],
|
|
57
|
+
review,
|
|
58
|
+
approvals: review === 'approved' ? 2 : 0,
|
|
59
|
+
};
|
|
60
|
+
}),
|
|
61
|
+
),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const seed = (space: Space) => {
|
|
65
|
+
const make = (props: Partial<Parameters<typeof PullRequest.make>[0]> & { number: number; title: string }) =>
|
|
66
|
+
space.db.add(PullRequest.make({ owner: 'dxos', repo: 'dxos', state: 'open', ...props }));
|
|
67
|
+
|
|
68
|
+
const failing = make({
|
|
69
|
+
number: 13410,
|
|
70
|
+
title: 'echo: memoize the index rebuild across reconnects',
|
|
71
|
+
author: 'wittjosiah',
|
|
72
|
+
updatedAt: daysAgo(0.1),
|
|
73
|
+
});
|
|
74
|
+
make({
|
|
75
|
+
number: 13402,
|
|
76
|
+
title: 'plugin-github: pull request triage list',
|
|
77
|
+
author: 'dmaretskyi',
|
|
78
|
+
updatedAt: daysAgo(1),
|
|
79
|
+
});
|
|
80
|
+
make({
|
|
81
|
+
number: 13398,
|
|
82
|
+
title: 'react-ui-menu: generic sort and group menus',
|
|
83
|
+
author: 'burdon',
|
|
84
|
+
updatedAt: daysAgo(2),
|
|
85
|
+
});
|
|
86
|
+
make({ number: 13377, title: 'docs: walkthrough fixtures', author: 'burdon', state: 'draft', updatedAt: daysAgo(6) });
|
|
87
|
+
make({
|
|
88
|
+
number: 13301,
|
|
89
|
+
title: 'tasks: milestone grouping',
|
|
90
|
+
author: 'richburdon',
|
|
91
|
+
state: 'merged',
|
|
92
|
+
updatedAt: daysAgo(9),
|
|
93
|
+
});
|
|
94
|
+
make({
|
|
95
|
+
number: 13250,
|
|
96
|
+
title: 'Revert flaky storybook watcher',
|
|
97
|
+
author: 'wittjosiah',
|
|
98
|
+
state: 'closed',
|
|
99
|
+
updatedAt: daysAgo(20),
|
|
100
|
+
});
|
|
101
|
+
make({
|
|
102
|
+
repo: 'edge',
|
|
103
|
+
number: 412,
|
|
104
|
+
title: 'router: forward trace context to db-service',
|
|
105
|
+
author: 'dmaretskyi',
|
|
106
|
+
updatedAt: daysAgo(3),
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
space.db.add(Task.make({ title: 'Fix index rebuild', status: 'started', artifacts: [Ref.make(failing)] }));
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const DefaultStory = () => {
|
|
113
|
+
const [space] = useSpaces();
|
|
114
|
+
if (!space) {
|
|
115
|
+
return <Loading data={{ space: false }} />;
|
|
116
|
+
}
|
|
117
|
+
return (
|
|
118
|
+
<div className='dx-expand'>
|
|
119
|
+
<PullRequestsArticle role='article' attendableId='story' db={space.db} />
|
|
120
|
+
</div>
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const meta = {
|
|
125
|
+
title: 'plugins/plugin-github/stories/PullRequestsArticle',
|
|
126
|
+
render: DefaultStory,
|
|
127
|
+
decorators: [
|
|
128
|
+
withTheme(),
|
|
129
|
+
withLayout({ layout: 'fullscreen' }),
|
|
130
|
+
withPluginManager({
|
|
131
|
+
capabilities: [
|
|
132
|
+
Capability.contribute(AppCapabilities.Translations, translations),
|
|
133
|
+
Capability.contribute(Capabilities.OperationHandler, handlers),
|
|
134
|
+
],
|
|
135
|
+
plugins: [
|
|
136
|
+
...CorePlugins.make(),
|
|
137
|
+
ClientPlugin.make({
|
|
138
|
+
types: [PullRequest.PullRequest, Task.Task],
|
|
139
|
+
onClientInitialized: ({ client }) =>
|
|
140
|
+
Effect.gen(function* () {
|
|
141
|
+
const { defaultSpace } = yield* initializeIdentity(client);
|
|
142
|
+
yield* Effect.promise(async () => {
|
|
143
|
+
seed(defaultSpace);
|
|
144
|
+
await defaultSpace.db.flush({ indexes: true });
|
|
145
|
+
});
|
|
146
|
+
}),
|
|
147
|
+
}),
|
|
148
|
+
],
|
|
149
|
+
}),
|
|
150
|
+
],
|
|
151
|
+
parameters: { layout: 'fullscreen', translations },
|
|
152
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
153
|
+
|
|
154
|
+
export default meta;
|
|
155
|
+
|
|
156
|
+
type Story = StoryObj<typeof meta>;
|
|
157
|
+
|
|
158
|
+
/** Ordered by relevance: the open pull request with failing CI (and a task tracking it) leads. */
|
|
159
|
+
export const Default: Story = {
|
|
160
|
+
play: async ({ canvasElement }) => {
|
|
161
|
+
const canvas = within(canvasElement);
|
|
162
|
+
const rows = await canvas.findAllByTestId('pull-requests.row', {}, { timeout: 10_000 });
|
|
163
|
+
await expect(rows).toHaveLength(7);
|
|
164
|
+
await waitFor(
|
|
165
|
+
() => expect(within(rows[0]).getByTestId('pull-requests.row.checks').textContent).toContain('CI failing'),
|
|
166
|
+
{ timeout: 10_000 },
|
|
167
|
+
);
|
|
168
|
+
await expect(within(rows[0]).getByTestId('pull-requests.row.tasks').textContent).toContain('Fix index rebuild');
|
|
169
|
+
},
|
|
170
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { useCallback, useRef, useState } from 'react';
|
|
7
|
+
import { expect, waitFor } from 'storybook/test';
|
|
8
|
+
|
|
9
|
+
import * as Panel from '@dxos/react-ui/Panel';
|
|
10
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
11
|
+
import { type DiffLayout, type DiffLineTarget } from '@dxos/ui-editor';
|
|
12
|
+
|
|
13
|
+
import { translations } from '#translations';
|
|
14
|
+
|
|
15
|
+
import { LineCommentPopover } from '../components/CommentComposer/index.ts';
|
|
16
|
+
import { WalkthroughView } from '../components/WalkthroughView/index.ts';
|
|
17
|
+
import { WALKTHROUGH } from './walkthrough-fixture.ts';
|
|
18
|
+
|
|
19
|
+
type StoryArgs = {
|
|
20
|
+
text: string;
|
|
21
|
+
layout?: DiffLayout;
|
|
22
|
+
sidebar?: 'full' | 'stats' | 'none';
|
|
23
|
+
/** Offer the hover comment button on each diff line, and float the composer at the line picked. */
|
|
24
|
+
comments?: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A walkthrough is ONE markdown document: the ```diff fences are block widgets inside it, not a
|
|
29
|
+
* separate diff view the prose is wrapped around.
|
|
30
|
+
*/
|
|
31
|
+
const DefaultStory = ({ text, layout, sidebar = 'full', comments }: StoryArgs) => {
|
|
32
|
+
const [target, setTarget] = useState<DiffLineTarget>();
|
|
33
|
+
const [comment, setComment] = useState('');
|
|
34
|
+
const anchorRef = useRef<HTMLElement | null>(null);
|
|
35
|
+
|
|
36
|
+
const handleLineComment = useCallback((next: DiffLineTarget, anchor: HTMLElement) => {
|
|
37
|
+
anchorRef.current = anchor;
|
|
38
|
+
setTarget(next);
|
|
39
|
+
}, []);
|
|
40
|
+
|
|
41
|
+
const handleCancel = useCallback(() => {
|
|
42
|
+
setTarget(undefined);
|
|
43
|
+
anchorRef.current = null;
|
|
44
|
+
}, []);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<Panel.Root>
|
|
48
|
+
<Panel.Body>
|
|
49
|
+
<WalkthroughView
|
|
50
|
+
value={text}
|
|
51
|
+
layout={layout}
|
|
52
|
+
sidebar={sidebar}
|
|
53
|
+
onLineComment={comments ? handleLineComment : undefined}
|
|
54
|
+
/>
|
|
55
|
+
</Panel.Body>
|
|
56
|
+
<LineCommentPopover
|
|
57
|
+
open={!!target}
|
|
58
|
+
anchorRef={anchorRef}
|
|
59
|
+
target={target}
|
|
60
|
+
value={comment}
|
|
61
|
+
onValueChange={setComment}
|
|
62
|
+
onSubmit={handleCancel}
|
|
63
|
+
onCancel={handleCancel}
|
|
64
|
+
/>
|
|
65
|
+
</Panel.Root>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const meta = {
|
|
70
|
+
title: 'plugins/plugin-github/stories/Walkthrough',
|
|
71
|
+
render: DefaultStory,
|
|
72
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
|
|
73
|
+
parameters: { layout: 'fullscreen', controls: { disable: true }, translations },
|
|
74
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
75
|
+
|
|
76
|
+
export default meta;
|
|
77
|
+
|
|
78
|
+
type Story = StoryObj<typeof meta>;
|
|
79
|
+
|
|
80
|
+
/** The whole thing: prose, headings, side-by-side chunks and the navigation rail. */
|
|
81
|
+
export const Default: Story = {
|
|
82
|
+
args: { text: WALKTHROUGH },
|
|
83
|
+
play: async ({ canvasElement }) => {
|
|
84
|
+
// The rail overflows in a short pane; it must scroll with the app's scrollbar, not the browser's.
|
|
85
|
+
await waitFor(() => expect(canvasElement.querySelector('.cm-walkthrough-sidebar')).not.toBeNull(), {
|
|
86
|
+
timeout: 10_000,
|
|
87
|
+
});
|
|
88
|
+
await expect(canvasElement.querySelector('.cm-walkthrough-sidebar')).toHaveClass('dx-scrollbar-thin');
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/** The rail Graphite collapses to when the reader wants the width back. */
|
|
93
|
+
export const StatsRail: Story = {
|
|
94
|
+
args: { text: WALKTHROUGH, sidebar: 'stats' },
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/** Unified chunks, which is also what the side-by-side layout falls back to in a narrow pane. */
|
|
98
|
+
export const Inline: Story = {
|
|
99
|
+
args: { text: WALKTHROUGH, layout: 'inline', sidebar: 'none' },
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/** No rail, so the chunks are the only thing the document adds to plain markdown. */
|
|
103
|
+
export const Chunks: Story = {
|
|
104
|
+
args: { text: WALKTHROUGH, sidebar: 'none' },
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/** The comment composer floats at the diff line it addresses, not in a band above the document. */
|
|
108
|
+
export const LineComment: Story = {
|
|
109
|
+
args: { text: WALKTHROUGH, comments: true, sidebar: 'none' },
|
|
110
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, expect, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { parsePullRequestUrl } from './github.ts';
|
|
8
|
+
|
|
9
|
+
describe('parsePullRequestUrl', () => {
|
|
10
|
+
test('reads owner, repository and number', () => {
|
|
11
|
+
expect(parsePullRequestUrl('https://github.com/dxos/dxos/pull/13082')).to.deep.eq({
|
|
12
|
+
owner: 'dxos',
|
|
13
|
+
repo: 'dxos',
|
|
14
|
+
number: 13082,
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('tolerates www, a trailing path and surrounding space', () => {
|
|
19
|
+
expect(parsePullRequestUrl(' https://www.github.com/dxos/dxos/pull/13082/files ')).to.deep.eq({
|
|
20
|
+
owner: 'dxos',
|
|
21
|
+
repo: 'dxos',
|
|
22
|
+
number: 13082,
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('keeps a query string out of the number', () => {
|
|
27
|
+
expect(parsePullRequestUrl('https://github.com/dxos/dxos/pull/13082?w=1#issuecomment-1')).to.deep.eq({
|
|
28
|
+
owner: 'dxos',
|
|
29
|
+
repo: 'dxos',
|
|
30
|
+
number: 13082,
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('rejects a query string standing in for the repository', () => {
|
|
35
|
+
expect(parsePullRequestUrl('https://github.com/dxos/dxos?x=/pull/9')).to.eq(undefined);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('rejects a number the path continues through', () => {
|
|
39
|
+
expect(parsePullRequestUrl('https://github.com/dxos/dxos/pull/13082x')).to.eq(undefined);
|
|
40
|
+
expect(parsePullRequestUrl('https://github.com/dxos/dxos/pull/13082-old')).to.eq(undefined);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('reads a URL copied out of prose, with its punctuation attached', () => {
|
|
44
|
+
for (const trailing of ['.', ',', ')', ']', '>']) {
|
|
45
|
+
expect(parsePullRequestUrl(`https://github.com/dxos/dxos/pull/13082${trailing}`)).to.deep.eq({
|
|
46
|
+
owner: 'dxos',
|
|
47
|
+
repo: 'dxos',
|
|
48
|
+
number: 13082,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('ignores the case of the host', () => {
|
|
54
|
+
expect(parsePullRequestUrl('https://GitHub.com/dxos/dxos/pull/13082')).to.deep.eq({
|
|
55
|
+
owner: 'dxos',
|
|
56
|
+
repo: 'dxos',
|
|
57
|
+
number: 13082,
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('rejects anything that is not a pull request URL', () => {
|
|
62
|
+
expect(parsePullRequestUrl('https://github.com/dxos/dxos/issues/13082')).to.eq(undefined);
|
|
63
|
+
expect(parsePullRequestUrl('not a url')).to.eq(undefined);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
/** Owner, repository and number, as a pull request URL names them. */
|
|
6
|
+
export type PullRequestRef = {
|
|
7
|
+
owner: string;
|
|
8
|
+
repo: string;
|
|
9
|
+
number: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// `[^/?#]`, and a word boundary after the number: an unanchored tail would read a query string as
|
|
13
|
+
// part of the repository name and `…/pull/12x` as pull request 12, while a fixed delimiter set
|
|
14
|
+
// would reject the trailing period or bracket a URL copied out of prose carries.
|
|
15
|
+
const PULL_URL = /^https?:\/\/(?:www\.)?github\.com\/([^/?#]+)\/([^/?#]+)\/pull\/(\d+)(?![\w-])/i;
|
|
16
|
+
|
|
17
|
+
/** Reads `https://github.com/owner/repo/pull/123`, with or without a trailing path. */
|
|
18
|
+
export const parsePullRequestUrl = (url: string): PullRequestRef | undefined => {
|
|
19
|
+
const match = PULL_URL.exec(url.trim());
|
|
20
|
+
if (!match) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return { owner: match[1], repo: match[2], number: Number(match[3]) };
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type RemotePullRequest = {
|
|
28
|
+
title: string;
|
|
29
|
+
body?: string;
|
|
30
|
+
baseBranch?: string;
|
|
31
|
+
headBranch?: string;
|
|
32
|
+
commit?: string;
|
|
33
|
+
diff: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const API = 'https://api.github.com';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Fetches a public pull request and its diff straight from the browser. `api.github.com` answers
|
|
40
|
+
* cross-origin and does not require a token for a public repository, so a story needs no credentials
|
|
41
|
+
* — at the cost of the unauthenticated rate limit, which is per IP and easy to hit.
|
|
42
|
+
*/
|
|
43
|
+
export const fetchPullRequest = async ({ owner, repo, number }: PullRequestRef): Promise<RemotePullRequest> => {
|
|
44
|
+
const url = `${API}/repos/${owner}/${repo}/pulls/${number}`;
|
|
45
|
+
const [meta, diff] = await Promise.all([
|
|
46
|
+
fetch(url, { headers: { Accept: 'application/vnd.github+json' } }),
|
|
47
|
+
fetch(url, { headers: { Accept: 'application/vnd.github.v3.diff' } }),
|
|
48
|
+
]);
|
|
49
|
+
if (!meta.ok) {
|
|
50
|
+
throw new Error(`GitHub answered ${meta.status} for ${owner}/${repo}#${number}.`);
|
|
51
|
+
}
|
|
52
|
+
if (!diff.ok) {
|
|
53
|
+
// 406 is how GitHub reports a pull request too large to serve as one diff.
|
|
54
|
+
throw new Error(
|
|
55
|
+
diff.status === 406
|
|
56
|
+
? `${owner}/${repo}#${number} is too large for GitHub to serve as a single diff.`
|
|
57
|
+
: `GitHub answered ${diff.status} for the diff of ${owner}/${repo}#${number}.`,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const json = await meta.json();
|
|
62
|
+
return {
|
|
63
|
+
title: json.title,
|
|
64
|
+
body: json.body ?? undefined,
|
|
65
|
+
baseBranch: json.base?.ref,
|
|
66
|
+
headBranch: json.head?.ref,
|
|
67
|
+
commit: json.head?.sha,
|
|
68
|
+
diff: await diff.text(),
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A pull-request walkthrough: one markdown document whose prose, headings and ```diff fences read as
|
|
7
|
+
* a single narrative. Written out rather than generated so the story exercises the cases that matter
|
|
8
|
+
* visually — a pure insertion, a replacement, a removal, several hunks in one file, and a fence with
|
|
9
|
+
* no metadata at all.
|
|
10
|
+
*/
|
|
11
|
+
export const WALKTHROUGH = `# MCP latency probe
|
|
12
|
+
|
|
13
|
+
Adds a latency probe to the assistant eval harness. One shared MCP connection serves a whole probe
|
|
14
|
+
set: connect, list tools, warm up, then run timed iterations whose statistics the scorer reads
|
|
15
|
+
instead of a thrown eval.
|
|
16
|
+
|
|
17
|
+
## Harness wiring
|
|
18
|
+
|
|
19
|
+
### Harness API surface
|
|
20
|
+
|
|
21
|
+
\`ClaudeHarnessOptions.target\` plus harness fields for \`target\`, \`url\`, and a \`latency\` callback that
|
|
22
|
+
dials the same surface the agent uses, on a separate connection.
|
|
23
|
+
|
|
24
|
+
\`\`\`diff file=packages/core/compute/assistant-evals/src/claude-harness.ts lines=66-99 lang=typescript
|
|
25
|
+
@@ -64,7 +66,16 @@ export type ClaudeHarnessOptions = {
|
|
26
|
+
allowedTools?: string[];
|
|
27
|
+
model?: string;
|
|
28
|
+
turnTimeout?: number;
|
|
29
|
+
+ /**
|
|
30
|
+
+ * Which MCP surface to drive: the in-process host, or one of the deployed
|
|
31
|
+
+ * \`mcp-space-service\` workers. Defaults to \`DX_EVAL_MCP_TARGET\`, and to
|
|
32
|
+
+ * \`local\` without it.
|
|
33
|
+
+ */
|
|
34
|
+
+ target?: McpTarget;
|
|
35
|
+
+
|
|
36
|
+
+ /** Called once per probe set with the measured connect and call latencies. */
|
|
37
|
+
+ latency?: (report: LatencyReport) => void;
|
|
38
|
+
};
|
|
39
|
+
\`\`\`
|
|
40
|
+
|
|
41
|
+
### Dial remote or host
|
|
42
|
+
|
|
43
|
+
The dial is the only place that knows which surface is in play, so the rest of the harness keeps
|
|
44
|
+
taking a client rather than a target.
|
|
45
|
+
|
|
46
|
+
\`\`\`diff file=packages/core/compute/assistant-evals/src/claude-harness.ts lines=118-140 lang=typescript
|
|
47
|
+
@@ -118,12 +120,16 @@ const connect = async (options: ClaudeHarnessOptions) => {
|
|
48
|
+
- const client = await createLocalClient(options);
|
|
49
|
+
- await client.connect();
|
|
50
|
+
- return client;
|
|
51
|
+
+ const target = options.target ?? (process.env.DX_EVAL_MCP_TARGET as McpTarget) ?? 'local';
|
|
52
|
+
+ const client = target === 'local' ? await createLocalClient(options) : await createRemoteClient(target);
|
|
53
|
+
+ await client.connect();
|
|
54
|
+
+ return client;
|
|
55
|
+
};
|
|
56
|
+
\`\`\`
|
|
57
|
+
|
|
58
|
+
## Probe runner
|
|
59
|
+
|
|
60
|
+
One shared connection for the whole probe set: warmup, then timed iterations. Connect and listTools
|
|
61
|
+
failures and per-call throws become errored samples; a cleanup failure must not discard a completed
|
|
62
|
+
report.
|
|
63
|
+
|
|
64
|
+
\`\`\`diff file=packages/core/compute/assistant-evals/src/McpLatency.ts lines=160-181 lang=typescript
|
|
65
|
+
@@ -158,6 +160,24 @@ export const probe = async ({ target, probes, iterations }: ProbeOptions) => {
|
|
66
|
+
+ // The client may never have connected, and closing one that did not is not
|
|
67
|
+
+ // an error worth losing the report over.
|
|
68
|
+
+ connectMillis ??= Date.now() - connectStarted;
|
|
69
|
+
+ for (const probe of probes) {
|
|
70
|
+
+ samples.push({ tool: probe.tool, label: labelOf(probe), millis: Date.now() - connectStarted, isError: true });
|
|
71
|
+
+ }
|
|
72
|
+
+ } finally {
|
|
73
|
+
+ await client.close().catch(() => {});
|
|
74
|
+
+ }
|
|
75
|
+
+
|
|
76
|
+
+ return { target, url, connectMillis: connectMillis ?? 0, samples, stats: summarize(samples) };
|
|
77
|
+
};
|
|
78
|
+
\`\`\`
|
|
79
|
+
|
|
80
|
+
## Eval scenario
|
|
81
|
+
|
|
82
|
+
### Scorers
|
|
83
|
+
|
|
84
|
+
A failing probe is now a low score with a reason, not a thrown error, so one unreachable worker no
|
|
85
|
+
longer voids the run.
|
|
86
|
+
|
|
87
|
+
\`\`\`diff file=packages/core/compute/assistant-evals/src/mcp-server.eval.ts lines=40-58 lang=typescript
|
|
88
|
+
@@ -40,9 +40,13 @@ const scorers = [
|
|
89
|
+
{
|
|
90
|
+
name: 'latency',
|
|
91
|
+
- score: ({ output }) => {
|
|
92
|
+
- throw new Error('not implemented');
|
|
93
|
+
- },
|
|
94
|
+
+ score: ({ output }) => ({
|
|
95
|
+
+ score: output.stats.p95 < BUDGET_MILLIS ? 1 : 0,
|
|
96
|
+
+ metadata: { p95: output.stats.p95, budget: BUDGET_MILLIS },
|
|
97
|
+
+ }),
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
\`\`\`
|
|
101
|
+
|
|
102
|
+
## Documentation
|
|
103
|
+
|
|
104
|
+
The README gains the environment variable and what the probe reports. A fence needs no metadata when
|
|
105
|
+
the prose above it has already said which file is in play.
|
|
106
|
+
|
|
107
|
+
\`\`\`diff
|
|
108
|
+
@@ -12,3 +12,7 @@
|
|
109
|
+
Run the suite with \`moon run assistant-evals:test\`.
|
|
110
|
+
+
|
|
111
|
+
+Set \`DX_EVAL_MCP_TARGET\` to \`local\`, \`staging\` or \`production\` to choose the
|
|
112
|
+
+MCP surface the latency probe dials. The probe reports connect time, per-tool
|
|
113
|
+
+p50 and p95, and the error rate across the probe set.
|
|
114
|
+
\`\`\`
|
|
115
|
+
`;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { random } from '@dxos/random';
|
|
8
|
+
import { Issue, PullRequest, Repo } from '@dxos/types';
|
|
9
|
+
|
|
10
|
+
import { type GitHubCapabilities } from '#types';
|
|
11
|
+
|
|
12
|
+
import { type GitHubLink } from '../extensions/index.ts';
|
|
13
|
+
|
|
14
|
+
// Kept out of the story modules: react-refresh only fast-refreshes a module whose exports are all
|
|
15
|
+
// components, so factories exported beside a story force a full page reload on every edit.
|
|
16
|
+
|
|
17
|
+
/** Deterministic per link, so a re-hover shows the same fixture. */
|
|
18
|
+
const seedFor = (link: GitHubLink) =>
|
|
19
|
+
random.seed(link.url.split('').reduce((acc: number, char: string) => acc + char.charCodeAt(0), 1));
|
|
20
|
+
|
|
21
|
+
/** A repository fixture for a link, deterministic per URL. */
|
|
22
|
+
export const createRepo = (
|
|
23
|
+
link: GitHubLink = { owner: 'dxos', repo: 'dxos', kind: 'repo', url: 'https://github.com/dxos/dxos' },
|
|
24
|
+
): Repo.Repo => {
|
|
25
|
+
seedFor(link);
|
|
26
|
+
return Repo.make({
|
|
27
|
+
owner: link.owner,
|
|
28
|
+
name: link.repo,
|
|
29
|
+
url: link.url,
|
|
30
|
+
description: random.lorem.paragraph(),
|
|
31
|
+
defaultBranch: 'main',
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** An issue fixture for a link, deterministic per URL. */
|
|
36
|
+
export const createIssue = (
|
|
37
|
+
link: GitHubLink = {
|
|
38
|
+
owner: 'dxos',
|
|
39
|
+
repo: 'dxos',
|
|
40
|
+
kind: 'issue',
|
|
41
|
+
number: 1,
|
|
42
|
+
url: 'https://github.com/dxos/dxos/issues/1',
|
|
43
|
+
},
|
|
44
|
+
): Issue.Issue => {
|
|
45
|
+
seedFor(link);
|
|
46
|
+
return Issue.make({
|
|
47
|
+
owner: link.owner,
|
|
48
|
+
repo: link.repo,
|
|
49
|
+
number: link.number ?? 0,
|
|
50
|
+
url: link.url,
|
|
51
|
+
title: random.lorem.sentence(),
|
|
52
|
+
state: random.helpers.arrayElement(['open', 'closed'] as const),
|
|
53
|
+
author: random.person.fullName(),
|
|
54
|
+
description: random.lorem.paragraph(),
|
|
55
|
+
labels: ['bug', 'editor'],
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** A pull-request fixture for a link, deterministic per URL. */
|
|
60
|
+
export const createPullRequest = (
|
|
61
|
+
link: GitHubLink = {
|
|
62
|
+
owner: 'dxos',
|
|
63
|
+
repo: 'dxos',
|
|
64
|
+
kind: 'pull',
|
|
65
|
+
number: 13007,
|
|
66
|
+
url: 'https://github.com/dxos/dxos/pull/13007',
|
|
67
|
+
},
|
|
68
|
+
): PullRequest.PullRequest => {
|
|
69
|
+
seedFor(link);
|
|
70
|
+
return PullRequest.make({
|
|
71
|
+
owner: link.owner,
|
|
72
|
+
repo: link.repo,
|
|
73
|
+
number: link.number ?? 0,
|
|
74
|
+
url: link.url,
|
|
75
|
+
title: random.lorem.sentence(),
|
|
76
|
+
state: random.helpers.arrayElement(['open', 'merged', 'draft', 'closed'] as const),
|
|
77
|
+
author: random.person.fullName(),
|
|
78
|
+
description: random.lorem.paragraph(),
|
|
79
|
+
baseBranch: 'main',
|
|
80
|
+
headBranch: `${random.lorem.word()}/${random.lorem.word()}`,
|
|
81
|
+
additions: random.number.int({ min: 5, max: 900 }),
|
|
82
|
+
deletions: random.number.int({ min: 0, max: 400 }),
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** A repository the fixture source cannot reach, standing in for a private one the space holds no token for. */
|
|
87
|
+
export const UNREACHABLE_REPO = 'private';
|
|
88
|
+
|
|
89
|
+
/** A `LinkSource` answering from fixtures, so a story exercises the resolver without the network. */
|
|
90
|
+
export const fixtureLinkSource: GitHubCapabilities.GitHubLinkSource = (link) =>
|
|
91
|
+
Effect.succeed(
|
|
92
|
+
link.repo === UNREACHABLE_REPO
|
|
93
|
+
? undefined
|
|
94
|
+
: link.kind === 'repo'
|
|
95
|
+
? createRepo(link)
|
|
96
|
+
: link.kind === 'pull'
|
|
97
|
+
? createPullRequest(link)
|
|
98
|
+
: createIssue(link),
|
|
99
|
+
);
|
|
@@ -0,0 +1,25 @@
|
|
|
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 Plugin from '@dxos/app-framework/Plugin';
|
|
9
|
+
import { DXN } from '@dxos/keys';
|
|
10
|
+
|
|
11
|
+
import { GitHubCapabilities } from '#types';
|
|
12
|
+
|
|
13
|
+
import { fixtureLinkSource } from './fixtures.ts';
|
|
14
|
+
|
|
15
|
+
/** Replaces the plugin's default fetch: a story answers every link from fixtures, deterministic per URL. */
|
|
16
|
+
export const FixtureLinkSourcePlugin = Plugin.define(
|
|
17
|
+
Plugin.makeMeta({ key: DXN.make('org.dxos.plugin.github.testing.linkSource'), name: 'Fixture link source' }),
|
|
18
|
+
).pipe(
|
|
19
|
+
Plugin.addModule({
|
|
20
|
+
id: 'linkSource',
|
|
21
|
+
provides: [GitHubCapabilities.LinkSource],
|
|
22
|
+
activate: () => Effect.succeed([Capability.contribute(GitHubCapabilities.LinkSource, fixtureLinkSource)]),
|
|
23
|
+
}),
|
|
24
|
+
Plugin.make,
|
|
25
|
+
);
|