@linxin666/dsh-client-ui-session-id 0.4.22 → 0.4.23
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 +2 -2
- package/README.md +7 -7
- package/README.zh.md +7 -7
- package/lib/client.js +94 -4
- package/lib/client.js.map +1 -1
- package/lib/types/client/SessionIdEntry.d.ts +1 -1
- package/lib/types/client/SessionIdEnvironmentRow.d.ts +12 -0
- package/lib/types/client/SessionIdPanel.d.ts +1 -1
- package/lib/types/client/index.d.ts +2 -1
- package/lib/types/client/semantic.d.ts +2 -0
- package/package.json +18 -17
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
|
# node scripts/verify-docs.mjs --write <dir>
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 14051d688962faadd4759100ede49575a29be2a2
|
|
6
|
+
README.zh.md: d42d3a998eb4247a44a2b03da98b4d7ce4eea746
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ English | [中文](README.zh.md)
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
<img src="https://img.shields.io/npm/v/@linxin666/dsh-client-ui-session-id?style=flat-square" alt="Version">
|
|
7
7
|
|
|
8
|
-
<img src="https://img.shields.io/badge/DSH-%3E%3D0.2.3--alpha.
|
|
8
|
+
<img src="https://img.shields.io/badge/DSH-%3E%3D0.2.3--alpha.4-4c6ef5?style=flat-square&labelColor=454a54" alt="DSH">
|
|
9
9
|
|
|
10
10
|
<img src="https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square" alt="License">
|
|
11
11
|
</p>
|
|
@@ -15,14 +15,15 @@ English | [中文](README.zh.md)
|
|
|
15
15
|
<em>Sidebar Footer Trigger · Real-Time Session ID List · One-Click Clipboard Copy · Instant Local Filter</em>
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
|
-
A browser-only extension for DeepSeek Harness (DSH) Web GUI and desktop client:
|
|
18
|
+
A browser-only extension for DeepSeek Harness (DSH) Web GUI and desktop client: adds a copyable session-ID row to the session environment panel (`conversation.session.panel.environment.row`) and a quick trigger at the bottom of the sidebar (`sidebar.footer.action`) to search and copy full session IDs with one click, without modifying DSH source code and with zero host overhead.
|
|
19
19
|
|
|
20
20
|
## What it does
|
|
21
21
|
|
|
22
|
+
- Adds a copyable current-session ID row in the session environment panel (`conversation.session.panel.environment.row`, `id: 'session-id'`, `order: 40`).
|
|
22
23
|
- Adds a "Session ID" trigger beside the sidebar settings row: an icon-only
|
|
23
24
|
button in both the 56px rail and the wide sidebar (the label stays as the
|
|
24
25
|
accessible name and hover tooltip).
|
|
25
|
-
- In the rail it stacks vertically with
|
|
26
|
+
- In the rail it stacks vertically with pairing and other footer actions on the rail
|
|
26
27
|
centerline; in the wide sidebar it sits inline with them.
|
|
27
28
|
- Opens a centered panel listing every session: display title, full session id
|
|
28
29
|
(monospace), and a per-row "Copy" button. The current session is marked.
|
|
@@ -49,8 +50,8 @@ at the bottom of the sidebar.
|
|
|
49
50
|
```sh
|
|
50
51
|
git clone https://github.com/zhu1090093659/dsh-web.git
|
|
51
52
|
cd dsh-web
|
|
52
|
-
pnpm install
|
|
53
|
-
pnpm
|
|
53
|
+
pnpm run deps:install
|
|
54
|
+
pnpm build
|
|
54
55
|
dsh plugin --profile web add link:$(pwd)/packages/dsh-session-id
|
|
55
56
|
```
|
|
56
57
|
|
|
@@ -69,8 +70,7 @@ dsh plugin --profile web add link:$(pwd)/packages/dsh-session-id
|
|
|
69
70
|
|
|
70
71
|
## Known limitations
|
|
71
72
|
|
|
72
|
-
- Requires a DSH shell
|
|
73
|
-
newer shells). On older shells the entry does not render.
|
|
73
|
+
- Requires a DSH shell declaring `sidebar.footer.action` (and `conversation.session.panel.environment.row` on DSH 0.2.3-alpha.2+ for the environment panel row); missing slots are skipped cleanly.
|
|
74
74
|
- Read-only viewer: it shows and copies ids, it does not open or manage
|
|
75
75
|
sessions.
|
|
76
76
|
|
package/README.zh.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
<img src="https://img.shields.io/npm/v/@linxin666/dsh-client-ui-session-id?style=flat-square" alt="Version">
|
|
7
7
|
|
|
8
|
-
<img src="https://img.shields.io/badge/DSH-%3E%3D0.2.3--alpha.
|
|
8
|
+
<img src="https://img.shields.io/badge/DSH-%3E%3D0.2.3--alpha.4-4c6ef5?style=flat-square&labelColor=454a54" alt="DSH">
|
|
9
9
|
|
|
10
10
|
<img src="https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square" alt="License">
|
|
11
11
|
</p>
|
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
<em>侧边栏底栏入口 · 实时全量会话 ID · 一键复制到剪贴板 · 本地极速过滤 · 零 Host 开销</em>
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
|
-
纯浏览器端的 DSH Web GUI
|
|
18
|
+
纯浏览器端的 DSH Web GUI 插件:在会话环境面板提供当前会话 ID 一键复制行(`conversation.session.panel.environment.row`),并在侧边栏底部加入口(`sidebar.footer.action`),打开面板列出全部会话的完整 ID 一键复制,不改任何 DSH 源码,host 侧零行为。
|
|
19
19
|
|
|
20
20
|
## 是什么
|
|
21
21
|
|
|
22
|
+
- 在会话环境面板注册当前会话 ID 复制行(`conversation.session.panel.environment.row`,`id: 'session-id'`,`order: 40`)。
|
|
22
23
|
- 在侧边栏底部的设置行旁边新增「会话 ID」入口:收起态与展开态都只显示
|
|
23
24
|
图标按钮(文字保留为无障碍名称与悬停提示)。
|
|
24
|
-
-
|
|
25
|
+
- 收起态下与配对等其他底部入口同列纵向堆叠、对齐轨道中轴;展开态下与其他底部
|
|
25
26
|
入口同行横排。
|
|
26
27
|
- 点击打开居中面板,列出全部会话:显示标题、完整会话 ID(等宽字体),每行
|
|
27
28
|
一个「复制」按钮;当前会话有标记。
|
|
@@ -47,8 +48,8 @@ dsh plugin --profile web add @linxin666/dsh-client-ui-session-id@latest
|
|
|
47
48
|
```sh
|
|
48
49
|
git clone https://github.com/zhu1090093659/dsh-web.git
|
|
49
50
|
cd dsh-web
|
|
50
|
-
pnpm install
|
|
51
|
-
pnpm
|
|
51
|
+
pnpm run deps:install
|
|
52
|
+
pnpm build
|
|
52
53
|
dsh plugin --profile web add link:$(pwd)/packages/dsh-session-id
|
|
53
54
|
```
|
|
54
55
|
|
|
@@ -64,8 +65,7 @@ dsh plugin --profile web add link:$(pwd)/packages/dsh-session-id
|
|
|
64
65
|
|
|
65
66
|
## 已知限制
|
|
66
67
|
|
|
67
|
-
- 需要声明了 `sidebar.footer.action`
|
|
68
|
-
旧版外壳上入口不会渲染。
|
|
68
|
+
- 需要声明了 `sidebar.footer.action` 的 DSH Web 外壳(会话环境面板复制行需 DSH 0.2.3-alpha.2+ 声明 `conversation.session.panel.environment.row`);缺失的槽位会被静默跳过。
|
|
69
69
|
- 只读查看器:只展示与复制 ID,不打开或管理会话。
|
|
70
70
|
|
|
71
71
|
## 数据遥测
|
package/lib/client.js
CHANGED
|
@@ -6,7 +6,7 @@ window.__ModuleLoader__.load({
|
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
7
|
let react = require("react");
|
|
8
8
|
let react_dom = require("react-dom");
|
|
9
|
-
let
|
|
9
|
+
let _deepseek_ai_dsh_client_ui_primitives_client = require("@deepseek-ai/dsh-client-ui-primitives/client");
|
|
10
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
11
|
//#region src/client/main-session.ts
|
|
12
12
|
/**
|
|
@@ -97,12 +97,17 @@ window.__ModuleLoader__.load({
|
|
|
97
97
|
const SESSION_ID_PART_COPY = "copy";
|
|
98
98
|
/** The panel search input. */
|
|
99
99
|
const SESSION_ID_PART_SEARCH = "search";
|
|
100
|
+
/** The official session-panel environment row for the active session. */
|
|
101
|
+
const SESSION_ID_PART_ENV_ROW = "environment-row";
|
|
100
102
|
//#endregion
|
|
101
103
|
//#region \0dsh-css:packages/dsh-session-id/src/client/session-id.module.css.mjs
|
|
102
104
|
var session_id_module_css_default = {
|
|
103
105
|
"closeButton": "-TNLea_closeButton",
|
|
104
106
|
"copyButton": "-TNLea_copyButton",
|
|
105
107
|
"empty": "-TNLea_empty",
|
|
108
|
+
"envContent": "-TNLea_envContent",
|
|
109
|
+
"envCopyButton": "-TNLea_envCopyButton",
|
|
110
|
+
"envValue": "-TNLea_envValue",
|
|
106
111
|
"header": "-TNLea_header",
|
|
107
112
|
"heading": "-TNLea_heading",
|
|
108
113
|
"icon": "-TNLea_icon",
|
|
@@ -150,7 +155,7 @@ window.__ModuleLoader__.load({
|
|
|
150
155
|
}, []);
|
|
151
156
|
const handleCopy = () => {
|
|
152
157
|
window.clearTimeout(idleTimer.current);
|
|
153
|
-
(0,
|
|
158
|
+
(0, _deepseek_ai_dsh_client_ui_primitives_client.writeClipboard)(session.id).then((ok) => {
|
|
154
159
|
if (ok) {
|
|
155
160
|
setStatus("copied");
|
|
156
161
|
idleTimer.current = window.setTimeout(() => {
|
|
@@ -300,6 +305,78 @@ window.__ModuleLoader__.load({
|
|
|
300
305
|
}), document.body)] });
|
|
301
306
|
}
|
|
302
307
|
//#endregion
|
|
308
|
+
//#region src/client/SessionIdEnvironmentRow.tsx
|
|
309
|
+
/**
|
|
310
|
+
* Official `conversation.session.panel.environment.row` entry: shows the
|
|
311
|
+
* active session's id inside the official Session Panel's Environment section
|
|
312
|
+
* with one-click copy, matching the panel's `data-session-panel-row` markup.
|
|
313
|
+
* @module @linxin666/dsh-client-ui-session-id/client/SessionIdEnvironmentRow
|
|
314
|
+
*/
|
|
315
|
+
/**
|
|
316
|
+
* Render the active session's id as a native row inside the Session Panel's
|
|
317
|
+
* Environment section.
|
|
318
|
+
*/
|
|
319
|
+
function SessionIdEnvironmentRow({ sessionId, t, copy = _deepseek_ai_dsh_client_ui_primitives_client.writeClipboard }) {
|
|
320
|
+
const [status, setStatus] = (0, react.useState)("idle");
|
|
321
|
+
const idleTimer = (0, react.useRef)(void 0);
|
|
322
|
+
(0, react.useEffect)(() => {
|
|
323
|
+
setStatus("idle");
|
|
324
|
+
return () => {
|
|
325
|
+
window.clearTimeout(idleTimer.current);
|
|
326
|
+
};
|
|
327
|
+
}, [sessionId]);
|
|
328
|
+
if (!sessionId) return null;
|
|
329
|
+
const handleCopy = () => {
|
|
330
|
+
window.clearTimeout(idleTimer.current);
|
|
331
|
+
copy(sessionId).then((ok) => {
|
|
332
|
+
if (ok) {
|
|
333
|
+
setStatus("copied");
|
|
334
|
+
idleTimer.current = window.setTimeout(() => {
|
|
335
|
+
setStatus("idle");
|
|
336
|
+
}, 1200);
|
|
337
|
+
} else setStatus("failed");
|
|
338
|
+
}).catch(() => {
|
|
339
|
+
setStatus("failed");
|
|
340
|
+
});
|
|
341
|
+
};
|
|
342
|
+
const copyLabel = status === "copied" ? t("panel.copied") : status === "failed" ? t("panel.copyFailed") : t("panel.copy");
|
|
343
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
344
|
+
"data-session-panel-row": "",
|
|
345
|
+
"data-dsh-plugin": SESSION_ID_PLUGIN_ATTR,
|
|
346
|
+
"data-dsh-part": SESSION_ID_PART_ENV_ROW,
|
|
347
|
+
"data-session-id": sessionId,
|
|
348
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
349
|
+
"data-row-part": "body",
|
|
350
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
351
|
+
"data-row-part": "icon",
|
|
352
|
+
"aria-hidden": "true",
|
|
353
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SessionIdIcon, {})
|
|
354
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
355
|
+
"data-row-part": "content",
|
|
356
|
+
className: session_id_module_css_default.envContent,
|
|
357
|
+
title: `${t("entry.label")}: ${sessionId}`,
|
|
358
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
359
|
+
className: session_id_module_css_default.envValue,
|
|
360
|
+
children: sessionId
|
|
361
|
+
})
|
|
362
|
+
})]
|
|
363
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
364
|
+
"data-row-part": "menu",
|
|
365
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
366
|
+
type: "button",
|
|
367
|
+
className: session_id_module_css_default.envCopyButton,
|
|
368
|
+
"data-dsh-part": SESSION_ID_PART_COPY,
|
|
369
|
+
"data-copied": status === "copied" ? "true" : void 0,
|
|
370
|
+
"data-failed": status === "failed" ? "true" : void 0,
|
|
371
|
+
"aria-label": `${copyLabel} ${sessionId}`,
|
|
372
|
+
title: copyLabel,
|
|
373
|
+
onClick: handleCopy,
|
|
374
|
+
children: status === "copied" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckIcon, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopyIcon, {})
|
|
375
|
+
})
|
|
376
|
+
})]
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
//#endregion
|
|
303
380
|
//#region src/client/locales.ts
|
|
304
381
|
/**
|
|
305
382
|
* Locale dictionaries for the session-id plugin. `zh` is the key-set source of
|
|
@@ -354,7 +431,7 @@ window.__ModuleLoader__.load({
|
|
|
354
431
|
/** The building package's version, when the bundle carries it. */
|
|
355
432
|
function bakedVersion() {
|
|
356
433
|
try {
|
|
357
|
-
return "0.4.
|
|
434
|
+
return "0.4.23";
|
|
358
435
|
} catch {
|
|
359
436
|
return;
|
|
360
437
|
}
|
|
@@ -482,13 +559,26 @@ window.__ModuleLoader__.load({
|
|
|
482
559
|
return () => {};
|
|
483
560
|
}
|
|
484
561
|
});
|
|
562
|
+
ctx.slots.inject("conversation.session.panel.environment.row", () => {
|
|
563
|
+
try {
|
|
564
|
+
return ctx.slots.register({
|
|
565
|
+
name: "conversation.session.panel.environment.row",
|
|
566
|
+
id: ENTRY_ID,
|
|
567
|
+
order: 40,
|
|
568
|
+
locale: NS,
|
|
569
|
+
inject: (sessionId) => ({ sessionId })
|
|
570
|
+
}, SessionIdEnvironmentRow);
|
|
571
|
+
} catch {
|
|
572
|
+
return () => {};
|
|
573
|
+
}
|
|
574
|
+
});
|
|
485
575
|
}
|
|
486
576
|
//#endregion
|
|
487
577
|
exports.apply = apply;
|
|
488
578
|
exports.inject = inject;
|
|
489
579
|
return module.exports;
|
|
490
580
|
},
|
|
491
|
-
meta: () => ({ stylesheets: { "packages/dsh-session-id/src/client/session-id.module.css": { text: () => ".-TNLea_trigger{width:36px;height:36px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:50%;flex:none;order:1;justify-content:center;align-items:center;padding:0;transition:background-color .12s,color .12s,box-shadow .12s;display:inline-flex;position:relative}.-TNLea_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.-TNLea_trigger:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}.-TNLea_trigger:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-2), 0 0 0 4px var(--dsw-alias-brand-primary);outline:none}[class*=footerActions]:has([data-dsh-plugin=session-id][data-wide=rail]){flex-direction:column;align-items:center;gap:4px}.-TNLea_overlay{z-index:1000;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.-TNLea_mask{background:var(--dsw-alias-bg-mask-1);backdrop-filter:var(--dsw-mask-blur);position:absolute;inset:0}.-TNLea_panel{z-index:1;box-sizing:border-box;background:var(--dsw-alias-bg-layer-2);width:560px;max-width:calc(100vw - 48px);max-height:calc(100vh - 48px);box-shadow:var(--dsw-shadow-lv3);color:var(--dsw-alias-label-primary);border-radius:24px;flex-direction:column;gap:14px;padding:24px;font-size:14px;line-height:22px;display:flex;position:relative}.-TNLea_header{align-items:flex-start;gap:12px;display:flex}.-TNLea_heading{flex:1;min-width:0}.-TNLea_title{margin:0;font-size:18px;font-weight:600;line-height:26px}.-TNLea_closeButton{width:28px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:8px;flex:none;justify-content:center;align-items:center;padding:0;transition:background-color .12s,color .12s;display:inline-flex}.-TNLea_closeButton:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.-TNLea_closeButton:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-2), 0 0 0 4px var(--dsw-alias-brand-primary);outline:none}.-TNLea_search{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);width:100%;height:32px;color:var(--dsw-alias-label-primary);border-radius:8px;flex:none;padding:0 10px;font-size:14px;line-height:20px}.-TNLea_search::placeholder{color:var(--dsw-alias-label-tertiary)}.-TNLea_search:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-2), 0 0 0 4px var(--dsw-alias-brand-primary);outline:none}.-TNLea_empty{text-align:center;color:var(--dsw-alias-label-tertiary);padding:24px 0}.-TNLea_list{flex-direction:column;gap:4px;display:flex;overflow:auto}.-TNLea_row{border-radius:10px;align-items:center;gap:10px;min-width:0;padding:8px 10px;display:flex}.-TNLea_row:hover{background:var(--dsw-alias-interactive-bg-hover)}.-TNLea_rowInfo{flex:1;min-width:0}.-TNLea_rowTitle{white-space:nowrap;text-overflow:ellipsis;color:var(--dsw-alias-label-primary);font-weight:500;display:block;overflow:hidden}.-TNLea_rowTitle.-TNLea_rowActive{color:var(--dsw-alias-brand-primary)}.-TNLea_rowId{white-space:nowrap;text-overflow:ellipsis;color:var(--dsw-alias-label-secondary);font-family:var(--dsw-font-mono,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);margin-top:2px;font-size:12px;line-height:18px;display:block;overflow:hidden}.-TNLea_rowMeta{color:var(--dsw-alias-label-tertiary);align-items:center;gap:8px;margin-top:2px;font-size:12px;line-height:18px;display:flex}.-TNLea_copyButton{height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:8px;flex:none;align-items:center;gap:4px;padding:0 10px;font-size:12px;line-height:18px;transition:background-color .12s,color .12s;display:inline-flex}.-TNLea_copyButton:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.-TNLea_copyButton[data-copied=true]{color:var(--dsw-alias-brand-primary)}.-TNLea_copyButton[data-failed=true]{color:var(--dsw-alias-state-error-primary)}.-TNLea_copyButton:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-2), 0 0 0 4px var(--dsw-alias-brand-primary);outline:none}.-TNLea_icon{width:16px;height:16px}.-TNLea_iconSmall{width:12px;height:12px}" } } })
|
|
581
|
+
meta: () => ({ stylesheets: { "packages/dsh-session-id/src/client/session-id.module.css": { text: () => ".-TNLea_trigger{width:36px;height:36px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:50%;flex:none;order:1;justify-content:center;align-items:center;padding:0;transition:background-color .12s,color .12s,box-shadow .12s;display:inline-flex;position:relative}.-TNLea_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.-TNLea_trigger:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}.-TNLea_trigger:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-2), 0 0 0 4px var(--dsw-alias-brand-primary);outline:none}[class*=footerActions]:has([data-dsh-plugin=session-id][data-wide=rail]){flex-direction:column;align-items:center;gap:4px}.-TNLea_overlay{z-index:1000;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.-TNLea_mask{background:var(--dsw-alias-bg-mask-1);backdrop-filter:var(--dsw-mask-blur);position:absolute;inset:0}.-TNLea_panel{z-index:1;box-sizing:border-box;background:var(--dsw-alias-bg-layer-2);width:560px;max-width:calc(100vw - 48px);max-height:calc(100vh - 48px);box-shadow:var(--dsw-shadow-lv3);color:var(--dsw-alias-label-primary);border-radius:24px;flex-direction:column;gap:14px;padding:24px;font-size:14px;line-height:22px;display:flex;position:relative}.-TNLea_header{align-items:flex-start;gap:12px;display:flex}.-TNLea_heading{flex:1;min-width:0}.-TNLea_title{margin:0;font-size:18px;font-weight:600;line-height:26px}.-TNLea_closeButton{width:28px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:8px;flex:none;justify-content:center;align-items:center;padding:0;transition:background-color .12s,color .12s;display:inline-flex}.-TNLea_closeButton:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.-TNLea_closeButton:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-2), 0 0 0 4px var(--dsw-alias-brand-primary);outline:none}.-TNLea_search{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);width:100%;height:32px;color:var(--dsw-alias-label-primary);border-radius:8px;flex:none;padding:0 10px;font-size:14px;line-height:20px}.-TNLea_search::placeholder{color:var(--dsw-alias-label-tertiary)}.-TNLea_search:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-2), 0 0 0 4px var(--dsw-alias-brand-primary);outline:none}.-TNLea_empty{text-align:center;color:var(--dsw-alias-label-tertiary);padding:24px 0}.-TNLea_list{flex-direction:column;gap:4px;display:flex;overflow:auto}.-TNLea_row{border-radius:10px;align-items:center;gap:10px;min-width:0;padding:8px 10px;display:flex}.-TNLea_row:hover{background:var(--dsw-alias-interactive-bg-hover)}.-TNLea_rowInfo{flex:1;min-width:0}.-TNLea_rowTitle{white-space:nowrap;text-overflow:ellipsis;color:var(--dsw-alias-label-primary);font-weight:500;display:block;overflow:hidden}.-TNLea_rowTitle.-TNLea_rowActive{color:var(--dsw-alias-brand-primary)}.-TNLea_rowId{white-space:nowrap;text-overflow:ellipsis;color:var(--dsw-alias-label-secondary);font-family:var(--dsw-font-mono,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);margin-top:2px;font-size:12px;line-height:18px;display:block;overflow:hidden}.-TNLea_rowMeta{color:var(--dsw-alias-label-tertiary);align-items:center;gap:8px;margin-top:2px;font-size:12px;line-height:18px;display:flex}.-TNLea_copyButton{height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:8px;flex:none;align-items:center;gap:4px;padding:0 10px;font-size:12px;line-height:18px;transition:background-color .12s,color .12s;display:inline-flex}.-TNLea_copyButton:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.-TNLea_copyButton[data-copied=true]{color:var(--dsw-alias-brand-primary)}.-TNLea_copyButton[data-failed=true]{color:var(--dsw-alias-state-error-primary)}.-TNLea_copyButton:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-2), 0 0 0 4px var(--dsw-alias-brand-primary);outline:none}.-TNLea_icon{width:16px;height:16px}.-TNLea_iconSmall{width:12px;height:12px}.-TNLea_envContent{flex:1;align-items:center;min-width:0;display:inline-flex}.-TNLea_envValue{text-overflow:ellipsis;white-space:nowrap;font-family:var(--dsw-font-mono,ui-monospace, monospace);color:var(--dsw-alias-label-secondary);font-size:12px;overflow:hidden}.-TNLea_envCopyButton{width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;padding:0;transition:background-color .12s,color .12s;display:inline-flex}.-TNLea_envCopyButton:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.-TNLea_envCopyButton[data-copied=true]{color:var(--dsw-alias-brand-primary)}.-TNLea_envCopyButton[data-failed=true]{color:var(--dsw-alias-state-error-primary)}" } } })
|
|
492
582
|
});
|
|
493
583
|
|
|
494
584
|
//# sourceMappingURL=client.js.map
|
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["css","css"],"sources":["../../../packages/dsh-session-id/src/client/main-session.ts","../../../packages/dsh-session-id/src/client/icons.tsx","../../../packages/dsh-session-id/src/client/semantic.ts","../../../packages/dsh-session-id/src/client/SessionIdPanel.tsx","../../../packages/dsh-session-id/src/client/SessionIdEntry.tsx","../../../packages/dsh-session-id/src/client/locales.ts","../../../packages/dsh-session-id/src/client/telemetry.ts","../../../packages/dsh-session-id/src/client/index.ts"],"sourcesContent":["// Generated by scripts/sync-shared.mjs from shared/client/main-session.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Main-view Session derivation for the multi-instance Client Session model.\n *\n * The Client Session Controller carries no global \"current\" selection: view\n * selection belongs to the workspace UI, which owns the main-area reference and\n * publishes it through the catalog's per-source ownership counts\n * (`SessionSummary.retainedBy.mainView`). A plugin that needs the Session the\n * main view shows derives it from that marker instead of the removed\n * `SessionListState.current` field.\n *\n * The marker describes view ownership, not authority. It is the right input for\n * presentation and for deciding which view a navigation targets; it is not a\n * business fallback, because source counts never imply visibility or success.\n * @module dsh-web/shared/main-session\n */\n\n/** The catalog row subset this helper reads (a `SessionSummary` projection). */\nexport interface MainViewOwnedRow<Id extends string = string> {\n /** Catalog row identity. */\n readonly id: Id\n /** Per-source local ownership counts; absent rows are never owned. */\n readonly retainedBy?: Readonly<Partial<Record<string, number>>> | undefined\n}\n\n/**\n * Resolve the Session the main view currently shows.\n *\n * Reads the catalog's rows rather than a per-id retain-info source: ownership\n * counts ride the list snapshot, so this neither allocates observers nor opens\n * history, and a subscription to the list still fires when the selection moves.\n * @param byId - the session catalog's rows (`SessionListState.byId`), when available.\n * @returns the main-view session id, or undefined when the main view shows none.\n */\nexport function mainViewSessionId<Id extends string>(\n byId: Readonly<Record<Id, MainViewOwnedRow<Id> | undefined>> | undefined | null,\n): Id | undefined {\n if (byId === undefined || byId === null) return undefined\n for (const row of Object.values<MainViewOwnedRow<Id> | undefined>(byId)) {\n if (row !== undefined && (row.retainedBy?.mainView ?? 0) > 0) return row.id\n }\n return undefined\n}\n","/**\n * Inline SVG icons for the session-id plugin (16px stroke style matching the\n * shell's nav icons; sized via className where a smaller variant is needed).\n */\nimport type { SVGProps } from 'react'\n\n/** Shared svg attrs for the 16px stroke icon family. */\nfunction iconProps(props: SVGProps<SVGSVGElement>): SVGProps<SVGSVGElement> {\n return {\n width: 16,\n height: 16,\n viewBox: '0 0 16 16',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 1.3,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n 'aria-hidden': true,\n ...props,\n }\n}\n\n/** An ID-card / identifier glyph for the seat trigger and panel title. */\nexport function SessionIdIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg {...iconProps(props)}>\n <rect x=\"1.5\" y=\"3.5\" width=\"13\" height=\"9\" rx=\"1.5\" />\n <path d=\"M4 6.5h2M4 9h2M7.5 6.5h4.5M7.5 9h4.5\" />\n </svg>\n )\n}\n\n/** Copy glyph. */\nexport function CopyIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg {...iconProps(props)}>\n <rect x=\"5.5\" y=\"5.5\" width=\"9\" height=\"9\" rx=\"1.5\" />\n <path d=\"M2.5 10.5v-7A1.5 1.5 0 0 1 4 2h5.5\" />\n </svg>\n )\n}\n\n/** Check glyph for the transient copied state. */\nexport function CheckIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg {...iconProps(props)}>\n <path d=\"M3 8.5 6.5 12l6.5-8\" />\n </svg>\n )\n}\n\n/** Close glyph for the panel header. */\nexport function CloseIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg {...iconProps(props)}>\n <path d=\"M4 4l8 8M12 4l-8 8\" />\n </svg>\n )\n}\n","/**\n * Semantic attribute values for the session-id plugin (contract:\n * skins/skin-center/contracts/semantic-attrs-v1.md). Root containers carry\n * `data-dsh-plugin`; parts carry bare `data-dsh-part` values owned by the\n * plugin attribute.\n */\n\n/** Plugin short name stamped on the root container and the footer trigger. */\nexport const SESSION_ID_PLUGIN_ATTR = 'session-id'\n\n/** The sidebar footer seat trigger. */\nexport const SESSION_ID_PART_ENTRY = 'entry'\n\n/** The modal panel root. */\nexport const SESSION_ID_PART_PANEL = 'panel'\n\n/** One session list row. */\nexport const SESSION_ID_PART_ROW = 'row'\n\n/** The per-row copy button. */\nexport const SESSION_ID_PART_COPY = 'copy'\n\n/** The panel search input. */\nexport const SESSION_ID_PART_SEARCH = 'search'","/**\n * Session ID panel — a centered modal listing every session with its full id\n * and a copy button. Data rides the injected `sessionList` observable\n * (ctx.sessions.list, see SessionRuntime.list) read through\n * useSyncExternalStore, so the panel stays in sync with host list updates and\n * needs no per-session runtime wiring.\n */\nimport { useEffect, useRef, useSyncExternalStore, useState } from 'react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { SessionListState, SessionSummary } from '@deepseek-ai/dsh-api-session-controller/client'\nimport { writeClipboard } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { mainViewSessionId } from './main-session.ts'\nimport { CheckIcon, CopyIcon, CloseIcon } from './icons.tsx'\nimport { SESSION_ID_PART_COPY, SESSION_ID_PART_PANEL, SESSION_ID_PART_ROW, SESSION_ID_PART_SEARCH, SESSION_ID_PLUGIN_ATTR } from './semantic.ts'\nimport css from './session-id.module.css'\n\n/** The sessions-list read face injected by the plugin (ObservableSnapshot). */\nexport type SessionListReadSource = {\n getSnapshot(): SessionListState\n subscribe(fn: () => void): () => void\n}\n\n/** Panel props: the list source + the locale seat. */\nexport type SessionIdPanelProps = PropsLocale<'session-id'> & {\n list: SessionListReadSource\n onClose: () => void\n}\n\n/** Sort sessions by update time, newest first; blank rows sink to the bottom. */\nfunction sortSessions(list: SessionListState): SessionSummary[] {\n const rows = list.ids\n .map(id => list.byId[id])\n .filter((row): row is SessionSummary => row !== undefined)\n return [...rows].sort((a, b) => {\n if (a.blank !== b.blank) return a.blank ? 1 : -1\n return b.updatedAt - a.updatedAt\n })\n}\n\n/** One session row: title + id + copy button with transient \"copied\" / failed state. */\nfunction SessionRow({ session, current, t }: {\n session: SessionSummary\n current: string | undefined\n t: PropsLocale<'session-id'>['t']\n}) {\n const [status, setStatus] = useState<'idle' | 'copied' | 'failed'>('idle')\n const idleTimer = useRef<number | undefined>(undefined)\n const active = session.id === current\n const title = session.displayTitle || session.id\n\n // A pending reset timer belongs to the previous copy; drop it when the row\n // leaves the DOM so nothing keeps running after unmount.\n useEffect(() => {\n return () => { window.clearTimeout(idleTimer.current) }\n }, [])\n\n const handleCopy = (): void => {\n // Clear the previous reset before a new write so rapid repeated clicks\n // never stack timers (only the latest copy reaches the idle reset).\n window.clearTimeout(idleTimer.current)\n // Copy must be gesture-driven; a failed write surfaces an actionable\n // message instead of silently swallowing the error (no permission\n // requests, no background retry).\n void writeClipboard(session.id).then((ok) => {\n if (ok) {\n setStatus('copied')\n idleTimer.current = window.setTimeout(() => { setStatus('idle') }, 1200)\n } else {\n setStatus('failed')\n }\n }).catch(() => {\n // A rejected write is the same actionable failure as ok === false.\n setStatus('failed')\n })\n }\n\n const copyLabel = status === 'copied' ? t('panel.copied')\n : status === 'failed' ? t('panel.copyFailed') : t('panel.copy')\n\n return (\n <div className={css.row} data-dsh-part={SESSION_ID_PART_ROW}>\n <span className={css.rowInfo}>\n <span className={`${css.rowTitle}${active ? ` ${css.rowActive}` : ''}`} title={title}>\n {title}\n </span>\n {active && <span className={css.rowMeta}>{t('panel.current')}</span>}\n <span className={css.rowId} title={session.id}>{session.id}</span>\n </span>\n <button\n type=\"button\"\n className={css.copyButton}\n data-dsh-part={SESSION_ID_PART_COPY}\n data-copied={status === 'copied' ? 'true' : undefined}\n data-failed={status === 'failed' ? 'true' : undefined}\n aria-label={`${copyLabel} ${session.id}`}\n onClick={handleCopy}\n >\n {status === 'copied' ? <CheckIcon className={css.iconSmall} /> : <CopyIcon className={css.iconSmall} />}\n {copyLabel}\n </button>\n </div>\n )\n}\n\n/**\n * Render the session-id panel body.\n * @param props - injected list source + locale seat + close callback.\n * @returns the modal panel.\n */\nexport function SessionIdPanel({ list, onClose, t }: SessionIdPanelProps) {\n const snapshot = useSyncExternalStore(list.subscribe, list.getSnapshot)\n const sorted = sortSessions(snapshot)\n // The catalog carries no global selection since 0.1.6-alpha.2; the Session the\n // main view owns is the one to mark as current.\n const currentId = mainViewSessionId(snapshot.byId)\n const [search, setSearch] = useState('')\n\n // Local, read-only filter over the already-visible list (title or id\n // substring, case-insensitive) — no host API, no disk, no other profile.\n const query = search.trim().toLowerCase()\n const rows = query === ''\n ? sorted\n : sorted.filter(row => row.displayTitle.toLowerCase().includes(query) || row.id.toLowerCase().includes(query))\n\n return (\n <div className={css.overlay} role=\"presentation\" data-dsh-plugin={SESSION_ID_PLUGIN_ATTR}>\n <div className={css.mask} aria-hidden=\"true\" onClick={onClose} />\n <div className={css.panel} data-dsh-part={SESSION_ID_PART_PANEL} role=\"dialog\" aria-modal=\"true\" aria-label={t('panel.title')}>\n <div className={css.header}>\n <div className={css.heading}>\n <h2 className={css.title}>{t('panel.title')}</h2>\n </div>\n <button\n type=\"button\"\n className={css.closeButton}\n aria-label={t('panel.close')}\n onClick={onClose}\n >\n <CloseIcon className={css.icon} />\n </button>\n </div>\n <input\n type=\"search\"\n className={css.search}\n data-dsh-part={SESSION_ID_PART_SEARCH}\n placeholder={t('panel.search.placeholder')}\n aria-label={t('panel.search.aria')}\n value={search}\n onChange={(event) => { setSearch(event.target.value) }}\n />\n {rows.length === 0 ? (\n <div className={css.empty}>{query === '' ? t('panel.empty') : t('panel.noMatches')}</div>\n ) : (\n <div className={css.list}>\n {rows.map(row => (\n <SessionRow key={row.id} session={row} current={currentId} t={t} />\n ))}\n </div>\n )}\n </div>\n </div>\n )\n}\n","/**\n * Sidebar footer entry for the session-id plugin: the icon-only trigger\n * beside the sidebar settings seat (wide row / rail circle) that opens the\n * session-id panel. Registered into the official `sidebar.footer.action`\n * list slot (declared by ui-sidebar, same seat dsh-remote-web-ui shares).\n */\nimport { useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport { SessionIdPanel, type SessionListReadSource } from './SessionIdPanel.tsx'\nimport { SESSION_ID_PART_ENTRY, SESSION_ID_PLUGIN_ATTR } from './semantic.ts'\nimport { SessionIdIcon } from './icons.tsx'\nimport css from './session-id.module.css'\n\n/** Entry props: the footer seat's column state + injected list source + locale seat. */\nexport type SessionIdEntryProps = PropsLocale<'session-id'> & {\n /** Whether the sidebar renders wide content (false = 56px rail). */\n wide: boolean\n /** The sessions-list read face (ctx.sessions.list wrapped by the plugin). */\n list: SessionListReadSource\n}\n\n/**\n * Render the session-id seat trigger and panel.\n * @param props - composed slot props.\n * @returns the trigger and, when open, the panel portal.\n */\nexport function SessionIdEntry({ wide, list, t }: SessionIdEntryProps) {\n const [open, setOpen] = useState(false)\n\n const trigger = (\n <button\n type=\"button\"\n className={css.trigger}\n data-dsh-plugin={SESSION_ID_PLUGIN_ATTR}\n data-dsh-part={SESSION_ID_PART_ENTRY}\n data-wide={wide ? 'wide' : 'rail'}\n aria-label={t('entry.label')}\n title={t('entry.label')}\n onClick={() => { setOpen(true) }}\n >\n <SessionIdIcon />\n </button>\n )\n\n return (\n <>\n {trigger}\n {open && createPortal(\n <SessionIdPanel list={list} onClose={() => { setOpen(false) }} t={t} />,\n document.body,\n )}\n </>\n )\n}\n","/**\n * Locale dictionaries for the session-id plugin. `zh` is the key-set source of\n * truth; `en` keeps a full key-for-key mirror (packages/AGENTS.md bilingual\n * rules). Registered through ctx.locale.register(NS, { zh, en }).\n */\n\n/** Simplified Chinese dictionary (key-set source of truth). */\nexport const zh = {\n 'entry.label': '会话 ID',\n 'panel.title': '会话 ID',\n 'panel.empty': '暂无会话',\n 'panel.noMatches': '无匹配会话',\n 'panel.search.placeholder': '搜索标题或 ID…',\n 'panel.search.aria': '搜索会话',\n 'panel.close': '关闭',\n 'panel.copy': '复制',\n 'panel.copied': '已复制',\n 'panel.copyFailed': '复制失败,请重试',\n 'panel.current': '当前',\n 'panel.updatedAt': '更新于 {t}',\n 'panel.time.now': '刚刚',\n 'panel.time.minutes': '{n} 分钟前',\n 'panel.time.hours': '{n} 小时前',\n 'panel.time.days': '{n} 天前',\n}\n\n/** The session-id namespace key union. */\nexport type SessionIdKey = keyof typeof zh\n\n/** English dictionary, key-for-key complete against zh. */\nexport const en: Record<SessionIdKey, string> = {\n 'entry.label': 'Session ID',\n 'panel.title': 'Session IDs',\n 'panel.empty': 'No sessions',\n 'panel.noMatches': 'No matching sessions',\n 'panel.search.placeholder': 'Search title or ID…',\n 'panel.search.aria': 'Search sessions',\n 'panel.close': 'Close',\n 'panel.copy': 'Copy',\n 'panel.copied': 'Copied',\n 'panel.copyFailed': 'Copy failed, retry',\n 'panel.current': 'Current',\n 'panel.updatedAt': 'Updated {t}',\n 'panel.time.now': 'just now',\n 'panel.time.minutes': '{n}m ago',\n 'panel.time.hours': '{n}h ago',\n 'panel.time.days': '{n}d ago',\n}","// Generated by scripts/sync-shared.mjs from shared/client/telemetry.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Anonymous install telemetry shared by the DSH Web UI family plugins.\n *\n * Once per UTC day per browser, each wired plugin sends one heartbeat to\n * the dsh-market edge API listing its package name (and version when known).\n * The payload carries no conversation data and no identifiers beyond a random\n * UUID generated in localStorage; the server hashes it with a deployment salt\n * before storage and never persists IP addresses. Sends are fire-and-forget:\n * failures stay silent and simply retry on a later mount or day. Frames where\n * storage is unavailable report nothing.\n *\n * The family-wide opt-out and the browser's Do Not Track signal both suppress\n * the heartbeat; the Web Plugins settings switch writes the same localStorage\n * key. The system is documented in docs/telemetry.md.\n */\n\nexport type TelemetryChannel = 'market' | 'npm' | 'unknown'\n\nexport interface TelemetryItem {\n /** npm package name or asset id, e.g. \"@linxin666/dsh-pet\" or \"skin:harbor\". */\n name: string\n /** Installed version when known; omitted otherwise. */\n version?: string\n /** Install channel when determinable (market = Workshop install). */\n channel?: TelemetryChannel\n}\n\n/** localStorage key carrying the family-wide telemetry opt-out ('1' = off). */\nexport const TELEMETRY_OPT_OUT_KEY = 'dsh-web-ui-telemetry-opt-out'\n\nconst VISITOR_KEY = 'dsh-web-ui-telemetry-visitor'\nconst DAY_KEY_PREFIX = 'dsh-web-ui-telemetry-day:'\nconst ENDPOINT = 'https://dsh-market.com/api/telemetry/event'\n\n// Baked into each client bundle by shared/tsdown.client.ts (the package's own\n// package.json version at build time). Undefined in dev/test builds.\ndeclare const __DSH_PKG_VERSION__: string | undefined\n\n/** The building package's version, when the bundle carries it. */\nfunction bakedVersion(): string | undefined {\n try {\n return typeof __DSH_PKG_VERSION__ === 'string' && __DSH_PKG_VERSION__ !== ''\n ? __DSH_PKG_VERSION__\n : undefined\n } catch {\n return undefined\n }\n}\n\n/** Whether the user switched the family-wide opt-out on (reads storage only). */\nexport function isTelemetryOptedOut(): boolean {\n try {\n return localStorage.getItem(TELEMETRY_OPT_OUT_KEY) === '1'\n } catch {\n // Storage unavailable: there is no stored opt-out to honour.\n return false\n }\n}\n\n/** Turn the family-wide opt-out on or off (writing '1' / removing the key); never throws. */\nexport function setTelemetryOptedOut(optedOut: boolean): void {\n try {\n if (optedOut) localStorage.setItem(TELEMETRY_OPT_OUT_KEY, '1')\n else localStorage.removeItem(TELEMETRY_OPT_OUT_KEY)\n } catch {\n // Storage unavailable: the preference cannot be persisted on this machine.\n }\n}\n\n/** Whether the browser itself asks not to be tracked; a failed read means no signal. */\nfunction doNotTrackRequested(): boolean {\n try {\n // '1' per the DNT header spec, 'yes' from older Firefox builds.\n return navigator.doNotTrack === '1' || navigator.doNotTrack === 'yes'\n } catch {\n return false\n }\n}\n\n/** Whether a heartbeat must be suppressed right now: opt-out stored, or the browser asks not to be tracked. */\nexport function isTelemetrySuppressed(): boolean {\n return isTelemetryOptedOut() || doNotTrackRequested()\n}\n\n/** Read or lazily create the anonymous visitor id; null when storage is unavailable. */\nfunction visitorId(): string | null {\n try {\n const existing = localStorage.getItem(VISITOR_KEY)\n if (existing && /^[A-Za-z0-9_-]{16,64}$/.test(existing)) return existing\n const fresh = crypto.randomUUID().replaceAll('-', '')\n localStorage.setItem(VISITOR_KEY, fresh)\n return fresh\n } catch {\n // Storage unavailable (privacy mode, sandboxed frame): report nothing.\n return null\n }\n}\n\n/** Drop stale per-day dedup keys so localStorage does not grow forever. */\nfunction pruneDayKeys(today: string): void {\n try {\n for (let index = localStorage.length - 1; index >= 0; index -= 1) {\n const key = localStorage.key(index)\n if (key !== null && key.startsWith(DAY_KEY_PREFIX) && key !== DAY_KEY_PREFIX + today) {\n localStorage.removeItem(key)\n }\n }\n } catch { /* best effort */ }\n}\n\n/**\n * Fire the daily heartbeat for the given items at most once per UTC day per\n * browser. Never throws and never blocks the caller. Items without an explicit\n * version inherit the bundle's baked build version.\n */\nexport function reportDailyHeartbeat(items: readonly TelemetryItem[]): void {\n try {\n // First guard: a stored opt-out or the browser's Do Not Track stops every\n // read below from minting an id, marking the day, or reaching the network.\n if (isTelemetrySuppressed()) return\n if (items.length === 0) return\n const today = new Date().toISOString().slice(0, 10)\n // Automation contexts (CDP-driven QA browsers, fresh isolated profiles)\n // mint a new visitor id per run and would inflate instance counts.\n if (navigator.webdriver) return\n if (localStorage.getItem(DAY_KEY_PREFIX + today) !== null) return\n const visitor = visitorId()\n if (visitor === null) return\n pruneDayKeys(today)\n const payloadItems = items.map((item) => {\n const out: Record<string, string> = { name: item.name }\n const version = item.version ?? bakedVersion()\n if (version !== undefined) out.version = version\n if (item.channel !== undefined) out.channel = item.channel\n return out\n })\n const body = JSON.stringify({ kind: 'heartbeat', visitor, items: payloadItems })\n void fetch(ENDPOINT, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body,\n keepalive: true,\n }).then((response) => {\n // Mark the day only after an accepted send, so offline browsers retry\n // on a later mount instead of going dark until tomorrow.\n if (response.ok) localStorage.setItem(DAY_KEY_PREFIX + today, '1')\n }).catch(() => { /* unreachable endpoint: stay silent */ })\n } catch { /* never break the host UI over telemetry */ }\n}\n","/**\n * Session-id plugin — browser half. Registers the `session-id` dictionaries\n * and the sidebar-foot trigger (into the ui-sidebar-declared\n * `sidebar.footer.action` list slot) that opens the session-id panel. The\n * panel lists every session with its full id and a copy button.\n *\n * Export discipline (packages/AGENTS.md): the /client surface carries only\n * what cordis loading needs plus types.\n */\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\n// Type-only: pulls the locale plugin's Context merge (ctx.locale) and its\n// LocaleNamespaceMap merge table.\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the ui-sidebar SlotMap merge (the 'sidebar.footer.action' hole).\nimport type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'\nimport { SessionIdEntry } from './SessionIdEntry.tsx'\nimport { en, zh, type SessionIdKey } from './locales.ts'\nimport { reportDailyHeartbeat } from './telemetry.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Session-id surface copy. */\n 'session-id': SessionIdKey\n }\n}\n\n/** Dictionary namespace owned by this plugin. */\nconst NS = 'session-id'\n\n/** Unique occupant id inside the shared footer.action list slot. */\nconst ENTRY_ID = 'session-id'\n\n/** Services required by this plugin. */\nexport const inject = ['slots', 'locale', 'sessions']\n\n/**\n * Register the session-id surface.\n * @param ctx - client root context.\n */\nexport function apply(ctx: ClientContext): void {\n // Anonymous install heartbeat (docs/telemetry.md): one beat per browser per\n // UTC day, package name only, silent failure.\n reportDailyHeartbeat([{ name: '@linxin666/dsh-client-ui-session-id' }])\n\n ctx.effect(() => {\n try {\n return ctx.locale.register(NS, { zh, en })\n } catch {\n return () => {}\n }\n }, 'session-id: dictionaries')\n\n // Sidebar foot entry. The shell declares 'sidebar.footer.action' (list kind:\n // multiple occupants may share the seat); registration is declaration-aware\n // via slots.inject. The list read face (ctx.sessions.list) is injected as a\n // plain prop so the component can subscribe without per-session wiring.\n ctx.slots.inject('sidebar.footer.action', () => {\n // Read the browser sessions face explicitly (combined host/client program\n // shares the Cordis Context name; the explicit face keeps types correct).\n const sessions = ctx.get('sessions') as unknown as ISessions\n const list = {\n getSnapshot: () => sessions.list.getSnapshot(),\n subscribe: (fn: () => void) => sessions.list.subscribe(fn),\n }\n try {\n return ctx.slots.register({\n name: 'sidebar.footer.action',\n id: ENTRY_ID,\n locale: NS,\n inject: () => ({ list }),\n }, SessionIdEntry)\n } catch {\n return () => {}\n }\n })\n}\n\nexport type { SessionIdEntryProps } from './SessionIdEntry.tsx'\nexport type { SessionIdKey } from './locales.ts'\nexport type { SessionListReadSource, SessionIdPanelProps } from './SessionIdPanel.tsx'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAkCA,SAAgB,kBACd,MACgB;GAChB,IAAI,SAAS,KAAA,KAAa,SAAS,MAAM,OAAO,KAAA;GAChD,KAAK,MAAM,OAAO,OAAO,OAAyC,IAAI,GACpE,IAAI,QAAQ,KAAA,MAAc,IAAI,YAAY,YAAY,KAAK,GAAG,OAAO,IAAI;EAG7E;;;;ECnCA,SAAS,UAAU,OAAyD;GAC1E,OAAO;IACL,OAAO;IACP,QAAQ;IACR,SAAS;IACT,MAAM;IACN,QAAQ;IACR,aAAa;IACb,eAAe;IACf,gBAAgB;IAChB,eAAe;IACf,GAAG;GACL;EACF;;EAGA,SAAgB,cAAc,OAAgC;GAC5D,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;IAAK,GAAI,UAAU,KAAK;cAAxB,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;KAAM,GAAE;KAAM,GAAE;KAAM,OAAM;KAAK,QAAO;KAAI,IAAG;IAAO,CAAA,GACtD,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAM,GAAE,uCAAwC,CAAA,CAC7C;;EAET;;EAGA,SAAgB,SAAS,OAAgC;GACvD,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;IAAK,GAAI,UAAU,KAAK;cAAxB,CACE,i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AI,SAAS,IAAI,aAAa,QAAQ,iBAAiB,OAAO,GAAG;IACnE,CAAC,CAAC,CAAC,YAAY,CAA0C,CAAC;GAC5D,QAAQ,CAA+C;EACzD;;;;ECxHA,MAAM,KAAK;;EAGX,MAAM,WAAW;;EAGjB,MAAa,SAAS;GAAC;GAAS;GAAU;EAAU;;;;;EAMpD,SAAgB,MAAM,KAA0B;GAG9C,qBAAqB,CAAC,EAAE,MAAM,sCAAsC,CAAC,CAAC;GAEtE,IAAI,aAAa;IACf,IAAI;KACF,OAAO,IAAI,OAAO,SAAS,IAAI;MAAE;MAAI;KAAG,CAAC;IAC3C,QAAQ;KACN,aAAa,CAAC;IAChB;GACF,GAAG,0BAA0B;GAM7B,IAAI,MAAM,OAAO,+BAA+B;IAG9C,MAAM,WAAW,IAAI,IAAI,UAAU;IACnC,MAAM,OAAO;KACX,mBAAmB,SAAS,KAAK,YAAY;KAC7C,YAAY,OAAmB,SAAS,KAAK,UAAU,EAAE;IAC3D;IACA,IAAI;KACF,OAAO,IAAI,MAAM,SAAS;MACxB,MAAM;MACN,IAAI;MACJ,QAAQ;MACR,eAAe,EAAE,KAAK;KACxB,GAAG,cAAc;IACnB,QAAQ;KACN,aAAa,CAAC;IAChB;GACF,CAAC;EACH"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["css","css","writeClipboard","css"],"sources":["../../../packages/dsh-session-id/src/client/main-session.ts","../../../packages/dsh-session-id/src/client/icons.tsx","../../../packages/dsh-session-id/src/client/semantic.ts","../../../packages/dsh-session-id/src/client/SessionIdPanel.tsx","../../../packages/dsh-session-id/src/client/SessionIdEntry.tsx","../../../packages/dsh-session-id/src/client/SessionIdEnvironmentRow.tsx","../../../packages/dsh-session-id/src/client/locales.ts","../../../packages/dsh-session-id/src/client/telemetry.ts","../../../packages/dsh-session-id/src/client/index.ts"],"sourcesContent":["// Generated by scripts/sync-shared.mjs from shared/client/main-session.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Main-view Session derivation for the multi-instance Client Session model.\n *\n * The Client Session Controller carries no global \"current\" selection: view\n * selection belongs to the workspace UI, which owns the main-area reference and\n * publishes it through the catalog's per-source ownership counts\n * (`SessionSummary.retainedBy.mainView`). A plugin that needs the Session the\n * main view shows derives it from that marker instead of the removed\n * `SessionListState.current` field.\n *\n * The marker describes view ownership, not authority. It is the right input for\n * presentation and for deciding which view a navigation targets; it is not a\n * business fallback, because source counts never imply visibility or success.\n * @module dsh-web/shared/main-session\n */\n\n/** The catalog row subset this helper reads (a `SessionSummary` projection). */\nexport interface MainViewOwnedRow<Id extends string = string> {\n /** Catalog row identity. */\n readonly id: Id\n /** Per-source local ownership counts; absent rows are never owned. */\n readonly retainedBy?: Readonly<Partial<Record<string, number>>> | undefined\n}\n\n/**\n * Resolve the Session the main view currently shows.\n *\n * Reads the catalog's rows rather than a per-id retain-info source: ownership\n * counts ride the list snapshot, so this neither allocates observers nor opens\n * history, and a subscription to the list still fires when the selection moves.\n * @param byId - the session catalog's rows (`SessionListState.byId`), when available.\n * @returns the main-view session id, or undefined when the main view shows none.\n */\nexport function mainViewSessionId<Id extends string>(\n byId: Readonly<Record<Id, MainViewOwnedRow<Id> | undefined>> | undefined | null,\n): Id | undefined {\n if (byId === undefined || byId === null) return undefined\n for (const row of Object.values<MainViewOwnedRow<Id> | undefined>(byId)) {\n if (row !== undefined && (row.retainedBy?.mainView ?? 0) > 0) return row.id\n }\n return undefined\n}\n","/**\n * Inline SVG icons for the session-id plugin (16px stroke style matching the\n * shell's nav icons; sized via className where a smaller variant is needed).\n */\nimport type { SVGProps } from 'react'\n\n/** Shared svg attrs for the 16px stroke icon family. */\nfunction iconProps(props: SVGProps<SVGSVGElement>): SVGProps<SVGSVGElement> {\n return {\n width: 16,\n height: 16,\n viewBox: '0 0 16 16',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 1.3,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n 'aria-hidden': true,\n ...props,\n }\n}\n\n/** An ID-card / identifier glyph for the seat trigger and panel title. */\nexport function SessionIdIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg {...iconProps(props)}>\n <rect x=\"1.5\" y=\"3.5\" width=\"13\" height=\"9\" rx=\"1.5\" />\n <path d=\"M4 6.5h2M4 9h2M7.5 6.5h4.5M7.5 9h4.5\" />\n </svg>\n )\n}\n\n/** Copy glyph. */\nexport function CopyIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg {...iconProps(props)}>\n <rect x=\"5.5\" y=\"5.5\" width=\"9\" height=\"9\" rx=\"1.5\" />\n <path d=\"M2.5 10.5v-7A1.5 1.5 0 0 1 4 2h5.5\" />\n </svg>\n )\n}\n\n/** Check glyph for the transient copied state. */\nexport function CheckIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg {...iconProps(props)}>\n <path d=\"M3 8.5 6.5 12l6.5-8\" />\n </svg>\n )\n}\n\n/** Close glyph for the panel header. */\nexport function CloseIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg {...iconProps(props)}>\n <path d=\"M4 4l8 8M12 4l-8 8\" />\n </svg>\n )\n}\n","/**\n * Semantic attribute values for the session-id plugin (contract:\n * skins/skin-center/contracts/semantic-attrs-v1.md). Root containers carry\n * `data-dsh-plugin`; parts carry bare `data-dsh-part` values owned by the\n * plugin attribute.\n */\n\n/** Plugin short name stamped on the root container and the footer trigger. */\nexport const SESSION_ID_PLUGIN_ATTR = 'session-id'\n\n/** The sidebar footer seat trigger. */\nexport const SESSION_ID_PART_ENTRY = 'entry'\n\n/** The modal panel root. */\nexport const SESSION_ID_PART_PANEL = 'panel'\n\n/** One session list row. */\nexport const SESSION_ID_PART_ROW = 'row'\n\n/** The per-row copy button. */\nexport const SESSION_ID_PART_COPY = 'copy'\n\n/** The panel search input. */\nexport const SESSION_ID_PART_SEARCH = 'search'\n\n/** The official session-panel environment row for the active session. */\nexport const SESSION_ID_PART_ENV_ROW = 'environment-row'","/**\n * Session ID panel — a centered modal listing every session with its full id\n * and a copy button. Data rides the injected `sessionList` observable\n * (ctx.sessions.list, see SessionRuntime.list) read through\n * useSyncExternalStore, so the panel stays in sync with host list updates and\n * needs no per-session runtime wiring.\n */\nimport { useEffect, useRef, useSyncExternalStore, useState } from 'react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'\nimport type { SessionListState, SessionSummary } from '@deepseek-ai/dsh-api-session-controller/client'\nimport { writeClipboard } from '@deepseek-ai/dsh-client-ui-primitives/client'\nimport { mainViewSessionId } from './main-session.ts'\nimport { CheckIcon, CopyIcon, CloseIcon } from './icons.tsx'\nimport { SESSION_ID_PART_COPY, SESSION_ID_PART_PANEL, SESSION_ID_PART_ROW, SESSION_ID_PART_SEARCH, SESSION_ID_PLUGIN_ATTR } from './semantic.ts'\nimport css from './session-id.module.css'\n\n/** The sessions-list read face injected by the plugin (ObservableSnapshot). */\nexport type SessionListReadSource = {\n getSnapshot(): SessionListState\n subscribe(fn: () => void): () => void\n}\n\n/** Panel props: the list source + the locale seat. */\nexport type SessionIdPanelProps = PropsLocale<'session-id'> & {\n list: SessionListReadSource\n onClose: () => void\n}\n\n/** Sort sessions by update time, newest first; blank rows sink to the bottom. */\nfunction sortSessions(list: SessionListState): SessionSummary[] {\n const rows = list.ids\n .map(id => list.byId[id])\n .filter((row): row is SessionSummary => row !== undefined)\n return [...rows].sort((a, b) => {\n if (a.blank !== b.blank) return a.blank ? 1 : -1\n return b.updatedAt - a.updatedAt\n })\n}\n\n/** One session row: title + id + copy button with transient \"copied\" / failed state. */\nfunction SessionRow({ session, current, t }: {\n session: SessionSummary\n current: string | undefined\n t: PropsLocale<'session-id'>['t']\n}) {\n const [status, setStatus] = useState<'idle' | 'copied' | 'failed'>('idle')\n const idleTimer = useRef<number | undefined>(undefined)\n const active = session.id === current\n const title = session.displayTitle || session.id\n\n // A pending reset timer belongs to the previous copy; drop it when the row\n // leaves the DOM so nothing keeps running after unmount.\n useEffect(() => {\n return () => { window.clearTimeout(idleTimer.current) }\n }, [])\n\n const handleCopy = (): void => {\n // Clear the previous reset before a new write so rapid repeated clicks\n // never stack timers (only the latest copy reaches the idle reset).\n window.clearTimeout(idleTimer.current)\n // Copy must be gesture-driven; a failed write surfaces an actionable\n // message instead of silently swallowing the error (no permission\n // requests, no background retry).\n void writeClipboard(session.id).then((ok) => {\n if (ok) {\n setStatus('copied')\n idleTimer.current = window.setTimeout(() => { setStatus('idle') }, 1200)\n } else {\n setStatus('failed')\n }\n }).catch(() => {\n // A rejected write is the same actionable failure as ok === false.\n setStatus('failed')\n })\n }\n\n const copyLabel = status === 'copied' ? t('panel.copied')\n : status === 'failed' ? t('panel.copyFailed') : t('panel.copy')\n\n return (\n <div className={css.row} data-dsh-part={SESSION_ID_PART_ROW}>\n <span className={css.rowInfo}>\n <span className={`${css.rowTitle}${active ? ` ${css.rowActive}` : ''}`} title={title}>\n {title}\n </span>\n {active && <span className={css.rowMeta}>{t('panel.current')}</span>}\n <span className={css.rowId} title={session.id}>{session.id}</span>\n </span>\n <button\n type=\"button\"\n className={css.copyButton}\n data-dsh-part={SESSION_ID_PART_COPY}\n data-copied={status === 'copied' ? 'true' : undefined}\n data-failed={status === 'failed' ? 'true' : undefined}\n aria-label={`${copyLabel} ${session.id}`}\n onClick={handleCopy}\n >\n {status === 'copied' ? <CheckIcon className={css.iconSmall} /> : <CopyIcon className={css.iconSmall} />}\n {copyLabel}\n </button>\n </div>\n )\n}\n\n/**\n * Render the session-id panel body.\n * @param props - injected list source + locale seat + close callback.\n * @returns the modal panel.\n */\nexport function SessionIdPanel({ list, onClose, t }: SessionIdPanelProps) {\n const snapshot = useSyncExternalStore(list.subscribe, list.getSnapshot)\n const sorted = sortSessions(snapshot)\n // The catalog carries no global selection since 0.1.6-alpha.2; the Session the\n // main view owns is the one to mark as current.\n const currentId = mainViewSessionId(snapshot.byId)\n const [search, setSearch] = useState('')\n\n // Local, read-only filter over the already-visible list (title or id\n // substring, case-insensitive) — no host API, no disk, no other profile.\n const query = search.trim().toLowerCase()\n const rows = query === ''\n ? sorted\n : sorted.filter(row => row.displayTitle.toLowerCase().includes(query) || row.id.toLowerCase().includes(query))\n\n return (\n <div className={css.overlay} role=\"presentation\" data-dsh-plugin={SESSION_ID_PLUGIN_ATTR}>\n <div className={css.mask} aria-hidden=\"true\" onClick={onClose} />\n <div className={css.panel} data-dsh-part={SESSION_ID_PART_PANEL} role=\"dialog\" aria-modal=\"true\" aria-label={t('panel.title')}>\n <div className={css.header}>\n <div className={css.heading}>\n <h2 className={css.title}>{t('panel.title')}</h2>\n </div>\n <button\n type=\"button\"\n className={css.closeButton}\n aria-label={t('panel.close')}\n onClick={onClose}\n >\n <CloseIcon className={css.icon} />\n </button>\n </div>\n <input\n type=\"search\"\n className={css.search}\n data-dsh-part={SESSION_ID_PART_SEARCH}\n placeholder={t('panel.search.placeholder')}\n aria-label={t('panel.search.aria')}\n value={search}\n onChange={(event) => { setSearch(event.target.value) }}\n />\n {rows.length === 0 ? (\n <div className={css.empty}>{query === '' ? t('panel.empty') : t('panel.noMatches')}</div>\n ) : (\n <div className={css.list}>\n {rows.map(row => (\n <SessionRow key={row.id} session={row} current={currentId} t={t} />\n ))}\n </div>\n )}\n </div>\n </div>\n )\n}\n","/**\n * Sidebar footer entry for the session-id plugin: the icon-only trigger\n * beside the sidebar settings seat (wide row / rail circle) that opens the\n * session-id panel. Registered into the official `sidebar.footer.action`\n * list slot (declared by ui-sidebar, same seat dsh-remote-web-ui shares).\n */\nimport { useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client'\nimport { SessionIdPanel, type SessionListReadSource } from './SessionIdPanel.tsx'\nimport { SESSION_ID_PART_ENTRY, SESSION_ID_PLUGIN_ATTR } from './semantic.ts'\nimport { SessionIdIcon } from './icons.tsx'\nimport css from './session-id.module.css'\n\n/** Entry props: the footer seat's column state + injected list source + locale seat. */\nexport type SessionIdEntryProps = PropsLocale<'session-id'> & {\n /** Whether the sidebar renders wide content (false = 56px rail). */\n wide: boolean\n /** The sessions-list read face (ctx.sessions.list wrapped by the plugin). */\n list: SessionListReadSource\n}\n\n/**\n * Render the session-id seat trigger and panel.\n * @param props - composed slot props.\n * @returns the trigger and, when open, the panel portal.\n */\nexport function SessionIdEntry({ wide, list, t }: SessionIdEntryProps) {\n const [open, setOpen] = useState(false)\n\n const trigger = (\n <button\n type=\"button\"\n className={css.trigger}\n data-dsh-plugin={SESSION_ID_PLUGIN_ATTR}\n data-dsh-part={SESSION_ID_PART_ENTRY}\n data-wide={wide ? 'wide' : 'rail'}\n aria-label={t('entry.label')}\n title={t('entry.label')}\n onClick={() => { setOpen(true) }}\n >\n <SessionIdIcon />\n </button>\n )\n\n return (\n <>\n {trigger}\n {open && createPortal(\n <SessionIdPanel list={list} onClose={() => { setOpen(false) }} t={t} />,\n document.body,\n )}\n </>\n )\n}\n","/**\n * Official `conversation.session.panel.environment.row` entry: shows the\n * active session's id inside the official Session Panel's Environment section\n * with one-click copy, matching the panel's `data-session-panel-row` markup.\n * @module @linxin666/dsh-client-ui-session-id/client/SessionIdEnvironmentRow\n */\nimport { useEffect, useRef, useState } from 'react'\nimport type {} from '@deepseek-ai/dsh-client-ui-session-panel/client'\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots/client'\nimport { writeClipboard } from '@deepseek-ai/dsh-client-ui-primitives/client'\nimport { CheckIcon, CopyIcon, SessionIdIcon } from './icons.tsx'\nimport { SESSION_ID_PART_COPY, SESSION_ID_PART_ENV_ROW, SESSION_ID_PLUGIN_ATTR } from './semantic.ts'\nimport css from './session-id.module.css'\n\nexport type SessionIdEnvironmentRowProps =\n & Partial<PropsRuntime<'conversation.session.panel.environment.row'>>\n & PropsLocale<'session-id'>\n & {\n /** Active session id supplied by the session-scoped slot runtime. */\n sessionId: string\n /** Clipboard writer override (defaults to official `writeClipboard`). */\n copy?: (text: string) => Promise<boolean>\n }\n\n/**\n * Render the active session's id as a native row inside the Session Panel's\n * Environment section.\n */\nexport function SessionIdEnvironmentRow({\n sessionId,\n t,\n copy = writeClipboard,\n}: SessionIdEnvironmentRowProps) {\n const [status, setStatus] = useState<'idle' | 'copied' | 'failed'>('idle')\n const idleTimer = useRef<number | undefined>(undefined)\n\n useEffect(() => {\n setStatus('idle')\n return () => { window.clearTimeout(idleTimer.current) }\n }, [sessionId])\n\n if (!sessionId) return null\n\n const handleCopy = (): void => {\n window.clearTimeout(idleTimer.current)\n void copy(sessionId).then((ok) => {\n if (ok) {\n setStatus('copied')\n idleTimer.current = window.setTimeout(() => { setStatus('idle') }, 1200)\n } else {\n setStatus('failed')\n }\n }).catch(() => {\n setStatus('failed')\n })\n }\n\n const copyLabel = status === 'copied'\n ? t('panel.copied')\n : status === 'failed'\n ? t('panel.copyFailed')\n : t('panel.copy')\n\n return (\n <div\n data-session-panel-row=\"\"\n data-dsh-plugin={SESSION_ID_PLUGIN_ATTR}\n data-dsh-part={SESSION_ID_PART_ENV_ROW}\n data-session-id={sessionId}\n >\n <span data-row-part=\"body\">\n <span data-row-part=\"icon\" aria-hidden=\"true\"><SessionIdIcon /></span>\n <span data-row-part=\"content\" className={css.envContent} title={`${t('entry.label')}: ${sessionId}`}>\n <span className={css.envValue}>{sessionId}</span>\n </span>\n </span>\n <span data-row-part=\"menu\">\n <button\n type=\"button\"\n className={css.envCopyButton}\n data-dsh-part={SESSION_ID_PART_COPY}\n data-copied={status === 'copied' ? 'true' : undefined}\n data-failed={status === 'failed' ? 'true' : undefined}\n aria-label={`${copyLabel} ${sessionId}`}\n title={copyLabel}\n onClick={handleCopy}\n >\n {status === 'copied' ? <CheckIcon /> : <CopyIcon />}\n </button>\n </span>\n </div>\n )\n}\n","/**\n * Locale dictionaries for the session-id plugin. `zh` is the key-set source of\n * truth; `en` keeps a full key-for-key mirror (packages/AGENTS.md bilingual\n * rules). Registered through ctx.locale.register(NS, { zh, en }).\n */\n\n/** Simplified Chinese dictionary (key-set source of truth). */\nexport const zh = {\n 'entry.label': '会话 ID',\n 'panel.title': '会话 ID',\n 'panel.empty': '暂无会话',\n 'panel.noMatches': '无匹配会话',\n 'panel.search.placeholder': '搜索标题或 ID…',\n 'panel.search.aria': '搜索会话',\n 'panel.close': '关闭',\n 'panel.copy': '复制',\n 'panel.copied': '已复制',\n 'panel.copyFailed': '复制失败,请重试',\n 'panel.current': '当前',\n 'panel.updatedAt': '更新于 {t}',\n 'panel.time.now': '刚刚',\n 'panel.time.minutes': '{n} 分钟前',\n 'panel.time.hours': '{n} 小时前',\n 'panel.time.days': '{n} 天前',\n}\n\n/** The session-id namespace key union. */\nexport type SessionIdKey = keyof typeof zh\n\n/** English dictionary, key-for-key complete against zh. */\nexport const en: Record<SessionIdKey, string> = {\n 'entry.label': 'Session ID',\n 'panel.title': 'Session IDs',\n 'panel.empty': 'No sessions',\n 'panel.noMatches': 'No matching sessions',\n 'panel.search.placeholder': 'Search title or ID…',\n 'panel.search.aria': 'Search sessions',\n 'panel.close': 'Close',\n 'panel.copy': 'Copy',\n 'panel.copied': 'Copied',\n 'panel.copyFailed': 'Copy failed, retry',\n 'panel.current': 'Current',\n 'panel.updatedAt': 'Updated {t}',\n 'panel.time.now': 'just now',\n 'panel.time.minutes': '{n}m ago',\n 'panel.time.hours': '{n}h ago',\n 'panel.time.days': '{n}d ago',\n}","// Generated by scripts/sync-shared.mjs from shared/client/telemetry.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Anonymous install telemetry shared by the DSH Web UI family plugins.\n *\n * Once per UTC day per browser, each wired plugin sends one heartbeat to\n * the dsh-market edge API listing its package name (and version when known).\n * The payload carries no conversation data and no identifiers beyond a random\n * UUID generated in localStorage; the server hashes it with a deployment salt\n * before storage and never persists IP addresses. Sends are fire-and-forget:\n * failures stay silent and simply retry on a later mount or day. Frames where\n * storage is unavailable report nothing.\n *\n * The family-wide opt-out and the browser's Do Not Track signal both suppress\n * the heartbeat; the Web Plugins settings switch writes the same localStorage\n * key. The system is documented in docs/telemetry.md.\n */\n\nexport type TelemetryChannel = 'market' | 'npm' | 'unknown'\n\nexport interface TelemetryItem {\n /** npm package name or asset id, e.g. \"@linxin666/dsh-pet\" or \"skin:harbor\". */\n name: string\n /** Installed version when known; omitted otherwise. */\n version?: string\n /** Install channel when determinable (market = Workshop install). */\n channel?: TelemetryChannel\n}\n\n/** localStorage key carrying the family-wide telemetry opt-out ('1' = off). */\nexport const TELEMETRY_OPT_OUT_KEY = 'dsh-web-ui-telemetry-opt-out'\n\nconst VISITOR_KEY = 'dsh-web-ui-telemetry-visitor'\nconst DAY_KEY_PREFIX = 'dsh-web-ui-telemetry-day:'\nconst ENDPOINT = 'https://dsh-market.com/api/telemetry/event'\n\n// Baked into each client bundle by shared/tsdown.client.ts (the package's own\n// package.json version at build time). Undefined in dev/test builds.\ndeclare const __DSH_PKG_VERSION__: string | undefined\n\n/** The building package's version, when the bundle carries it. */\nfunction bakedVersion(): string | undefined {\n try {\n return typeof __DSH_PKG_VERSION__ === 'string' && __DSH_PKG_VERSION__ !== ''\n ? __DSH_PKG_VERSION__\n : undefined\n } catch {\n return undefined\n }\n}\n\n/** Whether the user switched the family-wide opt-out on (reads storage only). */\nexport function isTelemetryOptedOut(): boolean {\n try {\n return localStorage.getItem(TELEMETRY_OPT_OUT_KEY) === '1'\n } catch {\n // Storage unavailable: there is no stored opt-out to honour.\n return false\n }\n}\n\n/** Turn the family-wide opt-out on or off (writing '1' / removing the key); never throws. */\nexport function setTelemetryOptedOut(optedOut: boolean): void {\n try {\n if (optedOut) localStorage.setItem(TELEMETRY_OPT_OUT_KEY, '1')\n else localStorage.removeItem(TELEMETRY_OPT_OUT_KEY)\n } catch {\n // Storage unavailable: the preference cannot be persisted on this machine.\n }\n}\n\n/** Whether the browser itself asks not to be tracked; a failed read means no signal. */\nfunction doNotTrackRequested(): boolean {\n try {\n // '1' per the DNT header spec, 'yes' from older Firefox builds.\n return navigator.doNotTrack === '1' || navigator.doNotTrack === 'yes'\n } catch {\n return false\n }\n}\n\n/** Whether a heartbeat must be suppressed right now: opt-out stored, or the browser asks not to be tracked. */\nexport function isTelemetrySuppressed(): boolean {\n return isTelemetryOptedOut() || doNotTrackRequested()\n}\n\n/** Read or lazily create the anonymous visitor id; null when storage is unavailable. */\nfunction visitorId(): string | null {\n try {\n const existing = localStorage.getItem(VISITOR_KEY)\n if (existing && /^[A-Za-z0-9_-]{16,64}$/.test(existing)) return existing\n const fresh = crypto.randomUUID().replaceAll('-', '')\n localStorage.setItem(VISITOR_KEY, fresh)\n return fresh\n } catch {\n // Storage unavailable (privacy mode, sandboxed frame): report nothing.\n return null\n }\n}\n\n/** Drop stale per-day dedup keys so localStorage does not grow forever. */\nfunction pruneDayKeys(today: string): void {\n try {\n for (let index = localStorage.length - 1; index >= 0; index -= 1) {\n const key = localStorage.key(index)\n if (key !== null && key.startsWith(DAY_KEY_PREFIX) && key !== DAY_KEY_PREFIX + today) {\n localStorage.removeItem(key)\n }\n }\n } catch { /* best effort */ }\n}\n\n/**\n * Fire the daily heartbeat for the given items at most once per UTC day per\n * browser. Never throws and never blocks the caller. Items without an explicit\n * version inherit the bundle's baked build version.\n */\nexport function reportDailyHeartbeat(items: readonly TelemetryItem[]): void {\n try {\n // First guard: a stored opt-out or the browser's Do Not Track stops every\n // read below from minting an id, marking the day, or reaching the network.\n if (isTelemetrySuppressed()) return\n if (items.length === 0) return\n const today = new Date().toISOString().slice(0, 10)\n // Automation contexts (CDP-driven QA browsers, fresh isolated profiles)\n // mint a new visitor id per run and would inflate instance counts.\n if (navigator.webdriver) return\n if (localStorage.getItem(DAY_KEY_PREFIX + today) !== null) return\n const visitor = visitorId()\n if (visitor === null) return\n pruneDayKeys(today)\n const payloadItems = items.map((item) => {\n const out: Record<string, string> = { name: item.name }\n const version = item.version ?? bakedVersion()\n if (version !== undefined) out.version = version\n if (item.channel !== undefined) out.channel = item.channel\n return out\n })\n const body = JSON.stringify({ kind: 'heartbeat', visitor, items: payloadItems })\n void fetch(ENDPOINT, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body,\n keepalive: true,\n }).then((response) => {\n // Mark the day only after an accepted send, so offline browsers retry\n // on a later mount instead of going dark until tomorrow.\n if (response.ok) localStorage.setItem(DAY_KEY_PREFIX + today, '1')\n }).catch(() => { /* unreachable endpoint: stay silent */ })\n } catch { /* never break the host UI over telemetry */ }\n}\n","/**\n * Session-id plugin — browser half. Registers the `session-id` dictionaries\n * and the sidebar-foot trigger (into the ui-sidebar-declared\n * `sidebar.footer.action` list slot) that opens the session-id panel. The\n * panel lists every session with its full id and a copy button.\n *\n * Export discipline (packages/AGENTS.md): the /client surface carries only\n * what cordis loading needs plus types.\n */\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\n// Type-only: pulls the locale plugin's Context merge (ctx.locale) and its\n// LocaleNamespaceMap merge table.\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the ui-sidebar SlotMap merge (the 'sidebar.footer.action' hole).\nimport type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'\n// Type-only: pulls the official Session Panel SlotMap merge ('conversation.session.panel.environment.row').\nimport type {} from '@deepseek-ai/dsh-client-ui-session-panel/client'\nimport { SessionIdEntry } from './SessionIdEntry.tsx'\nimport { SessionIdEnvironmentRow } from './SessionIdEnvironmentRow.tsx'\nimport { en, zh, type SessionIdKey } from './locales.ts'\nimport { reportDailyHeartbeat } from './telemetry.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots/client' {\n interface LocaleNamespaceMap {\n /** Session-id surface copy. */\n 'session-id': SessionIdKey\n }\n}\n\n/** Dictionary namespace owned by this plugin. */\nconst NS = 'session-id'\n\n/** Unique occupant id inside the shared footer.action list slot. */\nconst ENTRY_ID = 'session-id'\n\n/** Services required by this plugin. */\nexport const inject = ['slots', 'locale', 'sessions']\n\n/**\n * Register the session-id surface.\n * @param ctx - client root context.\n */\nexport function apply(ctx: ClientContext): void {\n // Anonymous install heartbeat (docs/telemetry.md): one beat per browser per\n // UTC day, package name only, silent failure.\n reportDailyHeartbeat([{ name: '@linxin666/dsh-client-ui-session-id' }])\n\n ctx.effect(() => {\n try {\n return ctx.locale.register(NS, { zh, en })\n } catch {\n return () => {}\n }\n }, 'session-id: dictionaries')\n\n // Sidebar foot entry. The shell declares 'sidebar.footer.action' (list kind:\n // multiple occupants may share the seat); registration is declaration-aware\n // via slots.inject. The list read face (ctx.sessions.list) is injected as a\n // plain prop so the component can subscribe without per-session wiring.\n ctx.slots.inject('sidebar.footer.action', () => {\n // Read the browser sessions face explicitly (combined host/client program\n // shares the Cordis Context name; the explicit face keeps types correct).\n const sessions = ctx.get('sessions') as unknown as ISessions\n const list = {\n getSnapshot: () => sessions.list.getSnapshot(),\n subscribe: (fn: () => void) => sessions.list.subscribe(fn),\n }\n try {\n return ctx.slots.register({\n name: 'sidebar.footer.action',\n id: ENTRY_ID,\n locale: NS,\n inject: () => ({ list }),\n }, SessionIdEntry)\n } catch {\n return () => {}\n }\n })\n // Official Session Panel Environment row (DSH 0.2.3-alpha.2+): expose the\n // active session id with one-click copy right beside the working folder.\n ctx.slots.inject('conversation.session.panel.environment.row', () => {\n try {\n return ctx.slots.register({\n name: 'conversation.session.panel.environment.row',\n id: ENTRY_ID,\n order: 40,\n locale: NS,\n inject: (sessionId) => ({ sessionId }),\n }, SessionIdEnvironmentRow)\n } catch {\n return () => {}\n }\n })\n}\n\nexport type { SessionIdEntryProps } from './SessionIdEntry.tsx'\nexport type { SessionIdEnvironmentRowProps } from './SessionIdEnvironmentRow.tsx'\nexport type { SessionIdKey } from './locales.ts'\nexport type { SessionListReadSource, SessionIdPanelProps } from './SessionIdPanel.tsx'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAkCA,SAAgB,kBACd,MACgB;GAChB,IAAI,SAAS,KAAA,KAAa,SAAS,MAAM,OAAO,KAAA;GAChD,KAAK,MAAM,O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AAiB,OAAO,GAAG;IACnE,CAAC,CAAC,CAAC,YAAY,CAA0C,CAAC;GAC5D,QAAQ,CAA+C;EACzD;;;;ECrHA,MAAM,KAAK;;EAGX,MAAM,WAAW;;EAGjB,MAAa,SAAS;GAAC;GAAS;GAAU;EAAU;;;;;EAMpD,SAAgB,MAAM,KAA0B;GAG9C,qBAAqB,CAAC,EAAE,MAAM,sCAAsC,CAAC,CAAC;GAEtE,IAAI,aAAa;IACf,IAAI;KACF,OAAO,IAAI,OAAO,SAAS,IAAI;MAAE;MAAI;KAAG,CAAC;IAC3C,QAAQ;KACN,aAAa,CAAC;IAChB;GACF,GAAG,0BAA0B;GAM7B,IAAI,MAAM,OAAO,+BAA+B;IAG9C,MAAM,WAAW,IAAI,IAAI,UAAU;IACnC,MAAM,OAAO;KACX,mBAAmB,SAAS,KAAK,YAAY;KAC7C,YAAY,OAAmB,SAAS,KAAK,UAAU,EAAE;IAC3D;IACA,IAAI;KACF,OAAO,IAAI,MAAM,SAAS;MACxB,MAAM;MACN,IAAI;MACJ,QAAQ;MACR,eAAe,EAAE,KAAK;KACxB,GAAG,cAAc;IACnB,QAAQ;KACN,aAAa,CAAC;IAChB;GACF,CAAC;GAGD,IAAI,MAAM,OAAO,oDAAoD;IACnE,IAAI;KACF,OAAO,IAAI,MAAM,SAAS;MACxB,MAAM;MACN,IAAI;MACJ,OAAO;MACP,QAAQ;MACR,SAAS,eAAe,EAAE,UAAU;KACtC,GAAG,uBAAuB;IAC5B,QAAQ;KACN,aAAa,CAAC;IAChB;GACF,CAAC;EACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
1
|
+
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client';
|
|
2
2
|
import { type SessionListReadSource } from './SessionIdPanel.tsx';
|
|
3
3
|
/** Entry props: the footer seat's column state + injected list source + locale seat. */
|
|
4
4
|
export type SessionIdEntryProps = PropsLocale<'session-id'> & {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots/client';
|
|
2
|
+
export type SessionIdEnvironmentRowProps = Partial<PropsRuntime<'conversation.session.panel.environment.row'>> & PropsLocale<'session-id'> & {
|
|
3
|
+
/** Active session id supplied by the session-scoped slot runtime. */
|
|
4
|
+
sessionId: string;
|
|
5
|
+
/** Clipboard writer override (defaults to official `writeClipboard`). */
|
|
6
|
+
copy?: (text: string) => Promise<boolean>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Render the active session's id as a native row inside the Session Panel's
|
|
10
|
+
* Environment section.
|
|
11
|
+
*/
|
|
12
|
+
export declare function SessionIdEnvironmentRow({ sessionId, t, copy, }: SessionIdEnvironmentRowProps): import("react").JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
1
|
+
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots/client';
|
|
2
2
|
import type { SessionListState } from '@deepseek-ai/dsh-api-session-controller/client';
|
|
3
3
|
/** The sessions-list read face injected by the plugin (ObservableSnapshot). */
|
|
4
4
|
export type SessionListReadSource = {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
11
11
|
import { type SessionIdKey } from './locales.ts';
|
|
12
|
-
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
12
|
+
declare module '@deepseek-ai/dsh-client-ui-slots/client' {
|
|
13
13
|
interface LocaleNamespaceMap {
|
|
14
14
|
/** Session-id surface copy. */
|
|
15
15
|
'session-id': SessionIdKey;
|
|
@@ -23,5 +23,6 @@ export declare const inject: string[];
|
|
|
23
23
|
*/
|
|
24
24
|
export declare function apply(ctx: ClientContext): void;
|
|
25
25
|
export type { SessionIdEntryProps } from './SessionIdEntry.tsx';
|
|
26
|
+
export type { SessionIdEnvironmentRowProps } from './SessionIdEnvironmentRow.tsx';
|
|
26
27
|
export type { SessionIdKey } from './locales.ts';
|
|
27
28
|
export type { SessionListReadSource, SessionIdPanelProps } from './SessionIdPanel.tsx';
|
|
@@ -16,3 +16,5 @@ export declare const SESSION_ID_PART_ROW = "row";
|
|
|
16
16
|
export declare const SESSION_ID_PART_COPY = "copy";
|
|
17
17
|
/** The panel search input. */
|
|
18
18
|
export declare const SESSION_ID_PART_SEARCH = "search";
|
|
19
|
+
/** The official session-panel environment row for the active session. */
|
|
20
|
+
export declare const SESSION_ID_PART_ENV_ROW = "environment-row";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linxin666/dsh-client-ui-session-id",
|
|
3
3
|
"description": "DSH web GUI plugin: sidebar-foot Session ID panel listing every session with its full id and one-click copy (browser-only; no source changes).",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.23",
|
|
5
5
|
"icon": "icon.svg",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "lib/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dsh": {
|
|
24
24
|
"engines": {
|
|
25
|
-
"dsh": ">=0.2.3-alpha.
|
|
25
|
+
"dsh": ">=0.2.3-alpha.4"
|
|
26
26
|
},
|
|
27
27
|
"bundle": {
|
|
28
28
|
"patch": "./cordis.patch.yml"
|
|
@@ -36,25 +36,26 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@deepseek-ai/dsh": ">=0.2.3-alpha.
|
|
40
|
-
"react": "^
|
|
39
|
+
"@deepseek-ai/dsh": ">=0.2.3-alpha.4",
|
|
40
|
+
"react": "^19.3.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@deepseek-ai/cordis": "~4.2.0-alpha.
|
|
44
|
-
"@deepseek-ai/dsh-api-remotes": "^0.2.3-alpha.
|
|
45
|
-
"@deepseek-ai/dsh-api-session-controller": "^0.2.3-alpha.
|
|
46
|
-
"@deepseek-ai/dsh-client-locale": "^0.2.3-alpha.
|
|
47
|
-
"@deepseek-ai/dsh-client-ui-primitives": "^0.2.3-alpha.
|
|
48
|
-
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.3-alpha.
|
|
49
|
-
"@deepseek-ai/dsh-client-ui-
|
|
50
|
-
"@deepseek-ai/dsh-client-ui-
|
|
43
|
+
"@deepseek-ai/cordis": "~4.2.0-alpha.3",
|
|
44
|
+
"@deepseek-ai/dsh-api-remotes": "^0.2.3-alpha.4",
|
|
45
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.2.3-alpha.4",
|
|
46
|
+
"@deepseek-ai/dsh-client-locale": "^0.2.3-alpha.4",
|
|
47
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.2.3-alpha.4",
|
|
48
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.3-alpha.4",
|
|
49
|
+
"@deepseek-ai/dsh-client-ui-session-panel": "^0.2.3-alpha.4",
|
|
50
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "^0.2.3-alpha.4",
|
|
51
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.2.3-alpha.4",
|
|
51
52
|
"@testing-library/dom": "^10.4.1",
|
|
52
|
-
"@testing-library/react": "^16.
|
|
53
|
-
"@types/react": "~
|
|
54
|
-
"@types/react-dom": "
|
|
53
|
+
"@testing-library/react": "^16.3.3",
|
|
54
|
+
"@types/react": "~19.3.2",
|
|
55
|
+
"@types/react-dom": "~19.3.0",
|
|
55
56
|
"jsdom": "29.1.1",
|
|
56
|
-
"react": "^
|
|
57
|
-
"react-dom": "^
|
|
57
|
+
"react": "^19.3.1",
|
|
58
|
+
"react-dom": "^19.3.1",
|
|
58
59
|
"tsdown": "0.22.2",
|
|
59
60
|
"typescript": "~5.7.2",
|
|
60
61
|
"vite-tsconfig-paths": "^6.1.1",
|