@michengai/dsh-codex-pet 1.0.8 → 1.0.12

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.12] - 2026-11-03
4
+
5
+ - Accurately detect settings nav icon slot container: only skip DOM pseudo-element when span.navIcon container is present, preventing dual icons on newer hosts while maintaining single icon compatibility on older hosts.
6
+
7
+ ## [1.0.9] - 2026-11-03
8
+
9
+ - 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.
10
+
3
11
  ## [1.0.8] - 2026-11-03
4
12
 
5
13
  - 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.
@@ -1,5 +1,13 @@
1
1
  # 更新日志
2
2
 
3
+ ## [1.0.12] - 2026-11-03
4
+
5
+ - 设置导航图标精准识别宿主插槽容器:仅在存在 span.navIcon 容器时主动避让 DOM 伪元素,避免新版宿主双图标重叠与老版宿主单图标兼容异常。
6
+
7
+ ## [1.0.9] - 2026-11-03
8
+
9
+ - 适配最新 DSH 宿主规范:全面支持 DSH 最新预发布版本 `0.2.2-alpha.3` 与全系 RC(覆盖至 `0.2.1-rc.5`),在设置页接入官方原生导航图标插槽,确保宠物设置项在最新宿主中正常展示矢量图标。
10
+
3
11
  ## [1.0.8] - 2026-11-03
4
12
 
5
13
  - 卡顿显著消失:插件不再为了收集通知而逐个打开会话。此前会话多的机器启动、窗口最大化、切换视图都会连续卡上几十秒,现在与不装插件的水平一致。
package/lib/client.js CHANGED
@@ -291,7 +291,7 @@ function translator(language) {
291
291
  }
292
292
 
293
293
  // src/client.tsx
294
- var import_react8 = require("react");
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.8"
864
+ "1.0.12"
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
  )}")`;
@@ -2262,6 +2285,16 @@ function isPetNavRow(button) {
2262
2285
  function applyPetSettingsIcon(button) {
2263
2286
  const isOwn = isPetNavRow(button);
2264
2287
  if (isOwn) {
2288
+ const hasSlotIcon = Array.from(button.children).some(
2289
+ (child) => child.tagName === "SPAN" && child.className && String(child.className).includes("navIcon")
2290
+ ) || Boolean(button.querySelector?.('span[class*="navIcon"]'));
2291
+ if (hasSlotIcon) {
2292
+ if (button.hasAttribute(PET_NAV_ICON_MARKER)) {
2293
+ button.removeAttribute(PET_NAV_ICON_MARKER);
2294
+ return true;
2295
+ }
2296
+ return false;
2297
+ }
2265
2298
  if (button.getAttribute(PET_NAV_ICON_MARKER) === "") return false;
2266
2299
  button.setAttribute(PET_NAV_ICON_MARKER, "");
2267
2300
  return true;
@@ -2352,11 +2385,11 @@ function observePetSettingsIcon() {
2352
2385
  }
2353
2386
 
2354
2387
  // src/global-overlay.tsx
2355
- var import_react7 = require("react");
2388
+ var import_react8 = require("react");
2356
2389
  var import_react_dom = require("react-dom");
2357
2390
  function GlobalOverlay({ children }) {
2358
- const [container, setContainer] = (0, import_react7.useState)(null);
2359
- (0, import_react7.useEffect)(() => {
2391
+ const [container, setContainer] = (0, import_react8.useState)(null);
2392
+ (0, import_react8.useEffect)(() => {
2360
2393
  const element = document.createElement("div");
2361
2394
  element.setAttribute("data-dsh-pet-overlay", "");
2362
2395
  element.style.cssText = "position:fixed;left:0;top:0;width:0;height:0;overflow:visible;z-index:2147483000;pointer-events:none";
@@ -2395,20 +2428,20 @@ function Overlay({
2395
2428
  }) {
2396
2429
  const controller = usePetController(locale);
2397
2430
  const t = translator(controller.language);
2398
- const [settingsOpen, setSettingsOpen] = (0, import_react8.useState)(false);
2399
- (0, import_react8.useEffect)(() => {
2431
+ const [settingsOpen, setSettingsOpen] = (0, import_react9.useState)(false);
2432
+ (0, import_react9.useEffect)(() => {
2400
2433
  const show = () => setSettingsOpen(true);
2401
2434
  window.addEventListener("dcp-open-settings", show);
2402
2435
  return () => window.removeEventListener("dcp-open-settings", show);
2403
2436
  }, []);
2404
- const [state, setState] = (0, import_react8.useState)(EMPTY_NOTIFICATIONS);
2405
- const notifications = (0, import_react8.useRef)(
2437
+ const [state, setState] = (0, import_react9.useState)(EMPTY_NOTIFICATIONS);
2438
+ const notifications = (0, import_react9.useRef)(
2406
2439
  null
2407
2440
  );
2408
- const dismissed = (0, import_react8.useRef)(/* @__PURE__ */ new Map());
2409
- const createDraft = (0, import_react8.useRef)("");
2441
+ const dismissed = (0, import_react9.useRef)(/* @__PURE__ */ new Map());
2442
+ const createDraft = (0, import_react9.useRef)("");
2410
2443
  const petVisible = controller.library?.config.visible === true;
2411
- (0, import_react8.useEffect)(() => {
2444
+ (0, import_react9.useEffect)(() => {
2412
2445
  if (!petVisible) {
2413
2446
  setState(
2414
2447
  (current) => current.items.length === 0 && current.activity.pose === "idle" && current.hidden === 0 ? current : EMPTY_NOTIFICATIONS
@@ -2429,7 +2462,7 @@ function Overlay({
2429
2462
  sessions.releaseBindings();
2430
2463
  };
2431
2464
  }, [sessions, pending, petVisible]);
2432
- (0, import_react8.useEffect)(observePetSettingsIcon, []);
2465
+ (0, import_react9.useEffect)(observePetSettingsIcon, []);
2433
2466
  const command = async (value) => {
2434
2467
  const engine = notifications.current;
2435
2468
  if (!engine) throw new Error("\u4F1A\u8BDD\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA");
@@ -2439,17 +2472,17 @@ function Overlay({
2439
2472
  }
2440
2473
  await engine.command(value);
2441
2474
  };
2442
- const [externalDisplay, setExternalDisplay] = (0, import_react8.useState)(false);
2443
- const actions = (0, import_react8.useRef)({
2475
+ const [externalDisplay, setExternalDisplay] = (0, import_react9.useState)(false);
2476
+ const actions = (0, import_react9.useRef)({
2444
2477
  command,
2445
2478
  updateConfig: controller.update,
2446
2479
  openSettings
2447
2480
  });
2448
2481
  actions.current = { command, updateConfig: controller.update, openSettings };
2449
- const provider = (0, import_react8.useRef)(
2482
+ const provider = (0, import_react9.useRef)(
2450
2483
  null
2451
2484
  );
2452
- (0, import_react8.useEffect)(() => {
2485
+ (0, import_react9.useEffect)(() => {
2453
2486
  const value = createCompanionProvider({
2454
2487
  command: (command2) => actions.current.command(command2),
2455
2488
  updateConfig: (config) => actions.current.updateConfig(config),
@@ -2466,7 +2499,7 @@ function Overlay({
2466
2499
  window.dispatchEvent(new Event("dsh-pet-disposed"));
2467
2500
  };
2468
2501
  }, []);
2469
- (0, import_react8.useEffect)(() => {
2502
+ (0, import_react9.useEffect)(() => {
2470
2503
  const library = controller.library;
2471
2504
  provider.current?.publish(
2472
2505
  library ? {
@@ -2616,6 +2649,16 @@ function apply(ctx) {
2616
2649
  () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Page, { sessions, locale: ctx.locale })
2617
2650
  )
2618
2651
  );
2652
+ ctx.slots.inject(
2653
+ "settings.section.icon",
2654
+ () => ctx.slots.register(
2655
+ {
2656
+ name: "settings.section.icon",
2657
+ id: "codex-pet"
2658
+ },
2659
+ PetNavIcon
2660
+ )
2661
+ );
2619
2662
  ctx.slots.inject(
2620
2663
  "shell.overlay",
2621
2664
  () => ctx.slots.register(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@michengai/dsh-codex-pet",
3
- "version": "1.0.8",
3
+ "version": "1.0.12",
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",