skillwiki 0.10.111 → 0.10.113

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 (44) hide show
  1. package/dist/{chunk-I6IRJCUJ.js → chunk-3TKNAOJH.js} +2 -2
  2. package/dist/chunk-5D5HFQ76.js +111 -0
  3. package/dist/{chunk-OJJBZDPR.js → chunk-5RHR4FEK.js} +183 -211
  4. package/dist/{chunk-GQWCTJTU.js → chunk-6VUK2FTX.js} +1 -1
  5. package/dist/{chunk-JQV5KNPT.js → chunk-CBT35FAW.js} +3 -3
  6. package/dist/{chunk-HBJLFPQP.js → chunk-FQERKMD7.js} +458 -18
  7. package/dist/{chunk-PYPPG7RF.js → chunk-IJKJGQKL.js} +1 -1
  8. package/dist/{chunk-MRPJ7X7W.js → chunk-IJWZDQDH.js} +3 -3
  9. package/dist/{chunk-X5GL2FCU.js → chunk-JL2SCLXT.js} +1 -1
  10. package/dist/chunk-K3M6OSUW.js +77 -0
  11. package/dist/{chunk-5IBLXGLY.js → chunk-K3YZESND.js} +2 -2
  12. package/dist/chunk-OGEAFXON.js +60 -0
  13. package/dist/{chunk-6OQLBNKR.js → chunk-OWWWO2XS.js} +29 -4
  14. package/dist/{chunk-KWEYA3OE.js → chunk-SEY4N4CT.js} +1 -1
  15. package/dist/{chunk-UIEQIJXP.js → chunk-VNSZCK5V.js} +47 -44
  16. package/dist/{chunk-TDBUJUYH.js → chunk-XJ5VEIH7.js} +42 -18
  17. package/dist/cli.js +586 -122
  18. package/dist/{index-projection-2K672CBO.js → index-projection-RQSOEDXM.js} +5 -5
  19. package/dist/{journal-QU5IDXQF.js → journal-V5XHBEI5.js} +3 -3
  20. package/dist/{managed-write-preflight-GRSHQYKC.js → managed-write-preflight-2BMHZWVJ.js} +7 -7
  21. package/dist/mcp-auth-env-QONKW4EO.js +25 -0
  22. package/dist/{migrate-PIB4QA54.js → migrate-SRRCXI2K.js} +6 -5
  23. package/dist/mirror-H5BTBAON.js +151 -0
  24. package/dist/runtime-LQZIG3XN.js +20 -0
  25. package/dist/skillwiki-mcp.js +14 -12
  26. package/dist/sources-E6KHDRDE.js +10 -0
  27. package/dist/{watcher-MHG46J3R.js → watcher-VJ3TOU6J.js} +20 -110
  28. package/package.json +1 -1
  29. package/skills/.claude-plugin/plugin.json +1 -1
  30. package/skills/.codex-plugin/plugin.json +1 -1
  31. package/skills/.cursor-plugin/plugin.json +1 -1
  32. package/skills/package.json +1 -1
  33. package/skills/skills/using-skillwiki/SKILL.md +1 -1
  34. package/skills/skills/wiki-ingest/SKILL.md +47 -0
  35. package/skills/skills/wiki-init/SKILL.md +3 -0
  36. package/skills/skills/wiki-lint/SKILL.md +7 -0
  37. package/skills/using-skillwiki/SKILL.md +1 -1
  38. package/skills/wiki-ingest/SKILL.md +47 -0
  39. package/skills/wiki-init/SKILL.md +3 -0
  40. package/skills/wiki-lint/SKILL.md +7 -0
  41. package/templates/launchd/com.karlchow.skillwiki-mirror-sse.plist +20 -0
  42. package/dist/chunk-I2J3IJB7.js +0 -54
  43. package/dist/runtime-GLMI5OCT.js +0 -15
  44. package/dist/sources-D2MGP246.js +0 -10
@@ -3,14 +3,14 @@ import {
3
3
  extractFrontmatter,
4
4
  scanSensitiveContent,
5
5
  scanVault
6
- } from "./chunk-X5GL2FCU.js";
6
+ } from "./chunk-JL2SCLXT.js";
7
7
  import {
8
8
  MetaSchema,
9
9
  TypedKnowledgeSchema,
10
10
  detectSchema,
11
11
  err,
12
12
  ok
13
- } from "./chunk-UIEQIJXP.js";
13
+ } from "./chunk-VNSZCK5V.js";
14
14
 
15
15
  // src/utils/index-universe.ts
16
16
  import { readFile } from "fs/promises";
@@ -0,0 +1,111 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ ExitCode,
4
+ err,
5
+ ipv4InCidr,
6
+ isBlockedHost,
7
+ ok
8
+ } from "./chunk-VNSZCK5V.js";
9
+
10
+ // src/commands/fetch-guard.ts
11
+ var REDACT_PARAMS = /* @__PURE__ */ new Set(["api_key", "token", "key", "auth", "password", "secret", "access_token"]);
12
+ var PATH_TOKEN_RE = /[A-Fa-f0-9]{32,}|[A-Za-z0-9_\-]{40,}/g;
13
+ function runFetchGuard(input) {
14
+ return Promise.resolve(runFetchGuardSync(input));
15
+ }
16
+ function runFetchGuardSync(input) {
17
+ let u;
18
+ try {
19
+ u = new URL(input.url);
20
+ } catch {
21
+ return { exitCode: ExitCode.MALFORMED_URL, result: err("MALFORMED_URL", { url: input.url }) };
22
+ }
23
+ const sanitized = sanitizeUrl(u);
24
+ if (u.protocol !== "https:") {
25
+ return {
26
+ exitCode: ExitCode.SCHEME_REJECTED,
27
+ result: err("SCHEME_REJECTED", { sanitized_url: sanitized, scheme: u.protocol })
28
+ };
29
+ }
30
+ if (isBlockedHost(u.hostname)) {
31
+ return {
32
+ exitCode: ExitCode.HOST_BLOCKED,
33
+ result: err("HOST_BLOCKED", { sanitized_url: sanitized, host: u.hostname })
34
+ };
35
+ }
36
+ return { exitCode: ExitCode.OK, result: ok({ allowed: true, sanitized_url: sanitized, humanHint: `ALLOWED: ${sanitized}` }) };
37
+ }
38
+ function sanitizeUrl(u) {
39
+ const clone = new URL(u.toString());
40
+ if (clone.username || clone.password) {
41
+ clone.username = "";
42
+ clone.password = "";
43
+ }
44
+ for (const k of Array.from(clone.searchParams.keys())) {
45
+ if (REDACT_PARAMS.has(k.toLowerCase())) clone.searchParams.set(k, "REDACTED");
46
+ }
47
+ let s = clone.toString();
48
+ s = s.replace(PATH_TOKEN_RE, "REDACTED");
49
+ return s;
50
+ }
51
+
52
+ // src/clip-outbox/ssrf.ts
53
+ import { isIP } from "net";
54
+ import { lookup as dnsLookup } from "dns/promises";
55
+ var extraBlockedV4 = [
56
+ ["0.0.0.0", 8],
57
+ ["100.64.0.0", 10],
58
+ ["192.0.2.0", 24],
59
+ ["198.18.0.0", 15],
60
+ ["198.51.100.0", 24],
61
+ ["203.0.113.0", 24],
62
+ ["224.0.0.0", 4],
63
+ ["240.0.0.0", 4]
64
+ ];
65
+ function isBlockedAddress(address) {
66
+ if (isBlockedHost(address)) return true;
67
+ const version = isIP(address);
68
+ if (version === 4) {
69
+ return extraBlockedV4.some(([base, prefix]) => ipv4InCidr(address, base, prefix));
70
+ }
71
+ if (version === 6) {
72
+ const lower = address.toLowerCase();
73
+ return lower === "::" || lower === "::1" || lower.startsWith("fc") || lower.startsWith("fd") || lower.startsWith("fe80:");
74
+ }
75
+ return false;
76
+ }
77
+ async function assertPublicHttpsUrl(url, lookup = defaultLookup) {
78
+ const guard = runFetchGuardSync({ url });
79
+ if (!guard.result.ok) {
80
+ return { ok: false, reason: guard.result.error };
81
+ }
82
+ let parsed;
83
+ try {
84
+ parsed = new URL(url);
85
+ } catch {
86
+ return { ok: false, reason: "MALFORMED_URL" };
87
+ }
88
+ if (isBlockedAddress(parsed.hostname)) {
89
+ return { ok: false, reason: "HOST_BLOCKED" };
90
+ }
91
+ try {
92
+ const addresses = await lookup(parsed.hostname);
93
+ if (addresses.length === 0) return { ok: false, reason: "DNS_EMPTY" };
94
+ if (addresses.some(isBlockedAddress)) return { ok: false, reason: "HOST_BLOCKED" };
95
+ } catch {
96
+ return { ok: false, reason: "DNS_FAILED" };
97
+ }
98
+ return { ok: true, href: parsed.href };
99
+ }
100
+ async function defaultLookup(hostname) {
101
+ if (isIP(hostname)) return [hostname];
102
+ const v4 = await dnsLookup(hostname, { all: true, verbatim: true });
103
+ return v4.map((row) => row.address);
104
+ }
105
+
106
+ export {
107
+ runFetchGuard,
108
+ runFetchGuardSync,
109
+ assertPublicHttpsUrl,
110
+ defaultLookup
111
+ };