react-semaphor 0.1.539 → 0.1.541

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 (51) hide show
  1. package/dist/assistant-context/index.js +1 -1
  2. package/dist/assistant-protocol/index.js +63 -54
  3. package/dist/brand-studio/index.js +1 -1
  4. package/dist/briefings/index.js +41 -38
  5. package/dist/chunks/add-to-dashboard-BuAqfA2Y.js +80 -0
  6. package/dist/chunks/{aggregate-table-row-presentation-BjK9YfMI.js → aggregate-table-row-presentation-B_vQjYR3.js} +319 -302
  7. package/dist/chunks/{assistant-chat-DgiSuFT4.js → assistant-chat-D1fDZD6O.js} +2448 -2228
  8. package/dist/chunks/{context-HD9usB1P.js → context-ClREvqCZ.js} +101 -102
  9. package/dist/chunks/{dashboard-y5BwcvzT.js → dashboard-B6IrON_Q.js} +1 -1
  10. package/dist/chunks/{dashboard-briefing-launcher-Bl3gCeBR.js → dashboard-briefing-launcher-DwjFpewq.js} +117 -117
  11. package/dist/chunks/{dashboard-controls-0EX0HiJt.js → dashboard-controls-C_BI28ME.js} +6 -6
  12. package/dist/chunks/{dashboard-json-6X_2BDiL.js → dashboard-json-DDY15Trn.js} +2 -2
  13. package/dist/chunks/{document-dashboard-inputs-BrYYlRVo.js → document-dashboard-inputs-DP_Op5mu.js} +1168 -1166
  14. package/dist/chunks/{edit-dashboard-visual-Bzchfgga.js → edit-dashboard-visual-CH2dzWW-.js} +5 -5
  15. package/dist/chunks/{index-CqMiAkay.js → index-DaQlghLY.js} +547 -511
  16. package/dist/chunks/report-preferences-dialog-DpNkFfQO.js +1950 -0
  17. package/dist/chunks/{saved-dashboard-context-Dqve2jlB.js → saved-dashboard-context-CJ2WpoMF.js} +2 -2
  18. package/dist/chunks/{semaphor-ready-indicator-ldcwmLoY.js → semaphor-ready-indicator-KT598QJq.js} +33482 -33334
  19. package/dist/chunks/{shelf-drop-preview-context-BWxunXTq.js → shelf-drop-preview-context-BxV3Fl8h.js} +3 -3
  20. package/dist/chunks/{switch-CvItuC1Q.js → switch-DWEWiv1J.js} +53 -52
  21. package/dist/chunks/{use-create-flow-overlay-state-RHgzVfcz.js → use-create-flow-overlay-state-DdD12SMY.js} +3 -3
  22. package/dist/dashboard/index.js +1 -1
  23. package/dist/dashboard-authoring/index.js +582 -568
  24. package/dist/format-utils/index.js +117 -114
  25. package/dist/index.js +11 -11
  26. package/dist/pdf-export-policy/index.js +20 -10
  27. package/dist/style.css +1 -1
  28. package/dist/surfboard/index.js +1 -1
  29. package/dist/types/briefings/attachment-outcomes.d.ts +23 -0
  30. package/dist/types/briefings/index.d.ts +1 -0
  31. package/dist/types/components/assistant/assistant-entry-points.d.ts +3 -0
  32. package/dist/types/components/assistant/assistant-store.d.ts +49 -1
  33. package/dist/types/components/assistant/use-assistant.d.ts +10 -1
  34. package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
  35. package/dist/types/lib/query-context/card-server-request.d.ts +5 -1
  36. package/dist/types/lib/types/common-types.d.ts +7 -0
  37. package/dist/types/lib/types/explorer-types.d.ts +2 -2
  38. package/dist/types/shared/assistant-protocol/context.d.ts +88 -66
  39. package/dist/types/shared/assistant-protocol/conversation.d.ts +3 -0
  40. package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
  41. package/dist/types/shared/assistant-protocol/limits.d.ts +2 -0
  42. package/dist/types/shared/assistant-protocol/request.d.ts +6 -1
  43. package/dist/types/shared/assistant-protocol/tagged-fields.d.ts +29 -0
  44. package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +20 -0
  45. package/dist/types/shared/format-utils/attachment-filter-line.d.ts +14 -0
  46. package/dist/types/shared/format-utils/filter-line.d.ts +7 -0
  47. package/dist/types/shared/format-utils/index.d.ts +1 -0
  48. package/dist/types/shared/format-utils/pdf-export-policy.d.ts +9 -0
  49. package/package.json +2 -1
  50. package/dist/chunks/add-to-dashboard-CxtTfISD.js +0 -56
  51. package/dist/chunks/report-preferences-dialog-CWhSbc5_.js +0 -1808
@@ -1,4 +1,4 @@
1
- import { A as e, a as t, b as r, c as o, p as d, d as n, e as p } from "../chunks/saved-dashboard-context-Dqve2jlB.js";
1
+ import { A as e, a as t, b as r, c as o, p as d, d as n, e as p } from "../chunks/saved-dashboard-context-CJ2WpoMF.js";
2
2
  export {
3
3
  e as AssistantContextSourceError,
4
4
  t as assistantCardReplayFields,
@@ -1,22 +1,23 @@
1
1
  import { z as e } from "zod";
2
- import { s as x } from "../chunks/analytics-base-schemas-BFAoRlkU.js";
3
- import { a as T, A as s, b as f } from "../chunks/context-HD9usB1P.js";
4
- import { d as N, h as R, k as v, c as k, j as E, e as q, i as L, g as U, f as B, r as M } from "../chunks/context-HD9usB1P.js";
5
- import { p as $, a as j, r as D } from "../chunks/availability-Bp5Gfu1I.js";
6
- import { A as F, a as J, D as V, i as w } from "../chunks/conversation-sQiWYUOb.js";
7
- import { A as Y, b as z, c as G, s as H, a as K, t as Q, v as W } from "../chunks/add-to-dashboard-CxtTfISD.js";
2
+ import { s as g } from "../chunks/analytics-base-schemas-BFAoRlkU.js";
3
+ import { a as x, b as f, A as s, c as T } from "../chunks/context-ClREvqCZ.js";
4
+ import { e as k, j as E, m as q, d as F, l as L, g as M, k as U, h as B, i as O, f as $, r as j } from "../chunks/context-ClREvqCZ.js";
5
+ import { t as C } from "../chunks/add-to-dashboard-BuAqfA2Y.js";
6
+ import { A as P, e as J, q as V, s as w, f as X, d as Y, a as z, c as G, b as H, v as K } from "../chunks/add-to-dashboard-BuAqfA2Y.js";
7
+ import { p as W, a as Z, r as ee } from "../chunks/availability-Bp5Gfu1I.js";
8
+ import { A as te, a as ae, D as oe, i as re } from "../chunks/conversation-sQiWYUOb.js";
8
9
  const p = [
9
10
  "matrix",
10
11
  "no_query",
11
12
  "document_section",
12
13
  "blocked",
13
14
  "pending"
14
- ], C = e.object({
15
+ ], b = e.object({
15
16
  turnId: e.string().min(1).max(s.idChars),
16
17
  conversationId: e.string().min(1).max(s.idChars).optional(),
17
18
  message: e.string().min(1).max(s.messageChars),
18
- context: T,
19
- addedSources: e.array(x).max(s.addedSources),
19
+ context: x,
20
+ addedSources: e.array(g).max(s.addedSources),
20
21
  selectedCardRequest: e.object({
21
22
  cardId: e.string().min(1).max(s.idChars),
22
23
  connectionId: e.string().min(1).max(s.idChars),
@@ -26,28 +27,29 @@ const p = [
26
27
  cardId: e.string().min(1).max(s.idChars),
27
28
  reason: e.enum(p),
28
29
  message: e.string().max(s.textChars).optional()
29
- }).strict().optional()
30
+ }).strict().optional(),
31
+ taggedFields: e.array(f).max(s.taggedFields).optional()
30
32
  }).strict();
31
- function h(n) {
32
- var A;
33
- const i = new TextEncoder().encode(n).length;
34
- if (i > s.requestBytes)
35
- return m(`body: ${i} bytes exceeds ${s.requestBytes}`);
33
+ function N(r) {
34
+ var m;
35
+ const d = new TextEncoder().encode(r).length;
36
+ if (d > s.requestBytes)
37
+ return A(`body: ${d} bytes exceeds ${s.requestBytes}`);
36
38
  let o;
37
39
  try {
38
- o = JSON.parse(n);
40
+ o = JSON.parse(r);
39
41
  } catch {
40
42
  return { ok: !1, code: "context_invalid", issues: ["body: not JSON"] };
41
43
  }
42
- const d = o && typeof o == "object" ? o.context : void 0;
43
- if (d !== void 0) {
44
- const t = f(d);
44
+ const i = o && typeof o == "object" ? o.context : void 0;
45
+ if (i !== void 0) {
46
+ const t = T(i);
45
47
  if (t > s.contextBytes)
46
- return m(
48
+ return A(
47
49
  `context: ${t} bytes exceeds ${s.contextBytes}`
48
50
  );
49
51
  }
50
- const a = C.safeParse(o);
52
+ const a = b.safeParse(o);
51
53
  if (!a.success)
52
54
  return {
53
55
  ok: !1,
@@ -58,47 +60,54 @@ function h(n) {
58
60
  };
59
61
  if (!a.data.message.trim())
60
62
  return { ok: !1, code: "context_invalid", issues: ["message: must not be blank"] };
61
- const { selectedCardRequest: c, selectedCardUnavailable: l } = a.data, u = (A = a.data.context.selectedCard) == null ? void 0 : A.id, r = [
63
+ const { selectedCardRequest: c, selectedCardUnavailable: l } = a.data, u = (m = a.data.context.selectedCard) == null ? void 0 : m.id, n = [
62
64
  ...c ? [["selectedCardRequest", c.cardId]] : [],
63
65
  ...l ? [["selectedCardUnavailable", l.cardId]] : []
64
66
  ], S = [
65
- ...r.length > 1 ? ["selectedCardRequest, selectedCardUnavailable: send one of them, not both"] : [],
66
- ...r.filter(([, t]) => t !== u).map(([t]) => `${t}: not the card the context asks about`),
67
- ...u && r.length === 0 ? ["selectedCardRequest: the asked-about card needs its request or selectedCardUnavailable"] : []
67
+ ...n.length > 1 ? ["selectedCardRequest, selectedCardUnavailable: send one of them, not both"] : [],
68
+ ...n.filter(([, t]) => t !== u).map(([t]) => `${t}: not the card the context asks about`),
69
+ ...u && n.length === 0 ? ["selectedCardRequest: the asked-about card needs its request or selectedCardUnavailable"] : [],
70
+ ...C(a.data.context, a.data.taggedFields ?? [])
68
71
  ];
69
72
  return S.length ? { ok: !1, code: "context_invalid", issues: S } : { ok: !0, value: a.data };
70
73
  }
71
- function m(n) {
72
- return { ok: !1, code: "context_too_large", issues: [n] };
74
+ function A(r) {
75
+ return { ok: !1, code: "context_too_large", issues: [r] };
73
76
  }
74
77
  export {
75
- Y as ASSISTANT_CARD_TYPES,
78
+ P as ASSISTANT_CARD_TYPES,
76
79
  p as ASSISTANT_CARD_UNAVAILABLE_REASONS,
77
- N as ASSISTANT_CONTEXT_VERSION,
78
- F as ASSISTANT_LAYOUTS,
80
+ k as ASSISTANT_CONTEXT_VERSION,
81
+ te as ASSISTANT_LAYOUTS,
79
82
  s as ASSISTANT_LIMITS,
80
- J as ASSISTANT_NAME_MAX_CHARS,
81
- R as ASSISTANT_PARTS_VERSION,
82
- v as ASSISTANT_REFUSAL_MESSAGES,
83
- k as AssistantContextTooLargeError,
84
- V as DEFAULT_ASSISTANT_NAME,
85
- z as addableSourceKey,
86
- T as assistantContextSchema,
87
- f as assistantJsonBytes,
88
- E as assistantRefusalMessage,
89
- q as compareAssistantContexts,
90
- L as dailyLimitMessage,
91
- U as describeSource,
92
- B as fitAssistantText,
93
- w as isAssistantLayout,
94
- $ as parseAssistantTokenConfig,
95
- h as parseAssistantTurnRequest,
96
- j as readAssistantTokenConfig,
97
- M as renderContextForModel,
98
- D as resolveAssistantAvailability,
99
- G as sourceRefLabel,
100
- H as storedTurnEnding,
101
- K as toTranscriptChunks,
102
- Q as toTranscriptPart,
103
- W as visualInputOf
83
+ ae as ASSISTANT_NAME_MAX_CHARS,
84
+ E as ASSISTANT_PARTS_VERSION,
85
+ q as ASSISTANT_REFUSAL_MESSAGES,
86
+ F as AssistantContextTooLargeError,
87
+ oe as DEFAULT_ASSISTANT_NAME,
88
+ J as addableSourceKey,
89
+ f as assistantCardFieldSchema,
90
+ x as assistantContextSchema,
91
+ T as assistantJsonBytes,
92
+ L as assistantRefusalMessage,
93
+ M as compareAssistantContexts,
94
+ U as dailyLimitMessage,
95
+ B as describeCardField,
96
+ O as describeSource,
97
+ $ as fitAssistantText,
98
+ re as isAssistantLayout,
99
+ W as parseAssistantTokenConfig,
100
+ N as parseAssistantTurnRequest,
101
+ V as questionForModel,
102
+ Z as readAssistantTokenConfig,
103
+ j as renderContextForModel,
104
+ ee as resolveAssistantAvailability,
105
+ w as sameCardField,
106
+ X as sourceRefLabel,
107
+ Y as storedTurnEnding,
108
+ z as taggableFields,
109
+ C as taggedFieldIssues,
110
+ G as toTranscriptChunks,
111
+ H as toTranscriptPart,
112
+ K as visualInputOf
104
113
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as d, jsx as r, Fragment as le } from "react/jsx-runtime";
2
2
  import m from "react";
3
- import { P as ge, a as be, B as C, b as fe, C as De, R as me, L as se, S as ue, c as je, T as Ie, d as Je, e as V, f as Le, g as M, h as $e, i as _e, j as Ue, k as Ve, l as E, m as K, n as Q, o as ee, I as he, p as re, q as oe, r as ke, s as xe, t as ye, u as ve, v as Ce, w as Me } from "../chunks/switch-CvItuC1Q.js";
3
+ import { P as ge, a as be, B as C, b as fe, C as De, R as me, L as se, S as ue, c as je, T as Ie, d as Je, e as V, f as Le, g as M, h as $e, i as _e, j as Ue, k as Ve, l as E, m as K, n as Q, o as ee, I as he, p as re, q as oe, r as ke, s as xe, t as ye, u as ve, v as Ce, w as Me } from "../chunks/switch-DWEWiv1J.js";
4
4
  import { A as Ge, p as We } from "../chunks/color-CJvdlFM_.js";
5
5
  import "../chunks/index-CuHybtft.js";
6
6
  import "../chunks/validators-Ej1DdCXa.js";
@@ -6,50 +6,53 @@ import "../chunks/matrix-operation-contract-B8PBF1Gd.js";
6
6
  import "../chunks/analytics-base-schemas-BFAoRlkU.js";
7
7
  import "zod";
8
8
  import "../value-format-preferences/index.js";
9
- import { K as l, O as B, J as m, N as u, T as c, L as d, D as p, M as I, y as C, w as D, x as E, X as T, u as h, Z as S, f as b, e as F, _ as A, C as y, A as _, c as N, d as R, S as M, Q as x, q as v, b as G, a as L, a6 as O, g as U, a5 as z, a1 as V, a2 as J, P as q, B as P, s as X, a3 as H, a4 as K, z as Q, U as w, Y as W, W as Y, t as Z, V as $, $ as j, a0 as k } from "../chunks/index-CqMiAkay.js";
9
+ import { L as l, a7 as B, P as m, K as d, O as c, U as u, M as I, D as E, N as C, y as T, w as p, x as D, Y as h, u as S, _ as A, f as F, e as _, $ as b, E as N, A as y, c as M, d as R, T as O, S as x, q as v, b as G, a as L, a9 as U, g as z, a6 as V, a2 as q, a8 as H, a3 as J, Q as P, B as X, s as K, a4 as Q, a5 as w, z as W, V as Y, Z, X as $, t as j, C as k, W as ii, a0 as ai, a1 as ei } from "../chunks/index-DaQlghLY.js";
10
10
  export {
11
11
  l as BRIEFING_ARTIFACT_FORMATS,
12
- B as BRIEFING_CONTENT_LIMITS,
13
- m as BRIEFING_KIND,
14
- u as BRIEFING_TEXT_LIMITS,
15
- c as BriefingContractError,
16
- d as DEFAULT_BRIEFING_ARTIFACT_FORMATS,
17
- p as DEFAULT_BRIEFING_SCHEDULE,
18
- I as MAX_BRIEFING_ATTACHMENTS,
19
- C as briefingScheduleDayOccurs,
20
- D as briefingScheduleMonths,
21
- E as briefingScheduleShortMonths,
22
- T as buildBriefingJobConfig,
23
- h as buildBriefingScheduleExpr,
24
- S as buildCreateBriefingRequest,
25
- b as buildDashboardTemporalSnapshotEntries,
26
- F as buildMatrixDeliveryEnvelope,
27
- A as buildUpdateBriefingRequest,
28
- y as canCreateBriefingForUser,
29
- _ as canonicalBriefingMonthDays,
30
- N as captureMatrixExport,
12
+ B as BRIEFING_ATTACHMENT_OMISSION_CODES,
13
+ m as BRIEFING_CONTENT_LIMITS,
14
+ d as BRIEFING_KIND,
15
+ c as BRIEFING_TEXT_LIMITS,
16
+ u as BriefingContractError,
17
+ I as DEFAULT_BRIEFING_ARTIFACT_FORMATS,
18
+ E as DEFAULT_BRIEFING_SCHEDULE,
19
+ C as MAX_BRIEFING_ATTACHMENTS,
20
+ T as briefingScheduleDayOccurs,
21
+ p as briefingScheduleMonths,
22
+ D as briefingScheduleShortMonths,
23
+ h as buildBriefingJobConfig,
24
+ S as buildBriefingScheduleExpr,
25
+ A as buildCreateBriefingRequest,
26
+ F as buildDashboardTemporalSnapshotEntries,
27
+ _ as buildMatrixDeliveryEnvelope,
28
+ b as buildUpdateBriefingRequest,
29
+ N as canCreateBriefingForUser,
30
+ y as canonicalBriefingMonthDays,
31
+ M as captureMatrixExport,
31
32
  R as describeBriefingSchedule,
32
- M as formatBriefingComparisonValues,
33
+ O as formatBriefingComparisonValues,
33
34
  x as formatBriefingDisplayValue,
34
35
  v as getBriefingCardAttachmentCapability,
35
36
  G as getBriefingCardAttachmentFormats,
36
37
  L as getBriefingCreationIntents,
37
- O as getBriefingDisplayTypeLabel,
38
- U as getBriefingPresentation,
39
- z as getDefaultBriefingCardAttachmentFormat,
40
- V as isBriefingArtifactFormat,
38
+ U as getBriefingDisplayTypeLabel,
39
+ z as getBriefingPresentation,
40
+ V as getDefaultBriefingCardAttachmentFormat,
41
+ q as isBriefingArtifactFormat,
42
+ H as isBriefingAttachmentOmissionCode,
41
43
  J as isBriefingDeliveryChannel,
42
- q as isBriefingNumericValue,
43
- P as isEmailOnlyBriefingDelivery,
44
- X as isValidBriefingTimezone,
45
- H as matrixDeliveryPayloadSchema,
46
- K as matrixDeliveryQuerySchema,
47
- Q as nextBriefingScheduleDates,
48
- w as normalizeBriefingContentDocument,
49
- W as normalizeBriefingDraft,
50
- Y as normalizeBriefingJobConfig,
51
- Z as parseBriefingScheduleExpr,
52
- $ as validateBriefingContentDocument,
53
- j as validateBriefingDraft,
54
- k as validateBriefingJobConfig
44
+ P as isBriefingNumericValue,
45
+ X as isEmailOnlyBriefingDelivery,
46
+ K as isValidBriefingTimezone,
47
+ Q as matrixDeliveryPayloadSchema,
48
+ w as matrixDeliveryQuerySchema,
49
+ W as nextBriefingScheduleDates,
50
+ Y as normalizeBriefingContentDocument,
51
+ Z as normalizeBriefingDraft,
52
+ $ as normalizeBriefingJobConfig,
53
+ j as parseBriefingScheduleExpr,
54
+ k as readBriefingOmittedAttachments,
55
+ ii as validateBriefingContentDocument,
56
+ ai as validateBriefingDraft,
57
+ ei as validateBriefingJobConfig
55
58
  };
@@ -0,0 +1,80 @@
1
+ import { A as d, h as l, m as s } from "./context-ClREvqCZ.js";
2
+ function u(e, t) {
3
+ return e.role === t.role && e.name === t.name && e.aggregate === t.aggregate && e.granularity === t.granularity;
4
+ }
5
+ function o(e) {
6
+ var n, r;
7
+ const t = (n = e.selectedCard) == null ? void 0 : n.description;
8
+ return (t == null ? void 0 : t.status) !== "described" || t.sql || ((r = e.editing) == null ? void 0 : r.mode) === "sql" ? [] : t.fields;
9
+ }
10
+ function f(e, t) {
11
+ if (t.length === 0) return [];
12
+ if (t.length > d.taggedFields)
13
+ return [`taggedFields: at most ${d.taggedFields}`];
14
+ const n = o(e);
15
+ return t.flatMap((r, a) => n.some((i) => u(i, r)) ? t.slice(0, a).some((i) => u(i, r)) ? [`taggedFields.${a}: tagged twice`] : [] : [`taggedFields.${a}: not a field of the card the context asks about`]);
16
+ }
17
+ function m(e, t) {
18
+ return t != null && t.length ? `Fields of the asked-about card the user tagged in this question: ${t.map(l).join("; ")}.
19
+
20
+ ${e}` : e;
21
+ }
22
+ function c(e) {
23
+ if (e.kind === "text") return { type: "text", text: e.text };
24
+ const { kind: t, ...n } = e;
25
+ return {
26
+ type: `data-${t}`,
27
+ ...e.kind === "stage" ? { id: e.stageId } : {},
28
+ data: n
29
+ };
30
+ }
31
+ function S(e, t) {
32
+ return e.kind !== "text" ? [c(e)] : [
33
+ { type: "text-start", id: t },
34
+ { type: "text-delta", id: t, delta: e.text },
35
+ { type: "text-end", id: t }
36
+ ];
37
+ }
38
+ function b(e) {
39
+ if (e === "failed" || e === "interrupted")
40
+ return { kind: "refusal", code: "model_unavailable", message: s.model_unavailable };
41
+ if (e === "running")
42
+ return { kind: "refusal", code: "turn_in_progress", message: s.turn_in_progress };
43
+ }
44
+ function k(e) {
45
+ if (e.kind === "semantic") return JSON.stringify(["semantic", e.domainId, e.datasetName]);
46
+ if (e.kind === "sql") return JSON.stringify(["sql", e.connectionId]);
47
+ }
48
+ function p(e) {
49
+ return e.label ?? (e.kind === "semantic" ? e.datasetName : e.kind === "physical" ? e.tableName : "SQL");
50
+ }
51
+ function F(e) {
52
+ return {
53
+ columns: e.columns,
54
+ records: e.records,
55
+ rowCount: e.rowCount,
56
+ governed: e.status.governed,
57
+ complete: e.status.complete,
58
+ truncated: e.status.truncated
59
+ };
60
+ }
61
+ const y = {
62
+ number: "kpi",
63
+ line: "line",
64
+ bar: "bar",
65
+ stackedBar: "stackedBar",
66
+ table: "table"
67
+ };
68
+ export {
69
+ y as A,
70
+ o as a,
71
+ c as b,
72
+ S as c,
73
+ b as d,
74
+ k as e,
75
+ p as f,
76
+ m as q,
77
+ u as s,
78
+ f as t,
79
+ F as v
80
+ };