Elffuss BraidHub

kikocis/continue public

796feb88992e · 2.9 KiBRawPermalink
1import type {
2 ContinueRcJson,
3 FileStatsMap,
4 FileType,
5 IDE,
6 IdeInfo,
7 IdeSettings,
8 IndexTag,
9 Location,
10 Problem,
11 Range,
12 RangeInFile,
13 TerminalOptions,
14 Thread,
15} from "../";
16import { ControlPlaneSessionInfo } from "../control-plane/AuthTypes";
17
18export interface GetGhTokenArgs {
19 force?: boolean;
20}
21
22export type ToIdeFromWebviewOrCoreProtocol = {
23 // Methods from IDE type
24 getIdeInfo: [undefined, IdeInfo];
25 getWorkspaceDirs: [undefined, string[]];
26 writeFile: [{ path: string; contents: string }, void];
27 showVirtualFile: [{ name: string; content: string }, void];
28 openFile: [{ path: string }, void];
29 openUrl: [string, void];
30 runCommand: [{ command: string; options?: TerminalOptions }, void];
31 getSearchResults: [{ query: string; maxResults?: number }, string];
32 getFileResults: [{ pattern: string; maxResults?: number }, string[]];
33 subprocess: [{ command: string; cwd?: string }, [string, string]];
34 saveFile: [{ filepath: string }, void];
35 fileExists: [{ filepath: string }, boolean];
36 readFile: [{ filepath: string }, string];
37 getProblems: [{ filepath: string }, Problem[]];
38 getOpenFiles: [undefined, string[]];
39 getCurrentFile: [
40 undefined,
41 (
42 | undefined
43 | {
44 isUntitled: boolean;
45 path: string;
46 contents: string;
47 }
48 ),
49 ];
50 getPinnedFiles: [undefined, string[]];
51 showLines: [{ filepath: string; startLine: number; endLine: number }, void];
52 readRangeInFile: [{ filepath: string; range: Range }, string];
53 getDiff: [{ includeUnstaged: boolean }, string[]];
54 getWorkspaceConfigs: [undefined, ContinueRcJson[]];
55 getTerminalContents: [undefined, string];
56 getDebugLocals: [{ threadIndex: number }, string];
57 getTopLevelCallStackSources: [
58 { threadIndex: number; stackDepth: number },
59 string[],
60 ];
61 getAvailableThreads: [undefined, Thread[]];
62 isTelemetryEnabled: [undefined, boolean];
63 isWorkspaceRemote: [undefined, boolean];
64 getUniqueId: [undefined, string];
65 getTags: [string, IndexTag[]];
66 readSecrets: [{ keys: string[] }, Record<string, string>];
67 writeSecrets: [{ secrets: Record<string, string> }, void];
68 // end methods from IDE type
69
70 getIdeSettings: [undefined, IdeSettings];
71
72 // Git
73 getBranch: [{ dir: string }, string];
74 getRepoName: [{ dir: string }, string | undefined];
75
76 showToast: [
77 Parameters<IDE["showToast"]>,
78 Awaited<ReturnType<IDE["showToast"]>>,
79 ];
80 getGitRootPath: [{ dir: string }, string | undefined];
81 listDir: [{ dir: string }, [string, FileType][]];
82 getFileStats: [{ files: string[] }, FileStatsMap];
83
84 gotoDefinition: [{ location: Location }, RangeInFile[]];
85
86 getControlPlaneSessionInfo: [
87 { silent: boolean; useOnboarding: boolean },
88 ControlPlaneSessionInfo | undefined,
89 ];
90 logoutOfControlPlane: [undefined, void];
91 reportError: [any, void];
92 closeSidebar: [undefined, void];
93};
94
95export type ToWebviewOrCoreFromIdeProtocol = {
96 didChangeActiveTextEditor: [{ filepath: string }, void];
97};