@zhin.js/adapter-milky 1.1.20 → 1.1.21
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 +27 -0
- package/lib/protocol.d.ts +2 -1
- package/lib/self-profile.d.ts +8 -0
- package/lib/self-profile.js +13 -0
- package/lib/sse-endpoint.js +3 -0
- package/lib/webhook-endpoint.js +3 -0
- package/lib/ws-endpoint.js +3 -0
- package/lib/wss-endpoint.js +3 -0
- package/package.json +18 -18
- package/schema.json +106 -1
- package/src/protocol.ts +2 -1
- package/src/self-profile.ts +19 -0
- package/src/sse-endpoint.ts +3 -0
- package/src/webhook-endpoint.ts +3 -0
- package/src/ws-endpoint.ts +3 -0
- package/src/wss-endpoint.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @zhin.js/adapter-milky
|
|
2
2
|
|
|
3
|
+
## 1.1.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- af8f803: Use the current Endpoint's platform profile for Agent account identity, with per-field configured fallbacks and scoped, identity-approved profile tools. Keep SOUL first-person and independent of account names. Profile ports preserve the source Client, cancellation, truthful update outcomes and private image authority.
|
|
8
|
+
|
|
9
|
+
Adapter Feature API 2.1 and Tool Feature API 1.1 describe the additive profile requirements; new Core, official adapters and generated plugins declare the corresponding floors. Existing compatible API-2.0/API-1.0 plugins remain accepted by the newer providers. npm releases remain patch.
|
|
10
|
+
|
|
11
|
+
Private IM assets now bind to the full canonical conversation and principal. Existing IM asset records that contain only the earlier lossy hash remain on disk until their original expiry, but cannot be safely rebound; recapture them. No automatic file deletion, platform profile mutation or workspace SOUL rewrite occurs during upgrade.
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [b88e988]
|
|
14
|
+
- Updated dependencies [f78eb84]
|
|
15
|
+
- Updated dependencies [c15cef9]
|
|
16
|
+
- Updated dependencies [b0c02a2]
|
|
17
|
+
- Updated dependencies [af8f803]
|
|
18
|
+
- Updated dependencies [26fda97]
|
|
19
|
+
- Updated dependencies [976886c]
|
|
20
|
+
- Updated dependencies [032dc96]
|
|
21
|
+
- @zhin.js/adapter@1.1.27
|
|
22
|
+
- @zhin.js/client@1.1.23
|
|
23
|
+
- @zhin.js/im-contract@1.1.10
|
|
24
|
+
- @zhin.js/core@1.1.55
|
|
25
|
+
- @zhin.js/page@1.1.13
|
|
26
|
+
- @zhin.js/host-http@1.1.13
|
|
27
|
+
- @zhin.js/feature-kit@1.1.11
|
|
28
|
+
- @zhin.js/skill@1.1.12
|
|
29
|
+
|
|
3
30
|
## 1.1.20
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/lib/protocol.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EndpointProfileConfiguration } from 'zhin.js/adapter';
|
|
1
2
|
/**
|
|
2
3
|
* Milky protocol helpers (no legacy Adapter/Endpoint / segment-mapper).
|
|
3
4
|
* Canonicalization is owned by gateway/core before endpoint.send.
|
|
@@ -6,7 +7,7 @@
|
|
|
6
7
|
import { type ConversationRef } from '@zhin.js/im-contract';
|
|
7
8
|
import type { Segment } from '@zhin.js/core/runtime';
|
|
8
9
|
/** One endpoint config after AdapterIndex expands `plugins.<instanceKey>.endpoints`. */
|
|
9
|
-
export interface MilkyEndpointConfig {
|
|
10
|
+
export interface MilkyEndpointConfig extends EndpointProfileConfiguration {
|
|
10
11
|
readonly connection?: 'ws' | 'sse' | 'webhook' | 'wss';
|
|
11
12
|
readonly id: string;
|
|
12
13
|
readonly baseUrl: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EndpointProfile, PendingRpcRequest } from 'zhin.js/adapter';
|
|
2
|
+
interface MilkySelfProfileOptions {
|
|
3
|
+
readonly call: (request: PendingRpcRequest) => Promise<unknown>;
|
|
4
|
+
readonly reportAccount: (id: string) => void;
|
|
5
|
+
}
|
|
6
|
+
/** Milky login facts are fetched through the same account-bound, error-checked native caller. */
|
|
7
|
+
export declare function createMilkySelfProfile({ call, reportAccount }: MilkySelfProfileOptions): EndpointProfile;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Milky login facts are fetched through the same account-bound, error-checked native caller. */
|
|
2
|
+
export function createMilkySelfProfile({ call, reportAccount }) {
|
|
3
|
+
return Object.freeze({
|
|
4
|
+
writableFields: Object.freeze([]),
|
|
5
|
+
async read({ signal }) {
|
|
6
|
+
const self = await call({ action: 'get_login_info', signal });
|
|
7
|
+
if (!self?.uin || typeof self.nickname !== 'string')
|
|
8
|
+
throw new Error('Milky returned an incomplete self profile');
|
|
9
|
+
reportAccount(String(self.uin));
|
|
10
|
+
return { nickname: self.nickname };
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
}
|
package/lib/sse-endpoint.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createMilkySelfProfile } from './self-profile.js';
|
|
1
2
|
/**
|
|
2
3
|
* Milky SSE client endpoint — GET text/event-stream on /event.
|
|
3
4
|
*/
|
|
@@ -33,6 +34,8 @@ export class MilkySseEndpoint extends MilkyClient {
|
|
|
33
34
|
close: () => { this.#open = false; }, stop: () => this.#stop(),
|
|
34
35
|
send: request => this.#send(request),
|
|
35
36
|
management: this.#management, control: this.#control,
|
|
37
|
+
profile: createMilkySelfProfile({ call: request => call(request).then(response => readMilkyResponse(response, request.action)),
|
|
38
|
+
reportAccount: id => this[endpointSpec].reportSelfUserId(id) }),
|
|
36
39
|
get transportState() { return readTransportState(); },
|
|
37
40
|
});
|
|
38
41
|
forwardMilkyClientEvents(this, (name, payload) => {
|
package/lib/webhook-endpoint.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createMilkySelfProfile } from './self-profile.js';
|
|
1
2
|
import { acceptHttpIngress } from 'imhelper';
|
|
2
3
|
import { createEndpointSpecification, endpointSpec, createRecallEndpointControl, } from 'zhin.js/adapter';
|
|
3
4
|
import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
|
|
@@ -30,6 +31,8 @@ export class MilkyWebhookEndpoint extends MilkyClient {
|
|
|
30
31
|
close: () => { this.#open = false; }, stop: () => this.#stop(),
|
|
31
32
|
send: request => this.#send(request),
|
|
32
33
|
management: this.#management, control: this.#control,
|
|
34
|
+
profile: createMilkySelfProfile({ call: request => call(request).then(response => readMilkyResponse(response, request.action)),
|
|
35
|
+
reportAccount: id => this[endpointSpec].reportSelfUserId(id) }),
|
|
33
36
|
});
|
|
34
37
|
forwardMilkyClientEvents(this, (name, payload) => {
|
|
35
38
|
void this[endpointSpec].events.run(() => {
|
package/lib/ws-endpoint.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createMilkySelfProfile } from './self-profile.js';
|
|
1
2
|
/**
|
|
2
3
|
* Milky WS client endpoint — outbound connect to Milky protocol server.
|
|
3
4
|
*/
|
|
@@ -35,6 +36,8 @@ export class MilkyWsEndpoint extends MilkyClient {
|
|
|
35
36
|
close: () => { this.#close(); }, stop: () => this.#stop(),
|
|
36
37
|
send: request => this.#send(request),
|
|
37
38
|
management: this.#management, control: this.#control,
|
|
39
|
+
profile: createMilkySelfProfile({ call: request => call(request).then(response => readMilkyResponse(response, request.action)),
|
|
40
|
+
reportAccount: id => this[endpointSpec].reportSelfUserId(id) }),
|
|
38
41
|
get transportState() { return readTransportState(); },
|
|
39
42
|
});
|
|
40
43
|
forwardMilkyClientEvents(this, (name, payload) => {
|
package/lib/wss-endpoint.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createMilkySelfProfile } from './self-profile.js';
|
|
1
2
|
/**
|
|
2
3
|
* Milky reverse WSS endpoint — httpHostToken WS upgrade inbound + baseUrl HTTP API outbound.
|
|
3
4
|
*/
|
|
@@ -42,6 +43,8 @@ export class MilkyWssEndpoint extends MilkyClient {
|
|
|
42
43
|
close: () => { this.#open = false; }, stop: () => this.#stop(),
|
|
43
44
|
send: request => this.#send(request),
|
|
44
45
|
management: this.#management, control: this.#control,
|
|
46
|
+
profile: createMilkySelfProfile({ call: request => call(request).then(response => readMilkyResponse(response, request.action)),
|
|
47
|
+
reportAccount: id => this[endpointSpec].reportSelfUserId(id) }),
|
|
45
48
|
get transportState() { return readTransportState(); },
|
|
46
49
|
});
|
|
47
50
|
forwardMilkyClientEvents(this, (name, payload) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-milky",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.21",
|
|
4
4
|
"description": "Zhin.js Milky adapter for Plugin Runtime (WebSocket client)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -43,16 +43,16 @@
|
|
|
43
43
|
"@imhelper/milky-v1": "1.0.7",
|
|
44
44
|
"imhelper": "1.0.7",
|
|
45
45
|
"ws": "^8.21.1",
|
|
46
|
-
"@zhin.js/adapter": "1.1.
|
|
47
|
-
"@zhin.js/client": "1.1.
|
|
46
|
+
"@zhin.js/adapter": "1.1.27",
|
|
47
|
+
"@zhin.js/client": "1.1.23",
|
|
48
48
|
"@zhin.js/console-contract": "1.1.3",
|
|
49
|
-
"@zhin.js/
|
|
50
|
-
"@zhin.js/
|
|
51
|
-
"@zhin.js/
|
|
52
|
-
"@zhin.js/im-contract": "1.1.9",
|
|
49
|
+
"@zhin.js/feature-kit": "1.1.11",
|
|
50
|
+
"@zhin.js/host-http": "1.1.13",
|
|
51
|
+
"@zhin.js/im-contract": "1.1.10",
|
|
53
52
|
"@zhin.js/logger": "1.1.2",
|
|
54
|
-
"@zhin.js/page": "1.1.
|
|
55
|
-
"@zhin.js/skill": "1.1.
|
|
53
|
+
"@zhin.js/page": "1.1.13",
|
|
54
|
+
"@zhin.js/skill": "1.1.12",
|
|
55
|
+
"@zhin.js/core": "1.1.55"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/node": "^26.1.2",
|
|
@@ -60,17 +60,17 @@
|
|
|
60
60
|
"typescript": "^6.0.3",
|
|
61
61
|
"vitest": "^4.1.10",
|
|
62
62
|
"zod": "^4.4.3",
|
|
63
|
-
"@zhin.js/agent": "1.1.
|
|
64
|
-
"@zhin.js/host-http": "1.1.
|
|
65
|
-
"zhin.js": "1.1.
|
|
63
|
+
"@zhin.js/agent": "1.1.46",
|
|
64
|
+
"@zhin.js/host-http": "1.1.13",
|
|
65
|
+
"zhin.js": "1.1.20"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"zod": "^4.0.0",
|
|
69
|
-
"@zhin.js/adapter": "^1.1.
|
|
70
|
-
"@zhin.js/agent": "^1.1.
|
|
71
|
-
"@zhin.js/command": "^1.1.
|
|
72
|
-
"@zhin.js/core": "^1.1.
|
|
73
|
-
"zhin.js": "^1.1.
|
|
69
|
+
"@zhin.js/adapter": "^1.1.27",
|
|
70
|
+
"@zhin.js/agent": "^1.1.46",
|
|
71
|
+
"@zhin.js/command": "^1.1.13",
|
|
72
|
+
"@zhin.js/core": "^1.1.55",
|
|
73
|
+
"zhin.js": "^1.1.20"
|
|
74
74
|
},
|
|
75
75
|
"peerDependenciesMeta": {
|
|
76
76
|
"@zhin.js/agent": {
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"features": [
|
|
108
108
|
{
|
|
109
109
|
"package": "@zhin.js/adapter",
|
|
110
|
-
"api": "^2.
|
|
110
|
+
"api": "^2.1.0"
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
113
|
"package": "@zhin.js/command",
|
package/schema.json
CHANGED
|
@@ -119,6 +119,27 @@
|
|
|
119
119
|
"id": {
|
|
120
120
|
"type": "string",
|
|
121
121
|
"description": "Milky bot name"
|
|
122
|
+
},
|
|
123
|
+
"nickname": {
|
|
124
|
+
"type": [
|
|
125
|
+
"string",
|
|
126
|
+
"null"
|
|
127
|
+
],
|
|
128
|
+
"description": "账号昵称兜底",
|
|
129
|
+
"x-i18n": {
|
|
130
|
+
"en": {
|
|
131
|
+
"description": "Fallback account nickname"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"profile": {
|
|
136
|
+
"$ref": "#/$defs/selfProfileFallback",
|
|
137
|
+
"description": "账号资料兜底",
|
|
138
|
+
"x-i18n": {
|
|
139
|
+
"en": {
|
|
140
|
+
"description": "Fallback account profile"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
122
143
|
}
|
|
123
144
|
},
|
|
124
145
|
"required": [
|
|
@@ -141,9 +162,93 @@
|
|
|
141
162
|
"description": "Command prefix. The default empty string allows unprefixed commands; '/' requires a leading slash. Each endpoints[i] can override it."
|
|
142
163
|
}
|
|
143
164
|
}
|
|
165
|
+
},
|
|
166
|
+
"nickname": {
|
|
167
|
+
"type": [
|
|
168
|
+
"string",
|
|
169
|
+
"null"
|
|
170
|
+
],
|
|
171
|
+
"description": "账号昵称兜底",
|
|
172
|
+
"x-i18n": {
|
|
173
|
+
"en": {
|
|
174
|
+
"description": "Fallback account nickname"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"profile": {
|
|
179
|
+
"$ref": "#/$defs/selfProfileFallback",
|
|
180
|
+
"description": "账号资料兜底",
|
|
181
|
+
"x-i18n": {
|
|
182
|
+
"en": {
|
|
183
|
+
"description": "Fallback account profile"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
144
186
|
}
|
|
145
187
|
},
|
|
146
188
|
"required": [
|
|
147
189
|
"endpoints"
|
|
148
|
-
]
|
|
190
|
+
],
|
|
191
|
+
"$defs": {
|
|
192
|
+
"selfProfileFallback": {
|
|
193
|
+
"type": "object",
|
|
194
|
+
"additionalProperties": false,
|
|
195
|
+
"properties": {
|
|
196
|
+
"gender": {
|
|
197
|
+
"type": [
|
|
198
|
+
"string",
|
|
199
|
+
"null"
|
|
200
|
+
],
|
|
201
|
+
"enum": [
|
|
202
|
+
"male",
|
|
203
|
+
"female",
|
|
204
|
+
"other",
|
|
205
|
+
"unknown",
|
|
206
|
+
null
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
"age": {
|
|
210
|
+
"type": [
|
|
211
|
+
"integer",
|
|
212
|
+
"null"
|
|
213
|
+
],
|
|
214
|
+
"minimum": 0
|
|
215
|
+
},
|
|
216
|
+
"birthday": {
|
|
217
|
+
"type": [
|
|
218
|
+
"string",
|
|
219
|
+
"null"
|
|
220
|
+
],
|
|
221
|
+
"pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$"
|
|
222
|
+
},
|
|
223
|
+
"signature": {
|
|
224
|
+
"type": [
|
|
225
|
+
"string",
|
|
226
|
+
"null"
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
"avatar": {
|
|
230
|
+
"type": [
|
|
231
|
+
"string",
|
|
232
|
+
"null"
|
|
233
|
+
],
|
|
234
|
+
"pattern": "^(https?://[^\\s/?#]+(?:[/?#].*)?|)$"
|
|
235
|
+
},
|
|
236
|
+
"interests": {
|
|
237
|
+
"type": [
|
|
238
|
+
"array",
|
|
239
|
+
"null"
|
|
240
|
+
],
|
|
241
|
+
"items": {
|
|
242
|
+
"type": "string"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"bio": {
|
|
246
|
+
"type": [
|
|
247
|
+
"string",
|
|
248
|
+
"null"
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
149
254
|
}
|
package/src/protocol.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EndpointProfileConfiguration } from 'zhin.js/adapter';
|
|
1
2
|
/**
|
|
2
3
|
* Milky protocol helpers (no legacy Adapter/Endpoint / segment-mapper).
|
|
3
4
|
* Canonicalization is owned by gateway/core before endpoint.send.
|
|
@@ -11,7 +12,7 @@ import { formatCompact, getLogger } from '@zhin.js/logger';
|
|
|
11
12
|
const logger = getLogger('milky');
|
|
12
13
|
|
|
13
14
|
/** One endpoint config after AdapterIndex expands `plugins.<instanceKey>.endpoints`. */
|
|
14
|
-
export interface MilkyEndpointConfig {
|
|
15
|
+
export interface MilkyEndpointConfig extends EndpointProfileConfiguration {
|
|
15
16
|
readonly connection?: 'ws' | 'sse' | 'webhook' | 'wss';
|
|
16
17
|
readonly id: string;
|
|
17
18
|
readonly baseUrl: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { EndpointProfile, PendingRpcRequest } from 'zhin.js/adapter';
|
|
2
|
+
|
|
3
|
+
interface MilkySelfProfileOptions {
|
|
4
|
+
readonly call: (request: PendingRpcRequest) => Promise<unknown>;
|
|
5
|
+
readonly reportAccount: (id: string) => void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** Milky login facts are fetched through the same account-bound, error-checked native caller. */
|
|
9
|
+
export function createMilkySelfProfile({ call, reportAccount }: MilkySelfProfileOptions): EndpointProfile {
|
|
10
|
+
return Object.freeze<EndpointProfile>({
|
|
11
|
+
writableFields: Object.freeze([]),
|
|
12
|
+
async read({ signal }) {
|
|
13
|
+
const self = await call({ action: 'get_login_info', signal }) as { uin?: number; nickname?: string } | undefined;
|
|
14
|
+
if (!self?.uin || typeof self.nickname !== 'string') throw new Error('Milky returned an incomplete self profile');
|
|
15
|
+
reportAccount(String(self.uin));
|
|
16
|
+
return { nickname: self.nickname };
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
package/src/sse-endpoint.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createMilkySelfProfile } from './self-profile.js';
|
|
1
2
|
/**
|
|
2
3
|
* Milky SSE client endpoint — GET text/event-stream on /event.
|
|
3
4
|
*/
|
|
@@ -80,6 +81,8 @@ export class MilkySseEndpoint extends MilkyClient implements Endpoint {
|
|
|
80
81
|
close: () => { this.#open = false; }, stop: () => this.#stop(),
|
|
81
82
|
send: request => this.#send(request),
|
|
82
83
|
management: this.#management, control: this.#control,
|
|
84
|
+
profile: createMilkySelfProfile({ call: request => call(request).then(response => readMilkyResponse(response, request.action)),
|
|
85
|
+
reportAccount: id => this[endpointSpec].reportSelfUserId(id) }),
|
|
83
86
|
get transportState() { return readTransportState(); },
|
|
84
87
|
});
|
|
85
88
|
forwardMilkyClientEvents(this, (name, payload) => {
|
package/src/webhook-endpoint.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createMilkySelfProfile } from './self-profile.js';
|
|
1
2
|
/**
|
|
2
3
|
* Milky webhook endpoint — httpHostToken POST inbound + baseUrl HTTP API outbound.
|
|
3
4
|
*/
|
|
@@ -70,6 +71,8 @@ export class MilkyWebhookEndpoint extends MilkyClient implements Endpoint {
|
|
|
70
71
|
close: () => { this.#open = false; }, stop: () => this.#stop(),
|
|
71
72
|
send: request => this.#send(request),
|
|
72
73
|
management: this.#management, control: this.#control,
|
|
74
|
+
profile: createMilkySelfProfile({ call: request => call(request).then(response => readMilkyResponse(response, request.action)),
|
|
75
|
+
reportAccount: id => this[endpointSpec].reportSelfUserId(id) }),
|
|
73
76
|
});
|
|
74
77
|
forwardMilkyClientEvents(this, (name, payload) => {
|
|
75
78
|
void this[endpointSpec].events.run(() => {
|
package/src/ws-endpoint.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createMilkySelfProfile } from './self-profile.js';
|
|
1
2
|
/**
|
|
2
3
|
* Milky WS client endpoint — outbound connect to Milky protocol server.
|
|
3
4
|
*/
|
|
@@ -84,6 +85,8 @@ export class MilkyWsEndpoint extends MilkyClient implements Endpoint {
|
|
|
84
85
|
close: () => { this.#close(); }, stop: () => this.#stop(),
|
|
85
86
|
send: request => this.#send(request),
|
|
86
87
|
management: this.#management, control: this.#control,
|
|
88
|
+
profile: createMilkySelfProfile({ call: request => call(request).then(response => readMilkyResponse(response, request.action)),
|
|
89
|
+
reportAccount: id => this[endpointSpec].reportSelfUserId(id) }),
|
|
87
90
|
get transportState() { return readTransportState(); },
|
|
88
91
|
});
|
|
89
92
|
forwardMilkyClientEvents(this, (name, payload) => {
|
package/src/wss-endpoint.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createMilkySelfProfile } from './self-profile.js';
|
|
1
2
|
/**
|
|
2
3
|
* Milky reverse WSS endpoint — httpHostToken WS upgrade inbound + baseUrl HTTP API outbound.
|
|
3
4
|
*/
|
|
@@ -82,6 +83,8 @@ export class MilkyWssEndpoint extends MilkyClient implements Endpoint {
|
|
|
82
83
|
close: () => { this.#open = false; }, stop: () => this.#stop(),
|
|
83
84
|
send: request => this.#send(request),
|
|
84
85
|
management: this.#management, control: this.#control,
|
|
86
|
+
profile: createMilkySelfProfile({ call: request => call(request).then(response => readMilkyResponse(response, request.action)),
|
|
87
|
+
reportAccount: id => this[endpointSpec].reportSelfUserId(id) }),
|
|
85
88
|
get transportState() { return readTransportState(); },
|
|
86
89
|
});
|
|
87
90
|
forwardMilkyClientEvents(this, (name, payload) => {
|