@callmeradical/augy 0.7.1 → 0.7.2
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.
|
@@ -116,6 +116,10 @@ async function homePushCommand() {
|
|
|
116
116
|
for (const skill of authored) {
|
|
117
117
|
bundle.skills[skill.name] = "";
|
|
118
118
|
}
|
|
119
|
+
const contextEntries = allSkills.filter((s3) => s3.contexts && s3.contexts.length > 0).map((s3) => [s3.name, s3.contexts]);
|
|
120
|
+
if (contextEntries.length) {
|
|
121
|
+
bundle.contexts = Object.fromEntries(contextEntries);
|
|
122
|
+
}
|
|
119
123
|
await writeFile(
|
|
120
124
|
join(cloneDir, home.path),
|
|
121
125
|
JSON.stringify(bundle, null, 2) + "\n",
|
|
@@ -126,12 +130,24 @@ async function homePushCommand() {
|
|
|
126
130
|
await gitAddAll(cloneDir);
|
|
127
131
|
const skillCount = allSkills.length;
|
|
128
132
|
const authoredNote = authored.length ? ` (${authored.length} authored)` : "";
|
|
129
|
-
|
|
130
|
-
|
|
133
|
+
let pushed = false;
|
|
134
|
+
try {
|
|
135
|
+
await gitCommit(cloneDir, `chore: update skills via augy \u2014 ${skillCount} skill(s)${authoredNote}`);
|
|
136
|
+
await gitPush(cloneDir);
|
|
137
|
+
pushed = true;
|
|
138
|
+
s2.stop(`${chalk.green("\u2713")} Pushed`);
|
|
139
|
+
} catch (err) {
|
|
140
|
+
const msg = String(err);
|
|
141
|
+
if (msg.includes("nothing to commit") || msg.includes("nothing added to commit")) {
|
|
142
|
+
s2.stop(chalk.dim("Nothing changed \u2014 home repo is already up to date"));
|
|
143
|
+
} else {
|
|
144
|
+
s2.stop(chalk.red("\u2717 Push failed"));
|
|
145
|
+
throw err;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
131
148
|
outro(
|
|
132
|
-
`${chalk.bold(String(skillCount))} skill(s) saved to ${chalk.cyan(home.repo)}
|
|
133
|
-
` +
|
|
134
|
-
`) : "") + chalk.dim(` Run \`augy home pull\` on a new machine to restore.`)
|
|
149
|
+
pushed ? `${chalk.bold(String(skillCount))} skill(s) saved to ${chalk.cyan(home.repo)}
|
|
150
|
+
` + chalk.dim(` Run \`augy home pull\` on a new machine to restore.`) : chalk.dim("Home repo is up to date \u2014 no changes to push.")
|
|
135
151
|
);
|
|
136
152
|
}
|
|
137
153
|
async function homePullCommand(opts = {}) {
|
|
@@ -155,10 +171,12 @@ async function homePullCommand(opts = {}) {
|
|
|
155
171
|
if (e.isDirectory()) available.push({ name: e.name, source: "", isAuthored: true });
|
|
156
172
|
}
|
|
157
173
|
}
|
|
174
|
+
let bundleContexts = {};
|
|
158
175
|
const manifestPath = join(cloneDir, home.path);
|
|
159
176
|
if (existsSync(manifestPath)) {
|
|
160
177
|
const { readFile } = await import("fs/promises");
|
|
161
178
|
const bundle = JSON.parse(await readFile(manifestPath, "utf8"));
|
|
179
|
+
bundleContexts = bundle.contexts ?? {};
|
|
162
180
|
for (const [name, source] of Object.entries(bundle.skills)) {
|
|
163
181
|
if (source && !available.find((s2) => s2.name === name)) {
|
|
164
182
|
available.push({ name, source, isAuthored: false });
|
|
@@ -173,8 +191,7 @@ async function homePullCommand(opts = {}) {
|
|
|
173
191
|
const selected = await filterableMultiselect({
|
|
174
192
|
message: `Select skills to install ${chalk.dim(`(${available.length} available)`)}`,
|
|
175
193
|
options: available.map((sk) => {
|
|
176
|
-
const
|
|
177
|
-
const contexts = record?.contexts ?? [];
|
|
194
|
+
const contexts = bundleContexts[sk.name] ?? currentRegistry.skills[sk.name]?.contexts ?? [];
|
|
178
195
|
const matches = skillMatchesContext(contexts, opts.context);
|
|
179
196
|
const ctxHint = contexts.length ? chalk.dim(contexts.join(", ")) : "";
|
|
180
197
|
const srcHint = sk.isAuthored ? chalk.dim("authored") : chalk.dim(sk.source);
|
|
@@ -233,6 +250,7 @@ async function homePullCommand(opts = {}) {
|
|
|
233
250
|
agentIds: targetAgents.map((a) => a.id),
|
|
234
251
|
agentPaths
|
|
235
252
|
});
|
|
253
|
+
if (bundleContexts[sk.name]) record.contexts = bundleContexts[sk.name];
|
|
236
254
|
upsertSkill(registry, record);
|
|
237
255
|
}
|
|
238
256
|
if (authoredToInstall.length) await writeRegistry(registry);
|
package/dist/index.js
CHANGED
|
@@ -102,19 +102,19 @@ author.command("edit <name>").description("Open an existing skill in $EDITOR").a
|
|
|
102
102
|
});
|
|
103
103
|
var home = program.command("home").description("Manage a personal GitHub repo for backing up your skills manifest");
|
|
104
104
|
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) => {
|
|
105
|
-
const { homeSetCommand } = await import("./home-
|
|
105
|
+
const { homeSetCommand } = await import("./home-PGOEFTIJ.js");
|
|
106
106
|
await homeSetCommand(repo, opts);
|
|
107
107
|
});
|
|
108
108
|
home.command("push").description("Push your installed skills manifest to the home repo").action(async () => {
|
|
109
|
-
const { homePushCommand } = await import("./home-
|
|
109
|
+
const { homePushCommand } = await import("./home-PGOEFTIJ.js");
|
|
110
110
|
await homePushCommand();
|
|
111
111
|
});
|
|
112
112
|
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)").option("--context <ctx>", "Pre-select only skills matching this context (e.g. work, personal)").action(async (opts) => {
|
|
113
|
-
const { homePullCommand } = await import("./home-
|
|
113
|
+
const { homePullCommand } = await import("./home-PGOEFTIJ.js");
|
|
114
114
|
await homePullCommand(opts);
|
|
115
115
|
});
|
|
116
116
|
home.command("show").description("Show the current home repo configuration").action(async () => {
|
|
117
|
-
const { homeShowCommand } = await import("./home-
|
|
117
|
+
const { homeShowCommand } = await import("./home-PGOEFTIJ.js");
|
|
118
118
|
await homeShowCommand();
|
|
119
119
|
});
|
|
120
120
|
program.action(async () => {
|