dsh-spec-collab 0.2.0 → 0.2.1

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.
@@ -94,8 +94,8 @@ button:disabled { cursor: default; opacity: .52; }
94
94
  .unsaved { color: var(--amber); font-weight: 650; }
95
95
  .saveButton:not(:disabled) { border-color: var(--green); color: var(--green-deep); font-weight: 700; }
96
96
  .editorContext { min-width: 0; min-height: 42px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-bottom: 1px solid #cfe0da; padding: 5px 12px; background: #f1f8f5; }
97
- .selectionPrompt { min-width: 0; display: flex; align-items: center; gap: 6px; }
98
- .selectionPrompt span { max-width: 360px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
97
+ .selectionPrompt { position: fixed; z-index: 22; box-sizing: border-box; width: min(380px, calc(100vw - 24px)); min-width: 0; display: flex; align-items: center; gap: 6px; border: 1px solid #9dbbb0; border-radius: 6px; padding: 6px; background: var(--paper); box-shadow: 0 8px 24px rgba(23,33,29,.18); }
98
+ .selectionPrompt span { min-width: 0; flex: 1; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
99
99
  .selectionPrompt button { min-height: 28px; padding: 3px 8px; }
100
100
  .selectionPrompt button:last-child { width: 28px; border: 0; padding: 0; background: transparent; }
101
101
  .commentAction { border-color: var(--green) !important; background: var(--mint) !important; color: var(--green-deep) !important; font-weight: 650; }
@@ -105,6 +105,7 @@ button:disabled { cursor: default; opacity: .52; }
105
105
  .emptyMain span { color: var(--green); font-size: 11px; font-weight: 750; }
106
106
  .emptyMain h2 { margin: 8px 0; font: 700 28px/1.25 ui-serif, "Songti SC", serif; }
107
107
  .emptyMain p { margin: 0 auto 18px; color: var(--muted); }
108
+ .richEditorShell { position: relative; height: 100%; overflow: hidden; background: var(--paper); }
108
109
  .richEditor { height: 100%; background: var(--paper); }
109
110
  .richEditor :global(.toastui-editor-defaultUI) { height: 100% !important; border: 0; font-family: Inter, "PingFang SC", ui-sans-serif, system-ui, sans-serif; }
110
111
  .richEditor :global(.toastui-editor-toolbar), .richEditor :global(.toastui-editor-mode-switch) { display: none !important; }
@@ -115,6 +116,12 @@ button:disabled { cursor: default; opacity: .52; }
115
116
  .richEditor :global(.toastui-editor-contents h2) { margin: 36px 0 14px; border-bottom: 1px solid var(--line); padding-bottom: 8px; color: var(--ink); font-size: 20px; line-height: 1.4; }
116
117
  .richEditor :global(.toastui-editor-contents h3) { margin: 26px 0 10px; color: var(--ink); font-size: 16px; line-height: 1.4; }
117
118
  .richEditor :global(.toastui-editor-contents p) { margin: 10px 0; }
119
+ .richEditor .reviewSourceSelected { border-radius: 3px; background: #fff3df; box-shadow: -4px 0 #c9792a; }
120
+ .reviewAnchorLayer { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
121
+ .documentReviewAnchor { position: absolute; box-sizing: border-box; width: 23px; height: 23px; min-height: 23px; display: grid; place-items: center; border: 1px solid #8eaaa0; border-radius: 50%; padding: 0; background: var(--paper); color: var(--green-deep); font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; pointer-events: auto; box-shadow: 0 2px 6px rgba(23,33,29,.12); }
122
+ .documentReviewAnchor:hover { border-color: var(--green); background: var(--mint); }
123
+ .documentReviewAnchorBlocking { border-color: #c7863f; background: var(--amber-soft); color: #834714; }
124
+ .documentReviewAnchorSelected { border-color: var(--green); background: var(--green); color: #fff; }
118
125
 
119
126
  .primaryNav { flex: 0 0 auto; min-height: 44px; display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); padding: 5px 7px; background: var(--paper); }
120
127
  .primaryNav > div { min-width: 0; display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
@@ -156,6 +163,12 @@ button:disabled { cursor: default; opacity: .52; }
156
163
  .panelSummary > div { display: grid; gap: 1px; }
157
164
  .panelSummary strong { font-size: 12px; }
158
165
  .panelSummary span { color: var(--amber); font-size: 10px; }
166
+ .checklistMeter { flex: 0 0 72px; align-content: center; justify-items: end; gap: 3px !important; }
167
+ .checklistMeter small { color: var(--muted); font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
168
+ .checklistMeter progress { width: 72px; height: 4px; overflow: hidden; border: 0; border-radius: 2px; background: #dde4e0; color: var(--green); }
169
+ .checklistMeter progress::-webkit-progress-bar { background: #dde4e0; }
170
+ .checklistMeter progress::-webkit-progress-value { background: var(--green); }
171
+ .checklistMeter progress::-moz-progress-bar { background: var(--green); }
159
172
  .runHistory, .historyGroup { border-bottom: 1px solid var(--line); background: #fafbfa; }
160
173
  .runHistory > summary, .historyGroup > summary { cursor: pointer; padding: 10px 14px; color: var(--muted); font-size: 11px; font-weight: 650; }
161
174
  .runHistory > .run { border-top: 1px solid var(--line); padding: 12px 16px; background: var(--paper); }
@@ -163,44 +176,34 @@ button:disabled { cursor: default; opacity: .52; }
163
176
  .run > div:first-child { display: flex; justify-content: space-between; gap: 8px; }
164
177
  .run > div:first-child span { color: var(--muted); font-size: 11px; }
165
178
  .reviewCard { display: grid; gap: 11px; background: var(--paper); }
166
- .reviewCardBody { display: grid; gap: 11px; }
167
- .reviewDetails { border-bottom: 1px solid var(--line); background: var(--paper); }
168
- .endedReview { background: #fafbfa; }
169
- .pendingReview { border-left: 3px solid var(--amber); }
170
- .reviewDetails > summary { min-height: 47px; display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 11px; cursor: pointer; list-style: none; }
171
- .reviewDetails > summary::-webkit-details-marker { display: none; }
172
- .reviewDetails > summary::before { content: '›'; flex: none; color: var(--muted); font-size: 17px; transition: transform .15s ease; }
173
- .reviewDetails[open] > summary::before { transform: rotate(90deg); }
174
- .reviewDetails > summary span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 620; }
175
- .reviewDetails > summary b { flex: none; color: var(--muted); font-size: 10px; font-weight: 600; }
176
- .reviewDetails > .reviewCardBody { border-top: 1px solid #e8ece9; padding: 12px 16px 16px; background: var(--paper); }
179
+ .reviewChecklist { display: grid; background: var(--paper); }
180
+ .reviewChecklistRow { box-sizing: border-box; width: 100%; height: 76px; min-width: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 12px; align-items: center; gap: 9px; overflow: hidden; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 9px 12px; background: var(--paper); text-align: left; }
181
+ .reviewChecklistRow:hover { background: #f6f9f7; }
182
+ .reviewChecklistRow:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--green); outline-offset: -2px; }
183
+ .reviewChecklistBlocking { box-shadow: inset 3px 0 var(--amber); }
184
+ .reviewChecklistAnswered { background: #f7faf8; }
185
+ .reviewChecklistSettled { background: #fafbfa; color: var(--muted); }
186
+ .reviewChecklistSelected { position: relative; z-index: 1; background: var(--blue-soft); box-shadow: inset 3px 0 var(--green); }
187
+ .reviewCheckBox { box-sizing: border-box; width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid #aab8b2; border-radius: 3px; color: var(--green); font-size: 12px; font-weight: 800; }
188
+ .reviewChecklistBlocking .reviewCheckBox { border-color: #c7863f; background: var(--amber-soft); }
189
+ .reviewChecklistAnswered .reviewCheckBox { border-color: #88ad9f; background: var(--mint); }
190
+ .reviewChecklistSettled .reviewCheckBox { border-color: #88ad9f; background: var(--mint); }
191
+ .reviewCheckCopy { min-width: 0; display: grid; align-content: center; gap: 3px; }
192
+ .reviewCheckMeta { min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
193
+ .reviewCheckMeta b { flex: none; color: var(--green-deep); font-size: 9px; font-weight: 760; }
194
+ .reviewCheckMeta small { min-width: 0; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
195
+ .reviewCheckCopy > strong { min-width: 0; max-height: 34px; display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; color: var(--ink); font-size: 12px; font-weight: 620; line-height: 17px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
196
+ .reviewCheckStatus { flex: none; max-width: 66px; overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
197
+ .reviewCheckArrow { color: var(--muted); font-size: 17px; }
177
198
  .reviewTitle { color: var(--ink); font-weight: 650; }
178
199
  .reviewTitle > :first-child { margin-top: 0; }
179
200
  .reviewTitle > :last-child { margin-bottom: 0; }
180
- .reviewField { display: grid; gap: 4px; }
181
- .reviewField > span { color: var(--muted); font-size: 10px; font-weight: 750; }
182
- .questionField { border-left: 3px solid var(--amber); padding: 9px 11px; background: var(--amber-soft); }
183
- .impactDetails, .evidence, .patchDetails { border: 1px solid var(--line); border-radius: 5px; padding: 7px 9px; }
184
- .impactDetails summary, .evidence summary, .patchDetails summary { cursor: pointer; color: var(--muted); font-size: 11px; font-weight: 650; }
185
- .evidence > div { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
186
- .evidence code { overflow-wrap: anywhere; color: var(--blue); font-size: 10px; }
201
+ .patchDetails { border: 1px solid var(--line); border-radius: 5px; padding: 7px 9px; }
202
+ .patchDetails summary { cursor: pointer; color: var(--muted); font-size: 11px; font-weight: 650; }
187
203
  .badges { display: flex !important; justify-content: flex-start !important; flex-wrap: wrap; gap: 4px !important; }
188
204
  .badges > * { border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 7px; font-size: 10px; }
189
205
  .badges > b:first-child { border-color: #dfb77f; background: var(--amber-soft); color: #834714; }
190
- .humanResponse { display: grid; grid-template-columns: auto 1fr; gap: 2px 7px; border-left: 3px solid var(--green); padding: 9px 10px; background: var(--mint); }
191
- .humanResponse > span { color: var(--green); font-size: 9px; font-weight: 750; }
192
- .humanResponse > strong { font-size: 11px; }
193
- .humanResponse > div { grid-column: 1 / -1; }
194
- .quickOptions { display: grid; gap: 5px; }
195
- .quickOptions > span { color: var(--muted); font-size: 10px; font-weight: 700; }
196
- .quickOptions button { height: auto; min-height: 36px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; border-color: #d5e3de; padding: 7px 9px; background: #f7faf8; text-align: left; white-space: normal; }
197
- .quickOptions button b { color: var(--green); font-size: 10px; }
198
- .responseForm { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
199
- .responseForm label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
200
- .responseForm select, .responseForm textarea { box-sizing: border-box; width: 100%; border: 1px solid var(--line-strong); border-radius: 5px; padding: 8px; color: var(--ink); background: var(--paper); }
201
- .responseForm textarea { min-height: 96px; resize: vertical; }
202
206
  .cardActions { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line); padding-top: 9px; }
203
- .answerButton { border-color: var(--green); color: var(--green-deep); font-weight: 700; }
204
207
 
205
208
  .markdownBody { min-width: 0; overflow-wrap: anywhere; color: var(--text); }
206
209
  .markdownBody p { margin: 5px 0; }
@@ -219,7 +222,14 @@ button:disabled { cursor: default; opacity: .52; }
219
222
  .threadList p, .threadList blockquote, .threadList strong { overflow-wrap: anywhere; }
220
223
  .threadList section > small { display: block; margin: 6px 0; color: var(--muted); font-size: 11px; }
221
224
  .threadList blockquote { margin: 7px 0; border-left: 3px solid #8fb7c5; padding: 6px 8px; background: var(--blue-soft); }
222
- .newThread textarea { box-sizing: border-box; width: 100%; min-height: 86px; resize: vertical; }
225
+ .newThread { display: grid; gap: 10px; background: #f8faf9; }
226
+ .newThread header { display: grid; gap: 2px; }
227
+ .newThread header span { color: var(--green); font-size: 9px; font-weight: 750; }
228
+ .newThread header strong { color: var(--ink); font-size: 14px; }
229
+ .newThread label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 650; }
230
+ .newThread textarea { box-sizing: border-box; width: 100%; min-height: 112px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 5px; padding: 8px; }
231
+ .newThread > small { margin: 0 !important; color: var(--muted); font-size: 10px; line-height: 1.5; }
232
+ .newThread > div:last-child { display: flex; justify-content: flex-end; gap: 7px; }
223
233
  .reply { margin-top: 8px; padding: 8px; background: var(--blue-soft); }
224
234
  .aiConversation { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 7px; }
225
235
  .chatToggle { width: 100%; border-color: #a8c4ce; color: var(--blue); }
@@ -292,6 +302,63 @@ button:disabled { cursor: default; opacity: .52; }
292
302
  .modal textarea { min-height: 120px; resize: vertical; }
293
303
  .modal form > div:last-child { display: flex; justify-content: flex-end; gap: 8px; }
294
304
 
305
+ .reviewDecisionModal { z-index: 34; padding: 20px; }
306
+ .reviewDecisionDialog { box-sizing: border-box; width: min(1120px, 100%); height: min(760px, calc(100vh - 40px)); min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper); box-shadow: 0 18px 48px rgba(23,33,29,.24); }
307
+ .reviewDecisionHeader { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding: 17px 20px 16px; }
308
+ .reviewDecisionHeader > div { min-width: 0; }
309
+ .reviewDecisionDialog .reviewDecisionHeader h2 { margin: 8px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: 18px; font-weight: 680; line-height: 1.45; }
310
+ .reviewDecisionHeader > button { flex: 0 0 32px; width: 32px; height: 32px; border: 0; padding: 0; color: var(--muted); font-size: 21px; }
311
+ .decisionTags { display: flex; flex-wrap: wrap; gap: 5px; }
312
+ .decisionTags > * { border: 1px solid var(--line-strong); border-radius: 3px; padding: 2px 6px; color: var(--muted); font-size: 9px; font-weight: 680; }
313
+ .decisionTags > b { border-color: #dfb77f; background: var(--amber-soft); color: #834714; }
314
+ .reviewDecisionBody { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .8fr); }
315
+ .reviewDecisionContext { min-width: 0; overflow: auto; padding: 28px 34px 48px; }
316
+ .reviewDecisionAside { min-width: 0; min-height: 0; overflow: auto; border-left: 1px solid var(--line); padding: 24px 22px 28px; background: #f7f9f8; }
317
+ .decisionQuestion { border-left: 4px solid var(--amber); padding: 14px 17px; background: var(--amber-soft); }
318
+ .decisionQuestion > span { display: block; margin-bottom: 5px; color: #834714; font-size: 10px; font-weight: 760; }
319
+ .decisionQuestion .markdownBody { color: var(--ink); font-size: 15px; font-weight: 620; line-height: 1.65; }
320
+ .decisionQuestion .markdownBody p { margin: 0; color: var(--ink); }
321
+ .decisionSection { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
322
+ .decisionSection h3 { margin: 0 0 9px; color: var(--ink); font-size: 12px; }
323
+ .decisionSection > p { margin: 0; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
324
+ .decisionSectionHead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
325
+ .decisionSectionHead span { color: var(--muted); font-size: 10px; }
326
+ .decisionSectionHead button { min-height: 28px; border-color: transparent; padding: 3px 6px; color: var(--green-deep); font-size: 10px; font-weight: 700; }
327
+ .decisionSourceList { display: grid; gap: 8px; }
328
+ .decisionSource { border-left: 3px solid #7ea7b6; padding: 10px 12px; background: var(--blue-soft); }
329
+ .decisionSource > span { display: block; margin-bottom: 4px; color: var(--blue); font-size: 9px; font-weight: 730; }
330
+ .decisionSource .markdownBody { color: var(--ink); font-size: 12px; line-height: 1.55; }
331
+ .decisionSource .markdownBody > :first-child { margin-top: 0; }
332
+ .decisionSource .markdownBody > :last-child { margin-bottom: 0; }
333
+ .decisionEvidenceList { display: grid; }
334
+ .decisionEvidence { min-width: 0; padding: 13px 0; }
335
+ .decisionEvidence + .decisionEvidence { border-top: 1px solid var(--line); }
336
+ .decisionEvidence code { display: block; overflow-wrap: anywhere; color: var(--blue); font-size: 10px; }
337
+ .decisionEvidence .markdownBody { margin-top: 4px; }
338
+ .decisionEmpty { border-left: 3px solid var(--line-strong); padding: 8px 10px; background: var(--canvas); }
339
+ .decisionAsideHead { display: grid; gap: 3px; margin-bottom: 18px; }
340
+ .decisionAsideHead span { color: var(--green); font-size: 10px; font-weight: 760; }
341
+ .decisionAsideHead strong { color: var(--ink); font-size: 14px; }
342
+ .decisionOptions { min-width: 0; display: grid; gap: 6px; margin: 0 0 18px; border: 0; padding: 0; }
343
+ .decisionOptions legend { margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
344
+ .decisionOptions button { box-sizing: border-box; width: 100%; height: auto; min-height: 44px; display: grid; grid-template-columns: minmax(0, 1fr) 22px; align-items: center; gap: 9px; border-color: #cdd9d4; padding: 9px 10px; background: var(--paper); text-align: left; white-space: normal; }
345
+ .decisionOptions button span { overflow-wrap: anywhere; font-size: 11px; line-height: 1.45; }
346
+ .decisionOptions button b { color: var(--muted); font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
347
+ .decisionOptions .selectedDecisionOption { border-color: var(--green); background: var(--mint); }
348
+ .decisionOptions .selectedDecisionOption b { color: var(--green); }
349
+ .decisionForm { display: grid; gap: 12px; }
350
+ .decisionForm label { display: grid; gap: 5px; margin: 0; color: var(--muted); font-size: 10px; font-weight: 680; }
351
+ .decisionForm select, .decisionForm textarea { color: var(--ink); background: var(--paper); }
352
+ .decisionForm textarea { min-height: 190px; line-height: 1.6; resize: vertical; }
353
+ .decisionModeHint { margin: -6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
354
+ .decisionActions { position: sticky; bottom: -28px; display: flex; justify-content: space-between; gap: 8px; margin: 20px -22px -28px; border-top: 1px solid var(--line); padding: 13px 22px; background: #f7f9f8; }
355
+ .decisionActions > div { display: flex; justify-content: flex-end; gap: 7px; }
356
+ .decisionResponse { display: grid; gap: 8px; border-left: 4px solid var(--green); padding: 14px 16px; background: var(--mint); }
357
+ .decisionResponse > span { color: var(--green); font-size: 10px; font-weight: 760; }
358
+ .decisionResponse > strong { color: var(--ink); font-size: 14px; }
359
+ .decisionResponse > small { color: var(--muted); font-size: 10px; }
360
+ .decisionResponse > p { margin: 0; }
361
+
295
362
  .footer { grid-row: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; overflow: hidden; border-top: 1px solid var(--line); padding: 0 10px; background: var(--paper); color: var(--muted); font-size: 10px; white-space: nowrap; }
296
363
  .footer span { overflow: hidden; text-overflow: ellipsis; }
297
364
  .entry { box-sizing: border-box; width: 100%; overflow: hidden; }
@@ -311,8 +378,7 @@ button:disabled { cursor: default; opacity: .52; }
311
378
  .toolbar { align-items: flex-start; flex-direction: column; }
312
379
  .toolbar > div:last-child { width: 100%; justify-content: flex-start; }
313
380
  .summaryInput { flex: 1 1 120px; width: auto; }
314
- .selectionPrompt { width: 100%; }
315
- .selectionPrompt span { flex: 1; max-width: none; }
381
+ .selectionPrompt { max-width: calc(100vw - 24px); }
316
382
  }
317
383
  @media (max-width: 680px) {
318
384
  .header { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 9px 10px; }
@@ -335,6 +401,16 @@ button:disabled { cursor: default; opacity: .52; }
335
401
  .conflictDialog { height: 100%; overflow: auto; grid-template-rows: auto auto auto auto; }
336
402
  .conflictColumns, .conflictDiffs, .compareColumns { grid-template-columns: 1fr; }
337
403
  .conflictColumns textarea { min-height: 220px; }
404
+ .reviewDecisionModal { padding: 0; }
405
+ .reviewDecisionDialog { width: 100%; height: 100%; border: 0; border-radius: 0; }
406
+ .reviewDecisionHeader { padding: 13px 14px; }
407
+ .reviewDecisionDialog .reviewDecisionHeader h2 { font-size: 15px; }
408
+ .reviewDecisionBody { display: block; overflow: auto; }
409
+ .reviewDecisionContext, .reviewDecisionAside { overflow: visible; }
410
+ .reviewDecisionContext { padding: 20px 16px 34px; }
411
+ .reviewDecisionAside { border-top: 1px solid var(--line); border-left: 0; padding: 20px 16px 24px; }
412
+ .decisionActions { bottom: -24px; margin: 20px -16px -24px; padding: 12px 16px; }
413
+ .decisionActions, .decisionActions > div { flex-wrap: wrap; }
338
414
  }
339
415
  @media (prefers-reduced-motion: reduce) {
340
416
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
@@ -2,7 +2,7 @@ import type { ParticipantRole, RequirementView, ReviewKind } from '../protocol.t
2
2
 
3
3
  export type TaskView = 'review' | 'patches' | 'ready'
4
4
  export type WorkflowCommand =
5
- | { kind: 'open'; view: TaskView }
5
+ | { kind: 'open'; view: TaskView; objectId?: string }
6
6
  | { kind: 'bind-workspace' }
7
7
  | { kind: 'request-review'; reviewKind: ReviewKind }
8
8
  | { kind: 'advance' }
@@ -51,16 +51,16 @@ export function workflowState(requirement: RequirementView, participantRole: Par
51
51
  actionLabel: '开始需求检查', command: { kind: 'request-review', reviewKind: 'product-first' },
52
52
  }
53
53
  if (unanswered.length > 0) return {
54
- eyebrow: '需要你的判断', title: `回答 ${unanswered.length} 个关键问题`, detail: '先处理会影响范围、规则或验收结果的问题,其余内容可以稍后核对。',
55
- actionLabel: '继续回答', command: { kind: 'open', view: 'review' },
54
+ eyebrow: '需要你的判断', title: `回答 ${unanswered.length} 个关键问题`, detail: '可以连续回答;完成最后一项后,再让 AI 回读全部结论并整理正文。',
55
+ actionLabel: '回答下一题', command: { kind: 'open', view: 'review', objectId: unanswered[0]!.id },
56
56
  }
57
57
  if (currentPatches.length > 0) return {
58
58
  eyebrow: 'AI 已整理改动', title: `审核 ${currentPatches.length} 份正文修改`, detail: '确认改动符合你的判断后,再写入正式需求版本。',
59
59
  actionLabel: '查看改动', command: { kind: 'open', view: 'patches' },
60
60
  }
61
61
  if (productBlockers.length > 0 || !completed('product-second')) return {
62
- eyebrow: '答案已收集', title: '让 AI 把结论整理进正文', detail: 'AI 会复核你的回答,并生成可逐项审核的正文修改。',
63
- actionLabel: '整理正文改动', command: { kind: 'request-review', reviewKind: 'product-second' },
62
+ eyebrow: '人工回答已完成', title: '下一步:让 AI 回读全部回答', detail: '点击下方按钮后,AI 会重新检查正文与回答,并生成可逐项审核的正文修改。此步骤不会自动开始。',
63
+ actionLabel: '让 AI 回读并生成修改', command: { kind: 'request-review', reviewKind: 'product-second' },
64
64
  }
65
65
  return {
66
66
  eyebrow: '产品澄清完成', title: '进入产品确认', detail: '当前版本没有产品侧阻塞问题,下一步由产品负责人确认内容。',
@@ -87,7 +87,7 @@ export function workflowState(requirement: RequirementView, participantRole: Par
87
87
  }
88
88
  if (unanswered.length > 0) return {
89
89
  eyebrow: '研发发现待确认项', title: `处理 ${unanswered.length} 个阻塞问题`, detail: '这些问题会影响实现或验收,需要在交付研发前明确。',
90
- actionLabel: '继续处理', command: { kind: 'open', view: 'review' },
90
+ actionLabel: '处理下一题', command: { kind: 'open', view: 'review', objectId: unanswered[0]!.id },
91
91
  }
92
92
  if (currentPatches.length > 0) return {
93
93
  eyebrow: '研发建议了改动', title: `审核 ${currentPatches.length} 份正文修改`, detail: '确认实现约束和测试条件已准确写回需求。',
@@ -95,7 +95,7 @@ export function workflowState(requirement: RequirementView, participantRole: Par
95
95
  }
96
96
  if (blockers.length > 0) return {
97
97
  eyebrow: '仍有待收敛内容', title: '复核已回复的问题', detail: '已有回复尚未消除阻塞,请重新检查或让 AI 根据结论更新正文。',
98
- actionLabel: '查看问题', command: { kind: 'open', view: 'review' },
98
+ actionLabel: '查看问题', command: { kind: 'open', view: 'review', objectId: blockers[0]!.id },
99
99
  }
100
100
  if (failedChecks.length > 0) return {
101
101
  eyebrow: '交付条件未齐', title: `补齐 ${failedChecks.length} 项需求内容`, detail: '完成条件会指出正文缺少的目标、范围、验收标准或测试约束。',
package/src/index.ts CHANGED
@@ -8,14 +8,18 @@ import type {} from '@deepseek-ai/dsh-system-prompt'
8
8
  import type {} from '@deepseek-ai/dsh-tools'
9
9
  import { CollaborationEngine } from './engine.ts'
10
10
  import { GitRequirementStore } from './git-store.ts'
11
+ import { DEFAULT_REVIEW_PROMPTS, resolveReviewPrompts, type ReviewPromptConfig } from './prompts.ts'
11
12
  import { DshReviewCoordinator } from './review-runtime.ts'
12
13
  import { ReviewContextCatalog, type ReviewContextConfig } from './review-context.ts'
13
14
  import { makeRoutes } from './routes.ts'
14
15
  import { allSpecTools } from './tools.ts'
15
16
 
17
+ export { DEFAULT_REVIEW_PROMPTS, resolveReviewPrompts }
18
+ export type { ReviewPromptConfig }
19
+
16
20
  export const name = 'spec-collab'
17
21
  export const inject = ['webServer', 'apiProxy', 'tools', 'systemPrompt']
18
- export interface Config extends ReviewContextConfig { dataRoot?: string; repositoryPath?: string }
22
+ export interface Config extends ReviewContextConfig { dataRoot?: string; repositoryPath?: string; prompts?: ReviewPromptConfig }
19
23
 
20
24
  const stringList = () => Schema.array(Schema.string()).default([])
21
25
  const contextFields = () => ({
@@ -24,6 +28,7 @@ const contextFields = () => ({
24
28
  documentPaths: stringList().description('AI 分析前可读取的本地文件或目录路径;相对路径按需求工作区根目录解析。'),
25
29
  agentPreset: Schema.string().description('实际挂载这些 Skill/MCP 工具的 DSH Agent Preset ID。'),
26
30
  })
31
+ const promptText = (value: string, description: string) => Schema.string().role('textarea').default(value).description(description)
27
32
  export const Config: Schema<Config> = Schema.object({
28
33
  dataRoot: Schema.string().description('协作账本数据目录。'),
29
34
  repositoryPath: Schema.string().description('正式 Spec Git 仓库目录。'),
@@ -32,18 +37,31 @@ export const Config: Schema<Config> = Schema.object({
32
37
  workspaceId: Schema.string().required().description('需要追加项目专属 AI 上下文的 DSH workspaceId。'),
33
38
  ...contextFields(),
34
39
  })).default([]).description('按 DSH 工作区追加的 AI 上下文;未列出的工作区仍继承 defaultContext。'),
40
+ prompts: Schema.object({
41
+ system: promptText(DEFAULT_REVIEW_PROMPTS.system, '注入普通 DSH 会话的插件系统说明。'),
42
+ workspaceContext: promptText(DEFAULT_REVIEW_PROMPTS.workspaceContext, '工作区上下文模板。必须保留 {{WORKSPACE_SNAPSHOT}} 和 {{RESOURCE_INSTRUCTIONS}};还可使用 {{WORKSPACE_ID}}、{{WORKSPACE_TITLE}}、{{WORKSPACE_PATH}}。'),
43
+ resourceInstructions: promptText(DEFAULT_REVIEW_PROMPTS.resourceInstructions, 'Skill、MCP 和文档资源说明模板。可用变量:{{RESOURCE_DETAILS}}、{{SKILLS}}、{{MCP_SERVERS}}、{{DOCUMENT_PATHS}}。'),
44
+ common: promptText(DEFAULT_REVIEW_PROMPTS.common, '所有审核和评论分析共享的约束。'),
45
+ productFirst: promptText(DEFAULT_REVIEW_PROMPTS.productFirst, '产品 AI 初审任务提示词。'),
46
+ productSecond: promptText(DEFAULT_REVIEW_PROMPTS.productSecond, '产品回复后的二次审核任务提示词。'),
47
+ engineeringPrecheck: promptText(DEFAULT_REVIEW_PROMPTS.engineeringPrecheck, '研发智能预审任务提示词。'),
48
+ changeReview: promptText(DEFAULT_REVIEW_PROMPTS.changeReview, '保存新版本后的变更审核任务提示词。'),
49
+ comment: promptText(DEFAULT_REVIEW_PROMPTS.comment, '正文评论的 AI 分析任务提示词。'),
50
+ followUp: promptText(DEFAULT_REVIEW_PROMPTS.followUp, 'AI 会话追问模板,必须保留 {{CONTENT}}。'),
51
+ }).description('AI 提示词配置;未填写的字段使用插件内置默认值。'),
35
52
  }) as Schema<Config>
36
53
 
37
54
  export function apply(ctx: Context, config: Config = {}): void {
38
55
  const dataRoot = config.dataRoot ?? join(homedir(), '.dsh', 'spec-collab')
39
56
  const contexts = new ReviewContextCatalog(config)
57
+ const prompts = resolveReviewPrompts(config.prompts)
40
58
  const engine = new CollaborationEngine(join(dataRoot, 'collaboration-v2.json'), new GitRequirementStore(config.repositoryPath ?? join(dataRoot, 'repository')))
41
- const coordinator = new DshReviewCoordinator(ctx.apiProxy, contexts)
59
+ const coordinator = new DshReviewCoordinator(ctx.apiProxy, contexts, prompts)
42
60
  engine.setCoordinator(coordinator)
43
61
  ctx.effect(() => { const disposers = makeRoutes(engine, coordinator).map(route => ctx.webServer.register(route)); return () => { for (const dispose of disposers) dispose() } }, 'spec-collab: routes')
44
62
  ctx.effect(() => { const disposers = allSpecTools(engine).map(tool => ctx.tools.register(tool)); return () => { for (const dispose of disposers) dispose() } }, 'spec-collab: tools')
45
63
  ctx.effect(() => ctx.systemPrompt.section({
46
64
  name: 'plugin:spec-collab', order: 190,
47
- text: '本机已安装 dsh-spec-collab「AI 需求澄清与 Spec 共创工作台」。产品输入原始需求后,产品 AI 初审并生成结构化 Review Item,产品逐项回应,AI 二次审核并提出候选 patch;产品确认后进入产研与双方 AI 共审,最终通过 Ready 质量门输出 commit 绑定的 Ready Spec。正式 Spec 版本只存 Git+Markdown;AI 只能提出 Review Item、分析回复和候选 patch,不能确认产品/技术语义,也不能直接写 Git 或标记 Ready。该产品严格止于 Ready Spec,不执行代码开发、测试、worktree、部署或发布。使用 spec_list/spec_read 读取,spec_reply/spec_submit_review/spec_propose_patch 参与审核。',
65
+ text: prompts.system,
48
66
  }), 'spec-collab: prompt')
49
67
  }
package/src/prompts.ts ADDED
@@ -0,0 +1,100 @@
1
+ export interface ReviewPromptConfig {
2
+ system?: string
3
+ workspaceContext?: string
4
+ resourceInstructions?: string
5
+ common?: string
6
+ productFirst?: string
7
+ productSecond?: string
8
+ engineeringPrecheck?: string
9
+ changeReview?: string
10
+ comment?: string
11
+ followUp?: string
12
+ }
13
+
14
+ export type ResolvedReviewPrompts = Required<ReviewPromptConfig>
15
+
16
+ export const DEFAULT_REVIEW_PROMPTS: ResolvedReviewPrompts = {
17
+ system: '本机已安装 dsh-spec-collab「AI 需求澄清与 Spec 共创工作台」。产品输入原始需求后,产品 AI 初审并生成结构化 Review Item,产品逐项回应,AI 二次审核并提出候选 patch;产品确认后进入产研与双方 AI 共审,最终通过 Ready 质量门输出 commit 绑定的 Ready Spec。正式 Spec 版本只存 Git+Markdown;AI 只能提出 Review Item、分析回复和候选 patch,不能确认产品/技术语义,也不能直接写 Git 或标记 Ready。该产品严格止于 Ready Spec,不执行代码开发、测试、worktree、部署或发布。使用 spec_list/spec_read 读取,spec_reply/spec_submit_review/spec_propose_patch 参与审核。',
18
+ workspaceContext: [
19
+ '## 本次审核必须使用的上下文',
20
+ 'DSH 工作区:`{{WORKSPACE_ID}}`。当前 AI session 必须挂载该工作区,不得创建未分组会话。',
21
+ '工作区名称:{{WORKSPACE_TITLE}}',
22
+ '工作区根目录:`{{WORKSPACE_PATH}}`',
23
+ '',
24
+ '开始审核前必须先实际读取工作区上下文,不能只读取 Spec:',
25
+ '1. 检查工作区根目录,并读取存在的 AGENTS.md、CONTEXT.md、README/README.md 和 CONTRIBUTING.md。',
26
+ '2. 读取存在的项目清单与构建入口,例如 package.json、pyproject.toml、Cargo.toml、go.mod、pom.xml 或构建脚本。',
27
+ '3. 根据需求关键词定位相关代码、产品文档、测试和 Git 历史;结论引用具体文件路径及 commit 或其他可识别版本。',
28
+ '4. 不得把“已绑定工作区”等同于“已读取上下文”。无法访问文件或历史时,明确说明并使用 TO_VERIFY。',
29
+ '',
30
+ '{{WORKSPACE_SNAPSHOT}}',
31
+ '',
32
+ '{{RESOURCE_INSTRUCTIONS}}',
33
+ ].join('\n'),
34
+ resourceInstructions: [
35
+ '{{RESOURCE_DETAILS}}',
36
+ '任何已配置资源若在当前 Agent Preset 中不可用、无权限或读取失败,必须在结论中明确指出该资源并使用 TO_VERIFY;不得假装已经查询或把不可访问内容写成 FACT。',
37
+ ].join('\n'),
38
+ common: [
39
+ '所有面向用户的输出必须使用简体中文,包括 Review Item 的陈述、影响、问题、成熟度总结、候选 patch 摘要以及评论分析回复。仅保留代码标识、路径、commit SHA、AC ID、FACT / INFERENCE / ASSUMPTION / TO_VERIFY 等固定枚举为原文。',
40
+ 'You are a review worker for a requirements clarification product. You must not implement code, generate downstream test delivery, create worktrees, deploy, or mark the requirement Ready. AI output is proposal data only and requires human confirmation.',
41
+ 'A FACT must cite an accessible, version-pinned source. If evidence is unavailable, use TO_VERIFY; never invent historical or implementation conflicts.',
42
+ 'Use spec_read to retrieve the exact current data. Do not modify files directly.',
43
+ '每个 Review Item 默认给出三个 recommendedOptions。每个选项只表达一个决定,使用“选择 + 直接结果”的短句,建议不超过 45 个汉字;三个选项必须有真实差异,不得只是“接受、拒绝、待验证”的同义改写。确有四种独立方案时才允许第四项。',
44
+ 'Review Item 的 question 只问一个可以直接回答的问题,建议不超过 40 个汉字。背景放在 statement,后果放在 impact,不要把背景、问题和多个子问题挤进 question 或选项。',
45
+ '每个 Review Item 必须提供 sourceAnchors:优先从当前 Spec 原文逐字复制 1 至 3 段能说明问题的短句,并填写所在 heading;不得改写或概括。问题来自正文缺失、没有可引用原文时,sourceAnchors 使用空数组,并通过 affectedSections / affectedAcceptanceIds 指明应补充的位置。',
46
+ '审核记录与正式文档必须分层:FACT / INFERENCE / ASSUMPTION / TO_VERIFY、commit SHA、run ID 等只用于结构化审核记录,不得堆入候选 Spec 正文。',
47
+ '候选 Spec 必须使用产品和研发都能直接理解的自然中文。避免行业黑话、审计腔和无必要的英文;英文缩写首次出现时必须同时写出中文含义,例如“行动按钮(CTA)”,后续优先使用中文。无法准确解释的缩写不要使用。',
48
+ '优先使用这些通俗说法:操作按钮(不用 CTA)、统一风格标识(不用 canonical key)、点赞(不用 like)、提示词(不用 prompt)、测试数据(不用 fixture)、最终判断依据(不用事实源)、完成状态(不用终态)、重复操作结果一致(不用幂等)。Upgrade、Download、Lite、Plus 等确为界面文案或套餐名时可保留,但首次出现要说明中文含义。',
49
+ '正文不要写“当前唯一可访问来源”“固定于某 commit”“统一记为 TO_VERIFY”这类过程说明。资料不足时,只在“待补充资料”章节按“资料名称:需要补充的内容;负责人(如已知)”列出,不重复背景、不写内部状态枚举。',
50
+ '每段只表达一个结论,优先使用短句和具体业务语言。删除不影响需求理解、研发实现或验收判断的元信息。',
51
+ '候选 patch 直接从文档标题开始,不写“本文为候选 patch”“不代表已确认决策”等免责声明。保留清晰的 Markdown 章节;身份与权限差异优先用表格,验收标准使用“前提 / 操作 / 预期结果”,不要使用 Given / When / Then。',
52
+ '合并重复内容:目标讲用户结果,范围只列做与不做,业务规则只定义规则,验收标准只写可验证场景。同一句规则不要再分别复制到目标、范围、术语、验收和风险章节。',
53
+ ].join('\n'),
54
+ productFirst: 'Perform the initial product review across goal, evidence, history-conflict, current-implementation, scope, semantics, completeness, acceptance, and risk. Submit structured findings with spec_submit_review. If the draft needs changes, also submit a candidate patch with spec_propose_patch. The candidate document must follow the plain-language and audit-metadata separation rules above.',
55
+ productSecond: 'Review product responses against their original Review Items. Do not close vague answers. Submit remaining/new findings with spec_submit_review and a reviewable candidate patch with spec_propose_patch. Rewrite awkward inherited wording instead of copying internal review terminology into the document.',
56
+ engineeringPrecheck: 'Read the product-confirmed Spec and inspect relevant current code/history available in the workspace. Find implementation fact conflicts, affected entries/roles/states, technical ambiguity, compatibility/permission/data boundaries, and unverifiable acceptance criteria. Submit with spec_submit_review and propose a patch only when needed.',
57
+ changeReview: 'Review only the latest saved commit against its parent. Identify materiality, affected sections/ACs, confirmations or decisions that need reconfirmation, and new conflicts. Submit with spec_submit_review; propose a patch only when needed.',
58
+ comment: 'Analyze this substantive comment. First query any code/document facts you can obtain. Then use spec_reply exactly once with your understanding, versioned evidence or TO_VERIFY status, affected sections/ACs, and recommended disposition. Do not silently modify the Spec or choose between conflicting product and engineering positions.',
59
+ followUp: '请使用简体中文回答以下追问,并继续遵守当前 Spec 审核任务的证据、权限和结构化回写约束。\n\n{{CONTENT}}',
60
+ }
61
+
62
+ export function resolveReviewPrompts(config: ReviewPromptConfig = {}): ResolvedReviewPrompts {
63
+ const prompts = { ...DEFAULT_REVIEW_PROMPTS, ...config }
64
+ validateTemplate('workspaceContext', prompts.workspaceContext,
65
+ ['WORKSPACE_ID', 'WORKSPACE_TITLE', 'WORKSPACE_PATH', 'WORKSPACE_SNAPSHOT', 'RESOURCE_INSTRUCTIONS'],
66
+ ['WORKSPACE_SNAPSHOT', 'RESOURCE_INSTRUCTIONS'])
67
+ validateTemplate('resourceInstructions', prompts.resourceInstructions,
68
+ ['RESOURCE_DETAILS', 'SKILLS', 'MCP_SERVERS', 'DOCUMENT_PATHS'])
69
+ validateTemplate('followUp', prompts.followUp, ['CONTENT'], ['CONTENT'])
70
+ for (const name of ['system', 'common', 'productFirst', 'productSecond', 'engineeringPrecheck', 'changeReview', 'comment'] as const) {
71
+ validateTemplate(name, prompts[name], [])
72
+ }
73
+ return prompts
74
+ }
75
+
76
+ export function renderPrompt(template: string, values: Record<string, string>): string {
77
+ return template.replace(/\{\{([A-Z_]+)\}\}/g, (placeholder, key: string) => values[key] ?? placeholder)
78
+ }
79
+
80
+ export function extractPromptValue(rendered: string, template: string, placeholder: string): string | undefined {
81
+ const token = `{{${placeholder}}}`
82
+ const index = template.indexOf(token)
83
+ if (index < 0) return undefined
84
+ const prefix = template.slice(0, index)
85
+ const suffix = template.slice(index + token.length)
86
+ if (!rendered.startsWith(prefix) || !rendered.endsWith(suffix)) return undefined
87
+ return rendered.slice(prefix.length, rendered.length - suffix.length)
88
+ }
89
+
90
+ function validateTemplate(name: keyof ResolvedReviewPrompts, template: string, allowed: string[], requiredOnce: string[] = []): void {
91
+ const counts = new Map<string, number>()
92
+ for (const match of template.matchAll(/\{\{([A-Z_]+)\}\}/g)) {
93
+ const placeholder = match[1]!
94
+ if (!allowed.includes(placeholder)) throw new Error(`${name} prompt contains unsupported placeholder {{${placeholder}}}`)
95
+ counts.set(placeholder, (counts.get(placeholder) ?? 0) + 1)
96
+ }
97
+ for (const placeholder of requiredOnce) {
98
+ if (counts.get(placeholder) !== 1) throw new Error(`${name} prompt must contain {{${placeholder}}} exactly once`)
99
+ }
100
+ }
package/src/protocol.ts CHANGED
@@ -18,9 +18,11 @@ export interface ParticipantSnapshot { participantId: string; nickname: string;
18
18
  export interface SourceReference { id: string; sourceType: 'text' | 'markdown' | 'prototype' | 'meeting' | 'data' | 'link' | 'feedback' | 'code-scope'; label: string; stableId?: string; version?: string; accessStatus: 'available' | 'unverified' | 'missing' }
19
19
  export interface RequirementVersion { commit: string; parentCommit?: string; markdown: string; author: ParticipantSnapshot; summary: string; createdAt: number }
20
20
  export interface ReviewEvidence { statement: string; source: string; version?: string; accessible: boolean }
21
+ export interface ReviewSourceAnchor { quote: string; heading?: string }
21
22
  export interface ReviewItem {
22
23
  id: string; requirementId: string; commit: string; reviewKind: ReviewKind; type: ReviewItemType; severity: Severity; statement: string
23
24
  evidence: ReviewEvidence[]; epistemicStatus: EpistemicStatus; impact: string; question: string; affectedSections: string[]; affectedAcceptanceIds: string[]
25
+ sourceAnchors?: ReviewSourceAnchor[]
24
26
  recommendedOptions?: string[]
25
27
  ownerRole: ParticipantRole; ownerParticipantId?: string; status: ReviewItemStatus
26
28
  response?: { participant: ParticipantSnapshot; disposition: 'context' | 'evidence' | 'accept' | 'accept-modified' | 'reject' | 'to-verify' | 'joint-review'; body: string; createdAt: number }
@@ -1,5 +1,6 @@
1
1
  import { homedir } from 'node:os'
2
2
  import { normalize, resolve } from 'node:path'
3
+ import { DEFAULT_REVIEW_PROMPTS, renderPrompt } from './prompts.ts'
3
4
 
4
5
  export interface ReviewContextResources {
5
6
  skills?: string[]
@@ -56,17 +57,33 @@ export class ReviewContextCatalog {
56
57
  }
57
58
  }
58
59
 
59
- export function reviewContextPrompt(context: ResolvedReviewContext): string {
60
- const rows = [
61
- '## 本次审核必须使用的上下文',
62
- `DSH 工作区:\`${context.workspaceId}\`。当前 AI session 必须挂载该工作区,不得创建未分组会话。`,
63
- ]
60
+ export interface ReviewContextPromptOptions {
61
+ workspace?: { title: string; path: string }
62
+ workspaceSnapshot?: string
63
+ workspaceTemplate?: string
64
+ resourceTemplate?: string
65
+ }
66
+
67
+ export function reviewContextPrompt(context: ResolvedReviewContext, options: ReviewContextPromptOptions = {}): string {
68
+ const workspace = options.workspace ?? { title: context.workspaceId, path: '未提供' }
69
+ const rows: string[] = []
64
70
  if (context.skills.length > 0) rows.push(`Skills:先调用 skill 工具加载 ${context.skills.map(value => `\`${value}\``).join('、')},读取完整说明后再分析。`)
65
71
  if (context.mcpServers.length > 0) rows.push(`MCP:需要事实查询时优先使用 ${context.mcpServers.map(value => `\`mcp__${value}__*\``).join('、')} namespace 下的工具。`)
66
72
  if (context.documentPaths.length > 0) rows.push('本地参考文档:分析前先读取与本需求相关的路径;相对路径基于当前 DSH 工作区根目录,引用时必须带具体文件路径和可识别版本。', ...context.documentPaths.map(value => `- \`${value}\``))
67
73
  if (context.skills.length === 0 && context.mcpServers.length === 0 && context.documentPaths.length === 0) rows.push('当前未配置额外 Skill、MCP 或本地参考文档。')
68
- rows.push('任何已配置资源若在当前 Agent Preset 中不可用、无权限或读取失败,必须在结论中明确指出该资源并使用 TO_VERIFY;不得假装已经查询或把不可访问内容写成 FACT。')
69
- return rows.join('\n')
74
+ const resourceInstructions = renderPrompt(options.resourceTemplate ?? DEFAULT_REVIEW_PROMPTS.resourceInstructions, {
75
+ RESOURCE_DETAILS: rows.join('\n'),
76
+ SKILLS: formatValues(context.skills),
77
+ MCP_SERVERS: formatValues(context.mcpServers.map(value => `mcp__${value}__*`)),
78
+ DOCUMENT_PATHS: formatValues(context.documentPaths),
79
+ })
80
+ return renderPrompt(options.workspaceTemplate ?? DEFAULT_REVIEW_PROMPTS.workspaceContext, {
81
+ WORKSPACE_ID: context.workspaceId,
82
+ WORKSPACE_TITLE: workspace.title,
83
+ WORKSPACE_PATH: workspace.path,
84
+ WORKSPACE_SNAPSHOT: options.workspaceSnapshot ?? '工作区快照尚未生成。',
85
+ RESOURCE_INSTRUCTIONS: resourceInstructions,
86
+ })
70
87
  }
71
88
 
72
89
  function normalizeResources(value: ReviewContextResources | undefined): NormalizedReviewContext {
@@ -80,6 +97,7 @@ function normalizeResources(value: ReviewContextResources | undefined): Normaliz
80
97
 
81
98
  function cleanList(values: string[] | undefined): string[] { return unique((values ?? []).map(value => value.trim()).filter(Boolean)) }
82
99
  function unique(values: string[]): string[] { return [...new Set(values)] }
100
+ function formatValues(values: string[]): string { return values.length > 0 ? values.map(value => `\`${value}\``).join('、') : '未配置' }
83
101
  function resolveDocumentPath(value: string): string {
84
102
  if (value === '~') return homedir()
85
103
  if (value.startsWith('~/') || value.startsWith('~\\')) return normalize(resolve(homedir(), value.slice(2)))