@xpert-ai/plugin-live-dashboard 0.6.2 → 0.7.1
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/.xpertai-plugin/plugin.json +1 -1
- package/README.md +14 -2
- package/assets/explore/PROVENANCE.md +9 -0
- package/assets/explore/category-contribution.webp +0 -0
- package/assets/explore/ecommerce-operations.webp +0 -0
- package/assets/explore/extensions.svg +1 -0
- package/assets/explore/generation-prompts.json +107 -0
- package/assets/explore/global-assets.webp +0 -0
- package/assets/explore/hotel-cancellation.webp +0 -0
- package/assets/explore/hotel-operations.webp +0 -0
- package/assets/explore/insights.svg +1 -0
- package/assets/explore/knowledge.svg +1 -0
- package/assets/explore/legal-defense.webp +0 -0
- package/assets/explore/order-promotion.webp +0 -0
- package/assets/explore/outbound-travel.webp +0 -0
- package/assets/explore/schedule.svg +1 -0
- package/assets/explore/steam-market.webp +0 -0
- package/assets/explore/weather-alerts.webp +0 -0
- package/assets/library/catalog/README.md +11 -0
- package/assets/library/catalog/analysis-template-conversion-diagnosis.svg +1 -0
- package/assets/library/catalog/analysis-template-customer-lifecycle.svg +1 -0
- package/assets/library/catalog/analysis-template-growth-attribution.svg +1 -0
- package/assets/library/catalog/analysis-template-multi-criteria.svg +1 -0
- package/assets/library/catalog/analysis-template-regional-flow.svg +1 -0
- package/assets/library/catalog/analysis-template-risk-monitoring.svg +1 -0
- package/assets/library/catalog/component-analysis-note.svg +1 -0
- package/assets/library/catalog/component-box-plot.svg +1 -0
- package/assets/library/catalog/component-bullet.svg +1 -0
- package/assets/library/catalog/component-calendar-heatmap.svg +1 -0
- package/assets/library/catalog/component-collapsible-panel.svg +1 -0
- package/assets/library/catalog/component-combo-chart.svg +1 -0
- package/assets/library/catalog/component-content-panel.svg +1 -0
- package/assets/library/catalog/component-date-range.svg +1 -0
- package/assets/library/catalog/component-detail-table.svg +1 -0
- package/assets/library/catalog/component-donut.svg +1 -0
- package/assets/library/catalog/component-dumbbell.svg +1 -0
- package/assets/library/catalog/component-event-timeline.svg +1 -0
- package/assets/library/catalog/component-funnel.svg +1 -0
- package/assets/library/catalog/component-histogram.svg +1 -0
- package/assets/library/catalog/component-keyword-filter.svg +1 -0
- package/assets/library/catalog/component-matrix-heatmap.svg +1 -0
- package/assets/library/catalog/component-metric-card.svg +1 -0
- package/assets/library/catalog/component-metric-group.svg +1 -0
- package/assets/library/catalog/component-multi-series.svg +1 -0
- package/assets/library/catalog/component-number-range.svg +1 -0
- package/assets/library/catalog/component-option-filter.svg +1 -0
- package/assets/library/catalog/component-pareto.svg +1 -0
- package/assets/library/catalog/component-percent-stacked.svg +1 -0
- package/assets/library/catalog/component-pivot-table.svg +1 -0
- package/assets/library/catalog/component-radar.svg +1 -0
- package/assets/library/catalog/component-ranking.svg +1 -0
- package/assets/library/catalog/component-sankey.svg +1 -0
- package/assets/library/catalog/component-scatter-bubble.svg +1 -0
- package/assets/library/catalog/component-segmented-filter.svg +1 -0
- package/assets/library/catalog/component-small-multiples.svg +1 -0
- package/assets/library/catalog/component-sunburst.svg +1 -0
- package/assets/library/catalog/component-tabbed-panel.svg +1 -0
- package/assets/library/catalog/component-target-progress.svg +1 -0
- package/assets/library/catalog/component-toggle-filter.svg +1 -0
- package/assets/library/catalog/component-treemap.svg +1 -0
- package/assets/library/catalog/component-trend-comparison.svg +1 -0
- package/assets/library/catalog/component-waterfall.svg +1 -0
- package/assets/library/catalog/provenance.json +524 -0
- package/assets/library/catalog/visual-theme-amber-sunset.svg +1 -0
- package/assets/library/catalog/visual-theme-art-deco.svg +1 -0
- package/assets/library/catalog/visual-theme-bauhaus.svg +1 -0
- package/assets/library/catalog/visual-theme-burgundy-night.svg +1 -0
- package/assets/library/catalog/visual-theme-cinematic.svg +1 -0
- package/assets/library/catalog/visual-theme-clarity-blue.svg +1 -0
- package/assets/library/catalog/visual-theme-clay.svg +1 -0
- package/assets/library/catalog/visual-theme-cobalt-diagonal.svg +1 -0
- package/assets/library/catalog/visual-theme-coral-cream.svg +1 -0
- package/assets/library/catalog/visual-theme-crimson-black.svg +1 -0
- package/assets/library/catalog/visual-theme-cyberpunk.svg +1 -0
- package/assets/library/catalog/visual-theme-dark-olive.svg +1 -0
- package/assets/library/catalog/visual-theme-dark-tech.svg +1 -0
- package/assets/library/catalog/visual-theme-deep-sea-blue.svg +1 -0
- package/assets/library/catalog/visual-theme-deep-sea-mist.svg +1 -0
- package/assets/library/catalog/visual-theme-financial-trading.svg +1 -0
- package/assets/library/catalog/visual-theme-flat.svg +1 -0
- package/assets/library/catalog/visual-theme-frosted-tech.svg +1 -0
- package/assets/library/catalog/visual-theme-golden-eye.svg +1 -0
- package/assets/library/catalog/visual-theme-hand-drawn.svg +1 -0
- package/assets/library/catalog/visual-theme-industrial.svg +1 -0
- package/assets/library/catalog/visual-theme-layered-paper.svg +1 -0
- package/assets/library/catalog/visual-theme-material.svg +1 -0
- package/assets/library/catalog/visual-theme-maximalism.svg +1 -0
- package/assets/library/catalog/visual-theme-midnight-emerald.svg +1 -0
- package/assets/library/catalog/visual-theme-minimal-modern.svg +1 -0
- package/assets/library/catalog/visual-theme-misty-green.svg +1 -0
- package/assets/library/catalog/visual-theme-misty-rose.svg +1 -0
- package/assets/library/catalog/visual-theme-natural-terrain.svg +1 -0
- package/assets/library/catalog/visual-theme-neo-brutalism.svg +1 -0
- package/assets/library/catalog/visual-theme-newsprint.svg +1 -0
- package/assets/library/catalog/visual-theme-olive-terracotta.svg +1 -0
- package/assets/library/catalog/visual-theme-paper-journal.svg +1 -0
- package/assets/library/catalog/visual-theme-pastel-matrix.svg +1 -0
- package/assets/library/catalog/visual-theme-pixel-dashboard.svg +1 -0
- package/assets/library/catalog/visual-theme-premium-business.svg +1 -0
- package/assets/library/catalog/visual-theme-redline-brief.svg +1 -0
- package/assets/library/catalog/visual-theme-sage.svg +1 -0
- package/assets/library/catalog/visual-theme-soft-porcelain.svg +1 -0
- package/assets/library/catalog/visual-theme-swiss-grid.svg +1 -0
- package/assets/library/catalog/visual-theme-tdesign-enterprise.svg +1 -0
- package/assets/library/catalog/visual-theme-terminal-green.svg +1 -0
- package/assets/library/catalog/visual-theme-warm-sand.svg +1 -0
- package/dist/lib/agent.schema.d.ts +514 -32
- package/dist/lib/analysis-scene-chart.d.ts +8 -0
- package/dist/lib/analysis-scene-chart.js +61 -0
- package/dist/lib/analysis-scene-tool.d.ts +87 -0
- package/dist/lib/analysis-scene-tool.js +33 -0
- package/dist/lib/analysis-scene-widget.d.ts +6 -0
- package/dist/lib/analysis-scene-widget.js +107 -0
- package/dist/lib/analysis-scene.schema.d.ts +66 -0
- package/dist/lib/analysis-scene.schema.js +20 -0
- package/dist/lib/archive.service.d.ts +35 -0
- package/dist/lib/artifact-type.provider.d.ts +1 -0
- package/dist/lib/artifact-type.provider.js +18 -0
- package/dist/lib/bundled-example-source.d.ts +11 -0
- package/dist/lib/bundled-example-source.js +60 -0
- package/dist/lib/certification.schema.d.ts +4 -0
- package/dist/lib/certification.schema.js +14 -0
- package/dist/lib/content-capability.js +1 -0
- package/dist/lib/content-type.d.ts +2 -0
- package/dist/lib/content-type.js +5 -0
- package/dist/lib/content.provider.js +5 -3
- package/dist/lib/dashboard-archive.d.ts +35 -0
- package/dist/lib/dashboard-artifact.d.ts +93 -0
- package/dist/lib/dashboard-artifact.js +24 -0
- package/dist/lib/dashboard-delivery.d.ts +11 -0
- package/dist/lib/dashboard-delivery.js +55 -0
- package/dist/lib/dashboard-discovery.schema.d.ts +446 -0
- package/dist/lib/dashboard-discovery.schema.js +35 -0
- package/dist/lib/dashboard-navigation.d.ts +22 -21
- package/dist/lib/dashboard-navigation.js +5 -4
- package/dist/lib/dashboard-queries.d.ts +2 -2
- package/dist/lib/dashboard-queries.js +2 -2
- package/dist/lib/dashboard-receipt.js +1 -1
- package/dist/lib/dashboard-view.schema.d.ts +964 -64
- package/dist/lib/dashboard.schema.d.ts +738 -23
- package/dist/lib/dashboard.schema.js +8 -2
- package/dist/lib/dashboard.service.d.ts +155 -2
- package/dist/lib/dashboard.service.js +38 -4
- package/dist/lib/dataset-artifact.provider.d.ts +13 -0
- package/dist/lib/dataset-artifact.provider.js +57 -0
- package/dist/lib/dataset.schema.d.ts +195 -0
- package/dist/lib/dataset.schema.js +23 -0
- package/dist/lib/dataset.service.d.ts +54 -0
- package/dist/lib/dataset.service.js +119 -0
- package/dist/lib/definition-tools.d.ts +14 -54
- package/dist/lib/definition-tools.js +29 -9
- package/dist/lib/document-package.d.ts +35 -0
- package/dist/lib/editing.d.ts +552 -2
- package/dist/lib/evidence/evidence-diff.d.ts +17 -0
- package/dist/lib/evidence/evidence-diff.js +30 -0
- package/dist/lib/evidence/evidence-transfers.d.ts +14 -0
- package/dist/lib/evidence/evidence-transfers.js +41 -0
- package/dist/lib/evidence/evidence-view.provider.d.ts +91 -0
- package/dist/lib/evidence/evidence-view.provider.js +92 -0
- package/dist/lib/evidence/evidence.entity.d.ts +14 -0
- package/dist/lib/evidence/evidence.entity.js +62 -0
- package/dist/lib/evidence/evidence.provider.d.ts +43 -0
- package/dist/lib/evidence/evidence.provider.js +91 -0
- package/dist/lib/evidence/evidence.service.d.ts +67 -0
- package/dist/lib/evidence/evidence.service.js +218 -0
- package/dist/lib/explore-catalog.d.ts +15 -0
- package/dist/lib/explore-catalog.js +51 -0
- package/dist/lib/explore-catalog.json +131 -0
- package/dist/lib/explore.schema.d.ts +69 -0
- package/dist/lib/explore.schema.js +9 -0
- package/dist/lib/group-sharing.d.ts +17 -0
- package/dist/lib/group-sharing.js +39 -0
- package/dist/lib/hotel-document.d.ts +3 -0
- package/dist/lib/hotel-document.js +26 -0
- package/dist/lib/hotel-template.d.ts +246 -0
- package/dist/lib/hotel-template.js +77 -0
- package/dist/lib/library/access.d.ts +9 -0
- package/dist/lib/library/access.js +14 -0
- package/dist/lib/library/actions.d.ts +7 -0
- package/dist/lib/library/actions.js +55 -0
- package/dist/lib/library/archive.d.ts +13 -0
- package/dist/lib/library/archive.js +123 -0
- package/dist/lib/library/asset-validation.d.ts +4 -0
- package/dist/lib/library/asset-validation.js +77 -0
- package/dist/lib/library/catalog-blueprints.json +3225 -0
- package/dist/lib/library/catalog.service.d.ts +2427 -0
- package/dist/lib/library/catalog.service.js +270 -0
- package/dist/lib/library/dataset-binding.service.d.ts +65 -0
- package/dist/lib/library/dataset-binding.service.js +152 -0
- package/dist/lib/library/directory-contract.d.ts +161 -0
- package/dist/lib/library/directory-contract.js +19 -0
- package/dist/lib/library/directory.service.d.ts +33 -0
- package/dist/lib/library/directory.service.js +69 -0
- package/dist/lib/library/entities.d.ts +80 -0
- package/dist/lib/library/entities.js +280 -0
- package/dist/lib/library/execution-contract.d.ts +200 -0
- package/dist/lib/library/execution-contract.js +19 -0
- package/dist/lib/library/execution-resolution.d.ts +2490 -0
- package/dist/lib/library/execution-resolution.js +101 -0
- package/dist/lib/library/file-artifact.provider.d.ts +7 -0
- package/dist/lib/library/file-artifact.provider.js +35 -0
- package/dist/lib/library/files.service.d.ts +20 -0
- package/dist/lib/library/files.service.js +112 -0
- package/dist/lib/library/origin.schema.d.ts +171 -0
- package/dist/lib/library/origin.schema.js +14 -0
- package/dist/lib/library/resource-contract.d.ts +2779 -0
- package/dist/lib/library/resource-contract.js +167 -0
- package/dist/lib/library/resource-json.d.ts +11 -0
- package/dist/lib/library/resource-json.js +53 -0
- package/dist/lib/library/task-preparation.service.d.ts +14 -0
- package/dist/lib/library/task-preparation.service.js +85 -0
- package/dist/lib/library/template-compiler.d.ts +19 -0
- package/dist/lib/library/template-compiler.js +73 -0
- package/dist/lib/library/template-execution.service.d.ts +79 -0
- package/dist/lib/library/template-execution.service.js +135 -0
- package/dist/lib/library/transfers.service.d.ts +94 -0
- package/dist/lib/library/transfers.service.js +193 -0
- package/dist/lib/library/zip-container.d.ts +10 -0
- package/dist/lib/library/zip-container.js +79 -0
- package/dist/lib/library-view.provider.d.ts +88 -0
- package/dist/lib/library-view.provider.js +164 -0
- package/dist/lib/library.schema.d.ts +347 -0
- package/dist/lib/library.schema.js +41 -0
- package/dist/lib/middleware.d.ts +8 -2
- package/dist/lib/middleware.js +119 -11
- package/dist/lib/monitor.js +2 -2
- package/dist/lib/plugin.js +21 -1
- package/dist/lib/presentation.provider.d.ts +35 -0
- package/dist/lib/presentation.provider.js +4 -15
- package/dist/lib/projects.schema.d.ts +4 -4
- package/dist/lib/query-session.d.ts +1 -1
- package/dist/lib/query-session.js +13 -8
- package/dist/lib/remote-entry.d.ts +1 -1
- package/dist/lib/remote-entry.js +2 -2
- package/dist/lib/resource.schema.d.ts +1067 -0
- package/dist/lib/resource.schema.js +76 -0
- package/dist/lib/runtime-context.d.ts +2 -0
- package/dist/lib/runtime-context.js +22 -0
- package/dist/lib/sharing.service.d.ts +12 -0
- package/dist/lib/sharing.service.js +4 -0
- package/dist/lib/source-executions.d.ts +69 -51
- package/dist/lib/source-executions.js +2 -1
- package/dist/lib/template.schema.d.ts +36 -0
- package/dist/lib/template.schema.js +17 -0
- package/dist/lib/template.service.d.ts +21 -0
- package/dist/lib/template.service.js +56 -0
- package/dist/lib/templates.js +5 -5
- package/dist/lib/view.provider.d.ts +129 -4
- package/dist/lib/view.provider.js +61 -35
- package/dist/remote/app.css +1 -1
- package/dist/remote/app.js +54 -53
- package/dist/remote/build-manifest.json +238 -46
- package/dist/sandbox-actions/action.json +1 -1
- package/dist/sandbox-actions/bundle/host.js +2 -2
- package/docs/content-packages.mdx +43 -0
- package/docs/dashboard-starter.mdx +22 -0
- package/docs/data-view.mdx +30 -0
- package/docs/dataset-generation.mdx +32 -0
- package/docs/dataset-storage.mdx +29 -0
- package/docs/docs.json +15 -0
- package/docs/editing.mdx +6 -0
- package/docs/html-mode.md +1 -1
- package/docs/index.mdx +8 -0
- package/docs/inline-analysis.mdx +62 -0
- package/docs/library-browser-verification.mdx +46 -0
- package/docs/library-detail-ui.mdx +21 -0
- package/docs/library-directory-ui.mdx +24 -0
- package/docs/library-execution.mdx +49 -0
- package/docs/library-import-ui.mdx +20 -0
- package/docs/library-storage.mdx +63 -0
- package/docs/proposals/resource-sharing-decoupling.mdx +83 -0
- package/docs/standard-theme.mdx +28 -0
- package/docs/template-agent-handoff.mdx +37 -0
- package/docs/verification.mdx +4 -0
- package/package.json +9 -5
- package/skills/live-dashboard/SKILL.md +41 -1
- package/skills/live-dashboard/examples/README.md +2 -2
- package/skills/live-dashboard/examples/production-quality/README.md +2 -2
- package/skills/live-dashboard/examples/regional-sales/README.md +3 -3
- package/skills/live-dashboard/examples/regional-sales/query.json +49 -1
- package/skills/live-dashboard/examples/sales-overview/README.md +2 -2
- package/skills/live-dashboard/references/attribution-analysis.md +8 -0
- package/skills/live-dashboard/references/pareto-analysis.md +8 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.catalogTargetSchema = exports.catalogQuerySchema = exports.resourceIdentity = exports.resourceSchema = exports.hotelRoles = exports.resourceColumnSchema = exports.resourceHeaderSchema = exports.resourcePresentationSchema = exports.resourceRefSchema = exports.fieldKey = exports.resourceVersion = exports.resourceKey = exports.resourceKindSchema = exports.resourceKinds = exports.LIBRARY_MAX_RESOURCES = exports.LIBRARY_MAX_BYTES = exports.RESOURCE_MAX_BYTES = exports.RESOURCE_TYPE = void 0;
|
|
4
|
+
exports.canonicalJson = canonicalJson;
|
|
5
|
+
/** @internal Offline content-authoring adapter. Runtime storage and transport use library/resource-contract V2. */
|
|
6
|
+
const v3_1 = require("zod/v3");
|
|
7
|
+
const explore_schema_1 = require("./explore.schema");
|
|
8
|
+
exports.RESOURCE_TYPE = 'live-dashboard-library-resource';
|
|
9
|
+
exports.RESOURCE_MAX_BYTES = 8_000_000;
|
|
10
|
+
exports.LIBRARY_MAX_BYTES = 32_000_000;
|
|
11
|
+
exports.LIBRARY_MAX_RESOURCES = 100;
|
|
12
|
+
exports.resourceKinds = ['analysis-template', 'public-dataset', 'visual-theme', 'component', 'example-task'];
|
|
13
|
+
exports.resourceKindSchema = v3_1.z.enum(exports.resourceKinds);
|
|
14
|
+
exports.resourceKey = v3_1.z.string().uuid();
|
|
15
|
+
exports.resourceVersion = v3_1.z.string().regex(/^(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})$/);
|
|
16
|
+
exports.fieldKey = v3_1.z.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/).refine(v => !['constructor', 'prototype', '__proto__'].includes(v));
|
|
17
|
+
const scalar = v3_1.z.union([v3_1.z.string().max(4096), v3_1.z.number().finite(), v3_1.z.boolean(), v3_1.z.null()]);
|
|
18
|
+
exports.resourceRefSchema = v3_1.z.object({ logicalId: exports.resourceKey, version: exports.resourceVersion, role: exports.fieldKey }).strict();
|
|
19
|
+
exports.resourcePresentationSchema = v3_1.z.object({ cover: explore_schema_1.exploreKeySchema.optional(), category: v3_1.z.string().max(60).optional() }).strict();
|
|
20
|
+
exports.resourceHeaderSchema = v3_1.z.object({
|
|
21
|
+
schema: v3_1.z.literal('xpert.library.resource'), formatVersion: v3_1.z.literal(1), logicalId: exports.resourceKey, version: exports.resourceVersion,
|
|
22
|
+
title: v3_1.z.string().min(1).max(160), description: v3_1.z.string().max(4000), tags: v3_1.z.array(v3_1.z.string().min(1).max(40)).max(12),
|
|
23
|
+
license: v3_1.z.object({ identifier: v3_1.z.string().min(1).max(100), attribution: v3_1.z.string().max(2000) }).strict(),
|
|
24
|
+
presentation: exports.resourcePresentationSchema.optional(),
|
|
25
|
+
provenance: v3_1.z.enum(['synthetic', 'user-provided', 'open-data']), dependencies: v3_1.z.array(exports.resourceRefSchema).max(30)
|
|
26
|
+
}).strict();
|
|
27
|
+
exports.resourceColumnSchema = v3_1.z.object({ key: exports.fieldKey, label: v3_1.z.string().min(1).max(160),
|
|
28
|
+
type: v3_1.z.enum(['string', 'number', 'boolean', 'date']), nullable: v3_1.z.boolean() }).strict();
|
|
29
|
+
const dataset = v3_1.z.object({ columns: v3_1.z.array(exports.resourceColumnSchema).min(1).max(80), rows: v3_1.z.array(v3_1.z.record(exports.fieldKey, scalar)).max(50_000) }).strict();
|
|
30
|
+
exports.hotelRoles = ['booking_id', 'arrival_date', 'is_cancelled', 'adr', 'nights', 'hotel', 'channel', 'lead_time', 'deposit_type', 'country', 'reserved_room', 'assigned_room'];
|
|
31
|
+
exports.resourceSchema = v3_1.z.discriminatedUnion('kind', [
|
|
32
|
+
exports.resourceHeaderSchema.extend({ kind: v3_1.z.literal('public-dataset'), content: dataset }),
|
|
33
|
+
exports.resourceHeaderSchema.extend({ kind: v3_1.z.literal('analysis-template'), content: v3_1.z.object({ recipe: v3_1.z.literal('hotel-operations'),
|
|
34
|
+
roles: v3_1.z.array(v3_1.z.object({ role: v3_1.z.enum(exports.hotelRoles), required: v3_1.z.boolean(), type: exports.resourceColumnSchema.shape.type }).strict()).min(3).max(12),
|
|
35
|
+
currency: v3_1.z.string().regex(/^[A-Z]{3}$/) }).strict() }),
|
|
36
|
+
exports.resourceHeaderSchema.extend({ kind: v3_1.z.literal('visual-theme'), content: v3_1.z.object({ theme: v3_1.z.enum(['system', 'slate', 'contrast']) }).strict() }),
|
|
37
|
+
exports.resourceHeaderSchema.extend({ kind: v3_1.z.literal('component'), content: v3_1.z.object({ chart: v3_1.z.enum(['bar', 'line', 'area', 'pie', 'details']) }).strict() }),
|
|
38
|
+
exports.resourceHeaderSchema.extend({ kind: v3_1.z.literal('example-task'), content: v3_1.z.object({ execution: v3_1.z.enum(['managed-template', 'agent-task']).optional(), question: v3_1.z.string().min(1).max(8000), skills: v3_1.z.array(v3_1.z.string().min(1).max(160)).max(12).optional() }).strict() })
|
|
39
|
+
]).superRefine((r, ctx) => {
|
|
40
|
+
if (new Set(r.dependencies.map(d => d.role)).size !== r.dependencies.length)
|
|
41
|
+
ctx.addIssue({ code: 'custom', message: 'Duplicate dependency role' });
|
|
42
|
+
if (r.kind === 'analysis-template') {
|
|
43
|
+
if (new Set(r.content.roles.map(item => item.role)).size !== r.content.roles.length ||
|
|
44
|
+
['booking_id', 'arrival_date', 'is_cancelled'].some(role => !r.content.roles.some(item => item.role === role && item.required)))
|
|
45
|
+
ctx.addIssue({ code: 'custom', message: 'Hotel template requires unique roles and the three core fields' });
|
|
46
|
+
}
|
|
47
|
+
if (r.kind !== 'public-dataset')
|
|
48
|
+
return;
|
|
49
|
+
const { columns, rows } = r.content;
|
|
50
|
+
if (new Set(columns.map(c => c.key)).size !== columns.length)
|
|
51
|
+
ctx.addIssue({ code: 'custom', message: 'Duplicate dataset column' });
|
|
52
|
+
for (const row of rows) {
|
|
53
|
+
if (Object.keys(row).length !== columns.length || columns.some(c => !Object.hasOwn(row, c.key) ||
|
|
54
|
+
(row[c.key] === null ? !c.nullable : c.type === 'date' ? typeof row[c.key] !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(String(row[c.key])) || !isIsoDate(String(row[c.key])) : typeof row[c.key] !== c.type))) {
|
|
55
|
+
ctx.addIssue({ code: 'custom', message: 'Dataset row does not match declared columns' });
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
const resourceIdentity = (r) => `${r.logicalId}@${r.version}`;
|
|
61
|
+
exports.resourceIdentity = resourceIdentity;
|
|
62
|
+
exports.catalogQuerySchema = v3_1.z.object({ page: v3_1.z.number().int().min(1).max(100000).default(1), pageSize: v3_1.z.number().int().min(1).max(50).default(24),
|
|
63
|
+
search: v3_1.z.string().max(100).default(''), tag: v3_1.z.string().max(40).optional(), kind: exports.resourceKindSchema.optional(), audience: v3_1.z.enum(['mine', 'public']).default('mine') }).strict();
|
|
64
|
+
exports.catalogTargetSchema = v3_1.z.object({ releaseId: v3_1.z.string().uuid() }).strict();
|
|
65
|
+
/** Sort keys for stable digests; semantic array order remains significant. */
|
|
66
|
+
function canonicalJson(value) {
|
|
67
|
+
if (value === null || typeof value !== 'object')
|
|
68
|
+
return JSON.stringify(value);
|
|
69
|
+
if (Array.isArray(value))
|
|
70
|
+
return `[${value.map(canonicalJson).join(',')}]`;
|
|
71
|
+
return `{${Object.entries(value).filter(([, v]) => v !== undefined).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([k, v]) => `${JSON.stringify(k)}:${canonicalJson(v)}`).join(',')}}`;
|
|
72
|
+
}
|
|
73
|
+
function isIsoDate(value) {
|
|
74
|
+
const time = Date.parse(value);
|
|
75
|
+
return Number.isFinite(time) && new Date(time).toISOString().slice(0, 10) === value;
|
|
76
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { DynamicStructuredTool } from '@langchain/core/tools';
|
|
1
2
|
import type { XpertResolvedViewHostContext } from '@xpert-ai/contracts';
|
|
2
3
|
import { type IAgentMiddlewareContext } from '@xpert-ai/plugin-sdk';
|
|
3
4
|
export declare function dashboardRuntimeContext(context: IAgentMiddlewareContext): XpertResolvedViewHostContext;
|
|
5
|
+
export declare function dashboardProjectTools(projectId: string | undefined, operations: DynamicStructuredTool[]): DynamicStructuredTool[];
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dashboardRuntimeContext = dashboardRuntimeContext;
|
|
4
|
+
exports.dashboardProjectTools = dashboardProjectTools;
|
|
5
|
+
const messages_1 = require("@langchain/core/messages");
|
|
4
6
|
const plugin_sdk_1 = require("@xpert-ai/plugin-sdk");
|
|
5
7
|
function dashboardRuntimeContext(context) {
|
|
6
8
|
if (!context.xpertId)
|
|
@@ -8,6 +10,26 @@ function dashboardRuntimeContext(context) {
|
|
|
8
10
|
return { tenantId: context.tenantId ?? plugin_sdk_1.RequestContext.currentTenantId(),
|
|
9
11
|
organizationId: context.organizationId ?? plugin_sdk_1.RequestContext.getOrganizationId(), userId: context.userId ?? plugin_sdk_1.RequestContext.currentUserId(),
|
|
10
12
|
hostType: 'agent', hostId: context.xpertId, slots: [],
|
|
13
|
+
...(context.workspaceId ? { workspaceId: context.workspaceId } : {}),
|
|
11
14
|
...(context.projectId ? { runtimeScope: { projectId: context.projectId, conversationId: context.conversationId ?? null,
|
|
12
15
|
dataScopeKey: `project:${context.projectId}`, workspaceFiles: { catalog: 'projects', scopeId: context.projectId, projectId: context.projectId } } } : {}) };
|
|
13
16
|
}
|
|
17
|
+
const missingProject = JSON.stringify({
|
|
18
|
+
code: 'PROJECT_REQUIRED',
|
|
19
|
+
message: 'Dashboard operations need a Project. Ask the user to select or create one, then retry this operation.'
|
|
20
|
+
});
|
|
21
|
+
function dashboardProjectTools(projectId, operations) {
|
|
22
|
+
for (const operation of operations) {
|
|
23
|
+
const execute = operation.func;
|
|
24
|
+
// A refused call is visible to the model. It performs no workspace operation to attach to chat history.
|
|
25
|
+
if (!projectId)
|
|
26
|
+
operation.metadata = { ...operation.metadata, internal: true };
|
|
27
|
+
operation.func = async (input, callbacks, config) => {
|
|
28
|
+
if (projectId)
|
|
29
|
+
return execute(input, callbacks, config);
|
|
30
|
+
const id = config?.toolCall?.id;
|
|
31
|
+
return id ? new messages_1.ToolMessage({ name: operation.name, tool_call_id: id, status: 'error', content: missingProject }) : missingProject;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return operations;
|
|
35
|
+
}
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod/v3';
|
|
|
2
2
|
import type { XpertResolvedViewHostContext } from '@xpert-ai/contracts';
|
|
3
3
|
import { type RuntimeCapabilityRegistry } from '@xpert-ai/plugin-sdk';
|
|
4
4
|
import { DashboardService } from './dashboard.service';
|
|
5
|
+
import { groupGrantAction } from './group-sharing';
|
|
5
6
|
export declare const shareInput: z.ZodEffects<z.ZodObject<{
|
|
6
7
|
artifactId: z.ZodString;
|
|
7
8
|
versionMode: z.ZodEnum<["latest", "version"]>;
|
|
@@ -27,6 +28,17 @@ export declare class DashboardSharingService {
|
|
|
27
28
|
private readonly dashboards;
|
|
28
29
|
private readonly runtime;
|
|
29
30
|
constructor(dashboards: DashboardService, runtime: RuntimeCapabilityRegistry);
|
|
31
|
+
group(context: XpertResolvedViewHostContext, action: z.infer<typeof groupGrantAction>, input: unknown): Promise<import("@xpert-ai/contracts").ArtifactUseGrantSummary | import("@xpert-ai/contracts").ResourceAnalysisDataset[] | {
|
|
32
|
+
items: Array<{
|
|
33
|
+
id: string;
|
|
34
|
+
title: string;
|
|
35
|
+
projectId: string;
|
|
36
|
+
}>;
|
|
37
|
+
nextOffset: number | null;
|
|
38
|
+
} | {
|
|
39
|
+
items: import("@xpert-ai/plugin-sdk").ArtifactGrantDetails[];
|
|
40
|
+
nextOffset: number | null;
|
|
41
|
+
}>;
|
|
30
42
|
inspect(context: XpertResolvedViewHostContext, artifactId: string, versionId?: string): Promise<{
|
|
31
43
|
published: {
|
|
32
44
|
current: boolean;
|
|
@@ -18,6 +18,7 @@ const v3_1 = require("zod/v3");
|
|
|
18
18
|
const plugin_sdk_1 = require("@xpert-ai/plugin-sdk");
|
|
19
19
|
const dashboard_service_1 = require("./dashboard.service");
|
|
20
20
|
const dashboard_sharing_1 = require("./dashboard-sharing");
|
|
21
|
+
const group_sharing_1 = require("./group-sharing");
|
|
21
22
|
exports.shareInput = v3_1.z.object({ artifactId: v3_1.z.string().uuid(), versionMode: v3_1.z.enum(['latest', 'version']), versionId: v3_1.z.string().uuid().optional() }).strict()
|
|
22
23
|
.refine(value => value.versionMode !== 'version' || !!value.versionId, 'A fixed share requires a published version');
|
|
23
24
|
let DashboardSharingService = class DashboardSharingService {
|
|
@@ -25,6 +26,9 @@ let DashboardSharingService = class DashboardSharingService {
|
|
|
25
26
|
this.dashboards = dashboards;
|
|
26
27
|
this.runtime = runtime;
|
|
27
28
|
}
|
|
29
|
+
group(context, action, input) {
|
|
30
|
+
return (0, group_sharing_1.executeGroupGrant)(this.runtime, this.dashboards, context, action, input);
|
|
31
|
+
}
|
|
28
32
|
async inspect(context, artifactId, versionId) {
|
|
29
33
|
const versions = await this.dashboards.history(context, artifactId);
|
|
30
34
|
const selected = versionId ? versions.find(version => version.versionId === versionId) : versions.find(version => version.current);
|
|
@@ -46,14 +46,17 @@ export declare const sourceDatasetSchema: z.ZodObject<{
|
|
|
46
46
|
executionId: z.ZodString;
|
|
47
47
|
bindingId: z.ZodString;
|
|
48
48
|
providerId: z.ZodString;
|
|
49
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
49
50
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
50
51
|
executionId: z.ZodString;
|
|
51
52
|
bindingId: z.ZodString;
|
|
52
53
|
providerId: z.ZodString;
|
|
54
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
53
55
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
54
56
|
executionId: z.ZodString;
|
|
55
57
|
bindingId: z.ZodString;
|
|
56
58
|
providerId: z.ZodString;
|
|
59
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
57
60
|
}, z.ZodTypeAny, "passthrough">>;
|
|
58
61
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
59
62
|
schema: z.ZodLiteral<"xpert.analytics.dataset">;
|
|
@@ -102,14 +105,17 @@ export declare const sourceDatasetSchema: z.ZodObject<{
|
|
|
102
105
|
executionId: z.ZodString;
|
|
103
106
|
bindingId: z.ZodString;
|
|
104
107
|
providerId: z.ZodString;
|
|
108
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
105
109
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
106
110
|
executionId: z.ZodString;
|
|
107
111
|
bindingId: z.ZodString;
|
|
108
112
|
providerId: z.ZodString;
|
|
113
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
109
114
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
110
115
|
executionId: z.ZodString;
|
|
111
116
|
bindingId: z.ZodString;
|
|
112
117
|
providerId: z.ZodString;
|
|
118
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
113
119
|
}, z.ZodTypeAny, "passthrough">>;
|
|
114
120
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
115
121
|
schema: z.ZodLiteral<"xpert.analytics.dataset">;
|
|
@@ -158,14 +164,17 @@ export declare const sourceDatasetSchema: z.ZodObject<{
|
|
|
158
164
|
executionId: z.ZodString;
|
|
159
165
|
bindingId: z.ZodString;
|
|
160
166
|
providerId: z.ZodString;
|
|
167
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
161
168
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
162
169
|
executionId: z.ZodString;
|
|
163
170
|
bindingId: z.ZodString;
|
|
164
171
|
providerId: z.ZodString;
|
|
172
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
165
173
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
166
174
|
executionId: z.ZodString;
|
|
167
175
|
bindingId: z.ZodString;
|
|
168
176
|
providerId: z.ZodString;
|
|
177
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
169
178
|
}, z.ZodTypeAny, "passthrough">>;
|
|
170
179
|
}, z.ZodTypeAny, "passthrough">>;
|
|
171
180
|
export type SourceDataset = z.infer<typeof sourceDatasetSchema>;
|
|
@@ -178,43 +187,46 @@ export declare const renderDatasetSchema: z.ZodObject<{
|
|
|
178
187
|
executionId: z.ZodString;
|
|
179
188
|
bindingId: z.ZodString;
|
|
180
189
|
providerId: z.ZodString;
|
|
190
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
181
191
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
182
192
|
executionId: z.ZodString;
|
|
183
193
|
bindingId: z.ZodString;
|
|
184
194
|
providerId: z.ZodString;
|
|
195
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
185
196
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
186
197
|
executionId: z.ZodString;
|
|
187
198
|
bindingId: z.ZodString;
|
|
188
199
|
providerId: z.ZodString;
|
|
200
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
189
201
|
}, z.ZodTypeAny, "passthrough">>;
|
|
190
202
|
} & {
|
|
191
203
|
fields: z.ZodArray<z.ZodObject<{
|
|
192
204
|
id: z.ZodString;
|
|
193
205
|
label: z.ZodString;
|
|
194
|
-
|
|
206
|
+
role: z.ZodEnum<["dimension", "measure", "time", "identifier"]>;
|
|
195
207
|
logicalType: z.ZodEnum<["string", "boolean", "int64", "float64", "decimal", "date", "timestamp"]>;
|
|
196
208
|
nullable: z.ZodBoolean;
|
|
197
|
-
role: z.ZodEnum<["dimension", "measure", "time", "identifier"]>;
|
|
198
|
-
semanticRef: z.ZodOptional<z.ZodString>;
|
|
199
209
|
unit: z.ZodOptional<z.ZodString>;
|
|
210
|
+
sourceField: z.ZodString;
|
|
211
|
+
semanticRef: z.ZodOptional<z.ZodString>;
|
|
200
212
|
}, "strict", z.ZodTypeAny, {
|
|
201
213
|
id: string;
|
|
202
214
|
label: string;
|
|
203
|
-
|
|
204
|
-
logicalType: "string" | "boolean" | "date" | "
|
|
215
|
+
role: "identifier" | "dimension" | "measure" | "time";
|
|
216
|
+
logicalType: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
|
|
205
217
|
nullable: boolean;
|
|
206
|
-
|
|
207
|
-
semanticRef?: string | undefined;
|
|
218
|
+
sourceField: string;
|
|
208
219
|
unit?: string | undefined;
|
|
220
|
+
semanticRef?: string | undefined;
|
|
209
221
|
}, {
|
|
210
222
|
id: string;
|
|
211
223
|
label: string;
|
|
212
|
-
|
|
213
|
-
logicalType: "string" | "boolean" | "date" | "
|
|
224
|
+
role: "identifier" | "dimension" | "measure" | "time";
|
|
225
|
+
logicalType: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
|
|
214
226
|
nullable: boolean;
|
|
215
|
-
|
|
216
|
-
semanticRef?: string | undefined;
|
|
227
|
+
sourceField: string;
|
|
217
228
|
unit?: string | undefined;
|
|
229
|
+
semanticRef?: string | undefined;
|
|
218
230
|
}>, "many">;
|
|
219
231
|
grain: z.ZodArray<z.ZodString, "many">;
|
|
220
232
|
completeness: z.ZodObject<{
|
|
@@ -224,16 +236,16 @@ export declare const renderDatasetSchema: z.ZodObject<{
|
|
|
224
236
|
scope: z.ZodEnum<["full_query_result", "page", "sample", "top_n"]>;
|
|
225
237
|
truncated: z.ZodBoolean;
|
|
226
238
|
}, "strip", z.ZodTypeAny, {
|
|
227
|
-
scope: "page" | "full_query_result" | "sample" | "top_n";
|
|
228
|
-
truncated: boolean;
|
|
229
239
|
returnedRows: number;
|
|
230
240
|
totalAccuracy: "exact" | "unknown" | "estimated";
|
|
231
|
-
totalRows?: number | undefined;
|
|
232
|
-
}, {
|
|
233
241
|
scope: "page" | "full_query_result" | "sample" | "top_n";
|
|
234
242
|
truncated: boolean;
|
|
243
|
+
totalRows?: number | undefined;
|
|
244
|
+
}, {
|
|
235
245
|
returnedRows: number;
|
|
236
246
|
totalAccuracy: "exact" | "unknown" | "estimated";
|
|
247
|
+
scope: "page" | "full_query_result" | "sample" | "top_n";
|
|
248
|
+
truncated: boolean;
|
|
237
249
|
totalRows?: number | undefined;
|
|
238
250
|
}>;
|
|
239
251
|
freshness: z.ZodObject<{
|
|
@@ -241,12 +253,12 @@ export declare const renderDatasetSchema: z.ZodObject<{
|
|
|
241
253
|
sourceFetchedAt: z.ZodString;
|
|
242
254
|
dataAsOf: z.ZodOptional<z.ZodString>;
|
|
243
255
|
}, "strip", z.ZodTypeAny, {
|
|
244
|
-
sourceFetchedAt: string;
|
|
245
256
|
executedAt: string;
|
|
257
|
+
sourceFetchedAt: string;
|
|
246
258
|
dataAsOf?: string | undefined;
|
|
247
259
|
}, {
|
|
248
|
-
sourceFetchedAt: string;
|
|
249
260
|
executedAt: string;
|
|
261
|
+
sourceFetchedAt: string;
|
|
250
262
|
dataAsOf?: string | undefined;
|
|
251
263
|
}>;
|
|
252
264
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
@@ -257,43 +269,46 @@ export declare const renderDatasetSchema: z.ZodObject<{
|
|
|
257
269
|
executionId: z.ZodString;
|
|
258
270
|
bindingId: z.ZodString;
|
|
259
271
|
providerId: z.ZodString;
|
|
272
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
260
273
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
261
274
|
executionId: z.ZodString;
|
|
262
275
|
bindingId: z.ZodString;
|
|
263
276
|
providerId: z.ZodString;
|
|
277
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
264
278
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
265
279
|
executionId: z.ZodString;
|
|
266
280
|
bindingId: z.ZodString;
|
|
267
281
|
providerId: z.ZodString;
|
|
282
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
268
283
|
}, z.ZodTypeAny, "passthrough">>;
|
|
269
284
|
} & {
|
|
270
285
|
fields: z.ZodArray<z.ZodObject<{
|
|
271
286
|
id: z.ZodString;
|
|
272
287
|
label: z.ZodString;
|
|
273
|
-
|
|
288
|
+
role: z.ZodEnum<["dimension", "measure", "time", "identifier"]>;
|
|
274
289
|
logicalType: z.ZodEnum<["string", "boolean", "int64", "float64", "decimal", "date", "timestamp"]>;
|
|
275
290
|
nullable: z.ZodBoolean;
|
|
276
|
-
role: z.ZodEnum<["dimension", "measure", "time", "identifier"]>;
|
|
277
|
-
semanticRef: z.ZodOptional<z.ZodString>;
|
|
278
291
|
unit: z.ZodOptional<z.ZodString>;
|
|
292
|
+
sourceField: z.ZodString;
|
|
293
|
+
semanticRef: z.ZodOptional<z.ZodString>;
|
|
279
294
|
}, "strict", z.ZodTypeAny, {
|
|
280
295
|
id: string;
|
|
281
296
|
label: string;
|
|
282
|
-
|
|
283
|
-
logicalType: "string" | "boolean" | "date" | "
|
|
297
|
+
role: "identifier" | "dimension" | "measure" | "time";
|
|
298
|
+
logicalType: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
|
|
284
299
|
nullable: boolean;
|
|
285
|
-
|
|
286
|
-
semanticRef?: string | undefined;
|
|
300
|
+
sourceField: string;
|
|
287
301
|
unit?: string | undefined;
|
|
302
|
+
semanticRef?: string | undefined;
|
|
288
303
|
}, {
|
|
289
304
|
id: string;
|
|
290
305
|
label: string;
|
|
291
|
-
|
|
292
|
-
logicalType: "string" | "boolean" | "date" | "
|
|
306
|
+
role: "identifier" | "dimension" | "measure" | "time";
|
|
307
|
+
logicalType: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
|
|
293
308
|
nullable: boolean;
|
|
294
|
-
|
|
295
|
-
semanticRef?: string | undefined;
|
|
309
|
+
sourceField: string;
|
|
296
310
|
unit?: string | undefined;
|
|
311
|
+
semanticRef?: string | undefined;
|
|
297
312
|
}>, "many">;
|
|
298
313
|
grain: z.ZodArray<z.ZodString, "many">;
|
|
299
314
|
completeness: z.ZodObject<{
|
|
@@ -303,16 +318,16 @@ export declare const renderDatasetSchema: z.ZodObject<{
|
|
|
303
318
|
scope: z.ZodEnum<["full_query_result", "page", "sample", "top_n"]>;
|
|
304
319
|
truncated: z.ZodBoolean;
|
|
305
320
|
}, "strip", z.ZodTypeAny, {
|
|
306
|
-
scope: "page" | "full_query_result" | "sample" | "top_n";
|
|
307
|
-
truncated: boolean;
|
|
308
321
|
returnedRows: number;
|
|
309
322
|
totalAccuracy: "exact" | "unknown" | "estimated";
|
|
310
|
-
totalRows?: number | undefined;
|
|
311
|
-
}, {
|
|
312
323
|
scope: "page" | "full_query_result" | "sample" | "top_n";
|
|
313
324
|
truncated: boolean;
|
|
325
|
+
totalRows?: number | undefined;
|
|
326
|
+
}, {
|
|
314
327
|
returnedRows: number;
|
|
315
328
|
totalAccuracy: "exact" | "unknown" | "estimated";
|
|
329
|
+
scope: "page" | "full_query_result" | "sample" | "top_n";
|
|
330
|
+
truncated: boolean;
|
|
316
331
|
totalRows?: number | undefined;
|
|
317
332
|
}>;
|
|
318
333
|
freshness: z.ZodObject<{
|
|
@@ -320,12 +335,12 @@ export declare const renderDatasetSchema: z.ZodObject<{
|
|
|
320
335
|
sourceFetchedAt: z.ZodString;
|
|
321
336
|
dataAsOf: z.ZodOptional<z.ZodString>;
|
|
322
337
|
}, "strip", z.ZodTypeAny, {
|
|
323
|
-
sourceFetchedAt: string;
|
|
324
338
|
executedAt: string;
|
|
339
|
+
sourceFetchedAt: string;
|
|
325
340
|
dataAsOf?: string | undefined;
|
|
326
341
|
}, {
|
|
327
|
-
sourceFetchedAt: string;
|
|
328
342
|
executedAt: string;
|
|
343
|
+
sourceFetchedAt: string;
|
|
329
344
|
dataAsOf?: string | undefined;
|
|
330
345
|
}>;
|
|
331
346
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
@@ -336,43 +351,46 @@ export declare const renderDatasetSchema: z.ZodObject<{
|
|
|
336
351
|
executionId: z.ZodString;
|
|
337
352
|
bindingId: z.ZodString;
|
|
338
353
|
providerId: z.ZodString;
|
|
354
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
339
355
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
340
356
|
executionId: z.ZodString;
|
|
341
357
|
bindingId: z.ZodString;
|
|
342
358
|
providerId: z.ZodString;
|
|
359
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
343
360
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
344
361
|
executionId: z.ZodString;
|
|
345
362
|
bindingId: z.ZodString;
|
|
346
363
|
providerId: z.ZodString;
|
|
364
|
+
certification: z.ZodOptional<z.ZodType<import("@xpert-ai/contracts").AnalyticsCertification, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsCertification>>;
|
|
347
365
|
}, z.ZodTypeAny, "passthrough">>;
|
|
348
366
|
} & {
|
|
349
367
|
fields: z.ZodArray<z.ZodObject<{
|
|
350
368
|
id: z.ZodString;
|
|
351
369
|
label: z.ZodString;
|
|
352
|
-
|
|
370
|
+
role: z.ZodEnum<["dimension", "measure", "time", "identifier"]>;
|
|
353
371
|
logicalType: z.ZodEnum<["string", "boolean", "int64", "float64", "decimal", "date", "timestamp"]>;
|
|
354
372
|
nullable: z.ZodBoolean;
|
|
355
|
-
role: z.ZodEnum<["dimension", "measure", "time", "identifier"]>;
|
|
356
|
-
semanticRef: z.ZodOptional<z.ZodString>;
|
|
357
373
|
unit: z.ZodOptional<z.ZodString>;
|
|
374
|
+
sourceField: z.ZodString;
|
|
375
|
+
semanticRef: z.ZodOptional<z.ZodString>;
|
|
358
376
|
}, "strict", z.ZodTypeAny, {
|
|
359
377
|
id: string;
|
|
360
378
|
label: string;
|
|
361
|
-
|
|
362
|
-
logicalType: "string" | "boolean" | "date" | "
|
|
379
|
+
role: "identifier" | "dimension" | "measure" | "time";
|
|
380
|
+
logicalType: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
|
|
363
381
|
nullable: boolean;
|
|
364
|
-
|
|
365
|
-
semanticRef?: string | undefined;
|
|
382
|
+
sourceField: string;
|
|
366
383
|
unit?: string | undefined;
|
|
384
|
+
semanticRef?: string | undefined;
|
|
367
385
|
}, {
|
|
368
386
|
id: string;
|
|
369
387
|
label: string;
|
|
370
|
-
|
|
371
|
-
logicalType: "string" | "boolean" | "date" | "
|
|
388
|
+
role: "identifier" | "dimension" | "measure" | "time";
|
|
389
|
+
logicalType: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
|
|
372
390
|
nullable: boolean;
|
|
373
|
-
|
|
374
|
-
semanticRef?: string | undefined;
|
|
391
|
+
sourceField: string;
|
|
375
392
|
unit?: string | undefined;
|
|
393
|
+
semanticRef?: string | undefined;
|
|
376
394
|
}>, "many">;
|
|
377
395
|
grain: z.ZodArray<z.ZodString, "many">;
|
|
378
396
|
completeness: z.ZodObject<{
|
|
@@ -382,16 +400,16 @@ export declare const renderDatasetSchema: z.ZodObject<{
|
|
|
382
400
|
scope: z.ZodEnum<["full_query_result", "page", "sample", "top_n"]>;
|
|
383
401
|
truncated: z.ZodBoolean;
|
|
384
402
|
}, "strip", z.ZodTypeAny, {
|
|
385
|
-
scope: "page" | "full_query_result" | "sample" | "top_n";
|
|
386
|
-
truncated: boolean;
|
|
387
403
|
returnedRows: number;
|
|
388
404
|
totalAccuracy: "exact" | "unknown" | "estimated";
|
|
389
|
-
totalRows?: number | undefined;
|
|
390
|
-
}, {
|
|
391
405
|
scope: "page" | "full_query_result" | "sample" | "top_n";
|
|
392
406
|
truncated: boolean;
|
|
407
|
+
totalRows?: number | undefined;
|
|
408
|
+
}, {
|
|
393
409
|
returnedRows: number;
|
|
394
410
|
totalAccuracy: "exact" | "unknown" | "estimated";
|
|
411
|
+
scope: "page" | "full_query_result" | "sample" | "top_n";
|
|
412
|
+
truncated: boolean;
|
|
395
413
|
totalRows?: number | undefined;
|
|
396
414
|
}>;
|
|
397
415
|
freshness: z.ZodObject<{
|
|
@@ -399,12 +417,12 @@ export declare const renderDatasetSchema: z.ZodObject<{
|
|
|
399
417
|
sourceFetchedAt: z.ZodString;
|
|
400
418
|
dataAsOf: z.ZodOptional<z.ZodString>;
|
|
401
419
|
}, "strip", z.ZodTypeAny, {
|
|
402
|
-
sourceFetchedAt: string;
|
|
403
420
|
executedAt: string;
|
|
421
|
+
sourceFetchedAt: string;
|
|
404
422
|
dataAsOf?: string | undefined;
|
|
405
423
|
}, {
|
|
406
|
-
sourceFetchedAt: string;
|
|
407
424
|
executedAt: string;
|
|
425
|
+
sourceFetchedAt: string;
|
|
408
426
|
dataAsOf?: string | undefined;
|
|
409
427
|
}>;
|
|
410
428
|
}, z.ZodTypeAny, "passthrough">>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.renderDatasetSchema = exports.sourceDatasetSchema = void 0;
|
|
4
4
|
exports.reduceSourceExecutions = reduceSourceExecutions;
|
|
5
|
+
const certification_schema_1 = require("./certification.schema");
|
|
5
6
|
const v3_1 = require("zod/v3");
|
|
6
7
|
const analytics_1 = require("@xpert-ai/plugin-sdk/analytics");
|
|
7
8
|
const scalar = v3_1.z.union([v3_1.z.string(), v3_1.z.number(), v3_1.z.boolean(), v3_1.z.null()]);
|
|
@@ -10,7 +11,7 @@ exports.sourceDatasetSchema = v3_1.z.object({
|
|
|
10
11
|
fields: v3_1.z.array(v3_1.z.object({ id: v3_1.z.string(), label: v3_1.z.string().optional() }).passthrough()), rows: v3_1.z.array(v3_1.z.record(scalar)),
|
|
11
12
|
completeness: v3_1.z.object({ truncated: v3_1.z.boolean(), returnedRows: v3_1.z.number(), scope: v3_1.z.string(), totalAccuracy: v3_1.z.string() }).passthrough(),
|
|
12
13
|
freshness: v3_1.z.object({ sourceFetchedAt: v3_1.z.string(), executedAt: v3_1.z.string().optional(), dataAsOf: v3_1.z.string().optional() }),
|
|
13
|
-
provenance: v3_1.z.object({ executionId: v3_1.z.string(), bindingId: v3_1.z.string(), providerId: v3_1.z.string() }).passthrough()
|
|
14
|
+
provenance: v3_1.z.object({ executionId: v3_1.z.string(), bindingId: v3_1.z.string(), providerId: v3_1.z.string(), certification: certification_schema_1.certificationSchema.optional() }).passthrough()
|
|
14
15
|
}).passthrough();
|
|
15
16
|
/** Rendering needs the complete typed contract; inspection deliberately accepts a smaller projection. */
|
|
16
17
|
exports.renderDatasetSchema = exports.sourceDatasetSchema.extend({
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
/**
|
|
3
|
+
* @beta Standard-dashboard generation contracts are experimental. Preset keys,
|
|
4
|
+
* field mappings and request payloads may change incompatibly during beta.
|
|
5
|
+
*/
|
|
6
|
+
export declare const templateKeySchema: z.ZodEnum<["comparison", "trend", "details", "bar", "line", "area", "pie"]>;
|
|
7
|
+
export declare const visualThemeSchema: z.ZodEnum<["system", "slate", "contrast"]>;
|
|
8
|
+
export declare const templateCreateSchema: z.ZodObject<{
|
|
9
|
+
datasetId: z.ZodString;
|
|
10
|
+
datasetRevision: z.ZodNumber;
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
title: z.ZodString;
|
|
13
|
+
template: z.ZodEnum<["comparison", "trend", "details", "bar", "line", "area", "pie"]>;
|
|
14
|
+
theme: z.ZodEnum<["system", "slate", "contrast"]>;
|
|
15
|
+
x: z.ZodOptional<z.ZodString>;
|
|
16
|
+
y: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, "strict", z.ZodTypeAny, {
|
|
18
|
+
title: string;
|
|
19
|
+
id: string;
|
|
20
|
+
template: "bar" | "line" | "area" | "pie" | "details" | "comparison" | "trend";
|
|
21
|
+
theme: "system" | "slate" | "contrast";
|
|
22
|
+
datasetId: string;
|
|
23
|
+
datasetRevision: number;
|
|
24
|
+
x?: string | undefined;
|
|
25
|
+
y?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
title: string;
|
|
28
|
+
id: string;
|
|
29
|
+
template: "bar" | "line" | "area" | "pie" | "details" | "comparison" | "trend";
|
|
30
|
+
theme: "system" | "slate" | "contrast";
|
|
31
|
+
datasetId: string;
|
|
32
|
+
datasetRevision: number;
|
|
33
|
+
x?: string | undefined;
|
|
34
|
+
y?: string | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
export type TemplateCreate = z.infer<typeof templateCreateSchema>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.templateCreateSchema = exports.visualThemeSchema = exports.templateKeySchema = void 0;
|
|
4
|
+
const v3_1 = require("zod/v3");
|
|
5
|
+
const dashboard_schema_1 = require("./dashboard.schema");
|
|
6
|
+
/**
|
|
7
|
+
* @beta Standard-dashboard generation contracts are experimental. Preset keys,
|
|
8
|
+
* field mappings and request payloads may change incompatibly during beta.
|
|
9
|
+
*/
|
|
10
|
+
exports.templateKeySchema = v3_1.z.enum(['comparison', 'trend', 'details', 'bar', 'line', 'area', 'pie']);
|
|
11
|
+
exports.visualThemeSchema = dashboard_schema_1.dashboardSchema.innerType().shape.visualTheme.unwrap();
|
|
12
|
+
const field = dashboard_schema_1.dashboardSchema.innerType().shape.charts.element.shape.x;
|
|
13
|
+
exports.templateCreateSchema = v3_1.z.object({
|
|
14
|
+
datasetId: v3_1.z.string().uuid(), datasetRevision: v3_1.z.number().int().positive(),
|
|
15
|
+
id: v3_1.z.string().uuid(), title: v3_1.z.string().trim().min(1).max(160), template: exports.templateKeySchema,
|
|
16
|
+
theme: exports.visualThemeSchema, x: field.optional(), y: field.optional()
|
|
17
|
+
}).strict();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { XpertResolvedViewHostContext } from '@xpert-ai/contracts';
|
|
2
|
+
import { DashboardService } from './dashboard.service';
|
|
3
|
+
import { DashboardDatasetService } from './dataset.service';
|
|
4
|
+
import { type DatasetDefinition } from './dataset.schema';
|
|
5
|
+
import { type TemplateCreate } from './template.schema';
|
|
6
|
+
import { type DashboardManifest } from './dashboard.schema';
|
|
7
|
+
/** @beta Dataset-to-dashboard generation APIs and preset semantics may change incompatibly during beta. */
|
|
8
|
+
export declare class DashboardTemplateService {
|
|
9
|
+
private readonly dashboards;
|
|
10
|
+
private readonly datasets;
|
|
11
|
+
constructor(dashboards: DashboardService, datasets: DashboardDatasetService);
|
|
12
|
+
create(context: XpertResolvedViewHostContext, input: TemplateCreate): Promise<{
|
|
13
|
+
artifactId: string;
|
|
14
|
+
draftId: string;
|
|
15
|
+
draftRevision: number;
|
|
16
|
+
baseVersionId: string | null;
|
|
17
|
+
status: "draft";
|
|
18
|
+
title: string;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
export declare function templateManifest(dataset: DatasetDefinition, input: TemplateCreate): DashboardManifest;
|