@shepai/cli 1.14.2 → 1.15.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 +191 -101
- package/dist/src/application/ports/output/external-issue-fetcher.interface.d.ts +69 -0
- package/dist/src/application/ports/output/external-issue-fetcher.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/external-issue-fetcher.interface.js +46 -0
- package/dist/src/application/ports/output/feature-agent-process.interface.d.ts +44 -0
- package/dist/src/application/ports/output/feature-agent-process.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/feature-agent-process.interface.js +12 -0
- package/dist/src/application/ports/output/feature-repository.interface.d.ts +76 -0
- package/dist/src/application/ports/output/feature-repository.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/feature-repository.interface.js +11 -0
- package/dist/src/application/ports/output/index.d.ts +3 -0
- package/dist/src/application/ports/output/index.d.ts.map +1 -1
- package/dist/src/application/ports/output/index.js +1 -1
- package/dist/src/application/ports/output/spec-initializer.interface.d.ts +33 -0
- package/dist/src/application/ports/output/spec-initializer.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/spec-initializer.interface.js +8 -0
- package/dist/src/application/ports/output/worktree-service.interface.d.ts +83 -0
- package/dist/src/application/ports/output/worktree-service.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/worktree-service.interface.js +30 -0
- package/dist/src/application/use-cases/agents/approve-agent-run.use-case.d.ts +22 -0
- package/dist/src/application/use-cases/agents/approve-agent-run.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/agents/approve-agent-run.use-case.js +67 -0
- package/dist/src/application/use-cases/agents/delete-agent-run.use-case.d.ts +16 -0
- package/dist/src/application/use-cases/agents/delete-agent-run.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/agents/delete-agent-run.use-case.js +46 -0
- package/dist/src/application/use-cases/agents/get-agent-run.use-case.d.ts +22 -0
- package/dist/src/application/use-cases/agents/get-agent-run.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/agents/get-agent-run.use-case.js +42 -0
- package/dist/src/application/use-cases/agents/list-agent-runs.use-case.d.ts +21 -0
- package/dist/src/application/use-cases/agents/list-agent-runs.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/agents/list-agent-runs.use-case.js +54 -0
- package/dist/src/application/use-cases/agents/reject-agent-run.use-case.d.ts +16 -0
- package/dist/src/application/use-cases/agents/reject-agent-run.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/agents/reject-agent-run.use-case.js +52 -0
- package/dist/src/application/use-cases/agents/show-agent-run.use-case.d.ts +24 -0
- package/dist/src/application/use-cases/agents/show-agent-run.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/agents/show-agent-run.use-case.js +52 -0
- package/dist/src/application/use-cases/agents/stop-agent-run.use-case.d.ts +15 -0
- package/dist/src/application/use-cases/agents/stop-agent-run.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/agents/stop-agent-run.use-case.js +86 -0
- package/dist/src/application/use-cases/features/create-feature.use-case.d.ts +43 -0
- package/dist/src/application/use-cases/features/create-feature.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/features/create-feature.use-case.js +166 -0
- package/dist/src/application/use-cases/features/delete-feature.use-case.d.ts +27 -0
- package/dist/src/application/use-cases/features/delete-feature.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/features/delete-feature.use-case.js +83 -0
- package/dist/src/application/use-cases/features/list-features.use-case.d.ts +17 -0
- package/dist/src/application/use-cases/features/list-features.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/features/list-features.use-case.js +37 -0
- package/dist/src/application/use-cases/features/resume-feature.use-case.d.ts +24 -0
- package/dist/src/application/use-cases/features/resume-feature.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/features/resume-feature.use-case.js +100 -0
- package/dist/src/application/use-cases/features/show-feature.use-case.d.ts +17 -0
- package/dist/src/application/use-cases/features/show-feature.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/features/show-feature.use-case.js +43 -0
- package/dist/src/domain/generated/output.d.ts +26 -1
- package/dist/src/domain/generated/output.d.ts.map +1 -1
- package/dist/src/domain/generated/output.js +1 -0
- package/dist/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/src/infrastructure/di/container.js +64 -14
- package/dist/src/infrastructure/persistence/sqlite/mappers/agent-run.mapper.d.ts +4 -0
- package/dist/src/infrastructure/persistence/sqlite/mappers/agent-run.mapper.d.ts.map +1 -1
- package/dist/src/infrastructure/persistence/sqlite/mappers/agent-run.mapper.js +8 -0
- package/dist/src/infrastructure/persistence/sqlite/mappers/feature.mapper.d.ts +50 -0
- package/dist/src/infrastructure/persistence/sqlite/mappers/feature.mapper.d.ts.map +1 -0
- package/dist/src/infrastructure/persistence/sqlite/mappers/feature.mapper.js +62 -0
- package/dist/src/infrastructure/persistence/sqlite/migrations.d.ts.map +1 -1
- package/dist/src/infrastructure/persistence/sqlite/migrations.js +49 -0
- package/dist/src/infrastructure/repositories/agent-run.repository.d.ts.map +1 -1
- package/dist/src/infrastructure/repositories/agent-run.repository.js +30 -8
- package/dist/src/infrastructure/repositories/sqlite-feature.repository.d.ts +25 -0
- package/dist/src/infrastructure/repositories/sqlite-feature.repository.d.ts.map +1 -0
- package/dist/src/infrastructure/repositories/sqlite-feature.repository.js +113 -0
- package/dist/src/infrastructure/services/agents/{langgraph → analyze-repo}/analyze-repository-graph.d.ts +0 -22
- package/dist/src/infrastructure/services/agents/analyze-repo/analyze-repository-graph.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/{langgraph → analyze-repo}/analyze-repository-graph.js +4 -11
- package/dist/src/infrastructure/services/agents/analyze-repo/prompts/analyze-repository.prompt.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/{agent-executor-factory.service.d.ts → common/agent-executor-factory.service.d.ts} +3 -3
- package/dist/src/infrastructure/services/agents/common/agent-executor-factory.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/{agent-registry.service.d.ts → common/agent-registry.service.d.ts} +1 -1
- package/dist/src/infrastructure/services/agents/common/agent-registry.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/{agent-registry.service.js → common/agent-registry.service.js} +7 -1
- package/dist/src/infrastructure/services/agents/{agent-runner.service.d.ts → common/agent-runner.service.d.ts} +5 -5
- package/dist/src/infrastructure/services/agents/common/agent-runner.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/{agent-runner.service.js → common/agent-runner.service.js} +4 -4
- package/dist/src/infrastructure/services/agents/{agent-validator.service.d.ts → common/agent-validator.service.d.ts} +2 -2
- package/dist/src/infrastructure/services/agents/common/agent-validator.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/{langgraph → common}/checkpointer.d.ts +1 -0
- package/dist/src/infrastructure/services/agents/common/checkpointer.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/{langgraph → common}/checkpointer.js +6 -0
- package/dist/src/infrastructure/services/agents/{executors → common/executors}/claude-code-executor.service.d.ts +9 -2
- package/dist/src/infrastructure/services/agents/common/executors/claude-code-executor.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/{executors → common/executors}/claude-code-executor.service.js +103 -6
- package/dist/src/infrastructure/services/agents/common/executors/mock-executor-factory.service.d.ts +15 -0
- package/dist/src/infrastructure/services/agents/common/executors/mock-executor-factory.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/common/executors/mock-executor-factory.service.js +16 -0
- package/dist/src/infrastructure/services/agents/common/executors/mock-executor.service.d.ts +17 -0
- package/dist/src/infrastructure/services/agents/common/executors/mock-executor.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/common/executors/mock-executor.service.js +49 -0
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts +244 -0
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-graph.js +36 -0
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts +20 -0
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.js +90 -0
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts +31 -0
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js +236 -0
- package/dist/src/infrastructure/services/agents/feature-agent/heartbeat.d.ts +19 -0
- package/dist/src/infrastructure/services/agents/feature-agent/heartbeat.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/heartbeat.js +38 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/analyze.node.d.ts +7 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/analyze.node.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/analyze.node.js +9 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/implement.node.d.ts +11 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/implement.node.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/implement.node.js +23 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts +40 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +114 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/plan.node.d.ts +7 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/plan.node.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/plan.node.js +9 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.d.ts +9 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.js +94 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/implement.prompt.d.ts +8 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/implement.prompt.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/implement.prompt.js +18 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.d.ts +11 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.js +170 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.d.ts +10 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.js +116 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.d.ts +10 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/prompts/research.prompt.js +121 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/requirements.node.d.ts +7 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/requirements.node.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/requirements.node.js +9 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/research.node.d.ts +7 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/research.node.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/nodes/research.node.js +9 -0
- package/dist/src/infrastructure/services/agents/feature-agent/state.d.ts +39 -0
- package/dist/src/infrastructure/services/agents/feature-agent/state.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/feature-agent/state.js +27 -0
- package/dist/src/infrastructure/services/external/github-issue.service.d.ts +19 -0
- package/dist/src/infrastructure/services/external/github-issue.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/external/github-issue.service.js +59 -0
- package/dist/src/infrastructure/services/external/jira-ticket.service.d.ts +23 -0
- package/dist/src/infrastructure/services/external/jira-ticket.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/external/jira-ticket.service.js +57 -0
- package/dist/src/infrastructure/services/git/worktree.service.d.ts +28 -0
- package/dist/src/infrastructure/services/git/worktree.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/git/worktree.service.js +112 -0
- package/dist/src/infrastructure/services/spec/spec-initializer.service.d.ts +17 -0
- package/dist/src/infrastructure/services/spec/spec-initializer.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/spec/spec-initializer.service.js +281 -0
- package/dist/src/presentation/cli/commands/agent/approve.command.d.ts +11 -0
- package/dist/src/presentation/cli/commands/agent/approve.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/agent/approve.command.js +42 -0
- package/dist/src/presentation/cli/commands/agent/delete.command.d.ts +11 -0
- package/dist/src/presentation/cli/commands/agent/delete.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/agent/delete.command.js +49 -0
- package/dist/src/presentation/cli/commands/agent/index.d.ts +21 -0
- package/dist/src/presentation/cli/commands/agent/index.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/agent/index.js +38 -0
- package/dist/src/presentation/cli/commands/agent/logs.command.d.ts +13 -0
- package/dist/src/presentation/cli/commands/agent/logs.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/agent/logs.command.js +163 -0
- package/dist/src/presentation/cli/commands/agent/ls.command.d.ts +12 -0
- package/dist/src/presentation/cli/commands/agent/ls.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/agent/ls.command.js +111 -0
- package/dist/src/presentation/cli/commands/agent/reject.command.d.ts +11 -0
- package/dist/src/presentation/cli/commands/agent/reject.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/agent/reject.command.js +43 -0
- package/dist/src/presentation/cli/commands/agent/resolve-run.d.ts +10 -0
- package/dist/src/presentation/cli/commands/agent/resolve-run.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/agent/resolve-run.js +27 -0
- package/dist/src/presentation/cli/commands/agent/show.command.d.ts +12 -0
- package/dist/src/presentation/cli/commands/agent/show.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/agent/show.command.js +202 -0
- package/dist/src/presentation/cli/commands/agent/stop.command.d.ts +11 -0
- package/dist/src/presentation/cli/commands/agent/stop.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/agent/stop.command.js +42 -0
- package/dist/src/presentation/cli/commands/feat/del.command.d.ts +17 -0
- package/dist/src/presentation/cli/commands/feat/del.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/feat/del.command.js +55 -0
- package/dist/src/presentation/cli/commands/feat/index.d.ts +17 -0
- package/dist/src/presentation/cli/commands/feat/index.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/feat/index.js +29 -0
- package/dist/src/presentation/cli/commands/feat/ls.command.d.ts +15 -0
- package/dist/src/presentation/cli/commands/feat/ls.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/feat/ls.command.js +112 -0
- package/dist/src/presentation/cli/commands/feat/new.command.d.ts +17 -0
- package/dist/src/presentation/cli/commands/feat/new.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/feat/new.command.js +64 -0
- package/dist/src/presentation/cli/commands/feat/resume.command.d.ts +11 -0
- package/dist/src/presentation/cli/commands/feat/resume.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/feat/resume.command.js +33 -0
- package/dist/src/presentation/cli/commands/feat/show.command.d.ts +11 -0
- package/dist/src/presentation/cli/commands/feat/show.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/feat/show.command.js +128 -0
- package/dist/src/presentation/cli/index.d.ts +8 -4
- package/dist/src/presentation/cli/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/index.js +12 -4
- package/dist/src/presentation/cli/ui/detail-view.d.ts +43 -0
- package/dist/src/presentation/cli/ui/detail-view.d.ts.map +1 -0
- package/dist/src/presentation/cli/ui/detail-view.js +57 -0
- package/dist/src/presentation/cli/ui/index.d.ts +2 -0
- package/dist/src/presentation/cli/ui/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/ui/index.js +2 -0
- package/dist/src/presentation/cli/ui/list-view.d.ts +34 -0
- package/dist/src/presentation/cli/ui/list-view.d.ts.map +1 -0
- package/dist/src/presentation/cli/ui/list-view.js +65 -0
- package/dist/src/presentation/cli/ui/symbols.d.ts +5 -1
- package/dist/src/presentation/cli/ui/symbols.d.ts.map +1 -1
- package/dist/src/presentation/cli/ui/symbols.js +4 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/cache/.previewinfo +1 -1
- package/web/.next/cache/.rscinfo +1 -1
- package/web/.next/cache/config.json +3 -3
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +1 -1
- package/web/.next/required-server-files.json +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.html +2 -2
- package/web/.next/server/app/_not-found.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/index.html +2 -2
- package/web/.next/server/app/index.rsc +1 -1
- package/web/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/version.html +2 -2
- package/web/.next/server/app/version.rsc +1 -1
- package/web/.next/server/app/version.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/version/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/version.segment.rsc +1 -1
- package/web/.next/server/chunks/ssr/_19be0743._.js +1 -1
- package/web/.next/server/pages/404.html +2 -2
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +1 -1
- package/web/.next/trace +1 -1
- package/web/.next/trace-build +1 -1
- package/dist/src/infrastructure/services/agents/agent-executor-factory.service.d.ts.map +0 -1
- package/dist/src/infrastructure/services/agents/agent-registry.service.d.ts.map +0 -1
- package/dist/src/infrastructure/services/agents/agent-runner.service.d.ts.map +0 -1
- package/dist/src/infrastructure/services/agents/agent-validator.service.d.ts.map +0 -1
- package/dist/src/infrastructure/services/agents/executors/claude-code-executor.service.d.ts.map +0 -1
- package/dist/src/infrastructure/services/agents/langgraph/analyze-repository-graph.d.ts.map +0 -1
- package/dist/src/infrastructure/services/agents/langgraph/checkpointer.d.ts.map +0 -1
- package/dist/src/infrastructure/services/agents/langgraph/prompts/analyze-repository.prompt.d.ts.map +0 -1
- /package/dist/src/infrastructure/services/agents/{langgraph → analyze-repo}/prompts/analyze-repository.prompt.d.ts +0 -0
- /package/dist/src/infrastructure/services/agents/{langgraph → analyze-repo}/prompts/analyze-repository.prompt.js +0 -0
- /package/dist/src/infrastructure/services/agents/{agent-executor-factory.service.js → common/agent-executor-factory.service.js} +0 -0
- /package/dist/src/infrastructure/services/agents/{agent-validator.service.js → common/agent-validator.service.js} +0 -0
- /package/web/.next/static/{rCkFI74-eja9LrkBfHFpp → XV-wYY85Xk9ANCuQDQ6_H}/_buildManifest.js +0 -0
- /package/web/.next/static/{rCkFI74-eja9LrkBfHFpp → XV-wYY85Xk9ANCuQDQ6_H}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{rCkFI74-eja9LrkBfHFpp → XV-wYY85Xk9ANCuQDQ6_H}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Issue Fetcher Service
|
|
3
|
+
*
|
|
4
|
+
* Fetches GitHub issues using the gh CLI subprocess.
|
|
5
|
+
* Supports owner/repo#number and #number (current repo) formats.
|
|
6
|
+
*/
|
|
7
|
+
import { IssueNotFoundError, IssueServiceUnavailableError, } from '../../../application/ports/output/external-issue-fetcher.interface.js';
|
|
8
|
+
export class GitHubIssueFetcher {
|
|
9
|
+
execFile;
|
|
10
|
+
constructor(execFile) {
|
|
11
|
+
this.execFile = execFile;
|
|
12
|
+
}
|
|
13
|
+
async fetchGitHubIssue(ref) {
|
|
14
|
+
const { issueNumber, repo } = this.parseRef(ref);
|
|
15
|
+
const args = ['issue', 'view', issueNumber];
|
|
16
|
+
if (repo) {
|
|
17
|
+
args.push('--repo', repo);
|
|
18
|
+
}
|
|
19
|
+
args.push('--json', 'title,body,labels,url');
|
|
20
|
+
try {
|
|
21
|
+
const { stdout } = await this.execFile('gh', args, { timeout: 30_000 });
|
|
22
|
+
const data = JSON.parse(stdout);
|
|
23
|
+
return {
|
|
24
|
+
title: data.title,
|
|
25
|
+
description: data.body ?? '',
|
|
26
|
+
labels: data.labels.map((l) => l.name),
|
|
27
|
+
url: data.url,
|
|
28
|
+
source: 'github',
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
33
|
+
if (error.code === 'ENOENT') {
|
|
34
|
+
throw new IssueServiceUnavailableError('GitHub CLI (gh) is not installed. Install it from https://cli.github.com/');
|
|
35
|
+
}
|
|
36
|
+
if (error.message.includes('Could not resolve')) {
|
|
37
|
+
throw new IssueNotFoundError(`GitHub issue ${ref} not found`);
|
|
38
|
+
}
|
|
39
|
+
throw new IssueNotFoundError(`Failed to fetch GitHub issue ${ref}: ${error.message}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
parseRef(ref) {
|
|
43
|
+
// Format: owner/repo#123
|
|
44
|
+
const fullMatch = ref.match(/^([^#]+)#(\d+)$/);
|
|
45
|
+
if (fullMatch) {
|
|
46
|
+
return { issueNumber: fullMatch[2], repo: fullMatch[1] };
|
|
47
|
+
}
|
|
48
|
+
// Format: #123
|
|
49
|
+
const hashMatch = ref.match(/^#(\d+)$/);
|
|
50
|
+
if (hashMatch) {
|
|
51
|
+
return { issueNumber: hashMatch[1] };
|
|
52
|
+
}
|
|
53
|
+
// Format: plain number
|
|
54
|
+
if (/^\d+$/.test(ref)) {
|
|
55
|
+
return { issueNumber: ref };
|
|
56
|
+
}
|
|
57
|
+
throw new IssueNotFoundError(`Invalid GitHub issue reference: ${ref}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jira Ticket Fetcher Service
|
|
3
|
+
*
|
|
4
|
+
* Fetches Jira tickets using the Jira REST API v3 via fetch.
|
|
5
|
+
* Requires baseUrl, email, and API token for authentication.
|
|
6
|
+
*/
|
|
7
|
+
import type { IExternalIssueFetcher, ExternalIssue } from '../../../application/ports/output/external-issue-fetcher.interface.js';
|
|
8
|
+
type FetchFn = (url: string, init?: RequestInit) => Promise<Response>;
|
|
9
|
+
export interface JiraConfig {
|
|
10
|
+
baseUrl: string;
|
|
11
|
+
email: string;
|
|
12
|
+
token: string;
|
|
13
|
+
fetchFn?: FetchFn;
|
|
14
|
+
}
|
|
15
|
+
export declare class JiraTicketFetcher implements Pick<IExternalIssueFetcher, 'fetchJiraTicket'> {
|
|
16
|
+
private readonly baseUrl;
|
|
17
|
+
private readonly authHeader;
|
|
18
|
+
private readonly fetchFn;
|
|
19
|
+
constructor(config: JiraConfig);
|
|
20
|
+
fetchJiraTicket(key: string): Promise<ExternalIssue>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=jira-ticket.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jira-ticket.service.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/services/external/jira-ticket.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,aAAa,EACd,MAAM,gEAAgE,CAAC;AAOxE,KAAK,OAAO,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEtE,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,iBAAkB,YAAW,IAAI,CAAC,qBAAqB,EAAE,iBAAiB,CAAC;IACtF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;gBAEtB,MAAM,EAAE,UAAU;IAYxB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAqD3D"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jira Ticket Fetcher Service
|
|
3
|
+
*
|
|
4
|
+
* Fetches Jira tickets using the Jira REST API v3 via fetch.
|
|
5
|
+
* Requires baseUrl, email, and API token for authentication.
|
|
6
|
+
*/
|
|
7
|
+
import { IssueNotFoundError, IssueAuthenticationError, IssueServiceUnavailableError, } from '../../../application/ports/output/external-issue-fetcher.interface.js';
|
|
8
|
+
export class JiraTicketFetcher {
|
|
9
|
+
baseUrl;
|
|
10
|
+
authHeader;
|
|
11
|
+
fetchFn;
|
|
12
|
+
constructor(config) {
|
|
13
|
+
if (!config.baseUrl) {
|
|
14
|
+
throw new IssueServiceUnavailableError('Jira configuration is incomplete: baseUrl is required');
|
|
15
|
+
}
|
|
16
|
+
this.baseUrl = config.baseUrl.replace(/\/$/, '');
|
|
17
|
+
this.authHeader = `Basic ${Buffer.from(`${config.email}:${config.token}`).toString('base64')}`;
|
|
18
|
+
this.fetchFn = config.fetchFn ?? globalThis.fetch;
|
|
19
|
+
}
|
|
20
|
+
async fetchJiraTicket(key) {
|
|
21
|
+
const url = `${this.baseUrl}/rest/api/3/issue/${key}?fields=summary,description,labels`;
|
|
22
|
+
try {
|
|
23
|
+
const response = await this.fetchFn(url, {
|
|
24
|
+
headers: {
|
|
25
|
+
Authorization: this.authHeader,
|
|
26
|
+
Accept: 'application/json',
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
if (response.status === 404) {
|
|
31
|
+
throw new IssueNotFoundError(`Jira ticket ${key} not found`);
|
|
32
|
+
}
|
|
33
|
+
if (response.status === 401 || response.status === 403) {
|
|
34
|
+
throw new IssueAuthenticationError(`Jira authentication failed (${response.status}): check your email and API token`);
|
|
35
|
+
}
|
|
36
|
+
throw new IssueServiceUnavailableError(`Jira API returned ${response.status}`);
|
|
37
|
+
}
|
|
38
|
+
const data = (await response.json());
|
|
39
|
+
return {
|
|
40
|
+
title: data.fields.summary,
|
|
41
|
+
description: data.fields.description ?? '',
|
|
42
|
+
labels: data.fields.labels ?? [],
|
|
43
|
+
url: `${this.baseUrl}/browse/${key}`,
|
|
44
|
+
source: 'jira',
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
// Re-throw our own errors
|
|
49
|
+
if (err instanceof IssueNotFoundError ||
|
|
50
|
+
err instanceof IssueAuthenticationError ||
|
|
51
|
+
err instanceof IssueServiceUnavailableError) {
|
|
52
|
+
throw err;
|
|
53
|
+
}
|
|
54
|
+
throw new IssueServiceUnavailableError(`Failed to connect to Jira: ${err instanceof Error ? err.message : String(err)}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Worktree Service Implementation
|
|
3
|
+
*
|
|
4
|
+
* Manages git worktrees using native execFile for process execution.
|
|
5
|
+
* Uses constructor dependency injection for the command executor
|
|
6
|
+
* to enable testability without mocking node:child_process directly.
|
|
7
|
+
*/
|
|
8
|
+
import type { IWorktreeService, WorktreeInfo } from '../../../application/ports/output/worktree-service.interface.js';
|
|
9
|
+
/**
|
|
10
|
+
* Type for the command executor dependency.
|
|
11
|
+
* Matches the promisified signature of child_process.execFile.
|
|
12
|
+
*/
|
|
13
|
+
export type ExecFunction = (file: string, args: string[], options?: object) => Promise<{
|
|
14
|
+
stdout: string;
|
|
15
|
+
stderr: string;
|
|
16
|
+
}>;
|
|
17
|
+
export declare class WorktreeService implements IWorktreeService {
|
|
18
|
+
private readonly execFile;
|
|
19
|
+
constructor(execFile: ExecFunction);
|
|
20
|
+
create(repoPath: string, branch: string, worktreePath: string): Promise<WorktreeInfo>;
|
|
21
|
+
remove(worktreePath: string): Promise<void>;
|
|
22
|
+
list(repoPath: string): Promise<WorktreeInfo[]>;
|
|
23
|
+
exists(repoPath: string, branch: string): Promise<boolean>;
|
|
24
|
+
getWorktreePath(repoPath: string, branch: string): string;
|
|
25
|
+
private parseWorktreeOutput;
|
|
26
|
+
private parseGitError;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=worktree.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree.service.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/services/git/worktree.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,iEAAiE,CAAC;AAOzE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE,MAAM,KACb,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEjD,qBACa,eAAgB,YAAW,gBAAgB;IAClB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,YAAY;IAErE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAqBrF,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ3C,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAO/C,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKhE,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAMzD,OAAO,CAAC,mBAAmB;IA2B3B,OAAO,CAAC,aAAa;CA+BtB"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Worktree Service Implementation
|
|
3
|
+
*
|
|
4
|
+
* Manages git worktrees using native execFile for process execution.
|
|
5
|
+
* Uses constructor dependency injection for the command executor
|
|
6
|
+
* to enable testability without mocking node:child_process directly.
|
|
7
|
+
*/
|
|
8
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
9
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
11
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
12
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13
|
+
};
|
|
14
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
15
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
16
|
+
};
|
|
17
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
18
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
19
|
+
};
|
|
20
|
+
import { createHash } from 'node:crypto';
|
|
21
|
+
import path from 'node:path';
|
|
22
|
+
import { injectable, inject } from 'tsyringe';
|
|
23
|
+
import { WorktreeError, WorktreeErrorCode, } from '../../../application/ports/output/worktree-service.interface.js';
|
|
24
|
+
import { SHEP_HOME_DIR } from '../filesystem/shep-directory.service.js';
|
|
25
|
+
let WorktreeService = class WorktreeService {
|
|
26
|
+
execFile;
|
|
27
|
+
constructor(execFile) {
|
|
28
|
+
this.execFile = execFile;
|
|
29
|
+
}
|
|
30
|
+
async create(repoPath, branch, worktreePath) {
|
|
31
|
+
try {
|
|
32
|
+
await this.execFile('git', ['worktree', 'add', worktreePath, '-b', branch], {
|
|
33
|
+
cwd: repoPath,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
throw this.parseGitError(error);
|
|
38
|
+
}
|
|
39
|
+
// Get info about the created worktree
|
|
40
|
+
const worktrees = await this.list(repoPath);
|
|
41
|
+
const created = worktrees.find((w) => w.path === worktreePath);
|
|
42
|
+
if (!created) {
|
|
43
|
+
throw new WorktreeError('Worktree created but not found in list', WorktreeErrorCode.GIT_ERROR);
|
|
44
|
+
}
|
|
45
|
+
return created;
|
|
46
|
+
}
|
|
47
|
+
async remove(worktreePath) {
|
|
48
|
+
try {
|
|
49
|
+
await this.execFile('git', ['worktree', 'remove', worktreePath], {});
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
throw this.parseGitError(error);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async list(repoPath) {
|
|
56
|
+
const { stdout } = await this.execFile('git', ['worktree', 'list', '--porcelain'], {
|
|
57
|
+
cwd: repoPath,
|
|
58
|
+
});
|
|
59
|
+
return this.parseWorktreeOutput(stdout);
|
|
60
|
+
}
|
|
61
|
+
async exists(repoPath, branch) {
|
|
62
|
+
const worktrees = await this.list(repoPath);
|
|
63
|
+
return worktrees.some((w) => w.branch === branch);
|
|
64
|
+
}
|
|
65
|
+
getWorktreePath(repoPath, branch) {
|
|
66
|
+
const repoHash = createHash('sha256').update(repoPath).digest('hex').slice(0, 16);
|
|
67
|
+
const slug = branch.replace(/\//g, '-');
|
|
68
|
+
return path.join(SHEP_HOME_DIR, 'repos', repoHash, 'wt', slug);
|
|
69
|
+
}
|
|
70
|
+
parseWorktreeOutput(output) {
|
|
71
|
+
if (!output.trim())
|
|
72
|
+
return [];
|
|
73
|
+
const worktrees = [];
|
|
74
|
+
const blocks = output.split('\n\n').filter((b) => b.trim());
|
|
75
|
+
for (const block of blocks) {
|
|
76
|
+
const lines = block.split('\n');
|
|
77
|
+
const wtPath = lines.find((l) => l.startsWith('worktree '))?.slice('worktree '.length) ?? '';
|
|
78
|
+
const head = lines.find((l) => l.startsWith('HEAD '))?.slice('HEAD '.length) ?? '';
|
|
79
|
+
const branchLine = lines.find((l) => l.startsWith('branch '));
|
|
80
|
+
const fullBranch = branchLine?.slice('branch '.length) ?? '';
|
|
81
|
+
const branch = fullBranch.replace('refs/heads/', '');
|
|
82
|
+
if (wtPath) {
|
|
83
|
+
worktrees.push({
|
|
84
|
+
path: wtPath,
|
|
85
|
+
head,
|
|
86
|
+
branch,
|
|
87
|
+
isMain: worktrees.length === 0, // First entry is always main
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return worktrees;
|
|
92
|
+
}
|
|
93
|
+
parseGitError(error) {
|
|
94
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
95
|
+
if (message.includes('already exists')) {
|
|
96
|
+
return new WorktreeError(message, WorktreeErrorCode.ALREADY_EXISTS, error instanceof Error ? error : undefined);
|
|
97
|
+
}
|
|
98
|
+
if (message.includes('already checked out') || message.includes('is already checked out')) {
|
|
99
|
+
return new WorktreeError(message, WorktreeErrorCode.BRANCH_IN_USE, error instanceof Error ? error : undefined);
|
|
100
|
+
}
|
|
101
|
+
if (message.includes('not a valid directory') || message.includes('is not a working tree')) {
|
|
102
|
+
return new WorktreeError(message, WorktreeErrorCode.NOT_FOUND, error instanceof Error ? error : undefined);
|
|
103
|
+
}
|
|
104
|
+
return new WorktreeError(message, WorktreeErrorCode.GIT_ERROR, error instanceof Error ? error : undefined);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
WorktreeService = __decorate([
|
|
108
|
+
injectable(),
|
|
109
|
+
__param(0, inject('ExecFunction')),
|
|
110
|
+
__metadata("design:paramtypes", [Function])
|
|
111
|
+
], WorktreeService);
|
|
112
|
+
export { WorktreeService };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spec Initializer Service
|
|
3
|
+
*
|
|
4
|
+
* Creates feature specification directories with YAML template files.
|
|
5
|
+
* Templates match exactly what /shep-kit:new-feature produces,
|
|
6
|
+
* enabling dogfooding — the CLI and the skill use the same spec format.
|
|
7
|
+
*/
|
|
8
|
+
import type { ISpecInitializerService, SpecInitializerResult } from '../../../application/ports/output/spec-initializer.interface.js';
|
|
9
|
+
export declare class SpecInitializerService implements ISpecInitializerService {
|
|
10
|
+
initialize(basePath: string, slug: string, featureNumber: number, description: string): Promise<SpecInitializerResult>;
|
|
11
|
+
/**
|
|
12
|
+
* Scan specs/ for existing NNN-* directories and return the next available number.
|
|
13
|
+
* Uses the DB-derived hint as a minimum, but always respects filesystem state.
|
|
14
|
+
*/
|
|
15
|
+
private resolveNextNumber;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=spec-initializer.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-initializer.service.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/services/spec/spec-initializer.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,0DAA0D,CAAC;AA4PlE,qBAAa,sBAAuB,YAAW,uBAAuB;IAC9D,UAAU,CACd,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,CAAC;IA4BjC;;;OAGG;YACW,iBAAiB;CAoBhC"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spec Initializer Service
|
|
3
|
+
*
|
|
4
|
+
* Creates feature specification directories with YAML template files.
|
|
5
|
+
* Templates match exactly what /shep-kit:new-feature produces,
|
|
6
|
+
* enabling dogfooding — the CLI and the skill use the same spec format.
|
|
7
|
+
*/
|
|
8
|
+
import { mkdir, readdir, writeFile } from 'node:fs/promises';
|
|
9
|
+
import { join } from 'node:path';
|
|
10
|
+
/**
|
|
11
|
+
* Pad a number to 3 digits with leading zeros.
|
|
12
|
+
*/
|
|
13
|
+
function padNumber(n) {
|
|
14
|
+
return String(n).padStart(3, '0');
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Apply template variable substitution matching init-feature.sh behavior.
|
|
18
|
+
* Handles both {{VAR}} and { { VAR } } (Prettier-formatted) patterns.
|
|
19
|
+
*/
|
|
20
|
+
function applyTemplate(template, vars) {
|
|
21
|
+
const replacements = [
|
|
22
|
+
[/\{\{ ?NNN ?\}\}|\{ \{ NNN \} \}/g, vars.nnn],
|
|
23
|
+
[/\{\{ ?FEATURE_NAME ?\}\}|\{ \{ FEATURE_NAME \} \}/g, vars.slug],
|
|
24
|
+
[/\{\{ ?FEATURE_ID ?\}\}|\{ \{ FEATURE_ID \} \}/g, `${vars.nnn}-${vars.slug}`],
|
|
25
|
+
[/\{\{ ?FEATURE_NUMBER ?\}\}|\{ \{ FEATURE_NUMBER \} \}/g, String(vars.featureNumber)],
|
|
26
|
+
[/\{\{ ?BRANCH_NAME ?\}\}|\{ \{ BRANCH_NAME \} \}/g, `feat/${vars.nnn}-${vars.slug}`],
|
|
27
|
+
[/\{\{ ?DATE ?\}\}|\{ \{ DATE \} \}/g, vars.date],
|
|
28
|
+
[/\{\{ ?TIMESTAMP ?\}\}|\{ \{ TIMESTAMP \} \}/g, vars.timestamp],
|
|
29
|
+
[/\{\{ ?DESCRIPTION ?\}\}|\{ \{ DESCRIPTION \} \}/g, vars.description],
|
|
30
|
+
];
|
|
31
|
+
let result = template;
|
|
32
|
+
for (const [pattern, replacement] of replacements) {
|
|
33
|
+
result = result.replace(pattern, replacement);
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
// ─── YAML Templates ────────────────────────────────────────────────
|
|
38
|
+
// These match .claude/skills/shep-kit:new-feature/templates/ exactly.
|
|
39
|
+
const SPEC_YAML = `# Feature Specification (YAML)
|
|
40
|
+
# This is the source of truth. Markdown is auto-generated from this file.
|
|
41
|
+
|
|
42
|
+
name: {{FEATURE_NAME}}
|
|
43
|
+
number: {{NNN}}
|
|
44
|
+
branch: feat/{{NNN}}-{{FEATURE_NAME}}
|
|
45
|
+
oneLiner: {{DESCRIPTION}}
|
|
46
|
+
summary: >
|
|
47
|
+
{{DESCRIPTION}}
|
|
48
|
+
phase: Analysis
|
|
49
|
+
sizeEstimate: M
|
|
50
|
+
|
|
51
|
+
# Relationships
|
|
52
|
+
relatedFeatures:
|
|
53
|
+
[]
|
|
54
|
+
|
|
55
|
+
technologies:
|
|
56
|
+
[]
|
|
57
|
+
|
|
58
|
+
relatedLinks:
|
|
59
|
+
[]
|
|
60
|
+
|
|
61
|
+
# Open questions (must be resolved before implementation)
|
|
62
|
+
openQuestions:
|
|
63
|
+
[]
|
|
64
|
+
|
|
65
|
+
# Markdown content (the actual spec)
|
|
66
|
+
content: |
|
|
67
|
+
## Problem Statement
|
|
68
|
+
|
|
69
|
+
{{DESCRIPTION}}
|
|
70
|
+
|
|
71
|
+
## Success Criteria
|
|
72
|
+
|
|
73
|
+
- [ ] TBD
|
|
74
|
+
|
|
75
|
+
## Affected Areas
|
|
76
|
+
|
|
77
|
+
| Area | Impact | Reasoning |
|
|
78
|
+
| ---- | ------ | --------- |
|
|
79
|
+
| TBD | TBD | TBD |
|
|
80
|
+
|
|
81
|
+
## Dependencies
|
|
82
|
+
|
|
83
|
+
None identified.
|
|
84
|
+
|
|
85
|
+
## Size Estimate
|
|
86
|
+
|
|
87
|
+
**M** - To be refined during research
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
_Generated by feature agent — proceed with research_
|
|
92
|
+
`;
|
|
93
|
+
const RESEARCH_YAML = `# Research Artifact (YAML)
|
|
94
|
+
# This is the source of truth. Markdown is auto-generated from this file.
|
|
95
|
+
|
|
96
|
+
name: {{FEATURE_NAME}}
|
|
97
|
+
summary: Technical analysis for {{NNN}}-{{FEATURE_NAME}}
|
|
98
|
+
|
|
99
|
+
# Relationships
|
|
100
|
+
relatedFeatures: []
|
|
101
|
+
technologies: []
|
|
102
|
+
relatedLinks: []
|
|
103
|
+
|
|
104
|
+
# Structured technology decisions
|
|
105
|
+
decisions: []
|
|
106
|
+
|
|
107
|
+
# Open questions (should be resolved by end of research)
|
|
108
|
+
openQuestions: []
|
|
109
|
+
|
|
110
|
+
# Markdown content (the full research document)
|
|
111
|
+
content: |
|
|
112
|
+
## Status
|
|
113
|
+
|
|
114
|
+
- **Phase:** Research
|
|
115
|
+
- **Updated:** {{DATE}}
|
|
116
|
+
|
|
117
|
+
## Technology Decisions
|
|
118
|
+
|
|
119
|
+
TBD
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
_To be updated during research phase_
|
|
124
|
+
`;
|
|
125
|
+
const PLAN_YAML = `# Implementation Plan (YAML)
|
|
126
|
+
# This is the source of truth. Markdown is auto-generated from this file.
|
|
127
|
+
|
|
128
|
+
name: {{FEATURE_NAME}}
|
|
129
|
+
summary: Implementation plan for {{NNN}}-{{FEATURE_NAME}}
|
|
130
|
+
|
|
131
|
+
# Relationships
|
|
132
|
+
relatedFeatures: []
|
|
133
|
+
technologies: []
|
|
134
|
+
relatedLinks: []
|
|
135
|
+
|
|
136
|
+
# Structured implementation phases
|
|
137
|
+
phases: []
|
|
138
|
+
|
|
139
|
+
# File change tracking
|
|
140
|
+
filesToCreate: []
|
|
141
|
+
filesToModify: []
|
|
142
|
+
|
|
143
|
+
# Open questions (should all be resolved before implementation)
|
|
144
|
+
openQuestions: []
|
|
145
|
+
|
|
146
|
+
# Markdown content (the full plan document)
|
|
147
|
+
content: |
|
|
148
|
+
## Status
|
|
149
|
+
|
|
150
|
+
- **Phase:** Planning
|
|
151
|
+
- **Updated:** {{DATE}}
|
|
152
|
+
|
|
153
|
+
## Implementation Strategy
|
|
154
|
+
|
|
155
|
+
TBD
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
_To be updated during planning phase_
|
|
160
|
+
`;
|
|
161
|
+
const TASKS_YAML = `# Task Breakdown (YAML)
|
|
162
|
+
# This is the source of truth. Markdown is auto-generated from this file.
|
|
163
|
+
|
|
164
|
+
name: {{FEATURE_NAME}}
|
|
165
|
+
summary: Task breakdown for {{NNN}}-{{FEATURE_NAME}}
|
|
166
|
+
|
|
167
|
+
# Relationships
|
|
168
|
+
relatedFeatures: []
|
|
169
|
+
technologies: []
|
|
170
|
+
relatedLinks: []
|
|
171
|
+
|
|
172
|
+
# Structured task list
|
|
173
|
+
tasks: []
|
|
174
|
+
|
|
175
|
+
# Total effort estimate
|
|
176
|
+
totalEstimate: TBD
|
|
177
|
+
|
|
178
|
+
# Open questions
|
|
179
|
+
openQuestions: []
|
|
180
|
+
|
|
181
|
+
# Markdown content (the full tasks document)
|
|
182
|
+
content: |
|
|
183
|
+
## Status
|
|
184
|
+
|
|
185
|
+
- **Phase:** Implementation
|
|
186
|
+
- **Updated:** {{DATE}}
|
|
187
|
+
|
|
188
|
+
## Task List
|
|
189
|
+
|
|
190
|
+
TBD
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
_Task breakdown for implementation tracking_
|
|
195
|
+
`;
|
|
196
|
+
const FEATURE_YAML = `feature:
|
|
197
|
+
id: '{{FEATURE_ID}}'
|
|
198
|
+
name: '{{FEATURE_NAME}}'
|
|
199
|
+
number: {{FEATURE_NUMBER}}
|
|
200
|
+
branch: '{{BRANCH_NAME}}'
|
|
201
|
+
lifecycle: 'research'
|
|
202
|
+
createdAt: '{{TIMESTAMP}}'
|
|
203
|
+
|
|
204
|
+
status:
|
|
205
|
+
phase: 'research'
|
|
206
|
+
progress:
|
|
207
|
+
completed: 0
|
|
208
|
+
total: 0
|
|
209
|
+
percentage: 0
|
|
210
|
+
currentTask: null
|
|
211
|
+
lastUpdated: '{{TIMESTAMP}}'
|
|
212
|
+
lastUpdatedBy: 'feature-agent'
|
|
213
|
+
|
|
214
|
+
validation:
|
|
215
|
+
lastRun: null
|
|
216
|
+
gatesPassed: []
|
|
217
|
+
autoFixesApplied: []
|
|
218
|
+
|
|
219
|
+
tasks:
|
|
220
|
+
current: null
|
|
221
|
+
blocked: []
|
|
222
|
+
failed: []
|
|
223
|
+
|
|
224
|
+
checkpoints:
|
|
225
|
+
- phase: 'feature-created'
|
|
226
|
+
completedAt: '{{TIMESTAMP}}'
|
|
227
|
+
completedBy: 'feature-agent'
|
|
228
|
+
|
|
229
|
+
errors:
|
|
230
|
+
current: null
|
|
231
|
+
history: []
|
|
232
|
+
`;
|
|
233
|
+
const TEMPLATES = [
|
|
234
|
+
{ filename: 'spec.yaml', content: SPEC_YAML },
|
|
235
|
+
{ filename: 'research.yaml', content: RESEARCH_YAML },
|
|
236
|
+
{ filename: 'plan.yaml', content: PLAN_YAML },
|
|
237
|
+
{ filename: 'tasks.yaml', content: TASKS_YAML },
|
|
238
|
+
{ filename: 'feature.yaml', content: FEATURE_YAML },
|
|
239
|
+
];
|
|
240
|
+
export class SpecInitializerService {
|
|
241
|
+
async initialize(basePath, slug, featureNumber, description) {
|
|
242
|
+
// Scan existing specs/ directory for highest NNN prefix to avoid collisions
|
|
243
|
+
// (specs may have been created outside the DB, e.g., via /shep-kit:new-feature)
|
|
244
|
+
const resolvedNumber = await this.resolveNextNumber(basePath, featureNumber);
|
|
245
|
+
const nnn = padNumber(resolvedNumber);
|
|
246
|
+
const specDirName = `${nnn}-${slug}`;
|
|
247
|
+
const specDir = join(basePath, 'specs', specDirName);
|
|
248
|
+
// Create the spec directory
|
|
249
|
+
await mkdir(specDir, { recursive: true });
|
|
250
|
+
const now = new Date();
|
|
251
|
+
const date = now.toISOString().split('T')[0];
|
|
252
|
+
const timestamp = now.toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
253
|
+
const vars = { nnn, slug, featureNumber: resolvedNumber, date, timestamp, description };
|
|
254
|
+
// Write all template files
|
|
255
|
+
await Promise.all(TEMPLATES.map(({ filename, content }) => writeFile(join(specDir, filename), applyTemplate(content, vars), 'utf-8')));
|
|
256
|
+
return { specDir, featureNumber: nnn };
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Scan specs/ for existing NNN-* directories and return the next available number.
|
|
260
|
+
* Uses the DB-derived hint as a minimum, but always respects filesystem state.
|
|
261
|
+
*/
|
|
262
|
+
async resolveNextNumber(basePath, hint) {
|
|
263
|
+
const specsDir = join(basePath, 'specs');
|
|
264
|
+
let entries;
|
|
265
|
+
try {
|
|
266
|
+
entries = await readdir(specsDir);
|
|
267
|
+
}
|
|
268
|
+
catch {
|
|
269
|
+
// specs/ doesn't exist yet — use hint
|
|
270
|
+
return hint;
|
|
271
|
+
}
|
|
272
|
+
let maxExisting = 0;
|
|
273
|
+
for (const entry of entries) {
|
|
274
|
+
const match = entry.match(/^(\d{3})-/);
|
|
275
|
+
if (match) {
|
|
276
|
+
maxExisting = Math.max(maxExisting, parseInt(match[1], 10));
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return Math.max(maxExisting + 1, hint);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Approve Command
|
|
3
|
+
*
|
|
4
|
+
* Approves a paused agent run (waiting_approval) and resumes execution.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* shep agent approve <id>
|
|
8
|
+
*/
|
|
9
|
+
import { Command } from 'commander';
|
|
10
|
+
export declare function createApproveCommand(): Command;
|
|
11
|
+
//# sourceMappingURL=approve.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approve.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/approve.command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,oBAAoB,IAAI,OAAO,CA8B9C"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Approve Command
|
|
3
|
+
*
|
|
4
|
+
* Approves a paused agent run (waiting_approval) and resumes execution.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* shep agent approve <id>
|
|
8
|
+
*/
|
|
9
|
+
import { Command } from 'commander';
|
|
10
|
+
import { container } from '../../../../infrastructure/di/container.js';
|
|
11
|
+
import { ApproveAgentRunUseCase } from '../../../../application/use-cases/agents/approve-agent-run.use-case.js';
|
|
12
|
+
import { colors, messages } from '../../ui/index.js';
|
|
13
|
+
import { resolveAgentRun } from './resolve-run.js';
|
|
14
|
+
export function createApproveCommand() {
|
|
15
|
+
return new Command('approve')
|
|
16
|
+
.description('Approve a paused agent run and resume execution')
|
|
17
|
+
.argument('<id>', 'Agent run ID (or prefix)')
|
|
18
|
+
.action(async (id) => {
|
|
19
|
+
try {
|
|
20
|
+
const resolved = await resolveAgentRun(id);
|
|
21
|
+
if ('error' in resolved) {
|
|
22
|
+
messages.error(resolved.error);
|
|
23
|
+
process.exitCode = 1;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const useCase = container.resolve(ApproveAgentRunUseCase);
|
|
27
|
+
const result = await useCase.execute(resolved.run.id);
|
|
28
|
+
if (result.approved) {
|
|
29
|
+
messages.success(`Approved ${colors.accent(resolved.run.id.substring(0, 8))}: ${result.reason}`);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
messages.error(result.reason);
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
38
|
+
messages.error('Failed to approve agent run', err);
|
|
39
|
+
process.exitCode = 1;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Delete Command
|
|
3
|
+
*
|
|
4
|
+
* Remove an agent run record from the database.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* shep agent delete <id>
|
|
8
|
+
*/
|
|
9
|
+
import { Command } from 'commander';
|
|
10
|
+
export declare function createDeleteCommand(): Command;
|
|
11
|
+
//# sourceMappingURL=delete.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/delete.command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,mBAAmB,IAAI,OAAO,CAsC7C"}
|