@chengxianglibra/dsh-data-analysis 0.3.0 → 0.3.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 (53) hide show
  1. package/README.en.md +7 -2
  2. package/README.md +7 -2
  3. package/assets/logo-horizontal.svg +42 -0
  4. package/assets/logo-mark.svg +20 -0
  5. package/lib/bin/environment.js +99 -76
  6. package/lib/client/analysis-ui/offline-runtime.generated.js +1 -1
  7. package/lib/client/credentials/install.js +42 -38
  8. package/lib/client/credentials/model.js +9 -0
  9. package/lib/client/credentials/report-publishing.js +84 -0
  10. package/lib/client/credentials/styles.js +2 -0
  11. package/lib/client/i18n/credentials.js +18 -0
  12. package/lib/client/i18n/presentation.js +24 -0
  13. package/lib/client/right-tabs/install.js +9 -1
  14. package/lib/client/right-tabs/report-actions.js +30 -4
  15. package/lib/client/right-tabs/report-publishing.js +107 -0
  16. package/lib/client/right-tabs/styles.js +3 -0
  17. package/lib/client/ui/styles.generated.js +3 -0
  18. package/lib/client-composition.js +202 -191
  19. package/lib/client.js +205 -194
  20. package/lib/datasource/resolver-program.js +4 -4
  21. package/lib/environment/binding.js +16 -23
  22. package/lib/environment/doctor.js +8 -1
  23. package/lib/environment/identity.js +32 -0
  24. package/lib/environment/project-preparation.js +5 -5
  25. package/lib/environment/runtime.js +15 -16
  26. package/lib/plugin-agents.js +6 -1
  27. package/lib/plugin.js +18 -0
  28. package/lib/presentation/rpc.js +19 -0
  29. package/lib/report-publishing/adapters.js +136 -0
  30. package/lib/report-publishing/config.js +58 -0
  31. package/lib/report-publishing/credential-contract.js +25 -0
  32. package/lib/report-publishing/service.js +133 -0
  33. package/lib/skill-build.generated.js +2 -2
  34. package/lib/types/client/credentials/install.d.ts +2 -1
  35. package/lib/types/client/credentials/model.d.ts +30 -0
  36. package/lib/types/client/credentials/report-publishing.d.ts +5 -0
  37. package/lib/types/client/credentials/styles.d.ts +1 -1
  38. package/lib/types/client/i18n/copy.d.ts +21 -0
  39. package/lib/types/client/i18n/credentials.d.ts +18 -0
  40. package/lib/types/client/i18n/presentation.d.ts +24 -0
  41. package/lib/types/client/right-tabs/report-actions.d.ts +5 -1
  42. package/lib/types/client/right-tabs/report-publishing.d.ts +21 -0
  43. package/lib/types/client/right-tabs/styles.d.ts +1 -1
  44. package/lib/types/environment/identity.d.ts +6 -0
  45. package/lib/types/plugin-agents.d.ts +2 -0
  46. package/lib/types/plugin.d.ts +4 -0
  47. package/lib/types/presentation/rpc.d.ts +1358 -0
  48. package/lib/types/report-publishing/adapters.d.ts +6 -0
  49. package/lib/types/report-publishing/config.d.ts +23 -0
  50. package/lib/types/report-publishing/credential-contract.d.ts +61 -0
  51. package/lib/types/report-publishing/service.d.ts +31 -0
  52. package/package.json +4 -1
  53. package/skills/dsh-data-analysis-files/references/delivery.md +3 -1
@@ -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 { Session } from '@deepseek-ai/dsh-session';
4
+ import type { ReportPublishingService } from './service.ts';
5
+ export declare function registerPublishingRpc(connection: HostConnectionHandle, service: ReportPublishingService | undefined, workspaceExists: (id: string) => boolean): () => Promise<void>;
6
+ export declare function registerReportPublishTool(ctx: Context, service: ReportPublishingService, session: Session): () => Promise<void>;
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ declare const enabledPublishing: z.ZodObject<{
3
+ enabled: z.ZodLiteral<true>;
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 enabledPublishing> | {
19
+ enabled?: false;
20
+ };
21
+ export type EnabledPublishingConfig = z.output<typeof enabledPublishing>;
22
+ export declare function resolvePublishingConfig(value: unknown): EnabledPublishingConfig | undefined;
23
+ export {};
@@ -0,0 +1,61 @@
1
+ import { z } from 'zod';
2
+ export declare const REPORT_PUBLISHING_CHANNEL = "/dsh-report-publishing";
3
+ export declare const publishingFields: readonly ["accessKeyId", "secretAccessKey", "sessionToken"];
4
+ export declare const publishingFieldSchema: z.ZodEnum<{
5
+ accessKeyId: "accessKeyId";
6
+ secretAccessKey: "secretAccessKey";
7
+ sessionToken: "sessionToken";
8
+ }>;
9
+ export type PublishingField = z.infer<typeof publishingFieldSchema>;
10
+ declare const publishingCredentialViewSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
11
+ enabled: z.ZodLiteral<false>;
12
+ fields: z.ZodTuple<[], null>;
13
+ }, z.core.$strict>, z.ZodObject<{
14
+ enabled: z.ZodLiteral<true>;
15
+ configId: z.ZodString;
16
+ name: z.ZodString;
17
+ bucket: z.ZodString;
18
+ fields: z.ZodArray<z.ZodObject<{
19
+ field: z.ZodEnum<{
20
+ accessKeyId: "accessKeyId";
21
+ secretAccessKey: "secretAccessKey";
22
+ sessionToken: "sessionToken";
23
+ }>;
24
+ reference: z.ZodString;
25
+ required: z.ZodBoolean;
26
+ configured: z.ZodBoolean;
27
+ writable: z.ZodBoolean;
28
+ source: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strict>>;
30
+ }, z.core.$strict>], "enabled">;
31
+ export type PublishingCredentialView = z.infer<typeof publishingCredentialViewSchema>;
32
+ export declare const publishingCredentialResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
33
+ ok: z.ZodLiteral<true>;
34
+ value: z.ZodDiscriminatedUnion<[z.ZodObject<{
35
+ enabled: z.ZodLiteral<false>;
36
+ fields: z.ZodTuple<[], null>;
37
+ }, z.core.$strict>, z.ZodObject<{
38
+ enabled: z.ZodLiteral<true>;
39
+ configId: z.ZodString;
40
+ name: z.ZodString;
41
+ bucket: z.ZodString;
42
+ fields: z.ZodArray<z.ZodObject<{
43
+ field: z.ZodEnum<{
44
+ accessKeyId: "accessKeyId";
45
+ secretAccessKey: "secretAccessKey";
46
+ sessionToken: "sessionToken";
47
+ }>;
48
+ reference: z.ZodString;
49
+ required: z.ZodBoolean;
50
+ configured: z.ZodBoolean;
51
+ writable: z.ZodBoolean;
52
+ source: z.ZodOptional<z.ZodString>;
53
+ }, z.core.$strict>>;
54
+ }, z.core.$strict>], "enabled">;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ ok: z.ZodLiteral<false>;
57
+ error: z.ZodObject<{
58
+ message: z.ZodString;
59
+ }, z.core.$strip>;
60
+ }, z.core.$strip>], "ok">;
61
+ export {};
@@ -0,0 +1,31 @@
1
+ import { type CredentialProvider } from '@deepseek-ai/dsh-credentials';
2
+ import type { SavedReportRef } from '../presentation/contracts/report-ref.ts';
3
+ import type { MarivoPresentationFileService } from '../presentation/rpc.ts';
4
+ import type { EnabledPublishingConfig } from './config.ts';
5
+ import { type PublishingCredentialView, type PublishingField } from './credential-contract.ts';
6
+ type Store = Pick<CredentialProvider, 'describe' | 'set' | 'unset' | 'resolve'>;
7
+ export declare class ReportPublishingService {
8
+ #private;
9
+ readonly configId: `${string}-${string}-${string}-${string}-${string}`;
10
+ constructor(config: EnabledPublishingConfig, store: Store, files: Pick<MarivoPresentationFileService, 'readSavedReport'>, workspaceName: (id: string) => string);
11
+ assertConfig(configId: string): void;
12
+ describe(): Promise<PublishingCredentialView>;
13
+ change(field: PublishingField, value: string | undefined, signal: AbortSignal): Promise<void>;
14
+ publish(scope: {
15
+ sessionId: string;
16
+ } | {
17
+ workspaceId: string;
18
+ }, ref: SavedReportRef, caller: AbortSignal): Promise<{
19
+ storage: string;
20
+ bucket: string;
21
+ key: string;
22
+ url: string;
23
+ workspaceId: string;
24
+ reportId: string;
25
+ buildId: string;
26
+ sha256: string;
27
+ bytes: number;
28
+ publishedAt: string;
29
+ }>;
30
+ }
31
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chengxianglibra/dsh-data-analysis",
3
3
  "description": "Marivo runtime, live Help, secure datasource execution and presentation delivery for DeepSeek Harness",
4
- "version": "0.3.0",
4
+ "version": "0.3.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/chengxianglibra/dsh-data-analysis.git",
@@ -46,6 +46,8 @@
46
46
  "./package.json": "./package.json"
47
47
  },
48
48
  "files": [
49
+ "assets/logo-mark.svg",
50
+ "assets/logo-horizontal.svg",
49
51
  "lib/**/*.js",
50
52
  "lib/types/**/*.d.ts",
51
53
  "skills/dsh-data-analysis-presentation/**",
@@ -107,6 +109,7 @@
107
109
  }
108
110
  },
109
111
  "dependencies": {
112
+ "@aws-sdk/client-s3": "^3.1167.0",
110
113
  "@deepseek-ai/schemastery": "^3.18.1",
111
114
  "@noble/hashes": "2.4.0",
112
115
  "@openuidev/lang-core": "1.0.1",
@@ -6,7 +6,9 @@
6
6
 
7
7
  只交付用户要求的最终文件。分析 UI 的保存记录、快照和 receipt 不作为默认附件;用户另行要求时,先确认实际文件已经存在且当前 Session 可访问。
8
8
 
9
- 用户需要分析报告的离线 HTML 时,可在报告标签页导出当前显示的已保存版本。文件包含已保存快照,可能包括当前未显示的数据,分享前应确认内容;截断的快照不会因导出而变完整。下载由浏览器处理,不自动成为 Session 文件,也不代表已通过 `present` 交付;不以手写 HTML 冒充报告导出。对象存储发布不受支持。
9
+ 报告三点菜单默认提供本地 HTML 导出;开启 `reportPublishing.enabled` 后替换为「发布到对象存储」。缺凭据时,点击「前往凭证管理」跳到「数据源与凭证」页面中与「数据源」同级的「凭证管理」tab,补齐后重试发布。
10
+
11
+ 导出或发布均使用当前显示的已保存版本。HTML 包含已保存快照,可能包括当前未显示的数据,分享前应确认内容;截断的快照不会因此变完整。本地下载由浏览器处理,发布成功返回链接,均不自动成为 Session 文件,也不代表已通过 `present` 交付;不以手写 HTML 冒充报告导出。
10
12
 
11
13
  Session 文件生成成功,或用户要求预览且已有文件确认可访问后,调用 `present`,分别核对生成与声明结果。CSV、TSV、XLSX 由 Harness 原生表格预览读取文件,契约见 `dsh-v0.1.7-rc.1/packages/client/ui-sidebar-documentpreview/README.zh.md`;这是只读文件视图,不是 Marivo Report/Build,也不代表插件支持写入 XLSX 或分析旧 `.xls`。当前缺少 `present` 时,说明文件实际状态和原生交付能力不可用,并提供准确路径;不虚构卡片,不安装工具或改写 profile。
12
14