react-semaphor 0.1.602 → 0.1.604
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/activity/index.js +1 -73
- package/dist/analytics-protocol/index.js +1 -1451
- package/dist/appearance/index.js +1 -12
- package/dist/appearance-runtime/index.js +1 -5
- package/dist/assistant-context/index.js +1 -11
- package/dist/assistant-protocol/index.js +1 -152
- package/dist/brand-studio/index.js +4 -1594
- package/dist/briefings/index.js +1 -70
- package/dist/chunks/add-to-dashboard-DeHEBEqG.js +12 -0
- package/dist/chunks/analytics-base-schemas-BREc5WGv.js +1 -0
- package/dist/chunks/appearance-context-BqBZrijL.js +1 -0
- package/dist/chunks/appearance-runtime-provider-DmbCrOOG.js +1 -0
- package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
- package/dist/chunks/assistant-chat-CjYrwVDa.js +56 -0
- package/dist/chunks/attribution-BEFSsbNn.js +1 -0
- package/dist/chunks/availability-3AIOf6Z-.js +1 -0
- package/dist/chunks/bookmark-impact-C89zBLq3.js +1 -0
- package/dist/chunks/bookmark-state-69YYnRql.js +1 -0
- package/dist/chunks/brand-DCaZyRt6.js +1 -0
- package/dist/chunks/card-filter-builder-CTp6RAz1.js +17 -0
- package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
- package/dist/chunks/comparison-window-caption-C312mn3s.js +1 -0
- package/dist/chunks/context-ALdccLHw.js +2 -0
- package/dist/chunks/conversation-JMK2kyTK.js +1 -0
- package/dist/chunks/dashboard-BX28ld6s.js +1 -0
- package/dist/chunks/dashboard-briefing-launcher-qo7GH4EO.js +37 -0
- package/dist/chunks/dashboard-controls-DhRjB7MA.js +42 -0
- package/dist/chunks/dashboard-json-9cHzhSjC.js +1 -0
- package/dist/chunks/dates-D-KP8G-z.js +1 -0
- package/dist/chunks/edit-DEAK0UZo.js +1 -0
- package/dist/chunks/edit-dashboard-visual-Duq_QkB_.js +93 -0
- package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
- package/dist/chunks/filter-line-CwQrqORc.js +1 -0
- package/dist/chunks/filter-reach-preview-gixPFlZj.js +1 -0
- package/dist/chunks/filter-value-text-B3tXakhd.js +1 -0
- package/dist/chunks/index-B-VF1ogs.js +1 -0
- package/dist/chunks/index-BE1DfxNs.js +1 -0
- package/dist/chunks/index-DViPGDFj.js +1 -0
- package/dist/chunks/layout-grid-BWtlgw0T.js +6 -0
- package/dist/chunks/matrix-analytical-definition-CtFqWyCK.js +1 -0
- package/dist/chunks/matrix-member-presentation-Q0MCJ-YK.js +1 -0
- package/dist/chunks/matrix-operation-contract-D1RC1bfi.js +1 -0
- package/dist/chunks/metric-comparison-DEZYXROZ.js +1 -0
- package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
- package/dist/chunks/paintbrush-BjS3SbrH.js +6 -0
- package/dist/chunks/palette-BzC-CGOc.js +6 -0
- package/dist/chunks/pickers-DuBrUht0.js +1 -0
- package/dist/chunks/pivot-result-contract-expectations-DTQAgr4n.js +1 -0
- package/dist/chunks/pivot-result-identity-DTNCB--h.js +1 -0
- package/dist/chunks/raw-temporal-value-DeyEhL0S.js +1 -0
- package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
- package/dist/chunks/report-preferences-dialog-B_gUmCzG.js +1 -0
- package/dist/chunks/report-runtime-context-BWzIHCKK.js +1 -0
- package/dist/chunks/resolve-dashboard-input-context-B-TtRqxu.js +8 -0
- package/dist/chunks/resolver-AN9ChBfZ.js +1 -0
- package/dist/chunks/save-DdFUZcbi.js +6 -0
- package/dist/chunks/saved-dashboard-context-BAJ5tWiq.js +1 -0
- package/dist/chunks/schema-MC0cQSAb.js +4 -0
- package/dist/chunks/selection-filter-compiler-CCoCD25M.js +1 -0
- package/dist/chunks/semaphor-ready-indicator-DzjorP3t.js +999 -0
- package/dist/chunks/set-DuJfGkbY.js +1 -0
- package/dist/chunks/shelf-drop-preview-context-BlLJ5RsT.js +6 -0
- package/dist/chunks/stored-dashboard-Ctcpkllg.js +1 -0
- package/dist/chunks/style-sheet-parts-BRGt9O05.js +178 -0
- package/dist/chunks/table-export-sheet-rC5pKmXg.js +2 -0
- package/dist/chunks/token-types-Bj9iMy0w.js +1 -0
- package/dist/chunks/validators-CqV3Yka1.js +1 -0
- package/dist/chunks/variable-draft-DJrfUyhv.js +1 -0
- package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
- package/dist/dashboard/index.js +1 -7
- package/dist/dashboard-authoring/index.js +1 -4491
- package/dist/format-utils/index.js +1 -424
- package/dist/index.js +1 -554
- package/dist/layouts/index.js +1 -7
- package/dist/live-channel/index.js +1 -124
- package/dist/pdf-export-policy/index.js +1 -92
- package/dist/pdf-table-layout/index.js +1 -993
- package/dist/report-runtime-context/index.js +1 -9
- package/dist/shared/index.js +1 -6
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -9
- package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
- package/dist/types/index.js +1 -88
- package/dist/types/lib/document/document-edits.d.ts +0 -4
- package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
- package/dist/types/lib/stores/explorer-actions.d.ts +7 -6
- package/dist/types/lib/types/common-types.d.ts +0 -2
- package/dist/types/lib/types/explorer-types.d.ts +1 -1
- package/dist/types/lib/types/semantic-types.d.ts +6 -10
- package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
- package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
- package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
- package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
- package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
- package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
- package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +132 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
- package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -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 -1
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +21 -358
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
- package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +115 -0
- package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +6 -1
- package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
- package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
- package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
- package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +33 -8
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +0 -2
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
- package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
- package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
- package/dist/types/shared/temporal/index.d.ts +2 -0
- package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
- package/dist/types/shared/temporal/temporal.d.ts +27 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
- package/dist/usage-events/index.js +1 -285
- package/dist/value-format-preferences/index.js +1 -635
- package/package.json +6 -2
- package/dist/chunks/add-to-dashboard-ClhEIFst.js +0 -291
- package/dist/chunks/analytics-base-schemas-DevrgqQb.js +0 -678
- package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
- package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
- package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
- package/dist/chunks/assistant-chat-BWF3GYip.js +0 -6115
- package/dist/chunks/attribution-BvoKvhcj.js +0 -32
- package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
- package/dist/chunks/bookmark-impact-BF3iRx5a.js +0 -76
- package/dist/chunks/bookmark-state-CBSTdW6q.js +0 -1666
- package/dist/chunks/brand-BoUV0iHF.js +0 -54
- package/dist/chunks/card-filter-builder-B8XHwMY6.js +0 -4069
- package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
- package/dist/chunks/comparison-window-caption-W83qB4V5.js +0 -741
- package/dist/chunks/context-BJoEFgNl.js +0 -369
- package/dist/chunks/conversation-sQiWYUOb.js +0 -16
- package/dist/chunks/dashboard-DG5EIYYB.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-CBSrhyWZ.js +0 -4875
- package/dist/chunks/dashboard-controls-D6ECO4N1.js +0 -2290
- package/dist/chunks/dashboard-json-DrJftBSL.js +0 -66
- package/dist/chunks/dates-Bz-qM5px.js +0 -164
- package/dist/chunks/edit-9df1zOWe.js +0 -226
- package/dist/chunks/edit-dashboard-visual-BDYAJIbb.js +0 -18605
- package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
- package/dist/chunks/filter-line-BXT6y303.js +0 -703
- package/dist/chunks/filter-reach-copy-BukhZmzm.js +0 -5250
- package/dist/chunks/filter-value-text-D3-bf3_b.js +0 -153
- package/dist/chunks/index-BVKzKl5d.js +0 -90
- package/dist/chunks/index-BW0yozjs.js +0 -2795
- package/dist/chunks/index-CV_Kzou0.js +0 -595
- package/dist/chunks/layout-grid-Ds0diMeY.js +0 -16
- package/dist/chunks/matrix-analytical-definition-CgQgVeeI.js +0 -1162
- package/dist/chunks/matrix-member-presentation-DSBIIudt.js +0 -258
- package/dist/chunks/matrix-operation-contract--DkNCOzd.js +0 -1412
- package/dist/chunks/metric-comparison-zMylnIkc.js +0 -541
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
- package/dist/chunks/paintbrush-CX8pao1j.js +0 -27
- package/dist/chunks/palette-CuA0HlzF.js +0 -23
- package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
- package/dist/chunks/pivot-result-contract-expectations-C8KL7hPx.js +0 -5046
- package/dist/chunks/pivot-result-identity-C1AOH1PS.js +0 -77
- package/dist/chunks/raw-temporal-value-E416F-0L.js +0 -454
- package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
- package/dist/chunks/report-preferences-dialog-CbuVNDGi.js +0 -1637
- package/dist/chunks/report-runtime-context-E7USjN7E.js +0 -388
- package/dist/chunks/resolve-dashboard-input-context-CULCE_hM.js +0 -25172
- package/dist/chunks/resolver-DG_tfEpt.js +0 -156
- package/dist/chunks/save-BKHlDONy.js +0 -21
- package/dist/chunks/saved-dashboard-context-C1WlOx5z.js +0 -632
- package/dist/chunks/schema-C9NPiIru.js +0 -2568
- package/dist/chunks/selection-filter-compiler-ifT8JCXS.js +0 -131
- package/dist/chunks/semaphor-ready-indicator-CBIRcDWs.js +0 -145326
- package/dist/chunks/shelf-drop-preview-context-xR69SMA8.js +0 -2466
- package/dist/chunks/stored-dashboard-BuM8vnWf.js +0 -4070
- package/dist/chunks/style-sheet-parts-Bt9ZNre8.js +0 -8674
- package/dist/chunks/table-export-sheet-DVljtHkG.js +0 -949
- package/dist/chunks/token-types-D_xKgyVS.js +0 -8
- package/dist/chunks/upload-Dll_M7XQ.js +0 -15
- package/dist/chunks/validators-ClWHpYql.js +0 -3686
- package/dist/chunks/variable-draft-CDGGl53R.js +0 -242
- package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
import { A as c, i as y, o as h } from "./context-BJoEFgNl.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
|
-
};
|