@xpert-ai/plugin-live-dashboard 0.7.0 → 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 +2 -2
- package/dist/lib/analysis-scene-tool.d.ts +8 -8
- package/dist/lib/analysis-scene.schema.d.ts +6 -6
- 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/dashboard-delivery.d.ts +11 -0
- package/dist/lib/dashboard-delivery.js +55 -0
- package/dist/lib/dashboard-navigation.d.ts +5 -5
- package/dist/lib/dashboard-queries.d.ts +2 -2
- package/dist/lib/dashboard-queries.js +2 -2
- package/dist/lib/dashboard-view.schema.d.ts +10 -10
- package/dist/lib/dashboard.schema.d.ts +18 -0
- package/dist/lib/dashboard.schema.js +2 -1
- package/dist/lib/dashboard.service.d.ts +11 -2
- package/dist/lib/dashboard.service.js +17 -4
- package/dist/lib/definition-tools.d.ts +14 -54
- package/dist/lib/definition-tools.js +29 -9
- package/dist/lib/editing-session.d.ts +4 -4
- 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/middleware.d.ts +6 -2
- package/dist/lib/middleware.js +95 -11
- package/dist/lib/monitor.js +2 -2
- package/dist/lib/plugin.js +6 -1
- 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/runtime-context.d.ts +2 -0
- package/dist/lib/runtime-context.js +21 -0
- package/dist/lib/source-executions.d.ts +36 -18
- package/dist/lib/source-executions.js +2 -1
- package/dist/lib/templates.js +5 -5
- package/dist/lib/view.provider.js +7 -1
- package/dist/remote/app.css +1 -1
- package/dist/remote/app.js +23 -23
- package/dist/remote/build-manifest.json +45 -35
- package/dist/sandbox-actions/action.json +1 -1
- package/dist/sandbox-actions/bundle/host.js +2 -2
- package/docs/editing.mdx +6 -0
- package/docs/html-mode.md +1 -1
- package/package.json +5 -5
- package/skills/live-dashboard/SKILL.md +1 -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/docs/html-mode.md
CHANGED
|
@@ -19,7 +19,7 @@ HTML iframe → 专属 MessagePort → Live Dashboard View → query-binding
|
|
|
19
19
|
|
|
20
20
|
## 平台接口
|
|
21
21
|
|
|
22
|
-
`@xpert-ai/plugin-sdk/artifact-document` 是浏览器安全子入口。`mountArtifactDocument` 封装 HTML 格式验证、CSP
|
|
22
|
+
`@xpert-ai/plugin-sdk/artifact-document` 是浏览器安全子入口。`mountArtifactDocument` 封装 HTML 格式验证、CSP、独立 MessageChannel、Binding ID 白名单、请求限额、销毁和刷新。每次挂载都从 `sandbox="allow-scripts"` 开始;只有可信宿主显式传入 `allowDownloads: true` 时才追加 `allow-downloads`。交互式 HTML 看板会开启下载。HTML 预检使用同一个挂载函数但不传入该选项,验证沙箱保持仅脚本。同源、表单和弹窗仍然拒绝。`installArtifactDocumentFramePolicy` 在专用宿主文档安装 frame-src 策略,禁止子文档自行跳转到外部 URL。需要 SDK 3.38.0 及以上,构建期钉扎在 3.38.0。
|
|
23
23
|
|
|
24
24
|
平台不依赖 `live-dashboard`、data-xpert、图表库或任何业务页面。插件可以替换渲染器与数据源,而不复制平台权限和隔离逻辑。
|
|
25
25
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xpert-ai/plugin-live-dashboard",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Versioned live dashboards using platform analytics and Data Analytics renderer",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@nestjs/common": "^11.1.6",
|
|
38
38
|
"@nestjs/core": "^11.1.6",
|
|
39
39
|
"@nestjs/typeorm": "^11.0.3",
|
|
40
|
-
"@xpert-ai/contracts": "^3.
|
|
41
|
-
"@xpert-ai/plugin-sdk": "^3.
|
|
40
|
+
"@xpert-ai/contracts": "^3.36.0",
|
|
41
|
+
"@xpert-ai/plugin-sdk": "^3.36.0",
|
|
42
42
|
"typeorm": "^0.3.31",
|
|
43
43
|
"zod": "3.25.67"
|
|
44
44
|
},
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"@types/react": "^18.3.24",
|
|
54
54
|
"@types/react-dom": "^18.3.7",
|
|
55
55
|
"@xpert-ai/community-data-analytics": "0.1.35",
|
|
56
|
-
"@xpert-ai/contracts": "3.
|
|
57
|
-
"@xpert-ai/plugin-sdk": "3.
|
|
56
|
+
"@xpert-ai/contracts": "3.38.0",
|
|
57
|
+
"@xpert-ai/plugin-sdk": "3.38.0",
|
|
58
58
|
"echarts": "5.6.0",
|
|
59
59
|
"react": "^18.3.1",
|
|
60
60
|
"react-dom": "^18.3.1",
|
|
@@ -9,7 +9,7 @@ Use the platform SandboxFile tools to author source files. Use the dashboard too
|
|
|
9
9
|
|
|
10
10
|
## Quick start and examples
|
|
11
11
|
|
|
12
|
-
For a first dashboard or a request for examples, read [examples/catalog.json](examples/catalog.json), [the shared workflow](examples/README.md), and only the selected recipe. Offer regional-sales (standard chart), sales-overview (HTML/ECharts), or production-quality (HTML/ECharts). Keep all files and drafts in the currently selected ChatKit Project. Explicit demo requests use labeled synthetic fixtures through a real registered file.table source; otherwise establish demo versus real data before writing. Never silently fill real-data gaps with sample values. Reuse existing authoring and draft tools; sample updates never overwrite existing dashboards.
|
|
12
|
+
When the user selects one of the three bundled CSV demos, call `analytics_definition_register` with only its exact `exampleId` and bind its returned immutable source version. For a first dashboard or a request for examples, read [examples/catalog.json](examples/catalog.json), [the shared workflow](examples/README.md), and only the selected recipe. Offer regional-sales (standard chart), sales-overview (HTML/ECharts), or production-quality (HTML/ECharts). Keep all files and drafts in the currently selected ChatKit Project. Explicit demo requests use labeled synthetic fixtures through a real registered file.table source; otherwise establish demo versus real data before writing. Never silently fill real-data gaps with sample values. Reuse existing authoring and draft tools; sample updates never overwrite existing dashboards.
|
|
13
13
|
|
|
14
14
|
For enterprise BI, offer [Superstore](examples/superstore/README.md): three full dashboards over the authorized **published Data Xpert SuperstoreOrders model**. This recipe uses `data-xpert.ontology`, not the file workflow above. Keep its fictional teaching-data label. Do not read the entire orders.csv into model context; follow its administrator setup and source discovery. Missing authorization/model is a setup gap, never permission to substitute another sample. Preserve its independent backend totals for distinct orders/customers.
|
|
15
15
|
|
|
@@ -11,8 +11,8 @@ An explicit request to “try demo” authorizes copying synthetic fixture data
|
|
|
11
11
|
## Execute, do not just return a page
|
|
12
12
|
|
|
13
13
|
1. Read the recipe's README, `definition.json`, `query.json` and source. Read HTML lifecycle guidance for HTML recipes. `demo.csv` and `demo.json` are alternatives, not two datasets to combine.
|
|
14
|
-
2.
|
|
15
|
-
3.
|
|
14
|
+
2. For the packaged synthetic CSV, call `analytics_definition_register` with only the exact catalog `exampleId`. The tool resolves the current Project, checks the local sample bytes and registers the packaged definition. Keep the returned source and version.
|
|
15
|
+
3. For a user-specified replacement file, follow the ordinary file inspection and definition registration flow. Resolve its authorized connection and verify its actual columns before adapting the recipe.
|
|
16
16
|
4. Refresh `dashboard_list_sources`, discover the registered source, and use its current `bindingPayload`. Merge `query.json.payloadFields` into that payload. Bind query parameter names to the same control IDs. Output fields map to the recipe column keys, with the actual declared types/units/nullability and explicit grain.
|
|
17
17
|
5. Use `dashboard_preview` for defaults and at least two filter values. Compare real returned rows, completeness, totals and weighted ratios with `expected.json`. Use `dashboard_test_filter` from the preview checks for the two filter values; keep the original default/null Binding. Use exactly one current successful preview receipt for the one saved Binding, not a duplicate Binding per tested filter. Keep the returned datasetId in standard chart/table definitions. An HTML example expects exactly one saved complete Binding and resolves its ID from the SDK's declared bindingIds.
|
|
18
18
|
6. Standard recipe: call `dashboard_create` using `dashboard-create.json` with this run's previewId and datasetId. HTML: call `dashboard_libraries`, write the complete HTML file, then `dashboard_create_html` with this run's previewIds, declared controls and `libraries:["echarts"]`. Do not publish automatically. Fix preflight errors before claiming success.
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
## 用演示数据制作
|
|
13
13
|
|
|
14
14
|
1. 读取主技能及 `../README.md`。确认当前 ChatKit 项目已选定,用户明确要求演示数据。
|
|
15
|
-
2.
|
|
16
|
-
3.
|
|
15
|
+
2. 调用 `analytics_definition_register`,只传 `{"exampleId":"production-quality"}`。在当前项目使用配方自带的 CSV 和字段定义。
|
|
16
|
+
3. 使用返回的 source 和 versionId 进行发现与预览。
|
|
17
17
|
4. 基于 `query.json`,使用发现结果的 datasetId、revision 和 contractHash 构造查询。预览全部、至少两个筛选值,逐项比对 `expected.json`。输出字段 id 必须与本样例列 key 一致;logicalType/nullable/unit 必须与发现结果一致。
|
|
18
18
|
5. 读取 `dashboard.html`,仅使用本次唯一的完整 Dataset Binding。保留注释中的数据与生命周期约束。调用 dashboard_libraries,写入当前项目文件,再使用本次 previewIds、query.json 的 controls 和 libraries:["echarts"] 调用 dashboard_create_html。
|
|
19
19
|
6. 检查成功保存回执,报告看板及草稿修订,结束制作;不要为了确认保存而再调用 dashboard_open/update。用户通过回执卡片打开看板核对筛选、刷新与项目归属。保存失败不得宣布完成,发布仍需人工确认。
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
## 用演示数据制作
|
|
13
13
|
|
|
14
14
|
1. 读取主技能及 `../README.md`。确认当前 ChatKit 项目已选定,用户明确要求演示数据。
|
|
15
|
-
2.
|
|
16
|
-
3.
|
|
17
|
-
4.
|
|
15
|
+
2. 调用 `analytics_definition_register`,只传 `{"exampleId":"regional-sales"}`。在当前项目使用配方自带的 CSV 和字段定义。
|
|
16
|
+
3. 若用户要求按区域汇总销售额,将登记回执中的 `preparedQuery.previewRequest` 原样传给 `dashboard_preview_binding`。配方按 `region` 分组,对 `amount` 求和,金额单位为 CNY。按其他口径制作时从回执中的 `binding` 开始。
|
|
17
|
+
4. 若需要可筛选的区域明细,基于 `query.json`,使用发现结果的 datasetId、revision 和 contractHash 构造查询。预览全部、至少两个筛选值,逐项比对 `expected.json`。输出字段 id 必须与本样例列 key 一致;logicalType/nullable/unit 必须与发现结果一致。
|
|
18
18
|
5. 读取 `dashboard-create.json`,将 previewIds 替换为本次预览凭证,图表/table 的 datasetId 替换为预览返回值,再调用 dashboard_create。
|
|
19
19
|
6. 检查成功保存回执,报告看板及草稿修订;打开看板核对筛选、刷新与项目归属。保存失败不得宣布完成,发布仍需人工确认。
|
|
20
20
|
|
|
@@ -41,5 +41,53 @@
|
|
|
41
41
|
"type": "string",
|
|
42
42
|
"defaultValue": null
|
|
43
43
|
}
|
|
44
|
-
]
|
|
44
|
+
],
|
|
45
|
+
"summary": {
|
|
46
|
+
"key": "sales-by-region",
|
|
47
|
+
"description": "Sum sales amount by region (CNY), all regions.",
|
|
48
|
+
"payloadFields": {
|
|
49
|
+
"select": [
|
|
50
|
+
"region",
|
|
51
|
+
"total_sales"
|
|
52
|
+
],
|
|
53
|
+
"groupBy": [
|
|
54
|
+
"region"
|
|
55
|
+
],
|
|
56
|
+
"aggregates": [
|
|
57
|
+
{
|
|
58
|
+
"key": "total_sales",
|
|
59
|
+
"operation": "sum",
|
|
60
|
+
"column": "amount"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"orderBy": [
|
|
64
|
+
{
|
|
65
|
+
"column": "total_sales",
|
|
66
|
+
"direction": "desc"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"grain": [
|
|
71
|
+
"region"
|
|
72
|
+
],
|
|
73
|
+
"fields": [
|
|
74
|
+
{
|
|
75
|
+
"id": "region",
|
|
76
|
+
"sourceField": "region",
|
|
77
|
+
"label": "区域",
|
|
78
|
+
"logicalType": "string",
|
|
79
|
+
"role": "dimension",
|
|
80
|
+
"nullable": false
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"id": "amount",
|
|
84
|
+
"sourceField": "total_sales",
|
|
85
|
+
"label": "销售额合计",
|
|
86
|
+
"logicalType": "decimal",
|
|
87
|
+
"role": "measure",
|
|
88
|
+
"nullable": true,
|
|
89
|
+
"unit": "CNY"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
45
93
|
}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
## 用演示数据制作
|
|
13
13
|
|
|
14
14
|
1. 读取主技能及 `../README.md`。确认当前 ChatKit 项目已选定,用户明确要求演示数据。
|
|
15
|
-
2.
|
|
16
|
-
3.
|
|
15
|
+
2. 调用 `analytics_definition_register`,只传 `{"exampleId":"sales-overview"}`。在当前项目使用配方自带的 CSV 和字段定义。
|
|
16
|
+
3. 使用返回的 source 和 versionId 进行发现与预览。
|
|
17
17
|
4. 基于 `query.json`,使用发现结果的 datasetId、revision 和 contractHash 构造查询。预览全部、至少两个筛选值,逐项比对 `expected.json`。输出字段 id 必须与本样例列 key 一致;logicalType/nullable/unit 必须与发现结果一致。
|
|
18
18
|
5. 读取 `dashboard.html`,仅使用本次唯一的完整 Dataset Binding。保留注释中的数据与生命周期约束。调用 dashboard_libraries,写入当前项目文件,再使用本次 previewIds、query.json 的 controls 和 libraries:["echarts"] 调用 dashboard_create_html。
|
|
19
19
|
6. 检查成功保存回执,报告看板及草稿修订,结束制作;不要为了确认保存而再调用 dashboard_open/update。用户通过回执卡片打开看板核对筛选、刷新与项目归属。保存失败不得宣布完成,发布仍需人工确认。
|