feat(01-03): implement Kimi paths layout and local guard

- Resolve Kimi global skills under the generic agents path
- Add empty Kimi layout placeholder and local install no-op guard
- Keep selection/path tests aligned without Kimi skill conversion
This commit is contained in:
Viktorplus
2026-06-06 13:17:56 +02:00
parent 0d456d4bb0
commit 58626283b2
6 changed files with 122 additions and 68 deletions

View File

@@ -167,7 +167,7 @@ function findAgentsSourceRoot(runtimeConfigDir?: string): string {
const ALLOWED_RUNTIMES = new Set([
'claude', 'cursor', 'gemini', 'codex', 'copilot', 'antigravity',
'windsurf', 'augment', 'trae', 'qwen', 'hermes', 'codebuddy',
'cline', 'opencode', 'kilo',
'cline', 'kimi', 'opencode', 'kilo',
]);
// ---------------------------------------------------------------------------
@@ -304,6 +304,12 @@ function resolveRuntimeArtifactLayout(runtime: string, configDir: string, scope:
kinds = [];
break;
case 'kimi':
// Phase 1 skeleton only: Kimi is recognized by the layout seam, but
// SKILL.md conversion and local project semantics are deferred.
kinds = [];
break;
case 'opencode':
kinds = [commandsKind('command', 'gsd-', configDir)];
break;

View File

@@ -14,6 +14,9 @@
* cline — Rules-based; commands are embedded in .clinerules. Cline does
* not use a skills/ directory. getGlobalSkillDir() returns null
* for cline so the caller can emit an appropriate warning.
* kimi — Agent Skills are discovered from the generic agents root:
* ~/.config/agents/skills. ~/.kimi/skills is compatible with
* Kimi CLI, but is not GSD's canonical Phase 1 install target.
*/
import os from 'node:os';
@@ -125,6 +128,13 @@ export function getGlobalConfigDir(runtime: string): string {
case 'cline':
return env['CLINE_CONFIG_DIR'] ? expandTilde(env['CLINE_CONFIG_DIR']) : path.join(home, '.cline');
// ── Kimi CLI (generic agents XDG root) ─────────────────────────────────
case 'kimi': {
if (env['KIMI_CONFIG_DIR']) return expandTilde(env['KIMI_CONFIG_DIR']);
if (env['XDG_CONFIG_HOME']) return path.join(expandTilde(env['XDG_CONFIG_HOME']), 'agents');
return path.join(home, '.config', 'agents');
}
// ── OpenCode (XDG) ───────────────────────────────────────────────────────
case 'opencode': {
if (env['OPENCODE_CONFIG_DIR']) return expandTilde(env['OPENCODE_CONFIG_DIR']);