dsh-git-worktree 0.4.0 → 0.6.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/CHANGELOG.md +55 -0
- package/README.en.md +33 -13
- package/README.md +34 -13
- package/lib/adapters/git.js +8 -0
- package/lib/adapters/git.js.map +1 -1
- package/lib/adapters/registry.js +100 -1
- package/lib/adapters/registry.js.map +1 -1
- package/lib/checkpoint.d.ts +3 -0
- package/lib/checkpoint.js +29 -0
- package/lib/checkpoint.js.map +1 -0
- package/lib/client/WorktreeReviewRow.js +24 -4
- package/lib/client/WorktreeReviewRow.js.map +1 -1
- package/lib/client/actions.d.ts +25 -1
- package/lib/client/actions.js.map +1 -1
- package/lib/client/console-remote/adapter.js +10 -3
- package/lib/client/console-remote/adapter.js.map +1 -1
- package/lib/client/review-console/PreflightStatus.d.ts +3 -2
- package/lib/client/review-console/PreflightStatus.js +3 -3
- package/lib/client/review-console/PreflightStatus.js.map +1 -1
- package/lib/client/review-console/ReviewActions.js +560 -23
- package/lib/client/review-console/ReviewActions.js.map +1 -1
- package/lib/client/review-console/WorktreeReviewPanel.js +18 -3
- package/lib/client/review-console/WorktreeReviewPanel.js.map +1 -1
- package/lib/client/review-console/preflight-cache.d.ts +2 -0
- package/lib/client/review-console/preflight-cache.js +18 -5
- package/lib/client/review-console/preflight-cache.js.map +1 -1
- package/lib/client/review-console/preview-recovery-cache.d.ts +20 -0
- package/lib/client/review-console/preview-recovery-cache.js +103 -0
- package/lib/client/review-console/preview-recovery-cache.js.map +1 -0
- package/lib/client/review-console/recovery-continuation.d.ts +53 -0
- package/lib/client/review-console/recovery-continuation.js +483 -0
- package/lib/client/review-console/recovery-continuation.js.map +1 -0
- package/lib/client/review-console/review-console.styles.js +9 -1
- package/lib/client/review-console/review-console.styles.js.map +1 -1
- package/lib/client/target-console/WorktreeConsoleView.js +1 -1
- package/lib/client/target-console/WorktreeConsoleView.js.map +1 -1
- package/lib/client/target-console/WorktreeReviewStatus.js +13 -0
- package/lib/client/target-console/WorktreeReviewStatus.js.map +1 -1
- package/lib/client.js +1628 -83
- package/lib/console-contract.d.ts +105 -1
- package/lib/console-contract.js.map +1 -1
- package/lib/console-host/control-plane.d.ts +6 -1
- package/lib/console-host/control-plane.js +211 -8
- package/lib/console-host/control-plane.js.map +1 -1
- package/lib/console-host/errors.d.ts +2 -2
- package/lib/console-host/errors.js +21 -5
- package/lib/console-host/errors.js.map +1 -1
- package/lib/console-host/projection.js +60 -1
- package/lib/console-host/projection.js.map +1 -1
- package/lib/console-host/service.d.ts +10 -5
- package/lib/console-host/service.js +48 -6
- package/lib/console-host/service.js.map +1 -1
- package/lib/console-remote/descriptors.js +37 -1
- package/lib/console-remote/descriptors.js.map +1 -1
- package/lib/console-remote/remote.d.ts +10 -5
- package/lib/console-remote/remote.js.map +1 -1
- package/lib/console-remote/schemas.d.ts +103 -1
- package/lib/console-remote/schemas.js +147 -5
- package/lib/console-remote/schemas.js.map +1 -1
- package/lib/index.d.ts +13 -2
- package/lib/index.js.map +1 -1
- package/lib/ports.d.ts +76 -1
- package/lib/session-checkout-apply.d.ts +76 -0
- package/lib/session-checkout-apply.js +608 -143
- package/lib/session-checkout-apply.js.map +1 -1
- package/lib/session-checkout-module.js +752 -121
- package/lib/session-checkout-module.js.map +1 -1
- package/lib/types.d.ts +93 -2
- package/lib/types.js.map +1 -1
- package/package.json +13 -13
- package/scripts/check-publish.mjs +1 -1
package/lib/types.d.ts
CHANGED
|
@@ -28,6 +28,16 @@ export interface WorktreeValidationItem {
|
|
|
28
28
|
status: 'passed' | 'failed' | 'not_run';
|
|
29
29
|
summary?: string;
|
|
30
30
|
}
|
|
31
|
+
/** A saved stage that exists only in the managed Worktree history until final delivery. */
|
|
32
|
+
export interface WorktreeCheckpointView {
|
|
33
|
+
checkpointId: string;
|
|
34
|
+
sequence: number;
|
|
35
|
+
reviewId: string;
|
|
36
|
+
createdAt: number;
|
|
37
|
+
summary: string;
|
|
38
|
+
validationStatus: WorktreeValidationStatus;
|
|
39
|
+
changedFiles: string[];
|
|
40
|
+
}
|
|
31
41
|
export interface WorktreeReviewView {
|
|
32
42
|
reviewId: string;
|
|
33
43
|
iteration: number;
|
|
@@ -110,6 +120,7 @@ export interface WorktreeApplyPreflightFacts {
|
|
|
110
120
|
export interface WorktreeAcceptanceBlockerView {
|
|
111
121
|
checkoutId: string;
|
|
112
122
|
ownerSessionId: string;
|
|
123
|
+
revision: number;
|
|
113
124
|
state: 'preview_active' | 'preview_detached' | 'finalized' | 'retained' | 'working' | 'ready_for_review' | 'delivered';
|
|
114
125
|
}
|
|
115
126
|
export type WorktreeApplyPreflightView = ({
|
|
@@ -160,6 +171,10 @@ export interface SessionTargetView {
|
|
|
160
171
|
revision: number;
|
|
161
172
|
/** Delivery state for isolated checkouts; Local targets do not carry it. */
|
|
162
173
|
delivery?: WorktreeDeliveryView;
|
|
174
|
+
/** Linear saved stages that remain unpublished to Local. */
|
|
175
|
+
checkpoints?: WorktreeCheckpointView[];
|
|
176
|
+
/** Host-derived CAS generation for the exact active Review/checkpoint state. */
|
|
177
|
+
checkpointGeneration?: string;
|
|
163
178
|
/** Current project Local Preview slot state; does not expose another checkout identity. */
|
|
164
179
|
reviewSlot?: 'available' | 'waiting';
|
|
165
180
|
/** Owner Session holding the slot, used only for navigation/status. */
|
|
@@ -187,15 +202,83 @@ export interface SessionCheckoutFinishOperation extends SessionCheckoutOperation
|
|
|
187
202
|
export interface SessionCheckoutPreviewOperation extends SessionCheckoutOperationBase {
|
|
188
203
|
action: 'preview';
|
|
189
204
|
}
|
|
205
|
+
export interface SessionCheckoutCheckpointOperation extends SessionCheckoutOperationBase {
|
|
206
|
+
action: 'checkpoint';
|
|
207
|
+
commitMessage: string;
|
|
208
|
+
expectedReviewId: string;
|
|
209
|
+
expectedGeneration: string;
|
|
210
|
+
requestId: string;
|
|
211
|
+
}
|
|
212
|
+
export type WorktreePreviewRecoveryActionBlockReason = 'stale_local' | 'preview_modified' | 'commit_isolation_conflict' | 'operation_not_allowed' | 'project_acceptance_busy';
|
|
213
|
+
export type WorktreePreviewRecoveryRollbackAction = {
|
|
214
|
+
status: 'safe';
|
|
215
|
+
targetTreeOid: string;
|
|
216
|
+
} | {
|
|
217
|
+
status: 'blocked';
|
|
218
|
+
code: WorktreePreviewRecoveryActionBlockReason;
|
|
219
|
+
message: string;
|
|
220
|
+
conflictingFiles?: string[];
|
|
221
|
+
};
|
|
222
|
+
export type WorktreePreviewRecoveryFinalizeAction = {
|
|
223
|
+
status: 'safe';
|
|
224
|
+
taskTreeOid: string;
|
|
225
|
+
finalIndexTreeOid: string;
|
|
226
|
+
expectedWorkingTreeOid: string;
|
|
227
|
+
commitRequired: boolean;
|
|
228
|
+
} | {
|
|
229
|
+
status: 'blocked';
|
|
230
|
+
code: WorktreePreviewRecoveryActionBlockReason;
|
|
231
|
+
message: string;
|
|
232
|
+
conflictingFiles?: string[];
|
|
233
|
+
};
|
|
234
|
+
/** Host-issued read-only recovery context. Mutation always recomputes and compares it under the Host lock. */
|
|
235
|
+
export interface WorktreePreviewRecoveryProof {
|
|
236
|
+
sessionId: string;
|
|
237
|
+
checkoutId: string;
|
|
238
|
+
reviewId: string;
|
|
239
|
+
previewId: string;
|
|
240
|
+
revision: number;
|
|
241
|
+
generation: string;
|
|
242
|
+
/** SHA-256 over the complete durable receipt; binds proof to retained recovery evidence. */
|
|
243
|
+
receiptFingerprint: string;
|
|
244
|
+
localFingerprint: string;
|
|
245
|
+
localHeadOid: string;
|
|
246
|
+
localHeadRef: string | null;
|
|
247
|
+
localHeadTreeOid: string;
|
|
248
|
+
localIndexTreeOid: string;
|
|
249
|
+
localWorkingTreeOid: string;
|
|
250
|
+
rollback: WorktreePreviewRecoveryRollbackAction;
|
|
251
|
+
finalize: WorktreePreviewRecoveryFinalizeAction;
|
|
252
|
+
blocker?: WorktreeAcceptanceBlockerView;
|
|
253
|
+
}
|
|
254
|
+
export type WorktreePreviewRecoveryPreflightBlockedReason = 'not_owner' | 'not_preview_detached' | 'stale_target' | 'artifacts_missing' | 'checkout_unavailable' | 'git_error';
|
|
255
|
+
export type WorktreePreviewRecoveryPreflightView = {
|
|
256
|
+
status: 'assessed';
|
|
257
|
+
localModified: false;
|
|
258
|
+
proof: WorktreePreviewRecoveryProof;
|
|
259
|
+
} | {
|
|
260
|
+
status: 'blocked';
|
|
261
|
+
localModified: false;
|
|
262
|
+
checkoutId: string;
|
|
263
|
+
reviewId: string | null;
|
|
264
|
+
previewId: string | null;
|
|
265
|
+
revision: number;
|
|
266
|
+
reason: WorktreePreviewRecoveryPreflightBlockedReason;
|
|
267
|
+
message: string;
|
|
268
|
+
};
|
|
190
269
|
export interface SessionCheckoutRollbackPreviewOperation extends SessionCheckoutOperationBase {
|
|
191
270
|
action: 'rollback_preview';
|
|
192
271
|
/** Structured withdraw-and-continue flow returns to working instead of preserving the review. */
|
|
193
272
|
resumeRevision?: boolean;
|
|
273
|
+
/** Required only for preview_detached; it is context to re-verify, never bearer permission. */
|
|
274
|
+
recoveryProof?: WorktreePreviewRecoveryProof;
|
|
194
275
|
}
|
|
195
276
|
export interface SessionCheckoutFinalizePreviewOperation extends SessionCheckoutOperationBase {
|
|
196
277
|
action: 'finalize_preview';
|
|
197
278
|
commitMessage: string;
|
|
198
279
|
retention?: WorktreeRetentionMode;
|
|
280
|
+
/** Required only for preview_detached; it is context to re-verify, never bearer permission. */
|
|
281
|
+
recoveryProof?: WorktreePreviewRecoveryProof;
|
|
199
282
|
}
|
|
200
283
|
export interface SessionCheckoutRetryCleanupOperation extends SessionCheckoutOperationBase {
|
|
201
284
|
action: 'retry_cleanup';
|
|
@@ -208,7 +291,7 @@ export interface SessionCheckoutDiscardOperation extends SessionCheckoutOperatio
|
|
|
208
291
|
export interface SessionCheckoutRecoverOperation extends SessionCheckoutOperationBase {
|
|
209
292
|
action: 'recover';
|
|
210
293
|
}
|
|
211
|
-
export type SessionCheckoutOperation = SessionCheckoutApplyOperation | SessionCheckoutFinishOperation | SessionCheckoutPreviewOperation | SessionCheckoutRollbackPreviewOperation | SessionCheckoutFinalizePreviewOperation | SessionCheckoutRetryCleanupOperation | SessionCheckoutDiscardOperation | SessionCheckoutRecoverOperation;
|
|
294
|
+
export type SessionCheckoutOperation = SessionCheckoutApplyOperation | SessionCheckoutFinishOperation | SessionCheckoutPreviewOperation | SessionCheckoutCheckpointOperation | SessionCheckoutRollbackPreviewOperation | SessionCheckoutFinalizePreviewOperation | SessionCheckoutRetryCleanupOperation | SessionCheckoutDiscardOperation | SessionCheckoutRecoverOperation;
|
|
212
295
|
export interface SessionCheckoutAppliedResult {
|
|
213
296
|
status: 'applied';
|
|
214
297
|
target: SessionTargetView;
|
|
@@ -219,6 +302,12 @@ export interface SessionCheckoutPreviewedResult {
|
|
|
219
302
|
target: SessionTargetView;
|
|
220
303
|
changedFiles: string[];
|
|
221
304
|
}
|
|
305
|
+
export interface SessionCheckoutCheckpointedResult {
|
|
306
|
+
status: 'checkpointed';
|
|
307
|
+
target: SessionTargetView;
|
|
308
|
+
checkpoint: WorktreeCheckpointView;
|
|
309
|
+
changedFiles: string[];
|
|
310
|
+
}
|
|
222
311
|
export interface SessionCheckoutPreviewRolledBackResult {
|
|
223
312
|
status: 'preview_rolled_back';
|
|
224
313
|
target: SessionTargetView;
|
|
@@ -280,6 +369,8 @@ export interface ManagedWorktreeSummaryView {
|
|
|
280
369
|
phase: SessionCheckoutPhase;
|
|
281
370
|
dirty: boolean;
|
|
282
371
|
commitOid: string | null;
|
|
372
|
+
/** Number of saved managed-Worktree stages not yet delivered to Local. */
|
|
373
|
+
checkpointCount?: number;
|
|
283
374
|
retention?: Exclude<WorktreeRetentionMode, 'cleanup'>;
|
|
284
375
|
retainedAt?: number;
|
|
285
376
|
expiresAt?: number | null;
|
|
@@ -321,7 +412,7 @@ export interface SessionCheckoutOperationErrorResult {
|
|
|
321
412
|
message: string;
|
|
322
413
|
target?: SessionTargetView;
|
|
323
414
|
}
|
|
324
|
-
export type SessionCheckoutOperationResult = SessionCheckoutAppliedResult | SessionCheckoutPreviewedResult | SessionCheckoutPreviewRolledBackResult | SessionCheckoutPreviewDetachedResult | SessionCheckoutFinishedResult | SessionCheckoutConflictResult | SessionCheckoutDiscardedResult | SessionCheckoutRecoveredResult | SessionCheckoutOperationErrorResult;
|
|
415
|
+
export type SessionCheckoutOperationResult = SessionCheckoutAppliedResult | SessionCheckoutPreviewedResult | SessionCheckoutCheckpointedResult | SessionCheckoutPreviewRolledBackResult | SessionCheckoutPreviewDetachedResult | SessionCheckoutFinishedResult | SessionCheckoutConflictResult | SessionCheckoutDiscardedResult | SessionCheckoutRecoveredResult | SessionCheckoutOperationErrorResult;
|
|
325
416
|
export declare const SESSION_CHECKOUT_ERROR_CODES: readonly ["session_not_found", "project_not_found", "project_root_missing", "not_git_repository", "target_unselected", "target_already_bound", "project_mismatch", "checkout_missing", "checkout_mismatch", "recovery_required", "registry_corrupt", "git_operation_failed", "not_owner", "stale_target", "dirty_confirmation_required", "apply_conflict", "apply_failed", "invalid_input", "invalid_plan", "stale_local", "stale_isolated", "git_error", "commit_isolation_conflict", "checkout_limit_reached", "project_acceptance_busy", "operation_not_allowed", "preview_not_active", "preview_modified", "recovery_unsafe"];
|
|
326
417
|
export type SessionCheckoutErrorCode = typeof SESSION_CHECKOUT_ERROR_CODES[number];
|
|
327
418
|
export interface SessionCheckoutFailure {
|
package/lib/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgfH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,mBAAmB;IACnB,mBAAmB;IACnB,sBAAsB;IACtB,oBAAoB;IACpB,mBAAmB;IACnB,sBAAsB;IACtB,kBAAkB;IAClB,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,kBAAkB;IAClB,sBAAsB;IACtB,WAAW;IACX,cAAc;IACd,6BAA6B;IAC7B,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,cAAc;IACd,aAAa;IACb,gBAAgB;IAChB,WAAW;IACX,2BAA2B;IAC3B,wBAAwB;IACxB,yBAAyB;IACzB,uBAAuB;IACvB,oBAAoB;IACpB,kBAAkB;IAClB,iBAAiB;CACT,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-git-worktree",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Experimental Git worktree Session Targets for DeepSeek Harness with
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "Experimental Git worktree Session Targets for DeepSeek Harness with isolated sessions, review checkpoints, human-confirmed delivery, and safe recovery.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -76,14 +76,14 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@deepseek-ai/cordis": "4.0.1",
|
|
79
|
-
"@deepseek-ai/dsh-agent": "0.1.
|
|
80
|
-
"@deepseek-ai/dsh-commands": "0.1.
|
|
81
|
-
"@deepseek-ai/dsh-session": "0.1.
|
|
82
|
-
"@deepseek-ai/dsh-subprocess": "0.1.
|
|
83
|
-
"@deepseek-ai/dsh-system-prompt": "0.1.
|
|
84
|
-
"@deepseek-ai/dsh-tools": "0.1.
|
|
85
|
-
"@deepseek-ai/dsh-typert-protocol": "0.1.
|
|
86
|
-
"@deepseek-ai/dsh-typert-registry": "0.1.
|
|
79
|
+
"@deepseek-ai/dsh-agent": "0.1.1-rc.2",
|
|
80
|
+
"@deepseek-ai/dsh-commands": "0.1.1-rc.2",
|
|
81
|
+
"@deepseek-ai/dsh-session": "0.1.1-rc.2",
|
|
82
|
+
"@deepseek-ai/dsh-subprocess": "0.1.1-rc.2",
|
|
83
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.1-rc.2",
|
|
84
|
+
"@deepseek-ai/dsh-tools": "0.1.1-rc.2",
|
|
85
|
+
"@deepseek-ai/dsh-typert-protocol": "0.1.1-rc.2",
|
|
86
|
+
"@deepseek-ai/dsh-typert-registry": "0.1.1-rc.2",
|
|
87
87
|
"@deepseek-ai/schemastery": "3.18.1",
|
|
88
88
|
"zod": "4.4.3"
|
|
89
89
|
},
|
|
@@ -91,9 +91,9 @@
|
|
|
91
91
|
"react": "^18.2.0"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
|
-
"@deepseek-ai/dsh-api-gateway": "0.1.
|
|
95
|
-
"@deepseek-ai/dsh-client-connection": "0.1.
|
|
96
|
-
"@deepseek-ai/dsh-typert-loader": "0.1.
|
|
94
|
+
"@deepseek-ai/dsh-api-gateway": "0.1.1-rc.2",
|
|
95
|
+
"@deepseek-ai/dsh-client-connection": "0.1.1-rc.2",
|
|
96
|
+
"@deepseek-ai/dsh-typert-loader": "0.1.1-rc.2",
|
|
97
97
|
"@testing-library/react": "^16.3.2",
|
|
98
98
|
"@types/node": "^22.0.0",
|
|
99
99
|
"@types/react": "~18.3.31",
|
|
@@ -94,7 +94,7 @@ try {
|
|
|
94
94
|
if (hostContribution?.package !== manifest.name || hostContribution.face !== 'host') fail('./typert has invalid package/face identity')
|
|
95
95
|
if (remoteContribution?.package !== manifest.name) fail('./remote has invalid package identity')
|
|
96
96
|
if (hostContribution.invocations !== remoteContribution.descriptors) fail('./typert and ./remote must share one descriptor array instance')
|
|
97
|
-
const expectedRemoteMethods = ['current', 'list', 'create', 'inspect', 'reviewDiff', 'preflight', 'preview', 'resumeRevision', 'rollbackPreview', 'discard', 'finalize', 'finalizePreview', 'setRetention', 'retryCleanup', 'beginNextIteration']
|
|
97
|
+
const expectedRemoteMethods = ['current', 'list', 'create', 'inspect', 'reviewDiff', 'preflight', 'previewRecoveryPreflight', 'preparePreviewRecoveryAnalysis', 'createPreviewRecoveryHandoff', 'preview', 'checkpoint', 'resumeRevision', 'prepareReviewRegeneration', 'rollbackPreview', 'discard', 'finalize', 'finalizePreview', 'setRetention', 'retryCleanup', 'beginNextIteration']
|
|
98
98
|
if (JSON.stringify(hostContribution.invocations.map(value => value.method)) !== JSON.stringify(expectedRemoteMethods)) {
|
|
99
99
|
fail(`manual Remote methods differ from the required surface: ${hostContribution.invocations.map(value => value.method).join(', ')}`)
|
|
100
100
|
}
|