@michengai/dsh-codex-pet 0.1.4 → 0.1.5
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 +5 -0
- package/CHANGELOG.zh-CN.md +5 -0
- package/README.md +3 -20
- package/README.zh-CN.md +3 -20
- package/lib/client.js +32 -15
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.5] - 2026-09-12
|
|
4
|
+
|
|
5
|
+
- Keep the pet in a global Web overlay across pages while preserving interaction and letting clicks pass through empty areas.
|
|
6
|
+
- Showing the pet on Codex UI settings pages requires Codex UI 1.1.3 or later. The pet still works independently without Codex UI.
|
|
7
|
+
|
|
3
8
|
## [0.1.4] - 2026-09-11
|
|
4
9
|
|
|
5
10
|
- Restore compatibility with DSH `0.1.0-rc.8`, `0.1.1-rc.2`, `0.1.2-rc.1`, and `0.1.5-rc.1` while retaining `0.1.5-rc.2`. Adapt legacy session requests so pet notifications can answer questions and approvals on older hosts.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## [0.1.5] - 2026-09-12
|
|
4
|
+
|
|
5
|
+
- 宠物改为在整个 Web 页面内悬浮,切换页面时保留显示和交互,空白区域不阻挡页面操作。
|
|
6
|
+
- 在 Codex UI 设置页显示宠物需要同时升级 Codex UI 至 1.1.3 或更新版本;未安装 Codex UI 时仍可独立使用。
|
|
7
|
+
|
|
3
8
|
## [0.1.4] - 2026-09-11
|
|
4
9
|
|
|
5
10
|
- 恢复 DSH `0.1.0-rc.8`、`0.1.1-rc.2`、`0.1.2-rc.1`、`0.1.5-rc.1` 兼容,同时保留 `0.1.5-rc.2`;适配旧版会话请求,使宠物通知可处理旧宿主的提问和审批。
|
package/README.md
CHANGED
|
@@ -100,7 +100,7 @@ Open **Settings → Pets** (`宠物` in the current UI), or open settings from t
|
|
|
100
100
|
|
|
101
101
|
The pet is a notification and action surface. Start new conversations and write follow-up messages in the main DSH interface.
|
|
102
102
|
|
|
103
|
-
Known
|
|
103
|
+
Known issue: in DSH `0.1.5-rc.2`, stopping a task before the model starts responding may cause the pet to show a failure notification.
|
|
104
104
|
|
|
105
105
|
### Create a custom pet
|
|
106
106
|
|
|
@@ -126,26 +126,9 @@ dsh plugin --profile web remove @michengai/dsh-codex-pet
|
|
|
126
126
|
|
|
127
127
|
Custom pets are stored in `.dsh/codex-pet/pets` under your user directory by default; open the folder from pet settings. If `DSH_HOME` is set, pets are stored in its `codex-pet/pets` folder. Uninstalling keeps those files and settings.
|
|
128
128
|
|
|
129
|
-
##
|
|
129
|
+
## Contributing
|
|
130
130
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
```powershell
|
|
134
|
-
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
135
|
-
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
136
|
-
npm ci
|
|
137
|
-
npx playwright install chromium
|
|
138
|
-
npm run check
|
|
139
|
-
npm test
|
|
140
|
-
npm run smoke
|
|
141
|
-
npm run test:e2e
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
End-to-end tests also require pnpm on PATH (CI uses `11.25.0`). They install the local package through the official CLI and boot the full DSH Web app to test pet settings, persistence, session creation, question responses, completion and failure notifications, and cancellation. Only the external model HTTP service is replaced with a local fixture; no paid model or image generation is used. Tests use a separate `DSH_HOME` and keep logs and screenshots in the ignored `.preview/e2e-latest-*` directory without changing your everyday profile.
|
|
145
|
-
|
|
146
|
-
The official type check verifies structural compatibility, not service lifecycle behavior. E2E runs as a separate CI job with a 25-minute budget; publishing requires a successful main push CI run for the exact tagged commit, including both language jobs for all five supported host versions. Wait for CI before tagging; missing, running, skipped, or failed checks block publishing. Windows Profile link errors (`EBUSY`) retry after 5 seconds within a shared 120-second startup budget; shutdown may require up to 10 additional seconds. This mitigates transient failures without claiming Windows stability. Other failures remain failures. Reports retain the locale, original failure, retry observations, and separate cleanup errors. PowerShell (`powershell.exe` on Windows, `pwsh` elsewhere) retains the latest five completed, marked runs. Unmarked historical evidence, unfinished runs, and directories containing `.keep` are preserved; pruning never follows directory links. Add `.keep` to release acceptance evidence before subsequent runs.
|
|
147
|
-
|
|
148
|
-
Set `DSH_PET_E2E_LOCALE` to `zh-CN` (default) or `en-US` to choose the browser language; CI tests both languages on all five supported versions. Set `DSH_PET_E2E_VERSION` to choose an older host; its complete official dependency graph is installed in isolation with exact versions. Development dependencies remain on rc.2. Set `DSH_PET_E2E_ROOT` to a separate directory named `.preview` to place isolated hosts and evidence on another volume.
|
|
131
|
+
See the [development and validation guide (Chinese)](https://github.com/MichengAI/dsh-codex-pet/blob/main/CONTRIBUTING.md) for local development, testing, and release procedures.
|
|
149
132
|
|
|
150
133
|
## License
|
|
151
134
|
|
package/README.zh-CN.md
CHANGED
|
@@ -100,7 +100,7 @@ dsh plugin --profile web add @michengai/dsh-codex-pet@latest --registry=https://
|
|
|
100
100
|
|
|
101
101
|
宠物承担通知和待处理操作。新建会话、输入后续消息仍在 DSH 主界面完成。
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
已知问题:在 DSH `0.1.5-rc.2` 中,若模型尚未开始响应就停止任务,宠物可能显示失败通知。
|
|
104
104
|
|
|
105
105
|
### 创建自定义宠物
|
|
106
106
|
|
|
@@ -126,26 +126,9 @@ dsh plugin --profile web remove @michengai/dsh-codex-pet
|
|
|
126
126
|
|
|
127
127
|
自定义宠物默认保存在用户目录的 `.dsh/codex-pet/pets` 下,可从宠物设置打开。设置了 `DSH_HOME` 时使用该目录下的 `codex-pet/pets`。卸载插件会保留这些文件与配置。
|
|
128
128
|
|
|
129
|
-
##
|
|
129
|
+
## 参与开发
|
|
130
130
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
```powershell
|
|
134
|
-
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
135
|
-
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
136
|
-
npm ci
|
|
137
|
-
npx playwright install chromium
|
|
138
|
-
npm run check
|
|
139
|
-
npm test
|
|
140
|
-
npm run smoke
|
|
141
|
-
npm run test:e2e
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
端到端测试另需 PATH 中有 pnpm(CI 使用 `11.25.0`)。它通过官方 CLI 安装本地发行包、启动完整 DSH Web,验证宠物设置、持久化、创建会话、提问回传、完成与失败通知和停止任务。只有外部模型 HTTP 服务使用本地夹具,不调用付费模型或生成图片。测试使用独立 `DSH_HOME`,日志和截图保存在忽略的 `.preview/e2e-latest-*` 下,不改动日常 Profile。
|
|
145
|
-
|
|
146
|
-
官方类型检查验证结构兼容性,不替代服务生命周期验证。E2E 拆为独立 CI job,限时 25 分钟;发布前必须验证标签提交对应的 main push CI 成功,且全部 5 个宿主版本的中英文 job 均通过;先等待 CI,再打标签,缺失、运行中、跳过或失败的检查都会阻止发布。Windows Profile 链接错误(`EBUSY`)在共享的 120 秒启动预算内每次等待 5 秒后重试,关闭进程最多另需 10 秒;这只缓解瞬时竞争,不代表 Windows 已稳定,其他错误直接失败。报告同时保留语言、原始失败、重试记录及独立清理错误。通过 PowerShell(Windows 使用 `powershell.exe`,其他平台使用 `pwsh`)保留最近 5 次已标记并结束的运行;未标记的历史证据、未结束运行及含 `.keep` 文件的目录不回收,清理不跟随目录链接。发布验收证据应在后续运行前添加 `.keep`。
|
|
147
|
-
|
|
148
|
-
可设置 `DSH_PET_E2E_LOCALE` 为 `zh-CN`(默认)或 `en-US` 选择浏览器语言,CI 对全部 5 个版本分别验证两种语言。设置 `DSH_PET_E2E_VERSION` 可选择旧版宿主,其完整官方依赖图在隔离目录内精确安装,开发依赖继续保持 rc.2。可通过 `DSH_PET_E2E_ROOT` 指向另一个名为 `.preview` 的独立目录,将测试宿主和证据放到其他磁盘。
|
|
131
|
+
本地开发、测试与发布流程见 [开发与验证指南](https://github.com/MichengAI/dsh-codex-pet/blob/main/CONTRIBUTING.md)。
|
|
149
132
|
|
|
150
133
|
## 许可证
|
|
151
134
|
|
package/lib/client.js
CHANGED
|
@@ -337,7 +337,7 @@ function translator(language) {
|
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
// src/client.tsx
|
|
340
|
-
var
|
|
340
|
+
var import_react7 = require("react");
|
|
341
341
|
|
|
342
342
|
// src/library-store.ts
|
|
343
343
|
function createLibraryStore(request2) {
|
|
@@ -893,7 +893,7 @@ function PluginUpdateHeader({ locale }) {
|
|
|
893
893
|
zh2 ? "\u5BA0\u7269" : "Pets",
|
|
894
894
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dcp-version", children: [
|
|
895
895
|
"v",
|
|
896
|
-
"0.1.
|
|
896
|
+
"0.1.5"
|
|
897
897
|
] })
|
|
898
898
|
] }),
|
|
899
899
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", { className: "dcp-project-links", children: [
|
|
@@ -2108,6 +2108,22 @@ function observePetSettingsIcon() {
|
|
|
2108
2108
|
return () => observer.disconnect();
|
|
2109
2109
|
}
|
|
2110
2110
|
|
|
2111
|
+
// src/global-overlay.tsx
|
|
2112
|
+
var import_react6 = require("react");
|
|
2113
|
+
var import_react_dom = require("react-dom");
|
|
2114
|
+
function GlobalOverlay({ children }) {
|
|
2115
|
+
const [container, setContainer] = (0, import_react6.useState)(null);
|
|
2116
|
+
(0, import_react6.useEffect)(() => {
|
|
2117
|
+
const element = document.createElement("div");
|
|
2118
|
+
element.setAttribute("data-dsh-pet-overlay", "");
|
|
2119
|
+
element.style.cssText = "position:fixed;inset:0;z-index:2147483000;pointer-events:none";
|
|
2120
|
+
document.body.append(element);
|
|
2121
|
+
setContainer(element);
|
|
2122
|
+
return () => element.remove();
|
|
2123
|
+
}, []);
|
|
2124
|
+
return container ? (0, import_react_dom.createPortal)(children, container) : null;
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2111
2127
|
// src/client.tsx
|
|
2112
2128
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
2113
2129
|
var name = "michengai-codex-pet";
|
|
@@ -2131,23 +2147,23 @@ function Overlay({
|
|
|
2131
2147
|
}) {
|
|
2132
2148
|
const controller = usePetController(locale);
|
|
2133
2149
|
const t = translator(controller.language);
|
|
2134
|
-
const settingsDialog = (0,
|
|
2135
|
-
(0,
|
|
2150
|
+
const settingsDialog = (0, import_react7.useRef)(null);
|
|
2151
|
+
(0, import_react7.useEffect)(() => {
|
|
2136
2152
|
const show = () => {
|
|
2137
2153
|
if (!settingsDialog.current?.open) settingsDialog.current?.showModal();
|
|
2138
2154
|
};
|
|
2139
2155
|
window.addEventListener("dcp-open-settings", show);
|
|
2140
2156
|
return () => window.removeEventListener("dcp-open-settings", show);
|
|
2141
2157
|
}, []);
|
|
2142
|
-
const [state, setState] = (0,
|
|
2158
|
+
const [state, setState] = (0, import_react7.useState)({
|
|
2143
2159
|
items: [],
|
|
2144
2160
|
activity: IDLE,
|
|
2145
2161
|
hidden: 0
|
|
2146
2162
|
});
|
|
2147
|
-
const notifications = (0,
|
|
2163
|
+
const notifications = (0, import_react7.useRef)(
|
|
2148
2164
|
null
|
|
2149
2165
|
);
|
|
2150
|
-
(0,
|
|
2166
|
+
(0, import_react7.useEffect)(() => {
|
|
2151
2167
|
const engine = createNotifications(sessions, pending, setState);
|
|
2152
2168
|
notifications.current = engine;
|
|
2153
2169
|
return () => {
|
|
@@ -2155,7 +2171,7 @@ function Overlay({
|
|
|
2155
2171
|
engine.dispose();
|
|
2156
2172
|
};
|
|
2157
2173
|
}, [sessions, pending]);
|
|
2158
|
-
(0,
|
|
2174
|
+
(0, import_react7.useEffect)(observePetSettingsIcon, []);
|
|
2159
2175
|
const command = async (value) => {
|
|
2160
2176
|
const engine = notifications.current;
|
|
2161
2177
|
if (!engine) throw new Error("\u4F1A\u8BDD\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA");
|
|
@@ -2165,17 +2181,17 @@ function Overlay({
|
|
|
2165
2181
|
}
|
|
2166
2182
|
await engine.command(value);
|
|
2167
2183
|
};
|
|
2168
|
-
const [externalDisplay, setExternalDisplay] = (0,
|
|
2169
|
-
const actions = (0,
|
|
2184
|
+
const [externalDisplay, setExternalDisplay] = (0, import_react7.useState)(false);
|
|
2185
|
+
const actions = (0, import_react7.useRef)({
|
|
2170
2186
|
command,
|
|
2171
2187
|
updateConfig: controller.update,
|
|
2172
2188
|
openSettings
|
|
2173
2189
|
});
|
|
2174
2190
|
actions.current = { command, updateConfig: controller.update, openSettings };
|
|
2175
|
-
const provider = (0,
|
|
2191
|
+
const provider = (0, import_react7.useRef)(
|
|
2176
2192
|
null
|
|
2177
2193
|
);
|
|
2178
|
-
(0,
|
|
2194
|
+
(0, import_react7.useEffect)(() => {
|
|
2179
2195
|
const value = createCompanionProvider({
|
|
2180
2196
|
command: (command2) => actions.current.command(command2),
|
|
2181
2197
|
updateConfig: (config) => actions.current.updateConfig(config),
|
|
@@ -2192,7 +2208,7 @@ function Overlay({
|
|
|
2192
2208
|
window.dispatchEvent(new Event("dsh-pet-disposed"));
|
|
2193
2209
|
};
|
|
2194
2210
|
}, []);
|
|
2195
|
-
(0,
|
|
2211
|
+
(0, import_react7.useEffect)(() => {
|
|
2196
2212
|
const library = controller.library;
|
|
2197
2213
|
provider.current?.publish(
|
|
2198
2214
|
library ? {
|
|
@@ -2224,6 +2240,7 @@ function Overlay({
|
|
|
2224
2240
|
className: "dcp dcp-dialog",
|
|
2225
2241
|
"aria-label": t("\u5BA0\u7269\u8BBE\u7F6E"),
|
|
2226
2242
|
style: {
|
|
2243
|
+
pointerEvents: "auto",
|
|
2227
2244
|
width: "min(800px, calc(100vw - 32px))",
|
|
2228
2245
|
maxHeight: "85vh",
|
|
2229
2246
|
overflow: "auto"
|
|
@@ -2305,14 +2322,14 @@ function apply(ctx) {
|
|
|
2305
2322
|
"shell.overlay",
|
|
2306
2323
|
() => ctx.slots.register(
|
|
2307
2324
|
{ name: "shell.overlay", id: "michengai-codex-pet", order: 100 },
|
|
2308
|
-
() => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2325
|
+
() => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GlobalOverlay, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2309
2326
|
Overlay,
|
|
2310
2327
|
{
|
|
2311
2328
|
sessions,
|
|
2312
2329
|
pending,
|
|
2313
2330
|
locale: ctx.locale
|
|
2314
2331
|
}
|
|
2315
|
-
)
|
|
2332
|
+
) })
|
|
2316
2333
|
)
|
|
2317
2334
|
);
|
|
2318
2335
|
}
|