@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 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 { summary, links };
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 = cloneBody(parsed, split.links, "__links");
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 for palz target=${String(parsed.conversation_id || "")} summaryMsgId=${String(summaryBody.msg_id || "")} linksMsgId=${String(linksBody.msg_id || "")}`,
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}`,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plugin-deliverables",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "npm_package": "@dai_ming/plugin-deliverables",
5
5
  "description": "Deliverables plugin: MCP server + skill + AGENTS rules for AI-generated file uploads",
6
6
  "mcp_servers": {
@@ -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.17",
5
+ "version": "1.0.18",
6
6
  "skills": ["./skills"],
7
7
  "configSchema": {
8
8
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dai_ming/plugin-deliverables",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "OpenClaw deliverables plugin — upload AI-generated files to OSS and return shareable preview/download links",
5
5
  "keywords": [
6
6
  "openclaw",