@backendkit-labs/agent-coding 0.28.5 → 0.30.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/README.md +4 -0
- package/dist/__tests__/cli-baseline.test.d.ts +2 -0
- package/dist/__tests__/cli-baseline.test.d.ts.map +1 -0
- package/dist/__tests__/cli-baseline.test.js +114 -0
- package/dist/__tests__/cli-baseline.test.js.map +1 -0
- package/dist/__tests__/context-hooks.test.d.ts +2 -0
- package/dist/__tests__/context-hooks.test.d.ts.map +1 -0
- package/dist/__tests__/context-hooks.test.js +21 -0
- package/dist/__tests__/context-hooks.test.js.map +1 -0
- package/dist/__tests__/createCodingEngine.forwarding.test.js +2 -1
- package/dist/__tests__/createCodingEngine.forwarding.test.js.map +1 -1
- package/dist/__tests__/sandbox.test.js +1 -1
- package/dist/__tests__/sandbox.test.js.map +1 -1
- package/dist/__tests__/workspace-trust.test.js +7 -5
- package/dist/__tests__/workspace-trust.test.js.map +1 -1
- package/dist/agents/AgentLoader.d.ts.map +1 -1
- package/dist/agents/AgentLoader.js +2 -1
- package/dist/agents/AgentLoader.js.map +1 -1
- package/dist/cli/agent-discovery/AgentPackageLoader.d.ts +22 -0
- package/dist/cli/agent-discovery/AgentPackageLoader.d.ts.map +1 -0
- package/dist/cli/agent-discovery/AgentPackageLoader.js +100 -0
- package/dist/cli/agent-discovery/AgentPackageLoader.js.map +1 -0
- package/dist/cli/agent-discovery/RemoteAgentRegistry.d.ts +31 -0
- package/dist/cli/agent-discovery/RemoteAgentRegistry.d.ts.map +1 -0
- package/dist/cli/agent-discovery/RemoteAgentRegistry.js +106 -0
- package/dist/cli/agent-discovery/RemoteAgentRegistry.js.map +1 -0
- package/dist/cli/agent-discovery/__tests__/RemoteAgentRegistry.ssrf.test.d.ts +2 -0
- package/dist/cli/agent-discovery/__tests__/RemoteAgentRegistry.ssrf.test.d.ts.map +1 -0
- package/dist/cli/agent-discovery/__tests__/RemoteAgentRegistry.ssrf.test.js +34 -0
- package/dist/cli/agent-discovery/__tests__/RemoteAgentRegistry.ssrf.test.js.map +1 -0
- package/dist/cli/agent-discovery/__tests__/discoverAgents.test.d.ts +2 -0
- package/dist/cli/agent-discovery/__tests__/discoverAgents.test.d.ts.map +1 -0
- package/dist/cli/agent-discovery/__tests__/discoverAgents.test.js +147 -0
- package/dist/cli/agent-discovery/__tests__/discoverAgents.test.js.map +1 -0
- package/dist/cli/agent-discovery/__tests__/download-guard.test.d.ts +2 -0
- package/dist/cli/agent-discovery/__tests__/download-guard.test.d.ts.map +1 -0
- package/dist/cli/agent-discovery/__tests__/download-guard.test.js +47 -0
- package/dist/cli/agent-discovery/__tests__/download-guard.test.js.map +1 -0
- package/dist/cli/agent-discovery/discoverAgents.d.ts +21 -0
- package/dist/cli/agent-discovery/discoverAgents.d.ts.map +1 -0
- package/dist/cli/agent-discovery/discoverAgents.js +74 -0
- package/dist/cli/agent-discovery/discoverAgents.js.map +1 -0
- package/dist/cli/agent-discovery/download-guard.d.ts +20 -0
- package/dist/cli/agent-discovery/download-guard.d.ts.map +1 -0
- package/dist/cli/agent-discovery/download-guard.js +84 -0
- package/dist/cli/agent-discovery/download-guard.js.map +1 -0
- package/dist/cli/agent-discovery/index.d.ts +5 -0
- package/dist/cli/agent-discovery/index.d.ts.map +1 -0
- package/dist/cli/agent-discovery/index.js +12 -0
- package/dist/cli/agent-discovery/index.js.map +1 -0
- package/dist/cli/agent-discovery/types.d.ts +48 -0
- package/dist/cli/agent-discovery/types.d.ts.map +1 -0
- package/dist/cli/agent-discovery/types.js +3 -0
- package/dist/cli/agent-discovery/types.js.map +1 -0
- package/dist/cli/bootstrap/GlobalSeed.d.ts +46 -0
- package/dist/cli/bootstrap/GlobalSeed.d.ts.map +1 -0
- package/dist/cli/bootstrap/GlobalSeed.js +285 -0
- package/dist/cli/bootstrap/GlobalSeed.js.map +1 -0
- package/dist/cli/bootstrap/config.d.ts +24 -0
- package/dist/cli/bootstrap/config.d.ts.map +1 -0
- package/dist/cli/bootstrap/config.js +71 -0
- package/dist/cli/bootstrap/config.js.map +1 -0
- package/dist/cli/checkpoint/index.d.ts +17 -0
- package/dist/cli/checkpoint/index.d.ts.map +1 -0
- package/dist/cli/checkpoint/index.js +207 -0
- package/dist/cli/checkpoint/index.js.map +1 -0
- package/dist/cli/commands/builtin.d.ts +7 -0
- package/dist/cli/commands/builtin.d.ts.map +1 -0
- package/dist/cli/commands/builtin.js +962 -0
- package/dist/cli/commands/builtin.js.map +1 -0
- package/dist/cli/context/__tests__/formatPipeline.test.d.ts +2 -0
- package/dist/cli/context/__tests__/formatPipeline.test.d.ts.map +1 -0
- package/dist/cli/context/__tests__/formatPipeline.test.js +25 -0
- package/dist/cli/context/__tests__/formatPipeline.test.js.map +1 -0
- package/dist/cli/context/index.d.ts +8 -0
- package/dist/cli/context/index.d.ts.map +1 -0
- package/dist/cli/context/index.js +8 -0
- package/dist/cli/context/index.js.map +1 -0
- package/dist/cli/context/pipeline.d.ts +46 -0
- package/dist/cli/context/pipeline.d.ts.map +1 -0
- package/dist/cli/context/pipeline.js +112 -0
- package/dist/cli/context/pipeline.js.map +1 -0
- package/dist/cli/context/stages/stage-instructions.d.ts +12 -0
- package/dist/cli/context/stages/stage-instructions.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-instructions.js +76 -0
- package/dist/cli/context/stages/stage-instructions.js.map +1 -0
- package/dist/cli/context/stages/stage-lessons.d.ts +13 -0
- package/dist/cli/context/stages/stage-lessons.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-lessons.js +83 -0
- package/dist/cli/context/stages/stage-lessons.js.map +1 -0
- package/dist/cli/context/stages/stage-manifest.d.ts +11 -0
- package/dist/cli/context/stages/stage-manifest.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-manifest.js +62 -0
- package/dist/cli/context/stages/stage-manifest.js.map +1 -0
- package/dist/cli/context/stages/stage-project.d.ts +10 -0
- package/dist/cli/context/stages/stage-project.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-project.js +55 -0
- package/dist/cli/context/stages/stage-project.js.map +1 -0
- package/dist/cli/context/stages/stage-session.d.ts +12 -0
- package/dist/cli/context/stages/stage-session.d.ts.map +1 -0
- package/dist/cli/context/stages/stage-session.js +69 -0
- package/dist/cli/context/stages/stage-session.js.map +1 -0
- package/dist/cli/file-sources.d.ts +17 -0
- package/dist/cli/file-sources.d.ts.map +1 -0
- package/dist/cli/file-sources.js +42 -0
- package/dist/cli/file-sources.js.map +1 -0
- package/dist/cli/index.d.ts +26 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +55 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/skills/__tests__/SkillLoader.test.d.ts +2 -0
- package/dist/cli/skills/__tests__/SkillLoader.test.d.ts.map +1 -0
- package/dist/cli/skills/__tests__/SkillLoader.test.js +285 -0
- package/dist/cli/skills/__tests__/SkillLoader.test.js.map +1 -0
- package/dist/cli/skills/__tests__/SkillManager.safety.test.d.ts +2 -0
- package/dist/cli/skills/__tests__/SkillManager.safety.test.d.ts.map +1 -0
- package/dist/cli/skills/__tests__/SkillManager.safety.test.js +87 -0
- package/dist/cli/skills/__tests__/SkillManager.safety.test.js.map +1 -0
- package/dist/cli/skills/__tests__/stack.test.d.ts +2 -0
- package/dist/cli/skills/__tests__/stack.test.d.ts.map +1 -0
- package/dist/cli/skills/__tests__/stack.test.js +81 -0
- package/dist/cli/skills/__tests__/stack.test.js.map +1 -0
- package/dist/cli/skills/loader.d.ts +42 -0
- package/dist/cli/skills/loader.d.ts.map +1 -0
- package/dist/cli/skills/loader.js +158 -0
- package/dist/cli/skills/loader.js.map +1 -0
- package/dist/cli/skills/manager.d.ts +97 -0
- package/dist/cli/skills/manager.d.ts.map +1 -0
- package/dist/cli/skills/manager.js +304 -0
- package/dist/cli/skills/manager.js.map +1 -0
- package/dist/cli/skills/parse-md-skill.d.ts +14 -0
- package/dist/cli/skills/parse-md-skill.d.ts.map +1 -0
- package/dist/cli/skills/parse-md-skill.js +86 -0
- package/dist/cli/skills/parse-md-skill.js.map +1 -0
- package/dist/cli/skills/providers/github.d.ts +21 -0
- package/dist/cli/skills/providers/github.d.ts.map +1 -0
- package/dist/cli/skills/providers/github.js +146 -0
- package/dist/cli/skills/providers/github.js.map +1 -0
- package/dist/cli/skills/providers/index.d.ts +6 -0
- package/dist/cli/skills/providers/index.d.ts.map +1 -0
- package/dist/cli/skills/providers/index.js +12 -0
- package/dist/cli/skills/providers/index.js.map +1 -0
- package/dist/cli/skills/providers/local.d.ts +16 -0
- package/dist/cli/skills/providers/local.d.ts.map +1 -0
- package/dist/cli/skills/providers/local.js +91 -0
- package/dist/cli/skills/providers/local.js.map +1 -0
- package/dist/cli/skills/providers/obsidian.d.ts +31 -0
- package/dist/cli/skills/providers/obsidian.d.ts.map +1 -0
- package/dist/cli/skills/providers/obsidian.js +141 -0
- package/dist/cli/skills/providers/obsidian.js.map +1 -0
- package/dist/cli/skills/providers/skills-sh.d.ts +32 -0
- package/dist/cli/skills/providers/skills-sh.d.ts.map +1 -0
- package/dist/cli/skills/providers/skills-sh.js +53 -0
- package/dist/cli/skills/providers/skills-sh.js.map +1 -0
- package/dist/cli/skills/providers/types.d.ts +25 -0
- package/dist/cli/skills/providers/types.d.ts.map +1 -0
- package/dist/cli/skills/providers/types.js +3 -0
- package/dist/cli/skills/providers/types.js.map +1 -0
- package/dist/cli/skills/safe-name.d.ts +2 -0
- package/dist/cli/skills/safe-name.d.ts.map +1 -0
- package/dist/cli/skills/safe-name.js +22 -0
- package/dist/cli/skills/safe-name.js.map +1 -0
- package/dist/cli/skills/stack.d.ts +3 -0
- package/dist/cli/skills/stack.d.ts.map +1 -0
- package/dist/cli/skills/stack.js +64 -0
- package/dist/cli/skills/stack.js.map +1 -0
- package/dist/cli/skills/types.d.ts +28 -0
- package/dist/cli/skills/types.d.ts.map +1 -0
- package/dist/cli/skills/types.js +3 -0
- package/dist/cli/skills/types.js.map +1 -0
- package/dist/cli/trust/__tests__/workspace-trust.test.d.ts +2 -0
- package/dist/cli/trust/__tests__/workspace-trust.test.d.ts.map +1 -0
- package/dist/cli/trust/__tests__/workspace-trust.test.js +252 -0
- package/dist/cli/trust/__tests__/workspace-trust.test.js.map +1 -0
- package/dist/cli/trust/workspace-trust.d.ts +49 -0
- package/dist/cli/trust/workspace-trust.d.ts.map +1 -0
- package/dist/cli/trust/workspace-trust.js +163 -0
- package/dist/cli/trust/workspace-trust.js.map +1 -0
- package/dist/cli/workspace/index.d.ts +68 -0
- package/dist/cli/workspace/index.d.ts.map +1 -0
- package/dist/cli/workspace/index.js +231 -0
- package/dist/cli/workspace/index.js.map +1 -0
- package/dist/context-hooks.d.ts +11 -0
- package/dist/context-hooks.d.ts.map +1 -0
- package/dist/context-hooks.js +23 -0
- package/dist/context-hooks.js.map +1 -0
- package/dist/context-services.d.ts +12 -0
- package/dist/context-services.d.ts.map +1 -0
- package/dist/context-services.js +20 -0
- package/dist/context-services.js.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -12
- package/dist/index.js.map +1 -1
- package/dist/orchestration/capability-matrix.d.ts +1 -1
- package/dist/orchestration/capability-matrix.d.ts.map +1 -1
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.d.ts +2 -0
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.js +42 -0
- package/dist/pipeline/__tests__/AgentEngine.orchestratorFailure.test.js.map +1 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.d.ts +2 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.js +64 -0
- package/dist/pipeline/__tests__/coding-pipeline-hooks.test.js.map +1 -0
- package/dist/pipeline/__tests__/engine-brief.test.d.ts +2 -0
- package/dist/pipeline/__tests__/engine-brief.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/engine-brief.test.js +159 -0
- package/dist/pipeline/__tests__/engine-brief.test.js.map +1 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.d.ts +2 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.d.ts.map +1 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.js +276 -0
- package/dist/pipeline/__tests__/qa-orchestrator.test.js.map +1 -0
- package/dist/pipeline/coding-pipeline-hooks.d.ts +28 -0
- package/dist/pipeline/coding-pipeline-hooks.d.ts.map +1 -0
- package/dist/pipeline/coding-pipeline-hooks.js +91 -0
- package/dist/pipeline/coding-pipeline-hooks.js.map +1 -0
- package/dist/pipeline/index.d.ts +13 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +44 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.d.ts +11 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.js +105 -0
- package/dist/pipeline/orchestration/__tests__/agent-id-consistency.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.d.ts +2 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.js +21 -0
- package/dist/pipeline/orchestration/__tests__/fsm-commit-skipped.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.d.ts +9 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.js +101 -0
- package/dist/pipeline/orchestration/__tests__/fsm-critical-path.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.d.ts +2 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.js +54 -0
- package/dist/pipeline/orchestration/__tests__/fsm-rework-and-regression.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.d.ts +2 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.js +57 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-llm.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.d.ts +9 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.js +43 -0
- package/dist/pipeline/orchestration/__tests__/intent-detector-scores.test.js.map +1 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.d.ts +10 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.d.ts.map +1 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.js +264 -0
- package/dist/pipeline/orchestration/__tests__/reflection-cycle.test.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.d.ts +31 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.js +120 -0
- package/dist/pipeline/orchestration/audit/audit-ci-blocker.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.d.ts +33 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.js +126 -0
- package/dist/pipeline/orchestration/audit/audit-finding-tracer.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.d.ts +27 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.js +155 -0
- package/dist/pipeline/orchestration/audit/audit-lessons-learned.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.d.ts +21 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.js +110 -0
- package/dist/pipeline/orchestration/audit/audit-pending-issues.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.d.ts +39 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.js +65 -0
- package/dist/pipeline/orchestration/audit/audit-reflection-bridge.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.d.ts +30 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.js +249 -0
- package/dist/pipeline/orchestration/audit/audit-report-renderer.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.d.ts +52 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.js +144 -0
- package/dist/pipeline/orchestration/audit/audit-report-version-manager.js.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.d.ts +37 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.js +129 -0
- package/dist/pipeline/orchestration/audit/audit-silent-gates-buffer.js.map +1 -0
- package/dist/pipeline/orchestration/audit/index.d.ts +17 -0
- package/dist/pipeline/orchestration/audit/index.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/index.js +26 -0
- package/dist/pipeline/orchestration/audit/index.js.map +1 -0
- package/dist/pipeline/orchestration/audit/types.d.ts +79 -0
- package/dist/pipeline/orchestration/audit/types.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit/types.js +10 -0
- package/dist/pipeline/orchestration/audit/types.js.map +1 -0
- package/dist/pipeline/orchestration/audit-reporter.d.ts +133 -0
- package/dist/pipeline/orchestration/audit-reporter.d.ts.map +1 -0
- package/dist/pipeline/orchestration/audit-reporter.js +322 -0
- package/dist/pipeline/orchestration/audit-reporter.js.map +1 -0
- package/dist/pipeline/orchestration/config-loader.d.ts +51 -0
- package/dist/pipeline/orchestration/config-loader.d.ts.map +1 -0
- package/dist/pipeline/orchestration/config-loader.js +215 -0
- package/dist/pipeline/orchestration/config-loader.js.map +1 -0
- package/dist/pipeline/orchestration/domain-detector.d.ts +36 -0
- package/dist/pipeline/orchestration/domain-detector.d.ts.map +1 -0
- package/dist/pipeline/orchestration/domain-detector.js +157 -0
- package/dist/pipeline/orchestration/domain-detector.js.map +1 -0
- package/dist/pipeline/orchestration/fsm.d.ts +92 -0
- package/dist/pipeline/orchestration/fsm.d.ts.map +1 -0
- package/dist/pipeline/orchestration/fsm.js +243 -0
- package/dist/pipeline/orchestration/fsm.js.map +1 -0
- package/dist/pipeline/orchestration/gate-resolver.d.ts +52 -0
- package/dist/pipeline/orchestration/gate-resolver.d.ts.map +1 -0
- package/dist/pipeline/orchestration/gate-resolver.js +120 -0
- package/dist/pipeline/orchestration/gate-resolver.js.map +1 -0
- package/dist/pipeline/orchestration/index.d.ts +16 -0
- package/dist/pipeline/orchestration/index.d.ts.map +1 -0
- package/dist/pipeline/orchestration/index.js +32 -0
- package/dist/pipeline/orchestration/index.js.map +1 -0
- package/dist/pipeline/orchestration/intent-detector.d.ts +37 -0
- package/dist/pipeline/orchestration/intent-detector.d.ts.map +1 -0
- package/dist/pipeline/orchestration/intent-detector.js +248 -0
- package/dist/pipeline/orchestration/intent-detector.js.map +1 -0
- package/dist/pipeline/orchestration/keyword-match.d.ts +17 -0
- package/dist/pipeline/orchestration/keyword-match.d.ts.map +1 -0
- package/dist/pipeline/orchestration/keyword-match.js +26 -0
- package/dist/pipeline/orchestration/keyword-match.js.map +1 -0
- package/dist/pipeline/orchestration/orchestrator.d.ts +158 -0
- package/dist/pipeline/orchestration/orchestrator.d.ts.map +1 -0
- package/dist/pipeline/orchestration/orchestrator.js +414 -0
- package/dist/pipeline/orchestration/orchestrator.js.map +1 -0
- package/dist/pipeline/orchestration/policy-engine.d.ts +54 -0
- package/dist/pipeline/orchestration/policy-engine.d.ts.map +1 -0
- package/dist/pipeline/orchestration/policy-engine.js +278 -0
- package/dist/pipeline/orchestration/policy-engine.js.map +1 -0
- package/dist/pipeline/orchestration/risk-scorer.d.ts +38 -0
- package/dist/pipeline/orchestration/risk-scorer.d.ts.map +1 -0
- package/dist/pipeline/orchestration/risk-scorer.js +145 -0
- package/dist/pipeline/orchestration/risk-scorer.js.map +1 -0
- package/dist/pipeline/orchestration/task-context.d.ts +205 -0
- package/dist/pipeline/orchestration/task-context.d.ts.map +1 -0
- package/dist/pipeline/orchestration/task-context.js +162 -0
- package/dist/pipeline/orchestration/task-context.js.map +1 -0
- package/dist/pipeline/orchestration/types.d.ts +111 -0
- package/dist/pipeline/orchestration/types.d.ts.map +1 -0
- package/dist/pipeline/orchestration/types.js +37 -0
- package/dist/pipeline/orchestration/types.js.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.test.d.ts +2 -0
- package/dist/pipeline/qa/__tests__/QAService.test.d.ts.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.test.js +170 -0
- package/dist/pipeline/qa/__tests__/QAService.test.js.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.d.ts +2 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.d.ts.map +1 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.js +39 -0
- package/dist/pipeline/qa/__tests__/QAService.verdict.test.js.map +1 -0
- package/dist/pipeline/qa/index.d.ts +3 -0
- package/dist/pipeline/qa/index.d.ts.map +1 -0
- package/dist/pipeline/qa/index.js +6 -0
- package/dist/pipeline/qa/index.js.map +1 -0
- package/dist/pipeline/qa/qa-service.d.ts +33 -0
- package/dist/pipeline/qa/qa-service.d.ts.map +1 -0
- package/dist/pipeline/qa/qa-service.js +239 -0
- package/dist/pipeline/qa/qa-service.js.map +1 -0
- package/dist/pipeline/qa-orchestrator.d.ts +60 -0
- package/dist/pipeline/qa-orchestrator.d.ts.map +1 -0
- package/dist/pipeline/qa-orchestrator.js +177 -0
- package/dist/pipeline/qa-orchestrator.js.map +1 -0
- package/dist/pipeline/reflection/domains/agent-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/agent-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/agent-domain.js +161 -0
- package/dist/pipeline/reflection/domains/agent-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/audit-domain.d.ts +46 -0
- package/dist/pipeline/reflection/domains/audit-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/audit-domain.js +241 -0
- package/dist/pipeline/reflection/domains/audit-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.js +156 -0
- package/dist/pipeline/reflection/domains/bootstrap-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/commit-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/commit-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/commit-domain.js +174 -0
- package/dist/pipeline/reflection/domains/commit-domain.js.map +1 -0
- package/dist/pipeline/reflection/domains/test-domain.d.ts +40 -0
- package/dist/pipeline/reflection/domains/test-domain.d.ts.map +1 -0
- package/dist/pipeline/reflection/domains/test-domain.js +194 -0
- package/dist/pipeline/reflection/domains/test-domain.js.map +1 -0
- package/dist/pipeline/reflection/historical-loader.d.ts +105 -0
- package/dist/pipeline/reflection/historical-loader.d.ts.map +1 -0
- package/dist/pipeline/reflection/historical-loader.js +462 -0
- package/dist/pipeline/reflection/historical-loader.js.map +1 -0
- package/dist/pipeline/reflection/hooks/agent-hook.d.ts +72 -0
- package/dist/pipeline/reflection/hooks/agent-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/agent-hook.js +98 -0
- package/dist/pipeline/reflection/hooks/agent-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/audit-hook.d.ts +72 -0
- package/dist/pipeline/reflection/hooks/audit-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/audit-hook.js +112 -0
- package/dist/pipeline/reflection/hooks/audit-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.d.ts +71 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.js +97 -0
- package/dist/pipeline/reflection/hooks/bootstrap-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/commit-hook.d.ts +63 -0
- package/dist/pipeline/reflection/hooks/commit-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/commit-hook.js +90 -0
- package/dist/pipeline/reflection/hooks/commit-hook.js.map +1 -0
- package/dist/pipeline/reflection/hooks/test-hook.d.ts +65 -0
- package/dist/pipeline/reflection/hooks/test-hook.d.ts.map +1 -0
- package/dist/pipeline/reflection/hooks/test-hook.js +99 -0
- package/dist/pipeline/reflection/hooks/test-hook.js.map +1 -0
- package/dist/pipeline/reflection/lessons-memo-generator.d.ts +60 -0
- package/dist/pipeline/reflection/lessons-memo-generator.d.ts.map +1 -0
- package/dist/pipeline/reflection/lessons-memo-generator.js +286 -0
- package/dist/pipeline/reflection/lessons-memo-generator.js.map +1 -0
- package/dist/store/ProjectStore.d.ts +1 -1
- package/dist/store/ProjectStore.d.ts.map +1 -1
- package/dist/store/ProjectStore.js +2 -1
- package/dist/store/ProjectStore.js.map +1 -1
- package/dist/store/types.d.ts +28 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +3 -0
- package/dist/store/types.js.map +1 -0
- package/dist/tools/__tests__/command-parser.test.js +1 -1
- package/dist/tools/__tests__/command-parser.test.js.map +1 -1
- package/dist/tools/__tests__/declared-facts.test.d.ts +2 -0
- package/dist/tools/__tests__/declared-facts.test.d.ts.map +1 -0
- package/dist/tools/__tests__/declared-facts.test.js +21 -0
- package/dist/tools/__tests__/declared-facts.test.js.map +1 -0
- package/dist/tools/__tests__/package-install.test.d.ts +2 -0
- package/dist/tools/__tests__/package-install.test.d.ts.map +1 -0
- package/dist/tools/__tests__/package-install.test.js +56 -0
- package/dist/tools/__tests__/package-install.test.js.map +1 -0
- package/dist/tools/__tests__/save-tools.secrets.test.js +1 -1
- package/dist/tools/__tests__/save-tools.secrets.test.js.map +1 -1
- package/dist/tools/edit-file.d.ts.map +1 -1
- package/dist/tools/edit-file.js +1 -0
- package/dist/tools/edit-file.js.map +1 -1
- package/dist/tools/list-directory.d.ts.map +1 -1
- package/dist/tools/list-directory.js +1 -0
- package/dist/tools/list-directory.js.map +1 -1
- package/dist/tools/package-install.d.ts +11 -0
- package/dist/tools/package-install.d.ts.map +1 -0
- package/dist/tools/package-install.js +112 -0
- package/dist/tools/package-install.js.map +1 -0
- package/dist/tools/read-file.d.ts.map +1 -1
- package/dist/tools/read-file.js +1 -0
- package/dist/tools/read-file.js.map +1 -1
- package/dist/tools/run-command.d.ts.map +1 -1
- package/dist/tools/run-command.js +5 -1
- package/dist/tools/run-command.js.map +1 -1
- package/dist/tools/save-audit.d.ts.map +1 -1
- package/dist/tools/save-audit.js +7 -6
- package/dist/tools/save-audit.js.map +1 -1
- package/dist/tools/save-context.d.ts.map +1 -1
- package/dist/tools/save-context.js +3 -2
- package/dist/tools/save-context.js.map +1 -1
- package/dist/tools/save-learning.d.ts.map +1 -1
- package/dist/tools/save-learning.js +4 -3
- package/dist/tools/save-learning.js.map +1 -1
- package/dist/tools/save-user-preference.d.ts.map +1 -1
- package/dist/tools/save-user-preference.js +3 -2
- package/dist/tools/save-user-preference.js.map +1 -1
- package/dist/tools/search-files.d.ts.map +1 -1
- package/dist/tools/search-files.js +1 -0
- package/dist/tools/search-files.js.map +1 -1
- package/dist/tools/update-session.d.ts.map +1 -1
- package/dist/tools/update-session.js +3 -2
- package/dist/tools/update-session.js.map +1 -1
- package/dist/tools/write-file.d.ts.map +1 -1
- package/dist/tools/write-file.js +1 -0
- package/dist/tools/write-file.js.map +1 -1
- package/package.json +71 -44
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.SkillManager = void 0;
|
|
37
|
+
exports.createSkillManager = createSkillManager;
|
|
38
|
+
const fs = __importStar(require("fs/promises"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const result_1 = require("@backendkit-labs/result");
|
|
41
|
+
const agent_core_1 = require("@backendkit-labs/agent-core");
|
|
42
|
+
const agent_core_2 = require("@backendkit-labs/agent-core");
|
|
43
|
+
const safe_name_1 = require("./safe-name");
|
|
44
|
+
const parse_md_skill_1 = require("./parse-md-skill");
|
|
45
|
+
const github_1 = require("./providers/github");
|
|
46
|
+
const local_1 = require("./providers/local");
|
|
47
|
+
const skills_sh_1 = require("./providers/skills-sh");
|
|
48
|
+
const DEFAULT_MAX_PROMPT_BYTES = 20_000;
|
|
49
|
+
/**
|
|
50
|
+
* Manages lifecycle of external skill packs: install, uninstall, list, update.
|
|
51
|
+
*
|
|
52
|
+
* Skills are stored as .md files with YAML frontmatter.
|
|
53
|
+
*
|
|
54
|
+
* Safety guarantee: disk is only modified after ALL network fetches succeed.
|
|
55
|
+
* If a fetch fails mid-way, existing packs are untouched.
|
|
56
|
+
*
|
|
57
|
+
* Security: pass a TrustConfig to restrict which sources can be installed.
|
|
58
|
+
* const manager = new SkillManager('my-app', {
|
|
59
|
+
* allowedSources: ['https://github.com/my-org/', 'https://skills.sh/'],
|
|
60
|
+
* })
|
|
61
|
+
*
|
|
62
|
+
* Extend with custom sources:
|
|
63
|
+
* manager.use(new MyProvider())
|
|
64
|
+
*/
|
|
65
|
+
class SkillManager {
|
|
66
|
+
appName;
|
|
67
|
+
packsDir;
|
|
68
|
+
sourcesFile;
|
|
69
|
+
providers;
|
|
70
|
+
trust;
|
|
71
|
+
constructor(appName, trust = {}) {
|
|
72
|
+
this.appName = appName;
|
|
73
|
+
const skillsDir = path.join((0, agent_core_1.getFrameworkDir)(appName), 'skills');
|
|
74
|
+
this.packsDir = path.join(skillsDir, 'packs');
|
|
75
|
+
this.sourcesFile = path.join(skillsDir, 'sources.json');
|
|
76
|
+
this.trust = trust;
|
|
77
|
+
this.providers = [
|
|
78
|
+
new github_1.GitHubProvider(appName),
|
|
79
|
+
new skills_sh_1.SkillsShProvider(appName),
|
|
80
|
+
new local_1.LocalProvider(),
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Registers an additional source provider.
|
|
85
|
+
* Registered providers take precedence over built-in ones.
|
|
86
|
+
*/
|
|
87
|
+
use(provider) {
|
|
88
|
+
this.providers.unshift(provider);
|
|
89
|
+
return this;
|
|
90
|
+
}
|
|
91
|
+
async install(source, options = {}) {
|
|
92
|
+
// Security gate — checked before any network activity
|
|
93
|
+
this.assertTrusted(source);
|
|
94
|
+
const packName = options.pack ?? this.derivePackName(source);
|
|
95
|
+
// Project-scoped: flat install into {projectDir}/skills/
|
|
96
|
+
// Global-scoped: install into ~/.{appName}/skills/packs/{pack}/
|
|
97
|
+
const { projectDir } = options;
|
|
98
|
+
const installDir = projectDir
|
|
99
|
+
? path.join(projectDir, 'skills')
|
|
100
|
+
: this.packDir(packName);
|
|
101
|
+
if (!options.force) {
|
|
102
|
+
// For project-scoped, check if source is already in project sources.json
|
|
103
|
+
const existingSources = projectDir
|
|
104
|
+
? await this.loadSourcesFrom(path.join(projectDir, 'skills', 'sources.json'))
|
|
105
|
+
: await this.loadSources();
|
|
106
|
+
const alreadyInstalled = existingSources.some(s => s.pack === packName);
|
|
107
|
+
if (alreadyInstalled) {
|
|
108
|
+
throw new Error(`Pack '${packName}' is already installed. Use force: true or call update() to refresh.`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const provider = this.providers.find(p => p.canHandle(source));
|
|
112
|
+
if (!provider) {
|
|
113
|
+
throw new Error(`No provider found for source: '${source}'.\n` +
|
|
114
|
+
`Built-in providers: GitHub URLs (https://github.com/...), local paths (/abs or ./rel).\n` +
|
|
115
|
+
`Register custom providers with manager.use(new MyProvider()).`);
|
|
116
|
+
}
|
|
117
|
+
// Fetch everything into memory first — no disk writes until all succeed
|
|
118
|
+
const raw = await provider.fetch(source, { skill: options.skill });
|
|
119
|
+
if (raw.length === 0) {
|
|
120
|
+
throw new Error(`No valid skills found in '${source}'` +
|
|
121
|
+
(options.skill ? ` matching skill '${options.skill}'` : '') + '.');
|
|
122
|
+
}
|
|
123
|
+
// Content sanitization — even trusted sources are bounded
|
|
124
|
+
const skills = this.sanitize(raw, source);
|
|
125
|
+
// Write to disk only after successful fetch and sanitization
|
|
126
|
+
await fs.mkdir(installDir, { recursive: true });
|
|
127
|
+
await Promise.all(skills.map(skill => {
|
|
128
|
+
const filePath = path.join(installDir, `${skill.name}.md`);
|
|
129
|
+
// belt and braces: the name was validated in sanitize(); the resolved path must still be inside installDir
|
|
130
|
+
if (path.dirname(path.resolve(filePath)) !== path.resolve(installDir)) {
|
|
131
|
+
throw new Error(`Unsafe skill name ${JSON.stringify(skill.name)}: resolves outside the install directory.`);
|
|
132
|
+
}
|
|
133
|
+
return (0, agent_core_2.atomicWrite)(filePath, (0, parse_md_skill_1.skillToMd)(skill));
|
|
134
|
+
}));
|
|
135
|
+
const entry = { pack: packName, source, installedAt: new Date().toISOString() };
|
|
136
|
+
if (projectDir) {
|
|
137
|
+
await this.upsertSourceTo(path.join(projectDir, 'skills', 'sources.json'), entry);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
await this.upsertSource(entry);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
async uninstall(packName) {
|
|
144
|
+
const packDir = this.packDir(packName);
|
|
145
|
+
const result = await (0, result_1.run)(() => fs.rm(packDir, { recursive: true, force: true }));
|
|
146
|
+
if (!(0, result_1.isOk)(result)) {
|
|
147
|
+
throw new Error(`Failed to remove pack '${packName}': ${String(result.error)}`);
|
|
148
|
+
}
|
|
149
|
+
await this.removeSource(packName);
|
|
150
|
+
}
|
|
151
|
+
async list() {
|
|
152
|
+
const sources = await this.loadSources();
|
|
153
|
+
return Promise.all(sources.map(async (src) => {
|
|
154
|
+
const filesResult = await (0, result_1.run)(() => fs.readdir(this.packDir(src.pack)));
|
|
155
|
+
const skills = (0, result_1.isOk)(filesResult)
|
|
156
|
+
? filesResult.value
|
|
157
|
+
.filter(f => /\.(ya?ml|md)$/.test(f))
|
|
158
|
+
.map(f => f.replace(/\.(ya?ml|md)$/, ''))
|
|
159
|
+
: [];
|
|
160
|
+
return { ...src, skills };
|
|
161
|
+
}));
|
|
162
|
+
}
|
|
163
|
+
async update(packName) {
|
|
164
|
+
const sources = await this.loadSources();
|
|
165
|
+
const entry = sources.find(s => s.pack === packName);
|
|
166
|
+
if (!entry)
|
|
167
|
+
throw new Error(`Pack '${packName}' is not installed. Run install() first.`);
|
|
168
|
+
await this.install(entry.source, { pack: packName, force: true });
|
|
169
|
+
}
|
|
170
|
+
// ---------------------------------------------------------------------------
|
|
171
|
+
// Security
|
|
172
|
+
// ---------------------------------------------------------------------------
|
|
173
|
+
/**
|
|
174
|
+
* Throws if the source is not in the allowlist.
|
|
175
|
+
* When allowedSources is undefined the manager is in open mode — any source is accepted.
|
|
176
|
+
*/
|
|
177
|
+
assertTrusted(source) {
|
|
178
|
+
const { allowedSources } = this.trust;
|
|
179
|
+
if (!allowedSources)
|
|
180
|
+
return; // open mode
|
|
181
|
+
const trusted = allowedSources.some(prefix => source.startsWith(prefix));
|
|
182
|
+
if (!trusted) {
|
|
183
|
+
throw new Error(`Source '${source}' is not in the trusted allowlist.\n` +
|
|
184
|
+
`Allowed prefixes: ${allowedSources.join(', ')}\n` +
|
|
185
|
+
`Pass the source to TrustConfig.allowedSources to authorize it.`);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Validates content bounds on all skills from a source.
|
|
190
|
+
* Prevents prompt-flooding even from trusted sources.
|
|
191
|
+
*/
|
|
192
|
+
sanitize(skills, source) {
|
|
193
|
+
const maxBytes = this.trust.maxPromptBytes ?? DEFAULT_MAX_PROMPT_BYTES;
|
|
194
|
+
for (const skill of skills) {
|
|
195
|
+
(0, safe_name_1.assertSafeFileName)('skill name', skill.name);
|
|
196
|
+
if (!skill.systemPromptAddition)
|
|
197
|
+
continue;
|
|
198
|
+
const bytes = Buffer.byteLength(skill.systemPromptAddition, 'utf-8');
|
|
199
|
+
if (bytes > maxBytes) {
|
|
200
|
+
throw new Error(`Skill '${skill.name}' from '${source}' exceeds the allowed prompt size.\n` +
|
|
201
|
+
`Got ${bytes} bytes, limit is ${maxBytes} bytes.\n` +
|
|
202
|
+
`Raise TrustConfig.maxPromptBytes if this source is intentionally verbose.`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return skills;
|
|
206
|
+
}
|
|
207
|
+
// ---------------------------------------------------------------------------
|
|
208
|
+
// Private
|
|
209
|
+
// ---------------------------------------------------------------------------
|
|
210
|
+
derivePackName(source) {
|
|
211
|
+
const githubMatch = source.match(/github\.com\/([^/]+)\/([^/?#]+)/i);
|
|
212
|
+
if (githubMatch)
|
|
213
|
+
return `@${githubMatch[1]}`;
|
|
214
|
+
const skillsShMatch = source.match(/skills\.sh\/([^/?#]+)\/([^/?#]+)/i);
|
|
215
|
+
if (skillsShMatch)
|
|
216
|
+
return `@${skillsShMatch[1]}/${skillsShMatch[2]}`;
|
|
217
|
+
if (source.startsWith('obsidian://')) {
|
|
218
|
+
const params = new URLSearchParams(source.split('?')[1] ?? '');
|
|
219
|
+
return `obsidian-${params.get('folder')?.replace(/\//g, '-') ?? 'vault'}`;
|
|
220
|
+
}
|
|
221
|
+
return path.basename(source);
|
|
222
|
+
}
|
|
223
|
+
packDir(packName) {
|
|
224
|
+
const dirName = packName.replace(/\//g, '-');
|
|
225
|
+
(0, safe_name_1.assertSafeFileName)('pack name', dirName);
|
|
226
|
+
return path.join(this.packsDir, dirName);
|
|
227
|
+
}
|
|
228
|
+
async loadSources() {
|
|
229
|
+
return this.loadSourcesFrom(this.sourcesFile);
|
|
230
|
+
}
|
|
231
|
+
async loadSourcesFrom(file) {
|
|
232
|
+
const result = await (0, result_1.run)(() => fs.readFile(file, 'utf-8'));
|
|
233
|
+
if (!(0, result_1.isOk)(result))
|
|
234
|
+
return [];
|
|
235
|
+
try {
|
|
236
|
+
const parsed = JSON.parse(result.value);
|
|
237
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
238
|
+
}
|
|
239
|
+
catch {
|
|
240
|
+
return [];
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
async upsertSource(entry) {
|
|
244
|
+
return this.upsertSourceTo(this.sourcesFile, entry);
|
|
245
|
+
}
|
|
246
|
+
async upsertSourceTo(file, entry) {
|
|
247
|
+
const sources = await this.loadSourcesFrom(file);
|
|
248
|
+
const idx = sources.findIndex(s => s.pack === entry.pack);
|
|
249
|
+
if (idx >= 0)
|
|
250
|
+
sources[idx] = entry;
|
|
251
|
+
else
|
|
252
|
+
sources.push(entry);
|
|
253
|
+
await fs.mkdir(path.dirname(file), { recursive: true });
|
|
254
|
+
await (0, agent_core_2.atomicWrite)(file, JSON.stringify(sources, null, 2));
|
|
255
|
+
}
|
|
256
|
+
async removeSource(packName) {
|
|
257
|
+
const sources = await this.loadSources();
|
|
258
|
+
const filtered = sources.filter(s => s.pack !== packName);
|
|
259
|
+
await (0, agent_core_2.atomicWrite)(this.sourcesFile, JSON.stringify(filtered, null, 2));
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
exports.SkillManager = SkillManager;
|
|
263
|
+
/**
|
|
264
|
+
* Standard factory for SkillManager.
|
|
265
|
+
* Use this instead of `new SkillManager()` in agent implementations.
|
|
266
|
+
*
|
|
267
|
+
* - Reads TrustConfig from env vars so security is configured at the host level:
|
|
268
|
+
* BK_TRUSTED_SOURCES — comma-separated source prefixes (open mode if unset)
|
|
269
|
+
* BK_MAX_PROMPT_BYTES — max bytes for systemPromptAddition (default: 20 000)
|
|
270
|
+
*
|
|
271
|
+
* - ObsidianProvider is NOT registered by default — call `.use(new ObsidianProvider())`
|
|
272
|
+
* when the agent needs vault access (it requires a user-specific vault path).
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* // Basic — open mode, all built-in sources
|
|
276
|
+
* const manager = createSkillManager('my-app');
|
|
277
|
+
*
|
|
278
|
+
* // With allowlist
|
|
279
|
+
* const manager = createSkillManager('my-app', {
|
|
280
|
+
* allowedSources: ['https://github.com/my-org/', 'https://skills.sh/'],
|
|
281
|
+
* });
|
|
282
|
+
*
|
|
283
|
+
* // With Obsidian support
|
|
284
|
+
* const manager = createSkillManager('my-app').use(new ObsidianProvider());
|
|
285
|
+
*/
|
|
286
|
+
function createSkillManager(appName, trust) {
|
|
287
|
+
const resolvedTrust = { ...trust };
|
|
288
|
+
if (!resolvedTrust.allowedSources) {
|
|
289
|
+
const env = process.env.BK_TRUSTED_SOURCES;
|
|
290
|
+
if (env) {
|
|
291
|
+
resolvedTrust.allowedSources = env.split(',').map(s => s.trim()).filter(Boolean);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
if (!resolvedTrust.maxPromptBytes) {
|
|
295
|
+
const env = process.env.BK_MAX_PROMPT_BYTES;
|
|
296
|
+
if (env) {
|
|
297
|
+
const parsed = parseInt(env, 10);
|
|
298
|
+
if (!isNaN(parsed))
|
|
299
|
+
resolvedTrust.maxPromptBytes = parsed;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return new SkillManager(appName, resolvedTrust);
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../src/cli/skills/manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgTA,gDAmBC;AAnUD,gDAAkC;AAClC,2CAA6B;AAC7B,oDAAoD;AACpD,4DAA8D;AA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AAG,CAAC,mBAAmB,CAAC;QAC5C,IAAI,GAAG,EAAE,CAAC;YACN,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACjC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;gBAAE,aAAa,CAAC,cAAc,GAAG,MAAM,CAAC;QAC9D,CAAC;IACL,CAAC;IAED,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Skill } from '@backendkit-labs/agent-core';
|
|
2
|
+
/**
|
|
3
|
+
* Parses a .md file with YAML frontmatter into a Skill.
|
|
4
|
+
* The markdown body becomes systemPromptAddition (unless already set in frontmatter).
|
|
5
|
+
* Returns null if frontmatter is missing or invalid.
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseMdSkill(content: string): Skill | null;
|
|
8
|
+
/**
|
|
9
|
+
* Serializes a Skill to .md format.
|
|
10
|
+
* scope and pack are excluded from frontmatter — they are set by the loader
|
|
11
|
+
* based on where the file lives, not stored in the file itself.
|
|
12
|
+
*/
|
|
13
|
+
export declare function skillToMd(skill: Skill): string;
|
|
14
|
+
//# sourceMappingURL=parse-md-skill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-md-skill.d.ts","sourceRoot":"","sources":["../../../src/cli/skills/parse-md-skill.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAIzD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI,CA6B1D;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAQ9C"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.parseMdSkill = parseMdSkill;
|
|
37
|
+
exports.skillToMd = skillToMd;
|
|
38
|
+
const yaml = __importStar(require("yaml"));
|
|
39
|
+
const FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;
|
|
40
|
+
/**
|
|
41
|
+
* Parses a .md file with YAML frontmatter into a Skill.
|
|
42
|
+
* The markdown body becomes systemPromptAddition (unless already set in frontmatter).
|
|
43
|
+
* Returns null if frontmatter is missing or invalid.
|
|
44
|
+
*/
|
|
45
|
+
function parseMdSkill(content) {
|
|
46
|
+
const match = content.match(FRONTMATTER_RE);
|
|
47
|
+
if (!match)
|
|
48
|
+
return null;
|
|
49
|
+
const [, frontmatter, body] = match;
|
|
50
|
+
let parsed;
|
|
51
|
+
try {
|
|
52
|
+
parsed = yaml.parse(frontmatter);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
if (!parsed || typeof parsed.name !== 'string' || !parsed.name)
|
|
58
|
+
return null;
|
|
59
|
+
const skill = {
|
|
60
|
+
...parsed,
|
|
61
|
+
name: parsed.name,
|
|
62
|
+
version: typeof parsed.version === 'string' ? parsed.version : '1.0.0',
|
|
63
|
+
description: typeof parsed.description === 'string' ? parsed.description : '',
|
|
64
|
+
triggers: Array.isArray(parsed.triggers) ? parsed.triggers : [],
|
|
65
|
+
};
|
|
66
|
+
const bodyText = body.trim();
|
|
67
|
+
if (bodyText && !skill.systemPromptAddition) {
|
|
68
|
+
skill.systemPromptAddition = bodyText;
|
|
69
|
+
}
|
|
70
|
+
return skill;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Serializes a Skill to .md format.
|
|
74
|
+
* scope and pack are excluded from frontmatter — they are set by the loader
|
|
75
|
+
* based on where the file lives, not stored in the file itself.
|
|
76
|
+
*/
|
|
77
|
+
function skillToMd(skill) {
|
|
78
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
79
|
+
const { systemPromptAddition, scope, pack, ...frontmatterFields } = skill;
|
|
80
|
+
const frontmatter = yaml.stringify(frontmatterFields).trimEnd();
|
|
81
|
+
const body = systemPromptAddition?.trim() ?? '';
|
|
82
|
+
return body
|
|
83
|
+
? `---\n${frontmatter}\n---\n\n${body}\n`
|
|
84
|
+
: `---\n${frontmatter}\n---\n`;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=parse-md-skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-md-skill.js","sourceRoot":"","sources":["../../../src/cli/skills/parse-md-skill.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,oCA6BC;AAOD,8BAQC;AAtDD,2CAA6B;AAG7B,MAAM,cAAc,GAAG,6CAA6C,CAAC;AAErE;;;;GAIG;AACH,SAAgB,YAAY,CAAC,OAAe;IACxC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,MAAM,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC;IAEpC,IAAI,MAA+B,CAAC;IACpC,IAAI,CAAC;QACD,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAA4B,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAE5E,MAAM,KAAK,GAAU;QACjB,GAAI,MAAyB;QAC7B,IAAI,EAAE,MAAM,CAAC,IAAc;QAC3B,OAAO,EAAE,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;QACtE,WAAW,EAAE,OAAO,MAAM,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;QAC7E,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAE,MAAM,CAAC,QAAqB,CAAC,CAAC,CAAC,EAAE;KAChF,CAAC;IAEF,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,QAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC1C,KAAK,CAAC,oBAAoB,GAAG,QAAQ,CAAC;IAC1C,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CAAC,KAAY;IAClC,6DAA6D;IAC7D,MAAM,EAAE,oBAAoB,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,iBAAiB,EAAE,GAAG,KAAK,CAAC;IAC1E,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,OAAO,EAAE,CAAC;IAChE,MAAM,IAAI,GAAG,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAChD,OAAO,IAAI;QACP,CAAC,CAAC,QAAQ,WAAW,YAAY,IAAI,IAAI;QACzC,CAAC,CAAC,QAAQ,WAAW,SAAS,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Skill } from '@backendkit-labs/agent-core';
|
|
2
|
+
import type { FetchOptions, SkillSourceProvider } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Fetches skill packs from GitHub repositories.
|
|
5
|
+
* Looks for skill files in a /skills subfolder first, then the repo root.
|
|
6
|
+
* Supports both .yaml/.yml and .md (with frontmatter) skill files.
|
|
7
|
+
*
|
|
8
|
+
* Accepted source formats:
|
|
9
|
+
* https://github.com/{owner}/{repo}
|
|
10
|
+
* https://github.com/{owner}/{repo}.git
|
|
11
|
+
*/
|
|
12
|
+
export declare class GitHubProvider implements SkillSourceProvider {
|
|
13
|
+
private readonly appName;
|
|
14
|
+
readonly id = "github";
|
|
15
|
+
constructor(appName?: string);
|
|
16
|
+
canHandle(source: string): boolean;
|
|
17
|
+
fetch(source: string, options?: FetchOptions): Promise<Skill[]>;
|
|
18
|
+
private listSkillFiles;
|
|
19
|
+
private downloadAndParse;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=github.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../src/cli/skills/providers/github.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAUjE;;;;;;;;GAQG;AACH,qBAAa,cAAe,YAAW,mBAAmB;IAG1C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,QAAQ,CAAC,EAAE,YAAY;gBAEM,OAAO,GAAE,MAAgB;IAEtD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAI5B,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;YAgBvD,cAAc;YA2Bd,gBAAgB;CAoCjC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.GitHubProvider = void 0;
|
|
37
|
+
const result_1 = require("@backendkit-labs/result");
|
|
38
|
+
const parse_md_skill_1 = require("../parse-md-skill");
|
|
39
|
+
const yaml = __importStar(require("yaml"));
|
|
40
|
+
const SKILL_FILE_RE = /\.(ya?ml|md)$/i;
|
|
41
|
+
/**
|
|
42
|
+
* Fetches skill packs from GitHub repositories.
|
|
43
|
+
* Looks for skill files in a /skills subfolder first, then the repo root.
|
|
44
|
+
* Supports both .yaml/.yml and .md (with frontmatter) skill files.
|
|
45
|
+
*
|
|
46
|
+
* Accepted source formats:
|
|
47
|
+
* https://github.com/{owner}/{repo}
|
|
48
|
+
* https://github.com/{owner}/{repo}.git
|
|
49
|
+
*/
|
|
50
|
+
class GitHubProvider {
|
|
51
|
+
appName;
|
|
52
|
+
id = 'github';
|
|
53
|
+
constructor(appName = 'agent') {
|
|
54
|
+
this.appName = appName;
|
|
55
|
+
}
|
|
56
|
+
canHandle(source) {
|
|
57
|
+
return /^https?:\/\/github\.com\//i.test(source);
|
|
58
|
+
}
|
|
59
|
+
async fetch(source, options) {
|
|
60
|
+
const match = source.match(/github\.com\/([^/]+)\/([^/?#]+)/i);
|
|
61
|
+
if (!match)
|
|
62
|
+
throw new Error(`Invalid GitHub URL: ${source}`);
|
|
63
|
+
const [, owner, repo] = match;
|
|
64
|
+
const cleanRepo = repo.replace(/\.git$/, '');
|
|
65
|
+
for (const folder of ['skills', '']) {
|
|
66
|
+
const apiUrl = `https://api.github.com/repos/${owner}/${cleanRepo}/contents/${folder}`;
|
|
67
|
+
const files = await this.listSkillFiles(apiUrl);
|
|
68
|
+
if (files.length > 0) {
|
|
69
|
+
return this.downloadAndParse(files, options?.skill);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
74
|
+
async listSkillFiles(apiUrl) {
|
|
75
|
+
let res;
|
|
76
|
+
try {
|
|
77
|
+
res = await fetch(apiUrl, {
|
|
78
|
+
headers: {
|
|
79
|
+
Accept: 'application/vnd.github.v3+json',
|
|
80
|
+
'User-Agent': this.appName,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
catch (e) {
|
|
85
|
+
throw new Error(`Network error reaching GitHub API: ${String(e)}`);
|
|
86
|
+
}
|
|
87
|
+
if (res.status === 404)
|
|
88
|
+
return [];
|
|
89
|
+
if (!res.ok)
|
|
90
|
+
throw new Error(`GitHub API error ${res.status}: ${apiUrl}`);
|
|
91
|
+
const data = (0, result_1.fromThrowable)(() => res.json());
|
|
92
|
+
if (!(0, result_1.isOk)(data))
|
|
93
|
+
return [];
|
|
94
|
+
const items = await data.value;
|
|
95
|
+
if (!Array.isArray(items))
|
|
96
|
+
return [];
|
|
97
|
+
return items
|
|
98
|
+
.filter(f => f['type'] === 'file' && typeof f['name'] === 'string' && SKILL_FILE_RE.test(f['name']))
|
|
99
|
+
.map(f => ({ name: f['name'], download_url: f['download_url'] }));
|
|
100
|
+
}
|
|
101
|
+
async downloadAndParse(files, onlySkill) {
|
|
102
|
+
const results = await Promise.allSettled(files.map(async (file) => {
|
|
103
|
+
let res;
|
|
104
|
+
try {
|
|
105
|
+
res = await fetch(file.download_url);
|
|
106
|
+
}
|
|
107
|
+
catch (e) {
|
|
108
|
+
throw new Error(`Network error fetching ${file.name}: ${String(e)}`);
|
|
109
|
+
}
|
|
110
|
+
if (!res.ok)
|
|
111
|
+
throw new Error(`Failed to download ${file.name}: HTTP ${res.status}`);
|
|
112
|
+
const text = await res.text();
|
|
113
|
+
const skill = /\.md$/i.test(file.name)
|
|
114
|
+
? (0, parse_md_skill_1.parseMdSkill)(text)
|
|
115
|
+
: parseYamlSkill(text);
|
|
116
|
+
if (!skill)
|
|
117
|
+
throw new Error(`Invalid skill file: ${file.name}`);
|
|
118
|
+
if (onlySkill && skill.name !== onlySkill)
|
|
119
|
+
return null;
|
|
120
|
+
return skill;
|
|
121
|
+
}));
|
|
122
|
+
const skills = [];
|
|
123
|
+
const errors = [];
|
|
124
|
+
for (const r of results) {
|
|
125
|
+
if (r.status === 'rejected')
|
|
126
|
+
errors.push(String(r.reason));
|
|
127
|
+
else if (r.value != null)
|
|
128
|
+
skills.push(r.value);
|
|
129
|
+
}
|
|
130
|
+
if (errors.length > 0 && skills.length === 0) {
|
|
131
|
+
throw new Error(`All skill downloads failed:\n${errors.join('\n')}`);
|
|
132
|
+
}
|
|
133
|
+
return skills;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.GitHubProvider = GitHubProvider;
|
|
137
|
+
function parseYamlSkill(text) {
|
|
138
|
+
const parsed = (0, result_1.fromThrowable)(() => yaml.parse(text));
|
|
139
|
+
if (!parsed.ok || !parsed.value?.name)
|
|
140
|
+
return null;
|
|
141
|
+
const skill = parsed.value;
|
|
142
|
+
if (!Array.isArray(skill.triggers))
|
|
143
|
+
skill.triggers = [];
|
|
144
|
+
return skill;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=github.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.js","sourceRoot":"","sources":["../../../../src/cli/skills/providers/github.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA8D;AAC9D,sDAAiD;AAGjD,2CAA6B;AAO7B,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAEvC;;;;;;;;GAQG;AACH,MAAa,cAAc;IAGM;IAFpB,EAAE,GAAG,QAAQ,CAAC;IAEvB,YAA6B,UAAkB,OAAO;QAAzB,YAAO,GAAP,OAAO,CAAkB;IAAG,CAAC;IAE1D,SAAS,CAAC,MAAc;QACpB,OAAO,4BAA4B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,MAAc,EAAE,OAAsB;QAC9C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAC/D,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,MAAM,EAAE,CAAC,CAAC;QAC7D,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC;QAC9B,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAE7C,KAAK,MAAM,MAAM,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC;YAClC,MAAM,MAAM,GAAG,gCAAgC,KAAK,IAAI,SAAS,aAAa,MAAM,EAAE,CAAC;YACvF,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YAChD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACnB,OAAO,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK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E,CAAC;YACtB,IAAI,CAAC,CAAC,MAAM,KAAK,UAAU;gBAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;iBACtD,IAAI,CAAC,CAAC,KAAK,IAAI,IAAI;gBAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,gCAAgC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzE,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAxFD,wCAwFC;AAED,SAAS,cAAc,CAAC,IAAY;IAChC,MAAM,MAAM,GAAG,IAAA,sBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAU,CAAC,CAAC;IAC9D,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI;QAAE,OAAO,IAAI,CAAC;IACnD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAC3B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC;QAAE,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC;IACxD,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { GitHubProvider } from './github';
|
|
2
|
+
export { LocalProvider } from './local';
|
|
3
|
+
export { SkillsShProvider } from './skills-sh';
|
|
4
|
+
export { ObsidianProvider } from './obsidian';
|
|
5
|
+
export type { SkillSourceProvider, FetchOptions } from './types';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/skills/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObsidianProvider = exports.SkillsShProvider = exports.LocalProvider = exports.GitHubProvider = void 0;
|
|
4
|
+
var github_1 = require("./github");
|
|
5
|
+
Object.defineProperty(exports, "GitHubProvider", { enumerable: true, get: function () { return github_1.GitHubProvider; } });
|
|
6
|
+
var local_1 = require("./local");
|
|
7
|
+
Object.defineProperty(exports, "LocalProvider", { enumerable: true, get: function () { return local_1.LocalProvider; } });
|
|
8
|
+
var skills_sh_1 = require("./skills-sh");
|
|
9
|
+
Object.defineProperty(exports, "SkillsShProvider", { enumerable: true, get: function () { return skills_sh_1.SkillsShProvider; } });
|
|
10
|
+
var obsidian_1 = require("./obsidian");
|
|
11
|
+
Object.defineProperty(exports, "ObsidianProvider", { enumerable: true, get: function () { return obsidian_1.ObsidianProvider; } });
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/skills/providers/index.ts"],"names":[],"mappings":";;;AAAA,mCAA0C;AAAjC,wGAAA,cAAc,OAAA;AACvB,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AACtB,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA;AACzB,uCAA8C;AAArC,4GAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Skill } from '@backendkit-labs/agent-core';
|
|
2
|
+
import type { FetchOptions, SkillSourceProvider } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Fetches skills from a local filesystem directory.
|
|
5
|
+
* Supports both .yaml/.yml and .md (with frontmatter) skill files.
|
|
6
|
+
*
|
|
7
|
+
* Accepted source formats:
|
|
8
|
+
* /absolute/path/to/skills
|
|
9
|
+
* ./relative/path/to/skills
|
|
10
|
+
*/
|
|
11
|
+
export declare class LocalProvider implements SkillSourceProvider {
|
|
12
|
+
readonly id = "local";
|
|
13
|
+
canHandle(source: string): boolean;
|
|
14
|
+
fetch(source: string, options?: FetchOptions): Promise<Skill[]>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=local.d.ts.map
|