hungry-ghost-hive 0.48.0 → 0.49.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/dist/agents/base-agent.d.ts +11 -11
- package/dist/agents/base-agent.d.ts.map +1 -1
- package/dist/agents/base-agent.js +25 -25
- package/dist/agents/base-agent.js.map +1 -1
- package/dist/agents/base-agent.test.js +2 -1
- package/dist/agents/base-agent.test.js.map +1 -1
- package/dist/agents/intermediate.d.ts +2 -0
- package/dist/agents/intermediate.d.ts.map +1 -1
- package/dist/agents/intermediate.js +25 -18
- package/dist/agents/intermediate.js.map +1 -1
- package/dist/agents/junior.d.ts +2 -0
- package/dist/agents/junior.d.ts.map +1 -1
- package/dist/agents/junior.js +25 -18
- package/dist/agents/junior.js.map +1 -1
- package/dist/agents/qa.d.ts +2 -0
- package/dist/agents/qa.d.ts.map +1 -1
- package/dist/agents/qa.js +47 -38
- package/dist/agents/qa.js.map +1 -1
- package/dist/agents/senior.d.ts +2 -0
- package/dist/agents/senior.d.ts.map +1 -1
- package/dist/agents/senior.js +40 -27
- package/dist/agents/senior.js.map +1 -1
- package/dist/agents/tech-lead.d.ts +2 -0
- package/dist/agents/tech-lead.d.ts.map +1 -1
- package/dist/agents/tech-lead.js +37 -31
- package/dist/agents/tech-lead.js.map +1 -1
- package/dist/cli/commands/add-repo.js +2 -2
- package/dist/cli/commands/add-repo.js.map +1 -1
- package/dist/cli/commands/add-repo.test.js +1 -1
- package/dist/cli/commands/add-repo.test.js.map +1 -1
- package/dist/cli/commands/agents.d.ts.map +1 -1
- package/dist/cli/commands/agents.js +12 -10
- package/dist/cli/commands/agents.js.map +1 -1
- package/dist/cli/commands/agents.test.js +7 -7
- package/dist/cli/commands/agents.test.js.map +1 -1
- package/dist/cli/commands/approach.js +2 -2
- package/dist/cli/commands/approach.js.map +1 -1
- package/dist/cli/commands/approvals.js +7 -7
- package/dist/cli/commands/approvals.js.map +1 -1
- package/dist/cli/commands/approvals.test.js +8 -8
- package/dist/cli/commands/approvals.test.js.map +1 -1
- package/dist/cli/commands/assign.js +4 -4
- package/dist/cli/commands/assign.js.map +1 -1
- package/dist/cli/commands/assign.test.js +18 -16
- package/dist/cli/commands/assign.test.js.map +1 -1
- package/dist/cli/commands/cleanup.d.ts.map +1 -1
- package/dist/cli/commands/cleanup.js +8 -8
- package/dist/cli/commands/cleanup.js.map +1 -1
- package/dist/cli/commands/cleanup.test.js +5 -1
- package/dist/cli/commands/cleanup.test.js.map +1 -1
- package/dist/cli/commands/escalations.js +9 -7
- package/dist/cli/commands/escalations.js.map +1 -1
- package/dist/cli/commands/escalations.test.js +2 -2
- package/dist/cli/commands/escalations.test.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +48 -5
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/init.test.js +4 -0
- package/dist/cli/commands/init.test.js.map +1 -1
- package/dist/cli/commands/manager/agent-monitoring.d.ts +2 -2
- package/dist/cli/commands/manager/agent-monitoring.d.ts.map +1 -1
- package/dist/cli/commands/manager/agent-monitoring.js +1 -1
- package/dist/cli/commands/manager/agent-monitoring.js.map +1 -1
- package/dist/cli/commands/manager/auditor-lifecycle.js +3 -3
- package/dist/cli/commands/manager/auditor-lifecycle.js.map +1 -1
- package/dist/cli/commands/manager/auditor-lifecycle.test.js +21 -14
- package/dist/cli/commands/manager/auditor-lifecycle.test.js.map +1 -1
- package/dist/cli/commands/manager/auto-reject-comment-only-reviews.test.js +28 -23
- package/dist/cli/commands/manager/auto-reject-comment-only-reviews.test.js.map +1 -1
- package/dist/cli/commands/manager/escalation-handler.d.ts +2 -2
- package/dist/cli/commands/manager/escalation-handler.d.ts.map +1 -1
- package/dist/cli/commands/manager/escalation-handler.js +11 -10
- package/dist/cli/commands/manager/escalation-handler.js.map +1 -1
- package/dist/cli/commands/manager/escalation-handler.test.js +8 -8
- package/dist/cli/commands/manager/escalation-handler.test.js.map +1 -1
- package/dist/cli/commands/manager/feature-sign-off.js +7 -7
- package/dist/cli/commands/manager/feature-sign-off.js.map +1 -1
- package/dist/cli/commands/manager/feature-sign-off.test.js +40 -31
- package/dist/cli/commands/manager/feature-sign-off.test.js.map +1 -1
- package/dist/cli/commands/manager/feature-test-result.d.ts.map +1 -1
- package/dist/cli/commands/manager/feature-test-result.js +12 -13
- package/dist/cli/commands/manager/feature-test-result.js.map +1 -1
- package/dist/cli/commands/manager/handoff-recovery.d.ts.map +1 -1
- package/dist/cli/commands/manager/handoff-recovery.js +14 -15
- package/dist/cli/commands/manager/handoff-recovery.js.map +1 -1
- package/dist/cli/commands/manager/index.d.ts.map +1 -1
- package/dist/cli/commands/manager/index.js +26 -26
- package/dist/cli/commands/manager/index.js.map +1 -1
- package/dist/cli/commands/manager/index.test.js +3 -3
- package/dist/cli/commands/manager/index.test.js.map +1 -1
- package/dist/cli/commands/manager/merged-story-cleanup.d.ts +2 -2
- package/dist/cli/commands/manager/merged-story-cleanup.d.ts.map +1 -1
- package/dist/cli/commands/manager/merged-story-cleanup.js +6 -7
- package/dist/cli/commands/manager/merged-story-cleanup.js.map +1 -1
- package/dist/cli/commands/manager/merged-story-cleanup.test.js +27 -18
- package/dist/cli/commands/manager/merged-story-cleanup.test.js.map +1 -1
- package/dist/cli/commands/manager/pr-sync-orchestrator.d.ts.map +1 -1
- package/dist/cli/commands/manager/pr-sync-orchestrator.js +46 -38
- package/dist/cli/commands/manager/pr-sync-orchestrator.js.map +1 -1
- package/dist/cli/commands/manager/qa-review-handler.d.ts.map +1 -1
- package/dist/cli/commands/manager/qa-review-handler.js +25 -22
- package/dist/cli/commands/manager/qa-review-handler.js.map +1 -1
- package/dist/cli/commands/manager/spin-down.d.ts.map +1 -1
- package/dist/cli/commands/manager/spin-down.js +23 -19
- package/dist/cli/commands/manager/spin-down.js.map +1 -1
- package/dist/cli/commands/manager/stale-escalations.d.ts +2 -3
- package/dist/cli/commands/manager/stale-escalations.d.ts.map +1 -1
- package/dist/cli/commands/manager/stale-escalations.js.map +1 -1
- package/dist/cli/commands/manager/stuck-story-helpers.js +8 -8
- package/dist/cli/commands/manager/stuck-story-helpers.js.map +1 -1
- package/dist/cli/commands/manager/stuck-story-processor.d.ts +2 -2
- package/dist/cli/commands/manager/stuck-story-processor.d.ts.map +1 -1
- package/dist/cli/commands/manager/stuck-story-processor.js +23 -22
- package/dist/cli/commands/manager/stuck-story-processor.js.map +1 -1
- package/dist/cli/commands/manager/tech-lead-lifecycle.js +6 -6
- package/dist/cli/commands/manager/tech-lead-lifecycle.js.map +1 -1
- package/dist/cli/commands/manager/types.d.ts +2 -3
- package/dist/cli/commands/manager/types.d.ts.map +1 -1
- package/dist/cli/commands/manager/types.js.map +1 -1
- package/dist/cli/commands/msg.test.js +2 -2
- package/dist/cli/commands/msg.test.js.map +1 -1
- package/dist/cli/commands/my-stories.d.ts.map +1 -1
- package/dist/cli/commands/my-stories.js +17 -18
- package/dist/cli/commands/my-stories.js.map +1 -1
- package/dist/cli/commands/my-stories.test.js +2 -2
- package/dist/cli/commands/my-stories.test.js.map +1 -1
- package/dist/cli/commands/nuke.test.js +1 -1
- package/dist/cli/commands/nuke.test.js.map +1 -1
- package/dist/cli/commands/pr.js +32 -32
- package/dist/cli/commands/pr.js.map +1 -1
- package/dist/cli/commands/pr.test.js +10 -6
- package/dist/cli/commands/pr.test.js.map +1 -1
- package/dist/cli/commands/progress.d.ts.map +1 -1
- package/dist/cli/commands/progress.js +4 -5
- package/dist/cli/commands/progress.js.map +1 -1
- package/dist/cli/commands/progress.test.js +1 -1
- package/dist/cli/commands/progress.test.js.map +1 -1
- package/dist/cli/commands/req-headless.test.d.ts +2 -0
- package/dist/cli/commands/req-headless.test.d.ts.map +1 -0
- package/dist/cli/commands/req-headless.test.js +128 -0
- package/dist/cli/commands/req-headless.test.js.map +1 -0
- package/dist/cli/commands/req-spawn.test.js +5 -1
- package/dist/cli/commands/req-spawn.test.js.map +1 -1
- package/dist/cli/commands/req.d.ts.map +1 -1
- package/dist/cli/commands/req.js +13 -14
- package/dist/cli/commands/req.js.map +1 -1
- package/dist/cli/commands/resume.d.ts.map +1 -1
- package/dist/cli/commands/resume.js +7 -8
- package/dist/cli/commands/resume.js.map +1 -1
- package/dist/cli/commands/resume.test.js +1 -1
- package/dist/cli/commands/resume.test.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +42 -40
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/status.test.js +1 -1
- package/dist/cli/commands/status.test.js.map +1 -1
- package/dist/cli/commands/stories.js +9 -9
- package/dist/cli/commands/stories.js.map +1 -1
- package/dist/cli/commands/stories.test.js +2 -2
- package/dist/cli/commands/stories.test.js.map +1 -1
- package/dist/cli/commands/teams.js +11 -11
- package/dist/cli/commands/teams.js.map +1 -1
- package/dist/cli/commands/teams.test.js +2 -2
- package/dist/cli/commands/teams.test.js.map +1 -1
- package/dist/cli/dashboard/index.d.ts +2 -2
- package/dist/cli/dashboard/index.d.ts.map +1 -1
- package/dist/cli/dashboard/index.js +29 -20
- package/dist/cli/dashboard/index.js.map +1 -1
- package/dist/cli/dashboard/index.test.js +34 -32
- package/dist/cli/dashboard/index.test.js.map +1 -1
- package/dist/cli/dashboard/panels/activity.d.ts +3 -3
- package/dist/cli/dashboard/panels/activity.d.ts.map +1 -1
- package/dist/cli/dashboard/panels/activity.js +1 -1
- package/dist/cli/dashboard/panels/activity.js.map +1 -1
- package/dist/cli/dashboard/panels/agents.d.ts +3 -3
- package/dist/cli/dashboard/panels/agents.d.ts.map +1 -1
- package/dist/cli/dashboard/panels/agents.js +2 -2
- package/dist/cli/dashboard/panels/agents.js.map +1 -1
- package/dist/cli/dashboard/panels/escalations.d.ts +3 -3
- package/dist/cli/dashboard/panels/escalations.d.ts.map +1 -1
- package/dist/cli/dashboard/panels/escalations.js +1 -1
- package/dist/cli/dashboard/panels/escalations.js.map +1 -1
- package/dist/cli/dashboard/panels/merge-queue.d.ts +3 -3
- package/dist/cli/dashboard/panels/merge-queue.d.ts.map +1 -1
- package/dist/cli/dashboard/panels/merge-queue.js +1 -1
- package/dist/cli/dashboard/panels/merge-queue.js.map +1 -1
- package/dist/cli/dashboard/panels/pipeline.d.ts +3 -3
- package/dist/cli/dashboard/panels/pipeline.d.ts.map +1 -1
- package/dist/cli/dashboard/panels/pipeline.js +1 -1
- package/dist/cli/dashboard/panels/pipeline.js.map +1 -1
- package/dist/config/schema.d.ts +85 -82
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +1 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/connectors/project-management/operations.d.ts +7 -7
- package/dist/connectors/project-management/operations.d.ts.map +1 -1
- package/dist/connectors/project-management/operations.js +2 -3
- package/dist/connectors/project-management/operations.js.map +1 -1
- package/dist/context-files/index.test.js +1 -0
- package/dist/context-files/index.test.js.map +1 -1
- package/dist/db/client.d.ts +6 -0
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +7 -0
- package/dist/db/client.js.map +1 -1
- package/dist/db/postgres-provider.d.ts +43 -0
- package/dist/db/postgres-provider.d.ts.map +1 -0
- package/dist/db/postgres-provider.integration.test.d.ts +2 -0
- package/dist/db/postgres-provider.integration.test.d.ts.map +1 -0
- package/dist/db/postgres-provider.integration.test.js +399 -0
- package/dist/db/postgres-provider.integration.test.js.map +1 -0
- package/dist/db/postgres-provider.js +315 -0
- package/dist/db/postgres-provider.js.map +1 -0
- package/dist/db/postgres-provider.test.d.ts +2 -0
- package/dist/db/postgres-provider.test.d.ts.map +1 -0
- package/dist/db/postgres-provider.test.js +72 -0
- package/dist/db/postgres-provider.test.js.map +1 -0
- package/dist/db/provider.d.ts +59 -0
- package/dist/db/provider.d.ts.map +1 -0
- package/dist/db/provider.js +121 -0
- package/dist/db/provider.js.map +1 -0
- package/dist/db/provider.test.d.ts +2 -0
- package/dist/db/provider.test.d.ts.map +1 -0
- package/dist/db/provider.test.js +226 -0
- package/dist/db/provider.test.js.map +1 -0
- package/dist/db/queries/agents.d.ts +13 -13
- package/dist/db/queries/agents.d.ts.map +1 -1
- package/dist/db/queries/agents.js +27 -28
- package/dist/db/queries/agents.js.map +1 -1
- package/dist/db/queries/agents.test.js +113 -111
- package/dist/db/queries/agents.test.js.map +1 -1
- package/dist/db/queries/escalations.d.ts +16 -16
- package/dist/db/queries/escalations.d.ts.map +1 -1
- package/dist/db/queries/escalations.js +34 -35
- package/dist/db/queries/escalations.js.map +1 -1
- package/dist/db/queries/escalations.test.js +133 -131
- package/dist/db/queries/escalations.test.js.map +1 -1
- package/dist/db/queries/heartbeat.d.ts +5 -5
- package/dist/db/queries/heartbeat.d.ts.map +1 -1
- package/dist/db/queries/heartbeat.js +7 -23
- package/dist/db/queries/heartbeat.js.map +1 -1
- package/dist/db/queries/heartbeat.test.js +76 -76
- package/dist/db/queries/heartbeat.test.js.map +1 -1
- package/dist/db/queries/integration-sync.d.ts +7 -7
- package/dist/db/queries/integration-sync.d.ts.map +1 -1
- package/dist/db/queries/integration-sync.js +13 -14
- package/dist/db/queries/integration-sync.js.map +1 -1
- package/dist/db/queries/logs.d.ts +10 -10
- package/dist/db/queries/logs.d.ts.map +1 -1
- package/dist/db/queries/logs.js +44 -42
- package/dist/db/queries/logs.js.map +1 -1
- package/dist/db/queries/logs.test.js +149 -146
- package/dist/db/queries/logs.test.js.map +1 -1
- package/dist/db/queries/messages.d.ts +6 -6
- package/dist/db/queries/messages.d.ts.map +1 -1
- package/dist/db/queries/messages.js +12 -11
- package/dist/db/queries/messages.js.map +1 -1
- package/dist/db/queries/messages.test.js +47 -46
- package/dist/db/queries/messages.test.js.map +1 -1
- package/dist/db/queries/pull-requests.d.ts +18 -18
- package/dist/db/queries/pull-requests.d.ts.map +1 -1
- package/dist/db/queries/pull-requests.js +50 -48
- package/dist/db/queries/pull-requests.js.map +1 -1
- package/dist/db/queries/pull-requests.test.js +195 -198
- package/dist/db/queries/pull-requests.test.js.map +1 -1
- package/dist/db/queries/requirements.d.ts +8 -8
- package/dist/db/queries/requirements.d.ts.map +1 -1
- package/dist/db/queries/requirements.js +17 -18
- package/dist/db/queries/requirements.js.map +1 -1
- package/dist/db/queries/requirements.test.js +83 -81
- package/dist/db/queries/requirements.test.js.map +1 -1
- package/dist/db/queries/stories.d.ts +29 -29
- package/dist/db/queries/stories.d.ts.map +1 -1
- package/dist/db/queries/stories.js +58 -64
- package/dist/db/queries/stories.js.map +1 -1
- package/dist/db/queries/stories.test.js +172 -170
- package/dist/db/queries/stories.test.js.map +1 -1
- package/dist/db/queries/teams.d.ts +6 -6
- package/dist/db/queries/teams.d.ts.map +1 -1
- package/dist/db/queries/teams.js +11 -12
- package/dist/db/queries/teams.js.map +1 -1
- package/dist/db/queries/teams.test.js +36 -34
- package/dist/db/queries/teams.test.js.map +1 -1
- package/dist/integrations/jira/repair.test.js +26 -24
- package/dist/integrations/jira/repair.test.js.map +1 -1
- package/dist/integrations/jira/stories.d.ts +3 -3
- package/dist/integrations/jira/stories.d.ts.map +1 -1
- package/dist/integrations/jira/stories.js +12 -12
- package/dist/integrations/jira/stories.js.map +1 -1
- package/dist/integrations/jira/stories.test.js +10 -8
- package/dist/integrations/jira/stories.test.js.map +1 -1
- package/dist/integrations/jira/sync.d.ts +7 -7
- package/dist/integrations/jira/sync.d.ts.map +1 -1
- package/dist/integrations/jira/sync.js +17 -20
- package/dist/integrations/jira/sync.js.map +1 -1
- package/dist/integrations/jira/sync.test.js +63 -62
- package/dist/integrations/jira/sync.test.js.map +1 -1
- package/dist/integrations/jira/transitions.d.ts +3 -3
- package/dist/integrations/jira/transitions.d.ts.map +1 -1
- package/dist/integrations/jira/transitions.js +3 -3
- package/dist/integrations/jira/transitions.js.map +1 -1
- package/dist/orchestrator/agent-selector.d.ts +3 -3
- package/dist/orchestrator/agent-selector.d.ts.map +1 -1
- package/dist/orchestrator/agent-selector.js +5 -6
- package/dist/orchestrator/agent-selector.js.map +1 -1
- package/dist/orchestrator/dependency-resolver.d.ts +4 -4
- package/dist/orchestrator/dependency-resolver.d.ts.map +1 -1
- package/dist/orchestrator/dependency-resolver.js +6 -6
- package/dist/orchestrator/dependency-resolver.js.map +1 -1
- package/dist/orchestrator/feature-branch.d.ts +3 -3
- package/dist/orchestrator/feature-branch.d.ts.map +1 -1
- package/dist/orchestrator/feature-branch.js +9 -10
- package/dist/orchestrator/feature-branch.js.map +1 -1
- package/dist/orchestrator/feature-branch.test.js +80 -78
- package/dist/orchestrator/feature-branch.test.js.map +1 -1
- package/dist/orchestrator/orphan-recovery.d.ts +2 -2
- package/dist/orchestrator/orphan-recovery.d.ts.map +1 -1
- package/dist/orchestrator/orphan-recovery.js +10 -10
- package/dist/orchestrator/orphan-recovery.js.map +1 -1
- package/dist/orchestrator/scheduler.d.ts +4 -4
- package/dist/orchestrator/scheduler.d.ts.map +1 -1
- package/dist/orchestrator/scheduler.js +90 -76
- package/dist/orchestrator/scheduler.js.map +1 -1
- package/dist/orchestrator/scheduler.test.js +496 -374
- package/dist/orchestrator/scheduler.test.js.map +1 -1
- package/dist/utils/auto-merge.d.ts.map +1 -1
- package/dist/utils/auto-merge.js +74 -56
- package/dist/utils/auto-merge.js.map +1 -1
- package/dist/utils/auto-merge.test.js +101 -66
- package/dist/utils/auto-merge.test.js.map +1 -1
- package/dist/utils/cli-helpers.d.ts +5 -5
- package/dist/utils/cli-helpers.d.ts.map +1 -1
- package/dist/utils/cli-helpers.js +8 -9
- package/dist/utils/cli-helpers.js.map +1 -1
- package/dist/utils/cli-helpers.test.js +28 -30
- package/dist/utils/cli-helpers.test.js.map +1 -1
- package/dist/utils/paths.d.ts +6 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +12 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/paths.test.js +1 -0
- package/dist/utils/paths.test.js.map +1 -1
- package/dist/utils/pr-sync.d.ts +10 -10
- package/dist/utils/pr-sync.d.ts.map +1 -1
- package/dist/utils/pr-sync.js +20 -21
- package/dist/utils/pr-sync.js.map +1 -1
- package/dist/utils/pr-sync.test.js +52 -50
- package/dist/utils/pr-sync.test.js.map +1 -1
- package/dist/utils/with-hive-context.d.ts.map +1 -1
- package/dist/utils/with-hive-context.js +70 -1
- package/dist/utils/with-hive-context.js.map +1 -1
- package/package.json +3 -1
- package/src/agents/base-agent.test.ts +2 -1
- package/src/agents/base-agent.ts +32 -28
- package/src/agents/intermediate.ts +27 -18
- package/src/agents/junior.ts +27 -18
- package/src/agents/qa.ts +54 -40
- package/src/agents/senior.ts +42 -27
- package/src/agents/tech-lead.ts +42 -32
- package/src/cli/commands/add-repo.test.ts +1 -1
- package/src/cli/commands/add-repo.ts +2 -2
- package/src/cli/commands/agents.test.ts +7 -7
- package/src/cli/commands/agents.ts +12 -10
- package/src/cli/commands/approach.ts +2 -2
- package/src/cli/commands/approvals.test.ts +8 -8
- package/src/cli/commands/approvals.ts +9 -7
- package/src/cli/commands/assign.test.ts +19 -18
- package/src/cli/commands/assign.ts +4 -4
- package/src/cli/commands/cleanup.test.ts +5 -1
- package/src/cli/commands/cleanup.ts +11 -9
- package/src/cli/commands/escalations.test.ts +2 -2
- package/src/cli/commands/escalations.ts +9 -7
- package/src/cli/commands/init.test.ts +5 -0
- package/src/cli/commands/init.ts +53 -5
- package/src/cli/commands/manager/agent-monitoring.ts +3 -3
- package/src/cli/commands/manager/auditor-lifecycle.test.ts +21 -14
- package/src/cli/commands/manager/auditor-lifecycle.ts +3 -3
- package/src/cli/commands/manager/auto-reject-comment-only-reviews.test.ts +28 -23
- package/src/cli/commands/manager/escalation-handler.test.ts +13 -13
- package/src/cli/commands/manager/escalation-handler.ts +19 -12
- package/src/cli/commands/manager/feature-sign-off.test.ts +40 -31
- package/src/cli/commands/manager/feature-sign-off.ts +7 -7
- package/src/cli/commands/manager/feature-test-result.ts +13 -16
- package/src/cli/commands/manager/handoff-recovery.ts +20 -20
- package/src/cli/commands/manager/index.test.ts +4 -4
- package/src/cli/commands/manager/index.ts +58 -59
- package/src/cli/commands/manager/merged-story-cleanup.test.ts +28 -19
- package/src/cli/commands/manager/merged-story-cleanup.ts +11 -14
- package/src/cli/commands/manager/pr-sync-orchestrator.ts +115 -110
- package/src/cli/commands/manager/qa-review-handler.ts +50 -63
- package/src/cli/commands/manager/spin-down.ts +27 -25
- package/src/cli/commands/manager/stale-escalations.ts +2 -3
- package/src/cli/commands/manager/stuck-story-helpers.ts +10 -10
- package/src/cli/commands/manager/stuck-story-processor.ts +56 -62
- package/src/cli/commands/manager/tech-lead-lifecycle.ts +6 -6
- package/src/cli/commands/manager/types.ts +2 -3
- package/src/cli/commands/msg.test.ts +2 -2
- package/src/cli/commands/my-stories.test.ts +4 -2
- package/src/cli/commands/my-stories.ts +22 -27
- package/src/cli/commands/nuke.test.ts +1 -1
- package/src/cli/commands/pr.test.ts +10 -6
- package/src/cli/commands/pr.ts +41 -32
- package/src/cli/commands/progress.test.ts +1 -1
- package/src/cli/commands/progress.ts +11 -6
- package/src/cli/commands/req-headless.test.ts +170 -0
- package/src/cli/commands/req-spawn.test.ts +12 -2
- package/src/cli/commands/req.ts +13 -14
- package/src/cli/commands/resume.test.ts +1 -1
- package/src/cli/commands/resume.ts +7 -8
- package/src/cli/commands/status.test.ts +1 -1
- package/src/cli/commands/status.ts +52 -40
- package/src/cli/commands/stories.test.ts +4 -2
- package/src/cli/commands/stories.ts +11 -11
- package/src/cli/commands/teams.test.ts +2 -2
- package/src/cli/commands/teams.ts +11 -11
- package/src/cli/dashboard/index.test.ts +35 -34
- package/src/cli/dashboard/index.ts +34 -23
- package/src/cli/dashboard/panels/activity.ts +10 -4
- package/src/cli/dashboard/panels/agents.ts +8 -5
- package/src/cli/dashboard/panels/escalations.ts +4 -4
- package/src/cli/dashboard/panels/merge-queue.ts +4 -4
- package/src/cli/dashboard/panels/pipeline.ts +10 -4
- package/src/config/schema.ts +1 -0
- package/src/connectors/project-management/operations.ts +9 -10
- package/src/context-files/index.test.ts +1 -0
- package/src/db/client.ts +17 -0
- package/src/db/pg-migrations/001-full-schema.sql +209 -0
- package/src/db/postgres-provider.integration.test.ts +574 -0
- package/src/db/postgres-provider.test.ts +97 -0
- package/src/db/postgres-provider.ts +364 -0
- package/src/db/provider.test.ts +283 -0
- package/src/db/provider.ts +161 -0
- package/src/db/queries/agents.test.ts +114 -113
- package/src/db/queries/agents.ts +50 -36
- package/src/db/queries/escalations.test.ts +134 -133
- package/src/db/queries/escalations.ts +72 -57
- package/src/db/queries/heartbeat.test.ts +77 -78
- package/src/db/queries/heartbeat.ts +24 -46
- package/src/db/queries/integration-sync.ts +26 -26
- package/src/db/queries/logs.test.ts +151 -148
- package/src/db/queries/logs.ts +78 -53
- package/src/db/queries/messages.test.ts +48 -50
- package/src/db/queries/messages.ts +26 -18
- package/src/db/queries/pull-requests.test.ts +194 -199
- package/src/db/queries/pull-requests.ts +117 -88
- package/src/db/queries/requirements.test.ts +84 -83
- package/src/db/queries/requirements.ts +33 -28
- package/src/db/queries/stories.test.ts +173 -172
- package/src/db/queries/stories.ts +141 -110
- package/src/db/queries/teams.test.ts +37 -36
- package/src/db/queries/teams.ts +22 -14
- package/src/integrations/jira/repair.test.ts +27 -26
- package/src/integrations/jira/stories.test.ts +15 -16
- package/src/integrations/jira/stories.ts +15 -15
- package/src/integrations/jira/sync.test.ts +68 -68
- package/src/integrations/jira/sync.ts +29 -39
- package/src/integrations/jira/transitions.ts +6 -6
- package/src/orchestrator/agent-selector.ts +9 -8
- package/src/orchestrator/dependency-resolver.ts +16 -7
- package/src/orchestrator/feature-branch.test.ts +85 -80
- package/src/orchestrator/feature-branch.ts +13 -14
- package/src/orchestrator/orphan-recovery.ts +14 -13
- package/src/orchestrator/scheduler.test.ts +536 -394
- package/src/orchestrator/scheduler.ts +129 -115
- package/src/utils/auto-merge.test.ts +102 -68
- package/src/utils/auto-merge.ts +161 -168
- package/src/utils/cli-helpers.test.ts +30 -32
- package/src/utils/cli-helpers.ts +15 -11
- package/src/utils/paths.test.ts +1 -0
- package/src/utils/paths.ts +14 -1
- package/src/utils/pr-sync.test.ts +55 -52
- package/src/utils/pr-sync.ts +27 -32
- package/src/utils/with-hive-context.ts +89 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// Licensed under the Hungry Ghost Hive License. See LICENSE.
|
|
2
|
+
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
|
+
|
|
5
|
+
vi.mock('../../cli-runtimes/index.js', () => ({
|
|
6
|
+
getCliRuntimeBuilder: vi.fn(() => ({
|
|
7
|
+
buildSpawnCommand: vi.fn(() => ['claude', '--dangerously-skip-permissions']),
|
|
8
|
+
})),
|
|
9
|
+
resolveRuntimeModelForCli: vi.fn(model => model),
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
vi.mock('../../cluster/runtime.js', () => ({
|
|
13
|
+
fetchLocalClusterStatus: vi.fn(() => null),
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
vi.mock('../../config/loader.js', () => ({
|
|
17
|
+
loadConfig: vi.fn(() => ({
|
|
18
|
+
models: {
|
|
19
|
+
tech_lead: {
|
|
20
|
+
cli_tool: 'claude',
|
|
21
|
+
safety_mode: 'bypassPermissions',
|
|
22
|
+
model: 'claude-sonnet-4-6',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
integrations: {
|
|
26
|
+
project_management: { provider: 'none' },
|
|
27
|
+
},
|
|
28
|
+
agents: { chrome_enabled: false },
|
|
29
|
+
cluster: { enabled: false },
|
|
30
|
+
})),
|
|
31
|
+
}));
|
|
32
|
+
|
|
33
|
+
vi.mock('../../connectors/registry.js', () => ({
|
|
34
|
+
registry: {
|
|
35
|
+
getProjectManagement: vi.fn(() => null),
|
|
36
|
+
},
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
vi.mock('../../db/client.js', () => ({
|
|
40
|
+
withTransaction: vi.fn(async (_db: unknown, fn: () => unknown) => fn()),
|
|
41
|
+
}));
|
|
42
|
+
|
|
43
|
+
vi.mock('../../db/queries/agents.js', () => ({
|
|
44
|
+
createAgent: vi.fn(() => ({ id: 'agent-1' })),
|
|
45
|
+
getTechLead: vi.fn(() => ({ id: 'agent-1' })),
|
|
46
|
+
updateAgent: vi.fn(),
|
|
47
|
+
}));
|
|
48
|
+
|
|
49
|
+
vi.mock('../../db/queries/logs.js', () => ({
|
|
50
|
+
createLog: vi.fn(),
|
|
51
|
+
}));
|
|
52
|
+
|
|
53
|
+
vi.mock('../../db/queries/requirements.js', () => ({
|
|
54
|
+
createRequirement: vi.fn(() => ({ id: 'req-1', godmode: 0 })),
|
|
55
|
+
updateRequirement: vi.fn(),
|
|
56
|
+
}));
|
|
57
|
+
|
|
58
|
+
vi.mock('../../db/queries/teams.js', () => ({
|
|
59
|
+
getAllTeams: vi.fn(() => [{ id: 'team-1', name: 'alpha' }]),
|
|
60
|
+
}));
|
|
61
|
+
|
|
62
|
+
vi.mock('../../tmux/manager.js', () => ({
|
|
63
|
+
isTmuxAvailable: vi.fn(),
|
|
64
|
+
isTmuxSessionRunning: vi.fn(),
|
|
65
|
+
sendToTmuxSession: vi.fn(),
|
|
66
|
+
spawnTmuxSession: vi.fn(),
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
vi.mock('../../utils/instance.js', () => ({
|
|
70
|
+
getTechLeadSessionName: vi.fn(() => 'hive-tech-lead'),
|
|
71
|
+
}));
|
|
72
|
+
|
|
73
|
+
vi.mock('../../utils/with-hive-context.js', () => ({
|
|
74
|
+
withHiveContext: vi.fn(
|
|
75
|
+
(
|
|
76
|
+
cb: (ctx: {
|
|
77
|
+
root: string;
|
|
78
|
+
paths: { hiveDir: string };
|
|
79
|
+
db: { db: object; provider: object };
|
|
80
|
+
}) => unknown
|
|
81
|
+
) =>
|
|
82
|
+
cb({
|
|
83
|
+
root: '/tmp/hive',
|
|
84
|
+
paths: { hiveDir: '/tmp/hive/.hive' },
|
|
85
|
+
db: { db: {}, provider: { withTransaction: vi.fn(async (fn: () => unknown) => fn()) } },
|
|
86
|
+
})
|
|
87
|
+
),
|
|
88
|
+
}));
|
|
89
|
+
|
|
90
|
+
vi.mock('../dashboard/index.js', () => ({
|
|
91
|
+
startDashboard: vi.fn(),
|
|
92
|
+
}));
|
|
93
|
+
|
|
94
|
+
vi.mock('ora', () => ({
|
|
95
|
+
default: vi.fn(() => ({
|
|
96
|
+
start: vi.fn().mockReturnThis(),
|
|
97
|
+
succeed: vi.fn().mockReturnThis(),
|
|
98
|
+
fail: vi.fn().mockReturnThis(),
|
|
99
|
+
warn: vi.fn().mockReturnThis(),
|
|
100
|
+
text: '',
|
|
101
|
+
})),
|
|
102
|
+
}));
|
|
103
|
+
|
|
104
|
+
import * as tmuxManager from '../../tmux/manager.js';
|
|
105
|
+
import * as dashboard from '../dashboard/index.js';
|
|
106
|
+
import { reqCommand } from './req.js';
|
|
107
|
+
|
|
108
|
+
describe('req command - headless dashboard behavior', () => {
|
|
109
|
+
beforeEach(() => {
|
|
110
|
+
vi.clearAllMocks();
|
|
111
|
+
delete process.env.HIVE_HEADLESS;
|
|
112
|
+
// Reset Commander option state between tests so --headless from one test
|
|
113
|
+
// doesn't bleed into the next.
|
|
114
|
+
reqCommand.setOptionValue('headless', undefined);
|
|
115
|
+
vi.mocked(tmuxManager.isTmuxAvailable).mockResolvedValue(true);
|
|
116
|
+
vi.mocked(tmuxManager.isTmuxSessionRunning).mockResolvedValue(false);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
afterEach(() => {
|
|
120
|
+
delete process.env.HIVE_HEADLESS;
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('calls startDashboard when --headless flag is not set', async () => {
|
|
124
|
+
await reqCommand.parseAsync(['node', 'req', 'Build a feature', '--target-branch', 'main'], {
|
|
125
|
+
from: 'user',
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
expect(dashboard.startDashboard).toHaveBeenCalledOnce();
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it('does not call startDashboard when --headless flag is passed', async () => {
|
|
132
|
+
await reqCommand.parseAsync(
|
|
133
|
+
['node', 'req', 'Build a feature', '--target-branch', 'main', '--headless'],
|
|
134
|
+
{ from: 'user' }
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
expect(dashboard.startDashboard).not.toHaveBeenCalled();
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('does not call startDashboard when HIVE_HEADLESS=1 env var is set', async () => {
|
|
141
|
+
process.env.HIVE_HEADLESS = '1';
|
|
142
|
+
|
|
143
|
+
await reqCommand.parseAsync(['node', 'req', 'Build a feature', '--target-branch', 'main'], {
|
|
144
|
+
from: 'user',
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
expect(dashboard.startDashboard).not.toHaveBeenCalled();
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it('calls startDashboard when HIVE_HEADLESS env var is absent', async () => {
|
|
151
|
+
delete process.env.HIVE_HEADLESS;
|
|
152
|
+
|
|
153
|
+
await reqCommand.parseAsync(['node', 'req', 'Build a feature', '--target-branch', 'main'], {
|
|
154
|
+
from: 'user',
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
expect(dashboard.startDashboard).toHaveBeenCalledOnce();
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it('does not call startDashboard when HIVE_HEADLESS is set to non-1 value', async () => {
|
|
161
|
+
process.env.HIVE_HEADLESS = '0';
|
|
162
|
+
|
|
163
|
+
await reqCommand.parseAsync(['node', 'req', 'Build a feature', '--target-branch', 'main'], {
|
|
164
|
+
from: 'user',
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// HIVE_HEADLESS=0 is falsy for the === '1' check, so dashboard should launch
|
|
168
|
+
expect(dashboard.startDashboard).toHaveBeenCalledOnce();
|
|
169
|
+
});
|
|
170
|
+
});
|
|
@@ -75,8 +75,18 @@ vi.mock('../../utils/instance.js', () => ({
|
|
|
75
75
|
|
|
76
76
|
vi.mock('../../utils/with-hive-context.js', () => ({
|
|
77
77
|
withHiveContext: vi.fn(
|
|
78
|
-
(
|
|
79
|
-
cb
|
|
78
|
+
(
|
|
79
|
+
cb: (ctx: {
|
|
80
|
+
root: string;
|
|
81
|
+
paths: { hiveDir: string };
|
|
82
|
+
db: { db: object; provider: object };
|
|
83
|
+
}) => unknown
|
|
84
|
+
) =>
|
|
85
|
+
cb({
|
|
86
|
+
root: '/tmp/hive',
|
|
87
|
+
paths: { hiveDir: '/tmp/hive/.hive' },
|
|
88
|
+
db: { db: {}, provider: { withTransaction: vi.fn(async (fn: () => unknown) => fn()) } },
|
|
89
|
+
})
|
|
80
90
|
),
|
|
81
91
|
}));
|
|
82
92
|
|
package/src/cli/commands/req.ts
CHANGED
|
@@ -9,7 +9,6 @@ import { getCliRuntimeBuilder, resolveRuntimeModelForCli } from '../../cli-runti
|
|
|
9
9
|
import { fetchLocalClusterStatus } from '../../cluster/runtime.js';
|
|
10
10
|
import { loadConfig } from '../../config/loader.js';
|
|
11
11
|
import { registry } from '../../connectors/registry.js';
|
|
12
|
-
import { withTransaction } from '../../db/client.js';
|
|
13
12
|
import { createAgent, getTechLead, updateAgent } from '../../db/queries/agents.js';
|
|
14
13
|
import { createLog } from '../../db/queries/logs.js';
|
|
15
14
|
import { createRequirement, updateRequirement } from '../../db/queries/requirements.js';
|
|
@@ -143,7 +142,7 @@ export const reqCommand = new Command('req')
|
|
|
143
142
|
|
|
144
143
|
try {
|
|
145
144
|
// Check if there are any teams
|
|
146
|
-
const teams = getAllTeams(db.
|
|
145
|
+
const teams = await getAllTeams(db.provider);
|
|
147
146
|
if (teams.length === 0) {
|
|
148
147
|
spinner.fail(chalk.red('No teams found. Add a repository first:'));
|
|
149
148
|
console.log(chalk.gray(' hive add-repo --url <repo-url> --team <team-name>'));
|
|
@@ -152,7 +151,7 @@ export const reqCommand = new Command('req')
|
|
|
152
151
|
|
|
153
152
|
// Create requirement
|
|
154
153
|
spinner.text = 'Creating requirement...';
|
|
155
|
-
const req = createRequirement(db.
|
|
154
|
+
const req = await createRequirement(db.provider, {
|
|
156
155
|
title,
|
|
157
156
|
description,
|
|
158
157
|
godmode: options.godmode,
|
|
@@ -161,7 +160,7 @@ export const reqCommand = new Command('req')
|
|
|
161
160
|
|
|
162
161
|
// If this came from a PM provider epic URL, store the epic key/id
|
|
163
162
|
if (epicKey && epicId) {
|
|
164
|
-
updateRequirement(db.
|
|
163
|
+
await updateRequirement(db.provider, req.id, {
|
|
165
164
|
jiraEpicKey: epicKey,
|
|
166
165
|
jiraEpicId: epicId,
|
|
167
166
|
});
|
|
@@ -190,7 +189,7 @@ export const reqCommand = new Command('req')
|
|
|
190
189
|
|
|
191
190
|
// Get or create Tech Lead agent
|
|
192
191
|
spinner.text = 'Spawning Tech Lead...';
|
|
193
|
-
let techLead = getTechLead(db.
|
|
192
|
+
let techLead = await getTechLead(db.provider);
|
|
194
193
|
const techLeadCliTool = config.models.tech_lead.cli_tool;
|
|
195
194
|
const techLeadSafetyMode = config.models.tech_lead.safety_mode;
|
|
196
195
|
const techLeadModel = resolveRuntimeModelForCli(
|
|
@@ -199,21 +198,21 @@ export const reqCommand = new Command('req')
|
|
|
199
198
|
);
|
|
200
199
|
|
|
201
200
|
if (!techLead) {
|
|
202
|
-
techLead = createAgent(db.
|
|
201
|
+
techLead = await createAgent(db.provider, { type: 'tech_lead', model: techLeadModel });
|
|
203
202
|
}
|
|
204
203
|
|
|
205
204
|
// Update Tech Lead status and log event (atomic transaction)
|
|
206
|
-
await withTransaction(
|
|
207
|
-
updateAgent(db.
|
|
205
|
+
await db.provider.withTransaction(async () => {
|
|
206
|
+
await updateAgent(db.provider, techLead.id, { status: 'working' });
|
|
208
207
|
|
|
209
|
-
createLog(db.
|
|
208
|
+
await createLog(db.provider, {
|
|
210
209
|
agentId: techLead.id,
|
|
211
210
|
eventType: 'REQUIREMENT_RECEIVED',
|
|
212
211
|
message: title,
|
|
213
212
|
metadata: { requirement_id: req.id, godmode: req.godmode ? true : false },
|
|
214
213
|
});
|
|
215
214
|
|
|
216
|
-
updateRequirement(db.
|
|
215
|
+
await updateRequirement(db.provider, req.id, { status: 'planning' });
|
|
217
216
|
});
|
|
218
217
|
|
|
219
218
|
// Spawn Tech Lead tmux session
|
|
@@ -257,17 +256,17 @@ export const reqCommand = new Command('req')
|
|
|
257
256
|
}
|
|
258
257
|
|
|
259
258
|
// Update agent and log spawning/planning events (atomic transaction)
|
|
260
|
-
await withTransaction(
|
|
261
|
-
updateAgent(db.
|
|
259
|
+
await db.provider.withTransaction(async () => {
|
|
260
|
+
await updateAgent(db.provider, techLead.id, { tmuxSession: sessionName });
|
|
262
261
|
|
|
263
|
-
createLog(db.
|
|
262
|
+
await createLog(db.provider, {
|
|
264
263
|
agentId: techLead.id,
|
|
265
264
|
eventType: 'AGENT_SPAWNED',
|
|
266
265
|
message: `Tech Lead spawned for requirement ${req.id}`,
|
|
267
266
|
metadata: { tmux_session: sessionName },
|
|
268
267
|
});
|
|
269
268
|
|
|
270
|
-
createLog(db.
|
|
269
|
+
await createLog(db.provider, {
|
|
271
270
|
agentId: techLead.id,
|
|
272
271
|
eventType: 'PLANNING_STARTED',
|
|
273
272
|
message: `Planning started for requirement ${req.id}`,
|
|
@@ -49,7 +49,7 @@ vi.mock('../../tmux/manager.js', () => ({
|
|
|
49
49
|
|
|
50
50
|
vi.mock('../../utils/with-hive-context.js', () => ({
|
|
51
51
|
withHiveContext: vi.fn(callback =>
|
|
52
|
-
callback({ db: { db: {} }, root: '/tmp', paths: { hiveDir: '/tmp/.hive' } })
|
|
52
|
+
callback({ db: { db: {}, provider: {} }, root: '/tmp', paths: { hiveDir: '/tmp/.hive' } })
|
|
53
53
|
),
|
|
54
54
|
}));
|
|
55
55
|
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
selectCompatibleModelForCli,
|
|
10
10
|
} from '../../cli-runtimes/index.js';
|
|
11
11
|
import { loadConfig } from '../../config/index.js';
|
|
12
|
-
import { withTransaction } from '../../db/client.js';
|
|
13
12
|
import { getAllAgents, updateAgent, type AgentRow } from '../../db/queries/agents.js';
|
|
14
13
|
import { createLog } from '../../db/queries/logs.js';
|
|
15
14
|
import { getTeamById } from '../../db/queries/teams.js';
|
|
@@ -35,17 +34,17 @@ export const resumeCommand = new Command('resume')
|
|
|
35
34
|
let agentsToResume: AgentRow[];
|
|
36
35
|
|
|
37
36
|
if (options.agent) {
|
|
38
|
-
const agent = requireAgent(db.
|
|
37
|
+
const agent = await requireAgent(db.provider, options.agent);
|
|
39
38
|
if (agent.status === 'terminated') {
|
|
40
39
|
console.error(chalk.red('Cannot resume a terminated agent'));
|
|
41
40
|
process.exit(1);
|
|
42
41
|
}
|
|
43
42
|
agentsToResume = [agent];
|
|
44
43
|
} else if (options.all) {
|
|
45
|
-
agentsToResume = getAllAgents(db.
|
|
44
|
+
agentsToResume = (await getAllAgents(db.provider)).filter(a => a.status !== 'terminated');
|
|
46
45
|
} else {
|
|
47
46
|
// Default: resume blocked or idle agents that have memory state
|
|
48
|
-
agentsToResume = getAllAgents(db.
|
|
47
|
+
agentsToResume = (await getAllAgents(db.provider)).filter(
|
|
49
48
|
a => a.status !== 'terminated' && a.memory_state
|
|
50
49
|
);
|
|
51
50
|
}
|
|
@@ -73,7 +72,7 @@ export const resumeCommand = new Command('resume')
|
|
|
73
72
|
// Determine work directory
|
|
74
73
|
let workDir = root;
|
|
75
74
|
if (agent.team_id) {
|
|
76
|
-
const team = getTeamById(db.
|
|
75
|
+
const team = await getTeamById(db.provider, agent.team_id);
|
|
77
76
|
if (team) {
|
|
78
77
|
workDir = `${root}/${team.repo_path}`;
|
|
79
78
|
}
|
|
@@ -105,13 +104,13 @@ export const resumeCommand = new Command('resume')
|
|
|
105
104
|
});
|
|
106
105
|
|
|
107
106
|
// Update agent state and log event (atomic transaction)
|
|
108
|
-
await withTransaction(
|
|
109
|
-
updateAgent(db.
|
|
107
|
+
await db.provider.withTransaction(async () => {
|
|
108
|
+
await updateAgent(db.provider, agent.id, {
|
|
110
109
|
status: 'working',
|
|
111
110
|
tmuxSession: sessionName,
|
|
112
111
|
});
|
|
113
112
|
|
|
114
|
-
createLog(db.
|
|
113
|
+
await createLog(db.provider, {
|
|
115
114
|
agentId: agent.id,
|
|
116
115
|
storyId: agent.current_story_id,
|
|
117
116
|
eventType: 'AGENT_RESUMED',
|
|
@@ -36,7 +36,7 @@ vi.mock('../../db/queries/teams.js', () => ({
|
|
|
36
36
|
}));
|
|
37
37
|
|
|
38
38
|
vi.mock('../../utils/with-hive-context.js', () => ({
|
|
39
|
-
withReadOnlyHiveContext: vi.fn(callback => callback({ db: { db: {} } })),
|
|
39
|
+
withReadOnlyHiveContext: vi.fn(callback => callback({ db: { db: {}, provider: {} } })),
|
|
40
40
|
}));
|
|
41
41
|
|
|
42
42
|
import { statusCommand } from './status.js';
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { Command } from 'commander';
|
|
5
|
+
import type { DatabaseProvider } from '../../db/provider.js';
|
|
5
6
|
import { getActiveAgents, getAllAgents } from '../../db/queries/agents.js';
|
|
6
7
|
import { getPendingEscalations, getPendingHumanEscalations } from '../../db/queries/escalations.js';
|
|
7
8
|
import { getLogsByStory, getRecentLogs } from '../../db/queries/logs.js';
|
|
@@ -23,26 +24,26 @@ export const statusCommand = new Command('status')
|
|
|
23
24
|
.option('--story <id>', 'Show status for a specific story')
|
|
24
25
|
.option('--json', 'Output as JSON')
|
|
25
26
|
.action(async (options: { team?: string; story?: string; json?: boolean }) => {
|
|
26
|
-
await withReadOnlyHiveContext(({ db }) => {
|
|
27
|
+
await withReadOnlyHiveContext(async ({ db }) => {
|
|
27
28
|
if (options.story) {
|
|
28
|
-
showStoryStatus(db.
|
|
29
|
+
await showStoryStatus(db.provider, options.story, options.json);
|
|
29
30
|
} else if (options.team) {
|
|
30
|
-
showTeamStatus(db.
|
|
31
|
+
await showTeamStatus(db.provider, options.team, options.json);
|
|
31
32
|
} else {
|
|
32
|
-
showOverallStatus(db.
|
|
33
|
+
await showOverallStatus(db.provider, options.json);
|
|
33
34
|
}
|
|
34
35
|
});
|
|
35
36
|
});
|
|
36
37
|
|
|
37
|
-
function showOverallStatus(db:
|
|
38
|
-
const teams = getAllTeams(db);
|
|
39
|
-
const allAgents = getAllAgents(db);
|
|
40
|
-
const activeAgents = getActiveAgents(db);
|
|
41
|
-
const storyCounts = getStoryCounts(db);
|
|
42
|
-
const requirements = getPendingRequirements(db);
|
|
43
|
-
const escalations = getPendingEscalations(db);
|
|
44
|
-
const approvals = getPendingHumanEscalations(db);
|
|
45
|
-
const recentLogs = getRecentLogs(db, 5);
|
|
38
|
+
async function showOverallStatus(db: DatabaseProvider, json?: boolean): Promise<void> {
|
|
39
|
+
const teams = await getAllTeams(db);
|
|
40
|
+
const allAgents = await getAllAgents(db);
|
|
41
|
+
const activeAgents = await getActiveAgents(db);
|
|
42
|
+
const storyCounts = await getStoryCounts(db);
|
|
43
|
+
const requirements = await getPendingRequirements(db);
|
|
44
|
+
const escalations = await getPendingEscalations(db);
|
|
45
|
+
const approvals = await getPendingHumanEscalations(db);
|
|
46
|
+
const recentLogs = await getRecentLogs(db, 5);
|
|
46
47
|
|
|
47
48
|
const terminatedAgents = allAgents.filter(a => a.status === 'terminated').length;
|
|
48
49
|
|
|
@@ -153,21 +154,44 @@ function showOverallStatus(db: import('sql.js').Database, json?: boolean): void
|
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
156
|
|
|
156
|
-
function showTeamStatus(
|
|
157
|
-
|
|
157
|
+
async function showTeamStatus(
|
|
158
|
+
db: DatabaseProvider,
|
|
159
|
+
teamName: string,
|
|
160
|
+
json?: boolean
|
|
161
|
+
): Promise<void> {
|
|
162
|
+
const team = await getTeamByName(db, teamName);
|
|
158
163
|
if (!team) {
|
|
159
164
|
console.error(chalk.red(`Team not found: ${teamName}`));
|
|
160
165
|
process.exit(1);
|
|
161
166
|
}
|
|
162
167
|
|
|
163
|
-
const stories = getStoriesByTeam(db, team.id);
|
|
164
|
-
const activeAgents = getActiveAgents(db).filter(a => a.team_id === team.id);
|
|
168
|
+
const stories = await getStoriesByTeam(db, team.id);
|
|
169
|
+
const activeAgents = (await getActiveAgents(db)).filter(a => a.team_id === team.id);
|
|
165
170
|
|
|
166
171
|
const storyCounts: Record<string, number> = {};
|
|
167
172
|
for (const story of stories) {
|
|
168
173
|
storyCounts[story.status] = (storyCounts[story.status] || 0) + 1;
|
|
169
174
|
}
|
|
170
175
|
|
|
176
|
+
const agentDetails = [];
|
|
177
|
+
for (const a of activeAgents) {
|
|
178
|
+
let godmode = false;
|
|
179
|
+
if (a.current_story_id) {
|
|
180
|
+
const story = await getStoryById(db, a.current_story_id);
|
|
181
|
+
if (story && story.requirement_id) {
|
|
182
|
+
const requirement = await getRequirementById(db, story.requirement_id);
|
|
183
|
+
godmode = requirement?.godmode ? true : false;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
agentDetails.push({
|
|
187
|
+
id: a.id,
|
|
188
|
+
type: a.type,
|
|
189
|
+
status: a.status,
|
|
190
|
+
currentStory: a.current_story_id,
|
|
191
|
+
godmode,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
171
195
|
const status = {
|
|
172
196
|
team: {
|
|
173
197
|
id: team.id,
|
|
@@ -175,23 +199,7 @@ function showTeamStatus(db: import('sql.js').Database, teamName: string, json?:
|
|
|
175
199
|
repo_url: team.repo_url,
|
|
176
200
|
repo_path: team.repo_path,
|
|
177
201
|
},
|
|
178
|
-
agents:
|
|
179
|
-
let godmode = false;
|
|
180
|
-
if (a.current_story_id) {
|
|
181
|
-
const story = getStoryById(db, a.current_story_id);
|
|
182
|
-
if (story && story.requirement_id) {
|
|
183
|
-
const requirement = getRequirementById(db, story.requirement_id);
|
|
184
|
-
godmode = requirement?.godmode ? true : false;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
return {
|
|
188
|
-
id: a.id,
|
|
189
|
-
type: a.type,
|
|
190
|
-
status: a.status,
|
|
191
|
-
currentStory: a.current_story_id,
|
|
192
|
-
godmode,
|
|
193
|
-
};
|
|
194
|
-
}),
|
|
202
|
+
agents: agentDetails,
|
|
195
203
|
stories: {
|
|
196
204
|
total: stories.length,
|
|
197
205
|
counts: storyCounts,
|
|
@@ -215,9 +223,9 @@ function showTeamStatus(db: import('sql.js').Database, teamName: string, json?:
|
|
|
215
223
|
for (const agent of activeAgents) {
|
|
216
224
|
let opusIndicator = '';
|
|
217
225
|
if (agent.current_story_id) {
|
|
218
|
-
const story = getStoryById(db, agent.current_story_id);
|
|
226
|
+
const story = await getStoryById(db, agent.current_story_id);
|
|
219
227
|
if (story && story.requirement_id) {
|
|
220
|
-
const requirement = getRequirementById(db, story.requirement_id);
|
|
228
|
+
const requirement = await getRequirementById(db, story.requirement_id);
|
|
221
229
|
if (requirement?.godmode) {
|
|
222
230
|
opusIndicator = chalk.yellow(' [Opus]');
|
|
223
231
|
}
|
|
@@ -237,11 +245,15 @@ function showTeamStatus(db: import('sql.js').Database, teamName: string, json?:
|
|
|
237
245
|
}
|
|
238
246
|
}
|
|
239
247
|
|
|
240
|
-
function showStoryStatus(
|
|
241
|
-
|
|
248
|
+
async function showStoryStatus(
|
|
249
|
+
db: DatabaseProvider,
|
|
250
|
+
storyId: string,
|
|
251
|
+
json?: boolean
|
|
252
|
+
): Promise<void> {
|
|
253
|
+
const story = await requireStory(db, storyId);
|
|
242
254
|
|
|
243
|
-
const dependencies = getStoryDependencies(db, story.id);
|
|
244
|
-
const logs = getLogsByStory(db, story.id).slice(0, 10);
|
|
255
|
+
const dependencies = await getStoryDependencies(db, story.id);
|
|
256
|
+
const logs = (await getLogsByStory(db, story.id)).slice(0, 10);
|
|
245
257
|
|
|
246
258
|
const status = {
|
|
247
259
|
story: {
|
|
@@ -34,8 +34,10 @@ vi.mock('../../integrations/jira/stories.js', () => ({
|
|
|
34
34
|
}));
|
|
35
35
|
|
|
36
36
|
vi.mock('../../utils/with-hive-context.js', () => ({
|
|
37
|
-
withHiveContext: vi.fn(callback =>
|
|
38
|
-
|
|
37
|
+
withHiveContext: vi.fn(callback =>
|
|
38
|
+
callback({ db: { db: {}, provider: {} }, paths: { hiveDir: '/tmp' } })
|
|
39
|
+
),
|
|
40
|
+
withReadOnlyHiveContext: vi.fn(callback => callback({ db: { db: {}, provider: {} } })),
|
|
39
41
|
}));
|
|
40
42
|
|
|
41
43
|
import { storiesCommand } from './stories.js';
|
|
@@ -27,9 +27,9 @@ storiesCommand
|
|
|
27
27
|
await withReadOnlyHiveContext(async ({ db }) => {
|
|
28
28
|
let stories;
|
|
29
29
|
if (options.status) {
|
|
30
|
-
stories = getStoriesByStatus(db.
|
|
30
|
+
stories = await getStoriesByStatus(db.provider, options.status as StoryStatus);
|
|
31
31
|
} else {
|
|
32
|
-
stories = getAllStories(db.
|
|
32
|
+
stories = await getAllStories(db.provider);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
if (options.json) {
|
|
@@ -89,8 +89,8 @@ storiesCommand
|
|
|
89
89
|
}) => {
|
|
90
90
|
await withHiveContext(async ({ root, paths, db }) => {
|
|
91
91
|
// Create local story
|
|
92
|
-
const story = createStory(
|
|
93
|
-
db.
|
|
92
|
+
const story = await createStory(
|
|
93
|
+
db.provider,
|
|
94
94
|
{
|
|
95
95
|
requirementId: options.requirement || null,
|
|
96
96
|
teamId: options.team || null,
|
|
@@ -103,8 +103,8 @@ storiesCommand
|
|
|
103
103
|
|
|
104
104
|
// Update with optional fields
|
|
105
105
|
if (options.points !== undefined || options.complexity !== undefined) {
|
|
106
|
-
updateStory(
|
|
107
|
-
db.
|
|
106
|
+
await updateStory(
|
|
107
|
+
db.provider,
|
|
108
108
|
story.id,
|
|
109
109
|
{
|
|
110
110
|
storyPoints: options.points ?? null,
|
|
@@ -118,8 +118,8 @@ storiesCommand
|
|
|
118
118
|
// Sync to PM provider if configured
|
|
119
119
|
let externalKey: string | null = null;
|
|
120
120
|
try {
|
|
121
|
-
const updatedStory = getStoryById(db.
|
|
122
|
-
const result = await syncStoryToProvider(root, db.
|
|
121
|
+
const updatedStory = (await getStoryById(db.provider, story.id))!;
|
|
122
|
+
const result = await syncStoryToProvider(root, db.provider, updatedStory);
|
|
123
123
|
|
|
124
124
|
if (result) {
|
|
125
125
|
externalKey = result.key;
|
|
@@ -134,7 +134,7 @@ storiesCommand
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
if (options.json) {
|
|
137
|
-
const finalStory = getStoryById(db.
|
|
137
|
+
const finalStory = await getStoryById(db.provider, story.id);
|
|
138
138
|
console.log(JSON.stringify(finalStory, null, 2));
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
@@ -154,9 +154,9 @@ storiesCommand
|
|
|
154
154
|
.description('Show story details')
|
|
155
155
|
.action(async (storyId: string) => {
|
|
156
156
|
await withReadOnlyHiveContext(async ({ db }) => {
|
|
157
|
-
const story = requireStory(db.
|
|
157
|
+
const story = await requireStory(db.provider, storyId);
|
|
158
158
|
|
|
159
|
-
const dependencies = getStoryDependencies(db.
|
|
159
|
+
const dependencies = await getStoryDependencies(db.provider, story.id);
|
|
160
160
|
|
|
161
161
|
console.log(chalk.bold(`\nStory: ${story.id}\n`));
|
|
162
162
|
console.log(chalk.bold('Title:'), story.title);
|
|
@@ -19,8 +19,8 @@ vi.mock('../../db/queries/teams.js', () => ({
|
|
|
19
19
|
}));
|
|
20
20
|
|
|
21
21
|
vi.mock('../../utils/with-hive-context.js', () => ({
|
|
22
|
-
withHiveContext: vi.fn(callback => callback({ db: { db: {} } })),
|
|
23
|
-
withReadOnlyHiveContext: vi.fn(callback => callback({ db: { db: {} } })),
|
|
22
|
+
withHiveContext: vi.fn(callback => callback({ db: { db: {}, provider: {} } })),
|
|
23
|
+
withReadOnlyHiveContext: vi.fn(callback => callback({ db: { db: {}, provider: {} } })),
|
|
24
24
|
}));
|
|
25
25
|
|
|
26
26
|
import { teamsCommand } from './teams.js';
|
|
@@ -15,7 +15,7 @@ teamsCommand
|
|
|
15
15
|
.option('--json', 'Output as JSON')
|
|
16
16
|
.action(async (options: { json?: boolean }) => {
|
|
17
17
|
await withReadOnlyHiveContext(async ({ db }) => {
|
|
18
|
-
const teams = getAllTeams(db.
|
|
18
|
+
const teams = await getAllTeams(db.provider);
|
|
19
19
|
|
|
20
20
|
if (options.json) {
|
|
21
21
|
console.log(JSON.stringify(teams, null, 2));
|
|
@@ -31,9 +31,9 @@ teamsCommand
|
|
|
31
31
|
console.log(chalk.bold('\nTeams:\n'));
|
|
32
32
|
|
|
33
33
|
for (const team of teams) {
|
|
34
|
-
const agents = getAgentsByTeam(db.
|
|
35
|
-
const stories = getStoriesByTeam(db.
|
|
36
|
-
const storyPoints = getStoryPointsByTeam(db.
|
|
34
|
+
const agents = await getAgentsByTeam(db.provider, team.id);
|
|
35
|
+
const stories = await getStoriesByTeam(db.provider, team.id);
|
|
36
|
+
const storyPoints = await getStoryPointsByTeam(db.provider, team.id);
|
|
37
37
|
|
|
38
38
|
console.log(chalk.cyan(` ${team.name}`));
|
|
39
39
|
console.log(chalk.gray(` ID: ${team.id}`));
|
|
@@ -52,16 +52,16 @@ teamsCommand
|
|
|
52
52
|
.description('Show team details')
|
|
53
53
|
.action(async (name: string) => {
|
|
54
54
|
await withReadOnlyHiveContext(async ({ db }) => {
|
|
55
|
-
const team = getTeamByName(db.
|
|
55
|
+
const team = await getTeamByName(db.provider, name);
|
|
56
56
|
|
|
57
57
|
if (!team) {
|
|
58
58
|
console.error(chalk.red(`Team not found: ${name}`));
|
|
59
59
|
process.exit(1);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
const agents = getAgentsByTeam(db.
|
|
63
|
-
const stories = getStoriesByTeam(db.
|
|
64
|
-
const storyPoints = getStoryPointsByTeam(db.
|
|
62
|
+
const agents = await getAgentsByTeam(db.provider, team.id);
|
|
63
|
+
const stories = await getStoriesByTeam(db.provider, team.id);
|
|
64
|
+
const storyPoints = await getStoryPointsByTeam(db.provider, team.id);
|
|
65
65
|
|
|
66
66
|
console.log(chalk.bold(`\nTeam: ${team.name}\n`));
|
|
67
67
|
console.log(chalk.gray(`ID: ${team.id}`));
|
|
@@ -113,14 +113,14 @@ teamsCommand
|
|
|
113
113
|
.option('--force', 'Force removal even if team has active stories')
|
|
114
114
|
.action(async (name: string, options: { force?: boolean }) => {
|
|
115
115
|
await withHiveContext(async ({ db }) => {
|
|
116
|
-
const team = getTeamByName(db.
|
|
116
|
+
const team = await getTeamByName(db.provider, name);
|
|
117
117
|
|
|
118
118
|
if (!team) {
|
|
119
119
|
console.error(chalk.red(`Team not found: ${name}`));
|
|
120
120
|
process.exit(1);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
const stories = getStoriesByTeam(db.
|
|
123
|
+
const stories = await getStoriesByTeam(db.provider, team.id);
|
|
124
124
|
const activeStories = stories.filter(s => !['merged', 'draft'].includes(s.status));
|
|
125
125
|
|
|
126
126
|
if (activeStories.length > 0 && !options.force) {
|
|
@@ -132,7 +132,7 @@ teamsCommand
|
|
|
132
132
|
process.exit(1);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
deleteTeam(db.
|
|
135
|
+
await deleteTeam(db.provider, team.id);
|
|
136
136
|
console.log(chalk.green(`Team "${name}" removed successfully.`));
|
|
137
137
|
console.log(
|
|
138
138
|
chalk.yellow('Note: Git submodule was not removed. Run the following to remove it:')
|