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.
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
export * from "./types.js";
|
|
export * from "./antigravity.js";
|
|
export * from "./symlink-hosts.js";
|
|
|
|
import {
|
|
getAntigravitySkillsStatus,
|
|
syncAntigravitySkillsConfig
|
|
} from "./antigravity.js";
|
|
import {
|
|
getAllLinkableHostsStatus,
|
|
syncAllLinkableHosts
|
|
} from "./symlink-hosts.js";
|
|
import type { AllAgentHostsStatus, AllAgentHostsSyncResult } from "./types.js";
|
|
|
|
export function syncAllAgentHosts(options?: {
|
|
baseHomeDir?: string;
|
|
sourceSkillDir?: string;
|
|
antigravityConfigFile?: string;
|
|
}): AllAgentHostsSyncResult {
|
|
const antigravity = syncAntigravitySkillsConfig({
|
|
configFile: options?.antigravityConfigFile,
|
|
targetSkillsDir: options?.sourceSkillDir
|
|
? undefined
|
|
: undefined
|
|
});
|
|
const hosts = syncAllLinkableHosts(options);
|
|
|
|
return {
|
|
antigravity,
|
|
hosts
|
|
};
|
|
}
|
|
|
|
export function getAllAgentHostsStatus(options?: {
|
|
baseHomeDir?: string;
|
|
sourceSkillDir?: string;
|
|
antigravityConfigFile?: string;
|
|
}): AllAgentHostsStatus {
|
|
const antigravity = getAntigravitySkillsStatus({
|
|
configFile: options?.antigravityConfigFile
|
|
});
|
|
const hosts = getAllLinkableHostsStatus(options);
|
|
|
|
return {
|
|
antigravity,
|
|
hosts
|
|
};
|
|
}
|