@apralabs/apra-fleet 0.4.3 → 0.4.5
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 +114 -33
- package/dist/agents/backlog-groomer.md +80 -27
- package/dist/agents/ci-watcher.md +42 -22
- package/dist/agents/deployer.md +59 -24
- package/dist/agents/doer.md +111 -41
- package/dist/agents/harvester.md +60 -48
- package/dist/agents/integ-test-runner.md +45 -23
- package/dist/agents/kb-reconciler.md +34 -7
- package/dist/agents/plan-reviewer.md +54 -24
- package/dist/agents/planner.md +71 -43
- package/dist/agents/regression-test-runner.md +106 -78
- package/dist/agents/reviewer.md +170 -57
- package/dist/agents/schemas/backlog-groomer-output.json +1 -1
- package/dist/agents/schemas/deployer-output.json +5 -0
- package/dist/agents/schemas/doer-output.json +110 -2
- package/dist/agents/schemas/harvester-input.json +1 -5
- package/dist/agents/schemas/planner-output.json +1 -1
- package/dist/agents/schemas/regression-test-runner-output.json +41 -7
- package/dist/agents/schemas/reviewer-output.json +166 -5
- package/dist/cli/agent-transform.d.ts +7 -0
- package/dist/cli/agent-transform.js +46 -1
- package/dist/cli/auth.d.ts +1 -0
- package/dist/cli/auth.js +42 -8
- package/dist/cli/beads-install.d.ts +35 -0
- package/dist/cli/beads-install.js +125 -0
- package/dist/cli/beads-pin.d.ts +5 -0
- package/dist/cli/beads-pin.js +26 -0
- package/dist/cli/call.d.ts +27 -0
- package/dist/cli/call.js +177 -0
- package/dist/cli/claude-mod.d.ts +75 -0
- package/dist/cli/claude-mod.js +288 -0
- package/dist/cli/config.d.ts +24 -1
- package/dist/cli/config.js +69 -2
- package/dist/cli/dolt-install.d.ts +19 -3
- package/dist/cli/dolt-install.js +51 -16
- package/dist/cli/fleet-se-guard.d.ts +59 -0
- package/dist/cli/fleet-se-guard.js +231 -0
- package/dist/cli/install-guard.d.ts +63 -0
- package/dist/cli/install-guard.js +156 -4
- package/dist/cli/install.d.ts +89 -21
- package/dist/cli/install.js +778 -160
- package/dist/cli/kb-commit.d.ts +2 -1
- package/dist/cli/kb-commit.js +1 -1
- package/dist/cli/kb-import.d.ts +2 -1
- package/dist/cli/kb-import.js +1 -1
- package/dist/cli/kb-profile.d.ts +16 -0
- package/dist/cli/kb-profile.js +81 -0
- package/dist/cli/register-member.js +20 -3
- package/dist/cli/remove-member.d.ts +4 -0
- package/dist/cli/remove-member.js +63 -0
- package/dist/cli/secret.js +9 -0
- package/dist/cli/start.js +62 -4
- package/dist/cli/status.d.ts +3 -0
- package/dist/cli/status.js +45 -12
- package/dist/cli/stop.js +64 -9
- package/dist/cli/uninstall.js +112 -16
- package/dist/cli/update.d.ts +4 -0
- package/dist/cli/update.js +52 -5
- package/dist/cli/watch.js +1 -1
- package/dist/cli/workflow.js +3 -2
- package/dist/commands/kb-server.d.ts +10 -1
- package/dist/commands/kb-server.js +292 -11
- package/dist/hub-service/http-server.d.ts +5 -1
- package/dist/hub-service/http-server.js +55 -5
- package/dist/index.js +177 -9
- package/dist/os/child-env-bound.d.ts +77 -0
- package/dist/os/child-env-bound.js +171 -0
- package/dist/os/git-executable.d.ts +57 -0
- package/dist/os/git-executable.js +85 -0
- package/dist/os/go-concurrency.d.ts +44 -0
- package/dist/os/go-concurrency.js +53 -0
- package/dist/os/index.d.ts +1 -0
- package/dist/os/index.js +1 -0
- package/dist/os/linux.d.ts +9 -2
- package/dist/os/linux.js +50 -15
- package/dist/os/macos.d.ts +1 -1
- package/dist/os/macos.js +2 -11
- package/dist/os/os-commands.d.ts +42 -2
- package/dist/os/os-commands.js +2 -0
- package/dist/os/windows-executable.d.ts +53 -0
- package/dist/os/windows-executable.js +185 -0
- package/dist/os/windows-gitbash.d.ts +24 -14
- package/dist/os/windows-gitbash.js +56 -18
- package/dist/os/windows-wrapper.d.ts +0 -4
- package/dist/os/windows-wrapper.js +2 -1
- package/dist/os/windows.d.ts +7 -2
- package/dist/os/windows.js +109 -32
- package/dist/paths.d.ts +30 -0
- package/dist/paths.js +52 -0
- package/dist/providers/agy.d.ts +6 -2
- package/dist/providers/agy.js +245 -106
- package/dist/providers/claude-permission-denial.d.ts +7 -0
- package/dist/providers/claude-permission-denial.js +137 -0
- package/dist/providers/claude.d.ts +86 -38
- package/dist/providers/claude.js +426 -164
- package/dist/providers/codex.js +5 -1
- package/dist/providers/copilot.js +5 -1
- package/dist/providers/opencode.d.ts +10 -2
- package/dist/providers/opencode.js +114 -53
- package/dist/providers/provider.d.ts +171 -33
- package/dist/providers/provider.js +164 -3
- package/dist/services/agent-provisioner.d.ts +29 -0
- package/dist/services/agent-provisioner.js +107 -0
- package/dist/services/agent-shadow.d.ts +96 -0
- package/dist/services/agent-shadow.js +479 -0
- package/dist/services/agy-project.d.ts +9 -2
- package/dist/services/agy-project.js +22 -19
- package/dist/services/auth-socket.d.ts +43 -0
- package/dist/services/auth-socket.js +97 -26
- package/dist/services/auth-web.js +1 -1
- package/dist/services/budget-awareness.d.ts +11 -11
- package/dist/services/budget-awareness.js +15 -3
- package/dist/services/claude-local-scope-mcp.d.ts +19 -0
- package/dist/services/claude-local-scope-mcp.js +91 -0
- package/dist/services/cloud/aws.js +2 -1
- package/dist/services/cloud/lifecycle.js +19 -2
- package/dist/services/cloud/task-wrapper.d.ts +0 -9
- package/dist/services/cloud/task-wrapper.js +15 -6
- package/dist/services/credential-store.d.ts +33 -0
- package/dist/services/credential-store.js +79 -2
- package/dist/services/event-loop-watchdog.d.ts +32 -0
- package/dist/services/event-loop-watchdog.js +140 -0
- package/dist/services/http-transport.d.ts +78 -1
- package/dist/services/http-transport.js +347 -52
- package/dist/services/in-flight-agents.d.ts +2 -0
- package/dist/services/in-flight-agents.js +4 -0
- package/dist/services/kb-tool-profile.d.ts +36 -0
- package/dist/services/kb-tool-profile.js +88 -0
- package/dist/services/knowledge/bible-basis-filter.d.ts +53 -0
- package/dist/services/knowledge/bible-basis-filter.js +134 -0
- package/dist/services/knowledge/bible-blob-id.d.ts +44 -0
- package/dist/services/knowledge/bible-blob-id.js +122 -0
- package/dist/services/knowledge/bible-import.d.ts +173 -0
- package/dist/services/knowledge/bible-import.js +344 -0
- package/dist/services/knowledge/file-hash.d.ts +31 -0
- package/dist/services/knowledge/file-hash.js +155 -24
- package/dist/services/knowledge/http-provider.d.ts +305 -21
- package/dist/services/knowledge/http-provider.js +801 -119
- package/dist/services/knowledge/kb-config.d.ts +65 -1
- package/dist/services/knowledge/kb-config.js +143 -3
- package/dist/services/knowledge/kb-http-auth-state.d.ts +26 -0
- package/dist/services/knowledge/kb-http-auth-state.js +40 -0
- package/dist/services/knowledge/kb-maintainer-grant.d.ts +15 -0
- package/dist/services/knowledge/kb-maintainer-grant.js +34 -0
- package/dist/services/knowledge/kb-providers.d.ts +13 -2
- package/dist/services/knowledge/kb-providers.js +75 -37
- package/dist/services/knowledge/kb-removed-scope-keys.d.ts +28 -0
- package/dist/services/knowledge/kb-removed-scope-keys.js +59 -0
- package/dist/services/knowledge/kb-scopes.d.ts +14 -0
- package/dist/services/knowledge/kb-scopes.js +47 -0
- package/dist/services/knowledge/kb-self.d.ts +204 -0
- package/dist/services/knowledge/kb-self.js +358 -0
- package/dist/services/knowledge/member-bible-view.d.ts +21 -0
- package/dist/services/knowledge/member-bible-view.js +207 -0
- package/dist/services/knowledge/path-validation.d.ts +7 -0
- package/dist/services/knowledge/path-validation.js +11 -0
- package/dist/services/knowledge/pre-init.js +1 -0
- package/dist/services/knowledge/project-slug.js +5 -4
- package/dist/services/knowledge/repository-header.d.ts +77 -0
- package/dist/services/knowledge/repository-header.js +233 -0
- package/dist/services/knowledge/require-sqlite-project.d.ts +1 -1
- package/dist/services/knowledge/require-sqlite-project.js +1 -1
- package/dist/services/knowledge/sqlite-provider.d.ts +233 -11
- package/dist/services/knowledge/sqlite-provider.js +719 -45
- package/dist/services/knowledge/types.d.ts +59 -3
- package/dist/services/member-access-secret.d.ts +70 -0
- package/dist/services/member-access-secret.js +195 -0
- package/dist/services/member-busy.d.ts +12 -0
- package/dist/services/member-busy.js +20 -0
- package/dist/services/member-call-counts.d.ts +24 -0
- package/dist/services/member-call-counts.js +58 -0
- package/dist/services/member-config-io.d.ts +193 -0
- package/dist/services/member-config-io.js +446 -0
- package/dist/services/member-fleet-install.d.ts +710 -0
- package/dist/services/member-fleet-install.js +1896 -0
- package/dist/services/member-secret-env.d.ts +42 -0
- package/dist/services/member-secret-env.js +68 -0
- package/dist/services/member-tool-allowlist.d.ts +49 -0
- package/dist/services/member-tool-allowlist.js +115 -0
- package/dist/services/model-pricing.d.ts +19 -0
- package/dist/services/model-pricing.js +54 -8
- package/dist/services/port-holder.d.ts +86 -0
- package/dist/services/port-holder.js +352 -0
- package/dist/services/preflight-check.js +2 -0
- package/dist/services/registry.d.ts +13 -2
- package/dist/services/registry.js +27 -1
- package/dist/services/relay-strategy.d.ts +2 -0
- package/dist/services/relay-strategy.js +8 -0
- package/dist/services/server-lifecycle.d.ts +26 -0
- package/dist/services/server-lifecycle.js +85 -0
- package/dist/services/service-manager/index.d.ts +7 -1
- package/dist/services/service-manager/index.js +17 -4
- package/dist/services/service-manager/linux.d.ts +1 -1
- package/dist/services/service-manager/linux.js +15 -7
- package/dist/services/service-manager/macos.d.ts +11 -1
- package/dist/services/service-manager/macos.js +45 -7
- package/dist/services/service-manager/service-path.d.ts +24 -0
- package/dist/services/service-manager/service-path.js +55 -0
- package/dist/services/service-manager/types.d.ts +54 -3
- package/dist/services/service-manager/types.js +29 -0
- package/dist/services/service-manager/windows.d.ts +187 -3
- package/dist/services/service-manager/windows.js +684 -50
- package/dist/services/service-notice.d.ts +21 -0
- package/dist/services/service-notice.js +81 -0
- package/dist/services/service-start-guard.d.ts +20 -0
- package/dist/services/service-start-guard.js +86 -0
- package/dist/services/session-cost.d.ts +24 -0
- package/dist/services/session-cost.js +105 -0
- package/dist/services/session-mcp-config.d.ts +83 -0
- package/dist/services/session-mcp-config.js +211 -0
- package/dist/services/session-registry.d.ts +13 -0
- package/dist/services/session-registry.js +13 -0
- package/dist/services/session-roots.d.ts +67 -0
- package/dist/services/session-roots.js +126 -0
- package/dist/services/sftp.d.ts +34 -0
- package/dist/services/sftp.js +304 -76
- package/dist/services/shell-probe.d.ts +0 -24
- package/dist/services/shell-probe.js +28 -3
- package/dist/services/singleton.d.ts +68 -2
- package/dist/services/singleton.js +168 -11
- package/dist/services/sprint-coordination.js +9 -3
- package/dist/services/ssh.d.ts +27 -0
- package/dist/services/ssh.js +229 -38
- package/dist/services/stall/find-log-file.js +12 -5
- package/dist/services/stall/index.d.ts +1 -1
- package/dist/services/stall/read-log-tail.d.ts +23 -0
- package/dist/services/stall/read-log-tail.js +33 -2
- package/dist/services/stall/stall-detector.d.ts +25 -1
- package/dist/services/stall/stall-detector.js +85 -6
- package/dist/services/stall/stall-poller.d.ts +16 -0
- package/dist/services/stall/stall-poller.js +50 -6
- package/dist/services/statusline.d.ts +21 -0
- package/dist/services/statusline.js +97 -1
- package/dist/services/stopped-marker.d.ts +16 -0
- package/dist/services/stopped-marker.js +55 -0
- package/dist/services/strategy.d.ts +33 -1
- package/dist/services/strategy.js +86 -17
- package/dist/services/supervisor-service-cleanup.d.ts +52 -0
- package/dist/services/supervisor-service-cleanup.js +333 -0
- package/dist/services/tool-registry.d.ts +8 -1
- package/dist/services/tool-registry.js +251 -62
- package/dist/services/tool-scope.d.ts +91 -0
- package/dist/services/tool-scope.js +124 -0
- package/dist/services/vcs/azure-devops.js +10 -0
- package/dist/services/vcs/bitbucket.d.ts +22 -1
- package/dist/services/vcs/bitbucket.js +163 -17
- package/dist/services/vcs/types.d.ts +25 -2
- package/dist/services/watch/project-resolver.js +3 -1
- package/dist/skills/auto-sprint-args/SKILL.md +2 -2
- package/dist/skills/fleet-sprint-cli/SKILL.md +39 -15
- package/dist/skills/pm/SKILL.md +3 -3
- package/dist/skills/pm/cost.md +5 -1
- package/dist/skills/pm/index.md +11 -9
- package/dist/skills/pm/kb-reconcile.md +29 -14
- package/dist/skills/pm/kb-review.md +1 -0
- package/dist/skills/pm/sprint.md +7 -6
- package/dist/tools/check-status.d.ts +104 -5
- package/dist/tools/check-status.js +326 -57
- package/dist/tools/child-id-allocator.d.ts +2 -2
- package/dist/tools/child-id-allocator.js +1 -1
- package/dist/tools/code-index-heal.d.ts +8 -0
- package/dist/tools/code-index-heal.js +21 -0
- package/dist/tools/code-index-state.d.ts +45 -0
- package/dist/tools/code-index-state.js +115 -0
- package/dist/tools/code-intelligence-codebase-memory.js +6 -33
- package/dist/tools/code-intelligence-freshness.js +1 -1
- package/dist/tools/code-intelligence-gitnexus.d.ts +49 -0
- package/dist/tools/code-intelligence-gitnexus.js +488 -55
- package/dist/tools/code-intelligence-kb-enrich.js +7 -6
- package/dist/tools/code-intelligence-readiness.d.ts +156 -0
- package/dist/tools/code-intelligence-readiness.js +291 -0
- package/dist/tools/code-intelligence-reindex.d.ts +219 -0
- package/dist/tools/code-intelligence-reindex.js +602 -50
- package/dist/tools/code-intelligence-telemetry.d.ts +6 -1
- package/dist/tools/code-intelligence-telemetry.js +12 -3
- package/dist/tools/code-intelligence.d.ts +81 -31
- package/dist/tools/code-intelligence.js +156 -52
- package/dist/tools/compose-permissions.d.ts +57 -2
- package/dist/tools/compose-permissions.js +497 -44
- package/dist/tools/execute-command.d.ts +11 -0
- package/dist/tools/execute-command.js +92 -18
- package/dist/tools/execute-prompt.d.ts +59 -15
- package/dist/tools/execute-prompt.js +550 -135
- package/dist/tools/fleet-snapshot.d.ts +21 -0
- package/dist/tools/fleet-snapshot.js +78 -0
- package/dist/tools/kb-bible-commit.d.ts +79 -0
- package/dist/tools/kb-bible-commit.js +348 -0
- package/dist/tools/kb-capture.d.ts +15 -11
- package/dist/tools/kb-capture.js +42 -11
- package/dist/tools/kb-context.d.ts +27 -7
- package/dist/tools/kb-context.js +85 -14
- package/dist/tools/kb-demote.d.ts +27 -0
- package/dist/tools/kb-demote.js +37 -0
- package/dist/tools/kb-export.d.ts +128 -7
- package/dist/tools/kb-export.js +273 -67
- package/dist/tools/kb-feedback.d.ts +15 -9
- package/dist/tools/kb-feedback.js +27 -11
- package/dist/tools/kb-freshness-sweep.d.ts +11 -7
- package/dist/tools/kb-freshness-sweep.js +7 -7
- package/dist/tools/kb-harvest.d.ts +11 -7
- package/dist/tools/kb-harvest.js +35 -16
- package/dist/tools/kb-import.d.ts +42 -10
- package/dist/tools/kb-import.js +185 -160
- package/dist/tools/kb-invalidate.d.ts +26 -11
- package/dist/tools/kb-invalidate.js +118 -12
- package/dist/tools/kb-list.d.ts +14 -10
- package/dist/tools/kb-list.js +61 -13
- package/dist/tools/kb-promote.d.ts +11 -7
- package/dist/tools/kb-promote.js +16 -8
- package/dist/tools/kb-query.d.ts +24 -11
- package/dist/tools/kb-query.js +230 -23
- package/dist/tools/kb-reconcile-prefilter.d.ts +11 -7
- package/dist/tools/kb-reconcile-prefilter.js +10 -8
- package/dist/tools/kb-resolve-contradiction.d.ts +11 -7
- package/dist/tools/kb-resolve-contradiction.js +7 -7
- package/dist/tools/kb-session-prime.d.ts +14 -7
- package/dist/tools/kb-session-prime.js +127 -47
- package/dist/tools/kb-setup.d.ts +31 -4
- package/dist/tools/kb-setup.js +172 -20
- package/dist/tools/kb-stats.d.ts +11 -10
- package/dist/tools/kb-stats.js +22 -41
- package/dist/tools/list-members.js +6 -3
- package/dist/tools/member-detail.d.ts +3 -0
- package/dist/tools/member-detail.js +95 -20
- package/dist/tools/member-reservation.d.ts +2 -2
- package/dist/tools/provision-auth.d.ts +39 -1
- package/dist/tools/provision-auth.js +269 -47
- package/dist/tools/provision-vcs-auth.d.ts +30 -5
- package/dist/tools/provision-vcs-auth.js +53 -7
- package/dist/tools/receive-files.js +8 -3
- package/dist/tools/register-member.d.ts +34 -8
- package/dist/tools/register-member.js +76 -58
- package/dist/tools/remove-member.js +110 -32
- package/dist/tools/send-email.d.ts +2 -2
- package/dist/tools/send-files.js +9 -6
- package/dist/tools/send-message.d.ts +3 -0
- package/dist/tools/send-message.js +15 -2
- package/dist/tools/session-stats.d.ts +17 -0
- package/dist/tools/session-stats.js +27 -0
- package/dist/tools/shutdown-server.js +5 -0
- package/dist/tools/stop-prompt.js +3 -1
- package/dist/tools/update-agent-cli.d.ts +19 -0
- package/dist/tools/update-agent-cli.js +59 -2
- package/dist/tools/update-member.d.ts +13 -10
- package/dist/tools/update-member.js +138 -7
- package/dist/tools/vcs-credential-exec.d.ts +45 -3
- package/dist/tools/vcs-credential-exec.js +98 -13
- package/dist/types.d.ts +98 -1
- package/dist/utils/agent-helpers.js +2 -0
- package/dist/utils/auth-env.d.ts +15 -4
- package/dist/utils/auth-env.js +52 -23
- package/dist/utils/find-on-path.d.ts +37 -0
- package/dist/utils/find-on-path.js +85 -0
- package/dist/utils/log-helpers.d.ts +37 -0
- package/dist/utils/log-helpers.js +106 -20
- package/dist/utils/owner-only-fs.d.ts +56 -0
- package/dist/utils/owner-only-fs.js +98 -0
- package/dist/utils/process-utils.d.ts +28 -0
- package/dist/utils/process-utils.js +72 -0
- package/dist/utils/prompt-errors.js +4 -1
- package/dist/utils/redact-known-secrets.d.ts +17 -0
- package/dist/utils/redact-known-secrets.js +70 -0
- package/dist/utils/session-caller.d.ts +4 -2
- package/dist/utils/session-caller.js +3 -2
- package/dist/utils/shell-escape.d.ts +42 -3
- package/dist/utils/shell-escape.js +70 -4
- package/dist/utils/skill-matrix.js +1 -1
- package/dist/utils/ssh-error-messages.js +3 -0
- package/dist/utils/vcs-provider-detect.js +2 -2
- package/dist/utils/workspace-trust.d.ts +24 -1
- package/dist/utils/workspace-trust.js +21 -17
- package/dist/workflows/auto-sprint.js +468 -52
- package/package.json +15 -9
- package/packages/apra-fleet-client/package.json +2 -2
- package/packages/apra-fleet-client/src/client/api.mjs +722 -38
- package/packages/apra-fleet-client/src/client/auto-start.mjs +434 -0
- package/packages/apra-fleet-client/src/client/client.mjs +9 -0
- package/packages/apra-fleet-client/src/client/factory.mjs +23 -4
- package/packages/apra-fleet-client/src/client/reconnecting-transport.mjs +170 -0
- package/packages/apra-fleet-client/src/client/server-resolution.mjs +267 -30
- package/packages/apra-fleet-client/src/client/transport.mjs +43 -3
- package/packages/apra-fleet-se/apra-pm/agents/backlog-groomer.md +80 -27
- package/packages/apra-fleet-se/apra-pm/agents/ci-watcher.md +42 -22
- package/packages/apra-fleet-se/apra-pm/agents/deployer.md +59 -24
- package/packages/apra-fleet-se/apra-pm/agents/doer.md +111 -41
- package/packages/apra-fleet-se/apra-pm/agents/harvester.md +60 -48
- package/packages/apra-fleet-se/apra-pm/agents/integ-test-runner.md +45 -23
- package/packages/apra-fleet-se/apra-pm/agents/kb-reconciler.md +34 -7
- package/packages/apra-fleet-se/apra-pm/agents/plan-reviewer.md +54 -24
- package/packages/apra-fleet-se/apra-pm/agents/planner.md +71 -43
- package/packages/apra-fleet-se/apra-pm/agents/regression-test-runner.md +106 -78
- package/packages/apra-fleet-se/apra-pm/agents/reviewer.md +170 -57
- package/packages/apra-fleet-se/apra-pm/agents/schemas/backlog-groomer-output.json +1 -1
- package/packages/apra-fleet-se/apra-pm/agents/schemas/deployer-output.json +5 -0
- package/packages/apra-fleet-se/apra-pm/agents/schemas/doer-output.json +110 -2
- package/packages/apra-fleet-se/apra-pm/agents/schemas/harvester-input.json +1 -5
- package/packages/apra-fleet-se/apra-pm/agents/schemas/planner-output.json +1 -1
- package/packages/apra-fleet-se/apra-pm/agents/schemas/regression-test-runner-output.json +41 -7
- package/packages/apra-fleet-se/apra-pm/agents/schemas/reviewer-output.json +166 -5
- package/packages/apra-fleet-se/apra-pm/skills/pm/SKILL.md +3 -3
- package/packages/apra-fleet-se/apra-pm/skills/pm/cost.md +5 -1
- package/packages/apra-fleet-se/apra-pm/skills/pm/index.md +11 -9
- package/packages/apra-fleet-se/apra-pm/skills/pm/kb-reconcile.md +29 -14
- package/packages/apra-fleet-se/apra-pm/skills/pm/kb-review.md +1 -0
- package/packages/apra-fleet-se/apra-pm/skills/pm/sprint.md +7 -6
- package/packages/apra-fleet-se/bin/cli.mjs +282 -79
- package/packages/apra-fleet-se/bin/serve.mjs +186 -15
- package/packages/apra-fleet-se/fleet-sprint/abort.mjs +234 -46
- package/packages/apra-fleet-se/fleet-sprint/backlog-role.mjs +93 -0
- package/packages/apra-fleet-se/fleet-sprint/bd-sync-command.mjs +69 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-children.mjs +229 -53
- package/packages/apra-fleet-se/fleet-sprint/beads-identity-check.mjs +576 -33
- package/packages/apra-fleet-se/fleet-sprint/beads-identity.mjs +9 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-lock-probe.mjs +176 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-memory-hygiene.mjs +201 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-reachability.mjs +126 -0
- package/packages/apra-fleet-se/fleet-sprint/beads-scope.mjs +271 -7
- package/packages/apra-fleet-se/fleet-sprint/beads-transitions.mjs +154 -8
- package/packages/apra-fleet-se/fleet-sprint/ci-gate.mjs +353 -0
- package/packages/apra-fleet-se/fleet-sprint/conflict-ladder.mjs +12 -0
- package/packages/apra-fleet-se/fleet-sprint/contracts.mjs +142 -3
- package/packages/apra-fleet-se/fleet-sprint/coordination.mjs +48 -8
- package/packages/apra-fleet-se/fleet-sprint/decision-notify.mjs +338 -0
- package/packages/apra-fleet-se/fleet-sprint/decision-wait.mjs +731 -0
- package/packages/apra-fleet-se/fleet-sprint/decisions.mjs +372 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-accounting.mjs +270 -0
- package/packages/apra-fleet-se/fleet-sprint/dispatch-failure.mjs +22 -2
- package/packages/apra-fleet-se/fleet-sprint/dispatch-role.mjs +244 -22
- package/packages/apra-fleet-se/fleet-sprint/docs/README.md +56 -15
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-sync-redesign.md +6 -1
- package/packages/apra-fleet-se/fleet-sprint/docs/fleet-sprint-diagram.md +3 -3
- package/packages/apra-fleet-se/fleet-sprint/dolt-settle.mjs +9 -3
- package/packages/apra-fleet-se/fleet-sprint/dolt-sync.mjs +651 -37
- package/packages/apra-fleet-se/fleet-sprint/errors.mjs +282 -15
- package/packages/apra-fleet-se/fleet-sprint/explicit-id-create-guard.mjs +4 -4
- package/packages/apra-fleet-se/fleet-sprint/git-sync.mjs +207 -10
- package/packages/apra-fleet-se/fleet-sprint/git-topology.mjs +169 -10
- package/packages/apra-fleet-se/fleet-sprint/guarded-modules.mjs +88 -5
- package/packages/apra-fleet-se/fleet-sprint/kb-hints.mjs +181 -0
- package/packages/apra-fleet-se/fleet-sprint/kb-injection.mjs +64 -0
- package/packages/apra-fleet-se/fleet-sprint/kb-maintainer.mjs +298 -0
- package/packages/apra-fleet-se/fleet-sprint/kb.mjs +1896 -305
- package/packages/apra-fleet-se/fleet-sprint/lower-quality.mjs +39 -0
- package/packages/apra-fleet-se/fleet-sprint/member-align.mjs +391 -0
- package/packages/apra-fleet-se/fleet-sprint/member-call.mjs +374 -0
- package/packages/apra-fleet-se/fleet-sprint/member-init-probe.mjs +644 -0
- package/packages/apra-fleet-se/fleet-sprint/member-provisioning.mjs +454 -1
- package/packages/apra-fleet-se/fleet-sprint/member-sync.mjs +250 -29
- package/packages/apra-fleet-se/fleet-sprint/orphan-reclaim.mjs +153 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/deploy.mjs +129 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/develop.mjs +302 -52
- package/packages/apra-fleet-se/fleet-sprint/phases/ensure-sprint-branch.mjs +1 -0
- package/packages/apra-fleet-se/fleet-sprint/phases/final-review.mjs +142 -21
- package/packages/apra-fleet-se/fleet-sprint/phases/harvest.mjs +118 -36
- package/packages/apra-fleet-se/fleet-sprint/phases/integ-test.mjs +6 -6
- package/packages/apra-fleet-se/fleet-sprint/phases/plan.mjs +27 -18
- package/packages/apra-fleet-se/fleet-sprint/phases/publish-pr.mjs +99 -52
- package/packages/apra-fleet-se/fleet-sprint/phases/re-review.mjs +58 -10
- package/packages/apra-fleet-se/fleet-sprint/phases/regression-test.mjs +16 -11
- package/packages/apra-fleet-se/fleet-sprint/phases/replan.mjs +36 -3
- package/packages/apra-fleet-se/fleet-sprint/phases/review.mjs +90 -15
- package/packages/apra-fleet-se/fleet-sprint/pr-body.mjs +272 -0
- package/packages/apra-fleet-se/fleet-sprint/prompts.mjs +113 -28
- package/packages/apra-fleet-se/fleet-sprint/role-policies.mjs +19 -1
- package/packages/apra-fleet-se/fleet-sprint/runner.js +1631 -213
- package/packages/apra-fleet-se/fleet-sprint/se-os-commands.mjs +26 -0
- package/packages/apra-fleet-se/fleet-sprint/se-posix.mjs +183 -0
- package/packages/apra-fleet-se/fleet-sprint/se-windows.mjs +138 -0
- package/packages/apra-fleet-se/fleet-sprint/set-aside.mjs +288 -0
- package/packages/apra-fleet-se/fleet-sprint/shell-command-guard.mjs +44 -1
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-sprint-cli/SKILL.md +39 -15
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-supervisor/SKILL.md +87 -32
- package/packages/apra-fleet-se/fleet-sprint/sprint-args.mjs +158 -2
- package/packages/apra-fleet-se/fleet-sprint/sprint-report.mjs +132 -11
- package/packages/apra-fleet-se/fleet-sprint/sprint-state.mjs +31 -0
- package/packages/apra-fleet-se/fleet-sprint/usage-limit-controller.mjs +7 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-auth.mjs +774 -35
- package/packages/apra-fleet-se/fleet-sprint/vcs-module.mjs +134 -7
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/azure-devops.mjs +99 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/bitbucket.mjs +811 -17
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/github.mjs +223 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/index.mjs +138 -1
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/shell-helpers.mjs +8 -4
- package/packages/apra-fleet-se/fleet-sprint/verify-block.mjs +152 -0
- package/packages/apra-fleet-se/fleet-sprint/viewer-extensions.mjs +460 -23
- package/packages/apra-fleet-se/fleet-sprint/worklists.mjs +59 -3
- package/packages/apra-fleet-se/package.json +2 -2
- package/packages/apra-fleet-se/src/supervisor/api.mjs +1059 -0
- package/packages/apra-fleet-se/src/supervisor/backlog-member.mjs +332 -0
- package/packages/apra-fleet-se/src/supervisor/backlog.mjs +982 -0
- package/packages/apra-fleet-se/src/supervisor/beads-identity.mjs +246 -0
- package/packages/apra-fleet-se/src/supervisor/beads-view.mjs +438 -0
- package/packages/apra-fleet-se/src/supervisor/child-port.mjs +36 -0
- package/packages/apra-fleet-se/src/supervisor/dashboard.mjs +1662 -0
- package/packages/apra-fleet-se/src/supervisor/dolt-mutex.mjs +370 -0
- package/packages/apra-fleet-se/src/supervisor/dolt-orphan-sweep.mjs +338 -0
- package/packages/apra-fleet-se/src/supervisor/fleet-members.mjs +292 -0
- package/packages/apra-fleet-se/src/supervisor/history-view.mjs +276 -0
- package/packages/apra-fleet-se/src/supervisor/history.mjs +335 -0
- package/packages/apra-fleet-se/src/supervisor/id-allocator.mjs +611 -0
- package/packages/apra-fleet-se/src/supervisor/launch-form.mjs +444 -0
- package/packages/apra-fleet-se/src/supervisor/ledger.mjs +629 -0
- package/packages/apra-fleet-se/src/supervisor/lib/exec-bd.mjs +303 -0
- package/packages/apra-fleet-se/src/supervisor/log-timestamp.mjs +51 -0
- package/packages/apra-fleet-se/src/supervisor/log-view.mjs +159 -0
- package/packages/apra-fleet-se/src/supervisor/proxy.mjs +499 -0
- package/packages/apra-fleet-se/src/supervisor/readopt.mjs +136 -0
- package/packages/apra-fleet-se/src/supervisor/reconcile.mjs +263 -0
- package/packages/apra-fleet-se/src/supervisor/rename-with-retry.mjs +87 -0
- package/packages/apra-fleet-se/src/supervisor/scope-overlap.mjs +327 -0
- package/packages/apra-fleet-se/src/supervisor/self-log.mjs +133 -0
- package/packages/apra-fleet-se/src/supervisor/server.mjs +542 -0
- package/packages/apra-fleet-se/src/supervisor/spawner.mjs +544 -0
- package/packages/apra-fleet-se/src/supervisor/sprint-identity.mjs +96 -0
- package/packages/apra-fleet-se/src/supervisor/watchdog.mjs +993 -0
- package/packages/apra-fleet-workflow/package.json +3 -2
- package/packages/apra-fleet-workflow/src/viewer/index.mjs +150 -14
- package/packages/apra-fleet-workflow/src/viewer/request-guard.mjs +222 -0
- package/packages/apra-fleet-workflow/src/viewer/run-summary.mjs +127 -0
- package/packages/apra-fleet-workflow/src/workflow/index.mjs +105 -7
- package/packages/apra-fleet-workflow/src/workflow/pricing.mjs +75 -25
- package/plugins/claude-code/fleet-status/.claude-plugin/plugin.json +7 -0
- package/plugins/claude-code/fleet-status/hooks/hooks.json +1 -0
- package/plugins/claude-code/fleet-status/hooks/register.tsx +906 -0
- package/plugins/claude-code/fleet-status/types/index.d.ts +88 -0
- package/skills/fleet/auth-bitbucket.md +47 -20
- package/skills/fleet/onboarding.md +1 -1
- package/skills/fleet/permissions.md +9 -0
- package/skills/fleet/profiles/tag-kb-reconciler.json +2 -6
- package/skills/fleet/skill-matrix.md +3 -3
- package/version.json +1 -1
- package/dist/cli/agent-transform.d.ts.map +0 -1
- package/dist/cli/agent-transform.js.map +0 -1
- package/dist/cli/auth.d.ts.map +0 -1
- package/dist/cli/auth.js.map +0 -1
- package/dist/cli/config.d.ts.map +0 -1
- package/dist/cli/config.js.map +0 -1
- package/dist/cli/dolt-install.d.ts.map +0 -1
- package/dist/cli/dolt-install.js.map +0 -1
- package/dist/cli/install-guard.d.ts.map +0 -1
- package/dist/cli/install-guard.js.map +0 -1
- package/dist/cli/install.d.ts.map +0 -1
- package/dist/cli/install.js.map +0 -1
- package/dist/cli/join.d.ts.map +0 -1
- package/dist/cli/join.js.map +0 -1
- package/dist/cli/kb-commit.d.ts.map +0 -1
- package/dist/cli/kb-commit.js.map +0 -1
- package/dist/cli/kb-directives.d.ts.map +0 -1
- package/dist/cli/kb-directives.js.map +0 -1
- package/dist/cli/kb-import.d.ts.map +0 -1
- package/dist/cli/kb-import.js.map +0 -1
- package/dist/cli/register-member.d.ts.map +0 -1
- package/dist/cli/register-member.js.map +0 -1
- package/dist/cli/restart.d.ts.map +0 -1
- package/dist/cli/restart.js.map +0 -1
- package/dist/cli/secret.d.ts.map +0 -1
- package/dist/cli/secret.js.map +0 -1
- package/dist/cli/spoke.d.ts.map +0 -1
- package/dist/cli/spoke.js.map +0 -1
- package/dist/cli/start.d.ts.map +0 -1
- package/dist/cli/start.js.map +0 -1
- package/dist/cli/status.d.ts.map +0 -1
- package/dist/cli/status.js.map +0 -1
- package/dist/cli/stop.d.ts.map +0 -1
- package/dist/cli/stop.js.map +0 -1
- package/dist/cli/uninstall.d.ts.map +0 -1
- package/dist/cli/uninstall.js.map +0 -1
- package/dist/cli/update.d.ts.map +0 -1
- package/dist/cli/update.js.map +0 -1
- package/dist/cli/watch.d.ts.map +0 -1
- package/dist/cli/watch.js.map +0 -1
- package/dist/cli/workflow-assets.d.ts.map +0 -1
- package/dist/cli/workflow-assets.js.map +0 -1
- package/dist/cli/workflow.d.ts.map +0 -1
- package/dist/cli/workflow.js.map +0 -1
- package/dist/commands/kb-server.d.ts.map +0 -1
- package/dist/commands/kb-server.js.map +0 -1
- package/dist/delivery-mode.d.ts.map +0 -1
- package/dist/delivery-mode.js.map +0 -1
- package/dist/hub-service/activity.d.ts.map +0 -1
- package/dist/hub-service/activity.js.map +0 -1
- package/dist/hub-service/audit-log.d.ts.map +0 -1
- package/dist/hub-service/audit-log.js.map +0 -1
- package/dist/hub-service/db/pool.d.ts.map +0 -1
- package/dist/hub-service/db/pool.js.map +0 -1
- package/dist/hub-service/enrollment.d.ts.map +0 -1
- package/dist/hub-service/enrollment.js.map +0 -1
- package/dist/hub-service/envelope-routes.d.ts.map +0 -1
- package/dist/hub-service/envelope-routes.js.map +0 -1
- package/dist/hub-service/handlers/installers.d.ts.map +0 -1
- package/dist/hub-service/handlers/installers.js.map +0 -1
- package/dist/hub-service/http-server.d.ts.map +0 -1
- package/dist/hub-service/http-server.js.map +0 -1
- package/dist/hub-service/hub-jwt.d.ts.map +0 -1
- package/dist/hub-service/hub-jwt.js.map +0 -1
- package/dist/hub-service/jwt-revocation.d.ts.map +0 -1
- package/dist/hub-service/jwt-revocation.js.map +0 -1
- package/dist/hub-service/machines.d.ts.map +0 -1
- package/dist/hub-service/machines.js.map +0 -1
- package/dist/hub-service/main.d.ts.map +0 -1
- package/dist/hub-service/main.js.map +0 -1
- package/dist/hub-service/member-tokens.d.ts.map +0 -1
- package/dist/hub-service/member-tokens.js.map +0 -1
- package/dist/hub-service/member-view.d.ts.map +0 -1
- package/dist/hub-service/member-view.js.map +0 -1
- package/dist/hub-service/members.d.ts.map +0 -1
- package/dist/hub-service/members.js.map +0 -1
- package/dist/hub-service/presence.d.ts.map +0 -1
- package/dist/hub-service/presence.js.map +0 -1
- package/dist/hub-service/project-view.d.ts.map +0 -1
- package/dist/hub-service/project-view.js.map +0 -1
- package/dist/hub-service/projects.d.ts.map +0 -1
- package/dist/hub-service/projects.js.map +0 -1
- package/dist/hub-service/relay-queue.d.ts.map +0 -1
- package/dist/hub-service/relay-queue.js.map +0 -1
- package/dist/hub-service/session-jwt.d.ts.map +0 -1
- package/dist/hub-service/session-jwt.js.map +0 -1
- package/dist/hub-service/usage.d.ts.map +0 -1
- package/dist/hub-service/usage.js.map +0 -1
- package/dist/hub-service/users.d.ts.map +0 -1
- package/dist/hub-service/users.js.map +0 -1
- package/dist/hub-service/workspaces.d.ts.map +0 -1
- package/dist/hub-service/workspaces.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/onboarding/text.d.ts.map +0 -1
- package/dist/onboarding/text.js.map +0 -1
- package/dist/os/git-bash-candidates.d.ts.map +0 -1
- package/dist/os/git-bash-candidates.js.map +0 -1
- package/dist/os/index.d.ts.map +0 -1
- package/dist/os/index.js.map +0 -1
- package/dist/os/linux.d.ts.map +0 -1
- package/dist/os/linux.js.map +0 -1
- package/dist/os/macos.d.ts.map +0 -1
- package/dist/os/macos.js.map +0 -1
- package/dist/os/os-commands.d.ts.map +0 -1
- package/dist/os/os-commands.js.map +0 -1
- package/dist/os/windows-gitbash.d.ts.map +0 -1
- package/dist/os/windows-gitbash.js.map +0 -1
- package/dist/os/windows-wrapper.d.ts.map +0 -1
- package/dist/os/windows-wrapper.js.map +0 -1
- package/dist/os/windows.d.ts.map +0 -1
- package/dist/os/windows.js.map +0 -1
- package/dist/paths.d.ts.map +0 -1
- package/dist/paths.js.map +0 -1
- package/dist/providers/agy.d.ts.map +0 -1
- package/dist/providers/agy.js.map +0 -1
- package/dist/providers/claude.d.ts.map +0 -1
- package/dist/providers/claude.js.map +0 -1
- package/dist/providers/codex.d.ts.map +0 -1
- package/dist/providers/codex.js.map +0 -1
- package/dist/providers/copilot.d.ts.map +0 -1
- package/dist/providers/copilot.js.map +0 -1
- package/dist/providers/email/headers.d.ts.map +0 -1
- package/dist/providers/email/headers.js.map +0 -1
- package/dist/providers/email/index.d.ts.map +0 -1
- package/dist/providers/email/index.js.map +0 -1
- package/dist/providers/email/provider.d.ts.map +0 -1
- package/dist/providers/email/provider.js.map +0 -1
- package/dist/providers/email/sendgrid.d.ts.map +0 -1
- package/dist/providers/email/sendgrid.js.map +0 -1
- package/dist/providers/email/smtp.d.ts.map +0 -1
- package/dist/providers/email/smtp.js.map +0 -1
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/providers/index.js.map +0 -1
- package/dist/providers/none.d.ts.map +0 -1
- package/dist/providers/none.js.map +0 -1
- package/dist/providers/opencode.d.ts.map +0 -1
- package/dist/providers/opencode.js.map +0 -1
- package/dist/providers/provider.d.ts.map +0 -1
- package/dist/providers/provider.js.map +0 -1
- package/dist/services/agent-provisioner.d.ts.map +0 -1
- package/dist/services/agent-provisioner.js.map +0 -1
- package/dist/services/agy-project.d.ts.map +0 -1
- package/dist/services/agy-project.js.map +0 -1
- package/dist/services/auth-socket.d.ts.map +0 -1
- package/dist/services/auth-socket.js.map +0 -1
- package/dist/services/auth-web.d.ts.map +0 -1
- package/dist/services/auth-web.js.map +0 -1
- package/dist/services/budget-awareness.d.ts.map +0 -1
- package/dist/services/budget-awareness.js.map +0 -1
- package/dist/services/cloud/activity.d.ts.map +0 -1
- package/dist/services/cloud/activity.js.map +0 -1
- package/dist/services/cloud/aws.d.ts.map +0 -1
- package/dist/services/cloud/aws.js.map +0 -1
- package/dist/services/cloud/cost.d.ts.map +0 -1
- package/dist/services/cloud/cost.js.map +0 -1
- package/dist/services/cloud/idle-manager.d.ts.map +0 -1
- package/dist/services/cloud/idle-manager.js.map +0 -1
- package/dist/services/cloud/lifecycle.d.ts.map +0 -1
- package/dist/services/cloud/lifecycle.js.map +0 -1
- package/dist/services/cloud/task-wrapper.d.ts.map +0 -1
- package/dist/services/cloud/task-wrapper.js.map +0 -1
- package/dist/services/cloud/types.d.ts.map +0 -1
- package/dist/services/cloud/types.js.map +0 -1
- package/dist/services/cloud-sync.d.ts.map +0 -1
- package/dist/services/cloud-sync.js.map +0 -1
- package/dist/services/context-admission.d.ts.map +0 -1
- package/dist/services/context-admission.js.map +0 -1
- package/dist/services/credential-cleanup.d.ts.map +0 -1
- package/dist/services/credential-cleanup.js.map +0 -1
- package/dist/services/credential-store.d.ts.map +0 -1
- package/dist/services/credential-store.js.map +0 -1
- package/dist/services/event-bus.d.ts.map +0 -1
- package/dist/services/event-bus.js.map +0 -1
- package/dist/services/exit-drain.d.ts.map +0 -1
- package/dist/services/exit-drain.js.map +0 -1
- package/dist/services/file-chunker.d.ts.map +0 -1
- package/dist/services/file-chunker.js.map +0 -1
- package/dist/services/file-transfer-relay.d.ts.map +0 -1
- package/dist/services/file-transfer-relay.js.map +0 -1
- package/dist/services/file-transfer.d.ts.map +0 -1
- package/dist/services/file-transfer.js.map +0 -1
- package/dist/services/git-config.d.ts.map +0 -1
- package/dist/services/git-config.js.map +0 -1
- package/dist/services/github-app.d.ts.map +0 -1
- package/dist/services/github-app.js.map +0 -1
- package/dist/services/http-transport.d.ts.map +0 -1
- package/dist/services/http-transport.js.map +0 -1
- package/dist/services/hub-client.d.ts.map +0 -1
- package/dist/services/hub-client.js.map +0 -1
- package/dist/services/icons.d.ts.map +0 -1
- package/dist/services/icons.js.map +0 -1
- package/dist/services/jwt.d.ts.map +0 -1
- package/dist/services/jwt.js.map +0 -1
- package/dist/services/knowledge/audn.d.ts.map +0 -1
- package/dist/services/knowledge/audn.js.map +0 -1
- package/dist/services/knowledge/file-hash.d.ts.map +0 -1
- package/dist/services/knowledge/file-hash.js.map +0 -1
- package/dist/services/knowledge/http-provider.d.ts.map +0 -1
- package/dist/services/knowledge/http-provider.js.map +0 -1
- package/dist/services/knowledge/kb-config.d.ts.map +0 -1
- package/dist/services/knowledge/kb-config.js.map +0 -1
- package/dist/services/knowledge/kb-providers.d.ts.map +0 -1
- package/dist/services/knowledge/kb-providers.js.map +0 -1
- package/dist/services/knowledge/kb-scope-input.d.ts +0 -5
- package/dist/services/knowledge/kb-scope-input.d.ts.map +0 -1
- package/dist/services/knowledge/kb-scope-input.js +0 -11
- package/dist/services/knowledge/kb-scope-input.js.map +0 -1
- package/dist/services/knowledge/kb-service.d.ts.map +0 -1
- package/dist/services/knowledge/kb-service.js.map +0 -1
- package/dist/services/knowledge/path-validation.d.ts.map +0 -1
- package/dist/services/knowledge/path-validation.js.map +0 -1
- package/dist/services/knowledge/pre-init.d.ts.map +0 -1
- package/dist/services/knowledge/pre-init.js.map +0 -1
- package/dist/services/knowledge/project-slug.d.ts.map +0 -1
- package/dist/services/knowledge/project-slug.js.map +0 -1
- package/dist/services/knowledge/require-sqlite-project.d.ts.map +0 -1
- package/dist/services/knowledge/require-sqlite-project.js.map +0 -1
- package/dist/services/knowledge/sqlite-provider.d.ts.map +0 -1
- package/dist/services/knowledge/sqlite-provider.js.map +0 -1
- package/dist/services/knowledge/types.d.ts.map +0 -1
- package/dist/services/knowledge/types.js.map +0 -1
- package/dist/services/known-hosts.d.ts.map +0 -1
- package/dist/services/known-hosts.js.map +0 -1
- package/dist/services/known-sessions.d.ts.map +0 -1
- package/dist/services/known-sessions.js.map +0 -1
- package/dist/services/member-home.d.ts.map +0 -1
- package/dist/services/member-home.js.map +0 -1
- package/dist/services/member-remote-url.d.ts.map +0 -1
- package/dist/services/member-remote-url.js.map +0 -1
- package/dist/services/model-pricing.d.ts.map +0 -1
- package/dist/services/model-pricing.js.map +0 -1
- package/dist/services/onboarding.d.ts.map +0 -1
- package/dist/services/onboarding.js.map +0 -1
- package/dist/services/orphan-recovery.d.ts.map +0 -1
- package/dist/services/orphan-recovery.js.map +0 -1
- package/dist/services/pending-responses.d.ts.map +0 -1
- package/dist/services/pending-responses.js.map +0 -1
- package/dist/services/preflight-check.d.ts.map +0 -1
- package/dist/services/preflight-check.js.map +0 -1
- package/dist/services/registry.d.ts.map +0 -1
- package/dist/services/registry.js.map +0 -1
- package/dist/services/relay-context.d.ts.map +0 -1
- package/dist/services/relay-context.js.map +0 -1
- package/dist/services/relay-executor.d.ts.map +0 -1
- package/dist/services/relay-executor.js.map +0 -1
- package/dist/services/relay-request.d.ts.map +0 -1
- package/dist/services/relay-request.js.map +0 -1
- package/dist/services/relay-strategy.d.ts.map +0 -1
- package/dist/services/relay-strategy.js.map +0 -1
- package/dist/services/secret-token.d.ts.map +0 -1
- package/dist/services/secret-token.js.map +0 -1
- package/dist/services/service-manager/index.d.ts.map +0 -1
- package/dist/services/service-manager/index.js.map +0 -1
- package/dist/services/service-manager/linux.d.ts.map +0 -1
- package/dist/services/service-manager/linux.js.map +0 -1
- package/dist/services/service-manager/macos.d.ts.map +0 -1
- package/dist/services/service-manager/macos.js.map +0 -1
- package/dist/services/service-manager/types.d.ts.map +0 -1
- package/dist/services/service-manager/types.js.map +0 -1
- package/dist/services/service-manager/windows.d.ts.map +0 -1
- package/dist/services/service-manager/windows.js.map +0 -1
- package/dist/services/session-registry.d.ts.map +0 -1
- package/dist/services/session-registry.js.map +0 -1
- package/dist/services/sftp.d.ts.map +0 -1
- package/dist/services/sftp.js.map +0 -1
- package/dist/services/shell-probe.d.ts.map +0 -1
- package/dist/services/shell-probe.js.map +0 -1
- package/dist/services/singleton.d.ts.map +0 -1
- package/dist/services/singleton.js.map +0 -1
- package/dist/services/sprint-coordination.d.ts.map +0 -1
- package/dist/services/sprint-coordination.js.map +0 -1
- package/dist/services/ssh.d.ts.map +0 -1
- package/dist/services/ssh.js.map +0 -1
- package/dist/services/stall/find-log-file.d.ts.map +0 -1
- package/dist/services/stall/find-log-file.js.map +0 -1
- package/dist/services/stall/index.d.ts.map +0 -1
- package/dist/services/stall/index.js.map +0 -1
- package/dist/services/stall/log-path-resolver.d.ts.map +0 -1
- package/dist/services/stall/log-path-resolver.js.map +0 -1
- package/dist/services/stall/read-log-tail.d.ts.map +0 -1
- package/dist/services/stall/read-log-tail.js.map +0 -1
- package/dist/services/stall/stall-detector.d.ts.map +0 -1
- package/dist/services/stall/stall-detector.js.map +0 -1
- package/dist/services/stall/stall-poller.d.ts.map +0 -1
- package/dist/services/stall/stall-poller.js.map +0 -1
- package/dist/services/stall/time-utils.d.ts.map +0 -1
- package/dist/services/stall/time-utils.js.map +0 -1
- package/dist/services/statusline.d.ts.map +0 -1
- package/dist/services/statusline.js.map +0 -1
- package/dist/services/strategy.d.ts.map +0 -1
- package/dist/services/strategy.js.map +0 -1
- package/dist/services/substitution-engine.d.ts.map +0 -1
- package/dist/services/substitution-engine.js.map +0 -1
- package/dist/services/task-cleanup.d.ts.map +0 -1
- package/dist/services/task-cleanup.js.map +0 -1
- package/dist/services/token-issuer.d.ts.map +0 -1
- package/dist/services/token-issuer.js.map +0 -1
- package/dist/services/tool-registry.d.ts.map +0 -1
- package/dist/services/tool-registry.js.map +0 -1
- package/dist/services/update-check.d.ts.map +0 -1
- package/dist/services/update-check.js.map +0 -1
- package/dist/services/user-config.d.ts.map +0 -1
- package/dist/services/user-config.js.map +0 -1
- package/dist/services/vcs/azure-devops.d.ts.map +0 -1
- package/dist/services/vcs/azure-devops.js.map +0 -1
- package/dist/services/vcs/bitbucket.d.ts.map +0 -1
- package/dist/services/vcs/bitbucket.js.map +0 -1
- package/dist/services/vcs/constants.d.ts.map +0 -1
- package/dist/services/vcs/constants.js.map +0 -1
- package/dist/services/vcs/github.d.ts.map +0 -1
- package/dist/services/vcs/github.js.map +0 -1
- package/dist/services/vcs/types.d.ts.map +0 -1
- package/dist/services/vcs/types.js.map +0 -1
- package/dist/services/version-check.d.ts.map +0 -1
- package/dist/services/version-check.js.map +0 -1
- package/dist/services/watch/fleet-log.d.ts.map +0 -1
- package/dist/services/watch/fleet-log.js.map +0 -1
- package/dist/services/watch/project-resolver.d.ts.map +0 -1
- package/dist/services/watch/project-resolver.js.map +0 -1
- package/dist/services/watch/transcript-formatter.d.ts.map +0 -1
- package/dist/services/watch/transcript-formatter.js.map +0 -1
- package/dist/smoke-test.d.ts.map +0 -1
- package/dist/smoke-test.js.map +0 -1
- package/dist/tools/check-status.d.ts.map +0 -1
- package/dist/tools/check-status.js.map +0 -1
- package/dist/tools/child-id-allocator.d.ts.map +0 -1
- package/dist/tools/child-id-allocator.js.map +0 -1
- package/dist/tools/cloud-control.d.ts.map +0 -1
- package/dist/tools/cloud-control.js.map +0 -1
- package/dist/tools/code-intelligence-codebase-memory.d.ts.map +0 -1
- package/dist/tools/code-intelligence-codebase-memory.js.map +0 -1
- package/dist/tools/code-intelligence-freshness.d.ts.map +0 -1
- package/dist/tools/code-intelligence-freshness.js.map +0 -1
- package/dist/tools/code-intelligence-gitnexus.d.ts.map +0 -1
- package/dist/tools/code-intelligence-gitnexus.js.map +0 -1
- package/dist/tools/code-intelligence-kb-enrich.d.ts.map +0 -1
- package/dist/tools/code-intelligence-kb-enrich.js.map +0 -1
- package/dist/tools/code-intelligence-reindex.d.ts.map +0 -1
- package/dist/tools/code-intelligence-reindex.js.map +0 -1
- package/dist/tools/code-intelligence-telemetry.d.ts.map +0 -1
- package/dist/tools/code-intelligence-telemetry.js.map +0 -1
- package/dist/tools/code-intelligence-tests.d.ts.map +0 -1
- package/dist/tools/code-intelligence-tests.js.map +0 -1
- package/dist/tools/code-intelligence.d.ts.map +0 -1
- package/dist/tools/code-intelligence.js.map +0 -1
- package/dist/tools/compose-permissions.d.ts.map +0 -1
- package/dist/tools/compose-permissions.js.map +0 -1
- package/dist/tools/credential-store-delete.d.ts.map +0 -1
- package/dist/tools/credential-store-delete.js.map +0 -1
- package/dist/tools/credential-store-list.d.ts.map +0 -1
- package/dist/tools/credential-store-list.js.map +0 -1
- package/dist/tools/credential-store-set.d.ts.map +0 -1
- package/dist/tools/credential-store-set.js.map +0 -1
- package/dist/tools/credential-store-update.d.ts.map +0 -1
- package/dist/tools/credential-store-update.js.map +0 -1
- package/dist/tools/dolt-push-mutex.d.ts.map +0 -1
- package/dist/tools/dolt-push-mutex.js.map +0 -1
- package/dist/tools/execute-command.d.ts.map +0 -1
- package/dist/tools/execute-command.js.map +0 -1
- package/dist/tools/execute-prompt.d.ts.map +0 -1
- package/dist/tools/execute-prompt.js.map +0 -1
- package/dist/tools/get-member-model-pricing.d.ts.map +0 -1
- package/dist/tools/get-member-model-pricing.js.map +0 -1
- package/dist/tools/kb-capture.d.ts.map +0 -1
- package/dist/tools/kb-capture.js.map +0 -1
- package/dist/tools/kb-context.d.ts.map +0 -1
- package/dist/tools/kb-context.js.map +0 -1
- package/dist/tools/kb-export.d.ts.map +0 -1
- package/dist/tools/kb-export.js.map +0 -1
- package/dist/tools/kb-feedback.d.ts.map +0 -1
- package/dist/tools/kb-feedback.js.map +0 -1
- package/dist/tools/kb-freshness-sweep.d.ts.map +0 -1
- package/dist/tools/kb-freshness-sweep.js.map +0 -1
- package/dist/tools/kb-harvest.d.ts.map +0 -1
- package/dist/tools/kb-harvest.js.map +0 -1
- package/dist/tools/kb-import.d.ts.map +0 -1
- package/dist/tools/kb-import.js.map +0 -1
- package/dist/tools/kb-invalidate.d.ts.map +0 -1
- package/dist/tools/kb-invalidate.js.map +0 -1
- package/dist/tools/kb-list.d.ts.map +0 -1
- package/dist/tools/kb-list.js.map +0 -1
- package/dist/tools/kb-promote.d.ts.map +0 -1
- package/dist/tools/kb-promote.js.map +0 -1
- package/dist/tools/kb-query.d.ts.map +0 -1
- package/dist/tools/kb-query.js.map +0 -1
- package/dist/tools/kb-reconcile-prefilter.d.ts.map +0 -1
- package/dist/tools/kb-reconcile-prefilter.js.map +0 -1
- package/dist/tools/kb-resolve-contradiction.d.ts.map +0 -1
- package/dist/tools/kb-resolve-contradiction.js.map +0 -1
- package/dist/tools/kb-session-prime.d.ts.map +0 -1
- package/dist/tools/kb-session-prime.js.map +0 -1
- package/dist/tools/kb-setup.d.ts.map +0 -1
- package/dist/tools/kb-setup.js.map +0 -1
- package/dist/tools/kb-stats.d.ts.map +0 -1
- package/dist/tools/kb-stats.js.map +0 -1
- package/dist/tools/list-members.d.ts.map +0 -1
- package/dist/tools/list-members.js.map +0 -1
- package/dist/tools/member-detail.d.ts.map +0 -1
- package/dist/tools/member-detail.js.map +0 -1
- package/dist/tools/member-reservation.d.ts.map +0 -1
- package/dist/tools/member-reservation.js.map +0 -1
- package/dist/tools/monitor-task.d.ts.map +0 -1
- package/dist/tools/monitor-task.js.map +0 -1
- package/dist/tools/provision-auth.d.ts.map +0 -1
- package/dist/tools/provision-auth.js.map +0 -1
- package/dist/tools/provision-vcs-auth.d.ts.map +0 -1
- package/dist/tools/provision-vcs-auth.js.map +0 -1
- package/dist/tools/receive-files.d.ts.map +0 -1
- package/dist/tools/receive-files.js.map +0 -1
- package/dist/tools/register-member.d.ts.map +0 -1
- package/dist/tools/register-member.js.map +0 -1
- package/dist/tools/remove-member.d.ts.map +0 -1
- package/dist/tools/remove-member.js.map +0 -1
- package/dist/tools/report-status.d.ts.map +0 -1
- package/dist/tools/report-status.js.map +0 -1
- package/dist/tools/respond-to-message.d.ts.map +0 -1
- package/dist/tools/respond-to-message.js.map +0 -1
- package/dist/tools/revoke-vcs-auth.d.ts.map +0 -1
- package/dist/tools/revoke-vcs-auth.js.map +0 -1
- package/dist/tools/send-email.d.ts.map +0 -1
- package/dist/tools/send-email.js.map +0 -1
- package/dist/tools/send-files.d.ts.map +0 -1
- package/dist/tools/send-files.js.map +0 -1
- package/dist/tools/send-message.d.ts.map +0 -1
- package/dist/tools/send-message.js.map +0 -1
- package/dist/tools/setup-git-app.d.ts.map +0 -1
- package/dist/tools/setup-git-app.js.map +0 -1
- package/dist/tools/setup-ssh-key.d.ts.map +0 -1
- package/dist/tools/setup-ssh-key.js.map +0 -1
- package/dist/tools/shutdown-server.d.ts.map +0 -1
- package/dist/tools/shutdown-server.js.map +0 -1
- package/dist/tools/stop-prompt.d.ts.map +0 -1
- package/dist/tools/stop-prompt.js.map +0 -1
- package/dist/tools/update-agent-cli.d.ts.map +0 -1
- package/dist/tools/update-agent-cli.js.map +0 -1
- package/dist/tools/update-member.d.ts.map +0 -1
- package/dist/tools/update-member.js.map +0 -1
- package/dist/tools/vcs-credential-exec.d.ts.map +0 -1
- package/dist/tools/vcs-credential-exec.js.map +0 -1
- package/dist/tools/version.d.ts.map +0 -1
- package/dist/tools/version.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/agent-helpers.d.ts.map +0 -1
- package/dist/utils/agent-helpers.js.map +0 -1
- package/dist/utils/ansi.d.ts.map +0 -1
- package/dist/utils/ansi.js.map +0 -1
- package/dist/utils/auth-env.d.ts.map +0 -1
- package/dist/utils/auth-env.js.map +0 -1
- package/dist/utils/collect-secret.d.ts.map +0 -1
- package/dist/utils/collect-secret.js.map +0 -1
- package/dist/utils/credential-validation.d.ts.map +0 -1
- package/dist/utils/credential-validation.js.map +0 -1
- package/dist/utils/crypto.d.ts.map +0 -1
- package/dist/utils/crypto.js.map +0 -1
- package/dist/utils/deep-merge.d.ts.map +0 -1
- package/dist/utils/deep-merge.js.map +0 -1
- package/dist/utils/file-permissions.d.ts.map +0 -1
- package/dist/utils/file-permissions.js.map +0 -1
- package/dist/utils/gpu-parser.d.ts.map +0 -1
- package/dist/utils/gpu-parser.js.map +0 -1
- package/dist/utils/log-helpers.d.ts.map +0 -1
- package/dist/utils/log-helpers.js.map +0 -1
- package/dist/utils/oob-timeout.d.ts.map +0 -1
- package/dist/utils/oob-timeout.js.map +0 -1
- package/dist/utils/opencode-model-validation.d.ts.map +0 -1
- package/dist/utils/opencode-model-validation.js.map +0 -1
- package/dist/utils/pid-helpers.d.ts.map +0 -1
- package/dist/utils/pid-helpers.js.map +0 -1
- package/dist/utils/platform.d.ts.map +0 -1
- package/dist/utils/platform.js.map +0 -1
- package/dist/utils/process-utils.d.ts.map +0 -1
- package/dist/utils/process-utils.js.map +0 -1
- package/dist/utils/prompt-errors.d.ts.map +0 -1
- package/dist/utils/prompt-errors.js.map +0 -1
- package/dist/utils/resolve-member.d.ts.map +0 -1
- package/dist/utils/resolve-member.js.map +0 -1
- package/dist/utils/secure-input.d.ts.map +0 -1
- package/dist/utils/secure-input.js.map +0 -1
- package/dist/utils/session-caller.d.ts.map +0 -1
- package/dist/utils/session-caller.js.map +0 -1
- package/dist/utils/shell-escape.d.ts.map +0 -1
- package/dist/utils/shell-escape.js.map +0 -1
- package/dist/utils/skill-matrix.d.ts.map +0 -1
- package/dist/utils/skill-matrix.js.map +0 -1
- package/dist/utils/ssh-error-messages.d.ts.map +0 -1
- package/dist/utils/ssh-error-messages.js.map +0 -1
- package/dist/utils/vcs-provider-detect.d.ts.map +0 -1
- package/dist/utils/vcs-provider-detect.js.map +0 -1
- package/dist/utils/work-folder-validation.d.ts.map +0 -1
- package/dist/utils/work-folder-validation.js.map +0 -1
- package/dist/utils/workspace-trust.d.ts.map +0 -1
- package/dist/utils/workspace-trust.js.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { escapeHtml } from '@apralabs/apra-fleet-workflow/viewer/html-utils';
|
|
2
2
|
import { computeSprintProgress } from './sprint-progress.mjs';
|
|
3
|
+
import { DISPATCH_TOOL_CALLS_STATE_NAMESPACE } from './dispatch-accounting.mjs';
|
|
4
|
+
import { MEMBER_INIT_STATE_NAMESPACE } from './member-init-probe.mjs';
|
|
5
|
+
import { DECISIONS_STATE_NAMESPACE, answerPendingDecision } from './decision-wait.mjs';
|
|
3
6
|
|
|
4
7
|
/**
|
|
5
8
|
* apra-fleet-x8r.1: pure HTML-string builder for the beads-closed/required
|
|
@@ -695,7 +698,7 @@ export function renderBeadsHtml(sprintTasks, backlogTasks, collapsedIds) {
|
|
|
695
698
|
}
|
|
696
699
|
|
|
697
700
|
/**
|
|
698
|
-
* apra-fleet-eft.37.3: pure HTML-string builder for the
|
|
701
|
+
* apra-fleet-eft.37.3: pure HTML-string builder for the fleet-sprint verdict
|
|
699
702
|
* badge + PR link, moved OUT of the generic workflow core (which used to
|
|
700
703
|
* mint `state.verdict`/`state.prUrl` by name -- see
|
|
701
704
|
* docs/workflow-core-boundary-refactoring.md M2) and into this se-owned
|
|
@@ -704,11 +707,11 @@ export function renderBeadsHtml(sprintTasks, backlogTasks, collapsedIds) {
|
|
|
704
707
|
* SCALAR fields as a generic, unstyled key/value strip (src/viewer/
|
|
705
708
|
* index.mjs's `#result-strip`). This function reads the SAME
|
|
706
709
|
* `state.result` object, but knows the two keys that are meaningful for an
|
|
707
|
-
*
|
|
710
|
+
* fleet-sprint run specifically -- `verdict` (colored by outcome) and
|
|
708
711
|
* `prUrl` (link-ified) -- exactly the se-domain knowledge that has no
|
|
709
712
|
* business living in the generic engine.
|
|
710
713
|
*
|
|
711
|
-
* Returns '' when `result` carries neither key (e.g. a non-
|
|
714
|
+
* Returns '' when `result` carries neither key (e.g. a non-fleet-sprint
|
|
712
715
|
* workflow, or a run that hasn't finished yet), so the caller can hide its
|
|
713
716
|
* container entirely rather than show an empty badge strip.
|
|
714
717
|
*
|
|
@@ -718,9 +721,12 @@ export function renderBeadsHtml(sprintTasks, backlogTasks, collapsedIds) {
|
|
|
718
721
|
export function renderResultExtrasHtml(result) {
|
|
719
722
|
const verdict = result && typeof result === 'object' ? result.verdict : undefined;
|
|
720
723
|
const prUrl = result && typeof result === 'object' ? result.prUrl : undefined;
|
|
721
|
-
|
|
724
|
+
const warnings = result && typeof result === 'object' && Array.isArray(result.warnings)
|
|
725
|
+
? result.warnings.filter((w) => typeof w === 'string' && w.length > 0)
|
|
726
|
+
: [];
|
|
727
|
+
// Nothing se-meaningful to show (non-fleet-sprint workflow, or a run that
|
|
722
728
|
// hasn't finished yet) -- let the caller hide its container entirely.
|
|
723
|
-
if (verdict == null && prUrl == null) return '';
|
|
729
|
+
if (verdict == null && prUrl == null && warnings.length === 0) return '';
|
|
724
730
|
|
|
725
731
|
// Color signals outcome, same register as the beads status badges above:
|
|
726
732
|
// a clean PASS/MERGED/APPROVED recedes to green, anything that means
|
|
@@ -750,7 +756,17 @@ export function renderResultExtrasHtml(result) {
|
|
|
750
756
|
'style="color: var(--accent); font-size: 11px; text-decoration: none; white-space: nowrap;">PR -></a>';
|
|
751
757
|
}
|
|
752
758
|
|
|
753
|
-
|
|
759
|
+
// A terminal status of success-with-warnings (e.g. PR skipped for a VCS
|
|
760
|
+
// auth failure) renders each warning as an amber badge, never as plain
|
|
761
|
+
// success.
|
|
762
|
+
let warnHtml = '';
|
|
763
|
+
for (let i = 0; i < warnings.length; i++) {
|
|
764
|
+
warnHtml += '<span title="' + escapeHtml(warnings[i]) + '" style="color: var(--warning, #f59e0b); ' +
|
|
765
|
+
'font-weight: 700; font-size: 11px; border: 1px solid var(--warning, #f59e0b); border-radius: 4px; ' +
|
|
766
|
+
'padding: 2px 6px; white-space: nowrap;">WARNING: ' + escapeHtml(warnings[i]) + '</span>';
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
return verdictHtml + warnHtml + prHtml;
|
|
754
770
|
}
|
|
755
771
|
|
|
756
772
|
/**
|
|
@@ -795,7 +811,7 @@ export function renderBeadsIdentityHtml(identity) {
|
|
|
795
811
|
|
|
796
812
|
let rows = '';
|
|
797
813
|
if (identity.expected) {
|
|
798
|
-
const from = identity.expectedFrom === '
|
|
814
|
+
const from = identity.expectedFrom === 'backlog' ? 'expected (from backlog)' : 'expected';
|
|
799
815
|
rows += row(from, identity.expected);
|
|
800
816
|
}
|
|
801
817
|
for (const name of names) rows += row(name, members[name]);
|
|
@@ -840,9 +856,56 @@ function findBeadById(state, id) {
|
|
|
840
856
|
return null;
|
|
841
857
|
}
|
|
842
858
|
|
|
859
|
+
/**
|
|
860
|
+
* Neutral placeholder for the live view's progress area when no beads
|
|
861
|
+
* summary has been published yet -- never a misleading 'Required: 0/N'.
|
|
862
|
+
* Rendered by renderBeadsPanel() (the caller), so renderProgressBarHtml()
|
|
863
|
+
* itself stays unchanged for its other consumers.
|
|
864
|
+
* @returns {string}
|
|
865
|
+
*/
|
|
866
|
+
export function renderProgressPlaceholderHtml() {
|
|
867
|
+
return (
|
|
868
|
+
'<div class="sprint-progress sprint-progress-pending" style="display: flex; align-items: center; gap: 8px; padding: 8px; font-size: 12px;">' +
|
|
869
|
+
'<div style="color: #a1a1aa; white-space: nowrap;">Required: no summary yet</div>' +
|
|
870
|
+
'</div>'
|
|
871
|
+
);
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* Turns a published beads summary entry (GET /state?summary=1's
|
|
876
|
+
* extensions.beads) into the progress-bar HTML, or the placeholder when the
|
|
877
|
+
* entry is absent or malformed. Pure; shared by the browser script below.
|
|
878
|
+
* @param {object|null} summary
|
|
879
|
+
* @returns {string}
|
|
880
|
+
*/
|
|
881
|
+
export function renderBeadsSummaryProgressHtml(summary) {
|
|
882
|
+
const ok = summary && typeof summary === 'object'
|
|
883
|
+
&& typeof summary.closed === 'number' && Number.isFinite(summary.closed)
|
|
884
|
+
&& typeof summary.required === 'number' && Number.isFinite(summary.required);
|
|
885
|
+
if (!ok) return renderProgressPlaceholderHtml();
|
|
886
|
+
return renderProgressBarHtml({ closed: summary.closed, required: summary.required, fraction: summary.fraction });
|
|
887
|
+
}
|
|
888
|
+
|
|
843
889
|
export const beadsExtension = {
|
|
844
890
|
id: 'beads',
|
|
845
891
|
title: 'Tasks',
|
|
892
|
+
// Core's once-per-publish summarize hook (viewer/index.mjs): runs
|
|
893
|
+
// server-side in the sprint child, only when the 'beads' namespace is
|
|
894
|
+
// published. Pure, no I/O. computed_at is when the runner FETCHED the
|
|
895
|
+
// beads (payload.fetchedAt), not render/publish time.
|
|
896
|
+
summarize(data) {
|
|
897
|
+
const d = data || {};
|
|
898
|
+
const progress = computeSprintProgress(d.sprintTasks || [], {
|
|
899
|
+
goalMax: d.goalMax,
|
|
900
|
+
decomposedParentIds: d.decomposedParentIds,
|
|
901
|
+
});
|
|
902
|
+
return {
|
|
903
|
+
closed: progress.closed,
|
|
904
|
+
required: progress.required,
|
|
905
|
+
fraction: progress.fraction,
|
|
906
|
+
computed_at: d.fetchedAt ?? null,
|
|
907
|
+
};
|
|
908
|
+
},
|
|
846
909
|
// apra-fleet-eft.37.4 (M3): the beads extension's detailLookup hook,
|
|
847
910
|
// called by core's generic GET /extensions/beads/detail/:itemId route
|
|
848
911
|
// (packages/apra-fleet-workflow/src/viewer/index.mjs) against the LIVE,
|
|
@@ -863,10 +926,11 @@ export const beadsExtension = {
|
|
|
863
926
|
${renderBeadsHtml.toString()}
|
|
864
927
|
${renderResultExtrasHtml.toString()}
|
|
865
928
|
${renderBeadsIdentityHtml.toString()}
|
|
866
|
-
${computeSprintProgress.toString()}
|
|
867
929
|
${renderProgressBarHtml.toString()}
|
|
930
|
+
${renderProgressPlaceholderHtml.toString()}
|
|
931
|
+
${renderBeadsSummaryProgressHtml.toString()}
|
|
868
932
|
|
|
869
|
-
// apra-fleet-eft.37.3: mounts the
|
|
933
|
+
// apra-fleet-eft.37.3: mounts the fleet-sprint verdict badge + PR
|
|
870
934
|
// link into the header, next to core's generic (unstyled)
|
|
871
935
|
// #result-strip -- see viewer/index.mjs's 'workflow:result'
|
|
872
936
|
// CustomEvent, dispatched on every renderState() with
|
|
@@ -991,23 +1055,25 @@ export const beadsExtension = {
|
|
|
991
1055
|
// 'beadsIdentity' namespace (workflow:state:beadsIdentity); cached
|
|
992
1056
|
// here and rendered at the top of the Tasks panel on every rebuild.
|
|
993
1057
|
let lastBeadsIdentity = null;
|
|
1058
|
+
// Latest published beads summary (null until the first one).
|
|
1059
|
+
// workflow:summary:beads is dispatched just before
|
|
1060
|
+
// workflow:state:beads on every render, so the state handler below
|
|
1061
|
+
// always renders the current summary.
|
|
1062
|
+
let lastBeadsSummary = null;
|
|
1063
|
+
|
|
1064
|
+
document.addEventListener('workflow:summary:beads', (e) => {
|
|
1065
|
+
lastBeadsSummary = e.detail || null;
|
|
1066
|
+
});
|
|
994
1067
|
|
|
995
1068
|
function renderBeadsPanel() {
|
|
996
1069
|
const container = document.getElementById('extension-beads');
|
|
997
1070
|
if (!container) return;
|
|
998
|
-
//
|
|
999
|
-
//
|
|
1000
|
-
//
|
|
1001
|
-
//
|
|
1002
|
-
//
|
|
1003
|
-
|
|
1004
|
-
// own completion gate filters on) and threaded through verbatim,
|
|
1005
|
-
// never re-derived client-side.
|
|
1006
|
-
const progress = computeSprintProgress(lastBeadsData.sprintTasks || [], {
|
|
1007
|
-
goalMax: lastBeadsData.goalMax,
|
|
1008
|
-
decomposedParentIds: lastBeadsData.decomposedParentIds,
|
|
1009
|
-
});
|
|
1010
|
-
const progressHtml = renderProgressBarHtml(progress);
|
|
1071
|
+
// The progress bar renders the beads summary the child computed
|
|
1072
|
+
// server-side once per publish (summarize() above, delivered by
|
|
1073
|
+
// core's workflow:summary:beads event) -- the SAME object the
|
|
1074
|
+
// supervisor reads from GET /state?summary=1 -- never a browser
|
|
1075
|
+
// recompute of sprintTasks. No summary yet -> placeholder.
|
|
1076
|
+
const progressHtml = renderBeadsSummaryProgressHtml(lastBeadsSummary);
|
|
1011
1077
|
// apra-fleet-vk0a.2: pinned into the FIXED panel-header row (a
|
|
1012
1078
|
// sibling of the 'Tasks' label, core's generic per-extension
|
|
1013
1079
|
// header hook -- \`id="panel-header-\${ext.id}-extra"\`, see
|
|
@@ -1059,7 +1125,7 @@ export const beadsExtension = {
|
|
|
1059
1125
|
renderBeadsPanel();
|
|
1060
1126
|
});
|
|
1061
1127
|
|
|
1062
|
-
// apra-fleet-eft.37.3: mounts the
|
|
1128
|
+
// apra-fleet-eft.37.3: mounts the fleet-sprint verdict badge + PR
|
|
1063
1129
|
// link into the header, next to core's generic (unstyled)
|
|
1064
1130
|
// #result-strip -- see viewer/index.mjs's 'workflow:result'
|
|
1065
1131
|
// CustomEvent, dispatched on every renderState() with
|
|
@@ -1070,3 +1136,374 @@ export const beadsExtension = {
|
|
|
1070
1136
|
});
|
|
1071
1137
|
`
|
|
1072
1138
|
};
|
|
1139
|
+
|
|
1140
|
+
/**
|
|
1141
|
+
* Pure HTML-string builder for the Knowledge and Code Intel tab: per-member and
|
|
1142
|
+
* per-dispatch kb_* / code_* tool call counts, from the records
|
|
1143
|
+
* dispatch-accounting.mjs publishes (`{ dispatches: [{ index, member, role,
|
|
1144
|
+
* label, kb, code, reason }] }` -- session_stats snapshots taken before and
|
|
1145
|
+
* after each dispatch). It never re-derives a count from anything else.
|
|
1146
|
+
*
|
|
1147
|
+
* A count is either a non-negative integer or unknown: anything that is not
|
|
1148
|
+
* an integer (the 'unknown' marker, a missing or malformed value) renders as
|
|
1149
|
+
* the word "unknown", never as 0. A member total is unknown when any of its
|
|
1150
|
+
* dispatches is unknown for that kind.
|
|
1151
|
+
*
|
|
1152
|
+
* Same embed rule as renderBeadsHtml above: string concatenation only (this
|
|
1153
|
+
* source is embedded verbatim into the browser script via .toString()), every
|
|
1154
|
+
* interpolated value through escapeHtml, every helper nested inside so the one
|
|
1155
|
+
* embed captures everything, and a try/catch backstop so a malformed record
|
|
1156
|
+
* can never take the dashboard down.
|
|
1157
|
+
*
|
|
1158
|
+
* @param {{ dispatches?: object[] }|null|undefined} data
|
|
1159
|
+
* @returns {string}
|
|
1160
|
+
*/
|
|
1161
|
+
export function renderKbCodeIntelHtml(data, init) {
|
|
1162
|
+
try {
|
|
1163
|
+
function isCount(n) {
|
|
1164
|
+
return typeof n === 'number' && Number.isInteger(n) && n >= 0;
|
|
1165
|
+
}
|
|
1166
|
+
function countCell(n, title) {
|
|
1167
|
+
if (isCount(n)) {
|
|
1168
|
+
return '<td style="padding: 2px 8px; font-size: 11px; text-align: right;">' + escapeHtml(String(n)) + '</td>';
|
|
1169
|
+
}
|
|
1170
|
+
const tip = title ? ' title="' + escapeHtml(String(title)) + '"' : '';
|
|
1171
|
+
return '<td data-kb-panel-unknown="true" style="padding: 2px 8px; font-size: 11px; text-align: right; color: #f59e0b;"' + tip + '>unknown</td>';
|
|
1172
|
+
}
|
|
1173
|
+
function textCell(v) {
|
|
1174
|
+
return '<td style="padding: 2px 8px; font-size: 11px;">' + escapeHtml(String(v)) + '</td>';
|
|
1175
|
+
}
|
|
1176
|
+
function th(label) {
|
|
1177
|
+
return '<th style="padding: 2px 8px; font-size: 10px; color: #71717a; text-align: left;">' + escapeHtml(label) + '</th>';
|
|
1178
|
+
}
|
|
1179
|
+
// Why a member's totals are unknown: the first unknown dispatch's reason,
|
|
1180
|
+
// else the member-init record when that member's tools were unavailable.
|
|
1181
|
+
function memberUnknownReason(name, firstReason) {
|
|
1182
|
+
if (firstReason) return String(firstReason);
|
|
1183
|
+
const ms = (init && typeof init === 'object' && Array.isArray(init.members)) ? init.members : [];
|
|
1184
|
+
for (const m of ms) {
|
|
1185
|
+
if (m && m.member === name && m.verified !== true) return 'member tools unavailable: ' + String(m.reason || 'unverified');
|
|
1186
|
+
}
|
|
1187
|
+
return 'at least one dispatch count is unknown';
|
|
1188
|
+
}
|
|
1189
|
+
const records = (data && typeof data === 'object' && Array.isArray(data.dispatches))
|
|
1190
|
+
? data.dispatches.filter(function (r) { return r && typeof r === 'object'; })
|
|
1191
|
+
: [];
|
|
1192
|
+
|
|
1193
|
+
// Lower-quality-of-service section (b4g.65): the sprint banner and one
|
|
1194
|
+
// line per NON-verified member with its reason and one-line fix.
|
|
1195
|
+
// Verified members get no line; with all verified nothing renders.
|
|
1196
|
+
function lowerQualityHtml() {
|
|
1197
|
+
const members = (init && typeof init === 'object' && Array.isArray(init.members))
|
|
1198
|
+
? init.members.filter(function (m) { return m && typeof m === 'object' && m.verified !== true; })
|
|
1199
|
+
: [];
|
|
1200
|
+
if (members.length === 0) return '';
|
|
1201
|
+
let out = '';
|
|
1202
|
+
if (init && typeof init.banner === 'string' && init.banner) {
|
|
1203
|
+
out += '<div data-kb-lower-quality-banner="true" style="font-size: 11px; font-weight: 600; color: #f59e0b; padding: 4px 8px;">' + escapeHtml(init.banner) + '</div>';
|
|
1204
|
+
}
|
|
1205
|
+
for (const m of members) {
|
|
1206
|
+
out += '<div data-kb-lower-quality-member="' + escapeHtml(String(m.member || '(unknown member)')) + '" style="font-size: 11px; color: #f59e0b; padding: 2px 8px;">'
|
|
1207
|
+
+ escapeHtml(String(m.member || '(unknown member)')) + ': ' + escapeHtml(String(m.reason || 'unverified'))
|
|
1208
|
+
+ ' -- fix: ' + escapeHtml(String(m.fix || '(none recorded)')) + '</div>';
|
|
1209
|
+
}
|
|
1210
|
+
return out;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
let html = '<div data-kb-code-intel="true" style="padding: 8px;">' + lowerQualityHtml();
|
|
1214
|
+
html += '<div style="font-size: 11px; color: #a1a1aa; padding: 2px 8px;">kb_* and code_* tool calls counted by each member\'s own fleet server, read before and after every dispatch. "unknown" means the count could not be read -- it is not zero.</div>';
|
|
1215
|
+
if (records.length === 0) {
|
|
1216
|
+
html += '<div data-kb-panel-empty="true" style="font-size: 11px; color: #71717a; padding: 8px;">(no dispatches recorded yet)</div>';
|
|
1217
|
+
return html + '</div>';
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
// Per-member totals, in first-dispatch order.
|
|
1221
|
+
const order = [];
|
|
1222
|
+
const totals = {};
|
|
1223
|
+
for (const r of records) {
|
|
1224
|
+
const name = String(r.member || '(unknown member)');
|
|
1225
|
+
if (!Object.prototype.hasOwnProperty.call(totals, name)) {
|
|
1226
|
+
totals[name] = { dispatches: 0, kb: 0, code: 0, reason: null };
|
|
1227
|
+
order.push(name);
|
|
1228
|
+
}
|
|
1229
|
+
const t = totals[name];
|
|
1230
|
+
t.dispatches++;
|
|
1231
|
+
if (!t.reason && r.reason && (!isCount(r.kb) || !isCount(r.code))) t.reason = String(r.reason);
|
|
1232
|
+
t.kb = isCount(t.kb) && isCount(r.kb) ? t.kb + r.kb : 'unknown';
|
|
1233
|
+
t.code = isCount(t.code) && isCount(r.code) ? t.code + r.code : 'unknown';
|
|
1234
|
+
}
|
|
1235
|
+
html += '<div style="font-size: 11px; font-weight: 600; color: #a1a1aa; padding: 8px 8px 2px 8px;">Per member</div>';
|
|
1236
|
+
html += '<table data-kb-panel-members="true" style="border-collapse: collapse;"><tr>' + th('member') + th('dispatches') + th('kb_* calls') + th('code_* calls') + '</tr>';
|
|
1237
|
+
for (const name of order) {
|
|
1238
|
+
const t = totals[name];
|
|
1239
|
+
html += '<tr data-member="' + escapeHtml(name) + '">' + textCell(name) + textCell(t.dispatches)
|
|
1240
|
+
+ countCell(t.kb, memberUnknownReason(name, t.reason)) + countCell(t.code, memberUnknownReason(name, t.reason)) + '</tr>';
|
|
1241
|
+
}
|
|
1242
|
+
html += '</table>';
|
|
1243
|
+
// Visible reason for every member whose totals are unknown.
|
|
1244
|
+
for (const name of order) {
|
|
1245
|
+
const t = totals[name];
|
|
1246
|
+
if (isCount(t.kb) && isCount(t.code)) continue;
|
|
1247
|
+
html += '<div data-kb-unknown-reason="' + escapeHtml(name) + '" style="font-size: 11px; color: #f59e0b; padding: 2px 8px;">'
|
|
1248
|
+
+ escapeHtml(name) + ': kb_* and code_* counts unknown (' + escapeHtml(memberUnknownReason(name, t.reason)) + ')</div>';
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
html += '<div style="font-size: 11px; font-weight: 600; color: #a1a1aa; padding: 8px 8px 2px 8px;">Per dispatch</div>';
|
|
1252
|
+
html += '<table data-kb-panel-dispatches="true" style="border-collapse: collapse;"><tr>' + th('#') + th('member') + th('role') + th('label') + th('kb_* calls') + th('code_* calls') + '</tr>';
|
|
1253
|
+
for (const r of records) {
|
|
1254
|
+
html += '<tr>' + textCell(isCount(r.index) ? r.index : '-') + textCell(r.member || '(unknown member)')
|
|
1255
|
+
+ textCell(r.role || '-') + textCell(r.label || '-')
|
|
1256
|
+
+ countCell(r.kb, r.reason) + countCell(r.code, r.reason) + '</tr>';
|
|
1257
|
+
}
|
|
1258
|
+
html += '</table>';
|
|
1259
|
+
return html + '</div>';
|
|
1260
|
+
} catch (err) {
|
|
1261
|
+
return '<div data-kb-code-intel="true" data-kb-code-intel-error="true" style="font-size: 11px; color: #71717a; padding: 8px;">(Knowledge and Code Intel panel unavailable)</div>';
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
/**
|
|
1266
|
+
* The Knowledge and Code Intel tab: its own dashboardExtensions entry
|
|
1267
|
+
* (registered alongside beadsExtension in bin/cli.mjs), subscribed to
|
|
1268
|
+
* dispatch-accounting.mjs's publishState namespace.
|
|
1269
|
+
*/
|
|
1270
|
+
export const kbCodeIntelExtension = {
|
|
1271
|
+
id: 'kb-code-intel',
|
|
1272
|
+
title: 'Knowledge & Code Intel',
|
|
1273
|
+
js: `
|
|
1274
|
+
${escapeHtml.toString()}
|
|
1275
|
+
${renderKbCodeIntelHtml.toString()}
|
|
1276
|
+
|
|
1277
|
+
let lastDispatchToolCalls = null;
|
|
1278
|
+
let lastMemberInit = null;
|
|
1279
|
+
|
|
1280
|
+
function renderKbCodeIntelPanel() {
|
|
1281
|
+
const container = document.getElementById('extension-kb-code-intel');
|
|
1282
|
+
if (!container) return;
|
|
1283
|
+
container.innerHTML = renderKbCodeIntelHtml(lastDispatchToolCalls, lastMemberInit);
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
document.addEventListener('workflow:state:' + ${JSON.stringify(MEMBER_INIT_STATE_NAMESPACE)}, (e) => {
|
|
1287
|
+
lastMemberInit = e.detail || null;
|
|
1288
|
+
renderKbCodeIntelPanel();
|
|
1289
|
+
});
|
|
1290
|
+
|
|
1291
|
+
// String-concat form (not a quoted interpolation) so the per-line
|
|
1292
|
+
// shell-command guard does not read it as a member-bound command.
|
|
1293
|
+
document.addEventListener('workflow:state:' + ${JSON.stringify(DISPATCH_TOOL_CALLS_STATE_NAMESPACE)}, (e) => {
|
|
1294
|
+
lastDispatchToolCalls = e.detail || null;
|
|
1295
|
+
renderKbCodeIntelPanel();
|
|
1296
|
+
});
|
|
1297
|
+
|
|
1298
|
+
renderKbCodeIntelPanel();
|
|
1299
|
+
`
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
// =============================================================================
|
|
1303
|
+
// PENDING OPERATOR DECISIONS: banner + answer form (decision-wait.mjs publishes
|
|
1304
|
+
// the 'decisions' namespace: { state, pending: [...], waitingSince, setAside }).
|
|
1305
|
+
// =============================================================================
|
|
1306
|
+
|
|
1307
|
+
/** Longest operator answer the answer route accepts. */
|
|
1308
|
+
export const DECISION_ANSWER_MAX_CHARS = 4000;
|
|
1309
|
+
|
|
1310
|
+
/**
|
|
1311
|
+
* The decisions banner. Pure and self-contained (it is embedded into the
|
|
1312
|
+
* browser page with .toString(), like the other renderers here): every
|
|
1313
|
+
* interpolated value goes through escapeHtml; a malformed record can never
|
|
1314
|
+
* take the page down. Returns '' when nothing is pending. Question, options
|
|
1315
|
+
* and recommendation are never truncated.
|
|
1316
|
+
*
|
|
1317
|
+
* @param {{ state?: string, pending?: object[] }|null|undefined} data
|
|
1318
|
+
* @returns {string}
|
|
1319
|
+
*/
|
|
1320
|
+
export function renderDecisionsBannerHtml(data) {
|
|
1321
|
+
try {
|
|
1322
|
+
const pending = data && Array.isArray(data.pending) ? data.pending.filter(function (d) { return d && typeof d === 'object'; }) : [];
|
|
1323
|
+
if (pending.length === 0) return '';
|
|
1324
|
+
function channelHtml(name, n) {
|
|
1325
|
+
if (!n || typeof n !== 'object' || !n.status) {
|
|
1326
|
+
return '<span data-notify-channel="' + escapeHtml(name) + '" style="color: #a1a1aa;">' + escapeHtml(name) + ': not attempted</span>';
|
|
1327
|
+
}
|
|
1328
|
+
if (n.status === 'sent') {
|
|
1329
|
+
return '<span data-notify-channel="' + escapeHtml(name) + '" style="color: #4ade80;">' + escapeHtml(name) + ': sent</span>';
|
|
1330
|
+
}
|
|
1331
|
+
return '<span data-notify-channel="' + escapeHtml(name) + '" data-notify-failed="true" style="color: #f87171;">'
|
|
1332
|
+
+ escapeHtml(name) + ': notification failed' + (n.reason ? ' (' + escapeHtml(String(n.reason)) + ')' : '') + '</span>';
|
|
1333
|
+
}
|
|
1334
|
+
const paused = data.state === 'paused-awaiting-decision';
|
|
1335
|
+
let html = '<div data-decisions-banner="true" style="border: 1px solid #f59e0b; background: #2a2110; border-radius: 6px; padding: 10px; margin: 6px;">'
|
|
1336
|
+
+ '<div style="font-weight: 600; color: #fbbf24; font-size: 13px;">Operator decision needed ('
|
|
1337
|
+
+ escapeHtml(String(pending.length)) + ' pending' + (paused ? ', sprint paused awaiting decision' : '') + ')</div>';
|
|
1338
|
+
for (const d of pending) {
|
|
1339
|
+
const id = escapeHtml(String(d.decisionId || ''));
|
|
1340
|
+
const options = Array.isArray(d.options) ? d.options : [];
|
|
1341
|
+
const n = d.notification && typeof d.notification === 'object' ? d.notification : {};
|
|
1342
|
+
html += '<div data-decision-id="' + id + '" style="margin-top: 10px; font-size: 12px; color: #e4e4e7;">'
|
|
1343
|
+
+ '<div style="color: #a1a1aa;">Bead ' + escapeHtml(String(d.beadId || '')) + (d.decisionBeadId ? ' (decision bead ' + escapeHtml(String(d.decisionBeadId)) + ')' : '') + '</div>'
|
|
1344
|
+
+ '<div data-decision-question="true" style="white-space: pre-wrap; margin: 4px 0;">' + escapeHtml(String(d.question || '')) + '</div>'
|
|
1345
|
+
+ '<ul style="margin: 4px 0; padding-left: 18px;">';
|
|
1346
|
+
for (const o of options) {
|
|
1347
|
+
html += '<li data-decision-option="' + escapeHtml(String(o && o.id)) + '" style="white-space: pre-wrap;">(' + escapeHtml(String(o && o.id)) + ') ' + escapeHtml(String(o && o.text)) + '</li>';
|
|
1348
|
+
}
|
|
1349
|
+
html += '</ul><div data-decision-recommendation="true">Recommendation: ' + escapeHtml(String(d.recommendation || '')) + '</div>'
|
|
1350
|
+
+ '<div style="margin-top: 4px; font-size: 11px;">Notification: ' + channelHtml('message', n.message) + ' · ' + channelHtml('email', n.email) + '</div>'
|
|
1351
|
+
+ '<form data-decision-form="' + id + '" style="margin-top: 6px;">';
|
|
1352
|
+
for (const o of options) {
|
|
1353
|
+
html += '<label style="margin-right: 10px;"><input type="radio" name="option-' + id + '" value="' + escapeHtml(String(o && o.id)) + '"/> ' + escapeHtml(String(o && o.id)) + '</label>';
|
|
1354
|
+
}
|
|
1355
|
+
html += '<div><textarea name="text" maxlength="4000" rows="2" placeholder="Answer or extra instructions" style="width: 90%; margin-top: 4px; background: #18181b; color: #e4e4e7; border: 1px solid #3f3f46;"></textarea></div>'
|
|
1356
|
+
+ '<button type="submit" style="margin-top: 4px;">Submit answer</button> <span data-decision-result="true" style="font-size: 11px;"></span>'
|
|
1357
|
+
+ '</form></div>';
|
|
1358
|
+
}
|
|
1359
|
+
return html + '</div>';
|
|
1360
|
+
} catch (err) {
|
|
1361
|
+
return '<div data-decisions-banner="true" data-decisions-error="true" style="color: #f87171; padding: 8px;">(pending decisions present but could not be rendered)</div>';
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* Validates an answer-route body: { decisionId, answer } with a non-empty
|
|
1367
|
+
* string answer of at most DECISION_ANSWER_MAX_CHARS. Returns { ok, ... }.
|
|
1368
|
+
*/
|
|
1369
|
+
export function validateDecisionAnswerBody(body) {
|
|
1370
|
+
if (!body || typeof body !== 'object' || Array.isArray(body)) return { ok: false, error: 'body must be a JSON object' };
|
|
1371
|
+
if (typeof body.decisionId !== 'string' || !body.decisionId.trim()) return { ok: false, error: 'decisionId is required' };
|
|
1372
|
+
if (typeof body.answer !== 'string' || !body.answer.trim()) return { ok: false, error: 'answer is required' };
|
|
1373
|
+
if (body.answer.length > DECISION_ANSWER_MAX_CHARS) return { ok: false, error: `answer is longer than ${DECISION_ANSWER_MAX_CHARS} characters` };
|
|
1374
|
+
return { ok: true, decisionId: body.decisionId.trim(), answer: body.answer.trim() };
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
/**
|
|
1378
|
+
* Builds the decisions dashboard extension. `answer(decisionId, answer)` is
|
|
1379
|
+
* injectable for tests; it defaults to the in-process run that owns the
|
|
1380
|
+
* decision (decision-wait.mjs), which records it exactly like
|
|
1381
|
+
* `bd human respond` and resumes the sprint without a relaunch.
|
|
1382
|
+
*/
|
|
1383
|
+
export function createDecisionsExtension({ answer = answerPendingDecision } = {}) {
|
|
1384
|
+
return {
|
|
1385
|
+
id: DECISIONS_STATE_NAMESPACE,
|
|
1386
|
+
title: 'Decisions',
|
|
1387
|
+
// Once-per-publish summary, delivered unleaned in both GET /state
|
|
1388
|
+
// (top-level `summary`) and GET /state?summary=1, so a pending
|
|
1389
|
+
// decision's question and options are never truncated.
|
|
1390
|
+
summarize(data) {
|
|
1391
|
+
const d = data || {};
|
|
1392
|
+
return {
|
|
1393
|
+
state: d.state || 'running',
|
|
1394
|
+
pending: Array.isArray(d.pending) ? d.pending : [],
|
|
1395
|
+
waitingSince: d.waitingSince ?? null,
|
|
1396
|
+
};
|
|
1397
|
+
},
|
|
1398
|
+
actions: {
|
|
1399
|
+
async answer({ body, state }) {
|
|
1400
|
+
const checked = validateDecisionAnswerBody(body);
|
|
1401
|
+
if (!checked.ok) return { status: 400, body: { error: checked.error } };
|
|
1402
|
+
const known = state && state.extensions && state.extensions[DECISIONS_STATE_NAMESPACE];
|
|
1403
|
+
const pending = known && Array.isArray(known.pending) ? known.pending : [];
|
|
1404
|
+
if (!pending.some((d) => d && d.decisionId === checked.decisionId)) {
|
|
1405
|
+
return { status: 404, body: { error: 'no such pending decision', decisionId: checked.decisionId } };
|
|
1406
|
+
}
|
|
1407
|
+
try {
|
|
1408
|
+
const rec = await answer(checked.decisionId, checked.answer);
|
|
1409
|
+
return { status: 200, body: { ok: true, decisionId: checked.decisionId, status: (rec && rec.status) || 'recorded', released: (rec && rec.released) || [] } };
|
|
1410
|
+
} catch (err) {
|
|
1411
|
+
return { status: 409, body: { error: String(err && err.message ? err.message : err).slice(0, 500) } };
|
|
1412
|
+
}
|
|
1413
|
+
},
|
|
1414
|
+
},
|
|
1415
|
+
js: `
|
|
1416
|
+
${escapeHtml.toString()}
|
|
1417
|
+
${renderDecisionsBannerHtml.toString()}
|
|
1418
|
+
|
|
1419
|
+
let lastDecisions = null;
|
|
1420
|
+
let formBusy = false;
|
|
1421
|
+
// A render that arrived while an answer was in flight; applied once
|
|
1422
|
+
// the operator has had a moment to read the inline result.
|
|
1423
|
+
let renderDeferred = false;
|
|
1424
|
+
// Last HTML written to each surface: an identical re-publish must
|
|
1425
|
+
// not wipe an answer the operator is still typing.
|
|
1426
|
+
const renderedHtml = { panel: null, banner: null };
|
|
1427
|
+
|
|
1428
|
+
function renderDecisionsPanel() {
|
|
1429
|
+
const container = document.getElementById('extension-decisions');
|
|
1430
|
+
if (!container) return;
|
|
1431
|
+
const html = renderDecisionsBannerHtml(lastDecisions) || '<div style="font-size: 11px; color: #71717a; padding: 8px;">(no decisions pending)</div>';
|
|
1432
|
+
if (html === renderedHtml.panel) return;
|
|
1433
|
+
renderedHtml.panel = html;
|
|
1434
|
+
container.innerHTML = html;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
// The header-level banner (the viewer's per-extension slot outside
|
|
1438
|
+
// every tab panel): visible on every tab while a decision is
|
|
1439
|
+
// pending, hidden when none is.
|
|
1440
|
+
function renderDecisionsHeaderBanner() {
|
|
1441
|
+
const slot = document.getElementById('extension-banner-decisions');
|
|
1442
|
+
if (!slot) return;
|
|
1443
|
+
const html = renderDecisionsBannerHtml(lastDecisions);
|
|
1444
|
+
if (html === renderedHtml.banner) return;
|
|
1445
|
+
renderedHtml.banner = html;
|
|
1446
|
+
slot.innerHTML = html;
|
|
1447
|
+
slot.style.display = html ? 'block' : 'none';
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
function renderDecisions() {
|
|
1451
|
+
if (formBusy) { renderDeferred = true; return; }
|
|
1452
|
+
renderDecisionsPanel();
|
|
1453
|
+
renderDecisionsHeaderBanner();
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
// GET /state leans long strings under state.extensions, so the
|
|
1457
|
+
// untruncated per-publish summary (summarize() above, dispatched
|
|
1458
|
+
// just before the state event) is preferred; the raw state is the
|
|
1459
|
+
// fallback when no summary has been published yet.
|
|
1460
|
+
let lastSummary = null;
|
|
1461
|
+
document.addEventListener('workflow:summary:decisions', (e) => {
|
|
1462
|
+
lastSummary = e.detail || null;
|
|
1463
|
+
});
|
|
1464
|
+
document.addEventListener('workflow:state:decisions', (e) => {
|
|
1465
|
+
lastDecisions = lastSummary || e.detail || null;
|
|
1466
|
+
renderDecisions();
|
|
1467
|
+
});
|
|
1468
|
+
|
|
1469
|
+
document.addEventListener('submit', async (ev) => {
|
|
1470
|
+
const form = ev.target && ev.target.closest ? ev.target.closest('form[data-decision-form]') : null;
|
|
1471
|
+
if (!form) return;
|
|
1472
|
+
ev.preventDefault();
|
|
1473
|
+
const decisionId = form.getAttribute('data-decision-form');
|
|
1474
|
+
const picked = form.querySelector('input[type=radio]:checked');
|
|
1475
|
+
const text = (form.querySelector('textarea') || {}).value || '';
|
|
1476
|
+
const answer = [picked ? picked.value : '', text.trim()].filter(Boolean).join(': ');
|
|
1477
|
+
const result = form.querySelector('[data-decision-result]');
|
|
1478
|
+
if (!answer) { if (result) result.textContent = 'Choose an option or type an answer.'; return; }
|
|
1479
|
+
formBusy = true;
|
|
1480
|
+
let recorded = false;
|
|
1481
|
+
try {
|
|
1482
|
+
// Same-origin JSON POST: the answer routes refuse any other
|
|
1483
|
+
// content type and any cross-site origin.
|
|
1484
|
+
const res = await fetch('/extensions/decisions/actions/answer', {
|
|
1485
|
+
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
1486
|
+
body: JSON.stringify({ decisionId: decisionId, answer: answer })
|
|
1487
|
+
});
|
|
1488
|
+
const out = await res.json().catch(() => ({}));
|
|
1489
|
+
recorded = res.ok;
|
|
1490
|
+
if (result) result.textContent = res.ok ? 'Answer recorded; the sprint resumes.' : ('Failed: ' + (out.error || res.status));
|
|
1491
|
+
} catch (err) {
|
|
1492
|
+
if (result) result.textContent = 'Failed: ' + err.message;
|
|
1493
|
+
} finally {
|
|
1494
|
+
const release = () => {
|
|
1495
|
+
formBusy = false;
|
|
1496
|
+
if (renderDeferred) { renderDeferred = false; renderDecisions(); }
|
|
1497
|
+
};
|
|
1498
|
+
// Keep a recorded result readable briefly before a state
|
|
1499
|
+
// update that drops the answered decision hides it.
|
|
1500
|
+
if (recorded) setTimeout(release, 2500); else release();
|
|
1501
|
+
}
|
|
1502
|
+
});
|
|
1503
|
+
|
|
1504
|
+
renderDecisions();
|
|
1505
|
+
`
|
|
1506
|
+
};
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
export const decisionsExtension = createDecisionsExtension();
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
// <-> worklists.mjs cycle is safe because every use is inside a function
|
|
14
14
|
// body, never at module-evaluation time.
|
|
15
15
|
import { normalizeTierToken, DEFAULT_CONTEXT_CEILING } from './runner.js';
|
|
16
|
+
import { laneOf } from './beads-scope.mjs';
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* Validates a streak-assignment agent() result against the set of currently
|
|
@@ -86,9 +87,12 @@ export function selectStreaks(candidate, currentReady) {
|
|
|
86
87
|
* Ordering is total and stable: within a lane by numeric `streakOrder`
|
|
87
88
|
* ascending (missing/non-numeric last), then `title`, then `id`; lanes by their
|
|
88
89
|
* minimum `streakOrder`, then `streak` id. Members of a ready set are mutually
|
|
89
|
-
* unblocked
|
|
90
|
-
* the set),
|
|
91
|
-
*
|
|
90
|
+
* unblocked over `blocks` edges (such an edge keeps the blocked side out of
|
|
91
|
+
* the set), and lane order is enforced before this point by
|
|
92
|
+
* holdBackByLaneOrder(): a bead whose lower-order lane-mate is open and not
|
|
93
|
+
* in the same ready set never reaches here. So `streakOrder` alone cannot
|
|
94
|
+
* violate a prerequisite and the title/id tiebreak only separates
|
|
95
|
+
* otherwise-equal peers.
|
|
92
96
|
*
|
|
93
97
|
* Pure: no I/O, no agent() calls.
|
|
94
98
|
* @param {Array<{id: string, title?: string, metadata?: {streak?: string, streakOrder?: number|string}}>} currentReady
|
|
@@ -135,6 +139,58 @@ export function groupStreaksFromLaneMetadata(currentReady) {
|
|
|
135
139
|
return { streaks: laneEntries.map((e) => e.sorted), reason: null };
|
|
136
140
|
}
|
|
137
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Lane order is a prerequisite: a laned ready bead is dispatchable only when
|
|
144
|
+
* every lane-mate with a LOWER `streakOrder` is closed or is itself in the
|
|
145
|
+
* dispatchable set (it then runs ahead of it in the same streak, since
|
|
146
|
+
* groupStreaksFromLaneMetadata puts one lane into one streak in order).
|
|
147
|
+
* Holding one bead can hold its successors, so this runs to a fixpoint. Beads
|
|
148
|
+
* without a finite `streakOrder` take no part.
|
|
149
|
+
*
|
|
150
|
+
* Pure: no I/O.
|
|
151
|
+
* @param {Array<object>} ready this round's candidate beads, after every other exclusion
|
|
152
|
+
* @param {Array<object>} scopeBeads every in-scope bead, any status
|
|
153
|
+
* @returns {{ dispatchable: object[], held: Array<{ id: string, on: string[] }> }}
|
|
154
|
+
*/
|
|
155
|
+
export function holdBackByLaneOrder(ready, scopeBeads) {
|
|
156
|
+
const list = Array.isArray(ready) ? ready : [];
|
|
157
|
+
const kept = new Set(list.map((b) => String(b.id)));
|
|
158
|
+
const openLaned = [];
|
|
159
|
+
const seen = new Set();
|
|
160
|
+
for (const b of [...(Array.isArray(scopeBeads) ? scopeBeads : []), ...list]) {
|
|
161
|
+
if (!b || seen.has(String(b.id))) continue;
|
|
162
|
+
seen.add(String(b.id));
|
|
163
|
+
if (b.status !== 'closed' && laneOf(b)) openLaned.push(b);
|
|
164
|
+
}
|
|
165
|
+
const lowerOpenMates = (bead) => {
|
|
166
|
+
const lane = laneOf(bead);
|
|
167
|
+
if (!lane) return [];
|
|
168
|
+
return openLaned
|
|
169
|
+
.filter((m) => String(m.id) !== String(bead.id))
|
|
170
|
+
.filter((m) => { const ml = laneOf(m); return ml.streak === lane.streak && ml.order < lane.order; })
|
|
171
|
+
.map((m) => String(m.id));
|
|
172
|
+
};
|
|
173
|
+
const heldOn = new Map();
|
|
174
|
+
let changed = true;
|
|
175
|
+
while (changed) {
|
|
176
|
+
changed = false;
|
|
177
|
+
for (const b of list) {
|
|
178
|
+
const id = String(b.id);
|
|
179
|
+
if (!kept.has(id)) continue;
|
|
180
|
+
const missing = lowerOpenMates(b).filter((m) => !kept.has(m));
|
|
181
|
+
if (missing.length > 0) {
|
|
182
|
+
kept.delete(id);
|
|
183
|
+
heldOn.set(id, missing.sort());
|
|
184
|
+
changed = true;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
dispatchable: list.filter((b) => kept.has(String(b.id))),
|
|
190
|
+
held: [...heldOn.entries()].map(([id, on]) => ({ id, on })),
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
138
194
|
export const SIZE_POINTS = Object.freeze({ S: 1, M: 2, L: 4 });
|
|
139
195
|
export const MODEL_WEIGHT = Object.freeze({ cheap: 1, standard: 10, premium: 20 });
|
|
140
196
|
export const DEFAULT_EFFORT_THRESHOLD = 200;
|