@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
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type { IXpertTask, ProjectConfigurationOverview, ProjectConfigurationUpdate, ProjectConfigurationValues, TXpertTaskScheduleCapabilities, XpertProjectConfigurationView } from '@xpert-ai/contracts';
|
|
2
|
+
import type { ConnectorAuthMethodDefinition, ConnectorBinding, ConnectorRuntimeOptions, ConnectorStrategyDefinition } from '../../connector';
|
|
3
|
+
import type { RuntimeActor } from '../actor';
|
|
4
|
+
/** Supplied by the host from trusted request/execution context, never from an action/tool payload.
|
|
5
|
+
* Background callers restore execution identity before invoking operations that use domain services.
|
|
6
|
+
* assistantId retains the current Assistant-to-Project access check when invoked in its scope. */
|
|
7
|
+
export interface ProjectConfigurationScope {
|
|
8
|
+
actor: RuntimeActor;
|
|
9
|
+
projectId: string;
|
|
10
|
+
assistantId?: string;
|
|
11
|
+
}
|
|
12
|
+
export type ProjectConfigurationMemberRole = 'manager' | 'editor' | 'member';
|
|
13
|
+
export type ProjectConfigurationPageInput = {
|
|
14
|
+
page: number;
|
|
15
|
+
search: string;
|
|
16
|
+
};
|
|
17
|
+
export interface ProjectSkillArchive {
|
|
18
|
+
buffer: Buffer;
|
|
19
|
+
originalname?: string;
|
|
20
|
+
mimetype?: string;
|
|
21
|
+
size?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ProjectConfigurationPage {
|
|
24
|
+
items: {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
}[];
|
|
29
|
+
total: number;
|
|
30
|
+
page: number;
|
|
31
|
+
}
|
|
32
|
+
export interface ProjectConfigurationMemberCandidates extends ProjectConfigurationPage {
|
|
33
|
+
canInvite: boolean;
|
|
34
|
+
invitations: {
|
|
35
|
+
id: string;
|
|
36
|
+
email: string;
|
|
37
|
+
role: ProjectConfigurationMemberRole;
|
|
38
|
+
status: string;
|
|
39
|
+
}[];
|
|
40
|
+
}
|
|
41
|
+
export type ProjectConfigurationAutomationInput = Required<Pick<IXpertTask, 'name' | 'prompt' | 'xpertId' | 'options' | 'timeZone'>> & Pick<IXpertTask, 'agentKey'> & {
|
|
42
|
+
taskId?: string;
|
|
43
|
+
runtimeState?: ProjectConfigurationValues;
|
|
44
|
+
};
|
|
45
|
+
export interface ProjectConfigurationAutomationPage {
|
|
46
|
+
items: Pick<IXpertTask, 'id' | 'name' | 'prompt' | 'xpertId' | 'agentKey' | 'options' | 'timeZone' | 'status' | 'scheduleDescription' | 'runAsUserId' | 'pendingRunAsUserId' | 'runtimeState'>[];
|
|
47
|
+
total: number;
|
|
48
|
+
page: number;
|
|
49
|
+
}
|
|
50
|
+
export interface ProjectConfigurationAutomationOptions {
|
|
51
|
+
capabilities: TXpertTaskScheduleCapabilities;
|
|
52
|
+
connectors: ConnectorRuntimeOptions;
|
|
53
|
+
}
|
|
54
|
+
export interface ProjectConfigurationConnectors {
|
|
55
|
+
bindings: ConnectorBinding[];
|
|
56
|
+
definitions: {
|
|
57
|
+
provider: string;
|
|
58
|
+
label: ConnectorStrategyDefinition['label'];
|
|
59
|
+
authMethods: ConnectorAuthMethodDefinition[];
|
|
60
|
+
}[];
|
|
61
|
+
}
|
|
62
|
+
export interface ProjectConfigurationConnectorAuthorization {
|
|
63
|
+
status: string;
|
|
64
|
+
authorizationUrl?: string;
|
|
65
|
+
stateExpiresAt?: string;
|
|
66
|
+
}
|
|
67
|
+
/** Project configuration operations shared by plugins and trusted runtime callers.
|
|
68
|
+
* Each call revalidates identity and domain permissions; this API does not grant machine principals
|
|
69
|
+
* human management or consent authority. Browser OAuth launch still needs an authenticated HTTP origin. */
|
|
70
|
+
export interface ProjectConfigurationApi {
|
|
71
|
+
/** Non-secret effective settings for authorized execution, including a Project Assistant. No management authority. */
|
|
72
|
+
getRuntimeConfiguration(scope: ProjectConfigurationScope): Promise<Pick<XpertProjectConfigurationView, 'projectType' | 'revision' | 'effectiveValues'>>;
|
|
73
|
+
getOverview(scope: ProjectConfigurationScope): Promise<ProjectConfigurationOverview>;
|
|
74
|
+
get(scope: ProjectConfigurationScope): Promise<XpertProjectConfigurationView>;
|
|
75
|
+
update(scope: ProjectConfigurationScope, input: ProjectConfigurationUpdate): Promise<XpertProjectConfigurationView>;
|
|
76
|
+
listAvailableAssistants(scope: ProjectConfigurationScope, input: ProjectConfigurationPageInput): Promise<ProjectConfigurationPage>;
|
|
77
|
+
addAssistant(scope: ProjectConfigurationScope, input: {
|
|
78
|
+
xpertId: string;
|
|
79
|
+
}): Promise<null>;
|
|
80
|
+
removeAssistant(scope: ProjectConfigurationScope, input: {
|
|
81
|
+
xpertId: string;
|
|
82
|
+
}): Promise<null>;
|
|
83
|
+
listMemberCandidates(scope: ProjectConfigurationScope, input: ProjectConfigurationPageInput): Promise<ProjectConfigurationMemberCandidates>;
|
|
84
|
+
addMember(scope: ProjectConfigurationScope, input: {
|
|
85
|
+
userId: string;
|
|
86
|
+
role?: ProjectConfigurationMemberRole;
|
|
87
|
+
}): Promise<null>;
|
|
88
|
+
updateMemberRole(scope: ProjectConfigurationScope, input: {
|
|
89
|
+
userId: string;
|
|
90
|
+
role: ProjectConfigurationMemberRole;
|
|
91
|
+
}): Promise<null>;
|
|
92
|
+
removeMember(scope: ProjectConfigurationScope, input: {
|
|
93
|
+
userId: string;
|
|
94
|
+
}): Promise<null>;
|
|
95
|
+
transferOwnership(scope: ProjectConfigurationScope, input: {
|
|
96
|
+
userId: string;
|
|
97
|
+
}): Promise<null>;
|
|
98
|
+
inviteMember(scope: ProjectConfigurationScope, input: {
|
|
99
|
+
email: string;
|
|
100
|
+
role: ProjectConfigurationMemberRole;
|
|
101
|
+
}): Promise<null>;
|
|
102
|
+
revokeInvitation(scope: ProjectConfigurationScope, input: {
|
|
103
|
+
invitationId: string;
|
|
104
|
+
}): Promise<null>;
|
|
105
|
+
listSkillCatalog(scope: ProjectConfigurationScope, input: ProjectConfigurationPageInput): Promise<ProjectConfigurationPage>;
|
|
106
|
+
installSkill(scope: ProjectConfigurationScope, input: {
|
|
107
|
+
indexId: string;
|
|
108
|
+
}): Promise<null>;
|
|
109
|
+
setSkillEnabled(scope: ProjectConfigurationScope, input: {
|
|
110
|
+
skillId: string;
|
|
111
|
+
enabled: boolean;
|
|
112
|
+
}): Promise<null>;
|
|
113
|
+
removeSkill(scope: ProjectConfigurationScope, input: {
|
|
114
|
+
skillId: string;
|
|
115
|
+
}): Promise<null>;
|
|
116
|
+
deleteProject(scope: ProjectConfigurationScope, input: {
|
|
117
|
+
name: string;
|
|
118
|
+
}): Promise<null>;
|
|
119
|
+
listAutomations(scope: ProjectConfigurationScope, input: ProjectConfigurationPageInput): Promise<ProjectConfigurationAutomationPage>;
|
|
120
|
+
getAutomationOptions(scope: ProjectConfigurationScope, input: {
|
|
121
|
+
xpertId: string;
|
|
122
|
+
agentKey?: string;
|
|
123
|
+
}): Promise<ProjectConfigurationAutomationOptions>;
|
|
124
|
+
saveAutomation(scope: ProjectConfigurationScope, input: ProjectConfigurationAutomationInput): Promise<null>;
|
|
125
|
+
pauseAutomation(scope: ProjectConfigurationScope, input: {
|
|
126
|
+
taskId: string;
|
|
127
|
+
}): Promise<null>;
|
|
128
|
+
resumeAutomation(scope: ProjectConfigurationScope, input: {
|
|
129
|
+
taskId: string;
|
|
130
|
+
}): Promise<null>;
|
|
131
|
+
deleteAutomation(scope: ProjectConfigurationScope, input: {
|
|
132
|
+
taskId: string;
|
|
133
|
+
}): Promise<null>;
|
|
134
|
+
proposeAutomationRunAs(scope: ProjectConfigurationScope, input: {
|
|
135
|
+
taskId: string;
|
|
136
|
+
userId: string;
|
|
137
|
+
}): Promise<null>;
|
|
138
|
+
acceptAutomationRunAs(scope: ProjectConfigurationScope, input: {
|
|
139
|
+
taskId: string;
|
|
140
|
+
}): Promise<null>;
|
|
141
|
+
updateAutomationConnectors(scope: ProjectConfigurationScope, input: {
|
|
142
|
+
taskId: string;
|
|
143
|
+
runtimeState: ProjectConfigurationValues;
|
|
144
|
+
}): Promise<null>;
|
|
145
|
+
listConnectors(scope: ProjectConfigurationScope): Promise<ProjectConfigurationConnectors>;
|
|
146
|
+
addConnector(scope: ProjectConfigurationScope, input: {
|
|
147
|
+
provider: string;
|
|
148
|
+
}): Promise<null>;
|
|
149
|
+
removeConnector(scope: ProjectConfigurationScope, input: {
|
|
150
|
+
bindingId: string;
|
|
151
|
+
}): Promise<null>;
|
|
152
|
+
getConnectorAuthorizationStatus(scope: ProjectConfigurationScope, input: {
|
|
153
|
+
bindingId: string;
|
|
154
|
+
}): Promise<ProjectConfigurationConnectorAuthorization>;
|
|
155
|
+
cancelConnectorAuthorization(scope: ProjectConfigurationScope, input: {
|
|
156
|
+
bindingId: string;
|
|
157
|
+
}): Promise<null>;
|
|
158
|
+
connectConnector(scope: ProjectConfigurationScope, input: {
|
|
159
|
+
bindingId: string;
|
|
160
|
+
authMethodId?: string;
|
|
161
|
+
values?: Record<string, string>;
|
|
162
|
+
}): Promise<ProjectConfigurationConnectorAuthorization>;
|
|
163
|
+
updateInstructions(scope: ProjectConfigurationScope, content: string): Promise<void>;
|
|
164
|
+
uploadSkill(scope: ProjectConfigurationScope, file: ProjectSkillArchive): Promise<void>;
|
|
165
|
+
}
|
|
166
|
+
export declare const ProjectConfigurationRuntimeCapability: import("../../core/runtime-capability").RuntimeCapabilityKey<ProjectConfigurationApi>;
|
|
@@ -12,13 +12,64 @@ export interface XpertViewFileResource {
|
|
|
12
12
|
mimeType: string;
|
|
13
13
|
size?: number;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Server-side adapter that exposes plugin-owned views in host-defined slots.
|
|
17
|
+
* Register an injectable implementation with `@ViewExtensionProvider(providerKey)`.
|
|
18
|
+
*
|
|
19
|
+
* The host supplies caller context and enforces host/manifest access; providers validate
|
|
20
|
+
* business inputs and delegate resource authorization and business rules to domain services.
|
|
21
|
+
* Method `viewKey` arguments are provider-local manifest keys; the host handles public namespacing.
|
|
22
|
+
* Implement optional hooks for the capabilities the manifests expose. Prefer declared actions
|
|
23
|
+
* and domain services for new business features; keep this contract focused on host/view integration.
|
|
24
|
+
*/
|
|
15
25
|
export interface IXpertViewExtensionProvider {
|
|
26
|
+
/**
|
|
27
|
+
* Authorize each local draft operation through the resource's existing domain access checks.
|
|
28
|
+
* Use the trusted view context; throw on denial and return the canonical resource ID on success.
|
|
29
|
+
* Required to support workbench.content.draft; the host owns draft isolation and storage.
|
|
30
|
+
*/
|
|
31
|
+
authorizeLocalDraftResource?(context: XpertResolvedViewHostContext, viewKey: string, resourceId: string): Promise<string> | string;
|
|
32
|
+
/**
|
|
33
|
+
* Decide whether this provider applies to the resolved host, independently of any slot.
|
|
34
|
+
* Keep discovery lightweight and free of side effects; a match does not grant resource access.
|
|
35
|
+
*/
|
|
16
36
|
supports(context: XpertResolvedViewHostContext): Promise<boolean> | boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Describe the views available in a slot, including rendering, data, actions and optional capabilities.
|
|
39
|
+
* Use stable provider-local keys and return an empty list for unsupported slots.
|
|
40
|
+
* Keep discovery free of business mutations; the host applies activation and visibility policies.
|
|
41
|
+
*/
|
|
17
42
|
getViewManifests(context: XpertResolvedViewHostContext, slot: string): Promise<XpertExtensionViewManifest[]> | XpertExtensionViewManifest[];
|
|
43
|
+
/**
|
|
44
|
+
* Read the view's data for its declared query contract, within the caller's authorized resource scope.
|
|
45
|
+
* Keep this path free of business mutations; the host may cache results according to the manifest.
|
|
46
|
+
*/
|
|
18
47
|
getViewData(context: XpertResolvedViewHostContext, viewKey: string, query: XpertViewQuery): Promise<XpertViewDataResult> | XpertViewDataResult;
|
|
48
|
+
/**
|
|
49
|
+
* Handle a declared JSON action, such as saving, exporting or invoking a domain workflow.
|
|
50
|
+
* Validate action-specific input and delegate authorization and execution to domain services.
|
|
51
|
+
* Use the result's refresh hint when the operation invalidates the view's data.
|
|
52
|
+
*/
|
|
19
53
|
executeViewAction?(context: XpertResolvedViewHostContext, viewKey: string, actionKey: string, request: XpertViewActionRequest): Promise<XpertViewActionResult> | XpertViewActionResult;
|
|
54
|
+
/**
|
|
55
|
+
* Handle a declared file-transport action, such as importing an uploaded document.
|
|
56
|
+
* Apply the same domain rules as JSON actions and validate the file for its intended use.
|
|
57
|
+
*/
|
|
20
58
|
executeViewFileAction?(context: XpertResolvedViewHostContext, viewKey: string, actionKey: string, request: XpertViewActionRequest, file: XpertViewFileActionFile): Promise<XpertViewActionResult> | XpertViewActionResult;
|
|
59
|
+
/**
|
|
60
|
+
* Authorize a view-owned file for a purpose declared in the manifest's fileAccess policy.
|
|
61
|
+
* Return its portable workspace reference and presentation metadata for host-managed delivery.
|
|
62
|
+
*/
|
|
21
63
|
resolveViewFile?(context: XpertResolvedViewHostContext, viewKey: string, request: XpertViewFileAccessRequest): Promise<XpertViewFileResource> | XpertViewFileResource;
|
|
64
|
+
/**
|
|
65
|
+
* Supply dynamic choices for a declared view parameter, honoring search and dependent parameters.
|
|
66
|
+
* Restrict choices to resources visible to the caller; keep option lookup free of business mutations.
|
|
67
|
+
*/
|
|
22
68
|
getViewParameterOptions?(context: XpertResolvedViewHostContext, viewKey: string, parameterKey: string, query: XpertViewParameterOptionsQuery): Promise<XpertViewParameterOptionsResult> | XpertViewParameterOptionsResult;
|
|
69
|
+
/**
|
|
70
|
+
* Supply the HTML entry for a remote-component view using the component declared in its manifest.
|
|
71
|
+
* Serve plugin-controlled UI assets; use the host bridge for runtime data and actions.
|
|
72
|
+
* The host owns the iframe integration, while resource access remains enforced by the data/action hooks.
|
|
73
|
+
*/
|
|
23
74
|
getRemoteComponentEntry?(context: XpertResolvedViewHostContext, viewKey: string, component: XpertRemoteComponentViewSchema['component']): Promise<XpertRemoteComponentEntry> | XpertRemoteComponentEntry;
|
|
24
75
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface RemoteComponentInit {
|
|
2
|
+
locale: string;
|
|
3
|
+
theme?: {
|
|
4
|
+
mode?: string;
|
|
5
|
+
density?: 'default' | 'compact';
|
|
6
|
+
tokens?: Record<string, string | number>;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
/** Subscribe before rendering. The returned cleanup releases the listener and all outstanding requests. */
|
|
10
|
+
export declare function connect(init: (context: RemoteComponentInit, changed: boolean) => void, contextChanged: () => void): () => void;
|
|
11
|
+
export declare function request(type: string, body?: object): Promise<unknown>;
|
|
12
|
+
/** Bind a request before asynchronous preparation, so a context switch cannot redirect it. */
|
|
13
|
+
export declare function scopedRequest(): typeof request;
|