@aident-ai/cli 0.1.5 → 0.1.6-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +31 -11
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -560,7 +560,7 @@ function normalizeBaseUrl(url) {
|
|
|
560
560
|
}
|
|
561
561
|
|
|
562
562
|
// src/version.ts
|
|
563
|
-
var VERSION = "0.1.
|
|
563
|
+
var VERSION = "0.1.6-rc.0";
|
|
564
564
|
|
|
565
565
|
// src/catalogCache.ts
|
|
566
566
|
var CACHE_TTL_MS = 5 * 60 * 1000;
|
|
@@ -643,7 +643,9 @@ function getLoadoutSkillTargets(cwd = process.cwd(), home = homedir2(), env = pr
|
|
|
643
643
|
add("claude-code" /* ClaudeCode */, "project" /* Project */, join3(root, ".claude"));
|
|
644
644
|
add("cursor" /* Cursor */, "project" /* Project */, join3(root, ".cursor"));
|
|
645
645
|
add("gemini" /* Gemini */, "project" /* Project */, join3(root, ".gemini"));
|
|
646
|
-
|
|
646
|
+
for (const workBuddyRoot of getWorkBuddySkillHostRoots(root, {})) {
|
|
647
|
+
add("workbuddy" /* WorkBuddy */, "project" /* Project */, workBuddyRoot);
|
|
648
|
+
}
|
|
647
649
|
}
|
|
648
650
|
for (const root of getConfiguredLoadoutSkillHostRoots(home, env, repositoryRoot)) {
|
|
649
651
|
add(root.agent, root.scope, root.root, root.canonical, root.prefer);
|
|
@@ -659,6 +661,17 @@ function getGlobalLoadoutSkillHostRoots(home = homedir2(), env = process.env) {
|
|
|
659
661
|
function getManagedLoadoutSkillReleasesRoot(home = homedir2()) {
|
|
660
662
|
return join3(home, ".aident", "skills", "aident-skill", "releases");
|
|
661
663
|
}
|
|
664
|
+
function getWorkBuddySkillHostRoots(home = homedir2(), env = process.env) {
|
|
665
|
+
const defaultRoot = join3(home, ".workbuddy");
|
|
666
|
+
const configuredRoot = resolveConfiguredRoot(env.WORKBUDDY_CONFIG_DIR, defaultRoot);
|
|
667
|
+
return [...new Set([configuredRoot, defaultRoot, join3(home, ".workbuddy-ai")])];
|
|
668
|
+
}
|
|
669
|
+
function getDetectedWorkBuddySkillHostRoots(home = homedir2(), env = process.env) {
|
|
670
|
+
const configured = env.WORKBUDDY_CONFIG_DIR?.trim();
|
|
671
|
+
const configuredRoot = configured && isAbsolute(configured) ? resolve(configured) : undefined;
|
|
672
|
+
const detectedRoots = getWorkBuddySkillHostRoots(home, env).filter((root) => root === configuredRoot || existsSync(root));
|
|
673
|
+
return detectedRoots.length > 0 ? detectedRoots : [join3(home, ".workbuddy")];
|
|
674
|
+
}
|
|
662
675
|
function formatLoadoutAgentHost(agent) {
|
|
663
676
|
switch (agent) {
|
|
664
677
|
case "claude-code" /* ClaudeCode */:
|
|
@@ -737,13 +750,13 @@ function getConfiguredLoadoutSkillHostRoots(home, env, repositoryRoot) {
|
|
|
737
750
|
canonical: false,
|
|
738
751
|
prefer: true
|
|
739
752
|
},
|
|
740
|
-
{
|
|
753
|
+
...getWorkBuddySkillHostRoots(home, env).map((root) => ({
|
|
741
754
|
agent: "workbuddy" /* WorkBuddy */,
|
|
742
|
-
scope:
|
|
743
|
-
root
|
|
755
|
+
scope: getConfiguredScope(root, repositoryRoot),
|
|
756
|
+
root,
|
|
744
757
|
canonical: false,
|
|
745
|
-
prefer:
|
|
746
|
-
},
|
|
758
|
+
prefer: root === join3(home, ".workbuddy") || root === join3(home, ".workbuddy-ai")
|
|
759
|
+
})),
|
|
747
760
|
{
|
|
748
761
|
agent: "codex" /* Codex */,
|
|
749
762
|
scope: "admin" /* Admin */,
|
|
@@ -6637,8 +6650,12 @@ function getHome() {
|
|
|
6637
6650
|
function getCanonicalRoot(home, env) {
|
|
6638
6651
|
return path.join(getGlobalLoadoutSkillHostRoots(home, env).find(({ canonical }) => canonical).root, "skills");
|
|
6639
6652
|
}
|
|
6653
|
+
function getHarnessHosts(home, env) {
|
|
6654
|
+
return getGlobalLoadoutSkillHostRoots(home, env).filter(({ canonical }) => !canonical);
|
|
6655
|
+
}
|
|
6640
6656
|
function getHarnessRoots(home, env) {
|
|
6641
|
-
|
|
6657
|
+
const detectedWorkBuddyRoots = new Set(getDetectedWorkBuddySkillHostRoots(home, env));
|
|
6658
|
+
return getHarnessHosts(home, env).filter(({ agent, root }) => agent !== "workbuddy" /* WorkBuddy */ || detectedWorkBuddyRoots.has(root)).map(({ root }) => path.join(root, "skills"));
|
|
6642
6659
|
}
|
|
6643
6660
|
function getManifestPath(home) {
|
|
6644
6661
|
return path.join(home, ".aident", "favorite-skills.json");
|
|
@@ -6717,7 +6734,7 @@ async function readManifest(home, env) {
|
|
|
6717
6734
|
const value = JSON.parse(await readFile7(getManifestPath(home), "utf8"));
|
|
6718
6735
|
if (value.version !== MANIFEST_VERSION || !Array.isArray(value.skills))
|
|
6719
6736
|
throw new Error("Unsupported manifest");
|
|
6720
|
-
const harnessRoots = new Set(
|
|
6737
|
+
const harnessRoots = new Set(getHarnessHosts(home, env).map(({ root }) => path.join(root, "skills")));
|
|
6721
6738
|
for (const skill of value.skills) {
|
|
6722
6739
|
if (!LOADOUT_SKILL_NAME_PATTERN.test(skill.name) || !isCanonicalUuid(skill.artifactVersionId) || !/^loadout-[a-z0-9-]+-[0-9a-f]{8}$/.test(skill.commandName) || skill.installPath !== path.join(getCanonicalRoot(home, env), skill.commandName) || skill.linkPaths.some((linkPath) => !harnessRoots.has(path.dirname(linkPath)) || path.basename(linkPath) !== skill.commandName)) {
|
|
6723
6740
|
throw new Error("Invalid favorite Skills ownership manifest");
|
|
@@ -6805,7 +6822,7 @@ async function reconcileLoadoutFavoriteSkills(payload, home = getHome(), env = p
|
|
|
6805
6822
|
continue;
|
|
6806
6823
|
}
|
|
6807
6824
|
const allLinksExist = (await Promise.all(linkPaths.map(pathExists))).every(Boolean);
|
|
6808
|
-
if (previous?.artifactVersionId === pkg.artifactVersionId && previous.installPath === installPath && await pathExists(installPath) && allLinksExist) {
|
|
6825
|
+
if (previous?.artifactVersionId === pkg.artifactVersionId && previous.installPath === installPath && previous.linkPaths.length === linkPaths.length && previous.linkPaths.every((linkPath) => linkPaths.includes(linkPath)) && await pathExists(installPath) && allLinksExist) {
|
|
6809
6826
|
result.unchanged.push(pkg.name);
|
|
6810
6827
|
nextSkills.push(previous);
|
|
6811
6828
|
continue;
|
|
@@ -7748,6 +7765,7 @@ async function reconcileLoadoutSkill(policyValue, options = {}, injected = {}) {
|
|
|
7748
7765
|
const cwd = options.cwd ?? process.cwd();
|
|
7749
7766
|
const env = options.env ?? process.env;
|
|
7750
7767
|
const targets = getLoadoutSkillTargets(cwd, home, env);
|
|
7768
|
+
const detectedWorkBuddyRoots = new Set(getDetectedWorkBuddySkillHostRoots(home, env).map((root) => resolve2(root)));
|
|
7751
7769
|
const canonicalTarget = targets.find((target) => target.canonical);
|
|
7752
7770
|
if (!canonicalTarget)
|
|
7753
7771
|
throw new Error("Aident canonical global skill target is unavailable");
|
|
@@ -7790,7 +7808,9 @@ async function reconcileLoadoutSkill(policyValue, options = {}, injected = {}) {
|
|
|
7790
7808
|
getPathPresence(target.skillDirectory)
|
|
7791
7809
|
]);
|
|
7792
7810
|
if (hostPresence === "missing" /* Missing */ && skillPresence2 === "missing" /* Missing */) {
|
|
7793
|
-
|
|
7811
|
+
if (target.candidate.agent !== "workbuddy" /* WorkBuddy */ || !detectedWorkBuddyRoots.has(resolve2(target.hostRoot))) {
|
|
7812
|
+
continue;
|
|
7813
|
+
}
|
|
7794
7814
|
}
|
|
7795
7815
|
if (hostPresence === "unreadable" /* Unreadable */ || skillPresence2 === "unreadable" /* Unreadable */) {
|
|
7796
7816
|
results.push(unreadableTargetResult(target));
|
package/package.json
CHANGED