@zhin.js/adapter-napcat 1.1.14 → 1.1.16
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 +59 -0
- package/agents/napcat/messages.js +16 -0
- package/agents/napcat/messages.ts +16 -0
- package/agents/napcat/skills/napcat-account/tools/send_like/index.js +2 -1
- package/agents/napcat/skills/napcat-account/tools/send_like/index.ts +2 -1
- package/agents/napcat/skills/napcat-files-history/SKILL.md +5 -13
- package/agents/napcat/skills/napcat-group-content/SKILL.md +11 -10
- package/agents/napcat/skills/napcat-group-files-history/SKILL.md +20 -0
- package/agents/napcat/skills/napcat-group-media/SKILL.md +18 -0
- package/agents/napcat/skills/napcat-group-settings/SKILL.md +13 -12
- package/agents/napcat/skills/napcat-group-settings/tools/set_title/index.js +2 -1
- package/agents/napcat/skills/napcat-group-settings/tools/set_title/index.ts +2 -1
- package/agents/napcat/skills/napcat-media/SKILL.md +9 -14
- package/agents/napcat/skills/napcat-messaging/tools/send_poke/index.js +2 -1
- package/agents/napcat/skills/napcat-messaging/tools/send_poke/index.ts +2 -1
- package/agents/napcat/skills/napcat-private-history/SKILL.md +16 -0
- package/agents/napcat/skills/{napcat-files-history → napcat-private-history}/tools/get_friend_msg_history/index.js +1 -0
- package/agents/napcat/skills/{napcat-files-history → napcat-private-history}/tools/get_friend_msg_history/index.ts +1 -0
- package/commands/napcat/endpoint/definition.js +4 -4
- package/commands/napcat/endpoint/definition.ts +4 -4
- package/lib/endpoint-management.js +6 -0
- package/package.json +16 -16
- package/schema.json +35 -5
- package/src/endpoint-management.ts +6 -0
- /package/agents/napcat/skills/{napcat-files-history → napcat-group-files-history}/tools/get_group_file_url/index.js +0 -0
- /package/agents/napcat/skills/{napcat-files-history → napcat-group-files-history}/tools/get_group_file_url/index.ts +0 -0
- /package/agents/napcat/skills/{napcat-files-history → napcat-group-files-history}/tools/get_group_msg_history/index.js +0 -0
- /package/agents/napcat/skills/{napcat-files-history → napcat-group-files-history}/tools/get_group_msg_history/index.ts +0 -0
- /package/agents/napcat/skills/{napcat-files-history → napcat-group-files-history}/tools/get_group_root_files/index.js +0 -0
- /package/agents/napcat/skills/{napcat-files-history → napcat-group-files-history}/tools/get_group_root_files/index.ts +0 -0
- /package/agents/napcat/skills/{napcat-files-history → napcat-group-files-history}/tools/upload_group_file/index.js +0 -0
- /package/agents/napcat/skills/{napcat-files-history → napcat-group-files-history}/tools/upload_group_file/index.ts +0 -0
- /package/agents/napcat/skills/{napcat-media → napcat-group-media}/tools/ai_tts/index.js +0 -0
- /package/agents/napcat/skills/{napcat-media → napcat-group-media}/tools/ai_tts/index.ts +0 -0
- /package/agents/napcat/skills/{napcat-media → napcat-group-media}/tools/get_ai_characters/index.js +0 -0
- /package/agents/napcat/skills/{napcat-media → napcat-group-media}/tools/get_ai_characters/index.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,64 @@
|
|
|
1
1
|
# @zhin.js/adapter-napcat
|
|
2
2
|
|
|
3
|
+
## 1.1.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 334e92d: 公告:草稿 → 审批 → 发送(ADR 0037 第 1 期切片 B)。
|
|
8
|
+
|
|
9
|
+
- 新表 `ai_announcements` 与 `AiAnnouncements`:状态只前进 `draft` → `pending` → `approved` → `sent`,旁路 `rejected` / `expired` / `failed`;`revision` 乐观并发;改正文回到 `draft` 并重算 `content_hash`;待审批默认 24 小时超时。
|
|
10
|
+
- 新工具 `announcement_draft`(`risk: safe`):模型只能建草稿,不能提交、审批或发送。
|
|
11
|
+
- Console `plugin.root.announcements` / `announcement`(读)与 `announcement-create` / `-edit` / `-submit` / `-approve` / `-reject` / `-resend`(动作,暂用 `control:read` / `control:write`)。
|
|
12
|
+
- 批准即发送:摘要复核 → 控制面 → 会话画像 → 硬闸以公告审批记录作批准(`ToolHardGate.checkPreApproved`,不弹第二张卡)→ `EndpointManagement.sendGroupNotice`(icqq / napcat)。被拦或失败置 `failed`,不自动重试;重发回到 `pending` 需再批一次;摘要不符拒绝(`announcement_hash_mismatch`)。
|
|
13
|
+
- 审计追加 kind `announcement` 与码 `announcement_drafted` / `_submitted` / `_approved` / `_rejected` / `_expired` / `_sent` / `_send_failed` / `_resend` / `_hash_mismatch`。
|
|
14
|
+
|
|
15
|
+
- 53bc6a0: 适配器配置标签、端点命令和工具反馈支持中英文;复用当前操作语言,保持协议值、用户内容、身份、权限与发送链路不变。Sandbox 展示使用项目语言,QQ 绑定与交互状态保留完整会话身份。
|
|
16
|
+
- Updated dependencies [334e92d]
|
|
17
|
+
- Updated dependencies [f3b7c9f]
|
|
18
|
+
- Updated dependencies [658a5fb]
|
|
19
|
+
- Updated dependencies [144a17b]
|
|
20
|
+
- Updated dependencies [18296cf]
|
|
21
|
+
- Updated dependencies [08e64de]
|
|
22
|
+
- Updated dependencies [9cade30]
|
|
23
|
+
- Updated dependencies [53bc6a0]
|
|
24
|
+
- Updated dependencies [7595136]
|
|
25
|
+
- Updated dependencies [66b6404]
|
|
26
|
+
- Updated dependencies [adb4af2]
|
|
27
|
+
- Updated dependencies [69f9ef6]
|
|
28
|
+
- Updated dependencies [17d1301]
|
|
29
|
+
- @zhin.js/adapter@1.1.23
|
|
30
|
+
- @zhin.js/host-http@1.1.10
|
|
31
|
+
- @zhin.js/core@1.1.51
|
|
32
|
+
- @zhin.js/permission@1.1.9
|
|
33
|
+
- @zhin.js/tool@1.1.10
|
|
34
|
+
- @zhin.js/skill@1.1.10
|
|
35
|
+
- @zhin.js/im-contract@1.1.7
|
|
36
|
+
- @zhin.js/agent-feature@1.1.10
|
|
37
|
+
- @zhin.js/feature-kit@1.1.9
|
|
38
|
+
|
|
39
|
+
## 1.1.15
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- 7d68df6: 精简 Agent 内置固定提示词与消息说明,保留工具、审批和结构化回复能力。适配器 Skill 按会话场景拆分,群/频道管理仅向对应场景披露;提示段与模型消息段支持场景声明,沿用当前回合权限和 generation 投影。
|
|
44
|
+
- Updated dependencies [f98025b]
|
|
45
|
+
- Updated dependencies [66ec1a5]
|
|
46
|
+
- Updated dependencies [7d68df6]
|
|
47
|
+
- Updated dependencies [bf0fa9f]
|
|
48
|
+
- Updated dependencies [3326db3]
|
|
49
|
+
- Updated dependencies [e91235e]
|
|
50
|
+
- Updated dependencies [6da2bad]
|
|
51
|
+
- Updated dependencies [3781f1c]
|
|
52
|
+
- @zhin.js/core@1.1.50
|
|
53
|
+
- @zhin.js/adapter@1.1.22
|
|
54
|
+
- @zhin.js/im-contract@1.1.6
|
|
55
|
+
- @zhin.js/tool@1.1.9
|
|
56
|
+
- @zhin.js/host-http@1.1.9
|
|
57
|
+
- @zhin.js/agent-feature@1.1.9
|
|
58
|
+
- @zhin.js/feature-kit@1.1.8
|
|
59
|
+
- @zhin.js/permission@1.1.8
|
|
60
|
+
- @zhin.js/skill@1.1.9
|
|
61
|
+
|
|
3
62
|
## 1.1.14
|
|
4
63
|
|
|
5
64
|
### Patch Changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { createMessages } from 'zhin.js/i18n';
|
|
3
|
+
export const messages = createMessages({
|
|
4
|
+
"likesSent": {
|
|
5
|
+
"zh-CN": "已给 {p0} 点赞 {p1} 次",
|
|
6
|
+
"en": "Sent {p1} likes to {p0}"
|
|
7
|
+
},
|
|
8
|
+
"memberTitleSet": {
|
|
9
|
+
"zh-CN": "已设置 {p0} 头衔为 \"{p1}\"",
|
|
10
|
+
"en": "Title for {p0} set to \"{p1}\""
|
|
11
|
+
},
|
|
12
|
+
"userPoked": {
|
|
13
|
+
"zh-CN": "已戳 {p0}",
|
|
14
|
+
"en": "Poked {p0}"
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createMessages } from 'zhin.js/i18n';
|
|
2
|
+
|
|
3
|
+
export const messages = createMessages({
|
|
4
|
+
"likesSent": {
|
|
5
|
+
"zh-CN": "已给 {p0} 点赞 {p1} 次",
|
|
6
|
+
"en": "Sent {p1} likes to {p0}"
|
|
7
|
+
},
|
|
8
|
+
"memberTitleSet": {
|
|
9
|
+
"zh-CN": "已设置 {p0} 头衔为 \"{p1}\"",
|
|
10
|
+
"en": "Title for {p0} set to \"{p1}\""
|
|
11
|
+
},
|
|
12
|
+
"userPoked": {
|
|
13
|
+
"zh-CN": "已戳 {p0}",
|
|
14
|
+
"en": "Poked {p0}"
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
export default defineAgentTool({
|
|
@@ -13,6 +14,6 @@ export default defineAgentTool({
|
|
|
13
14
|
async execute({ user_id, times }, context) {
|
|
14
15
|
const endpoint = context.$client;
|
|
15
16
|
await endpoint.sendLike(user_id, times || 1);
|
|
16
|
-
return { success: true, message:
|
|
17
|
+
return { success: true, message: t(context.locale, 'likesSent', { p0: user_id, p1: times || 1 }) };
|
|
17
18
|
},
|
|
18
19
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
|
|
@@ -13,6 +14,6 @@ export default defineAgentTool<{ user_id: number; times?: number }>({
|
|
|
13
14
|
async execute({ user_id, times }: { user_id: number; times?: number }, context) {
|
|
14
15
|
const endpoint = context.$client;
|
|
15
16
|
await endpoint.sendLike(user_id, times || 1);
|
|
16
|
-
return { success: true, message:
|
|
17
|
+
return { success: true, message: t(context.locale, 'likesSent', { p0: user_id, p1: times || 1 }) };
|
|
17
18
|
},
|
|
18
19
|
});
|
|
@@ -2,21 +2,13 @@
|
|
|
2
2
|
name: napcat-files-history
|
|
3
3
|
platforms:
|
|
4
4
|
- napcat
|
|
5
|
-
description: NapCatQQ
|
|
5
|
+
description: NapCatQQ 文件下载。
|
|
6
6
|
keywords:
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
- "下载"
|
|
10
|
-
- "消息历史"
|
|
7
|
+
- napcat
|
|
8
|
+
- 下载
|
|
11
9
|
tools:
|
|
12
|
-
-
|
|
13
|
-
- "get_group_file_url"
|
|
14
|
-
- "get_group_root_files"
|
|
15
|
-
- "download_file"
|
|
16
|
-
- "get_group_msg_history"
|
|
17
|
-
- "get_friend_msg_history"
|
|
10
|
+
- download_file
|
|
18
11
|
---
|
|
19
|
-
|
|
20
12
|
# napcat-files-history
|
|
21
13
|
|
|
22
|
-
|
|
14
|
+
下载给定文件到缓存目录;只读取任务必需范围,保留工具返回的真实路径。
|
|
@@ -4,18 +4,19 @@ platforms:
|
|
|
4
4
|
- napcat
|
|
5
5
|
description: NapCatQQ 群公告与精华消息管理能力。
|
|
6
6
|
keywords:
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
7
|
+
- napcat
|
|
8
|
+
- 群公告
|
|
9
|
+
- 精华消息
|
|
10
10
|
tools:
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
11
|
+
- set_essence_msg
|
|
12
|
+
- delete_essence_msg
|
|
13
|
+
- get_essence_list
|
|
14
|
+
- send_group_notice
|
|
15
|
+
- get_group_notice
|
|
16
|
+
- del_group_notice
|
|
17
|
+
scopes:
|
|
18
|
+
- group
|
|
17
19
|
---
|
|
18
|
-
|
|
19
20
|
# napcat-group-content
|
|
20
21
|
|
|
21
22
|
先读取现有公告或精华列表,再进行创建、删除或变更;删除操作必须复核稳定 ID。
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: napcat-group-files-history
|
|
3
|
+
platforms:
|
|
4
|
+
- napcat
|
|
5
|
+
scopes:
|
|
6
|
+
- group
|
|
7
|
+
description: NapCatQQ 群文件与群消息历史。
|
|
8
|
+
keywords:
|
|
9
|
+
- napcat
|
|
10
|
+
- 群文件
|
|
11
|
+
- 消息历史
|
|
12
|
+
tools:
|
|
13
|
+
- upload_group_file
|
|
14
|
+
- get_group_file_url
|
|
15
|
+
- get_group_root_files
|
|
16
|
+
- get_group_msg_history
|
|
17
|
+
---
|
|
18
|
+
# napcat-group-files-history
|
|
19
|
+
|
|
20
|
+
文件和历史可能包含敏感内容,只读取任务必需范围;上传前确认目标群和文件。
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: napcat-group-media
|
|
3
|
+
platforms:
|
|
4
|
+
- napcat
|
|
5
|
+
scopes:
|
|
6
|
+
- group
|
|
7
|
+
description: NapCatQQ 群 AI 语音角色查询与 TTS。
|
|
8
|
+
keywords:
|
|
9
|
+
- napcat
|
|
10
|
+
- tts
|
|
11
|
+
- 语音
|
|
12
|
+
tools:
|
|
13
|
+
- ai_tts
|
|
14
|
+
- get_ai_characters
|
|
15
|
+
---
|
|
16
|
+
# napcat-group-media
|
|
17
|
+
|
|
18
|
+
先查询角色,再生成群 AI 语音;确认目标群。
|
|
@@ -4,20 +4,21 @@ platforms:
|
|
|
4
4
|
- napcat
|
|
5
5
|
description: NapCatQQ 群状态、群头像、头衔与签到设置能力。
|
|
6
6
|
keywords:
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
7
|
+
- napcat
|
|
8
|
+
- 群设置
|
|
9
|
+
- 群头像
|
|
10
|
+
- 头衔
|
|
11
|
+
- 签到
|
|
12
|
+
- 禁言
|
|
13
13
|
tools:
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
14
|
+
- get_group_shut_list
|
|
15
|
+
- set_group_portrait
|
|
16
|
+
- set_title
|
|
17
|
+
- group_sign
|
|
18
|
+
- get_group_info_ex
|
|
19
|
+
scopes:
|
|
20
|
+
- group
|
|
19
21
|
---
|
|
20
|
-
|
|
21
22
|
# napcat-group-settings
|
|
22
23
|
|
|
23
24
|
查询群状态后再修改群设置。头像和头衔变更遵守审批策略,不根据昵称猜测成员。
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
export default defineAgentTool({
|
|
@@ -16,6 +17,6 @@ export default defineAgentTool({
|
|
|
16
17
|
async execute({ group_id, user_id, title }, context) {
|
|
17
18
|
const endpoint = context.$client;
|
|
18
19
|
await endpoint.setTitle(group_id, user_id, title);
|
|
19
|
-
return { success: true, message:
|
|
20
|
+
return { success: true, message: t(context.locale, 'memberTitleSet', { p0: user_id, p1: title }) };
|
|
20
21
|
},
|
|
21
22
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
|
|
@@ -16,6 +17,6 @@ export default defineAgentTool<{ group_id: number; user_id: number; title: strin
|
|
|
16
17
|
async execute({ group_id, user_id, title }: { group_id: number; user_id: number; title: string }, context) {
|
|
17
18
|
const endpoint = context.$client;
|
|
18
19
|
await endpoint.setTitle(group_id, user_id, title);
|
|
19
|
-
return { success: true, message:
|
|
20
|
+
return { success: true, message: t(context.locale, 'memberTitleSet', { p0: user_id, p1: title }) };
|
|
20
21
|
},
|
|
21
22
|
});
|
|
@@ -2,22 +2,17 @@
|
|
|
2
2
|
name: napcat-media
|
|
3
3
|
platforms:
|
|
4
4
|
- napcat
|
|
5
|
-
description: NapCatQQ
|
|
5
|
+
description: NapCatQQ OCR、小程序卡片与翻译。
|
|
6
6
|
keywords:
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
- "翻译"
|
|
12
|
-
- "小程序"
|
|
7
|
+
- napcat
|
|
8
|
+
- ocr
|
|
9
|
+
- 翻译
|
|
10
|
+
- 小程序
|
|
13
11
|
tools:
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
- "get_mini_app_ark"
|
|
18
|
-
- "translate"
|
|
12
|
+
- ocr_image
|
|
13
|
+
- get_mini_app_ark
|
|
14
|
+
- translate
|
|
19
15
|
---
|
|
20
|
-
|
|
21
16
|
# napcat-media
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
按任务选择 OCR、小程序卡片或翻译工具;只使用真实输入,保留识别和翻译结果的不确定性。
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
export default defineAgentTool({
|
|
@@ -13,6 +14,6 @@ export default defineAgentTool({
|
|
|
13
14
|
async execute({ user_id, group_id }, context) {
|
|
14
15
|
const endpoint = context.$client;
|
|
15
16
|
await endpoint.sendPoke(user_id, group_id);
|
|
16
|
-
return { success: true, message:
|
|
17
|
+
return { success: true, message: t(context.locale, 'userPoked', { p0: user_id }) };
|
|
17
18
|
},
|
|
18
19
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
|
|
@@ -13,6 +14,6 @@ export default defineAgentTool<{ user_id: number; group_id?: number }>({
|
|
|
13
14
|
async execute({ user_id, group_id }: { user_id: number; group_id?: number }, context) {
|
|
14
15
|
const endpoint = context.$client;
|
|
15
16
|
await endpoint.sendPoke(user_id, group_id);
|
|
16
|
-
return { success: true, message:
|
|
17
|
+
return { success: true, message: t(context.locale, 'userPoked', { p0: user_id }) };
|
|
17
18
|
},
|
|
18
19
|
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: napcat-private-history
|
|
3
|
+
platforms:
|
|
4
|
+
- napcat
|
|
5
|
+
scopes:
|
|
6
|
+
- private
|
|
7
|
+
description: NapCatQQ 私聊消息历史。
|
|
8
|
+
keywords:
|
|
9
|
+
- napcat
|
|
10
|
+
- 消息历史
|
|
11
|
+
tools:
|
|
12
|
+
- get_friend_msg_history
|
|
13
|
+
---
|
|
14
|
+
# napcat-private-history
|
|
15
|
+
|
|
16
|
+
只读取任务必需的私聊记录,不把其他会话的历史发送给当前用户。
|
|
@@ -9,6 +9,7 @@ export default defineAgentTool({
|
|
|
9
9
|
count: z.number().optional().describe('获取条数(可选)'),
|
|
10
10
|
}),
|
|
11
11
|
adapter: 'napcat',
|
|
12
|
+
scopes: ["private"],
|
|
12
13
|
tags: ['napcat', 'qq'],
|
|
13
14
|
keywords: ['私聊记录', '好友聊天记录', 'friend history'],
|
|
14
15
|
async execute({ user_id, message_seq, count }, context) {
|
|
@@ -9,6 +9,7 @@ export default defineAgentTool<{ user_id: number; message_seq?: number; count?:
|
|
|
9
9
|
count: z.number().optional().describe('获取条数(可选)'),
|
|
10
10
|
}),
|
|
11
11
|
adapter: 'napcat',
|
|
12
|
+
scopes: ["private"],
|
|
12
13
|
tags: ['napcat', 'qq'],
|
|
13
14
|
keywords: ['私聊记录', '好友聊天记录', 'friend history'],
|
|
14
15
|
async execute({ user_id, message_seq, count }: { user_id: number; message_seq?: number; count?: number }, context) {
|
|
@@ -10,10 +10,10 @@ export const napcatEndpointCommands = createEndpointCommands({
|
|
|
10
10
|
adapterKey: 'napcat',
|
|
11
11
|
adapterDisplayName: 'NapCat',
|
|
12
12
|
fields: [
|
|
13
|
-
{ key: 'url', description: 'NapCat WebSocket URL(connection: ws 必填)' },
|
|
14
|
-
{ key: 'path', description: 'reverse-wss 路径(connection: wss)' },
|
|
15
|
-
{ key: 'http_url', description: 'HTTP API base URL(connection: http 出站)' },
|
|
16
|
-
{ key: 'post_path', description: 'HTTP POST 事件路径(connection: http 入站)' },
|
|
13
|
+
{ key: 'url', description: 'NapCat WebSocket URL(connection: ws 必填)', descriptionI18n: { en: "NapCat WebSocket URL (required for connection: ws)" } },
|
|
14
|
+
{ key: 'path', description: 'reverse-wss 路径(connection: wss)', descriptionI18n: { en: "Reverse WebSocket path (connection: wss)" } },
|
|
15
|
+
{ key: 'http_url', description: 'HTTP API base URL(connection: http 出站)', descriptionI18n: { en: "HTTP API base URL (outbound connection: http)" } },
|
|
16
|
+
{ key: 'post_path', description: 'HTTP POST 事件路径(connection: http 入站)', descriptionI18n: { en: "HTTP POST event path (inbound connection: http)" } },
|
|
17
17
|
{ key: 'access_token', env: true, description: 'NapCat access token' },
|
|
18
18
|
],
|
|
19
19
|
running: (use) => use(napcatRuntimeStateToken).endpoints.values(),
|
|
@@ -10,10 +10,10 @@ export const napcatEndpointCommands = createEndpointCommands({
|
|
|
10
10
|
adapterKey: 'napcat',
|
|
11
11
|
adapterDisplayName: 'NapCat',
|
|
12
12
|
fields: [
|
|
13
|
-
{ key: 'url', description: 'NapCat WebSocket URL(connection: ws 必填)' },
|
|
14
|
-
{ key: 'path', description: 'reverse-wss 路径(connection: wss)' },
|
|
15
|
-
{ key: 'http_url', description: 'HTTP API base URL(connection: http 出站)' },
|
|
16
|
-
{ key: 'post_path', description: 'HTTP POST 事件路径(connection: http 入站)' },
|
|
13
|
+
{ key: 'url', description: 'NapCat WebSocket URL(connection: ws 必填)', descriptionI18n: { en: "NapCat WebSocket URL (required for connection: ws)" } },
|
|
14
|
+
{ key: 'path', description: 'reverse-wss 路径(connection: wss)', descriptionI18n: { en: "Reverse WebSocket path (connection: wss)" } },
|
|
15
|
+
{ key: 'http_url', description: 'HTTP API base URL(connection: http 出站)', descriptionI18n: { en: "HTTP API base URL (outbound connection: http)" } },
|
|
16
|
+
{ key: 'post_path', description: 'HTTP POST 事件路径(connection: http 入站)', descriptionI18n: { en: "HTTP POST event path (inbound connection: http)" } },
|
|
17
17
|
{ key: 'access_token', env: true, description: 'NapCat access token' },
|
|
18
18
|
],
|
|
19
19
|
running: (use) => use(napcatRuntimeStateToken).endpoints.values(),
|
|
@@ -27,6 +27,12 @@ export function createNapCatEndpointManagement(endpoint) {
|
|
|
27
27
|
});
|
|
28
28
|
return toArray(data);
|
|
29
29
|
},
|
|
30
|
+
async sendGroupNotice(groupId, content) {
|
|
31
|
+
await endpoint.callApi('_send_group_notice', {
|
|
32
|
+
group_id: toNumberId(groupId, 'group_id'),
|
|
33
|
+
content,
|
|
34
|
+
});
|
|
35
|
+
},
|
|
30
36
|
});
|
|
31
37
|
}
|
|
32
38
|
function asRecord(value) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-napcat",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.16",
|
|
4
4
|
"description": "Zhin.js NapCat adapter for Plugin Runtime (WebSocket client, OneBot11 + NapCat extensions)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -44,16 +44,16 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"ws": "^8.21.1",
|
|
47
|
-
"@zhin.js/adapter": "1.1.
|
|
48
|
-
"@zhin.js/agent-feature": "1.1.
|
|
49
|
-
"@zhin.js/
|
|
50
|
-
"@zhin.js/
|
|
51
|
-
"@zhin.js/
|
|
47
|
+
"@zhin.js/adapter": "1.1.23",
|
|
48
|
+
"@zhin.js/agent-feature": "1.1.10",
|
|
49
|
+
"@zhin.js/core": "1.1.51",
|
|
50
|
+
"@zhin.js/im-contract": "1.1.7",
|
|
51
|
+
"@zhin.js/feature-kit": "1.1.9",
|
|
52
52
|
"@zhin.js/logger": "1.1.2",
|
|
53
|
-
"@zhin.js/permission": "1.1.
|
|
54
|
-
"@zhin.js/
|
|
55
|
-
"@zhin.js/
|
|
56
|
-
"@zhin.js/
|
|
53
|
+
"@zhin.js/permission": "1.1.9",
|
|
54
|
+
"@zhin.js/host-http": "1.1.10",
|
|
55
|
+
"@zhin.js/skill": "1.1.10",
|
|
56
|
+
"@zhin.js/tool": "1.1.10"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/node": "^26.1.2",
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
"typescript": "^6.0.3",
|
|
62
62
|
"vitest": "^4.1.10",
|
|
63
63
|
"zod": "^4.4.3",
|
|
64
|
-
"
|
|
65
|
-
"zhin.js": "1.1.
|
|
64
|
+
"zhin.js": "1.1.16",
|
|
65
|
+
"@zhin.js/host-http": "1.1.10"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"zod": "^4.0.0",
|
|
69
|
-
"@zhin.js/adapter": "^1.1.
|
|
70
|
-
"@zhin.js/
|
|
71
|
-
"zhin.js": "^1.1.
|
|
72
|
-
"
|
|
69
|
+
"@zhin.js/adapter": "^1.1.23",
|
|
70
|
+
"@zhin.js/core": "^1.1.51",
|
|
71
|
+
"@zhin.js/command": "^1.1.11",
|
|
72
|
+
"zhin.js": "^1.1.16"
|
|
73
73
|
},
|
|
74
74
|
"peerDependenciesMeta": {
|
|
75
75
|
"@zhin.js/command": {
|
package/schema.json
CHANGED
|
@@ -30,7 +30,12 @@
|
|
|
30
30
|
"string",
|
|
31
31
|
"number"
|
|
32
32
|
],
|
|
33
|
-
"description": "框架 master(QQ uin;AI/工具权限、endpoint 管理)。endpoints[i].master 可逐项覆盖"
|
|
33
|
+
"description": "框架 master(QQ uin;AI/工具权限、endpoint 管理)。endpoints[i].master 可逐项覆盖",
|
|
34
|
+
"x-i18n": {
|
|
35
|
+
"en": {
|
|
36
|
+
"description": "Framework masters (QQ uin; AI/tool permissions and endpoint management). endpoints[i].master can override this value."
|
|
37
|
+
}
|
|
38
|
+
}
|
|
34
39
|
},
|
|
35
40
|
"trusted": {
|
|
36
41
|
"type": "array",
|
|
@@ -41,7 +46,12 @@
|
|
|
41
46
|
],
|
|
42
47
|
"description": "Trusted QQ uin"
|
|
43
48
|
},
|
|
44
|
-
"description": "框架 trusted 用户列表(弱于 master)。endpoints[i].trusted 可逐项追加"
|
|
49
|
+
"description": "框架 trusted 用户列表(弱于 master)。endpoints[i].trusted 可逐项追加",
|
|
50
|
+
"x-i18n": {
|
|
51
|
+
"en": {
|
|
52
|
+
"description": "Framework trusted users, below master authority. endpoints[i].trusted can add users."
|
|
53
|
+
}
|
|
54
|
+
}
|
|
45
55
|
},
|
|
46
56
|
"endpoints": {
|
|
47
57
|
"type": "array",
|
|
@@ -56,7 +66,12 @@
|
|
|
56
66
|
"string",
|
|
57
67
|
"number"
|
|
58
68
|
],
|
|
59
|
-
"description": "本 endpoint 的框架 master(QQ uin);覆盖顶层 master"
|
|
69
|
+
"description": "本 endpoint 的框架 master(QQ uin);覆盖顶层 master",
|
|
70
|
+
"x-i18n": {
|
|
71
|
+
"en": {
|
|
72
|
+
"description": "Framework masters for this endpoint (QQ uin), overriding the top-level master list."
|
|
73
|
+
}
|
|
74
|
+
}
|
|
60
75
|
},
|
|
61
76
|
"trusted": {
|
|
62
77
|
"type": "array",
|
|
@@ -67,7 +82,12 @@
|
|
|
67
82
|
],
|
|
68
83
|
"description": "Trusted QQ uin"
|
|
69
84
|
},
|
|
70
|
-
"description": "本 endpoint 的 trusted 列表"
|
|
85
|
+
"description": "本 endpoint 的 trusted 列表",
|
|
86
|
+
"x-i18n": {
|
|
87
|
+
"en": {
|
|
88
|
+
"description": "Trusted users for this endpoint."
|
|
89
|
+
}
|
|
90
|
+
}
|
|
71
91
|
},
|
|
72
92
|
"connection": {
|
|
73
93
|
"type": "string",
|
|
@@ -117,12 +137,22 @@
|
|
|
117
137
|
"required": [
|
|
118
138
|
"id"
|
|
119
139
|
]
|
|
140
|
+
},
|
|
141
|
+
"x-i18n": {
|
|
142
|
+
"en": {
|
|
143
|
+
"description": "Multiple accounts: mount multiple endpoints in one plugin instance. Each entry uses the top-level fields; id is required and other fields override defaults."
|
|
144
|
+
}
|
|
120
145
|
}
|
|
121
146
|
},
|
|
122
147
|
"commandPrefix": {
|
|
123
148
|
"type": "string",
|
|
124
149
|
"default": "",
|
|
125
|
-
"description": "命令前缀(默认 '' 无前缀,任意文本按命令匹配;如 '/' 要求 / 开头)。endpoints[i] 可逐项覆盖"
|
|
150
|
+
"description": "命令前缀(默认 '' 无前缀,任意文本按命令匹配;如 '/' 要求 / 开头)。endpoints[i] 可逐项覆盖",
|
|
151
|
+
"x-i18n": {
|
|
152
|
+
"en": {
|
|
153
|
+
"description": "Command prefix. The default empty string allows unprefixed commands; '/' requires a leading slash. Each endpoints[i] can override it."
|
|
154
|
+
}
|
|
155
|
+
}
|
|
126
156
|
}
|
|
127
157
|
},
|
|
128
158
|
"required": [
|
|
@@ -49,6 +49,12 @@ export function createNapCatEndpointManagement(
|
|
|
49
49
|
});
|
|
50
50
|
return toArray(data);
|
|
51
51
|
},
|
|
52
|
+
async sendGroupNotice(groupId: string, content: string): Promise<void> {
|
|
53
|
+
await endpoint.callApi('_send_group_notice', {
|
|
54
|
+
group_id: toNumberId(groupId, 'group_id'),
|
|
55
|
+
content,
|
|
56
|
+
});
|
|
57
|
+
},
|
|
52
58
|
});
|
|
53
59
|
}
|
|
54
60
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/agents/napcat/skills/{napcat-media → napcat-group-media}/tools/get_ai_characters/index.js
RENAMED
|
File without changes
|
/package/agents/napcat/skills/{napcat-media → napcat-group-media}/tools/get_ai_characters/index.ts
RENAMED
|
File without changes
|