react-semaphor 0.1.526 → 0.1.527

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 (175) hide show
  1. package/DATA_APP_SDK.md +5 -1
  2. package/dist/analytics-protocol/index.js +1179 -296
  3. package/dist/brand-studio/index.js +15 -15
  4. package/dist/briefings/index.js +50 -49
  5. package/dist/chunks/{calculated-field-identity-D1ofR4KJ.js → calculated-field-identity-DEhjPSr-.js} +66 -65
  6. package/dist/chunks/{card-config-utils-9sv4e-Vb.js → card-config-utils-BlIbwkuD.js} +68 -65
  7. package/dist/chunks/{constants-DeLIHVAW.js → constants-DNWVy8Y3.js} +4 -4
  8. package/dist/chunks/dashboard-JNHR0_cZ.js +14 -0
  9. package/dist/chunks/{dashboard-briefing-launcher-DXz1GhFZ.js → dashboard-briefing-launcher-D9pFByPh.js} +372 -359
  10. package/dist/chunks/{dashboard-controls-Df8qOSrs.js → dashboard-controls-CJI5ZWMq.js} +739 -686
  11. package/dist/chunks/{dashboard-json-Xldp0qww.js → dashboard-json-DLdrFry-.js} +10 -10
  12. package/dist/chunks/{edit-dashboard-visual-COHBqyic.js → edit-dashboard-visual-D5LjWle1.js} +6603 -6572
  13. package/dist/chunks/{editor-action-buttons-DahlP57T.js → editor-action-buttons-G91NQKxU.js} +266 -267
  14. package/dist/chunks/{field-aggregations-BQjogiI1.js → field-aggregations-DeVQLIsP.js} +19 -19
  15. package/dist/chunks/{field-dependencies-v-lJNzC7.js → field-dependencies-CGYic38w.js} +1 -1
  16. package/dist/chunks/{index-CbjuruKe.js → index-BvJOYbNv.js} +755 -745
  17. package/dist/chunks/{matrix-analytical-definition-BimC4XIV.js → matrix-analytical-definition-BJyH5-99.js} +1 -1
  18. package/dist/chunks/{matrix-card-CIlz0Dnp.js → matrix-card-DY45yiUM.js} +7 -6
  19. package/dist/chunks/{matrix-control-sources-2VAzGlt8.js → matrix-control-sources-BypfLZsK.js} +11 -11
  20. package/dist/chunks/{matrix-definition-E5gXXSTZ.js → matrix-definition-Cdn3LoxW.js} +3 -3
  21. package/dist/chunks/{semantic-format-Baqp8kD_.js → matrix-formatter-BoKU3MzZ.js} +655 -511
  22. package/dist/chunks/{matrix-member-presentation-Bw7-JCrr.js → matrix-member-presentation-BBW0n1iY.js} +1 -1
  23. package/dist/chunks/matrix-operation-contract-BV02rLhu.js +809 -0
  24. package/dist/chunks/{metric-comparison-BphoJ9bq.js → metric-comparison-Crljx_XY.js} +15 -10
  25. package/dist/chunks/{numeric-presentation-VhMUHfrJ.js → numeric-presentation-LvnNY5Ma.js} +68 -68
  26. package/dist/chunks/pivot-header-presentation-D5v8uyjj.js +618 -0
  27. package/dist/chunks/{pivot-result-identity-BzUQiCEV.js → pivot-result-identity-CY__BuwI.js} +1 -1
  28. package/dist/chunks/{pivot-result-lifecycle-BFO354lk.js → pivot-result-lifecycle-BWrPhlGT.js} +259 -204
  29. package/dist/chunks/{raw-temporal-7bFbXd2a.js → raw-temporal-CdnA_OXJ.js} +10 -10
  30. package/dist/chunks/{raw-temporal-contract-BQZIJ1fn.js → raw-temporal-contract-Bc9z83t-.js} +1 -1
  31. package/dist/chunks/relative-date-DAF9J7mt.js +456 -0
  32. package/dist/chunks/{report-preferences-dialog-BcH-0lR-.js → report-preferences-dialog-D3hxu4sE.js} +131 -132
  33. package/dist/chunks/{report-runtime-context-CxIoGyNM.js → report-runtime-context-CtaGGlit.js} +1 -1
  34. package/dist/chunks/{selection-reducer-NF5C07yM.js → selection-reducer-C7Um5XN-.js} +47 -26
  35. package/dist/chunks/semantic-format-BjBMOSoo.js +192 -0
  36. package/dist/chunks/{semaphor-ready-indicator-BLRDuLr4.js → semaphor-ready-indicator-D46I_4g7.js} +49895 -46141
  37. package/dist/chunks/{slider-BYIH4icg.js → slider-B6LELqx6.js} +81 -82
  38. package/dist/chunks/{source-entity-resolution-Bzefiive.js → source-entity-resolution-Bde29mqE.js} +25 -25
  39. package/dist/chunks/switch-_7uBAbYx.js +24003 -0
  40. package/dist/chunks/{temporal-bucket-PcLFSYWX.js → temporal-bucket-DlFuhCnT.js} +6 -6
  41. package/dist/chunks/{temporal-bucket-contract-DTLDRzgV.js → temporal-bucket-contract-C6lUGPS3.js} +1 -1
  42. package/dist/chunks/temporal-input-presentation-DyMWCZYh.js +195 -0
  43. package/dist/chunks/{token-types-BC6RcUY8.js → token-types-UjyNz95-.js} +1 -1
  44. package/dist/chunks/{validators-CsdOtZI6.js → validators-CQcG0EPN.js} +852 -731
  45. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
  46. package/dist/dashboard/index.js +1 -1
  47. package/dist/dashboard-authoring/index.js +138 -137
  48. package/dist/data-app-sdk/index.js +12 -12
  49. package/dist/data-app-sdk-adapters/index.js +23 -22
  50. package/dist/data-app-sdk-validation/index.js +27 -26
  51. package/dist/format-utils/index.js +247 -329
  52. package/dist/index.js +165 -168
  53. package/dist/report-runtime-context/index.js +2 -2
  54. package/dist/style.css +1 -1
  55. package/dist/surfboard/index.js +1 -1
  56. package/dist/types/briefings/index.d.ts +3 -0
  57. package/dist/types/components/explorer/filters/card-date-filter.d.ts +13 -5
  58. package/dist/types/components/explorer/filters/card-date-selection.d.ts +28 -0
  59. package/dist/types/components/sharing-and-management/dashboard-actions-menu.d.ts +1 -1
  60. package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -1
  61. package/dist/types/components/surfboard/download-settings-dialog.d.ts +8 -0
  62. package/dist/types/components/surfboard/filter/types.d.ts +8 -29
  63. package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +5 -1
  64. package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -2
  65. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -21
  66. package/dist/types/components/ui-custom/report-calendar.d.ts +18 -0
  67. package/dist/types/components/visual/aggregated-table/utils/export-utils.d.ts +3 -5
  68. package/dist/types/components/visual/data-table/data-table-toolbar.d.ts +1 -1
  69. package/dist/types/components/visual/pivot-table/utils/pivot-table-export-utils.d.ts +3 -1
  70. package/dist/types/index.js +5 -5
  71. package/dist/types/lib/api/exports-api.d.ts +3 -0
  72. package/dist/types/lib/csv-download.d.ts +9 -0
  73. package/dist/types/lib/csv-encoding-options.d.ts +6 -0
  74. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +2 -1
  75. package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +0 -1
  76. package/dist/types/lib/document/document-input-runtime.d.ts +2 -1
  77. package/dist/types/lib/export-utils.d.ts +17 -15
  78. package/dist/types/lib/hooks/explorer/use-filter-builder.d.ts +2 -2
  79. package/dist/types/lib/hooks/use-relative-date-summarizer.d.ts +7 -0
  80. package/dist/types/lib/matrix-table/matrix-application-adapter.d.ts +3 -2
  81. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  82. package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +1 -1
  83. package/dist/types/lib/matrix-table/matrix-dataset-history.d.ts +47 -0
  84. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +7 -3
  85. package/dist/types/lib/matrix-table/matrix-execution-context.d.ts +2 -0
  86. package/dist/types/lib/matrix-table/matrix-query-transport.d.ts +4 -1
  87. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +105 -4
  88. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +43 -2
  89. package/dist/types/lib/matrix-table/use-matrix.d.ts +6 -0
  90. package/dist/types/lib/query-context/build-card-query-context.d.ts +5 -1
  91. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +0 -1
  92. package/dist/types/lib/query-context/build-global-date-comparison-context.d.ts +1 -2
  93. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +1 -2
  94. package/dist/types/lib/query-context/dashboard-card-query-key.d.ts +10 -0
  95. package/dist/types/lib/query-context/query-auth-scope.d.ts +5 -0
  96. package/dist/types/lib/stores/dashboard-store.d.ts +9 -4
  97. package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -2
  98. package/dist/types/lib/types/common-types.d.ts +5 -0
  99. package/dist/types/lib/types/explorer-types.d.ts +14 -0
  100. package/dist/types/lib/types/token-types.d.ts +0 -1
  101. package/dist/types/lib/utils/card-definition.d.ts +1 -1
  102. package/dist/types/lib/utils/date-timezone-utils.d.ts +4 -46
  103. package/dist/types/lib/utils/filter-default-value-utils.d.ts +8 -2
  104. package/dist/types/lib/utils/inline-filter-utils.d.ts +3 -2
  105. package/dist/types/lib/utils/relative-date-description.d.ts +38 -0
  106. package/dist/types/shared/analytics-protocol/contracts.d.ts +10 -7
  107. package/dist/types/shared/analytics-protocol/index.d.ts +12 -1
  108. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +20 -20
  109. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
  110. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
  111. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +51 -5
  112. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +9 -3
  113. package/dist/types/shared/analytics-protocol/operation-temporal-state.d.ts +64 -0
  114. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +61 -0
  115. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +20 -0
  116. package/dist/types/shared/analytics-protocol/runtime-schemas.d.ts +0 -2
  117. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +314 -0
  118. package/dist/types/shared/analytics-protocol/time-window.d.ts +13 -0
  119. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +8 -4
  120. package/dist/types/shared/format-utils/exporters/csv-utils.d.ts +46 -15
  121. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -3
  122. package/dist/types/shared/format-utils/flat-table-export-totals.d.ts +2 -1
  123. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +2 -2
  124. package/dist/types/shared/format-utils/types/format-types.d.ts +0 -42
  125. package/dist/types/shared/temporal/calendar-periods.d.ts +56 -0
  126. package/dist/types/shared/temporal/index.d.ts +5 -0
  127. package/dist/types/shared/temporal/relative-date.d.ts +21 -0
  128. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +73 -0
  129. package/dist/types/shared/temporal/time-window-periods.d.ts +21 -0
  130. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +23 -0
  131. package/package.json +1 -17
  132. package/src/data-app-sdk/README.md +6 -3
  133. package/dist/chunks/code-highlight-994tgM9v.js +0 -22265
  134. package/dist/chunks/dashboard-CsHvEtjN.js +0 -15
  135. package/dist/chunks/dashboard-date-comparison-definition-BqNhECUr.js +0 -183
  136. package/dist/chunks/matrix-formatter-WBgtebUT.js +0 -341
  137. package/dist/chunks/matrix-operation-contract-D32U2CSw.js +0 -1802
  138. package/dist/chunks/mouse-pointer-2-BZvGk45-.js +0 -19
  139. package/dist/chunks/pivot-header-presentation-CGtudHo7.js +0 -661
  140. package/dist/chunks/pre-block-Cq1RqhZX.js +0 -3987
  141. package/dist/chunks/search-CJz-QQ0Q.js +0 -24
  142. package/dist/chunks/switch-XaAACBrJ.js +0 -2234
  143. package/dist/chunks/temporal-input-presentation-2RJrvmYL.js +0 -222
  144. package/dist/chunks/update-policy-DhAUtiC8.js +0 -913
  145. package/dist/data-app-builder/index.js +0 -3666
  146. package/dist/data-app-builder-browser-runtime/index.js +0 -8
  147. package/dist/data-app-codegen/index.js +0 -22
  148. package/dist/data-app-codegen-node/index.js +0 -1807
  149. package/dist/types/components/data-app-runtime/published-data-app-runtime.d.ts +0 -7
  150. package/dist/types/components/surfboard/json-to-csv.d.ts +0 -7
  151. package/dist/types/components/visual/data-table/utils/export-utils.d.ts +0 -31
  152. package/dist/types/data-app-builder/browser-runtime.d.ts +0 -174
  153. package/dist/types/data-app-builder/constants.d.ts +0 -14
  154. package/dist/types/data-app-builder/data-app-builder.d.ts +0 -14
  155. package/dist/types/data-app-builder/index.d.ts +0 -1
  156. package/dist/types/data-app-builder/lib/api.d.ts +0 -36
  157. package/dist/types/data-app-builder/lib/context-select.d.ts +0 -3
  158. package/dist/types/data-app-builder/lib/diagnostics.d.ts +0 -12
  159. package/dist/types/data-app-builder/lib/file-tree.d.ts +0 -2
  160. package/dist/types/data-app-builder/types.d.ts +0 -558
  161. package/dist/types/data-app-builder-browser-runtime.d.ts +0 -2
  162. package/dist/types/data-app-builder.d.ts +0 -2
  163. package/dist/types/data-app-codegen/generate-contract.d.ts +0 -26
  164. package/dist/types/data-app-codegen/generated-contract-files.d.ts +0 -7
  165. package/dist/types/data-app-codegen/generated-contract-validation.d.ts +0 -13
  166. package/dist/types/data-app-codegen/index.d.ts +0 -6
  167. package/dist/types/data-app-codegen/live-execution.d.ts +0 -42
  168. package/dist/types/data-app-codegen/node.d.ts +0 -2
  169. package/dist/types/data-app-codegen/update-policy.d.ts +0 -25
  170. package/dist/types/data-app-codegen/validation.d.ts +0 -8
  171. package/dist/types/data-app-codegen-node.d.ts +0 -2
  172. package/dist/types/data-app-codegen.d.ts +0 -2
  173. package/dist/types/shared/analytics-protocol/data-app-codegen-summary.d.ts +0 -418
  174. package/dist/types/shared/format-utils/exporters/pivot-exporter.d.ts +0 -13
  175. package/dist/types/shared/format-utils/exporters/table-exporter.d.ts +0 -10
@@ -1,558 +0,0 @@
1
- import { BrowserSandboxFilePlan, BrowserSandboxRuntimeManifest } from './browser-runtime.js';
2
- import { SemaphorAnalyticsIntent, SemaphorFieldRef, SemaphorInputOperator, SemaphorSourceRef } from '../shared/analytics-protocol/index.js';
3
- export type Path = 'browser' | 'bridge';
4
- export type StepState = 'idle' | 'running' | 'done' | 'blocked';
5
- export type RunStatus = 'running' | 'done' | 'failed' | 'cancelled';
6
- export type AgentStep = {
7
- id: string;
8
- label: string;
9
- detail: string;
10
- state: StepState;
11
- startedAt?: number;
12
- durationMs?: number;
13
- };
14
- export type BridgeCommandResult = {
15
- command: string;
16
- durationMs: number;
17
- exitCode: number;
18
- ok: boolean;
19
- stdout: string;
20
- stderr: string;
21
- };
22
- export type BridgeResult = {
23
- ok: boolean;
24
- projectRoot?: string;
25
- provider?: string;
26
- validation?: 'typecheck' | 'build' | 'write-policy-validation' | 'import-validation' | 'data-api-validation';
27
- changedFiles?: string[];
28
- summary?: string;
29
- changes?: Array<{
30
- kind: 'add' | 'edit' | 'remove';
31
- label: string;
32
- }>;
33
- files?: Array<{
34
- path: string;
35
- size: number;
36
- }>;
37
- generationMeta?: {
38
- model: string;
39
- strategy: string;
40
- reasoningEffort?: string;
41
- durationMs: number;
42
- outputChars?: number;
43
- fallbackFrom?: {
44
- strategy: string;
45
- reason: string;
46
- };
47
- };
48
- attempts?: Array<{
49
- label: string;
50
- ok: boolean;
51
- command: BridgeCommandResult;
52
- }>;
53
- command?: BridgeCommandResult;
54
- importValidation?: {
55
- ok: boolean;
56
- diagnostics: string[];
57
- };
58
- writePolicyValidation?: {
59
- ok: boolean;
60
- diagnostics: string[];
61
- };
62
- dataApiValidation?: {
63
- ok: boolean;
64
- diagnostics: string[];
65
- };
66
- telemetry?: {
67
- contextFileCount?: number;
68
- contextChars?: number;
69
- generatedFileCount?: number;
70
- generatedChars?: number;
71
- repairAttempts?: number;
72
- };
73
- filePlan?: BrowserSandboxFilePlan;
74
- error?: string;
75
- };
76
- export type BridgeReadFilesResult = {
77
- ok: boolean;
78
- projectRoot?: string;
79
- files?: Array<{
80
- path: string;
81
- contents: string;
82
- }>;
83
- error?: string;
84
- };
85
- export type WorkspaceContext = {
86
- projectRoot?: string;
87
- framework?: string;
88
- packageManager?: string;
89
- runtimeManifest?: BrowserSandboxRuntimeManifest;
90
- packageJson?: {
91
- dependencies?: Record<string, string>;
92
- devDependencies?: Record<string, string>;
93
- scripts?: Record<string, string>;
94
- };
95
- componentsJson?: unknown;
96
- tsconfig?: {
97
- baseUrl?: string | null;
98
- paths?: Record<string, string[]>;
99
- jsx?: string | null;
100
- strict?: boolean | null;
101
- noUnusedLocals?: boolean | null;
102
- noUnusedParameters?: boolean | null;
103
- };
104
- files?: {
105
- source?: string[];
106
- root?: string[];
107
- snapshot?: string[];
108
- editable?: string[];
109
- editableGlobs?: string[];
110
- approvalRequiredGlobs?: string[];
111
- styleEntries?: string[];
112
- localModules?: string[];
113
- };
114
- validation?: {
115
- typecheck?: string | null;
116
- build?: string | null;
117
- };
118
- capabilities?: unknown;
119
- };
120
- export type BridgeWorkspaceContextResult = {
121
- ok: boolean;
122
- workspaceContext?: WorkspaceContext;
123
- error?: string;
124
- };
125
- export type GeneratedRevision = {
126
- provider?: string;
127
- summary?: string;
128
- changes?: BridgeResult['changes'];
129
- files: Array<{
130
- path: string;
131
- contents: string;
132
- }>;
133
- plan?: BrowserSandboxFilePlan;
134
- generationMeta?: BridgeResult['generationMeta'];
135
- attemptLabel?: string;
136
- };
137
- export type BuilderTurnMode = 'answer' | 'clarify' | 'edit' | 'read_files';
138
- export type DataAppOperationType = 'answer_question' | 'inspect_data' | 'inspect_files' | 'create_app' | 'add_view' | 'modify_view' | 'remove_view' | 'add_input' | 'modify_input' | 'remove_input' | 'change_layout' | 'change_style' | 'fix_error' | 'save_draft' | 'publish';
139
- export type DataAppOperationTarget = {
140
- id?: string;
141
- label?: string;
142
- kind?: string;
143
- filePath?: string;
144
- sourceId?: string;
145
- viewId?: string;
146
- inputId?: string;
147
- previousReference?: string;
148
- };
149
- export type DataAppOperationPlan = {
150
- schemaVersion: 'data-app-operation/v1';
151
- type: DataAppOperationType;
152
- userGoal: string;
153
- target?: DataAppOperationTarget;
154
- /**
155
- * Shared analytics protocol intent for data-bearing work. This is the same
156
- * contract consumed by the Data App SDK/server executor, not a Data
157
- * App-specific query shape.
158
- */
159
- analyticsIntent?: SemaphorAnalyticsIntent;
160
- inputIds?: string[];
161
- requiredInspections?: Array<'data' | 'files' | 'preview' | 'diagnostics'>;
162
- confidence?: 'low' | 'medium' | 'high';
163
- rationale?: string;
164
- };
165
- export type DataAppIntentSource = {
166
- id: string;
167
- label?: string;
168
- ref: SemaphorSourceRef;
169
- role?: 'primary' | 'lookup' | 'supporting';
170
- };
171
- export type DataAppIntentInput = {
172
- id: string;
173
- label: string;
174
- kind: 'filter' | 'control';
175
- field?: SemaphorFieldRef;
176
- sourceId?: string;
177
- operator?: SemaphorInputOperator;
178
- multi?: boolean;
179
- defaultValue?: unknown;
180
- affects?: string[];
181
- };
182
- export type DataAppIntentViewKind = 'kpi' | 'line_chart' | 'bar_chart' | 'area_chart' | 'pie_chart' | 'table' | 'text' | 'custom';
183
- export type DataAppIntentView = {
184
- id: string;
185
- title: string;
186
- description?: string;
187
- kind: DataAppIntentViewKind;
188
- /**
189
- * Canonical governed analytics question for this view. Generated React
190
- * should render it through react-semaphor/data-app-sdk hooks.
191
- */
192
- analytics?: SemaphorAnalyticsIntent;
193
- sourceIds?: string[];
194
- inputIds?: string[];
195
- };
196
- export type DataAppIntentInteraction = {
197
- id: string;
198
- kind: 'filter_affects_view' | 'drilldown' | 'navigation' | 'selection';
199
- fromId: string;
200
- toIds: string[];
201
- };
202
- export type DataAppIntentLayout = {
203
- style?: 'dashboard' | 'workflow' | 'report' | 'custom';
204
- sections?: Array<{
205
- id: string;
206
- title?: string;
207
- viewIds: string[];
208
- }>;
209
- };
210
- export type DataAppIntentManifest = {
211
- schemaVersion: 'data-app-intent/v1';
212
- app: {
213
- title: string;
214
- description?: string;
215
- goal?: string;
216
- };
217
- sources: DataAppIntentSource[];
218
- inputs: DataAppIntentInput[];
219
- views: DataAppIntentView[];
220
- interactions?: DataAppIntentInteraction[];
221
- layout?: DataAppIntentLayout;
222
- };
223
- export type DataAppBuilderDatasetInspectorArtifact = {
224
- id: string;
225
- type: 'dataset_inspector';
226
- title: string;
227
- domain: {
228
- id: string;
229
- name: string;
230
- label: string;
231
- };
232
- dataset: {
233
- id?: string | null;
234
- name: string;
235
- label?: string | null;
236
- analyticsRole?: string | null;
237
- primaryDateField?: string | null;
238
- };
239
- counts: {
240
- total: number;
241
- dimensions: number;
242
- measures: number;
243
- dates: number;
244
- identifiers: number;
245
- calculated: number;
246
- };
247
- fields: Array<{
248
- name: string;
249
- label?: string;
250
- role?: string;
251
- dataType?: string;
252
- source: 'physical' | 'calculated';
253
- }>;
254
- };
255
- export type DataAppBuilderArtifact = DataAppBuilderDatasetInspectorArtifact;
256
- export type DataAppBuilderUiAction = {
257
- type: 'open_dataset_inspector';
258
- artifactId: string;
259
- };
260
- export type DataAppBuilderAttachment = {
261
- id: string;
262
- type: 'screenshot';
263
- name: string;
264
- imageUrl: string;
265
- mediaType: string;
266
- createdAt: number;
267
- } | {
268
- id: string;
269
- type: 'dom-selection';
270
- name: string;
271
- text: string;
272
- createdAt: number;
273
- };
274
- export type BuilderTurn = {
275
- mode: BuilderTurnMode;
276
- message: string;
277
- operation?: DataAppOperationPlan;
278
- intentManifest?: DataAppIntentManifest;
279
- toolEvents?: Array<{
280
- tool: string;
281
- status: string;
282
- detail?: string;
283
- }>;
284
- requestedFiles?: string[];
285
- revision?: GeneratedRevision;
286
- artifacts?: DataAppBuilderArtifact[];
287
- uiActions?: DataAppBuilderUiAction[];
288
- };
289
- export type BuilderTurnResult = {
290
- ok: boolean;
291
- turn?: BuilderTurn;
292
- error?: string;
293
- };
294
- export type DataAppBuilderTurnProgressPhase = 'received' | 'authenticating' | 'routing' | 'inspecting_data' | 'reading_files' | 'planning_revision' | 'generating_code' | 'done';
295
- export type DataAppBuilderTurnProgress = {
296
- phase: DataAppBuilderTurnProgressPhase;
297
- label: string;
298
- detail?: string;
299
- };
300
- export type ApiStatus = {
301
- ok: boolean;
302
- appBuilder?: {
303
- hasOpenAiKey: boolean;
304
- environment: string;
305
- deploymentUrl: string | null;
306
- };
307
- error?: string;
308
- };
309
- export type UserMessage = {
310
- id: string;
311
- type: 'user';
312
- content: string;
313
- createdAt: number;
314
- attachments?: DataAppBuilderAttachment[];
315
- };
316
- export type RunMessage = {
317
- id: string;
318
- type: 'run';
319
- prompt: string;
320
- status: RunStatus;
321
- steps: AgentStep[];
322
- createdAt: number;
323
- startedAt: number;
324
- finishedAt?: number;
325
- result?: BridgeResult;
326
- error?: string;
327
- };
328
- export type AssistantMessage = {
329
- id: string;
330
- type: 'assistant';
331
- content: string;
332
- createdAt: number;
333
- tone?: 'default' | 'guidance' | 'blocked';
334
- artifacts?: DataAppBuilderArtifact[];
335
- operation?: DataAppOperationPlan;
336
- intentManifest?: DataAppIntentManifest;
337
- };
338
- export type ChatMessage = UserMessage | AssistantMessage | RunMessage;
339
- export type BuilderConversationMessage = {
340
- role: 'user' | 'assistant' | 'system';
341
- content: string;
342
- };
343
- export type BuilderConversationContext = {
344
- messages: BuilderConversationMessage[];
345
- activeTarget?: string;
346
- lastSuccessfulRun?: {
347
- prompt: string;
348
- changedFiles: string[];
349
- summary?: string;
350
- filePlan?: BrowserSandboxFilePlan;
351
- };
352
- lastOperation?: DataAppOperationPlan;
353
- intentManifest?: DataAppIntentManifest;
354
- };
355
- export type ReasoningEffort = 'low' | 'medium' | 'high';
356
- export type ModelPreset = {
357
- id: string;
358
- label: string;
359
- model: string;
360
- reasoningEffort?: ReasoningEffort;
361
- };
362
- export type DataAppBuilderTurnRequest = {
363
- projectId: string;
364
- message: string;
365
- currentFiles: NonNullable<BridgeReadFilesResult['files']>;
366
- workspaceContext: WorkspaceContext;
367
- conversationContext?: BuilderConversationContext;
368
- attachments?: DataAppBuilderAttachment[];
369
- diagnostics?: string[];
370
- repair?: boolean;
371
- allowFileReads?: boolean;
372
- generationModel: string;
373
- generationReasoningEffort?: ReasoningEffort;
374
- repairModel: string;
375
- repairReasoningEffort?: ReasoningEffort;
376
- stream?: boolean;
377
- };
378
- export type DataAppBuilderAdapters = {
379
- readStatus?: (options: {
380
- apiServiceUrl?: string;
381
- accessToken?: string;
382
- signal: AbortSignal;
383
- }) => Promise<ApiStatus>;
384
- runTurn?: (request: DataAppBuilderTurnRequest, options: {
385
- apiServiceUrl?: string;
386
- accessToken?: string;
387
- signal: AbortSignal;
388
- onProgress?: (progress: DataAppBuilderTurnProgress) => void;
389
- }) => Promise<BuilderTurn>;
390
- saveDraft?: (request: DataAppBuilderSaveDraftRequest, options: {
391
- apiServiceUrl?: string;
392
- accessToken?: string;
393
- signal: AbortSignal;
394
- }) => Promise<DataAppBuilderSaveDraftResult>;
395
- loadApp?: (request: {
396
- dataAppId: string;
397
- }, options: {
398
- apiServiceUrl?: string;
399
- accessToken?: string;
400
- signal: AbortSignal;
401
- }) => Promise<DataAppBuilderLoadedApp>;
402
- publish?: (request: DataAppBuilderPublishRequest, options: {
403
- apiServiceUrl?: string;
404
- accessToken?: string;
405
- signal: AbortSignal;
406
- onProgress?: (progress: DataAppBuilderPublishProgress) => void;
407
- }) => Promise<DataAppBuilderPublishResult>;
408
- };
409
- export type DataAppBuilderProps = {
410
- projectId: string;
411
- projectName: string;
412
- dataAppId?: string | null;
413
- apiServiceUrl?: string;
414
- backHref?: string;
415
- onBack?: () => void;
416
- adapters?: DataAppBuilderAdapters;
417
- };
418
- export type DataAppSourceSnapshotFile = {
419
- path: string;
420
- contents: string;
421
- hash?: string;
422
- };
423
- export type DataAppSourceSnapshot = {
424
- schemaVersion: 'data-app-source-snapshot/v1';
425
- files: DataAppSourceSnapshotFile[];
426
- metadata?: Record<string, unknown>;
427
- };
428
- export type DataAppSourceRevision = {
429
- schemaVersion: 'data-app-source-revision/v1';
430
- snapshotHash: string;
431
- git?: {
432
- commit?: string;
433
- branch?: string;
434
- dirtyTreeHash?: string;
435
- isDirty?: boolean;
436
- remoteUrlHash?: string;
437
- };
438
- workspace?: {
439
- adapter: 'bridge' | 'codex' | 'cli';
440
- rootName?: string;
441
- pathHash?: string;
442
- };
443
- collectedAt: string;
444
- };
445
- export type DataAppManifest = {
446
- schemaVersion: 'data-app/v1';
447
- app?: {
448
- id?: string;
449
- name?: string;
450
- description?: string;
451
- createdWith?: string;
452
- };
453
- runtime?: {
454
- framework?: string;
455
- bundler?: string;
456
- entry?: string;
457
- styles?: string[];
458
- assetsBasePath?: string;
459
- };
460
- semaphor?: Record<string, unknown>;
461
- build?: Record<string, unknown>;
462
- };
463
- export type DataAppBuilderSaveDraftRequest = {
464
- projectId: string;
465
- dataAppId?: string | null;
466
- title?: string;
467
- description?: string | null;
468
- manifest: DataAppManifest;
469
- sourceSnapshot: DataAppSourceSnapshot;
470
- sourceRevision?: DataAppSourceRevision | null;
471
- validationStatus?: unknown;
472
- bridgeWorkspaceHint?: string | null;
473
- };
474
- export type DataAppBuilderSaveDraftResult = {
475
- dataAppId: string;
476
- draftId?: string;
477
- savedAt?: string;
478
- };
479
- export type DataAppBuilderPublishAsset = {
480
- path: string;
481
- contentsBase64: string;
482
- contentType?: string;
483
- };
484
- export type DataAppBuilderPublishBuildResult = {
485
- manifest: DataAppManifest;
486
- validationStatus?: unknown;
487
- assets: DataAppBuilderPublishAsset[];
488
- entryFile: string;
489
- styleFiles?: string[];
490
- bridgeWorkspaceHint?: string | null;
491
- };
492
- export type DataAppBuilderPublishRequest = {
493
- projectId: string;
494
- dataAppId: string;
495
- draftId: string;
496
- title: string;
497
- description?: string | null;
498
- sourceSnapshot: DataAppSourceSnapshot;
499
- sourceRevision?: DataAppSourceRevision | null;
500
- bridgeWorkspaceHint?: string | null;
501
- validationStatus?: unknown;
502
- buildArtifacts: (options: {
503
- signal: AbortSignal;
504
- onProgress?: (progress: DataAppBuilderPublishProgress) => void;
505
- }) => Promise<DataAppBuilderPublishBuildResult>;
506
- };
507
- export type DataAppBuilderPublishResult = {
508
- dataAppId: string;
509
- versionId: string;
510
- version?: number;
511
- publishedAt?: string;
512
- };
513
- export type DataAppBuilderPublishProgress = {
514
- phase: 'start' | 'build' | 'upload' | 'complete';
515
- label: string;
516
- detail?: string;
517
- assetIndex?: number;
518
- assetCount?: number;
519
- };
520
- export type DataAppBuilderLoadedVersion = {
521
- id: string;
522
- dashboardId: string;
523
- version: number;
524
- status: string;
525
- manifest: DataAppManifest;
526
- sourceSnapshot?: DataAppSourceSnapshot | null;
527
- sourceRevision?: DataAppSourceRevision | null;
528
- bridgeWorkspaceHint?: string | null;
529
- createdAt?: string;
530
- updatedAt?: string;
531
- };
532
- export type DataAppBuilderLoadedApp = {
533
- id: string;
534
- projectId: string;
535
- title: string;
536
- description?: string | null;
537
- currentDataAppVersionId?: string | null;
538
- currentDataAppVersion?: DataAppBuilderLoadedVersion | null;
539
- dataAppVersions?: DataAppBuilderLoadedVersion[];
540
- };
541
- export type AppSuggestion = {
542
- id: string;
543
- title: string;
544
- description: string;
545
- datasets: string[];
546
- prompt: string;
547
- };
548
- export type BrowserFileSummary = {
549
- path: string;
550
- size: number;
551
- };
552
- export type BrowserFileTreeNode = {
553
- name: string;
554
- path: string;
555
- type: 'directory' | 'file';
556
- size?: number;
557
- children: BrowserFileTreeNode[];
558
- };
@@ -1,2 +0,0 @@
1
- export * from './data-app-builder/browser-runtime.js'
2
- export {}
@@ -1,2 +0,0 @@
1
- export * from './data-app-builder/index.js'
2
- export {}
@@ -1,26 +0,0 @@
1
- import { SemaphorDataAppCodegenSummary } from '../shared/analytics-protocol/data-app-codegen-summary.js';
2
- import { GENERATED_CONTRACT_SCHEMA_VERSION } from './validation.js';
3
- import { SemaphorGeneratedContractFiles } from './generated-contract-files.js';
4
- export declare const DEFAULT_GENERATED_CONTRACT_OUTPUT_DIR = "src/semaphor/generated";
5
- export type SemaphorDataAppContractGeneratorOptions = {
6
- allowEmpty?: boolean;
7
- generatorName?: string;
8
- generatorVersion?: string;
9
- };
10
- export type SemaphorGeneratedContractStats = {
11
- inputCount: number;
12
- executableViewCount: number;
13
- presentationViewCount: number;
14
- queryCount: number;
15
- optionQueryCount: number;
16
- };
17
- export type SemaphorGeneratedDataAppContract = {
18
- schemaVersion: typeof GENERATED_CONTRACT_SCHEMA_VERSION;
19
- files: SemaphorGeneratedContractFiles;
20
- manifest: Record<string, unknown>;
21
- contentHash: string;
22
- usageExample: string;
23
- warnings: string[];
24
- stats: SemaphorGeneratedContractStats;
25
- };
26
- export declare function generateSemaphorDataAppContract(summary: SemaphorDataAppCodegenSummary, options?: SemaphorDataAppContractGeneratorOptions): SemaphorGeneratedDataAppContract;
@@ -1,7 +0,0 @@
1
- export declare const GENERATED_CONTRACT_TYPESCRIPT_FILES: readonly ["sources.ts", "fields.ts", "inputs.ts", "queries.ts", "bindings.ts", "accessors.ts", "metadata.ts", "index.ts"];
2
- export declare const GENERATED_CONTRACT_DOCUMENTATION_FILES: readonly ["USAGE.md"];
3
- export declare const REQUIRED_GENERATED_CONTRACT_FILES: readonly ["sources.ts", "fields.ts", "inputs.ts", "queries.ts", "bindings.ts", "accessors.ts", "metadata.ts", "index.ts", "USAGE.md", "contract.manifest.json"];
4
- export type SemaphorGeneratedContractTypescriptFileName = (typeof GENERATED_CONTRACT_TYPESCRIPT_FILES)[number];
5
- export type SemaphorGeneratedContractDocumentationFileName = (typeof GENERATED_CONTRACT_DOCUMENTATION_FILES)[number];
6
- export type SemaphorGeneratedContractFileName = (typeof REQUIRED_GENERATED_CONTRACT_FILES)[number];
7
- export type SemaphorGeneratedContractFiles = Record<SemaphorGeneratedContractFileName, string>;
@@ -1,13 +0,0 @@
1
- export type SemaphorGeneratedContractValidationIssue = {
2
- path?: string;
3
- message: string;
4
- repairHint?: string;
5
- };
6
- export type SemaphorGeneratedContractValidationResult = {
7
- issues: SemaphorGeneratedContractValidationIssue[];
8
- };
9
- export type SemaphorGeneratedContractValidationInput = {
10
- manifest: unknown;
11
- generatedFiles?: Record<string, string>;
12
- };
13
- export declare function validateSemaphorGeneratedContract({ manifest, generatedFiles, }: SemaphorGeneratedContractValidationInput): Promise<SemaphorGeneratedContractValidationResult>;
@@ -1,6 +0,0 @@
1
- export { SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION, SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION, isSemaphorDataAppCodegenSummary, type SemaphorDataAppCodegenSummary, type SemaphorDataAppCodegenSummarySchemaVersion, type SemaphorDataAppCodegenSummaryValidatorVersion, } from '../shared/analytics-protocol/data-app-codegen-summary.js';
2
- export { CODEGEN_SUMMARY_SCHEMA_VERSION, CODEGEN_SUMMARY_VALIDATOR_VERSION, CONTRACT_MANIFEST_SCHEMA_VERSION, GENERATED_CONTRACT_SCHEMA_VERSION, assertValidCodegenSummary, validateCodegenSummary, validateSemaphorDataAppCodegenSummary, } from './validation.js';
3
- export { validateSemaphorGeneratedContract, type SemaphorGeneratedContractValidationInput, type SemaphorGeneratedContractValidationIssue, type SemaphorGeneratedContractValidationResult, } from './generated-contract-validation.js';
4
- export { GENERATED_CONTRACT_TYPESCRIPT_FILES, REQUIRED_GENERATED_CONTRACT_FILES, type SemaphorGeneratedContractFileName, type SemaphorGeneratedContractFiles, type SemaphorGeneratedContractTypescriptFileName, } from './generated-contract-files.js';
5
- export { buildSemaphorGeneratedActiveInput, buildSemaphorGeneratedInputOptionIntent, buildSemaphorGeneratedViewExecutionRequest, buildSemaphorGeneratedViewExecutionRequests, type SemaphorGeneratedViewExecutionRequest, type SemaphorGeneratedViewExecutionRequestIssue, type SemaphorGeneratedViewExecutionRequestsResult, } from './live-execution.js';
6
- export { evaluateSemaphorDataAppContractUpdatePolicy, type SemaphorDataAppContractUpdatePolicy, type SemaphorDataAppContractUpdatePolicyInput, type SemaphorDataAppContractUpdatePolicyResult, type SemaphorDataAppContractUpdatePolicyViolation, } from './update-policy.js';
@@ -1,42 +0,0 @@
1
- import { SemaphorActiveInput, SemaphorAnalysisQueryOptions, SemaphorInputValue } from '../data-app-sdk/contracts.js';
2
- import { MatrixWindowRequest, SemaphorAnalyticsIntent } from '../shared/analytics-protocol/index.js';
3
- type JsonRecord = Record<string, unknown>;
4
- type GeneratedRefContext = {
5
- sourcesByKey: Map<string, JsonRecord>;
6
- };
7
- type SemaphorGeneratedQueryResultShape = 'metric' | 'records' | 'analysis' | 'matrix' | 'sql' | 'inputOptions';
8
- export type SemaphorGeneratedViewExecutionRequest = {
9
- viewId: string;
10
- intent: SemaphorAnalyticsIntent;
11
- resultShape: SemaphorGeneratedQueryResultShape;
12
- analysisOptions?: SemaphorAnalysisQueryOptions;
13
- matrixWindowRequest?: MatrixWindowRequest;
14
- };
15
- export type SemaphorGeneratedViewExecutionRequestIssue = {
16
- viewId?: string;
17
- path?: string;
18
- message: string;
19
- };
20
- export type SemaphorGeneratedViewExecutionRequestsResult = {
21
- requests: SemaphorGeneratedViewExecutionRequest[];
22
- issues: SemaphorGeneratedViewExecutionRequestIssue[];
23
- };
24
- export declare function buildSemaphorGeneratedViewExecutionRequests(codegenSummary: unknown): SemaphorGeneratedViewExecutionRequestsResult;
25
- export declare function buildSemaphorGeneratedViewExecutionRequest(view: unknown, contextOrSummary: GeneratedRefContext | unknown): Omit<SemaphorGeneratedViewExecutionRequest, 'viewId'> | null;
26
- export declare function buildSemaphorGeneratedInputOptionIntent({ input, filterContract, codegenSummary, }: {
27
- input: unknown;
28
- filterContract: unknown;
29
- codegenSummary: unknown;
30
- }): Extract<SemaphorAnalyticsIntent, {
31
- kind: 'inputOptions';
32
- }> | null;
33
- export declare function buildSemaphorGeneratedActiveInput({ input, filterContract, binding, option, codegenSummary, }: {
34
- input: unknown;
35
- filterContract: unknown;
36
- binding: unknown;
37
- option: {
38
- value?: SemaphorInputValue;
39
- };
40
- codegenSummary: unknown;
41
- }): SemaphorActiveInput;
42
- export {};
@@ -1,2 +0,0 @@
1
- export * from './index.js';
2
- export { DEFAULT_GENERATED_CONTRACT_OUTPUT_DIR, generateSemaphorDataAppContract, type SemaphorDataAppContractGeneratorOptions, type SemaphorGeneratedContractStats, type SemaphorGeneratedDataAppContract, } from './generate-contract.js';
@@ -1,25 +0,0 @@
1
- export type SemaphorDataAppContractUpdatePolicyViolation = {
2
- path: string;
3
- reason: string;
4
- };
5
- export type SemaphorDataAppContractUpdatePolicy = {
6
- kind: string;
7
- mode: 'invalid_update_constraints' | 'invalid_operation_kind' | 'diagnostic_warning_fix' | 'metric_aggregate_override_edit' | 'general_iterative_update';
8
- reason: string;
9
- allowedViewChangeReasons?: string[];
10
- targetViewIds?: string[];
11
- };
12
- export type SemaphorDataAppContractUpdatePolicyResult = {
13
- ok: boolean;
14
- policy: SemaphorDataAppContractUpdatePolicy;
15
- violations: SemaphorDataAppContractUpdatePolicyViolation[];
16
- };
17
- export type SemaphorDataAppContractUpdatePolicyInput = {
18
- beforeSummary?: unknown;
19
- afterSummary?: unknown;
20
- migrationReport?: unknown;
21
- operationIntent?: unknown;
22
- constraints?: unknown;
23
- preferences?: unknown;
24
- };
25
- export declare function evaluateSemaphorDataAppContractUpdatePolicy({ beforeSummary, afterSummary, migrationReport, operationIntent, constraints, preferences, }: SemaphorDataAppContractUpdatePolicyInput): SemaphorDataAppContractUpdatePolicyResult;