@github/copilot-sdk 1.0.12-unstable.0 → 1.0.13-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/dist/cjs/client.js +5 -1
- package/dist/cjs/generated/rpc.js +5 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/types.js +8 -0
- package/dist/client.d.ts +2 -1
- package/dist/client.js +5 -1
- package/dist/generated/rpc.d.ts +150 -3
- package/dist/generated/rpc.js +5 -0
- package/dist/generated/session-events.d.ts +59 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/types.d.ts +19 -6
- package/dist/types.js +7 -0
- package/package.json +2 -2
package/dist/cjs/client.js
CHANGED
|
@@ -988,7 +988,8 @@ class CopilotClient {
|
|
|
988
988
|
*
|
|
989
989
|
* In empty mode, defaults the four overridable feature flags to safe values
|
|
990
990
|
* (caller values from `config` win). `installedPlugins=[]` is unconditional
|
|
991
|
-
* in empty mode
|
|
991
|
+
* in empty mode. `includedBuiltinSkills` defaults to `[]`, but callers can
|
|
992
|
+
* explicitly allow selected runtime-bundled skills.
|
|
992
993
|
*/
|
|
993
994
|
async updateSessionOptionsForMode(session, config) {
|
|
994
995
|
const patch = {};
|
|
@@ -998,6 +999,7 @@ class CopilotClient {
|
|
|
998
999
|
patch.coauthorEnabled = config.coauthorEnabled ?? false;
|
|
999
1000
|
patch.manageScheduleEnabled = config.manageScheduleEnabled ?? false;
|
|
1000
1001
|
patch.installedPlugins = [];
|
|
1002
|
+
patch.includedBuiltinSkills = config.includedBuiltinSkills ?? [];
|
|
1001
1003
|
} else {
|
|
1002
1004
|
if (config.skipCustomInstructions !== void 0)
|
|
1003
1005
|
patch.skipCustomInstructions = config.skipCustomInstructions;
|
|
@@ -1007,6 +1009,8 @@ class CopilotClient {
|
|
|
1007
1009
|
patch.coauthorEnabled = config.coauthorEnabled;
|
|
1008
1010
|
if (config.manageScheduleEnabled !== void 0)
|
|
1009
1011
|
patch.manageScheduleEnabled = config.manageScheduleEnabled;
|
|
1012
|
+
if (config.includedBuiltinSkills !== void 0)
|
|
1013
|
+
patch.includedBuiltinSkills = config.includedBuiltinSkills;
|
|
1010
1014
|
}
|
|
1011
1015
|
if (Object.keys(patch).length === 0) {
|
|
1012
1016
|
return;
|
|
@@ -2837,6 +2837,11 @@ function registerClientGlobalApiHandlers(connection, handlers) {
|
|
|
2837
2837
|
if (!handler) return;
|
|
2838
2838
|
await handler.event(params);
|
|
2839
2839
|
});
|
|
2840
|
+
connection.onRequest("gitHubToken.getToken", async (params) => {
|
|
2841
|
+
const handler = handlers.gitHubToken;
|
|
2842
|
+
if (!handler) throw new Error("No gitHubToken client-global handler registered");
|
|
2843
|
+
return handler.getToken(params);
|
|
2844
|
+
});
|
|
2840
2845
|
}
|
|
2841
2846
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2842
2847
|
0 && (module.exports = {
|
package/dist/cjs/index.js
CHANGED
|
@@ -27,6 +27,7 @@ __export(index_exports, {
|
|
|
27
27
|
CopilotWebSocketCloseStatus: () => import_types2.CopilotWebSocketCloseStatus,
|
|
28
28
|
CopilotWebSocketForwarder: () => import_types2.CopilotWebSocketForwarder,
|
|
29
29
|
CopilotWebSocketHandler: () => import_types2.CopilotWebSocketHandler,
|
|
30
|
+
DisableBypassPermissionsModes: () => import_types.DisableBypassPermissionsModes,
|
|
30
31
|
FactoryResumeError: () => import_factory.FactoryResumeError,
|
|
31
32
|
RuntimeConnection: () => import_types.RuntimeConnection,
|
|
32
33
|
SYSTEM_MESSAGE_SECTIONS: () => import_types2.SYSTEM_MESSAGE_SECTIONS,
|
|
@@ -60,6 +61,7 @@ var import_types2 = require("./types.js");
|
|
|
60
61
|
CopilotWebSocketCloseStatus,
|
|
61
62
|
CopilotWebSocketForwarder,
|
|
62
63
|
CopilotWebSocketHandler,
|
|
64
|
+
DisableBypassPermissionsModes,
|
|
63
65
|
FactoryResumeError,
|
|
64
66
|
RuntimeConnection,
|
|
65
67
|
SYSTEM_MESSAGE_SECTIONS,
|
package/dist/cjs/types.js
CHANGED
|
@@ -22,6 +22,7 @@ __export(types_exports, {
|
|
|
22
22
|
CopilotWebSocketCloseStatus: () => import_copilotRequestHandler.CopilotWebSocketCloseStatus,
|
|
23
23
|
CopilotWebSocketForwarder: () => import_copilotRequestHandler.CopilotWebSocketForwarder,
|
|
24
24
|
CopilotWebSocketHandler: () => import_copilotRequestHandler.CopilotWebSocketHandler,
|
|
25
|
+
DisableBypassPermissionsModes: () => DisableBypassPermissionsModes,
|
|
25
26
|
RuntimeConnection: () => RuntimeConnection,
|
|
26
27
|
SYSTEM_MESSAGE_SECTIONS: () => SYSTEM_MESSAGE_SECTIONS,
|
|
27
28
|
SessionFsSqliteTransactionFailure: () => import_sessionFsProvider2.SessionFsSqliteTransactionFailure,
|
|
@@ -165,12 +166,19 @@ const approveAll = (request, invocation) => {
|
|
|
165
166
|
const defaultJoinSessionPermissionHandler = () => ({
|
|
166
167
|
kind: "no-result"
|
|
167
168
|
});
|
|
169
|
+
const DisableBypassPermissionsModes = {
|
|
170
|
+
/** Turn off bypass-permissions mode entirely. */
|
|
171
|
+
Disable: "disable",
|
|
172
|
+
/** Permit automatic bypass but block full allow-all. */
|
|
173
|
+
AllowAutoOnly: "allow-auto-only"
|
|
174
|
+
};
|
|
168
175
|
// Annotate the CommonJS export names for ESM import in node:
|
|
169
176
|
0 && (module.exports = {
|
|
170
177
|
CopilotRequestHandler,
|
|
171
178
|
CopilotWebSocketCloseStatus,
|
|
172
179
|
CopilotWebSocketForwarder,
|
|
173
180
|
CopilotWebSocketHandler,
|
|
181
|
+
DisableBypassPermissionsModes,
|
|
174
182
|
RuntimeConnection,
|
|
175
183
|
SYSTEM_MESSAGE_SECTIONS,
|
|
176
184
|
SessionFsSqliteTransactionFailure,
|
package/dist/client.d.ts
CHANGED
|
@@ -198,7 +198,8 @@ export declare class CopilotClient {
|
|
|
198
198
|
*
|
|
199
199
|
* In empty mode, defaults the four overridable feature flags to safe values
|
|
200
200
|
* (caller values from `config` win). `installedPlugins=[]` is unconditional
|
|
201
|
-
* in empty mode
|
|
201
|
+
* in empty mode. `includedBuiltinSkills` defaults to `[]`, but callers can
|
|
202
|
+
* explicitly allow selected runtime-bundled skills.
|
|
202
203
|
*/
|
|
203
204
|
private updateSessionOptionsForMode;
|
|
204
205
|
createSession(config: SessionConfig): Promise<CopilotSession>;
|
package/dist/client.js
CHANGED
|
@@ -965,7 +965,8 @@ class CopilotClient {
|
|
|
965
965
|
*
|
|
966
966
|
* In empty mode, defaults the four overridable feature flags to safe values
|
|
967
967
|
* (caller values from `config` win). `installedPlugins=[]` is unconditional
|
|
968
|
-
* in empty mode
|
|
968
|
+
* in empty mode. `includedBuiltinSkills` defaults to `[]`, but callers can
|
|
969
|
+
* explicitly allow selected runtime-bundled skills.
|
|
969
970
|
*/
|
|
970
971
|
async updateSessionOptionsForMode(session, config) {
|
|
971
972
|
const patch = {};
|
|
@@ -975,6 +976,7 @@ class CopilotClient {
|
|
|
975
976
|
patch.coauthorEnabled = config.coauthorEnabled ?? false;
|
|
976
977
|
patch.manageScheduleEnabled = config.manageScheduleEnabled ?? false;
|
|
977
978
|
patch.installedPlugins = [];
|
|
979
|
+
patch.includedBuiltinSkills = config.includedBuiltinSkills ?? [];
|
|
978
980
|
} else {
|
|
979
981
|
if (config.skipCustomInstructions !== void 0)
|
|
980
982
|
patch.skipCustomInstructions = config.skipCustomInstructions;
|
|
@@ -984,6 +986,8 @@ class CopilotClient {
|
|
|
984
986
|
patch.coauthorEnabled = config.coauthorEnabled;
|
|
985
987
|
if (config.manageScheduleEnabled !== void 0)
|
|
986
988
|
patch.manageScheduleEnabled = config.manageScheduleEnabled;
|
|
989
|
+
if (config.includedBuiltinSkills !== void 0)
|
|
990
|
+
patch.includedBuiltinSkills = config.includedBuiltinSkills;
|
|
987
991
|
}
|
|
988
992
|
if (Object.keys(patch).length === 0) {
|
|
989
993
|
return;
|
package/dist/generated/rpc.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
|
15
15
|
* via the `definition` "AuthInfo".
|
|
16
16
|
*/
|
|
17
17
|
/** @experimental */
|
|
18
|
-
export type AuthInfo = HMACAuthInfo | EnvAuthInfo | TokenAuthInfo | CopilotApiTokenAuthInfo | UserAuthInfo | GhCliAuthInfo | ApiKeyAuthInfo;
|
|
18
|
+
export type AuthInfo = HMACAuthInfo | EnvAuthInfo | TokenAuthInfo | TokenProviderAuthInfo | CopilotApiTokenAuthInfo | UserAuthInfo | GhCliAuthInfo | ApiKeyAuthInfo;
|
|
19
19
|
/**
|
|
20
20
|
* User to log out
|
|
21
21
|
*
|
|
@@ -241,6 +241,8 @@ export type AuthInfoType =
|
|
|
241
241
|
| "api-key"
|
|
242
242
|
/** Authentication from a GitHub token. */
|
|
243
243
|
| "token"
|
|
244
|
+
/** Authentication from an SDK GitHub token callback. */
|
|
245
|
+
| "token-provider"
|
|
244
246
|
/** Authentication from a Copilot API token. */
|
|
245
247
|
| "copilot-api-token";
|
|
246
248
|
/**
|
|
@@ -1126,6 +1128,48 @@ export type FactoryPhaseStatus =
|
|
|
1126
1128
|
export type FilterMapping = {
|
|
1127
1129
|
[k: string]: ContentFilterMode;
|
|
1128
1130
|
} | ContentFilterMode;
|
|
1131
|
+
/**
|
|
1132
|
+
* Why the runtime is requesting a GitHub credential.
|
|
1133
|
+
*
|
|
1134
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
1135
|
+
* via the `definition` "GitHubTokenAcquireReason".
|
|
1136
|
+
*/
|
|
1137
|
+
/** @experimental */
|
|
1138
|
+
export type GitHubTokenAcquireReason =
|
|
1139
|
+
/** The runtime is acquiring the registration's first credential. */
|
|
1140
|
+
"initial"
|
|
1141
|
+
/** The runtime is replacing a credential that is approaching expiry. */
|
|
1142
|
+
| "refresh";
|
|
1143
|
+
/**
|
|
1144
|
+
* SDK host response to a GitHub credential request.
|
|
1145
|
+
*
|
|
1146
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
1147
|
+
* via the `definition` "GitHubTokenAcquireResult".
|
|
1148
|
+
*/
|
|
1149
|
+
/** @experimental */
|
|
1150
|
+
export type GitHubTokenAcquireResult = {
|
|
1151
|
+
/**
|
|
1152
|
+
* GitHub access token acquired by the SDK host.
|
|
1153
|
+
*/
|
|
1154
|
+
accessToken: string;
|
|
1155
|
+
/**
|
|
1156
|
+
* OAuth token type. Defaults to bearer when omitted.
|
|
1157
|
+
*/
|
|
1158
|
+
tokenType?: string;
|
|
1159
|
+
/**
|
|
1160
|
+
* Remaining token lifetime in seconds when callback execution completes. It must exceed the one-hour preflight refresh threshold.
|
|
1161
|
+
*/
|
|
1162
|
+
expiresIn: number;
|
|
1163
|
+
/**
|
|
1164
|
+
* GitHub credential response variant discriminator.
|
|
1165
|
+
*/
|
|
1166
|
+
kind: "token";
|
|
1167
|
+
} | {
|
|
1168
|
+
/**
|
|
1169
|
+
* GitHub credential response variant discriminator.
|
|
1170
|
+
*/
|
|
1171
|
+
kind: "cancelled";
|
|
1172
|
+
};
|
|
1129
1173
|
/**
|
|
1130
1174
|
* Optional compaction parameters.
|
|
1131
1175
|
*
|
|
@@ -1734,7 +1778,7 @@ export type McpOauthPendingRequestResponse = {
|
|
|
1734
1778
|
*/
|
|
1735
1779
|
accessToken: string;
|
|
1736
1780
|
/**
|
|
1737
|
-
* OAuth token type. Defaults to
|
|
1781
|
+
* OAuth token type. Defaults to bearer when omitted.
|
|
1738
1782
|
*/
|
|
1739
1783
|
tokenType?: string;
|
|
1740
1784
|
/**
|
|
@@ -3017,6 +3061,14 @@ export type SessionsOpenProgressStatus =
|
|
|
3017
3061
|
"in-progress"
|
|
3018
3062
|
/** The step has completed successfully. */
|
|
3019
3063
|
| "complete";
|
|
3064
|
+
/**
|
|
3065
|
+
* Authentication credentials accepted by session.gitHubAuth.setCredentials. Session-owned token-provider identities cannot be installed through this method.
|
|
3066
|
+
*
|
|
3067
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
3068
|
+
* via the `definition` "SettableAuthInfo".
|
|
3069
|
+
*/
|
|
3070
|
+
/** @experimental */
|
|
3071
|
+
export type SettableAuthInfo = HMACAuthInfo | EnvAuthInfo | SettableTokenAuthInfo | CopilotApiTokenAuthInfo | UserAuthInfo | GhCliAuthInfo | ApiKeyAuthInfo;
|
|
3020
3072
|
/**
|
|
3021
3073
|
* Rust-owned settings predicates exposed across the SDK boundary. Raw feature-flag names are intentionally not part of the contract.
|
|
3022
3074
|
*
|
|
@@ -3911,6 +3963,32 @@ export interface TokenAuthInfo {
|
|
|
3911
3963
|
* The token value itself. Treat as a secret.
|
|
3912
3964
|
*/
|
|
3913
3965
|
token: string;
|
|
3966
|
+
/**
|
|
3967
|
+
* Opaque native GitHub credential registration backing this token identity, when applicable.
|
|
3968
|
+
*/
|
|
3969
|
+
registrationId?: string;
|
|
3970
|
+
copilotUser?: CopilotUserResponse;
|
|
3971
|
+
}
|
|
3972
|
+
/**
|
|
3973
|
+
* Authentication-info variant backed by an SDK GitHub token callback. It carries routing metadata but never a plaintext token.
|
|
3974
|
+
*
|
|
3975
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
3976
|
+
* via the `definition` "TokenProviderAuthInfo".
|
|
3977
|
+
*/
|
|
3978
|
+
/** @experimental */
|
|
3979
|
+
export interface TokenProviderAuthInfo {
|
|
3980
|
+
/**
|
|
3981
|
+
* SDK callback-backed GitHub token authentication.
|
|
3982
|
+
*/
|
|
3983
|
+
type: "token-provider";
|
|
3984
|
+
/**
|
|
3985
|
+
* Authentication host.
|
|
3986
|
+
*/
|
|
3987
|
+
host: string;
|
|
3988
|
+
/**
|
|
3989
|
+
* Opaque SDK callback registration identifier.
|
|
3990
|
+
*/
|
|
3991
|
+
registrationId: string;
|
|
3914
3992
|
copilotUser?: CopilotUserResponse;
|
|
3915
3993
|
}
|
|
3916
3994
|
/**
|
|
@@ -4554,6 +4632,10 @@ export interface AuthIdentity {
|
|
|
4554
4632
|
* Name of the environment variable that supplied the credential, when applicable
|
|
4555
4633
|
*/
|
|
4556
4634
|
envVar?: string;
|
|
4635
|
+
/**
|
|
4636
|
+
* Opaque SDK GitHub credential registration backing this identity. Routing metadata only; never a credential.
|
|
4637
|
+
*/
|
|
4638
|
+
registrationId?: string;
|
|
4557
4639
|
copilotUser?: CopilotUserResponse;
|
|
4558
4640
|
}
|
|
4559
4641
|
/**
|
|
@@ -7966,6 +8048,28 @@ export interface GitHubTelemetryNotification {
|
|
|
7966
8048
|
restricted: boolean;
|
|
7967
8049
|
event: GitHubTelemetryEvent;
|
|
7968
8050
|
}
|
|
8051
|
+
/**
|
|
8052
|
+
* Asks the SDK client to acquire a GitHub access token from an opaque callback registration.
|
|
8053
|
+
*
|
|
8054
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
8055
|
+
* via the `definition` "GitHubTokenAcquireRequest".
|
|
8056
|
+
*/
|
|
8057
|
+
/** @experimental */
|
|
8058
|
+
export interface GitHubTokenAcquireRequest {
|
|
8059
|
+
/**
|
|
8060
|
+
* Opaque identifier generated by the SDK for this callback registration.
|
|
8061
|
+
*/
|
|
8062
|
+
registrationId: string;
|
|
8063
|
+
/**
|
|
8064
|
+
* Effective GitHub host for which the callback must return a token.
|
|
8065
|
+
*/
|
|
8066
|
+
host: string;
|
|
8067
|
+
/**
|
|
8068
|
+
* Session receiving the token. Absent only before a cloud session has been assigned its id.
|
|
8069
|
+
*/
|
|
8070
|
+
sessionId?: string;
|
|
8071
|
+
reason: GitHubTokenAcquireReason;
|
|
8072
|
+
}
|
|
7969
8073
|
/**
|
|
7970
8074
|
* Pending external tool call request ID, with the tool result or an error describing why it failed.
|
|
7971
8075
|
*
|
|
@@ -17385,6 +17489,10 @@ export interface SessionOpenOptions {
|
|
|
17385
17489
|
* Additional directories to search for skills.
|
|
17386
17490
|
*/
|
|
17387
17491
|
skillDirectories?: string[];
|
|
17492
|
+
/**
|
|
17493
|
+
* Built-in skill names to include in this session. When specified, only these runtime-bundled skills are available. Skills from other sources with the same name remain available.
|
|
17494
|
+
*/
|
|
17495
|
+
includedBuiltinSkills?: string[];
|
|
17388
17496
|
/**
|
|
17389
17497
|
* Skill IDs disabled for this session.
|
|
17390
17498
|
*/
|
|
@@ -17926,7 +18034,29 @@ export interface SessionsEnrichMetadataRequest {
|
|
|
17926
18034
|
*/
|
|
17927
18035
|
/** @experimental */
|
|
17928
18036
|
export interface SessionSetCredentialsParams {
|
|
17929
|
-
credentials?:
|
|
18037
|
+
credentials?: SettableAuthInfo;
|
|
18038
|
+
}
|
|
18039
|
+
/**
|
|
18040
|
+
* Token authentication accepted by session.gitHubAuth.setCredentials.
|
|
18041
|
+
*
|
|
18042
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
18043
|
+
* via the `definition` "SettableTokenAuthInfo".
|
|
18044
|
+
*/
|
|
18045
|
+
/** @experimental */
|
|
18046
|
+
export interface SettableTokenAuthInfo {
|
|
18047
|
+
/**
|
|
18048
|
+
* SDK-side token authentication; the host configured the token directly via the SDK.
|
|
18049
|
+
*/
|
|
18050
|
+
type: "token";
|
|
18051
|
+
/**
|
|
18052
|
+
* Authentication host.
|
|
18053
|
+
*/
|
|
18054
|
+
host: string;
|
|
18055
|
+
/**
|
|
18056
|
+
* The token value itself. Treat as a secret.
|
|
18057
|
+
*/
|
|
18058
|
+
token: string;
|
|
18059
|
+
copilotUser?: CopilotUserResponse;
|
|
17930
18060
|
}
|
|
17931
18061
|
/**
|
|
17932
18062
|
* Indicates whether the credential update succeeded.
|
|
@@ -18749,6 +18879,10 @@ export interface SessionUpdateOptionsParams {
|
|
|
18749
18879
|
* Additional directories to search for skills.
|
|
18750
18880
|
*/
|
|
18751
18881
|
skillDirectories?: string[];
|
|
18882
|
+
/**
|
|
18883
|
+
* Built-in skill names to include in this session. When specified, only these runtime-bundled skills are available. Skills from other sources with the same name remain available. Set to null to remove the allowlist restriction.
|
|
18884
|
+
*/
|
|
18885
|
+
includedBuiltinSkills?: string[] | null;
|
|
18752
18886
|
/**
|
|
18753
18887
|
* Skill IDs that should be excluded from this session.
|
|
18754
18888
|
*/
|
|
@@ -24388,11 +24522,24 @@ export interface GitHubTelemetryHandler {
|
|
|
24388
24522
|
*/
|
|
24389
24523
|
event(params: GitHubTelemetryNotification): Promise<void>;
|
|
24390
24524
|
}
|
|
24525
|
+
/** Handler for `gitHubToken` client global API methods. */
|
|
24526
|
+
/** @experimental */
|
|
24527
|
+
export interface GitHubTokenHandler {
|
|
24528
|
+
/**
|
|
24529
|
+
* Asks the SDK client to mint a GitHub access token for a session whose configuration supplied a GitHub token provider. The runtime acquires the initial token during bootstrap and refreshes it during expiry preflight when one hour or less remains.
|
|
24530
|
+
*
|
|
24531
|
+
* @param params Asks the SDK client to acquire a GitHub access token from an opaque callback registration.
|
|
24532
|
+
*
|
|
24533
|
+
* @returns SDK host response to a GitHub credential request.
|
|
24534
|
+
*/
|
|
24535
|
+
getToken(params: GitHubTokenAcquireRequest): Promise<GitHubTokenAcquireResult>;
|
|
24536
|
+
}
|
|
24391
24537
|
/** All client global API handler groups. */
|
|
24392
24538
|
export interface ClientGlobalApiHandlers {
|
|
24393
24539
|
extensionLaunchProvider?: ExtensionLaunchProviderHandler;
|
|
24394
24540
|
llmInference?: LlmInferenceHandler;
|
|
24395
24541
|
gitHubTelemetry?: GitHubTelemetryHandler;
|
|
24542
|
+
gitHubToken?: GitHubTokenHandler;
|
|
24396
24543
|
}
|
|
24397
24544
|
/**
|
|
24398
24545
|
* Register client global API handlers on a JSON-RPC connection.
|
package/dist/generated/rpc.js
CHANGED
|
@@ -2809,6 +2809,11 @@ function registerClientGlobalApiHandlers(connection, handlers) {
|
|
|
2809
2809
|
if (!handler) return;
|
|
2810
2810
|
await handler.event(params);
|
|
2811
2811
|
});
|
|
2812
|
+
connection.onRequest("gitHubToken.getToken", async (params) => {
|
|
2813
|
+
const handler = handlers.gitHubToken;
|
|
2814
|
+
if (!handler) throw new Error("No gitHubToken client-global handler registered");
|
|
2815
|
+
return handler.getToken(params);
|
|
2816
|
+
});
|
|
2812
2817
|
}
|
|
2813
2818
|
export {
|
|
2814
2819
|
createInternalServerRpc,
|
|
@@ -3608,6 +3608,7 @@ export interface AssistantMessageData {
|
|
|
3608
3608
|
* Generation phase for phased-output models (e.g., thinking vs. response phases)
|
|
3609
3609
|
*/
|
|
3610
3610
|
phase?: string;
|
|
3611
|
+
reasoningBlocks?: AssistantMessageReasoningBlocks;
|
|
3611
3612
|
/**
|
|
3612
3613
|
* Opaque/encrypted extended thinking data from Anthropic models. Session-bound and stripped on resume.
|
|
3613
3614
|
*/
|
|
@@ -3770,6 +3771,20 @@ export interface CitationLocationBlock {
|
|
|
3770
3771
|
*/
|
|
3771
3772
|
type: "block";
|
|
3772
3773
|
}
|
|
3774
|
+
/**
|
|
3775
|
+
* Neutral provider-tagged reasoning content blocks preserved verbatim for round-tripping
|
|
3776
|
+
*/
|
|
3777
|
+
/** @experimental */
|
|
3778
|
+
export interface AssistantMessageReasoningBlocks {
|
|
3779
|
+
/**
|
|
3780
|
+
* Provider-native reasoning content blocks (e.g. Anthropic `thinking` / `redacted_thinking`) preserved verbatim, in order. A single response can carry several, each signed over the content preceding it, so dropping or reordering any of them invalidates the rest.
|
|
3781
|
+
*/
|
|
3782
|
+
blocks?: JsonValue[];
|
|
3783
|
+
/**
|
|
3784
|
+
* Model provider that produced these reasoning blocks.
|
|
3785
|
+
*/
|
|
3786
|
+
provider: string;
|
|
3787
|
+
}
|
|
3773
3788
|
/**
|
|
3774
3789
|
* Neutral provider-tagged server-side tool-use payload (tool search, advisor) for verbatim round-tripping
|
|
3775
3790
|
*/
|
|
@@ -5474,10 +5489,30 @@ export interface SubagentCompletedData {
|
|
|
5474
5489
|
* Whether the sub-agent was torn down by cancellation - its own abort, or an ancestor being killed - instead of finishing its work. Cancellation is not a failure, so the run still reports completion; this distinguishes a torn-down sub-agent from one that ran to the end.
|
|
5475
5490
|
*/
|
|
5476
5491
|
cancelled?: boolean;
|
|
5492
|
+
/**
|
|
5493
|
+
* Whether the first model actually dispatched matched the user's configured preference
|
|
5494
|
+
*/
|
|
5495
|
+
configuredModelMatchesActual?: boolean;
|
|
5496
|
+
/**
|
|
5497
|
+
* Concrete model the user configured for this sub-agent via `/subagents`, when present
|
|
5498
|
+
*/
|
|
5499
|
+
configuredModelPreference?: string;
|
|
5477
5500
|
/**
|
|
5478
5501
|
* Wall-clock duration of the sub-agent execution in milliseconds
|
|
5479
5502
|
*/
|
|
5480
5503
|
durationMs?: number;
|
|
5504
|
+
/**
|
|
5505
|
+
* Whether the explicit task-call model matched the user's configured preference
|
|
5506
|
+
*/
|
|
5507
|
+
explicitModelMatchesPreference?: boolean;
|
|
5508
|
+
/**
|
|
5509
|
+
* Explicit model supplied by the parent agent on the task call, when present
|
|
5510
|
+
*/
|
|
5511
|
+
explicitModelOverride?: string;
|
|
5512
|
+
/**
|
|
5513
|
+
* First model for which the sub-agent started an inference request, when one was dispatched
|
|
5514
|
+
*/
|
|
5515
|
+
firstDispatchedModel?: string;
|
|
5481
5516
|
/**
|
|
5482
5517
|
* Model used by the sub-agent
|
|
5483
5518
|
*/
|
|
@@ -5537,6 +5572,14 @@ export interface SubagentFailedData {
|
|
|
5537
5572
|
* Internal name of the sub-agent
|
|
5538
5573
|
*/
|
|
5539
5574
|
agentName: string;
|
|
5575
|
+
/**
|
|
5576
|
+
* Whether the first model actually dispatched matched the user's configured preference
|
|
5577
|
+
*/
|
|
5578
|
+
configuredModelMatchesActual?: boolean;
|
|
5579
|
+
/**
|
|
5580
|
+
* Concrete model the user configured for this sub-agent via `/subagents`, when present
|
|
5581
|
+
*/
|
|
5582
|
+
configuredModelPreference?: string;
|
|
5540
5583
|
/**
|
|
5541
5584
|
* Wall-clock duration of the sub-agent execution in milliseconds
|
|
5542
5585
|
*/
|
|
@@ -5545,6 +5588,18 @@ export interface SubagentFailedData {
|
|
|
5545
5588
|
* Error message describing why the sub-agent failed
|
|
5546
5589
|
*/
|
|
5547
5590
|
error: string;
|
|
5591
|
+
/**
|
|
5592
|
+
* Whether the explicit task-call model matched the user's configured preference
|
|
5593
|
+
*/
|
|
5594
|
+
explicitModelMatchesPreference?: boolean;
|
|
5595
|
+
/**
|
|
5596
|
+
* Explicit model supplied by the parent agent on the task call, when present
|
|
5597
|
+
*/
|
|
5598
|
+
explicitModelOverride?: string;
|
|
5599
|
+
/**
|
|
5600
|
+
* First model for which the sub-agent started an inference request, when one was dispatched
|
|
5601
|
+
*/
|
|
5602
|
+
firstDispatchedModel?: string;
|
|
5548
5603
|
/**
|
|
5549
5604
|
* Model selected for the sub-agent, when known
|
|
5550
5605
|
*/
|
|
@@ -8787,6 +8842,10 @@ export interface ManagedSettingsResolvedData {
|
|
|
8787
8842
|
* Whether at least two managed sources supplied permission allowlists, so enforcement intersects them and the flattened settings payload omits `permissions.allow`.
|
|
8788
8843
|
*/
|
|
8789
8844
|
permissionsAllowIntersected?: boolean;
|
|
8845
|
+
/**
|
|
8846
|
+
* Whether the effective sandbox policy forces the sandbox on *only* because managed policy could not be determined, rather than because the policy requires it. Lets clients tell a user whose `--no-sandbox` was overridden that the sandbox stayed on as a fail-closed fallback, instead of attributing it to an administrator who set no such policy.
|
|
8847
|
+
*/
|
|
8848
|
+
sandboxEnabledByUndeterminedPolicy?: boolean;
|
|
8790
8849
|
/**
|
|
8791
8850
|
* Whether the server (account/org) managed-settings layer was present
|
|
8792
8851
|
*/
|
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 { RuntimeConnection } from "./types.js";
|
|
7
|
+
export { DisableBypassPermissionsModes, RuntimeConnection } from "./types.js";
|
|
8
8
|
export { BuiltInTools, ToolSet } from "./toolSet.js";
|
|
9
9
|
export { CopilotSession, type AssistantMessageEvent } from "./session.js";
|
|
10
10
|
export { defineFactory, FactoryResumeError, isFactoryRunTerminal } from "./factory.js";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CopilotClient } from "./client.js";
|
|
2
|
-
import { RuntimeConnection } from "./types.js";
|
|
2
|
+
import { DisableBypassPermissionsModes, RuntimeConnection } from "./types.js";
|
|
3
3
|
import { BuiltInTools, ToolSet } from "./toolSet.js";
|
|
4
4
|
import { CopilotSession } from "./session.js";
|
|
5
5
|
import { defineFactory, FactoryResumeError, isFactoryRunTerminal } from "./factory.js";
|
|
@@ -31,6 +31,7 @@ export {
|
|
|
31
31
|
CopilotWebSocketCloseStatus,
|
|
32
32
|
CopilotWebSocketForwarder,
|
|
33
33
|
CopilotWebSocketHandler,
|
|
34
|
+
DisableBypassPermissionsModes,
|
|
34
35
|
FactoryResumeError,
|
|
35
36
|
RuntimeConnection,
|
|
36
37
|
SYSTEM_MESSAGE_SECTIONS,
|
package/dist/types.d.ts
CHANGED
|
@@ -1751,6 +1751,13 @@ export interface GitHubMcpToolConfig {
|
|
|
1751
1751
|
enableInsidersMode?: boolean;
|
|
1752
1752
|
disableFormDeferral?: boolean;
|
|
1753
1753
|
}
|
|
1754
|
+
/** Well-known managed bypass-permissions policies. */
|
|
1755
|
+
export declare const DisableBypassPermissionsModes: {
|
|
1756
|
+
/** Turn off bypass-permissions mode entirely. */
|
|
1757
|
+
readonly Disable: "disable";
|
|
1758
|
+
/** Permit automatic bypass but block full allow-all. */
|
|
1759
|
+
readonly AllowAutoOnly: "allow-auto-only";
|
|
1760
|
+
};
|
|
1754
1761
|
/**
|
|
1755
1762
|
* Permissions-only managed policy injected by the host via
|
|
1756
1763
|
* {@link SessionConfigBase.managedSettings}.
|
|
@@ -1761,11 +1768,11 @@ export interface GitHubMcpToolConfig {
|
|
|
1761
1768
|
*/
|
|
1762
1769
|
export interface ManagedSettingsPermissions {
|
|
1763
1770
|
/**
|
|
1764
|
-
*
|
|
1765
|
-
*
|
|
1766
|
-
*
|
|
1771
|
+
* Restricts bypass-permissions mode for the session. See
|
|
1772
|
+
* {@link DisableBypassPermissionsModes} for well-known values. Unknown
|
|
1773
|
+
* values are forwarded so newer runtime policies fail closed.
|
|
1767
1774
|
*/
|
|
1768
|
-
disableBypassPermissionsMode?:
|
|
1775
|
+
disableBypassPermissionsMode?: string;
|
|
1769
1776
|
/** Operations that must always be denied. Unioned across managed layers. */
|
|
1770
1777
|
deny?: string[];
|
|
1771
1778
|
/**
|
|
@@ -1944,6 +1951,12 @@ export interface SessionConfigBase {
|
|
|
1944
1951
|
* a custom agent with the same name is configured.
|
|
1945
1952
|
*/
|
|
1946
1953
|
excludedBuiltinAgents?: string[];
|
|
1954
|
+
/**
|
|
1955
|
+
* Built-in skill names to include in the session. In `mode: "empty"`,
|
|
1956
|
+
* omitting this option excludes all runtime-bundled skills; specifying names
|
|
1957
|
+
* opts those built-ins back in. Skills from other sources remain eligible.
|
|
1958
|
+
*/
|
|
1959
|
+
includedBuiltinSkills?: string[];
|
|
1947
1960
|
/**
|
|
1948
1961
|
* Custom provider configuration (BYOK - Bring Your Own Key).
|
|
1949
1962
|
* When specified, uses the provided API endpoint instead of the Copilot API.
|
|
@@ -2240,8 +2253,8 @@ export interface SessionConfigBase {
|
|
|
2240
2253
|
* with the same managed-permission parser it uses for fetched policy and
|
|
2241
2254
|
* composes it restrictively with any self-fetched (server) and
|
|
2242
2255
|
* device-managed (MDM) layers: `deny`/`ask` rules are unioned, every
|
|
2243
|
-
* declared `allow` list must admit an operation, and
|
|
2244
|
-
*
|
|
2256
|
+
* declared `allow` list must admit an operation, and bypass-mode
|
|
2257
|
+
* restrictions are composed fail-closed.
|
|
2245
2258
|
*
|
|
2246
2259
|
* This is startup-only. It is **not** persisted: it must be re-supplied on
|
|
2247
2260
|
* {@link CopilotClient.resumeSession | resume}, where it replaces the prior
|
package/dist/types.js
CHANGED
|
@@ -134,11 +134,18 @@ const approveAll = (request, invocation) => {
|
|
|
134
134
|
const defaultJoinSessionPermissionHandler = () => ({
|
|
135
135
|
kind: "no-result"
|
|
136
136
|
});
|
|
137
|
+
const DisableBypassPermissionsModes = {
|
|
138
|
+
/** Turn off bypass-permissions mode entirely. */
|
|
139
|
+
Disable: "disable",
|
|
140
|
+
/** Permit automatic bypass but block full allow-all. */
|
|
141
|
+
AllowAutoOnly: "allow-auto-only"
|
|
142
|
+
};
|
|
137
143
|
export {
|
|
138
144
|
CopilotRequestHandler,
|
|
139
145
|
CopilotWebSocketCloseStatus,
|
|
140
146
|
CopilotWebSocketForwarder,
|
|
141
147
|
CopilotWebSocketHandler,
|
|
148
|
+
DisableBypassPermissionsModes,
|
|
142
149
|
RuntimeConnection,
|
|
143
150
|
SYSTEM_MESSAGE_SECTIONS,
|
|
144
151
|
SessionFsSqliteTransactionFailure,
|
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.
|
|
7
|
+
"version": "1.0.13-preview.1",
|
|
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.81-
|
|
59
|
+
"@github/copilot": "^1.0.81-10",
|
|
60
60
|
"koffi": "^3.1.0",
|
|
61
61
|
"vscode-jsonrpc": "^8.2.1",
|
|
62
62
|
"zod": "^4.3.6"
|