@zhin.js/core 1.5.16 → 1.7.0
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 +78 -195
- package/lib/ai-completion-contract.d.ts +135 -0
- package/lib/ai-completion-contract.js +69 -0
- package/lib/built/ai-access.d.ts +2 -21
- package/lib/built/ai-access.js +1 -46
- package/lib/built/ai-outbound/index.d.ts +0 -2
- package/lib/built/ai-outbound/index.js +0 -2
- package/lib/built/ai-outbound/prompt.d.ts +2 -0
- package/lib/built/ai-outbound/prompt.js +2 -0
- package/lib/built/ai-outbound/types.d.ts +1 -10
- package/lib/built/ai-trigger.d.ts +39 -78
- package/lib/built/ai-trigger.js +3 -254
- package/lib/built/common-adapter-tools.d.ts +21 -6
- package/lib/built/common-adapter-tools.js +28 -17
- package/lib/built/generic-segment-mapper.js +4 -1
- package/lib/built/html-segment-fallback.d.ts +6 -7
- package/lib/built/html-segment-fallback.js +1 -16
- package/lib/built/html-to-text.d.ts +0 -3
- package/lib/built/html-to-text.js +131 -40
- package/lib/built/interaction-messages.d.ts +1 -0
- package/lib/built/interaction-messages.js +30 -0
- package/lib/built/interactive-segments/action.d.ts +3 -4
- package/lib/built/interactive-segments/action.js +2 -5
- package/lib/built/interactive-segments/index.d.ts +0 -2
- package/lib/built/interactive-segments/index.js +0 -2
- package/lib/built/interactive-segments/keyboard-segment.d.ts +0 -1
- package/lib/built/interactive-segments/keyboard-segment.js +0 -1
- package/lib/built/interactive-segments/onebot-keyboard.d.ts +0 -1
- package/lib/built/interactive-segments/onebot-keyboard.js +0 -2
- package/lib/built/interactive-segments/resolve.d.ts +2 -3
- package/lib/built/interactive-segments/resolve.js +21 -14
- package/lib/built/interactive-segments/types.d.ts +2 -7
- package/lib/built/interactive-segments/types.js +22 -2
- package/lib/built/login-assist.d.ts +330 -25
- package/lib/built/login-assist.js +1156 -75
- package/lib/built/login-captcha.d.ts +62 -0
- package/lib/built/login-captcha.js +107 -0
- package/lib/built/message-enrich.d.ts +24 -27
- package/lib/built/message-enrich.js +53 -49
- package/lib/built/outbound-content-arrays.d.ts +4 -0
- package/lib/built/outbound-content-arrays.js +32 -0
- package/lib/built/outbound-media-trust.d.ts +46 -0
- package/lib/built/outbound-media-trust.js +245 -0
- package/lib/built/outbound-media-utils.d.ts +5 -3
- package/lib/built/outbound-media-utils.js +5 -3
- package/lib/built/readable-link.d.ts +4 -0
- package/lib/built/readable-link.js +32 -0
- package/lib/built/rich-segments/markdown-to-text.d.ts +1 -2
- package/lib/built/rich-segments/markdown-to-text.js +141 -17
- package/lib/built/roles.d.ts +141 -12
- package/lib/built/roles.js +253 -52
- package/lib/built/segment-contract/assert.js +8 -2
- package/lib/built/segment-contract/delivery.js +1 -0
- package/lib/built/segment-contract/index.d.ts +3 -3
- package/lib/built/segment-contract/index.js +2 -2
- package/lib/built/segment-contract/json-schema.d.ts +39 -5
- package/lib/built/segment-contract/json-schema.js +207 -24
- package/lib/built/segment-contract/preview.js +8 -1
- package/lib/built/segment-contract/text.js +1 -1
- package/lib/built/segment-contract/types.d.ts +2 -2
- package/lib/built/segment-contract/validate.d.ts +1553 -224
- package/lib/built/segment-contract/validate.js +39 -3
- package/lib/built/tool-access.d.ts +5 -0
- package/lib/built/tool-access.js +17 -0
- package/lib/built/user-interaction.d.ts +5 -4
- package/lib/built/user-interaction.js +64 -52
- package/lib/errors.d.ts +1 -18
- package/lib/errors.js +1 -26
- package/lib/feature/command-public-api.d.ts +5 -0
- package/lib/feature/command-public-api.js +5 -0
- package/lib/feature/command.d.ts +2 -0
- package/lib/feature/command.js +1 -0
- package/lib/feature/component.d.ts +1 -0
- package/lib/feature/component.js +1 -0
- package/lib/feature/handler.d.ts +13 -7
- package/lib/feature/handler.js +2 -1
- package/lib/feature/middleware-public-api.d.ts +6 -0
- package/lib/feature/middleware-public-api.js +6 -0
- package/lib/feature/middleware.d.ts +22 -2
- package/lib/feature/middleware.js +7 -2
- package/lib/im-scene.d.ts +4 -3
- package/lib/im-scene.js +9 -9
- package/lib/im-session-id.d.ts +20 -12
- package/lib/im-session-id.js +8 -8
- package/lib/index.d.ts +20 -48
- package/lib/index.js +15 -41
- package/lib/jsx/intrinsic-elements.d.ts +83 -0
- package/lib/jsx/message-renderer.d.ts +13 -0
- package/lib/jsx/message-renderer.js +128 -0
- package/lib/jsx/message-tags.d.ts +133 -0
- package/lib/jsx/message-tags.js +50 -0
- package/lib/jsx-dev-runtime.d.ts +2 -2
- package/lib/jsx-dev-runtime.js +1 -2
- package/lib/jsx-runtime.d.ts +2 -12
- package/lib/jsx-runtime.js +1 -10
- package/lib/jsx.d.ts +6 -30
- package/lib/jsx.js +3 -93
- package/lib/message.d.ts +0 -40
- package/lib/message.js +1 -27
- package/lib/models/system-log.d.ts +0 -2
- package/lib/models/system-log.js +1 -8
- package/lib/models/user.d.ts +0 -2
- package/lib/models/user.js +1 -7
- package/lib/notice.d.ts +38 -33
- package/lib/notice.js +23 -7
- package/lib/plugin-runtime/im/command-feedback.d.ts +59 -0
- package/lib/plugin-runtime/im/command-feedback.js +148 -0
- package/lib/plugin-runtime/im/contracts.d.ts +217 -32
- package/lib/plugin-runtime/im/contracts.js +141 -23
- package/lib/plugin-runtime/im/conversation-runtime.d.ts +42 -0
- package/lib/plugin-runtime/im/conversation-runtime.js +451 -0
- package/lib/plugin-runtime/im/endpoint-runtime.d.ts +112 -0
- package/lib/plugin-runtime/im/endpoint-runtime.js +434 -0
- package/lib/plugin-runtime/im/feature-gate.d.ts +21 -0
- package/lib/plugin-runtime/im/feature-gate.js +88 -0
- package/lib/plugin-runtime/im/host/component-host-installer.d.ts +2 -0
- package/lib/plugin-runtime/im/host/component-host-installer.js +14 -0
- package/lib/plugin-runtime/im/host/conversation-migration.d.ts +5 -0
- package/lib/plugin-runtime/im/host/conversation-migration.js +75 -0
- package/lib/plugin-runtime/im/host/database-config.d.ts +10 -0
- package/lib/plugin-runtime/im/host/database-config.js +152 -0
- package/lib/plugin-runtime/im/host/database-console-schema.d.ts +79 -0
- package/lib/plugin-runtime/im/host/database-console-schema.js +477 -0
- package/lib/plugin-runtime/im/host/database-console-sql.d.ts +66 -0
- package/lib/plugin-runtime/im/host/database-console-sql.js +459 -0
- package/lib/plugin-runtime/im/host/database-host-installer.d.ts +60 -0
- package/lib/plugin-runtime/im/host/database-host-installer.js +1166 -0
- package/lib/plugin-runtime/im/host/database-state.d.ts +9 -0
- package/lib/plugin-runtime/im/host/database-state.js +91 -0
- package/lib/plugin-runtime/im/host/index.d.ts +8 -0
- package/lib/plugin-runtime/im/host/index.js +8 -0
- package/lib/plugin-runtime/im/host/locale-host-installer.d.ts +3 -0
- package/lib/plugin-runtime/im/host/locale-host-installer.js +60 -0
- package/lib/plugin-runtime/im/host/outbound-host-installer.d.ts +8 -0
- package/lib/plugin-runtime/im/host/outbound-host-installer.js +153 -0
- package/lib/plugin-runtime/im/host/sender-enrichment.d.ts +34 -0
- package/lib/plugin-runtime/im/host/sender-enrichment.js +82 -0
- package/lib/plugin-runtime/im/im-runtime.d.ts +40 -111
- package/lib/plugin-runtime/im/im-runtime.js +235 -1059
- package/lib/plugin-runtime/im/inbound-dedup.d.ts +84 -0
- package/lib/plugin-runtime/im/inbound-dedup.js +322 -0
- package/lib/plugin-runtime/im/inbound-origin.d.ts +150 -0
- package/lib/plugin-runtime/im/inbound-origin.js +183 -0
- package/lib/plugin-runtime/im/inbound-runtime.d.ts +59 -0
- package/lib/plugin-runtime/im/inbound-runtime.js +478 -0
- package/lib/plugin-runtime/im/inbound-spine.d.ts +196 -0
- package/lib/plugin-runtime/im/inbound-spine.js +335 -0
- package/lib/plugin-runtime/im/index.d.ts +15 -4
- package/lib/plugin-runtime/im/index.js +11 -4
- package/lib/plugin-runtime/im/interaction-runtime.d.ts +50 -0
- package/lib/plugin-runtime/im/interaction-runtime.js +390 -0
- package/lib/plugin-runtime/im/interactive-router.d.ts +81 -0
- package/lib/plugin-runtime/im/interactive-router.js +382 -0
- package/lib/plugin-runtime/im/message-diagnostics.d.ts +70 -0
- package/lib/plugin-runtime/im/message-diagnostics.js +182 -0
- package/lib/plugin-runtime/im/message-dispatcher.d.ts +18 -4
- package/lib/plugin-runtime/im/message-dispatcher.js +138 -20
- package/lib/plugin-runtime/im/message-events.d.ts +85 -0
- package/lib/plugin-runtime/im/message-events.js +113 -0
- package/lib/plugin-runtime/im/outbound-delivery-runtime.d.ts +39 -0
- package/lib/plugin-runtime/im/outbound-delivery-runtime.js +450 -0
- package/lib/plugin-runtime/im/outbound-renderer.d.ts +52 -3
- package/lib/plugin-runtime/im/outbound-renderer.js +188 -8
- package/lib/plugin-runtime/im/outbound-segments.d.ts +29 -5
- package/lib/plugin-runtime/im/outbound-segments.js +130 -36
- package/lib/plugin-runtime/im/progressive-reply.d.ts +58 -0
- package/lib/plugin-runtime/im/progressive-reply.js +501 -0
- package/lib/plugin-runtime/im/public-api.d.ts +1 -1
- package/lib/request.d.ts +27 -36
- package/lib/request.js +14 -6
- package/lib/side-event/base.d.ts +64 -44
- package/lib/side-event/base.js +72 -19
- package/lib/side-event/index.d.ts +1 -1
- package/lib/side-event/index.js +1 -1
- package/lib/side-event/normalize.d.ts +7 -38
- package/lib/side-event/normalize.js +4 -109
- package/lib/side-event/scene-events.d.ts +40 -0
- package/lib/side-event/scene-events.js +147 -0
- package/lib/side-event/types.d.ts +4 -13
- package/lib/side-event/types.js +1 -55
- package/lib/system-event.d.ts +17 -12
- package/lib/system-event.js +8 -6
- package/lib/types.d.ts +23 -167
- package/lib/utils.d.ts +50 -33
- package/lib/utils.js +12 -185
- package/lib/venue/contracts.d.ts +21 -0
- package/lib/venue/contracts.js +3 -0
- package/lib/venue/floor-controller.d.ts +11 -0
- package/lib/venue/floor-controller.js +63 -0
- package/lib/venue/index.d.ts +13 -0
- package/lib/venue/index.js +11 -0
- package/lib/venue/membership-port.d.ts +23 -0
- package/lib/venue/membership-port.js +141 -0
- package/lib/venue/projector.d.ts +38 -0
- package/lib/venue/projector.js +45 -0
- package/lib/venue/registry.d.ts +16 -0
- package/lib/venue/registry.js +63 -0
- package/lib/venue/router.d.ts +19 -0
- package/lib/venue/router.js +101 -0
- package/lib/venue/send-limiter.d.ts +17 -0
- package/lib/venue/send-limiter.js +73 -0
- package/lib/venue/validator.d.ts +6 -0
- package/lib/venue/validator.js +160 -0
- package/package.json +24 -50
- package/lib/adapter.d.ts +0 -145
- package/lib/adapter.js +0 -377
- package/lib/built/adapter-process.d.ts +0 -58
- package/lib/built/adapter-process.js +0 -128
- package/lib/built/agent-preset.d.ts +0 -64
- package/lib/built/agent-preset.js +0 -79
- package/lib/built/ai-outbound/adapter-access.d.ts +0 -3
- package/lib/built/ai-outbound/adapter-access.js +0 -9
- package/lib/built/ai-outbound/extensions/qq-message.d.ts +0 -3
- package/lib/built/ai-outbound/extensions/qq-message.js +0 -23
- package/lib/built/authorization.d.ts +0 -10
- package/lib/built/authorization.js +0 -76
- package/lib/built/command.d.ts +0 -72
- package/lib/built/command.js +0 -105
- package/lib/built/component.d.ts +0 -67
- package/lib/built/component.js +0 -97
- package/lib/built/config.d.ts +0 -98
- package/lib/built/config.js +0 -372
- package/lib/built/connect-endpoint-instance.d.ts +0 -17
- package/lib/built/connect-endpoint-instance.js +0 -42
- package/lib/built/database.d.ts +0 -68
- package/lib/built/database.js +0 -106
- package/lib/built/dispatcher.d.ts +0 -141
- package/lib/built/dispatcher.js +0 -383
- package/lib/built/endpoint-commands.d.ts +0 -3
- package/lib/built/endpoint-commands.js +0 -99
- package/lib/built/endpoint-lifecycle-service.d.ts +0 -28
- package/lib/built/endpoint-lifecycle-service.js +0 -242
- package/lib/built/endpoint-lifecycle.d.ts +0 -27
- package/lib/built/endpoint-lifecycle.js +0 -36
- package/lib/built/endpoint-manager.d.ts +0 -34
- package/lib/built/html-renderer-loader.d.ts +0 -13
- package/lib/built/html-renderer-loader.js +0 -33
- package/lib/built/inbound-pipeline.d.ts +0 -37
- package/lib/built/inbound-pipeline.js +0 -63
- package/lib/built/inbound-runner.d.ts +0 -22
- package/lib/built/inbound-runner.js +0 -34
- package/lib/built/interactive-segment-contract.d.ts +0 -6
- package/lib/built/interactive-segment-contract.js +0 -9
- package/lib/built/interactive-segments/fallback-store.d.ts +0 -29
- package/lib/built/interactive-segments/fallback-store.js +0 -63
- package/lib/built/interactive-segments/handlers.d.ts +0 -16
- package/lib/built/interactive-segments/handlers.js +0 -74
- package/lib/built/introspection-format.d.ts +0 -10
- package/lib/built/introspection-format.js +0 -28
- package/lib/built/management-command-guard.d.ts +0 -15
- package/lib/built/management-command-guard.js +0 -25
- package/lib/built/message-filter.d.ts +0 -176
- package/lib/built/message-filter.js +0 -239
- package/lib/built/optional-peer-import.d.ts +0 -3
- package/lib/built/optional-peer-import.js +0 -33
- package/lib/built/outbound-media-contract.d.ts +0 -22
- package/lib/built/outbound-media-contract.js +0 -10
- package/lib/built/permission.d.ts +0 -51
- package/lib/built/permission.js +0 -99
- package/lib/built/permit-check.d.ts +0 -7
- package/lib/built/permit-check.js +0 -35
- package/lib/built/permit-parse.d.ts +0 -16
- package/lib/built/permit-parse.js +0 -32
- package/lib/built/platform-permit.d.ts +0 -20
- package/lib/built/platform-permit.js +0 -91
- package/lib/built/queue-im-field-contract.d.ts +0 -32
- package/lib/built/queue-im-field-contract.js +0 -67
- package/lib/built/rich-segments/adapter-policies.d.ts +0 -9
- package/lib/built/rich-segments/adapter-policies.js +0 -27
- package/lib/built/rich-segments/base.d.ts +0 -11
- package/lib/built/rich-segments/base.js +0 -24
- package/lib/built/rich-segments/builtins.d.ts +0 -4
- package/lib/built/rich-segments/builtins.js +0 -40
- package/lib/built/rich-segments/capabilities.d.ts +0 -6
- package/lib/built/rich-segments/capabilities.js +0 -38
- package/lib/built/rich-segments/html-segment.d.ts +0 -15
- package/lib/built/rich-segments/html-segment.js +0 -62
- package/lib/built/rich-segments/index.d.ts +0 -13
- package/lib/built/rich-segments/index.js +0 -13
- package/lib/built/rich-segments/markdown-segment.d.ts +0 -14
- package/lib/built/rich-segments/markdown-segment.js +0 -58
- package/lib/built/rich-segments/qrcode-segment.d.ts +0 -18
- package/lib/built/rich-segments/qrcode-segment.js +0 -73
- package/lib/built/rich-segments/registry.d.ts +0 -16
- package/lib/built/rich-segments/registry.js +0 -52
- package/lib/built/rich-segments/resolve.d.ts +0 -5
- package/lib/built/rich-segments/resolve.js +0 -87
- package/lib/built/rich-segments/tts-segment.d.ts +0 -13
- package/lib/built/rich-segments/tts-segment.js +0 -51
- package/lib/built/rich-segments/types.d.ts +0 -79
- package/lib/built/rich-segments/types.js +0 -17
- package/lib/built/runtime-io.d.ts +0 -9
- package/lib/built/runtime-io.js +0 -67
- package/lib/built/schedule.d.ts +0 -54
- package/lib/built/schedule.js +0 -112
- package/lib/built/schema-endpoint-manager.d.ts +0 -17
- package/lib/built/schema-endpoint-manager.js +0 -73
- package/lib/built/schema-feature.d.ts +0 -77
- package/lib/built/schema-feature.js +0 -130
- package/lib/built/skill.d.ts +0 -120
- package/lib/built/skill.js +0 -151
- package/lib/built/speech-loader.d.ts +0 -14
- package/lib/built/speech-loader.js +0 -32
- package/lib/built/tool.d.ts +0 -151
- package/lib/built/tool.js +0 -388
- package/lib/command.d.ts +0 -50
- package/lib/command.js +0 -106
- package/lib/component.d.ts +0 -26
- package/lib/component.js +0 -583
- package/lib/endpoint-capabilities.d.ts +0 -46
- package/lib/endpoint-capabilities.js +0 -55
- package/lib/endpoint.d.ts +0 -19
- package/lib/endpoint.js +0 -3
- package/lib/host-plugin-registry.d.ts +0 -8
- package/lib/host-plugin-registry.js +0 -12
- package/lib/plugin-context.d.ts +0 -27
- package/lib/plugin-context.js +0 -64
- package/lib/plugin-runtime/im/interactive.d.ts +0 -26
- package/lib/plugin-runtime/im/interactive.js +0 -46
- package/lib/plugin-runtime/im/login-assist-host.d.ts +0 -6
- package/lib/plugin-runtime/im/login-assist-host.js +0 -6
- package/lib/plugin-runtime/im/message-bus.d.ts +0 -38
- package/lib/plugin-runtime/im/message-bus.js +0 -40
- package/lib/plugin-runtime/im/service-tokens.d.ts +0 -18
- package/lib/plugin-runtime/im/service-tokens.js +0 -13
- package/lib/plugin.d.ts +0 -268
- package/lib/plugin.js +0 -583
- package/lib/schema-interaction.d.ts +0 -117
- package/lib/schema-interaction.js +0 -247
- package/lib/side-event/dispatch.d.ts +0 -15
- package/lib/side-event/dispatch.js +0 -140
- package/lib/tool-zod.d.ts +0 -43
- package/lib/tool-zod.js +0 -184
- /package/lib/{built/endpoint-manager.js → jsx/intrinsic-elements.js} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { validateVenueDefinitions } from './validator.js';
|
|
2
|
+
export function createVenueRegistry(venues) {
|
|
3
|
+
validateVenueDefinitions(venues);
|
|
4
|
+
const frozenVenues = Object.freeze(venues.map((venue) => Object.freeze({
|
|
5
|
+
...venue,
|
|
6
|
+
conversation: Object.freeze({ ...venue.conversation }),
|
|
7
|
+
members: Object.freeze(venue.members.map((member) => Object.freeze({
|
|
8
|
+
...member,
|
|
9
|
+
...(member.aliases ? { aliases: Object.freeze([...member.aliases]) } : {}),
|
|
10
|
+
}))),
|
|
11
|
+
})));
|
|
12
|
+
const byId = new Map();
|
|
13
|
+
const byAgent = new Map();
|
|
14
|
+
const byEndpoint = new Map();
|
|
15
|
+
for (const venue of frozenVenues) {
|
|
16
|
+
byId.set(venue.id, venue);
|
|
17
|
+
const agentMap = new Map();
|
|
18
|
+
const endpointMap = new Map();
|
|
19
|
+
for (const member of venue.members) {
|
|
20
|
+
agentMap.set(member.agent, member);
|
|
21
|
+
endpointMap.set(member.botEndpoint, member);
|
|
22
|
+
}
|
|
23
|
+
byAgent.set(venue.id, agentMap);
|
|
24
|
+
byEndpoint.set(venue.id, endpointMap);
|
|
25
|
+
}
|
|
26
|
+
return Object.freeze({
|
|
27
|
+
list() {
|
|
28
|
+
return frozenVenues;
|
|
29
|
+
},
|
|
30
|
+
get(venueId) {
|
|
31
|
+
return byId.get(venueId);
|
|
32
|
+
},
|
|
33
|
+
findByConversation(conv) {
|
|
34
|
+
const targetThread = conv.threadId ?? '';
|
|
35
|
+
return frozenVenues.find((venue) => {
|
|
36
|
+
const c = venue.conversation;
|
|
37
|
+
if (c.platform !== conv.platform || c.sceneId !== conv.sceneId) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (c.sceneType !== undefined && conv.sceneType !== undefined && c.sceneType !== conv.sceneType) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
const venueThread = c.threadId ?? '';
|
|
44
|
+
return venueThread === targetThread;
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
resolveMemberByAgent(venueId, agent) {
|
|
48
|
+
return byAgent.get(venueId)?.get(agent);
|
|
49
|
+
},
|
|
50
|
+
resolveMemberByEndpoint(venueId, endpointId) {
|
|
51
|
+
return byEndpoint.get(venueId)?.get(endpointId);
|
|
52
|
+
},
|
|
53
|
+
resolveEntryMember(venueId) {
|
|
54
|
+
const venue = byId.get(venueId);
|
|
55
|
+
if (!venue || venue.members.length === 0)
|
|
56
|
+
return undefined;
|
|
57
|
+
if (venue.entry !== undefined) {
|
|
58
|
+
return byAgent.get(venueId)?.get(venue.entry) ?? venue.members[0];
|
|
59
|
+
}
|
|
60
|
+
return venue.members[0];
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { VenueDefinition, VenueMemberConfig } from './contracts.js';
|
|
2
|
+
export type VenueRouteReason = 'pending' | 'mention' | 'reply' | 'endpoint' | 'entry';
|
|
3
|
+
export interface RouteVenueMessageInput {
|
|
4
|
+
readonly venue: VenueDefinition;
|
|
5
|
+
readonly text: string;
|
|
6
|
+
readonly mentions?: readonly string[];
|
|
7
|
+
readonly replyToSenderId?: string;
|
|
8
|
+
readonly pendingAgent?: string;
|
|
9
|
+
readonly winningEndpointId?: string;
|
|
10
|
+
readonly resolveEndpointSelfId?: (platform: string, endpointId: string) => string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface VenueRouteResult {
|
|
13
|
+
readonly member: VenueMemberConfig;
|
|
14
|
+
readonly reason: VenueRouteReason;
|
|
15
|
+
}
|
|
16
|
+
export declare function findMentionPositionInText(text: string, name: string): number;
|
|
17
|
+
export declare function findEarliestMemberTextMention(text: string, member: VenueMemberConfig): number;
|
|
18
|
+
export declare function resolveVenueEntryMember(venue: VenueDefinition): VenueMemberConfig;
|
|
19
|
+
export declare function routeVenueMessage(input: RouteVenueMessageInput): VenueRouteResult;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
const WORD_CHAR = '\\p{L}\\p{N}_-';
|
|
2
|
+
function escapeRegExp(value) {
|
|
3
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
4
|
+
}
|
|
5
|
+
export function findMentionPositionInText(text, name) {
|
|
6
|
+
if (!text || !name)
|
|
7
|
+
return -1;
|
|
8
|
+
const pattern = new RegExp(`(?<![${WORD_CHAR}])@${escapeRegExp(name)}(?![${WORD_CHAR}])`, 'iu');
|
|
9
|
+
const match = pattern.exec(text);
|
|
10
|
+
return match ? match.index : -1;
|
|
11
|
+
}
|
|
12
|
+
export function findEarliestMemberTextMention(text, member) {
|
|
13
|
+
if (!text)
|
|
14
|
+
return -1;
|
|
15
|
+
const names = [member.agent, ...(member.aliases ?? [])];
|
|
16
|
+
let earliest = -1;
|
|
17
|
+
for (const name of names) {
|
|
18
|
+
const pos = findMentionPositionInText(text, name);
|
|
19
|
+
if (pos >= 0 && (earliest < 0 || pos < earliest)) {
|
|
20
|
+
earliest = pos;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return earliest;
|
|
24
|
+
}
|
|
25
|
+
export function resolveVenueEntryMember(venue) {
|
|
26
|
+
if (venue.entry !== undefined) {
|
|
27
|
+
const found = venue.members.find((m) => m.agent === venue.entry);
|
|
28
|
+
if (found)
|
|
29
|
+
return found;
|
|
30
|
+
}
|
|
31
|
+
const first = venue.members[0];
|
|
32
|
+
if (!first) {
|
|
33
|
+
throw new Error(`Venue "${venue.id}" has no members`);
|
|
34
|
+
}
|
|
35
|
+
return first;
|
|
36
|
+
}
|
|
37
|
+
export function routeVenueMessage(input) {
|
|
38
|
+
const { venue, text, mentions, replyToSenderId, pendingAgent, winningEndpointId, resolveEndpointSelfId } = input;
|
|
39
|
+
const platform = venue.conversation.platform;
|
|
40
|
+
const entryMember = resolveVenueEntryMember(venue);
|
|
41
|
+
// 1. pending
|
|
42
|
+
if (pendingAgent !== undefined && pendingAgent !== '') {
|
|
43
|
+
const pendingMember = venue.members.find((m) => m.agent === pendingAgent);
|
|
44
|
+
if (pendingMember) {
|
|
45
|
+
return Object.freeze({ member: pendingMember, reason: 'pending' });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// 2. mention (structured mentions first, then @<agent> / @<alias> in text)
|
|
49
|
+
if (mentions && mentions.length > 0) {
|
|
50
|
+
for (const target of mentions) {
|
|
51
|
+
if (!target)
|
|
52
|
+
continue;
|
|
53
|
+
const bySelfId = venue.members.find((m) => {
|
|
54
|
+
const selfId = resolveEndpointSelfId?.(platform, m.botEndpoint);
|
|
55
|
+
return selfId !== undefined && selfId !== '' && selfId === target;
|
|
56
|
+
});
|
|
57
|
+
if (bySelfId) {
|
|
58
|
+
return Object.freeze({ member: bySelfId, reason: 'mention' });
|
|
59
|
+
}
|
|
60
|
+
const lowerTarget = target.toLowerCase();
|
|
61
|
+
const byName = venue.members.find((m) => m.agent.toLowerCase() === lowerTarget
|
|
62
|
+
|| (m.aliases?.some((alias) => alias.toLowerCase() === lowerTarget) ?? false));
|
|
63
|
+
if (byName) {
|
|
64
|
+
return Object.freeze({ member: byName, reason: 'mention' });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (text) {
|
|
69
|
+
let bestMember;
|
|
70
|
+
let bestIndex = -1;
|
|
71
|
+
for (const member of venue.members) {
|
|
72
|
+
const idx = findEarliestMemberTextMention(text, member);
|
|
73
|
+
if (idx >= 0 && (bestIndex < 0 || idx < bestIndex)) {
|
|
74
|
+
bestIndex = idx;
|
|
75
|
+
bestMember = member;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (bestMember) {
|
|
79
|
+
return Object.freeze({ member: bestMember, reason: 'mention' });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// 3. reply
|
|
83
|
+
if (replyToSenderId !== undefined && replyToSenderId !== '') {
|
|
84
|
+
const repliedMember = venue.members.find((m) => {
|
|
85
|
+
const selfId = resolveEndpointSelfId?.(platform, m.botEndpoint);
|
|
86
|
+
return (selfId !== undefined && selfId !== '' && selfId === replyToSenderId) || m.botEndpoint === replyToSenderId;
|
|
87
|
+
});
|
|
88
|
+
if (repliedMember) {
|
|
89
|
+
return Object.freeze({ member: repliedMember, reason: 'reply' });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// 4. endpoint (non-entry winningEndpointId)
|
|
93
|
+
if (winningEndpointId !== undefined && winningEndpointId !== '') {
|
|
94
|
+
const endpointMember = venue.members.find((m) => m.botEndpoint === winningEndpointId);
|
|
95
|
+
if (endpointMember && endpointMember.botEndpoint !== entryMember.botEndpoint) {
|
|
96
|
+
return Object.freeze({ member: endpointMember, reason: 'endpoint' });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// 5. entry
|
|
100
|
+
return Object.freeze({ member: entryMember, reason: 'entry' });
|
|
101
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface VenueSendLimiterOptions {
|
|
2
|
+
readonly minIntervalMs?: number;
|
|
3
|
+
readonly maxBurst?: number;
|
|
4
|
+
readonly now?: () => number;
|
|
5
|
+
readonly sleep?: (ms: number) => Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export type VenueSendLimiterKey = string | {
|
|
8
|
+
readonly venueId?: string;
|
|
9
|
+
readonly endpointId: string;
|
|
10
|
+
};
|
|
11
|
+
export interface VenueSendLimiter {
|
|
12
|
+
acquire(key: VenueSendLimiterKey): Promise<number>;
|
|
13
|
+
withLimit<T>(key: VenueSendLimiterKey, fn: () => Promise<T> | T): Promise<T>;
|
|
14
|
+
schedule<T>(key: VenueSendLimiterKey, fn: () => Promise<T> | T): Promise<T>;
|
|
15
|
+
reset(key?: VenueSendLimiterKey): void;
|
|
16
|
+
}
|
|
17
|
+
export declare function createVenueSendLimiter(options?: VenueSendLimiterOptions): VenueSendLimiter;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
function normalizeLimiterKey(key) {
|
|
2
|
+
if (typeof key === 'string')
|
|
3
|
+
return key;
|
|
4
|
+
return `${key.venueId ?? '*'}:${key.endpointId}`;
|
|
5
|
+
}
|
|
6
|
+
export function createVenueSendLimiter(options = {}) {
|
|
7
|
+
const minIntervalMs = Math.max(0, options.minIntervalMs ?? 1000);
|
|
8
|
+
const maxBurst = Math.max(1, Math.floor(options.maxBurst ?? 1));
|
|
9
|
+
const now = options.now ?? Date.now;
|
|
10
|
+
const sleep = options.sleep
|
|
11
|
+
?? ((ms) => new Promise((resolve) => {
|
|
12
|
+
setTimeout(resolve, ms);
|
|
13
|
+
}));
|
|
14
|
+
const buckets = new Map();
|
|
15
|
+
const reserveWaitMs = (rawKey) => {
|
|
16
|
+
if (minIntervalMs <= 0)
|
|
17
|
+
return 0;
|
|
18
|
+
const key = normalizeLimiterKey(rawKey);
|
|
19
|
+
const current = now();
|
|
20
|
+
let bucket = buckets.get(key);
|
|
21
|
+
if (!bucket) {
|
|
22
|
+
bucket = {
|
|
23
|
+
tokens: maxBurst,
|
|
24
|
+
lastRefillAt: current,
|
|
25
|
+
nextAvailableAt: current,
|
|
26
|
+
};
|
|
27
|
+
buckets.set(key, bucket);
|
|
28
|
+
}
|
|
29
|
+
else if (current > bucket.lastRefillAt) {
|
|
30
|
+
const elapsed = current - bucket.lastRefillAt;
|
|
31
|
+
const replenished = elapsed / minIntervalMs;
|
|
32
|
+
bucket.tokens = Math.min(maxBurst, bucket.tokens + replenished);
|
|
33
|
+
bucket.lastRefillAt = current;
|
|
34
|
+
}
|
|
35
|
+
if (bucket.tokens >= 1 && current >= bucket.nextAvailableAt) {
|
|
36
|
+
bucket.tokens -= 1;
|
|
37
|
+
if (bucket.tokens < 1) {
|
|
38
|
+
bucket.nextAvailableAt = current + Math.ceil((1 - bucket.tokens) * minIntervalMs);
|
|
39
|
+
}
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
const scheduledAt = Math.max(current, bucket.nextAvailableAt);
|
|
43
|
+
const waitMs = scheduledAt - current;
|
|
44
|
+
bucket.tokens = 0;
|
|
45
|
+
bucket.lastRefillAt = scheduledAt;
|
|
46
|
+
bucket.nextAvailableAt = scheduledAt + minIntervalMs;
|
|
47
|
+
return waitMs;
|
|
48
|
+
};
|
|
49
|
+
const acquire = async (key) => {
|
|
50
|
+
const waitMs = reserveWaitMs(key);
|
|
51
|
+
if (waitMs > 0) {
|
|
52
|
+
await sleep(waitMs);
|
|
53
|
+
}
|
|
54
|
+
return waitMs;
|
|
55
|
+
};
|
|
56
|
+
const withLimit = async (key, fn) => {
|
|
57
|
+
await acquire(key);
|
|
58
|
+
return await fn();
|
|
59
|
+
};
|
|
60
|
+
return Object.freeze({
|
|
61
|
+
acquire,
|
|
62
|
+
withLimit,
|
|
63
|
+
schedule: withLimit,
|
|
64
|
+
reset(key) {
|
|
65
|
+
if (key === undefined) {
|
|
66
|
+
buckets.clear();
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
buckets.delete(normalizeLimiterKey(key));
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VenueDefinition } from './contracts.js';
|
|
2
|
+
export declare class VenueValidationError extends Error {
|
|
3
|
+
readonly issues: readonly string[];
|
|
4
|
+
constructor(issues: readonly string[]);
|
|
5
|
+
}
|
|
6
|
+
export declare function validateVenueDefinitions(venues: readonly VenueDefinition[]): void;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
const VALID_SCENE_TYPES = new Set(['private', 'group', 'channel']);
|
|
2
|
+
const VALID_VISIBILITY_MODES = new Set(['visible', 'summary', 'backstage']);
|
|
3
|
+
export class VenueValidationError extends Error {
|
|
4
|
+
issues;
|
|
5
|
+
constructor(issues) {
|
|
6
|
+
super(`Invalid venue definitions:\n${issues.map((issue) => ` - ${issue}`).join('\n')}`);
|
|
7
|
+
this.name = 'VenueValidationError';
|
|
8
|
+
this.issues = Object.freeze([...issues]);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function isNonEmptyString(value) {
|
|
12
|
+
return typeof value === 'string' && value.trim().length > 0;
|
|
13
|
+
}
|
|
14
|
+
export function validateVenueDefinitions(venues) {
|
|
15
|
+
if (!Array.isArray(venues)) {
|
|
16
|
+
throw new VenueValidationError(['venues must be an array']);
|
|
17
|
+
}
|
|
18
|
+
const issues = [];
|
|
19
|
+
const seenVenueIds = new Set();
|
|
20
|
+
const seenConversations = [];
|
|
21
|
+
for (let i = 0; i < venues.length; i++) {
|
|
22
|
+
const venue = venues[i];
|
|
23
|
+
const label = isNonEmptyString(venue?.id) ? `venue "${venue.id.trim()}"` : `venues[${i}]`;
|
|
24
|
+
if (!venue || typeof venue !== 'object') {
|
|
25
|
+
issues.push(`${label}: must be an object`);
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (!isNonEmptyString(venue.id)) {
|
|
29
|
+
issues.push(`${label}: id must be a non-empty string`);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
const id = venue.id.trim();
|
|
33
|
+
if (seenVenueIds.has(id)) {
|
|
34
|
+
issues.push(`${label}: duplicate venue id "${id}"`);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
seenVenueIds.add(id);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const conv = venue.conversation;
|
|
41
|
+
if (!conv || typeof conv !== 'object') {
|
|
42
|
+
issues.push(`${label}: conversation is required`);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
const platformOk = isNonEmptyString(conv.platform);
|
|
46
|
+
const sceneIdOk = isNonEmptyString(conv.sceneId);
|
|
47
|
+
if (!platformOk) {
|
|
48
|
+
issues.push(`${label}: conversation.platform must be a non-empty string`);
|
|
49
|
+
}
|
|
50
|
+
if (!sceneIdOk) {
|
|
51
|
+
issues.push(`${label}: conversation.sceneId must be a non-empty string`);
|
|
52
|
+
}
|
|
53
|
+
if (conv.sceneType !== undefined && !VALID_SCENE_TYPES.has(conv.sceneType)) {
|
|
54
|
+
issues.push(`${label}: conversation.sceneType must be one of "private", "group", "channel"`);
|
|
55
|
+
}
|
|
56
|
+
if (conv.threadId !== undefined && !isNonEmptyString(conv.threadId)) {
|
|
57
|
+
issues.push(`${label}: conversation.threadId must be a non-empty string when provided`);
|
|
58
|
+
}
|
|
59
|
+
if (platformOk && sceneIdOk) {
|
|
60
|
+
const platform = conv.platform.trim();
|
|
61
|
+
const sceneType = conv.sceneType;
|
|
62
|
+
const sceneId = conv.sceneId.trim();
|
|
63
|
+
const threadId = conv.threadId?.trim() ?? '';
|
|
64
|
+
const conflict = seenConversations.find((existing) => existing.platform === platform
|
|
65
|
+
&& existing.sceneId === sceneId
|
|
66
|
+
&& existing.threadId === threadId
|
|
67
|
+
&& (existing.sceneType === undefined || sceneType === undefined || existing.sceneType === sceneType));
|
|
68
|
+
if (conflict) {
|
|
69
|
+
issues.push(`${label}: duplicate conversation (${platform}/${sceneType ?? '*'}/${sceneId}${threadId ? `/${threadId}` : ''}) already bound by venue "${conflict.venueId}"`);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
seenConversations.push({
|
|
73
|
+
venueId: isNonEmptyString(venue.id) ? venue.id.trim() : `venues[${i}]`,
|
|
74
|
+
platform,
|
|
75
|
+
sceneType,
|
|
76
|
+
sceneId,
|
|
77
|
+
threadId,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const memberAgents = new Set();
|
|
83
|
+
const memberEndpoints = new Set();
|
|
84
|
+
const memberNamesLower = new Set();
|
|
85
|
+
if (!Array.isArray(venue.members) || venue.members.length === 0) {
|
|
86
|
+
issues.push(`${label}: members must be a non-empty array`);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
for (let m = 0; m < venue.members.length; m++) {
|
|
90
|
+
const member = venue.members[m];
|
|
91
|
+
const memberLabel = `${label}.members[${m}]`;
|
|
92
|
+
if (!member || typeof member !== 'object') {
|
|
93
|
+
issues.push(`${memberLabel}: must be an object`);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (!isNonEmptyString(member.agent)) {
|
|
97
|
+
issues.push(`${memberLabel}: agent must be a non-empty string`);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const agent = member.agent.trim();
|
|
101
|
+
if (memberAgents.has(agent)) {
|
|
102
|
+
issues.push(`${memberLabel}: duplicate member agent "${agent}" in venue`);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
memberAgents.add(agent);
|
|
106
|
+
memberNamesLower.add(agent.toLowerCase());
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (!isNonEmptyString(member.botEndpoint)) {
|
|
110
|
+
issues.push(`${memberLabel}: botEndpoint must be a non-empty string`);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
const endpoint = member.botEndpoint.trim();
|
|
114
|
+
if (memberEndpoints.has(endpoint)) {
|
|
115
|
+
issues.push(`${memberLabel}: duplicate member botEndpoint "${endpoint}" in venue`);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
memberEndpoints.add(endpoint);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (member.aliases !== undefined) {
|
|
122
|
+
if (!Array.isArray(member.aliases)) {
|
|
123
|
+
issues.push(`${memberLabel}: aliases must be an array of strings`);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
for (let a = 0; a < member.aliases.length; a++) {
|
|
127
|
+
const alias = member.aliases[a];
|
|
128
|
+
if (!isNonEmptyString(alias)) {
|
|
129
|
+
issues.push(`${memberLabel}.aliases[${a}]: alias must be a non-empty string`);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
const lower = alias.trim().toLowerCase();
|
|
133
|
+
if (memberNamesLower.has(lower)) {
|
|
134
|
+
issues.push(`${memberLabel}.aliases[${a}]: duplicate alias "${alias}" in venue`);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
memberNamesLower.add(lower);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (venue.entry !== undefined) {
|
|
146
|
+
if (!isNonEmptyString(venue.entry)) {
|
|
147
|
+
issues.push(`${label}: entry must be a non-empty string when specified`);
|
|
148
|
+
}
|
|
149
|
+
else if (memberAgents.size > 0 && !memberAgents.has(venue.entry.trim())) {
|
|
150
|
+
issues.push(`${label}: entry "${venue.entry}" does not match any member agent in venue`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (venue.visibility !== undefined && !VALID_VISIBILITY_MODES.has(venue.visibility)) {
|
|
154
|
+
issues.push(`${label}: visibility must be "visible", "summary", or "backstage"`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (issues.length > 0) {
|
|
158
|
+
throw new VenueValidationError(issues);
|
|
159
|
+
}
|
|
160
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Zhin机器人核心框架",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -8,62 +8,42 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./lib/index.d.ts",
|
|
11
|
-
"development": "./src/index.ts",
|
|
12
11
|
"import": "./lib/index.js"
|
|
13
12
|
},
|
|
14
|
-
"./tool-zod": {
|
|
15
|
-
"types": "./lib/tool-zod.d.ts",
|
|
16
|
-
"development": "./src/tool-zod.ts",
|
|
17
|
-
"import": "./lib/tool-zod.js"
|
|
18
|
-
},
|
|
19
|
-
"./queue-im-field-contract": {
|
|
20
|
-
"types": "./lib/built/queue-im-field-contract.d.ts",
|
|
21
|
-
"development": "./src/built/queue-im-field-contract.ts",
|
|
22
|
-
"import": "./lib/built/queue-im-field-contract.js"
|
|
23
|
-
},
|
|
24
13
|
"./runtime": {
|
|
25
14
|
"types": "./lib/plugin-runtime/im/index.d.ts",
|
|
26
|
-
"development": "./src/plugin-runtime/im/index.ts",
|
|
27
15
|
"import": "./lib/plugin-runtime/im/index.js"
|
|
28
16
|
},
|
|
29
17
|
"./jsx": {
|
|
30
18
|
"types": "./lib/jsx.d.ts",
|
|
31
|
-
"development": "./src/jsx.ts",
|
|
32
19
|
"import": "./lib/jsx.js"
|
|
33
20
|
},
|
|
34
21
|
"./jsx-runtime": {
|
|
35
22
|
"types": "./lib/jsx-runtime.d.ts",
|
|
36
|
-
"development": "./src/jsx-runtime.ts",
|
|
37
23
|
"import": "./lib/jsx-runtime.js"
|
|
38
24
|
},
|
|
39
25
|
"./jsx-dev-runtime": {
|
|
40
26
|
"types": "./lib/jsx-dev-runtime.d.ts",
|
|
41
|
-
"development": "./src/jsx-dev-runtime.ts",
|
|
42
27
|
"import": "./lib/jsx-dev-runtime.js"
|
|
43
28
|
},
|
|
44
29
|
"./feature/adapter": {
|
|
45
30
|
"types": "./lib/feature/adapter.d.ts",
|
|
46
|
-
"development": "./src/feature/adapter.ts",
|
|
47
31
|
"import": "./lib/feature/adapter.js"
|
|
48
32
|
},
|
|
49
33
|
"./feature/command": {
|
|
50
34
|
"types": "./lib/feature/command.d.ts",
|
|
51
|
-
"development": "./src/feature/command.ts",
|
|
52
35
|
"import": "./lib/feature/command.js"
|
|
53
36
|
},
|
|
54
37
|
"./feature/component": {
|
|
55
38
|
"types": "./lib/feature/component.d.ts",
|
|
56
|
-
"development": "./src/feature/component.ts",
|
|
57
39
|
"import": "./lib/feature/component.js"
|
|
58
40
|
},
|
|
59
41
|
"./feature/middleware": {
|
|
60
42
|
"types": "./lib/feature/middleware.d.ts",
|
|
61
|
-
"development": "./src/feature/middleware.ts",
|
|
62
43
|
"import": "./lib/feature/middleware.js"
|
|
63
44
|
},
|
|
64
45
|
"./feature/handler": {
|
|
65
46
|
"types": "./lib/feature/handler.d.ts",
|
|
66
|
-
"development": "./src/feature/handler.ts",
|
|
67
47
|
"import": "./lib/feature/handler.js"
|
|
68
48
|
}
|
|
69
49
|
},
|
|
@@ -72,37 +52,27 @@
|
|
|
72
52
|
],
|
|
73
53
|
"dependencies": {
|
|
74
54
|
"qrcode": "^1.5.4",
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"@zhin.js/
|
|
79
|
-
"@zhin.js/
|
|
80
|
-
"@zhin.js/
|
|
81
|
-
"@zhin.js/
|
|
82
|
-
"@zhin.js/
|
|
83
|
-
"@zhin.js/
|
|
84
|
-
"@zhin.js/
|
|
85
|
-
"@zhin.js/
|
|
86
|
-
"@zhin.js/
|
|
87
|
-
"@zhin.js/
|
|
88
|
-
"@zhin.js/permission": "1.
|
|
89
|
-
"@zhin.js/
|
|
90
|
-
"@zhin.js/schema": "1.0.73"
|
|
91
|
-
},
|
|
92
|
-
"peerDependencies": {
|
|
93
|
-
"zod": "^4.0.0"
|
|
94
|
-
},
|
|
95
|
-
"peerDependenciesMeta": {
|
|
96
|
-
"zod": {
|
|
97
|
-
"optional": true
|
|
98
|
-
}
|
|
55
|
+
"@zhin.js/command": "1.2.2",
|
|
56
|
+
"@zhin.js/component": "1.1.18",
|
|
57
|
+
"@zhin.js/database": "1.2.0",
|
|
58
|
+
"@zhin.js/handler": "1.1.17",
|
|
59
|
+
"@zhin.js/adapter": "1.1.34",
|
|
60
|
+
"@zhin.js/kernel": "1.1.7",
|
|
61
|
+
"@zhin.js/logger": "1.1.3",
|
|
62
|
+
"@zhin.js/im-contract": "1.1.14",
|
|
63
|
+
"@zhin.js/middleware": "1.1.18",
|
|
64
|
+
"@zhin.js/plugin-runtime": "1.2.1",
|
|
65
|
+
"@zhin.js/schedule-feature": "1.1.17",
|
|
66
|
+
"@zhin.js/schema": "1.1.7",
|
|
67
|
+
"@zhin.js/feature-kit": "1.1.17",
|
|
68
|
+
"@zhin.js/permission": "1.2.1",
|
|
69
|
+
"@zhin.js/jsx": "1.1.13"
|
|
99
70
|
},
|
|
100
71
|
"devDependencies": {
|
|
101
72
|
"@types/node": "^26.1.2",
|
|
102
73
|
"@types/qrcode": "^1.5.6",
|
|
103
74
|
"ajv": "8.18.0",
|
|
104
|
-
"typescript": "^6.0.3"
|
|
105
|
-
"@zhin.js/ai": "1.5.9"
|
|
75
|
+
"typescript": "^6.0.3"
|
|
106
76
|
},
|
|
107
77
|
"repository": {
|
|
108
78
|
"type": "git",
|
|
@@ -120,7 +90,7 @@
|
|
|
120
90
|
"url": "https://github.com/lc-cn"
|
|
121
91
|
},
|
|
122
92
|
"engines": {
|
|
123
|
-
"node": "
|
|
93
|
+
"node": ">=22.19.0"
|
|
124
94
|
},
|
|
125
95
|
"zhin": {
|
|
126
96
|
"protocol": 1,
|
|
@@ -131,7 +101,7 @@
|
|
|
131
101
|
"features": [
|
|
132
102
|
{
|
|
133
103
|
"package": "@zhin.js/adapter",
|
|
134
|
-
"api": "^1.0
|
|
104
|
+
"api": "^2.1.0"
|
|
135
105
|
},
|
|
136
106
|
{
|
|
137
107
|
"package": "@zhin.js/command",
|
|
@@ -148,12 +118,16 @@
|
|
|
148
118
|
{
|
|
149
119
|
"package": "@zhin.js/handler",
|
|
150
120
|
"api": "^1.0.0"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"package": "@zhin.js/schedule-feature",
|
|
124
|
+
"api": "^1.0.0"
|
|
151
125
|
}
|
|
152
126
|
],
|
|
153
127
|
"plugins": []
|
|
154
128
|
},
|
|
155
129
|
"scripts": {
|
|
156
|
-
"build": "tsc",
|
|
130
|
+
"build": "rimraf lib && tsc",
|
|
157
131
|
"clean": "rimraf lib"
|
|
158
132
|
}
|
|
159
133
|
}
|