@soimy/dingtalk 3.6.0 → 3.6.2-beta.1

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.
Files changed (174) hide show
  1. package/README.md +4 -1
  2. package/dist/index.d.ts +14 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +14443 -0
  5. package/dist/index.js.map +7 -0
  6. package/dist/src/access-control.d.ts +43 -0
  7. package/dist/src/access-control.d.ts.map +1 -0
  8. package/dist/src/ack-reaction/dynamic-ack-reaction-controller.d.ts +22 -0
  9. package/dist/src/ack-reaction/dynamic-ack-reaction-controller.d.ts.map +1 -0
  10. package/dist/src/ack-reaction/dynamic-ack-reaction-events.d.ts +36 -0
  11. package/dist/src/ack-reaction/dynamic-ack-reaction-events.d.ts.map +1 -0
  12. package/dist/src/ack-reaction/dynamic-ack-reaction-progress.d.ts +7 -0
  13. package/dist/src/ack-reaction/dynamic-ack-reaction-progress.d.ts.map +1 -0
  14. package/dist/src/ack-reaction-classifier.d.ts +8 -0
  15. package/dist/src/ack-reaction-classifier.d.ts.map +1 -0
  16. package/dist/src/ack-reaction-service.d.ts +15 -0
  17. package/dist/src/ack-reaction-service.d.ts.map +1 -0
  18. package/dist/src/auth.d.ts +7 -0
  19. package/dist/src/auth.d.ts.map +1 -0
  20. package/dist/src/card/card-action-handler.d.ts +14 -0
  21. package/dist/src/card/card-action-handler.d.ts.map +1 -0
  22. package/dist/src/card/card-markdown-image-reroute.d.ts +16 -0
  23. package/dist/src/card/card-markdown-image-reroute.d.ts.map +1 -0
  24. package/dist/src/card/card-run-registry.d.ts +60 -0
  25. package/dist/src/card/card-run-registry.d.ts.map +1 -0
  26. package/dist/src/card/card-stop-handler.d.ts +18 -0
  27. package/dist/src/card/card-stop-handler.d.ts.map +1 -0
  28. package/dist/src/card/card-streaming-mode.d.ts +8 -0
  29. package/dist/src/card/card-streaming-mode.d.ts.map +1 -0
  30. package/dist/src/card/card-template.d.ts +21 -0
  31. package/dist/src/card/card-template.d.ts.map +1 -0
  32. package/dist/src/card/reasoning-answer-split.d.ts +6 -0
  33. package/dist/src/card/reasoning-answer-split.d.ts.map +1 -0
  34. package/dist/src/card/reasoning-block-assembler.d.ts +7 -0
  35. package/dist/src/card/reasoning-block-assembler.d.ts.map +1 -0
  36. package/dist/src/card/statusline-renderer.d.ts +24 -0
  37. package/dist/src/card/statusline-renderer.d.ts.map +1 -0
  38. package/dist/src/card-callback-service.d.ts +23 -0
  39. package/dist/src/card-callback-service.d.ts.map +1 -0
  40. package/dist/src/card-draft-controller.d.ts +75 -0
  41. package/dist/src/card-draft-controller.d.ts.map +1 -0
  42. package/dist/src/card-service.d.ts +99 -0
  43. package/dist/src/card-service.d.ts.map +1 -0
  44. package/dist/src/channel.d.ts +10 -0
  45. package/dist/src/channel.d.ts.map +1 -0
  46. package/dist/src/command/card-stop-command.d.ts +30 -0
  47. package/dist/src/command/card-stop-command.d.ts.map +1 -0
  48. package/dist/src/command/inbound-command-dispatch-service.d.ts +40 -0
  49. package/dist/src/command/inbound-command-dispatch-service.d.ts.map +1 -0
  50. package/dist/src/config-schema.d.ts +8 -0
  51. package/dist/src/config-schema.d.ts.map +1 -0
  52. package/dist/src/config.d.ts +60 -0
  53. package/dist/src/config.d.ts.map +1 -0
  54. package/dist/src/connection-manager.d.ts +148 -0
  55. package/dist/src/connection-manager.d.ts.map +1 -0
  56. package/dist/src/dedup.d.ts +4 -0
  57. package/dist/src/dedup.d.ts.map +1 -0
  58. package/dist/src/device-registration.d.ts +16 -0
  59. package/dist/src/device-registration.d.ts.map +1 -0
  60. package/dist/src/docs-service.d.ts +12 -0
  61. package/dist/src/docs-service.d.ts.map +1 -0
  62. package/dist/src/draft-stream-loop.d.ts +28 -0
  63. package/dist/src/draft-stream-loop.d.ts.map +1 -0
  64. package/dist/src/feedback-learning-service.d.ts +123 -0
  65. package/dist/src/feedback-learning-service.d.ts.map +1 -0
  66. package/dist/src/feedback-learning-store.d.ts +181 -0
  67. package/dist/src/feedback-learning-store.d.ts.map +1 -0
  68. package/dist/src/gateway/channel-gateway.d.ts +4 -0
  69. package/dist/src/gateway/channel-gateway.d.ts.map +1 -0
  70. package/dist/src/http-client.d.ts +9 -0
  71. package/dist/src/http-client.d.ts.map +1 -0
  72. package/dist/src/inbound-handler.d.ts +9 -0
  73. package/dist/src/inbound-handler.d.ts.map +1 -0
  74. package/dist/src/learning-command-service.d.ts +64 -0
  75. package/dist/src/learning-command-service.d.ts.map +1 -0
  76. package/dist/src/logger-context.d.ts +10 -0
  77. package/dist/src/logger-context.d.ts.map +1 -0
  78. package/dist/src/media-utils.d.ts +63 -0
  79. package/dist/src/media-utils.d.ts.map +1 -0
  80. package/dist/src/message-context-store.d.ts +126 -0
  81. package/dist/src/message-context-store.d.ts.map +1 -0
  82. package/dist/src/message-utils.d.ts +12 -0
  83. package/dist/src/message-utils.d.ts.map +1 -0
  84. package/dist/src/messaging/attachment-text-extractor.d.ts +13 -0
  85. package/dist/src/messaging/attachment-text-extractor.d.ts.map +1 -0
  86. package/dist/src/messaging/btw-deliver.d.ts +42 -0
  87. package/dist/src/messaging/btw-deliver.d.ts.map +1 -0
  88. package/dist/src/messaging/channel-actions.d.ts +3 -0
  89. package/dist/src/messaging/channel-actions.d.ts.map +1 -0
  90. package/dist/src/messaging/channel-outbound.d.ts +3 -0
  91. package/dist/src/messaging/channel-outbound.d.ts.map +1 -0
  92. package/dist/src/messaging/quoted-context.d.ts +36 -0
  93. package/dist/src/messaging/quoted-context.d.ts.map +1 -0
  94. package/dist/src/messaging/quoted-file-service.d.ts +25 -0
  95. package/dist/src/messaging/quoted-file-service.d.ts.map +1 -0
  96. package/dist/src/messaging/quoted-ref.d.ts +12 -0
  97. package/dist/src/messaging/quoted-ref.d.ts.map +1 -0
  98. package/dist/src/onboarding.d.ts +4 -0
  99. package/dist/src/onboarding.d.ts.map +1 -0
  100. package/dist/src/path-utils.d.ts +3 -0
  101. package/dist/src/path-utils.d.ts.map +1 -0
  102. package/dist/src/peer-id-registry.d.ts +35 -0
  103. package/dist/src/peer-id-registry.d.ts.map +1 -0
  104. package/dist/src/persistence-store.d.ts +27 -0
  105. package/dist/src/persistence-store.d.ts.map +1 -0
  106. package/dist/src/platform/channel-status.d.ts +3 -0
  107. package/dist/src/platform/channel-status.d.ts.map +1 -0
  108. package/dist/src/plugin-sdk-channel-actions-augment.d.ts +7 -0
  109. package/dist/src/plugin-sdk-channel-actions-augment.d.ts.map +1 -0
  110. package/dist/src/proactive-risk-registry.d.ts +22 -0
  111. package/dist/src/proactive-risk-registry.d.ts.map +1 -0
  112. package/dist/src/reply-strategy-card.d.ts +14 -0
  113. package/dist/src/reply-strategy-card.d.ts.map +1 -0
  114. package/dist/src/reply-strategy-markdown.d.ts +10 -0
  115. package/dist/src/reply-strategy-markdown.d.ts.map +1 -0
  116. package/dist/src/reply-strategy-types.d.ts +85 -0
  117. package/dist/src/reply-strategy-types.d.ts.map +1 -0
  118. package/dist/src/reply-strategy-with-reaction.d.ts +47 -0
  119. package/dist/src/reply-strategy-with-reaction.d.ts.map +1 -0
  120. package/dist/src/reply-strategy.d.ts +14 -0
  121. package/dist/src/reply-strategy.d.ts.map +1 -0
  122. package/dist/src/run-usage-store.d.ts +15 -0
  123. package/dist/src/run-usage-store.d.ts.map +1 -0
  124. package/dist/src/runtime.d.ts +4 -0
  125. package/dist/src/runtime.d.ts.map +1 -0
  126. package/dist/src/secret-input.d.ts +42 -0
  127. package/dist/src/secret-input.d.ts.map +1 -0
  128. package/dist/src/send-service.d.ts +46 -0
  129. package/dist/src/send-service.d.ts.map +1 -0
  130. package/dist/src/session-command-service.d.ts +35 -0
  131. package/dist/src/session-command-service.d.ts.map +1 -0
  132. package/dist/src/session-lock.d.ts +11 -0
  133. package/dist/src/session-lock.d.ts.map +1 -0
  134. package/dist/src/session-peer-store.d.ts +21 -0
  135. package/dist/src/session-peer-store.d.ts.map +1 -0
  136. package/dist/src/session-routing.d.ts +14 -0
  137. package/dist/src/session-routing.d.ts.map +1 -0
  138. package/dist/src/session-state.d.ts +13 -0
  139. package/dist/src/session-state.d.ts.map +1 -0
  140. package/dist/src/signature.d.ts +6 -0
  141. package/dist/src/signature.d.ts.map +1 -0
  142. package/dist/src/targeting/agent-name-matcher.d.ts +63 -0
  143. package/dist/src/targeting/agent-name-matcher.d.ts.map +1 -0
  144. package/dist/src/targeting/agent-routing.d.ts +72 -0
  145. package/dist/src/targeting/agent-routing.d.ts.map +1 -0
  146. package/dist/src/targeting/group-members-store.d.ts +3 -0
  147. package/dist/src/targeting/group-members-store.d.ts.map +1 -0
  148. package/dist/src/targeting/target-directory-adapter.d.ts +13 -0
  149. package/dist/src/targeting/target-directory-adapter.d.ts.map +1 -0
  150. package/dist/src/targeting/target-directory-store.d.ts +45 -0
  151. package/dist/src/targeting/target-directory-store.d.ts.map +1 -0
  152. package/dist/src/targeting/target-input.d.ts +3 -0
  153. package/dist/src/targeting/target-input.d.ts.map +1 -0
  154. package/dist/src/types.d.ts +730 -0
  155. package/dist/src/types.d.ts.map +1 -0
  156. package/dist/src/utils.d.ts +54 -0
  157. package/dist/src/utils.d.ts.map +1 -0
  158. package/openclaw.plugin.json +49 -5
  159. package/package.json +26 -5
  160. package/src/auth.ts +5 -2
  161. package/src/card-service.ts +41 -16
  162. package/src/channel.ts +5 -2
  163. package/src/config-schema.ts +2 -1
  164. package/src/config.ts +24 -67
  165. package/src/device-registration.ts +0 -32
  166. package/src/gateway/channel-gateway.ts +9 -8
  167. package/src/inbound-handler.ts +1239 -1061
  168. package/src/message-context-store.ts +183 -85
  169. package/src/messaging/channel-actions.ts +2 -1
  170. package/src/onboarding.ts +18 -13
  171. package/src/path-utils.ts +49 -0
  172. package/src/secret-input.ts +182 -0
  173. package/src/targeting/agent-routing.ts +30 -5
  174. package/src/types.ts +25 -10
@@ -0,0 +1,36 @@
1
+ import type { MessageRecord } from "../message-context-store";
2
+ import type { Logger, QuotedRef } from "../types";
3
+ export interface QuotedChainEntry {
4
+ depth: number;
5
+ direction: MessageRecord["direction"];
6
+ messageType: string;
7
+ sender?: string;
8
+ body: string;
9
+ createdAt: number;
10
+ }
11
+ export interface ResolvedQuotedRuntimeContext {
12
+ replyToId?: string;
13
+ replyToBody: string;
14
+ replyToSender?: string;
15
+ replyToIsQuote: true;
16
+ chain: QuotedChainEntry[];
17
+ untrustedContext?: string;
18
+ }
19
+ export interface QuotedRuntimePreview {
20
+ text?: string;
21
+ messageType?: string;
22
+ senderId?: string;
23
+ }
24
+ export declare function resolveQuotedRuntimeContext(params: {
25
+ storePath?: string;
26
+ accountId: string;
27
+ conversationId: string | null;
28
+ quotedRef?: QuotedRef;
29
+ firstRecord?: MessageRecord | null;
30
+ firstPreview?: QuotedRuntimePreview;
31
+ log?: Logger;
32
+ maxDepth?: number;
33
+ perHopBodyLimit?: number;
34
+ totalBodyLimit?: number;
35
+ }): ResolvedQuotedRuntimeContext | null;
36
+ //# sourceMappingURL=quoted-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quoted-context.d.ts","sourceRoot":"","sources":["../../../src/messaging/quoted-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAOlD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,IAAI,CAAC;IACrB,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAsHD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,4BAA4B,GAAG,IAAI,CA6GtC"}
@@ -0,0 +1,25 @@
1
+ import type { DingTalkConfig, Logger, MediaFile } from "../types";
2
+ export declare function parseDingTalkFileTime(timeStr: string): number;
3
+ export declare function getUnionIdByStaffId(config: DingTalkConfig, staffId: string, log?: Logger): Promise<string>;
4
+ export declare function getGroupFileSpaceId(config: DingTalkConfig, openConversationId: string, unionId: string, log?: Logger): Promise<string>;
5
+ interface DentryMatch {
6
+ dentryId: string;
7
+ name: string;
8
+ }
9
+ export interface ResolvedQuotedFile {
10
+ media: MediaFile;
11
+ spaceId: string;
12
+ fileId: string;
13
+ name?: string;
14
+ }
15
+ export declare function findFileByTimestamp(config: DingTalkConfig, spaceId: string, unionId: string, createdAt: number, log?: Logger): Promise<DentryMatch | null>;
16
+ export declare function downloadGroupFile(config: DingTalkConfig, spaceId: string, dentryId: string, unionId: string, log?: Logger, originalFilename?: string): Promise<MediaFile | null>;
17
+ export interface ResolveQuotedFileParams {
18
+ openConversationId: string;
19
+ senderStaffId?: string;
20
+ fileCreatedAt?: number;
21
+ }
22
+ export declare function resolveQuotedFile(config: DingTalkConfig, params: ResolveQuotedFileParams, log?: Logger): Promise<ResolvedQuotedFile | null>;
23
+ export declare function clearQuotedFileServiceCachesForTest(): void;
24
+ export {};
25
+ //# sourceMappingURL=quoted-file-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quoted-file-service.d.ts","sourceRoot":"","sources":["../../../src/messaging/quoted-file-service.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AA4ElE,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAO7D;AAID,wBAAsB,mBAAmB,CACrC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CA8BjB;AAED,wBAAsB,mBAAmB,CACrC,MAAM,EAAE,cAAc,EACtB,kBAAkB,EAAE,MAAM,EAC1B,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CAsBjB;AAED,UAAU,WAAW;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,mBAAmB,CACrC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,GAAG,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAgD7B;AAED,wBAAsB,iBAAiB,CACnC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,MAAM,EACZ,gBAAgB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAyF3B;AAID,MAAM,WAAW,uBAAuB;IACpC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAsB,iBAAiB,CACnC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,uBAAuB,EAC/B,GAAG,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CA+CpC;AAID,wBAAgB,mCAAmC,IAAI,IAAI,CAG1D"}
@@ -0,0 +1,12 @@
1
+ import { type MessageRecord } from "../message-context-store";
2
+ import type { DingTalkInboundMessage, Logger, MessageContent, QuotedRef } from "../types";
3
+ export declare function buildInboundQuotedRef(data: DingTalkInboundMessage, content: MessageContent): QuotedRef | undefined;
4
+ export declare function createReplyQuotedRef(msgId: string | undefined): QuotedRef | undefined;
5
+ export declare function resolveQuotedRecord(params: {
6
+ storePath?: string;
7
+ accountId: string;
8
+ conversationId: string | null;
9
+ quotedRef?: QuotedRef;
10
+ log?: Logger;
11
+ }): MessageRecord | null;
12
+ //# sourceMappingURL=quoted-ref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quoted-ref.d.ts","sourceRoot":"","sources":["../../../src/messaging/quoted-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAoB1F,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,sBAAsB,EAC5B,OAAO,EAAE,cAAc,GACtB,SAAS,GAAG,SAAS,CAsCvB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAUrF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,aAAa,GAAG,IAAI,CAWvB"}
@@ -0,0 +1,4 @@
1
+ import type { ChannelSetupAdapter, ChannelSetupWizard } from "openclaw/plugin-sdk/setup";
2
+ export declare const dingtalkSetupAdapter: ChannelSetupAdapter;
3
+ export declare const dingtalkSetupWizard: ChannelSetupWizard;
4
+ //# sourceMappingURL=onboarding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../src/onboarding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EAEnB,kBAAkB,EAGnB,MAAM,2BAA2B,CAAC;AAuhBnC,eAAO,MAAM,oBAAoB,EAAE,mBAUlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,kBAkDjC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function resolveRelativePath(input: string): string;
2
+ export declare const resolveUserPath: typeof resolveRelativePath;
3
+ //# sourceMappingURL=path-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../../src/path-utils.ts"],"names":[],"mappings":"AAYA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAkCzD;AAED,eAAO,MAAM,eAAe,4BAAsB,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Peer ID Registry
3
+ *
4
+ * Maps lowercased peer/session keys back to their original case-sensitive
5
+ * DingTalk conversationId values. DingTalk conversationIds are base64-encoded
6
+ * and therefore case-sensitive, but the framework may lowercase session keys
7
+ * internally. This registry preserves the original casing so outbound messages
8
+ * can be delivered correctly.
9
+ */
10
+ /**
11
+ * Register an original peer ID, keyed by its lowercased form.
12
+ */
13
+ export declare function registerPeerId(originalId: string): void;
14
+ /**
15
+ * Resolve a possibly-lowercased peer ID back to its original casing.
16
+ *
17
+ * If registry is empty at first outbound call (for example, cron/delivery queue
18
+ * fires before inbound callbacks), perform a one-time lazy preload from sessions.
19
+ *
20
+ * Returns the original if found, otherwise returns the input as-is.
21
+ */
22
+ export declare function resolveOriginalPeerId(id: string): string;
23
+ /**
24
+ * Clear the registry (for testing or shutdown).
25
+ */
26
+ export declare function clearPeerIdRegistry(): void;
27
+ /**
28
+ * Preload known peer IDs from all agents' sessions.json files.
29
+ *
30
+ * Safe to call repeatedly:
31
+ * - without explicit homeDir: runs once, then no-ops;
32
+ * - with explicit homeDir: always runs (useful for tests).
33
+ */
34
+ export declare function preloadPeerIdsFromSessions(homeDir?: string): void;
35
+ //# sourceMappingURL=peer-id-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"peer-id-registry.d.ts","sourceRoot":"","sources":["../../src/peer-id-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAKvD;AAUD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAUxD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAqEjE"}
@@ -0,0 +1,27 @@
1
+ import type { Logger } from "./types";
2
+ type NamespaceFormat = "json";
3
+ export interface PersistenceScope {
4
+ accountId?: string;
5
+ agentId?: string;
6
+ conversationId?: string;
7
+ groupId?: string;
8
+ targetId?: string;
9
+ }
10
+ export interface ResolveNamespacePathOptions {
11
+ storePath: string;
12
+ scope?: PersistenceScope;
13
+ format?: NamespaceFormat;
14
+ }
15
+ export interface ReadNamespaceJsonOptions<T> extends ResolveNamespacePathOptions {
16
+ fallback: T;
17
+ log?: Logger;
18
+ }
19
+ export interface WriteNamespaceJsonOptions<T> extends ResolveNamespacePathOptions {
20
+ data: T;
21
+ log?: Logger;
22
+ }
23
+ export declare function resolveNamespacePath(namespace: string, options: ResolveNamespacePathOptions): string;
24
+ export declare function readNamespaceJson<T>(namespace: string, options: ReadNamespaceJsonOptions<T>): T;
25
+ export declare function writeNamespaceJsonAtomic<T>(namespace: string, options: WriteNamespaceJsonOptions<T>): void;
26
+ export {};
27
+ //# sourceMappingURL=persistence-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence-store.d.ts","sourceRoot":"","sources":["../../src/persistence-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,KAAK,eAAe,GAAG,MAAM,CAAC;AAE9B,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,MAAM,WAAW,wBAAwB,CAAC,CAAC,CAAE,SAAQ,2BAA2B;IAC9E,QAAQ,EAAE,CAAC,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,yBAAyB,CAAC,CAAC,CAAE,SAAQ,2BAA2B;IAC/E,IAAI,EAAE,CAAC,CAAC;IACR,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AA6CD,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,2BAA2B,GAAG,MAAM,CAMpG;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,wBAAwB,CAAC,CAAC,CAAC,GACnC,CAAC,CAiBH;AAED,wBAAgB,wBAAwB,CAAC,CAAC,EACxC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACpC,IAAI,CAwBN"}
@@ -0,0 +1,3 @@
1
+ import type { DingTalkChannelPlugin } from "../types";
2
+ export declare function createDingTalkStatus(): NonNullable<DingTalkChannelPlugin["status"]>;
3
+ //# sourceMappingURL=channel-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel-status.d.ts","sourceRoot":"","sources":["../../../src/platform/channel-status.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAGtD,wBAAgB,oBAAoB,IAAI,WAAW,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CA4EnF"}
@@ -0,0 +1,7 @@
1
+ import type { ChannelMessageActionAdapter } from "openclaw/plugin-sdk/channel-contract";
2
+ type JsonResultReturn = NonNullable<ChannelMessageActionAdapter["handleAction"]> extends (...args: unknown[]) => Promise<infer TResult> ? TResult : never;
3
+ declare module "openclaw/plugin-sdk/channel-actions" {
4
+ function jsonResult(payload: unknown): JsonResultReturn;
5
+ }
6
+ export {};
7
+ //# sourceMappingURL=plugin-sdk-channel-actions-augment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-sdk-channel-actions-augment.d.ts","sourceRoot":"","sources":["../../src/plugin-sdk-channel-actions-augment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAExF,KAAK,gBAAgB,GAAG,WAAW,CAAC,2BAA2B,CAAC,cAAc,CAAC,CAAC,SAAS,CACvF,GAAG,IAAI,EAAE,OAAO,EAAE,KACf,OAAO,CAAC,MAAM,OAAO,CAAC,GACvB,OAAO,GACP,KAAK,CAAC;AAEV,OAAO,QAAQ,qCAAqC,CAAC;IACnD,SAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB,CAAC;CAChE"}
@@ -0,0 +1,22 @@
1
+ type ProactiveRiskLevel = "low" | "medium" | "high";
2
+ export interface ProactiveRiskObservation {
3
+ accountId: string;
4
+ targetId: string;
5
+ level: ProactiveRiskLevel;
6
+ reason: string;
7
+ source: string;
8
+ observedAtMs?: number;
9
+ }
10
+ export interface ProactiveRiskSnapshot {
11
+ level: ProactiveRiskLevel;
12
+ reason: string;
13
+ source: string;
14
+ observedAtMs: number;
15
+ }
16
+ export declare function recordProactiveRiskObservation(observation: ProactiveRiskObservation): void;
17
+ export declare function getProactiveRiskObservation(accountId: string, targetId: string, nowMs?: number): ProactiveRiskSnapshot | null;
18
+ export declare function getProactiveRiskObservationForAny(accountId: string, targetIds: Array<string | null | undefined>, nowMs?: number): ProactiveRiskSnapshot | null;
19
+ export declare function deleteProactiveRiskObservation(accountId: string, targetId: string): void;
20
+ export declare function clearProactiveRiskObservationsForTest(): void;
21
+ export {};
22
+ //# sourceMappingURL=proactive-risk-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proactive-risk-registry.d.ts","sourceRoot":"","sources":["../../src/proactive-risk-registry.ts"],"names":[],"mappings":"AAAA,KAAK,kBAAkB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEpD,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,kBAAkB,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB;AASD,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,wBAAwB,GAAG,IAAI,CAY1F;AAED,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,KAAK,SAAa,GACjB,qBAAqB,GAAG,IAAI,CAgB9B;AAED,wBAAgB,iCAAiC,CAC/C,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,EAC3C,KAAK,SAAa,GACjB,qBAAqB,GAAG,IAAI,CAW9B;AAED,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAMxF;AAED,wBAAgB,qCAAqC,IAAI,IAAI,CAE5D"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * AI Card reply strategy.
3
+ *
4
+ * Encapsulates the card draft controller lifecycle, deliver routing
5
+ * (final / tool / block), finalization, and failure fallback so that
6
+ * inbound-handler only coordinates — it no longer owns card state.
7
+ */
8
+ import type { ReplyStrategy, ReplyStrategyContext } from "./reply-strategy-types";
9
+ import type { AICardInstance } from "./types";
10
+ export declare function createCardReplyStrategy(ctx: ReplyStrategyContext & {
11
+ card: AICardInstance;
12
+ isStopRequested?: () => boolean;
13
+ }): ReplyStrategy;
14
+ //# sourceMappingURL=reply-strategy-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reply-strategy-card.d.ts","sourceRoot":"","sources":["../../src/reply-strategy-card.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmBH,OAAO,KAAK,EAAgC,aAAa,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAQhH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAc9C,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,oBAAoB,GAAG;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,OAAO,CAAA;CAAE,GACpF,aAAa,CAyvBf"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Markdown / text reply strategy.
3
+ *
4
+ * DingTalk cannot edit prior messages in place, so markdown mode emits
5
+ * incremental answer tails from dispatcher-delivered block/final payloads.
6
+ * Reasoning display is intentionally unsupported on DingTalk markdown.
7
+ */
8
+ import type { ReplyStrategy, ReplyStrategyContext } from "./reply-strategy-types";
9
+ export declare function createMarkdownReplyStrategy(ctx: ReplyStrategyContext): ReplyStrategy;
10
+ //# sourceMappingURL=reply-strategy-markdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reply-strategy-markdown.d.ts","sourceRoot":"","sources":["../../src/reply-strategy-markdown.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAgC,aAAa,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AA8ChH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,oBAAoB,GACxB,aAAa,CAuGf"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Shared type definitions for reply strategy implementations.
3
+ *
4
+ * Extracted into a leaf module so that the factory (reply-strategy.ts) and
5
+ * concrete strategies (reply-strategy-card.ts, reply-strategy-markdown.ts)
6
+ * can share these interfaces without circular imports.
7
+ */
8
+ import type { GetReplyOptions } from "openclaw/plugin-sdk/reply-runtime";
9
+ import type { DingTalkConfig, Logger, QuotedRef } from "./types";
10
+ export type InternalReplyStrategyConfig = DingTalkConfig & {
11
+ /** @deprecated Internal compatibility only. Removed from public config surface. */
12
+ cardStreamReasoning?: boolean;
13
+ };
14
+ export interface DeliverPayload {
15
+ text?: string;
16
+ mediaUrls: string[];
17
+ /**
18
+ * Shared reply-runtime voice hint. Strategies forward this unchanged into the
19
+ * channel media delivery helper; inbound-handler is responsible for bridging
20
+ * legacy aliases (for example `asVoice`) into this single field.
21
+ */
22
+ audioAsVoice?: boolean;
23
+ kind: "block" | "final" | "tool";
24
+ isReasoning?: boolean;
25
+ }
26
+ export interface ReplyOptions {
27
+ disableBlockStreaming: boolean;
28
+ onPartialReply?: (payload: {
29
+ text?: string;
30
+ }) => void | Promise<void>;
31
+ onReasoningStream?: (payload: {
32
+ text?: string;
33
+ }) => void | Promise<void>;
34
+ onAssistantMessageStart?: () => void | Promise<void>;
35
+ onAgentRunStart?: GetReplyOptions["onAgentRunStart"];
36
+ onModelSelected?: GetReplyOptions["onModelSelected"];
37
+ }
38
+ export interface ReplyStrategy {
39
+ /** Options forwarded to the runtime dispatcher. */
40
+ getReplyOptions(): ReplyOptions;
41
+ /** Called by the deliver callback for each payload chunk. */
42
+ deliver(payload: DeliverPayload): Promise<void>;
43
+ /** Called after dispatch completes successfully. */
44
+ finalize(): Promise<void>;
45
+ /** Called when dispatch throws an error. */
46
+ abort(error: Error): Promise<void>;
47
+ /** Last known final text (for external consumers such as logging). */
48
+ getFinalText(): string | undefined;
49
+ }
50
+ /** Shared context passed to every strategy implementation. */
51
+ export interface TaskMeta {
52
+ model?: string;
53
+ effort?: string;
54
+ usage?: number;
55
+ elapsedMs?: number;
56
+ agent?: string;
57
+ runIds?: Set<string>;
58
+ }
59
+ export interface ReplyStrategyContext {
60
+ config: InternalReplyStrategyConfig;
61
+ to: string;
62
+ sessionWebhook: string;
63
+ senderId: string;
64
+ isDirect: boolean;
65
+ accountId: string;
66
+ storePath: string;
67
+ disableBlockStreaming?: boolean;
68
+ sessionKey?: string;
69
+ sessionAgentId?: string;
70
+ groupId?: string;
71
+ log?: Logger;
72
+ replyQuotedRef?: QuotedRef;
73
+ /**
74
+ * Channel-level media delivery hook. The `audioAsVoice` option is the same
75
+ * shared voice semantic carried on DeliverPayload, not a second independent
76
+ * config knob.
77
+ */
78
+ deliverMedia: (urls: string[], options?: {
79
+ audioAsVoice?: boolean;
80
+ }) => Promise<void>;
81
+ isStopRequested?: () => boolean;
82
+ inboundText?: string;
83
+ taskMeta?: TaskMeta;
84
+ }
85
+ //# sourceMappingURL=reply-strategy-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reply-strategy-types.d.ts","sourceRoot":"","sources":["../../src/reply-strategy-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIjE,MAAM,MAAM,2BAA2B,GAAG,cAAc,GAAG;IACzD,mFAAmF;IACnF,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAIF,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzE,uBAAuB,CAAC,EAAE,MAAM,I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C;IACb,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtF,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Dynamic ack-reaction decorator for ReplyStrategy.
3
+ *
4
+ * When ackReaction is set to "emoji", wraps an inner strategy to switch
5
+ * the native ack-reaction emoji based on runtime tool execution events.
6
+ *
7
+ * Usage:
8
+ * let strategy = createReplyStrategy({ ... });
9
+ * if (ackReaction === "emoji" && runtimeEvents) {
10
+ * strategy = withDynamicReaction(strategy, { ... });
11
+ * }
12
+ *
13
+ * This decorator:
14
+ * - Subscribes to rt.events.onAgentEvent before dispatch
15
+ * - Maps tool_execution_start events to emoji via resolveToolReactionEmoji
16
+ * - Recalls the previous reaction and attaches the new one
17
+ * - Fires a heartbeat reaction if no tool event arrives for 55+ seconds
18
+ * - On dispose: recalls the current reaction and notifies the caller via
19
+ * onReactionDisposed so the finally block does not double-recall
20
+ * - Cleans up (unsubscribe + clear timer) on finalize/abort
21
+ *
22
+ * Important: the subscription MUST filter by runId or sessionKey to avoid
23
+ * cross-session reaction contamination when multiple messages are processed
24
+ * concurrently. The `sessionFilter` parameter is required for this reason.
25
+ */
26
+ import type { ReplyStrategy } from "./reply-strategy-types";
27
+ import type { DingTalkConfig, Logger } from "./types";
28
+ export interface DynamicReactionParams {
29
+ config: DingTalkConfig;
30
+ msgId: string;
31
+ conversationId?: string;
32
+ initialReaction: string;
33
+ /** Only process events matching this predicate (session isolation). */
34
+ sessionFilter: (event: unknown) => boolean;
35
+ onAttachReaction: (reactionName: string) => Promise<boolean>;
36
+ onRecallReaction: (reactionName: string) => Promise<void>;
37
+ subscribeAgentEvents: (listener: (event: unknown) => void) => () => void;
38
+ /**
39
+ * Called when the decorator recalls its current reaction during dispose.
40
+ * The caller should set ackReactionAttached=false so the finally block
41
+ * does not attempt to recall the same (already-removed) reaction.
42
+ */
43
+ onReactionDisposed?: () => void;
44
+ log?: Logger;
45
+ }
46
+ export declare function withDynamicReaction(inner: ReplyStrategy, params: DynamicReactionParams): ReplyStrategy;
47
+ //# sourceMappingURL=reply-strategy-with-reaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reply-strategy-with-reaction.d.ts","sourceRoot":"","sources":["../../src/reply-strategy-with-reaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAgC,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAMtD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,uEAAuE;IACvE,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IAC3C,gBAAgB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7D,gBAAgB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,oBAAoB,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;IACzE;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAgCD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,qBAAqB,GAC5B,aAAa,CAwGf"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Reply strategy factory for DingTalk message delivery.
3
+ *
4
+ * Delegates the "how to deliver a reply" concern to card or markdown
5
+ * strategy implementations. Type definitions live in reply-strategy-types.ts.
6
+ */
7
+ import type { AICardInstance } from "./types";
8
+ import type { ReplyStrategy, ReplyStrategyContext } from "./reply-strategy-types";
9
+ export type { DeliverPayload, ReplyOptions, ReplyStrategy, ReplyStrategyContext, TaskMeta, } from "./reply-strategy-types";
10
+ export declare function createReplyStrategy(params: ReplyStrategyContext & {
11
+ card: AICardInstance | undefined;
12
+ useCardMode: boolean;
13
+ }): ReplyStrategy;
14
+ //# sourceMappingURL=reply-strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reply-strategy.d.ts","sourceRoot":"","sources":["../../src/reply-strategy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAMlF,YAAY,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAIhC,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,oBAAoB,GAAG;IAC7B,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC;IACjC,WAAW,EAAE,OAAO,CAAC;CACtB,GACA,aAAa,CAKf"}
@@ -0,0 +1,15 @@
1
+ export interface UsageAccumulation {
2
+ input?: number;
3
+ output?: number;
4
+ cacheRead?: number;
5
+ cacheWrite?: number;
6
+ total?: number;
7
+ }
8
+ export declare function recordRunStart(runId: string): void;
9
+ export declare function accumulateUsage(runId: string, usage: UsageAccumulation): void;
10
+ export declare function getUsageByRunId(runId: string): UsageAccumulation | undefined;
11
+ export declare function getAggregatedUsage(runIds: Set<string> | undefined): UsageAccumulation;
12
+ export declare function clearRun(runId: string | undefined): void;
13
+ export declare function clearRuns(runIds: Set<string> | undefined): void;
14
+ export declare function clearAllForTest(): void;
15
+ //# sourceMappingURL=run-usage-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-usage-store.d.ts","sourceRoot":"","sources":["../../src/run-usage-store.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAIlD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAU7E;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAE5E;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,iBAAiB,CAarF;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAExD;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,IAAI,CAG/D;AAED,wBAAgB,eAAe,IAAI,IAAI,CAEtC"}
@@ -0,0 +1,4 @@
1
+ import type { PluginRuntime } from "openclaw/plugin-sdk/core";
2
+ export declare function setDingTalkRuntime(next: PluginRuntime): void;
3
+ export declare function getDingTalkRuntime(): PluginRuntime;
4
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAK9D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,CAE5D;AAED,wBAAgB,kBAAkB,IAAI,aAAa,CAElD"}
@@ -0,0 +1,42 @@
1
+ import { z } from "zod";
2
+ export type SecretInputRef = {
3
+ source: "env" | "file";
4
+ provider: string;
5
+ id: string;
6
+ };
7
+ export type SecretInput = string | SecretInputRef;
8
+ export type SecretInputResolutionFailure = {
9
+ source: SecretInputRef["source"];
10
+ provider: string;
11
+ id: string;
12
+ reason: string;
13
+ };
14
+ type SecretInputLog = {
15
+ warn?: (message: string, data?: unknown) => void;
16
+ };
17
+ export declare function formatSecretInputResolutionFailure(failure: SecretInputResolutionFailure): string;
18
+ export declare function buildSecretInputSchema(): z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
19
+ source: z.ZodEnum<{
20
+ env: "env";
21
+ file: "file";
22
+ }>;
23
+ provider: z.ZodString;
24
+ id: z.ZodString;
25
+ }, z.core.$strip>]>;
26
+ export declare function isSecretInputRef(value: unknown): value is SecretInputRef;
27
+ export declare function hasConfiguredSecretInput(value: unknown): boolean;
28
+ export declare function normalizeSecretInputString(value: unknown): string | undefined;
29
+ export declare function parseSecretInputString(value: unknown): SecretInput | undefined;
30
+ export declare function resolveSecretInputString(value: unknown, log?: SecretInputLog): Promise<string | undefined>;
31
+ export declare function resolveSecretInputStringWithFailure(value: unknown, log?: SecretInputLog): Promise<{
32
+ value?: string;
33
+ failure?: SecretInputResolutionFailure;
34
+ }>;
35
+ export declare function resolveDingTalkSecretConfig<T extends {
36
+ clientSecret?: unknown;
37
+ }>(config: T, log?: SecretInputLog): Promise<T & {
38
+ clientSecret?: string;
39
+ clientSecretResolutionFailure?: SecretInputResolutionFailure;
40
+ }>;
41
+ export {};
42
+ //# sourceMappingURL=secret-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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AAO,CAAC;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,4BAA4B,CAAA;CAAE,CAAC,CA0CrE;AAED,wBAAsB,2BAA2B,CAAC,CAAC,SAAS;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,EACpF,MAAM,EAAE,CAAC,EACT,GAAG,CAAC,EAAE,cAAc,GACnB,OAAO,CACR,CAAC,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,6BAA6B,CAAC,EAAE,4BAA4B,CAAA;CAAE,CAC5F,CAOA"}
@@ -0,0 +1,46 @@
1
+ import type { UploadMediaResult } from "./media-utils";
2
+ import type { AICardInstance, AxiosResponse, DingTalkConfig, DingTalkTrackingMetadata, Logger, SendMessageOptions } from "./types";
3
+ export { detectMediaTypeFromExtension } from "./media-utils";
4
+ type ProactiveTextSendResult = AxiosResponse | {
5
+ tracking: DingTalkTrackingMetadata;
6
+ };
7
+ /**
8
+ * Wrapper to upload media with shared getAccessToken binding.
9
+ */
10
+ export declare function uploadMedia(config: DingTalkConfig, mediaPath: string, mediaType: "image" | "voice" | "video" | "file", log?: Logger, options?: {
11
+ mediaLocalRoots?: string[];
12
+ }): Promise<UploadMediaResult | null>;
13
+ export declare function sendProactiveTextOrMarkdown(config: DingTalkConfig, target: string, text: string, options?: SendMessageOptions): Promise<ProactiveTextSendResult>;
14
+ export declare function sendProactiveMedia(config: DingTalkConfig, target: string, mediaPath: string, mediaType: "image" | "voice" | "video" | "file", options?: SendMessageOptions & {
15
+ accountId?: string;
16
+ }): Promise<{
17
+ ok: boolean;
18
+ error?: string;
19
+ data?: any;
20
+ messageId?: string;
21
+ mediaId?: string;
22
+ }>;
23
+ export declare function sendMedia(config: DingTalkConfig, target: string, mediaInput: string, options?: SendMessageOptions & {
24
+ mediaType?: "image" | "voice" | "video" | "file";
25
+ audioAsVoice?: boolean;
26
+ expectedCardOwnerId?: string;
27
+ }): Promise<{
28
+ ok: boolean;
29
+ error?: string;
30
+ data?: any;
31
+ messageId?: string;
32
+ mediaId?: string;
33
+ }>;
34
+ export declare function sendBySession(config: DingTalkConfig, sessionWebhook: string, text: string, options?: SendMessageOptions): Promise<AxiosResponse>;
35
+ export declare function sendMessage(config: DingTalkConfig, conversationId: string, text: string, options?: SendMessageOptions & {
36
+ sessionWebhook?: string;
37
+ card?: AICardInstance;
38
+ accountId?: string;
39
+ }): Promise<{
40
+ ok: boolean;
41
+ error?: string;
42
+ data?: AxiosResponse;
43
+ messageId?: string;
44
+ tracking?: DingTalkTrackingMetadata;
45
+ }>;
46
+ //# sourceMappingURL=send-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-service.d.ts","sourceRoot":"","sources":["../../src/send-service.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,MAAM,EAGN,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAiD7D,KAAK,uBAAuB,GAAG,aAAa,GAAG;IAAE,QAAQ,EAAE,wBAAwB,CAAA;CAAE,CAAC;AAiPtF;;GAEG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,EAC/C,GAAG,CAAC,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GACvC,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAEnC;AAED,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAA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B,GAAG;IAAE,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,cAAc,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GACxG,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,aAAa,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,wBAAwB,CAAA;CAAE,CAAC,CAsGzH"}
@@ -0,0 +1,35 @@
1
+ export interface ParsedSessionCommand {
2
+ scope: "session-alias-show" | "session-alias-set" | "session-alias-clear" | "session-alias-bind" | "session-alias-unbind" | "unknown";
3
+ peerId?: string;
4
+ sourceKind?: "direct" | "group";
5
+ sourceId?: string;
6
+ }
7
+ export declare function parseSessionCommand(text: string | undefined): ParsedSessionCommand;
8
+ export declare function validateSessionAlias(peerId: string | undefined): string | null;
9
+ export declare function formatSessionAliasReply(params: {
10
+ sourceKind: "direct" | "group";
11
+ sourceId: string;
12
+ peerId: string;
13
+ aliasSource: "default" | "override";
14
+ }): string;
15
+ export declare function formatSessionAliasSetReply(params: {
16
+ sourceKind: "direct" | "group";
17
+ sourceId: string;
18
+ peerId: string;
19
+ }): string;
20
+ export declare function formatSessionAliasValidationErrorReply(error: string): string;
21
+ export declare function formatSessionAliasClearedReply(params: {
22
+ sourceKind: "direct" | "group";
23
+ sourceId: string;
24
+ }): string;
25
+ export declare function formatSessionAliasBoundReply(params: {
26
+ sourceKind: "direct" | "group";
27
+ sourceId: string;
28
+ peerId: string;
29
+ }): string;
30
+ export declare function formatSessionAliasUnboundReply(params: {
31
+ sourceKind: "direct" | "group";
32
+ sourceId: string;
33
+ existed: boolean;
34
+ }): string;
35
+ //# sourceMappingURL=session-command-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-command-service.d.ts","sourceRoot":"","sources":["../../src/session-command-service.ts"],"names":[],"m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AU,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,MAAM,CAOT"}
@@ -0,0 +1,11 @@
1
+ export declare const SESSION_LOCK_NAMESPACE_POLICY: "memory-only";
2
+ /**
3
+ * Acquire a per-session lock. Returns a release function that MUST be called
4
+ * (typically in a `finally` block) to unblock the next queued caller.
5
+ *
6
+ * Different session keys run in parallel; same key runs serially.
7
+ */
8
+ export declare function acquireSessionLock(sessionKey: string): Promise<() => void>;
9
+ /** Visible for testing only. */
10
+ export declare function _getLocksMapForTest(): Map<string, Promise<void>>;
11
+ //# sourceMappingURL=session-lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-lock.d.ts","sourceRoot":"","sources":["../../src/session-lock.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,6BAA6B,EAAG,aAAsB,CAAC;AAEpE;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAchF;AAED,gCAAgC;AAChC,wBAAgB,mBAAmB,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAEhE"}