/** * Feedback submission module. * * Spawns `qodercli feedback` as a one-shot subprocess to submit user feedback. * Does not require an active SDK Client / `query()` session. */ import type { InternalAuthOptions } from './types/auth.js'; import type { HostActionEvent } from './protocol/feedback.js'; import type { FeedbackResult } from './types/account.js'; /** * Parameters for submitting feedback. */ export interface SubmitFeedbackParams { /** Feedback content (required) */ content: string; /** Session id to associate the feedback with */ sessionId?: string; /** Working directory the feedback was generated in */ workdir?: string; /** Additional diagnostic paths to include */ include?: string[]; /** Screenshot file paths (CLI accepts up to 5) */ imagePaths?: string[]; /** Contact email */ email?: string; /** Caller application version (CLI falls back to its own version when empty) */ callerVersion?: string; } /** * Integration profile reported in feedback telemetry. * * Translated to the corresponding `QODER_*_INTEGRATION_MODE=1` env var when the * qodercli subprocess is spawned. Affects the `ide_type` field uploaded with * the feedback bundle (and any other env-gated branches qodercli adds later). */ export type IntegrationMode = 'qoder_work' | 'quest' | string; /** * Options that control how the feedback subprocess is spawned. */ export interface SubmitFeedbackOptions { /** Path to the qodercli binary; auto-discovered when omitted */ cliPath?: string; /** Subprocess environment variables (defaults to process.env) */ env?: Record; /** Subprocess timeout in milliseconds (default 60000) */ timeout?: number; /** Storage directory passed via `--storage-dir` to keep auth state aligned */ storageDir?: string; /** * Integration profile to report. Translates to `QODER_WORK_INTEGRATION_MODE=1` * or `QODER_QUEST_INTEGRATION_MODE=1` in the spawned subprocess env. */ integrationMode?: IntegrationMode; } export interface SendHostActionEventOptions { auth?: InternalAuthOptions; proxy?: string; cliPath?: string; env?: Record; cwd?: string; timeout?: number; } /** Keep result correlations outside a materialized session's temporary root. */ export declare function resolveHostActionStorageDir(env?: NodeJS.ProcessEnv): string; /** Internal one-shot fallback. The action JSON is sent only through stdin. */ export declare function sendHostActionEvent(event: HostActionEvent, options?: SendHostActionEventOptions): Promise; /** * Submit user feedback through the qodercli `feedback` subcommand. * * Does not require `query()` to be running — a fresh subprocess is spawned * for each call. * * @example * ```typescript * import { submitFeedback } from '@qoder-ai/qoder-agent-sdk'; * * const result = await submitFeedback( * { content: 'Great experience!', sessionId: 'abc123' }, * { storageDir: '/custom/storage' }, * ); * console.log(result.success, result.message); * ``` */ export declare function submitFeedback(params: SubmitFeedbackParams, options?: SubmitFeedbackOptions): Promise;