@github/copilot-sdk 1.0.19 → 1.0.20-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 +30 -0
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +6 -1
- package/dist/cjs/generated/rpc.js +11 -0
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.js +6 -1
- package/dist/generated/rpc.d.ts +111 -1
- package/dist/generated/rpc.js +11 -0
- package/dist/generated/session-events.d.ts +156 -14
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -1377,6 +1377,36 @@ const session = await client.createSession({
|
|
|
1377
1377
|
});
|
|
1378
1378
|
```
|
|
1379
1379
|
|
|
1380
|
+
### Managed network policy for client-owned browsers
|
|
1381
|
+
|
|
1382
|
+
Obtain a reusable `permissionsContext` from
|
|
1383
|
+
`client.rpc.managedSettings.resolve({ selectionId })` for account and device
|
|
1384
|
+
policy, or `session.rpc.managedSettings.get()` for the session's retained policy,
|
|
1385
|
+
including SDK injection and policy-helper rules. Omit `selectionId` for the current
|
|
1386
|
+
account, or device policy only when signed out. Resolution uses the managed-policy
|
|
1387
|
+
cache and can fetch server policy; keep it off latency-critical startup paths.
|
|
1388
|
+
Older runtimes may omit `permissionsContext`. Treat an absent context as unsupported
|
|
1389
|
+
evaluation, not unmanaged policy; do not navigate without a policy decision.
|
|
1390
|
+
|
|
1391
|
+
Call `client.rpc.managedSettings.permissions.evaluate({ context: permissionsContext, operations: [{ kind: "url", url: "https://docs.example.com/guide" }] })`.
|
|
1392
|
+
This is pure, sessionless evaluation: it performs no policy discovery, I/O,
|
|
1393
|
+
prompting, or sandbox changes. Reuse an in-memory context for repeated checks and
|
|
1394
|
+
refresh it when managed policy changes. Retain the runtime-owned `permissions`
|
|
1395
|
+
object verbatim rather than rebuilding it from the flattened settings display.
|
|
1396
|
+
|
|
1397
|
+
The result is `{ results: [{ operation, verdict }], failClosed }`, with one entry per
|
|
1398
|
+
input operation in the same order. `deny` blocks navigation, `ask` requires approval,
|
|
1399
|
+
`allow` approves under managed policy, and `unmanaged` leaves the consumer's normal
|
|
1400
|
+
permission flow in effect. A check never prompts or grants a saved approval.
|
|
1401
|
+
Invalid URLs reject the batch. Unknown policy rejects or returns `failClosed: true`
|
|
1402
|
+
with all URLs denied; do not navigate on an error.
|
|
1403
|
+
|
|
1404
|
+
Check every navigation, redirect, and new-window destination before opening it.
|
|
1405
|
+
These APIs evaluate managed permission rules only: they do not replace browser
|
|
1406
|
+
security checks, user permissions, or sandbox policy. `permissions.limitTo` neither
|
|
1407
|
+
enables the sandbox nor changes `sandbox.userPolicy.network`; configure sandbox
|
|
1408
|
+
network restrictions explicitly.
|
|
1409
|
+
|
|
1380
1410
|
### Permission Result Kinds
|
|
1381
1411
|
|
|
1382
1412
|
The handler must return one of the `PermissionDecision` shapes (or `{ kind: "no-result" }`). Approval scopes are present-tense — they describe the decision to apply, not the outcome reported back on session events:
|
package/dist/cjs/cliVersion.js
CHANGED
|
@@ -22,7 +22,7 @@ __export(cliVersion_exports, {
|
|
|
22
22
|
COPILOT_CLI_VERSION: () => COPILOT_CLI_VERSION
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(cliVersion_exports);
|
|
25
|
-
const COPILOT_CLI_VERSION = "1.0.
|
|
25
|
+
const COPILOT_CLI_VERSION = "1.0.96-0";
|
|
26
26
|
const COPILOT_CLI_USE_NPM_PACKAGE = false;
|
|
27
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28
28
|
0 && (module.exports = {
|
package/dist/cjs/client.js
CHANGED
|
@@ -2455,6 +2455,7 @@ stderr: ${stderrOutput}`
|
|
|
2455
2455
|
/** Starts the in-process FFI runtime with SDK-managed typed options. */
|
|
2456
2456
|
async startInProcessFfi() {
|
|
2457
2457
|
const explicitEntrypoint = this.resolvedEnv.COPILOT_CLI_PATH;
|
|
2458
|
+
const cliLoginSyncIntegrationId = this.resolvedEnv.GITHUB_COPILOT_INTEGRATION_ID?.trim() || void 0;
|
|
2458
2459
|
let runtimeLibrary;
|
|
2459
2460
|
if (explicitEntrypoint) {
|
|
2460
2461
|
const entrypointDirectory = (0, import_node_path.dirname)((0, import_node_path.resolve)(explicitEntrypoint));
|
|
@@ -2466,7 +2467,8 @@ stderr: ${stderrOutput}`
|
|
|
2466
2467
|
"runtime.node"
|
|
2467
2468
|
);
|
|
2468
2469
|
} else {
|
|
2469
|
-
|
|
2470
|
+
const bundledRuntimePath = await getBundledRuntimePath();
|
|
2471
|
+
runtimeLibrary = (0, import_node_path.join)((0, import_node_path.dirname)(bundledRuntimePath), "runtime.node");
|
|
2470
2472
|
}
|
|
2471
2473
|
const { FfiRuntimeHost } = await import("./ffiRuntimeHost.js");
|
|
2472
2474
|
const environment = {};
|
|
@@ -2495,6 +2497,9 @@ stderr: ${stderrOutput}`
|
|
|
2495
2497
|
if (this.options.enableRemoteSessions) {
|
|
2496
2498
|
args.push("--remote");
|
|
2497
2499
|
}
|
|
2500
|
+
if (cliLoginSyncIntegrationId) {
|
|
2501
|
+
args.push(`--cli-login-sync-integration-id=${cliLoginSyncIntegrationId}`);
|
|
2502
|
+
}
|
|
2498
2503
|
const host = FfiRuntimeHost.create(runtimeLibrary, explicitEntrypoint, environment, args);
|
|
2499
2504
|
this.ffiHost = host;
|
|
2500
2505
|
await host.start();
|
|
@@ -707,6 +707,17 @@ function createServerRpc(connection) {
|
|
|
707
707
|
* @returns Effective enterprise managed settings for an account, resolved without a session.
|
|
708
708
|
*/
|
|
709
709
|
resolve: async (params) => connection.sendRequest("managedSettings.resolve", params),
|
|
710
|
+
/** @experimental */
|
|
711
|
+
permissions: {
|
|
712
|
+
/**
|
|
713
|
+
* Pure, sessionless evaluation of operations against a supplied permissionsContext. Performs no policy discovery, I/O, prompting, navigation, permission grants, or sandbox changes. Obtain the context from managedSettings.resolve or session.managedSettings.get, or reuse an in-memory context. Results preserve input order and duplicates. Consumers must block deny, obtain approval for ask, and use their normal permission flow for unmanaged. Unknown policy returns failClosed with every operation denied. This is not a substitute for user permissions or other security controls.
|
|
714
|
+
*
|
|
715
|
+
* @param params Managed policy context and ordered operations for pure, sessionless evaluation.
|
|
716
|
+
*
|
|
717
|
+
* @returns Ordered managed permission verdicts and the supplied policy's fail-closed posture.
|
|
718
|
+
*/
|
|
719
|
+
evaluate: async (params) => connection.sendRequest("managedSettings.permissions.evaluate", params)
|
|
720
|
+
},
|
|
710
721
|
/**
|
|
711
722
|
* Returns the managed-settings authoring JSON schema with descriptive `x-composition` annotations aligned with the shared settings-engine vocabulary. These annotations are not a complete runtime composition contract: model, effortLevel, and contextTier remain coupled. Use `managedSettings.compose` for the runtime's effective result. Performs no I/O.
|
|
712
723
|
*
|
package/dist/cliVersion.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const COPILOT_CLI_VERSION = "1.0.
|
|
1
|
+
export declare const COPILOT_CLI_VERSION = "1.0.96-0";
|
|
2
2
|
export declare const COPILOT_CLI_USE_NPM_PACKAGE = false;
|
package/dist/cliVersion.js
CHANGED
package/dist/client.js
CHANGED
|
@@ -2435,6 +2435,7 @@ stderr: ${stderrOutput}`
|
|
|
2435
2435
|
/** Starts the in-process FFI runtime with SDK-managed typed options. */
|
|
2436
2436
|
async startInProcessFfi() {
|
|
2437
2437
|
const explicitEntrypoint = this.resolvedEnv.COPILOT_CLI_PATH;
|
|
2438
|
+
const cliLoginSyncIntegrationId = this.resolvedEnv.GITHUB_COPILOT_INTEGRATION_ID?.trim() || void 0;
|
|
2438
2439
|
let runtimeLibrary;
|
|
2439
2440
|
if (explicitEntrypoint) {
|
|
2440
2441
|
const entrypointDirectory = dirname(resolve(explicitEntrypoint));
|
|
@@ -2446,7 +2447,8 @@ stderr: ${stderrOutput}`
|
|
|
2446
2447
|
"runtime.node"
|
|
2447
2448
|
);
|
|
2448
2449
|
} else {
|
|
2449
|
-
|
|
2450
|
+
const bundledRuntimePath = await getBundledRuntimePath();
|
|
2451
|
+
runtimeLibrary = join(dirname(bundledRuntimePath), "runtime.node");
|
|
2450
2452
|
}
|
|
2451
2453
|
const { FfiRuntimeHost } = await import("./ffiRuntimeHost.js");
|
|
2452
2454
|
const environment = {};
|
|
@@ -2475,6 +2477,9 @@ stderr: ${stderrOutput}`
|
|
|
2475
2477
|
if (this.options.enableRemoteSessions) {
|
|
2476
2478
|
args.push("--remote");
|
|
2477
2479
|
}
|
|
2480
|
+
if (cliLoginSyncIntegrationId) {
|
|
2481
|
+
args.push(`--cli-login-sync-integration-id=${cliLoginSyncIntegrationId}`);
|
|
2482
|
+
}
|
|
2478
2483
|
const host = FfiRuntimeHost.create(runtimeLibrary, explicitEntrypoint, environment, args);
|
|
2479
2484
|
this.ffiHost = host;
|
|
2480
2485
|
await host.start();
|
package/dist/generated/rpc.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Generated from: api.schema.json
|
|
4
4
|
*/
|
|
5
5
|
import type { MessageConnection } from "vscode-jsonrpc/node.js";
|
|
6
|
-
import type { AbortReason, AgentModelPolicy, Attachment, AutoTier, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, IndexedSearchState, ManagedSettingsResolvedData, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerMetadata, McpServerSource, McpServerStatus, ModelChangeSource, ModelProviderKind, ModelProviderRef, PermissionDecisionSource, PermissionMode, PermissionPromptRequest, PermissionRule, ProviderQuotaState, ReasoningSummary, RemediationAction, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompleteData, TaskCompletionOutcome, UsageGetMetricsResult, UserToolSessionApproval, Verbosity } from "./session-events.js";
|
|
6
|
+
import type { AbortReason, AgentModelPolicy, Attachment, AutoTier, ContextTier, EmbeddedBlobResourceContents, EmbeddedTextResourceContents, IndexedSearchState, ManagedPermissionsContext, ManagedSettingsResolvedData, McpOauthHttpResponse, McpOauthWWWAuthenticateParams, McpServerMetadata, McpServerSource, McpServerStatus, ModelChangeSource, ModelProviderKind, ModelProviderRef, PermissionDecisionSource, PermissionMode, PermissionPromptRequest, PermissionRule, ProviderQuotaState, ReasoningSummary, RemediationAction, SessionEvent, SessionLimitsConfig, SessionMode, ShutdownType, SkillSource, TaskCompleteData, TaskCompletionOutcome, UsageGetMetricsResult, UserToolSessionApproval, Verbosity } from "./session-events.js";
|
|
7
7
|
/** A value that can be represented losslessly on the SDK JSON wire. */
|
|
8
8
|
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
9
9
|
[key: string]: JsonValue;
|
|
@@ -2569,6 +2569,33 @@ export type SessionLogLevel =
|
|
|
2569
2569
|
| "warning"
|
|
2570
2570
|
/** Error message describing a failure. */
|
|
2571
2571
|
| "error";
|
|
2572
|
+
/** @experimental */
|
|
2573
|
+
export type ManagedPermissionOperation = {
|
|
2574
|
+
/**
|
|
2575
|
+
* Absolute HTTP(S) URL with a host. Invalid URLs reject the entire evaluation batch.
|
|
2576
|
+
*/
|
|
2577
|
+
url: string;
|
|
2578
|
+
/**
|
|
2579
|
+
* Operation to evaluate. Currently only url is supported.
|
|
2580
|
+
*/
|
|
2581
|
+
kind: "url";
|
|
2582
|
+
};
|
|
2583
|
+
/**
|
|
2584
|
+
* Managed-policy verdict only: deny blocks the URL, ask requires approval, allow approves under managed policy, and unmanaged leaves the normal consumer permission flow in effect. No verdict bypasses other security controls.
|
|
2585
|
+
*
|
|
2586
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
2587
|
+
* via the `definition` "ManagedPermissionVerdict".
|
|
2588
|
+
*/
|
|
2589
|
+
/** @experimental */
|
|
2590
|
+
export type ManagedPermissionVerdict =
|
|
2591
|
+
/** Managed policy prohibits the operation; do not offer approval. */
|
|
2592
|
+
"deny"
|
|
2593
|
+
/** Managed policy requires the consumer to obtain approval. */
|
|
2594
|
+
| "ask"
|
|
2595
|
+
/** Managed policy allows the operation, subject to other security controls. */
|
|
2596
|
+
| "allow"
|
|
2597
|
+
/** Managed policy does not decide the operation; use the consumer's normal permission flow. */
|
|
2598
|
+
| "unmanaged";
|
|
2572
2599
|
/**
|
|
2573
2600
|
* What retrying did for one plugin required by managed settings.
|
|
2574
2601
|
*
|
|
@@ -6721,6 +6748,10 @@ export interface AccountStatus {
|
|
|
6721
6748
|
*/
|
|
6722
6749
|
login: string;
|
|
6723
6750
|
kind: AccountKind;
|
|
6751
|
+
/**
|
|
6752
|
+
* Human-readable credential source used to authenticate this account, such as `gh` or `GITHUB_TOKEN`.
|
|
6753
|
+
*/
|
|
6754
|
+
authSource?: string;
|
|
6724
6755
|
/**
|
|
6725
6756
|
* Opaque id of the account this one was derived from (e.g. an EMU account's base Entra identity); absent for a root account. Matches the base identity account's selectionId, forming the derivation edge.
|
|
6726
6757
|
*/
|
|
@@ -13666,6 +13697,42 @@ export interface ManagedMcpServerConfig {
|
|
|
13666
13697
|
*/
|
|
13667
13698
|
headersRefreshTtlMs?: number;
|
|
13668
13699
|
}
|
|
13700
|
+
/** @experimental */
|
|
13701
|
+
export interface ManagedPermissionEvaluation {
|
|
13702
|
+
operation: ManagedPermissionOperation;
|
|
13703
|
+
verdict: ManagedPermissionVerdict;
|
|
13704
|
+
}
|
|
13705
|
+
/**
|
|
13706
|
+
* Managed policy context and ordered operations for pure, sessionless evaluation.
|
|
13707
|
+
*
|
|
13708
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
13709
|
+
* via the `definition` "ManagedPermissionsEvaluateRequest".
|
|
13710
|
+
*/
|
|
13711
|
+
/** @experimental */
|
|
13712
|
+
export interface ManagedPermissionsEvaluateRequest {
|
|
13713
|
+
context: ManagedPermissionsContext;
|
|
13714
|
+
/**
|
|
13715
|
+
* Operations to evaluate, preserving input order and duplicates. An empty batch is valid.
|
|
13716
|
+
*/
|
|
13717
|
+
operations: ManagedPermissionOperation[];
|
|
13718
|
+
}
|
|
13719
|
+
/**
|
|
13720
|
+
* Ordered managed permission verdicts and the supplied policy's fail-closed posture.
|
|
13721
|
+
*
|
|
13722
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
13723
|
+
* via the `definition` "ManagedPermissionsEvaluateResult".
|
|
13724
|
+
*/
|
|
13725
|
+
/** @experimental */
|
|
13726
|
+
export interface ManagedPermissionsEvaluateResult {
|
|
13727
|
+
/**
|
|
13728
|
+
* One verdict per input operation, in the same order, including duplicates.
|
|
13729
|
+
*/
|
|
13730
|
+
results: ManagedPermissionEvaluation[];
|
|
13731
|
+
/**
|
|
13732
|
+
* Managed permission policy could not be determined; every operation is denied.
|
|
13733
|
+
*/
|
|
13734
|
+
failClosed: boolean;
|
|
13735
|
+
}
|
|
13669
13736
|
/**
|
|
13670
13737
|
* Retry outcome for one plugin required by managed settings.
|
|
13671
13738
|
*
|
|
@@ -13863,6 +13930,7 @@ export interface ManagedSettingsResolveRequest {
|
|
|
13863
13930
|
*/
|
|
13864
13931
|
/** @experimental */
|
|
13865
13932
|
export interface ManagedSettingsResolveResult {
|
|
13933
|
+
permissionsContext?: ManagedPermissionsContext;
|
|
13866
13934
|
/**
|
|
13867
13935
|
* Printable opaque identity of the account the settings were resolved for, suitable for comparison and storage, not an account selectionId. Absent when no account was available, in which case only device policy is reported.
|
|
13868
13936
|
*/
|
|
@@ -29991,6 +30059,37 @@ export interface HostGetConfigurationResult {
|
|
|
29991
30059
|
/** @experimental */
|
|
29992
30060
|
export interface HostReadyResult {
|
|
29993
30061
|
}
|
|
30062
|
+
/**
|
|
30063
|
+
* Ordered managed permission verdicts and the supplied policy's fail-closed posture.
|
|
30064
|
+
*
|
|
30065
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
30066
|
+
* via the `definition` "ManagedSettingsPermissionsEvaluateResult".
|
|
30067
|
+
*/
|
|
30068
|
+
/** @experimental */
|
|
30069
|
+
export interface ManagedSettingsPermissionsEvaluateResult {
|
|
30070
|
+
/**
|
|
30071
|
+
* One verdict per input operation, in the same order, including duplicates.
|
|
30072
|
+
*/
|
|
30073
|
+
results: ManagedPermissionEvaluation[];
|
|
30074
|
+
/**
|
|
30075
|
+
* Managed permission policy could not be determined; every operation is denied.
|
|
30076
|
+
*/
|
|
30077
|
+
failClosed: boolean;
|
|
30078
|
+
}
|
|
30079
|
+
/**
|
|
30080
|
+
* Managed policy context and ordered operations for pure, sessionless evaluation.
|
|
30081
|
+
*
|
|
30082
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
30083
|
+
* via the `definition` "ManagedSettingsPermissionsEvaluateRequest".
|
|
30084
|
+
*/
|
|
30085
|
+
/** @experimental */
|
|
30086
|
+
export interface ManagedSettingsPermissionsEvaluateRequest {
|
|
30087
|
+
context: ManagedPermissionsContext;
|
|
30088
|
+
/**
|
|
30089
|
+
* Operations to evaluate, preserving input order and duplicates. An empty batch is valid.
|
|
30090
|
+
*/
|
|
30091
|
+
operations: ManagedPermissionOperation[];
|
|
30092
|
+
}
|
|
29994
30093
|
/** @experimental */
|
|
29995
30094
|
export interface SessionWorkflowPauseAtCheckpointResult {
|
|
29996
30095
|
action: WorkflowPauseCheckpointAction;
|
|
@@ -31184,6 +31283,17 @@ export declare function createServerRpc(connection: MessageConnection): {
|
|
|
31184
31283
|
* @returns Effective enterprise managed settings for an account, resolved without a session.
|
|
31185
31284
|
*/
|
|
31186
31285
|
resolve: (params: ManagedSettingsResolveRequest) => Promise<ManagedSettingsResolveResult>;
|
|
31286
|
+
/** @experimental */
|
|
31287
|
+
permissions: {
|
|
31288
|
+
/**
|
|
31289
|
+
* Pure, sessionless evaluation of operations against a supplied permissionsContext. Performs no policy discovery, I/O, prompting, navigation, permission grants, or sandbox changes. Obtain the context from managedSettings.resolve or session.managedSettings.get, or reuse an in-memory context. Results preserve input order and duplicates. Consumers must block deny, obtain approval for ask, and use their normal permission flow for unmanaged. Unknown policy returns failClosed with every operation denied. This is not a substitute for user permissions or other security controls.
|
|
31290
|
+
*
|
|
31291
|
+
* @param params Managed policy context and ordered operations for pure, sessionless evaluation.
|
|
31292
|
+
*
|
|
31293
|
+
* @returns Ordered managed permission verdicts and the supplied policy's fail-closed posture.
|
|
31294
|
+
*/
|
|
31295
|
+
evaluate: (params: ManagedSettingsPermissionsEvaluateRequest) => Promise<ManagedSettingsPermissionsEvaluateResult>;
|
|
31296
|
+
};
|
|
31187
31297
|
/**
|
|
31188
31298
|
* Returns the managed-settings authoring JSON schema with descriptive `x-composition` annotations aligned with the shared settings-engine vocabulary. These annotations are not a complete runtime composition contract: model, effortLevel, and contextTier remain coupled. Use `managedSettings.compose` for the runtime's effective result. Performs no I/O.
|
|
31189
31299
|
*
|
package/dist/generated/rpc.js
CHANGED
|
@@ -679,6 +679,17 @@ function createServerRpc(connection) {
|
|
|
679
679
|
* @returns Effective enterprise managed settings for an account, resolved without a session.
|
|
680
680
|
*/
|
|
681
681
|
resolve: async (params) => connection.sendRequest("managedSettings.resolve", params),
|
|
682
|
+
/** @experimental */
|
|
683
|
+
permissions: {
|
|
684
|
+
/**
|
|
685
|
+
* Pure, sessionless evaluation of operations against a supplied permissionsContext. Performs no policy discovery, I/O, prompting, navigation, permission grants, or sandbox changes. Obtain the context from managedSettings.resolve or session.managedSettings.get, or reuse an in-memory context. Results preserve input order and duplicates. Consumers must block deny, obtain approval for ask, and use their normal permission flow for unmanaged. Unknown policy returns failClosed with every operation denied. This is not a substitute for user permissions or other security controls.
|
|
686
|
+
*
|
|
687
|
+
* @param params Managed policy context and ordered operations for pure, sessionless evaluation.
|
|
688
|
+
*
|
|
689
|
+
* @returns Ordered managed permission verdicts and the supplied policy's fail-closed posture.
|
|
690
|
+
*/
|
|
691
|
+
evaluate: async (params) => connection.sendRequest("managedSettings.permissions.evaluate", params)
|
|
692
|
+
},
|
|
682
693
|
/**
|
|
683
694
|
* Returns the managed-settings authoring JSON schema with descriptive `x-composition` annotations aligned with the shared settings-engine vocabulary. These annotations are not a complete runtime composition contract: model, effortLevel, and contextTier remain coupled. Use `managedSettings.compose` for the runtime's effective result. Performs no I/O.
|
|
684
695
|
*
|
|
@@ -435,6 +435,38 @@ export type ProviderQuotaCapacityState =
|
|
|
435
435
|
| "unknown"
|
|
436
436
|
/** Client-only compatibility placeholder when acquisitionStatus is unavailable or failed; not an observed service verdict. */
|
|
437
437
|
| "unavailable";
|
|
438
|
+
/**
|
|
439
|
+
* Identity scope of a monthly usage reading.
|
|
440
|
+
*/
|
|
441
|
+
export type ProviderMonthlyUsageScope =
|
|
442
|
+
/** Consumption of the authenticated user within the parent observation's service and returned cycle. */
|
|
443
|
+
"user"
|
|
444
|
+
/** The service did not establish a recognized usage scope. */
|
|
445
|
+
| "unknown";
|
|
446
|
+
/**
|
|
447
|
+
* Availability of a service's monthly consumption reading.
|
|
448
|
+
*/
|
|
449
|
+
export type ProviderMonthlyUsageState =
|
|
450
|
+
/** The service reported a usable consumption reading, including an explicit zero. */
|
|
451
|
+
"available"
|
|
452
|
+
/** The service found no usage policy; no consumption amount is known. */
|
|
453
|
+
| "no_policy"
|
|
454
|
+
/** The read failed or its data could not be used; consumption is unknown. */
|
|
455
|
+
| "unavailable"
|
|
456
|
+
/** The service reported an unrecognized usage state. */
|
|
457
|
+
| "unknown";
|
|
458
|
+
/**
|
|
459
|
+
* Units explicitly reported by a quota provider.
|
|
460
|
+
*/
|
|
461
|
+
export type ProviderQuotaUnit =
|
|
462
|
+
/** AI credits, not tokens or currency. */
|
|
463
|
+
"ai_credits"
|
|
464
|
+
/** Requests charged against an entitlement. */
|
|
465
|
+
| "requests"
|
|
466
|
+
/** Model tokens. */
|
|
467
|
+
| "tokens"
|
|
468
|
+
/** The observation does not establish a quantity unit. */
|
|
469
|
+
| "unknown";
|
|
438
470
|
/**
|
|
439
471
|
* Timing and purpose of a provider quota observation.
|
|
440
472
|
*/
|
|
@@ -453,18 +485,6 @@ export type ProviderQuotaQuantityKind =
|
|
|
453
485
|
| "advisory_balance"
|
|
454
486
|
/** No quantity measurement, as with admission-only response headers. */
|
|
455
487
|
| "none";
|
|
456
|
-
/**
|
|
457
|
-
* Units explicitly reported by a quota provider.
|
|
458
|
-
*/
|
|
459
|
-
export type ProviderQuotaUnit =
|
|
460
|
-
/** AI credits, not tokens or currency. */
|
|
461
|
-
"ai_credits"
|
|
462
|
-
/** Requests charged against an entitlement. */
|
|
463
|
-
| "requests"
|
|
464
|
-
/** Model tokens. */
|
|
465
|
-
| "tokens"
|
|
466
|
-
/** The observation does not establish a quantity unit. */
|
|
467
|
-
| "unknown";
|
|
468
488
|
/**
|
|
469
489
|
* What initiated a conversation compaction
|
|
470
490
|
*/
|
|
@@ -764,6 +784,16 @@ export type AssistantUsageApiEndpoint =
|
|
|
764
784
|
| "/responses"
|
|
765
785
|
/** WebSocket Responses API endpoint. */
|
|
766
786
|
| "ws:/responses";
|
|
787
|
+
/**
|
|
788
|
+
* Content-Encoding applied to the request body sent on the wire
|
|
789
|
+
*/
|
|
790
|
+
export type ModelCallRequestBodyEncoding =
|
|
791
|
+
/** The request body was sent uncompressed (including every WebSocket request). */
|
|
792
|
+
"identity"
|
|
793
|
+
/** The request body was sent gzip-compressed. */
|
|
794
|
+
| "gzip"
|
|
795
|
+
/** The request body was sent zstd-compressed. */
|
|
796
|
+
| "zstd";
|
|
767
797
|
/**
|
|
768
798
|
* Transport used for a successful model call
|
|
769
799
|
*/
|
|
@@ -772,6 +802,34 @@ export type AssistantUsageTransport =
|
|
|
772
802
|
"http"
|
|
773
803
|
/** WebSocket transport. */
|
|
774
804
|
| "websocket";
|
|
805
|
+
/**
|
|
806
|
+
* Normalized cause of the WebSocket failure that triggered the HTTP fallback
|
|
807
|
+
*/
|
|
808
|
+
export type ModelCallWebSocketFallbackErrorKind =
|
|
809
|
+
/** DNS resolution of the WebSocket host failed. */
|
|
810
|
+
"dns"
|
|
811
|
+
/** The TLS handshake or a TLS record failed. */
|
|
812
|
+
| "tls"
|
|
813
|
+
/** A WebSocket connect or read timed out. */
|
|
814
|
+
| "timeout"
|
|
815
|
+
/** The peer refused the TCP connection. */
|
|
816
|
+
| "connection_refused"
|
|
817
|
+
/** The connection was reset, aborted, or ended mid-stream without a close. */
|
|
818
|
+
| "connection_reset"
|
|
819
|
+
/** The peer closed the WebSocket. */
|
|
820
|
+
| "closed_by_peer"
|
|
821
|
+
/** The runtime closed the WebSocket itself. */
|
|
822
|
+
| "closed_locally"
|
|
823
|
+
/** The socket was already closed before it was used. */
|
|
824
|
+
| "not_connected"
|
|
825
|
+
/** The upgrade or request was rejected with an HTTP status. */
|
|
826
|
+
| "http_status"
|
|
827
|
+
/** A WebSocket protocol violation or an undecodable frame. */
|
|
828
|
+
| "protocol"
|
|
829
|
+
/** The WebSocket request could not be built. */
|
|
830
|
+
| "configuration"
|
|
831
|
+
/** A failure that maps onto none of the other kinds. */
|
|
832
|
+
| "other";
|
|
775
833
|
/**
|
|
776
834
|
* Why a WebSocket-capable model call was carried by the HTTP fallback
|
|
777
835
|
*/
|
|
@@ -3569,6 +3627,7 @@ export interface ProviderQuotaState {
|
|
|
3569
3627
|
* HTTP status from acquisition, when available.
|
|
3570
3628
|
*/
|
|
3571
3629
|
httpStatus?: number;
|
|
3630
|
+
monthlyUsage?: ProviderMonthlyUsage;
|
|
3572
3631
|
observationKind?: ProviderQuotaObservationKind;
|
|
3573
3632
|
/**
|
|
3574
3633
|
* When the runtime observed this reading, not a charge timestamp or guarantee that consumption has settled.
|
|
@@ -3643,6 +3702,31 @@ export interface ProviderQuotaBudgetMetadata {
|
|
|
3643
3702
|
*/
|
|
3644
3703
|
usageAllowedWhenExhausted: boolean;
|
|
3645
3704
|
}
|
|
3705
|
+
/**
|
|
3706
|
+
* An authoritative monthly usage reading for the observation's provider, account, and service.
|
|
3707
|
+
*/
|
|
3708
|
+
/** @experimental */
|
|
3709
|
+
export interface ProviderMonthlyUsage {
|
|
3710
|
+
/**
|
|
3711
|
+
* Nonnegative finite consumption reported by the service, preserving zero and fractions. Present only when state is available; never computed from tokens or balance differences.
|
|
3712
|
+
*/
|
|
3713
|
+
consumedQuantity?: number;
|
|
3714
|
+
/**
|
|
3715
|
+
* Start of the service-reported monthly billing cycle, in UTC RFC 3339.
|
|
3716
|
+
*/
|
|
3717
|
+
cycleStart?: string;
|
|
3718
|
+
/**
|
|
3719
|
+
* Service read time in UTC RFC 3339, not a ledger reconciliation watermark or confirmation of the latest inference charge.
|
|
3720
|
+
*/
|
|
3721
|
+
queriedAt?: string;
|
|
3722
|
+
/**
|
|
3723
|
+
* End of the service-reported monthly billing cycle, in UTC RFC 3339.
|
|
3724
|
+
*/
|
|
3725
|
+
resetOn?: string;
|
|
3726
|
+
scope: ProviderMonthlyUsageScope;
|
|
3727
|
+
state: ProviderMonthlyUsageState;
|
|
3728
|
+
unit: ProviderQuotaUnit;
|
|
3729
|
+
}
|
|
3646
3730
|
/**
|
|
3647
3731
|
* Session event "session.context_changed". Updated working directory and git context after the change
|
|
3648
3732
|
*/
|
|
@@ -6614,9 +6698,14 @@ export interface AssistantUsageData {
|
|
|
6614
6698
|
*/
|
|
6615
6699
|
rejectedPredictionTokens?: number;
|
|
6616
6700
|
/**
|
|
6617
|
-
* Serialized (uncompressed) byte length of the request body. A content-free size signal.
|
|
6701
|
+
* Serialized (uncompressed) byte length of the request body, before any Content-Encoding. A content-free size signal.
|
|
6618
6702
|
*/
|
|
6619
6703
|
requestBodyBytes?: number;
|
|
6704
|
+
requestBodyEncoding?: ModelCallRequestBodyEncoding;
|
|
6705
|
+
/**
|
|
6706
|
+
* Byte length of the request body actually sent on the wire for the attempt that produced this outcome, after any Content-Encoding. Equals requestBodyBytes when the body was not compressed.
|
|
6707
|
+
*/
|
|
6708
|
+
requestBodyWireBytes?: number;
|
|
6620
6709
|
/**
|
|
6621
6710
|
* Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable.
|
|
6622
6711
|
*/
|
|
@@ -6634,7 +6723,24 @@ export interface AssistantUsageData {
|
|
|
6634
6723
|
* Milliseconds spent on the WebSocket attempt before falling back to HTTP
|
|
6635
6724
|
*/
|
|
6636
6725
|
websocketFallbackAfterMs?: number;
|
|
6726
|
+
/**
|
|
6727
|
+
* WebSocket close code received before the HTTP fallback
|
|
6728
|
+
*/
|
|
6729
|
+
websocketFallbackCloseCode?: number;
|
|
6730
|
+
websocketFallbackErrorKind?: ModelCallWebSocketFallbackErrorKind;
|
|
6637
6731
|
websocketFallbackReason?: ModelCallWebSocketFallbackReason;
|
|
6732
|
+
/**
|
|
6733
|
+
* Whether a WebSocket reconnect was attempted before falling back to HTTP
|
|
6734
|
+
*/
|
|
6735
|
+
websocketFallbackReconnectAttempted?: boolean;
|
|
6736
|
+
/**
|
|
6737
|
+
* Whether the HTTP fallback started during this model call, rather than being inherited from an earlier call
|
|
6738
|
+
*/
|
|
6739
|
+
websocketFallbackStartedThisCall?: boolean;
|
|
6740
|
+
/**
|
|
6741
|
+
* HTTP status of the WebSocket upgrade rejection or WebSocket API error that triggered the HTTP fallback
|
|
6742
|
+
*/
|
|
6743
|
+
websocketFallbackStatusCode?: number;
|
|
6638
6744
|
}
|
|
6639
6745
|
/**
|
|
6640
6746
|
* Ordered accounting identity assigned under the source session's emission lock.
|
|
@@ -6803,9 +6909,14 @@ export interface ModelCallFailureData {
|
|
|
6803
6909
|
*/
|
|
6804
6910
|
reasoningEffort?: string;
|
|
6805
6911
|
/**
|
|
6806
|
-
* Serialized (uncompressed) byte length of the failed request body. A content-free size signal.
|
|
6912
|
+
* Serialized (uncompressed) byte length of the failed request body, before any Content-Encoding. A content-free size signal.
|
|
6807
6913
|
*/
|
|
6808
6914
|
requestBodyBytes?: number;
|
|
6915
|
+
requestBodyEncoding?: ModelCallRequestBodyEncoding;
|
|
6916
|
+
/**
|
|
6917
|
+
* Byte length of the failed request body actually sent on the wire, after any Content-Encoding. Equals requestBodyBytes when the body was not compressed.
|
|
6918
|
+
*/
|
|
6919
|
+
requestBodyWireBytes?: number;
|
|
6809
6920
|
requestFingerprint?: ModelCallFailureRequestFingerprint;
|
|
6810
6921
|
/**
|
|
6811
6922
|
* Zero-based orchestrator retry index of the failed attempt
|
|
@@ -6829,7 +6940,24 @@ export interface ModelCallFailureData {
|
|
|
6829
6940
|
* Milliseconds spent on the WebSocket attempt before falling back to HTTP
|
|
6830
6941
|
*/
|
|
6831
6942
|
websocketFallbackAfterMs?: number;
|
|
6943
|
+
/**
|
|
6944
|
+
* WebSocket close code received before the HTTP fallback
|
|
6945
|
+
*/
|
|
6946
|
+
websocketFallbackCloseCode?: number;
|
|
6947
|
+
websocketFallbackErrorKind?: ModelCallWebSocketFallbackErrorKind;
|
|
6832
6948
|
websocketFallbackReason?: ModelCallWebSocketFallbackReason;
|
|
6949
|
+
/**
|
|
6950
|
+
* Whether a WebSocket reconnect was attempted before falling back to HTTP
|
|
6951
|
+
*/
|
|
6952
|
+
websocketFallbackReconnectAttempted?: boolean;
|
|
6953
|
+
/**
|
|
6954
|
+
* Whether the HTTP fallback started during this model call, rather than being inherited from an earlier call
|
|
6955
|
+
*/
|
|
6956
|
+
websocketFallbackStartedThisCall?: boolean;
|
|
6957
|
+
/**
|
|
6958
|
+
* HTTP status of the WebSocket upgrade rejection or WebSocket API error that triggered the HTTP fallback
|
|
6959
|
+
*/
|
|
6960
|
+
websocketFallbackStatusCode?: number;
|
|
6833
6961
|
}
|
|
6834
6962
|
/**
|
|
6835
6963
|
* Content-free structural summary of the failing request for diagnosing malformed 4xx calls
|
|
@@ -12301,6 +12429,7 @@ export interface ManagedSettingsResolvedData {
|
|
|
12301
12429
|
* Whether at least two managed sources supplied permission allowlists, so enforcement intersects them and the flattened settings payload omits `permissions.allow`.
|
|
12302
12430
|
*/
|
|
12303
12431
|
permissionsAllowIntersected?: boolean;
|
|
12432
|
+
permissionsContext?: ManagedPermissionsContext;
|
|
12304
12433
|
/**
|
|
12305
12434
|
* Whether the policy-helper managed-settings layer was present. The policy helper is the weakest channel: it fills keys no enterprise source set and can never replace one.
|
|
12306
12435
|
*/
|
|
@@ -12319,6 +12448,19 @@ export interface ManagedSettingsResolvedData {
|
|
|
12319
12448
|
settings?: JsonValue;
|
|
12320
12449
|
source: ManagedSettingsResolvedSource;
|
|
12321
12450
|
}
|
|
12451
|
+
/**
|
|
12452
|
+
* Reusable managed permission evaluation context. Treat permissions as runtime-owned policy data and retain it verbatim; it includes source-aware composition metadata. This is a snapshot, not a capability or approval token; only use contexts obtained from trusted policy sources.
|
|
12453
|
+
*/
|
|
12454
|
+
export interface ManagedPermissionsContext {
|
|
12455
|
+
/**
|
|
12456
|
+
* Policy could not be determined; evaluation must deny every operation.
|
|
12457
|
+
*/
|
|
12458
|
+
failClosed: boolean;
|
|
12459
|
+
/**
|
|
12460
|
+
* Runtime-owned composed permissions object. Absent when no permission policy is configured.
|
|
12461
|
+
*/
|
|
12462
|
+
permissions?: JsonValue;
|
|
12463
|
+
}
|
|
12322
12464
|
/**
|
|
12323
12465
|
* Session event "session.managed_settings_enforced". Runtime enforcement of enterprise managed settings: fires when the session blocks or caps a runtime action because enterprise policy governs it, so SDK clients can explain *why* an action was governed. Unlike `session.managed_settings_resolved` (which reports *what* is managed), this reports a concrete governed action — e.g. a user or host tried to turn on bypass permissions or Assisted Permissions while the corresponding policy disables it. Emitted live (not persisted to the session event log) on user/host-initiated attempts only, never for silent policy application. Marked experimental while the managed-settings surface stabilizes.
|
|
12324
12466
|
*/
|
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.20-preview.0",
|
|
9
|
+
"copilotCliVersion": "1.0.96-0",
|
|
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",
|
|
@@ -104,18 +104,18 @@
|
|
|
104
104
|
"README.md"
|
|
105
105
|
],
|
|
106
106
|
"copilotRuntime": {
|
|
107
|
-
"sourceSha": "
|
|
108
|
-
"version": "1.0.
|
|
107
|
+
"sourceSha": "2d97cdf84e4eed006767c83f2e6dc61b07754b35",
|
|
108
|
+
"version": "1.0.96-0",
|
|
109
109
|
"visibility": "public"
|
|
110
110
|
},
|
|
111
111
|
"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.
|
|
112
|
+
"@github/copilot-sdk-darwin-arm64": "1.0.20-preview.0",
|
|
113
|
+
"@github/copilot-sdk-darwin-x64": "1.0.20-preview.0",
|
|
114
|
+
"@github/copilot-sdk-linux-arm64": "1.0.20-preview.0",
|
|
115
|
+
"@github/copilot-sdk-linux-x64": "1.0.20-preview.0",
|
|
116
|
+
"@github/copilot-sdk-linuxmusl-arm64": "1.0.20-preview.0",
|
|
117
|
+
"@github/copilot-sdk-linuxmusl-x64": "1.0.20-preview.0",
|
|
118
|
+
"@github/copilot-sdk-win32-arm64": "1.0.20-preview.0",
|
|
119
|
+
"@github/copilot-sdk-win32-x64": "1.0.20-preview.0"
|
|
120
120
|
}
|
|
121
121
|
}
|