@zhin.js/adapter-icqq 1.1.0 → 1.1.3
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 +107 -0
- package/README.md +15 -6
- package/adapters/{icqq.js → icqq/index.js} +6 -6
- package/adapters/{icqq.ts → icqq/index.ts} +10 -10
- package/agents/icqq/agent.json +20 -0
- package/agents/icqq/boundaries.md +3 -0
- package/agents/icqq/conventions.md +3 -0
- package/agents/icqq/skills/icqq-directory/SKILL.md +20 -0
- package/{tools/friend_list.js → agents/icqq/skills/icqq-directory/tools/friend_list/index.js} +2 -1
- package/{tools/friend_list.ts → agents/icqq/skills/icqq-directory/tools/friend_list/index.ts} +2 -1
- package/{tools/group_list.js → agents/icqq/skills/icqq-directory/tools/group_list/index.js} +2 -1
- package/{tools/group_list.ts → agents/icqq/skills/icqq-directory/tools/group_list/index.ts} +2 -1
- package/{tools/group_member_info.js → agents/icqq/skills/icqq-directory/tools/group_member_info/index.js} +3 -1
- package/{tools/group_member_info.ts → agents/icqq/skills/icqq-directory/tools/group_member_info/index.ts} +3 -1
- package/{tools/user_info.js → agents/icqq/skills/icqq-directory/tools/user_info/index.js} +1 -0
- package/{tools/user_info.ts → agents/icqq/skills/icqq-directory/tools/user_info/index.ts} +1 -0
- package/agents/icqq/skills/icqq-group-admin/SKILL.md +25 -0
- package/{tools/announce.js → agents/icqq/skills/icqq-group-admin/tools/announce/index.js} +2 -0
- package/{tools/announce.ts → agents/icqq/skills/icqq-group-admin/tools/announce/index.ts} +2 -0
- package/{tools/essence.js → agents/icqq/skills/icqq-group-admin/tools/essence/index.js} +3 -1
- package/{tools/essence.ts → agents/icqq/skills/icqq-group-admin/tools/essence/index.ts} +3 -1
- package/{tools/group_invite.js → agents/icqq/skills/icqq-group-admin/tools/group_invite/index.js} +1 -1
- package/{tools/group_invite.ts → agents/icqq/skills/icqq-group-admin/tools/group_invite/index.ts} +1 -1
- package/{tools/group_kick.js → agents/icqq/skills/icqq-group-admin/tools/group_kick/index.js} +4 -3
- package/{tools/group_kick.ts → agents/icqq/skills/icqq-group-admin/tools/group_kick/index.ts} +4 -3
- package/{tools/set_anonymous.js → agents/icqq/skills/icqq-group-admin/tools/set_anonymous/index.js} +3 -1
- package/{tools/set_anonymous.ts → agents/icqq/skills/icqq-group-admin/tools/set_anonymous/index.ts} +3 -1
- package/{tools/set_mute.js → agents/icqq/skills/icqq-group-admin/tools/set_mute/index.js} +3 -2
- package/{tools/set_mute.ts → agents/icqq/skills/icqq-group-admin/tools/set_mute/index.ts} +3 -2
- package/{tools/set_title.js → agents/icqq/skills/icqq-group-admin/tools/set_title/index.js} +3 -2
- package/{tools/set_title.ts → agents/icqq/skills/icqq-group-admin/tools/set_title/index.ts} +3 -2
- package/agents/icqq/skills/icqq-group-state/SKILL.md +17 -0
- package/{tools/group_files.js → agents/icqq/skills/icqq-group-state/tools/group_files/index.js} +3 -1
- package/{tools/group_files.ts → agents/icqq/skills/icqq-group-state/tools/group_files/index.ts} +3 -1
- package/{tools/list_muted.js → agents/icqq/skills/icqq-group-state/tools/list_muted/index.js} +2 -1
- package/{tools/list_muted.ts → agents/icqq/skills/icqq-group-state/tools/list_muted/index.ts} +2 -1
- package/agents/icqq/skills/icqq-interaction/SKILL.md +19 -0
- package/{tools/group_sign.js → agents/icqq/skills/icqq-interaction/tools/group_sign/index.js} +2 -1
- package/{tools/group_sign.ts → agents/icqq/skills/icqq-interaction/tools/group_sign/index.ts} +2 -1
- package/{tools/poke.js → agents/icqq/skills/icqq-interaction/tools/poke/index.js} +2 -1
- package/{tools/poke.ts → agents/icqq/skills/icqq-interaction/tools/poke/index.ts} +2 -1
- package/{tools/send_user_like.js → agents/icqq/skills/icqq-interaction/tools/send_user_like/index.js} +4 -3
- package/{tools/send_user_like.ts → agents/icqq/skills/icqq-interaction/tools/send_user_like/index.ts} +3 -3
- package/agents/icqq/system.md +3 -0
- package/commands/{endpoint/add/[[id]].js → icqq/endpoint/add/[[id]]/index.js} +1 -1
- package/commands/icqq/endpoint/add/[[id]]/index.ts +3 -0
- package/{lib/icqq-endpoint-commands.js → commands/icqq/endpoint/definition.js} +10 -5
- package/{src/icqq-endpoint-commands.ts → commands/icqq/endpoint/definition.ts} +9 -5
- package/commands/{endpoint/list.js → icqq/endpoint/list/index.js} +1 -1
- package/commands/icqq/endpoint/list/index.ts +3 -0
- package/commands/{endpoint/remove/[id].js → icqq/endpoint/remove/[id]/index.js} +1 -1
- package/commands/icqq/endpoint/remove/[id]/index.ts +3 -0
- package/lib/content-resolver.d.ts +10 -0
- package/lib/content-resolver.js +98 -0
- package/lib/cq-message.d.ts +1 -1
- package/lib/cq-message.js +1 -1
- package/lib/endpoint.d.ts +1 -2
- package/lib/endpoint.js +34 -77
- package/lib/icqq-inbound.js +40 -0
- package/lib/icqq-runtime-state.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/outbound-media.d.ts +1 -1
- package/lib/outbound-media.js +1 -1
- package/lib/protocol.d.ts +4 -22
- package/lib/protocol.js +52 -55
- package/lib/types.d.ts +0 -6
- package/package.json +29 -23
- package/plugin.js +1 -1
- package/prompt-sections/platform/index.js +16 -0
- package/{agent/prompt-sections/platform.ts → prompt-sections/platform/index.ts} +3 -4
- package/schema.json +7 -1
- package/src/content-resolver.ts +131 -0
- package/src/cq-message.ts +1 -1
- package/src/endpoint.ts +43 -97
- package/src/icqq-inbound.ts +39 -0
- package/src/icqq-runtime-state.ts +1 -1
- package/src/index.ts +1 -1
- package/src/outbound-media.ts +2 -2
- package/src/protocol.ts +56 -80
- package/src/types.ts +0 -7
- package/commands/endpoint/add/[[id]].ts +0 -3
- package/commands/endpoint/list.ts +0 -3
- package/commands/endpoint/remove/[id].ts +0 -3
- package/lib/icqq-endpoint-commands.d.ts +0 -1
- /package/{agent/PERMITS.md → PERMITS.md} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,112 @@
|
|
|
1
1
|
# @zhin.js/adapter-icqq
|
|
2
2
|
|
|
3
|
+
## 1.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5b5d270: Complete the canonical share segment contract and preserve native ICQQ share delivery through Core and AI outbound pipelines.
|
|
8
|
+
- Updated dependencies [5b5d270]
|
|
9
|
+
- Updated dependencies [36c2eb9]
|
|
10
|
+
- @zhin.js/im-contract@1.1.2
|
|
11
|
+
- @zhin.js/core@1.1.38
|
|
12
|
+
- @zhin.js/adapter@1.1.15
|
|
13
|
+
- @zhin.js/agent-feature@1.1.2
|
|
14
|
+
- @zhin.js/feature-kit@1.1.2
|
|
15
|
+
- @zhin.js/permission@1.1.2
|
|
16
|
+
- @zhin.js/skill@1.1.2
|
|
17
|
+
- @zhin.js/tool@1.1.2
|
|
18
|
+
|
|
19
|
+
## 1.1.2
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 62dee52: Rename the Agent Tool policy field from `approval` to `requiresApproval`, so values such as `never` and `always` state when human approval is required. Remove the old field without a compatibility alias and migrate built-in, adapter, feature, and utility Tools to the canonical contract.
|
|
24
|
+
- a9e4a40: Derive Command user routes only from explicit `commands/**/*/index.ts(x)` entry paths instead of prepending the plugin owner. Child plugins can now publish top-level static or dynamic commands, while duplicate routes across owners fail during generation construction. Adapter endpoint commands move to explicit paths such as `commands/qq/endpoint/list/index.ts` and are invoked as `qq endpoint list`.
|
|
25
|
+
- 8740059: Standardize TypeScript capabilities on named module directories such as `commands/foo/index.ts`, `middlewares/audit/index.ts`, `handlers/message-receive/index.ts`, `pages/workroom/index.tsx`, and `mcps/filesystem/index.ts`. Only the fixed `index` entry is discovered; sibling files remain private helpers.
|
|
26
|
+
|
|
27
|
+
Command route segments come from directories, while `[name]`, `[[name]]`, `[...name]`, and `[[...name]]` directories declare dynamic parameters. Plugin owners do not enter the route unless their config explicitly sets `commandNamespace`; Endpoint `commandPrefix` remains platform-owned and defaults to an empty string.
|
|
28
|
+
|
|
29
|
+
Migrate the built-in adapters, plugins, examples, generators, migration tooling, hot reload classification, Agent authoring surfaces, documentation, and release artifacts to the explicit entry convention.
|
|
30
|
+
|
|
31
|
+
Make Tool ownership and progressive disclosure explicit across all four supported locations: plugin-public `tools/`, Agent-private `agents/<name>/tools/`, Skill-private `skills/<name>/tools/`, and Agent-Skill-private `agents/<name>/skills/<name>/tools/`. Move adapter and group-suite operations that require domain instructions into their owning Skills so `load_skill` is the only path that unlocks their schemas.
|
|
32
|
+
|
|
33
|
+
Remove the package-root `agent/` convention. Public capabilities now use named package-root directories, schedules use `schedules/<name>/index.ts` or `plugin.ts` injection, MCP connections use `mcps/<name>/index.ts`, Prompt Sections use `prompt-sections/<name>/index.ts`, Agent definitions use `agents/<name>/`, and permission vocabulary is published as `PERMITS.md`.
|
|
34
|
+
|
|
35
|
+
- eb3227a: Move Endpoint project-configuration persistence behind the root-owned `EndpointConfigurationStore` resource. The Adapter package now owns only command semantics and no longer imports Node filesystem, path, or YAML APIs; CLI owns canonical YAML and `.env` persistence, while QQ and ICQQ special binding flows use the same injected boundary. Remove the old direct persistence helpers and reject legacy `plugins` arrays instead of promoting them at runtime.
|
|
36
|
+
- ddbb92e: Isolate adapter Skills under platform-specific Agents and automatically select the matching platform Agent for IM ingress, preventing unrelated adapter Skills from entering another platform's prompt surface.
|
|
37
|
+
- 40d2c8f: Reduce the default Agent Tool surface by moving process diagnostics into a Skill and splitting broad platform Skills into focused task domains. Restore ICQQ friend and group directory tools with `on-risk` approval and explicit owner, administrator, master, or trusted access.
|
|
38
|
+
- 73a24b7: Reorganize the Adapter package into one-way authoring, Endpoint boundary, managed lifecycle, and Runtime projection modules without changing public imports. Extract ICQQ content resolution behind a focused module and document its source map.
|
|
39
|
+
- 4380cf9: Colocate adapter command definitions and Agent Skill handlers with their owning capabilities, and provide a shared validated platform permission constructor.
|
|
40
|
+
- 6dad65e: Require one canonical expanded ICQQ endpoint configuration. Remove nested endpoint and environment identity compatibility, replace the conflicting name-based public endpoint type with the actual direct-Client configuration contract, and delete the obsolete endpoint typing-indicator guide.
|
|
41
|
+
- 5c3858e: Make `@zhin.js/im-contract` the explicit zero-dependency owner of transport identities, canonical segments, media guards, conversation facts, stores, and delivery contracts. Platform adapters now read media contracts from that foundation instead of reaching through Core.
|
|
42
|
+
- 33ea736: Use `tools/<name>/index.ts` and `defineAgentTool` from `@zhin.js/tool` as the sole Agent Tool authoring model. Remove the duplicate `@zhin.js/tools` definition, context, bridge, export, and discovery path; migrate plugin manifests, examples, scaffolding, HMR, and prepack compilation to the generation-owned Tool Feature.
|
|
43
|
+
- df9f76b: Make Endpoint configuration persistence asynchronous and route it through the canonical transactional Root configuration port. Endpoint management now supports both YAML and JSON, materializes a missing Root config safely, serializes concurrent mutations, restores `.env` when the config commit fails, and restarts the development process after environment-file changes.
|
|
44
|
+
- Updated dependencies [c861789]
|
|
45
|
+
- Updated dependencies [1414ccb]
|
|
46
|
+
- Updated dependencies [743d470]
|
|
47
|
+
- Updated dependencies [62dee52]
|
|
48
|
+
- Updated dependencies [cd54131]
|
|
49
|
+
- Updated dependencies [a9e4a40]
|
|
50
|
+
- Updated dependencies [5855db7]
|
|
51
|
+
- Updated dependencies [ec921d2]
|
|
52
|
+
- Updated dependencies [8740059]
|
|
53
|
+
- Updated dependencies [63d1f7a]
|
|
54
|
+
- Updated dependencies [25a845a]
|
|
55
|
+
- Updated dependencies [9110ab8]
|
|
56
|
+
- Updated dependencies [eb3227a]
|
|
57
|
+
- Updated dependencies [b853dba]
|
|
58
|
+
- Updated dependencies [e561309]
|
|
59
|
+
- Updated dependencies [d4c6175]
|
|
60
|
+
- Updated dependencies [7a0e1ca]
|
|
61
|
+
- Updated dependencies [103b5d3]
|
|
62
|
+
- Updated dependencies [5a7a7f7]
|
|
63
|
+
- Updated dependencies [b076eae]
|
|
64
|
+
- Updated dependencies [535fed1]
|
|
65
|
+
- Updated dependencies [73a24b7]
|
|
66
|
+
- Updated dependencies [4380cf9]
|
|
67
|
+
- Updated dependencies [1cb1163]
|
|
68
|
+
- Updated dependencies [be3061e]
|
|
69
|
+
- Updated dependencies [75f8332]
|
|
70
|
+
- Updated dependencies [81935e2]
|
|
71
|
+
- Updated dependencies [f9ed01b]
|
|
72
|
+
- Updated dependencies [ac0ab50]
|
|
73
|
+
- Updated dependencies [5140ce1]
|
|
74
|
+
- Updated dependencies [522d75f]
|
|
75
|
+
- Updated dependencies [a7611b3]
|
|
76
|
+
- Updated dependencies [8823044]
|
|
77
|
+
- Updated dependencies [379439b]
|
|
78
|
+
- Updated dependencies [11c9352]
|
|
79
|
+
- Updated dependencies [135ac91]
|
|
80
|
+
- Updated dependencies [140cf0f]
|
|
81
|
+
- Updated dependencies [251e4d2]
|
|
82
|
+
- Updated dependencies [203ad34]
|
|
83
|
+
- Updated dependencies [e6c5113]
|
|
84
|
+
- Updated dependencies [e0f6478]
|
|
85
|
+
- Updated dependencies [698f16f]
|
|
86
|
+
- Updated dependencies [2fd8017]
|
|
87
|
+
- Updated dependencies [5c3858e]
|
|
88
|
+
- Updated dependencies [33ea736]
|
|
89
|
+
- Updated dependencies [df9f76b]
|
|
90
|
+
- @zhin.js/core@1.1.37
|
|
91
|
+
- @zhin.js/tool@1.1.1
|
|
92
|
+
- @zhin.js/adapter@1.1.14
|
|
93
|
+
- @zhin.js/feature-kit@1.1.1
|
|
94
|
+
- @zhin.js/agent-feature@1.1.1
|
|
95
|
+
- @zhin.js/skill@1.1.1
|
|
96
|
+
- @zhin.js/logger@1.1.1
|
|
97
|
+
- @zhin.js/im-contract@1.1.1
|
|
98
|
+
- @zhin.js/permission@1.1.1
|
|
99
|
+
|
|
100
|
+
## 1.1.1
|
|
101
|
+
|
|
102
|
+
### Patch Changes
|
|
103
|
+
|
|
104
|
+
- f0f4573: Fix ICQQ share segments to use the native share protocol instead of sending them as JSON cards.
|
|
105
|
+
- 51df035: fix: 修复 icqq 点赞错误
|
|
106
|
+
- Updated dependencies [769e67f]
|
|
107
|
+
- @zhin.js/adapter@1.1.13
|
|
108
|
+
- @zhin.js/core@1.1.36
|
|
109
|
+
|
|
3
110
|
## 1.1.0
|
|
4
111
|
|
|
5
112
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ ICQQ Plugin Runtime 适配器 — 进程内直接使用 [@icqqjs/icqq](https://g
|
|
|
8
8
|
- 入站:ICQQ Client 原始事件经 `Endpoint.emit(...)` 唯一入口上送;文本与图片 / 语音 / 视频 / 文件统一归一为 canonical `Segment` + `MediaRef`
|
|
9
9
|
- 出站:canonical Segment 直接投影为 ICQQ 原生 `Sendable`,再由 `sendGroupMsg` / `sendPrivateMsg` / …发送
|
|
10
10
|
- 群聊 reaction:`control.addReaction` / `removeReaction`(协议 ACK 失败不阻塞后续发送)
|
|
11
|
-
- Agent
|
|
11
|
+
- Agent 工具:按职责拆分在 `agents/icqq/skills/icqq-*/tools/`,只在对应 Skill 激活后披露
|
|
12
12
|
- Console Endpoint 管理:`src/endpoint.ts` 显式实现 `EndpointManagement`(好友/群/群成员列表、请求审批、删好友、踢人、禁言、设管理)
|
|
13
13
|
|
|
14
14
|
## 安装
|
|
@@ -62,6 +62,10 @@ plugins:
|
|
|
62
62
|
- id: "${ICQQ_ACCOUNT_3}"
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
+
`AdapterIndex` 会先合并插件实例默认值与 endpoint 覆盖值,再把一份完整配置交给
|
|
66
|
+
ICQQ adapter。协议层只接受这份展开后的 endpoint 配置,不读取环境变量,也不再次解析
|
|
67
|
+
嵌套的 `endpoints`。环境变量替换由 composition root 在配置加载阶段完成。
|
|
68
|
+
|
|
65
69
|
## Send conversation
|
|
66
70
|
|
|
67
71
|
| 类型 | conversation |
|
|
@@ -136,11 +140,16 @@ IM turn 的场景,才使用 `icqqClient.get(context, endpointId)` 显式选择
|
|
|
136
140
|
|
|
137
141
|
## 架构
|
|
138
142
|
|
|
139
|
-
- `plugin.ts` + `adapters/icqq.ts
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
143
|
+
- `plugin.ts` + `adapters/icqq/index.ts`:Plugin Runtime 入口与 `defineAdapter` 声明
|
|
144
|
+
- `src/endpoint.ts`:组合 ICQQ `Client`,只协调账号 transport、Zhin lifecycle 与各能力端口
|
|
145
|
+
- `src/content-resolver.ts`:保存已观察消息,并按深度和条数限制递归展开合并转发
|
|
146
|
+
- `src/icqq-inbound.ts`:把 ICQQ 原生消息归一为 Zhin 入站消息
|
|
147
|
+
- `src/protocol.ts`:配置解析、会话映射与出站目标转换
|
|
148
|
+
- `src/client.ts`:向插件作者暴露 ICQQ `Client` / `EventMap` 类型注册
|
|
149
|
+
- Agent 工具:`agents/icqq/skills/icqq-*/tools/<name>/index.ts`;权限说明见 `PERMITS.md`
|
|
150
|
+
|
|
151
|
+
阅读适配器实现时从 `endpoint.ts` 看能力装配,再进入对应能力文件。包外代码只从
|
|
152
|
+
`@zhin.js/adapter-icqq` 与 `zhin.js/adapter` 的公开入口导入,不依赖上述源码路径。
|
|
144
153
|
|
|
145
154
|
## Plugin Runtime 迁移说明
|
|
146
155
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
2
|
/**
|
|
3
|
-
* Convention entry: discover `adapters/icqq.ts` → defineAdapter.
|
|
3
|
+
* Convention entry: discover `adapters/icqq/index.ts` → defineAdapter.
|
|
4
4
|
*/
|
|
5
5
|
import { defineAdapter } from 'zhin.js/adapter';
|
|
6
6
|
import { loginAssistToken } from '@zhin.js/core/runtime';
|
|
7
|
-
import { IcqqEndpoint } from "
|
|
8
|
-
import { icqqRuntimeStateToken } from "
|
|
9
|
-
import { resolveIcqqConfig, } from "
|
|
10
|
-
export { IcqqEndpoint } from "
|
|
7
|
+
import { IcqqEndpoint } from "../../lib/endpoint.js";
|
|
8
|
+
import { icqqRuntimeStateToken } from "../../lib/icqq-runtime-state.js";
|
|
9
|
+
import { resolveIcqqConfig, } from "../../lib/protocol.js";
|
|
10
|
+
export { IcqqEndpoint } from "../../lib/endpoint.js";
|
|
11
11
|
export default defineAdapter({
|
|
12
12
|
capabilities: ['inbound', 'outbound'],
|
|
13
13
|
operations: ['recall', 'reaction'],
|
|
@@ -17,7 +17,7 @@ export default defineAdapter({
|
|
|
17
17
|
},
|
|
18
18
|
create(context) {
|
|
19
19
|
const config = resolveIcqqConfig(context.config);
|
|
20
|
-
// 注册到插件运行时状态(icqq
|
|
20
|
+
// 注册到插件运行时状态(icqq endpoint list 的"运行中"数据源)
|
|
21
21
|
context.use(icqqRuntimeStateToken).endpoints.set(config.id, {
|
|
22
22
|
id: config.id,
|
|
23
23
|
mode: 'direct',
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Convention entry: discover `adapters/icqq.ts` → defineAdapter.
|
|
2
|
+
* Convention entry: discover `adapters/icqq/index.ts` → defineAdapter.
|
|
3
3
|
*/
|
|
4
4
|
import { defineAdapter } from 'zhin.js/adapter';
|
|
5
5
|
import { loginAssistToken } from '@zhin.js/core/runtime';
|
|
6
|
-
import { IcqqEndpoint } from '
|
|
7
|
-
import { icqqRuntimeStateToken } from '
|
|
6
|
+
import { IcqqEndpoint } from '../../src/endpoint.js';
|
|
7
|
+
import { icqqRuntimeStateToken } from '../../src/icqq-runtime-state.js';
|
|
8
8
|
import {
|
|
9
9
|
resolveIcqqConfig,
|
|
10
|
-
type
|
|
11
|
-
} from '
|
|
10
|
+
type IcqqEndpointConfig,
|
|
11
|
+
} from '../../src/protocol.js';
|
|
12
12
|
|
|
13
|
-
export { IcqqEndpoint } from '
|
|
14
|
-
export type { IcqqEndpointOptions } from '
|
|
13
|
+
export { IcqqEndpoint } from '../../src/endpoint.js';
|
|
14
|
+
export type { IcqqEndpointOptions } from '../../src/endpoint.js';
|
|
15
15
|
|
|
16
16
|
declare module '@zhin.js/core' {
|
|
17
17
|
interface AdapterEndpoints {
|
|
18
|
-
icqq: import('
|
|
18
|
+
icqq: import('../../src/endpoint.js').IcqqEndpoint;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export default defineAdapter<
|
|
22
|
+
export default defineAdapter<IcqqEndpointConfig>({
|
|
23
23
|
capabilities: ['inbound', 'outbound'],
|
|
24
24
|
operations: ['recall', 'reaction'],
|
|
25
25
|
segments: {
|
|
@@ -28,7 +28,7 @@ export default defineAdapter<IcqqAdapterConfig>({
|
|
|
28
28
|
},
|
|
29
29
|
create(context) {
|
|
30
30
|
const config = resolveIcqqConfig(context.config);
|
|
31
|
-
// 注册到插件运行时状态(icqq
|
|
31
|
+
// 注册到插件运行时状态(icqq endpoint list 的"运行中"数据源)
|
|
32
32
|
context.use(icqqRuntimeStateToken).endpoints.set(config.id, {
|
|
33
33
|
id: config.id,
|
|
34
34
|
mode: 'direct',
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ICQQ Platform Agent",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Handles icqq platform-specific operations and progressively loads only the required platform Skill.",
|
|
5
|
+
"trigger_rules": {
|
|
6
|
+
"file_patterns": [],
|
|
7
|
+
"keywords": [
|
|
8
|
+
"icqq",
|
|
9
|
+
"adapter:icqq"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"entry_points": [
|
|
13
|
+
"system.md",
|
|
14
|
+
"boundaries.md",
|
|
15
|
+
"conventions.md"
|
|
16
|
+
],
|
|
17
|
+
"platforms": [
|
|
18
|
+
"icqq"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: icqq-directory
|
|
3
|
+
platforms:
|
|
4
|
+
- icqq
|
|
5
|
+
description: ICQQ 好友、群和成员目录查询能力。
|
|
6
|
+
keywords:
|
|
7
|
+
- "icqq"
|
|
8
|
+
- "好友列表"
|
|
9
|
+
- "群列表"
|
|
10
|
+
- "成员信息"
|
|
11
|
+
tools:
|
|
12
|
+
- "friend_list"
|
|
13
|
+
- "group_list"
|
|
14
|
+
- "user_info"
|
|
15
|
+
- "group_member_info"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# icqq-directory
|
|
19
|
+
|
|
20
|
+
查询用户或群成员前先获取稳定 QQ 号或群号。目录信息只向群主、管理员、master 或 trusted 披露;不要根据昵称猜测身份。
|
package/{tools/friend_list.js → agents/icqq/skills/icqq-directory/tools/friend_list/index.js}
RENAMED
|
@@ -5,7 +5,8 @@ export default defineAgentTool({
|
|
|
5
5
|
description: '获取 QQ 好友列表',
|
|
6
6
|
inputSchema: z.object({}),
|
|
7
7
|
adapter: 'icqq',
|
|
8
|
-
|
|
8
|
+
requiresApproval: 'on-risk',
|
|
9
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
9
10
|
async execute(_input, context) {
|
|
10
11
|
const client = context.$client;
|
|
11
12
|
const friends = Array.from(client.fl.values()).map((friend) => ({
|
package/{tools/friend_list.ts → agents/icqq/skills/icqq-directory/tools/friend_list/index.ts}
RENAMED
|
@@ -5,7 +5,8 @@ export default defineAgentTool<Record<string, never>>({
|
|
|
5
5
|
description: '获取 QQ 好友列表',
|
|
6
6
|
inputSchema: z.object({}),
|
|
7
7
|
adapter: 'icqq',
|
|
8
|
-
|
|
8
|
+
requiresApproval: 'on-risk',
|
|
9
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
9
10
|
async execute(_input, context) {
|
|
10
11
|
const client = context.$client;
|
|
11
12
|
const friends = Array.from(client.fl.values()).map((friend) => ({
|
|
@@ -5,7 +5,8 @@ export default defineAgentTool({
|
|
|
5
5
|
adapter: 'icqq',
|
|
6
6
|
description: '获取当前 QQ 账号的群列表',
|
|
7
7
|
inputSchema: z.object({}),
|
|
8
|
-
|
|
8
|
+
requiresApproval: 'on-risk',
|
|
9
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
9
10
|
async execute(_input, context) {
|
|
10
11
|
const client = context.$client;
|
|
11
12
|
const groups = Array.from(client.gl.values()).map((group) => ({
|
|
@@ -5,7 +5,8 @@ export default defineAgentTool<Record<string, never>>({
|
|
|
5
5
|
adapter: 'icqq',
|
|
6
6
|
description: '获取当前 QQ 账号的群列表',
|
|
7
7
|
inputSchema: z.object({}),
|
|
8
|
-
|
|
8
|
+
requiresApproval: 'on-risk',
|
|
9
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
9
10
|
async execute(_input, context) {
|
|
10
11
|
const client = context.$client;
|
|
11
12
|
const groups = Array.from(client.gl.values()).map((group) => ({
|
|
@@ -8,7 +8,9 @@ export default defineAgentTool({
|
|
|
8
8
|
user_id: z.number().describe('目标成员 QQ号'),
|
|
9
9
|
}),
|
|
10
10
|
adapter: 'icqq',
|
|
11
|
-
|
|
11
|
+
scopes: ['group'],
|
|
12
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
13
|
+
requiresApproval: 'never',
|
|
12
14
|
async execute({ group_id, user_id }, context) {
|
|
13
15
|
const group = context.$client.pickGroup(group_id);
|
|
14
16
|
if (!group)
|
|
@@ -12,7 +12,9 @@ export default defineAgentTool<GroupMemberInfoInput>({
|
|
|
12
12
|
user_id: z.number().describe('目标成员 QQ号'),
|
|
13
13
|
}),
|
|
14
14
|
adapter: 'icqq',
|
|
15
|
-
|
|
15
|
+
scopes:['group'],
|
|
16
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
17
|
+
requiresApproval: 'never',
|
|
16
18
|
async execute({ group_id, user_id }, context) {
|
|
17
19
|
const group = context.$client.pickGroup(group_id);
|
|
18
20
|
if (!group) return { success: false, message: '目标群不存在' };
|
|
@@ -7,6 +7,7 @@ export default defineAgentTool({
|
|
|
7
7
|
user_id: z.number().describe('目标成员 QQ号'),
|
|
8
8
|
}),
|
|
9
9
|
adapter: 'icqq',
|
|
10
|
+
requiresApproval: 'never',
|
|
10
11
|
async execute({ user_id }, context) {
|
|
11
12
|
const profile = await context.$client.getProfile(user_id);
|
|
12
13
|
return { success: true, message: `已获取 ${user_id} 的用户信息:${JSON.stringify(profile, null, 2)}` };
|
|
@@ -6,6 +6,7 @@ export default defineAgentTool<{ user_id: number }>({
|
|
|
6
6
|
user_id: z.number().describe('目标成员 QQ号'),
|
|
7
7
|
}),
|
|
8
8
|
adapter: 'icqq',
|
|
9
|
+
requiresApproval: 'never',
|
|
9
10
|
async execute({ user_id }, context) {
|
|
10
11
|
const profile = await context.$client.getProfile(user_id);
|
|
11
12
|
return { success: true, message: `已获取 ${user_id} 的用户信息:${JSON.stringify(profile,null,2)}` };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: icqq-group-admin
|
|
3
|
+
platforms:
|
|
4
|
+
- icqq
|
|
5
|
+
description: ICQQ 邀请、踢人、禁言、头衔、匿名、公告和精华管理能力。
|
|
6
|
+
keywords:
|
|
7
|
+
- "icqq"
|
|
8
|
+
- "群管理"
|
|
9
|
+
- "禁言"
|
|
10
|
+
- "踢人"
|
|
11
|
+
- "公告"
|
|
12
|
+
- "精华"
|
|
13
|
+
tools:
|
|
14
|
+
- "group_invite"
|
|
15
|
+
- "group_kick"
|
|
16
|
+
- "set_mute"
|
|
17
|
+
- "set_title"
|
|
18
|
+
- "set_anonymous"
|
|
19
|
+
- "announce"
|
|
20
|
+
- "essence"
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# icqq-group-admin
|
|
24
|
+
|
|
25
|
+
仅在目标群和目标成员明确时加载。所有写操作遵守 Tool 审批与角色权限;不可逆或影响成员关系的操作先复核参数。
|
|
@@ -8,6 +8,8 @@ export default defineAgentTool({
|
|
|
8
8
|
content: z.string().describe('公告内容'),
|
|
9
9
|
}),
|
|
10
10
|
adapter: 'icqq',
|
|
11
|
+
requiresApproval: 'once',
|
|
12
|
+
scopes: ['group'],
|
|
11
13
|
permissions: ['role(master,admin,trusted,owner)'],
|
|
12
14
|
async execute({ group_id, content }, context) {
|
|
13
15
|
await context.$client.sendGroupNotice(group_id, content);
|
|
@@ -7,6 +7,8 @@ export default defineAgentTool<{ group_id: number; content: string }>({
|
|
|
7
7
|
content: z.string().describe('公告内容'),
|
|
8
8
|
}),
|
|
9
9
|
adapter: 'icqq',
|
|
10
|
+
requiresApproval: 'once',
|
|
11
|
+
scopes:['group'],
|
|
10
12
|
permissions: ['role(master,admin,trusted,owner)'],
|
|
11
13
|
async execute({ group_id, content }, context) {
|
|
12
14
|
await context.$client.sendGroupNotice(group_id, content);
|
|
@@ -8,7 +8,9 @@ export default defineAgentTool({
|
|
|
8
8
|
action: z.enum(['add', 'remove']).describe('add=设为精华, remove=移除精华'),
|
|
9
9
|
}),
|
|
10
10
|
adapter: 'icqq',
|
|
11
|
-
|
|
11
|
+
requiresApproval: 'once',
|
|
12
|
+
scopes: ['group'],
|
|
13
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
12
14
|
async execute({ message_id, action }, context) {
|
|
13
15
|
const client = context.$client;
|
|
14
16
|
if (action === 'add') {
|
|
@@ -7,7 +7,9 @@ export default defineAgentTool<{ message_id: string; action: 'add' | 'remove' }>
|
|
|
7
7
|
action: z.enum(['add', 'remove']).describe('add=设为精华, remove=移除精华'),
|
|
8
8
|
}),
|
|
9
9
|
adapter: 'icqq',
|
|
10
|
-
|
|
10
|
+
requiresApproval: 'once',
|
|
11
|
+
scopes:['group'],
|
|
12
|
+
permissions: ['role(master,admin,trusted,owner)'],
|
|
11
13
|
async execute({ message_id, action }, context) {
|
|
12
14
|
const client = context.$client;
|
|
13
15
|
if (action === 'add') {
|
package/{tools/group_invite.js → agents/icqq/skills/icqq-group-admin/tools/group_invite/index.js}
RENAMED
|
@@ -8,7 +8,7 @@ export default defineAgentTool({
|
|
|
8
8
|
user_id: z.number().describe('要邀请的 QQ号'),
|
|
9
9
|
}),
|
|
10
10
|
adapter: 'icqq',
|
|
11
|
-
|
|
11
|
+
requiresApproval: 'always',
|
|
12
12
|
async execute({ group_id, user_id }, context) {
|
|
13
13
|
const client = context.$client;
|
|
14
14
|
const groupInfo = client.pickGroup(group_id);
|
package/{tools/group_invite.ts → agents/icqq/skills/icqq-group-admin/tools/group_invite/index.ts}
RENAMED
|
@@ -7,7 +7,7 @@ export default defineAgentTool<{ group_id: number; user_id: number }>({
|
|
|
7
7
|
user_id: z.number().describe('要邀请的 QQ号'),
|
|
8
8
|
}),
|
|
9
9
|
adapter: 'icqq',
|
|
10
|
-
|
|
10
|
+
requiresApproval: 'always',
|
|
11
11
|
async execute({ group_id, user_id }, context) {
|
|
12
12
|
const client = context.$client;
|
|
13
13
|
const groupInfo= client.pickGroup(group_id);
|
package/{tools/group_kick.js → agents/icqq/skills/icqq-group-admin/tools/group_kick/index.js}
RENAMED
|
@@ -8,15 +8,16 @@ export default defineAgentTool({
|
|
|
8
8
|
user_id: z.number().describe('要踢出的成员 QQ号'),
|
|
9
9
|
}),
|
|
10
10
|
adapter: 'icqq',
|
|
11
|
+
scopes: ['group'],
|
|
11
12
|
permissions: ['role(master,admin,trusted,owner)'],
|
|
12
|
-
|
|
13
|
+
requiresApproval: 'once',
|
|
13
14
|
async execute({ group_id, user_id }, context) {
|
|
14
15
|
const client = context.$client;
|
|
15
16
|
const selfInfo = client.pickMember(group_id, client.uin);
|
|
16
17
|
if (!selfInfo.is_admin && !selfInfo.is_owner)
|
|
17
|
-
return { success: false, message: '
|
|
18
|
+
return { success: false, message: '机器人不是群主或管理员,无法踢出成员' };
|
|
18
19
|
if (selfInfo.user_id === user_id)
|
|
19
|
-
return { success: false, message: '
|
|
20
|
+
return { success: false, message: '机器人不能踢出自己' };
|
|
20
21
|
const memberInfo = client.pickMember(group_id, user_id);
|
|
21
22
|
if (!memberInfo)
|
|
22
23
|
return { success: false, message: '目标成员不存在' };
|
package/{tools/group_kick.ts → agents/icqq/skills/icqq-group-admin/tools/group_kick/index.ts}
RENAMED
|
@@ -7,13 +7,14 @@ export default defineAgentTool<{ group_id: number; user_id: number }>({
|
|
|
7
7
|
user_id: z.number().describe('要踢出的成员 QQ号'),
|
|
8
8
|
}),
|
|
9
9
|
adapter: 'icqq',
|
|
10
|
+
scopes:['group'],
|
|
10
11
|
permissions: ['role(master,admin,trusted,owner)'],
|
|
11
|
-
|
|
12
|
+
requiresApproval: 'once',
|
|
12
13
|
async execute({ group_id, user_id }, context) {
|
|
13
14
|
const client = context.$client;
|
|
14
15
|
const selfInfo= client.pickMember(group_id,client.uin);
|
|
15
|
-
if(!selfInfo.is_admin && !selfInfo.is_owner) return { success: false, message: '
|
|
16
|
-
if(selfInfo.user_id === user_id) return { success: false, message: '
|
|
16
|
+
if(!selfInfo.is_admin && !selfInfo.is_owner) return { success: false, message: '机器人不是群主或管理员,无法踢出成员' };
|
|
17
|
+
if(selfInfo.user_id === user_id) return { success: false, message: '机器人不能踢出自己' };
|
|
17
18
|
const memberInfo= client.pickMember(group_id,user_id);
|
|
18
19
|
if(!memberInfo) return { success: false, message: '目标成员不存在' };
|
|
19
20
|
await client.setGroupKick(group_id, user_id);
|
package/{tools/set_anonymous.js → agents/icqq/skills/icqq-group-admin/tools/set_anonymous/index.js}
RENAMED
|
@@ -8,13 +8,15 @@ export default defineAgentTool({
|
|
|
8
8
|
enable: z.boolean().optional().describe('true=开启,false=关闭,默认 true'),
|
|
9
9
|
}),
|
|
10
10
|
adapter: 'icqq',
|
|
11
|
+
requiresApproval: 'once',
|
|
12
|
+
scopes: ['group'],
|
|
11
13
|
permissions: ['role(master,trusted,owner,admin)'],
|
|
12
14
|
async execute({ group_id, enable }, context) {
|
|
13
15
|
const client = context.$client;
|
|
14
16
|
const on = enable ?? true;
|
|
15
17
|
const selfInfo = client.pickMember(group_id, client.uin);
|
|
16
18
|
if (!selfInfo.is_admin && !selfInfo.is_owner)
|
|
17
|
-
return { success: false, message: '
|
|
19
|
+
return { success: false, message: '机器人不是群主或管理员,无法开启或关闭匿名聊天' };
|
|
18
20
|
await client.setGroupAnonymous(group_id, on);
|
|
19
21
|
return { success: true, message: on ? '已开启匿名聊天' : '已关闭匿名聊天' };
|
|
20
22
|
},
|
package/{tools/set_anonymous.ts → agents/icqq/skills/icqq-group-admin/tools/set_anonymous/index.ts}
RENAMED
|
@@ -7,12 +7,14 @@ export default defineAgentTool<{ group_id: number; enable?: boolean }>({
|
|
|
7
7
|
enable: z.boolean().optional().describe('true=开启,false=关闭,默认 true'),
|
|
8
8
|
}),
|
|
9
9
|
adapter: 'icqq',
|
|
10
|
+
requiresApproval: 'once',
|
|
11
|
+
scopes:['group'],
|
|
10
12
|
permissions: ['role(master,trusted,owner,admin)'],
|
|
11
13
|
async execute({ group_id, enable }, context) {
|
|
12
14
|
const client = context.$client;
|
|
13
15
|
const on = enable ?? true;
|
|
14
16
|
const selfInfo= client.pickMember(group_id,client.uin);
|
|
15
|
-
if(!selfInfo.is_admin && !selfInfo.is_owner) return { success: false, message: '
|
|
17
|
+
if(!selfInfo.is_admin && !selfInfo.is_owner) return { success: false, message: '机器人不是群主或管理员,无法开启或关闭匿名聊天' };
|
|
16
18
|
await client.setGroupAnonymous(group_id, on);
|
|
17
19
|
return { success: true, message: on ? '已开启匿名聊天' : '已关闭匿名聊天' };
|
|
18
20
|
},
|
|
@@ -9,12 +9,13 @@ export default defineAgentTool({
|
|
|
9
9
|
duration: z.number().describe('禁言时间(秒),0=解除禁言').default(0),
|
|
10
10
|
}),
|
|
11
11
|
adapter: 'icqq',
|
|
12
|
-
|
|
12
|
+
scopes: ['group'],
|
|
13
|
+
requiresApproval: 'always',
|
|
13
14
|
async execute({ group_id, user_id, duration }, context) {
|
|
14
15
|
const client = context.$client;
|
|
15
16
|
const selfInfo = client.pickMember(group_id, client.uin);
|
|
16
17
|
if (!selfInfo.is_admin && !selfInfo.is_owner)
|
|
17
|
-
return { success: false, message: '
|
|
18
|
+
return { success: false, message: '机器人不是群主或管理员,无法禁言/解除禁言成员' };
|
|
18
19
|
const memberInfo = client.pickMember(group_id, user_id);
|
|
19
20
|
if (!memberInfo)
|
|
20
21
|
return { success: false, message: '目标成员不存在' };
|
|
@@ -8,11 +8,12 @@ export default defineAgentTool<{ group_id: number; user_id: number; duration?: n
|
|
|
8
8
|
duration: z.number().describe('禁言时间(秒),0=解除禁言').default(0),
|
|
9
9
|
}),
|
|
10
10
|
adapter: 'icqq',
|
|
11
|
-
|
|
11
|
+
scopes:['group'],
|
|
12
|
+
requiresApproval: 'always',
|
|
12
13
|
async execute({ group_id, user_id, duration }, context) {
|
|
13
14
|
const client = context.$client;
|
|
14
15
|
const selfInfo= client.pickMember(group_id,client.uin);
|
|
15
|
-
if(!selfInfo.is_admin && !selfInfo.is_owner) return { success: false, message: '
|
|
16
|
+
if(!selfInfo.is_admin && !selfInfo.is_owner) return { success: false, message: '机器人不是群主或管理员,无法禁言/解除禁言成员' };
|
|
16
17
|
const memberInfo= client.pickMember(group_id,user_id);
|
|
17
18
|
if(!memberInfo) return { success: false, message: '目标成员不存在' };
|
|
18
19
|
await client.setGroupBan(group_id, user_id, duration === 0 ? 0 : duration);
|
|
@@ -10,12 +10,13 @@ export default defineAgentTool({
|
|
|
10
10
|
duration: z.number().optional().describe('持续时间(秒),-1永久').default(-1),
|
|
11
11
|
}),
|
|
12
12
|
adapter: 'icqq',
|
|
13
|
-
|
|
13
|
+
scopes: ['group'],
|
|
14
|
+
requiresApproval: 'always',
|
|
14
15
|
async execute({ group_id, user_id, title, duration }, context) {
|
|
15
16
|
const client = context.$client;
|
|
16
17
|
const selfInfo = client.pickMember(group_id, client.uin);
|
|
17
18
|
if (!selfInfo.is_admin && !selfInfo.is_owner)
|
|
18
|
-
return { success: false, message: '
|
|
19
|
+
return { success: false, message: '机器人不是群主或管理员,无法设置头衔' };
|
|
19
20
|
const memberInfo = client.pickMember(group_id, user_id);
|
|
20
21
|
if (!memberInfo)
|
|
21
22
|
return { success: false, message: '目标成员不存在' };
|
|
@@ -9,11 +9,12 @@ export default defineAgentTool<{ group_id: number; user_id: number; title: strin
|
|
|
9
9
|
duration: z.number().optional().describe('持续时间(秒),-1永久').default(-1),
|
|
10
10
|
}),
|
|
11
11
|
adapter: 'icqq',
|
|
12
|
-
|
|
12
|
+
scopes:['group'],
|
|
13
|
+
requiresApproval: 'always',
|
|
13
14
|
async execute({ group_id, user_id, title, duration }, context) {
|
|
14
15
|
const client = context.$client;
|
|
15
16
|
const selfInfo= client.pickMember(group_id,client.uin);
|
|
16
|
-
if(!selfInfo.is_admin && !selfInfo.is_owner) return { success: false, message: '
|
|
17
|
+
if(!selfInfo.is_admin && !selfInfo.is_owner) return { success: false, message: '机器人不是群主或管理员,无法设置头衔' };
|
|
17
18
|
const memberInfo= client.pickMember(group_id,user_id);
|
|
18
19
|
if(!memberInfo) return { success: false, message: '目标成员不存在' };
|
|
19
20
|
await client.setGroupSpecialTitle(group_id, user_id, title, duration ?? -1);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: icqq-group-state
|
|
3
|
+
platforms:
|
|
4
|
+
- icqq
|
|
5
|
+
description: ICQQ 群文件与禁言状态查询能力。
|
|
6
|
+
keywords:
|
|
7
|
+
- "icqq"
|
|
8
|
+
- "群文件"
|
|
9
|
+
- "禁言列表"
|
|
10
|
+
tools:
|
|
11
|
+
- "group_files"
|
|
12
|
+
- "list_muted"
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# icqq-group-state
|
|
16
|
+
|
|
17
|
+
用于读取群文件和禁言状态。确认群号后调用,不把列表之外的信息当作已验证事实。
|