@xpert-ai/contracts 3.21.0 → 3.21.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/contracts",
3
- "version": "3.21.0",
3
+ "version": "3.21.2",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@octokit/types": "13.10.0",
23
23
  "@types/json-schema": "^7.0.15",
24
- "@xpert-ai/chatkit-types": "0.13.0",
24
+ "@xpert-ai/chatkit-types": "0.14.2",
25
25
  "zod-to-json-schema": "^3.25.2"
26
26
  },
27
27
  "peerDependencies": {
@@ -8,7 +8,7 @@ import type { I18nText } from './i18n.model';
8
8
  export type RuntimeResourceKind = 'agent_plugin' | 'middleware' | 'external_xpert';
9
9
  /**
10
10
  * Availability in the current user/project context; execution still revalidates access.
11
- * partial means some components are usable; requires_auth needs personal authorization;
11
+ * partial means some components are usable; requires_auth needs Connector authorization;
12
12
  * configuration_required needs administrator configuration.
13
13
  */
14
14
  export type RuntimeResourceStatus = 'ready' | 'requires_auth' | 'configuration_required' | 'partial' | 'unavailable';
@@ -124,6 +124,8 @@ export interface AgentPluginConnectorBinding {
124
124
  export type RuntimeResourceDefinition = {
125
125
  kind: 'agent_plugin';
126
126
  packageId: string;
127
+ /** Scope installation/configuration. Omitted on legacy workspace bindings. */
128
+ availability?: 'scope';
127
129
  /** Portable expert reference to approved, published Assistant ID. */
128
130
  experts: {
129
131
  [reference: string]: string;
@@ -145,13 +147,13 @@ export type RuntimeResourceDefinition = {
145
147
  /** Published platform Assistant ID, not a remote Agent URL. */
146
148
  xpertId: string;
147
149
  };
148
- /** Administrator request to publish a resource binding. */
150
+ /** Administrator request to configure an installed resource. */
149
151
  export interface RuntimeResourceBindingInput {
150
152
  /** Supersede an existing binding; its conversation selections are not silently rewritten. */
151
153
  replacesBindingId?: string;
152
154
  title: string;
153
155
  description?: string;
154
- /** Workspaces granted access within the organization. */
156
+ /** Legacy targets; Agent Plugins are visible throughout their installation scope. */
155
157
  workspaceIds: string[];
156
158
  definition: RuntimeResourceDefinition;
157
159
  }
@@ -190,3 +192,8 @@ export interface WorkspaceAgentPluginAddResult {
190
192
  status: 'added' | 'already_added';
191
193
  bindingId: string;
192
194
  }
195
+ /** Read-only installation catalog, independent of authoring workspace membership. */
196
+ export interface InstalledAgentPlugin extends Omit<WorkspaceAgentPlugin, 'status'> {
197
+ scope: 'tenant' | 'organization';
198
+ status: 'available' | 'configuration_required' | 'disabled';
199
+ }
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod/v3';
2
+ /** Host-owned routing context for a native Assistant invocation, not a separate runtime provider. */
3
+ export declare const assistantTaskGroupContextSchema: z.ZodObject<{
4
+ type: z.ZodLiteral<"group_member">;
5
+ groupId: z.ZodString;
6
+ participantId: z.ZodString;
7
+ sourceParticipantId: z.ZodString;
8
+ projectId: z.ZodString;
9
+ }, "strict", z.ZodTypeAny, {
10
+ type?: "group_member";
11
+ projectId?: string;
12
+ participantId?: string;
13
+ groupId?: string;
14
+ sourceParticipantId?: string;
15
+ }, {
16
+ type?: "group_member";
17
+ projectId?: string;
18
+ participantId?: string;
19
+ groupId?: string;
20
+ sourceParticipantId?: string;
21
+ }>;
22
+ export type AssistantTaskGroupContext = z.output<typeof assistantTaskGroupContextSchema>;
23
+ export declare function assistantTaskGroupContext(target: {
24
+ provider: string;
25
+ configuration: unknown;
26
+ }): AssistantTaskGroupContext | null;
@@ -77,6 +77,23 @@ export interface ChatGroupComposerInput {
77
77
  }
78
78
  /** Server-authored routing and causality metadata; public senders cannot supply or override identity. */
79
79
  export interface ChatGroupCommunication {
80
+ /** Host-only task routing metadata; never accepted by group send APIs or model tools. */
81
+ projectTask?: {
82
+ invocationId: string;
83
+ projectId: string;
84
+ projectTaskId: string;
85
+ taskExecutionId: string;
86
+ };
87
+ /** Durable Invocation result notification, delivered through the group queue. */
88
+ runtimeResult?: {
89
+ invocationId: string;
90
+ consumerExecutionId: string;
91
+ revision: number;
92
+ projectId: string;
93
+ projectTaskId: string;
94
+ taskExecutionId: string;
95
+ specificationDigest: string;
96
+ };
80
97
  /** Validated Composer selections for this message, when supplied by a human sender. */
81
98
  composer?: ChatGroupComposerInput;
82
99
  intent: ChatGroupIntent;
@@ -113,6 +130,8 @@ export interface ChatGroupMessage {
113
130
  deliveries: {
114
131
  participantId: string;
115
132
  status: ChatGroupDeliveryStatus;
133
+ /** Credential-redacted execution failure; absent for pending or successful deliveries. */
134
+ error?: string;
116
135
  }[];
117
136
  }
118
137
  /**
@@ -281,6 +300,8 @@ export interface ChatGroupRuntimeView {
281
300
  messageId?: string;
282
301
  /** Execution status, distinct from the group's delivery and thread statuses. */
283
302
  status: string;
303
+ /** Credential-redacted error for this execution, independent of later runs in the conversation. */
304
+ error?: string;
284
305
  /** Display projection for this execution; human runtime context is replaced with the public question. */
285
306
  messages: {
286
307
  /** Runtime ChatMessage ID, not the public group message ID. */
@@ -296,3 +317,22 @@ export interface ChatGroupRuntimeView {
296
317
  createdAt: string;
297
318
  }[];
298
319
  }
320
+ /** Shared Project membership is explicitly selected; group membership alone grants no Project access. */
321
+ export interface ChatGroupProjectInput {
322
+ project: {
323
+ mode: 'create';
324
+ id: string;
325
+ name: string;
326
+ } | {
327
+ mode: 'existing';
328
+ projectId: string;
329
+ };
330
+ /** Include the primary Assistant. Updates add participants and preserve existing bindings. */
331
+ participantIds: string[];
332
+ }
333
+ export interface ChatGroupProject {
334
+ projectId: string;
335
+ name: string;
336
+ /** Complete active selection after the operation, including previously bound members. */
337
+ participantIds: string[];
338
+ }
@@ -0,0 +1,10 @@
1
+ import type { IAssistantBinding } from './assistant-binding.model';
2
+ import type { IXpert } from './xpert.model';
3
+ export type ClawXpertRecoveryStatus = {
4
+ status: 'ready' | 'missing' | 'binding_inaccessible' | 'dependency_unavailable' | 'initializing' | 'error';
5
+ code: 'ready' | 'binding_missing' | 'binding_inaccessible' | 'model_required' | 'initialization_running' | 'initialization_failed' | 'personal_workspace_unavailable';
6
+ checkedAt: string;
7
+ binding: IAssistantBinding | null;
8
+ candidates: Array<Pick<IXpert, 'id' | 'name' | 'title' | 'workspaceId'>>;
9
+ canRecover: boolean;
10
+ };
@@ -1,6 +1,19 @@
1
1
  import { AiModelTypeEnum } from '../agent';
2
2
  import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
3
3
  import { ICopilot } from './copilot.model';
4
+ import type { ModelFeature } from './ai-model.model';
5
+ /** Public catalog metadata for model selectors; excludes credentials and runtime configuration. */
6
+ export interface ModelSelectionMetadata {
7
+ provider?: {
8
+ id: string;
9
+ label: string;
10
+ iconUrl?: string;
11
+ };
12
+ connectionName?: string;
13
+ features?: ModelFeature[];
14
+ /** Declared context capacity in tokens, not usage. */
15
+ contextWindow?: number;
16
+ }
4
17
  export interface ICopilotModel extends TCopilotModel, IBasePerTenantAndOrganizationEntityModel {
5
18
  }
6
19
  export type TCopilotModel = {
@@ -2,6 +2,7 @@ import { AiModelTypeEnum } from '../agent';
2
2
  import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
3
3
  import { IAiProviderEntity } from './ai-model.model';
4
4
  import { ICopilot } from './copilot.model';
5
+ import type { ModelConfiguration, ModelDiscoveryState } from './model-discovery.model';
5
6
  export interface ICopilotProvider extends IBasePerTenantAndOrganizationEntityModel {
6
7
  providerName?: string;
7
8
  providerType?: string;
@@ -13,7 +14,9 @@ export interface ICopilotProvider extends IBasePerTenantAndOrganizationEntityMod
13
14
  quotaUsed?: number;
14
15
  /**
15
16
  */
16
- options?: any;
17
+ options?: Record<string, unknown> & {
18
+ modelDiscovery?: ModelDiscoveryState;
19
+ };
17
20
  copilot?: ICopilot;
18
21
  copilotId?: string;
19
22
  models?: ICopilotProviderModel[];
@@ -23,7 +26,11 @@ export interface ICopilotProviderModel extends IBasePerTenantAndOrganizationEnti
23
26
  providerName?: string;
24
27
  modelName?: string;
25
28
  modelType?: AiModelTypeEnum;
26
- modelProperties?: Record<string, any>;
29
+ modelProperties?: Record<string, any> & {
30
+ model_configuration?: ModelConfiguration;
31
+ discovery_model_id?: string;
32
+ configuration_source?: 'discovered' | 'manual';
33
+ };
27
34
  isValid?: boolean;
28
35
  provider?: ICopilotProvider;
29
36
  providerId?: string;
@@ -89,7 +89,7 @@ export declare const executionActivityItemSchema: z.ZodObject<{
89
89
  }[];
90
90
  }>]>>;
91
91
  }, "strict", z.ZodTypeAny, {
92
- status?: "succeeded" | "failed" | "running" | "unknown";
92
+ status?: "unknown" | "succeeded" | "failed" | "running";
93
93
  name?: string;
94
94
  input?: string;
95
95
  output?: string;
@@ -114,7 +114,7 @@ export declare const executionActivityItemSchema: z.ZodObject<{
114
114
  key?: string;
115
115
  };
116
116
  }, {
117
- status?: "succeeded" | "failed" | "running" | "unknown";
117
+ status?: "unknown" | "succeeded" | "failed" | "running";
118
118
  name?: string;
119
119
  input?: string;
120
120
  output?: string;
@@ -157,7 +157,7 @@ export declare const executionActivityItemSchema: z.ZodObject<{
157
157
  text?: string;
158
158
  kind?: "message";
159
159
  } | {
160
- status?: "succeeded" | "failed" | "running" | "unknown";
160
+ status?: "unknown" | "succeeded" | "failed" | "running";
161
161
  name?: string;
162
162
  input?: string;
163
163
  output?: string;
@@ -193,7 +193,7 @@ export declare const executionActivityItemSchema: z.ZodObject<{
193
193
  text?: string;
194
194
  kind?: "message";
195
195
  } | {
196
- status?: "succeeded" | "failed" | "running" | "unknown";
196
+ status?: "unknown" | "succeeded" | "failed" | "running";
197
197
  name?: string;
198
198
  input?: string;
199
199
  output?: string;
@@ -304,7 +304,7 @@ export declare const executionActivityBatchSchema: z.ZodObject<{
304
304
  }[];
305
305
  }>]>>;
306
306
  }, "strict", z.ZodTypeAny, {
307
- status?: "succeeded" | "failed" | "running" | "unknown";
307
+ status?: "unknown" | "succeeded" | "failed" | "running";
308
308
  name?: string;
309
309
  input?: string;
310
310
  output?: string;
@@ -329,7 +329,7 @@ export declare const executionActivityBatchSchema: z.ZodObject<{
329
329
  key?: string;
330
330
  };
331
331
  }, {
332
- status?: "succeeded" | "failed" | "running" | "unknown";
332
+ status?: "unknown" | "succeeded" | "failed" | "running";
333
333
  name?: string;
334
334
  input?: string;
335
335
  output?: string;
@@ -372,7 +372,7 @@ export declare const executionActivityBatchSchema: z.ZodObject<{
372
372
  text?: string;
373
373
  kind?: "message";
374
374
  } | {
375
- status?: "succeeded" | "failed" | "running" | "unknown";
375
+ status?: "unknown" | "succeeded" | "failed" | "running";
376
376
  name?: string;
377
377
  input?: string;
378
378
  output?: string;
@@ -408,7 +408,7 @@ export declare const executionActivityBatchSchema: z.ZodObject<{
408
408
  text?: string;
409
409
  kind?: "message";
410
410
  } | {
411
- status?: "succeeded" | "failed" | "running" | "unknown";
411
+ status?: "unknown" | "succeeded" | "failed" | "running";
412
412
  name?: string;
413
413
  input?: string;
414
414
  output?: string;
@@ -451,7 +451,7 @@ export declare const executionActivityBatchSchema: z.ZodObject<{
451
451
  text?: string;
452
452
  kind?: "message";
453
453
  } | {
454
- status?: "succeeded" | "failed" | "running" | "unknown";
454
+ status?: "unknown" | "succeeded" | "failed" | "running";
455
455
  name?: string;
456
456
  input?: string;
457
457
  output?: string;
@@ -493,7 +493,7 @@ export declare const executionActivityBatchSchema: z.ZodObject<{
493
493
  text?: string;
494
494
  kind?: "message";
495
495
  } | {
496
- status?: "succeeded" | "failed" | "running" | "unknown";
496
+ status?: "unknown" | "succeeded" | "failed" | "running";
497
497
  name?: string;
498
498
  input?: string;
499
499
  output?: string;
package/src/ai/index.d.ts CHANGED
@@ -7,11 +7,13 @@ export type { TChatRequest } from './xpert-chat.model';
7
7
  export type { ProjectSelection } from './project-selection.model';
8
8
  export { CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED } from './chat-event.model';
9
9
  export * from './assistant-binding.model';
10
+ export * from './clawxpert-recovery.model';
10
11
  export * from './bosi.model';
11
12
  export * from './assistant-order';
12
13
  export * from './assistant-model.model';
13
14
  export * from './assistant-user-preference.model';
14
15
  export * from './ai-model.model';
16
+ export * from './model-discovery.model';
15
17
  export * from './ai.model';
16
18
  export * from './chat-event.model';
17
19
  export { createResourceCardContent, isResourceCardContent, parseResourceCard, parseResourceCardContent, resourceCardId, upsertResourceCardContent } from './resource-card';
@@ -100,6 +102,7 @@ export * from './assistant-configuration.model';
100
102
  export * from './assistant-trigger.model';
101
103
  export * from './model-execution.model';
102
104
  export * from './agent-runtime.model';
105
+ export * from './assistant-task-context.model';
103
106
  export * from './project-task-runtime.model';
104
107
  export * from './realtime-voice.model';
105
108
  export * from './chat-group.model';