react-semaphor 0.1.334 → 0.1.336

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 (59) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +100 -242
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +3 -3
  5. package/dist/briefings/index.cjs +1 -1
  6. package/dist/briefings/index.js +435 -391
  7. package/dist/chunks/{braces-DlW7C5BH.js → braces-BLa_lORs.js} +1 -1
  8. package/dist/chunks/{braces-DYx37F5Z.js → braces-Q86XHDaD.js} +1 -1
  9. package/dist/chunks/{calendar-preferences-dialog-CB5MA9gF.js → calendar-preferences-dialog-Bm7ji3k9.js} +1 -1
  10. package/dist/chunks/{calendar-preferences-dialog-BLz4PrDX.js → calendar-preferences-dialog-Cocogo9H.js} +3 -3
  11. package/dist/chunks/catalog-field-grounding-DmT7aGUA.js +191 -0
  12. package/dist/chunks/catalog-field-grounding-VgVzDd25.js +1 -0
  13. package/dist/chunks/{chevrons-up-down-CP6oFMrt.js → chevrons-up-down-BBTZ5pAY.js} +1 -1
  14. package/dist/chunks/{chevrons-up-down-B_66pVv5.js → chevrons-up-down-CYuWasy_.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-Bwz4mKOI.js → dashboard-briefing-launcher-BtqtLx1-.js} +1 -1
  16. package/dist/chunks/{dashboard-briefing-launcher-B7AxiecS.js → dashboard-briefing-launcher-DF4CoaRn.js} +4 -4
  17. package/dist/chunks/{dashboard-controls-DlN7FGW-.js → dashboard-controls-0VMAeMoa.js} +1 -1
  18. package/dist/chunks/{dashboard-controls-CbuKeeeP.js → dashboard-controls-B5U-VUxs.js} +6 -6
  19. package/dist/chunks/{dashboard-json-CeVrYTnR.js → dashboard-json-CqbLOfnr.js} +1 -1
  20. package/dist/chunks/{dashboard-json-gcpeSd5I.js → dashboard-json-Hmc0Ri5z.js} +2 -2
  21. package/dist/chunks/{edit-dashboard-visual-Kn1wtj-Z.js → edit-dashboard-visual-C0EDM0QB.js} +3 -3
  22. package/dist/chunks/{edit-dashboard-visual-BggRcCO2.js → edit-dashboard-visual-D4VVu-QQ.js} +1302 -1302
  23. package/dist/chunks/{index-CP3_hN7P.js → index-DE0vIuYG.js} +4 -4
  24. package/dist/chunks/{index-TA0tBZ1g.js → index-DzyUhzV3.js} +262 -270
  25. package/dist/chunks/{palette-BW7lzLOY.js → palette-B9AbDw0n.js} +1 -1
  26. package/dist/chunks/{palette-BueS2ZEM.js → palette-DalASD28.js} +1 -1
  27. package/dist/chunks/{resource-management-panel-vDrPcmXs.js → resource-management-panel-C4YydU9I.js} +3 -3
  28. package/dist/chunks/{resource-management-panel-DBYcMHVL.js → resource-management-panel-P9iNqBM1.js} +1 -1
  29. package/dist/chunks/{switch-B6fK1sl9.js → switch-BAYfpAEb.js} +1967 -2008
  30. package/dist/chunks/{switch-BT7khJGF.js → switch-CyRoZr5T.js} +35 -35
  31. package/dist/chunks/{use-create-flow-overlay-state-T8Su6dzu.js → use-create-flow-overlay-state-CbhjxI3W.js} +1 -1
  32. package/dist/chunks/{use-create-flow-overlay-state-DPYHfe-S.js → use-create-flow-overlay-state-P1LMwQ89.js} +3 -3
  33. package/dist/chunks/{use-visual-utils-wqosOqyY.js → use-visual-utils-CV6_-y4p.js} +1 -1
  34. package/dist/chunks/{use-visual-utils-Daov8_1p.js → use-visual-utils-lB-3Zk0b.js} +2 -2
  35. package/dist/chunks/validators-BOqiGymD.js +660 -0
  36. package/dist/chunks/validators-BtFXY3S_.js +2 -0
  37. package/dist/dashboard/index.cjs +1 -1
  38. package/dist/dashboard/index.js +1 -1
  39. package/dist/dashboard-authoring/index.cjs +3 -3
  40. package/dist/dashboard-authoring/index.js +476 -453
  41. package/dist/data-app-builder/index.cjs +1 -1
  42. package/dist/data-app-builder/index.js +1 -1
  43. package/dist/data-app-builder-browser-runtime/index.cjs +1 -1
  44. package/dist/data-app-builder-browser-runtime/index.js +4 -9
  45. package/dist/data-app-sdk/index.cjs +1 -1
  46. package/dist/data-app-sdk/index.js +89 -80
  47. package/dist/index.cjs +1 -1
  48. package/dist/index.js +7 -7
  49. package/dist/surfboard/index.cjs +1 -1
  50. package/dist/surfboard/index.js +2 -2
  51. package/dist/types/analytics-protocol.d.ts +183 -5
  52. package/dist/types/briefings.d.ts +12 -0
  53. package/dist/types/dashboard-authoring.d.ts +33 -4
  54. package/dist/types/data-app-builder.d.ts +30 -3
  55. package/dist/types/data-app-sdk.d.ts +32 -5
  56. package/dist/types/main.d.ts +34 -3
  57. package/package.json +1 -1
  58. package/dist/chunks/validators-DDAweCzB.js +0 -371
  59. package/dist/chunks/validators-odlRJblR.js +0 -2
@@ -97,7 +97,8 @@ export declare const SEMAPHOR_ANALYTICS_INTENT_FIXTURES: {
97
97
  readonly connectionId: "conn_sales";
98
98
  readonly label: "Orders";
99
99
  };
100
- metric: string;
100
+ metrics: string[];
101
+ primaryMetric: string;
101
102
  comparison: {
102
103
  kind: "previous_period";
103
104
  };
@@ -189,7 +190,8 @@ export declare const SEMAPHOR_ANALYTICS_INTENT_FIXTURES: {
189
190
  readonly connectionId: "conn_sales";
190
191
  readonly label: "Orders";
191
192
  };
192
- metric: string;
193
+ metrics: string[];
194
+ primaryMetric: string;
193
195
  dateField: {
194
196
  name: string;
195
197
  role: "date";
@@ -201,6 +203,46 @@ export declare const SEMAPHOR_ANALYTICS_INTENT_FIXTURES: {
201
203
  };
202
204
  limit: number;
203
205
  };
206
+ inboundSupplierConcentration: {
207
+ version: 1;
208
+ kind: "metric";
209
+ id: string;
210
+ label: string;
211
+ source: {
212
+ readonly kind: "semantic";
213
+ readonly domainId: "domain_sales";
214
+ readonly datasetName: "orders";
215
+ readonly connectionId: "conn_sales";
216
+ readonly label: "Orders";
217
+ };
218
+ metrics: string[];
219
+ primaryMetric: string;
220
+ dateField: {
221
+ name: string;
222
+ role: "date";
223
+ dataType: "date";
224
+ };
225
+ timeWindow: {
226
+ unit: "month";
227
+ value: number;
228
+ anchor: "latest_available";
229
+ };
230
+ dimensions: {
231
+ name: string;
232
+ role: "dimension";
233
+ dataType: "number";
234
+ }[];
235
+ filters: {
236
+ field: {
237
+ name: string;
238
+ role: "dimension";
239
+ dataType: "string";
240
+ };
241
+ operator: "=";
242
+ value: string;
243
+ }[];
244
+ limit: number;
245
+ };
204
246
  boundedSqlRanking: {
205
247
  version: 1;
206
248
  kind: "sql";
@@ -229,24 +271,89 @@ export declare const SEMAPHOR_ANALYTICS_INTENT_FIXTURES: {
229
271
  };
230
272
  };
231
273
 
274
+ export declare type SemaphorAgentFilterInput = {
275
+ id?: string;
276
+ field: string | SemaphorFieldRef;
277
+ operator?: SemaphorAgentFilterInputOperator;
278
+ operation?: SemaphorAgentFilterInputOperator | string;
279
+ value?: unknown;
280
+ values?: unknown[];
281
+ };
282
+
283
+ export declare type SemaphorAgentFilterInputOperator = SemaphorAnalyticsFilterOperator | 'equals' | 'eq' | 'not_equals' | 'neq' | 'like' | 'not_like' | 'not in' | 'not contains' | 'not between' | 'is_null' | 'is_not_null' | 'is null' | 'is not null';
284
+
232
285
  export declare type SemaphorAnalyticsExecutionResult = {
233
286
  intentId?: string;
234
287
  queryId?: string;
235
288
  status: SemaphorAnalyticsExecutionStatus;
289
+ resultShape?: SemaphorAnalyticsResult['kind'] | 'period_change';
290
+ intent?: SemaphorAnalyticsIntent;
291
+ compiledQuery?: SemaphorCompiledQuery;
292
+ fieldsUsed?: SemaphorFieldRef[];
236
293
  result?: SemaphorAnalyticsResult;
237
294
  validation: SemaphorAnalyticsValidationResult;
295
+ coverage?: {
296
+ answeredObligations: string[];
297
+ missingObligations: string[];
298
+ warnings: SemaphorAnalyticsValidationIssue[];
299
+ };
238
300
  missingFields?: string[];
239
301
  warnings?: string[];
302
+ relationshipDiagnostics?: SemaphorRelationshipDiagnostics;
303
+ metadata?: Record<string, unknown>;
240
304
  };
241
305
 
242
306
  export declare type SemaphorAnalyticsExecutionStatus = 'answered' | 'partial' | 'failed';
243
307
 
244
308
  export declare type SemaphorAnalyticsFieldRole = 'metric' | 'dateField' | 'dimension' | 'input' | 'source' | 'sql';
245
309
 
310
+ export declare type SemaphorAnalyticsFilter = {
311
+ id?: string;
312
+ field: SemaphorFieldRef;
313
+ operator?: SemaphorAnalyticsFilterOperator;
314
+ value?: unknown;
315
+ values?: unknown[];
316
+ };
317
+
318
+ export declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
319
+
246
320
  export declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
247
321
 
248
322
  export declare type SemaphorAnalyticsIntentFixtureName = keyof typeof SEMAPHOR_ANALYTICS_INTENT_FIXTURES;
249
323
 
324
+ export declare type SemaphorAnalyticsObligation = {
325
+ id: string;
326
+ type: SemaphorAnalyticsObligationType;
327
+ subject: string;
328
+ prompt: string;
329
+ metricCandidates?: string[];
330
+ entityCandidates?: string[];
331
+ dateFieldCandidates?: string[];
332
+ dimensionCandidates?: string[];
333
+ displayFieldCandidates?: string[];
334
+ requiredFieldCandidates?: string[];
335
+ limit?: number;
336
+ timeWindowDays?: number;
337
+ timeWindowMonths?: number;
338
+ comparison?: 'same_period_last_year' | 'previous_period';
339
+ required?: boolean;
340
+ };
341
+
342
+ export declare type SemaphorAnalyticsObligationType = 'record_list' | 'count' | 'trend' | 'comparison' | 'driver_analysis' | 'metric_summary' | 'analysis_table' | 'lookup' | 'unknown';
343
+
344
+ export declare type SemaphorAnalyticsRecoveryPlan = {
345
+ version: SemaphorProtocolVersion;
346
+ kind: 'analytics_recovery_plan';
347
+ operationIntent: SemaphorOperationIntent;
348
+ plannedToolCalls: SemaphorRecoveryToolCall[];
349
+ diagnostics: Array<{
350
+ code: string;
351
+ message: string;
352
+ obligationId?: string;
353
+ recommendedNextStep?: string;
354
+ }>;
355
+ };
356
+
250
357
  export declare type SemaphorAnalyticsRepairHint = {
251
358
  code: SemaphorAnalyticsValidationCode | string;
252
359
  message?: string;
@@ -363,7 +470,7 @@ export declare type SemaphorInputBinding = {
363
470
  field?: SemaphorFieldRef;
364
471
  };
365
472
 
366
- export declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | '>' | '>=' | '<' | '<=';
473
+ export declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
367
474
 
368
475
  export declare type SemaphorInputOptionsIntent = {
369
476
  kind: 'inputOptions';
@@ -409,21 +516,32 @@ export declare type SemaphorInputSpec = {
409
516
  scope?: SemaphorInputScope;
410
517
  };
411
518
 
519
+ export declare type SemaphorMetricAnalysis = {
520
+ kind: 'period_change';
521
+ orderBy?: 'absolute_change' | 'positive_change' | 'negative_change';
522
+ direction?: 'increase' | 'decrease' | 'both';
523
+ timeWindow?: SemaphorTimeWindow;
524
+ };
525
+
412
526
  export declare type SemaphorMetricIntent = {
413
527
  kind: 'metric';
414
528
  version?: SemaphorProtocolVersion;
415
529
  id?: string;
416
530
  source: SemaphorSourceRef;
417
- metric: string;
418
- metrics?: string[];
531
+ metrics: string[];
532
+ primaryMetric?: string;
533
+ metricRefs?: SemaphorFieldRef[];
419
534
  label?: string;
420
535
  dateField?: SemaphorFieldRef;
421
536
  timeGrain?: SemaphorTimeGrain;
537
+ timeWindow?: SemaphorTimeWindow;
422
538
  dimensions?: SemaphorFieldRef[];
539
+ filters?: SemaphorAnalyticsFilter[];
423
540
  comparison?: {
424
541
  kind: 'previous_period' | 'previous_year' | 'target';
425
542
  targetValue?: number;
426
543
  };
544
+ analysis?: SemaphorMetricAnalysis;
427
545
  inputs?: SemaphorInputBinding[];
428
546
  limit?: number;
429
547
  };
@@ -439,6 +557,27 @@ export declare type SemaphorMetricResult = SemaphorAnalyticsResultBase & {
439
557
  };
440
558
  };
441
559
 
560
+ export declare type SemaphorOperationIntent = {
561
+ version: SemaphorProtocolVersion;
562
+ kind: 'answer_obligations';
563
+ obligations: SemaphorAnalyticsObligation[];
564
+ source?: SemaphorSourceRef;
565
+ context?: Record<string, unknown>;
566
+ } | {
567
+ version: SemaphorProtocolVersion;
568
+ kind: 'dashboard_change';
569
+ instruction: string;
570
+ targetDashboardId?: string;
571
+ analyticsIntent?: SemaphorAnalyticsIntent;
572
+ context?: Record<string, unknown>;
573
+ } | {
574
+ version: SemaphorProtocolVersion;
575
+ kind: 'data_app_change';
576
+ instruction: string;
577
+ analyticsIntent?: SemaphorAnalyticsIntent;
578
+ context?: Record<string, unknown>;
579
+ };
580
+
442
581
  export declare type SemaphorProtocolIssue = {
443
582
  code: string;
444
583
  message: string;
@@ -477,6 +616,35 @@ export declare type SemaphorRecordsResult = SemaphorAnalyticsResultBase & {
477
616
  records: Array<Record<string, unknown>>;
478
617
  };
479
618
 
619
+ export declare type SemaphorRecoveryToolCall = {
620
+ name: 'semaphor_get_dataset_schema' | 'semaphor_query_spec' | 'semaphor_query_sql' | string;
621
+ arguments: Record<string, unknown>;
622
+ purpose: string;
623
+ obligationId?: string;
624
+ recoveryKind?: 'schema_discovery' | 'query_spec' | 'sql' | 'unsupported';
625
+ };
626
+
627
+ export declare type SemaphorRelationshipDiagnostics = {
628
+ status: SemaphorRelationshipDiagnosticStatus;
629
+ requiredSources?: SemaphorSourceRef[];
630
+ relationshipsUsed?: string[];
631
+ missingSources?: string[];
632
+ warnings?: string[];
633
+ message?: string;
634
+ recommendedNextStep?: string;
635
+ joinPlanSummary?: {
636
+ baseSource?: SemaphorSourceRef;
637
+ joinedSources?: SemaphorSourceRef[];
638
+ joinCount?: number;
639
+ };
640
+ fanoutRisk?: {
641
+ status: 'none' | 'warning' | 'error' | 'unknown';
642
+ message?: string;
643
+ };
644
+ };
645
+
646
+ export declare type SemaphorRelationshipDiagnosticStatus = 'not_required' | 'resolved' | 'missing' | 'ambiguous' | 'fanout_risk' | 'unknown';
647
+
480
648
  export declare type SemaphorSourceCoordinateInput = {
481
649
  databaseName?: string;
482
650
  schemaName?: string;
@@ -544,6 +712,12 @@ export declare type SemaphorSqlResult = SemaphorAnalyticsResultBase & {
544
712
 
545
713
  export declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
546
714
 
715
+ export declare type SemaphorTimeWindow = {
716
+ unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
717
+ value: number;
718
+ anchor?: 'now' | 'latest_available';
719
+ };
720
+
547
721
  export declare type SemaphorValidationResult = {
548
722
  ok: boolean;
549
723
  errors: SemaphorProtocolIssue[];
@@ -566,6 +740,10 @@ export declare type SemaphorViewPresentation = {
566
740
 
567
741
  export declare function validateSemaphorAnalyticsIntent(intent: SemaphorAnalyticsIntent): SemaphorAnalyticsValidationResult;
568
742
 
743
+ export declare function validateSemaphorAnalyticsRecoveryPlan(plan: SemaphorAnalyticsRecoveryPlan): SemaphorAnalyticsValidationResult;
744
+
569
745
  export declare function validateSemaphorDashboardIntent(intent: SemaphorDashboardIntent): SemaphorValidationResult;
570
746
 
747
+ export declare function validateSemaphorOperationIntent(intent: SemaphorOperationIntent): SemaphorAnalyticsValidationResult;
748
+
571
749
  export { }
@@ -21,6 +21,7 @@ export declare const BRIEFING_TEXT_LIMITS: {
21
21
  readonly contentTitle: 500;
22
22
  readonly contentSummary: 20000;
23
23
  readonly contentText: 5000;
24
+ readonly contentSql: 50000;
24
25
  readonly contentItem: 2000;
25
26
  readonly contentCell: 500;
26
27
  readonly attachmentTitle: 500;
@@ -144,6 +145,12 @@ export declare type BriefingContentBlock = {
144
145
  title?: string;
145
146
  tiles: BriefingKpiTile[];
146
147
  evidenceIds?: string[];
148
+ } | {
149
+ type: 'progress';
150
+ label: string;
151
+ value: number;
152
+ detail?: string;
153
+ evidenceIds?: string[];
147
154
  } | BriefingContentTableBlock | {
148
155
  type: 'actions';
149
156
  title?: string;
@@ -154,6 +161,11 @@ export declare type BriefingContentBlock = {
154
161
  title?: string;
155
162
  items: string[];
156
163
  evidenceIds?: string[];
164
+ } | {
165
+ type: 'sql';
166
+ title?: string;
167
+ sql: string;
168
+ evidenceIds?: string[];
157
169
  } | {
158
170
  type: 'evidence_appendix';
159
171
  title?: string;
@@ -550,13 +550,15 @@ export declare type DashboardCardQueryFieldRef = {
550
550
  };
551
551
 
552
552
  export declare type DashboardCardQueryIntent = {
553
- metric?: string;
554
553
  metrics?: string[];
554
+ primaryMetric?: string;
555
+ metricRefs?: DashboardCardQueryFieldRef[];
555
556
  dateField?: string;
556
557
  dateFieldRef?: DashboardCardQueryFieldRef;
557
558
  timeGrain?: 'day' | 'week' | 'month' | 'quarter' | 'year';
558
559
  dimensions?: string[];
559
560
  dimensionRefs?: DashboardCardQueryFieldRef[];
561
+ filters?: SemaphorAnalyticsFilter[];
560
562
  limit?: number;
561
563
  };
562
564
 
@@ -1827,6 +1829,16 @@ declare type SelectedEntities = SelectedEntity[];
1827
1829
 
1828
1830
  declare type SelectedEntity = DatabaseEntityReference | DataModelEntityReference | DatasetEntityReference | FileEntityReference;
1829
1831
 
1832
+ declare type SemaphorAnalyticsFilter = {
1833
+ id?: string;
1834
+ field: SemaphorFieldRef;
1835
+ operator?: SemaphorAnalyticsFilterOperator;
1836
+ value?: unknown;
1837
+ values?: unknown[];
1838
+ };
1839
+
1840
+ declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
1841
+
1830
1842
  declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
1831
1843
 
1832
1844
  declare type SemaphorDashboardIntent = {
@@ -1869,7 +1881,7 @@ declare type SemaphorInputBinding = {
1869
1881
  field?: SemaphorFieldRef;
1870
1882
  };
1871
1883
 
1872
- declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | '>' | '>=' | '<' | '<=';
1884
+ declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
1873
1885
 
1874
1886
  declare type SemaphorInputOptionsIntent = {
1875
1887
  kind: 'inputOptions';
@@ -1906,21 +1918,32 @@ declare type SemaphorInputSpec = {
1906
1918
  scope?: SemaphorInputScope;
1907
1919
  };
1908
1920
 
1921
+ declare type SemaphorMetricAnalysis = {
1922
+ kind: 'period_change';
1923
+ orderBy?: 'absolute_change' | 'positive_change' | 'negative_change';
1924
+ direction?: 'increase' | 'decrease' | 'both';
1925
+ timeWindow?: SemaphorTimeWindow;
1926
+ };
1927
+
1909
1928
  declare type SemaphorMetricIntent = {
1910
1929
  kind: 'metric';
1911
1930
  version?: SemaphorProtocolVersion;
1912
1931
  id?: string;
1913
1932
  source: SemaphorSourceRef;
1914
- metric: string;
1915
- metrics?: string[];
1933
+ metrics: string[];
1934
+ primaryMetric?: string;
1935
+ metricRefs?: SemaphorFieldRef[];
1916
1936
  label?: string;
1917
1937
  dateField?: SemaphorFieldRef;
1918
1938
  timeGrain?: SemaphorTimeGrain;
1939
+ timeWindow?: SemaphorTimeWindow;
1919
1940
  dimensions?: SemaphorFieldRef[];
1941
+ filters?: SemaphorAnalyticsFilter[];
1920
1942
  comparison?: {
1921
1943
  kind: 'previous_period' | 'previous_year' | 'target';
1922
1944
  targetValue?: number;
1923
1945
  };
1946
+ analysis?: SemaphorMetricAnalysis;
1924
1947
  inputs?: SemaphorInputBinding[];
1925
1948
  limit?: number;
1926
1949
  };
@@ -1988,6 +2011,12 @@ declare type SemaphorSqlIntent = {
1988
2011
 
1989
2012
  declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
1990
2013
 
2014
+ declare type SemaphorTimeWindow = {
2015
+ unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
2016
+ value: number;
2017
+ anchor?: 'now' | 'latest_available';
2018
+ };
2019
+
1991
2020
  declare type SemaphorViewPresentation = {
1992
2021
  kind: 'kpi';
1993
2022
  format?: 'number' | 'currency' | 'percent' | 'duration';
@@ -480,6 +480,16 @@ export declare type GeneratedRevision = {
480
480
 
481
481
  export declare type ReasoningEffort = 'low' | 'medium' | 'high';
482
482
 
483
+ declare type SemaphorAnalyticsFilter = {
484
+ id?: string;
485
+ field: SemaphorFieldRef;
486
+ operator?: SemaphorAnalyticsFilterOperator;
487
+ value?: unknown;
488
+ values?: unknown[];
489
+ };
490
+
491
+ declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
492
+
483
493
  declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
484
494
 
485
495
  declare type SemaphorDialect = 'semantic' | 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
@@ -497,7 +507,7 @@ declare type SemaphorInputBinding = {
497
507
  field?: SemaphorFieldRef;
498
508
  };
499
509
 
500
- declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | '>' | '>=' | '<' | '<=';
510
+ declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
501
511
 
502
512
  declare type SemaphorInputOptionsIntent = {
503
513
  kind: 'inputOptions';
@@ -510,21 +520,32 @@ declare type SemaphorInputOptionsIntent = {
510
520
  limit?: number;
511
521
  };
512
522
 
523
+ declare type SemaphorMetricAnalysis = {
524
+ kind: 'period_change';
525
+ orderBy?: 'absolute_change' | 'positive_change' | 'negative_change';
526
+ direction?: 'increase' | 'decrease' | 'both';
527
+ timeWindow?: SemaphorTimeWindow;
528
+ };
529
+
513
530
  declare type SemaphorMetricIntent = {
514
531
  kind: 'metric';
515
532
  version?: SemaphorProtocolVersion;
516
533
  id?: string;
517
534
  source: SemaphorSourceRef;
518
- metric: string;
519
- metrics?: string[];
535
+ metrics: string[];
536
+ primaryMetric?: string;
537
+ metricRefs?: SemaphorFieldRef[];
520
538
  label?: string;
521
539
  dateField?: SemaphorFieldRef;
522
540
  timeGrain?: SemaphorTimeGrain;
541
+ timeWindow?: SemaphorTimeWindow;
523
542
  dimensions?: SemaphorFieldRef[];
543
+ filters?: SemaphorAnalyticsFilter[];
524
544
  comparison?: {
525
545
  kind: 'previous_period' | 'previous_year' | 'target';
526
546
  targetValue?: number;
527
547
  };
548
+ analysis?: SemaphorMetricAnalysis;
528
549
  inputs?: SemaphorInputBinding[];
529
550
  limit?: number;
530
551
  };
@@ -592,6 +613,12 @@ declare type SemaphorSqlIntent = {
592
613
 
593
614
  declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
594
615
 
616
+ declare type SemaphorTimeWindow = {
617
+ unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
618
+ value: number;
619
+ anchor?: 'now' | 'latest_available';
620
+ };
621
+
595
622
  export declare type WorkspaceContext = {
596
623
  projectRoot?: string;
597
624
  framework?: string;
@@ -16,6 +16,16 @@ export declare function normalizeSemaphorInputOptions(options?: Array<{
16
16
 
17
17
  export declare function readWindowRuntime(): SemaphorDataAppWindowRuntime | undefined;
18
18
 
19
+ declare type SemaphorAnalyticsFilter = {
20
+ id?: string;
21
+ field: SemaphorFieldRef;
22
+ operator?: SemaphorAnalyticsFilterOperator;
23
+ value?: unknown;
24
+ values?: unknown[];
25
+ };
26
+
27
+ declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
28
+
19
29
  declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
20
30
 
21
31
  export declare const SemaphorDataAppContext: Context<SemaphorDataAppRuntime>;
@@ -139,8 +149,8 @@ export declare type SemaphorDataAppMetricResult = SemaphorDataAppQueryState & Se
139
149
  export declare type SemaphorDataAppMetricSpec = SemaphorDataAppSourceSpec & {
140
150
  id?: string;
141
151
  label?: string;
142
- metric: string;
143
- metrics?: string[];
152
+ metrics: SemaphorDataAppNonEmptyArray<string>;
153
+ primaryMetric?: string;
144
154
  dateField?: SemaphorDataAppFieldSpec;
145
155
  timeGrain?: SemaphorTimeGrain;
146
156
  dimensions?: SemaphorDataAppFieldSpec[];
@@ -261,7 +271,7 @@ declare type SemaphorInputBinding = {
261
271
  field?: SemaphorFieldRef;
262
272
  };
263
273
 
264
- declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | '>' | '>=' | '<' | '<=';
274
+ declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
265
275
 
266
276
  declare type SemaphorInputOptionsIntent = {
267
277
  kind: 'inputOptions';
@@ -274,21 +284,32 @@ declare type SemaphorInputOptionsIntent = {
274
284
  limit?: number;
275
285
  };
276
286
 
287
+ declare type SemaphorMetricAnalysis = {
288
+ kind: 'period_change';
289
+ orderBy?: 'absolute_change' | 'positive_change' | 'negative_change';
290
+ direction?: 'increase' | 'decrease' | 'both';
291
+ timeWindow?: SemaphorTimeWindow;
292
+ };
293
+
277
294
  declare type SemaphorMetricIntent = {
278
295
  kind: 'metric';
279
296
  version?: SemaphorProtocolVersion;
280
297
  id?: string;
281
298
  source: SemaphorSourceRef;
282
- metric: string;
283
- metrics?: string[];
299
+ metrics: string[];
300
+ primaryMetric?: string;
301
+ metricRefs?: SemaphorFieldRef[];
284
302
  label?: string;
285
303
  dateField?: SemaphorFieldRef;
286
304
  timeGrain?: SemaphorTimeGrain;
305
+ timeWindow?: SemaphorTimeWindow;
287
306
  dimensions?: SemaphorFieldRef[];
307
+ filters?: SemaphorAnalyticsFilter[];
288
308
  comparison?: {
289
309
  kind: 'previous_period' | 'previous_year' | 'target';
290
310
  targetValue?: number;
291
311
  };
312
+ analysis?: SemaphorMetricAnalysis;
292
313
  inputs?: SemaphorInputBinding[];
293
314
  limit?: number;
294
315
  };
@@ -356,6 +377,12 @@ declare type SemaphorSqlIntent = {
356
377
 
357
378
  declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
358
379
 
380
+ declare type SemaphorTimeWindow = {
381
+ unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
382
+ value: number;
383
+ anchor?: 'now' | 'latest_available';
384
+ };
385
+
359
386
  export declare function toSemaphorActiveInputSnapshots(inputs: SemaphorDataAppInputReference[] | undefined): SemaphorDataAppInputSnapshot[];
360
387
 
361
388
  export declare function toSemaphorInputBinding(input: SemaphorDataAppInputReference): SemaphorInputBinding;
@@ -1778,13 +1778,15 @@ declare type DashboardCardQueryFieldRef = {
1778
1778
  };
1779
1779
 
1780
1780
  declare type DashboardCardQueryIntent = {
1781
- metric?: string;
1782
1781
  metrics?: string[];
1782
+ primaryMetric?: string;
1783
+ metricRefs?: DashboardCardQueryFieldRef[];
1783
1784
  dateField?: string;
1784
1785
  dateFieldRef?: DashboardCardQueryFieldRef;
1785
1786
  timeGrain?: 'day' | 'week' | 'month' | 'quarter' | 'year';
1786
1787
  dimensions?: string[];
1787
1788
  dimensionRefs?: DashboardCardQueryFieldRef[];
1789
+ filters?: SemaphorAnalyticsFilter[];
1788
1790
  limit?: number;
1789
1791
  };
1790
1792
 
@@ -4415,6 +4417,16 @@ declare type SemanticExecutionPayload = {
4415
4417
  }>;
4416
4418
  };
4417
4419
 
4420
+ declare type SemaphorAnalyticsFilter = {
4421
+ id?: string;
4422
+ field: SemaphorFieldRef;
4423
+ operator?: SemaphorAnalyticsFilterOperator;
4424
+ value?: unknown;
4425
+ values?: unknown[];
4426
+ };
4427
+
4428
+ declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
4429
+
4418
4430
  declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
4419
4431
 
4420
4432
  export declare const SemaphorContextProvider: ({ children, dashboardProps, }: {
@@ -4437,6 +4449,8 @@ declare type SemaphorInputBinding = {
4437
4449
  field?: SemaphorFieldRef;
4438
4450
  };
4439
4451
 
4452
+ declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
4453
+
4440
4454
  declare type SemaphorInputOptionsIntent = {
4441
4455
  kind: 'inputOptions';
4442
4456
  version?: SemaphorProtocolVersion;
@@ -4448,21 +4462,32 @@ declare type SemaphorInputOptionsIntent = {
4448
4462
  limit?: number;
4449
4463
  };
4450
4464
 
4465
+ declare type SemaphorMetricAnalysis = {
4466
+ kind: 'period_change';
4467
+ orderBy?: 'absolute_change' | 'positive_change' | 'negative_change';
4468
+ direction?: 'increase' | 'decrease' | 'both';
4469
+ timeWindow?: SemaphorTimeWindow;
4470
+ };
4471
+
4451
4472
  declare type SemaphorMetricIntent = {
4452
4473
  kind: 'metric';
4453
4474
  version?: SemaphorProtocolVersion;
4454
4475
  id?: string;
4455
4476
  source: SemaphorSourceRef;
4456
- metric: string;
4457
- metrics?: string[];
4477
+ metrics: string[];
4478
+ primaryMetric?: string;
4479
+ metricRefs?: SemaphorFieldRef[];
4458
4480
  label?: string;
4459
4481
  dateField?: SemaphorFieldRef;
4460
4482
  timeGrain?: SemaphorTimeGrain;
4483
+ timeWindow?: SemaphorTimeWindow;
4461
4484
  dimensions?: SemaphorFieldRef[];
4485
+ filters?: SemaphorAnalyticsFilter[];
4462
4486
  comparison?: {
4463
4487
  kind: 'previous_period' | 'previous_year' | 'target';
4464
4488
  targetValue?: number;
4465
4489
  };
4490
+ analysis?: SemaphorMetricAnalysis;
4466
4491
  inputs?: SemaphorInputBinding[];
4467
4492
  limit?: number;
4468
4493
  };
@@ -4536,6 +4561,12 @@ declare type SemaphorSqlIntent = {
4536
4561
 
4537
4562
  declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
4538
4563
 
4564
+ declare type SemaphorTimeWindow = {
4565
+ unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
4566
+ value: number;
4567
+ anchor?: 'now' | 'latest_available';
4568
+ };
4569
+
4539
4570
  /**
4540
4571
  * Stable serializer for dashboard dirty checks.
4541
4572
  * This consolidates normalization + serialization into one call site, so
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.334",
8
+ "version": "0.1.336",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",