react-semaphor 0.1.603 → 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 -1491
- 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 -4614
- package/dist/format-utils/index.js +1 -425
- 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/index.js +1 -88
- 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/explorer-actions.d.ts +7 -6
- 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/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/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/outline/outline-filters.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
- package/dist/usage-events/index.js +1 -285
- package/dist/value-format-preferences/index.js +1 -635
- package/package.json +4 -1
- package/dist/chunks/add-to-dashboard-CFF-wFU-.js +0 -291
- package/dist/chunks/analytics-base-schemas-DsUh5Q3C.js +0 -680
- 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-B6hNQI1t.js +0 -6115
- package/dist/chunks/attribution-BvoKvhcj.js +0 -32
- package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
- package/dist/chunks/bookmark-impact-Ba2PLcGp.js +0 -76
- package/dist/chunks/bookmark-state-n7AaNzR_.js +0 -1667
- package/dist/chunks/brand-BoUV0iHF.js +0 -54
- package/dist/chunks/card-filter-builder-Y22HizVx.js +0 -4069
- package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
- package/dist/chunks/comparison-window-caption-Ck2TIbnR.js +0 -741
- package/dist/chunks/context-UCQ7sere.js +0 -369
- package/dist/chunks/conversation-sQiWYUOb.js +0 -16
- package/dist/chunks/dashboard-BghI99oY.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-DtBAnGiH.js +0 -4875
- package/dist/chunks/dashboard-controls-CtFXlyjV.js +0 -2290
- package/dist/chunks/dashboard-json-DfGBUtCd.js +0 -66
- package/dist/chunks/dates-BnrXF4bb.js +0 -185
- package/dist/chunks/edit-9df1zOWe.js +0 -226
- package/dist/chunks/edit-dashboard-visual-oxt3x1wb.js +0 -18397
- package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
- package/dist/chunks/filter-line-Cy5YYqRL.js +0 -703
- package/dist/chunks/filter-reach-copy-CE_ZX147.js +0 -5111
- package/dist/chunks/filter-value-text-fWvSDwkl.js +0 -153
- package/dist/chunks/index-BVKzKl5d.js +0 -90
- package/dist/chunks/index-CV_Kzou0.js +0 -595
- package/dist/chunks/index-D5rxbtS4.js +0 -2795
- package/dist/chunks/layout-grid-9LndRoLa.js +0 -16
- package/dist/chunks/matrix-analytical-definition-CCp48UCw.js +0 -1233
- package/dist/chunks/matrix-member-presentation-zNehruXR.js +0 -391
- package/dist/chunks/matrix-operation-contract-DPBj69D8.js +0 -1413
- package/dist/chunks/metric-comparison-B0FR-Q8I.js +0 -600
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
- package/dist/chunks/paintbrush-58FQYY-y.js +0 -27
- package/dist/chunks/palette-Be62Tkoa.js +0 -23
- package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
- package/dist/chunks/pivot-result-contract-expectations-BYqAmG9n.js +0 -5092
- package/dist/chunks/pivot-result-identity-CAP4--iq.js +0 -77
- package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +0 -3778
- package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
- package/dist/chunks/report-preferences-dialog-uJp9GBTM.js +0 -1651
- package/dist/chunks/report-runtime-context-c77_KF9v.js +0 -388
- package/dist/chunks/resolve-dashboard-input-context-Rtl1ffmE.js +0 -25324
- package/dist/chunks/resolver-DG_tfEpt.js +0 -156
- package/dist/chunks/save-C5A0JnEV.js +0 -21
- package/dist/chunks/saved-dashboard-context-tcyTU8jm.js +0 -618
- package/dist/chunks/schema-C9NPiIru.js +0 -2568
- package/dist/chunks/selection-filter-compiler-DNijjI5y.js +0 -150
- package/dist/chunks/semaphor-ready-indicator-FBvunj6S.js +0 -145603
- package/dist/chunks/shelf-drop-preview-context-QKStrcK9.js +0 -2466
- package/dist/chunks/stored-dashboard-CHozcAY9.js +0 -4075
- package/dist/chunks/style-sheet-parts-CDCG-8Ej.js +0 -8681
- package/dist/chunks/table-export-sheet-ZFIvs6Sj.js +0 -949
- package/dist/chunks/token-types-XbM6QByy.js +0 -8
- package/dist/chunks/upload-H15d7uHK.js +0 -15
- package/dist/chunks/validators-Baf3VIf5.js +0 -3686
- package/dist/chunks/variable-draft-C2y8Jp6Z.js +0 -242
- package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
|
@@ -1,369 +0,0 @@
|
|
|
1
|
-
var T = Object.defineProperty;
|
|
2
|
-
var q = (e, a, i) => a in e ? T(e, a, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[a] = i;
|
|
3
|
-
var b = (e, a, i) => q(e, typeof a != "symbol" ? a + "" : a, i);
|
|
4
|
-
import { z as t } from "zod";
|
|
5
|
-
import { s as k } from "./analytics-base-schemas-DsUh5Q3C.js";
|
|
6
|
-
const J = 1, Y = [
|
|
7
|
-
// before streaming (HTTP status in spec section 10)
|
|
8
|
-
"assistant_unavailable",
|
|
9
|
-
"context_invalid",
|
|
10
|
-
"context_too_large",
|
|
11
|
-
"conversation_not_found",
|
|
12
|
-
"conversation_full",
|
|
13
|
-
"turn_in_progress",
|
|
14
|
-
"daily_limit_reached",
|
|
15
|
-
// inside the stream
|
|
16
|
-
"budget_exhausted",
|
|
17
|
-
"not_permitted",
|
|
18
|
-
"no_data_found",
|
|
19
|
-
"model_unavailable"
|
|
20
|
-
];
|
|
21
|
-
function _(e) {
|
|
22
|
-
return `You've used ${e === void 0 ? "today's questions" : `today's ${e} questions`}. They reset tomorrow. To keep going, contact your administrator.`;
|
|
23
|
-
}
|
|
24
|
-
function z(e, a = {}) {
|
|
25
|
-
return e === "daily_limit_reached" ? _(a.dailyLimit) : $[e];
|
|
26
|
-
}
|
|
27
|
-
const $ = {
|
|
28
|
-
assistant_unavailable: "The assistant is not available here.",
|
|
29
|
-
context_invalid: "Something on this page changed. Try again.",
|
|
30
|
-
context_too_large: "There is too much on this page to send with your question. Ask about one card, or clear some filters.",
|
|
31
|
-
conversation_not_found: "This conversation has ended. Start a new one.",
|
|
32
|
-
conversation_full: "This conversation is full. Start a new one.",
|
|
33
|
-
turn_in_progress: "Still answering your last question.",
|
|
34
|
-
daily_limit_reached: _(),
|
|
35
|
-
budget_exhausted: "This question needed more steps than one answer allows. Try asking for less at once.",
|
|
36
|
-
not_permitted: "You do not have access to the data this needs.",
|
|
37
|
-
no_data_found: "No data matched this question.",
|
|
38
|
-
model_unavailable: "The assistant could not answer right now. Try again."
|
|
39
|
-
}, A = {
|
|
40
|
-
messageChars: 4e3,
|
|
41
|
-
/** The whole serialized AssistantContext, in UTF-8 bytes. */
|
|
42
|
-
contextBytes: 48 * 1024,
|
|
43
|
-
/** The whole request body (context, message, added sources) except `openDashboard`, in UTF-8 bytes. */
|
|
44
|
-
requestBytes: 128 * 1024,
|
|
45
|
-
/**
|
|
46
|
-
* The dashboard on screen sent with a question (Phase 7, D7-12), alone, in
|
|
47
|
-
* UTF-8 bytes of its JSON. Over it the browser sends the question without it.
|
|
48
|
-
*/
|
|
49
|
-
openDashboardBytes: 2 * 1024 * 1024,
|
|
50
|
-
summaryCards: 30,
|
|
51
|
-
// AssistantContext.cards
|
|
52
|
-
otherSheets: 50,
|
|
53
|
-
activeInputs: 50,
|
|
54
|
-
/** Values listed for one input, or in one filter's text. */
|
|
55
|
-
inputValues: 50,
|
|
56
|
-
addedSources: 50,
|
|
57
|
-
cardFields: 60,
|
|
58
|
-
/** Fields of the asked-about card tagged in one question (Phase 11). */
|
|
59
|
-
taggedFields: 5,
|
|
60
|
-
cardFilters: 40,
|
|
61
|
-
cardControls: 40,
|
|
62
|
-
drillSteps: 10,
|
|
63
|
-
sqlChars: 2e4,
|
|
64
|
-
sqlParameters: 40,
|
|
65
|
-
idChars: 200,
|
|
66
|
-
labelChars: 500,
|
|
67
|
-
/** One filter, control or SQL parameter description. */
|
|
68
|
-
textChars: 4e3,
|
|
69
|
-
turnsPerConversation: 40,
|
|
70
|
-
conversationBytes: 1024 * 1024,
|
|
71
|
-
toolCallsPerTurn: 12,
|
|
72
|
-
secondsPerTurn: 120,
|
|
73
|
-
artifactRecords: 200,
|
|
74
|
-
// rows kept on an artifact (D4-6: several fit in a conversation's 1 MB)
|
|
75
|
-
conversationTtlSeconds: 24 * 60 * 60
|
|
76
|
-
};
|
|
77
|
-
function G(e) {
|
|
78
|
-
return new TextEncoder().encode(JSON.stringify(e)).length;
|
|
79
|
-
}
|
|
80
|
-
function H(e, a) {
|
|
81
|
-
if (e.length <= a) return e;
|
|
82
|
-
const i = (n) => ` [${n} more characters not shown]`, s = a - i(e.length).length;
|
|
83
|
-
return `${e.slice(0, s)}${i(e.length - s)}`;
|
|
84
|
-
}
|
|
85
|
-
class X extends Error {
|
|
86
|
-
constructor(i) {
|
|
87
|
-
super($.context_too_large);
|
|
88
|
-
b(this, "code", "context_too_large");
|
|
89
|
-
this.bytes = i, this.name = "AssistantContextTooLargeError";
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
const j = 1, N = ["dashboard", "editor", "none"], r = A, p = t.string().min(1).max(r.idChars), h = t.string().max(r.labelChars), u = t.string().max(r.textChars), g = t.number().int().positive(), v = t.string().min(1).max(100), S = t.object({ id: p, title: h }).strict(), E = t.object({
|
|
93
|
-
inputId: p,
|
|
94
|
-
label: h,
|
|
95
|
-
value: t.discriminatedUnion("kind", [
|
|
96
|
-
t.object({
|
|
97
|
-
kind: t.literal("set"),
|
|
98
|
-
text: u,
|
|
99
|
-
omittedValues: g.optional(),
|
|
100
|
-
notApplied: t.literal("opened_from_another_dashboard").optional(),
|
|
101
|
-
fingerprint: v
|
|
102
|
-
}).strict(),
|
|
103
|
-
t.object({ kind: t.literal("varies") }).strict()
|
|
104
|
-
]),
|
|
105
|
-
globalDate: t.literal(!0).optional()
|
|
106
|
-
}).strict(), y = {
|
|
107
|
-
id: p,
|
|
108
|
-
title: h,
|
|
109
|
-
visualType: t.string().max(100),
|
|
110
|
-
source: k.optional()
|
|
111
|
-
}, F = t.object(y).strict(), I = (e) => t.object(Object.fromEntries(e.map((a) => [a, g.optional()]))).strict().optional(), L = t.object({
|
|
112
|
-
role: t.enum(["row", "column", "measure", "detail"]),
|
|
113
|
-
label: h,
|
|
114
|
-
name: h,
|
|
115
|
-
aggregate: t.string().max(40).optional(),
|
|
116
|
-
granularity: t.string().max(40).optional()
|
|
117
|
-
}).strict(), x = t.discriminatedUnion("status", [
|
|
118
|
-
t.object({
|
|
119
|
-
status: t.literal("described"),
|
|
120
|
-
fields: t.array(L).max(r.cardFields),
|
|
121
|
-
filters: t.array(
|
|
122
|
-
t.object({
|
|
123
|
-
origin: t.enum(["dashboard_input", "card_input", "card", "drill", "selection"]),
|
|
124
|
-
text: u,
|
|
125
|
-
omittedValues: g.optional()
|
|
126
|
-
}).strict()
|
|
127
|
-
).max(r.cardFilters),
|
|
128
|
-
controls: t.array(t.object({ label: h, valueText: u }).strict()).max(r.cardControls),
|
|
129
|
-
drillPath: t.array(u).max(r.drillSteps),
|
|
130
|
-
sql: t.object({
|
|
131
|
-
text: t.string().max(r.sqlChars),
|
|
132
|
-
parameters: t.array(t.object({ name: h, valueText: u }).strict()).max(r.sqlParameters)
|
|
133
|
-
}).strict().optional(),
|
|
134
|
-
comparisons: t.array(u).max(r.cardFields).optional(),
|
|
135
|
-
omitted: I(["fields", "filters", "controls", "drillSteps", "sqlParameters", "comparisons"])
|
|
136
|
-
}).strict(),
|
|
137
|
-
t.object({
|
|
138
|
-
status: t.literal("not_described"),
|
|
139
|
-
reason: t.enum(["matrix", "custom_visual", "python", "snapshot_blocked", "snapshot_pending"]),
|
|
140
|
-
message: u.optional()
|
|
141
|
-
}).strict()
|
|
142
|
-
]), R = t.object({
|
|
143
|
-
...y,
|
|
144
|
-
fingerprint: v,
|
|
145
|
-
description: x
|
|
146
|
-
}).strict(), K = t.object({
|
|
147
|
-
version: t.literal(j),
|
|
148
|
-
surface: t.enum(N),
|
|
149
|
-
dashboard: t.object({
|
|
150
|
-
id: p,
|
|
151
|
-
title: h,
|
|
152
|
-
unsavedEdits: t.boolean()
|
|
153
|
-
}).strict().optional(),
|
|
154
|
-
sheet: S.optional(),
|
|
155
|
-
otherSheets: t.array(S).max(r.otherSheets),
|
|
156
|
-
activeInputs: t.array(E).max(r.activeInputs),
|
|
157
|
-
cards: t.array(F).max(r.summaryCards),
|
|
158
|
-
selectedCard: R.optional(),
|
|
159
|
-
editing: t.object({ mode: t.enum(["visual", "sql"]) }).strict().optional(),
|
|
160
|
-
omitted: I(["otherSheets", "activeInputs", "cards"]),
|
|
161
|
-
timeZone: t.string().min(1).max(100)
|
|
162
|
-
}).strict().superRefine((e, a) => {
|
|
163
|
-
e.surface !== "none" && !e.dashboard && a.addIssue({
|
|
164
|
-
code: t.ZodIssueCode.custom,
|
|
165
|
-
path: ["dashboard"],
|
|
166
|
-
message: `required on the ${e.surface} surface`
|
|
167
|
-
}), e.selectedCard && e.surface === "none" && a.addIssue({
|
|
168
|
-
code: t.ZodIssueCode.custom,
|
|
169
|
-
path: ["selectedCard"],
|
|
170
|
-
message: "only on the dashboard and editor surfaces"
|
|
171
|
-
}), e.surface === "editor" != !!e.editing && a.addIssue({
|
|
172
|
-
code: t.ZodIssueCode.custom,
|
|
173
|
-
path: ["editing"],
|
|
174
|
-
message: "required on the editor surface, and only there"
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
function ee(e, a) {
|
|
178
|
-
if (!e) return [];
|
|
179
|
-
const i = [];
|
|
180
|
-
e.surface !== a.surface && i.push({
|
|
181
|
-
kind: "surface_changed",
|
|
182
|
-
from: e.surface,
|
|
183
|
-
to: a.surface
|
|
184
|
-
}), e.sheet && a.sheet && e.sheet.id !== a.sheet.id && i.push({
|
|
185
|
-
kind: "sheet_changed",
|
|
186
|
-
fromSheetId: e.sheet.id,
|
|
187
|
-
toSheetId: a.sheet.id
|
|
188
|
-
});
|
|
189
|
-
const s = e.selectedCard, n = a.selectedCard;
|
|
190
|
-
(s == null ? void 0 : s.id) !== (n == null ? void 0 : n.id) ? i.push({
|
|
191
|
-
kind: "selection_changed",
|
|
192
|
-
...s ? { fromCardId: s.id } : {},
|
|
193
|
-
...n ? { toCardId: n.id } : {}
|
|
194
|
-
}) : s && n && s.fingerprint !== n.fingerprint && i.push({ kind: "card_changed", cardId: n.id });
|
|
195
|
-
const d = O(
|
|
196
|
-
e.activeInputs ?? [],
|
|
197
|
-
a.activeInputs
|
|
198
|
-
);
|
|
199
|
-
return d.length > 0 && i.push({ kind: "inputs_changed", inputIds: d }), i;
|
|
200
|
-
}
|
|
201
|
-
function O(e, a) {
|
|
202
|
-
const i = (o) => o ? o.value.kind === "set" ? o.value.fingerprint : "varies" : void 0, s = new Map(e.map((o) => [o.inputId, o])), n = new Map(a.map((o) => [o.inputId, o]));
|
|
203
|
-
return [.../* @__PURE__ */ new Set([...s.keys(), ...n.keys()])].filter(
|
|
204
|
-
(o) => i(s.get(o)) !== i(n.get(o))
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
function te(e, a, i) {
|
|
208
|
-
var n, d, o;
|
|
209
|
-
const s = [];
|
|
210
|
-
if (e.surface === "none" || !e.dashboard)
|
|
211
|
-
s.push(
|
|
212
|
-
"The user is not looking at a dashboard. Answer from the sources they added; if none fit, find the data with the discovery tools or ask which data to use."
|
|
213
|
-
);
|
|
214
|
-
else {
|
|
215
|
-
const c = e.surface === "editor" ? "editing a visual on" : "looking at";
|
|
216
|
-
s.push(
|
|
217
|
-
`The user is ${c} the dashboard ${l(e.dashboard.title)} (id ${e.dashboard.id})${e.dashboard.unsavedEdits ? ", which has unsaved edits" : ""}.`
|
|
218
|
-
), e.sheet && s.push(
|
|
219
|
-
`Current sheet: ${l(e.sheet.title)} (id ${e.sheet.id}).`
|
|
220
|
-
), e.otherSheets.length > 0 && s.push(
|
|
221
|
-
`Other sheets: ${e.otherSheets.map((C) => l(C.title)).join(", ")}${m((n = e.omitted) == null ? void 0 : n.otherSheets, "sheets")}.`
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
if (e.activeInputs.length > 0) {
|
|
225
|
-
s.push(
|
|
226
|
-
"",
|
|
227
|
-
"Dashboard inputs with a value (which of them a card applies is in that card's description when the user asks about it):"
|
|
228
|
-
);
|
|
229
|
-
for (const c of e.activeInputs)
|
|
230
|
-
s.push(`- ${B(c)}`);
|
|
231
|
-
(d = e.omitted) != null && d.activeInputs && s.push(`- ${e.omitted.activeInputs} more inputs are not listed.`);
|
|
232
|
-
}
|
|
233
|
-
if (e.cards.length > 0) {
|
|
234
|
-
s.push("", "Cards on this sheet:");
|
|
235
|
-
for (const c of e.cards)
|
|
236
|
-
s.push(`- ${f(c)}`);
|
|
237
|
-
(o = e.omitted) != null && o.cards && s.push(`- ${e.omitted.cards} more cards are not listed.`);
|
|
238
|
-
}
|
|
239
|
-
if (e.selectedCard && s.push("", ...Q(e.selectedCard, e.editing)), i.length > 0) {
|
|
240
|
-
s.push("", "Sources the user added:");
|
|
241
|
-
for (const c of i)
|
|
242
|
-
s.push(`- ${w(c)}`);
|
|
243
|
-
}
|
|
244
|
-
if (a.length > 0) {
|
|
245
|
-
s.push("", "Since the last question:");
|
|
246
|
-
for (const c of a)
|
|
247
|
-
s.push(`- ${V(c, e)}`);
|
|
248
|
-
}
|
|
249
|
-
return s.push("", `The user's time zone is ${e.timeZone}.`), s.join(`
|
|
250
|
-
`);
|
|
251
|
-
}
|
|
252
|
-
function P(e) {
|
|
253
|
-
const a = [e.name, e.aggregate, e.granularity ? `by ${e.granularity}` : void 0].filter(Boolean);
|
|
254
|
-
return `${e.role} ${l(e.label)} (${a.join(", ")})`;
|
|
255
|
-
}
|
|
256
|
-
function l(e) {
|
|
257
|
-
return JSON.stringify(e);
|
|
258
|
-
}
|
|
259
|
-
function m(e, a) {
|
|
260
|
-
return e ? `, and ${e} more ${a}` : "";
|
|
261
|
-
}
|
|
262
|
-
function f(e) {
|
|
263
|
-
return `${l(e.title)} (card id ${e.id}, ${e.visualType})${e.source ? ` from ${w(e.source)}` : ""}`;
|
|
264
|
-
}
|
|
265
|
-
function B(e) {
|
|
266
|
-
const { value: a } = e;
|
|
267
|
-
return a.kind === "varies" ? `${l(e.label)}: differs by card; ask about a card to see its value` : a.notApplied ? `${a.text} (not applied in this view: it was opened from another dashboard without this dashboard's own filters)` : `${a.text}${e.globalDate ? ", applied to each card's own date field, on cards that have one" : ""}`;
|
|
268
|
-
}
|
|
269
|
-
const D = {
|
|
270
|
-
matrix: "it is a Matrix card",
|
|
271
|
-
custom_visual: "it is a custom visual",
|
|
272
|
-
python: "it is computed with Python",
|
|
273
|
-
snapshot_blocked: "the dashboard could not compile it",
|
|
274
|
-
snapshot_pending: "it was still loading when the question was sent"
|
|
275
|
-
}, M = {
|
|
276
|
-
dashboard_input: "dashboard input",
|
|
277
|
-
card_input: "the card's own input",
|
|
278
|
-
card: "the card's own filter",
|
|
279
|
-
drill: "drill",
|
|
280
|
-
selection: "selection on another card"
|
|
281
|
-
};
|
|
282
|
-
function Q(e, a) {
|
|
283
|
-
var d;
|
|
284
|
-
const i = a ? [
|
|
285
|
-
`The user is editing the visual ${f(e)} in ${a.mode === "sql" ? "SQL" : "visual"} mode. What follows is their draft as it is on screen, which may not be saved: fromCard on this card runs the draft, and its rows are the draft's, not the saved card's. You cannot change the visual; to help change it, explain the steps in the editor or write SQL for them to paste.`
|
|
286
|
-
] : [`The user is asking about the card ${f(e)}.`], s = e.description;
|
|
287
|
-
if (s.status === "not_described")
|
|
288
|
-
return i.push(
|
|
289
|
-
`How this card is built is not available to you: ${D[s.reason]}${s.message ? ` (${s.message})` : ""}. Answer with the tools, and say that you could not read the card's definition.`
|
|
290
|
-
), i;
|
|
291
|
-
const n = s.omitted ?? {};
|
|
292
|
-
if (i.push(a ? "What the draft runs, as the editor compiled it:" : "What the card runs, as the dashboard compiled it:"), s.fields.length > 0) {
|
|
293
|
-
const o = s.fields.map(P);
|
|
294
|
-
i.push(`- Fields: ${o.join("; ")}${m(n.fields, "fields not listed")}.`);
|
|
295
|
-
} else
|
|
296
|
-
i.push("- Fields: none.");
|
|
297
|
-
if (s.filters.length > 0) {
|
|
298
|
-
i.push("- Filters, all applied together:");
|
|
299
|
-
for (const o of s.filters)
|
|
300
|
-
i.push(` - ${M[o.origin]}: ${o.text}`);
|
|
301
|
-
n.filters && i.push(` - ${n.filters} more filters are not listed.`);
|
|
302
|
-
} else
|
|
303
|
-
i.push("- Filters: none.");
|
|
304
|
-
if (s.drillPath.length > 0 && i.push(
|
|
305
|
-
`- Drilled into: ${s.drillPath.join(", then ")}${m(n.drillSteps, "steps")}.`
|
|
306
|
-
), s.controls.length > 0) {
|
|
307
|
-
i.push("- Controls:");
|
|
308
|
-
for (const o of s.controls)
|
|
309
|
-
i.push(` - ${l(o.label)}: ${o.valueText}`);
|
|
310
|
-
n.controls && i.push(` - ${n.controls} more controls are not listed.`);
|
|
311
|
-
}
|
|
312
|
-
if (s.sql && (i.push("- SQL:", "```sql", s.sql.text, "```"), s.sql.parameters.length > 0 && i.push(
|
|
313
|
-
`- SQL parameters: ${s.sql.parameters.map((o) => `${o.name} = ${o.valueText}`).join("; ")}${m(n.sqlParameters, "parameters")}.`
|
|
314
|
-
)), (d = s.comparisons) != null && d.length) {
|
|
315
|
-
i.push("- Comparisons (the windows are known only once a query runs):");
|
|
316
|
-
for (const o of s.comparisons) i.push(` - ${o}`);
|
|
317
|
-
n.comparisons && i.push(` - ${n.comparisons} more comparisons are not listed.`);
|
|
318
|
-
}
|
|
319
|
-
return i.push(
|
|
320
|
-
"This lists the card's fields, filters, drill path, controls, SQL and comparisons; it does not include the card's sorting, row limit or calculated-field formulas. A query you build yourself can differ from the card."
|
|
321
|
-
), i;
|
|
322
|
-
}
|
|
323
|
-
function w(e) {
|
|
324
|
-
switch (e.kind) {
|
|
325
|
-
case "semantic":
|
|
326
|
-
return `dataset ${l(e.label ?? e.datasetName)} (domainId ${e.domainId}, datasetName ${e.datasetName})`;
|
|
327
|
-
case "physical":
|
|
328
|
-
return `table ${[e.databaseName, e.schemaName, e.tableName].filter(Boolean).join(".")} (connectionId ${e.connectionId})`;
|
|
329
|
-
case "sql":
|
|
330
|
-
return `SQL on ${e.label ? l(e.label) : "a connection"} (connectionId ${e.connectionId})`;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
function V(e, a) {
|
|
334
|
-
var i;
|
|
335
|
-
switch (e.kind) {
|
|
336
|
-
case "surface_changed":
|
|
337
|
-
return `the user moved from the ${e.from} view to the ${e.to} view.`;
|
|
338
|
-
case "sheet_changed":
|
|
339
|
-
return `the user switched sheets (now ${l(((i = a.sheet) == null ? void 0 : i.title) ?? e.toSheetId)}).`;
|
|
340
|
-
case "selection_changed":
|
|
341
|
-
return e.toCardId ? `the user is now asking about card ${e.toCardId}.` : "the user is no longer asking about a specific card.";
|
|
342
|
-
case "card_changed":
|
|
343
|
-
return `card ${e.cardId} now runs differently (its fields, filters, controls or SQL changed).`;
|
|
344
|
-
case "inputs_changed":
|
|
345
|
-
return `these dashboard inputs changed: ${e.inputIds.map((n) => {
|
|
346
|
-
const d = a.activeInputs.find((o) => o.inputId === n);
|
|
347
|
-
return d ? l(d.label) : `input ${n} (now cleared)`;
|
|
348
|
-
}).join(", ")}.`;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
export {
|
|
352
|
-
A,
|
|
353
|
-
K as a,
|
|
354
|
-
L as b,
|
|
355
|
-
G as c,
|
|
356
|
-
X as d,
|
|
357
|
-
j as e,
|
|
358
|
-
H as f,
|
|
359
|
-
N as g,
|
|
360
|
-
ee as h,
|
|
361
|
-
P as i,
|
|
362
|
-
w as j,
|
|
363
|
-
J as k,
|
|
364
|
-
Y as l,
|
|
365
|
-
_ as m,
|
|
366
|
-
z as n,
|
|
367
|
-
$ as o,
|
|
368
|
-
te as r
|
|
369
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as a, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { E as o, F as i, S as d, B as s, a as c, U as l, D as t, A as h, C as f, b } from "./semaphor-ready-indicator-FBvunj6S.js";
|
|
3
|
-
function u(e) {
|
|
4
|
-
if (typeof window > "u")
|
|
5
|
-
return null;
|
|
6
|
-
const { preferences: r } = e;
|
|
7
|
-
return /* @__PURE__ */ a(o, { FallbackComponent: i, children: /* @__PURE__ */ a(d, { dashboardProps: e, children: /* @__PURE__ */ n(s, { children: [
|
|
8
|
-
/* @__PURE__ */ a(c, { componentType: "dashboard", componentId: e.id }),
|
|
9
|
-
/* @__PURE__ */ a(l, { appearance: e.appearance, children: /* @__PURE__ */ a(t, { preferences: r, children: /* @__PURE__ */ a(h, { children: /* @__PURE__ */ a("main", { className: "flex h-full flex-col", children: /* @__PURE__ */ a(f, { ...e, type: "dashboard", children: /* @__PURE__ */ a(b, {}) }) }) }) }) })
|
|
10
|
-
] }) }) });
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
u as D
|
|
14
|
-
};
|