Add multi-host skill bridge for WorkBuddy, Claude, and Qoder

Decouple agent host skill bridging into dedicated module src/core/agent-hosts/:
- antigravity.ts: manage ~/.gemini/config/skills.json
- symlink-hosts.ts: detect and bridge ~/.workbuddy, ~/.claude, and ~/.qoder
- types.ts: explicit types for host results and statuses
- agent-hosts.test.ts: isolated unit tests for host discovery and symlinks

Respect existing parent symlinks, replace legacy real directories safely,
prevent dotfile pollution by only acting when host roots exist, and
expose unified hosts array in seal-use skill install & status.
This commit is contained in:
gitea committed 2026-09-18 22:20:18 +08:00
1 parent ee4cb332d9
commit fb673f754e
8 files changed
+785 -254

No files matched your search

+12 -4
View File
@@ -1,11 +1,15 @@
import { existsSync } from "node:fs";
import { join } from "node:path";
import {
getAllLinkableHostsStatus,
getAntigravitySkillsStatus,
syncAllLinkableHosts,
syncAntigravitySkillsConfig
} from "../../core/agent-hosts/index.js";
import {
getDefaultGlobalSkillDir,
getSkillContent,
installSkillFiles,
syncAntigravitySkillsConfig
installSkillFiles
} from "../../core/embedded-skill.js";
import { booleanOption, stringOption } from "../parser.js";
import { printJson } from "../printer.js";
@@ -29,13 +33,15 @@ export function handleSkillCommand(action: string | undefined, maybeName: string
const result = installSkillFiles(targetDir);
const isGlobal = !isLocal && !customDir;
const antigravity = isGlobal ? syncAntigravitySkillsConfig() : undefined;
const hosts = isGlobal ? syncAllLinkableHosts() : undefined;
printJson({
installed: true,
targetDir: result.targetDir,
fileCount: result.files.length,
files: result.files,
...(antigravity ? { antigravity } : {})
...(antigravity ? { antigravity } : {}),
...(hosts ? { hosts } : {})
});
return;
}
@@ -44,6 +50,7 @@ export function handleSkillCommand(action: string | undefined, maybeName: string
const globalDir = getDefaultGlobalSkillDir();
const localDir = join(process.cwd(), ".agents", "skills", "seal-use");
const antigravity = getAntigravitySkillsStatus();
const hosts = getAllLinkableHostsStatus();
printJson({
global: {
dir: globalDir,
@@ -53,7 +60,8 @@ export function handleSkillCommand(action: string | undefined, maybeName: string
dir: localDir,
installed: existsSync(join(localDir, "SKILL.md"))
},
antigravity
antigravity,
hosts
});
return;
}