mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-09-30 12:39:42 +02:00
SessionMode gains 'pi', a first-class backend alongside Claude Code, OpenCode, Codex, Gemini and Antigravity: its own PTY, tmux session, rose tab identity, welcome button, run-mode entry, cron agentType, Docker and remote-SSH command defaults, and clone-repo Brain option. Pi is a different shape of CLI from the other four, and three decisions follow from that: - It has NO permission prompts and no sandbox, so there is no --dangerously-skip-permissions analog and none was invented. The privilege-shaped knob is the tri-state approveProjectTrust, which makes pi load and EXECUTE repo-local .pi/extensions TypeScript and install missing project packages. clampExternalCliBypassForOwner() therefore puts pi in the MATERIALIZE branch: a non-granted multi-user owner gets --no-approve even when no config was sent, because pi's own default is a prompt the session user could answer themselves. That helper had zero test coverage; it now has coverage for all four CLIs. - Only the PI_ prefix joins the env allowlist. Pi's ~34 provider key vars share no prefix and ALLOWED_ENV_PREFIXES is one global list with no mode context, so admitting them would widen the allowlist for every mode at once. Auth goes through pi's /login or the server's own environment. --api-key is deliberately never wired: it would put a provider secret on the spawn command line. - pi stays OUT of isAltScreenStripMode(). Its default TUI renders into the main screen with terminal-owned scrollback, and its 0.84.0 fullscreen mode is runtime-switchable via /settings; that flip was measured to put the pane into the alt screen, which the strip would have corrupted. pi-cli-resolver.ts additionally sanity-probes `pi --version` and requires semver-shaped output, because `pi` is a short generic name a stray binary can shadow; GET /api/pi/status surfaces path and version so a misresolution is diagnosable rather than presenting as a broken mode. Docker installs pi in its own --ignore-scripts step so that flag cannot affect the other four CLIs, and seeds its credentials per-file rather than whole-dir (~/.pi/agent also holds sessions, extensions and package trees). Verified end to end against pi 0.84.1 on an isolated instance: resolver search-dir fallback, flag construction, piConfig persistence across a full server restart, the trust prompt and its --no-approve suppression, the rose Run button on the default daylight-blue skin (the nested skin block eats per-mode gradients unless the rule lives inside it), and the buffer local-echo policy, which pi tolerates where codex did not. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
38 lines
1.7 KiB
TypeScript
38 lines
1.7 KiB
TypeScript
/**
|
|
* @fileoverview Utility module exports.
|
|
*
|
|
* This module re-exports all utility classes and functions for easy import.
|
|
*
|
|
* @module utils
|
|
*/
|
|
|
|
export { BufferAccumulator } from './buffer-accumulator.js';
|
|
export { CleanupManager } from './cleanup-manager.js';
|
|
export { Debouncer, KeyedDebouncer } from './debouncer.js';
|
|
export { startEventLoopMonitor } from './event-loop-monitor.js';
|
|
export type { EventLoopMonitorHandle } from './event-loop-monitor.js';
|
|
export { StaleExpirationMap } from './stale-expiration-map.js';
|
|
export {
|
|
ANSI_ESCAPE_PATTERN_FULL,
|
|
ANSI_ESCAPE_PATTERN_SIMPLE,
|
|
TOKEN_PATTERN,
|
|
SPINNER_PATTERN,
|
|
CLAUDE_WORKING_LINE_PATTERN,
|
|
stripAnsi,
|
|
SAFE_PATH_PATTERN,
|
|
execPattern,
|
|
} from './regex-patterns.js';
|
|
export { MAX_SESSION_TOKENS } from './token-validation.js';
|
|
export { isSafePushEndpoint } from './push-endpoint-validation.js';
|
|
export { stringSimilarity, fuzzyPhraseMatch, todoContentHash } from './string-similarity.js';
|
|
export { assertNever } from './type-safety.js';
|
|
export { wrapWithNice } from './nice-wrapper.js';
|
|
export { resolveLocalShell, loginShellArgs } from './shell-resolver.js';
|
|
export { findClaudeDir, getAugmentedPath, getClaudeCliVersion, getClaudeBinaryPath } from './claude-cli-resolver.js';
|
|
export { spawnPtyWithHelperRepair } from './node-pty-repair.js';
|
|
export { resolveOpenCodeDir } from './opencode-cli-resolver.js';
|
|
export { resolveCodexDir, isCodexAvailable } from './codex-cli-resolver.js';
|
|
export { resolveGeminiDir, isGeminiAvailable } from './gemini-cli-resolver.js';
|
|
export { resolveAntigravityDir, isAntigravityAvailable } from './antigravity-cli-resolver.js';
|
|
export { resolvePiDir, isPiAvailable, getPiCliVersion } from './pi-cli-resolver.js';
|