@github/copilot-sdk 1.0.28 → 1.0.29-preview.0
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 +58 -13
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +64 -6
- package/dist/cjs/entra.js +83 -0
- package/dist/cjs/generated/lifecycle-diagnostics.js +16 -0
- package/dist/cjs/generated/rpc.js +156 -9
- package/dist/cjs/installationConfirmation.js +1 -1
- package/dist/cjs/jsonrpcTypes.js +16 -0
- package/dist/cjs/session.js +39 -25
- package/dist/cjs/sessionFsProvider.js +28 -0
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.d.ts +1 -0
- package/dist/client.js +64 -6
- package/dist/entra.d.ts +3 -0
- package/dist/entra.js +59 -0
- package/dist/extension.d.ts +1 -1
- package/dist/generated/lifecycle-diagnostics.d.ts +220 -0
- package/dist/generated/lifecycle-diagnostics.js +0 -0
- package/dist/generated/rpc.d.ts +3697 -40
- package/dist/generated/rpc.js +156 -9
- package/dist/generated/session-events.d.ts +2329 -36
- package/dist/index.d.ts +3 -3
- package/dist/installationConfirmation.d.ts +1 -1
- package/dist/installationConfirmation.js +1 -4
- package/dist/jsonrpcTypes.d.ts +14 -0
- package/dist/jsonrpcTypes.js +0 -0
- package/dist/sdkProtocolVersion.d.ts +1 -1
- package/dist/session.js +39 -25
- package/dist/sessionFsProvider.d.ts +15 -0
- package/dist/sessionFsProvider.js +28 -0
- package/dist/types.d.ts +92 -22
- package/dist/workflow.d.ts +1 -1
- package/docs/agent-author.md +4 -4
- package/docs/extensions.md +4 -3
- package/docs/workflows.md +3 -1
- package/package.json +23 -23
package/docs/extensions.md
CHANGED
|
@@ -16,7 +16,7 @@ Extensions add custom tools, hooks, and behaviors to the Copilot CLI. They run a
|
|
|
16
16
|
└─────────────────────┘ └──────────────────────┘
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
1. **Discovery**: The CLI scans `.github/extensions/` (project) and the user's copilot config extensions directory for subdirectories containing `extension.mjs
|
|
19
|
+
1. **Discovery**: The CLI scans `.github/extensions/` (project) and the user's copilot config extensions directory for subdirectories containing an `extension.mjs`, `extension.cjs` or `extension.js` entry file.
|
|
20
20
|
2. **Launch**: Each extension is forked as a child process with `@github/copilot-sdk` available via an automatic module resolver.
|
|
21
21
|
3. **Connection**: The extension calls `joinSession()` which establishes a JSON-RPC connection over stdio to the CLI and attaches to the user's current foreground session.
|
|
22
22
|
4. **Registration**: Tools and hooks declared in the session options are registered with the CLI and become available to the agent.
|
|
@@ -27,10 +27,11 @@ Extensions add custom tools, hooks, and behaviors to the Copilot CLI. They run a
|
|
|
27
27
|
```
|
|
28
28
|
.github/extensions/
|
|
29
29
|
my-extension/
|
|
30
|
-
extension.mjs ← Entry point (required
|
|
30
|
+
extension.mjs ← Entry point (required)
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
-
|
|
33
|
+
- The entry file must be named `extension.mjs`, `extension.cjs` or `extension.js`. If a directory holds more than one, the first in that order is used.
|
|
34
|
+
- `.mjs` (ES modules) is the recommended form and is what the scaffold generates. `.cjs` is CommonJS, and `.js` is loaded under Node's usual module-type rules. TypeScript (`.ts`) is not supported.
|
|
34
35
|
- Each extension lives in its own subdirectory.
|
|
35
36
|
- The `@github/copilot-sdk` import is resolved automatically — you don't install it.
|
|
36
37
|
|
package/docs/workflows.md
CHANGED
|
@@ -194,6 +194,8 @@ Set `notifyOnComplete` to `true` for workflows that are likely to be invoked by
|
|
|
194
194
|
|
|
195
195
|
Both resolve with the run envelope (`WorkflowRunResult`) for **every** outcome—`completed`, `error`, `halted`, `paused`, and `cancelled` alike. Inspect `status` and read `result` only when the run completed; a limit breach carries a typed `failure`. A `paused` envelope means that the current attempt settled, not that the durable run is permanently finished. Resume the same run ID to start another attempt with its journal and accounting intact. SDK-initiated `run` and `resume` do not request permission, so they have no declined outcome. They still enforce execution eligibility, input validation, and active-run limits. Recognized pre-execution resume failures throw `WorkflowResumeError`, whose `code` is one of `not_found`, `non_resumable`, `workflow_run_not_resumable`, `already_active`, `workflow_already_running`, `workflow_limits_invalid`, `workflow_session_disposed`, `workflow_storage_unavailable`, or `workflow_storage_corrupt`.
|
|
196
196
|
|
|
197
|
+
If the runtime that owns a started run disappears, the run remains active until its existing lease expires. The next observation reconciles it to `halted`, after which it can be resumed through the same API. Resume reuses durable journal entries and durable AI credit spend; spend that was not durably stored before the runtime disappeared is not reconstructed.
|
|
198
|
+
|
|
197
199
|
Pause a running attempt from outside its workflow body:
|
|
198
200
|
|
|
199
201
|
```ts
|
|
@@ -238,7 +240,7 @@ const progressPage = await session.workflow.getRunProgress(runId, {
|
|
|
238
240
|
|
|
239
241
|
- `listRuns()` returns only the runs array from the newest default page of this session's durable workflow runs. This overload preserves the original convenience API.
|
|
240
242
|
- `listRuns({ afterSeq, beforeSeq, limit })` returns the full page. Its `oldestSeq`, `newestSeq`, `hasMoreNewer`, and `omittedOlder` fields let callers continue paging without raw RPC calls.
|
|
241
|
-
- `getRunDetail(runId)` returns phases, prompt-safe agent summaries, and the latest progress page.
|
|
243
|
+
- `getRunDetail(runId)` returns phases, prompt-safe agent summaries, and the latest progress page. Each current-runtime agent summary includes `consumedNanoAiu`, the known spend from that direct agent and its descendants. Older runtimes omit the field, and historical agents without attributable charge rows also omit it when the run contains unattributed spend.
|
|
242
244
|
- `getRunProgress(runId, options?)` pages progress forward, backward, by phase, or from the latest tail.
|
|
243
245
|
|
|
244
246
|
`getRun(runId)` reads the latest run envelope. `pause(runId)` pauses a running attempt and returns its `paused` envelope. `cancel(runId)` cancels a run and returns its terminal envelope.
|
package/package.json
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"url": "https://github.com/github/copilot-agent-runtime.git",
|
|
6
6
|
"directory": "src/sdk/nodejs"
|
|
7
7
|
},
|
|
8
|
-
"version": "1.0.
|
|
9
|
-
"copilotCliVersion": "1.0.
|
|
8
|
+
"version": "1.0.29-preview.0",
|
|
9
|
+
"copilotCliVersion": "1.0.106-1",
|
|
10
10
|
"description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC",
|
|
11
11
|
"main": "./dist/cjs/index.js",
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"scripts": {
|
|
37
37
|
"auth:refresh": "node ../scripts/npm-auth-refresh.mjs --run",
|
|
38
38
|
"clean": "rimraf --glob dist *.tgz",
|
|
39
|
-
"build": "tsx esbuild-copilotsdk-nodejs.ts",
|
|
39
|
+
"build": "node --import tsx esbuild-copilotsdk-nodejs.ts",
|
|
40
40
|
"pack:release": "npm run verify:dependency-policy && tsx scripts/package-sdk.ts",
|
|
41
41
|
"verify:dependency-policy": "tsx scripts/verify-dependency-policy.ts",
|
|
42
42
|
"verify:release-packages": "tsx scripts/verify-release-packages.ts",
|
|
@@ -68,25 +68,25 @@
|
|
|
68
68
|
"author": "GitHub",
|
|
69
69
|
"license": "MIT",
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"koffi": "3.
|
|
72
|
-
"vscode-jsonrpc": "
|
|
73
|
-
"zod": "4.
|
|
71
|
+
"koffi": "3.3.3",
|
|
72
|
+
"vscode-jsonrpc": "10.0.0",
|
|
73
|
+
"zod": "4.6.7"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@hpke/core": "^1.9.0",
|
|
77
77
|
"@microsoft/agent-host-protocol-v09": "npm:@microsoft/agent-host-protocol@0.9.0",
|
|
78
|
-
"@platformatic/vfs": "^0.
|
|
79
|
-
"@types/node": "^
|
|
78
|
+
"@platformatic/vfs": "^0.5.0",
|
|
79
|
+
"@types/node": "^26.6.5",
|
|
80
80
|
"@types/semver": "7.8.0",
|
|
81
81
|
"@types/ws": "^8.18.1",
|
|
82
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
83
|
-
"@typescript-eslint/parser": "^8.
|
|
82
|
+
"@typescript-eslint/eslint-plugin": "^8.72.1",
|
|
83
|
+
"@typescript-eslint/parser": "^8.72.1",
|
|
84
84
|
"esbuild": "^0.28.1",
|
|
85
|
-
"eslint": "^
|
|
85
|
+
"eslint": "^10.13.0",
|
|
86
86
|
"file-entry-cache": "file:./scripts/eslint-file-cache",
|
|
87
87
|
"glob": "^13.0.1",
|
|
88
88
|
"json-schema": "^0.4.0",
|
|
89
|
-
"json-schema-to-typescript": "^
|
|
89
|
+
"json-schema-to-typescript": "^16.0.0",
|
|
90
90
|
"jsonc-parser": "^3.3.1",
|
|
91
91
|
"prettier": "file:../../../third_party/build-tools/prettier-3.8.1",
|
|
92
92
|
"rimraf": "^6.1.2",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"tsx": "file:../../../third_party/build-tools/tsx-4.23.13",
|
|
96
96
|
"typescript": "^5.0.0",
|
|
97
97
|
"vite": "file:../../../third_party/build-tools/vite-8.3.4",
|
|
98
|
-
"vitest": "^
|
|
98
|
+
"vitest": "^5.0.5",
|
|
99
99
|
"ws": "^8.21.0",
|
|
100
100
|
"yaml": "^2.8.3"
|
|
101
101
|
},
|
|
@@ -114,18 +114,18 @@
|
|
|
114
114
|
"README.md"
|
|
115
115
|
],
|
|
116
116
|
"copilotRuntime": {
|
|
117
|
-
"sourceSha": "
|
|
118
|
-
"version": "1.0.
|
|
117
|
+
"sourceSha": "1fb35cfaf220f19b8983d5cbd2f7aa2128e58b3c",
|
|
118
|
+
"version": "1.0.106-1",
|
|
119
119
|
"visibility": "public"
|
|
120
120
|
},
|
|
121
121
|
"optionalDependencies": {
|
|
122
|
-
"@github/copilot-sdk-darwin-arm64": "1.0.
|
|
123
|
-
"@github/copilot-sdk-darwin-x64": "1.0.
|
|
124
|
-
"@github/copilot-sdk-linux-arm64": "1.0.
|
|
125
|
-
"@github/copilot-sdk-linux-x64": "1.0.
|
|
126
|
-
"@github/copilot-sdk-linuxmusl-arm64": "1.0.
|
|
127
|
-
"@github/copilot-sdk-linuxmusl-x64": "1.0.
|
|
128
|
-
"@github/copilot-sdk-win32-arm64": "1.0.
|
|
129
|
-
"@github/copilot-sdk-win32-x64": "1.0.
|
|
122
|
+
"@github/copilot-sdk-darwin-arm64": "1.0.29-preview.0",
|
|
123
|
+
"@github/copilot-sdk-darwin-x64": "1.0.29-preview.0",
|
|
124
|
+
"@github/copilot-sdk-linux-arm64": "1.0.29-preview.0",
|
|
125
|
+
"@github/copilot-sdk-linux-x64": "1.0.29-preview.0",
|
|
126
|
+
"@github/copilot-sdk-linuxmusl-arm64": "1.0.29-preview.0",
|
|
127
|
+
"@github/copilot-sdk-linuxmusl-x64": "1.0.29-preview.0",
|
|
128
|
+
"@github/copilot-sdk-win32-arm64": "1.0.29-preview.0",
|
|
129
|
+
"@github/copilot-sdk-win32-x64": "1.0.29-preview.0"
|
|
130
130
|
}
|
|
131
131
|
}
|