@github/copilot-sdk 1.0.29-preview.1 → 1.0.29-preview.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -813,9 +813,17 @@ function createServerRpc(connection) {
813
813
  *
814
814
  * @param params A bounded catalog search. Both the query length and the result count are capped by the schema so a caller cannot request an unbounded scan.
815
815
  *
816
- * @returns Outcome of a catalog.search call: either bounded inert candidates, or one typed refusal. Never a partial success.
816
+ * @returns Outcome of catalog.search or catalog.recommend: either bounded inert candidates, or one typed refusal. Never a partial success.
817
817
  */
818
818
  search: async (params) => connection.sendRequest("catalog.search", params),
819
+ /**
820
+ * Requests the initial page of at most ten official-product recommendations for a complete task and product, bound to an existing attached local session. Requires catalog-recommend, catalog-search-session-bound and catalog-search-credential-required. Uses the selected GitHub.com user credential on the fixed Agent Finder recommendations route; successful capability negotiation does not establish service acceptance. Returns the existing inert catalog candidates and retained install references with the typed catalog refusal union. No anonymous retry, unfiltered search fallback or continuation is performed. Server-owned product approvals establish provenance, not task suitability. Read-only: nothing is installed, configured or persisted.
821
+ *
822
+ * @param params Initial-page official-product recommendations for a complete task. The runtime fixes recommendationPolicy to official-product and pageSize to 10; callers cannot override the policy, request pagination or fall back to search.
823
+ *
824
+ * @returns Outcome of catalog.search or catalog.recommend: either bounded inert candidates, or one typed refusal. Never a partial success.
825
+ */
826
+ recommend: async (params) => connection.sendRequest("catalog.recommend", params),
819
827
  /**
820
828
  * Retrieves one saved feed by its opaque ID, optionally filtered by trust tier. Requires catalog-feeds and catalog-search-credential-required, and uses the same authority, credential policy, optional session binding and candidate projection as catalog.search, so available entries are the same inert candidates, with the same installability, handles and display metadata, and install through the same confirmed flows. Entries keep the feed's order; an entry the runtime cannot present is returned as unavailable with a reason rather than failing the feed. No anonymous retry. Read-only: nothing is installed, configured, or persisted.
821
829
  *
@@ -1781,7 +1789,23 @@ function createInternalServerRpc(connection) {
1781
1789
  *
1782
1790
  * @returns The environment variable supplying a classic personal access token, when one is set.
1783
1791
  */
1784
- getTokenEnvVar: async () => connection.sendRequest("account.getTokenEnvVar", {})
1792
+ getTokenEnvVar: async () => connection.sendRequest("account.getTokenEnvVar", {}),
1793
+ /**
1794
+ * Enrolls the supplied identity in Copilot Free. A host offers this when a signed-in user has no Copilot subscription, so that signing up does not mean leaving for a browser. The runtime resolves the identity's credential itself, so the caller sends none. Read `kind` before `status`: an identity whose credential cannot be resolved answers `no-token` rather than failing the call, because that asks the user to sign in again rather than reporting that enrollment broke. Enrolling an already-enrolled account succeeds and reports `already_subscribed`. This does not refresh the caller's cached account state; a host that shows subscription status should re-read it afterwards.
1795
+ *
1796
+ * @param params The authentication identity to enroll in Copilot Free.
1797
+ *
1798
+ * @returns What came of a Copilot Free enrollment attempt.
1799
+ */
1800
+ subscribeCopilotFree: async (params) => connection.sendRequest("account.subscribeCopilotFree", params),
1801
+ /**
1802
+ * Resolves the base URL of the GitHub host from its configured names, normalizing a bare hostname into an `https://` URL and falling back to the public github.com host when neither name is set. Unlike `account.getWebUrl` this needs no identity, so a host can reach it before anyone has signed in -- which is when an enterprise instance must already be known.
1803
+ *
1804
+ * @param params Configured names of the GitHub host to resolve.
1805
+ *
1806
+ * @returns Absolute base URL of the GitHub host.
1807
+ */
1808
+ getHostUrl: async (params) => connection.sendRequest("account.getHostUrl", params)
1785
1809
  },
1786
1810
  /** @experimental */
1787
1811
  mcp: {
@@ -1973,7 +1997,23 @@ function createInternalServerRpc(connection) {
1973
1997
  *
1974
1998
  * @returns The GitHub repository that owns the requested path, when the selected remote (`origin`, else the first) is on a GitHub host.
1975
1999
  */
1976
- atPath: async (params) => connection.sendRequest("gitHubRepository.atPath", params)
2000
+ atPath: async (params) => connection.sendRequest("gitHubRepository.atPath", params),
2001
+ /**
2002
+ * Resolves the owner and name of a GitHub repository from its numeric repository id, by asking the GitHub API under the supplied credential. Returns a null `repository` when the id names nothing the credential can see, which the API reports as a 404, so a caller can tell 'no such visible repository' apart from a request that failed. The host queried is derived from `authInfo` rather than supplied separately, so the lookup always runs against the account's own GitHub host.
2003
+ *
2004
+ * @param params Selects a GitHub repository by its numeric repository id, and the credential to look it up under.
2005
+ *
2006
+ * @returns The repository the requested id names, when the credential can see one.
2007
+ */
2008
+ getById: async (params) => connection.sendRequest("gitHubRepository.getById", params),
2009
+ /**
2010
+ * Finds the pull request a branch is open against, searching every repository in `baseRepositories` so a fork's branch finds the pull request it opened upstream. A candidate is discarded unless `headOwner` owns its head branch, because a branch name alone is ambiguous across forks. `status` separates 'not authenticated', 'no such pull request' and 'the search failed', so a caller can tell a conclusive absence apart from an unknown one. The host queried is derived from `authInfo` rather than supplied separately, so the lookup always runs against the account's own GitHub host.
2011
+ *
2012
+ * @param params Selects the pull request a branch is open against, and the credential to look it up under. The branch is searched across every repository in `baseRepositories`, which lets a fork's branch find the pull request it opened against upstream.
2013
+ *
2014
+ * @returns Outcome of a branch pull-request lookup. `status` carries why, because 'not authenticated', 'no pull request' and 'the search failed' are three different answers and only the first two are conclusive.
2015
+ */
2016
+ lookupBranchPullRequest: async (params) => connection.sendRequest("gitHubRepository.lookupBranchPullRequest", params)
1977
2017
  },
1978
2018
  /** @experimental */
1979
2019
  gitHubOwners: {
@@ -2141,11 +2181,242 @@ function createInternalServerRpc(connection) {
2141
2181
  * @returns Live agent metadata without connection credentials.
2142
2182
  */
2143
2183
  listEntries: async (params) => connection.sendRequest("agentRegistry.listEntries", params)
2184
+ },
2185
+ /** @experimental */
2186
+ gitHubFetch: {
2187
+ /**
2188
+ * Registers one authenticated GitHub API request before it starts, so cancellation can name the operation. Each request claims its id once. Refused for extensions.
2189
+ *
2190
+ * @returns One registered GitHub request, shared by execution and cancellation.
2191
+ */
2192
+ allocateRequestId: async () => connection.sendRequest("gitHubFetch.allocateRequestId", {}),
2193
+ /**
2194
+ * Calls the GitHub API with session credentials, or process credentials when sessionId is absent. A bound host can select its existing auth handle with authOwnerId. The URL must match that identity's API origin or the runtime's explicit debug API origin. Retries and eligible redirects resolve the current credential again. Explicit caller Authorization remains unchanged; cross-origin redirects discard credentials without restoring them on later hops. Release asset bodies require gitHubRelease.downloadAsset. JSON asset metadata and other response bodies remain supported. The runtime supplies a default User-Agent and records request diagnostics. Extensions cannot use this method.
2195
+ *
2196
+ * @param params A GitHub API request without caller-supplied auth identity or credential fields.
2197
+ *
2198
+ * @returns The HTTP response or a classified request failure.
2199
+ */
2200
+ request: async (params) => connection.sendRequest("gitHubFetch.request", params),
2201
+ /**
2202
+ * Executes a named GitHub or Copilot job operation. The runtime derives its URL, headers, retry policy, and credential. sessionId selects session auth; omission selects process auth. A bound host connection can select its existing auth handle with authOwnerId. Retries and eligible redirects resolve the current credential again. Cross-origin redirects discard credentials without restoring them on later hops. Non-success HTTP responses include the formatted error for the host. Extensions cannot use this method.
2203
+ *
2204
+ * @param params Arguments for a named authenticated operation.
2205
+ *
2206
+ * @returns The HTTP response or a classified request failure.
2207
+ */
2208
+ executeOperation: async (params) => connection.sendRequest("gitHubFetch.executeOperation", params),
2209
+ /**
2210
+ * Cancels a registered GitHub request. False means the id is no longer registered. Uses the same runtime request registry as request and executeOperation. Refused for extensions.
2211
+ *
2212
+ * @param params One registered GitHub request, shared by execution and cancellation.
2213
+ *
2214
+ * @returns Whether cancellation reached a registered GitHub request.
2215
+ */
2216
+ cancel: async (params) => connection.sendRequest("gitHubFetch.cancel", params)
2217
+ },
2218
+ /** @experimental */
2219
+ gitHubRelease: {
2220
+ /**
2221
+ * Allocates a connection-owned request id before a release lookup, snapshot, or asset download starts. Use the id to cancel that operation. A snapshot retains its allocation until disposal or connection close.
2222
+ *
2223
+ * @returns A freshly registered request id. Registering it before the work starts is what lets a cancel that races the request still find something to cancel.
2224
+ */
2225
+ allocateRequestId: async () => connection.sendRequest("gitHubRelease.allocateRequestId", {}),
2226
+ /**
2227
+ * Retires an unused allocation that this caller will never dispatch. Only an unclaimed id on this connection with no active guard is eligible. Active, foreign, unknown and previously retired ids return abandoned: false. Ordinary cancellation still preserves the first canceled claim. This cleanup remains available during shutdown and is refused for extensions.
2228
+ *
2229
+ * @param params An unused release allocation that this caller will never dispatch. This is separate from cancellation before a request arrives.
2230
+ *
2231
+ * @returns Whether the runtime retired an unused allocation without affecting active work.
2232
+ */
2233
+ abandonRequest: async (params) => connection.sendRequest("gitHubRelease.abandonRequest", params),
2234
+ /**
2235
+ * Looks up a published release or release list. A bound host connection uses its original auth source. Other SDK callers keep the existing authInfo path. The runtime resolves credentials for each request and redirect. Public releases also permit anonymous access. The kind field distinguishes a result, a missing tag, no release, a rate limit, and failure. This raw lookup does not return a shared snapshot.
2236
+ *
2237
+ * @param params Which release to look up, the credential to look it up under, and the request id that makes the lookup cancellable.
2238
+ *
2239
+ * @returns Outcome of a release lookup. `releaseJson` is present only for `found`, and `message` only for the kinds that carry an explanation.
2240
+ */
2241
+ lookup: async (params) => connection.sendRequest("gitHubRelease.lookup", params),
2242
+ /**
2243
+ * Loads one immutable release snapshot for an update client or SDK host. The runtime retains the original credential source and resolves it for each request. Calls with the same allocated request id and options share one lookup and result. A dropped waiter does not cancel that lookup. Use gitHubRelease.cancel to dispose the operation. The runtime admits one failure report before it publishes a failed result. Extensions cannot use this method.
2244
+ *
2245
+ * @param params Immutable options for one connection-owned release snapshot.
2246
+ *
2247
+ * @returns The shared release result with its original lookup duration. Runtime worker faults remain RPC errors.
2248
+ */
2249
+ getSnapshot: async (params) => connection.sendRequest("gitHubRelease.getSnapshot", params),
2250
+ /**
2251
+ * Cancels an allocated operation on this connection. For a snapshot, disposal also waits for its owned lookup and retires its credential authority. It does not delete completed caller-owned downloads. An unknown or foreign id returns canceled: false. A completed download still returns its owned file, which the caller must dispose.
2252
+ *
2253
+ * @param params The release lookup or asset download to abandon.
2254
+ *
2255
+ * @returns Whether the cancel reached live work.
2256
+ */
2257
+ cancel: async (params) => connection.sendRequest("gitHubRelease.cancel", params),
2258
+ /**
2259
+ * Streams a published Copilot release asset to a private file and computes its SHA-256. The URL must name an HTTPS release download in a supported repository. A snapshotRequestId retains that snapshot's original credential source. Otherwise, a bound host uses its original owner, and other SDK callers keep the authInfo path. Each request and redirect resolves credentials again. Revocation fails without an auth fallback. Ordinary credential rejection and transport fallback keep their existing behavior. A digest mismatch removes the file. The result contains file metadata, not archive bytes. The caller must dispose the completed file after use. The download's own requestId controls progress and cancellation. Extensions cannot use this method.
2260
+ *
2261
+ * @param params Which release asset to download, the credential to download it under, and the request id that makes the download cancellable.
2262
+ *
2263
+ * @returns Outcome of an asset download. Each field is present only for the kinds its description names.
2264
+ */
2265
+ downloadAsset: async (params) => connection.sendRequest("gitHubRelease.downloadAsset", params),
2266
+ /**
2267
+ * Reports how many bytes a running `gitHubRelease.downloadAsset` has written, for a progress display. The runtime sends no progress notification for a download, so a host polls this while the download runs. An id with no running download reports zero bytes and no total, which is the normal answer before the body starts and after the download ends.
2268
+ *
2269
+ * @param params The download whose progress to report.
2270
+ *
2271
+ * @returns Byte progress of a running download.
2272
+ */
2273
+ getDownloadProgress: async (params) => connection.sendRequest("gitHubRelease.getDownloadProgress", params)
2274
+ },
2275
+ /** @experimental */
2276
+ cloudTasks: {
2277
+ /**
2278
+ * Starts a cloud coding-agent task, the remote run whose record `cloudTasks.get` later reads. Answered above any session because the task it creates is not a background task inside one. Hosts other than the CLI want this: a GitHub App or an SDK consumer that hands work to a cloud agent creates the same task under the same credential, and resolving it here keeps one credential, endpoint and validation path. Target the task either by repository, supplying both `repositoryOwner` and `repositoryName`, or by `owner` alone for an account-level run. The result separates a rejected request from a failed one: when `ok` is false, `reason` categorises the rejection and `message` carries the explanation to show, while `failure` describes the HTTP call itself and is present only when one was actually made.
2279
+ *
2280
+ * @param params Describes the cloud coding-agent task to start and the credential to start it under. Target it either by repository, supplying both `repositoryOwner` and `repositoryName`, or by `owner` alone for an account-level run.
2281
+ *
2282
+ * @returns The outcome of starting a cloud task. A rejected request and a failed one are reported separately: `reason` and `message` describe a request the service declined, while `statusCode` and `errorMessage` describe the HTTP call itself and appear only when one was actually made.
2283
+ */
2284
+ create: async (params) => connection.sendRequest("cloudTasks.create", params),
2285
+ /**
2286
+ * Deletes one cloud coding-agent task, the remote run `cloudTasks.create` started. The deletion is a soft one: the service withdraws the task from its listings rather than destroying the record, so a host removing a run from its own UI is the intended caller. Answered above any session for the same reason as `cloudTasks.get` -- the task is remote and has no local counterpart. Hosts other than the CLI want this: a GitHub App or an SDK consumer that manages cloud agent runs withdraws the same record under the same credential, and resolving it here keeps one credential-resolution and endpoint path. The runtime resolves each token from `authInfo` or `authContextId`. A host may preserve an explicit `baseUrl`; omission derives the endpoint from `authInfo`. The result is the HTTP outcome rather than a bare success flag: the call returns no body, so `ok` alone describes a success, while a failure is reported through `statusCode`, `errorMessage` and `errorPayloadJson` instead of being raised as an error.
2287
+ *
2288
+ * @param params Identifies one cloud coding-agent task to delete, and the credential to delete it under.
2289
+ *
2290
+ * @returns The HTTP outcome of deleting a cloud task. The deletion returns no body, so a successful call carries nothing beyond `ok`; a failed one is described by the remaining fields rather than raised as an error, so a caller can surface the service's own explanation.
2291
+ */
2292
+ delete: async (params) => connection.sendRequest("cloudTasks.delete", params),
2293
+ /**
2294
+ * Reads one cloud coding-agent task from the Copilot API. This is the task a cloud agent runs on a host's behalf, not a background task inside a session, so it is answered above any session and the `tasks` group does not cover it. Hosts other than the CLI want this: a GitHub App or an SDK consumer that shows the state of a cloud agent run must read the same task record, and resolving it here keeps one credential-resolution, task-URL and circuit-breaker path instead of each host rebuilding them. The result is the HTTP outcome rather than the task itself: a caller must read `ok` and `statusCode` before `payloadJson`, because a 404 is reported as a non-ok result rather than an error, which is what lets a caller tell "no such task" apart from "the API call failed".
2295
+ *
2296
+ * @param params Identifies one cloud coding-agent task and the credential to read it under.
2297
+ *
2298
+ * @returns The HTTP outcome of reading a cloud task, rather than the task alone. A 404 arrives here as a non-ok result with `statusCode` 404, not as an error, so a caller can tell an absent task apart from a failed call.
2299
+ */
2300
+ get: async (params) => connection.sendRequest("cloudTasks.get", params),
2301
+ /**
2302
+ * Reads the logs a cloud coding-agent session produced, from the Copilot API. Answered above any session, for the same reason as `cloudTasks.get`: the session being asked about runs remotely and has no local counterpart. Read `resolved` first. It is false when no Copilot API URL could be resolved for the credential, which is a different outcome from a request that was made and failed, and a caller that treats the two alike will report a transport error for an account that simply has no API endpoint. When `resolved` is true, `debugMessages` carries the diagnostics the fetch produced and should be logged whatever the outcome, `errorString` reports a retrieval fault, and only then do `ok` and `statusCode` describe the HTTP result.
2303
+ *
2304
+ * @param params Identifies one cloud coding-agent session whose logs are to be read, and the credential to read them under.
2305
+ *
2306
+ * @returns The outcome of reading a cloud session's logs. `resolved` distinguishes "this credential has no Copilot API endpoint" from "the request was made and failed"; every other field describes a request that was actually attempted.
2307
+ */
2308
+ getSessionLogs: async (params) => connection.sendRequest("cloudTasks.getSessionLogs", params),
2309
+ /**
2310
+ * Reconstructs the session a cloud coding-agent task recorded, by reading that task's events and ordering them for replay. Answered above any session, for the same reason as `cloudTasks.get`: the session being rebuilt ran remotely and has no local counterpart. Hosts other than the CLI want this: an SDK consumer attaching to a run in progress, an ACP client resuming one, or a GitHub App rendering a task's transcript all rebuild the same history from the same events, and resolving it here keeps one credential, endpoint, ordering and anchor-detection path. A newly created task has no events yet, so this polls for them and fails once they do not arrive. Read `preStart` before either list: when it is true the session has not started, `replayEventsJson` is deliberately empty because there is no history to reconstruct, and only `observedEventsJson` is meaningful.
2311
+ *
2312
+ * @param params Identifies one cloud coding-agent task whose recorded session is to be replayed, and the credential to read it under.
2313
+ *
2314
+ * @returns A cloud task's recorded events, ordered for replay. Read `preStart` first: it selects which of the two event lists a caller should use, and they differ deliberately.
2315
+ */
2316
+ getSessionReplay: async (params) => connection.sendRequest("cloudTasks.getSessionReplay", params),
2317
+ /**
2318
+ * Reads whether one cloud coding-agent task is shared, from the Mission Control service. Answered above any session, for the same reason as `cloudTasks.get`: the task is a remote record with no local counterpart. Hosts other than the CLI want this: an SDK consumer or a GitHub App that offers a "share this run" affordance must read the same flag from the same service, and resolving it here keeps one credential-resolution and endpoint path. The credential is resolved from `authInfo` inside the runtime rather than being carried across the door, so no caller handles a raw token. Read `credentialResolved` first: it is false when the account has no usable credential, in which case no request was made at all, which a caller must not report as a failed request.
2319
+ *
2320
+ * @param params Identifies one cloud coding-agent task whose sharing status is to be read, and the credential to read it under.
2321
+ *
2322
+ * @returns The sharing status a cloud task carries after the call. Read `credentialResolved` first: when it is false no request was attempted at all, which is a different outcome from a request the service declined.
2323
+ */
2324
+ getSharingStatus: async (params) => connection.sendRequest("cloudTasks.getSharingStatus", params),
2325
+ /**
2326
+ * Changes whether one cloud coding-agent task is shared, through the Mission Control service, and reports the status the task carries afterwards. The companion to `cloudTasks.getSharingStatus` and answered above any session for the same reason. The status is sent verbatim and is not narrowed to a closed set, because the service owns these values. The credential is resolved from `authInfo` inside the runtime rather than being carried across the door. Read `credentialResolved` first: it is false when the account has no usable credential, in which case nothing was changed and no request was made.
2327
+ *
2328
+ * @param params Identifies one cloud coding-agent task whose sharing status is to be changed, the status to set, and the credential to change it under.
2329
+ *
2330
+ * @returns The sharing status a cloud task carries after the call. Read `credentialResolved` first: when it is false no request was attempted at all, which is a different outcome from a request the service declined.
2331
+ */
2332
+ setSharingStatus: async (params) => connection.sendRequest("cloudTasks.setSharingStatus", params),
2333
+ /**
2334
+ * Finds the session a caller should open for one cloud coding-agent task. A task identifier alone does not say what to open: the run may already exist locally, it may exist only in the cloud, or it may be a task that cannot be resumed at all. Resolving that needs a local session scan and a Mission Control lookup that agree on identity, which is why it is answered here rather than left to each host. Hosts other than the CLI want it: an IDE or a GitHub App that opens a run from a task link faces the same three outcomes. Read `kind` before any other field. `local-session` carries `sessionId`, `remote-session` carries `metadataJson`, `unresumable-task` means the task exists but cannot be continued, and `none` means no session matched. A failed service call is reported as `error` rather than raised, so a caller can surface the service's own message. Pass every local session identifier already rejected in `ignoredLocalSessionIds` and call again to get the next candidate; that is how a host skips a local session it could not load.
2335
+ *
2336
+ * @param params Identifies one cloud coding-agent task to resolve to an openable session, the credential to resolve it under, and the local candidates the caller has already rejected.
2337
+ *
2338
+ * @returns What a caller should open for the task. The four outcomes are distinct and carry different payloads, so read `kind` before any other field.
2339
+ */
2340
+ resolveTaskId: async (params) => connection.sendRequest("cloudTasks.resolveTaskId", params)
2341
+ },
2342
+ /** @experimental */
2343
+ cafeMetrics: {
2344
+ /**
2345
+ * Starts anonymous CAFE metrics for this process. The runtime selects the endpoint from COPILOT_CAFE_METRICS_URL or this connection's original auth owner. Offline and unsupported platforms refuse startup. Release eligibility must resolve before samples are sent. Requires the private trusted CLI host capability.
2346
+ *
2347
+ * @param params Versions and provider configuration for CAFE.
2348
+ *
2349
+ * @returns CAFE startup result.
2350
+ */
2351
+ start: async (params) => connection.sendRequest("cafeMetrics.start", params),
2352
+ /**
2353
+ * Resolves release eligibility once from the immutable release lookup shared with auto-update. Requires the private trusted CLI host capability.
2354
+ *
2355
+ * @param params Immutable release lookup result.
2356
+ *
2357
+ * @returns Admission result.
2358
+ */
2359
+ resolveAdmission: async (params) => connection.sendRequest("cafeMetrics.resolveAdmission", params),
2360
+ /**
2361
+ * Records one terminal resume result. Does nothing before startup. Requires the private trusted CLI host capability.
2362
+ *
2363
+ * @param params Terminal result of one resume attempt.
2364
+ */
2365
+ recordResumeResult: async (params) => connection.sendRequest("cafeMetrics.recordResumeResult", params),
2366
+ /**
2367
+ * Stops recording and drains within one 1.5-second deadline. flushOnly sends at most one batch without stopping recording. Requires the private trusted CLI host capability.
2368
+ *
2369
+ * @param params Preliminary flush or final disposal.
2370
+ */
2371
+ shutdown: async (params) => connection.sendRequest("cafeMetrics.shutdown", params)
2144
2372
  }
2145
2373
  };
2146
2374
  }
2147
2375
  function createSessionRpc(connection, sessionId) {
2148
2376
  return {
2377
+ /** @experimental */
2378
+ management: {
2379
+ /**
2380
+ * Updates opt-in session management policy live. Enabling the master enables all tools before applying individual overrides. Opt-in is scoped to the session's configuration directory.
2381
+ *
2382
+ * @param params Updates the session's live policy without changing persistent host settings.
2383
+ *
2384
+ * @returns Opt-in policy for local session management.
2385
+ */
2386
+ configure: async (params) => connection.sendRequest("session.management.configure", { ...params, sessionId }),
2387
+ /**
2388
+ * Lists other live, opted-in sessions in the same configuration directory. Requires the list tool to be enabled.
2389
+ *
2390
+ * @param params Lists opted-in local peers. The caller is omitted.
2391
+ *
2392
+ * @returns Eligible live peers reported by their owning runtimes.
2393
+ */
2394
+ list: async (params) => connection.sendRequest("session.management.list", { ...params, sessionId }),
2395
+ /**
2396
+ * Injects peer text into an opted-in session. Wakes an idle agent and safely queues delivery to a busy agent. Acceptance does not imply an answer or completed task.
2397
+ *
2398
+ * @param params Sends peer text, never human approval, to another opted-in session.
2399
+ *
2400
+ * @returns Acceptance is not a completed turn or a reply.
2401
+ */
2402
+ message: async (params) => connection.sendRequest("session.management.message", { ...params, sessionId }),
2403
+ /**
2404
+ * Asks the owning host to create and supervise a separate session, preserving permissions and model restrictions. Omitted model, reasoning effort, context tier and cwd inherit the caller's current values; explicit overrides use normal model validation and workspace trust. Records durable creation lineage before delivering the initial task as peer text. Returns the new session ID, not task completion. Requires the create tool and a host creation handler.
2405
+ *
2406
+ * @param params Requests a separate session. Omitted launch options inherit the caller's current configuration.
2407
+ *
2408
+ * @returns Identifies a session owned and supervised by the creating host.
2409
+ */
2410
+ create: async (params) => connection.sendRequest("session.management.create", { ...params, sessionId }),
2411
+ /**
2412
+ * Closes a live opted-in session created by the caller or one of its descendants, preserving saved history and leaving descendants open. Requires the close capability to be enabled. Self, ancestors, siblings and unrelated sessions cannot be closed.
2413
+ *
2414
+ * @param params Closes one live opted-in descendant without deleting its saved history or closing its children.
2415
+ *
2416
+ * @returns Completion of the existing non-deleting close lifecycle.
2417
+ */
2418
+ close: async (params) => connection.sendRequest("session.management.close", { ...params, sessionId })
2419
+ },
2149
2420
  /** @experimental */
2150
2421
  providers: {
2151
2422
  /**
@@ -2329,7 +2600,7 @@ function createSessionRpc(connection, sessionId) {
2329
2600
  /** @experimental */
2330
2601
  login: {
2331
2602
  /**
2332
- * Begin an interactive login flow for a provider kind (dispatch is kind-only) and return its opaque flow id and first step.
2603
+ * Begin an interactive login flow for a provider kind, optionally selecting how to authorize (`method`: `web` by default, or `device-code`), and return its opaque flow id and first step.
2333
2604
  *
2334
2605
  * @param params Begin an interactive login flow for a provider kind, optionally reusing a cached base identity or explicitly requesting provider account selection.
2335
2606
  *
@@ -2341,7 +2612,7 @@ function createSessionRpc(connection, sessionId) {
2341
2612
  *
2342
2613
  * @param params Advance an in-flight login flow, optionally fulfilling an input-required step.
2343
2614
  *
2344
- * @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).
2615
+ * @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). A device-code flow surfaces its one-time code as `device-code`; the consumer shows the code, may open the verification URI, and calls advance, which resolves once the user has authorized the device.
2345
2616
  */
2346
2617
  advance: async (params) => connection.sendRequest("session.accounts.login.advance", { ...params, sessionId }),
2347
2618
  /**
@@ -2783,7 +3054,13 @@ function createSessionRpc(connection, sessionId) {
2783
3054
  *
2784
3055
  * @returns Canonical runtime state for the session's current autopilot objective.
2785
3056
  */
2786
- getState: async () => connection.sendRequest("session.autopilotObjective.getState", { sessionId })
3057
+ getState: async () => connection.sendRequest("session.autopilotObjective.getState", { sessionId }),
3058
+ /**
3059
+ * Sets whether completing or pausing this session's objective preserves autopilot mode. This in-memory preference defaults to true and must be reapplied when attaching a client.
3060
+ *
3061
+ * @param params Client-resolved preference for retaining autopilot mode after objective completion or pause.
3062
+ */
3063
+ setStayInAutopilot: async (params) => connection.sendRequest("session.autopilotObjective.setStayInAutopilot", { ...params, sessionId })
2787
3064
  },
2788
3065
  /** @experimental */
2789
3066
  completions: {
@@ -3523,6 +3800,12 @@ function createSessionRpc(connection, sessionId) {
3523
3800
  * @returns The selectable model entries and selection ids synthesized for the synchronized BYOK models.
3524
3801
  */
3525
3802
  sync: async (params) => connection.sendRequest("session.provider.sync", { ...params, sessionId }),
3803
+ /**
3804
+ * Returns credential-free provider configuration status for the selected model. This does not validate provider credentials or contact the provider.
3805
+ *
3806
+ * @returns Credential-free provider configuration status for the selected model.
3807
+ */
3808
+ getStatus: async () => connection.sendRequest("session.provider.getStatus", { sessionId }),
3526
3809
  /**
3527
3810
  * Withdraws named host-managed models from the session's BYOK registry, leaving every other entry untouched. The scoped counterpart to `provider.sync`: a snapshot can only describe entries the caller knows about, so using it to remove one model silently withdraws rows registered by another source, such as a plugin calling `provider.add` at runtime. Naming what to remove leaves unrelated entries alone. Selection ids that are not registered are ignored, so withdrawal is idempotent. A provider is removed only when one of the withdrawn models was the last entry referencing it; a provider that simply has no models, which is the normal state while its rows are supplied by catalog discovery, is left in place.
3528
3811
  *
@@ -3863,6 +4146,12 @@ function createSessionRpc(connection, sessionId) {
3863
4146
  * @returns Current permission mode.
3864
4147
  */
3865
4148
  getMode: async () => connection.sendRequest("session.permissions.getMode", { sessionId }),
4149
+ /**
4150
+ * Returns the approval modes currently available under the session's feature and managed permission policy. This read does not change permissions; mutations must still check their authoritative result because policy may change.
4151
+ *
4152
+ * @returns Available permission modes, derived from current session policy.
4153
+ */
4154
+ getCapabilities: async () => connection.sendRequest("session.permissions.getCapabilities", { sessionId }),
3866
4155
  /**
3867
4156
  * Adds or removes session-scoped or location-scoped permission rules.
3868
4157
  *
@@ -4183,6 +4472,12 @@ function createSessionRpc(connection, sessionId) {
4183
4472
  * @returns Indicates whether an in-progress background compaction was cancelled.
4184
4473
  */
4185
4474
  cancelBackgroundCompaction: async () => connection.sendRequest("session.history.cancelBackgroundCompaction", { sessionId }),
4475
+ /**
4476
+ * Replaces this local session's compaction settings: the model, prompt and reasoning effort its automatic and manual compactions use. Each call replaces all three: an omitted field returns to its default. Settings are held in memory only, so re-apply them after resuming the session in a new process. A change applies to compactions that start afterwards, except that automatic compactions keep the model the running turn already chose for them until that turn ends; a compaction already in progress may still pick up a new reasoning effort. Rejects on a remote session.
4477
+ *
4478
+ * @param params Compaction settings for this session. Each call replaces the previous settings: an omitted field returns to its default. Settings live in memory until the session ends; re-apply them after resuming a session in a new process.
4479
+ */
4480
+ setCompactionConfig: async (params) => connection.sendRequest("session.history.setCompactionConfig", { ...params, sessionId }),
4186
4481
  /**
4187
4482
  * Aborts any in-progress manual compaction on a local session.
4188
4483
  *
@@ -4520,6 +4815,15 @@ function createInternalSessionRpc(connection, sessionId) {
4520
4815
  }
4521
4816
  },
4522
4817
  /** @experimental */
4818
+ canvasSource: {
4819
+ /**
4820
+ * Closes a canvas through its original session source. Requires the privately admitted in-process CLI host.
4821
+ *
4822
+ * @param params Closes a canvas through its original owned or attached session namespace.
4823
+ */
4824
+ close: async (params) => connection.sendRequest("session.canvasSource.close", { ...params, sessionId })
4825
+ },
4826
+ /** @experimental */
4523
4827
  workflow: {
4524
4828
  /**
4525
4829
  * Internal tool-originated dynamic workflow invocation.
@@ -4815,6 +5119,17 @@ function createInternalSessionRpc(connection, sessionId) {
4815
5119
  * @returns Result of registering or re-arming a scheduled prompt.
4816
5120
  */
4817
5121
  rearmSelfPaced: async (params) => connection.sendRequest("session.schedule.rearmSelfPaced", { ...params, sessionId })
5122
+ },
5123
+ /** @experimental */
5124
+ cafeMetrics: {
5125
+ /**
5126
+ * Records live model-call events, including subagents, and root compaction events. Replaces any earlier recorder. Requires the private trusted CLI host capability.
5127
+ */
5128
+ attach: async () => connection.sendRequest("session.cafeMetrics.attach", { sessionId }),
5129
+ /**
5130
+ * Stops recording this session. Does nothing if it has no recorder. Requires the private trusted CLI host capability.
5131
+ */
5132
+ detach: async () => connection.sendRequest("session.cafeMetrics.detach", { sessionId })
4818
5133
  }
4819
5134
  };
4820
5135
  }
@@ -253,7 +253,15 @@ export type IndexedSearchDisabledReason =
253
253
  /** The Windows cloud-sync safety check failed. */
254
254
  | "cloud_sync_detection_failed"
255
255
  /** The workspace is not available on the runtime's local filesystem. */
256
- | "workspace_not_local";
256
+ | "workspace_not_local"
257
+ /** Another process holds the machine-wide indexed-search server slot. */
258
+ | "server_limit"
259
+ /** The workspace is a filesystem or network-share root. */
260
+ | "filesystem_root"
261
+ /** The workspace is the user's home directory. */
262
+ | "home_directory"
263
+ /** The user's home directory could not be determined. */
264
+ | "home_directory_detection_failed";
257
265
  /**
258
266
  * Result of an indexed-search startup attempt.
259
267
  */
@@ -730,7 +738,7 @@ export type UserMessageAgentMode =
730
738
  /**
731
739
  * A user message attachment — a file, directory, code selection, blob, GitHub reference, GitHub-anchored pointer, or extension-supplied context payload
732
740
  */
733
- export type Attachment = AttachmentFile | AttachmentDirectory | AttachmentSelection | AttachmentGitHubReference | AttachmentGitHubCommit | AttachmentGitHubRelease | AttachmentGitHubActionsJob | AttachmentGitHubRepository | AttachmentGitHubFileDiff | AttachmentGitHubTreeComparison | AttachmentGitHubUrl | AttachmentGitHubFile | AttachmentGitHubSnippet | AttachmentBlob | AttachmentExtensionContext;
741
+ export type Attachment = AttachmentFile | AttachmentDirectory | AttachmentSelection | AttachmentGitHubReference | AttachmentGitHubCommit | AttachmentGitHubRelease | AttachmentGitHubActionsJob | AttachmentGitHubRepository | AttachmentGitHubFileDiff | AttachmentGitHubTreeComparison | AttachmentGitHubUrl | AttachmentGitHubFile | AttachmentGitHubSnippet | AttachmentBlob | AttachmentExtensionContext | AttachmentSessionReference;
734
742
  /**
735
743
  * Why the binary data is absent: it exceeded the inline size limit, or its asset was unavailable
736
744
  */
@@ -5802,6 +5810,10 @@ export interface UserMessageData {
5802
5810
  * Files, selections, or GitHub references attached to the message
5803
5811
  */
5804
5812
  attachments?: Attachment[];
5813
+ /**
5814
+ * IDs of accepted assistant messages that caused this delivered inter-agent prompt, referring to assistant.message.data.messageId across the agent tree. Captured when sending and retained through queued or immediate delivery. An empty list means no model-produced dependency; absence means provenance is unavailable.
5815
+ */
5816
+ causalDependencies?: string[];
5805
5817
  /**
5806
5818
  * The user's message text as displayed in the timeline
5807
5819
  */
@@ -6349,6 +6361,28 @@ export interface AttachmentExtensionContext {
6349
6361
  */
6350
6362
  type: "extension_context";
6351
6363
  }
6364
+ /**
6365
+ * An ID-bound reference to an eligible live session. Supplies identity context only, without sending a message, reading history, or granting permission.
6366
+ */
6367
+ /** @experimental */
6368
+ export interface AttachmentSessionReference {
6369
+ /**
6370
+ * User-visible mention label captured when the reference was selected.
6371
+ */
6372
+ displayName?: string;
6373
+ /**
6374
+ * Character offset of the selected mention in the displayed prompt.
6375
+ */
6376
+ mentionIndex?: number;
6377
+ /**
6378
+ * Stable identity of the selected session, never resolved from its title.
6379
+ */
6380
+ sessionId: string;
6381
+ /**
6382
+ * Attachment type discriminator.
6383
+ */
6384
+ type: "session_reference";
6385
+ }
6352
6386
  /**
6353
6387
  * Session event "pending_messages.modified". Empty payload; the event signals that the pending message queue has changed
6354
6388
  */
@@ -8964,6 +8998,10 @@ export interface ToolExecutionCompleteEvent {
8964
8998
  * Tool execution completion results including success status, detailed output, and error information
8965
8999
  */
8966
9000
  export interface ToolExecutionCompleteData {
9001
+ /**
9002
+ * IDs of accepted assistant messages whose output this tool result consumed, referring to assistant.message.data.messageId across the agent tree. Captured from the returned snapshot, including partial agent reads. An empty list means no model-produced dependency; absence means provenance is unavailable.
9003
+ */
9004
+ causalDependencies?: string[];
8967
9005
  /**
8968
9006
  * Error details when the tool execution failed
8969
9007
  */
@@ -10750,6 +10788,10 @@ export interface SystemNotificationEvent {
10750
10788
  * System-generated notification for runtime events like background task completion
10751
10789
  */
10752
10790
  export interface SystemNotificationData {
10791
+ /**
10792
+ * IDs of accepted assistant messages whose output this notification consumed, referring to assistant.message.data.messageId across the agent tree. Captured from the delivered snapshot, not the sender's later state. An empty list means no model-produced dependency; absence means provenance is unavailable.
10793
+ */
10794
+ causalDependencies?: string[];
10753
10795
  /**
10754
10796
  * The notification text, typically wrapped in <system_notification> XML tags
10755
10797
  */
@@ -14168,6 +14210,10 @@ export interface CommandQueuedData {
14168
14210
  * Unique identifier for this request; used to respond via session.respondToQueuedCommand()
14169
14211
  */
14170
14212
  requestId: string;
14213
+ /**
14214
+ * Whether a schedule dispatched this command. Consumers must reject commands marked as not schedulable before executing a scheduled request. Absent for ordinary queued commands.
14215
+ */
14216
+ scheduled?: boolean;
14171
14217
  }
14172
14218
  /**
14173
14219
  * Session event "command.execute". Registered command dispatch request routed to the owning client
package/dist/index.d.ts CHANGED
@@ -13,5 +13,5 @@ export { defineWorkflow, WorkflowResumeError, isWorkflowRunTerminal } from "./wo
13
13
  export { Canvas, CanvasError, createCanvas, type CanvasAction, type CanvasDeclaration, type CanvasHostContext, type CanvasHostContextCapabilities, type CanvasJsonSchema, type CanvasOptions, } from "./canvas.js";
14
14
  export { defineTool, approveAll, createAttributedPermissionResult, convertMcpCallToolResult, createSessionFsAdapter, CopilotRequestHandler, CopilotWebSocketHandler, CopilotWebSocketCloseStatus, CopilotWebSocketForwarder, SessionFsSqliteTransactionFailure, SessionFsWriteFailure, SYSTEM_MESSAGE_SECTIONS, } from "./types.js";
15
15
  export type * from "./generated/session-events.js";
16
- export type { AskUserVariant, CommandContext, CommandDefinition, CommandHandler, CanvasProviderIdentity, CloudSessionOptions, CloudSessionRepository, AuthIdentityMetadata, AuthInfoType, ConnectorAccountRequest, ConnectorAvailability, ConnectorCapabilities, ConnectorCatalogEntry, ConnectorCatalogResult, ConnectorCatalogStatus, ConnectorConnectRequest, ConnectorConnectResult, ConnectorContinueRequest, ConnectorDisconnectResult, ConnectorMcpStatus, ConnectorReconcileRequest, ConnectorRuntimeStatus, ConnectorSessionAccount, ConnectorSessionAccountResult, ConnectorStatus, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, AgentStopHandler, AgentStopHookInput, AgentStopHookOutput, SubagentStartHandler, SubagentStartHookInput, SubagentStartHookOutput, SubagentStopHandler, SubagentStopHookInput, SubagentStopHookOutput, UserPromptTransformedHandler, UserPromptTransformedHookInput, UserPromptTransformedHookOutput, CopilotClientInfo, CopilotClientMode, CopilotClientOptions, EntraAuthConfig, EntraAuthOptions, EntraTokenProvider, EntraTokenProviderArgs, EntraTokenProviderResult, InstallationConfirmationHandler, InstallationConfirmationRequest, InstallationConfirmationResponse, InstallationDecision, InstallationReview, McpInstallationReview, CopilotExpAssignmentResponse, StdioRuntimeConnection, InProcessRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExpConfigEntry, ExpFlagValue, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionLaunchProfile, ExtensionLaunchProvider, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, ExtensionInfo, KerberosAuthAcquireRequest, KerberosAuthConfig, KerberosAuthMode, KerberosAuthScope, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, HostDiagnostics, HostErrorReportingStatus, GitHubMcpToolConfig, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTokenProvider, GitHubTokenProviderArgs, GitHubTokenProviderResult, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, ExtensionContextAttachment, MessageOptions, ResponseSchema, MessageSource, ManagedSettings, ManagedSettingsPermissions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, AutoTier, CapiSessionOptions, CurrentModel, ModelSwitchAutoTierResult, ModelSwitchAutoTierStatus, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, NamedProviderConfig, PermissionHandler, PermissionRequest, PermissionRequestedData, PermissionRequestedEvent, PermissionRequestResult, AttributedPermissionResult, PermissionDecisionContext, PermissionDecisionOutcome, PermissionDecisionSource, PermissionDecisionSurface, PermissionResponseCapability, ProviderConfig, ProviderConfigModelProvider, ProviderModelConfig, ProviderTokenArgs, RemoteSessionMode, SandboxConfigSource, ResumeSessionConfig, TranscriptRecovery, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, WorkingDirectoryTrust, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionHooks, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsByteRange, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SessionFsSqliteStatement, SessionFsSqliteTransactionErrorClass, SkillProvider, SkillProviderCallOptions, SkillProviderDescriptor, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, ToolNamespace, CurrentToolMetadata, ToolTelemetry, ToolResultObject, ToolSearchConfig, ImageGenerationConfig, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
16
+ export type { AskUserVariant, CommandContext, CommandDefinition, CommandHandler, CanvasProviderIdentity, CloudSessionOptions, CloudSessionRepository, AuthIdentityMetadata, AuthInfoType, ConnectorAccountRequest, ConnectorAvailability, ConnectorCapabilities, ConnectorCatalogEntry, ConnectorCatalogResult, ConnectorCatalogStatus, ConnectorConnectRequest, ConnectorConnectResult, ConnectorContinueRequest, ConnectorDisconnectResult, ConnectorMcpStatus, ConnectorReconcileRequest, ConnectorRuntimeStatus, ConnectorSessionAccount, ConnectorSessionAccountResult, ConnectorStatus, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, AgentStopHandler, AgentStopHookInput, AgentStopHookOutput, SubagentStartHandler, SubagentStartHookInput, SubagentStartHookOutput, SubagentStopHandler, SubagentStopHookInput, SubagentStopHookOutput, UserPromptTransformedHandler, UserPromptTransformedHookInput, UserPromptTransformedHookOutput, CopilotClientInfo, CopilotClientMode, CopilotClientOptions, EntraAuthConfig, EntraAuthOptions, EntraTokenProvider, EntraTokenProviderArgs, EntraTokenProviderResult, InstallationConfirmationHandler, InstallationConfirmationRequest, InstallationConfirmationResponse, InstallationDecision, InstallationReview, McpInstallationReview, CopilotExpAssignmentResponse, StdioRuntimeConnection, InProcessRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExpConfigEntry, ExpFlagValue, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionLaunchProfile, ExtensionLaunchProvider, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, ExtensionInfo, KerberosAuthAcquireRequest, KerberosAuthConfig, KerberosAuthMode, KerberosAuthScope, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, HostDiagnostics, HostErrorReportingStatus, GitHubMcpToolConfig, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTokenProvider, GitHubTokenProviderArgs, GitHubTokenProviderResult, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, ExtensionContextAttachment, MessageOptions, ResponseSchema, MessageSource, ManagedSettings, ManagedSettingsPermissions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, AutoTier, CapiSessionOptions, CurrentModel, ModelSwitchAutoTierResult, ModelSwitchAutoTierStatus, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, NamedProviderConfig, PermissionHandler, PermissionRequest, PermissionRequestedData, PermissionRequestedEvent, PermissionRequestResult, AttributedPermissionResult, PermissionDecisionContext, PermissionDecisionOutcome, PermissionDecisionSource, PermissionDecisionSurface, PermissionResponseCapability, ProviderConfig, ProviderConfigModelProvider, ProviderModelConfig, ProviderTokenArgs, RemoteSessionMode, SandboxConfigSource, ResumeSessionConfig, TranscriptRecovery, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, WorkingDirectoryTrust, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionHooks, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsByteRange, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SessionFsSqliteStatement, SessionFsSqliteTransactionErrorClass, SkillProvider, SessionCreationHandler, ManagedSessionInfo, SessionManagementCloseRequest, SessionManagementCloseResult, SessionManagementConfigureRequest, SessionManagementCreateHostRequest, SessionManagementCreateRequest, SessionManagementCreateResult, SessionManagementListRequest, SessionManagementListResult, SessionManagementMessageRequest, SessionManagementMessageResult, SessionManagementPolicy, SessionManagementScope, SessionManagementToolOverrides, SkillProviderCallOptions, SkillProviderDescriptor, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, ToolNamespace, CurrentToolMetadata, ToolTelemetry, ToolResultObject, ToolSearchConfig, ImageGenerationConfig, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
17
17
  export type { JsonValue, WorkflowRunOptions, WorkflowResumeOptions, WorkflowLimitOverrides, WorkflowResumeErrorCode, SessionWorkflowApi, WorkflowAgentOptions, WorkflowContext, WorkflowDefinition, WorkflowHandle, WorkflowJsonSchema, WorkflowLimits, WorkflowMeta, WorkflowPipelineStage, WorkflowStepOptions, WorkflowRunResult, WorkflowRunStatus, WorkflowRunSummary, WorkflowListRunsOptions, WorkflowRunsPage, WorkflowRunDetail, WorkflowProgressPage, WorkflowProgressLine, WorkflowPhaseObservation, WorkflowPhaseStatus, WorkflowAgentContextObservation, WorkflowAgentModelObservation, WorkflowAgentReasoningEffortObservation, WorkflowAgentSummary, } from "./workflow.js";
package/dist/session.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createSessionRpc } from "./generated/rpc.js";
2
- import type { ModelSwitchAutoTierResult } from "./generated/rpc.js";
2
+ import type { ModelSwitchAutoTierResult, SessionManagementPolicy } from "./generated/rpc.js";
3
3
  import type { OpenCanvasInstance } from "./generated/rpc.js";
4
- import type { MessageOptions, ResponseSchema, ContextTier, ReasoningEffort, ReasoningSummary, AutoTier, ModelCapabilitiesOverride, SessionCapabilities, SessionConfig, SessionEvent, SessionEventHandler, SessionEventType, SessionUiApi, TranscriptRecovery, TypedSessionEventHandler } from "./types.js";
4
+ import type { MessageOptions, ResponseSchema, ContextTier, ReasoningEffort, ReasoningSummary, AutoTier, ModelCapabilitiesOverride, SessionCapabilities, SessionConfig, SessionEvent, SessionEventHandler, SessionEventType, SessionUiApi, SessionCreationHandler, TranscriptRecovery, TypedSessionEventHandler } from "./types.js";
5
5
  import { type SessionWorkflowApi } from "./workflow.js";
6
6
  /** Assistant message event - the final response from the assistant. */
7
7
  export type AssistantMessageEvent = Extract<SessionEvent, {
@@ -16,7 +16,7 @@ export type AssistantMessageEvent = Extract<SessionEvent, {
16
16
  *
17
17
  * @example
18
18
  * ```typescript
19
- * const session = await client.createSession({ model: "gpt-4" });
19
+ * const session = await client.createSession({ model: "gpt-5.4" });
20
20
  *
21
21
  * // Subscribe to events
22
22
  * session.on((event) => {
@@ -48,6 +48,7 @@ export declare class CopilotSession {
48
48
  /** Settles once every earlier `setTools` call has finished. */
49
49
  private setToolsQueue;
50
50
  private pendingExternalTools;
51
+ private pendingSessionCreations;
51
52
  private canvases;
52
53
  private bearerTokenProviders;
53
54
  private commandHandlers;
@@ -60,6 +61,7 @@ export declare class CopilotSession {
60
61
  private exitPlanModeHandler?;
61
62
  private autoModeSwitchHandler?;
62
63
  private skillProvider?;
64
+ private sessionCreationHandler?;
63
65
  private hooks?;
64
66
  private transformCallbacks?;
65
67
  private _rpc;
@@ -157,6 +159,7 @@ export declare class CopilotSession {
157
159
  * Events are still delivered to handlers registered via {@link on} while waiting.
158
160
  * Sub-agent events with a non-empty `agentId` do not complete the wait or supply its reply.
159
161
  * With a schema as the second argument, returns its parsed, validated result.
162
+ * Provider schema restrictions apply to that schema; see {@link MessageOptions.responseSchema}.
160
163
  * Structured waits select only root-agent output originating from this send;
161
164
  * other queued work may delay session.idle but cannot replace the result.
162
165
  *
@@ -244,6 +247,11 @@ export declare class CopilotSession {
244
247
  private _confirm;
245
248
  private _select;
246
249
  private _input;
250
+ /**
251
+ * Registers the host's creation callback without enabling the tool group.
252
+ * Enable it separately with `session.rpc.management.configure({ enabled: true })`.
253
+ */
254
+ setSessionCreationHandler(handler?: SessionCreationHandler): Promise<SessionManagementPolicy>;
247
255
  private requireSkillProvider;
248
256
  /**
249
257
  * Runs a provider call with an abort signal tied to the runtime's request