@wrongstack/cli 0.296.4 → 0.298.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-A5OSIU2P.js → acp-S4LZQB66.js} +91 -23
- package/dist/{auth-CJWQJVRH.js → auth-NLLGEYQR.js} +3 -3
- package/dist/boot/dispatch-webui.d.ts +7 -0
- package/dist/boot/governance-evidence-candidate.d.ts +3 -0
- package/dist/boot/governance-shadow-bridge.d.ts +19 -0
- package/dist/boot/governance-trace-context.d.ts +64 -0
- package/dist/boot/launch-banner.d.ts +22 -0
- package/dist/boot/tui-session-resume.d.ts +10 -1
- package/dist/chimera-leader-wake.d.ts +57 -0
- package/dist/chimera-reviewer-policy.d.ts +89 -1
- package/dist/chimera-subagent-ladder.d.ts +72 -0
- package/dist/{chunk-AZESNNIC.js → chunk-4HH3YGG4.js} +3 -3
- package/dist/{chunk-IHBYBYGA.js → chunk-A6Q5KGLV.js} +51 -18
- package/dist/{chunk-ABXK4VVY.js → chunk-ARWGQUB3.js} +2 -1
- package/dist/{chunk-OI7GWJDS.js → chunk-C5GH4YBL.js} +1389 -184
- package/dist/{chunk-TADVX644.js → chunk-GO3TJICK.js} +11 -2
- package/dist/{chunk-JBTFWWKV.js → chunk-I2BM6FK6.js} +9 -4
- package/dist/{chunk-AXVZMEWG.js → chunk-I5MEUFDI.js} +2 -2
- package/dist/{chunk-WY7KKOUK.js → chunk-JW75HY4F.js} +31 -10
- package/dist/chunk-U3SS4NRH.js +10 -0
- package/dist/{chunk-Z7YGASQP.js → chunk-V3XH6XBJ.js} +30 -26
- package/dist/{chunk-BQCAJ7FI.js → chunk-XTIXVJXP.js} +16 -3
- package/dist/{cli-main-TOAWVJDY.js → cli-main-TJEU4OUY.js} +25912 -25134
- package/dist/cli-main-helpers.d.ts +42 -2
- package/dist/{execution-O7I5DYE6.js → execution-INOV5P7N.js} +1264 -650
- package/dist/execution-chimera-cascade.d.ts +7 -1
- package/dist/execution-chimera-review.d.ts +35 -0
- package/dist/fleet/host-types.d.ts +6 -1
- package/dist/fleet-statusline.d.ts +1 -0
- package/dist/goal-host.d.ts +1 -1
- package/dist/governance-V2Z42RBE.js +65 -0
- package/dist/governance-hq-telemetry.d.ts +17 -0
- package/dist/{hq-JUYKUNJX.js → hq-WO6CLUSI.js} +2 -2
- package/dist/hq-publisher.d.ts +3 -2
- package/dist/hq-server/auth.d.ts +33 -2
- package/dist/hq-server/login-attempt-store.d.ts +73 -0
- package/dist/hq-server/routes/auth-handlers.d.ts +73 -5
- package/dist/hq-server/routes.d.ts +5 -5
- package/dist/hq-server/types.d.ts +44 -2
- package/dist/hq-server/utils.d.ts +51 -6
- package/dist/hq-server/ws.d.ts +61 -2
- package/dist/{hq-server-6AQ3BXZA.js → hq-server-6TSAORAC.js} +2 -2
- package/dist/hq-server.d.ts +10 -0
- package/dist/index.js +337 -42
- package/dist/kanban-hq-sync.d.ts +13 -1
- package/dist/live-settings-input.d.ts +10 -1
- package/dist/{mailbox-serve-2UWHEN3M.js → mailbox-serve-DBOOOOWZ.js} +50 -8
- package/dist/{sdd-runtime-JG4EEKL6.js → sdd-runtime-AIJCJGWC.js} +2 -2
- package/dist/services/sdd/state.d.ts +3 -3
- package/dist/settings-menu.d.ts +1 -1
- package/dist/slash-commands/command-context.d.ts +2 -0
- package/dist/slash-commands/fallback.d.ts +2 -0
- package/dist/slash-commands/goal-refiner.d.ts +1 -1
- package/dist/slash-commands/goal.d.ts +1 -1
- package/dist/subcommands/handlers/acp-connection-gate.d.ts +20 -0
- package/dist/subcommands/handlers/governance.d.ts +8 -0
- package/dist/{update-YC4TYW2Y.js → update-MV6TUACD.js} +3 -3
- package/dist/utils/win32-cmd.d.ts +9 -6
- package/dist/{version-help-DROHZRW6.js → version-help-ASKQYXDJ.js} +2 -2
- package/dist/webui-server/kanban-host-adapter.d.ts +1 -1
- package/dist/webui-server/session-start-payload.d.ts +4 -0
- package/dist/{webui-server-ZF5KVGC5.js → webui-server-PCLSXX6L.js} +164 -134
- package/dist/webui-server-options.d.ts +7 -0
- package/dist/wiring/brain-and-orchestration.d.ts +2 -0
- package/dist/wiring/hq-telemetry.d.ts +4 -3
- package/dist/wiring/lifecycle-plugins.d.ts +5 -8
- package/dist/wiring/metrics.d.ts +1 -1
- package/dist/wiring/provider-runtime-setup.d.ts +2 -2
- package/package.json +23 -22
- package/dist/acp-A5OSIU2P.js.map +0 -7
- package/dist/acp-registry-cache.d.ts.map +0 -1
- package/dist/acp-server-agent.d.ts.map +0 -1
- package/dist/arg-parser.d.ts.map +0 -1
- package/dist/audit-2ZSFGNIF.js.map +0 -7
- package/dist/auth-CJWQJVRH.js.map +0 -7
- package/dist/auth-menu/add-provider.d.ts.map +0 -1
- package/dist/auth-menu/anthropic-oauth.d.ts.map +0 -1
- package/dist/auth-menu/auth-menu-audit.d.ts.map +0 -1
- package/dist/auth-menu/direct.d.ts.map +0 -1
- package/dist/auth-menu/github-copilot-oauth.d.ts.map +0 -1
- package/dist/auth-menu/helpers.d.ts.map +0 -1
- package/dist/auth-menu/index.d.ts.map +0 -1
- package/dist/auth-menu/local-presets.d.ts.map +0 -1
- package/dist/auth-menu/local.d.ts.map +0 -1
- package/dist/auth-menu/loopback-server.d.ts.map +0 -1
- package/dist/auth-menu/oauth-menu.d.ts.map +0 -1
- package/dist/auth-menu/openai-codex-oauth.d.ts.map +0 -1
- package/dist/auth-menu/panel-service.d.ts.map +0 -1
- package/dist/auth-menu/provider-menu.d.ts.map +0 -1
- package/dist/auth-menu/shared.d.ts.map +0 -1
- package/dist/auth-menu/top-menu.d.ts.map +0 -1
- package/dist/auth-menu/types.d.ts.map +0 -1
- package/dist/auth-menu.d.ts.map +0 -1
- package/dist/bench-7ZDWSNEF.js.map +0 -7
- package/dist/boot/auto-discover-providers.d.ts.map +0 -1
- package/dist/boot/brain-decision-log.d.ts.map +0 -1
- package/dist/boot/config-backup-recovery.d.ts.map +0 -1
- package/dist/boot/container-wiring.d.ts.map +0 -1
- package/dist/boot/dispatch-singleshot.d.ts.map +0 -1
- package/dist/boot/dispatch-tui.d.ts.map +0 -1
- package/dist/boot/dispatch-webui.d.ts.map +0 -1
- package/dist/boot/event-wiring.d.ts.map +0 -1
- package/dist/boot/execution-mode.d.ts.map +0 -1
- package/dist/boot/launch-menu.d.ts.map +0 -1
- package/dist/boot/short-circuit-desktop.d.ts.map +0 -1
- package/dist/boot/short-circuit-flags.d.ts.map +0 -1
- package/dist/boot/short-circuit-hq.d.ts.map +0 -1
- package/dist/boot/simpleui-full-auto.d.ts.map +0 -1
- package/dist/boot/system-prompt-builder.d.ts.map +0 -1
- package/dist/boot/system-prompt.d.ts.map +0 -1
- package/dist/boot/tool-registry.d.ts.map +0 -1
- package/dist/boot/tui-coordinator-callbacks.d.ts.map +0 -1
- package/dist/boot/tui-coordinator-setup.d.ts.map +0 -1
- package/dist/boot/tui-debug-stream.d.ts.map +0 -1
- package/dist/boot/tui-goal-wiring.d.ts.map +0 -1
- package/dist/boot/tui-live-sessions.d.ts.map +0 -1
- package/dist/boot/tui-project-picker-callback.d.ts.map +0 -1
- package/dist/boot/tui-project-spawn.d.ts.map +0 -1
- package/dist/boot/tui-project-switch.d.ts.map +0 -1
- package/dist/boot/tui-runtime-state.d.ts.map +0 -1
- package/dist/boot/tui-sdd-callback.d.ts.map +0 -1
- package/dist/boot/tui-session-resume.d.ts.map +0 -1
- package/dist/boot/tui-settings-adapter.d.ts.map +0 -1
- package/dist/boot-config.d.ts.map +0 -1
- package/dist/boot.d.ts.map +0 -1
- package/dist/brain-menu/panel-service.d.ts.map +0 -1
- package/dist/chimera-review-task.d.ts.map +0 -1
- package/dist/chimera-reviewer-policy.d.ts.map +0 -1
- package/dist/chronicle-QQEQFSSE.js.map +0 -7
- package/dist/chunk-5N34EWJR.js.map +0 -7
- package/dist/chunk-66T43Q4Y.js.map +0 -7
- package/dist/chunk-7OCVIDC7.js.map +0 -7
- package/dist/chunk-ABXK4VVY.js.map +0 -7
- package/dist/chunk-AXVZMEWG.js.map +0 -7
- package/dist/chunk-AZESNNIC.js.map +0 -7
- package/dist/chunk-BGFM3PD7.js.map +0 -7
- package/dist/chunk-BQCAJ7FI.js.map +0 -7
- package/dist/chunk-DPJZQCVP.js.map +0 -7
- package/dist/chunk-F4PEGAJZ.js.map +0 -7
- package/dist/chunk-IHBYBYGA.js.map +0 -7
- package/dist/chunk-JBSQ7ONN.js.map +0 -7
- package/dist/chunk-JBTFWWKV.js.map +0 -7
- package/dist/chunk-JUHRI6OV.js.map +0 -7
- package/dist/chunk-OI7GWJDS.js.map +0 -7
- package/dist/chunk-OP47B3IX.js.map +0 -7
- package/dist/chunk-PJHET45A.js.map +0 -7
- package/dist/chunk-Q5GTM25S.js.map +0 -7
- package/dist/chunk-QD544J2B.js.map +0 -7
- package/dist/chunk-QUNHS6O3.js.map +0 -7
- package/dist/chunk-TADVX644.js.map +0 -7
- package/dist/chunk-TGDHN4LM.js.map +0 -7
- package/dist/chunk-TYO2OVAD.js.map +0 -7
- package/dist/chunk-VCYZ3WZV.js.map +0 -7
- package/dist/chunk-VJUEZZYB.js +0 -29
- package/dist/chunk-VJUEZZYB.js.map +0 -7
- package/dist/chunk-WHOIR577.js.map +0 -7
- package/dist/chunk-WY7KKOUK.js.map +0 -7
- package/dist/chunk-XJXDOF63.js.map +0 -7
- package/dist/chunk-XWEGWYDU.js.map +0 -7
- package/dist/chunk-YWUPHRGB.js.map +0 -7
- package/dist/chunk-Z7YGASQP.js.map +0 -7
- package/dist/cli-bundled-prompts.d.ts.map +0 -1
- package/dist/cli-bundled-skills.d.ts.map +0 -1
- package/dist/cli-context.d.ts.map +0 -1
- package/dist/cli-entry-main.d.ts.map +0 -1
- package/dist/cli-entry-point.d.ts.map +0 -1
- package/dist/cli-eternal-flag.d.ts.map +0 -1
- package/dist/cli-main-TOAWVJDY.js.map +0 -7
- package/dist/cli-main-helpers.d.ts.map +0 -1
- package/dist/cli-main.d.ts.map +0 -1
- package/dist/cli-update-notice.d.ts.map +0 -1
- package/dist/config-doctor.d.ts.map +0 -1
- package/dist/config-history.d.ts.map +0 -1
- package/dist/context-limit.d.ts.map +0 -1
- package/dist/context-overflow-diagnostic.d.ts.map +0 -1
- package/dist/diag-doctor-OQ3AA63O.js.map +0 -7
- package/dist/diff-renderer.d.ts.map +0 -1
- package/dist/execute-deps.d.ts.map +0 -1
- package/dist/execution-O7I5DYE6.js.map +0 -7
- package/dist/execution-chimera-ask.d.ts.map +0 -1
- package/dist/execution-chimera-cascade.d.ts.map +0 -1
- package/dist/execution-cleanup.d.ts.map +0 -1
- package/dist/execution-kanban-dispatch.d.ts.map +0 -1
- package/dist/execution-repl-fleet-callbacks.d.ts.map +0 -1
- package/dist/execution-storage-observability.d.ts.map +0 -1
- package/dist/execution-tui-next-step-callbacks.d.ts.map +0 -1
- package/dist/execution.d.ts.map +0 -1
- package/dist/export-TPORYVRZ.js.map +0 -7
- package/dist/fleet/host-acp-runner-cache.d.ts.map +0 -1
- package/dist/fleet/host-acp.d.ts.map +0 -1
- package/dist/fleet/host-concurrency.d.ts.map +0 -1
- package/dist/fleet/host-context.d.ts.map +0 -1
- package/dist/fleet/host-director-builder.d.ts.map +0 -1
- package/dist/fleet/host-director-event-bridges.d.ts.map +0 -1
- package/dist/fleet/host-director-services.d.ts.map +0 -1
- package/dist/fleet/host-event-bridge.d.ts.map +0 -1
- package/dist/fleet/host-helpers.d.ts.map +0 -1
- package/dist/fleet/host-learning-tracker.d.ts.map +0 -1
- package/dist/fleet/host-learning.d.ts.map +0 -1
- package/dist/fleet/host-lifecycle-events.d.ts.map +0 -1
- package/dist/fleet/host-paths.d.ts.map +0 -1
- package/dist/fleet/host-provider.d.ts.map +0 -1
- package/dist/fleet/host-session-writer.d.ts.map +0 -1
- package/dist/fleet/host-shadow-pass.d.ts.map +0 -1
- package/dist/fleet/host-spawn-types.d.ts.map +0 -1
- package/dist/fleet/host-status.d.ts.map +0 -1
- package/dist/fleet/host-subagent-factory.d.ts.map +0 -1
- package/dist/fleet/host-supervisor.d.ts.map +0 -1
- package/dist/fleet/host-task-result-report.d.ts.map +0 -1
- package/dist/fleet/host-types.d.ts.map +0 -1
- package/dist/fleet/host.d.ts.map +0 -1
- package/dist/fleet/routing.d.ts.map +0 -1
- package/dist/fleet/status-broadcast.d.ts.map +0 -1
- package/dist/fleet/supervisor-registry.d.ts.map +0 -1
- package/dist/fleet-statusline.d.ts.map +0 -1
- package/dist/goal-host.d.ts.map +0 -1
- package/dist/hooks-wiring.d.ts.map +0 -1
- package/dist/hq-JUYKUNJX.js.map +0 -7
- package/dist/hq-command-controller.d.ts.map +0 -1
- package/dist/hq-publisher.d.ts.map +0 -1
- package/dist/hq-recovery-html.d.ts.map +0 -1
- package/dist/hq-server/audit-actor.d.ts.map +0 -1
- package/dist/hq-server/auth-state.d.ts.map +0 -1
- package/dist/hq-server/auth.d.ts.map +0 -1
- package/dist/hq-server/preflight.d.ts.map +0 -1
- package/dist/hq-server/project-root.d.ts.map +0 -1
- package/dist/hq-server/routes/auth-handlers.d.ts.map +0 -1
- package/dist/hq-server/routes/session-handlers.d.ts.map +0 -1
- package/dist/hq-server/routes/system-handlers.d.ts.map +0 -1
- package/dist/hq-server/routes.d.ts.map +0 -1
- package/dist/hq-server/snapshot.d.ts.map +0 -1
- package/dist/hq-server/startup.d.ts.map +0 -1
- package/dist/hq-server/trust-boundary.d.ts.map +0 -1
- package/dist/hq-server/types.d.ts.map +0 -1
- package/dist/hq-server/utils.d.ts.map +0 -1
- package/dist/hq-server/ws.d.ts.map +0 -1
- package/dist/hq-server-6AQ3BXZA.js.map +0 -7
- package/dist/hq-server.d.ts.map +0 -1
- package/dist/hq-static-serve.d.ts.map +0 -1
- package/dist/hq-ttl-U2FAYFAT.js.map +0 -7
- package/dist/hq-tunnel-RFKGC4HI.js.map +0 -7
- package/dist/hq-tunnel.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -7
- package/dist/init-E2NDDOHI.js.map +0 -7
- package/dist/input-reader.d.ts.map +0 -1
- package/dist/kanban-dispatch-route.d.ts.map +0 -1
- package/dist/kanban-hq-sync.d.ts.map +0 -1
- package/dist/kanban-run-mirror-EKVNGXWW.js.map +0 -7
- package/dist/launch-hints.d.ts.map +0 -1
- package/dist/live-settings-input.d.ts.map +0 -1
- package/dist/mailbox-bridge-bootstrap.d.ts.map +0 -1
- package/dist/mailbox-serve-2UWHEN3M.js.map +0 -7
- package/dist/mcp-CYLPUEHC.js.map +0 -7
- package/dist/mcp-serve.d.ts.map +0 -1
- package/dist/modeldiag-HENYJ4N7.js.map +0 -7
- package/dist/multi-agent.d.ts.map +0 -1
- package/dist/next-task-predictor.d.ts.map +0 -1
- package/dist/permission-prompt.d.ts.map +0 -1
- package/dist/permissions-FNYLZIL4.js.map +0 -7
- package/dist/picker-key-state.d.ts.map +0 -1
- package/dist/picker-model-picker.d.ts.map +0 -1
- package/dist/picker-ui.d.ts.map +0 -1
- package/dist/picker.d.ts.map +0 -1
- package/dist/plugin-api-factory.d.ts.map +0 -1
- package/dist/plugin-management.d.ts.map +0 -1
- package/dist/plugin-usage-OU6X6LM3.js.map +0 -7
- package/dist/plugins-4LJ5IUBI.js.map +0 -7
- package/dist/pre-launch/launch-prompts.d.ts.map +0 -1
- package/dist/pre-launch/project-check.d.ts.map +0 -1
- package/dist/pre-launch.d.ts.map +0 -1
- package/dist/preflight.d.ts.map +0 -1
- package/dist/profile-config-path.d.ts.map +0 -1
- package/dist/project-BLQ3ALVL.js.map +0 -7
- package/dist/project-manifest-GE25PW4S.js.map +0 -7
- package/dist/project-picker-BOCWHBXP.js.map +0 -7
- package/dist/project-picker.d.ts.map +0 -1
- package/dist/projects-XE76NFNZ.js.map +0 -7
- package/dist/provider-config-utils.d.ts.map +0 -1
- package/dist/provider-helpers.d.ts.map +0 -1
- package/dist/provider-id.d.ts.map +0 -1
- package/dist/providers-models-GDELBHZK.js.map +0 -7
- package/dist/quick-VIO2BEHS.js.map +0 -7
- package/dist/renderer.d.ts.map +0 -1
- package/dist/repl-auto-proceed.d.ts.map +0 -1
- package/dist/repl-client-registration.d.ts.map +0 -1
- package/dist/repl-input.d.ts.map +0 -1
- package/dist/repl-options.d.ts.map +0 -1
- package/dist/repl-rendering.d.ts.map +0 -1
- package/dist/repl-suggestions.d.ts.map +0 -1
- package/dist/repl.d.ts.map +0 -1
- package/dist/replay-KCTXNMZQ.js.map +0 -7
- package/dist/rewind-EJMVFVLS.js.map +0 -7
- package/dist/sdd-runtime-JG4EEKL6.js.map +0 -7
- package/dist/services/autonomy-mode.d.ts.map +0 -1
- package/dist/services/commit-message.d.ts.map +0 -1
- package/dist/services/dispatch-classifier.d.ts.map +0 -1
- package/dist/services/mcp-management.d.ts.map +0 -1
- package/dist/services/project-facts.d.ts.map +0 -1
- package/dist/services/project-manifest.d.ts.map +0 -1
- package/dist/services/sdd/project-context.d.ts.map +0 -1
- package/dist/services/sdd/spec-detection.d.ts.map +0 -1
- package/dist/services/sdd/state.d.ts.map +0 -1
- package/dist/services/sdd/task-manager.d.ts.map +0 -1
- package/dist/services/sdd-runtime.d.ts.map +0 -1
- package/dist/services/statusline-config.d.ts.map +0 -1
- package/dist/services/suggestion-store.d.ts.map +0 -1
- package/dist/session-event-wiring.d.ts.map +0 -1
- package/dist/session-stats.d.ts.map +0 -1
- package/dist/sessions-config-NLCMK3BY.js.map +0 -7
- package/dist/settings-menu.d.ts.map +0 -1
- package/dist/shutdown-cleanup.d.ts.map +0 -1
- package/dist/simpleui-dist-JIFGUJO7.js.map +0 -7
- package/dist/simpleui-dist.d.ts.map +0 -1
- package/dist/slash-commands/acp.d.ts.map +0 -1
- package/dist/slash-commands/agent-improve.d.ts.map +0 -1
- package/dist/slash-commands/agents.d.ts.map +0 -1
- package/dist/slash-commands/audit.d.ts.map +0 -1
- package/dist/slash-commands/auth.d.ts.map +0 -1
- package/dist/slash-commands/autonomy.d.ts.map +0 -1
- package/dist/slash-commands/brain.d.ts.map +0 -1
- package/dist/slash-commands/btw.d.ts.map +0 -1
- package/dist/slash-commands/clear.d.ts.map +0 -1
- package/dist/slash-commands/codebase-reindex.d.ts.map +0 -1
- package/dist/slash-commands/collab.d.ts.map +0 -1
- package/dist/slash-commands/command-context.d.ts.map +0 -1
- package/dist/slash-commands/commit-llm.d.ts.map +0 -1
- package/dist/slash-commands/compact.d.ts.map +0 -1
- package/dist/slash-commands/context.d.ts.map +0 -1
- package/dist/slash-commands/coordinator.d.ts.map +0 -1
- package/dist/slash-commands/delegate.d.ts.map +0 -1
- package/dist/slash-commands/design.d.ts.map +0 -1
- package/dist/slash-commands/dev.d.ts.map +0 -1
- package/dist/slash-commands/diag-stats.d.ts.map +0 -1
- package/dist/slash-commands/dispatch-llm.d.ts.map +0 -1
- package/dist/slash-commands/doctor.d.ts.map +0 -1
- package/dist/slash-commands/enhance.d.ts.map +0 -1
- package/dist/slash-commands/ensemble.d.ts.map +0 -1
- package/dist/slash-commands/f-keys.d.ts.map +0 -1
- package/dist/slash-commands/fallback.d.ts.map +0 -1
- package/dist/slash-commands/fix-classifier.d.ts.map +0 -1
- package/dist/slash-commands/fix.d.ts.map +0 -1
- package/dist/slash-commands/fleet.d.ts.map +0 -1
- package/dist/slash-commands/git.d.ts.map +0 -1
- package/dist/slash-commands/gitid.d.ts.map +0 -1
- package/dist/slash-commands/goal-refiner.d.ts.map +0 -1
- package/dist/slash-commands/goal.d.ts.map +0 -1
- package/dist/slash-commands/health.d.ts.map +0 -1
- package/dist/slash-commands/help.d.ts.map +0 -1
- package/dist/slash-commands/helpers.d.ts.map +0 -1
- package/dist/slash-commands/hq.d.ts.map +0 -1
- package/dist/slash-commands/index.d.ts.map +0 -1
- package/dist/slash-commands/init.d.ts.map +0 -1
- package/dist/slash-commands/interrupt.d.ts.map +0 -1
- package/dist/slash-commands/kanban-agent-helpers.d.ts.map +0 -1
- package/dist/slash-commands/kanban-format.d.ts.map +0 -1
- package/dist/slash-commands/kanban-help.d.ts.map +0 -1
- package/dist/slash-commands/kanban.d.ts.map +0 -1
- package/dist/slash-commands/mailbox-demo.d.ts.map +0 -1
- package/dist/slash-commands/mailbox-serve.d.ts.map +0 -1
- package/dist/slash-commands/mailbox.d.ts.map +0 -1
- package/dist/slash-commands/mcp-utils.d.ts.map +0 -1
- package/dist/slash-commands/mcp.d.ts.map +0 -1
- package/dist/slash-commands/memory-compact.d.ts.map +0 -1
- package/dist/slash-commands/memory-flags.d.ts.map +0 -1
- package/dist/slash-commands/memory-formatters.d.ts.map +0 -1
- package/dist/slash-commands/memory.d.ts.map +0 -1
- package/dist/slash-commands/metrics.d.ts.map +0 -1
- package/dist/slash-commands/mode.d.ts.map +0 -1
- package/dist/slash-commands/modelcaps.d.ts.map +0 -1
- package/dist/slash-commands/models.d.ts.map +0 -1
- package/dist/slash-commands/mouse.d.ts.map +0 -1
- package/dist/slash-commands/next.d.ts.map +0 -1
- package/dist/slash-commands/plan.d.ts.map +0 -1
- package/dist/slash-commands/plugin.d.ts.map +0 -1
- package/dist/slash-commands/profile.d.ts.map +0 -1
- package/dist/slash-commands/project-utils.d.ts.map +0 -1
- package/dist/slash-commands/project.d.ts.map +0 -1
- package/dist/slash-commands/provider-status.d.ts.map +0 -1
- package/dist/slash-commands/prune.d.ts.map +0 -1
- package/dist/slash-commands/refiner.d.ts.map +0 -1
- package/dist/slash-commands/review.d.ts.map +0 -1
- package/dist/slash-commands/sdd/rendering.d.ts.map +0 -1
- package/dist/slash-commands/sdd-command-helpers.d.ts.map +0 -1
- package/dist/slash-commands/sdd-format.d.ts.map +0 -1
- package/dist/slash-commands/sdd.d.ts.map +0 -1
- package/dist/slash-commands/security.d.ts.map +0 -1
- package/dist/slash-commands/session.d.ts.map +0 -1
- package/dist/slash-commands/setmodel.d.ts.map +0 -1
- package/dist/slash-commands/settings.d.ts.map +0 -1
- package/dist/slash-commands/shadow.d.ts.map +0 -1
- package/dist/slash-commands/slash-deep-help.d.ts.map +0 -1
- package/dist/slash-commands/spawn-agents.d.ts.map +0 -1
- package/dist/slash-commands/statusline.d.ts.map +0 -1
- package/dist/slash-commands/suggest.d.ts.map +0 -1
- package/dist/slash-commands/suggestion-store.d.ts.map +0 -1
- package/dist/slash-commands/supervisor.d.ts.map +0 -1
- package/dist/slash-commands/surfaces.d.ts.map +0 -1
- package/dist/slash-commands/tasks.d.ts.map +0 -1
- package/dist/slash-commands/techstack.d.ts.map +0 -1
- package/dist/slash-commands/telegram-pairing.d.ts.map +0 -1
- package/dist/slash-commands/telegram-settings.d.ts.map +0 -1
- package/dist/slash-commands/telegram-setup.d.ts.map +0 -1
- package/dist/slash-commands/todos.d.ts.map +0 -1
- package/dist/slash-commands/tool.d.ts.map +0 -1
- package/dist/slash-commands/tools.d.ts.map +0 -1
- package/dist/slash-commands/tuneup.d.ts.map +0 -1
- package/dist/slash-commands/working-dir.d.ts.map +0 -1
- package/dist/slash-commands/worktree.d.ts.map +0 -1
- package/dist/slash-commands/yolo.d.ts.map +0 -1
- package/dist/spinner.d.ts.map +0 -1
- package/dist/subcommands/contracts.d.ts.map +0 -1
- package/dist/subcommands/handlers/acp.d.ts.map +0 -1
- package/dist/subcommands/handlers/audit.d.ts.map +0 -1
- package/dist/subcommands/handlers/auth-local-help.d.ts.map +0 -1
- package/dist/subcommands/handlers/auth.d.ts.map +0 -1
- package/dist/subcommands/handlers/bench-run-help.d.ts.map +0 -1
- package/dist/subcommands/handlers/bench.d.ts.map +0 -1
- package/dist/subcommands/handlers/chronicle.d.ts.map +0 -1
- package/dist/subcommands/handlers/config-history.d.ts.map +0 -1
- package/dist/subcommands/handlers/diag-doctor.d.ts.map +0 -1
- package/dist/subcommands/handlers/export.d.ts.map +0 -1
- package/dist/subcommands/handlers/helpers.d.ts.map +0 -1
- package/dist/subcommands/handlers/hq.d.ts.map +0 -1
- package/dist/subcommands/handlers/init.d.ts.map +0 -1
- package/dist/subcommands/handlers/mailbox-serve.d.ts.map +0 -1
- package/dist/subcommands/handlers/mcp.d.ts.map +0 -1
- package/dist/subcommands/handlers/model-smoke-test.d.ts.map +0 -1
- package/dist/subcommands/handlers/modeldiag-profiles.d.ts.map +0 -1
- package/dist/subcommands/handlers/modeldiag.d.ts.map +0 -1
- package/dist/subcommands/handlers/models-add-help.d.ts.map +0 -1
- package/dist/subcommands/handlers/per-subcommand-deep-help-table.d.ts.map +0 -1
- package/dist/subcommands/handlers/per-subcommand-help-data.d.ts.map +0 -1
- package/dist/subcommands/handlers/per-subcommand-help-table.d.ts.map +0 -1
- package/dist/subcommands/handlers/per-subcommand-help-types.d.ts.map +0 -1
- package/dist/subcommands/handlers/per-subcommand-help.d.ts.map +0 -1
- package/dist/subcommands/handlers/permissions.d.ts.map +0 -1
- package/dist/subcommands/handlers/plugin-usage.d.ts.map +0 -1
- package/dist/subcommands/handlers/project.d.ts.map +0 -1
- package/dist/subcommands/handlers/projects.d.ts.map +0 -1
- package/dist/subcommands/handlers/providers-models.d.ts.map +0 -1
- package/dist/subcommands/handlers/quick.d.ts.map +0 -1
- package/dist/subcommands/handlers/replay.d.ts.map +0 -1
- package/dist/subcommands/handlers/rewind.d.ts.map +0 -1
- package/dist/subcommands/handlers/sessions-config.d.ts.map +0 -1
- package/dist/subcommands/handlers/sessions-fleet.d.ts.map +0 -1
- package/dist/subcommands/handlers/tools-skills.d.ts.map +0 -1
- package/dist/subcommands/handlers/update.d.ts.map +0 -1
- package/dist/subcommands/handlers/version-help.d.ts.map +0 -1
- package/dist/subcommands/index.d.ts.map +0 -1
- package/dist/theme.d.ts.map +0 -1
- package/dist/tools-skills-UNKLOB7M.js.map +0 -7
- package/dist/tui-thinking-word.d.ts.map +0 -1
- package/dist/tuneup.d.ts.map +0 -1
- package/dist/update-YC4TYW2Y.js.map +0 -7
- package/dist/update-check-UMYTOH7Z.js.map +0 -7
- package/dist/update-check.d.ts.map +0 -1
- package/dist/utils/delay-format.d.ts.map +0 -1
- package/dist/utils/hq-ttl.d.ts.map +0 -1
- package/dist/utils/win32-cmd.d.ts.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/dist/version-help-DROHZRW6.js.map +0 -7
- package/dist/version.d.ts.map +0 -1
- package/dist/webui-server/client-registration.d.ts.map +0 -1
- package/dist/webui-server/connection-handler.d.ts.map +0 -1
- package/dist/webui-server/context-breakdown.d.ts.map +0 -1
- package/dist/webui-server/contracts.d.ts.map +0 -1
- package/dist/webui-server/cost-helpers.d.ts.map +0 -1
- package/dist/webui-server/kanban-host-adapter.d.ts.map +0 -1
- package/dist/webui-server/kanban-run-mirror.d.ts.map +0 -1
- package/dist/webui-server/kanban-supervisor.d.ts.map +0 -1
- package/dist/webui-server/lifecycle.d.ts.map +0 -1
- package/dist/webui-server/listen-helpers.d.ts.map +0 -1
- package/dist/webui-server/logger-shim.d.ts.map +0 -1
- package/dist/webui-server/node-pty-loader.d.ts.map +0 -1
- package/dist/webui-server/prefs-seeding.d.ts.map +0 -1
- package/dist/webui-server/privileged-actions.d.ts.map +0 -1
- package/dist/webui-server/provider-config.d.ts.map +0 -1
- package/dist/webui-server/session-start-payload.d.ts.map +0 -1
- package/dist/webui-server/setup-events.d.ts.map +0 -1
- package/dist/webui-server/static-serve.d.ts.map +0 -1
- package/dist/webui-server/stream-coalescer.d.ts.map +0 -1
- package/dist/webui-server/terminal-log-view.d.ts.map +0 -1
- package/dist/webui-server-ZF5KVGC5.js.map +0 -7
- package/dist/webui-server-options.d.ts.map +0 -1
- package/dist/webui-server.d.ts.map +0 -1
- package/dist/wiring/brain-and-orchestration.d.ts.map +0 -1
- package/dist/wiring/codebase-index.d.ts.map +0 -1
- package/dist/wiring/command-host-adapters.d.ts.map +0 -1
- package/dist/wiring/command-host-state.d.ts.map +0 -1
- package/dist/wiring/controllers.d.ts.map +0 -1
- package/dist/wiring/dep-watcher-bridge.d.ts.map +0 -1
- package/dist/wiring/dep-watcher.d.ts.map +0 -1
- package/dist/wiring/design-studio.d.ts.map +0 -1
- package/dist/wiring/director-setup.d.ts.map +0 -1
- package/dist/wiring/eternal-command-handlers.d.ts.map +0 -1
- package/dist/wiring/fleet-command-handlers.d.ts.map +0 -1
- package/dist/wiring/hq-telemetry.d.ts.map +0 -1
- package/dist/wiring/lifecycle-plugins.d.ts.map +0 -1
- package/dist/wiring/mailbox-bridge-bootstrap.d.ts.map +0 -1
- package/dist/wiring/management-tools.d.ts.map +0 -1
- package/dist/wiring/metrics.d.ts.map +0 -1
- package/dist/wiring/pipeline.d.ts.map +0 -1
- package/dist/wiring/plugins.d.ts.map +0 -1
- package/dist/wiring/provider-runtime-setup.d.ts.map +0 -1
- package/dist/wiring/provider-runtime.d.ts.map +0 -1
- package/dist/wiring/provider-status.d.ts.map +0 -1
- package/dist/wiring/provider-utility-tools.d.ts.map +0 -1
- package/dist/wiring/provider.d.ts.map +0 -1
- package/dist/wiring/replay.d.ts.map +0 -1
- package/dist/wiring/runtime-controller-deps.d.ts.map +0 -1
- package/dist/wiring/runtime-dispatch-state.d.ts.map +0 -1
- package/dist/wiring/runtime-lifecycle-deps.d.ts.map +0 -1
- package/dist/wiring/runtime-picker-deps.d.ts.map +0 -1
- package/dist/wiring/sage.d.ts.map +0 -1
- package/dist/wiring/sdd-handlers.d.ts.map +0 -1
- package/dist/wiring/security-command.d.ts.map +0 -1
- package/dist/wiring/session-command-handlers.d.ts.map +0 -1
- package/dist/wiring/session-registry.d.ts.map +0 -1
- package/dist/wiring/session.d.ts.map +0 -1
- package/dist/wiring/slash-commands.d.ts.map +0 -1
- package/dist/wiring/to-execute-deps.d.ts.map +0 -1
- package/dist/wiring/tools.d.ts.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReviewerAttempt } from './chimera-reviewer-policy.js';
|
|
1
2
|
import type { ExecuteDeps } from './execute-deps.js';
|
|
2
3
|
type Director = NonNullable<ExecuteDeps['fleet']['director']>;
|
|
3
4
|
type Events = ExecuteDeps['core']['events'];
|
|
@@ -9,7 +10,12 @@ export type InstallChimeraCascadeHandlerOptions = {
|
|
|
9
10
|
session: Session;
|
|
10
11
|
getPendingWork: () => PendingChimeraWork;
|
|
11
12
|
setPendingWork: (work: PendingChimeraWork) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Model ladder for cascade spawns. Supplied by the caller because only it
|
|
15
|
+
* holds the live config. Omit to keep the single unpinned spawn.
|
|
16
|
+
*/
|
|
17
|
+
buildLadder?: (() => ReviewerAttempt[]) | undefined;
|
|
12
18
|
};
|
|
13
|
-
export declare function installChimeraCascadeHandler({ events, director, session, getPendingWork, setPendingWork, }: InstallChimeraCascadeHandlerOptions): void;
|
|
19
|
+
export declare function installChimeraCascadeHandler({ events, director, session, getPendingWork, setPendingWork, buildLadder, }: InstallChimeraCascadeHandlerOptions): void;
|
|
14
20
|
export {};
|
|
15
21
|
//# sourceMappingURL=execution-chimera-cascade.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ChimeraReviewCompletePayload } from '@wrongstack/core/plugin';
|
|
2
|
+
import type { ExecuteDeps } from './execute-deps.js';
|
|
3
|
+
type Director = NonNullable<ExecuteDeps['fleet']['director']>;
|
|
4
|
+
type Events = ExecuteDeps['core']['events'];
|
|
5
|
+
type Session = ExecuteDeps['session']['session'];
|
|
6
|
+
type Mailbox = ExecuteDeps['session']['mailbox'];
|
|
7
|
+
type Agent = ExecuteDeps['core']['agent'];
|
|
8
|
+
type Config = ExecuteDeps['core']['config'];
|
|
9
|
+
type PendingChimeraWork = Promise<void> | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Canonicalize a file path for citation gating. The reviewer can cite
|
|
12
|
+
* absolute Windows paths (`D:\Codebox\...`) or mix casing on a
|
|
13
|
+
* case-insensitive filesystem; without this normalization, every citation
|
|
14
|
+
* counts as "out of scope" and the auto-fix eligibility guard silently
|
|
15
|
+
* suppresses the fix while the mailbox directive still claims findings.
|
|
16
|
+
*
|
|
17
|
+
* Exported for unit testing — the citation-gating pipeline is otherwise
|
|
18
|
+
* locked inside an event-handler closure and is not reachable from a
|
|
19
|
+
* direct test.
|
|
20
|
+
*/
|
|
21
|
+
export declare function normalizeFileKeyForCitation(raw: string, cwd: string): string;
|
|
22
|
+
export type InstallChimeraReviewHandlerOptions = {
|
|
23
|
+
events: Events;
|
|
24
|
+
director: Director | null | undefined;
|
|
25
|
+
session: Session;
|
|
26
|
+
mailbox: Mailbox;
|
|
27
|
+
agent: Agent;
|
|
28
|
+
config: Config;
|
|
29
|
+
projectDir: string;
|
|
30
|
+
persistReview?: ((payload: ChimeraReviewCompletePayload, projectDir: string) => Promise<void>) | undefined;
|
|
31
|
+
setPendingWork: (work: PendingChimeraWork) => void;
|
|
32
|
+
};
|
|
33
|
+
export declare function installChimeraReviewHandler({ events, director, session, mailbox, agent, config, projectDir, persistReview, setPendingWork, }: InstallChimeraReviewHandlerOptions): void;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=execution-chimera-review.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FallbackProfileManager } from '@wrongstack/core/agent';
|
|
1
|
+
import type { AgentPipelines, FallbackProfileManager } from '@wrongstack/core/agent';
|
|
2
2
|
import type { BrainArbiter, ProviderModelStatusTracker } from '@wrongstack/core/coordination';
|
|
3
3
|
import type { Container, EventBus } from '@wrongstack/core/kernel';
|
|
4
4
|
import type { ProviderRegistry, ToolRegistry } from '@wrongstack/core/registry';
|
|
@@ -27,6 +27,11 @@ export interface MultiAgentDeps {
|
|
|
27
27
|
renderer?: Renderer | undefined;
|
|
28
28
|
/** Shared live fallback profile manager from the runtime container. */
|
|
29
29
|
fallbackProfileManager: FallbackProfileManager;
|
|
30
|
+
/**
|
|
31
|
+
* Optional trusted control-plane hook installed on every in-process
|
|
32
|
+
* subagent pipeline. This is host wiring, never a model-visible capability.
|
|
33
|
+
*/
|
|
34
|
+
installToolBoundary?: ((pipelines: AgentPipelines) => void) | undefined;
|
|
30
35
|
}
|
|
31
36
|
/**
|
|
32
37
|
* Per-session options for the multi-agent host. Director Mode is always
|
package/dist/goal-host.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export interface GoalHostDeps {
|
|
|
41
41
|
events: EventBus;
|
|
42
42
|
/** Current parent session id for worktree lifecycle events. */
|
|
43
43
|
getSessionId?: (() => string | undefined) | undefined;
|
|
44
|
-
/** Directory for per-project phase-graph
|
|
44
|
+
/** Directory for per-project phase-graph engine checkpoints. */
|
|
45
45
|
storeDir: string;
|
|
46
46
|
/** Project root — base for git-worktree isolation. */
|
|
47
47
|
projectRoot: string;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import "./chunk-7OCVIDC7.js";
|
|
2
|
+
|
|
3
|
+
// src/subcommands/handlers/governance.ts
|
|
4
|
+
var DEFAULT_DEPENDENCIES = {
|
|
5
|
+
readStatus: async (projectRoot) => {
|
|
6
|
+
const runtime = await import("@wrongstack/runtime/governance-bootstrap");
|
|
7
|
+
return runtime.readGovernanceDaemonOperatorStatus(projectRoot);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
function usage() {
|
|
11
|
+
return "Usage:\n wstack governance status [--json]\n\nReads the project daemon through its local read-only status capability.\nWarnings are advisory and do not stop active tasks or model execution.\n";
|
|
12
|
+
}
|
|
13
|
+
function jsonRequested(args, deps) {
|
|
14
|
+
return args.includes("--json") || deps.flags?.["json"] === true;
|
|
15
|
+
}
|
|
16
|
+
async function runGovernanceStatusCommand(args, deps, dependencies = DEFAULT_DEPENDENCIES) {
|
|
17
|
+
const json = jsonRequested(args, deps);
|
|
18
|
+
const result = await dependencies.readStatus(deps.projectRoot);
|
|
19
|
+
if (json) {
|
|
20
|
+
deps.renderer.write(`${JSON.stringify(result, null, 2)}
|
|
21
|
+
`);
|
|
22
|
+
return result.available ? 0 : 1;
|
|
23
|
+
}
|
|
24
|
+
if (!result.available) {
|
|
25
|
+
deps.renderer.writeError(`Governance status unavailable (${result.code}): ${result.message}
|
|
26
|
+
`);
|
|
27
|
+
return 1;
|
|
28
|
+
}
|
|
29
|
+
const { status } = result;
|
|
30
|
+
const broker = status.attachmentBroker;
|
|
31
|
+
const lines = [
|
|
32
|
+
`Governance daemon: running (pid ${status.pid}, instance ${status.instanceId})`,
|
|
33
|
+
`Attachment broker: ${broker?.health ?? "unavailable"}`,
|
|
34
|
+
`Operator signal: ${status.signal.level} (${status.signal.code})`,
|
|
35
|
+
`Operator action: ${status.signal.operatorAction}`,
|
|
36
|
+
"Execution: continue (advisory only; no automatic task or model stop)"
|
|
37
|
+
];
|
|
38
|
+
if (broker) {
|
|
39
|
+
lines.push(`Consecutive failures: ${broker.consecutiveFailures}`);
|
|
40
|
+
lines.push(`Pending revocations: ${broker.pendingRevocations}`);
|
|
41
|
+
lines.push(`Audit persistence: ${broker.auditHealthy ? "healthy" : "unhealthy"}`);
|
|
42
|
+
}
|
|
43
|
+
deps.renderer.write(`${lines.join("\n")}
|
|
44
|
+
`);
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
var governanceCmd = async (args, deps) => {
|
|
48
|
+
const subcommand = args[0];
|
|
49
|
+
if (!subcommand || subcommand === "status") {
|
|
50
|
+
return runGovernanceStatusCommand(subcommand ? args.slice(1) : args, deps);
|
|
51
|
+
}
|
|
52
|
+
if (subcommand === "help" || subcommand === "--help" || subcommand === "-h") {
|
|
53
|
+
deps.renderer.write(usage());
|
|
54
|
+
return 0;
|
|
55
|
+
}
|
|
56
|
+
deps.renderer.writeError(`Unknown governance subcommand: ${subcommand}
|
|
57
|
+
`);
|
|
58
|
+
deps.renderer.write(usage());
|
|
59
|
+
return 1;
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
governanceCmd,
|
|
63
|
+
runGovernanceStatusCommand
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=governance-V2Z42RBE.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HqGovernanceSnapshotPayload, HqPublisher } from '@wrongstack/core/hq';
|
|
2
|
+
import { type GovernanceDaemonOperatorStatusReadResult } from '@wrongstack/runtime/governance-bootstrap';
|
|
3
|
+
export declare const GOVERNANCE_HQ_SNAPSHOT_INTERVAL_MS = 15000;
|
|
4
|
+
export interface GovernanceHqTelemetryOptions {
|
|
5
|
+
readonly publisher: Pick<HqPublisher, 'project' | 'publishEvent'>;
|
|
6
|
+
readonly projectRoot: string;
|
|
7
|
+
readonly intervalMs?: number;
|
|
8
|
+
readonly now?: () => string;
|
|
9
|
+
readonly readStatus?: (projectRoot: string) => Promise<GovernanceDaemonOperatorStatusReadResult>;
|
|
10
|
+
}
|
|
11
|
+
export declare function projectGovernanceHqSnapshot(projectId: string, observedAt: string, result: GovernanceDaemonOperatorStatusReadResult): HqGovernanceSnapshotPayload;
|
|
12
|
+
/**
|
|
13
|
+
* Publish a compact project-owner governance observation to HQ. Failures are
|
|
14
|
+
* represented as advisory snapshots and never stop task or model execution.
|
|
15
|
+
*/
|
|
16
|
+
export declare function startGovernanceHqTelemetry(options: GovernanceHqTelemetryOptions): () => void;
|
|
17
|
+
//# sourceMappingURL=governance-hq-telemetry.d.ts.map
|
|
@@ -36,7 +36,7 @@ var hqCmd = async (args, deps) => {
|
|
|
36
36
|
return 1;
|
|
37
37
|
};
|
|
38
38
|
async function startServer(deps) {
|
|
39
|
-
const { startHqServer } = await import("./hq-server-
|
|
39
|
+
const { startHqServer } = await import("./hq-server-6TSAORAC.js");
|
|
40
40
|
const dataDir = resolveDataDir(deps);
|
|
41
41
|
const flags = deps.flags ?? {};
|
|
42
42
|
const host = typeof flags["host"] === "string" ? flags["host"] : HQ_CLI_DEFAULT_HOST;
|
|
@@ -544,4 +544,4 @@ export {
|
|
|
544
544
|
hqCmd,
|
|
545
545
|
resolveAuditActor
|
|
546
546
|
};
|
|
547
|
-
//# sourceMappingURL=hq-
|
|
547
|
+
//# sourceMappingURL=hq-WO6CLUSI.js.map
|
package/dist/hq-publisher.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { CreateHqPublisherOptions } from '@wrongstack/core/hq';
|
|
2
|
-
import type
|
|
1
|
+
import type { CreateHqPublisherOptions, HqPublisher } from '@wrongstack/core/hq';
|
|
2
|
+
import { type KanbanHqSyncStats } from './kanban-hq-sync.js';
|
|
3
3
|
type CliHqPublisherOptions = Omit<CreateHqPublisherOptions, 'socketFactory'> & {
|
|
4
4
|
socketFactory?: CreateHqPublisherOptions['socketFactory'];
|
|
5
5
|
};
|
|
6
6
|
export interface CliHqConnection {
|
|
7
7
|
getPublisher(): HqPublisher | undefined;
|
|
8
|
+
getKanbanSyncStats(): KanbanHqSyncStats | undefined;
|
|
8
9
|
stop(): void;
|
|
9
10
|
}
|
|
10
11
|
export interface CliHqConnectionOptions extends CliHqPublisherOptions {
|
package/dist/hq-server/auth.d.ts
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
* @module hq-server/auth
|
|
5
5
|
*/
|
|
6
6
|
import type * as http from 'node:http';
|
|
7
|
-
import type { HqSessionEntry } from './types.js';
|
|
7
|
+
import type { HqRouterMutableAuth, HqSessionEntry } from './types.js';
|
|
8
8
|
export declare const HQ_SESSION_COOKIE = "hq.session";
|
|
9
9
|
export declare const HQ_SESSION_MAX_AGE_MS: number;
|
|
10
|
+
/** Idle timeout: sessions unused for this long are rejected and evicted. */
|
|
11
|
+
export declare const HQ_SESSION_IDLE_TIMEOUT_MS: number;
|
|
10
12
|
export interface HqBrowserAuthContext {
|
|
11
13
|
kind: 'token';
|
|
12
14
|
token: string;
|
|
@@ -28,9 +30,15 @@ export type HqBrowserAuthResult = HqBrowserAuthContext | HqCookieAuthContext | u
|
|
|
28
30
|
/**
|
|
29
31
|
* The only featureful frontend is the packaged, same-origin React SPA.
|
|
30
32
|
* The missing-assets recovery document contains inline CSS but no script.
|
|
33
|
+
*
|
|
34
|
+
* WS-061: `script-src` carried `'unsafe-inline'` despite that sentence above
|
|
35
|
+
* already stating nothing here needs it — verified against the built HTML,
|
|
36
|
+
* which has zero inline `<script>` elements without `src`. `style-src` keeps
|
|
37
|
+
* `'unsafe-inline'` because the recovery document's inline CSS is real, and
|
|
38
|
+
* inline style is not script execution.
|
|
31
39
|
*/
|
|
32
40
|
export declare function setHqSecurityHeaders(res: http.ServerResponse): void;
|
|
33
|
-
export declare function hasTrustedBrowserOrigin(req: http.IncomingMessage, boundHost?: string, boundPort?: number, trustedPublicOrigins?: ReadonlySet<string
|
|
41
|
+
export declare function hasTrustedBrowserOrigin(req: http.IncomingMessage, boundHost?: string, boundPort?: number, trustedPublicOrigins?: ReadonlySet<string>, allowFileOrigin?: boolean): boolean;
|
|
34
42
|
export declare function serializeHqSessionCookie(sessionId: string, secret: string): string;
|
|
35
43
|
export declare function parseHqSessionCookie(value: string, secret: string): string | undefined;
|
|
36
44
|
export declare function parseCookieHeader(cookieHeader: string | undefined): Record<string, string>;
|
|
@@ -38,6 +46,28 @@ export declare function setHqSessionCookie(res: http.ServerResponse, value: stri
|
|
|
38
46
|
export declare function clearHqSessionCookie(res: http.ServerResponse, secure?: boolean): void;
|
|
39
47
|
export declare function isTokenAuth(auth: HqBrowserAuthResult): auth is HqBrowserAuthContext;
|
|
40
48
|
export declare function isCookieAuth(auth: HqBrowserAuthResult): auth is HqCookieAuthContext;
|
|
49
|
+
/**
|
|
50
|
+
* Single source of truth for "must this HQ surface see a credential?".
|
|
51
|
+
*
|
|
52
|
+
* WS-010 introduced `requireAuthFloor` so that revoking the last credential on
|
|
53
|
+
* a running, network-reachable `wstack hq` could not silently drop it into open
|
|
54
|
+
* mode. That latch was then honoured at only three of the seven decision
|
|
55
|
+
* points. The four that open-coded their own `browserTokens.size > 0 ||
|
|
56
|
+
* passwordHash` test stayed open: the main `/api/*` gate, the mailbox gateway,
|
|
57
|
+
* the WebSocket upgrade, and `callerCanEnqueue` — which backs `/api/mailbox-send`,
|
|
58
|
+
* i.e. message injection into live agents.
|
|
59
|
+
*
|
|
60
|
+
* Any new gate MUST call this rather than re-deriving the condition; the bug
|
|
61
|
+
* was not a wrong condition but seven independent copies of it (WS-077).
|
|
62
|
+
*/
|
|
63
|
+
export declare function hqAuthRequired(mutableAuth: HqRouterMutableAuth, requireBrowserAuth?: boolean | undefined): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* The `/ws/client` counterpart. Fleet clients authenticate with `clientTokens`,
|
|
66
|
+
* which are a separate set from the browser tokens, but the same fail-closed
|
|
67
|
+
* floor applies: an all-expired client-token file must not mean "no auth
|
|
68
|
+
* configured, let anyone register as a session".
|
|
69
|
+
*/
|
|
70
|
+
export declare function hqClientAuthRequired(mutableAuth: HqRouterMutableAuth): boolean;
|
|
41
71
|
/**
|
|
42
72
|
* Constant-time membership test for a token set. Returns the matching stored
|
|
43
73
|
* token (so callers can look up its metadata) or undefined. Iterates and
|
|
@@ -51,6 +81,7 @@ export declare function authenticateBrowserRequest(req: http.IncomingMessage, ur
|
|
|
51
81
|
browserTokenObjs: Map<string, {
|
|
52
82
|
id: string;
|
|
53
83
|
capabilities?: string[];
|
|
84
|
+
expiresAt?: string;
|
|
54
85
|
}>;
|
|
55
86
|
passwordHash?: string | undefined;
|
|
56
87
|
cookieSecret?: string | undefined;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persistent login attempt tracker with debounced disk write-through.
|
|
3
|
+
*
|
|
4
|
+
* Replaces the in-memory `Map<string, { count, blockedUntil, lastAttempt }>`
|
|
5
|
+
* that reset on every server restart. Now an attacker who crashes or waits
|
|
6
|
+
* out the server cannot reset their lockout counter — the state survives
|
|
7
|
+
* across restarts.
|
|
8
|
+
*
|
|
9
|
+
* Storage: `~/.wrongstack/hq/login-attempts.json` (owner-only, 0o600 + icacls).
|
|
10
|
+
* The file is pruned on load (entries older than the retention window are
|
|
11
|
+
* dropped) and written back with a 500ms debounce so a burst of failed
|
|
12
|
+
* logins doesn't hammer the disk.
|
|
13
|
+
*
|
|
14
|
+
* @module hq-server/login-attempt-store
|
|
15
|
+
*/
|
|
16
|
+
export interface LoginAttemptEntry {
|
|
17
|
+
count: number;
|
|
18
|
+
blockedUntil: number;
|
|
19
|
+
lastAttempt: number;
|
|
20
|
+
}
|
|
21
|
+
export declare class LoginAttemptStore {
|
|
22
|
+
private store;
|
|
23
|
+
private writeTimer;
|
|
24
|
+
private dirty;
|
|
25
|
+
private readonly filePath;
|
|
26
|
+
private readonly debounceMs;
|
|
27
|
+
private readonly retentionMs;
|
|
28
|
+
constructor(dataDir: string, opts?: {
|
|
29
|
+
debounceMs?: number;
|
|
30
|
+
retentionMs?: number;
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* Load persisted state from disk and prune stale entries.
|
|
34
|
+
* Safe to call once at startup; subsequent calls reload from disk.
|
|
35
|
+
*/
|
|
36
|
+
load(): Promise<void>;
|
|
37
|
+
get(key: string): LoginAttemptEntry | undefined;
|
|
38
|
+
set(key: string, entry: LoginAttemptEntry): void;
|
|
39
|
+
delete(key: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Compound rate-limit key for public-relay mode: IP + SHA-256(password).
|
|
42
|
+
* Limits how often the SAME password can be tried from different IPs,
|
|
43
|
+
* so a rotating-IP attacker can't bypass per-IP backoff.
|
|
44
|
+
*/
|
|
45
|
+
static credentialKey(ip: string, password: string): string;
|
|
46
|
+
/**
|
|
47
|
+
* Check both IP and credential keys; return the stricter (later blockedUntil).
|
|
48
|
+
*/
|
|
49
|
+
checkBlocked(ip: string, password: string): {
|
|
50
|
+
blocked: boolean;
|
|
51
|
+
retryAfter: number;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Record a failed attempt on both IP and credential keys.
|
|
55
|
+
* Returns the updated IP entry (for the response Retry-After header).
|
|
56
|
+
*/
|
|
57
|
+
recordFailure(ip: string, password: string, maxBackoffMs?: number): LoginAttemptEntry;
|
|
58
|
+
/**
|
|
59
|
+
* Clear both IP and credential entries on successful login.
|
|
60
|
+
*/
|
|
61
|
+
clearOnSuccess(ip: string, password: string): void;
|
|
62
|
+
/** Number of tracked entries (for diagnostics). */
|
|
63
|
+
get size(): number;
|
|
64
|
+
/**
|
|
65
|
+
* Flush pending writes immediately. Called on server shutdown.
|
|
66
|
+
*/
|
|
67
|
+
flush(): Promise<void>;
|
|
68
|
+
private scheduleWrite;
|
|
69
|
+
private writeToDisk;
|
|
70
|
+
/** Iterate entries (for cleanup timers). */
|
|
71
|
+
entries(): IterableIterator<[string, LoginAttemptEntry]>;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=login-attempt-store.d.ts.map
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import type * as http from 'node:http';
|
|
2
2
|
import { type HqAlertRuleConfig, type HqRedactionPolicy, type HqToken } from '@wrongstack/core/hq';
|
|
3
|
+
import type { LoginAttemptStore } from '../login-attempt-store.js';
|
|
3
4
|
import type { HqRouterMutableAuth, HqSessionEntry } from '../types.js';
|
|
4
5
|
export declare function handleApiAuthStatus(req: http.IncomingMessage, res: http.ServerResponse, url: URL, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, requireBrowserAuth: boolean | undefined, trustedPublicOrigins: Set<string>, secureCookies: boolean | undefined): Promise<void>;
|
|
5
|
-
export declare function handleApiLogin(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, loginAttempts:
|
|
6
|
-
count: number;
|
|
7
|
-
blockedUntil: number;
|
|
8
|
-
lastAttempt: number;
|
|
9
|
-
}>, secureCookies: boolean | undefined): Promise<void>;
|
|
6
|
+
export declare function handleApiLogin(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, loginAttempts: LoginAttemptStore, secureCookies: boolean | undefined): Promise<void>;
|
|
10
7
|
export declare function handleApiLogout(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, secureCookies: boolean | undefined): Promise<void>;
|
|
11
8
|
export declare function handleApiPassword(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, dataDir: string, secureCookies: boolean | undefined, requireBrowserAuth: boolean | undefined): Promise<void>;
|
|
12
9
|
export declare function applyAuthFile(mutableAuth: HqRouterMutableAuth, next: {
|
|
@@ -14,12 +11,83 @@ export declare function applyAuthFile(mutableAuth: HqRouterMutableAuth, next: {
|
|
|
14
11
|
token: string;
|
|
15
12
|
id: string;
|
|
16
13
|
capabilities?: string[];
|
|
14
|
+
expiresAt?: string;
|
|
17
15
|
}>;
|
|
18
16
|
clientTokens?: Array<HqToken>;
|
|
19
17
|
redactionPolicy?: Partial<HqRedactionPolicy>;
|
|
20
18
|
passwordHash?: string;
|
|
21
19
|
cookieSecret?: string;
|
|
22
20
|
alertRules?: HqAlertRuleConfig;
|
|
21
|
+
totpSecret?: string;
|
|
22
|
+
totpPendingSecret?: string;
|
|
23
|
+
totpRecoveryCodes?: string[];
|
|
23
24
|
}): void;
|
|
24
25
|
export declare function handleApiBootstrap(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, secureCookies: boolean | undefined, bootstrapStore: import('@wrongstack/core/hq').HqBootstrapCodeStore): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* WS-065 — exchange a live browser token for an HttpOnly session cookie.
|
|
28
|
+
*
|
|
29
|
+
* The bootstrap flow above already gives fresh startup URLs a cookie and never
|
|
30
|
+
* persists a client-side credential. What it does not cover is the *legacy*
|
|
31
|
+
* paths: an older `?token=` startup URL, and manual token entry in the token
|
|
32
|
+
* gate. Both leave the raw token in `sessionStorage`, where any script on the
|
|
33
|
+
* origin can read it. This endpoint lets the SPA complete that migration on
|
|
34
|
+
* its own — authenticate once with the token it already holds, receive a
|
|
35
|
+
* cookie, and delete the stored copy.
|
|
36
|
+
*
|
|
37
|
+
* The minted session is exactly the one `handleApiBootstrap` mints: `kind:
|
|
38
|
+
* 'token'` carrying the source token's id. That matters because
|
|
39
|
+
* `authenticateBrowserRequest` re-resolves a token-origin session's
|
|
40
|
+
* capabilities from the LIVE token record on every request, so upgrading
|
|
41
|
+
* grants nothing the token did not already grant and dies the moment the token
|
|
42
|
+
* is revoked. No privilege boundary is crossed: the caller proved possession
|
|
43
|
+
* of the token, and the cookie is strictly weaker (HttpOnly, same-origin,
|
|
44
|
+
* server-expiring).
|
|
45
|
+
*/
|
|
46
|
+
export declare function handleApiTokenUpgrade(req: http.IncomingMessage, res: http.ServerResponse, url: URL, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, secureCookies: boolean | undefined): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* POST `/api/login/verify` — complete 2FA for a pending-2FA session.
|
|
49
|
+
* Accepts either a TOTP `code` or a `recoveryCode`. On success, the pending
|
|
50
|
+
* session is upgraded to a full session (pending2fa cleared). Recovery codes
|
|
51
|
+
* are single-use: the matched hash is removed from `auth.json` on success.
|
|
52
|
+
*/
|
|
53
|
+
export declare function handleApiLoginVerify(req: http.IncomingMessage, res: http.ServerResponse, _url: URL, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, loginAttempts: LoginAttemptStore, dataDir: string, secureCookies: boolean | undefined): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* POST `/api/auth/totp/setup` — generate a new TOTP secret (not yet active).
|
|
56
|
+
* Returns the base32 secret + otpauth URI for QR display. The secret is
|
|
57
|
+
* persisted as `totpPendingSecret` — login does NOT check this field, so
|
|
58
|
+
* an unconfirmed setup cannot lock the operator out. 2FA becomes active
|
|
59
|
+
* only after `/api/auth/totp/enable` verifies a code.
|
|
60
|
+
*
|
|
61
|
+
* Requires existing auth (cookie or token) — only the operator can set up 2FA.
|
|
62
|
+
*/
|
|
63
|
+
export declare function handleApiTotpSetup(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, dataDir: string): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* POST `/api/auth/totp/enable` — confirm 2FA enrollment by providing a valid
|
|
66
|
+
* TOTP code. Promotes `totpPendingSecret` → `totpSecret` (active), generates
|
|
67
|
+
* and returns recovery codes (shown once). After this, 2FA is required for
|
|
68
|
+
* password login.
|
|
69
|
+
*/
|
|
70
|
+
export declare function handleApiTotpEnable(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, dataDir: string): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* POST `/api/auth/totp/disable` — remove TOTP 2FA entirely. Requires the
|
|
73
|
+
* current password (or a valid TOTP code) as confirmation.
|
|
74
|
+
*/
|
|
75
|
+
export declare function handleApiTotpDisable(req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>, loginAttempts: LoginAttemptStore, dataDir: string): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* GET `/api/auth/sessions` — list all active browser sessions for the
|
|
78
|
+
* session-management UI. Returns each session's kind, creation time,
|
|
79
|
+
* last-seen time, and a truncated ID (never the full session ID — that
|
|
80
|
+
* would allow cookie forgery since the session ID IS the cookie value).
|
|
81
|
+
*/
|
|
82
|
+
export declare function handleApiAuthSessions(_req: http.IncomingMessage, res: http.ServerResponse, mutableAuth: HqRouterMutableAuth, sessions: Map<string, HqSessionEntry>): void;
|
|
83
|
+
/**
|
|
84
|
+
* DELETE `/api/auth/sessions/:id` — revoke a single session by ID.
|
|
85
|
+
* DELETE `/api/auth/sessions` — revoke ALL sessions (force logout everyone).
|
|
86
|
+
*/
|
|
87
|
+
export declare function handleApiAuthSessionsRevoke(_req: http.IncomingMessage, res: http.ServerResponse, url: URL, sessions: Map<string, HqSessionEntry>): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* GET `/api/auth/audit` — recent auth events for the audit panel.
|
|
90
|
+
* Returns the last 50 entries from auth-audit.jsonl, newest first.
|
|
91
|
+
*/
|
|
92
|
+
export declare function handleApiAuthAudit(_req: http.IncomingMessage, res: http.ServerResponse, dataDir: string): void;
|
|
25
93
|
//# sourceMappingURL=auth-handlers.d.ts.map
|
|
@@ -21,6 +21,7 @@ export declare const hasTrustedBrowserOrigin: typeof HqServerAuth.hasTrustedBrow
|
|
|
21
21
|
export declare const authenticateBrowserRequest: typeof HqServerAuth.authenticateBrowserRequest;
|
|
22
22
|
export declare const isTokenAuth: typeof HqServerAuth.isTokenAuth;
|
|
23
23
|
export declare const isCookieAuth: typeof HqServerAuth.isCookieAuth;
|
|
24
|
+
export declare const hqAuthRequired: typeof HqServerAuth.hqAuthRequired;
|
|
24
25
|
export declare const setHqSessionCookie: typeof HqServerAuth.setHqSessionCookie;
|
|
25
26
|
export declare const clearHqSessionCookie: typeof HqServerAuth.clearHqSessionCookie;
|
|
26
27
|
export declare const serializeHqSessionCookie: typeof HqServerAuth.serializeHqSessionCookie;
|
|
@@ -40,6 +41,7 @@ export declare const readLocalSubagentTranscript: typeof HqServerUtils.readLocal
|
|
|
40
41
|
export declare const lanIPv4Addresses: typeof HqServerUtils.lanIPv4Addresses;
|
|
41
42
|
export declare const hqRuntimeMarkerPath: typeof HqServerUtils.hqRuntimeMarkerPath;
|
|
42
43
|
import type { ConnectedClient, HqRouterMutableAuth, HqSessionEntry, HqSnapshotBroadcaster, ProjectDetail, TranscriptRing } from './types.js';
|
|
44
|
+
import type { LoginAttemptStore } from './login-attempt-store.js';
|
|
43
45
|
export type { ConnectedClient, HqSnapshotBroadcaster, ProjectDetail, TranscriptRing, };
|
|
44
46
|
export interface HqRouterMailboxGateway {
|
|
45
47
|
mailbox: Mailbox;
|
|
@@ -50,13 +52,11 @@ export interface HqRouterDeps {
|
|
|
50
52
|
host: string;
|
|
51
53
|
listeningPort: number;
|
|
52
54
|
trustedPublicOrigins: Set<string>;
|
|
55
|
+
/** Trust `Origin: file://`. Off by default — see StartHqServerOptions (WS-081). */
|
|
56
|
+
allowFileOrigin?: boolean | undefined;
|
|
53
57
|
mutableAuth: HqRouterMutableAuth;
|
|
54
58
|
sessions: Map<string, HqSessionEntry>;
|
|
55
|
-
loginAttempts:
|
|
56
|
-
count: number;
|
|
57
|
-
blockedUntil: number;
|
|
58
|
-
lastAttempt: number;
|
|
59
|
-
}>;
|
|
59
|
+
loginAttempts: LoginAttemptStore;
|
|
60
60
|
clients: Map<WebSocket, ConnectedClient>;
|
|
61
61
|
browsers: Set<WebSocket>;
|
|
62
62
|
eventLog: HqEventEnvelope[];
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module hq-server/types
|
|
5
5
|
*/
|
|
6
|
-
import type { HqAlertRuleConfig, HqBrowserMessage, HqClientCapability, HqClientRecord, HqEventEnvelope, HqFleetSnapshotPayload, HqMailboxSnapshotPayload, HqMcpServerHealth, HqPersistence, HqProjectIdentity, HqProjectRecord, HqQueuedCommand, HqRedactionPolicy, HqSessionSnapshotPayload, HqToken, HqTranscriptEntry } from '@wrongstack/core/hq';
|
|
6
|
+
import type { HqAlertRuleConfig, HqBrowserMessage, HqClientCapability, HqClientRecord, HqEventEnvelope, HqFleetSnapshotPayload, HqGovernanceSnapshotPayload, HqMailboxSnapshotPayload, HqMcpServerHealth, HqPersistence, HqProjectIdentity, HqProjectRecord, HqQueuedCommand, HqRedactionPolicy, HqSessionSnapshotPayload, HqToken, HqTranscriptEntry } from '@wrongstack/core/hq';
|
|
7
7
|
import type { WebSocket } from 'ws';
|
|
8
|
-
export type { HqBrowserMessage, HqClientCapability, HqClientRecord, HqEventEnvelope, HqFleetSnapshotPayload, HqMailboxSnapshotPayload, HqMcpServerHealth, HqPersistence, HqProjectIdentity, HqProjectRecord, HqQueuedCommand, HqRedactionPolicy, HqSessionSnapshotPayload, HqToken, HqTranscriptEntry, };
|
|
8
|
+
export type { HqBrowserMessage, HqClientCapability, HqClientRecord, HqEventEnvelope, HqFleetSnapshotPayload, HqGovernanceSnapshotPayload, HqMailboxSnapshotPayload, HqMcpServerHealth, HqPersistence, HqProjectIdentity, HqProjectRecord, HqQueuedCommand, HqRedactionPolicy, HqSessionSnapshotPayload, HqToken, HqTranscriptEntry, };
|
|
9
9
|
export interface TrackedSessionSnapshot {
|
|
10
10
|
payload: HqSessionSnapshotPayload;
|
|
11
11
|
/** Epoch ms of the last `session.snapshot` refresh — freshness authority for the cleanup timer. */
|
|
@@ -48,8 +48,21 @@ export interface ConnectedClient {
|
|
|
48
48
|
servers: HqMcpServerHealth[];
|
|
49
49
|
receivedAt: number;
|
|
50
50
|
}>;
|
|
51
|
+
/** Latest read-only governance advisory accepted from this project's leader. */
|
|
52
|
+
governanceSnapshot?: {
|
|
53
|
+
payload: HqGovernanceSnapshotPayload;
|
|
54
|
+
receivedAt: number;
|
|
55
|
+
};
|
|
51
56
|
/** Pending outbound commands (Phase 3 — control plane). */
|
|
52
57
|
commandQueue: HqQueuedCommand[];
|
|
58
|
+
/**
|
|
59
|
+
* Whether this client is the project's leader (the client with
|
|
60
|
+
* `control.receive` capability that other clients coordinate with).
|
|
61
|
+
* Live tracking lives in `HqServer`; this field is the snapshot.
|
|
62
|
+
* Used by the leader-deposed detector in `peer.rehydrate` emission.
|
|
63
|
+
* Defaults to `false` for clients without `control.receive`.
|
|
64
|
+
*/
|
|
65
|
+
isLeader: boolean;
|
|
53
66
|
}
|
|
54
67
|
export interface HqRouterMutableAuth {
|
|
55
68
|
operatorPolicy: HqRedactionPolicy;
|
|
@@ -59,11 +72,27 @@ export interface HqRouterMutableAuth {
|
|
|
59
72
|
browserTokenObjs: Map<string, {
|
|
60
73
|
id: string;
|
|
61
74
|
capabilities?: string[];
|
|
75
|
+
expiresAt?: string;
|
|
62
76
|
}>;
|
|
63
77
|
clientTokenObjs: Map<string, HqToken>;
|
|
64
78
|
passwordHash?: string | undefined;
|
|
65
79
|
cookieSecret?: string | undefined;
|
|
80
|
+
/** Base32-encoded TOTP secret for HQ 2FA (live-reloaded from auth.json). */
|
|
81
|
+
totpSecret?: string | undefined;
|
|
82
|
+
/** Pending TOTP secret (setup but not yet confirmed by enable). */
|
|
83
|
+
totpPendingSecret?: string | undefined;
|
|
84
|
+
/** SHA-256 hashes of single-use recovery codes (live-reloaded from auth.json). */
|
|
85
|
+
totpRecoveryCodes?: string[] | undefined;
|
|
66
86
|
alertRules: HqAlertRuleConfig | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* WS-010: set when the live bind would become unauthenticated and
|
|
89
|
+
* network-reachable. `assessHqExposure` runs at startup only, so revoking the
|
|
90
|
+
* last credential on a running `wstack hq` (default bind 0.0.0.0) silently
|
|
91
|
+
* dropped it into open mode — the kill switch acted as an unlock. When this
|
|
92
|
+
* is true, routes keep demanding auth even though no credential remains, so
|
|
93
|
+
* the surface fails closed instead of opening up.
|
|
94
|
+
*/
|
|
95
|
+
requireAuthFloor?: boolean | undefined;
|
|
67
96
|
}
|
|
68
97
|
/**
|
|
69
98
|
* Session record stored in the server-side `sessions` Map.
|
|
@@ -80,6 +109,19 @@ export interface HqSessionEntry {
|
|
|
80
109
|
readonly tokenId?: string | undefined;
|
|
81
110
|
/** For token sessions: capabilities inherited from the source token. */
|
|
82
111
|
readonly capabilities?: string[] | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* Set when a password login passed but 2FA verification is still pending.
|
|
114
|
+
* The session is valid but must NOT be treated as fully authenticated —
|
|
115
|
+
* only `/api/login/verify` may consume it. Other routes should reject it.
|
|
116
|
+
* Short-lived: `PENDING_2FA_TTL_MS` bounds it (5 min).
|
|
117
|
+
*/
|
|
118
|
+
readonly pending2fa?: boolean | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* Last time this session was used (epoch ms). Bumped on every authenticated
|
|
121
|
+
* request to implement idle-timeout (sliding expiration). Sessions idle for
|
|
122
|
+
* longer than `HQ_SESSION_IDLE_TIMEOUT_MS` are rejected and evicted.
|
|
123
|
+
*/
|
|
124
|
+
lastSeenAt: number;
|
|
83
125
|
}
|
|
84
126
|
export interface TranscriptRing {
|
|
85
127
|
entries: HqTranscriptEntry[];
|
|
@@ -35,8 +35,51 @@ export declare function agentMessageToEntry(p: Record<string, unknown>): HqTrans
|
|
|
35
35
|
* or the file is absent (caller falls back to the ring).
|
|
36
36
|
*/
|
|
37
37
|
export declare function readLocalSubagentTranscript(sessionId: string, subagentId: string): Promise<HqTranscriptEntry[] | null>;
|
|
38
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Percent-decode ONE URL path segment and reject anything that is not a safe
|
|
40
|
+
* single path component.
|
|
41
|
+
*
|
|
42
|
+
* WS-019: this used to be `decodeURIComponent` and nothing else, and its
|
|
43
|
+
* output is joined straight onto a filesystem path in
|
|
44
|
+
* {@link readLocalSubagentTranscript}. `%2e%2e%2f` decodes to `../`, so a
|
|
45
|
+
* request could walk out of the session's transcript directory and read any
|
|
46
|
+
* `transcript.jsonl` on the machine — other projects' sessions included.
|
|
47
|
+
* Percent-decoding is the step that CREATES the traversal, so validating
|
|
48
|
+
* before decoding would have checked the wrong string.
|
|
49
|
+
*
|
|
50
|
+
* The rule is a whole path component or nothing: no separators, no `.`/`..`,
|
|
51
|
+
* no NUL, no drive-letter colon, non-empty, and length-bounded. Real ids are
|
|
52
|
+
* generated tokens, so nothing legitimate is excluded.
|
|
53
|
+
*/
|
|
39
54
|
export declare function decodePathSegment(value: string): string | null;
|
|
55
|
+
/**
|
|
56
|
+
* Percent-decode a session id that may contain a date-shard separator.
|
|
57
|
+
*
|
|
58
|
+
* Session ids are `YYYY-MM-DD/sess_<ULID>` (see `generateSessionId`), so a
|
|
59
|
+
* literal `/` is legitimate. This decoder allows that one shape while still
|
|
60
|
+
* blocking traversal (`..`, backslash, NUL, drive-relative forms). The
|
|
61
|
+
* resolved-path containment check in {@link readLocalSubagentTranscript}
|
|
62
|
+
* is the second lock.
|
|
63
|
+
*/
|
|
64
|
+
export declare function decodeSessionId(value: string): string | null;
|
|
65
|
+
/**
|
|
66
|
+
* True when `value` is usable as exactly one filesystem path component.
|
|
67
|
+
*
|
|
68
|
+
* Exported so the traversal rule has one definition — a second copy is how a
|
|
69
|
+
* guard and its callers drift apart, which is the shape of several findings in
|
|
70
|
+
* this audit.
|
|
71
|
+
*/
|
|
72
|
+
export declare function isSafePathSegment(value: string): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Session IDs are `YYYY-MM-DD/sess_<ULID>` — one forward slash is the
|
|
75
|
+
* date-shard separator. Legacy flat ids (no slash) remain readable too
|
|
76
|
+
* (`generateSessionId` in core/storage/session-id.ts), so accept one OR two
|
|
77
|
+
* components while blocking everything that {@link isSafePathSegment} blocks:
|
|
78
|
+
* no backslash, NUL, or drive-relative colon; no `.`/`..`; no empty component;
|
|
79
|
+
* no deeper nesting (three or more components). The resolved-path containment
|
|
80
|
+
* check in `sessionScopedPath` (core/utils) is the second lock.
|
|
81
|
+
*/
|
|
82
|
+
export declare function isSafeSessionId(value: string): boolean;
|
|
40
83
|
/** Normalize display host — "0.0.0.0" prints as "127.0.0.1" for user-facing URLs. */
|
|
41
84
|
export declare function displayHost(host: string): string;
|
|
42
85
|
/** Read the full body of an HTTP request as a UTF-8 string (capped at 1 MB). */
|
|
@@ -69,10 +112,12 @@ export declare function hqMachineKey(hostname: string | undefined, machineId: st
|
|
|
69
112
|
*/
|
|
70
113
|
export declare function recordTimeseriesSignal(persistence: HqPersistence, event: HqEventEnvelope): void;
|
|
71
114
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
115
|
+
* Re-exported from `@wrongstack/core/security`.
|
|
116
|
+
*
|
|
117
|
+
* WS-066: this used to be an HQ-local implementation, which is why the WebUI
|
|
118
|
+
* and SimpleUI servers — which have the same JSON-API surface — never adopted
|
|
119
|
+
* it and forwarded `String(err)` verbatim instead. One implementation now
|
|
120
|
+
* serves every server surface.
|
|
76
121
|
*/
|
|
77
|
-
export
|
|
122
|
+
export { sanitizeApiError, scrubErrorDetail } from '@wrongstack/core/security';
|
|
78
123
|
//# sourceMappingURL=utils.d.ts.map
|