hungry-ghost-hive 0.3.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/LICENSE +111 -0
- package/README.md +352 -0
- package/dist/agents/base-agent.d.ts +63 -0
- package/dist/agents/base-agent.d.ts.map +1 -0
- package/dist/agents/base-agent.js +189 -0
- package/dist/agents/base-agent.js.map +1 -0
- package/dist/agents/index.d.ts +7 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +7 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/intermediate.d.ts +15 -0
- package/dist/agents/intermediate.d.ts.map +1 -0
- package/dist/agents/intermediate.js +142 -0
- package/dist/agents/intermediate.js.map +1 -0
- package/dist/agents/junior.d.ts +15 -0
- package/dist/agents/junior.d.ts.map +1 -0
- package/dist/agents/junior.js +147 -0
- package/dist/agents/junior.js.map +1 -0
- package/dist/agents/qa.d.ts +23 -0
- package/dist/agents/qa.d.ts.map +1 -0
- package/dist/agents/qa.js +238 -0
- package/dist/agents/qa.js.map +1 -0
- package/dist/agents/senior.d.ts +18 -0
- package/dist/agents/senior.d.ts.map +1 -0
- package/dist/agents/senior.js +267 -0
- package/dist/agents/senior.js.map +1 -0
- package/dist/agents/tech-lead.d.ts +17 -0
- package/dist/agents/tech-lead.d.ts.map +1 -0
- package/dist/agents/tech-lead.js +274 -0
- package/dist/agents/tech-lead.js.map +1 -0
- package/dist/cli/commands/add-repo.d.ts +3 -0
- package/dist/cli/commands/add-repo.d.ts.map +1 -0
- package/dist/cli/commands/add-repo.js +84 -0
- package/dist/cli/commands/add-repo.js.map +1 -0
- package/dist/cli/commands/agents.d.ts +3 -0
- package/dist/cli/commands/agents.d.ts.map +1 -0
- package/dist/cli/commands/agents.js +214 -0
- package/dist/cli/commands/agents.js.map +1 -0
- package/dist/cli/commands/assign.d.ts +3 -0
- package/dist/cli/commands/assign.d.ts.map +1 -0
- package/dist/cli/commands/assign.js +81 -0
- package/dist/cli/commands/assign.js.map +1 -0
- package/dist/cli/commands/config.d.ts +3 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +118 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/escalations.d.ts +3 -0
- package/dist/cli/commands/escalations.d.ts.map +1 -0
- package/dist/cli/commands/escalations.js +157 -0
- package/dist/cli/commands/escalations.js.map +1 -0
- package/dist/cli/commands/index.d.ts +17 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +17 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/init.d.ts +3 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +59 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/manager.d.ts +3 -0
- package/dist/cli/commands/manager.d.ts.map +1 -0
- package/dist/cli/commands/manager.js +775 -0
- package/dist/cli/commands/manager.js.map +1 -0
- package/dist/cli/commands/manager.test.d.ts +2 -0
- package/dist/cli/commands/manager.test.d.ts.map +1 -0
- package/dist/cli/commands/manager.test.js +45 -0
- package/dist/cli/commands/manager.test.js.map +1 -0
- package/dist/cli/commands/msg.d.ts +3 -0
- package/dist/cli/commands/msg.d.ts.map +1 -0
- package/dist/cli/commands/msg.js +190 -0
- package/dist/cli/commands/msg.js.map +1 -0
- package/dist/cli/commands/my-stories.d.ts +3 -0
- package/dist/cli/commands/my-stories.d.ts.map +1 -0
- package/dist/cli/commands/my-stories.js +174 -0
- package/dist/cli/commands/my-stories.js.map +1 -0
- package/dist/cli/commands/nuke.d.ts +3 -0
- package/dist/cli/commands/nuke.d.ts.map +1 -0
- package/dist/cli/commands/nuke.js +189 -0
- package/dist/cli/commands/nuke.js.map +1 -0
- package/dist/cli/commands/pr.d.ts +3 -0
- package/dist/cli/commands/pr.d.ts.map +1 -0
- package/dist/cli/commands/pr.js +488 -0
- package/dist/cli/commands/pr.js.map +1 -0
- package/dist/cli/commands/req.d.ts +3 -0
- package/dist/cli/commands/req.d.ts.map +1 -0
- package/dist/cli/commands/req.js +212 -0
- package/dist/cli/commands/req.js.map +1 -0
- package/dist/cli/commands/resume.d.ts +3 -0
- package/dist/cli/commands/resume.d.ts.map +1 -0
- package/dist/cli/commands/resume.js +114 -0
- package/dist/cli/commands/resume.js.map +1 -0
- package/dist/cli/commands/status.d.ts +3 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +259 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/stories.d.ts +3 -0
- package/dist/cli/commands/stories.d.ts.map +1 -0
- package/dist/cli/commands/stories.js +111 -0
- package/dist/cli/commands/stories.js.map +1 -0
- package/dist/cli/commands/teams.d.ts +3 -0
- package/dist/cli/commands/teams.d.ts.map +1 -0
- package/dist/cli/commands/teams.js +137 -0
- package/dist/cli/commands/teams.js.map +1 -0
- package/dist/cli/dashboard/index.d.ts +5 -0
- package/dist/cli/dashboard/index.d.ts.map +1 -0
- package/dist/cli/dashboard/index.js +128 -0
- package/dist/cli/dashboard/index.js.map +1 -0
- package/dist/cli/dashboard/panels/activity.d.ts +5 -0
- package/dist/cli/dashboard/panels/activity.d.ts.map +1 -0
- package/dist/cli/dashboard/panels/activity.js +64 -0
- package/dist/cli/dashboard/panels/activity.js.map +1 -0
- package/dist/cli/dashboard/panels/agents.d.ts +5 -0
- package/dist/cli/dashboard/panels/agents.d.ts.map +1 -0
- package/dist/cli/dashboard/panels/agents.js +196 -0
- package/dist/cli/dashboard/panels/agents.js.map +1 -0
- package/dist/cli/dashboard/panels/escalations.d.ts +5 -0
- package/dist/cli/dashboard/panels/escalations.d.ts.map +1 -0
- package/dist/cli/dashboard/panels/escalations.js +93 -0
- package/dist/cli/dashboard/panels/escalations.js.map +1 -0
- package/dist/cli/dashboard/panels/merge-queue.d.ts +5 -0
- package/dist/cli/dashboard/panels/merge-queue.d.ts.map +1 -0
- package/dist/cli/dashboard/panels/merge-queue.js +57 -0
- package/dist/cli/dashboard/panels/merge-queue.js.map +1 -0
- package/dist/cli/dashboard/panels/pipeline.d.ts +5 -0
- package/dist/cli/dashboard/panels/pipeline.d.ts.map +1 -0
- package/dist/cli/dashboard/panels/pipeline.js +54 -0
- package/dist/cli/dashboard/panels/pipeline.js.map +1 -0
- package/dist/cli/dashboard/panels/stories.d.ts +5 -0
- package/dist/cli/dashboard/panels/stories.d.ts.map +1 -0
- package/dist/cli/dashboard/panels/stories.js +79 -0
- package/dist/cli/dashboard/panels/stories.js.map +1 -0
- package/dist/cli-runtimes/claude.d.ts +8 -0
- package/dist/cli-runtimes/claude.d.ts.map +1 -0
- package/dist/cli-runtimes/claude.js +27 -0
- package/dist/cli-runtimes/claude.js.map +1 -0
- package/dist/cli-runtimes/codex.d.ts +8 -0
- package/dist/cli-runtimes/codex.d.ts.map +1 -0
- package/dist/cli-runtimes/codex.js +27 -0
- package/dist/cli-runtimes/codex.js.map +1 -0
- package/dist/cli-runtimes/gemini.d.ts +8 -0
- package/dist/cli-runtimes/gemini.d.ts.map +1 -0
- package/dist/cli-runtimes/gemini.js +29 -0
- package/dist/cli-runtimes/gemini.js.map +1 -0
- package/dist/cli-runtimes/index.d.ts +25 -0
- package/dist/cli-runtimes/index.d.ts.map +1 -0
- package/dist/cli-runtimes/index.js +48 -0
- package/dist/cli-runtimes/index.js.map +1 -0
- package/dist/cli-runtimes/index.test.d.ts +2 -0
- package/dist/cli-runtimes/index.test.d.ts.map +1 -0
- package/dist/cli-runtimes/index.test.js +216 -0
- package/dist/cli-runtimes/index.test.js.map +1 -0
- package/dist/cli-runtimes/types.d.ts +27 -0
- package/dist/cli-runtimes/types.d.ts.map +1 -0
- package/dist/cli-runtimes/types.js +2 -0
- package/dist/cli-runtimes/types.js.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +3 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +11 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +72 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/schema.d.ts +660 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +217 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/schema.test.d.ts +2 -0
- package/dist/config/schema.test.d.ts.map +1 -0
- package/dist/config/schema.test.js +123 -0
- package/dist/config/schema.test.js.map +1 -0
- package/dist/context-files/generator.d.ts +32 -0
- package/dist/context-files/generator.d.ts.map +1 -0
- package/dist/context-files/generator.js +120 -0
- package/dist/context-files/generator.js.map +1 -0
- package/dist/context-files/index.d.ts +38 -0
- package/dist/context-files/index.d.ts.map +1 -0
- package/dist/context-files/index.js +76 -0
- package/dist/context-files/index.js.map +1 -0
- package/dist/context-files/index.test.d.ts +2 -0
- package/dist/context-files/index.test.d.ts.map +1 -0
- package/dist/context-files/index.test.js +265 -0
- package/dist/context-files/index.test.js.map +1 -0
- package/dist/context-files/templates.d.ts +19 -0
- package/dist/context-files/templates.d.ts.map +1 -0
- package/dist/context-files/templates.js +266 -0
- package/dist/context-files/templates.js.map +1 -0
- package/dist/db/client.d.ts +95 -0
- package/dist/db/client.d.ts.map +1 -0
- package/dist/db/client.js +343 -0
- package/dist/db/client.js.map +1 -0
- package/dist/db/lock.d.ts +25 -0
- package/dist/db/lock.d.ts.map +1 -0
- package/dist/db/lock.js +56 -0
- package/dist/db/lock.js.map +1 -0
- package/dist/db/lock.test.d.ts +2 -0
- package/dist/db/lock.test.d.ts.map +1 -0
- package/dist/db/lock.test.js +73 -0
- package/dist/db/lock.test.js.map +1 -0
- package/dist/db/queries/agents.d.ts +31 -0
- package/dist/db/queries/agents.d.ts.map +1 -0
- package/dist/db/queries/agents.js +76 -0
- package/dist/db/queries/agents.js.map +1 -0
- package/dist/db/queries/escalations.d.ts +29 -0
- package/dist/db/queries/escalations.d.ts.map +1 -0
- package/dist/db/queries/escalations.js +105 -0
- package/dist/db/queries/escalations.js.map +1 -0
- package/dist/db/queries/heartbeat.d.ts +20 -0
- package/dist/db/queries/heartbeat.d.ts.map +1 -0
- package/dist/db/queries/heartbeat.js +61 -0
- package/dist/db/queries/heartbeat.js.map +1 -0
- package/dist/db/queries/index.d.ts +8 -0
- package/dist/db/queries/index.d.ts.map +1 -0
- package/dist/db/queries/index.js +8 -0
- package/dist/db/queries/index.js.map +1 -0
- package/dist/db/queries/logs.d.ts +21 -0
- package/dist/db/queries/logs.d.ts.map +1 -0
- package/dist/db/queries/logs.js +72 -0
- package/dist/db/queries/logs.js.map +1 -0
- package/dist/db/queries/messages.d.ts +17 -0
- package/dist/db/queries/messages.d.ts.map +1 -0
- package/dist/db/queries/messages.js +22 -0
- package/dist/db/queries/messages.js.map +1 -0
- package/dist/db/queries/pull-requests.d.ts +33 -0
- package/dist/db/queries/pull-requests.d.ts.map +1 -0
- package/dist/db/queries/pull-requests.js +130 -0
- package/dist/db/queries/pull-requests.js.map +1 -0
- package/dist/db/queries/requirements.d.ts +22 -0
- package/dist/db/queries/requirements.d.ts.map +1 -0
- package/dist/db/queries/requirements.js +53 -0
- package/dist/db/queries/requirements.js.map +1 -0
- package/dist/db/queries/stories.d.ts +42 -0
- package/dist/db/queries/stories.d.ts.map +1 -0
- package/dist/db/queries/stories.js +163 -0
- package/dist/db/queries/stories.js.map +1 -0
- package/dist/db/queries/teams.d.ts +14 -0
- package/dist/db/queries/teams.d.ts.map +1 -0
- package/dist/db/queries/teams.js +24 -0
- package/dist/db/queries/teams.js.map +1 -0
- package/dist/git/branches.d.ts +52 -0
- package/dist/git/branches.d.ts.map +1 -0
- package/dist/git/branches.js +133 -0
- package/dist/git/branches.js.map +1 -0
- package/dist/git/github.d.ts +75 -0
- package/dist/git/github.d.ts.map +1 -0
- package/dist/git/github.js +162 -0
- package/dist/git/github.js.map +1 -0
- package/dist/git/index.d.ts +4 -0
- package/dist/git/index.d.ts.map +1 -0
- package/dist/git/index.js +4 -0
- package/dist/git/index.js.map +1 -0
- package/dist/git/submodules.d.ts +47 -0
- package/dist/git/submodules.d.ts.map +1 -0
- package/dist/git/submodules.js +115 -0
- package/dist/git/submodules.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/dist/llm/anthropic.d.ts +18 -0
- package/dist/llm/anthropic.d.ts.map +1 -0
- package/dist/llm/anthropic.js +111 -0
- package/dist/llm/anthropic.js.map +1 -0
- package/dist/llm/index.d.ts +6 -0
- package/dist/llm/index.d.ts.map +1 -0
- package/dist/llm/index.js +24 -0
- package/dist/llm/index.js.map +1 -0
- package/dist/llm/openai.d.ts +18 -0
- package/dist/llm/openai.d.ts.map +1 -0
- package/dist/llm/openai.js +103 -0
- package/dist/llm/openai.js.map +1 -0
- package/dist/llm/provider.d.ts +38 -0
- package/dist/llm/provider.d.ts.map +1 -0
- package/dist/llm/provider.js +17 -0
- package/dist/llm/provider.js.map +1 -0
- package/dist/orchestrator/index.d.ts +4 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +4 -0
- package/dist/orchestrator/index.js.map +1 -0
- package/dist/orchestrator/scaler.d.ts +42 -0
- package/dist/orchestrator/scaler.d.ts.map +1 -0
- package/dist/orchestrator/scaler.js +154 -0
- package/dist/orchestrator/scaler.js.map +1 -0
- package/dist/orchestrator/scheduler.d.ts +90 -0
- package/dist/orchestrator/scheduler.d.ts.map +1 -0
- package/dist/orchestrator/scheduler.js +1003 -0
- package/dist/orchestrator/scheduler.js.map +1 -0
- package/dist/orchestrator/scheduler.test.d.ts +2 -0
- package/dist/orchestrator/scheduler.test.d.ts.map +1 -0
- package/dist/orchestrator/scheduler.test.js +242 -0
- package/dist/orchestrator/scheduler.test.js.map +1 -0
- package/dist/orchestrator/workflow.d.ts +18 -0
- package/dist/orchestrator/workflow.d.ts.map +1 -0
- package/dist/orchestrator/workflow.js +106 -0
- package/dist/orchestrator/workflow.js.map +1 -0
- package/dist/state-detectors/claude.d.ts +33 -0
- package/dist/state-detectors/claude.d.ts.map +1 -0
- package/dist/state-detectors/claude.js +237 -0
- package/dist/state-detectors/claude.js.map +1 -0
- package/dist/state-detectors/claude.test.d.ts +2 -0
- package/dist/state-detectors/claude.test.d.ts.map +1 -0
- package/dist/state-detectors/claude.test.js +127 -0
- package/dist/state-detectors/claude.test.js.map +1 -0
- package/dist/state-detectors/codex.d.ts +34 -0
- package/dist/state-detectors/codex.d.ts.map +1 -0
- package/dist/state-detectors/codex.js +233 -0
- package/dist/state-detectors/codex.js.map +1 -0
- package/dist/state-detectors/codex.test.d.ts +2 -0
- package/dist/state-detectors/codex.test.d.ts.map +1 -0
- package/dist/state-detectors/codex.test.js +85 -0
- package/dist/state-detectors/codex.test.js.map +1 -0
- package/dist/state-detectors/factory.d.ts +22 -0
- package/dist/state-detectors/factory.d.ts.map +1 -0
- package/dist/state-detectors/factory.js +37 -0
- package/dist/state-detectors/factory.js.map +1 -0
- package/dist/state-detectors/factory.test.d.ts +2 -0
- package/dist/state-detectors/factory.test.d.ts.map +1 -0
- package/dist/state-detectors/factory.test.js +44 -0
- package/dist/state-detectors/factory.test.js.map +1 -0
- package/dist/state-detectors/gemini.d.ts +34 -0
- package/dist/state-detectors/gemini.d.ts.map +1 -0
- package/dist/state-detectors/gemini.js +236 -0
- package/dist/state-detectors/gemini.js.map +1 -0
- package/dist/state-detectors/gemini.test.d.ts +2 -0
- package/dist/state-detectors/gemini.test.d.ts.map +1 -0
- package/dist/state-detectors/gemini.test.js +93 -0
- package/dist/state-detectors/gemini.test.js.map +1 -0
- package/dist/state-detectors/index.d.ts +20 -0
- package/dist/state-detectors/index.d.ts.map +1 -0
- package/dist/state-detectors/index.js +21 -0
- package/dist/state-detectors/index.js.map +1 -0
- package/dist/state-detectors/types.d.ts +67 -0
- package/dist/state-detectors/types.d.ts.map +1 -0
- package/dist/state-detectors/types.js +28 -0
- package/dist/state-detectors/types.js.map +1 -0
- package/dist/tmux/index.d.ts +2 -0
- package/dist/tmux/index.d.ts.map +1 -0
- package/dist/tmux/index.js +2 -0
- package/dist/tmux/index.js.map +1 -0
- package/dist/tmux/manager.d.ts +45 -0
- package/dist/tmux/manager.d.ts.map +1 -0
- package/dist/tmux/manager.js +252 -0
- package/dist/tmux/manager.js.map +1 -0
- package/dist/utils/claude-code-state.d.ts +46 -0
- package/dist/utils/claude-code-state.d.ts.map +1 -0
- package/dist/utils/claude-code-state.js +252 -0
- package/dist/utils/claude-code-state.js.map +1 -0
- package/dist/utils/cli-builder.d.ts +19 -0
- package/dist/utils/cli-builder.d.ts.map +1 -0
- package/dist/utils/cli-builder.js +58 -0
- package/dist/utils/cli-builder.js.map +1 -0
- package/dist/utils/cli-commands.d.ts +27 -0
- package/dist/utils/cli-commands.d.ts.map +1 -0
- package/dist/utils/cli-commands.js +69 -0
- package/dist/utils/cli-commands.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +13 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +77 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/paths.d.ts +17 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +33 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/timeout.d.ts +25 -0
- package/dist/utils/timeout.d.ts.map +1 -0
- package/dist/utils/timeout.js +57 -0
- package/dist/utils/timeout.js.map +1 -0
- package/package.json +78 -0
- package/src/agents/base-agent.ts +255 -0
- package/src/agents/index.ts +6 -0
- package/src/agents/intermediate.ts +161 -0
- package/src/agents/junior.ts +166 -0
- package/src/agents/qa.ts +272 -0
- package/src/agents/senior.ts +307 -0
- package/src/agents/tech-lead.ts +324 -0
- package/src/cli/commands/add-repo.ts +89 -0
- package/src/cli/commands/agents.ts +247 -0
- package/src/cli/commands/assign.ts +86 -0
- package/src/cli/commands/config.ts +121 -0
- package/src/cli/commands/escalations.ts +179 -0
- package/src/cli/commands/index.ts +16 -0
- package/src/cli/commands/init.ts +66 -0
- package/src/cli/commands/manager.test.ts +52 -0
- package/src/cli/commands/manager.ts +916 -0
- package/src/cli/commands/msg.ts +232 -0
- package/src/cli/commands/my-stories.ts +198 -0
- package/src/cli/commands/nuke.ts +223 -0
- package/src/cli/commands/pr.ts +559 -0
- package/src/cli/commands/req.ts +231 -0
- package/src/cli/commands/resume.ts +129 -0
- package/src/cli/commands/status.ts +284 -0
- package/src/cli/commands/stories.ts +131 -0
- package/src/cli/commands/teams.ts +158 -0
- package/src/cli/dashboard/index.ts +141 -0
- package/src/cli/dashboard/panels/activity.ts +77 -0
- package/src/cli/dashboard/panels/agents.ts +244 -0
- package/src/cli/dashboard/panels/escalations.ts +109 -0
- package/src/cli/dashboard/panels/merge-queue.ts +65 -0
- package/src/cli/dashboard/panels/pipeline.ts +65 -0
- package/src/cli/dashboard/panels/stories.ts +87 -0
- package/src/cli-runtimes/claude.ts +31 -0
- package/src/cli-runtimes/codex.ts +31 -0
- package/src/cli-runtimes/gemini.ts +33 -0
- package/src/cli-runtimes/index.test.ts +261 -0
- package/src/cli-runtimes/index.ts +52 -0
- package/src/cli-runtimes/types.ts +30 -0
- package/src/config/index.ts +2 -0
- package/src/config/loader.ts +89 -0
- package/src/config/schema.test.ts +135 -0
- package/src/config/schema.ts +238 -0
- package/src/context-files/generator.ts +132 -0
- package/src/context-files/index.test.ts +323 -0
- package/src/context-files/index.ts +102 -0
- package/src/context-files/templates.ts +279 -0
- package/src/db/client.ts +475 -0
- package/src/db/lock.test.ts +93 -0
- package/src/db/lock.ts +74 -0
- package/src/db/migrations/001-initial.sql +121 -0
- package/src/db/migrations/005-add-agent-heartbeat.sql +4 -0
- package/src/db/queries/agents.ts +113 -0
- package/src/db/queries/escalations.ts +140 -0
- package/src/db/queries/heartbeat.ts +92 -0
- package/src/db/queries/index.ts +7 -0
- package/src/db/queries/logs.ts +136 -0
- package/src/db/queries/messages.ts +38 -0
- package/src/db/queries/pull-requests.ts +170 -0
- package/src/db/queries/requirements.ts +81 -0
- package/src/db/queries/stories.ts +223 -0
- package/src/db/queries/teams.ts +39 -0
- package/src/git/branches.ts +186 -0
- package/src/git/github.ts +247 -0
- package/src/git/index.ts +3 -0
- package/src/git/submodules.ts +141 -0
- package/src/index.ts +93 -0
- package/src/llm/anthropic.ts +134 -0
- package/src/llm/index.ts +26 -0
- package/src/llm/openai.ts +125 -0
- package/src/llm/provider.ts +60 -0
- package/src/orchestrator/index.ts +3 -0
- package/src/orchestrator/scaler.ts +201 -0
- package/src/orchestrator/scheduler.test.ts +288 -0
- package/src/orchestrator/scheduler.ts +1130 -0
- package/src/orchestrator/workflow.ts +137 -0
- package/src/state-detectors/claude.test.ts +149 -0
- package/src/state-detectors/claude.ts +256 -0
- package/src/state-detectors/codex.test.ts +100 -0
- package/src/state-detectors/codex.ts +252 -0
- package/src/state-detectors/factory.test.ts +51 -0
- package/src/state-detectors/factory.ts +40 -0
- package/src/state-detectors/gemini.test.ts +110 -0
- package/src/state-detectors/gemini.ts +255 -0
- package/src/state-detectors/index.ts +25 -0
- package/src/state-detectors/types.ts +80 -0
- package/src/tmux/index.ts +1 -0
- package/src/tmux/manager.ts +310 -0
- package/src/types/sql.js.d.ts +34 -0
- package/src/utils/claude-code-state.ts +281 -0
- package/src/utils/cli-builder.ts +78 -0
- package/src/utils/cli-commands.ts +84 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/logger.ts +93 -0
- package/src/utils/paths.ts +49 -0
- package/src/utils/timeout.ts +84 -0
- package/tsconfig.json +25 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
HUNGRY GHOST HIVE LICENSE
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hungry Ghost. All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS
|
|
6
|
+
|
|
7
|
+
1. DEFINITIONS
|
|
8
|
+
|
|
9
|
+
"Software" refers to the Hive system, including all source code, documentation,
|
|
10
|
+
and associated files in this repository.
|
|
11
|
+
|
|
12
|
+
"Contribution" means any work of authorship submitted to the project for
|
|
13
|
+
inclusion in the Software.
|
|
14
|
+
|
|
15
|
+
"Contributor" means any individual or entity that submits a Contribution.
|
|
16
|
+
|
|
17
|
+
2. GRANT OF RIGHTS
|
|
18
|
+
|
|
19
|
+
Subject to the terms of this License, you are granted the following rights:
|
|
20
|
+
|
|
21
|
+
a) USE: You may use the Software for any purpose, including commercial projects.
|
|
22
|
+
|
|
23
|
+
b) MODIFY: You may modify, adapt, and create derivative works of the Software
|
|
24
|
+
for your own internal use.
|
|
25
|
+
|
|
26
|
+
c) CONTRIBUTE: You may submit Contributions to the official repository. By
|
|
27
|
+
submitting a Contribution, you grant Hungry Ghost a perpetual, worldwide,
|
|
28
|
+
non-exclusive, royalty-free, irrevocable license to use, reproduce, modify,
|
|
29
|
+
distribute, and sublicense your Contribution as part of the Software.
|
|
30
|
+
|
|
31
|
+
3. RESTRICTIONS
|
|
32
|
+
|
|
33
|
+
The following actions are expressly PROHIBITED without prior written permission
|
|
34
|
+
from Hungry Ghost:
|
|
35
|
+
|
|
36
|
+
a) REDISTRIBUTION: You may not distribute, share, publish, or otherwise make
|
|
37
|
+
available the Software or any derivative works to any third party, whether
|
|
38
|
+
in source or binary form.
|
|
39
|
+
|
|
40
|
+
b) SELLING: You may not sell, license, sublicense, lease, or otherwise
|
|
41
|
+
commercialize the Software itself or any derivative works.
|
|
42
|
+
|
|
43
|
+
c) COMPETING PRODUCTS: You may not redistribute the Software, in whole or in
|
|
44
|
+
part, as part of a competing product or service.
|
|
45
|
+
|
|
46
|
+
Note: You ARE permitted to use the Software internally to build and sell your
|
|
47
|
+
own products and services. The restriction is on redistributing or selling the
|
|
48
|
+
Software itself, not on using it as a tool in your business.
|
|
49
|
+
|
|
50
|
+
4. CONTRIBUTIONS
|
|
51
|
+
|
|
52
|
+
a) All Contributions must be submitted through official channels (pull requests
|
|
53
|
+
to the official repository).
|
|
54
|
+
|
|
55
|
+
b) By submitting a Contribution, you represent that you have the right to grant
|
|
56
|
+
the license in Section 2(c) and that your Contribution does not violate any
|
|
57
|
+
third-party rights.
|
|
58
|
+
|
|
59
|
+
c) Hungry Ghost reserves the right to accept or reject any Contribution at its
|
|
60
|
+
sole discretion.
|
|
61
|
+
|
|
62
|
+
d) Accepted Contributions become part of the Software and are subject to this
|
|
63
|
+
License.
|
|
64
|
+
|
|
65
|
+
5. INTELLECTUAL PROPERTY
|
|
66
|
+
|
|
67
|
+
a) Hungry Ghost retains all right, title, and interest in and to the Software,
|
|
68
|
+
including all intellectual property rights.
|
|
69
|
+
|
|
70
|
+
b) This License does not grant you any rights to use Hungry Ghost's trademarks,
|
|
71
|
+
service marks, or trade names.
|
|
72
|
+
|
|
73
|
+
6. NO WARRANTY
|
|
74
|
+
|
|
75
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
76
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
77
|
+
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
78
|
+
HUNGRY GHOST BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING
|
|
79
|
+
FROM THE USE OF THE SOFTWARE.
|
|
80
|
+
|
|
81
|
+
7. TERMINATION
|
|
82
|
+
|
|
83
|
+
a) This License is effective until terminated.
|
|
84
|
+
|
|
85
|
+
b) Your rights under this License will terminate automatically without notice
|
|
86
|
+
if you fail to comply with any term of this License.
|
|
87
|
+
|
|
88
|
+
c) Upon termination, you must destroy all copies of the Software in your
|
|
89
|
+
possession.
|
|
90
|
+
|
|
91
|
+
8. GENERAL
|
|
92
|
+
|
|
93
|
+
a) This License constitutes the entire agreement between you and Hungry Ghost
|
|
94
|
+
concerning the Software.
|
|
95
|
+
|
|
96
|
+
b) This License shall be governed by the laws of the jurisdiction in which
|
|
97
|
+
Hungry Ghost is incorporated.
|
|
98
|
+
|
|
99
|
+
c) If any provision of this License is held to be unenforceable, such provision
|
|
100
|
+
shall be reformed only to the extent necessary to make it enforceable.
|
|
101
|
+
|
|
102
|
+
For permissions beyond the scope of this License, contact: legal@hungryghost.io
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
SUMMARY (not legally binding):
|
|
107
|
+
- You CAN use the software for any purpose, including commercial projects
|
|
108
|
+
- You CAN modify the software for your own use
|
|
109
|
+
- You CAN contribute improvements via pull requests
|
|
110
|
+
- You CANNOT redistribute the software to others
|
|
111
|
+
- You CANNOT sell or sublicense the software itself
|
package/README.md
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
# Hive - AI Agent Orchestrator
|
|
2
|
+
|
|
3
|
+
Hive is a CLI tool that orchestrates AI agents modeled after agile software development teams. You act as the **Product Owner**, providing requirements. Hive's AI agents handle the rest—from planning through to PR submission.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Via npm (Recommended)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g hungry-ghost-hive
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### For Contributors (Development Setup)
|
|
14
|
+
|
|
15
|
+
If you want to contribute or run from source:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Clone the repository
|
|
19
|
+
git clone https://github.com/nikrich/hungry-ghost-hive.git
|
|
20
|
+
cd hungry-ghost-hive
|
|
21
|
+
|
|
22
|
+
# Install dependencies
|
|
23
|
+
npm ci
|
|
24
|
+
|
|
25
|
+
# Build the project
|
|
26
|
+
npm run build
|
|
27
|
+
|
|
28
|
+
# Create a symlink
|
|
29
|
+
npm link
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Quick Start
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Initialize a workspace
|
|
36
|
+
hive init
|
|
37
|
+
|
|
38
|
+
# Add a repository with a team
|
|
39
|
+
hive add-repo --url git@github.com:org/my-service.git --team my-team
|
|
40
|
+
|
|
41
|
+
# Submit a requirement (this kicks off the entire workflow)
|
|
42
|
+
hive req "Add user authentication with OAuth2 support"
|
|
43
|
+
|
|
44
|
+
# Watch the magic happen
|
|
45
|
+
hive dashboard
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Basic Usage Examples
|
|
49
|
+
|
|
50
|
+
After installation, you can:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Check overall status
|
|
54
|
+
hive status
|
|
55
|
+
|
|
56
|
+
# View all stories
|
|
57
|
+
hive stories list
|
|
58
|
+
|
|
59
|
+
# Check your team's active agents
|
|
60
|
+
hive agents list --active
|
|
61
|
+
|
|
62
|
+
# Monitor progress in real-time
|
|
63
|
+
hive dashboard
|
|
64
|
+
|
|
65
|
+
# Check for escalations (agents asking for help)
|
|
66
|
+
hive escalations list
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## How It Works
|
|
70
|
+
|
|
71
|
+
### Your Role: Product Owner
|
|
72
|
+
|
|
73
|
+
You provide high-level requirements. The AI team handles everything else:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
77
|
+
│ YOU (Product Owner) │
|
|
78
|
+
│ "Add feature X to the system" │
|
|
79
|
+
└─────────────────────┬───────────────────────────────────────┘
|
|
80
|
+
│
|
|
81
|
+
▼
|
|
82
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
83
|
+
│ TECH LEAD (Claude Opus) │
|
|
84
|
+
│ • Analyzes your requirement │
|
|
85
|
+
│ • Breaks it into stories │
|
|
86
|
+
│ • Coordinates teams │
|
|
87
|
+
└─────────────────────┬───────────────────────────────────────┘
|
|
88
|
+
│
|
|
89
|
+
┌───────────┴───────────┐
|
|
90
|
+
▼ ▼
|
|
91
|
+
┌─────────────────┐ ┌─────────────────┐
|
|
92
|
+
│ TEAM: Alpha │ │ TEAM: Beta │
|
|
93
|
+
│ │ │ │
|
|
94
|
+
│ Senior (Sonnet) │ │ Senior (Sonnet) │
|
|
95
|
+
│ │ │ │ │ │
|
|
96
|
+
│ ┌───┴───┐ │ │ ┌───┴───┐ │
|
|
97
|
+
│ Int Jr │ │ Int Jr │
|
|
98
|
+
│ │ │ │
|
|
99
|
+
│ QA (Sonnet) │ │ QA (Sonnet) │
|
|
100
|
+
└─────────────────┘ └─────────────────┘
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### The Workflow
|
|
104
|
+
|
|
105
|
+
1. **You submit a requirement** → `hive req "Your feature request"`
|
|
106
|
+
2. **Tech Lead analyzes** → Identifies affected repos, creates stories
|
|
107
|
+
3. **Seniors estimate** → Assign complexity scores, plan the work
|
|
108
|
+
4. **Work is assigned** → Based on complexity:
|
|
109
|
+
- Simple (1-3 points) → Junior
|
|
110
|
+
- Medium (4-5 points) → Intermediate
|
|
111
|
+
- Complex (6-13 points) → Senior
|
|
112
|
+
5. **Developers implement** → Create branches, write code, run tests
|
|
113
|
+
6. **PRs submitted** → `hive pr submit` adds to merge queue
|
|
114
|
+
7. **QA reviews** → Automated spawning, code review, approval
|
|
115
|
+
8. **Merged!** → Story complete
|
|
116
|
+
|
|
117
|
+
### The Manager (Micromanager Daemon)
|
|
118
|
+
|
|
119
|
+
The Manager ensures agents stay productive:
|
|
120
|
+
|
|
121
|
+
- **Auto-starts** when work begins
|
|
122
|
+
- **Checks every 60 seconds** for stuck agents
|
|
123
|
+
- **Health checks** sync agent status with tmux sessions
|
|
124
|
+
- **Nudges idle agents** to check for work
|
|
125
|
+
- **Forwards messages** between agents
|
|
126
|
+
- **Spawns QA** when PRs need review
|
|
127
|
+
|
|
128
|
+
## Commands Reference
|
|
129
|
+
|
|
130
|
+
### For You (Product Owner)
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Submit a new requirement
|
|
134
|
+
hive req "Implement user authentication"
|
|
135
|
+
hive req --file requirements.md
|
|
136
|
+
|
|
137
|
+
# Check overall status
|
|
138
|
+
hive status
|
|
139
|
+
|
|
140
|
+
# Open the dashboard
|
|
141
|
+
hive dashboard
|
|
142
|
+
|
|
143
|
+
# Dashboard controls:
|
|
144
|
+
# ↑↓ Navigate agents list
|
|
145
|
+
# Enter Attach to selected agent's tmux session
|
|
146
|
+
# Ctrl+B,D Detach from tmux (returns to shell)
|
|
147
|
+
# Tab Switch between panels
|
|
148
|
+
# Esc/Q Exit dashboard
|
|
149
|
+
|
|
150
|
+
# View escalations (agents asking for help)
|
|
151
|
+
hive escalations list
|
|
152
|
+
hive escalations resolve <id> --message "Here's what to do..."
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Workflow Management
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Assign stories to agents (triggers work)
|
|
159
|
+
hive assign
|
|
160
|
+
|
|
161
|
+
# View stories
|
|
162
|
+
hive stories list
|
|
163
|
+
hive stories show <story-id>
|
|
164
|
+
|
|
165
|
+
# View agents
|
|
166
|
+
hive agents list
|
|
167
|
+
hive agents list --active
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Merge Queue & QA
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# View the merge queue
|
|
174
|
+
hive pr queue
|
|
175
|
+
|
|
176
|
+
# Manually trigger QA review
|
|
177
|
+
hive pr review --from <qa-session>
|
|
178
|
+
|
|
179
|
+
# Approve/reject PRs
|
|
180
|
+
hive pr approve <pr-id>
|
|
181
|
+
hive pr reject <pr-id> --reason "Tests failing"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Manager (Micromanager)
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Check manager status
|
|
188
|
+
hive manager status
|
|
189
|
+
|
|
190
|
+
# Manually start/stop
|
|
191
|
+
hive manager start
|
|
192
|
+
hive manager start -i 30 # Check every 30 seconds
|
|
193
|
+
hive manager stop
|
|
194
|
+
|
|
195
|
+
# Run single check
|
|
196
|
+
hive manager check
|
|
197
|
+
|
|
198
|
+
# Sync agent status with tmux
|
|
199
|
+
hive manager health
|
|
200
|
+
|
|
201
|
+
# Nudge a specific agent
|
|
202
|
+
hive manager nudge <session>
|
|
203
|
+
hive manager nudge hive-senior-alpha -m "Check the failing tests"
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Communication
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
# Send message to an agent
|
|
210
|
+
hive msg send hive-senior-alpha "Please prioritize STORY-001"
|
|
211
|
+
|
|
212
|
+
# Check messages
|
|
213
|
+
hive msg inbox
|
|
214
|
+
hive msg outbox
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Architecture
|
|
218
|
+
|
|
219
|
+
### Directory Structure
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
my-workspace/
|
|
223
|
+
├── .hive/
|
|
224
|
+
│ ├── hive.db # SQLite database (all state)
|
|
225
|
+
│ ├── hive.config.yaml # Configuration
|
|
226
|
+
│ ├── agents/ # Agent session states
|
|
227
|
+
│ └── logs/ # Conversation logs
|
|
228
|
+
├── repos/
|
|
229
|
+
│ ├── service-a/ # Git submodule
|
|
230
|
+
│ └── service-b/ # Git submodule
|
|
231
|
+
└── README.md
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Agent Sessions
|
|
235
|
+
|
|
236
|
+
Each agent runs in a tmux session:
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
hive-tech-lead # Tech Lead (Opus)
|
|
240
|
+
hive-senior-alpha # Senior for team "alpha"
|
|
241
|
+
hive-intermediate-alpha-1
|
|
242
|
+
hive-junior-alpha-1
|
|
243
|
+
hive-qa-alpha # QA for team "alpha"
|
|
244
|
+
hive-manager # The micromanager daemon
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Story States
|
|
248
|
+
|
|
249
|
+
```
|
|
250
|
+
draft → estimated → planned → in_progress → review → qa → pr_submitted → merged
|
|
251
|
+
↓
|
|
252
|
+
qa_failed (returns to developer)
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Configuration
|
|
256
|
+
|
|
257
|
+
Edit `.hive/hive.config.yaml`:
|
|
258
|
+
|
|
259
|
+
```yaml
|
|
260
|
+
# Model assignments
|
|
261
|
+
models:
|
|
262
|
+
tech_lead:
|
|
263
|
+
provider: anthropic
|
|
264
|
+
model: claude-opus-4-20250514
|
|
265
|
+
senior:
|
|
266
|
+
provider: anthropic
|
|
267
|
+
model: claude-sonnet-4-20250514
|
|
268
|
+
intermediate:
|
|
269
|
+
provider: anthropic
|
|
270
|
+
model: claude-haiku-3-5-20241022
|
|
271
|
+
junior:
|
|
272
|
+
provider: openai
|
|
273
|
+
model: gpt-4o-mini
|
|
274
|
+
qa:
|
|
275
|
+
provider: anthropic
|
|
276
|
+
model: claude-sonnet-4-20250514
|
|
277
|
+
|
|
278
|
+
# Complexity thresholds for delegation
|
|
279
|
+
scaling:
|
|
280
|
+
junior_max_complexity: 3 # 1-3 → Junior
|
|
281
|
+
intermediate_max_complexity: 5 # 4-5 → Intermediate
|
|
282
|
+
senior_capacity: 20 # Story points before scaling up
|
|
283
|
+
|
|
284
|
+
# QA checks
|
|
285
|
+
qa:
|
|
286
|
+
quality_checks:
|
|
287
|
+
- npm run lint
|
|
288
|
+
- npm run type-check
|
|
289
|
+
build_command: npm run build
|
|
290
|
+
test_command: npm test
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## Escalation Protocol
|
|
294
|
+
|
|
295
|
+
When agents get stuck, they escalate:
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
Junior → Senior → Tech Lead → YOU
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Check escalations:
|
|
302
|
+
```bash
|
|
303
|
+
hive escalations list
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
Resolve with guidance:
|
|
307
|
+
```bash
|
|
308
|
+
hive escalations resolve ESC-001 --message "Use OAuth2 with PKCE flow"
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## Tips for Product Owners
|
|
312
|
+
|
|
313
|
+
1. **Be specific in requirements** - The more detail, the better the stories
|
|
314
|
+
2. **Check the dashboard** - `hive dashboard` shows real-time progress
|
|
315
|
+
3. **Monitor escalations** - Agents will ask when they need guidance
|
|
316
|
+
4. **Trust the process** - Let agents work, they'll handle the details
|
|
317
|
+
|
|
318
|
+
## Troubleshooting
|
|
319
|
+
|
|
320
|
+
### Agents seem stuck
|
|
321
|
+
```bash
|
|
322
|
+
hive manager check # Nudge all agents
|
|
323
|
+
hive manager health # Sync status with tmux
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### Agent session died
|
|
327
|
+
```bash
|
|
328
|
+
hive manager health # Cleans up dead agents, respawns as needed
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### View agent logs
|
|
332
|
+
```bash
|
|
333
|
+
tmux attach -t hive-senior-alpha # Attach to see what agent is doing
|
|
334
|
+
# Detach with Ctrl+B, D
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Reset everything
|
|
338
|
+
```bash
|
|
339
|
+
hive nuke --all # WARNING: Deletes all data
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## Environment Variables
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
ANTHROPIC_API_KEY=sk-ant-... # Required for Claude agents
|
|
346
|
+
OPENAI_API_KEY=sk-... # Required for GPT agents (juniors)
|
|
347
|
+
GITHUB_TOKEN=ghp_... # Required for PR creation
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
## License
|
|
351
|
+
|
|
352
|
+
MIT
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Database } from 'sql.js';
|
|
2
|
+
import type { LLMProvider, Message } from '../llm/provider.js';
|
|
3
|
+
import { type EventType } from '../db/queries/logs.js';
|
|
4
|
+
import { type AgentRow, type AgentType, type AgentStatus } from '../db/queries/agents.js';
|
|
5
|
+
export interface MemoryState {
|
|
6
|
+
conversationSummary: string;
|
|
7
|
+
currentTask?: {
|
|
8
|
+
storyId?: string;
|
|
9
|
+
phase: string;
|
|
10
|
+
filesModified: string[];
|
|
11
|
+
lastAction: string;
|
|
12
|
+
};
|
|
13
|
+
context: {
|
|
14
|
+
codebaseNotes?: string;
|
|
15
|
+
blockers: string[];
|
|
16
|
+
decisionsMade: string[];
|
|
17
|
+
};
|
|
18
|
+
checkpointTokens: number;
|
|
19
|
+
}
|
|
20
|
+
export interface AgentContext {
|
|
21
|
+
db: Database;
|
|
22
|
+
provider: LLMProvider;
|
|
23
|
+
agentRow: AgentRow;
|
|
24
|
+
workDir: string;
|
|
25
|
+
config: {
|
|
26
|
+
maxRetries: number;
|
|
27
|
+
checkpointThreshold: number;
|
|
28
|
+
pollInterval: number;
|
|
29
|
+
llmTimeoutMs: number;
|
|
30
|
+
llmMaxRetries: number;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export declare abstract class BaseAgent {
|
|
34
|
+
protected db: Database;
|
|
35
|
+
protected provider: LLMProvider;
|
|
36
|
+
protected agentId: string;
|
|
37
|
+
protected agentType: AgentType;
|
|
38
|
+
protected teamId: string | null;
|
|
39
|
+
protected workDir: string;
|
|
40
|
+
protected config: AgentContext['config'];
|
|
41
|
+
protected messages: Message[];
|
|
42
|
+
protected memoryState: MemoryState;
|
|
43
|
+
protected totalTokens: number;
|
|
44
|
+
private heartbeatInterval;
|
|
45
|
+
constructor(context: AgentContext);
|
|
46
|
+
abstract getSystemPrompt(): string;
|
|
47
|
+
private startHeartbeat;
|
|
48
|
+
private sendHeartbeat;
|
|
49
|
+
private stopHeartbeat;
|
|
50
|
+
protected log(eventType: EventType, message?: string, metadata?: Record<string, unknown>): void;
|
|
51
|
+
protected updateStatus(status: AgentStatus): void;
|
|
52
|
+
protected saveMemoryState(): void;
|
|
53
|
+
protected chat(userMessage: string): Promise<string>;
|
|
54
|
+
protected checkpoint(): Promise<void>;
|
|
55
|
+
protected addDecision(decision: string): void;
|
|
56
|
+
protected addBlocker(blocker: string): void;
|
|
57
|
+
protected removeBlocker(blocker: string): void;
|
|
58
|
+
protected setCurrentTask(storyId: string, phase: string): void;
|
|
59
|
+
protected updateTaskProgress(lastAction: string, filesModified?: string[]): void;
|
|
60
|
+
run(): Promise<void>;
|
|
61
|
+
abstract execute(): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=base-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-agent.d.ts","sourceRoot":"","sources":["../../src/agents/base-agent.ts"],"names":[],"mappings":"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"}
|