@github/copilot-sdk 1.0.2 → 1.0.3
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 +27 -7
- package/dist/cjs/generated/rpc.js +34 -1
- package/dist/client.js +27 -7
- package/dist/generated/rpc.d.ts +328 -17
- package/dist/generated/rpc.js +34 -1
- package/dist/generated/session-events.d.ts +284 -29
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +134 -1
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -1400,6 +1400,30 @@ export interface SessionConfigBase {
|
|
|
1400
1400
|
* When specified, uses the provided API endpoint instead of the Copilot API.
|
|
1401
1401
|
*/
|
|
1402
1402
|
provider?: ProviderConfig;
|
|
1403
|
+
/**
|
|
1404
|
+
* Named BYOK provider connections (transport + credentials), referenced by
|
|
1405
|
+
* {@link models} entries via {@link NamedProviderConfig.name}.
|
|
1406
|
+
*
|
|
1407
|
+
* Unlike the singular {@link provider} — which makes the entire session BYOK
|
|
1408
|
+
* and bypasses Copilot API authentication — named providers are **additive**:
|
|
1409
|
+
* they coexist with Copilot API auth so models from CAPI and one or more BYOK
|
|
1410
|
+
* providers can be mixed within a single session and across sub-agents.
|
|
1411
|
+
* Combining `providers`/`models` with {@link provider} is rejected.
|
|
1412
|
+
*
|
|
1413
|
+
* @experimental This is part of an experimental multi-provider BYOK surface
|
|
1414
|
+
* and may change or be removed in future SDK or CLI releases.
|
|
1415
|
+
*/
|
|
1416
|
+
providers?: NamedProviderConfig[];
|
|
1417
|
+
/**
|
|
1418
|
+
* BYOK model definitions added to the session's selectable model list, each
|
|
1419
|
+
* referencing a `providers[].name`. Each model surfaces under the
|
|
1420
|
+
* provider-qualified selection id `providerName/id`, so BYOK ids never collide
|
|
1421
|
+
* with — and cannot shadow — bare CAPI ids; duplicate selection ids are rejected.
|
|
1422
|
+
*
|
|
1423
|
+
* @experimental This is part of an experimental multi-provider BYOK surface
|
|
1424
|
+
* and may change or be removed in future SDK or CLI releases.
|
|
1425
|
+
*/
|
|
1426
|
+
models?: ProviderModelConfig[];
|
|
1403
1427
|
/**
|
|
1404
1428
|
* Enables or disables internal session telemetry for this session.
|
|
1405
1429
|
* When `false`, disables session telemetry. When omitted (the default) or `true`,
|
|
@@ -1782,8 +1806,117 @@ export interface ProviderConfig {
|
|
|
1782
1806
|
maxOutputTokens?: number;
|
|
1783
1807
|
}
|
|
1784
1808
|
/**
|
|
1785
|
-
*
|
|
1809
|
+
* A named BYOK provider connection (transport + credentials only), referenced by
|
|
1810
|
+
* {@link ProviderModelConfig} entries via {@link NamedProviderConfig.name}.
|
|
1811
|
+
*
|
|
1812
|
+
* Unlike the singular, whole-session {@link ProviderConfig} — which bypasses
|
|
1813
|
+
* Copilot API authentication — named providers are **additive** and coexist with
|
|
1814
|
+
* Copilot API auth, so CAPI and BYOK models can be mixed within one session and
|
|
1815
|
+
* across sub-agents. See {@link SessionConfigBase.providers}.
|
|
1816
|
+
*
|
|
1817
|
+
* @experimental This type is part of an experimental multi-provider BYOK surface
|
|
1818
|
+
* and may change or be removed in future SDK or CLI releases.
|
|
1786
1819
|
*/
|
|
1820
|
+
export interface NamedProviderConfig {
|
|
1821
|
+
/**
|
|
1822
|
+
* Stable identifier referenced by {@link ProviderModelConfig.provider}.
|
|
1823
|
+
* Must not contain `/`.
|
|
1824
|
+
*/
|
|
1825
|
+
name: string;
|
|
1826
|
+
/**
|
|
1827
|
+
* Provider type. Defaults to "openai" for generic OpenAI-compatible APIs.
|
|
1828
|
+
*/
|
|
1829
|
+
type?: "openai" | "azure" | "anthropic";
|
|
1830
|
+
/**
|
|
1831
|
+
* Wire API format (openai/azure only). Defaults to "completions".
|
|
1832
|
+
*/
|
|
1833
|
+
wireApi?: "completions" | "responses";
|
|
1834
|
+
/**
|
|
1835
|
+
* API endpoint URL.
|
|
1836
|
+
*/
|
|
1837
|
+
baseUrl: string;
|
|
1838
|
+
/**
|
|
1839
|
+
* API key. Optional for local providers like Ollama.
|
|
1840
|
+
*/
|
|
1841
|
+
apiKey?: string;
|
|
1842
|
+
/**
|
|
1843
|
+
* Bearer token for authentication. Sets the Authorization header directly.
|
|
1844
|
+
* Takes precedence over {@link apiKey} when both are set.
|
|
1845
|
+
*/
|
|
1846
|
+
bearerToken?: string;
|
|
1847
|
+
/**
|
|
1848
|
+
* Azure-specific options.
|
|
1849
|
+
*/
|
|
1850
|
+
azure?: {
|
|
1851
|
+
/**
|
|
1852
|
+
* API version. When set, uses the versioned deployment route. When
|
|
1853
|
+
* omitted, uses the GA versionless v1 route.
|
|
1854
|
+
*/
|
|
1855
|
+
apiVersion?: string;
|
|
1856
|
+
};
|
|
1857
|
+
/**
|
|
1858
|
+
* Custom HTTP headers to include in all outbound requests to the provider.
|
|
1859
|
+
*/
|
|
1860
|
+
headers?: Record<string, string>;
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* A BYOK model definition that references a {@link NamedProviderConfig} by name
|
|
1864
|
+
* and is added to the session's selectable model list.
|
|
1865
|
+
*
|
|
1866
|
+
* Each model has three identities:
|
|
1867
|
+
* - {@link id}: the provider-local model id, unique within its provider. The
|
|
1868
|
+
* session-wide selection id (shown in the model list and passed to model
|
|
1869
|
+
* switching) is the provider-qualified `provider/id`.
|
|
1870
|
+
* - {@link modelId}: the well-known behavior base model used for
|
|
1871
|
+
* capability/config lookup. Defaults to {@link id}.
|
|
1872
|
+
* - {@link wireModel}: the model name actually sent to the provider API for
|
|
1873
|
+
* inference. Defaults to {@link id}.
|
|
1874
|
+
*
|
|
1875
|
+
* @experimental This type is part of an experimental multi-provider BYOK surface
|
|
1876
|
+
* and may change or be removed in future SDK or CLI releases.
|
|
1877
|
+
*/
|
|
1878
|
+
export interface ProviderModelConfig {
|
|
1879
|
+
/**
|
|
1880
|
+
* Provider-local model id, unique within its provider. The session-wide
|
|
1881
|
+
* selection id is the provider-qualified `provider/id`.
|
|
1882
|
+
*/
|
|
1883
|
+
id: string;
|
|
1884
|
+
/**
|
|
1885
|
+
* Name of the {@link NamedProviderConfig} that serves this model.
|
|
1886
|
+
*/
|
|
1887
|
+
provider: string;
|
|
1888
|
+
/**
|
|
1889
|
+
* The model name sent to the provider API for inference. Defaults to {@link id}.
|
|
1890
|
+
*/
|
|
1891
|
+
wireModel?: string;
|
|
1892
|
+
/**
|
|
1893
|
+
* Well-known base model id used for behavior/capability/config lookup.
|
|
1894
|
+
* Defaults to {@link id}.
|
|
1895
|
+
*/
|
|
1896
|
+
modelId?: string;
|
|
1897
|
+
/**
|
|
1898
|
+
* Display name for model pickers. Defaults to the provider-qualified
|
|
1899
|
+
* selection id (`provider/id`).
|
|
1900
|
+
*/
|
|
1901
|
+
name?: string;
|
|
1902
|
+
/**
|
|
1903
|
+
* Maximum prompt/input tokens for the model.
|
|
1904
|
+
*/
|
|
1905
|
+
maxPromptTokens?: number;
|
|
1906
|
+
/**
|
|
1907
|
+
* Maximum context window tokens for the model.
|
|
1908
|
+
*/
|
|
1909
|
+
maxContextWindowTokens?: number;
|
|
1910
|
+
/**
|
|
1911
|
+
* Maximum output tokens for the model.
|
|
1912
|
+
*/
|
|
1913
|
+
maxOutputTokens?: number;
|
|
1914
|
+
/**
|
|
1915
|
+
* Optional capability overrides (vision, tool_calls, reasoning, etc.) for
|
|
1916
|
+
* the synthesized model.
|
|
1917
|
+
*/
|
|
1918
|
+
capabilities?: ModelCapabilitiesOverride;
|
|
1919
|
+
}
|
|
1787
1920
|
export interface MessageOptions {
|
|
1788
1921
|
/**
|
|
1789
1922
|
* The prompt/message to send
|
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.3",
|
|
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.64-
|
|
59
|
+
"@github/copilot": "^1.0.64-1",
|
|
60
60
|
"vscode-jsonrpc": "^8.2.1",
|
|
61
61
|
"zod": "^4.3.6"
|
|
62
62
|
},
|