yourskills 0.2.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/dist/main.js +57 -11
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -5036,6 +5036,8 @@ function report2(manifest, answer) {
|
|
|
5036
5036
|
else if (entry.state === "unknown") {
|
|
5037
5037
|
unknown.push({
|
|
5038
5038
|
name: asked[at]?.name ?? entry.externalId,
|
|
5039
|
+
reason: entry.reason,
|
|
5040
|
+
..."repo" in entry ? { repo: entry.repo } : {},
|
|
5039
5041
|
message: entry.message
|
|
5040
5042
|
});
|
|
5041
5043
|
}
|
|
@@ -5054,6 +5056,19 @@ async function driftNow(client, nearest) {
|
|
|
5054
5056
|
});
|
|
5055
5057
|
return report2(nearest.manifest, answer);
|
|
5056
5058
|
}
|
|
5059
|
+
function markFor(reason) {
|
|
5060
|
+
return reason === "foreign" ? "fail" : "pending";
|
|
5061
|
+
}
|
|
5062
|
+
function nextFor(drift) {
|
|
5063
|
+
if (drift.moved.length > 0)
|
|
5064
|
+
return { command: "yourskills update --all", why: "install what moved" };
|
|
5065
|
+
if (drift.unknown.some((row) => row.reason === "orphaned"))
|
|
5066
|
+
return {
|
|
5067
|
+
command: "yourskills doctor",
|
|
5068
|
+
why: "see what is no longer watched"
|
|
5069
|
+
};
|
|
5070
|
+
return;
|
|
5071
|
+
}
|
|
5057
5072
|
async function outdatedReport(client, nearest, quiet = false) {
|
|
5058
5073
|
let drift;
|
|
5059
5074
|
try {
|
|
@@ -5075,7 +5090,11 @@ async function outdatedReport(client, nearest, quiet = false) {
|
|
|
5075
5090
|
note: [row.bundle ?? "-", lifecycleTag(row.lifecycle)].filter(Boolean).join(" ")
|
|
5076
5091
|
}));
|
|
5077
5092
|
for (const row of drift.unknown) {
|
|
5078
|
-
lines.push({
|
|
5093
|
+
lines.push({
|
|
5094
|
+
mark: markFor(row.reason),
|
|
5095
|
+
text: row.name,
|
|
5096
|
+
note: row.message
|
|
5097
|
+
});
|
|
5079
5098
|
}
|
|
5080
5099
|
for (const name of drift.unpinned) {
|
|
5081
5100
|
lines.push({
|
|
@@ -5085,6 +5104,7 @@ async function outdatedReport(client, nearest, quiet = false) {
|
|
|
5085
5104
|
});
|
|
5086
5105
|
}
|
|
5087
5106
|
const current = drift.moved.length === 0 && drift.unknown.length === 0;
|
|
5107
|
+
const next = nextFor(drift);
|
|
5088
5108
|
if (current && !quiet) {
|
|
5089
5109
|
lines.push({
|
|
5090
5110
|
mark: "ok",
|
|
@@ -5101,12 +5121,7 @@ async function outdatedReport(client, nearest, quiet = false) {
|
|
|
5101
5121
|
unpinned: drift.unpinned
|
|
5102
5122
|
},
|
|
5103
5123
|
silent: quiet && current,
|
|
5104
|
-
...
|
|
5105
|
-
next: {
|
|
5106
|
-
command: "yourskills update --all",
|
|
5107
|
-
why: "install what moved"
|
|
5108
|
-
}
|
|
5109
|
-
} : {}
|
|
5124
|
+
...next ? { next } : {}
|
|
5110
5125
|
};
|
|
5111
5126
|
}
|
|
5112
5127
|
// src/hooks/emit.ts
|
|
@@ -5738,7 +5753,7 @@ import { realpathSync } from "node:fs";
|
|
|
5738
5753
|
// package.json
|
|
5739
5754
|
var package_default = {
|
|
5740
5755
|
name: "yourskills",
|
|
5741
|
-
version: "0.
|
|
5756
|
+
version: "0.3.0",
|
|
5742
5757
|
description: "Browse, install and keep up to date the agent skills and bundles your team publishes on yourskills.",
|
|
5743
5758
|
license: "UNLICENSED",
|
|
5744
5759
|
homepage: "https://yourskills.store",
|
|
@@ -6558,6 +6573,37 @@ async function downstreamChecks(ask, server) {
|
|
|
6558
6573
|
}))
|
|
6559
6574
|
];
|
|
6560
6575
|
}
|
|
6576
|
+
var liveDrift = async (nearest, server) => driftNow(await createClient(server), nearest);
|
|
6577
|
+
async function unwatchedCheck(nearest, ask, server) {
|
|
6578
|
+
const name = "unwatched sources";
|
|
6579
|
+
let drift;
|
|
6580
|
+
try {
|
|
6581
|
+
drift = await ask(nearest, server);
|
|
6582
|
+
} catch (error) {
|
|
6583
|
+
return {
|
|
6584
|
+
name,
|
|
6585
|
+
ok: false,
|
|
6586
|
+
detail: `could not ask the registry: ${error instanceof Error ? error.message : String(error)}`
|
|
6587
|
+
};
|
|
6588
|
+
}
|
|
6589
|
+
const orphans = drift.unknown.filter((row) => row.reason === "orphaned");
|
|
6590
|
+
if (orphans.length === 0)
|
|
6591
|
+
return {
|
|
6592
|
+
name,
|
|
6593
|
+
ok: true,
|
|
6594
|
+
detail: "every installed skill came from a source this organization still connects"
|
|
6595
|
+
};
|
|
6596
|
+
const names = orphans.map((row) => row.name);
|
|
6597
|
+
const repos = [
|
|
6598
|
+
...new Set(orphans.map((row) => row.repo).filter((repo) => repo !== undefined))
|
|
6599
|
+
].sort((a, b) => a.localeCompare(b));
|
|
6600
|
+
const one = names.length === 1;
|
|
6601
|
+
return {
|
|
6602
|
+
name,
|
|
6603
|
+
ok: true,
|
|
6604
|
+
detail: `${names.join(", ")}: installed from ${repos.join(", ")}, which this ` + "organization does not connect any more, so nothing is watching " + `${repos.length === 1 ? "it" : "them"} for changes. The ` + `${one ? "copy on this machine goes" : "copies on this machine go"} on ` + "working. A team member can reconnect the source or vendor the skill into " + "your catalog, and then `yourskills update --all` moves this machine onto it."
|
|
6605
|
+
};
|
|
6606
|
+
}
|
|
6561
6607
|
function version(config) {
|
|
6562
6608
|
const latest = config.latestVersion;
|
|
6563
6609
|
if (latest && isNewer(latest, VERSION))
|
|
@@ -6577,7 +6623,7 @@ async function diagnose(nearest, options = {}) {
|
|
|
6577
6623
|
const account = await session(options.askOrganization ?? namedOrganization, options.server);
|
|
6578
6624
|
checks.push(await reachable(base), ...account);
|
|
6579
6625
|
if (account[0].ok) {
|
|
6580
|
-
checks.push(...await downstreamChecks(options.ask ?? liveDiagnosis, options.server));
|
|
6626
|
+
checks.push(...await downstreamChecks(options.ask ?? liveDiagnosis, options.server), await unwatchedCheck(nearest, options.askDrift ?? liveDrift, options.server));
|
|
6581
6627
|
}
|
|
6582
6628
|
}
|
|
6583
6629
|
checks.push(skillsResolvable(), await agents(nearest, local));
|
|
@@ -6614,7 +6660,7 @@ async function applyFixes(checks) {
|
|
|
6614
6660
|
}
|
|
6615
6661
|
return out;
|
|
6616
6662
|
}
|
|
6617
|
-
function
|
|
6663
|
+
function nextFor2(checks, fixing) {
|
|
6618
6664
|
if (!fixing && fixable(checks).length > 0)
|
|
6619
6665
|
return {
|
|
6620
6666
|
command: "yourskills doctor --fix",
|
|
@@ -6636,7 +6682,7 @@ function doctorLines(checks, fixing = false) {
|
|
|
6636
6682
|
note
|
|
6637
6683
|
};
|
|
6638
6684
|
});
|
|
6639
|
-
const next =
|
|
6685
|
+
const next = nextFor2(checks, fixing);
|
|
6640
6686
|
return {
|
|
6641
6687
|
title: fixing ? "doctor --fix" : "doctor",
|
|
6642
6688
|
lines,
|
package/package.json
CHANGED