dsh-vscode-mode 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -417,13 +417,13 @@ TortoiseSVN(`TortoiseProc.exe`)仅作 Windows 过渡增强:自研能力覆
417
417
 
418
418
  ```bash
419
419
  # ① Git 安装(clone + prepare 构建;推荐打固定 tag)
420
- dsh plugin --profile web add github:Lenonss/DSH_VsCodeMode#v0.9.0
420
+ dsh plugin --profile web add github:Lenonss/DSH_VsCodeMode#v0.10.0
421
421
 
422
422
  # ② npm 注册表(发布到 npm 后)
423
423
  dsh plugin --profile web add dsh-vscode-mode
424
424
 
425
425
  # ③ GitHub Release tgz 直装
426
- dsh plugin --profile web add https://github.com/Lenonss/DSH_VsCodeMode/releases/download/v0.9.0/dsh-vscode-mode-0.9.0.tgz
426
+ dsh plugin --profile web add https://github.com/Lenonss/DSH_VsCodeMode/releases/download/v0.10.0/dsh-vscode-mode-0.10.0.tgz
427
427
  ```
428
428
 
429
429
  > `dsh plugin ...` 是 pnpm 转发器:git 安装会克隆仓库、执行该包 `prepare` 脚本
@@ -718,6 +718,15 @@ Keep All / Undo All 却是亮的。修复:单文件 Keep / Undo 覆盖冲突
718
718
  完整变更见 [GitHub Releases](https://github.com/Lenonss/DSH_VsCodeMode/releases)。
719
719
  近期关键版本:
720
720
 
721
+ - **v0.10.0**:**SVN AI 深度分析发送链路重构**——① 发送主路径切换为**官方 composer
722
+ 链路**(`inputFor` setDraft + submit,即 UI「发送」内部路径,带 scope 铸造时延 3 次
723
+ 重试),`remote.session` 具名槽 RPC(`{args:{request:{rpcId,payload}}}`,gateway
724
+ `invoke` 铁证形态)多形态容错为兜底、HTTP wire 直调降为最后兜底;② 新会话创建
725
+ 主路径改为 **client store manager 面**(`sessions.create`,官方 connectWorkspace
726
+ 同链路,create 自带 store upsert → `open` 切换可用),wire 直调虽能建会话但 store
727
+ 无感故只作兜底;③ 新会话**主动铸造 scope + 命名「AI 深度分析 · \<目录\>」**
728
+ (`materializeScope` + `manager.rename`),会话列表一眼可见、点击即入;
729
+ ④ SvnPanel 通知文案同步更新,34 个 svnAiPlan 用例对齐新形态。
721
730
  - **v0.9.0**:**远端工作区差异审查(issue #7)+ SVN 变更 AI 智能分组**——① 支持
722
731
  ssh remote 插件打开的**远端项目**做交互式差异审查:按工作区根 `.remote-ssh.json`
723
732
  识别镜像根(向上 ≤8 层,与官方 findMirrorRoot 同判据),agent 写远端后以 `node:fs`
package/lib/client.js CHANGED
@@ -8836,6 +8836,19 @@ window.__ModuleLoader__.load({
8836
8836
  }
8837
8837
  }
8838
8838
  /**
8839
+ * wire 槽实参组装(gateway `invoke` 铁证:`request.args[parameter.wire]` 具名槽,
8840
+ * `session/prompt` 的槽名 = "request",值 = RpcRequest `{rpcId, payload}`)。
8841
+ * @author ddj 2026年09月24号
8842
+ * @param payload 业务载荷
8843
+ * @returns 具名槽实参 `{ args: { request: RpcRequest } }`
8844
+ */
8845
+ function slotArg(payload) {
8846
+ return { args: { request: {
8847
+ rpcId: mintRpcId(),
8848
+ payload
8849
+ } } };
8850
+ }
8851
+ /**
8839
8852
  * RPC 返回解析(照官方 dsh-client-runtime 调用形态:`const { result } = await api.sessions.create(...)`)。
8840
8853
  * 官方 api.sessions 面返回**信封** `{ rpcId, result: RpcResult }`——须解 .result;
8841
8854
  * 兼容裸 RpcResult 形态(个别补丁面直接回 {ok, value})。
@@ -8884,6 +8897,14 @@ window.__ModuleLoader__.load({
8884
8897
  */
8885
8898
  async function apiSessionPrompt(sessionId, text) {
8886
8899
  try {
8900
+ const payload = {
8901
+ sessionId,
8902
+ mode: "queue",
8903
+ content: [{
8904
+ type: "text",
8905
+ text
8906
+ }]
8907
+ };
8887
8908
  return (await (await fetch(SESSION_PROMPT_PATH, {
8888
8909
  method: "POST",
8889
8910
  headers: { "content-type": "application/json" },
@@ -8891,14 +8912,7 @@ window.__ModuleLoader__.load({
8891
8912
  type: "client-request",
8892
8913
  rpcId: mintRpcId(),
8893
8914
  method: "session/prompt",
8894
- payload: {
8895
- sessionId,
8896
- mode: "queue",
8897
- content: [{
8898
- type: "text",
8899
- text
8900
- }]
8901
- }
8915
+ payload: slotArg(payload)
8902
8916
  })
8903
8917
  })).json().catch(() => null))?.result?.ok === true;
8904
8918
  } catch {
@@ -8916,38 +8930,48 @@ window.__ModuleLoader__.load({
8916
8930
  */
8917
8931
  async function newDraftSession(ctx, cwd) {
8918
8932
  try {
8919
- const id = await apiSessionCreate(cwd);
8920
- if (id) return {
8921
- ok: true,
8922
- id
8923
- };
8933
+ const sessions = ctx.get("sessions");
8934
+ if (typeof sessions?.create === "function") {
8935
+ const created = await sessions.create(cwd ? { cwd } : void 0);
8936
+ const id = typeof created === "string" && created ? created : typeof created?.id === "string" ? created.id : typeof created?.sessionId === "string" ? created.sessionId : typeof created?.session?.id === "string" ? created.session.id : "";
8937
+ if (id) return {
8938
+ ok: true,
8939
+ id
8940
+ };
8941
+ }
8924
8942
  } catch {}
8925
8943
  try {
8926
8944
  const remote = ctx.get("remote.session");
8927
8945
  if (typeof remote?.create === "function") {
8928
8946
  const payload = cwd ? { cwd } : {};
8929
- for (const arg of [payload, {
8930
- rpcId: mintRpcId(),
8947
+ for (const arg of [
8948
+ slotArg(payload),
8949
+ { request: {
8950
+ rpcId: mintRpcId(),
8951
+ payload
8952
+ } },
8953
+ {
8954
+ rpcId: mintRpcId(),
8955
+ payload
8956
+ },
8931
8957
  payload
8932
- }]) {
8958
+ ]) try {
8933
8959
  const r = rpcOk(await remote.create(arg));
8934
8960
  const id = r.value;
8935
8961
  if (r.ok && typeof id?.sessionId === "string") return {
8936
8962
  ok: true,
8937
8963
  id: id.sessionId
8938
8964
  };
8939
- }
8940
- }
8941
- const sessions = ctx.get("sessions");
8942
- if (typeof sessions?.create === "function") {
8943
- const created = await sessions.create(cwd ? { cwd } : void 0);
8944
- const id = typeof created === "string" && created ? created : typeof created?.id === "string" ? created.id : typeof created?.sessionId === "string" ? created.sessionId : typeof created?.session?.id === "string" ? created.session.id : "";
8945
- if (id) return {
8946
- ok: true,
8947
- id
8948
- };
8965
+ } catch {}
8949
8966
  }
8950
8967
  } catch {}
8968
+ try {
8969
+ const id = await apiSessionCreate(cwd);
8970
+ if (id) return {
8971
+ ok: true,
8972
+ id
8973
+ };
8974
+ } catch {}
8951
8975
  return { ok: false };
8952
8976
  }
8953
8977
  /**
@@ -9087,7 +9111,12 @@ window.__ModuleLoader__.load({
9087
9111
  const startDraftSession = async (cwd) => {
9088
9112
  const result = await newDraftSession(ctx, cwd);
9089
9113
  if (result.ok && result.id) try {
9090
- ctx.get("sessions")?.open?.(result.id);
9114
+ const sessions = ctx.get("sessions");
9115
+ sessions?.materializeScope?.(result.id);
9116
+ const title = "AI 深度分析 · " + (String(cwd ?? "").split(/[\\/]/).pop() || "SVN 变更");
9117
+ sessions?.manager?.rename?.(result.id, title);
9118
+ sessions?.manager?.select?.(result.id);
9119
+ sessions?.open?.(result.id);
9091
9120
  } catch {}
9092
9121
  return result;
9093
9122
  };
@@ -9101,8 +9130,20 @@ window.__ModuleLoader__.load({
9101
9130
  */
9102
9131
  const sendTask = async (sessionId, text) => {
9103
9132
  if (!sessionId) return false;
9133
+ const composerOnce = async () => {
9134
+ const input = inputFor(ctx, sessionId);
9135
+ if (input && typeof input.setDraft === "function" && typeof input.submit === "function") {
9136
+ input.setDraft(text);
9137
+ input.submit();
9138
+ return true;
9139
+ }
9140
+ return false;
9141
+ };
9104
9142
  try {
9105
- if (await apiSessionPrompt(sessionId, text)) return true;
9143
+ for (let attempt = 3; attempt > 0; attempt--) {
9144
+ if (await composerOnce()) return true;
9145
+ if (attempt > 1) await new Promise((resolve) => setTimeout(resolve, 500));
9146
+ }
9106
9147
  } catch {}
9107
9148
  try {
9108
9149
  const remote = ctx.get("remote.session");
@@ -9115,12 +9156,25 @@ window.__ModuleLoader__.load({
9115
9156
  text
9116
9157
  }]
9117
9158
  };
9118
- for (const arg of [payload, {
9119
- rpcId: mintRpcId(),
9159
+ for (const arg of [
9160
+ slotArg(payload),
9161
+ { request: {
9162
+ rpcId: mintRpcId(),
9163
+ payload
9164
+ } },
9165
+ {
9166
+ rpcId: mintRpcId(),
9167
+ payload
9168
+ },
9120
9169
  payload
9121
- }]) if (rpcOk(await remote.prompt(arg)).ok) return true;
9170
+ ]) try {
9171
+ if (rpcOk(await remote.prompt(arg)).ok) return true;
9172
+ } catch {}
9122
9173
  }
9123
9174
  } catch {}
9175
+ try {
9176
+ return await apiSessionPrompt(sessionId, text);
9177
+ } catch {}
9124
9178
  return false;
9125
9179
  };
9126
9180
  return {
@@ -27912,7 +27966,7 @@ window.__ModuleLoader__.load({
27912
27966
  }
27913
27967
  add.sendTask(id, prompt).then((sent) => {
27914
27968
  if (sent) {
27915
- live?.notify?.("已在新会话发起深度分析(任务已自动发送),请在会话列表查看");
27969
+ live?.notify?.("已在新会话「AI 深度分析」发起任务并自动发送,请在左侧会话列表点开查看进度");
27916
27970
  startDeepPoll(since);
27917
27971
  } else degrade(prompt);
27918
27972
  });