@github/copilot-sdk 1.0.17-preview.0 → 1.0.17-preview.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +108 -0
- package/dist/canvas.d.ts +6 -1
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +69 -4
- package/dist/cjs/extension.js +2 -0
- package/dist/cjs/generated/rpc.js +577 -251
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/runtimeArtifacts.js +1 -0
- package/dist/cjs/session.js +151 -2
- package/dist/cjs/sessionFsProvider.js +57 -0
- package/dist/cjs/types.js +5 -2
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.d.ts +1 -0
- package/dist/client.js +69 -4
- package/dist/extension.d.ts +1 -1
- package/dist/extension.js +2 -0
- package/dist/generated/rpc.d.ts +2250 -684
- package/dist/generated/rpc.js +577 -251
- package/dist/generated/session-events.d.ts +292 -11
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -0
- package/dist/runtimeArtifacts.js +1 -0
- package/dist/session.d.ts +52 -1
- package/dist/session.js +151 -2
- package/dist/sessionFsProvider.d.ts +9 -1
- package/dist/sessionFsProvider.js +56 -0
- package/dist/types.d.ts +159 -2
- package/dist/types.js +4 -2
- package/docs/agent-author.md +29 -2
- package/package.json +13 -12
package/dist/generated/rpc.js
CHANGED
|
@@ -99,7 +99,48 @@ function createServerRpc(connection) {
|
|
|
99
99
|
*
|
|
100
100
|
* @returns Whether the host running this runtime can run the command sandbox. The runtime checks `supported` once per process. A capability answer can change while the process runs, for example after the user installs a missing package.
|
|
101
101
|
*/
|
|
102
|
-
getHostSupport: async () => connection.sendRequest("sandbox.getHostSupport", {})
|
|
102
|
+
getHostSupport: async () => connection.sendRequest("sandbox.getHostSupport", {}),
|
|
103
|
+
/** @experimental */
|
|
104
|
+
proxyCa: {
|
|
105
|
+
/**
|
|
106
|
+
* Reports whether the persistent certificate authority of the sandbox credential proxy exists, whether OS trust includes it, and whether it must be rotated. Changes nothing.
|
|
107
|
+
*
|
|
108
|
+
* @param params Identifies the credential hosts that the persistent certificate authority of the sandbox credential proxy must cover. The runtime always adds the hosts from the saved user settings.
|
|
109
|
+
*
|
|
110
|
+
* @returns Status of the persistent certificate authority of the sandbox credential proxy.
|
|
111
|
+
*/
|
|
112
|
+
getStatus: async (params) => connection.sendRequest("sandbox.proxyCa.getStatus", params),
|
|
113
|
+
/**
|
|
114
|
+
* Creates the persistent certificate authority of the sandbox credential proxy if none is stored, without changing OS trust, and returns the path of its public certificate. Keeps an existing certificate authority, even one that must be rotated. Fails where OS trust is unsupported. Trust it with sandbox.proxyCa.trust: the CLI trusts only the hosts in the saved user settings, so it refuses a certificate authority that also covers hosts from sandboxConfig.
|
|
115
|
+
*
|
|
116
|
+
* @param params Identifies the credential hosts that the persistent certificate authority of the sandbox credential proxy must cover. The runtime always adds the hosts from the saved user settings.
|
|
117
|
+
*
|
|
118
|
+
* @returns Result of creating the persistent certificate authority of the sandbox credential proxy.
|
|
119
|
+
*/
|
|
120
|
+
create: async (params) => connection.sendRequest("sandbox.proxyCa.create", params),
|
|
121
|
+
/**
|
|
122
|
+
* Replaces the persistent certificate authority of the sandbox credential proxy with a new one for the current credential hosts. If OS trust included the old one, removes it and trusts the new one, which can show an OS authentication prompt. Running sandboxed tools keep the old certificate authority until they restart.
|
|
123
|
+
*
|
|
124
|
+
* @param params Identifies the credential hosts that the persistent certificate authority of the sandbox credential proxy must cover. The runtime always adds the hosts from the saved user settings.
|
|
125
|
+
*
|
|
126
|
+
* @returns Status of the persistent certificate authority of the sandbox credential proxy.
|
|
127
|
+
*/
|
|
128
|
+
rotate: async (params) => connection.sendRequest("sandbox.proxyCa.rotate", params),
|
|
129
|
+
/**
|
|
130
|
+
* Adds the persistent certificate authority of the sandbox credential proxy to OS trust, so sandboxed clients that read only OS trust accept the proxy. Call create first. Refuses a certificate authority that is not constrained to the current credential hosts. Can show an OS authentication prompt.
|
|
131
|
+
*
|
|
132
|
+
* @param params Identifies the credential hosts that the persistent certificate authority of the sandbox credential proxy must cover. The runtime always adds the hosts from the saved user settings.
|
|
133
|
+
*
|
|
134
|
+
* @returns Status of the persistent certificate authority of the sandbox credential proxy.
|
|
135
|
+
*/
|
|
136
|
+
trust: async (params) => connection.sendRequest("sandbox.proxyCa.trust", params),
|
|
137
|
+
/**
|
|
138
|
+
* Removes the persistent certificate authority of the sandbox credential proxy from OS trust. Keeps the stored certificate authority. Can show an OS authentication prompt. Sandboxed clients that read only OS trust then reject the proxy; clients that read the per-process certificate bundle continue to work.
|
|
139
|
+
*
|
|
140
|
+
* @returns Status of the persistent certificate authority of the sandbox credential proxy.
|
|
141
|
+
*/
|
|
142
|
+
remove: async () => connection.sendRequest("sandbox.proxyCa.remove", {})
|
|
143
|
+
}
|
|
103
144
|
},
|
|
104
145
|
/** @experimental */
|
|
105
146
|
tools: {
|
|
@@ -597,21 +638,15 @@ function createServerRpc(connection) {
|
|
|
597
638
|
/** @experimental */
|
|
598
639
|
settings: {
|
|
599
640
|
/**
|
|
600
|
-
*
|
|
601
|
-
*/
|
|
602
|
-
reload: async () => connection.sendRequest("user.settings.reload", {}),
|
|
603
|
-
/**
|
|
604
|
-
* 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.
|
|
605
642
|
*
|
|
606
|
-
* @returns Per-key metadata for every known user setting
|
|
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.
|
|
607
644
|
*/
|
|
608
645
|
get: async () => connection.sendRequest("user.settings.get", {}),
|
|
609
646
|
/**
|
|
610
|
-
* Writes one or more user settings to settings.json, replacing each provided top-level key. A key whose value is null 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.
|
|
611
648
|
*
|
|
612
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.
|
|
613
|
-
*
|
|
614
|
-
* @returns Outcome of writing user settings.
|
|
615
650
|
*/
|
|
616
651
|
set: async (params) => connection.sendRequest("user.settings.set", params)
|
|
617
652
|
}
|
|
@@ -911,6 +946,37 @@ function createServerRpc(connection) {
|
|
|
911
946
|
* @returns Outcome of an agentRegistry.spawn call.
|
|
912
947
|
*/
|
|
913
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)
|
|
914
980
|
}
|
|
915
981
|
};
|
|
916
982
|
}
|
|
@@ -966,6 +1032,133 @@ function createInternalServerRpc(connection) {
|
|
|
966
1032
|
*/
|
|
967
1033
|
connect: async (params) => connection.sendRequest("connect", params),
|
|
968
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 */
|
|
969
1162
|
sessions: {
|
|
970
1163
|
/**
|
|
971
1164
|
* Reads lightweight persisted metadata for one local session without opening it.
|
|
@@ -1005,6 +1198,30 @@ function createInternalServerRpc(connection) {
|
|
|
1005
1198
|
* @param params Session ID to delete from disk.
|
|
1006
1199
|
*/
|
|
1007
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),
|
|
1008
1225
|
/**
|
|
1009
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.
|
|
1010
1227
|
*
|
|
@@ -1019,22 +1236,55 @@ function createInternalServerRpc(connection) {
|
|
|
1019
1236
|
* @param params Params to attach or detach an in-process ExtensionController delegate.
|
|
1020
1237
|
*/
|
|
1021
1238
|
configureSessionExtensions: async (params) => connection.sendRequest("sessions.configureSessionExtensions", params)
|
|
1022
|
-
},
|
|
1023
|
-
/** @experimental */
|
|
1024
|
-
accounts: {
|
|
1025
|
-
/**
|
|
1026
|
-
* Acquire a Microsoft Entra access token through the runtime's OneAuth broker. Account-scoped because it uses the same native broker as the account stack: a trusted host application mints a scoped Entra token for its own use, most notably to authenticate to a remote MCP server whose authorization server is Entra ID (in place of the generic browser-OAuth flow).
|
|
1027
|
-
*
|
|
1028
|
-
* @param params OneAuth token request supplied by a trusted host application.
|
|
1029
|
-
*
|
|
1030
|
-
* @returns Result of a OneAuth token acquisition.
|
|
1031
|
-
*/
|
|
1032
|
-
acquireEntraToken: async (params) => connection.sendRequest("accounts.acquireEntraToken", params)
|
|
1033
1239
|
}
|
|
1034
1240
|
};
|
|
1035
1241
|
}
|
|
1036
1242
|
function createSessionRpc(connection, sessionId) {
|
|
1037
1243
|
return {
|
|
1244
|
+
/** @experimental */
|
|
1245
|
+
providers: {
|
|
1246
|
+
/**
|
|
1247
|
+
* Returns adapter definitions and supported operations in this session's effective provider catalog, without running discovery. Does not list provider instances or select inference models.
|
|
1248
|
+
*
|
|
1249
|
+
* @returns Normalized model-provider adapter definitions available to the session, not discovered instances.
|
|
1250
|
+
*/
|
|
1251
|
+
getCatalog: async () => connection.sendRequest("session.providers.getCatalog", { sessionId }),
|
|
1252
|
+
/**
|
|
1253
|
+
* Discovers reachable instances using an adapter from this session's effective provider catalog and provider-specific discovery input.
|
|
1254
|
+
*
|
|
1255
|
+
* @param params Provider discovery parameters.
|
|
1256
|
+
*
|
|
1257
|
+
* @returns Provider instances found by a discovery operation.
|
|
1258
|
+
*/
|
|
1259
|
+
discover: async (params) => connection.sendRequest("session.providers.discover", { ...params, sessionId }),
|
|
1260
|
+
/**
|
|
1261
|
+
* Gets current health and version information for a discovered model-provider instance.
|
|
1262
|
+
*
|
|
1263
|
+
* @param params Provider status request parameters.
|
|
1264
|
+
*
|
|
1265
|
+
* @returns Current health information for a provider instance.
|
|
1266
|
+
*/
|
|
1267
|
+
getStatus: async (params) => connection.sendRequest("session.providers.getStatus", { ...params, sessionId }),
|
|
1268
|
+
/** @experimental */
|
|
1269
|
+
models: {
|
|
1270
|
+
/**
|
|
1271
|
+
* Lists models installed or otherwise available from a discovered model-provider instance.
|
|
1272
|
+
*
|
|
1273
|
+
* @param params Provider model inventory request parameters.
|
|
1274
|
+
*
|
|
1275
|
+
* @returns Models offered for agent conversations by one provider instance. Adapters exclude known-incompatible models, but retain candidates with unknown capabilities. Listing does not guarantee compatibility.
|
|
1276
|
+
*/
|
|
1277
|
+
list: async (params) => connection.sendRequest("session.providers.models.list", { ...params, sessionId }),
|
|
1278
|
+
/**
|
|
1279
|
+
* Translates a discovered model into the provider and model configuration needed to use it, and reports whether each is already registered in this session. Prepares only: it registers nothing, writes nothing, and performs no provider requests.
|
|
1280
|
+
*
|
|
1281
|
+
* @param params A discovered instance and one of its models to translate into provider configuration. Pass back the instance and model as returned by `session.providers.discover` and `session.providers.models.list`.
|
|
1282
|
+
*
|
|
1283
|
+
* @returns Provider configuration prepared from a discovered model. Preparing a plan changes nothing: it neither registers the model with the session nor writes durable configuration. To apply it, pass `provider` and `model` to `session.provider.add`, omitting whichever the dispositions report as already configured.
|
|
1284
|
+
*/
|
|
1285
|
+
prepareConfiguration: async (params) => connection.sendRequest("session.providers.models.prepareConfiguration", { ...params, sessionId })
|
|
1286
|
+
}
|
|
1287
|
+
},
|
|
1038
1288
|
/**
|
|
1039
1289
|
* Suspends the session while preserving persisted state for later resume.
|
|
1040
1290
|
*
|
|
@@ -1050,7 +1300,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1050
1300
|
*
|
|
1051
1301
|
* @experimental
|
|
1052
1302
|
*/
|
|
1053
|
-
send: async (params) => connection.sendRequest("session.send", {
|
|
1303
|
+
send: async (params) => connection.sendRequest("session.send", { ...params, sessionId }),
|
|
1054
1304
|
/**
|
|
1055
1305
|
* Sends zero or more user messages to the session in a single turn and returns their message IDs. All provided messages are appended to the conversation in order, then exactly one agent turn runs over the resulting history. When the list is empty, one turn runs over the existing history with no new user message. Remote-backed (Mission Control) sessions do not support this method and will return an error.
|
|
1056
1306
|
*
|
|
@@ -1060,7 +1310,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1060
1310
|
*
|
|
1061
1311
|
* @experimental
|
|
1062
1312
|
*/
|
|
1063
|
-
sendMessages: async (params) => connection.sendRequest("session.sendMessages", {
|
|
1313
|
+
sendMessages: async (params) => connection.sendRequest("session.sendMessages", { ...params, sessionId }),
|
|
1064
1314
|
/** @experimental */
|
|
1065
1315
|
sandbox: {
|
|
1066
1316
|
/**
|
|
@@ -1076,7 +1326,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1076
1326
|
*
|
|
1077
1327
|
* @returns Result of attempting to disable sandboxing for the current session.
|
|
1078
1328
|
*/
|
|
1079
|
-
disableForSession: async (params) => connection.sendRequest("session.sandbox.disableForSession", {
|
|
1329
|
+
disableForSession: async (params) => connection.sendRequest("session.sandbox.disableForSession", { ...params, sessionId }),
|
|
1080
1330
|
/**
|
|
1081
1331
|
* Adds the path offered by a pending sandbox escalation permission request's sandboxPathGrant to the session's sandbox policy and approves the request, so the blocked operation re-runs inside the sandbox rather than outside it. The request is rejected unless the exact request is still pending, carries a sandboxPathGrant, and the grant still takes effect under the current managed policy. Does not persist the path; hosts that store sandbox settings save it themselves.
|
|
1082
1332
|
*
|
|
@@ -1084,7 +1334,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1084
1334
|
*
|
|
1085
1335
|
* @returns Result of accepting a sandbox path grant.
|
|
1086
1336
|
*/
|
|
1087
|
-
grantPathForRequest: async (params) => connection.sendRequest("session.sandbox.grantPathForRequest", {
|
|
1337
|
+
grantPathForRequest: async (params) => connection.sendRequest("session.sandbox.grantPathForRequest", { ...params, sessionId })
|
|
1088
1338
|
},
|
|
1089
1339
|
/**
|
|
1090
1340
|
* Aborts the current agent turn.
|
|
@@ -1095,7 +1345,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1095
1345
|
*
|
|
1096
1346
|
* @experimental
|
|
1097
1347
|
*/
|
|
1098
|
-
abort: async (params) => connection.sendRequest("session.abort", {
|
|
1348
|
+
abort: async (params) => connection.sendRequest("session.abort", { ...params, sessionId }),
|
|
1099
1349
|
/**
|
|
1100
1350
|
* Interrupts the current main agent turn while leaving running background work (subagents, sidekicks, and promoted attached shells) alive. No-op when the main loop is not processing.
|
|
1101
1351
|
*
|
|
@@ -1105,7 +1355,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1105
1355
|
*
|
|
1106
1356
|
* @experimental
|
|
1107
1357
|
*/
|
|
1108
|
-
interruptMainTurn: async (params) => connection.sendRequest("session.interruptMainTurn", {
|
|
1358
|
+
interruptMainTurn: async (params) => connection.sendRequest("session.interruptMainTurn", { ...params, sessionId }),
|
|
1109
1359
|
/**
|
|
1110
1360
|
* Cancels every running background agent (task-registry subagents plus sidekick agents) without interrupting the main agent loop. Promoted attached shells are left running.
|
|
1111
1361
|
*
|
|
@@ -1121,7 +1371,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1121
1371
|
*
|
|
1122
1372
|
* @experimental
|
|
1123
1373
|
*/
|
|
1124
|
-
shutdown: async (params) => connection.sendRequest("session.shutdown", {
|
|
1374
|
+
shutdown: async (params) => connection.sendRequest("session.shutdown", { ...params, sessionId }),
|
|
1125
1375
|
/** @experimental */
|
|
1126
1376
|
gitHubAuth: {
|
|
1127
1377
|
/**
|
|
@@ -1137,7 +1387,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1137
1387
|
*
|
|
1138
1388
|
* @returns Indicates whether the credential update succeeded.
|
|
1139
1389
|
*/
|
|
1140
|
-
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", {
|
|
1390
|
+
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", { ...params, sessionId })
|
|
1141
1391
|
},
|
|
1142
1392
|
/** @experimental */
|
|
1143
1393
|
accounts: {
|
|
@@ -1148,7 +1398,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1148
1398
|
*
|
|
1149
1399
|
* @returns The enumerated collection, keyed by the same selector as the query.
|
|
1150
1400
|
*/
|
|
1151
|
-
enumerate: async (params) => connection.sendRequest("session.accounts.enumerate", {
|
|
1401
|
+
enumerate: async (params) => connection.sendRequest("session.accounts.enumerate", { ...params, sessionId }),
|
|
1152
1402
|
/**
|
|
1153
1403
|
* Read one typed accounts datum: the active account, a neutral status summary, or the last authentication errors.
|
|
1154
1404
|
*
|
|
@@ -1156,7 +1406,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1156
1406
|
*
|
|
1157
1407
|
* @returns The read result, keyed by the same selector as the query.
|
|
1158
1408
|
*/
|
|
1159
|
-
get: async (params) => connection.sendRequest("session.accounts.get", {
|
|
1409
|
+
get: async (params) => connection.sendRequest("session.accounts.get", { ...params, sessionId }),
|
|
1160
1410
|
/**
|
|
1161
1411
|
* Apply one non-interactive accounts mutation: switch the active account, log an account out, or set credentials from a token.
|
|
1162
1412
|
*
|
|
@@ -1164,7 +1414,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1164
1414
|
*
|
|
1165
1415
|
* @returns Result of a non-interactive accounts mutation.
|
|
1166
1416
|
*/
|
|
1167
|
-
set: async (params) => connection.sendRequest("session.accounts.set", {
|
|
1417
|
+
set: async (params) => connection.sendRequest("session.accounts.set", { ...params, sessionId }),
|
|
1168
1418
|
/** @experimental */
|
|
1169
1419
|
login: {
|
|
1170
1420
|
/**
|
|
@@ -1174,7 +1424,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1174
1424
|
*
|
|
1175
1425
|
* @returns A started login flow: its opaque id and first step.
|
|
1176
1426
|
*/
|
|
1177
|
-
begin: async (params) => connection.sendRequest("session.accounts.login.begin", {
|
|
1427
|
+
begin: async (params) => connection.sendRequest("session.accounts.login.begin", { ...params, sessionId }),
|
|
1178
1428
|
/**
|
|
1179
1429
|
* Advance an in-flight login flow, optionally fulfilling an input-required step, and return the next step.
|
|
1180
1430
|
*
|
|
@@ -1182,13 +1432,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1182
1432
|
*
|
|
1183
1433
|
* @returns One step in an interactive login flow. The consumer acts on the step and calls advance to proceed. Browser-open is encoded as two distinct steps by design: `open-url` is CONSUMER-driven (the provider surfaces the authorize URL and the consumer opens it — github.com/GHEC web), while `needs-interaction` is PROVIDER-driven (the provider opens the browser or broker UI itself and does not surface a URL — Entra).
|
|
1184
1434
|
*/
|
|
1185
|
-
advance: async (params) => connection.sendRequest("session.accounts.login.advance", {
|
|
1435
|
+
advance: async (params) => connection.sendRequest("session.accounts.login.advance", { ...params, sessionId }),
|
|
1186
1436
|
/**
|
|
1187
1437
|
* Cancel an in-flight login flow and release its resources.
|
|
1188
1438
|
*
|
|
1189
1439
|
* @param params Cancel an in-flight login flow.
|
|
1190
1440
|
*/
|
|
1191
|
-
cancel: async (params) => connection.sendRequest("session.accounts.login.cancel", {
|
|
1441
|
+
cancel: async (params) => connection.sendRequest("session.accounts.login.cancel", { ...params, sessionId })
|
|
1192
1442
|
}
|
|
1193
1443
|
},
|
|
1194
1444
|
/** @experimental */
|
|
@@ -1200,7 +1450,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1200
1450
|
*
|
|
1201
1451
|
* @returns Result of collecting a session debug bundle.
|
|
1202
1452
|
*/
|
|
1203
|
-
collectLogs: async (params) => connection.sendRequest("session.debug.collectLogs", {
|
|
1453
|
+
collectLogs: async (params) => connection.sendRequest("session.debug.collectLogs", { ...params, sessionId })
|
|
1204
1454
|
},
|
|
1205
1455
|
/** @experimental */
|
|
1206
1456
|
canvas: {
|
|
@@ -1223,13 +1473,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1223
1473
|
*
|
|
1224
1474
|
* @returns Open canvas instance snapshot.
|
|
1225
1475
|
*/
|
|
1226
|
-
open: async (params) => connection.sendRequest("session.canvas.open", {
|
|
1476
|
+
open: async (params) => connection.sendRequest("session.canvas.open", { ...params, sessionId }),
|
|
1227
1477
|
/**
|
|
1228
1478
|
* Closes an open canvas instance.
|
|
1229
1479
|
*
|
|
1230
1480
|
* @param params Canvas close parameters.
|
|
1231
1481
|
*/
|
|
1232
|
-
close: async (params) => connection.sendRequest("session.canvas.close", {
|
|
1482
|
+
close: async (params) => connection.sendRequest("session.canvas.close", { ...params, sessionId }),
|
|
1233
1483
|
/** @experimental */
|
|
1234
1484
|
action: {
|
|
1235
1485
|
/**
|
|
@@ -1239,7 +1489,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1239
1489
|
*
|
|
1240
1490
|
* @returns Canvas action invocation result.
|
|
1241
1491
|
*/
|
|
1242
|
-
invoke: async (params) => connection.sendRequest("session.canvas.action.invoke", {
|
|
1492
|
+
invoke: async (params) => connection.sendRequest("session.canvas.action.invoke", { ...params, sessionId })
|
|
1243
1493
|
}
|
|
1244
1494
|
},
|
|
1245
1495
|
/** @experimental */
|
|
@@ -1251,7 +1501,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1251
1501
|
*
|
|
1252
1502
|
* @returns Complete current or terminal workflow run envelope.
|
|
1253
1503
|
*/
|
|
1254
|
-
run: async (params) => connection.sendRequest("session.workflow.run", {
|
|
1504
|
+
run: async (params) => connection.sendRequest("session.workflow.run", { ...params, sessionId }),
|
|
1255
1505
|
/**
|
|
1256
1506
|
* Resumes a dynamic workflow run using its persisted name, arguments, journal, and accounting.
|
|
1257
1507
|
*
|
|
@@ -1259,7 +1509,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1259
1509
|
*
|
|
1260
1510
|
* @returns Resolved persisted workflow identity and resumed run envelope.
|
|
1261
1511
|
*/
|
|
1262
|
-
resume: async (params) => connection.sendRequest("session.workflow.resume", {
|
|
1512
|
+
resume: async (params) => connection.sendRequest("session.workflow.resume", { ...params, sessionId }),
|
|
1263
1513
|
/**
|
|
1264
1514
|
* Gets the current or settled envelope for a dynamic workflow run.
|
|
1265
1515
|
*
|
|
@@ -1267,7 +1517,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1267
1517
|
*
|
|
1268
1518
|
* @returns Complete current or terminal workflow run envelope.
|
|
1269
1519
|
*/
|
|
1270
|
-
getRun: async (params) => connection.sendRequest("session.workflow.getRun", {
|
|
1520
|
+
getRun: async (params) => connection.sendRequest("session.workflow.getRun", { ...params, sessionId }),
|
|
1271
1521
|
/**
|
|
1272
1522
|
* Lists durable dynamic workflow runs for this session in creation order.
|
|
1273
1523
|
*
|
|
@@ -1275,7 +1525,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1275
1525
|
*
|
|
1276
1526
|
* @returns A page of workflow runs in durable creation order.
|
|
1277
1527
|
*/
|
|
1278
|
-
listRuns: async (params) => connection.sendRequest("session.workflow.listRuns", {
|
|
1528
|
+
listRuns: async (params) => connection.sendRequest("session.workflow.listRuns", { ...params, sessionId }),
|
|
1279
1529
|
/**
|
|
1280
1530
|
* Gets durable and live observability detail for one dynamic workflow run.
|
|
1281
1531
|
*
|
|
@@ -1283,7 +1533,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1283
1533
|
*
|
|
1284
1534
|
* @returns Full workflow run observability detail.
|
|
1285
1535
|
*/
|
|
1286
|
-
getRunDetail: async (params) => connection.sendRequest("session.workflow.getRunDetail", {
|
|
1536
|
+
getRunDetail: async (params) => connection.sendRequest("session.workflow.getRunDetail", { ...params, sessionId }),
|
|
1287
1537
|
/**
|
|
1288
1538
|
* Pages durable progress for one dynamic workflow run.
|
|
1289
1539
|
*
|
|
@@ -1291,7 +1541,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1291
1541
|
*
|
|
1292
1542
|
* @returns A bidirectional page of workflow progress.
|
|
1293
1543
|
*/
|
|
1294
|
-
getRunProgress: async (params) => connection.sendRequest("session.workflow.getRunProgress", {
|
|
1544
|
+
getRunProgress: async (params) => connection.sendRequest("session.workflow.getRunProgress", { ...params, sessionId }),
|
|
1295
1545
|
/**
|
|
1296
1546
|
* Requests cancellation of a dynamic workflow run and returns its run envelope.
|
|
1297
1547
|
*
|
|
@@ -1299,7 +1549,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1299
1549
|
*
|
|
1300
1550
|
* @returns Complete current or terminal workflow run envelope.
|
|
1301
1551
|
*/
|
|
1302
|
-
cancel: async (params) => connection.sendRequest("session.workflow.cancel", {
|
|
1552
|
+
cancel: async (params) => connection.sendRequest("session.workflow.cancel", { ...params, sessionId }),
|
|
1303
1553
|
/**
|
|
1304
1554
|
* Pauses a running dynamic workflow and returns its settled run envelope.
|
|
1305
1555
|
*
|
|
@@ -1307,7 +1557,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1307
1557
|
*
|
|
1308
1558
|
* @returns Complete current or terminal workflow run envelope.
|
|
1309
1559
|
*/
|
|
1310
|
-
pause: async (params) => connection.sendRequest("session.workflow.pause", {
|
|
1560
|
+
pause: async (params) => connection.sendRequest("session.workflow.pause", { ...params, sessionId }),
|
|
1311
1561
|
/**
|
|
1312
1562
|
* Records a batch of ordered dynamic workflow progress lines.
|
|
1313
1563
|
*
|
|
@@ -1315,7 +1565,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1315
1565
|
*
|
|
1316
1566
|
* @returns Acknowledgement that a workflow request was accepted.
|
|
1317
1567
|
*/
|
|
1318
|
-
log: async (params) => connection.sendRequest("session.workflow.log", {
|
|
1568
|
+
log: async (params) => connection.sendRequest("session.workflow.log", { ...params, sessionId }),
|
|
1319
1569
|
/**
|
|
1320
1570
|
* Runs one dynamic-workflow-scoped subagent and returns its result.
|
|
1321
1571
|
*
|
|
@@ -1323,7 +1573,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1323
1573
|
*
|
|
1324
1574
|
* @returns Result of one workflow-scoped subagent call.
|
|
1325
1575
|
*/
|
|
1326
|
-
agent: async (params) => connection.sendRequest("session.workflow.agent", {
|
|
1576
|
+
agent: async (params) => connection.sendRequest("session.workflow.agent", { ...params, sessionId }),
|
|
1327
1577
|
/** @experimental */
|
|
1328
1578
|
journal: {
|
|
1329
1579
|
/**
|
|
@@ -1333,7 +1583,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1333
1583
|
*
|
|
1334
1584
|
* @returns Result of reading a workflow journal entry.
|
|
1335
1585
|
*/
|
|
1336
|
-
get: async (params) => connection.sendRequest("session.workflow.journal.get", {
|
|
1586
|
+
get: async (params) => connection.sendRequest("session.workflow.journal.get", { ...params, sessionId }),
|
|
1337
1587
|
/**
|
|
1338
1588
|
* Stores a memoized dynamic workflow journal entry.
|
|
1339
1589
|
*
|
|
@@ -1341,7 +1591,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1341
1591
|
*
|
|
1342
1592
|
* @returns Acknowledgement that a workflow request was accepted.
|
|
1343
1593
|
*/
|
|
1344
|
-
put: async (params) => connection.sendRequest("session.workflow.journal.put", {
|
|
1594
|
+
put: async (params) => connection.sendRequest("session.workflow.journal.put", { ...params, sessionId })
|
|
1345
1595
|
}
|
|
1346
1596
|
},
|
|
1347
1597
|
/** @experimental */
|
|
@@ -1359,7 +1609,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1359
1609
|
*
|
|
1360
1610
|
* @returns The model identifier active on the session after the switch.
|
|
1361
1611
|
*/
|
|
1362
|
-
switchTo: async (params) => connection.sendRequest("session.model.switchTo", {
|
|
1612
|
+
switchTo: async (params) => connection.sendRequest("session.model.switchTo", { ...params, sessionId }),
|
|
1363
1613
|
/**
|
|
1364
1614
|
* Requests an Auto preference change without changing the session's selected model. The latest unclaimed request wins; the runtime commits it only after a later prompt using the `auto` model mints a usable model and token pair. A `pending` response confirms that the request was accepted, not that it committed. Observe eventual success through `session.model_change`, failure through the ephemeral `session.auto_tier_switch_failed` event, or current unclaimed state through `session.model.getCurrent`.
|
|
1365
1615
|
*
|
|
@@ -1367,7 +1617,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1367
1617
|
*
|
|
1368
1618
|
* @returns Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed.
|
|
1369
1619
|
*/
|
|
1370
|
-
switchAutoTier: async (params) => connection.sendRequest("session.model.switchAutoTier", {
|
|
1620
|
+
switchAutoTier: async (params) => connection.sendRequest("session.model.switchAutoTier", { ...params, sessionId }),
|
|
1371
1621
|
/**
|
|
1372
1622
|
* Replaces or clears the host-supplied model allowlist for a running session.
|
|
1373
1623
|
*
|
|
@@ -1375,7 +1625,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1375
1625
|
*
|
|
1376
1626
|
* @returns The applied host allowlist and effective session model policy after intersection.
|
|
1377
1627
|
*/
|
|
1378
|
-
setAllowedModels: async (params) => connection.sendRequest("session.model.setAllowedModels", {
|
|
1628
|
+
setAllowedModels: async (params) => connection.sendRequest("session.model.setAllowedModels", { ...params, sessionId }),
|
|
1379
1629
|
/**
|
|
1380
1630
|
* Updates the session's reasoning effort without changing the selected model.
|
|
1381
1631
|
*
|
|
@@ -1383,7 +1633,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1383
1633
|
*
|
|
1384
1634
|
* @returns Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns.
|
|
1385
1635
|
*/
|
|
1386
|
-
setReasoningEffort: async (params) => connection.sendRequest("session.model.setReasoningEffort", {
|
|
1636
|
+
setReasoningEffort: async (params) => connection.sendRequest("session.model.setReasoningEffort", { ...params, sessionId }),
|
|
1387
1637
|
/**
|
|
1388
1638
|
* Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's.
|
|
1389
1639
|
*
|
|
@@ -1391,7 +1641,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1391
1641
|
*
|
|
1392
1642
|
* @returns The list of models available to this session.
|
|
1393
1643
|
*/
|
|
1394
|
-
list: async (params) => connection.sendRequest("session.model.list", {
|
|
1644
|
+
list: async (params) => connection.sendRequest("session.model.list", { ...params, sessionId })
|
|
1395
1645
|
},
|
|
1396
1646
|
/** @experimental */
|
|
1397
1647
|
mode: {
|
|
@@ -1408,7 +1658,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1408
1658
|
*
|
|
1409
1659
|
* @returns Outcome of a session mode change, including any model switch it triggered and follow-up the host must perform.
|
|
1410
1660
|
*/
|
|
1411
|
-
set: async (params) => connection.sendRequest("session.mode.set", {
|
|
1661
|
+
set: async (params) => connection.sendRequest("session.mode.set", { ...params, sessionId })
|
|
1412
1662
|
},
|
|
1413
1663
|
/** @experimental */
|
|
1414
1664
|
name: {
|
|
@@ -1423,7 +1673,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1423
1673
|
*
|
|
1424
1674
|
* @param params New friendly name to apply to the session.
|
|
1425
1675
|
*/
|
|
1426
|
-
set: async (params) => connection.sendRequest("session.name.set", {
|
|
1676
|
+
set: async (params) => connection.sendRequest("session.name.set", { ...params, sessionId }),
|
|
1427
1677
|
/**
|
|
1428
1678
|
* Persists an auto-generated session summary as the session's name when no user-set name exists.
|
|
1429
1679
|
*
|
|
@@ -1431,7 +1681,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1431
1681
|
*
|
|
1432
1682
|
* @returns Indicates whether the auto-generated summary was applied as the session's name.
|
|
1433
1683
|
*/
|
|
1434
|
-
setAuto: async (params) => connection.sendRequest("session.name.setAuto", {
|
|
1684
|
+
setAuto: async (params) => connection.sendRequest("session.name.setAuto", { ...params, sessionId })
|
|
1435
1685
|
},
|
|
1436
1686
|
/** @experimental */
|
|
1437
1687
|
plan: {
|
|
@@ -1446,7 +1696,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1446
1696
|
*
|
|
1447
1697
|
* @param params Replacement contents to write to the session plan file.
|
|
1448
1698
|
*/
|
|
1449
|
-
update: async (params) => connection.sendRequest("session.plan.update", {
|
|
1699
|
+
update: async (params) => connection.sendRequest("session.plan.update", { ...params, sessionId }),
|
|
1450
1700
|
/**
|
|
1451
1701
|
* Deletes the session plan file from the workspace.
|
|
1452
1702
|
*/
|
|
@@ -1479,7 +1729,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1479
1729
|
*
|
|
1480
1730
|
* @returns Current workspace metadata for the session, including its absolute filesystem path when available.
|
|
1481
1731
|
*/
|
|
1482
|
-
updateMetadata: async (params) => connection.sendRequest("session.workspaces.updateMetadata", {
|
|
1732
|
+
updateMetadata: async (params) => connection.sendRequest("session.workspaces.updateMetadata", { ...params, sessionId }),
|
|
1483
1733
|
/**
|
|
1484
1734
|
* Ensures a local session workspace exists and returns it.
|
|
1485
1735
|
*
|
|
@@ -1487,7 +1737,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1487
1737
|
*
|
|
1488
1738
|
* @returns Current workspace metadata for the session, including its absolute filesystem path when available.
|
|
1489
1739
|
*/
|
|
1490
|
-
ensure: async (params) => connection.sendRequest("session.workspaces.ensure", {
|
|
1740
|
+
ensure: async (params) => connection.sendRequest("session.workspaces.ensure", { ...params, sessionId }),
|
|
1491
1741
|
/**
|
|
1492
1742
|
* Lists files stored in the session workspace files directory.
|
|
1493
1743
|
*
|
|
@@ -1501,13 +1751,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1501
1751
|
*
|
|
1502
1752
|
* @returns Contents of the requested workspace file as a UTF-8 string.
|
|
1503
1753
|
*/
|
|
1504
|
-
readFile: async (params) => connection.sendRequest("session.workspaces.readFile", {
|
|
1754
|
+
readFile: async (params) => connection.sendRequest("session.workspaces.readFile", { ...params, sessionId }),
|
|
1505
1755
|
/**
|
|
1506
1756
|
* Creates or overwrites a file in the session workspace files directory.
|
|
1507
1757
|
*
|
|
1508
1758
|
* @param params Relative path and UTF-8 content for the workspace file to create or overwrite.
|
|
1509
1759
|
*/
|
|
1510
|
-
createFile: async (params) => connection.sendRequest("session.workspaces.createFile", {
|
|
1760
|
+
createFile: async (params) => connection.sendRequest("session.workspaces.createFile", { ...params, sessionId }),
|
|
1511
1761
|
/**
|
|
1512
1762
|
* Returns metadata for a file or directory in the session workspace files directory.
|
|
1513
1763
|
*
|
|
@@ -1515,25 +1765,25 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1515
1765
|
*
|
|
1516
1766
|
* @returns Filesystem metadata for a path in the session workspace files directory.
|
|
1517
1767
|
*/
|
|
1518
|
-
statFile: async (params) => connection.sendRequest("session.workspaces.statFile", {
|
|
1768
|
+
statFile: async (params) => connection.sendRequest("session.workspaces.statFile", { ...params, sessionId }),
|
|
1519
1769
|
/**
|
|
1520
1770
|
* Creates a directory in the session workspace files directory.
|
|
1521
1771
|
*
|
|
1522
1772
|
* @param params Directory to create within the session workspace files directory.
|
|
1523
1773
|
*/
|
|
1524
|
-
createDirectory: async (params) => connection.sendRequest("session.workspaces.createDirectory", {
|
|
1774
|
+
createDirectory: async (params) => connection.sendRequest("session.workspaces.createDirectory", { ...params, sessionId }),
|
|
1525
1775
|
/**
|
|
1526
1776
|
* Removes a file or directory from the session workspace files directory.
|
|
1527
1777
|
*
|
|
1528
1778
|
* @param params File or directory to remove from the session workspace files directory.
|
|
1529
1779
|
*/
|
|
1530
|
-
removePath: async (params) => connection.sendRequest("session.workspaces.removePath", {
|
|
1780
|
+
removePath: async (params) => connection.sendRequest("session.workspaces.removePath", { ...params, sessionId }),
|
|
1531
1781
|
/**
|
|
1532
1782
|
* Renames a file or directory within the session workspace files directory.
|
|
1533
1783
|
*
|
|
1534
1784
|
* @param params Source and destination paths for a rename within the session workspace files directory.
|
|
1535
1785
|
*/
|
|
1536
|
-
renamePath: async (params) => connection.sendRequest("session.workspaces.renamePath", {
|
|
1786
|
+
renamePath: async (params) => connection.sendRequest("session.workspaces.renamePath", { ...params, sessionId }),
|
|
1537
1787
|
/**
|
|
1538
1788
|
* Lists workspace checkpoints in chronological order.
|
|
1539
1789
|
*
|
|
@@ -1547,7 +1797,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1547
1797
|
*
|
|
1548
1798
|
* @returns Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing.
|
|
1549
1799
|
*/
|
|
1550
|
-
readCheckpoint: async (params) => connection.sendRequest("session.workspaces.readCheckpoint", {
|
|
1800
|
+
readCheckpoint: async (params) => connection.sendRequest("session.workspaces.readCheckpoint", { ...params, sessionId }),
|
|
1551
1801
|
/**
|
|
1552
1802
|
* Adds a compaction summary checkpoint to the local session workspace.
|
|
1553
1803
|
*
|
|
@@ -1555,7 +1805,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1555
1805
|
*
|
|
1556
1806
|
* @returns Persisted summary metadata and refreshed workspace metadata.
|
|
1557
1807
|
*/
|
|
1558
|
-
addSummary: async (params) => connection.sendRequest("session.workspaces.addSummary", {
|
|
1808
|
+
addSummary: async (params) => connection.sendRequest("session.workspaces.addSummary", { ...params, sessionId }),
|
|
1559
1809
|
/**
|
|
1560
1810
|
* Truncates local workspace compaction summaries after a rollback.
|
|
1561
1811
|
*
|
|
@@ -1563,7 +1813,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1563
1813
|
*
|
|
1564
1814
|
* @returns Current workspace metadata for the session, including its absolute filesystem path when available.
|
|
1565
1815
|
*/
|
|
1566
|
-
truncateSummaries: async (params) => connection.sendRequest("session.workspaces.truncateSummaries", {
|
|
1816
|
+
truncateSummaries: async (params) => connection.sendRequest("session.workspaces.truncateSummaries", { ...params, sessionId }),
|
|
1567
1817
|
/**
|
|
1568
1818
|
* Reads the autopilot objective state file from the local session workspace.
|
|
1569
1819
|
*
|
|
@@ -1577,7 +1827,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1577
1827
|
*
|
|
1578
1828
|
* @returns Result of writing the autopilot objective file.
|
|
1579
1829
|
*/
|
|
1580
|
-
writeAutopilotObjective: async (params) => connection.sendRequest("session.workspaces.writeAutopilotObjective", {
|
|
1830
|
+
writeAutopilotObjective: async (params) => connection.sendRequest("session.workspaces.writeAutopilotObjective", { ...params, sessionId }),
|
|
1581
1831
|
/**
|
|
1582
1832
|
* Deletes the autopilot objective state file from the local session workspace.
|
|
1583
1833
|
*
|
|
@@ -1597,7 +1847,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1597
1847
|
*
|
|
1598
1848
|
* @returns Descriptor for the saved paste file, or null when the workspace is unavailable.
|
|
1599
1849
|
*/
|
|
1600
|
-
saveLargePaste: async (params) => connection.sendRequest("session.workspaces.saveLargePaste", {
|
|
1850
|
+
saveLargePaste: async (params) => connection.sendRequest("session.workspaces.saveLargePaste", { ...params, sessionId }),
|
|
1601
1851
|
/**
|
|
1602
1852
|
* Computes a diff for the session workspace. Never rejects for a busy session: a `session`-mode diff that cannot read the session's file-change captures falls back to an unstaged git diff with `isFallback: true` and reports why in `unavailableReason`.
|
|
1603
1853
|
*
|
|
@@ -1605,7 +1855,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1605
1855
|
*
|
|
1606
1856
|
* @returns Workspace diff result for the requested mode.
|
|
1607
1857
|
*/
|
|
1608
|
-
diff: async (params) => connection.sendRequest("session.workspaces.diff", {
|
|
1858
|
+
diff: async (params) => connection.sendRequest("session.workspaces.diff", { ...params, sessionId })
|
|
1609
1859
|
},
|
|
1610
1860
|
/** @experimental */
|
|
1611
1861
|
autopilotObjective: {
|
|
@@ -1631,7 +1881,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1631
1881
|
*
|
|
1632
1882
|
* @returns Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions.
|
|
1633
1883
|
*/
|
|
1634
|
-
request: async (params) => connection.sendRequest("session.completions.request", {
|
|
1884
|
+
request: async (params) => connection.sendRequest("session.completions.request", { ...params, sessionId })
|
|
1635
1885
|
},
|
|
1636
1886
|
/** @experimental */
|
|
1637
1887
|
instructions: {
|
|
@@ -1642,16 +1892,18 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1642
1892
|
*/
|
|
1643
1893
|
getSources: async () => connection.sendRequest("session.instructions.getSources", { sessionId }),
|
|
1644
1894
|
/**
|
|
1645
|
-
*
|
|
1895
|
+
* For local sessions, invalidates instruction discovery and the model-facing prompt, then returns freshly discovered sources. The updated prompt takes effect on the next turn. Remote sessions must reload on their agent host instead.
|
|
1896
|
+
*
|
|
1897
|
+
* @returns Instruction sources loaded for the session, in merge order.
|
|
1646
1898
|
*/
|
|
1647
1899
|
reload: async () => connection.sendRequest("session.instructions.reload", { sessionId })
|
|
1648
1900
|
},
|
|
1649
1901
|
/** @experimental */
|
|
1650
1902
|
customizations: {
|
|
1651
1903
|
/**
|
|
1652
|
-
*
|
|
1904
|
+
* For local sessions, reconciles repository context and discovered instructions, plugins, skills, agents, hooks, MCP servers, and extensions after files appear or change under the working directory. Independent component failures are returned in outcomes and errors; a rejected call can have partially applied earlier steps. Remote sessions must reload on their agent host instead. The model-facing context is rebuilt on the next turn.
|
|
1653
1905
|
*
|
|
1654
|
-
* @returns
|
|
1906
|
+
* @returns Results of reloading discovered session customizations. Inspect outcomes for reloaded, skipped, or failed subsystems; a rejection may follow partial mutation. Changes to the model-facing prompt and tools apply on the next turn.
|
|
1655
1907
|
*/
|
|
1656
1908
|
reload: async () => connection.sendRequest("session.customizations.reload", { sessionId })
|
|
1657
1909
|
},
|
|
@@ -1664,7 +1916,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1664
1916
|
*
|
|
1665
1917
|
* @returns Indicates whether fleet mode was successfully activated.
|
|
1666
1918
|
*/
|
|
1667
|
-
start: async (params) => connection.sendRequest("session.fleet.start", {
|
|
1919
|
+
start: async (params) => connection.sendRequest("session.fleet.start", { ...params, sessionId })
|
|
1668
1920
|
},
|
|
1669
1921
|
/** @experimental */
|
|
1670
1922
|
agent: {
|
|
@@ -1675,13 +1927,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1675
1927
|
*
|
|
1676
1928
|
* @returns Agents available to the session.
|
|
1677
1929
|
*/
|
|
1678
|
-
list: async (params) => connection.sendRequest("session.agent.list", {
|
|
1930
|
+
list: async (params) => connection.sendRequest("session.agent.list", { ...params, sessionId }),
|
|
1679
1931
|
/**
|
|
1680
1932
|
* Sets an in-memory authored prompt override for an available agent. For built-in agents, this replaces only the static base prompt while preserving runtime-owned dynamic prompt composition and behavior. The special `general-purpose` agent is not overrideable. Overrides are not persisted; resumed and forked sessions start without them, so the host must re-apply them.
|
|
1681
1933
|
*
|
|
1682
1934
|
* @param params An in-memory authored prompt override for an available agent.
|
|
1683
1935
|
*/
|
|
1684
|
-
setPrompt: async (params) => connection.sendRequest("session.agent.setPrompt", {
|
|
1936
|
+
setPrompt: async (params) => connection.sendRequest("session.agent.setPrompt", { ...params, sessionId }),
|
|
1685
1937
|
/**
|
|
1686
1938
|
* Gets the currently selected custom agent for the session.
|
|
1687
1939
|
*
|
|
@@ -1695,7 +1947,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1695
1947
|
*
|
|
1696
1948
|
* @returns The newly selected custom agent.
|
|
1697
1949
|
*/
|
|
1698
|
-
select: async (params) => connection.sendRequest("session.agent.select", {
|
|
1950
|
+
select: async (params) => connection.sendRequest("session.agent.select", { ...params, sessionId }),
|
|
1699
1951
|
/**
|
|
1700
1952
|
* Clears the selected custom agent and returns the session to the default agent.
|
|
1701
1953
|
*/
|
|
@@ -1716,7 +1968,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1716
1968
|
*
|
|
1717
1969
|
* @returns Identifier assigned to the newly started background agent task.
|
|
1718
1970
|
*/
|
|
1719
|
-
startAgent: async (params) => connection.sendRequest("session.tasks.startAgent", {
|
|
1971
|
+
startAgent: async (params) => connection.sendRequest("session.tasks.startAgent", { ...params, sessionId }),
|
|
1720
1972
|
/**
|
|
1721
1973
|
* Lists background tasks tracked by the session.
|
|
1722
1974
|
*
|
|
@@ -1730,7 +1982,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1730
1982
|
*
|
|
1731
1983
|
* @returns Result of registering or reclaiming a client-owned task.
|
|
1732
1984
|
*/
|
|
1733
|
-
register: async (params) => connection.sendRequest("session.tasks.register", {
|
|
1985
|
+
register: async (params) => connection.sendRequest("session.tasks.register", { ...params, sessionId }),
|
|
1734
1986
|
/**
|
|
1735
1987
|
* Publishes generic progress or a terminal outcome for a client-owned task.
|
|
1736
1988
|
*
|
|
@@ -1738,7 +1990,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1738
1990
|
*
|
|
1739
1991
|
* @returns Result of publishing a client-owned task update.
|
|
1740
1992
|
*/
|
|
1741
|
-
update: async (params) => connection.sendRequest("session.tasks.update", {
|
|
1993
|
+
update: async (params) => connection.sendRequest("session.tasks.update", { ...params, sessionId }),
|
|
1742
1994
|
/**
|
|
1743
1995
|
* Refreshes metadata for any detached background shells the runtime knows about.
|
|
1744
1996
|
*
|
|
@@ -1758,7 +2010,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1758
2010
|
*
|
|
1759
2011
|
* @returns Progress information for the task, or null when no task with that ID is tracked.
|
|
1760
2012
|
*/
|
|
1761
|
-
getProgress: async (params) => connection.sendRequest("session.tasks.getProgress", {
|
|
2013
|
+
getProgress: async (params) => connection.sendRequest("session.tasks.getProgress", { ...params, sessionId }),
|
|
1762
2014
|
/**
|
|
1763
2015
|
* Returns the first sync-waiting task that can currently be promoted to background mode.
|
|
1764
2016
|
*
|
|
@@ -1772,7 +2024,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1772
2024
|
*
|
|
1773
2025
|
* @returns Indicates whether the task was successfully promoted to background mode.
|
|
1774
2026
|
*/
|
|
1775
|
-
promoteToBackground: async (params) => connection.sendRequest("session.tasks.promoteToBackground", {
|
|
2027
|
+
promoteToBackground: async (params) => connection.sendRequest("session.tasks.promoteToBackground", { ...params, sessionId }),
|
|
1776
2028
|
/**
|
|
1777
2029
|
* Atomically promotes the first promotable sync-waiting task to background mode and returns it.
|
|
1778
2030
|
*
|
|
@@ -1786,7 +2038,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1786
2038
|
*
|
|
1787
2039
|
* @returns Indicates whether the background task was successfully cancelled.
|
|
1788
2040
|
*/
|
|
1789
|
-
cancel: async (params) => connection.sendRequest("session.tasks.cancel", {
|
|
2041
|
+
cancel: async (params) => connection.sendRequest("session.tasks.cancel", { ...params, sessionId }),
|
|
1790
2042
|
/**
|
|
1791
2043
|
* Removes a completed or cancelled background task from tracking.
|
|
1792
2044
|
*
|
|
@@ -1794,7 +2046,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1794
2046
|
*
|
|
1795
2047
|
* @returns Indicates whether the task was removed. False when the task does not exist or is still running/idle.
|
|
1796
2048
|
*/
|
|
1797
|
-
remove: async (params) => connection.sendRequest("session.tasks.remove", {
|
|
2049
|
+
remove: async (params) => connection.sendRequest("session.tasks.remove", { ...params, sessionId }),
|
|
1798
2050
|
/**
|
|
1799
2051
|
* Sends a message to a background agent task.
|
|
1800
2052
|
*
|
|
@@ -1802,7 +2054,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1802
2054
|
*
|
|
1803
2055
|
* @returns Indicates whether the message was delivered, with an error message when delivery failed.
|
|
1804
2056
|
*/
|
|
1805
|
-
sendMessage: async (params) => connection.sendRequest("session.tasks.sendMessage", {
|
|
2057
|
+
sendMessage: async (params) => connection.sendRequest("session.tasks.sendMessage", { ...params, sessionId })
|
|
1806
2058
|
},
|
|
1807
2059
|
/** @experimental */
|
|
1808
2060
|
skills: {
|
|
@@ -1823,13 +2075,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1823
2075
|
*
|
|
1824
2076
|
* @param params Name of the skill to enable for the session.
|
|
1825
2077
|
*/
|
|
1826
|
-
enable: async (params) => connection.sendRequest("session.skills.enable", {
|
|
2078
|
+
enable: async (params) => connection.sendRequest("session.skills.enable", { ...params, sessionId }),
|
|
1827
2079
|
/**
|
|
1828
2080
|
* Disables a skill for the session.
|
|
1829
2081
|
*
|
|
1830
2082
|
* @param params Name of the skill to disable for the session.
|
|
1831
2083
|
*/
|
|
1832
|
-
disable: async (params) => connection.sendRequest("session.skills.disable", {
|
|
2084
|
+
disable: async (params) => connection.sendRequest("session.skills.disable", { ...params, sessionId }),
|
|
1833
2085
|
/**
|
|
1834
2086
|
* Reloads skill definitions for the session.
|
|
1835
2087
|
*
|
|
@@ -1844,11 +2096,17 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1844
2096
|
/** @experimental */
|
|
1845
2097
|
mcp: {
|
|
1846
2098
|
/**
|
|
1847
|
-
* Lists MCP servers
|
|
2099
|
+
* Lists materialized MCP servers and their connection status. Cache misses may start and wait for MCP servers.
|
|
1848
2100
|
*
|
|
1849
2101
|
* @returns MCP servers configured for the session, with their connection status and host-level state.
|
|
1850
2102
|
*/
|
|
1851
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 }),
|
|
1852
2110
|
/**
|
|
1853
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.
|
|
1854
2112
|
*
|
|
@@ -1856,19 +2114,19 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1856
2114
|
*
|
|
1857
2115
|
* @returns Tools exposed by the connected MCP server. Throws when the server is not connected.
|
|
1858
2116
|
*/
|
|
1859
|
-
listTools: async (params) => connection.sendRequest("session.mcp.listTools", {
|
|
2117
|
+
listTools: async (params) => connection.sendRequest("session.mcp.listTools", { ...params, sessionId }),
|
|
1860
2118
|
/**
|
|
1861
2119
|
* Enables an MCP server for the session.
|
|
1862
2120
|
*
|
|
1863
2121
|
* @param params Name of the MCP server to enable for the session.
|
|
1864
2122
|
*/
|
|
1865
|
-
enable: async (params) => connection.sendRequest("session.mcp.enable", {
|
|
2123
|
+
enable: async (params) => connection.sendRequest("session.mcp.enable", { ...params, sessionId }),
|
|
1866
2124
|
/**
|
|
1867
2125
|
* Disables an MCP server for the session.
|
|
1868
2126
|
*
|
|
1869
2127
|
* @param params Name of the MCP server to disable for the session.
|
|
1870
2128
|
*/
|
|
1871
|
-
disable: async (params) => connection.sendRequest("session.mcp.disable", {
|
|
2129
|
+
disable: async (params) => connection.sendRequest("session.mcp.disable", { ...params, sessionId }),
|
|
1872
2130
|
/**
|
|
1873
2131
|
* Reloads MCP server connections for the session.
|
|
1874
2132
|
*/
|
|
@@ -1886,7 +2144,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1886
2144
|
*
|
|
1887
2145
|
* @returns Outcome of an MCP sampling execution: success result, failure error, or cancellation.
|
|
1888
2146
|
*/
|
|
1889
|
-
executeSampling: async (params) => connection.sendRequest("session.mcp.executeSampling", {
|
|
2147
|
+
executeSampling: async (params) => connection.sendRequest("session.mcp.executeSampling", { ...params, sessionId }),
|
|
1890
2148
|
/**
|
|
1891
2149
|
* Cancels an in-flight MCP sampling execution by request ID.
|
|
1892
2150
|
*
|
|
@@ -1894,7 +2152,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1894
2152
|
*
|
|
1895
2153
|
* @returns Indicates whether an in-flight sampling execution with the given requestId was found and cancelled.
|
|
1896
2154
|
*/
|
|
1897
|
-
cancelSamplingExecution: async (params) => connection.sendRequest("session.mcp.cancelSamplingExecution", {
|
|
2155
|
+
cancelSamplingExecution: async (params) => connection.sendRequest("session.mcp.cancelSamplingExecution", { ...params, sessionId }),
|
|
1898
2156
|
/**
|
|
1899
2157
|
* Sets how environment-variable values supplied to MCP servers are resolved (direct or indirect).
|
|
1900
2158
|
*
|
|
@@ -1902,7 +2160,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1902
2160
|
*
|
|
1903
2161
|
* @returns Env-value mode recorded on the session after the update.
|
|
1904
2162
|
*/
|
|
1905
|
-
setEnvValueMode: async (params) => connection.sendRequest("session.mcp.setEnvValueMode", {
|
|
2163
|
+
setEnvValueMode: async (params) => connection.sendRequest("session.mcp.setEnvValueMode", { ...params, sessionId }),
|
|
1906
2164
|
/**
|
|
1907
2165
|
* Removes the auto-managed `github` MCP server when present.
|
|
1908
2166
|
*
|
|
@@ -1914,19 +2172,19 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1914
2172
|
*
|
|
1915
2173
|
* @param params Server name and optional configuration for an individual MCP server start. Omit `config` for a config-free start-by-name of an already-configured server.
|
|
1916
2174
|
*/
|
|
1917
|
-
startServer: async (params) => connection.sendRequest("session.mcp.startServer", {
|
|
2175
|
+
startServer: async (params) => connection.sendRequest("session.mcp.startServer", { ...params, sessionId }),
|
|
1918
2176
|
/**
|
|
1919
2177
|
* Restarts an individual MCP server on the live session (stops then starts). Omit `config` for a config-free restart-by-name of an already-configured server; supply `config` to restart with a replacement configuration. Session-scoped and ephemeral: does NOT modify persistent user configuration (`mcp.config.*`).
|
|
1920
2178
|
*
|
|
1921
2179
|
* @param params Server name and optional replacement configuration for an individual MCP server restart. Omit `config` for a config-free restart-by-name of an already-configured server.
|
|
1922
2180
|
*/
|
|
1923
|
-
restartServer: async (params) => connection.sendRequest("session.mcp.restartServer", {
|
|
2181
|
+
restartServer: async (params) => connection.sendRequest("session.mcp.restartServer", { ...params, sessionId }),
|
|
1924
2182
|
/**
|
|
1925
2183
|
* Stops an individual MCP server on the session's host.
|
|
1926
2184
|
*
|
|
1927
2185
|
* @param params Server name for an individual MCP server stop.
|
|
1928
2186
|
*/
|
|
1929
|
-
stopServer: async (params) => connection.sendRequest("session.mcp.stopServer", {
|
|
2187
|
+
stopServer: async (params) => connection.sendRequest("session.mcp.stopServer", { ...params, sessionId }),
|
|
1930
2188
|
/**
|
|
1931
2189
|
* Checks whether a named MCP server is currently running on the session's host.
|
|
1932
2190
|
*
|
|
@@ -1934,7 +2192,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1934
2192
|
*
|
|
1935
2193
|
* @returns Whether the named MCP server is running.
|
|
1936
2194
|
*/
|
|
1937
|
-
isServerRunning: async (params) => connection.sendRequest("session.mcp.isServerRunning", {
|
|
2195
|
+
isServerRunning: async (params) => connection.sendRequest("session.mcp.isServerRunning", { ...params, sessionId }),
|
|
1938
2196
|
/** @experimental */
|
|
1939
2197
|
oauth: {
|
|
1940
2198
|
/**
|
|
@@ -1944,13 +2202,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1944
2202
|
*
|
|
1945
2203
|
* @returns Indicates whether the pending MCP OAuth response was accepted.
|
|
1946
2204
|
*/
|
|
1947
|
-
handlePendingRequest: async (params) => connection.sendRequest("session.mcp.oauth.handlePendingRequest", {
|
|
2205
|
+
handlePendingRequest: async (params) => connection.sendRequest("session.mcp.oauth.handlePendingRequest", { ...params, sessionId }),
|
|
1948
2206
|
/**
|
|
1949
2207
|
* Notifies the session that MCP OAuth authentication succeeded and updated credentials were persisted, so cached tool definitions can be refreshed.
|
|
1950
2208
|
*
|
|
1951
2209
|
* @param params Identifies the MCP server whose persisted OAuth credentials were updated.
|
|
1952
2210
|
*/
|
|
1953
|
-
authenticationStateChanged: async (params) => connection.sendRequest("session.mcp.oauth.authenticationStateChanged", {
|
|
2211
|
+
authenticationStateChanged: async (params) => connection.sendRequest("session.mcp.oauth.authenticationStateChanged", { ...params, sessionId }),
|
|
1954
2212
|
/**
|
|
1955
2213
|
* Prepares an inert, expiring owned OAuth login bound to the original session requester and exact installation. Does not activate, connect, read credentials or open a browser.
|
|
1956
2214
|
*
|
|
@@ -1958,15 +2216,21 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1958
2216
|
*
|
|
1959
2217
|
* @returns An inert runtime-issued login handle. Preparation alone performs no activation or OAuth work.
|
|
1960
2218
|
*/
|
|
1961
|
-
prepareLogin: async (params) => connection.sendRequest("session.mcp.oauth.prepareLogin", {
|
|
2219
|
+
prepareLogin: async (params) => connection.sendRequest("session.mcp.oauth.prepareLogin", { ...params, sessionId }),
|
|
1962
2220
|
/**
|
|
1963
2221
|
* Starts OAuth authentication for a remote MCP server. Owned servers require the original one-use prepareLogin handle and exact installation ID; manual servers retain the existing direct login behaviour.
|
|
1964
2222
|
*
|
|
1965
|
-
* @param params Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback
|
|
2223
|
+
* @param params Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback handling, and static OAuth client selection.
|
|
1966
2224
|
*
|
|
1967
2225
|
* @returns OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
|
|
1968
2226
|
*/
|
|
1969
|
-
login: async (params) => connection.sendRequest("session.mcp.oauth.login", {
|
|
2227
|
+
login: async (params) => connection.sendRequest("session.mcp.oauth.login", { ...params, sessionId }),
|
|
2228
|
+
/**
|
|
2229
|
+
* Completes a runtime-managed MCP OAuth login after the authorization server redirects to a host-managed callback URL.
|
|
2230
|
+
*
|
|
2231
|
+
* @param params Host-delivered callback for a runtime-managed MCP OAuth login.
|
|
2232
|
+
*/
|
|
2233
|
+
complete: async (params) => connection.sendRequest("session.mcp.oauth.complete", { ...params, sessionId }),
|
|
1970
2234
|
/**
|
|
1971
2235
|
* Passively probes a configured remote MCP server to classify whether OAuth is required or a cached/override token is accepted. Does not start OAuth, emit pending OAuth requests, or mutate MCP connection state.
|
|
1972
2236
|
*
|
|
@@ -1974,7 +2238,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1974
2238
|
*
|
|
1975
2239
|
* @returns Passive MCP OAuth probe result. `authenticated` means the server accepted the probe request while an OAuth-origin access token was attached; it does not prove the server required or independently validated that token. The probe does not make a second unauthenticated request. Failed is an expected probe-domain outcome; JSON-RPC errors are reserved for API-call failures.
|
|
1976
2240
|
*/
|
|
1977
|
-
probe: async (params) => connection.sendRequest("session.mcp.oauth.probe", {
|
|
2241
|
+
probe: async (params) => connection.sendRequest("session.mcp.oauth.probe", { ...params, sessionId }),
|
|
1978
2242
|
/**
|
|
1979
2243
|
* Cancels the exact owned OAuth login issued to this original session requester, without clearing shared credentials.
|
|
1980
2244
|
*
|
|
@@ -1982,7 +2246,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1982
2246
|
*
|
|
1983
2247
|
* @returns Honest terminal cancellation result; persistence or recovery failures remain RPC errors.
|
|
1984
2248
|
*/
|
|
1985
|
-
cancelLogin: async (params) => connection.sendRequest("session.mcp.oauth.cancelLogin", {
|
|
2249
|
+
cancelLogin: async (params) => connection.sendRequest("session.mcp.oauth.cancelLogin", { ...params, sessionId }),
|
|
1986
2250
|
/**
|
|
1987
2251
|
* Responds to a pending MCP OAuth authorization request by its request id.
|
|
1988
2252
|
*
|
|
@@ -1990,7 +2254,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1990
2254
|
*
|
|
1991
2255
|
* @returns Indicates whether the pending MCP OAuth response was accepted.
|
|
1992
2256
|
*/
|
|
1993
|
-
respond: async (params) => connection.sendRequest("session.mcp.oauth.respond", {
|
|
2257
|
+
respond: async (params) => connection.sendRequest("session.mcp.oauth.respond", { ...params, sessionId })
|
|
1994
2258
|
},
|
|
1995
2259
|
/** @experimental */
|
|
1996
2260
|
headers: {
|
|
@@ -2001,7 +2265,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2001
2265
|
*
|
|
2002
2266
|
* @returns Indicates whether the pending MCP headers refresh response was accepted.
|
|
2003
2267
|
*/
|
|
2004
|
-
handlePendingHeadersRefreshRequest: async (params) => connection.sendRequest("session.mcp.headers.handlePendingHeadersRefreshRequest", {
|
|
2268
|
+
handlePendingHeadersRefreshRequest: async (params) => connection.sendRequest("session.mcp.headers.handlePendingHeadersRefreshRequest", { ...params, sessionId })
|
|
2005
2269
|
},
|
|
2006
2270
|
/** @experimental */
|
|
2007
2271
|
apps: {
|
|
@@ -2012,7 +2276,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2012
2276
|
*
|
|
2013
2277
|
* @returns Resource contents returned by the MCP server.
|
|
2014
2278
|
*/
|
|
2015
|
-
readResource: async (params) => connection.sendRequest("session.mcp.apps.readResource", {
|
|
2279
|
+
readResource: async (params) => connection.sendRequest("session.mcp.apps.readResource", { ...params, sessionId }),
|
|
2016
2280
|
/**
|
|
2017
2281
|
* List tools that an MCP App view is allowed to call (SEP-1865 visibility filter). Returns tools whose `_meta.ui.visibility` is unset (default `["model","app"]`) or includes `"app"`.
|
|
2018
2282
|
*
|
|
@@ -2020,7 +2284,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2020
2284
|
*
|
|
2021
2285
|
* @returns App-callable tools from the named MCP server.
|
|
2022
2286
|
*/
|
|
2023
|
-
listTools: async (params) => connection.sendRequest("session.mcp.apps.listTools", {
|
|
2287
|
+
listTools: async (params) => connection.sendRequest("session.mcp.apps.listTools", { ...params, sessionId }),
|
|
2024
2288
|
/**
|
|
2025
2289
|
* Call an MCP tool from an MCP App view (SEP-1865). Enforces the visibility check that prevents an app iframe from invoking model-only tools. Returns the standard MCP `CallToolResult`.
|
|
2026
2290
|
*
|
|
@@ -2028,13 +2292,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2028
2292
|
*
|
|
2029
2293
|
* @returns Standard MCP CallToolResult
|
|
2030
2294
|
*/
|
|
2031
|
-
callTool: async (params) => connection.sendRequest("session.mcp.apps.callTool", {
|
|
2295
|
+
callTool: async (params) => connection.sendRequest("session.mcp.apps.callTool", { ...params, sessionId }),
|
|
2032
2296
|
/**
|
|
2033
2297
|
* Replace the host context returned to MCP App guests on `ui/initialize`. Hosts use this to advertise theme, locale, or other metadata to the guest UI.
|
|
2034
2298
|
*
|
|
2035
2299
|
* @param params Host context to advertise to MCP App guests.
|
|
2036
2300
|
*/
|
|
2037
|
-
setHostContext: async (params) => connection.sendRequest("session.mcp.apps.setHostContext", {
|
|
2301
|
+
setHostContext: async (params) => connection.sendRequest("session.mcp.apps.setHostContext", { ...params, sessionId }),
|
|
2038
2302
|
/**
|
|
2039
2303
|
* Read the current host context advertised to MCP App guests.
|
|
2040
2304
|
*
|
|
@@ -2048,7 +2312,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2048
2312
|
*
|
|
2049
2313
|
* @returns Diagnostic snapshot of MCP Apps wiring for the named server.
|
|
2050
2314
|
*/
|
|
2051
|
-
diagnose: async (params) => connection.sendRequest("session.mcp.apps.diagnose", {
|
|
2315
|
+
diagnose: async (params) => connection.sendRequest("session.mcp.apps.diagnose", { ...params, sessionId })
|
|
2052
2316
|
},
|
|
2053
2317
|
/** @experimental */
|
|
2054
2318
|
resources: {
|
|
@@ -2059,7 +2323,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2059
2323
|
*
|
|
2060
2324
|
* @returns Resource contents returned by the MCP server.
|
|
2061
2325
|
*/
|
|
2062
|
-
read: async (params) => connection.sendRequest("session.mcp.resources.read", {
|
|
2326
|
+
read: async (params) => connection.sendRequest("session.mcp.resources.read", { ...params, sessionId }),
|
|
2063
2327
|
/**
|
|
2064
2328
|
* Enumerate one page of resources a connected MCP server exposes (proxies MCP `resources/list`). Pass `cursor` to continue from a prior result's `nextCursor`.
|
|
2065
2329
|
*
|
|
@@ -2067,7 +2331,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2067
2331
|
*
|
|
2068
2332
|
* @returns One page of resources advertised by the named MCP server.
|
|
2069
2333
|
*/
|
|
2070
|
-
list: async (params) => connection.sendRequest("session.mcp.resources.list", {
|
|
2334
|
+
list: async (params) => connection.sendRequest("session.mcp.resources.list", { ...params, sessionId }),
|
|
2071
2335
|
/**
|
|
2072
2336
|
* Enumerate one page of resource templates a connected MCP server exposes (proxies MCP `resources/templates/list`). Pass `cursor` to continue from a prior result's `nextCursor`.
|
|
2073
2337
|
*
|
|
@@ -2075,7 +2339,26 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2075
2339
|
*
|
|
2076
2340
|
* @returns One page of resource templates advertised by the named MCP server.
|
|
2077
2341
|
*/
|
|
2078
|
-
listTemplates: async (params) => connection.sendRequest("session.mcp.resources.listTemplates", {
|
|
2342
|
+
listTemplates: async (params) => connection.sendRequest("session.mcp.resources.listTemplates", { ...params, sessionId })
|
|
2343
|
+
},
|
|
2344
|
+
/** @experimental */
|
|
2345
|
+
prompts: {
|
|
2346
|
+
/**
|
|
2347
|
+
* Enumerate one page of prompts a connected MCP server exposes (proxies MCP `prompts/list`). Pass `cursor` to continue from a prior result's `nextCursor`.
|
|
2348
|
+
*
|
|
2349
|
+
* @param params MCP server whose prompts to enumerate.
|
|
2350
|
+
*
|
|
2351
|
+
* @returns One page of prompts advertised by the named MCP server.
|
|
2352
|
+
*/
|
|
2353
|
+
list: async (params) => connection.sendRequest("session.mcp.prompts.list", { ...params, sessionId }),
|
|
2354
|
+
/**
|
|
2355
|
+
* Get a prompt's messages from a connected MCP server (proxies MCP `prompts/get`). Content is preserved as opaque JSON. Does not send messages to the model, execute tools, or fetch referenced resources.
|
|
2356
|
+
*
|
|
2357
|
+
* @param params MCP server, prompt name, and optional string-valued arguments.
|
|
2358
|
+
*
|
|
2359
|
+
* @returns Prompt messages returned by the MCP server without sending them to the model.
|
|
2360
|
+
*/
|
|
2361
|
+
get: async (params) => connection.sendRequest("session.mcp.prompts.get", { ...params, sessionId })
|
|
2079
2362
|
}
|
|
2080
2363
|
},
|
|
2081
2364
|
/** @experimental */
|
|
@@ -2087,7 +2370,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2087
2370
|
*
|
|
2088
2371
|
* @returns Per-source session diagnostics configuration.
|
|
2089
2372
|
*/
|
|
2090
|
-
configure: async (params) => connection.sendRequest("session.diagnostics.configure", {
|
|
2373
|
+
configure: async (params) => connection.sendRequest("session.diagnostics.configure", { ...params, sessionId }),
|
|
2091
2374
|
/**
|
|
2092
2375
|
* Reads a bounded batch of retained session diagnostics for the selected sources. Records are never consumed and each reader advances independently through its opaque cursor.
|
|
2093
2376
|
*
|
|
@@ -2095,7 +2378,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2095
2378
|
*
|
|
2096
2379
|
* @returns One cursor-addressed page of retained session diagnostics.
|
|
2097
2380
|
*/
|
|
2098
|
-
read: async (params) => connection.sendRequest("session.diagnostics.read", {
|
|
2381
|
+
read: async (params) => connection.sendRequest("session.diagnostics.read", { ...params, sessionId })
|
|
2099
2382
|
},
|
|
2100
2383
|
/** @experimental */
|
|
2101
2384
|
connectors: {
|
|
@@ -2124,7 +2407,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2124
2407
|
*
|
|
2125
2408
|
* @returns Validated Connector catalog snapshot cached by the session.
|
|
2126
2409
|
*/
|
|
2127
|
-
list: async (params) => connection.sendRequest("session.connectors.list", {
|
|
2410
|
+
list: async (params) => connection.sendRequest("session.connectors.list", { ...params, sessionId }),
|
|
2128
2411
|
/**
|
|
2129
2412
|
* Refreshes and validates the Connector catalog for the pinned opaque account selection.
|
|
2130
2413
|
*
|
|
@@ -2132,7 +2415,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2132
2415
|
*
|
|
2133
2416
|
* @returns Validated Connector catalog snapshot cached by the session.
|
|
2134
2417
|
*/
|
|
2135
|
-
refresh: async (params) => connection.sendRequest("session.connectors.refresh", {
|
|
2418
|
+
refresh: async (params) => connection.sendRequest("session.connectors.refresh", { ...params, sessionId }),
|
|
2136
2419
|
/**
|
|
2137
2420
|
* Initiates an idempotent Connector connection request without opening a browser. Returns connected when the service is immediately authoritative, consent_required with a validated URL, or pending with an opaque continuation ID.
|
|
2138
2421
|
*
|
|
@@ -2140,7 +2423,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2140
2423
|
*
|
|
2141
2424
|
* @returns Typed result of initiating or continuing a Connector connection.
|
|
2142
2425
|
*/
|
|
2143
|
-
connect: async (params) => connection.sendRequest("session.connectors.connect", {
|
|
2426
|
+
connect: async (params) => connection.sendRequest("session.connectors.connect", { ...params, sessionId }),
|
|
2144
2427
|
/**
|
|
2145
2428
|
* Re-initiates an idempotent Connector connection request without browser or UI effects, with the same typed outcomes as connect.
|
|
2146
2429
|
*
|
|
@@ -2148,7 +2431,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2148
2431
|
*
|
|
2149
2432
|
* @returns Typed result of initiating or continuing a Connector connection.
|
|
2150
2433
|
*/
|
|
2151
|
-
reconnect: async (params) => connection.sendRequest("session.connectors.reconnect", {
|
|
2434
|
+
reconnect: async (params) => connection.sendRequest("session.connectors.reconnect", { ...params, sessionId }),
|
|
2152
2435
|
/**
|
|
2153
2436
|
* Continues a pending Connector connection with caller-supplied attempt, interval, and deadline bounds. The runtime never opens the returned consent URL.
|
|
2154
2437
|
*
|
|
@@ -2156,7 +2439,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2156
2439
|
*
|
|
2157
2440
|
* @returns Typed result of initiating or continuing a Connector connection.
|
|
2158
2441
|
*/
|
|
2159
|
-
continueConnection: async (params) => connection.sendRequest("session.connectors.continueConnection", {
|
|
2442
|
+
continueConnection: async (params) => connection.sendRequest("session.connectors.continueConnection", { ...params, sessionId }),
|
|
2160
2443
|
/**
|
|
2161
2444
|
* Disconnects one Connector for the pinned opaque account selection, refreshes the authoritative catalog, and removes its session-owned MCP projection.
|
|
2162
2445
|
*
|
|
@@ -2164,7 +2447,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2164
2447
|
*
|
|
2165
2448
|
* @returns Authoritative result after disconnect and MCP reconciliation.
|
|
2166
2449
|
*/
|
|
2167
|
-
disconnect: async (params) => connection.sendRequest("session.connectors.disconnect", {
|
|
2450
|
+
disconnect: async (params) => connection.sendRequest("session.connectors.disconnect", { ...params, sessionId }),
|
|
2168
2451
|
/**
|
|
2169
2452
|
* Reconciles the authoritative cached or freshly requested Connector catalog into the session Connector MCP projection and returns live status.
|
|
2170
2453
|
*
|
|
@@ -2172,7 +2455,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2172
2455
|
*
|
|
2173
2456
|
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
2174
2457
|
*/
|
|
2175
|
-
reconcile: async (params) => connection.sendRequest("session.connectors.reconcile", {
|
|
2458
|
+
reconcile: async (params) => connection.sendRequest("session.connectors.reconcile", { ...params, sessionId })
|
|
2176
2459
|
},
|
|
2177
2460
|
/** @experimental */
|
|
2178
2461
|
managedSettings: {
|
|
@@ -2198,13 +2481,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2198
2481
|
*
|
|
2199
2482
|
* @returns Result of installing a plugin.
|
|
2200
2483
|
*/
|
|
2201
|
-
install: async (params) => connection.sendRequest("session.plugins.install", {
|
|
2484
|
+
install: async (params) => connection.sendRequest("session.plugins.install", { ...params, sessionId }),
|
|
2202
2485
|
/**
|
|
2203
2486
|
* Uninstalls a plugin when permitted by the live session's retained managed policy.
|
|
2204
2487
|
*
|
|
2205
2488
|
* @param params Name (or spec) of the plugin to uninstall.
|
|
2206
2489
|
*/
|
|
2207
|
-
uninstall: async (params) => connection.sendRequest("session.plugins.uninstall", {
|
|
2490
|
+
uninstall: async (params) => connection.sendRequest("session.plugins.uninstall", { ...params, sessionId }),
|
|
2208
2491
|
/**
|
|
2209
2492
|
* Updates an installed plugin using the live session's authoritative account, working directory, and retained managed policy.
|
|
2210
2493
|
*
|
|
@@ -2212,19 +2495,19 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2212
2495
|
*
|
|
2213
2496
|
* @returns Result of updating a single plugin.
|
|
2214
2497
|
*/
|
|
2215
|
-
update: async (params) => connection.sendRequest("session.plugins.update", {
|
|
2498
|
+
update: async (params) => connection.sendRequest("session.plugins.update", { ...params, sessionId }),
|
|
2216
2499
|
/**
|
|
2217
2500
|
* Enables installed plugins when permitted by the live session's retained managed policy.
|
|
2218
2501
|
*
|
|
2219
2502
|
* @param params Plugin names (or specs) to enable in the session's authoritative working directory.
|
|
2220
2503
|
*/
|
|
2221
|
-
enable: async (params) => connection.sendRequest("session.plugins.enable", {
|
|
2504
|
+
enable: async (params) => connection.sendRequest("session.plugins.enable", { ...params, sessionId }),
|
|
2222
2505
|
/**
|
|
2223
2506
|
* Disables installed plugins when permitted by the live session's retained managed policy.
|
|
2224
2507
|
*
|
|
2225
2508
|
* @param params Plugin names (or specs) to disable in the session's authoritative working directory.
|
|
2226
2509
|
*/
|
|
2227
|
-
disable: async (params) => connection.sendRequest("session.plugins.disable", {
|
|
2510
|
+
disable: async (params) => connection.sendRequest("session.plugins.disable", { ...params, sessionId }),
|
|
2228
2511
|
/** @experimental */
|
|
2229
2512
|
marketplaces: {
|
|
2230
2513
|
/**
|
|
@@ -2240,7 +2523,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2240
2523
|
*
|
|
2241
2524
|
* @returns Result of registering a new marketplace.
|
|
2242
2525
|
*/
|
|
2243
|
-
add: async (params) => connection.sendRequest("session.plugins.marketplaces.add", {
|
|
2526
|
+
add: async (params) => connection.sendRequest("session.plugins.marketplaces.add", { ...params, sessionId }),
|
|
2244
2527
|
/**
|
|
2245
2528
|
* Removes a marketplace when permitted by the live session's retained managed policy.
|
|
2246
2529
|
*
|
|
@@ -2248,7 +2531,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2248
2531
|
*
|
|
2249
2532
|
* @returns Outcome of the remove attempt, including dependent-plugin info when applicable.
|
|
2250
2533
|
*/
|
|
2251
|
-
remove: async (params) => connection.sendRequest("session.plugins.marketplaces.remove", {
|
|
2534
|
+
remove: async (params) => connection.sendRequest("session.plugins.marketplaces.remove", { ...params, sessionId }),
|
|
2252
2535
|
/**
|
|
2253
2536
|
* Browses a marketplace resolved through the live session's working directory and retained managed policy.
|
|
2254
2537
|
*
|
|
@@ -2256,7 +2539,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2256
2539
|
*
|
|
2257
2540
|
* @returns Plugins advertised by the marketplace.
|
|
2258
2541
|
*/
|
|
2259
|
-
browse: async (params) => connection.sendRequest("session.plugins.marketplaces.browse", {
|
|
2542
|
+
browse: async (params) => connection.sendRequest("session.plugins.marketplaces.browse", { ...params, sessionId }),
|
|
2260
2543
|
/**
|
|
2261
2544
|
* Refreshes marketplaces resolved through the live session's working directory and retained managed policy.
|
|
2262
2545
|
*
|
|
@@ -2264,14 +2547,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2264
2547
|
*
|
|
2265
2548
|
* @returns Result of refreshing one or more marketplace catalogs.
|
|
2266
2549
|
*/
|
|
2267
|
-
refresh: async (params) => connection.sendRequest("session.plugins.marketplaces.refresh", {
|
|
2550
|
+
refresh: async (params) => connection.sendRequest("session.plugins.marketplaces.refresh", { ...params, sessionId })
|
|
2268
2551
|
},
|
|
2269
2552
|
/**
|
|
2270
2553
|
* Reloads the session's plugin set, refreshing MCP servers, custom agents, hooks, and skills cache so SDK-driven changes via `server.plugins.*` take effect immediately.
|
|
2271
2554
|
*
|
|
2272
2555
|
* @param params Optional flags controlling which side effects the reload performs.
|
|
2273
2556
|
*/
|
|
2274
|
-
reload: async (params) => connection.sendRequest("session.plugins.reload", {
|
|
2557
|
+
reload: async (params) => connection.sendRequest("session.plugins.reload", { ...params, sessionId })
|
|
2275
2558
|
},
|
|
2276
2559
|
/** @experimental */
|
|
2277
2560
|
provider: {
|
|
@@ -2282,7 +2565,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2282
2565
|
*
|
|
2283
2566
|
* @returns A snapshot of the provider endpoint the session is currently configured to talk to.
|
|
2284
2567
|
*/
|
|
2285
|
-
getEndpoint: async (params) => connection.sendRequest("session.provider.getEndpoint", {
|
|
2568
|
+
getEndpoint: async (params) => connection.sendRequest("session.provider.getEndpoint", { ...params, sessionId }),
|
|
2286
2569
|
/**
|
|
2287
2570
|
* Adds BYOK providers and/or models to the session's registry at runtime, extending the additive registry built from the session's `providers`/`models` options. Both fields are optional, so a call may add providers only, models only, or both. Within a single call providers are registered before models, so a model may reference a provider added in the same call; across calls a model may reference any provider already registered (from session creation or a prior add). A model whose referenced provider is not registered by the end of the call is rejected. Newly added models become selectable via `model.list` / `model.switchTo` and are inherited by sub-agents spawned afterwards.
|
|
2288
2571
|
*
|
|
@@ -2290,7 +2573,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2290
2573
|
*
|
|
2291
2574
|
* @returns The selectable model entries synthesized for the models added by this call.
|
|
2292
2575
|
*/
|
|
2293
|
-
add: async (params) => connection.sendRequest("session.provider.add", {
|
|
2576
|
+
add: async (params) => connection.sendRequest("session.provider.add", { ...params, sessionId }),
|
|
2294
2577
|
/**
|
|
2295
2578
|
* Atomically updates the session's BYOK provider and model registry by applying the supplied snapshot, replacing existing entries, updating models, or removing entries absent from the snapshot.
|
|
2296
2579
|
*
|
|
@@ -2298,7 +2581,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2298
2581
|
*
|
|
2299
2582
|
* @returns The selectable model entries and selection ids synthesized for the synchronized BYOK models.
|
|
2300
2583
|
*/
|
|
2301
|
-
sync: async (params) => connection.sendRequest("session.provider.sync", {
|
|
2584
|
+
sync: async (params) => connection.sendRequest("session.provider.sync", { ...params, sessionId }),
|
|
2302
2585
|
/**
|
|
2303
2586
|
* Withdraws named host-managed models from the session's BYOK registry, leaving every other entry untouched. The scoped counterpart to `provider.sync`: a snapshot can only describe entries the caller knows about, so using it to remove one model silently withdraws rows registered by another source, such as a plugin calling `provider.add` at runtime. Naming what to remove leaves unrelated entries alone. Selection ids that are not registered are ignored, so withdrawal is idempotent. A provider is removed only when one of the withdrawn models was the last entry referencing it; a provider that simply has no models, which is the normal state while its rows are supplied by catalog discovery, is left in place.
|
|
2304
2587
|
*
|
|
@@ -2306,7 +2589,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2306
2589
|
*
|
|
2307
2590
|
* @returns What the withdrawal actually removed from the registry.
|
|
2308
2591
|
*/
|
|
2309
|
-
withdraw: async (params) => connection.sendRequest("session.provider.withdraw", {
|
|
2592
|
+
withdraw: async (params) => connection.sendRequest("session.provider.withdraw", { ...params, sessionId })
|
|
2310
2593
|
},
|
|
2311
2594
|
/** @experimental */
|
|
2312
2595
|
options: {
|
|
@@ -2317,7 +2600,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2317
2600
|
*
|
|
2318
2601
|
* @returns Indicates whether the session options patch was applied successfully.
|
|
2319
2602
|
*/
|
|
2320
|
-
update: async (params) => connection.sendRequest("session.options.update", {
|
|
2603
|
+
update: async (params) => connection.sendRequest("session.options.update", { ...params, sessionId })
|
|
2321
2604
|
},
|
|
2322
2605
|
/** @experimental */
|
|
2323
2606
|
lsp: {
|
|
@@ -2326,7 +2609,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2326
2609
|
*
|
|
2327
2610
|
* @param params Parameters for (re)loading the merged LSP configuration set.
|
|
2328
2611
|
*/
|
|
2329
|
-
initialize: async (params) => connection.sendRequest("session.lsp.initialize", {
|
|
2612
|
+
initialize: async (params) => connection.sendRequest("session.lsp.initialize", { ...params, sessionId })
|
|
2330
2613
|
},
|
|
2331
2614
|
/** @experimental */
|
|
2332
2615
|
extensions: {
|
|
@@ -2341,13 +2624,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2341
2624
|
*
|
|
2342
2625
|
* @param params Source-qualified extension identifier to enable for the session.
|
|
2343
2626
|
*/
|
|
2344
|
-
enable: async (params) => connection.sendRequest("session.extensions.enable", {
|
|
2627
|
+
enable: async (params) => connection.sendRequest("session.extensions.enable", { ...params, sessionId }),
|
|
2345
2628
|
/**
|
|
2346
2629
|
* Disables an extension for the session.
|
|
2347
2630
|
*
|
|
2348
2631
|
* @param params Source-qualified extension identifier to disable for the session.
|
|
2349
2632
|
*/
|
|
2350
|
-
disable: async (params) => connection.sendRequest("session.extensions.disable", {
|
|
2633
|
+
disable: async (params) => connection.sendRequest("session.extensions.disable", { ...params, sessionId }),
|
|
2351
2634
|
/**
|
|
2352
2635
|
* Reloads extension definitions and processes for the session.
|
|
2353
2636
|
*/
|
|
@@ -2357,7 +2640,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2357
2640
|
*
|
|
2358
2641
|
* @param params Parameters for session.extensions.sendAttachmentsToMessage.
|
|
2359
2642
|
*/
|
|
2360
|
-
sendAttachmentsToMessage: async (params) => connection.sendRequest("session.extensions.sendAttachmentsToMessage", {
|
|
2643
|
+
sendAttachmentsToMessage: async (params) => connection.sendRequest("session.extensions.sendAttachmentsToMessage", { ...params, sessionId })
|
|
2361
2644
|
},
|
|
2362
2645
|
/** @experimental */
|
|
2363
2646
|
tools: {
|
|
@@ -2368,7 +2651,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2368
2651
|
*
|
|
2369
2652
|
* @returns Canonical result returned by a session tool.
|
|
2370
2653
|
*/
|
|
2371
|
-
execute: async (params) => connection.sendRequest("session.tools.execute", {
|
|
2654
|
+
execute: async (params) => connection.sendRequest("session.tools.execute", { ...params, sessionId }),
|
|
2372
2655
|
/**
|
|
2373
2656
|
* Returns the Rust-owned built-in tool descriptors used to construct the session's offered tool set.
|
|
2374
2657
|
*
|
|
@@ -2376,7 +2659,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2376
2659
|
*
|
|
2377
2660
|
* @returns Rust-owned built-in tool descriptors for the session.
|
|
2378
2661
|
*/
|
|
2379
|
-
getBuiltinDescriptors: async (params) => connection.sendRequest("session.tools.getBuiltinDescriptors", {
|
|
2662
|
+
getBuiltinDescriptors: async (params) => connection.sendRequest("session.tools.getBuiltinDescriptors", { ...params, sessionId }),
|
|
2380
2663
|
/**
|
|
2381
2664
|
* Projects a completed task_complete tool call into its label-safe session event payload.
|
|
2382
2665
|
*
|
|
@@ -2384,7 +2667,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2384
2667
|
*
|
|
2385
2668
|
* @returns Task completion notification with summary from the agent
|
|
2386
2669
|
*/
|
|
2387
|
-
taskCompleteEventData: async (params) => connection.sendRequest("session.tools.taskCompleteEventData", {
|
|
2670
|
+
taskCompleteEventData: async (params) => connection.sendRequest("session.tools.taskCompleteEventData", { ...params, sessionId }),
|
|
2388
2671
|
/**
|
|
2389
2672
|
* Provides the result for a pending external tool call.
|
|
2390
2673
|
*
|
|
@@ -2392,7 +2675,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2392
2675
|
*
|
|
2393
2676
|
* @returns Indicates whether the external tool call result was handled successfully.
|
|
2394
2677
|
*/
|
|
2395
|
-
handlePendingToolCall: async (params) => connection.sendRequest("session.tools.handlePendingToolCall", {
|
|
2678
|
+
handlePendingToolCall: async (params) => connection.sendRequest("session.tools.handlePendingToolCall", { ...params, sessionId }),
|
|
2396
2679
|
/**
|
|
2397
2680
|
* Resolves, builds, and validates the runtime tool list for the session.
|
|
2398
2681
|
*
|
|
@@ -2412,7 +2695,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2412
2695
|
*
|
|
2413
2696
|
* @returns Empty result after replacing the calling connection's externally implemented tools.
|
|
2414
2697
|
*/
|
|
2415
|
-
set: async (params) => connection.sendRequest("session.tools.set", {
|
|
2698
|
+
set: async (params) => connection.sendRequest("session.tools.set", { ...params, sessionId }),
|
|
2416
2699
|
/**
|
|
2417
2700
|
* Sets the current session's live subagent settings override, which takes precedence over persisted user settings until cleared. Persisted user settings remain the source of truth for future sessions.
|
|
2418
2701
|
*
|
|
@@ -2420,7 +2703,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2420
2703
|
*
|
|
2421
2704
|
* @returns Empty result after applying subagent settings
|
|
2422
2705
|
*/
|
|
2423
|
-
updateSubagentSettings: async (params) => connection.sendRequest("session.tools.updateSubagentSettings", {
|
|
2706
|
+
updateSubagentSettings: async (params) => connection.sendRequest("session.tools.updateSubagentSettings", { ...params, sessionId })
|
|
2424
2707
|
},
|
|
2425
2708
|
/** @experimental */
|
|
2426
2709
|
commands: {
|
|
@@ -2431,7 +2714,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2431
2714
|
*
|
|
2432
2715
|
* @returns Slash commands available in the session, after applying any include/exclude filters.
|
|
2433
2716
|
*/
|
|
2434
|
-
list: async (params) => connection.sendRequest("session.commands.list", {
|
|
2717
|
+
list: async (params) => connection.sendRequest("session.commands.list", { ...params, sessionId }),
|
|
2435
2718
|
/**
|
|
2436
2719
|
* Invokes a slash command in the session.
|
|
2437
2720
|
*
|
|
@@ -2439,7 +2722,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2439
2722
|
*
|
|
2440
2723
|
* @returns Result of invoking the slash command (text output, prompt to send to the agent, completion, or subcommand selection).
|
|
2441
2724
|
*/
|
|
2442
|
-
invoke: async (params) => connection.sendRequest("session.commands.invoke", {
|
|
2725
|
+
invoke: async (params) => connection.sendRequest("session.commands.invoke", { ...params, sessionId }),
|
|
2443
2726
|
/**
|
|
2444
2727
|
* Reports completion of a pending client-handled slash command.
|
|
2445
2728
|
*
|
|
@@ -2447,7 +2730,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2447
2730
|
*
|
|
2448
2731
|
* @returns Indicates whether the pending client-handled command was completed successfully.
|
|
2449
2732
|
*/
|
|
2450
|
-
handlePendingCommand: async (params) => connection.sendRequest("session.commands.handlePendingCommand", {
|
|
2733
|
+
handlePendingCommand: async (params) => connection.sendRequest("session.commands.handlePendingCommand", { ...params, sessionId }),
|
|
2451
2734
|
/**
|
|
2452
2735
|
* Executes a slash command synchronously and returns any error.
|
|
2453
2736
|
*
|
|
@@ -2455,7 +2738,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2455
2738
|
*
|
|
2456
2739
|
* @returns Error message produced while executing the command, if any.
|
|
2457
2740
|
*/
|
|
2458
|
-
execute: async (params) => connection.sendRequest("session.commands.execute", {
|
|
2741
|
+
execute: async (params) => connection.sendRequest("session.commands.execute", { ...params, sessionId }),
|
|
2459
2742
|
/**
|
|
2460
2743
|
* Enqueues a slash command for FIFO processing on the local session.
|
|
2461
2744
|
*
|
|
@@ -2463,7 +2746,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2463
2746
|
*
|
|
2464
2747
|
* @returns Indicates whether the command was accepted into the local execution queue.
|
|
2465
2748
|
*/
|
|
2466
|
-
enqueue: async (params) => connection.sendRequest("session.commands.enqueue", {
|
|
2749
|
+
enqueue: async (params) => connection.sendRequest("session.commands.enqueue", { ...params, sessionId }),
|
|
2467
2750
|
/**
|
|
2468
2751
|
* Reports whether the host actually executed a queued command and whether to continue processing.
|
|
2469
2752
|
*
|
|
@@ -2471,7 +2754,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2471
2754
|
*
|
|
2472
2755
|
* @returns Indicates whether the queued-command response was matched to a pending request.
|
|
2473
2756
|
*/
|
|
2474
|
-
respondToQueuedCommand: async (params) => connection.sendRequest("session.commands.respondToQueuedCommand", {
|
|
2757
|
+
respondToQueuedCommand: async (params) => connection.sendRequest("session.commands.respondToQueuedCommand", { ...params, sessionId })
|
|
2475
2758
|
},
|
|
2476
2759
|
/** @experimental */
|
|
2477
2760
|
telemetry: {
|
|
@@ -2486,7 +2769,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2486
2769
|
*
|
|
2487
2770
|
* @param params Feature override key/value pairs to attach to subsequent telemetry events from this session.
|
|
2488
2771
|
*/
|
|
2489
|
-
setFeatureOverrides: async (params) => connection.sendRequest("session.telemetry.setFeatureOverrides", {
|
|
2772
|
+
setFeatureOverrides: async (params) => connection.sendRequest("session.telemetry.setFeatureOverrides", { ...params, sessionId })
|
|
2490
2773
|
},
|
|
2491
2774
|
/** @experimental */
|
|
2492
2775
|
ui: {
|
|
@@ -2497,7 +2780,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2497
2780
|
*
|
|
2498
2781
|
* @returns Completed transient query. Ordered chunks and the terminal outcome are also delivered through `ui.ephemeral_query` session events while it runs.
|
|
2499
2782
|
*/
|
|
2500
|
-
ephemeralQuery: async (params) => connection.sendRequest("session.ui.ephemeralQuery", {
|
|
2783
|
+
ephemeralQuery: async (params) => connection.sendRequest("session.ui.ephemeralQuery", { ...params, sessionId }),
|
|
2501
2784
|
/**
|
|
2502
2785
|
* Requests structured input from a UI-capable client.
|
|
2503
2786
|
*
|
|
@@ -2505,7 +2788,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2505
2788
|
*
|
|
2506
2789
|
* @returns The elicitation response (accept with form values, decline, or cancel)
|
|
2507
2790
|
*/
|
|
2508
|
-
elicitation: async (params) => connection.sendRequest("session.ui.elicitation", {
|
|
2791
|
+
elicitation: async (params) => connection.sendRequest("session.ui.elicitation", { ...params, sessionId }),
|
|
2509
2792
|
/**
|
|
2510
2793
|
* Provides the user response for a pending elicitation request.
|
|
2511
2794
|
*
|
|
@@ -2513,7 +2796,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2513
2796
|
*
|
|
2514
2797
|
* @returns Indicates whether the elicitation response was accepted; false if it was already resolved by another client.
|
|
2515
2798
|
*/
|
|
2516
|
-
handlePendingElicitation: async (params) => connection.sendRequest("session.ui.handlePendingElicitation", {
|
|
2799
|
+
handlePendingElicitation: async (params) => connection.sendRequest("session.ui.handlePendingElicitation", { ...params, sessionId }),
|
|
2517
2800
|
/**
|
|
2518
2801
|
* Resolves a pending `user_input.requested` event with the user's response.
|
|
2519
2802
|
*
|
|
@@ -2521,7 +2804,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2521
2804
|
*
|
|
2522
2805
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
2523
2806
|
*/
|
|
2524
|
-
handlePendingUserInput: async (params) => connection.sendRequest("session.ui.handlePendingUserInput", {
|
|
2807
|
+
handlePendingUserInput: async (params) => connection.sendRequest("session.ui.handlePendingUserInput", { ...params, sessionId }),
|
|
2525
2808
|
/**
|
|
2526
2809
|
* Resolves a pending `sampling.requested` event with a sampling result, or rejects it.
|
|
2527
2810
|
*
|
|
@@ -2529,7 +2812,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2529
2812
|
*
|
|
2530
2813
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
2531
2814
|
*/
|
|
2532
|
-
handlePendingSampling: async (params) => connection.sendRequest("session.ui.handlePendingSampling", {
|
|
2815
|
+
handlePendingSampling: async (params) => connection.sendRequest("session.ui.handlePendingSampling", { ...params, sessionId }),
|
|
2533
2816
|
/**
|
|
2534
2817
|
* Resolves a pending `auto_mode_switch.requested` event with the user's accept/decline decision.
|
|
2535
2818
|
*
|
|
@@ -2537,7 +2820,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2537
2820
|
*
|
|
2538
2821
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
2539
2822
|
*/
|
|
2540
|
-
handlePendingAutoModeSwitch: async (params) => connection.sendRequest("session.ui.handlePendingAutoModeSwitch", {
|
|
2823
|
+
handlePendingAutoModeSwitch: async (params) => connection.sendRequest("session.ui.handlePendingAutoModeSwitch", { ...params, sessionId }),
|
|
2541
2824
|
/**
|
|
2542
2825
|
* Resolves a pending `session_limits_exhausted.requested` event with the user's selected limit action.
|
|
2543
2826
|
*
|
|
@@ -2545,7 +2828,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2545
2828
|
*
|
|
2546
2829
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
2547
2830
|
*/
|
|
2548
|
-
handlePendingSessionLimitsExhausted: async (params) => connection.sendRequest("session.ui.handlePendingSessionLimitsExhausted", {
|
|
2831
|
+
handlePendingSessionLimitsExhausted: async (params) => connection.sendRequest("session.ui.handlePendingSessionLimitsExhausted", { ...params, sessionId }),
|
|
2549
2832
|
/**
|
|
2550
2833
|
* Resolves a pending `exit_plan_mode.requested` event with the user's response.
|
|
2551
2834
|
*
|
|
@@ -2553,7 +2836,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2553
2836
|
*
|
|
2554
2837
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
2555
2838
|
*/
|
|
2556
|
-
handlePendingExitPlanMode: async (params) => connection.sendRequest("session.ui.handlePendingExitPlanMode", {
|
|
2839
|
+
handlePendingExitPlanMode: async (params) => connection.sendRequest("session.ui.handlePendingExitPlanMode", { ...params, sessionId }),
|
|
2557
2840
|
/**
|
|
2558
2841
|
* Registers an in-process handler for auto-mode-switch requests so the server bridge skips dispatch.
|
|
2559
2842
|
*
|
|
@@ -2567,7 +2850,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2567
2850
|
*
|
|
2568
2851
|
* @returns Indicates whether the handle was active and the registration count was decremented.
|
|
2569
2852
|
*/
|
|
2570
|
-
unregisterDirectAutoModeSwitchHandler: async (params) => connection.sendRequest("session.ui.unregisterDirectAutoModeSwitchHandler", {
|
|
2853
|
+
unregisterDirectAutoModeSwitchHandler: async (params) => connection.sendRequest("session.ui.unregisterDirectAutoModeSwitchHandler", { ...params, sessionId })
|
|
2571
2854
|
},
|
|
2572
2855
|
/** @experimental */
|
|
2573
2856
|
permissions: {
|
|
@@ -2578,7 +2861,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2578
2861
|
*
|
|
2579
2862
|
* @returns Indicates whether the operation succeeded.
|
|
2580
2863
|
*/
|
|
2581
|
-
configure: async (params) => connection.sendRequest("session.permissions.configure", {
|
|
2864
|
+
configure: async (params) => connection.sendRequest("session.permissions.configure", { ...params, sessionId }),
|
|
2582
2865
|
/**
|
|
2583
2866
|
* Provides a decision for a pending tool permission request.
|
|
2584
2867
|
*
|
|
@@ -2586,7 +2869,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2586
2869
|
*
|
|
2587
2870
|
* @returns Indicates whether the permission decision was applied; false when the request was already resolved.
|
|
2588
2871
|
*/
|
|
2589
|
-
handlePendingPermissionRequest: async (params) => connection.sendRequest("session.permissions.handlePendingPermissionRequest", {
|
|
2872
|
+
handlePendingPermissionRequest: async (params) => connection.sendRequest("session.permissions.handlePendingPermissionRequest", { ...params, sessionId }),
|
|
2590
2873
|
/**
|
|
2591
2874
|
* Reconstructs the set of pending tool permission requests from the session's event history.
|
|
2592
2875
|
*
|
|
@@ -2600,7 +2883,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2600
2883
|
*
|
|
2601
2884
|
* @returns Indicates whether the operation succeeded.
|
|
2602
2885
|
*/
|
|
2603
|
-
setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", {
|
|
2886
|
+
setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", { ...params, sessionId }),
|
|
2604
2887
|
/**
|
|
2605
2888
|
* Sets the permission mode for the session. `manual` follows the normal approval flow, `assisted` attaches LLM safety recommendations, and `allow-all` automatically approves permission requests. The result returns the authoritative post-mutation mode so callers can update local state without racing the `session.permissions_changed` notification.
|
|
2606
2889
|
*
|
|
@@ -2608,7 +2891,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2608
2891
|
*
|
|
2609
2892
|
* @returns Indicates whether the requested permission mode was applied and reports the authoritative post-mutation mode.
|
|
2610
2893
|
*/
|
|
2611
|
-
setMode: async (params) => connection.sendRequest("session.permissions.setMode", {
|
|
2894
|
+
setMode: async (params) => connection.sendRequest("session.permissions.setMode", { ...params, sessionId }),
|
|
2612
2895
|
/**
|
|
2613
2896
|
* Returns the current permission mode for the session.
|
|
2614
2897
|
*
|
|
@@ -2622,7 +2905,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2622
2905
|
*
|
|
2623
2906
|
* @returns Indicates whether the operation succeeded.
|
|
2624
2907
|
*/
|
|
2625
|
-
modifyRules: async (params) => connection.sendRequest("session.permissions.modifyRules", {
|
|
2908
|
+
modifyRules: async (params) => connection.sendRequest("session.permissions.modifyRules", { ...params, sessionId }),
|
|
2626
2909
|
/**
|
|
2627
2910
|
* Sets whether the client wants permission prompts bridged into session events.
|
|
2628
2911
|
*
|
|
@@ -2630,7 +2913,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2630
2913
|
*
|
|
2631
2914
|
* @returns Indicates whether the operation succeeded.
|
|
2632
2915
|
*/
|
|
2633
|
-
setRequired: async (params) => connection.sendRequest("session.permissions.setRequired", {
|
|
2916
|
+
setRequired: async (params) => connection.sendRequest("session.permissions.setRequired", { ...params, sessionId }),
|
|
2634
2917
|
/**
|
|
2635
2918
|
* Clears session-scoped tool approvals and, for full resets, exact session-approved paths.
|
|
2636
2919
|
*
|
|
@@ -2638,7 +2921,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2638
2921
|
*
|
|
2639
2922
|
* @returns Indicates whether the operation succeeded.
|
|
2640
2923
|
*/
|
|
2641
|
-
resetSessionApprovals: async (params) => connection.sendRequest("session.permissions.resetSessionApprovals", {
|
|
2924
|
+
resetSessionApprovals: async (params) => connection.sendRequest("session.permissions.resetSessionApprovals", { ...params, sessionId }),
|
|
2642
2925
|
/**
|
|
2643
2926
|
* Notifies the runtime that a permission prompt UI has been shown to the user.
|
|
2644
2927
|
*
|
|
@@ -2646,7 +2929,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2646
2929
|
*
|
|
2647
2930
|
* @returns Indicates whether the operation succeeded.
|
|
2648
2931
|
*/
|
|
2649
|
-
notifyPromptShown: async (params) => connection.sendRequest("session.permissions.notifyPromptShown", {
|
|
2932
|
+
notifyPromptShown: async (params) => connection.sendRequest("session.permissions.notifyPromptShown", { ...params, sessionId }),
|
|
2650
2933
|
/** @experimental */
|
|
2651
2934
|
paths: {
|
|
2652
2935
|
/**
|
|
@@ -2662,7 +2945,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2662
2945
|
*
|
|
2663
2946
|
* @returns Indicates whether the operation succeeded.
|
|
2664
2947
|
*/
|
|
2665
|
-
add: async (params) => connection.sendRequest("session.permissions.paths.add", {
|
|
2948
|
+
add: async (params) => connection.sendRequest("session.permissions.paths.add", { ...params, sessionId }),
|
|
2666
2949
|
/**
|
|
2667
2950
|
* Updates the session's primary working directory used by the permission policy.
|
|
2668
2951
|
*
|
|
@@ -2670,7 +2953,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2670
2953
|
*
|
|
2671
2954
|
* @returns Indicates whether the operation succeeded.
|
|
2672
2955
|
*/
|
|
2673
|
-
updatePrimary: async (params) => connection.sendRequest("session.permissions.paths.updatePrimary", {
|
|
2956
|
+
updatePrimary: async (params) => connection.sendRequest("session.permissions.paths.updatePrimary", { ...params, sessionId }),
|
|
2674
2957
|
/**
|
|
2675
2958
|
* Reports whether a path falls within any of the session's allowed directories.
|
|
2676
2959
|
*
|
|
@@ -2678,7 +2961,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2678
2961
|
*
|
|
2679
2962
|
* @returns Indicates whether the supplied path is within the session's allowed directories.
|
|
2680
2963
|
*/
|
|
2681
|
-
isPathWithinAllowedDirectories: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinAllowedDirectories", {
|
|
2964
|
+
isPathWithinAllowedDirectories: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinAllowedDirectories", { ...params, sessionId }),
|
|
2682
2965
|
/**
|
|
2683
2966
|
* Reports whether a path falls within the session's workspace (primary) directory.
|
|
2684
2967
|
*
|
|
@@ -2686,7 +2969,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2686
2969
|
*
|
|
2687
2970
|
* @returns Indicates whether the supplied path is within the session's workspace directory.
|
|
2688
2971
|
*/
|
|
2689
|
-
isPathWithinWorkspace: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinWorkspace", {
|
|
2972
|
+
isPathWithinWorkspace: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinWorkspace", { ...params, sessionId })
|
|
2690
2973
|
},
|
|
2691
2974
|
/** @experimental */
|
|
2692
2975
|
locations: {
|
|
@@ -2697,7 +2980,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2697
2980
|
*
|
|
2698
2981
|
* @returns Resolved location-permissions key and type.
|
|
2699
2982
|
*/
|
|
2700
|
-
resolve: async (params) => connection.sendRequest("session.permissions.locations.resolve", {
|
|
2983
|
+
resolve: async (params) => connection.sendRequest("session.permissions.locations.resolve", { ...params, sessionId }),
|
|
2701
2984
|
/**
|
|
2702
2985
|
* Applies persisted location-scoped tool approvals and allowed directories for a working directory to this session's permission service.
|
|
2703
2986
|
*
|
|
@@ -2705,7 +2988,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2705
2988
|
*
|
|
2706
2989
|
* @returns Summary of persisted location permissions applied to the session.
|
|
2707
2990
|
*/
|
|
2708
|
-
apply: async (params) => connection.sendRequest("session.permissions.locations.apply", {
|
|
2991
|
+
apply: async (params) => connection.sendRequest("session.permissions.locations.apply", { ...params, sessionId }),
|
|
2709
2992
|
/**
|
|
2710
2993
|
* Persists a tool approval for a permission location and applies its rules to this session's live permission service.
|
|
2711
2994
|
*
|
|
@@ -2713,7 +2996,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2713
2996
|
*
|
|
2714
2997
|
* @returns Indicates whether the operation succeeded.
|
|
2715
2998
|
*/
|
|
2716
|
-
addToolApproval: async (params) => connection.sendRequest("session.permissions.locations.addToolApproval", {
|
|
2999
|
+
addToolApproval: async (params) => connection.sendRequest("session.permissions.locations.addToolApproval", { ...params, sessionId })
|
|
2717
3000
|
},
|
|
2718
3001
|
/** @experimental */
|
|
2719
3002
|
folderTrust: {
|
|
@@ -2724,7 +3007,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2724
3007
|
*
|
|
2725
3008
|
* @returns Folder trust check result.
|
|
2726
3009
|
*/
|
|
2727
|
-
isTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.isTrusted", {
|
|
3010
|
+
isTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.isTrusted", { ...params, sessionId }),
|
|
2728
3011
|
/**
|
|
2729
3012
|
* Adds a folder to the user's trusted folders list.
|
|
2730
3013
|
*
|
|
@@ -2732,7 +3015,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2732
3015
|
*
|
|
2733
3016
|
* @returns Indicates whether the operation succeeded.
|
|
2734
3017
|
*/
|
|
2735
|
-
addTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.addTrusted", {
|
|
3018
|
+
addTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.addTrusted", { ...params, sessionId })
|
|
2736
3019
|
},
|
|
2737
3020
|
/** @experimental */
|
|
2738
3021
|
urls: {
|
|
@@ -2743,7 +3026,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2743
3026
|
*
|
|
2744
3027
|
* @returns Indicates whether the operation succeeded.
|
|
2745
3028
|
*/
|
|
2746
|
-
setUnrestrictedMode: async (params) => connection.sendRequest("session.permissions.urls.setUnrestrictedMode", {
|
|
3029
|
+
setUnrestrictedMode: async (params) => connection.sendRequest("session.permissions.urls.setUnrestrictedMode", { ...params, sessionId })
|
|
2747
3030
|
}
|
|
2748
3031
|
},
|
|
2749
3032
|
/**
|
|
@@ -2755,7 +3038,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2755
3038
|
*
|
|
2756
3039
|
* @experimental
|
|
2757
3040
|
*/
|
|
2758
|
-
log: async (params) => connection.sendRequest("session.log", {
|
|
3041
|
+
log: async (params) => connection.sendRequest("session.log", { ...params, sessionId }),
|
|
2759
3042
|
/** @experimental */
|
|
2760
3043
|
metadata: {
|
|
2761
3044
|
/**
|
|
@@ -2777,7 +3060,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2777
3060
|
*
|
|
2778
3061
|
* @returns Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values.
|
|
2779
3062
|
*/
|
|
2780
|
-
updateClientMetadata: async (params) => connection.sendRequest("session.metadata.updateClientMetadata", {
|
|
3063
|
+
updateClientMetadata: async (params) => connection.sendRequest("session.metadata.updateClientMetadata", { ...params, sessionId }),
|
|
2781
3064
|
/**
|
|
2782
3065
|
* Reports whether the local session is currently processing user/agent messages.
|
|
2783
3066
|
*
|
|
@@ -2797,7 +3080,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2797
3080
|
*
|
|
2798
3081
|
* @returns Token breakdown for the session's current context window, or null if uninitialized.
|
|
2799
3082
|
*/
|
|
2800
|
-
contextInfo: async (params) => connection.sendRequest("session.metadata.contextInfo", {
|
|
3083
|
+
contextInfo: async (params) => connection.sendRequest("session.metadata.contextInfo", { ...params, sessionId }),
|
|
2801
3084
|
/**
|
|
2802
3085
|
* Returns the experimental per-source attribution breakdown of the session's current context window as a flat list of entries (skills, subagents, MCP servers, built-in tools, plugin rollups, system/tool-definition costs, with nesting via parentId), plus the successful compaction count. The heaviest individual messages are available separately via `metadata.getContextHeaviestMessages`. Returns null until the session has initialized its system prompt and tool metadata.
|
|
2803
3086
|
*
|
|
@@ -2811,7 +3094,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2811
3094
|
*
|
|
2812
3095
|
* @returns The heaviest individual messages in the session's context window, most-expensive first.
|
|
2813
3096
|
*/
|
|
2814
|
-
getContextHeaviestMessages: async (params) => connection.sendRequest("session.metadata.getContextHeaviestMessages", {
|
|
3097
|
+
getContextHeaviestMessages: async (params) => connection.sendRequest("session.metadata.getContextHeaviestMessages", { ...params, sessionId }),
|
|
2815
3098
|
/**
|
|
2816
3099
|
* Records a working-directory/git context change and emits a `session.context_changed` event. For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event): a local session's working directory is authoritative and is moved via `metadata.setWorkingDirectory` (or an SDK `session.resume` that supplies a `workingDirectory`), not by this method.
|
|
2817
3100
|
*
|
|
@@ -2819,7 +3102,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2819
3102
|
*
|
|
2820
3103
|
* @returns Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode). For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event); move a local session's working directory via `metadata.setWorkingDirectory` instead.
|
|
2821
3104
|
*/
|
|
2822
|
-
recordContextChange: async (params) => connection.sendRequest("session.metadata.recordContextChange", {
|
|
3105
|
+
recordContextChange: async (params) => connection.sendRequest("session.metadata.recordContextChange", { ...params, sessionId }),
|
|
2823
3106
|
/**
|
|
2824
3107
|
* Updates the session's working directory. For local sessions the target is validated first (an absolute path that exists on disk) and the permission primary directory is re-based; a rejected validation fails the call before any session state changes.
|
|
2825
3108
|
*
|
|
@@ -2827,7 +3110,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2827
3110
|
*
|
|
2828
3111
|
* @returns Update the session's working directory. Used by the host when the user explicitly changes cwd (e.g., the `/cd` slash command). The host is responsible for any related side-effects (file index, etc.); it does NOT change the process working directory (a session's cwd is per-session, not process-global). For local sessions the runtime validates the target first (an absolute path that exists on disk) and re-bases the permission primary directory; a rejected validation fails the call before anything is mutated, persisted, or emitted. Location-scoped permission rules are then re-keyed to the new directory (best-effort). Remote sessions only record the path.
|
|
2829
3112
|
*/
|
|
2830
|
-
setWorkingDirectory: async (params) => connection.sendRequest("session.metadata.setWorkingDirectory", {
|
|
3113
|
+
setWorkingDirectory: async (params) => connection.sendRequest("session.metadata.setWorkingDirectory", { ...params, sessionId }),
|
|
2831
3114
|
/**
|
|
2832
3115
|
* Re-tokenizes the session's existing messages against a model and returns aggregate token totals.
|
|
2833
3116
|
*
|
|
@@ -2835,7 +3118,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2835
3118
|
*
|
|
2836
3119
|
* @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.
|
|
2837
3120
|
*/
|
|
2838
|
-
recomputeContextTokens: async (params) => connection.sendRequest("session.metadata.recomputeContextTokens", {
|
|
3121
|
+
recomputeContextTokens: async (params) => connection.sendRequest("session.metadata.recomputeContextTokens", { ...params, sessionId })
|
|
2839
3122
|
},
|
|
2840
3123
|
/** @experimental */
|
|
2841
3124
|
contentExclusion: {
|
|
@@ -2846,18 +3129,18 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2846
3129
|
*
|
|
2847
3130
|
* @returns Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable.
|
|
2848
3131
|
*/
|
|
2849
|
-
checkPaths: async (params) => connection.sendRequest("session.contentExclusion.checkPaths", {
|
|
3132
|
+
checkPaths: async (params) => connection.sendRequest("session.contentExclusion.checkPaths", { ...params, sessionId })
|
|
2850
3133
|
},
|
|
2851
3134
|
/** @experimental */
|
|
2852
3135
|
shell: {
|
|
2853
3136
|
/**
|
|
2854
|
-
* Starts a shell command
|
|
3137
|
+
* Starts a shell command, returning an RPC error if it cannot be spawned. The command runs as the leader of its own process group (POSIX) or in a dedicated job object (Windows), so a forced termination — via "shell.kill", the request timeout, or session disposal — signals that whole group/job rather than only the direct child. Two gaps are worth planning for: a command that exits on its own does not trigger that teardown, and on POSIX a descendant that moves itself into a new session or process group (for example via "setsid") leaves the signalled group, so either can leave a background process running.
|
|
2855
3138
|
*
|
|
2856
|
-
* @param params Shell command to run, with optional working directory and timeout in milliseconds.
|
|
3139
|
+
* @param params Shell command to run, with optional working directory and timeout in milliseconds. Spawn failures return an RPC error.
|
|
2857
3140
|
*
|
|
2858
|
-
* @returns Identifier of the spawned process,
|
|
3141
|
+
* @returns Identifier of the spawned shell process, usable with shell.kill while the process is running.
|
|
2859
3142
|
*/
|
|
2860
|
-
exec: async (params) => connection.sendRequest("session.shell.exec", {
|
|
3143
|
+
exec: async (params) => connection.sendRequest("session.shell.exec", { ...params, sessionId }),
|
|
2861
3144
|
/**
|
|
2862
3145
|
* Sends a signal to a shell process previously started via "shell.exec". The signal targets the command's whole process group (POSIX) or job object (Windows), so descendants still in that group are signalled too, not just the direct child. On POSIX a descendant that moved itself into a new session or process group (for example via "setsid") is no longer in the signalled group and survives.
|
|
2863
3146
|
*
|
|
@@ -2865,7 +3148,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2865
3148
|
*
|
|
2866
3149
|
* @returns Indicates whether the signal was delivered; false if the process was unknown or already exited.
|
|
2867
3150
|
*/
|
|
2868
|
-
kill: async (params) => connection.sendRequest("session.shell.kill", {
|
|
3151
|
+
kill: async (params) => connection.sendRequest("session.shell.kill", { ...params, sessionId }),
|
|
2869
3152
|
/**
|
|
2870
3153
|
* Executes a user-requested shell command through the session runtime.
|
|
2871
3154
|
*
|
|
@@ -2873,7 +3156,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2873
3156
|
*
|
|
2874
3157
|
* @returns Result of a user-requested shell command.
|
|
2875
3158
|
*/
|
|
2876
|
-
executeUserRequested: async (params) => connection.sendRequest("session.shell.executeUserRequested", {
|
|
3159
|
+
executeUserRequested: async (params) => connection.sendRequest("session.shell.executeUserRequested", { ...params, sessionId }),
|
|
2877
3160
|
/**
|
|
2878
3161
|
* Cancels a user-requested shell command by request ID.
|
|
2879
3162
|
*
|
|
@@ -2881,7 +3164,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2881
3164
|
*
|
|
2882
3165
|
* @returns Cancellation result for a user-requested shell command.
|
|
2883
3166
|
*/
|
|
2884
|
-
cancelUserRequested: async (params) => connection.sendRequest("session.shell.cancelUserRequested", {
|
|
3167
|
+
cancelUserRequested: async (params) => connection.sendRequest("session.shell.cancelUserRequested", { ...params, sessionId })
|
|
2885
3168
|
},
|
|
2886
3169
|
/** @experimental */
|
|
2887
3170
|
history: {
|
|
@@ -2892,7 +3175,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2892
3175
|
*
|
|
2893
3176
|
* @returns Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown.
|
|
2894
3177
|
*/
|
|
2895
|
-
compact: async (params) => connection.sendRequest("session.history.compact", {
|
|
3178
|
+
compact: async (params) => connection.sendRequest("session.history.compact", { ...params, sessionId }),
|
|
2896
3179
|
/**
|
|
2897
3180
|
* Truncates persisted session history to a specific event.
|
|
2898
3181
|
*
|
|
@@ -2900,7 +3183,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2900
3183
|
*
|
|
2901
3184
|
* @returns Number of events that were removed by the truncation.
|
|
2902
3185
|
*/
|
|
2903
|
-
truncate: async (params) => connection.sendRequest("session.history.truncate", {
|
|
3186
|
+
truncate: async (params) => connection.sendRequest("session.history.truncate", { ...params, sessionId }),
|
|
2904
3187
|
/**
|
|
2905
3188
|
* Lists the user turns that the session can rewind to. Never rejects for a busy session: rewind reads need the session's file-change captures to be settled, so a session that still holds active work answers with `unavailableReason: "session-busy"` and no points, which the caller can retry.
|
|
2906
3189
|
*
|
|
@@ -2914,7 +3197,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2914
3197
|
*
|
|
2915
3198
|
* @returns Files and aggregate changes for a prospective rewind.
|
|
2916
3199
|
*/
|
|
2917
|
-
previewRewind: async (params) => connection.sendRequest("session.history.previewRewind", {
|
|
3200
|
+
previewRewind: async (params) => connection.sendRequest("session.history.previewRewind", { ...params, sessionId }),
|
|
2918
3201
|
/**
|
|
2919
3202
|
* Rewinds the session conversation, optionally restoring files changed by the discarded turns. Not crash-atomic: file restore and conversation truncation are separate stores, applied in that order, so a process crash between them can leave the workspace rewound while the conversation still contains the discarded turns. There is no recovery journal; re-running the same rewind is the recovery path for a crash before truncation lands, since file restore is idempotent (already-restored files are reported as skipped) and truncation is re-derived from the still-retained boundary event. After truncation lands that boundary no longer exists, so the same request is rejected; the only stage that can still be outstanding is snapshot pruning, whose failure leaves orphan snapshots the capture store tolerates. The reverse inconsistency cannot occur, because truncation is never applied before file restore succeeds.
|
|
2920
3203
|
*
|
|
@@ -2922,7 +3205,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2922
3205
|
*
|
|
2923
3206
|
* @returns Structured outcome of a rewind request.
|
|
2924
3207
|
*/
|
|
2925
|
-
rewind: async (params) => connection.sendRequest("session.history.rewind", {
|
|
3208
|
+
rewind: async (params) => connection.sendRequest("session.history.rewind", { ...params, sessionId }),
|
|
2926
3209
|
/**
|
|
2927
3210
|
* Cancels any in-progress background compaction on a local session.
|
|
2928
3211
|
*
|
|
@@ -2948,7 +3231,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2948
3231
|
*
|
|
2949
3232
|
* @returns What a successful clear removed. A clear that could not be applied rejects instead of reporting a count.
|
|
2950
3233
|
*/
|
|
2951
|
-
clearContext: async (params) => connection.sendRequest("session.history.clearContext", {
|
|
3234
|
+
clearContext: async (params) => connection.sendRequest("session.history.clearContext", { ...params, sessionId })
|
|
2952
3235
|
},
|
|
2953
3236
|
/** @experimental */
|
|
2954
3237
|
queue: {
|
|
@@ -2965,7 +3248,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2965
3248
|
*
|
|
2966
3249
|
* @returns Result of moving a queued item.
|
|
2967
3250
|
*/
|
|
2968
|
-
moveItem: async (params) => connection.sendRequest("session.queue.moveItem", {
|
|
3251
|
+
moveItem: async (params) => connection.sendRequest("session.queue.moveItem", { ...params, sessionId }),
|
|
2969
3252
|
/**
|
|
2970
3253
|
* Inserts a new queued message at a public visible position.
|
|
2971
3254
|
*
|
|
@@ -2973,7 +3256,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2973
3256
|
*
|
|
2974
3257
|
* @returns Result of inserting a queued message.
|
|
2975
3258
|
*/
|
|
2976
|
-
insertAt: async (params) => connection.sendRequest("session.queue.insertAt", {
|
|
3259
|
+
insertAt: async (params) => connection.sendRequest("session.queue.insertAt", { ...params, sessionId }),
|
|
2977
3260
|
/**
|
|
2978
3261
|
* Removes an addressable queued item by its stable id.
|
|
2979
3262
|
*
|
|
@@ -2981,7 +3264,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2981
3264
|
*
|
|
2982
3265
|
* @returns Result of removing a queued item.
|
|
2983
3266
|
*/
|
|
2984
|
-
removeAt: async (params) => connection.sendRequest("session.queue.removeAt", {
|
|
3267
|
+
removeAt: async (params) => connection.sendRequest("session.queue.removeAt", { ...params, sessionId }),
|
|
2985
3268
|
/**
|
|
2986
3269
|
* Updates the text of an addressable single-message queue item.
|
|
2987
3270
|
*
|
|
@@ -2989,7 +3272,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2989
3272
|
*
|
|
2990
3273
|
* @returns Result of editing a queued message.
|
|
2991
3274
|
*/
|
|
2992
|
-
updateText: async (params) => connection.sendRequest("session.queue.updateText", {
|
|
3275
|
+
updateText: async (params) => connection.sendRequest("session.queue.updateText", { ...params, sessionId }),
|
|
2993
3276
|
/**
|
|
2994
3277
|
* Atomically withdraws an unchanged user message of a local session: from the queued or steering lane while unconsumed, or from the running turn it started while the model has not answered it and nothing the user sent after it is pending. Withdrawing from the running turn interrupts that turn and removes its events from history. A client retaining the original draft may restore it only when removed is true.
|
|
2995
3278
|
*
|
|
@@ -2997,7 +3280,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2997
3280
|
*
|
|
2998
3281
|
* @returns Result of withdrawing a user message.
|
|
2999
3282
|
*/
|
|
3000
|
-
withdrawMessage: async (params) => connection.sendRequest("session.queue.withdrawMessage", {
|
|
3283
|
+
withdrawMessage: async (params) => connection.sendRequest("session.queue.withdrawMessage", { ...params, sessionId }),
|
|
3001
3284
|
/**
|
|
3002
3285
|
* Atomically appends text and attachments to an unchanged, unconsumed local steering message. Returns updated=false if delivery or withdrawal already claimed the message.
|
|
3003
3286
|
*
|
|
@@ -3005,7 +3288,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3005
3288
|
*
|
|
3006
3289
|
* @returns Result of editing a queued message.
|
|
3007
3290
|
*/
|
|
3008
|
-
appendSteering: async (params) => connection.sendRequest("session.queue.appendSteering", {
|
|
3291
|
+
appendSteering: async (params) => connection.sendRequest("session.queue.appendSteering", { ...params, sessionId }),
|
|
3009
3292
|
/**
|
|
3010
3293
|
* Duplicates an addressable queued item immediately after its source.
|
|
3011
3294
|
*
|
|
@@ -3013,13 +3296,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3013
3296
|
*
|
|
3014
3297
|
* @returns Result of duplicating a queued item.
|
|
3015
3298
|
*/
|
|
3016
|
-
duplicateAt: async (params) => connection.sendRequest("session.queue.duplicateAt", {
|
|
3299
|
+
duplicateAt: async (params) => connection.sendRequest("session.queue.duplicateAt", { ...params, sessionId }),
|
|
3017
3300
|
/**
|
|
3018
3301
|
* Acquires or releases the queued-lane drain pause.
|
|
3019
3302
|
*
|
|
3020
3303
|
* @param params Parameters for acquiring or releasing the queued-lane drain pause. Acquisition is exclusive and non-idempotent: `paused: true` against an already-paused session fails with `queue_already_paused`. The pause is never released automatically — it is not tied to the caller's lifetime, so a client that exits without sending `paused: false` leaves the lane frozen. Release is unowned: `paused: false` clears the pause for any caller, including one that never acquired it.
|
|
3021
3304
|
*/
|
|
3022
|
-
setDrainPaused: async (params) => connection.sendRequest("session.queue.setDrainPaused", {
|
|
3305
|
+
setDrainPaused: async (params) => connection.sendRequest("session.queue.setDrainPaused", { ...params, sessionId }),
|
|
3023
3306
|
/**
|
|
3024
3307
|
* Moves an addressable queued message into the live turn's steering lane.
|
|
3025
3308
|
*
|
|
@@ -3027,7 +3310,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3027
3310
|
*
|
|
3028
3311
|
* @returns Result of trying to steer a queued message into a live turn.
|
|
3029
3312
|
*/
|
|
3030
|
-
sendNow: async (params) => connection.sendRequest("session.queue.sendNow", {
|
|
3313
|
+
sendNow: async (params) => connection.sendRequest("session.queue.sendNow", { ...params, sessionId }),
|
|
3031
3314
|
/**
|
|
3032
3315
|
* Removes the most recently queued user-facing item (LIFO).
|
|
3033
3316
|
*
|
|
@@ -3048,7 +3331,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3048
3331
|
*
|
|
3049
3332
|
* @returns Batch of session events returned by a read, with cursor and continuation metadata.
|
|
3050
3333
|
*/
|
|
3051
|
-
read: async (params) => connection.sendRequest("session.eventLog.read", {
|
|
3334
|
+
read: async (params) => connection.sendRequest("session.eventLog.read", { ...params, sessionId }),
|
|
3052
3335
|
/**
|
|
3053
3336
|
* Returns a snapshot of the current tail cursor without consuming events.
|
|
3054
3337
|
*
|
|
@@ -3062,7 +3345,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3062
3345
|
*
|
|
3063
3346
|
* @returns Opaque handle representing an event-type interest registration.
|
|
3064
3347
|
*/
|
|
3065
|
-
registerInterest: async (params) => connection.sendRequest("session.eventLog.registerInterest", {
|
|
3348
|
+
registerInterest: async (params) => connection.sendRequest("session.eventLog.registerInterest", { ...params, sessionId }),
|
|
3066
3349
|
/**
|
|
3067
3350
|
* Releases a consumer's previously-registered interest in an event type.
|
|
3068
3351
|
*
|
|
@@ -3070,7 +3353,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3070
3353
|
*
|
|
3071
3354
|
* @returns Indicates whether the operation succeeded.
|
|
3072
3355
|
*/
|
|
3073
|
-
releaseInterest: async (params) => connection.sendRequest("session.eventLog.releaseInterest", {
|
|
3356
|
+
releaseInterest: async (params) => connection.sendRequest("session.eventLog.releaseInterest", { ...params, sessionId })
|
|
3074
3357
|
},
|
|
3075
3358
|
/** @experimental */
|
|
3076
3359
|
usage: {
|
|
@@ -3090,7 +3373,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3090
3373
|
*
|
|
3091
3374
|
* @returns Prediction result. Available results include prediction details; unavailable results include an explicit reason.
|
|
3092
3375
|
*/
|
|
3093
|
-
predict: async (params) => connection.sendRequest("session.limitPrediction.predict", {
|
|
3376
|
+
predict: async (params) => connection.sendRequest("session.limitPrediction.predict", { ...params, sessionId })
|
|
3094
3377
|
},
|
|
3095
3378
|
/** @experimental */
|
|
3096
3379
|
remote: {
|
|
@@ -3101,7 +3384,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3101
3384
|
*
|
|
3102
3385
|
* @returns GitHub URL for the session and a flag indicating whether remote steering is enabled.
|
|
3103
3386
|
*/
|
|
3104
|
-
enable: async (params) => connection.sendRequest("session.remote.enable", {
|
|
3387
|
+
enable: async (params) => connection.sendRequest("session.remote.enable", { ...params, sessionId }),
|
|
3105
3388
|
/**
|
|
3106
3389
|
* Disables remote session export and steering.
|
|
3107
3390
|
*/
|
|
@@ -3113,7 +3396,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3113
3396
|
*
|
|
3114
3397
|
* @returns Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own.
|
|
3115
3398
|
*/
|
|
3116
|
-
notifySteerableChanged: async (params) => connection.sendRequest("session.remote.notifySteerableChanged", {
|
|
3399
|
+
notifySteerableChanged: async (params) => connection.sendRequest("session.remote.notifySteerableChanged", { ...params, sessionId })
|
|
3117
3400
|
},
|
|
3118
3401
|
/** @experimental */
|
|
3119
3402
|
visibility: {
|
|
@@ -3130,7 +3413,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3130
3413
|
*
|
|
3131
3414
|
* @returns Effective sharing status and shareable GitHub URL after updating session visibility.
|
|
3132
3415
|
*/
|
|
3133
|
-
set: async (params) => connection.sendRequest("session.visibility.set", {
|
|
3416
|
+
set: async (params) => connection.sendRequest("session.visibility.set", { ...params, sessionId })
|
|
3134
3417
|
},
|
|
3135
3418
|
/** @experimental */
|
|
3136
3419
|
schedule: {
|
|
@@ -3147,7 +3430,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3147
3430
|
*
|
|
3148
3431
|
* @returns Remove a scheduled prompt by id. The result entry is omitted if the id was unknown.
|
|
3149
3432
|
*/
|
|
3150
|
-
stop: async (params) => connection.sendRequest("session.schedule.stop", {
|
|
3433
|
+
stop: async (params) => connection.sendRequest("session.schedule.stop", { ...params, sessionId })
|
|
3151
3434
|
}
|
|
3152
3435
|
};
|
|
3153
3436
|
}
|
|
@@ -3160,7 +3443,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3160
3443
|
*
|
|
3161
3444
|
* @experimental
|
|
3162
3445
|
*/
|
|
3163
|
-
sendSystemNotification: async (params) => connection.sendRequest("session.sendSystemNotification", {
|
|
3446
|
+
sendSystemNotification: async (params) => connection.sendRequest("session.sendSystemNotification", { ...params, sessionId }),
|
|
3164
3447
|
/** @experimental */
|
|
3165
3448
|
gitHubAuth: {
|
|
3166
3449
|
/**
|
|
@@ -3188,13 +3471,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3188
3471
|
*
|
|
3189
3472
|
* @returns Authentication credentials accepted only at native protocol ingress. Runtime outputs use credential-free `AuthIdentity` metadata.
|
|
3190
3473
|
*/
|
|
3191
|
-
login: async (params) => connection.sendRequest("session.gitHubAuth.login", {
|
|
3474
|
+
login: async (params) => connection.sendRequest("session.gitHubAuth.login", { ...params, sessionId }),
|
|
3192
3475
|
/**
|
|
3193
3476
|
* Switches the session to another available authentication.
|
|
3194
3477
|
*
|
|
3195
3478
|
* @param params Parameters for switching the session's active authentication.
|
|
3196
3479
|
*/
|
|
3197
|
-
switchToAuth: async (params) => connection.sendRequest("session.gitHubAuth.switchToAuth", {
|
|
3480
|
+
switchToAuth: async (params) => connection.sendRequest("session.gitHubAuth.switchToAuth", { ...params, sessionId }),
|
|
3198
3481
|
/**
|
|
3199
3482
|
* Logs out the session's current GitHub authentication.
|
|
3200
3483
|
*
|
|
@@ -3208,7 +3491,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3208
3491
|
*
|
|
3209
3492
|
* @returns Whether the requested authentication was logged out.
|
|
3210
3493
|
*/
|
|
3211
|
-
logoutUser: async (params) => connection.sendRequest("session.gitHubAuth.logoutUser", {
|
|
3494
|
+
logoutUser: async (params) => connection.sendRequest("session.gitHubAuth.logoutUser", { ...params, sessionId }),
|
|
3212
3495
|
/**
|
|
3213
3496
|
* Gets validation errors from the most recent authentication attempt.
|
|
3214
3497
|
*
|
|
@@ -3225,13 +3508,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3225
3508
|
*
|
|
3226
3509
|
* @param params Internal canvas provider registration parameters.
|
|
3227
3510
|
*/
|
|
3228
|
-
register: async (params) => connection.sendRequest("session.canvas.provider.register", {
|
|
3511
|
+
register: async (params) => connection.sendRequest("session.canvas.provider.register", { ...params, sessionId }),
|
|
3229
3512
|
/**
|
|
3230
3513
|
* Unregisters an internal canvas provider connection.
|
|
3231
3514
|
*
|
|
3232
3515
|
* @param params Internal canvas provider unregistration parameters.
|
|
3233
3516
|
*/
|
|
3234
|
-
unregister: async (params) => connection.sendRequest("session.canvas.provider.unregister", {
|
|
3517
|
+
unregister: async (params) => connection.sendRequest("session.canvas.provider.unregister", { ...params, sessionId })
|
|
3235
3518
|
}
|
|
3236
3519
|
},
|
|
3237
3520
|
/** @experimental */
|
|
@@ -3243,7 +3526,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3243
3526
|
*
|
|
3244
3527
|
* @returns Complete current or terminal workflow run envelope.
|
|
3245
3528
|
*/
|
|
3246
|
-
runFromTool: async (params) => connection.sendRequest("session.workflow.runFromTool", {
|
|
3529
|
+
runFromTool: async (params) => connection.sendRequest("session.workflow.runFromTool", { ...params, sessionId }),
|
|
3247
3530
|
/**
|
|
3248
3531
|
* Internal tool-originated dynamic workflow resume.
|
|
3249
3532
|
*
|
|
@@ -3251,13 +3534,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3251
3534
|
*
|
|
3252
3535
|
* @returns Resolved persisted workflow identity and resumed run envelope.
|
|
3253
3536
|
*/
|
|
3254
|
-
resumeFromTool: async (params) => connection.sendRequest("session.workflow.resumeFromTool", {
|
|
3537
|
+
resumeFromTool: async (params) => connection.sendRequest("session.workflow.resumeFromTool", { ...params, sessionId }),
|
|
3255
3538
|
/**
|
|
3256
3539
|
* Atomically pauses an owned dynamic workflow attempt at a durable checkpoint.
|
|
3257
3540
|
*
|
|
3258
3541
|
* @param params Parameters for an owned durable pause checkpoint.
|
|
3259
3542
|
*/
|
|
3260
|
-
pauseAtCheckpoint: async (params) => connection.sendRequest("session.workflow.pauseAtCheckpoint", {
|
|
3543
|
+
pauseAtCheckpoint: async (params) => connection.sendRequest("session.workflow.pauseAtCheckpoint", { ...params, sessionId })
|
|
3261
3544
|
},
|
|
3262
3545
|
/** @experimental */
|
|
3263
3546
|
model: {
|
|
@@ -3268,10 +3551,16 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3268
3551
|
*
|
|
3269
3552
|
* @returns The model identifier active on the session after the switch.
|
|
3270
3553
|
*/
|
|
3271
|
-
applyStartupOverlay: async (params) => connection.sendRequest("session.model.applyStartupOverlay", {
|
|
3554
|
+
applyStartupOverlay: async (params) => connection.sendRequest("session.model.applyStartupOverlay", { ...params, sessionId })
|
|
3272
3555
|
},
|
|
3273
3556
|
/** @experimental */
|
|
3274
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 }),
|
|
3275
3564
|
/**
|
|
3276
3565
|
* Reloads MCP server connections for the session with an explicit host-provided configuration.
|
|
3277
3566
|
*
|
|
@@ -3279,7 +3568,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3279
3568
|
*
|
|
3280
3569
|
* @returns MCP server startup filtering result.
|
|
3281
3570
|
*/
|
|
3282
|
-
reloadWithConfig: async (params) => connection.sendRequest("session.mcp.reloadWithConfig", {
|
|
3571
|
+
reloadWithConfig: async (params) => connection.sendRequest("session.mcp.reloadWithConfig", { ...params, sessionId }),
|
|
3283
3572
|
/**
|
|
3284
3573
|
* Configures the built-in GitHub MCP server for the session's current auth context.
|
|
3285
3574
|
*
|
|
@@ -3287,19 +3576,19 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3287
3576
|
*
|
|
3288
3577
|
* @returns Result of configuring GitHub MCP.
|
|
3289
3578
|
*/
|
|
3290
|
-
configureGitHub: async (params) => connection.sendRequest("session.mcp.configureGitHub", {
|
|
3579
|
+
configureGitHub: async (params) => connection.sendRequest("session.mcp.configureGitHub", { ...params, sessionId }),
|
|
3291
3580
|
/**
|
|
3292
3581
|
* Registers a pre-connected external MCP client (e.g. IDE) on the session's host. The caller retains lifecycle ownership of the client and transport. Marked internal because the `client` and `transport` arguments are in-process MCP SDK instances that cannot be serialized across the JSON-RPC boundary; once the CLI moves on top of the SDK, external clients will be expressed as transport configs the runtime can construct itself.
|
|
3293
3582
|
*
|
|
3294
3583
|
* @param params Registration parameters for an external MCP client.
|
|
3295
3584
|
*/
|
|
3296
|
-
registerExternalClient: async (params) => connection.sendRequest("session.mcp.registerExternalClient", {
|
|
3585
|
+
registerExternalClient: async (params) => connection.sendRequest("session.mcp.registerExternalClient", { ...params, sessionId }),
|
|
3297
3586
|
/**
|
|
3298
3587
|
* Unregisters a previously registered external MCP client by server name. Marked internal as the paired companion of `registerExternalClient`: only in-process callers that registered a client this way can meaningfully unregister it. Disappears alongside `registerExternalClient`: once external clients are described to the runtime as config rather than handed in as instances, lifecycle (including deregistration) is owned entirely by the runtime.
|
|
3299
3588
|
*
|
|
3300
3589
|
* @param params Server name identifying the external client to remove.
|
|
3301
3590
|
*/
|
|
3302
|
-
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", {
|
|
3591
|
+
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", { ...params, sessionId })
|
|
3303
3592
|
},
|
|
3304
3593
|
/** @experimental */
|
|
3305
3594
|
connectors: {
|
|
@@ -3310,7 +3599,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3310
3599
|
*
|
|
3311
3600
|
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
3312
3601
|
*/
|
|
3313
|
-
reconcileForStartup: async (params) => connection.sendRequest("session.connectors.reconcileForStartup", {
|
|
3602
|
+
reconcileForStartup: async (params) => connection.sendRequest("session.connectors.reconcileForStartup", { ...params, sessionId }),
|
|
3314
3603
|
/**
|
|
3315
3604
|
* Removes the runtime-owned Connector MCP projection without changing service-side connections.
|
|
3316
3605
|
*
|
|
@@ -3327,7 +3616,34 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3327
3616
|
*
|
|
3328
3617
|
* @returns Whether finalizing the invocation effect succeeded, and the failure reason when it did not.
|
|
3329
3618
|
*/
|
|
3330
|
-
finalizeInvocationEffect: async (params) => connection.sendRequest("session.commands.finalizeInvocationEffect", {
|
|
3619
|
+
finalizeInvocationEffect: async (params) => connection.sendRequest("session.commands.finalizeInvocationEffect", { ...params, sessionId })
|
|
3620
|
+
},
|
|
3621
|
+
/** @experimental */
|
|
3622
|
+
ui: {
|
|
3623
|
+
/**
|
|
3624
|
+
* Resolves a pending elicitation request after direct interaction in the trusted in-process client. Only an accepted response to the built-in ask_user tool can become trusted human evidence.
|
|
3625
|
+
*
|
|
3626
|
+
* @param params Pending elicitation request ID and the user's response (accept/decline/cancel + form values).
|
|
3627
|
+
*
|
|
3628
|
+
* @returns Indicates whether the elicitation response was accepted; false if it was already resolved by another client.
|
|
3629
|
+
*/
|
|
3630
|
+
handleHumanAskUser: async (params) => connection.sendRequest("session.ui.handleHumanAskUser", { ...params, sessionId }),
|
|
3631
|
+
/**
|
|
3632
|
+
* Resolves a pending `user_input.requested` event after direct interaction in the trusted in-process client.
|
|
3633
|
+
*
|
|
3634
|
+
* @param params Request ID of a pending `user_input.requested` event and the user's response.
|
|
3635
|
+
*
|
|
3636
|
+
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
3637
|
+
*/
|
|
3638
|
+
handleHumanUserInput: async (params) => connection.sendRequest("session.ui.handleHumanUserInput", { ...params, sessionId }),
|
|
3639
|
+
/**
|
|
3640
|
+
* Resolves a pending `exit_plan_mode.requested` event after direct interaction in the trusted in-process client.
|
|
3641
|
+
*
|
|
3642
|
+
* @param params Request ID of a pending `exit_plan_mode.requested` event and the user's response.
|
|
3643
|
+
*
|
|
3644
|
+
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
3645
|
+
*/
|
|
3646
|
+
handleHumanExitPlanMode: async (params) => connection.sendRequest("session.ui.handleHumanExitPlanMode", { ...params, sessionId })
|
|
3331
3647
|
},
|
|
3332
3648
|
/** @experimental */
|
|
3333
3649
|
settings: {
|
|
@@ -3344,7 +3660,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3344
3660
|
*
|
|
3345
3661
|
* @returns Result of evaluating a Rust-owned settings predicate.
|
|
3346
3662
|
*/
|
|
3347
|
-
evaluatePredicate: async (params) => connection.sendRequest("session.settings.evaluatePredicate", {
|
|
3663
|
+
evaluatePredicate: async (params) => connection.sendRequest("session.settings.evaluatePredicate", { ...params, sessionId })
|
|
3348
3664
|
},
|
|
3349
3665
|
/** @experimental */
|
|
3350
3666
|
queue: {
|
|
@@ -3367,7 +3683,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3367
3683
|
*
|
|
3368
3684
|
* @returns Whether a deferred-idle drain should run.
|
|
3369
3685
|
*/
|
|
3370
|
-
beginDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.beginDeferredIdleDrain", {
|
|
3686
|
+
beginDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.beginDeferredIdleDrain", { ...params, sessionId }),
|
|
3371
3687
|
/**
|
|
3372
3688
|
* Finishes a native deferred-idle drain and reports whether to drain queue work or emit idle.
|
|
3373
3689
|
*
|
|
@@ -3375,13 +3691,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3375
3691
|
*
|
|
3376
3692
|
* @returns Action selected by the native deferred-idle drain.
|
|
3377
3693
|
*/
|
|
3378
|
-
finishDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.finishDeferredIdleDrain", {
|
|
3694
|
+
finishDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.finishDeferredIdleDrain", { ...params, sessionId }),
|
|
3379
3695
|
/**
|
|
3380
3696
|
* Marks session.idle as deferred by native background work state.
|
|
3381
3697
|
*
|
|
3382
3698
|
* @param params Inputs for marking session.idle deferred in native state.
|
|
3383
3699
|
*/
|
|
3384
|
-
deferSessionIdle: async (params) => connection.sendRequest("session.queue.deferSessionIdle", {
|
|
3700
|
+
deferSessionIdle: async (params) => connection.sendRequest("session.queue.deferSessionIdle", { ...params, sessionId }),
|
|
3385
3701
|
/**
|
|
3386
3702
|
* Consumes queued native system notifications matching an internal filter.
|
|
3387
3703
|
*
|
|
@@ -3389,7 +3705,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3389
3705
|
*
|
|
3390
3706
|
* @returns Indicates whether a user-facing pending item was removed.
|
|
3391
3707
|
*/
|
|
3392
|
-
consumeSystemNotifications: async (params) => connection.sendRequest("session.queue.consumeSystemNotifications", {
|
|
3708
|
+
consumeSystemNotifications: async (params) => connection.sendRequest("session.queue.consumeSystemNotifications", { ...params, sessionId }),
|
|
3393
3709
|
/**
|
|
3394
3710
|
* Enqueues the internal resume-pending wake item when orphan handling needs a follow-up turn.
|
|
3395
3711
|
*
|
|
@@ -3420,7 +3736,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3420
3736
|
*
|
|
3421
3737
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
3422
3738
|
*/
|
|
3423
|
-
add: async (params) => connection.sendRequest("session.schedule.add", {
|
|
3739
|
+
add: async (params) => connection.sendRequest("session.schedule.add", { ...params, sessionId }),
|
|
3424
3740
|
/**
|
|
3425
3741
|
* Registers a recurring cron scheduled prompt.
|
|
3426
3742
|
*
|
|
@@ -3428,7 +3744,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3428
3744
|
*
|
|
3429
3745
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
3430
3746
|
*/
|
|
3431
|
-
addCron: async (params) => connection.sendRequest("session.schedule.addCron", {
|
|
3747
|
+
addCron: async (params) => connection.sendRequest("session.schedule.addCron", { ...params, sessionId }),
|
|
3432
3748
|
/**
|
|
3433
3749
|
* Registers an absolute-time scheduled prompt.
|
|
3434
3750
|
*
|
|
@@ -3436,7 +3752,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3436
3752
|
*
|
|
3437
3753
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
3438
3754
|
*/
|
|
3439
|
-
addAt: async (params) => connection.sendRequest("session.schedule.addAt", {
|
|
3755
|
+
addAt: async (params) => connection.sendRequest("session.schedule.addAt", { ...params, sessionId }),
|
|
3440
3756
|
/**
|
|
3441
3757
|
* Registers a self-paced scheduled prompt.
|
|
3442
3758
|
*
|
|
@@ -3444,7 +3760,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3444
3760
|
*
|
|
3445
3761
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
3446
3762
|
*/
|
|
3447
|
-
addSelfPaced: async (params) => connection.sendRequest("session.schedule.addSelfPaced", {
|
|
3763
|
+
addSelfPaced: async (params) => connection.sendRequest("session.schedule.addSelfPaced", { ...params, sessionId }),
|
|
3448
3764
|
/**
|
|
3449
3765
|
* Re-arms an active self-paced scheduled prompt.
|
|
3450
3766
|
*
|
|
@@ -3452,7 +3768,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3452
3768
|
*
|
|
3453
3769
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
3454
3770
|
*/
|
|
3455
|
-
rearmSelfPaced: async (params) => connection.sendRequest("session.schedule.rearmSelfPaced", {
|
|
3771
|
+
rearmSelfPaced: async (params) => connection.sendRequest("session.schedule.rearmSelfPaced", { ...params, sessionId })
|
|
3456
3772
|
}
|
|
3457
3773
|
};
|
|
3458
3774
|
}
|
|
@@ -3482,11 +3798,21 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
3482
3798
|
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
|
|
3483
3799
|
return handler.readFile(params);
|
|
3484
3800
|
});
|
|
3801
|
+
connection.onRequest("sessionFs.readFileBytes", async (params) => {
|
|
3802
|
+
const handler = getHandlers(params.sessionId).sessionFs;
|
|
3803
|
+
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
|
|
3804
|
+
return handler.readFileBytes(params);
|
|
3805
|
+
});
|
|
3485
3806
|
connection.onRequest("sessionFs.writeFile", async (params) => {
|
|
3486
3807
|
const handler = getHandlers(params.sessionId).sessionFs;
|
|
3487
3808
|
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
|
|
3488
3809
|
return handler.writeFile(params);
|
|
3489
3810
|
});
|
|
3811
|
+
connection.onRequest("sessionFs.writeFileBytes", async (params) => {
|
|
3812
|
+
const handler = getHandlers(params.sessionId).sessionFs;
|
|
3813
|
+
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
|
|
3814
|
+
return handler.writeFileBytes(params);
|
|
3815
|
+
});
|
|
3490
3816
|
connection.onRequest("sessionFs.appendFile", async (params) => {
|
|
3491
3817
|
const handler = getHandlers(params.sessionId).sessionFs;
|
|
3492
3818
|
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
|