@github/copilot-sdk 0.3.0-preview.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,13 @@
3
3
  * Generated from: api.schema.json
4
4
  */
5
5
  import type { MessageConnection } from "vscode-jsonrpc/node.js";
6
+ /**
7
+ * Authentication type
8
+ *
9
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
10
+ * via the `definition` "AuthInfoType".
11
+ */
12
+ export type AuthInfoType = "hmac" | "env" | "user" | "gh-cli" | "api-key" | "token" | "copilot-api-token";
6
13
  /**
7
14
  * Server transport type: stdio, http, sse, or memory (local configs are normalized to stdio)
8
15
  *
@@ -93,7 +100,21 @@ export type McpServerSource = "user" | "workspace" | "plugin" | "builtin";
93
100
  * via the `definition` "SessionMode".
94
101
  */
95
102
  export type SessionMode = "interactive" | "plan" | "autopilot";
96
- export type PermissionDecision = PermissionDecisionApproved | PermissionDecisionDeniedByRules | PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser | PermissionDecisionDeniedInteractivelyByUser | PermissionDecisionDeniedByContentExclusionPolicy | PermissionDecisionDeniedByPermissionRequestHook;
103
+ export type PermissionDecision = PermissionDecisionApproveOnce | PermissionDecisionApproveForSession | PermissionDecisionApproveForLocation | PermissionDecisionReject | PermissionDecisionUserNotAvailable;
104
+ /**
105
+ * The approval to add as a session-scoped rule
106
+ *
107
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
108
+ * via the `definition` "PermissionDecisionApproveForSessionApproval".
109
+ */
110
+ export type PermissionDecisionApproveForSessionApproval = PermissionDecisionApproveForSessionApprovalCommands | PermissionDecisionApproveForSessionApprovalRead | PermissionDecisionApproveForSessionApprovalWrite | PermissionDecisionApproveForSessionApprovalMcp | PermissionDecisionApproveForSessionApprovalMcpSampling | PermissionDecisionApproveForSessionApprovalMemory | PermissionDecisionApproveForSessionApprovalCustomTool;
111
+ /**
112
+ * The approval to persist for this location
113
+ *
114
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
115
+ * via the `definition` "PermissionDecisionApproveForLocationApproval".
116
+ */
117
+ export type PermissionDecisionApproveForLocationApproval = PermissionDecisionApproveForLocationApprovalCommands | PermissionDecisionApproveForLocationApprovalRead | PermissionDecisionApproveForLocationApprovalWrite | PermissionDecisionApproveForLocationApprovalMcp | PermissionDecisionApproveForLocationApprovalMcpSampling | PermissionDecisionApproveForLocationApprovalMemory | PermissionDecisionApproveForLocationApprovalCustomTool;
97
118
  /**
98
119
  * Error classification
99
120
  *
@@ -140,6 +161,12 @@ export type UIElicitationSchemaPropertyNumberType = "number" | "integer";
140
161
  * via the `definition` "UIElicitationResponseAction".
141
162
  */
142
163
  export type UIElicitationResponseAction = "accept" | "decline" | "cancel";
164
+ export interface AccountGetQuotaRequest {
165
+ /**
166
+ * GitHub token for per-user quota lookup. When provided, resolves this token to determine the user's quota instead of using the global auth.
167
+ */
168
+ gitHubToken?: string;
169
+ }
143
170
  export interface AccountGetQuotaResult {
144
171
  /**
145
172
  * Quota snapshots keyed by type (e.g., chat, completions, premium_interactions)
@@ -481,6 +508,18 @@ export interface McpServerConfigHttp {
481
508
  oauthClientId?: string;
482
509
  oauthPublicClient?: boolean;
483
510
  }
511
+ export interface McpConfigDisableRequest {
512
+ /**
513
+ * Names of MCP servers to disable. Each server is added to the persisted disabled list so new sessions skip it. Already-disabled names are ignored. Active sessions keep their current connections until they end.
514
+ */
515
+ names: string[];
516
+ }
517
+ export interface McpConfigEnableRequest {
518
+ /**
519
+ * Names of MCP servers to enable. Each server is removed from the persisted disabled list so new sessions spawn it. Unknown or already-enabled names are ignored.
520
+ */
521
+ names: string[];
522
+ }
484
523
  export interface McpConfigList {
485
524
  /**
486
525
  * All MCP servers from user config, keyed by name
@@ -528,6 +567,32 @@ export interface McpEnableRequest {
528
567
  */
529
568
  serverName: string;
530
569
  }
570
+ /** @experimental */
571
+ export interface McpOauthLoginRequest {
572
+ /**
573
+ * Name of the remote MCP server to authenticate
574
+ */
575
+ serverName: string;
576
+ /**
577
+ * When true, clears any cached OAuth token for the server and runs a full new authorization. Use when the user explicitly wants to switch accounts or believes their session is stuck.
578
+ */
579
+ forceReauth?: boolean;
580
+ /**
581
+ * Optional override for the OAuth client display name shown on the consent screen. Applies to newly registered dynamic clients only — existing registrations keep the name they were created with. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass their own surface-specific label so the consent screen matches the product the user sees.
582
+ */
583
+ clientName?: string;
584
+ /**
585
+ * Optional override for the body text shown on the OAuth loopback callback success page. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass surface-specific copy telling the user where to return.
586
+ */
587
+ callbackSuccessMessage?: string;
588
+ }
589
+ /** @experimental */
590
+ export interface McpOauthLoginResult {
591
+ /**
592
+ * URL the caller should open in a browser to complete OAuth. Omitted when cached tokens were still valid and no browser interaction was needed — the server is already reconnected in that case. When present, the runtime starts the callback listener before returning and continues the flow in the background; completion is signaled via session.mcp_server_status_changed.
593
+ */
594
+ authorizationUrl?: string;
595
+ }
531
596
  export interface McpServer {
532
597
  /**
533
598
  * Server name (config key)
@@ -649,7 +714,7 @@ export interface ModelPolicy {
649
714
  /**
650
715
  * Usage terms or conditions for this model
651
716
  */
652
- terms: string;
717
+ terms?: string;
653
718
  }
654
719
  /**
655
720
  * Billing information
@@ -718,6 +783,12 @@ export interface ModelList {
718
783
  */
719
784
  models: Model[];
720
785
  }
786
+ export interface ModelsListRequest {
787
+ /**
788
+ * GitHub token for per-user model listing. When provided, resolves this token to determine the user's Copilot plan and available models instead of using the global auth.
789
+ */
790
+ gitHubToken?: string;
791
+ }
721
792
  export interface ModelSwitchToRequest {
722
793
  /**
723
794
  * Model identifier to switch to
@@ -750,76 +821,128 @@ export interface NameSetRequest {
750
821
  */
751
822
  name: string;
752
823
  }
753
- export interface PermissionDecisionApproved {
824
+ export interface PermissionDecisionApproveOnce {
754
825
  /**
755
- * The permission request was approved
826
+ * The permission request was approved for this one instance
756
827
  */
757
- kind: "approved";
828
+ kind: "approve-once";
758
829
  }
759
- export interface PermissionDecisionDeniedByRules {
830
+ export interface PermissionDecisionApproveForSession {
760
831
  /**
761
- * Denied because approval rules explicitly blocked it
832
+ * Approved and remembered for the rest of the session
762
833
  */
763
- kind: "denied-by-rules";
834
+ kind: "approve-for-session";
835
+ approval: PermissionDecisionApproveForSessionApproval;
836
+ }
837
+ export interface PermissionDecisionApproveForSessionApprovalCommands {
838
+ kind: "commands";
839
+ commandIdentifiers: string[];
840
+ }
841
+ export interface PermissionDecisionApproveForSessionApprovalRead {
842
+ kind: "read";
843
+ }
844
+ export interface PermissionDecisionApproveForSessionApprovalWrite {
845
+ kind: "write";
846
+ }
847
+ export interface PermissionDecisionApproveForSessionApprovalMcp {
848
+ kind: "mcp";
849
+ serverName: string;
850
+ toolName: string | null;
851
+ }
852
+ export interface PermissionDecisionApproveForSessionApprovalMcpSampling {
853
+ kind: "mcp-sampling";
854
+ serverName: string;
855
+ }
856
+ export interface PermissionDecisionApproveForSessionApprovalMemory {
857
+ kind: "memory";
858
+ }
859
+ export interface PermissionDecisionApproveForSessionApprovalCustomTool {
860
+ kind: "custom-tool";
861
+ toolName: string;
862
+ }
863
+ export interface PermissionDecisionApproveForLocation {
764
864
  /**
765
- * Rules that denied the request
865
+ * Approved and persisted for this project location
766
866
  */
767
- rules: unknown[];
768
- }
769
- export interface PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser {
867
+ kind: "approve-for-location";
868
+ approval: PermissionDecisionApproveForLocationApproval;
770
869
  /**
771
- * Denied because no approval rule matched and user confirmation was unavailable
870
+ * The location key (git root or cwd) to persist the approval to
772
871
  */
773
- kind: "denied-no-approval-rule-and-could-not-request-from-user";
872
+ locationKey: string;
873
+ }
874
+ export interface PermissionDecisionApproveForLocationApprovalCommands {
875
+ kind: "commands";
876
+ commandIdentifiers: string[];
877
+ }
878
+ export interface PermissionDecisionApproveForLocationApprovalRead {
879
+ kind: "read";
880
+ }
881
+ export interface PermissionDecisionApproveForLocationApprovalWrite {
882
+ kind: "write";
883
+ }
884
+ export interface PermissionDecisionApproveForLocationApprovalMcp {
885
+ kind: "mcp";
886
+ serverName: string;
887
+ toolName: string | null;
774
888
  }
775
- export interface PermissionDecisionDeniedInteractivelyByUser {
889
+ export interface PermissionDecisionApproveForLocationApprovalMcpSampling {
890
+ kind: "mcp-sampling";
891
+ serverName: string;
892
+ }
893
+ export interface PermissionDecisionApproveForLocationApprovalMemory {
894
+ kind: "memory";
895
+ }
896
+ export interface PermissionDecisionApproveForLocationApprovalCustomTool {
897
+ kind: "custom-tool";
898
+ toolName: string;
899
+ }
900
+ export interface PermissionDecisionReject {
776
901
  /**
777
902
  * Denied by the user during an interactive prompt
778
903
  */
779
- kind: "denied-interactively-by-user";
904
+ kind: "reject";
780
905
  /**
781
906
  * Optional feedback from the user explaining the denial
782
907
  */
783
908
  feedback?: string;
784
909
  }
785
- export interface PermissionDecisionDeniedByContentExclusionPolicy {
786
- /**
787
- * Denied by the organization's content exclusion policy
788
- */
789
- kind: "denied-by-content-exclusion-policy";
910
+ export interface PermissionDecisionUserNotAvailable {
790
911
  /**
791
- * File path that triggered the exclusion
912
+ * Denied because user confirmation was unavailable
792
913
  */
793
- path: string;
794
- /**
795
- * Human-readable explanation of why the path was excluded
796
- */
797
- message: string;
914
+ kind: "user-not-available";
798
915
  }
799
- export interface PermissionDecisionDeniedByPermissionRequestHook {
916
+ export interface PermissionDecisionRequest {
800
917
  /**
801
- * Denied by a permission request hook registered by an extension or plugin
918
+ * Request ID of the pending permission request
802
919
  */
803
- kind: "denied-by-permission-request-hook";
920
+ requestId: string;
921
+ result: PermissionDecision;
922
+ }
923
+ export interface PermissionRequestResult {
804
924
  /**
805
- * Optional message from the hook explaining the denial
925
+ * Whether the permission request was handled successfully
806
926
  */
807
- message?: string;
927
+ success: boolean;
928
+ }
929
+ export interface PermissionsResetSessionApprovalsRequest {
930
+ }
931
+ export interface PermissionsResetSessionApprovalsResult {
808
932
  /**
809
- * Whether to interrupt the current agent turn
933
+ * Whether the operation succeeded
810
934
  */
811
- interrupt?: boolean;
935
+ success: boolean;
812
936
  }
813
- export interface PermissionDecisionRequest {
937
+ export interface PermissionsSetApproveAllRequest {
814
938
  /**
815
- * Request ID of the pending permission request
939
+ * Whether to auto-approve all tool permission requests
816
940
  */
817
- requestId: string;
818
- result: PermissionDecision;
941
+ enabled: boolean;
819
942
  }
820
- export interface PermissionRequestResult {
943
+ export interface PermissionsSetApproveAllResult {
821
944
  /**
822
- * Whether the permission request was handled successfully
945
+ * Whether the operation succeeded
823
946
  */
824
947
  success: boolean;
825
948
  }
@@ -924,6 +1047,29 @@ export interface ServerSkillList {
924
1047
  */
925
1048
  skills: ServerSkill[];
926
1049
  }
1050
+ export interface SessionAuthStatus {
1051
+ /**
1052
+ * Whether the session has resolved authentication
1053
+ */
1054
+ isAuthenticated: boolean;
1055
+ authType?: AuthInfoType;
1056
+ /**
1057
+ * Authentication host URL
1058
+ */
1059
+ host?: string;
1060
+ /**
1061
+ * Authenticated login/username, if available
1062
+ */
1063
+ login?: string;
1064
+ /**
1065
+ * Human-readable authentication status description
1066
+ */
1067
+ statusMessage?: string;
1068
+ /**
1069
+ * Copilot plan tier (e.g., individual_pro, business)
1070
+ */
1071
+ copilotPlan?: string;
1072
+ }
927
1073
  export interface SessionFsAppendFileRequest {
928
1074
  /**
929
1075
  * Target session identifier
@@ -1622,13 +1768,13 @@ export interface WorkspacesReadFileResult {
1622
1768
  export declare function createServerRpc(connection: MessageConnection): {
1623
1769
  ping: (params: PingRequest) => Promise<PingResult>;
1624
1770
  models: {
1625
- list: () => Promise<ModelList>;
1771
+ list: (params?: ModelsListRequest) => Promise<ModelList>;
1626
1772
  };
1627
1773
  tools: {
1628
1774
  list: (params: ToolsListRequest) => Promise<ToolList>;
1629
1775
  };
1630
1776
  account: {
1631
- getQuota: () => Promise<AccountGetQuotaResult>;
1777
+ getQuota: (params?: AccountGetQuotaRequest) => Promise<AccountGetQuotaResult>;
1632
1778
  };
1633
1779
  mcp: {
1634
1780
  config: {
@@ -1636,6 +1782,8 @@ export declare function createServerRpc(connection: MessageConnection): {
1636
1782
  add: (params: McpConfigAddRequest) => Promise<void>;
1637
1783
  update: (params: McpConfigUpdateRequest) => Promise<void>;
1638
1784
  remove: (params: McpConfigRemoveRequest) => Promise<void>;
1785
+ enable: (params: McpConfigEnableRequest) => Promise<void>;
1786
+ disable: (params: McpConfigDisableRequest) => Promise<void>;
1639
1787
  };
1640
1788
  discover: (params: McpDiscoverRequest) => Promise<McpDiscoverResult>;
1641
1789
  };
@@ -1655,57 +1803,64 @@ export declare function createServerRpc(connection: MessageConnection): {
1655
1803
  };
1656
1804
  /** Create typed session-scoped RPC methods. */
1657
1805
  export declare function createSessionRpc(connection: MessageConnection, sessionId: string): {
1806
+ auth: {
1807
+ getStatus: () => Promise<SessionAuthStatus>;
1808
+ };
1658
1809
  model: {
1659
1810
  getCurrent: () => Promise<CurrentModel>;
1660
- switchTo: (params: Omit<ModelSwitchToRequest, "sessionId">) => Promise<ModelSwitchToResult>;
1811
+ switchTo: (params: ModelSwitchToRequest) => Promise<ModelSwitchToResult>;
1661
1812
  };
1662
1813
  mode: {
1663
1814
  get: () => Promise<SessionMode>;
1664
- set: (params: Omit<ModeSetRequest, "sessionId">) => Promise<void>;
1815
+ set: (params: ModeSetRequest) => Promise<void>;
1665
1816
  };
1666
1817
  name: {
1667
1818
  get: () => Promise<NameGetResult>;
1668
- set: (params: Omit<NameSetRequest, "sessionId">) => Promise<void>;
1819
+ set: (params: NameSetRequest) => Promise<void>;
1669
1820
  };
1670
1821
  plan: {
1671
1822
  read: () => Promise<PlanReadResult>;
1672
- update: (params: Omit<PlanUpdateRequest, "sessionId">) => Promise<void>;
1823
+ update: (params: PlanUpdateRequest) => Promise<void>;
1673
1824
  delete: () => Promise<void>;
1674
1825
  };
1675
1826
  workspaces: {
1676
1827
  getWorkspace: () => Promise<WorkspacesGetWorkspaceResult>;
1677
1828
  listFiles: () => Promise<WorkspacesListFilesResult>;
1678
- readFile: (params: Omit<WorkspacesReadFileRequest, "sessionId">) => Promise<WorkspacesReadFileResult>;
1679
- createFile: (params: Omit<WorkspacesCreateFileRequest, "sessionId">) => Promise<void>;
1829
+ readFile: (params: WorkspacesReadFileRequest) => Promise<WorkspacesReadFileResult>;
1830
+ createFile: (params: WorkspacesCreateFileRequest) => Promise<void>;
1680
1831
  };
1681
1832
  instructions: {
1682
1833
  getSources: () => Promise<InstructionsGetSourcesResult>;
1683
1834
  };
1684
1835
  /** @experimental */
1685
1836
  fleet: {
1686
- start: (params: Omit<FleetStartRequest, "sessionId">) => Promise<FleetStartResult>;
1837
+ start: (params: FleetStartRequest) => Promise<FleetStartResult>;
1687
1838
  };
1688
1839
  /** @experimental */
1689
1840
  agent: {
1690
1841
  list: () => Promise<AgentList>;
1691
1842
  getCurrent: () => Promise<AgentGetCurrentResult>;
1692
- select: (params: Omit<AgentSelectRequest, "sessionId">) => Promise<AgentSelectResult>;
1843
+ select: (params: AgentSelectRequest) => Promise<AgentSelectResult>;
1693
1844
  deselect: () => Promise<void>;
1694
1845
  reload: () => Promise<AgentReloadResult>;
1695
1846
  };
1696
1847
  /** @experimental */
1697
1848
  skills: {
1698
1849
  list: () => Promise<SkillList>;
1699
- enable: (params: Omit<SkillsEnableRequest, "sessionId">) => Promise<void>;
1700
- disable: (params: Omit<SkillsDisableRequest, "sessionId">) => Promise<void>;
1850
+ enable: (params: SkillsEnableRequest) => Promise<void>;
1851
+ disable: (params: SkillsDisableRequest) => Promise<void>;
1701
1852
  reload: () => Promise<void>;
1702
1853
  };
1703
1854
  /** @experimental */
1704
1855
  mcp: {
1705
1856
  list: () => Promise<McpServerList>;
1706
- enable: (params: Omit<McpEnableRequest, "sessionId">) => Promise<void>;
1707
- disable: (params: Omit<McpDisableRequest, "sessionId">) => Promise<void>;
1857
+ enable: (params: McpEnableRequest) => Promise<void>;
1858
+ disable: (params: McpDisableRequest) => Promise<void>;
1708
1859
  reload: () => Promise<void>;
1860
+ /** @experimental */
1861
+ oauth: {
1862
+ login: (params: McpOauthLoginRequest) => Promise<McpOauthLoginResult>;
1863
+ };
1709
1864
  };
1710
1865
  /** @experimental */
1711
1866
  plugins: {
@@ -1714,32 +1869,34 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
1714
1869
  /** @experimental */
1715
1870
  extensions: {
1716
1871
  list: () => Promise<ExtensionList>;
1717
- enable: (params: Omit<ExtensionsEnableRequest, "sessionId">) => Promise<void>;
1718
- disable: (params: Omit<ExtensionsDisableRequest, "sessionId">) => Promise<void>;
1872
+ enable: (params: ExtensionsEnableRequest) => Promise<void>;
1873
+ disable: (params: ExtensionsDisableRequest) => Promise<void>;
1719
1874
  reload: () => Promise<void>;
1720
1875
  };
1721
1876
  tools: {
1722
- handlePendingToolCall: (params: Omit<ToolsHandlePendingToolCallRequest, "sessionId">) => Promise<HandleToolCallResult>;
1877
+ handlePendingToolCall: (params: ToolsHandlePendingToolCallRequest) => Promise<HandleToolCallResult>;
1723
1878
  };
1724
1879
  commands: {
1725
- handlePendingCommand: (params: Omit<CommandsHandlePendingCommandRequest, "sessionId">) => Promise<CommandsHandlePendingCommandResult>;
1880
+ handlePendingCommand: (params: CommandsHandlePendingCommandRequest) => Promise<CommandsHandlePendingCommandResult>;
1726
1881
  };
1727
1882
  ui: {
1728
- elicitation: (params: Omit<UIElicitationRequest, "sessionId">) => Promise<UIElicitationResponse>;
1729
- handlePendingElicitation: (params: Omit<UIHandlePendingElicitationRequest, "sessionId">) => Promise<UIElicitationResult>;
1883
+ elicitation: (params: UIElicitationRequest) => Promise<UIElicitationResponse>;
1884
+ handlePendingElicitation: (params: UIHandlePendingElicitationRequest) => Promise<UIElicitationResult>;
1730
1885
  };
1731
1886
  permissions: {
1732
- handlePendingPermissionRequest: (params: Omit<PermissionDecisionRequest, "sessionId">) => Promise<PermissionRequestResult>;
1887
+ handlePendingPermissionRequest: (params: PermissionDecisionRequest) => Promise<PermissionRequestResult>;
1888
+ setApproveAll: (params: PermissionsSetApproveAllRequest) => Promise<PermissionsSetApproveAllResult>;
1889
+ resetSessionApprovals: () => Promise<PermissionsResetSessionApprovalsResult>;
1733
1890
  };
1734
- log: (params: Omit<LogRequest, "sessionId">) => Promise<LogResult>;
1891
+ log: (params: LogRequest) => Promise<LogResult>;
1735
1892
  shell: {
1736
- exec: (params: Omit<ShellExecRequest, "sessionId">) => Promise<ShellExecResult>;
1737
- kill: (params: Omit<ShellKillRequest, "sessionId">) => Promise<ShellKillResult>;
1893
+ exec: (params: ShellExecRequest) => Promise<ShellExecResult>;
1894
+ kill: (params: ShellKillRequest) => Promise<ShellKillResult>;
1738
1895
  };
1739
1896
  /** @experimental */
1740
1897
  history: {
1741
1898
  compact: () => Promise<HistoryCompactResult>;
1742
- truncate: (params: Omit<HistoryTruncateRequest, "sessionId">) => Promise<HistoryTruncateResult>;
1899
+ truncate: (params: HistoryTruncateRequest) => Promise<HistoryTruncateResult>;
1743
1900
  };
1744
1901
  /** @experimental */
1745
1902
  usage: {
@@ -2,20 +2,22 @@ function createServerRpc(connection) {
2
2
  return {
3
3
  ping: async (params) => connection.sendRequest("ping", params),
4
4
  models: {
5
- list: async () => connection.sendRequest("models.list", {})
5
+ list: async (params) => connection.sendRequest("models.list", params)
6
6
  },
7
7
  tools: {
8
8
  list: async (params) => connection.sendRequest("tools.list", params)
9
9
  },
10
10
  account: {
11
- getQuota: async () => connection.sendRequest("account.getQuota", {})
11
+ getQuota: async (params) => connection.sendRequest("account.getQuota", params)
12
12
  },
13
13
  mcp: {
14
14
  config: {
15
15
  list: async () => connection.sendRequest("mcp.config.list", {}),
16
16
  add: async (params) => connection.sendRequest("mcp.config.add", params),
17
17
  update: async (params) => connection.sendRequest("mcp.config.update", params),
18
- remove: async (params) => connection.sendRequest("mcp.config.remove", params)
18
+ remove: async (params) => connection.sendRequest("mcp.config.remove", params),
19
+ enable: async (params) => connection.sendRequest("mcp.config.enable", params),
20
+ disable: async (params) => connection.sendRequest("mcp.config.disable", params)
19
21
  },
20
22
  discover: async (params) => connection.sendRequest("mcp.discover", params)
21
23
  },
@@ -36,6 +38,9 @@ function createServerRpc(connection) {
36
38
  }
37
39
  function createSessionRpc(connection, sessionId) {
38
40
  return {
41
+ auth: {
42
+ getStatus: async () => connection.sendRequest("session.auth.getStatus", { sessionId })
43
+ },
39
44
  model: {
40
45
  getCurrent: async () => connection.sendRequest("session.model.getCurrent", { sessionId }),
41
46
  switchTo: async (params) => connection.sendRequest("session.model.switchTo", { sessionId, ...params })
@@ -86,7 +91,11 @@ function createSessionRpc(connection, sessionId) {
86
91
  list: async () => connection.sendRequest("session.mcp.list", { sessionId }),
87
92
  enable: async (params) => connection.sendRequest("session.mcp.enable", { sessionId, ...params }),
88
93
  disable: async (params) => connection.sendRequest("session.mcp.disable", { sessionId, ...params }),
89
- reload: async () => connection.sendRequest("session.mcp.reload", { sessionId })
94
+ reload: async () => connection.sendRequest("session.mcp.reload", { sessionId }),
95
+ /** @experimental */
96
+ oauth: {
97
+ login: async (params) => connection.sendRequest("session.mcp.oauth.login", { sessionId, ...params })
98
+ }
90
99
  },
91
100
  /** @experimental */
92
101
  plugins: {
@@ -110,7 +119,9 @@ function createSessionRpc(connection, sessionId) {
110
119
  handlePendingElicitation: async (params) => connection.sendRequest("session.ui.handlePendingElicitation", { sessionId, ...params })
111
120
  },
112
121
  permissions: {
113
- handlePendingPermissionRequest: async (params) => connection.sendRequest("session.permissions.handlePendingPermissionRequest", { sessionId, ...params })
122
+ handlePendingPermissionRequest: async (params) => connection.sendRequest("session.permissions.handlePendingPermissionRequest", { sessionId, ...params }),
123
+ setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", { sessionId, ...params }),
124
+ resetSessionApprovals: async () => connection.sendRequest("session.permissions.resetSessionApprovals", { sessionId })
114
125
  },
115
126
  log: async (params) => connection.sendRequest("session.log", { sessionId, ...params }),
116
127
  shell: {