@zhin.js/core 1.1.33 → 1.1.35
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/README.md +140 -61
- package/lib/adapter.d.ts +72 -23
- package/lib/adapter.js +222 -58
- package/lib/built/adapter-process.d.ts +20 -5
- package/lib/built/adapter-process.js +54 -7
- package/lib/built/agent-preset.d.ts +1 -2
- package/lib/built/agent-preset.js +1 -2
- package/lib/built/ai-access.d.ts +36 -0
- package/lib/built/ai-access.js +46 -0
- package/lib/built/ai-outbound/adapter-access.d.ts +3 -0
- package/lib/built/ai-outbound/adapter-access.js +9 -0
- package/lib/built/ai-outbound/extensions/onebot-keyboard.d.ts +2 -0
- package/lib/built/ai-outbound/extensions/onebot-keyboard.js +67 -0
- package/lib/built/ai-outbound/extensions/qq-message.d.ts +3 -0
- package/lib/built/ai-outbound/extensions/qq-message.js +23 -0
- package/lib/built/ai-outbound/index.d.ts +9 -0
- package/lib/built/ai-outbound/index.js +9 -0
- package/lib/built/ai-outbound/parse.d.ts +13 -0
- package/lib/built/ai-outbound/parse.js +104 -0
- package/lib/built/ai-outbound/plain-mention-rewrite.d.ts +6 -0
- package/lib/built/ai-outbound/plain-mention-rewrite.js +37 -0
- package/lib/built/ai-outbound/prompt.d.ts +11 -0
- package/lib/built/ai-outbound/prompt.js +44 -0
- package/lib/built/ai-outbound/resolve.d.ts +4 -0
- package/lib/built/ai-outbound/resolve.js +64 -0
- package/lib/built/ai-outbound/structured-detect.d.ts +3 -0
- package/lib/built/ai-outbound/structured-detect.js +6 -0
- package/lib/built/ai-outbound/types.d.ts +58 -0
- package/lib/built/ai-outbound/types.js +5 -0
- package/lib/built/ai-trigger.d.ts +17 -17
- package/lib/built/ai-trigger.js +65 -70
- package/lib/built/authorization.d.ts +10 -0
- package/lib/built/authorization.js +76 -0
- package/lib/built/command.d.ts +9 -5
- package/lib/built/command.js +20 -7
- package/lib/built/common-adapter-tools.d.ts +35 -29
- package/lib/built/common-adapter-tools.js +83 -67
- package/lib/built/component.d.ts +1 -3
- package/lib/built/component.js +2 -4
- package/lib/built/config.d.ts +4 -5
- package/lib/built/config.js +26 -9
- package/lib/built/connect-endpoint-instance.d.ts +17 -0
- package/lib/built/connect-endpoint-instance.js +42 -0
- package/lib/built/database.d.ts +5 -3
- package/lib/built/database.js +10 -4
- package/lib/built/dispatcher.d.ts +10 -8
- package/lib/built/dispatcher.js +31 -9
- package/lib/built/endpoint-commands.d.ts +3 -0
- package/lib/built/endpoint-commands.js +99 -0
- package/lib/built/endpoint-lifecycle-service.d.ts +28 -0
- package/lib/built/endpoint-lifecycle-service.js +242 -0
- package/lib/built/endpoint-lifecycle.d.ts +27 -0
- package/lib/built/endpoint-lifecycle.js +36 -0
- package/lib/built/endpoint-manager.d.ts +34 -0
- package/lib/built/endpoint-manager.js +1 -0
- package/lib/built/generated-qrcode.d.ts +24 -0
- package/lib/built/generated-qrcode.js +45 -0
- package/lib/built/generic-segment-mapper.d.ts +4 -0
- package/lib/built/generic-segment-mapper.js +190 -0
- package/lib/built/html-renderer-loader.d.ts +13 -0
- package/lib/built/html-renderer-loader.js +33 -0
- package/lib/built/html-segment-fallback.d.ts +9 -0
- package/lib/built/html-segment-fallback.js +49 -0
- package/lib/built/html-to-text.d.ts +4 -1
- package/lib/built/html-to-text.js +47 -16
- package/lib/built/inbound-pipeline.d.ts +37 -0
- package/lib/built/inbound-pipeline.js +63 -0
- package/lib/built/inbound-runner.d.ts +0 -1
- package/lib/built/inbound-runner.js +0 -3
- package/lib/built/interactive-segment-contract.d.ts +6 -0
- package/lib/built/interactive-segment-contract.js +9 -0
- package/lib/built/interactive-segments/action.d.ts +17 -0
- package/lib/built/interactive-segments/action.js +69 -0
- package/lib/built/interactive-segments/button-spec.d.ts +10 -0
- package/lib/built/interactive-segments/button-spec.js +21 -0
- package/lib/built/interactive-segments/fallback-store.d.ts +29 -0
- package/lib/built/interactive-segments/fallback-store.js +63 -0
- package/lib/built/interactive-segments/handlers.d.ts +16 -0
- package/lib/built/interactive-segments/handlers.js +74 -0
- package/lib/built/interactive-segments/index.d.ts +8 -0
- package/lib/built/interactive-segments/index.js +8 -0
- package/lib/built/interactive-segments/keyboard-segment.d.ts +11 -0
- package/lib/built/interactive-segments/keyboard-segment.js +12 -0
- package/lib/built/interactive-segments/onebot-keyboard.d.ts +7 -0
- package/lib/built/interactive-segments/onebot-keyboard.js +51 -0
- package/lib/built/interactive-segments/resolve.d.ts +15 -0
- package/lib/built/interactive-segments/resolve.js +110 -0
- package/lib/built/interactive-segments/types.d.ts +50 -0
- package/lib/built/interactive-segments/types.js +9 -0
- package/lib/built/introspection-format.d.ts +10 -0
- package/lib/built/introspection-format.js +28 -0
- package/lib/built/login-assist.d.ts +43 -9
- package/lib/built/login-assist.js +113 -11
- package/lib/built/management-command-guard.d.ts +15 -0
- package/lib/built/management-command-guard.js +25 -0
- package/lib/built/message-enrich.d.ts +38 -0
- package/lib/built/message-enrich.js +75 -0
- package/lib/built/message-filter.d.ts +4 -5
- package/lib/built/message-filter.js +5 -7
- package/lib/built/optional-peer-import.d.ts +3 -0
- package/lib/built/optional-peer-import.js +33 -0
- package/lib/built/outbound-media-contract.d.ts +22 -0
- package/lib/built/outbound-media-contract.js +10 -0
- package/lib/built/outbound-media-utils.d.ts +9 -0
- package/lib/built/outbound-media-utils.js +62 -0
- package/lib/built/permission.d.ts +3 -7
- package/lib/built/permission.js +39 -52
- package/lib/built/permit-check.d.ts +7 -0
- package/lib/built/permit-check.js +35 -0
- package/lib/built/permit-parse.d.ts +16 -0
- package/lib/built/permit-parse.js +32 -0
- package/lib/built/platform-permit.d.ts +20 -0
- package/lib/built/platform-permit.js +91 -0
- package/lib/built/queue-im-field-contract.d.ts +7 -2
- package/lib/built/queue-im-field-contract.js +13 -4
- package/lib/built/rich-segments/adapter-policies.d.ts +9 -0
- package/lib/built/rich-segments/adapter-policies.js +27 -0
- package/lib/built/rich-segments/base.d.ts +11 -0
- package/lib/built/rich-segments/base.js +24 -0
- package/lib/built/rich-segments/builtins.d.ts +4 -0
- package/lib/built/rich-segments/builtins.js +40 -0
- package/lib/built/rich-segments/capabilities.d.ts +6 -0
- package/lib/built/rich-segments/capabilities.js +38 -0
- package/lib/built/rich-segments/html-segment.d.ts +15 -0
- package/lib/built/rich-segments/html-segment.js +62 -0
- package/lib/built/rich-segments/index.d.ts +13 -0
- package/lib/built/rich-segments/index.js +13 -0
- package/lib/built/rich-segments/markdown-segment.d.ts +14 -0
- package/lib/built/rich-segments/markdown-segment.js +58 -0
- package/lib/built/rich-segments/markdown-to-text.d.ts +3 -0
- package/lib/built/rich-segments/markdown-to-text.js +27 -0
- package/lib/built/rich-segments/qrcode-segment.d.ts +18 -0
- package/lib/built/rich-segments/qrcode-segment.js +73 -0
- package/lib/built/rich-segments/registry.d.ts +16 -0
- package/lib/built/rich-segments/registry.js +52 -0
- package/lib/built/rich-segments/resolve.d.ts +5 -0
- package/lib/built/rich-segments/resolve.js +87 -0
- package/lib/built/rich-segments/tts-segment.d.ts +13 -0
- package/lib/built/rich-segments/tts-segment.js +51 -0
- package/lib/built/rich-segments/types.d.ts +79 -0
- package/lib/built/rich-segments/types.js +17 -0
- package/lib/built/roles.d.ts +4 -5
- package/lib/built/roles.js +4 -5
- package/lib/built/runtime-io.d.ts +0 -1
- package/lib/built/runtime-io.js +0 -1
- package/lib/built/schedule.d.ts +54 -0
- package/lib/built/schedule.js +112 -0
- package/lib/built/schema-endpoint-manager.d.ts +17 -0
- package/lib/built/schema-endpoint-manager.js +73 -0
- package/lib/built/schema-feature.d.ts +0 -1
- package/lib/built/schema-feature.js +1 -3
- package/lib/built/segment-contract/assert.d.ts +7 -0
- package/lib/built/segment-contract/assert.js +39 -0
- package/lib/built/segment-contract/delivery.d.ts +5 -0
- package/lib/built/segment-contract/delivery.js +40 -0
- package/lib/built/segment-contract/image.d.ts +5 -0
- package/lib/built/segment-contract/image.js +10 -0
- package/lib/built/segment-contract/index.d.ts +10 -0
- package/lib/built/segment-contract/index.js +9 -0
- package/lib/built/segment-contract/json-schema.d.ts +28 -0
- package/lib/built/segment-contract/json-schema.js +128 -0
- package/lib/built/segment-contract/media.d.ts +12 -0
- package/lib/built/segment-contract/media.js +22 -0
- package/lib/built/segment-contract/mention.d.ts +10 -0
- package/lib/built/segment-contract/mention.js +26 -0
- package/lib/built/segment-contract/preview.d.ts +3 -0
- package/lib/built/segment-contract/preview.js +159 -0
- package/lib/built/segment-contract/text.d.ts +7 -0
- package/lib/built/segment-contract/text.js +34 -0
- package/lib/built/segment-contract/types.d.ts +58 -0
- package/lib/built/segment-contract/types.js +1 -0
- package/lib/built/segment-contract/validate.d.ts +229 -0
- package/lib/built/segment-contract/validate.js +174 -0
- package/lib/built/skill.d.ts +0 -1
- package/lib/built/skill.js +0 -1
- package/lib/built/speech-loader.d.ts +14 -0
- package/lib/built/speech-loader.js +32 -0
- package/lib/built/tool.d.ts +14 -13
- package/lib/built/tool.js +30 -25
- package/lib/built/user-interaction.d.ts +30 -0
- package/lib/built/user-interaction.js +248 -0
- package/lib/command.d.ts +19 -11
- package/lib/command.js +42 -11
- package/lib/component.d.ts +0 -1
- package/lib/component.js +67 -14
- package/lib/endpoint-capabilities.d.ts +46 -0
- package/lib/endpoint-capabilities.js +55 -0
- package/lib/endpoint.d.ts +19 -0
- package/lib/endpoint.js +3 -0
- package/lib/errors.d.ts +2 -3
- package/lib/errors.js +4 -5
- package/lib/feature/adapter.d.ts +2 -0
- package/lib/feature/adapter.js +2 -0
- package/lib/feature/command.d.ts +2 -0
- package/lib/feature/command.js +2 -0
- package/lib/feature/component.d.ts +2 -0
- package/lib/feature/component.js +2 -0
- package/lib/feature/handler.d.ts +52 -0
- package/lib/feature/handler.js +26 -0
- package/lib/feature/middleware.d.ts +2 -0
- package/lib/feature/middleware.js +2 -0
- package/lib/host-plugin-registry.d.ts +8 -0
- package/lib/host-plugin-registry.js +12 -0
- package/lib/im-scene.d.ts +29 -0
- package/lib/im-scene.js +75 -0
- package/lib/im-session-id.d.ts +39 -0
- package/lib/im-session-id.js +47 -0
- package/lib/index.d.ts +59 -21
- package/lib/index.js +53 -28
- package/lib/jsx-dev-runtime.d.ts +0 -1
- package/lib/jsx-dev-runtime.js +0 -1
- package/lib/jsx-runtime.d.ts +1 -1
- package/lib/jsx-runtime.js +0 -1
- package/lib/jsx.d.ts +19 -22
- package/lib/jsx.js +0 -1
- package/lib/message.d.ts +16 -10
- package/lib/message.js +16 -13
- package/lib/models/system-log.d.ts +0 -1
- package/lib/models/system-log.js +0 -1
- package/lib/models/user.d.ts +0 -1
- package/lib/models/user.js +0 -1
- package/lib/notice.d.ts +16 -59
- package/lib/notice.js +1 -4
- package/lib/plugin-context.d.ts +27 -0
- package/lib/plugin-context.js +64 -0
- package/lib/plugin-runtime/im/contracts.d.ts +191 -0
- package/lib/plugin-runtime/im/contracts.js +169 -0
- package/lib/plugin-runtime/im/im-runtime.d.ts +177 -0
- package/lib/plugin-runtime/im/im-runtime.js +1204 -0
- package/lib/plugin-runtime/im/index.d.ts +9 -0
- package/lib/plugin-runtime/im/index.js +9 -0
- package/lib/plugin-runtime/im/interactive.d.ts +26 -0
- package/lib/plugin-runtime/im/interactive.js +46 -0
- package/lib/plugin-runtime/im/login-assist-host.d.ts +6 -0
- package/lib/plugin-runtime/im/login-assist-host.js +6 -0
- package/lib/plugin-runtime/im/message-bus.d.ts +38 -0
- package/lib/plugin-runtime/im/message-bus.js +40 -0
- package/lib/plugin-runtime/im/message-dispatcher.d.ts +18 -0
- package/lib/plugin-runtime/im/message-dispatcher.js +107 -0
- package/lib/plugin-runtime/im/outbound-renderer.d.ts +7 -0
- package/lib/plugin-runtime/im/outbound-renderer.js +70 -0
- package/lib/plugin-runtime/im/outbound-segments.d.ts +72 -0
- package/lib/plugin-runtime/im/outbound-segments.js +220 -0
- package/lib/plugin-runtime/im/public-api.d.ts +6 -0
- package/lib/plugin-runtime/im/public-api.js +6 -0
- package/lib/plugin-runtime/im/service-tokens.d.ts +18 -0
- package/lib/plugin-runtime/im/service-tokens.js +13 -0
- package/lib/plugin.d.ts +34 -24
- package/lib/plugin.js +119 -224
- package/lib/request.d.ts +17 -61
- package/lib/request.js +0 -4
- package/lib/{prompt.d.ts → schema-interaction.d.ts} +6 -7
- package/lib/{prompt.js → schema-interaction.js} +20 -17
- package/lib/side-event/base.d.ts +52 -0
- package/lib/side-event/base.js +30 -0
- package/lib/side-event/dispatch.d.ts +15 -0
- package/lib/side-event/dispatch.js +140 -0
- package/lib/side-event/index.d.ts +4 -0
- package/lib/side-event/index.js +4 -0
- package/lib/side-event/normalize.d.ts +42 -0
- package/lib/side-event/normalize.js +121 -0
- package/lib/side-event/types.d.ts +23 -0
- package/lib/side-event/types.js +55 -0
- package/lib/system-event.d.ts +15 -0
- package/lib/system-event.js +7 -0
- package/lib/tool-zod.d.ts +18 -3
- package/lib/tool-zod.js +140 -54
- package/lib/types.d.ts +44 -85
- package/lib/types.js +0 -1
- package/lib/utils.d.ts +68 -1
- package/lib/utils.js +73 -11
- package/package.json +98 -10
- package/lib/adapter.d.ts.map +0 -1
- package/lib/adapter.js.map +0 -1
- package/lib/agent-prompt.d.ts +0 -37
- package/lib/agent-prompt.d.ts.map +0 -1
- package/lib/agent-prompt.js +0 -2
- package/lib/agent-prompt.js.map +0 -1
- package/lib/bot.d.ts +0 -38
- package/lib/bot.d.ts.map +0 -1
- package/lib/bot.js +0 -2
- package/lib/bot.js.map +0 -1
- package/lib/built/adapter-process.d.ts.map +0 -1
- package/lib/built/adapter-process.js.map +0 -1
- package/lib/built/agent-preset.d.ts.map +0 -1
- package/lib/built/agent-preset.js.map +0 -1
- package/lib/built/ai-trigger.d.ts.map +0 -1
- package/lib/built/ai-trigger.js.map +0 -1
- package/lib/built/command.d.ts.map +0 -1
- package/lib/built/command.js.map +0 -1
- package/lib/built/common-adapter-tools.d.ts.map +0 -1
- package/lib/built/common-adapter-tools.js.map +0 -1
- package/lib/built/component.d.ts.map +0 -1
- package/lib/built/component.js.map +0 -1
- package/lib/built/config.d.ts.map +0 -1
- package/lib/built/config.js.map +0 -1
- package/lib/built/cron.d.ts +0 -75
- package/lib/built/cron.d.ts.map +0 -1
- package/lib/built/cron.js +0 -122
- package/lib/built/cron.js.map +0 -1
- package/lib/built/database.d.ts.map +0 -1
- package/lib/built/database.js.map +0 -1
- package/lib/built/dispatcher.d.ts.map +0 -1
- package/lib/built/dispatcher.js.map +0 -1
- package/lib/built/html-to-text.d.ts.map +0 -1
- package/lib/built/html-to-text.js.map +0 -1
- package/lib/built/inbound-runner.d.ts.map +0 -1
- package/lib/built/inbound-runner.js.map +0 -1
- package/lib/built/login-assist.d.ts.map +0 -1
- package/lib/built/login-assist.js.map +0 -1
- package/lib/built/message-filter.d.ts.map +0 -1
- package/lib/built/message-filter.js.map +0 -1
- package/lib/built/permission.d.ts.map +0 -1
- package/lib/built/permission.js.map +0 -1
- package/lib/built/prepend-quote-context.d.ts +0 -33
- package/lib/built/prepend-quote-context.d.ts.map +0 -1
- package/lib/built/prepend-quote-context.js +0 -129
- package/lib/built/prepend-quote-context.js.map +0 -1
- package/lib/built/queue-im-field-contract.d.ts.map +0 -1
- package/lib/built/queue-im-field-contract.js.map +0 -1
- package/lib/built/roles.d.ts.map +0 -1
- package/lib/built/roles.js.map +0 -1
- package/lib/built/runtime-io.d.ts.map +0 -1
- package/lib/built/runtime-io.js.map +0 -1
- package/lib/built/schema-feature.d.ts.map +0 -1
- package/lib/built/schema-feature.js.map +0 -1
- package/lib/built/skill.d.ts.map +0 -1
- package/lib/built/skill.js.map +0 -1
- package/lib/built/tool.d.ts.map +0 -1
- package/lib/built/tool.js.map +0 -1
- package/lib/command.d.ts.map +0 -1
- package/lib/command.js.map +0 -1
- package/lib/component.d.ts.map +0 -1
- package/lib/component.js.map +0 -1
- package/lib/errors.d.ts.map +0 -1
- package/lib/errors.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/jsx-dev-runtime.d.ts.map +0 -1
- package/lib/jsx-dev-runtime.js.map +0 -1
- package/lib/jsx-runtime.d.ts.map +0 -1
- package/lib/jsx-runtime.js.map +0 -1
- package/lib/jsx.d.ts.map +0 -1
- package/lib/jsx.js.map +0 -1
- package/lib/message-quote.d.ts +0 -11
- package/lib/message-quote.d.ts.map +0 -1
- package/lib/message-quote.js +0 -91
- package/lib/message-quote.js.map +0 -1
- package/lib/message.d.ts.map +0 -1
- package/lib/message.js.map +0 -1
- package/lib/models/system-log.d.ts.map +0 -1
- package/lib/models/system-log.js.map +0 -1
- package/lib/models/user.d.ts.map +0 -1
- package/lib/models/user.js.map +0 -1
- package/lib/notice.d.ts.map +0 -1
- package/lib/notice.js.map +0 -1
- package/lib/plugin.d.ts.map +0 -1
- package/lib/plugin.js.map +0 -1
- package/lib/prompt.d.ts.map +0 -1
- package/lib/prompt.js.map +0 -1
- package/lib/request.d.ts.map +0 -1
- package/lib/request.js.map +0 -1
- package/lib/scheduler/scheduler.d.ts +0 -49
- package/lib/scheduler/scheduler.d.ts.map +0 -1
- package/lib/scheduler/scheduler.js +0 -352
- package/lib/scheduler/scheduler.js.map +0 -1
- package/lib/scheduler/types.d.ts +0 -71
- package/lib/scheduler/types.d.ts.map +0 -1
- package/lib/scheduler/types.js +0 -8
- package/lib/scheduler/types.js.map +0 -1
- package/lib/tool-zod.d.ts.map +0 -1
- package/lib/tool-zod.js.map +0 -1
- package/lib/types-generator.d.ts +0 -6
- package/lib/types-generator.d.ts.map +0 -1
- package/lib/types-generator.js +0 -72
- package/lib/types-generator.js.map +0 -1
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js.map +0 -1
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js.map +0 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { htmlToFallbackText } from '../../built/html-to-text.js';
|
|
2
|
+
import { toCanonicalSegments } from '../../built/generic-segment-mapper.js';
|
|
3
|
+
import { effectiveKeyboardFallbackMap, renderKeyboardAsText, } from '../../built/interactive-segments/resolve.js';
|
|
4
|
+
import { DEFAULT_INTERACTIVE_POLICY, isKeyboardSegment, } from '../../built/interactive-segments/types.js';
|
|
5
|
+
import { isMediaRef } from '../../built/segment-contract/index.js';
|
|
6
|
+
import { markdownToPlainText } from '../../built/rich-segments/markdown-to-text.js';
|
|
7
|
+
const DEFAULT_CARD_WIDTH = 540;
|
|
8
|
+
const DEFAULT_CARD_FILENAME = 'card.png';
|
|
9
|
+
const DEFAULT_MEDIA_POLICY = 'url-or-text';
|
|
10
|
+
/**
|
|
11
|
+
* 解析端点的出站媒体策略:读 adapter definition 声明的 `segments.outboundMedia`
|
|
12
|
+
* (多 endpoint 展开的 `slot~entry` id 回退到 slot id 查声明);
|
|
13
|
+
* 未声明回退 `url-or-text`(仅 URL 媒体可达,其余文本降级)。
|
|
14
|
+
*/
|
|
15
|
+
export function resolveOutboundMediaPolicy(adapter, snapshot) {
|
|
16
|
+
const slot = snapshot.capabilities.get(adapter)
|
|
17
|
+
?? snapshot.capabilities.get(baseSlotCapabilityId(adapter));
|
|
18
|
+
return readDeclaredMediaPolicy(slot?.definition) ?? DEFAULT_MEDIA_POLICY;
|
|
19
|
+
}
|
|
20
|
+
function readDeclaredMediaPolicy(definition) {
|
|
21
|
+
if (!definition || typeof definition !== 'object')
|
|
22
|
+
return undefined;
|
|
23
|
+
const segments = definition.segments;
|
|
24
|
+
if (!segments || typeof segments !== 'object')
|
|
25
|
+
return undefined;
|
|
26
|
+
const declared = segments.outboundMedia;
|
|
27
|
+
if (!Array.isArray(declared))
|
|
28
|
+
return undefined;
|
|
29
|
+
if (declared.includes('base64'))
|
|
30
|
+
return 'base64';
|
|
31
|
+
if (declared.includes('upload') || declared.includes('path'))
|
|
32
|
+
return 'passthrough';
|
|
33
|
+
if (declared.includes('url'))
|
|
34
|
+
return 'url-or-text';
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
export function isOutboundSegment(value) {
|
|
38
|
+
return typeof value === 'object'
|
|
39
|
+
&& value !== null
|
|
40
|
+
&& !Array.isArray(value)
|
|
41
|
+
&& typeof value.type === 'string';
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 平台名 → 出站 interactive 策略(adapter 未声明 `segments.interactive` 时
|
|
45
|
+
* 的内置来源):telegram / discord 端点自行把 keyboard 编码为原生按钮;
|
|
46
|
+
* 其余平台默认 'text'(编号文本降级,对齐旧轨 DEFAULT_INTERACTIVE_POLICY)。
|
|
47
|
+
*/
|
|
48
|
+
const OUTBOUND_INTERACTIVE_POLICY_BY_ADAPTER = {
|
|
49
|
+
telegram: 'native',
|
|
50
|
+
discord: 'native',
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* 解析端点的出站 interactive 策略:优先读 adapter definition 上声明的
|
|
54
|
+
* `segments.interactive`,否则按平台名查内置表,未知平台回退 'text'。
|
|
55
|
+
*/
|
|
56
|
+
export function resolveOutboundInteractivePolicy(adapter, snapshot) {
|
|
57
|
+
const slot = snapshot.capabilities.get(adapter)
|
|
58
|
+
?? snapshot.capabilities.get(baseSlotCapabilityId(adapter));
|
|
59
|
+
const declared = readDeclaredInteractivePolicy(slot?.definition);
|
|
60
|
+
if (declared)
|
|
61
|
+
return declared;
|
|
62
|
+
const packageName = slot ? snapshot.tree.get(slot.owner)?.packageName : undefined;
|
|
63
|
+
const adapterType = adapterTypeName(packageName);
|
|
64
|
+
return (adapterType ? OUTBOUND_INTERACTIVE_POLICY_BY_ADAPTER[adapterType] : undefined)
|
|
65
|
+
?? DEFAULT_INTERACTIVE_POLICY;
|
|
66
|
+
}
|
|
67
|
+
/** Preserve semantic Markdown only when the endpoint explicitly declares native consumption. */
|
|
68
|
+
export function resolveOutboundMarkdownPolicy(adapter, snapshot) {
|
|
69
|
+
const slot = snapshot.capabilities.get(adapter)
|
|
70
|
+
?? snapshot.capabilities.get(baseSlotCapabilityId(adapter));
|
|
71
|
+
if (!slot?.definition || typeof slot.definition !== 'object')
|
|
72
|
+
return 'text';
|
|
73
|
+
const segments = slot.definition.segments;
|
|
74
|
+
if (!segments || typeof segments !== 'object')
|
|
75
|
+
return 'text';
|
|
76
|
+
return segments.markdown === 'native' ? 'native' : 'text';
|
|
77
|
+
}
|
|
78
|
+
export function applyOutboundMarkdownPolicy(payload, policy) {
|
|
79
|
+
if (policy === 'native')
|
|
80
|
+
return payload;
|
|
81
|
+
const convert = (item) => {
|
|
82
|
+
if (!item || typeof item !== 'object' || Array.isArray(item))
|
|
83
|
+
return item;
|
|
84
|
+
const segment = item;
|
|
85
|
+
if (segment.type !== 'markdown')
|
|
86
|
+
return item;
|
|
87
|
+
const content = String(segment.data?.content ?? segment.data?.text ?? '');
|
|
88
|
+
return { type: 'text', data: { text: markdownToPlainText(content) } };
|
|
89
|
+
};
|
|
90
|
+
return Array.isArray(payload) ? payload.map(convert) : convert(payload);
|
|
91
|
+
}
|
|
92
|
+
function readDeclaredInteractivePolicy(definition) {
|
|
93
|
+
if (!definition || typeof definition !== 'object')
|
|
94
|
+
return undefined;
|
|
95
|
+
const segments = definition.segments;
|
|
96
|
+
if (!segments || typeof segments !== 'object')
|
|
97
|
+
return undefined;
|
|
98
|
+
const declared = segments.interactive;
|
|
99
|
+
return declared === 'native' || declared === 'text' ? declared : undefined;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* keyboard 段中央降级:'text' 端点把 keyboard 渲染为编号文本(复用旧轨
|
|
103
|
+
* `renderKeyboardAsText`),并把有效 fallback 映射经 `remember` 回调写入
|
|
104
|
+
* 中央存储(供入站数字回跳解析);'native' 端点透传 keyboard。
|
|
105
|
+
*/
|
|
106
|
+
export function applyOutboundInteractivePolicy(payload, policy, remember) {
|
|
107
|
+
if (policy !== 'text' || !Array.isArray(payload))
|
|
108
|
+
return payload;
|
|
109
|
+
return payload.map((item) => {
|
|
110
|
+
if (!isKeyboardSegment(item))
|
|
111
|
+
return item;
|
|
112
|
+
const data = item.data;
|
|
113
|
+
remember?.(effectiveKeyboardFallbackMap(data));
|
|
114
|
+
return { type: 'text', data: { text: renderKeyboardAsText(data) } };
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/** 多 endpoint 展开的 record id(`slot.id~entry`)→ slot id(entry 名禁含 `~`,见 adapter-index)。 */
|
|
118
|
+
function baseSlotCapabilityId(adapter) {
|
|
119
|
+
const tilde = adapter.indexOf('~');
|
|
120
|
+
return (tilde === -1 ? adapter : adapter.slice(0, tilde));
|
|
121
|
+
}
|
|
122
|
+
/** `@zhin.js/adapter-icqq` → `icqq`;非 adapter 包名原样返回。 */
|
|
123
|
+
function adapterTypeName(packageName) {
|
|
124
|
+
if (!packageName)
|
|
125
|
+
return undefined;
|
|
126
|
+
return packageName.replace(/^@[^/]+\/adapter-/, '');
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Normalize a rendered outbound payload toward canonical wire segments:
|
|
130
|
+
* - segment arrays stay arrays (html segments converted per element,
|
|
131
|
+
* 其余段经 `toCanonicalSegments` 归一为 canonical Segment);
|
|
132
|
+
* - a single segment object is wrapped into a one-element array;
|
|
133
|
+
* - anything else (plain strings, legacy `{ text }` shorthands) passes through.
|
|
134
|
+
*/
|
|
135
|
+
export async function normalizeOutboundPayload(payload, renderer, options) {
|
|
136
|
+
const mediaPolicy = options?.mediaPolicy ?? DEFAULT_MEDIA_POLICY;
|
|
137
|
+
if (Array.isArray(payload)) {
|
|
138
|
+
const resolved = await Promise.all(payload.map((item) => normalizeOneSegment(item, renderer, mediaPolicy)));
|
|
139
|
+
return applyOutboundMediaPolicy(resolved, mediaPolicy);
|
|
140
|
+
}
|
|
141
|
+
if (isOutboundSegment(payload)) {
|
|
142
|
+
return applyOutboundMediaPolicy([await normalizeOneSegment(payload, renderer, mediaPolicy)], mediaPolicy);
|
|
143
|
+
}
|
|
144
|
+
return payload;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* 单个出站项 → canonical Segment:
|
|
148
|
+
* - html 段走渲染/文本降级专线(产物已是 canonical 兼容形状,不再过
|
|
149
|
+
* `toCanonicalSegments`,以免 legacy 双写字段被 strip);
|
|
150
|
+
* - 其余项经 `toCanonicalSegments` 归一(字符串→text、at→mention、
|
|
151
|
+
* 旧 wire 字段 `{url,file,base64}`→MediaRef)。
|
|
152
|
+
*/
|
|
153
|
+
async function normalizeOneSegment(item, renderer, mediaPolicy) {
|
|
154
|
+
if (isOutboundSegment(item) && item.type === 'html') {
|
|
155
|
+
return renderHtmlSegment(item, renderer, mediaPolicy);
|
|
156
|
+
}
|
|
157
|
+
return toCanonicalSegments([item])[0];
|
|
158
|
+
}
|
|
159
|
+
async function renderHtmlSegment(segment, renderer, mediaPolicy) {
|
|
160
|
+
const data = segment.data ?? {};
|
|
161
|
+
const html = typeof data.html === 'string' ? data.html : '';
|
|
162
|
+
// url-or-text 端点无法投递 base64 图片(本层无上传通道),直接文本降级,跳过渲染。
|
|
163
|
+
if (html && renderer && mediaPolicy !== 'url-or-text') {
|
|
164
|
+
try {
|
|
165
|
+
const result = await renderer.render(html, {
|
|
166
|
+
width: typeof data.width === 'number' ? data.width : DEFAULT_CARD_WIDTH,
|
|
167
|
+
format: 'png',
|
|
168
|
+
...(typeof data.backgroundColor === 'string'
|
|
169
|
+
? { backgroundColor: data.backgroundColor }
|
|
170
|
+
: {}),
|
|
171
|
+
});
|
|
172
|
+
if (result.format === 'png' && result.data && typeof result.data === 'object') {
|
|
173
|
+
const base64 = Buffer.from(result.data).toString('base64');
|
|
174
|
+
return {
|
|
175
|
+
type: 'image',
|
|
176
|
+
data: {
|
|
177
|
+
media: {
|
|
178
|
+
kind: 'base64',
|
|
179
|
+
value: base64,
|
|
180
|
+
mime_type: 'image/png',
|
|
181
|
+
file_name: typeof data.fileName === 'string' ? data.fileName : DEFAULT_CARD_FILENAME,
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
// 渲染失败 → 文本降级
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return { type: 'text', data: { text: htmlSegmentFallbackText(data, html) } };
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* 媒体协商:仅 `url-or-text` 需要在本层动作——媒体段的非 URL MediaRef
|
|
195
|
+
* (base64 / 本地路径)无法投递,降级为文本(alt / file_name 优先)。
|
|
196
|
+
*/
|
|
197
|
+
const MEDIA_SEGMENT_TYPES = new Set(['image', 'audio', 'video', 'file']);
|
|
198
|
+
function applyOutboundMediaPolicy(segments, mediaPolicy) {
|
|
199
|
+
if (mediaPolicy !== 'url-or-text')
|
|
200
|
+
return segments;
|
|
201
|
+
return segments.map((segment) => {
|
|
202
|
+
if (!MEDIA_SEGMENT_TYPES.has(segment.type))
|
|
203
|
+
return segment;
|
|
204
|
+
const data = segment.data;
|
|
205
|
+
const media = data.media;
|
|
206
|
+
if (!isMediaRef(media) || media.kind === 'url')
|
|
207
|
+
return segment;
|
|
208
|
+
const label = typeof data.alt === 'string' && data.alt
|
|
209
|
+
? data.alt
|
|
210
|
+
: typeof data.name === 'string' && data.name
|
|
211
|
+
? data.name
|
|
212
|
+
: media.file_name ?? `[${segment.type}]`;
|
|
213
|
+
return { type: 'text', data: { text: label } };
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
function htmlSegmentFallbackText(data, html) {
|
|
217
|
+
if (typeof data.text === 'string' && data.text.length > 0)
|
|
218
|
+
return data.text;
|
|
219
|
+
return html ? htmlToFallbackText(html) : '';
|
|
220
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public IM gateway contract exposed from `zhin.js/core/runtime`.
|
|
3
|
+
* @module zhin.js/core/runtime
|
|
4
|
+
*/
|
|
5
|
+
export { outboundMessageToken } from './im-runtime.js';
|
|
6
|
+
export { Message, type ComponentCall, type ConversationAddress, type IncomingContext, type IncomingMessage, type MessageDispatchResult, type OutboundMessageService, type MessageSenderRef, type OutboundEnvelope, type RawContent, type SendContent, type SendRequest, } from './contracts.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core service tokens — typed Token 替代 legacy string-based inject('x')。
|
|
3
|
+
*
|
|
4
|
+
* Slice 2:Token 指向当前 Feature 实例(双写窗口)。
|
|
5
|
+
* Slice 4:Feature 删除后,Token 类型改为 Runtime projection 接口。
|
|
6
|
+
*/
|
|
7
|
+
import type { CommandFeature } from '../../built/command.js';
|
|
8
|
+
import type { ComponentFeature } from '../../built/component.js';
|
|
9
|
+
import type { ScheduleFeature } from '../../built/schedule.js';
|
|
10
|
+
import type { ConfigFeature } from '../../built/config.js';
|
|
11
|
+
import type { SchemaFeature } from '../../built/schema-feature.js';
|
|
12
|
+
import type { MessageDispatcherService } from '../../built/dispatcher.js';
|
|
13
|
+
export declare const commandServiceToken: import("@zhin.js/plugin-runtime").Token<CommandFeature>;
|
|
14
|
+
export declare const componentServiceToken: import("@zhin.js/plugin-runtime").Token<ComponentFeature>;
|
|
15
|
+
export declare const schedulerServiceToken: import("@zhin.js/plugin-runtime").Token<ScheduleFeature>;
|
|
16
|
+
export declare const configServiceToken: import("@zhin.js/plugin-runtime").Token<ConfigFeature>;
|
|
17
|
+
export declare const schemaServiceToken: import("@zhin.js/plugin-runtime").Token<SchemaFeature>;
|
|
18
|
+
export declare const dispatcherServiceToken: import("@zhin.js/plugin-runtime").Token<MessageDispatcherService>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core service tokens — typed Token 替代 legacy string-based inject('x')。
|
|
3
|
+
*
|
|
4
|
+
* Slice 2:Token 指向当前 Feature 实例(双写窗口)。
|
|
5
|
+
* Slice 4:Feature 删除后,Token 类型改为 Runtime projection 接口。
|
|
6
|
+
*/
|
|
7
|
+
import { createToken } from '@zhin.js/plugin-runtime';
|
|
8
|
+
export const commandServiceToken = createToken('zhin.im.command-service');
|
|
9
|
+
export const componentServiceToken = createToken('zhin.im.component-service');
|
|
10
|
+
export const schedulerServiceToken = createToken('zhin.im.scheduler-service');
|
|
11
|
+
export const configServiceToken = createToken('zhin.im.config-service');
|
|
12
|
+
export const schemaServiceToken = createToken('zhin.im.schema-service');
|
|
13
|
+
export const dispatcherServiceToken = createToken('zhin.im.dispatcher-service');
|
package/lib/plugin.d.ts
CHANGED
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
* - 生命周期事件类型安全(Plugin.Lifecycle)
|
|
7
7
|
* - 中间件系统、适配器管理、useContext 等
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
10
|
-
import type {
|
|
11
|
-
import { MessageMiddleware, RegisteredAdapter, MaybePromise, ArrayItem, SendOptions, MessageSendPayload } from "./types.js";
|
|
9
|
+
import { MessageMiddleware, RegisteredAdapter, MaybePromise, ArrayItem, SendOptions, MessageSendPayload, type PluginManifest } from './types.js';
|
|
10
|
+
import type { InteractiveHandler } from "./built/interactive-segments/types.js";
|
|
12
11
|
import { Adapter, Adapters } from "./adapter.js";
|
|
13
|
-
import { PluginBase, PluginBaseLifecycle } from
|
|
14
|
-
|
|
12
|
+
import { PluginBase, PluginBaseLifecycle, type PluginLike } from '@zhin.js/kernel';
|
|
13
|
+
export { getPlugin, markPluginRuntimeActive, isPluginRuntimeActive, resetPluginRuntimeFlag } from "./plugin-context.js";
|
|
14
|
+
export { storage, getCurrentFile } from "./plugin-context.js";
|
|
15
|
+
export { setHostRootPlugin, getHostRootPlugin } from "./host-plugin-registry.js";
|
|
15
16
|
declare const contextsKey: unique symbol;
|
|
16
17
|
export type SideEffect<A extends (keyof Plugin.Contexts)[]> = {
|
|
17
18
|
(...args: ContextList<A>): MaybePromise<void | DisposeFn<ContextList<A>>>;
|
|
@@ -20,18 +21,11 @@ export type SideEffect<A extends (keyof Plugin.Contexts)[]> = {
|
|
|
20
21
|
export type DisposeFn<A> = (context: ArrayItem<A>) => MaybePromise<void>;
|
|
21
22
|
export type ContextList<CS extends (keyof Plugin.Contexts)[]> = CS extends [infer L, ...infer R] ? R extends (keyof Plugin.Contexts)[] ? [ContextItem<L>, ...ContextList<R>] : never[] : never[];
|
|
22
23
|
type ContextItem<L> = L extends keyof Plugin.Contexts ? Plugin.Contexts[L] : never;
|
|
23
|
-
export declare const storage: AsyncLocalStorage<Plugin>;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* 同一上下文中同一文件多次调用返回同一实例
|
|
25
|
+
* @deprecated **已删除**。请使用 `definePlugin` + 约定目录(`zhin runtime start`)。
|
|
26
|
+
* @throws 总是抛出——仅保留签名供编译期过渡。
|
|
28
27
|
*/
|
|
29
28
|
export declare function usePlugin(): Plugin;
|
|
30
|
-
/**
|
|
31
|
-
* getPlugin - 获取当前 AsyncLocalStorage 中的插件实例
|
|
32
|
-
* 用于 extensions 等场景,不创建新插件
|
|
33
|
-
*/
|
|
34
|
-
export declare function getPlugin(): Plugin;
|
|
35
29
|
export interface Plugin extends Plugin.Extensions {
|
|
36
30
|
on<K extends keyof Plugin.Lifecycle>(name: K, listener: (...args: Plugin.Lifecycle[K]) => void): this;
|
|
37
31
|
on(name: string | symbol, listener: (...args: any[]) => void): this;
|
|
@@ -59,7 +53,6 @@ export declare class Plugin extends PluginBase implements PluginLike {
|
|
|
59
53
|
started: boolean;
|
|
60
54
|
get root(): Plugin;
|
|
61
55
|
get middleware(): MessageMiddleware<RegisteredAdapter>;
|
|
62
|
-
recordFeatureContribution(featureName: string, itemName: string): void;
|
|
63
56
|
/**
|
|
64
57
|
* 构造函数
|
|
65
58
|
*/
|
|
@@ -69,6 +62,10 @@ export declare class Plugin extends PluginBase implements PluginLike {
|
|
|
69
62
|
* 中间件用于处理消息流转
|
|
70
63
|
*/
|
|
71
64
|
addMiddleware<T extends RegisteredAdapter>(middleware: MessageMiddleware<T>, name?: string): () => void;
|
|
65
|
+
/**
|
|
66
|
+
* 注册交互式 action 回调处理器(自动安装根中间件,优先于 Dispatcher)
|
|
67
|
+
*/
|
|
68
|
+
registerInteractiveHandler(prefix: string, handler: InteractiveHandler): () => void;
|
|
72
69
|
/**
|
|
73
70
|
* 插件名称
|
|
74
71
|
*/
|
|
@@ -87,8 +84,13 @@ export declare class Plugin extends PluginBase implements PluginLike {
|
|
|
87
84
|
contextIsReady<T extends keyof Plugin.Contexts>(name: T): boolean;
|
|
88
85
|
/**
|
|
89
86
|
* 启动插件
|
|
87
|
+
* 覆盖 PluginBase.start() 以支持 Context 挂载失败回滚
|
|
90
88
|
*/
|
|
91
89
|
start(t?: number): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* 覆盖 mountAllContexts:支持部分失败回滚
|
|
92
|
+
*/
|
|
93
|
+
protected mountAllContexts(): Promise<void>;
|
|
92
94
|
/**
|
|
93
95
|
* 获取插件提供的功能
|
|
94
96
|
* 从各个服务中获取数据
|
|
@@ -105,10 +107,10 @@ export declare class Plugin extends PluginBase implements PluginLike {
|
|
|
105
107
|
info(): Record<string, any>;
|
|
106
108
|
/**
|
|
107
109
|
* 停止插件
|
|
110
|
+
* 委托 PluginBase.stop() 处理通用清理,仅补充 IM 特化逻辑
|
|
108
111
|
*/
|
|
109
112
|
stop(): Promise<void>;
|
|
110
113
|
onMounted(callback: () => void | Promise<void>): void;
|
|
111
|
-
onDispose(callback: () => void | Promise<void>): () => void;
|
|
112
114
|
/**
|
|
113
115
|
* dispatch - 向上冒泡到父插件,或者在根节点广播(类型安全版本)
|
|
114
116
|
*/
|
|
@@ -159,7 +161,7 @@ export declare namespace Plugin {
|
|
|
159
161
|
interface Features {
|
|
160
162
|
commands: string[];
|
|
161
163
|
components: string[];
|
|
162
|
-
|
|
164
|
+
schedules: string[];
|
|
163
165
|
middlewares: string[];
|
|
164
166
|
}
|
|
165
167
|
/**
|
|
@@ -175,10 +177,15 @@ export declare namespace Plugin {
|
|
|
175
177
|
"call.recallMessage": [string, string, string];
|
|
176
178
|
'before.sendMessage': [SendOptions];
|
|
177
179
|
'message.send': [MessageSendPayload];
|
|
178
|
-
"message.receive": [
|
|
179
|
-
"
|
|
180
|
-
"
|
|
181
|
-
|
|
180
|
+
"message.receive": [import('./message.js').Message];
|
|
181
|
+
"endpoint.login.pending": [import('./built/login-assist.js').PendingLoginTask];
|
|
182
|
+
"endpoint.login.expired": [import('./built/login-assist.js').PendingLoginTask];
|
|
183
|
+
'endpoint.connect': [import('./built/endpoint-lifecycle.js').EndpointLifecyclePayload];
|
|
184
|
+
'endpoint.disconnect': [import('./built/endpoint-lifecycle.js').EndpointLifecyclePayload];
|
|
185
|
+
'endpoint.error': [import('./built/endpoint-lifecycle.js').EndpointLifecyclePayload];
|
|
186
|
+
"request.receive": [import('./request.js').Request];
|
|
187
|
+
"notice.receive": [import('./notice.js').Notice];
|
|
188
|
+
"system.receive": [import('./system-event.js').SystemEvent];
|
|
182
189
|
"ai.processing.start": [Plugin.AIEventPayload];
|
|
183
190
|
"ai.processing.finish": [Plugin.AIEventPayload];
|
|
184
191
|
"ai.processing.error": [Plugin.AIEventPayload];
|
|
@@ -190,6 +197,8 @@ export declare namespace Plugin {
|
|
|
190
197
|
"ai.response": [Plugin.AIEventPayload];
|
|
191
198
|
"ai.typing.start": [Plugin.AIEventPayload];
|
|
192
199
|
"ai.typing.stop": [Plugin.AIEventPayload];
|
|
200
|
+
"ai.activity.queued.start": [Plugin.AIEventPayload];
|
|
201
|
+
"ai.activity.queued.clear": [Plugin.AIEventPayload];
|
|
193
202
|
"ai.subagent.spawn": [Plugin.AIEventPayload];
|
|
194
203
|
"ai.subagent.start": [Plugin.AIEventPayload];
|
|
195
204
|
"ai.subagent.finish": [Plugin.AIEventPayload];
|
|
@@ -201,6 +210,9 @@ export declare namespace Plugin {
|
|
|
201
210
|
"ai.session.new": [Plugin.AIEventPayload];
|
|
202
211
|
"ai.session.compact": [Plugin.AIEventPayload];
|
|
203
212
|
"ai.hook": [Plugin.AIEventPayload];
|
|
213
|
+
"schedule.start": [Plugin.AIEventPayload];
|
|
214
|
+
"schedule.finish": [Plugin.AIEventPayload];
|
|
215
|
+
"schedule.error": [Plugin.AIEventPayload];
|
|
204
216
|
}
|
|
205
217
|
interface AIEventPayload {
|
|
206
218
|
sessionId: string;
|
|
@@ -209,7 +221,7 @@ export declare namespace Plugin {
|
|
|
209
221
|
path?: 'chat' | 'fast' | 'agent' | 'multimodal' | 'rate_limited';
|
|
210
222
|
userId?: string;
|
|
211
223
|
platform?: string;
|
|
212
|
-
|
|
224
|
+
endpointKey?: string;
|
|
213
225
|
sceneId?: string;
|
|
214
226
|
messageId?: string;
|
|
215
227
|
scope?: string;
|
|
@@ -254,5 +266,3 @@ export declare namespace Plugin {
|
|
|
254
266
|
interface Extensions {
|
|
255
267
|
}
|
|
256
268
|
}
|
|
257
|
-
export {};
|
|
258
|
-
//# sourceMappingURL=plugin.d.ts.map
|