@chengxianglibra/dsh-data-analysis 0.2.0 → 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.
- package/README.en.md +135 -0
- package/README.md +50 -80
- package/lib/client/credentials/install.js +2 -2
- package/lib/client/i18n/copy.js +4 -1
- package/lib/client/i18n/host.js +1 -0
- package/lib/client/i18n/settings.js +30 -0
- package/lib/client/settings/card.js +90 -0
- package/lib/client/settings/install.js +10 -0
- package/lib/client.js +85 -62
- package/lib/datasource/configure.js +1 -1
- package/lib/datasource/python-options.js +1 -7
- package/lib/datasource/python.js +9 -6
- package/lib/datasource/test.js +1 -1
- package/lib/disclosure/execution-guidance.js +5 -8
- package/lib/plugin-agents.js +2 -2
- package/lib/plugin.js +6 -2
- package/lib/presentation/assets/portable.js +1 -1
- package/lib/presentation/assets/static.js +47 -47
- package/lib/settings.js +21 -0
- package/lib/types/client/i18n/copy.d.ts +15 -0
- package/lib/types/client/i18n/host.d.ts +1 -0
- package/lib/types/client/i18n/settings.d.ts +16 -0
- package/lib/types/client/settings/card.d.ts +9 -0
- package/lib/types/client/settings/install.d.ts +2 -0
- package/lib/types/client.d.ts +2 -2
- package/lib/types/datasource/python-options.d.ts +1 -2
- package/lib/types/datasource/python.d.ts +2 -2
- package/lib/types/plugin-agents.d.ts +2 -0
- package/lib/types/settings.d.ts +14 -0
- package/package.json +15 -5
- package/python/presentation-kit/dist/dsh_data_analysis_presentation_kit-1.1.0-py3-none-any.whl +0 -0
- package/skills/dsh-data-analysis-files/SKILL.md +22 -10
- package/skills/dsh-data-analysis-files/references/delivery.md +15 -0
- package/skills/dsh-data-analysis-presentation/SKILL.md +15 -19
- package/skills/dsh-data-analysis-presentation/references/schema.md +4 -1
package/lib/settings.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import z from '@deepseek-ai/schemastery';
|
|
2
|
+
import { resolvePythonOptions } from "./datasource/python-options.js";
|
|
3
|
+
export const PYTHON_SETTINGS_NAMESPACE = 'dsh-data-analysis';
|
|
4
|
+
export const PythonSettings = z.object({
|
|
5
|
+
pythonTimeoutMs: z.number().min(1).max(2_147_483_647).step(1).required(),
|
|
6
|
+
});
|
|
7
|
+
/** Follow the Host settings provider; headless compositions retain their entry configuration. */
|
|
8
|
+
export function installPythonSettings(ctx, options) {
|
|
9
|
+
const entry = resolvePythonOptions(options);
|
|
10
|
+
let source = () => entry;
|
|
11
|
+
const dispose = ctx.inject(['settings'], (settingsCtx) => {
|
|
12
|
+
settingsCtx.settings.installSection(ctx, PYTHON_SETTINGS_NAMESPACE, PythonSettings, entry, {
|
|
13
|
+
validate: resolvePythonOptions,
|
|
14
|
+
setSource: (current) => {
|
|
15
|
+
source = current;
|
|
16
|
+
},
|
|
17
|
+
onChange: () => { },
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
return { get: () => source(), dispose: () => dispose.dispose() };
|
|
21
|
+
}
|
|
@@ -4,14 +4,29 @@ import * as navigation from './navigation.ts';
|
|
|
4
4
|
import * as presentation from './presentation.ts';
|
|
5
5
|
import * as python from './python.ts';
|
|
6
6
|
import * as semantic from './semantic.ts';
|
|
7
|
+
import * as settings from './settings.ts';
|
|
7
8
|
export declare const dictionaries: {
|
|
8
9
|
credentials: typeof credentials;
|
|
9
10
|
navigation: typeof navigation;
|
|
10
11
|
presentation: typeof presentation;
|
|
11
12
|
semantic: typeof semantic;
|
|
12
13
|
python: typeof python;
|
|
14
|
+
settings: typeof settings;
|
|
13
15
|
};
|
|
14
16
|
export declare const zh: {
|
|
17
|
+
'marivo.settings.title': "数据分析";
|
|
18
|
+
'marivo.settings.timeout': "Python 默认执行超时(秒)";
|
|
19
|
+
'marivo.settings.hint': "默认 120 秒。保存后对所有 Workspace 的下一次 Python 调用生效,不改变已开始调用的时限。单次调用可指定其他时限;仍受 Harness 执行限制约束。";
|
|
20
|
+
'marivo.settings.description': "Python 执行设置。";
|
|
21
|
+
'marivo.settings.expand': "展开设置";
|
|
22
|
+
'marivo.settings.collapse': "收起设置";
|
|
23
|
+
'marivo.settings.save': "保存";
|
|
24
|
+
'marivo.settings.saving': "保存中…";
|
|
25
|
+
'marivo.settings.discard': "放弃修改";
|
|
26
|
+
'marivo.settings.unsaved': "未保存";
|
|
27
|
+
'marivo.settings.invalid': "请输入 0.001 至 2147483.647 秒,最多三位小数。";
|
|
28
|
+
'marivo.settings.read-only': "当前连接的设置只读。";
|
|
29
|
+
'marivo.settings.failed': "保存失败或设置已被其他页面修改。草稿已保留;可放弃修改以读取最新值,再重试。";
|
|
15
30
|
'marivo.python.input': "输入";
|
|
16
31
|
'marivo.python.output': "输出";
|
|
17
32
|
'marivo.python.raw': "原始输入/输出";
|
|
@@ -8,6 +8,7 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
8
8
|
'marivo.presentation': keyof typeof dictionaries.presentation.zh;
|
|
9
9
|
'marivo.semantic': keyof typeof dictionaries.semantic.zh;
|
|
10
10
|
'marivo.python': keyof typeof dictionaries.python.zh;
|
|
11
|
+
'marivo.settings': keyof typeof dictionaries.settings.zh;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
export declare function installCopy(ctx: Context): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const zh: {
|
|
2
|
+
readonly 'marivo.settings.title': "数据分析";
|
|
3
|
+
readonly 'marivo.settings.timeout': "Python 默认执行超时(秒)";
|
|
4
|
+
readonly 'marivo.settings.hint': "默认 120 秒。保存后对所有 Workspace 的下一次 Python 调用生效,不改变已开始调用的时限。单次调用可指定其他时限;仍受 Harness 执行限制约束。";
|
|
5
|
+
readonly 'marivo.settings.description': "Python 执行设置。";
|
|
6
|
+
readonly 'marivo.settings.expand': "展开设置";
|
|
7
|
+
readonly 'marivo.settings.collapse': "收起设置";
|
|
8
|
+
readonly 'marivo.settings.save': "保存";
|
|
9
|
+
readonly 'marivo.settings.saving': "保存中…";
|
|
10
|
+
readonly 'marivo.settings.discard': "放弃修改";
|
|
11
|
+
readonly 'marivo.settings.unsaved': "未保存";
|
|
12
|
+
readonly 'marivo.settings.invalid': "请输入 0.001 至 2147483.647 秒,最多三位小数。";
|
|
13
|
+
readonly 'marivo.settings.read-only': "当前连接的设置只读。";
|
|
14
|
+
readonly 'marivo.settings.failed': "保存失败或设置已被其他页面修改。草稿已保留;可放弃修改以读取最新值,再重试。";
|
|
15
|
+
};
|
|
16
|
+
export declare const en: Record<keyof typeof zh, string>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
2
|
+
export interface PythonSettingsValue {
|
|
3
|
+
pythonTimeoutMs: number;
|
|
4
|
+
}
|
|
5
|
+
/** Seconds in the form, exact integer milliseconds at the Host boundary. */
|
|
6
|
+
export declare function timeoutMilliseconds(text: string): number | undefined;
|
|
7
|
+
export declare function PythonSettingsCard({ scope }: {
|
|
8
|
+
scope: SettingsScope<PythonSettingsValue>;
|
|
9
|
+
}): import("react").JSX.Element | null;
|
package/lib/types/client.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
-
import {
|
|
2
|
+
import { installRightTabs } from './client/right-tabs/install.tsx';
|
|
3
3
|
export { marivoPresentationDeliveryDefinition, parsePresentationDurableContent, presentationDeliveryFromEvent, presentationsForNode, } from './client/presentation/delivery.ts';
|
|
4
4
|
export { PresentationDeliveryModel } from './client/presentation/delivery-model.ts';
|
|
5
5
|
export { HostPresentationReader } from './client/presentation/host-entry.tsx';
|
|
6
|
-
export
|
|
6
|
+
export declare const inject: string[];
|
|
7
7
|
export declare function apply(ctx: Context, options?: {
|
|
8
8
|
diagnostics?: boolean;
|
|
9
9
|
onInstalled?: (controller: ReturnType<typeof installRightTabs>) => void;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export declare const DEFAULT_PYTHON_TIMEOUT_MS = 120000;
|
|
2
|
-
export declare const DEFAULT_PYTHON_MAX_TIMEOUT_MS = 600000;
|
|
3
2
|
export interface MarivoPythonOptions {
|
|
4
3
|
pythonTimeoutMs?: number;
|
|
5
|
-
pythonMaxTimeoutMs?: number;
|
|
6
4
|
}
|
|
5
|
+
export type MarivoPythonOptionsSource = MarivoPythonOptions | (() => MarivoPythonOptions);
|
|
7
6
|
/** Do not echo rejected inputs: tool arguments and configuration are not trusted diagnostics. */
|
|
8
7
|
export declare function pythonTimeout(value: unknown, name: string): number;
|
|
9
8
|
export declare function resolvePythonOptions(options: MarivoPythonOptions): Required<MarivoPythonOptions>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
2
|
import { type MarivoDatasourceBridgeSource } from './bridge.ts';
|
|
3
|
-
import { type
|
|
3
|
+
import { type MarivoPythonOptionsSource } from './python-options.ts';
|
|
4
4
|
import { type MarivoCredentialService } from './service.ts';
|
|
5
5
|
export interface MarivoPythonExecutionSummary {
|
|
6
6
|
phase: 'preparing' | 'executing' | 'capturing-code';
|
|
@@ -16,4 +16,4 @@ export declare class MarivoPythonExecutionError extends Error {
|
|
|
16
16
|
readonly execution: MarivoPythonExecutionSummary;
|
|
17
17
|
constructor(message: string, execution: MarivoPythonExecutionSummary);
|
|
18
18
|
}
|
|
19
|
-
export declare function registerMarivoPythonTool(ctx: Context, source: MarivoDatasourceBridgeSource, service: MarivoCredentialService, options?:
|
|
19
|
+
export declare function registerMarivoPythonTool(ctx: Context, source: MarivoDatasourceBridgeSource, service: MarivoCredentialService, options?: MarivoPythonOptionsSource): () => Promise<void>;
|
|
@@ -17,6 +17,8 @@ export declare function createMarivoAgentInstallation(ctx: Context, environmentO
|
|
|
17
17
|
credentials?: CredentialStore;
|
|
18
18
|
credentialService?: MarivoCredentialService;
|
|
19
19
|
credentialInteraction?: 'web' | 'none';
|
|
20
|
+
/** Read once at call admission so saved settings affect existing Agents. */
|
|
21
|
+
pythonOptionsSource?: () => MarivoPythonOptions;
|
|
20
22
|
/** Runtime-scoped Help source; normal plugin installation never binds Help to a Workspace. */
|
|
21
23
|
helpBridgeSource?: MarivoHelpBridgeSource;
|
|
22
24
|
}): {
|
|
@@ -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
|
+
};
|
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.2.
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/chengxianglibra/dsh-data-analysis.git",
|
|
@@ -57,7 +57,8 @@
|
|
|
57
57
|
"skills/dsh-data-analysis-files/**",
|
|
58
58
|
"python/presentation-kit/dist/dsh_data_analysis_presentation_kit-1.1.0-py3-none-any.whl",
|
|
59
59
|
"cordis.patch.yml",
|
|
60
|
-
"README.md"
|
|
60
|
+
"README.md",
|
|
61
|
+
"README.en.md"
|
|
61
62
|
],
|
|
62
63
|
"scripts": {
|
|
63
64
|
"build": "npm run clean && tsc -p tsconfig.build.json && node scripts/finalize-build.mjs",
|
|
@@ -98,7 +99,9 @@
|
|
|
98
99
|
"@deepseek-ai/dsh-client-ui-input-trigger",
|
|
99
100
|
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
100
101
|
"@deepseek-ai/dsh-client-ui-layout",
|
|
101
|
-
"@deepseek-ai/dsh-client-ui-sidebar-right"
|
|
102
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right",
|
|
103
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
104
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins"
|
|
102
105
|
],
|
|
103
106
|
"platform": "web"
|
|
104
107
|
},
|
|
@@ -155,7 +158,11 @@
|
|
|
155
158
|
"recharts": "3.8.1",
|
|
156
159
|
"sql-formatter": "15.8.2",
|
|
157
160
|
"typescript": "^6.0.3",
|
|
158
|
-
"zustand": "4.4.7"
|
|
161
|
+
"zustand": "4.4.7",
|
|
162
|
+
"@deepseek-ai/dsh-settings": "0.1.5-rc.1",
|
|
163
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.5-rc.1",
|
|
164
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.5-rc.1",
|
|
165
|
+
"@deepseek-ai/dsh-settings-file": "0.1.5-rc.1"
|
|
159
166
|
},
|
|
160
167
|
"peerDependencies": {
|
|
161
168
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
@@ -190,6 +197,9 @@
|
|
|
190
197
|
"@deepseek-ai/dsh-typert-registry": ">=0.1.5-rc.1",
|
|
191
198
|
"@deepseek-ai/dsh-util-values": ">=0.1.5-rc.1",
|
|
192
199
|
"@deepseek-ai/dsh-workspace": ">=0.1.5-rc.1",
|
|
193
|
-
"react": "^18.3.1"
|
|
200
|
+
"react": "^18.3.1",
|
|
201
|
+
"@deepseek-ai/dsh-settings": ">=0.1.5-rc.1",
|
|
202
|
+
"@deepseek-ai/dsh-client-ui-settings": ">=0.1.5-rc.1",
|
|
203
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.5-rc.1"
|
|
194
204
|
}
|
|
195
205
|
}
|
package/python/presentation-kit/dist/dsh_data_analysis_presentation_kit-1.1.0-py3-none-any.whl
CHANGED
|
Binary file
|
|
@@ -1,32 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dsh-data-analysis-files
|
|
3
|
-
description:
|
|
3
|
+
description: 分析附件或 Workspace 中的 CSV、JSON、Parquet、Excel 数据,回答问题或交付 CSV、JSON、PNG 文件。可接续报告展示,无需先建立 Marivo datasource 或语义模型。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# 文件分析
|
|
7
7
|
|
|
8
|
+
本 Skill 负责文件读取、计算、分析核对与普通文件交付。按用户问题选择方法;需要保存报告或交互展示时,完成分析后交给 `dsh-data-analysis-presentation`。
|
|
9
|
+
|
|
10
|
+
## 确认输入与执行
|
|
11
|
+
|
|
8
12
|
使用 Harness 提供的当前附件可读路径,或用户指定的 Workspace 文件;同名附件按消息和完整路径区分。路径不可读时报告实际问题,不猜测 Host 缓存位置。
|
|
13
|
+
在实际读取代码中使用该完整路径,使执行记录保留输入身份;不为缩短路径而复制成 Workspace 同名文件,以免覆盖或在后续追问中读到旧副本。
|
|
9
14
|
|
|
10
|
-
|
|
15
|
+
文件读取、计算和最终文件生成均通过 `marivo_python` 在绑定 Runtime 中执行,不改走 Bash 的 `python`/`python3` 或其他解释器。纯本地文件分析可直接使用 pandas 或原生 `duckdb`,传 `datasources: []`;无需 `md.raw_sql`、Marivo 分析 Skill、live Help 或语义建模。只有实际访问 Marivo datasource 时才声明其精确名称并查询相关契约。
|
|
11
16
|
|
|
12
17
|
使用现有 reader,保留回答所需的 sheet、字段和解析范围;区分样本与全量。Excel `.xlsx` 可用 DuckDB `read_xlsx`,首次使用可能联网获取官方扩展;不承诺旧 `.xls` 或冷缓存离线读取,不临时安装 Python 依赖。
|
|
13
18
|
|
|
14
19
|
每次 `marivo_python` 都是独立进程。原生 DuckDB 连接可在本次调用内复用、创建临时表,并及时关闭;后续追问重新读取原文件或已有结果,不依赖上次内存状态。按问题控制读取和输出规模,SQL `LIMIT` 不代表仅扫描这些行。
|
|
15
20
|
|
|
16
|
-
##
|
|
21
|
+
## 计算与核对
|
|
22
|
+
|
|
23
|
+
按问题确认粒度、单位、时间范围与比较基准;检查会影响计算的解析类型、缺失值、重复记录及连接基数。合并同名文件、筛选或去重时说明实际规则,不把缺失值当零,不把样本当全量。
|
|
17
24
|
|
|
18
|
-
|
|
25
|
+
完成文字答案或生成交付物前,逐项核对用户问题及各比较分支。保留比较两侧、变化方向和比例分母,从原值核对差值、比例与合计;Top N 或子集不能替代全量结论。观测和数值贡献不自动证明原因;结论措辞应体现实际证据强度。
|
|
26
|
+
最后核对解释文字中的比较名称与涨跌方向是否和表中同一项一致;基准不同可以解释比率差异,本身不能证明业务变化的原因。
|
|
19
27
|
|
|
20
|
-
|
|
28
|
+
某个基准或分支缺数据时,交付已有支持的答案,并明确缺失范围及影响,不用另一项成功比较替代。所需答案已有支持或已明确阻塞时结束,不为完善展示额外扩展分析。
|
|
21
29
|
|
|
22
|
-
|
|
30
|
+
## 可复用语义与停止条件
|
|
23
31
|
|
|
24
|
-
|
|
32
|
+
分析中发现可供后续任务复用的业务定义或语义缺口时,先区分共享口径与本次结果:指标定义、维度含义或业务关系可作为语义候选;观测数值、临时筛选与未验证假设保留在当前分析中,不自动成为共享定义。
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
仅当当前问题需要该共享定义,或用户已授权语义沉淀时,加载 `marivo-semantic`,携带复用用途、已有依据、适用范围和未决含义,按其 Skill 与实时 Help 检查并优先复用已有对象。需要新增或修正时只处理最小必要缺口;业务含义与授权已明确则继续,实质歧义按语义 Skill 澄清,不自行猜测定义,也不重复请求已有授权。
|
|
35
|
+
|
|
36
|
+
收到经验证的对象引用后继续原问题;必要对象已完成且原问题已回答,或阻塞已明确时停止。不递归扩展相邻指标、实体或业务域。顺带发现的范围外机会只在答复中简要说明用途与依据,不自动建模、另建记录文件或继续探索。普通文件计算仍无需语义建模;展示流程不承担语义沉淀。
|
|
37
|
+
|
|
38
|
+
## 按用户目标交付
|
|
27
39
|
|
|
28
|
-
|
|
40
|
+
普通答案和简短比较表格直接在聊天中回答,不额外创建文件。用户要求 CSV、JSON、PNG 等实际文件时,先读[文件交付](references/delivery.md),通过 `marivo_python` 生成最终文件,优先写入当前绑定 Workspace;确认执行成功、文件存在后,调用实际可用的 Harness 原生 `present`,再回复用户。文件生成和原生声明分别核对,路径或代码块不能替代交付。
|
|
29
41
|
|
|
30
|
-
|
|
42
|
+
需要交互图表、表格、报告或看板时加载 `dsh-data-analysis-presentation`,将 DataFrame 交给现有 writer,关联实际返回的 `codeRef`,用 `marivo_present` 保存固定 Build。在正文说明文件名与分析范围,不将文件结果冒充 Marivo Artifact 或 Evidence。普通 `present` 不赋予文件 Report/Build 或 Evidence 身份。
|
|
31
43
|
|
|
32
44
|
需要起步代码时读[简短示例](references/examples.md);其中提供无需额外依赖的 PNG 写入代码,也通过 `marivo_python` 执行。
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# 文件交付与恢复
|
|
2
|
+
|
|
3
|
+
用户要求 CSV、JSON、PNG 等实际文件时读取本页。生成最终文件后,按当前 Harness 原生 `present` 工具契约交付;不猜测附件缓存或 Shell 私有临时目录。工具拥有路径与类型校验,详见 Harness [present 契约](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.1.5-rc.1/packages/fs/tool-present/README.md)。
|
|
4
|
+
|
|
5
|
+
## 生成与声明
|
|
6
|
+
|
|
7
|
+
只交付用户要求的最终文件。报告内部的 `presentation.json`、computed 数据和 receipt 不作为默认附件;用户另行要求时,先确认实际文件已经存在且当前 Session 可访问。浏览器内生成的下载不伪装成 Session 文件;报告 HTML 交给展示 Skill 的导出或发布流程。
|
|
8
|
+
|
|
9
|
+
文件生成成功后调用 `present`,分别核对生成与声明结果。当前缺少 `present` 时,说明“文件已生成,原生交付能力不可用”,并提供准确路径;不虚构卡片,不安装工具或改写 profile。
|
|
10
|
+
|
|
11
|
+
## 失败与再次交付
|
|
12
|
+
|
|
13
|
+
生成失败不声明成功;声明失败区分“文件已生成”和“交付未完成”。修复路径或可见性后只重试交付,不为补卡片重跑分析。响应不确定时先核对已有调用结果和事件,不盲目重复声明。原生打开失败时使用 Host 的预览或错误反馈,不绕过权限。
|
|
14
|
+
|
|
15
|
+
卡片读取当前源文件,不保存内容版本;修改、移动或删除会影响后续读取。成功声明的持久事件属于 Harness,即使 PTC 外层程序随后失败,也不撤销已成功的声明。子代理产物属于其调用 Session;父 Agent 如需交付,先确认自己能访问文件,再在父 Session 显式调用 `present`,不自动跨 Session 转投递。
|
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dsh-data-analysis-presentation
|
|
3
|
-
description:
|
|
3
|
+
description: 将已有分析结果保存为右侧阅读器中的交互图表、表格、报告、看板或来源面板,并支持报告更新、HTML 导出与按需发布。普通文字、简短聊天表格及 CSV、PNG 文件交付无需此 Skill。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# 分析展示与报告交付
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
本 Skill 负责把已有结果组织为 JSON Draft,通过 `marivo_present` 保存并打开阅读器。分析方法、业务语义、质量与 lineage 由分析流程和 Marivo Runtime 契约拥有;展示不能补造缺失证据。
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 生成报告
|
|
11
11
|
|
|
12
|
-
1.
|
|
13
|
-
2.
|
|
14
|
-
3.
|
|
15
|
-
4.
|
|
16
|
-
5.
|
|
12
|
+
1. 确认展示目标与已有结果。报告语言遵循用户要求,否则根据问题和上下文决定,不跟随系统界面语言。已有结果可直接展示;缺少计算时,文件分析交给 `dsh-data-analysis-files`,Marivo 分析或建模交给对应 Runtime Skill 与 live Help。只补所需分支。
|
|
13
|
+
2. 选择数据与来源。可恢复 Artifact 用实际 `session.id` 和 `artifact.ref` 引用,按需加 `findingId`,不重复导出。同一问题需要计算后的 DataFrame 时,通过 `marivo_python` 在绑定 Runtime 使用 `dsh_data_analysis_presentation.write_dataset`;纯本地 pandas/原生 DuckDB 传 `datasources: []`,访问 Marivo datasource 才声明其精确名称。文件结果注明文件名与分析范围,关联实际返回的 `codeRef`,不构造 Marivo Artifact 或 Evidence 身份。
|
|
14
|
+
3. 写草稿前读 [schema 与文件边界](references/schema.md)。使用完整 Draft、Workspace 相对路径和实际来源身份;来源事实与 unavailable 状态由 builder 读取。报告、看板及比较型展示还需读 [叙事与证据检查](references/narrative.md),核对展示中的数值、范围、方向、分母和文字与已有结果一致。需要图表时读 [图形配置](references/charts.md),需要起步草稿或 writer 用法时读 [可改写示例](references/examples.md)。
|
|
15
|
+
4. 用普通文件能力在当前 Workspace 写 Draft。手写 computed JSON 时可按 [静态预检](references/schema.md#草稿静态预检)检查结构,再调用 `marivo_present`。成功 receipt 才表示已保存交付;失败按诊断修正草稿或引用,不为修复展示自动重新查询、observe、revalidate 或重放分析。缺失数据交回原分析流程。
|
|
16
|
+
5. 回复主要结论、未完成分支和实质限制,简短说明报告已在右侧 tab 打开;headless 时提供 receipt 的准确路径。保留来源 unavailable、Agent 预筛选与 writer 截断的区别。只声明实际完成的浏览器检查,不把构建成功视为计算或业务结论已验证。
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## 按操作读取
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
用户要求发布对象存储链接时,按[发布报告](references/publishing.md)使用实时披露的 `marivo_publish_report`。
|
|
27
|
-
|
|
28
|
-
离线 HTML 文件按[导出与原生交付](references/export-html.md)处理:`marivo_export_html` 成功后调用 `present`。
|
|
20
|
+
- **修改、合并或刷新已有报告**:先读 [报告更新](references/schema.md#报告更新)。基于已读取内容修改完整 Draft,保留用户需要的编辑;成对传入实际 `report_id` 与 `expected_build_id`,保存同一 Report 的新 Build。冲突时读取并核对当前版本,不仅替换 expected ID 重试。
|
|
21
|
+
- **筛选与动态指标**:默认不添加全局筛选。需要共同维度交互时,先读 [全局筛选与动态指标](references/interaction.md),准备所有可选组合所需结果;reader 不重算,缺组合时减少筛选或回到分析流程。
|
|
22
|
+
- **来源与生成代码追问**:简短问题可用 Marivo 公开 Python API 回答;需要来源面板时用 `datasets: []` 与 `source` block。脚本关联方式见 [生成代码](references/schema.md#生成代码),从报告 cell 继续见 [引用恢复](references/schema.md#从报告-cell-引用继续)。已有快照不证明当前数据新鲜度。
|
|
23
|
+
- **离线 HTML 文件**:读 [导出与原生交付](references/export-html.md),使用保存的 Build 导出,再调用原生 `present`。普通报告交付不额外生成 HTML 或附件。
|
|
24
|
+
- **对象存储链接**:用户要求发布时读 [发布报告](references/publishing.md),使用实时可用的 `marivo_publish_report`;成功后返回其确认的 URL。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 草稿 schema 与文件边界
|
|
2
2
|
|
|
3
|
-
这是插件的
|
|
3
|
+
这是插件的 Draft v2 写入契约。所有对象只接受列出的字段;不要把生成文档或 receipt 当作草稿。Marivo 的分析 API 与 semantic schema 以 bound Runtime 的 Skill 和 live Help 为准。
|
|
4
4
|
|
|
5
5
|
## 报告语言与版本
|
|
6
6
|
|
|
@@ -63,6 +63,9 @@ marivo_present({ draft_path, report_id, expected_build_id })
|
|
|
63
63
|
再以该已读取版本提交;不能只替换 expected ID 重试。响应丢失时也先读取 current 核对内容,避免重复提交。
|
|
64
64
|
已有 Report 之间不自动合并,历史 Build 不覆盖或清理。
|
|
65
65
|
|
|
66
|
+
用户可在宿主阅读器编辑呈现并保存同一报告,支持 cell 移动、删除(可删空)及撤销。读取当前保存内容
|
|
67
|
+
后保留用户需要的编辑;固定 Build 链接与离线 HTML 保留原快照。筛选选择只是临时展示,不进入保存或下载。
|
|
68
|
+
|
|
66
69
|
## 生成代码
|
|
67
70
|
|
|
68
71
|
`marivo_python` 成功执行后自动保存该次提交的 Python 原文,并在结果中返回 `codeRef: {executionId, sha256}`。
|