@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
@@ -0,0 +1,53 @@
1
+ import type { JsonValue } from '@deepseek-ai/dsh-session';
2
+ import type { MarivoBridgeSource } from '../environment/source.ts';
3
+ import type { MarivoCheckedRunner, MarivoEnvironmentBinding } from '../environment/types.ts';
4
+ interface JsonObject {
5
+ [key: string]: JsonValue;
6
+ }
7
+ export interface MarivoDatasourceFailure extends JsonObject {
8
+ code: string;
9
+ exception_type: string;
10
+ backend_code: string | null;
11
+ backend_name: string | null;
12
+ message: string;
13
+ }
14
+ export interface MarivoDatasourceRepair extends JsonObject {
15
+ kind: string;
16
+ help_target: string;
17
+ action: string;
18
+ snippet: string | null;
19
+ candidates: string[];
20
+ preserves_evidence: boolean | null;
21
+ }
22
+ export interface MarivoDatasourceDescription {
23
+ name: string;
24
+ refs: string[];
25
+ }
26
+ export interface MarivoDatasourceTestResult {
27
+ name: string;
28
+ ok: boolean;
29
+ latency_ms: number | null;
30
+ failure: MarivoDatasourceFailure | null;
31
+ repair: MarivoDatasourceRepair | null;
32
+ }
33
+ export interface MarivoDatasourceBridgePort {
34
+ readonly binding: Readonly<MarivoEnvironmentBinding>;
35
+ describe(name: string, signal?: AbortSignal): Promise<MarivoDatasourceDescription>;
36
+ inventory(signal?: AbortSignal): Promise<MarivoDatasourceDescription[]>;
37
+ test(name: string, environmentOverlay: Readonly<NodeJS.ProcessEnv>, signal?: AbortSignal): Promise<MarivoDatasourceTestResult>;
38
+ }
39
+ export type MarivoDatasourceBridgeSource = MarivoBridgeSource<MarivoDatasourceBridgePort>;
40
+ export type MarivoDatasourceInventoryBridge = Pick<MarivoDatasourceBridgePort, 'inventory'>;
41
+ export type MarivoDatasourceInventoryBridgeSource = MarivoBridgeSource<MarivoDatasourceInventoryBridge>;
42
+ /** Identity-checked adapter for Marivo datasource metadata and connection tests. */
43
+ export declare class MarivoDatasourceBridge {
44
+ #private;
45
+ readonly binding: Readonly<MarivoEnvironmentBinding>;
46
+ constructor(runner: MarivoCheckedRunner);
47
+ describe(name: string, signal?: AbortSignal): Promise<MarivoDatasourceDescription>;
48
+ inventory(signal?: AbortSignal): Promise<MarivoDatasourceDescription[]>;
49
+ test(name: string, environmentOverlay: Readonly<NodeJS.ProcessEnv>, signal?: AbortSignal): Promise<MarivoDatasourceTestResult>;
50
+ }
51
+ export declare function resolveMarivoDatasourceBridge(source: MarivoDatasourceBridgeSource): Promise<MarivoDatasourceBridgePort>;
52
+ export declare function resolveMarivoDatasourceInventoryBridge(source: MarivoDatasourceInventoryBridgeSource): Promise<MarivoDatasourceInventoryBridge>;
53
+ export {};
@@ -0,0 +1,8 @@
1
+ export type { MarivoDatasourceAccessOptions, MarivoDatasourceAccessValue, } from './access.ts';
2
+ export { createMarivoDatasourceAccessTool, MARIVO_DATASOURCE_ACCESS_TOOL_NAME, registerMarivoDatasourceAccessTool, } from './access.ts';
3
+ export type { MarivoDatasourceBridgePort, MarivoDatasourceBridgeSource, MarivoDatasourceDescription, MarivoDatasourceFailure, MarivoDatasourceInventoryBridge, MarivoDatasourceInventoryBridgeSource, MarivoDatasourceRepair, MarivoDatasourceTestResult, } from './bridge.ts';
4
+ export { MarivoDatasourceBridge, resolveMarivoDatasourceBridge, resolveMarivoDatasourceInventoryBridge, } from './bridge.ts';
5
+ export type { MarivoShellLeaseReceipt } from './shell-env.ts';
6
+ export { assertMarivoCredentialReferences, DEFAULT_MARIVO_CREDENTIAL_LEASE_MAX_USES, DEFAULT_MARIVO_CREDENTIAL_LEASE_TTL_MS, MARIVO_CREDENTIAL_LEASE_PREFIX, MARIVO_CREDENTIAL_STORAGE_PREFIX, MarivoShellCredentialLeases, marivoCredentialStorageRef, } from './shell-env.ts';
7
+ export type { MarivoDatasourceTestOptions, MarivoDatasourceTestValue, } from './test.ts';
8
+ export { createMarivoDatasourceTestTool, MARIVO_DATASOURCE_TEST_TOOL_NAME, registerMarivoDatasourceTestTool, } from './test.ts';
@@ -0,0 +1,38 @@
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
+ 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
+ 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
+ /** Publish the exact shared interpreter as a non-secret, per-execution DSH fact. */
21
+ export declare function registerMarivoRuntimeShellEnvironment(ctx: Context, pythonExecutable: string): () => void;
22
+ /** Map one user-authored datasource environment reference to plugin-owned DSH storage. */
23
+ export declare function marivoCredentialStorageRef(ref: string): MarivoCredentialStorageRefName;
24
+ 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
+ export {};
@@ -0,0 +1,32 @@
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
+ import { type ToolDefinition } from '@deepseek-ai/dsh-tools';
5
+ import { type MarivoDatasourceBridgePort, type MarivoDatasourceBridgeSource, type MarivoDatasourceFailure, type MarivoDatasourceRepair } from './bridge.ts';
6
+ export declare const MARIVO_DATASOURCE_TEST_TOOL_NAME = "marivo_datasource_test";
7
+ interface JsonObject {
8
+ [key: string]: JsonValue;
9
+ }
10
+ export type MarivoDatasourceTestValue = ({
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 {};
@@ -0,0 +1,73 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { Agent } from '@deepseek-ai/dsh-agent';
3
+ import type { UserMessage } from '@deepseek-ai/dsh-session';
4
+ import type { ToolExecution, ToolExecutionResult } from '@deepseek-ai/dsh-tools';
5
+ import { type MarivoHelpBridgeSource, type MarivoHelpDelivery, type MarivoHelpDeliveryQuery, type MarivoHelpLimits } from './help.ts';
6
+ export declare const MARIVO_ROOT_HELP_TARGETS: Readonly<{
7
+ readonly 'marivo-analysis': "analysis";
8
+ readonly 'marivo-semantic': "authoring";
9
+ }>;
10
+ export type MarivoSkillName = keyof typeof MARIVO_ROOT_HELP_TARGETS;
11
+ export type MarivoRootHelpTarget = (typeof MARIVO_ROOT_HELP_TARGETS)[MarivoSkillName];
12
+ export interface MarivoDisclosureOptions {
13
+ helpLimits?: Partial<MarivoHelpLimits>;
14
+ }
15
+ export interface MarivoSkillActivationRecord {
16
+ skill: MarivoSkillName;
17
+ source: 'model' | 'user';
18
+ }
19
+ export interface MarivoRootHelpDisclosureRecord {
20
+ skill: MarivoSkillName;
21
+ target: MarivoRootHelpTarget;
22
+ environmentFingerprint: string;
23
+ bodyDigest: string;
24
+ delivery: MarivoHelpDelivery;
25
+ reason: 'activation' | 'recovery';
26
+ helpTextBytes: number;
27
+ latencyMs: number;
28
+ }
29
+ export interface MarivoDisclosureFailureRecord {
30
+ skills: MarivoSkillName[];
31
+ message: string;
32
+ }
33
+ export interface MarivoDisclosureTelemetry {
34
+ activations: MarivoSkillActivationRecord[];
35
+ rootHelp: MarivoRootHelpDisclosureRecord[];
36
+ failures: MarivoDisclosureFailureRecord[];
37
+ }
38
+ export interface MarivoDisclosureSource {
39
+ readonly kind: 'marivo-disclosure';
40
+ readonly form: 'root-help';
41
+ readonly skill: MarivoSkillName;
42
+ readonly target: MarivoRootHelpTarget;
43
+ readonly environmentFingerprint: string;
44
+ readonly bodyDigest: string;
45
+ readonly update?: true;
46
+ }
47
+ declare module '@deepseek-ai/dsh-llm' {
48
+ interface MessageSourceMap {
49
+ 'marivo-disclosure': MarivoDisclosureSource;
50
+ }
51
+ }
52
+ export declare class MarivoDisclosureError extends Error {
53
+ readonly code = "root-help-failed";
54
+ readonly skills: readonly MarivoSkillName[];
55
+ constructor(skills: readonly MarivoSkillName[], cause: unknown);
56
+ }
57
+ /** Per-Agent controller for skill-triggered, prompt-visible Marivo help disclosure. */
58
+ export declare class MarivoDisclosureController {
59
+ #private;
60
+ readonly agent: Agent;
61
+ readonly bridgeSource: MarivoHelpBridgeSource;
62
+ readonly options: Readonly<MarivoDisclosureOptions>;
63
+ constructor(agent: Agent, bridgeSource: MarivoHelpBridgeSource, options?: MarivoDisclosureOptions);
64
+ get activeSkills(): readonly MarivoSkillName[];
65
+ telemetry(): MarivoDisclosureTelemetry;
66
+ addDisposer(disposer: () => void): void;
67
+ observeToolResult(exec: Readonly<ToolExecution>, result: Readonly<ToolExecutionResult>): void;
68
+ resolveDelivery(query: Readonly<MarivoHelpDeliveryQuery>): MarivoHelpDelivery;
69
+ prepareStep(messages: readonly UserMessage[], signal: AbortSignal): Promise<UserMessage[]>;
70
+ dispose(): void;
71
+ }
72
+ /** Install skill-triggered Marivo live-help disclosure for one Agent scope. */
73
+ export declare function installMarivoDisclosure(_ctx: Context, agent: Agent, bridgeSource: MarivoHelpBridgeSource, options?: MarivoDisclosureOptions): MarivoDisclosureController;
@@ -0,0 +1,28 @@
1
+ import type { MarivoBridgeSource } from '../environment/source.ts';
2
+ import type { MarivoCheckedRunner, MarivoEnvironmentBinding } from '../environment/types.ts';
3
+ export interface MarivoHelpBridgeLimits {
4
+ timeoutMs: number;
5
+ stdoutMaxBytes: number;
6
+ stderrMaxBytes: number;
7
+ }
8
+ export interface MarivoHelpBridgePort {
9
+ readonly binding: Readonly<MarivoEnvironmentBinding>;
10
+ inventory(limits: Readonly<MarivoHelpBridgeLimits>, signal?: AbortSignal): Promise<Buffer>;
11
+ runTarget(target: string, limits: Readonly<MarivoHelpBridgeLimits>, signal?: AbortSignal): Promise<Buffer>;
12
+ }
13
+ export type MarivoHelpBridgeSource = MarivoBridgeSource<MarivoHelpBridgePort>;
14
+ export type MarivoHelpFailureCode = 'invalid-request' | 'target-failed' | 'empty-help' | 'combined-output-limit';
15
+ export declare class MarivoHelpError extends Error {
16
+ readonly code: MarivoHelpFailureCode;
17
+ readonly details: Readonly<Record<string, unknown>>;
18
+ constructor(code: MarivoHelpFailureCode, message: string, details?: Readonly<Record<string, unknown>>, options?: ErrorOptions);
19
+ }
20
+ /** Identity-checked adapter for the live Marivo Help surface. */
21
+ export declare class MarivoHelpBridge {
22
+ #private;
23
+ readonly binding: Readonly<MarivoEnvironmentBinding>;
24
+ constructor(runner: MarivoCheckedRunner);
25
+ runTarget(target: string, limits: Readonly<MarivoHelpBridgeLimits>, signal?: AbortSignal): Promise<Buffer>;
26
+ inventory(limits: Readonly<MarivoHelpBridgeLimits>, signal?: AbortSignal): Promise<Buffer>;
27
+ }
28
+ export declare function resolveMarivoHelpBridge(source: MarivoHelpBridgeSource): Promise<MarivoHelpBridgePort>;
@@ -0,0 +1,64 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import { type ToolDefinition } from '@deepseek-ai/dsh-tools';
3
+ import { type MarivoHelpBridgePort, type MarivoHelpBridgeSource } from './bridge.ts';
4
+ export type { MarivoHelpBridgePort, MarivoHelpBridgeSource, MarivoHelpFailureCode, } from './bridge.ts';
5
+ export { MarivoHelpError, resolveMarivoHelpBridge } from './bridge.ts';
6
+ export declare const MARIVO_HELP_TOOL_NAME = "marivo_help";
7
+ export interface MarivoHelpLimits {
8
+ maxTargets: number;
9
+ maxTargetChars: number;
10
+ maxTotalTargetChars: number;
11
+ targetTimeoutMs: number;
12
+ focusedStdoutMaxBytes: number;
13
+ inventoryStdoutMaxBytes: number;
14
+ stderrMaxBytes: number;
15
+ combinedStdoutMaxBytes: number;
16
+ toolTimeoutMs: number;
17
+ }
18
+ export declare const DEFAULT_MARIVO_HELP_LIMITS: Readonly<MarivoHelpLimits>;
19
+ export interface MarivoHelpTargetResult {
20
+ target: string;
21
+ body: string;
22
+ bodyDigest: string;
23
+ delivery: MarivoHelpDelivery;
24
+ }
25
+ export type MarivoHelpDelivery = 'delivered' | 'already-visible' | 'replacement';
26
+ export interface MarivoHelpDeliveryQuery {
27
+ environmentFingerprint: string;
28
+ target: string;
29
+ bodyDigest: string;
30
+ }
31
+ export type MarivoHelpDeliveryResolver = (query: Readonly<MarivoHelpDeliveryQuery>) => MarivoHelpDelivery;
32
+ export interface MarivoHelpValue {
33
+ environment: {
34
+ version: string;
35
+ fingerprint: string;
36
+ };
37
+ targets: MarivoHelpTargetResult[];
38
+ }
39
+ export interface MarivoHelpToolValue {
40
+ environment: {
41
+ version: string;
42
+ };
43
+ targets: MarivoHelpTargetResult[];
44
+ }
45
+ export declare function resolveMarivoHelpLimits(overrides?: Partial<MarivoHelpLimits>): Readonly<MarivoHelpLimits>;
46
+ /** Validate only mechanical resource boundaries and deduplicate in first-seen order. */
47
+ export declare function normalizeHelpTargets(input: unknown, limits: Readonly<MarivoHelpLimits>): string[];
48
+ /** Read the current raw canonical inventory without parsing or caching it. */
49
+ export declare function loadTargetInventory(bridge: MarivoHelpBridgePort, options?: {
50
+ limits?: Partial<MarivoHelpLimits>;
51
+ signal?: AbortSignal;
52
+ }): Promise<string>;
53
+ export declare function marivoHelpBodyDigest(body: string): string;
54
+ export declare function renderMarivoHelpValue(value: MarivoHelpToolValue): string;
55
+ /** Read one all-or-nothing batch from the bound live Marivo help surface. */
56
+ export declare function readMarivoHelpTargets(bridge: MarivoHelpBridgePort, rawTargets: unknown, options?: {
57
+ limits?: Partial<MarivoHelpLimits>;
58
+ signal?: AbortSignal;
59
+ resolveDelivery?: MarivoHelpDeliveryResolver;
60
+ }): Promise<MarivoHelpValue>;
61
+ /** Build the native Harness ToolDefinition without registering Agent activation behavior. */
62
+ export declare function createMarivoHelpTool(bridgeSource: MarivoHelpBridgeSource, limitOverrides?: Partial<MarivoHelpLimits>, resolveDelivery?: MarivoHelpDeliveryResolver): ToolDefinition;
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;
@@ -0,0 +1,5 @@
1
+ export type { MarivoDisclosureFailureRecord, MarivoDisclosureOptions, MarivoDisclosureSource, MarivoDisclosureTelemetry, MarivoRootHelpDisclosureRecord, MarivoRootHelpTarget, MarivoSkillActivationRecord, MarivoSkillName, } from './activation.ts';
2
+ export { installMarivoDisclosure, MARIVO_ROOT_HELP_TARGETS, MarivoDisclosureController, MarivoDisclosureError, } from './activation.ts';
3
+ export { MarivoHelpBridge } from './bridge.ts';
4
+ export type { MarivoHelpBridgePort, MarivoHelpBridgeSource, MarivoHelpDelivery, MarivoHelpDeliveryQuery, MarivoHelpDeliveryResolver, MarivoHelpFailureCode, MarivoHelpLimits, MarivoHelpTargetResult, MarivoHelpValue, } from './help.ts';
5
+ export { createMarivoHelpTool, DEFAULT_MARIVO_HELP_LIMITS, loadTargetInventory, MARIVO_HELP_TOOL_NAME, MarivoHelpError, marivoHelpBodyDigest, normalizeHelpTargets, readMarivoHelpTargets, registerMarivoHelpTool, renderMarivoHelpValue, resolveMarivoHelpBridge, resolveMarivoHelpLimits, } from './help.ts';
@@ -0,0 +1,26 @@
1
+ import { FixedSubprocessPolicy } from './subprocess.ts';
2
+ import type { ImportIdentity, MarivoCheckedRunRequest, MarivoEnvironmentBinding, MarivoEnvironmentConfig, SharedMarivoRuntime } from './types.ts';
3
+ /** A ready binding and the single frozen subprocess policy that established it. */
4
+ export declare class MarivoEnvironment {
5
+ #private;
6
+ readonly binding: Readonly<MarivoEnvironmentBinding>;
7
+ readonly subprocessPolicy: FixedSubprocessPolicy;
8
+ constructor(binding: MarivoEnvironmentBinding, subprocessPolicy: FixedSubprocessPolicy);
9
+ get status(): 'ready' | 'failed';
10
+ /**
11
+ * Execute one Python program after checking the bound import identity in the same process.
12
+ * Identity mismatch permanently fails this binding; ordinary program failures do not.
13
+ */
14
+ runChecked(request: MarivoCheckedRunRequest): Promise<import("./types.ts").SubprocessResult>;
15
+ /** Recheck and return the exact bound import identity. */
16
+ assertImportIdentity(signal?: AbortSignal): Promise<ImportIdentity>;
17
+ }
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?: {
20
+ environment?: NodeJS.ProcessEnv;
21
+ }): MarivoEnvironment;
22
+ /** Resolve, probe, and establish one Marivo Environment Binding. */
23
+ export declare function bindMarivoEnvironment(config: MarivoEnvironmentConfig, options?: {
24
+ environment?: NodeJS.ProcessEnv;
25
+ signal?: AbortSignal;
26
+ }): Promise<MarivoEnvironment>;
@@ -0,0 +1,8 @@
1
+ import type { DoctorReport } from './types.ts';
2
+ /** Parse the complete doctor stdout. Non-zero process exit is deliberately handled elsewhere. */
3
+ export declare function parseDoctorReport(stdout: Buffer): DoctorReport;
4
+ /**
5
+ * Validate disclosure-specific admission checks without treating the top-level doctor status as
6
+ * an admission decision.
7
+ */
8
+ export declare function admitDoctorReport(report: DoctorReport, expectedProjectRoot: string, expectedPythonExecutable: string): void;
@@ -0,0 +1,7 @@
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-report-kit-unsupported' | 'shared-runtime-report-kit-wheel-invalid' | 'shared-runtime-report-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
+ /** Stable failure envelope for config, subprocess, doctor, and identity errors. */
3
+ export declare class MarivoEnvironmentError extends Error {
4
+ readonly code: EnvironmentFailureCode;
5
+ readonly details: Readonly<Record<string, unknown>>;
6
+ constructor(code: EnvironmentFailureCode, message: string, details?: Readonly<Record<string, unknown>>, options?: ErrorOptions);
7
+ }
@@ -0,0 +1,9 @@
1
+ export { bindMarivoEnvironment, createSharedMarivoRuntimeRunner, MarivoEnvironment, } from './binding.ts';
2
+ export { admitDoctorReport, parseDoctorReport } from './doctor.ts';
3
+ export { MarivoEnvironmentError } from './errors.ts';
4
+ export { DEFAULT_SHARED_RUNTIME_INSTALL_TIMEOUT_MS, ensureSharedMarivoRuntime, SHARED_MARIVO_PACKAGE_SPEC, SHARED_PYTHON_SPEC, } from './runtime.ts';
5
+ export type { MarivoBridgeSource, MarivoEnvironmentSource } from './source.ts';
6
+ export { resolveMarivoBridgeSource, resolveMarivoEnvironmentSource, } from './source.ts';
7
+ export { DEFAULT_SUBPROCESS_LIMITS, FixedSubprocessPolicy, MARIVO_PERSIST_CREDENTIALS_DISABLED, MARIVO_PERSIST_CREDENTIALS_ENV, SUBPROCESS_POLICY_ID, } from './subprocess.ts';
8
+ export type { DoctorCheck, DoctorOverallStatus, DoctorReport, DoctorSection, DoctorStatus, ImportIdentity, MarivoCheckedRunner, MarivoCheckedRunRequest, MarivoEnvironmentBinding, MarivoEnvironmentConfig, SharedMarivoRuntime, SharedMarivoRuntimeConfig, SubprocessLimits, SubprocessRequest, SubprocessResult, } from './types.ts';
9
+ export { MarivoWorkspaceEnvironmentManager } from './workspace.ts';
@@ -0,0 +1,17 @@
1
+ import type { SharedMarivoRuntime, SharedMarivoRuntimeConfig } from './types.ts';
2
+ export declare const SHARED_PYTHON_SPEC = "3.10";
3
+ export declare const SHARED_MARIVO_PACKAGE_SPEC: string;
4
+ export declare const REPORT_KIT_DISTRIBUTION = "dsh-data-analysis-report-kit";
5
+ export declare const REPORT_KIT_VERSION = "3.0.0";
6
+ export declare const REPORT_KIT_PANDAS_RANGE = ">=2.2.0,<3.0.0";
7
+ export declare const REPORT_KIT_WHEEL_FILENAME = "dsh_data_analysis_report_kit-3.0.0-py3-none-any.whl";
8
+ export declare const DEFAULT_SHARED_RUNTIME_INSTALL_TIMEOUT_MS = 600000;
9
+ interface RuntimeInstallOptions {
10
+ environment?: NodeJS.ProcessEnv;
11
+ waitIntervalMs?: number;
12
+ /** Test/build seam; production always resolves the wheel distributed beside the plugin. */
13
+ reportKitWheelPath?: string;
14
+ }
15
+ /** Ensure and validate the one DSH-home-owned Marivo installation. */
16
+ export declare function ensureSharedMarivoRuntime(config?: SharedMarivoRuntimeConfig, options?: RuntimeInstallOptions): Promise<SharedMarivoRuntime>;
17
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { MarivoEnvironment } from './binding.ts';
2
+ /** A fixed binding or a lazy per-Agent/per-Workspace binding. */
3
+ export type MarivoEnvironmentSource = MarivoEnvironment | (() => Promise<MarivoEnvironment>);
4
+ /** A fixed domain adapter or a lazy adapter backed by a Workspace Environment. */
5
+ export type MarivoBridgeSource<T> = T | (() => Promise<T>);
6
+ export declare function resolveMarivoEnvironmentSource(source: MarivoEnvironmentSource): Promise<MarivoEnvironment>;
7
+ export declare function resolveMarivoBridgeSource<T>(source: MarivoBridgeSource<T>): Promise<T>;
@@ -0,0 +1,19 @@
1
+ import type { SubprocessLimits, SubprocessRequest, SubprocessResult } from './types.ts';
2
+ export declare const SUBPROCESS_POLICY_ID: "direct-argv-inherited-env-snapshot-overlay-v2";
3
+ export declare const MARIVO_PERSIST_CREDENTIALS_ENV = "MARIVO_PERSIST_CREDENTIALS";
4
+ export declare const MARIVO_PERSIST_CREDENTIALS_DISABLED = "0";
5
+ export declare const DEFAULT_SUBPROCESS_LIMITS: Readonly<SubprocessLimits>;
6
+ /**
7
+ * Direct-argv subprocess runner shared by doctor, inventory, and focused help.
8
+ *
9
+ * The policy captures cwd and the environment projection once. Calls never use a shell. On
10
+ * POSIX, detached children form a process group so timeout, cancellation, and output overflow
11
+ * terminate the whole group.
12
+ */
13
+ export declare class FixedSubprocessPolicy {
14
+ #private;
15
+ readonly id: "direct-argv-inherited-env-snapshot-overlay-v2";
16
+ readonly cwd: string;
17
+ constructor(cwd: string, environment?: NodeJS.ProcessEnv);
18
+ run(request: SubprocessRequest): Promise<SubprocessResult>;
19
+ }
@@ -0,0 +1,96 @@
1
+ /** Configuration accepted by the MVP environment resolver. */
2
+ export interface MarivoEnvironmentConfig {
3
+ projectRoot: string;
4
+ pythonExecutable?: string;
5
+ }
6
+ /** Configuration for the one DSH-home-owned Marivo runtime shared by every Workspace. */
7
+ export interface SharedMarivoRuntimeConfig {
8
+ runtimeRoot?: string;
9
+ pythonExecutable?: string;
10
+ uvExecutable?: string;
11
+ installTimeoutMs?: number;
12
+ }
13
+ /** Validated identity and stable skill root of the shared Marivo installation. */
14
+ export interface SharedMarivoRuntime {
15
+ runtimeRoot: string;
16
+ pythonExecutable: string;
17
+ marivoVersion: string;
18
+ packagePath: string;
19
+ reportKitVersion: string;
20
+ reportKitPackagePath: string;
21
+ skillsRoot: string;
22
+ installationPath: string;
23
+ }
24
+ export type DoctorStatus = 'ok' | 'info' | 'warning' | 'fail' | 'skipped';
25
+ export type DoctorOverallStatus = 'ok' | 'warning' | 'fail';
26
+ export interface DoctorCheck {
27
+ id: string;
28
+ status: DoctorStatus;
29
+ summary: string;
30
+ details?: Record<string, unknown>;
31
+ }
32
+ export interface DoctorSection {
33
+ id: string;
34
+ status: DoctorStatus;
35
+ checks: DoctorCheck[];
36
+ }
37
+ export interface DoctorReport {
38
+ status: DoctorOverallStatus;
39
+ project_root: string;
40
+ python_executable: string;
41
+ marivo: {
42
+ version: string;
43
+ package_path: string;
44
+ };
45
+ sections: DoctorSection[];
46
+ }
47
+ /** Stable, non-secret identity retained by a successful binding. */
48
+ export interface MarivoEnvironmentBinding {
49
+ projectRoot: string;
50
+ pythonExecutable: string;
51
+ marivoVersion: string;
52
+ packagePath: string;
53
+ subprocessPolicyId: string;
54
+ fingerprint: string;
55
+ }
56
+ export interface SubprocessLimits {
57
+ timeoutMs: number;
58
+ stdoutMaxBytes: number;
59
+ stderrMaxBytes: number;
60
+ terminateGraceMs: number;
61
+ }
62
+ export interface SubprocessRequest {
63
+ executable: string;
64
+ args: readonly string[];
65
+ /** Per-call environment values layered over the frozen binding snapshot. */
66
+ environmentOverlay?: Readonly<NodeJS.ProcessEnv>;
67
+ limits?: Partial<SubprocessLimits>;
68
+ signal?: AbortSignal;
69
+ }
70
+ /** One identity-checked Python operation executed by a bound Environment. */
71
+ export interface MarivoCheckedRunRequest {
72
+ program: string;
73
+ args?: readonly string[];
74
+ /** Per-operation values; every non-empty value is redacted from captured output. */
75
+ environmentOverlay?: Readonly<NodeJS.ProcessEnv>;
76
+ limits?: Partial<SubprocessLimits>;
77
+ signal?: AbortSignal;
78
+ }
79
+ export interface SubprocessResult {
80
+ exitCode: number | null;
81
+ signal: NodeJS.Signals | null;
82
+ stdout: Buffer;
83
+ stderr: Buffer;
84
+ durationMs: number;
85
+ }
86
+ export interface ImportIdentity {
87
+ pythonExecutable: string;
88
+ marivoVersion: string;
89
+ packagePath: string;
90
+ }
91
+ /** Narrow execution contract consumed by domain bridge adapters. */
92
+ export interface MarivoCheckedRunner {
93
+ readonly binding: Readonly<MarivoEnvironmentBinding>;
94
+ readonly status: 'ready' | 'failed';
95
+ runChecked(request: MarivoCheckedRunRequest): Promise<SubprocessResult>;
96
+ }
@@ -0,0 +1,10 @@
1
+ import { type MarivoEnvironment } from './binding.ts';
2
+ import type { SharedMarivoRuntime } from './types.ts';
3
+ /** Cache one zero-init Workspace binding while retaining project-specific doctor state. */
4
+ export declare class MarivoWorkspaceEnvironmentManager {
5
+ #private;
6
+ readonly runtime: SharedMarivoRuntime;
7
+ constructor(runtime: SharedMarivoRuntime);
8
+ resolve(projectRoot: string): Promise<MarivoEnvironment>;
9
+ dispose(): void;
10
+ }
@@ -0,0 +1,40 @@
1
+ import type { MarivoBridgeSource } from '../environment/source.ts';
2
+ import type { MarivoCheckedRunner, MarivoEnvironmentBinding } from '../environment/types.ts';
3
+ export interface MarivoFindingProjection {
4
+ status: 'available' | 'missing' | 'unsupported';
5
+ title: string;
6
+ locator: string;
7
+ excerpt: string | null;
8
+ truncated: boolean;
9
+ findingId: string;
10
+ findingType: string | null;
11
+ epistemicKind: string | null;
12
+ artifactRef: string;
13
+ sessionId: string;
14
+ canonicalItemKey: string | null;
15
+ committedAt: string | null;
16
+ sourceRefs: string[];
17
+ revalidation: {
18
+ status: string;
19
+ semanticStatus: string | null;
20
+ evidenceStatus: string | null;
21
+ dependencyStatus: string | null;
22
+ } | null;
23
+ }
24
+ export interface MarivoFindingSelection {
25
+ artifactRef: string;
26
+ findingId: string;
27
+ }
28
+ export interface MarivoEvidenceBridgePort {
29
+ readonly binding: Readonly<Pick<MarivoEnvironmentBinding, 'fingerprint' | 'marivoVersion'>>;
30
+ findings(sessionId: string, selections: readonly MarivoFindingSelection[], signal?: AbortSignal): Promise<MarivoFindingProjection[]>;
31
+ }
32
+ export type MarivoEvidenceBridgeSource = MarivoBridgeSource<MarivoEvidenceBridgePort>;
33
+ /** Identity-checked adapter for exact persisted Marivo Findings. */
34
+ export declare class MarivoEvidenceBridge {
35
+ #private;
36
+ readonly binding: Readonly<MarivoEnvironmentBinding>;
37
+ constructor(runner: MarivoCheckedRunner);
38
+ findings(sessionId: string, selections: readonly MarivoFindingSelection[], signal?: AbortSignal): Promise<MarivoFindingProjection[]>;
39
+ }
40
+ export declare function resolveMarivoEvidenceBridge(source: MarivoEvidenceBridgeSource): Promise<MarivoEvidenceBridgePort>;
@@ -0,0 +1,4 @@
1
+ export type { MarivoEvidenceBridgePort, MarivoEvidenceBridgeSource, MarivoFindingProjection, MarivoFindingSelection, } from './bridge.ts';
2
+ export { MarivoEvidenceBridge, resolveMarivoEvidenceBridge, } from './bridge.ts';
3
+ export type { MarivoEvidenceSource, MarivoEvidenceSourcesMeta, MarivoEvidenceSourcesValue, } from './sources.ts';
4
+ export { createMarivoEvidenceSourcesTool, evidenceSourcesMeta, installMarivoEvidenceSourcesCodeDelivery, MARIVO_EVIDENCE_SOURCES_DURABLE_CONTENT_KIND, MARIVO_EVIDENCE_SOURCES_MAX_PER_CALL, MARIVO_EVIDENCE_SOURCES_META_KIND, MARIVO_EVIDENCE_SOURCES_META_VERSION, MARIVO_EVIDENCE_SOURCES_TOOL_NAME, registerMarivoEvidenceSourcesTool, } from './sources.ts';
@@ -0,0 +1,57 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { JsonValue, Session } from '@deepseek-ai/dsh-session';
3
+ import { type ToolDefinition } from '@deepseek-ai/dsh-tools';
4
+ import { type MarivoEvidenceBridgeSource } from './bridge.ts';
5
+ export declare const MARIVO_EVIDENCE_SOURCES_TOOL_NAME = "marivo_evidence_sources";
6
+ export declare const MARIVO_EVIDENCE_SOURCES_META_KIND = "marivo-evidence-sources";
7
+ export declare const MARIVO_EVIDENCE_SOURCES_META_VERSION = 2;
8
+ export declare const MARIVO_EVIDENCE_SOURCES_DURABLE_CONTENT_KIND = "marivo-evidence-sources-card";
9
+ export declare const MARIVO_EVIDENCE_SOURCES_MAX_PER_CALL = 20;
10
+ export interface MarivoEvidenceSource {
11
+ [key: string]: JsonValue;
12
+ status: 'available' | 'missing' | 'unsupported';
13
+ title: string;
14
+ locator: string;
15
+ excerpt: string | null;
16
+ truncated: boolean;
17
+ environmentFingerprint: string;
18
+ sessionId: string;
19
+ findingId: string;
20
+ findingType: string | null;
21
+ epistemicKind: string | null;
22
+ artifactRef: string;
23
+ canonicalItemKey: string | null;
24
+ committedAt: string | null;
25
+ sourceRefs: string[];
26
+ revalidation: {
27
+ [key: string]: JsonValue;
28
+ status: string;
29
+ semanticStatus: string | null;
30
+ evidenceStatus: string | null;
31
+ dependencyStatus: string | null;
32
+ } | null;
33
+ }
34
+ export interface MarivoEvidenceSourcesValue {
35
+ [key: string]: JsonValue;
36
+ status: 'ok';
37
+ environment: {
38
+ version: string;
39
+ fingerprint: string;
40
+ };
41
+ dshSessionId: string;
42
+ sessionId: string;
43
+ sources: MarivoEvidenceSource[];
44
+ }
45
+ export interface MarivoEvidenceSourcesMeta {
46
+ [key: string]: JsonValue;
47
+ kind: typeof MARIVO_EVIDENCE_SOURCES_META_KIND;
48
+ version: typeof MARIVO_EVIDENCE_SOURCES_META_VERSION;
49
+ dshSessionId: string;
50
+ sources: MarivoEvidenceSource[];
51
+ }
52
+ export declare function evidenceSourcesMeta(value: MarivoEvidenceSourcesValue): MarivoEvidenceSourcesMeta;
53
+ /** Build the exact-Finding source attachment Tool for one Agent and DSH Session. */
54
+ export declare function createMarivoEvidenceSourcesTool(bridgeSource: MarivoEvidenceBridgeSource, session: Session): ToolDefinition;
55
+ export declare function registerMarivoEvidenceSourcesTool(ctx: Context, bridgeSource: MarivoEvidenceBridgeSource, session: Session): () => void;
56
+ /** Preserve nested Code Mode source metadata on the durable sub-dispatch event. */
57
+ export declare function installMarivoEvidenceSourcesCodeDelivery(ctx: Context): () => void;
@@ -0,0 +1,9 @@
1
+ export type { MarivoBridgeSet } from './bridges.ts';
2
+ export { createMarivoBridgeSet } from './bridges.ts';
3
+ export * from './compatibility.ts';
4
+ export * from './datasource/index.ts';
5
+ export * from './disclosure/index.ts';
6
+ export * from './environment/index.ts';
7
+ export * from './evidence/index.ts';
8
+ export type { Config as PluginConfig } from './plugin.ts';
9
+ export { apply, Config, inject, installMarivoPlugin, name } from './plugin.ts';