@deepseek-ai/dsh-experimental-client-ui-forge 0.2.3-alpha.2 → 0.2.3-alpha.4
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/README.i18n.yaml +10 -10
- package/README.md +37 -19
- package/README.zh.md +37 -19
- package/lib/client.js +22 -17
- package/lib/client.js.map +1 -1
- package/lib/index.js +941 -188
- package/lib/typert.host.js +894 -175
- package/lib/typert.remote-client.d.ts +35 -17
- package/lib/typert.remote-client.d.ts.map +1 -1
- package/lib/typert.remote-client.js +751 -146
- package/lib/types/client/ActionToast.d.ts +1 -1
- package/lib/types/client/ActionToast.d.ts.map +1 -1
- package/lib/types/client/ActionToast.js.map +1 -1
- package/lib/types/client/BaseMenu.d.ts +6 -4
- package/lib/types/client/BaseMenu.d.ts.map +1 -1
- package/lib/types/client/BaseMenu.js.map +1 -1
- package/lib/types/client/BranchPicker.d.ts +84 -0
- package/lib/types/client/BranchPicker.d.ts.map +1 -0
- package/lib/types/client/BranchPicker.js.map +1 -0
- package/lib/types/client/ChangeRequestCard.d.ts +31 -13
- package/lib/types/client/ChangeRequestCard.d.ts.map +1 -1
- package/lib/types/client/ChangeRequestCard.js.map +1 -1
- package/lib/types/client/ChangeRequestOverview.d.ts +28 -6
- package/lib/types/client/ChangeRequestOverview.d.ts.map +1 -1
- package/lib/types/client/ChangeRequestOverview.js.map +1 -1
- package/lib/types/client/ChangeRequestsSection.d.ts +5 -3
- package/lib/types/client/ChangeRequestsSection.d.ts.map +1 -1
- package/lib/types/client/ChangeRequestsSection.js.map +1 -1
- package/lib/types/client/ChangeStatus.d.ts +41 -0
- package/lib/types/client/ChangeStatus.d.ts.map +1 -0
- package/lib/types/client/ChangeStatus.js.map +1 -0
- package/lib/types/client/ChangedFiles.d.ts +1 -1
- package/lib/types/client/ChangedFiles.d.ts.map +1 -1
- package/lib/types/client/ChangedFiles.js.map +1 -1
- package/lib/types/client/ChangesLoading.d.ts +1 -1
- package/lib/types/client/ChangesLoading.d.ts.map +1 -1
- package/lib/types/client/ChangesTab.d.ts +35 -12
- package/lib/types/client/ChangesTab.d.ts.map +1 -1
- package/lib/types/client/ChangesTab.js.map +1 -1
- package/lib/types/client/ChangesTabTitle.d.ts +1 -1
- package/lib/types/client/ChangesTabTitle.d.ts.map +1 -1
- package/lib/types/client/ChangesTabTitle.js.map +1 -1
- package/lib/types/client/CommitMenu.d.ts +11 -8
- package/lib/types/client/CommitMenu.d.ts.map +1 -1
- package/lib/types/client/CommitMenu.js.map +1 -1
- package/lib/types/client/CopyCommandButton.d.ts +19 -0
- package/lib/types/client/CopyCommandButton.d.ts.map +1 -0
- package/lib/types/client/CopyCommandButton.js.map +1 -0
- package/lib/types/client/DiffFile.d.ts +36 -5
- package/lib/types/client/DiffFile.d.ts.map +1 -1
- package/lib/types/client/DiffFile.js.map +1 -1
- package/lib/types/client/EnvironmentRows.d.ts +6 -6
- package/lib/types/client/EnvironmentRows.d.ts.map +1 -1
- package/lib/types/client/EnvironmentRows.js.map +1 -1
- package/lib/types/client/FileLabel.d.ts +5 -5
- package/lib/types/client/FileLabel.d.ts.map +1 -1
- package/lib/types/client/FileLabel.js.map +1 -1
- package/lib/types/client/HeadMenu.d.ts +35 -0
- package/lib/types/client/HeadMenu.d.ts.map +1 -0
- package/lib/types/client/HeadMenu.js.map +1 -0
- package/lib/types/client/HostSettings.d.ts +33 -0
- package/lib/types/client/HostSettings.d.ts.map +1 -0
- package/lib/types/client/HostSettings.js.map +1 -0
- package/lib/types/client/LensFilter.d.ts +2 -2
- package/lib/types/client/LensFilter.d.ts.map +1 -1
- package/lib/types/client/LensFilter.js.map +1 -1
- package/lib/types/client/ReasonButton.js.map +1 -1
- package/lib/types/client/RefreshGlyph.js.map +1 -1
- package/lib/types/client/ReviewComposer.d.ts +1 -1
- package/lib/types/client/ReviewComposer.d.ts.map +1 -1
- package/lib/types/client/ReviewComposer.js.map +1 -1
- package/lib/types/client/ReviewControls.d.ts +1 -1
- package/lib/types/client/ReviewControls.d.ts.map +1 -1
- package/lib/types/client/ReviewControls.js.map +1 -1
- package/lib/types/client/ReviewThread.d.ts +1 -1
- package/lib/types/client/ReviewThread.d.ts.map +1 -1
- package/lib/types/client/ReviewThread.js.map +1 -1
- package/lib/types/client/ReviewThreads.d.ts +21 -4
- package/lib/types/client/ReviewThreads.d.ts.map +1 -1
- package/lib/types/client/ReviewThreads.js.map +1 -1
- package/lib/types/client/SessionHoverForge.d.ts +1 -1
- package/lib/types/client/SessionHoverForge.d.ts.map +1 -1
- package/lib/types/client/SessionHoverForge.js.map +1 -1
- package/lib/types/client/SessionRowForge.d.ts +1 -1
- package/lib/types/client/SessionRowForge.d.ts.map +1 -1
- package/lib/types/client/SessionRowForge.js.map +1 -1
- package/lib/types/client/SubmitReview.d.ts +1 -1
- package/lib/types/client/SubmitReview.d.ts.map +1 -1
- package/lib/types/client/SubmitReview.js.map +1 -1
- package/lib/types/client/ThreadList.d.ts +3 -1
- package/lib/types/client/ThreadList.d.ts.map +1 -1
- package/lib/types/client/ThreadList.js.map +1 -1
- package/lib/types/client/ViewOptionsMenu.d.ts +1 -1
- package/lib/types/client/ViewOptionsMenu.d.ts.map +1 -1
- package/lib/types/client/ViewOptionsMenu.js.map +1 -1
- package/lib/types/client/WorktreeNameDialog.d.ts +1 -1
- package/lib/types/client/WorktreeNameDialog.d.ts.map +1 -1
- package/lib/types/client/WorktreeNameDialog.js.map +1 -1
- package/lib/types/client/WorktreeProgress.d.ts +1 -1
- package/lib/types/client/WorktreeProgress.d.ts.map +1 -1
- package/lib/types/client/WorktreeProgress.js.map +1 -1
- package/lib/types/client/WorktreeSettings.d.ts +1 -1
- package/lib/types/client/WorktreeSettings.d.ts.map +1 -1
- package/lib/types/client/WorktreeSettings.js.map +1 -1
- package/lib/types/client/WorktreeToggle.d.ts +1 -1
- package/lib/types/client/WorktreeToggle.d.ts.map +1 -1
- package/lib/types/client/WorktreeToggle.js.map +1 -1
- package/lib/types/client/annotations.d.ts +1 -1
- package/lib/types/client/annotations.d.ts.map +1 -1
- package/lib/types/client/branch-search.d.ts +1 -1
- package/lib/types/client/branch-search.d.ts.map +1 -1
- package/lib/types/client/branch-search.js.map +1 -1
- package/lib/types/client/changes-address.d.ts +1 -1
- package/lib/types/client/changes-address.d.ts.map +1 -1
- package/lib/types/client/changes-service.d.ts +1 -1
- package/lib/types/client/changes-service.d.ts.map +1 -1
- package/lib/types/client/changes-store.d.ts +25 -6
- package/lib/types/client/changes-store.d.ts.map +1 -1
- package/lib/types/client/changes-store.js.map +1 -1
- package/lib/types/client/checkout.d.ts +1 -1
- package/lib/types/client/checkout.d.ts.map +1 -1
- package/lib/types/client/code-selection.d.ts.map +1 -1
- package/lib/types/client/code-selection.js.map +1 -1
- package/lib/types/client/forge-copy.d.ts +8 -1
- package/lib/types/client/forge-copy.d.ts.map +1 -1
- package/lib/types/client/forge-copy.js.map +1 -1
- package/lib/types/client/format.d.ts +1 -1
- package/lib/types/client/format.d.ts.map +1 -1
- package/lib/types/client/format.js.map +1 -1
- package/lib/types/client/glyphs.d.ts +36 -1
- package/lib/types/client/glyphs.d.ts.map +1 -1
- package/lib/types/client/glyphs.js.map +1 -1
- package/lib/types/client/highlight-context.d.ts +1 -1
- package/lib/types/client/highlight-context.d.ts.map +1 -1
- package/lib/types/client/host-settings-form.d.ts +69 -0
- package/lib/types/client/host-settings-form.d.ts.map +1 -0
- package/lib/types/client/host-settings-form.js.map +1 -0
- package/lib/types/client/host-sign-in.d.ts +31 -0
- package/lib/types/client/host-sign-in.d.ts.map +1 -0
- package/lib/types/client/host-sign-in.js.map +1 -0
- package/lib/types/client/index.d.ts +1 -2
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/index.js.map +1 -1
- package/lib/types/client/local-writes.d.ts +47 -0
- package/lib/types/client/local-writes.d.ts.map +1 -0
- package/lib/types/client/local-writes.js.map +1 -0
- package/lib/types/client/locales.d.ts +111 -13
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/locales.js.map +1 -1
- package/lib/types/client/minute-clock.d.ts +7 -0
- package/lib/types/client/minute-clock.d.ts.map +1 -0
- package/lib/types/client/minute-clock.js.map +1 -0
- package/lib/types/client/mount.d.ts +15 -1
- package/lib/types/client/mount.d.ts.map +1 -1
- package/lib/types/client/mount.js.map +1 -1
- package/lib/types/client/review-page/ReviewActivity.d.ts +44 -0
- package/lib/types/client/review-page/ReviewActivity.d.ts.map +1 -0
- package/lib/types/client/review-page/ReviewActivity.js.map +1 -0
- package/lib/types/client/review-page/ReviewChat.d.ts +1 -1
- package/lib/types/client/review-page/ReviewChat.d.ts.map +1 -1
- package/lib/types/client/review-page/ReviewChat.js.map +1 -1
- package/lib/types/client/review-page/ReviewDetail.d.ts +26 -9
- package/lib/types/client/review-page/ReviewDetail.d.ts.map +1 -1
- package/lib/types/client/review-page/ReviewDetail.js.map +1 -1
- package/lib/types/client/review-page/ReviewLabels.d.ts +1 -1
- package/lib/types/client/review-page/ReviewLabels.d.ts.map +1 -1
- package/lib/types/client/review-page/ReviewLabels.js.map +1 -1
- package/lib/types/client/review-page/ReviewList.d.ts +10 -8
- package/lib/types/client/review-page/ReviewList.d.ts.map +1 -1
- package/lib/types/client/review-page/ReviewList.js.map +1 -1
- package/lib/types/client/review-page/ReviewNav.d.ts +1 -1
- package/lib/types/client/review-page/ReviewNav.d.ts.map +1 -1
- package/lib/types/client/review-page/ReviewPage.d.ts +17 -14
- package/lib/types/client/review-page/ReviewPage.d.ts.map +1 -1
- package/lib/types/client/review-page/ReviewPage.js.map +1 -1
- package/lib/types/client/review-page/ReviewSkeleton.d.ts +26 -0
- package/lib/types/client/review-page/ReviewSkeleton.d.ts.map +1 -0
- package/lib/types/client/review-page/ReviewSkeleton.js.map +1 -0
- package/lib/types/client/review-page/ReviewStatus.d.ts +19 -13
- package/lib/types/client/review-page/ReviewStatus.d.ts.map +1 -1
- package/lib/types/client/review-page/ReviewStatus.js.map +1 -1
- package/lib/types/client/review-page/review-activity.d.ts +37 -0
- package/lib/types/client/review-page/review-activity.d.ts.map +1 -0
- package/lib/types/client/review-page/review-activity.js.map +1 -0
- package/lib/types/client/review-page/review-lists.d.ts +48 -13
- package/lib/types/client/review-page/review-lists.d.ts.map +1 -1
- package/lib/types/client/review-page/review-lists.js.map +1 -1
- package/lib/types/client/review-page/review-mount.d.ts +3 -1
- package/lib/types/client/review-page/review-mount.d.ts.map +1 -1
- package/lib/types/client/review-page/review-mount.js.map +1 -1
- package/lib/types/client/review-page/review-store.d.ts +19 -9
- package/lib/types/client/review-page/review-store.d.ts.map +1 -1
- package/lib/types/client/review-page/review-store.js.map +1 -1
- package/lib/types/client/review-queue.d.ts +1 -1
- package/lib/types/client/review-queue.d.ts.map +1 -1
- package/lib/types/client/review-queue.js.map +1 -1
- package/lib/types/client/review-threads.d.ts +15 -8
- package/lib/types/client/review-threads.d.ts.map +1 -1
- package/lib/types/client/review-threads.js.map +1 -1
- package/lib/types/client/review.d.ts +12 -1
- package/lib/types/client/review.d.ts.map +1 -1
- package/lib/types/client/review.js.map +1 -1
- package/lib/types/client/row-form-labels.d.ts +12 -0
- package/lib/types/client/row-form-labels.d.ts.map +1 -0
- package/lib/types/client/row-form-labels.js.map +1 -0
- package/lib/types/client/session-list.d.ts +1 -1
- package/lib/types/client/session-list.d.ts.map +1 -1
- package/lib/types/client/slots.d.ts +1 -1
- package/lib/types/client/slots.d.ts.map +1 -1
- package/lib/types/client/source.d.ts +1 -1
- package/lib/types/client/source.d.ts.map +1 -1
- package/lib/types/client/status.d.ts +7 -6
- package/lib/types/client/status.d.ts.map +1 -1
- package/lib/types/client/status.js.map +1 -1
- package/lib/types/client/thread-state.d.ts +2 -2
- package/lib/types/client/thread-state.d.ts.map +1 -1
- package/lib/types/client/thread-state.js.map +1 -1
- package/lib/types/client/toolbar-fold.d.ts +16 -6
- package/lib/types/client/toolbar-fold.d.ts.map +1 -1
- package/lib/types/client/toolbar-fold.js.map +1 -1
- package/lib/types/client/worktree-settings-form.d.ts +1 -1
- package/lib/types/client/worktree-settings-form.d.ts.map +1 -1
- package/lib/types/client/worktree-settings-form.js.map +1 -1
- package/lib/types/diff.d.ts.map +1 -1
- package/lib/types/diff.js.map +1 -1
- package/lib/types/git.d.ts +22 -0
- package/lib/types/git.d.ts.map +1 -1
- package/lib/types/git.js.map +1 -1
- package/lib/types/index.d.ts +137 -36
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js.map +1 -1
- package/lib/types/local-diff.d.ts +81 -23
- package/lib/types/local-diff.d.ts.map +1 -1
- package/lib/types/local-diff.js.map +1 -1
- package/lib/types/local-write.d.ts +44 -0
- package/lib/types/local-write.d.ts.map +1 -0
- package/lib/types/local-write.js.map +1 -0
- package/lib/types/panel.js.map +1 -1
- package/lib/types/parse.d.ts +12 -3
- package/lib/types/parse.d.ts.map +1 -1
- package/lib/types/parse.js.map +1 -1
- package/lib/types/restore.d.ts +12 -0
- package/lib/types/restore.d.ts.map +1 -0
- package/lib/types/restore.js.map +1 -0
- package/lib/types/types.d.ts +128 -13
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/viewer-lists.d.ts +22 -13
- package/lib/types/viewer-lists.d.ts.map +1 -1
- package/lib/types/viewer-lists.js.map +1 -1
- package/lib/types/worktree.js.map +1 -1
- package/package.json +62 -58
- package/src/client/ActionToast.tsx +2 -2
- package/src/client/BaseMenu.module.css +15 -3
- package/src/client/BaseMenu.tsx +25 -88
- package/src/client/BranchPicker.tsx +170 -0
- package/src/client/ChangeRequestCard.tsx +194 -70
- package/src/client/ChangeRequestOverview.tsx +194 -82
- package/src/client/ChangeRequestsSection.tsx +45 -14
- package/src/client/ChangeStatus.module.css +70 -0
- package/src/client/ChangeStatus.tsx +104 -0
- package/src/client/ChangedFiles.tsx +22 -9
- package/src/client/ChangesLoading.tsx +1 -1
- package/src/client/ChangesTab.module.css +181 -33
- package/src/client/ChangesTab.tsx +499 -183
- package/src/client/ChangesTabTitle.tsx +2 -2
- package/src/client/CommitMenu.tsx +83 -42
- package/src/client/CopyCommandButton.tsx +25 -0
- package/src/client/DiffFile.tsx +147 -29
- package/src/client/EnvironmentRows.tsx +34 -28
- package/src/client/FileLabel.module.css +16 -18
- package/src/client/FileLabel.tsx +16 -32
- package/src/client/Forge.module.css +26 -6
- package/src/client/HeadMenu.tsx +69 -0
- package/src/client/HostSettings.module.css +194 -0
- package/src/client/HostSettings.tsx +194 -0
- package/src/client/LensFilter.tsx +13 -11
- package/src/client/ReasonButton.tsx +1 -1
- package/src/client/RefreshGlyph.tsx +1 -1
- package/src/client/ReviewComposer.tsx +31 -19
- package/src/client/ReviewControls.tsx +18 -9
- package/src/client/ReviewThread.tsx +65 -23
- package/src/client/ReviewThreads.tsx +133 -38
- package/src/client/SessionHoverForge.tsx +2 -2
- package/src/client/SessionRowForge.tsx +2 -2
- package/src/client/SubmitReview.tsx +7 -5
- package/src/client/ThreadList.module.css +4 -3
- package/src/client/ThreadList.tsx +11 -8
- package/src/client/ViewOptionsMenu.tsx +12 -10
- package/src/client/WorktreeNameDialog.tsx +17 -13
- package/src/client/WorktreeProgress.tsx +13 -11
- package/src/client/WorktreeSettings.tsx +8 -14
- package/src/client/WorktreeToggle.tsx +67 -37
- package/src/client/annotations.ts +1 -1
- package/src/client/branch-search.tsx +2 -2
- package/src/client/changes-address.ts +1 -1
- package/src/client/changes-service.ts +1 -1
- package/src/client/changes-store.ts +57 -10
- package/src/client/checkout.ts +1 -1
- package/src/client/code-selection.ts +3 -1
- package/src/client/forge-copy.ts +11 -1
- package/src/client/format.ts +2 -2
- package/src/client/glyphs.tsx +72 -5
- package/src/client/highlight-context.ts +1 -1
- package/src/client/host-settings-form.ts +115 -0
- package/src/client/host-sign-in.ts +46 -0
- package/src/client/index.ts +1 -2
- package/src/client/local-writes.ts +129 -0
- package/src/client/locales.ts +881 -97
- package/src/client/minute-clock.ts +19 -0
- package/src/client/mount.ts +121 -57
- package/src/client/review-page/ReviewActivity.tsx +406 -0
- package/src/client/review-page/ReviewChat.tsx +48 -19
- package/src/client/review-page/ReviewDetail.tsx +246 -78
- package/src/client/review-page/ReviewLabels.tsx +2 -2
- package/src/client/review-page/ReviewList.tsx +173 -151
- package/src/client/review-page/ReviewNav.tsx +1 -1
- package/src/client/review-page/ReviewPage.module.css +571 -23
- package/src/client/review-page/ReviewPage.tsx +84 -53
- package/src/client/review-page/ReviewSkeleton.tsx +108 -0
- package/src/client/review-page/ReviewStatus.tsx +74 -44
- package/src/client/review-page/review-activity.ts +64 -0
- package/src/client/review-page/review-lists.ts +85 -22
- package/src/client/review-page/review-mount.ts +24 -7
- package/src/client/review-page/review-store.ts +24 -7
- package/src/client/review-queue.ts +7 -3
- package/src/client/review-threads.ts +24 -12
- package/src/client/review.ts +20 -2
- package/src/client/row-form-labels.ts +17 -0
- package/src/client/session-list.ts +1 -1
- package/src/client/slots.ts +1 -1
- package/src/client/source.ts +1 -1
- package/src/client/status.ts +20 -9
- package/src/client/thread-state.ts +8 -7
- package/src/client/toolbar-fold.ts +59 -14
- package/src/client/worktree-settings-form.ts +1 -1
- package/src/diff.ts +8 -5
- package/src/git.ts +31 -1
- package/src/index.ts +319 -70
- package/src/local-diff.ts +151 -48
- package/src/local-write.ts +159 -0
- package/src/panel.ts +1 -1
- package/src/parse.ts +26 -4
- package/src/restore.ts +15 -0
- package/src/types.ts +121 -17
- package/src/viewer-lists.ts +124 -48
- package/src/worktree.ts +1 -1
- package/lib/types/client/AttentionIndicator.d.ts +0 -22
- package/lib/types/client/AttentionIndicator.d.ts.map +0 -1
- package/lib/types/client/AttentionIndicator.js.map +0 -1
- package/src/client/AttentionIndicator.tsx +0 -37
package/src/types.ts
CHANGED
|
@@ -219,6 +219,16 @@ export interface ForgeReviewList {
|
|
|
219
219
|
readonly failure: ForgeFailure | null
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
+
/** One repository on one host, which the review page's lists can be read in. */
|
|
223
|
+
export interface ForgeReviewRepository {
|
|
224
|
+
/** Host name of the provider that lists the repository, compared without case. */
|
|
225
|
+
readonly host: string
|
|
226
|
+
/** Owner or namespace; nested groups of a GitLab project stay in it. */
|
|
227
|
+
readonly owner: string
|
|
228
|
+
/** Repository name. */
|
|
229
|
+
readonly name: string
|
|
230
|
+
}
|
|
231
|
+
|
|
222
232
|
/** The review page's lists on one host of one provider. */
|
|
223
233
|
export interface ForgeReviewHost {
|
|
224
234
|
/** Forge family of the provider. */
|
|
@@ -227,6 +237,11 @@ export interface ForgeReviewHost {
|
|
|
227
237
|
readonly host: string
|
|
228
238
|
/** Login of the signed-in user the latest successful read named, or null before one. */
|
|
229
239
|
readonly viewer: string | null
|
|
240
|
+
/**
|
|
241
|
+
* The command that signs the provider's CLI in to the host, while the latest read failed for lack of sign-in and the
|
|
242
|
+
* provider names one; null otherwise.
|
|
243
|
+
*/
|
|
244
|
+
readonly signIn: string | null
|
|
230
245
|
/** Each list the provider offers on the host; a list it does not offer is absent. */
|
|
231
246
|
readonly lists: Partial<Readonly<Record<ForgeViewerFilter, ForgeReviewList>>>
|
|
232
247
|
}
|
|
@@ -332,11 +347,19 @@ export interface ForgeBaseBranch {
|
|
|
332
347
|
readonly ref: string
|
|
333
348
|
/** The ref without `refs/heads/` or `refs/remotes/`, such as `master` or `origin/master`. */
|
|
334
349
|
readonly name: string
|
|
350
|
+
/**
|
|
351
|
+
* Directory Git registered for the worktree that has this local branch checked out, absent when none has; a scope
|
|
352
|
+
* that names the branch as its head reads that worktree.
|
|
353
|
+
*/
|
|
354
|
+
readonly worktree?: string
|
|
335
355
|
}
|
|
336
356
|
|
|
337
357
|
/** What the `branch` scope compares with while no base branch is chosen. */
|
|
338
358
|
export interface ForgeAutomaticBase {
|
|
339
|
-
/**
|
|
359
|
+
/**
|
|
360
|
+
* The created worktree's base branch or abbreviated base commit, or the default branch of the code host remote;
|
|
361
|
+
* for a scope with a `head`, the Session's checked-out branch, or its abbreviated HEAD commit when detached.
|
|
362
|
+
*/
|
|
340
363
|
readonly name: string
|
|
341
364
|
/** Whether the fork point is the base commit of the worktree the Session created rather than a merge base. */
|
|
342
365
|
readonly worktree: boolean
|
|
@@ -348,7 +371,7 @@ export interface ForgeBaseBranches {
|
|
|
348
371
|
readonly automatic: ForgeAutomaticBase | null
|
|
349
372
|
/** Remote-tracking branches without symbolic refs such as `origin/HEAD`, most recently committed first, at most `maxBranches`. */
|
|
350
373
|
readonly remote: readonly ForgeBaseBranch[]
|
|
351
|
-
/** Local branches other than the
|
|
374
|
+
/** Local branches other than the one the scope shows, most recently committed first, at most `maxBranches`. */
|
|
352
375
|
readonly local: readonly ForgeBaseBranch[]
|
|
353
376
|
}
|
|
354
377
|
|
|
@@ -363,21 +386,41 @@ export interface ForgeCommitRange {
|
|
|
363
386
|
readonly to: string
|
|
364
387
|
}
|
|
365
388
|
|
|
366
|
-
/**
|
|
389
|
+
/**
|
|
390
|
+
* The changes of a change request up to one commit, from the merge base of its base commit with that commit: what the
|
|
391
|
+
* whole change request showed while that commit was its head. The commit need not be among the change request's listed
|
|
392
|
+
* commits, as after its branch was rewritten.
|
|
393
|
+
*/
|
|
394
|
+
export interface ForgeCommitsUpTo {
|
|
395
|
+
/** Full object name of the commit the changes end at. */
|
|
396
|
+
readonly upTo: string
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/** The commits a change request view shows instead of the whole change request. */
|
|
400
|
+
export type ForgeChangeCommits = ForgeCommitRange | ForgeCommitsUpTo
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Which local changes a diff covers. Without `head` each reads the checkout of the Session's current directory through
|
|
404
|
+
* Git. With `head`, the full ref name of a branch under `refs/heads/` or `refs/remotes/`, it reads that branch in place
|
|
405
|
+
* of the checked-out one: in the worktree of the repository that has the branch checked out, where every scope applies
|
|
406
|
+
* and HEAD below is that worktree's, or, when no worktree has it, from the branch's commits, where only the `branch`
|
|
407
|
+
* scope applies and no uncommitted or untracked file shows.
|
|
408
|
+
*/
|
|
367
409
|
export type ForgeLocalScope =
|
|
368
410
|
/**
|
|
369
|
-
* The working tree and untracked files against a fork point: the merge base of HEAD with the
|
|
370
|
-
* `base`
|
|
371
|
-
*
|
|
372
|
-
* of
|
|
411
|
+
* The working tree and untracked files against a fork point: the merge base of HEAD with the `base` ref. While
|
|
412
|
+
* `base` is null, a scope with a `head` uses the merge base with the commit the Session's own HEAD names; a scope
|
|
413
|
+
* without one uses the base commit of the worktree the Session created, else the merge base of HEAD with the
|
|
414
|
+
* default branch of the code host remote. With `commits`, only the changes of those commits between the fork
|
|
415
|
+
* point and HEAD, without uncommitted or untracked files.
|
|
373
416
|
*/
|
|
374
|
-
| { readonly kind: 'branch'; readonly base: string | null; readonly commits: ForgeCommitRange | null }
|
|
417
|
+
| { readonly kind: 'branch'; readonly head?: string; readonly base: string | null; readonly commits: ForgeCommitRange | null }
|
|
375
418
|
/** The working tree and untracked files against HEAD. */
|
|
376
|
-
| { readonly kind: 'uncommitted' }
|
|
419
|
+
| { readonly kind: 'uncommitted'; readonly head?: string }
|
|
377
420
|
/** The working tree and untracked files against the index. */
|
|
378
|
-
| { readonly kind: 'unstaged' }
|
|
421
|
+
| { readonly kind: 'unstaged'; readonly head?: string }
|
|
379
422
|
/** The index against HEAD. */
|
|
380
|
-
| { readonly kind: 'staged' }
|
|
423
|
+
| { readonly kind: 'staged'; readonly head?: string }
|
|
381
424
|
|
|
382
425
|
/** One hunk of a file diff. */
|
|
383
426
|
export interface ForgeDiffHunk {
|
|
@@ -417,6 +460,8 @@ export interface ForgeDiffFile {
|
|
|
417
460
|
readonly oversized: boolean
|
|
418
461
|
/** Whether Git does not track the file yet; only local diffs list such files. */
|
|
419
462
|
readonly untracked: boolean
|
|
463
|
+
/** Whether the path is a submodule, whose change is the commit recorded for it and whose hunks hold no file content. */
|
|
464
|
+
readonly submodule: boolean
|
|
420
465
|
/** Lines added. */
|
|
421
466
|
readonly additions: number
|
|
422
467
|
/** Lines deleted. */
|
|
@@ -440,11 +485,51 @@ export interface ForgeLocalDiff {
|
|
|
440
485
|
readonly files: readonly ForgeDiffFile[]
|
|
441
486
|
/** Untracked files left out beyond `maxUntrackedFiles`. */
|
|
442
487
|
readonly omitted: number
|
|
488
|
+
/**
|
|
489
|
+
* Top-level directory of the worktree the scope read for its `head`; absent for the Session's own checkout and for
|
|
490
|
+
* a head read from its commits.
|
|
491
|
+
*/
|
|
492
|
+
readonly worktree?: string
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/** One file of a local write, as the `unstaged` scope listed it for the reader. */
|
|
496
|
+
export interface ForgeLocalWriteFile {
|
|
497
|
+
/** Path relative to the repository root, as the diff names it. */
|
|
498
|
+
readonly path: string
|
|
499
|
+
/** Digest of the change the reader saw. */
|
|
500
|
+
readonly digest: string
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* A write a person makes from the changes view to the index or the working tree of the Session's checkout, on whole
|
|
505
|
+
* files. The person's press authorizes it, so the Session's access mode does not bound it.
|
|
506
|
+
*/
|
|
507
|
+
export type ForgeLocalWrite =
|
|
508
|
+
/** Copy the working-tree state of the files into the index, adding untracked files and recording deletions. */
|
|
509
|
+
| { readonly kind: 'stage'; readonly files: readonly ForgeLocalWriteFile[] }
|
|
510
|
+
/** Return the index entries of the paths to HEAD; a staged rename names both of its paths. */
|
|
511
|
+
| { readonly kind: 'unstage'; readonly paths: readonly string[] }
|
|
512
|
+
/**
|
|
513
|
+
* Return the working-tree files to their index entries and delete untracked files. A file Git tracks without
|
|
514
|
+
* content yet, as `git add --intent-to-add` leaves it, is refused, because its index entry is empty; so is a
|
|
515
|
+
* submodule, whose checkout a restore leaves as it is.
|
|
516
|
+
*/
|
|
517
|
+
| { readonly kind: 'restore'; readonly files: readonly ForgeLocalWriteFile[] }
|
|
518
|
+
/** Return the index entries of the paths to `tree`, the {@link ForgeLocalWriteResult.undo} of an earlier write. */
|
|
519
|
+
| { readonly kind: 'reindex'; readonly tree: string; readonly paths: readonly string[] }
|
|
520
|
+
|
|
521
|
+
/** What a local write left for undoing it. */
|
|
522
|
+
export interface ForgeLocalWriteResult {
|
|
523
|
+
/**
|
|
524
|
+
* Object name of the index as a tree before a `stage` or `unstage`, which a `reindex` of the same paths returns to;
|
|
525
|
+
* null for other writes and while the index holds unmerged entries.
|
|
526
|
+
*/
|
|
527
|
+
readonly undo: string | null
|
|
443
528
|
}
|
|
444
529
|
|
|
445
530
|
/** Changes of a change request, or of consecutive commits of it, as its code host computes them. */
|
|
446
531
|
export interface ForgeChangeRequestDiff {
|
|
447
|
-
/** Commit whose new side the diff describes: the head,
|
|
532
|
+
/** Commit whose new side the diff describes: the head, the last chosen commit, or the commit the changes go up to. */
|
|
448
533
|
readonly headSha: string
|
|
449
534
|
/** Changed files in the host's order. */
|
|
450
535
|
readonly files: readonly ForgeDiffFile[]
|
|
@@ -487,7 +572,10 @@ export interface ForgeLensResult {
|
|
|
487
572
|
export type ForgeLensSource =
|
|
488
573
|
/** Local changes of a Session's checkout in one scope. */
|
|
489
574
|
| { readonly kind: 'local'; readonly scope: ForgeLocalScope }
|
|
490
|
-
/**
|
|
575
|
+
/**
|
|
576
|
+
* A change request at one head commit, whole or as consecutive commits. A view of its changes up to an earlier commit
|
|
577
|
+
* is the whole change request with that commit as `headSha`.
|
|
578
|
+
*/
|
|
491
579
|
| { readonly kind: 'change'; readonly ref: ChangeRequestRef; readonly headSha: string; readonly commits: ForgeCommitRange | null }
|
|
492
580
|
|
|
493
581
|
/** What one `classify` call receives. */
|
|
@@ -522,10 +610,10 @@ export interface ForgeLens {
|
|
|
522
610
|
|
|
523
611
|
/** What a changes view asks a lens to classify: its source, the version of the files it shows, and the lens. */
|
|
524
612
|
export interface ForgeLensRequest {
|
|
525
|
-
/** The view's source: local changes in a scope, or a binding URL with its chosen commits. */
|
|
613
|
+
/** The view's source: local changes in a scope, or a binding URL with its chosen commits or the commit its changes go up to. */
|
|
526
614
|
readonly source:
|
|
527
615
|
| { readonly kind: 'local'; readonly scope: ForgeLocalScope }
|
|
528
|
-
| { readonly kind: 'change'; readonly url: string; readonly commits:
|
|
616
|
+
| { readonly kind: 'change'; readonly url: string; readonly commits: ForgeChangeCommits | null }
|
|
529
617
|
/** `lensVersion` of the files the view shows; files read since with another version refuse the request. */
|
|
530
618
|
readonly version: string
|
|
531
619
|
/** Identity of the registered lens. */
|
|
@@ -648,7 +736,7 @@ export interface Config {
|
|
|
648
736
|
reviewListIntervalMs?: number
|
|
649
737
|
/** Milliseconds between two reads of the review page's navigation count while it is shown. */
|
|
650
738
|
reviewCountIntervalMs?: number
|
|
651
|
-
/** Largest delay in milliseconds between two reads of the review page's lists or count after consecutive
|
|
739
|
+
/** Largest delay in milliseconds between two reads of the review page's lists or count on one host after its consecutive failed reads. */
|
|
652
740
|
reviewMaxBackoffMs?: number
|
|
653
741
|
/** Most change requests one review page list shows, capped by each provider's own limit. */
|
|
654
742
|
reviewPageSize?: number
|
|
@@ -698,6 +786,13 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
698
786
|
'forgePanel/no-fork-point': Record<string, never>
|
|
699
787
|
/** The base branch chosen for the `branch` scope does not exist, as after the branch was deleted. */
|
|
700
788
|
'forgePanel/base-missing': Record<string, never>
|
|
789
|
+
/** The branch a local scope reads in place of the checked-out one does not exist, as after the branch was deleted. */
|
|
790
|
+
'forgePanel/head-missing': Record<string, never>
|
|
791
|
+
/**
|
|
792
|
+
* A scope other than `branch` named a branch that no worktree has checked out, as after its worktree was removed;
|
|
793
|
+
* only the `branch` scope reads such a branch.
|
|
794
|
+
*/
|
|
795
|
+
'forgePanel/no-working-tree': Record<string, never>
|
|
701
796
|
/** Filter configuration could not be read completely; no comparison ran. Correct Git settings or the output limit before retrying. */
|
|
702
797
|
'forgePanel/filter-config-failed': Record<string, never>
|
|
703
798
|
/**
|
|
@@ -709,16 +804,25 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
709
804
|
'forgePanel/checks-failed': Record<string, never>
|
|
710
805
|
/** The code host did not provide the change request's diff or file, or its status has not been read yet; the message says why. */
|
|
711
806
|
'forgePanel/diff-failed': Record<string, never>
|
|
712
|
-
/**
|
|
807
|
+
/**
|
|
808
|
+
* A chosen commit is no longer among the listed commits of the branch or change request, the commits are out of
|
|
809
|
+
* order, or the commit a change request's changes go up to is not a full object name or one the code host has.
|
|
810
|
+
*/
|
|
713
811
|
'forgePanel/commits-missing': Record<string, never>
|
|
714
812
|
/** A chosen commit after the first lacks the commit listed before it as its first parent, so two ends cannot name the run. */
|
|
715
813
|
'forgePanel/commits-not-linear': Record<string, never>
|
|
814
|
+
/** A file's unstaged change is not the one the reader saw; nothing was written. */
|
|
815
|
+
'forgePanel/local-stale': Record<string, never>
|
|
816
|
+
/** A file listed as deleted has a directory at its path, which a write of that path would reach into; nothing was written. */
|
|
817
|
+
'forgePanel/local-path-replaced': Record<string, never>
|
|
716
818
|
/** The code host did not provide the signed-in user's viewed marks on the change request's files; the message says why. */
|
|
717
819
|
'forgePanel/viewed-failed': Record<string, never>
|
|
718
820
|
/** The code host did not list the accounts a review can be requested from; the message says why. */
|
|
719
821
|
'forgePanel/reviewers-failed': Record<string, never>
|
|
720
822
|
/** The code host did not provide a change request's description; the message says why. */
|
|
721
823
|
'forgePanel/description-failed': Record<string, never>
|
|
824
|
+
/** The code host did not provide a change request's activity; the message says why. */
|
|
825
|
+
'forgePanel/activity-failed': Record<string, never>
|
|
722
826
|
/** The code host's provider cannot read review threads, so the changes view shows none. */
|
|
723
827
|
'forgePanel/review-unsupported': Record<string, never>
|
|
724
828
|
/** The code host did not provide the change request's review threads, or its status has not been read yet; the message says why. */
|
package/src/viewer-lists.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The review page's lists of the signed-in user's change requests and its navigation count. Lists are read only while
|
|
3
3
|
* some reader streams them and the count only while some reader streams it; neither joins the forge's status polling.
|
|
4
|
-
* Readers of one repository scope share one poller, which reads every list of every host each round, hosts in
|
|
5
|
-
* and each host's lists one after another, so one host has at most one read in flight. A
|
|
6
|
-
*
|
|
4
|
+
* Readers of one repository scope share one poller, which reads every list of every due host each round, hosts in
|
|
5
|
+
* parallel and each host's lists one after another, so one host has at most one read in flight. A host whose read
|
|
6
|
+
* failed is read again later each time, as status polling waits after consecutive failures, while the other hosts
|
|
7
|
+
* keep their cadence. A scope that names a repository reads only the host the repository is on.
|
|
7
8
|
*/
|
|
8
9
|
|
|
9
10
|
import type {
|
|
10
11
|
ForgeFailure, ForgeViewerFilter, ForgeViewerList, ForgeViewerQuery, ForgeViewerSource,
|
|
11
12
|
} from '@deepseek-ai/dsh-experimental-forge/types'
|
|
12
|
-
import type { ForgeReviewCountFrame, ForgeReviewFrame, ForgeReviewHost, ForgeReviewList } from './types.ts'
|
|
13
|
+
import type { ForgeReviewCountFrame, ForgeReviewFrame, ForgeReviewHost, ForgeReviewList, ForgeReviewRepository } from './types.ts'
|
|
13
14
|
|
|
14
15
|
/** The lists in the order the page shows them. */
|
|
15
16
|
const FILTERS: readonly ForgeViewerFilter[] = ['review-requested', 'authored', 'involved']
|
|
@@ -22,6 +23,8 @@ export interface ViewerListSources {
|
|
|
22
23
|
readonly list: (forge: string, query: ForgeViewerQuery, signal: AbortSignal) => Promise<ForgeViewerList | ForgeFailure>
|
|
23
24
|
/** Read the size of every list on one host. */
|
|
24
25
|
readonly count: (forge: string, host: string, signal: AbortSignal) => Promise<ReadonlyMap<ForgeViewerFilter, number> | ForgeFailure>
|
|
26
|
+
/** The command that signs the provider's CLI in to a host, or null when the provider names none. */
|
|
27
|
+
readonly signIn: (forge: string, host: string, signal: AbortSignal) => Promise<string | null>
|
|
25
28
|
/** Report a read that rejected instead of resolving to a failure. */
|
|
26
29
|
readonly report: (error: unknown) => void
|
|
27
30
|
}
|
|
@@ -32,14 +35,14 @@ export interface ViewerListTiming {
|
|
|
32
35
|
readonly listIntervalMs: number
|
|
33
36
|
/** Milliseconds between two rounds of the count poller. */
|
|
34
37
|
readonly countIntervalMs: number
|
|
35
|
-
/** Largest delay in milliseconds after consecutive failed
|
|
38
|
+
/** Largest delay in milliseconds before a host is read again after consecutive failed reads. */
|
|
36
39
|
readonly maxBackoffMs: number
|
|
37
40
|
/** Most change requests one list read asks for, before each provider's own limit. */
|
|
38
41
|
readonly pageSize: number
|
|
39
42
|
}
|
|
40
43
|
|
|
41
|
-
/** One repository to list in, or null for every repository. */
|
|
42
|
-
export type ViewerScope =
|
|
44
|
+
/** One repository on one host to list in, or null for every repository of every host. */
|
|
45
|
+
export type ViewerScope = ForgeReviewRepository | null
|
|
43
46
|
|
|
44
47
|
/** A stream's latest undelivered frame; a newer frame replaces one the reader has not taken. */
|
|
45
48
|
export class Reader<T> {
|
|
@@ -92,15 +95,15 @@ export class Reader<T> {
|
|
|
92
95
|
}
|
|
93
96
|
}
|
|
94
97
|
|
|
95
|
-
/** A loop that runs one round, waits, and repeats until stopped; a refresh ends the wait early. */
|
|
98
|
+
/** A loop that runs one round, waits as long as the round asks, and repeats until stopped; a refresh ends the wait early. */
|
|
96
99
|
class Poller {
|
|
97
100
|
private readonly aborter = new AbortController()
|
|
98
101
|
private wake: (() => void) | undefined
|
|
99
102
|
private refreshing = false
|
|
100
|
-
private failures = 0
|
|
101
103
|
readonly done: Promise<void>
|
|
102
104
|
|
|
103
|
-
|
|
105
|
+
/** @param round - runs one round, `forced` after a refresh, and resolves to the milliseconds to wait before the next. */
|
|
106
|
+
constructor(private readonly round: (signal: AbortSignal, forced: boolean) => Promise<number>) {
|
|
104
107
|
this.done = this.loop()
|
|
105
108
|
}
|
|
106
109
|
|
|
@@ -123,12 +126,12 @@ class Poller {
|
|
|
123
126
|
private async loop(): Promise<void> {
|
|
124
127
|
const { signal } = this.aborter
|
|
125
128
|
while (!signal.aborted) {
|
|
129
|
+
const forced = this.refreshing
|
|
126
130
|
this.refreshing = false
|
|
127
|
-
const
|
|
128
|
-
this.failures = succeeded ? 0 : this.failures + 1
|
|
131
|
+
const wait = await this.round(signal, forced)
|
|
129
132
|
if (this.skipsWait(signal)) continue
|
|
130
133
|
await new Promise<void>((resolve) => {
|
|
131
|
-
const timer = setTimeout(resolve,
|
|
134
|
+
const timer = setTimeout(resolve, wait)
|
|
132
135
|
this.wake = () => { clearTimeout(timer); resolve() }
|
|
133
136
|
})
|
|
134
137
|
this.wake = undefined
|
|
@@ -136,28 +139,72 @@ class Poller {
|
|
|
136
139
|
}
|
|
137
140
|
}
|
|
138
141
|
|
|
139
|
-
/**
|
|
142
|
+
/**
|
|
143
|
+
* When each host of one poller is read next. A host is due at once until its first read settles; after a read it is
|
|
144
|
+
* due one delay after the start of the round that read it, and the delay grows with its consecutive failed reads.
|
|
145
|
+
*/
|
|
146
|
+
class HostSchedule {
|
|
147
|
+
private readonly hosts = new Map<string, { readonly failures: number; readonly dueAt: number }>()
|
|
148
|
+
|
|
149
|
+
/** @param delay - milliseconds between two reads of a host after the given number of consecutive failed reads. */
|
|
150
|
+
constructor(private readonly delay: (failures: number) => number) {}
|
|
151
|
+
|
|
152
|
+
/** Whether a round that starts at `now` reads the host. */
|
|
153
|
+
due(key: string, now: number): boolean {
|
|
154
|
+
return (this.hosts.get(key)?.dueAt ?? 0) <= now
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** Record whether the read of the host succeeded in the round that started at `started`. */
|
|
158
|
+
settle(key: string, started: number, succeeded: boolean): void {
|
|
159
|
+
const failures = succeeded ? 0 : (this.hosts.get(key)?.failures ?? 0) + 1
|
|
160
|
+
this.hosts.set(key, { failures, dueAt: started + this.delay(failures) })
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** Milliseconds from `now` until the first of `keys` is due, or the delay between two successful reads without any key. */
|
|
164
|
+
wait(keys: readonly string[], now: number): number {
|
|
165
|
+
if (keys.length === 0) return this.delay(0)
|
|
166
|
+
return Math.max(0, Math.min(...keys.map(key => this.hosts.get(key)?.dueAt ?? 0)) - now)
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** One host a scope reads, with the provider that lists on it. */
|
|
171
|
+
interface Target {
|
|
172
|
+
readonly source: ForgeViewerSource
|
|
173
|
+
readonly host: string
|
|
174
|
+
readonly key: string
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** The readers of one repository scope, the poller they share, when each host is read next, and what was read. */
|
|
140
178
|
class Scope {
|
|
141
179
|
readonly readers = new Set<Reader<ForgeReviewFrame>>()
|
|
142
180
|
readonly hosts = new Map<string, ForgeReviewHost>()
|
|
181
|
+
readonly schedule: HostSchedule
|
|
143
182
|
reading = false
|
|
144
183
|
readonly poller: Poller
|
|
145
184
|
|
|
146
185
|
/**
|
|
147
|
-
* @param
|
|
148
|
-
* @param
|
|
186
|
+
* @param repository - the repository the scope lists in, or null for every repository of every host.
|
|
187
|
+
* @param round - reads the scope's due hosts once, every host when `forced`; resolves to the wait before the next round.
|
|
188
|
+
* @param delay - milliseconds between two reads of a host after the given number of consecutive failed reads.
|
|
149
189
|
*/
|
|
150
|
-
constructor(
|
|
151
|
-
|
|
190
|
+
constructor(
|
|
191
|
+
readonly repository: ViewerScope,
|
|
192
|
+
round: (scope: Scope, signal: AbortSignal, forced: boolean) => Promise<number>,
|
|
193
|
+
delay: (failures: number) => number,
|
|
194
|
+
) {
|
|
195
|
+
this.schedule = new HostSchedule(delay)
|
|
196
|
+
this.poller = new Poller((signal, forced) => round(this, signal, forced))
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** The hosts the scope reads, in registration and configuration order: every host, or the one its repository is on. */
|
|
200
|
+
targets(order: readonly ForgeViewerSource[]): Target[] {
|
|
201
|
+
const only = this.repository?.host.toLowerCase()
|
|
202
|
+
return order.flatMap(source => source.hosts.filter(host => only === undefined || host === only)
|
|
203
|
+
.map(host => ({ source, host, key: hostKey(source.forge, host) })))
|
|
152
204
|
}
|
|
153
205
|
|
|
154
206
|
frame(order: readonly ForgeViewerSource[]): ForgeReviewFrame {
|
|
155
|
-
const hosts
|
|
156
|
-
for (const source of order) {
|
|
157
|
-
for (const host of source.hosts) {
|
|
158
|
-
hosts.push(this.hosts.get(hostKey(source.forge, host)) ?? emptyHost(source, host))
|
|
159
|
-
}
|
|
160
|
-
}
|
|
207
|
+
const hosts = this.targets(order).map(({ source, host, key }) => this.hosts.get(key) ?? emptyHost(source, host))
|
|
161
208
|
return { hosts, reading: this.reading }
|
|
162
209
|
}
|
|
163
210
|
}
|
|
@@ -167,6 +214,7 @@ export class ViewerLists {
|
|
|
167
214
|
private readonly scopes = new Map<string, Scope>()
|
|
168
215
|
private readonly countReaders = new Set<Reader<ForgeReviewCountFrame>>()
|
|
169
216
|
private readonly counts = new Map<string, number>()
|
|
217
|
+
private readonly countSchedule = new HostSchedule(failures => this.delay(this.timing.countIntervalMs, failures))
|
|
170
218
|
private countPoller: Poller | undefined
|
|
171
219
|
private disposed = false
|
|
172
220
|
|
|
@@ -179,18 +227,19 @@ export class ViewerLists {
|
|
|
179
227
|
/**
|
|
180
228
|
* Stream the lists of one repository scope: the lists read so far first, then a frame after each read settles.
|
|
181
229
|
* The stream ends when `signal` aborts or the hub is disposed; the last stream of a scope stops its reads.
|
|
182
|
-
* @param scope - one repository, or null for every repository.
|
|
230
|
+
* @param scope - one repository on its host, or null for every repository of every host.
|
|
183
231
|
* @param signal - ends the stream.
|
|
184
232
|
* @returns frames, each complete.
|
|
185
233
|
*/
|
|
186
234
|
async *lists(scope: ViewerScope, signal: AbortSignal): AsyncIterable<ForgeReviewFrame> {
|
|
187
235
|
signal.throwIfAborted()
|
|
188
236
|
if (this.disposed) return
|
|
189
|
-
const key = scope === null ? '' : `${scope.owner}/${scope.name}`.toLowerCase()
|
|
237
|
+
const key = scope === null ? '' : `${scope.host}\n${scope.owner}/${scope.name}`.toLowerCase()
|
|
190
238
|
let state = this.scopes.get(key)
|
|
191
239
|
if (state === undefined) {
|
|
192
240
|
state = new Scope(
|
|
193
|
-
(created, round) => this.readScope(created,
|
|
241
|
+
scope, (created, round, forced) => this.readScope(created, round, forced),
|
|
242
|
+
failures => this.delay(this.timing.listIntervalMs, failures),
|
|
194
243
|
)
|
|
195
244
|
this.scopes.set(key, state)
|
|
196
245
|
}
|
|
@@ -221,7 +270,7 @@ export class ViewerLists {
|
|
|
221
270
|
const reader = new Reader<ForgeReviewCountFrame>(signal)
|
|
222
271
|
this.countReaders.add(reader)
|
|
223
272
|
reader.push(this.countFrame())
|
|
224
|
-
this.countPoller ??= new Poller(
|
|
273
|
+
this.countPoller ??= new Poller((round, forced) => this.readCounts(round, forced))
|
|
225
274
|
try {
|
|
226
275
|
yield* reader.frames()
|
|
227
276
|
} finally {
|
|
@@ -271,45 +320,72 @@ export class ViewerLists {
|
|
|
271
320
|
await Promise.all(pollers.map(async (poller) =>{ await poller.stop() }))
|
|
272
321
|
}
|
|
273
322
|
|
|
274
|
-
/**
|
|
275
|
-
|
|
276
|
-
|
|
323
|
+
/**
|
|
324
|
+
* Read every list of the scope's due hosts once, of every host when `forced`.
|
|
325
|
+
* @returns milliseconds until the scope's next host is due.
|
|
326
|
+
*/
|
|
327
|
+
private async readScope(scope: Scope, signal: AbortSignal, forced: boolean): Promise<number> {
|
|
328
|
+
const started = Date.now()
|
|
329
|
+
const targets = scope.targets(this.sources.sources())
|
|
330
|
+
const repository = scope.repository === null ? null : { owner: scope.repository.owner, name: scope.repository.name }
|
|
277
331
|
scope.reading = true
|
|
278
332
|
this.publish(scope)
|
|
279
|
-
|
|
333
|
+
await Promise.all(targets.filter(target => forced || scope.schedule.due(target.key, started)).map(async ({ source, host, key }) => {
|
|
280
334
|
let succeeded = true
|
|
281
335
|
let hostFailure: ForgeFailure | undefined
|
|
282
336
|
for (const filter of FILTERS) {
|
|
283
337
|
if (!source.filters.has(filter)) continue
|
|
284
338
|
const query: ForgeViewerQuery = { host, filter, repository, limit: Math.min(source.maxItems, this.timing.pageSize) }
|
|
285
339
|
const result = hostFailure ?? await this.read(() => this.sources.list(source.forge, query, signal), signal)
|
|
286
|
-
if (signal.aborted) return
|
|
340
|
+
if (signal.aborted) return
|
|
287
341
|
if ('code' in result && HOST_FAILURES.has(result.code)) hostFailure = result
|
|
288
342
|
succeeded = this.settle(scope, source, host, filter, result) && succeeded
|
|
289
343
|
if (repository === null && !('code' in result) && filter === 'review-requested') {
|
|
290
|
-
this.counts.set(
|
|
344
|
+
this.counts.set(key, result.total)
|
|
291
345
|
this.publishCount()
|
|
292
346
|
}
|
|
293
347
|
this.publish(scope)
|
|
294
348
|
}
|
|
295
|
-
|
|
296
|
-
|
|
349
|
+
const signIn = hostFailure?.code === 'unauthenticated' ? await this.signInOf(scope, source, host, signal) : null
|
|
350
|
+
if (signal.aborted) return
|
|
351
|
+
const current = scope.hosts.get(key) ?? emptyHost(source, host)
|
|
352
|
+
if (current.signIn !== signIn) {
|
|
353
|
+
scope.hosts.set(key, { ...current, signIn })
|
|
354
|
+
this.publish(scope)
|
|
355
|
+
}
|
|
356
|
+
scope.schedule.settle(key, started, succeeded)
|
|
357
|
+
}))
|
|
297
358
|
scope.reading = false
|
|
298
359
|
if (!signal.aborted) this.publish(scope)
|
|
299
|
-
return
|
|
360
|
+
return scope.schedule.wait(targets.map(target => target.key), Date.now())
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/** The sign-in command the scope already holds for the host, else the one its provider names now, else null. */
|
|
364
|
+
private async signInOf(scope: Scope, source: ForgeViewerSource, host: string, signal: AbortSignal): Promise<string | null> {
|
|
365
|
+
const known = scope.hosts.get(hostKey(source.forge, host))?.signIn ?? null
|
|
366
|
+
if (known !== null) return known
|
|
367
|
+
const command = await this.read<string | null>(() => this.sources.signIn(source.forge, host, signal), signal)
|
|
368
|
+
return typeof command === 'string' ? command : null
|
|
300
369
|
}
|
|
301
370
|
|
|
302
|
-
/**
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
371
|
+
/**
|
|
372
|
+
* Read the count of every due host once, of every host when `forced`.
|
|
373
|
+
* @returns milliseconds until the next host is due.
|
|
374
|
+
*/
|
|
375
|
+
private async readCounts(signal: AbortSignal, forced: boolean): Promise<number> {
|
|
376
|
+
const started = Date.now()
|
|
377
|
+
const targets = this.sources.sources().filter(source => source.filters.has('review-requested'))
|
|
378
|
+
.flatMap(source => source.hosts.map(host => ({ source, host, key: hostKey(source.forge, host) })))
|
|
379
|
+
await Promise.all(targets.filter(target => forced || this.countSchedule.due(target.key, started)).map(async ({ source, host, key }) => {
|
|
306
380
|
const result = await this.read(() => this.sources.count(source.forge, host, signal), signal)
|
|
307
|
-
if (signal.aborted
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
381
|
+
if (signal.aborted) return
|
|
382
|
+
if (!('code' in result)) {
|
|
383
|
+
this.counts.set(key, result.get('review-requested') ?? 0)
|
|
384
|
+
this.publishCount()
|
|
385
|
+
}
|
|
386
|
+
this.countSchedule.settle(key, started, !('code' in result))
|
|
387
|
+
}))
|
|
388
|
+
return this.countSchedule.wait(targets.map(target => target.key), Date.now())
|
|
313
389
|
}
|
|
314
390
|
|
|
315
391
|
/** Run one read, turning a rejection into an `unavailable` failure and reporting it unless `signal` aborted. */
|
|
@@ -371,5 +447,5 @@ function hostKey(forge: string, host: string): string {
|
|
|
371
447
|
function emptyHost(source: ForgeViewerSource, host: string): ForgeReviewHost {
|
|
372
448
|
const lists: Partial<Record<ForgeViewerFilter, ForgeReviewList>> = {}
|
|
373
449
|
for (const filter of FILTERS) if (source.filters.has(filter)) lists[filter] = EMPTY_LIST
|
|
374
|
-
return { forge: source.forge, host, viewer: null, lists }
|
|
450
|
+
return { forge: source.forge, host, viewer: null, signIn: null, lists }
|
|
375
451
|
}
|
package/src/worktree.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { Context } from '@deepseek-ai/cordis'
|
|
|
5
5
|
import type { Agent, PreStepDecision } from '@deepseek-ai/dsh-agent'
|
|
6
6
|
import { CREATED_RECORD, createdWorktreeSchema, generatedWorktreeName } from '@deepseek-ai/dsh-experimental-worktree'
|
|
7
7
|
import type { CreatedWorktree, CreateWorktreePhase } from '@deepseek-ai/dsh-experimental-worktree'
|
|
8
|
-
import { appendPluginRecord, pluginRecordOf } from '@deepseek-ai/dsh-session'
|
|
8
|
+
import { appendPluginRecord, pluginRecordOf } from '@deepseek-ai/dsh-session-store'
|
|
9
9
|
import type { Session, SessionEvent } from '@deepseek-ai/dsh-session'
|
|
10
10
|
import type { ProjectionDefinition, ProjectionHandle } from '@deepseek-ai/dsh-session-projection'
|
|
11
11
|
import { assertNever } from '@deepseek-ai/dsh-util-values'
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/** Mark over the Session panel toggle while a bound change request needs attention. */
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
import type { HostObservable, InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
4
|
-
import type { NS } from './locales.ts';
|
|
5
|
-
import type { PanelSnapshot } from './source.ts';
|
|
6
|
-
/** Business face of the attention indicator. */
|
|
7
|
-
export interface AttentionIndicatorInjected {
|
|
8
|
-
/** Panel snapshot of the Session; bound as `usePanel`. */
|
|
9
|
-
readonly hooks: {
|
|
10
|
-
readonly panel: HostObservable<PanelSnapshot>;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
/** Full props of the attention indicator. */
|
|
14
|
-
export type AttentionIndicatorProps = PropsRuntime<'conversation.session.panel.indicator'> & InjectFace<AttentionIndicatorInjected> & PropsLocale<typeof NS>;
|
|
15
|
-
/**
|
|
16
|
-
* Render a yellow dot, named for assistive technology, while any bound change
|
|
17
|
-
* request has failing checks, requested changes, or a merge conflict.
|
|
18
|
-
* @param props - panel snapshot hook and copy.
|
|
19
|
-
* @returns the indicator, or null while nothing needs attention.
|
|
20
|
-
*/
|
|
21
|
-
export declare function AttentionIndicator({ usePanel, t }: AttentionIndicatorProps): ReactNode;
|
|
22
|
-
//# sourceMappingURL=AttentionIndicator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttentionIndicator.d.ts","sourceRoot":"","sources":["../../../src/client/AttentionIndicator.tsx"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAE7G,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAIhD,gDAAgD;AAChD,MAAM,WAAW,0BAA0B;IACzC,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;KAAE,CAAA;CAClE;AAED,6CAA6C;AAC7C,MAAM,MAAM,uBAAuB,GACjC,YAAY,CAAC,sCAAsC,CAAC,GAClD,UAAU,CAAC,0BAA0B,CAAC,GACtC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAA;AAE1B;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,uBAAuB,GAAG,SAAS,CAQtF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttentionIndicator.js","sourceRoot":"","sources":["../../../src/client/AttentionIndicator.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,GAAG,MAAM,oBAAoB,CAAA;AAcpC;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC,EAA2B;IACzE,MAAM,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC,CAAA;IACpG,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAA;IAC3B,OAAO,CACL,eAAM,SAAS,EAAE,GAAG,CAAC,SAAS,0BAAuB,EAAE,YACrD,eAAM,SAAS,EAAE,GAAG,CAAC,cAAc,YAAG,CAAC,CAAC,kBAAkB,CAAC,GAAQ,GAC9D,CACR,CAAA;AACH,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/** Mark over the Session panel toggle while a bound change request needs attention. */
|
|
2
|
-
|
|
3
|
-
import type { ReactNode } from 'react'
|
|
4
|
-
import type { HostObservable, InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
|
|
5
|
-
import type {} from '@deepseek-ai/dsh-client-ui-session-panel/client'
|
|
6
|
-
import type { NS } from './locales.ts'
|
|
7
|
-
import type { PanelSnapshot } from './source.ts'
|
|
8
|
-
import { needsAttention } from './status.ts'
|
|
9
|
-
import css from './Forge.module.css'
|
|
10
|
-
|
|
11
|
-
/** Business face of the attention indicator. */
|
|
12
|
-
export interface AttentionIndicatorInjected {
|
|
13
|
-
/** Panel snapshot of the Session; bound as `usePanel`. */
|
|
14
|
-
readonly hooks: { readonly panel: HostObservable<PanelSnapshot> }
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** Full props of the attention indicator. */
|
|
18
|
-
export type AttentionIndicatorProps =
|
|
19
|
-
PropsRuntime<'conversation.session.panel.indicator'>
|
|
20
|
-
& InjectFace<AttentionIndicatorInjected>
|
|
21
|
-
& PropsLocale<typeof NS>
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Render a yellow dot, named for assistive technology, while any bound change
|
|
25
|
-
* request has failing checks, requested changes, or a merge conflict.
|
|
26
|
-
* @param props - panel snapshot hook and copy.
|
|
27
|
-
* @returns the indicator, or null while nothing needs attention.
|
|
28
|
-
*/
|
|
29
|
-
export function AttentionIndicator({ usePanel, t }: AttentionIndicatorProps): ReactNode {
|
|
30
|
-
const attention = usePanel(snapshot => snapshot.state?.changeRequests.some(needsAttention) === true)
|
|
31
|
-
if (!attention) return null
|
|
32
|
-
return (
|
|
33
|
-
<span className={css.attention} data-forge-attention="">
|
|
34
|
-
<span className={css.visuallyHidden}>{t('header.attention')}</span>
|
|
35
|
-
</span>
|
|
36
|
-
)
|
|
37
|
-
}
|