@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.js CHANGED
@@ -405,6 +405,7 @@ __export(index_exports, {
405
405
  renderMissionBriefBlock: () => renderMissionBriefBlock,
406
406
  renderWorkerProtocolFooter: () => renderWorkerProtocolFooter,
407
407
  sanitizeModelIdentifier: () => sanitizeModelIdentifier,
408
+ sanitizeRefusalCode: () => sanitizeRefusalCode,
408
409
  scoreGitStatusCandidate: () => scoreGitStatusCandidate,
409
410
  scoreGitUpstreamFreshness: () => scoreGitUpstreamFreshness,
410
411
  sessionIdsEquivalent: () => sessionIdsEquivalent,
@@ -2078,6 +2079,12 @@ var RECLAIMING_SEND_REFUSALS = ["session_exited", "no_target", "unsupported_inpu
2078
2079
  var DELIVERY_OUTCOMES = ["delivered", "queued"];
2079
2080
  var DELIVERY_VIAS = ["local", "p2p"];
2080
2081
  var DISPATCH_FAILURE_REASONS = ["worker_absent", "transport_error", "spawn_failed", "rejected_by_worker", "timeout"];
2082
+ function sanitizeRefusalCode(value) {
2083
+ if (typeof value !== "string") return void 0;
2084
+ const normalized = value.trim().toLowerCase().replace(/[^a-z_]/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "");
2085
+ if (!normalized) return void 0;
2086
+ return normalized.slice(0, 64);
2087
+ }
2081
2088
  var CONSUME_PROFILES = ["default", "native_source"];
2082
2089
  var SESSION_REBOUND_REASONS = ["restart", "live_holder"];
2083
2090
  var SUSPENSION_MODALS = ["approval", "choice"];
@@ -2205,7 +2212,7 @@ var TURN_EVIDENCE_FIELD_SPECS = {
2205
2212
  },
2206
2213
  delivered: { messageId: id, outcome: en(DELIVERY_OUTCOMES), via: en(DELIVERY_VIAS) },
2207
2214
  delivery_refused: { messageId: id, reason: en(SEND_REFUSAL_REASONS) },
2208
- dispatch_failed: { workerAbsent: bool, reason: en(DISPATCH_FAILURE_REASONS) },
2215
+ dispatch_failed: { workerAbsent: bool, reason: en(DISPATCH_FAILURE_REASONS), refusalCode: idOpt },
2209
2216
  duplicate_dispatch_refusal: { holderSessionId: id, holderAttemptId: idOpt },
2210
2217
  session_rebound: { toSessionId: id, reason: en(SESSION_REBOUND_REASONS) },
2211
2218
  turn_started: { retro: bool },
@@ -3917,6 +3924,7 @@ function touchedFilesOutsideOwnership(touched, owned) {
3917
3924
  renderMissionBriefBlock,
3918
3925
  renderWorkerProtocolFooter,
3919
3926
  sanitizeModelIdentifier,
3927
+ sanitizeRefusalCode,
3920
3928
  scoreGitStatusCandidate,
3921
3929
  scoreGitUpstreamFreshness,
3922
3930
  sessionIdsEquivalent,