@xpert-ai/plugin-live-dashboard 0.3.1 → 0.4.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.
Files changed (148) hide show
  1. package/.xpertai-plugin/plugin.json +10 -2
  2. package/README.md +6 -0
  3. package/assets/branding/cover-v1.prompt.txt +27 -0
  4. package/assets/branding/cover-v1.webp +0 -0
  5. package/assets/previews/customer-brief.png +0 -0
  6. package/assets/previews/profit-atlas.png +0 -0
  7. package/assets/previews/trend-workspace.png +0 -0
  8. package/dist/index.js +6 -3
  9. package/dist/lib/agent.schema.d.ts +43 -37
  10. package/dist/lib/agent.schema.js +2 -1
  11. package/dist/lib/app-config.d.ts +62 -0
  12. package/dist/lib/app-config.js +38 -0
  13. package/dist/lib/artifact-type.provider.d.ts +15 -0
  14. package/dist/lib/artifact-type.provider.js +78 -0
  15. package/dist/lib/assistant-template.d.ts +1 -2
  16. package/dist/lib/assistant-template.js +3 -52
  17. package/dist/lib/content.provider.js +13 -5
  18. package/dist/lib/dashboard-navigation.d.ts +58 -14
  19. package/dist/lib/dashboard-navigation.js +11 -10
  20. package/dist/lib/dashboard-view.schema.d.ts +278 -46
  21. package/dist/lib/dashboard-view.schema.js +9 -1
  22. package/dist/lib/dashboard.service.d.ts +49 -3
  23. package/dist/lib/dashboard.service.js +64 -28
  24. package/dist/lib/document-libraries.d.ts +1 -1
  25. package/dist/lib/document-libraries.js +3 -2
  26. package/dist/lib/document-network.d.ts +1 -1
  27. package/dist/lib/document-network.js +2 -6
  28. package/dist/lib/editing-feedback.d.ts +5 -0
  29. package/dist/lib/editing-feedback.js +19 -0
  30. package/dist/lib/editing-patch.d.ts +22 -0
  31. package/dist/lib/editing-patch.js +46 -0
  32. package/dist/lib/editing-session.d.ts +167 -0
  33. package/dist/lib/editing-session.js +53 -0
  34. package/dist/lib/editing.d.ts +92 -60
  35. package/dist/lib/editing.js +36 -24
  36. package/dist/lib/html-guidance.d.ts +1 -1
  37. package/dist/lib/html-guidance.js +1 -1
  38. package/dist/lib/middleware.js +42 -18
  39. package/dist/lib/monitor.d.ts +70 -0
  40. package/dist/lib/monitor.js +101 -0
  41. package/dist/lib/plugin.js +4 -1
  42. package/dist/lib/project.d.ts +106 -0
  43. package/dist/lib/project.js +17 -0
  44. package/dist/lib/projects.schema.d.ts +63 -0
  45. package/dist/lib/projects.schema.js +8 -0
  46. package/dist/lib/projects.service.d.ts +25 -0
  47. package/dist/lib/projects.service.js +75 -0
  48. package/dist/lib/resource-card.js +1 -1
  49. package/dist/lib/runtime-context.d.ts +3 -0
  50. package/dist/lib/runtime-context.js +13 -0
  51. package/dist/lib/save-evidence.d.ts +1 -1
  52. package/dist/lib/templates.d.ts +2 -0
  53. package/dist/lib/templates.js +55 -0
  54. package/dist/lib/view.provider.d.ts +127 -8
  55. package/dist/lib/view.provider.js +49 -12
  56. package/dist/libraries/TREND-WORKSPACE-ICONS-LICENSE.txt +43 -0
  57. package/dist/libraries/catalog.json +1 -1
  58. package/dist/remote/app.css +1 -1
  59. package/dist/remote/app.js +34 -34
  60. package/dist/remote/build-manifest.json +116 -32
  61. package/dist/sandbox-actions/action.json +1 -1
  62. package/dist/sandbox-actions/bundle/host.js +2 -2
  63. package/dist/sandbox-actions/bundle/resource-cache.mjs +2 -1
  64. package/dist/sandbox-actions/bundle/validate.mjs +1 -1
  65. package/docs/docs.json +7 -0
  66. package/docs/frontend-libraries.mdx +12 -4
  67. package/docs/html-mode.md +3 -3
  68. package/docs/quick-start-acceptance.mdx +50 -0
  69. package/docs/quick-start.mdx +64 -0
  70. package/docs/superstore.mdx +38 -0
  71. package/docs/team-sharing.mdx +6 -2
  72. package/docs/trend-workspace-acceptance.mdx +43 -0
  73. package/docs/trend-workspace.mdx +30 -0
  74. package/docs/verification.mdx +4 -2
  75. package/docs/visual-styles-acceptance.mdx +40 -0
  76. package/docs/visual-styles.mdx +46 -0
  77. package/package.json +23 -17
  78. package/skills/live-dashboard/SKILL.md +27 -3
  79. package/skills/live-dashboard/examples/README.md +25 -0
  80. package/skills/live-dashboard/examples/catalog.json +79 -0
  81. package/skills/live-dashboard/examples/production-quality/README.md +25 -0
  82. package/skills/live-dashboard/examples/production-quality/dashboard.html +129 -0
  83. package/skills/live-dashboard/examples/production-quality/definition.json +67 -0
  84. package/skills/live-dashboard/examples/production-quality/demo.csv +7 -0
  85. package/skills/live-dashboard/examples/production-quality/demo.json +44 -0
  86. package/skills/live-dashboard/examples/production-quality/expected.json +26 -0
  87. package/skills/live-dashboard/examples/production-quality/preview.png +0 -0
  88. package/skills/live-dashboard/examples/production-quality/query.json +53 -0
  89. package/skills/live-dashboard/examples/regional-sales/README.md +25 -0
  90. package/skills/live-dashboard/examples/regional-sales/dashboard-create.json +35 -0
  91. package/skills/live-dashboard/examples/regional-sales/definition.json +35 -0
  92. package/skills/live-dashboard/examples/regional-sales/demo.csv +5 -0
  93. package/skills/live-dashboard/examples/regional-sales/demo.json +18 -0
  94. package/skills/live-dashboard/examples/regional-sales/expected.json +19 -0
  95. package/skills/live-dashboard/examples/regional-sales/preview.png +0 -0
  96. package/skills/live-dashboard/examples/regional-sales/query.json +45 -0
  97. package/skills/live-dashboard/examples/sales-overview/README.md +25 -0
  98. package/skills/live-dashboard/examples/sales-overview/dashboard.html +129 -0
  99. package/skills/live-dashboard/examples/sales-overview/definition.json +57 -0
  100. package/skills/live-dashboard/examples/sales-overview/demo.csv +7 -0
  101. package/skills/live-dashboard/examples/sales-overview/demo.json +38 -0
  102. package/skills/live-dashboard/examples/sales-overview/expected.json +22 -0
  103. package/skills/live-dashboard/examples/sales-overview/preview.png +0 -0
  104. package/skills/live-dashboard/examples/sales-overview/query.json +52 -0
  105. package/skills/live-dashboard/examples/superstore/README.md +64 -0
  106. package/skills/live-dashboard/examples/superstore/THIRD_PARTY_LICENSE.txt +207 -0
  107. package/skills/live-dashboard/examples/superstore/build_data.py +155 -0
  108. package/skills/live-dashboard/examples/superstore/build_pages.py +129 -0
  109. package/skills/live-dashboard/examples/superstore/checks.json +104 -0
  110. package/skills/live-dashboard/examples/superstore/customers-mobile-dark.png +0 -0
  111. package/skills/live-dashboard/examples/superstore/customers-select.png +0 -0
  112. package/skills/live-dashboard/examples/superstore/customers.html +316 -0
  113. package/skills/live-dashboard/examples/superstore/customers.png +0 -0
  114. package/skills/live-dashboard/examples/superstore/customers.queries.json +512 -0
  115. package/skills/live-dashboard/examples/superstore/expected.json +4069 -0
  116. package/skills/live-dashboard/examples/superstore/import.json +200 -0
  117. package/skills/live-dashboard/examples/superstore/orders.csv +10195 -0
  118. package/skills/live-dashboard/examples/superstore/overview-mobile-dark.png +0 -0
  119. package/skills/live-dashboard/examples/superstore/overview-select.png +0 -0
  120. package/skills/live-dashboard/examples/superstore/overview.html +310 -0
  121. package/skills/live-dashboard/examples/superstore/overview.png +0 -0
  122. package/skills/live-dashboard/examples/superstore/overview.queries.json +636 -0
  123. package/skills/live-dashboard/examples/superstore/page.js +109 -0
  124. package/skills/live-dashboard/examples/superstore/profitability-mobile-dark.png +0 -0
  125. package/skills/live-dashboard/examples/superstore/profitability-select.png +0 -0
  126. package/skills/live-dashboard/examples/superstore/profitability.html +307 -0
  127. package/skills/live-dashboard/examples/superstore/profitability.png +0 -0
  128. package/skills/live-dashboard/examples/superstore/profitability.queries.json +334 -0
  129. package/skills/live-dashboard/examples/superstore/provenance.json +24 -0
  130. package/skills/live-dashboard/examples/superstore/semantic-model.json +220 -0
  131. package/skills/live-dashboard/examples/superstore/test_data.py +62 -0
  132. package/skills/live-dashboard/references/html-runtime.md +1 -1
  133. package/skills/live-dashboard/themes/README.md +50 -0
  134. package/skills/live-dashboard/themes/customer-brief/README.md +47 -0
  135. package/skills/live-dashboard/themes/customer-brief/charts.js +17 -0
  136. package/skills/live-dashboard/themes/customer-brief/layout.html +22 -0
  137. package/skills/live-dashboard/themes/customer-brief/theme.css +108 -0
  138. package/skills/live-dashboard/themes/profit-atlas/README.md +43 -0
  139. package/skills/live-dashboard/themes/profit-atlas/charts.js +30 -0
  140. package/skills/live-dashboard/themes/profit-atlas/layout.html +19 -0
  141. package/skills/live-dashboard/themes/profit-atlas/theme.css +75 -0
  142. package/skills/live-dashboard/themes/trend-workspace/ICON_LICENSE.txt +43 -0
  143. package/skills/live-dashboard/themes/trend-workspace/README.md +144 -0
  144. package/skills/live-dashboard/themes/trend-workspace/charts.js +60 -0
  145. package/skills/live-dashboard/themes/trend-workspace/icons.js +11 -0
  146. package/skills/live-dashboard/themes/trend-workspace/layout.html +45 -0
  147. package/skills/live-dashboard/themes/trend-workspace/select.js +127 -0
  148. package/skills/live-dashboard/themes/trend-workspace/theme.css +137 -0
@@ -52,8 +52,8 @@ let DashboardContentProvider = class DashboardContentProvider {
52
52
  },
53
53
  describe: input => this.describe(input),
54
54
  extract: async (input) => {
55
- const saved = await this.service.open(context(input), input.sourceResourceId);
56
- return (0, dashboard_search_1.dashboardSearchProjection)(saved.manifest, String(saved.draftRevision ?? 0));
55
+ const saved = await this.service.open(context(input), input.sourceResourceId, undefined, undefined, 'published');
56
+ return (0, dashboard_search_1.dashboardSearchProjection)(saved.manifest, saved.versionId ?? 'unpublished');
57
57
  },
58
58
  create: async (input) => {
59
59
  if (input.templateId)
@@ -130,6 +130,8 @@ let DashboardContentProvider = class DashboardContentProvider {
130
130
  const access = (await this.runtime.require(plugin_sdk_1.ProjectAccessRuntimeCapability).listReadable({ actor: input.actor, projectIds: [artifact.projectId] }))[0];
131
131
  if (!access)
132
132
  throw new common_1.ForbiddenException('DASHBOARD_ACCESS_DENIED');
133
+ if (access.role === 'member' && !artifact.currentVersionId)
134
+ throw new common_1.ForbiddenException('DASHBOARD_NOT_PUBLISHED');
133
135
  return { providerKey: exports.DASHBOARD_CONTENT_PROVIDER, resourceId: input.resourceId, title: artifact.title ?? '', role: access.role,
134
136
  canWrite: !access.archived && ['owner', 'manager', 'editor'].includes(access.role), canManage: access.canManage };
135
137
  }
@@ -141,14 +143,20 @@ let DashboardContentProvider = class DashboardContentProvider {
141
143
  const artifact = await this.runtime.require(plugin_sdk_1.ArtifactsRuntimeCapability).getArtifact(input.sourceResourceId);
142
144
  if (artifact.projectId !== input.projectId || artifact.status === 'deleted')
143
145
  throw new common_1.ForbiddenException('DASHBOARD_ACCESS_DENIED');
144
- const draft = await this.runtime.require(plugin_sdk_1.ArtifactDraftsRuntimeCapability).get(input.sourceResourceId, { includeArchived: true });
146
+ const draft = access.role !== 'member' ? await this.runtime.require(plugin_sdk_1.ArtifactDraftsRuntimeCapability).get(input.sourceResourceId, { includeArchived: true }) : null;
147
+ if (access.role === 'member') {
148
+ const saved = await this.service.open(context(input), input.sourceResourceId, undefined, undefined, 'published');
149
+ return { ...MODEL, projectId: input.projectId, title: saved.manifest.title, revision: String(saved.versionNumber),
150
+ updatedAt: new Date(saved.updatedAt ?? 0).toISOString(), deleted: false, defaultEditorKey: EDITOR, allowedActions: [],
151
+ sourceSync: { status: 'synced', revision: String(saved.versionNumber) }, source: { kind: 'managed' } };
152
+ }
145
153
  if (!draft)
146
154
  throw new common_1.BadRequestException('DASHBOARD_VERSION_UNAVAILABLE');
147
155
  const deleted = artifact.status === 'archived';
148
156
  const saved = !deleted ? await this.service.open(context(input), input.sourceResourceId) : null;
149
- return { ...MODEL, offlineAccess: 'project', projectId: input.projectId, title: draft.title ?? artifact.title ?? '', revision: String(draft.revision),
157
+ return { ...MODEL, projectId: input.projectId, title: draft.title ?? artifact.title ?? '', revision: String(draft.revision),
150
158
  updatedAt: new Date(draft.updatedAt ?? artifact.updatedAt ?? 0).toISOString(), deleted, defaultEditorKey: EDITOR,
151
- allowedActions: [...(!deleted ? ['rename', 'duplicate'] : []), ...(access.canManage ? [deleted ? 'restore' : 'trash'] : [])],
159
+ allowedActions: [...(!deleted && !access.archived ? ['rename', 'duplicate'] : []), ...(access.canManage ? [deleted ? 'restore' : 'trash'] : [])],
152
160
  ...(saved ? { preview: { kind: 'outline', revision: String(draft.revision), lines: [saved.manifest.title, ...saved.manifest.charts.map(chart => chart.title), ...saved.manifest.tables.map(table => table.title)].slice(0, 6).map(line => line.slice(0, 160)) } } : {}),
153
161
  sourceSync: { status: 'synced', revision: String(draft.revision) },
154
162
  source: draft.workspaceFileRef?.workspacePath ? { kind: 'file', path: draft.workspaceFileRef.workspacePath } : { kind: 'managed' } };
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod/v3';
2
2
  import type { XpertResolvedViewHostContext } from '@xpert-ai/contracts';
3
3
  export declare const DASHBOARD_VIEW_KEY = "live-dashboard__live-dashboard";
4
- export declare const dashboardNavigationTargetSchema: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
4
+ export declare const dashboardNavigationTargetSchema: z.ZodObject<{
5
5
  target: z.ZodLiteral<"workbench.view">;
6
6
  viewKey: z.ZodLiteral<"live-dashboard__live-dashboard">;
7
7
  }, "strict", z.ZodTypeAny, {
@@ -10,78 +10,122 @@ export declare const dashboardNavigationTargetSchema: z.ZodDiscriminatedUnion<"t
10
10
  }, {
11
11
  target: "workbench.view";
12
12
  viewKey: "live-dashboard__live-dashboard";
13
- }>, z.ZodObject<{
14
- target: z.ZodLiteral<"assistant.project">;
15
- projectId: z.ZodString;
16
- viewKey: z.ZodLiteral<"live-dashboard__live-dashboard">;
17
- }, "strict", z.ZodTypeAny, {
18
- projectId: string;
19
- target: "assistant.project";
20
- viewKey: "live-dashboard__live-dashboard";
21
- }, {
22
- projectId: string;
23
- target: "assistant.project";
24
- viewKey: "live-dashboard__live-dashboard";
25
- }>]>;
13
+ }>;
26
14
  export type DashboardNavigationTarget = z.infer<typeof dashboardNavigationTargetSchema>;
27
15
  /** Resolve from the authorized host context, never from the dashboard's business identity. */
28
16
  export declare function dashboardNavigationTarget(context: XpertResolvedViewHostContext): DashboardNavigationTarget;
29
17
  export declare const dashboardNavigationSchema: z.ZodEffects<z.ZodObject<{
30
18
  selectionId: z.ZodOptional<z.ZodString>;
19
+ page: z.ZodOptional<z.ZodNumber>;
20
+ pageSize: z.ZodOptional<z.ZodNumber>;
31
21
  parameters: z.ZodOptional<z.ZodObject<{
22
+ pipelineInstanceId: z.ZodOptional<z.ZodString>;
23
+ pipelineRoundId: z.ZodOptional<z.ZodString>;
24
+ pipelineNodeId: z.ZodOptional<z.ZodString>;
32
25
  contentProvider: z.ZodOptional<z.ZodString>;
33
26
  contentId: z.ZodOptional<z.ZodString>;
34
27
  contentTitle: z.ZodOptional<z.ZodString>;
35
28
  contentEditor: z.ZodOptional<z.ZodString>;
36
29
  artifactId: z.ZodOptional<z.ZodString>;
37
30
  versionId: z.ZodOptional<z.ZodString>;
31
+ newDashboard: z.ZodOptional<z.ZodBoolean>;
32
+ picker: z.ZodOptional<z.ZodLiteral<"dashboards">>;
33
+ draftRevision: z.ZodOptional<z.ZodNumber>;
34
+ mode: z.ZodOptional<z.ZodEnum<["published", "draft"]>>;
38
35
  }, "strict", z.ZodTypeAny, {
39
36
  artifactId?: string | undefined;
40
37
  versionId?: string | undefined;
38
+ draftRevision?: number | undefined;
39
+ mode?: "draft" | "published" | undefined;
40
+ pipelineInstanceId?: string | undefined;
41
+ pipelineRoundId?: string | undefined;
42
+ pipelineNodeId?: string | undefined;
41
43
  contentProvider?: string | undefined;
42
44
  contentId?: string | undefined;
43
45
  contentTitle?: string | undefined;
44
46
  contentEditor?: string | undefined;
47
+ newDashboard?: boolean | undefined;
48
+ picker?: "dashboards" | undefined;
45
49
  }, {
46
50
  artifactId?: string | undefined;
47
51
  versionId?: string | undefined;
52
+ draftRevision?: number | undefined;
53
+ mode?: "draft" | "published" | undefined;
54
+ pipelineInstanceId?: string | undefined;
55
+ pipelineRoundId?: string | undefined;
56
+ pipelineNodeId?: string | undefined;
48
57
  contentProvider?: string | undefined;
49
58
  contentId?: string | undefined;
50
59
  contentTitle?: string | undefined;
51
60
  contentEditor?: string | undefined;
61
+ newDashboard?: boolean | undefined;
62
+ picker?: "dashboards" | undefined;
52
63
  }>>;
53
64
  }, "strip", z.ZodTypeAny, {
65
+ page?: number | undefined;
66
+ pageSize?: number | undefined;
54
67
  selectionId?: string | undefined;
55
68
  parameters?: {
56
69
  artifactId?: string | undefined;
57
70
  versionId?: string | undefined;
71
+ draftRevision?: number | undefined;
72
+ mode?: "draft" | "published" | undefined;
73
+ pipelineInstanceId?: string | undefined;
74
+ pipelineRoundId?: string | undefined;
75
+ pipelineNodeId?: string | undefined;
58
76
  contentProvider?: string | undefined;
59
77
  contentId?: string | undefined;
60
78
  contentTitle?: string | undefined;
61
79
  contentEditor?: string | undefined;
80
+ newDashboard?: boolean | undefined;
81
+ picker?: "dashboards" | undefined;
62
82
  } | undefined;
63
83
  }, {
84
+ page?: number | undefined;
85
+ pageSize?: number | undefined;
64
86
  selectionId?: string | undefined;
65
87
  parameters?: {
66
88
  artifactId?: string | undefined;
67
89
  versionId?: string | undefined;
90
+ draftRevision?: number | undefined;
91
+ mode?: "draft" | "published" | undefined;
92
+ pipelineInstanceId?: string | undefined;
93
+ pipelineRoundId?: string | undefined;
94
+ pipelineNodeId?: string | undefined;
68
95
  contentProvider?: string | undefined;
69
96
  contentId?: string | undefined;
70
97
  contentTitle?: string | undefined;
71
98
  contentEditor?: string | undefined;
99
+ newDashboard?: boolean | undefined;
100
+ picker?: "dashboards" | undefined;
72
101
  } | undefined;
73
102
  }>, {
103
+ newDashboard?: boolean | undefined;
104
+ picker?: "dashboards" | undefined;
105
+ mode?: "draft" | "published" | undefined;
106
+ pageSize?: number | undefined;
107
+ page?: number | undefined;
108
+ draftRevision?: number | undefined;
74
109
  artifactId: string | undefined;
75
110
  versionId: string | undefined;
76
111
  }, {
112
+ page?: number | undefined;
113
+ pageSize?: number | undefined;
77
114
  selectionId?: string | undefined;
78
115
  parameters?: {
79
116
  artifactId?: string | undefined;
80
117
  versionId?: string | undefined;
118
+ draftRevision?: number | undefined;
119
+ mode?: "draft" | "published" | undefined;
120
+ pipelineInstanceId?: string | undefined;
121
+ pipelineRoundId?: string | undefined;
122
+ pipelineNodeId?: string | undefined;
81
123
  contentProvider?: string | undefined;
82
124
  contentId?: string | undefined;
83
125
  contentTitle?: string | undefined;
84
126
  contentEditor?: string | undefined;
127
+ newDashboard?: boolean | undefined;
128
+ picker?: "dashboards" | undefined;
85
129
  } | undefined;
86
130
  }>;
87
131
  export type DashboardNavigation = z.infer<typeof dashboardNavigationSchema>;
@@ -5,28 +5,29 @@ exports.dashboardNavigationTarget = dashboardNavigationTarget;
5
5
  const v3_1 = require("zod/v3");
6
6
  // The host namespaces provider + local view key; cards use the resolved public key.
7
7
  exports.DASHBOARD_VIEW_KEY = 'live-dashboard__live-dashboard';
8
- exports.dashboardNavigationTargetSchema = v3_1.z.discriminatedUnion('target', [
9
- v3_1.z.object({ target: v3_1.z.literal('workbench.view'), viewKey: v3_1.z.literal(exports.DASHBOARD_VIEW_KEY) }).strict(),
10
- v3_1.z.object({ target: v3_1.z.literal('assistant.project'), projectId: v3_1.z.string().uuid(), viewKey: v3_1.z.literal(exports.DASHBOARD_VIEW_KEY) }).strict()
11
- ]);
8
+ exports.dashboardNavigationTargetSchema = v3_1.z.object({
9
+ target: v3_1.z.literal('workbench.view'), viewKey: v3_1.z.literal(exports.DASHBOARD_VIEW_KEY)
10
+ }).strict();
12
11
  /** Resolve from the authorized host context, never from the dashboard's business identity. */
13
12
  function dashboardNavigationTarget(context) {
14
- if (context.hostType !== 'agent' && context.hostType !== 'project')
13
+ if (context.hostType !== 'agent')
15
14
  throw new Error('DASHBOARD_HOST_UNSUPPORTED');
16
15
  return {
17
- ...(context.hostType === 'project' ? { target: 'assistant.project', projectId: context.hostId } : { target: 'workbench.view' }),
16
+ target: 'workbench.view',
18
17
  viewKey: exports.DASHBOARD_VIEW_KEY
19
18
  };
20
19
  }
21
20
  exports.dashboardNavigationSchema = v3_1.z.object({
22
21
  selectionId: v3_1.z.string().uuid().optional(),
23
- parameters: v3_1.z.object({ contentProvider: v3_1.z.string().optional(), contentId: v3_1.z.string().uuid().optional(), contentTitle: v3_1.z.string().optional(), contentEditor: v3_1.z.string().optional(), artifactId: v3_1.z.string().uuid().optional(), versionId: v3_1.z.string().uuid().optional() }).strict().optional()
22
+ page: v3_1.z.number().int().positive().optional(), pageSize: v3_1.z.number().int().min(1).max(100).optional(),
23
+ parameters: v3_1.z.object({ pipelineInstanceId: v3_1.z.string().uuid().optional(), pipelineRoundId: v3_1.z.string().uuid().optional(), pipelineNodeId: v3_1.z.string().uuid().optional(), contentProvider: v3_1.z.string().optional(), contentId: v3_1.z.string().uuid().optional(), contentTitle: v3_1.z.string().optional(), contentEditor: v3_1.z.string().optional(), artifactId: v3_1.z.string().uuid().optional(), versionId: v3_1.z.string().uuid().optional(), newDashboard: v3_1.z.boolean().optional(), picker: v3_1.z.literal('dashboards').optional(), draftRevision: v3_1.z.number().int().positive().optional(), mode: v3_1.z.enum(['published', 'draft']).optional() }).strict().optional()
24
24
  }).transform((query, ctx) => {
25
25
  const artifactId = query.selectionId ?? query.parameters?.artifactId;
26
26
  const versionId = query.parameters?.versionId;
27
- if (query.selectionId && query.parameters?.artifactId && query.selectionId !== query.parameters.artifactId || versionId && !artifactId)
27
+ if (query.parameters?.newDashboard && artifactId || query.selectionId && query.parameters?.artifactId && query.selectionId !== query.parameters.artifactId || versionId && !artifactId)
28
28
  ctx.addIssue({ code: v3_1.z.ZodIssueCode.custom, message: 'DASHBOARD_NAVIGATION_INVALID: provide one Artifact identity and an optional version' });
29
- return { artifactId, versionId };
29
+ return { artifactId, versionId, ...(query.parameters?.draftRevision ? { draftRevision: query.parameters.draftRevision } : {}), ...(query.page ? { page: query.page } : {}), ...(query.pageSize ? { pageSize: query.pageSize } : {}),
30
+ ...(query.parameters?.mode ? { mode: query.parameters.mode } : {}), ...(query.parameters?.picker ? { picker: query.parameters.picker } : {}), ...(query.parameters?.newDashboard ? { newDashboard: true } : {}) };
30
31
  });
31
- const dashboardNavigationKey = (target) => JSON.stringify([target.artifactId ?? null, target.versionId ?? null]);
32
+ const dashboardNavigationKey = (target) => JSON.stringify([target.artifactId ?? null, target.versionId ?? null, target.newDashboard ?? false, target.mode ?? null, target.draftRevision ?? null, target.picker ?? null]);
32
33
  exports.dashboardNavigationKey = dashboardNavigationKey;
@@ -30,6 +30,75 @@ export declare const dashboardSummarySchema: z.ZodObject<{
30
30
  updatedAt?: string | undefined;
31
31
  canDelete?: boolean | undefined;
32
32
  }>;
33
+ export declare const dashboardPickerPageSchema: z.ZodObject<{
34
+ items: z.ZodArray<z.ZodObject<{
35
+ artifactId: z.ZodString;
36
+ versionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
+ versionNumber: z.ZodOptional<z.ZodNumber>;
38
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
+ updatedAt: z.ZodOptional<z.ZodString>;
40
+ draftRevision: z.ZodOptional<z.ZodNumber>;
41
+ canDelete: z.ZodOptional<z.ZodBoolean>;
42
+ isDraft: z.ZodOptional<z.ZodBoolean>;
43
+ baseVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
+ }, "strip", z.ZodTypeAny, {
45
+ artifactId: string;
46
+ title?: string | null | undefined;
47
+ versionId?: string | null | undefined;
48
+ draftRevision?: number | undefined;
49
+ versionNumber?: number | undefined;
50
+ baseVersionId?: string | null | undefined;
51
+ isDraft?: boolean | undefined;
52
+ updatedAt?: string | undefined;
53
+ canDelete?: boolean | undefined;
54
+ }, {
55
+ artifactId: string;
56
+ title?: string | null | undefined;
57
+ versionId?: string | null | undefined;
58
+ draftRevision?: number | undefined;
59
+ versionNumber?: number | undefined;
60
+ baseVersionId?: string | null | undefined;
61
+ isDraft?: boolean | undefined;
62
+ updatedAt?: string | undefined;
63
+ canDelete?: boolean | undefined;
64
+ }>, "many">;
65
+ page: z.ZodNumber;
66
+ hasMore: z.ZodBoolean;
67
+ canEdit: z.ZodDefault<z.ZodBoolean>;
68
+ mode: z.ZodOptional<z.ZodEnum<["draft", "published"]>>;
69
+ }, "strip", z.ZodTypeAny, {
70
+ canEdit: boolean;
71
+ page: number;
72
+ items: {
73
+ artifactId: string;
74
+ title?: string | null | undefined;
75
+ versionId?: string | null | undefined;
76
+ draftRevision?: number | undefined;
77
+ versionNumber?: number | undefined;
78
+ baseVersionId?: string | null | undefined;
79
+ isDraft?: boolean | undefined;
80
+ updatedAt?: string | undefined;
81
+ canDelete?: boolean | undefined;
82
+ }[];
83
+ hasMore: boolean;
84
+ mode?: "draft" | "published" | undefined;
85
+ }, {
86
+ page: number;
87
+ items: {
88
+ artifactId: string;
89
+ title?: string | null | undefined;
90
+ versionId?: string | null | undefined;
91
+ draftRevision?: number | undefined;
92
+ versionNumber?: number | undefined;
93
+ baseVersionId?: string | null | undefined;
94
+ isDraft?: boolean | undefined;
95
+ updatedAt?: string | undefined;
96
+ canDelete?: boolean | undefined;
97
+ }[];
98
+ hasMore: boolean;
99
+ mode?: "draft" | "published" | undefined;
100
+ canEdit?: boolean | undefined;
101
+ }>;
33
102
  export declare const dashboardSavedSchema: z.ZodObject<{
34
103
  artifactId: z.ZodString;
35
104
  versionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -430,7 +499,51 @@ export declare const dashboardSavedSchema: z.ZodObject<{
430
499
  }>;
431
500
  export declare const dashboardViewDataSchema: z.ZodObject<{
432
501
  meta: z.ZodObject<{
433
- navigationTarget: z.ZodOptional<z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
502
+ currentProject: z.ZodOptional<z.ZodNullable<z.ZodObject<{
503
+ id: z.ZodString;
504
+ name: z.ZodString;
505
+ }, "strip", z.ZodTypeAny, {
506
+ id: string;
507
+ name: string;
508
+ }, {
509
+ id: string;
510
+ name: string;
511
+ }>>>;
512
+ access: z.ZodOptional<z.ZodObject<{
513
+ project: z.ZodBoolean;
514
+ archived: z.ZodBoolean;
515
+ canReadDraft: z.ZodBoolean;
516
+ canEdit: z.ZodBoolean;
517
+ canManage: z.ZodBoolean;
518
+ }, "strip", z.ZodTypeAny, {
519
+ project: boolean;
520
+ archived: boolean;
521
+ canReadDraft: boolean;
522
+ canEdit: boolean;
523
+ canManage: boolean;
524
+ }, {
525
+ project: boolean;
526
+ archived: boolean;
527
+ canReadDraft: boolean;
528
+ canEdit: boolean;
529
+ canManage: boolean;
530
+ }>>;
531
+ mode: z.ZodOptional<z.ZodEnum<["published", "draft"]>>;
532
+ notice: z.ZodOptional<z.ZodLiteral<"not_published">>;
533
+ pagination: z.ZodOptional<z.ZodObject<{
534
+ page: z.ZodNumber;
535
+ pageSize: z.ZodNumber;
536
+ hasMore: z.ZodBoolean;
537
+ }, "strip", z.ZodTypeAny, {
538
+ page: number;
539
+ pageSize: number;
540
+ hasMore: boolean;
541
+ }, {
542
+ page: number;
543
+ pageSize: number;
544
+ hasMore: boolean;
545
+ }>>;
546
+ navigationTarget: z.ZodOptional<z.ZodObject<{
434
547
  target: z.ZodLiteral<"workbench.view">;
435
548
  viewKey: z.ZodLiteral<"live-dashboard__live-dashboard">;
436
549
  }, "strict", z.ZodTypeAny, {
@@ -439,19 +552,7 @@ export declare const dashboardViewDataSchema: z.ZodObject<{
439
552
  }, {
440
553
  target: "workbench.view";
441
554
  viewKey: "live-dashboard__live-dashboard";
442
- }>, z.ZodObject<{
443
- target: z.ZodLiteral<"assistant.project">;
444
- projectId: z.ZodString;
445
- viewKey: z.ZodLiteral<"live-dashboard__live-dashboard">;
446
- }, "strict", z.ZodTypeAny, {
447
- projectId: string;
448
- target: "assistant.project";
449
- viewKey: "live-dashboard__live-dashboard";
450
- }, {
451
- projectId: string;
452
- target: "assistant.project";
453
- viewKey: "live-dashboard__live-dashboard";
454
- }>]>>;
555
+ }>>;
455
556
  dashboards: z.ZodArray<z.ZodObject<{
456
557
  artifactId: z.ZodString;
457
558
  versionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -483,6 +584,37 @@ export declare const dashboardViewDataSchema: z.ZodObject<{
483
584
  updatedAt?: string | undefined;
484
585
  canDelete?: boolean | undefined;
485
586
  }>, "many">;
587
+ selectedDashboard: z.ZodOptional<z.ZodObject<{
588
+ artifactId: z.ZodString;
589
+ versionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
590
+ versionNumber: z.ZodOptional<z.ZodNumber>;
591
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
592
+ updatedAt: z.ZodOptional<z.ZodString>;
593
+ draftRevision: z.ZodOptional<z.ZodNumber>;
594
+ canDelete: z.ZodOptional<z.ZodBoolean>;
595
+ isDraft: z.ZodOptional<z.ZodBoolean>;
596
+ baseVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
597
+ }, "strip", z.ZodTypeAny, {
598
+ artifactId: string;
599
+ title?: string | null | undefined;
600
+ versionId?: string | null | undefined;
601
+ draftRevision?: number | undefined;
602
+ versionNumber?: number | undefined;
603
+ baseVersionId?: string | null | undefined;
604
+ isDraft?: boolean | undefined;
605
+ updatedAt?: string | undefined;
606
+ canDelete?: boolean | undefined;
607
+ }, {
608
+ artifactId: string;
609
+ title?: string | null | undefined;
610
+ versionId?: string | null | undefined;
611
+ draftRevision?: number | undefined;
612
+ versionNumber?: number | undefined;
613
+ baseVersionId?: string | null | undefined;
614
+ isDraft?: boolean | undefined;
615
+ updatedAt?: string | undefined;
616
+ canDelete?: boolean | undefined;
617
+ }>>;
486
618
  sources: z.ZodArray<z.ZodObject<{
487
619
  source: z.ZodType<import("@xpert-ai/contracts").AnalyticsSourceRef, z.ZodTypeDef, import("@xpert-ai/contracts").AnalyticsSourceRef>;
488
620
  name: z.ZodString;
@@ -923,10 +1055,6 @@ export declare const dashboardViewDataSchema: z.ZodObject<{
923
1055
  canDelete?: boolean | undefined;
924
1056
  }>, "many">>;
925
1057
  }, "strip", z.ZodTypeAny, {
926
- sources: {
927
- name: string;
928
- source: import("@xpert-ai/contracts").AnalyticsSourceRef;
929
- }[];
930
1058
  dashboards: {
931
1059
  artifactId: string;
932
1060
  title?: string | null | undefined;
@@ -938,6 +1066,11 @@ export declare const dashboardViewDataSchema: z.ZodObject<{
938
1066
  updatedAt?: string | undefined;
939
1067
  canDelete?: boolean | undefined;
940
1068
  }[];
1069
+ sources: {
1070
+ name: string;
1071
+ source: import("@xpert-ai/contracts").AnalyticsSourceRef;
1072
+ }[];
1073
+ mode?: "draft" | "published" | undefined;
941
1074
  saved?: {
942
1075
  manifest: {
943
1076
  schema: "xpert.live-dashboard";
@@ -983,13 +1116,37 @@ export declare const dashboardViewDataSchema: z.ZodObject<{
983
1116
  updatedAt?: string | undefined;
984
1117
  canDelete?: boolean | undefined;
985
1118
  } | undefined;
1119
+ access?: {
1120
+ project: boolean;
1121
+ archived: boolean;
1122
+ canReadDraft: boolean;
1123
+ canEdit: boolean;
1124
+ canManage: boolean;
1125
+ } | undefined;
1126
+ notice?: "not_published" | undefined;
1127
+ currentProject?: {
1128
+ id: string;
1129
+ name: string;
1130
+ } | null | undefined;
1131
+ pagination?: {
1132
+ page: number;
1133
+ pageSize: number;
1134
+ hasMore: boolean;
1135
+ } | undefined;
986
1136
  navigationTarget?: {
987
1137
  target: "workbench.view";
988
1138
  viewKey: "live-dashboard__live-dashboard";
989
- } | {
990
- projectId: string;
991
- target: "assistant.project";
992
- viewKey: "live-dashboard__live-dashboard";
1139
+ } | undefined;
1140
+ selectedDashboard?: {
1141
+ artifactId: string;
1142
+ title?: string | null | undefined;
1143
+ versionId?: string | null | undefined;
1144
+ draftRevision?: number | undefined;
1145
+ versionNumber?: number | undefined;
1146
+ baseVersionId?: string | null | undefined;
1147
+ isDraft?: boolean | undefined;
1148
+ updatedAt?: string | undefined;
1149
+ canDelete?: boolean | undefined;
993
1150
  } | undefined;
994
1151
  versions?: {
995
1152
  artifactId: string;
@@ -1003,10 +1160,6 @@ export declare const dashboardViewDataSchema: z.ZodObject<{
1003
1160
  canDelete?: boolean | undefined;
1004
1161
  }[] | undefined;
1005
1162
  }, {
1006
- sources: {
1007
- name: string;
1008
- source: import("@xpert-ai/contracts").AnalyticsSourceRef;
1009
- }[];
1010
1163
  dashboards: {
1011
1164
  artifactId: string;
1012
1165
  title?: string | null | undefined;
@@ -1018,6 +1171,11 @@ export declare const dashboardViewDataSchema: z.ZodObject<{
1018
1171
  updatedAt?: string | undefined;
1019
1172
  canDelete?: boolean | undefined;
1020
1173
  }[];
1174
+ sources: {
1175
+ name: string;
1176
+ source: import("@xpert-ai/contracts").AnalyticsSourceRef;
1177
+ }[];
1178
+ mode?: "draft" | "published" | undefined;
1021
1179
  saved?: {
1022
1180
  manifest: {
1023
1181
  schema: "xpert.live-dashboard";
@@ -1076,13 +1234,37 @@ export declare const dashboardViewDataSchema: z.ZodObject<{
1076
1234
  updatedAt?: string | undefined;
1077
1235
  canDelete?: boolean | undefined;
1078
1236
  } | undefined;
1237
+ access?: {
1238
+ project: boolean;
1239
+ archived: boolean;
1240
+ canReadDraft: boolean;
1241
+ canEdit: boolean;
1242
+ canManage: boolean;
1243
+ } | undefined;
1244
+ notice?: "not_published" | undefined;
1245
+ currentProject?: {
1246
+ id: string;
1247
+ name: string;
1248
+ } | null | undefined;
1249
+ pagination?: {
1250
+ page: number;
1251
+ pageSize: number;
1252
+ hasMore: boolean;
1253
+ } | undefined;
1079
1254
  navigationTarget?: {
1080
1255
  target: "workbench.view";
1081
1256
  viewKey: "live-dashboard__live-dashboard";
1082
- } | {
1083
- projectId: string;
1084
- target: "assistant.project";
1085
- viewKey: "live-dashboard__live-dashboard";
1257
+ } | undefined;
1258
+ selectedDashboard?: {
1259
+ artifactId: string;
1260
+ title?: string | null | undefined;
1261
+ versionId?: string | null | undefined;
1262
+ draftRevision?: number | undefined;
1263
+ versionNumber?: number | undefined;
1264
+ baseVersionId?: string | null | undefined;
1265
+ isDraft?: boolean | undefined;
1266
+ updatedAt?: string | undefined;
1267
+ canDelete?: boolean | undefined;
1086
1268
  } | undefined;
1087
1269
  versions?: {
1088
1270
  artifactId: string;
@@ -1098,10 +1280,6 @@ export declare const dashboardViewDataSchema: z.ZodObject<{
1098
1280
  }>;
1099
1281
  }, "strip", z.ZodTypeAny, {
1100
1282
  meta: {
1101
- sources: {
1102
- name: string;
1103
- source: import("@xpert-ai/contracts").AnalyticsSourceRef;
1104
- }[];
1105
1283
  dashboards: {
1106
1284
  artifactId: string;
1107
1285
  title?: string | null | undefined;
@@ -1113,6 +1291,11 @@ export declare const dashboardViewDataSchema: z.ZodObject<{
1113
1291
  updatedAt?: string | undefined;
1114
1292
  canDelete?: boolean | undefined;
1115
1293
  }[];
1294
+ sources: {
1295
+ name: string;
1296
+ source: import("@xpert-ai/contracts").AnalyticsSourceRef;
1297
+ }[];
1298
+ mode?: "draft" | "published" | undefined;
1116
1299
  saved?: {
1117
1300
  manifest: {
1118
1301
  schema: "xpert.live-dashboard";
@@ -1158,13 +1341,37 @@ export declare const dashboardViewDataSchema: z.ZodObject<{
1158
1341
  updatedAt?: string | undefined;
1159
1342
  canDelete?: boolean | undefined;
1160
1343
  } | undefined;
1344
+ access?: {
1345
+ project: boolean;
1346
+ archived: boolean;
1347
+ canReadDraft: boolean;
1348
+ canEdit: boolean;
1349
+ canManage: boolean;
1350
+ } | undefined;
1351
+ notice?: "not_published" | undefined;
1352
+ currentProject?: {
1353
+ id: string;
1354
+ name: string;
1355
+ } | null | undefined;
1356
+ pagination?: {
1357
+ page: number;
1358
+ pageSize: number;
1359
+ hasMore: boolean;
1360
+ } | undefined;
1161
1361
  navigationTarget?: {
1162
1362
  target: "workbench.view";
1163
1363
  viewKey: "live-dashboard__live-dashboard";
1164
- } | {
1165
- projectId: string;
1166
- target: "assistant.project";
1167
- viewKey: "live-dashboard__live-dashboard";
1364
+ } | undefined;
1365
+ selectedDashboard?: {
1366
+ artifactId: string;
1367
+ title?: string | null | undefined;
1368
+ versionId?: string | null | undefined;
1369
+ draftRevision?: number | undefined;
1370
+ versionNumber?: number | undefined;
1371
+ baseVersionId?: string | null | undefined;
1372
+ isDraft?: boolean | undefined;
1373
+ updatedAt?: string | undefined;
1374
+ canDelete?: boolean | undefined;
1168
1375
  } | undefined;
1169
1376
  versions?: {
1170
1377
  artifactId: string;
@@ -1180,10 +1387,6 @@ export declare const dashboardViewDataSchema: z.ZodObject<{
1180
1387
  };
1181
1388
  }, {
1182
1389
  meta: {
1183
- sources: {
1184
- name: string;
1185
- source: import("@xpert-ai/contracts").AnalyticsSourceRef;
1186
- }[];
1187
1390
  dashboards: {
1188
1391
  artifactId: string;
1189
1392
  title?: string | null | undefined;
@@ -1195,6 +1398,11 @@ export declare const dashboardViewDataSchema: z.ZodObject<{
1195
1398
  updatedAt?: string | undefined;
1196
1399
  canDelete?: boolean | undefined;
1197
1400
  }[];
1401
+ sources: {
1402
+ name: string;
1403
+ source: import("@xpert-ai/contracts").AnalyticsSourceRef;
1404
+ }[];
1405
+ mode?: "draft" | "published" | undefined;
1198
1406
  saved?: {
1199
1407
  manifest: {
1200
1408
  schema: "xpert.live-dashboard";
@@ -1253,13 +1461,37 @@ export declare const dashboardViewDataSchema: z.ZodObject<{
1253
1461
  updatedAt?: string | undefined;
1254
1462
  canDelete?: boolean | undefined;
1255
1463
  } | undefined;
1464
+ access?: {
1465
+ project: boolean;
1466
+ archived: boolean;
1467
+ canReadDraft: boolean;
1468
+ canEdit: boolean;
1469
+ canManage: boolean;
1470
+ } | undefined;
1471
+ notice?: "not_published" | undefined;
1472
+ currentProject?: {
1473
+ id: string;
1474
+ name: string;
1475
+ } | null | undefined;
1476
+ pagination?: {
1477
+ page: number;
1478
+ pageSize: number;
1479
+ hasMore: boolean;
1480
+ } | undefined;
1256
1481
  navigationTarget?: {
1257
1482
  target: "workbench.view";
1258
1483
  viewKey: "live-dashboard__live-dashboard";
1259
- } | {
1260
- projectId: string;
1261
- target: "assistant.project";
1262
- viewKey: "live-dashboard__live-dashboard";
1484
+ } | undefined;
1485
+ selectedDashboard?: {
1486
+ artifactId: string;
1487
+ title?: string | null | undefined;
1488
+ versionId?: string | null | undefined;
1489
+ draftRevision?: number | undefined;
1490
+ versionNumber?: number | undefined;
1491
+ baseVersionId?: string | null | undefined;
1492
+ isDraft?: boolean | undefined;
1493
+ updatedAt?: string | undefined;
1494
+ canDelete?: boolean | undefined;
1263
1495
  } | undefined;
1264
1496
  versions?: {
1265
1497
  artifactId: string;