@valiron/skill 1.0.6 → 1.0.8
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/README.md +3 -4
- package/bin/cli.mjs +14 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,14 +24,12 @@ The skill file gives your AI coding assistant context about Valiron — the SDK,
|
|
|
24
24
|
API, trust model, and middleware — so it can help you integrate Valiron into
|
|
25
25
|
your project.
|
|
26
26
|
|
|
27
|
-
It includes the
|
|
27
|
+
It includes the provider-backed identity v2 flow for ANS and future identity
|
|
28
28
|
providers. Agents can sign requests with `createAgentIdentityProof()`, while API
|
|
29
29
|
owners can verify identity, reputation, and policy with dedicated Express,
|
|
30
30
|
Fastify, Next.js, or framework-independent gates.
|
|
31
31
|
|
|
32
|
-
The installer fetches the
|
|
33
|
-
`npx @valiron/skill` and approve overwriting the existing file to refresh an
|
|
34
|
-
installed skill.
|
|
32
|
+
The installer fetches the skill over HTTPS and requires the content digest pinned by that installer release. It rejects redirects, timeouts, oversized content and a digest mismatch. If hosted content changes, upgrade to a matching released installer before retrying; accepting a different digest is not an installation workaround. Source changes do not publish a new npm package.
|
|
35
33
|
|
|
36
34
|
## Documentation
|
|
37
35
|
|
|
@@ -40,6 +38,7 @@ installed skill.
|
|
|
40
38
|
- **[API Reference](https://valiron.co/docs/agents/API-REFERENCE.md)** — HTTP endpoints
|
|
41
39
|
- **[Quickstart](https://valiron.co/docs/agents/QUICKSTART.md)** — get started in 2 minutes
|
|
42
40
|
- **[Provider Identity](https://valiron.co/docs/agents/PROVIDER-IDENTITY.md)** — ANS signing and verification
|
|
41
|
+
- **[Controlled Crawler Access](https://www.valiron.co/docs/agents/CRAWLER-PROTECTION.md)** — separate integration package for source checks and shared work budgets; not installed by this skill installer
|
|
43
42
|
|
|
44
43
|
## License
|
|
45
44
|
|
package/bin/cli.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { createInterface } from "node:readline/promises";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
4
5
|
import { get } from "node:https";
|
|
5
6
|
import { writeFileSync, mkdirSync, existsSync } from "node:fs";
|
|
6
7
|
import { dirname, resolve } from "node:path";
|
|
7
8
|
|
|
8
|
-
const
|
|
9
|
+
const SKILL_SHA256 = "5296146cd4c003f4db773721c7c5271ee2b28ec040528abd96b2ff0d4877f870";
|
|
10
|
+
const SKILL_URL = "https://www.valiron.co/skill/SKILL.md";
|
|
9
11
|
|
|
10
12
|
// Claude Code uses a directory with SKILL.md (official Claude Skills format).
|
|
11
13
|
// Other platforms get the same file placed at their expected path.
|
|
@@ -17,9 +19,9 @@ const PLATFORMS = [
|
|
|
17
19
|
{ key: "5", name: "Generic (AGENTS.md)", path: "AGENTS.md" },
|
|
18
20
|
];
|
|
19
21
|
|
|
20
|
-
function fetchURL(url, redirectsRemaining =
|
|
22
|
+
function fetchURL(url, redirectsRemaining = 0) {
|
|
21
23
|
return new Promise((res, rej) => {
|
|
22
|
-
get(url, (resp) => {
|
|
24
|
+
const req = get(url, (resp) => {
|
|
23
25
|
if (
|
|
24
26
|
resp.statusCode >= 300 &&
|
|
25
27
|
resp.statusCode < 400 &&
|
|
@@ -42,10 +44,15 @@ function fetchURL(url, redirectsRemaining = 5) {
|
|
|
42
44
|
rej(new Error(`HTTP ${resp.statusCode} fetching ${url}`));
|
|
43
45
|
return;
|
|
44
46
|
}
|
|
45
|
-
let data = "";
|
|
46
|
-
resp.on("data", (chunk) =>
|
|
47
|
+
let data = ""; let size = 0;
|
|
48
|
+
resp.on("data", (chunk) => {
|
|
49
|
+
size += chunk.length;
|
|
50
|
+
if (size > 256 * 1024) { resp.destroy(); rej(new Error("Skill content too large")); return; }
|
|
51
|
+
data += chunk;
|
|
52
|
+
});
|
|
47
53
|
resp.on("end", () => res(data));
|
|
48
54
|
}).on("error", rej);
|
|
55
|
+
req.setTimeout(10000, () => req.destroy(new Error("Skill fetch timed out")));
|
|
49
56
|
});
|
|
50
57
|
}
|
|
51
58
|
|
|
@@ -91,6 +98,8 @@ async function main() {
|
|
|
91
98
|
|
|
92
99
|
let content = await fetchURL(SKILL_URL);
|
|
93
100
|
|
|
101
|
+
if (createHash("sha256").update(content).digest("hex") !== SKILL_SHA256) throw new Error("Skill content differs from this release; update @valiron/skill before installing");
|
|
102
|
+
|
|
94
103
|
// Strip YAML frontmatter for non-Claude platforms (they don't use it)
|
|
95
104
|
if (platform.key !== "1") {
|
|
96
105
|
content = content.replace(/^---\n[\s\S]*?\n---\n+/, "");
|