import type { SessionConfigPropertySchema, SessionConfigSchema } from "./state/protocol/commands.js"; import { type ChatConfigState, type ChatSummary, type SessionConfigState } from "./state/protocol/state.js"; export type SessionApprovalLevel = "default" | "assisted" | "autoApprove"; export type SessionWorkspaceTarget = "folder" | "worktree"; export interface ISessionConfigProperty { readonly key: string; readonly schema: SessionConfigPropertySchema; } /** Copilot creation-time integration options are not user-facing chat controls. */ export declare function isHiddenSessionConfigProperty(key: string): boolean; /** A published VS Code key wins even if its shape requires the generic picker. */ export declare function getSessionApprovalProperty(schema: SessionConfigSchema | undefined): ISessionConfigProperty | undefined; export declare function getSessionModeProperty(schema: SessionConfigSchema | undefined): ISessionConfigProperty | undefined; export declare function getSessionIsolationProperty(schema: SessionConfigSchema): ISessionConfigProperty | undefined; export declare function getSessionBaseBranchProperty(schema: SessionConfigSchema): ISessionConfigProperty | undefined; export declare function getSessionWorkspaceProperties(schema: SessionConfigSchema): { isolationKey: string; baseBranchKey: string; isolation: ISessionConfigProperty | undefined; baseBranch: ISessionConfigProperty | undefined; }; /** Reuses existing controls without renaming the host's properties or confusing its two branch fields. */ export declare function getSessionConfigPresentationKey(key: string, schema: SessionConfigSchema): string; export declare function readSessionApprovalLevel(property: ISessionConfigProperty | undefined, value: unknown): SessionApprovalLevel | undefined; export declare function writeSessionApprovalLevel(property: ISessionConfigProperty | undefined, level: string): string | undefined; export declare function readSessionIsolation(property: ISessionConfigProperty | undefined, value: unknown): SessionWorkspaceTarget | undefined; export declare function writeSessionIsolation(property: ISessionConfigProperty | undefined, isolation: string): string | undefined; export declare function getAvailableSessionApprovalValues(property: ISessionConfigProperty, schema: SessionConfigSchema, values: Readonly>): readonly string[]; /** * Supported approval values that the host's read-only availability report withholds. Unlike values absent from * the schema, they are supported but not currently allowed; the report does not say why. */ export declare function getWithheldSessionApprovalValues(property: ISessionConfigProperty, schema: SessionConfigSchema, values: Readonly>): readonly string[]; export declare function getEffectiveSessionApprovalValue(property: ISessionConfigProperty, schema: SessionConfigSchema, values: Readonly>): unknown; /** * Whether a picker in a chat may change a property: before the session is * created, or afterwards when the session's value may change or the chat may * set its own (`chatMutable`, independent of `sessionMutable`). */ export declare function isSessionConfigWritable(schema: SessionConfigPropertySchema | undefined, isNewSession: boolean): boolean; export declare function validateSessionConfigWrite(schema: SessionConfigSchema, values: Readonly>, key: string, value: unknown, isNewSession: boolean): void; /** Retains advertised inputs without inventing defaults, renaming aliases, or forwarding approval reports. */ export declare function filterSessionConfigValues(schema: SessionConfigSchema, values: Readonly> | undefined, isNewSession?: boolean): Record; /** Whether a chat may set `key` for itself; every other property is set on the session. */ export declare function isChatConfigProperty(schema: SessionConfigSchema | undefined, key: string): boolean; /** Whether the session's schema lets a chat set any property for itself; a host without such properties keeps all config on the session. */ export declare function hasChatConfigProperties(schema: SessionConfigSchema | undefined): boolean; /** The values of `values` that the session's schema lets a chat set for itself. */ export declare function filterChatConfigValues(schema: SessionConfigSchema | undefined, values: Readonly> | undefined): Record; /** * The defaults of a chat's own schema with `values` applied over them: the * effective config of a chat whose agent differs from its session's. An omitted * value falls back to its schema default. */ export declare function withChatSchemaDefaults(schema: SessionConfigSchema, values: Readonly> | undefined): Record; /** * The chat-applicable part of an agent's config, for a chat whose agent * differs from its session's: the properties a chat may set, seeded with the * agent's defaults (`values`) and then with `existing` values the schema accepts. */ export declare function toOwnChatConfig(agentConfig: SessionConfigState, existing?: Readonly>): SessionConfigState; /** * The values of `values` a chat may keep under `schema`: properties the schema marks `chatMutable`, not host-reported * (`readOnly`), with a value the schema offers. Used when a moved chat's config schema changes with its agent. */ export declare function getValidChatConfigValues(schema: SessionConfigSchema, values: Readonly>): Record; /** * The config schema of a chat: its own (`ChatConfigState.schema`, set for a * chat whose agent differs from its session's), else its session's. */ export declare function getChatConfigSchema(session: SessionConfigState | undefined, chat: ChatConfigState | undefined): SessionConfigSchema | undefined; /** * The values a chat is created with, or that an older build's overlay of a * chat's own values completes to: the `chatMutable` properties of the session's * effective `values`, with `overlay` (the chat's own values) applied over them. * Properties that are not `chatMutable` stay session-wide, and `readOnly` ones * are host-reported, so neither is copied from the session. */ export declare function getCompleteChatConfigValues(session: SessionConfigState, overlay?: Readonly>): Record; /** * A chat's effective config. A chat with its own `schema` (its agent differs * from its session's) is that schema with its values over the schema's defaults. * A chat without config is the session's. * * Otherwise it depends on `completeValues`, whether the host publishes a chat's * complete values (only while chats may use their own agents, the * `multipleChatProviders.enabled` root config): * - `false` (default; older hosts, and hosts with the setting off): the chat's * values are an overlay on its session's: the session's config with the * chat's own values applied over it (see {@link applyChatConfigLayers}), so a * property the chat didn't set follows its session. * - `true`: the chat's values are its complete config, which the session's * config never changes: its `chatMutable` properties come from its values, * falling back to the schema's `default`, and the other, session-wide * properties from the session. */ export declare function getEffectiveChatConfig(session: SessionConfigState, chat: ChatConfigState | undefined, completeValues?: boolean): SessionConfigState; /** * Applies a chat's own config layers (innermost first: the chat, then the * chats that spawned it) over `base` (the session's values); an inner value * wins. A host-reported effective approval mode describes the approvals of * its own layer and the layers outside it, so one from outside a layer that * chose its own approvals does not apply. */ export declare function applyChatConfigLayers(base: Readonly>, layers: readonly Readonly>[]): Record; /** * The chats whose own config values apply to `chat`, innermost first: the chat, * then the chats that spawned it, following the `Tool` origins recorded in the * session's chat catalog (as the host does), never the chat URI's shape. */ export declare function getChatConfigChain(chats: readonly Pick[] | undefined, chat: string): readonly string[]; /** * The chat whose own values a write from `chat` changes: the chat itself, or * for a subagent its nearest spawning chat that is not one, as the host does * for a subagent's writes. */ export declare function getChatConfigWriteTarget(chats: readonly Pick[] | undefined, chat: string): string; /** * The config of a chat chain (innermost first) as one chat's (see {@link applyChatConfigLayers}), keeping the * innermost own `schema`: a subagent has no config of its own and uses the chat that spawned it. */ export declare function mergeChatConfigChain(configs: readonly (ChatConfigState | undefined)[]): ChatConfigState | undefined; /** Splits a config patch into the values a chat sets for itself and the values set on the session. */ export declare function splitChatConfigPatch(schema: SessionConfigSchema | undefined, patch: Readonly>): { readonly chat: Record; readonly session: Record; }; /** * Throws when a client may not set `key` to `value` for a chat. `values` are * the chat's effective values; the session's write rules apply on top of * the property being settable per chat. */ export declare function validateChatConfigWrite(schema: SessionConfigSchema, values: Readonly>, key: string, value: unknown): void; /** * Throws when a picker in a chat may not write `key` to `value`: a running * session's `chatMutable` property is written to the chat, everything else to * the session. */ export declare function validateChatPickerConfigWrite(schema: SessionConfigSchema, values: Readonly>, key: string, value: unknown, isNewSession: boolean): void;