@callmeradical/augy 0.1.0 → 0.3.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/README.md +105 -33
- package/dist/bundle-L4LMJLKN.js +49 -0
- package/dist/{chunk-YXCEZ3EY.js → chunk-HZSFPII7.js} +2 -2
- package/dist/{chunk-ZW6ZKHTF.js → chunk-JM4VVAHN.js} +9 -1
- package/dist/{chunk-UJX6VJ3S.js → chunk-RBF4Q6N4.js} +1 -1
- package/dist/chunk-V5GA2ZHU.js +65 -0
- package/dist/{chunk-PX2LVUHV.js → chunk-Z4R7NYGP.js} +2 -2
- package/dist/{diff-KYSWUXMH.js → diff-JQ5L3GEO.js} +5 -5
- package/dist/home-TWK3PMCL.js +205 -0
- package/dist/index.js +40 -15
- package/dist/{info-7BO4LXXS.js → info-2AD4VEXX.js} +5 -5
- package/dist/{install-FPAGHWX2.js → install-7ZWHGCFN.js} +12 -11
- package/dist/{list-UJX2MYXK.js → list-FTEIYHCK.js} +2 -2
- package/dist/{registry-QVCNZXBZ.js → registry-2B52E3ME.js} +5 -1
- package/dist/{rollback-WAZV5HNG.js → rollback-NSDZL7WA.js} +7 -7
- package/dist/{scan-DKN7YBT5.js → scan-CC4IYZ35.js} +5 -5
- package/dist/{search-2V2U23KC.js → search-Y3ID5H4Z.js} +3 -3
- package/dist/{set-source-TITL27N3.js → set-source-GRYHJOX6.js} +2 -2
- package/dist/sync-QQFXUXCN.js +189 -0
- package/dist/{tap-3RD3XZ56.js → tap-OWJLWLKR.js} +3 -3
- package/dist/{uninstall-3C3XZZEC.js → uninstall-EYLNWP2L.js} +2 -2
- package/dist/{update-A3PSROUK.js → update-VEXE6ZKZ.js} +6 -6
- package/dist/{versions-OMI6OFJC.js → versions-BGGRVKJ2.js} +2 -2
- package/package.json +7 -3
- package/dist/chunk-R2TJ3UDO.js +0 -43
- /package/dist/{chunk-EU54UQ4C.js → chunk-2E5SVRSR.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -10,58 +10,66 @@ var pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf8")
|
|
|
10
10
|
var program = new Command();
|
|
11
11
|
program.name("augy").description("Homebrew for AI agent skills \u2014 install, version, update, rollback").version(pkg.version);
|
|
12
12
|
program.command("install [url]").description("Install skills from a GitHub URL or owner/repo[/path]").option("-a, --agent <agents...>", "Target agent(s): opencode, claude, codex").action(async (url, opts) => {
|
|
13
|
-
const { installCommand } = await import("./install-
|
|
13
|
+
const { installCommand } = await import("./install-7ZWHGCFN.js");
|
|
14
14
|
await installCommand(url, opts ?? {});
|
|
15
15
|
});
|
|
16
16
|
program.command("update [skill]").description("Check for upstream changes and upgrade installed skills").action(async (skill) => {
|
|
17
|
-
const { updateCommand } = await import("./update-
|
|
17
|
+
const { updateCommand } = await import("./update-VEXE6ZKZ.js");
|
|
18
18
|
await updateCommand(skill);
|
|
19
19
|
});
|
|
20
20
|
program.command("list").description("Show all installed skills with version + agent info").option("--json", "Output raw JSON registry").action(async (opts) => {
|
|
21
|
-
const { listCommand } = await import("./list-
|
|
21
|
+
const { listCommand } = await import("./list-FTEIYHCK.js");
|
|
22
22
|
await listCommand(opts ?? {});
|
|
23
23
|
});
|
|
24
24
|
program.command("diff <skill> [sha1] [sha2]").description(
|
|
25
25
|
"Browse file-level diffs for a skill\n augy diff <skill> installed \u2194 upstream HEAD\n augy diff <skill> <sha> installed \u2194 specific SHA (archive or GitHub)\n augy diff <skill> <sha1> <sha2> two local archives side-by-side"
|
|
26
26
|
).action(async (skill, sha1, sha2) => {
|
|
27
|
-
const { diffCommand } = await import("./diff-
|
|
27
|
+
const { diffCommand } = await import("./diff-JQ5L3GEO.js");
|
|
28
28
|
await diffCommand(skill, sha1, sha2);
|
|
29
29
|
});
|
|
30
|
+
program.command("bundle").description("Write an augy.json manifest from installed skills for team sharing").option("-o, --output <path>", "Output path (default: ./augy.json)").option("--include-untracked", "Include skills without a known source").action(async (opts) => {
|
|
31
|
+
const { bundleCommand } = await import("./bundle-L4LMJLKN.js");
|
|
32
|
+
await bundleCommand(opts);
|
|
33
|
+
});
|
|
34
|
+
program.command("sync [path]").description("Install/update skills from an augy.json manifest (default: ./augy.json)").option("--dry-run", "Preview changes without applying them").option("-a, --agent <agents...>", "Target agent(s) (default: all detected)").action(async (path, opts) => {
|
|
35
|
+
const { syncCommand } = await import("./sync-QQFXUXCN.js");
|
|
36
|
+
await syncCommand(path, opts ?? {});
|
|
37
|
+
});
|
|
30
38
|
program.command("scan").description("Find skills installed outside augy and optionally import them into the registry").action(async () => {
|
|
31
|
-
const { scanCommand } = await import("./scan-
|
|
39
|
+
const { scanCommand } = await import("./scan-CC4IYZ35.js");
|
|
32
40
|
await scanCommand();
|
|
33
41
|
});
|
|
34
42
|
program.command("info <skill>").description("Show full metadata, version history, and description for an installed skill").action(async (skill) => {
|
|
35
|
-
const { infoCommand } = await import("./info-
|
|
43
|
+
const { infoCommand } = await import("./info-2AD4VEXX.js");
|
|
36
44
|
await infoCommand(skill);
|
|
37
45
|
});
|
|
38
46
|
program.command("search [query]").description("Search all taps for available skills (optionally filter by name)").action(async (query) => {
|
|
39
|
-
const { searchCommand } = await import("./search-
|
|
47
|
+
const { searchCommand } = await import("./search-Y3ID5H4Z.js");
|
|
40
48
|
await searchCommand(query);
|
|
41
49
|
});
|
|
42
50
|
var tap = program.command("tap").description("Manage trusted repos (taps) for skill name resolution");
|
|
43
51
|
tap.command("add <repo>").description("Register a tap e.g. augy tap add owner/repo").option("--path <skills-dir>", "Subdirectory where skills live (default: skills)").option("--description <text>", "Optional description").action(async (repo, opts) => {
|
|
44
|
-
const { tapAddCommand } = await import("./tap-
|
|
52
|
+
const { tapAddCommand } = await import("./tap-OWJLWLKR.js");
|
|
45
53
|
await tapAddCommand(repo, opts);
|
|
46
54
|
});
|
|
47
55
|
tap.command("remove <repo>").description("Unregister a tap").action(async (repo) => {
|
|
48
|
-
const { tapRemoveCommand } = await import("./tap-
|
|
56
|
+
const { tapRemoveCommand } = await import("./tap-OWJLWLKR.js");
|
|
49
57
|
await tapRemoveCommand(repo);
|
|
50
58
|
});
|
|
51
59
|
tap.command("list").description("List all registered taps").action(async () => {
|
|
52
|
-
const { tapListCommand } = await import("./tap-
|
|
60
|
+
const { tapListCommand } = await import("./tap-OWJLWLKR.js");
|
|
53
61
|
await tapListCommand();
|
|
54
62
|
});
|
|
55
63
|
program.command("set-source <skill> <url>").description("Attach a GitHub source URL to a skill imported without one").action(async (skill, url) => {
|
|
56
|
-
const { setSourceCommand } = await import("./set-source-
|
|
64
|
+
const { setSourceCommand } = await import("./set-source-GRYHJOX6.js");
|
|
57
65
|
await setSourceCommand(skill, url);
|
|
58
66
|
});
|
|
59
67
|
program.command("uninstall <skill>").description("Remove a skill from all agent paths and the registry").action(async (skill) => {
|
|
60
|
-
const { uninstallCommand } = await import("./uninstall-
|
|
68
|
+
const { uninstallCommand } = await import("./uninstall-EYLNWP2L.js");
|
|
61
69
|
await uninstallCommand(skill);
|
|
62
70
|
});
|
|
63
71
|
program.command("rollback <skill> [sha]").description("Restore a skill to a previous archived version").action(async (skill, sha) => {
|
|
64
|
-
const { rollbackCommand } = await import("./rollback-
|
|
72
|
+
const { rollbackCommand } = await import("./rollback-NSDZL7WA.js");
|
|
65
73
|
await rollbackCommand(skill, sha);
|
|
66
74
|
});
|
|
67
75
|
program.command("pin <skill>").description("Pin a skill so it is skipped during `augy update`").action(async (skill) => {
|
|
@@ -70,14 +78,31 @@ program.command("pin <skill>").description("Pin a skill so it is skipped during
|
|
|
70
78
|
program.command("unpin <skill>").description("Allow a pinned skill to receive updates again").action(async (skill) => {
|
|
71
79
|
await setPinned(skill, false);
|
|
72
80
|
});
|
|
81
|
+
var home = program.command("home").description("Manage a personal GitHub repo for backing up your skills manifest");
|
|
82
|
+
home.command("set <repo>").description("Set the home repo e.g. augy home set alice/my-skills").option("--path <file>", "Manifest path within the repo (default: augy.json)").option("--skills-path <dir>", "Dir for authored skills in the repo (default: skills)").action(async (repo, opts) => {
|
|
83
|
+
const { homeSetCommand } = await import("./home-TWK3PMCL.js");
|
|
84
|
+
await homeSetCommand(repo, opts);
|
|
85
|
+
});
|
|
86
|
+
home.command("push").description("Push your installed skills manifest to the home repo").action(async () => {
|
|
87
|
+
const { homePushCommand } = await import("./home-TWK3PMCL.js");
|
|
88
|
+
await homePushCommand();
|
|
89
|
+
});
|
|
90
|
+
home.command("pull").description("Fetch the manifest from the home repo and sync skills").option("--dry-run", "Preview changes without applying them").option("-a, --agent <agents...>", "Target agent(s) (default: all detected)").action(async (opts) => {
|
|
91
|
+
const { homePullCommand } = await import("./home-TWK3PMCL.js");
|
|
92
|
+
await homePullCommand(opts);
|
|
93
|
+
});
|
|
94
|
+
home.command("show").description("Show the current home repo configuration").action(async () => {
|
|
95
|
+
const { homeShowCommand } = await import("./home-TWK3PMCL.js");
|
|
96
|
+
await homeShowCommand();
|
|
97
|
+
});
|
|
73
98
|
program.action(async () => {
|
|
74
|
-
const { installCommand } = await import("./install-
|
|
99
|
+
const { installCommand } = await import("./install-7ZWHGCFN.js");
|
|
75
100
|
await installCommand();
|
|
76
101
|
});
|
|
77
102
|
program.parse();
|
|
78
103
|
async function setPinned(skillName, pinned) {
|
|
79
104
|
const chalk = (await import("chalk")).default;
|
|
80
|
-
const { readRegistry, writeRegistry, getSkill } = await import("./registry-
|
|
105
|
+
const { readRegistry, writeRegistry, getSkill } = await import("./registry-2B52E3ME.js");
|
|
81
106
|
const registry = await readRegistry();
|
|
82
107
|
const skill = getSkill(registry, skillName);
|
|
83
108
|
if (!skill) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
archiveExists
|
|
3
|
-
} from "./chunk-PX2LVUHV.js";
|
|
4
1
|
import {
|
|
5
2
|
AGENTS
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-V5GA2ZHU.js";
|
|
4
|
+
import {
|
|
5
|
+
archiveExists
|
|
6
|
+
} from "./chunk-Z4R7NYGP.js";
|
|
7
7
|
import {
|
|
8
8
|
getSkill,
|
|
9
9
|
readRegistry,
|
|
10
10
|
shortSha
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JM4VVAHN.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/info.ts
|
|
14
14
|
import chalk from "chalk";
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
filterableMultiselect
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RBF4Q6N4.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveSkillFromTaps
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HZSFPII7.js";
|
|
7
7
|
import {
|
|
8
8
|
AGENTS,
|
|
9
|
-
agentSkillPath
|
|
10
|
-
|
|
9
|
+
agentSkillPath,
|
|
10
|
+
detectInstalledAgents
|
|
11
|
+
} from "./chunk-V5GA2ZHU.js";
|
|
11
12
|
import {
|
|
12
13
|
discoverSkills,
|
|
13
14
|
downloadSkill,
|
|
14
15
|
parseGitHubUrl
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2E5SVRSR.js";
|
|
16
17
|
import {
|
|
17
18
|
createSkillRecord,
|
|
18
19
|
getSkill,
|
|
19
20
|
readRegistry,
|
|
20
21
|
shortSha,
|
|
21
22
|
writeRegistry
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-JM4VVAHN.js";
|
|
23
24
|
|
|
24
25
|
// src/commands/install.ts
|
|
25
26
|
import {
|
|
@@ -27,7 +28,6 @@ import {
|
|
|
27
28
|
confirm,
|
|
28
29
|
intro,
|
|
29
30
|
isCancel,
|
|
30
|
-
multiselect,
|
|
31
31
|
outro,
|
|
32
32
|
select,
|
|
33
33
|
spinner,
|
|
@@ -173,14 +173,15 @@ async function promptSkillSelection(skills) {
|
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
async function promptAgentSelection() {
|
|
176
|
-
|
|
176
|
+
const detected = new Set(detectInstalledAgents().map((a) => a.id));
|
|
177
|
+
return filterableMultiselect({
|
|
177
178
|
message: "Install for which agents?",
|
|
178
179
|
options: AGENTS.map((a) => ({
|
|
179
180
|
value: a,
|
|
180
181
|
label: a.name,
|
|
181
|
-
hint: chalk.dim(a.skillsPath)
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
hint: detected.has(a.id) ? chalk.dim(a.skillsPath) : chalk.dim("not detected"),
|
|
183
|
+
selected: detected.has(a.id)
|
|
184
|
+
}))
|
|
184
185
|
});
|
|
185
186
|
}
|
|
186
187
|
function bail() {
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
addTap,
|
|
3
3
|
augyHome,
|
|
4
4
|
createSkillRecord,
|
|
5
|
+
getHomeConfig,
|
|
5
6
|
getSkill,
|
|
6
7
|
getTap,
|
|
7
8
|
listSkills,
|
|
@@ -10,17 +11,19 @@ import {
|
|
|
10
11
|
registryPath,
|
|
11
12
|
removeSkill,
|
|
12
13
|
removeTap,
|
|
14
|
+
setHomeConfig,
|
|
13
15
|
shortSha,
|
|
14
16
|
tapKey,
|
|
15
17
|
upsertSkill,
|
|
16
18
|
versionArchivePath,
|
|
17
19
|
versionsDir,
|
|
18
20
|
writeRegistry
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JM4VVAHN.js";
|
|
20
22
|
export {
|
|
21
23
|
addTap,
|
|
22
24
|
augyHome,
|
|
23
25
|
createSkillRecord,
|
|
26
|
+
getHomeConfig,
|
|
24
27
|
getSkill,
|
|
25
28
|
getTap,
|
|
26
29
|
listSkills,
|
|
@@ -29,6 +32,7 @@ export {
|
|
|
29
32
|
registryPath,
|
|
30
33
|
removeSkill,
|
|
31
34
|
removeTap,
|
|
35
|
+
setHomeConfig,
|
|
32
36
|
shortSha,
|
|
33
37
|
tapKey,
|
|
34
38
|
upsertSkill,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
archiveExists,
|
|
3
|
-
restoreVersion
|
|
4
|
-
} from "./chunk-PX2LVUHV.js";
|
|
5
1
|
import {
|
|
6
2
|
agentById,
|
|
7
3
|
agentSkillPath
|
|
8
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-V5GA2ZHU.js";
|
|
5
|
+
import {
|
|
6
|
+
archiveExists,
|
|
7
|
+
restoreVersion
|
|
8
|
+
} from "./chunk-Z4R7NYGP.js";
|
|
9
9
|
import {
|
|
10
10
|
getSkill,
|
|
11
11
|
readRegistry,
|
|
12
12
|
shortSha,
|
|
13
13
|
writeRegistry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JM4VVAHN.js";
|
|
15
15
|
|
|
16
16
|
// src/commands/rollback.ts
|
|
17
17
|
import { cancel, intro, isCancel, outro, select, spinner } from "@clack/prompts";
|
|
@@ -74,7 +74,7 @@ The snapshot may have been pruned.`
|
|
|
74
74
|
try {
|
|
75
75
|
const currentDest = destPaths[0];
|
|
76
76
|
if (currentDest) {
|
|
77
|
-
const { archiveVersion } = await import("./versions-
|
|
77
|
+
const { archiveVersion } = await import("./versions-BGGRVKJ2.js");
|
|
78
78
|
await archiveVersion(currentDest, nameArg, skill.sha);
|
|
79
79
|
}
|
|
80
80
|
await restoreVersion(nameArg, targetSha, destPaths);
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
} from "./chunk-KCQY4IDO.js";
|
|
5
5
|
import {
|
|
6
6
|
filterableMultiselect
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RBF4Q6N4.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveSkillFromTaps
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HZSFPII7.js";
|
|
11
11
|
import {
|
|
12
12
|
AGENTS
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-V5GA2ZHU.js";
|
|
14
14
|
import {
|
|
15
15
|
discoverSkills,
|
|
16
16
|
parseGitHubUrl
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-2E5SVRSR.js";
|
|
18
18
|
import {
|
|
19
19
|
createSkillRecord,
|
|
20
20
|
getSkill,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
readRegistry,
|
|
23
23
|
shortSha,
|
|
24
24
|
writeRegistry
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-JM4VVAHN.js";
|
|
26
26
|
|
|
27
27
|
// src/commands/scan.ts
|
|
28
28
|
import { readdir, readFile } from "fs/promises";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
searchTaps
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-HZSFPII7.js";
|
|
4
|
+
import "./chunk-2E5SVRSR.js";
|
|
5
5
|
import {
|
|
6
6
|
listSkills,
|
|
7
7
|
readRegistry,
|
|
8
8
|
shortSha
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JM4VVAHN.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/search.ts
|
|
12
12
|
import { spinner } from "@clack/prompts";
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
buildGigetSource,
|
|
6
6
|
latestShaForPath,
|
|
7
7
|
parseGitHubUrl
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2E5SVRSR.js";
|
|
9
9
|
import {
|
|
10
10
|
getSkill,
|
|
11
11
|
readRegistry,
|
|
12
12
|
shortSha,
|
|
13
13
|
writeRegistry
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JM4VVAHN.js";
|
|
15
15
|
|
|
16
16
|
// src/commands/set-source.ts
|
|
17
17
|
import { cancel, intro, outro, spinner } from "@clack/prompts";
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AGENTS,
|
|
3
|
+
agentSkillPath,
|
|
4
|
+
detectInstalledAgents
|
|
5
|
+
} from "./chunk-V5GA2ZHU.js";
|
|
6
|
+
import {
|
|
7
|
+
discoverSkills,
|
|
8
|
+
downloadSkill,
|
|
9
|
+
latestShaForPath,
|
|
10
|
+
parseGitHubUrl
|
|
11
|
+
} from "./chunk-2E5SVRSR.js";
|
|
12
|
+
import {
|
|
13
|
+
createSkillRecord,
|
|
14
|
+
getSkill,
|
|
15
|
+
readRegistry,
|
|
16
|
+
shortSha,
|
|
17
|
+
writeRegistry
|
|
18
|
+
} from "./chunk-JM4VVAHN.js";
|
|
19
|
+
|
|
20
|
+
// src/commands/sync.ts
|
|
21
|
+
import {
|
|
22
|
+
confirm,
|
|
23
|
+
intro,
|
|
24
|
+
isCancel,
|
|
25
|
+
outro,
|
|
26
|
+
spinner
|
|
27
|
+
} from "@clack/prompts";
|
|
28
|
+
import chalk from "chalk";
|
|
29
|
+
import { existsSync } from "fs";
|
|
30
|
+
import { readFile } from "fs/promises";
|
|
31
|
+
import { join } from "path";
|
|
32
|
+
import { cwd } from "process";
|
|
33
|
+
import { mkdir, rm } from "fs/promises";
|
|
34
|
+
var DEFAULT_FILENAME = "augy.json";
|
|
35
|
+
async function syncCommand(pathArg, opts = {}) {
|
|
36
|
+
intro(chalk.bold("augy") + chalk.dim(" \u2014 sync"));
|
|
37
|
+
const manifestPath = pathArg ?? join(cwd(), DEFAULT_FILENAME);
|
|
38
|
+
if (!existsSync(manifestPath)) {
|
|
39
|
+
console.error(
|
|
40
|
+
chalk.red(`No manifest found at ${manifestPath}
|
|
41
|
+
`) + chalk.dim("Run `augy bundle` to create one.")
|
|
42
|
+
);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
let bundle;
|
|
46
|
+
try {
|
|
47
|
+
bundle = JSON.parse(await readFile(manifestPath, "utf8"));
|
|
48
|
+
} catch {
|
|
49
|
+
console.error(chalk.red(`Could not parse ${manifestPath}`));
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
const entries = Object.entries(bundle.skills);
|
|
53
|
+
if (!entries.length) {
|
|
54
|
+
outro(chalk.dim("Manifest is empty \u2014 nothing to sync."));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
console.log(
|
|
58
|
+
chalk.dim(`
|
|
59
|
+
Manifest: ${manifestPath}`) + chalk.dim(` (${entries.length} skill(s))
|
|
60
|
+
`)
|
|
61
|
+
);
|
|
62
|
+
const targetAgents = opts.agent?.length ? AGENTS.filter((a) => opts.agent.includes(a.id)) : detectInstalledAgents();
|
|
63
|
+
if (!targetAgents.length) {
|
|
64
|
+
console.error(chalk.red("No agents detected. Install an agent or use --agent to specify one."));
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
const registry = await readRegistry();
|
|
68
|
+
const s = spinner();
|
|
69
|
+
s.start("Resolving skills\u2026");
|
|
70
|
+
const plan = [];
|
|
71
|
+
await Promise.allSettled(
|
|
72
|
+
entries.map(async ([name, source]) => {
|
|
73
|
+
if (!source) {
|
|
74
|
+
plan.push({ name, source: "", action: "no-source" });
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const installed = getSkill(registry, name);
|
|
78
|
+
try {
|
|
79
|
+
const coords = parseGitHubUrl(source);
|
|
80
|
+
const remoteSha = await latestShaForPath(
|
|
81
|
+
coords.owner,
|
|
82
|
+
coords.repo,
|
|
83
|
+
coords.path || ".",
|
|
84
|
+
coords.ref
|
|
85
|
+
);
|
|
86
|
+
if (!installed) {
|
|
87
|
+
plan.push({ name, source, action: "install", remoteSha });
|
|
88
|
+
} else if (installed.sha !== remoteSha) {
|
|
89
|
+
plan.push({ name, source, action: "upgrade", remoteSha });
|
|
90
|
+
} else {
|
|
91
|
+
plan.push({ name, source, action: "up-to-date", remoteSha });
|
|
92
|
+
}
|
|
93
|
+
} catch {
|
|
94
|
+
plan.push({ name, source, action: "no-source" });
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
);
|
|
98
|
+
const order = { install: 0, upgrade: 1, "up-to-date": 2, "no-source": 3 };
|
|
99
|
+
plan.sort((a, b) => order[a.action] - order[b.action]);
|
|
100
|
+
s.stop("Resolved");
|
|
101
|
+
const toInstall = plan.filter((p) => p.action === "install");
|
|
102
|
+
const toUpgrade = plan.filter((p) => p.action === "upgrade");
|
|
103
|
+
const upToDate = plan.filter((p) => p.action === "up-to-date");
|
|
104
|
+
const noSource = plan.filter((p) => p.action === "no-source");
|
|
105
|
+
if (toInstall.length) {
|
|
106
|
+
console.log(chalk.bold(` Install (${toInstall.length})`));
|
|
107
|
+
for (const p of toInstall) {
|
|
108
|
+
console.log(` ${chalk.cyan(p.name)} ${chalk.dim(p.remoteSha ? "@" + shortSha(p.remoteSha) : "")}`);
|
|
109
|
+
}
|
|
110
|
+
console.log();
|
|
111
|
+
}
|
|
112
|
+
if (toUpgrade.length) {
|
|
113
|
+
console.log(chalk.bold(` Upgrade (${toUpgrade.length})`));
|
|
114
|
+
for (const p of toUpgrade) {
|
|
115
|
+
const installed = getSkill(registry, p.name);
|
|
116
|
+
console.log(
|
|
117
|
+
` ${chalk.cyan(p.name)} ${chalk.dim(installed.shortSha)} \u2192 ${chalk.green(shortSha(p.remoteSha))}`
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
console.log();
|
|
121
|
+
}
|
|
122
|
+
if (upToDate.length) {
|
|
123
|
+
console.log(chalk.dim(` Up to date (${upToDate.length}): `) + chalk.dim(upToDate.map((p) => p.name).join(", ")));
|
|
124
|
+
console.log();
|
|
125
|
+
}
|
|
126
|
+
if (noSource.length) {
|
|
127
|
+
console.log(chalk.yellow(` Skipped \u2014 no source (${noSource.length}): `) + chalk.dim(noSource.map((p) => p.name).join(", ")));
|
|
128
|
+
console.log();
|
|
129
|
+
}
|
|
130
|
+
if (!toInstall.length && !toUpgrade.length) {
|
|
131
|
+
outro(chalk.green("Everything is up to date."));
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (opts.dryRun) {
|
|
135
|
+
outro(chalk.dim("Dry run \u2014 no changes made."));
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const actionCount = toInstall.length + toUpgrade.length;
|
|
139
|
+
const ok = await confirm({
|
|
140
|
+
message: `Apply ${actionCount} change(s) to ${targetAgents.map((a) => a.name).join(", ")}?`
|
|
141
|
+
});
|
|
142
|
+
if (isCancel(ok) || !ok) {
|
|
143
|
+
console.log(chalk.dim("Cancelled."));
|
|
144
|
+
process.exit(0);
|
|
145
|
+
}
|
|
146
|
+
for (const entry of [...toInstall, ...toUpgrade]) {
|
|
147
|
+
const s2 = spinner();
|
|
148
|
+
s2.start(`${entry.action === "install" ? "Installing" : "Upgrading"} ${chalk.cyan(entry.name)}\u2026`);
|
|
149
|
+
try {
|
|
150
|
+
const coords = parseGitHubUrl(entry.source);
|
|
151
|
+
const remote = await discoverSkills(coords);
|
|
152
|
+
const match = remote.find((r) => r.name === entry.name) ?? remote[0];
|
|
153
|
+
if (!match) throw new Error("Skill not found at source");
|
|
154
|
+
const agentPaths = {};
|
|
155
|
+
for (const agent of targetAgents) {
|
|
156
|
+
const dest = agentSkillPath(agent, entry.name);
|
|
157
|
+
agentPaths[agent.id] = dest;
|
|
158
|
+
await rm(dest, { recursive: true, force: true });
|
|
159
|
+
await mkdir(dest, { recursive: true });
|
|
160
|
+
await downloadSkill(match.gigetSource, dest);
|
|
161
|
+
}
|
|
162
|
+
const existing = getSkill(registry, entry.name);
|
|
163
|
+
const record = createSkillRecord({
|
|
164
|
+
name: entry.name,
|
|
165
|
+
source: entry.source,
|
|
166
|
+
gigetSource: match.gigetSource,
|
|
167
|
+
sha: match.sha,
|
|
168
|
+
agentIds: targetAgents.map((a) => a.id),
|
|
169
|
+
agentPaths
|
|
170
|
+
});
|
|
171
|
+
if (existing) {
|
|
172
|
+
record.installedAt = existing.installedAt;
|
|
173
|
+
record.pinned = existing.pinned;
|
|
174
|
+
record.history = existing.history;
|
|
175
|
+
}
|
|
176
|
+
registry.skills[entry.name] = record;
|
|
177
|
+
await writeRegistry(registry);
|
|
178
|
+
s2.stop(
|
|
179
|
+
`${chalk.green("\u2713")} ${chalk.cyan(entry.name)} ${chalk.dim("@" + shortSha(match.sha))}`
|
|
180
|
+
);
|
|
181
|
+
} catch (err) {
|
|
182
|
+
s2.stop(`${chalk.red("\u2717")} ${chalk.cyan(entry.name)} \u2014 ${String(err)}`);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
outro(chalk.green(`Sync complete ${chalk.dim(`(${actionCount} change(s) applied)`)}`));
|
|
186
|
+
}
|
|
187
|
+
export {
|
|
188
|
+
syncCommand
|
|
189
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseTapArg,
|
|
3
3
|
tapSource
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HZSFPII7.js";
|
|
5
5
|
import {
|
|
6
6
|
discoverSkills,
|
|
7
7
|
parseGitHubUrl
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2E5SVRSR.js";
|
|
9
9
|
import {
|
|
10
10
|
addTap,
|
|
11
11
|
listTaps,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
removeTap,
|
|
14
14
|
tapKey,
|
|
15
15
|
writeRegistry
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JM4VVAHN.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/tap.ts
|
|
19
19
|
import { cancel, confirm, intro, isCancel, outro, spinner, text } from "@clack/prompts";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pruneVersions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Z4R7NYGP.js";
|
|
4
4
|
import {
|
|
5
5
|
getSkill,
|
|
6
6
|
readRegistry,
|
|
7
7
|
removeSkill,
|
|
8
8
|
versionsDir,
|
|
9
9
|
writeRegistry
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JM4VVAHN.js";
|
|
11
11
|
|
|
12
12
|
// src/commands/uninstall.ts
|
|
13
13
|
import { cancel, confirm, intro, isCancel, outro, spinner } from "@clack/prompts";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
archiveVersion
|
|
3
|
-
} from "./chunk-PX2LVUHV.js";
|
|
4
1
|
import {
|
|
5
2
|
agentById,
|
|
6
3
|
agentSkillPath
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-V5GA2ZHU.js";
|
|
8
5
|
import {
|
|
9
6
|
discoverSkills,
|
|
10
7
|
downloadSkill,
|
|
11
8
|
parseGitHubUrl
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2E5SVRSR.js";
|
|
10
|
+
import {
|
|
11
|
+
archiveVersion
|
|
12
|
+
} from "./chunk-Z4R7NYGP.js";
|
|
13
13
|
import {
|
|
14
14
|
listSkills,
|
|
15
15
|
readRegistry,
|
|
16
16
|
shortSha,
|
|
17
17
|
writeRegistry
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-JM4VVAHN.js";
|
|
19
19
|
|
|
20
20
|
// src/commands/update.ts
|
|
21
21
|
import { cancel, confirm, intro, isCancel, multiselect, outro, spinner } from "@clack/prompts";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@callmeradical/augy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Homebrew for AI agent skills — install, version, update, rollback",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,9 @@
|
|
|
35
35
|
"build": "tsup src/index.ts --format esm --outDir dist --clean",
|
|
36
36
|
"dev": "tsx src/index.ts",
|
|
37
37
|
"typecheck": "tsc --noEmit",
|
|
38
|
-
"
|
|
38
|
+
"test": "vitest run",
|
|
39
|
+
"test:watch": "vitest",
|
|
40
|
+
"prepublishOnly": "npm run build && npm test"
|
|
39
41
|
},
|
|
40
42
|
"dependencies": {
|
|
41
43
|
"@clack/prompts": "^0.9.0",
|
|
@@ -47,9 +49,11 @@
|
|
|
47
49
|
"devDependencies": {
|
|
48
50
|
"@types/diff": "^7.0.2",
|
|
49
51
|
"@types/node": "^22.0.0",
|
|
52
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
50
53
|
"tsup": "^8.3.0",
|
|
51
54
|
"tsx": "^4.19.0",
|
|
52
|
-
"typescript": "^5.7.0"
|
|
55
|
+
"typescript": "^5.7.0",
|
|
56
|
+
"vitest": "^4.1.8"
|
|
53
57
|
},
|
|
54
58
|
"engines": {
|
|
55
59
|
"node": ">=18"
|