@divergeai/cli 0.1.13 → 0.1.14
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/diverge.mjs +21 -8
- package/package.json +1 -1
package/dist/diverge.mjs
CHANGED
|
@@ -7387,7 +7387,7 @@ import path11 from "node:path";
|
|
|
7387
7387
|
import { parseArgs as parseArgs2 } from "node:util";
|
|
7388
7388
|
|
|
7389
7389
|
// src/version.ts
|
|
7390
|
-
var VERSION = true ? "0.1.
|
|
7390
|
+
var VERSION = true ? "0.1.14" : "dev";
|
|
7391
7391
|
var USER_AGENT = `diverge/${VERSION}`;
|
|
7392
7392
|
|
|
7393
7393
|
// src/http.ts
|
|
@@ -8316,13 +8316,21 @@ function readSkillsManifest(root) {
|
|
|
8316
8316
|
}
|
|
8317
8317
|
return null;
|
|
8318
8318
|
}
|
|
8319
|
+
function few(names, limit = 6) {
|
|
8320
|
+
return names.length <= limit ? names.join(", ") : `${names.slice(0, limit).join(", ")} and ${names.length - limit} more`;
|
|
8321
|
+
}
|
|
8319
8322
|
function installSkills(root, skills, source, now = () => /* @__PURE__ */ new Date()) {
|
|
8320
8323
|
const previous = readSkillsManifest(root);
|
|
8324
|
+
const held = previous?.skills ?? {};
|
|
8321
8325
|
const written = [];
|
|
8326
|
+
const added = [];
|
|
8327
|
+
const updated = [];
|
|
8322
8328
|
for (const skill of skills) {
|
|
8323
8329
|
if (!/^[a-z0-9][a-z0-9-]{0,63}$/.test(skill.name)) throw new Error(`skill name ${JSON.stringify(skill.name)} is not a folder name`);
|
|
8324
8330
|
writeTextAtomic(path8.join(root, skill.name, "SKILL.md"), skill.content, 420);
|
|
8325
8331
|
written.push(skill.name);
|
|
8332
|
+
if (!(skill.name in held)) added.push(skill.name);
|
|
8333
|
+
else if (held[skill.name] !== skill.updatedAt) updated.push(skill.name);
|
|
8326
8334
|
}
|
|
8327
8335
|
const removed = [];
|
|
8328
8336
|
for (const name of Object.keys(previous?.skills ?? {})) {
|
|
@@ -8336,7 +8344,7 @@ function installSkills(root, skills, source, now = () => /* @__PURE__ */ new Dat
|
|
|
8336
8344
|
skills: Object.fromEntries(skills.map((skill) => [skill.name, skill.updatedAt]))
|
|
8337
8345
|
};
|
|
8338
8346
|
writeJsonAtomic(path8.join(root, SKILLS_MANIFEST), manifest, 420);
|
|
8339
|
-
return { root, written, removed };
|
|
8347
|
+
return { root, written, added, updated, removed };
|
|
8340
8348
|
}
|
|
8341
8349
|
function skillsStatus(root, skills) {
|
|
8342
8350
|
const manifest = readSkillsManifest(root);
|
|
@@ -8368,7 +8376,8 @@ var skillsUsage = `diverge skills <list|install|status> [--harness claude,codex,
|
|
|
8368
8376
|
|
|
8369
8377
|
list the skills the platform serves you: your organization's skills whose tools you can run
|
|
8370
8378
|
install write them, and the CLI's own "diverge" skill, into each harness's user skill folder
|
|
8371
|
-
(~/.claude/skills, ~/.codex/skills, $DSH_HOME/skills); retires the ones the organization retired
|
|
8379
|
+
(~/.claude/skills, ~/.codex/skills, $DSH_HOME/skills); retires the ones the organization retired;
|
|
8380
|
+
reports what changed \u2014 the full list is \`skills list\`
|
|
8372
8381
|
status what each folder holds against what the platform serves now
|
|
8373
8382
|
|
|
8374
8383
|
A skill is a procedure over the tools it names; you get the ones whose every
|
|
@@ -8390,8 +8399,12 @@ function harnessesOf(flag) {
|
|
|
8390
8399
|
function installForHarness(io, harness, skills, apiUrl, into) {
|
|
8391
8400
|
const root = into ?? skillsRoot(harness, io.env);
|
|
8392
8401
|
const result = installSkills(root, skills, apiUrl);
|
|
8393
|
-
const
|
|
8394
|
-
|
|
8402
|
+
const changes = [
|
|
8403
|
+
...result.added.length ? [`${result.added.length} new: ${few(result.added)}`] : [],
|
|
8404
|
+
...result.updated.length ? [`${result.updated.length} updated: ${few(result.updated)}`] : [],
|
|
8405
|
+
...result.removed.length ? [`${result.removed.length} retired: ${few(result.removed)}`] : []
|
|
8406
|
+
];
|
|
8407
|
+
io.stdout(`${harness}: ${result.written.length} skills in ${root}${changes.length ? ` (${changes.join("; ")})` : " (unchanged)"}`);
|
|
8395
8408
|
}
|
|
8396
8409
|
async function runSkills(args, io) {
|
|
8397
8410
|
const [verb, ...rest] = args;
|
|
@@ -8416,9 +8429,9 @@ async function runSkills(args, io) {
|
|
|
8416
8429
|
for (const harness of harnessesOf(values.harness)) {
|
|
8417
8430
|
const status2 = skillsStatus(values.into ?? skillsRoot(harness, io.env), skills);
|
|
8418
8431
|
const parts = [`${status2.current.length} current`];
|
|
8419
|
-
if (status2.behind.length) parts.push(`${status2.behind.length} behind (${status2.behind
|
|
8420
|
-
if (status2.missing.length) parts.push(`${status2.missing.length} missing (${status2.missing
|
|
8421
|
-
if (status2.retired.length) parts.push(`${status2.retired.length} retired (${status2.retired
|
|
8432
|
+
if (status2.behind.length) parts.push(`${status2.behind.length} behind (${few(status2.behind)})`);
|
|
8433
|
+
if (status2.missing.length) parts.push(`${status2.missing.length} missing${status2.current.length || status2.behind.length ? ` (${few(status2.missing)})` : ""}`);
|
|
8434
|
+
if (status2.retired.length) parts.push(`${status2.retired.length} retired (${few(status2.retired)})`);
|
|
8422
8435
|
behind ||= status2.behind.length + status2.missing.length + status2.retired.length > 0;
|
|
8423
8436
|
io.stdout(`${harness}: ${parts.join(", ")} in ${status2.root}${status2.installedAt ? ` (installed ${status2.installedAt})` : " (never installed)"}`);
|
|
8424
8437
|
}
|
package/package.json
CHANGED