@michengai/dsh-codex-pet 1.0.8 → 1.0.9
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 +4 -0
- package/CHANGELOG.zh-CN.md +4 -0
- package/lib/client.js +51 -18
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.0.9] - 2026-11-03
|
|
4
|
+
|
|
5
|
+
- Align with latest DSH host conventions: verified compatibility across DSH latest prerelease `0.2.2-alpha.3` and all RCs up to `0.2.1-rc.5`, and integrated the official settings section icon slot to ensure the pet settings row presents the native paw icon on newer hosts.
|
|
6
|
+
|
|
3
7
|
## [1.0.8] - 2026-11-03
|
|
4
8
|
|
|
5
9
|
- The lag is gone: the plugin no longer opens every session just to collect notifications. Machines with many sessions used to stall for tens of seconds on startup, on maximizing the window, and on view switches; it now matches the cost of not installing the plugin.
|
package/CHANGELOG.zh-CN.md
CHANGED
package/lib/client.js
CHANGED
|
@@ -291,7 +291,7 @@ function translator(language) {
|
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
// src/client.tsx
|
|
294
|
-
var
|
|
294
|
+
var import_react9 = require("react");
|
|
295
295
|
var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
296
296
|
|
|
297
297
|
// src/library-store.ts
|
|
@@ -861,7 +861,7 @@ function PluginUpdateHeader({ locale }) {
|
|
|
861
861
|
zh2 ? "\u5BA0\u7269" : "Pets",
|
|
862
862
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dcp-version", children: [
|
|
863
863
|
"v",
|
|
864
|
-
"1.0.
|
|
864
|
+
"1.0.9"
|
|
865
865
|
] })
|
|
866
866
|
] }),
|
|
867
867
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
@@ -2221,7 +2221,30 @@ async function createPetSession(sessions, description, directory, skill) {
|
|
|
2221
2221
|
}
|
|
2222
2222
|
|
|
2223
2223
|
// src/settings-icon.ts
|
|
2224
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
2224
2225
|
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"/>';
|
|
2226
|
+
function PetNavIcon({ size = 16 }) {
|
|
2227
|
+
return import_react7.default.createElement(
|
|
2228
|
+
"svg",
|
|
2229
|
+
{
|
|
2230
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2231
|
+
viewBox: "0 0 24 24",
|
|
2232
|
+
width: size,
|
|
2233
|
+
height: size,
|
|
2234
|
+
fill: "none",
|
|
2235
|
+
stroke: "currentColor",
|
|
2236
|
+
strokeWidth: 2,
|
|
2237
|
+
strokeLinecap: "round",
|
|
2238
|
+
strokeLinejoin: "round"
|
|
2239
|
+
},
|
|
2240
|
+
import_react7.default.createElement("circle", { cx: 11, cy: 4, r: 2 }),
|
|
2241
|
+
import_react7.default.createElement("circle", { cx: 18, cy: 8, r: 2 }),
|
|
2242
|
+
import_react7.default.createElement("circle", { cx: 20, cy: 16, r: 2 }),
|
|
2243
|
+
import_react7.default.createElement("path", {
|
|
2244
|
+
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"
|
|
2245
|
+
})
|
|
2246
|
+
);
|
|
2247
|
+
}
|
|
2225
2248
|
var PAW_MASK = `url("data:image/svg+xml,${encodeURIComponent(
|
|
2226
2249
|
`<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>`
|
|
2227
2250
|
)}")`;
|
|
@@ -2352,11 +2375,11 @@ function observePetSettingsIcon() {
|
|
|
2352
2375
|
}
|
|
2353
2376
|
|
|
2354
2377
|
// src/global-overlay.tsx
|
|
2355
|
-
var
|
|
2378
|
+
var import_react8 = require("react");
|
|
2356
2379
|
var import_react_dom = require("react-dom");
|
|
2357
2380
|
function GlobalOverlay({ children }) {
|
|
2358
|
-
const [container, setContainer] = (0,
|
|
2359
|
-
(0,
|
|
2381
|
+
const [container, setContainer] = (0, import_react8.useState)(null);
|
|
2382
|
+
(0, import_react8.useEffect)(() => {
|
|
2360
2383
|
const element = document.createElement("div");
|
|
2361
2384
|
element.setAttribute("data-dsh-pet-overlay", "");
|
|
2362
2385
|
element.style.cssText = "position:fixed;left:0;top:0;width:0;height:0;overflow:visible;z-index:2147483000;pointer-events:none";
|
|
@@ -2395,20 +2418,20 @@ function Overlay({
|
|
|
2395
2418
|
}) {
|
|
2396
2419
|
const controller = usePetController(locale);
|
|
2397
2420
|
const t = translator(controller.language);
|
|
2398
|
-
const [settingsOpen, setSettingsOpen] = (0,
|
|
2399
|
-
(0,
|
|
2421
|
+
const [settingsOpen, setSettingsOpen] = (0, import_react9.useState)(false);
|
|
2422
|
+
(0, import_react9.useEffect)(() => {
|
|
2400
2423
|
const show = () => setSettingsOpen(true);
|
|
2401
2424
|
window.addEventListener("dcp-open-settings", show);
|
|
2402
2425
|
return () => window.removeEventListener("dcp-open-settings", show);
|
|
2403
2426
|
}, []);
|
|
2404
|
-
const [state, setState] = (0,
|
|
2405
|
-
const notifications = (0,
|
|
2427
|
+
const [state, setState] = (0, import_react9.useState)(EMPTY_NOTIFICATIONS);
|
|
2428
|
+
const notifications = (0, import_react9.useRef)(
|
|
2406
2429
|
null
|
|
2407
2430
|
);
|
|
2408
|
-
const dismissed = (0,
|
|
2409
|
-
const createDraft = (0,
|
|
2431
|
+
const dismissed = (0, import_react9.useRef)(/* @__PURE__ */ new Map());
|
|
2432
|
+
const createDraft = (0, import_react9.useRef)("");
|
|
2410
2433
|
const petVisible = controller.library?.config.visible === true;
|
|
2411
|
-
(0,
|
|
2434
|
+
(0, import_react9.useEffect)(() => {
|
|
2412
2435
|
if (!petVisible) {
|
|
2413
2436
|
setState(
|
|
2414
2437
|
(current) => current.items.length === 0 && current.activity.pose === "idle" && current.hidden === 0 ? current : EMPTY_NOTIFICATIONS
|
|
@@ -2429,7 +2452,7 @@ function Overlay({
|
|
|
2429
2452
|
sessions.releaseBindings();
|
|
2430
2453
|
};
|
|
2431
2454
|
}, [sessions, pending, petVisible]);
|
|
2432
|
-
(0,
|
|
2455
|
+
(0, import_react9.useEffect)(observePetSettingsIcon, []);
|
|
2433
2456
|
const command = async (value) => {
|
|
2434
2457
|
const engine = notifications.current;
|
|
2435
2458
|
if (!engine) throw new Error("\u4F1A\u8BDD\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA");
|
|
@@ -2439,17 +2462,17 @@ function Overlay({
|
|
|
2439
2462
|
}
|
|
2440
2463
|
await engine.command(value);
|
|
2441
2464
|
};
|
|
2442
|
-
const [externalDisplay, setExternalDisplay] = (0,
|
|
2443
|
-
const actions = (0,
|
|
2465
|
+
const [externalDisplay, setExternalDisplay] = (0, import_react9.useState)(false);
|
|
2466
|
+
const actions = (0, import_react9.useRef)({
|
|
2444
2467
|
command,
|
|
2445
2468
|
updateConfig: controller.update,
|
|
2446
2469
|
openSettings
|
|
2447
2470
|
});
|
|
2448
2471
|
actions.current = { command, updateConfig: controller.update, openSettings };
|
|
2449
|
-
const provider = (0,
|
|
2472
|
+
const provider = (0, import_react9.useRef)(
|
|
2450
2473
|
null
|
|
2451
2474
|
);
|
|
2452
|
-
(0,
|
|
2475
|
+
(0, import_react9.useEffect)(() => {
|
|
2453
2476
|
const value = createCompanionProvider({
|
|
2454
2477
|
command: (command2) => actions.current.command(command2),
|
|
2455
2478
|
updateConfig: (config) => actions.current.updateConfig(config),
|
|
@@ -2466,7 +2489,7 @@ function Overlay({
|
|
|
2466
2489
|
window.dispatchEvent(new Event("dsh-pet-disposed"));
|
|
2467
2490
|
};
|
|
2468
2491
|
}, []);
|
|
2469
|
-
(0,
|
|
2492
|
+
(0, import_react9.useEffect)(() => {
|
|
2470
2493
|
const library = controller.library;
|
|
2471
2494
|
provider.current?.publish(
|
|
2472
2495
|
library ? {
|
|
@@ -2616,6 +2639,16 @@ function apply(ctx) {
|
|
|
2616
2639
|
() => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Page, { sessions, locale: ctx.locale })
|
|
2617
2640
|
)
|
|
2618
2641
|
);
|
|
2642
|
+
ctx.slots.inject(
|
|
2643
|
+
"settings.section.icon",
|
|
2644
|
+
() => ctx.slots.register(
|
|
2645
|
+
{
|
|
2646
|
+
name: "settings.section.icon",
|
|
2647
|
+
id: "codex-pet"
|
|
2648
|
+
},
|
|
2649
|
+
PetNavIcon
|
|
2650
|
+
)
|
|
2651
|
+
);
|
|
2619
2652
|
ctx.slots.inject(
|
|
2620
2653
|
"shell.overlay",
|
|
2621
2654
|
() => ctx.slots.register(
|
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.9",
|
|
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",
|