@deepseek-ai/dsh-client-ui-reference 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-reference/README.md
5
- README.md: 6b5046f1c6300f5ec02d3737617019874762d47a
6
- README.zh.md: 99ba6fda18a73f5686f5e02403e48d5e556f9c3c
5
+ README.md: 57b5ae2440cf3dd4512cf44361b334dc7f3a58c9
6
+ README.zh.md: fa5af63c939f2bb71f371262dbbf137180c63f8e
package/README.md CHANGED
@@ -53,6 +53,8 @@ The source keeps candidate encoding internal to the registration effect: the `/c
53
53
 
54
54
  For an unquoted token, the browser starts the `fileReferences/list` and `sessionReferenceResolver/candidates` Remote calls together, then deterministically orders files, direct subagents of the current Session, and other Sessions. Rows use the resolver's display title, which prefers a subagent's creation label while ordinary Sessions retain their projected title, and render under locale-owned group headings without a redundant raw `reference` source title. A session row is dated from the Host session list's `updatedAt` through the same relative-time bucket that list uses, so one session reads the same age on both surfaces; a session the list does not carry falls back to the candidate's creation time. A drilled query publishes a breadcrumb from the workspace root to the current directory; each crumb carries the drill payload a folder row would, so returning to a step and descending into one are one outcome.
55
55
 
56
+ Candidate requests require an existing retained Client Session and share one temporary `referenceCandidates` reference. Both discovery calls wait for that Session's initial history open to succeed; an unretained Session or failed open prevents both RPCs. The candidate request's cancellation signal covers the history wait and both calls, and the temporary reference is released when the lookup settles.
57
+
56
58
  ### Serialization
57
59
 
58
60
  File picks preserve the natural text defined by the shared `@path` grammar as the hidden serialized and clipboard form. Session picks use the canonical `@[label](dsh-session:…)` mention; serialization never reconstructs identity from the visible title.
package/README.zh.md CHANGED
@@ -53,6 +53,8 @@ Web 用户需要从同一个 `@` 补全菜单提及文件、文件夹或会话
53
53
 
54
54
  对于未加引号的 token,浏览器会同时启动 `fileReferences/list` 与 `sessionReferenceResolver/candidates` Remote 调用,再按文件、当前 Session 的直接 subagent、其他 Session 的确定性顺序排列。各行使用 resolver 的显示标题;subagent 优先使用创建标签,普通 Session 保持投影标题,并渲染在 locale 管理的分组标题下,不显示重复的原始 `reference` source 标题。会话行用宿主会话列表的 `updatedAt` 经该列表相同的相对时间分档标注时间,因此同一个会话在两处读到的时长一致;列表中没有的会话回落到候选自带的创建时间。下钻后的查询会发布一条从工作区根目录到当前目录的面包屑;每一节携带的下钻载荷与文件夹行相同,因此「回到某一步」与「进入某一层」是同一个结果。
55
55
 
56
+ 候选请求要求客户端已持有该会话,并共用一个临时的 `referenceCandidates` 引用。两个发现调用都等待该会话首次历史打开成功;未持有会话或打开失败时,均不发送 RPC。候选请求的取消信号同时覆盖历史等待和两个调用,查询结束时释放临时引用。
57
+
56
58
  ### 序列化
57
59
 
58
60
  文件选择把共享 `@path` 语法所定义的自然文本保留为隐藏的序列化与剪贴板形式。会话选择使用规范的 `@[label](dsh-session:…)` mention;序列化永远不会根据可见标题重建身份。
package/lib/client.js CHANGED
@@ -161,9 +161,18 @@ window.__ModuleLoader__.load({
161
161
  name: "reference",
162
162
  showGroupTitle: false,
163
163
  async candidates(session, { query, quoted, drilled, signal }) {
164
- const fileLookup = ctx.remote.fileReferences.list(session.sessionId, query, signal).then((result) => result.ok ? result.value : []);
165
- const sessionLookup = quoted === true ? Promise.resolve([]) : ctx.remote.sessionReferenceResolver.candidates(session.sessionId, query, signal).then((result) => result.ok ? result.value : []);
166
- const [fileItems, sessionItems] = await Promise.all([fileLookup, sessionLookup]);
164
+ if (sessions.binding(session.sessionId) === void 0) throw new Error(`reference candidates require a retained session "${session.sessionId}"`);
165
+ const [fileItems, sessionItems] = await sessions.using(session.sessionId, {
166
+ source: "referenceCandidates",
167
+ signal
168
+ }, async (reference) => {
169
+ signal.throwIfAborted();
170
+ const state = reference.binding.session.getSnapshot();
171
+ if (state.openState !== "open") throw state.openError ?? /* @__PURE__ */ new Error(`session "${session.sessionId}" is not open`);
172
+ const fileLookup = ctx.remote.fileReferences.list(session.sessionId, query, signal).then((result) => result.ok ? result.value : []);
173
+ const sessionLookup = quoted === true ? Promise.resolve([]) : ctx.remote.sessionReferenceResolver.candidates(session.sessionId, query, signal).then((result) => result.ok ? result.value : []);
174
+ return Promise.all([fileLookup, sessionLookup]);
175
+ });
167
176
  if (signal.aborted) return [];
168
177
  const withLocation = crumbsFor(query, quoted === true, drilled, t) === void 0;
169
178
  const now = Date.now();
@@ -1,4 +1,10 @@
1
1
  import type { Context as ClientContext } from '@deepseek-ai/cordis';
2
+ declare module '@deepseek-ai/dsh-api-session-controller/client' {
3
+ interface SessionReferenceSourceMap {
4
+ /** File and Session candidates waiting for initial history and their RPC results. */
5
+ referenceCandidates: unknown;
6
+ }
7
+ }
2
8
  /** Required services: the trigger registry, the Remote namespaces, and the copy. */
3
9
  export declare const inject: string[];
4
10
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-client-ui-reference",
3
3
  "description": "Unified Web @file and @session reference source",
4
- "version": "0.1.6-alpha.2",
4
+ "version": "0.1.7-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -40,23 +40,23 @@
40
40
  },
41
41
  "license": "MIT",
42
42
  "peerDependencies": {
43
- "@deepseek-ai/cordis": "^4.0.2"
43
+ "@deepseek-ai/cordis": "~4.0.4"
44
44
  },
45
45
  "devDependencies": {
46
- "@deepseek-ai/dsh-api-remotes": "^0.1.6-alpha.2",
47
- "@deepseek-ai/dsh-api-session-controller": "^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-input-trigger": "^0.1.6-alpha.2",
52
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.6-alpha.2",
53
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.6-alpha.2",
54
- "@deepseek-ai/dsh-file-reference": "^0.1.6-alpha.2",
55
- "@deepseek-ai/dsh-session-reference": "^0.1.6-alpha.2",
56
- "@deepseek-ai/dsh-typert-protocol": "^0.1.6-alpha.2",
57
- "@deepseek-ai/dsh-util-workspace-path": "^0.1.6-alpha.2",
58
- "@deepseek-ai/cordis": "^4.0.2",
59
- "@deepseek-ai/dsh-client-ui-sidebar-right": "^0.1.6-alpha.2"
46
+ "@deepseek-ai/dsh-api-session-controller": "0.1.7-alpha.2",
47
+ "@deepseek-ai/dsh-api-remotes": "0.1.7-alpha.2",
48
+ "@deepseek-ai/dsh-client-connection": "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-input-trigger": "0.1.7-alpha.2",
52
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.7-alpha.2",
53
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.7-alpha.2",
54
+ "@deepseek-ai/dsh-file-reference": "0.1.7-alpha.2",
55
+ "@deepseek-ai/dsh-session-reference": "0.1.7-alpha.2",
56
+ "@deepseek-ai/dsh-typert-protocol": "0.1.7-alpha.2",
57
+ "@deepseek-ai/dsh-util-workspace-path": "0.1.7-alpha.2",
58
+ "@deepseek-ai/cordis": "~4.0.4",
59
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "0.1.7-alpha.2"
60
60
  },
61
61
  "files": [
62
62
  "lib/index.js",