mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-14 10:39:32 +01:00
Found with knip (exports, types, class members) and confirmed by a text search of src, test, scripts and packages before each removal. - Per-CLI get<Cli>NotFoundMessage() (nine of them) with their message constants: missingCliMessage() builds that text from the registry now. - Registry leftovers: renderCliCommand, asCliId, cliIds, isCliRunnable, createCliResolverForTest, profileExists, and two name lists that only repeated schema enums. - A task-description cache in Session that was written on every chunk of terminal output (one regex pass per line) and never read since the subagent watcher takes descriptions from transcripts. The cache module, its pattern and both parse methods go with it. - Session.parentAgentId / childAgentIds: never set by anything, so the two optional SessionState fields were never on the wire. - Unreferenced methods on TmuxManager (pipe-pane pair, syncMouseMode), RespawnController, StateStore.recoverFromBackup (load() already falls back to the .bak file), TeamWatcher, SseStreamManager and the AI checkers' getErrorVerdict. - updateCaseEnvVars: the settings.local.json env path that envOverrides replaced. - Re-exports in the utils, cli-registry, routes and prompts barrels that no importer used, and unused test helpers (MockStateStore, the mobile throttle helpers and others). Eight mobile tests imported the WebServer type from a path that does not exist (../src instead of ../../src); type-only, so nothing failed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
49 lines
1.9 KiB
TypeScript
49 lines
1.9 KiB
TypeScript
/**
|
|
* @fileoverview Resolve the Antigravity CLI (`agy`) binary across common install paths.
|
|
*
|
|
* Mirrors gemini-cli-resolver.ts. Google's installer (antigravity.google/cli/install.sh)
|
|
* places the binary at ~/.local/bin/agy; the other locations cover manual installs.
|
|
*
|
|
* @module utils/antigravity-cli-resolver
|
|
*/
|
|
|
|
import { getCli } from '../config/cli-registry/registry.js';
|
|
import { expandHome } from './cli-resolver.js';
|
|
import { createCliExecutableResolver, type CliResolverHost } from './cli-executable-resolver.js';
|
|
|
|
/** Common directories where the Antigravity CLI binary may be installed */
|
|
/**
|
|
* Directories probed after `which`, read from this CLI's registry entry so the spawn
|
|
* path, `codeman doctor` and this resolver cannot disagree about where to look.
|
|
* `~` is expanded by `expandHome`; nothing else is interpreted.
|
|
*/
|
|
const ANTIGRAVITY_SEARCH_DIRS = (): string[] => (getCli('antigravity')?.discovery.searchDirs ?? []).map(expandHome);
|
|
|
|
function createAntigravityResolver(host?: CliResolverHost, now?: () => number) {
|
|
return createCliExecutableResolver({ binary: 'agy', searchDirs: ANTIGRAVITY_SEARCH_DIRS, now }, host);
|
|
}
|
|
|
|
/** Creates an isolated Antigravity wrapper around an injected resolver host and clock. */
|
|
export function createAntigravityResolverForTest(host: CliResolverHost, now?: () => number) {
|
|
return createAntigravityResolver(host, now);
|
|
}
|
|
|
|
const antigravityResolver = createAntigravityResolver();
|
|
|
|
/**
|
|
* Finds the directory containing the `agy` binary.
|
|
* Checks `which agy` first, then falls back to common install locations.
|
|
*
|
|
* @returns Directory path, or null if not found
|
|
*/
|
|
export function resolveAntigravityDir(): string | null {
|
|
return antigravityResolver.resolve()?.directory ?? null;
|
|
}
|
|
|
|
/**
|
|
* Check if the Antigravity CLI is available on the system.
|
|
*/
|
|
export function isAntigravityAvailable(): boolean {
|
|
return resolveAntigravityDir() !== null;
|
|
}
|