import { Event } from "../../../../base/common/event.js"; import { IHoverDelegate } from "../../../../base/browser/ui/hover/hoverDelegate.js"; import { IDisposable } from "../../../../base/common/lifecycle.js"; import { IObservable } from "../../../../base/common/observable.js"; import { IChatInputPickerResponsiveLayoutItem } from "../../../../workbench/contrib/chat/browser/widget/input/chatInputPickerResponsiveLayout.js"; import { IModelPickerComparison } from "../../../../workbench/contrib/chat/browser/widget/input/modelPicker/modelPickerComparison.js"; import { IChatRequestVariableEntry } from "../../../../workbench/contrib/chat/common/attachments/chatVariableEntries.js"; import { IWorkspaceSelectionSnapshot } from "../../../common/workspaceSelection.js"; import { IActiveSession } from "../../../services/sessions/common/sessionsManagement.js"; import type { IChat } from "../../../services/sessions/common/session.js"; import { NewSessionWorkspacePreselectionSource } from "./newSessionComposerService.js"; import type { NewChatUserInteraction } from "./newChatUserInteraction.js"; import type { ISessionTypePickerOptions } from "./sessionTypePicker.js"; import type { IChatPetPlatformOccupation } from "../../../../workbench/contrib/chat/browser/widget/chatPetWidget.js"; /** * The attachments with the input's GitHub issue and pull request links kept as * pills: links typed into the input are added, and pills for links no longer * in it are removed. Returns `undefined` when nothing changes. */ export declare function syncInputGitHubContextAttachments(input: string, attachments: readonly IChatRequestVariableEntry[]): IChatRequestVariableEntry[] | undefined; /** Whether the composer has something to send: text, an explicit file or image, or host-provided content. */ export declare function hasSendableNewChatContent(query: string, attachments: readonly IChatRequestVariableEntry[], hasAdditionalSendContent?: boolean): boolean; /** The new-session composer's prompt placeholder. */ export declare const NEW_SESSION_PROMPT_PLACEHOLDER: string; /** * The labeled pickers in `container`, for responsive layouts that compact them * when the row runs out of room. */ export declare function getLabeledPickerResponsiveItems(container: HTMLElement): IChatInputPickerResponsiveLayoutItem[]; /** * Options passed to a composer's `sendRequest` callback when the user submits * the input. */ export interface INewChatInputSendRequest { readonly query: string; readonly attachments?: IChatRequestVariableEntry[]; readonly background?: boolean; readonly userInteraction?: NewChatUserInteraction; } /** Repository controls a host renders in place of the session provider's. */ export interface IComposerRepositoryControls extends IDisposable { /** Whether any control is shown, so an otherwise empty controls row can hide. */ readonly visible: IObservable; } /** Options a new-session or new-chat host supplies to its composer input. */ export interface INewChatComposerInputOptions { readonly session: IObservable; /** * The chat the input binds to. Defaults to the session's active chat, such as a new session's * draft chat. A host that shows one of several chats passes its own, so the input never binds * to another chat that is active elsewhere. */ readonly chat?: IObservable; readonly getWorkspacePreselectionSource?: () => NewSessionWorkspacePreselectionSource; readonly getWorkspaceSelection?: () => IWorkspaceSelectionSnapshot; readonly onDidChangeWorkspaceSelection?: Event; readonly canApplyWorkspaceDefault?: () => boolean; readonly sendRequest: (request: INewChatInputSendRequest) => Promise; /** Keep an in-place composer's read-only editor focusable while confirming and sending. */ readonly preserveInputFocusOnSend?: boolean; /** * Asks the host about a request before it is sent. Answering is not part of the request's latency, * so it runs before the request is measured. Resolves `false` to cancel the send. */ readonly confirmSend?: (query: string) => Promise; readonly inputVisible?: IObservable; readonly hostVisible?: IObservable; readonly canSendRequest: IObservable; readonly canSubmitWithoutSession?: IObservable; readonly hasAdditionalSendContent?: IObservable; readonly loading: IObservable; readonly placeholder?: string; /** Marks the input box as this onboarding spotlight target. */ readonly onboardingTargetId?: string; /** * The repository controls (such as isolation and branch). By default the session provider * contributes them; `false` renders none, and a function renders the host's own controls in * their place, so they are positioned like the provider's. */ readonly renderRepositoryControls?: boolean | ((container: HTMLElement, hoverDelegate: IHoverDelegate) => IComposerRepositoryControls); readonly sessionTypePickerOptions?: ISessionTypePickerOptions; readonly supportsBackground?: boolean; readonly sendButtonLabel?: IObservable; readonly modelPickerComparison?: IModelPickerComparison; readonly deferredNotificationsEnabled?: IObservable; readonly petHostPreferred?: IObservable; readonly renderChatPet?: boolean; readonly getChatPetPlatformElements?: () => readonly HTMLElement[]; readonly getChatPetBasePlatformElement?: () => HTMLElement | undefined; readonly getChatPetJumpGameElement?: () => HTMLElement | undefined; readonly onDidChangeChatPetPlatform?: Event; readonly setChatPetPlatformOccupation?: (occupation: IChatPetPlatformOccupation | undefined) => void; /** * Keep this composer a valid voice target even while a created session * is active. Used by the in-session "new chat" composer so dictation * creates a parallel chat instead of routing to the parent session's * chat widget. The welcome composer leaves this unset. */ readonly voiceRoutesWhileSessionActive?: boolean; }