@github/copilot-sdk 1.0.20 → 1.0.21-preview.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 +37 -0
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +5 -0
- package/dist/cjs/generated/rpc.js +782 -213
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.js +5 -0
- package/dist/generated/rpc.d.ts +1207 -331
- package/dist/generated/rpc.js +782 -213
- package/dist/generated/session-events.d.ts +32 -2
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +43 -5
- package/package.json +13 -14
|
@@ -71,7 +71,9 @@ export type RemediationAction =
|
|
|
71
71
|
/** Review or widen the sandbox policy. The blocked path or host is named by the accompanying message or by the tool result the action arrived with. */
|
|
72
72
|
| "review_sandbox_policy"
|
|
73
73
|
/** Permit outbound network access in the sandbox policy. */
|
|
74
|
-
| "allow_sandbox_outbound"
|
|
74
|
+
| "allow_sandbox_outbound"
|
|
75
|
+
/** Discard conversation history back through the blocked request before continuing. */
|
|
76
|
+
| "rewind_conversation";
|
|
75
77
|
/**
|
|
76
78
|
* The session mode the agent is operating in
|
|
77
79
|
*/
|
|
@@ -1942,7 +1944,7 @@ export interface ErrorData {
|
|
|
1942
1944
|
*/
|
|
1943
1945
|
errorCode?: string;
|
|
1944
1946
|
/**
|
|
1945
|
-
* Category of error (e.g., "authentication", "authorization", "quota", "rate_limit", "context_limit", "query")
|
|
1947
|
+
* Category of error (e.g., "authentication", "authorization", "policy", "quota", "rate_limit", "context_limit", "query")
|
|
1946
1948
|
*/
|
|
1947
1949
|
errorType: string;
|
|
1948
1950
|
/**
|
|
@@ -1953,6 +1955,14 @@ export interface ErrorData {
|
|
|
1953
1955
|
* GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs
|
|
1954
1956
|
*/
|
|
1955
1957
|
providerCallId?: string;
|
|
1958
|
+
/**
|
|
1959
|
+
* Sanitized provider-defined error parameter preserved from a structured upstream error envelope, when available.
|
|
1960
|
+
*/
|
|
1961
|
+
providerErrorParam?: string;
|
|
1962
|
+
/**
|
|
1963
|
+
* Provider-defined error type preserved from a structured upstream error envelope, when available (for example, `invalid_request_error`).
|
|
1964
|
+
*/
|
|
1965
|
+
providerErrorType?: string;
|
|
1956
1966
|
remediation?: RemediationAction;
|
|
1957
1967
|
/**
|
|
1958
1968
|
* Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
|
|
@@ -4071,6 +4081,10 @@ export interface CompactionCompleteCompactionTokensUsed {
|
|
|
4071
4081
|
*/
|
|
4072
4082
|
outputTokens?: number;
|
|
4073
4083
|
provider?: ModelProviderRef;
|
|
4084
|
+
/**
|
|
4085
|
+
* Number of model requests represented by this aggregated compaction usage
|
|
4086
|
+
*/
|
|
4087
|
+
requestCount?: number;
|
|
4074
4088
|
}
|
|
4075
4089
|
/**
|
|
4076
4090
|
* Token usage detail for a single billing category
|
|
@@ -4197,6 +4211,14 @@ export interface PermissionRecoveryData {
|
|
|
4197
4211
|
*/
|
|
4198
4212
|
maxAttempts: number;
|
|
4199
4213
|
onBlocked: PermissionRecoveryOnBlocked;
|
|
4214
|
+
/**
|
|
4215
|
+
* Subagent identifier that owns this recovery episode when the request was delegated through a parent permission service
|
|
4216
|
+
*/
|
|
4217
|
+
ownerAgentId?: string;
|
|
4218
|
+
/**
|
|
4219
|
+
* Root or child execution-session identifier that owns this recovery episode; omitted for legacy snapshots
|
|
4220
|
+
*/
|
|
4221
|
+
ownerSessionId?: string;
|
|
4200
4222
|
reason: PermissionRecoveryReason;
|
|
4201
4223
|
status: PermissionRecoveryStatus;
|
|
4202
4224
|
}
|
|
@@ -9158,6 +9180,14 @@ export interface PermissionRequestedEvent {
|
|
|
9158
9180
|
*/
|
|
9159
9181
|
export interface PermissionRequestedData {
|
|
9160
9182
|
agentMode?: SessionMode;
|
|
9183
|
+
/**
|
|
9184
|
+
* Delegated agent that owns permission recovery when the owner session multiplexes remote agents. Absent otherwise.
|
|
9185
|
+
*/
|
|
9186
|
+
ownerAgentId?: string;
|
|
9187
|
+
/**
|
|
9188
|
+
* Execution session that owns permission recovery for this request. Absent on historical events.
|
|
9189
|
+
*/
|
|
9190
|
+
ownerSessionId?: string;
|
|
9161
9191
|
permissionMode?: PermissionMode;
|
|
9162
9192
|
permissionRequest: PermissionRequest;
|
|
9163
9193
|
promptRequest?: PermissionPromptRequest;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* JSON-RPC based SDK for programmatic control of GitHub Copilot CLI
|
|
5
5
|
*/
|
|
6
6
|
export { CopilotClient } from "./client.js";
|
|
7
|
-
export type { HostLocalServerOptions, HostGitHubEnvironmentOptions } from "./generated/rpc.js";
|
|
7
|
+
export type { HostLocalServerOptions, HostGitHubEnvironmentOptions, ModelGetReasoningSummariesRequest, ModelGetReasoningSummariesResult, } from "./generated/rpc.js";
|
|
8
8
|
export { AhpHost, type AhpHostExit, type AhpHostOptions, type AhpSessionCreateRequest, type AhpSessionResumeRequest, } from "./host.js";
|
|
9
9
|
export { DisableBypassPermissionsModes, RuntimeConnection } from "./types.js";
|
|
10
10
|
export { BuiltInTools, ToolSet } from "./toolSet.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -1574,6 +1574,8 @@ export type MCPServerConfig = MCPStdioServerConfig | MCPHTTPServerConfig;
|
|
|
1574
1574
|
* Configuration for a custom agent.
|
|
1575
1575
|
*/
|
|
1576
1576
|
export interface CustomAgentConfig {
|
|
1577
|
+
/** Declarative hook actions keyed by event name, active only for this agent. */
|
|
1578
|
+
hooks?: Record<string, Record<string, unknown>[]>;
|
|
1577
1579
|
/**
|
|
1578
1580
|
* Unique name of the custom agent.
|
|
1579
1581
|
*/
|
|
@@ -2411,7 +2413,11 @@ export interface SessionConfigBase {
|
|
|
2411
2413
|
*/
|
|
2412
2414
|
agent?: string;
|
|
2413
2415
|
/**
|
|
2414
|
-
*
|
|
2416
|
+
* Explicit discovery-only skill roots. No general filesystem access is granted.
|
|
2417
|
+
* Available without `enableConfigDiscovery`; skill and managed disables still apply.
|
|
2418
|
+
* Relative paths resolve once when supplied against the request's effective
|
|
2419
|
+
* `workingDirectory`, and retained roots do not move when it changes.
|
|
2420
|
+
* Null and omission are equivalent; `[]` clears only the explicit SDK contribution.
|
|
2415
2421
|
*/
|
|
2416
2422
|
skillDirectories?: string[];
|
|
2417
2423
|
/**
|
|
@@ -2430,6 +2436,25 @@ export interface SessionConfigBase {
|
|
|
2430
2436
|
* or be removed in future SDK or CLI releases.
|
|
2431
2437
|
*/
|
|
2432
2438
|
skillProvider?: SkillProvider;
|
|
2439
|
+
/**
|
|
2440
|
+
* Explicit discovery-only agent roots, separate from `customAgents` objects.
|
|
2441
|
+
* No general filesystem access is granted. Available without `enableConfigDiscovery`;
|
|
2442
|
+
* source and managed disables still apply.
|
|
2443
|
+
* Relative paths resolve once when supplied against the request's effective
|
|
2444
|
+
* `workingDirectory`, and retained roots do not move when it changes.
|
|
2445
|
+
* Null and omission are equivalent; `[]` clears only the explicit SDK contribution.
|
|
2446
|
+
*/
|
|
2447
|
+
agentDirectories?: string[];
|
|
2448
|
+
/**
|
|
2449
|
+
* Explicit discovery-only file-hook roots, separate from callback `hooks`.
|
|
2450
|
+
* No general filesystem access is granted. Available without `enableConfigDiscovery`
|
|
2451
|
+
* or `enableFileHooks` (which controls repository-origin hooks only);
|
|
2452
|
+
* hook and managed disables still apply.
|
|
2453
|
+
* Relative paths resolve once when supplied against the request's effective
|
|
2454
|
+
* `workingDirectory`, and retained roots do not move when it changes.
|
|
2455
|
+
* Null and omission are equivalent; `[]` clears only the explicit SDK contribution.
|
|
2456
|
+
*/
|
|
2457
|
+
hookDirectories?: string[];
|
|
2433
2458
|
/**
|
|
2434
2459
|
* Local filesystem paths to Open Plugins-format directories
|
|
2435
2460
|
* (https://open-plugins.com/) to load for this session.
|
|
@@ -2445,7 +2470,12 @@ export interface SessionConfigBase {
|
|
|
2445
2470
|
*/
|
|
2446
2471
|
pluginDirectories?: string[];
|
|
2447
2472
|
/**
|
|
2448
|
-
*
|
|
2473
|
+
* Explicit discovery-only instruction roots using the existing SDK instruction formats.
|
|
2474
|
+
* No general filesystem access is granted. Available without `enableConfigDiscovery`;
|
|
2475
|
+
* instruction and managed disables still apply.
|
|
2476
|
+
* Relative paths resolve once when supplied against the request's effective
|
|
2477
|
+
* `workingDirectory`, and retained roots do not move when it changes.
|
|
2478
|
+
* Null and omission are equivalent; `[]` clears only the explicit SDK contribution.
|
|
2449
2479
|
*/
|
|
2450
2480
|
instructionDirectories?: string[];
|
|
2451
2481
|
/**
|
|
@@ -2549,9 +2579,9 @@ export interface SessionConfigBase {
|
|
|
2549
2579
|
*/
|
|
2550
2580
|
enableOnDemandInstructionDiscovery?: boolean;
|
|
2551
2581
|
/**
|
|
2552
|
-
* When true, enables
|
|
2553
|
-
*
|
|
2554
|
-
*
|
|
2582
|
+
* When true, enables repository-origin file hooks from `.github/hooks/` and
|
|
2583
|
+
* trusted repository-configured roots. Does not control explicit `hookDirectories`
|
|
2584
|
+
* or the `hooks` callback parameter.
|
|
2555
2585
|
*/
|
|
2556
2586
|
enableFileHooks?: boolean;
|
|
2557
2587
|
/**
|
|
@@ -2608,6 +2638,14 @@ export interface SessionConfig extends SessionConfigBase {
|
|
|
2608
2638
|
* Optional custom session ID. If not provided, the server generates one.
|
|
2609
2639
|
*/
|
|
2610
2640
|
sessionId?: string;
|
|
2641
|
+
/**
|
|
2642
|
+
* Names the session at creation, as `session.name.set` would, and is validated the
|
|
2643
|
+
* same way: non-empty, no leading or trailing whitespace, at most 100 UTF-16 units,
|
|
2644
|
+
* no control characters, and no double quotes. A name also makes the session persist
|
|
2645
|
+
* from the start, so it can be listed and resumed without ever running a turn.
|
|
2646
|
+
* Local sessions only: cloud creation rejects it.
|
|
2647
|
+
*/
|
|
2648
|
+
name?: string;
|
|
2611
2649
|
/**
|
|
2612
2650
|
* Invalidates the process-wide custom-instruction discovery cache before
|
|
2613
2651
|
* creating this session. Use when instruction files changed in the same runtime.
|
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.21-preview.1",
|
|
9
|
+
"copilotCliVersion": "1.0.97-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",
|
|
@@ -85,13 +85,12 @@
|
|
|
85
85
|
"json-schema": "^0.4.0",
|
|
86
86
|
"json-schema-to-typescript": "^15.0.4",
|
|
87
87
|
"prettier": "^3.8.1",
|
|
88
|
-
"quicktype-core": "^23.2.6",
|
|
89
88
|
"rimraf": "^6.1.2",
|
|
90
89
|
"semver": "^7.7.3",
|
|
91
90
|
"tar": "^7.5.22",
|
|
92
91
|
"tsx": "^4.20.6",
|
|
93
92
|
"typescript": "^5.0.0",
|
|
94
|
-
"vitest": "^4.
|
|
93
|
+
"vitest": "^4.1.11",
|
|
95
94
|
"ws": "^8.21.0"
|
|
96
95
|
},
|
|
97
96
|
"engines": {
|
|
@@ -104,18 +103,18 @@
|
|
|
104
103
|
"README.md"
|
|
105
104
|
],
|
|
106
105
|
"copilotRuntime": {
|
|
107
|
-
"sourceSha": "
|
|
108
|
-
"version": "1.0.
|
|
106
|
+
"sourceSha": "c47039bb19686a2781d7614b161431a4ac624d56",
|
|
107
|
+
"version": "1.0.97-1",
|
|
109
108
|
"visibility": "public"
|
|
110
109
|
},
|
|
111
110
|
"optionalDependencies": {
|
|
112
|
-
"@github/copilot-sdk-darwin-arm64": "1.0.
|
|
113
|
-
"@github/copilot-sdk-darwin-x64": "1.0.
|
|
114
|
-
"@github/copilot-sdk-linux-arm64": "1.0.
|
|
115
|
-
"@github/copilot-sdk-linux-x64": "1.0.
|
|
116
|
-
"@github/copilot-sdk-linuxmusl-arm64": "1.0.
|
|
117
|
-
"@github/copilot-sdk-linuxmusl-x64": "1.0.
|
|
118
|
-
"@github/copilot-sdk-win32-arm64": "1.0.
|
|
119
|
-
"@github/copilot-sdk-win32-x64": "1.0.
|
|
111
|
+
"@github/copilot-sdk-darwin-arm64": "1.0.21-preview.1",
|
|
112
|
+
"@github/copilot-sdk-darwin-x64": "1.0.21-preview.1",
|
|
113
|
+
"@github/copilot-sdk-linux-arm64": "1.0.21-preview.1",
|
|
114
|
+
"@github/copilot-sdk-linux-x64": "1.0.21-preview.1",
|
|
115
|
+
"@github/copilot-sdk-linuxmusl-arm64": "1.0.21-preview.1",
|
|
116
|
+
"@github/copilot-sdk-linuxmusl-x64": "1.0.21-preview.1",
|
|
117
|
+
"@github/copilot-sdk-win32-arm64": "1.0.21-preview.1",
|
|
118
|
+
"@github/copilot-sdk-win32-x64": "1.0.21-preview.1"
|
|
120
119
|
}
|
|
121
120
|
}
|