@xpert-ai/contracts 3.26.2 → 3.28.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/index.cjs.js +760 -290
- package/index.esm.js +726 -291
- package/package.json +2 -2
- package/src/agent-plugin.d.ts +2 -0
- package/src/ai/chat-recovery.model.d.ts +33 -0
- package/src/ai/chat.model.d.ts +16 -1
- package/src/ai/computer-codex-isolation.model.d.ts +12 -0
- package/src/ai/execution-control-evidence.schema.d.ts +294 -0
- package/src/ai/execution-control.model.d.ts +26 -0
- package/src/ai/index.d.ts +6 -0
- package/src/ai/mcp-execution-control.schema.d.ts +107 -0
- package/src/ai/mcp-operation.model.d.ts +60 -0
- package/src/ai/mcp-task.schema.d.ts +85 -0
- package/src/ai/model-execution-parameters.model.d.ts +46 -0
- package/src/ai/model-execution.model.d.ts +3 -0
- package/src/ai/project-pipeline/operation.schema.d.ts +1987 -2
- package/src/ai/project-task-runtime.model.d.ts +44 -44
- package/src/ai/run-display-snapshot.model.d.ts +24 -0
- package/src/ai/sandbox-execution-control.schema.d.ts +100 -0
- package/src/ai/thread-activity.model.d.ts +1 -0
- package/src/ai/thread-control-projection.model.d.ts +9 -0
- package/src/ai/thread-control-view.schema.d.ts +97 -0
- package/src/ai/xpert-agent-execution.model.d.ts +2 -0
- package/src/ai/xpert-project-type.model.d.ts +2 -0
- package/src/ai/xpert-template.model.d.ts +2 -0
- package/src/ai/xpert-workspace.model.d.ts +1 -0
- package/src/ai/xpert.model.d.ts +4 -0
- package/src/api-key.model.d.ts +3 -1
- package/src/artifact.model.d.ts +3 -0
- package/src/content-document.model.d.ts +142 -0
- package/src/content-reference.model.d.ts +19 -0
- package/src/content-resource.model.d.ts +112 -0
- package/src/desktop-shell.model.d.ts +8 -0
- package/src/execution-control-admission.schema.d.ts +119 -0
- package/src/index.d.ts +12 -1
- package/src/plugin-application.d.ts +34 -7
- package/src/runtime-control.d.ts +9 -0
- package/src/secret-token.model.d.ts +33 -0
- package/src/task-control.model.d.ts +45 -0
- package/src/view-extension/model.d.ts +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xpert-ai/contracts",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.28.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.
|
|
24
|
+
"@xpert-ai/chatkit-types": "~0.19.0",
|
|
25
25
|
"zod-to-json-schema": "^3.25.2"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
package/src/agent-plugin.d.ts
CHANGED
|
@@ -247,3 +247,5 @@ export interface InstalledAgentPlugin extends Omit<WorkspaceAgentPlugin, 'status
|
|
|
247
247
|
scope: 'tenant' | 'organization';
|
|
248
248
|
status: 'available' | 'configuration_required' | 'disabled';
|
|
249
249
|
}
|
|
250
|
+
/** Storage faults are distinct from dependency compatibility and installation snapshot changes. */
|
|
251
|
+
export type AgentPluginStorageErrorCode = 'AGENT_PLUGIN_STORAGE_MISSING' | 'AGENT_PLUGIN_STORAGE_UNREADABLE' | 'AGENT_PLUGIN_STORAGE_CORRUPT';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { TChatCheckpointReference } from './chat.model';
|
|
2
|
+
/** Server-owned boundaries. An input retry may repeat completed actions; latest is not an automatic resume grant. */
|
|
3
|
+
export type TChatExecutionRecovery = {
|
|
4
|
+
version: 1;
|
|
5
|
+
graphRevision: string;
|
|
6
|
+
input?: TChatCheckpointReference;
|
|
7
|
+
latest: TChatCheckpointReference;
|
|
8
|
+
};
|
|
9
|
+
export type TChatRecoveryErrorCode = 'conversation_graph_changed' | 'conversation_recovery_unavailable' | 'conversation_branch_selection_changed';
|
|
10
|
+
export type TChatRecoveryError = {
|
|
11
|
+
code: TChatRecoveryErrorCode;
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
export type TMessageEditAdmission = {
|
|
15
|
+
version: 1;
|
|
16
|
+
state: 'pending' | 'admitted';
|
|
17
|
+
workingThreadId: string;
|
|
18
|
+
workingThreadRevision: number;
|
|
19
|
+
};
|
|
20
|
+
/** Internal diagnostic result. ChatKit receives only TChatThreadCapabilities. */
|
|
21
|
+
export type TChatThreadRecovery = {
|
|
22
|
+
threadId: string;
|
|
23
|
+
executionId?: string;
|
|
24
|
+
canRetry: boolean;
|
|
25
|
+
reason?: TChatRecoveryErrorCode;
|
|
26
|
+
originalError?: string;
|
|
27
|
+
sourceThreadId?: string;
|
|
28
|
+
};
|
|
29
|
+
/** Chat clients consume availability only; diagnostic details stay server-side. */
|
|
30
|
+
export type TChatThreadCapabilities = {
|
|
31
|
+
canRetry: boolean;
|
|
32
|
+
controlView?: import('./thread-control-view.schema').ThreadControlView;
|
|
33
|
+
};
|
package/src/ai/chat.model.d.ts
CHANGED
|
@@ -120,8 +120,19 @@ export type TChatThreadDisplayPause = {
|
|
|
120
120
|
};
|
|
121
121
|
export type TChatThreadRunControl = {
|
|
122
122
|
executionId: string;
|
|
123
|
-
state: 'running' | 'pausing' | 'paused';
|
|
123
|
+
state: 'running' | 'pausing' | 'paused' | 'terminating' | 'settling' | 'input_wait';
|
|
124
|
+
/** Trusted checkpoint node names allowed to finish the current input continuation during pause. */
|
|
125
|
+
inputNodes?: string[];
|
|
126
|
+
/** Saved graph outcome while attached work still lacks settlement evidence. */
|
|
127
|
+
pendingFinish?: {
|
|
128
|
+
status: TChatConversationStatus;
|
|
129
|
+
error?: string | null;
|
|
130
|
+
operation?: TSensitiveOperation | null;
|
|
131
|
+
};
|
|
124
132
|
pauseId?: string;
|
|
133
|
+
/** Fences late finalizers while a resume is claimed but not yet bound to its new execution. */
|
|
134
|
+
resumeClaimed?: boolean;
|
|
135
|
+
resumeClaimId?: string;
|
|
125
136
|
graphRevision?: string;
|
|
126
137
|
checkpoint?: TChatCheckpointReference;
|
|
127
138
|
};
|
|
@@ -133,6 +144,8 @@ export declare const ChatThreadPurpose: {
|
|
|
133
144
|
export type TChatThreadPurpose = (typeof ChatThreadPurpose)[keyof typeof ChatThreadPurpose];
|
|
134
145
|
/** Machine-readable keys stored in `ChatConversationThread.metadata`. */
|
|
135
146
|
export type TChatThreadMetadata = {
|
|
147
|
+
/** Server-owned admission for historical-message edits. */
|
|
148
|
+
editAdmission?: import('./chat-recovery.model').TMessageEditAdmission;
|
|
136
149
|
/** User-editable branch label, independent of the conversation title. */
|
|
137
150
|
title?: string;
|
|
138
151
|
primary?: boolean;
|
|
@@ -178,6 +191,8 @@ export type TSensitiveOperation = {
|
|
|
178
191
|
* Corresponds to the thread in the [Agent Protocol](https://github.com/langchain-ai/agent-protocol).
|
|
179
192
|
*/
|
|
180
193
|
export interface IChatConversation extends IBasePerTenantAndOrganizationEntityModel {
|
|
194
|
+
/** Optimistic concurrency token for the persisted working-thread selection. */
|
|
195
|
+
workingThreadRevision?: number;
|
|
181
196
|
/**
|
|
182
197
|
* `private`: ordinary chat; `group`: shared public transcript; `group_assistant_runtime`:
|
|
183
198
|
* one member Assistant's isolated execution history. Optional for legacy DTOs (treated as private).
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Host-selected Codex execution boundary. This describes policy, not command readiness. */
|
|
2
|
+
export type ComputerCodexIsolationPolicy = {
|
|
3
|
+
provider: 'codex';
|
|
4
|
+
approvalPolicy: 'never';
|
|
5
|
+
commandReadiness: 'verify_before_launch';
|
|
6
|
+
} & ({
|
|
7
|
+
sandboxMode: 'workspace-write';
|
|
8
|
+
enforcement: 'codex';
|
|
9
|
+
} | {
|
|
10
|
+
sandboxMode: 'danger-full-access';
|
|
11
|
+
enforcement: 'computer';
|
|
12
|
+
});
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
/** Host-assigned attempt identity. A new host boot or execution never inherits an old target. */
|
|
3
|
+
export declare const executionRuntimeTargetSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
4
|
+
version: z.ZodLiteral<1>;
|
|
5
|
+
kind: z.ZodLiteral<"host">;
|
|
6
|
+
generation: z.ZodString;
|
|
7
|
+
hostId: z.ZodString;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
kind: "host";
|
|
10
|
+
version: 1;
|
|
11
|
+
generation: string;
|
|
12
|
+
hostId: string;
|
|
13
|
+
}, {
|
|
14
|
+
kind: "host";
|
|
15
|
+
version: 1;
|
|
16
|
+
generation: string;
|
|
17
|
+
hostId: string;
|
|
18
|
+
}>, z.ZodObject<{
|
|
19
|
+
version: z.ZodLiteral<1>;
|
|
20
|
+
kind: z.ZodLiteral<"provider">;
|
|
21
|
+
generation: z.ZodString;
|
|
22
|
+
}, "strict", z.ZodTypeAny, {
|
|
23
|
+
kind: "provider";
|
|
24
|
+
version: 1;
|
|
25
|
+
generation: string;
|
|
26
|
+
}, {
|
|
27
|
+
kind: "provider";
|
|
28
|
+
version: 1;
|
|
29
|
+
generation: string;
|
|
30
|
+
}>]>;
|
|
31
|
+
export type ExecutionRuntimeTarget = z.output<typeof executionRuntimeTargetSchema>;
|
|
32
|
+
export declare function executionRuntimeTargetsEqual(left: ExecutionRuntimeTarget | undefined, right: ExecutionRuntimeTarget | undefined): boolean;
|
|
33
|
+
/** Control acknowledgements never constitute completion evidence. Missing evidence stays unknown. */
|
|
34
|
+
export declare const executionControlEvidenceSchema: z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
|
|
35
|
+
source: z.ZodLiteral<"unavailable">;
|
|
36
|
+
subject: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
37
|
+
kind: z.ZodLiteral<"execution">;
|
|
38
|
+
id: z.ZodString;
|
|
39
|
+
}, "strict", z.ZodTypeAny, {
|
|
40
|
+
kind: "execution";
|
|
41
|
+
id: string;
|
|
42
|
+
}, {
|
|
43
|
+
kind: "execution";
|
|
44
|
+
id: string;
|
|
45
|
+
}>, z.ZodObject<{
|
|
46
|
+
kind: z.ZodLiteral<"invocation">;
|
|
47
|
+
id: z.ZodString;
|
|
48
|
+
}, "strict", z.ZodTypeAny, {
|
|
49
|
+
kind: "invocation";
|
|
50
|
+
id: string;
|
|
51
|
+
}, {
|
|
52
|
+
kind: "invocation";
|
|
53
|
+
id: string;
|
|
54
|
+
}>]>;
|
|
55
|
+
state: z.ZodLiteral<"unknown">;
|
|
56
|
+
reason: z.ZodEnum<["unregistered", "unconfirmed", "unsupported"]>;
|
|
57
|
+
version: z.ZodLiteral<1>;
|
|
58
|
+
observedAt: z.ZodString;
|
|
59
|
+
}, "strict", z.ZodTypeAny, {
|
|
60
|
+
subject: {
|
|
61
|
+
kind: "execution";
|
|
62
|
+
id: string;
|
|
63
|
+
} | {
|
|
64
|
+
kind: "invocation";
|
|
65
|
+
id: string;
|
|
66
|
+
};
|
|
67
|
+
source: "unavailable";
|
|
68
|
+
version: 1;
|
|
69
|
+
state: "unknown";
|
|
70
|
+
reason: "unregistered" | "unconfirmed" | "unsupported";
|
|
71
|
+
observedAt: string;
|
|
72
|
+
}, {
|
|
73
|
+
subject: {
|
|
74
|
+
kind: "execution";
|
|
75
|
+
id: string;
|
|
76
|
+
} | {
|
|
77
|
+
kind: "invocation";
|
|
78
|
+
id: string;
|
|
79
|
+
};
|
|
80
|
+
source: "unavailable";
|
|
81
|
+
version: 1;
|
|
82
|
+
state: "unknown";
|
|
83
|
+
reason: "unregistered" | "unconfirmed" | "unsupported";
|
|
84
|
+
observedAt: string;
|
|
85
|
+
}>, z.ZodObject<{
|
|
86
|
+
source: z.ZodLiteral<"platform">;
|
|
87
|
+
subject: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
88
|
+
kind: z.ZodLiteral<"execution">;
|
|
89
|
+
id: z.ZodString;
|
|
90
|
+
}, "strict", z.ZodTypeAny, {
|
|
91
|
+
kind: "execution";
|
|
92
|
+
id: string;
|
|
93
|
+
}, {
|
|
94
|
+
kind: "execution";
|
|
95
|
+
id: string;
|
|
96
|
+
}>, z.ZodObject<{
|
|
97
|
+
kind: z.ZodLiteral<"invocation">;
|
|
98
|
+
id: z.ZodString;
|
|
99
|
+
}, "strict", z.ZodTypeAny, {
|
|
100
|
+
kind: "invocation";
|
|
101
|
+
id: string;
|
|
102
|
+
}, {
|
|
103
|
+
kind: "invocation";
|
|
104
|
+
id: string;
|
|
105
|
+
}>]>;
|
|
106
|
+
scope: z.ZodLiteral<"owned_subtree">;
|
|
107
|
+
state: z.ZodEnum<["running", "pausing", "paused", "terminating", "settled"]>;
|
|
108
|
+
desired: z.ZodEnum<["running", "paused", "terminated"]>;
|
|
109
|
+
taskId: z.ZodString;
|
|
110
|
+
rootId: z.ZodString;
|
|
111
|
+
revision: z.ZodNumber;
|
|
112
|
+
executionId: z.ZodString;
|
|
113
|
+
threadId: z.ZodString;
|
|
114
|
+
version: z.ZodLiteral<1>;
|
|
115
|
+
observedAt: z.ZodString;
|
|
116
|
+
}, "strict", z.ZodTypeAny, {
|
|
117
|
+
subject: {
|
|
118
|
+
kind: "execution";
|
|
119
|
+
id: string;
|
|
120
|
+
} | {
|
|
121
|
+
kind: "invocation";
|
|
122
|
+
id: string;
|
|
123
|
+
};
|
|
124
|
+
source: "platform";
|
|
125
|
+
version: 1;
|
|
126
|
+
scope: "owned_subtree";
|
|
127
|
+
revision: number;
|
|
128
|
+
state: "running" | "paused" | "pausing" | "terminating" | "settled";
|
|
129
|
+
threadId: string;
|
|
130
|
+
observedAt: string;
|
|
131
|
+
desired: "running" | "paused" | "terminated";
|
|
132
|
+
taskId: string;
|
|
133
|
+
rootId: string;
|
|
134
|
+
executionId: string;
|
|
135
|
+
}, {
|
|
136
|
+
subject: {
|
|
137
|
+
kind: "execution";
|
|
138
|
+
id: string;
|
|
139
|
+
} | {
|
|
140
|
+
kind: "invocation";
|
|
141
|
+
id: string;
|
|
142
|
+
};
|
|
143
|
+
source: "platform";
|
|
144
|
+
version: 1;
|
|
145
|
+
scope: "owned_subtree";
|
|
146
|
+
revision: number;
|
|
147
|
+
state: "running" | "paused" | "pausing" | "terminating" | "settled";
|
|
148
|
+
threadId: string;
|
|
149
|
+
observedAt: string;
|
|
150
|
+
desired: "running" | "paused" | "terminated";
|
|
151
|
+
taskId: string;
|
|
152
|
+
rootId: string;
|
|
153
|
+
executionId: string;
|
|
154
|
+
}>, z.ZodObject<{
|
|
155
|
+
source: z.ZodLiteral<"provider">;
|
|
156
|
+
subject: z.ZodObject<{
|
|
157
|
+
kind: z.ZodLiteral<"invocation">;
|
|
158
|
+
id: z.ZodString;
|
|
159
|
+
}, "strict", z.ZodTypeAny, {
|
|
160
|
+
kind: "invocation";
|
|
161
|
+
id: string;
|
|
162
|
+
}, {
|
|
163
|
+
kind: "invocation";
|
|
164
|
+
id: string;
|
|
165
|
+
}>;
|
|
166
|
+
scope: z.ZodLiteral<"operation">;
|
|
167
|
+
state: z.ZodLiteral<"settled">;
|
|
168
|
+
outcome: z.ZodEnum<["succeeded", "failed", "cancelled"]>;
|
|
169
|
+
sessionId: z.ZodString;
|
|
170
|
+
runId: z.ZodString;
|
|
171
|
+
receiptKey: z.ZodString;
|
|
172
|
+
target: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
173
|
+
version: z.ZodLiteral<1>;
|
|
174
|
+
kind: z.ZodLiteral<"host">;
|
|
175
|
+
generation: z.ZodString;
|
|
176
|
+
hostId: z.ZodString;
|
|
177
|
+
}, "strict", z.ZodTypeAny, {
|
|
178
|
+
kind: "host";
|
|
179
|
+
version: 1;
|
|
180
|
+
generation: string;
|
|
181
|
+
hostId: string;
|
|
182
|
+
}, {
|
|
183
|
+
kind: "host";
|
|
184
|
+
version: 1;
|
|
185
|
+
generation: string;
|
|
186
|
+
hostId: string;
|
|
187
|
+
}>, z.ZodObject<{
|
|
188
|
+
version: z.ZodLiteral<1>;
|
|
189
|
+
kind: z.ZodLiteral<"provider">;
|
|
190
|
+
generation: z.ZodString;
|
|
191
|
+
}, "strict", z.ZodTypeAny, {
|
|
192
|
+
kind: "provider";
|
|
193
|
+
version: 1;
|
|
194
|
+
generation: string;
|
|
195
|
+
}, {
|
|
196
|
+
kind: "provider";
|
|
197
|
+
version: 1;
|
|
198
|
+
generation: string;
|
|
199
|
+
}>]>>;
|
|
200
|
+
version: z.ZodLiteral<1>;
|
|
201
|
+
observedAt: z.ZodString;
|
|
202
|
+
}, "strict", z.ZodTypeAny, {
|
|
203
|
+
subject: {
|
|
204
|
+
kind: "invocation";
|
|
205
|
+
id: string;
|
|
206
|
+
};
|
|
207
|
+
outcome: "succeeded" | "failed" | "cancelled";
|
|
208
|
+
source: "provider";
|
|
209
|
+
version: 1;
|
|
210
|
+
scope: "operation";
|
|
211
|
+
state: "settled";
|
|
212
|
+
runId: string;
|
|
213
|
+
observedAt: string;
|
|
214
|
+
sessionId: string;
|
|
215
|
+
receiptKey: string;
|
|
216
|
+
target?: {
|
|
217
|
+
kind: "host";
|
|
218
|
+
version: 1;
|
|
219
|
+
generation: string;
|
|
220
|
+
hostId: string;
|
|
221
|
+
} | {
|
|
222
|
+
kind: "provider";
|
|
223
|
+
version: 1;
|
|
224
|
+
generation: string;
|
|
225
|
+
} | undefined;
|
|
226
|
+
}, {
|
|
227
|
+
subject: {
|
|
228
|
+
kind: "invocation";
|
|
229
|
+
id: string;
|
|
230
|
+
};
|
|
231
|
+
outcome: "succeeded" | "failed" | "cancelled";
|
|
232
|
+
source: "provider";
|
|
233
|
+
version: 1;
|
|
234
|
+
scope: "operation";
|
|
235
|
+
state: "settled";
|
|
236
|
+
runId: string;
|
|
237
|
+
observedAt: string;
|
|
238
|
+
sessionId: string;
|
|
239
|
+
receiptKey: string;
|
|
240
|
+
target?: {
|
|
241
|
+
kind: "host";
|
|
242
|
+
version: 1;
|
|
243
|
+
generation: string;
|
|
244
|
+
hostId: string;
|
|
245
|
+
} | {
|
|
246
|
+
kind: "provider";
|
|
247
|
+
version: 1;
|
|
248
|
+
generation: string;
|
|
249
|
+
} | undefined;
|
|
250
|
+
}>, z.ZodObject<{
|
|
251
|
+
source: z.ZodLiteral<"host_admission">;
|
|
252
|
+
subject: z.ZodObject<{
|
|
253
|
+
kind: z.ZodLiteral<"invocation">;
|
|
254
|
+
id: z.ZodString;
|
|
255
|
+
}, "strict", z.ZodTypeAny, {
|
|
256
|
+
kind: "invocation";
|
|
257
|
+
id: string;
|
|
258
|
+
}, {
|
|
259
|
+
kind: "invocation";
|
|
260
|
+
id: string;
|
|
261
|
+
}>;
|
|
262
|
+
scope: z.ZodLiteral<"operation">;
|
|
263
|
+
state: z.ZodLiteral<"settled">;
|
|
264
|
+
outcome: z.ZodEnum<["failed", "cancelled"]>;
|
|
265
|
+
reason: z.ZodLiteral<"not_started">;
|
|
266
|
+
version: z.ZodLiteral<1>;
|
|
267
|
+
observedAt: z.ZodString;
|
|
268
|
+
}, "strict", z.ZodTypeAny, {
|
|
269
|
+
subject: {
|
|
270
|
+
kind: "invocation";
|
|
271
|
+
id: string;
|
|
272
|
+
};
|
|
273
|
+
outcome: "failed" | "cancelled";
|
|
274
|
+
source: "host_admission";
|
|
275
|
+
version: 1;
|
|
276
|
+
scope: "operation";
|
|
277
|
+
state: "settled";
|
|
278
|
+
reason: "not_started";
|
|
279
|
+
observedAt: string;
|
|
280
|
+
}, {
|
|
281
|
+
subject: {
|
|
282
|
+
kind: "invocation";
|
|
283
|
+
id: string;
|
|
284
|
+
};
|
|
285
|
+
outcome: "failed" | "cancelled";
|
|
286
|
+
source: "host_admission";
|
|
287
|
+
version: 1;
|
|
288
|
+
scope: "operation";
|
|
289
|
+
state: "settled";
|
|
290
|
+
reason: "not_started";
|
|
291
|
+
observedAt: string;
|
|
292
|
+
}>]>;
|
|
293
|
+
export type ExecutionControlEvidence = z.output<typeof executionControlEvidenceSchema>;
|
|
294
|
+
export declare function unknownExecutionControl(subject: ExecutionControlEvidence['subject'], reason?: 'unregistered' | 'unconfirmed' | 'unsupported'): ExecutionControlEvidence;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
2
|
+
/** Lifecycle ownership is assigned by trusted creation code, never inferred from async/background mode. */
|
|
3
|
+
export type TExecutionOwnership = {
|
|
4
|
+
policy: 'attached' | 'detached' | 'shared';
|
|
5
|
+
parentExecutionId?: string;
|
|
6
|
+
rootExecutionId: string;
|
|
7
|
+
};
|
|
8
|
+
export type TExecutionControlIntent = 'running' | 'paused' | 'terminated';
|
|
9
|
+
/** Local tool receipts describe actual calls, not aborted LangChain wrappers. */
|
|
10
|
+
export type TExecutionWorkReceipt = {
|
|
11
|
+
id: string;
|
|
12
|
+
executionId: string;
|
|
13
|
+
settled: boolean;
|
|
14
|
+
};
|
|
15
|
+
/** Internal control facts; public clients receive a separate control view. */
|
|
16
|
+
export interface IExecutionControl extends IBasePerTenantAndOrganizationEntityModel {
|
|
17
|
+
executionId: string;
|
|
18
|
+
threadId: string;
|
|
19
|
+
rootExecutionId: string;
|
|
20
|
+
ownership: TExecutionOwnership;
|
|
21
|
+
ancestors: string[];
|
|
22
|
+
desired: TExecutionControlIntent;
|
|
23
|
+
revision: number;
|
|
24
|
+
graphEnded: boolean;
|
|
25
|
+
work: TExecutionWorkReceipt[];
|
|
26
|
+
}
|
package/src/ai/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export { createResourceCardContent, isResourceCardContent, parseResourceCard, pa
|
|
|
21
21
|
export type { ConversationResourceCard, ResourceCardImage, ResourceCardOpenTarget, ResourceCardScalar, TMessageContentResourceCard } from './resource-card';
|
|
22
22
|
export * from './thread-goal.model';
|
|
23
23
|
export * from './chat.model';
|
|
24
|
+
export * from './chat-recovery.model';
|
|
24
25
|
export * from './chat-message.model';
|
|
25
26
|
export * from './chat-task-summary.model';
|
|
26
27
|
export * from './chat-message-feedback.model';
|
|
@@ -102,6 +103,8 @@ export * from './knowledge-keyword-analyzer.model';
|
|
|
102
103
|
export * from './assistant-configuration.model';
|
|
103
104
|
export * from './assistant-trigger.model';
|
|
104
105
|
export * from './model-execution.model';
|
|
106
|
+
export * from './model-execution-parameters.model';
|
|
107
|
+
export * from './computer-codex-isolation.model';
|
|
105
108
|
export * from './agent-runtime.model';
|
|
106
109
|
export * from './assistant-task-context.model';
|
|
107
110
|
export * from './project-task-runtime.model';
|
|
@@ -120,3 +123,6 @@ export * from './assistant-template-setup.model';
|
|
|
120
123
|
export * from './template-activity.model';
|
|
121
124
|
export * from './template-lifecycle.model';
|
|
122
125
|
export * from './assistant-template-overview.model';
|
|
126
|
+
export * from './run-display-snapshot.model';
|
|
127
|
+
export * from './execution-control.model';
|
|
128
|
+
export * from './execution-control-evidence.schema';
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
/** Negotiated Xpert extension. MCP cancellation acknowledgements are not exit evidence. */
|
|
3
|
+
export declare const MCP_EXECUTION_CONTROL_EXTENSION_ID = "ai.xpert/execution-control";
|
|
4
|
+
export declare const MCP_EXECUTION_CONTROL_METHOD = "xpert/tasks/control";
|
|
5
|
+
/** Additive tools/list metadata for 2026, which removed top-level Tool.execution. */
|
|
6
|
+
export declare const mcpExecutionToolDeclarationSchema: z.ZodObject<{
|
|
7
|
+
version: z.ZodLiteral<1>;
|
|
8
|
+
taskSupport: z.ZodEnum<["required", "optional", "forbidden"]>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
version?: 1;
|
|
11
|
+
taskSupport?: "required" | "optional" | "forbidden";
|
|
12
|
+
}, {
|
|
13
|
+
version?: 1;
|
|
14
|
+
taskSupport?: "required" | "optional" | "forbidden";
|
|
15
|
+
}>;
|
|
16
|
+
export declare const mcpOperationIdentitySchema: z.ZodObject<{
|
|
17
|
+
version: z.ZodLiteral<1>;
|
|
18
|
+
operationId: z.ZodString;
|
|
19
|
+
generation: z.ZodString;
|
|
20
|
+
inputHash: z.ZodString;
|
|
21
|
+
toolName: z.ZodString;
|
|
22
|
+
}, "strict", z.ZodTypeAny, {
|
|
23
|
+
version?: 1;
|
|
24
|
+
generation?: string;
|
|
25
|
+
toolName?: string;
|
|
26
|
+
inputHash?: string;
|
|
27
|
+
operationId?: string;
|
|
28
|
+
}, {
|
|
29
|
+
version?: 1;
|
|
30
|
+
generation?: string;
|
|
31
|
+
toolName?: string;
|
|
32
|
+
inputHash?: string;
|
|
33
|
+
operationId?: string;
|
|
34
|
+
}>;
|
|
35
|
+
export type McpOperationIdentity = z.output<typeof mcpOperationIdentitySchema>;
|
|
36
|
+
export declare const mcpExecutionControlRequestSchema: z.ZodObject<{
|
|
37
|
+
version: z.ZodLiteral<1>;
|
|
38
|
+
operationId: z.ZodString;
|
|
39
|
+
generation: z.ZodString;
|
|
40
|
+
inputHash: z.ZodString;
|
|
41
|
+
toolName: z.ZodString;
|
|
42
|
+
} & {
|
|
43
|
+
serverId: z.ZodString;
|
|
44
|
+
action: z.ZodEnum<["inspect", "terminate"]>;
|
|
45
|
+
}, "strict", z.ZodTypeAny, {
|
|
46
|
+
version?: 1;
|
|
47
|
+
generation?: string;
|
|
48
|
+
toolName?: string;
|
|
49
|
+
inputHash?: string;
|
|
50
|
+
action?: "terminate" | "inspect";
|
|
51
|
+
operationId?: string;
|
|
52
|
+
serverId?: string;
|
|
53
|
+
}, {
|
|
54
|
+
version?: 1;
|
|
55
|
+
generation?: string;
|
|
56
|
+
toolName?: string;
|
|
57
|
+
inputHash?: string;
|
|
58
|
+
action?: "terminate" | "inspect";
|
|
59
|
+
operationId?: string;
|
|
60
|
+
serverId?: string;
|
|
61
|
+
}>;
|
|
62
|
+
export type McpExecutionControlRequest = z.output<typeof mcpExecutionControlRequestSchema>;
|
|
63
|
+
export declare const mcpExecutionReceiptSchema: z.ZodObject<{
|
|
64
|
+
version: z.ZodLiteral<1>;
|
|
65
|
+
serverId: z.ZodString;
|
|
66
|
+
operationId: z.ZodString;
|
|
67
|
+
generation: z.ZodString;
|
|
68
|
+
taskId: z.ZodNullable<z.ZodString>;
|
|
69
|
+
state: z.ZodEnum<["pending", "settled", "unknown"]>;
|
|
70
|
+
intent: z.ZodEnum<["running", "paused", "terminated"]>;
|
|
71
|
+
revision: z.ZodNumber;
|
|
72
|
+
handlerExited: z.ZodBoolean;
|
|
73
|
+
descendantsSettled: z.ZodBoolean;
|
|
74
|
+
}, "strict", z.ZodTypeAny, {
|
|
75
|
+
version?: 1;
|
|
76
|
+
generation?: string;
|
|
77
|
+
revision?: number;
|
|
78
|
+
taskId?: string;
|
|
79
|
+
operationId?: string;
|
|
80
|
+
state?: "unknown" | "pending" | "settled";
|
|
81
|
+
serverId?: string;
|
|
82
|
+
intent?: "paused" | "running" | "terminated";
|
|
83
|
+
handlerExited?: boolean;
|
|
84
|
+
descendantsSettled?: boolean;
|
|
85
|
+
}, {
|
|
86
|
+
version?: 1;
|
|
87
|
+
generation?: string;
|
|
88
|
+
revision?: number;
|
|
89
|
+
taskId?: string;
|
|
90
|
+
operationId?: string;
|
|
91
|
+
state?: "unknown" | "pending" | "settled";
|
|
92
|
+
serverId?: string;
|
|
93
|
+
intent?: "paused" | "running" | "terminated";
|
|
94
|
+
handlerExited?: boolean;
|
|
95
|
+
descendantsSettled?: boolean;
|
|
96
|
+
}>;
|
|
97
|
+
export type McpExecutionReceipt = z.output<typeof mcpExecutionReceiptSchema>;
|
|
98
|
+
export declare const mcpExecutionCapabilitySchema: z.ZodObject<{
|
|
99
|
+
version: z.ZodLiteral<1>;
|
|
100
|
+
serverId: z.ZodString;
|
|
101
|
+
}, "strict", z.ZodTypeAny, {
|
|
102
|
+
version?: 1;
|
|
103
|
+
serverId?: string;
|
|
104
|
+
}, {
|
|
105
|
+
version?: 1;
|
|
106
|
+
serverId?: string;
|
|
107
|
+
}>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
2
|
+
import type { McpPrincipal } from './mcp-auth.model';
|
|
3
|
+
import type { McpExecutionReceipt, McpOperationIdentity } from './mcp-execution-control.schema';
|
|
4
|
+
import type { McpConsumerTask } from './mcp-task.schema';
|
|
5
|
+
export type McpOperationAuthority = {
|
|
6
|
+
kind: 'workspace';
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'assistant';
|
|
9
|
+
xpertId: string;
|
|
10
|
+
projectId?: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'publication';
|
|
13
|
+
principal: McpPrincipal;
|
|
14
|
+
};
|
|
15
|
+
export interface McpOperationScope {
|
|
16
|
+
actor: {
|
|
17
|
+
tenantId: string;
|
|
18
|
+
organizationId: string | null;
|
|
19
|
+
userId: string | null;
|
|
20
|
+
};
|
|
21
|
+
workspaceId: string;
|
|
22
|
+
toolsetId: string;
|
|
23
|
+
authority?: McpOperationAuthority;
|
|
24
|
+
serverName: string;
|
|
25
|
+
}
|
|
26
|
+
export interface McpOperationRecord {
|
|
27
|
+
version: 1;
|
|
28
|
+
scope: McpOperationScope;
|
|
29
|
+
connectionVersion: string;
|
|
30
|
+
reconnectable: boolean;
|
|
31
|
+
identity: McpOperationIdentity;
|
|
32
|
+
serverId: string | null;
|
|
33
|
+
mode: 'task' | 'call';
|
|
34
|
+
phase: 'reserved' | 'sending' | 'observing' | 'settled' | 'unknown';
|
|
35
|
+
hostId: string;
|
|
36
|
+
claim: string;
|
|
37
|
+
taskId?: string;
|
|
38
|
+
receipt?: McpExecutionReceipt;
|
|
39
|
+
task?: McpConsumerTask;
|
|
40
|
+
result?: object;
|
|
41
|
+
callReturned?: boolean;
|
|
42
|
+
hostExited: boolean;
|
|
43
|
+
inputResponses: Record<string, object>;
|
|
44
|
+
inputLease?: {
|
|
45
|
+
key: string;
|
|
46
|
+
owner: string;
|
|
47
|
+
expiresAt: number;
|
|
48
|
+
};
|
|
49
|
+
failureCount: number;
|
|
50
|
+
}
|
|
51
|
+
/** Internal durable call identity and control data; not a public diagnostic view. */
|
|
52
|
+
export interface IMcpRemoteOperation extends IBasePerTenantAndOrganizationEntityModel {
|
|
53
|
+
id: string;
|
|
54
|
+
tenantId: string;
|
|
55
|
+
operationKey: string;
|
|
56
|
+
targetId: string;
|
|
57
|
+
generation: string;
|
|
58
|
+
record: McpOperationRecord;
|
|
59
|
+
nextControlAt: Date | null;
|
|
60
|
+
}
|