react-semaphor 0.1.571 → 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.
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +62 -59
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/{model-change-T1cRkh3m.js → add-to-dashboard-B6Ah8Lub.js} +121 -84
- package/dist/chunks/{assistant-chat-SkCraw2C.js → assistant-chat-D95DtCj7.js} +2398 -2300
- package/dist/chunks/{bookmark-impact-DCYD-6Fr.js → bookmark-impact-DUWw3wlA.js} +2 -2
- package/dist/chunks/{bookmark-state-CflS88gq.js → bookmark-state-BEl_G9vr.js} +54 -54
- package/dist/chunks/{card-filter-builder-D-aSYpyr.js → card-filter-builder-B3bEPylu.js} +54 -54
- package/dist/chunks/{dashboard-B_w_ekUz.js → dashboard-DdALjmc3.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-_g1m2tJ3.js → dashboard-briefing-launcher-D2vevpyl.js} +923 -956
- package/dist/chunks/{dashboard-controls-CY0gbcCt.js → dashboard-controls-DxrsGK9A.js} +103 -103
- package/dist/chunks/{dashboard-json-DsM79yem.js → dashboard-json-rwds0HjB.js} +1 -1
- package/dist/chunks/{dates-RSEzJ9N7.js → dates-DlYMDaF2.js} +5 -5
- package/dist/chunks/{edit-dashboard-visual-cX0FM-4i.js → edit-dashboard-visual-BCDz5HOb.js} +1354 -1317
- package/dist/chunks/{filter-reach-copy-thzt25Rc.js → filter-reach-copy-BTAXnbwQ.js} +9 -9
- package/dist/chunks/{index-y3HUzRNk.js → index-8BxDk8EP.js} +2 -2
- package/dist/chunks/{report-preferences-dialog-B_GXs91t.js → report-preferences-dialog-D9nBczmk.js} +725 -801
- package/dist/chunks/{resolve-dashboard-input-context-Lkbwycwe.js → resolve-dashboard-input-context-DBFuNhZo.js} +3961 -3923
- package/dist/chunks/{saved-dashboard-context-DC_TEd6y.js → saved-dashboard-context-AChHk4tw.js} +3 -3
- package/dist/chunks/{semaphor-ready-indicator-CBQamwQY.js → semaphor-ready-indicator-BdOAS4Uw.js} +25293 -24700
- package/dist/chunks/{shelf-drop-preview-context-Bkjf0XXw.js → shelf-drop-preview-context-B1goDUYE.js} +259 -259
- package/dist/chunks/{stored-dashboard-C0hekXiI.js → stored-dashboard-rpLzf4mk.js} +231 -231
- package/dist/chunks/{variable-draft-DvglU8yj.js → variable-draft-DPSMDwqt.js} +2 -2
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1381 -1368
- package/dist/index.js +147 -147
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/dashboard/summary-card.d.ts +5 -0
- package/dist/types/index.js +1 -1
- package/dist/types/lib/formatters/kpi-number-formatter.d.ts +12 -0
- package/dist/types/lib/types/explorer-types.d.ts +6 -0
- package/dist/types/shared/assistant-protocol/model-change.d.ts +52 -1
- package/dist/types/shared/assistant-protocol/parts.d.ts +49 -2
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +38 -0
- 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-
|
|
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
|
|
3
|
-
import { a as
|
|
4
|
-
import { e as
|
|
5
|
-
import { t as
|
|
6
|
-
import { A as J, m as K, C as
|
|
7
|
-
import { p as
|
|
8
|
-
import { A as
|
|
9
|
-
const
|
|
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:
|
|
20
|
-
addedSources: e.array(
|
|
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(
|
|
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(),
|
|
36
|
-
function
|
|
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 >
|
|
40
|
-
return d(`body: ${n} bytes exceeds ${
|
|
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:
|
|
79
|
-
...
|
|
80
|
-
...
|
|
81
|
-
],
|
|
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 !==
|
|
84
|
-
...
|
|
85
|
-
...
|
|
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
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
-
|
|
115
|
+
x as assistantContextSchema,
|
|
116
116
|
c as assistantJsonBytes,
|
|
117
117
|
$ as assistantRefusalMessage,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
125
|
-
Q as
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
be as
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
};
|
package/dist/briefings/index.js
CHANGED
|
@@ -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-
|
|
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
|
|
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
|
|
6
|
-
var
|
|
7
|
-
const t = (
|
|
8
|
-
return (t == null ? void 0 : t.status) !== "described" || t.sql || ((
|
|
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
|
|
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
|
|
15
|
-
return t.flatMap((
|
|
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
|
|
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
|
|
22
|
+
function y(e) {
|
|
23
23
|
if (e.kind === "text") return { type: "text", text: e.text };
|
|
24
|
-
const { kind: t, ...
|
|
24
|
+
const { kind: t, ...o } = e;
|
|
25
25
|
return {
|
|
26
26
|
type: `data-${t}`,
|
|
27
27
|
...e.kind === "stage" ? { id: e.stageId } : {},
|
|
28
|
-
data:
|
|
28
|
+
data: o
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return e.kind !== "text" ? [
|
|
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
|
|
45
|
+
let o = -1;
|
|
46
46
|
e.forEach((n, a) => {
|
|
47
|
-
t(n) === "text" && (
|
|
47
|
+
t(n) === "text" && (o = a);
|
|
48
48
|
});
|
|
49
|
-
let
|
|
49
|
+
let s = -1;
|
|
50
50
|
return e.forEach((n, a) => {
|
|
51
|
-
a <
|
|
52
|
-
}), new Set(e.filter((n, a) => a <
|
|
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
|
|
68
|
+
function q(e) {
|
|
69
69
|
return Object.hasOwn(p, e) && p[e] === "body";
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function $(e) {
|
|
72
72
|
return e.kind === "text" ? "text" : e.kind === "stage" && !e.change ? "step" : "other";
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const t = b(e,
|
|
76
|
-
return e.flatMap((
|
|
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
|
|
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
|
-
},
|
|
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
|
|
135
|
+
function B(e, t) {
|
|
100
136
|
var a;
|
|
101
|
-
const
|
|
102
|
-
`${t.assistantName} conversation${
|
|
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: ${
|
|
106
|
-
return d.push(...
|
|
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 [
|
|
145
|
+
return [s.join(`
|
|
110
146
|
`), ...n].join(`
|
|
111
147
|
|
|
112
148
|
`) + `
|
|
113
149
|
`;
|
|
114
150
|
}
|
|
115
|
-
function
|
|
116
|
-
return [...(e.taggedFields ?? []).map((
|
|
151
|
+
function I(e) {
|
|
152
|
+
return [...(e.taggedFields ?? []).map((o) => `@${o.label}`), e.message].join(" ");
|
|
117
153
|
}
|
|
118
|
-
function
|
|
119
|
-
const t = b(e,
|
|
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() &&
|
|
159
|
+
!t.has(n) && n.text.trim() && s.push(n.text.trim());
|
|
124
160
|
break;
|
|
125
161
|
case "proposal":
|
|
126
|
-
|
|
162
|
+
s.push("Dashboard changes", ...n.changes.filter((a) => a.sentence).map((a) => `+ ${a.sentence}`));
|
|
127
163
|
break;
|
|
128
164
|
case "proposal_refused":
|
|
129
|
-
|
|
165
|
+
s.push("Not added", `! ${n.message}`);
|
|
130
166
|
break;
|
|
131
167
|
case "model_change":
|
|
132
|
-
|
|
168
|
+
s.push(...F(n));
|
|
133
169
|
break;
|
|
134
170
|
case "clarify":
|
|
135
|
-
|
|
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
|
-
|
|
177
|
+
s.push(`[Result: ${n.artifact.title}]`);
|
|
142
178
|
break;
|
|
143
179
|
case "refusal":
|
|
144
|
-
|
|
180
|
+
s.push(n.message);
|
|
145
181
|
break;
|
|
146
182
|
case "stage":
|
|
147
|
-
|
|
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
|
|
193
|
+
return o.size && s.push(`(${o.size} ${o.size === 1 ? "step" : "steps"})`), s;
|
|
158
194
|
}
|
|
159
|
-
function
|
|
160
|
-
const
|
|
161
|
-
return (t ||
|
|
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
|
-
|
|
166
|
-
}),
|
|
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
|
|
204
|
+
function w(e) {
|
|
169
205
|
return e.split(`
|
|
170
206
|
`).map((t) => ` ${t}`);
|
|
171
207
|
}
|
|
172
|
-
function
|
|
208
|
+
function E(e) {
|
|
173
209
|
return e.replace(/^semaphor_/, "");
|
|
174
210
|
}
|
|
175
|
-
function
|
|
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
|
|
222
|
+
function J(e) {
|
|
180
223
|
return e.label ?? (e.kind === "semantic" ? e.datasetName : e.kind === "physical" ? e.tableName : "SQL");
|
|
181
224
|
}
|
|
182
|
-
function
|
|
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
|
|
235
|
+
const V = {
|
|
193
236
|
number: "kpi",
|
|
194
237
|
line: "line",
|
|
195
238
|
bar: "bar",
|
|
196
239
|
stackedBar: "stackedBar",
|
|
197
240
|
table: "table"
|
|
198
|
-
}
|
|
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
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
244
|
+
P as C,
|
|
245
|
+
_ as a,
|
|
246
|
+
y as b,
|
|
247
|
+
j as c,
|
|
214
248
|
S as d,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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
|
};
|