@xpert-ai/contracts 3.33.1 → 3.35.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.
Files changed (68) hide show
  1. package/index.cjs.js +545 -168
  2. package/index.esm.js +517 -169
  3. package/package.json +2 -2
  4. package/src/ai/ai.model.d.ts +1 -1
  5. package/src/ai/chat-group-entity.model.d.ts +1 -1
  6. package/src/ai/chat-group.model.d.ts +116 -3
  7. package/src/ai/conversation-trail.model.d.ts +2 -2
  8. package/src/ai/evolution/baseline.d.ts +12 -0
  9. package/src/ai/evolution/candidate.d.ts +20 -0
  10. package/src/ai/evolution/capability-version.d.ts +12 -0
  11. package/src/ai/evolution/change.d.ts +40 -2
  12. package/src/ai/evolution/evaluation.d.ts +26 -0
  13. package/src/ai/evolution/example.d.ts +5 -0
  14. package/src/ai/evolution/experience.d.ts +3 -0
  15. package/src/ai/evolution/governance.d.ts +29 -3
  16. package/src/ai/evolution/index.d.ts +1 -0
  17. package/src/ai/evolution/learning-event.d.ts +13 -0
  18. package/src/ai/evolution/learning-review.d.ts +61 -0
  19. package/src/ai/evolution/persistence.d.ts +7 -2
  20. package/src/ai/evolution/provider.d.ts +38 -0
  21. package/src/ai/evolution/release.d.ts +24 -6
  22. package/src/ai/evolution/runtime.d.ts +19 -0
  23. package/src/ai/evolution/strategy.d.ts +10 -0
  24. package/src/ai/evolution/target.d.ts +34 -6
  25. package/src/ai/execution-control-evidence.schema.d.ts +46 -4
  26. package/src/ai/index.d.ts +4 -0
  27. package/src/ai/model-execution.model.d.ts +2 -0
  28. package/src/ai/project-configuration-view.model.d.ts +77 -0
  29. package/src/ai/project-pipeline/analytics.d.ts +5 -33
  30. package/src/ai/project-pipeline/budget.schema.d.ts +38 -0
  31. package/src/ai/project-pipeline/commands.schema.d.ts +10 -10
  32. package/src/ai/project-pipeline/configuration-form.d.ts +2 -2
  33. package/src/ai/project-pipeline/index.d.ts +1 -0
  34. package/src/ai/project-pipeline/model-usage-statistics.d.ts +6 -26
  35. package/src/ai/project-pipeline/operation.schema.d.ts +370 -40
  36. package/src/ai/project-pipeline/plugin-deployment.schema.d.ts +152 -0
  37. package/src/ai/project-pipeline/portfolio.schema.d.ts +14 -86
  38. package/src/ai/project-pipeline/provider-actions.schema.d.ts +12 -12
  39. package/src/ai/project-pipeline/runtime.schema.d.ts +2 -2
  40. package/src/ai/project-pipeline/statistics.d.ts +5 -33
  41. package/src/ai/project-task-runtime.model.d.ts +1329 -78
  42. package/src/ai/project-type-configuration.model.d.ts +48 -0
  43. package/src/ai/xpert-agent-execution.model.d.ts +16 -2
  44. package/src/ai/xpert-project-type.model.d.ts +3 -0
  45. package/src/ai/xpert-project.model.d.ts +3 -1
  46. package/src/ai/xpert-task.model.d.ts +16 -0
  47. package/src/ai/xpert.model.d.ts +2 -0
  48. package/src/app-platform.d.ts +36 -36
  49. package/src/artifact-group-reference.model.d.ts +71 -0
  50. package/src/artifact-use-grant-command.d.ts +54 -0
  51. package/src/artifact-use-grant.model.d.ts +62 -0
  52. package/src/content-resource.model.d.ts +3 -0
  53. package/src/conversation-resource.model.d.ts +63 -0
  54. package/src/desktop-shell.model.d.ts +13 -1
  55. package/src/icon-definition.schema.d.ts +24 -0
  56. package/src/index.d.ts +6 -0
  57. package/src/plugin-management.d.ts +13 -0
  58. package/src/plugin.d.ts +2 -0
  59. package/src/resource-analysis.model.d.ts +140 -0
  60. package/src/runtime-control.d.ts +6 -0
  61. package/src/types.d.ts +1 -2
  62. package/src/user-notification.schema.d.ts +29 -0
  63. package/src/user.model.d.ts +11 -0
  64. package/src/view-extension/client-commands.d.ts +176 -0
  65. package/src/view-extension/context-event.d.ts +66 -0
  66. package/src/view-extension/index.d.ts +2 -0
  67. package/src/view-extension/model.d.ts +2 -158
  68. package/src/view-extension/workbench-open.d.ts +17 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/contracts",
3
- "version": "3.33.1",
3
+ "version": "3.35.0",
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.20.2",
24
+ "@xpert-ai/chatkit-types": "~0.21.0",
25
25
  "zod-to-json-schema": "^3.25.2"
26
26
  },
27
27
  "peerDependencies": {
@@ -140,7 +140,7 @@ export type TChatStreamMessageEndPayload = {
140
140
  data: Partial<TChatStreamMessageEndData>;
141
141
  };
142
142
  export type TChatStreamMessageLifecyclePayload = TChatStreamMessageStartPayload | TChatStreamMessageEndPayload;
143
- export type TChatStreamAgentEndData = Pick<IXpertAgentExecution, 'id' | 'agentKey' | 'status' | 'error' | 'elapsedTime' | 'tokens' | 'totalTokens' | 'embedTokens' | 'inputTokens' | 'outputTokens' | 'totalPrice' | 'currency' | 'metadata' | 'responseLatency' | 'parentId' | 'xpertId'>;
143
+ export type TChatStreamAgentEndData = Pick<IXpertAgentExecution, 'id' | 'agentKey' | 'status' | 'error' | 'elapsedTime' | 'tokens' | 'totalTokens' | 'embedTokens' | 'inputTokens' | 'outputTokens' | 'chargedPoints' | 'metadata' | 'responseLatency' | 'parentId' | 'xpertId'>;
144
144
  export type TChatStreamAgentEndPayload = {
145
145
  type: ChatMessageTypeEnum.EVENT;
146
146
  event: ChatMessageEventTypeEnum.ON_AGENT_END;
@@ -41,7 +41,7 @@ export interface IGroupMessageRecipient extends IBasePerTenantAndOrganizationEnt
41
41
  status: ChatGroupDeliveryStatus;
42
42
  /** Whether this delivery should invoke the recipient Assistant via the existing message queue. */
43
43
  wake: boolean;
44
- /** Public group reply that fulfills this request. */
44
+ /** Persisted final reply by this recipient; progress replies never claim completion. */
45
45
  replyMessageId?: string | null;
46
46
  /** Recorded Assistant execution and its runtime input message. */
47
47
  executionId?: string | null;
@@ -1,6 +1,8 @@
1
- import type { RuntimeCapabilitiesSelection } from '@xpert-ai/chatkit-types';
1
+ import type { ConversationResourceTarget } from '../conversation-resource.model';
2
+ import type { RuntimeCapabilitiesSelection, TMessageContentResourceCard } from '@xpert-ai/chatkit-types';
2
3
  import type { RuntimeResourcesSelection } from '../agent-plugin';
3
- import type { TAvatar } from '../types';
4
+ import type { IconDefinition, TAvatar } from '../types';
5
+ import type { XpertProjectTypeRef } from './xpert-project-type.model';
4
6
  /**
5
7
  * Public group protocol for ChatConversation(purpose='group'). Each Assistant has a separate runtime.
6
8
  * Participant IDs identify membership within this group; subject IDs identify User or Xpert records.
@@ -13,6 +15,13 @@ import type { TAvatar } from '../types';
13
15
  * routes back to its sender; `message` publishes information without waking addressed Assistants.
14
16
  */
15
17
  export type ChatGroupIntent = 'request' | 'reply' | 'message';
18
+ /**
19
+ * Completion intent for one sender's reply to one group request, independent of delivery/run status.
20
+ * `progress` publishes a partial answer without completing the request or waking its requester.
21
+ * `final` completes this sender's answer only after successful publication and may wake the requester.
22
+ * It does not complete a Project task, accept its result, or complete other recipients' answers.
23
+ */
24
+ export type ChatGroupReplyStage = 'progress' | 'final';
16
25
  /** Per-recipient delivery progress, independent of the overall Assistant run status. */
17
26
  export type ChatGroupDeliveryStatus =
18
27
  /** Accepted for delivery; dispatch may still be pending. */
@@ -52,6 +61,15 @@ export interface ChatGroupParticipant {
52
61
  }
53
62
  /** Invite candidate before membership exists; submit kind + subjectId to add the member. */
54
63
  export type ChatGroupCandidate = Pick<ChatGroupParticipant, 'kind' | 'subjectId' | 'name' | 'avatar'>;
64
+ /** A rejected send has not persisted a message or queued an Assistant execution. */
65
+ export type ChatGroupProjectRequiredError = {
66
+ statusCode: 400;
67
+ error: 'Bad Request';
68
+ code: 'GROUP_PROJECT_REQUIRED';
69
+ message: string;
70
+ groupId: string;
71
+ participantIds: string[];
72
+ };
55
73
  /**
56
74
  * Per-message selections from the shared Composer, scoped to one addressed Assistant.
57
75
  * This does not choose the recipient: the server requires a single matching Assistant recipient
@@ -79,8 +97,45 @@ export interface ChatGroupComposerInput {
79
97
  /** Shared capability selection contract; selection does not confer permission to use a capability. */
80
98
  runtimeCapabilities?: RuntimeCapabilitiesSelection;
81
99
  }
100
+ /**
101
+ * Server-authored clickable resource entry persisted with a group message.
102
+ * History replay may show the entry but must not auto-open it; opening always reauthorizes the resource in the current group and Project.
103
+ */
104
+ export interface ChatGroupResourceLink {
105
+ /** Public type icon captured by the host when publishing. Optional for legacy links; never an access grant. */
106
+ icon?: IconDefinition;
107
+ /** Canonical locator shared with discovery and Workbench. Contains no access grant. */
108
+ resource: ConversationResourceTarget;
109
+ /** Receiving group's runtime Project; checked before opening, never a source Project override. */
110
+ projectId: string;
111
+ /** Display label only; never use it to infer resource identity or type. */
112
+ title: string;
113
+ }
114
+ /** Live, requester-addressed navigation request derived from a resource link; not a durable open-on-load instruction. */
115
+ export interface ChatGroupResourceOpenRequest extends ChatGroupResourceLink {
116
+ /** Server-generated deduplication ID; consumers must not repeat an already handled navigation request. */
117
+ requestId: string;
118
+ /** Initiating message's client correlation ID, or its message ID fallback; used to match the current sender. */
119
+ clientMessageId: string;
120
+ }
82
121
  /** Server-authored routing and causality metadata; public senders cannot supply or override identity. */
83
122
  export interface ChatGroupCommunication {
123
+ /** Inert resource entries for message rendering, including history; these alone never trigger navigation. */
124
+ resourceLinks?: ChatGroupResourceLink[];
125
+ /**
126
+ * Server-only instruction to derive a fresh resource_open event for one human participant.
127
+ * Stream adapters check audience, connection freshness and request deduplication; replayed messages remain inert.
128
+ */
129
+ resourceNavigation?: {
130
+ /** Unique navigation request ID, carried into ChatGroupResourceOpenRequest. */
131
+ requestId: string;
132
+ /** Server emission time in Unix epoch milliseconds; used to reject stale/replayed instructions. */
133
+ issuedAt: number;
134
+ /** Client correlation ID of the initiating message, with server message ID as fallback. */
135
+ clientMessageId: string;
136
+ /** Intended viewer's group membership ID, not a User Account or Assistant ID. */
137
+ participantId: string;
138
+ };
84
139
  /** Host-only task routing metadata; never accepted by group send APIs or model tools. */
85
140
  projectTask?: {
86
141
  invocationId: string;
@@ -107,6 +162,13 @@ export interface ChatGroupCommunication {
107
162
  recipientIds: string[];
108
163
  /** Public group request being answered; a protocol relationship, not a required UI quote. */
109
164
  replyToMessageId?: string;
165
+ /**
166
+ * Valid only for `intent: 'reply'`. New Assistant tool calls must explicitly choose a stage.
167
+ * Absent on legacy replies means `final`; new publications persist the resolved stage.
168
+ * A successfully published final tool reply suppresses the automatic final answer for the same
169
+ * request and sender. Progress replies, ordinary messages and requests do not suppress it.
170
+ */
171
+ replyStage?: ChatGroupReplyStage;
110
172
  /** Public group message that caused this runtime output; independent of explicit reply intent. */
111
173
  causedByMessageId?: string;
112
174
  /** First public message ID in the causal chain, inherited across Assistant handoffs/replies. */
@@ -116,6 +178,44 @@ export interface ChatGroupCommunication {
116
178
  /** Causal depth: roots start at zero; inherited messages increment it for server loop limits. */
117
179
  hop: number;
118
180
  }
181
+ /** JSON presentation values only; no executable code, runtime sessions or host credentials. */
182
+ export type ChatGroupDisplayValue = string | number | boolean | null | ChatGroupDisplayValue[] | {
183
+ [key: string]: ChatGroupDisplayValue;
184
+ };
185
+ /**
186
+ * First-phase allowlist of inert tool-result snapshots. This is not a plugin publication API.
187
+ * Widget uses existing flat A2UI messages; ResourceCard uses the existing card contract.
188
+ * McpApp carries only a result snapshot, never an App instance, token, input or bridge.
189
+ * These blocks do not complete a request, wake an Assistant, or authorize resource access.
190
+ * Consumers must ignore unknown/malformed blocks and must not attach the source run's actions.
191
+ */
192
+ export type ChatGroupDisplay = TMessageContentResourceCard | {
193
+ id: string;
194
+ type: 'component';
195
+ data: {
196
+ category: 'Dashboard';
197
+ } & ({
198
+ type: 'Widget';
199
+ widgets: {
200
+ name: string;
201
+ messages: {
202
+ [key: string]: ChatGroupDisplayValue;
203
+ }[];
204
+ }[];
205
+ } | {
206
+ type: 'McpApp';
207
+ toolResult: {
208
+ content: {
209
+ type: 'text';
210
+ text: string;
211
+ }[];
212
+ structuredContent?: {
213
+ [key: string]: ChatGroupDisplayValue;
214
+ };
215
+ isError?: boolean;
216
+ };
217
+ });
218
+ };
119
219
  /** Public message in the shared group transcript, separate from private runtime ChatMessages. */
120
220
  export interface ChatGroupMessage {
121
221
  /** Persisted ChatMessage ID in the group conversation. */
@@ -125,6 +225,12 @@ export interface ChatGroupMessage {
125
225
  /** Server-assigned order within this conversation; unchanged when this message is updated. */
126
226
  sequence: number;
127
227
  text: string;
228
+ /**
229
+ * Server-filtered result snapshots, present even when text is empty. Block IDs are stable
230
+ * within this public message. Live snapshots and paginated history use the same shape.
231
+ * Only trusted runtime projection may supply these; public send APIs remain text-only.
232
+ */
233
+ display?: ChatGroupDisplay[];
128
234
  /** ISO 8601 creation timestamp; sequence, not this timestamp, defines transcript order. */
129
235
  createdAt: string;
130
236
  communication: ChatGroupCommunication;
@@ -265,8 +371,13 @@ export interface ChatGroupRun {
265
371
  * Extend this union together with stream validation and reducers; private runtime events do not belong here.
266
372
  */
267
373
  export type ChatGroupEvent =
268
- /** Refresh public state and reconcile its history page by message ID. */
374
+ /** Live navigation for the addressed requester; clients reauthorize the resource before opening it. */
269
375
  {
376
+ type: 'resource_open';
377
+ request: ChatGroupResourceOpenRequest;
378
+ }
379
+ /** Refresh public state and reconcile its history page by message ID. */
380
+ | {
270
381
  type: 'snapshot';
271
382
  snapshot: ChatGroupSnapshot;
272
383
  }
@@ -327,9 +438,11 @@ export interface ChatGroupProjectInput {
327
438
  mode: 'create';
328
439
  id: string;
329
440
  name: string;
441
+ projectType?: XpertProjectTypeRef;
330
442
  } | {
331
443
  mode: 'existing';
332
444
  projectId: string;
445
+ reuse?: true;
333
446
  };
334
447
  /** Include the primary Assistant. Updates add participants and preserve existing bindings. */
335
448
  participantIds: string[];
@@ -323,6 +323,7 @@ export declare const trailGraphSchema: z.ZodObject<{
323
323
  toolCallId?: string;
324
324
  }[];
325
325
  threadId?: string;
326
+ coverage?: ("historical" | "record_limit" | "missing_identity" | "no_execution" | "timing_unavailable" | "activity_unavailable")[];
326
327
  messageId?: string;
327
328
  lanes?: {
328
329
  status?: "idle" | "error" | "unknown" | "success" | "interrupted" | "running" | "pending" | "waiting" | "cancelling";
@@ -343,7 +344,6 @@ export declare const trailGraphSchema: z.ZodObject<{
343
344
  spawnStepId?: string;
344
345
  elapsedMs?: number;
345
346
  }[];
346
- coverage?: ("historical" | "record_limit" | "missing_identity" | "no_execution" | "timing_unavailable" | "activity_unavailable")[];
347
347
  layer?: "execution" | "conversation";
348
348
  episodes?: {
349
349
  id?: string;
@@ -381,6 +381,7 @@ export declare const trailGraphSchema: z.ZodObject<{
381
381
  toolCallId?: string;
382
382
  }[];
383
383
  threadId?: string;
384
+ coverage?: ("historical" | "record_limit" | "missing_identity" | "no_execution" | "timing_unavailable" | "activity_unavailable")[];
384
385
  messageId?: string;
385
386
  lanes?: {
386
387
  status?: "idle" | "error" | "unknown" | "success" | "interrupted" | "running" | "pending" | "waiting" | "cancelling";
@@ -401,7 +402,6 @@ export declare const trailGraphSchema: z.ZodObject<{
401
402
  spawnStepId?: string;
402
403
  elapsedMs?: number;
403
404
  }[];
404
- coverage?: ("historical" | "record_limit" | "missing_identity" | "no_execution" | "timing_unavailable" | "activity_unavailable")[];
405
405
  layer?: "execution" | "conversation";
406
406
  episodes?: {
407
407
  id?: string;
@@ -8,33 +8,45 @@ export interface EvolutionBaselinePreview {
8
8
  ready: boolean;
9
9
  issues: string[];
10
10
  }
11
+ /** Compares published source rules with the scoped active version. A managed release cannot be overwritten as a baseline. */
11
12
  export interface EvolutionBaselineInspection {
12
13
  targetId: string;
13
14
  canManage: boolean;
14
15
  status: 'missing' | 'current' | 'update_available' | 'blocked' | 'managed_release';
15
16
  preview: EvolutionBaselinePreview;
17
+ /** Existing pointer and version, or null if no baseline is active; contentJson may be unavailable independently. */
16
18
  current: {
17
19
  pointer: ActiveCapabilityPointer;
18
20
  version: CapabilityVersion;
19
21
  contentJson: string | null;
20
22
  } | null;
21
23
  }
24
+ /** Tenant, organization and target of the baseline operation; identifiers alone do not grant access. */
22
25
  export interface EvolutionBaselineIdentity {
23
26
  tenantId: string;
24
27
  organizationId: string;
25
28
  targetId: string;
26
29
  }
30
+ /** Conditional baseline publication bound to the reviewed source and the observed pointer revision. */
27
31
  export interface EvolutionBaselinePublishRequest extends EvolutionBaselineIdentity {
28
32
  mode: 'initialize' | 'update';
33
+ /** Pointer revision at inspection; zero denotes an absent pointer for initialization. */
29
34
  expectedRevision: number;
35
+ /** Content hash of the reviewed source preview, distinct from the pointer revision. */
30
36
  expectedHash: string;
31
37
  reason: string;
32
38
  }
39
+ /** Plugin-facing contract for inspecting and conditionally publishing a scoped baseline. */
33
40
  export interface EvolutionBaselineRuntimeApi {
41
+ /** Returns source readiness and current version information without changing the pointer. */
34
42
  inspect(input: EvolutionBaselineIdentity): Promise<EvolutionBaselineInspection>;
43
+ /** Publishes the reviewed baseline under the requested preconditions; must preserve a release-managed pointer. */
35
44
  publish(input: EvolutionBaselinePublishRequest): Promise<ActiveCapabilityPointer>;
36
45
  }
46
+ /** Provider-defined read access to source rules and to a particular baseline artifact. */
37
47
  export interface EvolutionBaselineReader {
48
+ /** Describes the current source content and whether it is ready to export. */
38
49
  previewBaseline(request: ExportEvolutionBaselineRequest): Promise<EvolutionBaselinePreview>;
50
+ /** Returns the JSON content of the specified artifact, independent of changes to current source rules. */
39
51
  readBaseline(request: ExportEvolutionBaselineRequest, artifact: EvolutionArtifactRef): Promise<string>;
40
52
  }
@@ -1,5 +1,7 @@
1
1
  import { EvolutionArtifactRef, EvolutionProviderContext, EvolutionScope } from './target';
2
+ /** Governance state of a candidate artifact; approval or packaging alone does not make it effective. */
2
3
  export type EvolutionCandidateStatus = 'building' | 'ready' | 'evaluating' | 'evaluation_failed' | 'pending_approval' | 'approved' | 'rejected' | 'packaged' | 'expired';
4
+ /** Artifact proposed for one target, bound to its baseline, proposal revision and strategy. */
3
5
  export interface EvolutionCandidate {
4
6
  definition?: Omit<import('./change').EvolutionChangeCandidate, 'artifact'>;
5
7
  evaluationRunId?: string;
@@ -14,11 +16,13 @@ export interface EvolutionCandidate {
14
16
  providerVersion: string;
15
17
  dependencyVersionIds: string[];
16
18
  targetScope: EvolutionScope;
19
+ /** Fingerprint of build inputs, distinct from the content hash of the resulting artifact. */
17
20
  buildInputsHash: string;
18
21
  status: EvolutionCandidateStatus;
19
22
  createdBy: string;
20
23
  createdAt: string;
21
24
  }
25
+ /** Inputs to a target-owned build. Evidence and dependencies belong to the specified proposal revision and scope. */
22
26
  export interface BuildEvolutionCandidateRequest {
23
27
  context?: EvolutionProviderContext;
24
28
  targetId: string;
@@ -26,15 +30,26 @@ export interface BuildEvolutionCandidateRequest {
26
30
  proposalId: string;
27
31
  proposalRevision: number;
28
32
  baseVersionId: string;
33
+ /** Artifact of baseVersionId when supplied; it must not be replaced by the currently active version. */
29
34
  baseArtifact?: EvolutionArtifactRef;
35
+ /** Target-defined changes to apply to the baseline, not an already-built artifact. */
30
36
  changeSet: Record<string, string | number | boolean | string[]>;
37
+ /** Evidence selection fixed by the proposal; independent of the order of supplied event records. */
31
38
  evidenceEventIds: string[];
39
+ /**
40
+ * Scoped records for the selected IDs, matched by eventId rather than position.
41
+ * If records are absent, the IDs still identify the proposal's evidence.
42
+ */
43
+ evidenceEvents?: import('./learning-event').LearningEvent[];
32
44
  dependencyVersionIds: string[];
33
45
  actorId: string;
46
+ /** Identifies the same build operation across retries. */
34
47
  idempotencyKey: string;
35
48
  }
49
+ /** Provider-produced artifact and build provenance, prior to replay or approval. */
36
50
  export interface CandidateBuildResult {
37
51
  artifact: EvolutionArtifactRef;
52
+ /** Provider-defined summary of the effective build inputs. */
38
53
  normalizedManifest: Record<string, string | number | boolean | string[]>;
39
54
  dependencyVersionIds: string[];
40
55
  validationSummary: string;
@@ -42,6 +57,7 @@ export interface CandidateBuildResult {
42
57
  providerTraceId: string;
43
58
  buildInputsHash: string;
44
59
  }
60
+ /** Asks whether a specific artifact is valid for the proposed target and baseline. */
45
61
  export interface ValidateEvolutionCandidateRequest {
46
62
  context?: EvolutionProviderContext;
47
63
  targetId: string;
@@ -51,18 +67,22 @@ export interface ValidateEvolutionCandidateRequest {
51
67
  baseArtifact?: EvolutionArtifactRef;
52
68
  dependencyVersionIds: string[];
53
69
  }
70
+ /** Identifies the target and scope whose baseline the provider is asked to export. */
54
71
  export interface ExportEvolutionBaselineRequest {
55
72
  context: EvolutionProviderContext;
56
73
  targetId: string;
57
74
  scope: EvolutionScope;
75
+ /** Specific baseline version requested, if the request identifies one. */
58
76
  requestedVersionId?: string;
59
77
  }
78
+ /** Baseline artifact together with its provider-supplied version label and pinned dependencies. */
60
79
  export interface ExportEvolutionBaselineResult {
61
80
  artifact: EvolutionArtifactRef;
62
81
  dependencyVersionIds: string[];
63
82
  semanticVersion: string;
64
83
  providerTraceId: string;
65
84
  }
85
+ /** Structural validation outcome. Warnings can accompany a valid artifact; validity does not imply a passing replay. */
66
86
  export interface CandidateValidationResult {
67
87
  valid: boolean;
68
88
  failureCodes: string[];
@@ -1,43 +1,55 @@
1
1
  import { EvolutionArtifactRef, EvolutionChannel, EvolutionExecutionMode, EvolutionScope } from './target';
2
+ /** Immutable version of a target and its dependencies. Creating a version does not make it active. */
2
3
  export interface CapabilityVersion {
3
4
  versionId: string;
4
5
  targetId: string;
6
+ /** Version sequence for the target; unrelated to a channel pointer's revision. */
5
7
  sequence: number;
6
8
  semanticVersion: string;
7
9
  artifact: EvolutionArtifactRef;
8
10
  providerKey: string;
9
11
  providerVersion: string;
12
+ /** Concrete versions on which this version depends. */
10
13
  dependencyVersionIds: string[];
14
+ /** Candidate from which this version was promoted, if it originated from one. */
11
15
  sourceCandidateId?: string;
12
16
  createdAt: string;
13
17
  createdBy: string;
14
18
  }
19
+ /** Pins one target's version and artifact identity for an execution or replay. */
15
20
  export interface CapabilityVersionBundleItem {
16
21
  targetId: string;
17
22
  versionId: string;
23
+ /** Expected hash of the artifact for this binding. A different payload does not satisfy the assignment. */
18
24
  artifactHash: string;
19
25
  providerKey: string;
20
26
  providerVersion: string;
21
27
  }
28
+ /** Immutable set of version bindings. It identifies the artifacts used, without embedding their contents. */
22
29
  export interface CapabilityVersionBundle {
23
30
  bundleId: string;
31
+ /** Digest of the version bindings, distinct from the hash of any individual artifact. */
24
32
  bundleHash: string;
25
33
  executionMode: EvolutionExecutionMode;
26
34
  items: CapabilityVersionBundleItem[];
27
35
  createdAt: string;
28
36
  }
37
+ /** Mutable selection of an immutable version for one target, scope and release channel. */
29
38
  export interface ActiveCapabilityPointer {
30
39
  pointerId: string;
31
40
  targetId: string;
32
41
  scope: EvolutionScope;
33
42
  channel: EvolutionChannel;
34
43
  activeVersionId: string;
44
+ /** Previously selected version retained as the rollback destination, when available. */
35
45
  rollbackVersionId?: string;
36
46
  releasePackageId?: string;
47
+ /** Revision of the selection for concurrency checks; distinct from the version sequence. */
37
48
  revision: number;
38
49
  updatedAt: string;
39
50
  updatedBy: string;
40
51
  }
52
+ /** Selects the targets, scope and execution mode for a version bundle. */
41
53
  export interface ResolveCapabilityBundleRequest {
42
54
  scope: EvolutionScope;
43
55
  executionMode: EvolutionExecutionMode;
@@ -2,11 +2,13 @@ import type { I18nText } from '../../i18n.model';
2
2
  import type { ApprovalDecision } from './release';
3
3
  import type { EvolutionArtifactRef, EvolutionProviderContext, EvolutionScope } from './target';
4
4
  import type { EvolutionInputKind, EvolutionStrategySnapshot, EvolutionStageRecord } from './strategy';
5
+ /** Provider-owned resource version and content hash; a resource ID alone does not identify reviewed content. */
5
6
  export interface EvolutionVersionRef {
6
7
  resourceId: string;
7
8
  version: string;
8
9
  hash: string;
9
10
  }
11
+ /** Versioned evidence supporting a change, with an optional locator for the cited part. */
10
12
  export interface EvolutionEvidenceRef {
11
13
  kind: 'document' | 'execution' | 'feedback' | 'evaluation' | 'artifact';
12
14
  subjectKey: string;
@@ -19,6 +21,7 @@ export interface EvolutionEvidenceRef {
19
21
  quoteHash?: string;
20
22
  };
21
23
  }
24
+ /** One provider-defined change to a resource; path and operation follow the target's own vocabulary. */
22
25
  export interface EvolutionChangeDelta {
23
26
  path: string;
24
27
  operation: string;
@@ -26,6 +29,7 @@ export interface EvolutionChangeDelta {
26
29
  before?: string;
27
30
  after: string;
28
31
  }
32
+ /** Reviewable artifact and proposed differences relative to the identified baseline. */
29
33
  export interface EvolutionChangeCandidate {
30
34
  artifact: EvolutionArtifactRef;
31
35
  baseline: EvolutionVersionRef;
@@ -33,6 +37,7 @@ export interface EvolutionChangeCandidate {
33
37
  warnings: string[];
34
38
  summary: string;
35
39
  }
40
+ /** One evaluation judgment with a declared origin; a failed blocking check prevents the evaluation from passing. */
36
41
  export interface EvolutionCheck {
37
42
  checkId: string;
38
43
  title: string;
@@ -43,12 +48,14 @@ export interface EvolutionCheck {
43
48
  details: string;
44
49
  evidenceRefs: string[];
45
50
  }
51
+ /** Assessment of a named readiness condition; unknown is distinct from a confirmed failure. */
46
52
  export interface EvolutionReadiness {
47
53
  key: string;
48
54
  label: I18nText;
49
55
  status: 'passed' | 'blocked' | 'unknown';
50
56
  reasons: string[];
51
57
  }
58
+ /** Assessment bound to the specific candidate, baseline and evidence that were evaluated. */
52
59
  export interface EvolutionChangeEvaluation {
53
60
  runId: string;
54
61
  candidateHash: string;
@@ -61,13 +68,16 @@ export interface EvolutionChangeEvaluation {
61
68
  passed: boolean;
62
69
  completedAt: string;
63
70
  strategyHash?: string;
71
+ /** Distinguishes completed testing from a strategy with no applicable tests. */
64
72
  assessment?: 'tested' | 'not_applicable';
73
+ /** Individual strategy-step runs contributing to this assessment, when recorded. */
65
74
  evaluationRuns?: Array<{
66
75
  key: string;
67
76
  kind: string;
68
77
  runId: string;
69
78
  }>;
70
79
  }
80
+ /** Binds a published resource version to the candidate content and approval that authorized it. */
71
81
  export interface EvolutionPublicationReceipt {
72
82
  receiptId: string;
73
83
  changeId: string;
@@ -76,12 +86,14 @@ export interface EvolutionPublicationReceipt {
76
86
  resource: EvolutionVersionRef;
77
87
  completedAt: string;
78
88
  }
89
+ /** Provider-defined destination for a particular business resource in an Assistant's Workbench. */
79
90
  export interface EvolutionWorkbenchLink {
80
91
  xpertId: string;
81
92
  viewKey: string;
82
93
  selectionId: string;
83
94
  parameters: Record<string, string>;
84
95
  }
96
+ /** Provider-defined metric; null represents an unavailable value rather than zero. */
85
97
  export interface EvolutionPresentationMetric {
86
98
  kind?: 'adoption';
87
99
  key: string;
@@ -89,7 +101,7 @@ export interface EvolutionPresentationMetric {
89
101
  value: string | number | null;
90
102
  total?: number;
91
103
  }
92
- /** Provider-owned business explanations; never parsed from titles or candidate JSON by the UI. */
104
+ /** Provider-owned explanation of the business rationale, evidence and changes; display text has no governance semantics. */
93
105
  export interface EvolutionChangeBusinessDetails {
94
106
  title: I18nText;
95
107
  baselineLabel?: I18nText;
@@ -124,6 +136,7 @@ export interface EvolutionChangeBusinessDetails {
124
136
  total: number;
125
137
  };
126
138
  }
139
+ /** Domain description of a change and its observed effect, separate from its approval and publication state. */
127
140
  export interface EvolutionChangePresentation {
128
141
  title: string;
129
142
  resourceLabel: string;
@@ -139,13 +152,16 @@ export interface EvolutionChangePresentation {
139
152
  workbench?: EvolutionWorkbenchLink;
140
153
  historyWorkbench?: EvolutionWorkbenchLink;
141
154
  }
155
+ /** Governance state of a change; publication alone does not imply adoption by every subject. */
142
156
  export type EvolutionChangeStatus = 'preparing' | 'testing' | 'test_failed' | 'pending_approval' | 'approved' | 'publishing' | 'published' | 'rejected' | 'stale' | 'failed';
157
+ /** Scoped record of a proposed change, binding its strategy, baseline, evidence and subsequent decisions. */
143
158
  export interface EvolutionChange {
144
159
  contractVersion: 3;
145
160
  strategy: EvolutionStrategySnapshot;
146
161
  sourceKind: EvolutionInputKind;
147
162
  learningEventIds: string[];
148
163
  candidateInput: Record<string, string | number | boolean | string[]>;
164
+ /** Frozen dataset IDs keyed by evaluation step key, not by target or candidate ID. */
149
165
  datasetSnapshotIds: Record<string, string>;
150
166
  stages: EvolutionStageRecord[];
151
167
  changeId: string;
@@ -167,10 +183,11 @@ export interface EvolutionChange {
167
183
  failureReasons?: string[];
168
184
  presentation?: EvolutionChangePresentation;
169
185
  presentationUnavailable?: boolean;
170
- /** Optional execution transcript in the initiating assistant's ChatKit. */
186
+ /** Optional context linking this change to the initiating Assistant's execution history. */
171
187
  executionContext?: EvolutionExecutionContext;
172
188
  executionConversation?: EvolutionExecutionConversation;
173
189
  }
190
+ /** Context of the initiating Assistant for recording change activity in its execution history. */
174
191
  export interface EvolutionExecutionContext {
175
192
  xpertId: string;
176
193
  projectId?: string;
@@ -178,53 +195,72 @@ export interface EvolutionExecutionContext {
178
195
  input: string;
179
196
  language?: string;
180
197
  }
198
+ /** Conversation, thread and execution references for the change's execution history. */
181
199
  export interface EvolutionExecutionConversation {
182
200
  conversationId: string;
183
201
  threadId: string;
184
202
  executionId: string;
185
203
  }
204
+ /** Trusted provider context and the specific change under consideration. */
186
205
  export interface EvolutionChangeOperation {
187
206
  context: EvolutionProviderContext;
188
207
  change: EvolutionChange;
208
+ /** Strategy step under assessment, when the operation is step-specific. */
189
209
  evaluationStep?: import('./strategy').EvolutionEvaluationStep;
190
210
  }
211
+ /** Target-owned responsibilities for drafting, checking and publishing domain resource versions. */
191
212
  export interface EvolutionChangeProvider {
213
+ /** Provides domain presentation and effect information without changing the governance decision. */
192
214
  describe?(operation: EvolutionChangeOperation): Promise<EvolutionChangePresentation>;
215
+ /** Produces an artifact and reviewable differences against the specified baseline. */
193
216
  prepare(operation: EvolutionChangeOperation): Promise<EvolutionChangeCandidate>;
217
+ /** Returns checks bound to the candidate, baseline and evidence under assessment. */
194
218
  evaluate(operation: EvolutionChangeOperation): Promise<EvolutionChangeEvaluation>;
219
+ /** Reports whether the change's reviewed inputs are still current for the target. */
195
220
  validateCurrent(operation: EvolutionChangeOperation): Promise<{
196
221
  valid: boolean;
197
222
  reasons: string[];
198
223
  }>;
224
+ /** Enforces target-specific authority to publish; approval alone does not grant that authority. */
199
225
  authorizePublication(operation: EvolutionChangeOperation): Promise<void>;
226
+ /** Publishes the approved resource version and returns evidence identifying what was written. */
200
227
  publish(operation: EvolutionChangeOperation): Promise<EvolutionPublicationReceipt>;
201
228
  }
229
+ /** Tenant and organization that bound a change operation; their IDs do not grant access. */
202
230
  export interface EvolutionChangeIdentity {
203
231
  tenantId: string;
204
232
  organizationId: string;
205
233
  }
234
+ /** Requests a scoped change under an explicit strategy, baseline and set of evidence references. */
206
235
  export interface SubmitEvolutionChange extends EvolutionChangeIdentity {
207
236
  executionContext?: EvolutionExecutionContext;
208
237
  strategyId: string;
209
238
  sourceKind: EvolutionInputKind;
210
239
  learningEventIds?: string[];
211
240
  candidateInput?: Record<string, string | number | boolean | string[]>;
241
+ /** Optional frozen dataset bindings keyed by evaluation step key. */
212
242
  datasetSnapshotIds?: Record<string, string>;
213
243
  targetId: string;
244
+ /** Caller-supplied identity of the logical submission across retries. */
214
245
  requestId: string;
215
246
  scope: EvolutionScope;
216
247
  baseline: EvolutionVersionRef;
217
248
  evidence: EvolutionEvidenceRef[];
218
249
  }
250
+ /** Plugin-facing contract for scoped change preparation, review and publication. */
219
251
  export interface EvolutionChangeRuntimeApi {
252
+ /** Submits a change for preparation; acceptance does not imply the candidate is ready. */
220
253
  prepare(input: SubmitEvolutionChange): Promise<EvolutionChange>;
254
+ /** Returns the identified change within the supplied identity. */
221
255
  get(input: EvolutionChangeIdentity & {
222
256
  changeId: string;
223
257
  }): Promise<EvolutionChange>;
258
+ /** Returns scoped changes matching the supplied target or request filters. */
224
259
  list(input: EvolutionChangeIdentity & {
225
260
  targetId?: string;
226
261
  requestId?: string;
227
262
  }): Promise<EvolutionChange[]>;
263
+ /** Binds the human decision to the supplied candidate hash and evaluation run. */
228
264
  decide(input: EvolutionChangeIdentity & {
229
265
  changeId: string;
230
266
  candidateHash: string;
@@ -232,6 +268,7 @@ export interface EvolutionChangeRuntimeApi {
232
268
  decision: 'approved' | 'rejected';
233
269
  reason: string;
234
270
  }): Promise<EvolutionChange>;
271
+ /** Requests publication under the strategy's publication and effect policy. */
235
272
  publish(input: EvolutionChangeIdentity & {
236
273
  changeId: string;
237
274
  }): Promise<EvolutionChange>;
@@ -251,6 +288,7 @@ export interface EvolutionLifecycleRecord {
251
288
  sourceKind: EvolutionInputKind;
252
289
  releasePackageId?: string;
253
290
  publicationStatus: 'preparing' | 'review' | 'publishing' | 'published' | 'closed' | 'blocked';
291
+ /** Actual effect or adoption, independent of whether publication is complete. */
254
292
  effectStatus: 'pending' | 'partial' | 'active' | 'unknown';
255
293
  baseline: EvolutionVersionRef;
256
294
  candidate?: EvolutionChangeCandidate;