/** * Shared constants and types of the headless LLM loop (`--self`): provider * defaults, iteration/timeout budgets, and the ToolDef/ChatMessage wire * shapes. Split out of llm.ts (1200-line-per-file rule) - re-exported from * llm.ts where part of its public surface. */ export declare const DEFAULT_LLM_BASE_URL = "https://api.openai.com/v1"; export declare const DEFAULT_LLM_MODEL = "deepseek-chat"; export declare const MAX_ITERATIONS = 12; export declare const TIMEOUT_MS = 120000; export declare const STREAM_TIMEOUT_MS = 180000; export interface ToolDef { name: string; description: string; parameters: Record; } export interface ChatMessage { role: 'system' | 'user' | 'assistant' | 'tool'; content?: string; tool_call_id?: string; tool_calls?: Array<{ id: string; type: 'function'; function: { name: string; arguments: string; }; }>; } export interface LlmResult { summary: string; iterations: number; tokensUsed: number; finishedBy: 'no-tool-call' | 'max-iterations' | 'task-done' | 'asked-human'; } export interface LlmOptions { baseUrl: string; apiKey: string; model: string; agentName: string; systemPrompt?: string | null; /** Sampling temperature (0-2). Default 0.2 (Phase D). */ temperature?: number; /** Token budget for the completion (Phase D). */ maxTokens?: number; /** Resume a previous --self session for this task (Phase E, IMP-540). */ continue?: boolean; /** * The agent's own TeamShare user id. Lets the agent assign tasks/subtasks * to itself: create_task/update_task accept assigneeId "me"/"self" which * resolve to this id. Injected from GET /agents/:id/settings (userId). */ agentUserId?: string; /** * Read-only plan-mode session (plain chat): the system prompt forbids * local file edits/git and requires offering task creation instead. * Only chat-reply sets this (for mentions with NO linked task) — build * and task sessions must never pass it. */ readOnly?: boolean; /** * Run-stable OpenCode session id, sent as `x-opencode-session` on Zen/Go * direct calls. Session runners generate one per run when absent; every * turn of the same run reuses it (routing + prompt caching). */ opencodeSessionId?: string; }