@soimy/dingtalk 3.6.10 → 3.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/dist/index.d.ts +1 -1
- package/dist/index.js +11655 -10324
- package/dist/src/{ack-reaction-service.d.ts → ack-reaction/ack-reaction-service.d.ts} +1 -1
- package/dist/src/ack-reaction/dynamic-ack-reaction-controller.d.ts +3 -3
- package/dist/src/card/ask-user-question-context.d.ts +1 -1
- package/dist/src/card/ask-user-question-store.d.ts +1 -1
- package/dist/src/card/ask-user-question.d.ts +1 -1
- package/dist/src/card/card-action-handler.d.ts +2 -2
- package/dist/src/{card-draft-controller.d.ts → card/card-draft-controller.d.ts} +5 -1
- package/dist/src/card/card-run-registry.d.ts +2 -2
- package/dist/src/{card-service.d.ts → card/card-service.d.ts} +1 -1
- package/dist/src/card/card-stop-handler.d.ts +1 -1
- package/dist/src/card/card-streaming-mode.d.ts +1 -1
- package/dist/src/card/card-task-progress.d.ts +60 -0
- package/dist/src/channel.d.ts +6 -6
- package/dist/src/command/card-stop-command.d.ts +1 -1
- package/dist/src/{feedback-learning-service.d.ts → command/feedback-learning-service.d.ts} +1 -1
- package/dist/src/command/inbound-command-dispatch-service.d.ts +2 -2
- package/dist/src/{learning-command-service.d.ts → command/learning-command-service.d.ts} +1 -1
- package/dist/src/gateway/channel-gateway.d.ts +1 -1
- package/dist/src/{connection-manager.d.ts → gateway/connection-manager.d.ts} +1 -1
- package/dist/src/{docs-service.d.ts → gateway/docs-service.d.ts} +5 -5
- package/dist/src/{inbound-handler.d.ts → gateway/inbound-handler.d.ts} +1 -1
- package/dist/src/gateway/inbound-session-queue-dispatcher.d.ts +1 -1
- package/dist/src/messaging/attachment-text-extractor.d.ts +1 -1
- package/dist/src/messaging/btw-deliver.d.ts +1 -1
- package/dist/src/messaging/channel-outbound.d.ts +1 -1
- package/dist/src/messaging/inline-directives.d.ts +42 -0
- package/dist/src/{media-utils.d.ts → messaging/media-utils.d.ts} +1 -1
- package/dist/src/{message-context-store.d.ts → messaging/message-context-store.d.ts} +7 -1
- package/dist/src/{message-utils.d.ts → messaging/message-utils.d.ts} +1 -1
- package/dist/src/messaging/quoted-context.d.ts +2 -2
- package/dist/src/messaging/quoted-file-service.d.ts +1 -1
- package/dist/src/messaging/quoted-ref.d.ts +2 -2
- package/dist/src/{reply-strategy-card.d.ts → messaging/reply-strategy-card.d.ts} +1 -1
- package/dist/src/{reply-strategy-types.d.ts → messaging/reply-strategy-types.d.ts} +10 -1
- package/dist/src/{reply-strategy-with-reaction.d.ts → messaging/reply-strategy-with-reaction.d.ts} +1 -1
- package/dist/src/{reply-strategy.d.ts → messaging/reply-strategy.d.ts} +1 -1
- package/dist/src/{send-service.d.ts → messaging/send-service.d.ts} +1 -1
- package/dist/src/platform/channel-status.d.ts +1 -1
- package/dist/src/platform/config.d.ts +110 -0
- package/dist/src/platform/runtime-events.d.ts +67 -0
- package/dist/src/{types.d.ts → platform/types.d.ts} +75 -2
- package/dist/src/{persistence-store.d.ts → shared/persistence-store.d.ts} +1 -1
- package/dist/src/{utils.d.ts → shared/utils.d.ts} +1 -1
- package/dist/src/targeting/agent-name-matcher.d.ts +1 -1
- package/dist/src/targeting/agent-routing.d.ts +3 -3
- package/dist/src/{session-routing.d.ts → targeting/session-routing.d.ts} +1 -1
- package/index.ts +193 -69
- package/openclaw.plugin.json +158 -2
- package/package.json +16 -16
- package/src/{ack-reaction-classifier.ts → ack-reaction/ack-reaction-classifier.ts} +85 -13
- package/src/{ack-reaction-service.ts → ack-reaction/ack-reaction-service.ts} +13 -7
- package/src/ack-reaction/dynamic-ack-reaction-controller.ts +46 -31
- package/src/ack-reaction/dynamic-ack-reaction-progress.ts +4 -1
- package/src/card/ask-user-question-context.ts +1 -1
- package/src/card/ask-user-question-store.ts +2 -2
- package/src/card/ask-user-question.ts +11 -7
- package/src/card/card-action-handler.ts +2 -2
- package/src/{card-callback-service.ts → card/card-callback-service.ts} +7 -9
- package/src/card/card-draft-controller.ts +770 -0
- package/src/card/card-markdown-image-reroute.ts +8 -2
- package/src/card/card-run-registry.ts +17 -7
- package/src/{card-service.ts → card/card-service.ts} +91 -61
- package/src/card/card-stop-handler.ts +12 -8
- package/src/card/card-streaming-mode.ts +1 -1
- package/src/card/card-task-progress.ts +330 -0
- package/src/card/draft-stream-loop.ts +119 -0
- package/src/card/reasoning-answer-split.ts +125 -121
- package/src/card/reasoning-block-assembler.ts +122 -123
- package/src/{run-usage-store.ts → card/run-usage-store.ts} +18 -6
- package/src/card/statusline-renderer.ts +14 -5
- package/src/card/task-model-metadata.ts +8 -3
- package/src/channel.ts +14 -16
- package/src/command/card-stop-command.ts +2 -2
- package/src/{feedback-learning-service.ts → command/feedback-learning-service.ts} +36 -16
- package/src/{feedback-learning-store.ts → command/feedback-learning-store.ts} +133 -81
- package/src/command/inbound-command-dispatch-service.ts +12 -6
- package/src/{learning-command-service.ts → command/learning-command-service.ts} +36 -29
- package/src/{session-command-service.ts → command/session-command-service.ts} +3 -1
- package/src/gateway/channel-gateway.ts +106 -28
- package/src/{connection-manager.ts → gateway/connection-manager.ts} +45 -30
- package/src/{docs-service.ts → gateway/docs-service.ts} +5 -5
- package/src/{inbound-handler.ts → gateway/inbound-handler.ts} +144 -85
- package/src/gateway/inbound-session-queue-dispatcher.ts +18 -14
- package/src/{session-lock.ts → gateway/session-lock.ts} +14 -14
- package/src/messaging/attachment-text-extractor.ts +21 -7
- package/src/messaging/btw-deliver.ts +2 -2
- package/src/messaging/channel-actions.ts +15 -7
- package/src/messaging/channel-outbound.ts +16 -11
- package/src/messaging/inline-directives.ts +342 -0
- package/src/{media-utils.ts → messaging/media-utils.ts} +276 -72
- package/src/{message-context-store.ts → messaging/message-context-store.ts} +11 -2
- package/src/{message-utils.ts → messaging/message-utils.ts} +46 -11
- package/src/messaging/quoted-context.ts +2 -2
- package/src/messaging/quoted-file-service.ts +311 -294
- package/src/messaging/quoted-ref.ts +11 -7
- package/src/{reply-strategy-card.ts → messaging/reply-strategy-card.ts} +178 -101
- package/src/{reply-strategy-markdown.ts → messaging/reply-strategy-markdown.ts} +8 -2
- package/src/{reply-strategy-types.ts → messaging/reply-strategy-types.ts} +11 -1
- package/src/{reply-strategy-with-reaction.ts → messaging/reply-strategy-with-reaction.ts} +6 -1
- package/src/{reply-strategy.ts → messaging/reply-strategy.ts} +2 -2
- package/src/{send-service.ts → messaging/send-service.ts} +100 -65
- package/src/{auth.ts → platform/auth.ts} +2 -2
- package/src/platform/channel-status.ts +3 -3
- package/src/{config-schema.ts → platform/config-schema.ts} +81 -4
- package/src/{config.ts → platform/config.ts} +167 -19
- package/src/{device-registration.ts → platform/device-registration.ts} +5 -4
- package/src/{onboarding.ts → platform/onboarding.ts} +1 -4
- package/src/{plugin-sdk-channel-actions-augment.ts → platform/plugin-sdk-channel-actions-augment.ts} +6 -5
- package/src/platform/runtime-events.ts +202 -0
- package/src/{secret-input.ts → platform/secret-input.ts} +117 -11
- package/src/{types.ts → platform/types.ts} +77 -2
- package/src/{http-client.ts → shared/http-client.ts} +1 -3
- package/src/{persistence-store.ts → shared/persistence-store.ts} +6 -6
- package/src/{utils.ts → shared/utils.ts} +30 -13
- package/src/targeting/agent-name-matcher.ts +1 -1
- package/src/targeting/agent-routing.ts +7 -7
- package/src/targeting/group-members-store.ts +1 -1
- package/src/{session-peer-store.ts → targeting/session-peer-store.ts} +9 -4
- package/src/{session-routing.ts → targeting/session-routing.ts} +1 -1
- package/src/targeting/target-directory-adapter.ts +3 -3
- package/src/targeting/target-directory-store.ts +1 -1
- package/src/targeting/target-input.ts +1 -1
- package/dist/src/ack-reaction/dynamic-ack-reaction-events.d.ts +0 -35
- package/dist/src/config.d.ts +0 -59
- package/src/ack-reaction/dynamic-ack-reaction-events.ts +0 -123
- package/src/card-draft-controller.ts +0 -637
- package/src/draft-stream-loop.ts +0 -119
- /package/dist/src/{ack-reaction-classifier.d.ts → ack-reaction/ack-reaction-classifier.d.ts} +0 -0
- /package/dist/src/{card-callback-service.d.ts → card/card-callback-service.d.ts} +0 -0
- /package/dist/src/{draft-stream-loop.d.ts → card/draft-stream-loop.d.ts} +0 -0
- /package/dist/src/{run-usage-store.d.ts → card/run-usage-store.d.ts} +0 -0
- /package/dist/src/{feedback-learning-store.d.ts → command/feedback-learning-store.d.ts} +0 -0
- /package/dist/src/{session-command-service.d.ts → command/session-command-service.d.ts} +0 -0
- /package/dist/src/{session-lock.d.ts → gateway/session-lock.d.ts} +0 -0
- /package/dist/src/{proactive-risk-registry.d.ts → messaging/proactive-risk-registry.d.ts} +0 -0
- /package/dist/src/{reply-strategy-markdown.d.ts → messaging/reply-strategy-markdown.d.ts} +0 -0
- /package/dist/src/{access-control.d.ts → platform/access-control.d.ts} +0 -0
- /package/dist/src/{auth.d.ts → platform/auth.d.ts} +0 -0
- /package/dist/src/{config-schema.d.ts → platform/config-schema.d.ts} +0 -0
- /package/dist/src/{device-registration.d.ts → platform/device-registration.d.ts} +0 -0
- /package/dist/src/{logger-context.d.ts → platform/logger-context.d.ts} +0 -0
- /package/dist/src/{onboarding.d.ts → platform/onboarding.d.ts} +0 -0
- /package/dist/src/{plugin-sdk-channel-actions-augment.d.ts → platform/plugin-sdk-channel-actions-augment.d.ts} +0 -0
- /package/dist/src/{runtime.d.ts → platform/runtime.d.ts} +0 -0
- /package/dist/src/{secret-input.d.ts → platform/secret-input.d.ts} +0 -0
- /package/dist/src/{session-state.d.ts → platform/session-state.d.ts} +0 -0
- /package/dist/src/{signature.d.ts → platform/signature.d.ts} +0 -0
- /package/dist/src/{dedup.d.ts → shared/dedup.d.ts} +0 -0
- /package/dist/src/{http-client.d.ts → shared/http-client.d.ts} +0 -0
- /package/dist/src/{path-utils.d.ts → shared/path-utils.d.ts} +0 -0
- /package/dist/src/{peer-id-registry.d.ts → targeting/peer-id-registry.d.ts} +0 -0
- /package/dist/src/{session-peer-store.d.ts → targeting/session-peer-store.d.ts} +0 -0
- /package/src/{proactive-risk-registry.ts → messaging/proactive-risk-registry.ts} +0 -0
- /package/src/{access-control.ts → platform/access-control.ts} +0 -0
- /package/src/{logger-context.ts → platform/logger-context.ts} +0 -0
- /package/src/{runtime.ts → platform/runtime.ts} +0 -0
- /package/src/{session-state.ts → platform/session-state.ts} +0 -0
- /package/src/{signature.ts → platform/signature.ts} +0 -0
- /package/src/{dedup.ts → shared/dedup.ts} +0 -0
- /package/src/{path-utils.ts → shared/path-utils.ts} +0 -0
- /package/src/{peer-id-registry.ts → targeting/peer-id-registry.ts} +0 -0
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
MessageContent,
|
|
5
5
|
QuotedInfo,
|
|
6
6
|
SendMessageOptions,
|
|
7
|
-
} from "
|
|
7
|
+
} from "../platform/types";
|
|
8
8
|
|
|
9
9
|
interface DingTalkDocMeta {
|
|
10
10
|
spaceId: string;
|
|
@@ -106,6 +106,35 @@ function extractRichTextQuoteParts(
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
function extractCardContentText(cardContent: unknown): string | undefined {
|
|
110
|
+
if (!Array.isArray(cardContent)) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
const collected: string[] = [];
|
|
114
|
+
const walk = (nodes: unknown): void => {
|
|
115
|
+
if (!Array.isArray(nodes)) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
for (const node of nodes) {
|
|
119
|
+
if (node === null || typeof node !== "object" || Array.isArray(node)) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
const element = node as { elementType?: unknown; value?: unknown; children?: unknown };
|
|
123
|
+
if (element.elementType === "TEXT" && typeof element.value === "string") {
|
|
124
|
+
collected.push(element.value);
|
|
125
|
+
}
|
|
126
|
+
walk(element.children);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
walk(cardContent);
|
|
130
|
+
const text = collected
|
|
131
|
+
.map((segment) => segment.trim())
|
|
132
|
+
.filter(Boolean)
|
|
133
|
+
.join("\n")
|
|
134
|
+
.trim();
|
|
135
|
+
return text.length > 0 ? text : undefined;
|
|
136
|
+
}
|
|
137
|
+
|
|
109
138
|
function extractAtMentionsFromText(text: string): AtMention[] {
|
|
110
139
|
const mentions: AtMention[] = [];
|
|
111
140
|
const matches = text.matchAll(/(?<!\w)@([^\s@.]+)(?!\.\w)/g);
|
|
@@ -321,7 +350,9 @@ function buildRepliedMessagePreview(params: {
|
|
|
321
350
|
cardCreatedAt: repliedMsg.createdAt,
|
|
322
351
|
processQueryKey: trimString(data.originalProcessQueryKey),
|
|
323
352
|
previewText:
|
|
324
|
-
trimString(content?.text) ||
|
|
353
|
+
trimString(content?.text) ||
|
|
354
|
+
extractCardContentText(content?.cardContent) ||
|
|
355
|
+
buildQuotedMessageTypePlaceholder("interactiveCard"),
|
|
325
356
|
previewMessageType: "interactiveCard",
|
|
326
357
|
previewSenderId: trimString(repliedMsg.senderId),
|
|
327
358
|
};
|
|
@@ -332,6 +363,7 @@ function buildRepliedMessagePreview(params: {
|
|
|
332
363
|
fileCreatedAt: repliedMsg.createdAt,
|
|
333
364
|
previewText:
|
|
334
365
|
trimString(content?.text) ||
|
|
366
|
+
extractCardContentText(content?.cardContent) ||
|
|
335
367
|
buildQuotedMessageTypePlaceholder(docMeta ? "interactiveCardFile" : "interactiveCard"),
|
|
336
368
|
previewMessageType: docMeta ? "interactiveCardFile" : "interactiveCard",
|
|
337
369
|
previewSenderId: trimString(repliedMsg.senderId),
|
|
@@ -351,6 +383,7 @@ function buildRepliedMessagePreview(params: {
|
|
|
351
383
|
|
|
352
384
|
const textPreview =
|
|
353
385
|
trimString(content?.text) ||
|
|
386
|
+
trimString(content?.content) ||
|
|
354
387
|
trimString(richTextQuote?.summary) ||
|
|
355
388
|
buildQuotedMessageTypePlaceholder(repliedMsgType, fileName);
|
|
356
389
|
|
|
@@ -459,7 +492,11 @@ function buildSeparatorRow(alignments: ("left" | "center" | "right")[]): string
|
|
|
459
492
|
* Render markdown table rows preserving original alignment.
|
|
460
493
|
* Extracts alignment from the separator row and applies it to output.
|
|
461
494
|
*/
|
|
462
|
-
function renderMarkdownTable(
|
|
495
|
+
function renderMarkdownTable(
|
|
496
|
+
headerLine: string,
|
|
497
|
+
separatorLine: string,
|
|
498
|
+
dataLines: string[],
|
|
499
|
+
): string {
|
|
463
500
|
const headerCells = parseMarkdownTableRow(headerLine);
|
|
464
501
|
const separatorCells = parseMarkdownTableRow(separatorLine);
|
|
465
502
|
const dataRows = dataLines.map(parseMarkdownTableRow).filter((cells) => cells.length > 0);
|
|
@@ -484,13 +521,11 @@ function renderMarkdownTable(headerLine: string, separatorLine: string, dataLine
|
|
|
484
521
|
const separator = buildSeparatorRow(alignments);
|
|
485
522
|
|
|
486
523
|
const allRows = [headerCells, ...dataRows];
|
|
487
|
-
const rendered = allRows
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
return "|" + padded.join("|") + "|";
|
|
493
|
-
});
|
|
524
|
+
const rendered = allRows.map((cells) => {
|
|
525
|
+
const padded =
|
|
526
|
+
cells.length < colCount ? [...cells, ...Array(colCount - cells.length).fill("")] : cells;
|
|
527
|
+
return "|" + padded.join("|") + "|";
|
|
528
|
+
});
|
|
494
529
|
|
|
495
530
|
// Insert separator after header row (works for header-only tables too)
|
|
496
531
|
rendered.splice(1, 0, separator);
|
|
@@ -636,7 +671,7 @@ export function extractMessageContent(data: DingTalkInboundMessage): MessageCont
|
|
|
636
671
|
}
|
|
637
672
|
|
|
638
673
|
// No msgType — backward compat: extract text or richText from content.
|
|
639
|
-
if (content?.text?.
|
|
674
|
+
if (trimString(content?.text) || trimString(content?.content)) {
|
|
640
675
|
return repliedMsgId ? { msgId: repliedMsgId, ...repliedPreview } : null;
|
|
641
676
|
}
|
|
642
677
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { Logger, QuotedRef } from "../platform/types";
|
|
2
|
+
import type { MessageRecord } from "./message-context-store";
|
|
3
3
|
import { resolveQuotedRecord } from "./quoted-ref";
|
|
4
4
|
|
|
5
5
|
const DEFAULT_MAX_DEPTH = 3;
|