@xpert-ai/plugin-sdk 3.30.1 → 3.31.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/model-provider.cjs.js +1 -1
- package/model-provider.esm.js +1 -1
- package/package.json +2 -2
- package/src/lib/data/analytics/analytics-provider.d.ts +7 -6
- package/src/lib/project-pipeline/adapters.d.ts +2 -0
- package/src/lib/runtime/capabilities/assistant-middleware-access.d.ts +7 -7
- package/src/lib/runtime/capabilities/project-access.d.ts +2 -2
- package/src/lib/workflow/trigger/strategy.interface.d.ts +34 -0
package/model-provider.cjs.js
CHANGED
|
@@ -270,7 +270,7 @@ const ProjectProvisioningRuntimeCapability = createRuntimeCapability('platform.p
|
|
|
270
270
|
});
|
|
271
271
|
|
|
272
272
|
const ProjectAccessRuntimeCapability = createRuntimeCapability('platform.project.access', {
|
|
273
|
-
description: 'Resolve
|
|
273
|
+
description: 'Resolve Project membership and Assistant execution access for platform and plugin operations.'
|
|
274
274
|
});
|
|
275
275
|
|
|
276
276
|
const ProjectFilesRuntimeCapability = createRuntimeCapability('platform.project.files', {
|
package/model-provider.esm.js
CHANGED
|
@@ -268,7 +268,7 @@ const ProjectProvisioningRuntimeCapability = createRuntimeCapability('platform.p
|
|
|
268
268
|
});
|
|
269
269
|
|
|
270
270
|
const ProjectAccessRuntimeCapability = createRuntimeCapability('platform.project.access', {
|
|
271
|
-
description: 'Resolve
|
|
271
|
+
description: 'Resolve Project membership and Assistant execution access for platform and plugin operations.'
|
|
272
272
|
});
|
|
273
273
|
|
|
274
274
|
const ProjectFilesRuntimeCapability = createRuntimeCapability('platform.project.files', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xpert-ai/plugin-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.31.0",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@langchain/openai": "0.6.9",
|
|
77
|
-
"@xpert-ai/contracts": "3.
|
|
77
|
+
"@xpert-ai/contracts": "3.31.0",
|
|
78
78
|
"express": "^4.22.1",
|
|
79
79
|
"js-tiktoken": "^1.0.21"
|
|
80
80
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AnalyticsDefinitionAuthoring } from './analytics-authoring';
|
|
2
|
-
import type { AnalyticsSourceRef, AnalyticsConfigurationEntry, AnalyticsBinding, AnalyticsProviderDescriptor, AnalyticsQueryRequest, AnalyticsSourceSummary, AnalyticalDataset, AnalyticsValue, JSONValue, AnalyticsDiscoveryRequest, AnalyticsDiscoveryResult } from '@xpert-ai/contracts';
|
|
2
|
+
import type { AnalyticsSourceRef, AnalyticsConfigurationEntry, AnalyticsBinding, AnalyticsField, AnalyticsProviderDescriptor, AnalyticsQueryRequest, AnalyticsSourceSummary, AnalyticalDataset, AnalyticsValue, JSONValue, AnalyticsDiscoveryRequest, AnalyticsDiscoveryResult } from '@xpert-ai/contracts';
|
|
3
3
|
import type { DataSourceActor } from '../datasource/workbench';
|
|
4
4
|
/** Host-created execution scope. Providers must not accept replacements from payload or controls. */
|
|
5
5
|
export interface AnalyticsProviderContext {
|
|
@@ -21,13 +21,14 @@ export interface AnalyticsProviderContext {
|
|
|
21
21
|
/** Provider IDs through the current call; forward to child queries for cycle/depth checks. */
|
|
22
22
|
ancestry: readonly string[];
|
|
23
23
|
}
|
|
24
|
+
/** Source-declared metadata, never inferred from names or sampled cells. */
|
|
25
|
+
export type AnalyticsResultColumn = {
|
|
26
|
+
key: string;
|
|
27
|
+
} & Partial<Pick<AnalyticsField, 'semanticRef' | 'logicalType' | 'role' | 'nullable' | 'label' | 'unit'>>;
|
|
24
28
|
/** Native-column result before host projection; cells already use canonical AnalyticsValue encodings. */
|
|
25
29
|
export interface AnalyticsProviderResult {
|
|
26
|
-
/**
|
|
27
|
-
columns:
|
|
28
|
-
key: string;
|
|
29
|
-
semanticRef?: string;
|
|
30
|
-
}>;
|
|
30
|
+
/** Declare columns even for zero rows. Optional metadata supports authoring; it never overrides Binding.output. */
|
|
31
|
+
columns: AnalyticsResultColumn[];
|
|
31
32
|
/** Keys match columns[].key; the host maps them to Binding.output.fields[].id without coercion. */
|
|
32
33
|
rows: Array<Record<string, AnalyticsValue>>;
|
|
33
34
|
/** Describe the actual result scope/counts; successful transport does not imply a complete result. */
|
|
@@ -48,6 +48,8 @@ export interface ProjectPipelineNodeHandler {
|
|
|
48
48
|
/** The host binds the authorized published Assistant, Project and stable runtime IDs. */
|
|
49
49
|
export interface ProjectPipelineAssistantContext extends ProjectPipelineOperationContext {
|
|
50
50
|
executor: {
|
|
51
|
+
/** Persisted execution actor, independent of the business run owner. */
|
|
52
|
+
userId?: string;
|
|
51
53
|
xpertId: string;
|
|
52
54
|
workspaceId: string;
|
|
53
55
|
publishedVersion: string;
|
|
@@ -12,17 +12,17 @@ export type AssistantMiddlewareAccessScope = {
|
|
|
12
12
|
projectId: string;
|
|
13
13
|
};
|
|
14
14
|
export interface AssistantMiddlewareAccessApi {
|
|
15
|
-
/**
|
|
16
|
-
* Standalone access uses the Assistant catalog policy; Project use requires current
|
|
17
|
-
* membership and an Assistant binding instead. Both require active organization membership.
|
|
18
|
-
* View providers needing configuration/runtime should use ViewMiddlewareRuntimeCapability.
|
|
19
|
-
* This does not grant file/resource operations. Resource ACLs and collaboration delivery
|
|
20
|
-
* retain their own checks and must not depend on this middleware feature remaining installed.
|
|
21
|
-
*/
|
|
15
|
+
/** Live authorization for the exact published Assistant and middleware; resource operations retain their own ACLs. */
|
|
22
16
|
assertAccess(input: AssistantMiddlewareRequirement & {
|
|
23
17
|
actor: OrganizationRuntimeActor;
|
|
24
18
|
assistantId: string;
|
|
25
19
|
scope: AssistantMiddlewareAccessScope;
|
|
26
20
|
}): Promise<void>;
|
|
21
|
+
/** Execute under the bound Assistant account, subject to live actor and middleware authorization. */
|
|
22
|
+
runAsAssistant<T>(input: AssistantMiddlewareRequirement & {
|
|
23
|
+
actor: OrganizationRuntimeActor;
|
|
24
|
+
assistantId: string;
|
|
25
|
+
scope: AssistantMiddlewareAccessScope;
|
|
26
|
+
}, work: () => Promise<T>): Promise<T>;
|
|
27
27
|
}
|
|
28
28
|
export declare const AssistantMiddlewareAccessRuntimeCapability: import("../../core/runtime-capability").RuntimeCapabilityKey<AssistantMiddlewareAccessApi>;
|
|
@@ -4,13 +4,13 @@ export type ProjectAccessActor = RuntimeActor;
|
|
|
4
4
|
export interface ProjectHumanAccess extends XpertProjectClassification {
|
|
5
5
|
projectId: string;
|
|
6
6
|
name?: string;
|
|
7
|
-
role: 'owner' | 'manager' | 'editor' | 'member';
|
|
7
|
+
role: 'owner' | 'manager' | 'editor' | 'member' | 'assistant';
|
|
8
8
|
canManage: boolean;
|
|
9
9
|
archived: boolean;
|
|
10
10
|
/** Explicit Project bindings, for plugins that choose to use assignment as business policy. */
|
|
11
11
|
assistantIds?: string[];
|
|
12
12
|
}
|
|
13
|
-
/** Project membership and explicit Assistant bindings. Feature activation remains Assistant-owned. */
|
|
13
|
+
/** Project membership, Assistant execution access and explicit Assistant bindings. Feature activation remains Assistant-owned. */
|
|
14
14
|
export interface ProjectAccessApi {
|
|
15
15
|
listReadable(input: {
|
|
16
16
|
actor: ProjectAccessActor;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { TWorkflowTriggerConnectionStatus, TWorkflowTriggerMeta, TXpertTeamNode } from '@xpert-ai/contracts';
|
|
2
2
|
export type TWorkflowTriggerBootstrapMode = 'replay_publish' | 'skip';
|
|
3
|
+
/**
|
|
4
|
+
* Lifecycle policy for recovering published triggers during system bootstrap.
|
|
5
|
+
* Declares recovery participation and criticality independently of normal publication.
|
|
6
|
+
*/
|
|
3
7
|
export type TWorkflowTriggerBootstrapConfig = {
|
|
4
8
|
mode: TWorkflowTriggerBootstrapMode;
|
|
5
9
|
critical?: boolean;
|
|
@@ -10,7 +14,15 @@ export type TWorkflowTriggerParams<T> = {
|
|
|
10
14
|
scope?: {
|
|
11
15
|
tenantId: string;
|
|
12
16
|
organizationId: string | null;
|
|
17
|
+
userId?: string;
|
|
18
|
+
assistantUserId?: string;
|
|
19
|
+
workspaceId?: string;
|
|
13
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Supplementary instructions scoped to trigger-initiated runs.
|
|
23
|
+
* Additive to existing task instructions; preserves the Assistant's instruction definition.
|
|
24
|
+
*/
|
|
25
|
+
additionalInstructions?: string;
|
|
14
26
|
agentKey?: string;
|
|
15
27
|
node?: TXpertTeamNode;
|
|
16
28
|
config: T;
|
|
@@ -25,8 +37,30 @@ export interface IWorkflowTriggerStrategy<T> {
|
|
|
25
37
|
* - critical: false
|
|
26
38
|
*/
|
|
27
39
|
bootstrap?: TWorkflowTriggerBootstrapConfig;
|
|
40
|
+
/**
|
|
41
|
+
* Assesses configuration validity within the supplied trigger context.
|
|
42
|
+
* Reports validation findings without activating the trigger.
|
|
43
|
+
*/
|
|
28
44
|
validate(payload: TWorkflowTriggerParams<T>): Promise<any[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Read-only snapshot of the connection represented by the trigger configuration.
|
|
47
|
+
* Connection state is distinct from configuration validity and individual run outcomes.
|
|
48
|
+
*/
|
|
29
49
|
connectionStatus?(config: T): Promise<Pick<TWorkflowTriggerConnectionStatus, 'connected' | 'state'>>;
|
|
50
|
+
/**
|
|
51
|
+
* Read-only snapshot of trigger availability, connectivity and activity within an Assistant scope.
|
|
52
|
+
* Describes the trigger's operational state independently of the Assistant's execution state.
|
|
53
|
+
*/
|
|
54
|
+
assistantStatus?(params: TWorkflowTriggerParams<T>): Promise<{
|
|
55
|
+
/** Availability within the supplied Assistant and actor scope. */
|
|
56
|
+
available: boolean;
|
|
57
|
+
/** Connection state, independent of individual run outcomes. */
|
|
58
|
+
connection: TWorkflowTriggerConnectionStatus['state'];
|
|
59
|
+
/** Latest trigger activity time (ISO 8601), or null if none. */
|
|
60
|
+
lastActivityAt: string | null;
|
|
61
|
+
/** Latest run initiation time (ISO 8601), distinct from completion; null if none. */
|
|
62
|
+
lastRunAt: string | null;
|
|
63
|
+
}>;
|
|
30
64
|
/**
|
|
31
65
|
* Initialize the trigger when publish xpert workflow
|
|
32
66
|
*
|