@chengxianglibra/dsh-data-analysis 0.1.2 → 0.2.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 (222) hide show
  1. package/README.en.md +135 -0
  2. package/README.md +105 -98
  3. package/cordis.patch.yml +1 -1
  4. package/lib/bin/environment.js +8 -6
  5. package/lib/client/credentials/changes.js +74 -0
  6. package/lib/client/credentials/create-datasource.js +126 -22
  7. package/lib/client/credentials/credential-draft.js +42 -0
  8. package/lib/client/credentials/defaults.js +11 -0
  9. package/lib/client/credentials/descriptions.js +46 -0
  10. package/lib/client/credentials/install.js +209 -81
  11. package/lib/client/credentials/model.js +323 -51
  12. package/lib/client/credentials/report-publishing.js +96 -0
  13. package/lib/client/credentials/styles.js +13 -9
  14. package/lib/client/i18n/context.js +22 -0
  15. package/lib/client/i18n/copy.js +60 -0
  16. package/lib/client/i18n/credentials.js +475 -0
  17. package/lib/client/i18n/host.js +28 -0
  18. package/lib/client/i18n/navigation.js +41 -0
  19. package/lib/client/i18n/presentation.js +577 -0
  20. package/lib/client/i18n/python.js +36 -0
  21. package/lib/client/i18n/semantic.js +441 -0
  22. package/lib/client/i18n/settings.js +30 -0
  23. package/lib/client/input-context.js +21 -0
  24. package/lib/client/python-tool/card.js +35 -0
  25. package/lib/client/python-tool/execution-error.js +35 -0
  26. package/lib/client/python-tool/install.js +9 -0
  27. package/lib/client/python-tool/model.js +101 -0
  28. package/lib/client/right-tabs/install.js +535 -0
  29. package/lib/client/right-tabs/live-delivery.js +58 -0
  30. package/lib/client/right-tabs/navigation.js +47 -0
  31. package/lib/client/right-tabs/page.js +178 -0
  32. package/lib/client/right-tabs/styles.js +11 -0
  33. package/lib/client/rpc.js +5 -0
  34. package/lib/client/semantic-reference.js +10 -0
  35. package/lib/client/settings/card.js +90 -0
  36. package/lib/client/settings/install.js +10 -0
  37. package/lib/client/workspace-header-action.js +14 -1
  38. package/lib/client/workspace-shortcuts.js +26 -0
  39. package/lib/client.js +388 -242
  40. package/lib/compatibility.js +1 -1
  41. package/lib/datasource/authoring.js +43 -4
  42. package/lib/datasource/bridge-programs.js +23 -20
  43. package/lib/datasource/bridge.js +46 -3
  44. package/lib/datasource/changes-contract.js +41 -0
  45. package/lib/datasource/changes.js +49 -0
  46. package/lib/datasource/configure.js +39 -0
  47. package/lib/datasource/defaults.js +25 -0
  48. package/lib/datasource/index.js +2 -1
  49. package/lib/datasource/python-options.js +15 -0
  50. package/lib/datasource/python.js +119 -25
  51. package/lib/datasource/rpc.js +75 -13
  52. package/lib/datasource/service.js +286 -11
  53. package/lib/datasource/test.js +3 -2
  54. package/lib/disclosure/activation.js +19 -7
  55. package/lib/disclosure/execution-guidance.js +49 -0
  56. package/lib/disclosure/help.js +4 -1
  57. package/lib/environment/runtime.js +35 -34
  58. package/lib/environment/workspace.js +18 -1
  59. package/lib/lifecycle.js +33 -0
  60. package/lib/plugin-agents.js +154 -0
  61. package/lib/plugin.js +98 -172
  62. package/lib/presentation/asset.js +34 -0
  63. package/lib/presentation/assets/portable.js +14 -14
  64. package/lib/presentation/assets/static.js +344 -73
  65. package/lib/presentation/build/index.js +3 -2
  66. package/lib/presentation/commit.js +19 -12
  67. package/lib/presentation/contracts/asset-path.js +9 -0
  68. package/lib/presentation/contracts/catalog.js +62 -0
  69. package/lib/presentation/contracts/charts.js +0 -23
  70. package/lib/presentation/contracts/index.js +17 -5
  71. package/lib/presentation/contracts/types.js +1 -1
  72. package/lib/presentation/delivery.js +45 -30
  73. package/lib/presentation/export-html.js +214 -0
  74. package/lib/presentation/files.js +4 -5
  75. package/lib/presentation/projection/index.js +2 -1
  76. package/lib/presentation/projection/program.js +2 -9
  77. package/lib/presentation/projection/sql-code.js +13 -13
  78. package/lib/presentation/reports.js +114 -17
  79. package/lib/presentation/rpc.js +96 -58
  80. package/lib/presentation/tool.js +6 -10
  81. package/lib/report-publishing/adapters.js +111 -0
  82. package/lib/report-publishing/config.js +69 -0
  83. package/lib/report-publishing/service.js +180 -0
  84. package/lib/rpc.js +49 -0
  85. package/lib/semantic-browser/contracts.js +17 -0
  86. package/lib/semantic-browser/program.js +10 -0
  87. package/lib/semantic-browser/service.js +40 -6
  88. package/lib/semantic-reference/bridge.js +10 -1
  89. package/lib/semantic-reference/contracts.js +20 -6
  90. package/lib/semantic-reference/environment.js +56 -0
  91. package/lib/semantic-reference/labels.js +16 -0
  92. package/lib/semantic-reference/rpc.js +39 -18
  93. package/lib/semantic-reference/search.js +5 -4
  94. package/lib/semantic-reference/usage.js +12 -3
  95. package/lib/settings.js +21 -0
  96. package/lib/tool-lifecycle.js +22 -0
  97. package/lib/types/client/credentials/changes.d.ts +9 -0
  98. package/lib/types/client/credentials/create-datasource.d.ts +3 -1
  99. package/lib/types/client/credentials/credential-draft.d.ts +14 -0
  100. package/lib/types/client/credentials/defaults.d.ts +2 -0
  101. package/lib/types/client/credentials/descriptions.d.ts +1 -0
  102. package/lib/types/client/credentials/install.d.ts +19 -1
  103. package/lib/types/client/credentials/model.d.ts +31 -11
  104. package/lib/types/client/credentials/report-publishing.d.ts +5 -0
  105. package/lib/types/client/credentials/styles.d.ts +1 -1
  106. package/lib/types/client/i18n/context.d.ts +17 -0
  107. package/lib/types/client/i18n/copy.d.ts +821 -0
  108. package/lib/types/client/i18n/credentials.d.ts +475 -0
  109. package/lib/types/client/i18n/host.d.ts +17 -0
  110. package/lib/types/client/i18n/navigation.d.ts +41 -0
  111. package/lib/types/client/i18n/presentation.d.ts +577 -0
  112. package/lib/types/client/i18n/python.d.ts +19 -0
  113. package/lib/types/client/i18n/semantic.d.ts +441 -0
  114. package/lib/types/client/i18n/settings.d.ts +16 -0
  115. package/lib/types/client/input-context.d.ts +19 -0
  116. package/lib/types/client/presentation/ask-dsh.d.ts +4 -8
  117. package/lib/types/client/presentation/catalog-model.d.ts +24 -0
  118. package/lib/types/client/presentation/catalog.d.ts +20 -0
  119. package/lib/types/client/presentation/chart-tooltip.d.ts +2 -2
  120. package/lib/types/client/presentation/context-reference.d.ts +12 -0
  121. package/lib/types/client/presentation/copy-context.d.ts +2 -2
  122. package/lib/types/client/presentation/delivery-model.d.ts +27 -6
  123. package/lib/types/client/presentation/delivery.d.ts +8 -7
  124. package/lib/types/client/presentation/download.d.ts +2 -0
  125. package/lib/types/client/presentation/export-menu.d.ts +26 -0
  126. package/lib/types/client/presentation/export-view.d.ts +63 -0
  127. package/lib/types/client/presentation/host-entry.d.ts +8 -2
  128. package/lib/types/client/presentation/icons.d.ts +1 -1
  129. package/lib/types/client/presentation/model.d.ts +14 -15
  130. package/lib/types/client/presentation/reader.d.ts +15 -2
  131. package/lib/types/client/presentation/reference-source.d.ts +9 -0
  132. package/lib/types/client/presentation/source-code-model.d.ts +2 -1
  133. package/lib/types/client/presentation/source-code.d.ts +0 -5
  134. package/lib/types/client/presentation/source-dialog.d.ts +1 -2
  135. package/lib/types/client/presentation/sources.d.ts +5 -5
  136. package/lib/types/client/presentation/styles.d.ts +1 -1
  137. package/lib/types/client/presentation/table.d.ts +5 -1
  138. package/lib/types/client/python-tool/card.d.ts +2 -0
  139. package/lib/types/client/python-tool/execution-error.d.ts +3 -0
  140. package/lib/types/client/python-tool/install.d.ts +2 -0
  141. package/lib/types/client/python-tool/model.d.ts +20 -0
  142. package/lib/types/client/right-tabs/install.d.ts +18 -0
  143. package/lib/types/client/right-tabs/live-delivery.d.ts +8 -0
  144. package/lib/types/client/right-tabs/navigation.d.ts +17 -0
  145. package/lib/types/client/right-tabs/page.d.ts +36 -0
  146. package/lib/types/client/right-tabs/styles.d.ts +2 -0
  147. package/lib/types/client/rpc.d.ts +3 -0
  148. package/lib/types/client/semantic-reference.d.ts +4 -0
  149. package/lib/types/client/settings/card.d.ts +9 -0
  150. package/lib/types/client/settings/install.d.ts +2 -0
  151. package/lib/types/client/workspace-header-action.d.ts +1 -1
  152. package/lib/types/client/workspace-shortcuts.d.ts +15 -0
  153. package/lib/types/client.d.ts +5 -2
  154. package/lib/types/compatibility.d.ts +1 -1
  155. package/lib/types/datasource/authoring.d.ts +10 -0
  156. package/lib/types/datasource/bridge.d.ts +23 -2
  157. package/lib/types/datasource/changes-contract.d.ts +18 -0
  158. package/lib/types/datasource/changes.d.ts +15 -0
  159. package/lib/types/datasource/configure.d.ts +7 -0
  160. package/lib/types/datasource/defaults.d.ts +7 -0
  161. package/lib/types/datasource/index.d.ts +6 -1
  162. package/lib/types/datasource/python-options.d.ts +8 -0
  163. package/lib/types/datasource/python.d.ts +17 -2
  164. package/lib/types/datasource/rpc.d.ts +2 -1
  165. package/lib/types/datasource/service.d.ts +48 -5
  166. package/lib/types/datasource/test.d.ts +1 -1
  167. package/lib/types/disclosure/activation.d.ts +2 -1
  168. package/lib/types/disclosure/execution-guidance.d.ts +6 -0
  169. package/lib/types/disclosure/help.d.ts +1 -1
  170. package/lib/types/environment/types.d.ts +2 -1
  171. package/lib/types/environment/workspace.d.ts +1 -0
  172. package/lib/types/lifecycle.d.ts +8 -0
  173. package/lib/types/plugin-agents.d.ts +29 -0
  174. package/lib/types/plugin.d.ts +12 -28
  175. package/lib/types/presentation/asset.d.ts +6 -0
  176. package/lib/types/presentation/build/index.d.ts +7 -2
  177. package/lib/types/presentation/commit.d.ts +1 -1
  178. package/lib/types/presentation/contracts/asset-path.d.ts +2 -0
  179. package/lib/types/presentation/contracts/catalog.d.ts +27 -0
  180. package/lib/types/presentation/contracts/charts.d.ts +0 -2
  181. package/lib/types/presentation/contracts/types.d.ts +7 -4
  182. package/lib/types/presentation/delivery.d.ts +1 -1
  183. package/lib/types/presentation/export-html.d.ts +13 -0
  184. package/lib/types/presentation/reports.d.ts +6 -1
  185. package/lib/types/presentation/rpc.d.ts +3 -2
  186. package/lib/types/presentation/tool.d.ts +2 -2
  187. package/lib/types/report-publishing/adapters.d.ts +6 -0
  188. package/lib/types/report-publishing/config.d.ts +22 -0
  189. package/lib/types/report-publishing/service.d.ts +68 -0
  190. package/lib/types/rpc.d.ts +3 -0
  191. package/lib/types/semantic-browser/contracts.d.ts +7 -0
  192. package/lib/types/semantic-browser/service.d.ts +7 -1
  193. package/lib/types/semantic-reference/bridge.d.ts +1 -0
  194. package/lib/types/semantic-reference/contracts.d.ts +5 -2
  195. package/lib/types/semantic-reference/environment.d.ts +22 -0
  196. package/lib/types/semantic-reference/labels.d.ts +16 -0
  197. package/lib/types/semantic-reference/rpc.d.ts +1 -1
  198. package/lib/types/semantic-reference/search.d.ts +1 -1
  199. package/lib/types/settings.d.ts +14 -0
  200. package/lib/types/tool-lifecycle.d.ts +4 -0
  201. package/lib/types/workspace-identity.d.ts +6 -0
  202. package/lib/workspace-identity.js +9 -0
  203. package/package.json +93 -61
  204. package/python/presentation-kit/dist/dsh_data_analysis_presentation_kit-1.1.0-py3-none-any.whl +0 -0
  205. package/skills/dsh-data-analysis-files/SKILL.md +44 -0
  206. package/skills/dsh-data-analysis-files/references/delivery.md +15 -0
  207. package/skills/dsh-data-analysis-files/references/examples.md +93 -0
  208. package/skills/dsh-data-analysis-presentation/SKILL.md +15 -15
  209. package/skills/dsh-data-analysis-presentation/references/examples/artifact.draft.json +13 -4
  210. package/skills/dsh-data-analysis-presentation/references/examples/charts.draft.json +3 -2
  211. package/skills/dsh-data-analysis-presentation/references/examples/comparison.draft.json +3 -2
  212. package/skills/dsh-data-analysis-presentation/references/examples/computed-sources.draft.json +12 -5
  213. package/skills/dsh-data-analysis-presentation/references/examples/computed.draft.json +3 -2
  214. package/skills/dsh-data-analysis-presentation/references/examples/interaction.draft.json +3 -2
  215. package/skills/dsh-data-analysis-presentation/references/examples/source-only.draft.json +12 -4
  216. package/skills/dsh-data-analysis-presentation/references/examples.md +3 -1
  217. package/skills/dsh-data-analysis-presentation/references/export-html.md +7 -0
  218. package/skills/dsh-data-analysis-presentation/references/interaction.md +1 -1
  219. package/skills/dsh-data-analysis-presentation/references/narrative.md +1 -1
  220. package/skills/dsh-data-analysis-presentation/references/publishing.md +3 -0
  221. package/skills/dsh-data-analysis-presentation/references/schema.md +29 -2
  222. package/lib/types/client/presentation/install.d.ts +0 -15
@@ -0,0 +1,27 @@
1
+ import { type PresentationReceipt } from './index.ts';
2
+ export interface PublicationSource {
3
+ kind: 'agent' | 'reader';
4
+ sessionId: string | null;
5
+ }
6
+ export interface ReportVersion {
7
+ receipt: PresentationReceipt;
8
+ publishedAt: string | null;
9
+ source: PublicationSource | null;
10
+ }
11
+ export interface ReportHistory {
12
+ workspaceId: string;
13
+ reportId: string;
14
+ currentBuildId: string;
15
+ legacyHistoryUnavailable: boolean;
16
+ versions: ReportVersion[];
17
+ }
18
+ export interface ReportCatalog {
19
+ workspaceId: string;
20
+ reports: ReportVersion[];
21
+ unavailable: number;
22
+ }
23
+ export declare const REPORT_HISTORY_BYTES: number;
24
+ export declare const REPORT_HISTORY_LIMIT = 4096;
25
+ export declare function parseReportVersion(value: unknown): ReportVersion;
26
+ export declare function parseReportHistory(value: unknown): ReportHistory;
27
+ export declare function parseReportCatalog(value: unknown): ReportCatalog;
@@ -1,12 +1,10 @@
1
1
  import { type ChartType, type ChartView, type TypedDataset } from './types.ts';
2
2
  export type { ChartBindings, ChartOptions, ChartType, ChartView } from './types.ts';
3
3
  export declare const CHART_TYPES: readonly ["line", "area", "stackedArea", "sparkline", "bar", "horizontalBar", "stackedBar", "stackedBar100", "horizontalStackedBar", "horizontalStackedBar100", "histogram", "boxPlot", "scatter", "heatmap", "pie", "leaderboard", "funnel", "waterfall"];
4
- export declare const CHART_LABELS: Record<ChartType, string>;
5
4
  /** Strictly validates one binding. A containing block handles id/kind/preparedViews. */
6
5
  export declare function parseChartViewShape(value: unknown, path?: string): asserts value is ChartView;
7
6
  /** Exact source columns, including every auxiliary field used by geometry or tooltip. */
8
7
  export declare function chartColumns(view: ChartView): string[];
9
- export declare function chartSeriesFields(view: ChartView): string[];
10
8
  /** Verifies supplied values only: never bins, ranks, accumulates, normalizes or sorts. */
11
9
  export declare function validateChartView(view: ChartView, dataset: TypedDataset, path?: string, dataPath?: string, rowIndices?: readonly number[]): void;
12
10
  /** Changes geometry only. Statistical views must be declared with prepared bindings. */
@@ -1,7 +1,7 @@
1
1
  /** Pure presentation data. No Marivo schema, Node runtime or Host imports. */
2
2
  import type { PythonCodeRef, PythonCodeSnippet } from '../../python-execution-contracts.ts';
3
3
  export type { PythonCodeRef, PythonCodeSnippet } from '../../python-execution-contracts.ts';
4
- export declare const PRESENTATION_SCHEMA_VERSION: 2;
4
+ export declare const PRESENTATION_SCHEMA_VERSION: 3;
5
5
  export declare const PRESENTATION_BUDGETS: {
6
6
  readonly documentBytes: number;
7
7
  readonly draftBytes: number;
@@ -203,8 +203,10 @@ export interface PresentationInteraction {
203
203
  filters: PresentationFilter[];
204
204
  slices: PresentationSlice[];
205
205
  }
206
+ export type PresentationLocale = 'zh-CN' | 'en-US';
206
207
  export interface PresentationDraft {
207
- schemaVersion: 1;
208
+ schemaVersion: 2;
209
+ locale: PresentationLocale;
208
210
  title: string;
209
211
  datasets: DraftDataset[];
210
212
  sources: DeclaredSource[];
@@ -217,7 +219,8 @@ export interface PresentationDiagnostic {
217
219
  message: string;
218
220
  }
219
221
  export interface PresentationDocument {
220
- schemaVersion: 2;
222
+ schemaVersion: 3;
223
+ locale: PresentationLocale;
221
224
  reportId: string;
222
225
  workspaceId: string;
223
226
  buildId: string;
@@ -247,6 +250,6 @@ export interface PresentationReceipt {
247
250
  summary: string;
248
251
  files: {
249
252
  document: PresentationFile<'presentation.json'>;
250
- html: PresentationFile<'index.html'>;
253
+ html?: PresentationFile<'index.html'>;
251
254
  };
252
255
  }
@@ -1,3 +1,3 @@
1
1
  import type { Context } from '@deepseek-ai/cordis';
2
2
  /** Persist the same envelope on nested Code dispatch even when code discards the return value. */
3
- export declare function installMarivoPresentationCodeDelivery(ctx: Context): () => void;
3
+ export declare function installMarivoPresentationCodeDelivery(ctx: Context): () => Promise<void>;
@@ -0,0 +1,13 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { Session } from '@deepseek-ai/dsh-session';
3
+ export declare const MARIVO_EXPORT_HTML_TOOL_NAME = "marivo_export_html";
4
+ export type ExportWorkspaceSource = () => {
5
+ id: string;
6
+ path: string;
7
+ } | Promise<{
8
+ id: string;
9
+ path: string;
10
+ }>;
11
+ export declare function parseHtmlOutputPath(value: unknown): string;
12
+ export declare function createMarivoExportHtmlTool(source: ExportWorkspaceSource, session: Session): import("@deepseek-ai/dsh-tools").ToolDefinition;
13
+ export declare function registerMarivoExportHtmlTool(ctx: Context, source: ExportWorkspaceSource, session: Session): () => Promise<void>;
@@ -1,5 +1,10 @@
1
+ import { type PublicationSource, type ReportCatalog, type ReportHistory } from './contracts/catalog.ts';
1
2
  import { type PresentationDocument, type PresentationReceipt } from './contracts/index.ts';
2
3
  export declare function readReceiptDocument(root: string, receipt: PresentationReceipt, signal?: AbortSignal): Promise<PresentationDocument>;
4
+ /** Current and its publication history become visible through one atomic rename. */
5
+ export declare function readReportHistory(root: string, workspaceId: string, reportId: string, signal?: AbortSignal): Promise<ReportHistory>;
3
6
  export declare function resolvePresentation(root: string, workspaceId: string, reportId: string, signal?: AbortSignal): Promise<PresentationReceipt>;
7
+ /** Enumerate only publication pointers, never completed-but-unpublished build directories. */
8
+ export declare function listReports(root: string, workspaceId: string, signal?: AbortSignal): Promise<ReportCatalog>;
4
9
  /** The mutable pointer is the publication boundary; completed builds are never overwritten. */
5
- export declare function publishPresentation(root: string, document: PresentationDocument, expectedBuildId: string | null, assertOwner: () => Promise<void>, signal?: AbortSignal): Promise<PresentationReceipt>;
10
+ export declare function publishPresentation(root: string, document: PresentationDocument, expectedBuildId: string | null, assertOwner: () => Promise<void>, signal?: AbortSignal, source?: PublicationSource | null): Promise<PresentationReceipt>;
@@ -7,8 +7,9 @@ export interface PresentationWorkspace {
7
7
  export type PresentationWorkspaceResolver = (sessionId: string) => PresentationWorkspace | undefined | Promise<PresentationWorkspace | undefined>;
8
8
  export declare class MarivoPresentationFileService {
9
9
  #private;
10
- constructor(resolve: PresentationWorkspaceResolver);
11
- close(): void;
10
+ constructor(resolve: PresentationWorkspaceResolver, resolveId?: PresentationWorkspaceResolver);
11
+ catalog(endpoint: 'reports/list' | 'reports/history', payload: unknown, caller?: AbortSignal): Promise<import("./contracts/catalog.ts").ReportHistory | import("./contracts/catalog.ts").ReportCatalog>;
12
+ close(): Promise<void>;
12
13
  report(endpoint: 'reports/resolve' | 'reports/save', payload: unknown, caller?: AbortSignal): Promise<import("./contracts/types.ts").PresentationReceipt>;
13
14
  read(payload: unknown, caller?: AbortSignal): Promise<{
14
15
  workspaceId: string;
@@ -7,6 +7,6 @@ export interface PresentationBinding {
7
7
  projection: MarivoPresentationProjection;
8
8
  }
9
9
  export type PresentationBindingSource = () => PresentationBinding | Promise<PresentationBinding>;
10
- /** One call projects a draft, builds both assets, commits them, then emits the receipt. */
10
+ /** One call projects a draft, builds the document, commits them, then emits the receipt. */
11
11
  export declare function createMarivoPresentTool(source: PresentationBindingSource, session: Session, lifecycleSignal?: AbortSignal): ToolDefinition;
12
- export declare function registerMarivoPresentTool(ctx: Context, source: PresentationBindingSource, session: Session): () => void;
12
+ export declare function registerMarivoPresentTool(ctx: Context, source: PresentationBindingSource, session: Session): () => Promise<void>;
@@ -0,0 +1,6 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { HostConnectionHandle } from '@deepseek-ai/dsh-client-connection';
3
+ import type { ReportPublishingService } from './service.ts';
4
+ export declare const PUBLISHING_CHANNEL = "/dsh-report-publishing";
5
+ export declare function registerPublishingCredentials(connection: HostConnectionHandle, service: ReportPublishingService, workspaceExists: (id: string) => boolean): () => Promise<void>;
6
+ export declare function registerReportPublishTool(ctx: Context, service: ReportPublishingService, sessionId: string): () => Promise<void>;
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ export declare const publishingConfigSchema: z.ZodObject<{
3
+ enabled: z.ZodDefault<z.ZodBoolean>;
4
+ storage: z.ZodObject<{
5
+ name: z.ZodString;
6
+ protocol: z.ZodDefault<z.ZodLiteral<"s3">>;
7
+ endpoint: z.ZodString;
8
+ region: z.ZodString;
9
+ bucket: z.ZodString;
10
+ forcePathStyle: z.ZodDefault<z.ZodBoolean>;
11
+ accessKeyIdRef: z.ZodString;
12
+ secretAccessKeyRef: z.ZodString;
13
+ sessionTokenRef: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strict>;
15
+ pathPrefix: z.ZodDefault<z.ZodString>;
16
+ publicBaseUrl: z.ZodString;
17
+ }, z.core.$strict>;
18
+ export type ReportPublishingConfig = z.input<typeof publishingConfigSchema> | {
19
+ enabled?: false;
20
+ };
21
+ export type EnabledPublishingConfig = z.output<typeof publishingConfigSchema>;
22
+ export declare function resolvePublishingConfig(value?: ReportPublishingConfig): EnabledPublishingConfig | undefined;
@@ -0,0 +1,68 @@
1
+ import { type CredentialProvider } from '@deepseek-ai/dsh-credentials';
2
+ import type { MarivoPresentationFileService } from '../presentation/rpc.ts';
3
+ import type { EnabledPublishingConfig } from './config.ts';
4
+ export declare function publishingPathName(value: string, fallback: string): string;
5
+ export type PublishingField = 'accessKeyId' | 'secretAccessKey' | 'sessionToken';
6
+ export interface PublishingCredentialField {
7
+ field: PublishingField;
8
+ reference: string;
9
+ required: boolean;
10
+ configured: boolean;
11
+ writable: boolean;
12
+ source?: string;
13
+ }
14
+ export interface PublishingCredentialView {
15
+ enabled: boolean;
16
+ configId?: string;
17
+ name?: string;
18
+ bucket?: string;
19
+ fields: PublishingCredentialField[];
20
+ }
21
+ type Store = Pick<CredentialProvider, 'describe' | 'set' | 'unset' | 'resolve'>;
22
+ export interface UploadInput {
23
+ config: EnabledPublishingConfig;
24
+ credentials: {
25
+ accessKeyId: string;
26
+ secretAccessKey: string;
27
+ sessionToken?: string;
28
+ };
29
+ key: string;
30
+ bytes: Buffer;
31
+ signal: AbortSignal;
32
+ }
33
+ export declare function uploadReport(input: UploadInput): Promise<void>;
34
+ export declare class ReportPublishingService {
35
+ readonly configId: `${string}-${string}-${string}-${string}-${string}`;
36
+ readonly config: EnabledPublishingConfig | undefined;
37
+ readonly store: Store;
38
+ readonly files: Pick<MarivoPresentationFileService, 'catalog' | 'read'>;
39
+ readonly upload: (input: UploadInput) => Promise<void>;
40
+ readonly workspaceName: (id: string) => string;
41
+ constructor(config: EnabledPublishingConfig | undefined, store: Store, files: Pick<MarivoPresentationFileService, 'catalog' | 'read'>, upload?: (input: UploadInput) => Promise<void>, workspaceName?: (id: string) => string);
42
+ assertConfig(configId: string): void;
43
+ references(): Array<{
44
+ field: PublishingField;
45
+ reference: string;
46
+ required: boolean;
47
+ }>;
48
+ describe(): Promise<PublishingCredentialView>;
49
+ change(field: PublishingField, value: string | undefined, signal: AbortSignal): Promise<void>;
50
+ publish(scope: {
51
+ sessionId: string;
52
+ } | {
53
+ workspaceId: string;
54
+ }, reportId: string, buildId: string, signal: AbortSignal, viewHtml?: string): Promise<{
55
+ storage: string;
56
+ bucket: string;
57
+ key: string;
58
+ url: string;
59
+ workspaceId: string;
60
+ reportId: string;
61
+ buildId: string;
62
+ sha256: string;
63
+ bytes: number;
64
+ kind: string;
65
+ publishedAt: string;
66
+ }>;
67
+ }
68
+ export {};
@@ -0,0 +1,3 @@
1
+ /** Dedicated plugin RPC envelopes over Harness-owned authenticated exact Fetch routes. */
2
+ import { type ConnectionRpcHandler, type HostConnectionHandle } from '@deepseek-ai/dsh-client-connection';
3
+ export declare function registerPluginRpc(connection: Pick<HostConnectionHandle, 'fetch'>, channel: string, endpoints: readonly string[], handler: ConnectionRpcHandler): () => Promise<void>;
@@ -2,6 +2,7 @@ import { type SemanticRef } from '../semantic-reference/contracts.ts';
2
2
  import { type ComputationDefinition } from './definition.ts';
3
3
  export declare const BROWSER_ENDPOINT = "semantic-browser/catalog";
4
4
  export declare const CATALOG_MAX_BYTES: number;
5
+ export declare const CATALOG_ERROR_SCHEMA = "marivo.semantic_catalog_error/v1";
5
6
  export interface DisplayField {
6
7
  readonly name: string;
7
8
  readonly value: string;
@@ -30,6 +31,11 @@ export interface CatalogProjection {
30
31
  readonly kinds: readonly string[];
31
32
  readonly objects: readonly SemanticObjectView[];
32
33
  }
34
+ export interface CatalogFailure {
35
+ readonly schema: typeof CATALOG_ERROR_SCHEMA;
36
+ readonly kind: 'semantic';
37
+ readonly message: string;
38
+ }
33
39
  export interface CatalogSnapshot extends CatalogProjection {
34
40
  readonly workspaceId: string;
35
41
  readonly projectRoot: string;
@@ -37,4 +43,5 @@ export interface CatalogSnapshot extends CatalogProjection {
37
43
  readonly loadedAt: string;
38
44
  }
39
45
  export declare function parseCatalogProjection(value: unknown): CatalogProjection;
46
+ export declare function parseCatalogFailure(value: unknown): CatalogFailure | undefined;
40
47
  export declare function parseCatalogSnapshot(value: unknown): CatalogSnapshot;
@@ -9,12 +9,18 @@ export interface BrowserHost {
9
9
  projectRoot(workspace: BrowserWorkspace): string;
10
10
  resolve(root: string): Promise<MarivoCheckedRunner>;
11
11
  }
12
+ export declare class SemanticCatalogLoadError extends Error {
13
+ readonly code = "catalog-load-failed";
14
+ readonly diagnostic: string;
15
+ constructor(diagnostic: string);
16
+ }
12
17
  /** Workspace-addressed read service; intentionally has no Agent or credential dependency. */
13
18
  export declare class SemanticBrowserService {
14
19
  #private;
15
20
  constructor(host: BrowserHost);
16
21
  read(payload: unknown, caller: AbortSignal): Promise<CatalogSnapshot>;
22
+ close(): Promise<void>;
17
23
  dispose(): void;
18
24
  }
19
- /** Fixed diagnostics only: Python errors may contain model code or datasource secrets. */
25
+ /** Preserve Marivo semantic diagnostics; keep unknown Python failures behind a fixed fallback. */
20
26
  export declare function browserFailure(error: unknown): string;
@@ -6,6 +6,7 @@ export declare class SemanticReferenceBridge {
6
6
  #private;
7
7
  constructor(clock?: () => number);
8
8
  candidates(runner: MarivoCheckedRunner, signal: AbortSignal): Promise<Projection>;
9
+ close(): Promise<void>;
9
10
  invalidate(key: string): void;
10
11
  dispose(): void;
11
12
  }
@@ -1,7 +1,6 @@
1
1
  /** Browser-safe wire contracts. These bounds do not reimplement Marivo's domain grammar. */
2
2
  export declare const CHANNEL = "/dsh-data-analysis";
3
3
  export declare const SOURCE = "marivo-semantic";
4
- export declare const LIMIT = 40;
5
4
  export declare const MAX_WIRE_BYTES: number;
6
5
  export interface SemanticRef {
7
6
  readonly schema: 'marivo.semantic_ref/v1';
@@ -46,6 +45,10 @@ export declare function parseCandidatesRequest(value: unknown): {
46
45
  sessionId: string;
47
46
  query: string;
48
47
  quoted: boolean;
49
- limit: number;
50
48
  };
51
49
  export declare function parseCandidatesResponse(value: unknown): CandidatesResponse;
50
+ /** Browser selection identity only; preparation never reloads semantic content. */
51
+ export declare function parsePrepareRequest(value: unknown): {
52
+ workspaceId: string;
53
+ envelope: Envelope;
54
+ };
@@ -0,0 +1,22 @@
1
+ import type { MarivoCheckedRunner } from '../environment/types.ts';
2
+ import type { EnvironmentResolver } from './rpc.ts';
3
+ interface Workspace {
4
+ id: string;
5
+ path: string;
6
+ }
7
+ interface Binding {
8
+ root: string;
9
+ environment: Promise<MarivoCheckedRunner>;
10
+ }
11
+ export interface ReferenceEnvironmentHost<A extends object> {
12
+ agent(sessionId: string): A | undefined;
13
+ binding(agent: A): Binding | undefined;
14
+ projectRoot(agent: A): string;
15
+ resolve(agent: A): Promise<MarivoCheckedRunner>;
16
+ workspace(sessionId: string): Workspace;
17
+ }
18
+ /** Reference identity includes Harness ownership; the underlying Runtime stays unchanged. */
19
+ export declare function semanticEnvironmentFingerprint(workspaceId: string, runtimeFingerprint: string): string;
20
+ /** Explicit selection establishes ownership; serialization never repairs it. */
21
+ export declare function referenceEnvironmentResolver<A extends object>(host: ReferenceEnvironmentHost<A>): EnvironmentResolver;
22
+ export {};
@@ -0,0 +1,16 @@
1
+ /** Shared display labels and search aliases; object kinds still come from the live Catalog. */
2
+ export declare const semanticKindLabels: {
3
+ readonly domain: "业务域";
4
+ readonly datasource: "数据源";
5
+ readonly entity: "实体";
6
+ readonly dimension: "维度";
7
+ readonly measure: "度量";
8
+ readonly time_dimension: "时间维度";
9
+ readonly metric: "指标";
10
+ readonly relationship: "关系";
11
+ readonly event: "事件";
12
+ readonly state_model: "状态模型";
13
+ readonly period_calendar: "周期日历";
14
+ readonly temporal_set: "时间集合";
15
+ readonly work_schedule: "工作日程";
16
+ };
@@ -2,7 +2,7 @@ import type { ConnectionRpcHandler, HostConnectionHandle } from '@deepseek-ai/ds
2
2
  import type { MarivoCheckedRunner } from '../environment/types.ts';
3
3
  import { SemanticReferenceBridge } from './bridge.ts';
4
4
  import { type SemanticReferenceUsage } from './usage.ts';
5
- export type EnvironmentResolver = (sessionId: string, purpose: 'candidates' | 'reference') => Promise<MarivoCheckedRunner>;
5
+ export type EnvironmentResolver = (sessionId: string, purpose: 'candidates' | 'reference' | 'prepare', workspaceId?: string) => Promise<MarivoCheckedRunner>;
6
6
  /** Abort the caller's wait, without pretending to cancel the shared Environment resolver. */
7
7
  export declare function abortable<T>(promise: Promise<T>, signal: AbortSignal): Promise<T>;
8
8
  export declare class SemanticReferenceService {
@@ -1,4 +1,4 @@
1
- import { type Projection, type RankedCandidate } from './contracts.ts';
1
+ import type { Projection, RankedCandidate } from './contracts.ts';
2
2
  export interface UsageScore {
3
3
  readonly count: number;
4
4
  readonly last: number;
@@ -0,0 +1,14 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import z from '@deepseek-ai/schemastery';
3
+ import { type MarivoPythonOptions } from './datasource/python-options.ts';
4
+ export declare const PYTHON_SETTINGS_NAMESPACE = "dsh-data-analysis";
5
+ export declare const PythonSettings: z<Schemastery.ObjectS<{
6
+ pythonTimeoutMs: z<number, number>;
7
+ }>, Schemastery.ObjectT<{
8
+ pythonTimeoutMs: z<number, number>;
9
+ }>>;
10
+ /** Follow the Host settings provider; headless compositions retain their entry configuration. */
11
+ export declare function installPythonSettings(ctx: Context, options: MarivoPythonOptions): {
12
+ get: () => Required<MarivoPythonOptions>;
13
+ dispose: () => Promise<void>;
14
+ };
@@ -0,0 +1,4 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
3
+ /** A plugin tool owns its execution promises; withdrawing its schema is not a drain. */
4
+ export declare function registerMarivoTool(ctx: Context, tool: ToolDefinition): () => Promise<void>;
@@ -0,0 +1,6 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ /** Resolve only Harness-owned, header-validated Workspace membership; never infer it from a path. */
3
+ export declare function resolvePresentationWorkspace(ctx: Context, sessionId: string): {
4
+ id: string;
5
+ path: string;
6
+ };
@@ -0,0 +1,9 @@
1
+ /** Resolve only Harness-owned, header-validated Workspace membership; never infer it from a path. */
2
+ export function resolvePresentationWorkspace(ctx, sessionId) {
3
+ const matches = ctx.workspaceRegistry
4
+ .list()
5
+ .filter((workspace) => workspace.sessionIds.some((id) => String(id) === sessionId));
6
+ if (matches.length !== 1)
7
+ throw new Error('Presentation requires one current Session Workspace');
8
+ return { id: String(matches[0].id), path: matches[0].path };
9
+ }