@zhin.js/adapter-qq 7.0.10 → 7.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 +20 -0
- package/README.md +1 -1
- package/adapters/qq.js +1 -1
- package/adapters/qq.ts +1 -1
- package/commands/endpoint/cancel.js +1 -1
- package/commands/endpoint/cancel.ts +1 -1
- package/lib/endpoint.d.ts +2 -2
- package/lib/protocol.js +1 -1
- package/lib/qq-bind-persist.d.ts +1 -1
- package/lib/qq-bind-persist.js +1 -1
- package/lib/qq-endpoint-commands.d.ts +1 -1
- package/lib/qq-endpoint-commands.js +2 -2
- package/lib/qq-endpoint-config.js +1 -1
- package/lib/qq-runtime-state.d.ts +1 -1
- package/lib/qq-runtime-state.js +1 -1
- package/middlewares/bot-kind-reply.js +1 -1
- package/middlewares/bot-kind-reply.ts +2 -2
- package/package.json +20 -16
- package/plugin.js +1 -1
- package/src/endpoint.ts +2 -2
- package/src/protocol.ts +1 -1
- package/src/qq-bind-persist.ts +1 -1
- package/src/qq-endpoint-commands.ts +2 -2
- package/src/qq-endpoint-config.ts +1 -1
- package/src/qq-runtime-state.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @zhin.js/adapter-qq
|
|
2
2
|
|
|
3
|
+
## 7.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
|
+
## 7.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/agent@1.1.11
|
|
22
|
+
|
|
3
23
|
## 7.0.10
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ pnpm add @zhin.js/adapter-qq
|
|
|
21
21
|
|
|
22
22
|
- `@zhin.js/adapter` — 约定式 `adapters/qq.ts`(`defineAdapter`)
|
|
23
23
|
- `@zhin.js/core` — `messageGatewayToken` 入站/出站
|
|
24
|
-
-
|
|
24
|
+
- `zhin.js` — `plugin.ts`(`definePlugin`)
|
|
25
25
|
- 配置经插件 `schema.json` 落到 `plugins.<instanceKey>`
|
|
26
26
|
- **无需** `@zhin.js/host-http` / `@zhin.js/host-router`(WebSocket 路径)
|
|
27
27
|
|
package/adapters/qq.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Convention entry: discover `adapters/qq.ts` → defineAdapter.
|
|
4
4
|
*/
|
|
5
|
-
import { defineAdapter } from '
|
|
5
|
+
import { defineAdapter } from 'zhin.js/adapter';
|
|
6
6
|
import { messageGatewayToken } from '@zhin.js/core/runtime';
|
|
7
7
|
import { httpHostToken } from '@zhin.js/host-http';
|
|
8
8
|
import { QqHttpEndpoint, QqWebsocketEndpoint } from "../lib/endpoint.js";
|
package/adapters/qq.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Convention entry: discover `adapters/qq.ts` → defineAdapter.
|
|
3
3
|
*/
|
|
4
|
-
import { defineAdapter } from '
|
|
4
|
+
import { defineAdapter } from 'zhin.js/adapter';
|
|
5
5
|
import { messageGatewayToken } from '@zhin.js/core/runtime';
|
|
6
6
|
import { httpHostToken } from '@zhin.js/host-http';
|
|
7
7
|
import { QqHttpEndpoint, QqWebsocketEndpoint } from '../src/endpoint.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
-
import { defineCommand } from '
|
|
2
|
+
import { defineCommand } from 'zhin.js/command';
|
|
3
3
|
import { isQqEndpointOperator, QQ_ENDPOINT_FORBIDDEN, runQqEndpointCancel, } from "../../lib/qq-endpoint-commands.js";
|
|
4
4
|
import { qqRuntimeStateToken } from "../../lib/qq-runtime-state.js";
|
|
5
5
|
export default defineCommand({
|
package/lib/endpoint.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* QQ endpoints — lifecycle, outbound, admit, agent tool surface.
|
|
3
3
|
*/
|
|
4
|
-
import type { EndpointInstance, EndpointManagement, EndpointSendRequest } from '
|
|
4
|
+
import type { EndpointInstance, EndpointManagement, EndpointSendRequest } from 'zhin.js/adapter';
|
|
5
5
|
import type { MessageGateway } from '@zhin.js/core/runtime';
|
|
6
6
|
import type { HttpHost } from '@zhin.js/host-http';
|
|
7
|
-
import type { CapabilityId } from '
|
|
7
|
+
import type { CapabilityId } from 'zhin.js';
|
|
8
8
|
import { type QqInboundMessage, type ResolvedQqHttpConfig, type ResolvedQqWebsocketConfig } from './protocol.js';
|
|
9
9
|
import { type CreateQqHttpBot } from './webhook.js';
|
|
10
10
|
import { type CreateQqBot } from './ws.js';
|
package/lib/protocol.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* QQ Official Bot protocol helpers — no legacy Adapter/Endpoint / segment-mapper.
|
|
3
3
|
* Canonicalization is owned by gateway/core before endpoint.send.
|
|
4
4
|
*/
|
|
5
|
-
import { pickCredential } from '
|
|
5
|
+
import { pickCredential } from 'zhin.js/adapter';
|
|
6
6
|
import { formatCompact, getLogger } from '@zhin.js/logger';
|
|
7
7
|
import { resolveQqIntents } from './qq-intents.js';
|
|
8
8
|
const logger = getLogger('qq');
|
package/lib/qq-bind-persist.d.ts
CHANGED
package/lib/qq-bind-persist.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildEndpointEnvKey, persistEndpointEnvValues, resolveProjectRoot, } from '
|
|
1
|
+
import { buildEndpointEnvKey, persistEndpointEnvValues, resolveProjectRoot, } from 'zhin.js/adapter';
|
|
2
2
|
export { resolveProjectRoot };
|
|
3
3
|
/** 按 endpoint 名称生成唯一 env 键(如 `QQ_MY_BOT_APPID`) */
|
|
4
4
|
export function buildQqCredentialEnvKeys(endpointId) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* 扫码绑定 add 流程(经套件 bindFlow 钩子接入)与 cancel,并导出
|
|
6
6
|
* qqEndpointCommands 供 commands/endpoint/ 下的命令文件默认导出。
|
|
7
7
|
*/
|
|
8
|
-
import { type EndpointCommandReply } from '
|
|
8
|
+
import { type EndpointCommandReply } from 'zhin.js/adapter';
|
|
9
9
|
import { type QqBotKind } from './qq-intents.js';
|
|
10
10
|
import { type QqPendingBotKind, type QqRuntimeState } from './qq-runtime-state.js';
|
|
11
11
|
export type QqCommandReply = EndpointCommandReply;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* 扫码绑定 add 流程(经套件 bindFlow 钩子接入)与 cancel,并导出
|
|
6
6
|
* qqEndpointCommands 供 commands/endpoint/ 下的命令文件默认导出。
|
|
7
7
|
*/
|
|
8
|
-
import { createEndpointCommands, endpointCommandForbidden, extractEndpointCommandReply, formatEndpointList, isEndpointOperator, removeEndpointById, } from '
|
|
9
|
-
import { defineCommand } from '
|
|
8
|
+
import { createEndpointCommands, endpointCommandForbidden, extractEndpointCommandReply, formatEndpointList, isEndpointOperator, removeEndpointById, } from 'zhin.js/adapter';
|
|
9
|
+
import { defineCommand } from 'zhin.js/command';
|
|
10
10
|
import { QQ_BOT_KIND_PROMPT, qqCommandSessionKey } from './qq-bot-kind-prompt.js';
|
|
11
11
|
import { startQqBindFlow } from './qq-bind-flow.js';
|
|
12
12
|
import { persistQqCredentialsToEnv } from './qq-bind-persist.js';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 实现已泛化到 @zhin.js/adapter 的 endpoint-commands 套件(Document 节点级保留注释);
|
|
4
4
|
* 本文件仅保留 QQ 专用签名以兼容既有调用与测试。
|
|
5
5
|
*/
|
|
6
|
-
import { addEndpointToConfig, findEndpointConfigFile, listConfiguredEndpoints, removeEndpointFromConfig, } from '
|
|
6
|
+
import { addEndpointToConfig, findEndpointConfigFile, listConfiguredEndpoints, removeEndpointFromConfig, } from 'zhin.js/adapter';
|
|
7
7
|
/** 定位项目配置文件:ZHIN_CONFIG 指定优先,否则发现 zhin.config.yml/.yaml,都没有则默认新建 zhin.config.yml */
|
|
8
8
|
export function findQqConfigFile(projectRoot) {
|
|
9
9
|
return findEndpointConfigFile('qq', projectRoot);
|
|
@@ -27,4 +27,4 @@ export interface QqRuntimeState {
|
|
|
27
27
|
pendingBotKind: QqPendingBotKind | null;
|
|
28
28
|
}
|
|
29
29
|
export declare function createQqRuntimeState(): QqRuntimeState;
|
|
30
|
-
export declare const qqRuntimeStateToken: import("
|
|
30
|
+
export declare const qqRuntimeStateToken: import("zhin.js").Token<QqRuntimeState>;
|
package/lib/qq-runtime-state.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 扫码绑定 / 待选 botKind 流程。由 plugin.ts setup() provide,
|
|
4
4
|
* adapter create 与 commands / middleware 通过 use(qqRuntimeStateToken) 共享。
|
|
5
5
|
*/
|
|
6
|
-
import { createToken } from '
|
|
6
|
+
import { createToken } from 'zhin.js';
|
|
7
7
|
export function createQqRuntimeState() {
|
|
8
8
|
return {
|
|
9
9
|
endpoints: new Map(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
-
import { defineMiddleware } from '
|
|
2
|
+
import { defineMiddleware } from 'zhin.js/middleware';
|
|
3
3
|
import { completeQqPendingBotKind, } from "../lib/qq-endpoint-commands.js";
|
|
4
4
|
import { parseQqBotKindAnswer, qqCommandSessionKey, QQ_BOT_KIND_PROMPT, } from "../lib/qq-bot-kind-prompt.js";
|
|
5
5
|
import { qqRuntimeStateToken } from "../lib/qq-runtime-state.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineMiddleware } from '
|
|
2
|
-
import type { CommandMessage } from '
|
|
1
|
+
import { defineMiddleware } from 'zhin.js/middleware';
|
|
2
|
+
import type { CommandMessage } from 'zhin.js/command';
|
|
3
3
|
import {
|
|
4
4
|
completeQqPendingBotKind,
|
|
5
5
|
} from '../src/qq-endpoint-commands.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-qq",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.12",
|
|
4
4
|
"description": "Zhin.js QQ Official adapter for Plugin Runtime (WebSocket gateway)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -35,29 +35,33 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"qq-official-bot": "^1.2.3",
|
|
38
|
-
"@zhin.js/adapter": "1.1.
|
|
39
|
-
"@zhin.js/
|
|
40
|
-
"@zhin.js/core": "1.5.9",
|
|
38
|
+
"@zhin.js/adapter": "1.1.10",
|
|
39
|
+
"@zhin.js/core": "1.5.10",
|
|
41
40
|
"@zhin.js/host-http": "1.0.10",
|
|
42
41
|
"@zhin.js/im-contract": "1.0.3",
|
|
43
42
|
"@zhin.js/logger": "1.0.76",
|
|
44
|
-
"@zhin.js/
|
|
45
|
-
"@zhin.js/permission": "1.0.2",
|
|
46
|
-
"@zhin.js/plugin-runtime": "1.1.6"
|
|
43
|
+
"@zhin.js/permission": "1.0.2"
|
|
47
44
|
},
|
|
48
45
|
"peerDependencies": {
|
|
49
46
|
"zod": "^4.0.0",
|
|
50
|
-
"@zhin.js/adapter": "1.1.
|
|
51
|
-
"@zhin.js/agent": "1.1.
|
|
52
|
-
"@zhin.js/
|
|
53
|
-
"@zhin.js/
|
|
54
|
-
"zhin.js": "
|
|
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/middleware": "1.0.11",
|
|
52
|
+
"zhin.js": "6.0.10"
|
|
55
53
|
},
|
|
56
54
|
"peerDependenciesMeta": {
|
|
57
|
-
"zhin.js": {
|
|
55
|
+
"@zhin.js/agent": {
|
|
58
56
|
"optional": true
|
|
59
57
|
},
|
|
60
|
-
"@zhin.js/
|
|
58
|
+
"@zhin.js/command": {
|
|
59
|
+
"optional": true
|
|
60
|
+
},
|
|
61
|
+
"@zhin.js/middleware": {
|
|
62
|
+
"optional": true
|
|
63
|
+
},
|
|
64
|
+
"zhin.js": {
|
|
61
65
|
"optional": true
|
|
62
66
|
},
|
|
63
67
|
"zod": {
|
|
@@ -69,9 +73,9 @@
|
|
|
69
73
|
"typescript": "^6.0.3",
|
|
70
74
|
"vitest": "^4.1.10",
|
|
71
75
|
"zod": "^4.4.3",
|
|
72
|
-
"@zhin.js/agent": "1.1.
|
|
76
|
+
"@zhin.js/agent": "1.1.12",
|
|
73
77
|
"@zhin.js/host-http": "1.0.10",
|
|
74
|
-
"zhin.js": "6.0.
|
|
78
|
+
"zhin.js": "6.0.10"
|
|
75
79
|
},
|
|
76
80
|
"files": [
|
|
77
81
|
"adapters",
|
package/plugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
-
import { definePlugin } from '
|
|
2
|
+
import { definePlugin } from 'zhin.js';
|
|
3
3
|
import { permissionHostToken } from '@zhin.js/permission';
|
|
4
4
|
import { checkQqPlatformPermit } from "./lib/platform-permit.js";
|
|
5
5
|
import { createQqRuntimeState, qqRuntimeStateToken } from "./lib/qq-runtime-state.js";
|
package/src/endpoint.ts
CHANGED
|
@@ -6,11 +6,11 @@ import type {
|
|
|
6
6
|
EndpointInstance,
|
|
7
7
|
EndpointManagement,
|
|
8
8
|
EndpointSendRequest,
|
|
9
|
-
} from '
|
|
9
|
+
} from 'zhin.js/adapter';
|
|
10
10
|
import type { MessageGateway } from '@zhin.js/core/runtime';
|
|
11
11
|
import type { HttpHost } from '@zhin.js/host-http';
|
|
12
12
|
import { formatCompact, getAdapterLogger, truncatePreview } from '@zhin.js/logger';
|
|
13
|
-
import type { CapabilityId } from '
|
|
13
|
+
import type { CapabilityId } from 'zhin.js';
|
|
14
14
|
import { formatOutbound } from './outbound.js';
|
|
15
15
|
import { registerQqAgentEndpoint } from './qq-agent-deps.js';
|
|
16
16
|
import {
|
package/src/protocol.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Canonicalization is owned by gateway/core before endpoint.send.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { pickCredential } from '
|
|
6
|
+
import { pickCredential } from 'zhin.js/adapter';
|
|
7
7
|
import type { ConversationKind, ConversationRef } from '@zhin.js/im-contract';
|
|
8
8
|
import { formatCompact, getLogger } from '@zhin.js/logger';
|
|
9
9
|
import { resolveQqIntents } from './qq-intents.js';
|
package/src/qq-bind-persist.ts
CHANGED
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
removeEndpointById,
|
|
15
15
|
type ConfiguredEndpointEntry,
|
|
16
16
|
type EndpointCommandReply,
|
|
17
|
-
} from '
|
|
18
|
-
import { defineCommand } from '
|
|
17
|
+
} from 'zhin.js/adapter';
|
|
18
|
+
import { defineCommand } from 'zhin.js/command';
|
|
19
19
|
import { QQ_BOT_KIND_PROMPT, qqCommandSessionKey } from './qq-bot-kind-prompt.js';
|
|
20
20
|
import { startQqBindFlow } from './qq-bind-flow.js';
|
|
21
21
|
import { persistQqCredentialsToEnv } from './qq-bind-persist.js';
|
package/src/qq-runtime-state.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 扫码绑定 / 待选 botKind 流程。由 plugin.ts setup() provide,
|
|
4
4
|
* adapter create 与 commands / middleware 通过 use(qqRuntimeStateToken) 共享。
|
|
5
5
|
*/
|
|
6
|
-
import { createToken } from '
|
|
6
|
+
import { createToken } from 'zhin.js';
|
|
7
7
|
|
|
8
8
|
export interface QqRunningEndpoint {
|
|
9
9
|
id: string;
|