@xpert-ai/plugin-live-dashboard 0.3.0 → 0.4.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.
- package/.xpertai-plugin/plugin.json +10 -2
- package/README.md +70 -0
- package/assets/branding/cover-v1.prompt.txt +27 -0
- package/assets/branding/cover-v1.webp +0 -0
- package/assets/previews/customer-brief.png +0 -0
- package/assets/previews/profit-atlas.png +0 -0
- package/assets/previews/trend-workspace.png +0 -0
- package/dist/index.js +14 -1
- package/dist/lib/agent.schema.d.ts +43 -37
- package/dist/lib/agent.schema.js +2 -1
- package/dist/lib/app-config.d.ts +62 -0
- package/dist/lib/app-config.js +38 -0
- package/dist/lib/artifact-type.provider.d.ts +15 -0
- package/dist/lib/artifact-type.provider.js +78 -0
- package/dist/lib/assistant-template.d.ts +2 -0
- package/dist/lib/assistant-template.js +7 -0
- package/dist/lib/content.provider.js +13 -5
- package/dist/lib/dashboard-navigation.d.ts +58 -14
- package/dist/lib/dashboard-navigation.js +11 -10
- package/dist/lib/dashboard-view.schema.d.ts +197 -46
- package/dist/lib/dashboard-view.schema.js +8 -1
- package/dist/lib/dashboard.service.d.ts +39 -2
- package/dist/lib/dashboard.service.js +52 -28
- package/dist/lib/document-libraries.d.ts +1 -1
- package/dist/lib/document-libraries.js +3 -2
- package/dist/lib/document-network.d.ts +1 -1
- package/dist/lib/document-network.js +2 -6
- package/dist/lib/editing-feedback.d.ts +5 -0
- package/dist/lib/editing-feedback.js +19 -0
- package/dist/lib/editing-patch.d.ts +22 -0
- package/dist/lib/editing-patch.js +46 -0
- package/dist/lib/editing-session.d.ts +167 -0
- package/dist/lib/editing-session.js +53 -0
- package/dist/lib/editing.d.ts +92 -60
- package/dist/lib/editing.js +36 -24
- package/dist/lib/html-guidance.d.ts +1 -1
- package/dist/lib/html-guidance.js +1 -1
- package/dist/lib/middleware.js +48 -20
- package/dist/lib/monitor.d.ts +70 -0
- package/dist/lib/monitor.js +101 -0
- package/dist/lib/plugin.js +5 -1
- package/dist/lib/project.d.ts +106 -0
- package/dist/lib/project.js +17 -0
- package/dist/lib/projects.schema.d.ts +49 -0
- package/dist/lib/projects.schema.js +7 -0
- package/dist/lib/projects.service.d.ts +23 -0
- package/dist/lib/projects.service.js +65 -0
- package/dist/lib/prompt-workflows.d.ts +3 -2
- package/dist/lib/prompt-workflows.js +17 -3
- package/dist/lib/provider-options.controller.d.ts +10 -0
- package/dist/lib/provider-options.controller.js +49 -0
- package/dist/lib/resource-card.js +1 -1
- package/dist/lib/runtime-context.d.ts +3 -0
- package/dist/lib/runtime-context.js +13 -0
- package/dist/lib/save-evidence.d.ts +1 -1
- package/dist/lib/templates.d.ts +2 -0
- package/dist/lib/templates.js +55 -0
- package/dist/lib/view.provider.d.ts +97 -7
- package/dist/lib/view.provider.js +39 -10
- package/dist/libraries/TREND-WORKSPACE-ICONS-LICENSE.txt +43 -0
- package/dist/libraries/catalog.json +1 -1
- package/dist/remote/app.css +1 -1
- package/dist/remote/app.js +33 -33
- package/dist/remote/build-manifest.json +118 -32
- package/dist/sandbox-actions/action.json +1 -1
- package/dist/sandbox-actions/bundle/host.js +2 -2
- package/dist/sandbox-actions/bundle/resource-cache.mjs +2 -1
- package/dist/sandbox-actions/bundle/validate.mjs +1 -1
- package/docs/docs.json +7 -0
- package/docs/frontend-libraries.mdx +12 -4
- package/docs/html-mode.md +3 -3
- package/docs/quick-start-acceptance.mdx +50 -0
- package/docs/quick-start.mdx +64 -0
- package/docs/superstore.mdx +38 -0
- package/docs/team-sharing.mdx +6 -2
- package/docs/trend-workspace-acceptance.mdx +43 -0
- package/docs/trend-workspace.mdx +30 -0
- package/docs/verification.mdx +4 -2
- package/docs/visual-styles-acceptance.mdx +40 -0
- package/docs/visual-styles.mdx +46 -0
- package/package.json +25 -18
- package/scripts/import-prompts.mjs +108 -0
- package/skills/live-dashboard/SKILL.md +27 -3
- package/skills/live-dashboard/examples/README.md +25 -0
- package/skills/live-dashboard/examples/catalog.json +79 -0
- package/skills/live-dashboard/examples/production-quality/README.md +25 -0
- package/skills/live-dashboard/examples/production-quality/dashboard.html +129 -0
- package/skills/live-dashboard/examples/production-quality/definition.json +67 -0
- package/skills/live-dashboard/examples/production-quality/demo.csv +7 -0
- package/skills/live-dashboard/examples/production-quality/demo.json +44 -0
- package/skills/live-dashboard/examples/production-quality/expected.json +26 -0
- package/skills/live-dashboard/examples/production-quality/preview.png +0 -0
- package/skills/live-dashboard/examples/production-quality/query.json +53 -0
- package/skills/live-dashboard/examples/regional-sales/README.md +25 -0
- package/skills/live-dashboard/examples/regional-sales/dashboard-create.json +35 -0
- package/skills/live-dashboard/examples/regional-sales/definition.json +35 -0
- package/skills/live-dashboard/examples/regional-sales/demo.csv +5 -0
- package/skills/live-dashboard/examples/regional-sales/demo.json +18 -0
- package/skills/live-dashboard/examples/regional-sales/expected.json +19 -0
- package/skills/live-dashboard/examples/regional-sales/preview.png +0 -0
- package/skills/live-dashboard/examples/regional-sales/query.json +45 -0
- package/skills/live-dashboard/examples/sales-overview/README.md +25 -0
- package/skills/live-dashboard/examples/sales-overview/dashboard.html +129 -0
- package/skills/live-dashboard/examples/sales-overview/definition.json +57 -0
- package/skills/live-dashboard/examples/sales-overview/demo.csv +7 -0
- package/skills/live-dashboard/examples/sales-overview/demo.json +38 -0
- package/skills/live-dashboard/examples/sales-overview/expected.json +22 -0
- package/skills/live-dashboard/examples/sales-overview/preview.png +0 -0
- package/skills/live-dashboard/examples/sales-overview/query.json +52 -0
- package/skills/live-dashboard/examples/superstore/README.md +64 -0
- package/skills/live-dashboard/examples/superstore/THIRD_PARTY_LICENSE.txt +207 -0
- package/skills/live-dashboard/examples/superstore/build_data.py +155 -0
- package/skills/live-dashboard/examples/superstore/build_pages.py +129 -0
- package/skills/live-dashboard/examples/superstore/checks.json +104 -0
- package/skills/live-dashboard/examples/superstore/customers-mobile-dark.png +0 -0
- package/skills/live-dashboard/examples/superstore/customers-select.png +0 -0
- package/skills/live-dashboard/examples/superstore/customers.html +316 -0
- package/skills/live-dashboard/examples/superstore/customers.png +0 -0
- package/skills/live-dashboard/examples/superstore/customers.queries.json +512 -0
- package/skills/live-dashboard/examples/superstore/expected.json +4069 -0
- package/skills/live-dashboard/examples/superstore/import.json +200 -0
- package/skills/live-dashboard/examples/superstore/orders.csv +10195 -0
- package/skills/live-dashboard/examples/superstore/overview-mobile-dark.png +0 -0
- package/skills/live-dashboard/examples/superstore/overview-select.png +0 -0
- package/skills/live-dashboard/examples/superstore/overview.html +310 -0
- package/skills/live-dashboard/examples/superstore/overview.png +0 -0
- package/skills/live-dashboard/examples/superstore/overview.queries.json +636 -0
- package/skills/live-dashboard/examples/superstore/page.js +109 -0
- package/skills/live-dashboard/examples/superstore/profitability-mobile-dark.png +0 -0
- package/skills/live-dashboard/examples/superstore/profitability-select.png +0 -0
- package/skills/live-dashboard/examples/superstore/profitability.html +307 -0
- package/skills/live-dashboard/examples/superstore/profitability.png +0 -0
- package/skills/live-dashboard/examples/superstore/profitability.queries.json +334 -0
- package/skills/live-dashboard/examples/superstore/provenance.json +24 -0
- package/skills/live-dashboard/examples/superstore/semantic-model.json +220 -0
- package/skills/live-dashboard/examples/superstore/test_data.py +62 -0
- package/skills/live-dashboard/references/html-runtime.md +1 -1
- package/skills/live-dashboard/themes/README.md +50 -0
- package/skills/live-dashboard/themes/customer-brief/README.md +47 -0
- package/skills/live-dashboard/themes/customer-brief/charts.js +17 -0
- package/skills/live-dashboard/themes/customer-brief/layout.html +22 -0
- package/skills/live-dashboard/themes/customer-brief/theme.css +108 -0
- package/skills/live-dashboard/themes/profit-atlas/README.md +43 -0
- package/skills/live-dashboard/themes/profit-atlas/charts.js +30 -0
- package/skills/live-dashboard/themes/profit-atlas/layout.html +19 -0
- package/skills/live-dashboard/themes/profit-atlas/theme.css +75 -0
- package/skills/live-dashboard/themes/trend-workspace/ICON_LICENSE.txt +43 -0
- package/skills/live-dashboard/themes/trend-workspace/README.md +144 -0
- package/skills/live-dashboard/themes/trend-workspace/charts.js +60 -0
- package/skills/live-dashboard/themes/trend-workspace/icons.js +11 -0
- package/skills/live-dashboard/themes/trend-workspace/layout.html +45 -0
- package/skills/live-dashboard/themes/trend-workspace/select.js +127 -0
- package/skills/live-dashboard/themes/trend-workspace/theme.css +137 -0
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xpert-ai/plugin-live-dashboard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"level": "system",
|
|
5
5
|
"artifactNamespace": "live_dashboard",
|
|
6
6
|
"sandboxActions": "./dist/sandbox-actions/action.json",
|
|
7
|
-
"skills": "./skills"
|
|
7
|
+
"skills": "./skills",
|
|
8
|
+
"assets": {
|
|
9
|
+
"screenshots": [
|
|
10
|
+
"./assets/branding/cover-v1.webp",
|
|
11
|
+
"./assets/previews/trend-workspace.png",
|
|
12
|
+
"./assets/previews/profit-atlas.png",
|
|
13
|
+
"./assets/previews/customer-brief.png"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
8
16
|
}
|
package/README.md
CHANGED
|
@@ -35,6 +35,17 @@ Tools are `dashboard_list_sources`, `dashboard_discover`, `dashboard_preview`, `
|
|
|
35
35
|
|
|
36
36
|
Specialized Assistants may configure `allowedFinalProviders` on the middleware, for example `["workspace_script.query"]`. Upstream discovery and preview still work with other providers, but Agent save rejects final bindings outside this list. Omit it for the existing unrestricted provider workflow. This is an Agent workflow policy, not a substitute for the server's source/Artifact authorization.
|
|
37
37
|
|
|
38
|
+
The settings form now selects each entry from a dropdown. Options come from
|
|
39
|
+
`GET /api/live-dashboard/provider-options`, using the host Analytics capability
|
|
40
|
+
with the authenticated tenant, organization and user. It lists distinct Provider
|
|
41
|
+
types of **currently accessible data sources**, not every installed adapter or
|
|
42
|
+
individual database connection. The list refreshes on loading the selector;
|
|
43
|
+
unavailable saved IDs remain visible and are not silently removed. A configured
|
|
44
|
+
policy still requires 1–20 values; the saved `string[]` contract is unchanged.
|
|
45
|
+
An empty catalog means no accessible sources; authorization/catalog errors remain
|
|
46
|
+
errors. This uses the existing platform `remoteSelect` control and requires no
|
|
47
|
+
platform changes.
|
|
48
|
+
|
|
38
49
|
For a dedicated Dashboard Assistant, mark its connected `LiveDashboard` middleware node `required: true` (see the [graph fragment](examples/assistant-middleware.yaml)). ChatKit sends an explicit capability allowlist; an optional middleware is unavailable until the user selects it. Enabling the Workbench view alone does not enable Agent tools. Preserve that platform selection behavior for general-purpose Assistants.
|
|
39
50
|
|
|
40
51
|
Only the LLM boundary uses `requestJson` / `payloadJson` strings, because recursive JSON unions are unreliable in model function schemas. The plugin parses these into the unchanged canonical JSON protocol before calling the platform. Protocol version and operation come from the discovered provider contract; parameter name also supplies the Agent-created control ID. Saved manifests retain the full generic Binding protocol. Preview uses Binding parameter defaults, avoiding a second control mapping for the model to repeat. Provider syntax is learned from discovery, not embedded in platform prompts.
|
|
@@ -59,6 +70,59 @@ Artifacts are owner-only within their agent/project host for this MVP. MIME: `ap
|
|
|
59
70
|
|
|
60
71
|
## Built-in prompt workflows / 内置提示词模板
|
|
61
72
|
|
|
73
|
+
### Chat shortcut buttons / 聊天快捷按钮
|
|
74
|
+
|
|
75
|
+
Like Presentation Studio, this plugin contributes an Assistant template with
|
|
76
|
+
12 workspace prompt workflows. In the plugin's contents, choose **实时看板助手 /
|
|
77
|
+
Live Dashboard Assistant**, install it into the target workspace, and select the
|
|
78
|
+
model and sandbox in the existing setup wizard. Its required LiveDashboard,
|
|
79
|
+
Skills and SandboxFile middleware nodes are already connected. Workspace prompts
|
|
80
|
+
use `insert_text`: clicking a shortcut opens editable text before sending.
|
|
81
|
+
|
|
82
|
+
Shortcut resources use names beginning with `live-dashboard-`. The legacy
|
|
83
|
+
middleware commands below keep their `/dashboard-` names: the host gives middleware
|
|
84
|
+
commands precedence, so reusing those names would hide the workspace shortcuts.
|
|
85
|
+
Both paths share the same prompt content. The workspace prompt library remains
|
|
86
|
+
the place to edit labels, content and Assistant associations.
|
|
87
|
+
|
|
88
|
+
**Existing Assistants:** a plugin update alone does not seed workspace resources.
|
|
89
|
+
Import the prompts once, or associate already imported prompts with the Assistant
|
|
90
|
+
in the workspace prompt library. The following shipped helper supports a one-time
|
|
91
|
+
import without changing the Assistant graph, model, publication or existing prompts:
|
|
92
|
+
|
|
93
|
+
1. Configure and publish the Assistant with LiveDashboard connected to its main
|
|
94
|
+
Agent and **System middleware** enabled. Keep its normal Skills, SandboxFile,
|
|
95
|
+
model and sandbox configuration.
|
|
96
|
+
2. From this plugin package directory (source checkout: build first), use Node 20+
|
|
97
|
+
and a platform login token with authoring access to the target workspace.
|
|
98
|
+
Provide `XPERT_TOKEN` through your normal secret environment; do not store it
|
|
99
|
+
in shell history or commit it. IDs come from the selected organization and
|
|
100
|
+
published Assistant.
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
node scripts/import-prompts.mjs \
|
|
104
|
+
--api-url https://your-xpert-host/api \
|
|
105
|
+
--organization-id YOUR_ORGANIZATION_UUID \
|
|
106
|
+
--assistant-id YOUR_ASSISTANT_UUID
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
3. Review the read-only preview. Repeat with `--apply` to create only the missing
|
|
110
|
+
resources, associated with this Assistant. The script then checks the published
|
|
111
|
+
runtime exposes the new `insert_text` shortcuts. Reopen the chat/new conversation
|
|
112
|
+
to refresh its command list. No republishing is needed just for prompt import.
|
|
113
|
+
|
|
114
|
+
The helper never overwrites or archives prompts or changes associations. Matching,
|
|
115
|
+
active and applicable prompts are skipped. Edited/archived prompts, resources
|
|
116
|
+
associated with another Assistant, or disabled/overridden command-profile entries
|
|
117
|
+
stop the import before writes: resolve those deliberately in the prompt library
|
|
118
|
+
or Assistant command settings. For a second Assistant in the same workspace,
|
|
119
|
+
associate the existing resources instead of importing duplicates. Network failures
|
|
120
|
+
can leave some newly created prompts; rerunning safely skips them. Use HTTPS for
|
|
121
|
+
remote hosts and configure trust for private certificates; do not disable TLS
|
|
122
|
+
verification. The helper does not install or update the plugin.
|
|
123
|
+
|
|
124
|
+
### Middleware slash commands / 中间件斜杠命令
|
|
125
|
+
|
|
62
126
|
When the Assistant has the `LiveDashboard` middleware, type `/dashboard-` in its
|
|
63
127
|
chat composer and select a workflow. Selection inserts an invocation so the user
|
|
64
128
|
can add requirements before sending; it does not submit or publish automatically.
|
|
@@ -180,3 +244,9 @@ Open the dashboard picker and use the trash icon beside an entry. The confirmati
|
|
|
180
244
|
The owner can delete private Assistant dashboards; Project dashboards require the current user's management permission. Read-only shared pages expose no delete control. The platform checks the confirmed draft revision atomically, rejecting concurrent edits. Entries without a saved working draft (legacy version-only or incomplete first saves) have no recycle revision and do not expose this action. No Agent deletion tool is registered.
|
|
181
245
|
|
|
182
246
|
Manual acceptance after installing the updated plugin: cancel a deletion and confirm the entry remains; delete an unused saved dashboard and confirm it stays absent after reload; delete the selected dashboard and confirm the preview clears and its old shared link is unavailable.
|
|
247
|
+
|
|
248
|
+
## Quick start and examples
|
|
249
|
+
|
|
250
|
+
See [快速开始与样例](docs/quick-start.mdx). The App initializes the project-scoped authoring Assistant. Three versioned recipes bundle source, labeled synthetic data, previews and checks in [skills/live-dashboard/examples](skills/live-dashboard/examples/README.md). Existing dashboards remain independent of recipe upgrades.
|
|
251
|
+
|
|
252
|
+
Superstore 企业 BI 样例的数据准备、三个页面和指标口径见 [Superstore](docs/superstore.mdx)。
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Use case: ads-marketing.
|
|
2
|
+
Create a NEW premium 16:9 Explore app cover for "Live Dashboard". The visual must communicate conversational creation, real connected data, interactive analytics, and editable animated data storytelling — not just a conventional static sales report.
|
|
3
|
+
Style reference: the attached DB Studio image is STYLE ONLY. Retain its bright warm ivory studio environment, confident Chinese typography, tactile white surfaces, subtle soft shadows. Combine this with beautifully art-directed dimensional motion graphics. Do not copy the database UI or its branding.
|
|
4
|
+
Layout: left 40% typography, right 55% compelling connected data/animation scene, generous spacing. Keep all essential information above 72% height. Bottom 23% quiet ivory background, reserved for the marketplace card overlay. Main message must remain readable as a 384px thumbnail.
|
|
5
|
+
Palette: ivory #F7F5EF, deep ink #142C42, restrained blue #3659A2, teal #178577 and small warm amber accents. Sophisticated, precise, high-end product design. No dark cyberpunk, no rainbow glow, no decorative plants or notebooks.
|
|
6
|
+
|
|
7
|
+
Exact text:
|
|
8
|
+
Brand upper left: "Live Dashboard"
|
|
9
|
+
Large two-line headline:
|
|
10
|
+
"数据会说话,"
|
|
11
|
+
"洞察动起来。"
|
|
12
|
+
First line deep ink, second line blue with a teal punctuation mark.
|
|
13
|
+
Support line: "对话生成 · 交互分析 · 动态可视化"
|
|
14
|
+
|
|
15
|
+
Visual story on right:
|
|
16
|
+
A single harmonious composition of two connected, layered white panels, almost frontal with mild perspective. Rear panel: a compact real-data dashboard labeled "实时洞察", with clear region-filter chips, two KPI cards "76,000" and "380", blue trend chart, teal bar chart. Small text "示例数据" makes the numbers clearly illustrative.
|
|
17
|
+
Front-right panel: an animated-data explainer labeled "动态演示", featuring sculptural blue/teal bars emerging into 3D, a flowing curved trajectory linking highlighted chart points, and two subtle translucent previous positions of a moving amber marker to make MOTION unmistakable. A small simple play triangle is allowed inside this illustrative panel, but no video export button or standalone editor UI. Let visual objects extend slightly beyond the panel border to convey expressive HTML/3D authoring. Motion should feel meaningful and beautifully choreographed, not a pile of floating widgets.
|
|
18
|
+
At the upper-left edge of the visualization add one tiny chat bubble: "把趋势讲清楚" connected by a restrained curved line into the dashboard. This conveys conversation-to-visual creation. Bottom edge of the right visual include small label "能力示意".
|
|
19
|
+
The linked dashboard and animated explainer should be distinct but form one flowing product narrative, with strong visual hierarchy, readable charts, deliberate negative space.
|
|
20
|
+
|
|
21
|
+
Constraints: only brand is Live Dashboard. Absolutely no Claude, Anthropic or other competitor name/logo/branding, no starburst assistant mark, no database cylinder, no invented app logo, no external product logos. No MP4/export labels, no unsupported automated-update promises, no camera/live-action imagery, no realistic people. Do not reproduce a real customer's data. The result is a marketing illustration, not a claimed actual UI screenshot. All Chinese text must be clean and correctly written. Avoid adding any text beyond the specified short labels.
|
|
22
|
+
|
|
23
|
+
Final refinement (built-in image_gen):
|
|
24
|
+
Change ONLY the small three-colored-bars logo immediately to the left of the 'Live Dashboard' brand text: remove that logo completely and fill its area with the surrounding warm ivory background. Align the 'Live Dashboard' brand text to the same left margin as the large Chinese headline. Keep every other element exactly unchanged: all Chinese text, the dashboard, the animated 3D chart and play symbol, the chat bubble, colors, lighting, margins and wide framing. Do not create any replacement icon or brand symbol.
|
|
25
|
+
|
|
26
|
+
Capability basis: docs/frontend-libraries.mdx, docs/editing.mdx and docs/quick-start.mdx. The cover illustrates conversational authoring, data-bound interactive views and authored HTML/chart/3D motion. It does not claim a separate video editor or MP4 export workflow.
|
|
27
|
+
Research: https://claude.com/resources/articles/dashboards-and-motion and https://support.claude.com/en/articles/17454997-get-started-with-claude-motion (2026-11-01). Competitor names and marks must not appear in the image.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -3,9 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const node_fs_1 = require("node:fs");
|
|
4
4
|
const node_path_1 = require("node:path");
|
|
5
5
|
const plugin_1 = require("./lib/plugin");
|
|
6
|
+
const project_1 = require("./lib/project");
|
|
7
|
+
const templates_1 = require("./lib/templates");
|
|
8
|
+
const assistant_template_1 = require("./lib/assistant-template");
|
|
9
|
+
const dashboard_icon_1 = require("./lib/dashboard-icon");
|
|
6
10
|
const packageJson = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, '../package.json'), 'utf8'));
|
|
7
11
|
const plugin = {
|
|
8
|
-
meta: {
|
|
12
|
+
meta: {
|
|
13
|
+
name: packageJson.name, version: packageJson.version, category: 'middleware', displayName: 'Live dashboards', description: 'Live dashboards',
|
|
14
|
+
author: 'XpertAI', level: packageJson.xpert.plugin.level, artifactNamespace: packageJson.xpert.plugin.artifactNamespace, icon: dashboard_icon_1.dashboardIcon,
|
|
15
|
+
targetApps: ['xpert', 'data-xpert'],
|
|
16
|
+
targetAppMeta: { xpert: { types: ['business-app', 'workbench-view', 'assistant-template'], capabilities: ['live_dashboard'], marketplace: { contents: [
|
|
17
|
+
project_1.dashboardApp,
|
|
18
|
+
{ type: 'assistant-template', name: assistant_template_1.DASHBOARD_TEMPLATE_KEY, displayName: assistant_template_1.dashboardAssistantTemplate.title, description: assistant_template_1.dashboardAssistantTemplate.description }
|
|
19
|
+
] } } }
|
|
20
|
+
},
|
|
21
|
+
templates: templates_1.dashboardTemplates,
|
|
9
22
|
register: () => ({ module: plugin_1.LiveDashboardPlugin })
|
|
10
23
|
};
|
|
11
24
|
exports.default = plugin;
|
|
@@ -15,7 +15,6 @@ export declare const discoverToolSchema: z.ZodObject<{
|
|
|
15
15
|
}>;
|
|
16
16
|
export declare const agentBindingSchema: z.ZodObject<{
|
|
17
17
|
source: z.ZodType<import("@xpert-ai/contracts").AnalyticsSourceRef, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsSourceRef>;
|
|
18
|
-
providerId: z.ZodString;
|
|
19
18
|
output: z.ZodObject<{
|
|
20
19
|
datasetId: z.ZodString;
|
|
21
20
|
fields: z.ZodArray<z.ZodObject<{
|
|
@@ -74,6 +73,7 @@ export declare const agentBindingSchema: z.ZodObject<{
|
|
|
74
73
|
}[];
|
|
75
74
|
grain?: string[];
|
|
76
75
|
}>;
|
|
76
|
+
providerId: z.ZodString;
|
|
77
77
|
} & {
|
|
78
78
|
parameters: z.ZodArray<z.ZodObject<Omit<{
|
|
79
79
|
name: z.ZodString;
|
|
@@ -98,14 +98,6 @@ export declare const agentBindingSchema: z.ZodObject<{
|
|
|
98
98
|
payloadJson: z.ZodString;
|
|
99
99
|
}, "strict", z.ZodTypeAny, {
|
|
100
100
|
source: import("@xpert-ai/contracts").AnalyticsSourceRef;
|
|
101
|
-
parameters: {
|
|
102
|
-
type: "string" | "number" | "boolean" | "date";
|
|
103
|
-
name: string;
|
|
104
|
-
required: boolean;
|
|
105
|
-
defaultValue?: string | number | boolean | null | undefined;
|
|
106
|
-
allowedValues?: (string | number | boolean | null)[] | undefined;
|
|
107
|
-
}[];
|
|
108
|
-
providerId: string;
|
|
109
101
|
output: {
|
|
110
102
|
datasetId?: string;
|
|
111
103
|
fields?: {
|
|
@@ -120,9 +112,6 @@ export declare const agentBindingSchema: z.ZodObject<{
|
|
|
120
112
|
}[];
|
|
121
113
|
grain?: string[];
|
|
122
114
|
};
|
|
123
|
-
payloadJson: string;
|
|
124
|
-
}, {
|
|
125
|
-
source: import("@xpert-ai/contracts").AnalyticsSourceRef;
|
|
126
115
|
parameters: {
|
|
127
116
|
type: "string" | "number" | "boolean" | "date";
|
|
128
117
|
name: string;
|
|
@@ -131,6 +120,9 @@ export declare const agentBindingSchema: z.ZodObject<{
|
|
|
131
120
|
allowedValues?: (string | number | boolean | null)[] | undefined;
|
|
132
121
|
}[];
|
|
133
122
|
providerId: string;
|
|
123
|
+
payloadJson: string;
|
|
124
|
+
}, {
|
|
125
|
+
source: import("@xpert-ai/contracts").AnalyticsSourceRef;
|
|
134
126
|
output: {
|
|
135
127
|
datasetId?: string;
|
|
136
128
|
fields?: {
|
|
@@ -145,12 +137,19 @@ export declare const agentBindingSchema: z.ZodObject<{
|
|
|
145
137
|
}[];
|
|
146
138
|
grain?: string[];
|
|
147
139
|
};
|
|
140
|
+
parameters: {
|
|
141
|
+
type: "string" | "number" | "boolean" | "date";
|
|
142
|
+
name: string;
|
|
143
|
+
required: boolean;
|
|
144
|
+
defaultValue?: string | number | boolean | null | undefined;
|
|
145
|
+
allowedValues?: (string | number | boolean | null)[] | undefined;
|
|
146
|
+
}[];
|
|
147
|
+
providerId: string;
|
|
148
148
|
payloadJson: string;
|
|
149
149
|
}>;
|
|
150
150
|
export declare const previewToolSchema: z.ZodObject<{
|
|
151
151
|
binding: z.ZodObject<{
|
|
152
152
|
source: z.ZodType<import("@xpert-ai/contracts").AnalyticsSourceRef, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsSourceRef>;
|
|
153
|
-
providerId: z.ZodString;
|
|
154
153
|
output: z.ZodObject<{
|
|
155
154
|
datasetId: z.ZodString;
|
|
156
155
|
fields: z.ZodArray<z.ZodObject<{
|
|
@@ -209,6 +208,7 @@ export declare const previewToolSchema: z.ZodObject<{
|
|
|
209
208
|
}[];
|
|
210
209
|
grain?: string[];
|
|
211
210
|
}>;
|
|
211
|
+
providerId: z.ZodString;
|
|
212
212
|
} & {
|
|
213
213
|
parameters: z.ZodArray<z.ZodObject<Omit<{
|
|
214
214
|
name: z.ZodString;
|
|
@@ -233,14 +233,6 @@ export declare const previewToolSchema: z.ZodObject<{
|
|
|
233
233
|
payloadJson: z.ZodString;
|
|
234
234
|
}, "strict", z.ZodTypeAny, {
|
|
235
235
|
source: import("@xpert-ai/contracts").AnalyticsSourceRef;
|
|
236
|
-
parameters: {
|
|
237
|
-
type: "string" | "number" | "boolean" | "date";
|
|
238
|
-
name: string;
|
|
239
|
-
required: boolean;
|
|
240
|
-
defaultValue?: string | number | boolean | null | undefined;
|
|
241
|
-
allowedValues?: (string | number | boolean | null)[] | undefined;
|
|
242
|
-
}[];
|
|
243
|
-
providerId: string;
|
|
244
236
|
output: {
|
|
245
237
|
datasetId?: string;
|
|
246
238
|
fields?: {
|
|
@@ -255,9 +247,6 @@ export declare const previewToolSchema: z.ZodObject<{
|
|
|
255
247
|
}[];
|
|
256
248
|
grain?: string[];
|
|
257
249
|
};
|
|
258
|
-
payloadJson: string;
|
|
259
|
-
}, {
|
|
260
|
-
source: import("@xpert-ai/contracts").AnalyticsSourceRef;
|
|
261
250
|
parameters: {
|
|
262
251
|
type: "string" | "number" | "boolean" | "date";
|
|
263
252
|
name: string;
|
|
@@ -266,6 +255,9 @@ export declare const previewToolSchema: z.ZodObject<{
|
|
|
266
255
|
allowedValues?: (string | number | boolean | null)[] | undefined;
|
|
267
256
|
}[];
|
|
268
257
|
providerId: string;
|
|
258
|
+
payloadJson: string;
|
|
259
|
+
}, {
|
|
260
|
+
source: import("@xpert-ai/contracts").AnalyticsSourceRef;
|
|
269
261
|
output: {
|
|
270
262
|
datasetId?: string;
|
|
271
263
|
fields?: {
|
|
@@ -280,11 +272,6 @@ export declare const previewToolSchema: z.ZodObject<{
|
|
|
280
272
|
}[];
|
|
281
273
|
grain?: string[];
|
|
282
274
|
};
|
|
283
|
-
payloadJson: string;
|
|
284
|
-
}>;
|
|
285
|
-
}, "strict", z.ZodTypeAny, {
|
|
286
|
-
binding: {
|
|
287
|
-
source: import("@xpert-ai/contracts").AnalyticsSourceRef;
|
|
288
275
|
parameters: {
|
|
289
276
|
type: "string" | "number" | "boolean" | "date";
|
|
290
277
|
name: string;
|
|
@@ -293,6 +280,11 @@ export declare const previewToolSchema: z.ZodObject<{
|
|
|
293
280
|
allowedValues?: (string | number | boolean | null)[] | undefined;
|
|
294
281
|
}[];
|
|
295
282
|
providerId: string;
|
|
283
|
+
payloadJson: string;
|
|
284
|
+
}>;
|
|
285
|
+
}, "strict", z.ZodTypeAny, {
|
|
286
|
+
binding: {
|
|
287
|
+
source: import("@xpert-ai/contracts").AnalyticsSourceRef;
|
|
296
288
|
output: {
|
|
297
289
|
datasetId?: string;
|
|
298
290
|
fields?: {
|
|
@@ -307,11 +299,6 @@ export declare const previewToolSchema: z.ZodObject<{
|
|
|
307
299
|
}[];
|
|
308
300
|
grain?: string[];
|
|
309
301
|
};
|
|
310
|
-
payloadJson: string;
|
|
311
|
-
};
|
|
312
|
-
}, {
|
|
313
|
-
binding: {
|
|
314
|
-
source: import("@xpert-ai/contracts").AnalyticsSourceRef;
|
|
315
302
|
parameters: {
|
|
316
303
|
type: "string" | "number" | "boolean" | "date";
|
|
317
304
|
name: string;
|
|
@@ -320,6 +307,11 @@ export declare const previewToolSchema: z.ZodObject<{
|
|
|
320
307
|
allowedValues?: (string | number | boolean | null)[] | undefined;
|
|
321
308
|
}[];
|
|
322
309
|
providerId: string;
|
|
310
|
+
payloadJson: string;
|
|
311
|
+
};
|
|
312
|
+
}, {
|
|
313
|
+
binding: {
|
|
314
|
+
source: import("@xpert-ai/contracts").AnalyticsSourceRef;
|
|
323
315
|
output: {
|
|
324
316
|
datasetId?: string;
|
|
325
317
|
fields?: {
|
|
@@ -334,10 +326,19 @@ export declare const previewToolSchema: z.ZodObject<{
|
|
|
334
326
|
}[];
|
|
335
327
|
grain?: string[];
|
|
336
328
|
};
|
|
329
|
+
parameters: {
|
|
330
|
+
type: "string" | "number" | "boolean" | "date";
|
|
331
|
+
name: string;
|
|
332
|
+
required: boolean;
|
|
333
|
+
defaultValue?: string | number | boolean | null | undefined;
|
|
334
|
+
allowedValues?: (string | number | boolean | null)[] | undefined;
|
|
335
|
+
}[];
|
|
336
|
+
providerId: string;
|
|
337
337
|
payloadJson: string;
|
|
338
338
|
};
|
|
339
339
|
}>;
|
|
340
340
|
export declare const createToolSchema: z.ZodObject<{} & {
|
|
341
|
+
creationIntent: z.ZodOptional<z.ZodEnum<["new", "copy"]>>;
|
|
341
342
|
title: z.ZodString;
|
|
342
343
|
supersedesPaths: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
343
344
|
controls: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
@@ -446,17 +447,20 @@ export declare const createToolSchema: z.ZodObject<{} & {
|
|
|
446
447
|
fields: string[];
|
|
447
448
|
}[];
|
|
448
449
|
previewIds: string[];
|
|
450
|
+
creationIntent?: "new" | "copy" | undefined;
|
|
449
451
|
supersedesPaths?: string[] | undefined;
|
|
450
452
|
}, {
|
|
451
453
|
title: string;
|
|
452
454
|
controls?: unknown;
|
|
453
455
|
charts?: unknown;
|
|
454
456
|
tables?: unknown;
|
|
457
|
+
creationIntent?: "new" | "copy" | undefined;
|
|
455
458
|
supersedesPaths?: string[] | undefined;
|
|
456
459
|
previewIds?: unknown;
|
|
457
460
|
}>;
|
|
458
461
|
export declare const htmlPathSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
459
462
|
export declare const createHtmlToolSchema: z.ZodObject<Omit<{} & {
|
|
463
|
+
creationIntent: z.ZodOptional<z.ZodEnum<["new", "copy"]>>;
|
|
460
464
|
title: z.ZodString;
|
|
461
465
|
supersedesPaths: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
462
466
|
controls: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
@@ -542,7 +546,7 @@ export declare const createHtmlToolSchema: z.ZodObject<Omit<{} & {
|
|
|
542
546
|
previewIds: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], unknown>;
|
|
543
547
|
}, "charts" | "tables"> & {
|
|
544
548
|
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")[]>>;
|
|
549
|
+
libraries: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodArray<z.ZodEnum<["echarts", "three", "trend-workspace", "profit-atlas", "customer-brief"]>, "many">, ("echarts" | "three" | "trend-workspace" | "profit-atlas" | "customer-brief")[], ("echarts" | "three" | "trend-workspace" | "profit-atlas" | "customer-brief")[]>, ("echarts" | "three" | "trend-workspace" | "profit-atlas" | "customer-brief")[], ("echarts" | "three" | "trend-workspace" | "profit-atlas" | "customer-brief")[]>>;
|
|
546
550
|
}, "strict", z.ZodTypeAny, {
|
|
547
551
|
path: string;
|
|
548
552
|
title: string;
|
|
@@ -554,15 +558,17 @@ export declare const createHtmlToolSchema: z.ZodObject<Omit<{} & {
|
|
|
554
558
|
allowedValues?: (string | number | boolean | null)[] | undefined;
|
|
555
559
|
}[];
|
|
556
560
|
previewIds: string[];
|
|
561
|
+
creationIntent?: "new" | "copy" | undefined;
|
|
557
562
|
supersedesPaths?: string[] | undefined;
|
|
558
|
-
libraries?: ("echarts" | "three")[] | undefined;
|
|
563
|
+
libraries?: ("echarts" | "three" | "trend-workspace" | "profit-atlas" | "customer-brief")[] | undefined;
|
|
559
564
|
}, {
|
|
560
565
|
path: string;
|
|
561
566
|
title: string;
|
|
562
567
|
controls?: unknown;
|
|
568
|
+
creationIntent?: "new" | "copy" | undefined;
|
|
563
569
|
supersedesPaths?: string[] | undefined;
|
|
564
570
|
previewIds?: unknown;
|
|
565
|
-
libraries?: ("echarts" | "three")[] | undefined;
|
|
571
|
+
libraries?: ("echarts" | "three" | "trend-workspace" | "profit-atlas" | "customer-brief")[] | undefined;
|
|
566
572
|
}>;
|
|
567
573
|
export declare function parseObjectJson(text: string): Record<string, import("@xpert-ai/contracts").JSONValue>;
|
|
568
574
|
export declare function fromAgentBinding(input: z.infer<typeof agentBindingSchema>, contract: AnalyticsDiscoveryResult['queryContract']): import("@xpert-ai/contracts").AnalyticsBinding;
|
package/dist/lib/agent.schema.js
CHANGED
|
@@ -22,6 +22,7 @@ exports.agentBindingSchema = analytics_1.analyticsBindingObjectSchema.omit({ pay
|
|
|
22
22
|
}).strict();
|
|
23
23
|
exports.previewToolSchema = v3_1.z.object({ binding: exports.agentBindingSchema }).strict();
|
|
24
24
|
exports.createToolSchema = dashboard_schema_1.dashboardSchema.innerType().omit({ schema: true, id: true, bindings: true, presentation: true }).extend({
|
|
25
|
+
creationIntent: v3_1.z.enum(['new', 'copy']).optional().describe('Required when an editing target exists. Use only when the user explicitly requests a new independent dashboard or a copy; ordinary refinements must use dashboard_open/update.'),
|
|
25
26
|
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
27
|
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
28
|
controls: (0, plugin_sdk_1.jsonEncodedSchema)(agentControlsSchema),
|
|
@@ -35,7 +36,7 @@ exports.htmlPathSchema = plugin_sdk_1.workspaceRelativeFilePathSchema.refine(pat
|
|
|
35
36
|
}, 'Use a named HTML file such as dashboards/sales.html; .html alone is not a dashboard filename.')
|
|
36
37
|
.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
38
|
exports.createHtmlToolSchema = exports.createToolSchema.omit({ charts: true, tables: true }).extend({ path: exports.htmlPathSchema,
|
|
38
|
-
libraries: document_libraries_1.libraryRequestsSchema.optional().describe('Bundled
|
|
39
|
+
libraries: document_libraries_1.libraryRequestsSchema.optional().describe('Bundled IDs from dashboard_libraries. Omit for native SVG/Canvas/DOM; use echarts or three for charts. Optional: add exactly one visual theme (trend-workspace, profit-atlas, customer-brief) with echarts. Preserve the saved theme unless a change is requested.') }).strict();
|
|
39
40
|
function parseObjectJson(text) {
|
|
40
41
|
try {
|
|
41
42
|
return analytics_1.analyticsOptionsSchema.parse(JSON.parse(text));
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export declare const dashboardAppConfig: {
|
|
2
|
+
scope: "organization";
|
|
3
|
+
assistantTemplateKey: string;
|
|
4
|
+
workspace: {
|
|
5
|
+
mode: "dedicated";
|
|
6
|
+
sharing: "private";
|
|
7
|
+
name: {
|
|
8
|
+
en_US: string;
|
|
9
|
+
zh_Hans: string;
|
|
10
|
+
};
|
|
11
|
+
description: {
|
|
12
|
+
en_US: string;
|
|
13
|
+
zh_Hans: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
knowledgebases: never[];
|
|
17
|
+
modelRequirements: {
|
|
18
|
+
primary: true;
|
|
19
|
+
};
|
|
20
|
+
presentation: {
|
|
21
|
+
developer: string;
|
|
22
|
+
tagline: {
|
|
23
|
+
en_US: string;
|
|
24
|
+
zh_Hans: string;
|
|
25
|
+
};
|
|
26
|
+
longDescription: {
|
|
27
|
+
en_US: string;
|
|
28
|
+
zh_Hans: string;
|
|
29
|
+
};
|
|
30
|
+
screenshots: string[];
|
|
31
|
+
features: {
|
|
32
|
+
key: string;
|
|
33
|
+
title: {
|
|
34
|
+
en_US: string;
|
|
35
|
+
zh_Hans: string;
|
|
36
|
+
};
|
|
37
|
+
description: {
|
|
38
|
+
en_US: string;
|
|
39
|
+
zh_Hans: string;
|
|
40
|
+
};
|
|
41
|
+
}[];
|
|
42
|
+
useCases: {
|
|
43
|
+
en_US: string;
|
|
44
|
+
zh_Hans: string;
|
|
45
|
+
}[];
|
|
46
|
+
dataScope: {
|
|
47
|
+
en_US: string;
|
|
48
|
+
zh_Hans: string;
|
|
49
|
+
};
|
|
50
|
+
initializationSummary: {
|
|
51
|
+
en_US: string;
|
|
52
|
+
zh_Hans: string;
|
|
53
|
+
};
|
|
54
|
+
initializationSteps: {
|
|
55
|
+
en_US: string;
|
|
56
|
+
zh_Hans: string;
|
|
57
|
+
}[];
|
|
58
|
+
};
|
|
59
|
+
entry: {
|
|
60
|
+
type: "assistant-chat";
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dashboardAppConfig = void 0;
|
|
4
|
+
const text = (en_US, zh_Hans) => ({ en_US, zh_Hans });
|
|
5
|
+
exports.dashboardAppConfig = {
|
|
6
|
+
scope: 'organization',
|
|
7
|
+
assistantTemplateKey: 'live-dashboard-assistant',
|
|
8
|
+
workspace: {
|
|
9
|
+
mode: 'dedicated', sharing: 'private',
|
|
10
|
+
name: text('Live Dashboard workspace', '实时看板工作空间'),
|
|
11
|
+
description: text('Assistant configuration for project-scoped dashboard authoring.', '管理按项目制作看板的助理配置。')
|
|
12
|
+
},
|
|
13
|
+
knowledgebases: [],
|
|
14
|
+
modelRequirements: { primary: true },
|
|
15
|
+
presentation: {
|
|
16
|
+
developer: 'Xpert AI',
|
|
17
|
+
tagline: text('From a working example to your live business data', '从可运行样例开始,连接你的业务数据'),
|
|
18
|
+
longDescription: text('Create dashboards with an Assistant in ChatKit. Select a Project, explore clearly labeled demo data or connect authorized files and business sources, then review a saved draft before publication.', '在 ChatKit 中与助理一起制作看板。选择项目,体验明确标注的演示数据或连接有权限的文件及业务数据源,检查保存的草稿后再发布。'),
|
|
19
|
+
screenshots: [
|
|
20
|
+
'./assets/branding/cover-v1.webp',
|
|
21
|
+
'./assets/previews/trend-workspace.png',
|
|
22
|
+
'./assets/previews/profit-atlas.png',
|
|
23
|
+
'./assets/previews/customer-brief.png'
|
|
24
|
+
],
|
|
25
|
+
features: [
|
|
26
|
+
{ key: 'visual-styles', title: text('Three visual styles', '三种视觉风格'), description: text('Preview the Trend Workspace overview, Profit Atlas profitability desk and Customer Brief report prototypes. Each style includes reusable Agent recipes.', '预览 Trend Workspace 经营总览、Profit Atlas 盈利分析台与 Customer Brief 客户报告原型。每种风格均提供 Agent 可复用配方。') },
|
|
27
|
+
{ key: 'superstore', title: text('Enterprise retail analytics', '企业零售 BI 样例'), description: text('A reproducible Tableau Superstore dataset and three dashboards query your authorized published Data Xpert model.', '可复现的 Tableau Superstore 数据与三个企业看板,通过有权限的 Data Xpert 发布模型查询。') },
|
|
28
|
+
{ key: 'examples', title: text('Three runnable examples', '三个可运行样例'), description: text('Regional sales, sales overview and production quality include source, demo data and validation checks.', '区域销售、销售总览和生产质量均附带源码、演示数据与核对清单。') },
|
|
29
|
+
{ key: 'project', title: text('One synchronized Project', '项目双向同步'), description: text('ChatKit and the dashboard view use the same Project and resource permissions.', 'ChatKit 与看板视图使用同一项目及资源权限。') },
|
|
30
|
+
{ key: 'draft', title: text('Review before publication', '先检查,再发布'), description: text('The Assistant saves a draft; a project manager publishes the reviewed revision.', '助理保存草稿,项目管理者检查后发布指定修订。') }
|
|
31
|
+
],
|
|
32
|
+
useCases: [text('Sales analysis', '销售分析'), text('Production and quality review', '生产与质量分析')],
|
|
33
|
+
dataScope: text('A private configuration workspace; dashboards and files belong to the selected Project. Installation does not grant data access.', '配置工作空间保持私有;看板和文件归属所选项目。安装应用不会授予数据访问权限。'),
|
|
34
|
+
initializationSummary: text('Prepare a workspace and publish the authoring Assistant. Choose or create a Project when entering chat.', '准备工作空间并发布制作助理。进入聊天后选择或创建项目。'),
|
|
35
|
+
initializationSteps: [text('Create the private workspace', '创建私有工作空间'), text('Install the authoring template and its dependencies', '安装制作模板及依赖'), text('Configure the primary model and publish the Assistant', '配置主模型并发布助理')]
|
|
36
|
+
},
|
|
37
|
+
entry: { type: 'assistant-chat' }
|
|
38
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DashboardService } from './dashboard.service';
|
|
2
|
+
import type { ArtifactDraftRecord } from '@xpert-ai/plugin-sdk';
|
|
3
|
+
import { type RuntimeCapabilityRegistry, type ArtifactTypeDefinition, type ArtifactTypeSource, type ArtifactTypeActor, type ContentOperation, type IArtifactTypeProvider } from '@xpert-ai/plugin-sdk';
|
|
4
|
+
/** Drafts require Project edit access; explicit authenticated shares may expand formal-version readership. */
|
|
5
|
+
export declare class DashboardArtifactType implements IArtifactTypeProvider {
|
|
6
|
+
private readonly runtime;
|
|
7
|
+
private readonly dashboards;
|
|
8
|
+
constructor(runtime: RuntimeCapabilityRegistry, dashboards: DashboardService);
|
|
9
|
+
readonly definition: ArtifactTypeDefinition;
|
|
10
|
+
authorize(source: ArtifactTypeSource, actor: ArtifactTypeActor, _operation: ContentOperation): Promise<void>;
|
|
11
|
+
validateContent(content: Buffer, mimeType: string): void;
|
|
12
|
+
authorizeDraft(source: ArtifactTypeSource, actor: ArtifactTypeActor, operation: ContentOperation): Promise<void>;
|
|
13
|
+
assertDraftPublication(source: ArtifactTypeSource, actor: ArtifactTypeActor, draft: ArtifactDraftRecord): Promise<void>;
|
|
14
|
+
validateLegacyContent(source: ArtifactTypeSource, content: Buffer, mimeType: string): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.DashboardArtifactType = void 0;
|
|
16
|
+
const dashboard_service_1 = require("./dashboard.service");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const plugin_sdk_1 = require("@xpert-ai/plugin-sdk");
|
|
19
|
+
const document_package_1 = require("./document-package");
|
|
20
|
+
const dashboard_sharing_1 = require("./dashboard-sharing");
|
|
21
|
+
/** Drafts require Project edit access; explicit authenticated shares may expand formal-version readership. */
|
|
22
|
+
let DashboardArtifactType = class DashboardArtifactType {
|
|
23
|
+
constructor(runtime, dashboards) {
|
|
24
|
+
this.runtime = runtime;
|
|
25
|
+
this.dashboards = dashboards;
|
|
26
|
+
this.definition = {
|
|
27
|
+
versioning: { mode: 'draft-only' },
|
|
28
|
+
title: { en_US: 'Live dashboard', zh_Hans: '实时看板' },
|
|
29
|
+
kinds: ['file'], content: { mimeTypes: ['application/json'], maxBytes: document_package_1.MAX_DASHBOARD_PACKAGE_BYTES },
|
|
30
|
+
collection: { allowCopy: false },
|
|
31
|
+
sharing: { projectAccess: 'link-audience', accessModes: ['organization_all'], versionModes: ['latest', 'version'],
|
|
32
|
+
allowDownload: false, mutableLinks: true, descriptor: true, shareKey: dashboard_sharing_1.DASHBOARD_SHARE_KEY },
|
|
33
|
+
presentation: { mode: 'authenticated' }
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
async authorize(source, actor, _operation) {
|
|
37
|
+
if (!actor.userId || !actor.tenantId || source.tenantId !== actor.tenantId ||
|
|
38
|
+
source.pluginName !== '@xpert-ai/plugin-live-dashboard' || source.resourceType !== 'live-dashboard')
|
|
39
|
+
throw new common_1.ForbiddenException('DASHBOARD_ACCESS_DENIED');
|
|
40
|
+
}
|
|
41
|
+
validateContent(content, mimeType) {
|
|
42
|
+
if (mimeType !== 'application/json' || content.length > document_package_1.MAX_DASHBOARD_PACKAGE_BYTES)
|
|
43
|
+
throw new common_1.ForbiddenException('DASHBOARD_VERSION_UNAVAILABLE');
|
|
44
|
+
(0, document_package_1.decodeDashboardPackage)(content);
|
|
45
|
+
}
|
|
46
|
+
async authorizeDraft(source, actor, operation) {
|
|
47
|
+
await this.authorize(source, actor, operation);
|
|
48
|
+
if (source.userId || !source.projectId)
|
|
49
|
+
return;
|
|
50
|
+
const access = (await this.runtime.require(plugin_sdk_1.ProjectAccessRuntimeCapability).listReadable({
|
|
51
|
+
actor: { tenantId: actor.tenantId, userId: actor.userId, organizationId: source.organizationId }, projectIds: [source.projectId]
|
|
52
|
+
}))[0];
|
|
53
|
+
if (!access || access.role === 'member')
|
|
54
|
+
throw new common_1.ForbiddenException('DASHBOARD_DRAFT_ACCESS_DENIED');
|
|
55
|
+
}
|
|
56
|
+
async assertDraftPublication(source, actor, draft) {
|
|
57
|
+
await this.authorizeDraft(source, actor, 'manage');
|
|
58
|
+
if (!actor.tenantId || !actor.userId || !source.organizationId)
|
|
59
|
+
throw new common_1.ForbiddenException('DASHBOARD_ACCESS_DENIED');
|
|
60
|
+
const currentActor = { tenantId: actor.tenantId, userId: actor.userId, organizationId: source.organizationId };
|
|
61
|
+
await this.dashboards.validatePublication({ ...currentActor, hostType: source.projectId ? 'project' : 'agent',
|
|
62
|
+
hostId: source.projectId ?? source.xpertId, slots: [] }, draft.artifactId, draft.revision, draft.baseVersionId);
|
|
63
|
+
}
|
|
64
|
+
validateLegacyContent(source, content, mimeType) {
|
|
65
|
+
this.validateContent(content, mimeType);
|
|
66
|
+
const { manifest } = (0, document_package_1.decodeDashboardPackage)(content);
|
|
67
|
+
const prefix = source.projectId ? `project/${source.projectId}/` : source.xpertId ? `agent/${source.xpertId}/` : null;
|
|
68
|
+
if (!prefix || source.resourceId !== `${prefix}${manifest.id}`)
|
|
69
|
+
throw new common_1.ForbiddenException('DASHBOARD_IDENTITY_MISMATCH');
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
exports.DashboardArtifactType = DashboardArtifactType;
|
|
73
|
+
exports.DashboardArtifactType = DashboardArtifactType = __decorate([
|
|
74
|
+
(0, common_1.Injectable)(),
|
|
75
|
+
(0, plugin_sdk_1.ArtifactTypeProvider)('live-dashboard'),
|
|
76
|
+
__param(0, (0, common_1.Inject)(plugin_sdk_1.XPERT_RUNTIME_CAPABILITIES_TOKEN)),
|
|
77
|
+
__metadata("design:paramtypes", [Object, dashboard_service_1.DashboardService])
|
|
78
|
+
], DashboardArtifactType);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dashboardAssistantTemplate = exports.DASHBOARD_TEMPLATE_KEY = void 0;
|
|
4
|
+
const templates_1 = require("./templates");
|
|
5
|
+
exports.DASHBOARD_TEMPLATE_KEY = 'live-dashboard-assistant';
|
|
6
|
+
// The App and standalone marketplace entry install the same project-aware author.
|
|
7
|
+
exports.dashboardAssistantTemplate = templates_1.dashboardTemplates[0];
|