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
35 lines (30 loc) · 1.09 KB
/
Copy pathutil.ts
File metadata and controls
35 lines (30 loc) · 1.09 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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
import type { SessionOptions } from "@github/copilot/sdk";
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 = NonNullable<SessionOptions["shellConfig"]>;
/**
* 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,
};