@zhin.js/adapter-kook 1.1.21 → 1.1.23

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,73 @@
1
1
  # @zhin.js/adapter-kook
2
2
 
3
+ ## 1.1.23
4
+
5
+ ### Patch Changes
6
+
7
+ - bc6ccb1: Deep audit bug fixes and 7 architectural improvements:
8
+ - Sink Agent Turn ingress pipeline from `@zhin.js/cli` into `@zhin.js/agent/runtime` (`plugin-runtime/ingress/`) and decompose `ingress-route.ts` into modular pipeline stages.
9
+ - Bind Session State Plane (`JsxButtonRegistry`, `InteractionRuntime`, `RuntimeInteractiveRouter`) to `PluginIncarnationRef` so active buttons and interactions survive unrelated-plugin HMR while expiring when the owning plugin reloads, and support per-conversation fallback numbering (`numberingScope: 'conversation'`).
10
+ - Establish `conversation_events` as the canonical message SSOT and reference `conversation_event_id`, `conversation_key`, `platform_message_id`, and `message_key` in `agent_messages` (`AGENT_MESSAGE_QUERY_VERSION = 2`), threading `conversationSequence` across inbound and outbound delivery receipts.
11
+ - Push down `DatabaseContextRepository` and `DatabaseScheduleJobStorage` full-session/full-table memory scans to indexed SQL queries.
12
+ - Add kernel-level inbound `replyTo` and `mentioned` auto-promotion (`promoteInboundMessagePayload`) plus reusable `InboundDeduper` and `TtlLookupCache` primitives in `@zhin.js/adapter`.
13
+ - Add `MiddlewareContext.dispatch` (`InboundDispatchSummary`) and `onAfterDispatch` hooks for `after-dispatch` middlewares, and support incremental rendering of in-place `envelope.payload` array mutations in `OutboundDeliveryRuntime`.
14
+ - Unify `HistoryWindowTracker` and `AgentCompactionRuntime` token/message budgets (`resolveUnifiedHistoryAndCompactionBudget`).
15
+ - Fix schema validation, database transaction connection cleanup and SQLite WAL mode, schedule timer wheel head-of-line blocking, security policy bash read paths and subagent guard propagation, group merge window permission carrier handoff, micro-compact namespaced tool matching, and WebSocket force-close / inbound segment mapping across adapters.
16
+ - Updated dependencies [3a8504b]
17
+ - Updated dependencies [6163abc]
18
+ - Updated dependencies [fed2c27]
19
+ - Updated dependencies [bc6ccb1]
20
+ - Updated dependencies [72b5a12]
21
+ - Updated dependencies [aa41889]
22
+ - Updated dependencies [4427e72]
23
+ - Updated dependencies [22bd14a]
24
+ - @zhin.js/agent-feature@1.1.14
25
+ - @zhin.js/core@1.1.57
26
+ - @zhin.js/client@1.1.25
27
+ - @zhin.js/page@1.1.15
28
+ - @zhin.js/im-contract@1.1.12
29
+ - @zhin.js/adapter@1.1.29
30
+ - @zhin.js/host-http@1.1.15
31
+ - @zhin.js/feature-kit@1.1.13
32
+ - @zhin.js/tool@1.1.16
33
+ - @zhin.js/permission@1.1.13
34
+ - @zhin.js/skill@1.1.14
35
+
36
+ ## 1.1.22
37
+
38
+ ### Patch Changes
39
+
40
+ - b249e5e: ADR 0044 C4:事件映射迁出 core。新增 `@zhin.js/adapter-onebot-events`,承载 OneBot v11 / NapCat / icqq 的原始通知与请求 → 标准事件映射(`receiveOneBotLikeSideEvent`、`mapNoticeParts`、`mapRequestParts`、`resolveSideEventDedupeKey` 及 OneBot 映射表,icqq 差异用覆盖表表达);KOOK、Slack 的映射迁入各自适配器;`@zhin.js/core` 只保留标准事件名、类型与 `buildNotice` / `buildRequest` / `buildSystem` / `senderFromId`,不再含任何平台名。core 不再导出上述映射函数与 `ONEBOT_/KOOK_/SLACK_NOTICE_PARTS_MAP`、`SideEventPlatform`、`OneBotLike*` 类型,适配器改从共享包导入。
41
+ - 41ff1a5: ADR 0044 C5: every official adapter now declares a capability `profile` (its `segments` moved into `profile.default.messaging.segments`). icqq declares the complete profile (per conversation kind: scene, all 14 actions with real limits, events, feedback, delivery) and implements the seven new management ports (`pokeUser`, `unmuteGroupMember`, `muteAllGroupMembers`, `setGroupCard`, `setGroupTitle`, `setGroupEssence`, `inviteGroupMember`) with fresh bot-role reads. qq official declares its passive reply windows; undeclared capabilities stay unsupported.
42
+ - cbd3f14: ADR 0044 integration and C6 guard. `delivery.spool` now reproduces the pre-0044 media rule (icqq `false`, every other official adapter `true`). icqq narrows `actions.recall.others` unless the Bot is admin or owner, and declares recall for groups. Endpoint kind capabilities merge the Endpoint's `operations` (Discord reactions keep working; Discord declares reaction feedback). Adapters in the `@zhin.js/` scope are trusted: their custom prompt text is not labelled `external_content`. Core no longer keeps a telegram/discord interactive-policy table (adapters declare `segments.interactive`). New `pnpm check:no-platform-branches` blocks platform-name branches in runtime code.
43
+ - 4fe49b5: 支持配置按需生效:分离保存与有效版本,独立变更先应用,账号资料更新保留连接,模型按回合使用确定版本;Console 返回结构化应用结果。监听改为仅显式 --watch 启用,开发模板显式选择源码和配置监听。
44
+
45
+ 自变更消费配置应用回执,避免已处理配置被二次重载;持久化本次写入修订和应用结果,未知结果或修订冲突时停止自动续作并保留现场,恢复不会覆盖未经本次变更确认的配置。
46
+
47
+ - Updated dependencies [b249e5e]
48
+ - Updated dependencies [57661f6]
49
+ - Updated dependencies [cbd3f14]
50
+ - Updated dependencies [299863a]
51
+ - Updated dependencies [aaa93d7]
52
+ - Updated dependencies [bd524d1]
53
+ - Updated dependencies [126ae99]
54
+ - Updated dependencies [4fe49b5]
55
+ - Updated dependencies [cce07db]
56
+ - Updated dependencies [b652db3]
57
+ - Updated dependencies [0315ba0]
58
+ - Updated dependencies [00be764]
59
+ - @zhin.js/core@1.1.56
60
+ - @zhin.js/adapter@1.1.28
61
+ - @zhin.js/im-contract@1.1.11
62
+ - @zhin.js/tool@1.1.15
63
+ - @zhin.js/skill@1.1.13
64
+ - @zhin.js/host-http@1.1.14
65
+ - @zhin.js/feature-kit@1.1.12
66
+ - @zhin.js/client@1.1.24
67
+ - @zhin.js/page@1.1.14
68
+ - @zhin.js/agent-feature@1.1.13
69
+ - @zhin.js/permission@1.1.12
70
+
3
71
  ## 1.1.21
4
72
 
5
73
  ### Patch Changes
@@ -9,13 +9,25 @@ import {} from "../../lib/protocol.js";
9
9
  export { KookWebhookEndpoint, KookWebsocketEndpoint, } from "../../lib/endpoint.js";
10
10
  export default defineAdapter({
11
11
  capabilities: ['inbound', 'outbound'],
12
- operations: ['recall'],
13
12
  // KOOK 图片上传后以原生卡片保留图文混排;KMarkdown 原生消费;
14
13
  // 原生卡片按钮经 return-val 事件进入 canonical action 链路。
15
- segments: {
16
- outboundMedia: ['url', 'upload'],
17
- interactive: 'native',
18
- markdown: 'native',
14
+ profile: {
15
+ default: {
16
+ messaging: {
17
+ segments: {
18
+ outboundMedia: ['url', 'upload'],
19
+ interactive: 'native',
20
+ markdown: 'native',
21
+ },
22
+ quote: true,
23
+ recall: {},
24
+ },
25
+ actions: {
26
+ recall: { scopes: ['private', 'group', 'channel'] },
27
+ quoteReply: { scopes: ['private', 'group', 'channel'] },
28
+ },
29
+ delivery: { send: true, proactive: true, spool: true },
30
+ },
19
31
  },
20
32
  createAdapter: context => new KookAdapter(context),
21
33
  });
@@ -20,13 +20,25 @@ export type { KookClientTransport } from '../../src/ws.js';
20
20
 
21
21
  export default defineAdapter<KookEndpointConfig>({
22
22
  capabilities: ['inbound', 'outbound'],
23
- operations: ['recall'],
24
23
  // KOOK 图片上传后以原生卡片保留图文混排;KMarkdown 原生消费;
25
24
  // 原生卡片按钮经 return-val 事件进入 canonical action 链路。
26
- segments: {
27
- outboundMedia: ['url', 'upload'],
28
- interactive: 'native',
29
- markdown: 'native',
25
+ profile: {
26
+ default: {
27
+ messaging: {
28
+ segments: {
29
+ outboundMedia: ['url', 'upload'],
30
+ interactive: 'native',
31
+ markdown: 'native',
32
+ },
33
+ quote: true,
34
+ recall: {},
35
+ },
36
+ actions: {
37
+ recall: { scopes: ['private', 'group', 'channel'] },
38
+ quoteReply: { scopes: ['private', 'group', 'channel'] },
39
+ },
40
+ delivery: { send: true, proactive: true, spool: true },
41
+ },
30
42
  },
31
43
  createAdapter: context => new KookAdapter(context),
32
44
  });
@@ -1,11 +1,3 @@
1
- /**
2
- * KOOK 入站发送者角色投影。
3
- *
4
- * 事件只携带数字角色 id,无法直接判断群主 / 管理员;这里按服务器缓存
5
- * guild.view(群主 id)与 guild-role.list(角色权限位),把发送者投影为
6
- * 跨平台规范角色 owner / admin。原始角色 id 以 `role:<id>` 形式放入 permissions,
7
- * 不进入 `sender.roles`。
8
- */
9
1
  import type { KookClientTransport } from './ws.js';
10
2
  export interface KookSenderRoleProjection {
11
3
  /** 规范角色:owner / admin;普通成员为 undefined。 */
@@ -1,11 +1,18 @@
1
+ /**
2
+ * KOOK 入站发送者角色投影。
3
+ *
4
+ * 事件只携带数字角色 id,无法直接判断群主 / 管理员;这里按服务器缓存
5
+ * guild.view(群主 id)与 guild-role.list(角色权限位),把发送者投影为
6
+ * 跨平台规范角色 owner / admin。原始角色 id 以 `role:<id>` 形式放入 permissions,
7
+ * 不进入 `sender.roles`。
8
+ */
9
+ import { TtlLookupCache } from 'zhin.js/adapter';
1
10
  /** KOOK 角色权限位:0x1 = 管理员。 */
2
11
  const KOOK_ROLE_ADMIN_BIT = 1;
3
12
  const CACHE_TTL_MS = 60_000;
4
13
  export class KookSenderRoleResolver {
5
14
  getClient;
6
- #guilds = new Map();
7
- /** One lookup per guild at a time: concurrent messages on a cache miss share it. */
8
- #lookups = new Map();
15
+ #guilds = new TtlLookupCache({ ttlMs: CACHE_TTL_MS });
9
16
  constructor(getClient) {
10
17
  this.getClient = getClient;
11
18
  }
@@ -24,18 +31,11 @@ export class KookSenderRoleResolver {
24
31
  return { permissions };
25
32
  }
26
33
  async #snapshot(guildId) {
27
- const cached = this.#guilds.get(guildId);
28
- if (cached && Date.now() - cached.at < CACHE_TTL_MS)
29
- return cached;
30
- let lookup = this.#lookups.get(guildId);
31
- if (!lookup) {
32
- lookup = this.#fetch(guildId).finally(() => this.#lookups.delete(guildId));
33
- this.#lookups.set(guildId, lookup);
34
- }
35
- return lookup;
34
+ return this.#guilds.getOrLoad(guildId, () => this.#fetch(guildId), {
35
+ cacheWhen: (snapshot) => snapshot !== undefined,
36
+ });
36
37
  }
37
38
  async #fetch(guildId) {
38
- const now = Date.now();
39
39
  const client = this.getClient();
40
40
  if (!client)
41
41
  return undefined;
@@ -54,8 +54,6 @@ export class KookSenderRoleResolver {
54
54
  }
55
55
  }
56
56
  catch { /* 保守:视为无管理员角色 */ }
57
- const snapshot = { at: now, ...(ownerId ? { ownerId } : {}), adminRoleIds };
58
- this.#guilds.set(guildId, snapshot);
59
- return snapshot;
57
+ return { ...(ownerId ? { ownerId } : {}), adminRoleIds };
60
58
  }
61
59
  }
@@ -1,5 +1,6 @@
1
- import { composeSideEventName, buildNotice, mapNoticeParts, senderFromId, KOOK_NOTICE_PARTS_MAP } from '@zhin.js/core';
1
+ import { composeSideEventName, buildNotice, senderFromId } from '@zhin.js/core';
2
2
  import { formatCompact } from '@zhin.js/logger';
3
+ import { mapKookNoticeParts } from './side-event-map.js';
3
4
  function extractKookNoticeType(raw) {
4
5
  if (!raw || typeof raw !== 'object')
5
6
  return null;
@@ -16,10 +17,10 @@ export function receiveKookSideEvent(emit, configId, raw, logger) {
16
17
  const noticeType = extractKookNoticeType(raw);
17
18
  if (!noticeType)
18
19
  return false;
19
- if (!Object.prototype.hasOwnProperty.call(KOOK_NOTICE_PARTS_MAP, noticeType))
20
+ const parts = mapKookNoticeParts(noticeType);
21
+ if (!parts)
20
22
  return false;
21
23
  const event = raw;
22
- const parts = mapNoticeParts('kook', noticeType);
23
24
  const body = event.extra?.body;
24
25
  const guildId = event.extra?.guild_id
25
26
  ?? (event.channel_type === 'GROUP' && event.type === 255 ? event.target_id : undefined);
@@ -0,0 +1,5 @@
1
+ import type { SideEventParts } from '@zhin.js/core';
2
+ /** KOOK extra.type 原始值 → 标准 scene_type + sub_type */
3
+ export declare const KOOK_NOTICE_PARTS_MAP: Readonly<Record<string, SideEventParts>>;
4
+ /** 已登记的 KOOK 通知映射为标准 scene_type + sub_type;未登记返回 undefined。 */
5
+ export declare function mapKookNoticeParts(raw: string): SideEventParts | undefined;
@@ -0,0 +1,15 @@
1
+ /** KOOK extra.type 原始值 → 标准 scene_type + sub_type */
2
+ export const KOOK_NOTICE_PARTS_MAP = {
3
+ joined_guild: { scene_type: 'group', sub_type: 'member_increase' },
4
+ exited_guild: { scene_type: 'group', sub_type: 'member_decrease' },
5
+ deleted_message: { scene_type: 'group', sub_type: 'recall' },
6
+ deleted_private_message: { scene_type: 'friend', sub_type: 'recall' },
7
+ added_reaction: { scene_type: 'group', sub_type: 'emoji_reaction' },
8
+ deleted_reaction: { scene_type: 'group', sub_type: 'emoji_reaction' },
9
+ private_added_reaction: { scene_type: 'group', sub_type: 'emoji_reaction' },
10
+ private_deleted_reaction: { scene_type: 'group', sub_type: 'emoji_reaction' },
11
+ };
12
+ /** 已登记的 KOOK 通知映射为标准 scene_type + sub_type;未登记返回 undefined。 */
13
+ export function mapKookNoticeParts(raw) {
14
+ return Object.prototype.hasOwnProperty.call(KOOK_NOTICE_PARTS_MAP, raw) ? KOOK_NOTICE_PARTS_MAP[raw] : undefined;
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-kook",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "Zhin.js KOOK adapter for Plugin Runtime (WebSocket gateway or Webhook)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -33,26 +33,26 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "kook-client": "^1.0.5",
36
- "@zhin.js/adapter": "1.1.27",
37
- "@zhin.js/agent-feature": "1.1.12",
38
- "@zhin.js/client": "1.1.23",
36
+ "@zhin.js/adapter": "1.1.29",
37
+ "@zhin.js/agent-feature": "1.1.14",
38
+ "@zhin.js/client": "1.1.25",
39
39
  "@zhin.js/console-contract": "1.1.3",
40
- "@zhin.js/core": "1.1.55",
41
- "@zhin.js/feature-kit": "1.1.11",
42
- "@zhin.js/host-http": "1.1.13",
43
- "@zhin.js/im-contract": "1.1.10",
40
+ "@zhin.js/core": "1.1.57",
41
+ "@zhin.js/feature-kit": "1.1.13",
42
+ "@zhin.js/host-http": "1.1.15",
43
+ "@zhin.js/im-contract": "1.1.12",
44
44
  "@zhin.js/logger": "1.1.2",
45
- "@zhin.js/page": "1.1.13",
46
- "@zhin.js/permission": "1.1.11",
47
- "@zhin.js/skill": "1.1.12",
48
- "@zhin.js/tool": "1.1.14"
45
+ "@zhin.js/page": "1.1.15",
46
+ "@zhin.js/permission": "1.1.13",
47
+ "@zhin.js/skill": "1.1.14",
48
+ "@zhin.js/tool": "1.1.16"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "zod": "^4.0.0",
52
- "@zhin.js/adapter": "^1.1.27",
53
- "@zhin.js/command": "^1.1.13",
54
- "@zhin.js/core": "^1.1.55",
55
- "zhin.js": "^1.1.20"
52
+ "@zhin.js/adapter": "^1.1.29",
53
+ "@zhin.js/command": "^1.1.15",
54
+ "@zhin.js/core": "^1.1.57",
55
+ "zhin.js": "^1.1.22"
56
56
  },
57
57
  "peerDependenciesMeta": {
58
58
  "@zhin.js/command": {
@@ -70,8 +70,8 @@
70
70
  "typescript": "^6.0.3",
71
71
  "vitest": "^4.1.10",
72
72
  "zod": "^4.4.3",
73
- "@zhin.js/host-http": "1.1.13",
74
- "zhin.js": "1.1.20"
73
+ "@zhin.js/host-http": "1.1.15",
74
+ "zhin.js": "1.1.22"
75
75
  },
76
76
  "files": [
77
77
  "adapters",
package/plugin.js CHANGED
@@ -5,6 +5,7 @@ import { checkKookPlatformPermit } from "./lib/platform-permit.js";
5
5
  import { createKookConsoleRpc } from "./lib/console.js";
6
6
  export default definePlugin({
7
7
  name: 'kook',
8
+ configUpdate: { featurePaths: [['nickname'], ['profile'], ['endpoints']] },
8
9
  metadata: {
9
10
  displayName: 'KOOK WebSocket Adapter',
10
11
  },
@@ -6,6 +6,7 @@
6
6
  * 跨平台规范角色 owner / admin。原始角色 id 以 `role:<id>` 形式放入 permissions,
7
7
  * 不进入 `sender.roles`。
8
8
  */
9
+ import { TtlLookupCache } from 'zhin.js/adapter';
9
10
  import type { KookClientTransport } from './ws.js';
10
11
 
11
12
  /** KOOK 角色权限位:0x1 = 管理员。 */
@@ -19,15 +20,12 @@ export interface KookSenderRoleProjection {
19
20
  }
20
21
 
21
22
  interface GuildSnapshot {
22
- readonly at: number;
23
23
  readonly ownerId?: string;
24
24
  readonly adminRoleIds: ReadonlySet<string>;
25
25
  }
26
26
 
27
27
  export class KookSenderRoleResolver {
28
- readonly #guilds = new Map<string, GuildSnapshot>();
29
- /** One lookup per guild at a time: concurrent messages on a cache miss share it. */
30
- readonly #lookups = new Map<string, Promise<GuildSnapshot | undefined>>();
28
+ readonly #guilds = new TtlLookupCache<string, GuildSnapshot | undefined>({ ttlMs: CACHE_TTL_MS });
31
29
 
32
30
  constructor(private readonly getClient: () => KookClientTransport | null) {}
33
31
 
@@ -51,18 +49,12 @@ export class KookSenderRoleResolver {
51
49
  }
52
50
 
53
51
  async #snapshot(guildId: string): Promise<GuildSnapshot | undefined> {
54
- const cached = this.#guilds.get(guildId);
55
- if (cached && Date.now() - cached.at < CACHE_TTL_MS) return cached;
56
- let lookup = this.#lookups.get(guildId);
57
- if (!lookup) {
58
- lookup = this.#fetch(guildId).finally(() => this.#lookups.delete(guildId));
59
- this.#lookups.set(guildId, lookup);
60
- }
61
- return lookup;
52
+ return this.#guilds.getOrLoad(guildId, () => this.#fetch(guildId), {
53
+ cacheWhen: (snapshot): snapshot is GuildSnapshot => snapshot !== undefined,
54
+ });
62
55
  }
63
56
 
64
57
  async #fetch(guildId: string): Promise<GuildSnapshot | undefined> {
65
- const now = Date.now();
66
58
  const client = this.getClient();
67
59
  if (!client) return undefined;
68
60
  let ownerId: string | undefined;
@@ -76,8 +68,6 @@ export class KookSenderRoleResolver {
76
68
  if ((Number(role.permissions) & KOOK_ROLE_ADMIN_BIT) !== 0) adminRoleIds.add(String(role.role_id));
77
69
  }
78
70
  } catch { /* 保守:视为无管理员角色 */ }
79
- const snapshot: GuildSnapshot = { at: now, ...(ownerId ? { ownerId } : {}), adminRoleIds };
80
- this.#guilds.set(guildId, snapshot);
81
- return snapshot;
71
+ return { ...(ownerId ? { ownerId } : {}), adminRoleIds };
82
72
  }
83
73
  }
@@ -1,7 +1,8 @@
1
- import { composeSideEventName, buildNotice, mapNoticeParts, senderFromId, KOOK_NOTICE_PARTS_MAP } from '@zhin.js/core';
1
+ import { composeSideEventName, buildNotice, senderFromId } from '@zhin.js/core';
2
2
  import type { EndpointEventEmitter } from 'zhin.js/adapter';
3
3
  import { formatCompact, type getAdapterLogger } from '@zhin.js/logger';
4
4
  import type { KookWebhookEventData } from './protocol.js';
5
+ import { mapKookNoticeParts } from './side-event-map.js';
5
6
 
6
7
  function extractKookNoticeType(raw: unknown): string | null {
7
8
  if (!raw || typeof raw !== 'object') return null;
@@ -22,9 +23,9 @@ export function receiveKookSideEvent(
22
23
  ): boolean {
23
24
  const noticeType = extractKookNoticeType(raw);
24
25
  if (!noticeType) return false;
25
- if (!Object.prototype.hasOwnProperty.call(KOOK_NOTICE_PARTS_MAP, noticeType)) return false;
26
+ const parts = mapKookNoticeParts(noticeType);
27
+ if (!parts) return false;
26
28
  const event = raw as KookWebhookEventData;
27
- const parts = mapNoticeParts('kook', noticeType);
28
29
  const body = event.extra?.body;
29
30
  const guildId = event.extra?.guild_id
30
31
  ?? (event.channel_type === 'GROUP' && event.type === 255 ? event.target_id : undefined);
@@ -0,0 +1,18 @@
1
+ import type { SideEventParts } from '@zhin.js/core';
2
+
3
+ /** KOOK extra.type 原始值 → 标准 scene_type + sub_type */
4
+ export const KOOK_NOTICE_PARTS_MAP: Readonly<Record<string, SideEventParts>> = {
5
+ joined_guild: { scene_type: 'group', sub_type: 'member_increase' },
6
+ exited_guild: { scene_type: 'group', sub_type: 'member_decrease' },
7
+ deleted_message: { scene_type: 'group', sub_type: 'recall' },
8
+ deleted_private_message: { scene_type: 'friend', sub_type: 'recall' },
9
+ added_reaction: { scene_type: 'group', sub_type: 'emoji_reaction' },
10
+ deleted_reaction: { scene_type: 'group', sub_type: 'emoji_reaction' },
11
+ private_added_reaction: { scene_type: 'group', sub_type: 'emoji_reaction' },
12
+ private_deleted_reaction: { scene_type: 'group', sub_type: 'emoji_reaction' },
13
+ };
14
+
15
+ /** 已登记的 KOOK 通知映射为标准 scene_type + sub_type;未登记返回 undefined。 */
16
+ export function mapKookNoticeParts(raw: string): SideEventParts | undefined {
17
+ return Object.prototype.hasOwnProperty.call(KOOK_NOTICE_PARTS_MAP, raw) ? KOOK_NOTICE_PARTS_MAP[raw] : undefined;
18
+ }