mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-11 07:29:00 +02:00
refactor(hosts): defineHost() factory — 10 copy-paste host files become declarations
hosts/*.ts were ten copies of one file: runtimeRoot byte-identical in 9/10, pathRewrites mechanically derivable from the host name for 7/10, the 11-entry toolRewrites map byte-identical between openclaw and gbrain, and every asset change a 10-file edit (cursor and slate had already fallen out of three other hand-maintained lists). defineHost() owns the defaults; each host file now declares only what makes it different (slate/cursor: 8 lines each). Shared constants: CROSS_MODEL_RESOLVERS, GBRAIN_RESOLVERS, EXEC_STYLE_TOOL_REWRITES. Genuinely-different things stayed explicit: codex/factory $GSTACK_ROOT rewrites, hermes's tool vocabulary, claude's denylist+prefixable install, opencode's wider runtimeRoot. Proof: JSON.stringify(ALL_HOST_CONFIGS) dump-diff before/after EMPTY (and a runtime walk confirmed no function-valued or undefined-keyed fields, so the JSON diff is complete); gen:skill-docs --host all zero-diff; host-config + gen-skill-docs + idempotency suites 485/485. Host files 595 -> 285 lines. docs/ADDING_A_HOST.md teaches the factory pattern. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
7c309f7817
commit
408ee77cde
+7
-40
@@ -1,50 +1,17 @@
|
||||
import type { HostConfig } from '../scripts/host-config';
|
||||
import { defineHost } from './define-host';
|
||||
|
||||
const kiro: HostConfig = {
|
||||
const kiro = defineHost({
|
||||
name: 'kiro',
|
||||
displayName: 'Kiro',
|
||||
cliCommand: 'kiro-cli',
|
||||
cliAliases: [],
|
||||
|
||||
globalRoot: '.kiro/skills/gstack',
|
||||
localSkillRoot: '.kiro/skills/gstack',
|
||||
hostSubdir: '.kiro',
|
||||
usesEnvVars: true,
|
||||
|
||||
frontmatter: {
|
||||
mode: 'allowlist',
|
||||
keepFields: ['name', 'description'],
|
||||
descriptionLimit: null,
|
||||
},
|
||||
|
||||
generation: {
|
||||
generateMetadata: false,
|
||||
skipSkills: ['codex'], // Codex skill is a Claude wrapper around codex exec
|
||||
},
|
||||
|
||||
pathRewrites: [
|
||||
{ from: '~/.claude/skills/gstack', to: '~/.kiro/skills/gstack' },
|
||||
{ from: '.claude/skills/gstack', to: '.kiro/skills/gstack' },
|
||||
{ from: '.claude/skills', to: '.kiro/skills' },
|
||||
// Beyond the standard .claude/* trio, Kiro also cleans up codex-style paths:
|
||||
// template prose that references ~/.codex/skills/gstack or .codex/skills
|
||||
// (e.g. cross-host examples) must land on Kiro's own paths.
|
||||
extraPathRewrites: [
|
||||
{ from: '~/.codex/skills/gstack', to: '~/.kiro/skills/gstack' },
|
||||
{ from: '.codex/skills', to: '.kiro/skills' },
|
||||
],
|
||||
|
||||
suppressedResolvers: ['GBRAIN_CONTEXT_LOAD', 'GBRAIN_SAVE_RESULTS'],
|
||||
|
||||
runtimeRoot: {
|
||||
globalSymlinks: ['bin', 'browse/dist', 'browse/bin', 'gstack-upgrade', 'ETHOS.md'],
|
||||
globalFiles: {
|
||||
'review': ['checklist.md', 'TODOS-format.md'],
|
||||
},
|
||||
},
|
||||
|
||||
install: {
|
||||
prefixable: false,
|
||||
linkingStrategy: 'symlink-generated',
|
||||
},
|
||||
|
||||
learningsMode: 'basic',
|
||||
};
|
||||
});
|
||||
|
||||
export default kiro;
|
||||
|
||||
Reference in New Issue
Block a user