forked from github/copilot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.ts
More file actions
37 lines (33 loc) · 1.08 KB
/
Copy pathutil.ts
File metadata and controls
37 lines (33 loc) · 1.08 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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
export function iife<T>(fn: () => Promise<T>): Promise<T> {
return fn();
}
export function sleep(ms: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms));
}
type ShellConfigType = {
shellToolName: string;
readShellToolName: string;
writeShellToolName: string;
};
/**
* Shell configuration for platform-specific tool names.
* Values duplicated from SDK since ShellConfig class isn't exported as a runtime value.
*/
export const ShellConfig: {
powerShell: ShellConfigType;
bash: ShellConfigType;
} = {
powerShell: {
shellToolName: "powershell",
readShellToolName: "read_powershell",
writeShellToolName: "write_powershell",
} as ShellConfigType,
bash: {
shellToolName: "bash",
readShellToolName: "read_bash",
writeShellToolName: "write_bash",
} as ShellConfigType,
};