@michengai/dsh-codex-pet 1.0.1 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/CHANGELOG.zh-CN.md +15 -0
- package/README.md +3 -3
- package/README.zh-CN.md +3 -3
- package/assets/screenshots/pet-settings.png +0 -0
- package/lib/client.js +176 -63
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.0.4] - 2026-10-24
|
|
4
|
+
|
|
5
|
+
- Fix e2e assertions and smoke tests for pseudo-element nav icon.
|
|
6
|
+
|
|
7
|
+
## [1.0.3] - 2026-10-24
|
|
8
|
+
|
|
9
|
+
- Add compatibility with DeepSeek Harness `0.2.1-rc.3` while retaining all existing supported versions.
|
|
10
|
+
|
|
11
|
+
## [1.0.2] - 2026-10-19
|
|
12
|
+
|
|
13
|
+
- Settings navigation draws the pet icon with a skin-safe CSS mask. It covers both the native DSH settings dialog and the dsh-codex-ui settings page without rewriting the host SVG.
|
|
14
|
+
- The pet settings page uses the host Button primitive and host typography, spacing, 0.5px borders, layer tokens, and container queries. The create action is a 22px plus icon next to refresh.
|
|
15
|
+
- The settings dialog follows host modal tokens, and the pet description field follows host input metrics.
|
|
16
|
+
- The end-to-end suite covers the nav icon, full-width layout, and host control metrics. The isolated smoke test loads the host primitives and checks the mask icon.
|
|
17
|
+
|
|
3
18
|
## [1.0.1] - 2026-10-17
|
|
4
19
|
|
|
5
20
|
- Add compatibility with DSH `0.2.1-rc.2` without dropping `0.2.0-rc.1`, `0.2.0-rc.2`, or `0.2.1-rc.1`. Pin development types and the default end-to-end host to `0.2.1-rc.2`. Cordis stays `4.0.5`.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## [1.0.4] - 2026-10-24
|
|
4
|
+
|
|
5
|
+
- 修复伪元素导航图标端到端断言与冒烟测试。
|
|
6
|
+
|
|
7
|
+
## [1.0.3] - 2026-10-24
|
|
8
|
+
|
|
9
|
+
- 新增 DeepSeek Harness `0.2.1-rc.3` 兼容,继续支持此前已声明的宿主版本。
|
|
10
|
+
|
|
11
|
+
## [1.0.2] - 2026-10-19
|
|
12
|
+
|
|
13
|
+
- 设置导航的宠物图标改用皮肤安全的 CSS mask,同时覆盖原生 DSH 设置弹窗与 dsh-codex-ui 设置页,不再改写宿主 SVG。
|
|
14
|
+
- 宠物设置页接入宿主 Button 原语,并对齐宿主字号、间距、0.5px 边框、背景层和容器查询;创建入口改为刷新按钮旁的 22px 加号图标。
|
|
15
|
+
- 设置弹窗对齐宿主 Modal token,宠物描述输入框对齐宿主 Input 指标。
|
|
16
|
+
- 端到端测试覆盖导航图标、全宽布局与控件尺寸;隔离冒烟测试加载宿主原语并校验 mask 图标。
|
|
17
|
+
|
|
3
18
|
## [1.0.1] - 2026-10-17
|
|
4
19
|
|
|
5
20
|
- 新增 DSH `0.2.1-rc.2` 兼容,不移除已支持的 `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`。开发类型和默认端到端宿主固定到 `0.2.1-rc.2`。Cordis 仍为 `4.0.5`。
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
|
-
> DSH Codex Pet is a community-maintained pet plugin for DeepSeek Harness (DSH), not an official OpenAI or DeepSeek AI product. From 1.0.1 it supports DSH `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-rc.1`, and `0.2.1-rc.
|
|
21
|
+
> DSH Codex Pet is a community-maintained pet plugin for DeepSeek Harness (DSH), not an official OpenAI or DeepSeek AI product. From 1.0.1 it supports DSH `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-rc.1`, `0.2.1-rc.2`, and `0.2.1-rc.3`. Earlier hosts and the `0.2.1` alphas are rejected by the version gate, so the plugin will not run; local pet settings and custom pets are not deleted.
|
|
22
22
|
|
|
23
23
|
## Features
|
|
24
24
|
|
|
@@ -74,7 +74,7 @@ For a desktop workbench, download [DSH Codex Desktop](https://github.com/Micheng
|
|
|
74
74
|
|
|
75
75
|
## Installation
|
|
76
76
|
|
|
77
|
-
Supported DeepSeek Harness versions: **`0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-rc.1`, and `0.2.1-rc.
|
|
77
|
+
Supported DeepSeek Harness versions: **`0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-rc.1`, `0.2.1-rc.2`, and `0.2.1-rc.3`**. Hosts before `0.2.0` (including the previously supported `0.1.2-rc.1`, `0.1.5-rc.1`, `0.1.5-rc.2`, `0.1.5-rc.3`, `0.1.7-rc.1`, and `0.1.7-rc.2`) and `0.2.1-alpha.1` through `0.2.1-alpha.5` are rejected by the version gate, and the plugin will not run. If you still use one of those hosts, install `@michengai/dsh-codex-pet@0.1.19` instead of `@latest`. The version gate only refuses to load the plugin. It does not delete pet selection, position, or custom pets under `DSH_HOME/codex-pet`. Make sure the `dsh` command is available. The example uses the `web` profile; replace it with your target profile.
|
|
78
78
|
|
|
79
79
|
```powershell
|
|
80
80
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
@@ -104,7 +104,7 @@ The pet is a notification and action surface. Start new conversations and write
|
|
|
104
104
|
|
|
105
105
|
### Create a custom pet
|
|
106
106
|
|
|
107
|
-
1. Open pet settings, click
|
|
107
|
+
1. Open pet settings, click the **+** icon (`创建`), and describe the companion.
|
|
108
108
|
2. Click **Create in DSH** (`在 DSH 中创建`). The plugin opens a dedicated task and sends the bundled Skill instructions.
|
|
109
109
|
3. Follow that task's progress. Creation uses DSH's configured model and image tools.
|
|
110
110
|
4. Once the pet files are saved, refresh the pet library and select the new companion.
|
package/README.zh-CN.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
|
-
> DSH Codex Pet 是社区维护的 DeepSeek Harness(DSH)宠物插件,并非 OpenAI 或 DeepSeek AI 官方产品。1.0.1 起支持 DSH `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`、`0.2.1-rc.2`。更早的宿主和 `0.2.1` 的 alpha 会被版本门拒绝,插件不会运行;本机宠物配置和自定义宠物不会因此删除。
|
|
21
|
+
> DSH Codex Pet 是社区维护的 DeepSeek Harness(DSH)宠物插件,并非 OpenAI 或 DeepSeek AI 官方产品。1.0.1 起支持 DSH `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`、`0.2.1-rc.2`、`0.2.1-rc.3`。更早的宿主和 `0.2.1` 的 alpha 会被版本门拒绝,插件不会运行;本机宠物配置和自定义宠物不会因此删除。
|
|
22
22
|
|
|
23
23
|
## 功能概览
|
|
24
24
|
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
|
|
75
75
|
## 安装
|
|
76
76
|
|
|
77
|
-
支持的 DeepSeek Harness 版本:**`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`、`0.2.1-rc.2`**。`0.2.0` 之前的宿主(包括此前支持的 `0.1.2-rc.1`、`0.1.5-rc.1`、`0.1.5-rc.2`、`0.1.5-rc.3`、`0.1.7-rc.1`、`0.1.7-rc.2`)以及 `0.2.1-alpha.1` 至 `0.2.1-alpha.5` 会被版本门拒绝,插件不会运行。仍在使用这些宿主时,请安装 `@michengai/dsh-codex-pet@0.1.19`,不要装 `@latest`。版本门只拒绝加载,不删除 `DSH_HOME/codex-pet` 里的宠物选择、位置和自定义宠物。需要可用的 `dsh` 命令。以下示例使用 `web` profile,请按实际环境替换。
|
|
77
|
+
支持的 DeepSeek Harness 版本:**`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`、`0.2.1-rc.2`、`0.2.1-rc.3`**。`0.2.0` 之前的宿主(包括此前支持的 `0.1.2-rc.1`、`0.1.5-rc.1`、`0.1.5-rc.2`、`0.1.5-rc.3`、`0.1.7-rc.1`、`0.1.7-rc.2`)以及 `0.2.1-alpha.1` 至 `0.2.1-alpha.5` 会被版本门拒绝,插件不会运行。仍在使用这些宿主时,请安装 `@michengai/dsh-codex-pet@0.1.19`,不要装 `@latest`。版本门只拒绝加载,不删除 `DSH_HOME/codex-pet` 里的宠物选择、位置和自定义宠物。需要可用的 `dsh` 命令。以下示例使用 `web` profile,请按实际环境替换。
|
|
78
78
|
|
|
79
79
|
```powershell
|
|
80
80
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
@@ -104,7 +104,7 @@ dsh plugin --profile web add @michengai/dsh-codex-pet@latest --registry=https://
|
|
|
104
104
|
|
|
105
105
|
### 创建自定义宠物
|
|
106
106
|
|
|
107
|
-
1. 打开宠物设置,点击
|
|
107
|
+
1. 打开宠物设置,点击 **+** 图标,描述想要的伙伴。
|
|
108
108
|
2. 点击 **在 DSH 中创建**,插件会打开独立任务并发送随包 Skill 指令。
|
|
109
109
|
3. 在该任务中查看进展,创建使用 DSH 当前配置的模型和图像工具。
|
|
110
110
|
4. 宠物文件生成并保存后,刷新宠物库并选择新伙伴。
|
|
Binary file
|
package/lib/client.js
CHANGED
|
@@ -272,6 +272,7 @@ function translator(language) {
|
|
|
272
272
|
|
|
273
273
|
// src/client.tsx
|
|
274
274
|
var import_react7 = require("react");
|
|
275
|
+
var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
275
276
|
|
|
276
277
|
// src/library-store.ts
|
|
277
278
|
function createLibraryStore(request2) {
|
|
@@ -332,6 +333,7 @@ var import_react2 = require("react");
|
|
|
332
333
|
|
|
333
334
|
// src/project-icons.tsx
|
|
334
335
|
var import_react = __toESM(require("react"), 1);
|
|
336
|
+
var primitives = __toESM(require("@deepseek-ai/dsh-client-ui-primitives"), 1);
|
|
335
337
|
function GithubMark16() {
|
|
336
338
|
return import_react.default.createElement(
|
|
337
339
|
"svg",
|
|
@@ -339,16 +341,15 @@ function GithubMark16() {
|
|
|
339
341
|
import_react.default.createElement("path", { fill: "currentColor", d: "M8 0a8 8 0 0 0-2.53 15.59c.4.074.547-.173.547-.385 0-.19-.007-.693-.01-1.36-2.226.484-2.695-1.073-2.695-1.073-.364-.924-.89-1.17-.89-1.17-.726-.496.055-.486.055-.486.803.056 1.225.824 1.225.824.714 1.223 1.872.87 2.328.665.072-.517.28-.87.508-1.07-1.777-.202-3.645-.888-3.645-3.956 0-.874.31-1.588.823-2.148-.083-.202-.357-1.017.078-2.12 0 0 .672-.215 2.2.82A7.65 7.65 0 0 1 8 4.8c.68.003 1.365.092 2.004.27 1.527-1.035 2.197-.82 2.197-.82.437 1.103.162 1.918.08 2.12.513.56.822 1.274.822 2.148 0 3.076-1.872 3.752-3.654 3.95.288.248.544.735.544 1.482 0 1.07-.01 1.932-.01 2.195 0 .214.144.463.55.384A8.001 8.001 0 0 0 8 0Z" })
|
|
340
342
|
);
|
|
341
343
|
}
|
|
344
|
+
var IconEditOutlineRegular2 = primitives.IconEditOutlineRegular;
|
|
342
345
|
function FeedbackMark16() {
|
|
346
|
+
if (typeof IconEditOutlineRegular2 === "function") {
|
|
347
|
+
return import_react.default.createElement(IconEditOutlineRegular2, { size: 16 });
|
|
348
|
+
}
|
|
343
349
|
return import_react.default.createElement(
|
|
344
350
|
"svg",
|
|
345
|
-
{ viewBox: "0 0 16 16", width: 16, height: 16,
|
|
346
|
-
import_react.default.createElement("path", { d: "
|
|
347
|
-
import_react.default.createElement("path", { d: "M10.8239 6.12629V7.36338H4.63437V6.12629H10.8239Z", fill: "currentColor" }),
|
|
348
|
-
import_react.default.createElement("path", { d: "M9.073 8.70524V9.94234H4.63437V8.70524H9.073Z", fill: "currentColor" }),
|
|
349
|
-
import_react.default.createElement("path", { d: "M9.13321 0.573526C10.0076 0.573525 10.7179 0.572522 11.285 0.63397C11.8645 0.696791 12.3743 0.831648 12.8193 1.1548C13.0776 1.34246 13.3056 1.57047 13.4933 1.82875C13.8164 2.2737 13.9513 2.7836 14.0141 3.36303C14.0755 3.93015 14.0745 4.64049 14.0745 5.51485V6.1757L12.7327 7.5629V5.51485C12.7327 4.61092 12.732 3.9862 12.6803 3.5081C12.6298 3.0427 12.5379 2.79497 12.4083 2.61654C12.3033 2.47211 12.176 2.34472 12.0315 2.23977C11.8531 2.11016 11.6054 2.01823 11.14 1.96777C10.6618 1.91601 10.0372 1.91539 9.13321 1.91539H6.32658C5.42262 1.91539 4.79796 1.91604 4.31983 1.96777C3.85451 2.01819 3.60672 2.11029 3.42827 2.23977C3.28392 2.34465 3.15643 2.47223 3.0515 2.61654C2.9219 2.79496 2.82997 3.04274 2.7795 3.5081C2.72774 3.9862 2.72712 4.61092 2.72712 5.51485V10.023C2.72712 10.9273 2.72773 11.5525 2.7795 12.0307C2.82992 12.4959 2.92205 12.7429 3.0515 12.9213C3.15645 13.0657 3.28384 13.1931 3.42827 13.2981C3.60676 13.4277 3.85408 13.5206 4.31983 13.5711C4.79797 13.6228 5.42259 13.6234 6.32658 13.6234H6.87057L5.57707 14.9593C5.03527 14.9556 4.57031 14.9467 4.17476 14.9039C3.59508 14.841 3.08558 14.7063 2.64048 14.383C2.38215 14.1953 2.15422 13.9684 1.96653 13.7101C1.64319 13.2649 1.50851 12.7546 1.4457 12.1748C1.38432 11.6076 1.38525 10.8974 1.38525 10.023V5.51485C1.38525 4.64049 1.38426 3.93015 1.4457 3.36303C1.50853 2.78363 1.64341 2.27368 1.96653 1.82875C2.15417 1.57059 2.38228 1.34239 2.64048 1.1548C3.08544 0.831805 3.59533 0.696762 4.17476 0.63397C4.74193 0.572552 5.45218 0.573525 6.32658 0.573526H9.13321Z", fill: "currentColor" }),
|
|
350
|
-
import_react.default.createElement("path", { d: "M14.2193 14.9553H10.0124L11.3744 13.6134H14.2193V14.9553Z", fill: "currentColor" }),
|
|
351
|
-
import_react.default.createElement("path", { d: "M8.24493 13.3711L7.49015 14.8806C7.40148 15.058 7.58961 15.2461 7.76695 15.1574L9.27651 14.4027L14.6147 9.09934L13.5832 8.06775L8.24493 13.3711Z", fill: "currentColor" })
|
|
351
|
+
{ viewBox: "0 0 16 16", width: 16, height: 16, "aria-hidden": true, focusable: false },
|
|
352
|
+
import_react.default.createElement("path", { fill: "currentColor", d: "M11.06 1.94a1.5 1.5 0 0 1 2.12 2.12l-8.5 8.5a1.5 1.5 0 0 1-.64.38l-2.5.71a.5.5 0 0 1-.61-.61l.71-2.5a1.5 1.5 0 0 1 .38-.64l8.5-8.5Z" })
|
|
352
353
|
);
|
|
353
354
|
}
|
|
354
355
|
|
|
@@ -396,8 +397,8 @@ function updateErrorMessage(code, language) {
|
|
|
396
397
|
var UPDATE_HEADER = "x-michengai-plugin-update";
|
|
397
398
|
var STYLE_ID = "michengai-plugin-update-ui";
|
|
398
399
|
var CSS = `
|
|
399
|
-
.mpi-version{margin-left:8px;color:var(--dsw-alias-label-tertiary,#9da1aa);font-family:inherit;font-size:12px;font-weight:500;line-height:18px;letter-spacing:0;white-space:nowrap;vertical-align:baseline}.mpi-check{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:28px;padding:0
|
|
400
|
-
.mpi-overlay{position:fixed;inset:0;z-index:2147483647;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(0,0,0,.62)}.mpi-dialog{position:relative;box-sizing:border-box;width:min(680px,100%);max-height:calc(100vh - 48px);overflow:auto;border:
|
|
400
|
+
.mpi-version{margin-left:8px;color:var(--dsw-alias-label-tertiary,#9da1aa);font-family:inherit;font-size:12px;font-weight:500;line-height:18px;letter-spacing:0;white-space:nowrap;vertical-align:baseline}.mpi-check{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:28px;height:28px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l3,var(--dsw-alias-border-l2,#4b4d52));border-radius:var(--dsw-radius-sm,7px);background:transparent;color:var(--dsw-alias-label-secondary,#b8bbc2);font:inherit;font-size:12px;font-weight:500;line-height:18px;white-space:nowrap;cursor:pointer}.mpi-check:hover{background:var(--dsw-alias-interactive-bg-hover,#3a3b3f);color:var(--dsw-alias-label-primary,#fff)}.mpi-check:focus-visible,.mpi-dialog .mpi-action:focus-visible,.mpi-dialog .mpi-dialog-close:focus-visible{outline:var(--dsw-focus-ring-width,1px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary,#4f8cff));outline-offset:2px}.mpi-icon{display:inline-flex;flex:0 0 auto;width:16px;height:16px;align-items:center;justify-content:center;pointer-events:none}.mpi-icon svg{display:block;width:16px;height:16px}
|
|
401
|
+
.mpi-overlay{position:fixed;inset:0;z-index:2147483647;display:flex;align-items:center;justify-content:center;padding:24px;background:var(--dsw-alias-bg-mask-1,rgba(0,0,0,.62));backdrop-filter:var(--dsw-mask-blur,none)}.mpi-dialog{position:relative;box-sizing:border-box;width:min(680px,100%);max-height:calc(100vh - 48px);overflow:auto;border:0;border-radius:var(--dsw-radius-panel,14px);padding:22px;background:var(--dsw-alias-bg-layer-2,var(--dsw-specific-menu,#202124));color:var(--dsw-alias-label-primary,#fff);box-shadow:var(--dsw-elevation-prominent,var(--dsw-shadow-lv3,0 16px 48px rgba(0,0,0,.24)));font-family:inherit}.mpi-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.mpi-dialog h2{margin:0;font-size:16px;line-height:24px;font-weight:500}.mpi-dialog .mpi-dialog-close{display:inline-flex;flex:0 0 28px;width:28px;height:28px;align-items:center;justify-content:center;padding:0;border:0;border-radius:var(--dsw-radius-sm,8px);background:transparent;color:var(--dsw-alias-label-secondary,#b8bbc2);cursor:pointer}.mpi-dialog .mpi-dialog-close:hover{background:var(--dsw-alias-interactive-bg-hover,#3a3b3f);color:var(--dsw-alias-label-primary,#fff)}.mpi-intro{margin:8px 0 18px;color:var(--dsw-alias-label-secondary,#c2c4ca);font-size:13px;line-height:20px}.mpi-meta{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px 18px;margin:0 0 16px;font-size:12px;line-height:18px}.mpi-meta dt{color:var(--dsw-alias-label-secondary,#c2c4ca)}.mpi-meta dd{margin:0;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.mpi-status{margin:0 0 18px;border-radius:var(--dsw-radius-sm,7px);padding:12px 14px;background:var(--dsw-alias-bg-layer-3,var(--dsw-specific-menu-item-hover,#252527));font-size:13px;font-weight:600;line-height:20px}.mpi-status[data-kind=error]{color:var(--dsw-alias-state-error-primary,#ff6464)}.mpi-status[data-kind=success]{color:var(--dsw-alias-state-success-primary,#36d67a)}.mpi-status[data-kind=update]{color:var(--dsw-alias-state-warn-primary,#e8b15a)}.mpi-manual{border-top:1px solid var(--dsw-alias-border-l2,#4b4d52);padding-top:16px}.mpi-manual h3{margin:0 0 6px;font-size:14px;line-height:20px}.mpi-manual p{margin:0 0 10px;color:var(--dsw-alias-label-secondary,#c2c4ca);font-size:12px;line-height:18px}.mpi-command{display:flex;align-items:center;gap:8px;border:1px solid var(--dsw-alias-border-l2,#4b4d52);border-radius:var(--dsw-radius-sm,7px);padding:10px;background:var(--dsw-alias-bg-layer-3,var(--dsw-specific-menu-item-hover,#252527))}.mpi-command code{min-width:0;flex:1;overflow:auto;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:18px;white-space:nowrap}.mpi-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:18px}.mpi-actions-group{display:flex;gap:8px}.mpi-dialog .mpi-action{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:32px;border:1px solid var(--dsw-alias-border-l2,#4b4d52);border-radius:var(--dsw-radius-sm,7px);padding:6px 10px;background:transparent;color:inherit;font:inherit;font-size:12px;cursor:pointer}.mpi-dialog .mpi-action:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,#414247)}.mpi-dialog .mpi-action:disabled{cursor:not-allowed;opacity:.55}.mpi-dialog .mpi-primary{border-color:var(--dsw-alias-button-primary-fill,var(--dsw-alias-state-business-primary,#4f8cff));background:var(--dsw-alias-button-primary-fill,var(--dsw-alias-state-business-primary,#4f8cff));color:var(--dsw-alias-label-primary-foreground,#fff)}.mpi-progress{height:4px;margin-top:10px;overflow:hidden;border-radius:99px;background:var(--dsw-alias-border-l2,#4b4d52)}.mpi-progress::after{display:block;width:32%;height:100%;background:var(--dsw-alias-state-business-primary,#4f8cff);content:'';animation:mpi-wave 1.15s ease-in-out infinite}@keyframes mpi-wave{from{transform:translateX(-110%)}to{transform:translateX(330%)}}@media(max-width:560px){.mpi-overlay{padding:10px}.mpi-dialog{max-height:calc(100vh - 20px);padding:16px}.mpi-actions{align-items:stretch}.mpi-actions-group{justify-content:flex-end;flex-wrap:wrap}.mpi-meta{grid-template-columns:1fr;gap:2px}.mpi-meta dd{margin-bottom:6px}}
|
|
401
402
|
`;
|
|
402
403
|
var ZH = {
|
|
403
404
|
unpublished: "\u5C1A\u672A\u53D1\u5E03\u5230 npm\uFF0C\u53D1\u5E03\u540E\u5373\u53EF\u68C0\u67E5\u5E76\u5B89\u88C5\u66F4\u65B0\u3002",
|
|
@@ -592,7 +593,7 @@ function observePluginUpdate(options) {
|
|
|
592
593
|
const setMessage = (message, kind = "") => {
|
|
593
594
|
status.textContent = message;
|
|
594
595
|
status.dataset.kind = kind;
|
|
595
|
-
status.style.color = kind === "update" ? "
|
|
596
|
+
status.style.color = kind === "update" ? "var(--dsw-alias-state-warn-primary,#e8b15a)" : "";
|
|
596
597
|
};
|
|
597
598
|
const setBusy = (value) => {
|
|
598
599
|
busy = value;
|
|
@@ -829,13 +830,13 @@ function PluginUpdateHeader({ locale }) {
|
|
|
829
830
|
});
|
|
830
831
|
}, [language]);
|
|
831
832
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
832
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: `.dcp-project-head{display:flex;align-items:center;justify-content:flex-start;gap:8px 12px;flex-wrap:wrap;margin-bottom:
|
|
833
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: `.dcp-project-head{display:flex;align-items:center;justify-content:flex-start;gap:8px 12px;flex-wrap:wrap;margin-bottom:0}.dcp-project-head h1{display:inline-flex;align-items:baseline;margin:0;white-space:nowrap}.dcp-version{font-size:12px;font-weight:500;line-height:18px;color:var(--dsw-alias-label-tertiary,#9da1aa);margin-left:10px}.dcp-project-links{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.dcp-project-links a,.dcp-project-links button{display:inline-flex;align-items:center;justify-content:center;gap:4px;box-sizing:border-box;min-height:28px;height:28px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l3,var(--dsw-alias-border-l2,#383838));border-radius:var(--dsw-radius-sm,7px);background:transparent;color:var(--dsw-alias-label-primary,inherit);font-family:inherit;font-size:12px;font-weight:500;line-height:18px;text-decoration:none;white-space:nowrap;cursor:pointer}.dcp-project-links a:hover,.dcp-project-links button:hover{background:var(--dsw-alias-interactive-bg-hover,#ffffff0a);color:var(--dsw-alias-label-primary,inherit)}.dcp-project-links a:focus-visible,.dcp-project-links button:focus-visible{outline:var(--dsw-focus-ring-width,1px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary,#4f8cff));outline-offset:2px}.dcp-project-links svg{display:block;flex:none;width:16px;height:16px}` }),
|
|
833
834
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { ref: root, className: "dcp-project-head", children: [
|
|
834
835
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h1", { children: [
|
|
835
836
|
zh2 ? "\u5BA0\u7269" : "Pets",
|
|
836
837
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dcp-version", children: [
|
|
837
838
|
"v",
|
|
838
|
-
"1.0.
|
|
839
|
+
"1.0.4"
|
|
839
840
|
] })
|
|
840
841
|
] }),
|
|
841
842
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", { className: "dcp-project-links", children: [
|
|
@@ -974,6 +975,24 @@ var MixerHorizontalIcon = /* @__PURE__ */ (0, import_react3.forwardRef)(function
|
|
|
974
975
|
clipRule: "evenodd"
|
|
975
976
|
}));
|
|
976
977
|
});
|
|
978
|
+
var _excluded$3x = ["color"];
|
|
979
|
+
var PlusIcon = /* @__PURE__ */ (0, import_react3.forwardRef)(function(_ref, forwardedRef) {
|
|
980
|
+
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, props = _objectWithoutPropertiesLoose(_ref, _excluded$3x);
|
|
981
|
+
return (0, import_react3.createElement)("svg", Object.assign({
|
|
982
|
+
width: "15",
|
|
983
|
+
height: "15",
|
|
984
|
+
viewBox: "0 0 15 15",
|
|
985
|
+
fill: "none",
|
|
986
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
987
|
+
}, props, {
|
|
988
|
+
ref: forwardedRef
|
|
989
|
+
}), (0, import_react3.createElement)("path", {
|
|
990
|
+
d: "M8 2.75C8 2.47386 7.77614 2.25 7.5 2.25C7.22386 2.25 7 2.47386 7 2.75V7H2.75C2.47386 7 2.25 7.22386 2.25 7.5C2.25 7.77614 2.47386 8 2.75 8H7V12.25C7 12.5261 7.22386 12.75 7.5 12.75C7.77614 12.75 8 12.5261 8 12.25V8H12.25C12.5261 8 12.75 7.77614 12.75 7.5C12.75 7.22386 12.5261 7 12.25 7H8V2.75Z",
|
|
991
|
+
fill: color,
|
|
992
|
+
fillRule: "evenodd",
|
|
993
|
+
clipRule: "evenodd"
|
|
994
|
+
}));
|
|
995
|
+
});
|
|
977
996
|
var _excluded$3A = ["color"];
|
|
978
997
|
var QuestionMarkCircledIcon = /* @__PURE__ */ (0, import_react3.forwardRef)(function(_ref, forwardedRef) {
|
|
979
998
|
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, props = _objectWithoutPropertiesLoose(_ref, _excluded$3A);
|
|
@@ -1157,18 +1176,18 @@ var polishedTrayStyles = `
|
|
|
1157
1176
|
|
|
1158
1177
|
// src/ui.tsx
|
|
1159
1178
|
var import_react5 = require("react");
|
|
1179
|
+
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
1160
1180
|
|
|
1161
1181
|
// src/styles.ts
|
|
1162
1182
|
var styles = `
|
|
1163
|
-
.dcp{--pet-bg:var(--dsw-alias-bg-base,#181818);--pet-card:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#242424));--pet-line:var(--dsw-alias-border-l2,#343434);--pet-text:var(--dsw-alias-label-primary,#d7d7d7);--pet-muted:var(--dsw-alias-label-secondary,#929292);font-family:Arial,"Microsoft YaHei",sans-serif;color:var(--pet-text);font-size:13px;line-height:1.45;color-scheme:inherit}
|
|
1164
|
-
.dcp *{box-sizing:border-box}.dcp
|
|
1165
|
-
.dcp-page{
|
|
1166
|
-
.dcp-card{border:
|
|
1183
|
+
.dcp{--pet-bg:var(--dsw-alias-bg-base,#181818);--pet-card:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-base,#242424));--pet-line:var(--dsw-alias-border-l2,#343434);--pet-text:var(--dsw-alias-label-primary,#d7d7d7);--pet-muted:var(--dsw-alias-label-secondary,#929292);font-family:var(--dsw-font-family,Arial,"Microsoft YaHei",sans-serif);color:var(--pet-text);font-size:13px;line-height:1.45;color-scheme:inherit}
|
|
1184
|
+
.dcp *{box-sizing:border-box}.dcp input,.dcp textarea{font:inherit}.dcp button:disabled{opacity:.4;cursor:not-allowed}.dcp button:focus-visible,.dcp input:focus-visible,.dcp textarea:focus-visible{outline:var(--dsw-focus-ring-width,1px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary,#9bc8ff));outline-offset:2px}.dcp-pet-button,.dcp-bubble,.dcp-menu button,.dcp-tray button{font:inherit;color:var(--pet-text);cursor:pointer}.dcp-pet-button,.dcp-bubble,.dcp-menu button,.dcp-tray button{border:0;background:transparent}.dcp-menu button:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,color-mix(in srgb,var(--pet-text) 8%,transparent))}
|
|
1185
|
+
.dcp-page{box-sizing:border-box;display:flex;flex-direction:column;gap:14px;width:100%;min-width:0;padding:2px 0 36px;font-size:14px;line-height:1.5;container-type:inline-size}.dcp-page h1{font-size:24px;line-height:32px;font-weight:600;letter-spacing:-.4px;margin:0}.dcp-page h2{font-size:14px;line-height:22px;font-weight:600;margin:0}.dcp-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.dcp-sub{color:var(--dsw-alias-label-tertiary,var(--pet-muted));margin:4px 0 0;font-size:14px;line-height:22px}.dcp-actions{display:flex;align-items:center;gap:8px}.dcp-icon-button{width:22px;min-width:22px;height:22px;padding:0;border-radius:var(--dsw-radius-sm,8px);background:transparent;color:var(--dsw-alias-label-secondary,#b9b9b9);border-color:var(--dsw-alias-border-l2)}.dcp-icon-button:hover:not(:disabled){color:var(--dsw-alias-link,#4176e6);border-color:var(--dsw-alias-link,#4176e6)}.dcp svg{width:16px;height:16px;flex-shrink:0}
|
|
1186
|
+
.dcp-card{border:0.5px solid var(--pet-line);border-radius:var(--dsw-radius-lg,16px);background:var(--dsw-alias-bg-layer-1,var(--pet-card));overflow:hidden;padding:0 14px}.dcp-row{display:flex;align-items:center;gap:12px;min-height:76px;border-bottom:0.5px solid var(--dsw-alias-border-l1,var(--pet-line))}.dcp-preview{width:52px;flex-shrink:0;display:flex;justify-content:center;align-items:center}.dcp-info{flex:1;min-width:0}.dcp-name{font-size:14px;font-weight:650;margin-bottom:3px}.dcp-description{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary,var(--pet-muted));overflow-wrap:anywhere}.dcp-folder{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0}.dcp-path{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;line-height:17px;color:var(--dsw-alias-label-tertiary,var(--pet-muted));overflow-wrap:anywhere}.dcp-folder-button{white-space:nowrap}.dcp-appearance{display:flex;flex-direction:column;gap:14px}.dcp-size{min-height:62px;display:flex;align-items:center;justify-content:space-between;padding:12px 16px}.dcp-size label{font-weight:600}.dcp-size input{width:160px;height:2px;accent-color:var(--dsw-alias-brand-primary,#fff);cursor:pointer}.dcp-size small{display:block;font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary,var(--pet-muted));font-weight:400;margin-top:2px}.dcp-note{margin:0;color:var(--dsw-alias-label-tertiary,var(--pet-muted));font-size:11px;line-height:17px}.dcp-error{padding:12px 14px;border:0.5px solid color-mix(in srgb,var(--dsw-alias-state-error-primary,#ed7272) 40%,transparent);border-radius:var(--dsw-radius-sm,8px);color:var(--dsw-alias-state-error-primary,#edb7a3);margin:0;font-size:12px;line-height:18px}.dcp-empty{padding:25px 14px;text-align:center;color:var(--dsw-alias-label-tertiary,var(--pet-muted));font-size:12px;line-height:18px}
|
|
1167
1187
|
.dcp-floating{position:fixed;z-index:2147483000;pointer-events:none}.dcp-pet-button{display:block!important;padding:0!important;background:transparent!important;touch-action:none;cursor:grab!important;pointer-events:auto;user-select:none;-webkit-user-select:none}.dcp-pet-button:active{cursor:grabbing!important}.dcp-sprite{background-repeat:no-repeat;pointer-events:none;flex-shrink:0}.dcp-bubble{position:absolute;bottom:calc(100% + 16px);right:0;min-width:160px;max-width:240px;width:max-content;padding:10px 16px!important;border:1px solid var(--pet-line)!important;border-radius:28px!important;background:var(--pet-card)!important;text-align:left;box-shadow:0 2px 12px #0002;pointer-events:auto}.dcp-bubble strong{display:block;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px}.dcp-bubble span{display:block;font-size:12px;color:var(--pet-muted)}.dcp-menu{position:absolute;right:0;bottom:100%;width:160px;padding:6px;border:1px solid var(--pet-line);background:var(--pet-card);border-radius:10px;pointer-events:auto;box-shadow:0 8px 32px #0004}.dcp-menu button{display:block;width:100%;text-align:left;padding:8px;border-radius:5px}.dcp-menu hr{border:0;border-top:1px solid var(--pet-line);margin:5px}
|
|
1168
|
-
.dcp-dialog{color:var(--pet-text);background:var(--pet-card);border:
|
|
1169
|
-
.dcp-
|
|
1170
|
-
.dcp-
|
|
1171
|
-
@media(max-width:600px){.dcp-page h1{font-size:22px;margin-bottom:24px}.dcp-head{flex-wrap:wrap;gap:10px}.dcp-row{min-height:86px;gap:8px}.dcp-preview{width:44px}.dcp-description{font-size:11px}.dcp-card{padding:0 12px}.dcp-folder{align-items:flex-start}.dcp-folder-button{font-size:11px!important}.dcp-size{padding:12px}.dcp-size input{width:130px}.dcp-appearance{margin-top:32px}}
|
|
1188
|
+
.dcp-dialog{color:var(--pet-text);background:var(--dsw-alias-bg-layer-2,var(--pet-card));border:0;border-radius:var(--dsw-radius-panel,16px);width:min(480px,calc(100vw - 32px));padding:24px;box-shadow:var(--dsw-elevation-prominent,0 16px 48px #0004)}.dcp-dialog[open]{display:flex;flex-direction:column;gap:12px}.dcp-dialog-close{align-self:flex-start}.dcp-dialog::backdrop{background:var(--dsw-alias-bg-mask-1,#0008);backdrop-filter:var(--dsw-mask-blur,none)}.dcp-create-dialog h2{font-size:16px;line-height:24px;font-weight:500;margin:0 0 12px}.dcp textarea.dcp-textarea{display:block;resize:vertical;width:100%;min-height:120px;color:var(--pet-text);background:var(--dsw-alias-bg-layer-1,var(--pet-bg));border:0.5px solid var(--dsw-alias-border-l4,var(--pet-line));border-radius:var(--dsw-radius-md,12px);padding:8px 12px;margin:16px 0;font-size:14px;line-height:22px}.dcp textarea.dcp-textarea:focus{outline:none;border-color:var(--dsw-alias-state-business-primary,var(--pet-line))}.dcp-dialog footer{display:flex;justify-content:flex-end;gap:8px}.dcp-creation{border-top:0.5px solid var(--pet-line);padding-top:12px}
|
|
1189
|
+
.dcp-size input{-webkit-appearance:none;appearance:none;background:var(--pet-line);height:2px}.dcp-size input::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;border-radius:50%;background:var(--dsw-alias-brand-primary,var(--pet-text))}
|
|
1190
|
+
@container(max-width:520px){.dcp-page h1{font-size:22px}.dcp-head{flex-wrap:wrap;gap:10px}.dcp-row{min-height:68px;gap:8px}.dcp-preview{width:44px}.dcp-description{font-size:11px}.dcp-card{padding:0 12px}.dcp-folder{align-items:flex-start}.dcp-size{padding:12px}.dcp-size input{width:130px}}
|
|
1172
1191
|
@media(prefers-reduced-motion:reduce){.dcp *{animation:none!important;transition:none!important}}
|
|
1173
1192
|
`;
|
|
1174
1193
|
|
|
@@ -1268,6 +1287,7 @@ function Settings({
|
|
|
1268
1287
|
const [busy, setBusy] = (0, import_react5.useState)(false), [showCreate, setShowCreate] = (0, import_react5.useState)(false), [description, setDescription] = (0, import_react5.useState)("");
|
|
1269
1288
|
const [size, setSize] = (0, import_react5.useState)(library?.config.size ?? 120);
|
|
1270
1289
|
const dialog = (0, import_react5.useRef)(null);
|
|
1290
|
+
const createTitleId = (0, import_react5.useId)();
|
|
1271
1291
|
const [creationError, setCreationError] = (0, import_react5.useState)("");
|
|
1272
1292
|
(0, import_react5.useEffect)(() => {
|
|
1273
1293
|
if (library) setSize(library.config.size);
|
|
@@ -1295,29 +1315,39 @@ function Settings({
|
|
|
1295
1315
|
] }),
|
|
1296
1316
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dcp-actions", children: [
|
|
1297
1317
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1298
|
-
|
|
1318
|
+
import_dsh_client_ui_primitives.Button,
|
|
1299
1319
|
{
|
|
1300
|
-
|
|
1320
|
+
type: "button",
|
|
1321
|
+
variant: "outline",
|
|
1322
|
+
size: "sm",
|
|
1323
|
+
className: "dcp-icon-button",
|
|
1301
1324
|
title: t("\u5237\u65B0\u5BA0\u7269\u5E93"),
|
|
1302
1325
|
"aria-label": t("\u5237\u65B0\u5BA0\u7269\u5E93"),
|
|
1303
1326
|
disabled: busy,
|
|
1304
|
-
|
|
1305
|
-
|
|
1327
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReloadIcon, {}),
|
|
1328
|
+
onClick: () => void act(controller.refresh)
|
|
1306
1329
|
}
|
|
1307
1330
|
),
|
|
1308
1331
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1309
|
-
|
|
1332
|
+
import_dsh_client_ui_primitives.Button,
|
|
1310
1333
|
{
|
|
1311
|
-
|
|
1334
|
+
type: "button",
|
|
1335
|
+
variant: "outline",
|
|
1336
|
+
size: "sm",
|
|
1337
|
+
className: "dcp-icon-button",
|
|
1338
|
+
title: t("\u521B\u5EFA"),
|
|
1339
|
+
"aria-label": t("\u521B\u5EFA"),
|
|
1312
1340
|
disabled: !library || busy,
|
|
1313
|
-
|
|
1314
|
-
|
|
1341
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PlusIcon, {}),
|
|
1342
|
+
onClick: () => setShowCreate(true)
|
|
1315
1343
|
}
|
|
1316
1344
|
),
|
|
1317
1345
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1318
|
-
|
|
1346
|
+
import_dsh_client_ui_primitives.Button,
|
|
1319
1347
|
{
|
|
1320
|
-
|
|
1348
|
+
type: "button",
|
|
1349
|
+
variant: "outline",
|
|
1350
|
+
size: "sm",
|
|
1321
1351
|
disabled: !library || busy,
|
|
1322
1352
|
onClick: () => void act(
|
|
1323
1353
|
() => controller.update({ visible: !library?.config.visible })
|
|
@@ -1337,9 +1367,11 @@ function Settings({
|
|
|
1337
1367
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dcp-description", children: pet.description })
|
|
1338
1368
|
] }),
|
|
1339
1369
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1340
|
-
|
|
1370
|
+
import_dsh_client_ui_primitives.Button,
|
|
1341
1371
|
{
|
|
1342
|
-
|
|
1372
|
+
type: "button",
|
|
1373
|
+
variant: library.config.selected === pet.id ? "ghost" : "outline",
|
|
1374
|
+
size: "sm",
|
|
1343
1375
|
"aria-label": library.config.selected === pet.id ? `${t("\u5DF2\u9009\u62E9")} ${pet.name}` : `${t("\u9009\u62E9")} ${pet.name}`,
|
|
1344
1376
|
"aria-pressed": library.config.selected === pet.id,
|
|
1345
1377
|
disabled: busy || library.config.selected === pet.id,
|
|
@@ -1354,17 +1386,17 @@ function Settings({
|
|
|
1354
1386
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: t("DSH \u81EA\u5B9A\u4E49\u5BA0\u7269") }),
|
|
1355
1387
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dcp-path", children: library?.customPath ?? t("\u6B63\u5728\u8BFB\u53D6\u76EE\u5F55\u2026") })
|
|
1356
1388
|
] }),
|
|
1357
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
1358
|
-
|
|
1389
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1390
|
+
import_dsh_client_ui_primitives.Button,
|
|
1359
1391
|
{
|
|
1392
|
+
type: "button",
|
|
1393
|
+
variant: "outline",
|
|
1394
|
+
size: "sm",
|
|
1360
1395
|
className: "dcp-folder-button",
|
|
1361
1396
|
disabled: !library || busy,
|
|
1397
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ArrowTopRightIcon, {}),
|
|
1362
1398
|
onClick: () => void act(controller.folder),
|
|
1363
|
-
children:
|
|
1364
|
-
t("\u6253\u5F00\u6587\u4EF6\u5939"),
|
|
1365
|
-
" ",
|
|
1366
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ArrowTopRightIcon, {})
|
|
1367
|
-
]
|
|
1399
|
+
children: t("\u6253\u5F00\u6587\u4EF6\u5939")
|
|
1368
1400
|
}
|
|
1369
1401
|
)
|
|
1370
1402
|
] })
|
|
@@ -1405,7 +1437,8 @@ function Settings({
|
|
|
1405
1437
|
"dialog",
|
|
1406
1438
|
{
|
|
1407
1439
|
ref: dialog,
|
|
1408
|
-
className: "dcp-dialog",
|
|
1440
|
+
className: "dcp-dialog dcp-create-dialog",
|
|
1441
|
+
"aria-labelledby": createTitleId,
|
|
1409
1442
|
onCancel: () => setShowCreate(false),
|
|
1410
1443
|
onClose: () => setShowCreate(false),
|
|
1411
1444
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
@@ -1426,10 +1459,11 @@ function Settings({
|
|
|
1426
1459
|
).finally(() => setBusy(false));
|
|
1427
1460
|
},
|
|
1428
1461
|
children: [
|
|
1429
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h2", { children: t("\u521B\u5EFA\u5BA0\u7269") }),
|
|
1462
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h2", { id: createTitleId, children: t("\u521B\u5EFA\u5BA0\u7269") }),
|
|
1430
1463
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1431
1464
|
"textarea",
|
|
1432
1465
|
{
|
|
1466
|
+
className: "dcp-textarea",
|
|
1433
1467
|
autoFocus: true,
|
|
1434
1468
|
"aria-label": t("\u5BA0\u7269\u63CF\u8FF0"),
|
|
1435
1469
|
placeholder: t(
|
|
@@ -1450,19 +1484,21 @@ function Settings({
|
|
|
1450
1484
|
creationError && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { role: "alert", className: "dcp-error", children: t(creationError) }),
|
|
1451
1485
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("footer", { children: [
|
|
1452
1486
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1453
|
-
|
|
1487
|
+
import_dsh_client_ui_primitives.Button,
|
|
1454
1488
|
{
|
|
1455
1489
|
type: "button",
|
|
1456
|
-
|
|
1490
|
+
variant: "ghost",
|
|
1491
|
+
size: "sm",
|
|
1457
1492
|
onClick: () => setShowCreate(false),
|
|
1458
1493
|
children: t("\u53D6\u6D88")
|
|
1459
1494
|
}
|
|
1460
1495
|
),
|
|
1461
1496
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1462
|
-
|
|
1497
|
+
import_dsh_client_ui_primitives.Button,
|
|
1463
1498
|
{
|
|
1464
1499
|
type: "submit",
|
|
1465
|
-
|
|
1500
|
+
variant: "primary",
|
|
1501
|
+
size: "sm",
|
|
1466
1502
|
disabled: busy || !description.trim() || !library?.skillAvailable || !create,
|
|
1467
1503
|
children: t("\u5728 DSH \u4E2D\u521B\u5EFA")
|
|
1468
1504
|
}
|
|
@@ -2067,25 +2103,100 @@ async function createPetSession(sessions, description, directory, skill) {
|
|
|
2067
2103
|
|
|
2068
2104
|
// src/settings-icon.ts
|
|
2069
2105
|
var PAW = '<circle cx="11" cy="4" r="2"/><circle cx="18" cy="8" r="2"/><circle cx="20" cy="16" r="2"/><path d="M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z"/>';
|
|
2106
|
+
var PAW_MASK = `url("data:image/svg+xml,${encodeURIComponent(
|
|
2107
|
+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${PAW}</svg>`
|
|
2108
|
+
)}")`;
|
|
2109
|
+
var PET_NAV_ICON_MARKER = "data-dcp-nav-icon";
|
|
2110
|
+
var PET_NAV_ROW_SELECTOR = '[role="dialog"] nav button, .dcu-settings-link';
|
|
2111
|
+
var NAV_ICON_STYLE_ID = "dcp-settings-nav-icon-style";
|
|
2112
|
+
var NAV_ICON_CSS = [
|
|
2113
|
+
`[${PET_NAV_ICON_MARKER}] > svg { display: none !important; }`,
|
|
2114
|
+
`[${PET_NAV_ICON_MARKER}]::before {`,
|
|
2115
|
+
` content: '';`,
|
|
2116
|
+
` flex: none;`,
|
|
2117
|
+
` width: 16px;`,
|
|
2118
|
+
` height: 16px;`,
|
|
2119
|
+
` color: var(--dcu-sidebar-icon, currentColor);`,
|
|
2120
|
+
` background: currentColor;`,
|
|
2121
|
+
` -webkit-mask: ${PAW_MASK} center / contain no-repeat;`,
|
|
2122
|
+
` mask: ${PAW_MASK} center / contain no-repeat;`,
|
|
2123
|
+
` -webkit-mask-repeat: no-repeat;`,
|
|
2124
|
+
` mask-repeat: no-repeat;`,
|
|
2125
|
+
` -webkit-mask-position: center;`,
|
|
2126
|
+
` mask-position: center;`,
|
|
2127
|
+
` -webkit-mask-size: 16px 16px;`,
|
|
2128
|
+
` mask-size: 16px 16px;`,
|
|
2129
|
+
`}`
|
|
2130
|
+
].join("\n");
|
|
2131
|
+
function ensureNavIconStyle() {
|
|
2132
|
+
if (typeof document === "undefined") return;
|
|
2133
|
+
if (document.getElementById(NAV_ICON_STYLE_ID) !== null) return;
|
|
2134
|
+
const style = document.createElement("style");
|
|
2135
|
+
style.id = NAV_ICON_STYLE_ID;
|
|
2136
|
+
style.textContent = NAV_ICON_CSS;
|
|
2137
|
+
(document.head ?? document.documentElement).appendChild(style);
|
|
2138
|
+
}
|
|
2139
|
+
function isPetNavRow(button) {
|
|
2140
|
+
const label = button.textContent?.trim() ?? "";
|
|
2141
|
+
return label === "\u5BA0\u7269" || label === "Pets";
|
|
2142
|
+
}
|
|
2143
|
+
function applyPetSettingsIcon(button) {
|
|
2144
|
+
const isOwn = isPetNavRow(button);
|
|
2145
|
+
if (isOwn) {
|
|
2146
|
+
if (button.getAttribute(PET_NAV_ICON_MARKER) === "") return false;
|
|
2147
|
+
button.setAttribute(PET_NAV_ICON_MARKER, "");
|
|
2148
|
+
return true;
|
|
2149
|
+
}
|
|
2150
|
+
if (button.hasAttribute(PET_NAV_ICON_MARKER)) {
|
|
2151
|
+
button.removeAttribute(PET_NAV_ICON_MARKER);
|
|
2152
|
+
return true;
|
|
2153
|
+
}
|
|
2154
|
+
return false;
|
|
2155
|
+
}
|
|
2156
|
+
function restorePetSettingsIcon(button) {
|
|
2157
|
+
if (!button.hasAttribute(PET_NAV_ICON_MARKER)) return false;
|
|
2158
|
+
button.removeAttribute(PET_NAV_ICON_MARKER);
|
|
2159
|
+
return true;
|
|
2160
|
+
}
|
|
2070
2161
|
function observePetSettingsIcon() {
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2162
|
+
if (typeof document === "undefined" || document.body === null)
|
|
2163
|
+
return () => {
|
|
2164
|
+
};
|
|
2165
|
+
ensureNavIconStyle();
|
|
2166
|
+
let disposed = false;
|
|
2167
|
+
let frame;
|
|
2168
|
+
const hasSettingsSurface = () => document.querySelector(
|
|
2169
|
+
'.dcu-settings-page, .dcu-settings-link, [data-shortcut-modal="settings"]'
|
|
2170
|
+
) !== null;
|
|
2171
|
+
const sync = () => {
|
|
2172
|
+
frame = void 0;
|
|
2173
|
+
if (disposed) return;
|
|
2174
|
+
if (!hasSettingsSurface() && document.querySelector(`[${PET_NAV_ICON_MARKER}]`) === null)
|
|
2175
|
+
return;
|
|
2176
|
+
for (const row of document.querySelectorAll(PET_NAV_ROW_SELECTOR)) {
|
|
2177
|
+
applyPetSettingsIcon(row);
|
|
2178
|
+
}
|
|
2179
|
+
};
|
|
2180
|
+
const schedule = () => {
|
|
2181
|
+
if (frame !== void 0 || disposed) return;
|
|
2182
|
+
frame = window.requestAnimationFrame(sync);
|
|
2183
|
+
};
|
|
2184
|
+
sync();
|
|
2185
|
+
const observer = new MutationObserver(schedule);
|
|
2186
|
+
observer.observe(document.body, {
|
|
2187
|
+
childList: true,
|
|
2188
|
+
subtree: true,
|
|
2189
|
+
characterData: true
|
|
2190
|
+
});
|
|
2191
|
+
return () => {
|
|
2192
|
+
disposed = true;
|
|
2193
|
+
observer.disconnect();
|
|
2194
|
+
if (frame !== void 0) window.cancelAnimationFrame(frame);
|
|
2195
|
+
for (const row of document.querySelectorAll(`[${PET_NAV_ICON_MARKER}]`)) {
|
|
2196
|
+
restorePetSettingsIcon(row);
|
|
2083
2197
|
}
|
|
2198
|
+
document.getElementById(NAV_ICON_STYLE_ID)?.remove();
|
|
2084
2199
|
};
|
|
2085
|
-
apply2();
|
|
2086
|
-
const observer = new MutationObserver(apply2);
|
|
2087
|
-
observer.observe(document.body, { childList: true, subtree: true });
|
|
2088
|
-
return () => observer.disconnect();
|
|
2089
2200
|
}
|
|
2090
2201
|
|
|
2091
2202
|
// src/global-overlay.tsx
|
|
@@ -2226,10 +2337,12 @@ function Overlay({
|
|
|
2226
2337
|
},
|
|
2227
2338
|
children: [
|
|
2228
2339
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2229
|
-
|
|
2340
|
+
import_dsh_client_ui_primitives2.Button,
|
|
2230
2341
|
{
|
|
2231
2342
|
type: "button",
|
|
2232
|
-
|
|
2343
|
+
variant: "ghost",
|
|
2344
|
+
size: "sm",
|
|
2345
|
+
className: "dcp-dialog-close",
|
|
2233
2346
|
onClick: () => settingsDialog.current?.close(),
|
|
2234
2347
|
children: t("\u5173\u95ED\u8BBE\u7F6E")
|
|
2235
2348
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-codex-pet",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "DSH Codex Pet — 为 DeepSeek Harness 提供宠物陪伴、多任务提醒与交互,以及 Skill 自定义宠物 · A pet companion with multi-task notifications, interactions, and Skill-based custom pets for DeepSeek Harness",
|
|
6
6
|
"type": "module",
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
"assets:import": "tsx scripts/import-codex.ts"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@deepseek-ai/dsh-
|
|
64
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3",
|
|
65
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3",
|
|
65
66
|
"react": "^18.2.0",
|
|
66
67
|
"react-dom": "^18.2.0"
|
|
67
68
|
},
|
|
@@ -75,6 +76,7 @@
|
|
|
75
76
|
"@deepseek-ai/dsh": "0.2.1-rc.2",
|
|
76
77
|
"@deepseek-ai/dsh-api-session-controller": "0.2.1-rc.2",
|
|
77
78
|
"@deepseek-ai/dsh-client-locale": "0.2.1-rc.2",
|
|
79
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.2",
|
|
78
80
|
"@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.2",
|
|
79
81
|
"@deepseek-ai/dsh-client-ui-session": "0.2.1-rc.2",
|
|
80
82
|
"@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.2",
|