@xpert-ai/plugin-live-dashboard 0.0.0-stage → 0.1.0

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 (95) hide show
  1. package/.xpertai-plugin/plugin.json +8 -0
  2. package/README.md +108 -2
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.js +11 -0
  5. package/dist/lib/agent.schema.d.ts +568 -0
  6. package/dist/lib/agent.schema.js +52 -0
  7. package/dist/lib/dashboard-icon.d.ts +5 -0
  8. package/dist/lib/dashboard-icon.js +8 -0
  9. package/dist/lib/dashboard-navigation.d.ts +38 -0
  10. package/dist/lib/dashboard-navigation.js +18 -0
  11. package/dist/lib/dashboard-queries.d.ts +8 -0
  12. package/dist/lib/dashboard-queries.js +39 -0
  13. package/dist/lib/dashboard-receipt.d.ts +11 -0
  14. package/dist/lib/dashboard-receipt.js +35 -0
  15. package/dist/lib/dashboard.schema.d.ts +816 -0
  16. package/dist/lib/dashboard.schema.js +74 -0
  17. package/dist/lib/dashboard.service.d.ts +243 -0
  18. package/dist/lib/dashboard.service.js +185 -0
  19. package/dist/lib/document-libraries.d.ts +8 -0
  20. package/dist/lib/document-libraries.js +41 -0
  21. package/dist/lib/document-package.d.ts +41 -0
  22. package/dist/lib/document-package.js +25 -0
  23. package/dist/lib/editing.d.ts +403 -0
  24. package/dist/lib/editing.js +114 -0
  25. package/dist/lib/filter-evidence.d.ts +71 -0
  26. package/dist/lib/filter-evidence.js +60 -0
  27. package/dist/lib/html-guidance.d.ts +1 -0
  28. package/dist/lib/html-guidance.js +4 -0
  29. package/dist/lib/html-validation.d.ts +19 -0
  30. package/dist/lib/html-validation.js +136 -0
  31. package/dist/lib/middleware.d.ts +10 -0
  32. package/dist/lib/middleware.js +225 -0
  33. package/dist/lib/plugin.d.ts +2 -0
  34. package/dist/lib/plugin.js +22 -0
  35. package/dist/lib/presentation.provider.d.ts +122 -0
  36. package/dist/lib/presentation.provider.js +72 -0
  37. package/dist/lib/remote-entry.d.ts +4 -0
  38. package/dist/lib/remote-entry.js +12 -0
  39. package/dist/lib/renderer.d.ts +58 -0
  40. package/dist/lib/renderer.js +32 -0
  41. package/dist/lib/resource-card.d.ts +21 -0
  42. package/dist/lib/resource-card.js +33 -0
  43. package/dist/lib/save-evidence.d.ts +24 -0
  44. package/dist/lib/save-evidence.js +99 -0
  45. package/dist/lib/sharing.service.d.ts +93 -0
  46. package/dist/lib/sharing.service.js +71 -0
  47. package/dist/lib/view.provider.d.ts +235 -0
  48. package/dist/lib/view.provider.js +103 -0
  49. package/dist/libraries/ECHARTS-LICENSE.txt +222 -0
  50. package/dist/libraries/ECHARTS-NOTICE.txt +5 -0
  51. package/dist/libraries/THREE-LICENSE.txt +21 -0
  52. package/dist/libraries/catalog.json +1 -0
  53. package/dist/remote/app.css +1 -0
  54. package/dist/remote/app.js +253 -0
  55. package/dist/remote/build-manifest.json +63 -0
  56. package/dist/remote/renderer-source.json +5 -0
  57. package/dist/remote/renderer.html +4653 -0
  58. package/dist/sandbox-actions/action.json +10 -0
  59. package/dist/sandbox-actions/bundle/host.js +149 -0
  60. package/dist/sandbox-actions/bundle/runner.mjs +15 -0
  61. package/dist/sandbox-actions/bundle/validate.mjs +140 -0
  62. package/dist/validation/host-entry.d.ts +1 -0
  63. package/dist/validation/host-entry.js +6 -0
  64. package/docs/AGENTS.md +9 -0
  65. package/docs/acceptance.md +89 -0
  66. package/docs/agent-acceptance.md +96 -0
  67. package/docs/chat-resource-cards.mdx +60 -0
  68. package/docs/docs.json +49 -0
  69. package/docs/drafts-acceptance.mdx +42 -0
  70. package/docs/drafts.mdx +35 -0
  71. package/docs/editing.mdx +63 -0
  72. package/docs/evolution-acceptance.mdx +98 -0
  73. package/docs/file-authoring-acceptance.mdx +62 -0
  74. package/docs/file-authoring.mdx +49 -0
  75. package/docs/file-datasets-acceptance.mdx +65 -0
  76. package/docs/fixed-build-multimodel-acceptance.mdx +129 -0
  77. package/docs/frontend-libraries-acceptance.mdx +86 -0
  78. package/docs/frontend-libraries.mdx +57 -0
  79. package/docs/html-acceptance.md +86 -0
  80. package/docs/html-mode.md +76 -0
  81. package/docs/index.mdx +47 -0
  82. package/docs/retry-regression-acceptance.mdx +112 -0
  83. package/docs/team-sharing-acceptance.mdx +66 -0
  84. package/docs/team-sharing.mdx +44 -0
  85. package/docs/verification.mdx +91 -0
  86. package/examples/assistant-middleware.yaml +28 -0
  87. package/examples/data-xpert-sales.json +118 -0
  88. package/examples/postgres-sales.json +93 -0
  89. package/index.cjs +1 -0
  90. package/package.json +73 -3
  91. package/skills/live-dashboard/SKILL.md +71 -0
  92. package/skills/live-dashboard/agents/xpertai.yaml +21 -0
  93. package/skills/live-dashboard/references/data-validation.md +15 -0
  94. package/skills/live-dashboard/references/html-lifecycle.md +129 -0
  95. package/skills/live-dashboard/references/html-runtime.md +53 -0
@@ -0,0 +1,568 @@
1
+ import { z } from 'zod/v3';
2
+ import type { AnalyticsDiscoveryResult } from '@xpert-ai/contracts';
3
+ export declare const discoverToolSchema: z.ZodObject<{
4
+ dataSourceId: z.ZodString;
5
+ providerId: z.ZodString;
6
+ requestJson: z.ZodDefault<z.ZodString>;
7
+ }, "strict", z.ZodTypeAny, {
8
+ dataSourceId: string;
9
+ providerId: string;
10
+ requestJson: string;
11
+ }, {
12
+ dataSourceId: string;
13
+ providerId: string;
14
+ requestJson?: string | undefined;
15
+ }>;
16
+ export declare const agentBindingSchema: z.ZodObject<{
17
+ dataSourceId: z.ZodString;
18
+ providerId: z.ZodString;
19
+ output: z.ZodObject<{
20
+ datasetId: z.ZodString;
21
+ fields: z.ZodArray<z.ZodObject<{
22
+ id: z.ZodString;
23
+ sourceField: z.ZodString;
24
+ label: z.ZodString;
25
+ logicalType: z.ZodEnum<["string", "boolean", "int64", "float64", "decimal", "date", "timestamp"]>;
26
+ nullable: z.ZodBoolean;
27
+ role: z.ZodEnum<["dimension", "measure", "time", "identifier"]>;
28
+ semanticRef: z.ZodOptional<z.ZodString>;
29
+ unit: z.ZodOptional<z.ZodString>;
30
+ }, "strict", z.ZodTypeAny, {
31
+ id?: string;
32
+ sourceField?: string;
33
+ label?: string;
34
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
35
+ nullable?: boolean;
36
+ role?: "dimension" | "measure" | "time" | "identifier";
37
+ semanticRef?: string;
38
+ unit?: string;
39
+ }, {
40
+ id?: string;
41
+ sourceField?: string;
42
+ label?: string;
43
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
44
+ nullable?: boolean;
45
+ role?: "dimension" | "measure" | "time" | "identifier";
46
+ semanticRef?: string;
47
+ unit?: string;
48
+ }>, "many">;
49
+ grain: z.ZodArray<z.ZodString, "many">;
50
+ }, "strict", z.ZodTypeAny, {
51
+ datasetId?: string;
52
+ fields?: {
53
+ id?: string;
54
+ sourceField?: string;
55
+ label?: string;
56
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
57
+ nullable?: boolean;
58
+ role?: "dimension" | "measure" | "time" | "identifier";
59
+ semanticRef?: string;
60
+ unit?: string;
61
+ }[];
62
+ grain?: string[];
63
+ }, {
64
+ datasetId?: string;
65
+ fields?: {
66
+ id?: string;
67
+ sourceField?: string;
68
+ label?: string;
69
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
70
+ nullable?: boolean;
71
+ role?: "dimension" | "measure" | "time" | "identifier";
72
+ semanticRef?: string;
73
+ unit?: string;
74
+ }[];
75
+ grain?: string[];
76
+ }>;
77
+ } & {
78
+ parameters: z.ZodArray<z.ZodObject<Omit<{
79
+ name: z.ZodString;
80
+ controlId: z.ZodString;
81
+ type: z.ZodEnum<["string", "number", "boolean", "date"]>;
82
+ required: z.ZodBoolean;
83
+ defaultValue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
84
+ allowedValues: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">>;
85
+ }, "controlId">, "strict", z.ZodTypeAny, {
86
+ type: "string" | "number" | "boolean" | "date";
87
+ name: string;
88
+ required: boolean;
89
+ defaultValue?: string | number | boolean | null | undefined;
90
+ allowedValues?: (string | number | boolean | null)[] | undefined;
91
+ }, {
92
+ type: "string" | "number" | "boolean" | "date";
93
+ name: string;
94
+ required: boolean;
95
+ defaultValue?: string | number | boolean | null | undefined;
96
+ allowedValues?: (string | number | boolean | null)[] | undefined;
97
+ }>, "many">;
98
+ payloadJson: z.ZodString;
99
+ }, "strict", z.ZodTypeAny, {
100
+ parameters: {
101
+ type: "string" | "number" | "boolean" | "date";
102
+ name: string;
103
+ required: boolean;
104
+ defaultValue?: string | number | boolean | null | undefined;
105
+ allowedValues?: (string | number | boolean | null)[] | undefined;
106
+ }[];
107
+ dataSourceId: string;
108
+ providerId: string;
109
+ output: {
110
+ datasetId?: string;
111
+ fields?: {
112
+ id?: string;
113
+ sourceField?: string;
114
+ label?: string;
115
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
116
+ nullable?: boolean;
117
+ role?: "dimension" | "measure" | "time" | "identifier";
118
+ semanticRef?: string;
119
+ unit?: string;
120
+ }[];
121
+ grain?: string[];
122
+ };
123
+ payloadJson: string;
124
+ }, {
125
+ parameters: {
126
+ type: "string" | "number" | "boolean" | "date";
127
+ name: string;
128
+ required: boolean;
129
+ defaultValue?: string | number | boolean | null | undefined;
130
+ allowedValues?: (string | number | boolean | null)[] | undefined;
131
+ }[];
132
+ dataSourceId: string;
133
+ providerId: string;
134
+ output: {
135
+ datasetId?: string;
136
+ fields?: {
137
+ id?: string;
138
+ sourceField?: string;
139
+ label?: string;
140
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
141
+ nullable?: boolean;
142
+ role?: "dimension" | "measure" | "time" | "identifier";
143
+ semanticRef?: string;
144
+ unit?: string;
145
+ }[];
146
+ grain?: string[];
147
+ };
148
+ payloadJson: string;
149
+ }>;
150
+ export declare const previewToolSchema: z.ZodObject<{
151
+ binding: z.ZodObject<{
152
+ dataSourceId: z.ZodString;
153
+ providerId: z.ZodString;
154
+ output: z.ZodObject<{
155
+ datasetId: z.ZodString;
156
+ fields: z.ZodArray<z.ZodObject<{
157
+ id: z.ZodString;
158
+ sourceField: z.ZodString;
159
+ label: z.ZodString;
160
+ logicalType: z.ZodEnum<["string", "boolean", "int64", "float64", "decimal", "date", "timestamp"]>;
161
+ nullable: z.ZodBoolean;
162
+ role: z.ZodEnum<["dimension", "measure", "time", "identifier"]>;
163
+ semanticRef: z.ZodOptional<z.ZodString>;
164
+ unit: z.ZodOptional<z.ZodString>;
165
+ }, "strict", z.ZodTypeAny, {
166
+ id?: string;
167
+ sourceField?: string;
168
+ label?: string;
169
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
170
+ nullable?: boolean;
171
+ role?: "dimension" | "measure" | "time" | "identifier";
172
+ semanticRef?: string;
173
+ unit?: string;
174
+ }, {
175
+ id?: string;
176
+ sourceField?: string;
177
+ label?: string;
178
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
179
+ nullable?: boolean;
180
+ role?: "dimension" | "measure" | "time" | "identifier";
181
+ semanticRef?: string;
182
+ unit?: string;
183
+ }>, "many">;
184
+ grain: z.ZodArray<z.ZodString, "many">;
185
+ }, "strict", z.ZodTypeAny, {
186
+ datasetId?: string;
187
+ fields?: {
188
+ id?: string;
189
+ sourceField?: string;
190
+ label?: string;
191
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
192
+ nullable?: boolean;
193
+ role?: "dimension" | "measure" | "time" | "identifier";
194
+ semanticRef?: string;
195
+ unit?: string;
196
+ }[];
197
+ grain?: string[];
198
+ }, {
199
+ datasetId?: string;
200
+ fields?: {
201
+ id?: string;
202
+ sourceField?: string;
203
+ label?: string;
204
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
205
+ nullable?: boolean;
206
+ role?: "dimension" | "measure" | "time" | "identifier";
207
+ semanticRef?: string;
208
+ unit?: string;
209
+ }[];
210
+ grain?: string[];
211
+ }>;
212
+ } & {
213
+ parameters: z.ZodArray<z.ZodObject<Omit<{
214
+ name: z.ZodString;
215
+ controlId: z.ZodString;
216
+ type: z.ZodEnum<["string", "number", "boolean", "date"]>;
217
+ required: z.ZodBoolean;
218
+ defaultValue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
219
+ allowedValues: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">>;
220
+ }, "controlId">, "strict", z.ZodTypeAny, {
221
+ type: "string" | "number" | "boolean" | "date";
222
+ name: string;
223
+ required: boolean;
224
+ defaultValue?: string | number | boolean | null | undefined;
225
+ allowedValues?: (string | number | boolean | null)[] | undefined;
226
+ }, {
227
+ type: "string" | "number" | "boolean" | "date";
228
+ name: string;
229
+ required: boolean;
230
+ defaultValue?: string | number | boolean | null | undefined;
231
+ allowedValues?: (string | number | boolean | null)[] | undefined;
232
+ }>, "many">;
233
+ payloadJson: z.ZodString;
234
+ }, "strict", z.ZodTypeAny, {
235
+ parameters: {
236
+ type: "string" | "number" | "boolean" | "date";
237
+ name: string;
238
+ required: boolean;
239
+ defaultValue?: string | number | boolean | null | undefined;
240
+ allowedValues?: (string | number | boolean | null)[] | undefined;
241
+ }[];
242
+ dataSourceId: string;
243
+ providerId: string;
244
+ output: {
245
+ datasetId?: string;
246
+ fields?: {
247
+ id?: string;
248
+ sourceField?: string;
249
+ label?: string;
250
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
251
+ nullable?: boolean;
252
+ role?: "dimension" | "measure" | "time" | "identifier";
253
+ semanticRef?: string;
254
+ unit?: string;
255
+ }[];
256
+ grain?: string[];
257
+ };
258
+ payloadJson: string;
259
+ }, {
260
+ parameters: {
261
+ type: "string" | "number" | "boolean" | "date";
262
+ name: string;
263
+ required: boolean;
264
+ defaultValue?: string | number | boolean | null | undefined;
265
+ allowedValues?: (string | number | boolean | null)[] | undefined;
266
+ }[];
267
+ dataSourceId: string;
268
+ providerId: string;
269
+ output: {
270
+ datasetId?: string;
271
+ fields?: {
272
+ id?: string;
273
+ sourceField?: string;
274
+ label?: string;
275
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
276
+ nullable?: boolean;
277
+ role?: "dimension" | "measure" | "time" | "identifier";
278
+ semanticRef?: string;
279
+ unit?: string;
280
+ }[];
281
+ grain?: string[];
282
+ };
283
+ payloadJson: string;
284
+ }>;
285
+ }, "strict", z.ZodTypeAny, {
286
+ binding: {
287
+ parameters: {
288
+ type: "string" | "number" | "boolean" | "date";
289
+ name: string;
290
+ required: boolean;
291
+ defaultValue?: string | number | boolean | null | undefined;
292
+ allowedValues?: (string | number | boolean | null)[] | undefined;
293
+ }[];
294
+ dataSourceId: string;
295
+ providerId: string;
296
+ output: {
297
+ datasetId?: string;
298
+ fields?: {
299
+ id?: string;
300
+ sourceField?: string;
301
+ label?: string;
302
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
303
+ nullable?: boolean;
304
+ role?: "dimension" | "measure" | "time" | "identifier";
305
+ semanticRef?: string;
306
+ unit?: string;
307
+ }[];
308
+ grain?: string[];
309
+ };
310
+ payloadJson: string;
311
+ };
312
+ }, {
313
+ binding: {
314
+ parameters: {
315
+ type: "string" | "number" | "boolean" | "date";
316
+ name: string;
317
+ required: boolean;
318
+ defaultValue?: string | number | boolean | null | undefined;
319
+ allowedValues?: (string | number | boolean | null)[] | undefined;
320
+ }[];
321
+ dataSourceId: string;
322
+ providerId: string;
323
+ output: {
324
+ datasetId?: string;
325
+ fields?: {
326
+ id?: string;
327
+ sourceField?: string;
328
+ label?: string;
329
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
330
+ nullable?: boolean;
331
+ role?: "dimension" | "measure" | "time" | "identifier";
332
+ semanticRef?: string;
333
+ unit?: string;
334
+ }[];
335
+ grain?: string[];
336
+ };
337
+ payloadJson: string;
338
+ };
339
+ }>;
340
+ export declare const createToolSchema: z.ZodObject<{} & {
341
+ title: z.ZodString;
342
+ supersedesPaths: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
343
+ controls: z.ZodEffects<z.ZodArray<z.ZodObject<{
344
+ controlId: z.ZodString;
345
+ type: z.ZodEnum<["string", "number", "boolean", "date"]>;
346
+ allowedValues: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">>;
347
+ label: z.ZodString;
348
+ } & {
349
+ defaultValue: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
350
+ }, "strict", z.ZodTypeAny, {
351
+ type: "string" | "number" | "boolean" | "date";
352
+ controlId: string;
353
+ defaultValue: string | number | boolean | null;
354
+ label: string;
355
+ allowedValues?: (string | number | boolean | null)[] | undefined;
356
+ }, {
357
+ type: "string" | "number" | "boolean" | "date";
358
+ controlId: string;
359
+ defaultValue: string | number | boolean | null;
360
+ label: string;
361
+ allowedValues?: (string | number | boolean | null)[] | undefined;
362
+ }>, "many">, {
363
+ type: "string" | "number" | "boolean" | "date";
364
+ controlId: string;
365
+ defaultValue: string | number | boolean | null;
366
+ label: string;
367
+ allowedValues?: (string | number | boolean | null)[] | undefined;
368
+ }[], unknown>;
369
+ charts: z.ZodEffects<z.ZodArray<z.ZodObject<{
370
+ id: z.ZodString;
371
+ title: z.ZodString;
372
+ type: z.ZodEnum<["bar", "line", "area", "pie", "scatter"]>;
373
+ datasetId: z.ZodString;
374
+ x: z.ZodString;
375
+ y: z.ZodString;
376
+ color: z.ZodOptional<z.ZodString>;
377
+ }, "strict", z.ZodTypeAny, {
378
+ type: "bar" | "line" | "area" | "pie" | "scatter";
379
+ id: string;
380
+ title: string;
381
+ datasetId: string;
382
+ x: string;
383
+ y: string;
384
+ color?: string | undefined;
385
+ }, {
386
+ type: "bar" | "line" | "area" | "pie" | "scatter";
387
+ id: string;
388
+ title: string;
389
+ datasetId: string;
390
+ x: string;
391
+ y: string;
392
+ color?: string | undefined;
393
+ }>, "many">, {
394
+ type: "bar" | "line" | "area" | "pie" | "scatter";
395
+ id: string;
396
+ title: string;
397
+ datasetId: string;
398
+ x: string;
399
+ y: string;
400
+ color?: string | undefined;
401
+ }[], unknown>;
402
+ tables: z.ZodEffects<z.ZodArray<z.ZodObject<{
403
+ id: z.ZodString;
404
+ title: z.ZodString;
405
+ datasetId: z.ZodString;
406
+ fields: z.ZodArray<z.ZodString, "many">;
407
+ }, "strict", z.ZodTypeAny, {
408
+ id: string;
409
+ title: string;
410
+ datasetId: string;
411
+ fields: string[];
412
+ }, {
413
+ id: string;
414
+ title: string;
415
+ datasetId: string;
416
+ fields: string[];
417
+ }>, "many">, {
418
+ id: string;
419
+ title: string;
420
+ datasetId: string;
421
+ fields: string[];
422
+ }[], unknown>;
423
+ previewIds: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
424
+ }, "strict", z.ZodTypeAny, {
425
+ title: string;
426
+ controls: {
427
+ type: "string" | "number" | "boolean" | "date";
428
+ controlId: string;
429
+ defaultValue: string | number | boolean | null;
430
+ label: string;
431
+ allowedValues?: (string | number | boolean | null)[] | undefined;
432
+ }[];
433
+ charts: {
434
+ type: "bar" | "line" | "area" | "pie" | "scatter";
435
+ id: string;
436
+ title: string;
437
+ datasetId: string;
438
+ x: string;
439
+ y: string;
440
+ color?: string | undefined;
441
+ }[];
442
+ tables: {
443
+ id: string;
444
+ title: string;
445
+ datasetId: string;
446
+ fields: string[];
447
+ }[];
448
+ previewIds: string[];
449
+ supersedesPaths?: string[] | undefined;
450
+ }, {
451
+ title: string;
452
+ controls?: unknown;
453
+ charts?: unknown;
454
+ tables?: unknown;
455
+ supersedesPaths?: string[] | undefined;
456
+ previewIds?: unknown;
457
+ }>;
458
+ export declare const htmlPathSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
459
+ export declare const createHtmlToolSchema: z.ZodObject<Omit<{} & {
460
+ title: z.ZodString;
461
+ supersedesPaths: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
462
+ controls: z.ZodEffects<z.ZodArray<z.ZodObject<{
463
+ controlId: z.ZodString;
464
+ type: z.ZodEnum<["string", "number", "boolean", "date"]>;
465
+ allowedValues: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">>;
466
+ label: z.ZodString;
467
+ } & {
468
+ defaultValue: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
469
+ }, "strict", z.ZodTypeAny, {
470
+ type: "string" | "number" | "boolean" | "date";
471
+ controlId: string;
472
+ defaultValue: string | number | boolean | null;
473
+ label: string;
474
+ allowedValues?: (string | number | boolean | null)[] | undefined;
475
+ }, {
476
+ type: "string" | "number" | "boolean" | "date";
477
+ controlId: string;
478
+ defaultValue: string | number | boolean | null;
479
+ label: string;
480
+ allowedValues?: (string | number | boolean | null)[] | undefined;
481
+ }>, "many">, {
482
+ type: "string" | "number" | "boolean" | "date";
483
+ controlId: string;
484
+ defaultValue: string | number | boolean | null;
485
+ label: string;
486
+ allowedValues?: (string | number | boolean | null)[] | undefined;
487
+ }[], unknown>;
488
+ charts: z.ZodEffects<z.ZodArray<z.ZodObject<{
489
+ id: z.ZodString;
490
+ title: z.ZodString;
491
+ type: z.ZodEnum<["bar", "line", "area", "pie", "scatter"]>;
492
+ datasetId: z.ZodString;
493
+ x: z.ZodString;
494
+ y: z.ZodString;
495
+ color: z.ZodOptional<z.ZodString>;
496
+ }, "strict", z.ZodTypeAny, {
497
+ type: "bar" | "line" | "area" | "pie" | "scatter";
498
+ id: string;
499
+ title: string;
500
+ datasetId: string;
501
+ x: string;
502
+ y: string;
503
+ color?: string | undefined;
504
+ }, {
505
+ type: "bar" | "line" | "area" | "pie" | "scatter";
506
+ id: string;
507
+ title: string;
508
+ datasetId: string;
509
+ x: string;
510
+ y: string;
511
+ color?: string | undefined;
512
+ }>, "many">, {
513
+ type: "bar" | "line" | "area" | "pie" | "scatter";
514
+ id: string;
515
+ title: string;
516
+ datasetId: string;
517
+ x: string;
518
+ y: string;
519
+ color?: string | undefined;
520
+ }[], unknown>;
521
+ tables: z.ZodEffects<z.ZodArray<z.ZodObject<{
522
+ id: z.ZodString;
523
+ title: z.ZodString;
524
+ datasetId: z.ZodString;
525
+ fields: z.ZodArray<z.ZodString, "many">;
526
+ }, "strict", z.ZodTypeAny, {
527
+ id: string;
528
+ title: string;
529
+ datasetId: string;
530
+ fields: string[];
531
+ }, {
532
+ id: string;
533
+ title: string;
534
+ datasetId: string;
535
+ fields: string[];
536
+ }>, "many">, {
537
+ id: string;
538
+ title: string;
539
+ datasetId: string;
540
+ fields: string[];
541
+ }[], unknown>;
542
+ previewIds: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
543
+ }, "charts" | "tables"> & {
544
+ path: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
545
+ libraries: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodEnum<["echarts", "three"]>, "many">, ("echarts" | "three")[], ("echarts" | "three")[]>>;
546
+ }, "strict", z.ZodTypeAny, {
547
+ path: string;
548
+ title: string;
549
+ controls: {
550
+ type: "string" | "number" | "boolean" | "date";
551
+ controlId: string;
552
+ defaultValue: string | number | boolean | null;
553
+ label: string;
554
+ allowedValues?: (string | number | boolean | null)[] | undefined;
555
+ }[];
556
+ previewIds: string[];
557
+ supersedesPaths?: string[] | undefined;
558
+ libraries?: ("echarts" | "three")[] | undefined;
559
+ }, {
560
+ path: string;
561
+ title: string;
562
+ controls?: unknown;
563
+ supersedesPaths?: string[] | undefined;
564
+ previewIds?: unknown;
565
+ libraries?: ("echarts" | "three")[] | undefined;
566
+ }>;
567
+ export declare function parseObjectJson(text: string): Record<string, import("@xpert-ai/contracts").JSONValue>;
568
+ export declare function fromAgentBinding(input: z.infer<typeof agentBindingSchema>, contract: AnalyticsDiscoveryResult['queryContract']): import("@xpert-ai/contracts").AnalyticsBinding;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createHtmlToolSchema = exports.htmlPathSchema = exports.createToolSchema = exports.previewToolSchema = exports.agentBindingSchema = exports.discoverToolSchema = void 0;
4
+ exports.parseObjectJson = parseObjectJson;
5
+ exports.fromAgentBinding = fromAgentBinding;
6
+ const v3_1 = require("zod/v3");
7
+ const analytics_1 = require("@xpert-ai/plugin-sdk/analytics");
8
+ const dashboard_schema_1 = require("./dashboard.schema");
9
+ const plugin_sdk_1 = require("@xpert-ai/plugin-sdk");
10
+ const document_libraries_1 = require("./document-libraries");
11
+ // LLM tool schemas cannot reliably express recursive JSON unions. Only this model boundary uses JSON text.
12
+ const objectJson = v3_1.z.string().min(2).max(64000).describe('A JSON object encoded as text. Use the exact provider-owned contract from discovery. No Markdown fences.');
13
+ const agentControlsSchema = v3_1.z.array(dashboard_schema_1.dashboardSchema.innerType().shape.controls.element.extend({
14
+ defaultValue: dashboard_schema_1.dashboardSchema.innerType().shape.controls.element.shape.defaultValue.unwrap()
15
+ .describe('Required: copy the verified Binding parameter defaultValue, including explicit null for an all-values filter.')
16
+ })).max(24);
17
+ exports.discoverToolSchema = v3_1.z.object({ dataSourceId: v3_1.z.string().uuid(), providerId: v3_1.z.string().min(1).max(160),
18
+ requestJson: objectJson.default('{}').describe('JSON text. Start with "{}"; then JSON.stringify the returned inspectRequest/nextRequest directly. Do not wrap it in inspectRequest.') }).strict();
19
+ exports.agentBindingSchema = analytics_1.analyticsBindingObjectSchema.omit({ payload: true, schemaVersion: true, id: true, operation: true, contractVersion: true }).extend({
20
+ parameters: v3_1.z.array(analytics_1.analyticsBindingObjectSchema.shape.parameters.element.omit({ controlId: true })).max(24),
21
+ payloadJson: objectJson
22
+ }).strict();
23
+ exports.previewToolSchema = v3_1.z.object({ binding: exports.agentBindingSchema }).strict();
24
+ exports.createToolSchema = dashboard_schema_1.dashboardSchema.innerType().omit({ schema: true, id: true, bindings: true, presentation: true }).extend({
25
+ title: dashboard_schema_1.dashboardSchema.innerType().shape.title.describe('Saved Artifact title. When renaming an HTML dashboard, include the new title in the SAME dashboard_update call as htmlPath; changing the HTML heading alone does not rename the saved Artifact.'),
26
+ supersedesPaths: v3_1.z.array(plugin_sdk_1.workspaceRelativeFilePathSchema).max(16).optional().describe('Explicitly abandon earlier unsaved HTML creation candidates after this dashboard saves successfully. Copy exact pending paths; never include an Artifact editing copy. Files are not deleted or claimed as saved. Also use when choosing a standard dashboard instead of an HTML prototype.'),
27
+ controls: (0, plugin_sdk_1.jsonEncodedSchema)(agentControlsSchema),
28
+ charts: (0, plugin_sdk_1.jsonEncodedSchema)(dashboard_schema_1.dashboardSchema.innerType().shape.charts),
29
+ tables: (0, plugin_sdk_1.jsonEncodedSchema)(dashboard_schema_1.dashboardSchema.innerType().shape.tables),
30
+ previewIds: (0, plugin_sdk_1.jsonEncodedSchema)(v3_1.z.array(v3_1.z.string().min(1)).min(1).max(8).describe('Exact previewId receipts from successful dashboard_preview calls. Do not repeat bindings.'))
31
+ }).strict();
32
+ exports.htmlPathSchema = plugin_sdk_1.workspaceRelativeFilePathSchema.refine(path => {
33
+ const name = path.split('/').at(-1) ?? '';
34
+ return path.length <= 300 && /\.html$/i.test(name) && name.slice(0, -5).trim().length > 0 && !name.startsWith('.');
35
+ }, 'Use a named HTML file such as dashboards/sales.html; .html alone is not a dashboard filename.')
36
+ .describe('Workspace-relative HTML file created or edited with SandboxFile, for example dashboards/sales.html. Copy the complete htmlPath from dashboard_open when editing.');
37
+ exports.createHtmlToolSchema = exports.createToolSchema.omit({ charts: true, tables: true }).extend({ path: exports.htmlPathSchema,
38
+ libraries: document_libraries_1.libraryRequestsSchema.optional().describe('Bundled library IDs from dashboard_libraries. Omit for native SVG/Canvas/DOM; use ["echarts"] for ECharts or ["three"] for Three.js.') }).strict();
39
+ function parseObjectJson(text) {
40
+ try {
41
+ return analytics_1.analyticsOptionsSchema.parse(JSON.parse(text));
42
+ }
43
+ catch {
44
+ throw new Error('DASHBOARD_INVALID_JSON: supply a JSON object encoded as text, matching the returned provider contract');
45
+ }
46
+ }
47
+ function fromAgentBinding(input, contract) {
48
+ const { payloadJson, ...binding } = input;
49
+ return analytics_1.analyticsBindingSchema.parse({ ...binding, schemaVersion: 1, id: input.output.datasetId,
50
+ operation: contract.operation, contractVersion: contract.contractVersion,
51
+ parameters: input.parameters.map(parameter => ({ ...parameter, controlId: parameter.name })), payload: parseObjectJson(payloadJson) });
52
+ }
@@ -0,0 +1,5 @@
1
+ /** Self-contained for hosts that do not load the plugin's icon font. */
2
+ export declare const dashboardIcon: {
3
+ type: "svg";
4
+ value: string;
5
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dashboardIcon = void 0;
4
+ /** Self-contained for hosts that do not load the plugin's icon font. */
5
+ exports.dashboardIcon = {
6
+ type: 'svg',
7
+ value: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="3"/><path d="M7 16v-4m5 4V7m5 9v-6"/></svg>'
8
+ };
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod/v3';
2
+ export declare const DASHBOARD_VIEW_KEY = "live-dashboard__live-dashboard";
3
+ export declare const dashboardNavigationSchema: z.ZodEffects<z.ZodObject<{
4
+ selectionId: z.ZodOptional<z.ZodString>;
5
+ parameters: z.ZodOptional<z.ZodObject<{
6
+ artifactId: z.ZodOptional<z.ZodString>;
7
+ versionId: z.ZodOptional<z.ZodString>;
8
+ }, "strict", z.ZodTypeAny, {
9
+ artifactId?: string | undefined;
10
+ versionId?: string | undefined;
11
+ }, {
12
+ artifactId?: string | undefined;
13
+ versionId?: string | undefined;
14
+ }>>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ selectionId?: string | undefined;
17
+ parameters?: {
18
+ artifactId?: string | undefined;
19
+ versionId?: string | undefined;
20
+ } | undefined;
21
+ }, {
22
+ selectionId?: string | undefined;
23
+ parameters?: {
24
+ artifactId?: string | undefined;
25
+ versionId?: string | undefined;
26
+ } | undefined;
27
+ }>, {
28
+ artifactId: string | undefined;
29
+ versionId: string | undefined;
30
+ }, {
31
+ selectionId?: string | undefined;
32
+ parameters?: {
33
+ artifactId?: string | undefined;
34
+ versionId?: string | undefined;
35
+ } | undefined;
36
+ }>;
37
+ export type DashboardNavigation = z.infer<typeof dashboardNavigationSchema>;
38
+ export declare const dashboardNavigationKey: (target: DashboardNavigation) => string;