@github/copilot-sdk 1.0.13 → 1.0.14-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 +16 -0
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +19 -3
- package/dist/cjs/ffiRuntimeHost.js +140 -55
- package/dist/cjs/generated/rpc.js +59 -7
- package/dist/cjs/session.js +1 -0
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.d.ts +3 -0
- package/dist/client.js +19 -3
- package/dist/ffiRuntimeHost.d.ts +8 -2
- package/dist/ffiRuntimeHost.js +140 -55
- package/dist/generated/rpc.d.ts +706 -45
- package/dist/generated/rpc.js +59 -7
- package/dist/generated/session-events.d.ts +461 -17
- package/dist/index.d.ts +1 -1
- package/dist/session.js +1 -0
- package/dist/types.d.ts +18 -1
- package/package.json +12 -11
package/dist/index.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ export { defineFactory, FactoryResumeError, isFactoryRunTerminal } from "./facto
|
|
|
11
11
|
export { Canvas, CanvasError, createCanvas, type CanvasAction, type CanvasDeclaration, type CanvasHostContext, type CanvasHostContextCapabilities, type CanvasJsonSchema, type CanvasOptions, } from "./canvas.js";
|
|
12
12
|
export { defineTool, approveAll, createAttributedPermissionResult, convertMcpCallToolResult, createSessionFsAdapter, CopilotRequestHandler, CopilotWebSocketHandler, CopilotWebSocketCloseStatus, CopilotWebSocketForwarder, SessionFsSqliteTransactionFailure, SYSTEM_MESSAGE_SECTIONS, } from "./types.js";
|
|
13
13
|
export type * from "./generated/session-events.js";
|
|
14
|
-
export type { AskUserVariant, CommandContext, CommandDefinition, CommandHandler, CanvasProviderIdentity, CloudSessionOptions, CloudSessionRepository, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, AgentStopHandler, AgentStopHookInput, AgentStopHookOutput, UserPromptTransformedHandler, UserPromptTransformedHookInput, UserPromptTransformedHookOutput, CopilotClientInfo, CopilotClientMode, CopilotClientOptions, CopilotExpAssignmentResponse, StdioRuntimeConnection, InProcessRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExpConfigEntry, ExpFlagValue, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, GitHubMcpToolConfig, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTokenProvider, GitHubTokenProviderArgs, GitHubTokenProviderResult, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, FactoryLimits, FactoryMeta, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, MessageOptions, ManagedSettings, ManagedSettingsPermissions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, AutoTier, CapiSessionOptions, CurrentModel, ModelSwitchAutoTierResult, ModelSwitchAutoTierStatus, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, NamedProviderConfig, PermissionHandler, PermissionRequest, PermissionRequestedData, PermissionRequestedEvent, PermissionRequestResult, AttributedPermissionResult, PermissionDecisionContext, PermissionDecisionOutcome, PermissionDecisionSource, PermissionDecisionSurface, PermissionResponseCapability, ProviderConfig, ProviderModelConfig, ProviderTokenArgs, RemoteSessionMode, ResumeSessionConfig, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionHooks, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SessionFsSqliteStatement, SessionFsSqliteTransactionErrorClass, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, CurrentToolMetadata, ToolTelemetry, ToolResultObject, ToolSearchConfig, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
|
|
14
|
+
export type { AskUserVariant, CommandContext, CommandDefinition, CommandHandler, CanvasProviderIdentity, CloudSessionOptions, CloudSessionRepository, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, AgentStopHandler, AgentStopHookInput, AgentStopHookOutput, UserPromptTransformedHandler, UserPromptTransformedHookInput, UserPromptTransformedHookOutput, CopilotClientInfo, CopilotClientMode, CopilotClientOptions, CopilotExpAssignmentResponse, StdioRuntimeConnection, InProcessRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExpConfigEntry, ExpFlagValue, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, GitHubMcpToolConfig, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTokenProvider, GitHubTokenProviderArgs, GitHubTokenProviderResult, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, FactoryLimits, FactoryMeta, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, MessageOptions, MessageSource, ManagedSettings, ManagedSettingsPermissions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, AutoTier, CapiSessionOptions, CurrentModel, ModelSwitchAutoTierResult, ModelSwitchAutoTierStatus, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, NamedProviderConfig, PermissionHandler, PermissionRequest, PermissionRequestedData, PermissionRequestedEvent, PermissionRequestResult, AttributedPermissionResult, PermissionDecisionContext, PermissionDecisionOutcome, PermissionDecisionSource, PermissionDecisionSurface, PermissionResponseCapability, ProviderConfig, ProviderModelConfig, ProviderTokenArgs, RemoteSessionMode, ResumeSessionConfig, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionHooks, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SessionFsSqliteStatement, SessionFsSqliteTransactionErrorClass, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, CurrentToolMetadata, ToolTelemetry, ToolResultObject, ToolSearchConfig, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
|
|
15
15
|
export type { RunOptions, ResumeOptions, FactoryResumeErrorCode, SessionFactoryApi, FactoryAgentOptions, FactoryContext, FactoryDefinition, FactoryHandle, FactoryJsonSchema, JsonValue, FactoryPipelineStage, FactoryStepOptions, FactoryRunResult, FactoryRunStatus, FactoryRunSummary, FactoryListRunsOptions, FactoryRunsPage, FactoryRunDetail, FactoryProgressPage, FactoryProgressLine, FactoryPhaseObservation, FactoryPhaseStatus, FactoryAgentSummary, } from "./factory.js";
|
package/dist/session.js
CHANGED
|
@@ -451,6 +451,7 @@ class CopilotSession {
|
|
|
451
451
|
...await getTraceContext(this.traceContextProvider),
|
|
452
452
|
sessionId: this.sessionId,
|
|
453
453
|
prompt: options.prompt,
|
|
454
|
+
source: options.source,
|
|
454
455
|
displayPrompt: options.displayPrompt,
|
|
455
456
|
attachments: options.attachments,
|
|
456
457
|
mode: options.mode,
|
package/dist/types.d.ts
CHANGED
|
@@ -46,7 +46,8 @@ export type { SessionFsSqliteStatement } from "./sessionFsProvider.js";
|
|
|
46
46
|
export type { SessionFsSqliteTransactionErrorClass } from "./sessionFsProvider.js";
|
|
47
47
|
export { SessionFsSqliteTransactionFailure } from "./sessionFsProvider.js";
|
|
48
48
|
export type { LlmInferenceHeaders } from "./generated/rpc.js";
|
|
49
|
-
export type { PermissionDecisionContext, PermissionDecisionOutcome,
|
|
49
|
+
export type { PermissionDecisionContext, PermissionDecisionOutcome, PermissionDecisionSurface, PermissionResponseCapability, } from "./generated/rpc.js";
|
|
50
|
+
export type { PermissionDecisionSource } from "./generated/session-events.js";
|
|
50
51
|
export type { CopilotRequestContext } from "./copilotRequestHandler.js";
|
|
51
52
|
export { CopilotRequestHandler, CopilotWebSocketHandler, CopilotWebSocketCloseStatus, CopilotWebSocketForwarder, } from "./copilotRequestHandler.js";
|
|
52
53
|
/**
|
|
@@ -2244,6 +2245,11 @@ export interface SessionConfigBase {
|
|
|
2244
2245
|
* @default "in-memory"
|
|
2245
2246
|
*/
|
|
2246
2247
|
mcpOAuthTokenStorage?: "persistent" | "in-memory";
|
|
2248
|
+
/**
|
|
2249
|
+
* OAuth Client ID Metadata Document URL identifying the host for MCP authorization.
|
|
2250
|
+
* When unset, no host identity is supplied.
|
|
2251
|
+
*/
|
|
2252
|
+
authClientIdMetadataUrl?: string;
|
|
2247
2253
|
/**
|
|
2248
2254
|
* MCP server configurations for the session.
|
|
2249
2255
|
* Keys are server names, values are server configurations.
|
|
@@ -2730,11 +2736,21 @@ export interface ProviderModelConfig {
|
|
|
2730
2736
|
*/
|
|
2731
2737
|
capabilities?: ModelCapabilitiesOverride;
|
|
2732
2738
|
}
|
|
2739
|
+
/**
|
|
2740
|
+
* Message provenance, independent of delivery mode.
|
|
2741
|
+
*/
|
|
2742
|
+
export type MessageSource = "user" | "system" | `agent-${string}`;
|
|
2733
2743
|
export interface MessageOptions {
|
|
2734
2744
|
/**
|
|
2735
2745
|
* The prompt/message to send
|
|
2736
2746
|
*/
|
|
2737
2747
|
prompt: string;
|
|
2748
|
+
/**
|
|
2749
|
+
* Optional message provenance. Omitted by default to preserve the runtime's
|
|
2750
|
+
* default for user messages. Use "system" for application-generated context
|
|
2751
|
+
* or `agent-${id}` for messages originating from an identified agent.
|
|
2752
|
+
*/
|
|
2753
|
+
source?: MessageSource;
|
|
2738
2754
|
/**
|
|
2739
2755
|
* File, directory, selection, or blob attachments
|
|
2740
2756
|
*/
|
|
@@ -2909,6 +2925,7 @@ export interface ModelCapabilities {
|
|
|
2909
2925
|
};
|
|
2910
2926
|
limits: {
|
|
2911
2927
|
max_prompt_tokens?: number;
|
|
2928
|
+
max_output_tokens?: number;
|
|
2912
2929
|
max_context_window_tokens: number;
|
|
2913
2930
|
vision?: {
|
|
2914
2931
|
supported_media_types: string[];
|
package/package.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "https://github.com/github/copilot-sdk.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.0.
|
|
8
|
-
"copilotCliVersion": "1.0.
|
|
7
|
+
"version": "1.0.14-preview.0",
|
|
8
|
+
"copilotCliVersion": "1.0.84-5",
|
|
9
9
|
"description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC",
|
|
10
10
|
"main": "./dist/cjs/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"type": "module",
|
|
35
35
|
"scripts": {
|
|
36
|
+
"auth:refresh": "node ../scripts/npm-auth-refresh.mjs --run",
|
|
36
37
|
"clean": "rimraf --glob dist *.tgz",
|
|
37
38
|
"build": "tsx esbuild-copilotsdk-nodejs.ts",
|
|
38
39
|
"pack:release": "tsx scripts/package-sdk.ts",
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
"author": "GitHub",
|
|
62
63
|
"license": "MIT",
|
|
63
64
|
"dependencies": {
|
|
64
|
-
"koffi": "^3.1
|
|
65
|
+
"koffi": "^3.2.1",
|
|
65
66
|
"vscode-jsonrpc": "^8.2.1",
|
|
66
67
|
"zod": "^4.3.6"
|
|
67
68
|
},
|
|
@@ -95,13 +96,13 @@
|
|
|
95
96
|
"README.md"
|
|
96
97
|
],
|
|
97
98
|
"optionalDependencies": {
|
|
98
|
-
"@github/copilot-sdk-darwin-arm64": "1.0.
|
|
99
|
-
"@github/copilot-sdk-darwin-x64": "1.0.
|
|
100
|
-
"@github/copilot-sdk-linux-arm64": "1.0.
|
|
101
|
-
"@github/copilot-sdk-linux-x64": "1.0.
|
|
102
|
-
"@github/copilot-sdk-linuxmusl-arm64": "1.0.
|
|
103
|
-
"@github/copilot-sdk-linuxmusl-x64": "1.0.
|
|
104
|
-
"@github/copilot-sdk-win32-arm64": "1.0.
|
|
105
|
-
"@github/copilot-sdk-win32-x64": "1.0.
|
|
99
|
+
"@github/copilot-sdk-darwin-arm64": "1.0.14-preview.0",
|
|
100
|
+
"@github/copilot-sdk-darwin-x64": "1.0.14-preview.0",
|
|
101
|
+
"@github/copilot-sdk-linux-arm64": "1.0.14-preview.0",
|
|
102
|
+
"@github/copilot-sdk-linux-x64": "1.0.14-preview.0",
|
|
103
|
+
"@github/copilot-sdk-linuxmusl-arm64": "1.0.14-preview.0",
|
|
104
|
+
"@github/copilot-sdk-linuxmusl-x64": "1.0.14-preview.0",
|
|
105
|
+
"@github/copilot-sdk-win32-arm64": "1.0.14-preview.0",
|
|
106
|
+
"@github/copilot-sdk-win32-x64": "1.0.14-preview.0"
|
|
106
107
|
}
|
|
107
108
|
}
|