react-semaphor 0.1.572 → 0.1.573

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 (40) hide show
  1. package/dist/assistant-context/index.js +1 -1
  2. package/dist/assistant-protocol/index.js +62 -59
  3. package/dist/briefings/index.js +1 -1
  4. package/dist/chunks/{model-change-T1cRkh3m.js → add-to-dashboard-B6Ah8Lub.js} +121 -84
  5. package/dist/chunks/{assistant-chat-DF1-q82n.js → assistant-chat-D95DtCj7.js} +2411 -2313
  6. package/dist/chunks/{bookmark-impact-fdj8fY9i.js → bookmark-impact-DUWw3wlA.js} +1 -1
  7. package/dist/chunks/{card-filter-builder-BFT21WI-.js → card-filter-builder-B3bEPylu.js} +54 -54
  8. package/dist/chunks/{dashboard-jUhZ7T4f.js → dashboard-DdALjmc3.js} +1 -1
  9. package/dist/chunks/{dashboard-briefing-launcher-DDXzTYuA.js → dashboard-briefing-launcher-D2vevpyl.js} +82 -82
  10. package/dist/chunks/{dashboard-controls-BwKQEoGp.js → dashboard-controls-DxrsGK9A.js} +7 -7
  11. package/dist/chunks/{dashboard-json-B3fR1_Oc.js → dashboard-json-rwds0HjB.js} +1 -1
  12. package/dist/chunks/{dates-DKkSDWHe.js → dates-DlYMDaF2.js} +4 -4
  13. package/dist/chunks/{edit-dashboard-visual-DGZABdS-.js → edit-dashboard-visual-BCDz5HOb.js} +1354 -1317
  14. package/dist/chunks/{filter-reach-copy-CWHV7GSb.js → filter-reach-copy-BTAXnbwQ.js} +2 -2
  15. package/dist/chunks/{index-CeeY4wjE.js → index-8BxDk8EP.js} +1 -1
  16. package/dist/chunks/{report-preferences-dialog-R3EGbxfu.js → report-preferences-dialog-D9nBczmk.js} +7 -7
  17. package/dist/chunks/{resolve-dashboard-input-context-CBQF3obr.js → resolve-dashboard-input-context-DBFuNhZo.js} +3961 -3923
  18. package/dist/chunks/{saved-dashboard-context-_-7LKeK1.js → saved-dashboard-context-AChHk4tw.js} +2 -2
  19. package/dist/chunks/{semaphor-ready-indicator-CEbA4CFb.js → semaphor-ready-indicator-BdOAS4Uw.js} +23554 -23073
  20. package/dist/chunks/{shelf-drop-preview-context-UqUUVSJq.js → shelf-drop-preview-context-B1goDUYE.js} +2 -2
  21. package/dist/chunks/{stored-dashboard-Bk3iCXtp.js → stored-dashboard-rpLzf4mk.js} +112 -112
  22. package/dist/chunks/{variable-draft-ggS3X7FG.js → variable-draft-DPSMDwqt.js} +2 -2
  23. package/dist/dashboard/index.js +1 -1
  24. package/dist/dashboard-authoring/index.js +1381 -1368
  25. package/dist/index.js +11 -11
  26. package/dist/style.css +1 -1
  27. package/dist/surfboard/index.js +1 -1
  28. package/dist/types/components/dashboard/summary-card.d.ts +5 -0
  29. package/dist/types/lib/formatters/kpi-number-formatter.d.ts +12 -0
  30. package/dist/types/lib/types/explorer-types.d.ts +6 -0
  31. package/dist/types/shared/assistant-protocol/model-change.d.ts +52 -1
  32. package/dist/types/shared/assistant-protocol/parts.d.ts +49 -2
  33. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +5 -0
  34. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  35. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -0
  36. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
  37. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
  38. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +4 -0
  39. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +38 -0
  40. package/package.json +1 -1
@@ -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-_-7LKeK1.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-AChHk4tw.js";
2
2
  export {
3
3
  e as AssistantContextSourceError,
4
4
  t as assistantCardReplayFields,
@@ -1,12 +1,12 @@
1
1
  import { z as e } from "zod";
2
- import { s as x } from "../chunks/analytics-base-schemas-BaIQrEzX.js";
3
- import { a as g, A as s, b as T, c } from "../chunks/context-R31TSL5V.js";
4
- import { e as q, j as O, m as F, d as L, l as $, g as M, k as U, h as j, i as w, f as P, r as V } from "../chunks/context-R31TSL5V.js";
5
- import { t as y } from "../chunks/model-change-T1cRkh3m.js";
6
- import { A as J, m as K, C as X, e as z, k as G, j as H, f as W, n as Q, q as Z, s as ee, h as se, l as ae, i as te, d as oe, a as re, c as ne, b as de, g as ie, v as ce, w as le } from "../chunks/model-change-T1cRkh3m.js";
7
- import { p as Se, a as be, r as me } from "../chunks/availability-Bp5Gfu1I.js";
8
- import { A as Ae, a as fe, D as pe, i as xe } from "../chunks/conversation-sQiWYUOb.js";
9
- const C = [
2
+ import { s as p } from "../chunks/analytics-base-schemas-BaIQrEzX.js";
3
+ import { a as x, A as s, b as T, c } from "../chunks/context-R31TSL5V.js";
4
+ import { e as O, j as q, m as L, d as F, l as $, g as U, k as M, h as j, i as w, f as P, r as V } from "../chunks/context-R31TSL5V.js";
5
+ import { t as C } from "../chunks/add-to-dashboard-B6Ah8Lub.js";
6
+ import { A as J, m as K, C as W, e as X, k as z, j as G, f as H, n as Q, o as Z, p as ee, r as se, q as ae, s as te, h as oe, l as re, i as ne, d as de, a as ie, c as ce, b as le, g as ue, v as me, w as Se } from "../chunks/add-to-dashboard-B6Ah8Lub.js";
7
+ import { p as be, a as Ae, r as fe } from "../chunks/availability-Bp5Gfu1I.js";
8
+ import { A as pe, a as xe, D as Te, i as Ce } from "../chunks/conversation-sQiWYUOb.js";
9
+ const y = [
10
10
  "matrix",
11
11
  "no_query",
12
12
  "document_section",
@@ -16,8 +16,8 @@ const C = [
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),
19
- context: g,
20
- addedSources: e.array(x).max(s.addedSources),
19
+ context: x,
20
+ addedSources: e.array(p).max(s.addedSources),
21
21
  selectedCardRequest: e.object({
22
22
  cardId: e.string().min(1).max(s.idChars),
23
23
  connectionId: e.string().min(1).max(s.idChars),
@@ -25,19 +25,19 @@ const C = [
25
25
  }).strict().optional(),
26
26
  selectedCardUnavailable: e.object({
27
27
  cardId: e.string().min(1).max(s.idChars),
28
- reason: e.enum(C),
28
+ reason: e.enum(y),
29
29
  message: e.string().max(s.textChars).optional()
30
30
  }).strict().optional(),
31
31
  taggedFields: e.array(T).max(s.taggedFields).optional(),
32
32
  // The document's own shape is the dashboard's; propose reads it through
33
33
  // the resolver and the save's validation. Here only what routes it.
34
34
  openDashboard: e.object({ id: e.string().min(1).max(s.idChars), sheets: e.array(e.unknown()) }).passthrough().optional()
35
- }).strict(), p = s.requestBytes + s.openDashboardBytes;
36
- function D(r) {
35
+ }).strict(), g = s.requestBytes + s.openDashboardBytes;
36
+ function v(r) {
37
37
  var A;
38
38
  const n = new TextEncoder().encode(r).length;
39
- if (n > p)
40
- return d(`body: ${n} bytes exceeds ${p}`);
39
+ if (n > g)
40
+ return d(`body: ${n} bytes exceeds ${g}`);
41
41
  let a;
42
42
  try {
43
43
  a = JSON.parse(r);
@@ -75,17 +75,17 @@ function D(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: b } = o.data, m = (A = o.data.context.selectedCard) == null ? void 0 : A.id, i = [
79
- ...S ? [["selectedCardRequest", S.cardId]] : [],
80
- ...b ? [["selectedCardUnavailable", b.cardId]] : []
81
- ], h = [
78
+ const { selectedCardRequest: m, selectedCardUnavailable: S } = o.data, h = (A = o.data.context.selectedCard) == null ? void 0 : A.id, i = [
79
+ ...m ? [["selectedCardRequest", m.cardId]] : [],
80
+ ...S ? [["selectedCardUnavailable", S.cardId]] : []
81
+ ], b = [
82
82
  ...i.length > 1 ? ["selectedCardRequest, selectedCardUnavailable: send one of them, not both"] : [],
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
- ...y(o.data.context, o.data.taggedFields ?? []),
83
+ ...i.filter(([, t]) => t !== h).map(([t]) => `${t}: not the card the context asks about`),
84
+ ...h && i.length === 0 ? ["selectedCardRequest: the asked-about card needs its request or selectedCardUnavailable"] : [],
85
+ ...C(o.data.context, o.data.taggedFields ?? []),
86
86
  ...I(o.data.context, o.data.openDashboard)
87
87
  ];
88
- return h.length ? { ok: !1, code: "context_invalid", issues: h } : { ok: !0, value: o.data };
88
+ return b.length ? { ok: !1, code: "context_invalid", issues: b } : { ok: !0, value: o.data };
89
89
  }
90
90
  function I(r, n) {
91
91
  var a;
@@ -97,48 +97,51 @@ function d(r) {
97
97
  export {
98
98
  J as ANSWER_PART_PLACEMENT,
99
99
  K as ASSISTANT_CARD_TYPES,
100
- C as ASSISTANT_CARD_UNAVAILABLE_REASONS,
101
- q as ASSISTANT_CONTEXT_VERSION,
102
- Ae as ASSISTANT_LAYOUTS,
100
+ y as ASSISTANT_CARD_UNAVAILABLE_REASONS,
101
+ O as ASSISTANT_CONTEXT_VERSION,
102
+ pe as ASSISTANT_LAYOUTS,
103
103
  s as ASSISTANT_LIMITS,
104
- fe as ASSISTANT_NAME_MAX_CHARS,
105
- O as ASSISTANT_PARTS_VERSION,
106
- F as ASSISTANT_REFUSAL_MESSAGES,
107
- p as ASSISTANT_TURN_BODY_BYTES,
108
- L as AssistantContextTooLargeError,
109
- X as COPIED_CONVERSATION_FIELDS,
110
- z as COPIED_TURN_FIELDS,
111
- pe as DEFAULT_ASSISTANT_NAME,
112
- G as addableSourceKey,
113
- H as answerTextOf,
104
+ xe as ASSISTANT_NAME_MAX_CHARS,
105
+ q as ASSISTANT_PARTS_VERSION,
106
+ L as ASSISTANT_REFUSAL_MESSAGES,
107
+ g as ASSISTANT_TURN_BODY_BYTES,
108
+ F as AssistantContextTooLargeError,
109
+ W as COPIED_CONVERSATION_FIELDS,
110
+ X as COPIED_TURN_FIELDS,
111
+ Te as DEFAULT_ASSISTANT_NAME,
112
+ z as addableSourceKey,
113
+ G as answerTextOf,
114
114
  T as assistantCardFieldSchema,
115
- g as assistantContextSchema,
115
+ x as assistantContextSchema,
116
116
  c as assistantJsonBytes,
117
117
  $ as assistantRefusalMessage,
118
- M as compareAssistantContexts,
119
- W as conversationText,
120
- U as dailyLimitMessage,
118
+ U as compareAssistantContexts,
119
+ H as conversationText,
120
+ M as dailyLimitMessage,
121
121
  j as describeCardField,
122
122
  w as describeSource,
123
123
  P as fitAssistantText,
124
- xe as isAssistantLayout,
125
- Q as modelChangeRefusalMessage,
126
- Se as parseAssistantTokenConfig,
127
- D as parseAssistantTurnRequest,
128
- Z as questionForModel,
129
- be as readAssistantTokenConfig,
124
+ Ce as isAssistantLayout,
125
+ Q as modelChangeLinkOutcomeWords,
126
+ Z as modelChangeLinkRefusal,
127
+ ee as modelChangeOutcomeUnclear,
128
+ se as modelChangeRefusalMessage,
129
+ be as parseAssistantTokenConfig,
130
+ v as parseAssistantTurnRequest,
131
+ ae as questionForModel,
132
+ Ae as readAssistantTokenConfig,
130
133
  V as renderContextForModel,
131
- me as resolveAssistantAvailability,
132
- ee as sameCardField,
133
- se as showsInAnswerBody,
134
- ae as sourceRefLabel,
135
- te as storedPartKind,
136
- oe as storedTurnEnding,
137
- re as taggableFields,
138
- y as taggedFieldIssues,
139
- ne as toTranscriptChunks,
140
- de as toTranscriptPart,
141
- ie as toolName,
142
- ce as visualInputOf,
143
- le as workingNotesOf
134
+ fe as resolveAssistantAvailability,
135
+ te as sameCardField,
136
+ oe as showsInAnswerBody,
137
+ re as sourceRefLabel,
138
+ ne as storedPartKind,
139
+ de as storedTurnEnding,
140
+ ie as taggableFields,
141
+ C as taggedFieldIssues,
142
+ ce as toTranscriptChunks,
143
+ le as toTranscriptPart,
144
+ ue as toolName,
145
+ me as visualInputOf,
146
+ Se as workingNotesOf
144
147
  };
@@ -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-CeeY4wjE.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-8BxDk8EP.js";
9
9
  export {
10
10
  g as BRIEFING_ARTIFACT_FORMATS,
11
11
  l as BRIEFING_ATTACHMENT_FORMATS,
@@ -1,35 +1,35 @@
1
1
  import { A as c, h as k, m as f } from "./context-R31TSL5V.js";
2
- function g(e, t) {
2
+ function h(e, t) {
3
3
  return e.role === t.role && e.name === t.name && e.aggregate === t.aggregate && e.granularity === t.granularity;
4
4
  }
5
- function $(e) {
6
- var s, o;
7
- const t = (s = e.selectedCard) == null ? void 0 : s.description;
8
- return (t == null ? void 0 : t.status) !== "described" || t.sql || ((o = e.editing) == null ? void 0 : o.mode) === "sql" ? [] : t.fields;
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
9
  }
10
- function v(e, t) {
10
+ function D(e, t) {
11
11
  if (t.length === 0) return [];
12
12
  if (t.length > c.taggedFields)
13
13
  return [`taggedFields: at most ${c.taggedFields}`];
14
- const s = $(e);
15
- return t.flatMap((o, n) => s.some((a) => g(a, o)) ? t.slice(0, n).some((a) => g(a, o)) ? [`taggedFields.${n}: tagged twice`] : [] : [`taggedFields.${n}: not a field of the card the context asks about`]);
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
16
  }
17
- function x(e, t) {
17
+ function R(e, t) {
18
18
  return t != null && t.length ? `Fields of the asked-about card the user tagged in this question: ${t.map(k).join("; ")}.
19
19
 
20
20
  ${e}` : e;
21
21
  }
22
- function _(e) {
22
+ function y(e) {
23
23
  if (e.kind === "text") return { type: "text", text: e.text };
24
- const { kind: t, ...s } = e;
24
+ const { kind: t, ...o } = e;
25
25
  return {
26
26
  type: `data-${t}`,
27
27
  ...e.kind === "stage" ? { id: e.stageId } : {},
28
- data: s
28
+ data: o
29
29
  };
30
30
  }
31
- function E(e, t) {
32
- return e.kind !== "text" ? [_(e)] : [
31
+ function j(e, t) {
32
+ return e.kind !== "text" ? [y(e)] : [
33
33
  { type: "text-start", id: t },
34
34
  { type: "text-delta", id: t, delta: e.text },
35
35
  { type: "text-end", id: t }
@@ -42,14 +42,14 @@ function S(e) {
42
42
  return { kind: "refusal", code: "turn_in_progress", message: f.turn_in_progress };
43
43
  }
44
44
  function b(e, t) {
45
- let s = -1;
45
+ let o = -1;
46
46
  e.forEach((n, a) => {
47
- t(n) === "text" && (s = a);
47
+ t(n) === "text" && (o = a);
48
48
  });
49
- let o = -1;
49
+ let s = -1;
50
50
  return e.forEach((n, a) => {
51
- a < s && t(n) === "step" && (o = a);
52
- }), new Set(e.filter((n, a) => a < o && t(n) === "text"));
51
+ a < o && t(n) === "step" && (s = a);
52
+ }), new Set(e.filter((n, a) => a < s && t(n) === "text"));
53
53
  }
54
54
  const p = {
55
55
  conversation: "nowhere",
@@ -65,24 +65,60 @@ const p = {
65
65
  proposal_refused: "body",
66
66
  model_change: "body"
67
67
  };
68
- function F(e) {
68
+ function q(e) {
69
69
  return Object.hasOwn(p, e) && p[e] === "body";
70
70
  }
71
- function w(e) {
71
+ function $(e) {
72
72
  return e.kind === "text" ? "text" : e.kind === "stage" && !e.change ? "step" : "other";
73
73
  }
74
- function O(e) {
75
- const t = b(e, w);
76
- return e.flatMap((s) => s.kind === "text" && !t.has(s) ? [s.text] : []).filter((s) => s.trim().length > 0).join(`
74
+ function M(e) {
75
+ const t = b(e, $);
76
+ return e.flatMap((o) => o.kind === "text" && !t.has(o) ? [o.text] : []).filter((o) => o.trim().length > 0).join(`
77
77
 
78
78
  `);
79
79
  }
80
- const L = {
80
+ const g = {
81
+ proposal_not_found: "This suggestion has expired. Ask for a new one.",
82
+ proposal_stale: "The data model changed while these were being added. Nothing was added; ask for a new suggestion.",
83
+ not_permitted: "You don’t have permission to change the data model.",
84
+ apply_in_progress: "They’re still being added.",
85
+ apply_outcome_unknown: "It isn’t clear whether they were added. Check the data model before asking again."
86
+ }, C = "They couldn’t be added.", m = {
87
+ exists: () => "it’s already in the model",
88
+ missing_fields: (e) => `a dataset or field it uses is no longer in ${e}`,
89
+ type_mismatch: () => "its fields’ types don’t match",
90
+ not_supported: () => "the data doesn’t support it"
91
+ };
92
+ function T(e, t) {
93
+ switch (e == null ? void 0 : e.status) {
94
+ case "added":
95
+ return "added";
96
+ case "existing":
97
+ return "already in the model";
98
+ case "left_out":
99
+ return "left out";
100
+ case "refused":
101
+ return `not added: ${N(e.reasons, t)}`;
102
+ default:
103
+ return "outcome unknown";
104
+ }
105
+ }
106
+ function N(e, t) {
107
+ const o = e.find((s) => Object.hasOwn(m, s));
108
+ return o ? m[o](t) : "it no longer fits the model";
109
+ }
110
+ function A(e) {
111
+ return e === "apply_outcome_unknown";
112
+ }
113
+ function x(e) {
114
+ return typeof e == "string" && Object.hasOwn(g, e) ? g[e] : C;
115
+ }
116
+ const P = {
81
117
  conversationId: "with tool calls",
82
118
  addedSources: "left out",
83
119
  allows: "left out",
84
120
  turns: "shown"
85
- }, q = {
121
+ }, U = {
86
122
  turnId: "left out",
87
123
  startedAt: "shown",
88
124
  // the first turn's, in the header
@@ -96,55 +132,55 @@ const L = {
96
132
  model: "with tool calls",
97
133
  instructionsVersion: "with tool calls"
98
134
  };
99
- function D(e, t) {
135
+ function B(e, t) {
100
136
  var a;
101
- const s = (a = e.turns[0]) == null ? void 0 : a.startedAt, o = [
102
- `${t.assistantName} conversation${s ? ` · ${s.slice(0, 16).replace("T", " ")} UTC` : ""}`,
137
+ const o = (a = e.turns[0]) == null ? void 0 : a.startedAt, s = [
138
+ `${t.assistantName} conversation${o ? ` · ${o.slice(0, 16).replace("T", " ")} UTC` : ""}`,
103
139
  ...t.toolCalls ? [`Conversation ${e.conversationId}`] : []
104
140
  ], n = e.turns.map((r) => {
105
- const d = [`You: ${y(r)}`, "", `${t.assistantName}:`], i = S(r.outcome), l = [...r.parts, ...i ? [i] : []];
106
- return d.push(...C(l)), t.toolCalls && r.toolCalls && d.push(...T(r.toolCalls, r.model, r.instructionsVersion)), d.join(`
141
+ const d = [`You: ${I(r)}`, "", `${t.assistantName}:`], i = S(r.outcome), l = [...r.parts, ...i ? [i] : []];
142
+ return d.push(...v(l)), t.toolCalls && r.toolCalls && d.push(...O(r.toolCalls, r.model, r.instructionsVersion)), d.join(`
107
143
  `);
108
144
  });
109
- return [o.join(`
145
+ return [s.join(`
110
146
  `), ...n].join(`
111
147
 
112
148
  `) + `
113
149
  `;
114
150
  }
115
- function y(e) {
116
- return [...(e.taggedFields ?? []).map((s) => `@${s.label}`), e.message].join(" ");
151
+ function I(e) {
152
+ return [...(e.taggedFields ?? []).map((o) => `@${o.label}`), e.message].join(" ");
117
153
  }
118
- function C(e) {
119
- const t = b(e, w), s = /* @__PURE__ */ new Set(), o = [];
154
+ function v(e) {
155
+ const t = b(e, $), o = /* @__PURE__ */ new Set(), s = [];
120
156
  for (const n of e)
121
157
  switch (n.kind) {
122
158
  case "text":
123
- !t.has(n) && n.text.trim() && o.push(n.text.trim());
159
+ !t.has(n) && n.text.trim() && s.push(n.text.trim());
124
160
  break;
125
161
  case "proposal":
126
- o.push("Dashboard changes", ...n.changes.filter((a) => a.sentence).map((a) => `+ ${a.sentence}`));
162
+ s.push("Dashboard changes", ...n.changes.filter((a) => a.sentence).map((a) => `+ ${a.sentence}`));
127
163
  break;
128
164
  case "proposal_refused":
129
- o.push("Not added", `! ${n.message}`);
165
+ s.push("Not added", `! ${n.message}`);
130
166
  break;
131
167
  case "model_change":
132
- o.push("Data model change (proposed)", ...n.changes.filter((a) => a.sentence).map((a) => `+ ${a.sentence}`));
168
+ s.push(...F(n));
133
169
  break;
134
170
  case "clarify":
135
- o.push(
171
+ s.push(
136
172
  n.multiple ? `${n.question} (pick any)` : n.question,
137
173
  ...n.options.map((a, r) => ` ${r + 1}. ${a.label}`)
138
174
  );
139
175
  break;
140
176
  case "artifact":
141
- o.push(`[Result: ${n.artifact.title}]`);
177
+ s.push(`[Result: ${n.artifact.title}]`);
142
178
  break;
143
179
  case "refusal":
144
- o.push(n.message);
180
+ s.push(n.message);
145
181
  break;
146
182
  case "stage":
147
- s.add(n.stageId);
183
+ o.add(n.stageId);
148
184
  break;
149
185
  case "using":
150
186
  case "trace":
@@ -154,32 +190,39 @@ function C(e) {
154
190
  default:
155
191
  return n;
156
192
  }
157
- return s.size && o.push(`(${s.size} ${s.size === 1 ? "step" : "steps"})`), o;
193
+ return o.size && s.push(`(${o.size} ${o.size === 1 ? "step" : "steps"})`), s;
158
194
  }
159
- function T(e, t, s) {
160
- const o = ["", "Tool calls:"];
161
- return (t || s) && o.push(` model ${t ?? "unknown"}${s ? ` · instructions ${s}` : ""}`), e.length || o.push(" none"), e.forEach((n, a) => {
195
+ function O(e, t, o) {
196
+ const s = ["", "Tool calls:"];
197
+ return (t || o) && s.push(` model ${t ?? "unknown"}${o ? ` · instructions ${o}` : ""}`), e.length || s.push(" none"), e.forEach((n, a) => {
162
198
  var u;
163
199
  const r = n.durationMs === void 0 ? "" : ` · ${n.durationMs} ms`, d = n.rowCount === void 0 ? "" : ` · ${n.rowCount} ${n.rowCount === 1 ? "row" : "rows"}`, i = n.ok || (u = n.error) == null ? void 0 : u.trim(), l = i && !i.includes(`
164
200
  `) ? `: ${i}` : "";
165
- o.push(` ${a + 1}. ${A(n.tool)}${r}${d} · ${n.ok ? "ok" : `failed${l}`}`), i && !l && o.push(" error:", ...h(i)), i && !l && o.push(" input:"), o.push(...h(JSON.stringify(n.input ?? {}, null, 2)));
166
- }), o;
201
+ s.push(` ${a + 1}. ${E(n.tool)}${r}${d} · ${n.ok ? "ok" : `failed${l}`}`), i && !l && s.push(" error:", ...w(i)), i && !l && s.push(" input:"), s.push(...w(JSON.stringify(n.input ?? {}, null, 2)));
202
+ }), s;
167
203
  }
168
- function h(e) {
204
+ function w(e) {
169
205
  return e.split(`
170
206
  `).map((t) => ` ${t}`);
171
207
  }
172
- function A(e) {
208
+ function E(e) {
173
209
  return e.replace(/^semaphor_/, "");
174
210
  }
175
- function R(e) {
211
+ function F(e) {
212
+ const t = e.changes.map((s) => s.sentence ?? s.op), o = e.outcome;
213
+ 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"}: ${x(o.code)})`, ...t.map((n) => `+ ${n}`)] : [
214
+ "Data model change",
215
+ ...t.map((s, n) => `+ ${s} (${T(o.links[n], e.domainLabel)})`)
216
+ ] : ["Data model change (proposed)", ...t.map((s) => `+ ${s}`)];
217
+ }
218
+ function z(e) {
176
219
  if (e.kind === "semantic") return JSON.stringify(["semantic", e.domainId, e.datasetName]);
177
220
  if (e.kind === "sql") return JSON.stringify(["sql", e.connectionId]);
178
221
  }
179
- function j(e) {
222
+ function J(e) {
180
223
  return e.label ?? (e.kind === "semantic" ? e.datasetName : e.kind === "physical" ? e.tableName : "SQL");
181
224
  }
182
- function M(e) {
225
+ function K(e) {
183
226
  return {
184
227
  columns: e.columns,
185
228
  records: e.records,
@@ -189,42 +232,36 @@ function M(e) {
189
232
  truncated: e.status.truncated
190
233
  };
191
234
  }
192
- const P = {
235
+ const V = {
193
236
  number: "kpi",
194
237
  line: "line",
195
238
  bar: "bar",
196
239
  stackedBar: "stackedBar",
197
240
  table: "table"
198
- }, m = {
199
- proposal_not_found: "This suggestion has expired. Ask again for a new one.",
200
- proposal_stale: "The data model changed since this was suggested. Ask again for a new one.",
201
- not_permitted: "You don’t have permission to change the data model.",
202
- apply_in_progress: "It’s still being added. Try again in a moment.",
203
- apply_outcome_unknown: "It isn’t clear whether it was added. Check the data model before adding it again."
204
- }, I = "It couldn’t be added. Try again.";
205
- function U(e) {
206
- return typeof e == "string" && Object.hasOwn(m, e) ? m[e] : I;
207
- }
241
+ };
208
242
  export {
209
243
  p as A,
210
- L as C,
211
- $ as a,
212
- _ as b,
213
- E as c,
244
+ P as C,
245
+ _ as a,
246
+ y as b,
247
+ j as c,
214
248
  S as d,
215
- q as e,
216
- D as f,
217
- A as g,
218
- F as h,
219
- w as i,
220
- O as j,
221
- R as k,
222
- j as l,
223
- P as m,
224
- U as n,
225
- x as q,
226
- g as s,
227
- v as t,
228
- M as v,
249
+ U as e,
250
+ B as f,
251
+ E as g,
252
+ q as h,
253
+ $ as i,
254
+ M as j,
255
+ z as k,
256
+ J as l,
257
+ V as m,
258
+ T as n,
259
+ N as o,
260
+ A as p,
261
+ R as q,
262
+ x as r,
263
+ h as s,
264
+ D as t,
265
+ K as v,
229
266
  b as w
230
267
  };