@github/copilot-sdk 1.0.15-unstable.35395657398.gad69ee1 → 1.0.15
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 +56 -4
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +37 -6
- package/dist/cjs/copilotRequestHandler.js +156 -20
- package/dist/cjs/extension.js +9 -9
- package/dist/cjs/generated/rpc.js +582 -111
- package/dist/cjs/index.js +7 -7
- package/dist/cjs/installationConfirmation.js +98 -0
- package/dist/cjs/session.js +122 -135
- package/dist/cjs/{factory.js → workflow.js} +33 -33
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.d.ts +3 -0
- package/dist/client.js +39 -6
- package/dist/copilotRequestHandler.js +156 -20
- package/dist/extension.d.ts +6 -6
- package/dist/extension.js +9 -9
- package/dist/generated/rpc.d.ts +16537 -12361
- package/dist/generated/rpc.js +582 -111
- package/dist/generated/session-events.d.ts +780 -120
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/installationConfirmation.d.ts +19 -0
- package/dist/installationConfirmation.js +77 -0
- package/dist/session.d.ts +10 -16
- package/dist/session.js +126 -139
- package/dist/types.d.ts +46 -69
- package/dist/workflow.d.ts +367 -0
- package/dist/{factory.js → workflow.js} +25 -25
- package/docs/extensions.md +1 -1
- package/docs/workflows.md +255 -0
- package/package.json +11 -10
- package/dist/factory.d.ts +0 -327
- package/docs/factories.md +0 -296
- package/docs/factory-patterns.md +0 -194
package/dist/generated/rpc.js
CHANGED
|
@@ -39,6 +39,15 @@ function createServerRpc(connection) {
|
|
|
39
39
|
getBuiltInCatalog: async () => connection.sendRequest("models.getBuiltInCatalog", {})
|
|
40
40
|
},
|
|
41
41
|
/** @experimental */
|
|
42
|
+
sandbox: {
|
|
43
|
+
/**
|
|
44
|
+
* Reports whether the host running this runtime can run the command sandbox, without starting a session or spawning a sandboxed command.
|
|
45
|
+
*
|
|
46
|
+
* @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.
|
|
47
|
+
*/
|
|
48
|
+
getHostSupport: async () => connection.sendRequest("sandbox.getHostSupport", {})
|
|
49
|
+
},
|
|
50
|
+
/** @experimental */
|
|
42
51
|
tools: {
|
|
43
52
|
/**
|
|
44
53
|
* Lists built-in tools available for a model.
|
|
@@ -159,7 +168,74 @@ function createServerRpc(connection) {
|
|
|
159
168
|
*
|
|
160
169
|
* @returns Outcome of an mcp.planInstall call: either a normalised plan, or one typed refusal. Nothing is written in either case.
|
|
161
170
|
*/
|
|
162
|
-
planInstall: async (params) => connection.sendRequest("mcp.planInstall", params)
|
|
171
|
+
planInstall: async (params) => connection.sendRequest("mcp.planInstall", params),
|
|
172
|
+
/**
|
|
173
|
+
* Consumes a bound catalogue plan and retains one exact fully resolved personal remote MCP operation requiring no supplied values or configured secrets. Returns its runtime operation ID and original expiry before any confirmation, activation, writer initialisation or installation effect. Register the original connection, operation and selected-session binding before calling applyInstall. Missing lower owned admission is unavailable, never a raw-config fallback.
|
|
174
|
+
*
|
|
175
|
+
* @param params Side-effect-free preparation of one original bound remote MCP choice.
|
|
176
|
+
*
|
|
177
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
178
|
+
*/
|
|
179
|
+
prepareInstall: async (params) => connection.sendRequest("mcp.prepareInstall", params),
|
|
180
|
+
/**
|
|
181
|
+
* Consumes a retained prepared MCP operation once, revalidates its original authority, requests explicit human consent through installations.confirm on the original connection, then revalidates source and applies the sealed transaction. An uncertain result requires original-operation inspection or recovery, never replay.
|
|
182
|
+
*
|
|
183
|
+
* @param params Applies exactly one previously prepared operation on its original connection.
|
|
184
|
+
*
|
|
185
|
+
* @returns An installation result together with the exact honoured contract, or a negotiation refusal.
|
|
186
|
+
*/
|
|
187
|
+
applyInstall: async (params) => connection.sendRequest("mcp.applyInstall", params),
|
|
188
|
+
/**
|
|
189
|
+
* Prepares a read-only removal plan for an exact owned receipt under the selected existing session. Returns the original operation ID before confirmation; neither planning nor abandonment changes configuration or shared OAuth credentials.
|
|
190
|
+
*
|
|
191
|
+
* @param params Read-only preparation of one owned removal under fresh selected-session authority.
|
|
192
|
+
*
|
|
193
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
194
|
+
*/
|
|
195
|
+
planUninstall: async (params) => connection.sendRequest("mcp.planUninstall", params),
|
|
196
|
+
/**
|
|
197
|
+
* Consumes the original owned-removal plan once and requests fresh exact human confirmation on its original connection. Drift is refused; unrelated manual configuration and shared OAuth credentials are preserved.
|
|
198
|
+
*
|
|
199
|
+
* @param params One-use application of the exact retained removal plan.
|
|
200
|
+
*
|
|
201
|
+
* @returns An installation result together with the exact honoured contract, or a negotiation refusal.
|
|
202
|
+
*/
|
|
203
|
+
applyUninstall: async (params) => connection.sendRequest("mcp.applyUninstall", params),
|
|
204
|
+
/** @experimental */
|
|
205
|
+
installations: {
|
|
206
|
+
/**
|
|
207
|
+
* Reads receipt-owned MCP inventory for the selected account and host without activating servers or reconstructing missing ownership. Configuration ownership does not prove session-specific usability.
|
|
208
|
+
*
|
|
209
|
+
* @param params New-work inventory or recovery request under an explicitly selected existing session.
|
|
210
|
+
*
|
|
211
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
212
|
+
*/
|
|
213
|
+
list: async (params) => connection.sendRequest("mcp.installations.list", params),
|
|
214
|
+
/**
|
|
215
|
+
* Reconciles already-confirmed durable MCP transactions, then inspects owned inventory. Does not replay apply or reconstruct deleted ownership metadata; unresolved or unsafe evidence remains an explicit refusal.
|
|
216
|
+
*
|
|
217
|
+
* @param params New-work inventory or recovery request under an explicitly selected existing session.
|
|
218
|
+
*
|
|
219
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
220
|
+
*/
|
|
221
|
+
recover: async (params) => connection.sendRequest("mcp.installations.recover", params),
|
|
222
|
+
/**
|
|
223
|
+
* Inspects a known operation only on its original connection. Remains available after account or selected-session loss; does not acquire new authority or rebind an operation.
|
|
224
|
+
*
|
|
225
|
+
* @param params Existing-operation control. A new session selector is deliberately not accepted.
|
|
226
|
+
*
|
|
227
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
228
|
+
*/
|
|
229
|
+
status: async (params) => connection.sendRequest("mcp.installations.status", params),
|
|
230
|
+
/**
|
|
231
|
+
* Requests cancellation of a known operation on its original connection, including before apply or confirmation. Already-started effects retain their transaction lease and report an honest terminal or recovery outcome.
|
|
232
|
+
*
|
|
233
|
+
* @param params Existing-operation control. A new session selector is deliberately not accepted.
|
|
234
|
+
*
|
|
235
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
236
|
+
*/
|
|
237
|
+
cancel: async (params) => connection.sendRequest("mcp.installations.cancel", params)
|
|
238
|
+
}
|
|
163
239
|
},
|
|
164
240
|
/** @experimental */
|
|
165
241
|
extensions: {
|
|
@@ -182,6 +258,115 @@ function createServerRpc(connection) {
|
|
|
182
258
|
*/
|
|
183
259
|
disable: async (params) => connection.sendRequest("extensions.disable", params)
|
|
184
260
|
},
|
|
261
|
+
/** @experimental */
|
|
262
|
+
skills: {
|
|
263
|
+
/**
|
|
264
|
+
* Plans installation of a verified Agent Finder Skill candidate without writing files. The returned review is safe to present to a user and installing always leaves the Skill disabled until separately enabled.
|
|
265
|
+
*
|
|
266
|
+
* @param params Side-effect-free planning of one verified Agent Finder Skill candidate.
|
|
267
|
+
*
|
|
268
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
269
|
+
*/
|
|
270
|
+
planInstall: async (params) => connection.sendRequest("skills.planInstall", params),
|
|
271
|
+
/**
|
|
272
|
+
* Consumes one verified Skill installation plan, requests explicit human consent through installations.confirm on the original connection, then revalidates and installs the Skill disabled.
|
|
273
|
+
*
|
|
274
|
+
* @param params Applies exactly one retained verified Skill installation plan.
|
|
275
|
+
*
|
|
276
|
+
* @returns Skill installation result with the honoured contract, or a typed request/negotiation refusal.
|
|
277
|
+
*/
|
|
278
|
+
applyInstall: async (params) => connection.sendRequest("skills.applyInstall", params),
|
|
279
|
+
/** @experimental */
|
|
280
|
+
installations: {
|
|
281
|
+
/**
|
|
282
|
+
* Lists owned verified Agent Finder Skill installations for the selected existing session. Listing is never gated by the Skill-install feature flag.
|
|
283
|
+
*
|
|
284
|
+
* @param params Inventory request under an explicitly selected existing session.
|
|
285
|
+
*
|
|
286
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
287
|
+
*/
|
|
288
|
+
list: async (params) => connection.sendRequest("skills.installations.list", params),
|
|
289
|
+
/**
|
|
290
|
+
* Reconciles interrupted owned Skill installation work for the selected existing session, then inspects owned inventory. Recovery is never gated by the Skill-install feature flag.
|
|
291
|
+
*
|
|
292
|
+
* @param params Inventory request under an explicitly selected existing session.
|
|
293
|
+
*
|
|
294
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
295
|
+
*/
|
|
296
|
+
recover: async (params) => connection.sendRequest("skills.installations.recover", params),
|
|
297
|
+
/**
|
|
298
|
+
* Inspects a known Skill installation operation on its original runtime connection. Status is never gated by the Skill-install feature flag.
|
|
299
|
+
*
|
|
300
|
+
* @param params Existing-operation control. A new session selector is deliberately not accepted.
|
|
301
|
+
*
|
|
302
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
303
|
+
*/
|
|
304
|
+
status: async (params) => connection.sendRequest("skills.installations.status", params),
|
|
305
|
+
/**
|
|
306
|
+
* Requests cancellation of a known Skill installation operation before commit. Already-started durable work requires recovery instead of silent replay.
|
|
307
|
+
*
|
|
308
|
+
* @param params Existing-operation control. A new session selector is deliberately not accepted.
|
|
309
|
+
*
|
|
310
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
311
|
+
*/
|
|
312
|
+
cancel: async (params) => connection.sendRequest("skills.installations.cancel", params),
|
|
313
|
+
/**
|
|
314
|
+
* Atomically persists enablement for one owned Agent Finder Skill and reconciles the selected bound session. Enablement is installation-scoped by receipt identity and is never gated by the Skill-install feature flag.
|
|
315
|
+
*
|
|
316
|
+
* @param params Persisted enablement update for one owned Skill installation.
|
|
317
|
+
*
|
|
318
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
319
|
+
*/
|
|
320
|
+
setEnabled: async (params) => connection.sendRequest("skills.installations.setEnabled", params)
|
|
321
|
+
},
|
|
322
|
+
/**
|
|
323
|
+
* Prepares a read-only removal plan for an owned verified Agent Finder Skill installation. Uninstall planning is never gated by the Skill-install feature flag.
|
|
324
|
+
*
|
|
325
|
+
* @param params Read-only preparation of one owned Skill removal under fresh selected-session authority.
|
|
326
|
+
*
|
|
327
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
328
|
+
*/
|
|
329
|
+
planUninstall: async (params) => connection.sendRequest("skills.planUninstall", params),
|
|
330
|
+
/**
|
|
331
|
+
* Consumes an owned Skill removal plan, requests explicit human consent through installations.confirm, refuses drift, and removes the exact owned files through quarantine.
|
|
332
|
+
*
|
|
333
|
+
* @param params One-use application of the exact retained Skill removal plan.
|
|
334
|
+
*
|
|
335
|
+
* @returns Skill installation result with the honoured contract, or a typed request/negotiation refusal.
|
|
336
|
+
*/
|
|
337
|
+
applyUninstall: async (params) => connection.sendRequest("skills.applyUninstall", params),
|
|
338
|
+
/** @experimental */
|
|
339
|
+
config: {
|
|
340
|
+
/**
|
|
341
|
+
* Replaces the global list of disabled skills.
|
|
342
|
+
*
|
|
343
|
+
* @param params Skill names to mark as disabled in global configuration, replacing any previous list.
|
|
344
|
+
*/
|
|
345
|
+
setDisabledSkills: async (params) => connection.sendRequest("skills.config.setDisabledSkills", params),
|
|
346
|
+
/**
|
|
347
|
+
* Atomically adds or removes one skill from the disabled list.
|
|
348
|
+
*
|
|
349
|
+
* @param params Adds or removes a single skill from the global disabled list, leaving every other entry untouched.
|
|
350
|
+
*/
|
|
351
|
+
setSkillDisabled: async (params) => connection.sendRequest("skills.config.setSkillDisabled", params)
|
|
352
|
+
},
|
|
353
|
+
/**
|
|
354
|
+
* Discovers skills across global and project sources.
|
|
355
|
+
*
|
|
356
|
+
* @param params Optional project paths and additional skill directories to include in discovery.
|
|
357
|
+
*
|
|
358
|
+
* @returns Skills discovered across global and project sources.
|
|
359
|
+
*/
|
|
360
|
+
discover: async (params) => connection.sendRequest("skills.discover", params),
|
|
361
|
+
/**
|
|
362
|
+
* Returns the canonical directories where a client may create skills that the runtime will recognize, including ones that do not exist yet. Project directories become active once created.
|
|
363
|
+
*
|
|
364
|
+
* @param params Optional project paths to enumerate.
|
|
365
|
+
*
|
|
366
|
+
* @returns Canonical locations where skills can be created so the runtime will recognize them.
|
|
367
|
+
*/
|
|
368
|
+
getDiscoveryPaths: async (params) => connection.sendRequest("skills.getDiscoveryPaths", params)
|
|
369
|
+
},
|
|
185
370
|
/**
|
|
186
371
|
* Registers the calling SDK client as the per-entrypoint extension launch provider. Call before creating any sessions. When omitted, the runtime uses its built-in extension launcher.
|
|
187
372
|
*
|
|
@@ -197,7 +382,15 @@ function createServerRpc(connection) {
|
|
|
197
382
|
*
|
|
198
383
|
* @returns Outcome of a catalog.search call: either bounded inert candidates, or one typed refusal. Never a partial success.
|
|
199
384
|
*/
|
|
200
|
-
search: async (params) => connection.sendRequest("catalog.search", params)
|
|
385
|
+
search: async (params) => connection.sendRequest("catalog.search", params),
|
|
386
|
+
/**
|
|
387
|
+
* Terminates one retained catalog selection group. A selected outcome returns the native host a fresh single-use candidate handle plus the original searchId for a later explicit mcp.planInstall call; non-selected outcomes release the group without producing a planning input. Candidate state, cards, URLs, credentials and private identifiers remain inside the runtime. The model-facing catalog_select tool projects the result separately and never exposes the candidate handle or searchId.
|
|
388
|
+
*
|
|
389
|
+
* @param params Terminates one retained catalog selection group through an opaque reference previously returned by the model-safe search projection.
|
|
390
|
+
*
|
|
391
|
+
* @returns Typed outcome of catalog.select. Only the selected host result carries a fresh candidate handle; the model-facing projection removes both that handle and searchId.
|
|
392
|
+
*/
|
|
393
|
+
select: async (params) => connection.sendRequest("catalog.select", params)
|
|
201
394
|
},
|
|
202
395
|
/** @experimental */
|
|
203
396
|
plugins: {
|
|
@@ -299,40 +492,6 @@ function createServerRpc(connection) {
|
|
|
299
492
|
}
|
|
300
493
|
},
|
|
301
494
|
/** @experimental */
|
|
302
|
-
skills: {
|
|
303
|
-
/** @experimental */
|
|
304
|
-
config: {
|
|
305
|
-
/**
|
|
306
|
-
* Replaces the global list of disabled skills.
|
|
307
|
-
*
|
|
308
|
-
* @param params Skill names to mark as disabled in global configuration, replacing any previous list.
|
|
309
|
-
*/
|
|
310
|
-
setDisabledSkills: async (params) => connection.sendRequest("skills.config.setDisabledSkills", params),
|
|
311
|
-
/**
|
|
312
|
-
* Atomically adds or removes one skill from the disabled list.
|
|
313
|
-
*
|
|
314
|
-
* @param params Adds or removes a single skill from the global disabled list, leaving every other entry untouched.
|
|
315
|
-
*/
|
|
316
|
-
setSkillDisabled: async (params) => connection.sendRequest("skills.config.setSkillDisabled", params)
|
|
317
|
-
},
|
|
318
|
-
/**
|
|
319
|
-
* Discovers skills across global and project sources.
|
|
320
|
-
*
|
|
321
|
-
* @param params Optional project paths and additional skill directories to include in discovery.
|
|
322
|
-
*
|
|
323
|
-
* @returns Skills discovered across global and project sources.
|
|
324
|
-
*/
|
|
325
|
-
discover: async (params) => connection.sendRequest("skills.discover", params),
|
|
326
|
-
/**
|
|
327
|
-
* Returns the canonical directories where a client may create skills that the runtime will recognize, including ones that do not exist yet. Project directories become active once created.
|
|
328
|
-
*
|
|
329
|
-
* @param params Optional project paths to enumerate.
|
|
330
|
-
*
|
|
331
|
-
* @returns Canonical locations where skills can be created so the runtime will recognize them.
|
|
332
|
-
*/
|
|
333
|
-
getDiscoveryPaths: async (params) => connection.sendRequest("skills.getDiscoveryPaths", params)
|
|
334
|
-
},
|
|
335
|
-
/** @experimental */
|
|
336
495
|
agents: {
|
|
337
496
|
/**
|
|
338
497
|
* Discovers custom agents across user, project, plugin, and remote sources.
|
|
@@ -428,7 +587,7 @@ function createServerRpc(connection) {
|
|
|
428
587
|
/**
|
|
429
588
|
* Registers an SDK client as the session filesystem provider.
|
|
430
589
|
*
|
|
431
|
-
* @param params Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider.
|
|
590
|
+
* @param params Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider. A registered provider is authoritative for path interpretation and filesystem facts used by workspace permission validation. Paths are interpreted lexically; home-relative paths (`~` and `~/...`) and Windows drive-relative paths such as `C:foo` are unsupported. Until provider-side canonicalization is supported, providers must not expose symlinks inside allowed roots that escape those roots.
|
|
432
591
|
*
|
|
433
592
|
* @returns Indicates whether the calling client was registered as the session filesystem provider.
|
|
434
593
|
*/
|
|
@@ -737,6 +896,17 @@ function createInternalServerRpc(connection) {
|
|
|
737
896
|
* @param params Params to attach or detach an in-process ExtensionController delegate.
|
|
738
897
|
*/
|
|
739
898
|
configureSessionExtensions: async (params) => connection.sendRequest("sessions.configureSessionExtensions", params)
|
|
899
|
+
},
|
|
900
|
+
/** @experimental */
|
|
901
|
+
accounts: {
|
|
902
|
+
/**
|
|
903
|
+
* 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).
|
|
904
|
+
*
|
|
905
|
+
* @param params OneAuth token request supplied by a trusted host application.
|
|
906
|
+
*
|
|
907
|
+
* @returns Result of a OneAuth token acquisition.
|
|
908
|
+
*/
|
|
909
|
+
acquireEntraToken: async (params) => connection.sendRequest("accounts.acquireEntraToken", params)
|
|
740
910
|
}
|
|
741
911
|
};
|
|
742
912
|
}
|
|
@@ -839,6 +1009,58 @@ function createSessionRpc(connection, sessionId) {
|
|
|
839
1009
|
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", { sessionId, ...params })
|
|
840
1010
|
},
|
|
841
1011
|
/** @experimental */
|
|
1012
|
+
accounts: {
|
|
1013
|
+
/**
|
|
1014
|
+
* Enumerate a typed accounts collection: the signed-in accounts, or the providers offered for interactive login.
|
|
1015
|
+
*
|
|
1016
|
+
* @param params Enumerate request carrying the typed collection query.
|
|
1017
|
+
*
|
|
1018
|
+
* @returns The enumerated collection, keyed by the same selector as the query.
|
|
1019
|
+
*/
|
|
1020
|
+
enumerate: async (params) => connection.sendRequest("session.accounts.enumerate", { sessionId, ...params }),
|
|
1021
|
+
/**
|
|
1022
|
+
* Read one typed accounts datum: the active account, a neutral status summary, or the last authentication errors.
|
|
1023
|
+
*
|
|
1024
|
+
* @param params Read request carrying the typed datum query.
|
|
1025
|
+
*
|
|
1026
|
+
* @returns The read result, keyed by the same selector as the query.
|
|
1027
|
+
*/
|
|
1028
|
+
get: async (params) => connection.sendRequest("session.accounts.get", { sessionId, ...params }),
|
|
1029
|
+
/**
|
|
1030
|
+
* Apply one non-interactive accounts mutation: switch the active account, log an account out, or set credentials from a token.
|
|
1031
|
+
*
|
|
1032
|
+
* @param params Mutation request carrying the typed write command.
|
|
1033
|
+
*
|
|
1034
|
+
* @returns Result of a non-interactive accounts mutation.
|
|
1035
|
+
*/
|
|
1036
|
+
set: async (params) => connection.sendRequest("session.accounts.set", { sessionId, ...params }),
|
|
1037
|
+
/** @experimental */
|
|
1038
|
+
login: {
|
|
1039
|
+
/**
|
|
1040
|
+
* Begin an interactive login flow for a provider kind (dispatch is kind-only) and return its opaque flow id and first step.
|
|
1041
|
+
*
|
|
1042
|
+
* @param params Begin an interactive login flow for a provider kind. Dispatch is kind-only.
|
|
1043
|
+
*
|
|
1044
|
+
* @returns A started login flow: its opaque id and first step.
|
|
1045
|
+
*/
|
|
1046
|
+
begin: async (params) => connection.sendRequest("session.accounts.login.begin", { sessionId, ...params }),
|
|
1047
|
+
/**
|
|
1048
|
+
* Advance an in-flight login flow, optionally fulfilling an input-required step, and return the next step.
|
|
1049
|
+
*
|
|
1050
|
+
* @param params Advance an in-flight login flow, optionally fulfilling an input-required step.
|
|
1051
|
+
*
|
|
1052
|
+
* @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).
|
|
1053
|
+
*/
|
|
1054
|
+
advance: async (params) => connection.sendRequest("session.accounts.login.advance", { sessionId, ...params }),
|
|
1055
|
+
/**
|
|
1056
|
+
* Cancel an in-flight login flow and release its resources.
|
|
1057
|
+
*
|
|
1058
|
+
* @param params Cancel an in-flight login flow.
|
|
1059
|
+
*/
|
|
1060
|
+
cancel: async (params) => connection.sendRequest("session.accounts.login.cancel", { sessionId, ...params })
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
/** @experimental */
|
|
842
1064
|
debug: {
|
|
843
1065
|
/**
|
|
844
1066
|
* Collects a session debug log bundle into a local archive or staging directory. Logs are redacted by default; redaction can be configured per caller-provided diagnostic entry. The runtime includes session-owned logs by default and accepts caller-provided diagnostic entries so host applications can add their own files without changing this API shape.
|
|
@@ -890,105 +1112,105 @@ function createSessionRpc(connection, sessionId) {
|
|
|
890
1112
|
}
|
|
891
1113
|
},
|
|
892
1114
|
/** @experimental */
|
|
893
|
-
|
|
1115
|
+
workflow: {
|
|
894
1116
|
/**
|
|
895
|
-
* Runs a registered
|
|
1117
|
+
* Runs a registered dynamic workflow by name at the top level.
|
|
896
1118
|
*
|
|
897
|
-
* @param params Parameters for invoking a registered
|
|
1119
|
+
* @param params Parameters for invoking a registered workflow.
|
|
898
1120
|
*
|
|
899
|
-
* @returns Complete current or terminal
|
|
1121
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
900
1122
|
*/
|
|
901
|
-
run: async (params) => connection.sendRequest("session.
|
|
1123
|
+
run: async (params) => connection.sendRequest("session.workflow.run", { sessionId, ...params }),
|
|
902
1124
|
/**
|
|
903
|
-
* Resumes a
|
|
1125
|
+
* Resumes a dynamic workflow run using its persisted name, arguments, journal, and accounting.
|
|
904
1126
|
*
|
|
905
|
-
* @param params Parameters for resuming a
|
|
1127
|
+
* @param params Parameters for resuming a workflow run from its persisted identity.
|
|
906
1128
|
*
|
|
907
|
-
* @returns Resolved persisted
|
|
1129
|
+
* @returns Resolved persisted workflow identity and resumed run envelope.
|
|
908
1130
|
*/
|
|
909
|
-
resume: async (params) => connection.sendRequest("session.
|
|
1131
|
+
resume: async (params) => connection.sendRequest("session.workflow.resume", { sessionId, ...params }),
|
|
910
1132
|
/**
|
|
911
|
-
* Gets the current or settled envelope for a
|
|
1133
|
+
* Gets the current or settled envelope for a dynamic workflow run.
|
|
912
1134
|
*
|
|
913
|
-
* @param params Parameters for retrieving a
|
|
1135
|
+
* @param params Parameters for retrieving a workflow run.
|
|
914
1136
|
*
|
|
915
|
-
* @returns Complete current or terminal
|
|
1137
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
916
1138
|
*/
|
|
917
|
-
getRun: async (params) => connection.sendRequest("session.
|
|
1139
|
+
getRun: async (params) => connection.sendRequest("session.workflow.getRun", { sessionId, ...params }),
|
|
918
1140
|
/**
|
|
919
|
-
* Lists durable
|
|
1141
|
+
* Lists durable dynamic workflow runs for this session in creation order.
|
|
920
1142
|
*
|
|
921
|
-
* @param params Parameters for paging
|
|
1143
|
+
* @param params Parameters for paging workflow runs.
|
|
922
1144
|
*
|
|
923
|
-
* @returns A page of
|
|
1145
|
+
* @returns A page of workflow runs in durable creation order.
|
|
924
1146
|
*/
|
|
925
|
-
listRuns: async (params) => connection.sendRequest("session.
|
|
1147
|
+
listRuns: async (params) => connection.sendRequest("session.workflow.listRuns", { sessionId, ...params }),
|
|
926
1148
|
/**
|
|
927
|
-
* Gets durable and live observability detail for one
|
|
1149
|
+
* Gets durable and live observability detail for one dynamic workflow run.
|
|
928
1150
|
*
|
|
929
|
-
* @param params Parameters for retrieving a
|
|
1151
|
+
* @param params Parameters for retrieving a workflow run.
|
|
930
1152
|
*
|
|
931
|
-
* @returns Full
|
|
1153
|
+
* @returns Full workflow run observability detail.
|
|
932
1154
|
*/
|
|
933
|
-
getRunDetail: async (params) => connection.sendRequest("session.
|
|
1155
|
+
getRunDetail: async (params) => connection.sendRequest("session.workflow.getRunDetail", { sessionId, ...params }),
|
|
934
1156
|
/**
|
|
935
|
-
* Pages durable progress for one
|
|
1157
|
+
* Pages durable progress for one dynamic workflow run.
|
|
936
1158
|
*
|
|
937
|
-
* @param params Parameters for paging
|
|
1159
|
+
* @param params Parameters for paging workflow progress.
|
|
938
1160
|
*
|
|
939
|
-
* @returns A bidirectional page of
|
|
1161
|
+
* @returns A bidirectional page of workflow progress.
|
|
940
1162
|
*/
|
|
941
|
-
getRunProgress: async (params) => connection.sendRequest("session.
|
|
1163
|
+
getRunProgress: async (params) => connection.sendRequest("session.workflow.getRunProgress", { sessionId, ...params }),
|
|
942
1164
|
/**
|
|
943
|
-
* Requests cancellation of a
|
|
1165
|
+
* Requests cancellation of a dynamic workflow run and returns its run envelope.
|
|
944
1166
|
*
|
|
945
|
-
* @param params Parameters for cancelling a
|
|
1167
|
+
* @param params Parameters for cancelling a workflow run.
|
|
946
1168
|
*
|
|
947
|
-
* @returns Complete current or terminal
|
|
1169
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
948
1170
|
*/
|
|
949
|
-
cancel: async (params) => connection.sendRequest("session.
|
|
1171
|
+
cancel: async (params) => connection.sendRequest("session.workflow.cancel", { sessionId, ...params }),
|
|
950
1172
|
/**
|
|
951
|
-
* Pauses a running
|
|
1173
|
+
* Pauses a running dynamic workflow and returns its settled run envelope.
|
|
952
1174
|
*
|
|
953
|
-
* @param params Parameters for pausing a running
|
|
1175
|
+
* @param params Parameters for pausing a running workflow.
|
|
954
1176
|
*
|
|
955
|
-
* @returns Complete current or terminal
|
|
1177
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
956
1178
|
*/
|
|
957
|
-
pause: async (params) => connection.sendRequest("session.
|
|
1179
|
+
pause: async (params) => connection.sendRequest("session.workflow.pause", { sessionId, ...params }),
|
|
958
1180
|
/**
|
|
959
|
-
* Records a batch of ordered
|
|
1181
|
+
* Records a batch of ordered dynamic workflow progress lines.
|
|
960
1182
|
*
|
|
961
|
-
* @param params Parameters for recording
|
|
1183
|
+
* @param params Parameters for recording workflow progress.
|
|
962
1184
|
*
|
|
963
|
-
* @returns Acknowledgement that a
|
|
1185
|
+
* @returns Acknowledgement that a workflow request was accepted.
|
|
964
1186
|
*/
|
|
965
|
-
log: async (params) => connection.sendRequest("session.
|
|
1187
|
+
log: async (params) => connection.sendRequest("session.workflow.log", { sessionId, ...params }),
|
|
966
1188
|
/**
|
|
967
|
-
* Runs one
|
|
1189
|
+
* Runs one dynamic-workflow-scoped subagent and returns its result.
|
|
968
1190
|
*
|
|
969
|
-
* @param params Parameters for one
|
|
1191
|
+
* @param params Parameters for one workflow-scoped subagent call.
|
|
970
1192
|
*
|
|
971
|
-
* @returns Result of one
|
|
1193
|
+
* @returns Result of one workflow-scoped subagent call.
|
|
972
1194
|
*/
|
|
973
|
-
agent: async (params) => connection.sendRequest("session.
|
|
1195
|
+
agent: async (params) => connection.sendRequest("session.workflow.agent", { sessionId, ...params }),
|
|
974
1196
|
/** @experimental */
|
|
975
1197
|
journal: {
|
|
976
1198
|
/**
|
|
977
|
-
* Reads a memoized
|
|
1199
|
+
* Reads a memoized dynamic workflow journal entry.
|
|
978
1200
|
*
|
|
979
|
-
* @param params Parameters for reading a
|
|
1201
|
+
* @param params Parameters for reading a workflow journal entry.
|
|
980
1202
|
*
|
|
981
|
-
* @returns Result of reading a
|
|
1203
|
+
* @returns Result of reading a workflow journal entry.
|
|
982
1204
|
*/
|
|
983
|
-
get: async (params) => connection.sendRequest("session.
|
|
1205
|
+
get: async (params) => connection.sendRequest("session.workflow.journal.get", { sessionId, ...params }),
|
|
984
1206
|
/**
|
|
985
|
-
* Stores a memoized
|
|
1207
|
+
* Stores a memoized dynamic workflow journal entry.
|
|
986
1208
|
*
|
|
987
|
-
* @param params Parameters for storing a
|
|
1209
|
+
* @param params Parameters for storing a workflow journal entry.
|
|
988
1210
|
*
|
|
989
|
-
* @returns Acknowledgement that a
|
|
1211
|
+
* @returns Acknowledgement that a workflow request was accepted.
|
|
990
1212
|
*/
|
|
991
|
-
put: async (params) => connection.sendRequest("session.
|
|
1213
|
+
put: async (params) => connection.sendRequest("session.workflow.journal.put", { sessionId, ...params })
|
|
992
1214
|
}
|
|
993
1215
|
},
|
|
994
1216
|
/** @experimental */
|
|
@@ -1287,7 +1509,20 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1287
1509
|
*
|
|
1288
1510
|
* @returns Instruction sources loaded for the session, in merge order.
|
|
1289
1511
|
*/
|
|
1290
|
-
getSources: async () => connection.sendRequest("session.instructions.getSources", { sessionId })
|
|
1512
|
+
getSources: async () => connection.sendRequest("session.instructions.getSources", { sessionId }),
|
|
1513
|
+
/**
|
|
1514
|
+
* Invalidates cached custom-instruction discovery so subsequent turns and source reads observe instruction files currently on disk.
|
|
1515
|
+
*/
|
|
1516
|
+
reload: async () => connection.sendRequest("session.instructions.reload", { sessionId })
|
|
1517
|
+
},
|
|
1518
|
+
/** @experimental */
|
|
1519
|
+
customizations: {
|
|
1520
|
+
/**
|
|
1521
|
+
* Reloads all repository and user customizations for the active session: instructions, plugins and their MCP servers and hooks, custom agents, extensions, and skills. Returns diagnostics from the final skill reload.
|
|
1522
|
+
*
|
|
1523
|
+
* @returns Diagnostics from reloading skill definitions, with warnings and errors as separate lists.
|
|
1524
|
+
*/
|
|
1525
|
+
reload: async () => connection.sendRequest("session.customizations.reload", { sessionId })
|
|
1291
1526
|
},
|
|
1292
1527
|
/** @experimental */
|
|
1293
1528
|
fleet: {
|
|
@@ -1586,7 +1821,15 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1586
1821
|
*/
|
|
1587
1822
|
authenticationStateChanged: async (params) => connection.sendRequest("session.mcp.oauth.authenticationStateChanged", { sessionId, ...params }),
|
|
1588
1823
|
/**
|
|
1589
|
-
*
|
|
1824
|
+
* 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.
|
|
1825
|
+
*
|
|
1826
|
+
* @param params Effect-free preparation bound to the existing local session, requester and installation, with frozen options.
|
|
1827
|
+
*
|
|
1828
|
+
* @returns An inert runtime-issued login handle. Preparation alone performs no activation or OAuth work.
|
|
1829
|
+
*/
|
|
1830
|
+
prepareLogin: async (params) => connection.sendRequest("session.mcp.oauth.prepareLogin", { sessionId, ...params }),
|
|
1831
|
+
/**
|
|
1832
|
+
* 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.
|
|
1590
1833
|
*
|
|
1591
1834
|
* @param params Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection.
|
|
1592
1835
|
*
|
|
@@ -1601,6 +1844,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1601
1844
|
* @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.
|
|
1602
1845
|
*/
|
|
1603
1846
|
probe: async (params) => connection.sendRequest("session.mcp.oauth.probe", { sessionId, ...params }),
|
|
1847
|
+
/**
|
|
1848
|
+
* Cancels the exact owned OAuth login issued to this original session requester, without clearing shared credentials.
|
|
1849
|
+
*
|
|
1850
|
+
* @param params Targets only the original prepared/applying owned login on this exact session requester.
|
|
1851
|
+
*
|
|
1852
|
+
* @returns Honest terminal cancellation result; persistence or recovery failures remain RPC errors.
|
|
1853
|
+
*/
|
|
1854
|
+
cancelLogin: async (params) => connection.sendRequest("session.mcp.oauth.cancelLogin", { sessionId, ...params }),
|
|
1604
1855
|
/**
|
|
1605
1856
|
* Responds to a pending MCP OAuth authorization request by its request id.
|
|
1606
1857
|
*
|
|
@@ -1697,13 +1948,187 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1697
1948
|
}
|
|
1698
1949
|
},
|
|
1699
1950
|
/** @experimental */
|
|
1951
|
+
diagnostics: {
|
|
1952
|
+
/**
|
|
1953
|
+
* Patches configured session diagnostic sources without restarting their producers. Setting a source level to off clears its retained diagnostics and invalidates cursors selecting that source.
|
|
1954
|
+
*
|
|
1955
|
+
* @param params Patch session diagnostic thresholds for explicitly supplied sources.
|
|
1956
|
+
*
|
|
1957
|
+
* @returns Per-source session diagnostics configuration.
|
|
1958
|
+
*/
|
|
1959
|
+
configure: async (params) => connection.sendRequest("session.diagnostics.configure", { sessionId, ...params }),
|
|
1960
|
+
/**
|
|
1961
|
+
* 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.
|
|
1962
|
+
*
|
|
1963
|
+
* @param params Cursor-based request for session diagnostics. The default limit is 100 (maximum 500); the default waitMs is zero (maximum 30000).
|
|
1964
|
+
*
|
|
1965
|
+
* @returns One cursor-addressed page of retained session diagnostics.
|
|
1966
|
+
*/
|
|
1967
|
+
read: async (params) => connection.sendRequest("session.diagnostics.read", { sessionId, ...params })
|
|
1968
|
+
},
|
|
1969
|
+
/** @experimental */
|
|
1970
|
+
connectors: {
|
|
1971
|
+
/**
|
|
1972
|
+
* Returns feature availability and bounded polling limits for the EXPERIMENTAL session connector API. This method never performs a Connector service request.
|
|
1973
|
+
*
|
|
1974
|
+
* @returns Feature detection and hard polling limits for the EXPERIMENTAL session connector API.
|
|
1975
|
+
*/
|
|
1976
|
+
getCapabilities: async () => connection.sendRequest("session.connectors.getCapabilities", { sessionId }),
|
|
1977
|
+
/**
|
|
1978
|
+
* Returns authoritative session Connector state from current availability, pinned account selection, cached catalog, and live MCP projection without performing a Connector service request.
|
|
1979
|
+
*
|
|
1980
|
+
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
1981
|
+
*/
|
|
1982
|
+
getStatus: async () => connection.sendRequest("session.connectors.getStatus", { sessionId }),
|
|
1983
|
+
/**
|
|
1984
|
+
* Returns the cached Connector catalog for the pinned opaque account selection, fetching it only when this session has no cached catalog.
|
|
1985
|
+
*
|
|
1986
|
+
* @param params Pins a Connector operation to one host-owned GitHub account through its opaque selection ID. Provider tokens are never accepted.
|
|
1987
|
+
*
|
|
1988
|
+
* @returns Validated Connector catalog snapshot cached by the session.
|
|
1989
|
+
*/
|
|
1990
|
+
list: async (params) => connection.sendRequest("session.connectors.list", { sessionId, ...params }),
|
|
1991
|
+
/**
|
|
1992
|
+
* Refreshes and validates the Connector catalog for the pinned opaque account selection.
|
|
1993
|
+
*
|
|
1994
|
+
* @param params Pins a Connector operation to one host-owned GitHub account through its opaque selection ID. Provider tokens are never accepted.
|
|
1995
|
+
*
|
|
1996
|
+
* @returns Validated Connector catalog snapshot cached by the session.
|
|
1997
|
+
*/
|
|
1998
|
+
refresh: async (params) => connection.sendRequest("session.connectors.refresh", { sessionId, ...params }),
|
|
1999
|
+
/**
|
|
2000
|
+
* 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.
|
|
2001
|
+
*
|
|
2002
|
+
* @param params Selects one Connector and the pinned host-owned account used for its service and MCP authorization.
|
|
2003
|
+
*
|
|
2004
|
+
* @returns Typed result of initiating or continuing a Connector connection.
|
|
2005
|
+
*/
|
|
2006
|
+
connect: async (params) => connection.sendRequest("session.connectors.connect", { sessionId, ...params }),
|
|
2007
|
+
/**
|
|
2008
|
+
* Re-initiates an idempotent Connector connection request without browser or UI effects, with the same typed outcomes as connect.
|
|
2009
|
+
*
|
|
2010
|
+
* @param params Selects one Connector and the pinned host-owned account used for its service and MCP authorization.
|
|
2011
|
+
*
|
|
2012
|
+
* @returns Typed result of initiating or continuing a Connector connection.
|
|
2013
|
+
*/
|
|
2014
|
+
reconnect: async (params) => connection.sendRequest("session.connectors.reconnect", { sessionId, ...params }),
|
|
2015
|
+
/**
|
|
2016
|
+
* Continues a pending Connector connection with caller-supplied attempt, interval, and deadline bounds. The runtime never opens the returned consent URL.
|
|
2017
|
+
*
|
|
2018
|
+
* @param params Explicitly bounded continuation of a pending Connector connection.
|
|
2019
|
+
*
|
|
2020
|
+
* @returns Typed result of initiating or continuing a Connector connection.
|
|
2021
|
+
*/
|
|
2022
|
+
continueConnection: async (params) => connection.sendRequest("session.connectors.continueConnection", { sessionId, ...params }),
|
|
2023
|
+
/**
|
|
2024
|
+
* Disconnects one Connector for the pinned opaque account selection, refreshes the authoritative catalog, and removes its session-owned MCP projection.
|
|
2025
|
+
*
|
|
2026
|
+
* @param params Selects one Connector and the pinned host-owned account used for its service and MCP authorization.
|
|
2027
|
+
*
|
|
2028
|
+
* @returns Authoritative result after disconnect and MCP reconciliation.
|
|
2029
|
+
*/
|
|
2030
|
+
disconnect: async (params) => connection.sendRequest("session.connectors.disconnect", { sessionId, ...params }),
|
|
2031
|
+
/**
|
|
2032
|
+
* Reconciles the authoritative cached or freshly requested Connector catalog into the session Connector MCP projection and returns live status.
|
|
2033
|
+
*
|
|
2034
|
+
* @param params Requests authoritative Connector-to-MCP reconciliation for the pinned account.
|
|
2035
|
+
*
|
|
2036
|
+
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
2037
|
+
*/
|
|
2038
|
+
reconcile: async (params) => connection.sendRequest("session.connectors.reconcile", { sessionId, ...params })
|
|
2039
|
+
},
|
|
2040
|
+
/** @experimental */
|
|
2041
|
+
managedSettings: {
|
|
2042
|
+
/**
|
|
2043
|
+
* Waits for the live session's in-flight managed-settings application, then returns the retained effective snapshot used by runtime enforcement and by `session.managed_settings_resolved`. It does not perform another account, device, or server resolution, and rejects when resolution has not produced a snapshot.
|
|
2044
|
+
*
|
|
2045
|
+
* @returns Enterprise managed-settings resolution: the effective managed settings the session applied and which channels contributed, so SDK clients can show users what is enterprise-managed. Fires whenever managed policy is (re)applied — at session start, on resume, and on account switch. This is an ephemeral live snapshot (delivered to subscribers but not persisted to the session event log), because at session start it resolves before `session.start` is emitted. Device values take precedence over server values, then the policy helper, per ordinary key, while permissions compose restrictively across device, server, policy-helper, and SDK-client layers. The account-scoped `getManagedSettings()` API does not include session-local client injection. Marked experimental while the managed-settings surface stabilizes.
|
|
2046
|
+
*/
|
|
2047
|
+
get: async () => connection.sendRequest("session.managedSettings.get", { sessionId })
|
|
2048
|
+
},
|
|
2049
|
+
/** @experimental */
|
|
1700
2050
|
plugins: {
|
|
1701
2051
|
/**
|
|
1702
|
-
* Lists
|
|
2052
|
+
* Lists globally installed, live, built-in, and enterprise-managed desired plugins using the live session's authoritative account, working directory, and retained managed policy.
|
|
1703
2053
|
*
|
|
1704
2054
|
* @returns Plugins installed for the session, with their enabled state and version metadata.
|
|
1705
2055
|
*/
|
|
1706
2056
|
list: async () => connection.sendRequest("session.plugins.list", { sessionId }),
|
|
2057
|
+
/**
|
|
2058
|
+
* Installs a plugin using the live session's authoritative account, working directory, and retained managed policy.
|
|
2059
|
+
*
|
|
2060
|
+
* @param params Plugin source resolved relative to the session's authoritative working directory.
|
|
2061
|
+
*
|
|
2062
|
+
* @returns Result of installing a plugin.
|
|
2063
|
+
*/
|
|
2064
|
+
install: async (params) => connection.sendRequest("session.plugins.install", { sessionId, ...params }),
|
|
2065
|
+
/**
|
|
2066
|
+
* Uninstalls a plugin when permitted by the live session's retained managed policy.
|
|
2067
|
+
*
|
|
2068
|
+
* @param params Name (or spec) of the plugin to uninstall.
|
|
2069
|
+
*/
|
|
2070
|
+
uninstall: async (params) => connection.sendRequest("session.plugins.uninstall", { sessionId, ...params }),
|
|
2071
|
+
/**
|
|
2072
|
+
* Updates an installed plugin using the live session's authoritative account, working directory, and retained managed policy.
|
|
2073
|
+
*
|
|
2074
|
+
* @param params Name (or spec) of the plugin to update.
|
|
2075
|
+
*
|
|
2076
|
+
* @returns Result of updating a single plugin.
|
|
2077
|
+
*/
|
|
2078
|
+
update: async (params) => connection.sendRequest("session.plugins.update", { sessionId, ...params }),
|
|
2079
|
+
/**
|
|
2080
|
+
* Enables installed plugins when permitted by the live session's retained managed policy.
|
|
2081
|
+
*
|
|
2082
|
+
* @param params Plugin names (or specs) to enable in the session's authoritative working directory.
|
|
2083
|
+
*/
|
|
2084
|
+
enable: async (params) => connection.sendRequest("session.plugins.enable", { sessionId, ...params }),
|
|
2085
|
+
/**
|
|
2086
|
+
* Disables installed plugins when permitted by the live session's retained managed policy.
|
|
2087
|
+
*
|
|
2088
|
+
* @param params Plugin names (or specs) to disable in the session's authoritative working directory.
|
|
2089
|
+
*/
|
|
2090
|
+
disable: async (params) => connection.sendRequest("session.plugins.disable", { sessionId, ...params }),
|
|
2091
|
+
/** @experimental */
|
|
2092
|
+
marketplaces: {
|
|
2093
|
+
/**
|
|
2094
|
+
* Lists registered and enterprise-managed desired marketplaces using the live session's retained policy.
|
|
2095
|
+
*
|
|
2096
|
+
* @returns All registered marketplaces, including built-in defaults.
|
|
2097
|
+
*/
|
|
2098
|
+
list: async () => connection.sendRequest("session.plugins.marketplaces.list", { sessionId }),
|
|
2099
|
+
/**
|
|
2100
|
+
* Adds a marketplace when permitted by the live session's retained managed policy.
|
|
2101
|
+
*
|
|
2102
|
+
* @param params Marketplace source and optional working directory for relative-path resolution.
|
|
2103
|
+
*
|
|
2104
|
+
* @returns Result of registering a new marketplace.
|
|
2105
|
+
*/
|
|
2106
|
+
add: async (params) => connection.sendRequest("session.plugins.marketplaces.add", { sessionId, ...params }),
|
|
2107
|
+
/**
|
|
2108
|
+
* Removes a marketplace when permitted by the live session's retained managed policy.
|
|
2109
|
+
*
|
|
2110
|
+
* @param params Name of the marketplace to remove and an optional force flag.
|
|
2111
|
+
*
|
|
2112
|
+
* @returns Outcome of the remove attempt, including dependent-plugin info when applicable.
|
|
2113
|
+
*/
|
|
2114
|
+
remove: async (params) => connection.sendRequest("session.plugins.marketplaces.remove", { sessionId, ...params }),
|
|
2115
|
+
/**
|
|
2116
|
+
* Browses a marketplace resolved through the live session's working directory and retained managed policy.
|
|
2117
|
+
*
|
|
2118
|
+
* @param params Name of the marketplace whose plugin catalog to fetch.
|
|
2119
|
+
*
|
|
2120
|
+
* @returns Plugins advertised by the marketplace.
|
|
2121
|
+
*/
|
|
2122
|
+
browse: async (params) => connection.sendRequest("session.plugins.marketplaces.browse", { sessionId, ...params }),
|
|
2123
|
+
/**
|
|
2124
|
+
* Refreshes marketplaces resolved through the live session's working directory and retained managed policy.
|
|
2125
|
+
*
|
|
2126
|
+
* @param params Optional marketplace name; omit to refresh all.
|
|
2127
|
+
*
|
|
2128
|
+
* @returns Result of refreshing one or more marketplace catalogs.
|
|
2129
|
+
*/
|
|
2130
|
+
refresh: async (params) => connection.sendRequest("session.plugins.marketplaces.refresh", { sessionId, ...params })
|
|
2131
|
+
},
|
|
1707
2132
|
/**
|
|
1708
2133
|
* 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.
|
|
1709
2134
|
*
|
|
@@ -1728,7 +2153,15 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1728
2153
|
*
|
|
1729
2154
|
* @returns The selectable model entries synthesized for the models added by this call.
|
|
1730
2155
|
*/
|
|
1731
|
-
add: async (params) => connection.sendRequest("session.provider.add", { sessionId, ...params })
|
|
2156
|
+
add: async (params) => connection.sendRequest("session.provider.add", { sessionId, ...params }),
|
|
2157
|
+
/**
|
|
2158
|
+
* 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.
|
|
2159
|
+
*
|
|
2160
|
+
* @param params Authoritative BYOK provider and model registry snapshot to apply atomically to the session.
|
|
2161
|
+
*
|
|
2162
|
+
* @returns The selectable model entries and selection ids synthesized for the synchronized BYOK models.
|
|
2163
|
+
*/
|
|
2164
|
+
sync: async (params) => connection.sendRequest("session.provider.sync", { sessionId, ...params })
|
|
1732
2165
|
},
|
|
1733
2166
|
/** @experimental */
|
|
1734
2167
|
options: {
|
|
@@ -2054,9 +2487,9 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2054
2487
|
*/
|
|
2055
2488
|
setRequired: async (params) => connection.sendRequest("session.permissions.setRequired", { sessionId, ...params }),
|
|
2056
2489
|
/**
|
|
2057
|
-
* Clears session-scoped tool
|
|
2490
|
+
* Clears session-scoped tool approvals and, for full resets, exact session-approved paths.
|
|
2058
2491
|
*
|
|
2059
|
-
* @param params Clears session-scoped tool
|
|
2492
|
+
* @param params Clears session-scoped tool approvals and optionally clears location-scoped approvals and exact session-approved paths.
|
|
2060
2493
|
*
|
|
2061
2494
|
* @returns Indicates whether the operation succeeded.
|
|
2062
2495
|
*/
|
|
@@ -2072,9 +2505,9 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2072
2505
|
/** @experimental */
|
|
2073
2506
|
paths: {
|
|
2074
2507
|
/**
|
|
2075
|
-
* Returns the session's
|
|
2508
|
+
* Returns the session's recursive directory grants, exact session-approved paths, and primary working directory.
|
|
2076
2509
|
*
|
|
2077
|
-
* @returns Snapshot of the session's
|
|
2510
|
+
* @returns Snapshot of the session's recursive directory grants, exact session-approved paths, and primary working directory.
|
|
2078
2511
|
*/
|
|
2079
2512
|
list: async () => connection.sendRequest("session.permissions.paths.list", { sessionId }),
|
|
2080
2513
|
/**
|
|
@@ -2412,6 +2845,22 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2412
2845
|
* @returns Result of editing a queued message.
|
|
2413
2846
|
*/
|
|
2414
2847
|
updateText: async (params) => connection.sendRequest("session.queue.updateText", { sessionId, ...params }),
|
|
2848
|
+
/**
|
|
2849
|
+
* 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.
|
|
2850
|
+
*
|
|
2851
|
+
* @param params Conditional withdrawal of a single user message, from its queue or from the running turn it started.
|
|
2852
|
+
*
|
|
2853
|
+
* @returns Result of withdrawing a user message.
|
|
2854
|
+
*/
|
|
2855
|
+
withdrawMessage: async (params) => connection.sendRequest("session.queue.withdrawMessage", { sessionId, ...params }),
|
|
2856
|
+
/**
|
|
2857
|
+
* Atomically appends text and attachments to an unchanged, unconsumed local steering message. Returns updated=false if delivery or withdrawal already claimed the message.
|
|
2858
|
+
*
|
|
2859
|
+
* @param params Append to one pending steering message without changing its identity or delivery position.
|
|
2860
|
+
*
|
|
2861
|
+
* @returns Result of editing a queued message.
|
|
2862
|
+
*/
|
|
2863
|
+
appendSteering: async (params) => connection.sendRequest("session.queue.appendSteering", { sessionId, ...params }),
|
|
2415
2864
|
/**
|
|
2416
2865
|
* Duplicates an addressable queued item immediately after its source.
|
|
2417
2866
|
*
|
|
@@ -2641,29 +3090,29 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2641
3090
|
}
|
|
2642
3091
|
},
|
|
2643
3092
|
/** @experimental */
|
|
2644
|
-
|
|
3093
|
+
workflow: {
|
|
2645
3094
|
/**
|
|
2646
|
-
* Internal tool-originated
|
|
3095
|
+
* Internal tool-originated dynamic workflow invocation.
|
|
2647
3096
|
*
|
|
2648
|
-
* @param params Internal parameters for invoking a registered
|
|
3097
|
+
* @param params Internal parameters for invoking a registered workflow from a tool.
|
|
2649
3098
|
*
|
|
2650
|
-
* @returns Complete current or terminal
|
|
3099
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
2651
3100
|
*/
|
|
2652
|
-
runFromTool: async (params) => connection.sendRequest("session.
|
|
3101
|
+
runFromTool: async (params) => connection.sendRequest("session.workflow.runFromTool", { sessionId, ...params }),
|
|
2653
3102
|
/**
|
|
2654
|
-
* Internal tool-originated
|
|
3103
|
+
* Internal tool-originated dynamic workflow resume.
|
|
2655
3104
|
*
|
|
2656
|
-
* @param params Internal parameters for resuming a
|
|
3105
|
+
* @param params Internal parameters for resuming a workflow run from a tool.
|
|
2657
3106
|
*
|
|
2658
|
-
* @returns Resolved persisted
|
|
3107
|
+
* @returns Resolved persisted workflow identity and resumed run envelope.
|
|
2659
3108
|
*/
|
|
2660
|
-
resumeFromTool: async (params) => connection.sendRequest("session.
|
|
3109
|
+
resumeFromTool: async (params) => connection.sendRequest("session.workflow.resumeFromTool", { sessionId, ...params }),
|
|
2661
3110
|
/**
|
|
2662
|
-
* Atomically pauses an owned
|
|
3111
|
+
* Atomically pauses an owned dynamic workflow attempt at a durable checkpoint.
|
|
2663
3112
|
*
|
|
2664
3113
|
* @param params Parameters for an owned durable pause checkpoint.
|
|
2665
3114
|
*/
|
|
2666
|
-
pauseAtCheckpoint: async (params) => connection.sendRequest("session.
|
|
3115
|
+
pauseAtCheckpoint: async (params) => connection.sendRequest("session.workflow.pauseAtCheckpoint", { sessionId, ...params })
|
|
2667
3116
|
},
|
|
2668
3117
|
/** @experimental */
|
|
2669
3118
|
model: {
|
|
@@ -2708,6 +3157,23 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2708
3157
|
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", { sessionId, ...params })
|
|
2709
3158
|
},
|
|
2710
3159
|
/** @experimental */
|
|
3160
|
+
connectors: {
|
|
3161
|
+
/**
|
|
3162
|
+
* Reconciles the authoritative Connector catalog into the session MCP projection during startup with a bounded deadline and fail-closed cleanup.
|
|
3163
|
+
*
|
|
3164
|
+
* @param params Pins a Connector operation to one host-owned GitHub account through its opaque selection ID. Provider tokens are never accepted.
|
|
3165
|
+
*
|
|
3166
|
+
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
3167
|
+
*/
|
|
3168
|
+
reconcileForStartup: async (params) => connection.sendRequest("session.connectors.reconcileForStartup", { sessionId, ...params }),
|
|
3169
|
+
/**
|
|
3170
|
+
* Removes the runtime-owned Connector MCP projection without changing service-side connections.
|
|
3171
|
+
*
|
|
3172
|
+
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
3173
|
+
*/
|
|
3174
|
+
withdrawProjection: async () => connection.sendRequest("session.connectors.withdrawProjection", { sessionId })
|
|
3175
|
+
},
|
|
3176
|
+
/** @experimental */
|
|
2711
3177
|
commands: {
|
|
2712
3178
|
/**
|
|
2713
3179
|
* Finalizes persistence associated with a client-applied slash-command effect.
|
|
@@ -2851,14 +3317,14 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
2851
3317
|
if (!handler) throw new Error(`No providerToken handler registered for session: ${params.sessionId}`);
|
|
2852
3318
|
return handler.getToken(params);
|
|
2853
3319
|
});
|
|
2854
|
-
connection.onRequest("
|
|
2855
|
-
const handler = getHandlers(params.sessionId).
|
|
2856
|
-
if (!handler) throw new Error(`No
|
|
3320
|
+
connection.onRequest("workflow.execute", async (params) => {
|
|
3321
|
+
const handler = getHandlers(params.sessionId).workflow;
|
|
3322
|
+
if (!handler) throw new Error(`No workflow handler registered for session: ${params.sessionId}`);
|
|
2857
3323
|
return handler.execute(params);
|
|
2858
3324
|
});
|
|
2859
|
-
connection.onRequest("
|
|
2860
|
-
const handler = getHandlers(params.sessionId).
|
|
2861
|
-
if (!handler) throw new Error(`No
|
|
3325
|
+
connection.onRequest("workflow.abort", async (params) => {
|
|
3326
|
+
const handler = getHandlers(params.sessionId).workflow;
|
|
3327
|
+
if (!handler) throw new Error(`No workflow handler registered for session: ${params.sessionId}`);
|
|
2862
3328
|
return handler.abort(params);
|
|
2863
3329
|
});
|
|
2864
3330
|
connection.onRequest("tasks.cancel", async (params) => {
|
|
@@ -2973,6 +3439,11 @@ function registerClientGlobalApiHandlers(connection, handlers) {
|
|
|
2973
3439
|
if (!handler) throw new Error("No gitHubToken client-global handler registered");
|
|
2974
3440
|
return handler.getToken(params);
|
|
2975
3441
|
});
|
|
3442
|
+
connection.onRequest("installations.confirm", async (params) => {
|
|
3443
|
+
const handler = handlers.installations;
|
|
3444
|
+
if (!handler) throw new Error("No installations client-global handler registered");
|
|
3445
|
+
return handler.confirm(params);
|
|
3446
|
+
});
|
|
2976
3447
|
}
|
|
2977
3448
|
export {
|
|
2978
3449
|
createInternalServerRpc,
|