@github/copilot-sdk 1.0.17-unstable.37553872417.gc9f6176 → 1.0.17

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.
@@ -638,21 +638,15 @@ function createServerRpc(connection) {
638
638
  /** @experimental */
639
639
  settings: {
640
640
  /**
641
- * Drops this runtime process's in-memory user settings cache so the next settings read observes disk.
642
- */
643
- reload: async () => connection.sendRequest("user.settings.reload", {}),
644
- /**
645
- * Lists every known user setting (settings.json overlaid with the legacy config.json, config.json wins), each with its effective value, its default, and whether it is at the default — so settings the user has never set still appear with their default value. Does not include repository- or enterprise-managed overrides that the runtime layers on top at session time.
641
+ * Lists every known user setting from settings.json, each with its effective value, its default, and whether it is at the default — so settings the user has never set still appear with their default value. Does not include repository- or enterprise-managed overrides that the runtime layers on top at session time.
646
642
  *
647
- * @returns Per-key metadata for every known user setting (settings.json overlaid with the legacy config.json, config.json wins), including settings left at their default. Excludes repository- and enterprise-managed overrides.
643
+ * @returns Per-key metadata for every known user setting in settings.json, including settings left at their default. Excludes repository- and enterprise-managed overrides.
648
644
  */
649
645
  get: async () => connection.sendRequest("user.settings.get", {}),
650
646
  /**
651
- * Writes one or more user settings to settings.json, replacing each provided top-level key. A key whose value is null is removed. Returns the keys whose new value is shadowed by a legacy config.json entry (config.json wins on read), which the runtime leaves in place — such writes do not take effect until the legacy value is removed.
647
+ * Writes one or more user settings to settings.json, replacing each provided top-level key. A key whose value is null is removed.
652
648
  *
653
649
  * @param params Partial user settings to write to settings.json. Each top-level key is written individually, replacing the existing value; a key whose value is null is removed.
654
- *
655
- * @returns Outcome of writing user settings.
656
650
  */
657
651
  set: async (params) => connection.sendRequest("user.settings.set", params)
658
652
  }
@@ -952,6 +946,37 @@ function createServerRpc(connection) {
952
946
  * @returns Outcome of an agentRegistry.spawn call.
953
947
  */
954
948
  spawn: async (params) => connection.sendRequest("agentRegistry.spawn", params)
949
+ },
950
+ /** @experimental */
951
+ connectors: {
952
+ /**
953
+ * Returns feature availability.
954
+ *
955
+ * @returns Feature availability.
956
+ */
957
+ getCapabilities: async () => connection.sendRequest("connectors.getCapabilities", {}),
958
+ /**
959
+ * Returns eligible accounts.
960
+ *
961
+ * @returns Eligible accounts.
962
+ */
963
+ getAccounts: async () => connection.sendRequest("connectors.getAccounts", {}),
964
+ /**
965
+ * Lists entries for the selected account.
966
+ *
967
+ * @param params Selected account.
968
+ *
969
+ * @returns Entries for the selected account.
970
+ */
971
+ list: async (params) => connection.sendRequest("connectors.list", params),
972
+ /**
973
+ * Refreshes entries for the selected account.
974
+ *
975
+ * @param params Selected account.
976
+ *
977
+ * @returns Entries for the selected account.
978
+ */
979
+ refresh: async (params) => connection.sendRequest("connectors.refresh", params)
955
980
  }
956
981
  };
957
982
  }
@@ -1007,6 +1032,133 @@ function createInternalServerRpc(connection) {
1007
1032
  */
1008
1033
  connect: async (params) => connection.sendRequest("connect", params),
1009
1034
  /** @experimental */
1035
+ agents: {
1036
+ /**
1037
+ * 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.
1038
+ *
1039
+ * @returns The agents this runtime ships, named so a consumer can tell them apart from authored ones.
1040
+ */
1041
+ getBuiltins: async () => connection.sendRequest("agents.getBuiltins", {}),
1042
+ /**
1043
+ * 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.
1044
+ *
1045
+ * @param params The feature flags to evaluate shipped agents against.
1046
+ *
1047
+ * @returns The shipped agents available under the requested flags.
1048
+ */
1049
+ getAvailableBuiltins: async (params) => connection.sendRequest("agents.getAvailableBuiltins", params),
1050
+ /**
1051
+ * 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.
1052
+ *
1053
+ * @param params The shipped agent whose definition to load.
1054
+ *
1055
+ * @returns One shipped agent's definition.
1056
+ */
1057
+ getBuiltinDefinition: async (params) => connection.sendRequest("agents.getBuiltinDefinition", params),
1058
+ /**
1059
+ * 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`.
1060
+ *
1061
+ * @param params The shipped agent whose listing entry to load.
1062
+ *
1063
+ * @returns One shipped agent, projected for a listing.
1064
+ */
1065
+ getBuiltinListingDefinition: async (params) => connection.sendRequest("agents.getBuiltinListingDefinition", params),
1066
+ /**
1067
+ * 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.
1068
+ *
1069
+ * @param params The models a custom agent asks for, and the models actually available.
1070
+ *
1071
+ * @returns The model to switch to, and the warning to show when the agent's preference could not be met.
1072
+ */
1073
+ customAgentInitialModelDecision: async (params) => connection.sendRequest("agents.customAgentInitialModelDecision", params)
1074
+ },
1075
+ /** @experimental */
1076
+ globalState: {
1077
+ /**
1078
+ * Reads the host's machine-wide state: which plugins are installed and the one-off flags and timestamps that record what the user has already been shown or migrated. This is the state that outlives a single session and a single workspace, so a host reads it to decide whether to run a first-launch step, offer an onboarding prompt, or skip one it has already completed. The stored credentials are deliberately not part of this result; a caller that needs an authenticated identity asks the account methods for it instead. Reading is non-destructive and every field is optional, because a fresh install has recorded nothing yet.
1079
+ *
1080
+ * @returns The host's machine-wide state. Every field is optional because a fresh install has recorded nothing yet, so a reader must treat an absent field as `not yet`, never as a negative answer. Stored credentials are deliberately absent from this shape.
1081
+ */
1082
+ load: async () => connection.sendRequest("globalState.load", {}),
1083
+ /**
1084
+ * Reads the host's machine-wide state exactly as `globalState.load` does, but from a caller-supplied configuration directory instead of the one the server resolved for itself. Use this when a consumer scopes a session to its own Copilot home — the SDK's per-session `configDir` override — so the state read matches the directory that session actually uses. An absent or empty `configDir` resolves the server's own home, making this identical to `globalState.load`. The stored credentials are omitted here for the same reason they are omitted from `globalState.load`: a caller that needs an authenticated identity asks the account methods instead, so pointing this at another directory cannot be used to read the credentials kept in it.
1085
+ *
1086
+ * @param params Selects the configuration directory whose machine-wide state to read.
1087
+ *
1088
+ * @returns The host's machine-wide state. Every field is optional because a fresh install has recorded nothing yet, so a reader must treat an absent field as `not yet`, never as a negative answer. Stored credentials are deliberately absent from this shape.
1089
+ */
1090
+ loadForConfigDir: async (params) => connection.sendRequest("globalState.loadForConfigDir", params),
1091
+ /**
1092
+ * Records one top-level key in the host's machine-wide state, the counterpart to `globalState.load`. A host calls this to remember that it has shown an onboarding step, asked a one-off question, or completed a migration, so the next run can skip it. Only the named key is replaced and the rest of the document is preserved, which lets two writers record different flags without overwriting each other; passing no value removes the key instead. Only the keys a host records itself are writable: `appInstallNudgeResponded`, `appTipShown`, `askedSetupTerminals`, `autoFeedbackLastPromptedAt`, `firstLaunchAt`, `recentModelIds`, `sandboxCredentialProxyCaDeclined` and `sandboxOnboardingShown`. Every other key is refused, including `installedPlugins`, the stored credentials, `trustedFolders`, the staff flags and the signed-in accounts. Plugin enablement must use the plugin APIs, which apply repository and managed-policy checks.
1093
+ *
1094
+ * @param params A single top-level key to record in the host's machine-wide state. The write replaces only that key and leaves the rest of the document untouched, so two writers recording different one-off flags do not overwrite each other. The stored credential keys cannot be written through this method.
1095
+ */
1096
+ writeKey: async (params) => connection.sendRequest("globalState.writeKey", params)
1097
+ },
1098
+ /** @experimental */
1099
+ gitHubRepository: {
1100
+ /**
1101
+ * 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'.
1102
+ *
1103
+ * @param params Working-tree path whose owning GitHub repository should be resolved.
1104
+ *
1105
+ * @returns The GitHub repository that owns the requested path, when the selected remote (`origin`, else the first) is on a GitHub host.
1106
+ */
1107
+ atPath: async (params) => connection.sendRequest("gitHubRepository.atPath", params)
1108
+ },
1109
+ /** @experimental */
1110
+ gitHubOwners: {
1111
+ /**
1112
+ * 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.
1113
+ *
1114
+ * @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.
1115
+ */
1116
+ nextRequestId: async () => connection.sendRequest("gitHubOwners.nextRequestId", {}),
1117
+ /**
1118
+ * 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`.
1119
+ *
1120
+ * @param params Credential to list owners under, and the request id that makes the listing cancellable.
1121
+ *
1122
+ * @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.
1123
+ */
1124
+ list: async (params) => connection.sendRequest("gitHubOwners.list", params),
1125
+ /**
1126
+ * 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.
1127
+ *
1128
+ * @param params The owner listing to abandon.
1129
+ *
1130
+ * @returns Whether the id named a running owner listing.
1131
+ */
1132
+ cancel: async (params) => connection.sendRequest("gitHubOwners.cancel", params)
1133
+ },
1134
+ /** @experimental */
1135
+ git: {
1136
+ /**
1137
+ * 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.
1138
+ *
1139
+ * @param params Working-tree path a git query applies to.
1140
+ *
1141
+ * @returns The remote the checked-out branch tracks.
1142
+ */
1143
+ currentBranchRemote: async (params) => connection.sendRequest("git.currentBranchRemote", params),
1144
+ /**
1145
+ * 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.
1146
+ *
1147
+ * @param params Working-tree path a git query applies to.
1148
+ *
1149
+ * @returns Updated working directory and git context. Emitted as the new payload of `session.context_changed`.
1150
+ */
1151
+ workingDirectoryContext: async (params) => connection.sendRequest("git.workingDirectoryContext", params),
1152
+ /**
1153
+ * 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.
1154
+ *
1155
+ * @param params Git working tree whose GitHub remotes should be listed.
1156
+ *
1157
+ * @returns The GitHub repositories a working tree's remotes point at.
1158
+ */
1159
+ reposFromRemotes: async (params) => connection.sendRequest("git.reposFromRemotes", params)
1160
+ },
1161
+ /** @experimental */
1010
1162
  sessions: {
1011
1163
  /**
1012
1164
  * Reads lightweight persisted metadata for one local session without opening it.
@@ -1046,6 +1198,30 @@ function createInternalServerRpc(connection) {
1046
1198
  * @param params Session ID to delete from disk.
1047
1199
  */
1048
1200
  delete: async (params) => connection.sendRequest("sessions.delete", params),
1201
+ /**
1202
+ * 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.
1203
+ *
1204
+ * @param params Identity, state location and starting context for a workspace record.
1205
+ *
1206
+ * @returns The workspace record that was written.
1207
+ */
1208
+ createWorkspace: async (params) => connection.sendRequest("sessions.createWorkspace", params),
1209
+ /**
1210
+ * 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.
1211
+ *
1212
+ * @param params Where the session's state lives, as a root directory and the session ID under it.
1213
+ *
1214
+ * @returns The workspace record on disk, omitted when the session has none.
1215
+ */
1216
+ loadWorkspace: async (params) => connection.sendRequest("sessions.loadWorkspace", params),
1217
+ /**
1218
+ * 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`.
1219
+ *
1220
+ * @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.
1221
+ *
1222
+ * @returns The merge completed. The record carries the supplied workspace-schema fields, but a stored `fork_count` stays.
1223
+ */
1224
+ updateWorkspaceFields: async (params) => connection.sendRequest("sessions.updateWorkspaceFields", params),
1049
1225
  /**
1050
1226
  * 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
1227
  *
@@ -1920,11 +2096,17 @@ function createSessionRpc(connection, sessionId) {
1920
2096
  /** @experimental */
1921
2097
  mcp: {
1922
2098
  /**
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.
2099
+ * Lists materialized MCP servers and their connection status. Cache misses may start and wait for MCP servers.
1924
2100
  *
1925
2101
  * @returns MCP servers configured for the session, with their connection status and host-level state.
1926
2102
  */
1927
2103
  list: async () => connection.sendRequest("session.mcp.list", { sessionId }),
2104
+ /**
2105
+ * 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.
2106
+ *
2107
+ * @returns Effective MCP configuration with optional live observations from matching already materialized servers.
2108
+ */
2109
+ listConfigured: async () => connection.sendRequest("session.mcp.listConfigured", { sessionId }),
1928
2110
  /**
1929
2111
  * 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
2112
  *
@@ -3373,6 +3555,12 @@ function createInternalSessionRpc(connection, sessionId) {
3373
3555
  },
3374
3556
  /** @experimental */
3375
3557
  mcp: {
3558
+ /**
3559
+ * 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.
3560
+ *
3561
+ * @param params Records which IDE the host is connected to, or clears it.
3562
+ */
3563
+ setConnectedIdeInfo: async (params) => connection.sendRequest("session.mcp.setConnectedIdeInfo", { ...params, sessionId }),
3376
3564
  /**
3377
3565
  * Reloads MCP server connections for the session with an explicit host-provided configuration.
3378
3566
  *
@@ -11,7 +11,7 @@ export type JsonValue = null | boolean | number | string | JsonValue[] | {
11
11
  */
12
12
  export type SessionEvent = StartEvent | ResumeEvent | RemoteSteerableChangedEvent | ErrorEvent | IdleEvent | TitleChangedEvent | ScheduleCreatedEvent | ScheduleCancelledEvent | ScheduleRearmedEvent | AutopilotObjectiveChangedEvent | InfoEvent | IndexedSearchEvent | WarningEvent | ModelChangeEvent | ModelDeselectedEvent | AutoTierRecommendationEvent | AutoTierSwitchFailedEvent | ModeChangedEvent | ModeNoticeDeliveredEvent | SessionLimitsChangedEvent | PermissionsChangedEvent | PlanChangedEvent | TodosChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | UsageCheckpointEvent | ContextChangedEvent | UsageInfoEvent | ContextClearedEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | CompletionReceiptEvent | FusionRouteStartedEvent | FusionRouteFailedEvent | FusionResolvedEvent | FusionCompletedEvent | PermissionRecoveryEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent | AssistantFusionPhaseStartedEvent | AssistantFusionPhaseActivityEvent | AssistantFusionPhaseCompletedEvent | AssistantFusionPhaseFailedEvent | AssistantServerToolProgressEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantToolCallDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantIdleEvent | AssistantUsageEvent | ModelCallFailureEvent | ModelCallFinishedEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolShellOutputEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | ToolSearchActivatedEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentConfiguredEvent | SubagentCompletedEvent | SubagentFailedEvent | SubagentSelectedEvent | SubagentDeselectedEvent | HookStartEvent | HookEndEvent | HookProgressEvent | BinaryAssetEvent | SystemMessageEvent | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent | PermissionCarriedForwardEvent | PermissionMessageAuthorizationEvent | PermissionMessageAuthorizationReadEvent | PermissionMessageAuthorizationDegradedEvent | PermissionAssentDetectedEvent | PermissionContextualAuthorizationEvent | UserInputRequestedEvent | UserInputCompletedEvent | ElicitationRequestedEvent | ElicitationCompletedEvent | SamplingRequestedEvent | SamplingCompletedEvent | McpOauthRequiredEvent | McpOauthCompletedEvent | McpHeadersRefreshRequiredEvent | McpHeadersRefreshCompletedEvent | CustomNotificationEvent | UIEphemeralQueryEvent | ExternalToolRequestedEvent | ExternalToolCompletedEvent | CommandQueuedEvent | CommandExecuteEvent | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent | SessionLimitsExhaustedRequestedEvent | SessionLimitsExhaustedCompletedEvent | AutoModeResolvedEvent | ManagedSettingsResolvedEvent | ManagedSettingsEnforcedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent | ExitPlanModeCompletedEvent | HumanResponseRecordedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | WorkflowRunUpdatedEvent | WorkflowRunStartedEvent | WorkflowRunSettledEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | McpServerRemovedEvent | McpServerNeedsReconnectEvent | McpToolsListChangedEvent | McpResourcesListChangedEvent | McpPromptsListChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent | CanvasClosedEvent | CanvasUnavailableEvent | CanvasRecordedEvent | CanvasRemovedEvent | ExtensionsAttachmentsPushedEvent | McpAppToolCallCompleteEvent;
13
13
  /**
14
- * Routing preference used when the session model is `auto`. `fast` is an integrator-only latency preset and is not a first-party GitHub Copilot product preference.
14
+ * Extensible routing preference for the virtual `auto` model. New identifiers must be advertised and enabled by the provider. `fast` is an integrator-only latency preset.
15
15
  */
16
16
  export type AutoTier =
17
17
  /** Optimize for efficiency. */
@@ -21,7 +21,7 @@ export type AutoTier =
21
21
  /** Optimize for intelligence. */
22
22
  | "intelligence"
23
23
  /** Integrator-only preset that optimizes for latency. */
24
- | "fast";
24
+ | "fast" | (string & {});
25
25
  /**
26
26
  * Hosting platform type of the repository (github or ado)
27
27
  */
@@ -308,7 +308,7 @@ export type ModelDeselectedReason =
308
308
  /** A host-managed provider snapshot no longer publishes the selected model. */
309
309
  "provider_withdrawn";
310
310
  /**
311
- * Auto preferences that Copilot API can recommend.
311
+ * Enabled Auto preferences that Copilot API can recommend.
312
312
  */
313
313
  export type RecommendedAutoTier =
314
314
  /** Optimize for efficiency. */
@@ -316,7 +316,7 @@ export type RecommendedAutoTier =
316
316
  /** Balance efficiency and intelligence. */
317
317
  | "balance"
318
318
  /** Optimize for intelligence. */
319
- | "intelligence";
319
+ | "intelligence" | (string & {});
320
320
  /**
321
321
  * Terminal reason an Auto preference activation failed.
322
322
  */
@@ -740,7 +740,7 @@ export type AbortReason =
740
740
  /** Autopilot stopped the run because the active objective reached its user-set --max-ai-credits limit. */
741
741
  | "autopilot_credit_limit";
742
742
  /**
743
- * Configuration source: user, workspace, plugin, builtin, or managed
743
+ * Configuration source: user, workspace, plugin, builtin, managed, or account
744
744
  */
745
745
  export type McpServerSource =
746
746
  /** Server configured in the user's global MCP configuration. */
@@ -752,7 +752,9 @@ export type McpServerSource =
752
752
  /** Server bundled with the runtime. */
753
753
  | "builtin"
754
754
  /** Server supplied by a trusted host-managed catalog. */
755
- | "managed";
755
+ | "managed"
756
+ /** Server contributed by a signed-in account; enablement and organization policy still apply. */
757
+ | "account";
756
758
  /**
757
759
  * Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server)
758
760
  */
@@ -1378,7 +1380,7 @@ export type McpServerStatus =
1378
1380
  | "pending"
1379
1381
  /** The server is configured but disabled. */
1380
1382
  | "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. */
1383
+ /** 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
1384
  | "stopped"
1383
1385
  /** The server is not configured for this session. */
1384
1386
  | "not_configured";
@@ -6201,6 +6203,10 @@ export interface ModelCallFailureData {
6201
6203
  * Reasoning effort level used for the failed model call, if applicable
6202
6204
  */
6203
6205
  reasoningEffort?: string;
6206
+ /**
6207
+ * Serialized (uncompressed) byte length of the failed request body. A content-free size signal.
6208
+ */
6209
+ requestBodyBytes?: number;
6204
6210
  requestFingerprint?: ModelCallFailureRequestFingerprint;
6205
6211
  /**
6206
6212
  * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable.
@@ -8852,6 +8858,8 @@ export interface PermissionApprovalEvaluation {
8852
8858
  | "action-too-long"
8853
8859
  /** The script path was not authorized for inspection. */
8854
8860
  | "path-not-authorized"
8861
+ /** A code source was excluded from review by content exclusion policy. */
8862
+ | "content-excluded"
8855
8863
  /** The script working directory was invalid. */
8856
8864
  | "invalid-working-directory"
8857
8865
  /** The script snapshot could not be read. */
@@ -8876,6 +8884,18 @@ export interface PermissionApprovalEvaluation {
8876
8884
  | "unreviewable-script-invocation"
8877
8885
  /** The script argument binding could not be reviewed. */
8878
8886
  | "argument-binding-unreviewable"
8887
+ /** The shell command could not be analyzed for execution evidence. */
8888
+ | "unsupported-command-shape"
8889
+ /** The shell command used a code source that cannot be bound for review. */
8890
+ | "unsupported-source"
8891
+ /** The shell command used a code source computed at run time. */
8892
+ | "dynamic-source"
8893
+ /** The shell command referenced more code sources than can be reviewed. */
8894
+ | "too-many-sources"
8895
+ /** A code-bearing executable could not be inspected. */
8896
+ | "executable-unavailable"
8897
+ /** A code-bearing executable exceeded the binding size limit. */
8898
+ | "executable-too-large"
8879
8899
  /** The script review metadata was malformed. */
8880
8900
  | "malformed-script-action-review"
8881
8901
  /** 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";
@@ -1880,6 +1882,13 @@ export interface ManagedSettingsPermissions {
1880
1882
  * (across managed layers) must admit an operation for it to be allowed.
1881
1883
  */
1882
1884
  allow?: string[];
1885
+ /**
1886
+ * Closed-world host boundary expressed as `Domain(hostname)`, `Domain(IP)`,
1887
+ * or `Domain(*.example.com)` rules. Schemes, ports, paths, queries, and
1888
+ * fragments are rejected. Multiple managed layers intersect their lists;
1889
+ * an empty list denies all hosts.
1890
+ */
1891
+ limitTo?: string[];
1883
1892
  }
1884
1893
  /**
1885
1894
  * Host-injected enterprise managed settings. The first supported contract is
@@ -1893,6 +1902,57 @@ export interface ManagedSettings {
1893
1902
  }
1894
1903
  /** Selects the model-facing shape of the built-in `ask_user` tool. */
1895
1904
  export type AskUserVariant = "legacy" | "elicitation";
1905
+ /**
1906
+ * Supplies session-scoped skills from the host's own storage, such as a
1907
+ * database, instead of `SKILL.md` files on disk.
1908
+ *
1909
+ * The runtime calls {@link SkillProvider.listSkills} when it builds the
1910
+ * session's skill catalog, and {@link SkillProvider.readSkill} each time it
1911
+ * needs a skill's instructions: when the model loads the skill through the
1912
+ * `skill` tool, when a user runs `/skill-name`, or when a custom agent lists
1913
+ * the skill. Calls may run concurrently, including on behalf of sub-agents, and
1914
+ * each call must finish within 30 seconds. Errors thrown by a provider are
1915
+ * never shown to the model.
1916
+ *
1917
+ * Supply a provider with {@link SessionConfigBase.skillProvider}. Providers
1918
+ * aren't supported for cloud sessions.
1919
+ *
1920
+ * @experimental Session-scoped skill providers are experimental and may change
1921
+ * or be removed in future SDK or CLI releases.
1922
+ */
1923
+ export interface SkillProvider {
1924
+ /**
1925
+ * Returns catalog metadata for every skill the provider supplies. The
1926
+ * descriptors are authoritative: names must be unique ignoring case, and
1927
+ * the runtime validates their limits.
1928
+ */
1929
+ listSkills(options: SkillProviderCallOptions): SkillProviderDescriptor[] | Promise<SkillProviderDescriptor[]>;
1930
+ /**
1931
+ * Returns the `SKILL.md` text for the named skill, or `null`/`undefined`
1932
+ * when the skill no longer exists.
1933
+ *
1934
+ * YAML frontmatter is optional. Fields it omits come from the skill's
1935
+ * descriptor, fields it declares must match the descriptor, and
1936
+ * `allowed-tools` can only be set there. Text whose first line is `---` is
1937
+ * parsed as frontmatter.
1938
+ *
1939
+ * @param name - The skill's name, as listed by {@link SkillProvider.listSkills}.
1940
+ */
1941
+ readSkill(name: string, options: SkillProviderCallOptions): string | null | undefined | Promise<string | null | undefined>;
1942
+ }
1943
+ /**
1944
+ * Per-call options passed to {@link SkillProvider} methods.
1945
+ *
1946
+ * @experimental Session-scoped skill providers are experimental and may change
1947
+ * or be removed in future SDK or CLI releases.
1948
+ */
1949
+ export interface SkillProviderCallOptions {
1950
+ /**
1951
+ * Aborted when the runtime cancels the call, for example when it times out
1952
+ * or the session disconnects. The runtime ignores any later result.
1953
+ */
1954
+ signal: AbortSignal;
1955
+ }
1896
1956
  /**
1897
1957
  * Shared configuration fields used by both {@link SessionConfig} (for
1898
1958
  * creating a new session) and {@link ResumeSessionConfig} (for resuming
@@ -2312,6 +2372,22 @@ export interface SessionConfigBase {
2312
2372
  * Directories to load skills from.
2313
2373
  */
2314
2374
  skillDirectories?: string[];
2375
+ /**
2376
+ * Supplies skills from the host's own storage instead of `SKILL.md` files on
2377
+ * disk. Provider skills join the session's skill catalog alongside file-based
2378
+ * skills. See {@link SkillProvider}.
2379
+ *
2380
+ * Supplying a provider enables skills unless `enableSkills` is set explicitly,
2381
+ * so set `enableSkills: true` when the client runs in `"empty"` mode. With
2382
+ * `enableSkills: false` the provider stays bound but receives no calls.
2383
+ *
2384
+ * The provider isn't persisted. Pass it again when resuming the session;
2385
+ * resuming without one removes the provider's skills.
2386
+ *
2387
+ * @experimental Session-scoped skill providers are experimental and may change
2388
+ * or be removed in future SDK or CLI releases.
2389
+ */
2390
+ skillProvider?: SkillProvider;
2315
2391
  /**
2316
2392
  * Local filesystem paths to Open Plugins-format directories
2317
2393
  * (https://open-plugins.com/) to load for this session.