@xpert-ai/contracts 3.21.2 → 3.21.3
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/index.cjs.js +569 -96
- package/index.esm.js +553 -97
- package/package.json +1 -1
- package/src/agent-plugin.d.ts +17 -4
- package/src/ai/assistant-capability.model.d.ts +24 -0
- package/src/ai/assistant-template-dependencies.model.d.ts +51 -0
- package/src/ai/assistant-template-manifest.model.d.ts +1826 -0
- package/src/ai/assistant-template-overview.model.d.ts +44 -0
- package/src/ai/assistant-template-setup.model.d.ts +193 -0
- package/src/ai/assistant-template.model.d.ts +16 -0
- package/src/ai/assistant-user-preference.model.d.ts +4 -0
- package/src/ai/index.d.ts +9 -0
- package/src/ai/project-task-runtime.model.d.ts +29 -29
- package/src/ai/template-activity.model.d.ts +24 -0
- package/src/ai/template-installation.model.d.ts +131 -0
- package/src/ai/template-lifecycle.model.d.ts +89 -0
- package/src/ai/template-manifest.model.d.ts +3 -0
- package/src/ai/xpert-template.model.d.ts +12 -8
- package/src/ai/xpert.model.d.ts +8 -0
- package/src/api-key.model.d.ts +12 -5
- package/src/index.d.ts +2 -0
- package/src/personal-api-key.model.d.ts +21 -0
- package/src/plugin-application.d.ts +8 -0
- package/src/plugin.d.ts +2 -37
- package/src/role-permission-modules.d.ts +3 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const templatePublicationInputSchema: z.ZodObject<{
|
|
3
|
+
revision: z.ZodString;
|
|
4
|
+
contentHash: z.ZodString;
|
|
5
|
+
visibility: z.ZodEnum<["team", "public"]>;
|
|
6
|
+
version: z.ZodString;
|
|
7
|
+
releaseNotes: z.ZodDefault<z.ZodString>;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
version?: string;
|
|
10
|
+
revision?: string;
|
|
11
|
+
contentHash?: string;
|
|
12
|
+
visibility?: "public" | "team";
|
|
13
|
+
releaseNotes?: string;
|
|
14
|
+
}, {
|
|
15
|
+
version?: string;
|
|
16
|
+
revision?: string;
|
|
17
|
+
contentHash?: string;
|
|
18
|
+
visibility?: "public" | "team";
|
|
19
|
+
releaseNotes?: string;
|
|
20
|
+
}>;
|
|
21
|
+
export type TemplatePublicationInput = z.output<typeof templatePublicationInputSchema>;
|
|
22
|
+
export interface TemplatePublicationPreview {
|
|
23
|
+
revision: string;
|
|
24
|
+
contentHash: string;
|
|
25
|
+
content: string;
|
|
26
|
+
omitted: string[];
|
|
27
|
+
blocked: string[];
|
|
28
|
+
publication?: {
|
|
29
|
+
id: string;
|
|
30
|
+
version: string;
|
|
31
|
+
visibility: 'team' | 'public';
|
|
32
|
+
revoked: boolean;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export declare const templateUpgradeSectionSchema: z.ZodEnum<["presentation", "instructions", "runtime", "definition"]>;
|
|
36
|
+
export type TemplateUpgradeSection = z.output<typeof templateUpgradeSectionSchema>;
|
|
37
|
+
export declare const templateUpgradeInputSchema: z.ZodObject<{
|
|
38
|
+
targetTemplateId: z.ZodOptional<z.ZodString>;
|
|
39
|
+
revision: z.ZodString;
|
|
40
|
+
sourceHash: z.ZodString;
|
|
41
|
+
choices: z.ZodRecord<z.ZodEnum<["presentation", "instructions", "runtime", "definition"]>, z.ZodEnum<["keep", "replace"]>>;
|
|
42
|
+
}, "strict", z.ZodTypeAny, {
|
|
43
|
+
revision?: string;
|
|
44
|
+
sourceHash?: string;
|
|
45
|
+
targetTemplateId?: string;
|
|
46
|
+
choices?: Partial<Record<"runtime" | "instructions" | "presentation" | "definition", "replace" | "keep">>;
|
|
47
|
+
}, {
|
|
48
|
+
revision?: string;
|
|
49
|
+
sourceHash?: string;
|
|
50
|
+
targetTemplateId?: string;
|
|
51
|
+
choices?: Partial<Record<"runtime" | "instructions" | "presentation" | "definition", "replace" | "keep">>;
|
|
52
|
+
}>;
|
|
53
|
+
export type TemplateUpgradeInput = z.output<typeof templateUpgradeInputSchema>;
|
|
54
|
+
export interface TemplateUpgradeSource {
|
|
55
|
+
id: string;
|
|
56
|
+
title: string;
|
|
57
|
+
source?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface TemplateUpgradePreview {
|
|
60
|
+
previousTemplateId?: string;
|
|
61
|
+
revision: string;
|
|
62
|
+
sourceHash: string;
|
|
63
|
+
templateId: string;
|
|
64
|
+
version: string;
|
|
65
|
+
releaseNotes: string;
|
|
66
|
+
baselineAvailable: boolean;
|
|
67
|
+
blocked: string[];
|
|
68
|
+
changes: {
|
|
69
|
+
section: TemplateUpgradeSection;
|
|
70
|
+
conflict: boolean;
|
|
71
|
+
before: string;
|
|
72
|
+
after: string;
|
|
73
|
+
}[];
|
|
74
|
+
operation?: TemplateUpgradeOperation;
|
|
75
|
+
}
|
|
76
|
+
export interface TemplateUpgradeOperation {
|
|
77
|
+
id: string;
|
|
78
|
+
state: 'draft' | 'published' | 'failed' | 'rolled-back';
|
|
79
|
+
canResume: boolean;
|
|
80
|
+
canRollback: boolean;
|
|
81
|
+
}
|
|
82
|
+
export declare const templateUpgradeActionSchema: z.ZodObject<{
|
|
83
|
+
operationId: z.ZodString;
|
|
84
|
+
}, "strict", z.ZodTypeAny, {
|
|
85
|
+
operationId?: string;
|
|
86
|
+
}, {
|
|
87
|
+
operationId?: string;
|
|
88
|
+
}>;
|
|
89
|
+
export type TemplateUpgradeAction = z.output<typeof templateUpgradeActionSchema>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { AssistantCapabilityDeclaration } from './assistant-capability.model';
|
|
2
|
+
import type { TemplateManifest, TemplateReadiness } from './template-manifest.model';
|
|
1
3
|
import { IBasePerTenantEntityModel } from '../base-entity.model';
|
|
2
4
|
import { IconDefinition, TAvatar } from '../types';
|
|
3
5
|
import { ModelSelectionMetadata, TCopilotModel } from './copilot-model.model';
|
|
@@ -5,7 +7,7 @@ import { ModelFeature } from './ai-model.model';
|
|
|
5
7
|
import { MCPServerType, TMCPServer } from './xpert-tool-mcp.model';
|
|
6
8
|
import { XpertTypeEnum } from './xpert.model';
|
|
7
9
|
import type { TPromptWorkflow } from './prompt-workflow.model';
|
|
8
|
-
import { PluginTargetApp, PluginTargetAppMeta, PluginTemplateApplicationSummary
|
|
10
|
+
import { PluginTargetApp, PluginTargetAppMeta, PluginTemplateApplicationSummary } from '../plugin';
|
|
9
11
|
export interface IXpertTemplate extends IBasePerTenantEntityModel {
|
|
10
12
|
key: string;
|
|
11
13
|
name?: string;
|
|
@@ -101,7 +103,8 @@ export type TTemplate = {
|
|
|
101
103
|
pluginVersion?: string;
|
|
102
104
|
contentHash?: string;
|
|
103
105
|
xpertName?: string;
|
|
104
|
-
|
|
106
|
+
manifest?: TemplateManifest;
|
|
107
|
+
dependencies?: import('./assistant-template-dependencies.model').AssistantTemplateDependencies;
|
|
105
108
|
/** Explicit capability requirements/options, implemented by registered providers. */
|
|
106
109
|
capabilities?: AssistantCapabilityDeclaration[];
|
|
107
110
|
/** Capabilities composed into this resolved template variant. */
|
|
@@ -116,14 +119,13 @@ export type TXpertTemplate = TTemplate & {
|
|
|
116
119
|
type: XpertTypeEnum | 'project';
|
|
117
120
|
copilotModel?: Partial<TCopilotModel>;
|
|
118
121
|
};
|
|
119
|
-
export type TXpertTemplateSummary = Omit<TXpertTemplate, 'export_data'
|
|
122
|
+
export type TXpertTemplateSummary = Omit<TXpertTemplate, 'export_data' | 'manifest'> & {
|
|
123
|
+
/** Catalog membership discriminator; full application configuration is detail-only. */
|
|
124
|
+
hasApplication?: boolean;
|
|
125
|
+
};
|
|
120
126
|
/** Opt-in capabilities offered by the serving distribution for a template. */
|
|
121
127
|
export type XpertTemplateCapability = string;
|
|
122
|
-
export
|
|
123
|
-
key: string;
|
|
124
|
-
/** Required capabilities cannot be disabled; optional capabilities default to off. */
|
|
125
|
-
required?: boolean;
|
|
126
|
-
}
|
|
128
|
+
export type { AssistantCapabilityDeclaration } from './assistant-capability.model';
|
|
127
129
|
/** Public model metadata for capability setup; never includes provider credentials or model configuration. */
|
|
128
130
|
export interface XpertTemplateModelOption extends ModelSelectionMetadata {
|
|
129
131
|
/** Opaque selection key; clients must submit it unchanged rather than reconstructing it. */
|
|
@@ -133,6 +135,7 @@ export interface XpertTemplateModelOption extends ModelSelectionMetadata {
|
|
|
133
135
|
copilotModel: TCopilotModel;
|
|
134
136
|
}
|
|
135
137
|
export interface XpertTemplateSetup {
|
|
138
|
+
readiness?: TemplateReadiness;
|
|
136
139
|
/** ID of a compatible organization default in `models`; absent if none qualifies. */
|
|
137
140
|
defaultModelId?: string;
|
|
138
141
|
realtimeModels?: import('./realtime-voice.model').RealtimeModelOption[];
|
|
@@ -148,6 +151,7 @@ export interface XpertTemplateSetup {
|
|
|
148
151
|
reason?: string;
|
|
149
152
|
}
|
|
150
153
|
export interface TXpertTemplateCatalogQuery {
|
|
154
|
+
assistantsOnly?: boolean;
|
|
151
155
|
search?: string;
|
|
152
156
|
category?: string;
|
|
153
157
|
pluginName?: string;
|
package/src/ai/xpert.model.d.ts
CHANGED
|
@@ -275,6 +275,10 @@ export type TXpertWorkbenchOptions = {
|
|
|
275
275
|
* `<plugin package>:<template key>` so a later sync resolves the same provider.
|
|
276
276
|
*/
|
|
277
277
|
export type TXpertTemplateSource = {
|
|
278
|
+
/** Portable section hashes at installation/update, used for three-way conflict detection. */
|
|
279
|
+
baseline?: Partial<Record<import('./template-lifecycle.model').TemplateUpgradeSection, string>>;
|
|
280
|
+
manifest?: import('./template-manifest.model').TemplateManifest;
|
|
281
|
+
dependencyLocks?: import('./template-manifest.model').TemplateDependencyLock[];
|
|
278
282
|
templateId: string;
|
|
279
283
|
templateKey: string;
|
|
280
284
|
pluginName?: string;
|
|
@@ -301,6 +305,9 @@ export type TXpertDataXpertOptions = {
|
|
|
301
305
|
[key: string]: unknown;
|
|
302
306
|
};
|
|
303
307
|
export type TXpertOptions = {
|
|
308
|
+
operationPolicy?: import('./assistant-template-setup.model').AssistantOperationPolicy;
|
|
309
|
+
templateDefinition?: import('./assistant-template.model').AssistantTemplateMetadata;
|
|
310
|
+
templateDependencyLocks?: import('./template-installation.model').TemplateDependencyLock[];
|
|
304
311
|
/** Default ChatKit message display for this Assistant. Omit to inherit the host application's default. */
|
|
305
312
|
messagePresentation?: {
|
|
306
313
|
mode?: 'transcript' | 'bubbles';
|
|
@@ -550,6 +557,7 @@ export type TXpertGraph = {
|
|
|
550
557
|
connections: TXpertTeamConnection[];
|
|
551
558
|
};
|
|
552
559
|
export type TXpertTeamDraft = TXpertGraph & {
|
|
560
|
+
template?: import('./assistant-template.model').AssistantTemplateMetadata;
|
|
553
561
|
team: Partial<IXpert>;
|
|
554
562
|
savedAt?: Date;
|
|
555
563
|
checklist?: ChecklistItem[];
|
package/src/api-key.model.d.ts
CHANGED
|
@@ -5,16 +5,18 @@ import { IUser } from './user.model';
|
|
|
5
5
|
* Represents an API key used for authentication and authorization.
|
|
6
6
|
*/
|
|
7
7
|
export interface IApiKey extends IBasePerTenantAndOrganizationEntityModel {
|
|
8
|
+
/** Plaintext for resource keys; SHA-256 digest for USER credentials. */
|
|
8
9
|
token: string;
|
|
9
10
|
name?: string;
|
|
10
11
|
/**
|
|
11
|
-
* Stable persisted binding kind for resolving the
|
|
12
|
+
* Stable persisted binding kind for resolving the human or resource principal behind this key.
|
|
12
13
|
* @deprecated Reading IApiPrincipal.apiKey.type for resource authorization is deprecated;
|
|
13
14
|
* use IApiPrincipal.resourceScope.kind. This persisted identity discriminator remains supported.
|
|
14
15
|
*/
|
|
15
16
|
type?: ApiKeyBindingType;
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
+
* Persisted identity binding. Examples:
|
|
19
|
+
* - user => human owner userId
|
|
18
20
|
* - assistant => xpertId
|
|
19
21
|
* - workspace => workspaceId
|
|
20
22
|
* - integration => integrationId
|
|
@@ -26,9 +28,12 @@ export interface IApiKey extends IBasePerTenantAndOrganizationEntityModel {
|
|
|
26
28
|
validUntil?: Date;
|
|
27
29
|
expired?: boolean;
|
|
28
30
|
lastUsedAt?: Date;
|
|
31
|
+
/** Display prefix for one-time personal credentials. */
|
|
32
|
+
prefix?: string | null;
|
|
33
|
+
revokedAt?: Date | null;
|
|
29
34
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
35
|
+
* Bound principal: a fixed human owner for USER keys, otherwise the technical principal.
|
|
36
|
+
* USER bindings must also match entityId; resource bindings prefer this explicit principal.
|
|
32
37
|
*/
|
|
33
38
|
userId?: string;
|
|
34
39
|
user?: IUser;
|
|
@@ -39,9 +44,11 @@ export interface IApiKey extends IBasePerTenantAndOrganizationEntityModel {
|
|
|
39
44
|
*/
|
|
40
45
|
export declare const API_PRINCIPAL_USER_ID_HEADER = "x-principal-user-id";
|
|
41
46
|
/**
|
|
42
|
-
* Stable binding kinds used to resolve
|
|
47
|
+
* Stable binding kinds used to resolve personal or resource credentials.
|
|
43
48
|
*/
|
|
44
49
|
export declare enum ApiKeyBindingType {
|
|
50
|
+
/** A fixed human owner, without an Assistant or workspace audience. */
|
|
51
|
+
USER = "user",
|
|
45
52
|
ASSISTANT = "assistant",
|
|
46
53
|
WORKSPACE = "workspace",
|
|
47
54
|
INTEGRATION = "integration",
|
package/src/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export * from './organization-team-employee-model';
|
|
|
26
26
|
export * from './organization-team-model';
|
|
27
27
|
export * from './organization.model';
|
|
28
28
|
export * from './role-permission.model';
|
|
29
|
+
export * from './role-permission-modules';
|
|
29
30
|
export * from './referral.model';
|
|
30
31
|
export * from './seed.model';
|
|
31
32
|
export * from './tag-entity.model';
|
|
@@ -54,6 +55,7 @@ export * from './integration/index';
|
|
|
54
55
|
export * from './ai/index';
|
|
55
56
|
export * from './agent/index';
|
|
56
57
|
export * from './api-key.model';
|
|
58
|
+
export * from './personal-api-key.model';
|
|
57
59
|
export * from './artifact.model';
|
|
58
60
|
export * from './business-area.model';
|
|
59
61
|
export * from './collaboration.model';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** A personal credential uses existing API-key endpoints as its human owner, subject to their current permissions. */
|
|
2
|
+
export declare const PERSONAL_API_KEY_LIFETIMES: readonly ["30", "90", "365", "never"];
|
|
3
|
+
export type PersonalApiKeyLifetime = (typeof PERSONAL_API_KEY_LIFETIMES)[number];
|
|
4
|
+
export interface PersonalApiKeyCreateInput {
|
|
5
|
+
name: string;
|
|
6
|
+
lifetime?: PersonalApiKeyLifetime;
|
|
7
|
+
}
|
|
8
|
+
/** Public metadata only; neither the secret nor its hash is returned by list endpoints. */
|
|
9
|
+
export interface PersonalApiKeySummary {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
prefix: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
expiresAt: string | null;
|
|
15
|
+
lastUsedAt: string | null;
|
|
16
|
+
revokedAt: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface PersonalApiKeyCreated {
|
|
19
|
+
key: PersonalApiKeySummary;
|
|
20
|
+
token: string;
|
|
21
|
+
}
|
|
@@ -228,7 +228,15 @@ export interface PluginApplicationPreflight {
|
|
|
228
228
|
toolsetRequirements?: PluginApplicationToolsetRequirement[];
|
|
229
229
|
}
|
|
230
230
|
/** Complete application detail assembled from trusted plugin metadata and scoped runtime state. */
|
|
231
|
+
export interface PluginApplicationCompositionItem {
|
|
232
|
+
key: string;
|
|
233
|
+
kind: 'assistant' | 'workspace' | 'knowledgebase';
|
|
234
|
+
role?: 'primary' | 'specialist' | 'standalone';
|
|
235
|
+
templateKey?: string;
|
|
236
|
+
title: string | I18nObject;
|
|
237
|
+
}
|
|
231
238
|
export interface PluginApplicationDetail {
|
|
239
|
+
composition: PluginApplicationCompositionItem[];
|
|
232
240
|
application: PluginTemplateApplicationSummary;
|
|
233
241
|
status: PluginApplicationStatusSummary;
|
|
234
242
|
preflight: PluginApplicationPreflight;
|
package/src/plugin.d.ts
CHANGED
|
@@ -198,43 +198,8 @@ export interface XpertPluginBundleManifest {
|
|
|
198
198
|
targetApps?: PluginTargetApp[];
|
|
199
199
|
targetAppMeta?: PluginTargetAppMeta;
|
|
200
200
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
componentKey: string;
|
|
204
|
-
targetAgentKey?: string;
|
|
205
|
-
}
|
|
206
|
-
export interface XpertTemplatePluginMcpServerDependency {
|
|
207
|
-
pluginName?: PluginName;
|
|
208
|
-
componentKey: string;
|
|
209
|
-
targetAgentKey?: string;
|
|
210
|
-
policyOverrides?: XpertPluginMcpServerPolicy;
|
|
211
|
-
}
|
|
212
|
-
export interface XpertTemplatePluginHookDependency {
|
|
213
|
-
pluginName?: PluginName;
|
|
214
|
-
componentKey: string;
|
|
215
|
-
targetAgentKey?: string;
|
|
216
|
-
events?: string[];
|
|
217
|
-
}
|
|
218
|
-
export interface XpertTemplatePluginAppDependency {
|
|
219
|
-
pluginName?: PluginName;
|
|
220
|
-
componentKey: string;
|
|
221
|
-
auth?: 'on_install' | 'on_first_use';
|
|
222
|
-
}
|
|
223
|
-
export interface XpertTemplatePluginToolsetDependency {
|
|
224
|
-
pluginName?: PluginName;
|
|
225
|
-
provider: string;
|
|
226
|
-
templateNodeKey: string;
|
|
227
|
-
targetAgentKey?: string;
|
|
228
|
-
instanceName?: string;
|
|
229
|
-
}
|
|
230
|
-
export interface XpertTemplatePluginDependencies {
|
|
231
|
-
plugins?: PluginName[];
|
|
232
|
-
skills?: XpertTemplatePluginSkillDependency[];
|
|
233
|
-
mcpServers?: XpertTemplatePluginMcpServerDependency[];
|
|
234
|
-
hooks?: XpertTemplatePluginHookDependency[];
|
|
235
|
-
apps?: XpertTemplatePluginAppDependency[];
|
|
236
|
-
toolsets?: XpertTemplatePluginToolsetDependency[];
|
|
237
|
-
}
|
|
201
|
+
/** @deprecated Use the Assistant template domain contracts. */
|
|
202
|
+
export type { AssistantTemplateSkillDependency as XpertTemplatePluginSkillDependency, AssistantTemplateMcpServerDependency as XpertTemplatePluginMcpServerDependency, AssistantTemplateHookDependency as XpertTemplatePluginHookDependency, AssistantTemplateAppDependency as XpertTemplatePluginAppDependency, AssistantTemplateToolsetDependency as XpertTemplatePluginToolsetDependency, AssistantTemplateDependencies as XpertTemplatePluginDependencies } from './ai/assistant-template-dependencies.model';
|
|
238
203
|
export interface PluginMarketplaceContribution {
|
|
239
204
|
/** Project types defined by an App, separate from installation configuration. */
|
|
240
205
|
projectTypes?: import('./ai/xpert-project-type.model').XpertProjectTypeDefinition[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Display-only grouping. PermissionGroups remains the authority for access rules. */
|
|
2
|
+
export type RolePermissionModule = 'ai' | 'projects' | 'members' | 'billing' | 'data' | 'personal' | 'other';
|
|
3
|
+
export declare const ROLE_PERMISSION_MODULES: ReadonlyMap<string, RolePermissionModule>;
|