@xpert-ai/plugin-live-dashboard 0.4.1 → 0.6.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 (79) hide show
  1. package/.xpertai-plugin/plugin.json +1 -1
  2. package/README.md +8 -2
  3. package/dist/index.js +3 -1
  4. package/dist/lib/agent.schema.d.ts +177 -23
  5. package/dist/lib/agent.schema.js +11 -9
  6. package/dist/lib/archive.service.d.ts +169 -0
  7. package/dist/lib/archive.service.js +147 -0
  8. package/dist/lib/bounded-map.d.ts +2 -0
  9. package/dist/lib/bounded-map.js +25 -0
  10. package/dist/lib/capacity.d.ts +14 -0
  11. package/dist/lib/capacity.js +16 -0
  12. package/dist/lib/content.provider.d.ts +1 -1
  13. package/dist/lib/dashboard-archive.d.ts +70 -0
  14. package/dist/lib/dashboard-archive.js +118 -0
  15. package/dist/lib/dashboard-queries.d.ts +1 -1
  16. package/dist/lib/dashboard-queries.js +11 -6
  17. package/dist/lib/dashboard-receipt.js +1 -1
  18. package/dist/lib/dashboard-sources.d.ts +69 -0
  19. package/dist/lib/dashboard-sources.js +38 -0
  20. package/dist/lib/dashboard-view.schema.d.ts +422 -88
  21. package/dist/lib/dashboard.schema.d.ts +379 -58
  22. package/dist/lib/dashboard.schema.js +20 -2
  23. package/dist/lib/dashboard.service.d.ts +80 -15
  24. package/dist/lib/dashboard.service.js +65 -9
  25. package/dist/lib/definition-tools.d.ts +4 -4
  26. package/dist/lib/document-host.js +1 -1
  27. package/dist/lib/document-package.d.ts +19 -4
  28. package/dist/lib/editing-patch.d.ts +3 -0
  29. package/dist/lib/editing-patch.js +4 -2
  30. package/dist/lib/editing-session.d.ts +4 -4
  31. package/dist/lib/editing.d.ts +204 -20
  32. package/dist/lib/editing.js +10 -3
  33. package/dist/lib/filter-evidence.d.ts +28 -0
  34. package/dist/lib/filter-evidence.js +3 -2
  35. package/dist/lib/html-guidance.d.ts +1 -0
  36. package/dist/lib/html-guidance.js +2 -1
  37. package/dist/lib/html-validation-feedback.d.ts +7 -0
  38. package/dist/lib/html-validation-feedback.js +19 -0
  39. package/dist/lib/html-validation.js +3 -2
  40. package/dist/lib/inspection-host.d.ts +7 -0
  41. package/dist/lib/inspection-host.js +48 -0
  42. package/dist/lib/inspection-runtime.d.ts +2 -0
  43. package/dist/lib/inspection-runtime.js +77 -0
  44. package/dist/lib/json-input.d.ts +4 -0
  45. package/dist/lib/json-input.js +21 -0
  46. package/dist/lib/middleware.d.ts +3 -1
  47. package/dist/lib/middleware.js +92 -13
  48. package/dist/lib/plugin.js +3 -1
  49. package/dist/lib/presentation.provider.d.ts +24 -9
  50. package/dist/lib/presentation.provider.js +2 -1
  51. package/dist/lib/preview-retry.d.ts +4 -3
  52. package/dist/lib/preview-retry.js +13 -7
  53. package/dist/lib/prompt-workflows.js +1 -1
  54. package/dist/lib/query-session.d.ts +9 -0
  55. package/dist/lib/query-session.js +64 -0
  56. package/dist/lib/save-requests.d.ts +118 -0
  57. package/dist/lib/save-requests.js +199 -0
  58. package/dist/lib/source-executions.d.ts +437 -0
  59. package/dist/lib/source-executions.js +49 -0
  60. package/dist/lib/source-validation.d.ts +2 -0
  61. package/dist/lib/source-validation.js +21 -0
  62. package/dist/lib/view.provider.d.ts +213 -8
  63. package/dist/lib/view.provider.js +47 -5
  64. package/dist/remote/app.css +1 -1
  65. package/dist/remote/app.js +185 -63
  66. package/dist/remote/build-manifest.json +52 -33
  67. package/dist/sandbox-actions/action.json +1 -1
  68. package/dist/sandbox-actions/bundle/host.js +63 -14
  69. package/dist/sandbox-actions/bundle/validate.mjs +2 -2
  70. package/dist/validation/host-entry.d.ts +5 -1
  71. package/dist/validation/host-entry.js +21 -4
  72. package/docs/docs.json +5 -1
  73. package/docs/large-dashboards-acceptance.mdx +74 -0
  74. package/docs/large-dashboards.mdx +80 -0
  75. package/docs/sources-inspect-portability-acceptance.mdx +67 -0
  76. package/docs/sources-inspect-portability.mdx +115 -0
  77. package/package.json +8 -7
  78. package/skills/live-dashboard/SKILL.md +5 -4
  79. package/skills/live-dashboard/references/source-inspection.md +17 -0
@@ -0,0 +1,69 @@
1
+ import { z } from 'zod/v3';
2
+ import type { DashboardManifest } from './dashboard.schema';
3
+ export declare const componentId: z.ZodString;
4
+ export declare const sourceMetadataSchema: z.ZodArray<z.ZodObject<{
5
+ bindingId: z.ZodString;
6
+ title: z.ZodString;
7
+ description: z.ZodOptional<z.ZodString>;
8
+ }, "strict", z.ZodTypeAny, {
9
+ bindingId: string;
10
+ title: string;
11
+ description?: string | undefined;
12
+ }, {
13
+ bindingId: string;
14
+ title: string;
15
+ description?: string | undefined;
16
+ }>, "many">;
17
+ export declare const dashboardComponentsSchema: z.ZodArray<z.ZodObject<{
18
+ id: z.ZodString;
19
+ elementId: z.ZodString;
20
+ title: z.ZodString;
21
+ kind: z.ZodEnum<["metric", "chart", "table", "filter", "text"]>;
22
+ sources: z.ZodArray<z.ZodObject<{
23
+ bindingId: z.ZodString;
24
+ fieldIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
25
+ }, "strict", z.ZodTypeAny, {
26
+ bindingId: string;
27
+ fieldIds?: string[] | undefined;
28
+ }, {
29
+ bindingId: string;
30
+ fieldIds?: string[] | undefined;
31
+ }>, "many">;
32
+ }, "strict", z.ZodTypeAny, {
33
+ title: string;
34
+ id: string;
35
+ elementId: string;
36
+ kind: "filter" | "metric" | "chart" | "table" | "text";
37
+ sources: {
38
+ bindingId: string;
39
+ fieldIds?: string[] | undefined;
40
+ }[];
41
+ }, {
42
+ title: string;
43
+ id: string;
44
+ elementId: string;
45
+ kind: "filter" | "metric" | "chart" | "table" | "text";
46
+ sources: {
47
+ bindingId: string;
48
+ fieldIds?: string[] | undefined;
49
+ }[];
50
+ }>, "many">;
51
+ export type DashboardComponent = z.infer<typeof dashboardComponentsSchema>[number];
52
+ export declare function dashboardComponents(manifest: DashboardManifest): DashboardComponent[];
53
+ export declare function dashboardSources(manifest: DashboardManifest): {
54
+ binding: import("@xpert-ai/contracts").AnalyticsBinding;
55
+ title: string;
56
+ description: string | undefined;
57
+ components: {
58
+ title: string;
59
+ id: string;
60
+ elementId: string;
61
+ kind: "filter" | "metric" | "chart" | "table" | "text";
62
+ sources: {
63
+ bindingId: string;
64
+ fieldIds?: string[] | undefined;
65
+ }[];
66
+ }[];
67
+ }[];
68
+ /** A rendering projection never exposes provider-native query configuration to a viewer. */
69
+ export declare function publicDashboardManifest(manifest: DashboardManifest): DashboardManifest;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dashboardComponentsSchema = exports.sourceMetadataSchema = exports.componentId = void 0;
4
+ exports.dashboardComponents = dashboardComponents;
5
+ exports.dashboardSources = dashboardSources;
6
+ exports.publicDashboardManifest = publicDashboardManifest;
7
+ const capacity_1 = require("./capacity");
8
+ const v3_1 = require("zod/v3");
9
+ exports.componentId = v3_1.z.string().regex(/^[A-Za-z][A-Za-z0-9_.-]{0,79}$/);
10
+ exports.sourceMetadataSchema = v3_1.z.array(v3_1.z.object({
11
+ bindingId: exports.componentId, title: v3_1.z.string().min(1).max(160), description: v3_1.z.string().max(2000).optional()
12
+ }).strict()).max(capacity_1.MAX_DASHBOARD_BINDINGS);
13
+ exports.dashboardComponentsSchema = v3_1.z.array(v3_1.z.object({
14
+ id: exports.componentId, elementId: exports.componentId, title: v3_1.z.string().min(1).max(160),
15
+ kind: v3_1.z.enum(['metric', 'chart', 'table', 'filter', 'text']),
16
+ sources: v3_1.z.array(v3_1.z.object({ bindingId: exports.componentId, fieldIds: v3_1.z.array(exports.componentId).max(80).optional() }).strict()).max(capacity_1.MAX_DASHBOARD_BINDINGS)
17
+ }).strict()).max(160);
18
+ function dashboardComponents(manifest) {
19
+ if (manifest.presentation)
20
+ return manifest.components ?? [];
21
+ return [...manifest.charts, ...manifest.tables].map(view => ({
22
+ id: view.id, elementId: view.id, title: view.title, kind: 'fields' in view ? 'table' : 'chart',
23
+ sources: manifest.bindings.filter(binding => binding.output.datasetId === view.datasetId)
24
+ .map(binding => ({ bindingId: binding.id, fieldIds: 'fields' in view ? view.fields : [view.x, view.y, ...(view.color ? [view.color] : [])] }))
25
+ }));
26
+ }
27
+ function dashboardSources(manifest) {
28
+ const components = dashboardComponents(manifest);
29
+ return manifest.bindings.map(binding => ({
30
+ binding, title: manifest.sourceMetadata?.find(item => item.bindingId === binding.id)?.title ?? binding.id,
31
+ description: manifest.sourceMetadata?.find(item => item.bindingId === binding.id)?.description,
32
+ components: components.filter(component => component.sources.some(source => source.bindingId === binding.id))
33
+ }));
34
+ }
35
+ /** A rendering projection never exposes provider-native query configuration to a viewer. */
36
+ function publicDashboardManifest(manifest) {
37
+ return { ...manifest, bindings: manifest.bindings.map(binding => ({ ...binding, payload: {} })) };
38
+ }