/** * Core constants for the Qoder Agent SDK. * * Hook events, exit reasons, timing constants, and version info. */ /** * Hook events supported by the public SDK hook registration API. */ export declare const HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "PostToolUseFailure", "UserPromptSubmit", "SessionStart", "SessionEnd", "Stop", "SubagentStart", "SubagentStop", "PreCompact", "PostCompact", "CwdChanged", "InstructionsLoaded", "FileChanged", "PermissionRequest", "PermissionDenied"]; /** * All supported exit reasons for session termination. */ export declare const EXIT_REASONS: readonly ["clear", "resume", "logout", "prompt_input_exit", "other", "bypass_permissions_disabled"]; /** * Grace period in milliseconds before sending SIGTERM after closing stdin. * Gives the CLI process time to flush and exit cleanly. */ export declare const CLOSE_GRACE_MS = 2000; /** * Grace period in milliseconds before sending SIGKILL after SIGTERM. * If the process hasn't exited after SIGTERM within this window, force-kill it. */ export declare const KILL_GRACE_MS = 5000; export declare const SDK_VERSION: string; /** * Value for the `--permission-prompt-tool` CLI flag. * * When set to `'stdio'`, the CLI sends permission prompts as `can_use_tool` * control requests over the JSONL stdin/stdout protocol, allowing the SDK * to resolve them via the `canUseTool` callback. */ export declare const PERMISSION_PROMPT_TOOL_STDIO = "stdio"; /** * Exit code the Qoder CLI emits for `FATAL_AUTHENTICATION_ERROR`. * See qodercli-next packages/core/src/utils/exitCodes.ts. */ export declare const CLI_EXIT_CODE_AUTH_ERROR = 41; /** * Built-in qodercli tools exposed by SDK sessions when callers do not pass * `options.tools`. * * Keep this list explicit so new qodercli built-ins do not automatically * become SDK-visible. UpdateGoal is included so an active goal started through * the SDK control plane can terminate itself. Goal creation/read, cron, * workflow, plan-mode transition, Bash PTY, worktree, topic, and * background-task control tools remain opt-in via `options.tools`. */ export declare const SDK_DEFAULT_TOOLS: readonly ["Agent", "AskUserQuestion", "Bash", "Edit", "Glob", "Grep", "ImageGen", "ImageSearch", "NotebookEdit", "Read", "Skill", "TaskCreate", "TaskGet", "TaskUpdate", "TaskList", "UpdateGoal", "WebFetch", "WebSearch", "Write"]; export declare const SDK_TASK_TOOLS: readonly ["TaskCreate", "TaskGet", "TaskUpdate", "TaskList"]; /** * Resolve the SDK's curated default tool surface against qodercli's Task * feature flag. qodercli replaces the persistent Task tools with TodoWrite * when QODER_FEATURE_TASKS is explicitly disabled, so the SDK must make the * same replacement before it writes its explicit --tools allowlist. */ export declare function resolveSdkDefaultTools(env: Record): string[]; /** * Tool names with SDK-side enrichment. Tracked as constants so callers and * the runner agree on the exact string the CLI emits. */ export declare const EXIT_PLAN_MODE_TOOL_NAME = "ExitPlanMode"; /** * Derived types from the const arrays. */ export type HookEventConst = (typeof HOOK_EVENTS)[number]; export type ExitReasonConst = (typeof EXIT_REASONS)[number];