@dai_ming/plugin-deliverables 1.0.17 → 1.0.18
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/index.js +20 -3
- package/openclaw-plugin.json +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -428,6 +428,7 @@ function splitDeliverableMessage(text) {
|
|
|
428
428
|
summaryLines = trimTrailingBlankLines(summaryLines);
|
|
429
429
|
|
|
430
430
|
const linkLines = [];
|
|
431
|
+
const linkUrls = [];
|
|
431
432
|
for (let i = firstLinkIndex; i < lines.length; i += 1) {
|
|
432
433
|
const line = lines[i];
|
|
433
434
|
if (isLinksHeading(line)) {
|
|
@@ -437,6 +438,10 @@ function splitDeliverableMessage(text) {
|
|
|
437
438
|
const normalizedLine = stripBulletPrefix(line).trim();
|
|
438
439
|
if (normalizedLine) {
|
|
439
440
|
linkLines.push(normalizedLine);
|
|
441
|
+
const url = extractDeliverableURL(normalizedLine);
|
|
442
|
+
if (url) {
|
|
443
|
+
linkUrls.push(url);
|
|
444
|
+
}
|
|
440
445
|
}
|
|
441
446
|
}
|
|
442
447
|
}
|
|
@@ -447,7 +452,11 @@ function splitDeliverableMessage(text) {
|
|
|
447
452
|
return null;
|
|
448
453
|
}
|
|
449
454
|
|
|
450
|
-
return {
|
|
455
|
+
return {
|
|
456
|
+
summary,
|
|
457
|
+
links,
|
|
458
|
+
primaryLinkUrl: linkUrls.length > 0 ? linkUrls[0] : "",
|
|
459
|
+
};
|
|
451
460
|
}
|
|
452
461
|
|
|
453
462
|
function cloneBody(body, content, suffix) {
|
|
@@ -462,6 +471,12 @@ function cloneBody(body, content, suffix) {
|
|
|
462
471
|
return next;
|
|
463
472
|
}
|
|
464
473
|
|
|
474
|
+
function cloneBodyAsFileLink(body, fileUrl, suffix) {
|
|
475
|
+
const next = cloneBody(body, [{ type: "file", file_url: { url: fileUrl } }], suffix);
|
|
476
|
+
delete next.msg_type;
|
|
477
|
+
return next;
|
|
478
|
+
}
|
|
479
|
+
|
|
465
480
|
function shouldSplitPalzPayload(body) {
|
|
466
481
|
if (!body || typeof body !== "object" || Array.isArray(body)) {
|
|
467
482
|
return null;
|
|
@@ -569,12 +584,14 @@ function installPalzFetchPatch(api) {
|
|
|
569
584
|
}
|
|
570
585
|
|
|
571
586
|
const summaryBody = cloneBody(parsed, split.summary, "__summary");
|
|
572
|
-
const linksBody =
|
|
587
|
+
const linksBody = split.primaryLinkUrl
|
|
588
|
+
? cloneBodyAsFileLink(parsed, split.primaryLinkUrl, "__links")
|
|
589
|
+
: cloneBody(parsed, split.links, "__links");
|
|
573
590
|
const summaryBodyStr = JSON.stringify(summaryBody);
|
|
574
591
|
const linksBodyStr = JSON.stringify(linksBody);
|
|
575
592
|
|
|
576
593
|
api.logger.info?.(
|
|
577
|
-
`[plugin-deliverables] split deliverable reply
|
|
594
|
+
`[plugin-deliverables] split deliverable reply injected by plugin-deliverables target=${String(parsed.conversation_id || "")} summaryMsgId=${String(summaryBody.msg_id || "")} linksMsgId=${String(linksBody.msg_id || "")} linksMode=${split.primaryLinkUrl ? "file_url" : "text"}`,
|
|
578
595
|
);
|
|
579
596
|
api.logger.info?.(
|
|
580
597
|
`[plugin-deliverables] palz summary request body_length=${summaryBodyStr.length}\n request_body=${summaryBodyStr}`,
|
package/openclaw-plugin.json
CHANGED
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "plugin-deliverables",
|
|
3
3
|
"name": "Deliverables",
|
|
4
4
|
"description": "Deliverables runtime guard for upload-first file delivery with Palz split-send diagnostics.",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.18",
|
|
6
6
|
"skills": ["./skills"],
|
|
7
7
|
"configSchema": {
|
|
8
8
|
"type": "object",
|
package/package.json
CHANGED