react-semaphor 0.1.579 → 0.1.580

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 (38) hide show
  1. package/dist/assistant-context/index.js +1 -1
  2. package/dist/assistant-protocol/index.js +52 -50
  3. package/dist/briefings/index.js +1 -1
  4. package/dist/chunks/add-to-dashboard-DhP8wVtM.js +291 -0
  5. package/dist/chunks/{assistant-chat-DBuKmREJ.js → assistant-chat-CUwGURJj.js} +2261 -2184
  6. package/dist/chunks/{bookmark-impact-MH4Dr-Ya.js → bookmark-impact-BNyR-yDX.js} +1 -1
  7. package/dist/chunks/{card-filter-builder-B9vtXVIZ.js → card-filter-builder-k9yqDSw8.js} +168 -180
  8. package/dist/chunks/{comparison-window-caption-PtcDWvkN.js → comparison-window-caption-DdLqMgiG.js} +180 -183
  9. package/dist/chunks/{dashboard-C4fyqxvV.js → dashboard-DvcAk8uJ.js} +1 -1
  10. package/dist/chunks/{dashboard-briefing-launcher-A9CLFv0s.js → dashboard-briefing-launcher-DBgS97ZH.js} +154 -154
  11. package/dist/chunks/{dashboard-controls-oKDW-835.js → dashboard-controls-BiZ1rlNC.js} +7 -7
  12. package/dist/chunks/{dashboard-json-Bej2NBkS.js → dashboard-json-B25xzYcJ.js} +1 -1
  13. package/dist/chunks/{dates-BhL-mimk.js → dates-3Pah03_l.js} +4 -4
  14. package/dist/chunks/{edit-dashboard-visual-BFsCY2GP.js → edit-dashboard-visual-DYuO3mEU.js} +8 -9
  15. package/dist/chunks/{filter-reach-copy-Xus3MfSo.js → filter-reach-copy-CzLt96tq.js} +124 -124
  16. package/dist/chunks/{index-CwlaI-UP.js → index-BMZq6JT6.js} +1 -1
  17. package/dist/chunks/{report-preferences-dialog-CcekIvkV.js → report-preferences-dialog-DpAetrdY.js} +7 -7
  18. package/dist/chunks/{resolve-dashboard-input-context-DoZHMivF.js → resolve-dashboard-input-context-CNxtkCzj.js} +6265 -6190
  19. package/dist/chunks/{saved-dashboard-context-LiDPCJ3r.js → saved-dashboard-context-Bnt0H7mi.js} +2 -2
  20. package/dist/chunks/{semaphor-ready-indicator-cAOfbBuc.js → semaphor-ready-indicator-Dwmvmf0S.js} +15009 -14989
  21. package/dist/chunks/{shelf-drop-preview-context-CwoYR7v1.js → shelf-drop-preview-context-CiveteBS.js} +2 -2
  22. package/dist/chunks/{stored-dashboard-CjnPEWO-.js → stored-dashboard-D3gu-D7A.js} +66 -66
  23. package/dist/chunks/{table-export-sheet-CP8zSOhj.js → table-export-sheet-BNGSJA2N.js} +1 -1
  24. package/dist/chunks/{variable-draft-T4EOBvcu.js → variable-draft-C3_RL2gI.js} +2 -2
  25. package/dist/dashboard/index.js +1 -1
  26. package/dist/dashboard-authoring/index.js +356 -349
  27. package/dist/format-utils/index.js +4 -4
  28. package/dist/index.js +11 -11
  29. package/dist/style.css +1 -1
  30. package/dist/surfboard/index.js +1 -1
  31. package/dist/types/shared/assistant-protocol/model-change.d.ts +23 -3
  32. package/dist/types/shared/assistant-protocol/parts.d.ts +10 -1
  33. package/dist/types/shared/dashboard-authoring/changes/aggregates.d.ts +2 -0
  34. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +9 -58
  35. package/dist/types/shared/dashboard-authoring/changes/domain-change.d.ts +1738 -0
  36. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  37. package/package.json +1 -1
  38. package/dist/chunks/add-to-dashboard-DQFuDA5R.js +0 -271
@@ -1,4 +1,4 @@
1
- import { A as e, a as t, b as r, c as d, d as o, p as i, e as n, f as p } from "../chunks/saved-dashboard-context-LiDPCJ3r.js";
1
+ import { A as e, a as t, b as r, c as d, d as o, p as i, e as n, f as p } from "../chunks/saved-dashboard-context-Bnt0H7mi.js";
2
2
  export {
3
3
  e as AssistantContextSourceError,
4
4
  t as assistantCardReplayFields,
@@ -1,18 +1,18 @@
1
1
  import { z as e } from "zod";
2
2
  import { s as g } from "../chunks/analytics-base-schemas-BaIQrEzX.js";
3
3
  import { a as p, A as s, b as x, c } from "../chunks/context-BTLBjQNh.js";
4
- import { e as O, k as L, l as q, o as F, g as U, d as $, n as M, h as P, m as j, i as w, j as V, f as Y, r as J } from "../chunks/context-BTLBjQNh.js";
5
- import { t as C } from "../chunks/add-to-dashboard-DQFuDA5R.js";
6
- import { A as W, n as X, C as z, e as G, l as H, k as Q, f as Z, o as ee, p as se, r as ae, u as te, q as oe, s as re, h as ne, m as de, i as ie, d as ce, a as le, j as ue, c as Se, b as me, g as Ae, v as he, w as be } from "../chunks/add-to-dashboard-DQFuDA5R.js";
7
- import { p as Te, a as ge, r as pe } from "../chunks/availability-Bp5Gfu1I.js";
8
- import { A as Ce, a as ye, D as _e, i as Ie } from "../chunks/conversation-sQiWYUOb.js";
9
- const y = [
4
+ import { e as L, k as B, l as q, o as F, g as U, d as M, n as $, h as P, m as j, i as w, j as V, f as Y, r as H } from "../chunks/context-BTLBjQNh.js";
5
+ import { t as C } from "../chunks/add-to-dashboard-DhP8wVtM.js";
6
+ import { A as K, n as W, C as G, e as X, M as z, l as Q, k as Z, f as ee, p as se, r as ae, u as te, x as oe, q as re, s as ne, h as de, m as ie, o as ce, i as le, d as ue, a as Se, j as Ae, c as me, b as he, g as be, v as fe, w as Te } from "../chunks/add-to-dashboard-DhP8wVtM.js";
7
+ import { p as pe, a as xe, r as Ce } from "../chunks/availability-Bp5Gfu1I.js";
8
+ import { A as ye, a as Ie, D as Ee, i as Ne } from "../chunks/conversation-sQiWYUOb.js";
9
+ const _ = [
10
10
  "matrix",
11
11
  "no_query",
12
12
  "document_section",
13
13
  "blocked",
14
14
  "pending"
15
- ], _ = e.object({
15
+ ], y = e.object({
16
16
  turnId: e.string().min(1).max(s.idChars),
17
17
  conversationId: e.string().min(1).max(s.idChars).optional(),
18
18
  message: e.string().min(1).max(s.messageChars),
@@ -25,7 +25,7 @@ const y = [
25
25
  }).strict().optional(),
26
26
  selectedCardUnavailable: e.object({
27
27
  cardId: e.string().min(1).max(s.idChars),
28
- reason: e.enum(y),
28
+ reason: e.enum(_),
29
29
  message: e.string().max(s.textChars).optional()
30
30
  }).strict().optional(),
31
31
  taggedFields: e.array(x).max(s.taggedFields).optional(),
@@ -64,7 +64,7 @@ function k(r) {
64
64
  `context: ${t} bytes exceeds ${s.contextBytes}`
65
65
  );
66
66
  }
67
- const o = _.safeParse(a);
67
+ const o = y.safeParse(a);
68
68
  if (!o.success)
69
69
  return {
70
70
  ok: !1,
@@ -75,13 +75,13 @@ function k(r) {
75
75
  };
76
76
  if (!o.data.message.trim())
77
77
  return { ok: !1, code: "context_invalid", issues: ["message: must not be blank"] };
78
- const { selectedCardRequest: S, selectedCardUnavailable: m } = o.data, A = (b = o.data.context.selectedCard) == null ? void 0 : b.id, i = [
78
+ const { selectedCardRequest: S, selectedCardUnavailable: A } = o.data, m = (b = o.data.context.selectedCard) == null ? void 0 : b.id, i = [
79
79
  ...S ? [["selectedCardRequest", S.cardId]] : [],
80
- ...m ? [["selectedCardUnavailable", m.cardId]] : []
80
+ ...A ? [["selectedCardUnavailable", A.cardId]] : []
81
81
  ], h = [
82
82
  ...i.length > 1 ? ["selectedCardRequest, selectedCardUnavailable: send one of them, not both"] : [],
83
- ...i.filter(([, t]) => t !== A).map(([t]) => `${t}: not the card the context asks about`),
84
- ...A && i.length === 0 ? ["selectedCardRequest: the asked-about card needs its request or selectedCardUnavailable"] : [],
83
+ ...i.filter(([, t]) => t !== m).map(([t]) => `${t}: not the card the context asks about`),
84
+ ...m && i.length === 0 ? ["selectedCardRequest: the asked-about card needs its request or selectedCardUnavailable"] : [],
85
85
  ...C(o.data.context, o.data.taggedFields ?? []),
86
86
  ...I(o.data.context, o.data.openDashboard)
87
87
  ];
@@ -95,56 +95,58 @@ function d(r) {
95
95
  return { ok: !1, code: "context_too_large", issues: [r] };
96
96
  }
97
97
  export {
98
- W as ANSWER_PART_PLACEMENT,
99
- X as ASSISTANT_CARD_TYPES,
100
- y as ASSISTANT_CARD_UNAVAILABLE_REASONS,
101
- O as ASSISTANT_CONTEXT_VERSION,
102
- Ce as ASSISTANT_LAYOUTS,
98
+ K as ANSWER_PART_PLACEMENT,
99
+ W as ASSISTANT_CARD_TYPES,
100
+ _ as ASSISTANT_CARD_UNAVAILABLE_REASONS,
101
+ L as ASSISTANT_CONTEXT_VERSION,
102
+ ye as ASSISTANT_LAYOUTS,
103
103
  s as ASSISTANT_LIMITS,
104
- ye as ASSISTANT_NAME_MAX_CHARS,
105
- L as ASSISTANT_PARTS_VERSION,
104
+ Ie as ASSISTANT_NAME_MAX_CHARS,
105
+ B as ASSISTANT_PARTS_VERSION,
106
106
  q as ASSISTANT_REFUSAL_CODES,
107
107
  F as ASSISTANT_REFUSAL_MESSAGES,
108
108
  U as ASSISTANT_SURFACES,
109
109
  T as ASSISTANT_TURN_BODY_BYTES,
110
- $ as AssistantContextTooLargeError,
111
- z as COPIED_CONVERSATION_FIELDS,
112
- G as COPIED_TURN_FIELDS,
113
- _e as DEFAULT_ASSISTANT_NAME,
114
- H as addableSourceKey,
115
- Q as answerTextOf,
110
+ M as AssistantContextTooLargeError,
111
+ G as COPIED_CONVERSATION_FIELDS,
112
+ X as COPIED_TURN_FIELDS,
113
+ Ee as DEFAULT_ASSISTANT_NAME,
114
+ z as MODEL_CHANGE_STALE_VALUES_SHOWN,
115
+ Q as addableSourceKey,
116
+ Z as answerTextOf,
116
117
  x as assistantCardFieldSchema,
117
118
  p as assistantContextSchema,
118
119
  c as assistantJsonBytes,
119
- M as assistantRefusalMessage,
120
+ $ as assistantRefusalMessage,
120
121
  P as compareAssistantContexts,
121
- Z as conversationText,
122
+ ee as conversationText,
122
123
  j as dailyLimitMessage,
123
124
  w as describeCardField,
124
125
  V as describeSource,
125
126
  Y as fitAssistantText,
126
- Ie as isAssistantLayout,
127
- ee as modelChangeLinkOutcomeWords,
128
- se as modelChangeLinkRefusal,
129
- ae as modelChangeOutcomeUnclear,
130
- te as modelChangeRefusalMessage,
131
- Te as parseAssistantTokenConfig,
127
+ Ne as isAssistantLayout,
128
+ se as modelChangeLinkOutcomeWords,
129
+ ae as modelChangeLinkRefusal,
130
+ te as modelChangeOutcomeUnclear,
131
+ oe as modelChangeRefusalMessage,
132
+ pe as parseAssistantTokenConfig,
132
133
  k as parseAssistantTurnRequest,
133
- oe as questionForModel,
134
- ge as readAssistantTokenConfig,
135
- J as renderContextForModel,
136
- pe as resolveAssistantAvailability,
137
- re as sameCardField,
138
- ne as showsInAnswerBody,
139
- de as sourceRefLabel,
140
- ie as storedPartKind,
141
- ce as storedTurnEnding,
142
- le as taggableFields,
134
+ re as questionForModel,
135
+ xe as readAssistantTokenConfig,
136
+ H as renderContextForModel,
137
+ Ce as resolveAssistantAvailability,
138
+ ne as sameCardField,
139
+ de as showsInAnswerBody,
140
+ ie as sourceRefLabel,
141
+ ce as staleValuesOf,
142
+ le as storedPartKind,
143
+ ue as storedTurnEnding,
144
+ Se as taggableFields,
143
145
  C as taggedFieldIssues,
144
- ue as textPartKind,
145
- Se as toTranscriptChunks,
146
- me as toTranscriptPart,
147
- Ae as toolName,
148
- he as visualInputOf,
149
- be as workingNotesOf
146
+ Ae as textPartKind,
147
+ me as toTranscriptChunks,
148
+ he as toTranscriptPart,
149
+ be as toolName,
150
+ fe as visualInputOf,
151
+ Te as workingNotesOf
150
152
  };
@@ -5,7 +5,7 @@ import "zod";
5
5
  import "../chunks/matrix-operation-contract-DCVinw1o.js";
6
6
  import "../chunks/analytics-base-schemas-BaIQrEzX.js";
7
7
  import "../value-format-preferences/index.js";
8
- import { A as g, J as l, a2 as B, F as m, a4 as E, z as c, B as I, E as T, K as d, C, D as u, M as A, Z as h, i as p, _ as D, $ as _, a5 as b, n as F, l as S, m as R, P as N, k as y, R as M, f as O, e as G, S as v, u as x, q as L, c as U, d as V, I as z, H, h as J, b as P, a as q, a6 as X, g as K, a0 as Q, V as Y, a3 as j, W as k, G as W, a1 as Z, r as $, j as w, X as ee, Y as ie, o as ae, L as re, Q as te, O as se, p as ne, s as oe, t as fe, N as ge, T as le, U as Be } from "../chunks/index-CwlaI-UP.js";
8
+ import { A as g, J as l, a2 as B, F as m, a4 as E, z as c, B as I, E as T, K as d, C, D as u, M as A, Z as h, i as p, _ as D, $ as _, a5 as b, n as F, l as S, m as R, P as N, k as y, R as M, f as O, e as G, S as v, u as x, q as L, c as U, d as V, I as z, H, h as J, b as P, a as q, a6 as X, g as K, a0 as Q, V as Y, a3 as j, W as k, G as W, a1 as Z, r as $, j as w, X as ee, Y as ie, o as ae, L as re, Q as te, O as se, p as ne, s as oe, t as fe, N as ge, T as le, U as Be } from "../chunks/index-BMZq6JT6.js";
9
9
  export {
10
10
  g as BRIEFING_ARTIFACT_FORMATS,
11
11
  l as BRIEFING_ATTACHMENT_FORMATS,
@@ -0,0 +1,291 @@
1
+ import { A as c, i as y, o as h } from "./context-BTLBjQNh.js";
2
+ function f(e, t) {
3
+ return e.role === t.role && e.name === t.name && e.aggregate === t.aggregate && e.granularity === t.granularity;
4
+ }
5
+ function S(e) {
6
+ var n, s;
7
+ const t = (n = e.selectedCard) == null ? void 0 : n.description;
8
+ return (t == null ? void 0 : t.status) !== "described" || t.sql || ((s = e.editing) == null ? void 0 : s.mode) === "sql" ? [] : t.fields;
9
+ }
10
+ function M(e, t) {
11
+ if (t.length === 0) return [];
12
+ if (t.length > c.taggedFields)
13
+ return [`taggedFields: at most ${c.taggedFields}`];
14
+ const n = S(e);
15
+ return t.flatMap((s, a) => n.some((o) => f(o, s)) ? t.slice(0, a).some((o) => f(o, s)) ? [`taggedFields.${a}: tagged twice`] : [] : [`taggedFields.${a}: not a field of the card the context asks about`]);
16
+ }
17
+ function q(e, t) {
18
+ return t != null && t.length ? `Fields of the asked-about card the user tagged in this question: ${t.map(y).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 U(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 T(e) {
39
+ if (e === "failed" || e === "interrupted")
40
+ return { kind: "refusal", code: "model_unavailable", message: h.model_unavailable };
41
+ if (e === "running")
42
+ return { kind: "refusal", code: "turn_in_progress", message: h.turn_in_progress };
43
+ }
44
+ function $(e, t) {
45
+ let n = -1;
46
+ e.forEach((a, o) => {
47
+ t(a) === "text" && (n = o);
48
+ });
49
+ let s = -1;
50
+ return e.forEach((a, o) => {
51
+ o < n && t(a) === "step" && (s = o);
52
+ }), new Set(e.filter((a, o) => o < s && t(a) === "text"));
53
+ }
54
+ const p = {
55
+ conversation: "nowhere",
56
+ text: "body",
57
+ stage: "details",
58
+ using: "details",
59
+ clarify: "body",
60
+ artifact: "body",
61
+ refusal: "body",
62
+ trace: "details",
63
+ proposal: "body",
64
+ proposal_operations: "nowhere",
65
+ proposal_refused: "body",
66
+ model_change: "body"
67
+ };
68
+ function P(e) {
69
+ return Object.hasOwn(p, e) && p[e] === "body";
70
+ }
71
+ function b(e) {
72
+ return e.kind === "text" ? v(e.text) : e.kind === "stage" && !e.change ? "step" : "other";
73
+ }
74
+ function v(e) {
75
+ return e.trim().length > 0 ? "text" : "other";
76
+ }
77
+ function V(e) {
78
+ const t = $(e, b);
79
+ return e.flatMap((n) => n.kind === "text" && !t.has(n) ? [n.text] : []).filter((n) => n.trim().length > 0).join(`
80
+
81
+ `);
82
+ }
83
+ const B = 5;
84
+ function K(e) {
85
+ if (!Array.isArray(e)) return;
86
+ const t = e.filter(
87
+ (n) => !!n && typeof n == "object" && typeof n.what == "string" && typeof n.now == "string"
88
+ );
89
+ return t.length > 0 ? t.map(({ what: n, now: s }) => ({ what: n, now: s })) : void 0;
90
+ }
91
+ const k = {
92
+ proposal_not_found: "This suggestion has expired. Ask for a new one.",
93
+ proposal_stale: "The data model changed while these were being added. Nothing was added; ask for a new suggestion.",
94
+ not_permitted: "You don’t have permission to change the data model.",
95
+ apply_in_progress: "They’re still being added.",
96
+ apply_outcome_unknown: "It isn’t clear whether they were added. Check the data model before asking again."
97
+ }, A = "They couldn’t be added.", N = {
98
+ ...k,
99
+ proposal_stale: "Someone changed these in the data model since they were suggested. Nothing was saved; ask for a new suggestion.",
100
+ apply_in_progress: "They’re still being saved.",
101
+ apply_outcome_unknown: "It isn’t clear whether they were saved. Check the data model before asking again."
102
+ }, E = "They couldn’t be saved.", g = {
103
+ exists: () => "it’s already in the model",
104
+ missing_fields: (e) => `a dataset or field it uses is no longer in ${e}`,
105
+ type_mismatch: () => "its fields’ types don’t match",
106
+ not_supported: () => "the data doesn’t support it"
107
+ };
108
+ function x(e, t) {
109
+ switch (e == null ? void 0 : e.status) {
110
+ case "added":
111
+ return "added";
112
+ case "existing":
113
+ return "already in the model";
114
+ case "left_out":
115
+ return "left out";
116
+ case "refused":
117
+ return `not added: ${O(e.reasons, t)}`;
118
+ default:
119
+ return "outcome unknown";
120
+ }
121
+ }
122
+ function O(e, t) {
123
+ const n = e.find((s) => Object.hasOwn(g, s));
124
+ return n ? g[n](t) : "it no longer fits the model";
125
+ }
126
+ function m(e) {
127
+ return e === "apply_outcome_unknown";
128
+ }
129
+ function w(e, t) {
130
+ const n = t === "edits" ? N : k;
131
+ return typeof e == "string" && Object.hasOwn(n, e) ? n[e] : t === "edits" ? E : A;
132
+ }
133
+ const z = {
134
+ conversationId: "with tool calls",
135
+ addedSources: "left out",
136
+ allows: "left out",
137
+ turns: "shown"
138
+ }, J = {
139
+ turnId: "left out",
140
+ startedAt: "shown",
141
+ // the first turn's, in the header
142
+ message: "shown",
143
+ taggedFields: "shown",
144
+ // before the question, as the assistant reads them
145
+ parts: "shown",
146
+ outcome: "shown",
147
+ // a turn that didn't end with its answer says so
148
+ toolCalls: "with tool calls",
149
+ model: "with tool calls",
150
+ instructionsVersion: "with tool calls"
151
+ };
152
+ function W(e, t) {
153
+ var o;
154
+ const n = (o = e.turns[0]) == null ? void 0 : o.startedAt, s = [
155
+ `${t.assistantName} conversation${n ? ` · ${n.slice(0, 16).replace("T", " ")} UTC` : ""}`,
156
+ ...t.toolCalls ? [`Conversation ${e.conversationId}`] : []
157
+ ], a = e.turns.map((r) => {
158
+ const d = [`You: ${I(r)}`, "", `${t.assistantName}:`], i = T(r.outcome), l = [...r.parts, ...i ? [i] : []];
159
+ return d.push(...L(l)), t.toolCalls && r.toolCalls && d.push(...F(r.toolCalls, r.model, r.instructionsVersion)), d.join(`
160
+ `);
161
+ });
162
+ return [s.join(`
163
+ `), ...a].join(`
164
+
165
+ `) + `
166
+ `;
167
+ }
168
+ function I(e) {
169
+ return [...(e.taggedFields ?? []).map((n) => `@${n.label}`), e.message].join(" ");
170
+ }
171
+ function L(e) {
172
+ const t = $(e, b), n = /* @__PURE__ */ new Set(), s = [];
173
+ for (const a of e)
174
+ switch (a.kind) {
175
+ case "text":
176
+ !t.has(a) && a.text.trim() && s.push(a.text.trim());
177
+ break;
178
+ case "proposal":
179
+ s.push("Dashboard changes", ...a.changes.filter((o) => o.sentence).map((o) => `+ ${o.sentence}`));
180
+ break;
181
+ case "proposal_refused":
182
+ s.push("Not added", `! ${a.message}`);
183
+ break;
184
+ case "model_change":
185
+ s.push(...R(a));
186
+ break;
187
+ case "clarify":
188
+ s.push(
189
+ a.multiple ? `${a.question} (pick any)` : a.question,
190
+ ...a.options.map((o, r) => ` ${r + 1}. ${o.label}`)
191
+ );
192
+ break;
193
+ case "artifact":
194
+ s.push(`[Result: ${a.artifact.title}]`);
195
+ break;
196
+ case "refusal":
197
+ s.push(a.message);
198
+ break;
199
+ case "stage":
200
+ n.add(a.stageId);
201
+ break;
202
+ case "using":
203
+ case "trace":
204
+ case "conversation":
205
+ case "proposal_operations":
206
+ break;
207
+ default:
208
+ return a;
209
+ }
210
+ return n.size && s.push(`(${n.size} ${n.size === 1 ? "step" : "steps"})`), s;
211
+ }
212
+ function F(e, t, n) {
213
+ const s = ["", "Tool calls:"];
214
+ return (t || n) && s.push(` model ${t ?? "unknown"}${n ? ` · instructions ${n}` : ""}`), e.length || s.push(" none"), e.forEach((a, o) => {
215
+ var u;
216
+ const r = a.durationMs === void 0 ? "" : ` · ${a.durationMs} ms`, d = a.rowCount === void 0 ? "" : ` · ${a.rowCount} ${a.rowCount === 1 ? "row" : "rows"}`, i = a.ok || (u = a.error) == null ? void 0 : u.trim(), l = i && !i.includes(`
217
+ `) ? `: ${i}` : "";
218
+ s.push(` ${o + 1}. ${D(a.tool)}${r}${d} · ${a.ok ? "ok" : `failed${l}`}`), i && !l && s.push(" error:", ..._(i)), i && !l && s.push(" input:"), s.push(..._(JSON.stringify(a.input ?? {}, null, 2)));
219
+ }), s;
220
+ }
221
+ function _(e) {
222
+ return e.split(`
223
+ `).map((t) => ` ${t}`);
224
+ }
225
+ function D(e) {
226
+ return e.replace(/^semaphor_/, "");
227
+ }
228
+ function R(e) {
229
+ const t = e.changes.map((s) => s.sentence ?? s.op), n = e.outcome;
230
+ if (e.changeKind === "edits") {
231
+ const s = n ? n.status === "applied" ? "saved" : n.status === "dismissed" ? "not saved: Not now" : `${m(n.code) ? "unclear whether saved" : "not saved"}: ${w(n.code, "edits")}` : "proposed", a = (n == null ? void 0 : n.status) === "refused" ? (n.changed ?? []).map((o) => ` Changed since: ${o.what} is now ${o.now}`) : [];
232
+ return [`Data model change (${s})`, ...t.map((o) => `+ ${o}`), ...a];
233
+ }
234
+ return n ? n.status === "dismissed" ? ["Data model change (not added: Not now)", ...t.map((s) => `+ ${s}`)] : n.status === "refused" ? [`Data model change (${m(n.code) ? "unclear whether added" : "not added"}: ${w(n.code)})`, ...t.map((a) => `+ ${a}`)] : [
235
+ "Data model change",
236
+ ...t.map((s, a) => `+ ${s} (${x(n.links[a], e.domainLabel)})`)
237
+ ] : ["Data model change (proposed)", ...t.map((s) => `+ ${s}`)];
238
+ }
239
+ function Y(e) {
240
+ if (e.kind === "semantic") return JSON.stringify(["semantic", e.domainId, e.datasetName]);
241
+ if (e.kind === "sql") return JSON.stringify(["sql", e.connectionId]);
242
+ }
243
+ function G(e) {
244
+ return e.label ?? (e.kind === "semantic" ? e.datasetName : e.kind === "physical" ? e.tableName : "SQL");
245
+ }
246
+ function H(e) {
247
+ return {
248
+ columns: e.columns,
249
+ records: e.records,
250
+ rowCount: e.rowCount,
251
+ governed: e.status.governed,
252
+ complete: e.status.complete,
253
+ truncated: e.status.truncated
254
+ };
255
+ }
256
+ const Q = {
257
+ number: "kpi",
258
+ line: "line",
259
+ bar: "bar",
260
+ stackedBar: "stackedBar",
261
+ table: "table"
262
+ };
263
+ export {
264
+ p as A,
265
+ z as C,
266
+ B as M,
267
+ S as a,
268
+ C as b,
269
+ U as c,
270
+ T as d,
271
+ J as e,
272
+ W as f,
273
+ D as g,
274
+ P as h,
275
+ b as i,
276
+ v as j,
277
+ V as k,
278
+ Y as l,
279
+ G as m,
280
+ Q as n,
281
+ K as o,
282
+ x as p,
283
+ q,
284
+ O as r,
285
+ f as s,
286
+ M as t,
287
+ m as u,
288
+ H as v,
289
+ $ as w,
290
+ w as x
291
+ };