@ycodium-ai/plugin-im 0.2.3020 → 0.2.3024
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.js +24 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -139147,6 +139147,28 @@ async function* newestFirst(threads, threadId) {
|
|
|
139147
139147
|
cursor = page.nextCursor;
|
|
139148
139148
|
} while (cursor !== null);
|
|
139149
139149
|
}
|
|
139150
|
+
async function attachmentsOf(threads, threadId, message) {
|
|
139151
|
+
const collected = [...message.attachments ?? []];
|
|
139152
|
+
const total = message.attachmentsTotal ?? collected.length;
|
|
139153
|
+
while (collected.length < total) {
|
|
139154
|
+
let page;
|
|
139155
|
+
try {
|
|
139156
|
+
page = await threads.messages.list({
|
|
139157
|
+
threadId,
|
|
139158
|
+
messageId: message.id,
|
|
139159
|
+
attachmentOffset: collected.length,
|
|
139160
|
+
textLimit: 2
|
|
139161
|
+
});
|
|
139162
|
+
} catch (error) {
|
|
139163
|
+
if (isThreadNotFound(error)) break;
|
|
139164
|
+
throw error;
|
|
139165
|
+
}
|
|
139166
|
+
const more = page.items[0]?.attachments ?? [];
|
|
139167
|
+
if (more.length === 0) break;
|
|
139168
|
+
collected.push(...more);
|
|
139169
|
+
}
|
|
139170
|
+
return collected;
|
|
139171
|
+
}
|
|
139150
139172
|
async function latestMessage(threads, threadId, accept) {
|
|
139151
139173
|
for await (const message of newestFirst(threads, threadId)) {
|
|
139152
139174
|
if (accept(message)) return message;
|
|
@@ -139226,6 +139248,7 @@ var makeNotifications = (core, deps) => {
|
|
|
139226
139248
|
(message) => message.role === "assistant" && message.text.trim() !== ""
|
|
139227
139249
|
);
|
|
139228
139250
|
if (thread !== null && final !== void 0) {
|
|
139251
|
+
const attachments = await attachmentsOf(host.threads, threadId, final);
|
|
139229
139252
|
for (const binding of reporters) {
|
|
139230
139253
|
const text3 = streamsTo(binding, threadId) ? "" : `${thread.title}
|
|
139231
139254
|
|
|
@@ -139234,7 +139257,7 @@ ${final.text}`;
|
|
|
139234
139257
|
await deliver(
|
|
139235
139258
|
owns ? await anchors.anchored(binding, threadId, final.turnId) : binding,
|
|
139236
139259
|
text3,
|
|
139237
|
-
|
|
139260
|
+
attachments
|
|
139238
139261
|
);
|
|
139239
139262
|
}
|
|
139240
139263
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/plugin-im",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3024",
|
|
4
4
|
"description": "Talk to your agents from Telegram, WeCom, Lark, or WeChat (experimental).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"im",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"markdown-it": "^15.0.2",
|
|
33
33
|
"react": "19.2.6",
|
|
34
34
|
"vite-plus": "0.2.2",
|
|
35
|
-
"@ycodium-ai/plugin-api": "0.2.
|
|
35
|
+
"@ycodium-ai/plugin-api": "0.2.3024"
|
|
36
36
|
},
|
|
37
37
|
"ycodium": {
|
|
38
38
|
"plugin": "./dist/index.js",
|