react-semaphor 0.1.326 → 0.1.328
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.
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +1 -1
- package/dist/brand-studio/index.cjs +5 -5
- package/dist/brand-studio/index.js +23 -24
- package/dist/chunks/_commonjsHelpers-BVfed4GL.js +28 -0
- package/dist/chunks/_commonjsHelpers-DwTZ_eVU.js +1 -0
- package/dist/chunks/{braces-DVaMJoCd.js → braces-CG8viaD2.js} +1 -1
- package/dist/chunks/{braces-dHeaioTd.js → braces-DSaa_4Oc.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-mqU_uOmY.js → calendar-preferences-dialog-DD_qAthL.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog--2jD-eKu.js → calendar-preferences-dialog-JRmNJptJ.js} +3 -3
- package/dist/chunks/{chevrons-up-down-DNQE-uEp.js → chevrons-up-down-CBa0uh0X.js} +1 -1
- package/dist/chunks/{chevrons-up-down-CLbzBHoI.js → chevrons-up-down-ChDNqVP7.js} +1 -1
- package/dist/chunks/dashboard-briefing-launcher-BKdJFwH5.js +106 -0
- package/dist/chunks/{dashboard-briefing-launcher-DsjXUPFq.js → dashboard-briefing-launcher-BfyNkd8i.js} +1106 -1108
- package/dist/chunks/{dashboard-controls-DgNkM1yT.js → dashboard-controls-0pZDLvFL.js} +218 -218
- package/dist/chunks/{dashboard-controls-XCa9PZuU.js → dashboard-controls-C0xm1QMR.js} +10 -10
- package/dist/chunks/dashboard-json-BW5OVZ6m.js +1 -0
- package/dist/chunks/{dashboard-json-DkA6Bf0Y.js → dashboard-json-DsruhRPD.js} +14 -13
- package/dist/chunks/date-formatter-B4EBSe9C.js +1 -0
- package/dist/chunks/date-formatter-CzcPZx39.js +416 -0
- package/dist/chunks/edit-dashboard-visual-DQyJ7SSv.js +178 -0
- package/dist/chunks/{edit-dashboard-visual-Q5hW5MXk.js → edit-dashboard-visual-g5SZZahJ.js} +8242 -7784
- package/dist/chunks/index-1JWDPCun.js +1935 -0
- package/dist/chunks/index-BdjXTQt4.js +1444 -0
- package/dist/chunks/{index-DwfDwtv2.js → index-BmKr-K7J.js} +117670 -113627
- package/dist/chunks/index-C1l78BIx.js +3247 -0
- package/dist/chunks/lib-Ce3zosXY.js +38 -0
- package/dist/chunks/lib-DFvr9fM4.js +5500 -0
- package/dist/chunks/{palette-DtmNws9a.js → palette-D0YmAqBS.js} +1 -1
- package/dist/chunks/{palette-DpcvHAiY.js → palette-DQgq3edH.js} +1 -1
- package/dist/chunks/{resource-management-panel-CGwWKZOP.js → resource-management-panel-CIfBh46E.js} +1 -1
- package/dist/chunks/{resource-management-panel-D2oAQkKi.js → resource-management-panel-Cj19pw9M.js} +145 -145
- package/dist/chunks/switch-BvTzw2AW.js +173 -0
- package/dist/chunks/{switch-j3AThLFk.js → switch-De31SR3q.js} +2752 -2717
- package/dist/chunks/typescript-Cmizj1hi.js +446 -0
- package/dist/chunks/typescript-H1EwZsOb.js +159820 -0
- package/dist/chunks/use-create-flow-overlay-state-BTQiKRD1.js +26 -0
- package/dist/chunks/{use-create-flow-overlay-state-CP6GDQAX.js → use-create-flow-overlay-state-IcHP0l39.js} +150 -151
- package/dist/chunks/{use-visual-utils-CSXU-96k.js → use-visual-utils-DQ5zGYD2.js} +13 -13
- package/dist/chunks/{use-visual-utils-NpOW5uZ1.js → use-visual-utils-XF-AqV8o.js} +1 -1
- package/dist/chunks/{validators-DvTxl9i0.js → validators-DDAweCzB.js} +67 -48
- package/dist/chunks/validators-odlRJblR.js +2 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +907 -527
- package/dist/data-app-builder/index.cjs +1 -0
- package/dist/data-app-builder/index.js +4 -0
- package/dist/data-app-builder-browser-runtime/index.cjs +1 -0
- package/dist/data-app-builder-browser-runtime/index.js +10 -0
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +208 -196
- package/dist/format-utils/index.cjs +4 -4
- package/dist/format-utils/index.js +22 -21
- package/dist/index.cjs +1 -1
- package/dist/index.js +14 -14
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +1 -0
- package/dist/types/dashboard-authoring.d.ts +79 -2
- package/dist/types/dashboard.d.ts +17 -2
- package/dist/types/data-app-builder-browser-runtime.d.ts +185 -0
- package/dist/types/data-app-builder.d.ts +630 -0
- package/dist/types/data-app-sdk.d.ts +15 -1
- package/dist/types/format-utils.d.ts +25 -0
- package/dist/types/main.d.ts +67 -10
- package/dist/types/shared.d.ts +17 -2
- package/dist/types/surfboard.d.ts +17 -2
- package/dist/types/types.d.ts +32 -3
- package/package.json +11 -1
- package/dist/chunks/dashboard-briefing-launcher-DguNfFr8.js +0 -106
- package/dist/chunks/dashboard-json-DiBd65Xf.js +0 -1
- package/dist/chunks/date-formatter-D9Bvw5Qk.js +0 -1
- package/dist/chunks/date-formatter-DyIOb6uC.js +0 -333
- package/dist/chunks/edit-dashboard-visual-BC9eOc4U.js +0 -178
- package/dist/chunks/index-B1-46PoR.js +0 -1303
- package/dist/chunks/save-BY7WF62U.js +0 -21
- package/dist/chunks/save-Cv_XRb94.js +0 -6
- package/dist/chunks/switch-5aQ_jcLH.js +0 -168
- package/dist/chunks/use-create-flow-overlay-state-BQPXP0AM.js +0 -26
- package/dist/chunks/validators-DJUMR5An.js +0 -2
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
export declare type ApiStatus = {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
appBuilder?: {
|
|
6
|
+
hasOpenAiKey: boolean;
|
|
7
|
+
environment: string;
|
|
8
|
+
deploymentUrl: string | null;
|
|
9
|
+
};
|
|
10
|
+
error?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export declare type BridgeCommandResult = {
|
|
14
|
+
command: string;
|
|
15
|
+
durationMs: number;
|
|
16
|
+
exitCode: number;
|
|
17
|
+
ok: boolean;
|
|
18
|
+
stdout: string;
|
|
19
|
+
stderr: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export declare type BridgeReadFilesResult = {
|
|
23
|
+
ok: boolean;
|
|
24
|
+
projectRoot?: string;
|
|
25
|
+
files?: Array<{
|
|
26
|
+
path: string;
|
|
27
|
+
contents: string;
|
|
28
|
+
}>;
|
|
29
|
+
error?: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export declare type BridgeResult = {
|
|
33
|
+
ok: boolean;
|
|
34
|
+
projectRoot?: string;
|
|
35
|
+
provider?: string;
|
|
36
|
+
validation?: 'typecheck' | 'build' | 'write-policy-validation' | 'import-validation' | 'data-api-validation';
|
|
37
|
+
changedFiles?: string[];
|
|
38
|
+
summary?: string;
|
|
39
|
+
changes?: Array<{
|
|
40
|
+
kind: 'add' | 'edit' | 'remove';
|
|
41
|
+
label: string;
|
|
42
|
+
}>;
|
|
43
|
+
files?: Array<{
|
|
44
|
+
path: string;
|
|
45
|
+
size: number;
|
|
46
|
+
}>;
|
|
47
|
+
generationMeta?: {
|
|
48
|
+
model: string;
|
|
49
|
+
strategy: string;
|
|
50
|
+
reasoningEffort?: string;
|
|
51
|
+
durationMs: number;
|
|
52
|
+
outputChars?: number;
|
|
53
|
+
fallbackFrom?: {
|
|
54
|
+
strategy: string;
|
|
55
|
+
reason: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
attempts?: Array<{
|
|
59
|
+
label: string;
|
|
60
|
+
ok: boolean;
|
|
61
|
+
command: BridgeCommandResult;
|
|
62
|
+
}>;
|
|
63
|
+
command?: BridgeCommandResult;
|
|
64
|
+
importValidation?: {
|
|
65
|
+
ok: boolean;
|
|
66
|
+
diagnostics: string[];
|
|
67
|
+
};
|
|
68
|
+
writePolicyValidation?: {
|
|
69
|
+
ok: boolean;
|
|
70
|
+
diagnostics: string[];
|
|
71
|
+
};
|
|
72
|
+
dataApiValidation?: {
|
|
73
|
+
ok: boolean;
|
|
74
|
+
diagnostics: string[];
|
|
75
|
+
};
|
|
76
|
+
telemetry?: {
|
|
77
|
+
contextFileCount?: number;
|
|
78
|
+
contextChars?: number;
|
|
79
|
+
generatedFileCount?: number;
|
|
80
|
+
generatedChars?: number;
|
|
81
|
+
repairAttempts?: number;
|
|
82
|
+
};
|
|
83
|
+
filePlan?: BrowserSandboxFilePlan;
|
|
84
|
+
error?: string;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export declare type BridgeWorkspaceContextResult = {
|
|
88
|
+
ok: boolean;
|
|
89
|
+
workspaceContext?: WorkspaceContext;
|
|
90
|
+
error?: string;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
declare type BrowserSandboxFilePlan = {
|
|
94
|
+
intent: string;
|
|
95
|
+
files: Array<{
|
|
96
|
+
path: string;
|
|
97
|
+
purpose: string;
|
|
98
|
+
action: 'create' | 'edit';
|
|
99
|
+
}>;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
declare type BrowserSandboxRuntimeManifest = {
|
|
103
|
+
id: string;
|
|
104
|
+
name: string;
|
|
105
|
+
execution: 'browser-sandbox';
|
|
106
|
+
moduleSystem: string;
|
|
107
|
+
cssPipeline: {
|
|
108
|
+
mode: string;
|
|
109
|
+
status: string;
|
|
110
|
+
};
|
|
111
|
+
packages: Array<{
|
|
112
|
+
name: string;
|
|
113
|
+
source: 'host' | 'runtime' | 'shim' | 'fallback';
|
|
114
|
+
status: 'supported' | 'partial';
|
|
115
|
+
}>;
|
|
116
|
+
components: Array<{
|
|
117
|
+
name: string;
|
|
118
|
+
importPath: string;
|
|
119
|
+
sourceFile: string;
|
|
120
|
+
implementation: 'source' | 'shim';
|
|
121
|
+
dependencies: string[];
|
|
122
|
+
}>;
|
|
123
|
+
limits: {
|
|
124
|
+
writeScope: string[];
|
|
125
|
+
editableGlobs: string[];
|
|
126
|
+
unsupported: string[];
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
declare type BuilderConversationContext = {
|
|
131
|
+
messages: BuilderConversationMessage[];
|
|
132
|
+
activeTarget?: string;
|
|
133
|
+
lastSuccessfulRun?: {
|
|
134
|
+
prompt: string;
|
|
135
|
+
changedFiles: string[];
|
|
136
|
+
summary?: string;
|
|
137
|
+
filePlan?: BrowserSandboxFilePlan;
|
|
138
|
+
};
|
|
139
|
+
lastOperation?: DataAppOperationPlan;
|
|
140
|
+
intentManifest?: DataAppIntentManifest;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
declare type BuilderConversationMessage = {
|
|
144
|
+
role: 'user' | 'assistant' | 'system';
|
|
145
|
+
content: string;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export declare type BuilderTurn = {
|
|
149
|
+
mode: BuilderTurnMode;
|
|
150
|
+
message: string;
|
|
151
|
+
operation?: DataAppOperationPlan;
|
|
152
|
+
intentManifest?: DataAppIntentManifest;
|
|
153
|
+
toolEvents?: Array<{
|
|
154
|
+
tool: string;
|
|
155
|
+
status: string;
|
|
156
|
+
detail?: string;
|
|
157
|
+
}>;
|
|
158
|
+
requestedFiles?: string[];
|
|
159
|
+
revision?: GeneratedRevision;
|
|
160
|
+
artifacts?: DataAppBuilderArtifact[];
|
|
161
|
+
uiActions?: DataAppBuilderUiAction[];
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export declare type BuilderTurnMode = 'answer' | 'clarify' | 'edit' | 'read_files';
|
|
165
|
+
|
|
166
|
+
export declare type BuilderTurnResult = {
|
|
167
|
+
ok: boolean;
|
|
168
|
+
turn?: BuilderTurn;
|
|
169
|
+
error?: string;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export declare function DataAppBuilder({ projectId, projectName, dataAppId, apiServiceUrl, adapters, }: DataAppBuilderProps): JSX.Element;
|
|
173
|
+
|
|
174
|
+
export declare type DataAppBuilderAdapters = {
|
|
175
|
+
readStatus?: (options: {
|
|
176
|
+
apiServiceUrl?: string;
|
|
177
|
+
accessToken?: string;
|
|
178
|
+
signal: AbortSignal;
|
|
179
|
+
}) => Promise<ApiStatus>;
|
|
180
|
+
runTurn?: (request: DataAppBuilderTurnRequest, options: {
|
|
181
|
+
apiServiceUrl?: string;
|
|
182
|
+
accessToken?: string;
|
|
183
|
+
signal: AbortSignal;
|
|
184
|
+
onProgress?: (progress: DataAppBuilderTurnProgress) => void;
|
|
185
|
+
}) => Promise<BuilderTurn>;
|
|
186
|
+
saveDraft?: (request: DataAppBuilderSaveDraftRequest, options: {
|
|
187
|
+
apiServiceUrl?: string;
|
|
188
|
+
accessToken?: string;
|
|
189
|
+
signal: AbortSignal;
|
|
190
|
+
}) => Promise<DataAppBuilderSaveDraftResult>;
|
|
191
|
+
publish?: (request: DataAppBuilderPublishRequest, options: {
|
|
192
|
+
apiServiceUrl?: string;
|
|
193
|
+
accessToken?: string;
|
|
194
|
+
signal: AbortSignal;
|
|
195
|
+
onProgress?: (progress: DataAppBuilderPublishProgress) => void;
|
|
196
|
+
}) => Promise<DataAppBuilderPublishResult>;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export declare type DataAppBuilderArtifact = DataAppBuilderDatasetInspectorArtifact;
|
|
200
|
+
|
|
201
|
+
declare type DataAppBuilderAttachment = {
|
|
202
|
+
id: string;
|
|
203
|
+
type: 'screenshot';
|
|
204
|
+
name: string;
|
|
205
|
+
imageUrl: string;
|
|
206
|
+
mediaType: string;
|
|
207
|
+
createdAt: number;
|
|
208
|
+
} | {
|
|
209
|
+
id: string;
|
|
210
|
+
type: 'dom-selection';
|
|
211
|
+
name: string;
|
|
212
|
+
text: string;
|
|
213
|
+
createdAt: number;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
export declare type DataAppBuilderDatasetInspectorArtifact = {
|
|
217
|
+
id: string;
|
|
218
|
+
type: 'dataset_inspector';
|
|
219
|
+
title: string;
|
|
220
|
+
domain: {
|
|
221
|
+
id: string;
|
|
222
|
+
name: string;
|
|
223
|
+
label: string;
|
|
224
|
+
};
|
|
225
|
+
dataset: {
|
|
226
|
+
id?: string | null;
|
|
227
|
+
name: string;
|
|
228
|
+
label?: string | null;
|
|
229
|
+
analyticsRole?: string | null;
|
|
230
|
+
primaryDateField?: string | null;
|
|
231
|
+
};
|
|
232
|
+
counts: {
|
|
233
|
+
total: number;
|
|
234
|
+
dimensions: number;
|
|
235
|
+
measures: number;
|
|
236
|
+
dates: number;
|
|
237
|
+
identifiers: number;
|
|
238
|
+
calculated: number;
|
|
239
|
+
};
|
|
240
|
+
fields: Array<{
|
|
241
|
+
name: string;
|
|
242
|
+
label?: string;
|
|
243
|
+
role?: string;
|
|
244
|
+
dataType?: string;
|
|
245
|
+
source: 'physical' | 'calculated';
|
|
246
|
+
}>;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export declare type DataAppBuilderProps = {
|
|
250
|
+
projectId: string;
|
|
251
|
+
projectName: string;
|
|
252
|
+
dataAppId?: string | null;
|
|
253
|
+
apiServiceUrl?: string;
|
|
254
|
+
backHref?: string;
|
|
255
|
+
onBack?: () => void;
|
|
256
|
+
adapters?: DataAppBuilderAdapters;
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
declare type DataAppBuilderPublishAsset = {
|
|
260
|
+
path: string;
|
|
261
|
+
contentsBase64: string;
|
|
262
|
+
contentType?: string;
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
export declare type DataAppBuilderPublishProgress = {
|
|
266
|
+
phase: 'start' | 'upload' | 'complete';
|
|
267
|
+
label: string;
|
|
268
|
+
detail?: string;
|
|
269
|
+
assetIndex?: number;
|
|
270
|
+
assetCount?: number;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export declare type DataAppBuilderPublishRequest = {
|
|
274
|
+
projectId: string;
|
|
275
|
+
dataAppId: string;
|
|
276
|
+
title: string;
|
|
277
|
+
description?: string | null;
|
|
278
|
+
manifest: DataAppManifest;
|
|
279
|
+
sourceSnapshot: DataAppSourceSnapshot;
|
|
280
|
+
sourceRevision?: string | null;
|
|
281
|
+
validationStatus?: unknown;
|
|
282
|
+
bridgeWorkspaceHint?: string | null;
|
|
283
|
+
assets: DataAppBuilderPublishAsset[];
|
|
284
|
+
entryFile: string;
|
|
285
|
+
styleFiles?: string[];
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
export declare type DataAppBuilderPublishResult = {
|
|
289
|
+
dataAppId: string;
|
|
290
|
+
versionId: string;
|
|
291
|
+
version?: number;
|
|
292
|
+
publishedAt?: string;
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
export declare type DataAppBuilderSaveDraftRequest = {
|
|
296
|
+
projectId: string;
|
|
297
|
+
dataAppId?: string | null;
|
|
298
|
+
title: string;
|
|
299
|
+
description?: string | null;
|
|
300
|
+
manifest: DataAppManifest;
|
|
301
|
+
sourceSnapshot: DataAppSourceSnapshot;
|
|
302
|
+
sourceRevision?: string | null;
|
|
303
|
+
validationStatus?: unknown;
|
|
304
|
+
bridgeWorkspaceHint?: string | null;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
export declare type DataAppBuilderSaveDraftResult = {
|
|
308
|
+
dataAppId: string;
|
|
309
|
+
draftId?: string;
|
|
310
|
+
savedAt?: string;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
export declare type DataAppBuilderTurnProgress = {
|
|
314
|
+
phase: DataAppBuilderTurnProgressPhase;
|
|
315
|
+
label: string;
|
|
316
|
+
detail?: string;
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
declare type DataAppBuilderTurnProgressPhase = 'received' | 'authenticating' | 'routing' | 'inspecting_data' | 'reading_files' | 'planning_revision' | 'generating_code' | 'done';
|
|
320
|
+
|
|
321
|
+
export declare type DataAppBuilderTurnRequest = {
|
|
322
|
+
projectId: string;
|
|
323
|
+
message: string;
|
|
324
|
+
currentFiles: NonNullable<BridgeReadFilesResult['files']>;
|
|
325
|
+
workspaceContext: WorkspaceContext;
|
|
326
|
+
conversationContext?: BuilderConversationContext;
|
|
327
|
+
attachments?: DataAppBuilderAttachment[];
|
|
328
|
+
diagnostics?: string[];
|
|
329
|
+
repair?: boolean;
|
|
330
|
+
allowFileReads?: boolean;
|
|
331
|
+
generationModel: string;
|
|
332
|
+
generationReasoningEffort?: ReasoningEffort;
|
|
333
|
+
repairModel: string;
|
|
334
|
+
repairReasoningEffort?: ReasoningEffort;
|
|
335
|
+
stream?: boolean;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
declare type DataAppBuilderUiAction = {
|
|
339
|
+
type: 'open_dataset_inspector';
|
|
340
|
+
artifactId: string;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
export declare type DataAppIntentInput = {
|
|
344
|
+
id: string;
|
|
345
|
+
label: string;
|
|
346
|
+
kind: 'filter' | 'control';
|
|
347
|
+
field?: SemaphorFieldRef;
|
|
348
|
+
sourceId?: string;
|
|
349
|
+
operator?: SemaphorInputOperator;
|
|
350
|
+
multi?: boolean;
|
|
351
|
+
defaultValue?: unknown;
|
|
352
|
+
affects?: string[];
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
export declare type DataAppIntentInteraction = {
|
|
356
|
+
id: string;
|
|
357
|
+
kind: 'filter_affects_view' | 'drilldown' | 'navigation' | 'selection';
|
|
358
|
+
fromId: string;
|
|
359
|
+
toIds: string[];
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
export declare type DataAppIntentLayout = {
|
|
363
|
+
style?: 'dashboard' | 'workflow' | 'report' | 'custom';
|
|
364
|
+
sections?: Array<{
|
|
365
|
+
id: string;
|
|
366
|
+
title?: string;
|
|
367
|
+
viewIds: string[];
|
|
368
|
+
}>;
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
export declare type DataAppIntentManifest = {
|
|
372
|
+
schemaVersion: 'data-app-intent/v1';
|
|
373
|
+
app: {
|
|
374
|
+
title: string;
|
|
375
|
+
description?: string;
|
|
376
|
+
goal?: string;
|
|
377
|
+
};
|
|
378
|
+
sources: DataAppIntentSource[];
|
|
379
|
+
inputs: DataAppIntentInput[];
|
|
380
|
+
views: DataAppIntentView[];
|
|
381
|
+
interactions?: DataAppIntentInteraction[];
|
|
382
|
+
layout?: DataAppIntentLayout;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
export declare type DataAppIntentSource = {
|
|
386
|
+
id: string;
|
|
387
|
+
label?: string;
|
|
388
|
+
ref: SemaphorSourceRef;
|
|
389
|
+
role?: 'primary' | 'lookup' | 'supporting';
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
export declare type DataAppIntentView = {
|
|
393
|
+
id: string;
|
|
394
|
+
title: string;
|
|
395
|
+
description?: string;
|
|
396
|
+
kind: DataAppIntentViewKind;
|
|
397
|
+
/**
|
|
398
|
+
* Canonical governed analytics question for this view. Generated React
|
|
399
|
+
* should render it through react-semaphor/data-app-sdk hooks.
|
|
400
|
+
*/
|
|
401
|
+
analytics?: SemaphorAnalyticsIntent;
|
|
402
|
+
sourceIds?: string[];
|
|
403
|
+
inputIds?: string[];
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
export declare type DataAppIntentViewKind = 'kpi' | 'line_chart' | 'bar_chart' | 'area_chart' | 'pie_chart' | 'table' | 'text' | 'custom';
|
|
407
|
+
|
|
408
|
+
export declare type DataAppManifest = {
|
|
409
|
+
schemaVersion: 'data-app/v1';
|
|
410
|
+
app?: {
|
|
411
|
+
id?: string;
|
|
412
|
+
name?: string;
|
|
413
|
+
description?: string;
|
|
414
|
+
createdWith?: string;
|
|
415
|
+
};
|
|
416
|
+
runtime?: {
|
|
417
|
+
framework?: string;
|
|
418
|
+
bundler?: string;
|
|
419
|
+
entry?: string;
|
|
420
|
+
styles?: string[];
|
|
421
|
+
assetsBasePath?: string;
|
|
422
|
+
};
|
|
423
|
+
semaphor?: Record<string, unknown>;
|
|
424
|
+
build?: Record<string, unknown>;
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
export declare type DataAppOperationPlan = {
|
|
428
|
+
schemaVersion: 'data-app-operation/v1';
|
|
429
|
+
type: DataAppOperationType;
|
|
430
|
+
userGoal: string;
|
|
431
|
+
target?: DataAppOperationTarget;
|
|
432
|
+
/**
|
|
433
|
+
* Shared analytics protocol intent for data-bearing work. This is the same
|
|
434
|
+
* contract consumed by the Data App SDK/server executor, not a Data
|
|
435
|
+
* App-specific query shape.
|
|
436
|
+
*/
|
|
437
|
+
analyticsIntent?: SemaphorAnalyticsIntent;
|
|
438
|
+
inputIds?: string[];
|
|
439
|
+
requiredInspections?: Array<'data' | 'files' | 'preview' | 'diagnostics'>;
|
|
440
|
+
confidence?: 'low' | 'medium' | 'high';
|
|
441
|
+
rationale?: string;
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
export declare type DataAppOperationTarget = {
|
|
445
|
+
id?: string;
|
|
446
|
+
label?: string;
|
|
447
|
+
kind?: string;
|
|
448
|
+
filePath?: string;
|
|
449
|
+
sourceId?: string;
|
|
450
|
+
viewId?: string;
|
|
451
|
+
inputId?: string;
|
|
452
|
+
previousReference?: string;
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
export declare 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';
|
|
456
|
+
|
|
457
|
+
export declare type DataAppSourceSnapshot = {
|
|
458
|
+
schemaVersion: 'data-app-source-snapshot/v1';
|
|
459
|
+
files: DataAppSourceSnapshotFile[];
|
|
460
|
+
metadata?: Record<string, unknown>;
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
declare type DataAppSourceSnapshotFile = {
|
|
464
|
+
path: string;
|
|
465
|
+
contents: string;
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
export declare type GeneratedRevision = {
|
|
469
|
+
provider?: string;
|
|
470
|
+
summary?: string;
|
|
471
|
+
changes?: BridgeResult['changes'];
|
|
472
|
+
files: Array<{
|
|
473
|
+
path: string;
|
|
474
|
+
contents: string;
|
|
475
|
+
}>;
|
|
476
|
+
plan?: BrowserSandboxFilePlan;
|
|
477
|
+
generationMeta?: BridgeResult['generationMeta'];
|
|
478
|
+
attemptLabel?: string;
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
export declare type ReasoningEffort = 'low' | 'medium' | 'high';
|
|
482
|
+
|
|
483
|
+
declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
|
|
484
|
+
|
|
485
|
+
declare type SemaphorDialect = 'semantic' | 'postgres' | 'mysql' | 'snowflake' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
|
|
486
|
+
|
|
487
|
+
declare type SemaphorFieldRef = {
|
|
488
|
+
name: string;
|
|
489
|
+
label?: string;
|
|
490
|
+
role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
|
|
491
|
+
dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
|
|
492
|
+
source?: SemaphorSourceRef;
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
declare type SemaphorInputBinding = {
|
|
496
|
+
inputId: string;
|
|
497
|
+
field?: SemaphorFieldRef;
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | '>' | '>=' | '<' | '<=';
|
|
501
|
+
|
|
502
|
+
declare type SemaphorInputOptionsIntent = {
|
|
503
|
+
kind: 'inputOptions';
|
|
504
|
+
version?: SemaphorProtocolVersion;
|
|
505
|
+
id?: string;
|
|
506
|
+
label?: string;
|
|
507
|
+
source: SemaphorSourceRef;
|
|
508
|
+
field: SemaphorFieldRef;
|
|
509
|
+
search?: string;
|
|
510
|
+
limit?: number;
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
declare type SemaphorMetricIntent = {
|
|
514
|
+
kind: 'metric';
|
|
515
|
+
version?: SemaphorProtocolVersion;
|
|
516
|
+
id?: string;
|
|
517
|
+
source: SemaphorSourceRef;
|
|
518
|
+
metric: string;
|
|
519
|
+
metrics?: string[];
|
|
520
|
+
label?: string;
|
|
521
|
+
dateField?: SemaphorFieldRef;
|
|
522
|
+
timeGrain?: SemaphorTimeGrain;
|
|
523
|
+
dimensions?: SemaphorFieldRef[];
|
|
524
|
+
comparison?: {
|
|
525
|
+
kind: 'previous_period' | 'previous_year' | 'target';
|
|
526
|
+
targetValue?: number;
|
|
527
|
+
};
|
|
528
|
+
inputs?: SemaphorInputBinding[];
|
|
529
|
+
limit?: number;
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
declare type SemaphorProtocolVersion = 1;
|
|
533
|
+
|
|
534
|
+
declare type SemaphorRecordsIntent = {
|
|
535
|
+
kind: 'records';
|
|
536
|
+
version?: SemaphorProtocolVersion;
|
|
537
|
+
source: SemaphorSourceRef;
|
|
538
|
+
id?: string;
|
|
539
|
+
label?: string;
|
|
540
|
+
fields: SemaphorFieldRef[];
|
|
541
|
+
measures?: string[];
|
|
542
|
+
dateField?: SemaphorFieldRef;
|
|
543
|
+
timeGrain?: SemaphorTimeGrain;
|
|
544
|
+
limit?: number;
|
|
545
|
+
orderBy?: {
|
|
546
|
+
field: string;
|
|
547
|
+
direction: 'asc' | 'desc';
|
|
548
|
+
};
|
|
549
|
+
inputs?: SemaphorInputBinding[];
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
declare type SemaphorSourceRef = {
|
|
553
|
+
kind: 'semantic';
|
|
554
|
+
domainId: string;
|
|
555
|
+
datasetName: string;
|
|
556
|
+
datasetId?: string;
|
|
557
|
+
label?: string;
|
|
558
|
+
connectionId?: string;
|
|
559
|
+
} | {
|
|
560
|
+
kind: 'physical';
|
|
561
|
+
connectionId: string;
|
|
562
|
+
tableName: string;
|
|
563
|
+
databaseName?: string;
|
|
564
|
+
schemaName?: string;
|
|
565
|
+
label?: string;
|
|
566
|
+
dialect?: SemaphorDialect;
|
|
567
|
+
} | {
|
|
568
|
+
kind: 'sql';
|
|
569
|
+
connectionId: string;
|
|
570
|
+
sql: string;
|
|
571
|
+
dialect?: SemaphorDialect;
|
|
572
|
+
label?: string;
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
declare type SemaphorSqlIntent = {
|
|
576
|
+
kind: 'sql';
|
|
577
|
+
version?: SemaphorProtocolVersion;
|
|
578
|
+
id?: string;
|
|
579
|
+
label?: string;
|
|
580
|
+
source: Extract<SemaphorSourceRef, {
|
|
581
|
+
kind: 'sql' | 'physical';
|
|
582
|
+
}>;
|
|
583
|
+
sql?: string;
|
|
584
|
+
parameters?: Record<string, unknown>;
|
|
585
|
+
pythonCode?: string;
|
|
586
|
+
limit?: number;
|
|
587
|
+
rationale?: string;
|
|
588
|
+
fields?: SemaphorFieldRef[];
|
|
589
|
+
inputs?: SemaphorInputBinding[];
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
593
|
+
|
|
594
|
+
export declare type WorkspaceContext = {
|
|
595
|
+
projectRoot?: string;
|
|
596
|
+
framework?: string;
|
|
597
|
+
packageManager?: string;
|
|
598
|
+
runtimeManifest?: BrowserSandboxRuntimeManifest;
|
|
599
|
+
packageJson?: {
|
|
600
|
+
dependencies?: Record<string, string>;
|
|
601
|
+
devDependencies?: Record<string, string>;
|
|
602
|
+
scripts?: Record<string, string>;
|
|
603
|
+
};
|
|
604
|
+
componentsJson?: unknown;
|
|
605
|
+
tsconfig?: {
|
|
606
|
+
baseUrl?: string | null;
|
|
607
|
+
paths?: Record<string, string[]>;
|
|
608
|
+
jsx?: string | null;
|
|
609
|
+
strict?: boolean | null;
|
|
610
|
+
noUnusedLocals?: boolean | null;
|
|
611
|
+
noUnusedParameters?: boolean | null;
|
|
612
|
+
};
|
|
613
|
+
files?: {
|
|
614
|
+
source?: string[];
|
|
615
|
+
root?: string[];
|
|
616
|
+
snapshot?: string[];
|
|
617
|
+
editable?: string[];
|
|
618
|
+
editableGlobs?: string[];
|
|
619
|
+
approvalRequiredGlobs?: string[];
|
|
620
|
+
styleEntries?: string[];
|
|
621
|
+
localModules?: string[];
|
|
622
|
+
};
|
|
623
|
+
validation?: {
|
|
624
|
+
typecheck?: string | null;
|
|
625
|
+
build?: string | null;
|
|
626
|
+
};
|
|
627
|
+
capabilities?: unknown;
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
export { }
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Context } from 'react';
|
|
1
2
|
import { JSX } from 'react/jsx-runtime';
|
|
2
3
|
import { ReactNode } from 'react';
|
|
3
4
|
|
|
@@ -13,8 +14,12 @@ export declare function normalizeSemaphorInputOptions(options?: Array<{
|
|
|
13
14
|
value: SemaphorDataAppOptionValue;
|
|
14
15
|
}[];
|
|
15
16
|
|
|
17
|
+
export declare function readWindowRuntime(): SemaphorDataAppWindowRuntime | undefined;
|
|
18
|
+
|
|
16
19
|
declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
|
|
17
20
|
|
|
21
|
+
export declare const SemaphorDataAppContext: Context<SemaphorDataAppRuntime>;
|
|
22
|
+
|
|
18
23
|
export declare type SemaphorDataAppControlInputSpec<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue> = SemaphorDataAppInputBase<TValue> & {
|
|
19
24
|
kind: 'control';
|
|
20
25
|
role: SemaphorDataAppControlRole;
|
|
@@ -233,6 +238,14 @@ export declare type SemaphorDataAppSourceSpec = {
|
|
|
233
238
|
sourceLabel?: string;
|
|
234
239
|
};
|
|
235
240
|
|
|
241
|
+
declare type SemaphorDataAppWindowRuntime = {
|
|
242
|
+
apiBaseUrl?: string;
|
|
243
|
+
dataApiBaseUrl?: string;
|
|
244
|
+
authToken?: null | {
|
|
245
|
+
accessToken?: string;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
|
|
236
249
|
declare type SemaphorDialect = 'semantic' | 'postgres' | 'mysql' | 'snowflake' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
|
|
237
250
|
|
|
238
251
|
declare type SemaphorFieldRef = {
|
|
@@ -240,6 +253,7 @@ declare type SemaphorFieldRef = {
|
|
|
240
253
|
label?: string;
|
|
241
254
|
role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
|
|
242
255
|
dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
|
|
256
|
+
source?: SemaphorSourceRef;
|
|
243
257
|
};
|
|
244
258
|
|
|
245
259
|
declare type SemaphorInputBinding = {
|
|
@@ -367,7 +381,7 @@ export declare function toSemaphorRecordsIntent(spec: SemaphorDataAppRecordsSpec
|
|
|
367
381
|
|
|
368
382
|
export declare function useSemaphorDataAppRuntime(): SemaphorDataAppRuntime;
|
|
369
383
|
|
|
370
|
-
export declare function useSemaphorInput<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue>(spec: SemaphorDataAppInputSpec<TValue>): SemaphorDataAppInputHandle
|
|
384
|
+
export declare function useSemaphorInput<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue>(spec: SemaphorDataAppInputSpec<TValue>): SemaphorDataAppInputHandle;
|
|
371
385
|
|
|
372
386
|
export declare function useSemaphorInputOptions(spec: SemaphorDataAppInputOptionsSpec): SemaphorDataAppInputOptionsResult;
|
|
373
387
|
|
|
@@ -107,6 +107,29 @@ export declare interface DateFormatOptions {
|
|
|
107
107
|
locale?: string;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
export declare type DurationDisplayStyle = 'compact' | 'digital' | 'long';
|
|
111
|
+
|
|
112
|
+
export declare interface DurationFormatOptions {
|
|
113
|
+
/** Unit represented by the raw numeric value. */
|
|
114
|
+
inputUnit?: DurationUnit;
|
|
115
|
+
/** Display style, e.g. "6min 32s", "06:32", or "6 minutes 32 seconds". */
|
|
116
|
+
outputStyle?: DurationDisplayStyle;
|
|
117
|
+
/** Largest unit to show. Defaults to day. */
|
|
118
|
+
largestUnit?: DurationUnit;
|
|
119
|
+
/** Smallest unit to show. Defaults to second. */
|
|
120
|
+
smallestUnit?: DurationUnit;
|
|
121
|
+
/** Maximum non-zero unit parts to show for compact/long output. */
|
|
122
|
+
maxUnits?: number;
|
|
123
|
+
/** Add prefix string before the formatted duration. */
|
|
124
|
+
prefix?: string;
|
|
125
|
+
/** Add suffix string after the formatted duration. */
|
|
126
|
+
suffix?: string;
|
|
127
|
+
/** Show negative durations in parentheses instead of a minus sign. */
|
|
128
|
+
negativeInParentheses?: boolean;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export declare type DurationUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
132
|
+
|
|
110
133
|
/**
|
|
111
134
|
* Escape a value for CSV output (RFC 4180 compliant)
|
|
112
135
|
* Wraps in quotes if value contains delimiter, quotes, or newlines
|
|
@@ -181,6 +204,8 @@ export declare function formatCurrency(value: number | null | undefined, options
|
|
|
181
204
|
*/
|
|
182
205
|
export declare const formatDate: (dateString: string | null | undefined, formatPattern: string | undefined, displayTimezone?: string, sourceTimezone?: string) => string;
|
|
183
206
|
|
|
207
|
+
export declare function formatDuration(value: number | string | null | undefined, options?: DurationFormatOptions): string;
|
|
208
|
+
|
|
184
209
|
/**
|
|
185
210
|
* Format a number with locale-aware formatting
|
|
186
211
|
*/
|