@xpert-ai/plugin-sdk 3.33.1 → 3.35.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/agent-results.cjs.js +2 -0
- package/agent-results.esm.js +1 -1
- package/analytics.cjs.js +87 -2
- package/analytics.esm.js +86 -1
- package/docs/artifact-types.md +30 -0
- package/index.cjs.js +69 -25
- package/index.esm.js +67 -31
- package/model-provider.cjs.js +13 -0
- package/model-provider.esm.js +11 -1
- package/package.json +2 -2
- package/results.cjs.js +8 -0
- package/results.esm.js +7 -1
- package/src/analytics.d.ts +1 -0
- package/src/lib/agent/runtime/dispatch.d.ts +232 -9
- package/src/lib/agent/runtime/execution-runner.d.ts +11 -1
- package/src/lib/agent/runtime/results.d.ts +17 -0
- package/src/lib/agent/runtime/strategy.d.ts +3 -0
- package/src/lib/agent/runtime/types.d.ts +2 -0
- package/src/lib/artifact-document/dependencies.d.ts +10 -10
- package/src/lib/artifact-presentation/index.d.ts +29 -11
- package/src/lib/artifact-type/analytics.d.ts +30 -0
- package/src/lib/artifact-type/definition.schema.d.ts +181 -1
- package/src/lib/artifact-type/index.d.ts +37 -1
- package/src/lib/artifact-type/version-context.d.ts +21 -0
- package/src/lib/content-resource/discovery.d.ts +11 -0
- package/src/lib/content-resource/index.d.ts +3 -0
- package/src/lib/data/analytics/analytics-provider.d.ts +3 -0
- package/src/lib/data/analytics/resource-analysis.schema.d.ts +19 -0
- package/src/lib/evolution/artifact-hash.d.ts +8 -0
- package/src/lib/evolution/index.d.ts +1 -0
- package/src/lib/evolution/provider.decorator.d.ts +1 -0
- package/src/lib/evolution/provider.registry.d.ts +2 -0
- package/src/lib/evolution/runtime-capability.d.ts +3 -0
- package/src/lib/file/file-storage/provider.interface.d.ts +24 -1
- package/src/lib/project-task/acceptance.d.ts +17 -0
- package/src/lib/project-task/index.d.ts +4 -0
- package/src/lib/runtime/capabilities/artifact-use-grants.d.ts +80 -0
- package/src/lib/runtime/capabilities/index.d.ts +3 -0
- package/src/lib/runtime/capabilities/plugin-test-access.d.ts +14 -0
- package/src/lib/runtime/capabilities/project-configuration.d.ts +164 -0
- package/src/lib/runtime/capabilities/project-provisioning.d.ts +9 -1
- package/src/lib/tool-provider/claims.d.ts +8 -0
- package/src/lib/tool-provider/index.d.ts +1 -0
- package/src/lib/tool-provider/registry.d.ts +0 -1
- package/src/lib/types.d.ts +5 -0
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
import { z } from 'zod/v3';
|
|
2
2
|
/** Package exports are a runtime boundary; reject malformed declarations before registration. */
|
|
3
|
-
export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodObject<{
|
|
3
|
+
export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
4
|
+
contentTypeId: z.ZodOptional<z.ZodString>;
|
|
5
|
+
icon: z.ZodOptional<z.ZodObject<{
|
|
6
|
+
type: z.ZodEnum<["image", "svg", "font", "emoji", "lottie"]>;
|
|
7
|
+
value: z.ZodString;
|
|
8
|
+
color: z.ZodOptional<z.ZodString>;
|
|
9
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
11
|
+
style: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
value?: string;
|
|
14
|
+
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
15
|
+
size?: number;
|
|
16
|
+
color?: string;
|
|
17
|
+
alt?: string;
|
|
18
|
+
style?: Record<string, string>;
|
|
19
|
+
}, {
|
|
20
|
+
value?: string;
|
|
21
|
+
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
22
|
+
size?: number;
|
|
23
|
+
color?: string;
|
|
24
|
+
alt?: string;
|
|
25
|
+
style?: Record<string, string>;
|
|
26
|
+
}>>;
|
|
4
27
|
title: z.ZodOptional<z.ZodObject<{
|
|
5
28
|
en_US: z.ZodString;
|
|
6
29
|
zh_Hans: z.ZodOptional<z.ZodString>;
|
|
@@ -22,6 +45,19 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
22
45
|
}, {
|
|
23
46
|
allowCopy?: boolean;
|
|
24
47
|
}>>;
|
|
48
|
+
useGrants: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
audience: z.ZodLiteral<"group">;
|
|
50
|
+
permission: z.ZodLiteral<"read">;
|
|
51
|
+
queryOperations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
52
|
+
}, "strict", z.ZodTypeAny, {
|
|
53
|
+
audience?: "group";
|
|
54
|
+
permission?: "read";
|
|
55
|
+
queryOperations?: string[];
|
|
56
|
+
}, {
|
|
57
|
+
audience?: "group";
|
|
58
|
+
permission?: "read";
|
|
59
|
+
queryOperations?: string[];
|
|
60
|
+
}>>;
|
|
25
61
|
versioning: z.ZodOptional<z.ZodObject<{
|
|
26
62
|
mode: z.ZodLiteral<"draft-only">;
|
|
27
63
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -83,6 +119,14 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
83
119
|
collection?: {
|
|
84
120
|
allowCopy?: boolean;
|
|
85
121
|
};
|
|
122
|
+
icon?: {
|
|
123
|
+
value?: string;
|
|
124
|
+
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
125
|
+
size?: number;
|
|
126
|
+
color?: string;
|
|
127
|
+
alt?: string;
|
|
128
|
+
style?: Record<string, string>;
|
|
129
|
+
};
|
|
86
130
|
content?: {
|
|
87
131
|
mimeTypes?: string[];
|
|
88
132
|
maxBytes?: number;
|
|
@@ -90,7 +134,13 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
90
134
|
presentation?: {
|
|
91
135
|
mode?: "file" | "authenticated" | "snapshot";
|
|
92
136
|
};
|
|
137
|
+
contentTypeId?: string;
|
|
93
138
|
kinds?: ("file" | "image" | "html" | "markdown" | "pdf" | "pptx" | "site" | "presentation")[];
|
|
139
|
+
useGrants?: {
|
|
140
|
+
audience?: "group";
|
|
141
|
+
permission?: "read";
|
|
142
|
+
queryOperations?: string[];
|
|
143
|
+
};
|
|
94
144
|
versioning?: {
|
|
95
145
|
mode?: "draft-only";
|
|
96
146
|
};
|
|
@@ -113,6 +163,14 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
113
163
|
collection?: {
|
|
114
164
|
allowCopy?: boolean;
|
|
115
165
|
};
|
|
166
|
+
icon?: {
|
|
167
|
+
value?: string;
|
|
168
|
+
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
169
|
+
size?: number;
|
|
170
|
+
color?: string;
|
|
171
|
+
alt?: string;
|
|
172
|
+
style?: Record<string, string>;
|
|
173
|
+
};
|
|
116
174
|
content?: {
|
|
117
175
|
mimeTypes?: string[];
|
|
118
176
|
maxBytes?: number;
|
|
@@ -120,7 +178,13 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
120
178
|
presentation?: {
|
|
121
179
|
mode?: "file" | "authenticated" | "snapshot";
|
|
122
180
|
};
|
|
181
|
+
contentTypeId?: string;
|
|
123
182
|
kinds?: ("file" | "image" | "html" | "markdown" | "pdf" | "pptx" | "site" | "presentation")[];
|
|
183
|
+
useGrants?: {
|
|
184
|
+
audience?: "group";
|
|
185
|
+
permission?: "read";
|
|
186
|
+
queryOperations?: string[];
|
|
187
|
+
};
|
|
124
188
|
versioning?: {
|
|
125
189
|
mode?: "draft-only";
|
|
126
190
|
};
|
|
@@ -143,6 +207,14 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
143
207
|
collection?: {
|
|
144
208
|
allowCopy?: boolean;
|
|
145
209
|
};
|
|
210
|
+
icon?: {
|
|
211
|
+
value?: string;
|
|
212
|
+
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
213
|
+
size?: number;
|
|
214
|
+
color?: string;
|
|
215
|
+
alt?: string;
|
|
216
|
+
style?: Record<string, string>;
|
|
217
|
+
};
|
|
146
218
|
content?: {
|
|
147
219
|
mimeTypes?: string[];
|
|
148
220
|
maxBytes?: number;
|
|
@@ -150,7 +222,13 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
150
222
|
presentation?: {
|
|
151
223
|
mode?: "file" | "authenticated" | "snapshot";
|
|
152
224
|
};
|
|
225
|
+
contentTypeId?: string;
|
|
153
226
|
kinds?: ("file" | "image" | "html" | "markdown" | "pdf" | "pptx" | "site" | "presentation")[];
|
|
227
|
+
useGrants?: {
|
|
228
|
+
audience?: "group";
|
|
229
|
+
permission?: "read";
|
|
230
|
+
queryOperations?: string[];
|
|
231
|
+
};
|
|
154
232
|
versioning?: {
|
|
155
233
|
mode?: "draft-only";
|
|
156
234
|
};
|
|
@@ -173,6 +251,14 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
173
251
|
collection?: {
|
|
174
252
|
allowCopy?: boolean;
|
|
175
253
|
};
|
|
254
|
+
icon?: {
|
|
255
|
+
value?: string;
|
|
256
|
+
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
257
|
+
size?: number;
|
|
258
|
+
color?: string;
|
|
259
|
+
alt?: string;
|
|
260
|
+
style?: Record<string, string>;
|
|
261
|
+
};
|
|
176
262
|
content?: {
|
|
177
263
|
mimeTypes?: string[];
|
|
178
264
|
maxBytes?: number;
|
|
@@ -180,7 +266,101 @@ export declare const artifactTypeDefinitionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
180
266
|
presentation?: {
|
|
181
267
|
mode?: "file" | "authenticated" | "snapshot";
|
|
182
268
|
};
|
|
269
|
+
contentTypeId?: string;
|
|
183
270
|
kinds?: ("file" | "image" | "html" | "markdown" | "pdf" | "pptx" | "site" | "presentation")[];
|
|
271
|
+
useGrants?: {
|
|
272
|
+
audience?: "group";
|
|
273
|
+
permission?: "read";
|
|
274
|
+
queryOperations?: string[];
|
|
275
|
+
};
|
|
276
|
+
versioning?: {
|
|
277
|
+
mode?: "draft-only";
|
|
278
|
+
};
|
|
279
|
+
sharing?: {
|
|
280
|
+
projectAccess?: "link-audience";
|
|
281
|
+
accessModes?: ("owner_only" | "workspace_all" | "organization_all" | "custom_principals" | "public_link" | "signed_preview")[];
|
|
282
|
+
versionModes?: ("version" | "latest")[];
|
|
283
|
+
maxTtlSeconds?: number;
|
|
284
|
+
allowDownload?: boolean;
|
|
285
|
+
mutableLinks?: boolean;
|
|
286
|
+
descriptor?: boolean;
|
|
287
|
+
shareKey?: string;
|
|
288
|
+
};
|
|
289
|
+
}>, {
|
|
290
|
+
title?: {
|
|
291
|
+
en_US?: string;
|
|
292
|
+
zh_Hans?: string;
|
|
293
|
+
zh_Hant?: string;
|
|
294
|
+
};
|
|
295
|
+
collection?: {
|
|
296
|
+
allowCopy?: boolean;
|
|
297
|
+
};
|
|
298
|
+
icon?: {
|
|
299
|
+
value?: string;
|
|
300
|
+
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
301
|
+
size?: number;
|
|
302
|
+
color?: string;
|
|
303
|
+
alt?: string;
|
|
304
|
+
style?: Record<string, string>;
|
|
305
|
+
};
|
|
306
|
+
content?: {
|
|
307
|
+
mimeTypes?: string[];
|
|
308
|
+
maxBytes?: number;
|
|
309
|
+
};
|
|
310
|
+
presentation?: {
|
|
311
|
+
mode?: "file" | "authenticated" | "snapshot";
|
|
312
|
+
};
|
|
313
|
+
contentTypeId?: string;
|
|
314
|
+
kinds?: ("file" | "image" | "html" | "markdown" | "pdf" | "pptx" | "site" | "presentation")[];
|
|
315
|
+
useGrants?: {
|
|
316
|
+
audience?: "group";
|
|
317
|
+
permission?: "read";
|
|
318
|
+
queryOperations?: string[];
|
|
319
|
+
};
|
|
320
|
+
versioning?: {
|
|
321
|
+
mode?: "draft-only";
|
|
322
|
+
};
|
|
323
|
+
sharing?: {
|
|
324
|
+
projectAccess?: "link-audience";
|
|
325
|
+
accessModes?: ("owner_only" | "workspace_all" | "organization_all" | "custom_principals" | "public_link" | "signed_preview")[];
|
|
326
|
+
versionModes?: ("version" | "latest")[];
|
|
327
|
+
maxTtlSeconds?: number;
|
|
328
|
+
allowDownload?: boolean;
|
|
329
|
+
mutableLinks?: boolean;
|
|
330
|
+
descriptor?: boolean;
|
|
331
|
+
shareKey?: string;
|
|
332
|
+
};
|
|
333
|
+
}, {
|
|
334
|
+
title?: {
|
|
335
|
+
en_US?: string;
|
|
336
|
+
zh_Hans?: string;
|
|
337
|
+
zh_Hant?: string;
|
|
338
|
+
};
|
|
339
|
+
collection?: {
|
|
340
|
+
allowCopy?: boolean;
|
|
341
|
+
};
|
|
342
|
+
icon?: {
|
|
343
|
+
value?: string;
|
|
344
|
+
type?: "image" | "svg" | "font" | "emoji" | "lottie";
|
|
345
|
+
size?: number;
|
|
346
|
+
color?: string;
|
|
347
|
+
alt?: string;
|
|
348
|
+
style?: Record<string, string>;
|
|
349
|
+
};
|
|
350
|
+
content?: {
|
|
351
|
+
mimeTypes?: string[];
|
|
352
|
+
maxBytes?: number;
|
|
353
|
+
};
|
|
354
|
+
presentation?: {
|
|
355
|
+
mode?: "file" | "authenticated" | "snapshot";
|
|
356
|
+
};
|
|
357
|
+
contentTypeId?: string;
|
|
358
|
+
kinds?: ("file" | "image" | "html" | "markdown" | "pdf" | "pptx" | "site" | "presentation")[];
|
|
359
|
+
useGrants?: {
|
|
360
|
+
audience?: "group";
|
|
361
|
+
permission?: "read";
|
|
362
|
+
queryOperations?: string[];
|
|
363
|
+
};
|
|
184
364
|
versioning?: {
|
|
185
365
|
mode?: "draft-only";
|
|
186
366
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ArtifactAccessMode, ArtifactKind, ArtifactLinkVersionMode, ArtifactTypeReference, I18nObject } from '@xpert-ai/contracts';
|
|
1
|
+
import type { ArtifactAccessMode, ArtifactKind, ArtifactLinkVersionMode, ArtifactTypeReference, IArtifactUseGrant, I18nObject, IconDefinition } from '@xpert-ai/contracts';
|
|
2
2
|
import type { ContentOperation } from '../content-resource';
|
|
3
3
|
import type { ArtifactLinkAccessInput } from '../runtime/capabilities/artifacts';
|
|
4
4
|
export declare const ARTIFACT_TYPE_PROVIDER = "XPERT_ARTIFACT_TYPE_PROVIDER";
|
|
@@ -23,9 +23,20 @@ export type ArtifactTypeLink = {
|
|
|
23
23
|
expiresAt?: Date | string | null;
|
|
24
24
|
allowDownload?: boolean;
|
|
25
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Delegation facts passed to a type's assertUseGrant hook for domain-specific restrictions.
|
|
28
|
+
* Projects, group and fixed version are host-resolved; this is neither an actor credential nor an analysis permission.
|
|
29
|
+
* The host owns lifecycle/concurrency checks and separately validates ResourceAnalysisPolicy when requested.
|
|
30
|
+
*/
|
|
31
|
+
export type ArtifactUseGrantPolicy = Pick<IArtifactUseGrant, 'artifactId' | 'versionId' | 'ownerProjectId' | 'targetProjectId' | 'targetGroupId' | 'permission' | 'expiresAt'>;
|
|
32
|
+
/** Declarative type capabilities validated by the host; opt-in metadata never substitutes for per-operation authorization. */
|
|
26
33
|
export interface ArtifactTypeDefinition {
|
|
34
|
+
/** Semantic catalog type for cross-surface discovery. Metadata only; does not register a Project-owned copy. */
|
|
35
|
+
contentTypeId?: string;
|
|
27
36
|
/** Localized semantic type name shown by libraries independently of the storage/rendering kind. */
|
|
28
37
|
title?: I18nObject;
|
|
38
|
+
/** Public type icon for resource cards. Display metadata only; never conveys access or navigation. */
|
|
39
|
+
icon?: IconDefinition;
|
|
29
40
|
kinds: readonly ArtifactKind[];
|
|
30
41
|
/** Copying bytes into another Project changes their lifecycle and sharing boundary. Custom views must opt in. */
|
|
31
42
|
collection?: {
|
|
@@ -39,6 +50,21 @@ export interface ArtifactTypeDefinition {
|
|
|
39
50
|
versioning?: {
|
|
40
51
|
mode: 'draft-only';
|
|
41
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* Opt in to fixed published versions used by another group's Project; omission disables group grants for this type.
|
|
55
|
+
* Requires authenticated presentation. This does not enable draft/edit/copy/export access or bypass data ACLs.
|
|
56
|
+
*/
|
|
57
|
+
useGrants?: {
|
|
58
|
+
/** Group-scoped audience; other groups sharing the same Project receive no implicit access. */
|
|
59
|
+
audience: 'group';
|
|
60
|
+
/** Only read use is supported; do not model authoring access by adding operations to queryOperations. */
|
|
61
|
+
permission: 'read';
|
|
62
|
+
/**
|
|
63
|
+
* Additional allowlist intersected with presentation-provider operations; omitted/empty permits no interactive queries.
|
|
64
|
+
* This controls viewer interactions, separately from Agent analysis consent. Providers still enforce upstream data ACLs.
|
|
65
|
+
*/
|
|
66
|
+
queryOperations?: readonly string[];
|
|
67
|
+
};
|
|
42
68
|
sharing?: {
|
|
43
69
|
/** Opt in to authenticated Project shares beyond membership; source ACL and data policy still apply. */
|
|
44
70
|
projectAccess?: 'link-audience';
|
|
@@ -97,7 +123,17 @@ export interface IArtifactTypeProvider {
|
|
|
97
123
|
validateLegacyContent?(source: ArtifactTypeSource, content: Buffer, mimeType: string): Promise<void> | void;
|
|
98
124
|
assertPublication?(source: ArtifactTypeSource, access: ArtifactLinkAccessInput): Promise<void> | void;
|
|
99
125
|
assertLink?(source: ArtifactTypeSource, link: ArtifactTypeLink): Promise<void> | void;
|
|
126
|
+
/**
|
|
127
|
+
* Reject delegation that violates this resource's domain policy, using the host-resolved source and grant facts.
|
|
128
|
+
* Called on offer, acceptance and granted reads; throw to deny. Omission retains all platform checks.
|
|
129
|
+
* Does not grant source membership or replace the Analytics query provider's dataset-sharing authorization.
|
|
130
|
+
*/
|
|
131
|
+
assertUseGrant?(source: ArtifactTypeSource, grant: ArtifactUseGrantPolicy): Promise<void> | void;
|
|
100
132
|
readonly snapshot?: ArtifactSnapshotProvider;
|
|
133
|
+
/** Optional fixed-version dataset declarations; queries and sharing authority remain with platform Analytics. */
|
|
134
|
+
readonly analytics?: import('./analytics').ArtifactTypeAnalytics;
|
|
101
135
|
}
|
|
102
136
|
export * from './registry';
|
|
137
|
+
export type { ArtifactVersionContext } from './version-context';
|
|
138
|
+
export type { ArtifactAnalyticsBinding, ArtifactTypeAnalytics } from './analytics';
|
|
103
139
|
export type { ArtifactTypeReference, ArtifactTypeBinding } from '@xpert-ai/contracts';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ArtifactRecord, ArtifactVersionRecord } from '../runtime/capabilities/artifacts';
|
|
2
|
+
/**
|
|
3
|
+
* Host-resolved input for one authorized, immutable published Artifact version.
|
|
4
|
+
* Shared by type extensions and presentation; no renderer or group context is required.
|
|
5
|
+
* Providers validate domain identity/content. The host retains ACLs and post-operation rechecks;
|
|
6
|
+
* retaining this object does not preserve authorization for a later request.
|
|
7
|
+
*/
|
|
8
|
+
export interface ArtifactVersionContext {
|
|
9
|
+
/** Current authenticated caller; never substitute the resource creator for upstream access. */
|
|
10
|
+
actor: {
|
|
11
|
+
tenantId: string;
|
|
12
|
+
organizationId: string;
|
|
13
|
+
userId: string;
|
|
14
|
+
};
|
|
15
|
+
/** Source ownership, including the authoring Project even when used from another Project. */
|
|
16
|
+
artifact: ArtifactRecord;
|
|
17
|
+
/** Exact published version selected by the host; never resolve latest content or a working draft. */
|
|
18
|
+
version: ArtifactVersionRecord;
|
|
19
|
+
/** Authorized, integrity-checked bytes; receiving them grants no general Workspace file access. */
|
|
20
|
+
content: Buffer;
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ConversationResourcePage, ConversationResourceQuery } from '@xpert-ai/contracts';
|
|
2
|
+
import type { ContentDocumentScope } from './document';
|
|
3
|
+
/** Host-resolved scope supplied by a View or admitted Assistant invocation, never remote-component/tool input. */
|
|
4
|
+
export interface ConversationResourceScope extends ContentDocumentScope {
|
|
5
|
+
/** Optional for ordinary Project browsing; required to discover an accepted group reference. */
|
|
6
|
+
conversationId?: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface ConversationResourcesApi {
|
|
9
|
+
/** Combines authorized Project content and current-group references without registering/copying shared content. */
|
|
10
|
+
list(scope: ConversationResourceScope, query: ConversationResourceQuery): Promise<ConversationResourcePage>;
|
|
11
|
+
}
|
|
@@ -86,9 +86,12 @@ export interface ContentResourcesApi {
|
|
|
86
86
|
readonly identities: ContentIdentitiesApi;
|
|
87
87
|
authorize(input: ContentResourceRequest): Promise<ContentResourceDescriptor>;
|
|
88
88
|
readonly catalog: import('./catalog').ContentCatalogApi;
|
|
89
|
+
/** Conversation-scoped discovery for Views; group authorization does not expand the Project catalog. */
|
|
90
|
+
readonly discovery: import('./discovery').ConversationResourcesApi;
|
|
89
91
|
}
|
|
90
92
|
export declare const ContentResourcesRuntimeCapability: import("../core/runtime-capability").RuntimeCapabilityKey<ContentResourcesApi>;
|
|
91
93
|
export * from './document';
|
|
92
94
|
export * from './reference';
|
|
93
95
|
export * from './editor';
|
|
94
96
|
export * from './catalog';
|
|
97
|
+
export * from './discovery';
|
|
@@ -53,6 +53,9 @@ export interface AnalyticsQueryProvider {
|
|
|
53
53
|
readonly descriptor: AnalyticsProviderDescriptor;
|
|
54
54
|
readonly configuration?: AnalyticsConfigurationEntry;
|
|
55
55
|
readonly authoring?: AnalyticsDefinitionAuthoring;
|
|
56
|
+
/** Explicit source authority to disclose this binding's results to a group.
|
|
57
|
+
* Read access alone is insufficient. Unsupported providers must remain view-only. */
|
|
58
|
+
authorizeGroupSharing?(binding: AnalyticsBinding, context: AnalyticsProviderContext): Promise<void>;
|
|
56
59
|
/** Validate and normalize immutable configuration at publication. */
|
|
57
60
|
validateConfiguration?(options: Record<string, JSONValue>, actor: DataSourceActor): Promise<Record<string, JSONValue>> | Record<string, JSONValue>;
|
|
58
61
|
/** Optional read-only metadata discovery; apply the same scope, cancellation and deadline as queries. */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
import type { AnalyticsField, AnalyticsValue, ResourceAnalysisPolicy, ResourceAnalysisQuery, ResourceAnalysisFilter } from '@xpert-ai/contracts';
|
|
3
|
+
/** Validate one predicate's shape/cardinality; field existence, logical types and allowed scope require live dataset metadata. */
|
|
4
|
+
export declare const resourceAnalysisFilterSchema: z.ZodType<ResourceAnalysisFilter>;
|
|
5
|
+
/**
|
|
6
|
+
* Shared authoring/server policy boundary: bounded nonempty allowlists, fixed-filter fields and supported mode combinations.
|
|
7
|
+
* Parsing does not establish source sharing authority or receiving-group consent; those remain runtime checks.
|
|
8
|
+
*/
|
|
9
|
+
export declare const resourceAnalysisPolicySchema: z.ZodType<ResourceAnalysisPolicy>;
|
|
10
|
+
/**
|
|
11
|
+
* Normalize public query input to ResourceAnalysisQuery, defaulting optional wire collections to empty values.
|
|
12
|
+
* Keep limit absent so the executor uses the live policy's maxRows; validate field/mode/budget permissions before querying.
|
|
13
|
+
*/
|
|
14
|
+
export declare const resourceAnalysisQuerySchema: z.ZodType<ResourceAnalysisQuery>;
|
|
15
|
+
/**
|
|
16
|
+
* Check a predicate scalar against the declared logical type, including exact-string int64/decimal wire values.
|
|
17
|
+
* Shared by authoring and execution; this does not validate the operator, field allowlist or grant authority.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isResourceAnalysisFilterValue(type: AnalyticsField['logicalType'], value: AnalyticsValue): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** JSON data eligible for a reproducible evolution digest. Array order is significant; object key order is not. */
|
|
2
|
+
export type EvolutionJson = null | boolean | number | string | EvolutionJson[] | {
|
|
3
|
+
[key: string]: EvolutionJson;
|
|
4
|
+
};
|
|
5
|
+
/** Returns the sha256-prefixed hex digest of the canonical JSON value. */
|
|
6
|
+
export declare function hashEvolutionValue(value: EvolutionJson): string;
|
|
7
|
+
/** Serializes JSON with object keys in sorted order and array elements in their original order. */
|
|
8
|
+
export declare function canonicalEvolutionJson(value: EvolutionJson): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './provider.decorator';
|
|
2
2
|
export * from './provider.registry';
|
|
3
3
|
export * from './runtime-capability';
|
|
4
|
+
export * from './artifact-hash';
|
|
4
5
|
export type { EvolutionBaselineExporter, EvolutionCandidateBuilder, EvolutionProvider, EvolutionReleaseProvider, EvolutionReplayEvaluator, EvolutionTargetProvider } from '@xpert-ai/contracts';
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const EVOLUTION_TARGET_PROVIDER = "EVOLUTION_TARGET_PROVIDER";
|
|
2
|
+
/** Declares the stable registration key of an evolution target provider. */
|
|
2
3
|
export declare const EvolutionTargetProviderStrategy: (providerKey: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { EvolutionTargetProvider } from '@xpert-ai/contracts';
|
|
2
2
|
import { DiscoveryService, Reflector } from '@nestjs/core';
|
|
3
3
|
import { BaseStrategyRegistry } from '../strategy';
|
|
4
|
+
/** Registry of evolution targets visible within a strategy scope. */
|
|
4
5
|
export declare class EvolutionTargetProviderRegistry extends BaseStrategyRegistry<EvolutionTargetProvider> {
|
|
5
6
|
constructor(discoveryService: DiscoveryService, reflector: Reflector);
|
|
7
|
+
/** Returns target declarations visible in the supplied organization scope. */
|
|
6
8
|
listDescriptors(organizationId?: string): import("@xpert-ai/contracts").EvolutionTargetDescriptor[];
|
|
7
9
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { EvolutionRuntimeApi, EvolutionChangeRuntimeApi, EvolutionBaselineRuntimeApi } from '@xpert-ai/contracts';
|
|
2
2
|
export declare const EVOLUTION_RUNTIME_SERVICE_TOKEN = "XPERT_EVOLUTION_RUNTIME_SERVICE";
|
|
3
|
+
/** Capability for inspecting and publishing source baselines within an authorized organization. */
|
|
3
4
|
export declare const EvolutionBaselineRuntimeCapability: import("../core").RuntimeCapabilityKey<EvolutionBaselineRuntimeApi>;
|
|
5
|
+
/** Capability for version selection and evidence tied to Agent executions. */
|
|
4
6
|
export declare const EvolutionRuntimeCapability: import("../core").RuntimeCapabilityKey<EvolutionRuntimeApi>;
|
|
7
|
+
/** Capability for scoped preparation, review and publication of versioned changes. */
|
|
5
8
|
export declare const EvolutionChangeRuntimeCapability: import("../core").RuntimeCapabilityKey<EvolutionChangeRuntimeApi>;
|
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
import { FileStorageOption, FileSystem, UploadedFile } from '@xpert-ai/contracts';
|
|
2
|
+
/** Object metadata supplied by the unified upload boundary. Existing providers may ignore it. */
|
|
3
|
+
export interface FileStoragePutOptions {
|
|
4
|
+
/** MIME type to persist with the object when the provider supports content metadata. */
|
|
5
|
+
contentType?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Storage adapter for local files or object-store keys, registered with FileStorageProvider.
|
|
9
|
+
* Callers must authorize access and supply scoped keys; this interface does not define resource permissions.
|
|
10
|
+
*/
|
|
2
11
|
export interface IFileStorageProvider {
|
|
12
|
+
/** Stable provider identifier used for selection and persisted storage metadata, such as LOCAL or MINIO. */
|
|
3
13
|
readonly name: string;
|
|
14
|
+
/** Effective provider configuration; may contain credentials and must remain server-side. */
|
|
4
15
|
readonly config?: FileSystem & Record<string, any>;
|
|
16
|
+
/** Builds a public or temporary signed URL for a stored key. Signed URLs must be regenerated after expiry. */
|
|
5
17
|
url(path: string): string;
|
|
18
|
+
/** Resolves a relative key against the provider root without reading or writing the file. */
|
|
6
19
|
path(path: string): string;
|
|
20
|
+
/** Creates a Multer storage engine using the destination, filename and prefix options. */
|
|
7
21
|
handler(options: FileStorageOption): any;
|
|
22
|
+
/** Reads the complete contents of a stored key into memory. */
|
|
8
23
|
getFile(file: string): Promise<Buffer>;
|
|
9
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Writes content and returns normalized upload metadata. Use a Buffer for portable provider behavior.
|
|
26
|
+
* @param fileContent Content accepted by the provider; string and URL handling is provider-specific.
|
|
27
|
+
* @param path Destination key in the provider's storage namespace.
|
|
28
|
+
* @param options Optional object metadata; providers that do not support it may ignore it.
|
|
29
|
+
*/
|
|
30
|
+
putFile(fileContent: string | Buffer | URL, path?: string, options?: FileStoragePutOptions): Promise<UploadedFile>;
|
|
31
|
+
/** Deletes the stored bytes for a key; callers remain responsible for associated application records. */
|
|
10
32
|
deleteFile(path: string): Promise<void>;
|
|
33
|
+
/** Normalizes provider-specific upload results into UploadedFile metadata; implementations may mutate the input. */
|
|
11
34
|
mapUploadedFile?(file: any): UploadedFile;
|
|
12
35
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Current formal acceptance facts; consumers decide which review mode their workflow requires. */
|
|
2
|
+
export interface ProjectTaskAcceptanceReceipt {
|
|
3
|
+
projectId: string;
|
|
4
|
+
taskId: string;
|
|
5
|
+
taskRevision: number;
|
|
6
|
+
conversationId: string;
|
|
7
|
+
decisionId: string;
|
|
8
|
+
review: {
|
|
9
|
+
executionId: string;
|
|
10
|
+
mode: 'evidence_only' | 'execution';
|
|
11
|
+
verdict: 'pass' | 'changes_required' | 'indeterminate';
|
|
12
|
+
} | null;
|
|
13
|
+
artifacts: Array<{
|
|
14
|
+
artifactId: string;
|
|
15
|
+
versionId: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
@@ -2,6 +2,8 @@ import { DiscoveryService, Reflector } from '@nestjs/core';
|
|
|
2
2
|
import type { ProjectTaskGraph, ProjectTaskGraphChange, ProjectTaskExecutionTarget, ProjectTaskTypeDefinition, TXpertProjectTaskStatus } from '@xpert-ai/contracts';
|
|
3
3
|
import { BaseStrategyRegistry } from '../strategy';
|
|
4
4
|
import type { ProjectAccessActor } from '../runtime/capabilities/project-access';
|
|
5
|
+
import type { ProjectTaskAcceptanceReceipt } from './acceptance';
|
|
6
|
+
export type { ProjectTaskAcceptanceReceipt } from './acceptance';
|
|
5
7
|
export interface ProjectTaskContext {
|
|
6
8
|
actor: ProjectAccessActor;
|
|
7
9
|
projectId: string;
|
|
@@ -60,6 +62,8 @@ export declare class ProjectTaskProviderRegistry extends BaseStrategyRegistry<IP
|
|
|
60
62
|
}
|
|
61
63
|
/** ORM-independent project task management; actor values come from trusted server context. */
|
|
62
64
|
export interface ProjectTasksApi {
|
|
65
|
+
/** Read current formal acceptance without dispatching or reconciling work; null means no current acceptance. */
|
|
66
|
+
readAcceptance(context: ProjectTaskContext, taskId: string): Promise<ProjectTaskAcceptanceReceipt | null>;
|
|
63
67
|
/** Read the saved graph and current execution facts. Never invokes provider snapshot/linked callbacks. */
|
|
64
68
|
graph(context: ProjectTaskContext): Promise<ProjectTaskGraph>;
|
|
65
69
|
/** After committing domain changes, enqueue a durable coalesced refresh; does not wait for provider callbacks. */
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { ArtifactUseGrantSummary, ResourceAnalysisDataset, ResourceAnalysisPolicy } from '@xpert-ai/contracts';
|
|
2
|
+
/** Offset pagination for source grant management; advance using the returned nextOffset, not a locally guessed cursor. */
|
|
3
|
+
export interface ArtifactGrantPage {
|
|
4
|
+
/** Zero-based start position; the runtime validates the supported range. */
|
|
5
|
+
offset: number;
|
|
6
|
+
/** Requested page size (1–100); a full page may require one further request to determine the end. */
|
|
7
|
+
limit: number;
|
|
8
|
+
}
|
|
9
|
+
/** Source-management display metadata for a grant; it is not a group reference or proof of current access. */
|
|
10
|
+
export interface ArtifactGrantDetails extends ArtifactUseGrantSummary {
|
|
11
|
+
/** Pinned version's display title; empty when its metadata is unavailable. */
|
|
12
|
+
title: string;
|
|
13
|
+
/** Pinned version's display sequence; 0 denotes unavailable metadata, not a usable version ID. */
|
|
14
|
+
versionNumber: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Source grant-management capability for external plugins' human authoring flows, such as a resource sharing View.
|
|
18
|
+
* The host resolves the authenticated human on every call; possession of the capability or plugin installation is not authority.
|
|
19
|
+
* Embedded Views use the bounded host authoring command rather than receiving login credentials or escalating a group session.
|
|
20
|
+
* Group acceptance/removal belongs to the receiving group's API and is intentionally not provided here.
|
|
21
|
+
*/
|
|
22
|
+
export interface ArtifactUseGrantsApi {
|
|
23
|
+
/**
|
|
24
|
+
* Inspect one published version's declared datasets and current source-sharing eligibility without executing data queries.
|
|
25
|
+
* Requires source management access. Returned canShare hints are advisory; offer rechecks the requested scope.
|
|
26
|
+
*/
|
|
27
|
+
analysisOptions(input: {
|
|
28
|
+
artifactId: string;
|
|
29
|
+
versionId: string;
|
|
30
|
+
}): Promise<ResourceAnalysisDataset[]>;
|
|
31
|
+
/**
|
|
32
|
+
* List groups the current human belongs to with a bound, non-archived usage Project, after checking source management.
|
|
33
|
+
* items[].id is the group ID and projectId is its usage Project. Candidates are not preauthorized offers; offer revalidates.
|
|
34
|
+
* nextOffset is null at the detected end of the list.
|
|
35
|
+
*/
|
|
36
|
+
targets(input: ArtifactGrantPage & {
|
|
37
|
+
artifactId: string;
|
|
38
|
+
}): Promise<{
|
|
39
|
+
items: Array<{
|
|
40
|
+
id: string;
|
|
41
|
+
title: string;
|
|
42
|
+
projectId: string;
|
|
43
|
+
}>;
|
|
44
|
+
nextOffset: number | null;
|
|
45
|
+
}>;
|
|
46
|
+
/** List this source Artifact's issued grants, including terminal/expired entries; nextOffset null ends pagination. */
|
|
47
|
+
issued(input: ArtifactGrantPage & {
|
|
48
|
+
artifactId: string;
|
|
49
|
+
}): Promise<{
|
|
50
|
+
items: ArtifactGrantDetails[];
|
|
51
|
+
nextOffset: number | null;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Create an offered grant for a fixed published version; it becomes usable only after group-owner acceptance.
|
|
55
|
+
* Both Projects and actor scope are resolved by the host. Existing grants are not silently replaced or broadened.
|
|
56
|
+
*/
|
|
57
|
+
offer(input: {
|
|
58
|
+
/** Source Artifact managed by the current human. */
|
|
59
|
+
artifactId: string;
|
|
60
|
+
/** Exact published version belonging to artifactId; never a draft or latest-version selector. */
|
|
61
|
+
versionId: string;
|
|
62
|
+
/** Receiving group in the same organization with a different usage Project from the source. */
|
|
63
|
+
targetGroupId: string;
|
|
64
|
+
/** Future ISO 8601 timestamp with timezone/offset; this runtime API does not accept a relative day count. */
|
|
65
|
+
expiresAt: string;
|
|
66
|
+
/** Proposed dataset analysis scope; omission creates a view-only offer and never grants upstream credentials. */
|
|
67
|
+
analysis?: ResourceAnalysisPolicy;
|
|
68
|
+
}): Promise<ArtifactUseGrantSummary>;
|
|
69
|
+
/**
|
|
70
|
+
* Revoke an offered/active grant belonging to artifactId using its latest grant revision, not a reference revision.
|
|
71
|
+
* A stale revision fails; refresh state before deciding to retry. Closure blocks future access but cannot recall disclosed data.
|
|
72
|
+
*/
|
|
73
|
+
revoke(input: {
|
|
74
|
+
artifactId: string;
|
|
75
|
+
grantId: string;
|
|
76
|
+
expectedRevision: number;
|
|
77
|
+
}): Promise<ArtifactUseGrantSummary>;
|
|
78
|
+
}
|
|
79
|
+
/** Stable plugin/host registry key; resolve via runtime capabilities rather than dispatching host-internal CQRS classes. */
|
|
80
|
+
export declare const ArtifactUseGrantsRuntimeCapability: import("../../core/runtime-capability").RuntimeCapabilityKey<ArtifactUseGrantsApi>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './actor-token';
|
|
2
2
|
export * from './artifacts';
|
|
3
3
|
export * from './artifact-library';
|
|
4
|
+
export * from './artifact-use-grants';
|
|
4
5
|
export * from './artifact-drafts';
|
|
5
6
|
export * from './artifact-content';
|
|
6
7
|
export * from './workspace-files';
|
|
@@ -8,6 +9,7 @@ export * from './workspace-storage';
|
|
|
8
9
|
export * from './sandbox-jobs';
|
|
9
10
|
export * from './project-provisioning';
|
|
10
11
|
export * from './project-access';
|
|
12
|
+
export * from './plugin-test-access';
|
|
11
13
|
export * from './project-files';
|
|
12
14
|
export * from './tool-images';
|
|
13
15
|
export * from './assistant-middleware-access';
|
|
@@ -15,3 +17,4 @@ export * from '../actor';
|
|
|
15
17
|
export * from './project-knowledge';
|
|
16
18
|
export * from './mcp-client-runtime';
|
|
17
19
|
export * from './rest-client-runtime';
|
|
20
|
+
export * from './project-configuration';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ProjectPipelineEvidenceRef } from '@xpert-ai/contracts';
|
|
2
|
+
import type { ProjectPipelineContext } from '../../project-pipeline/capability';
|
|
3
|
+
/** Prepare bounded MCP testing for a host-installed release. This API cannot install plugins. */
|
|
4
|
+
export interface PluginTestAccessApi {
|
|
5
|
+
prepare(context: ProjectPipelineContext, input: {
|
|
6
|
+
deployment: ProjectPipelineEvidenceRef;
|
|
7
|
+
componentKey: string;
|
|
8
|
+
}): Promise<{
|
|
9
|
+
path: string;
|
|
10
|
+
publicationId: string;
|
|
11
|
+
expiresAt: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
export declare const PluginTestAccessCapability: import("../../core/runtime-capability").RuntimeCapabilityKey<PluginTestAccessApi>;
|