react-semaphor 0.1.428 → 0.1.429

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 (96) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +72 -71
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +5 -4
  5. package/dist/briefings/index.cjs +1 -1
  6. package/dist/briefings/index.js +1031 -622
  7. package/dist/chunks/analyze-result-contract-BswhsmWT.js +1 -0
  8. package/dist/chunks/{analyze-result-contract-DnfF8kBb.js → analyze-result-contract-CfOBEwaC.js} +681 -759
  9. package/dist/chunks/{code-editor-CojfM3qp.js → code-editor-C65eEYyU.js} +2980 -2960
  10. package/dist/chunks/code-editor-DOh3aYEh.js +138 -0
  11. package/dist/chunks/{comparison-document-migration-b6c3xiWh.js → comparison-document-migration-DbU_BTxR.js} +1 -1
  12. package/dist/chunks/{comparison-document-migration-BJH1idOd.js → comparison-document-migration-Dj6xZMCb.js} +2 -2
  13. package/dist/chunks/csv-utils-Co0WxHke.js +4 -0
  14. package/dist/chunks/csv-utils-suxSkJGj.js +376 -0
  15. package/dist/chunks/dashboard-CQfAvRYI.js +1401 -0
  16. package/dist/chunks/{dashboard-509sbC4_.js → dashboard-agBXhvKo.js} +47563 -44929
  17. package/dist/chunks/{dashboard-briefing-launcher-B-ZTWJwo.js → dashboard-briefing-launcher-CkH_pthg.js} +1 -1
  18. package/dist/chunks/{dashboard-briefing-launcher-DIdYHNTq.js → dashboard-briefing-launcher-gBNNKqoH.js} +100 -99
  19. package/dist/chunks/{dashboard-controls-CWprw-Pb.js → dashboard-controls-CAZnIGfT.js} +2 -2
  20. package/dist/chunks/{dashboard-controls-CbRzWo1N.js → dashboard-controls-CoIxUTvH.js} +114 -113
  21. package/dist/chunks/{dashboard-json-jO4GQfZk.js → dashboard-json-BMcPjL8-.js} +18 -17
  22. package/dist/chunks/dashboard-json-D4hFrMkX.js +1 -0
  23. package/dist/chunks/{edit-dashboard-visual-KgQTjqWp.js → edit-dashboard-visual-Bc8qNfSr.js} +8721 -8481
  24. package/dist/chunks/edit-dashboard-visual-onhUUXlw.js +182 -0
  25. package/dist/chunks/{metric-comparison-CWweq9RG.js → metric-comparison-CPoDx56y.js} +1 -1
  26. package/dist/chunks/{metric-comparison-BKgkMy9r.js → metric-comparison-DVy3fll_.js} +1 -1
  27. package/dist/chunks/numeric-presentation-CGTcqocU.js +517 -0
  28. package/dist/chunks/numeric-presentation-Dlb-Dk4c.js +1 -0
  29. package/dist/chunks/report-preferences-dialog-CPptr_V9.js +690 -0
  30. package/dist/chunks/report-preferences-dialog-DV_5aHrS.js +1 -0
  31. package/dist/chunks/source-identity-5OPV4gvg.js +92 -0
  32. package/dist/chunks/source-identity-Cbo2LOHQ.js +1 -0
  33. package/dist/chunks/{update-policy-CY2k-pJP.js → update-policy-De2NswtM.js} +1 -1
  34. package/dist/chunks/{update-policy-BgONreNd.js → update-policy-DnF_74zC.js} +1 -1
  35. package/dist/chunks/{use-create-flow-overlay-state-BiMYdjZP.js → use-create-flow-overlay-state-Bs6gqgjo.js} +1 -1
  36. package/dist/chunks/{use-create-flow-overlay-state-CGsLzp9A.js → use-create-flow-overlay-state-CgQbCrni.js} +97 -96
  37. package/dist/chunks/validators-B2vUAqTf.js +1 -0
  38. package/dist/chunks/{validators-Cz-XuORM.js → validators-Bce_J7Vd.js} +19 -13
  39. package/dist/dashboard/index.cjs +1 -1
  40. package/dist/dashboard/index.js +1 -1
  41. package/dist/dashboard-authoring/index.cjs +3 -3
  42. package/dist/dashboard-authoring/index.js +20 -19
  43. package/dist/data-app-builder/index.cjs +1 -1
  44. package/dist/data-app-builder/index.js +50 -50
  45. package/dist/data-app-codegen/index.cjs +1 -1
  46. package/dist/data-app-codegen/index.js +2 -2
  47. package/dist/data-app-codegen-node/index.cjs +1 -1
  48. package/dist/data-app-codegen-node/index.js +3 -3
  49. package/dist/data-app-sdk/index.cjs +2 -2
  50. package/dist/data-app-sdk/index.js +27 -26
  51. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  52. package/dist/data-app-sdk-adapters/index.js +25 -24
  53. package/dist/data-app-sdk-validation/index.cjs +1 -1
  54. package/dist/data-app-sdk-validation/index.js +57 -55
  55. package/dist/format-utils/index.cjs +2 -5
  56. package/dist/format-utils/index.js +136 -161
  57. package/dist/index.cjs +1 -1
  58. package/dist/index.js +158 -155
  59. package/dist/report-runtime-context/index.cjs +1 -0
  60. package/dist/report-runtime-context/index.js +394 -0
  61. package/dist/style.css +1 -1
  62. package/dist/surfboard/index.cjs +1 -1
  63. package/dist/surfboard/index.js +7 -6
  64. package/dist/types/analytics-protocol.d.ts +0 -4
  65. package/dist/types/briefings.d.ts +216 -19
  66. package/dist/types/dashboard-assistant.d.ts +0 -2
  67. package/dist/types/dashboard-authoring.d.ts +34 -9
  68. package/dist/types/dashboard.d.ts +93 -9
  69. package/dist/types/data-app-builder.d.ts +0 -1
  70. package/dist/types/data-app-codegen-node.d.ts +6 -28
  71. package/dist/types/data-app-codegen.d.ts +6 -28
  72. package/dist/types/data-app-sdk-adapters.d.ts +6 -28
  73. package/dist/types/data-app-sdk-validation.d.ts +6 -29
  74. package/dist/types/data-app-sdk.d.ts +6 -31
  75. package/dist/types/format-utils.d.ts +128 -4
  76. package/dist/types/index.cjs +1 -1
  77. package/dist/types/index.js +10 -13
  78. package/dist/types/main.d.ts +249 -89
  79. package/dist/types/report-runtime-context.d.ts +99 -0
  80. package/dist/types/shared.d.ts +34 -9
  81. package/dist/types/surfboard.d.ts +119 -16
  82. package/dist/types/types.d.ts +156 -73
  83. package/dist/types/value-format-preferences.d.ts +126 -0
  84. package/dist/value-format-preferences/index.cjs +1 -0
  85. package/dist/value-format-preferences/index.js +635 -0
  86. package/package.json +11 -1
  87. package/dist/chunks/analyze-result-contract-ege_u6Nl.js +0 -1
  88. package/dist/chunks/calendar-preferences-dialog-BF9bNAF_.js +0 -457
  89. package/dist/chunks/calendar-preferences-dialog-_L9eBQfj.js +0 -1
  90. package/dist/chunks/code-editor-BoowcKU0.js +0 -138
  91. package/dist/chunks/dashboard-CMDXBLnG.js +0 -1402
  92. package/dist/chunks/dashboard-json-BEZrxx_k.js +0 -1
  93. package/dist/chunks/date-formatter-BTTYdAik.js +0 -1
  94. package/dist/chunks/date-formatter-D-89jTjG.js +0 -514
  95. package/dist/chunks/edit-dashboard-visual-D3uhqgm3.js +0 -182
  96. package/dist/chunks/validators-B4VMLX3_.js +0 -1
@@ -2,8 +2,8 @@ import { jsx as r, jsxs as c, Fragment as re } from "react/jsx-runtime";
2
2
  import * as Zn from "react";
3
3
  import { useContext as qn, useState as x, useRef as oe, useMemo as ze, useEffect as W, useCallback as Ot } from "react";
4
4
  import * as Xn from "react-dom/client";
5
- import { aK as ea, aL as ta, aM as Ir, aN as jr, aO as zr, aP as ra, aQ as Wr, aR as Hr, aS as Jr, aT as Vr, aU as _r, aV as Ur, aW as Kr, aX as na, aY as aa, aZ as oa, a_ as Ht, a$ as on, x as Gr, b0 as sa, b1 as Vt, b2 as sn, b3 as ia, b4 as la } from "../chunks/dashboard-509sbC4_.js";
6
- import { B as H, P as it, a as lt, b as dt, _ as da, $ as ca, a0 as ua, a1 as pa, a2 as ha, e as me, R as ma, d as _t } from "../chunks/code-editor-CojfM3qp.js";
5
+ import { aM as ea, aN as ta, aO as Ir, aP as jr, aQ as zr, aR as ra, aS as Wr, aT as Hr, aU as Jr, aV as Vr, aW as _r, aX as Ur, aY as Gr, aZ as na, a_ as aa, a$ as oa, b0 as Ht, b1 as on, R as Kr, b2 as sa, b3 as Vt, b4 as sn, b5 as ia, b6 as la } from "../chunks/dashboard-agBXhvKo.js";
6
+ import { B as H, P as it, a as lt, b as dt, _ as da, $ as ca, a0 as ua, a1 as pa, a2 as ha, L as me, R as ma, d as _t } from "../chunks/code-editor-C65eEYyU.js";
7
7
  import { loadSemaphorBrowserRuntime as ot } from "../data-app-builder-browser-runtime/index.js";
8
8
  import { c as $e, X as Je } from "../chunks/index-xHCrHprY.js";
9
9
  import { S as fa } from "../chunks/save-HCJjjzdX.js";
@@ -597,7 +597,7 @@ function Ea(e) {
597
597
  e
598
598
  );
599
599
  }
600
- function Kt(e) {
600
+ function Gt(e) {
601
601
  return e < 1e3 ? `${e}ms` : `${(e / 1e3).toFixed(e < 1e4 ? 1 : 0)}s`;
602
602
  }
603
603
  function Oa(e) {
@@ -768,7 +768,7 @@ function st(e, a) {
768
768
  s.set(d.id, d);
769
769
  return Array.from(s.values());
770
770
  }
771
- function Ka(e, a) {
771
+ function Ga(e, a) {
772
772
  return !a || !Ve(a) ? e : !e || !Ve(e) ? a : {
773
773
  schemaVersion: "data-app-intent/v1",
774
774
  app: {
@@ -825,7 +825,7 @@ function an(e, a) {
825
825
  intentManifest: h || void 0
826
826
  };
827
827
  }
828
- function Ga({
828
+ function Ka({
829
829
  files: e,
830
830
  selectedPath: a,
831
831
  onSelect: s
@@ -998,7 +998,7 @@ function Za({
998
998
  var Or, Lr;
999
999
  const [f, R] = x(Lt), [v, B] = x(Xr), [b, E] = x(It), [j, L] = x(!1), [F, z] = x(Lt), [ve, Z] = x(0), [A] = x(p), [_e, ct] = x(
1000
1000
  l || ""
1001
- ), [ut, Ue] = x([]), [De, Pe] = x([]), [q, ge] = x([]), [Qt, Ke] = x(null), [X, Ge] = x(!1), [ee, Yt] = x(!1), [Fe, un] = x(!0), [pn, se] = x("idle"), [hn, ie] = x(null), [Zt, qt] = x(null), [Xt, Qe] = x(() => Date.now()), [Me, er] = x(null), [pt, mn] = x("gpt-5.5-low"), Y = oe(null), K = oe(null), ht = oe([]), mt = oe(null), ft = oe(null), tr = oe(null), [be, ke] = x(!1), [rr, le] = x(null), [nr, gt] = x(!1), [ar, or] = x(!1), [Te, bt] = x("idle"), [sr, ir] = x(
1001
+ ), [ut, Ue] = x([]), [De, Pe] = x([]), [q, ge] = x([]), [Qt, Ge] = x(null), [X, Ke] = x(!1), [ee, Yt] = x(!1), [Fe, un] = x(!0), [pn, se] = x("idle"), [hn, ie] = x(null), [Zt, qt] = x(null), [Xt, Qe] = x(() => Date.now()), [Me, er] = x(null), [pt, mn] = x("gpt-5.5-low"), Y = oe(null), G = oe(null), ht = oe([]), mt = oe(null), ft = oe(null), tr = oe(null), [be, ke] = x(!1), [rr, le] = x(null), [nr, gt] = x(!1), [ar, or] = x(!1), [Te, bt] = x("idle"), [sr, ir] = x(
1002
1002
  null
1003
1003
  ), [fn, lr] = x(""), [gn, dr] = x([]), [xt, cr] = x([]), [wt, ur] = x(null), [pr, bn] = x([]), [xn, wn] = x(null), [yt, hr] = x(null), [vt, mr] = x(null), [xe, Ye] = x(
1004
1004
  d || null
@@ -1207,14 +1207,14 @@ function Za({
1207
1207
  };
1208
1208
  }, [s, a, Ar]);
1209
1209
  const rt = Ot(
1210
- async (t = K.current) => {
1210
+ async (t = G.current) => {
1211
1211
  if (!t) return;
1212
1212
  const n = await t.compileBrowserSandboxPreviewHtml();
1213
1213
  lr(n.html), dr(n.diagnostics), cr(n.warnings || []), ur(n.cssMode || null), Z((i) => i + 1);
1214
1214
  },
1215
1215
  []
1216
1216
  ), Oe = Ot(
1217
- (t = K.current, n = Se.current) => {
1217
+ (t = G.current, n = Se.current) => {
1218
1218
  var m;
1219
1219
  if (!t) return;
1220
1220
  const i = t.listBrowserSandboxFiles(), o = t.readBrowserSandboxWorkspaceContext(), u = n && i.some((k) => k.path === n) ? n : ((m = i[0]) == null ? void 0 : m.path) || null;
@@ -1235,7 +1235,7 @@ function Za({
1235
1235
  try {
1236
1236
  const i = await ot();
1237
1237
  if (t) return;
1238
- K.current = i, bt("ready"), await rt(i), Oe(i);
1238
+ G.current = i, bt("ready"), await rt(i), Oe(i);
1239
1239
  } catch (i) {
1240
1240
  if (t) return;
1241
1241
  bt("failed"), ir(
@@ -1248,13 +1248,13 @@ function Za({
1248
1248
  };
1249
1249
  }, [A, Oe, rt]);
1250
1250
  function kn(t) {
1251
- const n = K.current;
1251
+ const n = G.current;
1252
1252
  hr(t), Se.current = t, mr(
1253
1253
  n && n.readBrowserSandboxFiles([t])[0] || null
1254
1254
  );
1255
1255
  }
1256
1256
  async function Cr() {
1257
- const t = K.current;
1257
+ const t = G.current;
1258
1258
  !t || X || (t.resetBrowserSandbox(), await rt(t), Oe(t), M(
1259
1259
  "Browser Sandbox reset to the approved starter template. Existing generated browser files were replaced in local browser storage.",
1260
1260
  "guidance"
@@ -1368,7 +1368,7 @@ function Za({
1368
1368
  function Rn(t) {
1369
1369
  var i;
1370
1370
  t.intentManifest && At(
1371
- (o) => Ka(o, t.intentManifest)
1371
+ (o) => Ga(o, t.intentManifest)
1372
1372
  );
1373
1373
  const n = (i = t.artifacts) == null ? void 0 : i.find(
1374
1374
  (o) => o.type === "dataset_inspector"
@@ -1400,7 +1400,7 @@ function Za({
1400
1400
  createdAt: i,
1401
1401
  attachments: t.attachments
1402
1402
  }
1403
- ]), qt(i), se("context"), ie("Preparing app context and available files."), Gn({ ...t, prompt: n });
1403
+ ]), qt(i), se("context"), ie("Preparing app context and available files."), Kn({ ...t, prompt: n });
1404
1404
  }
1405
1405
  async function Bn(t) {
1406
1406
  if (!t.type.startsWith("image/")) {
@@ -1549,7 +1549,7 @@ function Za({
1549
1549
  const i = n === "browser" ? "Browser Sandbox" : "Local Bridge", o = (u = t.changedFiles) != null && u.length ? t.changedFiles.join(", ") : "no files";
1550
1550
  return t.ok ? `${i} applied the revision and validation passed. Changed files: ${o}. The preview has been refreshed; inspect the file tree and run card for the exact file plan.` : `${i} could not finish the revision cleanly. Changed files: ${o}. The run card includes the validation output so you can ask a follow-up repair question or switch runtimes.`;
1551
1551
  }
1552
- function G(t, n) {
1552
+ function K(t, n) {
1553
1553
  Cn(
1554
1554
  t,
1555
1555
  (i) => i.map((o) => {
@@ -1583,13 +1583,13 @@ function Za({
1583
1583
  var k, w, C, y;
1584
1584
  (k = Y.current) == null || k.abort();
1585
1585
  const o = new AbortController(), u = Date.now();
1586
- Y.current = o, Ge(!0), Ke(n), Qe(u), G(n, "reading");
1586
+ Y.current = o, Ke(!0), Ge(n), Qe(u), K(n, "reading");
1587
1587
  const m = window.setTimeout(() => {
1588
1588
  o.abort();
1589
1589
  }, 18e4);
1590
1590
  try {
1591
- let N = K.current;
1592
- N || (N = await ot(), K.current = N);
1591
+ let N = G.current;
1592
+ N || (N = await ot(), G.current = N);
1593
1593
  const I = N.readBrowserSandboxWorkspaceContext(), $ = (C = (w = I.files) == null ? void 0 : w.editable) != null && C.length ? tn(
1594
1594
  I.files.editable,
1595
1595
  Se.current,
@@ -1602,7 +1602,7 @@ function Za({
1602
1602
  const pe = [];
1603
1603
  for (let ne = 0; ne < We; ne += 1) {
1604
1604
  const te = Le.length > 0 || ne > 0, Ie = te ? `repair-${ne + 1}` : "initial";
1605
- G(n, te ? "repairing" : "generating");
1605
+ K(n, te ? "repairing" : "generating");
1606
1606
  const _ = ue || (await tt(
1607
1607
  {
1608
1608
  projectId: h,
@@ -1620,12 +1620,12 @@ function Za({
1620
1620
  )).revision;
1621
1621
  if (ue = void 0, !_)
1622
1622
  throw new Error("Data App Builder did not return a revision.");
1623
- G(n, "writing");
1623
+ K(n, "writing");
1624
1624
  const we = N.applyBrowserSandboxRevision({
1625
1625
  ..._,
1626
1626
  attemptLabel: Ie
1627
1627
  });
1628
- pe.push(...we.attempts || []), G(n, "typechecking");
1628
+ pe.push(...we.attempts || []), K(n, "typechecking");
1629
1629
  let D = {
1630
1630
  ...we,
1631
1631
  attempts: [...pe],
@@ -1679,7 +1679,7 @@ function Za({
1679
1679
  }
1680
1680
  if (!Q)
1681
1681
  throw new Error("The browser runtime loop ended without a validation result.");
1682
- G(n, Q.ok ? "complete" : "failed"), nt(n, {
1682
+ K(n, Q.ok ? "complete" : "failed"), nt(n, {
1683
1683
  status: Q.ok ? "done" : "failed",
1684
1684
  result: Q,
1685
1685
  error: Q.error,
@@ -1702,16 +1702,16 @@ function Za({
1702
1702
  }), M(
1703
1703
  `Browser Sandbox stopped before it could validate the app: ${$}`,
1704
1704
  "blocked"
1705
- ), G(n, "failed");
1705
+ ), K(n, "failed");
1706
1706
  } finally {
1707
- Ge(!1), Ke(null), Y.current = null, window.clearTimeout(m);
1707
+ Ke(!1), Ge(null), Y.current = null, window.clearTimeout(m);
1708
1708
  }
1709
1709
  }
1710
1710
  async function In(t, n, i) {
1711
1711
  var k, w, C, y;
1712
1712
  (k = Y.current) == null || k.abort();
1713
1713
  const o = new AbortController(), u = Date.now();
1714
- Y.current = o, Ge(!0), Ke(n), Qe(u), G(n, "reading");
1714
+ Y.current = o, Ke(!0), Ge(n), Qe(u), K(n, "reading");
1715
1715
  const m = window.setTimeout(() => {
1716
1716
  o.abort();
1717
1717
  }, 18e4);
@@ -1818,14 +1818,14 @@ function Za({
1818
1818
  const we = [];
1819
1819
  for (let D = 0; D < We; D += 1) {
1820
1820
  const T = te.length > 0 || D > 0, P = T ? `repair-${D + 1}` : "initial";
1821
- G(n, T ? "repairing" : "generating");
1821
+ K(n, T ? "repairing" : "generating");
1822
1822
  const U = await Ae({
1823
1823
  currentFiles: Ie,
1824
1824
  workspaceContext: ue,
1825
1825
  diagnostics: te,
1826
1826
  repair: T
1827
1827
  });
1828
- G(n, "writing");
1828
+ K(n, "writing");
1829
1829
  const ae = await Ce({
1830
1830
  ...U,
1831
1831
  attemptLabel: P
@@ -1846,7 +1846,7 @@ function Za({
1846
1846
  (je) => je.label.startsWith("repair")
1847
1847
  ).length
1848
1848
  }
1849
- }, G(n, "typechecking"), ae.ok || D === We - 1)
1849
+ }, K(n, "typechecking"), ae.ok || D === We - 1)
1850
1850
  break;
1851
1851
  Ie = (((y = ae.changedFiles) == null ? void 0 : y.length) || 0) > 0 ? await I(
1852
1852
  Q = Array.from(
@@ -1859,7 +1859,7 @@ function Za({
1859
1859
  }
1860
1860
  if (!_)
1861
1861
  throw new Error("The app-builder loop ended without a validation result.");
1862
- G(n, _.ok ? "complete" : "failed"), nt(n, {
1862
+ K(n, _.ok ? "complete" : "failed"), nt(n, {
1863
1863
  status: _.ok ? "done" : "failed",
1864
1864
  result: _,
1865
1865
  error: _.error,
@@ -1882,15 +1882,15 @@ function Za({
1882
1882
  }), M(
1883
1883
  `Local Bridge stopped before it could validate the app: ${$}`,
1884
1884
  "blocked"
1885
- ), G(n, "failed");
1885
+ ), K(n, "failed");
1886
1886
  } finally {
1887
- Ge(!1), Ke(null), Y.current = null, window.clearTimeout(m);
1887
+ Ke(!1), Ge(null), Y.current = null, window.clearTimeout(m);
1888
1888
  }
1889
1889
  }
1890
1890
  async function jn(t) {
1891
1891
  var u, m;
1892
- let n = K.current;
1893
- n || (n = await ot(), K.current = n);
1892
+ let n = G.current;
1893
+ n || (n = await ot(), G.current = n);
1894
1894
  const i = n.readBrowserSandboxWorkspaceContext(), o = (m = (u = i.files) == null ? void 0 : u.editable) != null && m.length ? tn(
1895
1895
  i.files.editable,
1896
1896
  Se.current,
@@ -1902,7 +1902,7 @@ function Za({
1902
1902
  };
1903
1903
  }
1904
1904
  async function zn(t) {
1905
- const n = K.current;
1905
+ const n = G.current;
1906
1906
  return n ? n.readBrowserSandboxFiles(t) : [];
1907
1907
  }
1908
1908
  async function Et(t, n) {
@@ -2113,8 +2113,8 @@ function Za({
2113
2113
  }
2114
2114
  async function _n() {
2115
2115
  var u, m, k, w;
2116
- let t = K.current;
2117
- t || (t = await ot(), K.current = t);
2116
+ let t = G.current;
2117
+ t || (t = await ot(), G.current = t);
2118
2118
  const n = t.readBrowserSandboxWorkspaceContext(), i = (m = (u = n.files) == null ? void 0 : u.snapshot) != null && m.length ? n.files.snapshot : [
2119
2119
  ...((k = n.files) == null ? void 0 : k.source) || [],
2120
2120
  ...((w = n.files) == null ? void 0 : w.root) || []
@@ -2228,7 +2228,7 @@ function Za({
2228
2228
  );
2229
2229
  return o;
2230
2230
  }
2231
- async function Kn() {
2231
+ async function Gn() {
2232
2232
  if (!Pt) {
2233
2233
  M(
2234
2234
  "Publish is not configured in this host yet.",
@@ -2319,7 +2319,7 @@ function Za({
2319
2319
  }), M(`Publish failed: ${u}`, "blocked");
2320
2320
  }
2321
2321
  }
2322
- async function Gn(t) {
2322
+ async function Kn(t) {
2323
2323
  var m, k;
2324
2324
  const { attachments: n, prompt: i } = t, o = new AbortController();
2325
2325
  Y.current = o, Yt(!0);
@@ -2519,7 +2519,7 @@ function Za({
2519
2519
  ] }),
2520
2520
  /* @__PURE__ */ c(_r, { children: [
2521
2521
  /* @__PURE__ */ r(Ur, { children: "Cancel" }),
2522
- /* @__PURE__ */ r(Kr, { onClick: S, children: "Discard" })
2522
+ /* @__PURE__ */ r(Gr, { onClick: S, children: "Discard" })
2523
2523
  ] })
2524
2524
  ] })
2525
2525
  ] }) : null })
@@ -2611,7 +2611,7 @@ function Za({
2611
2611
  }
2612
2612
  ),
2613
2613
  ut.length > 0 ? /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1.5 border-t border-border px-2 py-2", children: ut.map((t) => /* @__PURE__ */ r(
2614
- Gt,
2614
+ Kt,
2615
2615
  {
2616
2616
  attachment: t,
2617
2617
  onRemove: $n
@@ -2865,7 +2865,7 @@ function Za({
2865
2865
  title: "Refresh manifest",
2866
2866
  "aria-label": "Refresh manifest",
2867
2867
  onClick: () => void Tr(),
2868
- children: /* @__PURE__ */ r(Gr, { className: "h-3.5 w-3.5" })
2868
+ children: /* @__PURE__ */ r(Kr, { className: "h-3.5 w-3.5" })
2869
2869
  }
2870
2870
  )
2871
2871
  ] }),
@@ -2902,7 +2902,7 @@ function Za({
2902
2902
  ] }),
2903
2903
  /* @__PURE__ */ c(_r, { children: [
2904
2904
  /* @__PURE__ */ r(Ur, { children: "Cancel" }),
2905
- /* @__PURE__ */ r(Kr, { onClick: () => void Nn(), children: "Reset app" })
2905
+ /* @__PURE__ */ r(Gr, { onClick: () => void Nn(), children: "Reset app" })
2906
2906
  ] })
2907
2907
  ] })
2908
2908
  ] }),
@@ -2931,7 +2931,7 @@ function Za({
2931
2931
  className: "gap-1.5 text-muted-foreground",
2932
2932
  disabled: X || ee || Ze === "saving" || fr === "publishing" || A !== "bridge" || !Pt,
2933
2933
  title: "Build, upload, and publish the current Data App",
2934
- onClick: () => void Kn(),
2934
+ onClick: () => void Gn(),
2935
2935
  children: [
2936
2936
  fr === "publishing" ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(ba, { className: "h-3.5 w-3.5" }),
2937
2937
  "Publish"
@@ -3034,7 +3034,7 @@ function Za({
3034
3034
  onClick: () => {
3035
3035
  A === "browser" ? (rt(), Oe()) : (z(f), Z((t) => t + 1));
3036
3036
  },
3037
- children: /* @__PURE__ */ r(Gr, { className: "h-3.5 w-3.5" })
3037
+ children: /* @__PURE__ */ r(Kr, { className: "h-3.5 w-3.5" })
3038
3038
  }
3039
3039
  )
3040
3040
  ] })
@@ -3069,7 +3069,7 @@ function Za({
3069
3069
  /* @__PURE__ */ r("span", { className: "ml-auto font-mono text-[10px] text-muted-foreground", children: pr.length })
3070
3070
  ] }),
3071
3071
  /* @__PURE__ */ r("div", { className: "max-h-72 shrink-0 overflow-y-auto border-b border-border p-2", children: /* @__PURE__ */ r(
3072
- Ga,
3072
+ Ka,
3073
3073
  {
3074
3074
  files: pr,
3075
3075
  selectedPath: yt,
@@ -3273,7 +3273,7 @@ function no({
3273
3273
  }
3274
3274
  ),
3275
3275
  S.attachments.length > 0 ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex flex-wrap gap-1.5", children: S.attachments.map((R) => /* @__PURE__ */ r(
3276
- Gt,
3276
+ Kt,
3277
3277
  {
3278
3278
  attachment: R,
3279
3279
  onRemove: (v) => s(S.id, v)
@@ -3290,10 +3290,10 @@ function ao({ message: e }) {
3290
3290
  var a;
3291
3291
  return /* @__PURE__ */ c("div", { className: "ml-auto max-w-[88%] rounded-[6px] rounded-br-[2px] bg-foreground/10 px-3 py-2 text-[13px] leading-relaxed text-foreground", children: [
3292
3292
  /* @__PURE__ */ r("div", { children: e.content }),
3293
- (a = e.attachments) != null && a.length ? /* @__PURE__ */ r("div", { className: "mt-2 flex flex-wrap gap-1.5", children: e.attachments.map((s) => /* @__PURE__ */ r(Gt, { attachment: s }, s.id)) }) : null
3293
+ (a = e.attachments) != null && a.length ? /* @__PURE__ */ r("div", { className: "mt-2 flex flex-wrap gap-1.5", children: e.attachments.map((s) => /* @__PURE__ */ r(Kt, { attachment: s }, s.id)) }) : null
3294
3294
  ] });
3295
3295
  }
3296
- function Gt({
3296
+ function Kt({
3297
3297
  attachment: e,
3298
3298
  onRemove: a
3299
3299
  }) {
@@ -3528,7 +3528,7 @@ function co({
3528
3528
  /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
3529
3529
  /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground" }),
3530
3530
  /* @__PURE__ */ r("span", { className: "text-[12.5px] font-medium text-foreground", children: d }),
3531
- /* @__PURE__ */ r("span", { className: "ml-auto shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground", children: Kt(s) })
3531
+ /* @__PURE__ */ r("span", { className: "ml-auto shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground", children: Gt(s) })
3532
3532
  ] }),
3533
3533
  /* @__PURE__ */ r("div", { className: "mt-1 flex items-center justify-between gap-3", children: /* @__PURE__ */ r("span", { className: "text-[11px] leading-relaxed text-muted-foreground", children: l }) })
3534
3534
  ] });
@@ -3569,7 +3569,7 @@ function uo({
3569
3569
  d,
3570
3570
  " ·",
3571
3571
  " ",
3572
- Kt(h)
3572
+ Gt(h)
3573
3573
  ] })
3574
3574
  ] }),
3575
3575
  /* @__PURE__ */ c("div", { className: "space-y-2.5 border-t border-border/60 px-2.5 py-2", children: [
@@ -3669,7 +3669,7 @@ function po({
3669
3669
  (a || 0) + 1,
3670
3670
  " / ",
3671
3671
  We
3672
- ] }) : /* @__PURE__ */ r("span", { children: Kt(e) }) })
3672
+ ] }) : /* @__PURE__ */ r("span", { children: Gt(e) }) })
3673
3673
  ] });
3674
3674
  }
3675
3675
  function ho({ state: e }) {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../chunks/analyze-result-contract-ege_u6Nl.js"),e=require("../chunks/update-policy-BgONreNd.js");exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION=a.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION;exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION=a.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION;exports.isSemaphorDataAppCodegenSummary=a.isSemaphorDataAppCodegenSummary;exports.validateSemaphorDataAppCodegenSummary=a.validateSemaphorDataAppCodegenSummary;exports.CODEGEN_SUMMARY_SCHEMA_VERSION=e.CODEGEN_SUMMARY_SCHEMA_VERSION;exports.CODEGEN_SUMMARY_VALIDATOR_VERSION=e.CODEGEN_SUMMARY_VALIDATOR_VERSION;exports.CONTRACT_MANIFEST_SCHEMA_VERSION=e.CONTRACT_MANIFEST_SCHEMA_VERSION;exports.GENERATED_CONTRACT_SCHEMA_VERSION=e.GENERATED_CONTRACT_SCHEMA_VERSION;exports.GENERATED_CONTRACT_TYPESCRIPT_FILES=e.GENERATED_CONTRACT_TYPESCRIPT_FILES;exports.REQUIRED_GENERATED_CONTRACT_FILES=e.REQUIRED_GENERATED_CONTRACT_FILES;exports.assertValidCodegenSummary=e.assertValidCodegenSummary;exports.buildSemaphorGeneratedActiveInput=e.buildSemaphorGeneratedActiveInput;exports.buildSemaphorGeneratedInputOptionIntent=e.buildSemaphorGeneratedInputOptionIntent;exports.buildSemaphorGeneratedViewExecutionRequest=e.buildSemaphorGeneratedViewExecutionRequest;exports.buildSemaphorGeneratedViewExecutionRequests=e.buildSemaphorGeneratedViewExecutionRequests;exports.evaluateSemaphorDataAppContractUpdatePolicy=e.evaluateSemaphorDataAppContractUpdatePolicy;exports.validateCodegenSummary=e.validateCodegenSummary;exports.validateSemaphorGeneratedContract=e.validateSemaphorGeneratedContract;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../chunks/analyze-result-contract-BswhsmWT.js"),e=require("../chunks/update-policy-DnF_74zC.js");exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION=a.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION;exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION=a.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION;exports.isSemaphorDataAppCodegenSummary=a.isSemaphorDataAppCodegenSummary;exports.validateSemaphorDataAppCodegenSummary=a.validateSemaphorDataAppCodegenSummary;exports.CODEGEN_SUMMARY_SCHEMA_VERSION=e.CODEGEN_SUMMARY_SCHEMA_VERSION;exports.CODEGEN_SUMMARY_VALIDATOR_VERSION=e.CODEGEN_SUMMARY_VALIDATOR_VERSION;exports.CONTRACT_MANIFEST_SCHEMA_VERSION=e.CONTRACT_MANIFEST_SCHEMA_VERSION;exports.GENERATED_CONTRACT_SCHEMA_VERSION=e.GENERATED_CONTRACT_SCHEMA_VERSION;exports.GENERATED_CONTRACT_TYPESCRIPT_FILES=e.GENERATED_CONTRACT_TYPESCRIPT_FILES;exports.REQUIRED_GENERATED_CONTRACT_FILES=e.REQUIRED_GENERATED_CONTRACT_FILES;exports.assertValidCodegenSummary=e.assertValidCodegenSummary;exports.buildSemaphorGeneratedActiveInput=e.buildSemaphorGeneratedActiveInput;exports.buildSemaphorGeneratedInputOptionIntent=e.buildSemaphorGeneratedInputOptionIntent;exports.buildSemaphorGeneratedViewExecutionRequest=e.buildSemaphorGeneratedViewExecutionRequest;exports.buildSemaphorGeneratedViewExecutionRequests=e.buildSemaphorGeneratedViewExecutionRequests;exports.evaluateSemaphorDataAppContractUpdatePolicy=e.evaluateSemaphorDataAppContractUpdatePolicy;exports.validateCodegenSummary=e.validateCodegenSummary;exports.validateSemaphorGeneratedContract=e.validateSemaphorGeneratedContract;
@@ -1,5 +1,5 @@
1
- import { S as E, a as S, i as A, v as t } from "../chunks/analyze-result-contract-DnfF8kBb.js";
2
- import { C as R, a as r, b as s, G as C, c as o, R as p, d, e as O, f as i, g as m, h as n, i as N, v as T, j as I } from "../chunks/update-policy-CY2k-pJP.js";
1
+ import { S as E, a as S, i as A, v as t } from "../chunks/analyze-result-contract-CfOBEwaC.js";
2
+ import { C as R, a as r, b as s, G as C, c as o, R as p, d, e as O, f as i, g as m, h as n, i as N, v as T, j as I } from "../chunks/update-policy-De2NswtM.js";
3
3
  export {
4
4
  R as CODEGEN_SUMMARY_SCHEMA_VERSION,
5
5
  r as CODEGEN_SUMMARY_VALIDATOR_VERSION,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("../chunks/analyze-result-contract-ege_u6Nl.js"),R=require("../chunks/update-policy-BgONreNd.js"),he=require("node:crypto"),Ce="src/semaphor/generated",H=`// Generated by Semaphor Agent Plugin. Do not hand-edit analytics wiring here.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("../chunks/analyze-result-contract-BswhsmWT.js"),R=require("../chunks/update-policy-DnF_74zC.js"),he=require("node:crypto"),Ce="src/semaphor/generated",H=`// Generated by Semaphor Agent Plugin. Do not hand-edit analytics wiring here.
2
2
  // Regenerate from the accepted semaphor_plan_data_app codegenSummary when the plan changes.
3
3
  `;function Oe(e,n={}){R.assertValidCodegenSummary(e);const r=Me(e);if(r.views.length===0&&!n.allowEmpty)throw new Error("Contract generation produced zero executable views. Stop and ask for a different domain/goal or semantic model improvement; pass --allow-empty only for an explicit model-gap report.");const t=ke(r),o=Ne({contract:r,files:t,generatorName:n.generatorName||"react-semaphor/data-app-codegen/node",generatorVersion:n.generatorVersion||"unknown"}),a={...t,"contract.manifest.json":`${JSON.stringify(o,null,2)}
4
4
  `};return{schemaVersion:R.GENERATED_CONTRACT_SCHEMA_VERSION,files:a,manifest:o,contentHash:String(o.generatedContentHash||""),usageExample:Te(r),warnings:r.warnings,stats:{inputCount:r.inputs.length,executableViewCount:r.views.length,presentationViewCount:r.presentationViews.length,queryCount:r.views.length,optionQueryCount:r.optionQueries.length}}}function Me(e){var d,p,m,i,l,g,h,I,$,M,b,E;const n=[],r=[];for(const s of e.inputs){S(r,s.fieldRef);for(const V of s.bindings||[])S(r,V.fieldRef);S(r,(d=s.optionQuery)==null?void 0:d.valueFieldRef),S(r,(p=s.optionQuery)==null?void 0:p.labelFieldRef),S(r,(m=s.optionQuery)==null?void 0:m.filterFieldRef),D(r,(i=s.optionQuery)==null?void 0:i.spec)}for(const s of e.filterContracts){S(r,s.fieldRef),S(r,(l=s.optionQuery)==null?void 0:l.valueFieldRef),S(r,(g=s.optionQuery)==null?void 0:g.labelFieldRef),S(r,(h=s.optionQuery)==null?void 0:h.filterFieldRef),D(r,(I=s.optionQuery)==null?void 0:I.spec);for(const V of s.bindings||[])S(r,V.fieldRef)}for(const s of e.views){for(const V of s.fields||[])S(r,V);D(r,($=s.sdkSpec)==null?void 0:$.spec),D(r,s.visualSpec)}const t=e.implementationChecklist||{};for(const s of Object.values(t.bindingsByView||{}))for(const V of Array.isArray(s)?s:[])S(r,V.fieldRef),S(r,V.optionValueField),S(r,V.optionLabelField);for(const s of t.requiredInputOptions||[])S(r,s.visibleLabelField),S(r,s.optionValueField),S(r,s.runtimeFilterField);const o=pn([...e.sources.map(s=>({raw:s,key:Ie(s),aliases:Ve(s),name:""})),...r.map(s=>an(s)).filter(x)]);P(o,s=>{const V=F(s.raw);return j(s.raw.label||(V==null?void 0:V.datasetName)||(V==null?void 0:V.datasetId)||(V==null?void 0:V.name)||s.raw.kind||"source")});const a=ln(o),u=ne(r.filter(s=>s.name).map(s=>({raw:s,key:X(s),name:""})),s=>s.key);P(u,s=>j([s.raw.sourceKey?yn(s.raw.sourceKey):"",s.raw.aggregate?s.raw.aggregate.toLowerCase():"",s.raw.name].filter(Boolean).join("_")));const c=new Map(u.map(s=>[s.key,s.name])),w=e.inputs.map(s=>({raw:s,name:j(s.id||s.label||"input")}));P(w,s=>s.name);const f=w.filter(s=>!!s.raw.optionQuery).map(s=>({input:s,name:`${s.name}Options`,raw:s.raw.optionQuery}));P(f,s=>s.name);for(const s of f)un(s.raw.labelFieldRef,s.raw.valueFieldRef)&&dn(s.raw.valueFieldRef)&&n.push(`Input option query ${((M=s.raw.spec)==null?void 0:M.inputId)||s.input.raw.id||s.name} uses identifier field ${s.raw.valueFieldRef.name} as both label and value. It can execute, but the UI will show key values unless the semantic model exposes a human-readable label through a modeled relationship.`);const y=e.views.filter(s=>{var V,K;return!!((V=s.sdkSpec)!=null&&V.builder&&((K=s.sdkSpec)!=null&&K.spec))}).map(s=>({raw:s,name:j(s.id||s.title||"query")}));P(y,s=>s.name);const k=e.views.filter(s=>fe(s)&&!("sdkSpec"in s)).map(s=>sn(s));for(const s of e.views)(!("sdkSpec"in s)||!((b=s.sdkSpec)!=null&&b.builder)||!((E=s.sdkSpec)!=null&&E.spec))&&!fe(s)&&n.push(`Skipped view ${s.id||s.title||"unknown"} because it has no sdkSpec.`);return Ee({inputs:w,views:y,filterContracts:e.filterContracts}),{summary:e,title:e.title||"Semaphor Data App",sources:o,fields:u,inputs:w,optionQueries:f,views:y,presentationViews:k,filterContracts:e.filterContracts,checklist:t,sourceNameByKey:a,fieldNameByKey:c,warnings:n}}function Ee({inputs:e,views:n,filterContracts:r}){const t=new Set(e.map(a=>a.raw.id).filter(Boolean)),o=new Set(n.map(a=>a.raw.id).filter(Boolean));for(const[a,u]of r.entries()){if(!t.has(u.inputId))throw new Error(`filterContracts.${a}.inputId must reference a generated input.`);const c=new Set(u.appliesToViewIds||[]),w=new Set(u.notAppliedToViewIds||[]);for(const[f,y]of(u.appliesToViewIds||[]).entries())if(!o.has(y))throw new Error(`filterContracts.${a}.appliesToViewIds.${f} must reference an executable generated view.`);for(const[f,y]of(u.notAppliedToViewIds||[]).entries())if(!o.has(y))throw new Error(`filterContracts.${a}.notAppliedToViewIds.${f} must reference an executable generated view.`);for(const[f,y]of(u.bindings||[]).entries()){if(!o.has(y.viewId))throw new Error(`filterContracts.${a}.bindings.${f}.viewId must reference an executable generated view.`);if(!c.has(y.viewId))throw new Error(`filterContracts.${a}.bindings.${f}.viewId must be included in appliesToViewIds.`);if(w.has(y.viewId))throw new Error(`filterContracts.${a}.bindings.${f}.viewId must not be listed in notAppliedToViewIds.`)}}}function ke(e){return{"sources.ts":ve(e),"fields.ts":qe(e),"inputs.ts":De(e),"queries.ts":Pe(e),"bindings.ts":Le(e),"accessors.ts":Ye(e),"metadata.ts":We(e),"index.ts":Xe(),"USAGE.md":Ae(e)}}function Ne({contract:e,files:n,generatorName:r,generatorVersion:t}){return{schemaVersion:R.CONTRACT_MANIFEST_SCHEMA_VERSION,generatedContractSchemaVersion:R.GENERATED_CONTRACT_SCHEMA_VERSION,generator:{name:r,version:t},generatedContentHash:Ge(n),codegenSummaryValidatorVersion:R.CODEGEN_SUMMARY_VALIDATOR_VERSION,codegenSummaryHash:xe(e.summary),codegenSummary:e.summary}}function Ge(e){const n=he.createHash("sha256");for(const r of Object.keys(e).filter(t=>t.endsWith(".ts")).sort())n.update(r),n.update("\0"),n.update(e[r]),n.update("\0");return`sha256:${n.digest("hex")}`}function Ae(e){const n=["# Semaphor Generated Data App Contract","","Generated files in this directory are governed Semaphor analytics wiring. Do not hand-edit them.","","Use the app-facing exports from `index.ts`:","","- `queries`: generated governed query factories.","- `queryOptionsForView`: active-input wiring for each generated view.","- `rowsForView`: table/records row readers.","- `rowValuesForView`: friendly row object readers for chart/table views.","- `metricValuesForView`: friendly metric-value readers.","- `kpiPropsForView`: KPI component props derived from runtime metric results.","- `roleValuesForView`: canonical dimension/measure/date/id role readers.","- `appInputSpecs`: generated input/filter specs.","- `inputOptionQueries`: option-list query factories for generated inputs.","- `semaphorGeneratedContractMetadata`: generated view/input metadata and presentation-only views.","","Start with these exports before opening large generated internals such as `metadata.ts`.",""];return e.views.length>0&&(n.push("Generated executable views:"),e.views.forEach(r=>{n.push(`- \`${r.raw.id}\`: ${r.raw.title||r.name}`)}),n.push("")),e.inputs.length>0&&(n.push("Generated inputs:"),e.inputs.forEach(r=>{n.push(`- \`${r.raw.id}\`: ${r.raw.label||r.name}`)}),n.push("")),`${n.join(`
@@ -1,6 +1,6 @@
1
- import { S as Vn, a as Fn, i as bn, v as kn } from "../chunks/analyze-result-contract-DnfF8kBb.js";
2
- import { d as ke, G as fe, a as Re, b as Me } from "../chunks/update-policy-CY2k-pJP.js";
3
- import { C as Mn, c as Cn, R as On, e as xn, f as Gn, g as Nn, h as En, i as An, v as jn, j as vn } from "../chunks/update-policy-CY2k-pJP.js";
1
+ import { S as Vn, a as Fn, i as bn, v as kn } from "../chunks/analyze-result-contract-CfOBEwaC.js";
2
+ import { d as ke, G as fe, a as Re, b as Me } from "../chunks/update-policy-De2NswtM.js";
3
+ import { C as Mn, c as Cn, R as On, e as xn, f as Gn, g as Nn, h as En, i as An, v as jn, j as vn } from "../chunks/update-policy-De2NswtM.js";
4
4
  import { createHash as ye } from "node:crypto";
5
5
  const wn = "src/semaphor/generated", v = `// Generated by Semaphor Agent Plugin. Do not hand-edit analytics wiring here.
6
6
  // Regenerate from the accepted semaphor_plan_data_app codegenSummary when the plan changes.