@xpert-ai/plugin-sdk 3.23.0 → 3.25.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/_object_without_properties_loose.cjs.js +16 -0
- package/_object_without_properties_loose.esm.js +14 -0
- package/analytics-result.cjs.js +212 -0
- package/analytics-result.esm.js +201 -0
- package/analytics.cjs.default.js +1 -0
- package/analytics.cjs.js +17 -0
- package/analytics.cjs.mjs +2 -0
- package/analytics.d.ts +1 -0
- package/analytics.esm.js +2 -0
- package/artifact-document.cjs.default.js +1 -0
- package/artifact-document.cjs.js +581 -0
- package/artifact-document.cjs.mjs +2 -0
- package/artifact-document.d.ts +1 -0
- package/artifact-document.esm.js +563 -0
- package/data-workbench.cjs.js +23 -6
- package/data-workbench.esm.js +23 -6
- package/docs/README.md +8 -0
- package/docs/analytics.md +108 -0
- package/docs/artifact-documents.md +74 -0
- package/docs/artifact-drafts.md +24 -0
- package/docs/artifact-presentations.md +43 -0
- package/docs/json-encoded-schema.md +19 -0
- package/docs/mcp-client.md +63 -0
- package/docs/provider-credential-validation.md +34 -0
- package/docs/rest-client.md +24 -0
- package/docs/workspace-dataset-pipelines.md +120 -0
- package/docs/workspace-file-tools.md +66 -0
- package/index.cjs.js +555 -108
- package/index.esm.js +573 -172
- package/model-provider-toolset.cjs.js +1 -1
- package/model-provider-toolset.esm.js +1 -1
- package/model-provider.cjs.js +47 -1
- package/model-provider.esm.js +41 -2
- package/package.json +14 -2
- package/src/analytics.d.ts +3 -0
- package/src/artifact-document.d.ts +5 -0
- package/src/index.d.ts +2 -0
- package/src/lib/agent/handoff/agent-runtime-message.contract.d.ts +80 -80
- package/src/lib/agent/middleware/capabilities/assistant-task.d.ts +36 -1
- package/src/lib/agent/runtime/dispatch.d.ts +284 -284
- package/src/lib/agent/runtime/index.d.ts +1 -0
- package/src/lib/agent/runtime/pipeline-scope.d.ts +110 -0
- package/src/lib/agent/runtime/types.d.ts +4 -2
- package/src/lib/ai-model/ai-model-provider.interface.d.ts +3 -1
- package/src/lib/ai-model/utils/limits.d.ts +4 -2
- package/src/lib/artifact-document/dependencies.d.ts +101 -0
- package/src/lib/artifact-document/host.d.ts +30 -0
- package/src/lib/artifact-document/protocol.d.ts +60 -0
- package/src/lib/artifact-document/runtime.d.ts +4 -0
- package/src/lib/artifact-document/sha256.d.ts +2 -0
- package/src/lib/artifact-presentation/index.d.ts +35 -0
- package/src/lib/core/index.d.ts +1 -0
- package/src/lib/core/json-encoded-schema.d.ts +15 -0
- package/src/lib/data/analytics/analytics-payload.d.ts +3 -0
- package/src/lib/data/analytics/analytics-provider.d.ts +74 -0
- package/src/lib/data/analytics/analytics-result.d.ts +4 -0
- package/src/lib/data/analytics/analytics.registry.d.ts +10 -0
- package/src/lib/data/analytics/analytics.schema.d.ts +206 -0
- package/src/lib/data/analytics/index.d.ts +5 -0
- package/src/lib/data/datasource/index.d.ts +1 -0
- package/src/lib/data/datasource/types.d.ts +1 -1
- package/src/lib/data/datasource/workbench-adapter.d.ts +11 -1
- package/src/lib/data/datasource/workbench-sql.d.ts +12 -0
- package/src/lib/project-pipeline/adapters.d.ts +87 -0
- package/src/lib/project-pipeline/capability.d.ts +100 -0
- package/src/lib/project-pipeline/index.d.ts +5 -0
- package/src/lib/project-pipeline/projection.d.ts +71 -0
- package/src/lib/project-pipeline/registry.d.ts +509 -0
- package/src/lib/project-pipeline/runtime-registry.d.ts +45 -0
- package/src/lib/project-pipeline/scoped-registry.d.ts +10 -0
- package/src/lib/project-task/index.d.ts +6 -0
- package/src/lib/project-type/index.d.ts +17 -1
- package/src/lib/rag/types.d.ts +1 -1
- package/src/lib/runtime/capabilities/artifact-drafts.d.ts +29 -0
- package/src/lib/runtime/capabilities/artifacts.d.ts +12 -0
- package/src/lib/runtime/capabilities/index.d.ts +3 -0
- package/src/lib/runtime/capabilities/mcp-client-runtime.d.ts +41 -0
- package/src/lib/runtime/capabilities/rest-client-runtime.d.ts +34 -0
- package/src/lib/runtime/capabilities/sandbox-jobs.d.ts +36 -2
- package/src/lib/runtime/index.d.ts +2 -0
- package/src/lib/runtime/mutation-evidence.d.ts +7 -0
- package/src/lib/runtime/workspace-file-tools.d.ts +11 -0
- package/src/lib/sandbox/file-edits.d.ts +4 -0
- package/src/lib/sandbox/protocol.d.ts +7 -1
- package/src/lib/sandbox/runtime-provider.d.ts +4 -0
- package/src/lib/sandbox/sandbox.d.ts +2 -8
- package/src/lib/tool-provider/adapters.d.ts +1 -1
- package/src/lib/tool-provider/types.d.ts +2 -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>;
|
|
@@ -2,7 +2,7 @@ import * as _axios from 'axios';
|
|
|
2
2
|
import { Readable } from 'stream';
|
|
3
3
|
import type { DatabaseWorkbenchAdapter } from './workbench';
|
|
4
4
|
import { IColumnDef, IDataSourceCapabilityQuery, IDSSchema, IDSTable } from '@xpert-ai/contracts';
|
|
5
|
-
export { IColumnDef, IDataSourceCapabilityQuery, IDSSchema, IDSTable } from '@xpert-ai/contracts';
|
|
5
|
+
export type { IColumnDef, IDataSourceCapabilityQuery, IDSSchema, IDSTable } from '@xpert-ai/contracts';
|
|
6
6
|
/**
|
|
7
7
|
* The base options for DB adapters
|
|
8
8
|
*/
|
|
@@ -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
|
-
/**
|
|
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,87 @@
|
|
|
1
|
+
import type { ProjectPipelineEvidenceRef, ProjectPipelineJsonValue, ProjectPipelineSubjectVersion, ProjectPipelineWorkContext, ProjectPipelineOperationInput, ProjectPipelineOperationReceipt, ProjectPipelineCompletionReceipt, ProjectPipelinePolicyReceipt, ProjectPipelineAssistantInput, ProjectPipelineResourceClaim, ProjectPipelineResourceReservation, ProjectPipelineRuntimeInput } from '@xpert-ai/contracts';
|
|
2
|
+
import type { ProjectPipelineContext } from './capability';
|
|
3
|
+
import type { AgentInvocationResult } from '../agent/runtime/types';
|
|
4
|
+
export type { ProjectPipelineOperationReceipt } from '@xpert-ai/contracts';
|
|
5
|
+
/** Runtime adapters are registered separately from catalog declarations and resolved in the actor scope. */
|
|
6
|
+
export interface ProjectPipelineSubjectResolver {
|
|
7
|
+
resolve(context: ProjectPipelineContext, objectKey: string): Promise<ProjectPipelineSubjectVersion>;
|
|
8
|
+
checkCurrent(context: ProjectPipelineContext, version: ProjectPipelineSubjectVersion): Promise<boolean>;
|
|
9
|
+
}
|
|
10
|
+
export interface ProjectPipelineEvidenceResolver {
|
|
11
|
+
/** Reauthorize exact object and version; a stored reference is not a bearer credential. */
|
|
12
|
+
read(context: ProjectPipelineContext, reference: ProjectPipelineEvidenceRef): Promise<ProjectPipelineJsonValue>;
|
|
13
|
+
}
|
|
14
|
+
export interface ProjectPipelineValueSchema {
|
|
15
|
+
/** Parse typed evidence content. The host converts failures to a safe diagnostic code. */
|
|
16
|
+
parse(value: unknown): ProjectPipelineJsonValue;
|
|
17
|
+
}
|
|
18
|
+
export interface ProjectPipelineOperationContext extends ProjectPipelineContext {
|
|
19
|
+
work: ProjectPipelineWorkContext;
|
|
20
|
+
idempotencyKey: string;
|
|
21
|
+
inputs: {
|
|
22
|
+
[port: string]: ProjectPipelineOperationInput;
|
|
23
|
+
};
|
|
24
|
+
parameters: {
|
|
25
|
+
[key: string]: ProjectPipelineJsonValue;
|
|
26
|
+
};
|
|
27
|
+
subjects: ProjectPipelineSubjectVersion[];
|
|
28
|
+
/** Host-populated durable occupancy. Never an OS sandbox or a bearer permission. */
|
|
29
|
+
resources?: ProjectPipelineResourceReservation;
|
|
30
|
+
}
|
|
31
|
+
export interface ProjectPipelineResourceResolver {
|
|
32
|
+
/** Read-only authorization/canonicalization of real identities. No allocation or external writes here.
|
|
33
|
+
* Hash the canonical identity consistently across aliases/Projects/tenants; never trust a template lock key.
|
|
34
|
+
* The executor must recheck its exact resource identity and enforce filesystem/process isolation itself. */
|
|
35
|
+
resolve(context: ProjectPipelineOperationContext): Promise<ProjectPipelineResourceClaim[]>;
|
|
36
|
+
}
|
|
37
|
+
export interface ProjectPipelineNodeHandler {
|
|
38
|
+
/** The host persists the intent before execute. Domain writes must check the version/generation too. */
|
|
39
|
+
execute(context: ProjectPipelineOperationContext): Promise<ProjectPipelineOperationReceipt>;
|
|
40
|
+
/** An unknown effect is inspected with the same idempotency key; it is not automatically replayed. */
|
|
41
|
+
inspect(context: ProjectPipelineOperationContext, receiptKey?: string): Promise<ProjectPipelineOperationReceipt>;
|
|
42
|
+
cancel?(context: ProjectPipelineOperationContext, receiptKey: string): Promise<ProjectPipelineOperationReceipt>;
|
|
43
|
+
}
|
|
44
|
+
/** The host binds the authorized published Assistant, Project and stable runtime IDs. */
|
|
45
|
+
export interface ProjectPipelineAssistantContext extends ProjectPipelineOperationContext {
|
|
46
|
+
executor: {
|
|
47
|
+
xpertId: string;
|
|
48
|
+
workspaceId: string;
|
|
49
|
+
publishedVersion: string;
|
|
50
|
+
executionId: string;
|
|
51
|
+
conversationId: string;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface ProjectPipelineAssistantOperation {
|
|
55
|
+
/** Bounded domain prompt/context only; no actor, Project, model or executor overrides. */
|
|
56
|
+
prepare(context: ProjectPipelineAssistantContext): Promise<ProjectPipelineAssistantInput>;
|
|
57
|
+
/** Read the domain outputs after the native Runtime confirms success. Must be idempotent. */
|
|
58
|
+
collect(context: ProjectPipelineAssistantContext): Promise<Record<string, ProjectPipelineEvidenceRef>>;
|
|
59
|
+
}
|
|
60
|
+
export interface ProjectPipelineRuntimeContext extends ProjectPipelineOperationContext {
|
|
61
|
+
executor: {
|
|
62
|
+
bindingId: string;
|
|
63
|
+
provider: string;
|
|
64
|
+
revision: string;
|
|
65
|
+
reference: string;
|
|
66
|
+
invocationId: string;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export interface ProjectPipelineRuntimeOperation {
|
|
70
|
+
/** Bounded domain input only; the host selects and pins identity, target and invocation ID. */
|
|
71
|
+
prepare(context: ProjectPipelineRuntimeContext): Promise<ProjectPipelineRuntimeInput>;
|
|
72
|
+
/** Persist typed domain evidence only after the Runtime reports success. Must be idempotent. */
|
|
73
|
+
collect(context: ProjectPipelineRuntimeContext, result: AgentInvocationResult): Promise<Record<string, ProjectPipelineEvidenceRef>>;
|
|
74
|
+
}
|
|
75
|
+
export interface ProjectPipelineCompletionEvaluator {
|
|
76
|
+
evaluate(context: ProjectPipelineOperationContext, receipt: ProjectPipelineOperationReceipt): Promise<ProjectPipelineCompletionReceipt>;
|
|
77
|
+
}
|
|
78
|
+
export interface ProjectPipelinePolicyEvaluator {
|
|
79
|
+
/** Pure evaluation: reevaluation after a lost worker must not perform a business write. */
|
|
80
|
+
evaluate(context: ProjectPipelineOperationContext): Promise<ProjectPipelinePolicyReceipt>;
|
|
81
|
+
/** Required for human gates. Reauthorize the candidate selector and validate this exact decision. */
|
|
82
|
+
authorizeDecision?(context: ProjectPipelineOperationContext, input: {
|
|
83
|
+
candidateSelectionKey: string;
|
|
84
|
+
outcome: string;
|
|
85
|
+
evidence: ProjectPipelineEvidenceRef[];
|
|
86
|
+
}): Promise<boolean>;
|
|
87
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { ProjectPipelineConfiguration, ProjectPipelineConfigurationCheck, ProjectPipelineGraph, ProjectPipelineSummary, ProjectPipelineConfigure, ProjectPipelineStart, ProjectPipelineStartReceipt, ProjectPipelineDecision, ProjectPipelineNextRound, ProjectPipelineEvidenceRef, ProjectPipelineJsonValue, ProjectPipelineCancel, ProjectPipelineRetry, ProjectPipelineRoundSummary, ProjectPipelineCatalog, ProjectPipelineCatalogConfigure, ProjectPipelineSavedConfiguration, ProjectPipelineCatalogRequest, ProjectPipelineProviderActions, ProjectPipelineProviderActionCommand, ProjectPipelineProviderActionView, ProjectPipelineAnalytics, ProjectPipelineAnalyticsInput, ProjectPipelinePortfolio, ProjectPipelinePortfolioInput } from '@xpert-ai/contracts';
|
|
2
|
+
import type { ProjectAccessActor } from '../runtime/capabilities/project-access';
|
|
3
|
+
import type { ProjectPipelineProjectionLinks } from './projection';
|
|
4
|
+
export interface ProjectPipelineContext {
|
|
5
|
+
actor: ProjectAccessActor;
|
|
6
|
+
projectId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ProjectPipelineAnalyticsApi {
|
|
9
|
+
/** Current business state and all available linked execution history, selected by actual start time. */
|
|
10
|
+
read(context: ProjectPipelineContext, input: ProjectPipelineAnalyticsInput): Promise<ProjectPipelineAnalytics>;
|
|
11
|
+
}
|
|
12
|
+
export interface ProjectPipelinePortfolioApi {
|
|
13
|
+
/** Explicit selection only; every Project must be readable in the same trusted actor scope. */
|
|
14
|
+
read(actor: ProjectAccessActor, input: ProjectPipelinePortfolioInput): Promise<ProjectPipelinePortfolio>;
|
|
15
|
+
}
|
|
16
|
+
export declare const ProjectPipelinePortfolioRuntimeCapability: import("../core/runtime-capability").RuntimeCapabilityKey<ProjectPipelinePortfolioApi>;
|
|
17
|
+
export declare const ProjectPipelineAnalyticsRuntimeCapability: import("../core/runtime-capability").RuntimeCapabilityKey<ProjectPipelineAnalyticsApi>;
|
|
18
|
+
export interface ProjectPipelineProviderActionsApi {
|
|
19
|
+
list(context: ProjectPipelineContext, input: {
|
|
20
|
+
instanceId: string;
|
|
21
|
+
nodeInstanceId: string;
|
|
22
|
+
}): Promise<ProjectPipelineProviderActions>;
|
|
23
|
+
submit(context: ProjectPipelineContext, input: ProjectPipelineProviderActionCommand): Promise<ProjectPipelineProviderActionView>;
|
|
24
|
+
}
|
|
25
|
+
export declare const ProjectPipelineProviderActionsRuntimeCapability: import("../core/runtime-capability").RuntimeCapabilityKey<ProjectPipelineProviderActionsApi>;
|
|
26
|
+
export interface ProjectPipelineEvidenceApi {
|
|
27
|
+
/** Reauthorize, resolve the exact immutable artifact, and validate its digest and declared schema. */
|
|
28
|
+
read(context: ProjectPipelineContext, reference: ProjectPipelineEvidenceRef): Promise<ProjectPipelineJsonValue>;
|
|
29
|
+
}
|
|
30
|
+
export declare const ProjectPipelineEvidenceRuntimeCapability: import("../core/runtime-capability").RuntimeCapabilityKey<ProjectPipelineEvidenceApi>;
|
|
31
|
+
export interface ProjectPipelineConfigurationApi {
|
|
32
|
+
/** Metadata validation only; no persistence, domain callback, Assistant dispatch or external write. */
|
|
33
|
+
check(context: ProjectPipelineContext, configuration: ProjectPipelineConfiguration): Promise<ProjectPipelineConfigurationCheck>;
|
|
34
|
+
}
|
|
35
|
+
export interface ProjectPipelineCatalogApi {
|
|
36
|
+
list(context: ProjectPipelineContext, input?: import('@xpert-ai/contracts').ProjectPipelineCatalogRequest): Promise<ProjectPipelineCatalog>;
|
|
37
|
+
bindings(context: ProjectPipelineContext, input?: ProjectPipelineCatalogRequest & {
|
|
38
|
+
after?: string;
|
|
39
|
+
limit?: number;
|
|
40
|
+
}): Promise<{
|
|
41
|
+
items: ProjectPipelineSavedConfiguration[];
|
|
42
|
+
next: string | null;
|
|
43
|
+
}>;
|
|
44
|
+
binding(context: ProjectPipelineContext, bindingId: string, input?: ProjectPipelineCatalogRequest): Promise<ProjectPipelineSavedConfiguration>;
|
|
45
|
+
/** Resolve the current scoped template and allowlisted fields; save a binding without starting work. */
|
|
46
|
+
configure(context: ProjectPipelineContext, input: ProjectPipelineCatalogConfigure): Promise<{
|
|
47
|
+
bindingId: string;
|
|
48
|
+
revision: number;
|
|
49
|
+
definitionDigest: string;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
export declare const ProjectPipelineCatalogRuntimeCapability: import("../core/runtime-capability").RuntimeCapabilityKey<ProjectPipelineCatalogApi>;
|
|
53
|
+
export declare const ProjectPipelineConfigurationRuntimeCapability: import("../core/runtime-capability").RuntimeCapabilityKey<ProjectPipelineConfigurationApi>;
|
|
54
|
+
export interface ProjectPipelinesApi {
|
|
55
|
+
list(context: ProjectPipelineContext, input?: {
|
|
56
|
+
after?: string;
|
|
57
|
+
limit?: number;
|
|
58
|
+
}): Promise<{
|
|
59
|
+
items: ProjectPipelineSummary[];
|
|
60
|
+
next: string | null;
|
|
61
|
+
}>;
|
|
62
|
+
graph(context: ProjectPipelineContext, instanceId: string, input?: {
|
|
63
|
+
roundId?: string;
|
|
64
|
+
}): Promise<ProjectPipelineGraph>;
|
|
65
|
+
rounds(context: ProjectPipelineContext, instanceId: string, input?: {
|
|
66
|
+
after?: string;
|
|
67
|
+
limit?: number;
|
|
68
|
+
}): Promise<{
|
|
69
|
+
items: ProjectPipelineRoundSummary[];
|
|
70
|
+
next: string | null;
|
|
71
|
+
}>;
|
|
72
|
+
/** A durable refresh only reads provider facts. It never starts business work. */
|
|
73
|
+
refresh(context: ProjectPipelineContext, input: {
|
|
74
|
+
providerRef: string;
|
|
75
|
+
sourceKey: string;
|
|
76
|
+
}): Promise<{
|
|
77
|
+
status: 'queued';
|
|
78
|
+
}>;
|
|
79
|
+
/** Await the authoritative projection and its receipt before a provider dispatches work. Does not dispatch. */
|
|
80
|
+
synchronize(context: ProjectPipelineContext, input: {
|
|
81
|
+
providerRef: string;
|
|
82
|
+
sourceKey: string;
|
|
83
|
+
}): Promise<ProjectPipelineProjectionLinks | null>;
|
|
84
|
+
}
|
|
85
|
+
export declare const ProjectPipelinesRuntimeCapability: import("../core/runtime-capability").RuntimeCapabilityKey<ProjectPipelinesApi>;
|
|
86
|
+
export interface ProjectPipelineCommandsApi {
|
|
87
|
+
configure(context: ProjectPipelineContext, request: ProjectPipelineConfigure): Promise<{
|
|
88
|
+
bindingId: string;
|
|
89
|
+
revision: number;
|
|
90
|
+
definitionDigest: string;
|
|
91
|
+
}>;
|
|
92
|
+
start(context: ProjectPipelineContext, request: ProjectPipelineStart): Promise<ProjectPipelineStartReceipt>;
|
|
93
|
+
decide(context: ProjectPipelineContext, request: ProjectPipelineDecision): Promise<{
|
|
94
|
+
decisionId: string;
|
|
95
|
+
}>;
|
|
96
|
+
nextRound(context: ProjectPipelineContext, request: ProjectPipelineNextRound): Promise<ProjectPipelineStartReceipt>;
|
|
97
|
+
cancel(context: ProjectPipelineContext, request: ProjectPipelineCancel): Promise<ProjectPipelineStartReceipt>;
|
|
98
|
+
retry(context: ProjectPipelineContext, request: ProjectPipelineRetry): Promise<ProjectPipelineStartReceipt>;
|
|
99
|
+
}
|
|
100
|
+
export declare const ProjectPipelineCommandsRuntimeCapability: import("../core/runtime-capability").RuntimeCapabilityKey<ProjectPipelineCommandsApi>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { DiscoveryService, Reflector } from '@nestjs/core';
|
|
2
|
+
import type { ProjectPipelineHostCapabilities, ProjectPipelineProjection, ProjectTaskTypeDefinition, ProjectPipelineWorkContext, ProjectPipelineProjectionNode, ProjectPipelineNodePresentation, ProjectPipelineProviderActionDescriptor, ProjectPipelineProviderActionReceipt, ProjectPipelineJsonValue } from '@xpert-ai/contracts';
|
|
3
|
+
import { ProjectPipelineScopedRegistry } from './scoped-registry';
|
|
4
|
+
import type { ProjectPipelineContext } from './capability';
|
|
5
|
+
import type { StrategySource } from '../strategy';
|
|
6
|
+
export interface ProjectPipelineProjectionLinks {
|
|
7
|
+
instanceId: string;
|
|
8
|
+
revision: number;
|
|
9
|
+
tasks: Array<{
|
|
10
|
+
sourceKey: string;
|
|
11
|
+
taskId: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
/** Last committed platform position; a provider's locally saved snapshot may be ahead of it. */
|
|
15
|
+
export interface ProjectPipelineProjectionCheckpoint {
|
|
16
|
+
sourceEpoch: string;
|
|
17
|
+
sourceSequence: number;
|
|
18
|
+
run: Pick<ProjectPipelineProjection['run'], 'key' | 'state'>;
|
|
19
|
+
round: Pick<ProjectPipelineProjection['round'], 'key' | 'sequence' | 'generation' | 'state' | 'inputDigest'>;
|
|
20
|
+
}
|
|
21
|
+
export interface ProjectPipelineSnapshotContext extends ProjectPipelineContext {
|
|
22
|
+
/** Exact protocol support of this host. Informational; every persisted operation is checked again. */
|
|
23
|
+
hostCapabilities?: ProjectPipelineHostCapabilities;
|
|
24
|
+
/** Host-owned opt-ins. Omission means unsupported; providers must not infer support from package versions. */
|
|
25
|
+
hostFeatures?: {
|
|
26
|
+
nodeApplicationEntry?: 1;
|
|
27
|
+
nodePresentation?: 1;
|
|
28
|
+
};
|
|
29
|
+
/** Supplied by the host after authorization, never accepted from a client command. */
|
|
30
|
+
checkpoint?: ProjectPipelineProjectionCheckpoint | null;
|
|
31
|
+
}
|
|
32
|
+
export interface ProjectPipelineProviderNodeContext extends ProjectPipelineContext {
|
|
33
|
+
sourceKey: string;
|
|
34
|
+
work: Omit<ProjectPipelineWorkContext, 'operationId'>;
|
|
35
|
+
node: ProjectPipelineProjectionNode;
|
|
36
|
+
}
|
|
37
|
+
export interface ProjectPipelineProviderActionContext extends ProjectPipelineProviderNodeContext {
|
|
38
|
+
/** Supplied during execute so plugins can opt into explicit host extensions without guessing package versions. */
|
|
39
|
+
hostCapabilities?: ProjectPipelineHostCapabilities;
|
|
40
|
+
/** Present only during an authorized execute callback; never supplied to list or inspect callbacks. */
|
|
41
|
+
nativeDispatch?: import('@xpert-ai/contracts').ProjectPipelineNativeDispatch;
|
|
42
|
+
operationId: string;
|
|
43
|
+
actionRef: string;
|
|
44
|
+
sourceRevision: string;
|
|
45
|
+
parameters: Record<string, ProjectPipelineJsonValue>;
|
|
46
|
+
}
|
|
47
|
+
export interface IProjectPipelineProjectionProvider {
|
|
48
|
+
/** Versioned contribution reference. It must not also be an old ProjectTaskProvider key. */
|
|
49
|
+
readonly key: string;
|
|
50
|
+
readonly taskTypes?: readonly ProjectTaskTypeDefinition[];
|
|
51
|
+
/** Public actions carry nativeDispatch into every native Task; only the host can authorize execution ownership. */
|
|
52
|
+
readonly nativeTaskProtocol?: 1;
|
|
53
|
+
/** Read one authoritative instance. Missing data returns null; it never implies cancellation. */
|
|
54
|
+
snapshot(context: ProjectPipelineSnapshotContext, sourceKey: string): Promise<ProjectPipelineProjection | null>;
|
|
55
|
+
/** Receipt delivery is retryable. This callback must not dispatch or advance business work. */
|
|
56
|
+
linked?(context: ProjectPipelineContext, sourceKey: string, links: ProjectPipelineProjectionLinks): Promise<void>;
|
|
57
|
+
/** Read-only actor-specific diagnostics. Never persist permissions in the shared projection. */
|
|
58
|
+
describeNode?(context: ProjectPipelineProviderNodeContext): Promise<ProjectPipelineNodePresentation | null>;
|
|
59
|
+
/** Read-only availability for this actor and exact node; refs must be allowlisted by the saved definition. */
|
|
60
|
+
actions?(context: ProjectPipelineProviderNodeContext): Promise<ProjectPipelineProviderActionDescriptor[]>;
|
|
61
|
+
/** Pair with inspectAction for recovery. Recheck domain permissions and commit a receipt with the effect. */
|
|
62
|
+
executeAction?(context: ProjectPipelineProviderActionContext): Promise<ProjectPipelineProviderActionReceipt>;
|
|
63
|
+
/** Recover the original operation without repeating its effect, including after an ambiguous dispatch. */
|
|
64
|
+
inspectAction?(context: ProjectPipelineProviderActionContext, receiptKey?: string): Promise<ProjectPipelineProviderActionReceipt>;
|
|
65
|
+
}
|
|
66
|
+
export declare const PROJECT_PIPELINE_PROJECTION_PROVIDER = "PROJECT_PIPELINE_PROJECTION_PROVIDER";
|
|
67
|
+
export declare const ProjectPipelineProjectionProvider: (key: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
68
|
+
export declare class ProjectPipelineProjectionProviderRegistry extends ProjectPipelineScopedRegistry<IProjectPipelineProjectionProvider> {
|
|
69
|
+
constructor(discovery: DiscoveryService, reflector: Reflector);
|
|
70
|
+
register(key: string, provider: IProjectPipelineProjectionProvider, source: StrategySource): IProjectPipelineProjectionProvider;
|
|
71
|
+
}
|