@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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/agent-discovery/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC5F,YAAY,EACR,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,GACtB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.projectAgentsDir = exports.globalAgentsDir = exports.loadAgentsFromDir = exports.RemoteAgentRegistry = exports.discoverAgents = void 0;
|
|
4
|
+
var discoverAgents_1 = require("./discoverAgents");
|
|
5
|
+
Object.defineProperty(exports, "discoverAgents", { enumerable: true, get: function () { return discoverAgents_1.discoverAgents; } });
|
|
6
|
+
var RemoteAgentRegistry_1 = require("./RemoteAgentRegistry");
|
|
7
|
+
Object.defineProperty(exports, "RemoteAgentRegistry", { enumerable: true, get: function () { return RemoteAgentRegistry_1.RemoteAgentRegistry; } });
|
|
8
|
+
var AgentPackageLoader_1 = require("./AgentPackageLoader");
|
|
9
|
+
Object.defineProperty(exports, "loadAgentsFromDir", { enumerable: true, get: function () { return AgentPackageLoader_1.loadAgentsFromDir; } });
|
|
10
|
+
Object.defineProperty(exports, "globalAgentsDir", { enumerable: true, get: function () { return AgentPackageLoader_1.globalAgentsDir; } });
|
|
11
|
+
Object.defineProperty(exports, "projectAgentsDir", { enumerable: true, get: function () { return AgentPackageLoader_1.projectAgentsDir; } });
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/agent-discovery/index.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,2DAA4F;AAAnF,uHAAA,iBAAiB,OAAA;AAAE,qHAAA,eAAe,OAAA;AAAE,sHAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { AgentProfile } from '@backendkit-labs/agent-core';
|
|
2
|
+
/** Raw structure of an agent.yaml / agent.json file. */
|
|
3
|
+
export type AgentPackageFile = Omit<AgentProfile, 'source'> & {
|
|
4
|
+
source?: AgentProfile['source'];
|
|
5
|
+
};
|
|
6
|
+
export interface RemotePackageListing {
|
|
7
|
+
name: string;
|
|
8
|
+
version: string;
|
|
9
|
+
description: string;
|
|
10
|
+
/** URL to download the agent.yaml for this package. */
|
|
11
|
+
downloadUrl: string;
|
|
12
|
+
}
|
|
13
|
+
export interface RemoteRegistryIndex {
|
|
14
|
+
version: string;
|
|
15
|
+
agents: RemotePackageListing[];
|
|
16
|
+
}
|
|
17
|
+
export interface AgentDiscoveryConfig {
|
|
18
|
+
/**
|
|
19
|
+
* Application name used to locate global agent directories.
|
|
20
|
+
* Agents are looked up in ~/.{appName}/agents/.
|
|
21
|
+
* Defaults to 'bk-agent'.
|
|
22
|
+
*/
|
|
23
|
+
appName?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Load agents from the global (~/.{appName}/agents/) and
|
|
26
|
+
* project-local ({workingDir}/.{appName}/agents/) directories.
|
|
27
|
+
* Default: true.
|
|
28
|
+
*/
|
|
29
|
+
local?: boolean;
|
|
30
|
+
/** Working directory for project-local agent loading. Defaults to process.cwd(). */
|
|
31
|
+
workingDir?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the project layer (`{workingDir}/.{appName}/agents`) may load. Default: asked of the workspace trust
|
|
34
|
+
* (ADR-0006): true only for a project the user trusted or with BK_TRUST_PROJECT=1. The agents of a repository
|
|
35
|
+
* are the repository's own content, so they load only on the user's say-so. Pass it when the host already decided.
|
|
36
|
+
*/
|
|
37
|
+
trusted?: boolean;
|
|
38
|
+
/** Remote registry URL (e.g. 'https://registry.backendkit.dev/agents'). */
|
|
39
|
+
remote?: string;
|
|
40
|
+
/** Package names to install/cache from the remote registry. */
|
|
41
|
+
install?: string[];
|
|
42
|
+
/**
|
|
43
|
+
* Override the local cache directory for downloaded packages.
|
|
44
|
+
* Defaults to ~/.{appName}/agents/registry/.
|
|
45
|
+
*/
|
|
46
|
+
cacheDir?: string;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/agent-discovery/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAIhE,wDAAwD;AACxD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,GAAG;IAC1D,MAAM,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;CACnC,CAAC;AAIF,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,oBAAoB,EAAE,CAAC;CAClC;AAID,MAAM,WAAW,oBAAoB;IACjC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/cli/agent-discovery/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Skill } from '@backendkit-labs/agent-core';
|
|
2
|
+
import type { AgentProfile } from '@backendkit-labs/agent-core';
|
|
3
|
+
export interface SeedResult {
|
|
4
|
+
createdConfig: boolean;
|
|
5
|
+
createdUserMd: boolean;
|
|
6
|
+
createdAgentMd: boolean;
|
|
7
|
+
createdDirs: string[];
|
|
8
|
+
seededAgents: string[];
|
|
9
|
+
seededSkills: number;
|
|
10
|
+
}
|
|
11
|
+
export interface GlobalSeedOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Agents to seed as .json + .md pairs on first run so users can discover
|
|
14
|
+
* and customize them. Pass CODING_AGENTS here.
|
|
15
|
+
* Only writes files that don't already exist — safe to call on every startup.
|
|
16
|
+
*/
|
|
17
|
+
agents?: AgentProfile[];
|
|
18
|
+
/**
|
|
19
|
+
* Skills to seed as YAML files on first run so users can discover and
|
|
20
|
+
* customize them. Pass all builtin skills (global + packs).
|
|
21
|
+
* The engine always loads skills from memory — seeding is optional UX scaffolding.
|
|
22
|
+
*/
|
|
23
|
+
skills?: Skill[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Idempotent initialization of the framework's global directory structure.
|
|
27
|
+
* Runs at app startup — creates dirs and files only if they don't exist.
|
|
28
|
+
*
|
|
29
|
+
* Creates:
|
|
30
|
+
* ~/.{appName}/
|
|
31
|
+
* ├── config.json
|
|
32
|
+
* ├── USER.md
|
|
33
|
+
* ├── workspaces.json
|
|
34
|
+
* ├── agent-notes/
|
|
35
|
+
* ├── agents/ ← seeded from options.agents
|
|
36
|
+
* ├── skills/
|
|
37
|
+
* │ ├── sources.json
|
|
38
|
+
* │ ├── global/ ← global skills from options.skills
|
|
39
|
+
* │ └── packs/ ← pack skills from options.skills (grouped by skill.pack)
|
|
40
|
+
* └── projects/
|
|
41
|
+
* └── {cwd-slug}/
|
|
42
|
+
* ├── memory/
|
|
43
|
+
* └── audits/
|
|
44
|
+
*/
|
|
45
|
+
export declare function runGlobalSeed(appName: string, cwd?: string, options?: GlobalSeedOptions): Promise<SeedResult>;
|
|
46
|
+
//# sourceMappingURL=GlobalSeed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobalSeed.d.ts","sourceRoot":"","sources":["../../../src/cli/bootstrap/GlobalSeed.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAIhE,MAAM,WAAW,UAAU;IACvB,aAAa,EAAG,OAAO,CAAC;IACxB,aAAa,EAAG,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAK,MAAM,EAAE,CAAC;IACzB,YAAY,EAAI,MAAM,EAAE,CAAC;IACzB,YAAY,EAAI,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAC9B;;;;OAIG;IACH,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;CACpB;AA4FD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,aAAa,CAC/B,OAAO,EAAE,MAAM,EACf,GAAG,GAAE,MAAsB,EAC3B,OAAO,GAAE,iBAAsB,GAChC,OAAO,CAAC,UAAU,CAAC,CA+JrB"}
|
|
@@ -0,0 +1,285 @@
|
|
|
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.runGlobalSeed = runGlobalSeed;
|
|
37
|
+
const fs = __importStar(require("fs/promises"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const crypto_1 = require("crypto");
|
|
40
|
+
const agent_core_1 = require("@backendkit-labs/agent-core");
|
|
41
|
+
const config_1 = require("./config");
|
|
42
|
+
const parse_md_skill_1 = require("../skills/parse-md-skill");
|
|
43
|
+
// ── Helpers ───────────────────────────────────────────────────────────────────
|
|
44
|
+
async function fileExists(p) {
|
|
45
|
+
return fs.access(p).then(() => true).catch(() => false);
|
|
46
|
+
}
|
|
47
|
+
async function ensureDir(dir, created) {
|
|
48
|
+
try {
|
|
49
|
+
await fs.mkdir(dir, { recursive: true });
|
|
50
|
+
created.push(dir);
|
|
51
|
+
}
|
|
52
|
+
catch { /* already exists */ }
|
|
53
|
+
}
|
|
54
|
+
// ── Templates ─────────────────────────────────────────────────────────────────
|
|
55
|
+
function buildUserMdTemplate(appName) {
|
|
56
|
+
return `# Developer Preferences
|
|
57
|
+
|
|
58
|
+
> Edited by the user — the agent reads this file at startup.
|
|
59
|
+
|
|
60
|
+
## Communication style
|
|
61
|
+
- Concise, direct responses
|
|
62
|
+
- No summary at the end of each response
|
|
63
|
+
- Code without obvious comments
|
|
64
|
+
|
|
65
|
+
## Preferred stack
|
|
66
|
+
- <!-- E.g.: Node.js + TypeScript, Python, Go -->
|
|
67
|
+
|
|
68
|
+
## Conventions
|
|
69
|
+
- <!-- E.g.: conventional commits, kebab-case for files -->
|
|
70
|
+
|
|
71
|
+
## What I DON'T want
|
|
72
|
+
- Emojis in code
|
|
73
|
+
- Feature flags for direct changes
|
|
74
|
+
- Speculative error handling
|
|
75
|
+
|
|
76
|
+
## Additional notes
|
|
77
|
+
- <!-- Any specific preferences for ${appName} -->
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
function buildAgentMdTemplate(projectName) {
|
|
81
|
+
return `# ${projectName} — Project Instructions
|
|
82
|
+
|
|
83
|
+
> Edited by the team — the agent reads this file on every session.
|
|
84
|
+
|
|
85
|
+
## Stack
|
|
86
|
+
- <!-- E.g.: Node.js 20, TypeScript 5.7, NestJS 11, PostgreSQL -->
|
|
87
|
+
|
|
88
|
+
## Conventions
|
|
89
|
+
- <!-- Folder structure, used patterns, naming -->
|
|
90
|
+
|
|
91
|
+
## Project rules
|
|
92
|
+
- <!-- What the agent MUST and MUST NOT do here -->
|
|
93
|
+
|
|
94
|
+
## Business context
|
|
95
|
+
- <!-- Domain, key entities, main flows -->
|
|
96
|
+
`;
|
|
97
|
+
}
|
|
98
|
+
const AGENTS_README = `# Custom Agents
|
|
99
|
+
|
|
100
|
+
Place \`.json + .md\` file pairs here to define or override agents.
|
|
101
|
+
|
|
102
|
+
## Format
|
|
103
|
+
|
|
104
|
+
**{id}.json** — metadata:
|
|
105
|
+
\`\`\`json
|
|
106
|
+
{
|
|
107
|
+
"id": "my-agent",
|
|
108
|
+
"name": "My Agent",
|
|
109
|
+
"icon": "◇",
|
|
110
|
+
"description": "What this agent does",
|
|
111
|
+
"allowedTools": ["read_file", "write_file", "run_command"],
|
|
112
|
+
"delegatesTo": ["coder"]
|
|
113
|
+
}
|
|
114
|
+
\`\`\`
|
|
115
|
+
|
|
116
|
+
**{id}.md** — system prompt (overrides the json systemPrompt field):
|
|
117
|
+
\`\`\`
|
|
118
|
+
You are a specialist agent for...
|
|
119
|
+
\`\`\`
|
|
120
|
+
|
|
121
|
+
## Override a builtin
|
|
122
|
+
Drop only a \`.md\` file (no \`.json\`) to override just the system prompt
|
|
123
|
+
of an existing builtin agent while keeping its metadata.
|
|
124
|
+
`;
|
|
125
|
+
// ── Public API ────────────────────────────────────────────────────────────────
|
|
126
|
+
/**
|
|
127
|
+
* Idempotent initialization of the framework's global directory structure.
|
|
128
|
+
* Runs at app startup — creates dirs and files only if they don't exist.
|
|
129
|
+
*
|
|
130
|
+
* Creates:
|
|
131
|
+
* ~/.{appName}/
|
|
132
|
+
* ├── config.json
|
|
133
|
+
* ├── USER.md
|
|
134
|
+
* ├── workspaces.json
|
|
135
|
+
* ├── agent-notes/
|
|
136
|
+
* ├── agents/ ← seeded from options.agents
|
|
137
|
+
* ├── skills/
|
|
138
|
+
* │ ├── sources.json
|
|
139
|
+
* │ ├── global/ ← global skills from options.skills
|
|
140
|
+
* │ └── packs/ ← pack skills from options.skills (grouped by skill.pack)
|
|
141
|
+
* └── projects/
|
|
142
|
+
* └── {cwd-slug}/
|
|
143
|
+
* ├── memory/
|
|
144
|
+
* └── audits/
|
|
145
|
+
*/
|
|
146
|
+
async function runGlobalSeed(appName, cwd = process.cwd(), options = {}) {
|
|
147
|
+
const globalDir = (0, agent_core_1.getFrameworkDir)(appName);
|
|
148
|
+
const agentsDir = path.join(globalDir, 'agents');
|
|
149
|
+
const agentNotesDir = path.join(globalDir, 'agent-notes');
|
|
150
|
+
const skillsDir = path.join(globalDir, 'skills');
|
|
151
|
+
const skillsGlobal = path.join(skillsDir, 'global');
|
|
152
|
+
const skillsPacks = path.join(skillsDir, 'packs');
|
|
153
|
+
const projectsDir = path.join(globalDir, 'projects');
|
|
154
|
+
const projectKey = (0, agent_core_1.cwdToProjectKey)(cwd);
|
|
155
|
+
const projectDir = path.join(projectsDir, projectKey);
|
|
156
|
+
const projectName = path.basename(cwd);
|
|
157
|
+
const result = {
|
|
158
|
+
createdConfig: false,
|
|
159
|
+
createdUserMd: false,
|
|
160
|
+
createdAgentMd: false,
|
|
161
|
+
createdDirs: [],
|
|
162
|
+
seededAgents: [],
|
|
163
|
+
seededSkills: 0,
|
|
164
|
+
};
|
|
165
|
+
// ── 1. Core directory structure ───────────────────────────────────────────
|
|
166
|
+
const coreDirs = [
|
|
167
|
+
globalDir,
|
|
168
|
+
agentsDir,
|
|
169
|
+
agentNotesDir,
|
|
170
|
+
skillsDir,
|
|
171
|
+
skillsGlobal,
|
|
172
|
+
skillsPacks,
|
|
173
|
+
projectsDir,
|
|
174
|
+
projectDir,
|
|
175
|
+
path.join(projectDir, 'memory'),
|
|
176
|
+
path.join(projectDir, 'audits'),
|
|
177
|
+
path.join(projectDir, 'skills'),
|
|
178
|
+
path.join(projectDir, 'checkpoints'),
|
|
179
|
+
];
|
|
180
|
+
await Promise.all(coreDirs.map(d => ensureDir(d, result.createdDirs)));
|
|
181
|
+
// ── 2. config.json ────────────────────────────────────────────────────────
|
|
182
|
+
const configPath = path.join(globalDir, 'config.json');
|
|
183
|
+
if (!(await fileExists(configPath))) {
|
|
184
|
+
await fs.writeFile(configPath, JSON.stringify(config_1.DEFAULT_CONFIG, null, 2), 'utf-8');
|
|
185
|
+
result.createdConfig = true;
|
|
186
|
+
}
|
|
187
|
+
// ── 3. USER.md ────────────────────────────────────────────────────────────
|
|
188
|
+
const userMdPath = path.join(globalDir, 'USER.md');
|
|
189
|
+
if (!(await fileExists(userMdPath))) {
|
|
190
|
+
await fs.writeFile(userMdPath, buildUserMdTemplate(appName), 'utf-8');
|
|
191
|
+
result.createdUserMd = true;
|
|
192
|
+
}
|
|
193
|
+
// ── 4. workspaces.json ────────────────────────────────────────────────────
|
|
194
|
+
const workspacesPath = path.join(globalDir, 'workspaces.json');
|
|
195
|
+
if (!(await fileExists(workspacesPath))) {
|
|
196
|
+
await fs.writeFile(workspacesPath, JSON.stringify({}, null, 2), 'utf-8');
|
|
197
|
+
}
|
|
198
|
+
// ── 5. agents/README.md ───────────────────────────────────────────────────
|
|
199
|
+
const agentsReadme = path.join(agentsDir, 'README.md');
|
|
200
|
+
if (!(await fileExists(agentsReadme))) {
|
|
201
|
+
await fs.writeFile(agentsReadme, AGENTS_README, 'utf-8');
|
|
202
|
+
}
|
|
203
|
+
// ── 6. AGENT.md in project root ───────────────────────────────────────────
|
|
204
|
+
const agentMdPath = path.join(cwd, 'AGENT.md');
|
|
205
|
+
if (!(await fileExists(agentMdPath))) {
|
|
206
|
+
await fs.writeFile(agentMdPath, buildAgentMdTemplate(projectName), 'utf-8');
|
|
207
|
+
result.createdAgentMd = true;
|
|
208
|
+
}
|
|
209
|
+
// ── 7. Seed agents (.json + .md pairs) ───────────────────────────────────
|
|
210
|
+
// Re-seeds builtin prompts when the framework updates them, but only if the
|
|
211
|
+
// user has not customized the file. Customization is detected by comparing
|
|
212
|
+
// the current file content hash against the hash stored at seed time
|
|
213
|
+
// (_builtinHash in the .json). If they match → factory default → safe to
|
|
214
|
+
// update. If they differ → user-modified → leave it alone.
|
|
215
|
+
const agentsToSeed = options.agents ?? [];
|
|
216
|
+
await Promise.all(agentsToSeed.map(async (agent) => {
|
|
217
|
+
const jsonPath = path.join(agentsDir, `${agent.id}.json`);
|
|
218
|
+
const mdPath = path.join(agentsDir, `${agent.id}.md`);
|
|
219
|
+
const builtinHash = (0, crypto_1.createHash)('sha256').update(agent.systemPrompt).digest('hex').slice(0, 16);
|
|
220
|
+
const [jsonExists, mdExists] = await Promise.all([
|
|
221
|
+
fileExists(jsonPath),
|
|
222
|
+
fileExists(mdPath),
|
|
223
|
+
]);
|
|
224
|
+
// Read stored hash BEFORE overwriting .json
|
|
225
|
+
const storedHash = jsonExists
|
|
226
|
+
? await fs.readFile(jsonPath, 'utf-8')
|
|
227
|
+
.then(raw => JSON.parse(raw)._builtinHash)
|
|
228
|
+
.catch(() => undefined)
|
|
229
|
+
: undefined;
|
|
230
|
+
// Always write/update metadata .json (never has user content)
|
|
231
|
+
const { systemPrompt, source, systemPromptAddition, ...meta } = agent;
|
|
232
|
+
await fs.writeFile(jsonPath, JSON.stringify({ ...meta, _builtinHash: builtinHash }, null, 2), 'utf-8');
|
|
233
|
+
if (!mdExists) {
|
|
234
|
+
// First seed — write prompt
|
|
235
|
+
await fs.writeFile(mdPath, agent.systemPrompt, 'utf-8');
|
|
236
|
+
result.seededAgents.push(agent.id);
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if (!storedHash) {
|
|
240
|
+
// Pre-hash seed (old install) — treat as factory default, update
|
|
241
|
+
await fs.writeFile(mdPath, agent.systemPrompt, 'utf-8');
|
|
242
|
+
result.seededAgents.push(agent.id);
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
// Compare current file content hash against what was originally seeded
|
|
246
|
+
const currentContent = await fs.readFile(mdPath, 'utf-8');
|
|
247
|
+
const currentHash = (0, crypto_1.createHash)('sha256').update(currentContent).digest('hex').slice(0, 16);
|
|
248
|
+
if (currentHash === storedHash && storedHash !== builtinHash) {
|
|
249
|
+
// File is still factory default but builtin has changed — update
|
|
250
|
+
await fs.writeFile(mdPath, agent.systemPrompt, 'utf-8');
|
|
251
|
+
result.seededAgents.push(agent.id);
|
|
252
|
+
}
|
|
253
|
+
// else: user modified (currentHash !== storedHash) → leave it alone
|
|
254
|
+
// or: already up to date (storedHash === builtinHash) → no-op
|
|
255
|
+
}));
|
|
256
|
+
// ── 8. Seed skills as YAML ────────────────────────────────────────────────
|
|
257
|
+
if (options.skills && options.skills.length > 0) {
|
|
258
|
+
await Promise.all(options.skills.map(async (skill) => {
|
|
259
|
+
const dir = skill.scope === 'pack' && skill.pack
|
|
260
|
+
? path.join(skillsPacks, skill.pack)
|
|
261
|
+
: skillsGlobal;
|
|
262
|
+
await fs.mkdir(dir, { recursive: true });
|
|
263
|
+
const skillPath = path.join(dir, `${skill.name}.md`);
|
|
264
|
+
if (!(await fileExists(skillPath))) {
|
|
265
|
+
await fs.writeFile(skillPath, (0, parse_md_skill_1.skillToMd)(skill), 'utf-8');
|
|
266
|
+
result.seededSkills++;
|
|
267
|
+
}
|
|
268
|
+
}));
|
|
269
|
+
// ── 9. skills/sources.json — registry of installed packs ─────────────
|
|
270
|
+
const sourcesPath = path.join(skillsDir, 'sources.json');
|
|
271
|
+
if (!(await fileExists(sourcesPath))) {
|
|
272
|
+
const packs = [...new Set(options.skills
|
|
273
|
+
.filter(s => s.scope === 'pack' && s.pack)
|
|
274
|
+
.map(s => s.pack))];
|
|
275
|
+
const sources = packs.map(pack => ({
|
|
276
|
+
pack,
|
|
277
|
+
source: 'builtin',
|
|
278
|
+
installedAt: new Date().toISOString(),
|
|
279
|
+
}));
|
|
280
|
+
await fs.writeFile(sourcesPath, JSON.stringify(sources, null, 2), 'utf-8');
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return result;
|
|
284
|
+
}
|
|
285
|
+
//# sourceMappingURL=GlobalSeed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobalSeed.js","sourceRoot":"","sources":["../../../src/cli/bootstrap/GlobalSeed.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiJA,sCAmKC;AApTD,gDAAkC;AAClC,2CAA6B;AAC7B,mCAAoC;AACpC,4DAA+E;AAC/E,qCAA0C;AAC1C,6DAAqD;AA8BrD,iFAAiF;AAEjF,KAAK,UAAU,UAAU,CAAC,CAAS;IAC/B,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,GAAW,EAAE,OAAiB;IACnD,IAAI,CAAC;QACD,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC,CAAC,oBAAoB,CAAC,CAAC;AACpC,CAAC;AAED,iFAAiF;AAEjF,SAAS,mBAAmB,CAAC,OAAe;IACxC,OAAO;;;;;;;;;;;;;;;;;;;;;sCAqB2B,OAAO;CAC5C,CAAC;AACF,CAAC;AAED,SAAS,oBAAoB,CAAC,WAAmB;IAC7C,OAAO,KAAK,WAAW;;;;;;;;;;;;;;;CAe1B,CAAC;AACF,CAAC;AAED,MAAM,aAAa,GAAG;;;;;;;;;;;;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5
|
+
}
|
|
6
|
+
export interface FrameworkFeatures {
|
|
7
|
+
qa: boolean;
|
|
8
|
+
orchestration: boolean;
|
|
9
|
+
reflection: boolean;
|
|
10
|
+
delegation: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface FrameworkConfig {
|
|
13
|
+
version: string;
|
|
14
|
+
defaultProvider: string;
|
|
15
|
+
defaultModel: string;
|
|
16
|
+
defaultAgentId: string;
|
|
17
|
+
maxIterations: number;
|
|
18
|
+
maxParallelAgents: number;
|
|
19
|
+
providers: Record<string, ProviderConfig>;
|
|
20
|
+
features: FrameworkFeatures;
|
|
21
|
+
}
|
|
22
|
+
export declare const DEFAULT_CONFIG: FrameworkConfig;
|
|
23
|
+
export declare function loadFrameworkConfig(appName: string): Promise<FrameworkConfig>;
|
|
24
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/bootstrap/config.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,cAAc;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC1C,QAAQ,EAAE,iBAAiB,CAAC;CAC/B;AAED,eAAO,MAAM,cAAc,EAAE,eAkB5B,CAAC;AAIF,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAQnF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
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.DEFAULT_CONFIG = void 0;
|
|
37
|
+
exports.loadFrameworkConfig = loadFrameworkConfig;
|
|
38
|
+
const fs = __importStar(require("fs/promises"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const agent_core_1 = require("@backendkit-labs/agent-core");
|
|
41
|
+
exports.DEFAULT_CONFIG = {
|
|
42
|
+
version: '2.0.0',
|
|
43
|
+
defaultProvider: 'anthropic',
|
|
44
|
+
defaultModel: 'claude-sonnet-4-6',
|
|
45
|
+
defaultAgentId: 'general',
|
|
46
|
+
maxIterations: 100,
|
|
47
|
+
maxParallelAgents: 6,
|
|
48
|
+
providers: {
|
|
49
|
+
anthropic: { model: 'claude-sonnet-4-6' },
|
|
50
|
+
openai: { model: 'gpt-4o' },
|
|
51
|
+
deepseek: { model: 'deepseek-chat' },
|
|
52
|
+
},
|
|
53
|
+
features: {
|
|
54
|
+
qa: true,
|
|
55
|
+
orchestration: true,
|
|
56
|
+
reflection: true,
|
|
57
|
+
delegation: true,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
// ── Loader ────────────────────────────────────────────────────────────────────
|
|
61
|
+
async function loadFrameworkConfig(appName) {
|
|
62
|
+
const configPath = path.join((0, agent_core_1.getFrameworkDir)(appName), 'config.json');
|
|
63
|
+
try {
|
|
64
|
+
const raw = await fs.readFile(configPath, 'utf-8');
|
|
65
|
+
return { ...exports.DEFAULT_CONFIG, ...JSON.parse(raw) };
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return exports.DEFAULT_CONFIG;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/cli/bootstrap/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,kDAQC;AA5DD,gDAAkC;AAClC,2CAA6B;AAC7B,4DAA8D;AA4BjD,QAAA,cAAc,GAAoB;IAC3C,OAAO,EAAE,OAAO;IAChB,eAAe,EAAE,WAAW;IAC5B,YAAY,EAAE,mBAAmB;IACjC,cAAc,EAAE,SAAS;IACzB,aAAa,EAAE,GAAG;IAClB,iBAAiB,EAAE,CAAC;IACpB,SAAS,EAAE;QACP,SAAS,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE;QACzC,MAAM,EAAK,EAAE,KAAK,EAAE,QAAQ,EAAE;QAC9B,QAAQ,EAAG,EAAE,KAAK,EAAE,eAAe,EAAE;KACxC;IACD,QAAQ,EAAE;QACN,EAAE,EAAc,IAAI;QACpB,aAAa,EAAG,IAAI;QACpB,UAAU,EAAM,IAAI;QACpB,UAAU,EAAM,IAAI;KACvB;CACJ,CAAC;AAEF,iFAAiF;AAE1E,KAAK,UAAU,mBAAmB,CAAC,OAAe;IACrD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAA,4BAAe,EAAC,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC;IACtE,IAAI,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACnD,OAAO,EAAE,GAAG,sBAAc,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAqB,CAAC;IACxE,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,sBAAc,CAAC;IAC1B,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface CheckpointSummary {
|
|
2
|
+
filename: string;
|
|
3
|
+
date: string;
|
|
4
|
+
time: string;
|
|
5
|
+
feature: string;
|
|
6
|
+
path: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function createCheckpoint(projectDir: string, featureName: string, description: string, sessionContent: string): Promise<string>;
|
|
9
|
+
export declare function listCheckpoints(projectDir: string): Promise<CheckpointSummary[]>;
|
|
10
|
+
/** Returns the most recent checkpoint per unique feature name. */
|
|
11
|
+
export declare function getLatestCheckpoints(checkpoints: CheckpointSummary[]): CheckpointSummary[];
|
|
12
|
+
export declare function readCheckpoint(projectDir: string, filename: string): Promise<string | null>;
|
|
13
|
+
/** Extracts only the session state body from a checkpoint file (strips frontmatter + headers). */
|
|
14
|
+
export declare function extractSessionFromCheckpoint(content: string): string;
|
|
15
|
+
export declare function compactSession(projectDir: string, featureName: string, checkpointRef: string): Promise<void>;
|
|
16
|
+
export declare function compactSessionContent(content: string): string;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/checkpoint/index.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CAChB;AAuCD,wBAAsB,gBAAgB,CAClC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,CAAC,CA4CjB;AAED,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAgBtF;AAED,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,iBAAiB,EAAE,GAAG,iBAAiB,EAAE,CAO1F;AAED,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMjG;AAED,kGAAkG;AAClG,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKpE;AAID,wBAAsB,cAAc,CAChC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAO7D"}
|