react-semaphor 0.1.579 → 0.1.581

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
@@ -43,6 +43,7 @@ export * from './changes/diagnostics.js';
43
43
  export * from './changes/card-query-part.js';
44
44
  export * from './changes/read-card-query.js';
45
45
  export * from './changes/dashboard-change.js';
46
+ export * from './changes/domain-change.js';
46
47
  export { resolveDashboardChanges, type CardSource, type ChangeServices, type ChangeRef, type ChangeResolution, } from './changes/resolve-dashboard-changes.js';
47
48
  export * from './changes/resolve-dashboard-create.js';
48
49
  export * from './text-card-words/index.js';
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.579",
8
+ "version": "0.1.581",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -1,271 +0,0 @@
1
- import { A as c, i as k, o as f } from "./context-BTLBjQNh.js";
2
- function h(e, t) {
3
- return e.role === t.role && e.name === t.name && e.aggregate === t.aggregate && e.granularity === t.granularity;
4
- }
5
- function _(e) {
6
- var o, s;
7
- const t = (o = e.selectedCard) == null ? void 0 : o.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 R(e, t) {
11
- if (t.length === 0) return [];
12
- if (t.length > c.taggedFields)
13
- return [`taggedFields: at most ${c.taggedFields}`];
14
- const o = _(e);
15
- return t.flatMap((s, n) => o.some((a) => h(a, s)) ? t.slice(0, n).some((a) => h(a, s)) ? [`taggedFields.${n}: tagged twice`] : [] : [`taggedFields.${n}: not a field of the card the context asks about`]);
16
- }
17
- function j(e, t) {
18
- return t != null && t.length ? `Fields of the asked-about card the user tagged in this question: ${t.map(k).join("; ")}.
19
-
20
- ${e}` : e;
21
- }
22
- function y(e) {
23
- if (e.kind === "text") return { type: "text", text: e.text };
24
- const { kind: t, ...o } = e;
25
- return {
26
- type: `data-${t}`,
27
- ...e.kind === "stage" ? { id: e.stageId } : {},
28
- data: o
29
- };
30
- }
31
- function q(e, t) {
32
- return e.kind !== "text" ? [y(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 S(e) {
39
- if (e === "failed" || e === "interrupted")
40
- return { kind: "refusal", code: "model_unavailable", message: f.model_unavailable };
41
- if (e === "running")
42
- return { kind: "refusal", code: "turn_in_progress", message: f.turn_in_progress };
43
- }
44
- function b(e, t) {
45
- let o = -1;
46
- e.forEach((n, a) => {
47
- t(n) === "text" && (o = a);
48
- });
49
- let s = -1;
50
- return e.forEach((n, a) => {
51
- a < o && t(n) === "step" && (s = a);
52
- }), new Set(e.filter((n, a) => a < s && t(n) === "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 M(e) {
69
- return Object.hasOwn(p, e) && p[e] === "body";
70
- }
71
- function $(e) {
72
- return e.kind === "text" ? C(e.text) : e.kind === "stage" && !e.change ? "step" : "other";
73
- }
74
- function C(e) {
75
- return e.trim().length > 0 ? "text" : "other";
76
- }
77
- function P(e) {
78
- const t = b(e, $);
79
- return e.flatMap((o) => o.kind === "text" && !t.has(o) ? [o.text] : []).filter((o) => o.trim().length > 0).join(`
80
-
81
- `);
82
- }
83
- const g = {
84
- proposal_not_found: "This suggestion has expired. Ask for a new one.",
85
- proposal_stale: "The data model changed while these were being added. Nothing was added; ask for a new suggestion.",
86
- not_permitted: "You don’t have permission to change the data model.",
87
- apply_in_progress: "They’re still being added.",
88
- apply_outcome_unknown: "It isn’t clear whether they were added. Check the data model before asking again."
89
- }, T = "They couldn’t be added.", m = {
90
- exists: () => "it’s already in the model",
91
- missing_fields: (e) => `a dataset or field it uses is no longer in ${e}`,
92
- type_mismatch: () => "its fields’ types don’t match",
93
- not_supported: () => "the data doesn’t support it"
94
- };
95
- function x(e, t) {
96
- switch (e == null ? void 0 : e.status) {
97
- case "added":
98
- return "added";
99
- case "existing":
100
- return "already in the model";
101
- case "left_out":
102
- return "left out";
103
- case "refused":
104
- return `not added: ${N(e.reasons, t)}`;
105
- default:
106
- return "outcome unknown";
107
- }
108
- }
109
- function N(e, t) {
110
- const o = e.find((s) => Object.hasOwn(m, s));
111
- return o ? m[o](t) : "it no longer fits the model";
112
- }
113
- function A(e) {
114
- return e === "apply_outcome_unknown";
115
- }
116
- function I(e) {
117
- return typeof e == "string" && Object.hasOwn(g, e) ? g[e] : T;
118
- }
119
- const U = {
120
- conversationId: "with tool calls",
121
- addedSources: "left out",
122
- allows: "left out",
123
- turns: "shown"
124
- }, B = {
125
- turnId: "left out",
126
- startedAt: "shown",
127
- // the first turn's, in the header
128
- message: "shown",
129
- taggedFields: "shown",
130
- // before the question, as the assistant reads them
131
- parts: "shown",
132
- outcome: "shown",
133
- // a turn that didn't end with its answer says so
134
- toolCalls: "with tool calls",
135
- model: "with tool calls",
136
- instructionsVersion: "with tool calls"
137
- };
138
- function K(e, t) {
139
- var a;
140
- const o = (a = e.turns[0]) == null ? void 0 : a.startedAt, s = [
141
- `${t.assistantName} conversation${o ? ` · ${o.slice(0, 16).replace("T", " ")} UTC` : ""}`,
142
- ...t.toolCalls ? [`Conversation ${e.conversationId}`] : []
143
- ], n = e.turns.map((r) => {
144
- const d = [`You: ${v(r)}`, "", `${t.assistantName}:`], i = S(r.outcome), u = [...r.parts, ...i ? [i] : []];
145
- return d.push(...O(u)), t.toolCalls && r.toolCalls && d.push(...E(r.toolCalls, r.model, r.instructionsVersion)), d.join(`
146
- `);
147
- });
148
- return [s.join(`
149
- `), ...n].join(`
150
-
151
- `) + `
152
- `;
153
- }
154
- function v(e) {
155
- return [...(e.taggedFields ?? []).map((o) => `@${o.label}`), e.message].join(" ");
156
- }
157
- function O(e) {
158
- const t = b(e, $), o = /* @__PURE__ */ new Set(), s = [];
159
- for (const n of e)
160
- switch (n.kind) {
161
- case "text":
162
- !t.has(n) && n.text.trim() && s.push(n.text.trim());
163
- break;
164
- case "proposal":
165
- s.push("Dashboard changes", ...n.changes.filter((a) => a.sentence).map((a) => `+ ${a.sentence}`));
166
- break;
167
- case "proposal_refused":
168
- s.push("Not added", `! ${n.message}`);
169
- break;
170
- case "model_change":
171
- s.push(...L(n));
172
- break;
173
- case "clarify":
174
- s.push(
175
- n.multiple ? `${n.question} (pick any)` : n.question,
176
- ...n.options.map((a, r) => ` ${r + 1}. ${a.label}`)
177
- );
178
- break;
179
- case "artifact":
180
- s.push(`[Result: ${n.artifact.title}]`);
181
- break;
182
- case "refusal":
183
- s.push(n.message);
184
- break;
185
- case "stage":
186
- o.add(n.stageId);
187
- break;
188
- case "using":
189
- case "trace":
190
- case "conversation":
191
- case "proposal_operations":
192
- break;
193
- default:
194
- return n;
195
- }
196
- return o.size && s.push(`(${o.size} ${o.size === 1 ? "step" : "steps"})`), s;
197
- }
198
- function E(e, t, o) {
199
- const s = ["", "Tool calls:"];
200
- return (t || o) && s.push(` model ${t ?? "unknown"}${o ? ` · instructions ${o}` : ""}`), e.length || s.push(" none"), e.forEach((n, a) => {
201
- var l;
202
- const r = n.durationMs === void 0 ? "" : ` · ${n.durationMs} ms`, d = n.rowCount === void 0 ? "" : ` · ${n.rowCount} ${n.rowCount === 1 ? "row" : "rows"}`, i = n.ok || (l = n.error) == null ? void 0 : l.trim(), u = i && !i.includes(`
203
- `) ? `: ${i}` : "";
204
- s.push(` ${a + 1}. ${F(n.tool)}${r}${d} · ${n.ok ? "ok" : `failed${u}`}`), i && !u && s.push(" error:", ...w(i)), i && !u && s.push(" input:"), s.push(...w(JSON.stringify(n.input ?? {}, null, 2)));
205
- }), s;
206
- }
207
- function w(e) {
208
- return e.split(`
209
- `).map((t) => ` ${t}`);
210
- }
211
- function F(e) {
212
- return e.replace(/^semaphor_/, "");
213
- }
214
- function L(e) {
215
- const t = e.changes.map((s) => s.sentence ?? s.op), o = e.outcome;
216
- return o ? o.status === "dismissed" ? ["Data model change (not added: Not now)", ...t.map((s) => `+ ${s}`)] : o.status === "refused" ? [`Data model change (${A(o.code) ? "unclear whether added" : "not added"}: ${I(o.code)})`, ...t.map((n) => `+ ${n}`)] : [
217
- "Data model change",
218
- ...t.map((s, n) => `+ ${s} (${x(o.links[n], e.domainLabel)})`)
219
- ] : ["Data model change (proposed)", ...t.map((s) => `+ ${s}`)];
220
- }
221
- function z(e) {
222
- if (e.kind === "semantic") return JSON.stringify(["semantic", e.domainId, e.datasetName]);
223
- if (e.kind === "sql") return JSON.stringify(["sql", e.connectionId]);
224
- }
225
- function J(e) {
226
- return e.label ?? (e.kind === "semantic" ? e.datasetName : e.kind === "physical" ? e.tableName : "SQL");
227
- }
228
- function V(e) {
229
- return {
230
- columns: e.columns,
231
- records: e.records,
232
- rowCount: e.rowCount,
233
- governed: e.status.governed,
234
- complete: e.status.complete,
235
- truncated: e.status.truncated
236
- };
237
- }
238
- const Y = {
239
- number: "kpi",
240
- line: "line",
241
- bar: "bar",
242
- stackedBar: "stackedBar",
243
- table: "table"
244
- };
245
- export {
246
- p as A,
247
- U as C,
248
- _ as a,
249
- y as b,
250
- q as c,
251
- S as d,
252
- B as e,
253
- K as f,
254
- F as g,
255
- M as h,
256
- $ as i,
257
- C as j,
258
- P as k,
259
- z as l,
260
- J as m,
261
- Y as n,
262
- x as o,
263
- N as p,
264
- j as q,
265
- A as r,
266
- h as s,
267
- R as t,
268
- I as u,
269
- V as v,
270
- b as w
271
- };