react-semaphor 0.1.600 → 0.1.602

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 (83) hide show
  1. package/dist/analytics-protocol/index.js +9 -9
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/brand-studio/index.js +7 -7
  4. package/dist/briefings/index.js +48 -45
  5. package/dist/chunks/{assistant-chat-BULOkG9j.js → assistant-chat-BWF3GYip.js} +12 -12
  6. package/dist/chunks/{bookmark-impact-kdvXke8n.js → bookmark-impact-BF3iRx5a.js} +3 -3
  7. package/dist/chunks/{bookmark-state-h1OLXVjE.js → bookmark-state-CBSTdW6q.js} +4 -4
  8. package/dist/chunks/{card-filter-builder-CSCdSQQy.js → card-filter-builder-B8XHwMY6.js} +394 -394
  9. package/dist/chunks/comparison-window-caption-W83qB4V5.js +741 -0
  10. package/dist/chunks/{dashboard-y9ON19ge.js → dashboard-DG5EIYYB.js} +1 -1
  11. package/dist/chunks/{dashboard-briefing-launcher-9YwUclHA.js → dashboard-briefing-launcher-CBSrhyWZ.js} +727 -718
  12. package/dist/chunks/{dashboard-controls-O6PNXMCp.js → dashboard-controls-D6ECO4N1.js} +15 -15
  13. package/dist/chunks/{dashboard-json-Bxf91TYq.js → dashboard-json-DrJftBSL.js} +4 -4
  14. package/dist/chunks/{dates-DPTbpNxK.js → dates-Bz-qM5px.js} +10 -10
  15. package/dist/chunks/{edit-dashboard-visual-CKwaW8H_.js → edit-dashboard-visual-BDYAJIbb.js} +1569 -1548
  16. package/dist/chunks/filter-line-BXT6y303.js +703 -0
  17. package/dist/chunks/{filter-reach-copy-ClzNcNhP.js → filter-reach-copy-BukhZmzm.js} +1688 -1806
  18. package/dist/chunks/{filter-value-text-CXyuLW9Q.js → filter-value-text-D3-bf3_b.js} +6 -6
  19. package/dist/chunks/{index-CRo5--Y6.js → index-BW0yozjs.js} +386 -360
  20. package/dist/chunks/{layout-grid-DSrBSfPM.js → layout-grid-Ds0diMeY.js} +1 -1
  21. package/dist/chunks/{matrix-analytical-definition-i9PQY066.js → matrix-analytical-definition-CgQgVeeI.js} +35 -35
  22. package/dist/chunks/{matrix-member-presentation-B_2beBc0.js → matrix-member-presentation-DSBIIudt.js} +1 -1
  23. package/dist/chunks/{matrix-operation-contract-DdK0J_KU.js → matrix-operation-contract--DkNCOzd.js} +517 -514
  24. package/dist/chunks/{metric-comparison-Bhz0V841.js → metric-comparison-zMylnIkc.js} +3 -3
  25. package/dist/chunks/{paintbrush-1UiU-uTz.js → paintbrush-CX8pao1j.js} +1 -1
  26. package/dist/chunks/{palette-DFIFf_-m.js → palette-CuA0HlzF.js} +1 -1
  27. package/dist/chunks/{pivot-result-contract-expectations-Dk7WFR_u.js → pivot-result-contract-expectations-C8KL7hPx.js} +14 -14
  28. package/dist/chunks/{pivot-result-identity-CzzrJpEm.js → pivot-result-identity-C1AOH1PS.js} +1 -1
  29. package/dist/chunks/{raw-temporal-value-BLvdaMng.js → raw-temporal-value-E416F-0L.js} +16 -16
  30. package/dist/chunks/{report-preferences-dialog-DiDsYpng.js → report-preferences-dialog-CbuVNDGi.js} +13 -13
  31. package/dist/chunks/{report-runtime-context-CEGluufW.js → report-runtime-context-E7USjN7E.js} +1 -1
  32. package/dist/chunks/{resolve-dashboard-input-context-BAv33KGg.js → resolve-dashboard-input-context-CULCE_hM.js} +8419 -7054
  33. package/dist/chunks/{save-CWQ02kHo.js → save-BKHlDONy.js} +1 -1
  34. package/dist/chunks/{saved-dashboard-context-CvzYqADe.js → saved-dashboard-context-C1WlOx5z.js} +24 -24
  35. package/dist/chunks/{selection-filter-compiler-SwrBvyyJ.js → selection-filter-compiler-ifT8JCXS.js} +1 -1
  36. package/dist/chunks/{semaphor-ready-indicator-1PRI9Yh2.js → semaphor-ready-indicator-CBIRcDWs.js} +33810 -32067
  37. package/dist/chunks/{shelf-drop-preview-context-BLk5Nc6K.js → shelf-drop-preview-context-xR69SMA8.js} +53 -53
  38. package/dist/chunks/{stored-dashboard-xhYYKBsO.js → stored-dashboard-BuM8vnWf.js} +679 -657
  39. package/dist/chunks/{style-sheet-parts-BX7d7-2-.js → style-sheet-parts-Bt9ZNre8.js} +2 -2
  40. package/dist/chunks/{table-export-sheet-BWSVTclx.js → table-export-sheet-DVljtHkG.js} +1 -1
  41. package/dist/chunks/{token-types-CnlEiAdS.js → token-types-D_xKgyVS.js} +1 -1
  42. package/dist/chunks/{upload-DsqUSS8l.js → upload-Dll_M7XQ.js} +1 -1
  43. package/dist/chunks/{validators-D2Hm57lJ.js → validators-ClWHpYql.js} +80 -80
  44. package/dist/chunks/{variable-draft-DcKj8T1b.js → variable-draft-CDGGl53R.js} +27 -28
  45. package/dist/dashboard/index.js +2 -2
  46. package/dist/dashboard-authoring/index.js +3086 -2573
  47. package/dist/format-utils/index.js +238 -237
  48. package/dist/index.js +71 -73
  49. package/dist/report-runtime-context/index.js +1 -1
  50. package/dist/style.css +1 -1
  51. package/dist/surfboard/index.js +2 -2
  52. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  53. package/dist/types/briefings/attachments.d.ts +45 -4
  54. package/dist/types/briefings/index.d.ts +1 -1
  55. package/dist/types/components/dashboard/dashboard-web-component.d.ts +7 -0
  56. package/dist/types/index.js +5 -5
  57. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +1 -1
  58. package/dist/types/lib/export-utils.d.ts +72 -0
  59. package/dist/types/lib/formatters/dashboard-temporal-presentation.d.ts +10 -0
  60. package/dist/types/lib/query-context/assemble-card-query.d.ts +6 -1
  61. package/dist/types/lib/stores/dashboard-store.d.ts +30 -0
  62. package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +15 -0
  63. package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +52 -0
  64. package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +129 -0
  65. package/dist/types/shared/dashboard-authoring/calculations/resolve-dashboard-field-copies.d.ts +46 -0
  66. package/dist/types/shared/dashboard-authoring/calculations/tokens.d.ts +36 -0
  67. package/dist/types/shared/dashboard-authoring/card-data-file.d.ts +31 -0
  68. package/dist/types/shared/dashboard-authoring/changes/calculation-change.d.ts +399 -0
  69. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +144 -2
  70. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +21 -2
  71. package/dist/types/shared/dashboard-authoring/changes/domain-change.d.ts +143 -266
  72. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +2 -0
  73. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +46 -0
  74. package/dist/types/shared/dashboard-authoring/index.d.ts +10 -1
  75. package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +133 -0
  76. package/dist/types/shared/dashboard-authoring/operations/card-operations.d.ts +71 -0
  77. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +18 -5
  78. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +21 -0
  79. package/dist/types/shared/usage-events/details.d.ts +2 -2
  80. package/dist/types/shared/usage-events/envelope.d.ts +2 -2
  81. package/package.json +1 -1
  82. package/dist/chunks/comparison-window-caption-DJDwP9XO.js +0 -1309
  83. package/dist/chunks/filter-line-Dkg3yuOX.js +0 -134
@@ -0,0 +1,399 @@
1
+ import { z } from 'zod';
2
+ declare const calculationInputSchema: z.ZodUnion<[z.ZodObject<{
3
+ dataset: z.ZodString;
4
+ field: z.ZodString;
5
+ aggregate: z.ZodOptional<z.ZodEnum<["SUM", "COUNT", "AVG", "MIN", "MAX", "MEDIAN", "DISTINCT"]>>;
6
+ }, "strict", z.ZodTypeAny, {
7
+ field: string;
8
+ dataset: string;
9
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
10
+ }, {
11
+ field: string;
12
+ dataset: string;
13
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
14
+ }>, z.ZodObject<{
15
+ metric: z.ZodString;
16
+ dataset: z.ZodOptional<z.ZodString>;
17
+ }, "strict", z.ZodTypeAny, {
18
+ metric: string;
19
+ dataset?: string | undefined;
20
+ }, {
21
+ metric: string;
22
+ dataset?: string | undefined;
23
+ }>]>;
24
+ /**
25
+ * A new calculation, by intent: the domain decides whether it is a fact, a
26
+ * dimension or a metric from its formula (SE-D2). One dataset's formula names
27
+ * the dataset; one across datasets names its `inputs` as {token}s.
28
+ */
29
+ export declare const calculationAddSchema: z.ZodObject<{
30
+ op: z.ZodLiteral<"calculation.add">;
31
+ domainId: z.ZodOptional<z.ZodString>;
32
+ dataset: z.ZodOptional<z.ZodString>;
33
+ name: z.ZodString;
34
+ label: z.ZodOptional<z.ZodString>;
35
+ description: z.ZodOptional<z.ZodString>;
36
+ expression: z.ZodString;
37
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
38
+ dataset: z.ZodString;
39
+ field: z.ZodString;
40
+ aggregate: z.ZodOptional<z.ZodEnum<["SUM", "COUNT", "AVG", "MIN", "MAX", "MEDIAN", "DISTINCT"]>>;
41
+ }, "strict", z.ZodTypeAny, {
42
+ field: string;
43
+ dataset: string;
44
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
45
+ }, {
46
+ field: string;
47
+ dataset: string;
48
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
49
+ }>, z.ZodObject<{
50
+ metric: z.ZodString;
51
+ dataset: z.ZodOptional<z.ZodString>;
52
+ }, "strict", z.ZodTypeAny, {
53
+ metric: string;
54
+ dataset?: string | undefined;
55
+ }, {
56
+ metric: string;
57
+ dataset?: string | undefined;
58
+ }>]>>>;
59
+ use: z.ZodOptional<z.ZodEnum<["aggregate", "group_or_filter"]>>;
60
+ dataType: z.ZodOptional<z.ZodEnum<["string", "number", "boolean", "date", "datetime"]>>;
61
+ }, "strict", z.ZodTypeAny, {
62
+ name: string;
63
+ expression: string;
64
+ op: "calculation.add";
65
+ domainId?: string | undefined;
66
+ label?: string | undefined;
67
+ dataType?: "string" | "number" | "boolean" | "date" | "datetime" | undefined;
68
+ description?: string | undefined;
69
+ inputs?: Record<string, {
70
+ field: string;
71
+ dataset: string;
72
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
73
+ } | {
74
+ metric: string;
75
+ dataset?: string | undefined;
76
+ }> | undefined;
77
+ dataset?: string | undefined;
78
+ use?: "aggregate" | "group_or_filter" | undefined;
79
+ }, {
80
+ name: string;
81
+ expression: string;
82
+ op: "calculation.add";
83
+ domainId?: string | undefined;
84
+ label?: string | undefined;
85
+ dataType?: "string" | "number" | "boolean" | "date" | "datetime" | undefined;
86
+ description?: string | undefined;
87
+ inputs?: Record<string, {
88
+ field: string;
89
+ dataset: string;
90
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
91
+ } | {
92
+ metric: string;
93
+ dataset?: string | undefined;
94
+ }> | undefined;
95
+ dataset?: string | undefined;
96
+ use?: "aggregate" | "group_or_filter" | undefined;
97
+ }>;
98
+ /** A calculation changed: its label, description or formula. Its name identifies it. */
99
+ export declare const calculationUpdateSchema: z.ZodObject<{
100
+ op: z.ZodLiteral<"calculation.update">;
101
+ name: z.ZodString;
102
+ domainId: z.ZodOptional<z.ZodString>;
103
+ dataset: z.ZodOptional<z.ZodString>;
104
+ label: z.ZodOptional<z.ZodString>;
105
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
106
+ expression: z.ZodOptional<z.ZodString>;
107
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
108
+ dataset: z.ZodString;
109
+ field: z.ZodString;
110
+ aggregate: z.ZodOptional<z.ZodEnum<["SUM", "COUNT", "AVG", "MIN", "MAX", "MEDIAN", "DISTINCT"]>>;
111
+ }, "strict", z.ZodTypeAny, {
112
+ field: string;
113
+ dataset: string;
114
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
115
+ }, {
116
+ field: string;
117
+ dataset: string;
118
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
119
+ }>, z.ZodObject<{
120
+ metric: z.ZodString;
121
+ dataset: z.ZodOptional<z.ZodString>;
122
+ }, "strict", z.ZodTypeAny, {
123
+ metric: string;
124
+ dataset?: string | undefined;
125
+ }, {
126
+ metric: string;
127
+ dataset?: string | undefined;
128
+ }>]>>>;
129
+ }, "strict", z.ZodTypeAny, {
130
+ name: string;
131
+ op: "calculation.update";
132
+ domainId?: string | undefined;
133
+ label?: string | undefined;
134
+ description?: string | null | undefined;
135
+ expression?: string | undefined;
136
+ inputs?: Record<string, {
137
+ field: string;
138
+ dataset: string;
139
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
140
+ } | {
141
+ metric: string;
142
+ dataset?: string | undefined;
143
+ }> | undefined;
144
+ dataset?: string | undefined;
145
+ }, {
146
+ name: string;
147
+ op: "calculation.update";
148
+ domainId?: string | undefined;
149
+ label?: string | undefined;
150
+ description?: string | null | undefined;
151
+ expression?: string | undefined;
152
+ inputs?: Record<string, {
153
+ field: string;
154
+ dataset: string;
155
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
156
+ } | {
157
+ metric: string;
158
+ dataset?: string | undefined;
159
+ }> | undefined;
160
+ dataset?: string | undefined;
161
+ }>;
162
+ /** A dashboard field removed; refused while a card or filter uses it. */
163
+ export declare const calculationRemoveSchema: z.ZodObject<{
164
+ op: z.ZodLiteral<"calculation.remove">;
165
+ name: z.ZodString;
166
+ dataset: z.ZodOptional<z.ZodString>;
167
+ }, "strict", z.ZodTypeAny, {
168
+ name: string;
169
+ op: "calculation.remove";
170
+ dataset?: string | undefined;
171
+ }, {
172
+ name: string;
173
+ op: "calculation.remove";
174
+ dataset?: string | undefined;
175
+ }>;
176
+ export declare const calculationChangeSchemas: readonly [z.ZodObject<{
177
+ op: z.ZodLiteral<"calculation.add">;
178
+ domainId: z.ZodOptional<z.ZodString>;
179
+ dataset: z.ZodOptional<z.ZodString>;
180
+ name: z.ZodString;
181
+ label: z.ZodOptional<z.ZodString>;
182
+ description: z.ZodOptional<z.ZodString>;
183
+ expression: z.ZodString;
184
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
185
+ dataset: z.ZodString;
186
+ field: z.ZodString;
187
+ aggregate: z.ZodOptional<z.ZodEnum<["SUM", "COUNT", "AVG", "MIN", "MAX", "MEDIAN", "DISTINCT"]>>;
188
+ }, "strict", z.ZodTypeAny, {
189
+ field: string;
190
+ dataset: string;
191
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
192
+ }, {
193
+ field: string;
194
+ dataset: string;
195
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
196
+ }>, z.ZodObject<{
197
+ metric: z.ZodString;
198
+ dataset: z.ZodOptional<z.ZodString>;
199
+ }, "strict", z.ZodTypeAny, {
200
+ metric: string;
201
+ dataset?: string | undefined;
202
+ }, {
203
+ metric: string;
204
+ dataset?: string | undefined;
205
+ }>]>>>;
206
+ use: z.ZodOptional<z.ZodEnum<["aggregate", "group_or_filter"]>>;
207
+ dataType: z.ZodOptional<z.ZodEnum<["string", "number", "boolean", "date", "datetime"]>>;
208
+ }, "strict", z.ZodTypeAny, {
209
+ name: string;
210
+ expression: string;
211
+ op: "calculation.add";
212
+ domainId?: string | undefined;
213
+ label?: string | undefined;
214
+ dataType?: "string" | "number" | "boolean" | "date" | "datetime" | undefined;
215
+ description?: string | undefined;
216
+ inputs?: Record<string, {
217
+ field: string;
218
+ dataset: string;
219
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
220
+ } | {
221
+ metric: string;
222
+ dataset?: string | undefined;
223
+ }> | undefined;
224
+ dataset?: string | undefined;
225
+ use?: "aggregate" | "group_or_filter" | undefined;
226
+ }, {
227
+ name: string;
228
+ expression: string;
229
+ op: "calculation.add";
230
+ domainId?: string | undefined;
231
+ label?: string | undefined;
232
+ dataType?: "string" | "number" | "boolean" | "date" | "datetime" | undefined;
233
+ description?: string | undefined;
234
+ inputs?: Record<string, {
235
+ field: string;
236
+ dataset: string;
237
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
238
+ } | {
239
+ metric: string;
240
+ dataset?: string | undefined;
241
+ }> | undefined;
242
+ dataset?: string | undefined;
243
+ use?: "aggregate" | "group_or_filter" | undefined;
244
+ }>, z.ZodObject<{
245
+ op: z.ZodLiteral<"calculation.update">;
246
+ name: z.ZodString;
247
+ domainId: z.ZodOptional<z.ZodString>;
248
+ dataset: z.ZodOptional<z.ZodString>;
249
+ label: z.ZodOptional<z.ZodString>;
250
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
251
+ expression: z.ZodOptional<z.ZodString>;
252
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
253
+ dataset: z.ZodString;
254
+ field: z.ZodString;
255
+ aggregate: z.ZodOptional<z.ZodEnum<["SUM", "COUNT", "AVG", "MIN", "MAX", "MEDIAN", "DISTINCT"]>>;
256
+ }, "strict", z.ZodTypeAny, {
257
+ field: string;
258
+ dataset: string;
259
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
260
+ }, {
261
+ field: string;
262
+ dataset: string;
263
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
264
+ }>, z.ZodObject<{
265
+ metric: z.ZodString;
266
+ dataset: z.ZodOptional<z.ZodString>;
267
+ }, "strict", z.ZodTypeAny, {
268
+ metric: string;
269
+ dataset?: string | undefined;
270
+ }, {
271
+ metric: string;
272
+ dataset?: string | undefined;
273
+ }>]>>>;
274
+ }, "strict", z.ZodTypeAny, {
275
+ name: string;
276
+ op: "calculation.update";
277
+ domainId?: string | undefined;
278
+ label?: string | undefined;
279
+ description?: string | null | undefined;
280
+ expression?: string | undefined;
281
+ inputs?: Record<string, {
282
+ field: string;
283
+ dataset: string;
284
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
285
+ } | {
286
+ metric: string;
287
+ dataset?: string | undefined;
288
+ }> | undefined;
289
+ dataset?: string | undefined;
290
+ }, {
291
+ name: string;
292
+ op: "calculation.update";
293
+ domainId?: string | undefined;
294
+ label?: string | undefined;
295
+ description?: string | null | undefined;
296
+ expression?: string | undefined;
297
+ inputs?: Record<string, {
298
+ field: string;
299
+ dataset: string;
300
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
301
+ } | {
302
+ metric: string;
303
+ dataset?: string | undefined;
304
+ }> | undefined;
305
+ dataset?: string | undefined;
306
+ }>, z.ZodObject<{
307
+ op: z.ZodLiteral<"calculation.remove">;
308
+ name: z.ZodString;
309
+ dataset: z.ZodOptional<z.ZodString>;
310
+ }, "strict", z.ZodTypeAny, {
311
+ name: string;
312
+ op: "calculation.remove";
313
+ dataset?: string | undefined;
314
+ }, {
315
+ name: string;
316
+ op: "calculation.remove";
317
+ dataset?: string | undefined;
318
+ }>];
319
+ export declare const registeredCalculationChangeSchemas: readonly [z.ZodObject<{
320
+ op: z.ZodLiteral<"calculation.add">;
321
+ domainId: z.ZodOptional<z.ZodString>;
322
+ dataset: z.ZodOptional<z.ZodString>;
323
+ name: z.ZodString;
324
+ label: z.ZodOptional<z.ZodString>;
325
+ description: z.ZodOptional<z.ZodString>;
326
+ expression: z.ZodString;
327
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
328
+ use: z.ZodOptional<z.ZodEnum<["aggregate", "group_or_filter"]>>;
329
+ dataType: z.ZodOptional<z.ZodEnum<["string", "number", "boolean", "date", "datetime"]>>;
330
+ }, "strict", z.ZodTypeAny, {
331
+ name: string;
332
+ expression: string;
333
+ op: "calculation.add";
334
+ domainId?: string | undefined;
335
+ label?: string | undefined;
336
+ dataType?: "string" | "number" | "boolean" | "date" | "datetime" | undefined;
337
+ description?: string | undefined;
338
+ inputs?: Record<string, Record<string, unknown>> | undefined;
339
+ dataset?: string | undefined;
340
+ use?: "aggregate" | "group_or_filter" | undefined;
341
+ }, {
342
+ name: string;
343
+ expression: string;
344
+ op: "calculation.add";
345
+ domainId?: string | undefined;
346
+ label?: string | undefined;
347
+ dataType?: "string" | "number" | "boolean" | "date" | "datetime" | undefined;
348
+ description?: string | undefined;
349
+ inputs?: Record<string, Record<string, unknown>> | undefined;
350
+ dataset?: string | undefined;
351
+ use?: "aggregate" | "group_or_filter" | undefined;
352
+ }>, z.ZodObject<{
353
+ op: z.ZodLiteral<"calculation.update">;
354
+ name: z.ZodString;
355
+ domainId: z.ZodOptional<z.ZodString>;
356
+ dataset: z.ZodOptional<z.ZodString>;
357
+ label: z.ZodOptional<z.ZodString>;
358
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
359
+ expression: z.ZodOptional<z.ZodString>;
360
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
361
+ }, "strict", z.ZodTypeAny, {
362
+ name: string;
363
+ op: "calculation.update";
364
+ domainId?: string | undefined;
365
+ label?: string | undefined;
366
+ description?: string | null | undefined;
367
+ expression?: string | undefined;
368
+ inputs?: Record<string, Record<string, unknown>> | undefined;
369
+ dataset?: string | undefined;
370
+ }, {
371
+ name: string;
372
+ op: "calculation.update";
373
+ domainId?: string | undefined;
374
+ label?: string | undefined;
375
+ description?: string | null | undefined;
376
+ expression?: string | undefined;
377
+ inputs?: Record<string, Record<string, unknown>> | undefined;
378
+ dataset?: string | undefined;
379
+ }>, z.ZodObject<{
380
+ op: z.ZodLiteral<"calculation.remove">;
381
+ name: z.ZodString;
382
+ dataset: z.ZodOptional<z.ZodString>;
383
+ }, "strict", z.ZodTypeAny, {
384
+ name: string;
385
+ op: "calculation.remove";
386
+ dataset?: string | undefined;
387
+ }, {
388
+ name: string;
389
+ op: "calculation.remove";
390
+ dataset?: string | undefined;
391
+ }>];
392
+ export type CalculationInput = z.infer<typeof calculationInputSchema>;
393
+ export type CalculationAddChange = z.infer<typeof calculationAddSchema>;
394
+ export type CalculationUpdateChange = z.infer<typeof calculationUpdateSchema>;
395
+ export type CalculationRemoveChange = z.infer<typeof calculationRemoveSchema>;
396
+ export type CalculationChange = CalculationAddChange | CalculationUpdateChange | CalculationRemoveChange;
397
+ /** The calculation ops, in both op lists for routing (MC-D3). */
398
+ export declare const CALCULATION_CHANGE_OPS: readonly CalculationChange['op'][];
399
+ export {};
@@ -5938,13 +5938,13 @@ export declare const dashboardChangeSchema: z.ZodDiscriminatedUnion<"op", [z.Zod
5938
5938
  emptyText: z.ZodTypeAny;
5939
5939
  }, "strict", z.ZodTypeAny, {
5940
5940
  name: string;
5941
+ op: "variable.add";
5941
5942
  query: VariableQueryChange;
5942
5943
  get: "aggregate" | "first" | "list" | "only" | {
5943
5944
  kind: "aggregate" | "first" | "list" | "only";
5944
5945
  limit?: number | undefined;
5945
5946
  separator?: string | undefined;
5946
5947
  };
5947
- op: "variable.add";
5948
5948
  presentation?: {
5949
5949
  percent?: boolean | undefined;
5950
5950
  decimals?: number | undefined;
@@ -5966,13 +5966,13 @@ export declare const dashboardChangeSchema: z.ZodDiscriminatedUnion<"op", [z.Zod
5966
5966
  emptyText?: any;
5967
5967
  }, {
5968
5968
  name: string;
5969
+ op: "variable.add";
5969
5970
  query: VariableQueryChange;
5970
5971
  get: "aggregate" | "first" | "list" | "only" | {
5971
5972
  kind: "aggregate" | "first" | "list" | "only";
5972
5973
  limit?: number | undefined;
5973
5974
  separator?: string | undefined;
5974
5975
  };
5975
- op: "variable.add";
5976
5976
  presentation?: {
5977
5977
  percent?: boolean | undefined;
5978
5978
  decimals?: number | undefined;
@@ -6106,6 +6106,148 @@ export declare const dashboardChangeSchema: z.ZodDiscriminatedUnion<"op", [z.Zod
6106
6106
  size?: number | undefined;
6107
6107
  align?: "left" | "right" | "center" | undefined;
6108
6108
  } | undefined;
6109
+ }>, z.ZodObject<{
6110
+ op: z.ZodLiteral<"calculation.add">;
6111
+ domainId: z.ZodOptional<z.ZodString>;
6112
+ dataset: z.ZodOptional<z.ZodString>;
6113
+ name: z.ZodString;
6114
+ label: z.ZodOptional<z.ZodString>;
6115
+ description: z.ZodOptional<z.ZodString>;
6116
+ expression: z.ZodString;
6117
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
6118
+ dataset: z.ZodString;
6119
+ field: z.ZodString;
6120
+ aggregate: z.ZodOptional<z.ZodEnum<["SUM", "COUNT", "AVG", "MIN", "MAX", "MEDIAN", "DISTINCT"]>>;
6121
+ }, "strict", z.ZodTypeAny, {
6122
+ field: string;
6123
+ dataset: string;
6124
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
6125
+ }, {
6126
+ field: string;
6127
+ dataset: string;
6128
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
6129
+ }>, z.ZodObject<{
6130
+ metric: z.ZodString;
6131
+ dataset: z.ZodOptional<z.ZodString>;
6132
+ }, "strict", z.ZodTypeAny, {
6133
+ metric: string;
6134
+ dataset?: string | undefined;
6135
+ }, {
6136
+ metric: string;
6137
+ dataset?: string | undefined;
6138
+ }>]>>>;
6139
+ use: z.ZodOptional<z.ZodEnum<["aggregate", "group_or_filter"]>>;
6140
+ dataType: z.ZodOptional<z.ZodEnum<["string", "number", "boolean", "date", "datetime"]>>;
6141
+ }, "strict", z.ZodTypeAny, {
6142
+ name: string;
6143
+ expression: string;
6144
+ op: "calculation.add";
6145
+ domainId?: string | undefined;
6146
+ label?: string | undefined;
6147
+ dataType?: "string" | "number" | "boolean" | "date" | "datetime" | undefined;
6148
+ description?: string | undefined;
6149
+ inputs?: Record<string, {
6150
+ field: string;
6151
+ dataset: string;
6152
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
6153
+ } | {
6154
+ metric: string;
6155
+ dataset?: string | undefined;
6156
+ }> | undefined;
6157
+ dataset?: string | undefined;
6158
+ use?: "aggregate" | "group_or_filter" | undefined;
6159
+ }, {
6160
+ name: string;
6161
+ expression: string;
6162
+ op: "calculation.add";
6163
+ domainId?: string | undefined;
6164
+ label?: string | undefined;
6165
+ dataType?: "string" | "number" | "boolean" | "date" | "datetime" | undefined;
6166
+ description?: string | undefined;
6167
+ inputs?: Record<string, {
6168
+ field: string;
6169
+ dataset: string;
6170
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
6171
+ } | {
6172
+ metric: string;
6173
+ dataset?: string | undefined;
6174
+ }> | undefined;
6175
+ dataset?: string | undefined;
6176
+ use?: "aggregate" | "group_or_filter" | undefined;
6177
+ }>, z.ZodObject<{
6178
+ op: z.ZodLiteral<"calculation.update">;
6179
+ name: z.ZodString;
6180
+ domainId: z.ZodOptional<z.ZodString>;
6181
+ dataset: z.ZodOptional<z.ZodString>;
6182
+ label: z.ZodOptional<z.ZodString>;
6183
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6184
+ expression: z.ZodOptional<z.ZodString>;
6185
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
6186
+ dataset: z.ZodString;
6187
+ field: z.ZodString;
6188
+ aggregate: z.ZodOptional<z.ZodEnum<["SUM", "COUNT", "AVG", "MIN", "MAX", "MEDIAN", "DISTINCT"]>>;
6189
+ }, "strict", z.ZodTypeAny, {
6190
+ field: string;
6191
+ dataset: string;
6192
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
6193
+ }, {
6194
+ field: string;
6195
+ dataset: string;
6196
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
6197
+ }>, z.ZodObject<{
6198
+ metric: z.ZodString;
6199
+ dataset: z.ZodOptional<z.ZodString>;
6200
+ }, "strict", z.ZodTypeAny, {
6201
+ metric: string;
6202
+ dataset?: string | undefined;
6203
+ }, {
6204
+ metric: string;
6205
+ dataset?: string | undefined;
6206
+ }>]>>>;
6207
+ }, "strict", z.ZodTypeAny, {
6208
+ name: string;
6209
+ op: "calculation.update";
6210
+ domainId?: string | undefined;
6211
+ label?: string | undefined;
6212
+ description?: string | null | undefined;
6213
+ expression?: string | undefined;
6214
+ inputs?: Record<string, {
6215
+ field: string;
6216
+ dataset: string;
6217
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
6218
+ } | {
6219
+ metric: string;
6220
+ dataset?: string | undefined;
6221
+ }> | undefined;
6222
+ dataset?: string | undefined;
6223
+ }, {
6224
+ name: string;
6225
+ op: "calculation.update";
6226
+ domainId?: string | undefined;
6227
+ label?: string | undefined;
6228
+ description?: string | null | undefined;
6229
+ expression?: string | undefined;
6230
+ inputs?: Record<string, {
6231
+ field: string;
6232
+ dataset: string;
6233
+ aggregate?: "SUM" | "COUNT" | "AVG" | "MIN" | "MAX" | "MEDIAN" | "DISTINCT" | undefined;
6234
+ } | {
6235
+ metric: string;
6236
+ dataset?: string | undefined;
6237
+ }> | undefined;
6238
+ dataset?: string | undefined;
6239
+ }>, z.ZodObject<{
6240
+ op: z.ZodLiteral<"calculation.remove">;
6241
+ name: z.ZodString;
6242
+ dataset: z.ZodOptional<z.ZodString>;
6243
+ }, "strict", z.ZodTypeAny, {
6244
+ name: string;
6245
+ op: "calculation.remove";
6246
+ dataset?: string | undefined;
6247
+ }, {
6248
+ name: string;
6249
+ op: "calculation.remove";
6250
+ dataset?: string | undefined;
6109
6251
  }>]>;
6110
6252
  /** The ops of changes to a dashboard: the one list callers route by (semaphor-app's MCP change tools). */
6111
6253
  export declare const DASHBOARD_CHANGE_OPS: readonly DashboardChange['op'][];
@@ -46,7 +46,7 @@ export type ChangeProblemCode = 'invalid_change' | 'invalid_change_target' | 'co
46
46
  /** Text words the subset can't hold, or a token that isn't one of the card's variables (building a report SPEC §2.4, S-9). */
47
47
  | 'text_invalid'
48
48
  /** A `dashboard.style` change the style owner refuses, with its own code and fix (dashboard style SPEC §4.3). */
49
- | StyleRefusal['code'] | DataVariableProblemCode;
49
+ | StyleRefusal['code'] | DataVariableProblemCode | CalculatedFieldProblemCode;
50
50
  export type ChangeWarningCode =
51
51
  /** In-scope cards the filter doesn't reach. */
52
52
  'filter_not_reaching_cards'
@@ -79,7 +79,26 @@ export type ChangeWarningCode =
79
79
  /** A table calculation ordered along a grouping that isn't a date. */
80
80
  | 'transform_order_not_date'
81
81
  /** A text card in a KPI's spot shows as the KPI's info, as in the editor, not as a tab (building a report SPEC §5.1). */
82
- | 'tabs_show_as_kpi_info';
82
+ | 'tabs_show_as_kpi_info'
83
+ /** The same condition on every card a filter on its field reaches on a sheet: one dashboard filter's default (shared conditions SC-D10, SC-D16). */
84
+ | 'repeated_card_condition'
85
+ /** A card condition equal to the default of a dashboard filter that reaches the card: it won't follow the filter (SC-D11). */
86
+ | 'card_condition_repeats_filter_default';
87
+ /**
88
+ * Calculated fields (calculated fields one core, plan "Refusals"): a
89
+ * dashboard field's add, change or removal, and its formula.
90
+ */
91
+ export type CalculatedFieldProblemCode =
92
+ /** The name is a dashboard field already, or a field or calculation of the dataset in the domain. */
93
+ 'calculated_field_name_taken'
94
+ /** The compiler or the connection refuses the formula; the domain's own code. */
95
+ | 'invalid_calculation'
96
+ /** `calculation.update` or `.remove` names no dashboard field. */
97
+ | 'calculated_field_not_found'
98
+ /** `calculation.remove` while a copy remains; `details.usedBy` names the cards and filters. */
99
+ | 'calculated_field_in_use'
100
+ /** A Matrix card names a dashboard field. */
101
+ | 'calculated_field_not_for_matrix';
83
102
  /**
84
103
  * Data variables (spec 4.3): each refusal names the fix in its message; the
85
104
  * one writer's other issues (get, columns, measures) come back as `invalid_change`.