mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-06 13:45:35 +02:00
fix: add opencode setup support
This commit is contained in:
@@ -2115,15 +2115,16 @@ describe('setup script validation', () => {
|
||||
expect(fnBody).toContain('rm -f "$target"');
|
||||
});
|
||||
|
||||
test('setup supports --host auto|claude|codex|kiro', () => {
|
||||
test('setup supports --host auto|claude|codex|kiro|opencode', () => {
|
||||
expect(setupContent).toContain('--host');
|
||||
expect(setupContent).toContain('claude|codex|kiro|factory|auto');
|
||||
expect(setupContent).toContain('claude|codex|kiro|factory|opencode|auto');
|
||||
});
|
||||
|
||||
test('auto mode detects claude, codex, and kiro binaries', () => {
|
||||
test('auto mode detects claude, codex, kiro, and opencode binaries', () => {
|
||||
expect(setupContent).toContain('command -v claude');
|
||||
expect(setupContent).toContain('command -v codex');
|
||||
expect(setupContent).toContain('command -v kiro-cli');
|
||||
expect(setupContent).toContain('command -v opencode');
|
||||
});
|
||||
|
||||
// T1: Sidecar skip guard — prevents .agents/skills/gstack from being linked as a skill
|
||||
@@ -2143,7 +2144,6 @@ describe('setup script validation', () => {
|
||||
expect(content).toContain('$GSTACK_BIN/');
|
||||
});
|
||||
|
||||
// T3: Kiro host support in setup script
|
||||
test('setup supports --host kiro with install section and sed rewrites', () => {
|
||||
expect(setupContent).toContain('INSTALL_KIRO=');
|
||||
expect(setupContent).toContain('kiro-cli');
|
||||
@@ -2151,6 +2151,21 @@ describe('setup script validation', () => {
|
||||
expect(setupContent).toContain('~/.kiro/skills/gstack');
|
||||
});
|
||||
|
||||
test('setup supports --host opencode with install section and OpenCode skill path vars', () => {
|
||||
expect(setupContent).toContain('INSTALL_OPENCODE=');
|
||||
expect(setupContent).toContain('OPENCODE_SKILLS="$HOME/.config/opencode/skills"');
|
||||
expect(setupContent).toContain('OPENCODE_GSTACK="$OPENCODE_SKILLS/gstack"');
|
||||
});
|
||||
|
||||
test('setup installs OpenCode skills into a nested gstack runtime root', () => {
|
||||
expect(setupContent).toContain('create_opencode_runtime_root');
|
||||
expect(setupContent).toContain('.opencode/skills');
|
||||
expect(setupContent).toContain('review/specialists');
|
||||
expect(setupContent).toContain('qa/templates');
|
||||
expect(setupContent).toContain('qa/references');
|
||||
expect(setupContent).toContain('dx-hall-of-fame.md');
|
||||
});
|
||||
|
||||
test('create_agents_sidecar links runtime assets', () => {
|
||||
// Sidecar must link bin, browse, review, qa
|
||||
const fnStart = setupContent.indexOf('create_agents_sidecar()');
|
||||
|
||||
@@ -354,6 +354,21 @@ describe('host-config-export.ts CLI', () => {
|
||||
expect(lines).toContain('review/checklist.md');
|
||||
});
|
||||
|
||||
test('opencode symlinks returns nested runtime assets', () => {
|
||||
const { stdout, exitCode } = run('symlinks', 'opencode');
|
||||
expect(exitCode).toBe(0);
|
||||
const lines = stdout.split('\n');
|
||||
expect(lines).toContain('bin');
|
||||
expect(lines).toContain('browse/dist');
|
||||
expect(lines).toContain('browse/bin');
|
||||
expect(lines).toContain('review/design-checklist.md');
|
||||
expect(lines).toContain('review/greptile-triage.md');
|
||||
expect(lines).toContain('review/specialists');
|
||||
expect(lines).toContain('qa/templates');
|
||||
expect(lines).toContain('qa/references');
|
||||
expect(lines).toContain('plan-devex-review/dx-hall-of-fame.md');
|
||||
});
|
||||
|
||||
test('symlinks with missing host exits 1', () => {
|
||||
const { exitCode } = run('symlinks');
|
||||
expect(exitCode).toBe(1);
|
||||
|
||||
Reference in New Issue
Block a user