@qwen-code/channel-dingtalk 0.22.0 → 0.22.2-nightly.20260828.7357136dd1
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/DingtalkAdapter.d.ts +46 -3
- package/dist/DingtalkAdapter.d.ts.map +1 -1
- package/dist/DingtalkAdapter.js +648 -78
- package/dist/DingtalkAdapter.js.map +1 -1
- package/dist/outbound-file.d.ts +33 -0
- package/dist/outbound-file.d.ts.map +1 -0
- package/dist/outbound-file.js +109 -0
- package/dist/outbound-file.js.map +1 -0
- package/package.json +2 -2
|
@@ -36,6 +36,9 @@ export declare class DingtalkChannel extends ChannelBase {
|
|
|
36
36
|
private readonly inboundCardOwners;
|
|
37
37
|
private readonly cardRunBySession;
|
|
38
38
|
private readonly cardRuns;
|
|
39
|
+
private readonly fileProjectors;
|
|
40
|
+
private readonly blockFileProjectors;
|
|
41
|
+
private readonly blockProjectionArmed;
|
|
39
42
|
constructor(name: string, config: ChannelConfig, bridge: ChannelAgentBridge, options?: ChannelBaseOptions);
|
|
40
43
|
private createClient;
|
|
41
44
|
private installStructuredDownstreamHandler;
|
|
@@ -52,6 +55,7 @@ export declare class DingtalkChannel extends ChannelBase {
|
|
|
52
55
|
* dropped on ingestion. Exposed for testing the drop rule.
|
|
53
56
|
*/
|
|
54
57
|
static isUnroutableGroupMessage(isGroup: boolean, conversationId: string | undefined): boolean;
|
|
58
|
+
private projectOutgoingFileText;
|
|
55
59
|
private prepareOutgoingText;
|
|
56
60
|
private sendReply;
|
|
57
61
|
sendMessage(chatId: string, text: string): Promise<void>;
|
|
@@ -90,11 +94,31 @@ export declare class DingtalkChannel extends ChannelBase {
|
|
|
90
94
|
protected processInbound(envelope: Envelope): Promise<void>;
|
|
91
95
|
private untrackBufferedMentionTarget;
|
|
92
96
|
protected onPromptEnd(chatId: string, sessionId: string, messageId?: string): void;
|
|
97
|
+
/**
|
|
98
|
+
* Turn end is the only point where the block projector's held state can be
|
|
99
|
+
* settled: ChannelBase drains the turn's queued block sends before calling
|
|
100
|
+
* onPromptEnd, so everything already appended belongs to this turn. Flush
|
|
101
|
+
* the held candidate bytes (a trailing `[FILE:` prefix the stream never
|
|
102
|
+
* completed) before deleting the entry — a later delete-without-settle
|
|
103
|
+
* would silently drop them from the delivered answer. Also disarm the
|
|
104
|
+
* session: /clear eviction and session death settle WITHOUT draining the
|
|
105
|
+
* turn's send chain, and any block that lands afterwards must be dropped
|
|
106
|
+
* rather than recreating projector state.
|
|
107
|
+
*/
|
|
108
|
+
private settleBlockFileProjector;
|
|
109
|
+
/**
|
|
110
|
+
* Out-of-turn one-shot sends (background responses) must not flow through
|
|
111
|
+
* the session's block-streaming projector: a second sender interleaving with
|
|
112
|
+
* mid-projection state can swallow the send or split a held marker.
|
|
113
|
+
*/
|
|
114
|
+
protected deliverBackgroundReply(chatId: string, text: string, sessionId: string): Promise<void>;
|
|
93
115
|
protected sendResponseMessage(chatId: string, text: string, sessionId: string): Promise<void>;
|
|
116
|
+
private projectBlockStreamChunk;
|
|
94
117
|
private sendFallbackReply;
|
|
95
118
|
protected onResponseComplete(chatId: string, text: string, sessionId: string, segment?: ChannelOutputSegmentContext): Promise<void>;
|
|
96
119
|
protected onOutputSegmentEnd(_chatId: string, _sessionId: string, segment: ChannelOutputSegmentContext, reason: ChannelOutputSegmentEndReason): void | Promise<void>;
|
|
97
120
|
protected onResponseChunk(_chatId: string, chunk: string, _sessionId: string, segment?: ChannelOutputSegmentContext): void;
|
|
121
|
+
private deleteFileProjectorsForRun;
|
|
98
122
|
protected presentUserInputRequest(context: ChannelUserInputRequestContext): Promise<UserInputPresentationResult>;
|
|
99
123
|
/**
|
|
100
124
|
* Extract quoted/referenced message context from a reply.
|
|
@@ -102,8 +126,26 @@ export declare class DingtalkChannel extends ChannelBase {
|
|
|
102
126
|
*/
|
|
103
127
|
private extractQuotedContext;
|
|
104
128
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
129
|
+
* Warn once when a chat-record payload yields nothing to show the model.
|
|
130
|
+
* Both chat-record paths degrade silently otherwise — `parseJsonArray`
|
|
131
|
+
* swallows JSON errors, the top-level path falls back to `(chat record)`
|
|
132
|
+
* and the replied path to an empty quote — matching this file's convention
|
|
133
|
+
* of logging degraded paths (`onDownStream`, `onMessage`).
|
|
134
|
+
*/
|
|
135
|
+
private warnEmptyChatRecord;
|
|
136
|
+
/**
|
|
137
|
+
* The partial degradation the empty-record warning cannot see: a title or
|
|
138
|
+
* summary rendered, so the result is non-empty, but the entries key that
|
|
139
|
+
* arrived produced no lines at all (an object encoding such as
|
|
140
|
+
* `{"list":[...]}`, a non-array, or a present-but-unusable first alias).
|
|
141
|
+
* Every forwarded message is dropped and the user reports only that "the bot
|
|
142
|
+
* cannot see forwarded messages"; without this line nothing in the log
|
|
143
|
+
* distinguishes that from model behaviour.
|
|
144
|
+
*/
|
|
145
|
+
private warnUnreadableChatRecordEntries;
|
|
146
|
+
/**
|
|
147
|
+
* Build a text summary from a repliedMsg, handling text, richText, chat
|
|
148
|
+
* records, and media message types with placeholders.
|
|
107
149
|
*/
|
|
108
150
|
private summarizeRepliedContent;
|
|
109
151
|
/**
|
|
@@ -114,7 +156,8 @@ export declare class DingtalkChannel extends ChannelBase {
|
|
|
114
156
|
private mediaTypeFromMsgType;
|
|
115
157
|
/**
|
|
116
158
|
* Extract text and media download codes from an incoming DingTalk message.
|
|
117
|
-
* Handles text, richText, picture, file, audio, and video
|
|
159
|
+
* Handles text, richText, chat records, picture, file, audio, and video
|
|
160
|
+
* message types.
|
|
118
161
|
*/
|
|
119
162
|
private extractContent;
|
|
120
163
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DingtalkAdapter.d.ts","sourceRoot":"","sources":["../src/DingtalkAdapter.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,WAAW,
|
|
1
|
+
{"version":3,"file":"DingtalkAdapter.d.ts","sourceRoot":"","sources":["../src/DingtalkAdapter.ts"],"names":[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