dsh-spec-collab 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -39165,113 +39165,113 @@ window.__ModuleLoader__.load({
39165
39165
  document.head.appendChild(tag);
39166
39166
  }
39167
39167
  var workbench_module_css_default = {
39168
- "documents": "-kTeaG_documents",
39169
- "review": "-kTeaG_review",
39170
- "paneClosed": "-kTeaG_paneClosed",
39171
- "richEditor": "-kTeaG_richEditor",
39172
- "markdownBody": "-kTeaG_markdownBody",
39173
- "notice": "-kTeaG_notice",
39174
- "editorBody": "-kTeaG_editorBody",
39168
+ "documentButton": "-kTeaG_documentButton",
39169
+ "dangerText": "-kTeaG_dangerText",
39175
39170
  "collapseChat": "-kTeaG_collapseChat",
39176
- "view": "-kTeaG_view",
39177
- "checklist": "-kTeaG_checklist",
39178
- "chatMessages": "-kTeaG_chatMessages",
39179
- "mobileSpec": "-kTeaG_mobileSpec",
39180
- "identity": "-kTeaG_identity",
39181
- "resizerHidden": "-kTeaG_resizerHidden",
39182
- "summaryInput": "-kTeaG_summaryInput",
39183
- "requirementMenu": "-kTeaG_requirementMenu",
39184
- "run": "-kTeaG_run",
39171
+ "unsaved": "-kTeaG_unsaved",
39172
+ "conflictModal": "-kTeaG_conflictModal",
39173
+ "reply": "-kTeaG_reply",
39185
39174
  "aiConversation": "-kTeaG_aiConversation",
39186
- "emptyMain": "-kTeaG_emptyMain",
39187
- "runHistory": "-kTeaG_runHistory",
39188
- "titleBlock": "-kTeaG_titleBlock",
39189
- "grid": "-kTeaG_grid",
39190
- "quickOptions": "-kTeaG_quickOptions",
39191
- "documentButton": "-kTeaG_documentButton",
39192
- "headerActions": "-kTeaG_headerActions",
39193
- "editorContext": "-kTeaG_editorContext",
39194
- "tabBadge": "-kTeaG_tabBadge",
39195
- "workbench": "-kTeaG_workbench",
39196
- "activeMode": "-kTeaG_activeMode",
39197
- "panelSummary": "-kTeaG_panelSummary",
39198
- "patchDetails": "-kTeaG_patchDetails",
39199
- "chatError": "-kTeaG_chatError",
39200
- "humanResponse": "-kTeaG_humanResponse",
39201
- "responseForm": "-kTeaG_responseForm",
39202
- "checkItem": "-kTeaG_checkItem",
39203
- "itemsPanel": "-kTeaG_itemsPanel",
39204
- "paneHead": "-kTeaG_paneHead",
39205
- "versionCompare": "-kTeaG_versionCompare",
39206
- "reviewTitle": "-kTeaG_reviewTitle",
39207
- "conflictActions": "-kTeaG_conflictActions",
39208
- "panelAction": "-kTeaG_panelAction",
39209
- "editorPane": "-kTeaG_editorPane",
39175
+ "toolbar": "-kTeaG_toolbar",
39176
+ "modal": "-kTeaG_modal",
39177
+ "mobileCollab": "-kTeaG_mobileCollab",
39210
39178
  "legacyWarning": "-kTeaG_legacyWarning",
39211
- "chatToggle": "-kTeaG_chatToggle",
39179
+ "notice": "-kTeaG_notice",
39212
39180
  "commentAction": "-kTeaG_commentAction",
39181
+ "richEditor": "-kTeaG_richEditor",
39182
+ "responseForm": "-kTeaG_responseForm",
39183
+ "editorPane": "-kTeaG_editorPane",
39184
+ "workbench": "-kTeaG_workbench",
39185
+ "editorBody": "-kTeaG_editorBody",
39186
+ "panelSummary": "-kTeaG_panelSummary",
39213
39187
  "conflictColumns": "-kTeaG_conflictColumns",
39214
- "requirementRow": "-kTeaG_requirementRow",
39215
- "entryActive": "-kTeaG_entryActive",
39216
- "mobileCollab": "-kTeaG_mobileCollab",
39217
- "decisionForm": "-kTeaG_decisionForm",
39218
- "tabScroller": "-kTeaG_tabScroller",
39219
- "iconButton": "-kTeaG_iconButton",
39220
- "checkBlocked": "-kTeaG_checkBlocked",
39221
- "tabbar": "-kTeaG_tabbar",
39222
- "conflictDialog": "-kTeaG_conflictDialog",
39223
- "conflictModal": "-kTeaG_conflictModal",
39224
- "modal": "-kTeaG_modal",
39225
- "header": "-kTeaG_header",
39226
- "footer": "-kTeaG_footer",
39227
- "mobileViewSwitch": "-kTeaG_mobileViewSwitch",
39228
- "aiMessage": "-kTeaG_aiMessage",
39188
+ "conflictDiffs": "-kTeaG_conflictDiffs",
39189
+ "versionCompare": "-kTeaG_versionCompare",
39190
+ "entry": "-kTeaG_entry",
39191
+ "execute": "-kTeaG_execute",
39192
+ "preview": "-kTeaG_preview",
39193
+ "endedReview": "-kTeaG_endedReview",
39229
39194
  "paneActions": "-kTeaG_paneActions",
39230
- "patchAccept": "-kTeaG_patchAccept",
39195
+ "documents": "-kTeaG_documents",
39196
+ "checkIcon": "-kTeaG_checkIcon",
39197
+ "entryActive": "-kTeaG_entryActive",
39198
+ "newThread": "-kTeaG_newThread",
39199
+ "paneHead": "-kTeaG_paneHead",
39200
+ "downstreamReturn": "-kTeaG_downstreamReturn",
39201
+ "itemsPanel": "-kTeaG_itemsPanel",
39231
39202
  "badges": "-kTeaG_badges",
39232
- "execute": "-kTeaG_execute",
39233
- "compareHead": "-kTeaG_compareHead",
39234
- "compareColumns": "-kTeaG_compareColumns",
39203
+ "selectionPrompt": "-kTeaG_selectionPrompt",
39204
+ "panelAction": "-kTeaG_panelAction",
39205
+ "review": "-kTeaG_review",
39206
+ "headerActions": "-kTeaG_headerActions",
39207
+ "decisionForm": "-kTeaG_decisionForm",
39208
+ "chatComposer": "-kTeaG_chatComposer",
39209
+ "reviewTitle": "-kTeaG_reviewTitle",
39210
+ "mobileSpec": "-kTeaG_mobileSpec",
39235
39211
  "cardActions": "-kTeaG_cardActions",
39236
- "noticeHidden": "-kTeaG_noticeHidden",
39212
+ "footer": "-kTeaG_footer",
39237
39213
  "selectedDoc": "-kTeaG_selectedDoc",
39238
- "readyHead": "-kTeaG_readyHead",
39239
- "endedReview": "-kTeaG_endedReview",
39240
- "preview": "-kTeaG_preview",
39241
- "entry": "-kTeaG_entry",
39242
- "reply": "-kTeaG_reply",
39243
- "editorTitle": "-kTeaG_editorTitle",
39244
- "checkPassed": "-kTeaG_checkPassed",
39245
- "selectionPrompt": "-kTeaG_selectionPrompt",
39246
- "dangerText": "-kTeaG_dangerText",
39214
+ "run": "-kTeaG_run",
39215
+ "userMessage": "-kTeaG_userMessage",
39216
+ "identity": "-kTeaG_identity",
39217
+ "conflictDialog": "-kTeaG_conflictDialog",
39218
+ "compareHead": "-kTeaG_compareHead",
39219
+ "mobileViewSwitch": "-kTeaG_mobileViewSwitch",
39220
+ "requirementRow": "-kTeaG_requirementRow",
39221
+ "reviewCardBody": "-kTeaG_reviewCardBody",
39222
+ "questionField": "-kTeaG_questionField",
39223
+ "patchDetails": "-kTeaG_patchDetails",
39224
+ "paneClosed": "-kTeaG_paneClosed",
39225
+ "requirementMenu": "-kTeaG_requirementMenu",
39226
+ "emptyMain": "-kTeaG_emptyMain",
39227
+ "reviewCard": "-kTeaG_reviewCard",
39228
+ "header": "-kTeaG_header",
39229
+ "pendingReview": "-kTeaG_pendingReview",
39230
+ "rowMenuButton": "-kTeaG_rowMenuButton",
39247
39231
  "threadList": "-kTeaG_threadList",
39248
39232
  "editorMeta": "-kTeaG_editorMeta",
39249
- "unsaved": "-kTeaG_unsaved",
39250
- "pendingReview": "-kTeaG_pendingReview",
39251
- "toolbar": "-kTeaG_toolbar",
39252
- "resizer": "-kTeaG_resizer",
39233
+ "reviewDetails": "-kTeaG_reviewDetails",
39234
+ "noticeHidden": "-kTeaG_noticeHidden",
39235
+ "editorContext": "-kTeaG_editorContext",
39236
+ "tabBadge": "-kTeaG_tabBadge",
39237
+ "runHistory": "-kTeaG_runHistory",
39238
+ "summaryInput": "-kTeaG_summaryInput",
39253
39239
  "dangerButton": "-kTeaG_dangerButton",
39254
- "empty": "-kTeaG_empty",
39240
+ "resizer": "-kTeaG_resizer",
39241
+ "quickOptions": "-kTeaG_quickOptions",
39242
+ "markdownBody": "-kTeaG_markdownBody",
39243
+ "saveButton": "-kTeaG_saveButton",
39244
+ "tabScroller": "-kTeaG_tabScroller",
39255
39245
  "collapseRight": "-kTeaG_collapseRight",
39256
- "reviewCard": "-kTeaG_reviewCard",
39257
- "reviewField": "-kTeaG_reviewField",
39258
- "questionField": "-kTeaG_questionField",
39246
+ "evidence": "-kTeaG_evidence",
39247
+ "humanResponse": "-kTeaG_humanResponse",
39248
+ "missingOptions": "-kTeaG_missingOptions",
39259
39249
  "patchPreview": "-kTeaG_patchPreview",
39260
- "downstreamReturn": "-kTeaG_downstreamReturn",
39250
+ "empty": "-kTeaG_empty",
39251
+ "reviewField": "-kTeaG_reviewField",
39252
+ "grid": "-kTeaG_grid",
39253
+ "chatToggle": "-kTeaG_chatToggle",
39254
+ "chatMessages": "-kTeaG_chatMessages",
39255
+ "aiMessage": "-kTeaG_aiMessage",
39256
+ "readyHead": "-kTeaG_readyHead",
39257
+ "checkItem": "-kTeaG_checkItem",
39258
+ "checkBlocked": "-kTeaG_checkBlocked",
39259
+ "tabbar": "-kTeaG_tabbar",
39260
+ "patchAccept": "-kTeaG_patchAccept",
39261
+ "checklist": "-kTeaG_checklist",
39262
+ "view": "-kTeaG_view",
39263
+ "iconButton": "-kTeaG_iconButton",
39264
+ "resizerHidden": "-kTeaG_resizerHidden",
39261
39265
  "itemRow": "-kTeaG_itemRow",
39262
- "missingOptions": "-kTeaG_missingOptions",
39263
- "reviewDetails": "-kTeaG_reviewDetails",
39264
- "checkIcon": "-kTeaG_checkIcon",
39266
+ "editorTitle": "-kTeaG_editorTitle",
39265
39267
  "versionRow": "-kTeaG_versionRow",
39268
+ "compareColumns": "-kTeaG_compareColumns",
39266
39269
  "conflictHeader": "-kTeaG_conflictHeader",
39267
- "saveButton": "-kTeaG_saveButton",
39268
- "userMessage": "-kTeaG_userMessage",
39269
- "conflictDiffs": "-kTeaG_conflictDiffs",
39270
- "chatComposer": "-kTeaG_chatComposer",
39271
- "rowMenuButton": "-kTeaG_rowMenuButton",
39272
- "newThread": "-kTeaG_newThread",
39273
- "reviewCardBody": "-kTeaG_reviewCardBody",
39274
- "evidence": "-kTeaG_evidence"
39270
+ "checkPassed": "-kTeaG_checkPassed",
39271
+ "chatError": "-kTeaG_chatError",
39272
+ "titleBlock": "-kTeaG_titleBlock",
39273
+ "conflictActions": "-kTeaG_conflictActions",
39274
+ "activeMode": "-kTeaG_activeMode"
39275
39275
  };
39276
39276
  //#endregion
39277
39277
  //#region src/client/SpecWorkbench.tsx
@@ -39337,7 +39337,7 @@ window.__ModuleLoader__.load({
39337
39337
  versions: "版本记录",
39338
39338
  ready: "完成检查"
39339
39339
  };
39340
- function SpecWorkbench({ api }) {
39340
+ function SpecWorkbench({ api, onClose }) {
39341
39341
  const [requirements, setRequirements] = (0, react.useState)([]);
39342
39342
  const [reviewWorkspaces, setReviewWorkspaces] = (0, react.useState)([]);
39343
39343
  const [participantBindings, setParticipantBindings] = (0, react.useState)([]);
@@ -39662,6 +39662,10 @@ window.__ModuleLoader__.load({
39662
39662
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
39663
39663
  className: workbench_module_css_default.headerActions,
39664
39664
  children: [
39665
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
39666
+ onClick: onClose,
39667
+ children: "返回聊天"
39668
+ }),
39665
39669
  selected && !selected.workspaceId && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
39666
39670
  onClick: () => {
39667
39671
  setBindWorkspaceOpen(true);
@@ -41239,6 +41243,7 @@ window.__ModuleLoader__.load({
41239
41243
  const ACTIVE = "data-dsh-spec-collab-active";
41240
41244
  const VIEW = "[data-dsh-spec-collab-view]";
41241
41245
  const ACTIVATE_EVENT = "dsh-panel-activate";
41246
+ const CLOSE_EVENT = "dsh-spec-collab-close";
41242
41247
  function mountWorkbench(api) {
41243
41248
  let root;
41244
41249
  let container;
@@ -41253,7 +41258,10 @@ window.__ModuleLoader__.load({
41253
41258
  container.className = workbench_module_css_default.view;
41254
41259
  column.appendChild(container);
41255
41260
  root = (0, react_dom_client.createRoot)(container);
41256
- root.render(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SpecWorkbench, { api }));
41261
+ root.render(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SpecWorkbench, {
41262
+ api,
41263
+ onClose: () => document.dispatchEvent(new CustomEvent(CLOSE_EVENT))
41264
+ }));
41257
41265
  };
41258
41266
  const observer = new MutationObserver(ensure);
41259
41267
  observer.observe(document.body, {
@@ -41281,6 +41289,7 @@ window.__ModuleLoader__.load({
41281
41289
  close();
41282
41290
  };
41283
41291
  document.addEventListener("click", closeOnExternalNavigation, true);
41292
+ document.addEventListener(CLOSE_EVENT, close);
41284
41293
  const toggle = () => {
41285
41294
  const opening = !document.documentElement.hasAttribute(ACTIVE);
41286
41295
  for (const name of document.documentElement.getAttributeNames()) if (name.startsWith("data-dsh-") && name.endsWith("-active")) document.documentElement.removeAttribute(name);
@@ -41313,6 +41322,7 @@ window.__ModuleLoader__.load({
41313
41322
  return () => {
41314
41323
  observer.disconnect();
41315
41324
  document.removeEventListener("click", closeOnExternalNavigation, true);
41325
+ document.removeEventListener(CLOSE_EVENT, close);
41316
41326
  close();
41317
41327
  row?.remove();
41318
41328
  document.querySelector(VIEW)?.remove();
@@ -1,6 +1,7 @@
1
1
  import '@toast-ui/editor/dist/i18n/zh-cn';
2
2
  import type { SpecApi } from './api.ts';
3
- export declare function SpecWorkbench({ api }: {
3
+ export declare function SpecWorkbench({ api, onClose }: {
4
4
  api: SpecApi;
5
+ onClose: () => void;
5
6
  }): import("react").JSX.Element;
6
7
  //# sourceMappingURL=SpecWorkbench.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpecWorkbench.d.ts","sourceRoot":"","sources":["../../../src/client/SpecWorkbench.tsx"],"names":[],"mappings":"AAGA,OAAO,kCAAkC,CAAA;AAGzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAiCvC,wBAAgB,aAAa,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,OAAO,CAAA;CAAE,+BAyItD"}
1
+ {"version":3,"file":"SpecWorkbench.d.ts","sourceRoot":"","sources":["../../../src/client/SpecWorkbench.tsx"],"names":[],"mappings":"AAGA,OAAO,kCAAkC,CAAA;AAGzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAiCvC,wBAAgB,aAAa,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,+BA0IpF"}
@@ -1 +1 @@
1
- {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/client/mount.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AASvC,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,IAAI,CAoBvD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,IAAI,CAuC9C"}
1
+ {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/client/mount.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAUvC,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,IAAI,CAoBvD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,IAAI,CAwC9C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-spec-collab",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "AI-assisted requirement clarification and Git-backed Spec co-creation for DeepSeek Harness, ending at a human-confirmed Ready Spec.",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -37,7 +37,7 @@ function currentPendingActions(requirement: RequirementView): RequirementView['a
37
37
  }
38
38
  const tabLabel: Record<SideTab, string> = { review: '审核问题', discussion: '协作讨论', patches: '修改建议', decisions: '确认决策', items: '我的事项', versions: '版本记录', ready: '完成检查' }
39
39
 
40
- export function SpecWorkbench({ api }: { api: SpecApi }) {
40
+ export function SpecWorkbench({ api, onClose }: { api: SpecApi; onClose: () => void }) {
41
41
  const [requirements, setRequirements] = useState<RequirementView[]>([])
42
42
  const [reviewWorkspaces, setReviewWorkspaces] = useState<ReviewWorkspaceSummary[]>([])
43
43
  const [participantBindings, setParticipantBindings] = useState<ParticipantSnapshot[]>([])
@@ -148,6 +148,7 @@ export function SpecWorkbench({ api }: { api: SpecApi }) {
148
148
  <header className={css.header}>
149
149
  <div className={css.titleBlock}><strong>{selected?.title ?? 'AI 需求澄清与 Spec 共创'}</strong>{selected && <span>{stageLabel(selected.stage)} · {selected.workspaceId ? reviewWorkspaces.find(workspace => workspace.workspaceId === selected.workspaceId)?.title ?? selected.workspaceId : '未绑定工作区'} · {selected.currentCommit.slice(0, 10)} · {selected.reviewItems.filter(item => item.commit === selected.currentCommit && item.severity === 'blocking' && !['resolved', 'non-blocking-verify', 'joint-review'].includes(item.status)).length} 阻塞</span>}</div>
150
150
  <div className={css.headerActions}>
151
+ <button onClick={onClose}>返回聊天</button>
151
152
  {selected && !selected.workspaceId && <button onClick={() => { setBindWorkspaceOpen(true); void api.reviewWorkspaces().then(setReviewWorkspaces, error => setNotice(error instanceof Error ? error.message : String(error))) }}>绑定工作区</button>}
152
153
  {selected?.stage === 'product-review' && <><button disabled={productFirstRunning || !selected.workspaceId} title={!selected.workspaceId ? '请先绑定工作区' : productFirstRunning ? '初审进行中' : '启动智能初审'} onClick={() => void requestReview('product-first')}>智能初审</button><button disabled={!selected.workspaceId} onClick={() => void requestReview('product-second')}>智能复审</button><button className={css.execute} onClick={() => void advance()}>进入产品确认</button></>}
153
154
  {selected?.stage === 'product-confirmation' && <><button onClick={() => void confirm('product')}>产品确认当前版本</button><button onClick={() => void advance()}>进入产研共审</button></>}
@@ -8,6 +8,7 @@ import { findSidebarAnchor } from './sidebar-anchor.ts'
8
8
  const ACTIVE = 'data-dsh-spec-collab-active'
9
9
  const VIEW = '[data-dsh-spec-collab-view]'
10
10
  const ACTIVATE_EVENT = 'dsh-panel-activate'
11
+ const CLOSE_EVENT = 'dsh-spec-collab-close'
11
12
 
12
13
  export function mountWorkbench(api: SpecApi): () => void {
13
14
  let root: Root | undefined
@@ -23,7 +24,7 @@ export function mountWorkbench(api: SpecApi): () => void {
23
24
  container.className = css.view!
24
25
  column.appendChild(container)
25
26
  root = createRoot(container)
26
- root.render(<SpecWorkbench api={api} />)
27
+ root.render(<SpecWorkbench api={api} onClose={() => document.dispatchEvent(new CustomEvent(CLOSE_EVENT))} />)
27
28
  }
28
29
  const observer = new MutationObserver(ensure)
29
30
  observer.observe(document.body, { childList: true, subtree: true })
@@ -41,6 +42,7 @@ export function mountSidebarEntry(): () => void {
41
42
  close()
42
43
  }
43
44
  document.addEventListener('click', closeOnExternalNavigation, true)
45
+ document.addEventListener(CLOSE_EVENT, close)
44
46
  const toggle = (): void => {
45
47
  const opening = !document.documentElement.hasAttribute(ACTIVE)
46
48
  for (const name of document.documentElement.getAttributeNames()) {
@@ -69,5 +71,5 @@ export function mountSidebarEntry(): () => void {
69
71
  const observer = new MutationObserver(ensure)
70
72
  observer.observe(document.body, { childList: true, subtree: true })
71
73
  ensure()
72
- return () => { observer.disconnect(); document.removeEventListener('click', closeOnExternalNavigation, true); close(); row?.remove(); document.querySelector(VIEW)?.remove() }
74
+ return () => { observer.disconnect(); document.removeEventListener('click', closeOnExternalNavigation, true); document.removeEventListener(CLOSE_EVENT, close); close(); row?.remove(); document.querySelector(VIEW)?.remove() }
73
75
  }