@namewta/speculo 2.0.6 → 2.1.1
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 -0
- package/THIRD-PARTY-NOTICES.md +4 -0
- package/dist/src/agent-skills.d.ts +5 -0
- package/dist/src/agent-skills.js +10 -7
- package/dist/src/agent-skills.js.map +1 -1
- package/dist/src/cli.js +25 -36
- package/dist/src/cli.js.map +1 -1
- package/dist/src/coordination.d.ts +3 -3
- package/dist/src/coordination.js +21 -4
- package/dist/src/coordination.js.map +1 -1
- package/dist/src/doctor.js +8 -1
- package/dist/src/doctor.js.map +1 -1
- package/dist/src/external-files.d.ts +4 -2
- package/dist/src/external-files.js +4 -4
- package/dist/src/external-files.js.map +1 -1
- package/dist/src/hub-catalog.d.ts +11 -0
- package/dist/src/hub-catalog.js +91 -0
- package/dist/src/hub-catalog.js.map +1 -0
- package/dist/src/hub-resources.json +1 -0
- package/dist/src/hub-skills.d.ts +53 -0
- package/dist/src/hub-skills.js +157 -0
- package/dist/src/hub-skills.js.map +1 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.js +48 -47
- package/dist/src/index.js.map +1 -1
- package/dist/src/install-ui.d.ts +16 -7
- package/dist/src/install-ui.js +143 -92
- package/dist/src/install-ui.js.map +1 -1
- package/dist/src/manifest.d.ts +2 -0
- package/dist/src/manifest.js +2 -0
- package/dist/src/manifest.js.map +1 -1
- package/dist/src/refresh.d.ts +1 -0
- package/dist/src/refresh.js +13 -10
- package/dist/src/refresh.js.map +1 -1
- package/dist/src/retained-workflows.d.ts +10 -0
- package/dist/src/retained-workflows.js +25 -0
- package/dist/src/retained-workflows.js.map +1 -0
- package/dist/src/runtime-entry.d.ts +1 -0
- package/dist/src/runtime-entry.js +1 -0
- package/dist/src/runtime-entry.js.map +1 -1
- package/dist/src/skill-trees.d.ts +27 -0
- package/dist/src/skill-trees.js +118 -0
- package/dist/src/skill-trees.js.map +1 -0
- package/dist/src/terminal-ui.d.ts +30 -0
- package/dist/src/terminal-ui.js +148 -0
- package/dist/src/terminal-ui.js.map +1 -0
- package/dist/src/transaction.d.ts +3 -14
- package/dist/src/transaction.js +20 -36
- package/dist/src/transaction.js.map +1 -1
- package/dist/src/workflow-install.d.ts +15 -0
- package/dist/src/workflow-install.js +104 -0
- package/dist/src/workflow-install.js.map +1 -0
- package/dist/src/workflows.js +1 -1
- package/dist/src/workflows.js.map +1 -1
- package/package.json +6 -2
- package/skills-hub/automation/grok-bot-team-steward/CHEATSHEET.md +17 -0
- package/skills-hub/automation/grok-bot-team-steward/INSTALL.md +23 -0
- package/skills-hub/automation/grok-bot-team-steward/LICENSE +21 -0
- package/skills-hub/automation/grok-bot-team-steward/README.md +9 -0
- package/skills-hub/automation/grok-bot-team-steward/SKILL.md +52 -0
- package/skills-hub/automation/grok-bot-team-steward/agents/openai.yaml +4 -0
- package/skills-hub/automation/grok-bot-team-steward/references/00-hard-rules.md +50 -0
- package/skills-hub/automation/grok-bot-team-steward/references/01-snapshot-schema.md +84 -0
- package/skills-hub/automation/grok-bot-team-steward/references/02-export-protocol.md +57 -0
- package/skills-hub/automation/grok-bot-team-steward/references/03-restore-protocol.md +64 -0
- package/skills-hub/automation/grok-bot-team-steward/references/04-inventory.md +37 -0
- package/skills-hub/automation/grok-bot-team-steward/references/05-conversations.md +71 -0
- package/skills-hub/automation/grok-bot-team-steward/references/06-sanitizer.md +39 -0
- package/skills-hub/automation/grok-bot-team-steward/references/07-prompts.md +87 -0
- package/skills-hub/automation/grok-bot-team-steward/references/08-verification.md +30 -0
- package/skills-hub/automation/grok-bot-team-steward/references/09-sources.md +31 -0
- package/skills-hub/automation/grok-bot-team-steward/scripts/scrub.sh +17 -0
- package/skills-hub/automation/grok-bot-team-steward/scripts/snapshot-name.sh +18 -0
- package/skills-hub/automation/grok-bot-team-steward/scripts/validate-snapshot.sh +62 -0
- package/skills-hub/automation/grok-bot-team-steward/steward/ACTIVATE.md +58 -0
- package/skills-hub/automation/grok-bot-team-steward/steward/SETUP-INSTRUCTIONS.md +33 -0
- package/skills-hub/automation/grok-bot-team-steward/steward/STEWARD-PROFILE.md +28 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/CHANGELOG.md +3 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/CHARTER.md +27 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/DROP-LIST.md +10 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/GAPS.md +6 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/INIT.md +14 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/MANIFEST.md +30 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/MANIFEST.yaml +20 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/ORG.md +15 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/README.md +8 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/RESTORE.md +13 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/ROSTER.md +11 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/GAPS.md +7 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/MEMORY.md +9 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/PROFILE.md +27 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/agent-spec.md +9 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/conversations/INDEX.md +5 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/conversations/main.md +9 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/routines.md +5 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/bots/_SLUG/skills.md +5 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/connectors.md +7 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/meta/COMPLETED.md +6 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/meta/CREATED.md +6 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/meta/RESTORE-NOTES.md +13 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/meta/SANITIZER.md +7 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/meta/SOURCE.md +8 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/rooms/_ROOM.md +8 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/routines/_ROUTINE.md +12 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/shared/shared-memory.md +5 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/shared/workspace-map.md +5 -0
- package/skills-hub/automation/grok-bot-team-steward/templates/snapshot/skills/_SKILL/SKILL.md +18 -0
- package/skills-hub/automation/herdr/SKILL.md +246 -0
- package/skills-hub/automation/orca/SKILL.md +328 -0
- package/skills-hub/coding/gitea-repo/LICENSE +21 -0
- package/skills-hub/coding/gitea-repo/SKILL.md +50 -0
- package/skills-hub/coding/gitea-repo/agents/openai.yaml +4 -0
- package/skills-hub/coding/gitea-repo/references/auth-and-scopes.md +58 -0
- package/skills-hub/coding/gitea-repo/references/endpoint-map.md +80 -0
- package/skills-hub/coding/gitea-repo/references/pagination-and-errors.md +34 -0
- package/skills-hub/coding/gitea-repo/scripts/gitea_api.py +814 -0
- package/skills-hub/coding/github-repo-steward/LICENSE +21 -0
- package/skills-hub/coding/github-repo-steward/SKILL.md +48 -0
- package/skills-hub/coding/github-repo-steward/agents/openai.yaml +4 -0
- package/skills-hub/coding/github-repo-steward/references/00-auth-and-tokens.md +73 -0
- package/skills-hub/coding/github-repo-steward/references/01-inventory.md +55 -0
- package/skills-hub/coding/github-repo-steward/references/02-lifecycle.md +57 -0
- package/skills-hub/coding/github-repo-steward/references/03-stars.md +42 -0
- package/skills-hub/coding/github-repo-steward/references/04-hygiene.md +40 -0
- package/skills-hub/coding/github-repo-steward/references/05-sources.md +42 -0
- package/skills-hub/coding/github-repo-steward/scripts/inventory.sh +64 -0
- package/skills-hub/coding/vscode-fullstack/LICENSE +21 -0
- package/skills-hub/coding/vscode-fullstack/SKILL.md +47 -0
- package/skills-hub/coding/vscode-fullstack/agents/openai.yaml +4 -0
- package/skills-hub/coding/vscode-fullstack/references/extensions-and-settings.md +181 -0
- package/skills-hub/coding/vscode-fullstack/references/profiles-and-validation.md +62 -0
- package/skills-hub/coding/vscode-fullstack/references/runtime-reuse.md +52 -0
- package/skills-hub/design/photo-retouch/LICENSE +21 -0
- package/skills-hub/design/photo-retouch/SKILL.md +50 -0
- package/skills-hub/design/photo-retouch/agents/openai.yaml +4 -0
- package/skills-hub/design/photo-retouch/references/basic-retouch.md +58 -0
- package/skills-hub/design/photo-retouch/references/formal-portrait.md +57 -0
- package/skills-hub/design/photo-retouch/references/object-and-canvas.md +82 -0
- package/skills-hub/design/photo-retouch/references/product-photo.md +41 -0
- package/skills-hub/design/photo-retouch/references/repair-and-look.md +61 -0
- package/skills-hub/design/photo-retouch/references/social-effects.md +55 -0
- package/skills-hub/design/photo-retouch/references/travel-creative.md +79 -0
- package/skills-hub/system/clash-client-profile/LICENSE +21 -0
- package/skills-hub/system/clash-client-profile/SKILL.md +79 -0
- package/skills-hub/system/clash-client-profile/agents/openai.yaml +4 -0
- package/skills-hub/system/clash-client-profile/references/acceptance.md +81 -0
- package/skills-hub/system/clash-client-profile/references/browser-privacy.md +35 -0
- package/skills-hub/system/clash-client-profile/references/clash-verge.md +40 -0
- package/skills-hub/system/clash-client-profile/references/dns-workflow.md +147 -0
- package/skills-hub/system/clash-client-profile/references/flclash.md +24 -0
- package/skills-hub/system/clash-client-profile/references/network-performance.md +25 -0
- package/skills-hub/system/clash-client-profile/references/platform-dns.md +109 -0
- package/skills-hub/system/clash-client-profile/references/sources.md +46 -0
- package/skills-hub/system/clash-client-profile/references/troubleshooting.md +82 -0
- package/skills-hub/system/clash-client-profile/scripts/dns_guard.py +650 -0
- package/skills-hub/system/clash-client-profile/scripts/proxy_doctor.py +213 -0
- package/skills-hub/system/clash-client-profile/scripts/render_rules.py +34 -0
- package/skills-hub/system/clash-client-profile/templates/ai-rules.yaml +18 -0
- package/skills-hub/system/clash-client-profile/templates/dns-request.example.json +9 -0
- package/skills-hub/system/clash-client-profile/templates/dns.yaml +8 -0
- package/skills-hub/system/linux-dev-disk-cleanup/LICENSE +21 -0
- package/skills-hub/system/linux-dev-disk-cleanup/SKILL.md +42 -0
- package/skills-hub/system/linux-dev-disk-cleanup/agents/openai.yaml +4 -0
- package/skills-hub/system/linux-dev-disk-cleanup/references/linux-cleanup-workflow.md +145 -0
- package/skills-hub/system/optimize-codex-config/LICENSE +21 -0
- package/skills-hub/system/optimize-codex-config/SKILL.md +101 -0
- package/skills-hub/system/optimize-codex-config/agents/openai.yaml +4 -0
- package/skills-hub/system/optimize-codex-config/assets/capabilities.example.json +22 -0
- package/skills-hub/system/optimize-codex-config/references/cli.md +35 -0
- package/skills-hub/system/optimize-codex-config/references/configuration-contract.md +33 -0
- package/skills-hub/system/optimize-codex-config/references/optimization-method.md +38 -0
- package/skills-hub/system/optimize-codex-config/references/privacy.md +41 -0
- package/skills-hub/system/optimize-codex-config/references/sources.md +24 -0
- package/skills-hub/system/optimize-codex-config/references/statusline.md +31 -0
- package/skills-hub/system/optimize-codex-config/references/transactions.md +32 -0
- package/skills-hub/system/optimize-codex-config/references/troubleshooting.md +95 -0
- package/skills-hub/system/optimize-codex-config/scripts/adapters/claude.mjs +24 -0
- package/skills-hub/system/optimize-codex-config/scripts/adapters/codex.mjs +10 -0
- package/skills-hub/system/optimize-codex-config/scripts/ai-cli-config.mjs +67 -0
- package/skills-hub/system/optimize-codex-config/scripts/audit-codex-config.mjs +762 -0
- package/skills-hub/system/optimize-codex-config/scripts/lib/document.mjs +166 -0
- package/skills-hub/system/optimize-codex-config/scripts/lib/inspect.mjs +211 -0
- package/skills-hub/system/optimize-codex-config/scripts/lib/io.mjs +104 -0
- package/skills-hub/system/optimize-codex-config/scripts/lib/plan.mjs +79 -0
- package/skills-hub/system/optimize-codex-config/scripts/lib/transaction.mjs +205 -0
- package/skills-hub/system/optimize-codex-config/scripts/lib/writers.mjs +46 -0
- package/skills-hub/system/optimize-codex-config/scripts/statusline/claude-statusline.mjs +94 -0
- package/skills-hub/system/optimize-codex-config/scripts/vendor/THIRD-PARTY-NOTICES.txt +250 -0
- package/skills-hub/system/optimize-codex-config/scripts/vendor/build-package-lock.json +488 -0
- package/skills-hub/system/optimize-codex-config/scripts/vendor/manifest.json +14 -0
- package/skills-hub/system/optimize-codex-config/scripts/vendor/parsers.mjs +16 -0
- package/skills-hub/system/proxy-region-locale/LICENSE +21 -0
- package/skills-hub/system/proxy-region-locale/SKILL.md +42 -0
- package/skills-hub/system/proxy-region-locale/agents/openai.yaml +4 -0
- package/skills-hub/system/proxy-region-locale/references/linux.md +35 -0
- package/skills-hub/system/proxy-region-locale/references/macos.md +31 -0
- package/skills-hub/system/proxy-region-locale/references/windows.md +45 -0
- package/skills-hub/system/system-health-audit/LICENSE +21 -0
- package/skills-hub/system/system-health-audit/SKILL.md +41 -0
- package/skills-hub/system/system-health-audit/agents/openai.yaml +4 -0
- package/skills-hub/system/system-health-audit/references/platforms.md +37 -0
- package/skills-hub/system/system-health-audit/scripts/system_audit.py +41 -0
- package/skills-hub/system/windows-dev-disk-cleanup/LICENSE +21 -0
- package/skills-hub/system/windows-dev-disk-cleanup/SKILL.md +40 -0
- package/skills-hub/system/windows-dev-disk-cleanup/agents/openai.yaml +4 -0
- package/skills-hub/system/windows-dev-disk-cleanup/references/windows-cleanup-workflow.md +121 -0
- package/skills-hub/writing/.gitkeep +0 -0
- package/skills-hub/writing/job-application/LICENSE +21 -0
- package/skills-hub/writing/job-application/SKILL.md +160 -0
- package/skills-hub/writing/job-application/agents/openai.yaml +4 -0
- package/skills-hub/writing/job-application/assets/resume.css +10 -0
- package/skills-hub/writing/job-application/config.example.json +9 -0
- package/skills-hub/writing/job-application/references/company-research.md +7 -0
- package/skills-hub/writing/job-application/references/corpus-schema.md +33 -0
- package/skills-hub/writing/job-application/references/honesty-gate.md +29 -0
- package/skills-hub/writing/job-application/references/improvement-plan.md +15 -0
- package/skills-hub/writing/job-application/references/ingest-protocol.md +18 -0
- package/skills-hub/writing/job-application/references/interview-speech.md +16 -0
- package/skills-hub/writing/job-application/references/jd-parse.md +18 -0
- package/skills-hub/writing/job-application/references/persist-paths.md +34 -0
- package/skills-hub/writing/job-application/references/question-bank.md +19 -0
- package/skills-hub/writing/job-application/references/rendering.md +9 -0
- package/skills-hub/writing/job-application/references/resume-playbook.md +30 -0
- package/skills-hub/writing/job-application/scripts/README.md +12 -0
- package/skills-hub/writing/job-application/scripts/ingest_kb.py +188 -0
- package/skills-hub/writing/job-application/scripts/render_resume.py +144 -0
- package/skills-hub/writing/job-application/scripts/validate_claims.py +52 -0
- package/skills-hub/writing/job-application/scripts/write_config.py +72 -0
- package/skills-hub/writing/job-application/templates/application-index.md +10 -0
- package/skills-hub/writing/job-application/templates/brief.md +16 -0
- package/skills-hub/writing/job-application/templates/changelog.md +6 -0
- package/skills-hub/writing/job-application/templates/company-research.md +15 -0
- package/skills-hub/writing/job-application/templates/corpus.md +11 -0
- package/skills-hub/writing/job-application/templates/evidence-map.md +5 -0
- package/skills-hub/writing/job-application/templates/framings.md +6 -0
- package/skills-hub/writing/job-application/templates/improvement-plan.md +16 -0
- package/skills-hub/writing/job-application/templates/ingest-log.md +4 -0
- package/skills-hub/writing/job-application/templates/known-gaps.md +4 -0
- package/skills-hub/writing/job-application/templates/match-report.md +21 -0
- package/skills-hub/writing/job-application/templates/methodology-cache.md +10 -0
- package/skills-hub/writing/job-application/templates/persist-index.md +11 -0
- package/skills-hub/writing/job-application/templates/profile.md +21 -0
- package/skills-hub/writing/job-application/templates/questions.md +22 -0
- package/skills-hub/writing/job-application/templates/resume-original.md +10 -0
- package/skills-hub/writing/job-application/templates/resume-tailored.md +21 -0
- package/skills-hub/writing/job-application/templates/sources-index.md +6 -0
- package/skills-hub/writing/job-application/templates/speech.md +19 -0
- package/skills-hub/writing/job-application/templates/stories.md +9 -0
- package/skills-hub/writing/job-application/templates/story-bank.md +11 -0
- package/skills-hub/writing/job-application/templates/strengths.md +4 -0
- package/skills-hub/writing/job-application/templates/style-memory.md +7 -0
- package/skills-hub/writing/ste-zh/LICENSE +21 -0
- package/skills-hub/writing/ste-zh/NOTICE.md +9 -0
- package/skills-hub/writing/ste-zh/SKILL.md +130 -0
- package/skills-hub/writing/ste-zh/agents/openai.yaml +6 -0
- package/skills-hub/writing/ste-zh/examples/zh-report.md +23 -0
- package/skills-hub/writing/ste-zh/references/english-modes.md +13 -0
- package/skills-hub/writing/ste-zh/references/terminology.md +13 -0
- package/skills-hub/writing/ste-zh/references/zh-rules.md +29 -0
- package/template/.speculo/refresh-contract.json +2 -0
- package/template/canonical/canonical-specdev-goal-plan.md +33 -25
- package/template/canonical/canonical-specdev-grill-with-docs.md +214 -206
- package/template/canonical/canonical-specdev-spec.md +214 -206
- package/template/canonical/canonical-specdev-tickets.md +214 -206
- package/template/canonical/canonical-specdev-wayfinder.md +214 -206
- package/template/lib/speculo-runtime.mjs +183 -8
- package/template/references/coordination/coordination-contract.md +11 -3
- package/template/references/coordination/modes/cli.md +2 -2
- package/template/references/coordination/modes/herdr.md +9 -9
- package/template/references/coordination/modes/orca.md +11 -11
- package/template/references/coordination/project-facts.schema.json +1 -0
- package/template/workflows/specdev/specdev-i-init-setup/SKILL.md +7 -6
- package/template/workflows/specdev/specdev-i-init-setup/references/first-setup.md +30 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type SkillNode } from "./skill-trees.js";
|
|
2
|
+
export type HubSkill = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
root: string;
|
|
7
|
+
tree: Map<string, SkillNode>;
|
|
8
|
+
};
|
|
9
|
+
export type HubCatalog = Map<string, HubSkill>;
|
|
10
|
+
/** Only category/name is a public entry. Nested SKILL.md files are package resources. */
|
|
11
|
+
export declare function discoverHubCatalog(packageRoot: string): Promise<HubCatalog>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { readFile, readdir } from "node:fs/promises";
|
|
2
|
+
import { join, posix } from "node:path";
|
|
3
|
+
import { parseFrontmatter, readAssetCatalog, validateSkill } from "./assets.js";
|
|
4
|
+
import { safeRelativePath } from "./paths.js";
|
|
5
|
+
import { snapshotSkillTree, validSkillNode } from "./skill-trees.js";
|
|
6
|
+
const SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
7
|
+
/** Only category/name is a public entry. Nested SKILL.md files are package resources. */
|
|
8
|
+
export async function discoverHubCatalog(packageRoot) {
|
|
9
|
+
const root = join(packageRoot, "skills-hub"), catalog = new Map();
|
|
10
|
+
// npm omits .gitignore and normalizes modes. The build snapshot preserves the
|
|
11
|
+
// complete source package; any shipped source bytes that differ are rejected.
|
|
12
|
+
let bundle;
|
|
13
|
+
try {
|
|
14
|
+
bundle = JSON.parse(await readFile(join(packageRoot, "dist/src/hub-resources.json"), "utf8"));
|
|
15
|
+
}
|
|
16
|
+
catch (e) {
|
|
17
|
+
if (e.code !== "ENOENT")
|
|
18
|
+
throw e;
|
|
19
|
+
}
|
|
20
|
+
if (bundle && (bundle.schema_version !== 1 || !Array.isArray(bundle.packages) || new Set(bundle.packages.map(p => p.id)).size !== bundle.packages.length))
|
|
21
|
+
throw new Error("invalid-hub-bundle");
|
|
22
|
+
const names = new Set((await readAssetCatalog(join(packageRoot, "template"))).assets.map(a => a.name));
|
|
23
|
+
const categories = await readdir(root, { withFileTypes: true }).catch((e) => { if (e.code === "ENOENT")
|
|
24
|
+
return []; throw e; });
|
|
25
|
+
for (const category of categories.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
26
|
+
if (category.isSymbolicLink())
|
|
27
|
+
throw new Error("hub-source-symlink: " + category.name);
|
|
28
|
+
if (!category.isDirectory())
|
|
29
|
+
continue;
|
|
30
|
+
if (!SLUG.test(category.name))
|
|
31
|
+
throw new Error("invalid-hub-category: " + category.name);
|
|
32
|
+
for (const entry of (await readdir(join(root, category.name), { withFileTypes: true })).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
33
|
+
if (entry.isSymbolicLink())
|
|
34
|
+
throw new Error("hub-source-symlink: " + entry.name);
|
|
35
|
+
if (!entry.isDirectory())
|
|
36
|
+
continue;
|
|
37
|
+
const source = join(root, category.name, entry.name), content = await readFile(join(source, "SKILL.md"));
|
|
38
|
+
const errors = validateSkill(content, entry.name);
|
|
39
|
+
if (errors.length)
|
|
40
|
+
throw new Error(`invalid-hub-skill: ${category.name}/${entry.name}: ${errors.join("; ")}`);
|
|
41
|
+
if (names.has(entry.name))
|
|
42
|
+
throw new Error("duplicate-skill-name: " + entry.name);
|
|
43
|
+
names.add(entry.name);
|
|
44
|
+
const id = `${category.name}/${entry.name}`;
|
|
45
|
+
let tree = await snapshotSkillTree(source, { source: true });
|
|
46
|
+
if (bundle) {
|
|
47
|
+
const packaged = bundle.packages.find(p => p.id === id);
|
|
48
|
+
if (!packaged || !Array.isArray(packaged.nodes))
|
|
49
|
+
throw new Error("missing-hub-bundle-package: " + id);
|
|
50
|
+
const original = new Map();
|
|
51
|
+
for (const { path, node } of packaged.nodes) {
|
|
52
|
+
if (typeof path !== "string" || path && (!safeRelativePath(path) || path.endsWith("/")) || original.has(path) || !validSkillNode(node) || node.kind === "absent")
|
|
53
|
+
throw new Error("invalid-hub-bundle-node");
|
|
54
|
+
original.set(path, process.platform === "win32" ? { ...node, mode: node.kind === "directory" ? 0o755 : node.mode & 0o200 ? 0o666 : 0o444 } : node);
|
|
55
|
+
}
|
|
56
|
+
if (original.get("")?.kind !== "directory" || original.get("SKILL.md")?.kind !== "file")
|
|
57
|
+
throw new Error("invalid-hub-bundle-root");
|
|
58
|
+
for (const [path, node] of original)
|
|
59
|
+
if (path && original.get(posix.dirname(path) === "." ? "" : posix.dirname(path))?.kind !== "directory")
|
|
60
|
+
throw new Error("invalid-hub-bundle-parent");
|
|
61
|
+
for (const [path, node] of tree) {
|
|
62
|
+
const expected = original.get(path);
|
|
63
|
+
if (!expected || expected.kind !== node.kind || node.kind === "file" && (expected.kind !== "file" || expected.content !== node.content))
|
|
64
|
+
throw new Error(`stale-hub-bundle: ${id}/${path}; rebuild from skills-hub`);
|
|
65
|
+
}
|
|
66
|
+
tree = original;
|
|
67
|
+
}
|
|
68
|
+
// Markdown links to package resources must stay in this complete package.
|
|
69
|
+
for (const [path, node] of tree)
|
|
70
|
+
if (node.kind === "file" && path.endsWith(".md")) {
|
|
71
|
+
const text = Buffer.from(node.content, "base64").toString("utf8").replace(/```[^]*?```/g, "");
|
|
72
|
+
for (const match of text.matchAll(/\[[^\]]*\]\(([^\s)]+)(?:\s+"[^"]*")?\)/g)) {
|
|
73
|
+
const link = match[1];
|
|
74
|
+
if (/^(?:[a-z][a-z0-9+.-]*:|#|\/)/i.test(link) || /[<>${}]/.test(link))
|
|
75
|
+
continue;
|
|
76
|
+
const resource = decodeURIComponent(link.split("#")[0]);
|
|
77
|
+
if (!resource)
|
|
78
|
+
continue;
|
|
79
|
+
const resolved = posix.normalize(posix.join(posix.dirname(path), resource)).replace(/\/$/, "");
|
|
80
|
+
if (!safeRelativePath(resolved) || !tree.has(resolved))
|
|
81
|
+
throw new Error(`hub-resource-link: ${category.name}/${entry.name}/${path}: ${link}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catalog.set(id, { id, name: entry.name, description: String(parseFrontmatter(content).fields.description), root: source, tree });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (bundle && bundle.packages.some(p => !catalog.has(p.id)))
|
|
88
|
+
throw new Error("hub-bundle-catalog-mismatch");
|
|
89
|
+
return catalog;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=hub-catalog.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