@adhdev/mesh-shared 1.0.60-rc.45 → 1.0.60-rc.46

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.mjs CHANGED
@@ -1657,6 +1657,12 @@ var RECLAIMING_SEND_REFUSALS = ["session_exited", "no_target", "unsupported_inpu
1657
1657
  var DELIVERY_OUTCOMES = ["delivered", "queued"];
1658
1658
  var DELIVERY_VIAS = ["local", "p2p"];
1659
1659
  var DISPATCH_FAILURE_REASONS = ["worker_absent", "transport_error", "spawn_failed", "rejected_by_worker", "timeout"];
1660
+ function sanitizeRefusalCode(value) {
1661
+ if (typeof value !== "string") return void 0;
1662
+ const normalized = value.trim().toLowerCase().replace(/[^a-z_]/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "");
1663
+ if (!normalized) return void 0;
1664
+ return normalized.slice(0, 64);
1665
+ }
1660
1666
  var CONSUME_PROFILES = ["default", "native_source"];
1661
1667
  var SESSION_REBOUND_REASONS = ["restart", "live_holder"];
1662
1668
  var SUSPENSION_MODALS = ["approval", "choice"];
@@ -1784,7 +1790,7 @@ var TURN_EVIDENCE_FIELD_SPECS = {
1784
1790
  },
1785
1791
  delivered: { messageId: id, outcome: en(DELIVERY_OUTCOMES), via: en(DELIVERY_VIAS) },
1786
1792
  delivery_refused: { messageId: id, reason: en(SEND_REFUSAL_REASONS) },
1787
- dispatch_failed: { workerAbsent: bool, reason: en(DISPATCH_FAILURE_REASONS) },
1793
+ dispatch_failed: { workerAbsent: bool, reason: en(DISPATCH_FAILURE_REASONS), refusalCode: idOpt },
1788
1794
  duplicate_dispatch_refusal: { holderSessionId: id, holderAttemptId: idOpt },
1789
1795
  session_rebound: { toSessionId: id, reason: en(SESSION_REBOUND_REASONS) },
1790
1796
  turn_started: { retro: bool },
@@ -3495,6 +3501,7 @@ export {
3495
3501
  renderMissionBriefBlock,
3496
3502
  renderWorkerProtocolFooter,
3497
3503
  sanitizeModelIdentifier,
3504
+ sanitizeRefusalCode,
3498
3505
  scoreGitStatusCandidate,
3499
3506
  scoreGitUpstreamFreshness,
3500
3507
  sessionIdsEquivalent,