/** * Resolve the effective backgroundSessions value with full precedence: * TEAMSHARE_BACKGROUND env > agent setting > machine config > default true. * An explicit `false` from the agent always means "visible terminal" (opt-out * to the old behavior). Everything else is silent. */ export declare function resolveBackground(setting?: boolean | null): boolean; /** Session output capture + diagnostics live here. */ export declare const SESSIONS_DIR: string; /** * Identity carried into spawned sessions so PATH shims (npm/git wrappers) * can attribute locks + pings to the right agent/task. */ export interface SessionIdentity { agentId?: string; kind?: string; taskId?: string; projectId?: string; /** Multi-repo: JSON map of repo name -> path for the project. */ repoMap?: Record; } /** Phase D session settings (from the redeem response / join ack). */ export interface SessionSettings { model?: string | null; temperature?: number | null; maxTokens?: number | null; systemPrompt?: string | null; /** Server-side session driver (auto | opencode | claude | openrouter | none). */ harness?: 'auto' | 'opencode' | 'claude' | 'codex' | 'gemini' | 'antigravity' | 'copilot' | 'goose' | 'openhands' | 'aider' | 'openrouter' | 'none' | null; /** * Bridge wake dedupe cooldown (seconds; null = bridge defaults: 5 min * generic wakes, 30 min task/build wakes). */ wakeCooldownSec?: number | null; /** Daily window when wakes are ignored ({ start, end } "HH:MM"). */ quietHours?: { start: string; end: string; } | null; /** * BYOK provider key (key-authenticated settings only). Never passed as a * CLI flag (process-list leakage) - the spawned CLI fetches it itself. */ providerKey?: string | null; /** Run sessions as detached background processes (no visible terminal). */ backgroundSessions?: boolean | null; /** Agent's default working folder (per-agent linked folder). */ folderPath?: string | null; /** The human user who owns this agent (for per-user folder link resolution). */ userId?: string | null; } /** argv-safe equivalent of settingsFlags (headless fallback). */ export declare function settingsArgs(settings?: SessionSettings | null): string[]; /** Translates agent settings into CLI flags; systemPrompt goes to a temp file. */ export declare function settingsFlags(settings?: SessionSettings | null): string; /** * Shared VBS-hidden launch (Windows only). wscript.exe is a GUI-subsystem * binary — `detached` on it creates no console (zero flash) — and its * `sh.Run("node ...", 0, True)` creates the node console SW_HIDE from birth * while wscript stays alive as the parent (survival past the spawner). * This is the only Windows primitive that gives BOTH no-visible-window AND * survives-parent-exit: detached:true forces a visible console, and no- * detached dies with the parent (both empirically verified). */ export declare function launchHiddenVbs(spec: { argv: string[]; capture?: string; cwd?: string; env?: NodeJS.ProcessEnv; vbsPath: string; }): void; /** * Opens a terminal with a readable message when the CLI binary is missing * (stale checkout without `npm run build`) - instead of a flash-close that * shows nothing. Also used by the daemon/protocol guard to explain that a * project needs a linked folder before an agent will work on it. * * When `silent` is true the message goes to the daemon log only (no popup). */ export declare function openErrorTerminal(message: string, silent?: boolean): void; /** Task session: `teamshare-agent run [--task ] ...`. */ export declare function spawnAgentSession(agentId: string, apiKey: string, taskId: string, settings?: SessionSettings | null, sessionId?: string, cwd?: string, repoMap?: Record): void; /** Chat-reply session: `teamshare-agent chat --project --mention ...`. */ export declare function spawnChatSession(agentId: string, apiKey: string, projectId: string, mentionToken: string, settings?: SessionSettings | null, sessionId?: string, cwd?: string, targetId?: string): void; /** Document-assistant session (Phase F): `teamshare-agent doc --document ...`. */ export declare function spawnDocumentSession(agentId: string, apiKey: string, documentId: string, mentionToken: string, settings?: SessionSettings | null, sessionId?: string, cwd?: string, /** IMP-9xx: waking comment id - scopes the reply loop to just that comment. */ commentId?: string): void; /** Board-assistant session (P5): `teamshare-agent board --board ...`. */ export declare function spawnBoardSession(agentId: string, apiKey: string, boardId: string, mentionToken: string, settings?: SessionSettings | null, sessionId?: string, cwd?: string, commentId?: string): void; /** Build session (IMP-700): `teamshare-agent build --project ...`. */ export declare function spawnBuildSession(agentId: string, apiKey: string, projectId: string, settings?: SessionSettings | null, sessionId?: string, cwd?: string): void; /** Research / data-collection session: `teamshare-agent research --run ...`. */ export declare function spawnResearchSession(agentId: string, apiKey: string, projectId: string, runId: string, toolKey: string, settings?: SessionSettings | null, sessionId?: string, cwd?: string): void; /** * Document job: `teamshare-agent doc-job --project ...` - a deterministic * LibreOffice conversion for the document editing pipeline (no LLM involved). * Runs in its own process so a WASM crash cannot take the daemon down. */ export declare function spawnDocJobSession(agentId: string, apiKey: string, projectId: string | undefined, jobId: string, settings?: SessionSettings | null, sessionId?: string): void; /** Plan pass: `teamshare-agent plan --task ...` (enrich, never execute). */ export declare function spawnPlanSession(agentId: string, apiKey: string, taskId: string, projectId?: string, settings?: SessionSettings | null, sessionId?: string, cwd?: string): void; /** IMP-810: Worker session: `teamshare-agent worker --once --agent ...`. */ export declare function spawnWorkerSession(agentId: string, apiKey: string, _taskId: string, _orchestratorTaskId?: string, settings?: SessionSettings | null, sessionId?: string, cwd?: string, repoMap?: Record): void; /** Planner session: `teamshare-agent planner --project --task --agent ...`. */ export declare function spawnPlannerSession(agentId: string, apiKey: string, projectId: string, parentTaskId: string, description: string, settings?: SessionSettings | null, sessionId?: string, cwd?: string, repoMap?: Record): { sid: string; command: string; argv: string[]; capture: string; background: boolean; };