@shepai/cli 1.14.2 → 1.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +191 -101
- package/dist/src/application/ports/output/{agent-executor-factory.interface.d.ts → agents/agent-executor-factory.interface.d.ts} +1 -1
- package/dist/src/application/ports/output/agents/agent-executor-factory.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/{agent-executor.interface.d.ts → agents/agent-executor.interface.d.ts} +1 -1
- package/dist/src/application/ports/output/agents/agent-executor.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/{agent-registry.interface.d.ts → agents/agent-registry.interface.d.ts} +1 -1
- package/dist/src/application/ports/output/agents/agent-registry.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/{agent-run-repository.interface.d.ts → agents/agent-run-repository.interface.d.ts} +1 -1
- package/dist/src/application/ports/output/agents/agent-run-repository.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/{agent-runner.interface.d.ts → agents/agent-runner.interface.d.ts} +1 -1
- package/dist/src/application/ports/output/agents/agent-runner.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/{agent-validator.interface.d.ts → agents/agent-validator.interface.d.ts} +1 -1
- package/dist/src/application/ports/output/agents/agent-validator.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/agents/feature-agent-process.interface.d.ts +44 -0
- package/dist/src/application/ports/output/agents/feature-agent-process.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/agents/feature-agent-process.interface.js +12 -0
- package/dist/src/application/ports/output/agents/index.d.ts +13 -0
- package/dist/src/application/ports/output/agents/index.d.ts.map +1 -0
- package/dist/src/application/ports/output/agents/index.js +6 -0
- package/dist/src/application/ports/output/index.d.ts +8 -11
- package/dist/src/application/ports/output/index.d.ts.map +1 -1
- package/dist/src/application/ports/output/index.js +5 -3
- package/dist/src/application/ports/output/repositories/feature-repository.interface.d.ts +76 -0
- package/dist/src/application/ports/output/repositories/feature-repository.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/repositories/feature-repository.interface.js +11 -0
- package/dist/src/application/ports/output/repositories/index.d.ts +8 -0
- package/dist/src/application/ports/output/repositories/index.d.ts.map +1 -0
- package/dist/src/application/ports/output/repositories/index.js +6 -0
- package/dist/src/application/ports/output/{settings.repository.interface.d.ts → repositories/settings.repository.interface.d.ts} +1 -1
- package/dist/src/application/ports/output/repositories/settings.repository.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/services/external-issue-fetcher.interface.d.ts +69 -0
- package/dist/src/application/ports/output/services/external-issue-fetcher.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/services/external-issue-fetcher.interface.js +46 -0
- package/dist/src/application/ports/output/services/index.d.ts +13 -0
- package/dist/src/application/ports/output/services/index.d.ts.map +1 -0
- package/dist/src/application/ports/output/services/index.js +7 -0
- package/dist/src/application/ports/output/services/spec-initializer.interface.d.ts +33 -0
- package/dist/src/application/ports/output/services/spec-initializer.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/services/spec-initializer.interface.js +8 -0
- package/dist/src/application/ports/output/{version-service.interface.d.ts → services/version-service.interface.d.ts} +1 -1
- package/dist/src/application/ports/output/services/version-service.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/services/web-server-service.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/services/worktree-service.interface.d.ts +83 -0
- package/dist/src/application/ports/output/services/worktree-service.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/services/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/configure-agent.use-case.d.ts +2 -2
- package/dist/src/application/use-cases/agents/configure-agent.use-case.d.ts.map +1 -1
- 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/run-agent.use-case.d.ts +2 -2
- package/dist/src/application/use-cases/agents/run-agent.use-case.d.ts.map +1 -1
- 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/agents/validate-agent-auth.use-case.d.ts +1 -1
- package/dist/src/application/use-cases/agents/validate-agent-auth.use-case.d.ts.map +1 -1
- 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/application/use-cases/settings/initialize-settings.use-case.d.ts +1 -1
- package/dist/src/application/use-cases/settings/initialize-settings.use-case.d.ts.map +1 -1
- package/dist/src/application/use-cases/settings/load-settings.use-case.d.ts +1 -1
- package/dist/src/application/use-cases/settings/load-settings.use-case.d.ts.map +1 -1
- package/dist/src/application/use-cases/settings/update-settings.use-case.d.ts +1 -1
- package/dist/src/application/use-cases/settings/update-settings.use-case.d.ts.map +1 -1
- 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 +1 -1
- 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/repositories/sqlite-settings.repository.d.ts +1 -1
- package/dist/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -1
- package/dist/src/infrastructure/services/agents/{langgraph → analyze-repo}/analyze-repository-graph.d.ts +1 -23
- 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/agents/streaming/streaming-executor-proxy.d.ts +1 -1
- package/dist/src/infrastructure/services/agents/streaming/streaming-executor-proxy.d.ts.map +1 -1
- 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/infrastructure/services/web-server.service.d.ts +1 -1
- package/dist/src/infrastructure/services/web-server.service.d.ts.map +1 -1
- 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/application/ports/output/agent-executor-factory.interface.d.ts.map +0 -1
- package/dist/src/application/ports/output/agent-executor.interface.d.ts.map +0 -1
- package/dist/src/application/ports/output/agent-registry.interface.d.ts.map +0 -1
- package/dist/src/application/ports/output/agent-run-repository.interface.d.ts.map +0 -1
- package/dist/src/application/ports/output/agent-runner.interface.d.ts.map +0 -1
- package/dist/src/application/ports/output/agent-validator.interface.d.ts.map +0 -1
- package/dist/src/application/ports/output/settings.repository.interface.d.ts.map +0 -1
- package/dist/src/application/ports/output/version-service.interface.d.ts.map +0 -1
- package/dist/src/application/ports/output/web-server-service.interface.d.ts.map +0 -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/application/ports/output/{agent-executor-factory.interface.js → agents/agent-executor-factory.interface.js} +0 -0
- /package/dist/src/application/ports/output/{agent-executor.interface.js → agents/agent-executor.interface.js} +0 -0
- /package/dist/src/application/ports/output/{agent-registry.interface.js → agents/agent-registry.interface.js} +0 -0
- /package/dist/src/application/ports/output/{agent-run-repository.interface.js → agents/agent-run-repository.interface.js} +0 -0
- /package/dist/src/application/ports/output/{agent-runner.interface.js → agents/agent-runner.interface.js} +0 -0
- /package/dist/src/application/ports/output/{agent-validator.interface.js → agents/agent-validator.interface.js} +0 -0
- /package/dist/src/application/ports/output/{settings.repository.interface.js → repositories/settings.repository.interface.js} +0 -0
- /package/dist/src/application/ports/output/{version-service.interface.js → services/version-service.interface.js} +0 -0
- /package/dist/src/application/ports/output/{web-server-service.interface.d.ts → services/web-server-service.interface.d.ts} +0 -0
- /package/dist/src/application/ports/output/{web-server-service.interface.js → services/web-server-service.interface.js} +0 -0
- /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 → iYaq62xFNOChDTbH3WMrr}/_buildManifest.js +0 -0
- /package/web/.next/static/{rCkFI74-eja9LrkBfHFpp → iYaq62xFNOChDTbH3WMrr}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{rCkFI74-eja9LrkBfHFpp → iYaq62xFNOChDTbH3WMrr}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite Feature Repository Implementation
|
|
3
|
+
*
|
|
4
|
+
* Implements IFeatureRepository using SQLite database.
|
|
5
|
+
* Uses prepared statements to prevent SQL injection.
|
|
6
|
+
*/
|
|
7
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
8
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10
|
+
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;
|
|
11
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12
|
+
};
|
|
13
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
14
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
15
|
+
};
|
|
16
|
+
import { injectable } from 'tsyringe';
|
|
17
|
+
import { toDatabase, fromDatabase, } from '../persistence/sqlite/mappers/feature.mapper.js';
|
|
18
|
+
/**
|
|
19
|
+
* SQLite implementation of IFeatureRepository.
|
|
20
|
+
* Manages Feature persistence with CRUD operations.
|
|
21
|
+
*/
|
|
22
|
+
let SQLiteFeatureRepository = class SQLiteFeatureRepository {
|
|
23
|
+
db;
|
|
24
|
+
constructor(db) {
|
|
25
|
+
this.db = db;
|
|
26
|
+
}
|
|
27
|
+
async create(feature) {
|
|
28
|
+
const row = toDatabase(feature);
|
|
29
|
+
const stmt = this.db.prepare(`
|
|
30
|
+
INSERT INTO features (
|
|
31
|
+
id, name, slug, description, repository_path, branch,
|
|
32
|
+
lifecycle, messages, plan, related_artifacts,
|
|
33
|
+
agent_run_id, spec_path, created_at, updated_at
|
|
34
|
+
) VALUES (
|
|
35
|
+
@id, @name, @slug, @description, @repository_path, @branch,
|
|
36
|
+
@lifecycle, @messages, @plan, @related_artifacts,
|
|
37
|
+
@agent_run_id, @spec_path, @created_at, @updated_at
|
|
38
|
+
)
|
|
39
|
+
`);
|
|
40
|
+
stmt.run(row);
|
|
41
|
+
}
|
|
42
|
+
async findById(id) {
|
|
43
|
+
const stmt = this.db.prepare('SELECT * FROM features WHERE id = ?');
|
|
44
|
+
const row = stmt.get(id);
|
|
45
|
+
if (!row) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return fromDatabase(row);
|
|
49
|
+
}
|
|
50
|
+
async findByIdPrefix(prefix) {
|
|
51
|
+
const stmt = this.db.prepare('SELECT * FROM features WHERE id LIKE ?');
|
|
52
|
+
const rows = stmt.all(`${prefix}%`);
|
|
53
|
+
if (rows.length === 0)
|
|
54
|
+
return null;
|
|
55
|
+
if (rows.length > 1) {
|
|
56
|
+
throw new Error(`Ambiguous ID prefix "${prefix}" matches ${rows.length} features. Use a longer prefix.`);
|
|
57
|
+
}
|
|
58
|
+
return fromDatabase(rows[0]);
|
|
59
|
+
}
|
|
60
|
+
async findBySlug(slug, repositoryPath) {
|
|
61
|
+
const stmt = this.db.prepare('SELECT * FROM features WHERE slug = ? AND repository_path = ?');
|
|
62
|
+
const row = stmt.get(slug, repositoryPath);
|
|
63
|
+
if (!row) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return fromDatabase(row);
|
|
67
|
+
}
|
|
68
|
+
async list(filters) {
|
|
69
|
+
const conditions = [];
|
|
70
|
+
const params = [];
|
|
71
|
+
if (filters?.repositoryPath) {
|
|
72
|
+
conditions.push('repository_path = ?');
|
|
73
|
+
params.push(filters.repositoryPath);
|
|
74
|
+
}
|
|
75
|
+
if (filters?.lifecycle) {
|
|
76
|
+
conditions.push('lifecycle = ?');
|
|
77
|
+
params.push(filters.lifecycle);
|
|
78
|
+
}
|
|
79
|
+
const where = conditions.length > 0 ? ` WHERE ${conditions.join(' AND ')}` : '';
|
|
80
|
+
const stmt = this.db.prepare(`SELECT * FROM features${where}`);
|
|
81
|
+
const rows = stmt.all(...params);
|
|
82
|
+
return rows.map(fromDatabase);
|
|
83
|
+
}
|
|
84
|
+
async update(feature) {
|
|
85
|
+
const row = toDatabase(feature);
|
|
86
|
+
const stmt = this.db.prepare(`
|
|
87
|
+
UPDATE features SET
|
|
88
|
+
name = @name,
|
|
89
|
+
slug = @slug,
|
|
90
|
+
description = @description,
|
|
91
|
+
repository_path = @repository_path,
|
|
92
|
+
branch = @branch,
|
|
93
|
+
lifecycle = @lifecycle,
|
|
94
|
+
messages = @messages,
|
|
95
|
+
plan = @plan,
|
|
96
|
+
related_artifacts = @related_artifacts,
|
|
97
|
+
agent_run_id = @agent_run_id,
|
|
98
|
+
spec_path = @spec_path,
|
|
99
|
+
updated_at = @updated_at
|
|
100
|
+
WHERE id = @id
|
|
101
|
+
`);
|
|
102
|
+
stmt.run(row);
|
|
103
|
+
}
|
|
104
|
+
async delete(id) {
|
|
105
|
+
const stmt = this.db.prepare('DELETE FROM features WHERE id = ?');
|
|
106
|
+
stmt.run(id);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
SQLiteFeatureRepository = __decorate([
|
|
110
|
+
injectable(),
|
|
111
|
+
__metadata("design:paramtypes", [Object])
|
|
112
|
+
], SQLiteFeatureRepository);
|
|
113
|
+
export { SQLiteFeatureRepository };
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Uses prepared statements to prevent SQL injection.
|
|
7
7
|
*/
|
|
8
8
|
import type Database from 'better-sqlite3';
|
|
9
|
-
import type { ISettingsRepository } from '../../application/ports/output/settings.repository.interface.js';
|
|
9
|
+
import type { ISettingsRepository } from '../../application/ports/output/repositories/settings.repository.interface.js';
|
|
10
10
|
import type { Settings } from '../../domain/generated/output.js';
|
|
11
11
|
/**
|
|
12
12
|
* SQLite implementation of ISettingsRepository.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite-settings.repository.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/repositories/sqlite-settings.repository.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sqlite-settings.repository.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/repositories/sqlite-settings.repository.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8EAA8E,CAAC;AACxH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAOjE;;;GAGG;AACH,qBACa,wBAAyB,YAAW,mBAAmB;IACtD,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,QAAQ,CAAC,QAAQ;IAElD;;;;;;OAMG;IACG,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAiCnD;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAgBtC;;;;;OAKG;IACG,MAAM,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAwChD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type BaseCheckpointSaver } from '@langchain/langgraph';
|
|
2
|
-
import type { IAgentExecutor } from '../../../../application/ports/output/agent-executor.interface.js';
|
|
2
|
+
import type { IAgentExecutor } from '../../../../application/ports/output/agents/agent-executor.interface.js';
|
|
3
3
|
/**
|
|
4
4
|
* State annotation for the analyze-repository graph.
|
|
5
5
|
*
|
|
@@ -17,11 +17,6 @@ export declare const AnalyzeRepositoryState: import("@langchain/langgraph").Anno
|
|
|
17
17
|
(annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
|
|
18
18
|
Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
|
|
19
19
|
};
|
|
20
|
-
sessionId: {
|
|
21
|
-
(): import("@langchain/langgraph").LastValue<string | undefined>;
|
|
22
|
-
(annotation: import("@langchain/langgraph").SingleReducer<string | undefined, string | undefined>): import("@langchain/langgraph").BinaryOperatorAggregate<string | undefined, string | undefined>;
|
|
23
|
-
Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
|
|
24
|
-
};
|
|
25
20
|
error: {
|
|
26
21
|
(): import("@langchain/langgraph").LastValue<string | undefined>;
|
|
27
22
|
(annotation: import("@langchain/langgraph").SingleReducer<string | undefined, string | undefined>): import("@langchain/langgraph").BinaryOperatorAggregate<string | undefined, string | undefined>;
|
|
@@ -43,12 +38,10 @@ export type AnalyzeRepositoryStateType = typeof AnalyzeRepositoryState.State;
|
|
|
43
38
|
export declare function createAnalyzeRepositoryGraph(executor: IAgentExecutor, checkpointer?: BaseCheckpointSaver): import("@langchain/langgraph").CompiledStateGraph<{
|
|
44
39
|
repositoryPath: string;
|
|
45
40
|
analysisMarkdown: string;
|
|
46
|
-
sessionId: string | undefined;
|
|
47
41
|
error: string | undefined;
|
|
48
42
|
}, {
|
|
49
43
|
repositoryPath?: string | undefined;
|
|
50
44
|
analysisMarkdown?: string | undefined;
|
|
51
|
-
sessionId?: string | undefined;
|
|
52
45
|
error?: string | undefined;
|
|
53
46
|
}, "__start__" | "analyze", {
|
|
54
47
|
repositoryPath: {
|
|
@@ -61,11 +54,6 @@ export declare function createAnalyzeRepositoryGraph(executor: IAgentExecutor, c
|
|
|
61
54
|
(annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
|
|
62
55
|
Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
|
|
63
56
|
};
|
|
64
|
-
sessionId: {
|
|
65
|
-
(): import("@langchain/langgraph").LastValue<string | undefined>;
|
|
66
|
-
(annotation: import("@langchain/langgraph").SingleReducer<string | undefined, string | undefined>): import("@langchain/langgraph").BinaryOperatorAggregate<string | undefined, string | undefined>;
|
|
67
|
-
Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
|
|
68
|
-
};
|
|
69
57
|
error: {
|
|
70
58
|
(): import("@langchain/langgraph").LastValue<string | undefined>;
|
|
71
59
|
(annotation: import("@langchain/langgraph").SingleReducer<string | undefined, string | undefined>): import("@langchain/langgraph").BinaryOperatorAggregate<string | undefined, string | undefined>;
|
|
@@ -82,11 +70,6 @@ export declare function createAnalyzeRepositoryGraph(executor: IAgentExecutor, c
|
|
|
82
70
|
(annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
|
|
83
71
|
Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
|
|
84
72
|
};
|
|
85
|
-
sessionId: {
|
|
86
|
-
(): import("@langchain/langgraph").LastValue<string | undefined>;
|
|
87
|
-
(annotation: import("@langchain/langgraph").SingleReducer<string | undefined, string | undefined>): import("@langchain/langgraph").BinaryOperatorAggregate<string | undefined, string | undefined>;
|
|
88
|
-
Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
|
|
89
|
-
};
|
|
90
73
|
error: {
|
|
91
74
|
(): import("@langchain/langgraph").LastValue<string | undefined>;
|
|
92
75
|
(annotation: import("@langchain/langgraph").SingleReducer<string | undefined, string | undefined>): import("@langchain/langgraph").BinaryOperatorAggregate<string | undefined, string | undefined>;
|
|
@@ -104,11 +87,6 @@ export declare function createAnalyzeRepositoryGraph(executor: IAgentExecutor, c
|
|
|
104
87
|
(annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BinaryOperatorAggregate<string, string>;
|
|
105
88
|
Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
|
|
106
89
|
};
|
|
107
|
-
sessionId: {
|
|
108
|
-
(): import("@langchain/langgraph").LastValue<string | undefined>;
|
|
109
|
-
(annotation: import("@langchain/langgraph").SingleReducer<string | undefined, string | undefined>): import("@langchain/langgraph").BinaryOperatorAggregate<string | undefined, string | undefined>;
|
|
110
|
-
Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
|
|
111
|
-
};
|
|
112
90
|
error: {
|
|
113
91
|
(): import("@langchain/langgraph").LastValue<string | undefined>;
|
|
114
92
|
(annotation: import("@langchain/langgraph").SingleReducer<string | undefined, string | undefined>): import("@langchain/langgraph").BinaryOperatorAggregate<string | undefined, string | undefined>;
|
package/dist/src/infrastructure/services/agents/analyze-repo/analyze-repository-graph.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze-repository-graph.d.ts","sourceRoot":"","sources":["../../../../../../src/infrastructure/services/agents/analyze-repo/analyze-repository-graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+DAA+D,CAAC;AAGpG;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;EAIjC,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,OAAO,sBAAsB,CAAC,KAAK,CAAC;AAyB7E;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,cAAc,EACxB,YAAY,CAAC,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAQnC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Annotation, StateGraph, START, END } from '@langchain/langgraph';
|
|
2
|
-
import { AgentFeature } from '../../../../domain/generated/output.js';
|
|
3
2
|
import { buildAnalyzePrompt } from './prompts/analyze-repository.prompt.js';
|
|
4
3
|
/**
|
|
5
4
|
* State annotation for the analyze-repository graph.
|
|
@@ -10,29 +9,23 @@ import { buildAnalyzePrompt } from './prompts/analyze-repository.prompt.js';
|
|
|
10
9
|
export const AnalyzeRepositoryState = Annotation.Root({
|
|
11
10
|
repositoryPath: (Annotation),
|
|
12
11
|
analysisMarkdown: (Annotation),
|
|
13
|
-
sessionId: (Annotation),
|
|
14
12
|
error: (Annotation),
|
|
15
13
|
});
|
|
16
14
|
/**
|
|
17
15
|
* Creates the analyze node function that calls the agent-agnostic executor.
|
|
18
16
|
*
|
|
19
17
|
* The node receives the current state, builds a prompt from the repository path,
|
|
20
|
-
* and delegates execution to the injected IAgentExecutor.
|
|
21
|
-
*
|
|
18
|
+
* and delegates execution to the injected IAgentExecutor. Each invocation gets
|
|
19
|
+
* a clean agent context (no session resume).
|
|
22
20
|
*/
|
|
23
21
|
function createAnalyzeNode(executor) {
|
|
24
22
|
return async (state) => {
|
|
25
23
|
const prompt = buildAnalyzePrompt(state.repositoryPath);
|
|
26
|
-
const
|
|
24
|
+
const result = await executor.execute(prompt, {
|
|
27
25
|
cwd: state.repositoryPath,
|
|
28
|
-
};
|
|
29
|
-
if (state.sessionId && executor.supportsFeature(AgentFeature.sessionResume)) {
|
|
30
|
-
options.resumeSession = state.sessionId;
|
|
31
|
-
}
|
|
32
|
-
const result = await executor.execute(prompt, options);
|
|
26
|
+
});
|
|
33
27
|
return {
|
|
34
28
|
analysisMarkdown: result.result,
|
|
35
|
-
sessionId: result.sessionId ?? state.sessionId,
|
|
36
29
|
};
|
|
37
30
|
};
|
|
38
31
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze-repository.prompt.d.ts","sourceRoot":"","sources":["../../../../../../../src/infrastructure/services/agents/analyze-repo/prompts/analyze-repository.prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,mhBAcO,CAAC;AAE9C,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAEjE"}
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* Uses constructor dependency injection for the spawn function
|
|
8
8
|
* to enable testability without mocking node:child_process directly.
|
|
9
9
|
*/
|
|
10
|
-
import type { AgentType, AgentConfig } from '
|
|
11
|
-
import type { IAgentExecutor } from '
|
|
12
|
-
import type { IAgentExecutorFactory } from '
|
|
10
|
+
import type { AgentType, AgentConfig } from '../../../../domain/generated/output.js';
|
|
11
|
+
import type { IAgentExecutor } from '../../../../application/ports/output/agents/agent-executor.interface.js';
|
|
12
|
+
import type { IAgentExecutorFactory } from '../../../../application/ports/output/agents/agent-executor-factory.interface.js';
|
|
13
13
|
import { type SpawnFunction } from './executors/claude-code-executor.service.js';
|
|
14
14
|
/**
|
|
15
15
|
* Factory that creates and caches agent executor instances.
|
package/dist/src/infrastructure/services/agents/common/agent-executor-factory.service.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-executor-factory.service.d.ts","sourceRoot":"","sources":["../../../../../../src/infrastructure/services/agents/common/agent-executor-factory.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yEAAyE,CAAC;AAC9G,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iFAAiF,CAAC;AAC7H,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,6CAA6C,CAAC;AAErD;;;;;GAKG;AACH,qBAAa,oBAAqB,YAAW,qBAAqB;IAMpD,OAAO,CAAC,QAAQ,CAAC,KAAK;IALlC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqC;IAE3D;;OAEG;gBAC0B,KAAK,EAAE,aAAa;IAEjD;;;;;;;OAOG;IACH,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,GAAG,cAAc;IAoB9E;;;;OAIG;IACH,kBAAkB,IAAI,SAAS,EAAE;CAGlC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Pre-registers built-in agents (analyze-repository) at construction time.
|
|
9
9
|
*/
|
|
10
|
-
import type { IAgentRegistry, AgentDefinitionWithFactory } from '
|
|
10
|
+
import type { IAgentRegistry, AgentDefinitionWithFactory } from '../../../../application/ports/output/agents/agent-registry.interface.js';
|
|
11
11
|
export declare class AgentRegistryService implements IAgentRegistry {
|
|
12
12
|
private readonly agents;
|
|
13
13
|
constructor();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-registry.service.d.ts","sourceRoot":"","sources":["../../../../../../src/infrastructure/services/agents/common/agent-registry.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,0BAA0B,EAC3B,MAAM,+DAA+D,CAAC;AAIvE,qBAAa,oBAAqB,YAAW,cAAc;IACzD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiD;;IAiBxE,QAAQ,CAAC,UAAU,EAAE,0BAA0B,GAAG,IAAI;IAItD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS;IAIzD,IAAI,IAAI,0BAA0B,EAAE;CAGrC"}
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Pre-registers built-in agents (analyze-repository) at construction time.
|
|
9
9
|
*/
|
|
10
|
-
import { createAnalyzeRepositoryGraph } from '
|
|
10
|
+
import { createAnalyzeRepositoryGraph } from '../analyze-repo/analyze-repository-graph.js';
|
|
11
|
+
import { createFeatureAgentGraph } from '../feature-agent/feature-agent-graph.js';
|
|
11
12
|
export class AgentRegistryService {
|
|
12
13
|
agents = new Map();
|
|
13
14
|
constructor() {
|
|
@@ -17,6 +18,11 @@ export class AgentRegistryService {
|
|
|
17
18
|
description: 'Analyze repository structure, dependencies, and architecture',
|
|
18
19
|
graphFactory: createAnalyzeRepositoryGraph,
|
|
19
20
|
});
|
|
21
|
+
this.register({
|
|
22
|
+
name: 'feature-agent',
|
|
23
|
+
description: 'Autonomous SDLC agent: analyze → requirements → research → plan → implement',
|
|
24
|
+
graphFactory: createFeatureAgentGraph,
|
|
25
|
+
});
|
|
20
26
|
}
|
|
21
27
|
register(definition) {
|
|
22
28
|
this.agents.set(definition.name, definition);
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
* in the repository.
|
|
8
8
|
*/
|
|
9
9
|
import type { BaseCheckpointSaver } from '@langchain/langgraph';
|
|
10
|
-
import type { IAgentRunner, AgentRunOptions } from '
|
|
11
|
-
import type { IAgentRegistry } from '
|
|
12
|
-
import type { IAgentExecutorFactory } from '
|
|
13
|
-
import type { IAgentRunRepository } from '
|
|
14
|
-
import type { AgentRun, AgentRunEvent } from '
|
|
10
|
+
import type { IAgentRunner, AgentRunOptions } from '../../../../application/ports/output/agents/agent-runner.interface.js';
|
|
11
|
+
import type { IAgentRegistry } from '../../../../application/ports/output/agents/agent-registry.interface.js';
|
|
12
|
+
import type { IAgentExecutorFactory } from '../../../../application/ports/output/agents/agent-executor-factory.interface.js';
|
|
13
|
+
import type { IAgentRunRepository } from '../../../../application/ports/output/agents/agent-run-repository.interface.js';
|
|
14
|
+
import type { AgentRun, AgentRunEvent } from '../../../../domain/generated/output.js';
|
|
15
15
|
export declare class AgentRunnerService implements IAgentRunner {
|
|
16
16
|
private readonly registry;
|
|
17
17
|
private readonly executorFactory;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-runner.service.d.ts","sourceRoot":"","sources":["../../../../../../src/infrastructure/services/agents/common/agent-runner.service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAChB,MAAM,6DAA6D,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+DAA+D,CAAC;AACpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uEAAuE,CAAC;AACnH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qEAAqE,CAAC;AAE/G,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAM5E,qBAAa,kBAAmB,YAAW,YAAY;IAEnD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAHb,QAAQ,EAAE,cAAc,EACxB,eAAe,EAAE,qBAAqB,EACtC,YAAY,EAAE,mBAAmB,EACjC,aAAa,EAAE,mBAAmB;IAG/C,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC;IAmBxF,cAAc,CACnB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,eAAe,GACxB,aAAa,CAAC,aAAa,CAAC;YAwCjB,QAAQ;YAwCR,aAAa;YAUb,UAAU;CAQzB"}
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* in the repository.
|
|
8
8
|
*/
|
|
9
9
|
import * as crypto from 'node:crypto';
|
|
10
|
-
import { AgentRunStatus } from '
|
|
11
|
-
import { getSettings } from '
|
|
12
|
-
import { EventChannel } from '
|
|
13
|
-
import { StreamingExecutorProxy } from '
|
|
10
|
+
import { AgentRunStatus } from '../../../../domain/generated/output.js';
|
|
11
|
+
import { getSettings } from '../../../../infrastructure/services/settings.service.js';
|
|
12
|
+
import { EventChannel } from '../streaming/event-channel.js';
|
|
13
|
+
import { StreamingExecutorProxy } from '../streaming/streaming-executor-proxy.js';
|
|
14
14
|
export class AgentRunnerService {
|
|
15
15
|
registry;
|
|
16
16
|
executorFactory;
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* Uses constructor dependency injection for the command executor
|
|
9
9
|
* to enable testability without mocking node:child_process directly.
|
|
10
10
|
*/
|
|
11
|
-
import type { AgentType } from '
|
|
12
|
-
import type { IAgentValidator, AgentValidationResult } from '
|
|
11
|
+
import type { AgentType } from '../../../../domain/generated/output.js';
|
|
12
|
+
import type { IAgentValidator, AgentValidationResult } from '../../../../application/ports/output/agents/agent-validator.interface.js';
|
|
13
13
|
/**
|
|
14
14
|
* Type for the command executor dependency.
|
|
15
15
|
* Matches the promisified signature of child_process.execFile.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-validator.service.d.ts","sourceRoot":"","sources":["../../../../../../src/infrastructure/services/agents/common/agent-validator.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACtB,MAAM,0EAA0E,CAAC;AAElF;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,KACX,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AASjD;;;;;GAKG;AACH,qBACa,qBAAsB,YAAW,eAAe;IAC3D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IAEtC;;;OAGG;gBACiC,MAAM,EAAE,YAAY;IAIxD;;;;;OAKG;IACG,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC;CA2BxE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SqliteSaver } from '@langchain/langgraph-checkpoint-sqlite';
|
|
2
2
|
/**
|
|
3
3
|
* Creates a SQLite-backed checkpoint saver for LangGraph state persistence.
|
|
4
|
+
* Ensures the parent directory exists for file-based paths.
|
|
4
5
|
*
|
|
5
6
|
* @param dbPath - Path to the SQLite database file (e.g., ':memory:' or a file path)
|
|
6
7
|
* @returns A SqliteSaver instance ready for use as a LangGraph checkpointer
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpointer.d.ts","sourceRoot":"","sources":["../../../../../../src/infrastructure/services/agents/common/checkpointer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAErE;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAK9D"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { mkdirSync } from 'node:fs';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
1
3
|
import { SqliteSaver } from '@langchain/langgraph-checkpoint-sqlite';
|
|
2
4
|
/**
|
|
3
5
|
* Creates a SQLite-backed checkpoint saver for LangGraph state persistence.
|
|
6
|
+
* Ensures the parent directory exists for file-based paths.
|
|
4
7
|
*
|
|
5
8
|
* @param dbPath - Path to the SQLite database file (e.g., ':memory:' or a file path)
|
|
6
9
|
* @returns A SqliteSaver instance ready for use as a LangGraph checkpointer
|
|
7
10
|
*/
|
|
8
11
|
export function createCheckpointer(dbPath) {
|
|
12
|
+
if (dbPath !== ':memory:') {
|
|
13
|
+
mkdirSync(dirname(dbPath), { recursive: true });
|
|
14
|
+
}
|
|
9
15
|
return SqliteSaver.fromConnString(dbPath);
|
|
10
16
|
}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* to enable testability without mocking node:child_process directly.
|
|
10
10
|
*/
|
|
11
11
|
import type { ChildProcess } from 'node:child_process';
|
|
12
|
-
import type { AgentType, AgentFeature } from '
|
|
13
|
-
import type { IAgentExecutor, AgentExecutionOptions, AgentExecutionResult, AgentExecutionStreamEvent } from '
|
|
12
|
+
import type { AgentType, AgentFeature } from '../../../../../domain/generated/output.js';
|
|
13
|
+
import type { IAgentExecutor, AgentExecutionOptions, AgentExecutionResult, AgentExecutionStreamEvent } from '../../../../../application/ports/output/agents/agent-executor.interface.js';
|
|
14
14
|
/**
|
|
15
15
|
* Type for the spawn dependency.
|
|
16
16
|
* Matches the signature of child_process.spawn.
|
|
@@ -25,8 +25,15 @@ export declare class ClaudeCodeExecutorService implements IAgentExecutor {
|
|
|
25
25
|
private readonly spawn;
|
|
26
26
|
readonly agentType: AgentType;
|
|
27
27
|
constructor(spawn: SpawnFunction);
|
|
28
|
+
/** Debug logging — writes to stdout so it appears in the worker log file */
|
|
29
|
+
private log;
|
|
28
30
|
execute(prompt: string, options?: AgentExecutionOptions): Promise<AgentExecutionResult>;
|
|
29
31
|
executeStream(prompt: string, options?: AgentExecutionOptions): AsyncIterable<AgentExecutionStreamEvent>;
|
|
32
|
+
/**
|
|
33
|
+
* Log a stream-json line as a human-readable event in the worker log.
|
|
34
|
+
* Extracts tool calls, assistant text, and result summaries.
|
|
35
|
+
*/
|
|
36
|
+
private logStreamEvent;
|
|
30
37
|
supportsFeature(feature: AgentFeature): boolean;
|
|
31
38
|
private buildArgs;
|
|
32
39
|
private buildStreamArgs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code-executor.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/infrastructure/services/agents/common/executors/claude-code-executor.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,4EAA4E,CAAC;AAEpF;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,YAAY,CAAC;AAUhG;;;GAGG;AACH,qBAAa,yBAA0B,YAAW,cAAc;IAGlD,OAAO,CAAC,QAAQ,CAAC,KAAK;IAFlC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAA8B;gBAE9B,KAAK,EAAE,aAAa;IAEjD,4EAA4E;IAC5E,OAAO,CAAC,GAAG;IAKL,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAkHtF,aAAa,CAClB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,qBAAqB,GAC9B,aAAa,CAAC,yBAAyB,CAAC;IA+F3C;;;OAGG;IACH,OAAO,CAAC,cAAc;IAmCtB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO;IAI/C,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,eAAe;IAiCvB,OAAO,CAAC,eAAe;CAkExB"}
|
|
@@ -25,33 +25,87 @@ export class ClaudeCodeExecutorService {
|
|
|
25
25
|
constructor(spawn) {
|
|
26
26
|
this.spawn = spawn;
|
|
27
27
|
}
|
|
28
|
+
/** Debug logging — writes to stdout so it appears in the worker log file */
|
|
29
|
+
log(message) {
|
|
30
|
+
const ts = new Date().toISOString();
|
|
31
|
+
process.stdout.write(`[${ts}] [claude-executor] ${message}\n`);
|
|
32
|
+
}
|
|
28
33
|
async execute(prompt, options) {
|
|
29
|
-
|
|
34
|
+
// Use stream-json so we get real-time events in the worker log
|
|
35
|
+
// instead of zero output for minutes with --output-format json
|
|
36
|
+
const args = this.buildStreamArgs(prompt, options);
|
|
30
37
|
const spawnOpts = this.buildSpawnOptions(options);
|
|
38
|
+
this.log(`Spawning: claude ${args.map((a) => (a.length > 80 ? `${a.slice(0, 77)}...` : a)).join(' ')}`);
|
|
39
|
+
this.log(`Spawn options: ${JSON.stringify(spawnOpts)}`);
|
|
31
40
|
const proc = this.spawn('claude', args, spawnOpts);
|
|
41
|
+
this.log(`Subprocess PID: ${proc.pid ?? 'undefined (spawn may have failed)'}`);
|
|
42
|
+
// Close stdin immediately — we pass the prompt via -p, not stdin.
|
|
43
|
+
if (proc.stdin) {
|
|
44
|
+
proc.stdin.end();
|
|
45
|
+
}
|
|
32
46
|
return new Promise((resolve, reject) => {
|
|
33
|
-
|
|
47
|
+
// Line-based parsing: only keep the data we need, not all of stdout
|
|
48
|
+
let lineBuffer = '';
|
|
34
49
|
let stderr = '';
|
|
35
50
|
let timedOut = false;
|
|
36
51
|
let timeoutId;
|
|
52
|
+
// Collected from the stream — only the final result line matters
|
|
53
|
+
let resultText = '';
|
|
54
|
+
let sessionId;
|
|
55
|
+
let usage;
|
|
56
|
+
let metadata;
|
|
37
57
|
if (options?.timeout) {
|
|
38
58
|
timeoutId = setTimeout(() => {
|
|
39
59
|
timedOut = true;
|
|
40
60
|
proc.kill();
|
|
41
61
|
}, options.timeout);
|
|
42
62
|
}
|
|
63
|
+
const processLine = (line) => {
|
|
64
|
+
this.logStreamEvent(line);
|
|
65
|
+
try {
|
|
66
|
+
const parsed = JSON.parse(line);
|
|
67
|
+
if (parsed.type === 'result') {
|
|
68
|
+
resultText = parsed.result ?? '';
|
|
69
|
+
if (parsed.session_id)
|
|
70
|
+
sessionId = parsed.session_id;
|
|
71
|
+
if (parsed.input_tokens !== undefined && parsed.output_tokens !== undefined) {
|
|
72
|
+
usage = { inputTokens: parsed.input_tokens, outputTokens: parsed.output_tokens };
|
|
73
|
+
}
|
|
74
|
+
const { type: _t, result: _r, session_id: _s, input_tokens: _it, output_tokens: _ot, ...rest } = parsed;
|
|
75
|
+
if (Object.keys(rest).length > 0)
|
|
76
|
+
metadata = rest;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
/* not JSON — already logged by logStreamEvent */
|
|
81
|
+
}
|
|
82
|
+
};
|
|
43
83
|
proc.stdout?.on('data', (chunk) => {
|
|
44
|
-
|
|
84
|
+
lineBuffer += chunk.toString();
|
|
85
|
+
const lines = lineBuffer.split('\n');
|
|
86
|
+
lineBuffer = lines.pop() ?? '';
|
|
87
|
+
for (const line of lines) {
|
|
88
|
+
const trimmed = line.trim();
|
|
89
|
+
if (trimmed)
|
|
90
|
+
processLine(trimmed);
|
|
91
|
+
}
|
|
45
92
|
});
|
|
46
93
|
proc.stderr?.on('data', (chunk) => {
|
|
47
|
-
|
|
94
|
+
const data = chunk.toString();
|
|
95
|
+
stderr += data;
|
|
96
|
+
this.log(`stderr: ${data.trimEnd()}`);
|
|
48
97
|
});
|
|
49
98
|
proc.on('error', (error) => {
|
|
99
|
+
this.log(`Process error event: ${error.message}`);
|
|
50
100
|
if (timeoutId)
|
|
51
101
|
clearTimeout(timeoutId);
|
|
52
102
|
reject(error);
|
|
53
103
|
});
|
|
54
104
|
proc.on('close', (code) => {
|
|
105
|
+
// Flush remaining buffer
|
|
106
|
+
if (lineBuffer.trim())
|
|
107
|
+
processLine(lineBuffer.trim());
|
|
108
|
+
this.log(`Process closed with code ${code}, result=${resultText.length} chars`);
|
|
55
109
|
if (timeoutId)
|
|
56
110
|
clearTimeout(timeoutId);
|
|
57
111
|
if (timedOut) {
|
|
@@ -62,7 +116,14 @@ export class ClaudeCodeExecutorService {
|
|
|
62
116
|
reject(new Error(stderr.trim() || `Process exited with code ${code}`));
|
|
63
117
|
return;
|
|
64
118
|
}
|
|
65
|
-
|
|
119
|
+
const result = { result: resultText };
|
|
120
|
+
if (sessionId)
|
|
121
|
+
result.sessionId = sessionId;
|
|
122
|
+
if (usage)
|
|
123
|
+
result.usage = usage;
|
|
124
|
+
if (metadata)
|
|
125
|
+
result.metadata = metadata;
|
|
126
|
+
resolve(result);
|
|
66
127
|
});
|
|
67
128
|
});
|
|
68
129
|
}
|
|
@@ -150,11 +211,47 @@ export class ClaudeCodeExecutorService {
|
|
|
150
211
|
yield item;
|
|
151
212
|
}
|
|
152
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* Log a stream-json line as a human-readable event in the worker log.
|
|
216
|
+
* Extracts tool calls, assistant text, and result summaries.
|
|
217
|
+
*/
|
|
218
|
+
logStreamEvent(line) {
|
|
219
|
+
try {
|
|
220
|
+
const parsed = JSON.parse(line);
|
|
221
|
+
// Assistant messages contain tool_use and text blocks
|
|
222
|
+
if (parsed.type === 'assistant' && Array.isArray(parsed.message?.content)) {
|
|
223
|
+
for (const block of parsed.message.content) {
|
|
224
|
+
if (block.type === 'tool_use') {
|
|
225
|
+
const inputJson = JSON.stringify(block.input ?? {});
|
|
226
|
+
this.log(`[tool] ${block.name} ${inputJson}`);
|
|
227
|
+
}
|
|
228
|
+
else if (block.type === 'text' && block.text?.trim()) {
|
|
229
|
+
this.log(`[text] ${block.text.trim().replace(/\n/g, ' ')}`);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
// Final result — summary with session and token info
|
|
235
|
+
if (parsed.type === 'result') {
|
|
236
|
+
this.log(`[result] ${(parsed.result ?? '').length} chars, session=${parsed.session_id ?? 'none'}`);
|
|
237
|
+
if (parsed.input_tokens != null) {
|
|
238
|
+
this.log(`[tokens] ${parsed.input_tokens} in / ${parsed.output_tokens} out`);
|
|
239
|
+
}
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
catch {
|
|
244
|
+
// Non-JSON line — log it raw
|
|
245
|
+
if (line.length > 0) {
|
|
246
|
+
this.log(`[raw] ${line}`);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
153
250
|
supportsFeature(feature) {
|
|
154
251
|
return SUPPORTED_FEATURES.has(feature);
|
|
155
252
|
}
|
|
156
253
|
buildArgs(prompt, options) {
|
|
157
|
-
const args = ['-p', prompt, '--output-format', 'json'];
|
|
254
|
+
const args = ['-p', prompt, '--output-format', 'json', '--dangerously-skip-permissions'];
|
|
158
255
|
if (options?.resumeSession)
|
|
159
256
|
args.push('--resume', options.resumeSession);
|
|
160
257
|
if (options?.model)
|
package/dist/src/infrastructure/services/agents/common/executors/mock-executor-factory.service.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock Agent Executor Factory
|
|
3
|
+
*
|
|
4
|
+
* Returns MockAgentExecutorService for deterministic E2E test behavior.
|
|
5
|
+
* Activated via SHEP_MOCK_EXECUTOR=1 environment variable.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentType, AgentConfig } from '../../../../../domain/generated/output.js';
|
|
8
|
+
import type { IAgentExecutor } from '../../../../../application/ports/output/agents/agent-executor.interface.js';
|
|
9
|
+
import type { IAgentExecutorFactory } from '../../../../../application/ports/output/agents/agent-executor-factory.interface.js';
|
|
10
|
+
export declare class MockAgentExecutorFactory implements IAgentExecutorFactory {
|
|
11
|
+
private readonly executor;
|
|
12
|
+
createExecutor(_agentType: AgentType, _authConfig: AgentConfig): IAgentExecutor;
|
|
13
|
+
getSupportedAgents(): AgentType[];
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=mock-executor-factory.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-executor-factory.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/infrastructure/services/agents/common/executors/mock-executor-factory.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4EAA4E,CAAC;AACjH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oFAAoF,CAAC;AAGhI,qBAAa,wBAAyB,YAAW,qBAAqB;IACpE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;IAE3D,cAAc,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,GAAG,cAAc;IAI/E,kBAAkB,IAAI,SAAS,EAAE;CAGlC"}
|
package/dist/src/infrastructure/services/agents/common/executors/mock-executor-factory.service.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock Agent Executor Factory
|
|
3
|
+
*
|
|
4
|
+
* Returns MockAgentExecutorService for deterministic E2E test behavior.
|
|
5
|
+
* Activated via SHEP_MOCK_EXECUTOR=1 environment variable.
|
|
6
|
+
*/
|
|
7
|
+
import { MockAgentExecutorService } from './mock-executor.service.js';
|
|
8
|
+
export class MockAgentExecutorFactory {
|
|
9
|
+
executor = new MockAgentExecutorService();
|
|
10
|
+
createExecutor(_agentType, _authConfig) {
|
|
11
|
+
return this.executor;
|
|
12
|
+
}
|
|
13
|
+
getSupportedAgents() {
|
|
14
|
+
return ['claude-code'];
|
|
15
|
+
}
|
|
16
|
+
}
|