hiwork-core 0.0.6 → 0.0.7

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/lib/client.js CHANGED
@@ -83,6 +83,7 @@ var frameCss = [
83
83
  ].join("\n");
84
84
  var hostHideCss = [
85
85
  `header [class*="sessionLogButton"] { display: none !important; }`,
86
+ `header [class*="moreButton"] { display: none !important; }`,
86
87
  `[class*="settingsArea"] [aria-haspopup="dialog"] { display: none !important; }`
87
88
  ].join("\n");
88
89
  var brandCss = [
@@ -987,7 +988,7 @@ var HERO_STYLE = `
987
988
  [class*="_fishHitbox"],
988
989
  [class*="_previewBadge"]{display:none}
989
990
  [class*="_headline"]:not([class*="_headlineText"]){display:flex;justify-content:center;align-items:center;column-gap:0}
990
- [class*="_headlineText"]{font-size:0}
991
+ [class*="_headlineText"],[class*="_titleGroup"]>span:not([class]){font-size:0}
991
992
  [data-hiwork-hero-greeting]{font-size:26px;line-height:32px;font-weight:500}
992
993
  `;
993
994
  function ensureHeroStyle(doc = document) {
@@ -1006,20 +1007,26 @@ function pickHeroGreeting() {
1006
1007
  lastGreetingIndex = index;
1007
1008
  return HERO_GREETINGS[index];
1008
1009
  }
1010
+ function resolveHeroGreetingAnchor(root = document) {
1011
+ const hero = root.querySelector('[data-phase="hero"]');
1012
+ if (hero === null) return null;
1013
+ const legacy = hero.querySelector('[class$="_headlineText"]');
1014
+ if (legacy !== null) return legacy;
1015
+ return hero.querySelector('[class$="_titleGroup"]');
1016
+ }
1009
1017
  function decorateHeroGreeting(doc) {
1010
- const hero = doc.querySelector('[data-phase="hero"]');
1011
- const text = hero?.querySelector('[class$="_headlineText"]') ?? null;
1012
- if (hero === null || text === null) {
1018
+ const anchor = resolveHeroGreetingAnchor(doc);
1019
+ if (anchor === null) {
1013
1020
  removeStaleHeroGreeting(doc);
1014
1021
  return;
1015
1022
  }
1016
- const next = text.nextElementSibling;
1023
+ const next = anchor.nextElementSibling;
1017
1024
  if (next !== null && next.hasAttribute("data-hiwork-hero-greeting")) return;
1018
1025
  removeStaleHeroGreeting(doc);
1019
1026
  const span = doc.createElement("span");
1020
1027
  span.dataset.hiworkHeroGreeting = "";
1021
1028
  span.textContent = `${HERO_GREETING_PREFIX}${pickHeroGreeting()}`;
1022
- text.after(span);
1029
+ anchor.after(span);
1023
1030
  }
1024
1031
  function removeStaleHeroGreeting(doc) {
1025
1032
  for (const stale of Array.from(doc.querySelectorAll("[data-hiwork-hero-greeting]"))) stale.remove();
package/lib/index.js CHANGED
@@ -2545,7 +2545,7 @@ var Service = class Service2 {
2545
2545
  }
2546
2546
  };
2547
2547
 
2548
- // node_modules/.pnpm/@deepseek-ai+dsh-util-values@0.1.2-rc.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-util-values/lib/index.js
2548
+ // node_modules/.pnpm/@deepseek-ai+dsh-util-values@0.1.5-rc.1_@deepseek-ai+cordis@4.0.2/node_modules/@deepseek-ai/dsh-util-values/lib/index.js
2549
2549
  function deepEqualJson(a, b) {
2550
2550
  if (a === b) return true;
2551
2551
  if (typeof a !== "object" || typeof b !== "object" || a === null || b === null) return false;
@@ -2595,7 +2595,7 @@ function deepFreeze(value) {
2595
2595
  return value;
2596
2596
  }
2597
2597
 
2598
- // node_modules/.pnpm/@deepseek-ai+dsh-settings@0.1.2-rc.1_@deepseek-ai+cordis@4.0.2_@deepseek-ai+dsh-brand@0_1a9c14ce482b5dfab9823d79763d2768/node_modules/@deepseek-ai/dsh-settings/lib/index.js
2598
+ // node_modules/.pnpm/@deepseek-ai+dsh-settings@0.1.5-rc.1_@deepseek-ai+cordis@4.0.2_@deepseek-ai+dsh-brand@0_c134faa87a7ceb824972e79be819aa9b/node_modules/@deepseek-ai/dsh-settings/lib/index.js
2599
2599
  function isRecord(value) {
2600
2600
  return typeof value === "object" && value !== null && !Array.isArray(value);
2601
2601
  }
@@ -3137,7 +3137,7 @@ function isUnloading(ctx) {
3137
3137
  }
3138
3138
 
3139
3139
  // src/version.ts
3140
- var PKG_VERSION = false ? "dev" : "0.0.6";
3140
+ var PKG_VERSION = false ? "dev" : "0.0.7";
3141
3141
 
3142
3142
  // src/ai-router-client.ts
3143
3143
  var AUTH_AUTHORIZE_PATH = "/api/auth/authorize";
@@ -4,7 +4,7 @@
4
4
  * 前缀固定保留,候选每次进入 hero 页时随机切换(排除上一条,不重复);
5
5
  * 同时隐藏鱼形品牌标记与「预览版」徽标。
6
6
  *
7
- * 实现:宿主 headlineText 用 CSS 归零隐藏,问候语是插件自有(data-hiwork-hero-greeting
7
+ * 实现:宿主标题节点用 CSS 归零隐藏,问候语是插件自有(data-hiwork-hero-greeting
8
8
  * 标记)的相邻 span,由观察器幂等插入——不搬移/不改写宿主节点,宿主重建 hero 时自动
9
9
  * 重挂并换下一条,非 hero 阶段自动清残留。样式 id 改用 hiwork 前缀:本模块已是
10
10
  * dsh-ui 静态 ::after 版的超集,两版并存会双份文案。
@@ -14,13 +14,22 @@ export declare const HERO_GREETINGS: readonly string[];
14
14
  /** 固定前缀:所有候选共用,轮换的只是后半句。 */
15
15
  export declare const HERO_GREETING_PREFIX = "HiWork\uFF0C";
16
16
  export declare const HERO_STYLE_ID = "hiwork-conversation-hero-style";
17
- export declare const HERO_STYLE = "\n[class*=\"_fishHitbox\"],\n[class*=\"_previewBadge\"]{display:none}\n[class*=\"_headline\"]:not([class*=\"_headlineText\"]){display:flex;justify-content:center;align-items:center;column-gap:0}\n[class*=\"_headlineText\"]{font-size:0}\n[data-hiwork-hero-greeting]{font-size:26px;line-height:32px;font-weight:500}\n";
17
+ export declare const HERO_STYLE = "\n[class*=\"_fishHitbox\"],\n[class*=\"_previewBadge\"]{display:none}\n[class*=\"_headline\"]:not([class*=\"_headlineText\"]){display:flex;justify-content:center;align-items:center;column-gap:0}\n[class*=\"_headlineText\"],[class*=\"_titleGroup\"]>span:not([class]){font-size:0}\n[data-hiwork-hero-greeting]{font-size:26px;line-height:32px;font-weight:500}\n";
18
18
  export declare function ensureHeroStyle(doc?: Document): void;
19
19
  /** 随机取一条候选;命中上一条时顺移一位,保证连续两次不重复。 */
20
20
  export declare function pickHeroGreeting(): string;
21
21
  /**
22
- * 幂等装饰:hero / headlineText 缺失 → 只清残留;问候 span 已紧邻 headlineText →
23
- * 不动(观察循环不得反复重掷);否则清掉旧 span 后在 headlineText 之后插入新随机一条。
22
+ * hero 标题的插入锚点:问候语挂在它后面,样式表按同一份标记归零宿主标题。
23
+ *
24
+ * - `0.1.2-rc.1` 及更早:标题文本是 `*_headlineText` 自身。
25
+ * - `0.1.5-rc.1` 起:标题文本移进 `*_titleGroup` 的无类名 span(徽标走
26
+ * `*_previewBadge`),`*_headlineText` 已不存在;此时锚点取 titleGroup,
27
+ * 避免问候语落进 titleGroup 内部而继承它的归零字号。
28
+ */
29
+ export declare function resolveHeroGreetingAnchor(root?: ParentNode): HTMLElement | null;
30
+ /**
31
+ * 幂等装饰:找不到 hero 标题锚点 → 只清残留;问候 span 已紧邻锚点 →
32
+ * 不动(观察循环不得反复重掷);否则清掉旧 span 后在锚点之后插入新随机一条。
24
33
  */
25
34
  export declare function decorateHeroGreeting(doc: Document): void;
26
35
  /** 清理非 hero / 槽位变化后残留的问候节点。 */
@@ -67,15 +67,21 @@ export declare const frameSurfaceSelector = "[class*=\"_frame\"]:has(> [class*=\
67
67
  export declare const frameCss: string;
68
68
  /**
69
69
  * 隐藏宿主动作入口:
70
- * - 会话头部右上角「Session 日志」下载按钮(产品要求不暴露会话日志导出);
70
+ * - 会话头部右上角「Session 日志」导出入口(产品要求不暴露会话日志导出);
71
71
  * - 侧栏底部官方「设置」触发钮:账号行(sidebar.footer.action)自带设置入口。
72
72
  * 注意官方设置弹窗面板 portal 在 settingsArea 容器内部渲染,只能隐藏触发钮
73
73
  * 本身(settingsArea 整区 display:none 会连弹窗一起藏掉);触发钮留在 DOM 里
74
74
  * 供 openSettingsSection 程序化点击(display:none 不影响 .click() 派发,
75
75
  * dsh-ui 同款做法),弹窗照常打开。
76
- * 均按 CSS module 语义后缀命中(hash 前缀无关;运行版实测
77
- * nL4_yW_sessionLogButton / hHd-Xa_settingsArea)。display:none 同时移出
78
- * 无障碍树与 Tab 焦点链。后续要隐藏其他宿主入口,规则追加到这里。
76
+ * 均按 CSS module 语义后缀命中(hash 前缀无关)。display:none 同时移出无障碍树与
77
+ * Tab 焦点链。后续要隐藏其他宿主入口,规则追加到这里。
78
+ *
79
+ * Session 导出的两种宿主形态(规则并存,旧版留着不影响新版):
80
+ * - `0.1.2-rc.1`:`dsh-session-log-export` 在 utilities 槽直接渲染下载按钮
81
+ * (运行版实测 `nL4_yW_sessionLogButton`);
82
+ * - `0.1.5-rc.1` 起:同一个插件改渲染「更多操作」省略号按钮,菜单里只有
83
+ * 「下载 Session 日志」一项(`*_moreButton`,全量客户端 bundle 实测唯一,
84
+ * 见 dsh-session-log-export/lib/client.js)。整钮隐藏即满足同一产品要求。
79
85
  */
80
86
  export declare const hostHideCss: string;
81
87
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hiwork-core",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "description": "HiWork 企业统一登录与模型自动供给插件(ai-router 网关登录,Web 表单,无 CLI 认证)",
6
6
  "license": "UNLICENSED",
@@ -43,23 +43,23 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@deepseek-ai/cordis": "4.0.2",
46
- "@deepseek-ai/dsh-api-remotes": "0.1.2-rc.1",
47
- "@deepseek-ai/dsh-client-store": "0.1.2-rc.1",
48
- "@deepseek-ai/dsh-client-ui-chat": "0.1.2-rc.1",
49
- "@deepseek-ai/dsh-client-ui-conversation": "0.1.2-rc.1",
50
- "@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1",
51
- "@deepseek-ai/dsh-client-ui-renderer": "0.1.2-rc.1",
52
- "@deepseek-ai/dsh-client-ui-session": "0.1.2-rc.1",
53
- "@deepseek-ai/dsh-client-ui-settings": "0.1.2-rc.1",
54
- "@deepseek-ai/dsh-client-ui-sidebar": "0.1.2-rc.1",
55
- "@deepseek-ai/dsh-client-ui-slots": "0.1.2-rc.1",
56
- "@deepseek-ai/dsh-credentials": "0.1.2-rc.1",
57
- "@deepseek-ai/dsh-credentials-local": "0.1.2-rc.1",
58
- "@deepseek-ai/dsh-llm": "0.1.2-rc.1",
59
- "@deepseek-ai/dsh-llm-pi-ai": "0.1.2-rc.1",
60
- "@deepseek-ai/dsh-settings": "0.1.2-rc.1",
61
- "@deepseek-ai/dsh-settings-file": "0.1.2-rc.1",
62
- "@deepseek-ai/dsh-workspace": "0.1.2-rc.1",
46
+ "@deepseek-ai/dsh-api-remotes": "0.1.5-rc.1",
47
+ "@deepseek-ai/dsh-client-store": "0.1.5-rc.1",
48
+ "@deepseek-ai/dsh-client-ui-chat": "0.1.5-rc.1",
49
+ "@deepseek-ai/dsh-client-ui-conversation": "0.1.5-rc.1",
50
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.5-rc.1",
51
+ "@deepseek-ai/dsh-client-ui-renderer": "0.1.5-rc.1",
52
+ "@deepseek-ai/dsh-client-ui-session": "0.1.5-rc.1",
53
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.5-rc.1",
54
+ "@deepseek-ai/dsh-client-ui-sidebar": "0.1.5-rc.1",
55
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.5-rc.1",
56
+ "@deepseek-ai/dsh-credentials": "0.1.5-rc.1",
57
+ "@deepseek-ai/dsh-credentials-local": "0.1.5-rc.1",
58
+ "@deepseek-ai/dsh-llm": "0.1.5-rc.1",
59
+ "@deepseek-ai/dsh-llm-pi-ai": "0.1.5-rc.1",
60
+ "@deepseek-ai/dsh-settings": "0.1.5-rc.1",
61
+ "@deepseek-ai/dsh-settings-file": "0.1.5-rc.1",
62
+ "@deepseek-ai/dsh-workspace": "0.1.5-rc.1",
63
63
  "@deepseek-ai/schemastery": "3.18.2",
64
64
  "@types/node": "^22",
65
65
  "@types/react": "^18",