@chengxianglibra/dsh-data-analysis 0.1.1 → 0.2.0
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.md +139 -53
- package/cordis.patch.yml +1 -1
- package/lib/bin/environment.js +9 -7
- package/lib/bin/presentation-lint.js +21 -0
- package/lib/bridges.js +2 -2
- package/lib/client/credentials/changes.js +74 -0
- package/lib/client/credentials/create-datasource.js +171 -0
- package/lib/client/credentials/credential-draft.js +42 -0
- package/lib/client/credentials/defaults.js +11 -0
- package/lib/client/credentials/descriptions.js +46 -0
- package/lib/client/credentials/install.js +319 -0
- package/lib/client/credentials/model.js +766 -0
- package/lib/client/credentials/report-publishing.js +96 -0
- package/lib/client/credentials/styles.js +21 -0
- package/lib/client/i18n/context.js +22 -0
- package/lib/client/i18n/copy.js +57 -0
- package/lib/client/i18n/credentials.js +475 -0
- package/lib/client/i18n/host.js +27 -0
- package/lib/client/i18n/navigation.js +41 -0
- package/lib/client/i18n/presentation.js +577 -0
- package/lib/client/i18n/python.js +36 -0
- package/lib/client/i18n/semantic.js +441 -0
- package/lib/client/input-context.js +21 -0
- package/lib/client/python-tool/card.js +35 -0
- package/lib/client/python-tool/execution-error.js +35 -0
- package/lib/client/python-tool/install.js +9 -0
- package/lib/client/python-tool/model.js +101 -0
- package/lib/client/right-tabs/install.js +535 -0
- package/lib/client/right-tabs/live-delivery.js +58 -0
- package/lib/client/right-tabs/navigation.js +47 -0
- package/lib/client/right-tabs/page.js +178 -0
- package/lib/client/right-tabs/styles.js +11 -0
- package/lib/client/rpc.js +5 -0
- package/lib/client/semantic-reference.js +10 -0
- package/lib/client/workspace-header-action.js +24 -0
- package/lib/client/workspace-shortcuts.js +26 -0
- package/lib/client.js +1250 -730
- package/lib/compatibility.js +2 -2
- package/lib/datasource/authoring.js +109 -0
- package/lib/datasource/bridge-programs.js +42 -27
- package/lib/datasource/bridge.js +144 -9
- package/lib/datasource/changes-contract.js +41 -0
- package/lib/datasource/changes.js +49 -0
- package/lib/datasource/configure.js +39 -0
- package/lib/datasource/defaults.js +25 -0
- package/lib/datasource/index.js +4 -2
- package/lib/datasource/python-options.js +21 -0
- package/lib/datasource/python.js +206 -0
- package/lib/datasource/resolver-program.js +112 -0
- package/lib/datasource/rpc.js +150 -0
- package/lib/datasource/service.js +962 -0
- package/lib/datasource/shell-env.js +2 -333
- package/lib/datasource/test.js +25 -51
- package/lib/disclosure/activation.js +19 -7
- package/lib/disclosure/execution-guidance.js +52 -0
- package/lib/disclosure/help.js +4 -1
- package/lib/environment/binding.js +54 -9
- package/lib/environment/runtime.js +120 -108
- package/lib/environment/subprocess.js +6 -1
- package/lib/environment/summary.js +3 -3
- package/lib/environment/workspace.js +23 -1
- package/lib/index.js +1 -1
- package/lib/lifecycle.js +33 -0
- package/lib/plugin-agents.js +154 -0
- package/lib/plugin.js +172 -133
- package/lib/presentation/asset.js +34 -0
- package/lib/presentation/assets/portable.js +606 -0
- package/lib/presentation/assets/static.js +1216 -0
- package/lib/presentation/build/index.js +72 -0
- package/lib/presentation/commit.js +163 -0
- package/lib/presentation/contracts/asset-path.js +9 -0
- package/lib/presentation/contracts/catalog.js +62 -0
- package/lib/presentation/contracts/charts.js +453 -0
- package/lib/presentation/contracts/editing.js +58 -0
- package/lib/presentation/contracts/index.js +663 -0
- package/lib/presentation/contracts/interaction.js +62 -0
- package/lib/presentation/contracts/types.js +15 -0
- package/lib/presentation/contracts/values.js +28 -0
- package/lib/presentation/delivery.js +71 -0
- package/lib/presentation/export-html.js +214 -0
- package/lib/presentation/files.js +82 -0
- package/lib/presentation/index.js +6 -0
- package/lib/presentation/lint.js +46 -0
- package/lib/presentation/projection/files.js +85 -0
- package/lib/presentation/projection/index.js +196 -0
- package/lib/presentation/projection/program.js +137 -0
- package/lib/presentation/projection/sql-code.js +79 -0
- package/lib/presentation/receipt.js +34 -0
- package/lib/presentation/reports.js +219 -0
- package/lib/presentation/rpc.js +186 -0
- package/lib/presentation/tool.js +118 -0
- package/lib/python-execution-contracts.js +1 -0
- package/lib/python-execution.js +232 -0
- package/lib/report-publishing/adapters.js +111 -0
- package/lib/report-publishing/config.js +69 -0
- package/lib/report-publishing/service.js +180 -0
- package/lib/rpc.js +49 -0
- package/lib/semantic-browser/contracts.js +97 -0
- package/lib/semantic-browser/definition.js +64 -0
- package/lib/semantic-browser/program.js +129 -0
- package/lib/semantic-browser/service.js +106 -0
- package/lib/semantic-reference/bridge.js +127 -0
- package/lib/semantic-reference/contracts.js +127 -0
- package/lib/semantic-reference/environment.js +56 -0
- package/lib/semantic-reference/index.js +3 -0
- package/lib/semantic-reference/labels.js +16 -0
- package/lib/semantic-reference/rpc.js +143 -0
- package/lib/semantic-reference/search.js +95 -0
- package/lib/semantic-reference/usage.js +152 -0
- package/lib/tool-lifecycle.js +22 -0
- package/lib/types/bridges.d.ts +2 -2
- package/lib/types/client/credentials/changes.d.ts +9 -0
- package/lib/types/client/credentials/create-datasource.d.ts +7 -0
- package/lib/types/client/credentials/credential-draft.d.ts +14 -0
- package/lib/types/client/credentials/defaults.d.ts +2 -0
- package/lib/types/client/credentials/descriptions.d.ts +1 -0
- package/lib/types/client/credentials/install.d.ts +19 -0
- package/lib/types/client/credentials/model.d.ts +79 -0
- package/lib/types/client/credentials/report-publishing.d.ts +5 -0
- package/lib/types/client/credentials/styles.d.ts +1 -0
- package/lib/types/client/i18n/context.d.ts +17 -0
- package/lib/types/client/i18n/copy.d.ts +806 -0
- package/lib/types/client/i18n/credentials.d.ts +475 -0
- package/lib/types/client/i18n/host.d.ts +16 -0
- package/lib/types/client/i18n/navigation.d.ts +41 -0
- package/lib/types/client/i18n/presentation.d.ts +577 -0
- package/lib/types/client/i18n/python.d.ts +19 -0
- package/lib/types/client/i18n/semantic.d.ts +441 -0
- package/lib/types/client/input-context.d.ts +19 -0
- package/lib/types/client/presentation/ask-dsh.d.ts +5 -0
- package/lib/types/client/presentation/catalog-model.d.ts +24 -0
- package/lib/types/client/presentation/catalog.d.ts +20 -0
- package/lib/types/client/presentation/chart-explorer.d.ts +12 -0
- package/lib/types/client/presentation/chart-geometry.d.ts +30 -0
- package/lib/types/client/presentation/chart-renderer.d.ts +10 -0
- package/lib/types/client/presentation/chart-specials.d.ts +10 -0
- package/lib/types/client/presentation/chart-styles.d.ts +1 -0
- package/lib/types/client/presentation/chart-tooltip.d.ts +13 -0
- package/lib/types/client/presentation/chart-view.d.ts +23 -0
- package/lib/types/client/presentation/context-reference.d.ts +12 -0
- package/lib/types/client/presentation/copy-context.d.ts +5 -0
- package/lib/types/client/presentation/delivery-model.d.ts +75 -0
- package/lib/types/client/presentation/delivery.d.ts +78 -0
- package/lib/types/client/presentation/download.d.ts +2 -0
- package/lib/types/client/presentation/editor-controls.d.ts +12 -0
- package/lib/types/client/presentation/export-menu.d.ts +26 -0
- package/lib/types/client/presentation/export-view.d.ts +63 -0
- package/lib/types/client/presentation/global-filters.d.ts +6 -0
- package/lib/types/client/presentation/host-entry.d.ts +18 -0
- package/lib/types/client/presentation/icons.d.ts +4 -0
- package/lib/types/client/presentation/markdown.d.ts +5 -0
- package/lib/types/client/presentation/model.d.ts +61 -0
- package/lib/types/client/presentation/reader.d.ts +24 -0
- package/lib/types/client/presentation/reference-source.d.ts +9 -0
- package/lib/types/client/presentation/source-code-model.d.ts +17 -0
- package/lib/types/client/presentation/source-code.d.ts +6 -0
- package/lib/types/client/presentation/source-dialog.d.ts +12 -0
- package/lib/types/client/presentation/source-facts.d.ts +20 -0
- package/lib/types/client/presentation/source-format.d.ts +5 -0
- package/lib/types/client/presentation/source-highlight.d.ts +7 -0
- package/lib/types/client/presentation/sources.d.ts +13 -0
- package/lib/types/client/presentation/styles.d.ts +1 -0
- package/lib/types/client/presentation/table.d.ts +16 -0
- package/lib/types/client/presentation/use-element-width.d.ts +5 -0
- package/lib/types/client/python-tool/card.d.ts +2 -0
- package/lib/types/client/python-tool/execution-error.d.ts +3 -0
- package/lib/types/client/python-tool/install.d.ts +2 -0
- package/lib/types/client/python-tool/model.d.ts +20 -0
- package/lib/types/client/right-tabs/install.d.ts +18 -0
- package/lib/types/client/right-tabs/live-delivery.d.ts +8 -0
- package/lib/types/client/right-tabs/navigation.d.ts +17 -0
- package/lib/types/client/right-tabs/page.d.ts +36 -0
- package/lib/types/client/right-tabs/styles.d.ts +2 -0
- package/lib/types/client/rpc.d.ts +3 -0
- package/lib/types/client/semantic-reference.d.ts +4 -0
- package/lib/types/client/workspace-header-action.d.ts +7 -0
- package/lib/types/client/workspace-shortcuts.d.ts +15 -0
- package/lib/types/client.d.ts +9 -124
- package/lib/types/compatibility.d.ts +3 -3
- package/lib/types/datasource/authoring.d.ts +35 -0
- package/lib/types/datasource/bridge.d.ts +43 -4
- package/lib/types/datasource/changes-contract.d.ts +18 -0
- package/lib/types/datasource/changes.d.ts +15 -0
- package/lib/types/datasource/configure.d.ts +7 -0
- package/lib/types/datasource/defaults.d.ts +7 -0
- package/lib/types/datasource/index.d.ts +8 -5
- package/lib/types/datasource/python-options.d.ts +9 -0
- package/lib/types/datasource/python.d.ts +19 -0
- package/lib/types/datasource/resolver-program.d.ts +6 -0
- package/lib/types/datasource/rpc.d.ts +5 -0
- package/lib/types/datasource/service.d.ts +155 -0
- package/lib/types/datasource/shell-env.d.ts +0 -29
- package/lib/types/datasource/test.d.ts +6 -29
- package/lib/types/disclosure/activation.d.ts +2 -1
- package/lib/types/disclosure/execution-guidance.d.ts +6 -0
- package/lib/types/disclosure/help.d.ts +1 -1
- package/lib/types/environment/binding.d.ts +5 -1
- package/lib/types/environment/errors.d.ts +1 -1
- package/lib/types/environment/runtime.d.ts +5 -5
- package/lib/types/environment/types.d.ts +15 -3
- package/lib/types/environment/workspace.d.ts +1 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/lifecycle.d.ts +8 -0
- package/lib/types/plugin-agents.d.ts +27 -0
- package/lib/types/plugin.d.ts +14 -24
- package/lib/types/presentation/asset.d.ts +6 -0
- package/lib/types/presentation/build/index.d.ts +16 -0
- package/lib/types/presentation/commit.d.ts +4 -0
- package/lib/types/presentation/contracts/asset-path.d.ts +2 -0
- package/lib/types/presentation/contracts/catalog.d.ts +27 -0
- package/lib/types/presentation/contracts/charts.d.ts +11 -0
- package/lib/types/presentation/contracts/editing.d.ts +8 -0
- package/lib/types/presentation/contracts/index.d.ts +11 -0
- package/lib/types/presentation/contracts/interaction.d.ts +8 -0
- package/lib/types/presentation/contracts/types.d.ts +255 -0
- package/lib/types/presentation/contracts/values.d.ts +9 -0
- package/lib/types/presentation/delivery.d.ts +3 -0
- package/lib/types/presentation/export-html.d.ts +13 -0
- package/lib/types/presentation/files.d.ts +7 -0
- package/lib/types/presentation/index.d.ts +6 -0
- package/lib/types/presentation/lint.d.ts +13 -0
- package/lib/types/presentation/projection/files.d.ts +2 -0
- package/lib/types/presentation/projection/index.d.ts +20 -0
- package/lib/types/presentation/projection/program.d.ts +2 -0
- package/lib/types/presentation/projection/sql-code.d.ts +2 -0
- package/lib/types/presentation/receipt.d.ts +14 -0
- package/lib/types/presentation/reports.d.ts +10 -0
- package/lib/types/presentation/rpc.d.ts +25 -0
- package/lib/types/presentation/tool.d.ts +12 -0
- package/lib/types/python-execution-contracts.d.ts +10 -0
- package/lib/types/python-execution.d.ts +10 -0
- package/lib/types/report-publishing/adapters.d.ts +6 -0
- package/lib/types/report-publishing/config.d.ts +22 -0
- package/lib/types/report-publishing/service.d.ts +68 -0
- package/lib/types/rpc.d.ts +3 -0
- package/lib/types/semantic-browser/contracts.d.ts +47 -0
- package/lib/types/semantic-browser/definition.d.ts +20 -0
- package/lib/types/semantic-browser/program.d.ts +2 -0
- package/lib/types/semantic-browser/service.d.ts +26 -0
- package/lib/types/semantic-reference/bridge.d.ts +12 -0
- package/lib/types/semantic-reference/contracts.d.ts +54 -0
- package/lib/types/semantic-reference/environment.d.ts +22 -0
- package/lib/types/semantic-reference/index.d.ts +3 -0
- package/lib/types/semantic-reference/labels.d.ts +16 -0
- package/lib/types/semantic-reference/rpc.d.ts +15 -0
- package/lib/types/semantic-reference/search.d.ts +10 -0
- package/lib/types/semantic-reference/usage.d.ts +43 -0
- package/lib/types/tool-lifecycle.d.ts +4 -0
- package/lib/types/workspace-identity.d.ts +6 -0
- package/lib/workspace-identity.js +9 -0
- package/package.json +99 -53
- 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 +32 -0
- package/skills/dsh-data-analysis-files/references/examples.md +93 -0
- package/skills/dsh-data-analysis-presentation/SKILL.md +28 -0
- package/skills/dsh-data-analysis-presentation/references/chart-examples.md +18 -0
- package/skills/dsh-data-analysis-presentation/references/charts.md +55 -0
- package/skills/dsh-data-analysis-presentation/references/examples/artifact.draft.json +36 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-bins.dataset.json +33 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-boxes.dataset.json +45 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-composition.dataset.json +33 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-funnel.dataset.json +27 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-precision.dataset.json +21 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-series.dataset.json +58 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-shares.dataset.json +33 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts-waterfall.dataset.json +44 -0
- package/skills/dsh-data-analysis-presentation/references/examples/charts.draft.json +393 -0
- package/skills/dsh-data-analysis-presentation/references/examples/comparison-selected.dataset.json +24 -0
- package/skills/dsh-data-analysis-presentation/references/examples/comparison-summary.dataset.json +22 -0
- package/skills/dsh-data-analysis-presentation/references/examples/comparison.dataset.json +18 -0
- package/skills/dsh-data-analysis-presentation/references/examples/comparison.draft.json +80 -0
- package/skills/dsh-data-analysis-presentation/references/examples/computed-sources.draft.json +42 -0
- package/skills/dsh-data-analysis-presentation/references/examples/computed.dataset.json +12 -0
- package/skills/dsh-data-analysis-presentation/references/examples/computed.draft.json +58 -0
- package/skills/dsh-data-analysis-presentation/references/examples/interaction-detail.dataset.json +30 -0
- package/skills/dsh-data-analysis-presentation/references/examples/interaction-summary.dataset.json +22 -0
- package/skills/dsh-data-analysis-presentation/references/examples/interaction.draft.json +279 -0
- package/skills/dsh-data-analysis-presentation/references/examples/source-only.draft.json +27 -0
- package/skills/dsh-data-analysis-presentation/references/examples/write-charts.py +73 -0
- package/skills/dsh-data-analysis-presentation/references/examples/write-comparison.py +42 -0
- package/skills/dsh-data-analysis-presentation/references/examples/write-computed.py +21 -0
- package/skills/dsh-data-analysis-presentation/references/examples/write-interaction.py +33 -0
- package/skills/dsh-data-analysis-presentation/references/examples.md +44 -0
- package/skills/dsh-data-analysis-presentation/references/export-html.md +7 -0
- package/skills/dsh-data-analysis-presentation/references/interaction.md +56 -0
- package/skills/dsh-data-analysis-presentation/references/narrative.md +37 -0
- package/skills/dsh-data-analysis-presentation/references/publishing.md +3 -0
- package/skills/dsh-data-analysis-presentation/references/schema.md +162 -0
- package/lib/datasource/access.js +0 -60
- package/lib/datasource/credentials.js +0 -24
- package/lib/evidence/bridge-program.js +0 -153
- package/lib/evidence/bridge.js +0 -166
- package/lib/evidence/index.js +0 -2
- package/lib/evidence/sources.js +0 -263
- package/lib/types/datasource/access.d.ts +0 -27
- package/lib/types/evidence/bridge.d.ts +0 -40
- package/lib/types/evidence/index.d.ts +0 -4
- package/lib/types/evidence/sources.d.ts +0 -57
- package/python/report-kit/dist/dsh_data_analysis_report_kit-3.0.0-py3-none-any.whl +0 -0
- package/skills/dsh-data-analysis-report/SKILL.md +0 -57
- package/skills/dsh-data-analysis-report/assets/marivo-artifact.js +0 -113
- package/skills/dsh-data-analysis-report/assets/marivo-session-dag.js +0 -1201
- package/skills/dsh-data-analysis-report/assets/report-data.js +0 -449
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
2
|
+
import { type CredentialProvider } from '@deepseek-ai/dsh-credentials';
|
|
3
|
+
import type { ToolExecution } from '@deepseek-ai/dsh-tools';
|
|
4
|
+
import type { JsonValue } from '@deepseek-ai/dsh-util-values';
|
|
5
|
+
import type { DatasourceCreateInput, DatasourceUpdateInput } from './authoring.ts';
|
|
6
|
+
import type { MarivoDatasourceBridgePort, MarivoDatasourceDescription, MarivoDatasourceTestResult } from './bridge.ts';
|
|
7
|
+
export declare const CREDENTIAL_CHANNEL = "/dsh-data-analysis-credentials";
|
|
8
|
+
export type CredentialStore = Pick<CredentialProvider, 'describe' | 'resolve' | 'set' | 'unset'>;
|
|
9
|
+
export type CredentialAction = 'save' | 'update' | 'delete' | 'delete-datasource' | 'test' | 'submit' | 'diagnose';
|
|
10
|
+
export interface CredentialContextView {
|
|
11
|
+
token: string;
|
|
12
|
+
workspaceId: string;
|
|
13
|
+
name: string;
|
|
14
|
+
backend: string;
|
|
15
|
+
properties: Record<string, JsonValue>;
|
|
16
|
+
refs: string[];
|
|
17
|
+
fields: Record<string, string>;
|
|
18
|
+
version: string;
|
|
19
|
+
credentials: Record<string, {
|
|
20
|
+
configured: boolean;
|
|
21
|
+
source?: string;
|
|
22
|
+
writable: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
lastTest?: {
|
|
25
|
+
at: number;
|
|
26
|
+
result: MarivoDatasourceTestResult;
|
|
27
|
+
stale: boolean;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface CredentialRequestView {
|
|
31
|
+
id: string;
|
|
32
|
+
sessionId: string;
|
|
33
|
+
context: CredentialContextView;
|
|
34
|
+
status: 'awaiting-input' | 'executing' | 'awaiting-decision' | 'succeeded' | 'handed-off' | 'call-ended' | 'cancelled' | 'context-changed';
|
|
35
|
+
failure?: MarivoDatasourceTestResult;
|
|
36
|
+
endedAt?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface DatasourceConfigureInput {
|
|
39
|
+
mode: 'create' | 'edit';
|
|
40
|
+
name?: string;
|
|
41
|
+
reason: string;
|
|
42
|
+
}
|
|
43
|
+
export interface ConfigurationRequestView extends Omit<CredentialRequestView, 'context'> {
|
|
44
|
+
configuration: DatasourceConfigureInput;
|
|
45
|
+
workspaceId: string;
|
|
46
|
+
context?: CredentialContextView;
|
|
47
|
+
}
|
|
48
|
+
interface PendingConfiguration {
|
|
49
|
+
view: ConfigurationRequestView;
|
|
50
|
+
settled: boolean;
|
|
51
|
+
controller: AbortController;
|
|
52
|
+
exec: ToolExecution;
|
|
53
|
+
resolve: () => Promise<MarivoDatasourceBridgePort>;
|
|
54
|
+
fingerprint: string;
|
|
55
|
+
sessionIdentity: string;
|
|
56
|
+
signal: AbortSignal;
|
|
57
|
+
finish: (value: ConfigurationResult) => void;
|
|
58
|
+
stop: () => void;
|
|
59
|
+
}
|
|
60
|
+
export interface ConfigurationResult {
|
|
61
|
+
status: 'ok' | 'failed' | 'cancelled' | 'call-ended' | 'context-changed' | 'needs-configuration';
|
|
62
|
+
name?: string;
|
|
63
|
+
latency_ms?: number | null;
|
|
64
|
+
failure?: MarivoDatasourceTestResult['failure'];
|
|
65
|
+
repair?: MarivoDatasourceTestResult['repair'];
|
|
66
|
+
}
|
|
67
|
+
export interface CredentialOperationView {
|
|
68
|
+
id: string;
|
|
69
|
+
scope: string;
|
|
70
|
+
action: CredentialAction;
|
|
71
|
+
status: 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
72
|
+
phase: 'saving' | 'removing' | 'validating' | 'settled';
|
|
73
|
+
deleteCredentials?: boolean;
|
|
74
|
+
datasourceRemoved?: boolean;
|
|
75
|
+
deletedCredentials?: string[];
|
|
76
|
+
credentialDeleteFailures?: string[];
|
|
77
|
+
saved: string[];
|
|
78
|
+
errors: string[];
|
|
79
|
+
result?: MarivoDatasourceTestResult;
|
|
80
|
+
endedAt?: number;
|
|
81
|
+
}
|
|
82
|
+
export interface CredentialNeedsInput {
|
|
83
|
+
status: 'needs-credentials';
|
|
84
|
+
name: string;
|
|
85
|
+
refs: string[];
|
|
86
|
+
}
|
|
87
|
+
export interface PreparedCredentialExecution {
|
|
88
|
+
status: 'ready';
|
|
89
|
+
values: Record<string, string>;
|
|
90
|
+
grants: Record<string, MarivoDatasourceDescription>;
|
|
91
|
+
bridge: MarivoDatasourceBridgePort;
|
|
92
|
+
signal: AbortSignal;
|
|
93
|
+
/** Call synchronously immediately before starting the resolved Shell request. */
|
|
94
|
+
assertCurrent: () => void;
|
|
95
|
+
/** Forget values and stop operation-scoped credential tracking. */
|
|
96
|
+
release: () => void;
|
|
97
|
+
}
|
|
98
|
+
export declare class CredentialServiceError extends Error {
|
|
99
|
+
readonly code: string;
|
|
100
|
+
constructor(code: string);
|
|
101
|
+
}
|
|
102
|
+
export declare function credentialError(error: unknown): string;
|
|
103
|
+
/** Owns only plugin operations and execution-scoped waits. No value cache or datasource registry. */
|
|
104
|
+
export declare class MarivoCredentialService {
|
|
105
|
+
#private;
|
|
106
|
+
readonly generation: `${string}-${string}-${string}-${string}-${string}`;
|
|
107
|
+
readonly interaction: 'web' | 'none';
|
|
108
|
+
readonly now: () => number;
|
|
109
|
+
constructor(store: CredentialStore, interaction?: 'web' | 'none', now?: () => number);
|
|
110
|
+
executionSignal(caller: AbortSignal, agent?: Agent): AbortSignal;
|
|
111
|
+
invalidateStorageRef(storageRef: string): void;
|
|
112
|
+
invalidate(refs: readonly string[]): void;
|
|
113
|
+
overview(workspaceId: string, resolve: () => Promise<MarivoDatasourceBridgePort>, caller: AbortSignal): Promise<CredentialContextView[]>;
|
|
114
|
+
createDatasource(generation: string, fingerprint: string, input: DatasourceCreateInput, resolve: () => Promise<MarivoDatasourceBridgePort>, caller: AbortSignal): Promise<{
|
|
115
|
+
name: string;
|
|
116
|
+
}>;
|
|
117
|
+
updateDatasource(generation: string, fingerprint: string, input: DatasourceUpdateInput, resolve: () => Promise<MarivoDatasourceBridgePort>, caller: AbortSignal): Promise<{
|
|
118
|
+
name: string;
|
|
119
|
+
}>;
|
|
120
|
+
configure(exec: ToolExecution, resolve: () => Promise<MarivoDatasourceBridgePort>, input: DatasourceConfigureInput): Promise<ConfigurationResult>;
|
|
121
|
+
configurationRequest(id: string, workspaceId: string, resolve: () => Promise<MarivoDatasourceBridgePort>, caller: AbortSignal): Promise<PendingConfiguration>;
|
|
122
|
+
selectConfiguration(id: string, workspaceId: string, name: string, resolve: () => Promise<MarivoDatasourceBridgePort>, caller: AbortSignal): Promise<ConfigurationRequestView>;
|
|
123
|
+
prepare(_kind: 'test', exec: ToolExecution, resolve: () => Promise<MarivoDatasourceBridgePort>, name: string): Promise<MarivoDatasourceTestResult | CredentialNeedsInput>;
|
|
124
|
+
prepareExecution(exec: ToolExecution, resolve: () => Promise<MarivoDatasourceBridgePort>, names: string[]): Promise<PreparedCredentialExecution | CredentialNeedsInput | MarivoDatasourceTestResult>;
|
|
125
|
+
watch(sessionId: string, cursor?: string): {
|
|
126
|
+
generation: string;
|
|
127
|
+
cursor: string;
|
|
128
|
+
requests: CredentialRequestView[];
|
|
129
|
+
configurationRequests: ConfigurationRequestView[];
|
|
130
|
+
};
|
|
131
|
+
waitWatch(sessionId: string, cursor: string | undefined, signal: AbortSignal): Promise<{
|
|
132
|
+
generation: string;
|
|
133
|
+
cursor: string;
|
|
134
|
+
requests: CredentialRequestView[];
|
|
135
|
+
configurationRequests: ConfigurationRequestView[];
|
|
136
|
+
}>;
|
|
137
|
+
operation(generation: string, id: string, scope: string): CredentialOperationView | undefined;
|
|
138
|
+
start(input: {
|
|
139
|
+
generation: string;
|
|
140
|
+
id: string;
|
|
141
|
+
scope: string;
|
|
142
|
+
action: CredentialAction;
|
|
143
|
+
version: string;
|
|
144
|
+
requestId?: string;
|
|
145
|
+
changes?: Record<string, string>;
|
|
146
|
+
reference?: string;
|
|
147
|
+
deleteCredentials?: boolean;
|
|
148
|
+
}): CredentialOperationView;
|
|
149
|
+
cancelOperation(generation: string, id: string, scope: string): void;
|
|
150
|
+
cancelRequest(id: string): void;
|
|
151
|
+
disposeAgent(agent: Agent): void;
|
|
152
|
+
track<T>(task: Promise<T>): Promise<T>;
|
|
153
|
+
close(): Promise<void>;
|
|
154
|
+
}
|
|
155
|
+
export {};
|
|
@@ -1,38 +1,9 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
-
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
-
import { type CredentialProvider } from '@deepseek-ai/dsh-credentials';
|
|
4
|
-
import type { ToolExecution } from '@deepseek-ai/dsh-tools';
|
|
5
|
-
import { type MarivoDatasourceBridgePort, type MarivoDatasourceBridgeSource } from './bridge.ts';
|
|
6
2
|
export declare const MARIVO_CREDENTIAL_STORAGE_PREFIX = "DSH_DATA_ANALYSIS_CREDENTIAL_";
|
|
7
|
-
export declare const MARIVO_CREDENTIAL_LEASE_PREFIX = "# dsh-marivo-credential-lease:";
|
|
8
|
-
export declare const DEFAULT_MARIVO_CREDENTIAL_LEASE_TTL_MS: number;
|
|
9
|
-
export declare const DEFAULT_MARIVO_CREDENTIAL_LEASE_MAX_USES = 64;
|
|
10
3
|
type MarivoCredentialStorageRefName = `DSH_DATA_ANALYSIS_CREDENTIAL_${string}`;
|
|
11
|
-
export interface MarivoShellLeaseReceipt {
|
|
12
|
-
[key: string]: string | number;
|
|
13
|
-
token: string;
|
|
14
|
-
expires_in_ms: number;
|
|
15
|
-
max_uses: number;
|
|
16
|
-
usage: 'bounded-foreground-shell-lease';
|
|
17
|
-
bash_prelude: string;
|
|
18
|
-
pwsh_prelude: string;
|
|
19
|
-
}
|
|
20
4
|
/** Publish the exact shared interpreter as a non-secret, per-execution DSH fact. */
|
|
21
5
|
export declare function registerMarivoRuntimeShellEnvironment(ctx: Context, pythonExecutable: string): () => void;
|
|
22
6
|
/** Map one user-authored datasource environment reference to plugin-owned DSH storage. */
|
|
23
7
|
export declare function marivoCredentialStorageRef(ref: string): MarivoCredentialStorageRefName;
|
|
24
8
|
export declare function assertMarivoCredentialReferences(refs: readonly string[]): void;
|
|
25
|
-
/** Own bounded leases and expose credential values only to each admitted Shell execution. */
|
|
26
|
-
export declare class MarivoShellCredentialLeases {
|
|
27
|
-
#private;
|
|
28
|
-
constructor(ctx: Context, credentials: Pick<CredentialProvider, 'resolve'>, options?: {
|
|
29
|
-
ttlMs?: number;
|
|
30
|
-
maxUses?: number;
|
|
31
|
-
});
|
|
32
|
-
revokeLease(agent: Agent, bridge: MarivoDatasourceBridgePort, datasourceName: string): void;
|
|
33
|
-
issueLease(agent: Agent, bridge: MarivoDatasourceBridgePort, datasourceName: string, refs: readonly string[]): MarivoShellLeaseReceipt;
|
|
34
|
-
prepareExecution(agent: Agent, bridgeSource: MarivoDatasourceBridgeSource, execution: ToolExecution): Promise<boolean>;
|
|
35
|
-
installAgent(agent: Agent, bridgeSource: MarivoDatasourceBridgeSource): () => void;
|
|
36
|
-
dispose(): void;
|
|
37
|
-
}
|
|
38
9
|
export {};
|
|
@@ -1,32 +1,9 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
-
import type { CredentialProvider } from '@deepseek-ai/dsh-credentials';
|
|
3
|
-
import type { JsonValue } from '@deepseek-ai/dsh-session';
|
|
4
2
|
import { type ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
5
|
-
import { type
|
|
3
|
+
import { type MarivoDatasourceBridgeSource } from './bridge.ts';
|
|
4
|
+
import type { MarivoCredentialService } from './service.ts';
|
|
6
5
|
export declare const MARIVO_DATASOURCE_TEST_TOOL_NAME = "marivo_datasource_test";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
status: 'needs-credentials';
|
|
12
|
-
name: string;
|
|
13
|
-
refs: string[];
|
|
14
|
-
} & JsonObject) | ({
|
|
15
|
-
status: 'ok';
|
|
16
|
-
name: string;
|
|
17
|
-
latency_ms: number | null;
|
|
18
|
-
} & JsonObject) | ({
|
|
19
|
-
status: 'failed';
|
|
20
|
-
name: string;
|
|
21
|
-
latency_ms: number | null;
|
|
22
|
-
failure: MarivoDatasourceFailure;
|
|
23
|
-
repair: MarivoDatasourceRepair;
|
|
24
|
-
} & JsonObject);
|
|
25
|
-
export interface MarivoDatasourceTestOptions {
|
|
26
|
-
/** Explicit validation invalidates prior access for this Agent and datasource. */
|
|
27
|
-
revokeShellLease(bridge: MarivoDatasourceBridgePort, name: string): void;
|
|
28
|
-
}
|
|
29
|
-
/** Build the scoped datasource connection-test Tool. */
|
|
30
|
-
export declare function createMarivoDatasourceTestTool(bridgeSource: MarivoDatasourceBridgeSource, credentials: Pick<CredentialProvider, 'resolve'>, options: MarivoDatasourceTestOptions): ToolDefinition;
|
|
31
|
-
export declare function registerMarivoDatasourceTestTool(ctx: Context, bridgeSource: MarivoDatasourceBridgeSource, credentials: Pick<CredentialProvider, 'resolve'>, options: MarivoDatasourceTestOptions): () => void;
|
|
32
|
-
export {};
|
|
6
|
+
export declare function createMarivoDatasourceTestTool(source: MarivoDatasourceBridgeSource, service: MarivoCredentialService): ToolDefinition;
|
|
7
|
+
export declare function registerMarivoDatasourceTestTool(ctx: Context, source: MarivoDatasourceBridgeSource, service: MarivoCredentialService): () => Promise<void>;
|
|
8
|
+
/** Preserve the datasource tools' public status family; raw Marivo results stay inside the service. */
|
|
9
|
+
export declare function datasourceToolValue(result: Awaited<ReturnType<MarivoCredentialService['prepare']>>): any;
|
|
@@ -63,11 +63,12 @@ export declare class MarivoDisclosureController {
|
|
|
63
63
|
constructor(agent: Agent, bridgeSource: MarivoHelpBridgeSource, options?: MarivoDisclosureOptions);
|
|
64
64
|
get activeSkills(): readonly MarivoSkillName[];
|
|
65
65
|
telemetry(): MarivoDisclosureTelemetry;
|
|
66
|
-
addDisposer(disposer: () =>
|
|
66
|
+
addDisposer(disposer: () => unknown): void;
|
|
67
67
|
observeToolResult(exec: Readonly<ToolExecution>, result: Readonly<ToolExecutionResult>): void;
|
|
68
68
|
resolveDelivery(query: Readonly<MarivoHelpDeliveryQuery>): MarivoHelpDelivery;
|
|
69
69
|
prepareStep(messages: readonly UserMessage[], signal: AbortSignal): Promise<UserMessage[]>;
|
|
70
70
|
dispose(): void;
|
|
71
|
+
close(): Promise<void>;
|
|
71
72
|
}
|
|
72
73
|
/** Install skill-triggered Marivo live-help disclosure for one Agent scope. */
|
|
73
74
|
export declare function installMarivoDisclosure(_ctx: Context, agent: Agent, bridgeSource: MarivoHelpBridgeSource, options?: MarivoDisclosureOptions): MarivoDisclosureController;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
2
|
+
import type { MarivoDisclosureController } from './activation.ts';
|
|
3
|
+
export declare const MARIVO_DATASOURCE_CREDENTIAL_PROMPT: string;
|
|
4
|
+
export declare const MARIVO_ANALYSIS_CLOSEOUT_PROMPT: string;
|
|
5
|
+
/** Full-plugin seam: requires its execution tools, credentials service and system sections. */
|
|
6
|
+
export declare function installMarivoExecutionGuidance(agent: Agent, controller: MarivoDisclosureController): () => void;
|
|
@@ -61,4 +61,4 @@ export declare function readMarivoHelpTargets(bridge: MarivoHelpBridgePort, rawT
|
|
|
61
61
|
/** Build the native Harness ToolDefinition without registering Agent activation behavior. */
|
|
62
62
|
export declare function createMarivoHelpTool(bridgeSource: MarivoHelpBridgeSource, limitOverrides?: Partial<MarivoHelpLimits>, resolveDelivery?: MarivoHelpDeliveryResolver): ToolDefinition;
|
|
63
63
|
/** Register the focused Help Tool; skill-triggered root disclosure is composed separately. */
|
|
64
|
-
export declare function registerMarivoHelpTool(ctx: Context, bridgeSource: MarivoHelpBridgeSource, limits?: Partial<MarivoHelpLimits>, resolveDelivery?: MarivoHelpDeliveryResolver): () => void
|
|
64
|
+
export declare function registerMarivoHelpTool(ctx: Context, bridgeSource: MarivoHelpBridgeSource, limits?: Partial<MarivoHelpLimits>, resolveDelivery?: MarivoHelpDeliveryResolver): () => Promise<void>;
|
|
@@ -16,11 +16,15 @@ export declare class MarivoEnvironment {
|
|
|
16
16
|
assertImportIdentity(signal?: AbortSignal): Promise<ImportIdentity>;
|
|
17
17
|
}
|
|
18
18
|
/** Build an identity-checked Help runner directly from an admitted shared Runtime. */
|
|
19
|
-
export declare function createSharedMarivoRuntimeRunner(runtime: Pick<SharedMarivoRuntime, 'runtimeRoot' | 'pythonExecutable' | 'marivoVersion' | 'packagePath'>, options?: {
|
|
19
|
+
export declare function createSharedMarivoRuntimeRunner(runtime: Pick<SharedMarivoRuntime, 'runtimeRoot' | 'pythonExecutable' | 'marivoVersion' | 'packagePath' | 'presentationKitVersion' | 'presentationKitPackagePath'>, options?: {
|
|
20
20
|
environment?: NodeJS.ProcessEnv;
|
|
21
21
|
}): MarivoEnvironment;
|
|
22
22
|
/** Resolve, probe, and establish one Marivo Environment Binding. */
|
|
23
23
|
export declare function bindMarivoEnvironment(config: MarivoEnvironmentConfig, options?: {
|
|
24
24
|
environment?: NodeJS.ProcessEnv;
|
|
25
25
|
signal?: AbortSignal;
|
|
26
|
+
presentationKit?: Readonly<{
|
|
27
|
+
version: string;
|
|
28
|
+
packagePath: string;
|
|
29
|
+
}>;
|
|
26
30
|
}): Promise<MarivoEnvironment>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type EnvironmentFailureCode = 'project-root-invalid' | 'python-path-relative' | 'python-unavailable' | 'shared-runtime-config-invalid' | 'shared-runtime-lock-timeout' | 'shared-runtime-install-failed' | 'shared-runtime-identity-mismatch' | 'shared-runtime-version-unsupported' | 'shared-runtime-pandas-unsupported' | 'shared-runtime-
|
|
1
|
+
export type EnvironmentFailureCode = 'project-root-invalid' | 'python-path-relative' | 'python-unavailable' | 'shared-runtime-config-invalid' | 'shared-runtime-lock-timeout' | 'shared-runtime-install-failed' | 'shared-runtime-identity-mismatch' | 'shared-runtime-version-unsupported' | 'shared-runtime-pandas-unsupported' | 'shared-runtime-presentation-kit-unsupported' | 'shared-runtime-presentation-kit-wheel-invalid' | 'shared-runtime-presentation-kit-wheel-unavailable' | 'shared-runtime-package-unavailable' | 'shared-runtime-skills-invalid' | 'subprocess-start-failed' | 'subprocess-timeout' | 'subprocess-cancelled' | 'subprocess-output-limit' | 'subprocess-output-invalid' | 'subprocess-failed' | 'datasource-credential-ref-invalid' | 'datasource-credential-resolve-failed' | 'shell-credential-lease-invalid' | 'shell-credential-lease-expired' | 'shell-credential-lease-exhausted' | 'shell-credential-lease-scope-mismatch' | 'shell-credential-lease-resolve-failed' | 'shell-credential-injection-unsupported' | 'doctor-json-invalid' | 'doctor-admission-failed' | 'binding-identity-mismatch' | 'binding-failed';
|
|
2
2
|
/** Stable failure envelope for config, subprocess, doctor, and identity errors. */
|
|
3
3
|
export declare class MarivoEnvironmentError extends Error {
|
|
4
4
|
readonly code: EnvironmentFailureCode;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { SharedMarivoRuntime, SharedMarivoRuntimeConfig } from './types.ts';
|
|
2
2
|
export declare const SHARED_PYTHON_SPEC = "3.10";
|
|
3
3
|
export declare const SHARED_MARIVO_PACKAGE_SPEC: string;
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
4
|
+
export declare const PRESENTATION_KIT_DISTRIBUTION = "dsh-data-analysis-presentation-kit";
|
|
5
|
+
export declare const PRESENTATION_KIT_VERSION = "1.1.0";
|
|
6
|
+
export declare const PRESENTATION_KIT_PANDAS_RANGE = ">=2.2.0,<3.0.0";
|
|
7
|
+
export declare const PRESENTATION_KIT_WHEEL_FILENAME = "dsh_data_analysis_presentation_kit-1.1.0-py3-none-any.whl";
|
|
8
8
|
export declare const DEFAULT_SHARED_RUNTIME_INSTALL_TIMEOUT_MS = 600000;
|
|
9
9
|
interface RuntimeInstallOptions {
|
|
10
10
|
environment?: NodeJS.ProcessEnv;
|
|
11
11
|
waitIntervalMs?: number;
|
|
12
12
|
/** Test/build seam; production always resolves the wheel distributed beside the plugin. */
|
|
13
|
-
|
|
13
|
+
presentationKitWheelPath?: string;
|
|
14
14
|
}
|
|
15
15
|
/** Ensure and validate the one DSH-home-owned Marivo installation. */
|
|
16
16
|
export declare function ensureSharedMarivoRuntime(config?: SharedMarivoRuntimeConfig, options?: RuntimeInstallOptions): Promise<SharedMarivoRuntime>;
|
|
@@ -7,7 +7,8 @@ export interface MarivoEnvironmentConfig {
|
|
|
7
7
|
export interface SharedMarivoRuntimeConfig {
|
|
8
8
|
runtimeRoot?: string;
|
|
9
9
|
pythonExecutable?: string;
|
|
10
|
-
|
|
10
|
+
/** Absolute local Python for venv creation; defaults to python3 (Windows: python). */
|
|
11
|
+
bootstrapPythonExecutable?: string;
|
|
11
12
|
installTimeoutMs?: number;
|
|
12
13
|
}
|
|
13
14
|
/** Validated identity and stable skill root of the shared Marivo installation. */
|
|
@@ -16,8 +17,8 @@ export interface SharedMarivoRuntime {
|
|
|
16
17
|
pythonExecutable: string;
|
|
17
18
|
marivoVersion: string;
|
|
18
19
|
packagePath: string;
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
presentationKitVersion: string;
|
|
21
|
+
presentationKitPackagePath: string;
|
|
21
22
|
skillsRoot: string;
|
|
22
23
|
installationPath: string;
|
|
23
24
|
}
|
|
@@ -50,6 +51,11 @@ export interface MarivoEnvironmentBinding {
|
|
|
50
51
|
pythonExecutable: string;
|
|
51
52
|
marivoVersion: string;
|
|
52
53
|
packagePath: string;
|
|
54
|
+
/** Present only for bindings admitted through the shared presentation Runtime. */
|
|
55
|
+
presentationKit?: Readonly<{
|
|
56
|
+
version: string;
|
|
57
|
+
packagePath: string;
|
|
58
|
+
}>;
|
|
53
59
|
subprocessPolicyId: string;
|
|
54
60
|
fingerprint: string;
|
|
55
61
|
}
|
|
@@ -60,6 +66,8 @@ export interface SubprocessLimits {
|
|
|
60
66
|
terminateGraceMs: number;
|
|
61
67
|
}
|
|
62
68
|
export interface SubprocessRequest {
|
|
69
|
+
/** Host-only pipe input. Never part of argv or the environment. */
|
|
70
|
+
stdin?: string;
|
|
63
71
|
executable: string;
|
|
64
72
|
args: readonly string[];
|
|
65
73
|
/** Per-call environment values layered over the frozen binding snapshot. */
|
|
@@ -69,6 +77,10 @@ export interface SubprocessRequest {
|
|
|
69
77
|
}
|
|
70
78
|
/** One identity-checked Python operation executed by a bound Environment. */
|
|
71
79
|
export interface MarivoCheckedRunRequest {
|
|
80
|
+
/** Host-only pipe input; callers own its short operation lifetime. */
|
|
81
|
+
stdin?: string;
|
|
82
|
+
/** Values to redact from captured output, never passed through the environment. */
|
|
83
|
+
secretValues?: readonly string[];
|
|
72
84
|
program: string;
|
|
73
85
|
args?: readonly string[];
|
|
74
86
|
/** Per-operation values; every non-empty value is redacted from captured output. */
|
package/lib/types/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ export * from './compatibility.ts';
|
|
|
4
4
|
export * from './datasource/index.ts';
|
|
5
5
|
export * from './disclosure/index.ts';
|
|
6
6
|
export * from './environment/index.ts';
|
|
7
|
-
export * from './evidence/index.ts';
|
|
8
7
|
export type { Config as PluginConfig } from './plugin.ts';
|
|
9
8
|
export { apply, Config, inject, installMarivoPlugin, name } from './plugin.ts';
|
|
9
|
+
export * from './presentation/index.ts';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Tracks owned work, including work whose caller stopped waiting after cancellation. */
|
|
2
|
+
export declare class PendingTasks {
|
|
3
|
+
#private;
|
|
4
|
+
track<T>(task: Promise<T>): Promise<T>;
|
|
5
|
+
drain(): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
/** Start every stop synchronously, then await every cleanup even if another one fails. */
|
|
8
|
+
export declare function finishCleanup(actions: readonly (() => unknown)[]): Promise<void>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import { type MarivoPythonOptions } from './datasource/python-options.ts';
|
|
4
|
+
import { type CredentialStore, MarivoCredentialService } from './datasource/service.ts';
|
|
5
|
+
import type { MarivoHelpBridgeSource } from './disclosure/bridge.ts';
|
|
6
|
+
import { type MarivoDisclosureOptions } from './disclosure/index.ts';
|
|
7
|
+
import { MarivoEnvironment } from './environment/index.ts';
|
|
8
|
+
import type { ReportPublishingService } from './report-publishing/service.ts';
|
|
9
|
+
export type MarivoPluginEnvironmentResolver = (agent: Agent) => MarivoEnvironment | Promise<MarivoEnvironment>;
|
|
10
|
+
/**
|
|
11
|
+
* Install one already-bound environment into every live or subsequently published Agent scope.
|
|
12
|
+
* Installation is transactional for existing Agents and is disposed with the Cordis plugin.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createMarivoAgentInstallation(ctx: Context, environmentOrResolver: MarivoEnvironment | MarivoPluginEnvironmentResolver, options?: MarivoDisclosureOptions & MarivoPythonOptions & {
|
|
15
|
+
/** Override used by focused tests; normal plugin installation uses ctx.credentials. */
|
|
16
|
+
reportPublishing?: ReportPublishingService;
|
|
17
|
+
credentials?: CredentialStore;
|
|
18
|
+
credentialService?: MarivoCredentialService;
|
|
19
|
+
credentialInteraction?: 'web' | 'none';
|
|
20
|
+
/** Runtime-scoped Help source; normal plugin installation never binds Help to a Workspace. */
|
|
21
|
+
helpBridgeSource?: MarivoHelpBridgeSource;
|
|
22
|
+
}): {
|
|
23
|
+
install(): void;
|
|
24
|
+
close: () => Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
/** Stops synchronously; the returned Promise also waits for all owned work. */
|
|
27
|
+
export declare function installMarivoPlugin(...args: Parameters<typeof createMarivoAgentInstallation>): () => Promise<void>;
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,43 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ReportPublishingConfig } from './report-publishing/config.ts';
|
|
2
|
+
export { installMarivoPlugin, type MarivoPluginEnvironmentResolver } from './plugin-agents.ts';
|
|
3
|
+
export { resolvePresentationWorkspace } from './workspace-identity.ts';
|
|
2
4
|
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
-
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
4
|
-
import type { CredentialProvider } from '@deepseek-ai/dsh-credentials';
|
|
5
5
|
import z from '@deepseek-ai/schemastery';
|
|
6
|
-
import {
|
|
7
|
-
import { type
|
|
8
|
-
|
|
6
|
+
import type { DatasourceDefaults } from './datasource/defaults.ts';
|
|
7
|
+
import { type MarivoPythonOptions } from './datasource/python-options.ts';
|
|
8
|
+
export { MARIVO_DATASOURCE_CREDENTIAL_PROMPT } from './disclosure/execution-guidance.ts';
|
|
9
9
|
/** Cordis plugin name used by loader diagnostics and lifecycle logs. */
|
|
10
10
|
export declare const name = "dsh-data-analysis";
|
|
11
11
|
/** Services that must exist before the plugin binds and watches Agent scopes. */
|
|
12
12
|
export declare const inject: string[];
|
|
13
|
-
export declare const MARIVO_DATASOURCE_CREDENTIAL_PROMPT: string;
|
|
14
|
-
export declare const MARIVO_EVIDENCE_SOURCES_PROMPT: string;
|
|
15
|
-
export declare const MARIVO_REPORT_PROMPT: string;
|
|
16
13
|
/** Loader-safe configuration for the shared Runtime and per-Workspace bindings. */
|
|
17
|
-
export interface Config {
|
|
14
|
+
export interface Config extends MarivoPythonOptions {
|
|
15
|
+
readonly reportPublishing?: ReportPublishingConfig;
|
|
16
|
+
/** Non-secret creation defaults by backend; checked against each live Runtime schema. */
|
|
17
|
+
readonly datasourceDefaults?: DatasourceDefaults;
|
|
18
|
+
readonly credentialInteraction?: 'web' | 'none';
|
|
18
19
|
/** Explicit project root override; otherwise each Agent uses session.header.cwd. */
|
|
19
20
|
readonly projectRoot?: string;
|
|
20
21
|
/** Administrator-provided shared interpreter; must already contain an importable Marivo. */
|
|
21
22
|
readonly pythonExecutable?: string;
|
|
22
23
|
/** Shared Runtime root; defaults below $DSH_HOME. */
|
|
23
24
|
readonly runtimeRoot?: string;
|
|
24
|
-
/** Local
|
|
25
|
-
readonly
|
|
25
|
+
/** Local Python used to create the managed venv; an explicit value must be absolute. */
|
|
26
|
+
readonly bootstrapPythonExecutable?: string;
|
|
26
27
|
/** Maximum time for installation and lock acquisition. */
|
|
27
28
|
readonly installTimeoutMs?: number;
|
|
28
29
|
}
|
|
29
30
|
/** Cordis loader schema. Runtime defaults are resolved in {@link apply}. */
|
|
30
31
|
export declare const Config: z<Config>;
|
|
31
|
-
export type MarivoPluginEnvironmentResolver = (agent: Agent) => MarivoEnvironment | Promise<MarivoEnvironment>;
|
|
32
|
-
/**
|
|
33
|
-
* Install one already-bound environment into every live or subsequently published Agent scope.
|
|
34
|
-
* Installation is transactional for existing Agents and is disposed with the Cordis plugin.
|
|
35
|
-
*/
|
|
36
|
-
export declare function installMarivoPlugin(ctx: Context, environmentOrResolver: MarivoEnvironment | MarivoPluginEnvironmentResolver, options?: MarivoDisclosureOptions & {
|
|
37
|
-
/** Override used by focused tests; normal plugin installation uses ctx.credentials. */
|
|
38
|
-
credentials?: Pick<CredentialProvider, 'resolve'>;
|
|
39
|
-
/** Runtime-scoped Help source; normal plugin installation never binds Help to a Workspace. */
|
|
40
|
-
helpBridgeSource?: MarivoHelpBridgeSource;
|
|
41
|
-
}): () => void;
|
|
42
32
|
/** Ensure the shared Runtime once, mount its skills, then bind each Workspace lazily. */
|
|
43
|
-
export declare function apply(ctx: Context, config?: Config): Promise<() => void
|
|
33
|
+
export declare function apply(ctx: Context, config?: Config): Promise<() => Promise<void>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type PresentationAsset, type PresentationReceipt } from './contracts/index.ts';
|
|
2
|
+
/** Read a fixed, receipt-verified snapshot; never access analysis or current. */
|
|
3
|
+
export declare function readReceiptAsset(root: string, workspaceId: string, receipt: PresentationReceipt, asset: PresentationAsset, signal: AbortSignal): Promise<{
|
|
4
|
+
bytes: Buffer<ArrayBufferLike>;
|
|
5
|
+
sha256: string;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type PresentationDocument } from '../contracts/index.ts';
|
|
2
|
+
export interface BuiltPresentation {
|
|
3
|
+
document: PresentationDocument;
|
|
4
|
+
documentBytes: Buffer;
|
|
5
|
+
htmlBytes?: Buffer;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Render an S2 snapshot without reading source data, generating identity, or writing files.
|
|
9
|
+
* Both renderers are built into the installed package; execution needs no build tooling.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildPresentation(value: PresentationDocument): Promise<BuiltPresentation & {
|
|
12
|
+
htmlBytes: Buffer;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function buildPresentation(value: PresentationDocument, options: {
|
|
15
|
+
html?: boolean;
|
|
16
|
+
}): Promise<BuiltPresentation>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BuiltPresentation } from './build/index.ts';
|
|
2
|
+
import { type PresentationReceipt } from './contracts/index.ts';
|
|
3
|
+
/** Owns only one newly-created build. A single directory rename publishes all requested complete files. */
|
|
4
|
+
export declare function commitPresentation(workspaceRoot: string, input: BuiltPresentation, assertOwner: () => Promise<void>, signal?: AbortSignal): Promise<PresentationReceipt>;
|
|
@@ -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;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ChartType, type ChartView, type TypedDataset } from './types.ts';
|
|
2
|
+
export type { ChartBindings, ChartOptions, ChartType, ChartView } from './types.ts';
|
|
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
|
+
/** Strictly validates one binding. A containing block handles id/kind/preparedViews. */
|
|
5
|
+
export declare function parseChartViewShape(value: unknown, path?: string): asserts value is ChartView;
|
|
6
|
+
/** Exact source columns, including every auxiliary field used by geometry or tooltip. */
|
|
7
|
+
export declare function chartColumns(view: ChartView): string[];
|
|
8
|
+
/** Verifies supplied values only: never bins, ranks, accumulates, normalizes or sorts. */
|
|
9
|
+
export declare function validateChartView(view: ChartView, dataset: TypedDataset, path?: string, dataPath?: string, rowIndices?: readonly number[]): void;
|
|
10
|
+
/** Changes geometry only. Statistical views must be declared with prepared bindings. */
|
|
11
|
+
export declare function chartTransition(view: ChartView, chart: ChartType, dataset: TypedDataset): ChartView | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PresentationBlock, PresentationDocument } from './types.ts';
|
|
2
|
+
export interface PresentationEdits {
|
|
3
|
+
title: string;
|
|
4
|
+
blocks: PresentationBlock[];
|
|
5
|
+
}
|
|
6
|
+
export declare function presentationEdits(document: PresentationDocument): PresentationEdits;
|
|
7
|
+
/** Only presentation fields are accepted. Saved data, sources and captured code stay server-owned. */
|
|
8
|
+
export declare function applyPresentationEdits(base: PresentationDocument, value: unknown): PresentationDocument;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Cell, type DatasetColumn, type PresentationDocument, type PresentationDraft, type PresentationReceipt, type TypedDataset } from './types.ts';
|
|
2
|
+
export * from './charts.ts';
|
|
3
|
+
export * from './types.ts';
|
|
4
|
+
export * from './values.ts';
|
|
5
|
+
export declare function parsePresentationBuildId(value: unknown, path?: string): string;
|
|
6
|
+
export declare function parseTypedDataset(value: unknown, path?: string): TypedDataset;
|
|
7
|
+
/** Tables retain the original decimal/int64 spelling, including trailing decimal zeroes. */
|
|
8
|
+
export declare function formatCell(value: Cell, _column: DatasetColumn): string;
|
|
9
|
+
export declare function parsePresentationDraft(value: unknown): PresentationDraft;
|
|
10
|
+
export declare function parsePresentationDocument(value: unknown): PresentationDocument;
|
|
11
|
+
export declare function parsePresentationReceipt(value: unknown): PresentationReceipt;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PresentationBlock, PresentationDocument, PresentationInteraction } from './types.ts';
|
|
2
|
+
export declare function defaultSelection(interaction: PresentationInteraction): Record<string, string>;
|
|
3
|
+
export declare function selectedSlice(interaction: PresentationInteraction, selection: Record<string, string>): import("./types.ts").PresentationSlice;
|
|
4
|
+
export declare function interactionRows(interaction: PresentationInteraction | undefined, selection: Record<string, string>, block: PresentationBlock): number[] | undefined;
|
|
5
|
+
export declare function filterSummary(interaction: PresentationInteraction, selection: Record<string, string>): string;
|
|
6
|
+
/** Preserve the authored before / interactive / after boundary during host edits. */
|
|
7
|
+
export declare function blockRegion(document: PresentationDocument, id: string): number;
|
|
8
|
+
export declare function editedInteraction(document: PresentationDocument, blocks: PresentationBlock[]): PresentationInteraction | undefined;
|