@github/copilot-sdk 0.3.0-preview.1 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cjs/client.js +56 -8
- package/dist/cjs/generated/rpc.js +16 -0
- package/dist/client.d.ts +11 -2
- package/dist/client.js +63 -9
- package/dist/generated/rpc.d.ts +574 -40
- package/dist/generated/rpc.js +15 -0
- package/dist/generated/session-events.d.ts +370 -17
- package/dist/types.d.ts +32 -1
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -58,6 +58,14 @@ export interface CopilotClientOptions {
|
|
|
58
58
|
* If not set, inherits the current process's working directory
|
|
59
59
|
*/
|
|
60
60
|
cwd?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Base directory for Copilot data (session state, config, etc.).
|
|
63
|
+
* Sets the COPILOT_HOME environment variable on the spawned CLI process.
|
|
64
|
+
* When not set, the CLI defaults to ~/.copilot.
|
|
65
|
+
* This option is only used when the SDK spawns the CLI process; it is ignored
|
|
66
|
+
* when connecting to an external server via {@link cliUrl}.
|
|
67
|
+
*/
|
|
68
|
+
copilotHome?: string;
|
|
61
69
|
/**
|
|
62
70
|
* Port for the CLI server (TCP mode only)
|
|
63
71
|
* @default 0 (random available port)
|
|
@@ -167,6 +175,13 @@ export interface CopilotClientOptions {
|
|
|
167
175
|
* @default undefined (disabled)
|
|
168
176
|
*/
|
|
169
177
|
sessionIdleTimeoutSeconds?: number;
|
|
178
|
+
/**
|
|
179
|
+
* Connection token for the headless CLI server (TCP only). When the SDK
|
|
180
|
+
* spawns its own CLI in TCP mode and this is omitted, a UUID is generated
|
|
181
|
+
* automatically so the loopback listener is safe by default. Rejected with
|
|
182
|
+
* `useStdio: true` (stdio is pre-authenticated by transport).
|
|
183
|
+
*/
|
|
184
|
+
tcpConnectionToken?: string;
|
|
170
185
|
}
|
|
171
186
|
/**
|
|
172
187
|
* Configuration for creating a session
|
|
@@ -1059,6 +1074,10 @@ export interface SessionConfig {
|
|
|
1059
1074
|
* Directories to load skills from.
|
|
1060
1075
|
*/
|
|
1061
1076
|
skillDirectories?: string[];
|
|
1077
|
+
/**
|
|
1078
|
+
* Additional directories to search for custom instruction files.
|
|
1079
|
+
*/
|
|
1080
|
+
instructionDirectories?: string[];
|
|
1062
1081
|
/**
|
|
1063
1082
|
* List of skill names to disable.
|
|
1064
1083
|
*/
|
|
@@ -1099,13 +1118,25 @@ export interface SessionConfig {
|
|
|
1099
1118
|
/**
|
|
1100
1119
|
* Configuration for resuming a session
|
|
1101
1120
|
*/
|
|
1102
|
-
export type ResumeSessionConfig = Pick<SessionConfig, "clientName" | "model" | "tools" | "commands" | "systemMessage" | "availableTools" | "excludedTools" | "provider" | "modelCapabilities" | "streaming" | "includeSubAgentStreamingEvents" | "reasoningEffort" | "onPermissionRequest" | "onUserInputRequest" | "onElicitationRequest" | "hooks" | "workingDirectory" | "configDir" | "enableConfigDiscovery" | "mcpServers" | "customAgents" | "defaultAgent" | "agent" | "skillDirectories" | "disabledSkills" | "infiniteSessions" | "gitHubToken" | "onEvent" | "createSessionFsHandler"> & {
|
|
1121
|
+
export type ResumeSessionConfig = Pick<SessionConfig, "clientName" | "model" | "tools" | "commands" | "systemMessage" | "availableTools" | "excludedTools" | "provider" | "modelCapabilities" | "streaming" | "includeSubAgentStreamingEvents" | "reasoningEffort" | "onPermissionRequest" | "onUserInputRequest" | "onElicitationRequest" | "hooks" | "workingDirectory" | "configDir" | "enableConfigDiscovery" | "mcpServers" | "customAgents" | "defaultAgent" | "agent" | "skillDirectories" | "instructionDirectories" | "disabledSkills" | "infiniteSessions" | "gitHubToken" | "onEvent" | "createSessionFsHandler"> & {
|
|
1103
1122
|
/**
|
|
1104
1123
|
* When true, skips emitting the session.resume event.
|
|
1105
1124
|
* Useful for reconnecting to a session without triggering resume-related side effects.
|
|
1106
1125
|
* @default false
|
|
1107
1126
|
*/
|
|
1108
1127
|
disableResume?: boolean;
|
|
1128
|
+
/**
|
|
1129
|
+
* When true, the runtime continues any tool calls or permission prompts that were
|
|
1130
|
+
* still pending when the session was last suspended. When false (the default), the
|
|
1131
|
+
* runtime treats pending work as interrupted on resume.
|
|
1132
|
+
*
|
|
1133
|
+
* For permission requests, the runtime re-emits `permission.requested` so the
|
|
1134
|
+
* registered `onPermissionRequest` handler can re-prompt; for external tool calls,
|
|
1135
|
+
* the consumer is expected to supply the result via the corresponding low-level
|
|
1136
|
+
* RPC method.
|
|
1137
|
+
* @default false
|
|
1138
|
+
*/
|
|
1139
|
+
continuePendingWork?: boolean;
|
|
1109
1140
|
};
|
|
1110
1141
|
/**
|
|
1111
1142
|
* Configuration for a custom API provider.
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "https://github.com/github/copilot-sdk.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "1.0.0-beta.1",
|
|
8
8
|
"description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC",
|
|
9
9
|
"main": "./dist/cjs/index.js",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"author": "GitHub",
|
|
57
57
|
"license": "MIT",
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@github/copilot": "^1.0.
|
|
59
|
+
"@github/copilot": "^1.0.41-0",
|
|
60
60
|
"vscode-jsonrpc": "^8.2.1",
|
|
61
61
|
"zod": "^4.3.6"
|
|
62
62
|
},
|