@apralabs/apra-fleet 0.4.0 → 0.4.2
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 +159 -13
- package/dist/agents/backlog-groomer.md +31 -19
- package/dist/agents/ci-watcher.md +16 -1
- package/dist/agents/deployer.md +37 -47
- package/dist/agents/doer.md +147 -114
- package/dist/agents/harvester.md +41 -34
- package/dist/agents/integ-test-runner.md +98 -114
- package/dist/agents/kb-reconciler.md +205 -0
- package/dist/agents/plan-reviewer.md +45 -44
- package/dist/agents/planner.md +121 -50
- package/dist/agents/regression-test-runner.md +84 -81
- package/dist/agents/reviewer.md +118 -44
- 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 +3 -3
- 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-output.json +4 -17
- package/dist/agents/schemas/reviewer-output.json +105 -8
- package/dist/cli/auth.d.ts.map +1 -1
- package/dist/cli/auth.js +1 -2
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/config.d.ts +3 -3
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +4 -13
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/install.d.ts +1 -0
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +141 -44
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/join.js +1 -1
- package/dist/cli/join.js.map +1 -1
- 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.js +1 -1
- package/dist/cli/start.d.ts.map +1 -1
- package/dist/cli/start.js +7 -0
- package/dist/cli/start.js.map +1 -1
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +16 -3
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/watch.d.ts +76 -4
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +150 -17
- package/dist/cli/watch.js.map +1 -1
- 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/index.js +77 -2
- package/dist/index.js.map +1 -1
- package/dist/os/git-bash-candidates.d.ts +35 -0
- package/dist/os/git-bash-candidates.d.ts.map +1 -0
- package/dist/os/git-bash-candidates.js +46 -0
- package/dist/os/git-bash-candidates.js.map +1 -0
- package/dist/os/index.d.ts +13 -4
- package/dist/os/index.d.ts.map +1 -1
- package/dist/os/index.js +17 -2
- package/dist/os/index.js.map +1 -1
- package/dist/os/linux.d.ts +1 -0
- package/dist/os/linux.d.ts.map +1 -1
- package/dist/os/linux.js +19 -2
- package/dist/os/linux.js.map +1 -1
- package/dist/os/os-commands.d.ts +12 -0
- package/dist/os/os-commands.d.ts.map +1 -1
- package/dist/os/os-commands.js.map +1 -1
- package/dist/os/windows-gitbash.d.ts +93 -0
- package/dist/os/windows-gitbash.d.ts.map +1 -0
- package/dist/os/windows-gitbash.js +244 -0
- package/dist/os/windows-gitbash.js.map +1 -0
- package/dist/os/windows.d.ts +35 -0
- package/dist/os/windows.d.ts.map +1 -1
- package/dist/os/windows.js +93 -35
- package/dist/os/windows.js.map +1 -1
- package/dist/providers/agy.d.ts +15 -3
- package/dist/providers/agy.d.ts.map +1 -1
- package/dist/providers/agy.js +145 -11
- package/dist/providers/agy.js.map +1 -1
- package/dist/providers/claude.d.ts +14 -3
- package/dist/providers/claude.d.ts.map +1 -1
- package/dist/providers/claude.js +69 -22
- package/dist/providers/claude.js.map +1 -1
- package/dist/providers/codex.d.ts +14 -3
- package/dist/providers/codex.d.ts.map +1 -1
- package/dist/providers/codex.js +34 -8
- package/dist/providers/codex.js.map +1 -1
- package/dist/providers/copilot.d.ts +14 -3
- package/dist/providers/copilot.d.ts.map +1 -1
- package/dist/providers/copilot.js +33 -8
- 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/index.d.ts +0 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +0 -3
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/none.d.ts +14 -3
- package/dist/providers/none.d.ts.map +1 -1
- package/dist/providers/none.js +26 -2
- package/dist/providers/none.js.map +1 -1
- package/dist/providers/opencode.d.ts +14 -3
- package/dist/providers/opencode.d.ts.map +1 -1
- package/dist/providers/opencode.js +60 -6
- package/dist/providers/opencode.js.map +1 -1
- package/dist/providers/provider.d.ts +91 -5
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/provider.js +45 -1
- package/dist/providers/provider.js.map +1 -1
- package/dist/services/agent-provisioner.d.ts.map +1 -1
- package/dist/services/agent-provisioner.js +5 -8
- package/dist/services/agent-provisioner.js.map +1 -1
- package/dist/services/cloud/activity.js +2 -2
- package/dist/services/cloud/activity.js.map +1 -1
- 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/context-admission.d.ts.map +1 -1
- package/dist/services/context-admission.js +9 -7
- package/dist/services/context-admission.js.map +1 -1
- package/dist/services/credential-cleanup.d.ts.map +1 -1
- package/dist/services/credential-cleanup.js +22 -3
- package/dist/services/credential-cleanup.js.map +1 -1
- package/dist/services/github-app.d.ts.map +1 -1
- package/dist/services/github-app.js +11 -2
- package/dist/services/github-app.js.map +1 -1
- 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/member-home.d.ts +89 -0
- package/dist/services/member-home.d.ts.map +1 -0
- package/dist/services/member-home.js +259 -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.map +1 -1
- package/dist/services/model-pricing.js +0 -5
- package/dist/services/model-pricing.js.map +1 -1
- package/dist/services/orphan-recovery.d.ts +9 -3
- package/dist/services/orphan-recovery.d.ts.map +1 -1
- package/dist/services/orphan-recovery.js +22 -8
- package/dist/services/orphan-recovery.js.map +1 -1
- 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/shell-probe.d.ts +131 -0
- package/dist/services/shell-probe.d.ts.map +1 -0
- package/dist/services/shell-probe.js +210 -0
- package/dist/services/shell-probe.js.map +1 -0
- package/dist/services/singleton.d.ts +2 -0
- package/dist/services/singleton.d.ts.map +1 -1
- package/dist/services/singleton.js +1 -1
- package/dist/services/singleton.js.map +1 -1
- package/dist/services/ssh.js +2 -2
- package/dist/services/ssh.js.map +1 -1
- package/dist/services/stall/find-log-file.d.ts.map +1 -1
- package/dist/services/stall/find-log-file.js +22 -16
- package/dist/services/stall/find-log-file.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 -40
- package/dist/services/stall/log-path-resolver.js.map +1 -1
- package/dist/services/stall/read-log-tail.d.ts.map +1 -1
- package/dist/services/stall/read-log-tail.js +6 -5
- package/dist/services/stall/read-log-tail.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 +149 -6
- package/dist/services/stall/stall-detector.js.map +1 -1
- package/dist/services/stall/stall-poller.d.ts +34 -0
- package/dist/services/stall/stall-poller.d.ts.map +1 -1
- package/dist/services/stall/stall-poller.js +160 -35
- package/dist/services/stall/stall-poller.js.map +1 -1
- package/dist/services/strategy.d.ts +9 -0
- package/dist/services/strategy.d.ts.map +1 -1
- package/dist/services/strategy.js +41 -7
- package/dist/services/strategy.js.map +1 -1
- package/dist/services/tool-registry.d.ts.map +1 -1
- package/dist/services/tool-registry.js +87 -1
- package/dist/services/tool-registry.js.map +1 -1
- package/dist/services/user-config.js +1 -1
- package/dist/services/user-config.js.map +1 -1
- package/dist/services/vcs/azure-devops.d.ts +1 -1
- package/dist/services/vcs/azure-devops.d.ts.map +1 -1
- package/dist/services/vcs/azure-devops.js +105 -10
- package/dist/services/vcs/azure-devops.js.map +1 -1
- package/dist/services/vcs/bitbucket.d.ts.map +1 -1
- package/dist/services/vcs/bitbucket.js +16 -0
- package/dist/services/vcs/bitbucket.js.map +1 -1
- package/dist/services/vcs/github.d.ts.map +1 -1
- package/dist/services/vcs/github.js +56 -1
- package/dist/services/vcs/github.js.map +1 -1
- package/dist/services/vcs/types.d.ts +123 -2
- 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 +15 -3
- package/dist/skills/pm/SKILL.md +0 -1
- package/dist/skills/pm/beads.md +6 -0
- package/dist/skills/pm/cost.md +0 -1
- package/dist/skills/pm/fleet-addendum.md +6 -1
- 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 +245 -3
- package/dist/tools/check-status.js.map +1 -1
- package/dist/tools/child-id-allocator.d.ts +2 -2
- package/dist/tools/cloud-control.js +2 -2
- package/dist/tools/cloud-control.js.map +1 -1
- 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 +26 -0
- package/dist/tools/compose-permissions.d.ts.map +1 -1
- package/dist/tools/compose-permissions.js +257 -33
- package/dist/tools/compose-permissions.js.map +1 -1
- package/dist/tools/execute-command.d.ts +2 -0
- package/dist/tools/execute-command.d.ts.map +1 -1
- package/dist/tools/execute-command.js +114 -28
- package/dist/tools/execute-command.js.map +1 -1
- package/dist/tools/execute-prompt.d.ts +13 -1
- package/dist/tools/execute-prompt.d.ts.map +1 -1
- package/dist/tools/execute-prompt.js +310 -61
- package/dist/tools/execute-prompt.js.map +1 -1
- 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 +6 -2
- package/dist/tools/list-members.js.map +1 -1
- package/dist/tools/member-detail.d.ts.map +1 -1
- package/dist/tools/member-detail.js +13 -3
- package/dist/tools/member-detail.js.map +1 -1
- package/dist/tools/member-reservation.d.ts.map +1 -1
- package/dist/tools/member-reservation.js +13 -1
- package/dist/tools/member-reservation.js.map +1 -1
- package/dist/tools/monitor-task.d.ts.map +1 -1
- package/dist/tools/monitor-task.js +38 -5
- 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 +15 -8
- package/dist/tools/provision-auth.js.map +1 -1
- package/dist/tools/provision-vcs-auth.d.ts +5 -2
- package/dist/tools/provision-vcs-auth.d.ts.map +1 -1
- package/dist/tools/provision-vcs-auth.js +58 -52
- package/dist/tools/provision-vcs-auth.js.map +1 -1
- package/dist/tools/register-member.d.ts +21 -12
- package/dist/tools/register-member.d.ts.map +1 -1
- package/dist/tools/register-member.js +70 -3
- package/dist/tools/register-member.js.map +1 -1
- package/dist/tools/remove-member.d.ts.map +1 -1
- package/dist/tools/remove-member.js +19 -5
- package/dist/tools/remove-member.js.map +1 -1
- package/dist/tools/report-status.d.ts.map +1 -1
- package/dist/tools/report-status.js +2 -1
- package/dist/tools/report-status.js.map +1 -1
- package/dist/tools/revoke-vcs-auth.js +2 -2
- package/dist/tools/revoke-vcs-auth.js.map +1 -1
- 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/setup-ssh-key.d.ts.map +1 -1
- package/dist/tools/setup-ssh-key.js +4 -1
- package/dist/tools/setup-ssh-key.js.map +1 -1
- package/dist/tools/stop-prompt.js +2 -2
- package/dist/tools/stop-prompt.js.map +1 -1
- package/dist/tools/update-agent-cli.js +2 -2
- package/dist/tools/update-agent-cli.js.map +1 -1
- package/dist/tools/update-member.d.ts +21 -12
- package/dist/tools/update-member.d.ts.map +1 -1
- package/dist/tools/update-member.js +43 -2
- package/dist/tools/update-member.js.map +1 -1
- package/dist/types.d.ts +12 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/agent-helpers.d.ts +36 -0
- package/dist/utils/agent-helpers.d.ts.map +1 -1
- package/dist/utils/agent-helpers.js +39 -1
- package/dist/utils/agent-helpers.js.map +1 -1
- package/dist/utils/platform.d.ts +7 -0
- package/dist/utils/platform.d.ts.map +1 -1
- package/dist/utils/platform.js +11 -1
- package/dist/utils/platform.js.map +1 -1
- package/dist/utils/prompt-errors.js +1 -1
- 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.map +1 -1
- package/dist/utils/workspace-trust.js +5 -1
- package/dist/utils/workspace-trust.js.map +1 -1
- package/dist/workflows/auto-sprint.js +550 -23
- package/package.json +7 -4
- package/packages/apra-fleet-client/src/client/api.mjs +210 -7
- package/packages/apra-fleet-se/apra-pm/agents/backlog-groomer.md +31 -19
- package/packages/apra-fleet-se/apra-pm/agents/ci-watcher.md +16 -1
- package/packages/apra-fleet-se/apra-pm/agents/deployer.md +37 -47
- package/packages/apra-fleet-se/apra-pm/agents/doer.md +147 -114
- package/packages/apra-fleet-se/apra-pm/agents/harvester.md +41 -34
- package/packages/apra-fleet-se/apra-pm/agents/integ-test-runner.md +98 -114
- package/packages/apra-fleet-se/apra-pm/agents/kb-reconciler.md +205 -0
- package/packages/apra-fleet-se/apra-pm/agents/plan-reviewer.md +45 -44
- package/packages/apra-fleet-se/apra-pm/agents/planner.md +121 -50
- package/packages/apra-fleet-se/apra-pm/agents/regression-test-runner.md +84 -81
- package/packages/apra-fleet-se/apra-pm/agents/reviewer.md +118 -44
- package/packages/apra-fleet-se/apra-pm/agents/schemas/doer-output.json +63 -3
- package/packages/apra-fleet-se/apra-pm/agents/schemas/harvester-output.json +59 -2
- package/packages/apra-fleet-se/apra-pm/agents/schemas/integ-test-runner-output.json +3 -3
- package/packages/apra-fleet-se/apra-pm/agents/schemas/kb-reconciler-output.json +87 -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-output.json +4 -17
- package/packages/apra-fleet-se/apra-pm/agents/schemas/reviewer-output.json +105 -8
- package/packages/apra-fleet-se/apra-pm/skills/pm/SKILL.md +0 -1
- package/packages/apra-fleet-se/apra-pm/skills/pm/beads.md +6 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/cost.md +0 -1
- package/packages/apra-fleet-se/apra-pm/skills/pm/fleet-addendum.md +6 -1
- 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/bin/cli.mjs +139 -3
- package/packages/apra-fleet-se/bin/serve.mjs +49 -2
- package/packages/apra-fleet-se/fleet-sprint/contracts.mjs +182 -38
- package/packages/apra-fleet-se/fleet-sprint/docs/README.md +23 -8
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-manual-recovery-verified.md +258 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-sync-redesign.md +1487 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/escalate-to-llm-design.md +908 -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 +14 -4
- package/packages/apra-fleet-se/fleet-sprint/dolt-settle.mjs +1148 -0
- package/packages/apra-fleet-se/fleet-sprint/dolt-sync.mjs +229 -112
- package/packages/apra-fleet-se/fleet-sprint/errors.mjs +91 -6
- package/packages/apra-fleet-se/fleet-sprint/runner.js +2469 -238
- package/packages/apra-fleet-se/fleet-sprint/se-os-commands.mjs +134 -0
- package/packages/apra-fleet-se/fleet-sprint/se-posix.mjs +154 -0
- package/packages/apra-fleet-se/fleet-sprint/se-windows-gitbash.mjs +97 -0
- package/packages/apra-fleet-se/fleet-sprint/se-windows.mjs +143 -0
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-sprint-cli/SKILL.md +15 -3
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-supervisor/SKILL.md +350 -0
- package/packages/apra-fleet-se/fleet-sprint/sprint-progress.mjs +101 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-module.mjs +51 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/azure-devops.mjs +657 -12
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/dolt.mjs +33 -4
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/github.mjs +60 -30
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/index.mjs +205 -2
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/shell-helpers.mjs +164 -0
- package/packages/apra-fleet-se/fleet-sprint/viewer-extensions.mjs +141 -26
- package/packages/apra-fleet-se/package.json +1 -0
- package/packages/apra-fleet-workflow/src/viewer/index.mjs +294 -14
- package/packages/apra-fleet-workflow/src/viewer/run-title.mjs +60 -0
- package/packages/apra-fleet-workflow/src/workflow/index.mjs +443 -35
- package/skills/fleet/SKILL.md +20 -9
- package/skills/fleet/auth-azdevops.md +44 -5
- package/skills/fleet/auth-bitbucket.md +3 -3
- package/skills/fleet/auth-github.md +2 -2
- package/skills/fleet/beads-conflict-resolution.md +141 -0
- package/skills/fleet/beads.md +16 -12
- package/skills/fleet/knowledge-agent.md +66 -0
- package/skills/fleet/onboarding.md +4 -4
- package/skills/fleet/permissions.md +32 -8
- package/skills/fleet/profiles/base-dev.json +10 -1
- package/skills/fleet/profiles/base-reviewer.json +8 -1
- package/skills/fleet/profiles/tag-kb-reconciler.json +20 -0
- package/skills/fleet/skill-matrix.md +1 -1
- package/skills/fleet/troubleshooting.md +2 -1
- package/version.json +1 -1
- package/dist/providers/gemini.d.ts +0 -42
- package/dist/providers/gemini.d.ts.map +0 -1
- package/dist/providers/gemini.js +0 -202
- package/dist/providers/gemini.js.map +0 -1
- package/packages/apra-fleet-se/fleet-sprint/docs/coach-role-design.md +0 -151
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-tier2-runbook.md +0 -127
- package/packages/apra-fleet-se/fleet-sprint/dolt-recovery-path-b.mjs +0 -339
- package/packages/apra-fleet-se/fleet-sprint/dolt-recovery-tier2.mjs +0 -360
- package/packages/apra-fleet-se/fleet-sprint/dolt-recovery.mjs +0 -363
|
@@ -246,20 +246,48 @@ function summarizeExtractionAttempts(attempts) {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
/**
|
|
249
|
-
* Builds the
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
249
|
+
* Builds the repair re-ask prompt sent to the SAME member after an invalid
|
|
250
|
+
* structured-output attempt.
|
|
251
|
+
*
|
|
252
|
+
* HISTORY -- this deliberately REVERSES apra-fleet-02s.3, which shrank this
|
|
253
|
+
* to a lean reminder (validation errors only) on the theory that the forced
|
|
254
|
+
* `resume: true` on repair (see the payload construction below) guarantees
|
|
255
|
+
* the member's session still holds the original prompt and schema.
|
|
256
|
+
* apra-fleet-dnri: that assumption does not always hold. Observed live on
|
|
257
|
+
* 2026-08-20, a reviewer dispatch that failed schema validation twice was
|
|
258
|
+
* re-asked with only the validator text; the resumed session did not carry
|
|
259
|
+
* the task inputs, so the agent had no base branch, no branch and no work
|
|
260
|
+
* ids, correctly refused to guess, and its refusal was read as a real
|
|
261
|
+
* verdict -- aborting the whole sprint. Resume is an optimization, not a
|
|
262
|
+
* guarantee, so the re-ask must be self-contained on its own.
|
|
263
|
+
*
|
|
264
|
+
* BOUNDED ON PURPOSE (the original token-cost decision still stands): only
|
|
265
|
+
* `initialPrompt` is reattached -- the caller's original prompt plus the same
|
|
266
|
+
* schema instruction the initial dispatch appended. The invalid response
|
|
267
|
+
* text, the session transcript and any per-attempt accumulated history are
|
|
268
|
+
* NOT re-embedded, and callers must always pass the ORIGINAL `initialPrompt`
|
|
269
|
+
* (never the previous round's repair prompt), so the reattached portion is
|
|
270
|
+
* byte-identical on every repair round and the prompt does not grow.
|
|
271
|
+
*
|
|
272
|
+
* The reattachment is framed as REFERENCE material, not as a fresh order:
|
|
273
|
+
* when the repair re-ask resumes the failed attempt's own session (see the
|
|
274
|
+
* resume disposition at the dispatch payload below) the member may have
|
|
275
|
+
* already done the underlying work, and a prompt that restates the task can
|
|
276
|
+
* read as an instruction to redo it.
|
|
277
|
+
*
|
|
278
|
+
* @param {string} errorsText - Summary of every failed extraction attempt.
|
|
279
|
+
* @param {string} initialPrompt - The fully-resolved original dispatch prompt
|
|
280
|
+
* (caller prompt + appended schema instruction), unchanged.
|
|
257
281
|
*/
|
|
258
|
-
function buildRepairPrompt(errorsText) {
|
|
282
|
+
function buildRepairPrompt(errorsText, initialPrompt) {
|
|
259
283
|
return `Your previous response could not be used.\n\n` +
|
|
260
284
|
`Validation errors:\n${errorsText}\n\n` +
|
|
261
|
-
`
|
|
262
|
-
|
|
285
|
+
`For reference, the original request and the required JSON schema were:\n` +
|
|
286
|
+
`--- BEGIN ORIGINAL REQUEST ---\n${initialPrompt}\n--- END ORIGINAL REQUEST ---\n\n` +
|
|
287
|
+
`Do NOT redo any work you have already completed for this request -- report the ` +
|
|
288
|
+
`result you already determined. Respond again with corrected JSON only, strictly ` +
|
|
289
|
+
`conforming to the schema above. Do not include any commentary, explanation, or ` +
|
|
290
|
+
`text outside the JSON.`;
|
|
263
291
|
}
|
|
264
292
|
|
|
265
293
|
/**
|
|
@@ -329,10 +357,13 @@ function buildRepairPrompt(errorsText) {
|
|
|
329
357
|
* @property {number} [schemaRetries] - Only meaningful when `schema` is set. Bounded number
|
|
330
358
|
* of repair re-asks to the SAME member after a parse/validation failure, before giving up
|
|
331
359
|
* and throwing AgentOutputError. Defaults to 2 (so up to 3 total dispatches: 1 original +
|
|
332
|
-
* 2 repairs). Each repair re-ask FORCES `resume: true` (apra-fleet-02s.3) so
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
360
|
+
* 2 repairs). Each repair re-ask FORCES `resume: true` (apra-fleet-02s.3) so any real work
|
|
361
|
+
* the member already performed for this request is preserved rather than redone -- but the
|
|
362
|
+
* re-ask is SELF-CONTAINED and does not depend on that resume carrying context
|
|
363
|
+
* (apra-fleet-dnri): it reattaches the original prompt plus the schema instruction as
|
|
364
|
+
* reference, alongside the ajv validation/parse errors and a corrected-JSON instruction.
|
|
365
|
+
* The reattached portion is identical on every repair round (the invalid output, the
|
|
366
|
+
* session transcript and per-attempt history are never embedded), so repairs do not grow.
|
|
336
367
|
* Each attempt emits its own activity:start/activity:end pair and is cost-accounted
|
|
337
368
|
* individually. (apra-fleet-unw.8)
|
|
338
369
|
* @property {number} [busyWaitMs] - How long (ms) to keep waiting-and-retrying when the
|
|
@@ -386,10 +417,14 @@ export class FleetWorkflow extends EventEmitter {
|
|
|
386
417
|
* @param {import('../fleet-client/api.mjs').ApraFleet} fleetApi
|
|
387
418
|
* @param {any} args
|
|
388
419
|
*/
|
|
389
|
-
constructor(fleetApi, args = {}) {
|
|
420
|
+
constructor(fleetApi, args = {}, logPrefix = '') {
|
|
390
421
|
super();
|
|
391
422
|
this.fleetApi = fleetApi;
|
|
392
423
|
this.args = args;
|
|
424
|
+
// (apra-fleet-20i.1.1) Optional per-run scenario label prepended to
|
|
425
|
+
// the [Workflow Log]/[Dispatch]/[Command] console.log lines below.
|
|
426
|
+
// Defaults to '' so existing callers get byte-identical output.
|
|
427
|
+
this.logPrefix = logPrefix;
|
|
393
428
|
this.currentPhase = null;
|
|
394
429
|
this.budget = {
|
|
395
430
|
total: null,
|
|
@@ -420,6 +455,50 @@ export class FleetWorkflow extends EventEmitter {
|
|
|
420
455
|
// controller.signal (via _currentSignal()) when the caller doesn't
|
|
421
456
|
// pass its own opts.signal. See runWithContext()/requestStop() below.
|
|
422
457
|
this._activeControllers = new Map();
|
|
458
|
+
|
|
459
|
+
// (apra-fleet-p2to.1) Cooperative pause/resume gate. This is the
|
|
460
|
+
// GENERIC engine primitive -- a soft, deferred barrier at every
|
|
461
|
+
// agent()/command() entry -- NOT a journaled interrupt(). See
|
|
462
|
+
// requestPause()/requestResume()/setPauseGuard() and _pauseGate()
|
|
463
|
+
// below for the full semantics. All state is instance-level (like
|
|
464
|
+
// requestStop()'s _activeControllers), so a single pause quiesces
|
|
465
|
+
// every run sharing this FleetWorkflow instance.
|
|
466
|
+
//
|
|
467
|
+
// _pauseRequested : a pause has been asked for but has not yet
|
|
468
|
+
// "taken effect" (still draining in-flight work
|
|
469
|
+
// and/or waiting on the pause guard).
|
|
470
|
+
// _paused : the pause has taken effect at a clean-state
|
|
471
|
+
// boundary -- zero in-flight activities and the
|
|
472
|
+
// guard (if any) permitted it. New agent()/
|
|
473
|
+
// command() calls block at the gate while true.
|
|
474
|
+
// _pauseGuard : optional predicate (set via setPauseGuard) that
|
|
475
|
+
// defers a requested pause until it returns truthy
|
|
476
|
+
// -- i.e. lets the workflow script declare where a
|
|
477
|
+
// clean-state boundary actually is. Null means
|
|
478
|
+
// "any zero-in-flight point is a boundary".
|
|
479
|
+
// _inFlight : count of agent()/command() dispatches that have
|
|
480
|
+
// passed the gate and not yet completed. 'paused'
|
|
481
|
+
// is only declared when this reaches zero.
|
|
482
|
+
// _pauseWaiters : { resolve, reject } for every call currently
|
|
483
|
+
// blocked at the gate. requestResume() resolves
|
|
484
|
+
// them (they re-check and proceed); requestStop()
|
|
485
|
+
// rejects them with a CancelledError so a paused
|
|
486
|
+
// run tears down instead of hanging.
|
|
487
|
+
// _preResumeHook : optional async hook (set via setPreResumeHook)
|
|
488
|
+
// that requestResume() awaits as a HARD BARRIER
|
|
489
|
+
// before it clears pause state, releases any gate
|
|
490
|
+
// waiter, or emits 'resumed' -- so a caller's
|
|
491
|
+
// re-reserve/resync completes strictly ahead of the
|
|
492
|
+
// first post-resume dispatch. A hook rejection
|
|
493
|
+
// rejects requestResume() (the run stays paused)
|
|
494
|
+
// rather than being swallowed. Null means no
|
|
495
|
+
// barrier -- resume proceeds immediately.
|
|
496
|
+
this._pauseRequested = false;
|
|
497
|
+
this._paused = false;
|
|
498
|
+
this._pauseGuard = null;
|
|
499
|
+
this._preResumeHook = null;
|
|
500
|
+
this._inFlight = 0;
|
|
501
|
+
this._pauseWaiters = [];
|
|
423
502
|
}
|
|
424
503
|
|
|
425
504
|
// Returns the active per-run store (see runStorage above), or
|
|
@@ -497,13 +576,217 @@ export class FleetWorkflow extends EventEmitter {
|
|
|
497
576
|
* @param {string} [reason]
|
|
498
577
|
*/
|
|
499
578
|
requestStop(reason = 'Workflow run cancelled via requestStop()') {
|
|
579
|
+
// (apra-fleet-p2to.1) A stop supersedes any pause: reject every call
|
|
580
|
+
// blocked at the pause gate with a CancelledError so a paused run
|
|
581
|
+
// unwinds instead of hanging forever, and clear the pause state so a
|
|
582
|
+
// late-arriving activity doesn't re-block. The gate promise rejecting
|
|
583
|
+
// is what makes "requestStop() while paused tears down" work -- the
|
|
584
|
+
// blocked agent()/command() re-throws the CancelledError, which
|
|
585
|
+
// unwinds the run exactly like an aborted in-flight dispatch does.
|
|
586
|
+
this._pauseRequested = false;
|
|
587
|
+
this._paused = false;
|
|
588
|
+
const waiters = this._pauseWaiters;
|
|
589
|
+
this._pauseWaiters = [];
|
|
590
|
+
for (const waiter of waiters) {
|
|
591
|
+
waiter.reject(new CancelledError(`[Workflow Error] ${reason}`));
|
|
592
|
+
}
|
|
500
593
|
for (const controller of this._activeControllers.values()) {
|
|
501
594
|
controller.abort(new CancelledError(`[Workflow Error] ${reason}`));
|
|
502
595
|
}
|
|
503
596
|
}
|
|
504
597
|
|
|
598
|
+
/**
|
|
599
|
+
* (apra-fleet-p2to.1) Registers (or clears, with `null`) the pause guard:
|
|
600
|
+
* a predicate consulted whenever a requested-but-not-yet-engaged pause is
|
|
601
|
+
* about to take effect. A pause only engages -- transitions to `_paused`
|
|
602
|
+
* and fires 'paused' -- when in-flight work has drained to zero AND this
|
|
603
|
+
* guard returns truthy. That lets a workflow script defer a mid-run pause
|
|
604
|
+
* to a boundary IT considers clean (e.g. "between phases", "not inside a
|
|
605
|
+
* transaction") rather than the mere between-activities gaps the engine
|
|
606
|
+
* can see on its own. A null guard (the default) treats every
|
|
607
|
+
* zero-in-flight point as an acceptable boundary. The guard is called with
|
|
608
|
+
* no arguments; a throwing guard is treated as "not at a boundary yet"
|
|
609
|
+
* (fail-closed: keep deferring rather than pause at a point the script
|
|
610
|
+
* couldn't vouch for) and logged.
|
|
611
|
+
*
|
|
612
|
+
* Generic engine hook only -- it carries no fleet-sprint (or any other
|
|
613
|
+
* caller's) semantics; the meaning of "clean" is entirely the guard's.
|
|
614
|
+
*
|
|
615
|
+
* @param {(() => boolean) | null} fn
|
|
616
|
+
*/
|
|
617
|
+
setPauseGuard(fn) {
|
|
618
|
+
if (fn !== null && typeof fn !== 'function') {
|
|
619
|
+
throw new TypeError('[Workflow Error] setPauseGuard() requires a function or null');
|
|
620
|
+
}
|
|
621
|
+
this._pauseGuard = fn;
|
|
622
|
+
// Setting the guard at what the script now considers a clean boundary
|
|
623
|
+
// may be exactly the moment a deferred pause can finally engage.
|
|
624
|
+
this._maybeEngagePause();
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* (apra-fleet-p2to.1.3) Registers (or clears, with null) an async
|
|
629
|
+
* pre-resume hook that requestResume() awaits as a HARD BARRIER before it
|
|
630
|
+
* clears pause state, releases any gate waiter, or emits 'resumed'. This is
|
|
631
|
+
* the point at which a caller re-grabs/re-syncs whatever it released at
|
|
632
|
+
* pause (fleet-sprint's member re-reserve/resync) with the guarantee that
|
|
633
|
+
* the work completes strictly BEFORE the first post-resume agent()/
|
|
634
|
+
* command() dispatch -- no race with the resumed sprint loop.
|
|
635
|
+
*
|
|
636
|
+
* The hook is awaited; if it rejects, requestResume() rejects too and the
|
|
637
|
+
* run stays paused (pause state is never cleared on the reject path), so a
|
|
638
|
+
* failure surfaces to the caller instead of being silently swallowed --
|
|
639
|
+
* consistent with reReserveOnResume()'s rethrow contract.
|
|
640
|
+
*
|
|
641
|
+
* Generic engine hook only -- it carries no caller-specific semantics.
|
|
642
|
+
*
|
|
643
|
+
* @param {((reason: string) => (void | Promise<void>)) | null} fn
|
|
644
|
+
*/
|
|
645
|
+
setPreResumeHook(fn) {
|
|
646
|
+
if (fn !== null && typeof fn !== 'function') {
|
|
647
|
+
throw new TypeError('[Workflow Error] setPreResumeHook() requires a function or null');
|
|
648
|
+
}
|
|
649
|
+
this._preResumeHook = fn;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* (apra-fleet-p2to.1) Requests a cooperative pause of every run sharing
|
|
654
|
+
* this instance. Fires 'pause:requested' immediately, but the pause is
|
|
655
|
+
* DEFERRED: it only takes effect ('paused' fires, new dispatches block) at
|
|
656
|
+
* a clean-state boundary -- zero in-flight activities and, if a pause
|
|
657
|
+
* guard is set, that guard returning truthy. Calling it while already
|
|
658
|
+
* paused or pause-requested is a no-op.
|
|
659
|
+
*
|
|
660
|
+
* @param {string} [reason]
|
|
661
|
+
*/
|
|
662
|
+
requestPause(reason = 'Workflow run paused via requestPause()') {
|
|
663
|
+
if (this._paused || this._pauseRequested) return;
|
|
664
|
+
this._pauseRequested = true;
|
|
665
|
+
this.emit('pause:requested', this._pauseEventPayload({ reason }));
|
|
666
|
+
// If we're already quiescent (nothing in flight, guard permits), the
|
|
667
|
+
// pause engages right now; otherwise it engages later as in-flight
|
|
668
|
+
// work drains (_exitActivity) or the guard opens (setPauseGuard).
|
|
669
|
+
this._maybeEngagePause();
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* (apra-fleet-p2to.1) Resumes a paused (or merely pause-requested) run.
|
|
674
|
+
* Clears the pause state and releases every call blocked at the gate so
|
|
675
|
+
* they proceed. Fires 'resumed'. No-op if not paused/pause-requested.
|
|
676
|
+
*
|
|
677
|
+
* (apra-fleet-p2to.1.3) When a pre-resume hook is registered (see
|
|
678
|
+
* setPreResumeHook), it is awaited as a HARD BARRIER FIRST -- while the run
|
|
679
|
+
* is still paused, so no gate waiter is released and no new dispatch slips
|
|
680
|
+
* through -- and only once it resolves are the waiters released and
|
|
681
|
+
* 'resumed' emitted. This guarantees the caller's re-reserve/resync
|
|
682
|
+
* completes strictly ahead of the first post-resume dispatch. A hook
|
|
683
|
+
* rejection propagates out of requestResume() with the pause state left
|
|
684
|
+
* intact (run stays paused), rather than being swallowed.
|
|
685
|
+
*
|
|
686
|
+
* @param {string} [reason]
|
|
687
|
+
* @returns {Promise<void>}
|
|
688
|
+
*/
|
|
689
|
+
async requestResume(reason = 'Workflow run resumed via requestResume()') {
|
|
690
|
+
if (!this._paused && !this._pauseRequested) return;
|
|
691
|
+
// Barrier: drain the pre-resume hook BEFORE touching pause state. The
|
|
692
|
+
// run is still paused here, so waiters remain blocked and any fresh
|
|
693
|
+
// agent()/command() dispatch blocks at the gate -- the hook's work
|
|
694
|
+
// (e.g. member re-reserve/resync) cannot race the resumed loop. A
|
|
695
|
+
// rejection here surfaces to the caller with pause state untouched, so
|
|
696
|
+
// the run stays parked instead of resuming on a half-restored state.
|
|
697
|
+
if (this._preResumeHook) {
|
|
698
|
+
await this._preResumeHook(reason);
|
|
699
|
+
}
|
|
700
|
+
this._paused = false;
|
|
701
|
+
this._pauseRequested = false;
|
|
702
|
+
const waiters = this._pauseWaiters;
|
|
703
|
+
this._pauseWaiters = [];
|
|
704
|
+
for (const waiter of waiters) {
|
|
705
|
+
waiter.resolve();
|
|
706
|
+
}
|
|
707
|
+
this.emit('resumed', this._pauseEventPayload({ reason }));
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
// (apra-fleet-p2to.1) Phase/group (and runId) labels for pause lifecycle
|
|
711
|
+
// events, read from the active run store when there is one (falling back
|
|
712
|
+
// to the legacy instance-level fields), so subscribers can attribute a
|
|
713
|
+
// pause to where the run actually was -- exactly like log()/phase() do.
|
|
714
|
+
_pauseEventPayload(extra = {}) {
|
|
715
|
+
return {
|
|
716
|
+
phase: this._currentPhase(),
|
|
717
|
+
group: this._currentGroup(),
|
|
718
|
+
runId: this._currentRunId(),
|
|
719
|
+
...extra
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// (apra-fleet-p2to.1) True when a requested pause is allowed to take
|
|
724
|
+
// effect right now: null guard means "any zero-in-flight point is clean";
|
|
725
|
+
// otherwise the script's guard decides. A throwing guard fails closed
|
|
726
|
+
// (keep deferring) rather than pausing at an unvouched-for point.
|
|
727
|
+
_guardPermitsPause() {
|
|
728
|
+
if (!this._pauseGuard) return true;
|
|
729
|
+
try {
|
|
730
|
+
return !!this._pauseGuard();
|
|
731
|
+
} catch (err) {
|
|
732
|
+
console.error(`[Workflow] pause guard threw (deferring pause): ${err && err.message ? err.message : err}`);
|
|
733
|
+
return false;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// (apra-fleet-p2to.1) Engage a requested pause iff we're at a clean-state
|
|
738
|
+
// boundary: pause requested, not already paused, zero in-flight activities
|
|
739
|
+
// and the guard permits. Idempotent and cheap -- called from every point
|
|
740
|
+
// that can move us toward quiescence (requestPause, _exitActivity when the
|
|
741
|
+
// last activity drains, setPauseGuard opening the boundary, and the gate
|
|
742
|
+
// itself). This is the ONLY place 'paused' is emitted, which guarantees
|
|
743
|
+
// 'paused' can never fire while activities are still in flight.
|
|
744
|
+
_maybeEngagePause() {
|
|
745
|
+
if (!this._pauseRequested || this._paused) return;
|
|
746
|
+
if (this._inFlight > 0) return;
|
|
747
|
+
if (!this._guardPermitsPause()) return;
|
|
748
|
+
this._paused = true;
|
|
749
|
+
this.emit('paused', this._pauseEventPayload());
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
// (apra-fleet-p2to.1) The pause gate, awaited at the very start of every
|
|
753
|
+
// agent()/command() call (before it becomes in-flight). If a pause is
|
|
754
|
+
// engaged the call blocks here until requestResume() releases it (the
|
|
755
|
+
// awaited promise resolves) or requestStop() tears it down (the promise
|
|
756
|
+
// rejects with a CancelledError, which propagates out of agent()/command()
|
|
757
|
+
// and unwinds the run). A requested-but-not-yet-engaged pause is given a
|
|
758
|
+
// chance to engage first (this arrival at a gate is itself a between-
|
|
759
|
+
// activities boundary), so a pause requested while the run is idle takes
|
|
760
|
+
// effect on the next dispatch rather than slipping one through.
|
|
761
|
+
async _pauseGate() {
|
|
762
|
+
this._maybeEngagePause();
|
|
763
|
+
while (this._paused) {
|
|
764
|
+
await new Promise((resolve, reject) => {
|
|
765
|
+
this._pauseWaiters.push({ resolve, reject });
|
|
766
|
+
});
|
|
767
|
+
// Released by requestResume(); re-check in case another pause was
|
|
768
|
+
// requested in the meantime before we fall through to dispatch.
|
|
769
|
+
this._maybeEngagePause();
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
// (apra-fleet-p2to.1) In-flight bookkeeping bracketing the actual dispatch
|
|
774
|
+
// in agent()/command(). A call is "in flight" from the moment it clears
|
|
775
|
+
// the gate until it fully settles; 'paused' is withheld until this count
|
|
776
|
+
// returns to zero (see _maybeEngagePause), which is what "paused only at
|
|
777
|
+
// zero in-flight activities" means.
|
|
778
|
+
_enterActivity() {
|
|
779
|
+
this._inFlight += 1;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
_exitActivity() {
|
|
783
|
+
this._inFlight = Math.max(0, this._inFlight - 1);
|
|
784
|
+
// Draining the last in-flight activity may complete a deferred pause.
|
|
785
|
+
this._maybeEngagePause();
|
|
786
|
+
}
|
|
787
|
+
|
|
505
788
|
log(msg) {
|
|
506
|
-
console.log(
|
|
789
|
+
console.log(`${this.logPrefix}[Workflow Log] ${msg}`);
|
|
507
790
|
this.emit('log', { phase: this._currentPhase(), msg, runId: this._currentRunId() });
|
|
508
791
|
}
|
|
509
792
|
|
|
@@ -624,15 +907,29 @@ export class FleetWorkflow extends EventEmitter {
|
|
|
624
907
|
* @param {string} prompt
|
|
625
908
|
* @param {AgentOptions} [opts]
|
|
626
909
|
*/
|
|
910
|
+
// (apra-fleet-p2to.1) Public entry: passes through the cooperative pause
|
|
911
|
+
// gate, then brackets the real dispatch with in-flight bookkeeping so a
|
|
912
|
+
// pause only declares 'paused' once every such dispatch has settled. The
|
|
913
|
+
// try/finally guarantees the in-flight count is balanced on every exit
|
|
914
|
+
// path (success, throw, or a gate-rejecting requestStop()).
|
|
627
915
|
async agent(prompt, opts = {}) {
|
|
628
916
|
if (!opts.member_name && !opts.member_id) {
|
|
629
917
|
throw new Error(`[Workflow Error] agent() requires either member_name or member_id`);
|
|
630
918
|
}
|
|
919
|
+
await this._pauseGate();
|
|
920
|
+
this._enterActivity();
|
|
921
|
+
try {
|
|
922
|
+
return await this._agentDispatch(prompt, opts);
|
|
923
|
+
} finally {
|
|
924
|
+
this._exitActivity();
|
|
925
|
+
}
|
|
926
|
+
}
|
|
631
927
|
|
|
928
|
+
async _agentDispatch(prompt, opts = {}) {
|
|
632
929
|
const effectivePhase = opts.phase || this._currentPhase();
|
|
633
930
|
const runId = this._currentRunId();
|
|
634
931
|
if (effectivePhase) {
|
|
635
|
-
console.log(
|
|
932
|
+
console.log(`${this.logPrefix}[Dispatch] phase: ${effectivePhase} | member: ${opts.member_name || opts.member_id} | label: ${opts.label || 'none'}`);
|
|
636
933
|
}
|
|
637
934
|
|
|
638
935
|
let compiledSchema = null;
|
|
@@ -665,6 +962,14 @@ export class FleetWorkflow extends EventEmitter {
|
|
|
665
962
|
|
|
666
963
|
let currentPrompt = initialPrompt;
|
|
667
964
|
let lastActivityMeta = null;
|
|
965
|
+
// apra-fleet-dnri: the session id reported by the attempt that just
|
|
966
|
+
// failed, used as an EXPLICIT resume target by the repair dispatch of
|
|
967
|
+
// the NEXT iteration (see the resume disposition comment on the
|
|
968
|
+
// payload below). Declared outside the loop because the capture site
|
|
969
|
+
// sits after the payload is built within the same iteration. It is
|
|
970
|
+
// re-assigned (or cleared) on every turn, so a repair round never
|
|
971
|
+
// reuses an older round's id.
|
|
972
|
+
let failedAttemptSessionId = null;
|
|
668
973
|
const budget = this._currentBudget();
|
|
669
974
|
|
|
670
975
|
// (apra-fleet-unw.11, F6) Journal replay. `replayKey` is computed
|
|
@@ -781,6 +1086,47 @@ export class FleetWorkflow extends EventEmitter {
|
|
|
781
1086
|
lastActivityMeta = activityMeta;
|
|
782
1087
|
this.emit('activity:start', activityMeta);
|
|
783
1088
|
|
|
1089
|
+
// apra-fleet-dnri -- RESUME DISPOSITION for a schema-repair
|
|
1090
|
+
// re-ask, corrected after a live reproduction:
|
|
1091
|
+
//
|
|
1092
|
+
// A repair dispatch SHOULD continue the session that produced the
|
|
1093
|
+
// invalid output -- by repair time the member may already have
|
|
1094
|
+
// done real, side-effecting work for this request (files edited,
|
|
1095
|
+
// commits made, tracker items claimed), and a fresh session with
|
|
1096
|
+
// the task restated invites it to redo that work. But the naive
|
|
1097
|
+
// way of asking for that -- a bare boolean `true` -- does NOT
|
|
1098
|
+
// mean "the session that just failed". execute_prompt resolves
|
|
1099
|
+
// `resume: true` to `explicitResumeId ?? agent.sessionId`, i.e.
|
|
1100
|
+
// the member's single globally-stored LAST session, shared across
|
|
1101
|
+
// every role with no task scoping. Observed live: a doer's repair
|
|
1102
|
+
// retry landed in the immediately-prior plan-reviewer session and
|
|
1103
|
+
// came back with reviewer-shaped output carrying a field that is
|
|
1104
|
+
// not in the doer schema at all.
|
|
1105
|
+
//
|
|
1106
|
+
// So the repair dispatch names the session EXPLICITLY, by id
|
|
1107
|
+
// (execute_prompt's resume accepts a session-id string for
|
|
1108
|
+
// exactly this). When no id was reported for the failed attempt
|
|
1109
|
+
// (a provider without resume support, or a dispatch that returned
|
|
1110
|
+
// none), we degrade LOUDLY to a fresh, self-contained session and
|
|
1111
|
+
// pass the boolean `false` EXPLICITLY -- never `undefined`, since
|
|
1112
|
+
// execute_prompt's schema declares `.default(true)` on this field
|
|
1113
|
+
// and an omitted key would silently restore the exact
|
|
1114
|
+
// wrong-session bug above.
|
|
1115
|
+
//
|
|
1116
|
+
// Correctness does not depend on the resume landing: the repair
|
|
1117
|
+
// prompt reattaches the original prompt and schema itself (see
|
|
1118
|
+
// buildRepairPrompt), so the re-ask works whether or not the
|
|
1119
|
+
// resumed session still carries the original context.
|
|
1120
|
+
let repairResume = false;
|
|
1121
|
+
if (isRepair) {
|
|
1122
|
+
if (typeof failedAttemptSessionId === 'string' && failedAttemptSessionId) {
|
|
1123
|
+
repairResume = failedAttemptSessionId;
|
|
1124
|
+
} else {
|
|
1125
|
+
console.error(`[Agent Schema Repair] DEGRADED: no session id was reported for the attempt that just failed on member '${opts.member_name || opts.member_id}', so this repair re-ask CANNOT target that session and is being dispatched in a FRESH session (resume: false). Any side-effecting work the member already did for this request is not visible to it; the repair prompt is self-contained, so the re-ask is still answerable.`);
|
|
1126
|
+
repairResume = false;
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
|
|
784
1130
|
const payload = {
|
|
785
1131
|
prompt: currentPrompt,
|
|
786
1132
|
model: opts.model,
|
|
@@ -796,15 +1142,10 @@ export class FleetWorkflow extends EventEmitter {
|
|
|
796
1142
|
sprint_id: opts.sprint_id,
|
|
797
1143
|
// F10: default to a self-contained (non-resumed) session for
|
|
798
1144
|
// the INITIAL dispatch of a workflow-authored prompt. See
|
|
799
|
-
// AgentOptions.resume above and apra-fleet-unw.3.
|
|
800
|
-
//
|
|
801
|
-
//
|
|
802
|
-
|
|
803
|
-
// has the original prompt/schema and its own invalid output
|
|
804
|
-
// in context; buildRepairPrompt() was shrunk accordingly to a
|
|
805
|
-
// lean reminder (validation errors only), since re-sending
|
|
806
|
-
// that context fresh every repair round would waste tokens.
|
|
807
|
-
resume: isRepair ? true : (opts.resume ?? false),
|
|
1145
|
+
// AgentOptions.resume above and apra-fleet-unw.3. The
|
|
1146
|
+
// non-repair value is unchanged; the repair value is resolved
|
|
1147
|
+
// above (apra-fleet-dnri).
|
|
1148
|
+
resume: isRepair ? repairResume : (opts.resume ?? false),
|
|
808
1149
|
// apra-fleet-unw.5: opts pass-through only, no control-flow change here.
|
|
809
1150
|
timeoutMs: opts.timeoutMs,
|
|
810
1151
|
// apra-fleet-unw.10: defaults to the active run's cooperative
|
|
@@ -838,6 +1179,31 @@ export class FleetWorkflow extends EventEmitter {
|
|
|
838
1179
|
}
|
|
839
1180
|
}
|
|
840
1181
|
|
|
1182
|
+
// apra-fleet-dnri: naming the failed attempt's session id
|
|
1183
|
+
// explicitly (above) converts one previously self-healing
|
|
1184
|
+
// case into a hard failure. execute_prompt rejects an
|
|
1185
|
+
// unknown/expired EXPLICIT id up front with
|
|
1186
|
+
// {isError, reason: 'session_not_found'}, making no LLM call,
|
|
1187
|
+
// and its transparent retry-in-a-fresh-session recovery is
|
|
1188
|
+
// gated on `resume === true`, so it does not apply here. Left
|
|
1189
|
+
// alone, the dispatch-error branch below would turn that into
|
|
1190
|
+
// an AgentDispatchError and abort the whole step -- worse
|
|
1191
|
+
// than the boolean behaviour this replaced.
|
|
1192
|
+
// Scope is deliberately narrow: for REPAIR dispatches only,
|
|
1193
|
+
// for that ONE reason, re-dispatch exactly once with the SAME
|
|
1194
|
+
// repair prompt in a fresh self-contained session, inside the
|
|
1195
|
+
// existing maxRepairs budget. No new retry framework, no new
|
|
1196
|
+
// budget, no broader error taxonomy.
|
|
1197
|
+
if (
|
|
1198
|
+
isRepair
|
|
1199
|
+
&& result && result.structuredContent && result.structuredContent.isError
|
|
1200
|
+
&& result.structuredContent.reason === 'session_not_found'
|
|
1201
|
+
) {
|
|
1202
|
+
console.error(`[Agent Schema Repair] the session targeted by this repair re-ask (${payload.resume}) is gone or expired on member '${opts.member_name || opts.member_id}'; re-dispatching the same repair prompt once in a fresh self-contained session (resume: false).`);
|
|
1203
|
+
payload.resume = false;
|
|
1204
|
+
result = await this.fleetApi.executePrompt(payload);
|
|
1205
|
+
}
|
|
1206
|
+
|
|
841
1207
|
// execute_prompt's dispatch-level structuredContent (added
|
|
842
1208
|
// alongside the display text -- see src/tools/execute-prompt.ts)
|
|
843
1209
|
// reports real per-call token usage AND classifies dispatch
|
|
@@ -907,6 +1273,21 @@ export class FleetWorkflow extends EventEmitter {
|
|
|
907
1273
|
// engine falls back to a fresh session (a capability signal, not
|
|
908
1274
|
// a provider-name check). Best-effort: a throwing callback must
|
|
909
1275
|
// never break the dispatch.
|
|
1276
|
+
// apra-fleet-dnri: record THIS attempt's session id so that,
|
|
1277
|
+
// if its output turns out to be schema-invalid, the repair
|
|
1278
|
+
// dispatch of the next iteration can resume exactly this
|
|
1279
|
+
// session by id rather than whatever session the member
|
|
1280
|
+
// happens to have stored last. Assigned unconditionally (to
|
|
1281
|
+
// null when the provider reported none) so a later round can
|
|
1282
|
+
// never silently reuse an earlier round's id -- a provider may
|
|
1283
|
+
// mint a new id per turn. Deliberately NOT nested inside the
|
|
1284
|
+
// opts.onSessionId gate below: most callers pass no callback,
|
|
1285
|
+
// and gating the capture on it would mean the explicit-id
|
|
1286
|
+
// path never runs for them.
|
|
1287
|
+
failedAttemptSessionId = (structured && typeof structured.sessionId === 'string' && structured.sessionId)
|
|
1288
|
+
? structured.sessionId
|
|
1289
|
+
: null;
|
|
1290
|
+
|
|
910
1291
|
if (
|
|
911
1292
|
structured
|
|
912
1293
|
&& typeof structured.sessionId === 'string'
|
|
@@ -992,8 +1373,9 @@ export class FleetWorkflow extends EventEmitter {
|
|
|
992
1373
|
|
|
993
1374
|
if (attempt < maxRepairs) {
|
|
994
1375
|
// Bounded repair: re-dispatch to the SAME member with
|
|
995
|
-
// a
|
|
996
|
-
//
|
|
1376
|
+
// a self-contained prompt (ajv errors + the original
|
|
1377
|
+
// prompt/schema reattached as reference, but NOT the
|
|
1378
|
+
// invalid output). This attempt is still
|
|
997
1379
|
// recorded as its own activity:end (success: false)
|
|
998
1380
|
// so the journal/dashboard show it as a distinct step
|
|
999
1381
|
// before the repair attempt that follows.
|
|
@@ -1011,7 +1393,11 @@ export class FleetWorkflow extends EventEmitter {
|
|
|
1011
1393
|
// dashboard's structured activity data.
|
|
1012
1394
|
console.error(`[Agent API Error]`, repairMsg);
|
|
1013
1395
|
this.emit('activity:end', { ...activityMeta, error: repairMsg, output: text, duration, usage: result.usage, cost, success: false });
|
|
1014
|
-
|
|
1396
|
+
// apra-fleet-dnri: always re-derive from
|
|
1397
|
+
// `initialPrompt`, never from `currentPrompt` --
|
|
1398
|
+
// otherwise repair round 2 would nest round 1's
|
|
1399
|
+
// prompt and the re-ask would grow per attempt.
|
|
1400
|
+
currentPrompt = buildRepairPrompt(errorsText, initialPrompt);
|
|
1015
1401
|
continue;
|
|
1016
1402
|
}
|
|
1017
1403
|
|
|
@@ -1083,7 +1469,23 @@ export class FleetWorkflow extends EventEmitter {
|
|
|
1083
1469
|
* @param {string} cmd
|
|
1084
1470
|
* @param {CommandOptions} [opts]
|
|
1085
1471
|
*/
|
|
1472
|
+
// (apra-fleet-p2to.1) Public entry: same pause-gate + in-flight bracketing
|
|
1473
|
+
// as agent() above. The member-argument guard runs before the gate so a
|
|
1474
|
+
// malformed call fails fast rather than blocking on a pause.
|
|
1086
1475
|
async command(cmd, opts = {}) {
|
|
1476
|
+
if (!opts.member_name && !opts.member_id) {
|
|
1477
|
+
throw new Error(`[Workflow Error] command() requires either member_name or member_id`);
|
|
1478
|
+
}
|
|
1479
|
+
await this._pauseGate();
|
|
1480
|
+
this._enterActivity();
|
|
1481
|
+
try {
|
|
1482
|
+
return await this._commandDispatch(cmd, opts);
|
|
1483
|
+
} finally {
|
|
1484
|
+
this._exitActivity();
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
async _commandDispatch(cmd, opts = {}) {
|
|
1087
1489
|
// (apra-fleet-unw.17, A4) `opts.failSoft`: when set, a command
|
|
1088
1490
|
// failure that would otherwise throw (a well-formed `isError`
|
|
1089
1491
|
// result -> CommandError, a "Member not found" text sniff ->
|
|
@@ -1106,14 +1508,14 @@ export class FleetWorkflow extends EventEmitter {
|
|
|
1106
1508
|
if (!failSoft) throw err;
|
|
1107
1509
|
return { ok: false, output: '', error: err.message };
|
|
1108
1510
|
};
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1511
|
+
// (apra-fleet-p2to.2.3) The member-argument guard lives solely in the
|
|
1512
|
+
// public command() entrypoint above; _commandDispatch() is only ever
|
|
1513
|
+
// reached through it, so a second copy here was dead code. Removed.
|
|
1112
1514
|
|
|
1113
1515
|
const effectivePhase = opts.phase || this._currentPhase();
|
|
1114
1516
|
const runId = this._currentRunId();
|
|
1115
1517
|
if (!opts.silent) {
|
|
1116
|
-
console.log(
|
|
1518
|
+
console.log(`${this.logPrefix}[Command] phase: ${effectivePhase} | member: ${opts.member_name || opts.member_id} | label: ${opts.label || 'none'}`);
|
|
1117
1519
|
}
|
|
1118
1520
|
|
|
1119
1521
|
let finalCmd = cmd;
|
|
@@ -1583,7 +1985,13 @@ export class FleetWorkflow extends EventEmitter {
|
|
|
1583
1985
|
publishState: this.publishState.bind(this),
|
|
1584
1986
|
workflow: this.workflow.bind(this),
|
|
1585
1987
|
group: this.group.bind(this),
|
|
1586
|
-
endGroup: this.endGroup.bind(this)
|
|
1988
|
+
endGroup: this.endGroup.bind(this),
|
|
1989
|
+
// (apra-fleet-p2to.1) Script-facing: lets the workflow declare
|
|
1990
|
+
// where a clean-state boundary is so a deferred pause engages
|
|
1991
|
+
// there. requestPause()/requestResume()/requestStop() stay
|
|
1992
|
+
// instance-only (driven by the viewer/orchestrator, like
|
|
1993
|
+
// requestStop() already is), not part of the script context.
|
|
1994
|
+
setPauseGuard: this.setPauseGuard.bind(this)
|
|
1587
1995
|
};
|
|
1588
1996
|
}
|
|
1589
1997
|
|