mirror of https://github.com/garrytan/gstack.git
feat(hosts): add support for antigravity agent host
This commit is contained in:
parent
0c88517a0f
commit
9fb8990d06
|
|
@ -18,6 +18,7 @@ bin/gstack-global-discover
|
||||||
.openclaw/
|
.openclaw/
|
||||||
.hermes/
|
.hermes/
|
||||||
.gbrain/
|
.gbrain/
|
||||||
|
.antigravity/
|
||||||
.gbrain-source
|
.gbrain-source
|
||||||
.context/
|
.context/
|
||||||
extension/.auth.json
|
extension/.auth.json
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,7 @@ Or target a specific agent with `./setup --host <name>`:
|
||||||
| Kiro | `--host kiro` | `~/.kiro/skills/gstack-*/` |
|
| Kiro | `--host kiro` | `~/.kiro/skills/gstack-*/` |
|
||||||
| Hermes | `--host hermes` | `~/.hermes/skills/gstack-*/` |
|
| Hermes | `--host hermes` | `~/.hermes/skills/gstack-*/` |
|
||||||
| GBrain (mod) | `--host gbrain` | `~/.gbrain/skills/gstack-*/` |
|
| GBrain (mod) | `--host gbrain` | `~/.gbrain/skills/gstack-*/` |
|
||||||
|
| Antigravity | `--host antigravity` | `~/.antigravity/skills/gstack-*/` |
|
||||||
|
|
||||||
**Want to add support for another agent?** See [docs/ADDING_A_HOST.md](docs/ADDING_A_HOST.md).
|
**Want to add support for another agent?** See [docs/ADDING_A_HOST.md](docs/ADDING_A_HOST.md).
|
||||||
It's one TypeScript config file, zero code changes.
|
It's one TypeScript config file, zero code changes.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
import type { HostConfig } from '../scripts/host-config';
|
||||||
|
|
||||||
|
const antigravity: HostConfig = {
|
||||||
|
name: 'antigravity',
|
||||||
|
displayName: 'Antigravity',
|
||||||
|
cliCommand: 'antigravity',
|
||||||
|
cliAliases: [],
|
||||||
|
|
||||||
|
globalRoot: '.config/antigravity/skills/gstack',
|
||||||
|
localSkillRoot: '.antigravity/skills/gstack',
|
||||||
|
hostSubdir: '.antigravity',
|
||||||
|
usesEnvVars: true,
|
||||||
|
|
||||||
|
frontmatter: {
|
||||||
|
mode: 'allowlist',
|
||||||
|
keepFields: ['name', 'description'],
|
||||||
|
descriptionLimit: null,
|
||||||
|
},
|
||||||
|
|
||||||
|
generation: {
|
||||||
|
generateMetadata: false,
|
||||||
|
skipSkills: ['codex'],
|
||||||
|
},
|
||||||
|
|
||||||
|
pathRewrites: [
|
||||||
|
{ from: '~/.claude/skills/gstack', to: '~/.config/antigravity/skills/gstack' },
|
||||||
|
{ from: '.claude/skills/gstack', to: '.antigravity/skills/gstack' },
|
||||||
|
{ from: '.claude/skills', to: '.antigravity/skills' },
|
||||||
|
],
|
||||||
|
|
||||||
|
suppressedResolvers: ['GBRAIN_CONTEXT_LOAD', 'GBRAIN_SAVE_RESULTS'],
|
||||||
|
|
||||||
|
runtimeRoot: {
|
||||||
|
globalSymlinks: ['bin', 'browse/dist', 'browse/bin', 'design/dist', 'gstack-upgrade', 'ETHOS.md', 'review/specialists', 'qa/templates', 'qa/references', 'plan-devex-review/dx-hall-of-fame.md'],
|
||||||
|
globalFiles: {
|
||||||
|
'review': ['checklist.md', 'design-checklist.md', 'greptile-triage.md', 'TODOS-format.md'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
install: {
|
||||||
|
prefixable: false,
|
||||||
|
linkingStrategy: 'symlink-generated',
|
||||||
|
},
|
||||||
|
|
||||||
|
learningsMode: 'basic',
|
||||||
|
};
|
||||||
|
|
||||||
|
export default antigravity;
|
||||||
|
|
@ -16,9 +16,10 @@ import cursor from './cursor';
|
||||||
import openclaw from './openclaw';
|
import openclaw from './openclaw';
|
||||||
import hermes from './hermes';
|
import hermes from './hermes';
|
||||||
import gbrain from './gbrain';
|
import gbrain from './gbrain';
|
||||||
|
import antigravity from './antigravity';
|
||||||
|
|
||||||
/** All registered host configs. Add new hosts here. */
|
/** All registered host configs. Add new hosts here. */
|
||||||
export const ALL_HOST_CONFIGS: HostConfig[] = [claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain];
|
export const ALL_HOST_CONFIGS: HostConfig[] = [claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain, antigravity];
|
||||||
|
|
||||||
/** Map from host name to config. */
|
/** Map from host name to config. */
|
||||||
export const HOST_CONFIG_MAP: Record<string, HostConfig> = Object.fromEntries(
|
export const HOST_CONFIG_MAP: Record<string, HostConfig> = Object.fromEntries(
|
||||||
|
|
@ -65,4 +66,4 @@ export function getExternalHosts(): HostConfig[] {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-export individual configs for direct import
|
// Re-export individual configs for direct import
|
||||||
export { claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain };
|
export { claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain, antigravity };
|
||||||
|
|
|
||||||
107
setup
107
setup
|
|
@ -56,7 +56,7 @@ while [ $# -gt 0 ]; do
|
||||||
done
|
done
|
||||||
|
|
||||||
case "$HOST" in
|
case "$HOST" in
|
||||||
claude|codex|kiro|factory|opencode|auto) ;;
|
claude|codex|kiro|factory|opencode|antigravity|auto) ;;
|
||||||
openclaw)
|
openclaw)
|
||||||
echo ""
|
echo ""
|
||||||
echo "OpenClaw integration uses a different model — OpenClaw spawns Claude Code"
|
echo "OpenClaw integration uses a different model — OpenClaw spawns Claude Code"
|
||||||
|
|
@ -91,7 +91,7 @@ case "$HOST" in
|
||||||
echo "GBrain setup and brain skills ship from the GBrain repo."
|
echo "GBrain setup and brain skills ship from the GBrain repo."
|
||||||
echo ""
|
echo ""
|
||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
*) echo "Unknown --host value: $HOST (expected claude, codex, kiro, factory, opencode, openclaw, hermes, gbrain, or auto)" >&2; exit 1 ;;
|
*) echo "Unknown --host value: $HOST (expected claude, codex, kiro, factory, opencode, openclaw, hermes, gbrain, antigravity, or auto)" >&2; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# ─── Resolve skill prefix preference ─────────────────────────
|
# ─── Resolve skill prefix preference ─────────────────────────
|
||||||
|
|
@ -155,14 +155,16 @@ INSTALL_CODEX=0
|
||||||
INSTALL_KIRO=0
|
INSTALL_KIRO=0
|
||||||
INSTALL_FACTORY=0
|
INSTALL_FACTORY=0
|
||||||
INSTALL_OPENCODE=0
|
INSTALL_OPENCODE=0
|
||||||
|
INSTALL_ANTIGRAVITY=0
|
||||||
if [ "$HOST" = "auto" ]; then
|
if [ "$HOST" = "auto" ]; then
|
||||||
command -v claude >/dev/null 2>&1 && INSTALL_CLAUDE=1
|
command -v claude >/dev/null 2>&1 && INSTALL_CLAUDE=1
|
||||||
command -v codex >/dev/null 2>&1 && INSTALL_CODEX=1
|
command -v codex >/dev/null 2>&1 && INSTALL_CODEX=1
|
||||||
command -v kiro-cli >/dev/null 2>&1 && INSTALL_KIRO=1
|
command -v kiro-cli >/dev/null 2>&1 && INSTALL_KIRO=1
|
||||||
command -v droid >/dev/null 2>&1 && INSTALL_FACTORY=1
|
command -v droid >/dev/null 2>&1 && INSTALL_FACTORY=1
|
||||||
command -v opencode >/dev/null 2>&1 && INSTALL_OPENCODE=1
|
command -v opencode >/dev/null 2>&1 && INSTALL_OPENCODE=1
|
||||||
|
command -v antigravity >/dev/null 2>&1 && INSTALL_ANTIGRAVITY=1
|
||||||
# If none found, default to claude
|
# If none found, default to claude
|
||||||
if [ "$INSTALL_CLAUDE" -eq 0 ] && [ "$INSTALL_CODEX" -eq 0 ] && [ "$INSTALL_KIRO" -eq 0 ] && [ "$INSTALL_FACTORY" -eq 0 ] && [ "$INSTALL_OPENCODE" -eq 0 ]; then
|
if [ "$INSTALL_CLAUDE" -eq 0 ] && [ "$INSTALL_CODEX" -eq 0 ] && [ "$INSTALL_KIRO" -eq 0 ] && [ "$INSTALL_FACTORY" -eq 0 ] && [ "$INSTALL_OPENCODE" -eq 0 ] && [ "$INSTALL_ANTIGRAVITY" -eq 0 ]; then
|
||||||
INSTALL_CLAUDE=1
|
INSTALL_CLAUDE=1
|
||||||
fi
|
fi
|
||||||
elif [ "$HOST" = "claude" ]; then
|
elif [ "$HOST" = "claude" ]; then
|
||||||
|
|
@ -175,6 +177,8 @@ elif [ "$HOST" = "factory" ]; then
|
||||||
INSTALL_FACTORY=1
|
INSTALL_FACTORY=1
|
||||||
elif [ "$HOST" = "opencode" ]; then
|
elif [ "$HOST" = "opencode" ]; then
|
||||||
INSTALL_OPENCODE=1
|
INSTALL_OPENCODE=1
|
||||||
|
elif [ "$HOST" = "antigravity" ]; then
|
||||||
|
INSTALL_ANTIGRAVITY=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
migrate_direct_codex_install() {
|
migrate_direct_codex_install() {
|
||||||
|
|
@ -763,6 +767,91 @@ link_opencode_skill_dirs() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create_antigravity_runtime_root() {
|
||||||
|
local gstack_dir="$1"
|
||||||
|
local antigravity_gstack="$2"
|
||||||
|
local antigravity_dir="$gstack_dir/.antigravity/skills"
|
||||||
|
|
||||||
|
if [ -L "$antigravity_gstack" ]; then
|
||||||
|
rm -f "$antigravity_gstack"
|
||||||
|
elif [ -d "$antigravity_gstack" ] && [ "$antigravity_gstack" != "$gstack_dir" ]; then
|
||||||
|
rm -rf "$antigravity_gstack"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$antigravity_gstack" "$antigravity_gstack/browse" "$antigravity_gstack/design" "$antigravity_gstack/gstack-upgrade" "$antigravity_gstack/review" "$antigravity_gstack/qa" "$antigravity_gstack/plan-devex-review"
|
||||||
|
|
||||||
|
if [ -f "$antigravity_dir/gstack/SKILL.md" ]; then
|
||||||
|
ln -snf "$antigravity_dir/gstack/SKILL.md" "$antigravity_gstack/SKILL.md"
|
||||||
|
fi
|
||||||
|
if [ -d "$gstack_dir/bin" ]; then
|
||||||
|
ln -snf "$gstack_dir/bin" "$antigravity_gstack/bin"
|
||||||
|
fi
|
||||||
|
if [ -d "$gstack_dir/browse/dist" ]; then
|
||||||
|
ln -snf "$gstack_dir/browse/dist" "$antigravity_gstack/browse/dist"
|
||||||
|
fi
|
||||||
|
if [ -d "$gstack_dir/browse/bin" ]; then
|
||||||
|
ln -snf "$gstack_dir/browse/bin" "$antigravity_gstack/browse/bin"
|
||||||
|
fi
|
||||||
|
if [ -d "$gstack_dir/design/dist" ]; then
|
||||||
|
ln -snf "$gstack_dir/design/dist" "$antigravity_gstack/design/dist"
|
||||||
|
fi
|
||||||
|
if [ -f "$antigravity_dir/gstack-upgrade/SKILL.md" ]; then
|
||||||
|
ln -snf "$antigravity_dir/gstack-upgrade/SKILL.md" "$antigravity_gstack/gstack-upgrade/SKILL.md"
|
||||||
|
fi
|
||||||
|
for f in checklist.md design-checklist.md greptile-triage.md TODOS-format.md; do
|
||||||
|
if [ -f "$gstack_dir/review/$f" ]; then
|
||||||
|
ln -snf "$gstack_dir/review/$f" "$antigravity_gstack/review/$f"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ -d "$gstack_dir/review/specialists" ]; then
|
||||||
|
ln -snf "$gstack_dir/review/specialists" "$antigravity_gstack/review/specialists"
|
||||||
|
fi
|
||||||
|
if [ -d "$gstack_dir/qa/templates" ]; then
|
||||||
|
ln -snf "$gstack_dir/qa/templates" "$antigravity_gstack/qa/templates"
|
||||||
|
fi
|
||||||
|
if [ -d "$gstack_dir/qa/references" ]; then
|
||||||
|
ln -snf "$gstack_dir/qa/references" "$antigravity_gstack/qa/references"
|
||||||
|
fi
|
||||||
|
if [ -f "$gstack_dir/plan-devex-review/dx-hall-of-fame.md" ]; then
|
||||||
|
ln -snf "$gstack_dir/plan-devex-review/dx-hall-of-fame.md" "$antigravity_gstack/plan-devex-review/dx-hall-of-fame.md"
|
||||||
|
fi
|
||||||
|
if [ -f "$gstack_dir/ETHOS.md" ]; then
|
||||||
|
ln -snf "$gstack_dir/ETHOS.md" "$antigravity_gstack/ETHOS.md"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
link_antigravity_skill_dirs() {
|
||||||
|
local gstack_dir="$1"
|
||||||
|
local skills_dir="$2"
|
||||||
|
local antigravity_dir="$gstack_dir/.antigravity/skills"
|
||||||
|
local linked=()
|
||||||
|
|
||||||
|
if [ ! -d "$antigravity_dir" ]; then
|
||||||
|
echo " Generating .antigravity/ skill docs..."
|
||||||
|
( cd "$gstack_dir" && bun run gen:skill-docs --host antigravity )
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "$antigravity_dir" ]; then
|
||||||
|
echo " warning: .antigravity/skills/ generation failed — run 'bun run gen:skill-docs --host antigravity' manually" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for skill_dir in "$antigravity_dir"/gstack*/; do
|
||||||
|
if [ -f "$skill_dir/SKILL.md" ]; then
|
||||||
|
skill_name="$(basename "$skill_dir")"
|
||||||
|
[ "$skill_name" = "gstack" ] && continue
|
||||||
|
target="$skills_dir/$skill_name"
|
||||||
|
if [ -L "$target" ] || [ ! -e "$target" ]; then
|
||||||
|
ln -snf "$skill_dir" "$target"
|
||||||
|
linked+=("$skill_name")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ ${#linked[@]} -gt 0 ]; then
|
||||||
|
echo " linked skills: ${linked[*]}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# 4. Install for Claude (default)
|
# 4. Install for Claude (default)
|
||||||
SKILLS_BASENAME="$(basename "$INSTALL_SKILLS_DIR")"
|
SKILLS_BASENAME="$(basename "$INSTALL_SKILLS_DIR")"
|
||||||
SKILLS_PARENT_BASENAME="$(basename "$(dirname "$INSTALL_SKILLS_DIR")")"
|
SKILLS_PARENT_BASENAME="$(basename "$(dirname "$INSTALL_SKILLS_DIR")")"
|
||||||
|
|
@ -968,6 +1057,18 @@ if [ "$INSTALL_OPENCODE" -eq 1 ]; then
|
||||||
echo " opencode skills: $OPENCODE_SKILLS"
|
echo " opencode skills: $OPENCODE_SKILLS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 6d. Install for Antigravity
|
||||||
|
if [ "$INSTALL_ANTIGRAVITY" -eq 1 ]; then
|
||||||
|
ANTIGRAVITY_SKILLS="$HOME/.config/antigravity/skills"
|
||||||
|
ANTIGRAVITY_GSTACK="$ANTIGRAVITY_SKILLS/gstack"
|
||||||
|
mkdir -p "$ANTIGRAVITY_SKILLS"
|
||||||
|
create_antigravity_runtime_root "$SOURCE_GSTACK_DIR" "$ANTIGRAVITY_GSTACK"
|
||||||
|
link_antigravity_skill_dirs "$SOURCE_GSTACK_DIR" "$ANTIGRAVITY_SKILLS"
|
||||||
|
echo "gstack ready (antigravity)."
|
||||||
|
echo " browse: $BROWSE_BIN"
|
||||||
|
echo " antigravity skills: $ANTIGRAVITY_SKILLS"
|
||||||
|
fi
|
||||||
|
|
||||||
# 7. Create .agents/ sidecar symlinks for the real Codex skill target.
|
# 7. Create .agents/ sidecar symlinks for the real Codex skill target.
|
||||||
# The root Codex skill ends up pointing at $SOURCE_GSTACK_DIR/.agents/skills/gstack,
|
# The root Codex skill ends up pointing at $SOURCE_GSTACK_DIR/.agents/skills/gstack,
|
||||||
# so the runtime assets must live there for both global and repo-local installs.
|
# so the runtime assets must live there for both global and repo-local installs.
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import {
|
||||||
slate,
|
slate,
|
||||||
cursor,
|
cursor,
|
||||||
openclaw,
|
openclaw,
|
||||||
|
antigravity,
|
||||||
} from '../hosts/index';
|
} from '../hosts/index';
|
||||||
import { HOST_PATHS } from '../scripts/resolvers/types';
|
import { HOST_PATHS } from '../scripts/resolvers/types';
|
||||||
|
|
||||||
|
|
@ -30,8 +31,8 @@ const ROOT = path.resolve(import.meta.dir, '..');
|
||||||
// ─── hosts/index.ts ─────────────────────────────────────────
|
// ─── hosts/index.ts ─────────────────────────────────────────
|
||||||
|
|
||||||
describe('hosts/index.ts', () => {
|
describe('hosts/index.ts', () => {
|
||||||
test('ALL_HOST_CONFIGS has 10 hosts', () => {
|
test('ALL_HOST_CONFIGS has 11 hosts', () => {
|
||||||
expect(ALL_HOST_CONFIGS.length).toBe(10);
|
expect(ALL_HOST_CONFIGS.length).toBe(11);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('ALL_HOST_NAMES matches config names', () => {
|
test('ALL_HOST_NAMES matches config names', () => {
|
||||||
|
|
@ -53,6 +54,7 @@ describe('hosts/index.ts', () => {
|
||||||
expect(slate.name).toBe('slate');
|
expect(slate.name).toBe('slate');
|
||||||
expect(cursor.name).toBe('cursor');
|
expect(cursor.name).toBe('cursor');
|
||||||
expect(openclaw.name).toBe('openclaw');
|
expect(openclaw.name).toBe('openclaw');
|
||||||
|
expect(antigravity.name).toBe('antigravity');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('getHostConfig returns correct config', () => {
|
test('getHostConfig returns correct config', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue