@github/copilot-sdk 1.0.29-preview.0 → 1.0.29-preview.2

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.
@@ -5701,6 +5701,18 @@ export type SessionLimitPredictionUnavailableReason =
5701
5701
  */
5702
5702
  /** @experimental */
5703
5703
  export type SessionListEntry = LocalSessionMetadataValue | RemoteSessionMetadataValue;
5704
+ /**
5705
+ * Peer boundary evaluated in the process hosting the native session.
5706
+ *
5707
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
5708
+ * via the `definition` "SessionManagementScope".
5709
+ */
5710
+ /** @experimental */
5711
+ export type SessionManagementScope =
5712
+ /** Eligible local peers sharing the resolved configuration directory. */
5713
+ "all"
5714
+ /** Only peers hosted in this native runtime process. */
5715
+ | "in-process";
5704
5716
  /**
5705
5717
  * Public-facing workspace metadata for this session, or null if the session has no associated workspace. Excludes runtime-internal fields (GitHub IDs, summary count, internal flags).
5706
5718
  *
@@ -5874,7 +5886,7 @@ export type SessionsOpenProgressStep =
5874
5886
  "load-session"
5875
5887
  /** Validating that the local repository matches the remote session's repository. */
5876
5888
  | "validate-repo"
5877
- /** Checking the local working tree for uncommitted changes that would block the handoff. */
5889
+ /** Checking the local working tree for uncommitted changes, which stay in place and are carried onto the checked-out branch. */
5878
5890
  | "check-changes"
5879
5891
  /** Checking out the branch associated with the remote session in the local working tree. */
5880
5892
  | "checkout-branch"
@@ -8716,7 +8728,7 @@ export interface AgentsDiscoverRequest {
8716
8728
  */
8717
8729
  agentDirectories?: string[];
8718
8730
  /**
8719
- * Optional list of project directory paths to scan for project-scoped agents. When omitted or empty, only user/plugin/remote-independent agents are returned (no project scan).
8731
+ * Optional list of project directory paths to scan for project-scoped agents. When omitted or empty, no project is scanned: user-level and globally enabled plugin agents are still returned, but agents of a plugin enabled only in a repository's settings are not.
8720
8732
  */
8721
8733
  projectPaths?: string[];
8722
8734
  /**
@@ -9170,6 +9182,19 @@ export interface AutopilotObjectiveState {
9170
9182
  */
9171
9183
  creditLimit?: AutopilotObjectiveCreditLimit;
9172
9184
  }
9185
+ /**
9186
+ * Client-resolved preference for retaining autopilot mode after objective completion or pause.
9187
+ *
9188
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
9189
+ * via the `definition` "AutopilotObjectiveSetStayInAutopilotRequest".
9190
+ */
9191
+ /** @experimental */
9192
+ export interface AutopilotObjectiveSetStayInAutopilotRequest {
9193
+ /**
9194
+ * Whether an objective's requested return to interactive mode is suppressed.
9195
+ */
9196
+ value: boolean;
9197
+ }
9173
9198
  /** @experimental */
9174
9199
  export interface AutopilotOptions {
9175
9200
  /**
@@ -17740,6 +17765,43 @@ export interface ManagedPluginRetryEntry {
17740
17765
  */
17741
17766
  error?: string;
17742
17767
  }
17768
+ /**
17769
+ * An opted-in local session, reported by its live owner.
17770
+ *
17771
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
17772
+ * via the `definition` "ManagedSessionInfo".
17773
+ */
17774
+ /** @experimental */
17775
+ export interface ManagedSessionInfo {
17776
+ /**
17777
+ * Live peer's session identifier.
17778
+ */
17779
+ sessionId: string;
17780
+ /**
17781
+ * Human-readable peer name.
17782
+ */
17783
+ name: string;
17784
+ /**
17785
+ * Peer's current working directory.
17786
+ */
17787
+ cwd: string;
17788
+ /**
17789
+ * Peer's local session-state directory containing events.jsonl, when known.
17790
+ */
17791
+ sessionStatePath?: string;
17792
+ /**
17793
+ * Either idle or busy. A busy session may still accept messages.
17794
+ */
17795
+ state: string;
17796
+ /**
17797
+ * Peer's selected model, when known.
17798
+ */
17799
+ model?: string;
17800
+ /**
17801
+ * The session that created this root through session management, if any.
17802
+ */
17803
+ parentSessionId?: string;
17804
+ }
17743
17805
  /**
17744
17806
  * Lock state and provenance of one managed setting.
17745
17807
  *
@@ -23901,6 +23963,24 @@ export interface PermissionRulesSet {
23901
23963
  */
23902
23964
  denied: PermissionRule[];
23903
23965
  }
23966
+ /**
23967
+ * Available permission modes, derived from current session policy.
23968
+ *
23969
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
23970
+ * via the `definition` "PermissionsCapabilities".
23971
+ */
23972
+ /** @experimental */
23973
+ export interface PermissionsCapabilities {
23974
+ /**
23975
+ * Whether LLM-assisted approval is enabled for this session.
23976
+ */
23977
+ assistedApproval: boolean;
23978
+ /**
23979
+ * Whether managed policy currently permits unconditional approval.
23980
+ * Stays true while managed policy is still resolving.
23981
+ */
23982
+ bypassPermissions: boolean;
23983
+ }
23904
23984
  /**
23905
23985
  * No parameters.
23906
23986
  *
@@ -25286,6 +25366,19 @@ export interface ProviderSessionToken {
25286
25366
  */
25287
25367
  expiresAt?: string;
25288
25368
  }
25369
+ /**
25370
+ * Credential-free provider configuration status for the selected model.
25371
+ *
25372
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
25373
+ * via the `definition` "ProviderStatus".
25374
+ */
25375
+ /** @experimental */
25376
+ export interface ProviderStatus {
25377
+ /**
25378
+ * Whether the selected model uses a custom provider instead of requiring GitHub authentication.
25379
+ */
25380
+ hasCustomProvider: boolean;
25381
+ }
25289
25382
  /**
25290
25383
  * Authoritative BYOK provider and model registry snapshot to apply atomically to the session.
25291
25384
  *
@@ -29063,6 +29156,282 @@ export interface SessionManagedSettings {
29063
29156
  */
29064
29157
  permissions?: SessionManagedPermissions;
29065
29158
  }
29159
+ /**
29160
+ * Closes one live opted-in descendant without deleting its saved history or closing its children.
29161
+ *
29162
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
29163
+ * via the `definition` "SessionManagementCloseRequest".
29164
+ */
29165
+ /** @experimental */
29166
+ export interface SessionManagementCloseRequest {
29167
+ /**
29168
+ * Live created descendant whose owning host should close it.
29169
+ */
29170
+ targetSessionId: string;
29171
+ }
29172
+ /**
29173
+ * Completion of the existing non-deleting close lifecycle.
29174
+ *
29175
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
29176
+ * via the `definition` "SessionManagementCloseResult".
29177
+ */
29178
+ /** @experimental */
29179
+ export interface SessionManagementCloseResult {
29180
+ /**
29181
+ * True after the owning host has completed the existing session-close lifecycle.
29182
+ */
29183
+ closed: boolean;
29184
+ }
29185
+ /**
29186
+ * Updates the session's live policy without changing persistent host settings.
29187
+ *
29188
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
29189
+ * via the `definition` "SessionManagementConfigureRequest".
29190
+ */
29191
+ /** @experimental */
29192
+ export interface SessionManagementConfigureRequest {
29193
+ /**
29194
+ * Expected workspace for host activation. Required when enabling an interactive CLI session.
29195
+ */
29196
+ cwd?: string;
29197
+ /**
29198
+ * Enabling resets all session management operations to enabled, then applies overrides.
29199
+ */
29200
+ enabled?: boolean;
29201
+ /**
29202
+ * Peer boundary. Preserved when the master switch changes.
29203
+ */
29204
+ scope?: SessionManagementScope;
29205
+ /**
29206
+ * Individual tool overrides, applied after the master switch.
29207
+ */
29208
+ tools?: SessionManagementToolOverrides;
29209
+ /**
29210
+ * Bind creation to this SDK connection's sessionManagement.create callback.
29211
+ */
29212
+ hasCreateHandler?: boolean;
29213
+ }
29214
+ /**
29215
+ * Per-operation overrides for an enabled session management policy.
29216
+ *
29217
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
29218
+ * via the `definition` "SessionManagementToolOverrides".
29219
+ */
29220
+ /** @experimental */
29221
+ export interface SessionManagementToolOverrides {
29222
+ /**
29223
+ * Allow discovering eligible peer sessions.
29224
+ */
29225
+ list?: boolean;
29226
+ /**
29227
+ * Allow requesting an independent session from the owning host.
29228
+ */
29229
+ create?: boolean;
29230
+ /**
29231
+ * Allow delivering peer text to another eligible session.
29232
+ */
29233
+ message?: boolean;
29234
+ /**
29235
+ * Allow closing this session's live created descendants.
29236
+ */
29237
+ close?: boolean;
29238
+ }
29239
+ /**
29240
+ * Host callback. The host owns workspace records, UI, approval routing and cleanup.
29241
+ *
29242
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
29243
+ * via the `definition` "SessionManagementCreateHostRequest".
29244
+ */
29245
+ /** @experimental */
29246
+ export interface SessionManagementCreateHostRequest {
29247
+ /**
29248
+ * Target session identifier
29249
+ */
29250
+ sessionId: string;
29251
+ /**
29252
+ * The originating session; the host must not escalate its permissions.
29253
+ */
29254
+ parentSessionId: string;
29255
+ /**
29256
+ * Runtime-allocated identity. The host must create a fresh session with this exact ID.
29257
+ */
29258
+ newSessionId: string;
29259
+ /**
29260
+ * The new session must use this workspace and configuration directory.
29261
+ */
29262
+ cwd: string;
29263
+ /**
29264
+ * Parent's resolved configuration directory, which the host must preserve.
29265
+ */
29266
+ configDir: string;
29267
+ /**
29268
+ * Must not be broadened by the creating host.
29269
+ */
29270
+ permissionMode: PermissionMode;
29271
+ /**
29272
+ * Effective model to apply when creating the child.
29273
+ */
29274
+ model?: string;
29275
+ /**
29276
+ * Provider owning the effective model, when specified.
29277
+ */
29278
+ providerId?: string;
29279
+ /**
29280
+ * Effective reasoning effort, when specified.
29281
+ */
29282
+ reasoningEffort?: string;
29283
+ /**
29284
+ * Effective model-supported context tier, when specified.
29285
+ */
29286
+ contextTier?: ContextTier;
29287
+ /**
29288
+ * The host must preserve the parent's current model restrictions.
29289
+ */
29290
+ allowedModels?: string[];
29291
+ /**
29292
+ * Optional short name supplied for the independent session.
29293
+ */
29294
+ name?: string;
29295
+ }
29296
+ /**
29297
+ * Requests a separate session. Omitted launch options inherit the caller's current configuration.
29298
+ *
29299
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
29300
+ * via the `definition` "SessionManagementCreateRequest".
29301
+ */
29302
+ /** @experimental */
29303
+ export interface SessionManagementCreateRequest {
29304
+ /**
29305
+ * Initial task, delivered as peer text after successful creation.
29306
+ */
29307
+ prompt: string;
29308
+ /**
29309
+ * Optional short name for the independent session.
29310
+ */
29311
+ name?: string;
29312
+ /**
29313
+ * Absolute working directory. Defaults to the parent's current directory.
29314
+ */
29315
+ cwd?: string;
29316
+ /**
29317
+ * Optional model override; omission uses the parent's current model.
29318
+ */
29319
+ model?: string;
29320
+ /**
29321
+ * Optional effort supported by the selected model.
29322
+ */
29323
+ reasoningEffort?: string;
29324
+ /**
29325
+ * Uses the selected model's supported default or long-context tier, not an arbitrary token count.
29326
+ */
29327
+ contextTier?: ContextTier;
29328
+ }
29329
+ /**
29330
+ * Identifies a session owned and supervised by the creating host.
29331
+ *
29332
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
29333
+ * via the `definition` "SessionManagementCreateResult".
29334
+ */
29335
+ /** @experimental */
29336
+ export interface SessionManagementCreateResult {
29337
+ /**
29338
+ * Runtime-allocated identifier of the newly created session.
29339
+ */
29340
+ sessionId: string;
29341
+ }
29342
+ /**
29343
+ * Lists opted-in local peers. The caller is omitted.
29344
+ *
29345
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
29346
+ * via the `definition` "SessionManagementListRequest".
29347
+ */
29348
+ /** @experimental */
29349
+ export interface SessionManagementListRequest {
29350
+ /**
29351
+ * Optional exact working-directory filter.
29352
+ */
29353
+ cwd?: string;
29354
+ }
29355
+ /**
29356
+ * Eligible live peers reported by their owning runtimes.
29357
+ *
29358
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
29359
+ * via the `definition` "SessionManagementListResult".
29360
+ */
29361
+ /** @experimental */
29362
+ export interface SessionManagementListResult {
29363
+ /**
29364
+ * Matching peers, excluding the caller.
29365
+ */
29366
+ sessions: ManagedSessionInfo[];
29367
+ }
29368
+ /**
29369
+ * Sends peer text, never human approval, to another opted-in session.
29370
+ *
29371
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
29372
+ * via the `definition` "SessionManagementMessageRequest".
29373
+ */
29374
+ /** @experimental */
29375
+ export interface SessionManagementMessageRequest {
29376
+ /**
29377
+ * Eligible live peer that should receive the message.
29378
+ */
29379
+ targetSessionId: string;
29380
+ /**
29381
+ * Nonempty UTF-8 text, at most 16 KiB.
29382
+ */
29383
+ message: string;
29384
+ }
29385
+ /**
29386
+ * Acceptance is not a completed turn or a reply.
29387
+ *
29388
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
29389
+ * via the `definition` "SessionManagementMessageResult".
29390
+ */
29391
+ /** @experimental */
29392
+ export interface SessionManagementMessageResult {
29393
+ /**
29394
+ * True when the destination has accepted the peer message.
29395
+ */
29396
+ accepted: boolean;
29397
+ /**
29398
+ * Destination title captured by the receiving runtime at message admission.
29399
+ */
29400
+ targetSessionName?: string;
29401
+ }
29402
+ /**
29403
+ * Opt-in policy for local session management.
29404
+ *
29405
+ * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
29406
+ * via the `definition` "SessionManagementPolicy".
29407
+ */
29408
+ /** @experimental */
29409
+ export interface SessionManagementPolicy {
29410
+ /**
29411
+ * Master switch. Off by default.
29412
+ */
29413
+ enabled: boolean;
29414
+ /**
29415
+ * Discovery and direct access boundary. Defaults to all eligible local peers.
29416
+ */
29417
+ scope: SessionManagementScope;
29418
+ /**
29419
+ * Allow listing opted-in sessions in this configuration directory.
29420
+ */
29421
+ list: boolean;
29422
+ /**
29423
+ * Allow requesting a new session from the owning host.
29424
+ */
29425
+ create: boolean;
29426
+ /**
29427
+ * Allow sending a peer message to another opted-in session.
29428
+ */
29429
+ message: boolean;
29430
+ /**
29431
+ * Allow closing sessions created by this session or its descendants. On by default.
29432
+ */
29433
+ close: boolean;
29434
+ }
29066
29435
  /**
29067
29436
  * Records which IDE the host is connected to, or clears it.
29068
29437
  *
@@ -36548,7 +36917,7 @@ export interface WorkspacesStatFileResult {
36548
36917
  /** @experimental */
36549
36918
  export interface WorkspacesTruncateSummariesRequest {
36550
36919
  /**
36551
- * Number of newest summaries to keep.
36920
+ * Highest checkpoint number to keep. Checkpoints 1 through keepCount (the oldest) are kept and every later checkpoint is deleted; 0 deletes all.
36552
36921
  */
36553
36922
  keepCount: number;
36554
36923
  }
@@ -38805,6 +39174,49 @@ export declare function createServerRpc(connection: MessageConnection): {
38805
39174
  };
38806
39175
  /** Create typed session-scoped RPC methods. */
38807
39176
  export declare function createSessionRpc(connection: MessageConnection, sessionId: string): {
39177
+ /** @experimental */
39178
+ management: {
39179
+ /**
39180
+ * 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.
39181
+ *
39182
+ * @param params Updates the session's live policy without changing persistent host settings.
39183
+ *
39184
+ * @returns Opt-in policy for local session management.
39185
+ */
39186
+ configure: (params: SessionManagementConfigureRequest) => Promise<SessionManagementPolicy>;
39187
+ /**
39188
+ * Lists other live, opted-in sessions in the same configuration directory. Requires the list tool to be enabled.
39189
+ *
39190
+ * @param params Lists opted-in local peers. The caller is omitted.
39191
+ *
39192
+ * @returns Eligible live peers reported by their owning runtimes.
39193
+ */
39194
+ list: (params: SessionManagementListRequest) => Promise<SessionManagementListResult>;
39195
+ /**
39196
+ * 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.
39197
+ *
39198
+ * @param params Sends peer text, never human approval, to another opted-in session.
39199
+ *
39200
+ * @returns Acceptance is not a completed turn or a reply.
39201
+ */
39202
+ message: (params: SessionManagementMessageRequest) => Promise<SessionManagementMessageResult>;
39203
+ /**
39204
+ * 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.
39205
+ *
39206
+ * @param params Requests a separate session. Omitted launch options inherit the caller's current configuration.
39207
+ *
39208
+ * @returns Identifies a session owned and supervised by the creating host.
39209
+ */
39210
+ create: (params: SessionManagementCreateRequest) => Promise<SessionManagementCreateResult>;
39211
+ /**
39212
+ * 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.
39213
+ *
39214
+ * @param params Closes one live opted-in descendant without deleting its saved history or closing its children.
39215
+ *
39216
+ * @returns Completion of the existing non-deleting close lifecycle.
39217
+ */
39218
+ close: (params: SessionManagementCloseRequest) => Promise<SessionManagementCloseResult>;
39219
+ };
38808
39220
  /** @experimental */
38809
39221
  providers: {
38810
39222
  /**
@@ -39443,6 +39855,12 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
39443
39855
  * @returns Canonical runtime state for the session's current autopilot objective.
39444
39856
  */
39445
39857
  getState: () => Promise<AutopilotObjectiveGetStateResult>;
39858
+ /**
39859
+ * Sets whether completing or pausing this session's objective preserves autopilot mode. This in-memory preference defaults to false and must be reapplied when attaching a client.
39860
+ *
39861
+ * @param params Client-resolved preference for retaining autopilot mode after objective completion or pause.
39862
+ */
39863
+ setStayInAutopilot: (params: AutopilotObjectiveSetStayInAutopilotRequest) => Promise<void>;
39446
39864
  };
39447
39865
  /** @experimental */
39448
39866
  completions: {
@@ -40182,6 +40600,12 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
40182
40600
  * @returns The selectable model entries and selection ids synthesized for the synchronized BYOK models.
40183
40601
  */
40184
40602
  sync: (params: ProviderSyncRequest) => Promise<ProviderSyncResult>;
40603
+ /**
40604
+ * Returns credential-free provider configuration status for the selected model. This does not validate provider credentials or contact the provider.
40605
+ *
40606
+ * @returns Credential-free provider configuration status for the selected model.
40607
+ */
40608
+ getStatus: () => Promise<ProviderStatus>;
40185
40609
  /**
40186
40610
  * 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.
40187
40611
  *
@@ -40522,6 +40946,12 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
40522
40946
  * @returns Current permission mode.
40523
40947
  */
40524
40948
  getMode: () => Promise<PermissionsGetModeResult>;
40949
+ /**
40950
+ * 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.
40951
+ *
40952
+ * @returns Available permission modes, derived from current session policy.
40953
+ */
40954
+ getCapabilities: () => Promise<PermissionsCapabilities>;
40525
40955
  /**
40526
40956
  * Adds or removes session-scoped or location-scoped permission rules.
40527
40957
  *
@@ -2146,6 +2146,49 @@ function createInternalServerRpc(connection) {
2146
2146
  }
2147
2147
  function createSessionRpc(connection, sessionId) {
2148
2148
  return {
2149
+ /** @experimental */
2150
+ management: {
2151
+ /**
2152
+ * 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.
2153
+ *
2154
+ * @param params Updates the session's live policy without changing persistent host settings.
2155
+ *
2156
+ * @returns Opt-in policy for local session management.
2157
+ */
2158
+ configure: async (params) => connection.sendRequest("session.management.configure", { ...params, sessionId }),
2159
+ /**
2160
+ * Lists other live, opted-in sessions in the same configuration directory. Requires the list tool to be enabled.
2161
+ *
2162
+ * @param params Lists opted-in local peers. The caller is omitted.
2163
+ *
2164
+ * @returns Eligible live peers reported by their owning runtimes.
2165
+ */
2166
+ list: async (params) => connection.sendRequest("session.management.list", { ...params, sessionId }),
2167
+ /**
2168
+ * 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.
2169
+ *
2170
+ * @param params Sends peer text, never human approval, to another opted-in session.
2171
+ *
2172
+ * @returns Acceptance is not a completed turn or a reply.
2173
+ */
2174
+ message: async (params) => connection.sendRequest("session.management.message", { ...params, sessionId }),
2175
+ /**
2176
+ * 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.
2177
+ *
2178
+ * @param params Requests a separate session. Omitted launch options inherit the caller's current configuration.
2179
+ *
2180
+ * @returns Identifies a session owned and supervised by the creating host.
2181
+ */
2182
+ create: async (params) => connection.sendRequest("session.management.create", { ...params, sessionId }),
2183
+ /**
2184
+ * 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.
2185
+ *
2186
+ * @param params Closes one live opted-in descendant without deleting its saved history or closing its children.
2187
+ *
2188
+ * @returns Completion of the existing non-deleting close lifecycle.
2189
+ */
2190
+ close: async (params) => connection.sendRequest("session.management.close", { ...params, sessionId })
2191
+ },
2149
2192
  /** @experimental */
2150
2193
  providers: {
2151
2194
  /**
@@ -2783,7 +2826,13 @@ function createSessionRpc(connection, sessionId) {
2783
2826
  *
2784
2827
  * @returns Canonical runtime state for the session's current autopilot objective.
2785
2828
  */
2786
- getState: async () => connection.sendRequest("session.autopilotObjective.getState", { sessionId })
2829
+ getState: async () => connection.sendRequest("session.autopilotObjective.getState", { sessionId }),
2830
+ /**
2831
+ * Sets whether completing or pausing this session's objective preserves autopilot mode. This in-memory preference defaults to false and must be reapplied when attaching a client.
2832
+ *
2833
+ * @param params Client-resolved preference for retaining autopilot mode after objective completion or pause.
2834
+ */
2835
+ setStayInAutopilot: async (params) => connection.sendRequest("session.autopilotObjective.setStayInAutopilot", { ...params, sessionId })
2787
2836
  },
2788
2837
  /** @experimental */
2789
2838
  completions: {
@@ -3523,6 +3572,12 @@ function createSessionRpc(connection, sessionId) {
3523
3572
  * @returns The selectable model entries and selection ids synthesized for the synchronized BYOK models.
3524
3573
  */
3525
3574
  sync: async (params) => connection.sendRequest("session.provider.sync", { ...params, sessionId }),
3575
+ /**
3576
+ * Returns credential-free provider configuration status for the selected model. This does not validate provider credentials or contact the provider.
3577
+ *
3578
+ * @returns Credential-free provider configuration status for the selected model.
3579
+ */
3580
+ getStatus: async () => connection.sendRequest("session.provider.getStatus", { sessionId }),
3526
3581
  /**
3527
3582
  * 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
3583
  *
@@ -3863,6 +3918,12 @@ function createSessionRpc(connection, sessionId) {
3863
3918
  * @returns Current permission mode.
3864
3919
  */
3865
3920
  getMode: async () => connection.sendRequest("session.permissions.getMode", { sessionId }),
3921
+ /**
3922
+ * 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.
3923
+ *
3924
+ * @returns Available permission modes, derived from current session policy.
3925
+ */
3926
+ getCapabilities: async () => connection.sendRequest("session.permissions.getCapabilities", { sessionId }),
3866
3927
  /**
3867
3928
  * Adds or removes session-scoped or location-scoped permission rules.
3868
3929
  *
@@ -730,7 +730,7 @@ export type UserMessageAgentMode =
730
730
  /**
731
731
  * A user message attachment — a file, directory, code selection, blob, GitHub reference, GitHub-anchored pointer, or extension-supplied context payload
732
732
  */
733
- export type Attachment = AttachmentFile | AttachmentDirectory | AttachmentSelection | AttachmentGitHubReference | AttachmentGitHubCommit | AttachmentGitHubRelease | AttachmentGitHubActionsJob | AttachmentGitHubRepository | AttachmentGitHubFileDiff | AttachmentGitHubTreeComparison | AttachmentGitHubUrl | AttachmentGitHubFile | AttachmentGitHubSnippet | AttachmentBlob | AttachmentExtensionContext;
733
+ export type Attachment = AttachmentFile | AttachmentDirectory | AttachmentSelection | AttachmentGitHubReference | AttachmentGitHubCommit | AttachmentGitHubRelease | AttachmentGitHubActionsJob | AttachmentGitHubRepository | AttachmentGitHubFileDiff | AttachmentGitHubTreeComparison | AttachmentGitHubUrl | AttachmentGitHubFile | AttachmentGitHubSnippet | AttachmentBlob | AttachmentExtensionContext | AttachmentSessionReference;
734
734
  /**
735
735
  * Why the binary data is absent: it exceeded the inline size limit, or its asset was unavailable
736
736
  */
@@ -6349,6 +6349,28 @@ export interface AttachmentExtensionContext {
6349
6349
  */
6350
6350
  type: "extension_context";
6351
6351
  }
6352
+ /**
6353
+ * An ID-bound reference to an eligible live session. Supplies identity context only, without sending a message, reading history, or granting permission.
6354
+ */
6355
+ /** @experimental */
6356
+ export interface AttachmentSessionReference {
6357
+ /**
6358
+ * User-visible mention label captured when the reference was selected.
6359
+ */
6360
+ displayName?: string;
6361
+ /**
6362
+ * Character offset of the selected mention in the displayed prompt.
6363
+ */
6364
+ mentionIndex?: number;
6365
+ /**
6366
+ * Stable identity of the selected session, never resolved from its title.
6367
+ */
6368
+ sessionId: string;
6369
+ /**
6370
+ * Attachment type discriminator.
6371
+ */
6372
+ type: "session_reference";
6373
+ }
6352
6374
  /**
6353
6375
  * Session event "pending_messages.modified". Empty payload; the event signals that the pending message queue has changed
6354
6376
  */
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";