@zhin.js/adapter-icqq 8.0.10 → 8.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,26 @@
1
1
  # @zhin.js/adapter-icqq
2
2
 
3
+ ## 8.0.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 3556601: Declare Stable Feature packages referenced by `zhin.features` as optional `peerDependencies` on official plugins/adapters (`@zhin.js/runtime` ≥1.0.12 requires features to be declared in deps/peers). Keeps authoring via `zhin.js` facades without installing Feature implementation packages into `dependencies`, and removes the need for consumer postinstall peer-patch scripts. `zhin new` scaffolds the same peer shape.
8
+ - @zhin.js/agent@1.1.12
9
+ - @zhin.js/core@1.5.10
10
+ - zhin.js@6.0.10
11
+
12
+ ## 8.0.11
13
+
14
+ ### Patch Changes
15
+
16
+ - eb84b77: fix: 更新文档,建立正确的依赖关系
17
+ - Updated dependencies [d3920e9]
18
+ - @zhin.js/core@1.5.10
19
+ - zhin.js@6.0.10
20
+ - @zhin.js/adapter@1.1.10
21
+ - @zhin.js/tool@1.0.11
22
+ - @zhin.js/agent@1.1.11
23
+
3
24
  ## 8.0.10
4
25
 
5
26
  ### Patch Changes
package/adapters/icqq.js CHANGED
@@ -2,10 +2,10 @@
2
2
  /**
3
3
  * Convention entry: discover `adapters/icqq.ts` → defineAdapter.
4
4
  */
5
- import { defineAdapter } from '@zhin.js/adapter';
5
+ import { defineAdapter } from 'zhin.js/adapter';
6
6
  import { messageGatewayToken } from '@zhin.js/core/runtime';
7
7
  import { formatCompact, getLogger } from '@zhin.js/logger';
8
- import { databaseHostToken, INBOX_TABLE_NOTICE, INBOX_TABLE_REQUEST, runtimeEventPublisherToken, } from '@zhin.js/plugin-runtime';
8
+ import { databaseHostToken, INBOX_TABLE_NOTICE, INBOX_TABLE_REQUEST, runtimeEventPublisherToken, } from 'zhin.js';
9
9
  import { IcqqEndpoint } from "../lib/endpoint.js";
10
10
  import { icqqRuntimeStateToken } from "../lib/icqq-runtime-state.js";
11
11
  import { resolveIcqqConfig, } from "../lib/protocol.js";
package/adapters/icqq.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Convention entry: discover `adapters/icqq.ts` → defineAdapter.
3
3
  */
4
- import { defineAdapter, type AdapterContext } from '@zhin.js/adapter';
4
+ import { defineAdapter, type AdapterContext } from 'zhin.js/adapter';
5
5
  import { messageGatewayToken } from '@zhin.js/core/runtime';
6
6
  import { formatCompact, getLogger } from '@zhin.js/logger';
7
7
  import {
@@ -10,7 +10,7 @@ import {
10
10
  INBOX_TABLE_REQUEST,
11
11
  runtimeEventPublisherToken,
12
12
  type Token,
13
- } from '@zhin.js/plugin-runtime';
13
+ } from 'zhin.js';
14
14
  import { IcqqEndpoint, type IcqqInboxHooks } from '../src/endpoint.js';
15
15
  import { icqqRuntimeStateToken } from '../src/icqq-runtime-state.js';
16
16
  import {
package/lib/endpoint.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Client } from '@icqqjs/icqq';
2
- import type { EndpointControl, EndpointInstance, EndpointManagement, EndpointSendRequest } from '@zhin.js/adapter';
2
+ import type { EndpointControl, EndpointInstance, EndpointManagement, EndpointSendRequest } from 'zhin.js/adapter';
3
3
  import type { MessageGateway } from '@zhin.js/core/runtime';
4
- import type { CapabilityId } from '@zhin.js/plugin-runtime';
4
+ import type { CapabilityId } from 'zhin.js';
5
5
  import { type IcqqInboundMessage, type ResolvedIcqqConfig } from './protocol.js';
6
6
  export interface IcqqInboxHooks {
7
7
  recordRequest(row: Record<string, unknown>): void | Promise<void>;
@@ -1,5 +1,5 @@
1
- import { addEndpointToConfig, createEndpointCommands } from '@zhin.js/adapter';
2
- import { defineCommand } from '@zhin.js/command';
1
+ import { addEndpointToConfig, createEndpointCommands } from 'zhin.js/adapter';
2
+ import { defineCommand } from 'zhin.js/command';
3
3
  import { icqqRuntimeStateToken } from './icqq-runtime-state.js';
4
4
  export const icqqEndpointCommands = createEndpointCommands({
5
5
  adapterKey: 'icqq',
@@ -2,5 +2,5 @@
2
2
  * ICQQ 插件实例的运行时状态:adapter create() 注册的 endpoint 列表。
3
3
  * 由 plugin.ts setup() provide,adapter create 与 `icqq.endpoint` 命令共享(同一 owner generation)。
4
4
  */
5
- import { defineEndpointRuntimeStateToken } from '@zhin.js/adapter';
5
+ import { defineEndpointRuntimeStateToken } from 'zhin.js/adapter';
6
6
  export const icqqRuntimeStateToken = defineEndpointRuntimeStateToken('icqq');
package/lib/protocol.js CHANGED
@@ -1,4 +1,4 @@
1
- import { pickCredential } from '@zhin.js/adapter';
1
+ import { pickCredential } from 'zhin.js/adapter';
2
2
  import { resolveCqMediaArg } from "./cq-message.js";
3
3
  export { resolveIcqqInboundMessageId } from "./icqq-inbound.js";
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-icqq",
3
- "version": "8.0.10",
3
+ "version": "8.0.12",
4
4
  "description": "Zhin.js ICQQ adapter — direct connection to @icqqjs/icqq",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -34,34 +34,35 @@
34
34
  "directory": "plugins/adapters/icqq"
35
35
  },
36
36
  "dependencies": {
37
- "@zhin.js/adapter": "1.1.9",
38
- "@zhin.js/command": "1.0.13",
39
- "@zhin.js/core": "1.5.9",
40
- "@zhin.js/tool": "1.0.10",
37
+ "@zhin.js/adapter": "1.1.10",
38
+ "@zhin.js/core": "1.5.10",
41
39
  "@zhin.js/im-contract": "1.0.3",
40
+ "@zhin.js/logger": "1.0.76",
42
41
  "@zhin.js/permission": "1.0.2",
43
- "@zhin.js/plugin-runtime": "1.1.6",
44
- "@zhin.js/logger": "1.0.76"
42
+ "@zhin.js/tool": "1.0.11"
45
43
  },
46
44
  "peerDependencies": {
47
45
  "@icqqjs/icqq": "^1.12.2",
48
46
  "zod": "^4.0.0",
49
- "@zhin.js/adapter": "1.1.9",
50
- "@zhin.js/agent": "1.1.10",
51
- "@zhin.js/core": "1.5.9",
52
- "@zhin.js/plugin-runtime": "1.1.6",
53
- "zhin.js": "6.0.9"
47
+ "@zhin.js/adapter": "1.1.10",
48
+ "@zhin.js/agent": "1.1.12",
49
+ "@zhin.js/command": "1.0.14",
50
+ "@zhin.js/core": "1.5.10",
51
+ "zhin.js": "6.0.10"
54
52
  },
55
53
  "peerDependenciesMeta": {
56
- "zhin.js": {
57
- "optional": true
58
- },
59
54
  "@icqqjs/icqq": {
60
55
  "optional": true
61
56
  },
62
57
  "@zhin.js/agent": {
63
58
  "optional": true
64
59
  },
60
+ "@zhin.js/command": {
61
+ "optional": true
62
+ },
63
+ "zhin.js": {
64
+ "optional": true
65
+ },
65
66
  "zod": {
66
67
  "optional": true
67
68
  }
@@ -72,8 +73,8 @@
72
73
  "typescript": "^6.0.3",
73
74
  "vitest": "^4.1.10",
74
75
  "zod": "^4.4.3",
75
- "@zhin.js/agent": "1.1.10",
76
- "zhin.js": "6.0.9"
76
+ "@zhin.js/agent": "1.1.12",
77
+ "zhin.js": "6.0.10"
77
78
  },
78
79
  "files": [
79
80
  "adapters",
package/plugin.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
- import { createEndpointRuntimeState } from '@zhin.js/adapter';
3
- import { definePlugin } from '@zhin.js/plugin-runtime';
2
+ import { createEndpointRuntimeState } from 'zhin.js/adapter';
3
+ import { definePlugin } from 'zhin.js';
4
4
  import { permissionHostToken, createSceneRolePlatformChecker } from '@zhin.js/permission';
5
5
  import { icqqRuntimeStateToken } from "./lib/icqq-runtime-state.js";
6
6
  // Module-level guard: multiple icqq instances (icqq, icqq-2, …) share this
package/src/endpoint.ts CHANGED
@@ -10,11 +10,11 @@ import type {
10
10
  EndpointInstance,
11
11
  EndpointManagement,
12
12
  EndpointSendRequest,
13
- } from '@zhin.js/adapter';
13
+ } from 'zhin.js/adapter';
14
14
  import type { MessageGateway } from '@zhin.js/core/runtime';
15
15
  import type { MessageRef } from '@zhin.js/im-contract';
16
16
  import { formatCompact, getAdapterLogger, truncatePreview } from '@zhin.js/logger';
17
- import type { CapabilityId } from '@zhin.js/plugin-runtime';
17
+ import type { CapabilityId } from 'zhin.js';
18
18
  import { registerIcqqAgentEndpoint } from './icqq-agent-deps.js';
19
19
  import {
20
20
  InboundMessageDeduper,
@@ -1,5 +1,5 @@
1
- import { addEndpointToConfig, createEndpointCommands } from '@zhin.js/adapter';
2
- import { defineCommand } from '@zhin.js/command';
1
+ import { addEndpointToConfig, createEndpointCommands } from 'zhin.js/adapter';
2
+ import { defineCommand } from 'zhin.js/command';
3
3
  import { icqqRuntimeStateToken } from './icqq-runtime-state.js';
4
4
 
5
5
  export const icqqEndpointCommands = createEndpointCommands({
@@ -2,6 +2,6 @@
2
2
  * ICQQ 插件实例的运行时状态:adapter create() 注册的 endpoint 列表。
3
3
  * 由 plugin.ts setup() provide,adapter create 与 `icqq.endpoint` 命令共享(同一 owner generation)。
4
4
  */
5
- import { defineEndpointRuntimeStateToken } from '@zhin.js/adapter';
5
+ import { defineEndpointRuntimeStateToken } from 'zhin.js/adapter';
6
6
 
7
7
  export const icqqRuntimeStateToken = defineEndpointRuntimeStateToken('icqq');
package/src/protocol.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { pickCredential } from '@zhin.js/adapter';
1
+ import { pickCredential } from 'zhin.js/adapter';
2
2
  import type { ConversationRef } from '@zhin.js/im-contract';
3
3
  import type { MessageSegment } from "zhin.js";
4
4
  import { resolveCqMediaArg } from "./cq-message.js";
@@ -1,88 +0,0 @@
1
- /**
2
- * Fallback types when `@icqqjs/icqq` peer is not installed.
3
- * Prefer package types when the real dependency is present.
4
- */
5
- declare module '@icqqjs/icqq' {
6
- export interface Config extends Record<string, unknown> {
7
- sign_api_addr?: string;
8
- ver?: string;
9
- platform?: number;
10
- auto_server?: boolean;
11
- autoReconnect?: boolean;
12
- }
13
-
14
- export type Sendable = string | Record<string, unknown> | unknown[];
15
-
16
- export interface ParsedGroupMessageId {
17
- group_id: number;
18
- user_id: number;
19
- seq: number;
20
- rand: number;
21
- time: number;
22
- pktnum: number;
23
- }
24
-
25
- export function parseGroupMessageId(msgid: string): ParsedGroupMessageId;
26
-
27
- export interface GroupHandle {
28
- setReaction(seq: number, emoji: string): Promise<unknown>;
29
- delReaction(seq: number, reactionId: string): Promise<unknown>;
30
- }
31
-
32
- export interface FriendInfo {
33
- user_id: number;
34
- nickname: string;
35
- remark?: string;
36
- }
37
-
38
- export interface GroupInfo {
39
- group_id: number;
40
- group_name: string;
41
- }
42
-
43
- export interface GroupMemberInfo {
44
- user_id: number;
45
- nickname?: string;
46
- card?: string;
47
- role?: string;
48
- }
49
-
50
- export class Client {
51
- uin: number;
52
- fl: Map<number, FriendInfo>;
53
- gl: Map<number, GroupInfo>;
54
- config: Config;
55
- dir?: string;
56
- status?: number;
57
-
58
- constructor(uin?: number | Config, config?: Config);
59
-
60
- on(event: string, listener: (...args: unknown[]) => void): this;
61
- off(event: string, listener?: (...args: unknown[]) => void): this;
62
- emit(event: string, ...args: unknown[]): boolean;
63
-
64
- login(password?: string | number): Promise<void>;
65
- logout?(keepalive?: boolean): Promise<void>;
66
- terminate(): void;
67
-
68
- sendPrivateMsg(userId: number, message: Sendable): Promise<{ message_id?: unknown }>;
69
- sendGroupMsg(groupId: number, message: Sendable): Promise<{ message_id?: unknown }>;
70
- sendTempMsg(groupId: number, userId: number, message: Sendable): Promise<{ message_id?: unknown }>;
71
- sendGuildMsg(guildId: string, channelId: string, message: Sendable): Promise<{ message_id?: unknown }>;
72
-
73
- deleteMsg(messageId: string): Promise<boolean>;
74
- getSystemMsg(): Promise<unknown[]>;
75
- setFriendAddRequest(flag: string, approve: boolean, remark?: string): Promise<boolean>;
76
- setGroupAddRequest(flag: string, approve: boolean, reason?: string): Promise<boolean>;
77
- deleteFriend(userId: number): Promise<boolean>;
78
- setGroupKick(groupId: number, userId: number): Promise<boolean>;
79
- setGroupBan(groupId: number, userId: number, duration: number): Promise<boolean>;
80
- setGroupAdmin(groupId: number, userId: number, enabled: boolean): Promise<boolean>;
81
- getGroupMemberList(groupId: number): Promise<Map<number, GroupMemberInfo>>;
82
-
83
- getGuildList(): Array<{ guild_id: string; guild_name: string }>;
84
- getChannelList(guildId: string): Array<{ guild_id: string; channel_id: string; channel_name: string }>;
85
-
86
- pickGroup(groupId: number): GroupHandle;
87
- }
88
- }