@parall/parel-channel 1.55.4 → 1.55.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"typed-dispatch.d.ts","sourceRoot":"","sources":["../src/typed-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,MAAM,WAAW,iBAAiB;IAChC,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,kIAQpB,CAAC;AAEX,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED,wEAAwE;AACxE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAChD,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,mBAAmB,GAC3B,cAAc;AAChB,2CAA2C;GACzC;IAAE,O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MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,mBAAmB,GAC3B,cAAc;AAChB,2CAA2C;GACzC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE;AACtB;oEACoE;GAClE;IAAE,OAAO,EAAE,SAAS,CAAA;CAAE,CAAC;AA0B3B;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,iBAAiB,EACvB,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAAC,mBAAmB,CAAC,CAmC9B"}
@@ -25,6 +25,12 @@ function sanitizeMeta(value) {
25
25
  .replace(/[[\]|]/g, ' ')
26
26
  .trim();
27
27
  }
28
+ function formatApprovalDecisionReason(status, reason) {
29
+ const normalized = reason?.trim();
30
+ if (status !== 'rejected' || !normalized)
31
+ return '';
32
+ return `Reason (JSON): ${JSON.stringify(normalized)}`;
33
+ }
28
34
  /**
29
35
  * Build the plan for one typed dispatch. Throws on transient failures
30
36
  * (including unexpected handler errors — a poisoned row surfaces as catch-up
@@ -344,6 +350,9 @@ async function planApprovalDecided(ctx, approvalId, chatId, actor) {
344
350
  lines.push(`[Chat: prll://${resolvedChat}]`);
345
351
  lines.push(`[Decided by: ${sanitizeMeta(actor ?? approval.decided_by ?? 'system')}]`);
346
352
  lines.push('', `${statusLabel}: ${approval.title ?? ''}${execInfo}`);
353
+ const reasonLine = formatApprovalDecisionReason(approval.status, approval.decision_reason);
354
+ if (reasonLine)
355
+ lines.push(reasonLine);
347
356
  return {
348
357
  outcome: 'emit',
349
358
  // The decision belongs to the chat conversation it happened in — group
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/parel-channel",
3
- "version": "1.55.4",
3
+ "version": "1.55.5",
4
4
  "description": "Parall channel plugin for the parel runtime — lets a parel agent treat Parall as a managed_ws channel (receive dispatches, reply via the Parall API)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -106,6 +106,15 @@ function sanitizeMeta(value: string): string {
106
106
  .trim();
107
107
  }
108
108
 
109
+ function formatApprovalDecisionReason(
110
+ status: string | undefined,
111
+ reason: string | null | undefined,
112
+ ): string {
113
+ const normalized = reason?.trim();
114
+ if (status !== 'rejected' || !normalized) return '';
115
+ return `Reason (JSON): ${JSON.stringify(normalized)}`;
116
+ }
117
+
109
118
  /**
110
119
  * Build the plan for one typed dispatch. Throws on transient failures
111
120
  * (including unexpected handler errors — a poisoned row surfaces as catch-up
@@ -501,6 +510,7 @@ interface ApprovalRow {
501
510
  execution_status?: string;
502
511
  chat_id?: string;
503
512
  decided_by?: string;
513
+ decision_reason?: string | null;
504
514
  }
505
515
 
506
516
  async function planApprovalDecided(
@@ -530,6 +540,8 @@ async function planApprovalDecided(
530
540
  if (resolvedChat) lines.push(`[Chat: prll://${resolvedChat}]`);
531
541
  lines.push(`[Decided by: ${sanitizeMeta(actor ?? approval.decided_by ?? 'system')}]`);
532
542
  lines.push('', `${statusLabel}: ${approval.title ?? ''}${execInfo}`);
543
+ const reasonLine = formatApprovalDecisionReason(approval.status, approval.decision_reason);
544
+ if (reasonLine) lines.push(reasonLine);
533
545
 
534
546
  return {
535
547
  outcome: 'emit',