@xenosystem/agent-sdk 0.10.31 → 0.10.33
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/README.md +1 -1
- package/dist/artifacts/index.cjs +1 -1
- package/dist/artifacts/index.js +1 -1
- package/dist/automation/index.cjs +1 -1
- package/dist/automation/index.d.cts +14 -0
- package/dist/automation/index.d.ts +14 -0
- package/dist/automation/index.js +1 -1
- package/dist/control-plane/index.cjs +1 -1
- package/dist/control-plane/index.js +1 -1
- package/dist/electron/index.cjs +211 -198
- package/dist/electron/index.d.cts +60 -5
- package/dist/electron/index.d.ts +60 -5
- package/dist/electron/index.js +211 -198
- package/dist/electron/metafile-cjs.json +1 -1
- package/dist/electron/metafile-esm.json +1 -1
- package/dist/governance/index.cjs +24 -24
- package/dist/governance/index.js +24 -24
- package/dist/governance/metafile-cjs.json +1 -1
- package/dist/governance/metafile-esm.json +1 -1
- package/dist/hooks/index.cjs +4 -4
- package/dist/hooks/index.d.cts +18 -0
- package/dist/hooks/index.d.ts +18 -0
- package/dist/hooks/index.js +4 -4
- package/dist/hooks/metafile-cjs.json +1 -1
- package/dist/hooks/metafile-esm.json +1 -1
- package/dist/hosted/index.cjs +1 -1
- package/dist/hosted/index.d.cts +21 -3
- package/dist/hosted/index.d.ts +21 -3
- package/dist/hosted/index.js +1 -1
- package/dist/hosted/metafile-cjs.json +1 -1
- package/dist/hosted/metafile-esm.json +1 -1
- package/dist/index.cjs +420 -384
- package/dist/index.d.cts +331 -30
- package/dist/index.d.ts +331 -30
- package/dist/index.js +422 -386
- package/dist/mcp/index.cjs +21 -21
- package/dist/mcp/index.d.cts +253 -186
- package/dist/mcp/index.d.ts +253 -186
- package/dist/mcp/index.js +21 -21
- package/dist/mcp/metafile-cjs.json +1 -1
- package/dist/mcp/metafile-esm.json +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/session/index.cjs +15 -15
- package/dist/session/index.js +12 -12
- package/dist/session/metafile-cjs.json +1 -1
- package/dist/session/metafile-esm.json +1 -1
- package/dist/skills/index.d.cts +14 -0
- package/dist/skills/index.d.ts +14 -0
- package/package.json +2 -2
package/dist/mcp/index.d.ts
CHANGED
|
@@ -38,6 +38,202 @@ interface PermissionProfile {
|
|
|
38
38
|
startProcesses: PermissionProfileDecision;
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
+
declare const WEB_CONTEXT_TOOL_RESULT_SCHEMA: "xeno.web-context.tool-result.v1";
|
|
42
|
+
interface WebContextEvidenceProjection {
|
|
43
|
+
evidenceId: string;
|
|
44
|
+
requestId: string;
|
|
45
|
+
sourceUrl: string;
|
|
46
|
+
finalUrl?: string;
|
|
47
|
+
citations: Array<{
|
|
48
|
+
url: string;
|
|
49
|
+
title?: string;
|
|
50
|
+
artifactId?: string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
interface WebContextToolResult {
|
|
54
|
+
schemaVersion: typeof WEB_CONTEXT_TOOL_RESULT_SCHEMA;
|
|
55
|
+
operation: "search" | "fetch";
|
|
56
|
+
requestId: string;
|
|
57
|
+
evidence: WebContextEvidenceProjection;
|
|
58
|
+
job?: {
|
|
59
|
+
jobId: string;
|
|
60
|
+
state: string;
|
|
61
|
+
};
|
|
62
|
+
artifact?: {
|
|
63
|
+
artifactId: string;
|
|
64
|
+
mediaType: string;
|
|
65
|
+
bytes: number;
|
|
66
|
+
};
|
|
67
|
+
jobProgress?: WebJobProgress;
|
|
68
|
+
}
|
|
69
|
+
interface ToolDefinition {
|
|
70
|
+
name: string;
|
|
71
|
+
description: string;
|
|
72
|
+
input_schema: {
|
|
73
|
+
type: "object";
|
|
74
|
+
properties: Record<string, unknown>;
|
|
75
|
+
required?: string[];
|
|
76
|
+
additionalProperties?: boolean | Record<string, unknown>;
|
|
77
|
+
[keyword: string]: unknown;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
interface ImageUrlBlock {
|
|
81
|
+
type: "image_url";
|
|
82
|
+
image_url: {
|
|
83
|
+
url: string;
|
|
84
|
+
detail?: "auto" | "low" | "high";
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
interface ResourceContentBlock {
|
|
88
|
+
type: "resource";
|
|
89
|
+
uri?: string;
|
|
90
|
+
mimeType?: string;
|
|
91
|
+
text?: string;
|
|
92
|
+
data?: string;
|
|
93
|
+
}
|
|
94
|
+
type ToolAssistantContentBlock = TextBlock | ImageUrlBlock | ResourceContentBlock;
|
|
95
|
+
declare const TOOL_OPERATION_TERMINAL_STATES: readonly [
|
|
96
|
+
"completed",
|
|
97
|
+
"failed",
|
|
98
|
+
"timed_out",
|
|
99
|
+
"cancelled",
|
|
100
|
+
"outcome_unknown",
|
|
101
|
+
"orphaned"
|
|
102
|
+
];
|
|
103
|
+
type ToolOperationTerminalState = (typeof TOOL_OPERATION_TERMINAL_STATES)[number];
|
|
104
|
+
type ToolOperationState = "registered" | "starting" | "running_foreground" | "running_background" | "waiting_for_input" | "stalled" | "verifying" | ToolOperationTerminalState;
|
|
105
|
+
type ToolCompletionPolicy = "await" | "observe" | "detach";
|
|
106
|
+
interface ExpectedOutputContract {
|
|
107
|
+
path: string;
|
|
108
|
+
kind?: "file" | "directory";
|
|
109
|
+
nonEmpty?: boolean;
|
|
110
|
+
}
|
|
111
|
+
interface ToolEvidence {
|
|
112
|
+
id: string;
|
|
113
|
+
kind: "artifact" | "process" | "verification";
|
|
114
|
+
status: "pending" | "verified" | "failed";
|
|
115
|
+
path?: string;
|
|
116
|
+
observedAt: string;
|
|
117
|
+
operationId: string;
|
|
118
|
+
detail?: Record<string, string | number | boolean | null>;
|
|
119
|
+
}
|
|
120
|
+
interface ToolOperationSnapshot {
|
|
121
|
+
schemaVersion: 1;
|
|
122
|
+
operationId: string;
|
|
123
|
+
turnId: string;
|
|
124
|
+
generation: number;
|
|
125
|
+
toolCallId: string;
|
|
126
|
+
toolName: string;
|
|
127
|
+
ownerSessionId?: string;
|
|
128
|
+
state: ToolOperationState;
|
|
129
|
+
terminal: boolean;
|
|
130
|
+
presentation: "foreground" | "background";
|
|
131
|
+
completionPolicy: ToolCompletionPolicy;
|
|
132
|
+
promotable: boolean;
|
|
133
|
+
processId?: string;
|
|
134
|
+
taskId?: string;
|
|
135
|
+
displayName?: string;
|
|
136
|
+
pid?: number;
|
|
137
|
+
commandFingerprint?: string;
|
|
138
|
+
outputPath?: string;
|
|
139
|
+
startedAt: string;
|
|
140
|
+
lastActivityAt: string;
|
|
141
|
+
deadlineAt?: string;
|
|
142
|
+
elapsedMs: number;
|
|
143
|
+
idleMs: number;
|
|
144
|
+
outputBytes: number;
|
|
145
|
+
nextOffset: number;
|
|
146
|
+
exitCode?: number | null;
|
|
147
|
+
completionReason?: string;
|
|
148
|
+
suggestedNextAction?: string;
|
|
149
|
+
expectedOutputs?: ExpectedOutputContract[];
|
|
150
|
+
evidence?: ToolEvidence[];
|
|
151
|
+
}
|
|
152
|
+
interface ToolProgressUpdate {
|
|
153
|
+
activity?: "stdout" | "stderr" | "input" | "waiting_for_input" | "heartbeat" | "state";
|
|
154
|
+
message?: string;
|
|
155
|
+
bytes?: number;
|
|
156
|
+
outputBytes?: number;
|
|
157
|
+
nextOffset?: number;
|
|
158
|
+
webContextProgress?: WebJobProgress;
|
|
159
|
+
}
|
|
160
|
+
interface ToolAuthorizationReceipt {
|
|
161
|
+
turnId: string;
|
|
162
|
+
toolCallId: string;
|
|
163
|
+
toolName: string;
|
|
164
|
+
iteration: number;
|
|
165
|
+
policy: {
|
|
166
|
+
allowed: true;
|
|
167
|
+
reason: string;
|
|
168
|
+
temporaryOverride: boolean;
|
|
169
|
+
};
|
|
170
|
+
permission: {
|
|
171
|
+
allowed: true;
|
|
172
|
+
reason: string;
|
|
173
|
+
};
|
|
174
|
+
elevation?: {
|
|
175
|
+
network: boolean;
|
|
176
|
+
directories: string[];
|
|
177
|
+
justification: string;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
interface ToolResult {
|
|
181
|
+
success: boolean;
|
|
182
|
+
output: string;
|
|
183
|
+
error?: string;
|
|
184
|
+
errorCode?: string;
|
|
185
|
+
errorDetails?: Record<string, unknown>;
|
|
186
|
+
assistantContent?: ToolAssistantContentBlock[];
|
|
187
|
+
assistantOnlyContent?: ToolAssistantContentBlock[];
|
|
188
|
+
operation?: ToolOperationSnapshot;
|
|
189
|
+
evidence?: ToolEvidence[];
|
|
190
|
+
webContext?: WebContextToolResult;
|
|
191
|
+
retryable?: boolean;
|
|
192
|
+
}
|
|
193
|
+
interface ToolExecutionContext {
|
|
194
|
+
signal?: AbortSignal;
|
|
195
|
+
operationId?: string;
|
|
196
|
+
reportProgress?: (event: ToolProgressUpdate) => void;
|
|
197
|
+
authorization?: ToolAuthorizationReceipt;
|
|
198
|
+
ownerSessionId?: string;
|
|
199
|
+
}
|
|
200
|
+
interface ToolPolicyProjectionContext {
|
|
201
|
+
ownerSessionId?: string;
|
|
202
|
+
}
|
|
203
|
+
type ToolExecutor = (input: Record<string, unknown>, context?: ToolExecutionContext) => Promise<ToolResult>;
|
|
204
|
+
interface ToolPolicyProjection {
|
|
205
|
+
observabilityInput: Record<string, unknown>;
|
|
206
|
+
permissionInput: Record<string, unknown>;
|
|
207
|
+
permissionPreview?: string;
|
|
208
|
+
approvalKey?: string;
|
|
209
|
+
riskLevel?: "low" | "medium" | "high";
|
|
210
|
+
}
|
|
211
|
+
interface ToolAnnotationHints {
|
|
212
|
+
title?: string;
|
|
213
|
+
readOnlyHint?: boolean;
|
|
214
|
+
destructiveHint?: boolean;
|
|
215
|
+
idempotentHint?: boolean;
|
|
216
|
+
openWorldHint?: boolean;
|
|
217
|
+
}
|
|
218
|
+
interface ToolOrigin {
|
|
219
|
+
kind: "mcp";
|
|
220
|
+
server: string;
|
|
221
|
+
tool: string;
|
|
222
|
+
}
|
|
223
|
+
interface RegisteredTool {
|
|
224
|
+
definition: ToolDefinition;
|
|
225
|
+
execute: ToolExecutor;
|
|
226
|
+
readOnly?: boolean;
|
|
227
|
+
annotations?: ToolAnnotationHints;
|
|
228
|
+
origin?: ToolOrigin;
|
|
229
|
+
projectPolicyInput?: (input: Record<string, unknown>, context?: ToolPolicyProjectionContext) => ToolPolicyProjection | {
|
|
230
|
+
error: ToolResult;
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
interface TextBlock {
|
|
234
|
+
type: "text";
|
|
235
|
+
text: string;
|
|
236
|
+
}
|
|
41
237
|
declare const MCP_APPS_EXTENSION_ID: "io.modelcontextprotocol/ui";
|
|
42
238
|
declare const MCP_APP_RESOURCE_SCHEME: "ui:";
|
|
43
239
|
declare const MCP_APP_MIME_TYPE: "text/html;profile=mcp-app";
|
|
@@ -136,6 +332,7 @@ interface MCPTool {
|
|
|
136
332
|
description: string;
|
|
137
333
|
inputSchema: Record<string, unknown>;
|
|
138
334
|
server: string;
|
|
335
|
+
annotations?: ToolAnnotationHints;
|
|
139
336
|
_meta?: MCPAppExtensionMetadata;
|
|
140
337
|
appResourceUri?: string;
|
|
141
338
|
visibility: MCPAppVisibility[];
|
|
@@ -232,6 +429,7 @@ interface MCPToolsListResult {
|
|
|
232
429
|
name: string;
|
|
233
430
|
description?: string;
|
|
234
431
|
inputSchema: Record<string, unknown>;
|
|
432
|
+
annotations?: Record<string, unknown>;
|
|
235
433
|
_meta?: MCPAppExtensionMetadata;
|
|
236
434
|
}>;
|
|
237
435
|
}
|
|
@@ -327,6 +525,7 @@ interface MCPElicitationRequest {
|
|
|
327
525
|
message: string;
|
|
328
526
|
requestedSchema?: Record<string, unknown>;
|
|
329
527
|
params: Record<string, unknown>;
|
|
528
|
+
signal?: AbortSignal;
|
|
330
529
|
}
|
|
331
530
|
interface MCPElicitationResponse {
|
|
332
531
|
action: MCPElicitationAction;
|
|
@@ -372,6 +571,7 @@ interface ConnectConfiguredMCPServersResult {
|
|
|
372
571
|
name: string;
|
|
373
572
|
error: string;
|
|
374
573
|
}>;
|
|
574
|
+
disconnected?: string[];
|
|
375
575
|
}
|
|
376
576
|
interface MCPServerPromptRegistration {
|
|
377
577
|
name: string;
|
|
@@ -403,6 +603,29 @@ interface MCPServerModeOptions {
|
|
|
403
603
|
toolMetadata?: Record<string, MCPAppExtensionMetadata>;
|
|
404
604
|
appCapabilities?: MCPAppCapabilities | false;
|
|
405
605
|
}
|
|
606
|
+
declare const MCP_MAX_CATALOG_ENTRIES = 4096;
|
|
607
|
+
type MCPConnectionErrorCode = "MCP_CONNECTION_CLOSED" | "MCP_TRANSPORT_FAILED" | "MCP_SERVER_NOT_READY" | "MCP_SERVER_NOT_FOUND";
|
|
608
|
+
declare class MCPConnectionError extends Error {
|
|
609
|
+
readonly code: MCPConnectionErrorCode;
|
|
610
|
+
readonly serverName: string;
|
|
611
|
+
readonly details: {
|
|
612
|
+
method?: string;
|
|
613
|
+
status?: MCPServerState["status"];
|
|
614
|
+
cause?: unknown;
|
|
615
|
+
};
|
|
616
|
+
constructor(message: string, code: MCPConnectionErrorCode, serverName: string, details?: {
|
|
617
|
+
method?: string;
|
|
618
|
+
status?: MCPServerState["status"];
|
|
619
|
+
cause?: unknown;
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
type MCPCatalogErrorCode = "MCP_CATALOG_MALFORMED" | "MCP_CATALOG_TOO_LARGE";
|
|
623
|
+
declare class MCPCatalogError extends Error {
|
|
624
|
+
readonly code: MCPCatalogErrorCode;
|
|
625
|
+
readonly serverName: string;
|
|
626
|
+
readonly method: string;
|
|
627
|
+
constructor(message: string, code: MCPCatalogErrorCode, serverName: string, method: string);
|
|
628
|
+
}
|
|
406
629
|
type MCPServerChangeReason = "connected" | "disconnected" | "tools_changed" | "prompts_changed" | "resources_changed" | "resource_updated" | "error";
|
|
407
630
|
interface MCPServerChangeEvent {
|
|
408
631
|
serverName: string;
|
|
@@ -428,6 +651,8 @@ declare class MCPManager {
|
|
|
428
651
|
addServer(config: MCPServerConfig): Promise<void>;
|
|
429
652
|
connectConfiguredServers(options: ConnectConfiguredMCPServersOptions): Promise<ConnectConfiguredMCPServersResult>;
|
|
430
653
|
removeServer(name: string): void;
|
|
654
|
+
private dropEntry;
|
|
655
|
+
private rejectPendingFor;
|
|
431
656
|
listTools(serverName?: string): MCPTool[];
|
|
432
657
|
listAllTools(serverName?: string): MCPTool[];
|
|
433
658
|
listAppTools(serverName?: string): MCPTool[];
|
|
@@ -446,6 +671,11 @@ declare class MCPManager {
|
|
|
446
671
|
static loadConfiguredServers(cwd?: string): MCPConfiguredServer[];
|
|
447
672
|
private createTransport;
|
|
448
673
|
private discoverServerState;
|
|
674
|
+
private rediscover;
|
|
675
|
+
private resubscribe;
|
|
676
|
+
private runRefresh;
|
|
677
|
+
private fetchCatalog;
|
|
678
|
+
private isCurrentRefresh;
|
|
449
679
|
private refreshTools;
|
|
450
680
|
private refreshPrompts;
|
|
451
681
|
private refreshResources;
|
|
@@ -453,197 +683,18 @@ declare class MCPManager {
|
|
|
453
683
|
private getReadyServer;
|
|
454
684
|
private sendRequest;
|
|
455
685
|
private sendNotification;
|
|
686
|
+
private answer;
|
|
456
687
|
private sendResponse;
|
|
457
688
|
private sendError;
|
|
458
689
|
private handleMessage;
|
|
459
690
|
private handleRequest;
|
|
460
691
|
private handleElicitationCreate;
|
|
461
692
|
private handleNotification;
|
|
693
|
+
private failRefresh;
|
|
694
|
+
private settleCatalogFault;
|
|
462
695
|
private resolveApprovalDecision;
|
|
463
696
|
private emitServerStateChanged;
|
|
464
697
|
}
|
|
465
|
-
declare const WEB_CONTEXT_TOOL_RESULT_SCHEMA: "xeno.web-context.tool-result.v1";
|
|
466
|
-
interface WebContextEvidenceProjection {
|
|
467
|
-
evidenceId: string;
|
|
468
|
-
requestId: string;
|
|
469
|
-
sourceUrl: string;
|
|
470
|
-
finalUrl?: string;
|
|
471
|
-
citations: Array<{
|
|
472
|
-
url: string;
|
|
473
|
-
title?: string;
|
|
474
|
-
artifactId?: string;
|
|
475
|
-
}>;
|
|
476
|
-
}
|
|
477
|
-
interface WebContextToolResult {
|
|
478
|
-
schemaVersion: typeof WEB_CONTEXT_TOOL_RESULT_SCHEMA;
|
|
479
|
-
operation: "search" | "fetch";
|
|
480
|
-
requestId: string;
|
|
481
|
-
evidence: WebContextEvidenceProjection;
|
|
482
|
-
job?: {
|
|
483
|
-
jobId: string;
|
|
484
|
-
state: string;
|
|
485
|
-
};
|
|
486
|
-
artifact?: {
|
|
487
|
-
artifactId: string;
|
|
488
|
-
mediaType: string;
|
|
489
|
-
bytes: number;
|
|
490
|
-
};
|
|
491
|
-
jobProgress?: WebJobProgress;
|
|
492
|
-
}
|
|
493
|
-
interface ToolDefinition {
|
|
494
|
-
name: string;
|
|
495
|
-
description: string;
|
|
496
|
-
input_schema: {
|
|
497
|
-
type: "object";
|
|
498
|
-
properties: Record<string, unknown>;
|
|
499
|
-
required?: string[];
|
|
500
|
-
additionalProperties?: boolean | Record<string, unknown>;
|
|
501
|
-
[keyword: string]: unknown;
|
|
502
|
-
};
|
|
503
|
-
}
|
|
504
|
-
interface ImageUrlBlock {
|
|
505
|
-
type: "image_url";
|
|
506
|
-
image_url: {
|
|
507
|
-
url: string;
|
|
508
|
-
detail?: "auto" | "low" | "high";
|
|
509
|
-
};
|
|
510
|
-
}
|
|
511
|
-
interface ResourceContentBlock {
|
|
512
|
-
type: "resource";
|
|
513
|
-
uri?: string;
|
|
514
|
-
mimeType?: string;
|
|
515
|
-
text?: string;
|
|
516
|
-
data?: string;
|
|
517
|
-
}
|
|
518
|
-
type ToolAssistantContentBlock = TextBlock | ImageUrlBlock | ResourceContentBlock;
|
|
519
|
-
declare const TOOL_OPERATION_TERMINAL_STATES: readonly [
|
|
520
|
-
"completed",
|
|
521
|
-
"failed",
|
|
522
|
-
"timed_out",
|
|
523
|
-
"cancelled",
|
|
524
|
-
"outcome_unknown",
|
|
525
|
-
"orphaned"
|
|
526
|
-
];
|
|
527
|
-
type ToolOperationTerminalState = (typeof TOOL_OPERATION_TERMINAL_STATES)[number];
|
|
528
|
-
type ToolOperationState = "registered" | "starting" | "running_foreground" | "running_background" | "waiting_for_input" | "stalled" | "verifying" | ToolOperationTerminalState;
|
|
529
|
-
type ToolCompletionPolicy = "await" | "observe" | "detach";
|
|
530
|
-
interface ExpectedOutputContract {
|
|
531
|
-
path: string;
|
|
532
|
-
kind?: "file" | "directory";
|
|
533
|
-
nonEmpty?: boolean;
|
|
534
|
-
}
|
|
535
|
-
interface ToolEvidence {
|
|
536
|
-
id: string;
|
|
537
|
-
kind: "artifact" | "process" | "verification";
|
|
538
|
-
status: "pending" | "verified" | "failed";
|
|
539
|
-
path?: string;
|
|
540
|
-
observedAt: string;
|
|
541
|
-
operationId: string;
|
|
542
|
-
detail?: Record<string, string | number | boolean | null>;
|
|
543
|
-
}
|
|
544
|
-
interface ToolOperationSnapshot {
|
|
545
|
-
schemaVersion: 1;
|
|
546
|
-
operationId: string;
|
|
547
|
-
turnId: string;
|
|
548
|
-
generation: number;
|
|
549
|
-
toolCallId: string;
|
|
550
|
-
toolName: string;
|
|
551
|
-
ownerSessionId?: string;
|
|
552
|
-
state: ToolOperationState;
|
|
553
|
-
terminal: boolean;
|
|
554
|
-
presentation: "foreground" | "background";
|
|
555
|
-
completionPolicy: ToolCompletionPolicy;
|
|
556
|
-
promotable: boolean;
|
|
557
|
-
processId?: string;
|
|
558
|
-
taskId?: string;
|
|
559
|
-
displayName?: string;
|
|
560
|
-
pid?: number;
|
|
561
|
-
commandFingerprint?: string;
|
|
562
|
-
outputPath?: string;
|
|
563
|
-
startedAt: string;
|
|
564
|
-
lastActivityAt: string;
|
|
565
|
-
deadlineAt?: string;
|
|
566
|
-
elapsedMs: number;
|
|
567
|
-
idleMs: number;
|
|
568
|
-
outputBytes: number;
|
|
569
|
-
nextOffset: number;
|
|
570
|
-
exitCode?: number | null;
|
|
571
|
-
completionReason?: string;
|
|
572
|
-
suggestedNextAction?: string;
|
|
573
|
-
expectedOutputs?: ExpectedOutputContract[];
|
|
574
|
-
evidence?: ToolEvidence[];
|
|
575
|
-
}
|
|
576
|
-
interface ToolProgressUpdate {
|
|
577
|
-
activity?: "stdout" | "stderr" | "input" | "waiting_for_input" | "heartbeat" | "state";
|
|
578
|
-
message?: string;
|
|
579
|
-
bytes?: number;
|
|
580
|
-
outputBytes?: number;
|
|
581
|
-
nextOffset?: number;
|
|
582
|
-
webContextProgress?: WebJobProgress;
|
|
583
|
-
}
|
|
584
|
-
interface ToolAuthorizationReceipt {
|
|
585
|
-
turnId: string;
|
|
586
|
-
toolCallId: string;
|
|
587
|
-
toolName: string;
|
|
588
|
-
iteration: number;
|
|
589
|
-
policy: {
|
|
590
|
-
allowed: true;
|
|
591
|
-
reason: string;
|
|
592
|
-
temporaryOverride: boolean;
|
|
593
|
-
};
|
|
594
|
-
permission: {
|
|
595
|
-
allowed: true;
|
|
596
|
-
reason: string;
|
|
597
|
-
};
|
|
598
|
-
elevation?: {
|
|
599
|
-
network: boolean;
|
|
600
|
-
directories: string[];
|
|
601
|
-
justification: string;
|
|
602
|
-
};
|
|
603
|
-
}
|
|
604
|
-
interface ToolResult {
|
|
605
|
-
success: boolean;
|
|
606
|
-
output: string;
|
|
607
|
-
error?: string;
|
|
608
|
-
errorCode?: string;
|
|
609
|
-
errorDetails?: Record<string, unknown>;
|
|
610
|
-
assistantContent?: ToolAssistantContentBlock[];
|
|
611
|
-
assistantOnlyContent?: ToolAssistantContentBlock[];
|
|
612
|
-
operation?: ToolOperationSnapshot;
|
|
613
|
-
evidence?: ToolEvidence[];
|
|
614
|
-
webContext?: WebContextToolResult;
|
|
615
|
-
retryable?: boolean;
|
|
616
|
-
}
|
|
617
|
-
interface ToolExecutionContext {
|
|
618
|
-
signal?: AbortSignal;
|
|
619
|
-
operationId?: string;
|
|
620
|
-
reportProgress?: (event: ToolProgressUpdate) => void;
|
|
621
|
-
authorization?: ToolAuthorizationReceipt;
|
|
622
|
-
ownerSessionId?: string;
|
|
623
|
-
}
|
|
624
|
-
interface ToolPolicyProjectionContext {
|
|
625
|
-
ownerSessionId?: string;
|
|
626
|
-
}
|
|
627
|
-
type ToolExecutor = (input: Record<string, unknown>, context?: ToolExecutionContext) => Promise<ToolResult>;
|
|
628
|
-
interface ToolPolicyProjection {
|
|
629
|
-
observabilityInput: Record<string, unknown>;
|
|
630
|
-
permissionInput: Record<string, unknown>;
|
|
631
|
-
permissionPreview?: string;
|
|
632
|
-
approvalKey?: string;
|
|
633
|
-
riskLevel?: "low" | "medium" | "high";
|
|
634
|
-
}
|
|
635
|
-
interface RegisteredTool {
|
|
636
|
-
definition: ToolDefinition;
|
|
637
|
-
execute: ToolExecutor;
|
|
638
|
-
readOnly?: boolean;
|
|
639
|
-
projectPolicyInput?: (input: Record<string, unknown>, context?: ToolPolicyProjectionContext) => ToolPolicyProjection | {
|
|
640
|
-
error: ToolResult;
|
|
641
|
-
};
|
|
642
|
-
}
|
|
643
|
-
interface TextBlock {
|
|
644
|
-
type: "text";
|
|
645
|
-
text: string;
|
|
646
|
-
}
|
|
647
698
|
interface ToolRegistryOptions {
|
|
648
699
|
validateInputs?: boolean;
|
|
649
700
|
toolSchemaMode?: "all" | "demand";
|
|
@@ -751,6 +802,9 @@ declare class StdioTransport implements MCPTransportConnection {
|
|
|
751
802
|
private onError;
|
|
752
803
|
private onClose;
|
|
753
804
|
private closed;
|
|
805
|
+
private exited;
|
|
806
|
+
private inputBroken;
|
|
807
|
+
private killTimer;
|
|
754
808
|
constructor(process: ChildProcess, options?: {
|
|
755
809
|
maxMessageChars?: number;
|
|
756
810
|
});
|
|
@@ -761,6 +815,7 @@ declare class StdioTransport implements MCPTransportConnection {
|
|
|
761
815
|
send(message: JsonRpcMessage): void;
|
|
762
816
|
close(): void;
|
|
763
817
|
get isAlive(): boolean;
|
|
818
|
+
private get hasExited();
|
|
764
819
|
private setupListeners;
|
|
765
820
|
private receive;
|
|
766
821
|
private refuseOversized;
|
|
@@ -857,11 +912,16 @@ declare class StreamableHTTPTransport implements MCPTransportConnection {
|
|
|
857
912
|
private receiveLoopActive;
|
|
858
913
|
private reinitializePromise?;
|
|
859
914
|
private challengeHeaders?;
|
|
915
|
+
private onSessionRenewed;
|
|
916
|
+
private onSessionLost;
|
|
860
917
|
private readonly seenEventIds;
|
|
861
918
|
constructor(url: string, options?: StreamableHTTPTransportOptions);
|
|
862
919
|
setMessageHandler(handler: MessageHandler): void;
|
|
863
920
|
setErrorHandler(handler: ErrorHandler): void;
|
|
864
921
|
setCloseHandler(handler: CloseHandler): void;
|
|
922
|
+
setSessionRenewedHandler(handler: () => void): void;
|
|
923
|
+
setSessionLostHandler(handler: () => void): void;
|
|
924
|
+
private markSessionExpired;
|
|
865
925
|
send(message: JsonRpcMessage): Promise<void>;
|
|
866
926
|
close(): void;
|
|
867
927
|
get isAlive(): boolean;
|
|
@@ -1019,6 +1079,12 @@ declare class MCPOAuthClient {
|
|
|
1019
1079
|
type PersistentMcpScope = Exclude<MCPServerScope, "session">;
|
|
1020
1080
|
declare function loadMcpConfigFile(configPath: string, scope?: PersistentMcpScope): MCPConfigFile;
|
|
1021
1081
|
declare function saveMcpConfigFile(configPath: string, config: MCPConfigFile, scope?: PersistentMcpScope): void;
|
|
1082
|
+
interface MCPConfigSource {
|
|
1083
|
+
scope: Exclude<MCPServerScope, "session">;
|
|
1084
|
+
path: string;
|
|
1085
|
+
state: "absent" | "readable" | "unreadable";
|
|
1086
|
+
}
|
|
1087
|
+
declare function inspectMcpConfigSources(cwd?: string): MCPConfigSource[];
|
|
1022
1088
|
declare function loadConfiguredMcpServers(cwd?: string): MCPConfiguredServer[];
|
|
1023
1089
|
declare function upsertMcpServerConfig(scope: PersistentMcpScope, cwd: string | undefined, config: MCPServerConfig): string;
|
|
1024
1090
|
declare function removeMcpServerConfig(scope: PersistentMcpScope, cwd: string | undefined, name: string): string;
|
|
@@ -1042,8 +1108,9 @@ declare function getMcpToolName(serverName: string, toolName: string): string;
|
|
|
1042
1108
|
declare function getMcpPromptToolName(serverName: string, promptName: string): string;
|
|
1043
1109
|
declare function getMcpResourceToolName(serverName: string, resource: MCPResource): string;
|
|
1044
1110
|
declare function mcpInputSchemaToToolSchema(inputSchema: Record<string, unknown> | undefined): ToolDefinition["input_schema"];
|
|
1045
|
-
declare function
|
|
1046
|
-
declare function
|
|
1047
|
-
declare function
|
|
1111
|
+
declare function getMcpDefinitionFingerprint(kind: MCPRegistryEntryKind, entry: MCPTool | MCPPrompt | MCPResource): string;
|
|
1112
|
+
declare function createMcpRegisteredTool(manager: MCPManager, tool: MCPTool, registryName?: string): RegisteredTool;
|
|
1113
|
+
declare function createMcpPromptRegisteredTool(manager: MCPManager, prompt: MCPPrompt, registryName?: string): RegisteredTool;
|
|
1114
|
+
declare function createMcpResourceRegisteredTool(manager: MCPManager, resource: MCPResource, registryName?: string): RegisteredTool;
|
|
1048
1115
|
declare function syncMcpToolsToRegistry(manager: MCPManager, registry: ToolRegistry, previouslyRegistered?: string[], filter?: MCPRegistryFilter): string[];
|
|
1049
|
-
export { type ConnectConfiguredMCPServersOptions, type ConnectConfiguredMCPServersResult, type ExchangeMCPOAuthCodeOptions, type JsonRpcErrorResponse, type JsonRpcMessage, type JsonRpcNotification, type JsonRpcRequest, type JsonRpcResponse, type JsonRpcSuccessResponse, type MCPAppCapabilities, type MCPAppContentSecurityPolicy, type MCPAppExtensionMetadata, type MCPAppMetadata, type MCPAppPermissions, type MCPAppResourceDescriptor, type MCPAppValidationResult, type MCPAppVisibility, type MCPApprovalDecision, type MCPBearerTokenRefreshHandler, type MCPBearerTokenResolver, type MCPConfigFile, type MCPConfiguredServer, type MCPElicitationAction, type MCPElicitationHandler, type MCPElicitationRequest, type MCPElicitationResponse, type MCPHttpAuthChallenge, MCPHttpTransportError, type MCPHttpUrlPhase, type MCPInitializeParams, type MCPInitializeResult, MCPManager, type MCPManagerOptions, MCPMessageTooLargeError, type MCPOAuthAuthorizationServerMetadata, type MCPOAuthAuthorizationSession, MCPOAuthClient, type MCPOAuthClientOptions, type MCPOAuthClientRegistration, type MCPOAuthClientRegistrationSource, type MCPOAuthConfig, type MCPOAuthDiscoveryResult, type MCPOAuthProtectedResourceMetadata, type MCPOAuthTokenSet, type MCPOAuthTokenStore, type MCPOAuthUrlPhase, type MCPPrompt, type MCPPromptGetParams, type MCPPromptGetResult, type MCPPromptsListResult, type MCPRegistryAccessPolicy, type MCPRegistryEntryDescriptor, type MCPRegistryEntryKind, type MCPRegistryFilter, type MCPResource, type MCPResourceReadParams, type MCPResourceReadResult, type MCPResourceSubscribeParams, type MCPResourceTemplate, type MCPResourceTemplatesListResult, type MCPResourceUnsubscribeParams, type MCPResourcesListResult, MCPServer, type MCPServerConfig, type MCPServerModeOptions, type MCPServerPromptRegistration, type MCPServerResourceRegistration, type MCPServerScope, type MCPServerState, type MCPTool, type MCPToolCallParams, type MCPToolCallResult, type MCPToolsListResult, type MCPTransport, type MCPTransportConnection, MCP_APPS_EXTENSION_ID, MCP_APP_MIME_TYPE, MCP_APP_RESOURCE_SCHEME, MCP_PROTOCOL_VERSION, MCP_STDIO_MAX_MESSAGE_CHARS, MCP_SUPPORTED_PROTOCOL_VERSIONS, type PrepareMCPOAuthAuthorizationOptions, SSETransport, StdioTransport, StreamableHTTPTransport, type StreamableHTTPTransportOptions, type StreamableHTTPTransportSnapshot, approveMcpServer, assertSupportedMcpProtocolVersion, assertValidMcpAppResource, canonicalizeMcpResourceUri, clearMcpServerApproval, createMcpAppCapabilities, createMcpAppExtensionCapabilities, createMcpPkcePair, createMcpPromptRegisteredTool, createMcpRegisteredTool, createMcpResourceRegisteredTool, denyMcpServer, getMcpAppMetadata, getMcpAppResourceUri, getMcpApprovalDecision, getMcpAuthorizationServerMetadataUrls, getMcpPromptToolName, getMcpProtectedResourceMetadataUrls, getMcpResourceToolName, getMcpToolName, isMcpAppResourceUri, isMcpOAuthTokenExpired, isMcpToolVisibleToApp, isMcpToolVisibleToModel, isSupportedMcpProtocolVersion, loadConfiguredMcpServers, loadMcpConfigFile, matchesMcpRegistryEntryPolicy, mcpInputSchemaToToolSchema, normalizeMcpAppVisibility, parseMcpWwwAuthenticate, removeMcpServerConfig, resetMcpServerApprovals, saveMcpConfigFile, syncMcpToolsToRegistry, upsertMcpServerConfig, validateMcpAppResource };
|
|
1116
|
+
export { type ConnectConfiguredMCPServersOptions, type ConnectConfiguredMCPServersResult, type ExchangeMCPOAuthCodeOptions, type JsonRpcErrorResponse, type JsonRpcMessage, type JsonRpcNotification, type JsonRpcRequest, type JsonRpcResponse, type JsonRpcSuccessResponse, type MCPAppCapabilities, type MCPAppContentSecurityPolicy, type MCPAppExtensionMetadata, type MCPAppMetadata, type MCPAppPermissions, type MCPAppResourceDescriptor, type MCPAppValidationResult, type MCPAppVisibility, type MCPApprovalDecision, type MCPBearerTokenRefreshHandler, type MCPBearerTokenResolver, MCPCatalogError, type MCPCatalogErrorCode, type MCPConfigFile, type MCPConfigSource, type MCPConfiguredServer, MCPConnectionError, type MCPConnectionErrorCode, type MCPElicitationAction, type MCPElicitationHandler, type MCPElicitationRequest, type MCPElicitationResponse, type MCPHttpAuthChallenge, MCPHttpTransportError, type MCPHttpUrlPhase, type MCPInitializeParams, type MCPInitializeResult, MCPManager, type MCPManagerOptions, MCPMessageTooLargeError, type MCPOAuthAuthorizationServerMetadata, type MCPOAuthAuthorizationSession, MCPOAuthClient, type MCPOAuthClientOptions, type MCPOAuthClientRegistration, type MCPOAuthClientRegistrationSource, type MCPOAuthConfig, type MCPOAuthDiscoveryResult, type MCPOAuthProtectedResourceMetadata, type MCPOAuthTokenSet, type MCPOAuthTokenStore, type MCPOAuthUrlPhase, type MCPPrompt, type MCPPromptGetParams, type MCPPromptGetResult, type MCPPromptsListResult, type MCPRegistryAccessPolicy, type MCPRegistryEntryDescriptor, type MCPRegistryEntryKind, type MCPRegistryFilter, type MCPResource, type MCPResourceReadParams, type MCPResourceReadResult, type MCPResourceSubscribeParams, type MCPResourceTemplate, type MCPResourceTemplatesListResult, type MCPResourceUnsubscribeParams, type MCPResourcesListResult, MCPServer, type MCPServerConfig, type MCPServerModeOptions, type MCPServerPromptRegistration, type MCPServerResourceRegistration, type MCPServerScope, type MCPServerState, type MCPTool, type MCPToolCallParams, type MCPToolCallResult, type MCPToolsListResult, type MCPTransport, type MCPTransportConnection, MCP_APPS_EXTENSION_ID, MCP_APP_MIME_TYPE, MCP_APP_RESOURCE_SCHEME, MCP_MAX_CATALOG_ENTRIES, MCP_PROTOCOL_VERSION, MCP_STDIO_MAX_MESSAGE_CHARS, MCP_SUPPORTED_PROTOCOL_VERSIONS, type PrepareMCPOAuthAuthorizationOptions, SSETransport, StdioTransport, StreamableHTTPTransport, type StreamableHTTPTransportOptions, type StreamableHTTPTransportSnapshot, approveMcpServer, assertSupportedMcpProtocolVersion, assertValidMcpAppResource, canonicalizeMcpResourceUri, clearMcpServerApproval, createMcpAppCapabilities, createMcpAppExtensionCapabilities, createMcpPkcePair, createMcpPromptRegisteredTool, createMcpRegisteredTool, createMcpResourceRegisteredTool, denyMcpServer, getMcpAppMetadata, getMcpAppResourceUri, getMcpApprovalDecision, getMcpAuthorizationServerMetadataUrls, getMcpDefinitionFingerprint, getMcpPromptToolName, getMcpProtectedResourceMetadataUrls, getMcpResourceToolName, getMcpToolName, inspectMcpConfigSources, isMcpAppResourceUri, isMcpOAuthTokenExpired, isMcpToolVisibleToApp, isMcpToolVisibleToModel, isSupportedMcpProtocolVersion, loadConfiguredMcpServers, loadMcpConfigFile, matchesMcpRegistryEntryPolicy, mcpInputSchemaToToolSchema, normalizeMcpAppVisibility, parseMcpWwwAuthenticate, removeMcpServerConfig, resetMcpServerApprovals, saveMcpConfigFile, syncMcpToolsToRegistry, upsertMcpServerConfig, validateMcpAppResource };
|