@xpert-ai/contracts 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.
Files changed (106) hide show
  1. package/context-event.cjs.default.js +1 -0
  2. package/context-event.cjs.js +26 -0
  3. package/context-event.cjs.mjs +2 -0
  4. package/context-event.d.ts +1 -0
  5. package/context-event.esm.js +24 -0
  6. package/index.cjs.default.js +1 -0
  7. package/index.cjs.js +670 -319
  8. package/index.cjs.mjs +2 -0
  9. package/index.esm.js +637 -318
  10. package/package.json +18 -2
  11. package/src/agent-event.model.d.ts +88 -0
  12. package/src/agent-event.schema.d.ts +120 -0
  13. package/src/agent-plugin.d.ts +4 -29
  14. package/src/ai/agent-output-delivery.model.d.ts +22 -1
  15. package/src/ai/agent-runtime.model.d.ts +4 -4
  16. package/src/ai/assistant-capability.model.d.ts +0 -1
  17. package/src/ai/assistant-template-manifest.model.d.ts +316 -352
  18. package/src/ai/assistant-template-overview.model.d.ts +0 -4
  19. package/src/ai/assistant-template-setup.model.d.ts +8 -8
  20. package/src/ai/assistant-template.model.d.ts +0 -4
  21. package/src/ai/bosi.model.d.ts +1 -1
  22. package/src/ai/chat-activity.model.d.ts +8 -0
  23. package/src/ai/chat-message.model.d.ts +0 -11
  24. package/src/ai/chat.model.d.ts +1 -0
  25. package/src/ai/cli-execution.model.d.ts +88 -0
  26. package/src/ai/conversation-trail.model.d.ts +274 -274
  27. package/src/ai/copilot-store.model.d.ts +0 -13
  28. package/src/ai/evolution/entities.d.ts +164 -0
  29. package/src/ai/evolution/evaluation.d.ts +7 -0
  30. package/src/ai/evolution/execution-review.d.ts +68 -0
  31. package/src/ai/evolution/index.d.ts +2 -0
  32. package/src/ai/evolution/provider.d.ts +1 -0
  33. package/src/ai/evolution/target.d.ts +5 -0
  34. package/src/ai/execution-activity.model.d.ts +362 -362
  35. package/src/ai/execution-control-evidence.schema.d.ts +22 -22
  36. package/src/ai/execution-observability.model.d.ts +196 -196
  37. package/src/ai/execution-source.model.d.ts +45 -0
  38. package/src/ai/index.d.ts +4 -0
  39. package/src/ai/mcp-execution-control.schema.d.ts +2 -2
  40. package/src/ai/middleware.model.d.ts +1 -0
  41. package/src/ai/model-execution.model.d.ts +7 -108
  42. package/src/ai/model-replacement.model.d.ts +18 -18
  43. package/src/ai/project-configuration-view.model.d.ts +78 -0
  44. package/src/ai/project-pipeline/analytics.d.ts +192 -192
  45. package/src/ai/project-pipeline/budget.schema.d.ts +38 -0
  46. package/src/ai/project-pipeline/commands.schema.d.ts +543 -500
  47. package/src/ai/project-pipeline/configuration-form.d.ts +1980 -1836
  48. package/src/ai/project-pipeline/configuration.schema.d.ts +450 -413
  49. package/src/ai/project-pipeline/contribution.schema.d.ts +688 -639
  50. package/src/ai/project-pipeline/definition.schema.d.ts +400 -356
  51. package/src/ai/project-pipeline/execution-statistics.d.ts +18 -18
  52. package/src/ai/project-pipeline/graph.model.d.ts +5 -0
  53. package/src/ai/project-pipeline/human-wait-statistics.d.ts +2 -2
  54. package/src/ai/project-pipeline/index.d.ts +1 -0
  55. package/src/ai/project-pipeline/model-usage-statistics.d.ts +6 -6
  56. package/src/ai/project-pipeline/node.schema.d.ts +57 -44
  57. package/src/ai/project-pipeline/operation.schema.d.ts +338 -338
  58. package/src/ai/project-pipeline/plugin-deployment.schema.d.ts +152 -0
  59. package/src/ai/project-pipeline/portfolio.schema.d.ts +468 -468
  60. package/src/ai/project-pipeline/primitives.schema.d.ts +6 -6
  61. package/src/ai/project-pipeline/projection.schema.d.ts +609 -572
  62. package/src/ai/project-pipeline/provider-actions.schema.d.ts +112 -112
  63. package/src/ai/project-pipeline/queue-statistics.d.ts +10 -10
  64. package/src/ai/project-pipeline/runtime.schema.d.ts +62 -62
  65. package/src/ai/project-pipeline/statistics.d.ts +100 -100
  66. package/src/ai/project-task-runtime.model.d.ts +969 -242
  67. package/src/ai/project-type-configuration.model.d.ts +48 -0
  68. package/src/ai/sandbox-execution-control.schema.d.ts +6 -6
  69. package/src/ai/template-installation.model.d.ts +18 -18
  70. package/src/ai/template-lifecycle.model.d.ts +6 -6
  71. package/src/ai/thread-control-view.schema.d.ts +4 -4
  72. package/src/ai/xpert-agent-execution.model.d.ts +4 -0
  73. package/src/ai/xpert-project-type.model.d.ts +3 -0
  74. package/src/ai/xpert-project.model.d.ts +4 -1
  75. package/src/ai/xpert-task.model.d.ts +16 -0
  76. package/src/ai/xpert.model.d.ts +0 -34
  77. package/src/ai/xpert.utils.d.ts +0 -1
  78. package/src/analytics/analysis-evidence.model.d.ts +29 -0
  79. package/src/analytics/analytics-certification.model.d.ts +17 -0
  80. package/src/{analytics-definition.model.d.ts → analytics/analytics-definition.model.d.ts} +1 -1
  81. package/src/{analytics-diagnostic.d.ts → analytics/analytics-diagnostic.d.ts} +8 -8
  82. package/src/{analytics-query.model.d.ts → analytics/analytics-query.model.d.ts} +9 -1
  83. package/src/analytics/index.d.ts +7 -0
  84. package/src/{resource-analysis.model.d.ts → analytics/resource-analysis.model.d.ts} +6 -1
  85. package/src/app-platform.d.ts +16 -16
  86. package/src/{artifact-group-reference.model.d.ts → artifacts/artifact-group-reference.model.d.ts} +1 -1
  87. package/src/{artifact-presentation.model.d.ts → artifacts/artifact-presentation.model.d.ts} +1 -1
  88. package/src/{artifact-use-grant-command.d.ts → artifacts/artifact-use-grant-command.d.ts} +1 -1
  89. package/src/{artifact-use-grant.model.d.ts → artifacts/artifact-use-grant.model.d.ts} +2 -2
  90. package/src/{artifact.model.d.ts → artifacts/artifact.model.d.ts} +2 -2
  91. package/src/artifacts/index.d.ts +5 -0
  92. package/src/collaboration.model.d.ts +31 -11
  93. package/src/{content-document.model.d.ts → content/content-document.model.d.ts} +2 -0
  94. package/src/{content-resource.model.d.ts → content/content-resource.model.d.ts} +6 -3
  95. package/src/content/content-transfer.model.d.ts +21 -0
  96. package/src/content/index.d.ts +4 -0
  97. package/src/execution-control-admission.schema.d.ts +2 -2
  98. package/src/index.d.ts +5 -14
  99. package/src/plugin-management.d.ts +13 -0
  100. package/src/plugin.d.ts +2 -0
  101. package/src/user-notification.schema.d.ts +75 -28
  102. package/src/view-extension/client-commands.d.ts +24 -0
  103. package/src/view-extension/context-event.d.ts +66 -0
  104. package/src/view-extension/index.d.ts +1 -0
  105. /package/src/{analytics-source.model.d.ts → analytics/analytics-source.model.d.ts} +0 -0
  106. /package/src/{content-reference.model.d.ts → content/content-reference.model.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/contracts",
3
- "version": "3.34.0",
3
+ "version": "3.36.0",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,6 +9,22 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/xpert-ai/xpert/issues"
11
11
  },
12
+ "exports": {
13
+ ".": {
14
+ "module": "./index.esm.js",
15
+ "types": "./index.d.ts",
16
+ "import": "./index.cjs.mjs",
17
+ "default": "./index.cjs.js"
18
+ },
19
+ "./context-event": {
20
+ "module": "./context-event.esm.js",
21
+ "types": "./context-event.d.ts",
22
+ "import": "./context-event.cjs.mjs",
23
+ "default": "./context-event.cjs.js"
24
+ },
25
+ "./package.json": "./package.json",
26
+ "./*": "./*"
27
+ },
12
28
  "publishConfig": {
13
29
  "access": "public",
14
30
  "directory": "dist"
@@ -21,7 +37,7 @@
21
37
  "dependencies": {
22
38
  "@octokit/types": "13.10.0",
23
39
  "@types/json-schema": "^7.0.15",
24
- "@xpert-ai/chatkit-types": "~0.20.3",
40
+ "@xpert-ai/chatkit-types": "~0.22.0",
25
41
  "zod-to-json-schema": "^3.25.2"
26
42
  },
27
43
  "peerDependencies": {
@@ -0,0 +1,88 @@
1
+ import type { EventDecision, PluginAgentEvent } from './agent-event.schema';
2
+ import type { I18nObject, IconDefinition } from './types';
3
+ import type { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
4
+ export * from './agent-event.schema';
5
+ export interface IAgentEventBinding extends IBasePerTenantAndOrganizationEntityModel {
6
+ id: string;
7
+ tenantId: string;
8
+ organizationId: string;
9
+ workspaceId: string;
10
+ projectId: string | null;
11
+ xpertId: string;
12
+ userId: string;
13
+ plugin: string;
14
+ adapter: string;
15
+ sourceBindingRef: string;
16
+ publishedAt: Date;
17
+ revision: number;
18
+ state: 'configuring' | 'enabled' | 'paused' | 'revoked';
19
+ nextScan: Date;
20
+ capture: boolean;
21
+ lastScanAt: Date | null;
22
+ lastError: string | null;
23
+ }
24
+ export interface IAgentEventPartition extends IBasePerTenantAndOrganizationEntityModel {
25
+ id: string;
26
+ tenantId: string;
27
+ organizationId: string;
28
+ binding: string;
29
+ kind: string;
30
+ subject: string;
31
+ owner: string | null;
32
+ fence: string;
33
+ expires: Date | null;
34
+ }
35
+ export interface IAgentEventInbox extends IBasePerTenantAndOrganizationEntityModel {
36
+ id: string;
37
+ tenantId: string;
38
+ organizationId: string;
39
+ binding: string;
40
+ partition: string;
41
+ sourceEventId: string;
42
+ event: PluginAgentEvent;
43
+ fingerprint: string;
44
+ seq: string;
45
+ state: 'pending' | 'processing' | 'retry_wait' | 'isolated' | EventDecision['status'];
46
+ attempt: number;
47
+ due: Date;
48
+ receivedAt: Date;
49
+ conflictCount: number;
50
+ decision: EventDecision | null;
51
+ error: string | null;
52
+ }
53
+ export interface AgentEventTypeDisplay {
54
+ label: I18nObject;
55
+ icon: IconDefinition;
56
+ category: {
57
+ key: string;
58
+ label: I18nObject;
59
+ icon: IconDefinition;
60
+ };
61
+ }
62
+ export interface AgentEventTypeDefinition {
63
+ type: string;
64
+ schemaVersion: number;
65
+ display?: AgentEventTypeDisplay;
66
+ }
67
+ /** Optional domain projection. Sources recheck resource access in the bound actor scope. */
68
+ export interface AgentEventPresentation {
69
+ /** Explicit provenance in the source domain. The host authorizes it for the viewing principal. */
70
+ conversation?: {
71
+ conversationId: string;
72
+ };
73
+ title: string;
74
+ fields?: {
75
+ label: I18nObject;
76
+ value: string;
77
+ }[];
78
+ result?: {
79
+ action: I18nObject;
80
+ fields: {
81
+ label: I18nObject;
82
+ value: string;
83
+ }[];
84
+ };
85
+ }
86
+ export declare const EVENT_INBOX_FEATURE = "platform.event-inbox";
87
+ export declare const USER_EVENT_INBOX_SLOT = "user.event-inbox";
88
+ export declare const EVENT_INBOX_VIEW_KEY = "platform.event-inbox__inbox";
@@ -0,0 +1,120 @@
1
+ import { z } from 'zod/v3';
2
+ export declare const agentEventRefSchema: z.ZodObject<{
3
+ kind: z.ZodEffects<z.ZodString, string, string>;
4
+ key: z.ZodEffects<z.ZodString, string, string>;
5
+ }, "strict", z.ZodTypeAny, {
6
+ kind: string;
7
+ key: string;
8
+ }, {
9
+ kind: string;
10
+ key: string;
11
+ }>;
12
+ export declare const pluginAgentEventSchema: z.ZodObject<{
13
+ sourceEventId: z.ZodEffects<z.ZodString, string, string>;
14
+ bindingRevision: z.ZodNumber;
15
+ type: z.ZodEffects<z.ZodString, string, string>;
16
+ schemaVersion: z.ZodNumber;
17
+ occurredAt: z.ZodString;
18
+ subject: z.ZodObject<{
19
+ kind: z.ZodEffects<z.ZodString, string, string>;
20
+ key: z.ZodEffects<z.ZodString, string, string>;
21
+ }, "strict", z.ZodTypeAny, {
22
+ kind: string;
23
+ key: string;
24
+ }, {
25
+ kind: string;
26
+ key: string;
27
+ }>;
28
+ fact: z.ZodObject<{
29
+ key: z.ZodEffects<z.ZodString, string, string>;
30
+ revision: z.ZodEffects<z.ZodString, string, string>;
31
+ sha256: z.ZodString;
32
+ }, "strict", z.ZodTypeAny, {
33
+ key: string;
34
+ revision: string;
35
+ sha256: string;
36
+ }, {
37
+ key: string;
38
+ revision: string;
39
+ sha256: string;
40
+ }>;
41
+ }, "strict", z.ZodTypeAny, {
42
+ type: string;
43
+ sourceEventId: string;
44
+ bindingRevision: number;
45
+ schemaVersion: number;
46
+ occurredAt: string;
47
+ subject: {
48
+ kind: string;
49
+ key: string;
50
+ };
51
+ fact: {
52
+ key: string;
53
+ revision: string;
54
+ sha256: string;
55
+ };
56
+ }, {
57
+ type: string;
58
+ sourceEventId: string;
59
+ bindingRevision: number;
60
+ schemaVersion: number;
61
+ occurredAt: string;
62
+ subject: {
63
+ kind: string;
64
+ key: string;
65
+ };
66
+ fact: {
67
+ key: string;
68
+ revision: string;
69
+ sha256: string;
70
+ };
71
+ }>;
72
+ export type AgentEventRef = z.infer<typeof agentEventRefSchema>;
73
+ export type PluginAgentEvent = z.infer<typeof pluginAgentEventSchema>;
74
+ export declare const agentEventDecisionSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
75
+ status: z.ZodLiteral<"handled">;
76
+ operationKey: z.ZodEffects<z.ZodString, string, string>;
77
+ resultRef: z.ZodObject<{
78
+ kind: z.ZodEffects<z.ZodString, string, string>;
79
+ key: z.ZodEffects<z.ZodString, string, string>;
80
+ }, "strict", z.ZodTypeAny, {
81
+ kind: string;
82
+ key: string;
83
+ }, {
84
+ kind: string;
85
+ key: string;
86
+ }>;
87
+ }, "strict", z.ZodTypeAny, {
88
+ status: "handled";
89
+ operationKey: string;
90
+ resultRef: {
91
+ kind: string;
92
+ key: string;
93
+ };
94
+ }, {
95
+ status: "handled";
96
+ operationKey: string;
97
+ resultRef: {
98
+ kind: string;
99
+ key: string;
100
+ };
101
+ }>, z.ZodObject<{
102
+ status: z.ZodLiteral<"ignored">;
103
+ reasonCode: z.ZodString;
104
+ }, "strict", z.ZodTypeAny, {
105
+ status: "ignored";
106
+ reasonCode: string;
107
+ }, {
108
+ status: "ignored";
109
+ reasonCode: string;
110
+ }>, z.ZodObject<{
111
+ status: z.ZodLiteral<"blocked">;
112
+ reasonCode: z.ZodString;
113
+ }, "strict", z.ZodTypeAny, {
114
+ status: "blocked";
115
+ reasonCode: string;
116
+ }, {
117
+ status: "blocked";
118
+ reasonCode: string;
119
+ }>]>;
120
+ export type EventDecision = z.infer<typeof agentEventDecisionSchema>;
@@ -207,45 +207,20 @@ export interface RuntimeResourceBindingInput {
207
207
  workspaceIds: string[];
208
208
  definition: RuntimeResourceDefinition;
209
209
  }
210
- /** Editor-facing workspace installation catalog. Never includes sources, MCP configuration or credentials. */
211
- export interface WorkspaceAgentPlugin {
210
+ /** Installed package metadata visible in its organization or inherited from its tenant. */
211
+ export interface InstalledAgentPlugin {
212
212
  id: string;
213
213
  name: string;
214
214
  description?: I18nText;
215
215
  icon?: string;
216
216
  version: string;
217
- status: 'available' | 'not_published' | 'disabled';
217
+ scope: 'tenant' | 'organization';
218
+ status: 'available' | 'configuration_required' | 'disabled';
218
219
  components: Array<{
219
220
  kind: 'skill' | 'mcp' | 'middleware' | 'external_xpert' | 'assistant_template';
220
221
  name: string;
221
222
  }>;
222
223
  expertReferences: string[];
223
224
  }
224
- export interface WorkspaceAgentPluginOptions {
225
- workspaces: Array<{
226
- id: string;
227
- name: string;
228
- }>;
229
- experts: Array<{
230
- id: string;
231
- name: string;
232
- }>;
233
- }
234
- /** Add one imported package to one editable workspace without changing other workspaces or conversations. */
235
- export interface WorkspaceAgentPluginAddInput {
236
- packageId: string;
237
- experts: {
238
- [reference: string]: string;
239
- };
240
- }
241
- export interface WorkspaceAgentPluginAddResult {
242
- status: 'added' | 'already_added';
243
- bindingId: string;
244
- }
245
- /** Read-only installation catalog, independent of authoring workspace membership. */
246
- export interface InstalledAgentPlugin extends Omit<WorkspaceAgentPlugin, 'status'> {
247
- scope: 'tenant' | 'organization';
248
- status: 'available' | 'configuration_required' | 'disabled';
249
- }
250
225
  /** Storage faults are distinct from dependency compatibility and installation snapshot changes. */
251
226
  export type AgentPluginStorageErrorCode = 'AGENT_PLUGIN_STORAGE_MISSING' | 'AGENT_PLUGIN_STORAGE_UNREADABLE' | 'AGENT_PLUGIN_STORAGE_CORRUPT';
@@ -2,30 +2,51 @@ import { z } from 'zod/v3';
2
2
  export declare const AGENT_OUTPUT_MAX_PATHS = 128;
3
3
  /** Relative file selections only. A declaration does not grant filesystem access. */
4
4
  export declare const agentResultPathSchema: z.ZodEffects<z.ZodString, string, string>;
5
- /** Omission means no export. Optional paths restrict the adapter's explicitly declared deliverables. */
5
+ /** Omission means no file delivery. A report file is optional and independent of artifact export mode. */
6
6
  export declare const agentOutputDeliverySchema: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
7
7
  mode: z.ZodLiteral<"none">;
8
+ reportPath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
8
9
  }, "strict", z.ZodTypeAny, {
9
10
  mode: "none";
11
+ reportPath?: string | undefined;
10
12
  }, {
11
13
  mode: "none";
14
+ reportPath?: string | undefined;
12
15
  }>, z.ZodObject<{
13
16
  mode: z.ZodLiteral<"files">;
14
17
  paths: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
18
+ reportPath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
15
19
  }, "strict", z.ZodTypeAny, {
16
20
  mode: "files";
21
+ reportPath?: string | undefined;
17
22
  paths?: string[] | undefined;
18
23
  }, {
19
24
  mode: "files";
25
+ reportPath?: string | undefined;
20
26
  paths?: string[] | undefined;
21
27
  }>, z.ZodObject<{
22
28
  mode: z.ZodLiteral<"archive">;
23
29
  paths: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
30
+ reportPath: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
24
31
  }, "strict", z.ZodTypeAny, {
25
32
  mode: "archive";
33
+ reportPath?: string | undefined;
26
34
  paths?: string[] | undefined;
27
35
  }, {
28
36
  mode: "archive";
37
+ reportPath?: string | undefined;
29
38
  paths?: string[] | undefined;
30
39
  }>]>;
31
40
  export type AgentOutputDelivery = z.output<typeof agentOutputDeliverySchema>;
41
+ /** A delivery retry cannot relaunch the executor or change its originally selected report. */
42
+ export declare const agentDeliveryRecoverySchema: z.ZodObject<{
43
+ expectedRevision: z.ZodNumber;
44
+ paths: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
45
+ }, "strict", z.ZodTypeAny, {
46
+ expectedRevision: number;
47
+ paths?: string[] | undefined;
48
+ }, {
49
+ expectedRevision: number;
50
+ paths?: string[] | undefined;
51
+ }>;
52
+ export type AgentDeliveryRecovery = z.output<typeof agentDeliveryRecoverySchema>;
@@ -33,21 +33,21 @@ export declare const agentRuntimeProgressSchema: z.ZodObject<{
33
33
  source: "executor" | "host";
34
34
  observedAt: string;
35
35
  startedAt?: string | undefined;
36
- summary?: string | undefined;
37
- phase?: string | undefined;
38
36
  steps?: {
39
37
  completed: number;
40
38
  total: number;
41
39
  } | undefined;
40
+ summary?: string | undefined;
41
+ phase?: string | undefined;
42
42
  }, {
43
43
  source: "executor" | "host";
44
44
  observedAt: string;
45
45
  startedAt?: string | undefined;
46
- summary?: string | undefined;
47
- phase?: string | undefined;
48
46
  steps?: {
49
47
  completed: number;
50
48
  total: number;
51
49
  } | undefined;
50
+ summary?: string | undefined;
51
+ phase?: string | undefined;
52
52
  }>;
53
53
  export type AgentRuntimeProgress = z.output<typeof agentRuntimeProgressSchema>;
@@ -19,6 +19,5 @@ export interface AssistantCapabilitySummary {
19
19
  componentKey: string;
20
20
  targetAgentKey?: string;
21
21
  }[];
22
- seedMemoryCount: number;
23
22
  sandbox: boolean;
24
23
  }