@github/copilot-sdk 1.0.15-preview.3 → 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 +44 -0
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +18 -6
- package/dist/cjs/extension.js +1 -12
- package/dist/cjs/generated/rpc.js +262 -173
- package/dist/cjs/index.js +0 -7
- package/dist/cjs/installationConfirmation.js +98 -0
- package/dist/cjs/session.js +14 -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 +20 -6
- package/dist/extension.d.ts +10 -24
- package/dist/extension.js +1 -13
- package/dist/generated/rpc.d.ts +5960 -4645
- package/dist/generated/rpc.js +262 -173
- package/dist/generated/session-events.d.ts +197 -118
- 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 +2 -25
- package/dist/session.js +14 -529
- package/dist/types.d.ts +10 -65
- 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
|
@@ -196,7 +196,74 @@ function createServerRpc(connection) {
|
|
|
196
196
|
*
|
|
197
197
|
* @returns Outcome of an mcp.planInstall call: either a normalised plan, or one typed refusal. Nothing is written in either case.
|
|
198
198
|
*/
|
|
199
|
-
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
|
+
}
|
|
200
267
|
},
|
|
201
268
|
/** @experimental */
|
|
202
269
|
extensions: {
|
|
@@ -219,6 +286,115 @@ function createServerRpc(connection) {
|
|
|
219
286
|
*/
|
|
220
287
|
disable: async (params) => connection.sendRequest("extensions.disable", params)
|
|
221
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
|
+
},
|
|
222
398
|
/**
|
|
223
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.
|
|
224
400
|
*
|
|
@@ -344,40 +520,6 @@ function createServerRpc(connection) {
|
|
|
344
520
|
}
|
|
345
521
|
},
|
|
346
522
|
/** @experimental */
|
|
347
|
-
skills: {
|
|
348
|
-
/** @experimental */
|
|
349
|
-
config: {
|
|
350
|
-
/**
|
|
351
|
-
* Replaces the global list of disabled skills.
|
|
352
|
-
*
|
|
353
|
-
* @param params Skill names to mark as disabled in global configuration, replacing any previous list.
|
|
354
|
-
*/
|
|
355
|
-
setDisabledSkills: async (params) => connection.sendRequest("skills.config.setDisabledSkills", params),
|
|
356
|
-
/**
|
|
357
|
-
* Atomically adds or removes one skill from the disabled list.
|
|
358
|
-
*
|
|
359
|
-
* @param params Adds or removes a single skill from the global disabled list, leaving every other entry untouched.
|
|
360
|
-
*/
|
|
361
|
-
setSkillDisabled: async (params) => connection.sendRequest("skills.config.setSkillDisabled", params)
|
|
362
|
-
},
|
|
363
|
-
/**
|
|
364
|
-
* Discovers skills across global and project sources.
|
|
365
|
-
*
|
|
366
|
-
* @param params Optional project paths and additional skill directories to include in discovery.
|
|
367
|
-
*
|
|
368
|
-
* @returns Skills discovered across global and project sources.
|
|
369
|
-
*/
|
|
370
|
-
discover: async (params) => connection.sendRequest("skills.discover", params),
|
|
371
|
-
/**
|
|
372
|
-
* 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.
|
|
373
|
-
*
|
|
374
|
-
* @param params Optional project paths to enumerate.
|
|
375
|
-
*
|
|
376
|
-
* @returns Canonical locations where skills can be created so the runtime will recognize them.
|
|
377
|
-
*/
|
|
378
|
-
getDiscoveryPaths: async (params) => connection.sendRequest("skills.getDiscoveryPaths", params)
|
|
379
|
-
},
|
|
380
|
-
/** @experimental */
|
|
381
523
|
agents: {
|
|
382
524
|
/**
|
|
383
525
|
* Discovers custom agents across user, project, plugin, and remote sources.
|
|
@@ -782,6 +924,17 @@ function createInternalServerRpc(connection) {
|
|
|
782
924
|
* @param params Params to attach or detach an in-process ExtensionController delegate.
|
|
783
925
|
*/
|
|
784
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)
|
|
785
938
|
}
|
|
786
939
|
};
|
|
787
940
|
}
|
|
@@ -884,6 +1037,58 @@ function createSessionRpc(connection, sessionId) {
|
|
|
884
1037
|
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", { sessionId, ...params })
|
|
885
1038
|
},
|
|
886
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 */
|
|
887
1092
|
debug: {
|
|
888
1093
|
/**
|
|
889
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.
|
|
@@ -935,108 +1140,6 @@ function createSessionRpc(connection, sessionId) {
|
|
|
935
1140
|
}
|
|
936
1141
|
},
|
|
937
1142
|
/** @experimental */
|
|
938
|
-
factory: {
|
|
939
|
-
/**
|
|
940
|
-
* Runs a registered factory by name at the top level.
|
|
941
|
-
*
|
|
942
|
-
* @param params Parameters for invoking a registered factory.
|
|
943
|
-
*
|
|
944
|
-
* @returns Complete current or terminal factory run envelope.
|
|
945
|
-
*/
|
|
946
|
-
run: async (params) => connection.sendRequest("session.factory.run", { sessionId, ...params }),
|
|
947
|
-
/**
|
|
948
|
-
* Resumes a factory run using its persisted name, arguments, journal, and accounting.
|
|
949
|
-
*
|
|
950
|
-
* @param params Parameters for resuming a factory run from its persisted identity.
|
|
951
|
-
*
|
|
952
|
-
* @returns Resolved persisted factory identity and resumed run envelope.
|
|
953
|
-
*/
|
|
954
|
-
resume: async (params) => connection.sendRequest("session.factory.resume", { sessionId, ...params }),
|
|
955
|
-
/**
|
|
956
|
-
* Gets the current or settled envelope for a factory run.
|
|
957
|
-
*
|
|
958
|
-
* @param params Parameters for retrieving a factory run.
|
|
959
|
-
*
|
|
960
|
-
* @returns Complete current or terminal factory run envelope.
|
|
961
|
-
*/
|
|
962
|
-
getRun: async (params) => connection.sendRequest("session.factory.getRun", { sessionId, ...params }),
|
|
963
|
-
/**
|
|
964
|
-
* Lists durable factory runs for this session in creation order.
|
|
965
|
-
*
|
|
966
|
-
* @param params Parameters for paging factory runs.
|
|
967
|
-
*
|
|
968
|
-
* @returns A page of factory runs in durable creation order.
|
|
969
|
-
*/
|
|
970
|
-
listRuns: async (params) => connection.sendRequest("session.factory.listRuns", { sessionId, ...params }),
|
|
971
|
-
/**
|
|
972
|
-
* Gets durable and live observability detail for one factory run.
|
|
973
|
-
*
|
|
974
|
-
* @param params Parameters for retrieving a factory run.
|
|
975
|
-
*
|
|
976
|
-
* @returns Full factory run observability detail.
|
|
977
|
-
*/
|
|
978
|
-
getRunDetail: async (params) => connection.sendRequest("session.factory.getRunDetail", { sessionId, ...params }),
|
|
979
|
-
/**
|
|
980
|
-
* Pages durable progress for one factory run.
|
|
981
|
-
*
|
|
982
|
-
* @param params Parameters for paging factory progress.
|
|
983
|
-
*
|
|
984
|
-
* @returns A bidirectional page of factory progress.
|
|
985
|
-
*/
|
|
986
|
-
getRunProgress: async (params) => connection.sendRequest("session.factory.getRunProgress", { sessionId, ...params }),
|
|
987
|
-
/**
|
|
988
|
-
* Requests cancellation of a factory run and returns its run envelope.
|
|
989
|
-
*
|
|
990
|
-
* @param params Parameters for cancelling a factory run.
|
|
991
|
-
*
|
|
992
|
-
* @returns Complete current or terminal factory run envelope.
|
|
993
|
-
*/
|
|
994
|
-
cancel: async (params) => connection.sendRequest("session.factory.cancel", { sessionId, ...params }),
|
|
995
|
-
/**
|
|
996
|
-
* Pauses a running factory and returns its settled run envelope.
|
|
997
|
-
*
|
|
998
|
-
* @param params Parameters for pausing a running factory.
|
|
999
|
-
*
|
|
1000
|
-
* @returns Complete current or terminal factory run envelope.
|
|
1001
|
-
*/
|
|
1002
|
-
pause: async (params) => connection.sendRequest("session.factory.pause", { sessionId, ...params }),
|
|
1003
|
-
/**
|
|
1004
|
-
* Records a batch of ordered factory progress lines.
|
|
1005
|
-
*
|
|
1006
|
-
* @param params Parameters for recording factory progress.
|
|
1007
|
-
*
|
|
1008
|
-
* @returns Acknowledgement that a factory request was accepted.
|
|
1009
|
-
*/
|
|
1010
|
-
log: async (params) => connection.sendRequest("session.factory.log", { sessionId, ...params }),
|
|
1011
|
-
/**
|
|
1012
|
-
* Runs one factory-scoped subagent and returns its result.
|
|
1013
|
-
*
|
|
1014
|
-
* @param params Parameters for one factory-scoped subagent call.
|
|
1015
|
-
*
|
|
1016
|
-
* @returns Result of one factory-scoped subagent call.
|
|
1017
|
-
*/
|
|
1018
|
-
agent: async (params) => connection.sendRequest("session.factory.agent", { sessionId, ...params }),
|
|
1019
|
-
/** @experimental */
|
|
1020
|
-
journal: {
|
|
1021
|
-
/**
|
|
1022
|
-
* Reads a memoized factory journal entry.
|
|
1023
|
-
*
|
|
1024
|
-
* @param params Parameters for reading a factory journal entry.
|
|
1025
|
-
*
|
|
1026
|
-
* @returns Result of reading a factory journal entry.
|
|
1027
|
-
*/
|
|
1028
|
-
get: async (params) => connection.sendRequest("session.factory.journal.get", { sessionId, ...params }),
|
|
1029
|
-
/**
|
|
1030
|
-
* Stores a memoized factory journal entry.
|
|
1031
|
-
*
|
|
1032
|
-
* @param params Parameters for storing a factory journal entry.
|
|
1033
|
-
*
|
|
1034
|
-
* @returns Acknowledgement that a factory request was accepted.
|
|
1035
|
-
*/
|
|
1036
|
-
put: async (params) => connection.sendRequest("session.factory.journal.put", { sessionId, ...params })
|
|
1037
|
-
}
|
|
1038
|
-
},
|
|
1039
|
-
/** @experimental */
|
|
1040
1143
|
workflow: {
|
|
1041
1144
|
/**
|
|
1042
1145
|
* Runs a registered dynamic workflow by name at the top level.
|
|
@@ -1746,7 +1849,15 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1746
1849
|
*/
|
|
1747
1850
|
authenticationStateChanged: async (params) => connection.sendRequest("session.mcp.oauth.authenticationStateChanged", { sessionId, ...params }),
|
|
1748
1851
|
/**
|
|
1749
|
-
*
|
|
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.
|
|
1750
1861
|
*
|
|
1751
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.
|
|
1752
1863
|
*
|
|
@@ -1761,6 +1872,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1761
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.
|
|
1762
1873
|
*/
|
|
1763
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 }),
|
|
1764
1883
|
/**
|
|
1765
1884
|
* Responds to a pending MCP OAuth authorization request by its request id.
|
|
1766
1885
|
*
|
|
@@ -2999,31 +3118,6 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2999
3118
|
}
|
|
3000
3119
|
},
|
|
3001
3120
|
/** @experimental */
|
|
3002
|
-
factory: {
|
|
3003
|
-
/**
|
|
3004
|
-
* Internal tool-originated factory invocation.
|
|
3005
|
-
*
|
|
3006
|
-
* @param params Internal parameters for invoking a registered factory from a tool.
|
|
3007
|
-
*
|
|
3008
|
-
* @returns Complete current or terminal factory run envelope.
|
|
3009
|
-
*/
|
|
3010
|
-
runFromTool: async (params) => connection.sendRequest("session.factory.runFromTool", { sessionId, ...params }),
|
|
3011
|
-
/**
|
|
3012
|
-
* Internal tool-originated factory resume.
|
|
3013
|
-
*
|
|
3014
|
-
* @param params Internal parameters for resuming a factory run from a tool.
|
|
3015
|
-
*
|
|
3016
|
-
* @returns Resolved persisted factory identity and resumed run envelope.
|
|
3017
|
-
*/
|
|
3018
|
-
resumeFromTool: async (params) => connection.sendRequest("session.factory.resumeFromTool", { sessionId, ...params }),
|
|
3019
|
-
/**
|
|
3020
|
-
* Atomically pauses an owned factory attempt at a durable checkpoint.
|
|
3021
|
-
*
|
|
3022
|
-
* @param params Parameters for an owned durable pause checkpoint.
|
|
3023
|
-
*/
|
|
3024
|
-
pauseAtCheckpoint: async (params) => connection.sendRequest("session.factory.pauseAtCheckpoint", { sessionId, ...params })
|
|
3025
|
-
},
|
|
3026
|
-
/** @experimental */
|
|
3027
3121
|
workflow: {
|
|
3028
3122
|
/**
|
|
3029
3123
|
* Internal tool-originated dynamic workflow invocation.
|
|
@@ -3251,16 +3345,6 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
3251
3345
|
if (!handler) throw new Error(`No providerToken handler registered for session: ${params.sessionId}`);
|
|
3252
3346
|
return handler.getToken(params);
|
|
3253
3347
|
});
|
|
3254
|
-
connection.onRequest("factory.execute", async (params) => {
|
|
3255
|
-
const handler = getHandlers(params.sessionId).factory;
|
|
3256
|
-
if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`);
|
|
3257
|
-
return handler.execute(params);
|
|
3258
|
-
});
|
|
3259
|
-
connection.onRequest("factory.abort", async (params) => {
|
|
3260
|
-
const handler = getHandlers(params.sessionId).factory;
|
|
3261
|
-
if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`);
|
|
3262
|
-
return handler.abort(params);
|
|
3263
|
-
});
|
|
3264
3348
|
connection.onRequest("workflow.execute", async (params) => {
|
|
3265
3349
|
const handler = getHandlers(params.sessionId).workflow;
|
|
3266
3350
|
if (!handler) throw new Error(`No workflow handler registered for session: ${params.sessionId}`);
|
|
@@ -3383,6 +3467,11 @@ function registerClientGlobalApiHandlers(connection, handlers) {
|
|
|
3383
3467
|
if (!handler) throw new Error("No gitHubToken client-global handler registered");
|
|
3384
3468
|
return handler.getToken(params);
|
|
3385
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
|
+
});
|
|
3386
3475
|
}
|
|
3387
3476
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3388
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
|
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var installationConfirmation_exports = {};
|
|
20
|
+
__export(installationConfirmation_exports, {
|
|
21
|
+
createInstallationConfirmationAdapter: () => createInstallationConfirmationAdapter
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(installationConfirmation_exports);
|
|
24
|
+
var import_node = require("vscode-jsonrpc/node.js");
|
|
25
|
+
function createInstallationConfirmationAdapter(connection, handler) {
|
|
26
|
+
const closed = new import_node.CancellationTokenSource();
|
|
27
|
+
const closeSubscription = connection.onClose(() => closed.cancel());
|
|
28
|
+
const disposeSubscription = connection.onDispose(() => {
|
|
29
|
+
closed.cancel();
|
|
30
|
+
closed.dispose();
|
|
31
|
+
closeSubscription.dispose();
|
|
32
|
+
disposeSubscription.dispose();
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
async confirm(request, token) {
|
|
36
|
+
if (!token) {
|
|
37
|
+
throw new Error("Installation confirmation request cancellation is unavailable");
|
|
38
|
+
}
|
|
39
|
+
const { confirmationId, reviewFingerprint } = request;
|
|
40
|
+
const combined = new import_node.CancellationTokenSource();
|
|
41
|
+
const subscriptions = [];
|
|
42
|
+
const cancelRequest = () => combined.cancel();
|
|
43
|
+
const cancelConnection = () => combined.cancel();
|
|
44
|
+
const checkCancellation = () => {
|
|
45
|
+
if (closed.token.isCancellationRequested) {
|
|
46
|
+
throw new Error("Installation confirmation connection closed");
|
|
47
|
+
}
|
|
48
|
+
if (token.isCancellationRequested) {
|
|
49
|
+
throw new import_node.ResponseError(-32800, "Installation confirmation request cancelled");
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
try {
|
|
53
|
+
subscriptions.push(
|
|
54
|
+
token.onCancellationRequested(cancelRequest),
|
|
55
|
+
closed.token.onCancellationRequested(cancelConnection)
|
|
56
|
+
);
|
|
57
|
+
if (token.isCancellationRequested || closed.token.isCancellationRequested) {
|
|
58
|
+
combined.cancel();
|
|
59
|
+
}
|
|
60
|
+
checkCancellation();
|
|
61
|
+
const cancelled = new Promise((_resolve, reject) => {
|
|
62
|
+
subscriptions.push(
|
|
63
|
+
token.onCancellationRequested(
|
|
64
|
+
() => reject(
|
|
65
|
+
new import_node.ResponseError(
|
|
66
|
+
-32800,
|
|
67
|
+
"Installation confirmation request cancelled"
|
|
68
|
+
)
|
|
69
|
+
)
|
|
70
|
+
),
|
|
71
|
+
closed.token.onCancellationRequested(
|
|
72
|
+
() => reject(new Error("Installation confirmation connection closed"))
|
|
73
|
+
)
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
const decision = await Promise.race([
|
|
77
|
+
Promise.resolve().then(() => {
|
|
78
|
+
checkCancellation();
|
|
79
|
+
return handler(request, combined.token);
|
|
80
|
+
}),
|
|
81
|
+
cancelled
|
|
82
|
+
]);
|
|
83
|
+
checkCancellation();
|
|
84
|
+
if (decision !== "confirm" && decision !== "decline" && decision !== "cancel") {
|
|
85
|
+
throw new Error("Invalid installation confirmation decision");
|
|
86
|
+
}
|
|
87
|
+
return { confirmationId, reviewFingerprint, decision };
|
|
88
|
+
} finally {
|
|
89
|
+
for (const subscription of subscriptions) subscription.dispose();
|
|
90
|
+
combined.dispose();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
96
|
+
0 && (module.exports = {
|
|
97
|
+
createInstallationConfirmationAdapter
|
|
98
|
+
});
|