react-semaphor 0.1.539 → 0.1.540

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 (33) 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/chunks/add-to-dashboard-BuAqfA2Y.js +80 -0
  5. package/dist/chunks/{assistant-chat-DgiSuFT4.js → assistant-chat-ya7xopaC.js} +2448 -2228
  6. package/dist/chunks/{context-HD9usB1P.js → context-ClREvqCZ.js} +101 -102
  7. package/dist/chunks/{dashboard-y5BwcvzT.js → dashboard-B6Bithfl.js} +1 -1
  8. package/dist/chunks/{dashboard-briefing-launcher-Bl3gCeBR.js → dashboard-briefing-launcher-DJI-zfEq.js} +116 -116
  9. package/dist/chunks/{dashboard-controls-0EX0HiJt.js → dashboard-controls-Dh7HqoKy.js} +5 -5
  10. package/dist/chunks/{dashboard-json-6X_2BDiL.js → dashboard-json-BnmlB71h.js} +2 -2
  11. package/dist/chunks/{edit-dashboard-visual-Bzchfgga.js → edit-dashboard-visual-CydOkSko.js} +4 -4
  12. package/dist/chunks/report-preferences-dialog-neMDolLg.js +1950 -0
  13. package/dist/chunks/{saved-dashboard-context-Dqve2jlB.js → saved-dashboard-context-CCrLpfSQ.js} +1 -1
  14. package/dist/chunks/{semaphor-ready-indicator-ldcwmLoY.js → semaphor-ready-indicator--4DWtVBu.js} +20103 -20048
  15. package/dist/chunks/{shelf-drop-preview-context-BWxunXTq.js → shelf-drop-preview-context-CpdB5ois.js} +2 -2
  16. package/dist/chunks/{switch-CvItuC1Q.js → switch-DWEWiv1J.js} +53 -52
  17. package/dist/chunks/{use-create-flow-overlay-state-RHgzVfcz.js → use-create-flow-overlay-state-8g6Zhphh.js} +2 -2
  18. package/dist/dashboard/index.js +1 -1
  19. package/dist/index.js +9 -9
  20. package/dist/style.css +1 -1
  21. package/dist/surfboard/index.js +1 -1
  22. package/dist/types/components/assistant/assistant-entry-points.d.ts +3 -0
  23. package/dist/types/components/assistant/assistant-store.d.ts +49 -1
  24. package/dist/types/components/assistant/use-assistant.d.ts +10 -1
  25. package/dist/types/shared/assistant-protocol/context.d.ts +88 -66
  26. package/dist/types/shared/assistant-protocol/conversation.d.ts +3 -0
  27. package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
  28. package/dist/types/shared/assistant-protocol/limits.d.ts +2 -0
  29. package/dist/types/shared/assistant-protocol/request.d.ts +6 -1
  30. package/dist/types/shared/assistant-protocol/tagged-fields.d.ts +29 -0
  31. package/package.json +2 -1
  32. package/dist/chunks/add-to-dashboard-CxtTfISD.js +0 -56
  33. 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-CCrLpfSQ.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";
@@ -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
+ };