dsh-git-worktree 0.1.2 → 0.3.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 +93 -0
- package/LICENSE +21 -21
- package/README.md +187 -43
- package/README.zh.md +187 -41
- package/cordis.patch.yml +7 -7
- package/lib/adapters/lookup.d.ts +4 -2
- package/lib/adapters/lookup.js +31 -3
- package/lib/adapters/lookup.js.map +1 -1
- package/lib/adapters/registry.js +41 -0
- package/lib/adapters/registry.js.map +1 -1
- package/lib/adapters/safe-file.js +34 -4
- package/lib/adapters/safe-file.js.map +1 -1
- package/lib/client/WorktreeCreateRow.d.ts +7 -0
- package/lib/client/WorktreeCreateRow.js +26 -0
- package/lib/client/WorktreeCreateRow.js.map +1 -0
- package/lib/client/WorktreeReviewRow.d.ts +11 -0
- package/lib/client/WorktreeReviewRow.js +67 -0
- package/lib/client/WorktreeReviewRow.js.map +1 -0
- package/lib/client/actions.d.ts +86 -0
- package/lib/client/actions.js +35 -0
- package/lib/client/actions.js.map +1 -0
- package/lib/client/console-remote/adapter.d.ts +3 -0
- package/lib/client/console-remote/adapter.js +61 -0
- package/lib/client/console-remote/adapter.js.map +1 -0
- package/lib/client/console-remote/index.d.ts +18 -0
- package/lib/client/console-remote/index.js +17 -0
- package/lib/client/console-remote/index.js.map +1 -0
- package/lib/client/index.d.ts +17 -0
- package/lib/client/index.js +44 -0
- package/lib/client/index.js.map +1 -0
- package/lib/client/model.d.ts +68 -0
- package/lib/client/model.js +127 -0
- package/lib/client/model.js.map +1 -0
- package/lib/client/pre-session/PreSessionWorktreeToggle.d.ts +16 -0
- package/lib/client/pre-session/PreSessionWorktreeToggle.js +128 -0
- package/lib/client/pre-session/PreSessionWorktreeToggle.js.map +1 -0
- package/lib/client/pre-session/controller.d.ts +42 -0
- package/lib/client/pre-session/controller.js +149 -0
- package/lib/client/pre-session/controller.js.map +1 -0
- package/lib/client/pre-session/index.d.ts +15 -0
- package/lib/client/pre-session/index.js +16 -0
- package/lib/client/pre-session/index.js.map +1 -0
- package/lib/client/review-console/ReviewActions.d.ts +15 -0
- package/lib/client/review-console/ReviewActions.js +234 -0
- package/lib/client/review-console/ReviewActions.js.map +1 -0
- package/lib/client/review-console/WorktreeReviewPanel.d.ts +20 -0
- package/lib/client/review-console/WorktreeReviewPanel.js +75 -0
- package/lib/client/review-console/WorktreeReviewPanel.js.map +1 -0
- package/lib/client/review-console/index.d.ts +8 -0
- package/lib/client/review-console/index.js +22 -0
- package/lib/client/review-console/index.js.map +1 -0
- package/lib/client/review-console/review-console.styles.d.ts +1 -0
- package/lib/client/review-console/review-console.styles.js +81 -0
- package/lib/client/review-console/review-console.styles.js.map +1 -0
- package/lib/client/review-console/status-events.d.ts +3 -0
- package/lib/client/review-console/status-events.js +6 -0
- package/lib/client/review-console/status-events.js.map +1 -0
- package/lib/client/styles.d.ts +1 -0
- package/lib/client/styles.js +78 -0
- package/lib/client/styles.js.map +1 -0
- package/lib/client/target-console/TargetStatusAction.d.ts +7 -0
- package/lib/client/target-console/TargetStatusAction.js +46 -0
- package/lib/client/target-console/TargetStatusAction.js.map +1 -0
- package/lib/client/target-console/WorktreeConsoleView.d.ts +9 -0
- package/lib/client/target-console/WorktreeConsoleView.js +362 -0
- package/lib/client/target-console/WorktreeConsoleView.js.map +1 -0
- package/lib/client/target-console/WorktreeReviewStatus.d.ts +9 -0
- package/lib/client/target-console/WorktreeReviewStatus.js +125 -0
- package/lib/client/target-console/WorktreeReviewStatus.js.map +1 -0
- package/lib/client/target-console/index.d.ts +14 -0
- package/lib/client/target-console/index.js +23 -0
- package/lib/client/target-console/index.js.map +1 -0
- package/lib/client/target-console/target-console.styles.d.ts +1 -0
- package/lib/client/target-console/target-console.styles.js +130 -0
- package/lib/client/target-console/target-console.styles.js.map +1 -0
- package/lib/client.js +6902 -0
- package/lib/commands.d.ts +2 -4
- package/lib/commands.js +69 -28
- package/lib/commands.js.map +1 -1
- package/lib/console-contract.d.ts +253 -0
- package/lib/console-contract.js +86 -0
- package/lib/console-contract.js.map +1 -0
- package/lib/console-host/control-plane.d.ts +31 -0
- package/lib/console-host/control-plane.js +502 -0
- package/lib/console-host/control-plane.js.map +1 -0
- package/lib/console-host/errors.d.ts +6 -0
- package/lib/console-host/errors.js +31 -0
- package/lib/console-host/errors.js.map +1 -0
- package/lib/console-host/projection.d.ts +12 -0
- package/lib/console-host/projection.js +136 -0
- package/lib/console-host/projection.js.map +1 -0
- package/lib/console-host/review-diff.d.ts +18 -0
- package/lib/console-host/review-diff.js +176 -0
- package/lib/console-host/review-diff.js.map +1 -0
- package/lib/console-host/service.d.ts +26 -0
- package/lib/console-host/service.js +143 -0
- package/lib/console-host/service.js.map +1 -0
- package/lib/console-remote/descriptors.d.ts +3 -0
- package/lib/console-remote/descriptors.js +105 -0
- package/lib/console-remote/descriptors.js.map +1 -0
- package/lib/console-remote/remote.d.ts +29 -0
- package/lib/console-remote/remote.js +4 -0
- package/lib/console-remote/remote.js.map +1 -0
- package/lib/console-remote/schemas.d.ts +29 -0
- package/lib/console-remote/schemas.js +145 -0
- package/lib/console-remote/schemas.js.map +1 -0
- package/lib/console-remote/typert.d.ts +3 -0
- package/lib/console-remote/typert.js +14 -0
- package/lib/console-remote/typert.js.map +1 -0
- package/lib/index.d.ts +26 -8
- package/lib/index.js +28 -10
- package/lib/index.js.map +1 -1
- package/lib/managed-worktree-path.d.ts +14 -13
- package/lib/managed-worktree-path.js +32 -22
- package/lib/managed-worktree-path.js.map +1 -1
- package/lib/ports.d.ts +39 -1
- package/lib/session-checkout-apply.d.ts +54 -1
- package/lib/session-checkout-apply.js +318 -28
- package/lib/session-checkout-apply.js.map +1 -1
- package/lib/session-checkout-module.js +1098 -36
- package/lib/session-checkout-module.js.map +1 -1
- package/lib/session-target-context.d.ts +6 -0
- package/lib/session-target-context.js +16 -0
- package/lib/session-target-context.js.map +1 -0
- package/lib/tools.d.ts +6 -6
- package/lib/tools.js +107 -218
- package/lib/tools.js.map +1 -1
- package/lib/types.d.ts +57 -11
- package/lib/types.js +6 -6
- package/lib/types.js.map +1 -1
- package/package.json +116 -69
- package/scripts/check-publish.mjs +193 -0
- package/scripts/clean-lib.mjs +7 -0
- package/scripts/dev-dsh-lib.mjs +509 -0
- package/scripts/dev-dsh.mjs +95 -0
- package/scripts/dsh-source-runner.mjs +14 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { WorktreeReviewPanel } from './WorktreeReviewPanel.js';
|
|
2
|
+
/** Project one persisted review into the shared compact card/dock evidence shape. */
|
|
3
|
+
export function reviewEvidenceFromTarget(target, detailsMarkdown) {
|
|
4
|
+
if (!target.review)
|
|
5
|
+
return null;
|
|
6
|
+
return {
|
|
7
|
+
...target.review,
|
|
8
|
+
...(detailsMarkdown ? { detailsMarkdown } : {}),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/** Build the exact CAS identity required by Finalize and advanced review reads. */
|
|
12
|
+
export function reviewIdentityFromTarget(sessionId, target) {
|
|
13
|
+
if (!target.checkoutId || !target.review)
|
|
14
|
+
return null;
|
|
15
|
+
return {
|
|
16
|
+
sessionId,
|
|
17
|
+
checkoutId: target.checkoutId,
|
|
18
|
+
expectedRevision: target.revision,
|
|
19
|
+
expectedReviewId: target.review.reviewId,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/review-console/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAO9D,qFAAqF;AACrF,MAAM,UAAU,wBAAwB,CACtC,MAAoC,EACpC,eAAwB;IAExB,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IAC/B,OAAO;QACL,GAAG,MAAM,CAAC,MAAM;QAChB,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChD,CAAA;AACH,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,wBAAwB,CACtC,SAAiB,EACjB,MAAoC;IAEpC,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IACrD,OAAO;QACL,SAAS;QACT,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,gBAAgB,EAAE,MAAM,CAAC,QAAQ;QACjC,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ;KACzC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const REVIEW_CONSOLE_STYLES: string;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export const REVIEW_CONSOLE_STYLES = String.raw `
|
|
2
|
+
.dsh-wt-review-panel,
|
|
3
|
+
.dsh-wt-review-dock {
|
|
4
|
+
--wt-ink: color-mix(in srgb, currentColor 92%, transparent);
|
|
5
|
+
--wt-muted: color-mix(in srgb, currentColor 58%, transparent);
|
|
6
|
+
--wt-line: color-mix(in srgb, currentColor 14%, transparent);
|
|
7
|
+
--wt-panel: color-mix(in srgb, currentColor 4%, transparent);
|
|
8
|
+
--wt-green: #2f8f64;
|
|
9
|
+
--wt-amber: #b46a13;
|
|
10
|
+
--wt-red: #bd3b3b;
|
|
11
|
+
}
|
|
12
|
+
.dsh-wt-review-panel { display:grid; min-width:0; }
|
|
13
|
+
.dsh-wt-review-compact-head { display:flex; align-items:flex-start; gap:10px; min-width:0; padding:12px 14px 8px; }
|
|
14
|
+
.dsh-wt-review-status-icon,
|
|
15
|
+
.dsh-wt-review-dock-icon { display:inline-grid; place-items:center; width:18px; height:18px; flex:0 0 auto; border-radius:999px; background:color-mix(in srgb, var(--wt-green) 14%, transparent); color:var(--wt-green); font-size:12px; font-weight:800; }
|
|
16
|
+
.dsh-wt-review-status-icon[data-validation="failed"],
|
|
17
|
+
.dsh-wt-review-status-icon[data-validation="partial"] { background:color-mix(in srgb, var(--wt-amber) 14%, transparent); color:var(--wt-amber); }
|
|
18
|
+
.dsh-wt-review-compact-copy { min-width:0; flex:1; }
|
|
19
|
+
.dsh-wt-review-title { margin:0; min-width:0; font-size:14px; line-height:1.35; overflow-wrap:anywhere; }
|
|
20
|
+
.dsh-wt-review-summary { margin:3px 0 0; color:var(--wt-muted); line-height:1.45; overflow-wrap:anywhere; }
|
|
21
|
+
.dsh-wt-review-identity { flex:0 1 auto; max-width:34%; color:var(--wt-muted); font-size:10px; text-align:right; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
22
|
+
.dsh-wt-review-meta { display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; padding:0 14px 10px 42px; color:var(--wt-muted); font-size:11px; }
|
|
23
|
+
.dsh-wt-review-meta [data-validation="passed"] { color:var(--wt-green); }
|
|
24
|
+
.dsh-wt-review-meta [data-validation="failed"],
|
|
25
|
+
.dsh-wt-review-meta [data-validation="partial"] { color:var(--wt-amber); }
|
|
26
|
+
.dsh-wt-review-details-toggle { border:0; padding:0; background:transparent; color:inherit; font:inherit; cursor:pointer; }
|
|
27
|
+
.dsh-wt-review-details-toggle:hover { color:var(--wt-ink); }
|
|
28
|
+
.dsh-wt-review-details-toggle:focus-visible,
|
|
29
|
+
.dsh-wt-more-trigger:focus-visible { outline:2px solid #5a8dee; outline-offset:2px; }
|
|
30
|
+
.dsh-wt-review-validation-details { margin:0 14px 10px 42px; padding:9px 10px; border-radius:8px; background:var(--wt-panel); font-size:11px; }
|
|
31
|
+
.dsh-wt-review-validation-details > p { margin:0 0 7px; }
|
|
32
|
+
.dsh-wt-test-list { list-style:none; padding:0; margin:0; display:grid; gap:6px; }
|
|
33
|
+
.dsh-wt-test { display:grid; grid-template-columns:auto minmax(0, 1fr); gap:7px; align-items:start; }
|
|
34
|
+
.dsh-wt-test-state { color:var(--wt-muted); font-size:10px; padding-top:2px; }
|
|
35
|
+
.dsh-wt-test-state[data-test-status="passed"] { color:var(--wt-green); }
|
|
36
|
+
.dsh-wt-test-state[data-test-status="failed"] { color:var(--wt-amber); }
|
|
37
|
+
.dsh-wt-test-command { display:grid; gap:2px; min-width:0; overflow-wrap:anywhere; }
|
|
38
|
+
.dsh-wt-test-summary { color:var(--wt-muted); overflow-wrap:anywhere; }
|
|
39
|
+
.dsh-wt-review-actions { padding:0 14px 12px 42px; }
|
|
40
|
+
.dsh-wt-more-menu { position:relative; }
|
|
41
|
+
.dsh-wt-more-trigger { display:grid; place-items:center; width:32px; height:30px; border:1px solid var(--wt-line); border-radius:8px; cursor:pointer; list-style:none; font-weight:800; letter-spacing:1px; }
|
|
42
|
+
.dsh-wt-more-trigger::-webkit-details-marker { display:none; }
|
|
43
|
+
.dsh-wt-more-content { position:absolute; right:0; bottom:calc(100% + 6px); z-index:40; min-width:150px; padding:4px; border:1px solid var(--wt-line); border-radius:9px; background:Canvas; box-shadow:0 10px 30px color-mix(in srgb, black 18%, transparent); }
|
|
44
|
+
.dsh-wt-more-item { width:100%; border:0; border-radius:6px; padding:7px 9px; background:transparent; color:inherit; text-align:left; font:inherit; cursor:pointer; }
|
|
45
|
+
.dsh-wt-more-item:hover:not(:disabled) { background:color-mix(in srgb, currentColor 7%, transparent); }
|
|
46
|
+
.dsh-wt-more-item:disabled { opacity:.5; cursor:not-allowed; }
|
|
47
|
+
.dsh-wt-danger { color:var(--wt-red); border-color:color-mix(in srgb, var(--wt-red) 45%, transparent); }
|
|
48
|
+
.dsh-wt-danger-text { color:var(--wt-red); }
|
|
49
|
+
.dsh-wt-modal-footer { display:flex; justify-content:flex-end; gap:8px; }
|
|
50
|
+
.dsh-wt-commit-dialog { display:grid; gap:8px; }
|
|
51
|
+
.dsh-wt-commit-dialog > label:first-child { font-size:12px; font-weight:700; }
|
|
52
|
+
.dsh-wt-commit-dialog textarea { min-height:132px; max-height:240px; resize:vertical; border:1px solid var(--wt-line); border-radius:8px; padding:9px 10px; background:transparent; color:inherit; font:12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
|
|
53
|
+
.dsh-wt-character-count { color:var(--wt-muted); font-size:10px; text-align:right; }
|
|
54
|
+
.dsh-wt-retention-check { display:flex; align-items:center; gap:8px; border:1px solid var(--wt-line); border-radius:8px; padding:8px 9px; font-size:12px; }
|
|
55
|
+
.dsh-wt-retention-select { display:grid; gap:5px; padding:9px; border-radius:8px; background:var(--wt-panel); font-size:11px; }
|
|
56
|
+
.dsh-wt-retention-select select { min-height:32px; border:1px solid var(--wt-line); border-radius:7px; padding:0 8px; background:Canvas; color:inherit; }
|
|
57
|
+
.dsh-wt-preflight { margin-top:7px; padding:7px 9px; border-radius:8px; background:var(--wt-panel); color:var(--wt-muted); font-size:11px; }
|
|
58
|
+
.dsh-wt-preflight[data-preflight="conflict"],
|
|
59
|
+
.dsh-wt-preflight[data-preflight="blocked"] { color:var(--wt-amber); }
|
|
60
|
+
.dsh-wt-action-status { min-height:1.35em; margin-top:7px; color:var(--wt-muted); font-size:11px; }
|
|
61
|
+
.dsh-wt-review-dock { box-sizing:border-box; display:flex; flex:none; align-items:center; gap:9px; width:calc(100% - 2 * var(--dsh-composer-side-clearance, 16px) - 2 * var(--dsh-composer-dock-inset, 0px)); max-width:calc(var(--dsh-composer-card-max-width, 780px) - 2 * var(--dsh-composer-dock-inset, 0px)); margin:0 auto 8px; padding:7px 9px; border:1px solid color-mix(in srgb, #3275db 22%, transparent); border-radius:9px; background:color-mix(in srgb, #3275db 6%, transparent); color:var(--wt-ink); font-size:12px; }
|
|
62
|
+
.dsh-wt-review-dock-copy { display:grid; min-width:0; flex:1; gap:1px; }
|
|
63
|
+
.dsh-wt-review-dock-copy strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
64
|
+
.dsh-wt-review-dock-copy span { color:var(--wt-muted); font-size:10px; }
|
|
65
|
+
.dsh-wt-review-dock .dsh-wt-review-actions { padding:0; }
|
|
66
|
+
.dsh-wt-review-dock .dsh-wt-action-status { display:none; }
|
|
67
|
+
.dsh-wt-review-dock .dsh-wt-button { padding:5px 9px; font-size:11px; }
|
|
68
|
+
.dsh-wt-review-dock .dsh-wt-more-trigger { width:29px; height:27px; }
|
|
69
|
+
@media (max-width: 620px) {
|
|
70
|
+
.dsh-wt-review-compact-head { flex-wrap:wrap; }
|
|
71
|
+
.dsh-wt-review-identity { max-width:100%; margin-left:28px; }
|
|
72
|
+
.dsh-wt-review-meta,
|
|
73
|
+
.dsh-wt-review-validation-details,
|
|
74
|
+
.dsh-wt-review-actions { margin-left:0; padding-left:14px; }
|
|
75
|
+
.dsh-wt-review-dock { flex-wrap:wrap; width:calc(100% - 2 * var(--dsh-composer-side-clearance, 12px) - 2 * var(--dsh-composer-dock-inset, 0px)); }
|
|
76
|
+
.dsh-wt-review-dock-copy { flex-basis:calc(100% - 28px); }
|
|
77
|
+
.dsh-wt-review-dock-copy span { display:none; }
|
|
78
|
+
.dsh-wt-review-dock .dsh-wt-review-actions { margin-left:auto; }
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
//# sourceMappingURL=review-console.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-console.styles.js","sourceRoot":"","sources":["../../../src/client/review-console/review-console.styles.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+E9C,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const WORKTREE_REVIEW_REFRESH_EVENT = 'dsh-git-worktree:review-refresh';
|
|
2
|
+
/** Notify all mounted review surfaces to re-read the Host-authoritative target. */
|
|
3
|
+
export function requestWorktreeReviewRefresh(sessionId) {
|
|
4
|
+
window.dispatchEvent(new CustomEvent(WORKTREE_REVIEW_REFRESH_EVENT, { detail: { sessionId } }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=status-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-events.js","sourceRoot":"","sources":["../../../src/client/review-console/status-events.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,GAAG,iCAAiC,CAAA;AAE9E,mFAAmF;AACnF,MAAM,UAAU,4BAA4B,CAAC,SAAiB;IAC5D,MAAM,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,6BAA6B,EAAE,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAA;AACjG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const WORKTREE_STYLES: string;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { REVIEW_CONSOLE_STYLES } from './review-console/review-console.styles.js';
|
|
2
|
+
export const WORKTREE_STYLES = String.raw `
|
|
3
|
+
.dsh-wt-card {
|
|
4
|
+
--wt-ink: color-mix(in srgb, currentColor 92%, transparent);
|
|
5
|
+
--wt-muted: color-mix(in srgb, currentColor 58%, transparent);
|
|
6
|
+
--wt-line: color-mix(in srgb, currentColor 14%, transparent);
|
|
7
|
+
--wt-panel: color-mix(in srgb, currentColor 4%, transparent);
|
|
8
|
+
--wt-green: #2f8f64;
|
|
9
|
+
--wt-amber: #b46a13;
|
|
10
|
+
--wt-red: #bd3b3b;
|
|
11
|
+
margin: 6px 0;
|
|
12
|
+
border: 1px solid var(--wt-line);
|
|
13
|
+
border-radius: 12px;
|
|
14
|
+
background: linear-gradient(145deg, color-mix(in srgb, currentColor 2%, transparent), transparent 45%);
|
|
15
|
+
color: var(--wt-ink);
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
font-size: 13px;
|
|
18
|
+
}
|
|
19
|
+
.dsh-wt-head { display:flex; align-items:center; gap:10px; padding:10px 12px; min-width:0; }
|
|
20
|
+
.dsh-wt-mark { width:9px; height:9px; flex:0 0 auto; border-radius:999px; background:var(--wt-green); box-shadow:0 0 0 4px color-mix(in srgb, var(--wt-green) 14%, transparent); }
|
|
21
|
+
.dsh-wt-card[data-state="running"] .dsh-wt-mark { background:var(--wt-amber); animation:dsh-wt-pulse 1.4s ease-in-out infinite; }
|
|
22
|
+
.dsh-wt-card[data-state="error"] .dsh-wt-mark { background:var(--wt-red); box-shadow:0 0 0 4px color-mix(in srgb, var(--wt-red) 14%, transparent); }
|
|
23
|
+
@keyframes dsh-wt-pulse { 50% { opacity:.35; transform:scale(.82); } }
|
|
24
|
+
@media (prefers-reduced-motion: reduce) { .dsh-wt-card[data-state="running"] .dsh-wt-mark { animation:none; } }
|
|
25
|
+
.dsh-wt-title { font-weight:650; letter-spacing:-.01em; white-space:nowrap; }
|
|
26
|
+
.dsh-wt-subtitle { color:var(--wt-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
|
|
27
|
+
.dsh-wt-spacer { flex:1; }
|
|
28
|
+
.dsh-wt-body { border-top:1px solid var(--wt-line); padding:12px; display:grid; gap:11px; background:var(--wt-panel); }
|
|
29
|
+
.dsh-wt-grid { display:grid; grid-template-columns:minmax(90px, .35fr) minmax(0, 1fr); gap:7px 12px; }
|
|
30
|
+
.dsh-wt-label { color:var(--wt-muted); }
|
|
31
|
+
.dsh-wt-value { min-width:0; overflow-wrap:anywhere; }
|
|
32
|
+
.dsh-wt-code { font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:12px; }
|
|
33
|
+
.dsh-wt-path { border:0; padding:0; color:inherit; text-align:left; background:none; cursor:pointer; text-decoration:underline; text-decoration-color:color-mix(in srgb, currentColor 28%, transparent); text-underline-offset:3px; }
|
|
34
|
+
.dsh-wt-path:hover { text-decoration-color:currentColor; }
|
|
35
|
+
.dsh-wt-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
|
|
36
|
+
.dsh-wt-button { border:1px solid var(--wt-line); border-radius:8px; padding:7px 11px; background:transparent; color:inherit; font:inherit; font-weight:600; cursor:pointer; transition:background .15s ease, border-color .15s ease, transform .15s ease; }
|
|
37
|
+
.dsh-wt-button:hover:not(:disabled) { background:color-mix(in srgb, currentColor 7%, transparent); border-color:color-mix(in srgb, currentColor 28%, transparent); }
|
|
38
|
+
.dsh-wt-button:active:not(:disabled) { transform:translateY(1px); }
|
|
39
|
+
.dsh-wt-button:focus-visible, .dsh-wt-path:focus-visible, .dsh-wt-summary:focus-visible { outline:2px solid #5a8dee; outline-offset:2px; }
|
|
40
|
+
.dsh-wt-button:disabled { opacity:.52; cursor:wait; }
|
|
41
|
+
.dsh-wt-primary { background:#2257d7; color:white; border-color:#2257d7; }
|
|
42
|
+
.dsh-wt-primary:hover:not(:disabled) { background:#1848bd; border-color:#1848bd; }
|
|
43
|
+
.dsh-wt-error { color:var(--wt-red); line-height:1.45; overflow-wrap:anywhere; }
|
|
44
|
+
.dsh-wt-status { color:var(--wt-muted); }
|
|
45
|
+
.dsh-wt-badge { display:inline-flex; align-items:center; border:1px solid var(--wt-line); border-radius:999px; padding:2px 7px; font-size:11px; font-weight:650; text-transform:uppercase; letter-spacing:.04em; }
|
|
46
|
+
.dsh-wt-badge[data-validation="passed"] { color:var(--wt-green); }
|
|
47
|
+
.dsh-wt-badge[data-validation="failed"] { color:var(--wt-red); }
|
|
48
|
+
.dsh-wt-badge[data-validation="partial"] { color:var(--wt-amber); }
|
|
49
|
+
.dsh-wt-files { display:flex; flex-wrap:wrap; gap:5px; }
|
|
50
|
+
.dsh-wt-file { border:1px solid var(--wt-line); border-radius:6px; padding:3px 6px; font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:11px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
51
|
+
.dsh-wt-commit { margin:0; padding:9px 10px; max-height:150px; overflow:auto; border:1px solid var(--wt-line); border-radius:8px; background:color-mix(in srgb, currentColor 3%, transparent); white-space:pre-wrap; overflow-wrap:anywhere; }
|
|
52
|
+
.dsh-wt-details { border-top:1px solid var(--wt-line); padding-top:9px; }
|
|
53
|
+
.dsh-wt-summary { cursor:pointer; color:var(--wt-muted); font-weight:600; }
|
|
54
|
+
.dsh-wt-test-list { list-style:none; padding:7px 0 0; margin:0; display:grid; gap:6px; }
|
|
55
|
+
.dsh-wt-test { display:grid; grid-template-columns:auto minmax(0, 1fr); gap:7px; align-items:start; }
|
|
56
|
+
.dsh-wt-test-state { color:var(--wt-muted); font-size:11px; text-transform:uppercase; padding-top:2px; }
|
|
57
|
+
.dsh-wt-test-command { overflow-wrap:anywhere; }
|
|
58
|
+
.dsh-wt-retain { position:relative; }
|
|
59
|
+
.dsh-wt-retain[open] > .dsh-wt-summary { margin-bottom:7px; }
|
|
60
|
+
.dsh-wt-retain-actions { display:flex; gap:6px; flex-wrap:wrap; }
|
|
61
|
+
.dsh-wt-visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
|
|
62
|
+
.dsh-wt-pre-session { position:relative; display:inline-flex; align-items:center; min-width:0; }
|
|
63
|
+
.dsh-wt-pre-session-switch { display:inline-flex; align-items:center; gap:6px; min-height:28px; padding:3px 7px; border:0; border-radius:7px; background:transparent; color:inherit; font:inherit; font-size:12px; font-weight:600; cursor:pointer; white-space:nowrap; transition:background .15s ease, opacity .15s ease; }
|
|
64
|
+
.dsh-wt-pre-session-switch:hover:not(:disabled) { background:color-mix(in srgb, currentColor 7%, transparent); }
|
|
65
|
+
.dsh-wt-pre-session-switch:focus-visible { outline:2px solid #5a8dee; outline-offset:1px; }
|
|
66
|
+
.dsh-wt-pre-session-switch:disabled { cursor:default; opacity:.72; }
|
|
67
|
+
.dsh-wt-pre-session-check { display:inline-grid; place-items:center; width:14px; height:14px; border:1px solid color-mix(in srgb, currentColor 42%, transparent); border-radius:3px; background:color-mix(in srgb, currentColor 3%, transparent); font-size:10px; line-height:1; }
|
|
68
|
+
.dsh-wt-pre-session-switch[aria-checked="true"] .dsh-wt-pre-session-check { border-color:#2f8f64; background:#2f8f64; color:white; }
|
|
69
|
+
.dsh-wt-pre-session-state { padding:2px 6px; border-radius:999px; background:color-mix(in srgb, currentColor 7%, transparent); color:color-mix(in srgb, currentColor 60%, transparent); font-size:10px; font-weight:650; }
|
|
70
|
+
.dsh-wt-pre-session[data-state="preparing"] .dsh-wt-pre-session-state { color:#b46a13; }
|
|
71
|
+
.dsh-wt-pre-session[data-state="error"] .dsh-wt-pre-session-state { color:#bd3b3b; }
|
|
72
|
+
.dsh-wt-pre-session-error { position:absolute; left:0; bottom:calc(100% + 7px); z-index:20; width:max-content; max-width:min(360px, 75vw); padding:7px 9px; border:1px solid color-mix(in srgb, #bd3b3b 35%, transparent); border-radius:8px; background:color-mix(in srgb, Canvas 96%, #bd3b3b 4%); color:#bd3b3b; font-size:11px; font-weight:500; line-height:1.4; white-space:normal; box-shadow:0 8px 24px color-mix(in srgb, black 14%, transparent); }
|
|
73
|
+
|
|
74
|
+
.dsh-wt-pre-session-note { margin:0; color:color-mix(in srgb, currentColor 62%, transparent); font-size:12px; line-height:1.5; }
|
|
75
|
+
@media (max-width: 560px) { .dsh-wt-grid { grid-template-columns:1fr; gap:3px; } .dsh-wt-label { margin-top:4px; } .dsh-wt-pre-session-state { display:none; } }
|
|
76
|
+
${REVIEW_CONSOLE_STYLES}
|
|
77
|
+
`;
|
|
78
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/client/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAA;AAEjF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0EvC,qBAAqB;CACtB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WorktreeConsoleAdapter } from '../../console-contract.js';
|
|
2
|
+
export interface TargetStatusActionProps {
|
|
3
|
+
sessionId: string;
|
|
4
|
+
adapter: WorktreeConsoleAdapter;
|
|
5
|
+
}
|
|
6
|
+
/** Read-only Session Target capsule. The Harness header slot exposes no public view-switch action. */
|
|
7
|
+
export declare function TargetStatusAction({ sessionId, adapter }: TargetStatusActionProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useLayoutEffect, useState } from 'react';
|
|
3
|
+
const STATE_LABELS = {
|
|
4
|
+
local: 'Local',
|
|
5
|
+
creating: '创建中…',
|
|
6
|
+
working: 'Worktree',
|
|
7
|
+
ready_for_review: '待验收',
|
|
8
|
+
preview_active: 'Local 验收中',
|
|
9
|
+
preview_detached: '预览待恢复',
|
|
10
|
+
retained: '已保留',
|
|
11
|
+
cleanup_pending: '清理中',
|
|
12
|
+
recovery_required: '需要恢复',
|
|
13
|
+
delivered: '已交付',
|
|
14
|
+
};
|
|
15
|
+
/** Read-only Session Target capsule. The Harness header slot exposes no public view-switch action. */
|
|
16
|
+
export function TargetStatusAction({ sessionId, adapter }) {
|
|
17
|
+
const [state, setState] = useState('loading');
|
|
18
|
+
const [target, setTarget] = useState(null);
|
|
19
|
+
useLayoutEffect(() => {
|
|
20
|
+
let active = true;
|
|
21
|
+
setState('loading');
|
|
22
|
+
setTarget(null);
|
|
23
|
+
void adapter.current({ sessionId }).then((outcome) => {
|
|
24
|
+
if (!active)
|
|
25
|
+
return;
|
|
26
|
+
if (outcome.ok) {
|
|
27
|
+
setTarget(outcome.value.target);
|
|
28
|
+
setState(outcome.value.target.state);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
setState('error');
|
|
32
|
+
}
|
|
33
|
+
}, () => {
|
|
34
|
+
if (active)
|
|
35
|
+
setState('error');
|
|
36
|
+
});
|
|
37
|
+
return () => { active = false; };
|
|
38
|
+
}, [adapter, sessionId]);
|
|
39
|
+
const label = state === 'loading' ? '加载中…' : state === 'error' ? '不可用' : STATE_LABELS[state];
|
|
40
|
+
const expiry = state === 'retained' && target?.expiresAt
|
|
41
|
+
? new Date(target.expiresAt).toLocaleDateString()
|
|
42
|
+
: null;
|
|
43
|
+
const accessibleLabel = expiry === null ? `Session Target:${label}` : `Session Target:${label},到期 ${expiry}`;
|
|
44
|
+
return (_jsxs("span", { className: "dsh-wtc-target-chip", "data-target-state": state, role: "status", "aria-live": "polite", "aria-label": accessibleLabel, title: "Session Target \u72B6\u6001", children: [_jsx("span", { className: "dsh-wtc-target-dot", "aria-hidden": true }), label, expiry ? _jsxs("span", { className: "dsh-wtc-target-expiry", children: ["\u00B7 ", expiry] }) : null] }));
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=TargetStatusAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TargetStatusAction.js","sourceRoot":"","sources":["../../../src/client/target-console/TargetStatusAction.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAYjD,MAAM,YAAY,GAA+C;IAC/D,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,UAAU;IACnB,gBAAgB,EAAE,KAAK;IACvB,cAAc,EAAE,WAAW;IAC3B,gBAAgB,EAAE,OAAO;IACzB,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,KAAK;IACtB,iBAAiB,EAAE,MAAM;IACzB,SAAS,EAAE,KAAK;CACjB,CAAA;AAED,sGAAsG;AACtG,MAAM,UAAU,kBAAkB,CAAC,EAAE,SAAS,EAAE,OAAO,EAA2B;IAChF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAmD,SAAS,CAAC,CAAA;IAC/F,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAsC,IAAI,CAAC,CAAA;IAE/E,eAAe,CAAC,GAAG,EAAE;QACnB,IAAI,MAAM,GAAG,IAAI,CAAA;QACjB,QAAQ,CAAC,SAAS,CAAC,CAAA;QACnB,SAAS,CAAC,IAAI,CAAC,CAAA;QACf,KAAK,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;YACnD,IAAI,CAAC,MAAM;gBAAE,OAAM;YACnB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;gBACf,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;gBAC/B,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YACtC,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,OAAO,CAAC,CAAA;YACnB,CAAC;QACH,CAAC,EAAE,GAAG,EAAE;YACN,IAAI,MAAM;gBAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;QAC/B,CAAC,CAAC,CAAA;QACF,OAAO,GAAG,EAAE,GAAG,MAAM,GAAG,KAAK,CAAA,CAAC,CAAC,CAAA;IACjC,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAA;IAExB,MAAM,KAAK,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;IAC5F,MAAM,MAAM,GAAG,KAAK,KAAK,UAAU,IAAI,MAAM,EAAE,SAAS;QACtD,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,kBAAkB,EAAE;QACjD,CAAC,CAAC,IAAI,CAAA;IACR,MAAM,eAAe,GAAG,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,kBAAkB,KAAK,EAAE,CAAC,CAAC,CAAC,kBAAkB,KAAK,OAAO,MAAM,EAAE,CAAA;IAC5G,OAAO,CACL,gBACE,SAAS,EAAC,qBAAqB,uBACZ,KAAK,EACxB,IAAI,EAAC,QAAQ,eACH,QAAQ,gBACN,eAAe,EAC3B,KAAK,EAAC,6BAAmB,aAEzB,eAAM,SAAS,EAAC,oBAAoB,wBAAe,EAClD,KAAK,EACL,MAAM,CAAC,CAAC,CAAC,gBAAM,SAAS,EAAC,uBAAuB,wBAAI,MAAM,IAAQ,CAAC,CAAC,CAAC,IAAI,IACrE,CACR,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type WorktreeConsoleAdapter } from '../../console-contract.js';
|
|
2
|
+
import { type WorktreeClientServices } from '../actions.js';
|
|
3
|
+
export interface WorktreeConsoleViewProps {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
adapter: WorktreeConsoleAdapter;
|
|
6
|
+
services: WorktreeClientServices;
|
|
7
|
+
}
|
|
8
|
+
/** Project-scoped Worktree management surface backed only by WorktreeConsoleAdapter. */
|
|
9
|
+
export declare function WorktreeConsoleView({ sessionId, adapter, services }: WorktreeConsoleViewProps): import("react").JSX.Element;
|