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.
Files changed (59) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/MASTER_PLAN.md +9 -9
  3. package/README.md +84 -121
  4. package/catalog/discovered.json +59800 -10065
  5. package/catalog/packages.json +4 -3
  6. package/dist/src/cli.js +26 -2979
  7. package/dist/src/commands/agents.js +168 -0
  8. package/dist/src/commands/catalog.js +708 -0
  9. package/dist/src/commands/health.js +98 -0
  10. package/dist/src/commands/inventory.js +417 -0
  11. package/dist/src/commands/lifecycle.js +411 -0
  12. package/dist/src/commands/mcp.js +424 -0
  13. package/dist/src/commands/setup.js +67 -0
  14. package/dist/src/commands/sharing.js +358 -0
  15. package/dist/src/commands/support.js +246 -0
  16. package/dist/src/core/active-limit.js +2 -0
  17. package/dist/src/core/active-policy.js +2 -1
  18. package/dist/src/core/catalog-install.js +47 -10
  19. package/dist/src/core/catalog.js +15 -96
  20. package/dist/src/core/cli-guide.js +43 -37
  21. package/dist/src/core/completion.js +2 -20
  22. package/dist/src/core/doctor.js +73 -24
  23. package/dist/src/core/github.js +3 -2
  24. package/dist/src/core/handoff.js +161 -0
  25. package/dist/src/core/health-score-evidence.js +2 -2
  26. package/dist/src/core/health.js +83 -0
  27. package/dist/src/core/install.js +8 -3
  28. package/dist/src/core/loadout-card.js +14 -2
  29. package/dist/src/core/review-queue.js +7 -2
  30. package/dist/src/core/route.js +248 -0
  31. package/dist/src/core/skill-inventory.js +3 -3
  32. package/dist/src/core/skills.js +6 -7
  33. package/dist/src/core/source.js +10 -3
  34. package/dist/src/core/upgrade.js +10 -9
  35. package/docs/ACTIVE_SET.md +1 -1
  36. package/docs/ACTIVE_SET_POLICY.md +1 -1
  37. package/docs/CATALOG.md +2 -2
  38. package/docs/DEMO_SCRIPT.md +5 -5
  39. package/docs/DISCOVERED.md +250 -253
  40. package/docs/RELEASE_REVIEW.md +28 -143
  41. package/docs/SUBMISSION_COPY.md +4 -4
  42. package/docs/UPSTREAM_LICENSE_DECISIONS.md +19 -12
  43. package/docs/USER_TEST_GUIDE.md +1 -1
  44. package/docs/evidence/readme-claims.json +2 -14
  45. package/package.json +4 -3
  46. package/dist/src/core/benchmark-campaign.js +0 -496
  47. package/dist/src/core/benchmark-evidence.js +0 -458
  48. package/dist/src/core/benchmark-fixtures.js +0 -1157
  49. package/dist/src/core/benchmark-runner.js +0 -301
  50. package/dist/src/core/benchmark-trust.js +0 -795
  51. package/dist/src/core/catalog-release.js +0 -287
  52. package/dist/src/core/compatibility-intelligence.js +0 -465
  53. package/dist/src/core/ecosystem-import.js +0 -1072
  54. package/dist/src/core/head-to-head.js +0 -437
  55. package/dist/src/core/intelligence-feed-build.js +0 -59
  56. package/dist/src/core/intelligence-feed.js +0 -353
  57. package/dist/src/core/registry-api.js +0 -97
  58. package/dist/src/core/release-claims.js +0 -175
  59. package/dist/src/core/signing.js +0 -115
@@ -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
- }