@xpert-ai/plugin-live-dashboard 0.7.0 → 0.7.2
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/artifact-type.provider.js +38 -1
- 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-download-policy.d.ts +4 -0
- package/dist/lib/dashboard-download-policy.js +7 -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/document-host.d.ts +1 -1
- package/dist/lib/document-host.js +2 -1
- 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 +48 -37
- 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/dist/lib/templates.js
CHANGED
|
@@ -15,8 +15,8 @@ const startPrompts = [
|
|
|
15
15
|
const startLabels = ['区域销售 · 入门', '销售总览 · 入门', '生产质量 · 入门', 'Superstore 企业分析 · 进阶', '使用我的数据'];
|
|
16
16
|
const dsl = (monitor) => JSON.stringify({
|
|
17
17
|
team: { name: monitor ? 'live-dashboard-monitor' : 'live-dashboard-assistant', type: 'agent',
|
|
18
|
-
title: monitor ? '看板巡检' : '实时看板助理', version: '1', agent: { key: 'Agent_Dashboard' },
|
|
19
|
-
options: { workspaceScope: { mode: 'project-required', projectType: project_1.DASHBOARD_PROJECT_TYPE } },
|
|
18
|
+
title: monitor ? '看板巡检' : '实时看板助理', version: monitor ? '1' : '3', agent: { key: 'Agent_Dashboard' },
|
|
19
|
+
options: { workspaceScope: { mode: 'project-required', ...(monitor ? {} : { onMissing: 'create' }), projectType: project_1.DASHBOARD_PROJECT_TYPE } },
|
|
20
20
|
features: monitor ? {} : { sandbox: { enabled: true }, opener: { enabled: true,
|
|
21
21
|
message: '选择或创建项目,从样例开始,或连接你的业务数据制作实时看板。', questions: startPrompts.map((prompt, index) => ({ label: startLabels[index], prompt })) } },
|
|
22
22
|
// Reading a recipe, registering its file and validating filters spans multiple graph steps per tool call.
|
|
@@ -26,15 +26,15 @@ const dsl = (monitor) => JSON.stringify({
|
|
|
26
26
|
name: monitor ? 'dashboard-monitor' : 'dashboard-author', title: monitor ? '看板巡检' : '看板制作',
|
|
27
27
|
prompt: monitor
|
|
28
28
|
? 'Inspect explicitly selected published dashboards in the current Project. Use dashboard_inspect to check live bindings as the scheduled run actor. Report failed bindings, incomplete results and the observed freshness; never claim business-data freshness from query time alone. Do not change definitions, publish, or expand access. Only schedule work when the human requests it. Use the user language.'
|
|
29
|
-
: 'Create and maintain dashboards in the current Project.
|
|
29
|
+
: 'Create and maintain dashboards in the current Project. Discuss metrics and plans directly. When asked to produce a dashboard, select a Project first if needed, then read the live-dashboard skill before authoring. For example requests use read_skill_file to read examples/catalog.json and the selected recipe directly relative to the catalog SKILL.md path; do not list sandbox directories to locate bundled files. After a successful draft receipt, report the receipt and let the user open its emitted card; do not reopen/update an unchanged dashboard merely to verify the save. Ask whether to use labeled synthetic demo data or authorized real data when unspecified. Small onboarding demo files belong to the current Project and use file.table after registration. The Superstore enterprise recipe instead requires the authorized published Data Xpert ontology; follow its own setup and query plans, never replace it with file.table or other sample rows. Never substitute demo values for missing real data. For enterprise BI pages, read themes/README.md, choose one visual style appropriate to the requested analysis and read its guide and complete recipe. The Superstore suite uses Trend Workspace for overview, Profit Atlas for profitability and Customer Brief for customers and returns. Use echarts plus exactly one matching theme library, adapt chart fields to discovered data, and preserve the selected theme on edits unless a redesign is requested. Discover registered data sources and validate exact bindings. Preserve the selected Artifact, component IDs and current draft revision on edits. Saving is not publication. Publication requires a manager in the Workbench. Never infer another dashboard from titles or recency. Use the user language.',
|
|
30
30
|
collaboratorNames: [], toolsetIds: [], knowledgebaseIds: [] } },
|
|
31
|
-
...(monitor ? ['LiveDashboardMonitor', 'scheduler'] : ['LiveDashboard', 'SandboxFile', 'skillsMiddleware']).map((provider, index) => ({
|
|
31
|
+
...(monitor ? ['LiveDashboardMonitor', 'scheduler'] : ['ProjectMiddleware', 'LiveDashboard', 'SandboxFile', 'skillsMiddleware']).map((provider, index) => ({
|
|
32
32
|
type: 'workflow', key: `Middleware_${provider}`, position: { x: 550, y: 100 + index * 120 },
|
|
33
33
|
entity: { type: 'middleware', key: `Middleware_${provider}`, title: provider, provider, required: true,
|
|
34
34
|
...(provider === 'LiveDashboard' ? { options: { maxModelCalls: 64 } } : {}) }
|
|
35
35
|
}))
|
|
36
36
|
],
|
|
37
|
-
connections: (monitor ? ['LiveDashboardMonitor', 'scheduler'] : ['LiveDashboard', 'SandboxFile', 'skillsMiddleware']).map(provider => ({
|
|
37
|
+
connections: (monitor ? ['LiveDashboardMonitor', 'scheduler'] : ['ProjectMiddleware', 'LiveDashboard', 'SandboxFile', 'skillsMiddleware']).map(provider => ({
|
|
38
38
|
type: 'workflow', key: `Agent_Dashboard/Middleware_${provider}`, from: 'Agent_Dashboard', to: `Middleware_${provider}`, required: true
|
|
39
39
|
}))
|
|
40
40
|
});
|
|
@@ -78,6 +78,7 @@ let DashboardViewProvider = class DashboardViewProvider {
|
|
|
78
78
|
{ key: 'delete', label: text('Delete dashboard', '删除看板'), actionType: 'invoke', placement: 'toolbar', inputSchema: { type: 'object', properties: {}, additionalProperties: true } },
|
|
79
79
|
{ key: 'publish', label: text('Publish draft', '发布草稿'), actionType: 'invoke', placement: 'toolbar', inputSchema: { type: 'object', properties: {}, additionalProperties: true } },
|
|
80
80
|
{ key: 'save', label: text('Save', '保存'), actionType: 'invoke', placement: 'toolbar', inputSchema: { type: 'object', properties: {}, additionalProperties: true } },
|
|
81
|
+
{ key: 'restore-version', label: text('Restore as draft', '恢复为草稿'), actionType: 'invoke' },
|
|
81
82
|
{ key: 'query', label: text('Refresh', '刷新'), actionType: 'invoke', placement: 'toolbar', inputSchema: { type: 'object', properties: {}, additionalProperties: true } },
|
|
82
83
|
{ key: 'query-binding', label: text('Query binding', '查询绑定'), actionType: 'invoke', placement: 'toolbar', inputSchema: { type: 'object', properties: {}, additionalProperties: true } }
|
|
83
84
|
] };
|
|
@@ -169,6 +170,11 @@ let DashboardViewProvider = class DashboardViewProvider {
|
|
|
169
170
|
const input = parsed.data;
|
|
170
171
|
return { success: true, data: await this.service.publish(context, input.artifactId, input.expectedRevision, input.expectedCurrentVersionId), refresh: false };
|
|
171
172
|
}
|
|
173
|
+
if (action === 'restore-version') {
|
|
174
|
+
const input = v3_1.z.object({ artifactId: v3_1.z.string().uuid(), versionId: v3_1.z.string().uuid(),
|
|
175
|
+
expectedRevision: v3_1.z.number().int().nonnegative(), expectedCurrentVersionId: v3_1.z.string().uuid().nullable() }).strict().parse(request.input);
|
|
176
|
+
return { success: true, data: await this.service.restore(context, input.artifactId, input.versionId, input.expectedRevision, input.expectedCurrentVersionId), refresh: false };
|
|
177
|
+
}
|
|
172
178
|
if (action === 'save') {
|
|
173
179
|
const input = dashboard_schema_1.saveSchema.parse(request.input);
|
|
174
180
|
const data = this.saves && input.manifest.bindings.length > 8
|
|
@@ -186,7 +192,7 @@ let DashboardViewProvider = class DashboardViewProvider {
|
|
|
186
192
|
if (!parsed.success)
|
|
187
193
|
throw new common_1.BadRequestException('DASHBOARD_INVALID_QUERY');
|
|
188
194
|
const input = parsed.data;
|
|
189
|
-
return { success: true, data: await this.service.queryBinding(context, input.artifactId, input.versionId, input.bindingId, input.controls, input.draftRevision), refresh: false };
|
|
195
|
+
return { success: true, data: await this.service.queryBinding(context, input.artifactId, input.versionId, input.bindingId, input.controls, input.draftRevision, input.cache), refresh: false };
|
|
190
196
|
}
|
|
191
197
|
throw new common_1.BadRequestException('DASHBOARD_ACTION_UNSUPPORTED');
|
|
192
198
|
}
|