basant307/AI_Governance_Project
048
1/**2 * @license3 * Copyright 2025 Google LLC4 * SPDX-License-Identifier: Apache-2.05 */6import type { PartListUnion } from '@google/genai';7import { type Config } from '@qwen-code/qwen-code-core';8import { type SlashCommand, type ExecutionMode } from './ui/commands/types.js';9import type { HistoryItemWithoutId } from './ui/types.js';10import type { LoadedSettings } from './config/settings.js';11/**12 * Result of handling a slash command in non-interactive mode.13 *14 * Supported types:15 * - 'submit_prompt': Submits content to the model (supports all modes)16 * - 'message': Returns a single message (supports non-interactive JSON/text only)17 * - 'stream_messages': Streams multiple messages (supports ACP only)18 * - 'unsupported': Command cannot be executed in this mode19 * - 'no_command': No command was found or executed20 */21export type NonInteractiveSlashCommandResult = {22 type: 'submit_prompt';23 content: PartListUnion;24 outputHistoryItems?: HistoryItemWithoutId[];25 /** Per-turn model id (e.g. inline `/model <id> <prompt>`); no session change. */26 modelOverride?: string;27} | {28 type: 'message';29 messageType: 'info' | 'warning' | 'error';30 content: string;31 outputHistoryItems?: HistoryItemWithoutId[];32} | {33 type: 'stream_messages';34 messages: AsyncGenerator<{35 messageType: 'info' | 'warning' | 'error';36 content: string;37 }, void, unknown>;38} | {39 type: 'unsupported';40 reason: string;41 originalType: string;42} | {43 type: 'no_command';44};45/**46 * Processes a slash command in a non-interactive environment.47 *48 * @param rawQuery The raw query string (should start with '/')49 * @param abortController Controller to cancel the operation50 * @param config The configuration object51 * @param settings The loaded settings52 * @returns A Promise that resolves to a `NonInteractiveSlashCommandResult` describing53 * the outcome of the command execution.54 */55export declare const handleSlashCommand: (rawQuery: string, abortController: AbortController, config: Config, settings: LoadedSettings) => Promise<NonInteractiveSlashCommandResult>;56/**57 * Retrieves all available slash commands for the given execution mode.58 *59 * @param config The configuration object60 * @param abortSignal Signal to cancel the loading process61 * @param mode The execution mode to filter commands for. Defaults to 'acp'.62 * @returns A Promise that resolves to an array of SlashCommand objects63 */64export declare const getAvailableCommands: (config: Config, abortSignal: AbortSignal, mode?: ExecutionMode, settings?: LoadedSettings) => Promise<SlashCommand[]>;65 