@xpert-ai/plugin-sdk 3.34.0 → 3.36.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 +5 -1
- package/agent-results.esm.js +2 -2
- package/analytics-result.cjs.js +64 -27
- package/analytics-result.esm.js +62 -28
- package/analytics.cjs.js +157 -15
- package/analytics.esm.js +154 -17
- package/artifact-document.cjs.js +9 -3
- package/artifact-document.esm.js +9 -3
- package/collaboration-client.cjs.js +274 -140
- package/collaboration-client.esm.js +273 -141
- package/docs/README.md +23 -0
- package/index.cjs.js +214 -9
- package/index.esm.js +193 -15
- package/model-provider.cjs.js +8 -0
- package/model-provider.esm.js +7 -1
- package/package.json +8 -2
- package/remote-component.cjs.default.js +1 -0
- package/remote-component.cjs.js +143 -0
- package/remote-component.cjs.mjs +2 -0
- package/remote-component.d.ts +1 -0
- package/remote-component.esm.js +139 -0
- package/results.cjs.js +2 -6
- package/results.esm.js +2 -6
- package/src/analytics.d.ts +2 -0
- package/src/collaboration-client.d.ts +1 -0
- package/src/index.d.ts +1 -0
- package/src/lib/agent/handoff/agent-runtime-message.contract.d.ts +24 -24
- package/src/lib/agent/middleware/strategy.interface.d.ts +2 -0
- package/src/lib/agent/runtime/capability.d.ts +2 -0
- package/src/lib/agent/runtime/cli-model-profile.d.ts +14 -1
- package/src/lib/agent/runtime/dispatch.d.ts +298 -75
- package/src/lib/agent/runtime/execution-runner.d.ts +24 -5
- package/src/lib/agent/runtime/pipeline-scope.d.ts +4 -4
- package/src/lib/agent/runtime/results.d.ts +16 -219
- package/src/lib/agent/runtime/strategy.d.ts +3 -0
- package/src/lib/agent/runtime/types.d.ts +21 -0
- package/src/lib/agent-event/index.d.ts +55 -0
- package/src/lib/agent-event/journal.d.ts +30 -0
- package/src/lib/artifact-document/dependencies.d.ts +13 -13
- package/src/lib/artifact-document/protocol.d.ts +2 -2
- package/src/lib/artifact-document/scheduler.d.ts +3 -0
- package/src/lib/assistant-capability/middleware.d.ts +2 -1
- package/src/lib/collaboration/client.d.ts +6 -59
- package/src/lib/collaboration/index.d.ts +1 -0
- package/src/lib/collaboration/operations-client.d.ts +23 -0
- package/src/lib/collaboration/presence.d.ts +36 -0
- package/src/lib/collaboration/provider.registry.d.ts +2 -2
- package/src/lib/collaboration/transport.d.ts +24 -0
- package/src/lib/collaboration/types.d.ts +57 -5
- package/src/lib/content-resource/catalog.d.ts +23 -1
- package/src/lib/content-resource/editor.d.ts +36 -1
- package/src/lib/data/analytics/analysis-evidence.d.ts +757 -0
- package/src/lib/data/analytics/analytics-certification.d.ts +64 -0
- package/src/lib/data/analytics/analytics-provider.d.ts +9 -0
- package/src/lib/data/analytics/analytics-value.d.ts +5 -0
- package/src/lib/data/analytics/index.d.ts +1 -0
- package/src/lib/evolution/runtime-capability.d.ts +1 -0
- package/src/lib/project-pipeline/adapters.d.ts +9 -2
- package/src/lib/project-pipeline/registry.d.ts +53 -50
- package/src/lib/project-task/acceptance.d.ts +29 -0
- package/src/lib/project-task/index.d.ts +6 -0
- package/src/lib/runtime/capabilities/index.d.ts +2 -0
- package/src/lib/runtime/capabilities/plugin-test-access.d.ts +14 -0
- package/src/lib/runtime/capabilities/project-configuration.d.ts +166 -0
- package/src/lib/view-extension/provider.interface.d.ts +51 -0
- package/src/remote-component.d.ts +13 -0
package/analytics.esm.js
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import { a as analyticsCertificationSchema, b as analyticsFieldSchema, i as isAnalyticsCell } from './analytics-result.esm.js';
|
|
2
|
+
export { c as analyticsBindingObjectSchema, d as analyticsBindingSchema, e as analyticsControlsSchema, f as analyticsDiscoveryRequestObjectSchema, g as analyticsDiscoveryRequestSchema, h as analyticsDiscoveryResultSchema, j as analyticsOptionsSchema, k as analyticsParameterSchema, l as analyticsQueryRequestSchema, m as analyticsSourceKey, n as analyticsSourceRefSchema, o as normalizeAnalyticsResult, p as parseAnalyticsCertification, r as resolveAnalyticsParameters, v as validateAnalyticsBinding } from './analytics-result.esm.js';
|
|
2
3
|
import { z } from 'zod/v3';
|
|
4
|
+
import { _ as _object_without_properties_loose } from './_object_without_properties_loose.esm.js';
|
|
5
|
+
import './_extends.esm.js';
|
|
3
6
|
|
|
4
|
-
const key = z.string().trim().min(1).max(128).refine((value)=>![
|
|
7
|
+
const key$1 = z.string().trim().min(1).max(128).refine((value)=>![
|
|
5
8
|
'__proto__',
|
|
6
9
|
'constructor',
|
|
7
10
|
'prototype'
|
|
8
11
|
].includes(value));
|
|
9
|
-
const scalar = z.union([
|
|
12
|
+
const scalar$1 = z.union([
|
|
10
13
|
z.string().max(512),
|
|
11
14
|
z.number().finite(),
|
|
12
15
|
z.boolean(),
|
|
13
16
|
z.null()
|
|
14
17
|
]);
|
|
15
18
|
/** Validate one predicate's shape/cardinality; field existence, logical types and allowed scope require live dataset metadata. */ const resourceAnalysisFilterSchema = z.object({
|
|
16
|
-
field: key,
|
|
19
|
+
field: key$1,
|
|
17
20
|
operator: z.enum([
|
|
18
21
|
'eq',
|
|
19
22
|
'ne',
|
|
@@ -23,36 +26,41 @@ const scalar = z.union([
|
|
|
23
26
|
'lt',
|
|
24
27
|
'lte'
|
|
25
28
|
]),
|
|
26
|
-
values: z.array(scalar).min(1).max(50)
|
|
29
|
+
values: z.array(scalar$1).min(1).max(50)
|
|
27
30
|
}).strict().refine((value)=>value.operator === 'in' || value.values.length === 1);
|
|
28
31
|
/**
|
|
29
32
|
* Shared authoring/server policy boundary: bounded nonempty allowlists, fixed-filter fields and supported mode combinations.
|
|
30
33
|
* Parsing does not establish source sharing authority or receiving-group consent; those remain runtime checks.
|
|
31
34
|
*/ const resourceAnalysisPolicySchema = z.object({
|
|
35
|
+
execution: z.enum([
|
|
36
|
+
'viewer_permissions',
|
|
37
|
+
'delegated_results'
|
|
38
|
+
]).optional(),
|
|
32
39
|
mode: z.enum([
|
|
33
40
|
'bindings',
|
|
34
41
|
'explore'
|
|
35
42
|
]),
|
|
36
43
|
datasets: z.array(z.object({
|
|
37
|
-
key,
|
|
38
|
-
fields: z.array(key).min(1).max(64),
|
|
39
|
-
filters: z.array(resourceAnalysisFilterSchema).max(20)
|
|
44
|
+
key: key$1,
|
|
45
|
+
fields: z.array(key$1).min(1).max(64),
|
|
46
|
+
filters: z.array(resourceAnalysisFilterSchema).max(20),
|
|
47
|
+
controlValues: z.record(key$1, z.array(scalar$1).min(1).max(50)).refine((value)=>Object.keys(value).length <= 32).optional()
|
|
40
48
|
}).strict()).min(1).max(20),
|
|
41
49
|
allowDetails: z.boolean(),
|
|
42
50
|
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);
|
|
51
|
+
}).strict().refine((value)=>value.execution === 'delegated_results' || value.datasets.every((item)=>!item.controlValues)).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
52
|
/**
|
|
45
53
|
* Normalize public query input to ResourceAnalysisQuery, defaulting optional wire collections to empty values.
|
|
46
54
|
* Keep limit absent so the executor uses the live policy's maxRows; validate field/mode/budget permissions before querying.
|
|
47
55
|
*/ 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([]),
|
|
56
|
+
datasetKey: key$1,
|
|
57
|
+
controls: z.record(key$1, scalar$1).refine((value)=>Object.keys(value).length <= 32).default({}),
|
|
58
|
+
select: z.array(key$1).max(64).default([]),
|
|
51
59
|
filters: z.array(resourceAnalysisFilterSchema).max(20).default([]),
|
|
52
|
-
groupBy: z.array(key).max(8).default([]),
|
|
60
|
+
groupBy: z.array(key$1).max(8).default([]),
|
|
53
61
|
aggregates: z.array(z.object({
|
|
54
|
-
field: key.optional(),
|
|
55
|
-
key,
|
|
62
|
+
field: key$1.optional(),
|
|
63
|
+
key: key$1,
|
|
56
64
|
operation: z.enum([
|
|
57
65
|
'count',
|
|
58
66
|
'sum',
|
|
@@ -61,7 +69,7 @@ const scalar = z.union([
|
|
|
61
69
|
])
|
|
62
70
|
}).strict()).max(16).default([]),
|
|
63
71
|
orderBy: z.array(z.object({
|
|
64
|
-
field: key,
|
|
72
|
+
field: key$1,
|
|
65
73
|
direction: z.enum([
|
|
66
74
|
'asc',
|
|
67
75
|
'desc'
|
|
@@ -84,4 +92,133 @@ const scalar = z.union([
|
|
|
84
92
|
return true;
|
|
85
93
|
}
|
|
86
94
|
|
|
87
|
-
|
|
95
|
+
// Evidence is a bounded copy of a past result. Parsing establishes neither current source access
|
|
96
|
+
// nor certification authority; producers and readers enforce those checks in their own runtime.
|
|
97
|
+
const key = z.string().min(1).max(160).refine((value)=>![
|
|
98
|
+
'__proto__',
|
|
99
|
+
'constructor',
|
|
100
|
+
'prototype'
|
|
101
|
+
].includes(value));
|
|
102
|
+
const scalar = z.union([
|
|
103
|
+
z.string().max(4000),
|
|
104
|
+
z.number().finite(),
|
|
105
|
+
z.boolean(),
|
|
106
|
+
z.null()
|
|
107
|
+
]);
|
|
108
|
+
const dataset = z.object({
|
|
109
|
+
schema: z.literal('xpert.analytics.dataset'),
|
|
110
|
+
datasetId: key,
|
|
111
|
+
fields: z.array(analyticsFieldSchema).min(1).max(64),
|
|
112
|
+
rows: z.array(z.record(key, scalar)).max(1000),
|
|
113
|
+
grain: z.array(key).max(64),
|
|
114
|
+
completeness: z.object({
|
|
115
|
+
returnedRows: z.number().int().nonnegative(),
|
|
116
|
+
totalRows: z.number().int().nonnegative().optional(),
|
|
117
|
+
totalAccuracy: z.enum([
|
|
118
|
+
'exact',
|
|
119
|
+
'estimated',
|
|
120
|
+
'unknown'
|
|
121
|
+
]),
|
|
122
|
+
scope: z.enum([
|
|
123
|
+
'full_query_result',
|
|
124
|
+
'page',
|
|
125
|
+
'sample',
|
|
126
|
+
'top_n'
|
|
127
|
+
]),
|
|
128
|
+
truncated: z.boolean()
|
|
129
|
+
}).strict(),
|
|
130
|
+
freshness: z.object({
|
|
131
|
+
executedAt: z.string().datetime(),
|
|
132
|
+
sourceFetchedAt: z.string().datetime(),
|
|
133
|
+
dataAsOf: z.string().max(160).optional()
|
|
134
|
+
}).strict(),
|
|
135
|
+
provenance: z.object({
|
|
136
|
+
executionId: key,
|
|
137
|
+
bindingId: key,
|
|
138
|
+
providerId: key,
|
|
139
|
+
sourceVersion: z.string().max(512).optional(),
|
|
140
|
+
upstreamExecutionId: key.optional(),
|
|
141
|
+
auditRef: z.string().max(512).optional(),
|
|
142
|
+
certification: analyticsCertificationSchema.optional()
|
|
143
|
+
}).strict()
|
|
144
|
+
}).strict().superRefine((value, ctx)=>{
|
|
145
|
+
const ids = new Set(value.fields.map((field)=>field.id));
|
|
146
|
+
if (ids.size !== value.fields.length || new Set(value.grain).size !== value.grain.length || value.grain.some((id)=>!ids.has(id)) || value.completeness.returnedRows !== value.rows.length || value.completeness.totalRows !== undefined && value.completeness.totalRows < value.rows.length || value.completeness.truncated && value.completeness.scope === 'full_query_result') ctx.addIssue({
|
|
147
|
+
code: 'custom',
|
|
148
|
+
message: 'Inconsistent evidence result'
|
|
149
|
+
});
|
|
150
|
+
for (const row of value.rows){
|
|
151
|
+
// Reuse result validation so transport never coerces values or relaxes their logical types.
|
|
152
|
+
if (Object.keys(row).length !== ids.size || Object.keys(row).some((id)=>!ids.has(id)) || value.fields.some((field)=>!Object.prototype.hasOwnProperty.call(row, field.id) || !isAnalyticsCell(field.logicalType, row[field.id], field.nullable))) ctx.addIssue({
|
|
153
|
+
code: 'custom',
|
|
154
|
+
message: 'Invalid evidence cells'
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
const analysisEvidenceSchema = z.object({
|
|
159
|
+
schema: z.literal('xpert.analysis-evidence@1'),
|
|
160
|
+
id: z.string().uuid(),
|
|
161
|
+
title: z.string().min(1).max(200),
|
|
162
|
+
capturedAt: z.string().datetime(),
|
|
163
|
+
source: z.object({
|
|
164
|
+
artifactId: z.string().uuid(),
|
|
165
|
+
versionId: z.string().uuid(),
|
|
166
|
+
projectId: z.string().uuid()
|
|
167
|
+
}).strict(),
|
|
168
|
+
controls: z.record(key, scalar).refine((value)=>Object.keys(value).length <= 32),
|
|
169
|
+
datasets: z.array(dataset).min(1).max(20),
|
|
170
|
+
statements: z.array(z.object({
|
|
171
|
+
kind: z.enum([
|
|
172
|
+
'fact',
|
|
173
|
+
'inference',
|
|
174
|
+
'unverified'
|
|
175
|
+
]),
|
|
176
|
+
text: z.string().min(1).max(2000),
|
|
177
|
+
citations: z.array(z.object({
|
|
178
|
+
datasetId: key,
|
|
179
|
+
row: z.number().int().nonnegative(),
|
|
180
|
+
field: key
|
|
181
|
+
}).strict()).max(64)
|
|
182
|
+
}).strict()).max(1000),
|
|
183
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/)
|
|
184
|
+
}).strict().superRefine((value, ctx)=>{
|
|
185
|
+
if (new Set(value.datasets.map((item)=>item.datasetId)).size !== value.datasets.length) ctx.addIssue({
|
|
186
|
+
code: 'custom',
|
|
187
|
+
message: 'Duplicate evidence dataset'
|
|
188
|
+
});
|
|
189
|
+
for (const statement of value.statements){
|
|
190
|
+
// A citation identifies an existing cell; it does not prove the statement's interpretation.
|
|
191
|
+
if (statement.kind === 'fact' && !statement.citations.length) ctx.addIssue({
|
|
192
|
+
code: 'custom',
|
|
193
|
+
message: 'Facts need cell citations'
|
|
194
|
+
});
|
|
195
|
+
for (const citation of statement.citations){
|
|
196
|
+
const data = value.datasets.find((item)=>item.datasetId === citation.datasetId);
|
|
197
|
+
if (!data || citation.row >= data.rows.length || !data.fields.some((field)=>field.id === citation.field)) ctx.addIssue({
|
|
198
|
+
code: 'custom',
|
|
199
|
+
message: 'Unknown evidence cell'
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (new TextEncoder().encode(JSON.stringify(value)).length > 2000000) ctx.addIssue({
|
|
204
|
+
code: 'custom',
|
|
205
|
+
message: 'Evidence exceeds limit'
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
/** Canonicalize validated JSON: sort object keys, but preserve array order and exact scalar values.
|
|
209
|
+
* Omitted optional properties do not affect the digest. Hashing stays in the consumer's runtime. */ function canonicalEvidenceJson(value) {
|
|
210
|
+
if (value === null || typeof value !== 'object') return JSON.stringify(value);
|
|
211
|
+
if (Array.isArray(value)) return '[' + value.map(canonicalEvidenceJson).join(',') + ']';
|
|
212
|
+
return '{' + Object.entries(value).filter(([, entry])=>entry !== undefined).sort(([a], [b])=>a < b ? -1 : a > b ? 1 : 0).map(([name, entry])=>JSON.stringify(name) + ':' + canonicalEvidenceJson(entry)).join(',') + '}';
|
|
213
|
+
}
|
|
214
|
+
/** Validate shape and cell references; callers must verify the digest and current source access separately. */ function parseAnalysisEvidence(value) {
|
|
215
|
+
return analysisEvidenceSchema.parse(value);
|
|
216
|
+
}
|
|
217
|
+
/** Exclude only the digest itself; source, capture time, cells and statement classifications stay covered. */ function analysisEvidenceDigestInput(value) {
|
|
218
|
+
const { sha256: _digest } = value, body = _object_without_properties_loose(value, [
|
|
219
|
+
"sha256"
|
|
220
|
+
]);
|
|
221
|
+
return canonicalEvidenceJson(body);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export { analysisEvidenceDigestInput, analysisEvidenceSchema, analyticsCertificationSchema, analyticsFieldSchema, canonicalEvidenceJson, isResourceAnalysisFilterValue, parseAnalysisEvidence, resourceAnalysisFilterSchema, resourceAnalysisPolicySchema, resourceAnalysisQuerySchema };
|
package/artifact-document.cjs.js
CHANGED
|
@@ -523,13 +523,17 @@ const ARTIFACT_DOCUMENT_RUNTIME = String.raw`
|
|
|
523
523
|
const failure = (code)=>Object.assign(new Error(code), {
|
|
524
524
|
code
|
|
525
525
|
});
|
|
526
|
-
const keyOf = (input)=>
|
|
526
|
+
const keyOf = (input)=>{
|
|
527
|
+
var _input_cache;
|
|
528
|
+
return JSON.stringify([
|
|
527
529
|
input.bindingId,
|
|
530
|
+
(_input_cache = input.cache) != null ? _input_cache : null,
|
|
528
531
|
Object.keys(input.controls).sort().map((key)=>[
|
|
529
532
|
key,
|
|
530
533
|
input.controls[key]
|
|
531
534
|
])
|
|
532
535
|
]);
|
|
536
|
+
};
|
|
533
537
|
const priorities = {
|
|
534
538
|
interactive: 0,
|
|
535
539
|
initial: 1,
|
|
@@ -621,10 +625,12 @@ const QUEUE_TIMEOUT = 180000, EXECUTION_TIMEOUT = 45000, WINDOW = 60000;
|
|
|
621
625
|
rejectPromise = no;
|
|
622
626
|
});
|
|
623
627
|
const task = {
|
|
624
|
-
input: {
|
|
628
|
+
input: _extends._extends({
|
|
625
629
|
bindingId: input.bindingId,
|
|
626
630
|
controls: _extends._extends({}, input.controls)
|
|
627
|
-
},
|
|
631
|
+
}, input.cache ? {
|
|
632
|
+
cache: _extends._extends({}, input.cache)
|
|
633
|
+
} : {}),
|
|
628
634
|
key,
|
|
629
635
|
priority: priorities[priority],
|
|
630
636
|
controller: new AbortController(),
|
package/artifact-document.esm.js
CHANGED
|
@@ -521,13 +521,17 @@ const ARTIFACT_DOCUMENT_RUNTIME = String.raw`
|
|
|
521
521
|
const failure = (code)=>Object.assign(new Error(code), {
|
|
522
522
|
code
|
|
523
523
|
});
|
|
524
|
-
const keyOf = (input)=>
|
|
524
|
+
const keyOf = (input)=>{
|
|
525
|
+
var _input_cache;
|
|
526
|
+
return JSON.stringify([
|
|
525
527
|
input.bindingId,
|
|
528
|
+
(_input_cache = input.cache) != null ? _input_cache : null,
|
|
526
529
|
Object.keys(input.controls).sort().map((key)=>[
|
|
527
530
|
key,
|
|
528
531
|
input.controls[key]
|
|
529
532
|
])
|
|
530
533
|
]);
|
|
534
|
+
};
|
|
531
535
|
const priorities = {
|
|
532
536
|
interactive: 0,
|
|
533
537
|
initial: 1,
|
|
@@ -619,10 +623,12 @@ const QUEUE_TIMEOUT = 180000, EXECUTION_TIMEOUT = 45000, WINDOW = 60000;
|
|
|
619
623
|
rejectPromise = no;
|
|
620
624
|
});
|
|
621
625
|
const task = {
|
|
622
|
-
input: {
|
|
626
|
+
input: _extends({
|
|
623
627
|
bindingId: input.bindingId,
|
|
624
628
|
controls: _extends({}, input.controls)
|
|
625
|
-
},
|
|
629
|
+
}, input.cache ? {
|
|
630
|
+
cache: _extends({}, input.cache)
|
|
631
|
+
} : {}),
|
|
626
632
|
key,
|
|
627
633
|
priority: priorities[priority],
|
|
628
634
|
controller: new AbortController(),
|