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.
Files changed (211) hide show
  1. package/dist/activity/index.js +1 -73
  2. package/dist/analytics-protocol/index.js +1 -1451
  3. package/dist/appearance/index.js +1 -12
  4. package/dist/appearance-runtime/index.js +1 -5
  5. package/dist/assistant-context/index.js +1 -11
  6. package/dist/assistant-protocol/index.js +1 -152
  7. package/dist/brand-studio/index.js +4 -1594
  8. package/dist/briefings/index.js +1 -70
  9. package/dist/chunks/add-to-dashboard-DeHEBEqG.js +12 -0
  10. package/dist/chunks/analytics-base-schemas-BREc5WGv.js +1 -0
  11. package/dist/chunks/appearance-context-BqBZrijL.js +1 -0
  12. package/dist/chunks/appearance-runtime-provider-DmbCrOOG.js +1 -0
  13. package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
  14. package/dist/chunks/assistant-chat-CjYrwVDa.js +56 -0
  15. package/dist/chunks/attribution-BEFSsbNn.js +1 -0
  16. package/dist/chunks/availability-3AIOf6Z-.js +1 -0
  17. package/dist/chunks/bookmark-impact-C89zBLq3.js +1 -0
  18. package/dist/chunks/bookmark-state-69YYnRql.js +1 -0
  19. package/dist/chunks/brand-DCaZyRt6.js +1 -0
  20. package/dist/chunks/card-filter-builder-CTp6RAz1.js +17 -0
  21. package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
  22. package/dist/chunks/comparison-window-caption-C312mn3s.js +1 -0
  23. package/dist/chunks/context-ALdccLHw.js +2 -0
  24. package/dist/chunks/conversation-JMK2kyTK.js +1 -0
  25. package/dist/chunks/dashboard-BX28ld6s.js +1 -0
  26. package/dist/chunks/dashboard-briefing-launcher-qo7GH4EO.js +37 -0
  27. package/dist/chunks/dashboard-controls-DhRjB7MA.js +42 -0
  28. package/dist/chunks/dashboard-json-9cHzhSjC.js +1 -0
  29. package/dist/chunks/dates-D-KP8G-z.js +1 -0
  30. package/dist/chunks/edit-DEAK0UZo.js +1 -0
  31. package/dist/chunks/edit-dashboard-visual-Duq_QkB_.js +93 -0
  32. package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
  33. package/dist/chunks/filter-line-CwQrqORc.js +1 -0
  34. package/dist/chunks/filter-reach-preview-gixPFlZj.js +1 -0
  35. package/dist/chunks/filter-value-text-B3tXakhd.js +1 -0
  36. package/dist/chunks/index-B-VF1ogs.js +1 -0
  37. package/dist/chunks/index-BE1DfxNs.js +1 -0
  38. package/dist/chunks/index-DViPGDFj.js +1 -0
  39. package/dist/chunks/layout-grid-BWtlgw0T.js +6 -0
  40. package/dist/chunks/matrix-analytical-definition-CtFqWyCK.js +1 -0
  41. package/dist/chunks/matrix-member-presentation-Q0MCJ-YK.js +1 -0
  42. package/dist/chunks/matrix-operation-contract-D1RC1bfi.js +1 -0
  43. package/dist/chunks/metric-comparison-DEZYXROZ.js +1 -0
  44. package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
  45. package/dist/chunks/paintbrush-BjS3SbrH.js +6 -0
  46. package/dist/chunks/palette-BzC-CGOc.js +6 -0
  47. package/dist/chunks/pickers-DuBrUht0.js +1 -0
  48. package/dist/chunks/pivot-result-contract-expectations-DTQAgr4n.js +1 -0
  49. package/dist/chunks/pivot-result-identity-DTNCB--h.js +1 -0
  50. package/dist/chunks/raw-temporal-value-DeyEhL0S.js +1 -0
  51. package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
  52. package/dist/chunks/report-preferences-dialog-B_gUmCzG.js +1 -0
  53. package/dist/chunks/report-runtime-context-BWzIHCKK.js +1 -0
  54. package/dist/chunks/resolve-dashboard-input-context-B-TtRqxu.js +8 -0
  55. package/dist/chunks/resolver-AN9ChBfZ.js +1 -0
  56. package/dist/chunks/save-DdFUZcbi.js +6 -0
  57. package/dist/chunks/saved-dashboard-context-BAJ5tWiq.js +1 -0
  58. package/dist/chunks/schema-MC0cQSAb.js +4 -0
  59. package/dist/chunks/selection-filter-compiler-CCoCD25M.js +1 -0
  60. package/dist/chunks/semaphor-ready-indicator-DzjorP3t.js +999 -0
  61. package/dist/chunks/set-DuJfGkbY.js +1 -0
  62. package/dist/chunks/shelf-drop-preview-context-BlLJ5RsT.js +6 -0
  63. package/dist/chunks/stored-dashboard-Ctcpkllg.js +1 -0
  64. package/dist/chunks/style-sheet-parts-BRGt9O05.js +178 -0
  65. package/dist/chunks/table-export-sheet-rC5pKmXg.js +2 -0
  66. package/dist/chunks/token-types-Bj9iMy0w.js +1 -0
  67. package/dist/chunks/validators-CqV3Yka1.js +1 -0
  68. package/dist/chunks/variable-draft-DJrfUyhv.js +1 -0
  69. package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
  70. package/dist/dashboard/index.js +1 -7
  71. package/dist/dashboard-authoring/index.js +1 -4491
  72. package/dist/format-utils/index.js +1 -424
  73. package/dist/index.js +1 -554
  74. package/dist/layouts/index.js +1 -7
  75. package/dist/live-channel/index.js +1 -124
  76. package/dist/pdf-export-policy/index.js +1 -92
  77. package/dist/pdf-table-layout/index.js +1 -993
  78. package/dist/report-runtime-context/index.js +1 -9
  79. package/dist/shared/index.js +1 -6
  80. package/dist/style.css +1 -1
  81. package/dist/surfboard/index.js +1 -9
  82. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
  83. package/dist/types/index.js +1 -88
  84. package/dist/types/lib/document/document-edits.d.ts +0 -4
  85. package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
  86. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
  87. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  88. package/dist/types/lib/stores/explorer-actions.d.ts +7 -6
  89. package/dist/types/lib/types/common-types.d.ts +0 -2
  90. package/dist/types/lib/types/explorer-types.d.ts +1 -1
  91. package/dist/types/lib/types/semantic-types.d.ts +6 -10
  92. package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
  93. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
  94. package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
  95. package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
  96. package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
  97. package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
  98. package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
  99. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
  100. package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
  101. package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
  102. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
  103. package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
  104. package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +1 -1
  105. package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
  106. package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
  107. package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
  108. package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
  109. package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
  110. package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
  111. package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +132 -0
  112. package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
  113. package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
  114. package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
  115. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
  116. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  117. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
  118. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
  119. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +21 -358
  120. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
  121. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  122. package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
  123. package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +115 -0
  124. package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
  125. package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
  126. package/dist/types/shared/dashboard-authoring/index.d.ts +6 -1
  127. package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
  128. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
  129. package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
  130. package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
  131. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
  132. package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
  133. package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
  134. package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
  135. package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
  136. package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +33 -8
  137. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +0 -2
  138. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +5 -0
  139. package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
  140. package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
  141. package/dist/types/shared/format-utils/index.d.ts +1 -0
  142. package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
  143. package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
  144. package/dist/types/shared/temporal/index.d.ts +2 -0
  145. package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
  146. package/dist/types/shared/temporal/temporal.d.ts +27 -0
  147. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
  148. package/dist/usage-events/index.js +1 -285
  149. package/dist/value-format-preferences/index.js +1 -635
  150. package/package.json +6 -2
  151. package/dist/chunks/add-to-dashboard-ClhEIFst.js +0 -291
  152. package/dist/chunks/analytics-base-schemas-DevrgqQb.js +0 -678
  153. package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
  154. package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
  155. package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
  156. package/dist/chunks/assistant-chat-BWF3GYip.js +0 -6115
  157. package/dist/chunks/attribution-BvoKvhcj.js +0 -32
  158. package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
  159. package/dist/chunks/bookmark-impact-BF3iRx5a.js +0 -76
  160. package/dist/chunks/bookmark-state-CBSTdW6q.js +0 -1666
  161. package/dist/chunks/brand-BoUV0iHF.js +0 -54
  162. package/dist/chunks/card-filter-builder-B8XHwMY6.js +0 -4069
  163. package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
  164. package/dist/chunks/comparison-window-caption-W83qB4V5.js +0 -741
  165. package/dist/chunks/context-BJoEFgNl.js +0 -369
  166. package/dist/chunks/conversation-sQiWYUOb.js +0 -16
  167. package/dist/chunks/dashboard-DG5EIYYB.js +0 -14
  168. package/dist/chunks/dashboard-briefing-launcher-CBSrhyWZ.js +0 -4875
  169. package/dist/chunks/dashboard-controls-D6ECO4N1.js +0 -2290
  170. package/dist/chunks/dashboard-json-DrJftBSL.js +0 -66
  171. package/dist/chunks/dates-Bz-qM5px.js +0 -164
  172. package/dist/chunks/edit-9df1zOWe.js +0 -226
  173. package/dist/chunks/edit-dashboard-visual-BDYAJIbb.js +0 -18605
  174. package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
  175. package/dist/chunks/filter-line-BXT6y303.js +0 -703
  176. package/dist/chunks/filter-reach-copy-BukhZmzm.js +0 -5250
  177. package/dist/chunks/filter-value-text-D3-bf3_b.js +0 -153
  178. package/dist/chunks/index-BVKzKl5d.js +0 -90
  179. package/dist/chunks/index-BW0yozjs.js +0 -2795
  180. package/dist/chunks/index-CV_Kzou0.js +0 -595
  181. package/dist/chunks/layout-grid-Ds0diMeY.js +0 -16
  182. package/dist/chunks/matrix-analytical-definition-CgQgVeeI.js +0 -1162
  183. package/dist/chunks/matrix-member-presentation-DSBIIudt.js +0 -258
  184. package/dist/chunks/matrix-operation-contract--DkNCOzd.js +0 -1412
  185. package/dist/chunks/metric-comparison-zMylnIkc.js +0 -541
  186. package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
  187. package/dist/chunks/paintbrush-CX8pao1j.js +0 -27
  188. package/dist/chunks/palette-CuA0HlzF.js +0 -23
  189. package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
  190. package/dist/chunks/pivot-result-contract-expectations-C8KL7hPx.js +0 -5046
  191. package/dist/chunks/pivot-result-identity-C1AOH1PS.js +0 -77
  192. package/dist/chunks/raw-temporal-value-E416F-0L.js +0 -454
  193. package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
  194. package/dist/chunks/report-preferences-dialog-CbuVNDGi.js +0 -1637
  195. package/dist/chunks/report-runtime-context-E7USjN7E.js +0 -388
  196. package/dist/chunks/resolve-dashboard-input-context-CULCE_hM.js +0 -25172
  197. package/dist/chunks/resolver-DG_tfEpt.js +0 -156
  198. package/dist/chunks/save-BKHlDONy.js +0 -21
  199. package/dist/chunks/saved-dashboard-context-C1WlOx5z.js +0 -632
  200. package/dist/chunks/schema-C9NPiIru.js +0 -2568
  201. package/dist/chunks/selection-filter-compiler-ifT8JCXS.js +0 -131
  202. package/dist/chunks/semaphor-ready-indicator-CBIRcDWs.js +0 -145326
  203. package/dist/chunks/shelf-drop-preview-context-xR69SMA8.js +0 -2466
  204. package/dist/chunks/stored-dashboard-BuM8vnWf.js +0 -4070
  205. package/dist/chunks/style-sheet-parts-Bt9ZNre8.js +0 -8674
  206. package/dist/chunks/table-export-sheet-DVljtHkG.js +0 -949
  207. package/dist/chunks/token-types-D_xKgyVS.js +0 -8
  208. package/dist/chunks/upload-Dll_M7XQ.js +0 -15
  209. package/dist/chunks/validators-ClWHpYql.js +0 -3686
  210. package/dist/chunks/variable-draft-CDGGl53R.js +0 -242
  211. 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-DevrgqQb.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,16 +0,0 @@
1
- const t = [
2
- "docked-right",
3
- "docked-left",
4
- "centered",
5
- "full-page"
6
- ];
7
- function A(s) {
8
- return typeof s == "string" && t.includes(s);
9
- }
10
- const n = "Assistant", S = 40;
11
- export {
12
- t as A,
13
- n as D,
14
- S as a,
15
- A as i
16
- };
@@ -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-CBIRcDWs.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
- };