dsh-vscode-mode 0.19.1 → 0.20.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/README.md +8 -4
- package/lib/client.js +733 -321
- package/lib/client.js.map +1 -1
- package/lib/index.js +535 -42
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/archiveDb.ts +8 -8
- package/src/capture.ts +2 -2
- package/src/client/sidebar/panels/FileExplorer.ts +34 -5
- package/src/client/state/diffSummary.ts +30 -0
- package/src/client/state/reviewFeed.ts +60 -0
- package/src/client/ui/ConversationDiffDock.ts +9 -10
- package/src/client/ui/DiffBadge.ts +8 -6
- package/src/client/ui/DiffBox.ts +18 -0
- package/src/client/ui/DiffLauncher.ts +21 -5
- package/src/client/ui/EditorView.ts +17 -5
- package/src/client/ui/OfficialReview.ts +93 -0
- package/src/index.ts +3 -0
- package/src/model.ts +7 -3
- package/src/officialCapture.ts +199 -0
- package/src/reviewDb.ts +214 -0
- package/src/reviewRpc.ts +33 -0
- package/src/rpc.ts +14 -18
- package/src/shared/review.ts +91 -0
- package/src/shared/rpc.ts +7 -0
- package/src/store.ts +2 -2
package/src/shared/rpc.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { DAP_ACTIONS } from './dap.js'
|
|
|
25
25
|
import { appUrl } from './appUrl.js'
|
|
26
26
|
import type { LoggerLevel } from './logger.js'
|
|
27
27
|
import type { SvnViewRequest, SvnViewPayload } from './svnExplorer.js'
|
|
28
|
+
import type { DecideReview, ReviewDetail, ReviewPage, ReviewRequest } from './review.js'
|
|
28
29
|
|
|
29
30
|
/** webServer 精确路由。 */
|
|
30
31
|
export const RPC_PATH = '/edrv/rpc'
|
|
@@ -368,6 +369,9 @@ export interface UiStatePatchInput {
|
|
|
368
369
|
|
|
369
370
|
/** 每个方法的请求参数(sessionId 为公共可选字段)。 */
|
|
370
371
|
export interface RpcRequestMap {
|
|
372
|
+
'edrv.review.list': ReviewRequest & { cursor?: number; history?: boolean; path?: string }
|
|
373
|
+
'edrv.review.detail': ReviewRequest & { id: string }
|
|
374
|
+
'edrv.review.decide': DecideReview
|
|
371
375
|
'edrv.list': { sessionId?: string; callIds?: string[]; skipStale?: boolean }
|
|
372
376
|
'edrv.accept': { sessionId?: string; callId: string; scope?: RpcScope; hunkIndex?: number }
|
|
373
377
|
'edrv.reject': { sessionId?: string; callId: string; scope?: RpcScope; hunkIndex?: number }
|
|
@@ -537,6 +541,9 @@ export type RpcMethod = keyof RpcRequestMap
|
|
|
537
541
|
|
|
538
542
|
/** 每个方法成功(ok:true)时的附加载荷。 */
|
|
539
543
|
export interface RpcOkMap {
|
|
544
|
+
'edrv.review.list': { page: ReviewPage }
|
|
545
|
+
'edrv.review.detail': { detail: ReviewDetail }
|
|
546
|
+
'edrv.review.decide': { revision: number }
|
|
540
547
|
'edrv.list': { records: RecordView[] }
|
|
541
548
|
'edrv.accept': { record: RecordView }
|
|
542
549
|
'edrv.reject': { record: RecordView }
|
package/src/store.ts
CHANGED
|
@@ -221,10 +221,10 @@ export async function readForCache(ctx: Ctx, session: Session, cache: Map<string
|
|
|
221
221
|
*/
|
|
222
222
|
export async function recordIsStale(ctx: Ctx, session: Session, cache: Map<string, ReadState>, rec: DiffRecord): Promise<boolean> {
|
|
223
223
|
if (rec.superseded === true) return true
|
|
224
|
-
if (!Array.isArray(rec.hunks) || !rec.hunks.length) return
|
|
224
|
+
if (!Array.isArray(rec.hunks) || !rec.hunks.length) { rec.conflict = true; return false }
|
|
225
225
|
const state = await readForCache(ctx, session, cache, rec.path)
|
|
226
226
|
if (state.kind === 'unavailable') return false
|
|
227
|
-
if (state.kind === 'missing') return
|
|
227
|
+
if (state.kind === 'missing') { rec.conflict = true; return false }
|
|
228
228
|
if (rec.create === true) return false
|
|
229
229
|
const pending = rec.hunks.map((_, idx) => ({ idx, hunk: preciseHunk(rec, idx), status: rec.decisions.perHunk[idx] ?? rec.decisions.call }))
|
|
230
230
|
.filter((item) => item.status === 'pending' && item.hunk && !isNoopHunk(item.hunk))
|