-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathstate.ts
More file actions
41 lines (38 loc) · 1.31 KB
/
state.ts
File metadata and controls
41 lines (38 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
import type { ConsentManager } from "./consent-manager.ts";
import type { McpLifecycleManager } from "./lifecycle.ts";
import type { McpServerManager } from "./server-manager.ts";
import type { ToolMetadata, McpConfig, UiSessionMessages, UiStreamSummary } from "./types.ts";
import type { UiResourceHandler } from "./ui-resource-handler.ts";
import type { UiServerHandle } from "./ui-server.ts";
export interface CompletedUiSession {
serverName: string;
toolName: string;
completedAt: Date;
reason: string;
messages: UiSessionMessages;
stream?: UiStreamSummary;
}
export type SendMessageFn = (
message: {
customType: string;
content: Array<{ type: "text"; text: string }>;
display?: string;
details?: unknown;
},
options?: { triggerTurn?: boolean }
) => void;
export interface McpExtensionState {
manager: McpServerManager;
lifecycle: McpLifecycleManager;
toolMetadata: Map<string, ToolMetadata[]>;
config: McpConfig;
failureTracker: Map<string, number>;
uiResourceHandler: UiResourceHandler;
consentManager: ConsentManager;
uiServer: UiServerHandle | null;
completedUiSessions: CompletedUiSession[];
openBrowser: (url: string) => Promise<void>;
ui?: ExtensionContext["ui"];
sendMessage?: SendMessageFn;
}