@github/copilot-sdk 1.0.0-beta.5 → 1.0.0-beta.7
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 +25 -30
- package/dist/canvas.d.ts +163 -0
- package/dist/canvas.js +92 -0
- package/dist/cjs/canvas.js +119 -0
- package/dist/cjs/client.js +243 -251
- package/dist/cjs/extension.js +9 -2
- package/dist/cjs/generated/rpc.js +97 -1
- package/dist/cjs/index.js +17 -7
- package/dist/cjs/session.js +64 -90
- package/dist/cjs/types.js +36 -3
- package/dist/client.d.ts +46 -49
- package/dist/client.js +246 -252
- package/dist/extension.d.ts +3 -1
- package/dist/extension.js +10 -2
- package/dist/generated/rpc.d.ts +796 -63
- package/dist/generated/rpc.js +97 -1
- package/dist/generated/session-events.d.ts +491 -78
- package/dist/index.d.ts +4 -2
- package/dist/index.js +12 -2
- package/dist/session.d.ts +13 -210
- package/dist/session.js +63 -88
- package/dist/types.d.ts +291 -121
- package/dist/types.js +34 -2
- package/package.json +2 -2
package/dist/types.js
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
import { createSessionFsAdapter } from "./sessionFsProvider.js";
|
|
2
|
+
const RuntimeConnection = {
|
|
3
|
+
/**
|
|
4
|
+
* Spawn a runtime child process and communicate over its stdin/stdout.
|
|
5
|
+
* This is the default if no {@link CopilotClientOptions.connection} is set.
|
|
6
|
+
*/
|
|
7
|
+
forStdio(opts = {}) {
|
|
8
|
+
return { kind: "stdio", path: opts.path, args: opts.args };
|
|
9
|
+
},
|
|
10
|
+
/**
|
|
11
|
+
* Spawn a runtime child process that listens on a TCP socket and connect to it.
|
|
12
|
+
*/
|
|
13
|
+
forTcp(opts = {}) {
|
|
14
|
+
return {
|
|
15
|
+
kind: "tcp",
|
|
16
|
+
port: opts.port,
|
|
17
|
+
connectionToken: opts.connectionToken,
|
|
18
|
+
path: opts.path,
|
|
19
|
+
args: opts.args
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* Connect to an already-running runtime at the given URL. The SDK does not
|
|
24
|
+
* spawn a process in this mode.
|
|
25
|
+
*/
|
|
26
|
+
forUri(url, opts = {}) {
|
|
27
|
+
return { kind: "uri", url, connectionToken: opts.connectionToken };
|
|
28
|
+
}
|
|
29
|
+
};
|
|
2
30
|
function convertMcpCallToolResult(callResult) {
|
|
3
31
|
const textParts = [];
|
|
4
32
|
const binaryResults = [];
|
|
@@ -44,7 +72,7 @@ function convertMcpCallToolResult(callResult) {
|
|
|
44
72
|
function defineTool(name, config) {
|
|
45
73
|
return { name, ...config };
|
|
46
74
|
}
|
|
47
|
-
const
|
|
75
|
+
const SYSTEM_MESSAGE_SECTIONS = {
|
|
48
76
|
identity: { description: "Agent identity preamble and mode statement" },
|
|
49
77
|
tone: { description: "Response style, conciseness rules, output formatting preferences" },
|
|
50
78
|
tool_efficiency: { description: "Tool usage patterns, parallel calling, batching guidelines" },
|
|
@@ -54,6 +82,9 @@ const SYSTEM_PROMPT_SECTIONS = {
|
|
|
54
82
|
safety: { description: "Environment limitations, prohibited actions, security policies" },
|
|
55
83
|
tool_instructions: { description: "Per-tool usage instructions" },
|
|
56
84
|
custom_instructions: { description: "Repository and organization custom instructions" },
|
|
85
|
+
runtime_instructions: {
|
|
86
|
+
description: "Runtime-provided context and instructions (e.g. system notifications, memories, workspace context, mode-specific instructions, content-exclusion policy)"
|
|
87
|
+
},
|
|
57
88
|
last_instructions: {
|
|
58
89
|
description: "End-of-prompt instructions: parallel tool calling, persistence, task completion"
|
|
59
90
|
}
|
|
@@ -63,7 +94,8 @@ const defaultJoinSessionPermissionHandler = () => ({
|
|
|
63
94
|
kind: "no-result"
|
|
64
95
|
});
|
|
65
96
|
export {
|
|
66
|
-
|
|
97
|
+
RuntimeConnection,
|
|
98
|
+
SYSTEM_MESSAGE_SECTIONS,
|
|
67
99
|
approveAll,
|
|
68
100
|
convertMcpCallToolResult,
|
|
69
101
|
createSessionFsAdapter,
|
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": "1.0.0-beta.
|
|
7
|
+
"version": "1.0.0-beta.7",
|
|
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.53-2",
|
|
60
60
|
"vscode-jsonrpc": "^8.2.1",
|
|
61
61
|
"zod": "^4.3.6"
|
|
62
62
|
},
|