@belonguniverseai/react-sdk 0.4.0 → 0.4.1

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 (73) hide show
  1. package/dist/api/client.d.ts +237 -0
  2. package/dist/api/queries.d.ts +16 -0
  3. package/dist/api/query-keys.d.ts +1 -0
  4. package/dist/api/task-schedules.d.ts +3 -3
  5. package/dist/component/{arc-BhIvhaIH.js → arc-Du1-HUt0.js} +2 -2
  6. package/dist/component/{architectureDiagram-3BPJPVTR-BWNCirdr.js → architectureDiagram-3BPJPVTR-NTFoFNN-.js} +3 -3
  7. package/dist/component/{blockDiagram-GPEHLZMM-BnslF4z5.js → blockDiagram-GPEHLZMM-9LBL4EUV.js} +4 -4
  8. package/dist/component/{c4Diagram-AAUBKEIU-ByIoAzxn.js → c4Diagram-AAUBKEIU-C1enIoRg.js} +3 -3
  9. package/dist/component/{channel-BSkI2ZMQ.js → channel-CNnOkAN_.js} +2 -2
  10. package/dist/component/{chunk-2J33WTMH-DdP5frJt.js → chunk-2J33WTMH-X2Iy3mMD.js} +2 -2
  11. package/dist/component/{chunk-4BX2VUAB-DlsylVfZ.js → chunk-4BX2VUAB-BLlcE09Q.js} +2 -2
  12. package/dist/component/{chunk-55IACEB6-CcJHjxtI.js → chunk-55IACEB6-23v_td5T.js} +2 -2
  13. package/dist/component/{chunk-727SXJPM-IzRNu9Aj.js → chunk-727SXJPM-BC2kAa1t.js} +6 -6
  14. package/dist/component/{chunk-AQP2D5EJ-DmcGMHHV.js → chunk-AQP2D5EJ-CsRFVdwF.js} +4 -4
  15. package/dist/component/{chunk-FMBD7UC4-T7thtdBK.js → chunk-FMBD7UC4-CWrggihb.js} +2 -2
  16. package/dist/component/{chunk-ND2GUHAM-Dm_d0Ags.js → chunk-ND2GUHAM-Bj78QMsn.js} +2 -2
  17. package/dist/component/{chunk-QZHKN3VN-D2PGEfVN.js → chunk-QZHKN3VN-CS_FAlLS.js} +2 -2
  18. package/dist/component/{classDiagram-4FO5ZUOK-Bn7KwDp9.js → classDiagram-4FO5ZUOK-ci84KOU1.js} +3 -3
  19. package/dist/component/{classDiagram-v2-Q7XG4LA2-Bn7KwDp9.js → classDiagram-v2-Q7XG4LA2-ci84KOU1.js} +3 -3
  20. package/dist/component/{cose-bilkent-S5V4N54A-BtDuNpUN.js → cose-bilkent-S5V4N54A-QLIj0pt2.js} +2 -2
  21. package/dist/component/{dagre-BM42HDAG-BknZdIOQ.js → dagre-BM42HDAG-D32wP-VH.js} +2 -2
  22. package/dist/component/{diagram-2AECGRRQ-ISHN0dHe.js → diagram-2AECGRRQ-Dn47q_hT.js} +3 -3
  23. package/dist/component/{diagram-5GNKFQAL-7gWbpLCQ.js → diagram-5GNKFQAL-Df7a_ICg.js} +4 -4
  24. package/dist/component/{diagram-KO2AKTUF-B63ZLzkh.js → diagram-KO2AKTUF-CNcoKufc.js} +3 -3
  25. package/dist/component/{diagram-LMA3HP47-hhw0MjoS.js → diagram-LMA3HP47-Dq8j6XNs.js} +3 -3
  26. package/dist/component/{diagram-OG6HWLK6-D_L9Gvuh.js → diagram-OG6HWLK6-CZ1WglbZ.js} +4 -4
  27. package/dist/component/{erDiagram-TEJ5UH35-BAg27ZHd.js → erDiagram-TEJ5UH35-CDlHARAu.js} +5 -5
  28. package/dist/component/{flowDiagram-I6XJVG4X-DDYjK7xG.js → flowDiagram-I6XJVG4X-Cw1mKy8X.js} +7 -7
  29. package/dist/component/{ganttDiagram-6RSMTGT7-CDNAiKQG.js → ganttDiagram-6RSMTGT7-B3FUForj.js} +3 -3
  30. package/dist/component/{gitGraphDiagram-PVQCEYII-CY1N7jOJ.js → gitGraphDiagram-PVQCEYII-BgHuuQ27.js} +4 -4
  31. package/dist/component/{highlighted-body-OFNGDK62-DHwLnkF_.js → highlighted-body-OFNGDK62-BTv_Fxf3.js} +2 -2
  32. package/dist/component/index.js +2 -2
  33. package/dist/component/{infoDiagram-5YYISTIA-Cbgk6g6j.js → infoDiagram-5YYISTIA-DE9i_OcK.js} +2 -2
  34. package/dist/component/{ishikawaDiagram-YF4QCWOH-BUfiorJj.js → ishikawaDiagram-YF4QCWOH-BDe88Hz2.js} +2 -2
  35. package/dist/component/{journeyDiagram-JHISSGLW-Bh4IizEm.js → journeyDiagram-JHISSGLW-D3t45UC1.js} +5 -5
  36. package/dist/component/{kanban-definition-UN3LZRKU-CgWqLfFM.js → kanban-definition-UN3LZRKU-DfFJIuhU.js} +3 -3
  37. package/dist/component/{linear-D1rJivs3.js → linear-AXxuun7R.js} +2 -2
  38. package/dist/component/{mermaid-GHXKKRXX-iO2IZZUN.js → mermaid-GHXKKRXX-D7NVqIBP.js} +29725 -29037
  39. package/dist/component/{mindmap-definition-RKZ34NQL-DeQED-9b.js → mindmap-definition-RKZ34NQL-cTac4kYU.js} +4 -4
  40. package/dist/component/{pieDiagram-4H26LBE5-CZ5Zt_mz.js → pieDiagram-4H26LBE5-B1SubLQb.js} +4 -4
  41. package/dist/component/{quadrantDiagram-W4KKPZXB-Dib1AukJ.js → quadrantDiagram-W4KKPZXB-CzyBW8Cr.js} +3 -3
  42. package/dist/component/{requirementDiagram-4Y6WPE33-DubjTJYS.js → requirementDiagram-4Y6WPE33-DgS33NcX.js} +4 -4
  43. package/dist/component/{sankeyDiagram-5OEKKPKP-Cq2S3XKs.js → sankeyDiagram-5OEKKPKP-Cp4o_akq.js} +2 -2
  44. package/dist/component/{sequenceDiagram-3UESZ5HK-BUo5k0zn.js → sequenceDiagram-3UESZ5HK-2gf91-2b.js} +4 -4
  45. package/dist/component/{stateDiagram-AJRCARHV-DJwQp0D7.js → stateDiagram-AJRCARHV-BByZezJw.js} +3 -3
  46. package/dist/component/{stateDiagram-v2-BHNVJYJU-BX77P5aq.js → stateDiagram-v2-BHNVJYJU-B-IObShO.js} +3 -3
  47. package/dist/component/{timeline-definition-PNZ67QCA-DnQ481VI.js → timeline-definition-PNZ67QCA-D_2NG1sj.js} +3 -3
  48. package/dist/component/{vennDiagram-CIIHVFJN-BQ0X92lQ.js → vennDiagram-CIIHVFJN-BjrQUaEs.js} +2 -2
  49. package/dist/component/{wardleyDiagram-YWT4CUSO-CMTnjVTA.js → wardleyDiagram-YWT4CUSO-DYcvfAeQ.js} +3 -3
  50. package/dist/component/{xychartDiagram-2RQKCTM6-BLSiRWug.js → xychartDiagram-2RQKCTM6-CtLaJFtQ.js} +3 -3
  51. package/dist/components/embed/EmbedAvatar.d.ts +8 -1
  52. package/dist/components/embed/EmbedHeader.d.ts +25 -2
  53. package/dist/components/embed/EmbedRail.d.ts +12 -4
  54. package/dist/components/embed/EmbedSessions.d.ts +13 -2
  55. package/dist/components/embed/MobileNavBar.d.ts +4 -1
  56. package/dist/components/embed/SessionStatsPanel.d.ts +12 -0
  57. package/dist/components/embed/rail-flags.d.ts +23 -0
  58. package/dist/embed/adoption-notice.d.ts +10 -0
  59. package/dist/embed/presets.d.ts +10 -0
  60. package/dist/embed/theme.d.ts +13 -0
  61. package/dist/embed/voice/line-dispatch.d.ts +21 -0
  62. package/dist/embed/voice/line-run-reader.d.ts +16 -1
  63. package/dist/embed/voice/line-slots.d.ts +42 -4
  64. package/dist/embed/voice-call-lines.d.ts +33 -3
  65. package/dist/i18n/messages/en.d.ts +22 -0
  66. package/dist/i18n/messages/surfaces/header.d.ts +12 -0
  67. package/dist/i18n/messages/surfaces/sessions.d.ts +3 -0
  68. package/dist/i18n/messages/surfaces/stats.d.ts +55 -0
  69. package/dist/stream/belong-chat-transport.d.ts +19 -8
  70. package/dist/stream/chat-export-store.d.ts +35 -0
  71. package/dist/stream/session-stats-csv.d.ts +52 -0
  72. package/dist/stream/stream-state-store.d.ts +30 -1
  73. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import { g as oe } from "./chunk-55IACEB6-CcJHjxtI.js";
2
- import { s as ae } from "./chunk-2J33WTMH-DdP5frJt.js";
3
- import { _ as l, l as C, p as ce, r as le, G as he, K as G, c as B, i as F, b6 as de, af as ge, ag as ue, ah as pe } from "./mermaid-GHXKKRXX-iO2IZZUN.js";
1
+ import { g as oe } from "./chunk-55IACEB6-23v_td5T.js";
2
+ import { s as ae } from "./chunk-2J33WTMH-X2Iy3mMD.js";
3
+ import { _ as l, l as C, p as ce, r as le, G as he, K as G, c as B, i as F, b6 as de, af as ge, ag as ue, ah as pe } from "./mermaid-GHXKKRXX-D7NVqIBP.js";
4
4
  globalThis.process = globalThis.process || { env: {} };
5
5
  globalThis.global = globalThis.global || globalThis;
6
6
  const b = [];
@@ -830,4 +830,4 @@ var _e = Y, ke = 12, N = {
830
830
  export {
831
831
  we as diagram
832
832
  };
833
- //# sourceMappingURL=mindmap-definition-RKZ34NQL-DeQED-9b.js.map
833
+ //# sourceMappingURL=mindmap-definition-RKZ34NQL-cTac4kYU.js.map
@@ -1,7 +1,7 @@
1
- import { a0 as S, S as R, b5 as J, g as Q, s as Y, a as tt, b as et, t as at, q as nt, _ as g, l as W, c as rt, I as it, N as st, a7 as lt, e as ot, B as ct, K as ut } from "./mermaid-GHXKKRXX-iO2IZZUN.js";
2
- import { p as gt } from "./chunk-4BX2VUAB-DlsylVfZ.js";
1
+ import { a0 as S, S as R, b5 as J, g as Q, s as Y, a as tt, b as et, t as at, q as nt, _ as g, l as W, c as rt, I as it, N as st, a7 as lt, e as ot, B as ct, K as ut } from "./mermaid-GHXKKRXX-D7NVqIBP.js";
2
+ import { p as gt } from "./chunk-4BX2VUAB-BLlcE09Q.js";
3
3
  import { p as dt } from "./wardley-L42UT6IY-HA1eSIS_.js";
4
- import { d as P } from "./arc-BhIvhaIH.js";
4
+ import { d as P } from "./arc-Du1-HUt0.js";
5
5
  import { o as pt } from "./ordinal-D0x7izaa.js";
6
6
  globalThis.process = globalThis.process || { env: {} };
7
7
  globalThis.global = globalThis.global || globalThis;
@@ -163,4 +163,4 @@ var vt = ut.pie, z = {
163
163
  export {
164
164
  Lt as diagram
165
165
  };
166
- //# sourceMappingURL=pieDiagram-4H26LBE5-CZ5Zt_mz.js.map
166
+ //# sourceMappingURL=pieDiagram-4H26LBE5-B1SubLQb.js.map
@@ -1,5 +1,5 @@
1
- import { s as Se, g as _e, t as ee, q as Ae, a as ke, b as Fe, _ as r, c as Et, l as qt, d as vt, e as Pe, B as ve, K as z, i as Ce, a4 as Le } from "./mermaid-GHXKKRXX-iO2IZZUN.js";
2
- import { l as te } from "./linear-D1rJivs3.js";
1
+ import { s as Se, g as _e, t as ee, q as Ae, a as ke, b as Fe, _ as r, c as Et, l as qt, d as vt, e as Pe, B as ve, K as z, i as Ce, a4 as Le } from "./mermaid-GHXKKRXX-D7NVqIBP.js";
2
+ import { l as te } from "./linear-AXxuun7R.js";
3
3
  globalThis.process = globalThis.process || { env: {} };
4
4
  globalThis.global = globalThis.global || globalThis;
5
5
  var Ct = (function() {
@@ -1030,4 +1030,4 @@ var Ve = /* @__PURE__ */ r(function() {
1030
1030
  export {
1031
1031
  We as diagram
1032
1032
  };
1033
- //# sourceMappingURL=quadrantDiagram-W4KKPZXB-Dib1AukJ.js.map
1033
+ //# sourceMappingURL=quadrantDiagram-W4KKPZXB-CzyBW8Cr.js.map
@@ -1,6 +1,6 @@
1
- import { g as Ge } from "./chunk-55IACEB6-CcJHjxtI.js";
2
- import { s as ze } from "./chunk-2J33WTMH-DdP5frJt.js";
3
- import { _ as h, G as Ye, b as Xe, a as Je, s as Ze, g as et, q as tt, t as st, c as ke, l as Ne, B as it, F as rt, p as nt, r as at, u as lt } from "./mermaid-GHXKKRXX-iO2IZZUN.js";
1
+ import { g as Ge } from "./chunk-55IACEB6-23v_td5T.js";
2
+ import { s as ze } from "./chunk-2J33WTMH-X2Iy3mMD.js";
3
+ import { _ as h, G as Ye, b as Xe, a as Je, s as Ze, g as et, q as tt, t as st, c as ke, l as Ne, B as it, F as rt, p as nt, r as at, u as lt } from "./mermaid-GHXKKRXX-D7NVqIBP.js";
4
4
  globalThis.process = globalThis.process || { env: {} };
5
5
  globalThis.global = globalThis.global || globalThis;
6
6
  var qe = (function() {
@@ -885,4 +885,4 @@ var mt = /* @__PURE__ */ h(async function(e, u, o, n) {
885
885
  export {
886
886
  Rt as diagram
887
887
  };
888
- //# sourceMappingURL=requirementDiagram-4Y6WPE33-DubjTJYS.js.map
888
+ //# sourceMappingURL=requirementDiagram-4Y6WPE33-DgS33NcX.js.map
@@ -1,4 +1,4 @@
1
- import { q as kt, t as mt, s as xt, g as _t, b as vt, a as bt, _ as y, c as ot, C as St, d as G, ai as wt, B as Lt, k as Et } from "./mermaid-GHXKKRXX-iO2IZZUN.js";
1
+ import { q as kt, t as mt, s as xt, g as _t, b as vt, a as bt, _ as y, c as ot, C as St, d as G, ai as wt, B as Lt, k as Et } from "./mermaid-GHXKKRXX-D7NVqIBP.js";
2
2
  import { o as Tt } from "./ordinal-D0x7izaa.js";
3
3
  globalThis.process = globalThis.process || { env: {} };
4
4
  globalThis.global = globalThis.global || globalThis;
@@ -859,4 +859,4 @@ var ge = {
859
859
  export {
860
860
  ge as diagram
861
861
  };
862
- //# sourceMappingURL=sankeyDiagram-5OEKKPKP-Cq2S3XKs.js.map
862
+ //# sourceMappingURL=sankeyDiagram-5OEKKPKP-Cp4o_akq.js.map
@@ -1,6 +1,6 @@
1
- import { _ as g, o as tr, c as $, d as Mt, l as at, j as Ce, e as er, f as rr, k as P, b as ke, s as ar, q as sr, a as ir, g as nr, t as or, v as cr, J as lr, B as hr, i as Bt, u as Z, a5 as Q, a6 as wt, a7 as Me, a8 as dr, G as Yt, a9 as Tr, aa as Be } from "./mermaid-GHXKKRXX-iO2IZZUN.js";
2
- import { a as pr, b as ee, g as dt, d as Er, e as re, f as ae } from "./chunk-ND2GUHAM-Dm_d0Ags.js";
3
- import { I as ur } from "./chunk-QZHKN3VN-D2PGEfVN.js";
1
+ import { _ as g, o as tr, c as $, d as Mt, l as at, j as Ce, e as er, f as rr, k as P, b as ke, s as ar, q as sr, a as ir, g as nr, t as or, v as cr, J as lr, B as hr, i as Bt, u as Z, a5 as Q, a6 as wt, a7 as Me, a8 as dr, G as Yt, a9 as Tr, aa as Be } from "./mermaid-GHXKKRXX-D7NVqIBP.js";
2
+ import { a as pr, b as ee, g as dt, d as Er, e as re, f as ae } from "./chunk-ND2GUHAM-Bj78QMsn.js";
3
+ import { I as ur } from "./chunk-QZHKN3VN-CS_FAlLS.js";
4
4
  globalThis.process = globalThis.process || { env: {} };
5
5
  globalThis.global = globalThis.global || globalThis;
6
6
  var $t = (function() {
@@ -2894,4 +2894,4 @@ var ra = /* @__PURE__ */ g(async function(e, t, a) {
2894
2894
  export {
2895
2895
  Ta as diagram
2896
2896
  };
2897
- //# sourceMappingURL=sequenceDiagram-3UESZ5HK-BUo5k0zn.js.map
2897
+ //# sourceMappingURL=sequenceDiagram-3UESZ5HK-2gf91-2b.js.map
@@ -1,5 +1,5 @@
1
- import { s as R, a as W, S as N } from "./chunk-AQP2D5EJ-DmcGMHHV.js";
2
- import { _ as f, c as t, d as M, l as S, e as P, k as z, ac as _, ad as U, a9 as C, u as F } from "./mermaid-GHXKKRXX-iO2IZZUN.js";
1
+ import { s as R, a as W, S as N } from "./chunk-AQP2D5EJ-CsRFVdwF.js";
2
+ import { _ as f, c as t, d as M, l as S, e as P, k as z, ac as _, ad as U, a9 as C, u as F } from "./mermaid-GHXKKRXX-D7NVqIBP.js";
3
3
  import { G as O } from "./graph-BZLHvygk.js";
4
4
  import { l as J } from "./layout-Bu6nRdWm.js";
5
5
  globalThis.process = globalThis.process || { env: {} };
@@ -263,4 +263,4 @@ var X = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state")
263
263
  export {
264
264
  ot as diagram
265
265
  };
266
- //# sourceMappingURL=stateDiagram-AJRCARHV-DJwQp0D7.js.map
266
+ //# sourceMappingURL=stateDiagram-AJRCARHV-BByZezJw.js.map
@@ -1,5 +1,5 @@
1
- import { s as e, b as r, a as s, S as t } from "./chunk-AQP2D5EJ-DmcGMHHV.js";
2
- import { _ as l } from "./mermaid-GHXKKRXX-iO2IZZUN.js";
1
+ import { s as e, b as r, a as s, S as t } from "./chunk-AQP2D5EJ-CsRFVdwF.js";
2
+ import { _ as l } from "./mermaid-GHXKKRXX-D7NVqIBP.js";
3
3
  globalThis.process = globalThis.process || { env: {} };
4
4
  globalThis.global = globalThis.global || globalThis;
5
5
  var b = {
@@ -16,4 +16,4 @@ var b = {
16
16
  export {
17
17
  b as diagram
18
18
  };
19
- //# sourceMappingURL=stateDiagram-v2-BHNVJYJU-BX77P5aq.js.map
19
+ //# sourceMappingURL=stateDiagram-v2-BHNVJYJU-B-IObShO.js.map
@@ -1,5 +1,5 @@
1
- import { _ as o, G as gt, af as Rt, ag as Ct, ah as Wt, c as pt, l as E, N as Pt, a7 as Bt, ai as ft, d as U, F as Vt, aj as Ft, B as zt } from "./mermaid-GHXKKRXX-iO2IZZUN.js";
2
- import { d as ot } from "./arc-BhIvhaIH.js";
1
+ import { _ as o, G as gt, af as Rt, ag as Ct, ah as Wt, c as pt, l as E, N as Pt, a7 as Bt, ai as ft, d as U, F as Vt, aj as Ft, B as zt } from "./mermaid-GHXKKRXX-D7NVqIBP.js";
2
+ import { d as ot } from "./arc-Du1-HUt0.js";
3
3
  globalThis.process = globalThis.process || { env: {} };
4
4
  globalThis.global = globalThis.global || globalThis;
5
5
  var tt = (function() {
@@ -1055,4 +1055,4 @@ var Qt = /* @__PURE__ */ o(function(e, t, n, i, r, h = !1) {
1055
1055
  export {
1056
1056
  me as diagram
1057
1057
  };
1058
- //# sourceMappingURL=timeline-definition-PNZ67QCA-DnQ481VI.js.map
1058
+ //# sourceMappingURL=timeline-definition-PNZ67QCA-D_2NG1sj.js.map
@@ -1,4 +1,4 @@
1
- import { aX as Gt, s as Wt, g as Kt, t as Ht, q as Xt, a as Yt, b as Zt, _ as w, G as wt, N as Jt, d as ot, ao as Qt, af as $t, ag as te, ah as ee, e as ne, B as se, I as ie, K as oe } from "./mermaid-GHXKKRXX-iO2IZZUN.js";
1
+ import { aX as Gt, s as Wt, g as Kt, t as Ht, q as Xt, a as Yt, b as Zt, _ as w, G as wt, N as Jt, d as ot, ao as Qt, af as $t, ag as te, ah as ee, e as ne, B as se, I as ie, K as oe } from "./mermaid-GHXKKRXX-D7NVqIBP.js";
2
2
  globalThis.process = globalThis.process || { env: {} };
3
3
  globalThis.global = globalThis.global || globalThis;
4
4
  const kt = (t, n) => Gt(t, "a", -n), _t = 1e-10;
@@ -1557,4 +1557,4 @@ var qe = { draw: Ve }, Ge = {
1557
1557
  export {
1558
1558
  Ge as diagram
1559
1559
  };
1560
- //# sourceMappingURL=vennDiagram-CIIHVFJN-BQ0X92lQ.js.map
1560
+ //# sourceMappingURL=vennDiagram-CIIHVFJN-BjrQUaEs.js.map
@@ -1,5 +1,5 @@
1
- import { s as St, g as Mt, t as Nt, q as Tt, a as zt, b as Lt, _ as u, a4 as At, G as Xt, I as U, l as K, N as Et, e as Yt, B as It, c as j } from "./mermaid-GHXKKRXX-iO2IZZUN.js";
2
- import { p as Bt } from "./chunk-4BX2VUAB-DlsylVfZ.js";
1
+ import { s as St, g as Mt, t as Nt, q as Tt, a as zt, b as Lt, _ as u, a4 as At, G as Xt, I as U, l as K, N as Et, e as Yt, B as It, c as j } from "./mermaid-GHXKKRXX-D7NVqIBP.js";
2
+ import { p as Bt } from "./chunk-4BX2VUAB-BLlcE09Q.js";
3
3
  import { p as Ft } from "./wardley-L42UT6IY-HA1eSIS_.js";
4
4
  globalThis.process = globalThis.process || { env: {} };
5
5
  globalThis.global = globalThis.global || globalThis;
@@ -678,4 +678,4 @@ var Dt = {
678
678
  export {
679
679
  Qt as diagram
680
680
  };
681
- //# sourceMappingURL=wardleyDiagram-YWT4CUSO-CMTnjVTA.js.map
681
+ //# sourceMappingURL=wardleyDiagram-YWT4CUSO-DYcvfAeQ.js.map
@@ -1,7 +1,7 @@
1
- import { s as ei, g as si, t as Lt, q as ni, a as ai, b as oi, _ as a, l as Et, N as ri, e as hi, B as li, G as dt, i as ci, I as It, K as ui, a4 as gi, ap as xi, ac as Rt } from "./mermaid-GHXKKRXX-iO2IZZUN.js";
1
+ import { s as ei, g as si, t as Lt, q as ni, a as ai, b as oi, _ as a, l as Et, N as ri, e as hi, B as li, G as dt, i as ci, I as It, K as ui, a4 as gi, ap as xi, ac as Rt } from "./mermaid-GHXKKRXX-D7NVqIBP.js";
2
2
  import { i as di } from "./init-BOu0eQYQ.js";
3
3
  import { o as fi } from "./ordinal-D0x7izaa.js";
4
- import { l as Dt } from "./linear-D1rJivs3.js";
4
+ import { l as Dt } from "./linear-AXxuun7R.js";
5
5
  globalThis.process = globalThis.process || { env: {} };
6
6
  globalThis.global = globalThis.global || globalThis;
7
7
  function pi(t, i, e) {
@@ -1372,4 +1372,4 @@ var Ti = /* @__PURE__ */ a(function() {
1372
1372
  export {
1373
1373
  Mi as diagram
1374
1374
  };
1375
- //# sourceMappingURL=xychartDiagram-2RQKCTM6-BLSiRWug.js.map
1375
+ //# sourceMappingURL=xychartDiagram-2RQKCTM6-CtLaJFtQ.js.map
@@ -8,7 +8,7 @@ import { BelongTheme, BelongThemePalette, PresetName } from '../../types/public.
8
8
  * colour + custom CSS), then Log out. Gradient is brand-driven (Ocean → Deep
9
9
  * Sea) via the active palette.
10
10
  */
11
- export declare function EmbedAvatar({ user, size, theme, palette, side, menuSide: menuSideOverride, sessionId, voiceSupported, sessions, accent, cssVars, presets, activePreset, onToggleMode, onToggleSide, onAccentChange, onAccentReset, onCssVarsChange, onApplyPreset, onLogout, onNewSession, onSelectSession, onDeleteSession, onRenameSession, onSessionsOpen, }: {
11
+ export declare function EmbedAvatar({ user, size, theme, palette, side, menuSide: menuSideOverride, sessionId, voiceSupported, sessions, accent, cssVars, presets, activePreset, onToggleMode, onToggleSide, onAccentChange, onAccentReset, onCssVarsChange, onApplyPreset, onLogout, onNewSession, onSelectSession, onDeleteSession, onRenameSession, onSessionsOpen, onViewStats, sessionAgentLine, }: {
12
12
  user: string | null;
13
13
  size?: number;
14
14
  theme: BelongTheme;
@@ -47,4 +47,11 @@ export declare function EmbedAvatar({ user, size, theme, palette, side, menuSide
47
47
  /** Fired when the History submenu opens — the dock refetches the list so
48
48
  * it's fresh (mirrors EmbedSessions' own `onOpen`). */
49
49
  onSessionsOpen?: () => void;
50
+ /** Open the per-session stats dialog (plan 2026-07-24). Optional so the
51
+ * avatar menu still renders without the dock's panel host wired up. */
52
+ onViewStats?: (sessionId: string) => void;
53
+ /** sessionId -> the agent line currently bound to it (F3) — threaded
54
+ * straight through to the History submenu's `EmbedSessionsBody` so an
55
+ * already-open row wears its "Agent N" badge. */
56
+ sessionAgentLine?: ReadonlyMap<string, number>;
50
57
  }): import("react").JSX.Element;
@@ -2,10 +2,33 @@ import { BelongThemeBrand, BelongThemePalette } from '../../types/public.ts';
2
2
  /**
3
3
  * Slim brand bar at the top of the chat: the mark + the brand/view title, with
4
4
  * a small "by Belong" tagline when a tenant brand is active. Action controls
5
- * live in the rail (EmbedRail), not here.
5
+ * live in the rail (EmbedRail), not here — with TWO exceptions:
6
+ * • `onExportChat` — download the current conversation as JSON. Stateful:
7
+ * while the backend generates the export the button shows a spinner and
8
+ * is disabled; the label (aria + hover title) carries the timestamp of
9
+ * the session's last export when one exists.
10
+ * • `onCloseChat` — the in-surface way to close the CURRENT agent chat.
11
+ * The dock passes it only while the chat view is up AND more than one
12
+ * agent chat exists (closing the only conversation is meaningless — there
13
+ * is nothing to fall back to), so the single-chat header stays exactly as
14
+ * it always was.
6
15
  */
7
- export declare function EmbedHeader({ title, palette, brand, }: {
16
+ export declare function EmbedHeader({ title, palette, brand, onExportChat, exportState, exportChatLabel, onCloseChat, closeChatLabel, }: {
8
17
  title: string;
9
18
  palette: BelongThemePalette;
10
19
  brand: BelongThemeBrand;
20
+ /** Request a chat export (rendered only when provided — chat view with a
21
+ * server-bound session). Disabled while `exportState` is "generating". */
22
+ onExportChat?: () => void;
23
+ exportState?: "idle" | "generating";
24
+ /** Accessible name + hover title for the export control. Carries the last
25
+ * export timestamp when the session has one. Required with `onExportChat`. */
26
+ exportChatLabel?: string;
27
+ /** Close the current agent chat (release its line, fall back to the next
28
+ * agent). Rendered only when provided — see the component doc for the
29
+ * dock's gating rule. */
30
+ onCloseChat?: () => void;
31
+ /** Accessible name for the close control (carries the agent's identity,
32
+ * e.g. "Close Agent 2 — invoices"). Required alongside `onCloseChat`. */
33
+ closeChatLabel?: string;
11
34
  }): import("react").JSX.Element;
@@ -11,7 +11,7 @@ export type EmbedView = "chat" | "files" | "scheduled";
11
11
  * expand-to-modal — then the collapse toggle. Active fill + brand colours come
12
12
  * from `palette` so a host brand push re-themes everything.
13
13
  */
14
- export declare function EmbedRail({ view, collapsed, user, theme, palette, sessions, activeId, planProgress, speakEnabled, ttsSupported, voiceSupported, voiceStatus, pendingVoiceDraft, voiceActionFlash, accent, cssVars, presets, activePreset, onSelectView, onToggleCollapse, onToggleMode, onToggleSide, onAccentChange, onAccentReset, onCssVarsChange, onApplyPreset, onLogout, onNewSession, onSelectSession, onSelectAgentLine, onCloseAgentLine, onDeleteSession, onRenameSession, onSessionsOpen, onToggleSpeak, onExpand, }: {
14
+ export declare function EmbedRail({ view, collapsed, user, theme, palette, sessions, activeId, planProgress, speakEnabled, ttsSupported, voiceSupported, voiceStatus, pendingVoiceDraft, voiceActionFlash, accent, cssVars, presets, activePreset, onSelectView, onToggleCollapse, onToggleMode, onToggleSide, onAccentChange, onAccentReset, onCssVarsChange, onApplyPreset, onLogout, onNewSession, onSelectSession, onSelectAgentLine, onCloseAgentLine, onDeleteSession, onRenameSession, onSessionsOpen, onViewStats, onToggleSpeak, onExpand, }: {
15
15
  view: EmbedView;
16
16
  collapsed: boolean;
17
17
  user: string | null;
@@ -61,9 +61,14 @@ export declare function EmbedRail({ view, collapsed, user, theme, palette, sessi
61
61
  /** Rail agent chip clicked with a BOUND session — switches to the chat view
62
62
  * AND selects that agent's slot session (also clears its unseen-result
63
63
  * flag, via BelongDock's existing onSelectSession → markLineSeen lookup).
64
- * An unbound line (no sessionId yet) never reaches this — the chip falls
65
- * back to `onSelectView("chat")` instead, same as today's plain chat item. */
66
- onSelectAgentLine: (sessionId: string) => void;
64
+ * Also reached with `null` for the UNBOUND line-1 chip specifically — the
65
+ * one line whose chip is meaningfully clickable before it has a session —
66
+ * which BelongDock reads as "start a new foreground chat" (see its own
67
+ * doc). A line 2+ chip still unbound (the transient spinner window between
68
+ * reserving the line and its session mint) does NOT reach this — it falls
69
+ * back to `onSelectView("chat")` instead, same as today's plain chat item;
70
+ * there is nothing meaningful to select yet and no stale session to escape. */
71
+ onSelectAgentLine: (sessionId: string | null) => void;
67
72
  /** User closed an agent tab — RELEASES that line's slot (in memory + durably)
68
73
  * and nothing else. The conversation itself is NOT deleted server-side: it
69
74
  * stays in History and can be re-adopted from the avatar menu. Only offered
@@ -72,6 +77,9 @@ export declare function EmbedRail({ view, collapsed, user, theme, palette, sessi
72
77
  onDeleteSession: (id: string) => void;
73
78
  onRenameSession: (id: string, title: string) => void;
74
79
  onSessionsOpen?: () => void;
80
+ /** Open the per-session stats dialog (plan 2026-07-24). Optional so the
81
+ * rail still renders without the dock's panel host wired up. */
82
+ onViewStats?: (sessionId: string) => void;
75
83
  onToggleSpeak: () => void;
76
84
  onExpand: () => void;
77
85
  }): import("react").JSX.Element;
@@ -12,6 +12,17 @@ type SessionsBodyProps = {
12
12
  onDelete: (id: string) => void;
13
13
  /** Persist a user-chosen chat name (BEL-120). Only fired for a non-blank change. */
14
14
  onRename: (id: string, title: string) => void;
15
+ /** sessionId -> the agent line currently bound to it (F3). A row present in
16
+ * this map is open somewhere in the rail and wears a small "Agent N"
17
+ * badge; a row absent from it is not open in any agent and stays clean.
18
+ * Computed by the caller (EmbedRail / MobileNavBar, which already
19
+ * subscribe to the agent-lines registry) so this stays a pure
20
+ * presentational component — optional so a plain sessions list (no rail
21
+ * context) still renders without one. */
22
+ sessionAgentLine?: ReadonlyMap<string, number>;
23
+ /** Open the per-session stats dialog (plan 2026-07-24). Optional so a plain
24
+ * list without the dock's panel host still renders. */
25
+ onViewStats?: (sessionId: string) => void;
15
26
  };
16
27
  /**
17
28
  * The "New chat" item + recent-sessions list, WITHOUT a menu shell of its own —
@@ -23,13 +34,13 @@ type SessionsBodyProps = {
23
34
  * closed Content/SubContent by default, so this component's local edit/confirm
24
35
  * state resets for free on every close — no explicit reset needed here.
25
36
  */
26
- export declare function EmbedSessionsBody({ sessions, activeId, onNew, onSelect, onDelete, onRename, }: SessionsBodyProps): import("react").JSX.Element;
37
+ export declare function EmbedSessionsBody({ sessions, activeId, onNew, onSelect, onDelete, onRename, sessionAgentLine, onViewStats, }: SessionsBodyProps): import("react").JSX.Element;
27
38
  /**
28
39
  * Header control to start a new chat, switch to a recent session, rename one via
29
40
  * an inline text edit, or delete one via an inline trash → confirm flow. Rename +
30
41
  * delete are per-row inline affordances that keep the menu open (BEL-120).
31
42
  */
32
- export declare function EmbedSessions({ sessions, activeId, theme, side, triggerClassName, triggerLabel, onNew, onSelect, onDelete, onRename, onOpen, }: SessionsBodyProps & {
43
+ export declare function EmbedSessions({ sessions, activeId, theme, side, triggerClassName, triggerLabel, onNew, onSelect, onDelete, onRename, onOpen, sessionAgentLine, onViewStats, }: SessionsBodyProps & {
33
44
  theme: BelongTheme;
34
45
  /** Which way the menu opens — toward the panel from the rail edge, or
35
46
  * upward when the trigger lives in the mobile bottom nav bar. */
@@ -7,7 +7,7 @@ import { BelongTheme, BelongThemePalette, PresetName } from '../../types/public.
7
7
  * (chat / files / scheduled), the sessions switcher, the account avatar, and
8
8
  * a close chevron. Every cell is a ≥44px touch target; menus open upward.
9
9
  */
10
- export declare function MobileNavBar({ view, user, theme, palette, sessions, activeId, voiceSupported, accent, cssVars, presets, activePreset, onSelectView, onClose, onToggleMode, onToggleSide, onAccentChange, onAccentReset, onCssVarsChange, onApplyPreset, onLogout, onNewSession, onSelectSession, onDeleteSession, onRenameSession, onSessionsOpen, }: {
10
+ export declare function MobileNavBar({ view, user, theme, palette, sessions, activeId, voiceSupported, accent, cssVars, presets, activePreset, onSelectView, onClose, onToggleMode, onToggleSide, onAccentChange, onAccentReset, onCssVarsChange, onApplyPreset, onLogout, onNewSession, onSelectSession, onDeleteSession, onRenameSession, onSessionsOpen, onViewStats, }: {
11
11
  view: EmbedView;
12
12
  user: string | null;
13
13
  theme: BelongTheme;
@@ -36,4 +36,7 @@ export declare function MobileNavBar({ view, user, theme, palette, sessions, act
36
36
  onDeleteSession: (id: string) => void;
37
37
  onRenameSession: (id: string, title: string) => void;
38
38
  onSessionsOpen?: () => void;
39
+ /** Open the per-session stats dialog (plan 2026-07-24). Optional so the
40
+ * mobile nav still renders without the dock's panel host wired up. */
41
+ onViewStats?: (sessionId: string) => void;
39
42
  }): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * SessionStatsPanel (plan 2026-07-24) — a centered dialog opened from a history
3
+ * row's "Stats" action. Fetches GET /v1/session-stats/:id on open (works for ANY
4
+ * session, not just the active one, so REST not folded stream parts). Shows
5
+ * tokens, time running, turns, tool calls, runtime + a per-turn table, with two
6
+ * CSV exports.
7
+ */
8
+ export type SessionStatsPanelProps = {
9
+ readonly sessionId: string | null;
10
+ readonly onClose: () => void;
11
+ };
12
+ export declare const SessionStatsPanel: ({ sessionId, onClose, }: SessionStatsPanelProps) => React.ReactElement | null;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Rail feature flags — deliberately kept OUT of EmbedRail.tsx.
3
+ *
4
+ * A component file that ALSO exports a non-component value breaks React Fast
5
+ * Refresh's module boundary: Vite can no longer hot-swap the component and
6
+ * falls back to a full reload, and an already-open tab can be left in a
7
+ * broken HMR state until a hard reload. Living in a plain `.ts` module keeps
8
+ * EmbedRail.tsx a clean component-only Fast Refresh boundary.
9
+ */
10
+ /**
11
+ * Multi-agent rail (parallel chat "agent lines" spawned from the "+" button,
12
+ * capped at MAX_AGENT_LINES) is DEACTIVATED — switching between the spawned
13
+ * agents was buggy. While off:
14
+ * - the "+" spawn button is not rendered (no new chat agent lines can be
15
+ * started from the rail), so a plain chat session stays on line 1 and the
16
+ * rail is the single-chat item exactly as before; and
17
+ * - the standalone Chats/history dropdown is restored to the rail (it was
18
+ * demoted into the avatar menu when the agent rail landed).
19
+ * The underlying agent-line registry + voice multi-agent call board are left
20
+ * intact (the rail still renders line chips if a VOICE call opens more than
21
+ * one). Flip this to `true` to re-enable the chat spawn UX.
22
+ */
23
+ export declare const MULTI_AGENT_RAIL_ENABLED = false;
@@ -18,5 +18,15 @@ export declare const setPendingAdoptionNotice: (sessionId: string, line: number)
18
18
  /** The line number to announce for `sessionId`, or null when this mount has
19
19
  * nothing pending. Consuming clears the entry (the notice fires once). */
20
20
  export declare const consumePendingAdoptionNotice: (sessionId: string) => number | null;
21
+ /** Non-consuming read of the SAME entry (F3) — chat.tsx's line-1 bind effect
22
+ * uses this to learn WHICH line a freshly-opened History session should
23
+ * adopt onto (BelongDock recorded the intended target — the currently active
24
+ * line, not always line 1 — before the select remounted this route). Must
25
+ * not clear the entry: the notice effect above still needs to consume it
26
+ * once, for its own one-time "Loaded into Agent N" message, and the bind
27
+ * effect re-runs on every render (no dep array) so it would otherwise race
28
+ * that single consume. Returns null for a non-matching or already-consumed
29
+ * session, same as `consumePendingAdoptionNotice`. */
30
+ export declare const peekPendingAdoptionLine: (sessionId: string) => number | null;
21
31
  /** Test-only: forget any pending entry between test cases. */
22
32
  export declare const __clearPendingAdoptionNoticeForTest: () => void;
@@ -17,6 +17,16 @@ export declare const DEFAULT_PRESET: PresetName;
17
17
  export declare const isSimetrikHost: (hostname: string) => boolean;
18
18
  /** The default preset for a host: `simetrik` on a Simetrik domain, else belong. */
19
19
  export declare const defaultPresetForHost: (hostname: string) => PresetName;
20
+ /**
21
+ * The preset the dock boots with, given the user's stored choice and the host
22
+ * it's embedded on. **Brand-as-floor:** on a host that defaults to a tenant
23
+ * brand (a Simetrik domain), a stored *generic* built-in preset (`belong`) must
24
+ * not silently downgrade the brand — a stale `localStorage` preset from QA/dev
25
+ * once wiped Simetrik's brand on the real site. Only the user's explicit Custom
26
+ * theme (or a matching brand choice) overrides the host brand. On a non-branded
27
+ * host there's no floor to enforce, so the stored preference always wins.
28
+ */
29
+ export declare const resolveInitialPreset: (storedPreset: PresetName | undefined, hostname: string) => PresetName;
20
30
  export declare const getPreset: (name: PresetName) => PartialBelongTheme;
21
31
  export declare const listPresets: () => readonly {
22
32
  name: PresetName;
@@ -8,6 +8,19 @@ export declare const setTheme: (partial: PartialBelongTheme) => void;
8
8
  * the Custom style overlays the user's accent/cssVars stash. */
9
9
  export declare const applyPreset: (name: PresetName) => void;
10
10
  export declare const peekPreset: () => PresetName;
11
+ /**
12
+ * One-line diagnostic of how the boot theme resolved, logged once at init
13
+ * (see `applyInitConfig`). Pairs with the build-provenance line (plan 007 §B4)
14
+ * so a "the dock isn't showing our brand" report is answerable from the host
15
+ * console alone: it names the winning preset + brand, the host that drove the
16
+ * default, and whether the tenant's *published* theme overrode it on top.
17
+ */
18
+ export declare const describeThemeResolution: (input: {
19
+ hostname: string;
20
+ preset: PresetName;
21
+ brandName: string;
22
+ remoteThemeApplied: boolean;
23
+ }) => string;
11
24
  /**
12
25
  * Set (or clear, with `null`) the Custom-style accent. Updates the stash and
13
26
  * switches to the Custom style so the change is immediately visible.
@@ -18,10 +18,31 @@
18
18
  * create body carries the effective `workspaceExternalId` (absent when the host
19
19
  * runs unscoped). The line's registry label seeds the session title, so the
20
20
  * sessions list names the background conversation.
21
+ *
22
+ * BOOT RE-ATTACH (F3/R4): `attachLineReader` below is the ONE seam that wires
23
+ * a line-run reader onto a line, shared by a fresh dispatch (this module,
24
+ * right after a POST accepts a run) and `reattachPendingLineRuns` (called
25
+ * once at boot, after `initAgentLines()` rehydrates the registry) resuming a
26
+ * run that was still going when the page reloaded. Both paths persist the
27
+ * binding (`persistSlotRun`) and wire the identical phase/approval/navigate/
28
+ * artifact/finish/error callbacks — a reload must behave exactly like the
29
+ * live dispatch it is standing in for, not a parallel, easier-to-drift copy.
21
30
  */
22
31
  /** Abort every live line reader and invalidate their callbacks (call teardown).
23
32
  * Subscribed below to fire whenever a call leaves in_call/connecting. */
24
33
  export declare const abortAllLineReaders: () => void;
34
+ /**
35
+ * BOOT RE-ATTACH (F3/R4): call this once, right after `initAgentLines()`
36
+ * rehydrates the registry from persisted slots. Every background line (2/3)
37
+ * whose slot carried a non-null `runId` already shows `status: "working"`
38
+ * (`rehydratedLines()` in voice-call-lines.ts) — this re-attaches its reader
39
+ * so the line actually converges to ready/failed via the SAME
40
+ * `attachLineReader` a live dispatch uses, instead of sitting at an
41
+ * honest-looking but permanently stuck "working". Line 1 never carries a
42
+ * registry `runId` (see `AgentLine.runId`'s doc) and is skipped here — its
43
+ * own reload-resume path is the stream-state store's, not this one.
44
+ */
45
+ export declare const reattachPendingLineRuns: (fetchFn?: typeof fetch) => void;
25
46
  export declare const dispatchToLine: (req: {
26
47
  readonly line: number;
27
48
  readonly request: string;
@@ -31,6 +31,21 @@
31
31
  * NOT terminal, keep reading the same stream. "completed" finishes with
32
32
  * the accumulated text; "cancelled" | "failed" | "throttled" are errors.
33
33
  *
34
+ * BOOT RE-ATTACH (F3/R4): this reader is also opened for a run that already
35
+ * finished before the read starts (a persisted `runId` re-attached after a
36
+ * reload — see `attachLineReader` in line-dispatch.ts). Two ways that shows
37
+ * up on the wire, both a CLEAN convergence rather than a failure:
38
+ * - the run is still known server-side and just replays its full history
39
+ * (§36 — `GET .../stream` with no cursor replays from the start): the
40
+ * already-written terminal `data-status` event arrives like any other
41
+ * part and is handled by the SAME "completed"/"cancelled"/"failed"
42
+ * branch below — no special-casing needed, this is the ordinary path.
43
+ * - the run (or its task) is truly gone server-side — 404/410 — which
44
+ * reads identically to "nothing left to report", not an error: `onFinish`
45
+ * fires with empty text instead of `onError`, so a boot re-attach never
46
+ * paints a stale run as failed just because its record has since expired
47
+ * or the session behind it was deleted.
48
+ *
34
49
  * SSE parsing here is LINE-BY-LINE (split on "\n", not "\n\n") — the server
35
50
  * sends exactly one `data:` line per event. `id:` lines carry the event
36
51
  * cursor (ignored — v1 has no reconnect/resume) and `:`-prefixed lines are
@@ -50,6 +65,6 @@ export type WatchLineRunInput = {
50
65
  mimeType: string;
51
66
  }) => void;
52
67
  readonly onFinish: (finalText: string) => void;
53
- readonly onError: (message: string) => void;
68
+ readonly onError: (message: string, kind: "terminal" | "transport") => void;
54
69
  };
55
70
  export declare const watchLineRun: (input: WatchLineRunInput, fetchFn?: typeof fetch) => (() => void);
@@ -24,6 +24,18 @@
24
24
  * slots" — the switchboard just starts fresh, same as a first-ever call. The
25
25
  * schema is back-compatible with the pre-line-1 bag: a persisted object with
26
26
  * only `line2`/`line3` still parses fine, `line1` just defaults to `null`.
27
+ *
28
+ * `runId` (F3/R4 — reload must not lie about a still-running background
29
+ * line): the durable half of `bindLineRun`'s in-memory tracking, written by
30
+ * `persistSlotRun` (`voice-call-lines.ts`) alongside every `bindLineRun` call
31
+ * a background dispatch makes. Without it, a page reload has no way to know
32
+ * a line was mid-run — `runId` lives only in JS memory otherwise, and the
33
+ * boot rehydrate would show a lying "idle" line while the run keeps
34
+ * streaming server-side. Back-compatible the same way `line1` is: a bag
35
+ * written before this field existed has no `runId` key at all, and the
36
+ * schema defaults it to `null` (nothing was in flight when that bag was
37
+ * written). Line 1 never carries a meaningful value here — its `runId` is
38
+ * always `null` (see `AgentLine.runId`'s doc in voice-call-lines.ts).
27
39
  */
28
40
  /** Every line number that gets a persisted slot — all three agent lines. */
29
41
  declare const SLOT_LINES: readonly [1, 2, 3];
@@ -31,6 +43,20 @@ type SlotLine = (typeof SLOT_LINES)[number];
31
43
  export type LineSlot = {
32
44
  readonly sessionId: string;
33
45
  readonly label: string;
46
+ readonly runId: string | null;
47
+ };
48
+ /** Input to `writeLineSlot` — `runId` is OPTIONAL here (unlike the stored
49
+ * `LineSlot`) and defaults to `null` when omitted: every existing adoption
50
+ * call site (`persistSlotBinding`) writes a session/label pair without ever
51
+ * having an opinion on `runId`, and a fresh binding correctly has no run of
52
+ * its own yet (any run tracked against the PREVIOUS session at this slot is
53
+ * moot once the binding itself changes identity). `persistSlotRun` is the
54
+ * only writer that ever sets `runId` to a non-null value, via the narrower
55
+ * `writeLineSlotRun` below. */
56
+ export type LineSlotInput = {
57
+ readonly sessionId: string;
58
+ readonly label: string;
59
+ readonly runId?: string | null;
34
60
  };
35
61
  /** The persisted binding for line 1/2/3, or `null` when never set (or `line`
36
62
  * isn't a valid agent line at all). */
@@ -38,10 +64,22 @@ export declare const readLineSlot: (line: number) => LineSlot | null;
38
64
  /** Persist a line's current `{ sessionId, label }` so the NEXT rehydration
39
65
  * (`resetAgentLines()`, or a plain reload for line 1) rebinds onto the same
40
66
  * session. No-op for a line number that isn't 1/2/3, and no-op when the slot
41
- * already holds this exact `{ sessionId, label }` — callers (e.g. chat.tsx's
42
- * per-render bind effect) call this on every render, so an unchanged binding
43
- * must not touch storage. */
44
- export declare const writeLineSlot: (line: number, slot: LineSlot) => void;
67
+ * already holds this exact `{ sessionId, label, runId }` — callers (e.g.
68
+ * chat.tsx's per-render bind effect) call this on every render, so an
69
+ * unchanged binding must not touch storage. `runId` defaults to `null` when
70
+ * omitted (see `LineSlotInput`'s doc) a fresh binding via this function
71
+ * always represents a NEW session identity, so any run tracked against
72
+ * whatever this slot held before is stale by construction. */
73
+ export declare const writeLineSlot: (line: number, slot: LineSlotInput) => void;
74
+ /** Update ONLY the persisted `runId` for a line's slot, leaving `sessionId`/
75
+ * `label` untouched — the durable half of `bindLineRun` (called together as
76
+ * `persistSlotRun` in voice-call-lines.ts), so a background line's in-flight
77
+ * run survives a reload (F3/R4). No-op for a line number that isn't 1/2/3,
78
+ * when the slot doesn't exist yet (nothing to attach a run to — the session
79
+ * itself hasn't been adopted), or when the runId is already what's
80
+ * persisted (bindLineRun's own no-op-on-unchanged tolerance, mirrored here so
81
+ * the two halves stay in lockstep). */
82
+ export declare const writeLineSlotRun: (line: number, runId: string | null) => void;
45
83
  /** Drop a line's persisted binding — the durable half of `closeAgentLine`
46
84
  * (voice-call-lines.ts). Called when a slot is RELEASED rather than rebound: a
47
85
  * spawn whose session mint failed, or a session the user deleted. Without this
@@ -107,6 +107,13 @@ export declare const isLineReservation: (line: number, epoch: number) => boolean
107
107
  * (the boolean chat.tsx's aliasing guard needs) and `markLineSeen`'s callers
108
108
  * (which need the actual line number to mark seen). */
109
109
  export declare const lineBoundToSession: (sessionId: string) => AgentLine | undefined;
110
+ /** The line — INCLUDING line 1 — currently bound to `sessionId`, or `undefined`
111
+ * when no agent holds it. Unlike `lineBoundToSession` (deliberately line-1-blind
112
+ * for the aliasing guard), this is the honest "which agent already owns this
113
+ * conversation" lookup a History reopen needs: reopening a session that Agent 1
114
+ * already holds must SWITCH to Agent 1, not adopt (duplicate) it onto whatever
115
+ * background line the user happens to be viewing. */
116
+ export declare const lineOwningSession: (sessionId: string) => AgentLine | undefined;
110
117
  /** True when `sessionId` is already the session of some line OTHER than line
111
118
  * 1 — chat.tsx's line-1 aliasing guard uses this to skip rebinding line 1
112
119
  * onto a background line's session while the user is viewing it via
@@ -185,10 +192,33 @@ export declare const __bindLineSessionForTest: (line: number, sessionId: string)
185
192
  export declare const persistSlotBinding: (line: number, sessionId: string, label: string) => void;
186
193
  /** `stop_agent`'s target: bound by the line-run reader once a background
187
194
  * dispatch's POST returns a runId, and cleared to `null` when that run
188
- * finishes/fails/errors — a stopped or finished run must not look stoppable
189
- * again. No-op on an unknown line or an unchanged value (mirrors
190
- * `setLineStatus`'s re-write-on-every-render tolerance). */
195
+ * reaches a confirmed terminal state — a stopped or finished run must not look
196
+ * stoppable again. Transport-only failures deliberately retain it for
197
+ * re-attachment. No-op on an unknown line or an unchanged value (mirrors
198
+ * `setLineStatus`'s re-write-on-every-render tolerance). In-memory only —
199
+ * production code wanting the binding to SURVIVE a reload calls
200
+ * `persistSlotRun` below instead; this stays exported for the `__force*` /
201
+ * `__bindLineSessionForTest` style test harnesses that intentionally want
202
+ * the memory-only half. */
191
203
  export declare const bindLineRun: (line: number, runId: string | null) => void;
204
+ /**
205
+ * The durable half of `bindLineRun` (F3/R4): call this — not the bare
206
+ * `bindLineRun` — whenever a background dispatch's POST accepts a run, and
207
+ * again when that run reaches a terminal state (`onFinish`/`onError`
208
+ * clearing it back to `null`). Updates the in-memory registry AND the
209
+ * persisted slot together, so the ONE thing a page reload cannot observe by
210
+ * itself — "is this line's run still going?" — survives the reload instead
211
+ * of silently reverting to a lying "idle". `line-dispatch.ts`'s
212
+ * `attachLineReader` is the ONE seam that calls this, shared by a live
213
+ * dispatch and the boot re-attach (`reattachPendingLineRuns`) alike — same
214
+ * discipline as `persistSlotBinding`'s ADOPTION seam.
215
+ *
216
+ * Line 1 never goes through this (line-dispatch.ts never dispatches to line
217
+ * 1 — see its module doc): its `runId` stays the always-`null` value
218
+ * `bindLineRun` already tolerates, and its own run is resolved at stop-time
219
+ * from the stream-state store instead (`AgentLine.runId`'s doc).
220
+ */
221
+ export declare const persistSlotRun: (line: number, runId: string | null) => void;
192
222
  export declare const setLineStatus: (line: number, status: AgentLineStatus, lastText?: string) => void;
193
223
  /** CallScreen's agent board reads this as the live "what is it doing right
194
224
  * now" line under a working line's status dot — written on every phase