@xpert-ai/plugin-sdk 3.23.0 → 3.23.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 (55) hide show
  1. package/_object_without_properties_loose.cjs.js +16 -0
  2. package/_object_without_properties_loose.esm.js +14 -0
  3. package/analytics-result.cjs.js +212 -0
  4. package/analytics-result.esm.js +201 -0
  5. package/analytics.cjs.default.js +1 -0
  6. package/analytics.cjs.js +17 -0
  7. package/analytics.cjs.mjs +2 -0
  8. package/analytics.d.ts +1 -0
  9. package/analytics.esm.js +2 -0
  10. package/artifact-document.cjs.default.js +1 -0
  11. package/artifact-document.cjs.js +581 -0
  12. package/artifact-document.cjs.mjs +2 -0
  13. package/artifact-document.d.ts +1 -0
  14. package/artifact-document.esm.js +563 -0
  15. package/data-workbench.cjs.js +23 -6
  16. package/data-workbench.esm.js +23 -6
  17. package/docs/analytics.md +66 -0
  18. package/docs/artifact-documents.md +74 -0
  19. package/docs/artifact-drafts.md +24 -0
  20. package/docs/json-encoded-schema.md +19 -0
  21. package/docs/workspace-dataset-pipelines.md +120 -0
  22. package/docs/workspace-file-tools.md +60 -0
  23. package/index.cjs.js +84 -19
  24. package/index.esm.js +127 -82
  25. package/model-provider-toolset.cjs.js +1 -1
  26. package/model-provider-toolset.esm.js +1 -1
  27. package/model-provider.cjs.js +37 -1
  28. package/model-provider.esm.js +33 -2
  29. package/package.json +14 -2
  30. package/src/analytics.d.ts +3 -0
  31. package/src/artifact-document.d.ts +5 -0
  32. package/src/lib/agent/handoff/agent-runtime-message.contract.d.ts +10 -10
  33. package/src/lib/artifact-document/dependencies.d.ts +101 -0
  34. package/src/lib/artifact-document/host.d.ts +30 -0
  35. package/src/lib/artifact-document/protocol.d.ts +60 -0
  36. package/src/lib/artifact-document/runtime.d.ts +4 -0
  37. package/src/lib/artifact-document/sha256.d.ts +2 -0
  38. package/src/lib/core/index.d.ts +1 -0
  39. package/src/lib/core/json-encoded-schema.d.ts +15 -0
  40. package/src/lib/data/analytics/analytics-provider.d.ts +74 -0
  41. package/src/lib/data/analytics/analytics-result.d.ts +4 -0
  42. package/src/lib/data/analytics/analytics.registry.d.ts +10 -0
  43. package/src/lib/data/analytics/analytics.schema.d.ts +206 -0
  44. package/src/lib/data/analytics/index.d.ts +4 -0
  45. package/src/lib/data/datasource/index.d.ts +1 -0
  46. package/src/lib/data/datasource/workbench-adapter.d.ts +11 -1
  47. package/src/lib/data/datasource/workbench-sql.d.ts +12 -0
  48. package/src/lib/runtime/capabilities/artifact-drafts.d.ts +29 -0
  49. package/src/lib/runtime/capabilities/artifacts.d.ts +10 -0
  50. package/src/lib/runtime/capabilities/index.d.ts +1 -0
  51. package/src/lib/runtime/capabilities/sandbox-jobs.d.ts +36 -2
  52. package/src/lib/runtime/index.d.ts +2 -0
  53. package/src/lib/runtime/mutation-evidence.d.ts +7 -0
  54. package/src/lib/runtime/workspace-file-tools.d.ts +11 -0
  55. package/src/lib/sandbox/runtime-provider.d.ts +4 -0
@@ -0,0 +1,206 @@
1
+ import { z } from 'zod/v3';
2
+ import type { AnalyticsBinding, AnalyticsQueryRequest, AnalyticsDiscoveryRequest, AnalyticsDiscoveryResult, JSONValue } from '@xpert-ai/contracts';
3
+ export declare const analyticsOptionsSchema: z.ZodRecord<z.ZodString, z.ZodType<JSONValue, z.ZodTypeDef, JSONValue>>;
4
+ export declare const analyticsFieldSchema: z.ZodObject<{
5
+ id: z.ZodString;
6
+ sourceField: z.ZodString;
7
+ label: z.ZodString;
8
+ logicalType: z.ZodEnum<["string", "boolean", "int64", "float64", "decimal", "date", "timestamp"]>;
9
+ nullable: z.ZodBoolean;
10
+ role: z.ZodEnum<["dimension", "measure", "time", "identifier"]>;
11
+ semanticRef: z.ZodOptional<z.ZodString>;
12
+ unit: z.ZodOptional<z.ZodString>;
13
+ }, "strict", z.ZodTypeAny, {
14
+ id?: string;
15
+ sourceField?: string;
16
+ label?: string;
17
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
18
+ nullable?: boolean;
19
+ role?: "dimension" | "measure" | "time" | "identifier";
20
+ semanticRef?: string;
21
+ unit?: string;
22
+ }, {
23
+ id?: string;
24
+ sourceField?: string;
25
+ label?: string;
26
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
27
+ nullable?: boolean;
28
+ role?: "dimension" | "measure" | "time" | "identifier";
29
+ semanticRef?: string;
30
+ unit?: string;
31
+ }>;
32
+ export declare const analyticsParameterSchema: z.ZodObject<{
33
+ name: z.ZodString;
34
+ controlId: z.ZodString;
35
+ type: z.ZodEnum<["string", "number", "boolean", "date"]>;
36
+ required: z.ZodBoolean;
37
+ defaultValue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
38
+ allowedValues: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">>;
39
+ }, "strict", z.ZodTypeAny, {
40
+ type?: "string" | "number" | "boolean" | "date";
41
+ name?: string;
42
+ controlId?: string;
43
+ required?: boolean;
44
+ defaultValue?: string | number | boolean;
45
+ allowedValues?: (string | number | boolean)[];
46
+ }, {
47
+ type?: "string" | "number" | "boolean" | "date";
48
+ name?: string;
49
+ controlId?: string;
50
+ required?: boolean;
51
+ defaultValue?: string | number | boolean;
52
+ allowedValues?: (string | number | boolean)[];
53
+ }>;
54
+ export declare const analyticsBindingObjectSchema: z.ZodObject<{
55
+ schemaVersion: z.ZodLiteral<1>;
56
+ id: z.ZodString;
57
+ dataSourceId: z.ZodString;
58
+ providerId: z.ZodString;
59
+ operation: z.ZodString;
60
+ contractVersion: z.ZodNumber;
61
+ payload: z.ZodType<JSONValue, z.ZodTypeDef, JSONValue>;
62
+ parameters: z.ZodArray<z.ZodObject<{
63
+ name: z.ZodString;
64
+ controlId: z.ZodString;
65
+ type: z.ZodEnum<["string", "number", "boolean", "date"]>;
66
+ required: z.ZodBoolean;
67
+ defaultValue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
68
+ allowedValues: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">>;
69
+ }, "strict", z.ZodTypeAny, {
70
+ type?: "string" | "number" | "boolean" | "date";
71
+ name?: string;
72
+ controlId?: string;
73
+ required?: boolean;
74
+ defaultValue?: string | number | boolean;
75
+ allowedValues?: (string | number | boolean)[];
76
+ }, {
77
+ type?: "string" | "number" | "boolean" | "date";
78
+ name?: string;
79
+ controlId?: string;
80
+ required?: boolean;
81
+ defaultValue?: string | number | boolean;
82
+ allowedValues?: (string | number | boolean)[];
83
+ }>, "many">;
84
+ output: z.ZodObject<{
85
+ datasetId: z.ZodString;
86
+ fields: z.ZodArray<z.ZodObject<{
87
+ id: z.ZodString;
88
+ sourceField: z.ZodString;
89
+ label: z.ZodString;
90
+ logicalType: z.ZodEnum<["string", "boolean", "int64", "float64", "decimal", "date", "timestamp"]>;
91
+ nullable: z.ZodBoolean;
92
+ role: z.ZodEnum<["dimension", "measure", "time", "identifier"]>;
93
+ semanticRef: z.ZodOptional<z.ZodString>;
94
+ unit: z.ZodOptional<z.ZodString>;
95
+ }, "strict", z.ZodTypeAny, {
96
+ id?: string;
97
+ sourceField?: string;
98
+ label?: string;
99
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
100
+ nullable?: boolean;
101
+ role?: "dimension" | "measure" | "time" | "identifier";
102
+ semanticRef?: string;
103
+ unit?: string;
104
+ }, {
105
+ id?: string;
106
+ sourceField?: string;
107
+ label?: string;
108
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
109
+ nullable?: boolean;
110
+ role?: "dimension" | "measure" | "time" | "identifier";
111
+ semanticRef?: string;
112
+ unit?: string;
113
+ }>, "many">;
114
+ grain: z.ZodArray<z.ZodString, "many">;
115
+ }, "strict", z.ZodTypeAny, {
116
+ datasetId?: string;
117
+ fields?: {
118
+ id?: string;
119
+ sourceField?: string;
120
+ label?: string;
121
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
122
+ nullable?: boolean;
123
+ role?: "dimension" | "measure" | "time" | "identifier";
124
+ semanticRef?: string;
125
+ unit?: string;
126
+ }[];
127
+ grain?: string[];
128
+ }, {
129
+ datasetId?: string;
130
+ fields?: {
131
+ id?: string;
132
+ sourceField?: string;
133
+ label?: string;
134
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
135
+ nullable?: boolean;
136
+ role?: "dimension" | "measure" | "time" | "identifier";
137
+ semanticRef?: string;
138
+ unit?: string;
139
+ }[];
140
+ grain?: string[];
141
+ }>;
142
+ }, "strict", z.ZodTypeAny, {
143
+ id?: string;
144
+ schemaVersion?: 1;
145
+ dataSourceId?: string;
146
+ providerId?: string;
147
+ operation?: string;
148
+ contractVersion?: number;
149
+ payload?: JSONValue;
150
+ parameters?: {
151
+ type?: "string" | "number" | "boolean" | "date";
152
+ name?: string;
153
+ controlId?: string;
154
+ required?: boolean;
155
+ defaultValue?: string | number | boolean;
156
+ allowedValues?: (string | number | boolean)[];
157
+ }[];
158
+ output?: {
159
+ datasetId?: string;
160
+ fields?: {
161
+ id?: string;
162
+ sourceField?: string;
163
+ label?: string;
164
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
165
+ nullable?: boolean;
166
+ role?: "dimension" | "measure" | "time" | "identifier";
167
+ semanticRef?: string;
168
+ unit?: string;
169
+ }[];
170
+ grain?: string[];
171
+ };
172
+ }, {
173
+ id?: string;
174
+ schemaVersion?: 1;
175
+ dataSourceId?: string;
176
+ providerId?: string;
177
+ operation?: string;
178
+ contractVersion?: number;
179
+ payload?: JSONValue;
180
+ parameters?: {
181
+ type?: "string" | "number" | "boolean" | "date";
182
+ name?: string;
183
+ controlId?: string;
184
+ required?: boolean;
185
+ defaultValue?: string | number | boolean;
186
+ allowedValues?: (string | number | boolean)[];
187
+ }[];
188
+ output?: {
189
+ datasetId?: string;
190
+ fields?: {
191
+ id?: string;
192
+ sourceField?: string;
193
+ label?: string;
194
+ logicalType?: "string" | "boolean" | "date" | "int64" | "float64" | "decimal" | "timestamp";
195
+ nullable?: boolean;
196
+ role?: "dimension" | "measure" | "time" | "identifier";
197
+ semanticRef?: string;
198
+ unit?: string;
199
+ }[];
200
+ grain?: string[];
201
+ };
202
+ }>;
203
+ export declare const analyticsBindingSchema: z.ZodType<AnalyticsBinding>;
204
+ export declare const analyticsQueryRequestSchema: z.ZodType<AnalyticsQueryRequest, z.ZodTypeDef, unknown>;
205
+ export declare const analyticsDiscoveryRequestSchema: z.ZodType<AnalyticsDiscoveryRequest, z.ZodTypeDef, unknown>;
206
+ export declare const analyticsDiscoveryResultSchema: z.ZodType<AnalyticsDiscoveryResult>;
@@ -0,0 +1,4 @@
1
+ export * from './analytics-provider';
2
+ export * from './analytics.registry';
3
+ export * from './analytics.schema';
4
+ export * from './analytics-result';
@@ -6,3 +6,4 @@ export * from './types';
6
6
  export * from './workbench';
7
7
  export * from './workbench-sql';
8
8
  export * from './workbench-adapter';
9
+ export * from '../analytics';
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Why this exists: existing SQL Workbench plugins share this SDK implementation.
3
+ * Metadata and transaction SQL still couple it to PostgreSQL/MySQL/Doris.
4
+ * TODO: delegate dialect behavior to plugin-owned strategies behind DatabaseWorkbenchAdapter.
5
+ * Keep host authorization/execution limits and generic Dataset/Binding independent of dialects.
6
+ */
1
7
  import type { DatabaseCapabilities, DatabaseEngine, DatabaseImportInput, DatabaseImportReceipt, DatabaseLocation, DatabaseObjectDetail, DatabaseObjectPage, DatabaseObjectRef, DatabaseQueryInput, DatabaseResult, DatabaseValue, DatabaseWorkbenchAdapter } from './workbench';
2
8
  export interface WorkbenchTransport {
3
9
  execute(sql: string, parameters: DatabaseValue[], options: {
@@ -8,7 +14,11 @@ export interface WorkbenchTransport {
8
14
  close(): Promise<void>;
9
15
  importRows?(input: DatabaseImportInput, signal?: AbortSignal): Promise<DatabaseImportReceipt>;
10
16
  }
11
- /** One adapter per physical connection. A host session must not share it across users. */
17
+ /**
18
+ * One adapter per physical connection. A host session must not share it across users.
19
+ * @deprecated Legacy SDK-owned SQL dialects. New plugins should implement DatabaseWorkbenchAdapter
20
+ * with plugin-owned dialect behavior. Retained for compatibility with existing plugins.
21
+ */
12
22
  export declare class SqlDatabaseWorkbenchAdapter implements DatabaseWorkbenchAdapter {
13
23
  readonly engine: DatabaseEngine;
14
24
  private readonly transport;
@@ -7,6 +7,18 @@ export interface SqlStatement {
7
7
  words: string[];
8
8
  effect: 'read' | 'write' | 'unsupported';
9
9
  }
10
+ /**
11
+ * @deprecated Mixed-dialect Workbench policy. New adapters should own dialect-aware statement
12
+ * validation. Existing callers must retain this guard until an equivalent replacement is in place.
13
+ */
10
14
  export declare function splitWorkbenchSql(source: string): SqlStatement[];
15
+ /**
16
+ * @deprecated Uses the legacy mixed-dialect policy. New adapters should enforce read-only execution
17
+ * with dialect-aware validation and database permissions. Keep this guard until safely migrated.
18
+ */
11
19
  export declare function requireReadStatement(sql: string): string;
20
+ /**
21
+ * @deprecated Built-in engine switch. New adapters should own dialect-specific identifier quoting
22
+ * while preserving identifier validation and escaping.
23
+ */
12
24
  export declare function quoteDatabaseIdentifier(name: string, engine: 'doris' | 'mysql' | 'postgres'): string;
@@ -0,0 +1,29 @@
1
+ import type { ArtifactVersionInput, ArtifactVersionRecord } from './artifacts';
2
+ /** Mutable working copy. Revision numbers are never published version numbers. */
3
+ export type ArtifactDraftRecord = ArtifactVersionInput & {
4
+ id: string;
5
+ artifactId: string;
6
+ revision: number;
7
+ baseVersionId: string | null;
8
+ publishedRevision: number | null;
9
+ publishedVersionId: string | null;
10
+ updatedAt?: string | Date;
11
+ };
12
+ export type SaveArtifactDraftInput = ArtifactVersionInput & {
13
+ artifactId: string;
14
+ expectedRevision: number;
15
+ expectedCurrentVersionId: string | null;
16
+ };
17
+ export type PublishArtifactDraftInput = {
18
+ artifactId: string;
19
+ expectedRevision: number;
20
+ expectedCurrentVersionId: string | null;
21
+ };
22
+ export interface ArtifactDraftsApi {
23
+ list(artifactIds: string[]): Promise<ArtifactDraftRecord[]>;
24
+ get(artifactId: string): Promise<ArtifactDraftRecord | null>;
25
+ save(input: SaveArtifactDraftInput): Promise<ArtifactDraftRecord>;
26
+ /** Trusted application action only; never expose this operation as an Agent tool. */
27
+ publish(input: PublishArtifactDraftInput): Promise<ArtifactVersionRecord>;
28
+ }
29
+ export declare const ArtifactDraftsRuntimeCapability: import("../../core/runtime-capability").RuntimeCapabilityKey<ArtifactDraftsApi>;
@@ -46,6 +46,12 @@ export type CreateArtifactVersionInput = ArtifactVersionInput & {
46
46
  /** Idempotently creates or reuses one immutable Artifact content version. */
47
47
  export type EnsureArtifactVersionInput = CreateArtifactVersionInput & {
48
48
  idempotencyKey: string;
49
+ /**
50
+ * Compare-and-set guard when promoting a version to current; ignored when setCurrent is false.
51
+ * null requires no current version; omission preserves legacy behavior. Retrying the current
52
+ * immutable version is allowed, while a stale save targeting a different version returns a conflict.
53
+ */
54
+ expectedCurrentVersionId?: string | null;
49
55
  };
50
56
  /** Access policy requested for an Artifact link. */
51
57
  export type ArtifactLinkAccessInput = {
@@ -143,9 +149,13 @@ export type ArtifactLinkRecord = ArtifactScopeInput & {
143
149
  };
144
150
  /** Filter used when listing Artifacts visible to the current plugin/runtime scope. */
145
151
  export type ListArtifactsInput = {
152
+ /** Include current-version metadata in one batch, without reading Workspace file bytes. */
153
+ includeCurrentVersion?: boolean;
146
154
  pluginName?: string | null;
147
155
  resourceType?: string | null;
148
156
  resourceId?: string | null;
157
+ /** Literal resource ID prefix, never a pattern; narrows results without granting access. */
158
+ resourceIdPrefix?: string | null;
149
159
  status?: ArtifactStatus | 'all' | null;
150
160
  page?: number | null;
151
161
  pageSize?: number | null;
@@ -1,5 +1,6 @@
1
1
  export * from './actor-token';
2
2
  export * from './artifacts';
3
+ export * from './artifact-drafts';
3
4
  export * from './workspace-files';
4
5
  export * from './workspace-storage';
5
6
  export * from './sandbox-jobs';
@@ -1,7 +1,7 @@
1
1
  import type { JSONValue } from '@xpert-ai/contracts';
2
2
  import type { WorkspaceFileScope, WorkspacePortableFileReference } from './workspace-files';
3
3
  /** Stable machine-readable failures emitted by the Sandbox Jobs capability. */
4
- export declare const SANDBOX_JOB_ERROR_CODES: readonly ["SANDBOX_ACTION_UNAVAILABLE", "SANDBOX_ACTION_INVALID", "SANDBOX_PROFILE_UNAVAILABLE", "SANDBOX_RUNTIME_UNAVAILABLE", "SANDBOX_VERSION_MISMATCH", "SANDBOX_CAPACITY_UNAVAILABLE", "SANDBOX_START_FAILED", "BROWSER_LAUNCH_FAILED", "EXPORT_TIMEOUT", "EXPORT_OOM", "EXPORT_MEDIA_FAILED", "EXPORT_INPUT_INVALID", "EXPORT_OUTPUT_INVALID", "SANDBOX_CANCELLED"];
4
+ export declare const SANDBOX_JOB_ERROR_CODES: readonly ["SANDBOX_ACTION_UNAVAILABLE", "SANDBOX_ACTION_INVALID", "SANDBOX_PROFILE_UNAVAILABLE", "SANDBOX_RUNTIME_UNAVAILABLE", "SANDBOX_VERSION_MISMATCH", "SANDBOX_CAPACITY_UNAVAILABLE", "SANDBOX_START_FAILED", "SANDBOX_INVOCATION_FAILED", "BROWSER_LAUNCH_FAILED", "EXPORT_TIMEOUT", "EXPORT_OOM", "EXPORT_MEDIA_FAILED", "EXPORT_INPUT_INVALID", "EXPORT_OUTPUT_INVALID", "SANDBOX_CANCELLED"];
5
5
  export type SandboxJobErrorCode = (typeof SANDBOX_JOB_ERROR_CODES)[number];
6
6
  /** Persisted lifecycle states for a generic isolated background execution. */
7
7
  export type SandboxJobStatus = 'waiting' | 'starting' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'lost';
@@ -114,6 +114,40 @@ export type SandboxJobSnapshot = {
114
114
  startedAt?: Date | string | null;
115
115
  finishedAt?: Date | string | null;
116
116
  };
117
+ /**
118
+ * Host callbacks available only for one execution attempt. This configuration is never
119
+ * serialized into a Job or exposed to the script. An attached caller cannot replace it.
120
+ */
121
+ export type SandboxJobInvocation = {
122
+ /** Exact operation names the script may request; names carry no built-in business meaning. */
123
+ operations: readonly string[];
124
+ /** Positive integer request limit, including queued requests; Core caps it at 32. */
125
+ maxCalls: number;
126
+ /** Positive integer budget for UTF-8 request lines and response JSON combined; capped at 8 MB. */
127
+ maxBytes: number;
128
+ /**
129
+ * Runs in the initiating host context. The plugin validates the operation payload and
130
+ * rechecks resource access; the operation allowlist is not business authorization.
131
+ * Honor signal to stop child work. Return only data permitted to enter the script workspace.
132
+ */
133
+ handle(operation: string, payload: JSONValue, context: {
134
+ jobId: string;
135
+ signal: AbortSignal;
136
+ }): Promise<JSONValue>;
137
+ };
138
+ /** Live execution controls; kept separate from the persisted, JSON-only RunInput. */
139
+ export type SandboxJobRunOptions = {
140
+ /** Cancels an owned attempt; on reattachment, cancels only this caller's wait. */
141
+ signal?: AbortSignal;
142
+ invocation?: SandboxJobInvocation;
143
+ };
144
+ /**
145
+ * Stdout frame: prefix + JSON { id, operation, payload } + newline.
146
+ * Core writes { id, value } to <workspaceRoot>/invocations/<id>.json after validation.
147
+ * IDs are unique per attempt and restricted to 1–64 ASCII letters, digits, '_' or '-'.
148
+ * The bridge has no network endpoint and gives the script no host credentials.
149
+ */
150
+ export declare const SANDBOX_JOB_INVOCATION_PREFIX = "XPERT_SANDBOX_INVOKE ";
117
151
  /** Successful `run()` result; failed executions reject with SandboxJobRuntimeError. */
118
152
  export type SandboxJobRunResult = SandboxJobSnapshot & {
119
153
  status: 'succeeded';
@@ -141,7 +175,7 @@ export type SandboxJobActionHealth = {
141
175
  */
142
176
  export interface SandboxJobsApi {
143
177
  /** Starts, reattaches, or reuses a successful execution by tenant-scoped idempotency key. */
144
- run(input: SandboxJobRunInput): Promise<SandboxJobRunResult>;
178
+ run(input: SandboxJobRunInput, options?: SandboxJobRunOptions): Promise<SandboxJobRunResult>;
145
179
  /** Cancels the logical Job and terminates its active Runtime when one exists. */
146
180
  cancel(input: {
147
181
  jobId: string;
@@ -1,3 +1,5 @@
1
1
  export * from './runtime-capability';
2
2
  export * from './runtime-scope';
3
3
  export * from './capabilities';
4
+ export * from './mutation-evidence';
5
+ export * from './workspace-file-tools';
@@ -0,0 +1,7 @@
1
+ /** Run-scoped evidence for multi-tool writes. A file write is not a domain commit. */
2
+ export declare function createMutationEvidence<T>(): {
3
+ begin(): number;
4
+ accept(token: number, value: T): void;
5
+ readonly pending: boolean;
6
+ readonly receipt: T;
7
+ };
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod/v3';
2
+ /** Portable Agent input; filesystem containment and authorization remain with the host. */
3
+ export declare const workspaceRelativeFilePathSchema: z.ZodEffects<z.ZodString, string, string>;
4
+ /** Host-owned metadata lets plugins observe file intent without guessing tool names. */
5
+ export declare const workspaceFileMutationMetadata: {
6
+ readonly workspaceFileOperation: {
7
+ readonly type: "mutation";
8
+ readonly pathArgument: "file_path";
9
+ };
10
+ };
11
+ export declare function workspaceFileMutationPath(metadata: unknown, args: Record<string, unknown>): string | undefined;
@@ -76,6 +76,8 @@ export type SandboxRuntimeSecurity = {
76
76
  readOnlyRootFilesystem: boolean;
77
77
  noNewPrivileges: boolean;
78
78
  dropCapabilities: 'all';
79
+ /** Mount job inputs/actions read-only; outputs must live on a bounded ephemeral filesystem. */
80
+ readOnlyWorkspace?: boolean;
79
81
  };
80
82
  /** Isolation guarantees a Provider advertises before it can be selected. */
81
83
  export type SandboxRuntimeProviderCapabilities = {
@@ -86,6 +88,8 @@ export type SandboxRuntimeProviderCapabilities = {
86
88
  readOnlyRootFilesystem: boolean;
87
89
  /** Supports Job-scoped, read-only, seekable Workspace file mappings. */
88
90
  readOnlyFileMounts?: boolean;
91
+ /** Enforces read-only job inputs and bounded ephemeral outputs. */
92
+ readOnlyWorkspace?: boolean;
89
93
  };
90
94
  /** Minimum Provider guarantees required by a Runtime Definition. */
91
95
  export type SandboxRuntimeRequirements = SandboxRuntimeProviderCapabilities;