@zhin.js/adapter-satori 5.0.9 → 5.0.11
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 +18 -0
- package/README.md +1 -1
- package/adapters/satori.js +1 -1
- package/adapters/satori.ts +1 -1
- package/lib/endpoint.d.ts +2 -2
- package/lib/endpoint.js +1 -1
- package/lib/protocol.js +1 -1
- package/lib/satori-endpoint-commands.js +2 -2
- package/lib/satori-runtime-state.d.ts +1 -1
- package/lib/satori-runtime-state.js +1 -1
- package/package.json +13 -11
- package/plugin.js +2 -2
- package/src/endpoint.ts +2 -2
- package/src/protocol.ts +1 -1
- package/src/satori-endpoint-commands.ts +2 -2
- package/src/satori-runtime-state.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @zhin.js/adapter-satori
|
|
2
2
|
|
|
3
|
+
## 5.0.11
|
|
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/core@1.5.10
|
|
9
|
+
- zhin.js@6.0.10
|
|
10
|
+
|
|
11
|
+
## 5.0.10
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- eb84b77: fix: 更新文档,建立正确的依赖关系
|
|
16
|
+
- Updated dependencies [d3920e9]
|
|
17
|
+
- @zhin.js/core@1.5.10
|
|
18
|
+
- zhin.js@6.0.10
|
|
19
|
+
- @zhin.js/adapter@1.1.10
|
|
20
|
+
|
|
3
21
|
## 5.0.9
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ pnpm add @zhin.js/adapter-satori
|
|
|
23
23
|
|
|
24
24
|
- `@zhin.js/adapter` — 约定式 `adapters/satori.ts`(`defineAdapter`)
|
|
25
25
|
- `@zhin.js/core` — `messageGatewayToken` 入站/出站
|
|
26
|
-
-
|
|
26
|
+
- `zhin.js` — `plugin.ts`(`definePlugin`)
|
|
27
27
|
- `@zhin.js/host-http` — Webhook 模式需 `httpHostToken` 注册 POST 路由
|
|
28
28
|
- 配置经插件 `schema.json` 落到 `plugins.<instanceKey>`(`baseUrl` / `token` / …)
|
|
29
29
|
|
package/adapters/satori.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Convention entry: discover `adapters/satori.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 { SatoriWebhookEndpoint, SatoriWsEndpoint } from "../lib/endpoint.js";
|
package/adapters/satori.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Convention entry: discover `adapters/satori.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 { SatoriWebhookEndpoint, SatoriWsEndpoint } from '../src/endpoint.js';
|
package/lib/endpoint.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SatoriEndpoint — WebSocket and webhook lifecycle, outbound, admit.
|
|
3
3
|
*/
|
|
4
|
-
import { type EndpointInstance, type EndpointManagement, type EndpointSendRequest } from '
|
|
4
|
+
import { type EndpointInstance, type EndpointManagement, type 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 { callSatoriApi, type ResolvedSatoriWebhookConfig, type ResolvedSatoriWsConfig, type SatoriEventBody, type SatoriLogin } from './protocol.js';
|
|
9
9
|
import { type CreateSatoriWebSocket } from './ws.js';
|
|
10
10
|
export type SatoriApiCaller = typeof callSatoriApi;
|
package/lib/endpoint.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SatoriEndpoint — WebSocket and webhook lifecycle, outbound, admit.
|
|
3
3
|
*/
|
|
4
|
-
import { createEndpointLifecycle, } from '
|
|
4
|
+
import { createEndpointLifecycle, } from 'zhin.js/adapter';
|
|
5
5
|
import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
|
|
6
6
|
import { SatoriOpcode, buildWsUrl, callSatoriApi, extractCreatedMessageId, formatInboundContent, formatMessageId, formatSatoriOutbound, isMessageEvent, isSelfMentioned, parseMessageRef, resolveInboundSender, satoriInboundConversation, } from './protocol.js';
|
|
7
7
|
import { registerSatoriWebhookRoutes } from './webhook.js';
|
package/lib/protocol.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Canonicalization is owned by gateway/core before endpoint.send.
|
|
4
4
|
* Spec: https://satori.chat/zh-CN/protocol/overview.html
|
|
5
5
|
*/
|
|
6
|
-
import { pickCredential } from '
|
|
6
|
+
import { pickCredential } from 'zhin.js/adapter';
|
|
7
7
|
import { isMediaRef } from '@zhin.js/core';
|
|
8
8
|
import { formatCompact, getLogger } from '@zhin.js/logger';
|
|
9
9
|
const logger = getLogger('satori');
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* `satori.endpoint` 命令族:由 @zhin.js/adapter 的 createEndpointCommands 套件生成。
|
|
3
3
|
* commands/endpoint/ 下的 list / add / remove 直接默认导出这三项。
|
|
4
4
|
*/
|
|
5
|
-
import { createEndpointCommands } from '
|
|
6
|
-
import { defineCommand } from '
|
|
5
|
+
import { createEndpointCommands } from 'zhin.js/adapter';
|
|
6
|
+
import { defineCommand } from 'zhin.js/command';
|
|
7
7
|
import { satoriRuntimeStateToken } from './satori-runtime-state.js';
|
|
8
8
|
export const satoriEndpointCommands = createEndpointCommands({
|
|
9
9
|
adapterKey: 'satori',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const satoriRuntimeStateToken: import("
|
|
1
|
+
export declare const satoriRuntimeStateToken: import("zhin.js").Token<import("@zhin.js/adapter").EndpointRuntimeState>;
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Satori 插件实例的运行时状态:adapter create() 注册的 endpoint 列表。
|
|
3
3
|
* 由 plugin.ts setup() provide,adapter create 与 `satori.endpoint` 命令共享(同一 owner generation)。
|
|
4
4
|
*/
|
|
5
|
-
import { defineEndpointRuntimeStateToken } from '
|
|
5
|
+
import { defineEndpointRuntimeStateToken } from 'zhin.js/adapter';
|
|
6
6
|
export const satoriRuntimeStateToken = defineEndpointRuntimeStateToken('satori');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-satori",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.11",
|
|
4
4
|
"description": "Zhin.js Satori adapter for Plugin Runtime (WebSocket client)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -39,28 +39,30 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"ws": "^8.21.1",
|
|
42
|
-
"@zhin.js/adapter": "1.1.
|
|
43
|
-
"@zhin.js/
|
|
44
|
-
"@zhin.js/core": "1.5.9",
|
|
42
|
+
"@zhin.js/adapter": "1.1.10",
|
|
43
|
+
"@zhin.js/core": "1.5.10",
|
|
45
44
|
"@zhin.js/host-http": "1.0.10",
|
|
46
45
|
"@zhin.js/im-contract": "1.0.3",
|
|
47
|
-
"@zhin.js/logger": "1.0.76"
|
|
48
|
-
"@zhin.js/plugin-runtime": "1.1.6"
|
|
46
|
+
"@zhin.js/logger": "1.0.76"
|
|
49
47
|
},
|
|
50
48
|
"devDependencies": {
|
|
51
49
|
"@types/node": "^26.1.2",
|
|
52
50
|
"@types/ws": "^8.18.1",
|
|
53
51
|
"typescript": "^6.0.3",
|
|
54
52
|
"vitest": "^4.1.10",
|
|
55
|
-
"@zhin.js/host-http": "1.0.10"
|
|
53
|
+
"@zhin.js/host-http": "1.0.10",
|
|
54
|
+
"zhin.js": "6.0.10"
|
|
56
55
|
},
|
|
57
56
|
"peerDependencies": {
|
|
58
|
-
"@zhin.js/adapter": "1.1.
|
|
59
|
-
"@zhin.js/
|
|
60
|
-
"@zhin.js/
|
|
61
|
-
"zhin.js": "6.0.
|
|
57
|
+
"@zhin.js/adapter": "1.1.10",
|
|
58
|
+
"@zhin.js/command": "1.0.14",
|
|
59
|
+
"@zhin.js/core": "1.5.10",
|
|
60
|
+
"zhin.js": "6.0.10"
|
|
62
61
|
},
|
|
63
62
|
"peerDependenciesMeta": {
|
|
63
|
+
"@zhin.js/command": {
|
|
64
|
+
"optional": true
|
|
65
|
+
},
|
|
64
66
|
"zhin.js": {
|
|
65
67
|
"optional": true
|
|
66
68
|
}
|
package/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
-
import { createEndpointRuntimeState } from '
|
|
3
|
-
import { definePlugin } from '
|
|
2
|
+
import { createEndpointRuntimeState } from 'zhin.js/adapter';
|
|
3
|
+
import { definePlugin } from 'zhin.js';
|
|
4
4
|
import { satoriRuntimeStateToken } from "./lib/satori-runtime-state.js";
|
|
5
5
|
export default definePlugin({
|
|
6
6
|
name: 'satori',
|
package/src/endpoint.ts
CHANGED
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
type EndpointLifecycle,
|
|
11
11
|
type EndpointManagement,
|
|
12
12
|
type EndpointSendRequest,
|
|
13
|
-
} from '
|
|
13
|
+
} from 'zhin.js/adapter';
|
|
14
14
|
import type { MessageGateway } from '@zhin.js/core/runtime';
|
|
15
15
|
import type { HttpHost, HttpRouteRegistration } from '@zhin.js/host-http';
|
|
16
16
|
import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
|
|
17
|
-
import type { CapabilityId } from '
|
|
17
|
+
import type { CapabilityId } from 'zhin.js';
|
|
18
18
|
import {
|
|
19
19
|
SatoriOpcode,
|
|
20
20
|
buildWsUrl,
|
package/src/protocol.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Spec: https://satori.chat/zh-CN/protocol/overview.html
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { pickCredential } from '
|
|
7
|
+
import { pickCredential } from 'zhin.js/adapter';
|
|
8
8
|
import { isMediaRef } from '@zhin.js/core';
|
|
9
9
|
import type { ConversationKind, ConversationRef } from '@zhin.js/im-contract';
|
|
10
10
|
import { formatCompact, getLogger } from '@zhin.js/logger';
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* `satori.endpoint` 命令族:由 @zhin.js/adapter 的 createEndpointCommands 套件生成。
|
|
3
3
|
* commands/endpoint/ 下的 list / add / remove 直接默认导出这三项。
|
|
4
4
|
*/
|
|
5
|
-
import { createEndpointCommands } from '
|
|
6
|
-
import { defineCommand } from '
|
|
5
|
+
import { createEndpointCommands } from 'zhin.js/adapter';
|
|
6
|
+
import { defineCommand } from 'zhin.js/command';
|
|
7
7
|
import { satoriRuntimeStateToken } from './satori-runtime-state.js';
|
|
8
8
|
|
|
9
9
|
export const satoriEndpointCommands = createEndpointCommands({
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Satori 插件实例的运行时状态:adapter create() 注册的 endpoint 列表。
|
|
3
3
|
* 由 plugin.ts setup() provide,adapter create 与 `satori.endpoint` 命令共享(同一 owner generation)。
|
|
4
4
|
*/
|
|
5
|
-
import { defineEndpointRuntimeStateToken } from '
|
|
5
|
+
import { defineEndpointRuntimeStateToken } from 'zhin.js/adapter';
|
|
6
6
|
|
|
7
7
|
export const satoriRuntimeStateToken = defineEndpointRuntimeStateToken('satori');
|