@zhin.js/core 1.1.58 → 1.1.60
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.
|
@@ -420,21 +420,38 @@ export class InboundRuntime {
|
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
async #receiveSideEvent(event) {
|
|
423
|
+
let active = true;
|
|
423
424
|
const lease = this.context.acquire();
|
|
424
425
|
let endpointLease;
|
|
425
426
|
try {
|
|
426
427
|
endpointLease = requireAdapters(lease.value).acquireInbound(event.endpoint.id, event.client);
|
|
427
|
-
const
|
|
428
|
+
const captured = endpointLease;
|
|
429
|
+
const signal = AbortSignal.any([lease.stopSignal, captured.signal]);
|
|
430
|
+
const assertActive = () => {
|
|
431
|
+
if (!active)
|
|
432
|
+
throw new Error('Endpoint event context expired with its generation operation');
|
|
433
|
+
captured.assertActive();
|
|
434
|
+
};
|
|
428
435
|
await dispatchInboundHandlers({
|
|
429
436
|
lease,
|
|
430
437
|
event: event.name,
|
|
431
|
-
args: [event],
|
|
438
|
+
args: [withEndpointEventPayload(event, event.payload)],
|
|
432
439
|
signal,
|
|
433
440
|
interactions: this.context.interactions,
|
|
434
441
|
deliver: (req, snap) => this.context.deliver(req, snap),
|
|
442
|
+
captureInteraction: (owner, conversation) => {
|
|
443
|
+
assertActive();
|
|
444
|
+
return this.context.captureOperation({
|
|
445
|
+
target: conversation,
|
|
446
|
+
client: event.client,
|
|
447
|
+
requester: owner,
|
|
448
|
+
signal: captured.signal,
|
|
449
|
+
});
|
|
450
|
+
},
|
|
435
451
|
});
|
|
436
452
|
}
|
|
437
453
|
finally {
|
|
454
|
+
active = false;
|
|
438
455
|
try {
|
|
439
456
|
endpointLease?.release();
|
|
440
457
|
}
|
|
@@ -12,6 +12,7 @@ export type { RuntimeMessageDiagnostic, RuntimeMessageDiagnosticStep, RuntimeMes
|
|
|
12
12
|
export { MessageBus, messageBusToken, type EndpointEvent, type MessageBusEventMap, type MessageBusEventName, type RuntimeMessageEvent, type RuntimeMessageEventSource, type RuntimeMessageRendering, type RuntimeSceneEventSignal, type RuntimeSceneEventSource, type OutboundFallbackReason, } from './message-events.js';
|
|
13
13
|
export * from './outbound-renderer.js';
|
|
14
14
|
export * from './outbound-segments.js';
|
|
15
|
+
export { renderToSegments, isNativeMessageTag, type MessageRenderOptions } from '../../jsx/message-renderer.js';
|
|
15
16
|
export type { CoreReplyStream, OpenReplyStreamOptions, ReplyStreamSnapshot, ConfirmedReplyContent } from './progressive-reply.js';
|
|
16
17
|
export * from '../../notice.js';
|
|
17
18
|
export * from '../../request.js';
|
|
@@ -9,6 +9,7 @@ export * from './message-dispatcher.js';
|
|
|
9
9
|
export { MessageBus, messageBusToken, } from './message-events.js';
|
|
10
10
|
export * from './outbound-renderer.js';
|
|
11
11
|
export * from './outbound-segments.js';
|
|
12
|
+
export { renderToSegments, isNativeMessageTag } from '../../jsx/message-renderer.js';
|
|
12
13
|
export * from '../../notice.js';
|
|
13
14
|
export * from '../../request.js';
|
|
14
15
|
export * from '../../system-event.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.60",
|
|
4
4
|
"description": "Zhin机器人核心框架",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -57,28 +57,28 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"qrcode": "^1.5.4",
|
|
59
59
|
"segment-matcher": "^1.0.5",
|
|
60
|
-
"@zhin.js/adapter": "1.1.
|
|
61
|
-
"@zhin.js/command": "1.1.
|
|
62
|
-
"@zhin.js/component": "1.1.
|
|
60
|
+
"@zhin.js/adapter": "1.1.32",
|
|
61
|
+
"@zhin.js/command": "1.1.17",
|
|
62
|
+
"@zhin.js/component": "1.1.16",
|
|
63
63
|
"@zhin.js/database": "1.1.7",
|
|
64
|
-
"@zhin.js/handler": "1.1.
|
|
64
|
+
"@zhin.js/handler": "1.1.15",
|
|
65
65
|
"@zhin.js/im-contract": "1.1.13",
|
|
66
66
|
"@zhin.js/kernel": "1.1.6",
|
|
67
67
|
"@zhin.js/logger": "1.1.2",
|
|
68
|
-
"@zhin.js/middleware": "1.1.
|
|
69
|
-
"@zhin.js/permission": "1.1.
|
|
70
|
-
"@zhin.js/plugin-runtime": "1.1.
|
|
71
|
-
"@zhin.js/schedule-feature": "1.1.
|
|
68
|
+
"@zhin.js/middleware": "1.1.16",
|
|
69
|
+
"@zhin.js/permission": "1.1.15",
|
|
70
|
+
"@zhin.js/plugin-runtime": "1.1.23",
|
|
71
|
+
"@zhin.js/schedule-feature": "1.1.15",
|
|
72
72
|
"@zhin.js/schema": "1.1.5",
|
|
73
73
|
"@zhin.js/jsx": "1.1.12",
|
|
74
|
-
"@zhin.js/feature-kit": "1.1.
|
|
74
|
+
"@zhin.js/feature-kit": "1.1.15"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@types/node": "^26.1.2",
|
|
78
78
|
"@types/qrcode": "^1.5.6",
|
|
79
79
|
"ajv": "8.18.0",
|
|
80
80
|
"typescript": "^6.0.3",
|
|
81
|
-
"@zhin.js/ai": "1.1.
|
|
81
|
+
"@zhin.js/ai": "1.1.54"
|
|
82
82
|
},
|
|
83
83
|
"repository": {
|
|
84
84
|
"type": "git",
|