@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
package/agent-results.cjs.js
CHANGED
|
@@ -8,7 +8,9 @@ require('zod/v3');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
exports.AGENT_TASK_RESULTS_FEATURE = results.AGENT_TASK_RESULTS_FEATURE;
|
|
11
|
+
exports.AGENT_TASK_RESULT_FILE_MAX_BYTES = results.AGENT_TASK_RESULT_FILE_MAX_BYTES;
|
|
11
12
|
exports.agentResultItemSchema = results.agentResultItemSchema;
|
|
13
|
+
exports.agentTaskResultFileSchema = results.agentTaskResultFileSchema;
|
|
12
14
|
exports.agentTaskResultSchema = results.agentTaskResultSchema;
|
|
13
15
|
Object.defineProperty(exports, "agentOutputDeliverySchema", {
|
|
14
16
|
enumerable: true,
|
package/agent-results.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AGENT_TASK_RESULTS_FEATURE, a as
|
|
1
|
+
export { A as AGENT_TASK_RESULTS_FEATURE, a as AGENT_TASK_RESULT_FILE_MAX_BYTES, b as agentResultItemSchema, c as agentTaskResultFileSchema, d as agentTaskResultSchema } from './results.esm.js';
|
|
2
2
|
export { agentOutputDeliverySchema, agentResultPathSchema } from '@xpert-ai/contracts';
|
|
3
3
|
import './_extends.esm.js';
|
|
4
4
|
import 'zod/v3';
|
package/analytics.cjs.js
CHANGED
|
@@ -1,9 +1,90 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var analyticsResult = require('./analytics-result.cjs.js');
|
|
4
|
-
require('zod/v3');
|
|
5
|
-
|
|
4
|
+
var v3 = require('zod/v3');
|
|
6
5
|
|
|
6
|
+
const key = v3.z.string().trim().min(1).max(128).refine((value)=>![
|
|
7
|
+
'__proto__',
|
|
8
|
+
'constructor',
|
|
9
|
+
'prototype'
|
|
10
|
+
].includes(value));
|
|
11
|
+
const scalar = v3.z.union([
|
|
12
|
+
v3.z.string().max(512),
|
|
13
|
+
v3.z.number().finite(),
|
|
14
|
+
v3.z.boolean(),
|
|
15
|
+
v3.z.null()
|
|
16
|
+
]);
|
|
17
|
+
/** Validate one predicate's shape/cardinality; field existence, logical types and allowed scope require live dataset metadata. */ const resourceAnalysisFilterSchema = v3.z.object({
|
|
18
|
+
field: key,
|
|
19
|
+
operator: v3.z.enum([
|
|
20
|
+
'eq',
|
|
21
|
+
'ne',
|
|
22
|
+
'in',
|
|
23
|
+
'gt',
|
|
24
|
+
'gte',
|
|
25
|
+
'lt',
|
|
26
|
+
'lte'
|
|
27
|
+
]),
|
|
28
|
+
values: v3.z.array(scalar).min(1).max(50)
|
|
29
|
+
}).strict().refine((value)=>value.operator === 'in' || value.values.length === 1);
|
|
30
|
+
/**
|
|
31
|
+
* Shared authoring/server policy boundary: bounded nonempty allowlists, fixed-filter fields and supported mode combinations.
|
|
32
|
+
* Parsing does not establish source sharing authority or receiving-group consent; those remain runtime checks.
|
|
33
|
+
*/ const resourceAnalysisPolicySchema = v3.z.object({
|
|
34
|
+
mode: v3.z.enum([
|
|
35
|
+
'bindings',
|
|
36
|
+
'explore'
|
|
37
|
+
]),
|
|
38
|
+
datasets: v3.z.array(v3.z.object({
|
|
39
|
+
key,
|
|
40
|
+
fields: v3.z.array(key).min(1).max(64),
|
|
41
|
+
filters: v3.z.array(resourceAnalysisFilterSchema).max(20)
|
|
42
|
+
}).strict()).min(1).max(20),
|
|
43
|
+
allowDetails: v3.z.boolean(),
|
|
44
|
+
maxRows: v3.z.number().int().min(1).max(100)
|
|
45
|
+
}).strict().refine((value)=>new Set(value.datasets.map((item)=>item.key)).size === value.datasets.length).refine((value)=>value.datasets.every((item)=>new Set(item.fields).size === item.fields.length && item.filters.every((filter)=>item.fields.includes(filter.field)))).refine((value)=>value.mode !== 'bindings' || value.allowDetails);
|
|
46
|
+
/**
|
|
47
|
+
* Normalize public query input to ResourceAnalysisQuery, defaulting optional wire collections to empty values.
|
|
48
|
+
* Keep limit absent so the executor uses the live policy's maxRows; validate field/mode/budget permissions before querying.
|
|
49
|
+
*/ const resourceAnalysisQuerySchema = v3.z.object({
|
|
50
|
+
datasetKey: key,
|
|
51
|
+
controls: v3.z.record(key, scalar).refine((value)=>Object.keys(value).length <= 32).default({}),
|
|
52
|
+
select: v3.z.array(key).max(64).default([]),
|
|
53
|
+
filters: v3.z.array(resourceAnalysisFilterSchema).max(20).default([]),
|
|
54
|
+
groupBy: v3.z.array(key).max(8).default([]),
|
|
55
|
+
aggregates: v3.z.array(v3.z.object({
|
|
56
|
+
field: key.optional(),
|
|
57
|
+
key,
|
|
58
|
+
operation: v3.z.enum([
|
|
59
|
+
'count',
|
|
60
|
+
'sum',
|
|
61
|
+
'min',
|
|
62
|
+
'max'
|
|
63
|
+
])
|
|
64
|
+
}).strict()).max(16).default([]),
|
|
65
|
+
orderBy: v3.z.array(v3.z.object({
|
|
66
|
+
field: key,
|
|
67
|
+
direction: v3.z.enum([
|
|
68
|
+
'asc',
|
|
69
|
+
'desc'
|
|
70
|
+
])
|
|
71
|
+
}).strict()).max(8).default([]),
|
|
72
|
+
limit: v3.z.number().int().min(1).max(100).optional()
|
|
73
|
+
}).strict();
|
|
74
|
+
/**
|
|
75
|
+
* Check a predicate scalar against the declared logical type, including exact-string int64/decimal wire values.
|
|
76
|
+
* Shared by authoring and execution; this does not validate the operator, field allowlist or grant authority.
|
|
77
|
+
*/ function isResourceAnalysisFilterValue(type, value) {
|
|
78
|
+
if (value === null) return true;
|
|
79
|
+
if (type === 'boolean') return typeof value === 'boolean';
|
|
80
|
+
if (type === 'float64') return typeof value === 'number' && Number.isFinite(value);
|
|
81
|
+
if (typeof value !== 'string') return false;
|
|
82
|
+
if (type === 'int64') return value.length <= 128 && /^-?\d+$/.test(value);
|
|
83
|
+
if (type === 'decimal') return value.length <= 128 && /^-?\d+(\.\d+)?$/.test(value);
|
|
84
|
+
if (type === 'date') return /^\d{4}-\d{2}-\d{2}$/.test(value) && Number.isFinite(Date.parse(value));
|
|
85
|
+
if (type === 'timestamp') return /^\d{4}-\d{2}-\d{2}T/.test(value) && Number.isFinite(Date.parse(value));
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
7
88
|
|
|
8
89
|
exports.analyticsBindingObjectSchema = analyticsResult.analyticsBindingObjectSchema;
|
|
9
90
|
exports.analyticsBindingSchema = analyticsResult.analyticsBindingSchema;
|
|
@@ -20,3 +101,7 @@ exports.analyticsSourceRefSchema = analyticsResult.analyticsSourceRefSchema;
|
|
|
20
101
|
exports.normalizeAnalyticsResult = analyticsResult.normalizeAnalyticsResult;
|
|
21
102
|
exports.resolveAnalyticsParameters = analyticsResult.resolveAnalyticsParameters;
|
|
22
103
|
exports.validateAnalyticsBinding = analyticsResult.validateAnalyticsBinding;
|
|
104
|
+
exports.isResourceAnalysisFilterValue = isResourceAnalysisFilterValue;
|
|
105
|
+
exports.resourceAnalysisFilterSchema = resourceAnalysisFilterSchema;
|
|
106
|
+
exports.resourceAnalysisPolicySchema = resourceAnalysisPolicySchema;
|
|
107
|
+
exports.resourceAnalysisQuerySchema = resourceAnalysisQuerySchema;
|
package/analytics.esm.js
CHANGED
|
@@ -1,2 +1,87 @@
|
|
|
1
1
|
export { a as analyticsBindingObjectSchema, b as analyticsBindingSchema, c as analyticsControlsSchema, d as analyticsDiscoveryRequestObjectSchema, e as analyticsDiscoveryRequestSchema, f as analyticsDiscoveryResultSchema, g as analyticsFieldSchema, h as analyticsOptionsSchema, i as analyticsParameterSchema, j as analyticsQueryRequestSchema, k as analyticsSourceKey, l as analyticsSourceRefSchema, n as normalizeAnalyticsResult, r as resolveAnalyticsParameters, v as validateAnalyticsBinding } from './analytics-result.esm.js';
|
|
2
|
-
import 'zod/v3';
|
|
2
|
+
import { z } from 'zod/v3';
|
|
3
|
+
|
|
4
|
+
const key = z.string().trim().min(1).max(128).refine((value)=>![
|
|
5
|
+
'__proto__',
|
|
6
|
+
'constructor',
|
|
7
|
+
'prototype'
|
|
8
|
+
].includes(value));
|
|
9
|
+
const scalar = z.union([
|
|
10
|
+
z.string().max(512),
|
|
11
|
+
z.number().finite(),
|
|
12
|
+
z.boolean(),
|
|
13
|
+
z.null()
|
|
14
|
+
]);
|
|
15
|
+
/** Validate one predicate's shape/cardinality; field existence, logical types and allowed scope require live dataset metadata. */ const resourceAnalysisFilterSchema = z.object({
|
|
16
|
+
field: key,
|
|
17
|
+
operator: z.enum([
|
|
18
|
+
'eq',
|
|
19
|
+
'ne',
|
|
20
|
+
'in',
|
|
21
|
+
'gt',
|
|
22
|
+
'gte',
|
|
23
|
+
'lt',
|
|
24
|
+
'lte'
|
|
25
|
+
]),
|
|
26
|
+
values: z.array(scalar).min(1).max(50)
|
|
27
|
+
}).strict().refine((value)=>value.operator === 'in' || value.values.length === 1);
|
|
28
|
+
/**
|
|
29
|
+
* Shared authoring/server policy boundary: bounded nonempty allowlists, fixed-filter fields and supported mode combinations.
|
|
30
|
+
* Parsing does not establish source sharing authority or receiving-group consent; those remain runtime checks.
|
|
31
|
+
*/ const resourceAnalysisPolicySchema = z.object({
|
|
32
|
+
mode: z.enum([
|
|
33
|
+
'bindings',
|
|
34
|
+
'explore'
|
|
35
|
+
]),
|
|
36
|
+
datasets: z.array(z.object({
|
|
37
|
+
key,
|
|
38
|
+
fields: z.array(key).min(1).max(64),
|
|
39
|
+
filters: z.array(resourceAnalysisFilterSchema).max(20)
|
|
40
|
+
}).strict()).min(1).max(20),
|
|
41
|
+
allowDetails: z.boolean(),
|
|
42
|
+
maxRows: z.number().int().min(1).max(100)
|
|
43
|
+
}).strict().refine((value)=>new Set(value.datasets.map((item)=>item.key)).size === value.datasets.length).refine((value)=>value.datasets.every((item)=>new Set(item.fields).size === item.fields.length && item.filters.every((filter)=>item.fields.includes(filter.field)))).refine((value)=>value.mode !== 'bindings' || value.allowDetails);
|
|
44
|
+
/**
|
|
45
|
+
* Normalize public query input to ResourceAnalysisQuery, defaulting optional wire collections to empty values.
|
|
46
|
+
* Keep limit absent so the executor uses the live policy's maxRows; validate field/mode/budget permissions before querying.
|
|
47
|
+
*/ const resourceAnalysisQuerySchema = z.object({
|
|
48
|
+
datasetKey: key,
|
|
49
|
+
controls: z.record(key, scalar).refine((value)=>Object.keys(value).length <= 32).default({}),
|
|
50
|
+
select: z.array(key).max(64).default([]),
|
|
51
|
+
filters: z.array(resourceAnalysisFilterSchema).max(20).default([]),
|
|
52
|
+
groupBy: z.array(key).max(8).default([]),
|
|
53
|
+
aggregates: z.array(z.object({
|
|
54
|
+
field: key.optional(),
|
|
55
|
+
key,
|
|
56
|
+
operation: z.enum([
|
|
57
|
+
'count',
|
|
58
|
+
'sum',
|
|
59
|
+
'min',
|
|
60
|
+
'max'
|
|
61
|
+
])
|
|
62
|
+
}).strict()).max(16).default([]),
|
|
63
|
+
orderBy: z.array(z.object({
|
|
64
|
+
field: key,
|
|
65
|
+
direction: z.enum([
|
|
66
|
+
'asc',
|
|
67
|
+
'desc'
|
|
68
|
+
])
|
|
69
|
+
}).strict()).max(8).default([]),
|
|
70
|
+
limit: z.number().int().min(1).max(100).optional()
|
|
71
|
+
}).strict();
|
|
72
|
+
/**
|
|
73
|
+
* Check a predicate scalar against the declared logical type, including exact-string int64/decimal wire values.
|
|
74
|
+
* Shared by authoring and execution; this does not validate the operator, field allowlist or grant authority.
|
|
75
|
+
*/ function isResourceAnalysisFilterValue(type, value) {
|
|
76
|
+
if (value === null) return true;
|
|
77
|
+
if (type === 'boolean') return typeof value === 'boolean';
|
|
78
|
+
if (type === 'float64') return typeof value === 'number' && Number.isFinite(value);
|
|
79
|
+
if (typeof value !== 'string') return false;
|
|
80
|
+
if (type === 'int64') return value.length <= 128 && /^-?\d+$/.test(value);
|
|
81
|
+
if (type === 'decimal') return value.length <= 128 && /^-?\d+(\.\d+)?$/.test(value);
|
|
82
|
+
if (type === 'date') return /^\d{4}-\d{2}-\d{2}$/.test(value) && Number.isFinite(Date.parse(value));
|
|
83
|
+
if (type === 'timestamp') return /^\d{4}-\d{2}-\d{2}T/.test(value) && Number.isFinite(Date.parse(value));
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export { isResourceAnalysisFilterValue, resourceAnalysisFilterSchema, resourceAnalysisPolicySchema, resourceAnalysisQuerySchema };
|
package/docs/artifact-types.md
CHANGED
|
@@ -103,3 +103,33 @@ Types that own an application draft workflow can declare `versioning: { mode: 'd
|
|
|
103
103
|
`ArtifactContentRuntimeCapability` stores definition bytes in protected Artifact-owned storage. Ordinary project file listings and file tools cannot read that storage. Reads check the current source policy and require draft access unless the exact content is already referenced by a formal version. The platform validates ownership, canonical references, checksums and the 50 MB limit.
|
|
104
104
|
|
|
105
105
|
By default, Project membership and link audience are cumulative restrictions. A type may explicitly declare `sharing.projectAccess: 'link-audience'` only with authenticated presentation and organization/workspace audiences. In that case a manager's explicit share can grant access to the published definition outside Project membership. Provider authorization and any resource ACL still apply; tenant and audience membership are checked, revocation remains immediate, and the exception never applies to drafts, generic file APIs, library references, edits or data queries. It cannot enable anonymous/public sharing.
|
|
106
|
+
|
|
107
|
+
## Fixed-version analytics extension
|
|
108
|
+
|
|
109
|
+
A type may implement optional `analytics: ArtifactTypeAnalytics` on its existing
|
|
110
|
+
`IArtifactTypeProvider`. There is no additional decorator, registry or renderer
|
|
111
|
+
requirement for this extension. Its registration follows the type's exact plugin
|
|
112
|
+
installation; removal never falls back to another provider.
|
|
113
|
+
|
|
114
|
+
- `resolveBindings(context)` reads only the supplied `ArtifactVersionContext` and
|
|
115
|
+
returns `{ binding, title? }` entries with unique `binding.id` dataset keys.
|
|
116
|
+
Preserve published source, operation and native payload; never resolve a newer
|
|
117
|
+
source definition. An empty array declares no datasets for that version.
|
|
118
|
+
- `normalizeControls(context, datasetKey, controls)` is optional. Validate domain
|
|
119
|
+
control names/types/allowlists, apply published defaults, and select the binding's
|
|
120
|
+
parameters. Omission passes input through unchanged. Analytics subsequently
|
|
121
|
+
enforces its own parameter schema and execution constraints.
|
|
122
|
+
- Both hooks describe or normalize declarations only: they must not query data,
|
|
123
|
+
discover sources, make sharing decisions or open a Workbench. Native binding
|
|
124
|
+
payloads remain server-only; the host builds safe, permission-filtered descriptions.
|
|
125
|
+
- Source disclosure authority is checked by the existing `AnalyticsQueryProvider`'s
|
|
126
|
+
optional `authorizeGroupSharing(binding, context)`. Unsupported providers are not
|
|
127
|
+
eligible for analysis sharing. Actual data execution continues through `execute`
|
|
128
|
+
as the requesting human, independently of the source owner's sharing authority.
|
|
129
|
+
|
|
130
|
+
The host authorizes the fixed version, verifies bytes, validates plugin declarations,
|
|
131
|
+
checks accepted dataset/field/row scope, and revalidates grants and registrations
|
|
132
|
+
before releasing results. Do not treat a retained context as durable authorization.
|
|
133
|
+
`IArtifactPresentationProvider` remains responsible for read-only rendering and UI
|
|
134
|
+
queries; it has no headless analysis hook. Group grants currently still require an
|
|
135
|
+
`authenticated` presentation declaration; adding analytics does not relax that policy.
|
package/index.cjs.js
CHANGED
|
@@ -42,6 +42,7 @@ var connector = require('./connector.cjs.js');
|
|
|
42
42
|
var node_path = require('node:path');
|
|
43
43
|
var _object_without_properties_loose$2 = require('./_object_without_properties_loose.cjs.js');
|
|
44
44
|
var collaborationClient = require('./collaboration-client.cjs.js');
|
|
45
|
+
var crypto = require('crypto');
|
|
45
46
|
var tools = require('@langchain/core/tools');
|
|
46
47
|
|
|
47
48
|
function _interopNamespaceDefault(e) {
|
|
@@ -6919,6 +6920,8 @@ exports.ArtifactPresentationRegistry = __decorate([
|
|
|
6919
6920
|
], exports.ArtifactPresentationRegistry);
|
|
6920
6921
|
|
|
6921
6922
|
/** Package exports are a runtime boundary; reject malformed declarations before registration. */ const artifactTypeDefinitionSchema = v3.z.object({
|
|
6923
|
+
contentTypeId: v3.z.string().trim().min(1).max(200).optional(),
|
|
6924
|
+
icon: contracts.iconDefinitionSchema.optional(),
|
|
6922
6925
|
title: v3.z.object({
|
|
6923
6926
|
en_US: v3.z.string().trim().min(1).max(200),
|
|
6924
6927
|
zh_Hans: v3.z.string().trim().min(1).max(200).optional(),
|
|
@@ -6937,6 +6940,11 @@ exports.ArtifactPresentationRegistry = __decorate([
|
|
|
6937
6940
|
collection: v3.z.object({
|
|
6938
6941
|
allowCopy: v3.z.boolean()
|
|
6939
6942
|
}).strict().optional(),
|
|
6943
|
+
useGrants: v3.z.object({
|
|
6944
|
+
audience: v3.z.literal('group'),
|
|
6945
|
+
permission: v3.z.literal('read'),
|
|
6946
|
+
queryOperations: v3.z.array(v3.z.string().min(1).max(80)).max(32).optional()
|
|
6947
|
+
}).strict().optional(),
|
|
6940
6948
|
versioning: v3.z.object({
|
|
6941
6949
|
mode: v3.z.literal('draft-only')
|
|
6942
6950
|
}).strict().optional(),
|
|
@@ -6971,7 +6979,7 @@ exports.ArtifactPresentationRegistry = __decorate([
|
|
|
6971
6979
|
'authenticated'
|
|
6972
6980
|
])
|
|
6973
6981
|
}).strict()
|
|
6974
|
-
}).strict().refine((definition)=>{
|
|
6982
|
+
}).strict().refine((definition)=>!definition.useGrants || definition.presentation.mode === 'authenticated', 'Group use grants require an authenticated presentation').refine((definition)=>{
|
|
6975
6983
|
var _definition_sharing;
|
|
6976
6984
|
return ((_definition_sharing = definition.sharing) == null ? void 0 : _definition_sharing.projectAccess) !== 'link-audience' || definition.presentation.mode === 'authenticated' && definition.sharing.accessModes.every((mode)=>[
|
|
6977
6985
|
'organization_all',
|
|
@@ -7011,6 +7019,7 @@ const FILE_ARTIFACT_TYPE = {
|
|
|
7011
7019
|
var _provider_snapshot, _this_strategies_get;
|
|
7012
7020
|
if (!(provider == null ? void 0 : provider.definition) || typeof provider.authorize !== 'function' || typeof provider.validateContent !== 'function') throw new Error('ARTIFACT_TYPE_INVALID');
|
|
7013
7021
|
artifactTypeDefinitionSchema.parse(provider.definition);
|
|
7022
|
+
if (provider.analytics && (typeof provider.analytics.resolveBindings !== 'function' || provider.analytics.normalizeControls !== undefined && typeof provider.analytics.normalizeControls !== 'function')) throw new Error('ARTIFACT_TYPE_ANALYTICS_INVALID');
|
|
7014
7023
|
const identity = JSON.parse(key);
|
|
7015
7024
|
if (!Array.isArray(identity) || identity.length !== 2 || identity.some((value)=>typeof value !== 'string' || !value.trim())) throw new Error('ARTIFACT_TYPE_INVALID');
|
|
7016
7025
|
if (source.kind === 'plugin' && (identity[0] !== source.pluginName || source.pluginName === '@xpert-ai/platform')) throw new Error('ARTIFACT_TYPE_NAMESPACE_DENIED');
|
|
@@ -7167,10 +7176,10 @@ const ContentResourcesRuntimeCapability = modelProvider.createRuntimeCapability(
|
|
|
7167
7176
|
});
|
|
7168
7177
|
|
|
7169
7178
|
const EVOLUTION_TARGET_PROVIDER = 'EVOLUTION_TARGET_PROVIDER';
|
|
7170
|
-
const EvolutionTargetProviderStrategy = (providerKey)=>common.applyDecorators(common.SetMetadata(EVOLUTION_TARGET_PROVIDER, providerKey), common.SetMetadata(STRATEGY_META_KEY, EVOLUTION_TARGET_PROVIDER));
|
|
7179
|
+
/** Declares the stable registration key of an evolution target provider. */ const EvolutionTargetProviderStrategy = (providerKey)=>common.applyDecorators(common.SetMetadata(EVOLUTION_TARGET_PROVIDER, providerKey), common.SetMetadata(STRATEGY_META_KEY, EVOLUTION_TARGET_PROVIDER));
|
|
7171
7180
|
|
|
7172
|
-
exports.EvolutionTargetProviderRegistry = class EvolutionTargetProviderRegistry extends BaseStrategyRegistry {
|
|
7173
|
-
listDescriptors(organizationId) {
|
|
7181
|
+
/** Registry of evolution targets visible within a strategy scope. */ exports.EvolutionTargetProviderRegistry = class EvolutionTargetProviderRegistry extends BaseStrategyRegistry {
|
|
7182
|
+
/** Returns target declarations visible in the supplied organization scope. */ listDescriptors(organizationId) {
|
|
7174
7183
|
return this.list(organizationId).map((provider)=>provider.descriptor);
|
|
7175
7184
|
}
|
|
7176
7185
|
constructor(discoveryService, reflector){
|
|
@@ -7186,16 +7195,29 @@ exports.EvolutionTargetProviderRegistry = __decorate([
|
|
|
7186
7195
|
], exports.EvolutionTargetProviderRegistry);
|
|
7187
7196
|
|
|
7188
7197
|
const EVOLUTION_RUNTIME_SERVICE_TOKEN = 'XPERT_EVOLUTION_RUNTIME_SERVICE';
|
|
7189
|
-
const EvolutionBaselineRuntimeCapability = modelProvider.createRuntimeCapability('platform.agent-evolution.baselines', {
|
|
7198
|
+
/** Capability for inspecting and publishing source baselines within an authorized organization. */ const EvolutionBaselineRuntimeCapability = modelProvider.createRuntimeCapability('platform.agent-evolution.baselines', {
|
|
7190
7199
|
description: 'Inspect and initialize organization rule baselines with administrator authorization and revision checks.'
|
|
7191
7200
|
});
|
|
7192
|
-
const EvolutionRuntimeCapability = modelProvider.createRuntimeCapability('platform.agent-evolution', {
|
|
7201
|
+
/** Capability for version selection and evidence tied to Agent executions. */ const EvolutionRuntimeCapability = modelProvider.createRuntimeCapability('platform.agent-evolution', {
|
|
7193
7202
|
description: 'Ingest learning signals and resolve immutable capability versions for domain runtimes.'
|
|
7194
7203
|
});
|
|
7195
|
-
const EvolutionChangeRuntimeCapability = modelProvider.createRuntimeCapability('platform.agent-evolution.changes', {
|
|
7204
|
+
/** Capability for scoped preparation, review and publication of versioned changes. */ const EvolutionChangeRuntimeCapability = modelProvider.createRuntimeCapability('platform.agent-evolution.changes', {
|
|
7196
7205
|
description: 'Prepare, evaluate and publish versioned changes through target-owned validators and effect providers.'
|
|
7197
7206
|
});
|
|
7198
7207
|
|
|
7208
|
+
/** Returns the sha256-prefixed hex digest of the canonical JSON value. */ function hashEvolutionValue(value) {
|
|
7209
|
+
return `sha256:${crypto.createHash('sha256').update(canonicalEvolutionJson(value)).digest('hex')}`;
|
|
7210
|
+
}
|
|
7211
|
+
/** Serializes JSON with object keys in sorted order and array elements in their original order. */ function canonicalEvolutionJson(value) {
|
|
7212
|
+
if (value === null || typeof value === 'boolean' || typeof value === 'number' || typeof value === 'string') {
|
|
7213
|
+
return JSON.stringify(value);
|
|
7214
|
+
}
|
|
7215
|
+
if (Array.isArray(value)) {
|
|
7216
|
+
return `[${value.map((item)=>canonicalEvolutionJson(item)).join(',')}]`;
|
|
7217
|
+
}
|
|
7218
|
+
return `{${Object.keys(value).sort().map((key)=>`${JSON.stringify(key)}:${canonicalEvolutionJson(value[key])}`).join(',')}}`;
|
|
7219
|
+
}
|
|
7220
|
+
|
|
7199
7221
|
function defineMcpApp(definition) {
|
|
7200
7222
|
return Object.freeze(definition);
|
|
7201
7223
|
}
|
|
@@ -7588,6 +7610,30 @@ function includesValue(values, value) {
|
|
|
7588
7610
|
return values.some((candidate)=>candidate === value);
|
|
7589
7611
|
}
|
|
7590
7612
|
|
|
7613
|
+
function sameOwner(left, right) {
|
|
7614
|
+
return left.kind === 'plugin' ? right.kind === 'plugin' && left.pluginName === right.pluginName : right.kind === 'builtin';
|
|
7615
|
+
}
|
|
7616
|
+
/** Component keys belong to a plugin; public strategy and Tool names retain their scope-wide claims. */ function assertXpertToolProviderClaims(candidate, existing) {
|
|
7617
|
+
const { source, descriptor } = candidate;
|
|
7618
|
+
const tools = new Set(descriptor.tools.map(({ options })=>options.name));
|
|
7619
|
+
for (const other of existing){
|
|
7620
|
+
if (other.source.scopeKey !== source.scopeKey) continue;
|
|
7621
|
+
const owner = sameOwner(source, other.source);
|
|
7622
|
+
const otherOwner = other.source.kind === 'plugin' ? other.source.pluginName : 'built-in providers';
|
|
7623
|
+
if (other.descriptor.options.provider === descriptor.options.provider) {
|
|
7624
|
+
if (owner) continue; // A new instance/version may replace the same owner's registration.
|
|
7625
|
+
throw new Error(`Provider '${descriptor.options.provider}' is already registered by '${otherOwner}' in scope '${source.scopeKey}'.`);
|
|
7626
|
+
}
|
|
7627
|
+
if (owner && other.descriptor.options.componentKey === descriptor.options.componentKey) {
|
|
7628
|
+
throw new Error(`Component key '${descriptor.options.componentKey}' is already registered for '${otherOwner}' in scope '${source.scopeKey}'.`);
|
|
7629
|
+
}
|
|
7630
|
+
const duplicate = other.descriptor.tools.find(({ options })=>tools.has(options.name));
|
|
7631
|
+
if (duplicate) {
|
|
7632
|
+
throw new Error(`Tool '${duplicate.options.name}' is already registered by '${otherOwner}' in scope '${source.scopeKey}'.`);
|
|
7633
|
+
}
|
|
7634
|
+
}
|
|
7635
|
+
}
|
|
7636
|
+
|
|
7591
7637
|
exports.XpertToolProviderRegistry = class XpertToolProviderRegistry extends BaseStrategyRegistry {
|
|
7592
7638
|
upsert(candidate) {
|
|
7593
7639
|
const target = resolveStrategyMetadataTarget(candidate);
|
|
@@ -7595,7 +7641,13 @@ exports.XpertToolProviderRegistry = class XpertToolProviderRegistry extends Base
|
|
|
7595
7641
|
const instance = candidate;
|
|
7596
7642
|
const descriptor = describeXpertToolProvider(instance);
|
|
7597
7643
|
const source = this.getSource(instance);
|
|
7598
|
-
|
|
7644
|
+
assertXpertToolProviderClaims({
|
|
7645
|
+
descriptor,
|
|
7646
|
+
source
|
|
7647
|
+
}, this.listAllRegistrations().filter(({ strategy })=>strategy !== instance).map(({ strategy, source })=>({
|
|
7648
|
+
descriptor: describeXpertToolProvider(strategy),
|
|
7649
|
+
source
|
|
7650
|
+
})));
|
|
7599
7651
|
const previous = this.register(descriptor.options.provider, instance, source);
|
|
7600
7652
|
this.replacements.set(instance, previous != null ? previous : null);
|
|
7601
7653
|
}
|
|
@@ -7610,22 +7662,6 @@ exports.XpertToolProviderRegistry = class XpertToolProviderRegistry extends Base
|
|
|
7610
7662
|
}
|
|
7611
7663
|
this.replacements.delete(instance);
|
|
7612
7664
|
}
|
|
7613
|
-
assertUniqueClaims(instance, descriptor, scopeKey) {
|
|
7614
|
-
var _this_strategies_get;
|
|
7615
|
-
const toolNames = new Set(descriptor.tools.map(({ options })=>options.name));
|
|
7616
|
-
var _this_strategies_get_entries;
|
|
7617
|
-
for (const [providerKey, existing] of (_this_strategies_get_entries = (_this_strategies_get = this.strategies.get(scopeKey)) == null ? void 0 : _this_strategies_get.entries()) != null ? _this_strategies_get_entries : []){
|
|
7618
|
-
if (existing === instance || providerKey === descriptor.options.provider) continue;
|
|
7619
|
-
const existingDescriptor = describeXpertToolProvider(existing);
|
|
7620
|
-
if (existingDescriptor.options.componentKey === descriptor.options.componentKey) {
|
|
7621
|
-
throw new Error(`Component key '${descriptor.options.componentKey}' is already registered for scope '${scopeKey}'.`);
|
|
7622
|
-
}
|
|
7623
|
-
const duplicateTool = existingDescriptor.tools.find(({ options })=>toolNames.has(options.name));
|
|
7624
|
-
if (duplicateTool) {
|
|
7625
|
-
throw new Error(`Tool '${duplicateTool.options.name}' is already registered for scope '${scopeKey}'.`);
|
|
7626
|
-
}
|
|
7627
|
-
}
|
|
7628
|
-
}
|
|
7629
7665
|
constructor(discoveryService, reflector){
|
|
7630
7666
|
super(XPERT_TOOL_PROVIDER, discoveryService, reflector);
|
|
7631
7667
|
this.replacements = new WeakMap();
|
|
@@ -11022,7 +11058,7 @@ exports.ProjectTaskProviderRegistry = __decorate([
|
|
|
11022
11058
|
])
|
|
11023
11059
|
], exports.ProjectTaskProviderRegistry);
|
|
11024
11060
|
const ProjectTasksRuntimeCapability = modelProvider.createRuntimeCapability('platform.project.tasks', {
|
|
11025
|
-
description: 'Read project task graphs, request background synchronization, manage schedules, and resolve exact execution conversations.'
|
|
11061
|
+
description: 'Read project task graphs and acceptance receipts, request background synchronization, manage schedules, and resolve exact execution conversations.'
|
|
11026
11062
|
});
|
|
11027
11063
|
|
|
11028
11064
|
class UnavailablePipelineContribution {
|
|
@@ -11424,6 +11460,7 @@ exports.ActorTokenRuntimeFactoryCapability = modelProvider.ActorTokenRuntimeFact
|
|
|
11424
11460
|
exports.ArtifactContentRuntimeCapability = modelProvider.ArtifactContentRuntimeCapability;
|
|
11425
11461
|
exports.ArtifactDraftsRuntimeCapability = modelProvider.ArtifactDraftsRuntimeCapability;
|
|
11426
11462
|
exports.ArtifactLibraryRuntimeCapability = modelProvider.ArtifactLibraryRuntimeCapability;
|
|
11463
|
+
exports.ArtifactUseGrantsRuntimeCapability = modelProvider.ArtifactUseGrantsRuntimeCapability;
|
|
11427
11464
|
exports.ArtifactsRuntimeCapability = modelProvider.ArtifactsRuntimeCapability;
|
|
11428
11465
|
exports.AssistantMiddlewareAccessRuntimeCapability = modelProvider.AssistantMiddlewareAccessRuntimeCapability;
|
|
11429
11466
|
exports.BaseTool = modelProvider.BaseTool;
|
|
@@ -11433,7 +11470,9 @@ exports.DefaultAgentMiddlewareRuntimeCapabilityRegistry = modelProvider.DefaultR
|
|
|
11433
11470
|
exports.DefaultRuntimeCapabilityRegistry = modelProvider.DefaultRuntimeCapabilityRegistry;
|
|
11434
11471
|
exports.McpClientRuntimeCapability = modelProvider.McpClientRuntimeCapability;
|
|
11435
11472
|
exports.ModelProviderBuiltinToolset = modelProvider.ModelProviderBuiltinToolset;
|
|
11473
|
+
exports.PluginTestAccessCapability = modelProvider.PluginTestAccessCapability;
|
|
11436
11474
|
exports.ProjectAccessRuntimeCapability = modelProvider.ProjectAccessRuntimeCapability;
|
|
11475
|
+
exports.ProjectConfigurationRuntimeCapability = modelProvider.ProjectConfigurationRuntimeCapability;
|
|
11437
11476
|
exports.ProjectFilesRuntimeCapability = modelProvider.ProjectFilesRuntimeCapability;
|
|
11438
11477
|
exports.ProjectKnowledgeRuntimeCapability = modelProvider.ProjectKnowledgeRuntimeCapability;
|
|
11439
11478
|
exports.ProjectProvisioningRuntimeCapability = modelProvider.ProjectProvisioningRuntimeCapability;
|
|
@@ -11474,7 +11513,9 @@ exports.validateAnalyticsBinding = analyticsResult.validateAnalyticsBinding;
|
|
|
11474
11513
|
exports.ModelProviderHttpClient = modelProviderHttpClient.ModelProviderHttpClient;
|
|
11475
11514
|
exports.ModelProviderHttpError = modelProviderHttpClient.ModelProviderHttpError;
|
|
11476
11515
|
exports.AGENT_TASK_RESULTS_FEATURE = results.AGENT_TASK_RESULTS_FEATURE;
|
|
11516
|
+
exports.AGENT_TASK_RESULT_FILE_MAX_BYTES = results.AGENT_TASK_RESULT_FILE_MAX_BYTES;
|
|
11477
11517
|
exports.agentResultItemSchema = results.agentResultItemSchema;
|
|
11518
|
+
exports.agentTaskResultFileSchema = results.agentTaskResultFileSchema;
|
|
11478
11519
|
exports.agentTaskResultSchema = results.agentTaskResultSchema;
|
|
11479
11520
|
exports.CONNECTOR_AUTHORIZATION_MODES = connector.CONNECTOR_AUTHORIZATION_MODES;
|
|
11480
11521
|
exports.CONNECTOR_SCOPE_TYPES = connector.CONNECTOR_SCOPE_TYPES;
|
|
@@ -11736,11 +11777,13 @@ exports.applyModelConfiguration = applyModelConfiguration;
|
|
|
11736
11777
|
exports.applyModelContextSize = applyModelContextSize;
|
|
11737
11778
|
exports.artifactPresentationKey = artifactPresentationKey;
|
|
11738
11779
|
exports.artifactTypeKey = artifactTypeKey;
|
|
11780
|
+
exports.assertXpertToolProviderClaims = assertXpertToolProviderClaims;
|
|
11739
11781
|
exports.buildSandboxTimeoutMessage = buildSandboxTimeoutMessage;
|
|
11740
11782
|
exports.calcTokenUsage = calcTokenUsage;
|
|
11741
11783
|
exports.calculateLLMUsagePrice = calculateLLMUsagePrice;
|
|
11742
11784
|
exports.calculateModelPrice = calculateModelPrice;
|
|
11743
11785
|
exports.calculateModelUsageCharge = calculateModelUsageCharge;
|
|
11786
|
+
exports.canonicalEvolutionJson = canonicalEvolutionJson;
|
|
11744
11787
|
exports.chunkText = chunkText;
|
|
11745
11788
|
exports.countTextTokens = countTextTokens;
|
|
11746
11789
|
exports.countTokensSafe = countTokensSafe;
|
|
@@ -11772,6 +11815,7 @@ exports.getRequiredPermissionOperation = getRequiredPermissionOperation;
|
|
|
11772
11815
|
exports.getTenantGlobalScopeKey = getTenantGlobalScopeKey;
|
|
11773
11816
|
exports.getXpertToolMethod = getXpertToolMethod;
|
|
11774
11817
|
exports.hasAssistantMiddleware = hasAssistantMiddleware;
|
|
11818
|
+
exports.hashEvolutionValue = hashEvolutionValue;
|
|
11775
11819
|
exports.isAgentInvocationTerminal = isAgentInvocationTerminal;
|
|
11776
11820
|
exports.isDevelopmentSandboxRuntimeEnvironment = isDevelopmentSandboxRuntimeEnvironment;
|
|
11777
11821
|
exports.isExecutionObservationSession = isExecutionObservationSession;
|