@github/copilot-sdk 1.0.17-preview.4 → 1.0.17-preview.6

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.
@@ -952,6 +952,37 @@ function createServerRpc(connection) {
952
952
  * @returns Outcome of an agentRegistry.spawn call.
953
953
  */
954
954
  spawn: async (params) => connection.sendRequest("agentRegistry.spawn", params)
955
+ },
956
+ /** @experimental */
957
+ connectors: {
958
+ /**
959
+ * Returns feature availability.
960
+ *
961
+ * @returns Feature availability.
962
+ */
963
+ getCapabilities: async () => connection.sendRequest("connectors.getCapabilities", {}),
964
+ /**
965
+ * Returns eligible accounts.
966
+ *
967
+ * @returns Eligible accounts.
968
+ */
969
+ getAccounts: async () => connection.sendRequest("connectors.getAccounts", {}),
970
+ /**
971
+ * Lists entries for the selected account.
972
+ *
973
+ * @param params Selected account.
974
+ *
975
+ * @returns Entries for the selected account.
976
+ */
977
+ list: async (params) => connection.sendRequest("connectors.list", params),
978
+ /**
979
+ * Refreshes entries for the selected account.
980
+ *
981
+ * @param params Selected account.
982
+ *
983
+ * @returns Entries for the selected account.
984
+ */
985
+ refresh: async (params) => connection.sendRequest("connectors.refresh", params)
955
986
  }
956
987
  };
957
988
  }
@@ -1007,6 +1038,110 @@ function createInternalServerRpc(connection) {
1007
1038
  */
1008
1039
  connect: async (params) => connection.sendRequest("connect", params),
1009
1040
  /** @experimental */
1041
+ agents: {
1042
+ /**
1043
+ * Lists the agents this runtime ships, by name. A consumer separating shipped agents from ones the user or a plugin authored should compare against these names rather than against `AgentInfo.source`: an authored agent may carry the `builtin` source while not being one of these, and the runtime treats the two as separate questions. `disableableNames` is the subset a user may turn off, which a client needs to decide whether to offer a toggle. `yamlBasedNames` is the subset backed by a shipped YAML definition, which a client needs before asking the runtime to load one.
1044
+ *
1045
+ * @returns The agents this runtime ships, named so a consumer can tell them apart from authored ones.
1046
+ */
1047
+ getBuiltins: async () => connection.sendRequest("agents.getBuiltins", {}),
1048
+ /**
1049
+ * Lists the shipped agents a client should offer right now, filtered by the feature flags it passes. `getBuiltins` names every agent the runtime knows about; some of those are gated, so a client rendering a picker wants this narrower list together with the description to show beside each name.
1050
+ *
1051
+ * @param params The feature flags to evaluate shipped agents against.
1052
+ *
1053
+ * @returns The shipped agents available under the requested flags.
1054
+ */
1055
+ getAvailableBuiltins: async (params) => connection.sendRequest("agents.getAvailableBuiltins", params),
1056
+ /**
1057
+ * Loads one shipped agent's YAML definition, for a client that needs what the agent declares rather than only its name. `getBuiltins` reports which names have a definition to load: a name outside its `yamlBasedNames` is special-cased in code and has none. The definition crosses as its own JSON rather than as contract-typed fields, because the runtime parses it with the agent schema's tolerant shape and re-typing it here would drop the keys that shape accepts and this one does not. The projected `__nativeCustomAgent` view the runtime derives is included, so a caller reading the declared model and a caller rendering the agent see the same definition.
1058
+ *
1059
+ * @param params The shipped agent whose definition to load.
1060
+ *
1061
+ * @returns One shipped agent's definition.
1062
+ */
1063
+ getBuiltinDefinition: async (params) => connection.sendRequest("agents.getBuiltinDefinition", params),
1064
+ /**
1065
+ * Projects one shipped agent the way a picker lists it, reading only the metadata at the head of the definition file and stopping before the prompt body. `getBuiltinDefinition` answers the whole definition instead, so a client listing every shipped agent should prefer this one: the cost of a listing grows with the number of agents, and the prompt body is the part a listing never shows. The two also differ in shape. This returns the projected custom agent on its own, whereas `getBuiltinDefinition` returns the authored definition with that projection nested under `__nativeCustomAgent`.
1066
+ *
1067
+ * @param params The shipped agent whose listing entry to load.
1068
+ *
1069
+ * @returns One shipped agent, projected for a listing.
1070
+ */
1071
+ getBuiltinListingDefinition: async (params) => connection.sendRequest("agents.getBuiltinListingDefinition", params),
1072
+ /**
1073
+ * Resolves the model a custom agent asks for against the models actually available, and answers both the model to switch to and the warning a user should see when the agent's preference cannot be met. A custom agent may name several acceptable models in preference order, so the decision is a match rather than a lookup, and an agent whose preference is unavailable is a normal outcome that produces a warning rather than an error. A host must call this rather than pick the first available name itself, because the preference order and the wording of the warning are what keep one installation's agent selection the same as another's.
1074
+ *
1075
+ * @param params The models a custom agent asks for, and the models actually available.
1076
+ *
1077
+ * @returns The model to switch to, and the warning to show when the agent's preference could not be met.
1078
+ */
1079
+ customAgentInitialModelDecision: async (params) => connection.sendRequest("agents.customAgentInitialModelDecision", params)
1080
+ },
1081
+ /** @experimental */
1082
+ gitHubRepository: {
1083
+ /**
1084
+ * Resolves the GitHub repository that owns a working-tree path by reading the selected git remote configured for it, preferring `origin`. Returns a null `repository` when the path is inside a git working tree but that selected remote does not resolve to a GitHub host. Fails when the path is not inside a git working tree at all, so a caller can tell 'not a repository' apart from 'a repository with no GitHub remote'.
1085
+ *
1086
+ * @param params Working-tree path whose owning GitHub repository should be resolved.
1087
+ *
1088
+ * @returns The GitHub repository that owns the requested path, when the selected remote (`origin`, else the first) is on a GitHub host.
1089
+ */
1090
+ atPath: async (params) => connection.sendRequest("gitHubRepository.atPath", params)
1091
+ },
1092
+ /** @experimental */
1093
+ gitHubOwners: {
1094
+ /**
1095
+ * Registers a cancellable owner listing and returns its request id. Separate from `gitHubOwners.list` so the id exists before the listing starts: a caller that abandons the listing the moment it begins would otherwise have nothing to name in `gitHubOwners.cancel`. The id serves one listing only. Long-abandoned unused ids can be released by later allocations.
1096
+ *
1097
+ * @returns A freshly registered request id. Registering it before the listing starts is what lets a cancel that races the request still find the owner listing slot. The id serves one listing only. Long-abandoned unused ids can be released by later allocations.
1098
+ */
1099
+ nextRequestId: async () => connection.sendRequest("gitHubOwners.nextRequestId", {}),
1100
+ /**
1101
+ * Lists the logins the authenticated user may act as — their own account first, then the organizations they belong to — by asking the GitHub API under the supplied credential. No credential travels in the request: `authInfo` selects one the runtime already holds, and the runtime resolves the token and the GitHub host from it. A failure the caller should render arrives as `message`; one it should raise arrives as `throwError`.
1102
+ *
1103
+ * @param params Credential to list owners under, and the request id that makes the listing cancellable.
1104
+ *
1105
+ * @returns Outcome of an owner listing. Exactly one of `owners` and `message` is present, except that `throwError` reports a failure the caller is expected to raise rather than render.
1106
+ */
1107
+ list: async (params) => connection.sendRequest("gitHubOwners.list", params),
1108
+ /**
1109
+ * Abandons an owner listing started with the given request id. Answers `canceled: true` while a listing with that id is running. Answers `canceled: false` when the id was never registered, was registered but not used, was released after being abandoned, or its listing has ended. Canceling an unused id releases it, and a later `list` with that id is refused. The cancel acts only on owner listings and never reaches another request of the host.
1110
+ *
1111
+ * @param params The owner listing to abandon.
1112
+ *
1113
+ * @returns Whether the id named a running owner listing.
1114
+ */
1115
+ cancel: async (params) => connection.sendRequest("gitHubOwners.cancel", params)
1116
+ },
1117
+ /** @experimental */
1118
+ git: {
1119
+ /**
1120
+ * Reads the remote that the branch checked out in a working tree tracks, as `branch.<name>.remote` configures it. Reports `origin` rather than failing whenever there is no tracking configuration to read — on a detached HEAD, on a branch with no upstream, or when git itself fails — because a caller asking which remote to talk to needs an answer it can act on, not an error. Marked internal because it exists to carry a CLI call site off the napi boundary onto the SDK contract; it is migration plumbing, not a surface consumers are meant to depend on.
1121
+ *
1122
+ * @param params Working-tree path a git query applies to.
1123
+ *
1124
+ * @returns The remote the checked-out branch tracks.
1125
+ */
1126
+ currentBranchRemote: async (params) => connection.sendRequest("git.currentBranchRemote", params),
1127
+ /**
1128
+ * Collects the repository context of a working directory in one call: working tree root, repository identifier and host, current branch, and the HEAD and base commits. Every repository field is omitted when the path is not inside a git working tree, and the requested path is echoed back as `cwd`. The answer is the same `SessionWorkingDirectoryContext` that `session.metadata.recordContextChange` accepts, so a caller polling for a context change can forward the result unchanged. Marked internal because it exists to carry a CLI call site off the napi boundary onto the SDK contract; it is migration plumbing, not a surface consumers are meant to depend on. It can become public once an SDK consumer needs to derive session context from a directory itself.
1129
+ *
1130
+ * @param params Working-tree path a git query applies to.
1131
+ *
1132
+ * @returns Updated working directory and git context. Emitted as the new payload of `session.context_changed`.
1133
+ */
1134
+ workingDirectoryContext: async (params) => connection.sendRequest("git.workingDirectoryContext", params),
1135
+ /**
1136
+ * Lists the GitHub repositories a working tree's remotes point at, one entry per distinct repository, so a caller can resolve a base and head repository without parsing remote URLs itself. When several remotes name the same repository, only the first is listed, and the entry keeps that remote name. Remotes pointing at no GitHub host are left out, so an empty list means the tree reaches GitHub through no remote. Failing to read the remotes is reported as an error rather than as an empty list, because the two mean different things to a caller. Marked internal because it exists to carry a CLI call site off the napi boundary onto the SDK contract; it is migration plumbing, not a surface consumers are meant to depend on.
1137
+ *
1138
+ * @param params Git working tree whose GitHub remotes should be listed.
1139
+ *
1140
+ * @returns The GitHub repositories a working tree's remotes point at.
1141
+ */
1142
+ reposFromRemotes: async (params) => connection.sendRequest("git.reposFromRemotes", params)
1143
+ },
1144
+ /** @experimental */
1010
1145
  sessions: {
1011
1146
  /**
1012
1147
  * Reads lightweight persisted metadata for one local session without opening it.
@@ -1046,6 +1181,30 @@ function createInternalServerRpc(connection) {
1046
1181
  * @param params Session ID to delete from disk.
1047
1182
  */
1048
1183
  delete: async (params) => connection.sendRequest("sessions.delete", params),
1184
+ /**
1185
+ * Creates the workspace record for a session that has not been opened yet. A host that hands a session off to another application — writing the record and then launching that application against the session ID — needs the record on disk before any session exists to carry it, which the session-scoped workspace methods cannot do. Replaces any existing record and resets the checkpoint index. When writing to the local filesystem, a stored `fork_count` survives on disk. Returns the record it built, so a surviving stored `fork_count` can differ from the answer.
1186
+ *
1187
+ * @param params Identity, state location and starting context for a workspace record.
1188
+ *
1189
+ * @returns The workspace record that was written.
1190
+ */
1191
+ createWorkspace: async (params) => connection.sendRequest("sessions.createWorkspace", params),
1192
+ /**
1193
+ * Reads a session's workspace record straight from disk, without opening the session. Resuming by session ID has to know where the session lives before it can connect, so the lookup cannot come from the session-scoped workspace methods, which resolve their location from a live session's context. Returns no record when the file is absent.
1194
+ *
1195
+ * @param params Where the session's state lives, as a root directory and the session ID under it.
1196
+ *
1197
+ * @returns The workspace record on disk, omitted when the session has none.
1198
+ */
1199
+ loadWorkspace: async (params) => connection.sendRequest("sessions.loadWorkspace", params),
1200
+ /**
1201
+ * Merges fields into a session's workspace record on disk, creating the record when it is absent. The counterpart to `sessions.loadWorkspace`, for the same before-the-session-exists case. It preserves stored workspace-schema fields the request does not supply, does not preserve stored keys outside the workspace schema, and never replaces a stored `fork_count`.
1202
+ *
1203
+ * @param params Where the session's state lives, plus workspace-schema fields to merge into its workspace record. Stored keys outside the schema are not preserved, and a stored `fork_count` is never replaced.
1204
+ *
1205
+ * @returns The merge completed. The record carries the supplied workspace-schema fields, but a stored `fork_count` stays.
1206
+ */
1207
+ updateWorkspaceFields: async (params) => connection.sendRequest("sessions.updateWorkspaceFields", params),
1049
1208
  /**
1050
1209
  * Gets the dynamic-context board entry count associated with a session, when available. Internal: this exists solely so CLI telemetry events (`rem_spawn_gate`, `rem_consolidation_complete`) can pair START / END board counts around the detached rem-agent spawn. "Dynamic context board" is a runtime-internal concept that is not part of the public SDK contract; the long-term plan is to relocate the telemetry emission into the runtime so this method can be deleted entirely.
1051
1210
  *
@@ -1920,11 +2079,17 @@ function createSessionRpc(connection, sessionId) {
1920
2079
  /** @experimental */
1921
2080
  mcp: {
1922
2081
  /**
1923
- * Lists MCP servers configured for the session, their connection status, and host-level state. The host-level state (disabled/filtered servers, failed/needs-auth/pending connections, mcp3p policy, full config) is empty/zero when no MCP host has been initialized for the session.
2082
+ * Lists materialized MCP servers and their connection status. Cache misses may start and wait for MCP servers.
1924
2083
  *
1925
2084
  * @returns MCP servers configured for the session, with their connection status and host-level state.
1926
2085
  */
1927
2086
  list: async () => connection.sendRequest("session.mcp.list", { sessionId }),
2087
+ /**
2088
+ * Lists effective MCP configuration without starting, restarting, authenticating, or waiting for servers. An optional live observation is from an already materialized matching server; this is not a readiness guarantee.
2089
+ *
2090
+ * @returns Effective MCP configuration with optional live observations from matching already materialized servers.
2091
+ */
2092
+ listConfigured: async () => connection.sendRequest("session.mcp.listConfigured", { sessionId }),
1928
2093
  /**
1929
2094
  * Lists the tools exposed by a connected MCP server on this session's host. This performs a live `tools/list` request. Tool UI metadata is returned independently of whether MCP Apps rendering is enabled for the session.
1930
2095
  *
@@ -3373,6 +3538,12 @@ function createInternalSessionRpc(connection, sessionId) {
3373
3538
  },
3374
3539
  /** @experimental */
3375
3540
  mcp: {
3541
+ /**
3542
+ * Records the IDE the host is connected to, so the agent's system prompt can name it and its workspace folder. Null or an omitted `ide` clears the recorded value, which is how a host reports that it is disconnected; there is no separate clear method. Both `ideName` and `workspaceFolder` are required together, because half a state cannot be attributed to a project.
3543
+ *
3544
+ * @param params Records which IDE the host is connected to, or clears it.
3545
+ */
3546
+ setConnectedIdeInfo: async (params) => connection.sendRequest("session.mcp.setConnectedIdeInfo", { ...params, sessionId }),
3376
3547
  /**
3377
3548
  * Reloads MCP server connections for the session with an explicit host-provided configuration.
3378
3549
  *
@@ -1378,7 +1378,7 @@ export type McpServerStatus =
1378
1378
  | "pending"
1379
1379
  /** The server is configured but disabled. */
1380
1380
  | "disabled"
1381
- /** The server was intentionally stopped and can be restarted on demand when policy permits; a server quarantined by restrictive managed policy stays stopped and cannot be restarted until the policy allows it. */
1381
+ /** The server is not running: it may not have started yet, may have been explicitly stopped, or may be quarantined by restrictive managed policy. It can be restarted on demand when policy permits. */
1382
1382
  | "stopped"
1383
1383
  /** The server is not configured for this session. */
1384
1384
  | "not_configured";
@@ -8852,6 +8852,8 @@ export interface PermissionApprovalEvaluation {
8852
8852
  | "action-too-long"
8853
8853
  /** The script path was not authorized for inspection. */
8854
8854
  | "path-not-authorized"
8855
+ /** A code source was excluded from review by content exclusion policy. */
8856
+ | "content-excluded"
8855
8857
  /** The script working directory was invalid. */
8856
8858
  | "invalid-working-directory"
8857
8859
  /** The script snapshot could not be read. */
@@ -8876,6 +8878,18 @@ export interface PermissionApprovalEvaluation {
8876
8878
  | "unreviewable-script-invocation"
8877
8879
  /** The script argument binding could not be reviewed. */
8878
8880
  | "argument-binding-unreviewable"
8881
+ /** The shell command could not be analyzed for execution evidence. */
8882
+ | "unsupported-command-shape"
8883
+ /** The shell command used a code source that cannot be bound for review. */
8884
+ | "unsupported-source"
8885
+ /** The shell command used a code source computed at run time. */
8886
+ | "dynamic-source"
8887
+ /** The shell command referenced more code sources than can be reviewed. */
8888
+ | "too-many-sources"
8889
+ /** A code-bearing executable could not be inspected. */
8890
+ | "executable-unavailable"
8891
+ /** A code-bearing executable exceeded the binding size limit. */
8892
+ | "executable-too-large"
8879
8893
  /** The script review metadata was malformed. */
8880
8894
  | "malformed-script-action-review"
8881
8895
  /** The script snapshot manifest was malformed. */
package/dist/index.d.ts CHANGED
@@ -13,5 +13,5 @@ export { defineWorkflow, WorkflowResumeError, isWorkflowRunTerminal } from "./wo
13
13
  export { Canvas, CanvasError, createCanvas, type CanvasAction, type CanvasDeclaration, type CanvasHostContext, type CanvasHostContextCapabilities, type CanvasJsonSchema, type CanvasOptions, } from "./canvas.js";
14
14
  export { defineTool, approveAll, createAttributedPermissionResult, convertMcpCallToolResult, createSessionFsAdapter, CopilotRequestHandler, CopilotWebSocketHandler, CopilotWebSocketCloseStatus, CopilotWebSocketForwarder, SessionFsSqliteTransactionFailure, SessionFsWriteFailure, SYSTEM_MESSAGE_SECTIONS, } from "./types.js";
15
15
  export type * from "./generated/session-events.js";
16
- export type { AskUserVariant, CommandContext, CommandDefinition, CommandHandler, CanvasProviderIdentity, CloudSessionOptions, CloudSessionRepository, AuthIdentityMetadata, AuthInfoType, ConnectorAccountRequest, ConnectorAvailability, ConnectorCapabilities, ConnectorCatalogEntry, ConnectorCatalogResult, ConnectorCatalogStatus, ConnectorConnectRequest, ConnectorConnectResult, ConnectorContinueRequest, ConnectorDisconnectResult, ConnectorMcpStatus, ConnectorReconcileRequest, ConnectorRuntimeStatus, ConnectorSessionAccount, ConnectorSessionAccountResult, ConnectorStatus, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, AgentStopHandler, AgentStopHookInput, AgentStopHookOutput, SubagentStartHandler, SubagentStartHookInput, SubagentStartHookOutput, SubagentStopHandler, SubagentStopHookInput, SubagentStopHookOutput, UserPromptTransformedHandler, UserPromptTransformedHookInput, UserPromptTransformedHookOutput, CopilotClientInfo, CopilotClientMode, CopilotClientOptions, InstallationConfirmationHandler, InstallationConfirmationRequest, InstallationConfirmationResponse, InstallationDecision, InstallationReview, McpInstallationReview, CopilotExpAssignmentResponse, StdioRuntimeConnection, InProcessRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExpConfigEntry, ExpFlagValue, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionLaunchProfile, ExtensionLaunchProvider, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, GitHubMcpToolConfig, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTokenProvider, GitHubTokenProviderArgs, GitHubTokenProviderResult, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, ExtensionContextAttachment, MessageOptions, ResponseSchema, 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, ProviderConfigModelProvider, ProviderModelConfig, ProviderTokenArgs, RemoteSessionMode, SandboxConfigSource, ResumeSessionConfig, TranscriptRecovery, 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";
16
+ export type { AskUserVariant, CommandContext, CommandDefinition, CommandHandler, CanvasProviderIdentity, CloudSessionOptions, CloudSessionRepository, AuthIdentityMetadata, AuthInfoType, ConnectorAccountRequest, ConnectorAvailability, ConnectorCapabilities, ConnectorCatalogEntry, ConnectorCatalogResult, ConnectorCatalogStatus, ConnectorConnectRequest, ConnectorConnectResult, ConnectorContinueRequest, ConnectorDisconnectResult, ConnectorMcpStatus, ConnectorReconcileRequest, ConnectorRuntimeStatus, ConnectorSessionAccount, ConnectorSessionAccountResult, ConnectorStatus, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, AgentStopHandler, AgentStopHookInput, AgentStopHookOutput, SubagentStartHandler, SubagentStartHookInput, SubagentStartHookOutput, SubagentStopHandler, SubagentStopHookInput, SubagentStopHookOutput, UserPromptTransformedHandler, UserPromptTransformedHookInput, UserPromptTransformedHookOutput, CopilotClientInfo, CopilotClientMode, CopilotClientOptions, InstallationConfirmationHandler, InstallationConfirmationRequest, InstallationConfirmationResponse, InstallationDecision, InstallationReview, McpInstallationReview, CopilotExpAssignmentResponse, StdioRuntimeConnection, InProcessRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExpConfigEntry, ExpFlagValue, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionLaunchProfile, ExtensionLaunchProvider, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, GitHubMcpToolConfig, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTokenProvider, GitHubTokenProviderArgs, GitHubTokenProviderResult, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, ExtensionContextAttachment, MessageOptions, ResponseSchema, 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, ProviderConfigModelProvider, ProviderModelConfig, ProviderTokenArgs, RemoteSessionMode, SandboxConfigSource, ResumeSessionConfig, TranscriptRecovery, 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, SkillProvider, SkillProviderCallOptions, SkillProviderDescriptor, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, CurrentToolMetadata, ToolTelemetry, ToolResultObject, ToolSearchConfig, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
17
17
  export type { JsonValue, WorkflowRunOptions, WorkflowResumeOptions, WorkflowLimitOverrides, WorkflowResumeErrorCode, SessionWorkflowApi, WorkflowAgentOptions, WorkflowContext, WorkflowDefinition, WorkflowHandle, WorkflowJsonSchema, WorkflowLimits, WorkflowMeta, WorkflowPipelineStage, WorkflowStepOptions, WorkflowRunResult, WorkflowRunStatus, WorkflowRunSummary, WorkflowListRunsOptions, WorkflowRunsPage, WorkflowRunDetail, WorkflowProgressPage, WorkflowProgressLine, WorkflowPhaseObservation, WorkflowPhaseStatus, WorkflowAgentSummary, } from "./workflow.js";
package/dist/session.d.ts CHANGED
@@ -59,6 +59,7 @@ export declare class CopilotSession {
59
59
  private elicitationHandler?;
60
60
  private exitPlanModeHandler?;
61
61
  private autoModeSwitchHandler?;
62
+ private skillProvider?;
62
63
  private hooks?;
63
64
  private transformCallbacks?;
64
65
  private _rpc;
@@ -235,6 +236,12 @@ export declare class CopilotSession {
235
236
  private _confirm;
236
237
  private _select;
237
238
  private _input;
239
+ private requireSkillProvider;
240
+ /**
241
+ * Runs a provider call with an abort signal tied to the runtime's request
242
+ * cancellation. Failures are logged locally and reported generically.
243
+ */
244
+ private callSkillProvider;
238
245
  /**
239
246
  * Retrieves all events and messages from this session's history.
240
247
  *
package/dist/session.js CHANGED
@@ -266,6 +266,7 @@ class CopilotSession {
266
266
  elicitationHandler;
267
267
  exitPlanModeHandler;
268
268
  autoModeSwitchHandler;
269
+ skillProvider;
269
270
  hooks;
270
271
  transformCallbacks;
271
272
  _rpc = null;
@@ -678,6 +679,7 @@ class CopilotSession {
678
679
  this.elicitationHandler = void 0;
679
680
  this.exitPlanModeHandler = void 0;
680
681
  this.autoModeSwitchHandler = void 0;
682
+ this.skillProvider = void 0;
681
683
  this.commandHandlers.clear();
682
684
  this.canvases.clear();
683
685
  this.workflows.clear();
@@ -1584,6 +1586,68 @@ class CopilotSession {
1584
1586
  registerUserInputHandler(handler) {
1585
1587
  this.userInputHandler = handler;
1586
1588
  }
1589
+ /**
1590
+ * Registers the session's skill provider.
1591
+ *
1592
+ * @param provider - The skill provider, or undefined to remove it
1593
+ * @internal This method is typically called internally when creating a session.
1594
+ */
1595
+ registerSkillProvider(provider) {
1596
+ this.skillProvider = provider;
1597
+ }
1598
+ /**
1599
+ * Handles a `skillProvider.list` request from the runtime.
1600
+ *
1601
+ * @internal This method is for internal use by the SDK.
1602
+ */
1603
+ async _handleSkillProviderList(token) {
1604
+ const provider = this.requireSkillProvider();
1605
+ return await this.callSkillProvider("listSkills", token, async (options) => ({
1606
+ skills: await provider.listSkills(options) ?? []
1607
+ }));
1608
+ }
1609
+ /**
1610
+ * Handles a `skillProvider.read` request from the runtime.
1611
+ *
1612
+ * @internal This method is for internal use by the SDK.
1613
+ */
1614
+ async _handleSkillProviderRead(name, token) {
1615
+ const provider = this.requireSkillProvider();
1616
+ return await this.callSkillProvider("readSkill", token, async (options) => ({
1617
+ markdown: await provider.readSkill(name, options) ?? null
1618
+ }));
1619
+ }
1620
+ requireSkillProvider() {
1621
+ if (!this.skillProvider) {
1622
+ throw new Error(`No skill provider for session: ${this.sessionId}`);
1623
+ }
1624
+ return this.skillProvider;
1625
+ }
1626
+ /**
1627
+ * Runs a provider call with an abort signal tied to the runtime's request
1628
+ * cancellation. Failures are logged locally and reported generically.
1629
+ */
1630
+ async callSkillProvider(operation, token, call) {
1631
+ const controller = new AbortController();
1632
+ const subscription = token?.onCancellationRequested(() => controller.abort());
1633
+ if (token?.isCancellationRequested) {
1634
+ controller.abort();
1635
+ }
1636
+ try {
1637
+ return await call({ signal: controller.signal });
1638
+ } catch (error) {
1639
+ if (controller.signal.aborted) {
1640
+ throw new ResponseError(-32800, `Skill provider ${operation} cancelled`);
1641
+ }
1642
+ console.error(`Skill provider ${operation} failed`, {
1643
+ sessionId: this.sessionId,
1644
+ error
1645
+ });
1646
+ throw skillProviderFailure(operation);
1647
+ } finally {
1648
+ subscription?.dispose();
1649
+ }
1650
+ }
1587
1651
  /**
1588
1652
  * Registers hook handlers for session lifecycle events.
1589
1653
  *
@@ -1937,6 +2001,9 @@ function toCanvasRpcError(error) {
1937
2001
  const message = error instanceof Error ? error.message : String(error);
1938
2002
  return new ResponseError(ErrorCodes.InternalError, message, { code, message });
1939
2003
  }
2004
+ function skillProviderFailure(operation) {
2005
+ return new ResponseError(ErrorCodes.InternalError, `Skill provider ${operation} failed`);
2006
+ }
1940
2007
  function strictJsonValidationError(context, category, message, path) {
1941
2008
  return new ResponseError(ErrorCodes.InternalError, message, {
1942
2009
  code: context.code,
package/dist/types.d.ts CHANGED
@@ -50,6 +50,8 @@ export type { SessionFsSqliteTransactionErrorClass } from "./sessionFsProvider.j
50
50
  export { SessionFsSqliteTransactionFailure } from "./sessionFsProvider.js";
51
51
  export { SessionFsWriteFailure } from "./sessionFsProvider.js";
52
52
  export type { LlmInferenceHeaders } from "./generated/rpc.js";
53
+ import type { SkillProviderDescriptor } from "./generated/rpc.js";
54
+ export type { SkillProviderDescriptor };
53
55
  export type { PermissionDecisionContext, PermissionDecisionOutcome, PermissionDecisionSurface, PermissionResponseCapability, } from "./generated/rpc.js";
54
56
  export type { PermissionDecisionSource } from "./generated/session-events.js";
55
57
  export type { CopilotRequestContext } from "./copilotRequestHandler.js";
@@ -1893,6 +1895,57 @@ export interface ManagedSettings {
1893
1895
  }
1894
1896
  /** Selects the model-facing shape of the built-in `ask_user` tool. */
1895
1897
  export type AskUserVariant = "legacy" | "elicitation";
1898
+ /**
1899
+ * Supplies session-scoped skills from the host's own storage, such as a
1900
+ * database, instead of `SKILL.md` files on disk.
1901
+ *
1902
+ * The runtime calls {@link SkillProvider.listSkills} when it builds the
1903
+ * session's skill catalog, and {@link SkillProvider.readSkill} each time it
1904
+ * needs a skill's instructions: when the model loads the skill through the
1905
+ * `skill` tool, when a user runs `/skill-name`, or when a custom agent lists
1906
+ * the skill. Calls may run concurrently, including on behalf of sub-agents, and
1907
+ * each call must finish within 30 seconds. Errors thrown by a provider are
1908
+ * never shown to the model.
1909
+ *
1910
+ * Supply a provider with {@link SessionConfigBase.skillProvider}. Providers
1911
+ * aren't supported for cloud sessions.
1912
+ *
1913
+ * @experimental Session-scoped skill providers are experimental and may change
1914
+ * or be removed in future SDK or CLI releases.
1915
+ */
1916
+ export interface SkillProvider {
1917
+ /**
1918
+ * Returns catalog metadata for every skill the provider supplies. The
1919
+ * descriptors are authoritative: names must be unique ignoring case, and
1920
+ * the runtime validates their limits.
1921
+ */
1922
+ listSkills(options: SkillProviderCallOptions): SkillProviderDescriptor[] | Promise<SkillProviderDescriptor[]>;
1923
+ /**
1924
+ * Returns the `SKILL.md` text for the named skill, or `null`/`undefined`
1925
+ * when the skill no longer exists.
1926
+ *
1927
+ * YAML frontmatter is optional. Fields it omits come from the skill's
1928
+ * descriptor, fields it declares must match the descriptor, and
1929
+ * `allowed-tools` can only be set there. Text whose first line is `---` is
1930
+ * parsed as frontmatter.
1931
+ *
1932
+ * @param name - The skill's name, as listed by {@link SkillProvider.listSkills}.
1933
+ */
1934
+ readSkill(name: string, options: SkillProviderCallOptions): string | null | undefined | Promise<string | null | undefined>;
1935
+ }
1936
+ /**
1937
+ * Per-call options passed to {@link SkillProvider} methods.
1938
+ *
1939
+ * @experimental Session-scoped skill providers are experimental and may change
1940
+ * or be removed in future SDK or CLI releases.
1941
+ */
1942
+ export interface SkillProviderCallOptions {
1943
+ /**
1944
+ * Aborted when the runtime cancels the call, for example when it times out
1945
+ * or the session disconnects. The runtime ignores any later result.
1946
+ */
1947
+ signal: AbortSignal;
1948
+ }
1896
1949
  /**
1897
1950
  * Shared configuration fields used by both {@link SessionConfig} (for
1898
1951
  * creating a new session) and {@link ResumeSessionConfig} (for resuming
@@ -2312,6 +2365,22 @@ export interface SessionConfigBase {
2312
2365
  * Directories to load skills from.
2313
2366
  */
2314
2367
  skillDirectories?: string[];
2368
+ /**
2369
+ * Supplies skills from the host's own storage instead of `SKILL.md` files on
2370
+ * disk. Provider skills join the session's skill catalog alongside file-based
2371
+ * skills. See {@link SkillProvider}.
2372
+ *
2373
+ * Supplying a provider enables skills unless `enableSkills` is set explicitly,
2374
+ * so set `enableSkills: true` when the client runs in `"empty"` mode. With
2375
+ * `enableSkills: false` the provider stays bound but receives no calls.
2376
+ *
2377
+ * The provider isn't persisted. Pass it again when resuming the session;
2378
+ * resuming without one removes the provider's skills.
2379
+ *
2380
+ * @experimental Session-scoped skill providers are experimental and may change
2381
+ * or be removed in future SDK or CLI releases.
2382
+ */
2383
+ skillProvider?: SkillProvider;
2315
2384
  /**
2316
2385
  * Local filesystem paths to Open Plugins-format directories
2317
2386
  * (https://open-plugins.com/) to load for this session.
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.17-preview.4",
9
- "copilotCliVersion": "1.0.92-4",
8
+ "version": "1.0.17-preview.6",
9
+ "copilotCliVersion": "1.0.93-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": "f4385f4f118c567aa0178776aeb45e296e9e6733",
107
- "version": "1.0.92-4",
106
+ "sourceSha": "1ce52eda72a28d686f7bf6adf5d73b288e326e88",
107
+ "version": "1.0.93-0",
108
108
  "visibility": "public"
109
109
  },
110
110
  "optionalDependencies": {
111
- "@github/copilot-sdk-darwin-arm64": "1.0.17-preview.4",
112
- "@github/copilot-sdk-darwin-x64": "1.0.17-preview.4",
113
- "@github/copilot-sdk-linux-arm64": "1.0.17-preview.4",
114
- "@github/copilot-sdk-linux-x64": "1.0.17-preview.4",
115
- "@github/copilot-sdk-linuxmusl-arm64": "1.0.17-preview.4",
116
- "@github/copilot-sdk-linuxmusl-x64": "1.0.17-preview.4",
117
- "@github/copilot-sdk-win32-arm64": "1.0.17-preview.4",
118
- "@github/copilot-sdk-win32-x64": "1.0.17-preview.4"
111
+ "@github/copilot-sdk-darwin-arm64": "1.0.17-preview.6",
112
+ "@github/copilot-sdk-darwin-x64": "1.0.17-preview.6",
113
+ "@github/copilot-sdk-linux-arm64": "1.0.17-preview.6",
114
+ "@github/copilot-sdk-linux-x64": "1.0.17-preview.6",
115
+ "@github/copilot-sdk-linuxmusl-arm64": "1.0.17-preview.6",
116
+ "@github/copilot-sdk-linuxmusl-x64": "1.0.17-preview.6",
117
+ "@github/copilot-sdk-win32-arm64": "1.0.17-preview.6",
118
+ "@github/copilot-sdk-win32-x64": "1.0.17-preview.6"
119
119
  }
120
120
  }