@xpert-ai/contracts 3.27.0 → 3.29.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 (36) hide show
  1. package/index.cjs.js +862 -198
  2. package/index.esm.js +818 -199
  3. package/package.json +1 -1
  4. package/src/agent/graph.d.ts +5 -0
  5. package/src/ai/chat-recovery.model.d.ts +1 -0
  6. package/src/ai/chat.model.d.ts +12 -1
  7. package/src/ai/computer-codex-isolation.model.d.ts +12 -0
  8. package/src/ai/conversation-share.model.d.ts +65 -0
  9. package/src/ai/execution-control-evidence.schema.d.ts +294 -0
  10. package/src/ai/execution-control.model.d.ts +26 -0
  11. package/src/ai/execution-observability.model.d.ts +2163 -0
  12. package/src/ai/index.d.ts +6 -0
  13. package/src/ai/mcp-execution-control.schema.d.ts +107 -0
  14. package/src/ai/mcp-operation.model.d.ts +60 -0
  15. package/src/ai/mcp-task.schema.d.ts +85 -0
  16. package/src/ai/model-execution-parameters.model.d.ts +46 -0
  17. package/src/ai/model-execution.model.d.ts +4 -1
  18. package/src/ai/project-pipeline/operation.schema.d.ts +1987 -2
  19. package/src/ai/project-task-runtime.model.d.ts +44 -44
  20. package/src/ai/sandbox-execution-control.schema.d.ts +100 -0
  21. package/src/ai/thread-activity.model.d.ts +1 -0
  22. package/src/ai/thread-control-projection.model.d.ts +9 -0
  23. package/src/ai/thread-control-view.schema.d.ts +97 -0
  24. package/src/api-key.model.d.ts +3 -1
  25. package/src/artifact-presentation.model.d.ts +19 -0
  26. package/src/artifact.model.d.ts +14 -0
  27. package/src/content-document.model.d.ts +3 -1
  28. package/src/content-resource.model.d.ts +119 -0
  29. package/src/desktop-shell.model.d.ts +8 -0
  30. package/src/execution-control-admission.schema.d.ts +119 -0
  31. package/src/index.d.ts +9 -0
  32. package/src/plugin-application.d.ts +18 -0
  33. package/src/runtime-control.d.ts +9 -0
  34. package/src/secret-token.model.d.ts +33 -0
  35. package/src/task-control.model.d.ts +45 -0
  36. package/src/view-extension/model.d.ts +7 -0
package/src/ai/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './conversation-share.model';
1
2
  export declare const STATE_VARIABLE_HUMAN = "human";
2
3
  export * from './prompt-workflow-capabilities.model';
3
4
  export { ChatMessageEventTypeEnum, ChatMessageStepCategory, ChatMessageTypeEnum } from './ai.model';
@@ -103,6 +104,8 @@ export * from './knowledge-keyword-analyzer.model';
103
104
  export * from './assistant-configuration.model';
104
105
  export * from './assistant-trigger.model';
105
106
  export * from './model-execution.model';
107
+ export * from './model-execution-parameters.model';
108
+ export * from './computer-codex-isolation.model';
106
109
  export * from './agent-runtime.model';
107
110
  export * from './assistant-task-context.model';
108
111
  export * from './project-task-runtime.model';
@@ -122,3 +125,6 @@ export * from './template-activity.model';
122
125
  export * from './template-lifecycle.model';
123
126
  export * from './assistant-template-overview.model';
124
127
  export * from './run-display-snapshot.model';
128
+ export * from './execution-control.model';
129
+ export * from './execution-control-evidence.schema';
130
+ export * from './execution-observability.model';
@@ -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
+ }
@@ -0,0 +1,85 @@
1
+ import { z } from 'zod';
2
+ export declare const mcpTaskStartResultSchema: z.ZodObject<{
3
+ resultType: z.ZodLiteral<"task">;
4
+ taskId: z.ZodString;
5
+ status: z.ZodEnum<["working", "input_required", "completed", "failed", "cancelled"]>;
6
+ statusMessage: z.ZodOptional<z.ZodString>;
7
+ createdAt: z.ZodString;
8
+ lastUpdatedAt: z.ZodString;
9
+ ttlMs: z.ZodNullable<z.ZodNumber>;
10
+ pollIntervalMs: z.ZodOptional<z.ZodNumber>;
11
+ progress: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
12
+ content: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
13
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
14
+ resultType: z.ZodLiteral<"task">;
15
+ taskId: z.ZodString;
16
+ status: z.ZodEnum<["working", "input_required", "completed", "failed", "cancelled"]>;
17
+ statusMessage: z.ZodOptional<z.ZodString>;
18
+ createdAt: z.ZodString;
19
+ lastUpdatedAt: z.ZodString;
20
+ ttlMs: z.ZodNullable<z.ZodNumber>;
21
+ pollIntervalMs: z.ZodOptional<z.ZodNumber>;
22
+ progress: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
23
+ content: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
24
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
25
+ resultType: z.ZodLiteral<"task">;
26
+ taskId: z.ZodString;
27
+ status: z.ZodEnum<["working", "input_required", "completed", "failed", "cancelled"]>;
28
+ statusMessage: z.ZodOptional<z.ZodString>;
29
+ createdAt: z.ZodString;
30
+ lastUpdatedAt: z.ZodString;
31
+ ttlMs: z.ZodNullable<z.ZodNumber>;
32
+ pollIntervalMs: z.ZodOptional<z.ZodNumber>;
33
+ progress: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
34
+ content: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
35
+ }, z.ZodTypeAny, "passthrough">>;
36
+ export declare const mcpTaskResultSchema: z.ZodObject<{
37
+ resultType: z.ZodLiteral<"complete">;
38
+ taskId: z.ZodString;
39
+ status: z.ZodEnum<["working", "input_required", "completed", "failed", "cancelled"]>;
40
+ statusMessage: z.ZodOptional<z.ZodString>;
41
+ createdAt: z.ZodString;
42
+ lastUpdatedAt: z.ZodString;
43
+ ttlMs: z.ZodNullable<z.ZodNumber>;
44
+ pollIntervalMs: z.ZodOptional<z.ZodNumber>;
45
+ progress: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
46
+ inputRequests: z.ZodOptional<z.ZodUnknown>;
47
+ result: z.ZodOptional<z.ZodUnknown>;
48
+ error: z.ZodOptional<z.ZodUnknown>;
49
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
50
+ resultType: z.ZodLiteral<"complete">;
51
+ taskId: z.ZodString;
52
+ status: z.ZodEnum<["working", "input_required", "completed", "failed", "cancelled"]>;
53
+ statusMessage: z.ZodOptional<z.ZodString>;
54
+ createdAt: z.ZodString;
55
+ lastUpdatedAt: z.ZodString;
56
+ ttlMs: z.ZodNullable<z.ZodNumber>;
57
+ pollIntervalMs: z.ZodOptional<z.ZodNumber>;
58
+ progress: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
59
+ inputRequests: z.ZodOptional<z.ZodUnknown>;
60
+ result: z.ZodOptional<z.ZodUnknown>;
61
+ error: z.ZodOptional<z.ZodUnknown>;
62
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
63
+ resultType: z.ZodLiteral<"complete">;
64
+ taskId: z.ZodString;
65
+ status: z.ZodEnum<["working", "input_required", "completed", "failed", "cancelled"]>;
66
+ statusMessage: z.ZodOptional<z.ZodString>;
67
+ createdAt: z.ZodString;
68
+ lastUpdatedAt: z.ZodString;
69
+ ttlMs: z.ZodNullable<z.ZodNumber>;
70
+ pollIntervalMs: z.ZodOptional<z.ZodNumber>;
71
+ progress: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
72
+ inputRequests: z.ZodOptional<z.ZodUnknown>;
73
+ result: z.ZodOptional<z.ZodUnknown>;
74
+ error: z.ZodOptional<z.ZodUnknown>;
75
+ }, z.ZodTypeAny, "passthrough">>;
76
+ export declare const mcpTaskAcknowledgementSchema: z.ZodObject<{
77
+ resultType: z.ZodLiteral<"complete">;
78
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
79
+ resultType: z.ZodLiteral<"complete">;
80
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
81
+ resultType: z.ZodLiteral<"complete">;
82
+ }, z.ZodTypeAny, "passthrough">>;
83
+ export type McpConsumerTaskStart = z.infer<typeof mcpTaskStartResultSchema>;
84
+ export type McpConsumerTask = z.infer<typeof mcpTaskResultSchema>;
85
+ export type McpConsumerTaskAcknowledgement = z.infer<typeof mcpTaskAcknowledgementSchema>;
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod/v3';
2
+ /** Credential-free tuning snapshot. Output aliases are canonicalized to max_tokens at issuance. */
3
+ export declare const modelExecutionParametersSchema: z.ZodObject<{
4
+ temperature: z.ZodOptional<z.ZodNumber>;
5
+ top_p: z.ZodOptional<z.ZodNumber>;
6
+ top_k: z.ZodOptional<z.ZodNumber>;
7
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
8
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
9
+ repetition_penalty: z.ZodOptional<z.ZodNumber>;
10
+ seed: z.ZodOptional<z.ZodNumber>;
11
+ max_tokens: z.ZodOptional<z.ZodNumber>;
12
+ enable_thinking: z.ZodOptional<z.ZodBoolean>;
13
+ thinking_budget: z.ZodOptional<z.ZodNumber>;
14
+ reasoning_effort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high", "xhigh", "max"]>>;
15
+ thinking: z.ZodOptional<z.ZodEnum<["enabled", "disabled", "adaptive"]>>;
16
+ budget_tokens: z.ZodOptional<z.ZodNumber>;
17
+ }, "strict", z.ZodTypeAny, {
18
+ max_tokens?: number;
19
+ temperature?: number;
20
+ top_p?: number;
21
+ top_k?: number;
22
+ presence_penalty?: number;
23
+ frequency_penalty?: number;
24
+ repetition_penalty?: number;
25
+ seed?: number;
26
+ enable_thinking?: boolean;
27
+ thinking_budget?: number;
28
+ reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
29
+ thinking?: "disabled" | "enabled" | "adaptive";
30
+ budget_tokens?: number;
31
+ }, {
32
+ max_tokens?: number;
33
+ temperature?: number;
34
+ top_p?: number;
35
+ top_k?: number;
36
+ presence_penalty?: number;
37
+ frequency_penalty?: number;
38
+ repetition_penalty?: number;
39
+ seed?: number;
40
+ enable_thinking?: boolean;
41
+ thinking_budget?: number;
42
+ reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
43
+ thinking?: "disabled" | "enabled" | "adaptive";
44
+ budget_tokens?: number;
45
+ }>;
46
+ export type ModelExecutionParameters = z.output<typeof modelExecutionParametersSchema>;
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod/v3';
2
2
  import type { AiModelTypeEnum } from '../agent';
3
3
  import type { ModelFeature } from './ai-model.model';
4
+ import type { ModelExecutionParameters } from './model-execution-parameters.model';
4
5
  /** Entry point and execution location are independent dimensions. */
5
6
  export type ModelExecutionEntry = 'cli' | 'agent_runtime' | 'shell';
6
7
  export type ModelExecutionProtocol = 'openai_chat' | 'openai_responses' | 'anthropic_messages' | 'openai_responses_chat' | 'anthropic_messages_chat';
@@ -43,6 +44,8 @@ export interface ModelExecutionModel {
43
44
  model: string;
44
45
  modelType: AiModelTypeEnum.LLM;
45
46
  capabilities: ModelFeature[];
47
+ /** Validated non-secret Assistant parameters frozen at grant issuance; absent on legacy grants. */
48
+ parameters?: ModelExecutionParameters;
46
49
  /** Provider catalog context window; a CLI hint, not an execution policy limit. */
47
50
  contextWindow?: number;
48
51
  /** Provider catalog maximum output; a CLI hint, never an additional execution cap. */
@@ -86,7 +89,7 @@ export type ModelExecutionPolicy = {
86
89
  /** @deprecated Compatibility field, always true; no longer a tenant opt-in switch. */
87
90
  enabled: true;
88
91
  gatewayBaseUrl: string;
89
- /** Separately gated until each native protocol has passed real-model acceptance. */
92
+ /** Defaults to native Responses; explicit lists (including []) override it. Native Messages remains opt-in. */
90
93
  nativeProtocols?: Array<'openai_responses' | 'anthropic_messages'>;
91
94
  /** Explicit, limited Chat Completions translations; never advertised as native support. */
92
95
  chatBridgeProtocols?: Array<'openai_responses' | 'anthropic_messages'>;