Elffuss BraidHub

kikocis/continue public

21cf25b4ed37 · 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 getUniqueId: [undefined, string];
64 getTags: [string, IndexTag[]];
65 readSecrets: [{ keys: string[] }, Record<string, string>];
66 writeSecrets: [{ secrets: Record<string, string> }, void];
67 // end methods from IDE type
68
69 getIdeSettings: [undefined, IdeSettings];
70
71 // Git
72 getBranch: [{ dir: string }, string];
73 getRepoName: [{ dir: string }, string | undefined];
74
75 showToast: [
76 Parameters<IDE["showToast"]>,
77 Awaited<ReturnType<IDE["showToast"]>>,
78 ];
79 getGitRootPath: [{ dir: string }, string | undefined];
80 listDir: [{ dir: string }, [string, FileType][]];
81 getFileStats: [{ files: string[] }, FileStatsMap];
82
83 gotoDefinition: [{ location: Location }, RangeInFile[]];
84
85 getControlPlaneSessionInfo: [
86 { silent: boolean; useOnboarding: boolean },
87 ControlPlaneSessionInfo | undefined,
88 ];
89 logoutOfControlPlane: [undefined, void];
90 reportError: [any, void];
91 closeSidebar: [undefined, void];
92};
93
94export type ToWebviewOrCoreFromIdeProtocol = {
95 didChangeActiveTextEditor: [{ filepath: string }, void];
96};