@deepseek-ai/dsh-client-ui-commands 0.1.6-alpha.2 → 0.1.7-alpha.2

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.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/client/ui-commands/README.md
5
- README.md: f8cba29179f9960042a4a9e67e86496591a76d08
6
- README.zh.md: 1cea3ae7aea857f2b2d219abf0a7192c2f222792
5
+ README.md: 7fada747562ff15a96997d8bffe9aeb6f9a18fb5
6
+ README.zh.md: 2f532cbd0f3d33e304074644cc6cb02b7151d3e1
package/README.md CHANGED
@@ -49,6 +49,8 @@ When the composer submits with images or generic files, only a host command decl
49
49
 
50
50
  `src/client/contract.ts` defines contribution and decoration registration, plus `dismiss(name)`, which closes that command's open popups and confirmations: dismissal aborts pending option loads, prevents their late results from reopening the popup, and preserves composer drafts. `CommandDirectory` owns the per-session wire cache and resolves typed commands through `resolution.ts`; that module owns first-party identity matching and localized input spellings. `matchSpace` reads the ready cache synchronously, while `matchEnter` waits for readiness and rejects on warmup failure or cancellation. Forwarded catalog and connection events invalidate the cache. After a matched Host execution, this browser emits `command/executed`; other clients observe only the durable command events. `PopupSelectController` owns popup state, and `PopupSelectView` occupies the input overlay. `presentation.ts` owns row labels, icons, and sections; its helpers and the resolution helpers stay internal to the plugin.
51
51
 
52
+ Each command-directory fetch requires an existing retained Client Session and waits for its initial history open to succeed before sending `commands.list`. A temporary `commandCatalog` reference holds that Session until the fetch settles. An unretained Session or a failed open rejects without sending the RPC, so background catalog refreshes do not reopen closed Sessions.
53
+
52
54
  </details>
53
55
 
54
56
  -----
package/README.zh.md CHANGED
@@ -49,6 +49,8 @@ composer 携带图片或通用文件提交时,只有声明了 `input.attachmen
49
49
 
50
50
  `src/client/contract.ts` 定义贡献项和装饰的注册接口,以及 `dismiss(name)`:它关闭该命令已打开的弹窗与确认对话框,中止待完成的选项加载,阻止晚到结果重新打开弹窗,并保留 composer 草稿。`CommandDirectory` 负责会话级协议缓存,并通过 `resolution.ts` 解析输入命令;该模块负责内置命令标识匹配和本地化输入写法。`matchSpace` 同步读取就绪缓存,`matchEnter` 等待缓存就绪,预热失败或取消时拒绝。转发的目录和连接事件使缓存失效。宿主执行匹配的命令后,本浏览器发布 `command/executed`,其他客户端只观察持久命令事件。`PopupSelectController` 负责弹窗状态,`PopupSelectView` 占据输入浮层。`presentation.ts` 负责行标题、图标和分节,展示与解析辅助函数均留在插件内部。
51
51
 
52
+ 每次命令目录拉取都要求客户端已持有该会话,并等待首次历史打开成功后才发送 `commands.list`。临时的 `commandCatalog` 引用持续持有会话,直到拉取结束。未被持有的会话或打开失败会直接拒绝,不发送 RPC,因此后台目录刷新不会重新打开已关闭的会话。
53
+
52
54
  </details>
53
55
 
54
56
  -----
package/lib/client.js CHANGED
@@ -643,12 +643,12 @@ window.__ModuleLoader__.load({
643
643
  }
644
644
  /** Built-in Host commands whose client face this package owns. */
645
645
  const HOST_FACES = new Map([
646
- hostFace("goal", _deepseek_ai_dsh_client_ui_primitives.IconGoalOutline16),
647
- hostFace("plan", _deepseek_ai_dsh_client_ui_primitives.IconPlanOutline14),
648
- hostFace("feedback", _deepseek_ai_dsh_client_ui_primitives.IconPaperPlaneOutline14),
649
- hostFace("compact", _deepseek_ai_dsh_client_ui_primitives.IconCompactOutline16),
650
- hostFace("permission", _deepseek_ai_dsh_client_ui_primitives.IconShieldOutline16),
651
- hostFace("export", _deepseek_ai_dsh_client_ui_primitives.IconDownloadOutline16)
646
+ hostFace("goal", _deepseek_ai_dsh_client_ui_primitives.IconGoalOutlineRegular),
647
+ hostFace("plan", _deepseek_ai_dsh_client_ui_primitives.IconPlanOutlineRegular),
648
+ hostFace("feedback", _deepseek_ai_dsh_client_ui_primitives.IconPaperPlaneOutlineRegular),
649
+ hostFace("compact", _deepseek_ai_dsh_client_ui_primitives.IconCompactOutlineRegular),
650
+ hostFace("permission", _deepseek_ai_dsh_client_ui_primitives.PermissionIconFullAccessRegular),
651
+ hostFace("export", _deepseek_ai_dsh_client_ui_primitives.IconDownloadOutlineRegular)
652
652
  ]);
653
653
  /**
654
654
  * The localized menu face of a catalog row.
@@ -704,6 +704,8 @@ window.__ModuleLoader__.load({
704
704
  * `rankByName`). A host/contribution name collision fails loud. Every
705
705
  * execute addresses the session's agent by sessionId — sessions are always
706
706
  * agent-backed.
707
+ * Catalog RPCs retain an existing Client Session through completion and
708
+ * wait for its initial history open to succeed before contacting the Host.
707
709
  */
708
710
  /** Recover the command name from a line the Host confirmed as executed. */
709
711
  function submittedCommandName(line) {
@@ -737,10 +739,16 @@ window.__ModuleLoader__.load({
737
739
  if (locale === void 0) throw new Error("ui-commands: locale service unavailable");
738
740
  this.t = locale.bind("command");
739
741
  this.directory = new CommandDirectory(async (sessionId) => {
740
- if (this.sessions().subagentAddress(sessionId) !== void 0) return [];
741
- const result = await ctx.remote.commands.list(sessionId);
742
- if (!result.ok) throw new Error(`command.list failed: ${result.error.code}: ${result.error.message}`);
743
- return result.value;
742
+ const sessions = this.sessions();
743
+ if (sessions.subagentAddress(sessionId) !== void 0) return [];
744
+ if (sessions.binding(sessionId) === void 0) throw new Error(`command catalog requires a retained session "${sessionId}"`);
745
+ return sessions.using(sessionId, { source: "commandCatalog" }, async (reference) => {
746
+ const state = reference.binding.session.getSnapshot();
747
+ if (state.openState !== "open") throw state.openError ?? /* @__PURE__ */ new Error(`session "${sessionId}" is not open`);
748
+ const result = await ctx.remote.commands.list(sessionId);
749
+ if (!result.ok) throw new Error(`command.list failed: ${result.error.code}: ${result.error.message}`);
750
+ return result.value;
751
+ });
744
752
  });
745
753
  const inputTriggers = ctx.get("inputTriggers");
746
754
  if (inputTriggers === void 0) throw new Error("ui-commands: slash service unavailable");
@@ -1121,7 +1129,7 @@ window.__ModuleLoader__.load({
1121
1129
  }
1122
1130
  //#endregion
1123
1131
  //#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-commands/src/client/PopupSelectView.module.css.mjs
1124
- const css = ".mufS8W_card{z-index:100;--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);background:var(--dsw-specific-menu);--dsw-elevation-stroke-color:var(--dsw-alias-border-l1);min-width:min(220px,100%);max-width:100%;max-height:320px;box-shadow:var(--dsw-elevation-prominent);border:0;border-radius:20px;outline:none;flex-direction:column;padding:4px;display:flex;position:absolute;bottom:calc(100% + 4px);left:0;overflow:hidden}.mufS8W_viewport{flex-direction:column;min-height:0;display:flex;overflow-y:auto}.mufS8W_row{cursor:pointer;color:var(--dsw-alias-label-primary);border-radius:8px;align-items:center;gap:8px;padding:6px 8px;font-size:13px;display:flex}.mufS8W_rowActive{background:var(--dsw-alias-interactive-bg-hover)}.mufS8W_label{flex:0 auto;align-items:baseline;gap:4px;min-width:0;display:flex}.mufS8W_labelText{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}.mufS8W_badge{color:var(--dsw-alias-label-tertiary);letter-spacing:.2px;flex:none;align-self:flex-start;margin-top:-1px;font-size:8px;font-weight:600;line-height:10px}.mufS8W_detail{min-width:0;color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:12px;overflow:hidden}.mufS8W_check{color:var(--dsw-alias-label-primary);flex:none;margin-left:auto;display:inline-flex}.mufS8W_status{color:var(--dsw-alias-label-tertiary);padding:8px 10px;font-size:13px}.mufS8W_search{border:.5px solid var(--dsw-alias-border-inverted);color:var(--dsw-alias-label-primary);background:0 0;border-radius:8px;outline:none;margin:2px 2px 4px;padding:6px 8px;font-size:13px}.mufS8W_error{color:var(--dsw-alias-state-error-primary);align-items:center;gap:8px;padding:6px 8px;font-size:12px;display:flex}.mufS8W_errorText{text-overflow:ellipsis;flex:1;overflow:hidden}.mufS8W_retry{border:.5px solid var(--dsw-alias-border-inverted);color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border-radius:6px;padding:2px 8px;font-size:12px}";
1132
+ const css = ".mufS8W_card{z-index:100;--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);background:var(--dsw-specific-menu);min-width:min(220px,100%);max-width:100%;max-height:320px;backdrop-filter:var(--dsw-menu-backdrop-filter);--dsw-elevation-stroke-color:var(--dsw-alias-border-l1);box-shadow:var(--dsw-elevation-prominent);border:0;border-radius:16px;outline:none;flex-direction:column;padding:3px;display:flex;position:absolute;bottom:calc(100% + 4px);left:0;overflow:hidden}.mufS8W_viewport{flex-direction:column;min-height:0;display:flex;overflow-y:auto}.mufS8W_row{cursor:pointer;color:var(--dsw-alias-label-primary);border-radius:7px;align-items:center;gap:6px;padding:5px 7px;font-size:12px;display:flex}.mufS8W_rowActive{background:var(--dsw-alias-interactive-bg-hover)}.mufS8W_label{flex:0 auto;align-items:baseline;gap:4px;min-width:0;display:flex}.mufS8W_labelText{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}.mufS8W_badge{color:var(--dsw-alias-label-tertiary);letter-spacing:.2px;flex:none;align-self:flex-start;margin-top:-1px;font-size:8px;font-weight:600;line-height:10px}.mufS8W_detail{min-width:0;color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:11px;overflow:hidden}.mufS8W_check{color:var(--dsw-alias-label-primary);flex:none;margin-left:auto;display:inline-flex}.mufS8W_check svg{width:14px;height:14px}.mufS8W_status{color:var(--dsw-alias-label-tertiary);padding:7px 8px;font-size:12px}.mufS8W_search{border:.5px solid var(--dsw-alias-border-inverted);color:var(--dsw-alias-label-primary);background:0 0;border-radius:8px;outline:none;margin:2px 2px 3px;padding:5px 7px;font-size:12px}.mufS8W_error{color:var(--dsw-alias-state-error-primary);align-items:center;gap:6px;padding:5px 7px;font-size:11px;display:flex}.mufS8W_errorText{text-overflow:ellipsis;flex:1;overflow:hidden}.mufS8W_retry{border:.5px solid var(--dsw-alias-border-inverted);color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border-radius:6px;padding:2px 7px;font-size:11px}";
1125
1133
  const tagId = "@deepseek-ai/dsh-client-ui-commands/PopupSelectView.module.css";
1126
1134
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
1127
1135
  const tag = document.createElement("style");
@@ -1303,7 +1311,7 @@ window.__ModuleLoader__.load({
1303
1311
  }),
1304
1312
  option.active === true && (0, react_jsx_runtime.jsx)("span", {
1305
1313
  className: PopupSelectView_module_css_default.check,
1306
- children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, {})
1314
+ children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutlineRegular, {})
1307
1315
  })
1308
1316
  ]
1309
1317
  }, option.id))
@@ -9,6 +9,8 @@
9
9
  * `rankByName`). A host/contribution name collision fails loud. Every
10
10
  * execute addresses the session's agent by sessionId — sessions are always
11
11
  * agent-backed.
12
+ * Catalog RPCs retain an existing Client Session through completion and
13
+ * wait for its initial history open to succeed before contacting the Host.
12
14
  */
13
15
  import { Service } from '@deepseek-ai/cordis';
14
16
  import type { Context } from '@deepseek-ai/cordis';
@@ -18,6 +20,12 @@ import type { SessionId } from '@deepseek-ai/dsh-session/types';
18
20
  import type { ClientSessionContext } from '@deepseek-ai/dsh-client-ui-input-trigger/client';
19
21
  import type { CommandContribution, CommandDecoration, CommandUiContract } from './contract.ts';
20
22
  import { PopupSelectController } from './popup.ts';
23
+ declare module '@deepseek-ai/dsh-api-session-controller/client' {
24
+ interface SessionReferenceSourceMap {
25
+ /** A command-catalog fetch waiting for initial history and its RPC result. */
26
+ commandCatalog: unknown;
27
+ }
28
+ }
21
29
  declare module '@deepseek-ai/cordis' {
22
30
  interface Events {
23
31
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-client-ui-commands",
3
3
  "description": "Client command surface: global directory cache, '/' source, three command UI kinds, popupSelect registry",
4
- "version": "0.1.6-alpha.2",
4
+ "version": "0.1.7-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -38,28 +38,28 @@
38
38
  },
39
39
  "license": "MIT",
40
40
  "peerDependencies": {
41
- "@deepseek-ai/cordis": "^4.0.2"
41
+ "@deepseek-ai/cordis": "~4.0.4"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/react": "~18.3.1",
45
45
  "react": "^18.2.0",
46
46
  "clsx": "^2.0.0",
47
- "@deepseek-ai/dsh-api-remotes": "^0.1.6-alpha.2",
48
- "@deepseek-ai/dsh-client-connection": "^0.1.6-alpha.2",
49
- "@deepseek-ai/dsh-client-locale": "^0.1.6-alpha.2",
50
- "@deepseek-ai/dsh-client-test-runtime": "^0.1.6-alpha.2",
51
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.6-alpha.2",
52
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.6-alpha.2",
53
- "@deepseek-ai/dsh-client-ui-input-trigger": "^0.1.6-alpha.2",
54
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.6-alpha.2",
55
- "@deepseek-ai/dsh-commands": "^0.1.6-alpha.2",
56
- "@deepseek-ai/cordis": "^4.0.2",
57
- "@deepseek-ai/dsh-api-session-controller": "^0.1.6-alpha.2",
58
- "@deepseek-ai/dsh-client-store": "^0.1.6-alpha.2",
59
- "@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
60
- "@deepseek-ai/dsh-util-values": "^0.1.6-alpha.2",
61
- "@deepseek-ai/dsh-client-ui-renderer": "^0.1.6-alpha.2",
62
- "@deepseek-ai/dsh-client-ui-session": "^0.1.6-alpha.2"
47
+ "@deepseek-ai/dsh-client-connection": "0.1.7-alpha.2",
48
+ "@deepseek-ai/dsh-api-remotes": "0.1.7-alpha.2",
49
+ "@deepseek-ai/dsh-client-locale": "0.1.7-alpha.2",
50
+ "@deepseek-ai/dsh-client-test-runtime": "0.1.7-alpha.2",
51
+ "@deepseek-ai/dsh-client-ui-conversation": "0.1.7-alpha.2",
52
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.7-alpha.2",
53
+ "@deepseek-ai/cordis": "~4.0.4",
54
+ "@deepseek-ai/dsh-client-ui-input-trigger": "0.1.7-alpha.2",
55
+ "@deepseek-ai/dsh-commands": "0.1.7-alpha.2",
56
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.7-alpha.2",
57
+ "@deepseek-ai/dsh-api-session-controller": "0.1.7-alpha.2",
58
+ "@deepseek-ai/dsh-client-store": "0.1.7-alpha.2",
59
+ "@deepseek-ai/dsh-session": "0.1.7-alpha.2",
60
+ "@deepseek-ai/dsh-util-values": "0.1.7-alpha.2",
61
+ "@deepseek-ai/dsh-client-ui-renderer": "0.1.7-alpha.2",
62
+ "@deepseek-ai/dsh-client-ui-session": "0.1.7-alpha.2"
63
63
  },
64
64
  "files": [
65
65
  "lib/index.js",