@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
|
@@ -67,6 +67,15 @@ function createServerRpc(connection) {
|
|
|
67
67
|
getBuiltInCatalog: async () => connection.sendRequest("models.getBuiltInCatalog", {})
|
|
68
68
|
},
|
|
69
69
|
/** @experimental */
|
|
70
|
+
sandbox: {
|
|
71
|
+
/**
|
|
72
|
+
* Reports whether the host running this runtime can run the command sandbox, without starting a session or spawning a sandboxed command.
|
|
73
|
+
*
|
|
74
|
+
* @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.
|
|
75
|
+
*/
|
|
76
|
+
getHostSupport: async () => connection.sendRequest("sandbox.getHostSupport", {})
|
|
77
|
+
},
|
|
78
|
+
/** @experimental */
|
|
70
79
|
tools: {
|
|
71
80
|
/**
|
|
72
81
|
* Lists built-in tools available for a model.
|
|
@@ -187,7 +196,74 @@ function createServerRpc(connection) {
|
|
|
187
196
|
*
|
|
188
197
|
* @returns Outcome of an mcp.planInstall call: either a normalised plan, or one typed refusal. Nothing is written in either case.
|
|
189
198
|
*/
|
|
190
|
-
planInstall: async (params) => connection.sendRequest("mcp.planInstall", params)
|
|
199
|
+
planInstall: async (params) => connection.sendRequest("mcp.planInstall", params),
|
|
200
|
+
/**
|
|
201
|
+
* 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.
|
|
202
|
+
*
|
|
203
|
+
* @param params Side-effect-free preparation of one original bound remote MCP choice.
|
|
204
|
+
*
|
|
205
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
206
|
+
*/
|
|
207
|
+
prepareInstall: async (params) => connection.sendRequest("mcp.prepareInstall", params),
|
|
208
|
+
/**
|
|
209
|
+
* 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.
|
|
210
|
+
*
|
|
211
|
+
* @param params Applies exactly one previously prepared operation on its original connection.
|
|
212
|
+
*
|
|
213
|
+
* @returns An installation result together with the exact honoured contract, or a negotiation refusal.
|
|
214
|
+
*/
|
|
215
|
+
applyInstall: async (params) => connection.sendRequest("mcp.applyInstall", params),
|
|
216
|
+
/**
|
|
217
|
+
* 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.
|
|
218
|
+
*
|
|
219
|
+
* @param params Read-only preparation of one owned removal under fresh selected-session authority.
|
|
220
|
+
*
|
|
221
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
222
|
+
*/
|
|
223
|
+
planUninstall: async (params) => connection.sendRequest("mcp.planUninstall", params),
|
|
224
|
+
/**
|
|
225
|
+
* 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.
|
|
226
|
+
*
|
|
227
|
+
* @param params One-use application of the exact retained removal plan.
|
|
228
|
+
*
|
|
229
|
+
* @returns An installation result together with the exact honoured contract, or a negotiation refusal.
|
|
230
|
+
*/
|
|
231
|
+
applyUninstall: async (params) => connection.sendRequest("mcp.applyUninstall", params),
|
|
232
|
+
/** @experimental */
|
|
233
|
+
installations: {
|
|
234
|
+
/**
|
|
235
|
+
* 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.
|
|
236
|
+
*
|
|
237
|
+
* @param params New-work inventory or recovery request under an explicitly selected existing session.
|
|
238
|
+
*
|
|
239
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
240
|
+
*/
|
|
241
|
+
list: async (params) => connection.sendRequest("mcp.installations.list", params),
|
|
242
|
+
/**
|
|
243
|
+
* 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.
|
|
244
|
+
*
|
|
245
|
+
* @param params New-work inventory or recovery request under an explicitly selected existing session.
|
|
246
|
+
*
|
|
247
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
248
|
+
*/
|
|
249
|
+
recover: async (params) => connection.sendRequest("mcp.installations.recover", params),
|
|
250
|
+
/**
|
|
251
|
+
* 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.
|
|
252
|
+
*
|
|
253
|
+
* @param params Existing-operation control. A new session selector is deliberately not accepted.
|
|
254
|
+
*
|
|
255
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
256
|
+
*/
|
|
257
|
+
status: async (params) => connection.sendRequest("mcp.installations.status", params),
|
|
258
|
+
/**
|
|
259
|
+
* 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.
|
|
260
|
+
*
|
|
261
|
+
* @param params Existing-operation control. A new session selector is deliberately not accepted.
|
|
262
|
+
*
|
|
263
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
264
|
+
*/
|
|
265
|
+
cancel: async (params) => connection.sendRequest("mcp.installations.cancel", params)
|
|
266
|
+
}
|
|
191
267
|
},
|
|
192
268
|
/** @experimental */
|
|
193
269
|
extensions: {
|
|
@@ -210,6 +286,115 @@ function createServerRpc(connection) {
|
|
|
210
286
|
*/
|
|
211
287
|
disable: async (params) => connection.sendRequest("extensions.disable", params)
|
|
212
288
|
},
|
|
289
|
+
/** @experimental */
|
|
290
|
+
skills: {
|
|
291
|
+
/**
|
|
292
|
+
* 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.
|
|
293
|
+
*
|
|
294
|
+
* @param params Side-effect-free planning of one verified Agent Finder Skill candidate.
|
|
295
|
+
*
|
|
296
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
297
|
+
*/
|
|
298
|
+
planInstall: async (params) => connection.sendRequest("skills.planInstall", params),
|
|
299
|
+
/**
|
|
300
|
+
* Consumes one verified Skill installation plan, requests explicit human consent through installations.confirm on the original connection, then revalidates and installs the Skill disabled.
|
|
301
|
+
*
|
|
302
|
+
* @param params Applies exactly one retained verified Skill installation plan.
|
|
303
|
+
*
|
|
304
|
+
* @returns Skill installation result with the honoured contract, or a typed request/negotiation refusal.
|
|
305
|
+
*/
|
|
306
|
+
applyInstall: async (params) => connection.sendRequest("skills.applyInstall", params),
|
|
307
|
+
/** @experimental */
|
|
308
|
+
installations: {
|
|
309
|
+
/**
|
|
310
|
+
* Lists owned verified Agent Finder Skill installations for the selected existing session. Listing is never gated by the Skill-install feature flag.
|
|
311
|
+
*
|
|
312
|
+
* @param params Inventory request under an explicitly selected existing session.
|
|
313
|
+
*
|
|
314
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
315
|
+
*/
|
|
316
|
+
list: async (params) => connection.sendRequest("skills.installations.list", params),
|
|
317
|
+
/**
|
|
318
|
+
* 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.
|
|
319
|
+
*
|
|
320
|
+
* @param params Inventory request under an explicitly selected existing session.
|
|
321
|
+
*
|
|
322
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
323
|
+
*/
|
|
324
|
+
recover: async (params) => connection.sendRequest("skills.installations.recover", params),
|
|
325
|
+
/**
|
|
326
|
+
* Inspects a known Skill installation operation on its original runtime connection. Status is never gated by the Skill-install feature flag.
|
|
327
|
+
*
|
|
328
|
+
* @param params Existing-operation control. A new session selector is deliberately not accepted.
|
|
329
|
+
*
|
|
330
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
331
|
+
*/
|
|
332
|
+
status: async (params) => connection.sendRequest("skills.installations.status", params),
|
|
333
|
+
/**
|
|
334
|
+
* Requests cancellation of a known Skill installation operation before commit. Already-started durable work requires recovery instead of silent replay.
|
|
335
|
+
*
|
|
336
|
+
* @param params Existing-operation control. A new session selector is deliberately not accepted.
|
|
337
|
+
*
|
|
338
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
339
|
+
*/
|
|
340
|
+
cancel: async (params) => connection.sendRequest("skills.installations.cancel", params),
|
|
341
|
+
/**
|
|
342
|
+
* 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.
|
|
343
|
+
*
|
|
344
|
+
* @param params Persisted enablement update for one owned Skill installation.
|
|
345
|
+
*
|
|
346
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
347
|
+
*/
|
|
348
|
+
setEnabled: async (params) => connection.sendRequest("skills.installations.setEnabled", params)
|
|
349
|
+
},
|
|
350
|
+
/**
|
|
351
|
+
* 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.
|
|
352
|
+
*
|
|
353
|
+
* @param params Read-only preparation of one owned Skill removal under fresh selected-session authority.
|
|
354
|
+
*
|
|
355
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
356
|
+
*/
|
|
357
|
+
planUninstall: async (params) => connection.sendRequest("skills.planUninstall", params),
|
|
358
|
+
/**
|
|
359
|
+
* Consumes an owned Skill removal plan, requests explicit human consent through installations.confirm, refuses drift, and removes the exact owned files through quarantine.
|
|
360
|
+
*
|
|
361
|
+
* @param params One-use application of the exact retained Skill removal plan.
|
|
362
|
+
*
|
|
363
|
+
* @returns Skill installation result with the honoured contract, or a typed request/negotiation refusal.
|
|
364
|
+
*/
|
|
365
|
+
applyUninstall: async (params) => connection.sendRequest("skills.applyUninstall", params),
|
|
366
|
+
/** @experimental */
|
|
367
|
+
config: {
|
|
368
|
+
/**
|
|
369
|
+
* Replaces the global list of disabled skills.
|
|
370
|
+
*
|
|
371
|
+
* @param params Skill names to mark as disabled in global configuration, replacing any previous list.
|
|
372
|
+
*/
|
|
373
|
+
setDisabledSkills: async (params) => connection.sendRequest("skills.config.setDisabledSkills", params),
|
|
374
|
+
/**
|
|
375
|
+
* Atomically adds or removes one skill from the disabled list.
|
|
376
|
+
*
|
|
377
|
+
* @param params Adds or removes a single skill from the global disabled list, leaving every other entry untouched.
|
|
378
|
+
*/
|
|
379
|
+
setSkillDisabled: async (params) => connection.sendRequest("skills.config.setSkillDisabled", params)
|
|
380
|
+
},
|
|
381
|
+
/**
|
|
382
|
+
* Discovers skills across global and project sources.
|
|
383
|
+
*
|
|
384
|
+
* @param params Optional project paths and additional skill directories to include in discovery.
|
|
385
|
+
*
|
|
386
|
+
* @returns Skills discovered across global and project sources.
|
|
387
|
+
*/
|
|
388
|
+
discover: async (params) => connection.sendRequest("skills.discover", params),
|
|
389
|
+
/**
|
|
390
|
+
* 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.
|
|
391
|
+
*
|
|
392
|
+
* @param params Optional project paths to enumerate.
|
|
393
|
+
*
|
|
394
|
+
* @returns Canonical locations where skills can be created so the runtime will recognize them.
|
|
395
|
+
*/
|
|
396
|
+
getDiscoveryPaths: async (params) => connection.sendRequest("skills.getDiscoveryPaths", params)
|
|
397
|
+
},
|
|
213
398
|
/**
|
|
214
399
|
* 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.
|
|
215
400
|
*
|
|
@@ -335,40 +520,6 @@ function createServerRpc(connection) {
|
|
|
335
520
|
}
|
|
336
521
|
},
|
|
337
522
|
/** @experimental */
|
|
338
|
-
skills: {
|
|
339
|
-
/** @experimental */
|
|
340
|
-
config: {
|
|
341
|
-
/**
|
|
342
|
-
* Replaces the global list of disabled skills.
|
|
343
|
-
*
|
|
344
|
-
* @param params Skill names to mark as disabled in global configuration, replacing any previous list.
|
|
345
|
-
*/
|
|
346
|
-
setDisabledSkills: async (params) => connection.sendRequest("skills.config.setDisabledSkills", params),
|
|
347
|
-
/**
|
|
348
|
-
* Atomically adds or removes one skill from the disabled list.
|
|
349
|
-
*
|
|
350
|
-
* @param params Adds or removes a single skill from the global disabled list, leaving every other entry untouched.
|
|
351
|
-
*/
|
|
352
|
-
setSkillDisabled: async (params) => connection.sendRequest("skills.config.setSkillDisabled", params)
|
|
353
|
-
},
|
|
354
|
-
/**
|
|
355
|
-
* Discovers skills across global and project sources.
|
|
356
|
-
*
|
|
357
|
-
* @param params Optional project paths and additional skill directories to include in discovery.
|
|
358
|
-
*
|
|
359
|
-
* @returns Skills discovered across global and project sources.
|
|
360
|
-
*/
|
|
361
|
-
discover: async (params) => connection.sendRequest("skills.discover", params),
|
|
362
|
-
/**
|
|
363
|
-
* 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.
|
|
364
|
-
*
|
|
365
|
-
* @param params Optional project paths to enumerate.
|
|
366
|
-
*
|
|
367
|
-
* @returns Canonical locations where skills can be created so the runtime will recognize them.
|
|
368
|
-
*/
|
|
369
|
-
getDiscoveryPaths: async (params) => connection.sendRequest("skills.getDiscoveryPaths", params)
|
|
370
|
-
},
|
|
371
|
-
/** @experimental */
|
|
372
523
|
agents: {
|
|
373
524
|
/**
|
|
374
525
|
* Discovers custom agents across user, project, plugin, and remote sources.
|
|
@@ -773,6 +924,17 @@ function createInternalServerRpc(connection) {
|
|
|
773
924
|
* @param params Params to attach or detach an in-process ExtensionController delegate.
|
|
774
925
|
*/
|
|
775
926
|
configureSessionExtensions: async (params) => connection.sendRequest("sessions.configureSessionExtensions", params)
|
|
927
|
+
},
|
|
928
|
+
/** @experimental */
|
|
929
|
+
accounts: {
|
|
930
|
+
/**
|
|
931
|
+
* 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).
|
|
932
|
+
*
|
|
933
|
+
* @param params OneAuth token request supplied by a trusted host application.
|
|
934
|
+
*
|
|
935
|
+
* @returns Result of a OneAuth token acquisition.
|
|
936
|
+
*/
|
|
937
|
+
acquireEntraToken: async (params) => connection.sendRequest("accounts.acquireEntraToken", params)
|
|
776
938
|
}
|
|
777
939
|
};
|
|
778
940
|
}
|
|
@@ -875,6 +1037,58 @@ function createSessionRpc(connection, sessionId) {
|
|
|
875
1037
|
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", { sessionId, ...params })
|
|
876
1038
|
},
|
|
877
1039
|
/** @experimental */
|
|
1040
|
+
accounts: {
|
|
1041
|
+
/**
|
|
1042
|
+
* Enumerate a typed accounts collection: the signed-in accounts, or the providers offered for interactive login.
|
|
1043
|
+
*
|
|
1044
|
+
* @param params Enumerate request carrying the typed collection query.
|
|
1045
|
+
*
|
|
1046
|
+
* @returns The enumerated collection, keyed by the same selector as the query.
|
|
1047
|
+
*/
|
|
1048
|
+
enumerate: async (params) => connection.sendRequest("session.accounts.enumerate", { sessionId, ...params }),
|
|
1049
|
+
/**
|
|
1050
|
+
* Read one typed accounts datum: the active account, a neutral status summary, or the last authentication errors.
|
|
1051
|
+
*
|
|
1052
|
+
* @param params Read request carrying the typed datum query.
|
|
1053
|
+
*
|
|
1054
|
+
* @returns The read result, keyed by the same selector as the query.
|
|
1055
|
+
*/
|
|
1056
|
+
get: async (params) => connection.sendRequest("session.accounts.get", { sessionId, ...params }),
|
|
1057
|
+
/**
|
|
1058
|
+
* Apply one non-interactive accounts mutation: switch the active account, log an account out, or set credentials from a token.
|
|
1059
|
+
*
|
|
1060
|
+
* @param params Mutation request carrying the typed write command.
|
|
1061
|
+
*
|
|
1062
|
+
* @returns Result of a non-interactive accounts mutation.
|
|
1063
|
+
*/
|
|
1064
|
+
set: async (params) => connection.sendRequest("session.accounts.set", { sessionId, ...params }),
|
|
1065
|
+
/** @experimental */
|
|
1066
|
+
login: {
|
|
1067
|
+
/**
|
|
1068
|
+
* Begin an interactive login flow for a provider kind (dispatch is kind-only) and return its opaque flow id and first step.
|
|
1069
|
+
*
|
|
1070
|
+
* @param params Begin an interactive login flow for a provider kind. Dispatch is kind-only.
|
|
1071
|
+
*
|
|
1072
|
+
* @returns A started login flow: its opaque id and first step.
|
|
1073
|
+
*/
|
|
1074
|
+
begin: async (params) => connection.sendRequest("session.accounts.login.begin", { sessionId, ...params }),
|
|
1075
|
+
/**
|
|
1076
|
+
* Advance an in-flight login flow, optionally fulfilling an input-required step, and return the next step.
|
|
1077
|
+
*
|
|
1078
|
+
* @param params Advance an in-flight login flow, optionally fulfilling an input-required step.
|
|
1079
|
+
*
|
|
1080
|
+
* @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).
|
|
1081
|
+
*/
|
|
1082
|
+
advance: async (params) => connection.sendRequest("session.accounts.login.advance", { sessionId, ...params }),
|
|
1083
|
+
/**
|
|
1084
|
+
* Cancel an in-flight login flow and release its resources.
|
|
1085
|
+
*
|
|
1086
|
+
* @param params Cancel an in-flight login flow.
|
|
1087
|
+
*/
|
|
1088
|
+
cancel: async (params) => connection.sendRequest("session.accounts.login.cancel", { sessionId, ...params })
|
|
1089
|
+
}
|
|
1090
|
+
},
|
|
1091
|
+
/** @experimental */
|
|
878
1092
|
debug: {
|
|
879
1093
|
/**
|
|
880
1094
|
* 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.
|
|
@@ -926,108 +1140,6 @@ function createSessionRpc(connection, sessionId) {
|
|
|
926
1140
|
}
|
|
927
1141
|
},
|
|
928
1142
|
/** @experimental */
|
|
929
|
-
factory: {
|
|
930
|
-
/**
|
|
931
|
-
* Runs a registered factory by name at the top level.
|
|
932
|
-
*
|
|
933
|
-
* @param params Parameters for invoking a registered factory.
|
|
934
|
-
*
|
|
935
|
-
* @returns Complete current or terminal factory run envelope.
|
|
936
|
-
*/
|
|
937
|
-
run: async (params) => connection.sendRequest("session.factory.run", { sessionId, ...params }),
|
|
938
|
-
/**
|
|
939
|
-
* Resumes a factory run using its persisted name, arguments, journal, and accounting.
|
|
940
|
-
*
|
|
941
|
-
* @param params Parameters for resuming a factory run from its persisted identity.
|
|
942
|
-
*
|
|
943
|
-
* @returns Resolved persisted factory identity and resumed run envelope.
|
|
944
|
-
*/
|
|
945
|
-
resume: async (params) => connection.sendRequest("session.factory.resume", { sessionId, ...params }),
|
|
946
|
-
/**
|
|
947
|
-
* Gets the current or settled envelope for a factory run.
|
|
948
|
-
*
|
|
949
|
-
* @param params Parameters for retrieving a factory run.
|
|
950
|
-
*
|
|
951
|
-
* @returns Complete current or terminal factory run envelope.
|
|
952
|
-
*/
|
|
953
|
-
getRun: async (params) => connection.sendRequest("session.factory.getRun", { sessionId, ...params }),
|
|
954
|
-
/**
|
|
955
|
-
* Lists durable factory runs for this session in creation order.
|
|
956
|
-
*
|
|
957
|
-
* @param params Parameters for paging factory runs.
|
|
958
|
-
*
|
|
959
|
-
* @returns A page of factory runs in durable creation order.
|
|
960
|
-
*/
|
|
961
|
-
listRuns: async (params) => connection.sendRequest("session.factory.listRuns", { sessionId, ...params }),
|
|
962
|
-
/**
|
|
963
|
-
* Gets durable and live observability detail for one factory run.
|
|
964
|
-
*
|
|
965
|
-
* @param params Parameters for retrieving a factory run.
|
|
966
|
-
*
|
|
967
|
-
* @returns Full factory run observability detail.
|
|
968
|
-
*/
|
|
969
|
-
getRunDetail: async (params) => connection.sendRequest("session.factory.getRunDetail", { sessionId, ...params }),
|
|
970
|
-
/**
|
|
971
|
-
* Pages durable progress for one factory run.
|
|
972
|
-
*
|
|
973
|
-
* @param params Parameters for paging factory progress.
|
|
974
|
-
*
|
|
975
|
-
* @returns A bidirectional page of factory progress.
|
|
976
|
-
*/
|
|
977
|
-
getRunProgress: async (params) => connection.sendRequest("session.factory.getRunProgress", { sessionId, ...params }),
|
|
978
|
-
/**
|
|
979
|
-
* Requests cancellation of a factory run and returns its run envelope.
|
|
980
|
-
*
|
|
981
|
-
* @param params Parameters for cancelling a factory run.
|
|
982
|
-
*
|
|
983
|
-
* @returns Complete current or terminal factory run envelope.
|
|
984
|
-
*/
|
|
985
|
-
cancel: async (params) => connection.sendRequest("session.factory.cancel", { sessionId, ...params }),
|
|
986
|
-
/**
|
|
987
|
-
* Pauses a running factory and returns its settled run envelope.
|
|
988
|
-
*
|
|
989
|
-
* @param params Parameters for pausing a running factory.
|
|
990
|
-
*
|
|
991
|
-
* @returns Complete current or terminal factory run envelope.
|
|
992
|
-
*/
|
|
993
|
-
pause: async (params) => connection.sendRequest("session.factory.pause", { sessionId, ...params }),
|
|
994
|
-
/**
|
|
995
|
-
* Records a batch of ordered factory progress lines.
|
|
996
|
-
*
|
|
997
|
-
* @param params Parameters for recording factory progress.
|
|
998
|
-
*
|
|
999
|
-
* @returns Acknowledgement that a factory request was accepted.
|
|
1000
|
-
*/
|
|
1001
|
-
log: async (params) => connection.sendRequest("session.factory.log", { sessionId, ...params }),
|
|
1002
|
-
/**
|
|
1003
|
-
* Runs one factory-scoped subagent and returns its result.
|
|
1004
|
-
*
|
|
1005
|
-
* @param params Parameters for one factory-scoped subagent call.
|
|
1006
|
-
*
|
|
1007
|
-
* @returns Result of one factory-scoped subagent call.
|
|
1008
|
-
*/
|
|
1009
|
-
agent: async (params) => connection.sendRequest("session.factory.agent", { sessionId, ...params }),
|
|
1010
|
-
/** @experimental */
|
|
1011
|
-
journal: {
|
|
1012
|
-
/**
|
|
1013
|
-
* Reads a memoized factory journal entry.
|
|
1014
|
-
*
|
|
1015
|
-
* @param params Parameters for reading a factory journal entry.
|
|
1016
|
-
*
|
|
1017
|
-
* @returns Result of reading a factory journal entry.
|
|
1018
|
-
*/
|
|
1019
|
-
get: async (params) => connection.sendRequest("session.factory.journal.get", { sessionId, ...params }),
|
|
1020
|
-
/**
|
|
1021
|
-
* Stores a memoized factory journal entry.
|
|
1022
|
-
*
|
|
1023
|
-
* @param params Parameters for storing a factory journal entry.
|
|
1024
|
-
*
|
|
1025
|
-
* @returns Acknowledgement that a factory request was accepted.
|
|
1026
|
-
*/
|
|
1027
|
-
put: async (params) => connection.sendRequest("session.factory.journal.put", { sessionId, ...params })
|
|
1028
|
-
}
|
|
1029
|
-
},
|
|
1030
|
-
/** @experimental */
|
|
1031
1143
|
workflow: {
|
|
1032
1144
|
/**
|
|
1033
1145
|
* Runs a registered dynamic workflow by name at the top level.
|
|
@@ -1425,7 +1537,20 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1425
1537
|
*
|
|
1426
1538
|
* @returns Instruction sources loaded for the session, in merge order.
|
|
1427
1539
|
*/
|
|
1428
|
-
getSources: async () => connection.sendRequest("session.instructions.getSources", { sessionId })
|
|
1540
|
+
getSources: async () => connection.sendRequest("session.instructions.getSources", { sessionId }),
|
|
1541
|
+
/**
|
|
1542
|
+
* Invalidates cached custom-instruction discovery so subsequent turns and source reads observe instruction files currently on disk.
|
|
1543
|
+
*/
|
|
1544
|
+
reload: async () => connection.sendRequest("session.instructions.reload", { sessionId })
|
|
1545
|
+
},
|
|
1546
|
+
/** @experimental */
|
|
1547
|
+
customizations: {
|
|
1548
|
+
/**
|
|
1549
|
+
* 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.
|
|
1550
|
+
*
|
|
1551
|
+
* @returns Diagnostics from reloading skill definitions, with warnings and errors as separate lists.
|
|
1552
|
+
*/
|
|
1553
|
+
reload: async () => connection.sendRequest("session.customizations.reload", { sessionId })
|
|
1429
1554
|
},
|
|
1430
1555
|
/** @experimental */
|
|
1431
1556
|
fleet: {
|
|
@@ -1724,7 +1849,15 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1724
1849
|
*/
|
|
1725
1850
|
authenticationStateChanged: async (params) => connection.sendRequest("session.mcp.oauth.authenticationStateChanged", { sessionId, ...params }),
|
|
1726
1851
|
/**
|
|
1727
|
-
*
|
|
1852
|
+
* 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.
|
|
1853
|
+
*
|
|
1854
|
+
* @param params Effect-free preparation bound to the existing local session, requester and installation, with frozen options.
|
|
1855
|
+
*
|
|
1856
|
+
* @returns An inert runtime-issued login handle. Preparation alone performs no activation or OAuth work.
|
|
1857
|
+
*/
|
|
1858
|
+
prepareLogin: async (params) => connection.sendRequest("session.mcp.oauth.prepareLogin", { sessionId, ...params }),
|
|
1859
|
+
/**
|
|
1860
|
+
* 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.
|
|
1728
1861
|
*
|
|
1729
1862
|
* @param params Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection.
|
|
1730
1863
|
*
|
|
@@ -1739,6 +1872,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1739
1872
|
* @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.
|
|
1740
1873
|
*/
|
|
1741
1874
|
probe: async (params) => connection.sendRequest("session.mcp.oauth.probe", { sessionId, ...params }),
|
|
1875
|
+
/**
|
|
1876
|
+
* Cancels the exact owned OAuth login issued to this original session requester, without clearing shared credentials.
|
|
1877
|
+
*
|
|
1878
|
+
* @param params Targets only the original prepared/applying owned login on this exact session requester.
|
|
1879
|
+
*
|
|
1880
|
+
* @returns Honest terminal cancellation result; persistence or recovery failures remain RPC errors.
|
|
1881
|
+
*/
|
|
1882
|
+
cancelLogin: async (params) => connection.sendRequest("session.mcp.oauth.cancelLogin", { sessionId, ...params }),
|
|
1742
1883
|
/**
|
|
1743
1884
|
* Responds to a pending MCP OAuth authorization request by its request id.
|
|
1744
1885
|
*
|
|
@@ -1835,6 +1976,25 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1835
1976
|
}
|
|
1836
1977
|
},
|
|
1837
1978
|
/** @experimental */
|
|
1979
|
+
diagnostics: {
|
|
1980
|
+
/**
|
|
1981
|
+
* 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.
|
|
1982
|
+
*
|
|
1983
|
+
* @param params Patch session diagnostic thresholds for explicitly supplied sources.
|
|
1984
|
+
*
|
|
1985
|
+
* @returns Per-source session diagnostics configuration.
|
|
1986
|
+
*/
|
|
1987
|
+
configure: async (params) => connection.sendRequest("session.diagnostics.configure", { sessionId, ...params }),
|
|
1988
|
+
/**
|
|
1989
|
+
* 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.
|
|
1990
|
+
*
|
|
1991
|
+
* @param params Cursor-based request for session diagnostics. The default limit is 100 (maximum 500); the default waitMs is zero (maximum 30000).
|
|
1992
|
+
*
|
|
1993
|
+
* @returns One cursor-addressed page of retained session diagnostics.
|
|
1994
|
+
*/
|
|
1995
|
+
read: async (params) => connection.sendRequest("session.diagnostics.read", { sessionId, ...params })
|
|
1996
|
+
},
|
|
1997
|
+
/** @experimental */
|
|
1838
1998
|
connectors: {
|
|
1839
1999
|
/**
|
|
1840
2000
|
* Returns feature availability and bounded polling limits for the EXPERIMENTAL session connector API. This method never performs a Connector service request.
|
|
@@ -2714,11 +2874,11 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2714
2874
|
*/
|
|
2715
2875
|
updateText: async (params) => connection.sendRequest("session.queue.updateText", { sessionId, ...params }),
|
|
2716
2876
|
/**
|
|
2717
|
-
* Atomically withdraws an unchanged
|
|
2877
|
+
* 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.
|
|
2718
2878
|
*
|
|
2719
|
-
* @param params Conditional withdrawal of a single user message,
|
|
2879
|
+
* @param params Conditional withdrawal of a single user message, from its queue or from the running turn it started.
|
|
2720
2880
|
*
|
|
2721
|
-
* @returns Result of
|
|
2881
|
+
* @returns Result of withdrawing a user message.
|
|
2722
2882
|
*/
|
|
2723
2883
|
withdrawMessage: async (params) => connection.sendRequest("session.queue.withdrawMessage", { sessionId, ...params }),
|
|
2724
2884
|
/**
|
|
@@ -2958,31 +3118,6 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2958
3118
|
}
|
|
2959
3119
|
},
|
|
2960
3120
|
/** @experimental */
|
|
2961
|
-
factory: {
|
|
2962
|
-
/**
|
|
2963
|
-
* Internal tool-originated factory invocation.
|
|
2964
|
-
*
|
|
2965
|
-
* @param params Internal parameters for invoking a registered factory from a tool.
|
|
2966
|
-
*
|
|
2967
|
-
* @returns Complete current or terminal factory run envelope.
|
|
2968
|
-
*/
|
|
2969
|
-
runFromTool: async (params) => connection.sendRequest("session.factory.runFromTool", { sessionId, ...params }),
|
|
2970
|
-
/**
|
|
2971
|
-
* Internal tool-originated factory resume.
|
|
2972
|
-
*
|
|
2973
|
-
* @param params Internal parameters for resuming a factory run from a tool.
|
|
2974
|
-
*
|
|
2975
|
-
* @returns Resolved persisted factory identity and resumed run envelope.
|
|
2976
|
-
*/
|
|
2977
|
-
resumeFromTool: async (params) => connection.sendRequest("session.factory.resumeFromTool", { sessionId, ...params }),
|
|
2978
|
-
/**
|
|
2979
|
-
* Atomically pauses an owned factory attempt at a durable checkpoint.
|
|
2980
|
-
*
|
|
2981
|
-
* @param params Parameters for an owned durable pause checkpoint.
|
|
2982
|
-
*/
|
|
2983
|
-
pauseAtCheckpoint: async (params) => connection.sendRequest("session.factory.pauseAtCheckpoint", { sessionId, ...params })
|
|
2984
|
-
},
|
|
2985
|
-
/** @experimental */
|
|
2986
3121
|
workflow: {
|
|
2987
3122
|
/**
|
|
2988
3123
|
* Internal tool-originated dynamic workflow invocation.
|
|
@@ -3210,16 +3345,6 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
3210
3345
|
if (!handler) throw new Error(`No providerToken handler registered for session: ${params.sessionId}`);
|
|
3211
3346
|
return handler.getToken(params);
|
|
3212
3347
|
});
|
|
3213
|
-
connection.onRequest("factory.execute", async (params) => {
|
|
3214
|
-
const handler = getHandlers(params.sessionId).factory;
|
|
3215
|
-
if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`);
|
|
3216
|
-
return handler.execute(params);
|
|
3217
|
-
});
|
|
3218
|
-
connection.onRequest("factory.abort", async (params) => {
|
|
3219
|
-
const handler = getHandlers(params.sessionId).factory;
|
|
3220
|
-
if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`);
|
|
3221
|
-
return handler.abort(params);
|
|
3222
|
-
});
|
|
3223
3348
|
connection.onRequest("workflow.execute", async (params) => {
|
|
3224
3349
|
const handler = getHandlers(params.sessionId).workflow;
|
|
3225
3350
|
if (!handler) throw new Error(`No workflow handler registered for session: ${params.sessionId}`);
|
|
@@ -3342,6 +3467,11 @@ function registerClientGlobalApiHandlers(connection, handlers) {
|
|
|
3342
3467
|
if (!handler) throw new Error("No gitHubToken client-global handler registered");
|
|
3343
3468
|
return handler.getToken(params);
|
|
3344
3469
|
});
|
|
3470
|
+
connection.onRequest("installations.confirm", async (params) => {
|
|
3471
|
+
const handler = handlers.installations;
|
|
3472
|
+
if (!handler) throw new Error("No installations client-global handler registered");
|
|
3473
|
+
return handler.confirm(params);
|
|
3474
|
+
});
|
|
3345
3475
|
}
|
|
3346
3476
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3347
3477
|
0 && (module.exports = {
|
package/dist/cjs/index.js
CHANGED
|
@@ -28,7 +28,6 @@ __export(index_exports, {
|
|
|
28
28
|
CopilotWebSocketForwarder: () => import_types2.CopilotWebSocketForwarder,
|
|
29
29
|
CopilotWebSocketHandler: () => import_types2.CopilotWebSocketHandler,
|
|
30
30
|
DisableBypassPermissionsModes: () => import_types.DisableBypassPermissionsModes,
|
|
31
|
-
FactoryResumeError: () => import_factory.FactoryResumeError,
|
|
32
31
|
RuntimeConnection: () => import_types.RuntimeConnection,
|
|
33
32
|
SYSTEM_MESSAGE_SECTIONS: () => import_types2.SYSTEM_MESSAGE_SECTIONS,
|
|
34
33
|
SessionFsSqliteTransactionFailure: () => import_types2.SessionFsSqliteTransactionFailure,
|
|
@@ -39,10 +38,8 @@ __export(index_exports, {
|
|
|
39
38
|
createAttributedPermissionResult: () => import_types2.createAttributedPermissionResult,
|
|
40
39
|
createCanvas: () => import_canvas.createCanvas,
|
|
41
40
|
createSessionFsAdapter: () => import_types2.createSessionFsAdapter,
|
|
42
|
-
defineFactory: () => import_factory.defineFactory,
|
|
43
41
|
defineTool: () => import_types2.defineTool,
|
|
44
42
|
defineWorkflow: () => import_workflow.defineWorkflow,
|
|
45
|
-
isFactoryRunTerminal: () => import_factory.isFactoryRunTerminal,
|
|
46
43
|
isWorkflowRunTerminal: () => import_workflow.isWorkflowRunTerminal
|
|
47
44
|
});
|
|
48
45
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -50,7 +47,6 @@ var import_client = require("./client.js");
|
|
|
50
47
|
var import_types = require("./types.js");
|
|
51
48
|
var import_toolSet = require("./toolSet.js");
|
|
52
49
|
var import_session = require("./session.js");
|
|
53
|
-
var import_factory = require("./factory.js");
|
|
54
50
|
var import_workflow = require("./workflow.js");
|
|
55
51
|
var import_canvas = require("./canvas.js");
|
|
56
52
|
var import_types2 = require("./types.js");
|
|
@@ -66,7 +62,6 @@ var import_types2 = require("./types.js");
|
|
|
66
62
|
CopilotWebSocketForwarder,
|
|
67
63
|
CopilotWebSocketHandler,
|
|
68
64
|
DisableBypassPermissionsModes,
|
|
69
|
-
FactoryResumeError,
|
|
70
65
|
RuntimeConnection,
|
|
71
66
|
SYSTEM_MESSAGE_SECTIONS,
|
|
72
67
|
SessionFsSqliteTransactionFailure,
|
|
@@ -77,9 +72,7 @@ var import_types2 = require("./types.js");
|
|
|
77
72
|
createAttributedPermissionResult,
|
|
78
73
|
createCanvas,
|
|
79
74
|
createSessionFsAdapter,
|
|
80
|
-
defineFactory,
|
|
81
75
|
defineTool,
|
|
82
76
|
defineWorkflow,
|
|
83
|
-
isFactoryRunTerminal,
|
|
84
77
|
isWorkflowRunTerminal
|
|
85
78
|
});
|