@github/copilot-sdk 1.0.15-preview.2 → 1.0.15-preview.4
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 +53 -25
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +21 -6
- package/dist/cjs/extension.js +1 -12
- package/dist/cjs/generated/rpc.js +307 -177
- package/dist/cjs/index.js +0 -7
- package/dist/cjs/installationConfirmation.js +98 -0
- package/dist/cjs/session.js +15 -524
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.d.ts +1 -0
- package/dist/client.js +23 -6
- package/dist/extension.d.ts +10 -24
- package/dist/extension.js +1 -13
- package/dist/generated/rpc.d.ts +4455 -2788
- package/dist/generated/rpc.js +307 -177
- package/dist/generated/session-events.d.ts +211 -120
- package/dist/index.d.ts +2 -4
- package/dist/index.js +0 -4
- package/dist/installationConfirmation.d.ts +19 -0
- package/dist/installationConfirmation.js +77 -0
- package/dist/session.d.ts +3 -25
- package/dist/session.js +15 -529
- package/dist/types.d.ts +31 -66
- package/dist/workflow.d.ts +5 -2
- package/docs/extensions.md +0 -1
- package/docs/workflows.md +2 -4
- package/package.json +10 -10
- package/dist/cjs/factory.js +0 -134
- package/dist/factory.d.ts +0 -327
- package/dist/factory.js +0 -106
- 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
|
*
|
|
@@ -307,40 +492,6 @@ function createServerRpc(connection) {
|
|
|
307
492
|
}
|
|
308
493
|
},
|
|
309
494
|
/** @experimental */
|
|
310
|
-
skills: {
|
|
311
|
-
/** @experimental */
|
|
312
|
-
config: {
|
|
313
|
-
/**
|
|
314
|
-
* Replaces the global list of disabled skills.
|
|
315
|
-
*
|
|
316
|
-
* @param params Skill names to mark as disabled in global configuration, replacing any previous list.
|
|
317
|
-
*/
|
|
318
|
-
setDisabledSkills: async (params) => connection.sendRequest("skills.config.setDisabledSkills", params),
|
|
319
|
-
/**
|
|
320
|
-
* Atomically adds or removes one skill from the disabled list.
|
|
321
|
-
*
|
|
322
|
-
* @param params Adds or removes a single skill from the global disabled list, leaving every other entry untouched.
|
|
323
|
-
*/
|
|
324
|
-
setSkillDisabled: async (params) => connection.sendRequest("skills.config.setSkillDisabled", params)
|
|
325
|
-
},
|
|
326
|
-
/**
|
|
327
|
-
* Discovers skills across global and project sources.
|
|
328
|
-
*
|
|
329
|
-
* @param params Optional project paths and additional skill directories to include in discovery.
|
|
330
|
-
*
|
|
331
|
-
* @returns Skills discovered across global and project sources.
|
|
332
|
-
*/
|
|
333
|
-
discover: async (params) => connection.sendRequest("skills.discover", params),
|
|
334
|
-
/**
|
|
335
|
-
* 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.
|
|
336
|
-
*
|
|
337
|
-
* @param params Optional project paths to enumerate.
|
|
338
|
-
*
|
|
339
|
-
* @returns Canonical locations where skills can be created so the runtime will recognize them.
|
|
340
|
-
*/
|
|
341
|
-
getDiscoveryPaths: async (params) => connection.sendRequest("skills.getDiscoveryPaths", params)
|
|
342
|
-
},
|
|
343
|
-
/** @experimental */
|
|
344
495
|
agents: {
|
|
345
496
|
/**
|
|
346
497
|
* Discovers custom agents across user, project, plugin, and remote sources.
|
|
@@ -745,6 +896,17 @@ function createInternalServerRpc(connection) {
|
|
|
745
896
|
* @param params Params to attach or detach an in-process ExtensionController delegate.
|
|
746
897
|
*/
|
|
747
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)
|
|
748
910
|
}
|
|
749
911
|
};
|
|
750
912
|
}
|
|
@@ -847,6 +1009,58 @@ function createSessionRpc(connection, sessionId) {
|
|
|
847
1009
|
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", { sessionId, ...params })
|
|
848
1010
|
},
|
|
849
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 */
|
|
850
1064
|
debug: {
|
|
851
1065
|
/**
|
|
852
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.
|
|
@@ -898,108 +1112,6 @@ function createSessionRpc(connection, sessionId) {
|
|
|
898
1112
|
}
|
|
899
1113
|
},
|
|
900
1114
|
/** @experimental */
|
|
901
|
-
factory: {
|
|
902
|
-
/**
|
|
903
|
-
* Runs a registered factory by name at the top level.
|
|
904
|
-
*
|
|
905
|
-
* @param params Parameters for invoking a registered factory.
|
|
906
|
-
*
|
|
907
|
-
* @returns Complete current or terminal factory run envelope.
|
|
908
|
-
*/
|
|
909
|
-
run: async (params) => connection.sendRequest("session.factory.run", { sessionId, ...params }),
|
|
910
|
-
/**
|
|
911
|
-
* Resumes a factory run using its persisted name, arguments, journal, and accounting.
|
|
912
|
-
*
|
|
913
|
-
* @param params Parameters for resuming a factory run from its persisted identity.
|
|
914
|
-
*
|
|
915
|
-
* @returns Resolved persisted factory identity and resumed run envelope.
|
|
916
|
-
*/
|
|
917
|
-
resume: async (params) => connection.sendRequest("session.factory.resume", { sessionId, ...params }),
|
|
918
|
-
/**
|
|
919
|
-
* Gets the current or settled envelope for a factory run.
|
|
920
|
-
*
|
|
921
|
-
* @param params Parameters for retrieving a factory run.
|
|
922
|
-
*
|
|
923
|
-
* @returns Complete current or terminal factory run envelope.
|
|
924
|
-
*/
|
|
925
|
-
getRun: async (params) => connection.sendRequest("session.factory.getRun", { sessionId, ...params }),
|
|
926
|
-
/**
|
|
927
|
-
* Lists durable factory runs for this session in creation order.
|
|
928
|
-
*
|
|
929
|
-
* @param params Parameters for paging factory runs.
|
|
930
|
-
*
|
|
931
|
-
* @returns A page of factory runs in durable creation order.
|
|
932
|
-
*/
|
|
933
|
-
listRuns: async (params) => connection.sendRequest("session.factory.listRuns", { sessionId, ...params }),
|
|
934
|
-
/**
|
|
935
|
-
* Gets durable and live observability detail for one factory run.
|
|
936
|
-
*
|
|
937
|
-
* @param params Parameters for retrieving a factory run.
|
|
938
|
-
*
|
|
939
|
-
* @returns Full factory run observability detail.
|
|
940
|
-
*/
|
|
941
|
-
getRunDetail: async (params) => connection.sendRequest("session.factory.getRunDetail", { sessionId, ...params }),
|
|
942
|
-
/**
|
|
943
|
-
* Pages durable progress for one factory run.
|
|
944
|
-
*
|
|
945
|
-
* @param params Parameters for paging factory progress.
|
|
946
|
-
*
|
|
947
|
-
* @returns A bidirectional page of factory progress.
|
|
948
|
-
*/
|
|
949
|
-
getRunProgress: async (params) => connection.sendRequest("session.factory.getRunProgress", { sessionId, ...params }),
|
|
950
|
-
/**
|
|
951
|
-
* Requests cancellation of a factory run and returns its run envelope.
|
|
952
|
-
*
|
|
953
|
-
* @param params Parameters for cancelling a factory run.
|
|
954
|
-
*
|
|
955
|
-
* @returns Complete current or terminal factory run envelope.
|
|
956
|
-
*/
|
|
957
|
-
cancel: async (params) => connection.sendRequest("session.factory.cancel", { sessionId, ...params }),
|
|
958
|
-
/**
|
|
959
|
-
* Pauses a running factory and returns its settled run envelope.
|
|
960
|
-
*
|
|
961
|
-
* @param params Parameters for pausing a running factory.
|
|
962
|
-
*
|
|
963
|
-
* @returns Complete current or terminal factory run envelope.
|
|
964
|
-
*/
|
|
965
|
-
pause: async (params) => connection.sendRequest("session.factory.pause", { sessionId, ...params }),
|
|
966
|
-
/**
|
|
967
|
-
* Records a batch of ordered factory progress lines.
|
|
968
|
-
*
|
|
969
|
-
* @param params Parameters for recording factory progress.
|
|
970
|
-
*
|
|
971
|
-
* @returns Acknowledgement that a factory request was accepted.
|
|
972
|
-
*/
|
|
973
|
-
log: async (params) => connection.sendRequest("session.factory.log", { sessionId, ...params }),
|
|
974
|
-
/**
|
|
975
|
-
* Runs one factory-scoped subagent and returns its result.
|
|
976
|
-
*
|
|
977
|
-
* @param params Parameters for one factory-scoped subagent call.
|
|
978
|
-
*
|
|
979
|
-
* @returns Result of one factory-scoped subagent call.
|
|
980
|
-
*/
|
|
981
|
-
agent: async (params) => connection.sendRequest("session.factory.agent", { sessionId, ...params }),
|
|
982
|
-
/** @experimental */
|
|
983
|
-
journal: {
|
|
984
|
-
/**
|
|
985
|
-
* Reads a memoized factory journal entry.
|
|
986
|
-
*
|
|
987
|
-
* @param params Parameters for reading a factory journal entry.
|
|
988
|
-
*
|
|
989
|
-
* @returns Result of reading a factory journal entry.
|
|
990
|
-
*/
|
|
991
|
-
get: async (params) => connection.sendRequest("session.factory.journal.get", { sessionId, ...params }),
|
|
992
|
-
/**
|
|
993
|
-
* Stores a memoized factory journal entry.
|
|
994
|
-
*
|
|
995
|
-
* @param params Parameters for storing a factory journal entry.
|
|
996
|
-
*
|
|
997
|
-
* @returns Acknowledgement that a factory request was accepted.
|
|
998
|
-
*/
|
|
999
|
-
put: async (params) => connection.sendRequest("session.factory.journal.put", { sessionId, ...params })
|
|
1000
|
-
}
|
|
1001
|
-
},
|
|
1002
|
-
/** @experimental */
|
|
1003
1115
|
workflow: {
|
|
1004
1116
|
/**
|
|
1005
1117
|
* Runs a registered dynamic workflow by name at the top level.
|
|
@@ -1397,7 +1509,20 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1397
1509
|
*
|
|
1398
1510
|
* @returns Instruction sources loaded for the session, in merge order.
|
|
1399
1511
|
*/
|
|
1400
|
-
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 })
|
|
1401
1526
|
},
|
|
1402
1527
|
/** @experimental */
|
|
1403
1528
|
fleet: {
|
|
@@ -1696,7 +1821,15 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1696
1821
|
*/
|
|
1697
1822
|
authenticationStateChanged: async (params) => connection.sendRequest("session.mcp.oauth.authenticationStateChanged", { sessionId, ...params }),
|
|
1698
1823
|
/**
|
|
1699
|
-
*
|
|
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.
|
|
1700
1833
|
*
|
|
1701
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.
|
|
1702
1835
|
*
|
|
@@ -1711,6 +1844,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1711
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.
|
|
1712
1845
|
*/
|
|
1713
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 }),
|
|
1714
1855
|
/**
|
|
1715
1856
|
* Responds to a pending MCP OAuth authorization request by its request id.
|
|
1716
1857
|
*
|
|
@@ -1807,6 +1948,25 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1807
1948
|
}
|
|
1808
1949
|
},
|
|
1809
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 */
|
|
1810
1970
|
connectors: {
|
|
1811
1971
|
/**
|
|
1812
1972
|
* Returns feature availability and bounded polling limits for the EXPERIMENTAL session connector API. This method never performs a Connector service request.
|
|
@@ -2686,11 +2846,11 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2686
2846
|
*/
|
|
2687
2847
|
updateText: async (params) => connection.sendRequest("session.queue.updateText", { sessionId, ...params }),
|
|
2688
2848
|
/**
|
|
2689
|
-
* Atomically withdraws an unchanged
|
|
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.
|
|
2690
2850
|
*
|
|
2691
|
-
* @param params Conditional withdrawal of a single user message,
|
|
2851
|
+
* @param params Conditional withdrawal of a single user message, from its queue or from the running turn it started.
|
|
2692
2852
|
*
|
|
2693
|
-
* @returns Result of
|
|
2853
|
+
* @returns Result of withdrawing a user message.
|
|
2694
2854
|
*/
|
|
2695
2855
|
withdrawMessage: async (params) => connection.sendRequest("session.queue.withdrawMessage", { sessionId, ...params }),
|
|
2696
2856
|
/**
|
|
@@ -2930,31 +3090,6 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2930
3090
|
}
|
|
2931
3091
|
},
|
|
2932
3092
|
/** @experimental */
|
|
2933
|
-
factory: {
|
|
2934
|
-
/**
|
|
2935
|
-
* Internal tool-originated factory invocation.
|
|
2936
|
-
*
|
|
2937
|
-
* @param params Internal parameters for invoking a registered factory from a tool.
|
|
2938
|
-
*
|
|
2939
|
-
* @returns Complete current or terminal factory run envelope.
|
|
2940
|
-
*/
|
|
2941
|
-
runFromTool: async (params) => connection.sendRequest("session.factory.runFromTool", { sessionId, ...params }),
|
|
2942
|
-
/**
|
|
2943
|
-
* Internal tool-originated factory resume.
|
|
2944
|
-
*
|
|
2945
|
-
* @param params Internal parameters for resuming a factory run from a tool.
|
|
2946
|
-
*
|
|
2947
|
-
* @returns Resolved persisted factory identity and resumed run envelope.
|
|
2948
|
-
*/
|
|
2949
|
-
resumeFromTool: async (params) => connection.sendRequest("session.factory.resumeFromTool", { sessionId, ...params }),
|
|
2950
|
-
/**
|
|
2951
|
-
* Atomically pauses an owned factory attempt at a durable checkpoint.
|
|
2952
|
-
*
|
|
2953
|
-
* @param params Parameters for an owned durable pause checkpoint.
|
|
2954
|
-
*/
|
|
2955
|
-
pauseAtCheckpoint: async (params) => connection.sendRequest("session.factory.pauseAtCheckpoint", { sessionId, ...params })
|
|
2956
|
-
},
|
|
2957
|
-
/** @experimental */
|
|
2958
3093
|
workflow: {
|
|
2959
3094
|
/**
|
|
2960
3095
|
* Internal tool-originated dynamic workflow invocation.
|
|
@@ -3182,16 +3317,6 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
3182
3317
|
if (!handler) throw new Error(`No providerToken handler registered for session: ${params.sessionId}`);
|
|
3183
3318
|
return handler.getToken(params);
|
|
3184
3319
|
});
|
|
3185
|
-
connection.onRequest("factory.execute", async (params) => {
|
|
3186
|
-
const handler = getHandlers(params.sessionId).factory;
|
|
3187
|
-
if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`);
|
|
3188
|
-
return handler.execute(params);
|
|
3189
|
-
});
|
|
3190
|
-
connection.onRequest("factory.abort", async (params) => {
|
|
3191
|
-
const handler = getHandlers(params.sessionId).factory;
|
|
3192
|
-
if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`);
|
|
3193
|
-
return handler.abort(params);
|
|
3194
|
-
});
|
|
3195
3320
|
connection.onRequest("workflow.execute", async (params) => {
|
|
3196
3321
|
const handler = getHandlers(params.sessionId).workflow;
|
|
3197
3322
|
if (!handler) throw new Error(`No workflow handler registered for session: ${params.sessionId}`);
|
|
@@ -3314,6 +3439,11 @@ function registerClientGlobalApiHandlers(connection, handlers) {
|
|
|
3314
3439
|
if (!handler) throw new Error("No gitHubToken client-global handler registered");
|
|
3315
3440
|
return handler.getToken(params);
|
|
3316
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
|
+
});
|
|
3317
3447
|
}
|
|
3318
3448
|
export {
|
|
3319
3449
|
createInternalServerRpc,
|