@github/copilot-sdk 0.3.0 → 1.0.0-beta.2
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 +68 -11
- package/dist/cjs/generated/rpc.js +21 -0
- package/dist/client.d.ts +11 -2
- package/dist/client.js +75 -12
- package/dist/generated/rpc.d.ts +590 -40
- package/dist/generated/rpc.js +20 -0
- package/dist/generated/session-events.d.ts +450 -19
- package/dist/types.d.ts +67 -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,22 @@ 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;
|
|
185
|
+
/**
|
|
186
|
+
* Enable remote session support (Mission Control integration).
|
|
187
|
+
* When true, sessions in a GitHub repository working directory are
|
|
188
|
+
* accessible from GitHub web and mobile.
|
|
189
|
+
* This option is only used when the SDK spawns the CLI process; it is ignored
|
|
190
|
+
* when connecting to an external server via {@link cliUrl}.
|
|
191
|
+
* @default false
|
|
192
|
+
*/
|
|
193
|
+
remote?: boolean;
|
|
170
194
|
}
|
|
171
195
|
/**
|
|
172
196
|
* Configuration for creating a session
|
|
@@ -1059,6 +1083,10 @@ export interface SessionConfig {
|
|
|
1059
1083
|
* Directories to load skills from.
|
|
1060
1084
|
*/
|
|
1061
1085
|
skillDirectories?: string[];
|
|
1086
|
+
/**
|
|
1087
|
+
* Additional directories to search for custom instruction files.
|
|
1088
|
+
*/
|
|
1089
|
+
instructionDirectories?: string[];
|
|
1062
1090
|
/**
|
|
1063
1091
|
* List of skill names to disable.
|
|
1064
1092
|
*/
|
|
@@ -1099,13 +1127,25 @@ export interface SessionConfig {
|
|
|
1099
1127
|
/**
|
|
1100
1128
|
* Configuration for resuming a session
|
|
1101
1129
|
*/
|
|
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"> & {
|
|
1130
|
+
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
1131
|
/**
|
|
1104
1132
|
* When true, skips emitting the session.resume event.
|
|
1105
1133
|
* Useful for reconnecting to a session without triggering resume-related side effects.
|
|
1106
1134
|
* @default false
|
|
1107
1135
|
*/
|
|
1108
1136
|
disableResume?: boolean;
|
|
1137
|
+
/**
|
|
1138
|
+
* When true, the runtime continues any tool calls or permission prompts that were
|
|
1139
|
+
* still pending when the session was last suspended. When false (the default), the
|
|
1140
|
+
* runtime treats pending work as interrupted on resume.
|
|
1141
|
+
*
|
|
1142
|
+
* For permission requests, the runtime re-emits `permission.requested` so the
|
|
1143
|
+
* registered `onPermissionRequest` handler can re-prompt; for external tool calls,
|
|
1144
|
+
* the consumer is expected to supply the result via the corresponding low-level
|
|
1145
|
+
* RPC method.
|
|
1146
|
+
* @default false
|
|
1147
|
+
*/
|
|
1148
|
+
continuePendingWork?: boolean;
|
|
1109
1149
|
};
|
|
1110
1150
|
/**
|
|
1111
1151
|
* Configuration for a custom API provider.
|
|
@@ -1146,6 +1186,32 @@ export interface ProviderConfig {
|
|
|
1146
1186
|
* Custom HTTP headers to include in outbound provider requests.
|
|
1147
1187
|
*/
|
|
1148
1188
|
headers?: Record<string, string>;
|
|
1189
|
+
/**
|
|
1190
|
+
* Well-known model name used by the runtime to look up agent configuration
|
|
1191
|
+
* (tools, prompts, reasoning behavior) and default token limits. Also used
|
|
1192
|
+
* as the wire model when {@link wireModel} is not set.
|
|
1193
|
+
* Falls back to {@link SessionConfig.model}.
|
|
1194
|
+
*/
|
|
1195
|
+
modelId?: string;
|
|
1196
|
+
/**
|
|
1197
|
+
* Model name sent to the provider API for inference. Use this when the
|
|
1198
|
+
* provider's model name (e.g. an Azure deployment name or a custom
|
|
1199
|
+
* fine-tune name) differs from {@link modelId}.
|
|
1200
|
+
* Falls back to {@link modelId}, then {@link SessionConfig.model}.
|
|
1201
|
+
*/
|
|
1202
|
+
wireModel?: string;
|
|
1203
|
+
/**
|
|
1204
|
+
* Overrides the resolved model's default max prompt tokens. The runtime
|
|
1205
|
+
* triggers conversation compaction before sending a request when the
|
|
1206
|
+
* prompt (system message, history, tool definitions, user message) would
|
|
1207
|
+
* exceed this limit.
|
|
1208
|
+
*/
|
|
1209
|
+
maxInputTokens?: number;
|
|
1210
|
+
/**
|
|
1211
|
+
* Overrides the resolved model's default max output tokens. When hit, the
|
|
1212
|
+
* model stops generating and returns a truncated response.
|
|
1213
|
+
*/
|
|
1214
|
+
maxOutputTokens?: number;
|
|
1149
1215
|
}
|
|
1150
1216
|
/**
|
|
1151
1217
|
* Options for sending a message to a session
|
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.2",
|
|
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.43-0",
|
|
60
60
|
"vscode-jsonrpc": "^8.2.1",
|
|
61
61
|
"zod": "^4.3.6"
|
|
62
62
|
},
|