local-operator-ui 0.50.3 → 0.50.4

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.
Files changed (83) hide show
  1. package/out/main/index.js +417 -99
  2. package/out/preload/index.js +16 -0
  3. package/out/renderer/assets/{_basePickBy-BIAyBaDH.js → _basePickBy-BIQfMR48.js} +1 -1
  4. package/out/renderer/assets/{_baseUniq-DgL3QcW8.js → _baseUniq-BgTVzDm4.js} +1 -1
  5. package/out/renderer/assets/{agent-details-page-C5lbSJvs.js → agent-details-page-CK7UCkbX.js} +1 -1
  6. package/out/renderer/assets/{agent-hub-page-B9VCdhjZ.js → agent-hub-page-CjntTfYQ.js} +1 -1
  7. package/out/renderer/assets/{agents-page-BKbAx5If.js → agents-page-C6JEzbLk.js} +3 -3
  8. package/out/renderer/assets/{appearance-DDeZn9GW.js → appearance-Cr-wz2XG.js} +36 -36
  9. package/out/renderer/assets/{arc-BJTGFIUQ.js → arc-DlEzSww-.js} +1 -1
  10. package/out/renderer/assets/{architectureDiagram-IEHRJDOE-DVmjvFI2.js → architectureDiagram-IEHRJDOE-BHqdE7jj.js} +1 -1
  11. package/out/renderer/assets/{avatar-cropper-yhp9a7nF.js → avatar-cropper-Y_1k15A7.js} +1 -1
  12. package/out/renderer/assets/{blockDiagram-JOT3LUYC-CL_GQxtN.js → blockDiagram-JOT3LUYC-Ct_S7g13.js} +1 -1
  13. package/out/renderer/assets/browser-page-CvQaa7ZF.js +1 -0
  14. package/out/renderer/assets/{browser-webauthn-prompt-CFvjzfia.js → browser-webauthn-prompt-D4MzNaMs.js} +1 -1
  15. package/out/renderer/assets/{c4Diagram-VJAJSXHY-JQgwV_tI.js → c4Diagram-VJAJSXHY-0cfxxrV1.js} +1 -1
  16. package/out/renderer/assets/channel-BIfd2mO_.js +1 -0
  17. package/out/renderer/assets/{chunk-4BMEZGHF-CLQye7PF.js → chunk-4BMEZGHF-DFPtGlqQ.js} +1 -1
  18. package/out/renderer/assets/{chunk-A2AXSNBT-CiKwcN1S.js → chunk-A2AXSNBT-meyStMgl.js} +1 -1
  19. package/out/renderer/assets/{chunk-AEK57VVT-BMws5oV8.js → chunk-AEK57VVT-BEdPo4ks.js} +1 -1
  20. package/out/renderer/assets/{chunk-D6G4REZN-hmZMp437.js → chunk-D6G4REZN-DcExUv5N.js} +1 -1
  21. package/out/renderer/assets/{chunk-RZ5BOZE2-nkgroxgK.js → chunk-RZ5BOZE2-D97bec7O.js} +1 -1
  22. package/out/renderer/assets/{chunk-XZIHB7SX-C6i3Ku2G.js → chunk-XZIHB7SX-DGjNqQ8a.js} +1 -1
  23. package/out/renderer/assets/classDiagram-GIVACNV2-u2P52chH.js +1 -0
  24. package/out/renderer/assets/classDiagram-v2-COTLJTTW-u2P52chH.js +1 -0
  25. package/out/renderer/assets/clone-DXgy9Qu9.js +1 -0
  26. package/out/renderer/assets/{console-mirror-BCNLW_OB.js → console-mirror-D1SJfDTV.js} +1 -1
  27. package/out/renderer/assets/{consoleCapture-DX7_Bi8N.js → consoleCapture-BQo7ETQQ.js} +1 -1
  28. package/out/renderer/assets/{conversation-input-sync-CLca3RMQ.js → conversation-input-sync-BDpuF7C6.js} +254 -254
  29. package/out/renderer/assets/{dagre-OKDRZEBW-BPiVz0Ha.js → dagre-OKDRZEBW-CBaDWFEt.js} +1 -1
  30. package/out/renderer/assets/{diagram-SSKATNLV-CMybVMQY.js → diagram-SSKATNLV-ispcTo5e.js} +1 -1
  31. package/out/renderer/assets/{diagram-VNBRO52H-BQkTfxTP.js → diagram-VNBRO52H-BDlsgMn-.js} +1 -1
  32. package/out/renderer/assets/{erDiagram-Q7BY3M3F-CCe8VzJJ.js → erDiagram-Q7BY3M3F-CYPeSaH3.js} +1 -1
  33. package/out/renderer/assets/{flowDiagram-4HSFHLVR-BhwQJBn7.js → flowDiagram-4HSFHLVR-CMLsGESL.js} +1 -1
  34. package/out/renderer/assets/{ganttDiagram-APWFNJXF-D3Tb61s5.js → ganttDiagram-APWFNJXF-BRVxsCCP.js} +1 -1
  35. package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-C4TEmlf8.js → gitGraphDiagram-7IBYFJ6S-DE5og2RV.js} +1 -1
  36. package/out/renderer/assets/{graph-BxCV1sM0.js → graph-DDnRFykm.js} +1 -1
  37. package/out/renderer/assets/{index-B3GAg0Uk.js → index-CiHJ3lYz.js} +1 -1
  38. package/out/renderer/assets/{index-B-8qRFY6.js → index-Cpnot8lK.js} +177 -177
  39. package/out/renderer/assets/{index-lGgL8BJL.js → index-Fa4fKvzr.js} +1 -1
  40. package/out/renderer/assets/infoDiagram-PH2N3AL5-Bdk9rxy6.js +2 -0
  41. package/out/renderer/assets/{journeyDiagram-U35MCT3I-CfqQVRzF.js → journeyDiagram-U35MCT3I-go9IQj5S.js} +1 -1
  42. package/out/renderer/assets/{kanban-definition-NDS4AKOZ-C7yiVYFN.js → kanban-definition-NDS4AKOZ-BHwLNw_X.js} +1 -1
  43. package/out/renderer/assets/{layout-BFauCu5O.js → layout-zQcTVlOl.js} +1 -1
  44. package/out/renderer/assets/{legacy-agents-page-BTjIjTKU.js → legacy-agents-page-BilFWlCA.js} +1 -1
  45. package/out/renderer/assets/{library-page-D6vxagUJ.js → library-page-BCQH7-hs.js} +3 -3
  46. package/out/renderer/assets/{mermaid.core-FtMSeTAn.js → mermaid.core-DZNLevFz.js} +5 -5
  47. package/out/renderer/assets/{mesh-page-C05amwhq.js → mesh-page-CLeQ-D4w.js} +1 -1
  48. package/out/renderer/assets/{mindmap-definition-ALO5MXBD-DEp637Zx.js → mindmap-definition-ALO5MXBD-DrOY-0sS.js} +1 -1
  49. package/out/renderer/assets/{mini-rlwDnHGJ.js → mini-Bab6ERe8.js} +1 -1
  50. package/out/renderer/assets/{notifications-page-hzwfSkG_.js → notifications-page-BbM3mzCl.js} +1 -1
  51. package/out/renderer/assets/{org-access-DeGcAW0g.js → org-access-3xV9NsSd.js} +1 -1
  52. package/out/renderer/assets/{org-surface-gate-DdsmfeS0.js → org-surface-gate-JoOFLPYi.js} +1 -1
  53. package/out/renderer/assets/{pieDiagram-IB7DONF6-352EVHwb.js → pieDiagram-IB7DONF6-JyfdH5gn.js} +1 -1
  54. package/out/renderer/assets/{project-markdown-D9lbF2rE.js → project-markdown-D6HwXefM.js} +1 -1
  55. package/out/renderer/assets/{projects-page-f-jjNlM0.js → projects-page-D5xBEICx.js} +1 -1
  56. package/out/renderer/assets/{publication-validation-DkFv-tcS.js → publication-validation-pOLp0dos.js} +1 -1
  57. package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-CxETdWmc.js → quadrantDiagram-7GDLP6J5-BBtDnoHn.js} +1 -1
  58. package/out/renderer/assets/{radar-MK3ICKWK-CxlmgoFK.js → radar-MK3ICKWK-CtHJCWrJ.js} +1 -1
  59. package/out/renderer/assets/{radient-auth-buttons-BlN8k16h.js → radient-auth-buttons-DNkhmyBv.js} +1 -1
  60. package/out/renderer/assets/{requirementDiagram-KVF5MWMF-D1Ys-Vqa.js → requirementDiagram-KVF5MWMF-sB5SDSjY.js} +1 -1
  61. package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-DNbmJyZ0.js → sankeyDiagram-QLVOVGJD-CGioYe_J.js} +1 -1
  62. package/out/renderer/assets/{schedules-page-tf2PEdDS.js → schedules-page-jothEmnC.js} +1 -1
  63. package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-ORlE1ofs.js → sequenceDiagram-X6HHIX6F-CuNhF6i-.js} +1 -1
  64. package/out/renderer/assets/{settings-page-BkplTmVM.js → settings-page-caFCB3St.js} +1 -1
  65. package/out/renderer/assets/{smartart-DSMMDXy5.js → smartart-CGZfbyUs.js} +1 -1
  66. package/out/renderer/assets/{stateDiagram-DGXRK772-DHBC80cL.js → stateDiagram-DGXRK772-D5ElgpJs.js} +1 -1
  67. package/out/renderer/assets/{stateDiagram-v2-YXO3MK2T-Czy-GuC9.js → stateDiagram-v2-YXO3MK2T-61oDVBom.js} +1 -1
  68. package/out/renderer/assets/{team-bridge-page-B9m1gzDA.js → team-bridge-page-4TgWaKxG.js} +1 -1
  69. package/out/renderer/assets/{team-bridge-scope-preference-Ahy7myQs.js → team-bridge-scope-preference-D5JQQEFh.js} +1 -1
  70. package/out/renderer/assets/{timeline-definition-BDJGKUSR-yhK2UMNx.js → timeline-definition-BDJGKUSR-B1vy2fC7.js} +1 -1
  71. package/out/renderer/assets/{use-download-agent-mutation-B4ge3-WA.js → use-download-agent-mutation-CHGnPs7p.js} +1 -1
  72. package/out/renderer/assets/{use-session-snapshot-BrC4Vkbo.js → use-session-snapshot-BpNsrx-E.js} +1 -1
  73. package/out/renderer/assets/{xychartDiagram-VJFVF3MP-Cxztr4iS.js → xychartDiagram-VJFVF3MP-C-K_hlon.js} +1 -1
  74. package/out/renderer/console-capture.html +3 -3
  75. package/out/renderer/index.html +4 -4
  76. package/out/renderer/mini.html +4 -4
  77. package/package.json +1 -1
  78. package/out/renderer/assets/browser-page-BQQFCLqU.js +0 -1
  79. package/out/renderer/assets/channel-BGuz2tJb.js +0 -1
  80. package/out/renderer/assets/classDiagram-GIVACNV2-D9-F2Rdx.js +0 -1
  81. package/out/renderer/assets/classDiagram-v2-COTLJTTW-D9-F2Rdx.js +0 -1
  82. package/out/renderer/assets/clone-D46OhRyb.js +0 -1
  83. package/out/renderer/assets/infoDiagram-PH2N3AL5-BYXNTmvu.js +0 -2
package/out/main/index.js CHANGED
@@ -76179,11 +76179,11 @@ function bytesFromDataUrl(dataUrl) {
76179
76179
  }
76180
76180
  function readRecord(payload) {
76181
76181
  if (payload === null || typeof payload !== "object") return null;
76182
- const body = payload;
76183
- const inner = body.result;
76182
+ const body2 = payload;
76183
+ const inner = body2.result;
76184
76184
  if (inner !== null && typeof inner === "object")
76185
76185
  return inner;
76186
- return body;
76186
+ return body2;
76187
76187
  }
76188
76188
  function toAttachment(payload) {
76189
76189
  const record = readRecord(payload);
@@ -77015,9 +77015,9 @@ const pypiReleaseReading = (payload, platform) => {
77015
77015
  }
77016
77016
  return { namedVersion: trimmed, readyVersion: ready ? trimmed : null };
77017
77017
  };
77018
- const readPypiReleaseBody = (body, platform) => {
77018
+ const readPypiReleaseBody = (body2, platform) => {
77019
77019
  try {
77020
- return pypiReleaseReading(JSON.parse(body), platform);
77020
+ return pypiReleaseReading(JSON.parse(body2), platform);
77021
77021
  } catch {
77022
77022
  return { namedVersion: null, readyVersion: null };
77023
77023
  }
@@ -79261,15 +79261,15 @@ function driftInstallReading(input) {
79261
79261
  return { version: input.planVersion, source: "serving-install" };
79262
79262
  }
79263
79263
  const DEGRADED_LIVENESS_SOURCE = "liveness";
79264
- function rosterLivenessDegraded(body) {
79265
- const degraded = body?.result?.degraded;
79264
+ function rosterLivenessDegraded(body2) {
79265
+ const degraded = body2?.result?.degraded;
79266
79266
  return Array.isArray(degraded) && degraded.includes(DEGRADED_LIVENESS_SOURCE);
79267
79267
  }
79268
79268
  const KNOWN_LIVE_STATES = /* @__PURE__ */ new Set(["", "wedged", "busy", "attached", "idle"]);
79269
- function fleetRosterFromSessions(body) {
79270
- const sessions = body?.result?.sessions;
79269
+ function fleetRosterFromSessions(body2) {
79270
+ const sessions = body2?.result?.sessions;
79271
79271
  if (!Array.isArray(sessions)) return null;
79272
- if (rosterLivenessDegraded(body)) return null;
79272
+ if (rosterLivenessDegraded(body2)) return null;
79273
79273
  return sessions.filter(
79274
79274
  (row) => typeof row === "object" && row !== null
79275
79275
  ).map((row) => ({
@@ -79282,8 +79282,8 @@ function fleetRosterFromSessions(body) {
79282
79282
  function busyRosterRows(rows) {
79283
79283
  return rows.filter((row) => row.liveState === "busy");
79284
79284
  }
79285
- function servingWorkStateFromSessions(body) {
79286
- const rows = fleetRosterFromSessions(body);
79285
+ function servingWorkStateFromSessions(body2) {
79286
+ const rows = fleetRosterFromSessions(body2);
79287
79287
  if (rows === null) return "unknown";
79288
79288
  if (busyRosterRows(rows).length > 0) return "busy";
79289
79289
  if (rows.some(
@@ -79401,8 +79401,8 @@ class DesktopFeedRelay {
79401
79401
  let features;
79402
79402
  try {
79403
79403
  const response = await this.options.request({ op: "capabilities" });
79404
- const body = response.body;
79405
- features = body?.result?.features;
79404
+ const body2 = response.body;
79405
+ features = body2?.result?.features;
79406
79406
  } catch {
79407
79407
  this.running = false;
79408
79408
  this.setConnected(false);
@@ -79925,6 +79925,18 @@ const mediaRequestSchema = zod.z.discriminatedUnion("op", [
79925
79925
  zod.z.object({
79926
79926
  op: zod.z.literal("library.waveform"),
79927
79927
  assetId: zod.z.string().regex(/^la_[0-9a-f]{16}$/)
79928
+ }).strict(),
79929
+ /*
79930
+ * One notification sound as `audio/wav` with the volume baked in (core
79931
+ * `/v1/notification-sounds/{id}/audio?volume=`, `features.notification_sounds`).
79932
+ * Main stages it in ~/Library/Sounds or hands it to the renderer's player
79933
+ * (`notification-sound.ts`). The id is the catalog's slug or core's
79934
+ * `custom-[a-z0-9-]{1,40}`, checked here because it becomes a path segment.
79935
+ */
79936
+ zod.z.object({
79937
+ op: zod.z.literal("notification_sounds.audio"),
79938
+ soundId: zod.z.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/),
79939
+ volume: zod.z.number().int().min(0).max(100)
79928
79940
  }).strict()
79929
79941
  ]);
79930
79942
  function endpoint(request) {
@@ -80006,6 +80018,11 @@ function endpoint(request) {
80006
80018
  path: `/v1/desktop/library/assets/${request.assetId}/waveform`,
80007
80019
  method: "GET"
80008
80020
  };
80021
+ case "notification_sounds.audio":
80022
+ return {
80023
+ path: `/v1/notification-sounds/${request.soundId}/audio?volume=${request.volume}`,
80024
+ method: "GET"
80025
+ };
80009
80026
  case "team_bridge.attachment.upload":
80010
80027
  return {
80011
80028
  path: `/v1/desktop/team-bridge/conversations/${request.conversationId}/attachments?${new URLSearchParams({ tenant_id: request.tenantId, expected_account_id: request.expectedAccountId, ...request.mode ? { mode: request.mode } : {} })}`,
@@ -80101,10 +80118,10 @@ async function requestDesktopMediaOutcome(input, bytes, backendUrl, token) {
80101
80118
  };
80102
80119
  }
80103
80120
  const target2 = endpoint(request);
80104
- let body;
80121
+ let body2;
80105
80122
  let contentType;
80106
- if (request.op === "account.profile" || request.op === "account.avatar.delete" || request.op === "agent.export" || request.op === "agent.avatar" || request.op === "agent.avatar.delete" || request.op === "sessions.attachment" || request.op === "subagents.attachment" || request.op === "sessions.attachment.waveform" || request.op === "sessions.supplementDocument" || request.op === "library.content" || request.op === "library.thumbnail" || request.op === "library.waveform" || request.op === "team_bridge.attachment" || request.op === "team_bridge.owner_audit.attachment" || request.op === "team_bridge.avatar" || request.op === "team_bridge.endpoint_avatar" || request.op === "team_bridge.notification_avatar") {
80107
- body = void 0;
80123
+ if (request.op === "account.profile" || request.op === "account.avatar.delete" || request.op === "agent.export" || request.op === "agent.avatar" || request.op === "agent.avatar.delete" || request.op === "sessions.attachment" || request.op === "subagents.attachment" || request.op === "sessions.attachment.waveform" || request.op === "sessions.supplementDocument" || request.op === "library.content" || request.op === "library.thumbnail" || request.op === "library.waveform" || request.op === "notification_sounds.audio" || request.op === "team_bridge.attachment" || request.op === "team_bridge.owner_audit.attachment" || request.op === "team_bridge.avatar" || request.op === "team_bridge.endpoint_avatar" || request.op === "team_bridge.notification_avatar") {
80124
+ body2 = void 0;
80108
80125
  } else if (request.op === "team_bridge.attachment.upload" || request.op === "account.avatar.put" || request.op === "agent.avatar.put") {
80109
80126
  if (!bytes || bytes.byteLength === 0) {
80110
80127
  return {
@@ -80116,13 +80133,13 @@ async function requestDesktopMediaOutcome(input, bytes, backendUrl, token) {
80116
80133
  answered: false
80117
80134
  };
80118
80135
  }
80119
- body = new Blob([bytes]);
80136
+ body2 = new Blob([bytes]);
80120
80137
  contentType = "application/octet-stream";
80121
80138
  } else if (request.op === "account.profile.update") {
80122
- body = JSON.stringify(request.fields);
80139
+ body2 = JSON.stringify(request.fields);
80123
80140
  contentType = "application/json";
80124
80141
  } else if (request.op === "speech.create" || request.op === "speech.agent") {
80125
- body = JSON.stringify(request.request);
80142
+ body2 = JSON.stringify(request.request);
80126
80143
  contentType = "application/json";
80127
80144
  } else {
80128
80145
  if (!bytes) {
@@ -80141,7 +80158,7 @@ async function requestDesktopMediaOutcome(input, bytes, backendUrl, token) {
80141
80158
  form.append(key, value);
80142
80159
  }
80143
80160
  }
80144
- body = form;
80161
+ body2 = form;
80145
80162
  }
80146
80163
  let answered = false;
80147
80164
  try {
@@ -80155,7 +80172,7 @@ async function requestDesktopMediaOutcome(input, bytes, backendUrl, token) {
80155
80172
  ...request.op === "team_bridge.attachment.upload" && request.mode === "file" && request.fileName ? { "X-Bridge-File-Name": encodeURIComponent(request.fileName) } : {},
80156
80173
  Authorization: `Bearer ${token}`
80157
80174
  },
80158
- body,
80175
+ body: body2,
80159
80176
  // Private avatars are cached only as authority-scoped renderer blobs.
80160
80177
  // Neither Electron nor an intermediary may persist them across login.
80161
80178
  ...request.op === "team_bridge.owner_audit.attachment" || request.op === "team_bridge.avatar" || request.op === "team_bridge.endpoint_avatar" || request.op === "team_bridge.notification_avatar" ? { cache: "no-store" } : {},
@@ -80188,16 +80205,16 @@ async function requestDesktopMediaOutcome(input, bytes, backendUrl, token) {
80188
80205
  let busy = false;
80189
80206
  if (composite && response.status === 503 && response.body && mime === "application/json") {
80190
80207
  const reader2 = response.body.getReader();
80191
- let body2 = "";
80208
+ let body22 = "";
80192
80209
  try {
80193
80210
  for (; ; ) {
80194
80211
  const { done, value } = await reader2.read();
80195
80212
  if (done) break;
80196
- body2 += new TextDecoder().decode(value, { stream: true });
80197
- if (body2.length > 16 * 1024) break;
80213
+ body22 += new TextDecoder().decode(value, { stream: true });
80214
+ if (body22.length > 16 * 1024) break;
80198
80215
  }
80199
- if (body2.length <= 16 * 1024) {
80200
- const envelope = JSON.parse(body2);
80216
+ if (body22.length <= 16 * 1024) {
80217
+ const envelope = JSON.parse(body22);
80201
80218
  busy = typeof envelope === "object" && envelope !== null && "detail" in envelope && typeof envelope.detail === "object" && envelope.detail !== null && "code" in envelope.detail && envelope.detail.code === "renderer_busy";
80202
80219
  }
80203
80220
  } catch {
@@ -80601,8 +80618,8 @@ async function requestDesktopOutcome(input, backendUrl, token) {
80601
80618
  let answered = false;
80602
80619
  const deadlineMs = desktopRequestDeadlineMs(request);
80603
80620
  try {
80604
- const body = target2.body === void 0 ? void 0 : JSON.stringify(target2.body);
80605
- if (body && Buffer.byteLength(body) > desktopRequestByteBudget(request.op)) {
80621
+ const body2 = target2.body === void 0 ? void 0 : JSON.stringify(target2.body);
80622
+ if (body2 && Buffer.byteLength(body2) > desktopRequestByteBudget(request.op)) {
80606
80623
  return {
80607
80624
  response: {
80608
80625
  status: 413,
@@ -80615,10 +80632,10 @@ async function requestDesktopOutcome(input, backendUrl, token) {
80615
80632
  method: target2.method,
80616
80633
  headers: {
80617
80634
  Accept: "application/json",
80618
- ...body ? { "Content-Type": "application/json" } : {},
80635
+ ...body2 ? { "Content-Type": "application/json" } : {},
80619
80636
  ...token ? { Authorization: `Bearer ${token}` } : {}
80620
80637
  },
80621
- body,
80638
+ body: body2,
80622
80639
  redirect: "error",
80623
80640
  signal: AbortSignal.timeout(deadlineMs)
80624
80641
  });
@@ -89314,10 +89331,10 @@ ${indent}`) + "'";
89314
89331
  literalFallback = true;
89315
89332
  };
89316
89333
  }
89317
- const body = foldFlowLines2.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines2.FOLD_BLOCK, foldOptions);
89334
+ const body2 = foldFlowLines2.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines2.FOLD_BLOCK, foldOptions);
89318
89335
  if (!literalFallback)
89319
89336
  return `>${header}
89320
- ${indent}${body}`;
89337
+ ${indent}${body2}`;
89321
89338
  }
89322
89339
  value = value.replace(/\n+/g, `$&${indent}`);
89323
89340
  return `|${header}
@@ -91321,13 +91338,13 @@ function requireStringifyDocument() {
91321
91338
  contentComment = doc.contents.comment;
91322
91339
  }
91323
91340
  const onChompKeep = contentComment ? void 0 : () => chompKeep = true;
91324
- let body = stringify2.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);
91341
+ let body2 = stringify2.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);
91325
91342
  if (contentComment)
91326
- body += stringifyComment2.lineComment(body, "", commentString(contentComment));
91327
- if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") {
91328
- lines[lines.length - 1] = `--- ${body}`;
91343
+ body2 += stringifyComment2.lineComment(body2, "", commentString(contentComment));
91344
+ if ((body2[0] === "|" || body2[0] === ">") && lines[lines.length - 1] === "---") {
91345
+ lines[lines.length - 1] = `--- ${body2}`;
91329
91346
  } else
91330
- lines.push(body);
91347
+ lines.push(body2);
91331
91348
  } else {
91332
91349
  lines.push(stringify2.stringify(doc.contents, ctx));
91333
91350
  }
@@ -93313,13 +93330,13 @@ function requireCstScalar() {
93313
93330
  case ">": {
93314
93331
  const he = source.indexOf("\n");
93315
93332
  const head = source.substring(0, he);
93316
- const body = source.substring(he + 1) + "\n";
93333
+ const body2 = source.substring(he + 1) + "\n";
93317
93334
  const props = [
93318
93335
  { type: "block-scalar-header", offset, indent, source: head }
93319
93336
  ];
93320
93337
  if (!addEndtoBlockProps(props, end))
93321
93338
  props.push({ type: "newline", offset: -1, indent, source: "\n" });
93322
- return { type: "block-scalar", offset, indent, props, source: body };
93339
+ return { type: "block-scalar", offset, indent, props, source: body2 };
93323
93340
  }
93324
93341
  case '"':
93325
93342
  return { type: "double-quoted-scalar", offset, indent, source, end };
@@ -93376,13 +93393,13 @@ function requireCstScalar() {
93376
93393
  function setBlockScalarValue(token, source) {
93377
93394
  const he = source.indexOf("\n");
93378
93395
  const head = source.substring(0, he);
93379
- const body = source.substring(he + 1) + "\n";
93396
+ const body2 = source.substring(he + 1) + "\n";
93380
93397
  if (token.type === "block-scalar") {
93381
93398
  const header = token.props[0];
93382
93399
  if (header.type !== "block-scalar-header")
93383
93400
  throw new Error("Invalid block scalar header");
93384
93401
  header.source = head;
93385
- token.source = body;
93402
+ token.source = body2;
93386
93403
  } else {
93387
93404
  const { offset } = token;
93388
93405
  const indent = "indent" in token ? token.indent : -1;
@@ -93394,7 +93411,7 @@ function requireCstScalar() {
93394
93411
  for (const key of Object.keys(token))
93395
93412
  if (key !== "type" && key !== "offset")
93396
93413
  delete token[key];
93397
- Object.assign(token, { type: "block-scalar", indent, props, source: body });
93414
+ Object.assign(token, { type: "block-scalar", indent, props, source: body2 });
93398
93415
  }
93399
93416
  }
93400
93417
  function addEndtoBlockProps(props, end) {
@@ -96472,16 +96489,16 @@ class Osc133Scanner {
96472
96489
  return null;
96473
96490
  }
96474
96491
  finish() {
96475
- const body = this.body;
96492
+ const body2 = this.body;
96476
96493
  const offset = this.sequenceStart ?? 0;
96477
96494
  this.body = null;
96478
96495
  this.escaped = false;
96479
96496
  this.sequenceStart = null;
96480
- if (body === null || this.overflowed) {
96497
+ if (body2 === null || this.overflowed) {
96481
96498
  this.overflowed = false;
96482
96499
  return null;
96483
96500
  }
96484
- return parseBody(body, offset);
96501
+ return parseBody(body2, offset);
96485
96502
  }
96486
96503
  abandon() {
96487
96504
  this.body = null;
@@ -96489,8 +96506,8 @@ class Osc133Scanner {
96489
96506
  this.sequenceStart = null;
96490
96507
  }
96491
96508
  }
96492
- function parseBody(body, offset) {
96493
- const text2 = String.fromCharCode(...body);
96509
+ function parseBody(body2, offset) {
96510
+ const text2 = String.fromCharCode(...body2);
96494
96511
  const [kind, status2] = text2.split(";");
96495
96512
  const mapped = KINDS[kind];
96496
96513
  if (!mapped) return null;
@@ -99497,11 +99514,11 @@ async function startConsoleHost(options) {
99497
99514
  throw new AggregateError(failures, "Partial console cleanup incomplete.");
99498
99515
  };
99499
99516
  try {
99500
- const configDir = options.configDir ?? localOperatorConfigDir();
99517
+ const configDir2 = options.configDir ?? localOperatorConfigDir();
99501
99518
  const history = new ConsoleHistory(
99502
- path$1.join(configDir, "run", "ui-console", "history")
99519
+ path$1.join(configDir2, "run", "ui-console", "history")
99503
99520
  );
99504
- const policyEnv = { ...process.env, LOCAL_OPERATOR_CONFIG_DIR: configDir };
99521
+ const policyEnv = { ...process.env, LOCAL_OPERATOR_CONFIG_DIR: configDir2 };
99505
99522
  const policy = readConsolePolicy(policyEnv);
99506
99523
  const registry = new ConsoleRegistry({
99507
99524
  policy: policy ? {
@@ -99776,14 +99793,14 @@ function parseKeychainAccessGroups(entitlementsPlist) {
99776
99793
  const arrayStart = after.indexOf("<array>");
99777
99794
  const arrayEnd = after.indexOf("</array>", arrayStart + 1);
99778
99795
  if (arrayStart === -1 || arrayEnd === -1) return [];
99779
- const body = after.slice(arrayStart + "<array>".length, arrayEnd);
99796
+ const body2 = after.slice(arrayStart + "<array>".length, arrayEnd);
99780
99797
  const groups = [];
99781
99798
  const pattern = /<string>([^<]*)<\/string>/g;
99782
- let match = pattern.exec(body);
99799
+ let match = pattern.exec(body2);
99783
99800
  while (match !== null) {
99784
99801
  const value = match[1].trim();
99785
99802
  if (value) groups.push(value);
99786
- match = pattern.exec(body);
99803
+ match = pattern.exec(body2);
99787
99804
  }
99788
99805
  return groups;
99789
99806
  }
@@ -104571,17 +104588,17 @@ function findEntry(capture, requestId2) {
104571
104588
  }
104572
104589
  function retainBody(capture, entry, data) {
104573
104590
  if (!capture.active || !capture.entries.includes(entry)) return;
104574
- const body = Buffer.from(data, "utf8");
104575
- if (body.length > MAX_BODY_PER_REQUEST) {
104591
+ const body2 = Buffer.from(data, "utf8");
104592
+ if (body2.length > MAX_BODY_PER_REQUEST) {
104576
104593
  capture.droppedBodies++;
104577
104594
  return;
104578
104595
  }
104579
104596
  if (entry.request_body_base64 !== void 0) {
104580
104597
  capture.bodyBytes -= entry.request_body_size ?? 0;
104581
104598
  }
104582
- entry.request_body_base64 = body.toString("base64");
104583
- entry.request_body_size = body.length;
104584
- capture.bodyBytes += body.length;
104599
+ entry.request_body_base64 = body2.toString("base64");
104600
+ entry.request_body_size = body2.length;
104601
+ capture.bodyBytes += body2.length;
104585
104602
  trim(capture);
104586
104603
  }
104587
104604
  function pullPostData(capture, requestId2) {
@@ -104843,11 +104860,11 @@ const u16 = (value) => {
104843
104860
  return out;
104844
104861
  };
104845
104862
  const box = (type2, ...children) => {
104846
- const body = Buffer.concat(children);
104863
+ const body2 = Buffer.concat(children);
104847
104864
  return Buffer.concat([
104848
- u32(8 + body.length),
104865
+ u32(8 + body2.length),
104849
104866
  Buffer.from(type2, "latin1"),
104850
- body
104867
+ body2
104851
104868
  ]);
104852
104869
  };
104853
104870
  const fullBox = (type2, version, flags, ...children) => box(type2, u32(version << 24 | flags), ...children);
@@ -106451,12 +106468,12 @@ async function recordStart(ctx, params, requestId2) {
106451
106468
  await waitForCompositedFrame(ctx.cdp, contents, measured);
106452
106469
  }
106453
106470
  if (quality === "high" && ctx.recordingEncoder) {
106454
- const service = ctx.recordingEncoder;
106471
+ const service2 = ctx.recordingEncoder;
106455
106472
  await HqSession.start(
106456
106473
  {
106457
106474
  cdp: ctx.cdp,
106458
106475
  contents,
106459
- service,
106476
+ service: service2,
106460
106477
  maxWidth: measured?.width ?? RECORD_WIDTH,
106461
106478
  maxHeight: measured?.height ?? RECORD_HEIGHT,
106462
106479
  size: measured,
@@ -108204,10 +108221,10 @@ async function frameSnapshots(ctx, record, topNodes, refs) {
108204
108221
  };
108205
108222
  }
108206
108223
  const indent = " ".repeat(depth);
108207
- const body = inner.replace(REF_LABEL, (_m, n) => `[e${Number(n) + offset}]`).split("\n").filter(Boolean).map((line) => `${indent} ${line}`);
108224
+ const body2 = inner.replace(REF_LABEL, (_m, n) => `[e${Number(n) + offset}]`).split("\n").filter(Boolean).map((line) => `${indent} ${line}`);
108208
108225
  blocks.push(
108209
108226
  `${indent}- frame ${scope.path.join(` ${FRAME_HOP} `)}${scope.origin ? ` (${scope.origin})` : ""}:`,
108210
- ...body
108227
+ ...body2
108211
108228
  );
108212
108229
  next.push({ scope, nodes: frameNodes });
108213
108230
  } catch (error) {
@@ -113131,6 +113148,288 @@ class NotificationLifetime {
113131
113148
  return this.live.size;
113132
113149
  }
113133
113150
  }
113151
+ const NOTIFICATION_SOUND_PLAY_CHANNEL = "notification-sound:play";
113152
+ const SETTING_ENABLED = "notifications.sound.enabled";
113153
+ const SETTING_ID = "notifications.sound.id";
113154
+ const SETTING_VOLUME = "notifications.sound.volume";
113155
+ const DEFAULT_SOUND_ID = "soft-pulse";
113156
+ const DEFAULT_VOLUME = 70;
113157
+ const SYSTEM_SOUND_ID = "system";
113158
+ const ENV_NO_SOUND = "LOCAL_OPERATOR_NO_SOUND";
113159
+ const THROTTLE_MS = 1500;
113160
+ const THROTTLE_FILE = path$1.join("run", "notification-sound.last");
113161
+ const STAGED_PREFIX = "LocalOperator-";
113162
+ function configDir(env) {
113163
+ return env.LOCAL_OPERATOR_CONFIG_DIR || path$1.join(os.homedir(), ".local-operator");
113164
+ }
113165
+ function body(response) {
113166
+ if (response.status !== 200 || !response.body) return;
113167
+ const result = response.body.result;
113168
+ return result && typeof result === "object" ? result : void 0;
113169
+ }
113170
+ function stagedSoundName(soundId, volume, bytes, env = process.env) {
113171
+ const sha = node_crypto.createHash("sha256").update(bytes).digest("hex").slice(0, 8);
113172
+ return `${stagedScopePrefix(env)}${soundId}-${volume}-${sha}.wav`;
113173
+ }
113174
+ function stagedScopePrefix(env = process.env) {
113175
+ const scope = node_crypto.createHash("sha256").update(configDir(env)).digest("hex").slice(0, 8);
113176
+ return `${STAGED_PREFIX}${scope}-`;
113177
+ }
113178
+ const MAX_NOTIFICATION_SOUND_BYTES = 4 * 1024 * 1024;
113179
+ class NotificationSoundService {
113180
+ constructor(deps) {
113181
+ this.deps = deps;
113182
+ this.platform = deps.platform ?? process.platform;
113183
+ this.env = deps.env ?? process.env;
113184
+ this.soundsDir = deps.soundsDir ?? path$1.join(os.homedir(), "Library", "Sounds");
113185
+ this.now = deps.now ?? Date.now;
113186
+ }
113187
+ plan = { kind: "legacy" };
113188
+ /**
113189
+ * Whether any read has completed from real answers. Until one has, every
113190
+ * banner kicks a read (see `bannerOptions`), so the window in which a banner
113191
+ * can only follow `legacy` is as short as the backend allows.
113192
+ */
113193
+ settled = false;
113194
+ inFlight = null;
113195
+ /** Bumped by every refresh, so a slow older read cannot overwrite a newer one. */
113196
+ generation = 0;
113197
+ platform;
113198
+ env;
113199
+ soundsDir;
113200
+ now;
113201
+ /** The current plan; read by the probe and the tests, never by a site. */
113202
+ current() {
113203
+ return this.plan;
113204
+ }
113205
+ /**
113206
+ * Re-read the capability and the three settings, then fetch and stage the
113207
+ * sound. Never throws: a sound is a convenience.
113208
+ *
113209
+ * ANY UNANSWERED READ KEEPS THE LAST PLAN (review round 1 M1, QA Q1). These
113210
+ * reads run on every backend-ready, which is exactly when a restarting
113211
+ * backend answers 0/503/504. Reading such an answer as "no settings" fell
113212
+ * through to the defaults and played soft-pulse for a user who had turned
113213
+ * sounds off; reading it as "no capability" played the OS chime. Only a
113214
+ * capabilities answer that is a 200 WITHOUT the flag means an older backend.
113215
+ */
113216
+ refresh() {
113217
+ const run = this.read().finally(() => {
113218
+ if (this.inFlight === run) this.inFlight = null;
113219
+ });
113220
+ this.inFlight = run;
113221
+ return run;
113222
+ }
113223
+ keep(what, status2) {
113224
+ this.deps.log?.(
113225
+ `[notification-sound] ${what} unanswered (status ${status2}); keeping ${this.plan.kind}`
113226
+ );
113227
+ }
113228
+ async read() {
113229
+ const generation = ++this.generation;
113230
+ const stale = () => generation !== this.generation;
113231
+ try {
113232
+ const capabilitiesResponse = await this.deps.request({
113233
+ op: "capabilities"
113234
+ });
113235
+ if (stale()) return;
113236
+ const capabilities = body(capabilitiesResponse);
113237
+ if (!capabilities)
113238
+ return this.keep("capabilities", capabilitiesResponse.status);
113239
+ const features = capabilities.features;
113240
+ if (Number(features?.notification_sounds ?? 0) < 1) {
113241
+ this.plan = { kind: "legacy" };
113242
+ this.settled = true;
113243
+ return;
113244
+ }
113245
+ const listingResponse = await this.deps.request({ op: "settings.list" });
113246
+ if (stale()) return;
113247
+ const listing = body(listingResponse);
113248
+ if (!Array.isArray(listing?.settings))
113249
+ return this.keep("settings.list", listingResponse.status);
113250
+ const rows = listing.settings;
113251
+ const value = (key) => rows.find((row) => row?.key === key)?.value;
113252
+ const enabled = value(SETTING_ENABLED);
113253
+ const rawId = value(SETTING_ID);
113254
+ const rawVolume = value(SETTING_VOLUME);
113255
+ const soundId = typeof rawId === "string" && rawId ? rawId : DEFAULT_SOUND_ID;
113256
+ const volume = typeof rawVolume === "number" && Number.isFinite(rawVolume) ? Math.min(100, Math.max(0, Math.round(rawVolume))) : DEFAULT_VOLUME;
113257
+ if (this.env[ENV_NO_SOUND]) {
113258
+ this.plan = { kind: "silent", reason: `${ENV_NO_SOUND} is set` };
113259
+ this.settled = true;
113260
+ return;
113261
+ }
113262
+ if (enabled === false) {
113263
+ this.plan = { kind: "silent", reason: `${SETTING_ENABLED} is off` };
113264
+ this.settled = true;
113265
+ return;
113266
+ }
113267
+ if (soundId === SYSTEM_SOUND_ID) {
113268
+ this.plan = { kind: "system" };
113269
+ this.settled = true;
113270
+ return;
113271
+ }
113272
+ if (volume === 0) {
113273
+ this.plan = { kind: "silent", reason: `${SETTING_VOLUME} is 0` };
113274
+ this.settled = true;
113275
+ return;
113276
+ }
113277
+ let resolvedId = soundId;
113278
+ let audio = await this.fetchAudio(resolvedId, volume);
113279
+ if (stale()) return;
113280
+ if (audio.kind !== "bytes" && (audio.status === 404 || audio.status === 422) && resolvedId !== DEFAULT_SOUND_ID) {
113281
+ this.deps.log?.(
113282
+ `[notification-sound] ${resolvedId} not found (status ${audio.status}); using ${DEFAULT_SOUND_ID}`
113283
+ );
113284
+ resolvedId = DEFAULT_SOUND_ID;
113285
+ audio = await this.fetchAudio(resolvedId, volume);
113286
+ if (stale()) return;
113287
+ }
113288
+ if (audio.kind !== "bytes" || !audio.mimeType.toLowerCase().startsWith("audio/wav") || audio.data.byteLength === 0 || audio.data.byteLength > MAX_NOTIFICATION_SOUND_BYTES) {
113289
+ this.deps.log?.(
113290
+ `[notification-sound] audio for ${resolvedId} unavailable (status ${audio.status}); keeping ${this.plan.kind}`
113291
+ );
113292
+ return;
113293
+ }
113294
+ const staged = this.platform === "darwin" ? this.stage(resolvedId, volume, audio.data) : null;
113295
+ this.plan = {
113296
+ kind: "file",
113297
+ soundId: resolvedId,
113298
+ volume,
113299
+ bytes: audio.data,
113300
+ staged
113301
+ };
113302
+ this.settled = true;
113303
+ this.deps.log?.(
113304
+ `[notification-sound] ready id=${resolvedId} volume=${volume} bytes=${audio.data.byteLength} staged=${staged ?? "none"}`
113305
+ );
113306
+ } catch (error) {
113307
+ this.deps.log?.(`[notification-sound] refresh failed: ${String(error)}`);
113308
+ }
113309
+ }
113310
+ fetchAudio(soundId, volume) {
113311
+ return this.deps.media({
113312
+ op: "notification_sounds.audio",
113313
+ soundId,
113314
+ volume
113315
+ });
113316
+ }
113317
+ /**
113318
+ * A `config` feed frame: re-read only when a sound setting changed.
113319
+ *
113320
+ * The live feed names TOP-LEVEL config keys (core `desktop_feed.py` diffs
113321
+ * the top level), so a PATCH of `notifications.sound.volume` arrives as
113322
+ * `["notifications"]` (captured from `/v1/desktop/events`, QA round 1 Q2).
113323
+ * The dotted spellings are accepted too, so a feed that one day names
113324
+ * registry keys keeps working.
113325
+ */
113326
+ observeConfigChange(changedKeys) {
113327
+ if (changedKeys.some(
113328
+ (key) => key === "notifications" || key.startsWith("notifications.")
113329
+ ))
113330
+ void this.refresh();
113331
+ }
113332
+ /**
113333
+ * Write the WAV into `~/Library/Sounds` and prune older stagings. Returns the
113334
+ * file name the banner's `sound` carries, or `null` (the renderer fallback).
113335
+ *
113336
+ * Written to a temporary name and renamed, so the OS never opens a
113337
+ * half-written file under the name a banner points at.
113338
+ */
113339
+ stage(soundId, volume, bytes) {
113340
+ const name = stagedSoundName(soundId, volume, bytes, this.env);
113341
+ const scope = stagedScopePrefix(this.env);
113342
+ try {
113343
+ fs.mkdirSync(this.soundsDir, { recursive: true });
113344
+ const target2 = path$1.join(this.soundsDir, name);
113345
+ const temporary = path$1.join(this.soundsDir, `.${name}.${process.pid}.tmp`);
113346
+ fs.writeFileSync(temporary, bytes);
113347
+ fs.renameSync(temporary, target2);
113348
+ } catch (error) {
113349
+ this.deps.log?.(
113350
+ `[notification-sound] staging ${name} failed: ${String(error)}`
113351
+ );
113352
+ return null;
113353
+ }
113354
+ try {
113355
+ for (const entry of fs.readdirSync(this.soundsDir)) {
113356
+ const stale = entry !== name && entry.startsWith(scope) && entry.endsWith(".wav") || entry.startsWith(`.${scope}`) && entry.endsWith(".tmp");
113357
+ if (stale) fs.unlinkSync(path$1.join(this.soundsDir, entry));
113358
+ }
113359
+ } catch {
113360
+ }
113361
+ return name;
113362
+ }
113363
+ /**
113364
+ * The machine-wide sound slot, in two steps: `throttled()` reads it and
113365
+ * `takeSlot()` touches it. A `stat` and then a touch, NOT atomic, on purpose
113366
+ * (the backend's `claim_throttle` says why): a lost race costs one extra
113367
+ * chime, and a lock could lose a sound to a stale lock. Split so the
113368
+ * renderer fallback takes the slot only once a window accepted the sound
113369
+ * (QA round 1 Q3b): no window means no sound, and no sound must not silence
113370
+ * the TUI for 1.5 s. Fails OPEN when the run dir cannot be written, because
113371
+ * a tidiness rule must not become silence.
113372
+ */
113373
+ throttled() {
113374
+ const path2 = path$1.join(configDir(this.env), THROTTLE_FILE);
113375
+ try {
113376
+ const age = this.now() - fs.statSync(path2).mtimeMs;
113377
+ return age >= 0 && age < THROTTLE_MS;
113378
+ } catch {
113379
+ return false;
113380
+ }
113381
+ }
113382
+ takeSlot() {
113383
+ const path2 = path$1.join(configDir(this.env), THROTTLE_FILE);
113384
+ const stamp = this.now();
113385
+ try {
113386
+ fs.mkdirSync(path$1.join(configDir(this.env), "run"), { recursive: true });
113387
+ fs.closeSync(fs.openSync(path2, "a"));
113388
+ fs.utimesSync(path2, stamp / 1e3, stamp / 1e3);
113389
+ } catch {
113390
+ }
113391
+ }
113392
+ /**
113393
+ * The `silent` / `sound` options for a banner about to be shown. Call it
113394
+ * IMMEDIATELY before `new Notification` and show that banner: on the
113395
+ * fallback path it also starts the renderer sound, and it takes the
113396
+ * throttle slot.
113397
+ *
113398
+ * `silent` is the site's own request. A site asking for silence (Team
113399
+ * Bridge's coalesced replacement banner) always gets it and spends no slot.
113400
+ */
113401
+ bannerOptions(silent = false) {
113402
+ if (!this.settled && !this.inFlight) void this.refresh();
113403
+ if (silent) return { silent: true };
113404
+ const plan = this.plan;
113405
+ switch (plan.kind) {
113406
+ case "legacy":
113407
+ case "system":
113408
+ if (this.throttled()) return { silent: true };
113409
+ this.takeSlot();
113410
+ return { silent: false };
113411
+ case "silent":
113412
+ return { silent: true };
113413
+ case "file": {
113414
+ if (this.throttled()) return { silent: true };
113415
+ if (plan.staged) {
113416
+ this.takeSlot();
113417
+ return { silent: false, sound: plan.staged };
113418
+ }
113419
+ if (this.deps.playInRenderer(plan.bytes)) this.takeSlot();
113420
+ return { silent: true };
113421
+ }
113422
+ }
113423
+ }
113424
+ }
113425
+ let service = null;
113426
+ function configureNotificationSound(deps) {
113427
+ service = deps ? new NotificationSoundService(deps) : null;
113428
+ return service;
113429
+ }
113430
+ function notificationSoundOptions(silent = false) {
113431
+ return service ? service.bannerOptions(silent) : { silent };
113432
+ }
113134
113433
  const CONSENT_TITLE = () => t("ui.notices.main.consent_title");
113135
113434
  function consentBody(count, origin) {
113136
113435
  return count === 1 ? t("ui.notices.main.consent_body_one", { origin }) : t("ui.notices.main.consent_body_many", { count });
@@ -113181,7 +113480,8 @@ class ConsentNotifier {
113181
113480
  {
113182
113481
  title: CONSENT_TITLE(),
113183
113482
  body: consentBody(count, oldest.origin),
113184
- silent: false
113483
+ // The configured sound (or none); see `notification-sound.ts`.
113484
+ ...notificationSoundOptions()
113185
113485
  }
113186
113486
  );
113187
113487
  this.lifetime.retain(
@@ -115338,12 +115638,12 @@ const KEY_HEADER = "x-bridge-key";
115338
115638
  const INSTANCE_HEADER = "x-ui-browser-instance";
115339
115639
  const MAX_BODY_BYTES = 1 << 20;
115340
115640
  const LOOPBACK_HOST = "127.0.0.1";
115341
- function send(res, status2, body, contentType = "application/json") {
115641
+ function send(res, status2, body2, contentType = "application/json") {
115342
115642
  res.writeHead(status2, {
115343
115643
  "Content-Type": contentType,
115344
115644
  "Cache-Control": "no-store"
115345
115645
  });
115346
- res.end(typeof body === "string" ? body : JSON.stringify(body));
115646
+ res.end(typeof body2 === "string" ? body2 : JSON.stringify(body2));
115347
115647
  }
115348
115648
  function readBody(req) {
115349
115649
  return new Promise((resolve, reject) => {
@@ -115458,7 +115758,7 @@ async function handle(req, res, options) {
115458
115758
  const url = req.url ?? "";
115459
115759
  try {
115460
115760
  if (req.method === "GET" && url.split("?")[0] === HEALTH_PATH) {
115461
- const body = {
115761
+ const body2 = {
115462
115762
  host: "ui",
115463
115763
  proto: PROTO_VERSION,
115464
115764
  pid: process.pid,
@@ -115474,7 +115774,7 @@ async function handle(req, res, options) {
115474
115774
  // `capability_unsupported` possible without opening a socket.
115475
115775
  capabilities: [...HOST_CAPABILITIES]
115476
115776
  };
115477
- send(res, 200, body);
115777
+ send(res, 200, body2);
115478
115778
  return;
115479
115779
  }
115480
115780
  if (req.method !== "POST" || url.split("?")[0] !== RPC_PATH) {
@@ -118366,9 +118666,9 @@ class DesktopNotifier {
118366
118666
  }
118367
118667
  if (generation !== this.contractGeneration) return;
118368
118668
  if (response?.status === 200) {
118369
- const body = response.body;
118669
+ const body2 = response.body;
118370
118670
  this.applyNotificationContract(
118371
- body?.result?.features?.notification_contract
118671
+ body2?.result?.features?.notification_contract
118372
118672
  );
118373
118673
  this.contractAnswered = true;
118374
118674
  return;
@@ -118665,8 +118965,8 @@ class DesktopNotifier {
118665
118965
  completionToken
118666
118966
  });
118667
118967
  if (response.status !== 200) return "failed";
118668
- const body = response.body;
118669
- return body?.result?.claimed === true ? "won" : "lost";
118968
+ const body2 = response.body;
118969
+ return body2?.result?.claimed === true ? "won" : "lost";
118670
118970
  } catch {
118671
118971
  return "failed";
118672
118972
  }
@@ -118924,12 +119224,13 @@ class DesktopNotifier {
118924
119224
  * still re-words nothing (design 8.4). Gates pass `status = ""` and are
118925
119225
  * unaffected either way.
118926
119226
  */
118927
- show(sessionId2, title, status2, body, isSnippet = false, isFailure = false, surface = null) {
119227
+ show(sessionId2, title, status2, body2, isSnippet = false, isFailure = false, surface = null) {
118928
119228
  const lead = (isSnippet || isFailure) && status2 ? `${status2} — ` : "";
118929
119229
  const notification = new electron.Notification({
118930
119230
  title,
118931
- body: `${lead}${body}`.slice(0, MAX_BODY_CHARS),
118932
- silent: false
119231
+ body: `${lead}${body2}`.slice(0, MAX_BODY_CHARS),
119232
+ // The configured sound (or none); see `notification-sound.ts`.
119233
+ ...notificationSoundOptions()
118933
119234
  });
118934
119235
  this.lifetime.retain(notification, () => {
118935
119236
  const target2 = this.window();
@@ -119445,9 +119746,9 @@ function deviceLocaleFor(appLike) {
119445
119746
  };
119446
119747
  return attempt(appLike?.getPreferredSystemLanguages) ?? attempt(appLike?.getSystemLocale) ?? attempt(appLike?.getLocale);
119447
119748
  }
119448
- function asCapabilitiesAnswer(body) {
119449
- if (body === null || typeof body !== "object") return null;
119450
- const result = body.result;
119749
+ function asCapabilitiesAnswer(body2) {
119750
+ if (body2 === null || typeof body2 !== "object") return null;
119751
+ const result = body2.result;
119451
119752
  return result !== null && typeof result === "object" ? result : null;
119452
119753
  }
119453
119754
  function createMainLocale(options) {
@@ -120879,7 +121180,7 @@ function parseTeamBridgeNotifyRequest(value) {
120879
121180
  const conversationId = cleanId(input.conversationId);
120880
121181
  const tenantId = cleanId(input.tenantId);
120881
121182
  const title = cleanText(input.title, TEAM_BRIDGE_NOTIFY_MAX_TITLE);
120882
- const body = cleanText(input.body, TEAM_BRIDGE_NOTIFY_MAX_BODY);
121183
+ const body2 = cleanText(input.body, TEAM_BRIDGE_NOTIFY_MAX_BODY);
120883
121184
  const seq2 = input.seq;
120884
121185
  const sender = parseTeamBridgeNotificationSender(input.sender);
120885
121186
  const subtitle = input.subtitle === void 0 ? void 0 : cleanText(input.subtitle, TEAM_BRIDGE_NOTIFY_MAX_SUBTITLE);
@@ -120889,7 +121190,7 @@ function parseTeamBridgeNotifyRequest(value) {
120889
121190
  if (subtitle === null || threadId === null || messageId === null || viewing !== void 0 && typeof viewing !== "boolean") {
120890
121191
  return null;
120891
121192
  }
120892
- if (!owner?.accountId || conversationId === null || tenantId === null || title === null || body === null || typeof seq2 !== "number" || !Number.isSafeInteger(seq2) || seq2 < 0 || seq2 > MAX_SEQ) {
121193
+ if (!owner?.accountId || conversationId === null || tenantId === null || title === null || body2 === null || typeof seq2 !== "number" || !Number.isSafeInteger(seq2) || seq2 < 0 || seq2 > MAX_SEQ) {
120893
121194
  return null;
120894
121195
  }
120895
121196
  return {
@@ -120897,7 +121198,7 @@ function parseTeamBridgeNotifyRequest(value) {
120897
121198
  conversationId,
120898
121199
  tenantId,
120899
121200
  title,
120900
- body,
121201
+ body: body2,
120901
121202
  seq: seq2,
120902
121203
  ...sender ? { sender } : {},
120903
121204
  ...subtitle === void 0 ? {} : { subtitle },
@@ -121492,7 +121793,9 @@ class TeamBridgeNotifier {
121492
121793
  { ...request, title },
121493
121794
  this.options.platform ?? process.platform
121494
121795
  ),
121495
- silent: burst,
121796
+ // A coalesced replacement stays silent ("no second sound"); otherwise
121797
+ // the configured sound (or none), see `notification-sound.ts`.
121798
+ ...notificationSoundOptions(burst),
121496
121799
  ...icon2 ? { icon: icon2 } : {}
121497
121800
  });
121498
121801
  const conversationId = request.conversationId;
@@ -121882,11 +122185,11 @@ function serveOnTarget(bootVersion, installVersion, target2) {
121882
122185
  const order = compareVersions(boot, installed);
121883
122186
  return order === null ? boot === installed : order >= 0;
121884
122187
  }
121885
- function runtimeStragglerCount(body, current) {
122188
+ function runtimeStragglerCount(body2, current) {
121886
122189
  const currentBuild = current?.trim() ?? "";
121887
122190
  if (currentBuild === "") return null;
121888
- if (!isRecord(body)) return null;
121889
- const result = body.result;
122191
+ if (!isRecord(body2)) return null;
122192
+ const result = body2.result;
121890
122193
  if (!isRecord(result)) return null;
121891
122194
  const runtimes = result.runtimes;
121892
122195
  if (!Array.isArray(runtimes)) return null;
@@ -122477,9 +122780,9 @@ function rememberReleaseNotes(cache, notes) {
122477
122780
  function cachedReleaseNotes(cache, version) {
122478
122781
  return cache[String(version ?? "").trim()] ?? null;
122479
122782
  }
122480
- function summariseReleaseBody(body, limit = SUMMARY_LIMIT) {
122481
- if (typeof body !== "string") return null;
122482
- const blocks = body.replace(CRLF, "\n").split(BLANK_LINE);
122783
+ function summariseReleaseBody(body2, limit = SUMMARY_LIMIT) {
122784
+ if (typeof body2 !== "string") return null;
122785
+ const blocks = body2.replace(CRLF, "\n").split(BLANK_LINE);
122483
122786
  for (const block of blocks) {
122484
122787
  const text2 = flattenBlock(block);
122485
122788
  if (text2 && !isMachineRow(text2)) return truncateSummary(text2, limit);
@@ -123099,7 +123402,8 @@ function bannerReportedShown(notice, deadlineMs) {
123099
123402
  const notification = new electron.Notification({
123100
123403
  title: notice.title,
123101
123404
  body: notice.body,
123102
- silent: false
123405
+ // The configured sound (or none); see `notification-sound.ts`.
123406
+ ...notificationSoundOptions()
123103
123407
  });
123104
123408
  notification.on("show", () => {
123105
123409
  clearTimeout(deadline2);
@@ -131024,6 +131328,17 @@ electron.app.whenReady().then(async () => {
131024
131328
  return response;
131025
131329
  }
131026
131330
  );
131331
+ const notificationSound = configureNotificationSound({
131332
+ request: (input) => backendService.requestDesktop(input),
131333
+ media: (input) => backendService.requestDesktopMedia(input, null),
131334
+ playInRenderer: (bytes) => {
131335
+ const window = mainWindow;
131336
+ if (!window || window.isDestroyed()) return false;
131337
+ window.webContents.send(NOTIFICATION_SOUND_PLAY_CHANNEL, bytes);
131338
+ return true;
131339
+ },
131340
+ log: (line) => logger.info(line, LogFileType.BACKEND)
131341
+ });
131027
131342
  const desktopNotifier = new DesktopNotifier(
131028
131343
  () => mainWindow,
131029
131344
  sendDesktop,
@@ -131113,15 +131428,16 @@ electron.app.whenReady().then(async () => {
131113
131428
  notificationEndpointAvatarAvailable = false;
131114
131429
  notificationImages.clear();
131115
131430
  void backendService.requestDesktop({ op: "capabilities" }).then((response) => {
131116
- const body = response.body;
131431
+ const body2 = response.body;
131117
131432
  notificationAvatarAvailable = Number(
131118
- body?.result?.features?.team_bridge_notification_avatar ?? 0
131433
+ body2?.result?.features?.team_bridge_notification_avatar ?? 0
131119
131434
  ) >= 1;
131120
- notificationEndpointAvatarAvailable = Number(body?.result?.features?.team_bridge_endpoint_avatar ?? 0) >= 1;
131435
+ notificationEndpointAvatarAvailable = Number(body2?.result?.features?.team_bridge_endpoint_avatar ?? 0) >= 1;
131121
131436
  if (notificationAvatarAvailable)
131122
131437
  teamBridgeNotifier.replayDirectories();
131123
131438
  }).catch(() => void 0);
131124
131439
  void mainLocale.refresh();
131440
+ void notificationSound?.refresh();
131125
131441
  void desktopNotifier.refreshNotificationContract();
131126
131442
  void backendService.getDesktopFeedRelay().start();
131127
131443
  void publishViewerPresence();
@@ -131153,6 +131469,8 @@ electron.app.whenReady().then(async () => {
131153
131469
  if (frame.type === "config" && frame.payload.changed_keys.includes(LANGUAGE_SETTING_KEY)) {
131154
131470
  void mainLocale.refresh();
131155
131471
  }
131472
+ if (frame.type === "config")
131473
+ notificationSound?.observeConfigChange(frame.payload.changed_keys);
131156
131474
  const window = mainWindow;
131157
131475
  if (!window || window.isDestroyed()) return;
131158
131476
  window.webContents.send("desktop-feed-frame", frame);
@@ -131210,8 +131528,8 @@ electron.app.whenReady().then(async () => {
131210
131528
  const response = await backendService.requestDesktop({
131211
131529
  op: "capabilities"
131212
131530
  });
131213
- const body = response.body;
131214
- features = body?.result?.features;
131531
+ const body2 = response.body;
131532
+ features = body2?.result?.features;
131215
131533
  } catch {
131216
131534
  return;
131217
131535
  }
@@ -131364,9 +131682,9 @@ electron.app.whenReady().then(async () => {
131364
131682
  null
131365
131683
  );
131366
131684
  if (response.kind !== "json") return { html: null };
131367
- const body = response.body;
131685
+ const body2 = response.body;
131368
131686
  return {
131369
- html: body && typeof body.html === "string" ? body.html : null
131687
+ html: body2 && typeof body2.html === "string" ? body2.html : null
131370
131688
  };
131371
131689
  },
131372
131690
  (m) => logger.warn(m, LogFileType.BACKEND)