react-semaphor 0.1.497 → 0.1.499

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 (123) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +22 -22
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +4 -4
  5. package/dist/briefings/index.cjs +1 -1
  6. package/dist/briefings/index.js +5 -5
  7. package/dist/chunks/{calculated-field-identity-Cq9GwHfE.js → calculated-field-identity-BC2NViZZ.js} +75 -65
  8. package/dist/chunks/{calculated-field-identity-DTfyvvLC.cjs → calculated-field-identity-CtYhhZoG.cjs} +1 -1
  9. package/dist/chunks/{constants-CC3WKmqC.js → constants-CTRduy1g.js} +5 -5
  10. package/dist/chunks/{constants-DIuhVR6J.cjs → constants-DNgpRMaX.cjs} +1 -1
  11. package/dist/chunks/{dashboard-briefing-launcher-72HdqDbJ.js → dashboard-briefing-launcher-Bp6SBVb6.js} +9 -9
  12. package/dist/chunks/{dashboard-briefing-launcher-CZZuHl61.cjs → dashboard-briefing-launcher-Dtzn9Tqg.cjs} +1 -1
  13. package/dist/chunks/{dashboard-controls-B7YP9m8Y.cjs → dashboard-controls-CLw5VQ2x.cjs} +1 -1
  14. package/dist/chunks/{dashboard-controls-BwisKmY9.js → dashboard-controls-DDI3atQf.js} +11 -11
  15. package/dist/chunks/{dashboard-date-comparison-definition-Bqti6YAo.js → dashboard-date-comparison-definition-C1vJshiP.js} +6 -6
  16. package/dist/chunks/{dashboard-date-comparison-definition-C69F-zaC.cjs → dashboard-date-comparison-definition-CWz_Yte8.cjs} +1 -1
  17. package/dist/chunks/{dashboard-json-B6GTxo8h.cjs → dashboard-json-BnT6W7Lt.cjs} +1 -1
  18. package/dist/chunks/{dashboard-json-C5Cu7-zC.js → dashboard-json-rHLrTBbN.js} +7 -7
  19. package/dist/chunks/{edit-dashboard-visual-drzAIBe2.js → edit-dashboard-visual-BH2LkjHV.js} +7536 -7584
  20. package/dist/chunks/edit-dashboard-visual-DqAMe8XW.cjs +172 -0
  21. package/dist/chunks/{editor-action-buttons-Cm_fqm5R.cjs → editor-action-buttons-Boq8MLya.cjs} +1 -1
  22. package/dist/chunks/{editor-action-buttons-B8HjvmzM.js → editor-action-buttons-DUEK2-kM.js} +6 -6
  23. package/dist/chunks/{field-aggregations-naKZ7S2Q.cjs → field-aggregations-mlkON_QA.cjs} +1 -1
  24. package/dist/chunks/{field-aggregations-C8kZqMTD.js → field-aggregations-tLaXZ2VJ.js} +19 -19
  25. package/dist/chunks/field-dependencies-R7MrlW6D.cjs +1 -0
  26. package/dist/chunks/field-dependencies-ZE2klbHO.js +182 -0
  27. package/dist/chunks/{index-oll4m-qi.js → index-BVIet238.js} +11 -11
  28. package/dist/chunks/{index-CCa-A-Yx.cjs → index-Bh3SlWJS.cjs} +1 -1
  29. package/dist/chunks/{index-Cg8HZmMI.js → index-CEm8bwwd.js} +38146 -37887
  30. package/dist/chunks/index-Gos2ij10.cjs +1417 -0
  31. package/dist/chunks/{matrix-analytical-definition-B1xhoCak.js → matrix-analytical-definition-CIVFNNnF.js} +1 -1
  32. package/dist/chunks/{matrix-analytical-definition-BK5y9XHH.cjs → matrix-analytical-definition-wIEDXvV5.cjs} +1 -1
  33. package/dist/chunks/{matrix-card-BEb6hr8i.js → matrix-card-BVvKHL7s.js} +2 -2
  34. package/dist/chunks/{matrix-card-Ii8yYSnw.cjs → matrix-card-Dh0J0_Of.cjs} +1 -1
  35. package/dist/chunks/matrix-control-sources-CjnsBREg.js +605 -0
  36. package/dist/chunks/matrix-control-sources-a67fwoOO.cjs +1 -0
  37. package/dist/chunks/{matrix-definition-CZM5-YJX.js → matrix-definition-BEXCfZAe.js} +3 -3
  38. package/dist/chunks/{matrix-definition-CSNthxru.cjs → matrix-definition-CKVi4VVg.cjs} +1 -1
  39. package/dist/chunks/{matrix-formatter-CiXzpX6X.js → matrix-formatter-BTPfthsa.js} +33 -33
  40. package/dist/chunks/{matrix-formatter-C19PZAal.cjs → matrix-formatter-CWtdnbfv.cjs} +1 -1
  41. package/dist/chunks/{matrix-member-presentation-CabW8mJc.js → matrix-member-presentation-DiDUvZts.js} +1 -1
  42. package/dist/chunks/{matrix-member-presentation-CQHvq18l.cjs → matrix-member-presentation-e_KZoZOx.cjs} +1 -1
  43. package/dist/chunks/{matrix-operation-contract-0Nor-C71.js → matrix-operation-contract-CPgckXxm.js} +164 -164
  44. package/dist/chunks/{matrix-operation-contract-o9GXbiHw.cjs → matrix-operation-contract-thtFuUYf.cjs} +1 -1
  45. package/dist/chunks/{metric-comparison-DeiOjEm5.cjs → metric-comparison-CAqV6VnZ.cjs} +1 -1
  46. package/dist/chunks/{metric-comparison-Br8l0WkK.js → metric-comparison-Dgyq1I3d.js} +1 -1
  47. package/dist/chunks/{pivot-header-presentation-DRv-cSIP.cjs → pivot-header-presentation-DUXM-VOP.cjs} +1 -1
  48. package/dist/chunks/{pivot-header-presentation-DW-ti5ek.js → pivot-header-presentation-DcCO8-Ij.js} +3 -3
  49. package/dist/chunks/{pivot-result-identity-sZc1RaIz.js → pivot-result-identity-Be1zm0AV.js} +1 -1
  50. package/dist/chunks/{pivot-result-identity-DEenUrMj.cjs → pivot-result-identity-DJyF4I2K.cjs} +1 -1
  51. package/dist/chunks/{pivot-result-lifecycle-DJ40gdwk.js → pivot-result-lifecycle-DpSZOMOZ.js} +7 -7
  52. package/dist/chunks/{pivot-result-lifecycle-D81qcCcZ.cjs → pivot-result-lifecycle-E_huAPev.cjs} +1 -1
  53. package/dist/chunks/{raw-temporal-DDTt2yv5.cjs → raw-temporal-DYoPBY6B.cjs} +1 -1
  54. package/dist/chunks/{raw-temporal-DHCZrFe7.js → raw-temporal-DfnRBxQn.js} +2 -2
  55. package/dist/chunks/{raw-temporal-contract-CkvdtPYA.js → raw-temporal-contract-CNwYygW2.js} +1 -1
  56. package/dist/chunks/{raw-temporal-contract-BcbV56Rc.cjs → raw-temporal-contract-D1_n2pBj.cjs} +1 -1
  57. package/dist/chunks/{report-preferences-dialog-KI7AgU11.js → report-preferences-dialog-8nfXNWvl.js} +6 -6
  58. package/dist/chunks/{report-preferences-dialog-BOGeoFLL.cjs → report-preferences-dialog-CW59SyVZ.cjs} +1 -1
  59. package/dist/chunks/{report-runtime-context-lSIvyKm2.cjs → report-runtime-context-CqFbgZq9.cjs} +1 -1
  60. package/dist/chunks/{report-runtime-context-BlDpc-F-.js → report-runtime-context-Dln1qvGS.js} +5 -5
  61. package/dist/chunks/{semantic-format--_VEin18.cjs → semantic-format-C7Goni6h.cjs} +1 -1
  62. package/dist/chunks/{semantic-format-ew5zviaT.js → semantic-format-PKQt2EAz.js} +2 -2
  63. package/dist/chunks/{source-entity-resolution-DPjslVgx.cjs → source-entity-resolution-BMKxwdKN.cjs} +1 -1
  64. package/dist/chunks/{source-entity-resolution-79Rihbk3.js → source-entity-resolution-BSZ07Sl6.js} +18 -18
  65. package/dist/chunks/{switch-DlLDM7Pu.js → switch-B4wVqV4L.js} +1292 -1280
  66. package/dist/chunks/{switch-wR8lV0zN.cjs → switch-DVjKkt22.cjs} +24 -24
  67. package/dist/chunks/{temporal-bucket-contract-BYR6tj6F.cjs → temporal-bucket-contract-CSdspcYj.cjs} +1 -1
  68. package/dist/chunks/{temporal-bucket-contract-C-kKQ_W4.js → temporal-bucket-contract-_WCvDnvn.js} +1 -1
  69. package/dist/chunks/{update-policy-BCtFr2Qh.cjs → update-policy-BESKAspa.cjs} +1 -1
  70. package/dist/chunks/{update-policy-CP_A1IVD.js → update-policy-BWbXhkk-.js} +2 -2
  71. package/dist/chunks/{validators-D-_IT-Xw.js → validators-CHlnnHuS.js} +1105 -1041
  72. package/dist/chunks/validators-D2F_uxxP.cjs +1 -0
  73. package/dist/dashboard/index.cjs +1 -1
  74. package/dist/dashboard/index.js +1 -1
  75. package/dist/dashboard-authoring/index.cjs +3 -3
  76. package/dist/dashboard-authoring/index.js +112 -107
  77. package/dist/data-app-builder/index.cjs +1 -1
  78. package/dist/data-app-builder/index.js +2 -2
  79. package/dist/data-app-codegen/index.cjs +1 -1
  80. package/dist/data-app-codegen/index.js +2 -2
  81. package/dist/data-app-codegen-node/index.cjs +1 -1
  82. package/dist/data-app-codegen-node/index.js +3 -3
  83. package/dist/data-app-sdk/index.cjs +1 -1
  84. package/dist/data-app-sdk/index.js +232 -232
  85. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  86. package/dist/data-app-sdk-adapters/index.js +2 -2
  87. package/dist/data-app-sdk-validation/index.cjs +1 -1
  88. package/dist/data-app-sdk-validation/index.js +5 -5
  89. package/dist/format-utils/index.cjs +1 -1
  90. package/dist/format-utils/index.js +16 -16
  91. package/dist/index.cjs +1 -1
  92. package/dist/index.js +97 -93
  93. package/dist/report-runtime-context/index.cjs +1 -1
  94. package/dist/report-runtime-context/index.js +2 -2
  95. package/dist/style.css +1 -1
  96. package/dist/surfboard/index.cjs +1 -1
  97. package/dist/surfboard/index.js +2 -2
  98. package/dist/types/analytics-protocol.d.ts +15 -0
  99. package/dist/types/briefings.d.ts +16 -1
  100. package/dist/types/dashboard-assistant.d.ts +15 -0
  101. package/dist/types/dashboard-authoring.d.ts +49 -1
  102. package/dist/types/dashboard.d.ts +23 -1
  103. package/dist/types/data-app-builder.d.ts +15 -0
  104. package/dist/types/data-app-codegen-node.d.ts +15 -0
  105. package/dist/types/data-app-codegen.d.ts +15 -0
  106. package/dist/types/data-app-sdk-adapters.d.ts +15 -0
  107. package/dist/types/data-app-sdk-validation.d.ts +15 -0
  108. package/dist/types/data-app-sdk.d.ts +15 -0
  109. package/dist/types/format-utils.d.ts +15 -0
  110. package/dist/types/index.cjs +1 -1
  111. package/dist/types/index.js +34 -21
  112. package/dist/types/main.d.ts +74 -6
  113. package/dist/types/shared.d.ts +16 -1
  114. package/dist/types/surfboard.d.ts +23 -1
  115. package/dist/types/types.d.ts +172 -6
  116. package/package.json +1 -1
  117. package/dist/chunks/edit-dashboard-visual-DqBcJ1bo.cjs +0 -172
  118. package/dist/chunks/index-B8-qrqSa.cjs +0 -1417
  119. package/dist/chunks/matrix-control-sources-CdegRBcA.cjs +0 -1
  120. package/dist/chunks/matrix-control-sources-cbYmqWNg.js +0 -523
  121. package/dist/chunks/token-types-BIYFAsGq.js +0 -8
  122. package/dist/chunks/token-types-CkAGFhiW.cjs +0 -1
  123. package/dist/chunks/validators-ux2obZB9.cjs +0 -1
@@ -4621,6 +4621,8 @@ export declare const CALCULATED_FIELD_ENTITY_MARKER: "SEMAPHOR_CALCULATED_FIELD"
4621
4621
  */
4622
4622
  export declare interface CalculatedFieldFormula {
4623
4623
  operation: CalculatedFieldOperation;
4624
+ /** Evaluation stage of the definition, independent of its selected shelf. */
4625
+ computeStage?: 'row' | 'aggregate';
4624
4626
  /**
4625
4627
  * Array of full MetricField objects used as inputs to the calculated field.
4626
4628
  *
@@ -4648,6 +4650,32 @@ export declare interface CalculatedFieldFormula {
4648
4650
  constant?: number;
4649
4651
  }
4650
4652
 
4653
+ /** Metadata surface needed to classify a field without requiring shelf UI fields. */
4654
+ export declare type CalculatedFieldInspectable = {
4655
+ calculationRepresentation?: Field['calculationRepresentation'];
4656
+ name?: string;
4657
+ sourceField?: string;
4658
+ role?: Field['role'];
4659
+ entityName?: string;
4660
+ entityId?: string;
4661
+ qualifiedEntityName?: string;
4662
+ fieldScope?: FieldScope;
4663
+ expression?: string;
4664
+ calculatedFormula?: CalculatedFieldFormula;
4665
+ calculatedFieldOrigin?: Field['calculatedFieldOrigin'];
4666
+ derivedField?: SemaphorDerivedFieldDefinition;
4667
+ };
4668
+
4669
+ export declare type CalculatedFieldInspection = {
4670
+ representation: 'physical' | 'inline-expression' | 'manual' | 'typed-derived';
4671
+ ownership: 'local' | 'domain';
4672
+ completeness: 'not-calculated' | 'complete' | 'incomplete';
4673
+ computeStage?: 'row' | 'aggregate';
4674
+ runtimeExecutable: boolean;
4675
+ /** Compatibility mode for local runtime fields created before stage metadata. */
4676
+ legacyManual: boolean;
4677
+ };
4678
+
4651
4679
  /**
4652
4680
  * Operations supported for calculated fields
4653
4681
  */
@@ -10578,6 +10606,19 @@ export declare interface Field {
10578
10606
  */
10579
10607
  semanticTemporalPresentation?: SemanticTemporalPresentation;
10580
10608
  aggregate?: AggregateFunction;
10609
+ /** Whether this placement aggregate was supplied by the editor or authored. Omitted means unknown. */
10610
+ aggregateOrigin?: 'default' | 'explicit';
10611
+ /** Runtime representation, independent of definition ownership and shelf role. */
10612
+ calculationRepresentation?: 'inline-expression' | 'manual' | 'typed-derived';
10613
+ /** Definition identity survives timestamped shelf IDs and changes of placement role. */
10614
+ calculatedFieldOrigin?: {
10615
+ id: string;
10616
+ role?: Field['role'];
10617
+ };
10618
+ /** Provenance for display metadata on governed fields. Unmarked legacy values are semantic snapshots. */
10619
+ labelOrigin?: 'semantic' | 'override';
10620
+ /** Provenance for display formatting on governed fields. Unmarked legacy values are semantic snapshots. */
10621
+ formatOrigin?: 'semantic' | 'override';
10581
10622
  fieldScope?: FieldScope;
10582
10623
  }
10583
10624
 
@@ -10664,7 +10705,7 @@ export declare type FilterDashboardInputDefinitionUpdateResult = {
10664
10705
  */
10665
10706
  declare type FilterDisplayMode = 'canvas' | 'toolbar' | 'inherit';
10666
10707
 
10667
- declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'id' | 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role' | 'fieldScope'>> & {
10708
+ declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'id' | 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role' | 'fieldScope' | 'calculationRepresentation' | 'calculatedFieldOrigin' | 'derivedField'>> & {
10668
10709
  entityName?: Field['entityName'];
10669
10710
  entityType?: string;
10670
10711
  /** Exact database type used by server-side predicate formatting. */
@@ -10908,6 +10949,8 @@ export declare function getBriefingPreviewRun(apiServiceUrl: string, token: stri
10908
10949
 
10909
10950
  export declare function getBriefingRun(apiServiceUrl: string, token: string, briefingId: string, runId: string): Promise<BriefingRun>;
10910
10951
 
10952
+ export declare function getCalculatedFieldComputeStage(field: CalculatedFieldInspectable | null | undefined): 'row' | 'aggregate' | undefined;
10953
+
10911
10954
  export declare function getColumnDataType(column: TDataColumn): string;
10912
10955
 
10913
10956
  export declare type GetDashboardResponse = {
@@ -11087,6 +11130,13 @@ export declare type InputReference = {
11087
11130
  dimension: string;
11088
11131
  };
11089
11132
 
11133
+ /**
11134
+ * Inspect a runtime field without conflating public typed-derived metadata with
11135
+ * the dashboard-local expression/formula representation. Consumers use this
11136
+ * result for classification and stage; each compiler still owns execution.
11137
+ */
11138
+ export declare function inspectCalculatedField(field: CalculatedFieldInspectable | null | undefined): CalculatedFieldInspection;
11139
+
11090
11140
  /**
11091
11141
  * Unified Interaction type (V2)
11092
11142
  * Combines all interaction types into a single union for the new interactions array.
@@ -11220,11 +11270,6 @@ export declare function isCalculatedDimension(field: GroupByField): field is Gro
11220
11270
  expression: string;
11221
11271
  };
11222
11272
 
11223
- /**
11224
- * Generic type guard for any calculated field
11225
- */
11226
- export declare function isCalculatedField(field: Field): boolean;
11227
-
11228
11273
  /**
11229
11274
  * IMPORTANT: Why we store qualifiedFieldNames as strings instead of Field objects
11230
11275
  *
@@ -11248,6 +11293,15 @@ export declare function isColumnInSqlGen(column: TDataColumn, sqlGen: SqlGen): b
11248
11293
 
11249
11294
  export declare function isDateDataType(dataType: string): boolean;
11250
11295
 
11296
+ /**
11297
+ * True for every representation of a derived (calculated) field:
11298
+ * an expression, formula inputs, the shared-contract `derivedField`
11299
+ * (the only shape Matrix-authored calculations may carry), or a synthetic
11300
+ * calculated-field owner. Use this wherever the
11301
+ * question is "is this computed rather than stored".
11302
+ */
11303
+ export declare function isDerivedField(field: CalculatedFieldInspectable | null | undefined): boolean;
11304
+
11251
11305
  /**
11252
11306
  * Check if an export has completed (successfully or with failure)
11253
11307
  */
@@ -20003,6 +20057,10 @@ declare type MonthAlignedFiscalCalendar = {
20003
20057
 
20004
20058
  declare type NoneOptions = {};
20005
20059
 
20060
+ /** Normalize unannotated saved shapes once, before attaching placement/scope
20061
+ * metadata. Never replaces an explicit tag, even if invalid: validation owns it. */
20062
+ export declare function normalizeCalculatedFieldRepresentation<T extends CalculatedFieldInspectable>(field: T): T;
20063
+
20006
20064
  /**
20007
20065
  * Normalizes dashboard layout objects into a canonical structure:
20008
20066
  * - strips transient react-grid-layout runtime fields
@@ -22827,6 +22885,9 @@ declare type ShareRole = 'VIEWER' | 'EDITOR' | 'CONTRIBUTOR';
22827
22885
 
22828
22886
  declare type ShareScope = 'specific_tenant_user' | 'all_tenant_users' | 'specific_org_user' | 'all_org_users' | 'org_users_only' | 'all_tenants_only';
22829
22887
 
22888
+ /** Only a proven inherited default may be removed for an aggregate-stage definition. */
22889
+ export declare function shouldDropInheritedCalculationAggregate(computeStage: 'row' | 'aggregate' | undefined, aggregateOrigin: MetricField['aggregateOrigin']): boolean;
22890
+
22830
22891
  export declare interface SortByField extends Field {
22831
22892
  role: 'sortby';
22832
22893
  direction: 'asc' | 'desc';
@@ -25144,6 +25205,13 @@ export declare type TDataColumn = {
25144
25205
  expression?: string;
25145
25206
  calculatedFormula?: CalculatedFieldFormula;
25146
25207
  derivedField?: SemaphorDerivedFieldDefinition;
25208
+ fieldScope?: FieldScope;
25209
+ source?: Field['source'];
25210
+ calculatedFieldOrigin?: Field['calculatedFieldOrigin'];
25211
+ calculationRepresentation?: Field['calculationRepresentation'];
25212
+ aggregateOrigin?: Field['aggregateOrigin'];
25213
+ labelOrigin?: Field['labelOrigin'];
25214
+ formatOrigin?: Field['formatOrigin'];
25147
25215
  format?: FormatSpec;
25148
25216
  granularity?: TimeGranularity;
25149
25217
  sourceField?: string;
@@ -311,6 +311,8 @@ declare type CacheConfig = {
311
311
  */
312
312
  declare interface CalculatedFieldFormula {
313
313
  operation: CalculatedFieldOperation;
314
+ /** Evaluation stage of the definition, independent of its selected shelf. */
315
+ computeStage?: 'row' | 'aggregate';
314
316
  /**
315
317
  * Array of full MetricField objects used as inputs to the calculated field.
316
318
  *
@@ -4839,6 +4841,19 @@ declare interface Field {
4839
4841
  */
4840
4842
  semanticTemporalPresentation?: SemanticTemporalPresentation;
4841
4843
  aggregate?: AggregateFunction;
4844
+ /** Whether this placement aggregate was supplied by the editor or authored. Omitted means unknown. */
4845
+ aggregateOrigin?: 'default' | 'explicit';
4846
+ /** Runtime representation, independent of definition ownership and shelf role. */
4847
+ calculationRepresentation?: 'inline-expression' | 'manual' | 'typed-derived';
4848
+ /** Definition identity survives timestamped shelf IDs and changes of placement role. */
4849
+ calculatedFieldOrigin?: {
4850
+ id: string;
4851
+ role?: Field['role'];
4852
+ };
4853
+ /** Provenance for display metadata on governed fields. Unmarked legacy values are semantic snapshots. */
4854
+ labelOrigin?: 'semantic' | 'override';
4855
+ /** Provenance for display formatting on governed fields. Unmarked legacy values are semantic snapshots. */
4856
+ formatOrigin?: 'semantic' | 'override';
4842
4857
  fieldScope?: FieldScope;
4843
4858
  }
4844
4859
 
@@ -4903,7 +4918,7 @@ declare type FilterDashboardInputBase = DashboardInputBase & {
4903
4918
  */
4904
4919
  declare type FilterDisplayMode = 'canvas' | 'toolbar' | 'inherit';
4905
4920
 
4906
- declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'id' | 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role' | 'fieldScope'>> & {
4921
+ declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'id' | 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role' | 'fieldScope' | 'calculationRepresentation' | 'calculatedFieldOrigin' | 'derivedField'>> & {
4907
4922
  entityName?: Field['entityName'];
4908
4923
  entityType?: string;
4909
4924
  /** Exact database type used by server-side predicate formatting. */
@@ -403,6 +403,8 @@ export declare type CacheConfig = {
403
403
  */
404
404
  declare interface CalculatedFieldFormula {
405
405
  operation: CalculatedFieldOperation;
406
+ /** Evaluation stage of the definition, independent of its selected shelf. */
407
+ computeStage?: 'row' | 'aggregate';
406
408
  /**
407
409
  * Array of full MetricField objects used as inputs to the calculated field.
408
410
  *
@@ -5213,6 +5215,19 @@ declare interface Field {
5213
5215
  */
5214
5216
  semanticTemporalPresentation?: SemanticTemporalPresentation;
5215
5217
  aggregate?: AggregateFunction;
5218
+ /** Whether this placement aggregate was supplied by the editor or authored. Omitted means unknown. */
5219
+ aggregateOrigin?: 'default' | 'explicit';
5220
+ /** Runtime representation, independent of definition ownership and shelf role. */
5221
+ calculationRepresentation?: 'inline-expression' | 'manual' | 'typed-derived';
5222
+ /** Definition identity survives timestamped shelf IDs and changes of placement role. */
5223
+ calculatedFieldOrigin?: {
5224
+ id: string;
5225
+ role?: Field['role'];
5226
+ };
5227
+ /** Provenance for display metadata on governed fields. Unmarked legacy values are semantic snapshots. */
5228
+ labelOrigin?: 'semantic' | 'override';
5229
+ /** Provenance for display formatting on governed fields. Unmarked legacy values are semantic snapshots. */
5230
+ formatOrigin?: 'semantic' | 'override';
5216
5231
  fieldScope?: FieldScope;
5217
5232
  }
5218
5233
 
@@ -5277,7 +5292,7 @@ declare type FilterDashboardInputBase = DashboardInputBase & {
5277
5292
  */
5278
5293
  declare type FilterDisplayMode = 'canvas' | 'toolbar' | 'inherit';
5279
5294
 
5280
- declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'id' | 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role' | 'fieldScope'>> & {
5295
+ declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'id' | 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role' | 'fieldScope' | 'calculationRepresentation' | 'calculatedFieldOrigin' | 'derivedField'>> & {
5281
5296
  entityName?: Field['entityName'];
5282
5297
  entityType?: string;
5283
5298
  /** Exact database type used by server-side predicate formatting. */
@@ -10306,6 +10321,13 @@ export declare type TDataColumn = {
10306
10321
  expression?: string;
10307
10322
  calculatedFormula?: CalculatedFieldFormula;
10308
10323
  derivedField?: SemaphorDerivedFieldDefinition;
10324
+ fieldScope?: FieldScope;
10325
+ source?: Field['source'];
10326
+ calculatedFieldOrigin?: Field['calculatedFieldOrigin'];
10327
+ calculationRepresentation?: Field['calculationRepresentation'];
10328
+ aggregateOrigin?: Field['aggregateOrigin'];
10329
+ labelOrigin?: Field['labelOrigin'];
10330
+ formatOrigin?: Field['formatOrigin'];
10309
10331
  format?: FormatSpec;
10310
10332
  granularity?: TimeGranularity;
10311
10333
  sourceField?: string;
@@ -877,6 +877,8 @@ export declare const CALCULATED_FIELD_ENTITY_MARKER: "SEMAPHOR_CALCULATED_FIELD"
877
877
  */
878
878
  export declare interface CalculatedFieldFormula {
879
879
  operation: CalculatedFieldOperation;
880
+ /** Evaluation stage of the definition, independent of its selected shelf. */
881
+ computeStage?: 'row' | 'aggregate';
880
882
  /**
881
883
  * Array of full MetricField objects used as inputs to the calculated field.
882
884
  *
@@ -904,6 +906,32 @@ export declare interface CalculatedFieldFormula {
904
906
  constant?: number;
905
907
  }
906
908
 
909
+ /** Metadata surface needed to classify a field without requiring shelf UI fields. */
910
+ export declare type CalculatedFieldInspectable = {
911
+ calculationRepresentation?: Field['calculationRepresentation'];
912
+ name?: string;
913
+ sourceField?: string;
914
+ role?: Field['role'];
915
+ entityName?: string;
916
+ entityId?: string;
917
+ qualifiedEntityName?: string;
918
+ fieldScope?: FieldScope;
919
+ expression?: string;
920
+ calculatedFormula?: CalculatedFieldFormula;
921
+ calculatedFieldOrigin?: Field['calculatedFieldOrigin'];
922
+ derivedField?: SemaphorDerivedFieldDefinition;
923
+ };
924
+
925
+ export declare type CalculatedFieldInspection = {
926
+ representation: 'physical' | 'inline-expression' | 'manual' | 'typed-derived';
927
+ ownership: 'local' | 'domain';
928
+ completeness: 'not-calculated' | 'complete' | 'incomplete';
929
+ computeStage?: 'row' | 'aggregate';
930
+ runtimeExecutable: boolean;
931
+ /** Compatibility mode for local runtime fields created before stage metadata. */
932
+ legacyManual: boolean;
933
+ };
934
+
907
935
  /**
908
936
  * Operations supported for calculated fields
909
937
  */
@@ -1897,6 +1925,16 @@ declare interface ClickFilterInteraction {
1897
1925
  label?: string;
1898
1926
  }
1899
1927
 
1928
+ export declare function collectDatasetNamesFromExplorerField(field: ExplorerField | null | undefined, datasets: Set<string>, visitedFields?: Set<string>, visitedGroups?: Set<string>, options?: DatasetCollectionOptions): void;
1929
+
1930
+ export declare function collectDatasetNamesFromFilterGroup(filters: FilterGroup | null | undefined, datasets: Set<string>, visitedFields?: Set<string>, visitedGroups?: Set<string>, options?: DatasetCollectionOptions): void;
1931
+
1932
+ export declare function collectExecutionDatasetNamesFromExplorerField(field: ExplorerField | null | undefined, datasets: Set<string>, visitedFields?: Set<string>, visitedGroups?: Set<string>): void;
1933
+
1934
+ export declare function collectPreferredDatasetNamesFromExplorerField(field: ExplorerField | null | undefined, datasets: Set<string>): void;
1935
+
1936
+ export declare function collectQualifiedDatasetNamesFromExplorerField(field: ExplorerField | null | undefined, datasets: Set<string>, visitedFields?: Set<string>, visitedGroups?: Set<string>): void;
1937
+
1900
1938
  export declare type ColorConfig = {
1901
1939
  segments: Record<string, string>;
1902
1940
  };
@@ -4946,6 +4984,13 @@ export declare interface DataModelEntityReference extends DatabaseEntityReferenc
4946
4984
  description: string;
4947
4985
  }
4948
4986
 
4987
+ export declare type DatasetCollectionOptions = {
4988
+ /** Include datasets referenced by metric filter conditions. Default true. */
4989
+ includeMetricFilterDatasets?: boolean;
4990
+ /** Emit `qualifiedEntityName` when it is dotted, otherwise `entityName`. Default false. */
4991
+ preferQualifiedIdentity?: boolean;
4992
+ };
4993
+
4949
4994
  export declare interface DatasetEntityReference extends DatabaseEntityReference {
4950
4995
  type: 'dataset';
4951
4996
  datasetType: 'physical' | 'virtual';
@@ -4959,6 +5004,14 @@ export declare interface DatasetEntityReference extends DatabaseEntityReference
4959
5004
  description?: string;
4960
5005
  }
4961
5006
 
5007
+ /**
5008
+ * The dataset a shared analytics `source` ref names. Semantic sources are
5009
+ * the dataset name; physical sources keep database/schema/table so distinct
5010
+ * tables stay distinct. The single mapping for both the walker and the
5011
+ * calculator's identity resolver.
5012
+ */
5013
+ export declare function datasetRefFromSource(source: Field['source'] | undefined): FieldDatasetDependency | undefined;
5014
+
4962
5015
  export declare interface DataSource {
4963
5016
  connectionId: string;
4964
5017
  semanticDomainId?: string;
@@ -5026,6 +5079,9 @@ export declare type DeleteBriefingRunResponse = {
5026
5079
  deletedRunId: string;
5027
5080
  };
5028
5081
 
5082
+ /** Best available identity for a dependency: name, else qualified name. */
5083
+ export declare function dependencyDisplayIdentity(dep: FieldDatasetDependency): string;
5084
+
5029
5085
  /**
5030
5086
  * Field configuration for detail table columns.
5031
5087
  * Unlike GroupByField, DetailField does not support aggregation or granularity.
@@ -5725,6 +5781,41 @@ declare const expansionShape: z.ZodObject<{
5725
5781
  }[];
5726
5782
  }>;
5727
5783
 
5784
+ /**
5785
+ * Field dependency resolution (shared by server planning and client UX)
5786
+ * =====================================================================
5787
+ *
5788
+ * One question, answered in one place for every field representation:
5789
+ *
5790
+ * "Which datasets does this field read from?"
5791
+ *
5792
+ * Consumers:
5793
+ * - semaphor-app query planning (join resolution, filter applicability,
5794
+ * fan-out analysis) via the `collect*` functions, which keep the
5795
+ * original server API and semantics.
5796
+ * - react-semaphor field availability ("usable in this chart") via
5797
+ * `resolveFieldDatasetDependencies`, which returns full dependency
5798
+ * objects with qualified identity.
5799
+ *
5800
+ * Representations handled, in order, by ONE walker:
5801
+ * 1. A field owned by a real dataset is a leaf on that dataset, even when
5802
+ * it carries an expression (inline domain expressions, query-local
5803
+ * aliases). Synthetic owners (the calculated-field markers, the
5804
+ * `calculated_fields` group, or no owner) are never leaves.
5805
+ * 2. `calculatedFormula.inputFields`: full Field objects, walked
5806
+ * recursively.
5807
+ * 3. `derivedField.inputs[*].field.source`: the shared analytics contract,
5808
+ * used only when there are no formula inputs (both encode the same
5809
+ * inputs). Semantic sources resolve to the dataset name; physical
5810
+ * sources keep database/schema/table so `public.orders` and
5811
+ * `archive.orders` stay distinct. This is the only representation
5812
+ * Matrix-authored calculations may carry.
5813
+ * 4. Metric filter conditions (`parameters.filters`), when requested.
5814
+ *
5815
+ * Adding a representation means adding it here, once.
5816
+ */
5817
+ declare type ExplorerField = Field | GroupByField | MetricField;
5818
+
5728
5819
  export declare type ExportDataPayload = {
5729
5820
  cardId: string;
5730
5821
  title: string;
@@ -5800,9 +5891,46 @@ export declare interface Field {
5800
5891
  */
5801
5892
  semanticTemporalPresentation?: SemanticTemporalPresentation;
5802
5893
  aggregate?: AggregateFunction;
5894
+ /** Whether this placement aggregate was supplied by the editor or authored. Omitted means unknown. */
5895
+ aggregateOrigin?: 'default' | 'explicit';
5896
+ /** Runtime representation, independent of definition ownership and shelf role. */
5897
+ calculationRepresentation?: 'inline-expression' | 'manual' | 'typed-derived';
5898
+ /** Definition identity survives timestamped shelf IDs and changes of placement role. */
5899
+ calculatedFieldOrigin?: {
5900
+ id: string;
5901
+ role?: Field['role'];
5902
+ };
5903
+ /** Provenance for display metadata on governed fields. Unmarked legacy values are semantic snapshots. */
5904
+ labelOrigin?: 'semantic' | 'override';
5905
+ /** Provenance for display formatting on governed fields. Unmarked legacy values are semantic snapshots. */
5906
+ formatOrigin?: 'semantic' | 'override';
5803
5907
  fieldScope?: FieldScope;
5804
5908
  }
5805
5909
 
5910
+ export declare type FieldDatasetDependency = {
5911
+ /**
5912
+ * Dataset name as the catalog knows it (entityName / datasetName / table).
5913
+ * Empty string when the source carried only a qualified name.
5914
+ */
5915
+ entityName: string;
5916
+ entityId?: string;
5917
+ /** Qualified identity when known (`schema.table`, `db.schema.table`, or the field's qualifiedEntityName). */
5918
+ qualifiedEntityName?: string;
5919
+ /** Human label when the source carried one. */
5920
+ label?: string;
5921
+ };
5922
+
5923
+ export declare type FieldDependencyResolution = {
5924
+ /** Unique datasets, in first-seen order. */
5925
+ datasets: FieldDatasetDependency[];
5926
+ /**
5927
+ * False when at least one input could not be traced to a dataset (for
5928
+ * example a metric-to-metric reference that was not expanded into input
5929
+ * fields). Callers must not claim the field is available in that case.
5930
+ */
5931
+ complete: boolean;
5932
+ };
5933
+
5806
5934
  export declare type FieldScope = 'card' | 'sheet' | 'dashboard' | 'domain';
5807
5935
 
5808
5936
  declare type FileAttachment = {
@@ -5864,7 +5992,7 @@ declare type FilterDashboardInputBase = DashboardInputBase & {
5864
5992
  */
5865
5993
  declare type FilterDisplayMode = 'canvas' | 'toolbar' | 'inherit';
5866
5994
 
5867
- export declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'id' | 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role' | 'fieldScope'>> & {
5995
+ export declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'id' | 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role' | 'fieldScope' | 'calculationRepresentation' | 'calculatedFieldOrigin' | 'derivedField'>> & {
5868
5996
  entityName?: Field['entityName'];
5869
5997
  entityType?: string;
5870
5998
  /** Exact database type used by server-side predicate formatting. */
@@ -6042,6 +6170,8 @@ export declare type FormatSpec = {
6042
6170
  suffix?: string;
6043
6171
  } | TemporalBucketFormat;
6044
6172
 
6173
+ export declare function getCalculatedFieldComputeStage(field: CalculatedFieldInspectable | null | undefined): 'row' | 'aggregate' | undefined;
6174
+
6045
6175
  export declare type GetDashboardResponse = {
6046
6176
  dashboard: TDashboard;
6047
6177
  initialReportContext: ReportRuntimeContext;
@@ -6117,6 +6247,9 @@ export declare type HtmlOptions = {
6117
6247
  html: string;
6118
6248
  };
6119
6249
 
6250
+ /** Humanize a catalog dataset name for customer-facing copy. */
6251
+ export declare function humanizeDatasetName(name: string, labels?: Record<string, string>): string;
6252
+
6120
6253
  declare interface InlineDrillEvent extends BaseInteractionEvent {
6121
6254
  interactionMode: 'inlineDrill';
6122
6255
  fetchMode?: 'lazy' | 'preloaded';
@@ -6169,6 +6302,13 @@ export declare type InputReference = {
6169
6302
  dimension: string;
6170
6303
  };
6171
6304
 
6305
+ /**
6306
+ * Inspect a runtime field without conflating public typed-derived metadata with
6307
+ * the dashboard-local expression/formula representation. Consumers use this
6308
+ * result for classification and stage; each compiler still owns execution.
6309
+ */
6310
+ export declare function inspectCalculatedField(field: CalculatedFieldInspectable | null | undefined): CalculatedFieldInspection;
6311
+
6172
6312
  /**
6173
6313
  * Unified Interaction type (V2)
6174
6314
  * Combines all interaction types into a single union for the new interactions array.
@@ -6271,11 +6411,6 @@ export declare function isCalculatedDimension(field: GroupByField): field is Gro
6271
6411
  expression: string;
6272
6412
  };
6273
6413
 
6274
- /**
6275
- * Generic type guard for any calculated field
6276
- */
6277
- export declare function isCalculatedField(field: Field): boolean;
6278
-
6279
6414
  /**
6280
6415
  * IMPORTANT: Why we store qualifiedFieldNames as strings instead of Field objects
6281
6416
  *
@@ -6295,6 +6430,15 @@ export declare function isCalculatedMetric(field: Field): field is MetricField &
6295
6430
  expression: string;
6296
6431
  };
6297
6432
 
6433
+ /**
6434
+ * True for every representation of a derived (calculated) field:
6435
+ * an expression, formula inputs, the shared-contract `derivedField`
6436
+ * (the only shape Matrix-authored calculations may carry), or a synthetic
6437
+ * calculated-field owner. Use this wherever the
6438
+ * question is "is this computed rather than stored".
6439
+ */
6440
+ export declare function isDerivedField(field: CalculatedFieldInspectable | null | undefined): boolean;
6441
+
6298
6442
  export declare interface Join {
6299
6443
  id: string;
6300
6444
  source: DatabaseEntityReference;
@@ -6597,6 +6741,10 @@ declare type MonthAlignedFiscalCalendar = {
6597
6741
 
6598
6742
  declare type NoneOptions = {};
6599
6743
 
6744
+ /** Normalize unannotated saved shapes once, before attaching placement/scope
6745
+ * metadata. Never replaces an explicit tag, even if invalid: validation owns it. */
6746
+ export declare function normalizeCalculatedFieldRepresentation<T extends CalculatedFieldInspectable>(field: T): T;
6747
+
6600
6748
  export declare type NormalizedDashboardInput = NormalizedFilterDashboardInput | ControlDashboardInput;
6601
6749
 
6602
6750
  /** Runtime form after dashboard-filter references are resolved once. */
@@ -8729,6 +8877,14 @@ declare type ResolvedValueFormatPreferenceSources = {
8729
8877
  defaultCurrency: ReportPreferenceSource;
8730
8878
  };
8731
8879
 
8880
+ /**
8881
+ * Resolve the datasets a field reads from, with qualified identity.
8882
+ * Base fields resolve to their own dataset; calculated fields resolve
8883
+ * through their inputs. Metric filter datasets are not included: they do
8884
+ * not affect whether the field itself can be added.
8885
+ */
8886
+ export declare function resolveFieldDatasetDependencies(field: Field): FieldDependencyResolution;
8887
+
8732
8888
  export declare function resolveQueryColumnKeyMapEntry(columnKeyMap: QueryColumnKeyMap_2 | undefined, fieldId: string, role: QueryColumnKeyRole): QueryColumnKeyMapEntry | undefined;
8733
8889
 
8734
8890
  export declare function resolveUniqueQueryColumnKeyMapEntry(columnKeyMap: QueryColumnKeyMap_2 | undefined, fieldId: string): QueryColumnKeyMapEntry | undefined;
@@ -9005,6 +9161,9 @@ declare type SemaphorSourceRef = {
9005
9161
 
9006
9162
  declare type SemaphorTimeGrain = (typeof SEMAPHOR_TIME_GRAINS)[number];
9007
9163
 
9164
+ /** Only a proven inherited default may be removed for an aggregate-stage definition. */
9165
+ export declare function shouldDropInheritedCalculationAggregate(computeStage: 'row' | 'aggregate' | undefined, aggregateOrigin: MetricField['aggregateOrigin']): boolean;
9166
+
9008
9167
  export declare interface SortByField extends Field {
9009
9168
  role: 'sortby';
9010
9169
  direction: 'asc' | 'desc';
@@ -11231,6 +11390,13 @@ export declare type TDataColumn = {
11231
11390
  expression?: string;
11232
11391
  calculatedFormula?: CalculatedFieldFormula;
11233
11392
  derivedField?: SemaphorDerivedFieldDefinition;
11393
+ fieldScope?: FieldScope;
11394
+ source?: Field['source'];
11395
+ calculatedFieldOrigin?: Field['calculatedFieldOrigin'];
11396
+ calculationRepresentation?: Field['calculationRepresentation'];
11397
+ aggregateOrigin?: Field['aggregateOrigin'];
11398
+ labelOrigin?: Field['labelOrigin'];
11399
+ formatOrigin?: Field['formatOrigin'];
11234
11400
  format?: FormatSpec;
11235
11401
  granularity?: TimeGranularity;
11236
11402
  sourceField?: string;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.497",
8
+ "version": "0.1.499",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",