@apralabs/apra-fleet 0.4.2 → 0.4.3
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 +38 -5
- package/dist/agents/backlog-groomer.md +25 -0
- package/dist/agents/ci-watcher.md +11 -0
- package/dist/agents/deployer.md +37 -2
- package/dist/agents/doer.md +36 -12
- package/dist/agents/harvester.md +11 -0
- package/dist/agents/integ-test-runner.md +11 -0
- package/dist/agents/kb-reconciler.md +9 -0
- package/dist/agents/plan-reviewer.md +110 -22
- package/dist/agents/planner.md +125 -37
- package/dist/agents/regression-test-runner.md +11 -0
- package/dist/agents/reviewer.md +13 -2
- package/dist/agents/schemas/plan-reviewer-output.json +37 -0
- package/dist/cli/agent-transform.d.ts +83 -2
- package/dist/cli/agent-transform.d.ts.map +1 -1
- package/dist/cli/agent-transform.js +266 -21
- package/dist/cli/agent-transform.js.map +1 -1
- package/dist/cli/auth.d.ts.map +1 -1
- package/dist/cli/auth.js +28 -9
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/config.d.ts +7 -5
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +44 -34
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/install.d.ts +33 -0
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +290 -23
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/kb-directives.d.ts.map +1 -1
- package/dist/cli/kb-directives.js +2 -1
- package/dist/cli/kb-directives.js.map +1 -1
- package/dist/cli/register-member.d.ts.map +1 -1
- package/dist/cli/register-member.js +6 -2
- package/dist/cli/register-member.js.map +1 -1
- package/dist/commands/kb-server.d.ts +3 -0
- package/dist/commands/kb-server.d.ts.map +1 -1
- package/dist/commands/kb-server.js +43 -3
- package/dist/commands/kb-server.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/os/linux.d.ts +6 -0
- package/dist/os/linux.d.ts.map +1 -1
- package/dist/os/linux.js +35 -2
- package/dist/os/linux.js.map +1 -1
- package/dist/os/os-commands.d.ts +61 -2
- package/dist/os/os-commands.d.ts.map +1 -1
- package/dist/os/windows-gitbash.d.ts +5 -0
- package/dist/os/windows-gitbash.d.ts.map +1 -1
- package/dist/os/windows-gitbash.js +15 -0
- package/dist/os/windows-gitbash.js.map +1 -1
- package/dist/os/windows.d.ts +6 -0
- package/dist/os/windows.d.ts.map +1 -1
- package/dist/os/windows.js +46 -3
- package/dist/os/windows.js.map +1 -1
- package/dist/providers/agy.d.ts +115 -6
- package/dist/providers/agy.d.ts.map +1 -1
- package/dist/providers/agy.js +569 -53
- package/dist/providers/agy.js.map +1 -1
- package/dist/providers/claude.d.ts +81 -3
- package/dist/providers/claude.d.ts.map +1 -1
- package/dist/providers/claude.js +344 -10
- package/dist/providers/claude.js.map +1 -1
- package/dist/providers/codex.d.ts +4 -2
- package/dist/providers/codex.d.ts.map +1 -1
- package/dist/providers/codex.js +19 -2
- package/dist/providers/codex.js.map +1 -1
- package/dist/providers/copilot.d.ts +4 -2
- package/dist/providers/copilot.d.ts.map +1 -1
- package/dist/providers/copilot.js +20 -2
- package/dist/providers/copilot.js.map +1 -1
- package/dist/providers/none.d.ts +4 -2
- package/dist/providers/none.d.ts.map +1 -1
- package/dist/providers/none.js +17 -2
- package/dist/providers/none.js.map +1 -1
- package/dist/providers/opencode.d.ts +3 -1
- package/dist/providers/opencode.d.ts.map +1 -1
- package/dist/providers/opencode.js +22 -2
- package/dist/providers/opencode.js.map +1 -1
- package/dist/providers/provider.d.ts +201 -6
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/provider.js +56 -0
- package/dist/providers/provider.js.map +1 -1
- package/dist/services/agy-project.d.ts +102 -0
- package/dist/services/agy-project.d.ts.map +1 -0
- package/dist/services/agy-project.js +356 -0
- package/dist/services/agy-project.js.map +1 -0
- package/dist/services/auth-socket.js +4 -4
- package/dist/services/auth-web.js +1 -1
- package/dist/services/cloud/lifecycle.d.ts.map +1 -1
- package/dist/services/cloud/lifecycle.js +33 -4
- package/dist/services/cloud/lifecycle.js.map +1 -1
- package/dist/services/credential-cleanup.d.ts.map +1 -1
- package/dist/services/credential-cleanup.js +35 -17
- package/dist/services/credential-cleanup.js.map +1 -1
- package/dist/services/exit-drain.d.ts +44 -0
- package/dist/services/exit-drain.d.ts.map +1 -0
- package/dist/services/exit-drain.js +52 -0
- package/dist/services/exit-drain.js.map +1 -0
- package/dist/services/github-app.d.ts.map +1 -1
- package/dist/services/github-app.js +32 -4
- package/dist/services/github-app.js.map +1 -1
- package/dist/services/http-transport.d.ts +1 -0
- package/dist/services/http-transport.d.ts.map +1 -1
- package/dist/services/http-transport.js +48 -1
- package/dist/services/http-transport.js.map +1 -1
- package/dist/services/knowledge/kb-config.d.ts +42 -0
- package/dist/services/knowledge/kb-config.d.ts.map +1 -0
- package/dist/services/knowledge/kb-config.js +54 -0
- package/dist/services/knowledge/kb-config.js.map +1 -0
- package/dist/services/knowledge/kb-providers.d.ts +7 -1
- package/dist/services/knowledge/kb-providers.d.ts.map +1 -1
- package/dist/services/knowledge/kb-providers.js +191 -17
- package/dist/services/knowledge/kb-providers.js.map +1 -1
- package/dist/services/knowledge/require-sqlite-project.d.ts +32 -0
- package/dist/services/knowledge/require-sqlite-project.d.ts.map +1 -0
- package/dist/services/knowledge/require-sqlite-project.js +38 -0
- package/dist/services/knowledge/require-sqlite-project.js.map +1 -0
- package/dist/services/model-pricing.d.ts.map +1 -1
- package/dist/services/model-pricing.js +7 -3
- package/dist/services/model-pricing.js.map +1 -1
- package/dist/services/secret-token.d.ts +38 -0
- package/dist/services/secret-token.d.ts.map +1 -0
- package/dist/services/secret-token.js +51 -0
- package/dist/services/secret-token.js.map +1 -0
- package/dist/services/service-manager/types.d.ts +3 -1
- package/dist/services/service-manager/types.d.ts.map +1 -1
- package/dist/services/service-manager/windows.d.ts +14 -2
- package/dist/services/service-manager/windows.d.ts.map +1 -1
- package/dist/services/service-manager/windows.js +65 -7
- package/dist/services/service-manager/windows.js.map +1 -1
- package/dist/services/ssh.d.ts.map +1 -1
- package/dist/services/ssh.js +58 -2
- package/dist/services/ssh.js.map +1 -1
- package/dist/services/stall/read-log-tail.d.ts.map +1 -1
- package/dist/services/stall/read-log-tail.js +20 -10
- package/dist/services/stall/read-log-tail.js.map +1 -1
- package/dist/services/stall/stall-detector.d.ts +53 -4
- package/dist/services/stall/stall-detector.d.ts.map +1 -1
- package/dist/services/stall/stall-detector.js +212 -34
- package/dist/services/stall/stall-detector.js.map +1 -1
- package/dist/services/strategy.d.ts.map +1 -1
- package/dist/services/strategy.js +79 -2
- package/dist/services/strategy.js.map +1 -1
- package/dist/services/substitution-engine.js +2 -2
- package/dist/services/substitution-engine.js.map +1 -1
- package/dist/services/tool-registry.d.ts.map +1 -1
- package/dist/services/tool-registry.js +5 -3
- package/dist/services/tool-registry.js.map +1 -1
- package/dist/services/vcs/azure-devops.d.ts +66 -1
- package/dist/services/vcs/azure-devops.d.ts.map +1 -1
- package/dist/services/vcs/azure-devops.js +192 -21
- package/dist/services/vcs/azure-devops.js.map +1 -1
- package/dist/services/vcs/types.d.ts +1 -1
- package/dist/skills/fleet-sprint-cli/SKILL.md +18 -0
- package/dist/skills/pm/SKILL.md +1 -1
- package/dist/skills/pm/cost.md +0 -3
- package/dist/skills/pm/fleet-addendum.md +2 -2
- package/dist/tools/check-status.d.ts +7 -4
- package/dist/tools/check-status.d.ts.map +1 -1
- package/dist/tools/check-status.js +2 -0
- package/dist/tools/check-status.js.map +1 -1
- package/dist/tools/compose-permissions.d.ts +6 -0
- package/dist/tools/compose-permissions.d.ts.map +1 -1
- package/dist/tools/compose-permissions.js +182 -34
- package/dist/tools/compose-permissions.js.map +1 -1
- package/dist/tools/credential-store-set.js +1 -1
- package/dist/tools/execute-command.d.ts.map +1 -1
- package/dist/tools/execute-command.js +31 -20
- package/dist/tools/execute-command.js.map +1 -1
- package/dist/tools/execute-prompt.d.ts +15 -2
- package/dist/tools/execute-prompt.d.ts.map +1 -1
- package/dist/tools/execute-prompt.js +1196 -892
- package/dist/tools/execute-prompt.js.map +1 -1
- package/dist/tools/kb-capture.d.ts +2 -2
- package/dist/tools/kb-capture.d.ts.map +1 -1
- package/dist/tools/kb-capture.js +29 -5
- package/dist/tools/kb-capture.js.map +1 -1
- package/dist/tools/kb-export.d.ts +2 -2
- package/dist/tools/kb-export.d.ts.map +1 -1
- package/dist/tools/kb-export.js +3 -28
- package/dist/tools/kb-export.js.map +1 -1
- package/dist/tools/kb-feedback.d.ts.map +1 -1
- package/dist/tools/kb-feedback.js +3 -1
- package/dist/tools/kb-feedback.js.map +1 -1
- package/dist/tools/kb-freshness-sweep.d.ts.map +1 -1
- package/dist/tools/kb-freshness-sweep.js +3 -1
- package/dist/tools/kb-freshness-sweep.js.map +1 -1
- package/dist/tools/kb-import.d.ts.map +1 -1
- package/dist/tools/kb-import.js +2 -1
- package/dist/tools/kb-import.js.map +1 -1
- package/dist/tools/kb-list.d.ts.map +1 -1
- package/dist/tools/kb-list.js +3 -1
- package/dist/tools/kb-list.js.map +1 -1
- package/dist/tools/kb-query.d.ts +2 -2
- package/dist/tools/kb-reconcile-prefilter.d.ts.map +1 -1
- package/dist/tools/kb-reconcile-prefilter.js +3 -1
- package/dist/tools/kb-reconcile-prefilter.js.map +1 -1
- package/dist/tools/kb-resolve-contradiction.d.ts.map +1 -1
- package/dist/tools/kb-resolve-contradiction.js +3 -1
- package/dist/tools/kb-resolve-contradiction.js.map +1 -1
- package/dist/tools/kb-setup.d.ts.map +1 -1
- package/dist/tools/kb-setup.js +125 -20
- package/dist/tools/kb-setup.js.map +1 -1
- package/dist/tools/kb-stats.d.ts.map +1 -1
- package/dist/tools/kb-stats.js +64 -43
- package/dist/tools/kb-stats.js.map +1 -1
- package/dist/tools/list-members.d.ts +2 -2
- package/dist/tools/list-members.d.ts.map +1 -1
- package/dist/tools/list-members.js +1 -0
- package/dist/tools/list-members.js.map +1 -1
- package/dist/tools/member-detail.d.ts +2 -2
- package/dist/tools/member-detail.d.ts.map +1 -1
- package/dist/tools/member-detail.js +17 -0
- package/dist/tools/member-detail.js.map +1 -1
- package/dist/tools/member-reservation.d.ts +58 -1
- package/dist/tools/member-reservation.d.ts.map +1 -1
- package/dist/tools/member-reservation.js +61 -20
- package/dist/tools/member-reservation.js.map +1 -1
- package/dist/tools/provision-auth.d.ts +80 -1
- package/dist/tools/provision-auth.d.ts.map +1 -1
- package/dist/tools/provision-auth.js +142 -54
- package/dist/tools/provision-auth.js.map +1 -1
- package/dist/tools/provision-vcs-auth.d.ts +91 -1
- package/dist/tools/provision-vcs-auth.d.ts.map +1 -1
- package/dist/tools/provision-vcs-auth.js +209 -49
- package/dist/tools/provision-vcs-auth.js.map +1 -1
- package/dist/tools/register-member.d.ts +12 -9
- package/dist/tools/register-member.d.ts.map +1 -1
- package/dist/tools/register-member.js +99 -12
- 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 +27 -2
- package/dist/tools/remove-member.js.map +1 -1
- package/dist/tools/send-email.d.ts +2 -2
- package/dist/tools/setup-git-app.d.ts.map +1 -1
- package/dist/tools/setup-git-app.js +11 -7
- package/dist/tools/setup-git-app.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 +23 -1
- package/dist/tools/shutdown-server.js.map +1 -1
- package/dist/tools/update-member.d.ts +12 -9
- package/dist/tools/update-member.d.ts.map +1 -1
- package/dist/tools/update-member.js +43 -11
- package/dist/tools/update-member.js.map +1 -1
- package/dist/tools/vcs-credential-exec.d.ts +127 -0
- package/dist/tools/vcs-credential-exec.d.ts.map +1 -0
- package/dist/tools/vcs-credential-exec.js +197 -0
- package/dist/tools/vcs-credential-exec.js.map +1 -0
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/log-helpers.d.ts.map +1 -1
- package/dist/utils/log-helpers.js +2 -2
- package/dist/utils/log-helpers.js.map +1 -1
- package/dist/utils/prompt-errors.d.ts.map +1 -1
- package/dist/utils/prompt-errors.js +7 -1
- package/dist/utils/prompt-errors.js.map +1 -1
- package/dist/utils/shell-escape.d.ts +16 -0
- package/dist/utils/shell-escape.d.ts.map +1 -1
- package/dist/utils/shell-escape.js +22 -2
- package/dist/utils/shell-escape.js.map +1 -1
- package/dist/utils/vcs-provider-detect.d.ts +65 -0
- package/dist/utils/vcs-provider-detect.d.ts.map +1 -0
- package/dist/utils/vcs-provider-detect.js +109 -0
- package/dist/utils/vcs-provider-detect.js.map +1 -0
- package/dist/utils/workspace-trust.d.ts +20 -17
- package/dist/utils/workspace-trust.d.ts.map +1 -1
- package/dist/utils/workspace-trust.js +87 -1
- package/dist/utils/workspace-trust.js.map +1 -1
- package/dist/workflows/auto-sprint.js +176 -15
- package/package.json +6 -4
- package/packages/apra-fleet-client/src/client/api.mjs +319 -17
- package/packages/apra-fleet-client/src/client/errors.mjs +6 -2
- package/packages/apra-fleet-se/apra-pm/agents/_shared/GRAPH-SEMANTICS.md +10 -2
- package/packages/apra-fleet-se/apra-pm/agents/backlog-groomer.md +25 -0
- package/packages/apra-fleet-se/apra-pm/agents/ci-watcher.md +11 -0
- package/packages/apra-fleet-se/apra-pm/agents/deployer.md +37 -2
- package/packages/apra-fleet-se/apra-pm/agents/doer.md +36 -12
- package/packages/apra-fleet-se/apra-pm/agents/harvester.md +11 -0
- package/packages/apra-fleet-se/apra-pm/agents/integ-test-runner.md +11 -0
- package/packages/apra-fleet-se/apra-pm/agents/kb-reconciler.md +9 -0
- package/packages/apra-fleet-se/apra-pm/agents/plan-reviewer.md +110 -22
- package/packages/apra-fleet-se/apra-pm/agents/planner.md +125 -37
- package/packages/apra-fleet-se/apra-pm/agents/regression-test-runner.md +11 -0
- package/packages/apra-fleet-se/apra-pm/agents/reviewer.md +13 -2
- package/packages/apra-fleet-se/apra-pm/agents/schemas/plan-reviewer-output.json +37 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/SKILL.md +1 -1
- package/packages/apra-fleet-se/apra-pm/skills/pm/cost.md +0 -3
- package/packages/apra-fleet-se/apra-pm/skills/pm/fleet-addendum.md +2 -2
- package/packages/apra-fleet-se/bin/cli.mjs +149 -1
- package/packages/apra-fleet-se/bin/serve.mjs +78 -4
- package/packages/apra-fleet-se/fleet-sprint/abort.mjs +481 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-children.mjs +491 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-identity-check.mjs +282 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-identity.mjs +208 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-scope.mjs +638 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-transitions.mjs +301 -0
- package/packages/apra-fleet-se/fleet-sprint/branch-ensure.mjs +96 -0
- package/packages/apra-fleet-se/fleet-sprint/conflict-ladder.mjs +8 -0
- package/packages/apra-fleet-se/fleet-sprint/contracts.mjs +61 -14
- package/packages/apra-fleet-se/fleet-sprint/coordination.mjs +516 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-failure.mjs +184 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-role.mjs +1121 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-safety-guard.mjs +216 -4
- package/packages/apra-fleet-se/fleet-sprint/docs/README.md +1 -1
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-sync-redesign.md +276 -0
- package/packages/apra-fleet-se/fleet-sprint/docs/escalate-to-llm-design.md +1 -1
- package/packages/apra-fleet-se/fleet-sprint/docs/run-sprint-cycle-prelude-decision.md +215 -0
- package/packages/apra-fleet-se/fleet-sprint/dolt-literal-guard.mjs +56 -1
- package/packages/apra-fleet-se/fleet-sprint/dolt-sync.mjs +996 -32
- package/packages/apra-fleet-se/fleet-sprint/errors.mjs +267 -0
- package/packages/apra-fleet-se/fleet-sprint/explicit-id-create-guard.mjs +501 -0
- package/packages/apra-fleet-se/fleet-sprint/fatal-diagnostics.mjs +134 -0
- package/packages/apra-fleet-se/fleet-sprint/full-db-fetch-guard.mjs +102 -0
- package/packages/apra-fleet-se/fleet-sprint/git-sync.mjs +556 -0
- package/packages/apra-fleet-se/fleet-sprint/git-topology.mjs +495 -0
- package/packages/apra-fleet-se/fleet-sprint/guarded-modules.mjs +564 -0
- package/packages/apra-fleet-se/fleet-sprint/inline-ladder-guard.mjs +216 -0
- package/packages/apra-fleet-se/fleet-sprint/kb.mjs +728 -0
- package/packages/apra-fleet-se/fleet-sprint/mcp-result.mjs +75 -0
- package/packages/apra-fleet-se/fleet-sprint/member-provisioning.mjs +252 -0
- package/packages/apra-fleet-se/fleet-sprint/member-sync.mjs +581 -0
- package/packages/apra-fleet-se/fleet-sprint/member-target.mjs +93 -0
- package/packages/apra-fleet-se/fleet-sprint/newtask-text.mjs +266 -0
- package/packages/apra-fleet-se/fleet-sprint/parent-notes-staleness.mjs +201 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/deploy.mjs +136 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/develop.mjs +822 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/ensure-sprint-branch.mjs +294 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/final-review.mjs +403 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/harvest.mjs +180 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/integ-test.mjs +358 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/plan.mjs +390 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/publish-pr.mjs +323 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/re-review.mjs +232 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/regression-test.mjs +174 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/replan.mjs +197 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/review.mjs +305 -0
- package/packages/apra-fleet-se/fleet-sprint/prompts.mjs +559 -0
- package/packages/apra-fleet-se/fleet-sprint/role-policies.mjs +1416 -0
- package/packages/apra-fleet-se/fleet-sprint/round-session.mjs +100 -0
- package/packages/apra-fleet-se/fleet-sprint/runner.js +1467 -9798
- package/packages/apra-fleet-se/fleet-sprint/se-posix.mjs +17 -12
- package/packages/apra-fleet-se/fleet-sprint/shell-command-guard.mjs +304 -0
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-sprint-cli/SKILL.md +18 -0
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-supervisor/SKILL.md +21 -2
- package/packages/apra-fleet-se/fleet-sprint/sprint-args.mjs +454 -0
- package/packages/apra-fleet-se/fleet-sprint/sprint-report.mjs +239 -0
- package/packages/apra-fleet-se/fleet-sprint/sprint-state.mjs +163 -0
- package/packages/apra-fleet-se/fleet-sprint/unbracketed-push-guard.mjs +234 -0
- package/packages/apra-fleet-se/fleet-sprint/usage-limit-controller.mjs +211 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-auth.mjs +1279 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-module.mjs +153 -19
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/azure-devops.mjs +71 -21
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/bitbucket.mjs +28 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/github.mjs +131 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/index.mjs +140 -16
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/shell-helpers.mjs +1 -0
- package/packages/apra-fleet-se/fleet-sprint/viewer-extensions.mjs +77 -2
- package/packages/apra-fleet-se/fleet-sprint/worklists.mjs +559 -0
- package/packages/apra-fleet-se/package.json +1 -1
- package/packages/apra-fleet-workflow/src/viewer/index.mjs +17 -6
- package/packages/apra-fleet-workflow/src/workflow/index.mjs +49 -7
- package/skills/fleet/SKILL.md +8 -8
- package/skills/fleet/auth-azdevops.md +14 -3
- package/skills/fleet/auth-bitbucket.md +2 -2
- package/skills/fleet/auth-github.md +5 -4
- package/skills/fleet/onboarding.md +3 -3
- package/skills/fleet/permissions.md +5 -1
- package/skills/fleet/profiles/node.json +1 -1
- package/skills/fleet/troubleshooting.md +3 -3
- package/version.json +1 -1
|
@@ -30,6 +30,19 @@
|
|
|
30
30
|
* // never owns a host (dolt), and
|
|
31
31
|
* // for the generic-git catch-all
|
|
32
32
|
* // it returns true unconditionally.
|
|
33
|
+
* matchesHostForAuth: (host) => boolean // OPTIONAL; the CREDENTIAL-
|
|
34
|
+
* // PROVISIONING axis, for
|
|
35
|
+
* // resolveVcsAuthProviderForHost()
|
|
36
|
+
* // below. Declare it ONLY when a
|
|
37
|
+
* // provider's matchesHost() is
|
|
38
|
+
* // deliberately wider than the set
|
|
39
|
+
* // of hosts it is safe to auto-mint
|
|
40
|
+
* // a push credential for (see
|
|
41
|
+
* // ./github.mjs). Omitted means
|
|
42
|
+
* // "matchesHost is already exactly
|
|
43
|
+
* // right for auth too", which is
|
|
44
|
+
* // the case for every anchored
|
|
45
|
+
* // matcher.
|
|
33
46
|
* capabilitiesForHost: (host) => { canOpenPullRequest: boolean } // OPTIONAL;
|
|
34
47
|
* // capabilities() axis. What a
|
|
35
48
|
* // claimed host supports. MUST stay
|
|
@@ -68,7 +81,7 @@
|
|
|
68
81
|
* // literal -- out of the shared
|
|
69
82
|
* // callers. Only meaningful
|
|
70
83
|
* // alongside parseRepoRef.
|
|
71
|
-
* buildProvisionArgs: (ctx) => { args }|{ error } // OPTIONAL;
|
|
84
|
+
* buildProvisionArgs: (ctx) => { args, note? }|{ error } // OPTIONAL;
|
|
72
85
|
* // provisioning axis. Build the
|
|
73
86
|
* // provision_vcs_auth argument
|
|
74
87
|
* // object for a member of this
|
|
@@ -89,9 +102,16 @@
|
|
|
89
102
|
* // and self-heal paths, where an
|
|
90
103
|
* // out-of-band prompt stalls a
|
|
91
104
|
* // sprint. MUST pass a secret as a
|
|
92
|
-
* // {{
|
|
105
|
+
* // {{secret.NAME}} placeholder,
|
|
93
106
|
* // never a value -- resolution is
|
|
94
107
|
* // hub-side (see ./azure-devops.mjs).
|
|
108
|
+
* // ctx also carries the raw
|
|
109
|
+
* // `remoteUrl` the caller read and
|
|
110
|
+
* // `remoteReadError` (why it could
|
|
111
|
+
* // not be read, else null). An
|
|
112
|
+
* // optional `note` string next to
|
|
113
|
+
* // `args` is logged as an advisory,
|
|
114
|
+
* // never treated as a failure.
|
|
95
115
|
* defaultAuthMode: string|null // OPTIONAL, but declaring it (even
|
|
96
116
|
* // as null) is what makes a provider
|
|
97
117
|
* // part of resolveProvider()'s/
|
|
@@ -186,6 +206,51 @@
|
|
|
186
206
|
* // re-mintable" -- the
|
|
187
207
|
* // pre-existing GitHub/generic
|
|
188
208
|
* // behavior, unchanged.
|
|
209
|
+
* permissionScope: { // OPTIONAL; permission-scope axis.
|
|
210
|
+
* rules: RegExp[], // Patterns whose match means "the
|
|
211
|
+
* describe?: (raw) => string // identity was understood and the
|
|
212
|
+
* } // PRINCIPAL lacks the granted
|
|
213
|
+
* // permission/scope for this
|
|
214
|
+
* // operation". Two things follow
|
|
215
|
+
* // from a match, and neither is
|
|
216
|
+
* // expressible through `rules` +
|
|
217
|
+
* // `precedence` alone:
|
|
218
|
+
* // (1) the verdict is AUTH_DENIED
|
|
219
|
+
* // OUTRIGHT, ahead of every kind
|
|
220
|
+
* // in KIND_PRECEDENCE -- because
|
|
221
|
+
* // a host's permission refusal
|
|
222
|
+
* // usually arrives wrapped in the
|
|
223
|
+
* // host's GENERIC rejection tail
|
|
224
|
+
* // (for git: "failed to push some
|
|
225
|
+
* // refs", which DIVERGED matches
|
|
226
|
+
* // and which outranks AUTH), and
|
|
227
|
+
* // reordering a whole provider's
|
|
228
|
+
* // `precedence` to fix one rule
|
|
229
|
+
* // would re-read every other
|
|
230
|
+
* // ambiguous text too;
|
|
231
|
+
* // (2) the failure is NOT
|
|
232
|
+
* // self-healable -- re-minting the
|
|
233
|
+
* // same principal's credential
|
|
234
|
+
* // reproduces the same permission
|
|
235
|
+
* // set, so runGitStep returns it
|
|
236
|
+
* // immediately with no
|
|
237
|
+
* // onAuthFailure call and no
|
|
238
|
+
* // retry.
|
|
239
|
+
* // `describe(raw)` returns the
|
|
240
|
+
* // operator-facing referral
|
|
241
|
+
* // (which resource, which missing
|
|
242
|
+
* // permission, what an operator
|
|
243
|
+
* // must grant) that travels on
|
|
244
|
+
* // classifyFailure()'s
|
|
245
|
+
* // `operatorReferral`, so the
|
|
246
|
+
* // provider-specific wording never
|
|
247
|
+
* // leaks into a shared caller.
|
|
248
|
+
* // Omitting this hook means "this
|
|
249
|
+
* // provider has no
|
|
250
|
+
* // permission-scope rules" --
|
|
251
|
+
* // every AUTH_DENIED it produces
|
|
252
|
+
* // keeps today's self-heal
|
|
253
|
+
* // treatment.
|
|
189
254
|
* }
|
|
190
255
|
*
|
|
191
256
|
* The manifest is an explicit import list rather than a directory scan on
|
|
@@ -234,26 +299,26 @@ export function registerVcsProvider(impl) {
|
|
|
234
299
|
throw new Error('ERROR: VCSModule: a provider implementation must be an object with a non-empty string `name`.');
|
|
235
300
|
}
|
|
236
301
|
if (impl.rules != null && typeof impl.rules !== 'object') {
|
|
237
|
-
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-object \`rules\` table.`);
|
|
302
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-object \`rules\` table.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
238
303
|
}
|
|
239
304
|
if (impl.extractProviderCode != null && typeof impl.extractProviderCode !== 'function') {
|
|
240
|
-
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-function \`extractProviderCode\`.`);
|
|
305
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-function \`extractProviderCode\`.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
241
306
|
}
|
|
242
307
|
// apra-fleet-5co8.1.1: the host/URL-axis hooks. All OPTIONAL (a
|
|
243
308
|
// classification-only provider declares none of them), but validated up
|
|
244
309
|
// front for the same reason as `extractProviderCode` above -- a malformed
|
|
245
310
|
// hook must fail at registration, not inside resolveVcsProviderForHost()
|
|
246
311
|
// or a remote-URL preflight where the error would mask the real failure.
|
|
247
|
-
for (const hook of ['matchesHost', 'capabilitiesForHost', 'parseRepoRef', 'buildProvisionArgs']) {
|
|
312
|
+
for (const hook of ['matchesHost', 'matchesHostForAuth', 'capabilitiesForHost', 'parseRepoRef', 'buildProvisionArgs']) {
|
|
248
313
|
if (impl[hook] != null && typeof impl[hook] !== 'function') {
|
|
249
|
-
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-function \`${hook}\`.`);
|
|
314
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-function \`${hook}\`.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
250
315
|
}
|
|
251
316
|
}
|
|
252
317
|
// apra-fleet-5co8.1.2: the remedy text quoted into a preflight ERROR. A
|
|
253
318
|
// non-string here would land the literal 'undefined'/'[object Object]' in
|
|
254
319
|
// an operator-facing error, so reject it at registration too.
|
|
255
320
|
if (impl.repoRefHint != null && typeof impl.repoRefHint !== 'string') {
|
|
256
|
-
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-string \`repoRefHint\`.`);
|
|
321
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-string \`repoRefHint\`.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
257
322
|
}
|
|
258
323
|
// apra-fleet-647.1.5.1: the two auth-backend fields folded in from
|
|
259
324
|
// vcs-module.mjs's former BUILDERS/DEFAULT_AUTH_MODES tables. Both are
|
|
@@ -261,7 +326,7 @@ export function registerVcsProvider(impl) {
|
|
|
261
326
|
// them entirely -- see isAuthBackend() below), but validated up front,
|
|
262
327
|
// same rationale as `rules`/`extractProviderCode` above.
|
|
263
328
|
if (Object.prototype.hasOwnProperty.call(impl, 'defaultAuthMode') && impl.defaultAuthMode !== null && typeof impl.defaultAuthMode !== 'string') {
|
|
264
|
-
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-string, non-null \`defaultAuthMode\`.`);
|
|
329
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-string, non-null \`defaultAuthMode\`.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
265
330
|
}
|
|
266
331
|
// apra-fleet-lzfv.4: the create-pull-request RESPONSE mapping. OPTIONAL
|
|
267
332
|
// (a classification-only provider, or one with no PR builder, declares
|
|
@@ -271,17 +336,17 @@ export function registerVcsProvider(impl) {
|
|
|
271
336
|
if (impl.pullRequestResponse != null) {
|
|
272
337
|
const prr = impl.pullRequestResponse;
|
|
273
338
|
if (typeof prr !== 'object') {
|
|
274
|
-
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-object \`pullRequestResponse\`.`);
|
|
339
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-object \`pullRequestResponse\`.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
275
340
|
}
|
|
276
341
|
if (typeof prr.idField !== 'string' || !prr.idField.trim()) {
|
|
277
|
-
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a \`pullRequestResponse\` with no non-empty string \`idField\`.`);
|
|
342
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a \`pullRequestResponse\` with no non-empty string \`idField\`.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
278
343
|
}
|
|
279
344
|
if (typeof prr.map !== 'function') {
|
|
280
|
-
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a \`pullRequestResponse\` with a non-function \`map\`.`);
|
|
345
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a \`pullRequestResponse\` with a non-function \`map\`.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
281
346
|
}
|
|
282
347
|
for (const field of ['webUrlField', 'webUrlTemplate']) {
|
|
283
348
|
if (prr[field] != null && typeof prr[field] !== 'string') {
|
|
284
|
-
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a \`pullRequestResponse\` with a non-string, non-null \`${field}\`.`);
|
|
349
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a \`pullRequestResponse\` with a non-string, non-null \`${field}\`.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
285
350
|
}
|
|
286
351
|
}
|
|
287
352
|
}
|
|
@@ -294,18 +359,44 @@ export function registerVcsProvider(impl) {
|
|
|
294
359
|
if (impl.authRemedy != null) {
|
|
295
360
|
const remedy = impl.authRemedy;
|
|
296
361
|
if (typeof remedy !== 'object') {
|
|
297
|
-
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-object \`authRemedy\`.`);
|
|
362
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-object \`authRemedy\`.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
298
363
|
}
|
|
299
364
|
if (typeof remedy.serverSideReMintable !== 'boolean') {
|
|
300
|
-
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has an \`authRemedy\` with a non-boolean \`serverSideReMintable\`.`);
|
|
365
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has an \`authRemedy\` with a non-boolean \`serverSideReMintable\`.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
301
366
|
}
|
|
302
367
|
if (typeof remedy.hint !== 'string' || !remedy.hint.trim()) {
|
|
303
|
-
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has an \`authRemedy\` with no non-empty string \`hint\`.`);
|
|
368
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has an \`authRemedy\` with no non-empty string \`hint\`.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
// The permission-scope axis. OPTIONAL (omitting it means "this provider
|
|
372
|
+
// declares no permission-scope rules", i.e. today's behavior for every
|
|
373
|
+
// AUTH_DENIED it produces), but validated up front for the same reason as
|
|
374
|
+
// the hooks above: a malformed hook must fail at registration, not inside
|
|
375
|
+
// classifyFailure() where the error would mask the very failure being
|
|
376
|
+
// classified.
|
|
377
|
+
if (impl.permissionScope != null) {
|
|
378
|
+
const scope = impl.permissionScope;
|
|
379
|
+
if (typeof scope !== 'object') {
|
|
380
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-object \`permissionScope\`.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
381
|
+
}
|
|
382
|
+
if (!Array.isArray(scope.rules) || scope.rules.length === 0) {
|
|
383
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a \`permissionScope\` with no non-empty \`rules\` array.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
384
|
+
}
|
|
385
|
+
for (const re of scope.rules) {
|
|
386
|
+
if (!(re instanceof RegExp)) {
|
|
387
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-RegExp entry in \`permissionScope.rules\`.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
388
|
+
}
|
|
389
|
+
if (re.global) {
|
|
390
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a global (/g) entry in \`permissionScope.rules\` -- a /g regex carries lastIndex between calls and would make classifyFailure non-deterministic.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
if (scope.describe != null && typeof scope.describe !== 'function') {
|
|
394
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a \`permissionScope\` with a non-function \`describe\`.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
304
395
|
}
|
|
305
396
|
}
|
|
306
397
|
if (impl.builders != null) {
|
|
307
398
|
if (typeof impl.builders !== 'object') {
|
|
308
|
-
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-object \`builders\` table.`);
|
|
399
|
+
throw new Error(`ERROR: VCSModule: provider "${impl.name}" has a non-object \`builders\` table.`); // shell-guard-allow: escaped backtick is markdown-style inline-code formatting in a thrown developer-facing Error message, never a shell command string -- shell-command-guard flags any literal backtick in any JS string, not just dispatched command-string arguments.
|
|
309
400
|
}
|
|
310
401
|
for (const [action, builder] of Object.entries(impl.builders)) {
|
|
311
402
|
if (typeof builder !== 'function') {
|
|
@@ -416,6 +507,39 @@ export function resolveVcsProviderForHost(host) {
|
|
|
416
507
|
return registry.get('generic-git') || GenericGitVCS;
|
|
417
508
|
}
|
|
418
509
|
|
|
510
|
+
/**
|
|
511
|
+
* The CREDENTIAL-PROVISIONING sibling of resolveVcsProviderForHost().
|
|
512
|
+
*
|
|
513
|
+
* Same dispatch, one deliberate difference: a provider that declares
|
|
514
|
+
* `matchesHostForAuth` is asked THAT instead of `matchesHost`. Recognizing a
|
|
515
|
+
* host for capabilities() ("could a PR be opened here?") is cheap to get
|
|
516
|
+
* wrong -- the worst case is a PR attempt that fails. Recognizing it for auth
|
|
517
|
+
* is not: the caller mints a real push credential and points it at the host,
|
|
518
|
+
* so a substring matcher (see ./github.mjs's matchesHost, deliberately wide
|
|
519
|
+
* for GitHub Enterprise Server) would hand that credential to any lookalike
|
|
520
|
+
* domain containing the vendor name. Providers whose matcher is already
|
|
521
|
+
* anchored (bitbucket, azure-devops) declare no separate hook and are
|
|
522
|
+
* unaffected.
|
|
523
|
+
*
|
|
524
|
+
* Returns null rather than the generic-git catch-all: "no registered auth
|
|
525
|
+
* backend claims this host" is the answer a provisioning caller needs, and a
|
|
526
|
+
* catch-all descriptor there would read as a detection when it is a guess.
|
|
527
|
+
*
|
|
528
|
+
* @param {string|null} host
|
|
529
|
+
* @returns {object|null} an auth-backend provider descriptor, or null.
|
|
530
|
+
*/
|
|
531
|
+
export function resolveVcsAuthProviderForHost(host) {
|
|
532
|
+
for (const provider of [...registry.values()].reverse()) {
|
|
533
|
+
if (provider.name === 'generic-git') continue;
|
|
534
|
+
if (!isAuthBackend(provider)) continue;
|
|
535
|
+
const matcher = typeof provider.matchesHostForAuth === 'function'
|
|
536
|
+
? provider.matchesHostForAuth
|
|
537
|
+
: provider.matchesHost;
|
|
538
|
+
if (typeof matcher === 'function' && matcher(host)) return provider;
|
|
539
|
+
}
|
|
540
|
+
return null;
|
|
541
|
+
}
|
|
542
|
+
|
|
419
543
|
for (const impl of BUILT_IN_PROVIDERS) registerVcsProvider(impl);
|
|
420
544
|
|
|
421
545
|
export { GenericGitVCS, GitHubVCS, DoltVCS, BitbucketVCS, AzureDevOpsVCS };
|
|
@@ -102,6 +102,7 @@ function usesPowerShellQuoting(os, shell) {
|
|
|
102
102
|
* today (src/os/windows.ts cleanExec() spawns `powershell.exe`, and the
|
|
103
103
|
* remote path sends raw PowerShell text to the member's default shell). */
|
|
104
104
|
function escapeForWindowsArgv(value) {
|
|
105
|
+
// shell-guard-allow: ${backslashes} is a JS template interpolation of the regex-replace callback's own parameter, resolved entirely in JavaScript before the escaped string is ever assembled into a command -- not a shell-side expansion.
|
|
105
106
|
return String(value).replace(/(\\*)"/g, (_m, backslashes) => `${backslashes}${backslashes}\\"`);
|
|
106
107
|
}
|
|
107
108
|
|
|
@@ -753,6 +753,69 @@ export function renderResultExtrasHtml(result) {
|
|
|
753
753
|
return verdictHtml + prHtml;
|
|
754
754
|
}
|
|
755
755
|
|
|
756
|
+
/**
|
|
757
|
+
* Pure HTML-string builder for the "Beads database" block: which .beads
|
|
758
|
+
* (dir | prefix | remote) every member's bd resolved to at sprint start, as
|
|
759
|
+
* published by the runner's beads identity precondition under the
|
|
760
|
+
* `beadsIdentity` state namespace ({ expected, expectedFrom, members: {
|
|
761
|
+
* name: { beadsDir, prefix, syncRemote, repoRemote, unresolved?: string[] }
|
|
762
|
+
* }, warnings?: string[] }). A field named in a member's `unresolved` list
|
|
763
|
+
* renders as an amber "?" cell (the probe could not report it, so it was
|
|
764
|
+
* not compared); every published warning renders as one amber row under
|
|
765
|
+
* the table. Returns '' when nothing has been published yet so the caller
|
|
766
|
+
* can omit the block. Same embed rules as renderBeadsHtml: concatenation
|
|
767
|
+
* only, every value through escapeHtml.
|
|
768
|
+
*
|
|
769
|
+
* @param {{ expected?: object|null, expectedFrom?: string, members?: Record<string, object>, warnings?: string[] }|null|undefined} identity
|
|
770
|
+
* @returns {string}
|
|
771
|
+
*/
|
|
772
|
+
export function renderBeadsIdentityHtml(identity) {
|
|
773
|
+
if (!identity || typeof identity !== 'object') return '';
|
|
774
|
+
const members = identity.members && typeof identity.members === 'object' ? identity.members : {};
|
|
775
|
+
const names = Object.keys(members);
|
|
776
|
+
const warnings = Array.isArray(identity.warnings) ? identity.warnings : [];
|
|
777
|
+
if (names.length === 0 && !identity.expected && warnings.length === 0) return '';
|
|
778
|
+
|
|
779
|
+
function cell(value, unresolved) {
|
|
780
|
+
if (unresolved) {
|
|
781
|
+
return '<td data-unresolved="true" title="not reported by this member; not compared" style="padding: 2px 8px; font-size: 11px; font-family: monospace; color: #f59e0b; white-space: nowrap;">?</td>';
|
|
782
|
+
}
|
|
783
|
+
return '<td style="padding: 2px 8px; font-size: 11px; font-family: monospace; white-space: nowrap;">' + escapeHtml(String(value || '')) + '</td>';
|
|
784
|
+
}
|
|
785
|
+
function row(label, id) {
|
|
786
|
+
const rec = id && typeof id === 'object' ? id : {};
|
|
787
|
+
const unresolved = new Set(Array.isArray(rec.unresolved) ? rec.unresolved : []);
|
|
788
|
+
return '<tr>' +
|
|
789
|
+
'<td style="padding: 2px 8px; font-size: 11px; color: #a1a1aa; white-space: nowrap;">' + escapeHtml(String(label)) + '</td>' +
|
|
790
|
+
cell(rec.beadsDir || '(no .beads)', false) +
|
|
791
|
+
cell(rec.prefix || '?', unresolved.has('prefix')) +
|
|
792
|
+
cell(rec.syncRemote || '(unset)', unresolved.has('syncRemote')) +
|
|
793
|
+
'</tr>';
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
let rows = '';
|
|
797
|
+
if (identity.expected) {
|
|
798
|
+
const from = identity.expectedFrom === 'orchestrator' ? 'expected (from orchestrator)' : 'expected';
|
|
799
|
+
rows += row(from, identity.expected);
|
|
800
|
+
}
|
|
801
|
+
for (const name of names) rows += row(name, members[name]);
|
|
802
|
+
|
|
803
|
+
let warningsHtml = '';
|
|
804
|
+
for (const w of warnings) {
|
|
805
|
+
warningsHtml += '<div data-beads-identity-warning="true" style="font-size: 11px; color: #f59e0b; padding: 2px 8px;">WARNING: ' + escapeHtml(String(w)) + '</div>';
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
return '<div data-beads-identity="true" style="margin: 4px 0 8px 0;">' +
|
|
809
|
+
'<div style="font-size: 11px; font-weight: 600; color: #a1a1aa; padding: 2px 8px;">Beads database</div>' +
|
|
810
|
+
'<table style="border-collapse: collapse;">' +
|
|
811
|
+
'<tr>' +
|
|
812
|
+
'<th style="padding: 2px 8px; font-size: 10px; color: #71717a; text-align: left;">member</th>' +
|
|
813
|
+
'<th style="padding: 2px 8px; font-size: 10px; color: #71717a; text-align: left;">dir</th>' +
|
|
814
|
+
'<th style="padding: 2px 8px; font-size: 10px; color: #71717a; text-align: left;">prefix</th>' +
|
|
815
|
+
'<th style="padding: 2px 8px; font-size: 10px; color: #71717a; text-align: left;">remote</th>' +
|
|
816
|
+
'</tr>' + rows + '</table>' + warningsHtml + '</div>';
|
|
817
|
+
}
|
|
818
|
+
|
|
756
819
|
// apra-fleet-eft.37.4 (M3, docs/workflow-core-boundary-refactoring.md):
|
|
757
820
|
// relocated verbatim from packages/apra-fleet-workflow/src/viewer/index.mjs's
|
|
758
821
|
// former findBeadById() -- that was the one place core reached into
|
|
@@ -799,6 +862,7 @@ export const beadsExtension = {
|
|
|
799
862
|
${escapeHtml.toString()}
|
|
800
863
|
${renderBeadsHtml.toString()}
|
|
801
864
|
${renderResultExtrasHtml.toString()}
|
|
865
|
+
${renderBeadsIdentityHtml.toString()}
|
|
802
866
|
${computeSprintProgress.toString()}
|
|
803
867
|
${renderProgressBarHtml.toString()}
|
|
804
868
|
|
|
@@ -923,6 +987,10 @@ export const beadsExtension = {
|
|
|
923
987
|
// without waiting on (or synthesizing) a new server payload.
|
|
924
988
|
const collapsedBeadIds = new Set();
|
|
925
989
|
let lastBeadsData = { sprintTasks: [], backlogTasks: [] };
|
|
990
|
+
// The runner's beads identity precondition publishes under its own
|
|
991
|
+
// 'beadsIdentity' namespace (workflow:state:beadsIdentity); cached
|
|
992
|
+
// here and rendered at the top of the Tasks panel on every rebuild.
|
|
993
|
+
let lastBeadsIdentity = null;
|
|
926
994
|
|
|
927
995
|
function renderBeadsPanel() {
|
|
928
996
|
const container = document.getElementById('extension-beads');
|
|
@@ -950,15 +1018,22 @@ export const beadsExtension = {
|
|
|
950
1018
|
// hook is absent (an older/mismatched core template), rather
|
|
951
1019
|
// than silently dropping the widget.
|
|
952
1020
|
const headerExtra = document.getElementById('panel-header-beads-extra');
|
|
1021
|
+
const identityHtml = renderBeadsIdentityHtml(lastBeadsIdentity);
|
|
953
1022
|
if (headerExtra) {
|
|
954
1023
|
headerExtra.innerHTML = progressHtml;
|
|
955
|
-
container.innerHTML =
|
|
1024
|
+
container.innerHTML = identityHtml
|
|
1025
|
+
+ renderBeadsHtml(lastBeadsData.sprintTasks || [], lastBeadsData.backlogTasks || [], collapsedBeadIds);
|
|
956
1026
|
} else {
|
|
957
|
-
container.innerHTML = progressHtml
|
|
1027
|
+
container.innerHTML = progressHtml + identityHtml
|
|
958
1028
|
+ renderBeadsHtml(lastBeadsData.sprintTasks || [], lastBeadsData.backlogTasks || [], collapsedBeadIds);
|
|
959
1029
|
}
|
|
960
1030
|
}
|
|
961
1031
|
|
|
1032
|
+
document.addEventListener('workflow:state:beadsIdentity', (e) => {
|
|
1033
|
+
lastBeadsIdentity = e.detail || null;
|
|
1034
|
+
renderBeadsPanel();
|
|
1035
|
+
});
|
|
1036
|
+
|
|
962
1037
|
// Single document-level click-delegation listener (same rationale
|
|
963
1038
|
// as the capture-phase 'toggle' listener above) catches every
|
|
964
1039
|
// \`.tree-toggle\` click, including toggles on rows recreated by the
|