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
|
@@ -1,107 +1,108 @@
|
|
|
1
1
|
// Licensed under the Hungry Ghost Hive License. See LICENSE.
|
|
2
2
|
|
|
3
|
-
import type { Database } from 'sql.js';
|
|
4
3
|
import { beforeEach, describe, expect, it } from 'vitest';
|
|
4
|
+
import { SqliteProvider } from '../../db/provider.js';
|
|
5
5
|
import { createRequirement, updateRequirement } from '../../db/queries/requirements.js';
|
|
6
6
|
import { createTestDatabase } from '../../db/queries/test-helpers.js';
|
|
7
7
|
import { isGodmodeActive } from './index.js';
|
|
8
8
|
|
|
9
9
|
describe('isGodmodeActive', () => {
|
|
10
|
-
let db:
|
|
10
|
+
let db: SqliteProvider;
|
|
11
11
|
|
|
12
12
|
beforeEach(async () => {
|
|
13
|
-
|
|
13
|
+
const rawDb = await createTestDatabase();
|
|
14
|
+
db = new SqliteProvider(rawDb);
|
|
14
15
|
});
|
|
15
16
|
|
|
16
|
-
it('should return false when no requirements exist', () => {
|
|
17
|
-
expect(isGodmodeActive(db)).toBe(false);
|
|
17
|
+
it('should return false when no requirements exist', async () => {
|
|
18
|
+
expect(await isGodmodeActive(db)).toBe(false);
|
|
18
19
|
});
|
|
19
20
|
|
|
20
|
-
it('should return false when no requirements have godmode enabled', () => {
|
|
21
|
-
createRequirement(db, {
|
|
21
|
+
it('should return false when no requirements have godmode enabled', async () => {
|
|
22
|
+
await createRequirement(db, {
|
|
22
23
|
title: 'Normal Feature',
|
|
23
24
|
description: 'A normal feature request',
|
|
24
25
|
});
|
|
25
26
|
|
|
26
|
-
expect(isGodmodeActive(db)).toBe(false);
|
|
27
|
+
expect(await isGodmodeActive(db)).toBe(false);
|
|
27
28
|
});
|
|
28
29
|
|
|
29
|
-
it('should return true when a pending requirement has godmode enabled', () => {
|
|
30
|
-
createRequirement(db, {
|
|
30
|
+
it('should return true when a pending requirement has godmode enabled', async () => {
|
|
31
|
+
await createRequirement(db, {
|
|
31
32
|
title: 'Godmode Feature',
|
|
32
33
|
description: 'A godmode feature request',
|
|
33
34
|
godmode: true,
|
|
34
35
|
});
|
|
35
36
|
|
|
36
|
-
expect(isGodmodeActive(db)).toBe(true);
|
|
37
|
+
expect(await isGodmodeActive(db)).toBe(true);
|
|
37
38
|
});
|
|
38
39
|
|
|
39
|
-
it('should return true when an in_progress requirement has godmode enabled', () => {
|
|
40
|
-
const req = createRequirement(db, {
|
|
40
|
+
it('should return true when an in_progress requirement has godmode enabled', async () => {
|
|
41
|
+
const req = await createRequirement(db, {
|
|
41
42
|
title: 'Godmode Feature',
|
|
42
43
|
description: 'A godmode feature request',
|
|
43
44
|
godmode: true,
|
|
44
45
|
});
|
|
45
|
-
updateRequirement(db, req.id, { status: 'in_progress' });
|
|
46
|
+
await updateRequirement(db, req.id, { status: 'in_progress' });
|
|
46
47
|
|
|
47
|
-
expect(isGodmodeActive(db)).toBe(true);
|
|
48
|
+
expect(await isGodmodeActive(db)).toBe(true);
|
|
48
49
|
});
|
|
49
50
|
|
|
50
|
-
it('should return false when godmode requirement is completed', () => {
|
|
51
|
-
const req = createRequirement(db, {
|
|
51
|
+
it('should return false when godmode requirement is completed', async () => {
|
|
52
|
+
const req = await createRequirement(db, {
|
|
52
53
|
title: 'Godmode Feature',
|
|
53
54
|
description: 'A godmode feature request',
|
|
54
55
|
godmode: true,
|
|
55
56
|
});
|
|
56
|
-
updateRequirement(db, req.id, { status: 'completed' });
|
|
57
|
+
await updateRequirement(db, req.id, { status: 'completed' });
|
|
57
58
|
|
|
58
|
-
expect(isGodmodeActive(db)).toBe(false);
|
|
59
|
+
expect(await isGodmodeActive(db)).toBe(false);
|
|
59
60
|
});
|
|
60
61
|
|
|
61
|
-
it('should return true when at least one active requirement has godmode', () => {
|
|
62
|
-
createRequirement(db, {
|
|
62
|
+
it('should return true when at least one active requirement has godmode', async () => {
|
|
63
|
+
await createRequirement(db, {
|
|
63
64
|
title: 'Normal Feature',
|
|
64
65
|
description: 'A normal feature request',
|
|
65
66
|
});
|
|
66
67
|
|
|
67
|
-
createRequirement(db, {
|
|
68
|
+
await createRequirement(db, {
|
|
68
69
|
title: 'Godmode Feature',
|
|
69
70
|
description: 'A godmode feature request',
|
|
70
71
|
godmode: true,
|
|
71
72
|
});
|
|
72
73
|
|
|
73
|
-
expect(isGodmodeActive(db)).toBe(true);
|
|
74
|
+
expect(await isGodmodeActive(db)).toBe(true);
|
|
74
75
|
});
|
|
75
76
|
|
|
76
|
-
it('should return false when godmode is explicitly set to false', () => {
|
|
77
|
-
createRequirement(db, {
|
|
77
|
+
it('should return false when godmode is explicitly set to false', async () => {
|
|
78
|
+
await createRequirement(db, {
|
|
78
79
|
title: 'Feature',
|
|
79
80
|
description: 'A feature request',
|
|
80
81
|
godmode: false,
|
|
81
82
|
});
|
|
82
83
|
|
|
83
|
-
expect(isGodmodeActive(db)).toBe(false);
|
|
84
|
+
expect(await isGodmodeActive(db)).toBe(false);
|
|
84
85
|
});
|
|
85
86
|
|
|
86
|
-
it('should return true for planning status with godmode', () => {
|
|
87
|
-
const req = createRequirement(db, {
|
|
87
|
+
it('should return true for planning status with godmode', async () => {
|
|
88
|
+
const req = await createRequirement(db, {
|
|
88
89
|
title: 'Godmode Feature',
|
|
89
90
|
description: 'A godmode feature request',
|
|
90
91
|
godmode: true,
|
|
91
92
|
});
|
|
92
|
-
updateRequirement(db, req.id, { status: 'planning' });
|
|
93
|
+
await updateRequirement(db, req.id, { status: 'planning' });
|
|
93
94
|
|
|
94
|
-
expect(isGodmodeActive(db)).toBe(true);
|
|
95
|
+
expect(await isGodmodeActive(db)).toBe(true);
|
|
95
96
|
});
|
|
96
97
|
|
|
97
|
-
it('should return true for planned status with godmode', () => {
|
|
98
|
-
const req = createRequirement(db, {
|
|
98
|
+
it('should return true for planned status with godmode', async () => {
|
|
99
|
+
const req = await createRequirement(db, {
|
|
99
100
|
title: 'Godmode Feature',
|
|
100
101
|
description: 'A godmode feature request',
|
|
101
102
|
godmode: true,
|
|
102
103
|
});
|
|
103
|
-
updateRequirement(db, req.id, { status: 'planned' });
|
|
104
|
+
await updateRequirement(db, req.id, { status: 'planned' });
|
|
104
105
|
|
|
105
|
-
expect(isGodmodeActive(db)).toBe(true);
|
|
106
|
+
expect(await isGodmodeActive(db)).toBe(true);
|
|
106
107
|
});
|
|
107
108
|
});
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import blessed from 'blessed';
|
|
4
4
|
import { appendFileSync, existsSync, renameSync, statSync } from 'fs';
|
|
5
5
|
import { join } from 'path';
|
|
6
|
-
import type { Database } from 'sql.js';
|
|
7
6
|
import { getReadOnlyDatabase, type ReadOnlyDatabaseClient } from '../../db/client.js';
|
|
7
|
+
import type { DatabaseProvider } from '../../db/provider.js';
|
|
8
8
|
import { getAllRequirements } from '../../db/queries/requirements.js';
|
|
9
9
|
import { findHiveRoot, getHivePaths } from '../../utils/paths.js';
|
|
10
10
|
import { getVersion } from '../../utils/version.js';
|
|
@@ -42,9 +42,9 @@ export interface DashboardOptions {
|
|
|
42
42
|
/**
|
|
43
43
|
* Check if godmode is active by looking for any non-completed requirement with godmode enabled.
|
|
44
44
|
*/
|
|
45
|
-
export function isGodmodeActive(db:
|
|
46
|
-
const requirements = getAllRequirements(db);
|
|
47
|
-
return requirements.some(req => req.godmode && req.status !== 'completed');
|
|
45
|
+
export async function isGodmodeActive(db: DatabaseProvider): Promise<boolean> {
|
|
46
|
+
const requirements = await getAllRequirements(db);
|
|
47
|
+
return requirements.some(req => req.godmode && (req.status as string) !== 'completed');
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export async function startDashboard(options: DashboardOptions = {}): Promise<void> {
|
|
@@ -56,9 +56,12 @@ export async function startDashboard(options: DashboardOptions = {}): Promise<vo
|
|
|
56
56
|
|
|
57
57
|
const paths = getHivePaths(root);
|
|
58
58
|
const dbPath = join(paths.hiveDir, 'hive.db');
|
|
59
|
-
|
|
59
|
+
const isDistributed = !existsSync(dbPath);
|
|
60
|
+
debugLog(
|
|
61
|
+
`Dashboard starting - root: ${root}, hiveDir: ${paths.hiveDir}, distributed: ${isDistributed}`
|
|
62
|
+
);
|
|
60
63
|
let db: ReadOnlyDatabaseClient = await getReadOnlyDatabase(paths.hiveDir);
|
|
61
|
-
let lastDbMtime = statSync(dbPath).mtimeMs;
|
|
64
|
+
let lastDbMtime = isDistributed ? 0 : statSync(dbPath).mtimeMs;
|
|
62
65
|
const refreshInterval = options.refreshInterval || 5000;
|
|
63
66
|
const version = getVersion();
|
|
64
67
|
|
|
@@ -95,12 +98,12 @@ export async function startDashboard(options: DashboardOptions = {}): Promise<vo
|
|
|
95
98
|
};
|
|
96
99
|
|
|
97
100
|
// Create panels
|
|
98
|
-
const agentsPanel = createAgentsPanel(screen, db.
|
|
101
|
+
const agentsPanel = createAgentsPanel(screen, db.provider, pauseRefresh, resumeRefresh);
|
|
99
102
|
const storiesPanel = createStoriesPanel(screen, db.db);
|
|
100
|
-
const pipelinePanel = createPipelinePanel(screen, db.
|
|
101
|
-
const activityPanel = createActivityPanel(screen, db.
|
|
102
|
-
const mergeQueuePanel = createMergeQueuePanel(screen, db.
|
|
103
|
-
const escalationsPanel = createEscalationsPanel(screen, db.
|
|
103
|
+
const pipelinePanel = createPipelinePanel(screen, db.provider);
|
|
104
|
+
const activityPanel = createActivityPanel(screen, db.provider);
|
|
105
|
+
const mergeQueuePanel = createMergeQueuePanel(screen, db.provider);
|
|
106
|
+
const escalationsPanel = createEscalationsPanel(screen, db.provider, pauseRefresh, resumeRefresh);
|
|
104
107
|
|
|
105
108
|
// Footer
|
|
106
109
|
blessed.box({
|
|
@@ -126,13 +129,21 @@ export async function startDashboard(options: DashboardOptions = {}): Promise<vo
|
|
|
126
129
|
const refresh = async () => {
|
|
127
130
|
if (refreshPaused) return;
|
|
128
131
|
try {
|
|
129
|
-
//
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
// In distributed (Postgres) mode, always refresh since there's no local file.
|
|
133
|
+
// In SQLite mode, only reload when the file has been modified.
|
|
134
|
+
const shouldReload = isDistributed
|
|
135
|
+
? true
|
|
136
|
+
: (() => {
|
|
137
|
+
const currentMtime = statSync(dbPath).mtimeMs;
|
|
138
|
+
if (currentMtime !== lastDbMtime) {
|
|
139
|
+
lastDbMtime = currentMtime;
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
return false;
|
|
143
|
+
})();
|
|
144
|
+
|
|
145
|
+
if (shouldReload) {
|
|
132
146
|
debugLog(`Database changed - reloading from ${paths.hiveDir}`);
|
|
133
|
-
lastDbMtime = currentMtime;
|
|
134
|
-
|
|
135
|
-
// Get new database connection first, then close old one
|
|
136
147
|
const newDb = await getReadOnlyDatabase(paths.hiveDir);
|
|
137
148
|
try {
|
|
138
149
|
db.db.close();
|
|
@@ -143,18 +154,18 @@ export async function startDashboard(options: DashboardOptions = {}): Promise<vo
|
|
|
143
154
|
}
|
|
144
155
|
|
|
145
156
|
// Update header with godmode indicator
|
|
146
|
-
const godmode = isGodmodeActive(db.
|
|
157
|
+
const godmode = await isGodmodeActive(db.provider);
|
|
147
158
|
const godmodeLabel = godmode ? ' {yellow-fg}{bold}GODMODE ACTIVE{/bold}{/yellow-fg}' : '';
|
|
148
159
|
header.setContent(
|
|
149
160
|
` {bold}HIVE ORCHESTRATOR{/bold} v${version}${godmodeLabel} [R]efresh [Q]uit`
|
|
150
161
|
);
|
|
151
162
|
|
|
152
|
-
await updateAgentsPanel(agentsPanel, db.
|
|
163
|
+
await updateAgentsPanel(agentsPanel, db.provider);
|
|
153
164
|
await updateStoriesPanel(storiesPanel, db.db);
|
|
154
|
-
await updatePipelinePanel(pipelinePanel, db.
|
|
155
|
-
await updateActivityPanel(activityPanel, db.
|
|
156
|
-
await updateMergeQueuePanel(mergeQueuePanel, db.
|
|
157
|
-
await updateEscalationsPanel(escalationsPanel, db.
|
|
165
|
+
await updatePipelinePanel(pipelinePanel, db.provider);
|
|
166
|
+
await updateActivityPanel(activityPanel, db.provider);
|
|
167
|
+
await updateMergeQueuePanel(mergeQueuePanel, db.provider);
|
|
168
|
+
await updateEscalationsPanel(escalationsPanel, db.provider);
|
|
158
169
|
screen.render();
|
|
159
170
|
} catch (err: unknown) {
|
|
160
171
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
// Licensed under the Hungry Ghost Hive License. See LICENSE.
|
|
2
2
|
|
|
3
3
|
import blessed, { type Widgets } from 'blessed';
|
|
4
|
-
import type {
|
|
4
|
+
import type { DatabaseProvider } from '../../../db/provider.js';
|
|
5
5
|
import { getRecentLogs } from '../../../db/queries/logs.js';
|
|
6
6
|
|
|
7
|
-
export function createActivityPanel(
|
|
7
|
+
export function createActivityPanel(
|
|
8
|
+
screen: Widgets.Screen,
|
|
9
|
+
db: DatabaseProvider
|
|
10
|
+
): Widgets.BoxElement {
|
|
8
11
|
const box = blessed.box({
|
|
9
12
|
parent: screen,
|
|
10
13
|
top: '55%+5',
|
|
@@ -34,8 +37,11 @@ export function createActivityPanel(screen: Widgets.Screen, db: Database): Widge
|
|
|
34
37
|
return box;
|
|
35
38
|
}
|
|
36
39
|
|
|
37
|
-
export async function updateActivityPanel(
|
|
38
|
-
|
|
40
|
+
export async function updateActivityPanel(
|
|
41
|
+
box: Widgets.BoxElement,
|
|
42
|
+
db: DatabaseProvider
|
|
43
|
+
): Promise<void> {
|
|
44
|
+
const logs = await getRecentLogs(db, 50);
|
|
39
45
|
|
|
40
46
|
const lines: string[] = [];
|
|
41
47
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import blessed, { type Widgets } from 'blessed';
|
|
4
4
|
import { spawnSync } from 'child_process';
|
|
5
5
|
import { appendFileSync } from 'fs';
|
|
6
|
-
import type { Database } from 'sql.js';
|
|
7
6
|
import { loadConfig } from '../../../config/loader.js';
|
|
8
7
|
import type { ModelsConfig } from '../../../config/schema.js';
|
|
8
|
+
import type { DatabaseProvider } from '../../../db/provider.js';
|
|
9
9
|
import { getActiveAgents, type AgentRow } from '../../../db/queries/agents.js';
|
|
10
10
|
import { getTeamById } from '../../../db/queries/teams.js';
|
|
11
11
|
import { getHiveSessions } from '../../../tmux/manager.js';
|
|
@@ -21,7 +21,7 @@ let currentAgents: AgentRow[] = [];
|
|
|
21
21
|
|
|
22
22
|
export function createAgentsPanel(
|
|
23
23
|
screen: Widgets.Screen,
|
|
24
|
-
db:
|
|
24
|
+
db: DatabaseProvider,
|
|
25
25
|
pauseRefresh: () => void,
|
|
26
26
|
resumeRefresh: () => void
|
|
27
27
|
): Widgets.ListElement {
|
|
@@ -116,11 +116,14 @@ interface DisplayAgent extends AgentRow {
|
|
|
116
116
|
repo?: string;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
export async function updateAgentsPanel(
|
|
119
|
+
export async function updateAgentsPanel(
|
|
120
|
+
list: Widgets.ListElement,
|
|
121
|
+
db: DatabaseProvider
|
|
122
|
+
): Promise<void> {
|
|
120
123
|
// Preserve current selection before updating
|
|
121
124
|
const currentSelection = (list as unknown as { selected: number }).selected;
|
|
122
125
|
|
|
123
|
-
const agents = getActiveAgents(db);
|
|
126
|
+
const agents = await getActiveAgents(db);
|
|
124
127
|
debugLog(
|
|
125
128
|
`updateAgentsPanel called, found ${agents.length} agents, currentSelection=${currentSelection}`
|
|
126
129
|
);
|
|
@@ -172,7 +175,7 @@ export async function updateAgentsPanel(list: Widgets.ListElement, db: Database)
|
|
|
172
175
|
for (const agent of agents) {
|
|
173
176
|
const displayAgent: DisplayAgent = { ...agent };
|
|
174
177
|
if (agent.team_id) {
|
|
175
|
-
const team = getTeamById(db, agent.team_id);
|
|
178
|
+
const team = await getTeamById(db, agent.team_id);
|
|
176
179
|
if (team?.repo_path) {
|
|
177
180
|
// Extract repo name from path (e.g., "repos/my-service" -> "my-service")
|
|
178
181
|
displayAgent.repo = team.repo_path.replace(/^repos\//, '');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import blessed, { type Widgets } from 'blessed';
|
|
4
4
|
import { spawnSync } from 'child_process';
|
|
5
|
-
import type {
|
|
5
|
+
import type { DatabaseProvider } from '../../../db/provider.js';
|
|
6
6
|
import { getPendingEscalations, type EscalationRow } from '../../../db/queries/escalations.js';
|
|
7
7
|
|
|
8
8
|
// Store escalations for selection lookup
|
|
@@ -23,7 +23,7 @@ function summarizeEscalationReason(reason: string): string {
|
|
|
23
23
|
|
|
24
24
|
export function createEscalationsPanel(
|
|
25
25
|
screen: Widgets.Screen,
|
|
26
|
-
db:
|
|
26
|
+
db: DatabaseProvider,
|
|
27
27
|
pauseRefresh: () => void,
|
|
28
28
|
resumeRefresh: () => void
|
|
29
29
|
): Widgets.ListElement {
|
|
@@ -135,9 +135,9 @@ export function createEscalationsPanel(
|
|
|
135
135
|
|
|
136
136
|
export async function updateEscalationsPanel(
|
|
137
137
|
list: Widgets.ListElement,
|
|
138
|
-
db:
|
|
138
|
+
db: DatabaseProvider
|
|
139
139
|
): Promise<void> {
|
|
140
|
-
const escalations = getPendingEscalations(db);
|
|
140
|
+
const escalations = await getPendingEscalations(db);
|
|
141
141
|
currentEscalations = escalations; // Store for selection lookup
|
|
142
142
|
|
|
143
143
|
if (escalations.length === 0) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Licensed under the Hungry Ghost Hive License. See LICENSE.
|
|
2
2
|
|
|
3
3
|
import blessed, { type Widgets } from 'blessed';
|
|
4
|
-
import type {
|
|
4
|
+
import type { DatabaseProvider } from '../../../db/provider.js';
|
|
5
5
|
import { getMergeQueue, type PullRequestRow } from '../../../db/queries/pull-requests.js';
|
|
6
6
|
|
|
7
7
|
export function createMergeQueuePanel(
|
|
8
8
|
screen: Widgets.Screen,
|
|
9
|
-
db:
|
|
9
|
+
db: DatabaseProvider
|
|
10
10
|
): Widgets.ListTableElement {
|
|
11
11
|
const table = blessed.listtable({
|
|
12
12
|
parent: screen,
|
|
@@ -37,9 +37,9 @@ export function createMergeQueuePanel(
|
|
|
37
37
|
|
|
38
38
|
export async function updateMergeQueuePanel(
|
|
39
39
|
table: Widgets.ListTableElement,
|
|
40
|
-
db:
|
|
40
|
+
db: DatabaseProvider
|
|
41
41
|
): Promise<void> {
|
|
42
|
-
const queue = getMergeQueue(db);
|
|
42
|
+
const queue = await getMergeQueue(db);
|
|
43
43
|
|
|
44
44
|
const headers = ['#', 'Branch', 'Status'];
|
|
45
45
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
// Licensed under the Hungry Ghost Hive License. See LICENSE.
|
|
2
2
|
|
|
3
3
|
import blessed, { type Widgets } from 'blessed';
|
|
4
|
-
import type {
|
|
4
|
+
import type { DatabaseProvider } from '../../../db/provider.js';
|
|
5
5
|
import { getStoryCounts } from '../../../db/queries/stories.js';
|
|
6
6
|
|
|
7
|
-
export function createPipelinePanel(
|
|
7
|
+
export function createPipelinePanel(
|
|
8
|
+
screen: Widgets.Screen,
|
|
9
|
+
db: DatabaseProvider
|
|
10
|
+
): Widgets.BoxElement {
|
|
8
11
|
const box = blessed.box({
|
|
9
12
|
parent: screen,
|
|
10
13
|
top: '55%',
|
|
@@ -24,8 +27,11 @@ export function createPipelinePanel(screen: Widgets.Screen, db: Database): Widge
|
|
|
24
27
|
return box;
|
|
25
28
|
}
|
|
26
29
|
|
|
27
|
-
export async function updatePipelinePanel(
|
|
28
|
-
|
|
30
|
+
export async function updatePipelinePanel(
|
|
31
|
+
box: Widgets.BoxElement,
|
|
32
|
+
db: DatabaseProvider
|
|
33
|
+
): Promise<void> {
|
|
34
|
+
const counts = await getStoryCounts(db);
|
|
29
35
|
|
|
30
36
|
const stages = [
|
|
31
37
|
{ name: 'Planned', count: counts.planned, color: 'white' },
|
package/src/config/schema.ts
CHANGED
|
@@ -343,6 +343,7 @@ const ClusterConfigSchema = z
|
|
|
343
343
|
// Main configuration schema
|
|
344
344
|
export const HiveConfigSchema = z.object({
|
|
345
345
|
version: z.string().default('1.0'),
|
|
346
|
+
distributed: z.boolean().default(false),
|
|
346
347
|
models: ModelsConfigSchema.default({}),
|
|
347
348
|
scaling: ScalingConfigSchema.default({}),
|
|
348
349
|
integrations: IntegrationsConfigSchema.default({}),
|
|
@@ -10,10 +10,9 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { join } from 'path';
|
|
13
|
-
import type { Database } from 'sql.js';
|
|
14
13
|
import type { TokenStore } from '../../auth/token-store.js';
|
|
15
14
|
import type { HiveConfig } from '../../config/schema.js';
|
|
16
|
-
import {
|
|
15
|
+
import type { DatabaseProvider } from '../../db/provider.js';
|
|
17
16
|
import type { StoryRow } from '../../db/queries/stories.js';
|
|
18
17
|
import * as logger from '../../utils/logger.js';
|
|
19
18
|
import type {
|
|
@@ -94,7 +93,7 @@ async function resolveProvider(root: string) {
|
|
|
94
93
|
*/
|
|
95
94
|
export async function syncStatusForStory(
|
|
96
95
|
root: string,
|
|
97
|
-
db:
|
|
96
|
+
db: DatabaseProvider,
|
|
98
97
|
storyId: string,
|
|
99
98
|
newStatus: string
|
|
100
99
|
): Promise<void> {
|
|
@@ -124,7 +123,7 @@ export async function syncStatusForStory(
|
|
|
124
123
|
* Never throws — failures are logged as warnings.
|
|
125
124
|
*/
|
|
126
125
|
export async function postLifecycleComment(
|
|
127
|
-
db:
|
|
126
|
+
db: DatabaseProvider,
|
|
128
127
|
_hiveDir: string,
|
|
129
128
|
hiveConfig: HiveConfig | undefined,
|
|
130
129
|
storyId: string,
|
|
@@ -136,7 +135,7 @@ export async function postLifecycleComment(
|
|
|
136
135
|
const pmConfig = hiveConfig.integrations?.project_management;
|
|
137
136
|
if (!pmConfig || pmConfig.provider === 'none') return;
|
|
138
137
|
|
|
139
|
-
const story = queryOne<StoryRow>(
|
|
138
|
+
const story = await db.queryOne<StoryRow>('SELECT * FROM stories WHERE id = ?', [storyId]);
|
|
140
139
|
if (!story || !story.external_issue_key) {
|
|
141
140
|
logger.debug(`Story ${storyId} has no external issue key, skipping ${event} comment`);
|
|
142
141
|
return;
|
|
@@ -160,7 +159,7 @@ export async function postLifecycleComment(
|
|
|
160
159
|
* Never throws — failures are logged as warnings.
|
|
161
160
|
*/
|
|
162
161
|
export async function postProgressUpdate(
|
|
163
|
-
db:
|
|
162
|
+
db: DatabaseProvider,
|
|
164
163
|
_hiveDir: string,
|
|
165
164
|
hiveConfig: HiveConfig | undefined,
|
|
166
165
|
storyId: string,
|
|
@@ -172,7 +171,7 @@ export async function postProgressUpdate(
|
|
|
172
171
|
const pmConfig = hiveConfig.integrations?.project_management;
|
|
173
172
|
if (!pmConfig || pmConfig.provider === 'none') return;
|
|
174
173
|
|
|
175
|
-
const story = queryOne<StoryRow>(
|
|
174
|
+
const story = await db.queryOne<StoryRow>('SELECT * FROM stories WHERE id = ?', [storyId]);
|
|
176
175
|
if (!story?.external_subtask_key) {
|
|
177
176
|
logger.debug(`Story ${storyId} has no external subtask, skipping progress update`);
|
|
178
177
|
return;
|
|
@@ -200,7 +199,7 @@ export async function postProgressUpdate(
|
|
|
200
199
|
*
|
|
201
200
|
* Never throws — failures are logged.
|
|
202
201
|
*/
|
|
203
|
-
export async function syncFromProvider(root: string, db:
|
|
202
|
+
export async function syncFromProvider(root: string, db: DatabaseProvider): Promise<number> {
|
|
204
203
|
try {
|
|
205
204
|
const resolved = await resolveProvider(root);
|
|
206
205
|
if (!resolved) return 0;
|
|
@@ -227,7 +226,7 @@ export async function syncFromProvider(root: string, db: Database): Promise<numb
|
|
|
227
226
|
*/
|
|
228
227
|
export async function syncStoryToProvider(
|
|
229
228
|
root: string,
|
|
230
|
-
db:
|
|
229
|
+
db: DatabaseProvider,
|
|
231
230
|
story: StoryRow,
|
|
232
231
|
teamName?: string
|
|
233
232
|
): Promise<{ key: string; id: string } | null> {
|
|
@@ -256,7 +255,7 @@ export async function syncStoryToProvider(
|
|
|
256
255
|
*/
|
|
257
256
|
export async function syncRequirementToProvider(
|
|
258
257
|
root: string,
|
|
259
|
-
db:
|
|
258
|
+
db: DatabaseProvider,
|
|
260
259
|
requirement: { id: string; title: string; description: string },
|
|
261
260
|
storyIds: string[],
|
|
262
261
|
teamName?: string
|
package/src/db/client.ts
CHANGED
|
@@ -5,12 +5,22 @@ import { dirname, join } from 'path';
|
|
|
5
5
|
import initSqlJs, { Database as SqlJsDatabase } from 'sql.js';
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
7
7
|
import { DatabaseCorruptionError, InitializationError } from '../errors/index.js';
|
|
8
|
+
import {
|
|
9
|
+
ReadOnlySqliteProvider,
|
|
10
|
+
SqliteProvider,
|
|
11
|
+
type DatabaseProvider,
|
|
12
|
+
type WritableDatabaseProvider,
|
|
13
|
+
} from './provider.js';
|
|
14
|
+
export { createPostgresProvider, PostgresProvider } from './postgres-provider.js';
|
|
15
|
+
export { ReadOnlySqliteProvider, SqliteProvider } from './provider.js';
|
|
16
|
+
export type { DatabaseProvider, QueryResult, WritableDatabaseProvider } from './provider.js';
|
|
8
17
|
|
|
9
18
|
const __filename = fileURLToPath(import.meta.url);
|
|
10
19
|
const __dirname = dirname(__filename);
|
|
11
20
|
|
|
12
21
|
export interface DatabaseClient {
|
|
13
22
|
db: SqlJsDatabase;
|
|
23
|
+
provider: WritableDatabaseProvider;
|
|
14
24
|
close: () => void;
|
|
15
25
|
save: () => void;
|
|
16
26
|
runMigrations: () => void;
|
|
@@ -18,6 +28,7 @@ export interface DatabaseClient {
|
|
|
18
28
|
|
|
19
29
|
export interface ReadOnlyDatabaseClient {
|
|
20
30
|
db: SqlJsDatabase;
|
|
31
|
+
provider: DatabaseProvider;
|
|
21
32
|
close: () => void;
|
|
22
33
|
}
|
|
23
34
|
|
|
@@ -186,8 +197,11 @@ export async function createDatabase(dbPath: string): Promise<DatabaseClient> {
|
|
|
186
197
|
renameSync(tmpPath, dbPath);
|
|
187
198
|
};
|
|
188
199
|
|
|
200
|
+
const provider = new SqliteProvider(db, save);
|
|
201
|
+
|
|
189
202
|
const client: DatabaseClient = {
|
|
190
203
|
db,
|
|
204
|
+
provider,
|
|
191
205
|
close: () => {
|
|
192
206
|
save();
|
|
193
207
|
db.close();
|
|
@@ -660,8 +674,11 @@ export async function getReadOnlyDatabase(hiveDir: string): Promise<ReadOnlyData
|
|
|
660
674
|
}
|
|
661
675
|
}
|
|
662
676
|
|
|
677
|
+
const provider = new ReadOnlySqliteProvider(db);
|
|
678
|
+
|
|
663
679
|
return {
|
|
664
680
|
db,
|
|
681
|
+
provider,
|
|
665
682
|
close: () => db.close(),
|
|
666
683
|
};
|
|
667
684
|
}
|