dsh-spec-collab 0.4.0 → 0.4.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.1 — 2026-11-11
4
+
5
+ - Support DSH 0.2.2-rc.1 while retaining 0.2.1-rc.5 compatibility. Declare bounded runtime and SDK peer windows for both release lines, including npm's default prerelease matching, and reject unverified 0.2.3 and later releases.
6
+ - Replace the removed Session Controller inspection call with paginated event history on DSH 0.2.2. Keep one history cursor while reading earlier pages, preserve chronological replies, reject non-advancing cursors, and fall back to inspection on DSH 0.2.1.
7
+ - Build and type-check against the 0.2.2-rc.1 SDK and support both Cordis 4.0/4.1 and native schema versions. Cover the original exact-peer rejection, supported and unsupported runtimes, legacy history, and the current history protocol.
8
+
3
9
  ## 0.4.0 — 2026-11-03
4
10
 
5
11
  - Support DeepSeek Harness 0.2.1-rc.5 and declare its Host services as exact SDK peers. Older DSH 0.1.1-rc.1 installations must continue using plugin 0.3.1.
package/README.md CHANGED
@@ -7,23 +7,25 @@ DeepSeek Harness 的需求“编辑校样台”,用于把原始需求澄清为
7
7
 
8
8
  产品边界严格止于 Ready Spec,不包含代码实现、测试用例生成、worktree、MR、部署、发布或交付状态管理。
9
9
 
10
- 当前版本为 `v0.4.0`,兼容 DeepSeek Harness `v0.2.1-rc.5`。DSH `v0.1.1-rc.1` 请继续使用插件 `v0.3.1`;两个版本使用不同的宿主接口。插件可在局域网 HTTP 地址下运行,不依赖浏览器提供 `crypto.randomUUID`;新版 DSH 从“插件”入口旁挂载“需求讨论”,旧版侧栏仍支持“技能中心 / 设置”入口。
10
+ 当前版本为 `v0.4.1`,支持 DeepSeek Harness `0.2.1`(从 `rc.5` 起)与 `0.2.2`(从 `rc.1` 起),包含对应的稳定版本。插件使用有上界的 `engines.dsh` 和 SDK peer 范围;`0.2.3` 及后续系列需要验证后再扩展支持。DSH `v0.1.1-rc.1` 请继续使用插件 `v0.3.1`。
11
+
12
+ 插件在 DSH `0.2.2` 上通过分页事件接口读取完整 AI 历史,并保留 `0.2.1` 的历史读取方式。插件可在局域网 HTTP 地址下运行,不依赖浏览器提供 `crypto.randomUUID`;侧栏从“插件”入口旁挂载“需求讨论”,同时保留“技能中心 / 设置”定位。
11
13
 
12
14
  ## 安装
13
15
 
14
- 可在 DSH 插件管理中选择“安装第三方插件”,输入 `dsh-spec-collab@0.4.0`。命令行安装可使用与宿主同版本的 CLI:
16
+ 可在 DSH 插件管理中选择“安装第三方插件”,输入 `dsh-spec-collab@0.4.1`。命令行安装可使用与宿主同版本的 CLI:
15
17
 
16
18
  ```sh
17
- npx -y @deepseek-ai/dsh@0.2.1-rc.5 plugin --profile desktop add dsh-spec-collab@0.4.0
19
+ npx -y @deepseek-ai/dsh@0.2.2-rc.1 plugin --profile desktop add dsh-spec-collab@0.4.1
18
20
  ```
19
21
 
20
22
  如果 `dsh` 已在 `PATH` 中,也可以使用简写:
21
23
 
22
24
  ```sh
23
- dsh plugin --profile desktop add dsh-spec-collab@0.4.0
25
+ dsh plugin --profile desktop add dsh-spec-collab@0.4.1
24
26
  ```
25
27
 
26
- 安装到当前正在使用的 profile 后,在插件管理中确认插件已启用;如界面提示需要重启,重启现有桌面应用或 `dsh web` 进程。后续更新仍通过同一 profile 安装明确兼容的版本。
28
+ 安装到当前正在使用的 profile 后,在插件管理中确认插件已启用;如界面提示需要重启,重启现有桌面应用或 `dsh web` 进程。已安装 `0.4.0` 时,在同一 profile 中卸载旧版后安装 `0.4.1`,再启用插件。
27
29
 
28
30
  插件已经内置非安全 HTTP 环境所需的 UUID fallback,不需要通过代理向 HTML 注入 `crypto` polyfill。团队部署仍建议使用 HTTPS,并在 DSH 前配置认证。
29
31
 
@@ -94,7 +96,7 @@ dsh plugin --profile desktop add dsh-spec-collab@0.4.0
94
96
 
95
97
  </details>
96
98
 
97
- ## 当前能力(v0.4.0)
99
+ ## 当前能力(v0.4.1)
98
100
 
99
101
  ### 需求正文与版本
100
102
 
package/lib/client.js CHANGED
@@ -5807,7 +5807,7 @@ window.__ModuleLoader__.load({
5807
5807
  return new OrderedMap(content);
5808
5808
  };
5809
5809
  //#endregion
5810
- //#region node_modules/.pnpm/prosemirror-model@1.25.12/node_modules/prosemirror-model/dist/index.js
5810
+ //#region node_modules/.pnpm/prosemirror-model@1.25.13/node_modules/prosemirror-model/dist/index.js
5811
5811
  function findDiffStart(a, b, pos) {
5812
5812
  for (let i = 0;; i++) {
5813
5813
  if (i == a.childCount || i == b.childCount) return a.childCount == b.childCount ? null : pos;
@@ -7192,6 +7192,15 @@ window.__ModuleLoader__.load({
7192
7192
  }
7193
7193
  };
7194
7194
  Node$3.prototype.text = void 0;
7195
+ const v8InternHack = (() => {
7196
+ let { stack } = /* @__PURE__ */ new Error("/");
7197
+ if (!stack || !/\n\s*at\s/.test(stack)) return (s) => s;
7198
+ let obj = Object.create(null);
7199
+ return (s) => {
7200
+ obj[s];
7201
+ return s;
7202
+ };
7203
+ })();
7195
7204
  var TextNode = class TextNode extends Node$3 {
7196
7205
  /**
7197
7206
  @internal
@@ -7209,7 +7218,7 @@ window.__ModuleLoader__.load({
7209
7218
  return this.text;
7210
7219
  }
7211
7220
  textBetween(from, to) {
7212
- return this.text.slice(from, to);
7221
+ return v8InternHack(this.text.slice(from, to));
7213
7222
  }
7214
7223
  get nodeSize() {
7215
7224
  return this.text.length;
@@ -7223,7 +7232,7 @@ window.__ModuleLoader__.load({
7223
7232
  }
7224
7233
  cut(from = 0, to = this.text.length) {
7225
7234
  if (from == 0 && to == this.text.length) return this;
7226
- return this.withText(this.text.slice(from, to));
7235
+ return this.withText(v8InternHack(this.text.slice(from, to)));
7227
7236
  }
7228
7237
  eq(other) {
7229
7238
  return this.sameMarkup(other) && this.text == other.text;
@@ -8784,7 +8793,7 @@ window.__ModuleLoader__.load({
8784
8793
  };
8785
8794
  }
8786
8795
  //#endregion
8787
- //#region node_modules/.pnpm/prosemirror-transform@1.12.4/node_modules/prosemirror-transform/dist/index.js
8796
+ //#region node_modules/.pnpm/prosemirror-transform@1.12.5/node_modules/prosemirror-transform/dist/index.js
8788
8797
  const lower16 = 65535;
8789
8798
  const factor16 = Math.pow(2, 16);
8790
8799
  function makeRecover(index, offset) {
@@ -9559,7 +9568,7 @@ window.__ModuleLoader__.load({
9559
9568
  let from = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);
9560
9569
  let gapFrom = this.from == this.gapFrom ? from.pos : mapping.map(this.gapFrom, -1);
9561
9570
  let gapTo = this.to == this.gapTo ? to.pos : mapping.map(this.gapTo, 1);
9562
- if (from.deletedAcross && to.deletedAcross || gapFrom < from.pos || gapTo > to.pos) return null;
9571
+ if (from.deletedAcross && to.deletedAcross || gapFrom < from.pos || gapTo > to.pos || gapFrom > gapTo) return null;
9563
9572
  return new ReplaceAroundStep(from.pos, to.pos, gapFrom, gapTo, this.slice, this.insert, this.structure);
9564
9573
  }
9565
9574
  toJSON() {
@@ -10073,15 +10082,14 @@ window.__ModuleLoader__.load({
10073
10082
  this.placed = addToFragment(this.placed, frontierDepth, Fragment.from(add));
10074
10083
  this.frontier[frontierDepth].match = match;
10075
10084
  if (toEnd && openEndCount < 0 && parent && parent.type == this.frontier[this.depth].type && this.frontier.length > 1) this.closeFrontierNode();
10076
- for (let i = 0, cur = fragment; i < openEndCount; i++) {
10077
- let node = cur.lastChild;
10085
+ for (let i = 0, cur = add[add.length - 1]; cur && i < openEndCount; i++) {
10078
10086
  this.frontier.push({
10079
- type: node.type,
10080
- match: node.contentMatchAt(node.childCount)
10087
+ type: cur.type,
10088
+ match: cur.contentMatchAt(cur.childCount)
10081
10089
  });
10082
- cur = node.content;
10090
+ cur = cur.lastChild;
10083
10091
  }
10084
- this.unplaced = !toEnd ? new Slice(dropFromFragment(slice.content, sliceDepth, taken), slice.openStart, slice.openEnd) : sliceDepth == 0 ? Slice.empty : new Slice(dropFromFragment(slice.content, sliceDepth - 1, 1), sliceDepth - 1, openEndCount < 0 ? slice.openEnd : sliceDepth - 1);
10092
+ this.unplaced = !toEnd ? new Slice(dropFromFragment(slice.content, sliceDepth, taken), sliceDepth, slice.openEnd) : sliceDepth == 0 ? Slice.empty : new Slice(dropFromFragment(slice.content, sliceDepth - 1, 1), sliceDepth - 1, openEndCount < 0 ? slice.openEnd : sliceDepth - 1);
10085
10093
  }
10086
10094
  mustMoveInline() {
10087
10095
  if (!this.$to.parent.isTextblock) return -1;
@@ -46757,265 +46765,265 @@ window.__ModuleLoader__.load({
46757
46765
  document.head.appendChild(tag);
46758
46766
  }
46759
46767
  var workbench_module_css_default = {
46760
- "versionCopy": "-kTeaG_versionCopy",
46761
- "reviewDecisionContext": "-kTeaG_reviewDecisionContext",
46762
- "commentActions": "-kTeaG_commentActions",
46763
- "rowMenuButton": "-kTeaG_rowMenuButton",
46764
- "reviewTitle": "-kTeaG_reviewTitle",
46765
- "insightDialog": "-kTeaG_insightDialog",
46766
- "mobileCollab": "-kTeaG_mobileCollab",
46767
- "panelSummary": "-kTeaG_panelSummary",
46768
- "stage_product-confirmation": "-kTeaG_stage_product-confirmation",
46769
- "unsaved": "-kTeaG_unsaved",
46770
- "commentSourceButton": "-kTeaG_commentSourceButton",
46771
- "entryActive": "-kTeaG_entryActive",
46772
- "inlineReviewHeadActions": "-kTeaG_inlineReviewHeadActions",
46773
- "structuredDiff": "-kTeaG_structuredDiff",
46774
- "documentCommentAnchor": "-kTeaG_documentCommentAnchor",
46775
- "cardActions": "-kTeaG_cardActions",
46776
- "insightFilters": "-kTeaG_insightFilters",
46777
- "decisionSection": "-kTeaG_decisionSection",
46778
- "decisionEvidenceList": "-kTeaG_decisionEvidenceList",
46779
- "collabMetric": "-kTeaG_collabMetric",
46768
+ "checklist": "-kTeaG_checklist",
46769
+ "selectionPromptAbove": "-kTeaG_selectionPromptAbove",
46770
+ "formGrid": "-kTeaG_formGrid",
46771
+ "conflictHeader": "-kTeaG_conflictHeader",
46772
+ "emptyPanel": "-kTeaG_emptyPanel",
46773
+ "mobileViewSwitch": "-kTeaG_mobileViewSwitch",
46774
+ "collabStateDirty": "-kTeaG_collabStateDirty",
46775
+ "reviewCheckCopy": "-kTeaG_reviewCheckCopy",
46776
+ "header": "-kTeaG_header",
46777
+ "readyHead": "-kTeaG_readyHead",
46778
+ "commentBody": "-kTeaG_commentBody",
46780
46779
  "documentAnchorSelected": "-kTeaG_documentAnchorSelected",
46781
- "srOnly": "-kTeaG_srOnly",
46780
+ "myWorkButton": "-kTeaG_myWorkButton",
46781
+ "collapseChat": "-kTeaG_collapseChat",
46782
+ "selectionPromptHead": "-kTeaG_selectionPromptHead",
46783
+ "inlineReviewActions": "-kTeaG_inlineReviewActions",
46784
+ "collabBarActions": "-kTeaG_collabBarActions",
46785
+ "reviewDecisionContext": "-kTeaG_reviewDecisionContext",
46786
+ "reviewDecisionBody": "-kTeaG_reviewDecisionBody",
46782
46787
  "editorTitle": "-kTeaG_editorTitle",
46783
- "decisionEmpty": "-kTeaG_decisionEmpty",
46784
- "headerActions": "-kTeaG_headerActions",
46785
- "checklistMeter": "-kTeaG_checklistMeter",
46786
- "modal": "-kTeaG_modal",
46787
- "selectionPromptButtons": "-kTeaG_selectionPromptButtons",
46788
- "patchImpact": "-kTeaG_patchImpact",
46789
- "productName": "-kTeaG_productName",
46790
- "collabStateDirty": "-kTeaG_collabStateDirty",
46791
- "tabPanel": "-kTeaG_tabPanel",
46792
- "badges": "-kTeaG_badges",
46793
- "patchPreview": "-kTeaG_patchPreview",
46794
- "footer": "-kTeaG_footer",
46795
- "recordLinkButton": "-kTeaG_recordLinkButton",
46796
- "documentReviewHighlightBlocking": "-kTeaG_documentReviewHighlightBlocking",
46797
- "richEditorShell": "-kTeaG_richEditorShell",
46798
- "diffAdded": "-kTeaG_diffAdded",
46799
- "versionActions": "-kTeaG_versionActions",
46800
- "reviewChecklist": "-kTeaG_reviewChecklist",
46801
- "documentAnchorHighlightSelected": "-kTeaG_documentAnchorHighlightSelected",
46802
- "activeContext": "-kTeaG_activeContext",
46788
+ "aiMessage": "-kTeaG_aiMessage",
46789
+ "documentCommentAnchor": "-kTeaG_documentCommentAnchor",
46790
+ "userMessage": "-kTeaG_userMessage",
46791
+ "chatError": "-kTeaG_chatError",
46792
+ "reviewChecklistAnswered": "-kTeaG_reviewChecklistAnswered",
46793
+ "statusDot": "-kTeaG_statusDot",
46803
46794
  "selectedDecisionOption": "-kTeaG_selectedDecisionOption",
46804
- "collabMetricWarn": "-kTeaG_collabMetricWarn",
46795
+ "reviewCheckMeta": "-kTeaG_reviewCheckMeta",
46796
+ "documentCommentHighlight": "-kTeaG_documentCommentHighlight",
46797
+ "execute": "-kTeaG_execute",
46798
+ "decisionAsideHead": "-kTeaG_decisionAsideHead",
46805
46799
  "diffCollapsed": "-kTeaG_diffCollapsed",
46806
- "dialogHead": "-kTeaG_dialogHead",
46807
- "documentButton": "-kTeaG_documentButton",
46808
- "diffDialog": "-kTeaG_diffDialog",
46809
- "mobileSpec": "-kTeaG_mobileSpec",
46810
- "requirementMenu": "-kTeaG_requirementMenu",
46811
- "reviewChecklistBlocking": "-kTeaG_reviewChecklistBlocking",
46812
- "emptyList": "-kTeaG_emptyList",
46800
+ "threadList": "-kTeaG_threadList",
46813
46801
  "notice": "-kTeaG_notice",
46814
- "titleBlock": "-kTeaG_titleBlock",
46815
- "iconButton": "-kTeaG_iconButton",
46816
- "aiMessage": "-kTeaG_aiMessage",
46817
- "replyComposer": "-kTeaG_replyComposer",
46818
- "commentThread": "-kTeaG_commentThread",
46819
- "insightPanel": "-kTeaG_insightPanel",
46820
- "panelAction": "-kTeaG_panelAction",
46821
- "runHistory": "-kTeaG_runHistory",
46822
- "chatToggle": "-kTeaG_chatToggle",
46823
- "decisionModeHint": "-kTeaG_decisionModeHint",
46824
- "editorCollabBar": "-kTeaG_editorCollabBar",
46825
- "insightCard": "-kTeaG_insightCard",
46826
- "mobileViewSwitch": "-kTeaG_mobileViewSwitch",
46827
- "editorBody": "-kTeaG_editorBody",
46828
- "pulse": "-kTeaG_pulse",
46829
- "decisionForm": "-kTeaG_decisionForm",
46830
- "reviewChecklistSettled": "-kTeaG_reviewChecklistSettled",
46831
- "notificationList": "-kTeaG_notificationList",
46832
- "paneClosed": "-kTeaG_paneClosed",
46833
- "insightScore": "-kTeaG_insightScore",
46834
- "runningDot": "-kTeaG_runningDot",
46835
- "reviewDecisionHeader": "-kTeaG_reviewDecisionHeader",
46836
- "stage_joint-review": "-kTeaG_stage_joint-review",
46837
- "backLabel": "-kTeaG_backLabel",
46838
- "collabBarActions": "-kTeaG_collabBarActions",
46839
- "collapseChat": "-kTeaG_collapseChat",
46840
- "quietButton": "-kTeaG_quietButton",
46841
- "review": "-kTeaG_review",
46842
- "paneActions": "-kTeaG_paneActions",
46843
- "documentReviewAnchorSelected": "-kTeaG_documentReviewAnchorSelected",
46844
46802
  "compareHead": "-kTeaG_compareHead",
46845
- "myWorkList": "-kTeaG_myWorkList",
46846
- "primaryNav": "-kTeaG_primaryNav",
46847
- "resizer": "-kTeaG_resizer",
46848
- "selectionPromptAbove": "-kTeaG_selectionPromptAbove",
46849
- "versionCompare": "-kTeaG_versionCompare",
46850
- "diffHeader": "-kTeaG_diffHeader",
46851
- "emptyMain": "-kTeaG_emptyMain",
46852
- "decisionQuestion": "-kTeaG_decisionQuestion",
46853
- "chatError": "-kTeaG_chatError",
46854
- "selectionPromptSubmit": "-kTeaG_selectionPromptSubmit",
46855
- "selectionPrompt": "-kTeaG_selectionPrompt",
46856
- "identity": "-kTeaG_identity",
46857
- "decisionTags": "-kTeaG_decisionTags",
46858
- "commentBody": "-kTeaG_commentBody",
46859
- "statusDot": "-kTeaG_statusDot",
46860
- "compareColumns": "-kTeaG_compareColumns",
46861
- "inlineReviewHead": "-kTeaG_inlineReviewHead",
46862
- "inlineReviewActions": "-kTeaG_inlineReviewActions",
46863
- "grid": "-kTeaG_grid",
46803
+ "createButton": "-kTeaG_createButton",
46864
46804
  "emptyAside": "-kTeaG_emptyAside",
46865
- "inlineReviewDetails": "-kTeaG_inlineReviewDetails",
46866
- "reviewHeader": "-kTeaG_reviewHeader",
46867
- "decisionAsideHead": "-kTeaG_decisionAsideHead",
46868
- "activeMode": "-kTeaG_activeMode",
46869
- "aiConversation": "-kTeaG_aiConversation",
46870
- "dangerText": "-kTeaG_dangerText",
46871
- "reviewCheckMeta": "-kTeaG_reviewCheckMeta",
46872
- "commentGlyph": "-kTeaG_commentGlyph",
46873
- "selectionPromptCancel": "-kTeaG_selectionPromptCancel",
46874
- "reviewCheckStatus": "-kTeaG_reviewCheckStatus",
46875
- "inlineReviewBody": "-kTeaG_inlineReviewBody",
46876
- "tabBadge": "-kTeaG_tabBadge",
46877
46805
  "unreadNotification": "-kTeaG_unreadNotification",
46806
+ "reviewCheckArrow": "-kTeaG_reviewCheckArrow",
46807
+ "documentAnchorHighlight": "-kTeaG_documentAnchorHighlight",
46808
+ "notificationDialog": "-kTeaG_notificationDialog",
46809
+ "productName": "-kTeaG_productName",
46878
46810
  "threadPills": "-kTeaG_threadPills",
46879
- "checklist": "-kTeaG_checklist",
46880
- "toolbar": "-kTeaG_toolbar",
46881
- "decisionActions": "-kTeaG_decisionActions",
46882
- "decisionSource": "-kTeaG_decisionSource",
46811
+ "mobileDocumentsTrigger": "-kTeaG_mobileDocumentsTrigger",
46812
+ "formErrors": "-kTeaG_formErrors",
46813
+ "primaryNav": "-kTeaG_primaryNav",
46883
46814
  "summaryField": "-kTeaG_summaryField",
46884
- "emptyPanel": "-kTeaG_emptyPanel",
46885
- "checkItem": "-kTeaG_checkItem",
46886
- "patchAccept": "-kTeaG_patchAccept",
46887
- "requirementRow": "-kTeaG_requirementRow",
46888
- "replyStack": "-kTeaG_replyStack",
46889
- "discussionSummary": "-kTeaG_discussionSummary",
46890
- "reviewDecisionDialog": "-kTeaG_reviewDecisionDialog",
46891
- "workbench": "-kTeaG_workbench",
46892
- "reviewDecisionAside": "-kTeaG_reviewDecisionAside",
46893
- "myWorkButton": "-kTeaG_myWorkButton",
46894
- "conflictColumns": "-kTeaG_conflictColumns",
46895
- "taskAssignment": "-kTeaG_taskAssignment",
46896
- "versionPicker": "-kTeaG_versionPicker",
46897
- "diffContext": "-kTeaG_diffContext",
46898
- "conflictDialog": "-kTeaG_conflictDialog",
46899
- "importPreview": "-kTeaG_importPreview",
46900
- "decisionSourceList": "-kTeaG_decisionSourceList",
46815
+ "taskQueue": "-kTeaG_taskQueue",
46816
+ "documentReviewAnchorBlocking": "-kTeaG_documentReviewAnchorBlocking",
46817
+ "myWorkList": "-kTeaG_myWorkList",
46818
+ "inlineReviewHead": "-kTeaG_inlineReviewHead",
46819
+ "activeMode": "-kTeaG_activeMode",
46820
+ "reviewCheckBox": "-kTeaG_reviewCheckBox",
46821
+ "resizerHidden": "-kTeaG_resizerHidden",
46822
+ "disabledReason": "-kTeaG_disabledReason",
46823
+ "mobileSpec": "-kTeaG_mobileSpec",
46824
+ "checkPassed": "-kTeaG_checkPassed",
46825
+ "checkBlocked": "-kTeaG_checkBlocked",
46826
+ "decisionSectionHead": "-kTeaG_decisionSectionHead",
46827
+ "workflowEyebrow": "-kTeaG_workflowEyebrow",
46828
+ "summaryInput": "-kTeaG_summaryInput",
46901
46829
  "requirementFilters": "-kTeaG_requirementFilters",
46902
- "reviewAnchorLayer": "-kTeaG_reviewAnchorLayer",
46830
+ "noticeHidden": "-kTeaG_noticeHidden",
46831
+ "chatToggle": "-kTeaG_chatToggle",
46832
+ "documentReviewHighlightBlocking": "-kTeaG_documentReviewHighlightBlocking",
46833
+ "diffDialog": "-kTeaG_diffDialog",
46834
+ "inlineDecisionOptions": "-kTeaG_inlineDecisionOptions",
46835
+ "chatComposer": "-kTeaG_chatComposer",
46836
+ "commentActions": "-kTeaG_commentActions",
46837
+ "paneHead": "-kTeaG_paneHead",
46838
+ "quietButton": "-kTeaG_quietButton",
46839
+ "documentButton": "-kTeaG_documentButton",
46840
+ "entryActive": "-kTeaG_entryActive",
46841
+ "focusMode": "-kTeaG_focusMode",
46842
+ "threadHeaderActions": "-kTeaG_threadHeaderActions",
46843
+ "commentSourceSelected": "-kTeaG_commentSourceSelected",
46844
+ "emptyList": "-kTeaG_emptyList",
46845
+ "collabMetric": "-kTeaG_collabMetric",
46846
+ "contextNav": "-kTeaG_contextNav",
46847
+ "runningDot": "-kTeaG_runningDot",
46848
+ "reviewChecklistSettled": "-kTeaG_reviewChecklistSettled",
46849
+ "importPreview": "-kTeaG_importPreview",
46850
+ "taskAssignment": "-kTeaG_taskAssignment",
46851
+ "collapseRight": "-kTeaG_collapseRight",
46852
+ "collabMetricWarn": "-kTeaG_collabMetricWarn",
46903
46853
  "decisionEvidence": "-kTeaG_decisionEvidence",
46904
- "inlineReviewSource": "-kTeaG_inlineReviewSource",
46905
- "insightActions": "-kTeaG_insightActions",
46906
- "readyPackage": "-kTeaG_readyPackage",
46854
+ "chatMessages": "-kTeaG_chatMessages",
46855
+ "dangerButton": "-kTeaG_dangerButton",
46856
+ "selectionPromptCancel": "-kTeaG_selectionPromptCancel",
46857
+ "headerActions": "-kTeaG_headerActions",
46858
+ "workflowFocus": "-kTeaG_workflowFocus",
46859
+ "resizer": "-kTeaG_resizer",
46860
+ "titleBlock": "-kTeaG_titleBlock",
46861
+ "downstreamReturn": "-kTeaG_downstreamReturn",
46862
+ "threadStack": "-kTeaG_threadStack",
46863
+ "diffActions": "-kTeaG_diffActions",
46864
+ "structuredDiff": "-kTeaG_structuredDiff",
46865
+ "cardActions": "-kTeaG_cardActions",
46866
+ "srOnly": "-kTeaG_srOnly",
46867
+ "decisionSourceList": "-kTeaG_decisionSourceList",
46868
+ "documentAnchorHighlightSelected": "-kTeaG_documentAnchorHighlightSelected",
46869
+ "stage_joint-review": "-kTeaG_stage_joint-review",
46870
+ "conflictActions": "-kTeaG_conflictActions",
46871
+ "editorCollabBar": "-kTeaG_editorCollabBar",
46872
+ "discussionFilters": "-kTeaG_discussionFilters",
46873
+ "stage_ready": "-kTeaG_stage_ready",
46874
+ "inlineReviewBody": "-kTeaG_inlineReviewBody",
46875
+ "patchAccept": "-kTeaG_patchAccept",
46876
+ "reviewDecisionHeader": "-kTeaG_reviewDecisionHeader",
46877
+ "mobileDrawerClose": "-kTeaG_mobileDrawerClose",
46878
+ "collabStateRunning": "-kTeaG_collabStateRunning",
46879
+ "selectionPromptActions": "-kTeaG_selectionPromptActions",
46880
+ "documentReviewAnchorSelected": "-kTeaG_documentReviewAnchorSelected",
46907
46881
  "myWorkSummary": "-kTeaG_myWorkSummary",
46908
- "commentThreadClosed": "-kTeaG_commentThreadClosed",
46909
- "stageCurrent": "-kTeaG_stageCurrent",
46910
- "historyGroup": "-kTeaG_historyGroup",
46911
- "reviewDecisionBody": "-kTeaG_reviewDecisionBody",
46882
+ "patchImpact": "-kTeaG_patchImpact",
46883
+ "inlineReviewSource": "-kTeaG_inlineReviewSource",
46884
+ "patchPreview": "-kTeaG_patchPreview",
46885
+ "selectionPromptSubmit": "-kTeaG_selectionPromptSubmit",
46886
+ "markdownBody": "-kTeaG_markdownBody",
46887
+ "workbench": "-kTeaG_workbench",
46888
+ "backLabel": "-kTeaG_backLabel",
46889
+ "decisionSourceHead": "-kTeaG_decisionSourceHead",
46912
46890
  "fileButton": "-kTeaG_fileButton",
46913
- "saveButton": "-kTeaG_saveButton",
46914
- "decisionSectionHead": "-kTeaG_decisionSectionHead",
46915
- "notificationButton": "-kTeaG_notificationButton",
46916
- "dialogForm": "-kTeaG_dialogForm",
46917
- "legacyWarning": "-kTeaG_legacyWarning",
46918
- "focusMode": "-kTeaG_focusMode",
46919
46891
  "taskRow": "-kTeaG_taskRow",
46920
- "header": "-kTeaG_header",
46921
- "stageRail": "-kTeaG_stageRail",
46922
- "richEditor": "-kTeaG_richEditor",
46923
- "checkIcon": "-kTeaG_checkIcon",
46924
- "paneHead": "-kTeaG_paneHead",
46925
- "workflowEyebrow": "-kTeaG_workflowEyebrow",
46926
- "decisionSourceHead": "-kTeaG_decisionSourceHead",
46927
- "documentReviewAnchorBlocking": "-kTeaG_documentReviewAnchorBlocking",
46928
- "collabStateRunning": "-kTeaG_collabStateRunning",
46929
- "conflictDiffs": "-kTeaG_conflictDiffs",
46930
- "inlineDecisionOptions": "-kTeaG_inlineDecisionOptions",
46931
- "decisionOptions": "-kTeaG_decisionOptions",
46892
+ "review": "-kTeaG_review",
46893
+ "commentGlyph": "-kTeaG_commentGlyph",
46894
+ "reviewDecisionAside": "-kTeaG_reviewDecisionAside",
46895
+ "insightDialog": "-kTeaG_insightDialog",
46932
46896
  "entry": "-kTeaG_entry",
46933
- "filterChecks": "-kTeaG_filterChecks",
46934
- "notificationDialog": "-kTeaG_notificationDialog",
46935
- "mobileDocumentsOpen": "-kTeaG_mobileDocumentsOpen",
46936
- "checkBlocked": "-kTeaG_checkBlocked",
46937
- "insightLinks": "-kTeaG_insightLinks",
46938
- "noticeHidden": "-kTeaG_noticeHidden",
46939
- "reviewChecklistAnswered": "-kTeaG_reviewChecklistAnswered",
46940
- "reviewCheckBox": "-kTeaG_reviewCheckBox",
46941
- "inlineReviewPrompt": "-kTeaG_inlineReviewPrompt",
46942
- "view": "-kTeaG_view",
46943
- "editorContext": "-kTeaG_editorContext",
46944
- "createButton": "-kTeaG_createButton",
46945
- "reviewSourceSelected": "-kTeaG_reviewSourceSelected",
46946
- "run": "-kTeaG_run",
46947
- "collabBarState": "-kTeaG_collabBarState",
46948
- "mobileDrawerClose": "-kTeaG_mobileDrawerClose",
46897
+ "dangerText": "-kTeaG_dangerText",
46898
+ "selectedDoc": "-kTeaG_selectedDoc",
46899
+ "panelSummary": "-kTeaG_panelSummary",
46900
+ "commentThreadHead": "-kTeaG_commentThreadHead",
46901
+ "decisionSection": "-kTeaG_decisionSection",
46949
46902
  "reviewChecklistSelected": "-kTeaG_reviewChecklistSelected",
46950
- "readyHead": "-kTeaG_readyHead",
46903
+ "requirementMenu": "-kTeaG_requirementMenu",
46904
+ "historyGroup": "-kTeaG_historyGroup",
46905
+ "diffHeader": "-kTeaG_diffHeader",
46906
+ "discussionSummary": "-kTeaG_discussionSummary",
46907
+ "checkItem": "-kTeaG_checkItem",
46908
+ "notificationList": "-kTeaG_notificationList",
46909
+ "inlineDecisionForm": "-kTeaG_inlineDecisionForm",
46910
+ "insightActions": "-kTeaG_insightActions",
46911
+ "editorMeta": "-kTeaG_editorMeta",
46912
+ "reviewChecklist": "-kTeaG_reviewChecklist",
46913
+ "rowMenuButton": "-kTeaG_rowMenuButton",
46914
+ "runHistory": "-kTeaG_runHistory",
46915
+ "decisionEvidenceList": "-kTeaG_decisionEvidenceList",
46916
+ "notificationButton": "-kTeaG_notificationButton",
46917
+ "activeFilters": "-kTeaG_activeFilters",
46918
+ "footer": "-kTeaG_footer",
46919
+ "saveButton": "-kTeaG_saveButton",
46920
+ "diffContext": "-kTeaG_diffContext",
46921
+ "editorBody": "-kTeaG_editorBody",
46922
+ "decisionActions": "-kTeaG_decisionActions",
46923
+ "iconButton": "-kTeaG_iconButton",
46924
+ "commentThread": "-kTeaG_commentThread",
46925
+ "stageRail": "-kTeaG_stageRail",
46926
+ "emptyMain": "-kTeaG_emptyMain",
46951
46927
  "reviewCard": "-kTeaG_reviewCard",
46952
- "diffRemoved": "-kTeaG_diffRemoved",
46928
+ "dialogHead": "-kTeaG_dialogHead",
46929
+ "reply": "-kTeaG_reply",
46953
46930
  "readyPackageHead": "-kTeaG_readyPackageHead",
46954
- "formGrid": "-kTeaG_formGrid",
46955
- "commentThreadHead": "-kTeaG_commentThreadHead",
46956
- "taskQueue": "-kTeaG_taskQueue",
46957
- "documents": "-kTeaG_documents",
46958
- "commentSourceSelected": "-kTeaG_commentSourceSelected",
46959
- "selectionPromptBelow": "-kTeaG_selectionPromptBelow",
46931
+ "stickyActions": "-kTeaG_stickyActions",
46932
+ "documentReviewAnchor": "-kTeaG_documentReviewAnchor",
46933
+ "identity": "-kTeaG_identity",
46934
+ "requirementRow": "-kTeaG_requirementRow",
46935
+ "inlineReviewPrompt": "-kTeaG_inlineReviewPrompt",
46936
+ "conflictDialog": "-kTeaG_conflictDialog",
46937
+ "toolbar": "-kTeaG_toolbar",
46938
+ "reviewSourceSelected": "-kTeaG_reviewSourceSelected",
46939
+ "commentSourceButton": "-kTeaG_commentSourceButton",
46940
+ "insightFilters": "-kTeaG_insightFilters",
46941
+ "selectionPromptClose": "-kTeaG_selectionPromptClose",
46942
+ "readyPackage": "-kTeaG_readyPackage",
46943
+ "collabMetricActive": "-kTeaG_collabMetricActive",
46944
+ "dialogSurface": "-kTeaG_dialogSurface",
46945
+ "versionCopy": "-kTeaG_versionCopy",
46946
+ "editorContext": "-kTeaG_editorContext",
46960
46947
  "requirementSearch": "-kTeaG_requirementSearch",
46961
- "conflictHeader": "-kTeaG_conflictHeader",
46962
- "diffActions": "-kTeaG_diffActions",
46963
- "editorPane": "-kTeaG_editorPane",
46964
- "chatMessages": "-kTeaG_chatMessages",
46965
- "contextNav": "-kTeaG_contextNav",
46948
+ "decisionEmpty": "-kTeaG_decisionEmpty",
46949
+ "insightCard": "-kTeaG_insightCard",
46950
+ "decisionForm": "-kTeaG_decisionForm",
46951
+ "stageDone": "-kTeaG_stageDone",
46952
+ "reviewChecklistBlocking": "-kTeaG_reviewChecklistBlocking",
46966
46953
  "commentThreadSelected": "-kTeaG_commentThreadSelected",
46967
- "checkPassed": "-kTeaG_checkPassed",
46968
- "commentThreadMeta": "-kTeaG_commentThreadMeta",
46969
- "chatComposer": "-kTeaG_chatComposer",
46970
- "editorMeta": "-kTeaG_editorMeta",
46971
- "topActions": "-kTeaG_topActions",
46972
- "threadList": "-kTeaG_threadList",
46954
+ "paneClosed": "-kTeaG_paneClosed",
46973
46955
  "locateSourceButton": "-kTeaG_locateSourceButton",
46956
+ "panelAction": "-kTeaG_panelAction",
46957
+ "legacyWarning": "-kTeaG_legacyWarning",
46958
+ "reviewDecisionModal": "-kTeaG_reviewDecisionModal",
46959
+ "reviewDecisionDialog": "-kTeaG_reviewDecisionDialog",
46974
46960
  "inlineReviewQuestion": "-kTeaG_inlineReviewQuestion",
46975
- "discussionFilters": "-kTeaG_discussionFilters",
46976
- "resizerHidden": "-kTeaG_resizerHidden",
46977
- "dangerButton": "-kTeaG_dangerButton",
46978
- "disabledReason": "-kTeaG_disabledReason",
46979
- "stage_ready": "-kTeaG_stage_ready",
46980
- "decisionResponse": "-kTeaG_decisionResponse",
46981
- "selectionPromptActions": "-kTeaG_selectionPromptActions",
46982
- "conflictModal": "-kTeaG_conflictModal",
46983
- "threadStack": "-kTeaG_threadStack",
46984
- "collabMetricActive": "-kTeaG_collabMetricActive",
46985
- "reply": "-kTeaG_reply",
46986
- "stageDone": "-kTeaG_stageDone",
46961
+ "tabBadge": "-kTeaG_tabBadge",
46962
+ "selectionPromptBelow": "-kTeaG_selectionPromptBelow",
46963
+ "activeContext": "-kTeaG_activeContext",
46964
+ "commentThreadMeta": "-kTeaG_commentThreadMeta",
46965
+ "modal": "-kTeaG_modal",
46966
+ "discussionPanel": "-kTeaG_discussionPanel",
46987
46967
  "createSummary": "-kTeaG_createSummary",
46988
- "markdownBody": "-kTeaG_markdownBody",
46989
- "workflowFocus": "-kTeaG_workflowFocus",
46968
+ "unsaved": "-kTeaG_unsaved",
46969
+ "mobileDocumentsOpen": "-kTeaG_mobileDocumentsOpen",
46970
+ "diffAdded": "-kTeaG_diffAdded",
46971
+ "run": "-kTeaG_run",
46972
+ "inlineReviewDetails": "-kTeaG_inlineReviewDetails",
46973
+ "insightScore": "-kTeaG_insightScore",
46974
+ "topActions": "-kTeaG_topActions",
46975
+ "documentReviewHighlight": "-kTeaG_documentReviewHighlight",
46976
+ "inlineReviewHeadActions": "-kTeaG_inlineReviewHeadActions",
46977
+ "decisionQuestion": "-kTeaG_decisionQuestion",
46978
+ "mobileCollab": "-kTeaG_mobileCollab",
46979
+ "reviewTitle": "-kTeaG_reviewTitle",
46980
+ "decisionOptions": "-kTeaG_decisionOptions",
46981
+ "collabBarState": "-kTeaG_collabBarState",
46982
+ "diffRemoved": "-kTeaG_diffRemoved",
46983
+ "versionActions": "-kTeaG_versionActions",
46984
+ "richEditor": "-kTeaG_richEditor",
46985
+ "insightPanel": "-kTeaG_insightPanel",
46986
+ "reviewHeader": "-kTeaG_reviewHeader",
46987
+ "replyStack": "-kTeaG_replyStack",
46988
+ "stageCurrent": "-kTeaG_stageCurrent",
46989
+ "paneActions": "-kTeaG_paneActions",
46990
+ "compareColumns": "-kTeaG_compareColumns",
46991
+ "decisionResponse": "-kTeaG_decisionResponse",
46992
+ "versionPicker": "-kTeaG_versionPicker",
46990
46993
  "reviewChecklistRow": "-kTeaG_reviewChecklistRow",
46994
+ "editorPane": "-kTeaG_editorPane",
46995
+ "replyComposer": "-kTeaG_replyComposer",
46991
46996
  "empty": "-kTeaG_empty",
46992
- "collabStateSaved": "-kTeaG_collabStateSaved",
46993
- "threadHeaderActions": "-kTeaG_threadHeaderActions",
46994
- "discussionPanel": "-kTeaG_discussionPanel",
46995
- "documentCommentHighlight": "-kTeaG_documentCommentHighlight",
46996
- "reviewCheckCopy": "-kTeaG_reviewCheckCopy",
46997
- "summaryInput": "-kTeaG_summaryInput",
46998
- "reviewCheckArrow": "-kTeaG_reviewCheckArrow",
46999
- "collapseRight": "-kTeaG_collapseRight",
47000
- "documentAnchorHighlight": "-kTeaG_documentAnchorHighlight",
47001
- "selectionPromptClose": "-kTeaG_selectionPromptClose",
46997
+ "reviewAnchorLayer": "-kTeaG_reviewAnchorLayer",
46998
+ "richEditorShell": "-kTeaG_richEditorShell",
46999
+ "documents": "-kTeaG_documents",
47000
+ "view": "-kTeaG_view",
47001
+ "filterChecks": "-kTeaG_filterChecks",
47002
+ "conflictDiffs": "-kTeaG_conflictDiffs",
47003
+ "decisionModeHint": "-kTeaG_decisionModeHint",
47004
+ "decisionSource": "-kTeaG_decisionSource",
47005
+ "selectionPrompt": "-kTeaG_selectionPrompt",
47006
+ "pulse": "-kTeaG_pulse",
47007
+ "tabPanel": "-kTeaG_tabPanel",
47008
+ "reviewCheckStatus": "-kTeaG_reviewCheckStatus",
47002
47009
  "patchDetails": "-kTeaG_patchDetails",
47003
- "userMessage": "-kTeaG_userMessage",
47004
- "documentReviewHighlight": "-kTeaG_documentReviewHighlight",
47005
- "inlineDecisionForm": "-kTeaG_inlineDecisionForm",
47006
- "formErrors": "-kTeaG_formErrors",
47007
- "mobileDocumentsTrigger": "-kTeaG_mobileDocumentsTrigger",
47008
- "stickyActions": "-kTeaG_stickyActions",
47009
- "dialogSurface": "-kTeaG_dialogSurface",
47010
- "selectionPromptHead": "-kTeaG_selectionPromptHead",
47011
- "documentReviewAnchor": "-kTeaG_documentReviewAnchor",
47012
- "conflictActions": "-kTeaG_conflictActions",
47013
- "downstreamReturn": "-kTeaG_downstreamReturn",
47014
- "activeFilters": "-kTeaG_activeFilters",
47015
- "execute": "-kTeaG_execute",
47016
- "selectedDoc": "-kTeaG_selectedDoc",
47017
- "reviewDecisionModal": "-kTeaG_reviewDecisionModal",
47018
- "versionRow": "-kTeaG_versionRow"
47010
+ "stage_product-confirmation": "-kTeaG_stage_product-confirmation",
47011
+ "grid": "-kTeaG_grid",
47012
+ "dialogForm": "-kTeaG_dialogForm",
47013
+ "insightLinks": "-kTeaG_insightLinks",
47014
+ "decisionTags": "-kTeaG_decisionTags",
47015
+ "versionCompare": "-kTeaG_versionCompare",
47016
+ "versionRow": "-kTeaG_versionRow",
47017
+ "aiConversation": "-kTeaG_aiConversation",
47018
+ "conflictColumns": "-kTeaG_conflictColumns",
47019
+ "selectionPromptButtons": "-kTeaG_selectionPromptButtons",
47020
+ "collabStateSaved": "-kTeaG_collabStateSaved",
47021
+ "recordLinkButton": "-kTeaG_recordLinkButton",
47022
+ "conflictModal": "-kTeaG_conflictModal",
47023
+ "badges": "-kTeaG_badges",
47024
+ "commentThreadClosed": "-kTeaG_commentThreadClosed",
47025
+ "checkIcon": "-kTeaG_checkIcon",
47026
+ "checklistMeter": "-kTeaG_checklistMeter"
47019
47027
  };
47020
47028
  //#endregion
47021
47029
  //#region src/client/AccessibleDialog.tsx
package/lib/index.js CHANGED
@@ -2495,10 +2495,10 @@ var DshReviewCoordinator = class {
2495
2495
  });
2496
2496
  }
2497
2497
  async conversation(sessionId) {
2498
- const history = await this.host.sessionController.inspect(sessionId, this.lifetime.signal);
2498
+ const events = await this.conversationEvents(sessionId);
2499
2499
  const rows = [];
2500
2500
  let skippedOrchestrationPrompt = false;
2501
- for (const entry of history.events) {
2501
+ for (const entry of events) {
2502
2502
  if (entry.type !== "user/message" && entry.type !== "assistant/message") continue;
2503
2503
  if (entry.type === "user/message" && !skippedOrchestrationPrompt) {
2504
2504
  skippedOrchestrationPrompt = true;
@@ -2519,6 +2519,34 @@ var DshReviewCoordinator = class {
2519
2519
  }
2520
2520
  return rows;
2521
2521
  }
2522
+ async conversationEvents(sessionId) {
2523
+ const controller = this.host.sessionController;
2524
+ if (controller.events !== void 0) {
2525
+ const pages = [];
2526
+ let throughSeq;
2527
+ let beforeSeq;
2528
+ for (;;) {
2529
+ this.lifetime.signal.throwIfAborted();
2530
+ const page = await controller.events({
2531
+ address: {
2532
+ kind: "session",
2533
+ sessionId
2534
+ },
2535
+ maxMessages: 100,
2536
+ ...throughSeq === void 0 ? {} : { throughSeq },
2537
+ ...beforeSeq === void 0 ? {} : { beforeSeq }
2538
+ }, this.lifetime.signal);
2539
+ throughSeq ??= page.cursor;
2540
+ pages.push(page.records.map((record) => record.event));
2541
+ if (!page.hasMore) return pages.reverse().flat();
2542
+ const firstSeq = page.records[0]?.event.seq;
2543
+ if (firstSeq === void 0 || !Number.isSafeInteger(firstSeq) || firstSeq < 0 || beforeSeq !== void 0 && firstSeq >= beforeSeq) throw new Error("history pagination did not advance");
2544
+ beforeSeq = firstSeq;
2545
+ }
2546
+ }
2547
+ if (controller.inspect !== void 0) return (await controller.inspect(sessionId, this.lifetime.signal)).events;
2548
+ throw new Error("DSH Session history API is unavailable");
2549
+ }
2522
2550
  async followUp(sessionId, text) {
2523
2551
  const content = text.trim();
2524
2552
  if (content === "") throw new Error("追问内容不能为空");
@@ -1,12 +1,40 @@
1
- import type { SessionController } from '@deepseek-ai/dsh-api-session-controller';
1
+ import type { SessionController, SessionPromptRequest } from '@deepseek-ai/dsh-api-session-controller';
2
2
  import type { AgentPresetRegistry } from '@deepseek-ai/dsh-agent-preset-registry';
3
3
  import type { WorkspaceRegistry } from '@deepseek-ai/dsh-workspace';
4
4
  import type { AiCoordinator } from './engine.ts';
5
5
  import type { AiReviewRun, CommentThread, RequirementView, ReviewWorkspaceSummary } from './protocol.ts';
6
6
  import { type ReviewPromptConfig } from './prompts.ts';
7
7
  import { ReviewContextCatalog } from './review-context.ts';
8
+ interface ReviewHistoryEvent {
9
+ type: string;
10
+ data: unknown;
11
+ }
12
+ interface ReviewHistoryPage {
13
+ cursor: number;
14
+ records: readonly {
15
+ type: 'event';
16
+ event: ReviewHistoryEvent & {
17
+ seq: number;
18
+ };
19
+ }[];
20
+ hasMore: boolean;
21
+ }
22
+ interface ReviewHistoryReader {
23
+ events?(request: {
24
+ address: {
25
+ kind: 'session';
26
+ sessionId: SessionPromptRequest['sessionId'];
27
+ };
28
+ maxMessages: number;
29
+ throughSeq?: number;
30
+ beforeSeq?: number;
31
+ }, signal: AbortSignal): Promise<ReviewHistoryPage>;
32
+ inspect?(sessionId: SessionPromptRequest['sessionId'], signal: AbortSignal): Promise<{
33
+ events: readonly ReviewHistoryEvent[];
34
+ }>;
35
+ }
8
36
  export interface DshReviewHost {
9
- sessionController: Pick<SessionController, 'create' | 'rename' | 'prompt' | 'inspect'>;
37
+ sessionController: Pick<SessionController, 'create' | 'rename' | 'prompt'> & ReviewHistoryReader;
10
38
  workspaceRegistry: Pick<WorkspaceRegistry, 'list'>;
11
39
  agentPresets: Pick<AgentPresetRegistry, 'list'>;
12
40
  }
@@ -34,6 +62,7 @@ export declare class DshReviewCoordinator implements AiCoordinator {
34
62
  role: 'user' | 'assistant';
35
63
  text: string;
36
64
  }>>;
65
+ private conversationEvents;
37
66
  followUp(sessionId: string, text: string): Promise<void>;
38
67
  private inStageSession;
39
68
  private rememberStageSession;
@@ -41,4 +70,5 @@ export declare class DshReviewCoordinator implements AiCoordinator {
41
70
  private launch;
42
71
  private resolveWorkspace;
43
72
  }
73
+ export {};
44
74
  //# sourceMappingURL=review-runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"review-runtime.d.ts","sourceRoot":"","sources":["../../src/review-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAwB,MAAM,yCAAyC,CAAA;AACtG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AACjF,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AACxG,OAAO,EAA8G,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAClK,OAAO,EAAE,oBAAoB,EAAuB,MAAM,qBAAqB,CAAA;AAG/E,MAAM,WAAW,aAAa;IAC5B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC,CAAA;IACtF,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAA;IAClD,YAAY,EAAE,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAA;CAChD;AAGD,qBAAa,oBAAqB,YAAW,aAAa;IAI5C,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAiB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAH3E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuB;IAC/C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqC;IACnE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwB;gBACpB,IAAI,EAAE,aAAa,EAAmB,QAAQ,uBAA6B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version": "0.4.0",
3
+ "version": "0.4.1",
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",
@@ -52,57 +52,62 @@
52
52
  "publishConfig": {
53
53
  "registry": "https://registry.npmjs.org"
54
54
  },
55
+ "scripts": {
56
+ "clean": "node -e \"require('node:fs').rmSync('lib', { recursive: true, force: true })\"",
57
+ "build": "npm run clean && tsc -p tsconfig.build.json && tsdown",
58
+ "bundle": "tsdown",
59
+ "prepare": "npm run build",
60
+ "typecheck": "tsc --noEmit",
61
+ "test": "vitest run --maxWorkers=1 --minWorkers=1 --exclude tests/e2e/**",
62
+ "test:e2e": "playwright test"
63
+ },
55
64
  "dependencies": {
56
65
  "@toast-ui/editor": "3.2.2",
57
66
  "lightningcss": "^1.32.0",
58
67
  "markdown-it": "^14.1.0",
59
68
  "prosemirror-inputrules": "^1.5.0",
60
- "@deepseek-ai/schemastery": "~3.18.5"
69
+ "@deepseek-ai/schemastery": "~3.18.5 || ~3.19.0"
61
70
  },
62
71
  "devDependencies": {
63
72
  "@axe-core/playwright": "^4.10.0",
64
- "@deepseek-ai/cordis": "~4.0.5",
65
- "@deepseek-ai/dsh-agent-preset-registry": "0.2.1-rc.5",
66
- "@deepseek-ai/dsh-api-session-controller": "0.2.1-rc.5",
67
- "@deepseek-ai/dsh-app-boot": "0.2.1-rc.5",
68
- "@deepseek-ai/dsh-host-webserver": "0.2.1-rc.5",
69
- "@deepseek-ai/dsh-llm": "0.2.1-rc.5",
70
- "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.5",
71
- "@deepseek-ai/dsh-tools": "0.2.1-rc.5",
72
- "@deepseek-ai/dsh-workspace": "0.2.1-rc.5",
73
+ "@deepseek-ai/cordis": "~4.1.0",
74
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.2-rc.1",
75
+ "@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.1",
76
+ "@deepseek-ai/dsh-app-boot": "0.2.2-rc.1",
77
+ "@deepseek-ai/dsh-host-webserver": "0.2.2-rc.1",
78
+ "@deepseek-ai/dsh-llm": "0.2.2-rc.1",
79
+ "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.1",
80
+ "@deepseek-ai/dsh-tools": "0.2.2-rc.1",
81
+ "@deepseek-ai/dsh-workspace": "0.2.2-rc.1",
73
82
  "@playwright/test": "^1.55.0",
74
83
  "@types/markdown-it": "^14.1.2",
75
84
  "@types/node": "^22.20.0",
76
85
  "@types/react": "~18.3.1",
77
86
  "@types/react-dom": "^18.3.5",
87
+ "@types/semver": "^7.7.1",
78
88
  "jsdom": "^25.0.0",
79
89
  "react": "^18.3.1",
80
90
  "react-dom": "^18.3.1",
91
+ "semver": "^7.8.5",
81
92
  "tsdown": "0.22.2",
82
93
  "typescript": "~5.7.2",
83
94
  "vitest": "^3.0.0"
84
95
  },
85
96
  "peerDependencies": {
86
- "@deepseek-ai/cordis": "~4.0.5",
87
- "@deepseek-ai/dsh-agent-preset-registry": "0.2.1-rc.5",
88
- "@deepseek-ai/dsh-api-session-controller": "0.2.1-rc.5",
89
- "@deepseek-ai/dsh-host-webserver": "0.2.1-rc.5",
90
- "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.5",
91
- "@deepseek-ai/dsh-tools": "0.2.1-rc.5",
92
- "@deepseek-ai/dsh-workspace": "0.2.1-rc.5",
97
+ "@deepseek-ai/cordis": "~4.0.5 || ~4.1.0",
98
+ "@deepseek-ai/dsh-agent-preset-registry": ">=0.2.1-rc.5 <0.2.2-0 || >=0.2.2-rc.1 <0.2.3-0",
99
+ "@deepseek-ai/dsh-api-session-controller": ">=0.2.1-rc.5 <0.2.2-0 || >=0.2.2-rc.1 <0.2.3-0",
100
+ "@deepseek-ai/dsh-host-webserver": ">=0.2.1-rc.5 <0.2.2-0 || >=0.2.2-rc.1 <0.2.3-0",
101
+ "@deepseek-ai/dsh-system-prompt": ">=0.2.1-rc.5 <0.2.2-0 || >=0.2.2-rc.1 <0.2.3-0",
102
+ "@deepseek-ai/dsh-tools": ">=0.2.1-rc.5 <0.2.2-0 || >=0.2.2-rc.1 <0.2.3-0",
103
+ "@deepseek-ai/dsh-workspace": ">=0.2.1-rc.5 <0.2.2-0 || >=0.2.2-rc.1 <0.2.3-0",
93
104
  "react": "^18.2.0",
94
105
  "react-dom": "^18.2.0"
95
106
  },
96
107
  "engines": {
97
- "node": ">=20"
108
+ "node": ">=20",
109
+ "dsh": ">=0.2.1-rc.5 <0.2.2-0 || >=0.2.2-rc.1 <0.2.3-0"
98
110
  },
99
- "license": "Apache-2.0",
100
- "scripts": {
101
- "clean": "node -e \"require('node:fs').rmSync('lib', { recursive: true, force: true })\"",
102
- "build": "npm run clean && tsc -p tsconfig.build.json && tsdown",
103
- "bundle": "tsdown",
104
- "typecheck": "tsc --noEmit",
105
- "test": "vitest run --maxWorkers=1 --minWorkers=1 --exclude tests/e2e/**",
106
- "test:e2e": "playwright test"
107
- }
108
- }
111
+ "packageManager": "pnpm@9.9.0",
112
+ "license": "Apache-2.0"
113
+ }
@@ -7,8 +7,18 @@ import { DEFAULT_REVIEW_PROMPTS, extractPromptValue, renderPrompt, resolveReview
7
7
  import { ReviewContextCatalog, reviewContextPrompt } from './review-context.ts'
8
8
  import { readWorkspaceSnapshot } from './workspace-context.ts'
9
9
 
10
+ interface ReviewHistoryEvent { type: string; data: unknown }
11
+ interface ReviewHistoryPage {
12
+ cursor: number
13
+ records: readonly { type: 'event'; event: ReviewHistoryEvent & { seq: number } }[]
14
+ hasMore: boolean
15
+ }
16
+ interface ReviewHistoryReader {
17
+ events?(request: { address: { kind: 'session'; sessionId: SessionPromptRequest['sessionId'] }; maxMessages: number; throughSeq?: number; beforeSeq?: number }, signal: AbortSignal): Promise<ReviewHistoryPage>
18
+ inspect?(sessionId: SessionPromptRequest['sessionId'], signal: AbortSignal): Promise<{ events: readonly ReviewHistoryEvent[] }>
19
+ }
10
20
  export interface DshReviewHost {
11
- sessionController: Pick<SessionController, 'create' | 'rename' | 'prompt' | 'inspect'>
21
+ sessionController: Pick<SessionController, 'create' | 'rename' | 'prompt'> & ReviewHistoryReader
12
22
  workspaceRegistry: Pick<WorkspaceRegistry, 'list'>
13
23
  agentPresets: Pick<AgentPresetRegistry, 'list'>
14
24
  }
@@ -45,10 +55,10 @@ export class DshReviewCoordinator implements AiCoordinator {
45
55
  })
46
56
  }
47
57
  async conversation(sessionId: string): Promise<Array<{ role: 'user' | 'assistant'; text: string }>> {
48
- const history = await this.host.sessionController.inspect(sessionId as SessionPromptRequest['sessionId'], this.lifetime.signal)
58
+ const events = await this.conversationEvents(sessionId as SessionPromptRequest['sessionId'])
49
59
  const rows: Array<{ role: 'user' | 'assistant'; text: string }> = []
50
60
  let skippedOrchestrationPrompt = false
51
- for (const entry of history.events) {
61
+ for (const entry of events) {
52
62
  if (entry.type !== 'user/message' && entry.type !== 'assistant/message') continue
53
63
  if (entry.type === 'user/message' && !skippedOrchestrationPrompt) { skippedOrchestrationPrompt = true; continue }
54
64
  const value = entry.data as unknown
@@ -66,6 +76,30 @@ export class DshReviewCoordinator implements AiCoordinator {
66
76
  }
67
77
  return rows
68
78
  }
79
+ private async conversationEvents(sessionId: SessionPromptRequest['sessionId']): Promise<readonly ReviewHistoryEvent[]> {
80
+ const controller = this.host.sessionController
81
+ if (controller.events !== undefined) {
82
+ const pages: ReviewHistoryEvent[][] = []
83
+ let throughSeq: number | undefined
84
+ let beforeSeq: number | undefined
85
+ for (;;) {
86
+ this.lifetime.signal.throwIfAborted()
87
+ const page = await controller.events({
88
+ address: { kind: 'session', sessionId }, maxMessages: 100,
89
+ ...(throughSeq === undefined ? {} : { throughSeq }),
90
+ ...(beforeSeq === undefined ? {} : { beforeSeq }),
91
+ }, this.lifetime.signal)
92
+ throughSeq ??= page.cursor
93
+ pages.push(page.records.map(record => record.event))
94
+ if (!page.hasMore) return pages.reverse().flat()
95
+ const firstSeq = page.records[0]?.event.seq
96
+ if (firstSeq === undefined || !Number.isSafeInteger(firstSeq) || firstSeq < 0 || (beforeSeq !== undefined && firstSeq >= beforeSeq)) throw new Error('history pagination did not advance')
97
+ beforeSeq = firstSeq
98
+ }
99
+ }
100
+ if (controller.inspect !== undefined) return (await controller.inspect(sessionId, this.lifetime.signal)).events
101
+ throw new Error('DSH Session history API is unavailable')
102
+ }
69
103
  async followUp(sessionId: string, text: string): Promise<void> {
70
104
  const content = text.trim()
71
105
  if (content === '') throw new Error('追问内容不能为空')