mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-02 06:54:50 +01:00
* setup: explicit contributor marker; move pre-v1.91.231.0 installs to production deps (#3447) ./setup used node_modules/typescript as its contributor signal, so every install made before v1.91.231.0 (a full bun install) kept ~520 MB of test and eval packages forever. The contributor is now the clone bin/dev-setup marks with git config gstack.contributor true, or GSTACK_CONTRIBUTOR=1. An unmarked clone with the dev toolchain moves node_modules aside under a checkout lock, installs production-only, verifies every dependency, and drops the backup; any failure puts the full install back with SETUP_DEPS_MIGRATE_FAILED. CI and a clone whose git config cannot be read never migrate. Bun cache entries for the pinned Agent SDK are removed only when no other project links to them. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * hosts: add Gemini CLI as an experimental host (#1247) ./setup --host gemini (alias gemini-cli; --host auto when gemini is on PATH) installs gstack-<skill> directories into ~/.gemini/skills, which Gemini CLI 0.66.0 lists with gemini skills list, plus the ~/.gemini/skills/gstack runtime root. Renders go to .gemini-cli/ (gitignored) with name+description frontmatter whose names match their directories, CLAUDE.md rewritten to GEMINI.md, and a tool glossary for Gemini CLI's names (and Antigravity's, which can read the same folder). gstack-uninstall removes only gstack-managed entries there, so the user's own skills stay. Docs: ADDING_A_HOST.md verified facts, hosts.md, uninstall.md, README. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes (leave Bun's shared cache alone) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * changelog: Gemini CLI host and contributor marker (#1247, #3447) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: host lists name Copilot, Antigravity and Gemini CLI Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: the plan-mode re-render guard count includes the Gemini CLI host Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: troubleshooting's runtime-root guard host list names Gemini CLI Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
72 lines
2.4 KiB
TypeScript
72 lines
2.4 KiB
TypeScript
/**
|
|
* Host config registry.
|
|
*
|
|
* Import all host configs and derive the Host union type.
|
|
* Adding a new host: create hosts/myhost.ts, import here, add to ALL_HOST_CONFIGS.
|
|
*/
|
|
|
|
import type { HostConfig } from '../scripts/host-config';
|
|
import claude from './claude';
|
|
import codex from './codex';
|
|
import factory from './factory';
|
|
import kiro from './kiro';
|
|
import opencode from './opencode';
|
|
import slate from './slate';
|
|
import cursor from './cursor';
|
|
import openclaw from './openclaw';
|
|
import hermes from './hermes';
|
|
import gbrain from './gbrain';
|
|
import copilot from './copilot';
|
|
import agy from './agy';
|
|
import gemini from './gemini';
|
|
|
|
/** All registered host configs. Add new hosts here. */
|
|
export const ALL_HOST_CONFIGS: HostConfig[] = [claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain, copilot, agy, gemini];
|
|
|
|
/** Map from host name to config. */
|
|
export const HOST_CONFIG_MAP: Record<string, HostConfig> = Object.fromEntries(
|
|
ALL_HOST_CONFIGS.map(c => [c.name, c])
|
|
);
|
|
|
|
/** Union type of all host names, derived from configs. */
|
|
export type Host = (typeof ALL_HOST_CONFIGS)[number]['name'];
|
|
|
|
/** All host names as a string array (for CLI arg validation, etc.). */
|
|
export const ALL_HOST_NAMES: string[] = ALL_HOST_CONFIGS.map(c => c.name);
|
|
|
|
/** Get a host config by name. Throws if not found. */
|
|
export function getHostConfig(name: string): HostConfig {
|
|
const config = HOST_CONFIG_MAP[name];
|
|
if (!config) {
|
|
throw new Error(`Unknown host '${name}'. Valid hosts: ${ALL_HOST_NAMES.join(', ')}`);
|
|
}
|
|
return config;
|
|
}
|
|
|
|
/**
|
|
* Resolve a host name from a CLI argument, handling aliases.
|
|
* e.g., 'agents' → 'codex', 'droid' → 'factory', 'antigravity' → 'agy', 'gemini-cli' → 'gemini'
|
|
*/
|
|
export function resolveHostArg(arg: string): string {
|
|
// Direct name match
|
|
if (HOST_CONFIG_MAP[arg]) return arg;
|
|
|
|
// Alias match
|
|
for (const config of ALL_HOST_CONFIGS) {
|
|
if (config.cliAliases?.includes(arg)) return config.name;
|
|
}
|
|
|
|
throw new Error(`Unknown host '${arg}'. Valid hosts: ${ALL_HOST_NAMES.join(', ')}`);
|
|
}
|
|
|
|
/**
|
|
* Get hosts that are NOT the primary host (Claude).
|
|
* These are the hosts that need generated skill docs.
|
|
*/
|
|
export function getExternalHosts(): HostConfig[] {
|
|
return ALL_HOST_CONFIGS.filter(c => c.name !== 'claude');
|
|
}
|
|
|
|
// Re-export individual configs for direct import
|
|
export { claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain, copilot, agy, gemini };
|