@github/copilot-sdk 0.1.21 → 0.1.22
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/dist/client.js +6 -0
- package/dist/session.js +5 -1
- package/dist/types.d.ts +22 -3
- package/package.json +5 -5
package/dist/client.js
CHANGED
|
@@ -391,7 +391,11 @@ class CopilotClient {
|
|
|
391
391
|
}
|
|
392
392
|
const response = await this.connection.sendRequest("session.resume", {
|
|
393
393
|
sessionId,
|
|
394
|
+
model: config.model,
|
|
394
395
|
reasoningEffort: config.reasoningEffort,
|
|
396
|
+
systemMessage: config.systemMessage,
|
|
397
|
+
availableTools: config.availableTools,
|
|
398
|
+
excludedTools: config.excludedTools,
|
|
395
399
|
tools: config.tools?.map((tool) => ({
|
|
396
400
|
name: tool.name,
|
|
397
401
|
description: tool.description,
|
|
@@ -402,11 +406,13 @@ class CopilotClient {
|
|
|
402
406
|
requestUserInput: !!config.onUserInputRequest,
|
|
403
407
|
hooks: !!(config.hooks && Object.values(config.hooks).some(Boolean)),
|
|
404
408
|
workingDirectory: config.workingDirectory,
|
|
409
|
+
configDir: config.configDir,
|
|
405
410
|
streaming: config.streaming,
|
|
406
411
|
mcpServers: config.mcpServers,
|
|
407
412
|
customAgents: config.customAgents,
|
|
408
413
|
skillDirectories: config.skillDirectories,
|
|
409
414
|
disabledSkills: config.disabledSkills,
|
|
415
|
+
infiniteSessions: config.infiniteSessions,
|
|
410
416
|
disableResume: config.disableResume
|
|
411
417
|
});
|
|
412
418
|
const { sessionId: resumedSessionId, workspacePath } = response;
|
package/dist/session.js
CHANGED
|
@@ -96,10 +96,11 @@ class CopilotSession {
|
|
|
96
96
|
rejectWithError(error);
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
|
+
let timeoutId;
|
|
99
100
|
try {
|
|
100
101
|
await this.send(options);
|
|
101
102
|
const timeoutPromise = new Promise((_, reject) => {
|
|
102
|
-
setTimeout(
|
|
103
|
+
timeoutId = setTimeout(
|
|
103
104
|
() => reject(
|
|
104
105
|
new Error(
|
|
105
106
|
`Timeout after ${effectiveTimeout}ms waiting for session.idle`
|
|
@@ -111,6 +112,9 @@ class CopilotSession {
|
|
|
111
112
|
await Promise.race([idlePromise, timeoutPromise]);
|
|
112
113
|
return lastAssistantMessage;
|
|
113
114
|
} finally {
|
|
115
|
+
if (timeoutId !== void 0) {
|
|
116
|
+
clearTimeout(timeoutId);
|
|
117
|
+
}
|
|
114
118
|
unsubscribe();
|
|
115
119
|
}
|
|
116
120
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -587,7 +587,7 @@ export interface SessionConfig {
|
|
|
587
587
|
/**
|
|
588
588
|
* Configuration for resuming a session
|
|
589
589
|
*/
|
|
590
|
-
export type ResumeSessionConfig = Pick<SessionConfig, "tools" | "provider" | "streaming" | "reasoningEffort" | "onPermissionRequest" | "onUserInputRequest" | "hooks" | "workingDirectory" | "mcpServers" | "customAgents" | "skillDirectories" | "disabledSkills"> & {
|
|
590
|
+
export type ResumeSessionConfig = Pick<SessionConfig, "model" | "tools" | "systemMessage" | "availableTools" | "excludedTools" | "provider" | "streaming" | "reasoningEffort" | "onPermissionRequest" | "onUserInputRequest" | "hooks" | "workingDirectory" | "configDir" | "mcpServers" | "customAgents" | "skillDirectories" | "disabledSkills" | "infiniteSessions"> & {
|
|
591
591
|
/**
|
|
592
592
|
* When true, skips emitting the session.resume event.
|
|
593
593
|
* Useful for reconnecting to a session without triggering resume-related side effects.
|
|
@@ -640,12 +640,31 @@ export interface MessageOptions {
|
|
|
640
640
|
*/
|
|
641
641
|
prompt: string;
|
|
642
642
|
/**
|
|
643
|
-
* File or
|
|
643
|
+
* File, directory, or selection attachments
|
|
644
644
|
*/
|
|
645
645
|
attachments?: Array<{
|
|
646
|
-
type: "file"
|
|
646
|
+
type: "file";
|
|
647
647
|
path: string;
|
|
648
648
|
displayName?: string;
|
|
649
|
+
} | {
|
|
650
|
+
type: "directory";
|
|
651
|
+
path: string;
|
|
652
|
+
displayName?: string;
|
|
653
|
+
} | {
|
|
654
|
+
type: "selection";
|
|
655
|
+
filePath: string;
|
|
656
|
+
displayName: string;
|
|
657
|
+
selection?: {
|
|
658
|
+
start: {
|
|
659
|
+
line: number;
|
|
660
|
+
character: number;
|
|
661
|
+
};
|
|
662
|
+
end: {
|
|
663
|
+
line: number;
|
|
664
|
+
character: number;
|
|
665
|
+
};
|
|
666
|
+
};
|
|
667
|
+
text?: string;
|
|
649
668
|
}>;
|
|
650
669
|
/**
|
|
651
670
|
* Message delivery mode
|
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.1.
|
|
7
|
+
"version": "0.1.22",
|
|
8
8
|
"description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC",
|
|
9
9
|
"main": "./dist/index.js",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"author": "GitHub",
|
|
41
41
|
"license": "MIT",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@github/copilot": "^0.0.
|
|
43
|
+
"@github/copilot": "^0.0.403",
|
|
44
44
|
"vscode-jsonrpc": "^8.2.1",
|
|
45
|
-
"zod": "^4.3.
|
|
45
|
+
"zod": "^4.3.6"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^25.2.0",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@typescript-eslint/parser": "^8.54.0",
|
|
51
51
|
"esbuild": "^0.27.2",
|
|
52
52
|
"eslint": "^9.0.0",
|
|
53
|
-
"glob": "^
|
|
53
|
+
"glob": "^13.0.1",
|
|
54
54
|
"json-schema": "^0.4.0",
|
|
55
55
|
"json-schema-to-typescript": "^15.0.4",
|
|
56
|
-
"prettier": "^3.
|
|
56
|
+
"prettier": "^3.8.1",
|
|
57
57
|
"quicktype-core": "^23.2.6",
|
|
58
58
|
"rimraf": "^6.1.2",
|
|
59
59
|
"semver": "^7.7.3",
|