@github/copilot-sdk 1.0.21 → 1.0.22-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 +1 -0
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +2 -0
- package/dist/cjs/generated/rpc.js +11 -0
- package/dist/cjs/session.js +15 -1
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.js +2 -0
- package/dist/generated/rpc.d.ts +211 -1
- package/dist/generated/rpc.js +11 -0
- package/dist/session.js +15 -1
- package/dist/types.d.ts +7 -0
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -375,6 +375,7 @@ Create a new conversation session.
|
|
|
375
375
|
- `workingDirectory?: string` - Working directory for the session (default: runtime process cwd).
|
|
376
376
|
- `refreshCustomInstructions?: boolean` - Invalidates the process-wide custom-instruction discovery cache before creating this session, so instruction-file edits made in the same runtime are read again. Defaults to `false` (cache reuse). Other sessions in this runtime may observe updated instructions on later turns or discovery. This does not watch files or enable disabled instruction loading. Available on `SessionConfig`, not `ResumeSessionConfig`.
|
|
377
377
|
- `enableSessionStore?: boolean` - Enables the cross-session store for search and retrieval across sessions. When unset in `"copilot-cli"` mode, the runtime default applies (enabled). In `"empty"` mode, defaults to disabled.
|
|
378
|
+
- `enableGitHubCacheStore?: boolean` - Requests the read-only GitHub cache store (`github-cache-store` capability) on create or resume. The runtime registers the `github_sql` tool only when its `GITHUB_CACHE_STORE` feature flag is also on. Defaults to disabled in every mode.
|
|
378
379
|
- `gitHubTokenProvider?: GitHubTokenProvider` - Acquires rotating, session-scoped GitHub tokens. Token results require a positive `expiresIn` value in seconds remaining when the callback completes; production tokens typically last eight hours. Cannot be combined with `gitHubToken`.
|
|
379
380
|
- `provider?: ProviderConfig` - Custom API provider configuration (BYOK - Bring Your Own Key). See [Custom Providers](#custom-providers) section.
|
|
380
381
|
- `onPermissionRequest?: PermissionHandler` - Optional handler called before each tool execution to approve or deny it. When omitted, permission requests are emitted as events and left pending for manual resolution. `approveAll` approves requests when managed settings are disabled and throws when `enableManagedSettings` is true. Custom handlers can inspect `managedApprovalRequired` for human-facing confirmation logic. See [Permission Handling](#permission-handling) section.
|
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.98-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
|
@@ -1375,6 +1375,7 @@ class CopilotClient {
|
|
|
1375
1375
|
enableFileHooks: config.enableFileHooks,
|
|
1376
1376
|
enableHostGitOperations: config.enableHostGitOperations,
|
|
1377
1377
|
enableSessionStore: config.enableSessionStore,
|
|
1378
|
+
enableGitHubCacheStore: config.enableGitHubCacheStore,
|
|
1378
1379
|
enableSkills: config.enableSkills,
|
|
1379
1380
|
skillDirectories: config.skillDirectories,
|
|
1380
1381
|
...config.skillProvider ? { hasSkillProvider: true } : {},
|
|
@@ -1633,6 +1634,7 @@ class CopilotClient {
|
|
|
1633
1634
|
enableFileHooks: config.enableFileHooks,
|
|
1634
1635
|
enableHostGitOperations: config.enableHostGitOperations,
|
|
1635
1636
|
enableSessionStore: config.enableSessionStore,
|
|
1637
|
+
enableGitHubCacheStore: config.enableGitHubCacheStore,
|
|
1636
1638
|
enableSkills: config.enableSkills,
|
|
1637
1639
|
streaming: config.streaming,
|
|
1638
1640
|
includeSubAgentStreamingEvents: config.includeSubAgentStreamingEvents ?? true,
|
|
@@ -265,6 +265,17 @@ function createServerRpc(connection) {
|
|
|
265
265
|
getBuiltInCatalog: async () => connection.sendRequest("models.getBuiltInCatalog", {})
|
|
266
266
|
},
|
|
267
267
|
/** @experimental */
|
|
268
|
+
contentExclusion: {
|
|
269
|
+
/**
|
|
270
|
+
* Validates candidate content-exclusion policies and returns them normalized, without starting a session. This runs the same parser the runtime's own policy enforcement uses, so a host cannot accept a policy set the runtime would later reject, nor reject one it would have honored. Call it when policies arrive from outside the runtime — a command-line flag, a configuration file, a host's own settings — and must be checked before a session exists to apply them to. A malformed document fails with a message prefixed `Invalid JSON: `; a well-formed document that violates the policy schema fails with the offending field paths.
|
|
271
|
+
*
|
|
272
|
+
* @param params Candidate content-exclusion policies to validate, as the raw JSON text a host received. The text is supplied unparsed so that a syntax error and a schema violation are both reported by the runtime's own validator rather than by the caller's JSON parser.
|
|
273
|
+
*
|
|
274
|
+
* @returns The accepted policies, parsed and normalized. A rejected input is reported as an error rather than in this result.
|
|
275
|
+
*/
|
|
276
|
+
validatePolicies: async (params) => connection.sendRequest("contentExclusion.validatePolicies", params)
|
|
277
|
+
},
|
|
278
|
+
/** @experimental */
|
|
268
279
|
tools: {
|
|
269
280
|
/**
|
|
270
281
|
* Lists built-in tools available for a model.
|
package/dist/cjs/session.js
CHANGED
|
@@ -75,6 +75,20 @@ function deserializeHookInput(raw) {
|
|
|
75
75
|
...stop_hook_active === void 0 ? {} : { stopHookActive: stop_hook_active }
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
+
function normalizeHookError(hookType, input) {
|
|
79
|
+
if (hookType !== "errorOccurred" && hookType !== "sessionEnd") {
|
|
80
|
+
return input;
|
|
81
|
+
}
|
|
82
|
+
if (!input || typeof input !== "object" || !("error" in input)) {
|
|
83
|
+
return input;
|
|
84
|
+
}
|
|
85
|
+
const { error } = input;
|
|
86
|
+
if (!error || typeof error !== "object" || Array.isArray(error)) {
|
|
87
|
+
return input;
|
|
88
|
+
}
|
|
89
|
+
const { message } = error;
|
|
90
|
+
return { ...input, error: typeof message === "string" ? message : JSON.stringify(error) };
|
|
91
|
+
}
|
|
78
92
|
function isOpenCanvasInstance(value) {
|
|
79
93
|
if (!value || typeof value !== "object") {
|
|
80
94
|
return false;
|
|
@@ -1793,7 +1807,7 @@ class CopilotSession {
|
|
|
1793
1807
|
if (!this.hooks) {
|
|
1794
1808
|
return void 0;
|
|
1795
1809
|
}
|
|
1796
|
-
const normalized = deserializeHookInput(input);
|
|
1810
|
+
const normalized = normalizeHookError(hookType, deserializeHookInput(input));
|
|
1797
1811
|
const handlerMap = {
|
|
1798
1812
|
preToolUse: this.hooks.onPreToolUse,
|
|
1799
1813
|
preMcpToolCall: this.hooks.onPreMcpToolCall,
|
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.98-0";
|
|
2
2
|
export declare const COPILOT_CLI_USE_NPM_PACKAGE = false;
|
package/dist/cliVersion.js
CHANGED
package/dist/client.js
CHANGED
|
@@ -1355,6 +1355,7 @@ class CopilotClient {
|
|
|
1355
1355
|
enableFileHooks: config.enableFileHooks,
|
|
1356
1356
|
enableHostGitOperations: config.enableHostGitOperations,
|
|
1357
1357
|
enableSessionStore: config.enableSessionStore,
|
|
1358
|
+
enableGitHubCacheStore: config.enableGitHubCacheStore,
|
|
1358
1359
|
enableSkills: config.enableSkills,
|
|
1359
1360
|
skillDirectories: config.skillDirectories,
|
|
1360
1361
|
...config.skillProvider ? { hasSkillProvider: true } : {},
|
|
@@ -1613,6 +1614,7 @@ class CopilotClient {
|
|
|
1613
1614
|
enableFileHooks: config.enableFileHooks,
|
|
1614
1615
|
enableHostGitOperations: config.enableHostGitOperations,
|
|
1615
1616
|
enableSessionStore: config.enableSessionStore,
|
|
1617
|
+
enableGitHubCacheStore: config.enableGitHubCacheStore,
|
|
1616
1618
|
enableSkills: config.enableSkills,
|
|
1617
1619
|
streaming: config.streaming,
|
|
1618
1620
|
includeSubAgentStreamingEvents: config.includeSubAgentStreamingEvents ?? true,
|
package/dist/generated/rpc.d.ts
CHANGED
|
@@ -622,6 +622,80 @@ export type CatalogAgentPluginCompatibilityTag =
|
|
|
622
622
|
| "canvas-only"
|
|
623
623
|
/** The plugin targets GitHub Copilot. */
|
|
624
624
|
| "github-copilot";
|
|
625
|
+
/**
|
|
626
|
+
* Typed installability state for an Agent Plugin candidate
|
|
627
|
+
*
|
|
628
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
629
|
+
* via the `definition` "CatalogAgentPluginInstallability".
|
|
630
|
+
*/
|
|
631
|
+
/** @experimental */
|
|
632
|
+
export type CatalogAgentPluginInstallability =
|
|
633
|
+
/** The candidate carries complete, verified install data and the selected session may install it. Its install plan is present. */
|
|
634
|
+
"installable"
|
|
635
|
+
/** The catalogue supplied no complete, verified install data, so no install target is offered. */
|
|
636
|
+
| "install-data-unavailable"
|
|
637
|
+
/** Plugin installation is understood but disabled for the selected session. */
|
|
638
|
+
| "feature-disabled"
|
|
639
|
+
/** Reserved for plugin formats this runtime cannot install. Every format surfaced today installs through a marketplace. */
|
|
640
|
+
| "not-installable-kind";
|
|
641
|
+
/**
|
|
642
|
+
* One place an Agent Plugin can install from: Agent Finder's materialisation, a marketplace, or a GitHub repository. Each variant carries only its own fields.
|
|
643
|
+
*
|
|
644
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
645
|
+
* via the `definition` "CatalogAgentPluginInstallSource".
|
|
646
|
+
*/
|
|
647
|
+
/** @experimental */
|
|
648
|
+
export type CatalogAgentPluginInstallSource = CatalogAgentPluginMaterializationSource | CatalogAgentPluginMarketplaceSource | CatalogAgentPluginRepositorySource;
|
|
649
|
+
/**
|
|
650
|
+
* Discriminator for a materialisation install source
|
|
651
|
+
*
|
|
652
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
653
|
+
* via the `definition` "CatalogAgentPluginMaterializationSourceKind".
|
|
654
|
+
*/
|
|
655
|
+
/** @experimental */
|
|
656
|
+
export type CatalogAgentPluginMaterializationSourceKind =
|
|
657
|
+
/** Install from Agent Finder's verified materialisation. */
|
|
658
|
+
"materialization";
|
|
659
|
+
/**
|
|
660
|
+
* Discriminator for a marketplace install source
|
|
661
|
+
*
|
|
662
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
663
|
+
* via the `definition` "CatalogAgentPluginMarketplaceSourceKind".
|
|
664
|
+
*/
|
|
665
|
+
/** @experimental */
|
|
666
|
+
export type CatalogAgentPluginMarketplaceSourceKind = "marketplace";
|
|
667
|
+
/**
|
|
668
|
+
* Discriminator for a repository install source
|
|
669
|
+
*
|
|
670
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
671
|
+
* via the `definition` "CatalogAgentPluginRepositorySourceKind".
|
|
672
|
+
*/
|
|
673
|
+
/** @experimental */
|
|
674
|
+
export type CatalogAgentPluginRepositorySourceKind = "repository";
|
|
675
|
+
/**
|
|
676
|
+
* A kind of component an Agent Plugin contributes
|
|
677
|
+
*
|
|
678
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
679
|
+
* via the `definition` "CatalogAgentPluginComponent".
|
|
680
|
+
*/
|
|
681
|
+
/** @experimental */
|
|
682
|
+
export type CatalogAgentPluginComponent =
|
|
683
|
+
/** Custom agents. */
|
|
684
|
+
"agent"
|
|
685
|
+
/** Slash commands. */
|
|
686
|
+
| "command"
|
|
687
|
+
/** Skills. */
|
|
688
|
+
| "skill"
|
|
689
|
+
/** Hooks. */
|
|
690
|
+
| "hook"
|
|
691
|
+
/** Bundled MCP servers. */
|
|
692
|
+
| "mcp-server"
|
|
693
|
+
/** Bundled LSP servers. */
|
|
694
|
+
| "lsp-server"
|
|
695
|
+
/** Extensions. */
|
|
696
|
+
| "extension"
|
|
697
|
+
/** Canvases. */
|
|
698
|
+
| "canvas";
|
|
625
699
|
/**
|
|
626
700
|
* A versioned, bounded trust observation carried unchanged with a catalog candidate and its private handle context. Current observations require a recognised T1/T2 tier; every non-current state structurally forbids a tier. Eligibility remains `unknown` while Agent Finder supplies no exposure decision, and states absent from its current wire are never inferred from age, relevance, popularity, or a tier transition.
|
|
627
701
|
*
|
|
@@ -887,7 +961,9 @@ export type CatalogCapability =
|
|
|
887
961
|
/** Extends mcp-confirmed-remote-installation to declared non-secret header and URL values and receipt-owned header secrets for personal remote MCP choices. Requires mcp-confirmed-remote-installation and bound session authority. Secret values are written only to the reviewed backend after confirmation and are never returned; package and stdio choices remain unsupported. Advertised only when owned secret effects and owned secret activation are linked. */
|
|
888
962
|
| "mcp-configured-remote-installation"
|
|
889
963
|
/** Understands verified Agent Finder Skill install, uninstall, recovery and installation-scoped enablement APIs. Advertised only by runtimes with the Skill installation engine linked; acquisition may still be refused as feature-disabled per selected session. */
|
|
890
|
-
| "skill-confirmed-installation"
|
|
964
|
+
| "skill-confirmed-installation"
|
|
965
|
+
/** Understands `installability` and the reviewable `installPlan` on Agent Plugin candidates. Requires agent-plugin-discovery; without it, plugin candidates are unchanged. A plugin is installable only with complete, verified catalogue install data, and may still be reported as feature-disabled per selected session. */
|
|
966
|
+
| "agent-plugin-confirmed-installation";
|
|
891
967
|
/**
|
|
892
968
|
* Bounded extensible wire-feature identifier. Known values are described by `CatalogCapability`; newer callers may send future identifiers so an older runtime can return a typed negotiation refusal instead of failing schema validation. Capability negotiation establishes contract understanding, while each operation's result separately reports runtime availability.
|
|
893
969
|
*
|
|
@@ -4394,6 +4470,8 @@ export type SessionCapability =
|
|
|
4394
4470
|
| "elicitation"
|
|
4395
4471
|
/** Cross-session history tools and session-store SQL prompt/tool metadata. */
|
|
4396
4472
|
| "session-store"
|
|
4473
|
+
/** Read-only GitHub cache SQL tool (github_sql). */
|
|
4474
|
+
| "github-cache-store"
|
|
4397
4475
|
/** MCP Apps UI passthrough. */
|
|
4398
4476
|
| "mcp-apps"
|
|
4399
4477
|
/** Host-provided canvas rendering support. */
|
|
@@ -8214,6 +8292,8 @@ export interface CatalogAgentPluginCandidate {
|
|
|
8214
8292
|
compatibilityTags: ({
|
|
8215
8293
|
[k: string]: unknown | undefined;
|
|
8216
8294
|
} & []) | [CatalogAgentPluginCompatibilityTag] | [CatalogAgentPluginCompatibilityTag, CatalogAgentPluginCompatibilityTag] | [CatalogAgentPluginCompatibilityTag, CatalogAgentPluginCompatibilityTag, CatalogAgentPluginCompatibilityTag];
|
|
8295
|
+
installability?: CatalogAgentPluginInstallability;
|
|
8296
|
+
installPlan?: CatalogAgentPluginInstallPlan;
|
|
8217
8297
|
provenance: CatalogAgentPluginCandidateProvenance;
|
|
8218
8298
|
trust?: CatalogTrustSnapshot;
|
|
8219
8299
|
}
|
|
@@ -8234,6 +8314,99 @@ export interface CatalogPluginRepositorySource {
|
|
|
8234
8314
|
*/
|
|
8235
8315
|
path: string;
|
|
8236
8316
|
}
|
|
8317
|
+
/**
|
|
8318
|
+
* What installing an Agent Plugin would do, for the user to review and confirm. Provisional: the catalogue install data it is built from is not final.
|
|
8319
|
+
*
|
|
8320
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
8321
|
+
* via the `definition` "CatalogAgentPluginInstallPlan".
|
|
8322
|
+
*/
|
|
8323
|
+
/** @experimental */
|
|
8324
|
+
export interface CatalogAgentPluginInstallPlan {
|
|
8325
|
+
/**
|
|
8326
|
+
* Every valid install source, in preference order: materialization, then marketplace, then repository. Each kind appears at most once.
|
|
8327
|
+
*
|
|
8328
|
+
* @minItems 1
|
|
8329
|
+
* @maxItems 3
|
|
8330
|
+
*/
|
|
8331
|
+
sources: [CatalogAgentPluginInstallSource] | [CatalogAgentPluginInstallSource, CatalogAgentPluginInstallSource] | [CatalogAgentPluginInstallSource, CatalogAgentPluginInstallSource, CatalogAgentPluginInstallSource];
|
|
8332
|
+
/**
|
|
8333
|
+
* The plugin's name, as named in its marketplace or manifest.
|
|
8334
|
+
*/
|
|
8335
|
+
pluginName: string;
|
|
8336
|
+
version?: CatalogResourceVersion;
|
|
8337
|
+
/**
|
|
8338
|
+
* Exact full commit ID to install, in lowercase hex. Always present when the plan has a repository source; a plan with a marketplace source carries at least one of version and commit.
|
|
8339
|
+
*/
|
|
8340
|
+
commit?: string;
|
|
8341
|
+
/**
|
|
8342
|
+
* Components the plugin contributes, in canonical order.
|
|
8343
|
+
*
|
|
8344
|
+
* @minItems 1
|
|
8345
|
+
*/
|
|
8346
|
+
components: [CatalogAgentPluginComponent, ...CatalogAgentPluginComponent[]];
|
|
8347
|
+
/**
|
|
8348
|
+
* Canvas IDs the plugin contributes. Non-empty exactly when components include `canvas`.
|
|
8349
|
+
*/
|
|
8350
|
+
canvasIds: string[];
|
|
8351
|
+
/**
|
|
8352
|
+
* Extension IDs the plugin contributes. Non-empty exactly when components include `extension`.
|
|
8353
|
+
*/
|
|
8354
|
+
extensionIds: string[];
|
|
8355
|
+
/**
|
|
8356
|
+
* MCP servers the plugin depends on but does not bundle.
|
|
8357
|
+
*/
|
|
8358
|
+
mcpDependencies: string[];
|
|
8359
|
+
/**
|
|
8360
|
+
* Connectors the plugin depends on.
|
|
8361
|
+
*/
|
|
8362
|
+
connectorDependencies: string[];
|
|
8363
|
+
}
|
|
8364
|
+
/**
|
|
8365
|
+
* Agent Finder's verified materialisation of the plugin. Present only when the candidate carries a complete materialisation reference; the reference itself stays runtime-private.
|
|
8366
|
+
*
|
|
8367
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
8368
|
+
* via the `definition` "CatalogAgentPluginMaterializationSource".
|
|
8369
|
+
*/
|
|
8370
|
+
/** @experimental */
|
|
8371
|
+
export interface CatalogAgentPluginMaterializationSource {
|
|
8372
|
+
kind: CatalogAgentPluginMaterializationSourceKind;
|
|
8373
|
+
}
|
|
8374
|
+
/**
|
|
8375
|
+
* A plugin marketplace named by verified catalogue install data, installed as `pluginName@name`.
|
|
8376
|
+
*
|
|
8377
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
8378
|
+
* via the `definition` "CatalogAgentPluginMarketplaceSource".
|
|
8379
|
+
*/
|
|
8380
|
+
/** @experimental */
|
|
8381
|
+
export interface CatalogAgentPluginMarketplaceSource {
|
|
8382
|
+
kind: CatalogAgentPluginMarketplaceSourceKind;
|
|
8383
|
+
/**
|
|
8384
|
+
* Marketplace name.
|
|
8385
|
+
*/
|
|
8386
|
+
name: string;
|
|
8387
|
+
/**
|
|
8388
|
+
* Canonical lowercase GitHub owner/repository hosting the marketplace.
|
|
8389
|
+
*/
|
|
8390
|
+
repository: string;
|
|
8391
|
+
}
|
|
8392
|
+
/**
|
|
8393
|
+
* A GitHub repository holding the plugin, installed directly as `owner/repo[:path]` at the plan's commit, without a marketplace.
|
|
8394
|
+
*
|
|
8395
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
8396
|
+
* via the `definition` "CatalogAgentPluginRepositorySource".
|
|
8397
|
+
*/
|
|
8398
|
+
/** @experimental */
|
|
8399
|
+
export interface CatalogAgentPluginRepositorySource {
|
|
8400
|
+
kind: CatalogAgentPluginRepositorySourceKind;
|
|
8401
|
+
/**
|
|
8402
|
+
* Canonical lowercase GitHub owner/repository holding the plugin.
|
|
8403
|
+
*/
|
|
8404
|
+
repository: string;
|
|
8405
|
+
/**
|
|
8406
|
+
* Relative POSIX path of the plugin directory in the repository. Omitted when the plugin is at the repository root.
|
|
8407
|
+
*/
|
|
8408
|
+
path?: string;
|
|
8409
|
+
}
|
|
8237
8410
|
/**
|
|
8238
8411
|
* Where and when an Agent Plugin catalog reference was observed. Discovery provenance deliberately carries no descriptor URL, raw data, candidate handle, or content digest.
|
|
8239
8412
|
*
|
|
@@ -9973,6 +10146,32 @@ export interface ContentExclusionPathCheck {
|
|
|
9973
10146
|
*/
|
|
9974
10147
|
excluded: boolean;
|
|
9975
10148
|
}
|
|
10149
|
+
/**
|
|
10150
|
+
* Candidate content-exclusion policies to validate, as the raw JSON text a host received. The text is supplied unparsed so that a syntax error and a schema violation are both reported by the runtime's own validator rather than by the caller's JSON parser.
|
|
10151
|
+
*
|
|
10152
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
10153
|
+
* via the `definition` "ContentExclusionValidatePoliciesRequest".
|
|
10154
|
+
*/
|
|
10155
|
+
/** @experimental */
|
|
10156
|
+
export interface ContentExclusionValidatePoliciesRequest {
|
|
10157
|
+
/**
|
|
10158
|
+
* Unparsed JSON text expected to hold an array of content-exclusion policies.
|
|
10159
|
+
*/
|
|
10160
|
+
policiesJson: string;
|
|
10161
|
+
}
|
|
10162
|
+
/**
|
|
10163
|
+
* The accepted policies, parsed and normalized. A rejected input is reported as an error rather than in this result.
|
|
10164
|
+
*
|
|
10165
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
10166
|
+
* via the `definition` "ContentExclusionValidatePoliciesResult".
|
|
10167
|
+
*/
|
|
10168
|
+
/** @experimental */
|
|
10169
|
+
export interface ContentExclusionValidatePoliciesResult {
|
|
10170
|
+
/**
|
|
10171
|
+
* Validated policy objects in input order. Raw JSON preserves every field returned by the runtime's policy parser.
|
|
10172
|
+
*/
|
|
10173
|
+
policies: JsonValue[];
|
|
10174
|
+
}
|
|
9976
10175
|
/**
|
|
9977
10176
|
* A single large message currently in context.
|
|
9978
10177
|
*
|
|
@@ -31735,6 +31934,17 @@ export declare function createServerRpc(connection: MessageConnection): {
|
|
|
31735
31934
|
getBuiltInCatalog: () => Promise<BuiltInModelCatalog>;
|
|
31736
31935
|
};
|
|
31737
31936
|
/** @experimental */
|
|
31937
|
+
contentExclusion: {
|
|
31938
|
+
/**
|
|
31939
|
+
* Validates candidate content-exclusion policies and returns them normalized, without starting a session. This runs the same parser the runtime's own policy enforcement uses, so a host cannot accept a policy set the runtime would later reject, nor reject one it would have honored. Call it when policies arrive from outside the runtime — a command-line flag, a configuration file, a host's own settings — and must be checked before a session exists to apply them to. A malformed document fails with a message prefixed `Invalid JSON: `; a well-formed document that violates the policy schema fails with the offending field paths.
|
|
31940
|
+
*
|
|
31941
|
+
* @param params Candidate content-exclusion policies to validate, as the raw JSON text a host received. The text is supplied unparsed so that a syntax error and a schema violation are both reported by the runtime's own validator rather than by the caller's JSON parser.
|
|
31942
|
+
*
|
|
31943
|
+
* @returns The accepted policies, parsed and normalized. A rejected input is reported as an error rather than in this result.
|
|
31944
|
+
*/
|
|
31945
|
+
validatePolicies: (params: ContentExclusionValidatePoliciesRequest) => Promise<ContentExclusionValidatePoliciesResult>;
|
|
31946
|
+
};
|
|
31947
|
+
/** @experimental */
|
|
31738
31948
|
tools: {
|
|
31739
31949
|
/**
|
|
31740
31950
|
* Lists built-in tools available for a model.
|
package/dist/generated/rpc.js
CHANGED
|
@@ -237,6 +237,17 @@ function createServerRpc(connection) {
|
|
|
237
237
|
getBuiltInCatalog: async () => connection.sendRequest("models.getBuiltInCatalog", {})
|
|
238
238
|
},
|
|
239
239
|
/** @experimental */
|
|
240
|
+
contentExclusion: {
|
|
241
|
+
/**
|
|
242
|
+
* Validates candidate content-exclusion policies and returns them normalized, without starting a session. This runs the same parser the runtime's own policy enforcement uses, so a host cannot accept a policy set the runtime would later reject, nor reject one it would have honored. Call it when policies arrive from outside the runtime — a command-line flag, a configuration file, a host's own settings — and must be checked before a session exists to apply them to. A malformed document fails with a message prefixed `Invalid JSON: `; a well-formed document that violates the policy schema fails with the offending field paths.
|
|
243
|
+
*
|
|
244
|
+
* @param params Candidate content-exclusion policies to validate, as the raw JSON text a host received. The text is supplied unparsed so that a syntax error and a schema violation are both reported by the runtime's own validator rather than by the caller's JSON parser.
|
|
245
|
+
*
|
|
246
|
+
* @returns The accepted policies, parsed and normalized. A rejected input is reported as an error rather than in this result.
|
|
247
|
+
*/
|
|
248
|
+
validatePolicies: async (params) => connection.sendRequest("contentExclusion.validatePolicies", params)
|
|
249
|
+
},
|
|
250
|
+
/** @experimental */
|
|
240
251
|
tools: {
|
|
241
252
|
/**
|
|
242
253
|
* Lists built-in tools available for a model.
|
package/dist/session.js
CHANGED
|
@@ -57,6 +57,20 @@ function deserializeHookInput(raw) {
|
|
|
57
57
|
...stop_hook_active === void 0 ? {} : { stopHookActive: stop_hook_active }
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
+
function normalizeHookError(hookType, input) {
|
|
61
|
+
if (hookType !== "errorOccurred" && hookType !== "sessionEnd") {
|
|
62
|
+
return input;
|
|
63
|
+
}
|
|
64
|
+
if (!input || typeof input !== "object" || !("error" in input)) {
|
|
65
|
+
return input;
|
|
66
|
+
}
|
|
67
|
+
const { error } = input;
|
|
68
|
+
if (!error || typeof error !== "object" || Array.isArray(error)) {
|
|
69
|
+
return input;
|
|
70
|
+
}
|
|
71
|
+
const { message } = error;
|
|
72
|
+
return { ...input, error: typeof message === "string" ? message : JSON.stringify(error) };
|
|
73
|
+
}
|
|
60
74
|
function isOpenCanvasInstance(value) {
|
|
61
75
|
if (!value || typeof value !== "object") {
|
|
62
76
|
return false;
|
|
@@ -1775,7 +1789,7 @@ class CopilotSession {
|
|
|
1775
1789
|
if (!this.hooks) {
|
|
1776
1790
|
return void 0;
|
|
1777
1791
|
}
|
|
1778
|
-
const normalized = deserializeHookInput(input);
|
|
1792
|
+
const normalized = normalizeHookError(hookType, deserializeHookInput(input));
|
|
1779
1793
|
const handlerMap = {
|
|
1780
1794
|
preToolUse: this.hooks.onPreToolUse,
|
|
1781
1795
|
preMcpToolCall: this.hooks.onPreMcpToolCall,
|
package/dist/types.d.ts
CHANGED
|
@@ -2596,6 +2596,13 @@ export interface SessionConfigBase {
|
|
|
2596
2596
|
* read from the shared session store.
|
|
2597
2597
|
*/
|
|
2598
2598
|
enableSessionStore?: boolean;
|
|
2599
|
+
/**
|
|
2600
|
+
* When true, requests the read-only GitHub cache store for this session
|
|
2601
|
+
* (the `github-cache-store` capability). The runtime registers the
|
|
2602
|
+
* `github_sql` tool only when its `GITHUB_CACHE_STORE` feature flag is
|
|
2603
|
+
* also on. Defaults to disabled.
|
|
2604
|
+
*/
|
|
2605
|
+
enableGitHubCacheStore?: boolean;
|
|
2599
2606
|
/**
|
|
2600
2607
|
* When true, enables skill loading (including builtin skills and discovered
|
|
2601
2608
|
* skill directories). When false, no skills are loaded regardless of
|
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.22-preview.0",
|
|
9
|
+
"copilotCliVersion": "1.0.98-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",
|
|
@@ -103,18 +103,18 @@
|
|
|
103
103
|
"README.md"
|
|
104
104
|
],
|
|
105
105
|
"copilotRuntime": {
|
|
106
|
-
"sourceSha": "
|
|
107
|
-
"version": "1.0.
|
|
106
|
+
"sourceSha": "8f6dbb8fcdc7c2f25291088a43d0755763269588",
|
|
107
|
+
"version": "1.0.98-0",
|
|
108
108
|
"visibility": "public"
|
|
109
109
|
},
|
|
110
110
|
"optionalDependencies": {
|
|
111
|
-
"@github/copilot-sdk-darwin-arm64": "1.0.
|
|
112
|
-
"@github/copilot-sdk-darwin-x64": "1.0.
|
|
113
|
-
"@github/copilot-sdk-linux-arm64": "1.0.
|
|
114
|
-
"@github/copilot-sdk-linux-x64": "1.0.
|
|
115
|
-
"@github/copilot-sdk-linuxmusl-arm64": "1.0.
|
|
116
|
-
"@github/copilot-sdk-linuxmusl-x64": "1.0.
|
|
117
|
-
"@github/copilot-sdk-win32-arm64": "1.0.
|
|
118
|
-
"@github/copilot-sdk-win32-x64": "1.0.
|
|
111
|
+
"@github/copilot-sdk-darwin-arm64": "1.0.22-preview.0",
|
|
112
|
+
"@github/copilot-sdk-darwin-x64": "1.0.22-preview.0",
|
|
113
|
+
"@github/copilot-sdk-linux-arm64": "1.0.22-preview.0",
|
|
114
|
+
"@github/copilot-sdk-linux-x64": "1.0.22-preview.0",
|
|
115
|
+
"@github/copilot-sdk-linuxmusl-arm64": "1.0.22-preview.0",
|
|
116
|
+
"@github/copilot-sdk-linuxmusl-x64": "1.0.22-preview.0",
|
|
117
|
+
"@github/copilot-sdk-win32-arm64": "1.0.22-preview.0",
|
|
118
|
+
"@github/copilot-sdk-win32-x64": "1.0.22-preview.0"
|
|
119
119
|
}
|
|
120
120
|
}
|