@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,49 @@
|
|
|
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
|
+
import { container } from '../../../../infrastructure/di/container.js';
|
|
11
|
+
import { DeleteAgentRunUseCase } from '../../../../application/use-cases/agents/delete-agent-run.use-case.js';
|
|
12
|
+
import { colors, messages } from '../../ui/index.js';
|
|
13
|
+
import { resolveAgentRun } from './resolve-run.js';
|
|
14
|
+
export function createDeleteCommand() {
|
|
15
|
+
return new Command('delete')
|
|
16
|
+
.description('Delete an agent run record')
|
|
17
|
+
.argument('<id>', 'Agent run ID (or prefix)')
|
|
18
|
+
.option('--force', 'Force delete even if running')
|
|
19
|
+
.action(async (id, opts) => {
|
|
20
|
+
try {
|
|
21
|
+
const resolved = await resolveAgentRun(id);
|
|
22
|
+
if ('error' in resolved) {
|
|
23
|
+
messages.error(resolved.error);
|
|
24
|
+
process.exitCode = 1;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (opts.force && resolved.run.status === 'running') {
|
|
28
|
+
// Force delete: stop first, then delete
|
|
29
|
+
const { StopAgentRunUseCase } = await import('../../../../application/use-cases/agents/stop-agent-run.use-case.js');
|
|
30
|
+
const stopUseCase = container.resolve(StopAgentRunUseCase);
|
|
31
|
+
await stopUseCase.execute(resolved.run.id);
|
|
32
|
+
}
|
|
33
|
+
const useCase = container.resolve(DeleteAgentRunUseCase);
|
|
34
|
+
const result = await useCase.execute(resolved.run.id);
|
|
35
|
+
if (result.deleted) {
|
|
36
|
+
messages.success(`Deleted ${colors.accent(resolved.run.id.substring(0, 8))}`);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
messages.error(result.reason);
|
|
40
|
+
process.exitCode = 1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
45
|
+
messages.error('Failed to delete agent run', err);
|
|
46
|
+
process.exitCode = 1;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Command
|
|
3
|
+
*
|
|
4
|
+
* Top-level agent command with subcommands for managing and viewing agent runs.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* shep agent [subcommand]
|
|
8
|
+
*
|
|
9
|
+
* Subcommands:
|
|
10
|
+
* shep agent show <id> Display details of an agent run
|
|
11
|
+
* shep agent ls List all agent runs
|
|
12
|
+
* shep agent stop <id> Stop a running agent
|
|
13
|
+
* shep agent logs <id> View agent run logs
|
|
14
|
+
* shep agent delete <id> Delete an agent run record
|
|
15
|
+
*/
|
|
16
|
+
import { Command } from 'commander';
|
|
17
|
+
/**
|
|
18
|
+
* Create the agent command with all subcommands
|
|
19
|
+
*/
|
|
20
|
+
export declare function createAgentCommand(): Command;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAY5C"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Command
|
|
3
|
+
*
|
|
4
|
+
* Top-level agent command with subcommands for managing and viewing agent runs.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* shep agent [subcommand]
|
|
8
|
+
*
|
|
9
|
+
* Subcommands:
|
|
10
|
+
* shep agent show <id> Display details of an agent run
|
|
11
|
+
* shep agent ls List all agent runs
|
|
12
|
+
* shep agent stop <id> Stop a running agent
|
|
13
|
+
* shep agent logs <id> View agent run logs
|
|
14
|
+
* shep agent delete <id> Delete an agent run record
|
|
15
|
+
*/
|
|
16
|
+
import { Command } from 'commander';
|
|
17
|
+
import { createShowCommand } from './show.command.js';
|
|
18
|
+
import { createLsCommand } from './ls.command.js';
|
|
19
|
+
import { createStopCommand } from './stop.command.js';
|
|
20
|
+
import { createLogsCommand } from './logs.command.js';
|
|
21
|
+
import { createDeleteCommand } from './delete.command.js';
|
|
22
|
+
import { createApproveCommand } from './approve.command.js';
|
|
23
|
+
import { createRejectCommand } from './reject.command.js';
|
|
24
|
+
/**
|
|
25
|
+
* Create the agent command with all subcommands
|
|
26
|
+
*/
|
|
27
|
+
export function createAgentCommand() {
|
|
28
|
+
const agent = new Command('agent')
|
|
29
|
+
.description('Manage and view agent runs')
|
|
30
|
+
.addCommand(createShowCommand())
|
|
31
|
+
.addCommand(createLsCommand())
|
|
32
|
+
.addCommand(createStopCommand())
|
|
33
|
+
.addCommand(createLogsCommand())
|
|
34
|
+
.addCommand(createDeleteCommand())
|
|
35
|
+
.addCommand(createApproveCommand())
|
|
36
|
+
.addCommand(createRejectCommand());
|
|
37
|
+
return agent;
|
|
38
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Logs Command
|
|
3
|
+
*
|
|
4
|
+
* View log output for an agent run with efficient streaming.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* shep agent logs <id> # Print full log
|
|
8
|
+
* shep agent logs -f <id> # Follow (tail -f) using fs.watch
|
|
9
|
+
* shep agent logs -n 50 <id> # Last 50 lines
|
|
10
|
+
*/
|
|
11
|
+
import { Command } from 'commander';
|
|
12
|
+
export declare function createLogsCommand(): Command;
|
|
13
|
+
//# sourceMappingURL=logs.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/logs.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgDpC,wBAAgB,iBAAiB,IAAI,OAAO,CAwH3C"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Logs Command
|
|
3
|
+
*
|
|
4
|
+
* View log output for an agent run with efficient streaming.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* shep agent logs <id> # Print full log
|
|
8
|
+
* shep agent logs -f <id> # Follow (tail -f) using fs.watch
|
|
9
|
+
* shep agent logs -n 50 <id> # Last 50 lines
|
|
10
|
+
*/
|
|
11
|
+
import { Command } from 'commander';
|
|
12
|
+
import { join } from 'node:path';
|
|
13
|
+
import { homedir } from 'node:os';
|
|
14
|
+
import { closeSync, createReadStream, existsSync, openSync, readFileSync, readSync, statSync, watch, } from 'node:fs';
|
|
15
|
+
import { open } from 'node:fs/promises';
|
|
16
|
+
import { colors, messages } from '../../ui/index.js';
|
|
17
|
+
import { resolveAgentRun } from './resolve-run.js';
|
|
18
|
+
/** Read the last N lines from a file without loading it all into memory */
|
|
19
|
+
function readTailLines(filePath, n) {
|
|
20
|
+
const stat = statSync(filePath);
|
|
21
|
+
// For small files (< 64KB), just read the whole thing
|
|
22
|
+
if (stat.size < 65536) {
|
|
23
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
24
|
+
const lines = content.split('\n');
|
|
25
|
+
return lines.slice(Math.max(0, lines.length - n)).join('\n');
|
|
26
|
+
}
|
|
27
|
+
// For large files, read from the end in chunks
|
|
28
|
+
const fd = openSync(filePath, 'r');
|
|
29
|
+
const chunkSize = Math.min(stat.size, 8192);
|
|
30
|
+
let found = 0;
|
|
31
|
+
let pos = stat.size;
|
|
32
|
+
let tail = '';
|
|
33
|
+
const buf = Buffer.alloc(chunkSize);
|
|
34
|
+
while (pos > 0 && found <= n) {
|
|
35
|
+
const readSize = Math.min(chunkSize, pos);
|
|
36
|
+
pos -= readSize;
|
|
37
|
+
readSync(fd, buf, 0, readSize, pos);
|
|
38
|
+
const chunk = buf.toString('utf-8', 0, readSize);
|
|
39
|
+
tail = chunk + tail;
|
|
40
|
+
for (const ch of chunk) {
|
|
41
|
+
if (ch === '\n')
|
|
42
|
+
found++;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
closeSync(fd);
|
|
46
|
+
const lines = tail.split('\n');
|
|
47
|
+
return lines.slice(Math.max(0, lines.length - n)).join('\n');
|
|
48
|
+
}
|
|
49
|
+
export function createLogsCommand() {
|
|
50
|
+
return new Command('logs')
|
|
51
|
+
.description('View agent run logs')
|
|
52
|
+
.argument('<id>', 'Agent run ID (or prefix)')
|
|
53
|
+
.option('-f, --follow', 'Follow log output (like tail -f)')
|
|
54
|
+
.option('-n, --lines <count>', 'Number of lines to show from the end', '0')
|
|
55
|
+
.action(async (id, opts) => {
|
|
56
|
+
try {
|
|
57
|
+
const resolved = await resolveAgentRun(id);
|
|
58
|
+
if ('error' in resolved) {
|
|
59
|
+
messages.error(resolved.error);
|
|
60
|
+
process.exitCode = 1;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const logPath = join(homedir(), '.shep', 'logs', `worker-${resolved.run.id}.log`);
|
|
64
|
+
if (!existsSync(logPath)) {
|
|
65
|
+
messages.error(`No log file found for run ${resolved.run.id.substring(0, 8)}`);
|
|
66
|
+
messages.info(`Expected: ${logPath}`);
|
|
67
|
+
process.exitCode = 1;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const stat = statSync(logPath);
|
|
71
|
+
if (stat.size === 0) {
|
|
72
|
+
messages.info(`Log file is empty for run ${colors.accent(resolved.run.id.substring(0, 8))}`);
|
|
73
|
+
if (!opts.follow)
|
|
74
|
+
return;
|
|
75
|
+
// In follow mode, continue — the file will grow
|
|
76
|
+
}
|
|
77
|
+
const requestedLines = parseInt(opts.lines, 10);
|
|
78
|
+
if (opts.follow) {
|
|
79
|
+
// Print existing content first
|
|
80
|
+
if (stat.size > 0) {
|
|
81
|
+
if (requestedLines > 0) {
|
|
82
|
+
process.stdout.write(readTailLines(logPath, requestedLines));
|
|
83
|
+
if (!process.stdout.destroyed)
|
|
84
|
+
process.stdout.write('\n');
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
// Stream existing content without loading entire file into memory
|
|
88
|
+
await new Promise((resolve, reject) => {
|
|
89
|
+
const stream = createReadStream(logPath, { encoding: 'utf-8' });
|
|
90
|
+
stream.pipe(process.stdout, { end: false });
|
|
91
|
+
stream.on('end', resolve);
|
|
92
|
+
stream.on('error', reject);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// Follow new content using fs.watch (event-driven, no polling)
|
|
97
|
+
let position = stat.size;
|
|
98
|
+
const handle = await open(logPath, 'r');
|
|
99
|
+
// Reusable 4KB buffer for incremental reads
|
|
100
|
+
const readBuf = Buffer.alloc(4096);
|
|
101
|
+
const readNewContent = async () => {
|
|
102
|
+
try {
|
|
103
|
+
const currentStat = statSync(logPath);
|
|
104
|
+
while (position < currentStat.size) {
|
|
105
|
+
const bytesToRead = Math.min(readBuf.length, currentStat.size - position);
|
|
106
|
+
const { bytesRead } = await handle.read(readBuf, 0, bytesToRead, position);
|
|
107
|
+
if (bytesRead === 0)
|
|
108
|
+
break;
|
|
109
|
+
process.stdout.write(readBuf.toString('utf-8', 0, bytesRead));
|
|
110
|
+
position += bytesRead;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
// File may have been deleted/rotated
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
// Use fs.watch for efficient OS-level file change notifications
|
|
118
|
+
const watcher = watch(logPath, { persistent: true }, () => {
|
|
119
|
+
readNewContent();
|
|
120
|
+
});
|
|
121
|
+
// Fallback poll every 2s in case fs.watch misses events (NFS, etc.)
|
|
122
|
+
const fallbackInterval = setInterval(readNewContent, 2000);
|
|
123
|
+
const cleanup = async () => {
|
|
124
|
+
watcher.close();
|
|
125
|
+
clearInterval(fallbackInterval);
|
|
126
|
+
await handle.close();
|
|
127
|
+
};
|
|
128
|
+
process.on('SIGINT', async () => {
|
|
129
|
+
await cleanup();
|
|
130
|
+
process.exit(0);
|
|
131
|
+
});
|
|
132
|
+
process.on('SIGTERM', async () => {
|
|
133
|
+
await cleanup();
|
|
134
|
+
process.exit(0);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
// Print mode
|
|
139
|
+
if (requestedLines > 0) {
|
|
140
|
+
process.stdout.write(readTailLines(logPath, requestedLines));
|
|
141
|
+
process.stdout.write('\n');
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
// Stream the file — don't load it all into memory
|
|
145
|
+
await new Promise((resolve, reject) => {
|
|
146
|
+
const stream = createReadStream(logPath, { encoding: 'utf-8' });
|
|
147
|
+
stream.pipe(process.stdout, { end: false });
|
|
148
|
+
stream.on('end', () => {
|
|
149
|
+
process.stdout.write('\n');
|
|
150
|
+
resolve();
|
|
151
|
+
});
|
|
152
|
+
stream.on('error', reject);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
159
|
+
messages.error('Failed to read agent logs', err);
|
|
160
|
+
process.exitCode = 1;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent List Command
|
|
3
|
+
*
|
|
4
|
+
* List all agent runs with their status, PID, and other relevant details.
|
|
5
|
+
* Auto-detects dead PIDs and shows them as "crashed" instead of "running".
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* shep agent ls
|
|
9
|
+
*/
|
|
10
|
+
import { Command } from 'commander';
|
|
11
|
+
export declare function createLsCommand(): Command;
|
|
12
|
+
//# sourceMappingURL=ls.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ls.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/ls.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,wBAAgB,eAAe,IAAI,OAAO,CAqCzC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent List Command
|
|
3
|
+
*
|
|
4
|
+
* List all agent runs with their status, PID, and other relevant details.
|
|
5
|
+
* Auto-detects dead PIDs and shows them as "crashed" instead of "running".
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* shep agent ls
|
|
9
|
+
*/
|
|
10
|
+
import { Command } from 'commander';
|
|
11
|
+
import { container } from '../../../../infrastructure/di/container.js';
|
|
12
|
+
import { ListAgentRunsUseCase } from '../../../../application/use-cases/agents/list-agent-runs.use-case.js';
|
|
13
|
+
import { colors, symbols, messages, renderListView } from '../../ui/index.js';
|
|
14
|
+
function isProcessAlive(pid) {
|
|
15
|
+
try {
|
|
16
|
+
process.kill(pid, 0);
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function createLsCommand() {
|
|
24
|
+
return new Command('ls').description('List all agent runs').action(async () => {
|
|
25
|
+
try {
|
|
26
|
+
const useCase = container.resolve(ListAgentRunsUseCase);
|
|
27
|
+
const agentRuns = await useCase.execute();
|
|
28
|
+
const rows = agentRuns.map((run) => {
|
|
29
|
+
const liveness = getLiveness(run);
|
|
30
|
+
return [
|
|
31
|
+
run.id.substring(0, 8),
|
|
32
|
+
run.agentName,
|
|
33
|
+
liveness.displayStatus,
|
|
34
|
+
getDuration(run),
|
|
35
|
+
run.pid ? String(run.pid) : colors.muted('-'),
|
|
36
|
+
liveness.warning || '',
|
|
37
|
+
];
|
|
38
|
+
});
|
|
39
|
+
renderListView({
|
|
40
|
+
title: 'Agent Runs',
|
|
41
|
+
columns: [
|
|
42
|
+
{ label: 'ID', width: 10 },
|
|
43
|
+
{ label: 'Agent', width: 18 },
|
|
44
|
+
{ label: 'Status', width: 16 },
|
|
45
|
+
{ label: 'Duration', width: 10 },
|
|
46
|
+
{ label: 'PID', width: 8 },
|
|
47
|
+
{ label: 'Warning', width: 20 },
|
|
48
|
+
],
|
|
49
|
+
rows,
|
|
50
|
+
emptyMessage: 'No agent runs found',
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
55
|
+
messages.error('Failed to list agent runs', err);
|
|
56
|
+
process.exitCode = 1;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function getLiveness(run) {
|
|
61
|
+
const isActive = run.status === 'running' || run.status === 'pending';
|
|
62
|
+
if (isActive && run.pid && !isProcessAlive(run.pid)) {
|
|
63
|
+
return {
|
|
64
|
+
displayStatus: `${colors.error(symbols.error)} ${colors.error('crashed')}`,
|
|
65
|
+
warning: colors.error(`PID ${run.pid} dead`),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const map = {
|
|
69
|
+
pending: `${colors.muted(symbols.dotEmpty)} ${colors.muted('pending')}`,
|
|
70
|
+
running: `${colors.info(symbols.dot)} ${colors.info('running')}`,
|
|
71
|
+
completed: `${colors.success(symbols.success)} ${colors.success('completed')}`,
|
|
72
|
+
failed: `${colors.error(symbols.error)} ${colors.error('failed')}`,
|
|
73
|
+
interrupted: `${colors.error(symbols.error)} ${colors.error('interrupted')}`,
|
|
74
|
+
cancelled: `${colors.muted(symbols.dotEmpty)} ${colors.muted('cancelled')}`,
|
|
75
|
+
};
|
|
76
|
+
const displayStatus = map[run.status] || colors.muted(run.status);
|
|
77
|
+
let warning = '';
|
|
78
|
+
if (run.status === 'pending' && !run.startedAt) {
|
|
79
|
+
const hours = (Date.now() - new Date(run.createdAt).getTime()) / (1000 * 60 * 60);
|
|
80
|
+
if (hours > 24)
|
|
81
|
+
warning = colors.error('STUCK (>24h)');
|
|
82
|
+
else if (hours > 1)
|
|
83
|
+
warning = colors.error('SLOW (>1h)');
|
|
84
|
+
}
|
|
85
|
+
return { displayStatus, warning };
|
|
86
|
+
}
|
|
87
|
+
function getDuration(run) {
|
|
88
|
+
if (run.status === 'pending' && !run.startedAt) {
|
|
89
|
+
return fmtDuration(Date.now() - new Date(run.createdAt).getTime());
|
|
90
|
+
}
|
|
91
|
+
if (run.startedAt && run.completedAt) {
|
|
92
|
+
return fmtDuration(new Date(run.completedAt).getTime() - new Date(run.startedAt).getTime());
|
|
93
|
+
}
|
|
94
|
+
if (run.startedAt) {
|
|
95
|
+
return fmtDuration(Date.now() - new Date(run.startedAt).getTime());
|
|
96
|
+
}
|
|
97
|
+
return '-';
|
|
98
|
+
}
|
|
99
|
+
function fmtDuration(ms) {
|
|
100
|
+
const seconds = Math.floor(ms / 1000);
|
|
101
|
+
const minutes = Math.floor(seconds / 60);
|
|
102
|
+
const hours = Math.floor(minutes / 60);
|
|
103
|
+
const days = Math.floor(hours / 24);
|
|
104
|
+
if (days > 0)
|
|
105
|
+
return `${days}d ${hours % 24}h`;
|
|
106
|
+
if (hours > 0)
|
|
107
|
+
return `${hours}h ${minutes % 60}m`;
|
|
108
|
+
if (minutes > 0)
|
|
109
|
+
return `${minutes}m`;
|
|
110
|
+
return `${seconds}s`;
|
|
111
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Reject Command
|
|
3
|
+
*
|
|
4
|
+
* Rejects a paused agent run (waiting_approval) and cancels it.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* shep agent reject <id> [--reason <text>]
|
|
8
|
+
*/
|
|
9
|
+
import { Command } from 'commander';
|
|
10
|
+
export declare function createRejectCommand(): Command;
|
|
11
|
+
//# sourceMappingURL=reject.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reject.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/reject.command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,mBAAmB,IAAI,OAAO,CA+B7C"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Reject Command
|
|
3
|
+
*
|
|
4
|
+
* Rejects a paused agent run (waiting_approval) and cancels it.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* shep agent reject <id> [--reason <text>]
|
|
8
|
+
*/
|
|
9
|
+
import { Command } from 'commander';
|
|
10
|
+
import { container } from '../../../../infrastructure/di/container.js';
|
|
11
|
+
import { RejectAgentRunUseCase } from '../../../../application/use-cases/agents/reject-agent-run.use-case.js';
|
|
12
|
+
import { colors, messages } from '../../ui/index.js';
|
|
13
|
+
import { resolveAgentRun } from './resolve-run.js';
|
|
14
|
+
export function createRejectCommand() {
|
|
15
|
+
return new Command('reject')
|
|
16
|
+
.description('Reject a paused agent run and cancel it')
|
|
17
|
+
.argument('<id>', 'Agent run ID (or prefix)')
|
|
18
|
+
.option('-r, --reason <text>', 'Reason for rejection')
|
|
19
|
+
.action(async (id, opts) => {
|
|
20
|
+
try {
|
|
21
|
+
const resolved = await resolveAgentRun(id);
|
|
22
|
+
if ('error' in resolved) {
|
|
23
|
+
messages.error(resolved.error);
|
|
24
|
+
process.exitCode = 1;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const useCase = container.resolve(RejectAgentRunUseCase);
|
|
28
|
+
const result = await useCase.execute(resolved.run.id, opts.reason);
|
|
29
|
+
if (result.rejected) {
|
|
30
|
+
messages.success(`Rejected ${colors.accent(resolved.run.id.substring(0, 8))}: ${result.reason}`);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
messages.error(result.reason);
|
|
34
|
+
process.exitCode = 1;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
39
|
+
messages.error('Failed to reject agent run', err);
|
|
40
|
+
process.exitCode = 1;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared helper: resolve an agent run by exact or prefix ID.
|
|
3
|
+
*/
|
|
4
|
+
import type { AgentRun } from '../../../../domain/generated/output.js';
|
|
5
|
+
export declare function resolveAgentRun(id: string): Promise<{
|
|
6
|
+
run: AgentRun;
|
|
7
|
+
} | {
|
|
8
|
+
error: string;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=resolve-run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-run.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/resolve-run.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAEvE,wBAAsB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAsBhG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared helper: resolve an agent run by exact or prefix ID.
|
|
3
|
+
*/
|
|
4
|
+
import { container } from '../../../../infrastructure/di/container.js';
|
|
5
|
+
import { GetAgentRunUseCase } from '../../../../application/use-cases/agents/get-agent-run.use-case.js';
|
|
6
|
+
import { ListAgentRunsUseCase } from '../../../../application/use-cases/agents/list-agent-runs.use-case.js';
|
|
7
|
+
export async function resolveAgentRun(id) {
|
|
8
|
+
const getUseCase = container.resolve(GetAgentRunUseCase);
|
|
9
|
+
// Try exact match first
|
|
10
|
+
const exact = await getUseCase.execute(id);
|
|
11
|
+
if (exact)
|
|
12
|
+
return { run: exact };
|
|
13
|
+
// Try prefix match
|
|
14
|
+
if (id.length < 36) {
|
|
15
|
+
const listUseCase = container.resolve(ListAgentRunsUseCase);
|
|
16
|
+
const allRuns = await listUseCase.execute();
|
|
17
|
+
const matches = allRuns.filter((r) => r.id.startsWith(id));
|
|
18
|
+
if (matches.length === 1)
|
|
19
|
+
return { run: matches[0] };
|
|
20
|
+
if (matches.length > 1) {
|
|
21
|
+
return {
|
|
22
|
+
error: `Multiple runs match prefix "${id}": ${matches.map((m) => m.id.substring(0, 8)).join(', ')}`,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return { error: `Agent run not found: ${id}` };
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Show Command
|
|
3
|
+
*
|
|
4
|
+
* Display details of a specific agent run including execution status,
|
|
5
|
+
* PID, current node, heartbeat, and output.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* shep agent show <id>
|
|
9
|
+
*/
|
|
10
|
+
import { Command } from 'commander';
|
|
11
|
+
export declare function createShowCommand(): Command;
|
|
12
|
+
//# sourceMappingURL=show.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/agent/show.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyBpC,wBAAgB,iBAAiB,IAAI,OAAO,CAoG3C"}
|