@apralabs/apra-fleet 0.3.6 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +378 -252
- package/dist/agents/backlog-groomer.md +303 -0
- package/dist/agents/ci-watcher.md +13 -1
- package/dist/agents/deployer.md +66 -13
- package/dist/agents/doer.md +67 -8
- package/dist/agents/harvester.md +22 -3
- package/dist/agents/integ-test-runner.md +166 -60
- package/dist/agents/kb-reconciler.md +216 -0
- package/dist/agents/plan-reviewer.md +88 -18
- package/dist/agents/planner.md +182 -19
- package/dist/agents/regression-test-runner.md +234 -0
- package/dist/agents/reviewer.md +125 -9
- package/dist/agents/schemas/backlog-groomer-input.json +35 -0
- package/dist/agents/schemas/backlog-groomer-output.json +164 -0
- package/dist/agents/schemas/doer-output.json +63 -3
- package/dist/agents/schemas/harvester-output.json +59 -2
- package/dist/agents/schemas/integ-test-runner-output.json +34 -0
- package/dist/agents/schemas/kb-reconciler-output.json +87 -0
- package/dist/agents/schemas/planner-output.json +65 -0
- package/dist/agents/schemas/regression-test-runner-input.json +15 -0
- package/dist/agents/schemas/regression-test-runner-output.json +50 -0
- package/dist/agents/schemas/reviewer-output.json +108 -7
- package/dist/cli/agent-transform.d.ts +1 -0
- package/dist/cli/agent-transform.d.ts.map +1 -1
- package/dist/cli/agent-transform.js +77 -0
- package/dist/cli/agent-transform.js.map +1 -1
- package/dist/cli/auth.d.ts +3 -0
- package/dist/cli/auth.d.ts.map +1 -1
- package/dist/cli/auth.js +181 -5
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/config.d.ts +5 -1
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +7 -1
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/dolt-install.d.ts +91 -0
- package/dist/cli/dolt-install.d.ts.map +1 -0
- package/dist/cli/dolt-install.js +334 -0
- package/dist/cli/dolt-install.js.map +1 -0
- package/dist/cli/install-guard.d.ts +29 -0
- package/dist/cli/install-guard.d.ts.map +1 -0
- package/dist/cli/install-guard.js +153 -0
- package/dist/cli/install-guard.js.map +1 -0
- package/dist/cli/install.d.ts +45 -3
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +736 -109
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/join.d.ts +12 -0
- package/dist/cli/join.d.ts.map +1 -0
- package/dist/cli/join.js +87 -0
- package/dist/cli/join.js.map +1 -0
- package/dist/cli/kb-commit.d.ts +12 -0
- package/dist/cli/kb-commit.d.ts.map +1 -0
- package/dist/cli/kb-commit.js +53 -0
- package/dist/cli/kb-commit.js.map +1 -0
- package/dist/cli/kb-directives.d.ts +17 -0
- package/dist/cli/kb-directives.d.ts.map +1 -0
- package/dist/cli/kb-directives.js +146 -0
- package/dist/cli/kb-directives.js.map +1 -0
- package/dist/cli/kb-import.d.ts +13 -0
- package/dist/cli/kb-import.d.ts.map +1 -0
- package/dist/cli/kb-import.js +56 -0
- package/dist/cli/kb-import.js.map +1 -0
- package/dist/cli/register-member.d.ts +2 -0
- package/dist/cli/register-member.d.ts.map +1 -0
- package/dist/cli/register-member.js +193 -0
- package/dist/cli/register-member.js.map +1 -0
- package/dist/cli/restart.d.ts +2 -0
- package/dist/cli/restart.d.ts.map +1 -0
- package/dist/cli/restart.js +7 -0
- package/dist/cli/restart.js.map +1 -0
- package/dist/cli/spoke.d.ts +35 -0
- package/dist/cli/spoke.d.ts.map +1 -0
- package/dist/cli/spoke.js +212 -0
- package/dist/cli/spoke.js.map +1 -0
- package/dist/cli/start.d.ts +2 -0
- package/dist/cli/start.d.ts.map +1 -0
- package/dist/cli/start.js +92 -0
- package/dist/cli/start.js.map +1 -0
- package/dist/cli/status.d.ts +2 -0
- package/dist/cli/status.d.ts.map +1 -0
- package/dist/cli/status.js +83 -0
- package/dist/cli/status.js.map +1 -0
- package/dist/cli/stop.d.ts +2 -0
- package/dist/cli/stop.d.ts.map +1 -0
- package/dist/cli/stop.js +51 -0
- package/dist/cli/stop.js.map +1 -0
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +120 -9
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +10 -1
- package/dist/cli/update.js.map +1 -1
- package/dist/cli/watch.d.ts +53 -4
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +118 -17
- package/dist/cli/watch.js.map +1 -1
- package/dist/cli/workflow-assets.d.ts +37 -0
- package/dist/cli/workflow-assets.d.ts.map +1 -0
- package/dist/cli/workflow-assets.js +144 -0
- package/dist/cli/workflow-assets.js.map +1 -0
- package/dist/cli/workflow.d.ts +75 -0
- package/dist/cli/workflow.d.ts.map +1 -0
- package/dist/cli/workflow.js +397 -0
- package/dist/cli/workflow.js.map +1 -0
- package/dist/commands/kb-server.d.ts +8 -0
- package/dist/commands/kb-server.d.ts.map +1 -0
- package/dist/commands/kb-server.js +221 -0
- package/dist/commands/kb-server.js.map +1 -0
- package/dist/hub-service/activity.d.ts +30 -0
- package/dist/hub-service/activity.d.ts.map +1 -0
- package/dist/hub-service/activity.js +20 -0
- package/dist/hub-service/activity.js.map +1 -0
- package/dist/hub-service/audit-log.d.ts +19 -0
- package/dist/hub-service/audit-log.d.ts.map +1 -0
- package/dist/hub-service/audit-log.js +13 -0
- package/dist/hub-service/audit-log.js.map +1 -0
- package/dist/hub-service/db/pool.d.ts +19 -0
- package/dist/hub-service/db/pool.d.ts.map +1 -0
- package/dist/hub-service/db/pool.js +53 -0
- package/dist/hub-service/db/pool.js.map +1 -0
- package/dist/hub-service/enrollment.d.ts +29 -0
- package/dist/hub-service/enrollment.d.ts.map +1 -0
- package/dist/hub-service/enrollment.js +48 -0
- package/dist/hub-service/enrollment.js.map +1 -0
- package/dist/hub-service/envelope-routes.d.ts +46 -0
- package/dist/hub-service/envelope-routes.d.ts.map +1 -0
- package/dist/hub-service/envelope-routes.js +94 -0
- package/dist/hub-service/envelope-routes.js.map +1 -0
- package/dist/hub-service/handlers/installers.d.ts +14 -0
- package/dist/hub-service/handlers/installers.d.ts.map +1 -0
- package/dist/hub-service/handlers/installers.js +8 -0
- package/dist/hub-service/handlers/installers.js.map +1 -0
- package/dist/hub-service/http-server.d.ts +31 -0
- package/dist/hub-service/http-server.d.ts.map +1 -0
- package/dist/hub-service/http-server.js +711 -0
- package/dist/hub-service/http-server.js.map +1 -0
- package/dist/hub-service/hub-jwt.d.ts +30 -0
- package/dist/hub-service/hub-jwt.d.ts.map +1 -0
- package/dist/hub-service/hub-jwt.js +105 -0
- package/dist/hub-service/hub-jwt.js.map +1 -0
- package/dist/hub-service/jwt-revocation.d.ts +20 -0
- package/dist/hub-service/jwt-revocation.d.ts.map +1 -0
- package/dist/hub-service/jwt-revocation.js +18 -0
- package/dist/hub-service/jwt-revocation.js.map +1 -0
- package/dist/hub-service/machines.d.ts +16 -0
- package/dist/hub-service/machines.d.ts.map +1 -0
- package/dist/hub-service/machines.js +14 -0
- package/dist/hub-service/machines.js.map +1 -0
- package/dist/hub-service/main.d.ts +3 -0
- package/dist/hub-service/main.d.ts.map +1 -0
- package/dist/hub-service/main.js +64 -0
- package/dist/hub-service/main.js.map +1 -0
- package/dist/hub-service/member-tokens.d.ts +11 -0
- package/dist/hub-service/member-tokens.d.ts.map +1 -0
- package/dist/hub-service/member-tokens.js +49 -0
- package/dist/hub-service/member-tokens.js.map +1 -0
- package/dist/hub-service/member-view.d.ts +20 -0
- package/dist/hub-service/member-view.d.ts.map +1 -0
- package/dist/hub-service/member-view.js +76 -0
- package/dist/hub-service/member-view.js.map +1 -0
- package/dist/hub-service/members.d.ts +44 -0
- package/dist/hub-service/members.d.ts.map +1 -0
- package/dist/hub-service/members.js +25 -0
- package/dist/hub-service/members.js.map +1 -0
- package/dist/hub-service/presence.d.ts +40 -0
- package/dist/hub-service/presence.d.ts.map +1 -0
- package/dist/hub-service/presence.js +44 -0
- package/dist/hub-service/presence.js.map +1 -0
- package/dist/hub-service/project-view.d.ts +12 -0
- package/dist/hub-service/project-view.d.ts.map +1 -0
- package/dist/hub-service/project-view.js +34 -0
- package/dist/hub-service/project-view.js.map +1 -0
- package/dist/hub-service/projects.d.ts +48 -0
- package/dist/hub-service/projects.d.ts.map +1 -0
- package/dist/hub-service/projects.js +80 -0
- package/dist/hub-service/projects.js.map +1 -0
- package/dist/hub-service/relay-queue.d.ts +115 -0
- package/dist/hub-service/relay-queue.d.ts.map +1 -0
- package/dist/hub-service/relay-queue.js +148 -0
- package/dist/hub-service/relay-queue.js.map +1 -0
- package/dist/hub-service/session-jwt.d.ts +10 -0
- package/dist/hub-service/session-jwt.d.ts.map +1 -0
- package/dist/hub-service/session-jwt.js +69 -0
- package/dist/hub-service/session-jwt.js.map +1 -0
- package/dist/hub-service/usage.d.ts +40 -0
- package/dist/hub-service/usage.d.ts.map +1 -0
- package/dist/hub-service/usage.js +25 -0
- package/dist/hub-service/usage.js.map +1 -0
- package/dist/hub-service/users.d.ts +56 -0
- package/dist/hub-service/users.d.ts.map +1 -0
- package/dist/hub-service/users.js +72 -0
- package/dist/hub-service/users.js.map +1 -0
- package/dist/hub-service/workspaces.d.ts +20 -0
- package/dist/hub-service/workspaces.d.ts.map +1 -0
- package/dist/hub-service/workspaces.js +10 -0
- package/dist/hub-service/workspaces.js.map +1 -0
- package/dist/index.js +254 -132
- package/dist/index.js.map +1 -1
- package/dist/os/linux.d.ts +14 -0
- package/dist/os/linux.d.ts.map +1 -1
- package/dist/os/linux.js +80 -4
- package/dist/os/linux.js.map +1 -1
- package/dist/os/os-commands.d.ts +15 -0
- package/dist/os/os-commands.d.ts.map +1 -1
- package/dist/os/windows.d.ts +36 -0
- package/dist/os/windows.d.ts.map +1 -1
- package/dist/os/windows.js +74 -18
- package/dist/os/windows.js.map +1 -1
- package/dist/paths.d.ts +23 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +29 -0
- package/dist/paths.js.map +1 -1
- package/dist/providers/agy.d.ts +20 -2
- package/dist/providers/agy.d.ts.map +1 -1
- package/dist/providers/agy.js +259 -21
- package/dist/providers/agy.js.map +1 -1
- package/dist/providers/claude.d.ts +16 -2
- package/dist/providers/claude.d.ts.map +1 -1
- package/dist/providers/claude.js +283 -16
- package/dist/providers/claude.js.map +1 -1
- package/dist/providers/codex.d.ts +13 -2
- package/dist/providers/codex.d.ts.map +1 -1
- package/dist/providers/codex.js +36 -6
- package/dist/providers/codex.js.map +1 -1
- package/dist/providers/copilot.d.ts +13 -2
- package/dist/providers/copilot.d.ts.map +1 -1
- package/dist/providers/copilot.js +34 -7
- package/dist/providers/copilot.js.map +1 -1
- package/dist/providers/email/headers.d.ts +15 -0
- package/dist/providers/email/headers.d.ts.map +1 -0
- package/dist/providers/email/headers.js +42 -0
- package/dist/providers/email/headers.js.map +1 -0
- package/dist/providers/email/index.d.ts +18 -0
- package/dist/providers/email/index.d.ts.map +1 -0
- package/dist/providers/email/index.js +60 -0
- package/dist/providers/email/index.js.map +1 -0
- package/dist/providers/email/provider.d.ts +49 -0
- package/dist/providers/email/provider.d.ts.map +1 -0
- package/dist/providers/email/provider.js +2 -0
- package/dist/providers/email/provider.js.map +1 -0
- package/dist/providers/email/sendgrid.d.ts +12 -0
- package/dist/providers/email/sendgrid.d.ts.map +1 -0
- package/dist/providers/email/sendgrid.js +67 -0
- package/dist/providers/email/sendgrid.js.map +1 -0
- package/dist/providers/email/smtp.d.ts +65 -0
- package/dist/providers/email/smtp.d.ts.map +1 -0
- package/dist/providers/email/smtp.js +373 -0
- package/dist/providers/email/smtp.js.map +1 -0
- package/dist/providers/gemini.d.ts +13 -2
- package/dist/providers/gemini.d.ts.map +1 -1
- package/dist/providers/gemini.js +49 -5
- package/dist/providers/gemini.js.map +1 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +3 -0
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/none.d.ts +61 -0
- package/dist/providers/none.d.ts.map +1 -0
- package/dist/providers/none.js +124 -0
- package/dist/providers/none.js.map +1 -0
- package/dist/providers/opencode.d.ts +14 -2
- package/dist/providers/opencode.d.ts.map +1 -1
- package/dist/providers/opencode.js +104 -4
- package/dist/providers/opencode.js.map +1 -1
- package/dist/providers/provider.d.ts +156 -1
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/provider.js +54 -0
- package/dist/providers/provider.js.map +1 -1
- package/dist/services/agent-provisioner.d.ts +3 -3
- package/dist/services/agent-provisioner.d.ts.map +1 -1
- package/dist/services/agent-provisioner.js +11 -7
- package/dist/services/agent-provisioner.js.map +1 -1
- package/dist/services/auth-socket.d.ts.map +1 -1
- package/dist/services/auth-socket.js +2 -0
- package/dist/services/auth-socket.js.map +1 -1
- package/dist/services/budget-awareness.d.ts +130 -0
- package/dist/services/budget-awareness.d.ts.map +1 -0
- package/dist/services/budget-awareness.js +129 -0
- package/dist/services/budget-awareness.js.map +1 -0
- package/dist/services/cloud/lifecycle.d.ts.map +1 -1
- package/dist/services/cloud/lifecycle.js +3 -0
- package/dist/services/cloud/lifecycle.js.map +1 -1
- package/dist/services/cloud/task-wrapper.d.ts +18 -0
- package/dist/services/cloud/task-wrapper.d.ts.map +1 -1
- package/dist/services/cloud/task-wrapper.js +157 -0
- package/dist/services/cloud/task-wrapper.js.map +1 -1
- package/dist/services/cloud-sync.d.ts +35 -0
- package/dist/services/cloud-sync.d.ts.map +1 -0
- package/dist/services/cloud-sync.js +90 -0
- package/dist/services/cloud-sync.js.map +1 -0
- package/dist/services/context-admission.d.ts +82 -0
- package/dist/services/context-admission.d.ts.map +1 -0
- package/dist/services/context-admission.js +136 -0
- package/dist/services/context-admission.js.map +1 -0
- package/dist/services/event-bus.d.ts +27 -0
- package/dist/services/event-bus.d.ts.map +1 -0
- package/dist/services/event-bus.js +20 -0
- package/dist/services/event-bus.js.map +1 -0
- package/dist/services/file-chunker.d.ts +38 -0
- package/dist/services/file-chunker.d.ts.map +1 -0
- package/dist/services/file-chunker.js +63 -0
- package/dist/services/file-chunker.js.map +1 -0
- package/dist/services/file-transfer-relay.d.ts +55 -0
- package/dist/services/file-transfer-relay.d.ts.map +1 -0
- package/dist/services/file-transfer-relay.js +115 -0
- package/dist/services/file-transfer-relay.js.map +1 -0
- package/dist/services/github-app.d.ts.map +1 -1
- package/dist/services/github-app.js +12 -2
- package/dist/services/github-app.js.map +1 -1
- package/dist/services/http-transport.d.ts +25 -0
- package/dist/services/http-transport.d.ts.map +1 -0
- package/dist/services/http-transport.js +371 -0
- package/dist/services/http-transport.js.map +1 -0
- package/dist/services/hub-client.d.ts +69 -0
- package/dist/services/hub-client.d.ts.map +1 -0
- package/dist/services/hub-client.js +217 -0
- package/dist/services/hub-client.js.map +1 -0
- package/dist/services/jwt.d.ts +17 -0
- package/dist/services/jwt.d.ts.map +1 -0
- package/dist/services/jwt.js +70 -0
- package/dist/services/jwt.js.map +1 -0
- package/dist/services/knowledge/audn.d.ts +37 -0
- package/dist/services/knowledge/audn.d.ts.map +1 -0
- package/dist/services/knowledge/audn.js +219 -0
- package/dist/services/knowledge/audn.js.map +1 -0
- package/dist/services/knowledge/file-hash.d.ts +11 -0
- package/dist/services/knowledge/file-hash.d.ts.map +1 -0
- package/dist/services/knowledge/file-hash.js +123 -0
- package/dist/services/knowledge/file-hash.js.map +1 -0
- package/dist/services/knowledge/http-provider.d.ts +46 -0
- package/dist/services/knowledge/http-provider.d.ts.map +1 -0
- package/dist/services/knowledge/http-provider.js +254 -0
- package/dist/services/knowledge/http-provider.js.map +1 -0
- package/dist/services/knowledge/kb-providers.d.ts +15 -0
- package/dist/services/knowledge/kb-providers.d.ts.map +1 -0
- package/dist/services/knowledge/kb-providers.js +92 -0
- package/dist/services/knowledge/kb-providers.js.map +1 -0
- package/dist/services/knowledge/kb-scope-input.d.ts +5 -0
- package/dist/services/knowledge/kb-scope-input.d.ts.map +1 -0
- package/dist/services/knowledge/kb-scope-input.js +11 -0
- package/dist/services/knowledge/kb-scope-input.js.map +1 -0
- package/dist/services/knowledge/kb-service.d.ts +3 -0
- package/dist/services/knowledge/kb-service.d.ts.map +1 -0
- package/dist/services/knowledge/kb-service.js +2 -0
- package/dist/services/knowledge/kb-service.js.map +1 -0
- package/dist/services/knowledge/path-validation.d.ts +2 -0
- package/dist/services/knowledge/path-validation.d.ts.map +1 -0
- package/dist/services/knowledge/path-validation.js +13 -0
- package/dist/services/knowledge/path-validation.js.map +1 -0
- package/dist/services/knowledge/pre-init.d.ts +14 -0
- package/dist/services/knowledge/pre-init.d.ts.map +1 -0
- package/dist/services/knowledge/pre-init.js +147 -0
- package/dist/services/knowledge/pre-init.js.map +1 -0
- package/dist/services/knowledge/project-slug.d.ts +2 -0
- package/dist/services/knowledge/project-slug.d.ts.map +1 -0
- package/dist/services/knowledge/project-slug.js +49 -0
- package/dist/services/knowledge/project-slug.js.map +1 -0
- package/dist/services/knowledge/sqlite-provider.d.ts +147 -0
- package/dist/services/knowledge/sqlite-provider.d.ts.map +1 -0
- package/dist/services/knowledge/sqlite-provider.js +1646 -0
- package/dist/services/knowledge/sqlite-provider.js.map +1 -0
- package/dist/services/knowledge/types.d.ts +163 -0
- package/dist/services/knowledge/types.d.ts.map +1 -0
- package/dist/services/knowledge/types.js +9 -0
- package/dist/services/knowledge/types.js.map +1 -0
- package/dist/services/known-sessions.d.ts +8 -0
- package/dist/services/known-sessions.d.ts.map +1 -0
- package/dist/services/known-sessions.js +40 -0
- package/dist/services/known-sessions.js.map +1 -0
- package/dist/services/member-home.d.ts +89 -0
- package/dist/services/member-home.d.ts.map +1 -0
- package/dist/services/member-home.js +256 -0
- package/dist/services/member-home.js.map +1 -0
- package/dist/services/member-remote-url.d.ts +34 -0
- package/dist/services/member-remote-url.d.ts.map +1 -0
- package/dist/services/member-remote-url.js +39 -0
- package/dist/services/member-remote-url.js.map +1 -0
- package/dist/services/model-pricing.d.ts +36 -0
- package/dist/services/model-pricing.d.ts.map +1 -0
- package/dist/services/model-pricing.js +108 -0
- package/dist/services/model-pricing.js.map +1 -0
- package/dist/services/orphan-recovery.d.ts +59 -0
- package/dist/services/orphan-recovery.d.ts.map +1 -0
- package/dist/services/orphan-recovery.js +122 -0
- package/dist/services/orphan-recovery.js.map +1 -0
- package/dist/services/pending-responses.d.ts +23 -0
- package/dist/services/pending-responses.d.ts.map +1 -0
- package/dist/services/pending-responses.js +52 -0
- package/dist/services/pending-responses.js.map +1 -0
- package/dist/services/preflight-check.d.ts +56 -0
- package/dist/services/preflight-check.d.ts.map +1 -0
- package/dist/services/preflight-check.js +277 -0
- package/dist/services/preflight-check.js.map +1 -0
- package/dist/services/registry.d.ts +4 -1
- package/dist/services/registry.d.ts.map +1 -1
- package/dist/services/registry.js +3 -0
- package/dist/services/registry.js.map +1 -1
- package/dist/services/relay-context.d.ts +23 -0
- package/dist/services/relay-context.d.ts.map +1 -0
- package/dist/services/relay-context.js +8 -0
- package/dist/services/relay-context.js.map +1 -0
- package/dist/services/relay-executor.d.ts +68 -0
- package/dist/services/relay-executor.d.ts.map +1 -0
- package/dist/services/relay-executor.js +70 -0
- package/dist/services/relay-executor.js.map +1 -0
- package/dist/services/relay-request.d.ts +65 -0
- package/dist/services/relay-request.d.ts.map +1 -0
- package/dist/services/relay-request.js +129 -0
- package/dist/services/relay-request.js.map +1 -0
- package/dist/services/relay-strategy.d.ts +19 -0
- package/dist/services/relay-strategy.d.ts.map +1 -0
- package/dist/services/relay-strategy.js +111 -0
- package/dist/services/relay-strategy.js.map +1 -0
- package/dist/services/service-manager/index.d.ts +5 -0
- package/dist/services/service-manager/index.d.ts.map +1 -0
- package/dist/services/service-manager/index.js +66 -0
- package/dist/services/service-manager/index.js.map +1 -0
- package/dist/services/service-manager/linux.d.ts +10 -0
- package/dist/services/service-manager/linux.d.ts.map +1 -0
- package/dist/services/service-manager/linux.js +97 -0
- package/dist/services/service-manager/linux.js.map +1 -0
- package/dist/services/service-manager/macos.d.ts +10 -0
- package/dist/services/service-manager/macos.d.ts.map +1 -0
- package/dist/services/service-manager/macos.js +94 -0
- package/dist/services/service-manager/macos.js.map +1 -0
- package/dist/services/service-manager/types.d.ts +18 -0
- package/dist/services/service-manager/types.d.ts.map +1 -0
- package/dist/services/service-manager/types.js +5 -0
- package/dist/services/service-manager/types.js.map +1 -0
- package/dist/services/service-manager/windows.d.ts +10 -0
- package/dist/services/service-manager/windows.d.ts.map +1 -0
- package/dist/services/service-manager/windows.js +73 -0
- package/dist/services/service-manager/windows.js.map +1 -0
- package/dist/services/session-registry.d.ts +70 -0
- package/dist/services/session-registry.d.ts.map +1 -0
- package/dist/services/session-registry.js +91 -0
- package/dist/services/session-registry.js.map +1 -0
- package/dist/services/singleton.d.ts +15 -0
- package/dist/services/singleton.d.ts.map +1 -0
- package/dist/services/singleton.js +98 -0
- package/dist/services/singleton.js.map +1 -0
- package/dist/services/sprint-coordination.d.ts +168 -0
- package/dist/services/sprint-coordination.d.ts.map +1 -0
- package/dist/services/sprint-coordination.js +564 -0
- package/dist/services/sprint-coordination.js.map +1 -0
- package/dist/services/ssh.d.ts.map +1 -1
- package/dist/services/ssh.js +70 -3
- package/dist/services/ssh.js.map +1 -1
- package/dist/services/stall/log-path-resolver.d.ts +11 -8
- package/dist/services/stall/log-path-resolver.d.ts.map +1 -1
- package/dist/services/stall/log-path-resolver.js +17 -33
- package/dist/services/stall/log-path-resolver.js.map +1 -1
- package/dist/services/stall/stall-detector.d.ts +32 -0
- package/dist/services/stall/stall-detector.d.ts.map +1 -1
- package/dist/services/stall/stall-detector.js +187 -12
- package/dist/services/stall/stall-detector.js.map +1 -1
- package/dist/services/stall/stall-poller.d.ts +50 -0
- package/dist/services/stall/stall-poller.d.ts.map +1 -1
- package/dist/services/stall/stall-poller.js +268 -18
- package/dist/services/stall/stall-poller.js.map +1 -1
- package/dist/services/strategy.d.ts.map +1 -1
- package/dist/services/strategy.js +57 -7
- package/dist/services/strategy.js.map +1 -1
- package/dist/services/substitution-engine.d.ts +20 -0
- package/dist/services/substitution-engine.d.ts.map +1 -0
- package/dist/services/substitution-engine.js +92 -0
- package/dist/services/substitution-engine.js.map +1 -0
- package/dist/services/task-cleanup.d.ts.map +1 -1
- package/dist/services/task-cleanup.js +1 -9
- package/dist/services/task-cleanup.js.map +1 -1
- package/dist/services/token-issuer.d.ts +47 -0
- package/dist/services/token-issuer.d.ts.map +1 -0
- package/dist/services/token-issuer.js +63 -0
- package/dist/services/token-issuer.js.map +1 -0
- package/dist/services/tool-registry.d.ts +3 -0
- package/dist/services/tool-registry.d.ts.map +1 -0
- package/dist/services/tool-registry.js +225 -0
- package/dist/services/tool-registry.js.map +1 -0
- package/dist/services/user-config.d.ts +14 -0
- package/dist/services/user-config.d.ts.map +1 -1
- package/dist/services/user-config.js +55 -0
- package/dist/services/user-config.js.map +1 -1
- package/dist/services/vcs/github.d.ts.map +1 -1
- package/dist/services/vcs/github.js +32 -1
- package/dist/services/vcs/github.js.map +1 -1
- package/dist/services/vcs/types.d.ts +44 -0
- package/dist/services/vcs/types.d.ts.map +1 -1
- package/dist/services/version-check.d.ts +22 -0
- package/dist/services/version-check.d.ts.map +1 -0
- package/dist/services/version-check.js +103 -0
- package/dist/services/version-check.js.map +1 -0
- package/dist/skills/fleet-sprint-cli/SKILL.md +114 -0
- package/dist/skills/pm/beads.md +6 -0
- package/dist/skills/pm/cost.md +3 -0
- package/dist/skills/pm/doer-reviewer-loop.md +3 -0
- package/dist/skills/pm/fleet-addendum.md +6 -0
- package/dist/skills/pm/index.md +56 -0
- package/dist/skills/pm/kb-reconcile.md +132 -0
- package/dist/skills/pm/kb-review.md +109 -0
- package/dist/tools/check-status.d.ts +47 -0
- package/dist/tools/check-status.d.ts.map +1 -1
- package/dist/tools/check-status.js +250 -2
- package/dist/tools/check-status.js.map +1 -1
- package/dist/tools/child-id-allocator.d.ts +45 -0
- package/dist/tools/child-id-allocator.d.ts.map +1 -0
- package/dist/tools/child-id-allocator.js +62 -0
- package/dist/tools/child-id-allocator.js.map +1 -0
- package/dist/tools/cloud-control.d.ts +2 -2
- package/dist/tools/code-intelligence-codebase-memory.d.ts +11 -0
- package/dist/tools/code-intelligence-codebase-memory.d.ts.map +1 -0
- package/dist/tools/code-intelligence-codebase-memory.js +270 -0
- package/dist/tools/code-intelligence-codebase-memory.js.map +1 -0
- package/dist/tools/code-intelligence-freshness.d.ts +2 -0
- package/dist/tools/code-intelligence-freshness.d.ts.map +1 -0
- package/dist/tools/code-intelligence-freshness.js +26 -0
- package/dist/tools/code-intelligence-freshness.js.map +1 -0
- package/dist/tools/code-intelligence-gitnexus.d.ts +14 -0
- package/dist/tools/code-intelligence-gitnexus.d.ts.map +1 -0
- package/dist/tools/code-intelligence-gitnexus.js +475 -0
- package/dist/tools/code-intelligence-gitnexus.js.map +1 -0
- package/dist/tools/code-intelligence-kb-enrich.d.ts +2 -0
- package/dist/tools/code-intelligence-kb-enrich.d.ts.map +1 -0
- package/dist/tools/code-intelligence-kb-enrich.js +65 -0
- package/dist/tools/code-intelligence-kb-enrich.js.map +1 -0
- package/dist/tools/code-intelligence-reindex.d.ts +7 -0
- package/dist/tools/code-intelligence-reindex.d.ts.map +1 -0
- package/dist/tools/code-intelligence-reindex.js +106 -0
- package/dist/tools/code-intelligence-reindex.js.map +1 -0
- package/dist/tools/code-intelligence-telemetry.d.ts +5 -0
- package/dist/tools/code-intelligence-telemetry.d.ts.map +1 -0
- package/dist/tools/code-intelligence-telemetry.js +52 -0
- package/dist/tools/code-intelligence-telemetry.js.map +1 -0
- package/dist/tools/code-intelligence-tests.d.ts +2 -0
- package/dist/tools/code-intelligence-tests.d.ts.map +1 -0
- package/dist/tools/code-intelligence-tests.js +24 -0
- package/dist/tools/code-intelligence-tests.js.map +1 -0
- package/dist/tools/code-intelligence.d.ts +114 -0
- package/dist/tools/code-intelligence.d.ts.map +1 -0
- package/dist/tools/code-intelligence.js +124 -0
- package/dist/tools/code-intelligence.js.map +1 -0
- package/dist/tools/compose-permissions.d.ts +38 -4
- package/dist/tools/compose-permissions.d.ts.map +1 -1
- package/dist/tools/compose-permissions.js +295 -33
- package/dist/tools/compose-permissions.js.map +1 -1
- package/dist/tools/dolt-push-mutex.d.ts +44 -0
- package/dist/tools/dolt-push-mutex.d.ts.map +1 -0
- package/dist/tools/dolt-push-mutex.js +83 -0
- package/dist/tools/dolt-push-mutex.js.map +1 -0
- package/dist/tools/execute-command.d.ts +13 -1
- package/dist/tools/execute-command.d.ts.map +1 -1
- package/dist/tools/execute-command.js +108 -21
- package/dist/tools/execute-command.js.map +1 -1
- package/dist/tools/execute-prompt.d.ts +84 -12
- package/dist/tools/execute-prompt.d.ts.map +1 -1
- package/dist/tools/execute-prompt.js +1191 -88
- package/dist/tools/execute-prompt.js.map +1 -1
- package/dist/tools/get-member-model-pricing.d.ts +21 -0
- package/dist/tools/get-member-model-pricing.d.ts.map +1 -0
- package/dist/tools/get-member-model-pricing.js +29 -0
- package/dist/tools/get-member-model-pricing.js.map +1 -0
- package/dist/tools/kb-capture.d.ts +53 -0
- package/dist/tools/kb-capture.d.ts.map +1 -0
- package/dist/tools/kb-capture.js +130 -0
- package/dist/tools/kb-capture.js.map +1 -0
- package/dist/tools/kb-context.d.ts +17 -0
- package/dist/tools/kb-context.d.ts.map +1 -0
- package/dist/tools/kb-context.js +29 -0
- package/dist/tools/kb-context.js.map +1 -0
- package/dist/tools/kb-export.d.ts +19 -0
- package/dist/tools/kb-export.d.ts.map +1 -0
- package/dist/tools/kb-export.js +344 -0
- package/dist/tools/kb-export.js.map +1 -0
- package/dist/tools/kb-feedback.d.ts +23 -0
- package/dist/tools/kb-feedback.d.ts.map +1 -0
- package/dist/tools/kb-feedback.js +43 -0
- package/dist/tools/kb-feedback.js.map +1 -0
- package/dist/tools/kb-freshness-sweep.d.ts +14 -0
- package/dist/tools/kb-freshness-sweep.d.ts.map +1 -0
- package/dist/tools/kb-freshness-sweep.js +29 -0
- package/dist/tools/kb-freshness-sweep.js.map +1 -0
- package/dist/tools/kb-harvest.d.ts +20 -0
- package/dist/tools/kb-harvest.d.ts.map +1 -0
- package/dist/tools/kb-harvest.js +143 -0
- package/dist/tools/kb-harvest.js.map +1 -0
- package/dist/tools/kb-import.d.ts +44 -0
- package/dist/tools/kb-import.d.ts.map +1 -0
- package/dist/tools/kb-import.js +239 -0
- package/dist/tools/kb-import.js.map +1 -0
- package/dist/tools/kb-invalidate.d.ts +19 -0
- package/dist/tools/kb-invalidate.d.ts.map +1 -0
- package/dist/tools/kb-invalidate.js +34 -0
- package/dist/tools/kb-invalidate.js.map +1 -0
- package/dist/tools/kb-list.d.ts +32 -0
- package/dist/tools/kb-list.d.ts.map +1 -0
- package/dist/tools/kb-list.js +43 -0
- package/dist/tools/kb-list.js.map +1 -0
- package/dist/tools/kb-promote.d.ts +20 -0
- package/dist/tools/kb-promote.d.ts.map +1 -0
- package/dist/tools/kb-promote.js +20 -0
- package/dist/tools/kb-promote.js.map +1 -0
- package/dist/tools/kb-query.d.ts +35 -0
- package/dist/tools/kb-query.d.ts.map +1 -0
- package/dist/tools/kb-query.js +111 -0
- package/dist/tools/kb-query.js.map +1 -0
- package/dist/tools/kb-reconcile-prefilter.d.ts +14 -0
- package/dist/tools/kb-reconcile-prefilter.d.ts.map +1 -0
- package/dist/tools/kb-reconcile-prefilter.js +26 -0
- package/dist/tools/kb-reconcile-prefilter.js.map +1 -0
- package/dist/tools/kb-resolve-contradiction.d.ts +23 -0
- package/dist/tools/kb-resolve-contradiction.d.ts.map +1 -0
- package/dist/tools/kb-resolve-contradiction.js +37 -0
- package/dist/tools/kb-resolve-contradiction.js.map +1 -0
- package/dist/tools/kb-session-prime.d.ts +26 -0
- package/dist/tools/kb-session-prime.d.ts.map +1 -0
- package/dist/tools/kb-session-prime.js +392 -0
- package/dist/tools/kb-session-prime.js.map +1 -0
- package/dist/tools/kb-setup.d.ts +20 -0
- package/dist/tools/kb-setup.d.ts.map +1 -0
- package/dist/tools/kb-setup.js +49 -0
- package/dist/tools/kb-setup.js.map +1 -0
- package/dist/tools/kb-stats.d.ts +20 -0
- package/dist/tools/kb-stats.d.ts.map +1 -0
- package/dist/tools/kb-stats.js +115 -0
- package/dist/tools/kb-stats.js.map +1 -0
- package/dist/tools/list-members.d.ts.map +1 -1
- package/dist/tools/list-members.js +39 -7
- package/dist/tools/list-members.js.map +1 -1
- package/dist/tools/member-detail.d.ts +1 -1
- package/dist/tools/member-detail.d.ts.map +1 -1
- package/dist/tools/member-detail.js +16 -2
- package/dist/tools/member-detail.js.map +1 -1
- package/dist/tools/member-reservation.d.ts +29 -0
- package/dist/tools/member-reservation.d.ts.map +1 -0
- package/dist/tools/member-reservation.js +71 -0
- package/dist/tools/member-reservation.js.map +1 -0
- package/dist/tools/monitor-task.d.ts.map +1 -1
- package/dist/tools/monitor-task.js +21 -3
- package/dist/tools/monitor-task.js.map +1 -1
- package/dist/tools/provision-auth.d.ts.map +1 -1
- package/dist/tools/provision-auth.js +10 -3
- package/dist/tools/provision-auth.js.map +1 -1
- package/dist/tools/provision-vcs-auth.d.ts +7 -7
- package/dist/tools/provision-vcs-auth.js +1 -1
- package/dist/tools/provision-vcs-auth.js.map +1 -1
- package/dist/tools/register-member.d.ts +20 -5
- package/dist/tools/register-member.d.ts.map +1 -1
- package/dist/tools/register-member.js +174 -6
- package/dist/tools/register-member.js.map +1 -1
- package/dist/tools/remove-member.d.ts +1 -1
- package/dist/tools/remove-member.d.ts.map +1 -1
- package/dist/tools/remove-member.js +17 -3
- package/dist/tools/remove-member.js.map +1 -1
- package/dist/tools/report-status.d.ts +33 -0
- package/dist/tools/report-status.d.ts.map +1 -0
- package/dist/tools/report-status.js +45 -0
- package/dist/tools/report-status.js.map +1 -0
- package/dist/tools/respond-to-message.d.ts +21 -0
- package/dist/tools/respond-to-message.d.ts.map +1 -0
- package/dist/tools/respond-to-message.js +23 -0
- package/dist/tools/respond-to-message.js.map +1 -0
- package/dist/tools/send-email.d.ts +69 -0
- package/dist/tools/send-email.d.ts.map +1 -0
- package/dist/tools/send-email.js +177 -0
- package/dist/tools/send-email.js.map +1 -0
- package/dist/tools/send-files.d.ts +3 -0
- package/dist/tools/send-files.d.ts.map +1 -1
- package/dist/tools/send-files.js +88 -8
- package/dist/tools/send-files.js.map +1 -1
- package/dist/tools/send-message.d.ts +27 -0
- package/dist/tools/send-message.d.ts.map +1 -0
- package/dist/tools/send-message.js +46 -0
- package/dist/tools/send-message.js.map +1 -0
- package/dist/tools/setup-ssh-key.d.ts.map +1 -1
- package/dist/tools/setup-ssh-key.js +2 -0
- package/dist/tools/setup-ssh-key.js.map +1 -1
- package/dist/tools/shutdown-server.d.ts +2 -0
- package/dist/tools/shutdown-server.d.ts.map +1 -1
- package/dist/tools/shutdown-server.js +19 -0
- package/dist/tools/shutdown-server.js.map +1 -1
- package/dist/tools/update-member.d.ts +11 -8
- package/dist/tools/update-member.d.ts.map +1 -1
- package/dist/tools/update-member.js +36 -2
- package/dist/tools/update-member.js.map +1 -1
- package/dist/types.d.ts +16 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/agent-helpers.d.ts +2 -1
- package/dist/utils/agent-helpers.d.ts.map +1 -1
- package/dist/utils/agent-helpers.js +7 -2
- package/dist/utils/agent-helpers.js.map +1 -1
- package/dist/utils/pid-helpers.d.ts +15 -0
- package/dist/utils/pid-helpers.d.ts.map +1 -1
- package/dist/utils/pid-helpers.js +23 -0
- package/dist/utils/pid-helpers.js.map +1 -1
- package/dist/utils/process-utils.d.ts +3 -0
- package/dist/utils/process-utils.d.ts.map +1 -0
- package/dist/utils/process-utils.js +42 -0
- package/dist/utils/process-utils.js.map +1 -0
- package/dist/utils/prompt-errors.d.ts +2 -1
- package/dist/utils/prompt-errors.d.ts.map +1 -1
- package/dist/utils/prompt-errors.js +13 -3
- package/dist/utils/prompt-errors.js.map +1 -1
- package/dist/utils/session-caller.d.ts +28 -0
- package/dist/utils/session-caller.d.ts.map +1 -0
- package/dist/utils/session-caller.js +24 -0
- package/dist/utils/session-caller.js.map +1 -0
- package/dist/utils/work-folder-validation.d.ts +39 -0
- package/dist/utils/work-folder-validation.d.ts.map +1 -0
- package/dist/utils/work-folder-validation.js +60 -0
- package/dist/utils/work-folder-validation.js.map +1 -0
- package/dist/utils/workspace-trust.d.ts +24 -0
- package/dist/utils/workspace-trust.d.ts.map +1 -0
- package/dist/utils/workspace-trust.js +35 -0
- package/dist/utils/workspace-trust.js.map +1 -0
- package/dist/workflows/auto-sprint.js +994 -91
- package/package.json +40 -9
- package/packages/apra-fleet-client/package.json +26 -0
- package/packages/apra-fleet-client/src/client/api.mjs +510 -0
- package/packages/apra-fleet-client/src/client/client.mjs +146 -0
- package/packages/apra-fleet-client/src/client/errors.mjs +71 -0
- package/packages/apra-fleet-client/src/client/factory.mjs +65 -0
- package/packages/apra-fleet-client/src/client/server-resolution.mjs +265 -0
- package/packages/apra-fleet-client/src/client/transport.mjs +327 -0
- package/packages/apra-fleet-se/apra-pm/agents/backlog-groomer.md +303 -0
- package/packages/apra-fleet-se/apra-pm/agents/ci-watcher.md +101 -0
- package/packages/apra-fleet-se/apra-pm/agents/deployer.md +151 -0
- package/packages/apra-fleet-se/apra-pm/agents/doer.md +259 -0
- package/packages/apra-fleet-se/apra-pm/agents/harvester.md +188 -0
- package/packages/apra-fleet-se/apra-pm/agents/integ-test-runner.md +332 -0
- package/packages/apra-fleet-se/apra-pm/agents/kb-reconciler.md +216 -0
- package/packages/apra-fleet-se/apra-pm/agents/plan-reviewer.md +201 -0
- package/packages/apra-fleet-se/apra-pm/agents/planner.md +322 -0
- package/packages/apra-fleet-se/apra-pm/agents/regression-test-runner.md +234 -0
- package/packages/apra-fleet-se/apra-pm/agents/reviewer.md +275 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/backlog-groomer-input.json +35 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/backlog-groomer-output.json +164 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/ci-watcher-input.json +26 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/ci-watcher-output.json +18 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/deployer-input.json +19 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/deployer-output.json +17 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/doer-input.json +25 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/doer-output.json +82 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/harvester-input.json +31 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/harvester-output.json +75 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/integ-test-runner-input.json +20 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/integ-test-runner-output.json +61 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/kb-reconciler-output.json +87 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/plan-reviewer-input.json +15 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/plan-reviewer-output.json +30 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/planner-output.json +65 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/regression-test-runner-input.json +15 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/regression-test-runner-output.json +50 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/reviewer-input.json +25 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/reviewer-output.json +135 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/SKILL.md +402 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/beads.md +148 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/cost.md +157 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/doer-reviewer-loop.md +300 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/fleet-addendum.md +127 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/index.md +56 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/kb-reconcile.md +132 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/kb-review.md +109 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/simple-sprint.md +65 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/sprint.md +327 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/worktrees.md +92 -0
- package/packages/apra-fleet-se/apra-pm/version.json +3 -0
- package/packages/apra-fleet-se/bin/cli.mjs +864 -0
- package/packages/apra-fleet-se/bin/serve.mjs +395 -0
- package/packages/apra-fleet-se/fleet-sprint/conflict-ladder.mjs +178 -0
- package/packages/apra-fleet-se/fleet-sprint/contracts.mjs +940 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-safety-guard.mjs +177 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/README.md +191 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/coach-role-design.md +23 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-manual-recovery-verified.md +256 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-sync-redesign.md +1482 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/escalate-to-llm-design.md +908 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/fleet-sprint-diagram.md +94 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/shared-orchestrator-reservation-design.md +399 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/stabilization-log.md +1125 -0
- package/packages/apra-fleet-se/fleet-sprint/dolt-literal-guard.mjs +72 -0
- package/packages/apra-fleet-se/fleet-sprint/dolt-settle.mjs +972 -0
- package/packages/apra-fleet-se/fleet-sprint/dolt-sync.mjs +1310 -0
- package/packages/apra-fleet-se/fleet-sprint/errors.mjs +616 -0
- package/packages/apra-fleet-se/fleet-sprint/full-db-fetch-guard.mjs +118 -0
- package/packages/apra-fleet-se/fleet-sprint/runner.js +10747 -0
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-sprint-cli/SKILL.md +114 -0
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-supervisor/SKILL.md +350 -0
- package/packages/apra-fleet-se/fleet-sprint/sprint-lock.mjs +140 -0
- package/packages/apra-fleet-se/fleet-sprint/sprint-progress.mjs +101 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-module.mjs +435 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/azure-devops.mjs +68 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/bitbucket.mjs +53 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/dolt.mjs +146 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/generic-git.mjs +176 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/github.mjs +235 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/index.mjs +218 -0
- package/packages/apra-fleet-se/fleet-sprint/viewer-extensions.mjs +942 -0
- package/packages/apra-fleet-se/package.json +29 -0
- package/packages/apra-fleet-se/workflow.json +1 -0
- package/packages/apra-fleet-workflow/package.json +30 -0
- package/packages/apra-fleet-workflow/src/viewer/command-output-cap.mjs +112 -0
- package/packages/apra-fleet-workflow/src/viewer/debounced-writer.mjs +153 -0
- package/packages/apra-fleet-workflow/src/viewer/html-utils.mjs +31 -0
- package/packages/apra-fleet-workflow/src/viewer/index.mjs +1439 -0
- package/packages/apra-fleet-workflow/src/viewer/lean-state.mjs +237 -0
- package/packages/apra-fleet-workflow/src/viewer/run-state-paths.mjs +130 -0
- package/packages/apra-fleet-workflow/src/viewer/run-title.mjs +60 -0
- package/packages/apra-fleet-workflow/src/viewer/sprint-state-paths.mjs +29 -0
- package/packages/apra-fleet-workflow/src/workflow/engine.mjs +200 -0
- package/packages/apra-fleet-workflow/src/workflow/errors.mjs +146 -0
- package/packages/apra-fleet-workflow/src/workflow/index.mjs +1727 -0
- package/packages/apra-fleet-workflow/src/workflow/journal.mjs +291 -0
- package/packages/apra-fleet-workflow/src/workflow/pricing.mjs +99 -0
- package/packages/apra-fleet-workflow/src/workflow/vetting.mjs +111 -0
- package/scripts/agy-transcript-reader.js +1 -0
- package/scripts/fleet-statusline.sh +17 -13
- package/skills/fleet/SKILL.md +37 -2
- package/skills/fleet/beads.md +14 -7
- package/skills/fleet/knowledge-agent.md +66 -0
- package/skills/fleet/permissions.md +76 -2
- package/skills/fleet/profiles/base-dev.json +11 -1
- package/skills/fleet/profiles/base-reviewer.json +9 -1
- package/skills/fleet/profiles/node.json +2 -2
- package/skills/fleet/profiles/tag-kb-reconciler.json +20 -0
- package/version.json +1 -1
- package/scripts/agy-settings-merge.js +0 -27
- /package/{dist → packages/apra-fleet-se/apra-pm}/agents/_shared/GRAPH-SEMANTICS.md +0 -0
package/dist/cli/install.js
CHANGED
|
@@ -3,8 +3,29 @@ import path from 'node:path';
|
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import { execSync, execFileSync } from 'node:child_process';
|
|
5
5
|
import { serverVersion } from '../version.js';
|
|
6
|
+
import { DEFAULT_PORT, LOG_FILE_PATH } from '../paths.js';
|
|
7
|
+
import { getServiceManager } from '../services/service-manager/index.js';
|
|
6
8
|
import { BIN_DIR, HOOKS_DIR, SCRIPTS_DIR, getProviderInstallConfig, readConfig, writeConfig, writeInstallConfig, PROVIDER_STANDARD_MODELS } from './config.js';
|
|
7
|
-
import { transformAgentForOpenCode } from './agent-transform.js';
|
|
9
|
+
import { transformAgentForOpenCode, transformAgentForAgy } from './agent-transform.js';
|
|
10
|
+
import { FLEET_DIR } from '../paths.js';
|
|
11
|
+
import { extractWorkflowSubsystemAssets } from './workflow-assets.js';
|
|
12
|
+
import { downloadAndExtractDolt, verifyDolt } from './dolt-install.js';
|
|
13
|
+
import { classifyRunningServer, getInstallDataDir } from './install-guard.js';
|
|
14
|
+
const realDoltStepDeps = { downloadAndExtractDolt, verifyDolt };
|
|
15
|
+
let doltStepDeps = realDoltStepDeps;
|
|
16
|
+
/** Test-only: inject fakes for the dolt CLI install step's download/verify calls. */
|
|
17
|
+
export function _setDoltStepDeps(overrides) {
|
|
18
|
+
doltStepDeps = { ...realDoltStepDeps, ...overrides };
|
|
19
|
+
}
|
|
20
|
+
/** Test-only: restore the real (non-mocked) dolt step dependencies. */
|
|
21
|
+
export function _resetDoltStepDeps() {
|
|
22
|
+
doltStepDeps = realDoltStepDeps;
|
|
23
|
+
}
|
|
24
|
+
function doltStepEnabled() {
|
|
25
|
+
if (process.env.NODE_ENV !== 'test')
|
|
26
|
+
return true;
|
|
27
|
+
return process.env.APRA_FLEET_ENABLE_DOLT_INSTALL === '1';
|
|
28
|
+
}
|
|
8
29
|
// Detect SEA mode
|
|
9
30
|
let _seaOverride = null;
|
|
10
31
|
/** Override isSea() result -- for tests only. Pass null to restore default. */
|
|
@@ -52,21 +73,33 @@ export function isNpmGlobalInstall() {
|
|
|
52
73
|
function getSeaAsset(key) {
|
|
53
74
|
const sea = require('node:sea');
|
|
54
75
|
const buf = sea.getAsset(key);
|
|
55
|
-
// getAsset returns ArrayBuffer
|
|
76
|
+
// getAsset returns ArrayBuffer - decode to string
|
|
56
77
|
return new TextDecoder().decode(buf);
|
|
57
78
|
}
|
|
58
79
|
function getSeaAssetBuffer(key) {
|
|
59
80
|
const sea = require('node:sea');
|
|
60
81
|
return Buffer.from(sea.getAsset(key));
|
|
61
82
|
}
|
|
62
|
-
// Claude-only helper skill
|
|
83
|
+
// Claude-only helper skill packaged alongside apra-pm's auto-sprint workflow --
|
|
63
84
|
// installed into <configDir>/skills/auto-sprint-args, mirrors apra-pm/install.mjs.
|
|
64
85
|
const AUTO_SPRINT_ARGS_SKILL_NAME = 'auto-sprint-args';
|
|
86
|
+
// Helper skill for the fleet-sprint workflow (`apra-fleet workflow
|
|
87
|
+
// fleet-sprint`), shipped inside the fleet-sprint package itself. NOT provider-
|
|
88
|
+
// specific: installed into <configDir>/skills/fleet-sprint-cli for every LLM
|
|
89
|
+
// provider (every provider's config layout is <configDir>/skills/<name>, same
|
|
90
|
+
// as the pm and fleet skills).
|
|
91
|
+
const FLEET_SPRINT_CLI_SKILL_NAME = 'fleet-sprint-cli';
|
|
92
|
+
const FLEET_SPRINT_CLI_SKILL_VENDOR_BASE = 'packages/apra-fleet-se/fleet-sprint/skills/fleet-sprint-cli';
|
|
93
|
+
// Helper skill for driving fleet-sprints via the supervisor HTTP API
|
|
94
|
+
// (start/check/kill), as opposed to FLEET_SPRINT_CLI_SKILL_NAME above (direct
|
|
95
|
+
// CLI invocation). Ships alongside it, same provider-agnostic rationale.
|
|
96
|
+
const FLEET_SUPERVISOR_SKILL_NAME = 'fleet-supervisor';
|
|
97
|
+
const FLEET_SUPERVISOR_SKILL_VENDOR_BASE = 'packages/apra-fleet-se/fleet-sprint/skills/fleet-supervisor';
|
|
65
98
|
import { fileURLToPath } from 'url';
|
|
66
99
|
import { dirname } from 'path';
|
|
67
100
|
const __filename = fileURLToPath(import.meta.url);
|
|
68
101
|
const __dirname = dirname(__filename);
|
|
69
|
-
// Find project root
|
|
102
|
+
// Find project root - works for both tsc (dist/cli/install.js) and esbuild (dist/sea-bundle.cjs)
|
|
70
103
|
function findProjectRoot() {
|
|
71
104
|
let dir = __dirname;
|
|
72
105
|
for (let i = 0; i < 5; i++) {
|
|
@@ -76,7 +109,7 @@ function findProjectRoot() {
|
|
|
76
109
|
}
|
|
77
110
|
throw new Error('Cannot find project root (version.json not found)');
|
|
78
111
|
}
|
|
79
|
-
// Collect files recursively
|
|
112
|
+
// Collect files recursively - used by dev-mode manifest generation
|
|
80
113
|
function collectFilesRec(dir, base, rootBase) {
|
|
81
114
|
const effectiveRootBase = rootBase ?? base;
|
|
82
115
|
const results = {};
|
|
@@ -94,39 +127,152 @@ function collectFilesRec(dir, base, rootBase) {
|
|
|
94
127
|
}
|
|
95
128
|
return results;
|
|
96
129
|
}
|
|
97
|
-
|
|
130
|
+
// Directory names excluded (recursively) when collecting a package tree for
|
|
131
|
+
// the workflow-runtime / agent-schemas / built-in-workflow sections -- mirrors
|
|
132
|
+
// scripts/gen-sea-config.mjs's PACKAGE_TREE_EXCLUDE_DIRS.
|
|
133
|
+
const PACKAGE_TREE_EXCLUDE_DIRS = new Set(['test', 'docs', 'scripts', 'examples']);
|
|
134
|
+
/**
|
|
135
|
+
* Resolve a runtime dependency's package directory by walking the node_modules
|
|
136
|
+
* chain upward from `root`, the way Node's own resolver does.
|
|
137
|
+
*
|
|
138
|
+
* Why this exists: gen-sea-config.mjs (the SEA parity source) can assume every
|
|
139
|
+
* runtime dep sits at `root/node_modules/<pkg>` because it always runs from the
|
|
140
|
+
* git/workspace checkout, where nothing is hoisted above the repo root. But
|
|
141
|
+
* buildDevManifest() also runs at `apra-fleet install` time inside a REAL
|
|
142
|
+
* npm-installed tree, where `root` is `node_modules/@apralabs/apra-fleet` and
|
|
143
|
+
* npm HOISTS shared deps (ajv, undici, fast-uri, ...) up to a PARENT
|
|
144
|
+
* node_modules. A fixed `root/node_modules/<pkg>` probe misses every hoisted
|
|
145
|
+
* dep there, so the whole workflow-runtime section fails its existsSync gate and
|
|
146
|
+
* silently drops out -- leaving `apra-fleet workflow fleet-sprint` dead with no
|
|
147
|
+
* error (the exact class of failure tests/install-dev-manifest.test.ts guards).
|
|
148
|
+
* Walking up the chain resolves the dep wherever npm actually placed it; in a
|
|
149
|
+
* dev checkout the first candidate (`root/node_modules/<pkg>`) still wins, so
|
|
150
|
+
* the manifest is byte-identical there. Returns null when the dep is nowhere on
|
|
151
|
+
* the chain.
|
|
152
|
+
*/
|
|
153
|
+
function resolveNodeModulesDir(root, pkg) {
|
|
154
|
+
let dir = root;
|
|
155
|
+
for (;;) {
|
|
156
|
+
const candidate = path.join(dir, 'node_modules', pkg);
|
|
157
|
+
if (fs.existsSync(candidate))
|
|
158
|
+
return candidate;
|
|
159
|
+
const parent = path.dirname(dir);
|
|
160
|
+
if (parent === dir)
|
|
161
|
+
return null; // reached filesystem root
|
|
162
|
+
dir = parent;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// Runtime deps of the workflow subsystem that live under node_modules (as
|
|
166
|
+
// opposed to the first-party packages/ trees). Each tuple is [package name on
|
|
167
|
+
// disk, manifest prefix]; the two coincide today but are kept explicit to
|
|
168
|
+
// mirror gen-sea-config.mjs's collectPackageTree(..., '<prefix>') calls exactly.
|
|
169
|
+
const WORKFLOW_RUNTIME_NODE_MODULES_DEPS = [
|
|
170
|
+
['ajv', 'ajv'],
|
|
171
|
+
['fast-deep-equal', 'fast-deep-equal'],
|
|
172
|
+
['fast-uri', 'fast-uri'],
|
|
173
|
+
['json-schema-traverse', 'json-schema-traverse'],
|
|
174
|
+
['require-from-string', 'require-from-string'],
|
|
175
|
+
// undici is a direct runtime dependency of apra-fleet-client's transport
|
|
176
|
+
// (packages/apra-fleet-client/src/client/transport.mjs). undici-types is a
|
|
177
|
+
// types-only peer dependency (no runtime require of it in undici's lib), so
|
|
178
|
+
// it is intentionally not bundled here.
|
|
179
|
+
['undici', 'undici'],
|
|
180
|
+
];
|
|
181
|
+
function collectFilesFilteredRec(dir, base, rootBase, excludeDirs) {
|
|
182
|
+
const results = {};
|
|
183
|
+
if (!fs.existsSync(dir))
|
|
184
|
+
return results;
|
|
185
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
186
|
+
if (entry.isDirectory() && excludeDirs.has(entry.name))
|
|
187
|
+
continue;
|
|
188
|
+
const fullPath = path.join(dir, entry.name);
|
|
189
|
+
const relPath = path.join(base, entry.name).replace(/\\/g, '/');
|
|
190
|
+
if (entry.isDirectory()) {
|
|
191
|
+
Object.assign(results, collectFilesFilteredRec(fullPath, relPath, rootBase, excludeDirs));
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
results[path.relative(rootBase, relPath).replace(/\\/g, '/')] = relPath;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return results;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Collects a package/module tree using its real root-relative path (so values
|
|
201
|
+
* stay valid `join(root, value)` disk paths -- and thus valid dev-mode
|
|
202
|
+
* extractAsset() keys), then re-keys the result under `manifestPrefix` so
|
|
203
|
+
* multiple trees merge into one manifest section without key collisions.
|
|
204
|
+
* Mirrors scripts/gen-sea-config.mjs's collectPackageTree exactly, so the
|
|
205
|
+
* namespaced keys install.ts's workflow-install step consumes are identical
|
|
206
|
+
* in dev mode and SEA mode.
|
|
207
|
+
*/
|
|
208
|
+
function collectPackageTree(root, sourceDir, manifestPrefix, excludeDirs = PACKAGE_TREE_EXCLUDE_DIRS) {
|
|
209
|
+
const rootRelBase = path.relative(root, sourceDir).replace(/\\/g, '/');
|
|
210
|
+
const raw = collectFilesFilteredRec(sourceDir, rootRelBase, rootRelBase, excludeDirs);
|
|
211
|
+
const results = {};
|
|
212
|
+
for (const [shortKey, diskPath] of Object.entries(raw)) {
|
|
213
|
+
results[`${manifestPrefix}/${shortKey}`] = diskPath;
|
|
214
|
+
}
|
|
215
|
+
return results;
|
|
216
|
+
}
|
|
217
|
+
// Exported for tests: the dev-mode manifest is what gates the entire workflow
|
|
218
|
+
// subsystem install, and its inputs are filesystem paths that can silently go
|
|
219
|
+
// stale when directories move (see agentSchemasDir below).
|
|
220
|
+
export function buildDevManifest(root) {
|
|
98
221
|
const hooks = {};
|
|
99
222
|
for (const entry of fs.readdirSync(path.join(root, 'hooks'))) {
|
|
100
223
|
hooks[entry] = `hooks/${entry}`;
|
|
101
224
|
}
|
|
102
225
|
const scripts = {};
|
|
103
|
-
for (const entry of fs.readdirSync(path.join(root, 'scripts'))) {
|
|
104
|
-
if (entry.
|
|
226
|
+
for (const entry of fs.readdirSync(path.join(root, 'scripts'), { withFileTypes: true })) {
|
|
227
|
+
if (!entry.isFile())
|
|
228
|
+
continue; // skip subdirectories (e.g. agent-doc-partials/)
|
|
229
|
+
if (entry.name.endsWith('.mjs'))
|
|
105
230
|
continue; // skip build scripts
|
|
106
|
-
scripts[entry] = `scripts/${entry}`;
|
|
231
|
+
scripts[entry.name] = `scripts/${entry.name}`;
|
|
107
232
|
}
|
|
108
|
-
// Source PM skills
|
|
109
|
-
//
|
|
110
|
-
|
|
111
|
-
const
|
|
233
|
+
// Source PM skills from apra-pm local package copy (dev mode), fall back to
|
|
234
|
+
// dist/ for npm global installs. Skills have no
|
|
235
|
+
// build-time resolution step, so reading directly is safe.
|
|
236
|
+
const vendorPmSkills = path.join(root, 'packages', 'apra-fleet-se', 'apra-pm', 'skills', 'pm');
|
|
112
237
|
const pmSkillsDir = fs.existsSync(vendorPmSkills) ? vendorPmSkills : path.join(root, 'dist', 'skills', 'pm');
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
const
|
|
238
|
+
const pmBase = fs.existsSync(vendorPmSkills) ? 'packages/apra-fleet-se/apra-pm/skills/pm' : 'dist/skills/pm';
|
|
239
|
+
// Read straight from the local package copy -- same as skills above.
|
|
240
|
+
const agentsDir = path.join(root, 'packages', 'apra-fleet-se', 'apra-pm', 'agents');
|
|
241
|
+
const agentsBase = 'packages/apra-fleet-se/apra-pm/agents';
|
|
116
242
|
const skills = collectFilesRec(pmSkillsDir, pmBase, pmBase);
|
|
117
243
|
const agents = collectFilesRec(agentsDir, agentsBase, agentsBase);
|
|
118
244
|
const fleetSkills = collectFilesRec(path.join(root, 'skills', 'fleet'), 'skills/fleet');
|
|
119
|
-
// auto-sprint-args helper skill (
|
|
245
|
+
// auto-sprint-args helper skill (packaged alongside apra-pm's auto-sprint workflow;
|
|
120
246
|
// claude-only install target, see the install flow's PM cost/workflow step).
|
|
121
|
-
const vendorArgsSkill = path.join(root, '
|
|
247
|
+
const vendorArgsSkill = path.join(root, 'packages', 'apra-fleet-se', 'apra-pm', '.claude', 'skills', 'auto-sprint-args');
|
|
122
248
|
const distArgsSkill = path.join(root, 'dist', 'skills', 'auto-sprint-args');
|
|
123
249
|
const argsSkillDir = fs.existsSync(vendorArgsSkill) ? vendorArgsSkill : distArgsSkill;
|
|
124
250
|
const argsSkillBase = fs.existsSync(vendorArgsSkill)
|
|
125
|
-
? '
|
|
251
|
+
? 'packages/apra-fleet-se/apra-pm/.claude/skills/auto-sprint-args'
|
|
126
252
|
: 'dist/skills/auto-sprint-args';
|
|
127
253
|
const autoSprintArgsSkill = collectFilesRec(argsSkillDir, argsSkillBase, argsSkillBase);
|
|
128
|
-
//
|
|
129
|
-
|
|
254
|
+
// fleet-sprint-cli helper skill (ships inside the fleet-sprint package;
|
|
255
|
+
// documents the `apra-fleet workflow fleet-sprint` CLI flag contract).
|
|
256
|
+
// Provider-agnostic -- installed for every LLM provider.
|
|
257
|
+
const vendorCliSkill = path.join(root, ...FLEET_SPRINT_CLI_SKILL_VENDOR_BASE.split('/'));
|
|
258
|
+
const distCliSkill = path.join(root, 'dist', 'skills', FLEET_SPRINT_CLI_SKILL_NAME);
|
|
259
|
+
const cliSkillDir = fs.existsSync(vendorCliSkill) ? vendorCliSkill : distCliSkill;
|
|
260
|
+
const cliSkillBase = fs.existsSync(vendorCliSkill)
|
|
261
|
+
? FLEET_SPRINT_CLI_SKILL_VENDOR_BASE
|
|
262
|
+
: `dist/skills/${FLEET_SPRINT_CLI_SKILL_NAME}`;
|
|
263
|
+
const fleetSprintCliSkill = collectFilesRec(cliSkillDir, cliSkillBase, cliSkillBase);
|
|
264
|
+
// fleet-supervisor helper skill (ships inside the fleet-sprint package;
|
|
265
|
+
// documents the supervisor HTTP API contract for starting/checking/killing
|
|
266
|
+
// sprints). Provider-agnostic -- installed for every LLM provider.
|
|
267
|
+
const vendorSupervisorSkill = path.join(root, ...FLEET_SUPERVISOR_SKILL_VENDOR_BASE.split('/'));
|
|
268
|
+
const distSupervisorSkill = path.join(root, 'dist', 'skills', FLEET_SUPERVISOR_SKILL_NAME);
|
|
269
|
+
const supervisorSkillDir = fs.existsSync(vendorSupervisorSkill) ? vendorSupervisorSkill : distSupervisorSkill;
|
|
270
|
+
const supervisorSkillBase = fs.existsSync(vendorSupervisorSkill)
|
|
271
|
+
? FLEET_SUPERVISOR_SKILL_VENDOR_BASE
|
|
272
|
+
: `dist/skills/${FLEET_SUPERVISOR_SKILL_NAME}`;
|
|
273
|
+
const fleetSupervisorSkill = collectFilesRec(supervisorSkillDir, supervisorSkillBase, supervisorSkillBase);
|
|
274
|
+
// Collect auto-sprint.js from apra-pm/.claude/workflows (or dist/workflows fallback)
|
|
275
|
+
const vendorWorkflows = path.join(root, 'packages', 'apra-fleet-se', 'apra-pm', '.claude', 'workflows');
|
|
130
276
|
const workflowsSrc = fs.existsSync(vendorWorkflows)
|
|
131
277
|
? vendorWorkflows
|
|
132
278
|
: path.join(root, 'dist', 'workflows');
|
|
@@ -138,12 +284,61 @@ function buildDevManifest(root) {
|
|
|
138
284
|
}
|
|
139
285
|
}
|
|
140
286
|
}
|
|
287
|
+
// Workflow subsystem parity (mirrors scripts/gen-sea-config.mjs) so `node
|
|
288
|
+
// dist/index.js install` behaves identically to the SEA binary. Each source
|
|
289
|
+
// tree is optional -- an npm global install missing any piece simply omits
|
|
290
|
+
// the section, same as an older SEA manifest built before this epic; the
|
|
291
|
+
// install step warns and skips. The first-party packages/ trees resolve
|
|
292
|
+
// relative to root (shipped inside the tarball by the files allowlist); the
|
|
293
|
+
// node_modules runtime deps resolve via resolveNodeModulesDir() so a real
|
|
294
|
+
// npm-installed tree (which hoists them above root) still finds them.
|
|
295
|
+
const workflowRuntimeDir = path.join(root, 'packages', 'apra-fleet-workflow');
|
|
296
|
+
const clientDir = path.join(root, 'packages', 'apra-fleet-client');
|
|
297
|
+
const resolvedRuntimeDeps = WORKFLOW_RUNTIME_NODE_MODULES_DEPS.map(([pkg, prefix]) => [prefix, resolveNodeModulesDir(root, pkg)]);
|
|
298
|
+
const allRuntimeDepsResolved = resolvedRuntimeDeps.every(([, dir]) => dir !== null);
|
|
299
|
+
let workflowRuntime;
|
|
300
|
+
if (fs.existsSync(workflowRuntimeDir) && fs.existsSync(clientDir) && allRuntimeDepsResolved) {
|
|
301
|
+
workflowRuntime = {
|
|
302
|
+
...collectPackageTree(root, workflowRuntimeDir, '@apralabs/apra-fleet-workflow'),
|
|
303
|
+
...collectPackageTree(root, clientDir, '@apralabs/apra-fleet-client'),
|
|
304
|
+
};
|
|
305
|
+
for (const [prefix, dir] of resolvedRuntimeDeps) {
|
|
306
|
+
Object.assign(workflowRuntime, collectPackageTree(root, dir, prefix));
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
const agentSchemasDir = path.join(root, 'packages', 'apra-fleet-se', 'apra-pm', 'agents', 'schemas');
|
|
310
|
+
let agentSchemas;
|
|
311
|
+
if (fs.existsSync(agentSchemasDir)) {
|
|
312
|
+
agentSchemas = collectPackageTree(root, agentSchemasDir, 'agentSchemas');
|
|
313
|
+
}
|
|
314
|
+
const fleetSprintDir = path.join(root, 'packages', 'apra-fleet-se');
|
|
315
|
+
const helloWorldDir = path.join(root, 'examples', 'workflows', 'hello-world');
|
|
316
|
+
let builtinWorkflows;
|
|
317
|
+
if (fs.existsSync(fleetSprintDir) || fs.existsSync(helloWorldDir)) {
|
|
318
|
+
builtinWorkflows = {
|
|
319
|
+
...(fs.existsSync(fleetSprintDir) ? collectPackageTree(root, fleetSprintDir, 'fleet-sprint') : {}),
|
|
320
|
+
...(fs.existsSync(helloWorldDir) ? collectPackageTree(root, helloWorldDir, 'hello-world') : {}),
|
|
321
|
+
};
|
|
322
|
+
}
|
|
141
323
|
const vf = JSON.parse(fs.readFileSync(path.join(root, 'version.json'), 'utf-8'));
|
|
142
|
-
return {
|
|
324
|
+
return {
|
|
325
|
+
version: vf.version, hooks, scripts, skills, fleetSkills, agents, workflows,
|
|
326
|
+
workflowRuntime, agentSchemas, builtinWorkflows, autoSprintArgsSkill,
|
|
327
|
+
fleetSprintCliSkill, fleetSupervisorSkill,
|
|
328
|
+
};
|
|
143
329
|
}
|
|
144
330
|
let _manifestOverride = null;
|
|
145
|
-
/** Inject a manifest for tests
|
|
331
|
+
/** Inject a manifest for tests - avoids SEA asset extraction. Pass null to restore default. */
|
|
146
332
|
export function _setManifestOverride(m) { _manifestOverride = m; }
|
|
333
|
+
/**
|
|
334
|
+
* Test-only escape hatch to exercise the real buildDevManifest() (against the
|
|
335
|
+
* real filesystem, not the mocked node:fs used elsewhere in
|
|
336
|
+
* tests/install-workflows.test.ts) so regressions like apra-fleet-eft.19
|
|
337
|
+
* (dev-mode install omitting undici from the workflowRuntime bundle) are
|
|
338
|
+
* caught by a direct assertion on the generated manifest, not just on the
|
|
339
|
+
* mocked-fs runInstall() flow.
|
|
340
|
+
*/
|
|
341
|
+
export function _buildDevManifestForTest(root) { return buildDevManifest(root); }
|
|
147
342
|
function loadManifest() {
|
|
148
343
|
if (_manifestOverride !== null)
|
|
149
344
|
return _manifestOverride;
|
|
@@ -168,9 +363,9 @@ export function loadAgentAssets() {
|
|
|
168
363
|
return results;
|
|
169
364
|
}
|
|
170
365
|
const root = findProjectRoot();
|
|
171
|
-
const vendorAgents = path.join(root, '
|
|
366
|
+
const vendorAgents = path.join(root, 'packages', 'apra-fleet-se', 'apra-pm', 'agents');
|
|
172
367
|
const agentsSrc = fs.existsSync(vendorAgents) ? vendorAgents : path.join(root, 'dist', 'agents');
|
|
173
|
-
const agentsBase = fs.existsSync(vendorAgents) ? '
|
|
368
|
+
const agentsBase = fs.existsSync(vendorAgents) ? 'packages/apra-fleet-se/apra-pm/agents' : 'dist/agents';
|
|
174
369
|
const collected = collectFilesRec(agentsSrc, agentsBase, agentsBase);
|
|
175
370
|
for (const [relPath, rootRelativeLabel] of Object.entries(collected)) {
|
|
176
371
|
results.push({ relPath, content: fs.readFileSync(path.join(root, rootRelativeLabel), 'utf-8') });
|
|
@@ -303,10 +498,23 @@ function mergePermissions(paths, extraPerms = []) {
|
|
|
303
498
|
}
|
|
304
499
|
writeConfig(paths, settings);
|
|
305
500
|
}
|
|
306
|
-
function configureStatusline(paths, scriptPath) {
|
|
501
|
+
function configureStatusline(paths, scriptPath, llm) {
|
|
307
502
|
const settings = readConfig(paths);
|
|
308
|
-
|
|
309
|
-
|
|
503
|
+
let command;
|
|
504
|
+
if (process.platform === 'win32') {
|
|
505
|
+
if (llm === 'agy') {
|
|
506
|
+
const gitBash = 'C:\\Program Files\\Git\\bin\\bash.exe';
|
|
507
|
+
const bashBin = fs.existsSync(gitBash) ? `"${gitBash}"` : 'bash';
|
|
508
|
+
const formattedScriptPath = scriptPath.replace(/\\/g, '/');
|
|
509
|
+
command = `${bashBin} "${formattedScriptPath}"`;
|
|
510
|
+
}
|
|
511
|
+
else {
|
|
512
|
+
command = `bash "${scriptPath}"`;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
else {
|
|
516
|
+
command = scriptPath;
|
|
517
|
+
}
|
|
310
518
|
settings.statusLine = {
|
|
311
519
|
type: 'command',
|
|
312
520
|
command,
|
|
@@ -353,20 +561,27 @@ function mergeCopilotConfig(paths, mcpConfig) {
|
|
|
353
561
|
function mergeOpenCodeConfig(paths, mcpConfig) {
|
|
354
562
|
const settings = readConfig(paths);
|
|
355
563
|
settings.mcp = settings.mcp || {};
|
|
356
|
-
settings.mcp['apra-fleet'] =
|
|
357
|
-
type: '
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
564
|
+
settings.mcp['apra-fleet'] = mcpConfig.url
|
|
565
|
+
? { type: 'remote', url: mcpConfig.url, enabled: true }
|
|
566
|
+
: {
|
|
567
|
+
type: 'local',
|
|
568
|
+
command: [mcpConfig.command, ...(mcpConfig.args || [])],
|
|
569
|
+
enabled: true,
|
|
570
|
+
};
|
|
361
571
|
writeConfig(paths, settings);
|
|
362
572
|
}
|
|
363
573
|
function mergeCodexConfig(paths, mcpConfig) {
|
|
364
574
|
const settings = readConfig(paths);
|
|
365
575
|
settings.mcp_servers = settings.mcp_servers || {};
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
576
|
+
if (mcpConfig.url) {
|
|
577
|
+
settings.mcp_servers['apra-fleet'] = { url: mcpConfig.url };
|
|
578
|
+
}
|
|
579
|
+
else {
|
|
580
|
+
settings.mcp_servers['apra-fleet'] = {
|
|
581
|
+
command: mcpConfig.command.replace(/\\/g, '/'),
|
|
582
|
+
args: mcpConfig.args.map((a) => a.replace(/\\/g, '/')),
|
|
583
|
+
};
|
|
584
|
+
}
|
|
370
585
|
writeConfig(paths, settings);
|
|
371
586
|
}
|
|
372
587
|
function run(cmd, opts) {
|
|
@@ -374,12 +589,25 @@ function run(cmd, opts) {
|
|
|
374
589
|
const shellOpt = process.platform === 'win32' ? { shell: 'cmd.exe' } : {};
|
|
375
590
|
execSync(cmd, { stdio: 'inherit', ...shellOpt, ...opts });
|
|
376
591
|
}
|
|
592
|
+
/** Is `cmd` resolvable on PATH? Used before shelling out to a provider's own
|
|
593
|
+
* CLI (e.g. `claude`) so a missing binary degrades to a clear warning
|
|
594
|
+
* instead of install crashing with a raw "Command failed" error. */
|
|
595
|
+
function isCommandAvailable(cmd) {
|
|
596
|
+
try {
|
|
597
|
+
const checkCmd = process.platform === 'win32' ? `where ${cmd}` : `command -v ${cmd}`;
|
|
598
|
+
execSync(checkCmd, { stdio: 'ignore' });
|
|
599
|
+
return true;
|
|
600
|
+
}
|
|
601
|
+
catch {
|
|
602
|
+
return false;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
377
605
|
export function isApraFleetRunning() {
|
|
378
606
|
try {
|
|
379
607
|
if (process.platform === 'win32') {
|
|
380
608
|
const out = execSync('tasklist /FI "IMAGENAME eq apra-fleet.exe" /NH /FO CSV', { encoding: 'utf-8', stdio: 'pipe' });
|
|
381
609
|
const currentPid = process.pid.toString();
|
|
382
|
-
// Each CSV line: "apra-fleet.exe","<PID>","..."
|
|
610
|
+
// Each CSV line: "apra-fleet.exe","<PID>","..." - exclude the current installer process
|
|
383
611
|
return out.split('\n').some(line => {
|
|
384
612
|
const match = line.match(/"apra-fleet\.exe","(\d+)"/);
|
|
385
613
|
return match !== null && match[1] !== currentPid;
|
|
@@ -397,13 +625,57 @@ export function isApraFleetRunning() {
|
|
|
397
625
|
return false;
|
|
398
626
|
}
|
|
399
627
|
}
|
|
400
|
-
export function killApraFleet() {
|
|
628
|
+
export function killApraFleet(signal = 'SIGTERM') {
|
|
401
629
|
if (process.platform === 'win32') {
|
|
630
|
+
// taskkill /F is already forceful -- no softer signal to escalate from,
|
|
631
|
+
// so SIGKILL escalation on Windows just reissues the same command.
|
|
402
632
|
execSync('taskkill /F /IM apra-fleet.exe', { stdio: 'ignore' });
|
|
403
633
|
}
|
|
404
634
|
else {
|
|
405
635
|
// -x = exact name match
|
|
406
|
-
|
|
636
|
+
const cmd = signal === 'SIGKILL' ? 'pkill -9 -x apra-fleet' : 'pkill -x apra-fleet';
|
|
637
|
+
execSync(cmd, { stdio: 'ignore' });
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
const PROD_INSTALL_FORCE_TIMING = { pollIntervalMs: 200, graceMs: 3000, killGraceMs: 2000 };
|
|
641
|
+
// Tests run with NODE_ENV=test (see tests/setup.ts) and don't fake these timers,
|
|
642
|
+
// so default to a much shorter window there to keep the suite fast, unless a
|
|
643
|
+
// test explicitly overrides via _setInstallForceTimingOverride() to exercise
|
|
644
|
+
// the escalation path directly.
|
|
645
|
+
const TEST_INSTALL_FORCE_TIMING = { pollIntervalMs: 2, graceMs: 20, killGraceMs: 20 };
|
|
646
|
+
let _installForceTimingOverride = null;
|
|
647
|
+
/** Test-only: override the poll/grace timing used by waitForApraFleetToStop(). Pass null to restore default. */
|
|
648
|
+
export function _setInstallForceTimingOverride(t) {
|
|
649
|
+
_installForceTimingOverride = t;
|
|
650
|
+
}
|
|
651
|
+
function installForceTiming() {
|
|
652
|
+
if (_installForceTimingOverride)
|
|
653
|
+
return _installForceTimingOverride;
|
|
654
|
+
return process.env.NODE_ENV === 'test' ? TEST_INSTALL_FORCE_TIMING : PROD_INSTALL_FORCE_TIMING;
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Wait for any non-installer apra-fleet process to exit after killApraFleet()
|
|
658
|
+
* sends SIGTERM. Polls isApraFleetRunning() over a grace window; if the
|
|
659
|
+
* process is still alive once the window elapses, escalates to SIGKILL and
|
|
660
|
+
* polls again over a second (shorter) window. Returns as soon as no
|
|
661
|
+
* non-installer apra-fleet process is detected, or once both windows have
|
|
662
|
+
* elapsed -- callers should not assume termination is guaranteed in the
|
|
663
|
+
* latter case (see apra-fleet-l7n.3 for surfacing that failure to the
|
|
664
|
+
* operator instead of asserting success).
|
|
665
|
+
*/
|
|
666
|
+
export async function waitForApraFleetToStop() {
|
|
667
|
+
const { pollIntervalMs, graceMs, killGraceMs } = installForceTiming();
|
|
668
|
+
let deadline = Date.now() + graceMs;
|
|
669
|
+
while (isApraFleetRunning() && Date.now() < deadline) {
|
|
670
|
+
await new Promise(resolve => setTimeout(resolve, pollIntervalMs));
|
|
671
|
+
}
|
|
672
|
+
if (!isApraFleetRunning())
|
|
673
|
+
return;
|
|
674
|
+
// Grace window elapsed and a non-installer apra-fleet process is still alive -- escalate.
|
|
675
|
+
killApraFleet('SIGKILL');
|
|
676
|
+
deadline = Date.now() + killGraceMs;
|
|
677
|
+
while (isApraFleetRunning() && Date.now() < deadline) {
|
|
678
|
+
await new Promise(resolve => setTimeout(resolve, pollIntervalMs));
|
|
407
679
|
}
|
|
408
680
|
}
|
|
409
681
|
/**
|
|
@@ -425,8 +697,31 @@ export function writeAgyWorkspaceOverlays(workFolder) {
|
|
|
425
697
|
fs.writeFileSync(filePath, '', { mode: 0o644 });
|
|
426
698
|
}
|
|
427
699
|
}
|
|
700
|
+
// T3.4 (F9b, D8): copy the repo's committed .fleet/kb-canonical-global.json
|
|
701
|
+
// (when present) into the shared global KB data dir
|
|
702
|
+
// (~/.apra-fleet/data/knowledge/global/kb-canonical-global.json) so EVERY
|
|
703
|
+
// project on this machine can see the platform-level global bible without
|
|
704
|
+
// carrying it in its own repo. NON-FATAL on every path: absent source file ->
|
|
705
|
+
// skip silently (not an error -- most repos never carry this file); any
|
|
706
|
+
// read/copy failure (permissions, disk full, malformed path) -> warn and
|
|
707
|
+
// continue. The installer must never fail because of the bible.
|
|
708
|
+
function copyGlobalBible(repoCwd) {
|
|
709
|
+
try {
|
|
710
|
+
const srcPath = path.join(repoCwd, '.fleet', 'kb-canonical-global.json');
|
|
711
|
+
if (!fs.existsSync(srcPath))
|
|
712
|
+
return;
|
|
713
|
+
const destDir = path.join(FLEET_DIR, 'knowledge', 'global');
|
|
714
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
715
|
+
const destPath = path.join(destDir, 'kb-canonical-global.json');
|
|
716
|
+
fs.copyFileSync(srcPath, destPath);
|
|
717
|
+
console.log(' [OK] Global knowledge bible copied to ' + destDir);
|
|
718
|
+
}
|
|
719
|
+
catch (err) {
|
|
720
|
+
console.warn(' [WARN] Global knowledge bible copy skipped:', err instanceof Error ? err.message : String(err));
|
|
721
|
+
}
|
|
722
|
+
}
|
|
428
723
|
export async function runInstall(args) {
|
|
429
|
-
// --help / -h guard
|
|
724
|
+
// --help / -h guard - must come first, before any side effects (#142)
|
|
430
725
|
if (args.includes('--help') || args.includes('-h')) {
|
|
431
726
|
console.log(`apra-fleet install
|
|
432
727
|
|
|
@@ -436,20 +731,28 @@ Usage:
|
|
|
436
731
|
apra-fleet install Install binary + hooks + statusline + MCP + fleet & PM skills (default)
|
|
437
732
|
apra-fleet install --skill all Same as bare install (all skills)
|
|
438
733
|
apra-fleet install --skill fleet Install fleet skill only
|
|
439
|
-
apra-fleet install --skill pm Install PM skill (also installs fleet
|
|
734
|
+
apra-fleet install --skill pm Install PM skill (also installs fleet -- PM depends on fleet)
|
|
440
735
|
apra-fleet install --skill none Skip skill installation
|
|
441
736
|
apra-fleet install --no-skill Same as --skill none
|
|
737
|
+
apra-fleet install --workflows none Skip installing the workflow runtime + built-in workflows
|
|
442
738
|
apra-fleet install --force Stop a running server before installing
|
|
443
739
|
apra-fleet install --llm <provider> Target LLM provider: claude (default), gemini, codex, copilot, agy, opencode
|
|
740
|
+
apra-fleet install --transport http Register MCP server with HTTP transport (default)
|
|
741
|
+
apra-fleet install --transport stdio Register MCP server with stdio transport (legacy)
|
|
444
742
|
apra-fleet install --help Show this help
|
|
445
743
|
|
|
446
744
|
Options:
|
|
447
745
|
--llm <provider> LLM provider to configure. Supported: claude, gemini, codex, copilot, agy, opencode.
|
|
448
746
|
Defaults to claude. Note: --llm gemini shows a warning about sequential
|
|
449
|
-
dispatch
|
|
747
|
+
dispatch -- Gemini does not support background agents, so fleet operations
|
|
450
748
|
run sequentially rather than in parallel.
|
|
749
|
+
--transport <mode> MCP transport to use: http (default) or stdio. HTTP uses the singleton
|
|
750
|
+
fleet server at http://localhost:7523/mcp. stdio runs fleet as a subprocess.
|
|
451
751
|
--skill <mode> Which skills to install: all (default), fleet, pm, or none.
|
|
452
752
|
--no-skill Alias for --skill none.
|
|
753
|
+
--workflows <mode> Which workflow assets to install: all (default) or none. Installs
|
|
754
|
+
~/.apra-fleet/node_modules (workflow runtime), /schemas (agent role
|
|
755
|
+
schemas), and /workflows/{fleet-sprint,hello-world} (built-in workflows).
|
|
453
756
|
--force Stop a running apra-fleet server before installing (SEA mode only).`);
|
|
454
757
|
process.exit(0);
|
|
455
758
|
return;
|
|
@@ -492,7 +795,7 @@ Options:
|
|
|
492
795
|
skillMode = nextArg;
|
|
493
796
|
}
|
|
494
797
|
else {
|
|
495
|
-
// --skill with no value
|
|
798
|
+
// --skill with no value - install both (backwards-compat)
|
|
496
799
|
skillMode = 'all';
|
|
497
800
|
}
|
|
498
801
|
}
|
|
@@ -501,11 +804,61 @@ Options:
|
|
|
501
804
|
if (args.includes('--no-skill')) {
|
|
502
805
|
skillMode = 'none';
|
|
503
806
|
}
|
|
807
|
+
let workflowsMode = 'all';
|
|
808
|
+
const workflowsEqualArg = args.find(a => a.startsWith('--workflows='));
|
|
809
|
+
if (workflowsEqualArg) {
|
|
810
|
+
const val = workflowsEqualArg.split('=')[1];
|
|
811
|
+
if (val === 'all' || val === 'none') {
|
|
812
|
+
workflowsMode = val;
|
|
813
|
+
}
|
|
814
|
+
else {
|
|
815
|
+
console.error(`Error: --workflows value must be one of: all, none (got "${val}")`);
|
|
816
|
+
process.exit(1);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
else {
|
|
820
|
+
const workflowsIdx = args.indexOf('--workflows');
|
|
821
|
+
if (workflowsIdx >= 0) {
|
|
822
|
+
const nextArg = args[workflowsIdx + 1];
|
|
823
|
+
if (nextArg === 'all' || nextArg === 'none') {
|
|
824
|
+
workflowsMode = nextArg;
|
|
825
|
+
}
|
|
826
|
+
else {
|
|
827
|
+
console.error(`Error: --workflows requires a value: all or none.`);
|
|
828
|
+
process.exit(1);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
504
832
|
// Parse --force flag
|
|
505
833
|
const force = args.includes('--force');
|
|
834
|
+
let transport = 'http';
|
|
835
|
+
const transportEqualArg = args.find(a => a.startsWith('--transport='));
|
|
836
|
+
if (transportEqualArg) {
|
|
837
|
+
const val = transportEqualArg.split('=')[1];
|
|
838
|
+
if (val === 'http' || val === 'stdio') {
|
|
839
|
+
transport = val;
|
|
840
|
+
}
|
|
841
|
+
else {
|
|
842
|
+
console.error(`Error: --transport value must be one of: http, stdio (got "${val}")`);
|
|
843
|
+
process.exit(1);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
else {
|
|
847
|
+
const transportIdx = args.indexOf('--transport');
|
|
848
|
+
if (transportIdx >= 0 && transportIdx < args.length - 1) {
|
|
849
|
+
const val = args[transportIdx + 1];
|
|
850
|
+
if (val === 'http' || val === 'stdio') {
|
|
851
|
+
transport = val;
|
|
852
|
+
}
|
|
853
|
+
else {
|
|
854
|
+
console.error(`Error: --transport value must be one of: http, stdio (got "${val}")`);
|
|
855
|
+
process.exit(1);
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
506
859
|
// Reject unknown flags to catch typos early
|
|
507
|
-
const knownFlagPrefixes = ['--llm=', '--skill='];
|
|
508
|
-
const knownFlagExact = new Set(['--llm', '--skill', '--no-skill', '--force', '--help', '-h']);
|
|
860
|
+
const knownFlagPrefixes = ['--llm=', '--skill=', '--transport=', '--workflows='];
|
|
861
|
+
const knownFlagExact = new Set(['--llm', '--skill', '--no-skill', '--workflows', '--force', '--transport', '--help', '-h']);
|
|
509
862
|
for (const a of args) {
|
|
510
863
|
if (knownFlagExact.has(a))
|
|
511
864
|
continue;
|
|
@@ -519,22 +872,45 @@ Options:
|
|
|
519
872
|
const installFleet = skillMode === 'fleet' || skillMode === 'pm' || skillMode === 'all';
|
|
520
873
|
const installPm = skillMode === 'pm' || skillMode === 'all';
|
|
521
874
|
const installAgents = installPm && paths.agentsDir !== undefined;
|
|
875
|
+
const installWorkflows = workflowsMode === 'all';
|
|
876
|
+
const serviceStep = isSea() && transport === 'http';
|
|
522
877
|
let totalSteps = (installFleet && installPm) ? 8 : installFleet ? 7 : installPm ? 8 : 6;
|
|
523
878
|
if (installAgents)
|
|
524
879
|
totalSteps++;
|
|
525
880
|
if (installPm)
|
|
526
881
|
totalSteps++; // cost.js extraction + workflow copy step
|
|
882
|
+
if (installWorkflows)
|
|
883
|
+
totalSteps++; // workflow-subsystem runtime/schemas/built-ins step
|
|
884
|
+
totalSteps++; // dolt CLI install step (apra-fleet-ire.3) -- unconditional, mirrors Beads step
|
|
885
|
+
totalSteps++; // KB + code intelligence setup -- unconditional, runs after Beads
|
|
886
|
+
if (serviceStep)
|
|
887
|
+
totalSteps++;
|
|
527
888
|
if (llm === 'gemini' && (installFleet || installPm)) {
|
|
528
|
-
console.warn(`\n
|
|
889
|
+
console.warn(`\n- Note: Gemini does not support background agents. If you plan to use Gemini as the\n PM/orchestrator, fleet operations will run sequentially (no parallel dispatch).\n For best orchestration performance, consider using Claude. See docs for details.\n`);
|
|
529
890
|
}
|
|
530
891
|
// --- Running-process guard (SEA + npm modes -- dev mode runs via node, not a managed binary) ---
|
|
531
|
-
|
|
892
|
+
//
|
|
893
|
+
// isApraFleetRunning() is OS-global on purpose (waitForApraFleetToStop() and
|
|
894
|
+
// uninstall.ts depend on that). It is only the cheap first filter here:
|
|
895
|
+
// classifyRunningServer() then decides whether the running server is actually
|
|
896
|
+
// relevant to THIS install -- recorded live in the target data dir, or running
|
|
897
|
+
// from the install prefix we are about to overwrite (ETXTBSY). An unrelated
|
|
898
|
+
// server (isolated HOME/APRA_FLEET_DATA_DIR/prefix, e.g. ci.yml's clean temp
|
|
899
|
+
// prefix step) no longer blocks the install. See apra-fleet-1aw.
|
|
900
|
+
const runningScope = (isSea() || isNpmGlobalInstall()) && isApraFleetRunning()
|
|
901
|
+
? classifyRunningServer(BIN_DIR)
|
|
902
|
+
: null;
|
|
903
|
+
if (runningScope && !runningScope.relevant) {
|
|
904
|
+
console.log(`\n Note: an unrelated apra-fleet server is running -- ${runningScope.detail}.\n It is not associated with this install (data dir ${getInstallDataDir()}, prefix ${BIN_DIR}), so it is left running.\n`);
|
|
905
|
+
}
|
|
906
|
+
if (runningScope?.relevant) {
|
|
532
907
|
if (!force) {
|
|
533
908
|
const killHint = process.platform === 'win32'
|
|
534
909
|
? ' taskkill /F /IM apra-fleet.exe'
|
|
535
910
|
: ' pkill -x apra-fleet';
|
|
536
911
|
console.error(`
|
|
537
912
|
Error: apra-fleet is currently running. Stop the server before installing.
|
|
913
|
+
(${runningScope.detail})
|
|
538
914
|
|
|
539
915
|
Run with --force to stop it automatically:
|
|
540
916
|
apra-fleet install --force
|
|
@@ -545,7 +921,15 @@ ${killHint}
|
|
|
545
921
|
process.exit(1);
|
|
546
922
|
}
|
|
547
923
|
killApraFleet();
|
|
548
|
-
await
|
|
924
|
+
await waitForApraFleetToStop();
|
|
925
|
+
if (isApraFleetRunning()) {
|
|
926
|
+
console.error(`
|
|
927
|
+
Error: could not stop the running apra-fleet server (it is still running after
|
|
928
|
+
SIGTERM and a SIGKILL escalation). Stop it manually before installing:
|
|
929
|
+
${process.platform === 'win32' ? ' taskkill /F /IM apra-fleet.exe' : ' pkill -x apra-fleet'}
|
|
930
|
+
`);
|
|
931
|
+
process.exit(1);
|
|
932
|
+
}
|
|
549
933
|
console.log(' Stopped running server.');
|
|
550
934
|
}
|
|
551
935
|
console.log(`\nInstalling Apra Fleet ${serverVersion} for ${paths.name}...\n`);
|
|
@@ -596,49 +980,93 @@ ${killHint}
|
|
|
596
980
|
const installedHooksConfig = JSON.parse(fs.readFileSync(path.join(HOOKS_DIR, 'hooks-config.json'), 'utf-8'));
|
|
597
981
|
mergeHooksConfig(paths, installedHooksConfig, llm);
|
|
598
982
|
const statuslineScript = path.join(SCRIPTS_DIR, 'fleet-statusline.sh');
|
|
599
|
-
configureStatusline(paths, statuslineScript);
|
|
983
|
+
configureStatusline(paths, statuslineScript, llm);
|
|
600
984
|
const standardModel = PROVIDER_STANDARD_MODELS[llm] ?? PROVIDER_STANDARD_MODELS['claude'];
|
|
601
985
|
writeDefaultModel(paths, standardModel);
|
|
602
986
|
}
|
|
603
987
|
// --- Step 5: Register MCP server ---
|
|
604
988
|
console.log(` [5/${totalSteps}] Registering MCP server...`);
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
989
|
+
const fleetPort = DEFAULT_PORT;
|
|
990
|
+
const fleetUrl = `http://localhost:${fleetPort}/mcp`;
|
|
991
|
+
if (transport === 'http') {
|
|
992
|
+
if (llm === 'claude') {
|
|
993
|
+
if (!isCommandAvailable('claude')) {
|
|
994
|
+
console.warn(` Warning: the 'claude' CLI was not found on PATH -- skipping MCP server registration.\n` +
|
|
995
|
+
` Install Claude Code (https://claude.com/claude-code), then re-run 'apra-fleet install'\n` +
|
|
996
|
+
` to register apra-fleet with it, or register manually with:\n` +
|
|
997
|
+
` claude mcp add --scope user --transport http apra-fleet ${fleetUrl}`);
|
|
998
|
+
}
|
|
999
|
+
else {
|
|
1000
|
+
try {
|
|
1001
|
+
run('claude mcp remove apra-fleet --scope user', { stdio: 'ignore' });
|
|
1002
|
+
}
|
|
1003
|
+
catch { /* not registered */ }
|
|
1004
|
+
run(`claude mcp add --scope user --transport http apra-fleet ${fleetUrl}`);
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
else if (llm === 'gemini') {
|
|
1008
|
+
mergeGeminiConfig(paths, { httpUrl: fleetUrl });
|
|
1009
|
+
}
|
|
1010
|
+
else if (llm === 'codex') {
|
|
1011
|
+
mergeCodexConfig(paths, { url: fleetUrl });
|
|
1012
|
+
}
|
|
1013
|
+
else if (llm === 'copilot') {
|
|
1014
|
+
mergeCopilotConfig(paths, { url: fleetUrl, type: 'http' });
|
|
1015
|
+
}
|
|
1016
|
+
else if (llm === 'agy') {
|
|
1017
|
+
mergeAgyConfig(paths, { url: fleetUrl });
|
|
1018
|
+
}
|
|
1019
|
+
else if (llm === 'opencode') {
|
|
1020
|
+
mergeOpenCodeConfig(paths, { url: fleetUrl });
|
|
616
1021
|
}
|
|
617
|
-
catch { /* not registered */ }
|
|
618
|
-
// Build the claude MCP command from the actual mcpConfig structure.
|
|
619
|
-
// All args are quoted and joined so paths with spaces (e.g. Windows "Program Files") work.
|
|
620
|
-
const quotedArgs = mcpConfig.args.map((a) => `"${a.replace(/"/g, '\\"')}"`).join(' ');
|
|
621
|
-
const cmd = `claude mcp add --scope user apra-fleet -- "${mcpConfig.command}" ${quotedArgs}`;
|
|
622
|
-
run(cmd);
|
|
623
|
-
}
|
|
624
|
-
else if (llm === 'gemini') {
|
|
625
|
-
mergeGeminiConfig(paths, mcpConfig);
|
|
626
|
-
}
|
|
627
|
-
else if (llm === 'codex') {
|
|
628
|
-
mergeCodexConfig(paths, mcpConfig);
|
|
629
|
-
}
|
|
630
|
-
else if (llm === 'copilot') {
|
|
631
|
-
mergeCopilotConfig(paths, mcpConfig);
|
|
632
|
-
}
|
|
633
|
-
else if (llm === 'agy') {
|
|
634
|
-
mergeAgyConfig(paths, mcpConfig);
|
|
635
1022
|
}
|
|
636
|
-
else
|
|
637
|
-
|
|
1023
|
+
else {
|
|
1024
|
+
// 'run --transport stdio' starts the stdio MCP server; passed as trailing args so
|
|
1025
|
+
// LLM providers invoke `apra-fleet run` (or `node dist/index.js run`) and the no-arg
|
|
1026
|
+
// default (installation) is never accidentally triggered by the MCP host.
|
|
1027
|
+
const mcpConfig = isSea()
|
|
1028
|
+
? { command: binaryPath, args: ['run', '--transport', 'stdio'] }
|
|
1029
|
+
: isNpmGlobalInstall()
|
|
1030
|
+
? { command: process.execPath, args: [process.argv[1], 'run', '--transport', 'stdio'] }
|
|
1031
|
+
: { command: 'node', args: [path.join(findProjectRoot(), 'dist', 'index.js'), 'run', '--transport', 'stdio'] };
|
|
1032
|
+
if (llm === 'claude') {
|
|
1033
|
+
// Build the claude MCP command from the actual mcpConfig structure.
|
|
1034
|
+
// All args are quoted and joined so paths with spaces (e.g. Windows "Program Files") work.
|
|
1035
|
+
const quotedArgs = mcpConfig.args.map((a) => `"${a.replace(/"/g, '\\"')}"`).join(' ');
|
|
1036
|
+
const cmd = `claude mcp add --scope user apra-fleet -- "${mcpConfig.command}" ${quotedArgs}`;
|
|
1037
|
+
if (!isCommandAvailable('claude')) {
|
|
1038
|
+
console.warn(` Warning: the 'claude' CLI was not found on PATH -- skipping MCP server registration.\n` +
|
|
1039
|
+
` Install Claude Code (https://claude.com/claude-code), then re-run 'apra-fleet install'\n` +
|
|
1040
|
+
` to register apra-fleet with it, or register manually with:\n` +
|
|
1041
|
+
` ${cmd}`);
|
|
1042
|
+
}
|
|
1043
|
+
else {
|
|
1044
|
+
try {
|
|
1045
|
+
run('claude mcp remove apra-fleet --scope user', { stdio: 'ignore' });
|
|
1046
|
+
}
|
|
1047
|
+
catch { /* not registered */ }
|
|
1048
|
+
run(cmd);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
else if (llm === 'gemini') {
|
|
1052
|
+
mergeGeminiConfig(paths, mcpConfig);
|
|
1053
|
+
}
|
|
1054
|
+
else if (llm === 'codex') {
|
|
1055
|
+
mergeCodexConfig(paths, mcpConfig);
|
|
1056
|
+
}
|
|
1057
|
+
else if (llm === 'copilot') {
|
|
1058
|
+
mergeCopilotConfig(paths, mcpConfig);
|
|
1059
|
+
}
|
|
1060
|
+
else if (llm === 'agy') {
|
|
1061
|
+
mergeAgyConfig(paths, mcpConfig);
|
|
1062
|
+
}
|
|
1063
|
+
else if (llm === 'opencode') {
|
|
1064
|
+
mergeOpenCodeConfig(paths, mcpConfig);
|
|
1065
|
+
}
|
|
638
1066
|
}
|
|
639
1067
|
// --- Step 6: Install fleet skill (optional) ---
|
|
640
1068
|
if (skillMode === 'pm') {
|
|
641
|
-
console.warn(`\n
|
|
1069
|
+
console.warn(`\n- Note: PM skill depends on fleet skill - installing fleet skill first.\n`);
|
|
642
1070
|
}
|
|
643
1071
|
if (installFleet) {
|
|
644
1072
|
console.log(` [6/${totalSteps}] Installing fleet skill...`);
|
|
@@ -657,20 +1085,6 @@ ${killHint}
|
|
|
657
1085
|
}
|
|
658
1086
|
}
|
|
659
1087
|
// --- Step 7: Install PM skill (optional) ---
|
|
660
|
-
// Empty-submodule guard: vendor/apra-pm dir exists but was not initialized
|
|
661
|
-
if (installPm && !isSea()) {
|
|
662
|
-
const root = findProjectRoot();
|
|
663
|
-
const vendorDir = path.join(root, 'vendor', 'apra-pm');
|
|
664
|
-
if (fs.existsSync(vendorDir)) {
|
|
665
|
-
const skillMarker = path.join(vendorDir, 'skills', 'pm', 'SKILL.md');
|
|
666
|
-
if (!fs.existsSync(skillMarker)) {
|
|
667
|
-
console.error(`Error: vendor/apra-pm exists but appears empty (non-recursive clone).
|
|
668
|
-
Run: git submodule update --init --recursive
|
|
669
|
-
Then re-run: apra-fleet install`);
|
|
670
|
-
process.exit(1);
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
1088
|
if (installPm) {
|
|
675
1089
|
console.log(` [7/${totalSteps}] Installing PM skill...`);
|
|
676
1090
|
clearDirSync(paths.skillsDir);
|
|
@@ -682,9 +1096,9 @@ Then re-run: apra-fleet install`);
|
|
|
682
1096
|
}
|
|
683
1097
|
}
|
|
684
1098
|
else {
|
|
685
|
-
// Dev/npm mode: prefer
|
|
1099
|
+
// Dev/npm mode: prefer apra-pm local copy, fall back to dist/
|
|
686
1100
|
const root = findProjectRoot();
|
|
687
|
-
const vendorPm = path.join(root, '
|
|
1101
|
+
const vendorPm = path.join(root, 'packages', 'apra-fleet-se', 'apra-pm', 'skills', 'pm');
|
|
688
1102
|
const pmSrc = fs.existsSync(vendorPm) ? vendorPm : path.join(root, 'dist', 'skills', 'pm');
|
|
689
1103
|
copyDirSync(pmSrc, paths.skillsDir);
|
|
690
1104
|
}
|
|
@@ -702,7 +1116,7 @@ Then re-run: apra-fleet install`);
|
|
|
702
1116
|
}
|
|
703
1117
|
else {
|
|
704
1118
|
const root = findProjectRoot();
|
|
705
|
-
const wfPath = path.join(root, '
|
|
1119
|
+
const wfPath = path.join(root, 'packages', 'apra-fleet-se', 'apra-pm', '.claude', 'workflows', 'auto-sprint.js');
|
|
706
1120
|
const wfFallback = path.join(root, 'dist', 'workflows', 'auto-sprint.js');
|
|
707
1121
|
const wfSrc = fs.existsSync(wfPath) ? wfPath : fs.existsSync(wfFallback) ? wfFallback : null;
|
|
708
1122
|
if (wfSrc)
|
|
@@ -761,11 +1175,11 @@ Then re-run: apra-fleet install`);
|
|
|
761
1175
|
}))
|
|
762
1176
|
: (() => {
|
|
763
1177
|
const root = findProjectRoot();
|
|
764
|
-
const vendorArgsSkill = path.join(root, '
|
|
1178
|
+
const vendorArgsSkill = path.join(root, 'packages', 'apra-fleet-se', 'apra-pm', '.claude', 'skills', AUTO_SPRINT_ARGS_SKILL_NAME);
|
|
765
1179
|
const distArgsSkill = path.join(root, 'dist', 'skills', AUTO_SPRINT_ARGS_SKILL_NAME);
|
|
766
1180
|
const argsSkillSrc = fs.existsSync(vendorArgsSkill) ? vendorArgsSkill : distArgsSkill;
|
|
767
1181
|
const argsSkillBase = fs.existsSync(vendorArgsSkill)
|
|
768
|
-
? `
|
|
1182
|
+
? `packages/apra-fleet-se/apra-pm/.claude/skills/${AUTO_SPRINT_ARGS_SKILL_NAME}`
|
|
769
1183
|
: `dist/skills/${AUTO_SPRINT_ARGS_SKILL_NAME}`;
|
|
770
1184
|
const collected = collectFilesRec(argsSkillSrc, argsSkillBase, argsSkillBase);
|
|
771
1185
|
return Object.entries(collected).map(([relPath, rootRelativeLabel]) => ({
|
|
@@ -784,6 +1198,76 @@ Then re-run: apra-fleet install`);
|
|
|
784
1198
|
}
|
|
785
1199
|
}
|
|
786
1200
|
}
|
|
1201
|
+
// --- fleet-sprint-cli helper skill (all providers) ---
|
|
1202
|
+
// Documents the `apra-fleet workflow fleet-sprint` CLI contract for any LLM
|
|
1203
|
+
// driving apra-fleet. Deliberately NOT gated on provider (every provider gets
|
|
1204
|
+
// it) and NOT gated on installPm (fleet-sprint ships independently of the PM
|
|
1205
|
+
// skill) -- only on "skills are being installed at all".
|
|
1206
|
+
if (installFleet || installPm) {
|
|
1207
|
+
const cliSkillDest = path.join(paths.configDir, 'skills', FLEET_SPRINT_CLI_SKILL_NAME);
|
|
1208
|
+
const cliSkillEntries = isSea()
|
|
1209
|
+
? Object.entries(manifest.fleetSprintCliSkill ?? {}).map(([relPath, assetKey]) => ({
|
|
1210
|
+
relPath,
|
|
1211
|
+
content: extractAsset(assetKey),
|
|
1212
|
+
}))
|
|
1213
|
+
: (() => {
|
|
1214
|
+
const root = findProjectRoot();
|
|
1215
|
+
const vendorCliSkill = path.join(root, ...FLEET_SPRINT_CLI_SKILL_VENDOR_BASE.split('/'));
|
|
1216
|
+
const distCliSkill = path.join(root, 'dist', 'skills', FLEET_SPRINT_CLI_SKILL_NAME);
|
|
1217
|
+
const cliSkillSrc = fs.existsSync(vendorCliSkill) ? vendorCliSkill : distCliSkill;
|
|
1218
|
+
const cliSkillBase = fs.existsSync(vendorCliSkill)
|
|
1219
|
+
? FLEET_SPRINT_CLI_SKILL_VENDOR_BASE
|
|
1220
|
+
: `dist/skills/${FLEET_SPRINT_CLI_SKILL_NAME}`;
|
|
1221
|
+
const collected = collectFilesRec(cliSkillSrc, cliSkillBase, cliSkillBase);
|
|
1222
|
+
return Object.entries(collected).map(([relPath, rootRelativeLabel]) => ({
|
|
1223
|
+
relPath,
|
|
1224
|
+
content: fs.readFileSync(path.join(root, rootRelativeLabel), 'utf-8'),
|
|
1225
|
+
}));
|
|
1226
|
+
})();
|
|
1227
|
+
if (cliSkillEntries.length > 0) {
|
|
1228
|
+
clearDirSync(cliSkillDest);
|
|
1229
|
+
for (const { relPath, content } of cliSkillEntries) {
|
|
1230
|
+
writeAssetFile(path.join(cliSkillDest, relPath), content);
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
else {
|
|
1234
|
+
console.warn(` [!] ${FLEET_SPRINT_CLI_SKILL_NAME} skill source not found -- skill not installed`);
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
// --- fleet-supervisor helper skill (all providers) ---
|
|
1238
|
+
// Documents the supervisor HTTP API contract for starting/checking/killing
|
|
1239
|
+
// sprints. Same gating as fleet-sprint-cli above.
|
|
1240
|
+
if (installFleet || installPm) {
|
|
1241
|
+
const supervisorSkillDest = path.join(paths.configDir, 'skills', FLEET_SUPERVISOR_SKILL_NAME);
|
|
1242
|
+
const supervisorSkillEntries = isSea()
|
|
1243
|
+
? Object.entries(manifest.fleetSupervisorSkill ?? {}).map(([relPath, assetKey]) => ({
|
|
1244
|
+
relPath,
|
|
1245
|
+
content: extractAsset(assetKey),
|
|
1246
|
+
}))
|
|
1247
|
+
: (() => {
|
|
1248
|
+
const root = findProjectRoot();
|
|
1249
|
+
const vendorSupervisorSkill = path.join(root, ...FLEET_SUPERVISOR_SKILL_VENDOR_BASE.split('/'));
|
|
1250
|
+
const distSupervisorSkill = path.join(root, 'dist', 'skills', FLEET_SUPERVISOR_SKILL_NAME);
|
|
1251
|
+
const supervisorSkillSrc = fs.existsSync(vendorSupervisorSkill) ? vendorSupervisorSkill : distSupervisorSkill;
|
|
1252
|
+
const supervisorSkillBase = fs.existsSync(vendorSupervisorSkill)
|
|
1253
|
+
? FLEET_SUPERVISOR_SKILL_VENDOR_BASE
|
|
1254
|
+
: `dist/skills/${FLEET_SUPERVISOR_SKILL_NAME}`;
|
|
1255
|
+
const collected = collectFilesRec(supervisorSkillSrc, supervisorSkillBase, supervisorSkillBase);
|
|
1256
|
+
return Object.entries(collected).map(([relPath, rootRelativeLabel]) => ({
|
|
1257
|
+
relPath,
|
|
1258
|
+
content: fs.readFileSync(path.join(root, rootRelativeLabel), 'utf-8'),
|
|
1259
|
+
}));
|
|
1260
|
+
})();
|
|
1261
|
+
if (supervisorSkillEntries.length > 0) {
|
|
1262
|
+
clearDirSync(supervisorSkillDest);
|
|
1263
|
+
for (const { relPath, content } of supervisorSkillEntries) {
|
|
1264
|
+
writeAssetFile(path.join(supervisorSkillDest, relPath), content);
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
else {
|
|
1268
|
+
console.warn(` [!] ${FLEET_SUPERVISOR_SKILL_NAME} skill source not found -- skill not installed`);
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
787
1271
|
if (!installFleet && !installPm) {
|
|
788
1272
|
console.log(` Skipping skills (use --skill all to install, or omit --skill for default)`);
|
|
789
1273
|
}
|
|
@@ -793,29 +1277,147 @@ Then re-run: apra-fleet install`);
|
|
|
793
1277
|
console.log(` [${agentStep}/${totalSteps}] Installing PM agents...`);
|
|
794
1278
|
const agentsDestDir = paths.agentsDir;
|
|
795
1279
|
fs.mkdirSync(agentsDestDir, { recursive: true });
|
|
1280
|
+
// #336's loadAgentAssets() unifies SEA and dev-mode sourcing; its
|
|
1281
|
+
// dev-mode path reads packages/apra-fleet-se/apra-pm/agents directly (dist/agents only
|
|
1282
|
+
// as a fallback), preserving this branch's no-dist/agents rule, and it
|
|
1283
|
+
// recurses into _shared/ and schemas/ which the old flat readdir missed.
|
|
796
1284
|
for (const { relPath, content: rawContent } of loadAgentAssets()) {
|
|
797
|
-
const content = llm === 'opencode'
|
|
1285
|
+
const content = llm === 'opencode'
|
|
1286
|
+
? transformAgentForOpenCode(rawContent, relPath)
|
|
1287
|
+
: llm === 'agy'
|
|
1288
|
+
? transformAgentForAgy(rawContent, relPath)
|
|
1289
|
+
: rawContent;
|
|
798
1290
|
writeAssetFile(path.join(agentsDestDir, relPath), content);
|
|
799
1291
|
}
|
|
800
1292
|
}
|
|
1293
|
+
// --- Workflow-subsystem install step (optional, --workflows all|none) ---
|
|
1294
|
+
// Writes ~/.apra-fleet/{node_modules,schemas,workflows/{fleet-sprint,hello-world}}.
|
|
1295
|
+
// See docs/workflow-subsystem-plan.md Section 6 / Section 2.1 for the layout.
|
|
1296
|
+
if (installWorkflows) {
|
|
1297
|
+
// Two steps follow workflows (dolt, then Beads) before the optional service step.
|
|
1298
|
+
const workflowsStepNum = serviceStep ? totalSteps - 4 : totalSteps - 3;
|
|
1299
|
+
console.log(` [${workflowsStepNum}/${totalSteps}] Installing workflow runtime...`);
|
|
1300
|
+
// Extraction itself (node_modules / schemas / built-in workflows / .installed.json)
|
|
1301
|
+
// lives in workflow-assets.ts -- the SAME code path workflow.ts's self-heal
|
|
1302
|
+
// launcher path uses on-demand (apra-fleet-7pm.8).
|
|
1303
|
+
extractWorkflowSubsystemAssets({
|
|
1304
|
+
manifest,
|
|
1305
|
+
extractAssetBuffer,
|
|
1306
|
+
version: serverVersion,
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
// --- Dolt CLI install step (apra-fleet-ire.3) ---
|
|
1310
|
+
// Portable dolt binary, downloaded straight into BIN_DIR (never system PATH).
|
|
1311
|
+
// Mirrors the Beads install step immediately below: already-installed check
|
|
1312
|
+
// first, download+extract+verify otherwise. NON-FATAL, same as Beads -- a
|
|
1313
|
+
// missing/broken dolt must never fail "apra-fleet install".
|
|
1314
|
+
const doltStep = serviceStep ? totalSteps - 3 : totalSteps - 2;
|
|
1315
|
+
console.log(` [${doltStep}/${totalSteps}] Installing Dolt CLI...`);
|
|
1316
|
+
let doltVersion = 'not available';
|
|
1317
|
+
if (doltStepEnabled()) {
|
|
1318
|
+
try {
|
|
1319
|
+
const doltBinaryName = process.platform === 'win32' ? 'dolt.exe' : 'dolt';
|
|
1320
|
+
const doltPath = path.join(BIN_DIR, doltBinaryName);
|
|
1321
|
+
let installed = false;
|
|
1322
|
+
// Check if already installed
|
|
1323
|
+
if (fs.existsSync(doltPath)) {
|
|
1324
|
+
try {
|
|
1325
|
+
const result = await doltStepDeps.verifyDolt(doltPath);
|
|
1326
|
+
doltVersion = result.version;
|
|
1327
|
+
installed = true;
|
|
1328
|
+
}
|
|
1329
|
+
catch {
|
|
1330
|
+
// existing binary is broken/unusable -- fall through and (re)download
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
if (!installed) {
|
|
1334
|
+
// not installed (or broken) -- download and verify it
|
|
1335
|
+
const extractedPath = await doltStepDeps.downloadAndExtractDolt(BIN_DIR);
|
|
1336
|
+
const result = await doltStepDeps.verifyDolt(extractedPath);
|
|
1337
|
+
doltVersion = result.version;
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
catch (err) {
|
|
1341
|
+
// non-fatal: warn but don't fail the install
|
|
1342
|
+
console.warn(` Dolt install skipped -- ${err.message}`);
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
801
1345
|
// --- Beads install step ---
|
|
802
|
-
// shell:true required on Windows
|
|
1346
|
+
// shell:true required on Windows - npm global packages install as .cmd wrappers
|
|
803
1347
|
// that cannot be directly spawned by Node without a shell
|
|
804
|
-
|
|
1348
|
+
// KB + code intelligence is the final step (before the optional service step),
|
|
1349
|
+
// so Beads sits one slot earlier than it does on main.
|
|
1350
|
+
const beadsStep = serviceStep ? totalSteps - 2 : totalSteps - 1;
|
|
1351
|
+
console.log(` [${beadsStep}/${totalSteps}] Installing Beads task tracker...`);
|
|
805
1352
|
try {
|
|
806
1353
|
// Check if already installed
|
|
807
1354
|
try {
|
|
808
1355
|
execFileSync('bd', ['--version'], { stdio: 'pipe', shell: true });
|
|
809
|
-
// already installed
|
|
1356
|
+
// already installed - skip
|
|
810
1357
|
}
|
|
811
1358
|
catch {
|
|
812
|
-
// not installed
|
|
813
|
-
execFileSync('npm', ['install', '-g', '@beads/bd@1.
|
|
1359
|
+
// not installed - install it
|
|
1360
|
+
execFileSync('npm', ['install', '-g', '@beads/bd@1.1.2'], { stdio: 'inherit', shell: true });
|
|
814
1361
|
}
|
|
815
1362
|
}
|
|
816
1363
|
catch (err) {
|
|
817
1364
|
// non-fatal: warn but don't fail the install
|
|
818
|
-
console.warn('
|
|
1365
|
+
console.warn(' - Beads install skipped - npm not available or install failed');
|
|
1366
|
+
}
|
|
1367
|
+
// --- KB + code intelligence setup step ---
|
|
1368
|
+
// Only runs when the installer is invoked from inside a git repository.
|
|
1369
|
+
const kbStep = serviceStep ? totalSteps - 1 : totalSteps;
|
|
1370
|
+
console.log(` [${kbStep}/${totalSteps}] Setting up Knowledge Bank and code intelligence...`);
|
|
1371
|
+
const repoCwd = process.cwd();
|
|
1372
|
+
if (fs.existsSync(path.join(repoCwd, '.git'))) {
|
|
1373
|
+
// Clean up prior installs: remove legacy gitnexus entry from .mcp.json if present
|
|
1374
|
+
try {
|
|
1375
|
+
const mcpJsonPath = path.join(repoCwd, '.mcp.json');
|
|
1376
|
+
if (fs.existsSync(mcpJsonPath)) {
|
|
1377
|
+
const existing = JSON.parse(fs.readFileSync(mcpJsonPath, 'utf-8'));
|
|
1378
|
+
if (existing.mcpServers?.gitnexus) {
|
|
1379
|
+
delete existing.mcpServers.gitnexus;
|
|
1380
|
+
fs.writeFileSync(mcpJsonPath, JSON.stringify(existing, null, 2));
|
|
1381
|
+
console.log(' [OK] Removed legacy gitnexus entry from .mcp.json');
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
catch (err) {
|
|
1386
|
+
console.warn(' ⚠ .mcp.json cleanup skipped:', err instanceof Error ? err.message : String(err));
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
else {
|
|
1390
|
+
console.log(' Skipped: not in a git repository. Run apra-fleet install from your project root to set up KB.');
|
|
1391
|
+
}
|
|
1392
|
+
// T3.4 (F9b, D8): distribute the committed global bible (if this repo
|
|
1393
|
+
// carries one) to every project on the machine via the shared global KB
|
|
1394
|
+
// data dir. Independent of the .git check above -- the source file's own
|
|
1395
|
+
// presence is the only gate, and the step is fully non-fatal.
|
|
1396
|
+
copyGlobalBible(repoCwd);
|
|
1397
|
+
// Write code intelligence provider config (provider-agnostic; fleet serves code intelligence tools)
|
|
1398
|
+
try {
|
|
1399
|
+
const ciConfigDir = path.join(os.homedir(), '.apra-fleet', 'data', 'code-intelligence');
|
|
1400
|
+
fs.mkdirSync(ciConfigDir, { recursive: true });
|
|
1401
|
+
fs.writeFileSync(path.join(ciConfigDir, 'config.json'), JSON.stringify({ provider: 'gitnexus' }, null, 2));
|
|
1402
|
+
console.log(' [OK] Code intelligence provider config written');
|
|
1403
|
+
}
|
|
1404
|
+
catch (err) {
|
|
1405
|
+
console.warn(' ⚠ Code intelligence config skipped:', err instanceof Error ? err.message : String(err));
|
|
1406
|
+
}
|
|
1407
|
+
// Write code intelligence routing instruction to ~/.claude/CLAUDE.md
|
|
1408
|
+
try {
|
|
1409
|
+
const claudeMdPath = path.join(os.homedir(), '.claude', 'CLAUDE.md');
|
|
1410
|
+
const sentinel = '<!-- apra-fleet:code-intelligence -->';
|
|
1411
|
+
const block = `\n${sentinel}\nWhen code_graph, code_impact, code_query, or code_context tools are available,\nuse them for symbol lookups, call chain tracing, and impact analysis.\nNever use grep or file reads for structural questions when these tools are present.\n<!-- /apra-fleet:code-intelligence -->\n`;
|
|
1412
|
+
const existing = fs.existsSync(claudeMdPath) ? fs.readFileSync(claudeMdPath, 'utf-8') : '';
|
|
1413
|
+
if (!existing.includes(sentinel)) {
|
|
1414
|
+
fs.mkdirSync(path.dirname(claudeMdPath), { recursive: true });
|
|
1415
|
+
fs.appendFileSync(claudeMdPath, block);
|
|
1416
|
+
console.log(' [OK] Code intelligence routing instruction written to ~/.claude/CLAUDE.md');
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
catch (err) {
|
|
1420
|
+
console.warn(' ⚠ ~/.claude/CLAUDE.md update skipped:', err instanceof Error ? err.message : String(err));
|
|
819
1421
|
}
|
|
820
1422
|
// OpenCode uses --dangerously-skip-permissions and per-agent permission: frontmatter;
|
|
821
1423
|
// a top-level "permissions" key is invalid in opencode.json
|
|
@@ -826,7 +1428,30 @@ Then re-run: apra-fleet install`);
|
|
|
826
1428
|
mergePermissions(paths, extraPerms);
|
|
827
1429
|
}
|
|
828
1430
|
// Write install-config.json (merge provider entry)
|
|
829
|
-
writeInstallConfig(llm, skillMode);
|
|
1431
|
+
writeInstallConfig(llm, skillMode, workflowsMode);
|
|
1432
|
+
// --- Step N: Register and start service (SEA + HTTP mode only) ---
|
|
1433
|
+
let serviceRegistered = false;
|
|
1434
|
+
if (serviceStep) {
|
|
1435
|
+
console.log(` [${totalSteps}/${totalSteps}] Registering and starting service...`);
|
|
1436
|
+
const svcMgr = await getServiceManager();
|
|
1437
|
+
try {
|
|
1438
|
+
await svcMgr.register(binaryPath, ['--transport', 'http'], LOG_FILE_PATH);
|
|
1439
|
+
try {
|
|
1440
|
+
await svcMgr.start();
|
|
1441
|
+
serviceRegistered = true;
|
|
1442
|
+
}
|
|
1443
|
+
catch (startErr) {
|
|
1444
|
+
try {
|
|
1445
|
+
await svcMgr.unregister();
|
|
1446
|
+
}
|
|
1447
|
+
catch { }
|
|
1448
|
+
throw startErr;
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
catch (err) {
|
|
1452
|
+
console.warn(` Service registration skipped: ${err.message}`);
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
830
1455
|
// --- Done ---
|
|
831
1456
|
let beadsVersion = 'installed';
|
|
832
1457
|
try {
|
|
@@ -839,6 +1464,7 @@ Then re-run: apra-fleet install`);
|
|
|
839
1464
|
const clientName = llm === 'claude' ? 'Claude Code' : paths.name;
|
|
840
1465
|
const instructions = llm === 'claude' ? 'Run /mcp in Claude Code to load the server.' : `Restart ${paths.name} to load the server.`;
|
|
841
1466
|
const forceNote = force ? `\nRestart ${clientName} to reload the MCP server.` : '';
|
|
1467
|
+
const serviceLine = serviceStep ? `\n Service: ${serviceRegistered ? 'registered and running' : 'registration skipped'}` : '';
|
|
842
1468
|
console.log(`
|
|
843
1469
|
Apra Fleet ${serverVersion} installed successfully for ${paths.name}.
|
|
844
1470
|
Binary: ${BIN_DIR}
|
|
@@ -846,6 +1472,7 @@ Apra Fleet ${serverVersion} installed successfully for ${paths.name}.
|
|
|
846
1472
|
Scripts: ${SCRIPTS_DIR}
|
|
847
1473
|
Settings: ${paths.settingsFile}${installFleet ? `\n Fleet Skill: ${paths.fleetSkillsDir}` : ''}${installPm ? `\n PM Skill: ${paths.skillsDir}` : ''}${installAgents ? `\n Agents: ${paths.agentsDir}` : ''}
|
|
848
1474
|
Beads: ${beadsVersion}
|
|
1475
|
+
Dolt: ${doltVersion}${serviceLine}
|
|
849
1476
|
|
|
850
1477
|
${instructions}${forceNote}
|
|
851
1478
|
`);
|