loadout-ai 0.5.8 → 0.6.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/CHANGELOG.md +17 -0
- package/MASTER_PLAN.md +9 -9
- package/README.md +84 -121
- package/catalog/discovered.json +59800 -10065
- package/catalog/packages.json +4 -3
- package/dist/src/cli.js +26 -2979
- package/dist/src/commands/agents.js +168 -0
- package/dist/src/commands/catalog.js +708 -0
- package/dist/src/commands/health.js +98 -0
- package/dist/src/commands/inventory.js +417 -0
- package/dist/src/commands/lifecycle.js +411 -0
- package/dist/src/commands/mcp.js +424 -0
- package/dist/src/commands/setup.js +67 -0
- package/dist/src/commands/sharing.js +358 -0
- package/dist/src/commands/support.js +246 -0
- package/dist/src/core/active-limit.js +2 -0
- package/dist/src/core/active-policy.js +2 -1
- package/dist/src/core/catalog-install.js +47 -10
- package/dist/src/core/catalog.js +15 -96
- package/dist/src/core/cli-guide.js +43 -37
- package/dist/src/core/completion.js +2 -20
- package/dist/src/core/doctor.js +73 -24
- package/dist/src/core/github.js +3 -2
- package/dist/src/core/handoff.js +161 -0
- package/dist/src/core/health-score-evidence.js +2 -2
- package/dist/src/core/health.js +83 -0
- package/dist/src/core/install.js +8 -3
- package/dist/src/core/loadout-card.js +14 -2
- package/dist/src/core/review-queue.js +7 -2
- package/dist/src/core/route.js +248 -0
- package/dist/src/core/skill-inventory.js +3 -3
- package/dist/src/core/skills.js +6 -7
- package/dist/src/core/source.js +10 -3
- package/dist/src/core/upgrade.js +10 -9
- package/docs/ACTIVE_SET.md +1 -1
- package/docs/ACTIVE_SET_POLICY.md +1 -1
- package/docs/CATALOG.md +2 -2
- package/docs/DEMO_SCRIPT.md +5 -5
- package/docs/DISCOVERED.md +250 -253
- package/docs/RELEASE_REVIEW.md +28 -143
- package/docs/SUBMISSION_COPY.md +4 -4
- package/docs/UPSTREAM_LICENSE_DECISIONS.md +19 -12
- package/docs/USER_TEST_GUIDE.md +1 -1
- package/docs/evidence/readme-claims.json +2 -14
- package/package.json +4 -3
- package/dist/src/core/benchmark-campaign.js +0 -496
- package/dist/src/core/benchmark-evidence.js +0 -458
- package/dist/src/core/benchmark-fixtures.js +0 -1157
- package/dist/src/core/benchmark-runner.js +0 -301
- package/dist/src/core/benchmark-trust.js +0 -795
- package/dist/src/core/catalog-release.js +0 -287
- package/dist/src/core/compatibility-intelligence.js +0 -465
- package/dist/src/core/ecosystem-import.js +0 -1072
- package/dist/src/core/head-to-head.js +0 -437
- package/dist/src/core/intelligence-feed-build.js +0 -59
- package/dist/src/core/intelligence-feed.js +0 -353
- package/dist/src/core/registry-api.js +0 -97
- package/dist/src/core/release-claims.js +0 -175
- package/dist/src/core/signing.js +0 -115
package/dist/src/core/signing.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { createHash, createPrivateKey, createPublicKey, generateKeyPairSync, sign, verify, } from "node:crypto";
|
|
2
|
-
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
|
-
import { dirname, resolve } from "node:path";
|
|
4
|
-
function canonical(value) {
|
|
5
|
-
if (value === null ||
|
|
6
|
-
typeof value === "boolean" ||
|
|
7
|
-
typeof value === "number" ||
|
|
8
|
-
typeof value === "string")
|
|
9
|
-
return JSON.stringify(value);
|
|
10
|
-
if (Array.isArray(value))
|
|
11
|
-
return `[${value.map(canonical).join(",")}]`;
|
|
12
|
-
if (typeof value === "object")
|
|
13
|
-
return `{${Object.entries(value)
|
|
14
|
-
.filter(([, entry]) => entry !== undefined)
|
|
15
|
-
.sort(([a], [b]) => a.localeCompare(b))
|
|
16
|
-
.map(([key, entry]) => `${JSON.stringify(key)}:${canonical(entry)}`)
|
|
17
|
-
.join(",")}}`;
|
|
18
|
-
throw new Error(`Cannot sign unsupported value type: ${typeof value}`);
|
|
19
|
-
}
|
|
20
|
-
function fingerprint(publicKey) {
|
|
21
|
-
return `sha256:${createHash("sha256")
|
|
22
|
-
.update(publicKey.export({ type: "spki", format: "der" }))
|
|
23
|
-
.digest("hex")}`;
|
|
24
|
-
}
|
|
25
|
-
export function publicKeyFingerprint(publicKeyPem) {
|
|
26
|
-
const publicKey = createPublicKey(publicKeyPem);
|
|
27
|
-
if (publicKey.asymmetricKeyType !== "ed25519")
|
|
28
|
-
throw new Error("Signing public key must be Ed25519");
|
|
29
|
-
return fingerprint(publicKey);
|
|
30
|
-
}
|
|
31
|
-
export function signPayload(payload, privateKeyPem, createdAt = new Date().toISOString()) {
|
|
32
|
-
const privateKey = createPrivateKey(privateKeyPem);
|
|
33
|
-
const publicKey = createPublicKey(privateKey);
|
|
34
|
-
if (privateKey.asymmetricKeyType !== "ed25519")
|
|
35
|
-
throw new Error("Signing key must be Ed25519");
|
|
36
|
-
const message = Buffer.from(canonical({
|
|
37
|
-
schemaVersion: 1,
|
|
38
|
-
algorithm: "Ed25519",
|
|
39
|
-
createdAt,
|
|
40
|
-
publicKeyFingerprint: fingerprint(publicKey),
|
|
41
|
-
payload,
|
|
42
|
-
}));
|
|
43
|
-
return {
|
|
44
|
-
schemaVersion: 1,
|
|
45
|
-
algorithm: "Ed25519",
|
|
46
|
-
createdAt,
|
|
47
|
-
publicKeyFingerprint: fingerprint(publicKey),
|
|
48
|
-
payload,
|
|
49
|
-
signature: sign(null, message, privateKey).toString("base64"),
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
export function verifyEnvelope(envelope, publicKeyPem) {
|
|
53
|
-
if (envelope.schemaVersion !== 1 ||
|
|
54
|
-
envelope.algorithm !== "Ed25519" ||
|
|
55
|
-
typeof envelope.signature !== "string")
|
|
56
|
-
return { valid: false, fingerprint: "invalid" };
|
|
57
|
-
const publicKey = createPublicKey(publicKeyPem);
|
|
58
|
-
const keyFingerprint = fingerprint(publicKey);
|
|
59
|
-
if (publicKey.asymmetricKeyType !== "ed25519")
|
|
60
|
-
return { valid: false, fingerprint: keyFingerprint };
|
|
61
|
-
if (envelope.publicKeyFingerprint !== keyFingerprint)
|
|
62
|
-
return { valid: false, fingerprint: keyFingerprint };
|
|
63
|
-
const message = Buffer.from(canonical({
|
|
64
|
-
schemaVersion: envelope.schemaVersion,
|
|
65
|
-
algorithm: envelope.algorithm,
|
|
66
|
-
createdAt: envelope.createdAt,
|
|
67
|
-
publicKeyFingerprint: envelope.publicKeyFingerprint,
|
|
68
|
-
payload: envelope.payload,
|
|
69
|
-
}));
|
|
70
|
-
let signature;
|
|
71
|
-
try {
|
|
72
|
-
signature = Buffer.from(envelope.signature, "base64");
|
|
73
|
-
}
|
|
74
|
-
catch {
|
|
75
|
-
return { valid: false, fingerprint: keyFingerprint };
|
|
76
|
-
}
|
|
77
|
-
return {
|
|
78
|
-
valid: verify(null, message, publicKey, signature),
|
|
79
|
-
fingerprint: keyFingerprint,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
export async function generateSigningKeys(privatePath, publicPath) {
|
|
83
|
-
const pair = generateKeyPairSync("ed25519");
|
|
84
|
-
const privatePem = pair.privateKey
|
|
85
|
-
.export({ type: "pkcs8", format: "pem" })
|
|
86
|
-
.toString();
|
|
87
|
-
const publicPem = pair.publicKey
|
|
88
|
-
.export({ type: "spki", format: "pem" })
|
|
89
|
-
.toString();
|
|
90
|
-
const privateKey = resolve(privatePath);
|
|
91
|
-
const publicKey = resolve(publicPath);
|
|
92
|
-
await Promise.all([
|
|
93
|
-
mkdir(dirname(privateKey), { recursive: true }),
|
|
94
|
-
mkdir(dirname(publicKey), { recursive: true }),
|
|
95
|
-
]);
|
|
96
|
-
await writeFile(privateKey, privatePem, { mode: 0o600, flag: "wx" });
|
|
97
|
-
await writeFile(publicKey, publicPem, { mode: 0o644, flag: "wx" });
|
|
98
|
-
return { privateKey, publicKey, fingerprint: fingerprint(pair.publicKey) };
|
|
99
|
-
}
|
|
100
|
-
export async function signJsonFile(input, privateKeyPath, output) {
|
|
101
|
-
const payload = JSON.parse(await readFile(resolve(input), "utf8"));
|
|
102
|
-
const privateKey = await readFile(resolve(privateKeyPath), "utf8");
|
|
103
|
-
const envelope = signPayload(payload, privateKey);
|
|
104
|
-
const target = resolve(output);
|
|
105
|
-
await mkdir(dirname(target), { recursive: true });
|
|
106
|
-
await writeFile(target, `${JSON.stringify(envelope, null, 2)}\n`, {
|
|
107
|
-
flag: "wx",
|
|
108
|
-
});
|
|
109
|
-
return envelope;
|
|
110
|
-
}
|
|
111
|
-
export async function verifyJsonFile(input, publicKeyPath) {
|
|
112
|
-
const envelope = JSON.parse(await readFile(resolve(input), "utf8"));
|
|
113
|
-
const publicKey = await readFile(resolve(publicKeyPath), "utf8");
|
|
114
|
-
return verifyEnvelope(envelope, publicKey);
|
|
115
|
-
}
|