react-semaphor 0.1.443 → 0.1.445

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 (133) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/analytics-protocol/index.cjs +1 -1
  3. package/dist/analytics-protocol/index.js +123 -107
  4. package/dist/appearance/index.cjs +1 -1
  5. package/dist/brand-studio/index.cjs +2 -2
  6. package/dist/brand-studio/index.js +5 -4
  7. package/dist/briefings/index.cjs +1 -1
  8. package/dist/briefings/index.js +526 -457
  9. package/dist/chunks/analyze-result-contract-BHb7sUUW.cjs +1 -0
  10. package/dist/chunks/analyze-result-contract-DUv3QnMl.js +29 -0
  11. package/dist/chunks/{braces-CbO-aIwH.js → braces-BKimshER.cjs} +1 -1
  12. package/dist/chunks/{code-editor-BpADiIlq.js → code-editor-B4gTfvc5.js} +6800 -6560
  13. package/dist/chunks/code-editor-BYVorgOf.cjs +138 -0
  14. package/dist/chunks/common-types-CQ6SHfLk.cjs +1 -0
  15. package/dist/chunks/{common-types-ClkOI-3O.js → common-types-DFsDdpH7.js} +22 -21
  16. package/dist/chunks/dashboard-CAiwJW3L.cjs +1397 -0
  17. package/dist/chunks/{dashboard-briefing-launcher-C60n8LqW.js → dashboard-briefing-launcher-2SLNOaTg.js} +26 -24
  18. package/dist/chunks/{dashboard-briefing-launcher-BYMLjZxG.js → dashboard-briefing-launcher-CHwjpUYz.cjs} +2 -2
  19. package/dist/chunks/{dashboard-controls-ti9Rcel2.js → dashboard-controls-BfL14aqO.js} +11 -9
  20. package/dist/chunks/{dashboard-controls-BH_fZYDU.js → dashboard-controls-BgGTg4yw.cjs} +2 -2
  21. package/dist/chunks/dashboard-date-comparison-definition-DZq0htjG.cjs +1 -0
  22. package/dist/chunks/dashboard-json-BOv8tCa9.cjs +1 -0
  23. package/dist/chunks/{dashboard-json-Bturr634.js → dashboard-json-BZwq3EcS.js} +14 -12
  24. package/dist/chunks/{dashboard-Bd1Quco-.js → dashboard-u61yfU6u.js} +50081 -47351
  25. package/dist/chunks/edit-dashboard-visual-BdVCH0DJ.cjs +182 -0
  26. package/dist/chunks/{edit-dashboard-visual-DglMds57.js → edit-dashboard-visual-njLPYip3.js} +6825 -6656
  27. package/dist/chunks/{editor-action-buttons-CRi0fhVW.js → editor-action-buttons-BhLX5Q6m.js} +24 -23
  28. package/dist/chunks/{editor-action-buttons-Cxo7_tNG.js → editor-action-buttons-CBVMFipA.cjs} +1 -1
  29. package/dist/chunks/{index-D7KJindZ.js → format-types-CSv0V7mm.cjs} +1 -1
  30. package/dist/chunks/{index-CnujJ3fa.js → format-types-CZH5w1lo.js} +23 -17
  31. package/dist/chunks/{layout-grid-B08pP7v6.js → layout-grid-3-HWzEwU.cjs} +1 -1
  32. package/dist/chunks/{metric-comparison-CPoDx56y.js → metric-comparison-BJ_Qu1ZF.js} +1 -1
  33. package/dist/chunks/metric-comparison-CUAJ8n4y.cjs +1 -0
  34. package/dist/chunks/{palette-C0yjT5Tv.js → palette-DW_l7Jr0.cjs} +1 -1
  35. package/dist/chunks/pivot-result-identity-B6QCWOSi.js +94 -0
  36. package/dist/chunks/pivot-result-identity-CDLRT-YG.cjs +1 -0
  37. package/dist/chunks/pivot-result-lifecycle-BM3Pl-D1.js +914 -0
  38. package/dist/chunks/pivot-result-lifecycle-DPc0ANwk.cjs +4 -0
  39. package/dist/chunks/presentation-execution-BTV-Q43g.cjs +1 -0
  40. package/dist/chunks/presentation-execution-CGlb7YZ6.js +637 -0
  41. package/dist/chunks/{report-preferences-dialog-TtwdAuNn.js → report-preferences-dialog-D_NJu2wU.js} +7 -6
  42. package/dist/chunks/report-preferences-dialog-r8QzOSFb.cjs +1 -0
  43. package/dist/chunks/report-runtime-context-C8LZFsqV.cjs +1 -0
  44. package/dist/chunks/report-runtime-context-Qzn11HQe.js +387 -0
  45. package/dist/chunks/{save-Xdc4pnys.js → save-4_uMnE6s.cjs} +1 -1
  46. package/dist/chunks/{search-Dcud9ajy.js → search-6ZmeMq55.cjs} +1 -1
  47. package/dist/chunks/temporal-bucket-BnPxGrAi.js +446 -0
  48. package/dist/chunks/temporal-bucket-authoring-BUZMuVca.js +205 -0
  49. package/dist/chunks/temporal-bucket-authoring-CPTwHzvs.cjs +1 -0
  50. package/dist/chunks/temporal-bucket-contract-B2bJ1oe4.js +108 -0
  51. package/dist/chunks/temporal-bucket-contract-ChDBWX8I.cjs +1 -0
  52. package/dist/chunks/temporal-bucket-pMnV-4Nj.cjs +1 -0
  53. package/dist/chunks/{comparison-document-migration-Dj6xZMCb.js → temporal-result-owner-Cb27SSG9.js} +152 -123
  54. package/dist/chunks/temporal-result-owner-f6-i65Fb.cjs +1 -0
  55. package/dist/chunks/token-types-BdQ8kHBm.cjs +1 -0
  56. package/dist/chunks/token-types-DLo91nOf.js +8 -0
  57. package/dist/chunks/{update-policy-DnF_74zC.js → update-policy-BxvYMYz0.cjs} +1 -1
  58. package/dist/chunks/{update-policy-De2NswtM.js → update-policy-eg59mQqv.js} +1 -1
  59. package/dist/chunks/validators-9D4KBqKD.cjs +1 -0
  60. package/dist/chunks/validators-wZ2WlNHc.js +4640 -0
  61. package/dist/dashboard/index.cjs +1 -1
  62. package/dist/dashboard/index.js +2 -2
  63. package/dist/dashboard-authoring/index.cjs +3 -3
  64. package/dist/dashboard-authoring/index.js +136 -126
  65. package/dist/data-app-builder/index.cjs +1 -1
  66. package/dist/data-app-builder/index.js +2 -2
  67. package/dist/data-app-codegen/index.cjs +1 -1
  68. package/dist/data-app-codegen/index.js +2 -2
  69. package/dist/data-app-codegen-node/index.cjs +1 -1
  70. package/dist/data-app-codegen-node/index.js +3 -3
  71. package/dist/data-app-sdk/index.cjs +2 -2
  72. package/dist/data-app-sdk/index.js +34 -35
  73. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  74. package/dist/data-app-sdk-adapters/index.js +5 -5
  75. package/dist/data-app-sdk-validation/index.cjs +1 -1
  76. package/dist/data-app-sdk-validation/index.js +9 -10
  77. package/dist/format-utils/index.cjs +3 -3
  78. package/dist/format-utils/index.js +155 -176
  79. package/dist/index.cjs +1 -1
  80. package/dist/index.js +180 -174
  81. package/dist/report-runtime-context/index.cjs +1 -1
  82. package/dist/report-runtime-context/index.js +7 -392
  83. package/dist/shared/index.cjs +1 -1
  84. package/dist/style.css +1 -1
  85. package/dist/surfboard/index.cjs +1 -1
  86. package/dist/surfboard/index.js +3 -3
  87. package/dist/types/analytics-protocol.d.ts +257 -48
  88. package/dist/types/briefings.d.ts +138 -50
  89. package/dist/types/dashboard-assistant.d.ts +207 -52
  90. package/dist/types/dashboard-authoring.d.ts +182 -50
  91. package/dist/types/dashboard.d.ts +290 -48
  92. package/dist/types/data-app-builder.d.ts +48 -42
  93. package/dist/types/data-app-codegen-node.d.ts +50 -44
  94. package/dist/types/data-app-codegen.d.ts +50 -44
  95. package/dist/types/data-app-sdk-adapters.d.ts +48 -42
  96. package/dist/types/data-app-sdk-validation.d.ts +81 -43
  97. package/dist/types/data-app-sdk.d.ts +83 -45
  98. package/dist/types/format-utils.d.ts +645 -67
  99. package/dist/types/index.cjs +1 -1
  100. package/dist/types/index.js +19 -19
  101. package/dist/types/main.d.ts +298 -94
  102. package/dist/types/report-runtime-context.d.ts +3 -0
  103. package/dist/types/shared.d.ts +116 -41
  104. package/dist/types/surfboard.d.ts +290 -48
  105. package/dist/types/types.d.ts +455 -65
  106. package/package.json +3 -1
  107. package/dist/chunks/analyze-result-contract-BswhsmWT.js +0 -1
  108. package/dist/chunks/analyze-result-contract-CfOBEwaC.js +0 -1998
  109. package/dist/chunks/code-editor-M7HTUhdF.js +0 -138
  110. package/dist/chunks/common-types-C73-Ud1-.js +0 -1
  111. package/dist/chunks/comparison-document-migration-DbU_BTxR.js +0 -1
  112. package/dist/chunks/csv-utils-BZDvO2Fw.js +0 -376
  113. package/dist/chunks/csv-utils-Co0WxHke.js +0 -4
  114. package/dist/chunks/dashboard-cB3xmTNn.js +0 -1402
  115. package/dist/chunks/dashboard-date-comparison-definition-DGZr3m-b.js +0 -1
  116. package/dist/chunks/dashboard-json-Dw_55vSZ.js +0 -1
  117. package/dist/chunks/edit-dashboard-visual-BUc3NBQ4.js +0 -182
  118. package/dist/chunks/metric-comparison-DVy3fll_.js +0 -1
  119. package/dist/chunks/numeric-presentation-BJs5lSar.js +0 -517
  120. package/dist/chunks/numeric-presentation-Dlb-Dk4c.js +0 -1
  121. package/dist/chunks/report-preferences-dialog-CCvFqH4Q.js +0 -1
  122. package/dist/chunks/source-identity-5OPV4gvg.js +0 -92
  123. package/dist/chunks/source-identity-Cbo2LOHQ.js +0 -1
  124. package/dist/chunks/validators-B2vUAqTf.js +0 -1
  125. package/dist/chunks/validators-Bce_J7Vd.js +0 -2448
  126. /package/dist/chunks/{card-config-utils-15sRtebL.js → card-config-utils-15sRtebL.cjs} +0 -0
  127. /package/dist/chunks/{catalog-field-grounding-Bnx-3tE0.js → catalog-field-grounding-Bnx-3tE0.cjs} +0 -0
  128. /package/dist/chunks/{dashboard-input-contract-DV3cshjz.js → dashboard-input-contract-DV3cshjz.cjs} +0 -0
  129. /package/dist/chunks/{index-Dpm_VET4.js → index-Dpm_VET4.cjs} +0 -0
  130. /package/dist/chunks/{index-jSrCwPQz.js → index-jSrCwPQz.cjs} +0 -0
  131. /package/dist/chunks/{normalize-dashboard-for-dirty-check-BXRUMVb2.js → normalize-dashboard-for-dirty-check-BXRUMVb2.cjs} +0 -0
  132. /package/dist/chunks/{operators-DrTQsJXv.js → operators-DrTQsJXv.cjs} +0 -0
  133. /package/dist/chunks/{use-debounced-dirty-check-XHSwAefL.js → use-debounced-dirty-check-XHSwAefL.cjs} +0 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/dashboard-cB3xmTNn.js"),r=require("../chunks/common-types-C73-Ud1-.js"),o=require("../chunks/report-preferences-dialog-CCvFqH4Q.js");exports.DisplayFormatPreferencesFields=e.DisplayFormatPreferencesFields;exports.Surfboard=e.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=r.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;exports.ReportPreferencesDialog=o.ReportPreferencesDialog;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/dashboard-CAiwJW3L.cjs"),r=require("../chunks/common-types-CQ6SHfLk.cjs"),o=require("../chunks/report-preferences-dialog-r8QzOSFb.cjs");exports.DisplayFormatPreferencesFields=e.DisplayFormatPreferencesFields;exports.Surfboard=e.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=r.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;exports.ReportPreferencesDialog=o.ReportPreferencesDialog;
@@ -1,6 +1,6 @@
1
- import { a, b as o } from "../chunks/dashboard-Bd1Quco-.js";
2
- import { C as f, E } from "../chunks/common-types-ClkOI-3O.js";
3
- import { R as t } from "../chunks/report-preferences-dialog-TtwdAuNn.js";
1
+ import { a, b as o } from "../chunks/dashboard-u61yfU6u.js";
2
+ import { C as f, E } from "../chunks/common-types-DFsDdpH7.js";
3
+ import { R as t } from "../chunks/report-preferences-dialog-D_NJu2wU.js";
4
4
  export {
5
5
  f as CONTROL_CARD_DEFAULT_VALUE,
6
6
  a as DisplayFormatPreferencesFields,
@@ -56,6 +56,21 @@ export declare function buildSemaphorQualifiedSourcePath(input: {
56
56
  quoteIdentifier?: (value: string, dialect: SemaphorDialect) => string;
57
57
  }): string;
58
58
 
59
+ declare type CalendarContext = {
60
+ tz: string;
61
+ weekStart: WeekStart;
62
+ anchor: 'now' | {
63
+ iso: string;
64
+ };
65
+ fiscalCalendar?: MonthAlignedFiscalCalendar;
66
+ };
67
+
68
+ export declare type CanonicalDashboardRecordsPayload = DashboardRecordsPayload & {
69
+ columns: SemaphorResultColumn[];
70
+ };
71
+
72
+ export declare const canonicalDashboardRecordsPayloadSchema: z.ZodType<CanonicalDashboardRecordsPayload>;
73
+
59
74
  export declare const COMPARISON_PRESENTATION_DEFAULTS: {
60
75
  readonly displayMode: "difference";
61
76
  readonly showComparison: true;
@@ -124,6 +139,14 @@ export declare type DashboardDateComparisonOwner = {
124
139
  label: string;
125
140
  };
126
141
 
142
+ export declare type DashboardRecordsPayload = {
143
+ records: Array<Record<string, unknown>>;
144
+ columns?: SemaphorResultColumn[];
145
+ [key: string]: unknown;
146
+ };
147
+
148
+ export declare const dashboardRecordsPayloadSchema: z.ZodType<DashboardRecordsPayload>;
149
+
127
150
  export declare const DEFAULT_METRIC_COMPARISON_POLARITY: "higher_is_better";
128
151
 
129
152
  export declare function evaluateMetricComparison(input: {
@@ -169,6 +192,17 @@ export declare type GlobalDateComparisonSelection = {
169
192
  spec: ViewerPeriodComparisonSpec;
170
193
  };
171
194
 
195
+ /**
196
+ * Authoring boundary for a dashboard field that is known to be grouped by a
197
+ * temporal grain. The broad persisted field types remain intentionally
198
+ * compatible with unmigrated/non-temporal fields; new temporal writers use
199
+ * this boundary instead.
200
+ */
201
+ export declare type GroupedTemporalAuthoringInput<TBase extends object> = Omit<TBase, 'granularity' | 'format'> & {
202
+ granularity: SemaphorTimeGrain;
203
+ format?: TemporalBucketFormat;
204
+ };
205
+
172
206
  export declare function hasCompleteSemaphorSourceIdentity(source: SemaphorSourceRef | undefined): boolean;
173
207
 
174
208
  export declare function isAnalyticsCatalogDateField(field: AnalyticsCatalogField): boolean;
@@ -191,12 +225,16 @@ export declare function isSemaphorAnalyzeResultFieldName(value: string): value i
191
225
 
192
226
  export declare function isSemaphorDataAppCodegenSummary(value: unknown): value is SemaphorDataAppCodegenSummary;
193
227
 
228
+ export declare function isSemaphorMatrixTimeGrain(value: unknown): value is SemaphorMatrixTimeGrain;
229
+
230
+ export declare function isSemaphorTimeGrain(value: unknown): value is SemaphorTimeGrain;
231
+
194
232
  export declare type MatrixAxisLevelDescriptor = {
195
233
  instanceId: string;
196
234
  fieldKey: string;
197
235
  label: string;
198
236
  field: SemaphorFieldRef;
199
- grain?: SemaphorTimeGrain;
237
+ grain?: SemaphorMatrixTimeGrain;
200
238
  subtotal?: SemaphorMatrixSubtotalOptions;
201
239
  };
202
240
 
@@ -378,7 +416,7 @@ export declare type MatrixMeasureDescriptor = {
378
416
  label: string;
379
417
  field: SemaphorFieldRef;
380
418
  aggregate?: SemaphorAggregateFunction;
381
- format?: SemaphorValueFormat;
419
+ format?: SemaphorScalarValueFormat;
382
420
  totalBehavior?: SemaphorMatrixTotalCalculation;
383
421
  };
384
422
 
@@ -392,7 +430,7 @@ export declare type MatrixMeasureSemantics = {
392
430
  } | {
393
431
  kind: 'semiAdditive';
394
432
  aggregate?: SemaphorAggregateFunction;
395
- grain?: SemaphorTimeGrain;
433
+ grain?: SemaphorMatrixTimeGrain;
396
434
  } | {
397
435
  kind: 'nonAdditive';
398
436
  aggregate?: SemaphorAggregateFunction;
@@ -596,7 +634,7 @@ export declare type MetricComparisonSpec = {
596
634
  targetValue: number;
597
635
  };
598
636
 
599
- export declare type MetricComparisonWindowGrain = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
637
+ export declare type MetricComparisonWindowGrain = SemaphorTimeGrain;
600
638
 
601
639
  export declare type MetricResultAliasInput = {
602
640
  alias?: string;
@@ -607,10 +645,24 @@ export declare type MetricResultAliasInput = {
607
645
  expression?: string;
608
646
  };
609
647
 
648
+ declare type MonthAlignedFiscalCalendar = {
649
+ kind: 'month_aligned';
650
+ yearStartMonth: number;
651
+ };
652
+
610
653
  export declare function normalizeAnalyticsCatalogDataType(value: unknown): AnalyticsCatalogDataType;
611
654
 
612
655
  export declare function normalizeAnalyticsCatalogName(value: unknown): string;
613
656
 
657
+ /**
658
+ * Downstream normalized grouped fields always carry explicit presentation;
659
+ * an omitted authored format is materialized as `auto` by the Phase B adapter.
660
+ */
661
+ export declare type NormalizedGroupedTemporalField<TBase extends object> = Omit<TBase, 'granularity' | 'format'> & {
662
+ granularity: SemaphorTimeGrain;
663
+ format: TemporalBucketFormat;
664
+ };
665
+
614
666
  export declare function normalizeSemaphorAnalyticsFilterOperator(value: SemaphorAnalyticsFilterOperator | string | null | undefined): SemaphorAnalyticsFilterOperator | undefined;
615
667
 
616
668
  export declare function normalizeSemaphorDialect(input: string | undefined): SemaphorDialect;
@@ -646,6 +698,29 @@ export declare type ResolvedMetricComparisonRequest = {
646
698
  owner?: DashboardDateComparisonOwner;
647
699
  };
648
700
 
701
+ export declare type ResolvedPrimaryDateField = (ResolvedPrimaryDateFieldBase & ({
702
+ defaultGranularity?: SemaphorTimeGrain;
703
+ format?: undefined;
704
+ } | {
705
+ defaultGranularity: SemaphorTimeGrain;
706
+ format: TemporalBucketFormat;
707
+ })) | null;
708
+
709
+ declare type ResolvedPrimaryDateFieldBase = {
710
+ sourceDataset: string;
711
+ sourceField: string;
712
+ name: string;
713
+ qualifiedFieldName: string;
714
+ qualifiedEntityName?: string;
715
+ entityId: string;
716
+ entityName: string;
717
+ entityType: string;
718
+ dataType: string;
719
+ /** Canonical dataset coordinates stamped by the semantic grounding boundary. */
720
+ source?: SemaphorSourceRef;
721
+ supportedGranularities?: SemaphorTimeGrain[];
722
+ };
723
+
649
724
  export declare type ResolvedTemporalContext = {
650
725
  status: 'resolved';
651
726
  field: SourceBearingTemporalField;
@@ -686,6 +761,15 @@ export declare function semanticDatasetMatchesFieldCoordinates(dataset: {
686
761
  entityName?: unknown;
687
762
  }): boolean;
688
763
 
764
+ /**
765
+ * Semantic temporal input permits total omission, but a format can only exist
766
+ * in the branch that declares its grain.
767
+ */
768
+ export declare type SemanticGroupedTemporalInput<TBase extends object> = (Omit<TBase, 'granularity' | 'format'> & {
769
+ granularity?: undefined;
770
+ format?: undefined;
771
+ }) | GroupedTemporalAuthoringInput<TBase>;
772
+
689
773
  export declare const SEMAPHOR_ANALYTICS_INTENT_FIXTURES: {
690
774
  revenueKpi: {
691
775
  version: 1;
@@ -946,6 +1030,13 @@ export declare const SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION: "semaphor
946
1030
 
947
1031
  export declare const SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION: "semaphor-data-app-codegen-summary-validator/v2";
948
1032
 
1033
+ /** Stable field identity for the query builder's generated Count measure. */
1034
+ export declare const SEMAPHOR_GENERATED_COUNT_METRIC_ID: "__auto_count__";
1035
+
1036
+ export declare const SEMAPHOR_MATRIX_TIME_GRAINS: ["hour", "day", "week", "month", "quarter", "year"];
1037
+
1038
+ export declare const SEMAPHOR_TIME_GRAINS: readonly ["second", "minute", "hour", "day", "week", "month", "quarter", "year"];
1039
+
949
1040
  export declare type SemaphorAbsoluteTimeWindow = {
950
1041
  kind: 'absolute';
951
1042
  start: string;
@@ -2521,7 +2612,7 @@ export declare type SemaphorDataAppCodegenMatrixIntent = {
2521
2612
  rows: Array<{
2522
2613
  id?: string;
2523
2614
  field?: SemaphorDataAppCodegenFieldRef;
2524
- grain?: SemaphorTimeGrain;
2615
+ grain?: SemaphorMatrixTimeGrain;
2525
2616
  label?: string;
2526
2617
  subtotal?: boolean | {
2527
2618
  enabled?: boolean;
@@ -2531,7 +2622,7 @@ export declare type SemaphorDataAppCodegenMatrixIntent = {
2531
2622
  columns?: Array<{
2532
2623
  id?: string;
2533
2624
  field?: SemaphorDataAppCodegenFieldRef;
2534
- grain?: SemaphorTimeGrain;
2625
+ grain?: SemaphorMatrixTimeGrain;
2535
2626
  label?: string;
2536
2627
  subtotal?: boolean | {
2537
2628
  enabled?: boolean;
@@ -2912,7 +3003,7 @@ export declare type SemaphorDerivedFieldDefinition = {
2912
3003
  defaultAggregate?: SemaphorAggregateFunction;
2913
3004
  aggregationBehavior?: SemaphorDerivedFieldAggregationBehavior;
2914
3005
  aggregationStrategy?: SemaphorDerivedFieldAggregationStrategy;
2915
- format?: SemaphorValueFormat;
3006
+ format?: SemaphorScalarValueFormat;
2916
3007
  tags?: string[];
2917
3008
  };
2918
3009
 
@@ -3124,7 +3215,7 @@ export declare type SemaphorMatrixAxisExpansionOptions = {
3124
3215
  export declare type SemaphorMatrixAxisLevel = {
3125
3216
  id?: string;
3126
3217
  field: SemaphorFieldRef;
3127
- grain?: SemaphorTimeGrain;
3218
+ grain?: SemaphorMatrixTimeGrain;
3128
3219
  label?: string;
3129
3220
  subtotal?: boolean | SemaphorMatrixSubtotalOptions;
3130
3221
  sortBy?: SemaphorMatrixAxisSortRule;
@@ -3242,6 +3333,8 @@ export declare type SemaphorMatrixSubtotalOptions = {
3242
3333
  label?: string;
3243
3334
  };
3244
3335
 
3336
+ export declare type SemaphorMatrixTimeGrain = (typeof SEMAPHOR_MATRIX_TIME_GRAINS)[number];
3337
+
3245
3338
  export declare type SemaphorMatrixTotalCalculation = {
3246
3339
  kind: 'defaultAggregate';
3247
3340
  } | {
@@ -3277,7 +3370,7 @@ export declare type SemaphorMatrixValueField = {
3277
3370
  field: SemaphorFieldRef;
3278
3371
  aggregate?: SemaphorAggregateFunction;
3279
3372
  label?: string;
3280
- format?: SemaphorValueFormat;
3373
+ format?: SemaphorScalarValueFormat;
3281
3374
  totalBehavior?: SemaphorMatrixTotalCalculation;
3282
3375
  };
3283
3376
 
@@ -3563,6 +3656,30 @@ export declare const semaphorPhysicalSourceRefSchema: z.ZodObject<{
3563
3656
  dialect: z.ZodOptional<z.ZodEnum<["postgres", "mysql", "mssql", "snowflake", "clickhouse", "bigquery", "redshift", "duckdb", "sqlite", "unknown"]>>;
3564
3657
  }, z.ZodTypeAny, "passthrough">>;
3565
3658
 
3659
+ export declare type SemaphorPivotResultColumnIdentity = {
3660
+ metricId: string;
3661
+ /** Collision-safe identity for this configured metric instance. */
3662
+ metricAlias: string;
3663
+ /**
3664
+ * Sole transported tuple identity in configured pivot-axis order. A leaf
3665
+ * carries the complete tuple, a subtotal carries its explicit prefix, and a
3666
+ * metric-only or grand-total column carries an empty tuple.
3667
+ */
3668
+ members: SemaphorPivotResultMember[];
3669
+ };
3670
+
3671
+ export declare type SemaphorPivotResultMember = {
3672
+ /** Stable identity of the configured pivot field. */
3673
+ fieldId: string;
3674
+ /** Canonical pivot member value; labels are resolved only at presentation. */
3675
+ value: SemaphorPivotValue;
3676
+ /** Present when this member is an activated governed temporal bucket. */
3677
+ temporalBucket?: TemporalBucketMetadata;
3678
+ };
3679
+
3680
+ /** Stable canonical scalar transported for one physical pivot member. */
3681
+ export declare type SemaphorPivotValue = string | null;
3682
+
3566
3683
  export declare type SemaphorProtocolIssue = {
3567
3684
  code: string;
3568
3685
  message: string;
@@ -3798,7 +3915,7 @@ export declare type SemaphorRelationshipHint = {
3798
3915
 
3799
3916
  export declare type SemaphorRelativeTimeWindow = {
3800
3917
  kind?: 'relative';
3801
- unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
3918
+ unit: SemaphorTimeGrain;
3802
3919
  value: number;
3803
3920
  anchor?: 'now' | 'latest_available';
3804
3921
  completeness?: 'include_partial' | 'complete_periods';
@@ -3839,7 +3956,7 @@ export declare type SemaphorResultCalculationOutput = {
3839
3956
  key: string;
3840
3957
  label?: string;
3841
3958
  dataType?: SemaphorFieldRef['dataType'];
3842
- format?: SemaphorValueFormat;
3959
+ format?: SemaphorScalarValueFormat;
3843
3960
  };
3844
3961
 
3845
3962
  export declare type SemaphorResultColumn = {
@@ -3861,6 +3978,8 @@ export declare type SemaphorResultColumn = {
3861
3978
  aggregate?: SemaphorFieldRef['aggregate'];
3862
3979
  source?: SemaphorFieldRef['source'];
3863
3980
  derivedField?: SemaphorDerivedFieldDefinition;
3981
+ temporalBucket?: TemporalBucketMetadata;
3982
+ pivotIdentity?: SemaphorPivotResultColumnIdentity;
3864
3983
  };
3865
3984
 
3866
3985
  export declare type SemaphorResultColumnRef = {
@@ -3871,6 +3990,43 @@ export declare type SemaphorResultColumnRef = {
3871
3990
 
3872
3991
  export declare const semaphorResultColumnSchema: z.ZodType<SemaphorResultColumn>;
3873
3992
 
3993
+ export declare type SemaphorScalarValueFormat = {
3994
+ type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
3995
+ minimumFractionDigits?: number;
3996
+ maximumFractionDigits?: number;
3997
+ useGrouping?: boolean;
3998
+ prefix?: string;
3999
+ suffix?: string;
4000
+ negativeStyle?: 'minus' | 'parentheses';
4001
+ compact?: boolean;
4002
+ scale?: number;
4003
+ currency?: string;
4004
+ percentValueMode?: 'fraction' | 'whole';
4005
+ } | {
4006
+ type: 'date' | 'datetime';
4007
+ locale?: string;
4008
+ pattern?: string;
4009
+ relative?: boolean;
4010
+ timezone?: string;
4011
+ sourceTimezone?: string;
4012
+ prefix?: string;
4013
+ suffix?: string;
4014
+ } | {
4015
+ type: 'duration';
4016
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
4017
+ outputStyle?: 'compact' | 'digital' | 'long';
4018
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
4019
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
4020
+ maxUnits?: number;
4021
+ prefix?: string;
4022
+ suffix?: string;
4023
+ negativeStyle?: 'minus' | 'parentheses';
4024
+ } | {
4025
+ type: 'string';
4026
+ prefix?: string;
4027
+ suffix?: string;
4028
+ };
4029
+
3874
4030
  export declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
3875
4031
  kind: 'semantic';
3876
4032
  }>;
@@ -4123,7 +4279,9 @@ export declare const semaphorSqlSourceRefSchema: z.ZodObject<{
4123
4279
  label: z.ZodOptional<z.ZodString>;
4124
4280
  }, z.ZodTypeAny, "passthrough">>;
4125
4281
 
4126
- export declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
4282
+ export declare type SemaphorTimeGrain = (typeof SEMAPHOR_TIME_GRAINS)[number];
4283
+
4284
+ export declare const semaphorTimeGrainSchema: z.ZodEnum<["second", "minute", "hour", "day", "week", "month", "quarter", "year"]>;
4127
4285
 
4128
4286
  export declare type SemaphorTimeWindow = SemaphorRelativeTimeWindow | SemaphorAbsoluteTimeWindow;
4129
4287
 
@@ -4133,42 +4291,7 @@ export declare type SemaphorValidationResult = {
4133
4291
  warnings: SemaphorProtocolIssue[];
4134
4292
  };
4135
4293
 
4136
- export declare type SemaphorValueFormat = {
4137
- type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
4138
- minimumFractionDigits?: number;
4139
- maximumFractionDigits?: number;
4140
- useGrouping?: boolean;
4141
- prefix?: string;
4142
- suffix?: string;
4143
- negativeStyle?: 'minus' | 'parentheses';
4144
- compact?: boolean;
4145
- scale?: number;
4146
- currency?: string;
4147
- percentValueMode?: 'fraction' | 'whole';
4148
- } | {
4149
- type: 'date' | 'datetime';
4150
- locale?: string;
4151
- pattern?: string;
4152
- relative?: boolean;
4153
- timezone?: string;
4154
- sourceTimezone?: string;
4155
- prefix?: string;
4156
- suffix?: string;
4157
- } | {
4158
- type: 'duration';
4159
- inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
4160
- outputStyle?: 'compact' | 'digital' | 'long';
4161
- largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
4162
- smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
4163
- maxUnits?: number;
4164
- prefix?: string;
4165
- suffix?: string;
4166
- negativeStyle?: 'minus' | 'parentheses';
4167
- } | {
4168
- type: 'string';
4169
- prefix?: string;
4170
- suffix?: string;
4171
- };
4294
+ export declare type SemaphorValueFormat = SemaphorScalarValueFormat | TemporalBucketFormat;
4172
4295
 
4173
4296
  export declare type SemaphorViewPresentation = {
4174
4297
  kind: 'kpi';
@@ -4191,6 +4314,14 @@ export declare type SourceBearingTemporalField = SemaphorFieldRef & {
4191
4314
  source: SemaphorSourceRef;
4192
4315
  };
4193
4316
 
4317
+ export declare const TEMPORAL_BUCKET_CONTRACT_ERROR_CODES: {
4318
+ readonly missingMetadata: "missing_temporal_bucket_metadata";
4319
+ readonly invalidMetadata: "invalid_temporal_bucket_metadata";
4320
+ readonly invalidValue: "invalid_temporal_bucket_value";
4321
+ };
4322
+
4323
+ export declare const TEMPORAL_BUCKET_PRESETS: readonly ["week_of_short", "week_of_long", "quarter_short", "quarter_long", "fiscal_quarter_short", "fiscal_year"];
4324
+
4194
4325
  export declare const TEMPORAL_CONTEXT_ADAPTER_PARITY_FIXTURES: {
4195
4326
  readonly visibleAxis: {
4196
4327
  readonly source: {
@@ -4232,6 +4363,64 @@ export declare type TemporalBindingCandidate = {
4232
4363
  field: SourceBearingTemporalField;
4233
4364
  };
4234
4365
 
4366
+ export declare type TemporalBucketContractError = {
4367
+ code: TemporalBucketContractErrorCode;
4368
+ message: string;
4369
+ path?: string;
4370
+ };
4371
+
4372
+ export declare type TemporalBucketContractErrorCode = (typeof TEMPORAL_BUCKET_CONTRACT_ERROR_CODES)[keyof typeof TEMPORAL_BUCKET_CONTRACT_ERROR_CODES];
4373
+
4374
+ export declare function temporalBucketDataTypeForGrain(granularity: SemaphorTimeGrain): 'date' | 'datetime';
4375
+
4376
+ export declare type TemporalBucketFormat = {
4377
+ type: 'temporal_bucket';
4378
+ presentation: TemporalBucketPresentation;
4379
+ };
4380
+
4381
+ export declare const temporalBucketFormatSchema: z.ZodType<TemporalBucketFormat>;
4382
+
4383
+ export declare type TemporalBucketMetadata = {
4384
+ kind: 'temporal_bucket';
4385
+ granularity: SemaphorTimeGrain;
4386
+ calendar: Pick<CalendarContext, 'tz' | 'weekStart' | 'fiscalCalendar'>;
4387
+ };
4388
+
4389
+ export declare const temporalBucketMetadataSchema: z.ZodType<TemporalBucketMetadata>;
4390
+
4391
+ export declare type TemporalBucketMetadataValidationResult = {
4392
+ ok: true;
4393
+ value?: TemporalBucketMetadata;
4394
+ } | {
4395
+ ok: false;
4396
+ error: TemporalBucketContractError;
4397
+ };
4398
+
4399
+ export declare type TemporalBucketPresentation = {
4400
+ mode: 'auto';
4401
+ } | {
4402
+ mode: 'preset';
4403
+ preset: TemporalBucketPreset;
4404
+ } | {
4405
+ mode: 'pattern';
4406
+ pattern: string;
4407
+ };
4408
+
4409
+ export declare type TemporalBucketPreset = (typeof TEMPORAL_BUCKET_PRESETS)[number];
4410
+
4411
+ export declare type TemporalBucketResultColumnExpectation = {
4412
+ key: string;
4413
+ metadata: TemporalBucketMetadata;
4414
+ };
4415
+
4416
+ export declare type TemporalBucketResultColumnsValidationResult = {
4417
+ ok: true;
4418
+ value: SemaphorResultColumn[];
4419
+ } | {
4420
+ ok: false;
4421
+ error: TemporalBucketContractError;
4422
+ };
4423
+
4235
4424
  export declare type TemporalRangeCandidate = {
4236
4425
  id: string;
4237
4426
  source: 'global_date' | 'card';
@@ -4239,6 +4428,13 @@ export declare type TemporalRangeCandidate = {
4239
4428
  window: ResolvedDateWindow;
4240
4429
  };
4241
4430
 
4431
+ /**
4432
+ * Validates the atomic column boundary for an activated canonical producer.
4433
+ * Expected keys come from the producer's typed field/output mapping; this
4434
+ * function never infers temporal meaning from row values or labels.
4435
+ */
4436
+ export declare function validateActivatedTemporalBucketResultColumns(columns: SemaphorResultColumn[], expectedColumns: TemporalBucketResultColumnExpectation[]): TemporalBucketResultColumnsValidationResult;
4437
+
4242
4438
  export declare function validateComparisonPresentationSpec(value: unknown, path?: string): SemaphorValidationResult;
4243
4439
 
4244
4440
  export declare function validateGlobalDateComparisonContext(value: unknown, path?: string): SemaphorValidationResult;
@@ -4268,8 +4464,21 @@ export declare function validateSemaphorOperationIntent(intent: SemaphorOperatio
4268
4464
 
4269
4465
  export declare function validateSemaphorResultCalculation(calculation: SemaphorResultCalculation): SemaphorValidationResult;
4270
4466
 
4467
+ export declare function validateTemporalBucketMetadata(metadata: unknown): TemporalBucketMetadataValidationResult;
4468
+
4469
+ /**
4470
+ * Validates the temporal descriptor at an activated result-column boundary.
4471
+ * Callers must state whether that producer is expected to return a bucket;
4472
+ * this function never infers temporal meaning from values or labels.
4473
+ */
4474
+ export declare function validateTemporalBucketResultColumn(column: Pick<SemaphorResultColumn, 'dataType' | 'temporalBucket'>, options: {
4475
+ metadataRequired: boolean;
4476
+ }): TemporalBucketMetadataValidationResult;
4477
+
4271
4478
  export declare type ViewerPeriodComparisonSpec = Extract<MetricComparisonSpec, {
4272
4479
  kind: 'previous_period' | 'previous_year';
4273
4480
  }>;
4274
4481
 
4482
+ declare type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
4483
+
4275
4484
  export { }