mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-08 16:39:42 +02:00
Introduce src/config/terminal-history.ts: one place for terminal scrollback, tmux history-limit, and PTY buffer byte caps, each overridable via env var or the settings object and bounds-clamped via resolveTerminalHistoryConfig(). Defaults match the prior hardcoded values, so this is behavior-neutral. Wires the resolver through buffer-limits, tmux-manager (incl. a setHistoryLimit so a settings change applies live), session, server, system-routes, session-routes, schemas, and the config port. Adds 4 optional settings keys (terminalScrollback Lines, tmuxHistoryLimit, terminalBufferMaxBytes, terminalBufferTrimBytes) with bounds + a trim<=max cross-check.
26 lines
1.1 KiB
TypeScript
26 lines
1.1 KiB
TypeScript
/**
|
|
* @fileoverview Config port — capabilities for app configuration and settings.
|
|
* Route modules that read or modify configuration depend on this port.
|
|
*/
|
|
|
|
import type { ClaudeMode, NiceConfig } from '../../types.js';
|
|
import type { StateStore } from '../../state-store.js';
|
|
import type { TerminalHistoryConfig } from '../../config/terminal-history.js';
|
|
|
|
export interface ConfigPort {
|
|
readonly store: StateStore;
|
|
readonly port: number;
|
|
readonly https: boolean;
|
|
readonly testMode: boolean;
|
|
readonly serverStartTime: number;
|
|
getGlobalNiceConfig(): Promise<NiceConfig | undefined>;
|
|
getModelConfig(): Promise<{ defaultModel?: string; agentTypeOverrides?: Record<string, string> } | null>;
|
|
getClaudeModeConfig(): Promise<{ claudeMode?: ClaudeMode; allowedTools?: string }>;
|
|
getTerminalHistoryConfig(): Promise<TerminalHistoryConfig>;
|
|
getDefaultClaudeMdPath(): Promise<string | undefined>;
|
|
getLightState(): unknown;
|
|
getLightSessionsState(): unknown[];
|
|
startTranscriptWatcher(sessionId: string, transcriptPath: string): void;
|
|
stopTranscriptWatcher(sessionId: string): void;
|
|
}
|