@chengxianglibra/dsh-data-analysis 0.1.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 (66) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +72 -0
  3. package/cordis.patch.yml +11 -0
  4. package/lib/bin/environment.js +91 -0
  5. package/lib/bridges.js +11 -0
  6. package/lib/client.js +744 -0
  7. package/lib/compatibility.js +66 -0
  8. package/lib/datasource/access.js +60 -0
  9. package/lib/datasource/bridge-programs.js +80 -0
  10. package/lib/datasource/bridge.js +204 -0
  11. package/lib/datasource/credentials.js +24 -0
  12. package/lib/datasource/index.js +4 -0
  13. package/lib/datasource/shell-env.js +386 -0
  14. package/lib/datasource/test.js +65 -0
  15. package/lib/disclosure/activation.js +369 -0
  16. package/lib/disclosure/bridge-program.js +11 -0
  17. package/lib/disclosure/bridge.js +65 -0
  18. package/lib/disclosure/help.js +227 -0
  19. package/lib/disclosure/index.js +3 -0
  20. package/lib/environment/binding.js +273 -0
  21. package/lib/environment/doctor.js +123 -0
  22. package/lib/environment/errors.js +11 -0
  23. package/lib/environment/index.js +7 -0
  24. package/lib/environment/runtime.js +558 -0
  25. package/lib/environment/source.js +6 -0
  26. package/lib/environment/subprocess.js +178 -0
  27. package/lib/environment/summary.js +19 -0
  28. package/lib/environment/workspace.js +49 -0
  29. package/lib/evidence/bridge-program.js +153 -0
  30. package/lib/evidence/bridge.js +166 -0
  31. package/lib/evidence/index.js +2 -0
  32. package/lib/evidence/sources.js +263 -0
  33. package/lib/index.js +7 -0
  34. package/lib/plugin.js +179 -0
  35. package/lib/types/bridges.d.ts +11 -0
  36. package/lib/types/client.d.ts +125 -0
  37. package/lib/types/compatibility.d.ts +29 -0
  38. package/lib/types/datasource/access.d.ts +27 -0
  39. package/lib/types/datasource/bridge.d.ts +53 -0
  40. package/lib/types/datasource/index.d.ts +8 -0
  41. package/lib/types/datasource/shell-env.d.ts +38 -0
  42. package/lib/types/datasource/test.d.ts +32 -0
  43. package/lib/types/disclosure/activation.d.ts +73 -0
  44. package/lib/types/disclosure/bridge.d.ts +28 -0
  45. package/lib/types/disclosure/help.d.ts +64 -0
  46. package/lib/types/disclosure/index.d.ts +5 -0
  47. package/lib/types/environment/binding.d.ts +26 -0
  48. package/lib/types/environment/doctor.d.ts +8 -0
  49. package/lib/types/environment/errors.d.ts +7 -0
  50. package/lib/types/environment/index.d.ts +9 -0
  51. package/lib/types/environment/runtime.d.ts +17 -0
  52. package/lib/types/environment/source.d.ts +7 -0
  53. package/lib/types/environment/subprocess.d.ts +19 -0
  54. package/lib/types/environment/types.d.ts +96 -0
  55. package/lib/types/environment/workspace.d.ts +10 -0
  56. package/lib/types/evidence/bridge.d.ts +40 -0
  57. package/lib/types/evidence/index.d.ts +4 -0
  58. package/lib/types/evidence/sources.d.ts +57 -0
  59. package/lib/types/index.d.ts +9 -0
  60. package/lib/types/plugin.d.ts +43 -0
  61. package/package.json +149 -0
  62. package/python/report-kit/dist/dsh_data_analysis_report_kit-3.0.0-py3-none-any.whl +0 -0
  63. package/skills/dsh-data-analysis-report/SKILL.md +57 -0
  64. package/skills/dsh-data-analysis-report/assets/marivo-artifact.js +113 -0
  65. package/skills/dsh-data-analysis-report/assets/marivo-session-dag.js +1201 -0
  66. package/skills/dsh-data-analysis-report/assets/report-data.js +449 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 chengxianglibra
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # @chengxianglibra/dsh-data-analysis
2
+
3
+ 由个人维护的 DeepSeek Harness 社区插件,并非 DeepSeek 官方发行或维护的软件包。
4
+
5
+ DeepSeek Harness 的 Marivo 集成插件。当前包提供:
6
+
7
+ - 精确 Marivo 0.5.3 共享 Runtime 与 zero-init per-Workspace binding;
8
+ - `marivo_help` 实时公共 Help transport;
9
+ - `marivo_datasource_test` 的 DSH Credentials 收集与显式 connection test;
10
+ - `marivo_datasource_access` 的 30 分钟、最多 64 次 foreground Shell credential lease;
11
+ - `marivo_evidence_sources({ session_id, sources })` 的可移植 Artifact-owned Finding 来源交付;
12
+ - `emit_dataset(BaseFrame, ...)`、`emit_computed(DataFrame, ...)` 与
13
+ `emit_session_trace(SessionGraph, ...)` 的有界 JavaScript 投影;
14
+ - 随包分发并挂载的 `dsh-data-analysis-report` Skill,以及 `marivo-analysis` 激活后的按需路由。
15
+
16
+ 旧 `marivo_test`、`marivo_report_render`、`ReportDocument`、报告 parser/renderer/publisher、专用报告 Web
17
+ 卡片与 replay 入口已删除,不提供 alias。
18
+
19
+ ## Compatibility
20
+
21
+ 包内 `dshDataAnalysisCompatibility` 是唯一运行时兼容声明:
22
+
23
+ - DSH distribution 与所有必需 peer 精确使用 `0.1.1-rc.2`;
24
+ - Marivo package spec 精确为 `marivo[duckdb,trino,clickhouse]==0.5.3`;
25
+ - 项目自有 Runtime marker 为 `dsh-data-analysis-runtime/v2`;
26
+ - 子进程策略为 `direct-argv-inherited-env-snapshot-overlay-v2`。
27
+
28
+ 管理员解释器的 `marivo.__version__` 与 package identity 必须精确匹配;不使用 capability/version matrix。
29
+
30
+ ## Tool contracts
31
+
32
+ ```text
33
+ marivo_help({ targets: string[] })
34
+ marivo_datasource_test({ name: string })
35
+ marivo_datasource_access({ name: string })
36
+ marivo_evidence_sources({
37
+ session_id: string,
38
+ sources: Array<{ artifact_ref: string, finding_id: string }>
39
+ })
40
+ ```
41
+
42
+ `marivo_datasource_test` 只拥有缺失 Credentials 的 DSH/Web 闭环和显式连接测试;
43
+ `marivo_datasource_access` 只签发有界 foreground Shell lease,不执行连接测试。`md.inspect(...)`、
44
+ Session recovery、Artifact revalidation、Quality、Evidence 读取、Session Graph 与 `to_pandas()` 都直接使用
45
+ Marivo 公共 API,不增加 convenience Tool。
46
+
47
+ ## 报告交付
48
+
49
+ 仅当用户明确请求 HTML/Web 或耐久报告、接受生成提议,或修改已有 bundle 时,Agent 加载
50
+ `dsh-data-analysis-report`;普通长回答或多图表/表格不会自动产出文件。已有分析恢复并 revalidate persisted
51
+ Artifacts,不为报告展示重新执行 `observe`。
52
+ 该 Skill 只提供内容组织、布局、样式和检查原则,不包含页面 Starter、通用 chart helper、可视化 DSL 或
53
+ HTML Checker。配套 assets 提供 `ReportData` 读取、精简 Artifact 摘要和 Session DAG;Python report-kit
54
+ 分别通过 `emit_dataset`、`emit_computed`、`emit_session_trace` 发射 Artifact、pandas DataFrame 与 Graph
55
+ 快照;Artifact 与 Graph emitter 默认 `reader`,明确审计请求才使用 `audit`。多 Session 的独立 Graph 集中展示,
56
+ Frame preview 只按精确 Session 与 Artifact identity 关联。Agent 自由生成
57
+ `<workspace>/<new-report-directory>/index.html` 与可选相对资源。Native/both 的
58
+ 最终入口使用顶层 DSH `write` / `edit`,并以精确 Markdown 行内路径交付,让 DSH Web 复用 Produced Files
59
+ 提供点击;Code-only 在 `run_code` 内使用同一 Tool,但嵌套 mutation 只保证精确路径。插件不创建报告对象、
60
+ digest、不可变发布、历史字节 replay 或 share link。
61
+
62
+ ## 验证
63
+
64
+ ```bash
65
+ npm run check
66
+ npm run build
67
+ npm run verify:plugin-package
68
+ ```
69
+
70
+ 当前架构与验收边界见仓库根目录的[总体架构](../../docs/architecture.md)、
71
+ [插件能力优化设计](../../docs/plan/plugin-capability-optimization-design.md)和
72
+ [v2 验收记录](../../docs/acceptance/plugin-capability-optimization-v2.md)。
@@ -0,0 +1,11 @@
1
+ # Web-profile Marivo disclosure layer. One profile-owned plugin installation
2
+ # serves every Agent and session Workspace in native, code, or both mode.
3
+
4
+ - insert:
5
+ - id: dsh-data-analysis
6
+ name: '@chengxianglibra/dsh-data-analysis'
7
+ config:
8
+ projectRoot: !!js process.env.DSH_DATA_ANALYSIS_PROJECT_ROOT
9
+ pythonExecutable: !!js process.env.DSH_DATA_ANALYSIS_PYTHON
10
+ runtimeRoot: !!js process.env.DSH_DATA_ANALYSIS_RUNTIME_ROOT
11
+ uvExecutable: !!js process.env.DSH_DATA_ANALYSIS_UV
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env node
2
+ /** Fail-closed runtime environment probe for operators and deployment scripts. */
3
+ import process from 'node:process';
4
+ import { MarivoEnvironmentError } from "../environment/errors.js";
5
+ import { ensureSharedMarivoRuntime, MarivoWorkspaceEnvironmentManager, } from "../environment/index.js";
6
+ import { environmentPayload } from "../environment/summary.js";
7
+ function usage() {
8
+ return `Usage: dsh-data-analysis-env [--project-root PATH] [--python PATH] [--runtime-root PATH] [--uv PATH]
9
+
10
+ Ensures the shared pinned Marivo and report-kit Runtime, initializes the minimal
11
+ Workspace layout, and checks the exact interpreter, import identities, and doctor
12
+ admission used by the DSH plugin. The JSON output contains no credentials or raw
13
+ doctor details.
14
+ `;
15
+ }
16
+ function requireValue(argv, index, option) {
17
+ const value = argv[index + 1];
18
+ if (value === undefined || value.startsWith('--'))
19
+ throw new Error(`${option} requires a value`);
20
+ return value;
21
+ }
22
+ function parseArguments(argv) {
23
+ let projectRoot = process.env.DSH_DATA_ANALYSIS_PROJECT_ROOT ?? process.env.DSH_CWD ?? process.cwd();
24
+ let pythonExecutable = process.env.DSH_DATA_ANALYSIS_PYTHON;
25
+ let runtimeRoot = process.env.DSH_DATA_ANALYSIS_RUNTIME_ROOT;
26
+ let uvExecutable = process.env.DSH_DATA_ANALYSIS_UV;
27
+ for (let index = 0; index < argv.length; index++) {
28
+ const option = argv[index];
29
+ if (option === '--help' || option === '-h')
30
+ return 'help';
31
+ if (option === '--project-root') {
32
+ projectRoot = requireValue(argv, index, option);
33
+ index++;
34
+ continue;
35
+ }
36
+ if (option === '--python') {
37
+ pythonExecutable = requireValue(argv, index, option);
38
+ index++;
39
+ continue;
40
+ }
41
+ if (option === '--runtime-root') {
42
+ runtimeRoot = requireValue(argv, index, option);
43
+ index++;
44
+ continue;
45
+ }
46
+ if (option === '--uv') {
47
+ uvExecutable = requireValue(argv, index, option);
48
+ index++;
49
+ continue;
50
+ }
51
+ throw new Error(`unknown option: ${String(option)}`);
52
+ }
53
+ return {
54
+ projectRoot,
55
+ ...(pythonExecutable === undefined ? {} : { pythonExecutable }),
56
+ ...(runtimeRoot === undefined ? {} : { runtimeRoot }),
57
+ ...(uvExecutable === undefined ? {} : { uvExecutable }),
58
+ };
59
+ }
60
+ async function main(argv) {
61
+ let args;
62
+ try {
63
+ args = parseArguments(argv);
64
+ }
65
+ catch (error) {
66
+ process.stderr.write(`${error.message}\n${usage()}`);
67
+ return 2;
68
+ }
69
+ if (args === 'help') {
70
+ process.stdout.write(usage());
71
+ return 0;
72
+ }
73
+ try {
74
+ const runtime = await ensureSharedMarivoRuntime({
75
+ ...(args.pythonExecutable === undefined ? {} : { pythonExecutable: args.pythonExecutable }),
76
+ ...(args.runtimeRoot === undefined ? {} : { runtimeRoot: args.runtimeRoot }),
77
+ ...(args.uvExecutable === undefined ? {} : { uvExecutable: args.uvExecutable }),
78
+ });
79
+ const manager = new MarivoWorkspaceEnvironmentManager(runtime);
80
+ const environment = await manager.resolve(args.projectRoot);
81
+ process.stdout.write(`${JSON.stringify(environmentPayload(runtime, environment), undefined, 2)}\n`);
82
+ return 0;
83
+ }
84
+ catch (error) {
85
+ const code = error instanceof MarivoEnvironmentError ? error.code : 'unexpected-error';
86
+ const message = error instanceof Error ? error.message : String(error);
87
+ process.stderr.write(`dsh-data-analysis-env: ${code}: ${message}\n`);
88
+ return 1;
89
+ }
90
+ }
91
+ process.exitCode = await main(process.argv.slice(2));
package/lib/bridges.js ADDED
@@ -0,0 +1,11 @@
1
+ import { MarivoDatasourceBridge } from "./datasource/bridge.js";
2
+ import { MarivoHelpBridge } from "./disclosure/bridge.js";
3
+ import { MarivoEvidenceBridge } from "./evidence/bridge.js";
4
+ /** Compose domain adapters without adding domain methods back to the Environment. */
5
+ export function createMarivoBridgeSet(environment) {
6
+ return Object.freeze({
7
+ help: new MarivoHelpBridge(environment),
8
+ datasource: new MarivoDatasourceBridge(environment),
9
+ evidence: new MarivoEvidenceBridge(environment),
10
+ });
11
+ }