@microsoft/copilot-sdk 2.0.0-preview.0 → 2.0.0-preview.1

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.
@@ -1568,7 +1568,7 @@ function createInternalServerRpc(connection) {
1568
1568
  */
1569
1569
  setHookDisabled: async (params) => connection.sendRequest("user.settings.setHookDisabled", params),
1570
1570
  /**
1571
- * Reads the user's settings document exactly as `user.settings.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 settings read match the directory that session actually uses. An absent or empty `configDir` resolves the server's own home, making this identical to `user.settings.load`. Hook-validation relaxations are deliberately not caller-supplied: they continue to come from the server's environment, so a consumer cannot widen the host's hook policy through this method.
1571
+ * Reads the user's settings document as `user.settings.loadWithWarning` does, without its warning, 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 settings read match the directory that session actually uses. An absent or empty `configDir` resolves the server's own home, making this identical to the `settings` that `user.settings.loadWithWarning` returns. Hook-validation relaxations are deliberately not caller-supplied: they continue to come from the server's environment, so a consumer cannot widen the host's hook policy through this method.
1572
1572
  *
1573
1573
  * @param params Selects the configuration directory whose user settings to read.
1574
1574
  *
@@ -1576,7 +1576,7 @@ function createInternalServerRpc(connection) {
1576
1576
  */
1577
1577
  loadForConfigDir: async (params) => connection.sendRequest("user.settings.loadForConfigDir", params),
1578
1578
  /**
1579
- * Reads a repository's checked-in settings document as stored, normalized, together with any diagnostic raised while reading it. This is the repository half of the layering `user.settings.get` reports: `user.settings.load` reads the user's own document, and this reads the one a repository checks in to govern the keys `user.settings.governanceKeys` lists as repo-governable. A document that fails to parse, or that sets a key a repository may not govern, is reported through `warning` while the settings that did load are still returned, so a consumer surfaces the diagnostic and continues rather than failing the session. When `repoRoot` is the user's home directory the Claude-compatible configuration is skipped, so a home-directory session does not inherit a personal config as repository policy.
1579
+ * Reads a repository's checked-in settings document as stored, normalized, together with any diagnostic raised while reading it. This is the repository half of the layering `user.settings.get` reports: `user.settings.loadWithWarning` reads the user's own document, and this reads the one a repository checks in to govern the keys `user.settings.listGovernanceKeys` lists as repo-governable. A document that fails to parse, or that sets a key a repository may not govern, is reported through `warning` while the settings that did load are still returned, so a consumer surfaces the diagnostic and continues rather than failing the session. When `repoRoot` is the user's home directory the Claude-compatible configuration is skipped, so a home-directory session does not inherit a personal config as repository policy.
1580
1580
  *
1581
1581
  * @param params Selects the repository whose checked-in settings to read.
1582
1582
  *
@@ -1592,13 +1592,13 @@ function createInternalServerRpc(connection) {
1592
1592
  */
1593
1593
  loadAndMergeRepo: async (params) => connection.sendRequest("user.settings.loadAndMergeRepo", params),
1594
1594
  /**
1595
- * Reports the on-disk path of the settings document `user.settings.load` and `user.settings.set` read and write. Resolved the same way those methods resolve it, so a host that shows or opens the settings file names the file the runtime actually uses, including the extensionless legacy `settings` file when that is what is present.
1595
+ * Reports the on-disk path of the settings document `user.settings.loadWithWarning` and `user.settings.set` read and write. Resolved the same way those methods resolve it, so a host that shows or opens the settings file names the file the runtime actually uses, including the extensionless legacy `settings` file when that is what is present.
1596
1596
  *
1597
1597
  * @returns The on-disk location of the user's settings document.
1598
1598
  */
1599
1599
  getPath: async () => connection.sendRequest("user.settings.getPath", {}),
1600
1600
  /**
1601
- * Reads the user's stored settings together with the diagnostic raised while reading them. This is `user.settings.load` plus the reason part of the document was ignored: that one answers the document alone, so a caller cannot tell a clean read from a salvaged one. Read this when the caller is about to write the file back, where accepting a partial parse would discard every value the loader could not read. The settings that did load are still reported alongside the warning, so a consumer may surface it and continue instead of failing.
1601
+ * Reads the user's stored settings together with the diagnostic raised while reading them. This is `user.settings.loadForConfigDir` without a `configDir` plus the reason part of the document was ignored: that one answers the document alone, so a caller cannot tell a clean read from a salvaged one. Read this when the caller is about to write the file back, where accepting a partial parse would discard every value the loader could not read. The settings that did load are still reported alongside the warning, so a consumer may surface it and continue instead of failing.
1602
1602
  *
1603
1603
  * @returns The user's stored settings, together with any diagnostic raised while reading them.
1604
1604
  */
@@ -1660,7 +1660,7 @@ function createInternalServerRpc(connection) {
1660
1660
  */
1661
1661
  migrateStaffLogLevelOnce: async (params) => connection.sendRequest("user.settings.migrateStaffLogLevelOnce", params),
1662
1662
  /**
1663
- * Runs the one-time cleanup that removes obsolete CLI-owned settings and legacy rubber-duck keys from the user's settings document, and reports what it did. Idempotent and safe to call on every startup: with nothing obsolete left it reports `unchanged` and writes nothing. The cleanup preserves every key it does not recognize, so a setting written by a newer host is never dropped by an older one, and a document that fails to parse is reported `invalid` and left untouched rather than rewritten from a partial read. The cleaned document is not returned: it is written before this replies, so `user.settings.load` reads it authoritatively. A host that surfaces unrecognized keys through `user.settings.unknownKeys` wants this first, because the keys this retires would otherwise be shown to the user as if they were misspelled settings.
1663
+ * Runs the one-time cleanup that removes obsolete CLI-owned settings and legacy rubber-duck keys from the user's settings document, and reports what it did. Idempotent and safe to call on every startup: with nothing obsolete left it reports `unchanged` and writes nothing. The cleanup preserves every key it does not recognize, so a setting written by a newer host is never dropped by an older one, and a document that fails to parse is reported `invalid` and left untouched rather than rewritten from a partial read. The cleaned document is not returned: it is written before this replies, so `user.settings.loadWithWarning` reads it authoritatively. A host that surfaces unrecognized keys through `user.settings.getUnknownKeysWarning` wants this first, because the keys this retires would otherwise be shown to the user as if they were misspelled settings.
1664
1664
  *
1665
1665
  * @param params Selects the configuration directory whose settings document to clean.
1666
1666
  *
@@ -1668,7 +1668,7 @@ function createInternalServerRpc(connection) {
1668
1668
  */
1669
1669
  migrateObsoleteOnDisk: async (params) => connection.sendRequest("user.settings.migrateObsoleteOnDisk", params),
1670
1670
  /**
1671
- * Resolves the on-disk locations of the settings files this runtime reads, so a consumer can show or open them. The user path is the same file `user.settings.get`, `user.settings.load`, and `user.settings.set` operate on. Supply `repoRoot` to also resolve that repository's checked-in and local settings paths. A path is reported whether or not the file exists.
1671
+ * Resolves the on-disk locations of the settings files this runtime reads, so a consumer can show or open them. The user path is the same file `user.settings.get`, `user.settings.loadWithWarning`, and `user.settings.set` operate on. Supply `repoRoot` to also resolve that repository's checked-in and local settings paths. A path is reported whether or not the file exists.
1672
1672
  *
1673
1673
  * @param params Selects which settings file paths to resolve.
1674
1674
  *
@@ -4830,7 +4830,7 @@ function createSessionRpc(connection, sessionId) {
4830
4830
  *
4831
4831
  * @param params Model identifier to use when re-tokenizing the session's existing messages.
4832
4832
  *
4833
- * @returns Re-tokenize the session's existing messages against `modelId` and return the token totals. Useful for hosts that want an initial estimate of context usage on session resume, before the next agent turn fires `session.context_info_changed` events. Returns zeros for an empty session.
4833
+ * @returns Re-tokenize the session's existing messages against `modelId` and return the token totals. Useful for hosts that want an initial estimate of context usage on session resume, before the next agent turn fires `session.usage_info` events. Returns zeros for an empty session.
4834
4834
  */
4835
4835
  recomputeContextTokens: async (params) => connection.sendRequest("session.metadata.recomputeContextTokens", { ...params, sessionId })
4836
4836
  },
@@ -2218,6 +2218,10 @@ export interface StartData {
2218
2218
  * Provider of selectedModel at creation time, when explicitly selected.
2219
2219
  */
2220
2220
  providerId?: string;
2221
+ /**
2222
+ * Credential-free effective model routing policy restored on cold resume.
2223
+ */
2224
+ providerRouting?: JsonValue;
2221
2225
  /**
2222
2226
  * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
2223
2227
  */
@@ -2415,6 +2419,10 @@ export interface ResumeData {
2415
2419
  * Provider of selectedModel at resume time, when explicitly selected.
2416
2420
  */
2417
2421
  providerId?: string;
2422
+ /**
2423
+ * Credential-free effective model routing policy restored on cold resume.
2424
+ */
2425
+ providerRouting?: JsonValue;
2418
2426
  /**
2419
2427
  * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
2420
2428
  */
@@ -3245,6 +3253,10 @@ export interface ModelChangeData {
3245
3253
  * Provider selected for newModel. Omitted for legacy or unattributed selections; never inferred from a later selection.
3246
3254
  */
3247
3255
  providerId?: string;
3256
+ /**
3257
+ * Credential-free provider routing policy and selected-model registration.
3258
+ */
3259
+ providerRouting?: JsonValue;
3248
3260
  /**
3249
3261
  * Reasoning effort level after the model change, if applicable
3250
3262
  */
@@ -5492,6 +5504,10 @@ export interface PermissionRecoveryAttempt {
5492
5504
  * SHA-256 fingerprint of normalized request data; raw permission arguments are not included
5493
5505
  */
5494
5506
  requestFingerprint: string;
5507
+ /**
5508
+ * Whether this deferral happened because the automatic permission review ended without a verdict (timeout, empty or unparseable reply). Such a deferral assesses nothing: it does not make a later identical request a repeated attempt or count toward the attempt limit. Older runtimes ignore it.
5509
+ */
5510
+ reviewIncomplete?: boolean;
5495
5511
  /**
5496
5512
  * Tool-call identifier associated with this attempt, when available
5497
5513
  */
package/dist/host.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { HostExitedNotification, HostPublishSessionResult, HostUnpublishSessionResult, HostListSessionsResult, HostLocalServerOptions, HostGitHubEnvironmentOptions } from "./generated/rpc.js";
2
2
  import type { CopilotSession } from "./session.js";
3
- import type { SessionConfig, ResumeSessionConfig } from "./types.js";
3
+ import type { CreateSessionOptions, ResumeSessionOptions, SessionPermissionOptions } from "./types.js";
4
4
  /** Verified host admission identity, independent of inference authentication. @experimental */
5
5
  export type AhpSessionAuthentication = {
6
6
  mode: "github";
@@ -35,7 +35,9 @@ export interface AhpSessionCreateRequest {
35
35
  /** Trusted admission context supplied by the host, not by the connecting client. */
36
36
  authentication: AhpSessionAuthentication;
37
37
  /** Pass these settings to createSession, adding your prompt, tools and callbacks. */
38
- config: Omit<SessionConfig, "onPermissionRequest">;
38
+ config: Omit<CreateSessionOptions, "permissions"> & {
39
+ permissions?: Omit<SessionPermissionOptions, "onRequest">;
40
+ };
39
41
  /** Aborted when participation ends, including timeout or owner disconnection. */
40
42
  signal: AbortSignal;
41
43
  }
@@ -45,7 +47,9 @@ export interface AhpSessionResumeRequest {
45
47
  authentication: AhpSessionAuthentication;
46
48
  sessionId: string;
47
49
  /** Pass to resumeSession, adding application tools, hooks and callbacks. */
48
- config: Omit<ResumeSessionConfig, "onPermissionRequest">;
50
+ config: Omit<ResumeSessionOptions, "permissions"> & {
51
+ permissions?: Omit<SessionPermissionOptions, "onRequest">;
52
+ };
49
53
  /** Aborted when participation ends; late results are still released exactly once. */
50
54
  signal: AbortSignal;
51
55
  }
package/dist/index.d.ts CHANGED
@@ -19,5 +19,6 @@ export { defineWorkflow, WorkflowResumeError, isWorkflowRunTerminal, WORKFLOW_AG
19
19
  export { Canvas, CanvasError, createCanvas, type CanvasAction, type CanvasDeclaration, type CanvasHostContext, type CanvasHostContextCapabilities, type CanvasJsonSchema, type CanvasOptions, } from "./canvas.js";
20
20
  export { defineTool, approveAll, createAttributedPermissionResult, createAttributedResult, convertMcpCallToolResult, createSessionFsAdapter, CopilotRequestHandler, CopilotWebSocketHandler, CopilotWebSocketCloseStatus, CopilotWebSocketForwarder, SessionFsSqliteTransactionFailure, SessionFsWriteFailure, SYSTEM_MESSAGE_SECTIONS, } from "./types.js";
21
21
  export type * from "./generated/session-events.js";
22
- 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, AutoModeRecoveryContext, AutoModeSwitchRequest, AutoModeSwitchResponse, AgentStopHandler, AgentStopHookInput, AgentStopHookOutput, SubagentStartHandler, SubagentStartHookInput, SubagentStartHookOutput, SubagentStopHandler, SubagentStopHookInput, SubagentStopHookOutput, UserPromptTransformedHandler, UserPromptTransformedHookInput, UserPromptTransformedHookOutput, CopilotClientInfo, CopilotClientMode, CopilotClientOptions, EntraAuthConfig, EntraAuthOptions, EntraTokenProvider, EntraTokenProviderArgs, EntraTokenProviderResult, InstallationConfirmationHandler, InstallationConfirmationRequest, InstallationConfirmationResponse, InstallationDecision, InstallationReview, McpInstallationReview, CopilotExpAssignmentResponse, StdioRuntimeConnection, InProcessRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationHandlerResult, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExpConfigEntry, ExpFlagValue, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionLaunchProfile, ExtensionLaunchProvider, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, HostDiagnostics, HostErrorReportingStatus, GitHubMcpToolConfig, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTokenProvider, GitHubTokenProviderArgs, GitHubTokenProviderResult, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, MemoryStoreCallOptions, StoredMemory, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, ExtensionContextAttachment, MessageOptions, ResponseSchema, MessageSource, ManagedSettings, ManagedSettingsPermissions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, AutoTier, CapiSessionOptions, CurrentModel, FusionTier, ModelSwitchAutoTierResult, ModelSwitchAutoTierStatus, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, NamedProviderConfig, NetworkAuthenticateBasicRequest, NetworkAuthenticateBasicResult, NetworkAuthenticateNegotiateRequest, NetworkConfig, NetworkResolveProxyRequest, NetworkScope, PermissionHandler, PermissionRequest, PermissionRequestedData, PermissionRequestedEvent, PermissionRequestResult, AttributedPermissionResult, PromptDecisionLabel, PermissionDecisionContext, PermissionDecisionOutcome, PermissionDecisionSource, PermissionDecisionSurface, PermissionResponseCapability, ProviderConfig, ProviderConfigModelProvider, ProviderModelConfig, ProviderTokenArgs, RemoteSessionMode, SandboxConfigSource, ResumeSessionConfig, TranscriptRecovery, SectionOverride, SectionOverrideAction, SectionTransformFn, ShellAuthenticationHandler, ShellAuthenticationRequest, ShellAuthenticationResponse, SessionCapabilities, SessionConfig, SessionConfigBase, WorkingDirectoryTrust, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionHooks, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsByteRange, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SessionFsSqliteStatement, SessionFsSqliteTransactionErrorClass, SkillProvider, SessionCreationHandler, ManagedSessionInfo, SessionManagementCloseRequest, SessionManagementCloseResult, SessionManagementConfigureRequest, SessionManagementCreateHostRequest, SessionManagementCreateRequest, SessionManagementCreateResult, SessionManagementListRequest, SessionManagementListResult, SessionManagementMessageRequest, SessionManagementMessageResult, SessionManagementPolicy, SessionManagementScope, SessionManagementToolOverrides, SkillProviderCallOptions, SkillProviderDescriptor, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, ToolNamespace, CurrentToolMetadata, ToolTelemetry, ToolResultObject, ToolSearchConfig, ImageGenerationConfig, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
22
+ 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, AutoModeRecoveryContext, AutoModeSwitchRequest, AutoModeSwitchResponse, AgentStopHandler, AgentStopHookInput, AgentStopHookOutput, SubagentStartHandler, SubagentStartHookInput, SubagentStartHookOutput, SubagentStopHandler, SubagentStopHookInput, SubagentStopHookOutput, UserPromptTransformedHandler, UserPromptTransformedHookInput, UserPromptTransformedHookOutput, CopilotClientInfo, CopilotClientMode, CopilotClientOptions, EntraAuthConfig, EntraAuthOptions, EntraTokenProvider, EntraTokenProviderArgs, EntraTokenProviderResult, InstallationConfirmationHandler, InstallationConfirmationRequest, InstallationConfirmationResponse, InstallationDecision, InstallationReview, McpInstallationReview, CopilotExpAssignmentResponse, SpawnedStdioRuntimeConnection, InProcessRuntimeConnection, SpawnedTcpRuntimeConnection, TcpRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationHandlerResult, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExpConfigEntry, ExpFlagValue, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionLaunchProfile, ExtensionLaunchProvider, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, HostDiagnostics, HostErrorReportingStatus, GitHubMcpToolConfig, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTokenProvider, GitHubTokenProviderArgs, GitHubTokenProviderResult, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, MemoryStoreCallOptions, StoredMemory, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, ExtensionContextAttachment, MessageOptions, ResponseSchema, MessageSource, ManagedSettings, ManagedSettingsPermissions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, AutoTier, CapiSessionOptions, CurrentModel, FusionTier, ModelSwitchAutoTierResult, ModelSwitchAutoTierStatus, ModelCapabilities, AdaptiveThinkingSupport, ModelCapabilitiesSupports, ModelCapabilitiesLimits, ModelCapabilitiesLimitsVision, ModelPolicyState, ModelBillingPromo, ModelPickerCategory, ModelPickerPriceCategory, ModelMessage, ModelWarningText, ModelCapabilitiesOverride, ModelCapabilitiesOverrideSupports, ModelCapabilitiesOverrideLimits, ModelCapabilitiesOverrideLimitsVision, ModelPolicy, NamedProviderConfig, NetworkAuthenticateBasicRequest, NetworkAuthenticateBasicResult, NetworkAuthenticateNegotiateRequest, NetworkConfig, NetworkResolveProxyRequest, NetworkScope, PermissionHandler, PermissionRequest, PermissionRequestedData, PermissionRequestedEvent, PermissionRequestResult, AttributedPermissionResult, PromptDecisionLabel, PermissionDecisionContext, PermissionDecisionOutcome, PermissionDecisionSource, PermissionDecisionSurface, PermissionResponseCapability, ProviderConfigModelProvider, ProviderModelConfig, ProviderTokenArgs, RemoteSessionMode, SandboxConfigSource, ResumeSessionOptions, TranscriptRecovery, SectionOverride, SectionOverrideAction, SectionTransformFn, ShellAuthenticationHandler, ShellAuthenticationRequest, ShellAuthenticationResponse, SessionCapabilities, CreateSessionOptions, SessionOptionsBase, WorkingDirectoryTrust, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionHooks, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsByteRange, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SessionFsSqliteStatement, SessionFsSqliteTransactionErrorClass, SkillProvider, SessionCreationHandler, ManagedSessionInfo, SessionManagementCloseRequest, SessionManagementCloseResult, SessionManagementConfigureRequest, SessionManagementCreateHostRequest, SessionManagementCreateRequest, SessionManagementCreateResult, SessionManagementListRequest, SessionManagementListResult, SessionManagementMessageRequest, SessionManagementMessageResult, SessionManagementPolicy, SessionManagementScope, SessionManagementToolOverrides, SkillProviderCallOptions, SkillProviderDescriptor, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, ToolNamespace, CurrentToolMetadata, ToolTelemetry, ToolResultObject, ToolSearchConfig, ImageGenerationConfig, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
23
23
  export type { JsonValue, WorkflowRunOptions, WorkflowResumeOptions, WorkflowLimitOverrides, WorkflowResumeErrorCode, SessionWorkflowApi, WorkflowAgentOptions, WorkflowContext, WorkflowDefinition, WorkflowHandle, WorkflowAgentReference, WorkflowJsonSchema, WorkflowLimits, WorkflowMeta, WorkflowPipelineStage, WorkflowStepOptions, WorkflowRunResult, WorkflowRunStatus, WorkflowRunSummary, WorkflowListRunsOptions, WorkflowRunsPage, WorkflowRunDetail, WorkflowProgressPage, WorkflowProgressLine, WorkflowPhaseObservation, WorkflowPhaseStatus, WorkflowAgentContextObservation, WorkflowAgentModelObservation, WorkflowAgentReasoningEffortObservation, WorkflowAgentSummary, } from "./workflow.js";
24
+ export type { ClientPluginOptions, ClientExtensionOptions, ClientInstallationOptions, ClientObservabilityOptions, ClientGitHubOptions, ClientModelOptions, OwnedRuntimeOptions, SessionInferenceOptions, SessionPolicyOptions, SessionExperimentOptions, SessionToolOptions, SessionCanvasOptions, SessionExtensionOptions, SessionInteractionOptions, SessionAgentOptions, SessionSkillOptions, SessionGitHubOptions, SessionFilesystemOptions, SessionExecutionOptions, SessionInstructionOptions, SessionGitOptions, SessionPermissionOptions, SessionMcpOptions, SessionHookOptions, SessionEventOptions, SessionPluginOptions, SessionStateOptions, CreateSessionFilesystemOptions, CreateSessionInstructionOptions, ResumeSessionCanvasOptions, } from "./types.js";
@@ -2,7 +2,7 @@
2
2
  * The SDK protocol version.
3
3
  * This must match the version expected by the Copilot runtime server.
4
4
  */
5
- export declare const SDK_PROTOCOL_VERSION = 3;
5
+ export declare const SDK_PROTOCOL_VERSION = 4;
6
6
  /**
7
7
  * Gets the SDK protocol version.
8
8
  * @returns The protocol version number
@@ -1,4 +1,4 @@
1
- const SDK_PROTOCOL_VERSION = 3;
1
+ const SDK_PROTOCOL_VERSION = 4;
2
2
  function getSdkProtocolVersion() {
3
3
  return SDK_PROTOCOL_VERSION;
4
4
  }
package/dist/session.d.ts CHANGED
@@ -2,7 +2,7 @@ import { createSessionRpc } from "./generated/rpc.js";
2
2
  import type { ModelSwitchAutoTierResult, PermissionsSetModeResult, SessionManagementPolicy } from "./generated/rpc.js";
3
3
  import type { OpenCanvasInstance } from "./generated/rpc.js";
4
4
  import type { TrajectoryJsonValue } from "./generated/rpc.js";
5
- import type { MessageOptions, ResponseSchema, ContextTier, ReasoningEffort, ReasoningSummary, AutoTier, FusionTier, ModelCapabilitiesOverride, SessionCapabilities, SessionConfig, SessionEvent, SessionEventHandler, SessionEventType, SessionUiApi, SessionCreationHandler, TranscriptRecovery, TypedSessionEventHandler } from "./types.js";
5
+ import type { MessageOptions, ResponseSchema, ContextTier, ReasoningEffort, ReasoningSummary, AutoTier, FusionTier, ModelCapabilitiesOverride, SessionCapabilities, CreateSessionOptions, SessionEvent, SessionEventHandler, SessionEventType, SessionUiApi, SessionCreationHandler, TranscriptRecovery, TypedSessionEventHandler } from "./types.js";
6
6
  import { type SessionWorkflowApi } from "./workflow.js";
7
7
  /** Assistant message event - the final response from the assistant. */
8
8
  export type AssistantMessageEvent = Extract<SessionEvent, {
@@ -21,9 +21,9 @@ export type AssistantMessageEvent = Extract<SessionEvent, {
21
21
  *
22
22
  * // Subscribe to events
23
23
  * session.on((event) => {
24
- * if (event.type === "assistant.message") {
25
- * console.log(event.data.content);
26
- * }
24
+ * if (event.type === "assistant.message") {
25
+ * console.log(event.data.content);
26
+ * }
27
27
  * });
28
28
  *
29
29
  * // Send a message and wait for completion
@@ -115,7 +115,7 @@ export declare class CopilotSession {
115
115
  /** Recovery observed while loading this session; undefined on a clean resume. */
116
116
  get transcriptRecovery(): TranscriptRecovery | undefined;
117
117
  /**
118
- * Outcome of the `permissionMode` requested when this session was created
118
+ * Outcome of the `permissions.mode` requested when this session was created
119
119
  * or resumed: whether it was applied, and the authoritative mode the
120
120
  * session started in. Undefined when no mode was requested.
121
121
  */
@@ -500,7 +500,7 @@ export declare class CopilotSession {
500
500
  * ]);
501
501
  * ```
502
502
  */
503
- setTools(tools: NonNullable<SessionConfig["tools"]>): Promise<void>;
503
+ setTools(tools: NonNullable<NonNullable<CreateSessionOptions["tools"]>["definitions"]>): Promise<void>;
504
504
  /**
505
505
  * Log a message to the session timeline.
506
506
  * The message appears in the session event stream and is visible to SDK consumers
package/dist/session.js CHANGED
@@ -512,7 +512,7 @@ class CopilotSession {
512
512
  this._transcriptRecovery = recovery;
513
513
  }
514
514
  /**
515
- * Outcome of the `permissionMode` requested when this session was created
515
+ * Outcome of the `permissions.mode` requested when this session was created
516
516
  * or resumed: whether it was applied, and the authoritative mode the
517
517
  * session started in. Undefined when no mode was requested.
518
518
  */
@@ -1881,7 +1881,7 @@ class CopilotSession {
1881
1881
  /**
1882
1882
  * Sets the open-canvas snapshot for this session.
1883
1883
  *
1884
- * @param instances - The `openCanvases` array from the `session.resume` response.
1884
+ * @param instances - The `canvases.open` array from the `session.resume` response.
1885
1885
  * @internal This method is typically called internally when resuming a session.
1886
1886
  */
1887
1887
  setOpenCanvases(instances) {
package/dist/toolSet.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Builder that produces a list of source-qualified tool filter strings for
3
- * {@link SessionConfigBase.availableTools}.
3
+ * {@link SessionOptionsBase.tools.availableTools}.
4
4
  *
5
5
  * Tools are classified by the runtime at registration time (not from name
6
6
  * parsing), so `addBuiltIn("foo")` matches only tools the runtime registered
@@ -13,10 +13,11 @@
13
13
  * .addBuiltIn(BuiltInTools.Isolated)
14
14
  * .addMcp("*")
15
15
  * .addCustom("*");
16
- *
16
+ * *
17
17
  * const session = await client.createSession({
18
- * availableTools: tools,
19
- * // ...
18
+ * tools: {
19
+ * availableTools: tools
20
+ * }
20
21
  * });
21
22
  * ```
22
23
  */
@@ -51,7 +52,7 @@ export declare class ToolSet {
51
52
  addMcp(toolName: string): ToolSet;
52
53
  /**
53
54
  * Returns a defensive copy of the accumulated filter strings, suitable for
54
- * passing as {@link SessionConfigBase.availableTools}.
55
+ * passing as {@link SessionOptionsBase.tools.availableTools}.
55
56
  */
56
57
  toArray(): string[];
57
58
  }
package/dist/toolSet.js CHANGED
@@ -45,7 +45,7 @@ class ToolSet {
45
45
  }
46
46
  /**
47
47
  * Returns a defensive copy of the accumulated filter strings, suitable for
48
- * passing as {@link SessionConfigBase.availableTools}.
48
+ * passing as {@link SessionOptionsBase.tools.availableTools}.
49
49
  */
50
50
  toArray() {
51
51
  return [...this.items];