@wrongstack/cli 0.284.0 → 0.285.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/README.md +4 -4
- package/data/providers.json +5 -3
- package/dist/acp-registry-cache.d.ts +33 -0
- package/dist/acp-registry-cache.d.ts.map +1 -0
- package/dist/acp-server-agent.d.ts +66 -0
- package/dist/acp-server-agent.d.ts.map +1 -0
- package/dist/arg-parser.d.ts +41 -0
- package/dist/arg-parser.d.ts.map +1 -0
- package/dist/auth-menu/add-provider.d.ts +15 -0
- package/dist/auth-menu/add-provider.d.ts.map +1 -0
- package/dist/auth-menu/anthropic-oauth.d.ts +43 -0
- package/dist/auth-menu/anthropic-oauth.d.ts.map +1 -0
- package/dist/auth-menu/auth-menu-audit.d.ts +175 -0
- package/dist/auth-menu/auth-menu-audit.d.ts.map +1 -0
- package/dist/auth-menu/direct.d.ts +15 -0
- package/dist/auth-menu/direct.d.ts.map +1 -0
- package/dist/auth-menu/github-copilot-oauth.d.ts +73 -0
- package/dist/auth-menu/github-copilot-oauth.d.ts.map +1 -0
- package/dist/auth-menu/helpers.d.ts +7 -0
- package/dist/auth-menu/helpers.d.ts.map +1 -0
- package/dist/auth-menu/index.d.ts +8 -0
- package/dist/auth-menu/index.d.ts.map +1 -0
- package/dist/auth-menu/local-presets.d.ts +36 -0
- package/dist/auth-menu/local-presets.d.ts.map +1 -0
- package/dist/auth-menu/local.d.ts +138 -0
- package/dist/auth-menu/local.d.ts.map +1 -0
- package/dist/auth-menu/oauth-menu.d.ts +10 -0
- package/dist/auth-menu/oauth-menu.d.ts.map +1 -0
- package/dist/auth-menu/openai-codex-oauth.d.ts +167 -0
- package/dist/auth-menu/openai-codex-oauth.d.ts.map +1 -0
- package/dist/auth-menu/panel-service.d.ts +32 -0
- package/dist/auth-menu/panel-service.d.ts.map +1 -0
- package/dist/auth-menu/provider-menu.d.ts +7 -0
- package/dist/auth-menu/provider-menu.d.ts.map +1 -0
- package/dist/auth-menu/shared.d.ts +32 -0
- package/dist/auth-menu/shared.d.ts.map +1 -0
- package/dist/auth-menu/top-menu.d.ts +11 -0
- package/dist/auth-menu/top-menu.d.ts.map +1 -0
- package/dist/auth-menu/types.d.ts +42 -0
- package/dist/auth-menu/types.d.ts.map +1 -0
- package/dist/auth-menu.d.ts +7 -0
- package/dist/auth-menu.d.ts.map +1 -0
- package/dist/autophase-host.d.ts +103 -0
- package/dist/autophase-host.d.ts.map +1 -0
- package/dist/boot/auto-discover-providers.d.ts +20 -0
- package/dist/boot/auto-discover-providers.d.ts.map +1 -0
- package/dist/boot/brain-decision-log.d.ts +38 -0
- package/dist/boot/brain-decision-log.d.ts.map +1 -0
- package/dist/boot/container-wiring.d.ts +34 -0
- package/dist/boot/container-wiring.d.ts.map +1 -0
- package/dist/boot/dispatch-singleshot.d.ts +35 -0
- package/dist/boot/dispatch-singleshot.d.ts.map +1 -0
- package/dist/boot/dispatch-webui.d.ts +82 -0
- package/dist/boot/dispatch-webui.d.ts.map +1 -0
- package/dist/boot/event-wiring.d.ts +22 -0
- package/dist/boot/event-wiring.d.ts.map +1 -0
- package/dist/boot/short-circuit-desktop.d.ts +3 -0
- package/dist/boot/short-circuit-desktop.d.ts.map +1 -0
- package/dist/boot/short-circuit-flags.d.ts +9 -0
- package/dist/boot/short-circuit-flags.d.ts.map +1 -0
- package/dist/boot/short-circuit-hq.d.ts +16 -0
- package/dist/boot/short-circuit-hq.d.ts.map +1 -0
- package/dist/boot/system-prompt-builder.d.ts +91 -0
- package/dist/boot/system-prompt-builder.d.ts.map +1 -0
- package/dist/boot/system-prompt.d.ts +66 -0
- package/dist/boot/system-prompt.d.ts.map +1 -0
- package/dist/boot/tool-registry.d.ts +42 -0
- package/dist/boot/tool-registry.d.ts.map +1 -0
- package/dist/boot/tui-autophase-wiring.d.ts +23 -0
- package/dist/boot/tui-autophase-wiring.d.ts.map +1 -0
- package/dist/boot/tui-coordinator-setup.d.ts +38 -0
- package/dist/boot/tui-coordinator-setup.d.ts.map +1 -0
- package/dist/boot/tui-debug-stream.d.ts +18 -0
- package/dist/boot/tui-debug-stream.d.ts.map +1 -0
- package/dist/boot/tui-live-sessions.d.ts +39 -0
- package/dist/boot/tui-live-sessions.d.ts.map +1 -0
- package/dist/boot/tui-project-picker-callback.d.ts +30 -0
- package/dist/boot/tui-project-picker-callback.d.ts.map +1 -0
- package/dist/boot/tui-project-spawn.d.ts +19 -0
- package/dist/boot/tui-project-spawn.d.ts.map +1 -0
- package/dist/boot/tui-project-switch.d.ts +26 -0
- package/dist/boot/tui-project-switch.d.ts.map +1 -0
- package/dist/boot/tui-runtime-state.d.ts +83 -0
- package/dist/boot/tui-runtime-state.d.ts.map +1 -0
- package/dist/boot/tui-sdd-callback.d.ts +20 -0
- package/dist/boot/tui-sdd-callback.d.ts.map +1 -0
- package/dist/boot/tui-session-resume.d.ts +21 -0
- package/dist/boot/tui-session-resume.d.ts.map +1 -0
- package/dist/boot/tui-settings-adapter.d.ts +23 -0
- package/dist/boot/tui-settings-adapter.d.ts.map +1 -0
- package/dist/boot-config.d.ts +26 -0
- package/dist/boot-config.d.ts.map +1 -0
- package/dist/boot.d.ts +30 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/cli-bundled-prompts.d.ts +12 -0
- package/dist/cli-bundled-prompts.d.ts.map +1 -0
- package/dist/cli-bundled-skills.d.ts +13 -0
- package/dist/cli-bundled-skills.d.ts.map +1 -0
- package/dist/cli-context.d.ts +30 -0
- package/dist/cli-context.d.ts.map +1 -0
- package/dist/cli-entry-point.d.ts +2 -0
- package/dist/cli-entry-point.d.ts.map +1 -0
- package/dist/cli-eternal-flag.d.ts +66 -0
- package/dist/cli-eternal-flag.d.ts.map +1 -0
- package/dist/cli-main.d.ts +13 -0
- package/dist/cli-main.d.ts.map +1 -0
- package/dist/cli-recovery-prompt.d.ts +19 -0
- package/dist/cli-recovery-prompt.d.ts.map +1 -0
- package/dist/cli-update-notice.d.ts +3 -0
- package/dist/cli-update-notice.d.ts.map +1 -0
- package/dist/config-doctor.d.ts +39 -0
- package/dist/config-doctor.d.ts.map +1 -0
- package/dist/config-history.d.ts +54 -0
- package/dist/config-history.d.ts.map +1 -0
- package/dist/context-limit.d.ts +51 -0
- package/dist/context-limit.d.ts.map +1 -0
- package/dist/context-overflow-diagnostic.d.ts +3 -0
- package/dist/context-overflow-diagnostic.d.ts.map +1 -0
- package/dist/diff-renderer.d.ts +2 -0
- package/dist/diff-renderer.d.ts.map +1 -0
- package/dist/execute-deps.d.ts +239 -0
- package/dist/execute-deps.d.ts.map +1 -0
- package/dist/execution.d.ts +99 -0
- package/dist/execution.d.ts.map +1 -0
- package/dist/first-run-auth-gate.d.ts +18 -0
- package/dist/first-run-auth-gate.d.ts.map +1 -0
- package/dist/fleet/host.d.ts +533 -0
- package/dist/fleet/host.d.ts.map +1 -0
- package/dist/fleet/routing.d.ts +8 -0
- package/dist/fleet/routing.d.ts.map +1 -0
- package/dist/fleet/status-broadcast.d.ts +42 -0
- package/dist/fleet/status-broadcast.d.ts.map +1 -0
- package/dist/fleet/supervisor-registry.d.ts +16 -0
- package/dist/fleet/supervisor-registry.d.ts.map +1 -0
- package/dist/fleet-statusline.d.ts +71 -0
- package/dist/fleet-statusline.d.ts.map +1 -0
- package/dist/hooks-wiring.d.ts +26 -0
- package/dist/hooks-wiring.d.ts.map +1 -0
- package/dist/hq-command-controller.d.ts +52 -0
- package/dist/hq-command-controller.d.ts.map +1 -0
- package/dist/hq-dashboard-html.d.ts +2 -0
- package/dist/hq-dashboard-html.d.ts.map +1 -0
- package/dist/hq-publisher.d.ts +16 -0
- package/dist/hq-publisher.d.ts.map +1 -0
- package/dist/hq-server.d.ts +56 -0
- package/dist/hq-server.d.ts.map +1 -0
- package/dist/hq-static-serve.d.ts +26 -0
- package/dist/hq-static-serve.d.ts.map +1 -0
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6025 -3952
- package/dist/index.js.map +7 -1
- package/dist/input-reader.d.ts +45 -0
- package/dist/input-reader.d.ts.map +1 -0
- package/dist/launch-hints.d.ts +46 -0
- package/dist/launch-hints.d.ts.map +1 -0
- package/dist/mailbox-bridge-bootstrap.d.ts +85 -0
- package/dist/mailbox-bridge-bootstrap.d.ts.map +1 -0
- package/dist/mcp-serve.d.ts +23 -0
- package/dist/mcp-serve.d.ts.map +1 -0
- package/dist/multi-agent.d.ts +4 -0
- package/dist/multi-agent.d.ts.map +1 -0
- package/dist/next-task-predictor.d.ts +45 -0
- package/dist/next-task-predictor.d.ts.map +1 -0
- package/dist/permission-prompt.d.ts +11 -0
- package/dist/permission-prompt.d.ts.map +1 -0
- package/dist/picker.d.ts +86 -0
- package/dist/picker.d.ts.map +1 -0
- package/dist/plugin-api-factory.d.ts +3 -0
- package/dist/plugin-api-factory.d.ts.map +1 -0
- package/dist/plugin-management.d.ts +43 -0
- package/dist/plugin-management.d.ts.map +1 -0
- package/dist/pre-launch/indexing-question.d.ts +28 -0
- package/dist/pre-launch/indexing-question.d.ts.map +1 -0
- package/dist/pre-launch/launch-prompts.d.ts +52 -0
- package/dist/pre-launch/launch-prompts.d.ts.map +1 -0
- package/dist/pre-launch/project-check.d.ts +25 -0
- package/dist/pre-launch/project-check.d.ts.map +1 -0
- package/dist/pre-launch.d.ts +4 -0
- package/dist/pre-launch.d.ts.map +1 -0
- package/dist/preflight.d.ts +58 -0
- package/dist/preflight.d.ts.map +1 -0
- package/dist/project-picker.d.ts +56 -0
- package/dist/project-picker.d.ts.map +1 -0
- package/dist/provider-config-utils.d.ts +58 -0
- package/dist/provider-config-utils.d.ts.map +1 -0
- package/dist/provider-helpers.d.ts +53 -0
- package/dist/provider-helpers.d.ts.map +1 -0
- package/dist/renderer.d.ts +76 -0
- package/dist/renderer.d.ts.map +1 -0
- package/dist/repl.d.ts +162 -0
- package/dist/repl.d.ts.map +1 -0
- package/dist/services/project-facts.d.ts +17 -0
- package/dist/services/project-facts.d.ts.map +1 -0
- package/dist/session-event-wiring.d.ts +48 -0
- package/dist/session-event-wiring.d.ts.map +1 -0
- package/dist/session-stats.d.ts +38 -0
- package/dist/session-stats.d.ts.map +1 -0
- package/dist/settings-menu.d.ts +87 -0
- package/dist/settings-menu.d.ts.map +1 -0
- package/dist/shutdown-cleanup.d.ts +44 -0
- package/dist/shutdown-cleanup.d.ts.map +1 -0
- package/dist/slash-commands/acp.d.ts +23 -0
- package/dist/slash-commands/acp.d.ts.map +1 -0
- package/dist/slash-commands/agents.d.ts +16 -0
- package/dist/slash-commands/agents.d.ts.map +1 -0
- package/dist/slash-commands/audit.d.ts +11 -0
- package/dist/slash-commands/audit.d.ts.map +1 -0
- package/dist/slash-commands/auth.d.ts +20 -0
- package/dist/slash-commands/auth.d.ts.map +1 -0
- package/dist/slash-commands/autonomy.d.ts +5 -0
- package/dist/slash-commands/autonomy.d.ts.map +1 -0
- package/dist/slash-commands/autophase.d.ts +13 -0
- package/dist/slash-commands/autophase.d.ts.map +1 -0
- package/dist/slash-commands/brain.d.ts +4 -0
- package/dist/slash-commands/brain.d.ts.map +1 -0
- package/dist/slash-commands/btw.d.ts +13 -0
- package/dist/slash-commands/btw.d.ts.map +1 -0
- package/dist/slash-commands/clear.d.ts +4 -0
- package/dist/slash-commands/clear.d.ts.map +1 -0
- package/dist/slash-commands/codebase-reindex.d.ts +11 -0
- package/dist/slash-commands/codebase-reindex.d.ts.map +1 -0
- package/dist/slash-commands/collab.d.ts +26 -0
- package/dist/slash-commands/collab.d.ts.map +1 -0
- package/dist/slash-commands/commit-llm.d.ts +41 -0
- package/dist/slash-commands/commit-llm.d.ts.map +1 -0
- package/dist/slash-commands/compact.d.ts +4 -0
- package/dist/slash-commands/compact.d.ts.map +1 -0
- package/dist/slash-commands/context.d.ts +4 -0
- package/dist/slash-commands/context.d.ts.map +1 -0
- package/dist/slash-commands/coordinator.d.ts +4 -0
- package/dist/slash-commands/coordinator.d.ts.map +1 -0
- package/dist/slash-commands/delegate.d.ts +17 -0
- package/dist/slash-commands/delegate.d.ts.map +1 -0
- package/dist/slash-commands/design.d.ts +16 -0
- package/dist/slash-commands/design.d.ts.map +1 -0
- package/dist/slash-commands/dev.d.ts +9 -0
- package/dist/slash-commands/dev.d.ts.map +1 -0
- package/dist/slash-commands/diag-stats.d.ts +5 -0
- package/dist/slash-commands/diag-stats.d.ts.map +1 -0
- package/dist/slash-commands/dispatch-llm.d.ts +12 -0
- package/dist/slash-commands/dispatch-llm.d.ts.map +1 -0
- package/dist/slash-commands/doctor.d.ts +13 -0
- package/dist/slash-commands/doctor.d.ts.map +1 -0
- package/dist/slash-commands/enhance.d.ts +13 -0
- package/dist/slash-commands/enhance.d.ts.map +1 -0
- package/dist/slash-commands/ensemble.d.ts +17 -0
- package/dist/slash-commands/ensemble.d.ts.map +1 -0
- package/dist/slash-commands/f-keys.d.ts +18 -0
- package/dist/slash-commands/f-keys.d.ts.map +1 -0
- package/dist/slash-commands/fallback.d.ts +20 -0
- package/dist/slash-commands/fallback.d.ts.map +1 -0
- package/dist/slash-commands/fix-classifier.d.ts +28 -0
- package/dist/slash-commands/fix-classifier.d.ts.map +1 -0
- package/dist/slash-commands/fix.d.ts +4 -0
- package/dist/slash-commands/fix.d.ts.map +1 -0
- package/dist/slash-commands/fleet.d.ts +20 -0
- package/dist/slash-commands/fleet.d.ts.map +1 -0
- package/dist/slash-commands/gitid.d.ts +22 -0
- package/dist/slash-commands/gitid.d.ts.map +1 -0
- package/dist/slash-commands/goal-refiner.d.ts +22 -0
- package/dist/slash-commands/goal-refiner.d.ts.map +1 -0
- package/dist/slash-commands/goal.d.ts +4 -0
- package/dist/slash-commands/goal.d.ts.map +1 -0
- package/dist/slash-commands/help.d.ts +4 -0
- package/dist/slash-commands/help.d.ts.map +1 -0
- package/dist/slash-commands/helpers.d.ts +33 -0
- package/dist/slash-commands/helpers.d.ts.map +1 -0
- package/dist/slash-commands/hq.d.ts +4 -0
- package/dist/slash-commands/hq.d.ts.map +1 -0
- package/dist/slash-commands/index.d.ts +524 -0
- package/dist/slash-commands/index.d.ts.map +1 -0
- package/dist/slash-commands/init.d.ts +4 -0
- package/dist/slash-commands/init.d.ts.map +1 -0
- package/dist/slash-commands/interrupt.d.ts +15 -0
- package/dist/slash-commands/interrupt.d.ts.map +1 -0
- package/dist/slash-commands/kanban.d.ts +4 -0
- package/dist/slash-commands/kanban.d.ts.map +1 -0
- package/dist/slash-commands/mailbox-demo.d.ts +19 -0
- package/dist/slash-commands/mailbox-demo.d.ts.map +1 -0
- package/dist/slash-commands/mailbox-serve.d.ts +20 -0
- package/dist/slash-commands/mailbox-serve.d.ts.map +1 -0
- package/dist/slash-commands/mailbox.d.ts +28 -0
- package/dist/slash-commands/mailbox.d.ts.map +1 -0
- package/dist/slash-commands/mcp-utils.d.ts +24 -0
- package/dist/slash-commands/mcp-utils.d.ts.map +1 -0
- package/dist/slash-commands/mcp.d.ts +19 -0
- package/dist/slash-commands/mcp.d.ts.map +1 -0
- package/dist/slash-commands/memory.d.ts +4 -0
- package/dist/slash-commands/memory.d.ts.map +1 -0
- package/dist/slash-commands/mode.d.ts +6 -0
- package/dist/slash-commands/mode.d.ts.map +1 -0
- package/dist/slash-commands/modelcaps.d.ts +4 -0
- package/dist/slash-commands/modelcaps.d.ts.map +1 -0
- package/dist/slash-commands/models.d.ts +23 -0
- package/dist/slash-commands/models.d.ts.map +1 -0
- package/dist/slash-commands/mouse.d.ts +14 -0
- package/dist/slash-commands/mouse.d.ts.map +1 -0
- package/dist/slash-commands/next.d.ts +21 -0
- package/dist/slash-commands/next.d.ts.map +1 -0
- package/dist/slash-commands/plugin.d.ts +4 -0
- package/dist/slash-commands/plugin.d.ts.map +1 -0
- package/dist/slash-commands/project-utils.d.ts +51 -0
- package/dist/slash-commands/project-utils.d.ts.map +1 -0
- package/dist/slash-commands/project.d.ts +4 -0
- package/dist/slash-commands/project.d.ts.map +1 -0
- package/dist/slash-commands/prune.d.ts +4 -0
- package/dist/slash-commands/prune.d.ts.map +1 -0
- package/dist/slash-commands/review.d.ts +4 -0
- package/dist/slash-commands/review.d.ts.map +1 -0
- package/dist/slash-commands/sdd/project-context.d.ts +7 -0
- package/dist/slash-commands/sdd/project-context.d.ts.map +1 -0
- package/dist/slash-commands/sdd/rendering.d.ts +2 -0
- package/dist/slash-commands/sdd/rendering.d.ts.map +1 -0
- package/dist/slash-commands/sdd/spec-detection.d.ts +21 -0
- package/dist/slash-commands/sdd/spec-detection.d.ts.map +1 -0
- package/dist/slash-commands/sdd/state.d.ts +40 -0
- package/dist/slash-commands/sdd/state.d.ts.map +1 -0
- package/dist/slash-commands/sdd/task-manager.d.ts +37 -0
- package/dist/slash-commands/sdd/task-manager.d.ts.map +1 -0
- package/dist/slash-commands/sdd.d.ts +15 -0
- package/dist/slash-commands/sdd.d.ts.map +1 -0
- package/dist/slash-commands/security.d.ts +4 -0
- package/dist/slash-commands/security.d.ts.map +1 -0
- package/dist/slash-commands/session.d.ts +7 -0
- package/dist/slash-commands/session.d.ts.map +1 -0
- package/dist/slash-commands/setmodel.d.ts +20 -0
- package/dist/slash-commands/setmodel.d.ts.map +1 -0
- package/dist/slash-commands/settings.d.ts +12 -0
- package/dist/slash-commands/settings.d.ts.map +1 -0
- package/dist/slash-commands/shadow.d.ts +28 -0
- package/dist/slash-commands/shadow.d.ts.map +1 -0
- package/dist/slash-commands/slash-deep-help.d.ts +51 -0
- package/dist/slash-commands/slash-deep-help.d.ts.map +1 -0
- package/dist/slash-commands/spawn-agents.d.ts +6 -0
- package/dist/slash-commands/spawn-agents.d.ts.map +1 -0
- package/dist/slash-commands/statusline.d.ts +67 -0
- package/dist/slash-commands/statusline.d.ts.map +1 -0
- package/dist/slash-commands/suggest.d.ts +4 -0
- package/dist/slash-commands/suggest.d.ts.map +1 -0
- package/dist/slash-commands/suggestion-store.d.ts +29 -0
- package/dist/slash-commands/suggestion-store.d.ts.map +1 -0
- package/dist/slash-commands/supervisor.d.ts +18 -0
- package/dist/slash-commands/supervisor.d.ts.map +1 -0
- package/dist/slash-commands/surfaces.d.ts +4 -0
- package/dist/slash-commands/surfaces.d.ts.map +1 -0
- package/dist/slash-commands/tasks.d.ts +4 -0
- package/dist/slash-commands/tasks.d.ts.map +1 -0
- package/dist/slash-commands/techstack.d.ts +4 -0
- package/dist/slash-commands/techstack.d.ts.map +1 -0
- package/dist/slash-commands/telegram-settings.d.ts +4 -0
- package/dist/slash-commands/telegram-settings.d.ts.map +1 -0
- package/dist/slash-commands/telegram-setup.d.ts +11 -0
- package/dist/slash-commands/telegram-setup.d.ts.map +1 -0
- package/dist/slash-commands/todos.d.ts +4 -0
- package/dist/slash-commands/todos.d.ts.map +1 -0
- package/dist/slash-commands/tool.d.ts +4 -0
- package/dist/slash-commands/tool.d.ts.map +1 -0
- package/dist/slash-commands/tools.d.ts +4 -0
- package/dist/slash-commands/tools.d.ts.map +1 -0
- package/dist/slash-commands/tuneup.d.ts +15 -0
- package/dist/slash-commands/tuneup.d.ts.map +1 -0
- package/dist/slash-commands/working-dir.d.ts +14 -0
- package/dist/slash-commands/working-dir.d.ts.map +1 -0
- package/dist/slash-commands/worktree.d.ts +8 -0
- package/dist/slash-commands/worktree.d.ts.map +1 -0
- package/dist/slash-commands/yolo.d.ts +4 -0
- package/dist/slash-commands/yolo.d.ts.map +1 -0
- package/dist/spinner.d.ts +44 -0
- package/dist/spinner.d.ts.map +1 -0
- package/dist/subcommands/handlers/acp.d.ts +15 -0
- package/dist/subcommands/handlers/acp.d.ts.map +1 -0
- package/dist/subcommands/handlers/audit.d.ts +12 -0
- package/dist/subcommands/handlers/audit.d.ts.map +1 -0
- package/dist/subcommands/handlers/auth-local-help.d.ts +69 -0
- package/dist/subcommands/handlers/auth-local-help.d.ts.map +1 -0
- package/dist/subcommands/handlers/auth.d.ts +3 -0
- package/dist/subcommands/handlers/auth.d.ts.map +1 -0
- package/dist/subcommands/handlers/bench-run-help.d.ts +145 -0
- package/dist/subcommands/handlers/bench-run-help.d.ts.map +1 -0
- package/dist/subcommands/handlers/bench.d.ts +13 -0
- package/dist/subcommands/handlers/bench.d.ts.map +1 -0
- package/dist/subcommands/handlers/config-history.d.ts +10 -0
- package/dist/subcommands/handlers/config-history.d.ts.map +1 -0
- package/dist/subcommands/handlers/diag-doctor.d.ts +4 -0
- package/dist/subcommands/handlers/diag-doctor.d.ts.map +1 -0
- package/dist/subcommands/handlers/export.d.ts +3 -0
- package/dist/subcommands/handlers/export.d.ts.map +1 -0
- package/dist/subcommands/handlers/helpers.d.ts +2 -0
- package/dist/subcommands/handlers/helpers.d.ts.map +1 -0
- package/dist/subcommands/handlers/hq.d.ts +3 -0
- package/dist/subcommands/handlers/hq.d.ts.map +1 -0
- package/dist/subcommands/handlers/init.d.ts +7 -0
- package/dist/subcommands/handlers/init.d.ts.map +1 -0
- package/dist/subcommands/handlers/mailbox-serve.d.ts +3 -0
- package/dist/subcommands/handlers/mailbox-serve.d.ts.map +1 -0
- package/dist/subcommands/handlers/mcp.d.ts +3 -0
- package/dist/subcommands/handlers/mcp.d.ts.map +1 -0
- package/dist/subcommands/handlers/modeldiag.d.ts +3 -0
- package/dist/subcommands/handlers/modeldiag.d.ts.map +1 -0
- package/dist/subcommands/handlers/models-add-help.d.ts +142 -0
- package/dist/subcommands/handlers/models-add-help.d.ts.map +1 -0
- package/dist/subcommands/handlers/per-subcommand-help.d.ts +136 -0
- package/dist/subcommands/handlers/per-subcommand-help.d.ts.map +1 -0
- package/dist/subcommands/handlers/plugin-usage.d.ts +4 -0
- package/dist/subcommands/handlers/plugin-usage.d.ts.map +1 -0
- package/dist/subcommands/handlers/projects.d.ts +3 -0
- package/dist/subcommands/handlers/projects.d.ts.map +1 -0
- package/dist/subcommands/handlers/providers-models.d.ts +4 -0
- package/dist/subcommands/handlers/providers-models.d.ts.map +1 -0
- package/dist/subcommands/handlers/quick.d.ts +14 -0
- package/dist/subcommands/handlers/quick.d.ts.map +1 -0
- package/dist/subcommands/handlers/replay.d.ts +12 -0
- package/dist/subcommands/handlers/replay.d.ts.map +1 -0
- package/dist/subcommands/handlers/rewind.d.ts +3 -0
- package/dist/subcommands/handlers/rewind.d.ts.map +1 -0
- package/dist/subcommands/handlers/sessions-config.d.ts +4 -0
- package/dist/subcommands/handlers/sessions-config.d.ts.map +1 -0
- package/dist/subcommands/handlers/sessions-fleet.d.ts +15 -0
- package/dist/subcommands/handlers/sessions-fleet.d.ts.map +1 -0
- package/dist/subcommands/handlers/tools-skills.d.ts +4 -0
- package/dist/subcommands/handlers/tools-skills.d.ts.map +1 -0
- package/dist/subcommands/handlers/update.d.ts +7 -0
- package/dist/subcommands/handlers/update.d.ts.map +1 -0
- package/dist/subcommands/handlers/version-help.d.ts +4 -0
- package/dist/subcommands/handlers/version-help.d.ts.map +1 -0
- package/dist/subcommands/index.d.ts +26 -0
- package/dist/subcommands/index.d.ts.map +1 -0
- package/dist/theme.d.ts +12 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/tui-thinking-word.d.ts +5 -0
- package/dist/tui-thinking-word.d.ts.map +1 -0
- package/dist/tuneup.d.ts +162 -0
- package/dist/tuneup.d.ts.map +1 -0
- package/dist/update-check.d.ts +22 -0
- package/dist/update-check.d.ts.map +1 -0
- package/dist/utils/delay-format.d.ts +5 -0
- package/dist/utils/delay-format.d.ts.map +1 -0
- package/dist/utils/win32-cmd.d.ts +7 -0
- package/dist/utils/win32-cmd.d.ts.map +1 -0
- package/dist/utils.d.ts +58 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/version.d.ts +4 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/webui-server/client-registration.d.ts +41 -0
- package/dist/webui-server/client-registration.d.ts.map +1 -0
- package/dist/webui-server/connection-handler.d.ts +59 -0
- package/dist/webui-server/connection-handler.d.ts.map +1 -0
- package/dist/webui-server/context-breakdown.d.ts +57 -0
- package/dist/webui-server/context-breakdown.d.ts.map +1 -0
- package/dist/webui-server/cost-helpers.d.ts +29 -0
- package/dist/webui-server/cost-helpers.d.ts.map +1 -0
- package/dist/webui-server/lifecycle.d.ts +108 -0
- package/dist/webui-server/lifecycle.d.ts.map +1 -0
- package/dist/webui-server/logger-shim.d.ts +10 -0
- package/dist/webui-server/logger-shim.d.ts.map +1 -0
- package/dist/webui-server/message-router.d.ts +39 -0
- package/dist/webui-server/message-router.d.ts.map +1 -0
- package/dist/webui-server/prefs-seeding.d.ts +57 -0
- package/dist/webui-server/prefs-seeding.d.ts.map +1 -0
- package/dist/webui-server/provider-config.d.ts +61 -0
- package/dist/webui-server/provider-config.d.ts.map +1 -0
- package/dist/webui-server/session-start-payload.d.ts +20 -0
- package/dist/webui-server/session-start-payload.d.ts.map +1 -0
- package/dist/webui-server/session-status-poll.d.ts +14 -0
- package/dist/webui-server/session-status-poll.d.ts.map +1 -0
- package/dist/webui-server/setup-events.d.ts +45 -0
- package/dist/webui-server/setup-events.d.ts.map +1 -0
- package/dist/webui-server/static-serve.d.ts +70 -0
- package/dist/webui-server/static-serve.d.ts.map +1 -0
- package/dist/webui-server/stream-coalescer.d.ts +41 -0
- package/dist/webui-server/stream-coalescer.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/agent-config.d.ts +47 -0
- package/dist/webui-server/ws-handlers/agent-config.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/brain.d.ts +36 -0
- package/dist/webui-server/ws-handlers/brain.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/connection.d.ts +50 -0
- package/dist/webui-server/ws-handlers/connection.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/context.d.ts +55 -0
- package/dist/webui-server/ws-handlers/context.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/index.d.ts +60 -0
- package/dist/webui-server/ws-handlers/index.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/introspection.d.ts +35 -0
- package/dist/webui-server/ws-handlers/introspection.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/kanban.d.ts +41 -0
- package/dist/webui-server/ws-handlers/kanban.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/mailbox.d.ts +51 -0
- package/dist/webui-server/ws-handlers/mailbox.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/oauth.d.ts +16 -0
- package/dist/webui-server/ws-handlers/oauth.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/prefs.d.ts +32 -0
- package/dist/webui-server/ws-handlers/prefs.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/process.d.ts +6 -0
- package/dist/webui-server/ws-handlers/process.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/projects.d.ts +44 -0
- package/dist/webui-server/ws-handlers/projects.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/providers.d.ts +36 -0
- package/dist/webui-server/ws-handlers/providers.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/sessions.d.ts +38 -0
- package/dist/webui-server/ws-handlers/sessions.d.ts.map +1 -0
- package/dist/webui-server/ws-handlers/worklist.d.ts +49 -0
- package/dist/webui-server/ws-handlers/worklist.d.ts.map +1 -0
- package/dist/webui-server.d.ts +160 -0
- package/dist/webui-server.d.ts.map +1 -0
- package/dist/wiring/brain-and-orchestration.d.ts +63 -0
- package/dist/wiring/brain-and-orchestration.d.ts.map +1 -0
- package/dist/wiring/codebase-index.d.ts +33 -0
- package/dist/wiring/codebase-index.d.ts.map +1 -0
- package/dist/wiring/controllers.d.ts +46 -0
- package/dist/wiring/controllers.d.ts.map +1 -0
- package/dist/wiring/dep-watcher.d.ts +23 -0
- package/dist/wiring/dep-watcher.d.ts.map +1 -0
- package/dist/wiring/design-studio.d.ts +17 -0
- package/dist/wiring/design-studio.d.ts.map +1 -0
- package/dist/wiring/director-setup.d.ts +51 -0
- package/dist/wiring/director-setup.d.ts.map +1 -0
- package/dist/wiring/hq-telemetry.d.ts +42 -0
- package/dist/wiring/hq-telemetry.d.ts.map +1 -0
- package/dist/wiring/lifecycle-plugins.d.ts +58 -0
- package/dist/wiring/lifecycle-plugins.d.ts.map +1 -0
- package/dist/wiring/mailbox-bridge-bootstrap.d.ts +53 -0
- package/dist/wiring/mailbox-bridge-bootstrap.d.ts.map +1 -0
- package/dist/wiring/metrics.d.ts +21 -0
- package/dist/wiring/metrics.d.ts.map +1 -0
- package/dist/wiring/pipeline.d.ts +96 -0
- package/dist/wiring/pipeline.d.ts.map +1 -0
- package/dist/wiring/plugins.d.ts +108 -0
- package/dist/wiring/plugins.d.ts.map +1 -0
- package/dist/wiring/provider-runtime-setup.d.ts +47 -0
- package/dist/wiring/provider-runtime-setup.d.ts.map +1 -0
- package/dist/wiring/provider-runtime.d.ts +57 -0
- package/dist/wiring/provider-runtime.d.ts.map +1 -0
- package/dist/wiring/provider.d.ts +13 -0
- package/dist/wiring/provider.d.ts.map +1 -0
- package/dist/wiring/replay.d.ts +32 -0
- package/dist/wiring/replay.d.ts.map +1 -0
- package/dist/wiring/session.d.ts +56 -0
- package/dist/wiring/session.d.ts.map +1 -0
- package/dist/wiring/slash-commands.d.ts +74 -0
- package/dist/wiring/slash-commands.d.ts.map +1 -0
- package/dist/wiring/super-memory.d.ts +9 -0
- package/dist/wiring/super-memory.d.ts.map +1 -0
- package/dist/wiring/to-execute-deps.d.ts +11 -0
- package/dist/wiring/to-execute-deps.d.ts.map +1 -0
- package/dist/wiring/tools.d.ts +41 -0
- package/dist/wiring/tools.d.ts.map +1 -0
- package/package.json +20 -20
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { AutoPhaseWebSocketHandler, DesignContext, PromptsContext, SddBoardWebSocketHandler, SddWizardWebSocketHandler, SkillsContext, SpecsWebSocketHandler, TerminalWebSocketHandler, WorktreeWebSocketHandler } from '@wrongstack/webui/server';
|
|
2
|
+
import type { WebSocket } from 'ws';
|
|
3
|
+
import type { CliWebUIOptions, WSClientMessage, WSServerMessage } from '../webui-server.js';
|
|
4
|
+
import type { ConnectedClient } from './connection-handler.js';
|
|
5
|
+
import type { AgentConfigContext, BrainHandlerContext, ConnectionContext, ContextHandlerContext, IntrospectionContext, MailboxContext, PrefsContext, ProjectsContext, SessionsContext, WorklistContext, WsCommon, WsHandlerContext } from './ws-handlers/index.js';
|
|
6
|
+
export interface MessageRouterDeps {
|
|
7
|
+
opts: CliWebUIOptions;
|
|
8
|
+
send: (ws: WebSocket, msg: WSServerMessage) => void;
|
|
9
|
+
sendResult: (ws: WebSocket, success: boolean, message: string) => void;
|
|
10
|
+
sessionPayload: <T extends Record<string, unknown>>(payload: T) => T & {
|
|
11
|
+
sessionId: string;
|
|
12
|
+
};
|
|
13
|
+
currentSessionId: () => string;
|
|
14
|
+
shutdown: () => void;
|
|
15
|
+
wsHandlerCtx: WsHandlerContext;
|
|
16
|
+
brainCtx: BrainHandlerContext;
|
|
17
|
+
introspectionCtx: IntrospectionContext;
|
|
18
|
+
skillsCtx: SkillsContext;
|
|
19
|
+
promptsCtx: PromptsContext;
|
|
20
|
+
designCtx: DesignContext;
|
|
21
|
+
worklistCtx: WorklistContext;
|
|
22
|
+
agentConfigCtx: AgentConfigContext;
|
|
23
|
+
prefsCtx: PrefsContext;
|
|
24
|
+
projectsCtx: ProjectsContext;
|
|
25
|
+
contextHandlerCtx: ContextHandlerContext;
|
|
26
|
+
wsCommon: WsCommon;
|
|
27
|
+
mailboxCtx: MailboxContext;
|
|
28
|
+
sessionsCtx: SessionsContext;
|
|
29
|
+
connectionCtx: ConnectionContext;
|
|
30
|
+
autoPhaseHandler: AutoPhaseWebSocketHandler;
|
|
31
|
+
specsHandler: SpecsWebSocketHandler;
|
|
32
|
+
sddBoardHandler: SddBoardWebSocketHandler;
|
|
33
|
+
sddWizardHandler: SddWizardWebSocketHandler | null;
|
|
34
|
+
worktreeHandler: WorktreeWebSocketHandler;
|
|
35
|
+
terminalHandler: TerminalWebSocketHandler;
|
|
36
|
+
}
|
|
37
|
+
export type MessageRouter = (ws: WebSocket, client: ConnectedClient, msg: WSClientMessage) => Promise<void>;
|
|
38
|
+
export declare function createMessageRouter(deps: MessageRouterDeps): MessageRouter;
|
|
39
|
+
//# sourceMappingURL=message-router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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AAa,CAAC;IACzB,UAAU,EAAE,cAAc,CAAC;IAC3B,SAAS,EAAE,aAAa,CAAC;IACzB,WAAW,EAAE,eAAe,CAAC;IAC7B,cAAc,EAAE,kBAAkB,CAAC;IACnC,QAAQ,EAAE,YAAY,CAAC;IACvB,WAAW,EAAE,eAAe,CAAC;IAC7B,iBAAiB,EAAE,qBAAqB,CAAC;IACzC,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,cAAc,CAAC;IAC3B,WAAW,EAAE,eAAe,CAAC;IAC7B,aAAa,EAAE,iBAAiB,CAAC;IAEjC,gBAAgB,EAAE,yBAAyB,CAAC;IAC5C,YAAY,EAAE,qBAAqB,CAAC;IACpC,eAAe,EAAE,wBAAwB,CAAC;IAC1C,gBAAgB,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACnD,eAAe,EAAE,wBAAwB,CAAC;IAC1C,eAAe,EAAE,wBAAwB,CAAC;CAC3C;AAED,MAAM,MAAM,aAAa,GAAG,CAC1B,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,eAAe,KACjB,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,aAAa,CAimB1E"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preference key list, snapshot, persistence, and config-seeding.
|
|
3
|
+
*
|
|
4
|
+
* ## What lives here
|
|
5
|
+
*
|
|
6
|
+
* - `PREF_KEYS` – the canonical list of browser-setting ↔ config-file keys.
|
|
7
|
+
* - `createPrefsSeeding` – factory that returns `{ prefSnapshot, persistPrefs }`
|
|
8
|
+
* with file I/O captured in closure.
|
|
9
|
+
* - `seedConfigToMeta` – one-time call at startup: reads config.json and seeds
|
|
10
|
+
* `agent.ctx.meta` so the settings panel shows the real
|
|
11
|
+
* persisted values instead of localStorage defaults.
|
|
12
|
+
*
|
|
13
|
+
* ## Extraction history
|
|
14
|
+
*
|
|
15
|
+
* PR 9 of Issue #30 – extracted from webui-server.ts (was inline between the
|
|
16
|
+
* `PREF_KEYS` array and the `PrefsContext` construction).
|
|
17
|
+
*/
|
|
18
|
+
import type { Config } from '@wrongstack/core';
|
|
19
|
+
interface CliWebUIOptions {
|
|
20
|
+
agent: {
|
|
21
|
+
ctx: {
|
|
22
|
+
meta: Record<string, unknown>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
globalConfigPath?: string | undefined;
|
|
26
|
+
appConfig?: {
|
|
27
|
+
fallbackModels?: string[] | undefined;
|
|
28
|
+
fallbackProfiles?: Record<string, string[]> | undefined;
|
|
29
|
+
favoriteModels?: string[] | undefined;
|
|
30
|
+
favoriteModelsOnly?: boolean | undefined;
|
|
31
|
+
fallbackAuto?: boolean | undefined;
|
|
32
|
+
modelMatrix?: Config['modelMatrix'] | undefined;
|
|
33
|
+
uiLocale?: string | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
}
|
|
36
|
+
/** Keys synced between `agent.ctx.meta` and `config.json`. */
|
|
37
|
+
export declare const PREF_KEYS: readonly ['autonomy', 'autonomyDelayMs', 'autoProceedMaxIterations', 'yolo', 'maxIterations', 'chime', 'confirmExit', 'streamFleet', 'nextPrediction', 'fallbackModels', 'fallbackProfiles', 'favoriteModels', 'favoriteModelsOnly', 'modelMatrix', 'fallbackAuto', 'uiLocale', 'enhanceEnabled', 'enhanceDelayMs', 'enhanceLanguage', 'featureMcp', 'featurePlugins', 'featureMemory', 'featureSkills', 'featureModelsRegistry', 'indexOnStart', 'contextAutoCompact', 'contextStrategy', 'contextMode', 'tokenSavingTier', 'maxConcurrent', 'titleAnimation', 'reasoningMode', 'reasoningEffort', 'reasoningPreserve', 'cacheTtl', 'logLevel', 'auditLevel', 'hqEnabled', 'hqUrl', 'hqToken', 'hqRawContent', 'tgConfigured', 'tgSessionEnd', 'tgDelegate', 'tgLongToolMs'];
|
|
38
|
+
type PrefSnapshot = Record<string, unknown>;
|
|
39
|
+
/**
|
|
40
|
+
* One-time startup seed: reads `globalConfigPath` and copies recognised fields
|
|
41
|
+
* into `agent.ctx.meta` so the browser settings panel starts with the real
|
|
42
|
+
* persisted values instead of blank/undefined.
|
|
43
|
+
*
|
|
44
|
+
* Best-effort – missing or corrupt config leaves prefs unseeded.
|
|
45
|
+
*/
|
|
46
|
+
export declare function seedConfigToMeta(opts: CliWebUIOptions): Promise<void>;
|
|
47
|
+
interface PrefsSeeding {
|
|
48
|
+
prefSnapshot: () => PrefSnapshot;
|
|
49
|
+
persistPrefs: (payload: PrefSnapshot) => Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Factory – returns `prefSnapshot` and `persistPrefs` with file I/O captured
|
|
53
|
+
* in closure. Call once per `runWebUI` instance.
|
|
54
|
+
*/
|
|
55
|
+
export declare function createPrefsSeeding(opts: CliWebUIOptions): PrefsSeeding;
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=prefs-seeding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefs-seeding.d.ts","sourceRoot":"","sources":["../../src/webui-server/prefs-seeding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAK/C,UAAU,eAAe;IACvB,KAAK,EAAE;QAAE,GAAG,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAE,CAAA;KAAE,CAAC;IAClD,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,SAAS,CAAC,EAAE;QACV,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,CAAC;QACxD,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,S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GAAG,YAAY,CAsOtE"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { DefaultSecretVault } from '@wrongstack/core/security';
|
|
2
|
+
import type { ProviderConfig } from '@wrongstack/core/types';
|
|
3
|
+
export { expectDefined, maskedKey, normalizeKeys, nowIso, writeKeysBack, } from '../provider-config-utils.js';
|
|
4
|
+
/**
|
|
5
|
+
* PR 4 of Issue #30 (webui-server 8-PR refactor):
|
|
6
|
+
* provider-config IO.
|
|
7
|
+
*
|
|
8
|
+
* Before this PR, the two helpers below were inlined
|
|
9
|
+
* at the bottom of `webui-server.ts` as closure-captured
|
|
10
|
+
* helpers that read `opts.globalConfigPath` from the
|
|
11
|
+
* surrounding `runWebUI` scope. The helpers themselves
|
|
12
|
+
* are pure: given a config path and a vault, they
|
|
13
|
+
* load or save the providers map. The `globalConfigPath`
|
|
14
|
+
* closure capture is what made them untestable in
|
|
15
|
+
* isolation.
|
|
16
|
+
*
|
|
17
|
+
* After this PR, the helpers live in their own module
|
|
18
|
+
* with explicit parameters. `runWebUI` is the only
|
|
19
|
+
* caller; it now constructs the helpers at the call
|
|
20
|
+
* site or threads `globalConfigPath` through a thin
|
|
21
|
+
* adapter.
|
|
22
|
+
*
|
|
23
|
+
* Note: `writeKeysBack` and `normalizeKeys` (used by
|
|
24
|
+
* the per-handler key ops) are *already* imported from
|
|
25
|
+
* `@wrongstack/webui/server`. This PR does not move
|
|
26
|
+
* them — they were never inlined in `webui-server.ts`.
|
|
27
|
+
* Per the plan body's update after PR #51, they are
|
|
28
|
+
* not part of this extraction.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getVault(globalConfigPath: string | undefined): DefaultSecretVault;
|
|
31
|
+
export declare function loadSavedProviders(globalConfigPath: string | undefined): Promise<Record<string, ProviderConfig>>;
|
|
32
|
+
export declare function saveProviders(globalConfigPath: string | undefined, providers: Record<string, ProviderConfig>): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* A provider-config store bound to one `globalConfigPath`.
|
|
35
|
+
*
|
|
36
|
+
* PR 4 follow-up of Issue #30: the provider ws-handlers used to take a
|
|
37
|
+
* raw `globalConfigPath` and call `loadSavedProviders`/`saveProviders`
|
|
38
|
+
* with it on every operation. Binding the path once into a small
|
|
39
|
+
* `load`/`save` object (mirrors the standalone server's
|
|
40
|
+
* `createProviderConfigIO`) removes the repeated path threading and
|
|
41
|
+
* gives callers a single dependency to mock.
|
|
42
|
+
*/
|
|
43
|
+
export interface ProviderConfigStore {
|
|
44
|
+
load(): Promise<Record<string, ProviderConfig>>;
|
|
45
|
+
save(providers: Record<string, ProviderConfig>): Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Build a {@link ProviderConfigStore} for `globalConfigPath`. When the
|
|
49
|
+
* path is undefined the store is a no-op (load ⇒ `{}`, save ⇒ nothing),
|
|
50
|
+
* matching the underlying helpers' behaviour.
|
|
51
|
+
*
|
|
52
|
+
* @param configProvidersRef Optional callback that returns the in-memory
|
|
53
|
+
* merged `config.providers` map (from the boot config loader which merges
|
|
54
|
+
* global + project-local configs). When provided, `load()` returns from
|
|
55
|
+
* this ref instead of re-reading the single global config file on disk.
|
|
56
|
+
* This prevents a mismatch where providers stored in the project-local
|
|
57
|
+
* config (`config.local.json`) are visible to the agent but invisible
|
|
58
|
+
* to the WebUI's saved-providers panel.
|
|
59
|
+
*/
|
|
60
|
+
export declare function createProviderConfigStore(globalConfigPath: string | undefined, configProvidersRef?: () => Record<string, ProviderConfig>): ProviderConfigStore;
|
|
61
|
+
//# sourceMappingURL=provider-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-config.d.ts","sourceRoot":"","sources":["../../src/webui-server/provider-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAU7D,OAAO,EACL,aAAa,EACb,SAAS,EACT,aAAa,EACb,MAAM,EACN,aAAa,GACd,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,wBAAgB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,GAAG,kBAAkB,CAGjF;AAED,wBAAsB,kBAAkB,CACtC,gBAAgB,EAAE,MAAM,GAAG,SAAS,GACnC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAGzC;AAED,wBAAsB,aAAa,CACjC,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GACxC,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;IAChD,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CACvC,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,kBAAkB,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GACxD,mBAAmB,CAQrB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Context, ModelsRegistry } from '@wrongstack/core';
|
|
2
|
+
/** The slice of `CliWebUIOptions` the payload builder actually reads. */
|
|
3
|
+
export interface SessionStartPayloadDeps {
|
|
4
|
+
agent: {
|
|
5
|
+
ctx: Context;
|
|
6
|
+
};
|
|
7
|
+
session: {
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
10
|
+
modelsRegistry?: ModelsRegistry | undefined;
|
|
11
|
+
modeId?: string | undefined;
|
|
12
|
+
projectRoot?: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
export type BuildSessionStartPayload = (overrides?: Record<string, unknown>, needsSetup?: boolean) => Promise<Record<string, unknown>>;
|
|
15
|
+
/**
|
|
16
|
+
* Callers pass optional overrides for fields that vary per context
|
|
17
|
+
* (reset, mode, replayMessages, etc.).
|
|
18
|
+
*/
|
|
19
|
+
export declare function createSessionStartPayloadBuilder(deps: SessionStartPayloadDeps): BuildSessionStartPayload;
|
|
20
|
+
//# sourceMappingURL=session-start-payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-start-payload.d.ts","sourceRoot":"","sources":["../../src/webui-server/session-start-payload.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGhE,yEAAyE;AACzE,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE;QAAE,GAAG,EAAE,OAAO,CAAA;KAAE,CAAC;IACxB,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACxB,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,MAAM,MAAM,wBAAwB,GAAG,CACrC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,UAAU,CAAC,EAAE,OAAO,KACjB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEtC;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,uBAAuB,GAC5B,wBAAwB,CAoD1B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface SessionStatusPollDeps {
|
|
2
|
+
/** Directory holding session-registry.json (the wstack global root). */
|
|
3
|
+
globalRoot: string;
|
|
4
|
+
broadcast: (msg: {
|
|
5
|
+
type: string;
|
|
6
|
+
payload: unknown;
|
|
7
|
+
}) => void;
|
|
8
|
+
/** Shared disposer list — poll interval + fs watcher land here. */
|
|
9
|
+
eventUnsubscribers: Array<() => void>;
|
|
10
|
+
/** Receives the broadcaster so `/api/fleet/ping` can push-on-write. */
|
|
11
|
+
onBroadcastReady: (fn: () => Promise<void>) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function startSessionStatusPoll(deps: SessionStatusPollDeps): void;
|
|
14
|
+
//# sourceMappingURL=session-status-poll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-status-poll.d.ts","sourceRoot":"","sources":["../../src/webui-server/session-status-poll.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7D,mEAAmE;IACnE,kBAAkB,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;IACtC,uEAAuE;IACvE,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CACrD;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,CA4ExE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event arming for the CLI WebUI bridge — every EventBus subscription that
|
|
3
|
+
* fans agent/fleet/tool/mailbox/brain activity out to connected browsers.
|
|
4
|
+
*
|
|
5
|
+
* `createSetupEvents(deps)` returns the `setupEvents()` function the server
|
|
6
|
+
* calls on `listening` (and again after a project switch): it clears the
|
|
7
|
+
* shared `eventUnsubscribers` list and re-arms every subscription, pushing
|
|
8
|
+
* each disposer back onto that list so teardown/re-arm stays centralized in
|
|
9
|
+
* the caller. Fleet-concurrency gauge state lives here too — it is only ever
|
|
10
|
+
* read and mutated by these subscriptions.
|
|
11
|
+
*
|
|
12
|
+
* PR 12 of Issue #30: extracted from `webui-server.ts`.
|
|
13
|
+
*/
|
|
14
|
+
import type { Context, EventBus, JournalEntry, SecretScrubber } from '@wrongstack/core';
|
|
15
|
+
import { createEternalSubscription } from '@wrongstack/webui/server';
|
|
16
|
+
import type { StreamCoalescer } from './stream-coalescer.js';
|
|
17
|
+
import type { PendingConfirm } from './ws-handlers/index.js';
|
|
18
|
+
export interface SetupEventsDeps {
|
|
19
|
+
events: EventBus;
|
|
20
|
+
agent: {
|
|
21
|
+
ctx: Context;
|
|
22
|
+
};
|
|
23
|
+
subscribeEternalIteration?: ((fn: (entry: JournalEntry) => void) => () => void) | undefined;
|
|
24
|
+
broadcast: (msg: {
|
|
25
|
+
type: string;
|
|
26
|
+
payload: unknown;
|
|
27
|
+
}) => void;
|
|
28
|
+
sessionPayload: <T extends Record<string, unknown>>(payload: T) => T & {
|
|
29
|
+
sessionId: string;
|
|
30
|
+
};
|
|
31
|
+
currentSessionId: () => string;
|
|
32
|
+
queueTextDelta: StreamCoalescer['queueTextDelta'];
|
|
33
|
+
queueThinkingDelta: StreamCoalescer['queueThinkingDelta'];
|
|
34
|
+
queueToolProgress: StreamCoalescer['queueToolProgress'];
|
|
35
|
+
flushThinkingDelta: StreamCoalescer['flushThinkingDelta'];
|
|
36
|
+
flushAllStreamBuffers: StreamCoalescer['flushAllStreamBuffers'];
|
|
37
|
+
pendingConfirms: Map<string, PendingConfirm>;
|
|
38
|
+
secretScrubber: SecretScrubber;
|
|
39
|
+
/** Live clients getter for the shared eternal-iteration subscription. */
|
|
40
|
+
getClients: Parameters<typeof createEternalSubscription>[2];
|
|
41
|
+
/** Shared disposer list — the caller also pushes non-event disposers here. */
|
|
42
|
+
eventUnsubscribers: Array<() => void>;
|
|
43
|
+
}
|
|
44
|
+
export declare function createSetupEvents(deps: SetupEventsDeps): () => void;
|
|
45
|
+
//# sourceMapp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CAAC,CAAC;IAChE,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC7C,cAAc,EAAE,cAAc,CAAC;IAC/B,yEAAyE;IACzE,UAAU,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,8EAA8E;IAC9E,kBAAkB,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;CACvC;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,IAAI,CA2rBnE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Server } from 'node:http';
|
|
2
|
+
import { type CreateHttpServerOptions } from '@wrongstack/webui/server';
|
|
3
|
+
/**
|
|
4
|
+
* PR 6 of Issue #30 (webui-server 8-PR refactor):
|
|
5
|
+
* dist discovery + HTTP server bring-up.
|
|
6
|
+
*
|
|
7
|
+
* Before this PR, the `runWebUI` body inlined five lines
|
|
8
|
+
* that resolved the webui package's `dist` directory via
|
|
9
|
+
* `createRequire(import.meta.url)` and handed the path to
|
|
10
|
+
* `createHttpServer`. If the webui package wasn't built,
|
|
11
|
+
* the inline try/catch silently degraded to WS-only.
|
|
12
|
+
*
|
|
13
|
+
* After this PR, the dist-resolution lives in
|
|
14
|
+
* `webui-server/static-serve.ts` and the only thing
|
|
15
|
+
* `runWebUI` does is call `startStaticServe({ host,
|
|
16
|
+
* httpPort, wsPort, globalRoot })`. The function returns
|
|
17
|
+
* the listening `Server` and its real `port` (the OS
|
|
18
|
+
* may reassign if the requested port was in use), or
|
|
19
|
+
* `null` when the webui package is unbuilt.
|
|
20
|
+
*
|
|
21
|
+
* The try/catch around the require resolution stays
|
|
22
|
+
* inside this module so the runWebUI body does not have
|
|
23
|
+
* to think about webui's build state at all.
|
|
24
|
+
*/
|
|
25
|
+
export interface StaticServeHandle {
|
|
26
|
+
server: Server;
|
|
27
|
+
port: number;
|
|
28
|
+
}
|
|
29
|
+
export interface StaticServeOptions {
|
|
30
|
+
host: string;
|
|
31
|
+
httpPort: number;
|
|
32
|
+
wsPort: number;
|
|
33
|
+
globalRoot: string;
|
|
34
|
+
/** Push-on-write hook for `POST /api/fleet/ping` (immediate fleet re-broadcast). */
|
|
35
|
+
onFleetPing?: (() => void) | undefined;
|
|
36
|
+
/** Public browser-facing WS URL injected into the React app. */
|
|
37
|
+
publicWsUrl?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Shared auth token for `/ws-auth` and `/api/*` endpoints. Required for
|
|
40
|
+
* the cookie-based auth flow: the frontend extracts this from the URL,
|
|
41
|
+
* calls `/ws-auth?token=...` to get an HttpOnly cookie, then uses the
|
|
42
|
+
* cookie for subsequent WS upgrades (closing C-598 query-string exposure).
|
|
43
|
+
*/
|
|
44
|
+
apiToken?: string | undefined;
|
|
45
|
+
/** Force token auth even when the server binds to loopback. */
|
|
46
|
+
requireToken?: boolean | undefined;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Resolve the webui package's built `dist` directory.
|
|
50
|
+
*
|
|
51
|
+
* Returns the absolute path, or `null` if the package's
|
|
52
|
+
* server entry can't be resolved (webui not built). This
|
|
53
|
+
* is the one piece of `startStaticServe` that touches the
|
|
54
|
+
* module tree, so it lives behind its own function: tests
|
|
55
|
+
* can exercise the resolution (and stub it) without
|
|
56
|
+
* binding a socket.
|
|
57
|
+
*/
|
|
58
|
+
export declare function resolveDistDir(): string | null;
|
|
59
|
+
/**
|
|
60
|
+
* Injectable seams for `startStaticServe`. Both default to
|
|
61
|
+
* the real implementations; tests override them to assert
|
|
62
|
+
* the wiring without resolving the webui package or binding
|
|
63
|
+
* a real port.
|
|
64
|
+
*/
|
|
65
|
+
export interface StaticServeDeps {
|
|
66
|
+
resolveDist?: () => string | null;
|
|
67
|
+
createServer?: (opts: CreateHttpServerOptions) => Server;
|
|
68
|
+
}
|
|
69
|
+
export declare function startStaticServe(opts: StaticServeOptions, deps?: StaticServeDeps): StaticServeHandle | null;
|
|
70
|
+
//# sourceMappingURL=static-serve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-serve.d.ts","sourceRoot":"","sources":["../../src/webui-server/static-serve.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,KAAK,uBAAuB,EAAoB,MAAM,0BAA0B,CAAC;AAE1F;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,WAAW,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACvC,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,+DAA+D;IAC/D,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACpC;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAQ9C;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,uBAAuB,KAAK,MAAM,CAAC;CAC1D;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,kBAAkB,EACxB,IAAI,GAAE,eAAoB,GACzB,iBAAiB,GAAG,IAAI,CA6B1B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side stream coalescing for the CLI WebUI bridge.
|
|
3
|
+
*
|
|
4
|
+
* Coalesces high-volume live events (provider text/thinking deltas, tool
|
|
5
|
+
* progress) before they hit every connected browser tab. The frontend also
|
|
6
|
+
* coalesces per animation frame, but without this layer long streams still
|
|
7
|
+
* create one WebSocket message per provider token/tool progress event.
|
|
8
|
+
*
|
|
9
|
+
* PR 9 of Issue #30: extracted from `webui-server.ts`.
|
|
10
|
+
*/
|
|
11
|
+
export interface StreamCoalescerDeps {
|
|
12
|
+
/** Send a message to every connected client (webui-server's `broadcast`). */
|
|
13
|
+
broadcast: (msg: {
|
|
14
|
+
type: string;
|
|
15
|
+
payload: unknown;
|
|
16
|
+
}) => void;
|
|
17
|
+
/** Stamp a payload with the live session id (webui-server's `sessionPayload`). */
|
|
18
|
+
sessionPayload: <T extends Record<string, unknown>>(payload: T) => T & {
|
|
19
|
+
sessionId: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface ToolProgressPayload {
|
|
23
|
+
sessionId?: string | undefined;
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
event: {
|
|
27
|
+
type?: string | undefined;
|
|
28
|
+
text?: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface StreamCoalescer {
|
|
32
|
+
queueTextDelta(text: string, sessionId?: string | undefined): void;
|
|
33
|
+
queueThinkingDelta(text: string, sessionId?: string | undefined): void;
|
|
34
|
+
queueToolProgress(payload: ToolProgressPayload): void;
|
|
35
|
+
/** Flush a pending thinking buffer (text deltas interleave with thinking). */
|
|
36
|
+
flushThinkingDelta(): void;
|
|
37
|
+
/** Flush every pending buffer — call at iteration boundaries and shutdown. */
|
|
38
|
+
flushAllStreamBuffers(): void;
|
|
39
|
+
}
|
|
40
|
+
export declare function createStreamCoalescer(deps: StreamCoalescerDeps): StreamCoalescer;
|
|
41
|
+
//# sourceMappingURL=stream-coalescer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-coalescer.d.ts","sourceRoot":"","sources":["../../src/webui-server/stream-coalescer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,MAAM,WAAW,mBAAmB;IAClC,6EAA6E;IAC7E,SAAS,EAAE,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7D,kFAAkF;IAClF,cAAc,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9F;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;CACjE;AAED,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACnE,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACvE,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACtD,8EAA8E;IAC9E,kBAAkB,IAAI,IAAI,CAAC;IAC3B,8EAA8E;IAC9E,qBAAqB,IAAI,IAAI,CAAC;CAC/B;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,GAAG,eAAe,CA2JhF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type Agent, type ModelsRegistry, type ModeStore } from '@wrongstack/core';
|
|
2
|
+
import type { WebSocket } from 'ws';
|
|
3
|
+
import type { WsCommon } from './index.js';
|
|
4
|
+
/**
|
|
5
|
+
* PR 5e of Issue #30: agent-configuration WebSocket handlers —
|
|
6
|
+
* `modes.list` / `mode.switch` (agent mode) and `model.switch` /
|
|
7
|
+
* `model.refine` (provider+model). The first three re-broadcast a fresh
|
|
8
|
+
* `session.start` so every browser tab reflects the change.
|
|
9
|
+
*
|
|
10
|
+
* The session.start payload is built by `runWebUI`'s closure
|
|
11
|
+
* (`buildSessionStartPayload`, which reads a large amount of run state);
|
|
12
|
+
* it's threaded in here as the `buildSessionStart` callback rather than
|
|
13
|
+
* reconstructed. The other former captures (`opts.modeStore`,
|
|
14
|
+
* `opts.agent`, `opts.globalConfigPath`) are `AgentConfigContext` fields.
|
|
15
|
+
*/
|
|
16
|
+
export interface AgentConfigContext extends WsCommon {
|
|
17
|
+
/** The running agent — mode/model/provider live on its ctx. */
|
|
18
|
+
agent: Agent;
|
|
19
|
+
/** Mode store backing modes.list / mode.switch (optional). */
|
|
20
|
+
modeStore: ModeStore | undefined;
|
|
21
|
+
/** Global config path — model.switch reads saved provider configs from it. */
|
|
22
|
+
globalConfigPath: string | undefined;
|
|
23
|
+
/** Build the session.start payload (runWebUI's closure), broadcast on a config change. */
|
|
24
|
+
buildSessionStart: (overrides?: Record<string, unknown>) => Promise<unknown>;
|
|
25
|
+
/**
|
|
26
|
+
* Models registry, used to look up the active model's reasoning capabilities
|
|
27
|
+
* so the prompt refiner can send a gated low-effort hint. Optional — when
|
|
28
|
+
* absent the refiner sends no reasoning field (unchanged behavior).
|
|
29
|
+
*/
|
|
30
|
+
modelsRegistry?: ModelsRegistry | undefined;
|
|
31
|
+
onMaxContextResolved?: ((providerId: string, modelId: string, maxContext: number) => void) | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Persist durable keys to config.json (runWebUI's createPrefsSeeding closure).
|
|
34
|
+
* Used by model.switch to write the new provider+model so the choice survives
|
|
35
|
+
* restart — parity with the standalone server. Optional: when absent the
|
|
36
|
+
* switch still applies live, it just doesn't persist.
|
|
37
|
+
*/
|
|
38
|
+
persistPrefs?: ((payload: Record<string, unknown>) => Promise<void>) | undefined;
|
|
39
|
+
}
|
|
40
|
+
export declare function handleModesList(ctx: AgentConfigContext, ws: WebSocket): Promise<void>;
|
|
41
|
+
export declare function handleModeSwitch(ctx: AgentConfigContext, ws: WebSocket, id: string): Promise<void>;
|
|
42
|
+
export declare function handleModelSwitch(ctx: AgentConfigContext, ws: WebSocket, payload: {
|
|
43
|
+
provider: string;
|
|
44
|
+
model: string;
|
|
45
|
+
}): Promise<void>;
|
|
46
|
+
export declare function handleModelRefine(ctx: AgentConfigContext, ws: WebSocket, text: string): Promise<void>;
|
|
47
|
+
//# sourceMappingURL=agent-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-config.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/agent-config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EAGV,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,kBAAmB,SAAQ,QAAQ;IAClD,+DAA+D;IAC/D,KAAK,EAAE,KAAK,CAAC;IACb,8DAA8D;IAC9D,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;IACjC,8EAA8E;IAC9E,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,0FAA0F;IAC1F,iBAAiB,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7E;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC5C,oBAAoB,CAAC,EACjB,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC,GACnE,SAAS,CAAC;IACd;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC;CAClF;AAMD,wBAAsB,eAAe,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAiC3F;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,kBAAkB,EACvB,EAAE,EAAE,SAAS,EACb,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,kBAAkB,EACvB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC3C,OAAO,CAAC,IAAI,CAAC,CAkDf;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,kBAAkB,EACvB,EAAE,EAAE,SAAS,EACb,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CA0Df"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { BrainArbiter, BrainAutoRisk } from '@wrongstack/core';
|
|
2
|
+
import type { WebSocket } from 'ws';
|
|
3
|
+
import type { WsCommon } from './index.js';
|
|
4
|
+
/**
|
|
5
|
+
* PR 5b of Issue #30: Brain WebSocket handlers (`brain.status` /
|
|
6
|
+
* `brain.risk` / `brain.ask`).
|
|
7
|
+
*
|
|
8
|
+
* Extracted from the `runWebUI` switch. The former closure captures —
|
|
9
|
+
* `opts.brainSettings`, `opts.getBrainLog`, and the
|
|
10
|
+
* `opts.brain ?? container.resolve(TOKENS.BrainArbiter)` lookup — are now
|
|
11
|
+
* fields on `BrainHandlerContext`. The arbiter resolution is passed as a
|
|
12
|
+
* thunk so this module needn't know about the agent container or tokens.
|
|
13
|
+
*/
|
|
14
|
+
/** A single Brain decision-log entry (newest last). */
|
|
15
|
+
export interface BrainLogEntry {
|
|
16
|
+
at: number;
|
|
17
|
+
kind: string;
|
|
18
|
+
question: string;
|
|
19
|
+
outcome: string;
|
|
20
|
+
}
|
|
21
|
+
export interface BrainHandlerContext extends WsCommon {
|
|
22
|
+
/** Shared autonomy ceiling — the SAME object `/brain` mutates. */
|
|
23
|
+
brainSettings: {
|
|
24
|
+
maxAutoRisk: BrainAutoRisk;
|
|
25
|
+
} | undefined;
|
|
26
|
+
/** Read the host's rolling Brain decision log, or undefined when not wired. */
|
|
27
|
+
getBrainLog: (() => BrainLogEntry[]) | undefined;
|
|
28
|
+
/** Resolve the active Brain arbiter (host instance, else container-bound), or undefined. */
|
|
29
|
+
resolveArbiter: () => BrainArbiter | undefined;
|
|
30
|
+
/** Read the active session id for brain.ask requests. */
|
|
31
|
+
getSessionId?: (() => string | undefined) | undefined;
|
|
32
|
+
}
|
|
33
|
+
export declare function handleBrainStatus(ctx: BrainHandlerContext, ws: WebSocket): void;
|
|
34
|
+
export declare function handleBrainRisk(ctx: BrainHandlerContext, ws: WebSocket, level: string): void;
|
|
35
|
+
export declare function handleBrainAsk(ctx: BrainHandlerContext, ws: WebSocket, question: string | undefined): Promise<void>;
|
|
36
|
+
//# sourceMappingURL=brain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/brain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C;;;;;;;;;GASG;AAEH,uDAAuD;AACvD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAoB,SAAQ,QAAQ;IACnD,kEAAkE;IAClE,aAAa,EAAE;QAAE,WAAW,EAAE,aAAa,CAAA;KAAE,GAAG,SAAS,CAAC;IAC1D,+EAA+E;IAC/E,WAAW,EAAE,CAAC,MAAM,aAAa,EAAE,CAAC,GAAG,SAAS,CAAC;IACjD,4FAA4F;IAC5F,cAAc,EAAE,MAAM,YAAY,GAAG,SAAS,CAAC;IAC/C,yDAAyD;IACzD,YAAY,CAAC,EAAE,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;CACvD;AAMD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE,EAAE,SAAS,GAAG,IAAI,CAQ/E;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAe5F;AAED,wBAAsB,cAAc,CAClC,GAAG,EAAE,mBAAmB,EACxB,EAAE,EAAE,SAAS,EACb,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,OAAO,CAAC,IAAI,CAAC,CA6Bf"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Agent } from '@wrongstack/core';
|
|
2
|
+
import type { WebSocket } from 'ws';
|
|
3
|
+
import type { WsCommon } from './index.js';
|
|
4
|
+
/**
|
|
5
|
+
* PR 5k of Issue #30: the connection-level WebSocket handlers —
|
|
6
|
+
* `user_message` (the agent-run entry), `abort`, `ping`, and
|
|
7
|
+
* `tool.confirm_result`.
|
|
8
|
+
*
|
|
9
|
+
* These are the last cases that lived inline in `runWebUI`'s
|
|
10
|
+
* `handleMessage` switch. Unlike the topic groups, they own per-socket
|
|
11
|
+
* run-loop state: `abortControllers` (one in-flight `AbortController`
|
|
12
|
+
* per socket) and `pendingConfirms` (tool-permission resolvers keyed by
|
|
13
|
+
* confirm id). Both maps are *owned* by `runWebUI` and shared with the
|
|
14
|
+
* connection/close handlers, so they're passed by reference on the
|
|
15
|
+
* context rather than copied — the close handler still aborts/clears the
|
|
16
|
+
* same maps these handlers mutate.
|
|
17
|
+
*
|
|
18
|
+
* `opts` is threaded by reference (read-only here) so `handleUserMessage`
|
|
19
|
+
* calls the live `opts.agent` — after a project switch reassigns it, the
|
|
20
|
+
* next `user_message` runs the new agent.
|
|
21
|
+
*/
|
|
22
|
+
/** The tool-confirmation decision the client can send back. */
|
|
23
|
+
export type ConfirmDecision = 'yes' | 'no' | 'always' | 'deny';
|
|
24
|
+
export interface PendingConfirm {
|
|
25
|
+
resolve: (decision: ConfirmDecision) => void;
|
|
26
|
+
decisionSource?: string | undefined;
|
|
27
|
+
riskTier?: 'safe' | 'standard' | 'destructive' | undefined;
|
|
28
|
+
/** The exact `tool.confirm_needed` broadcast payload, kept so the prompt
|
|
29
|
+
* can be replayed to clients that connect while the confirm is pending
|
|
30
|
+
* (e.g. a browser refresh mid-prompt). */
|
|
31
|
+
payload?: Record<string, unknown> | undefined;
|
|
32
|
+
}
|
|
33
|
+
export declare function isDestructivePendingConfirm(confirm: PendingConfirm): boolean;
|
|
34
|
+
export declare function resolveYoloEligiblePendingConfirms(pendingConfirms: Map<string, PendingConfirm>): void;
|
|
35
|
+
export declare function resolveAllPendingConfirms(pendingConfirms: Map<string, PendingConfirm>, decision: ConfirmDecision): void;
|
|
36
|
+
export interface ConnectionOptions {
|
|
37
|
+
agent: Agent;
|
|
38
|
+
}
|
|
39
|
+
export interface ConnectionContext extends WsCommon {
|
|
40
|
+
opts: ConnectionOptions;
|
|
41
|
+
/** One in-flight run controller per socket; owned by runWebUI. */
|
|
42
|
+
abortControllers: Map<WebSocket, AbortController>;
|
|
43
|
+
/** Pending tool-permission resolvers keyed by confirm id; owned by runWebUI. */
|
|
44
|
+
pendingConfirms: Map<string, PendingConfirm>;
|
|
45
|
+
}
|
|
46
|
+
export declare function handleUserMessage(ctx: ConnectionContext, ws: WebSocket, content: string, requestedSessionId?: string | undefined): Promise<void>;
|
|
47
|
+
export declare function handleAbort(ctx: ConnectionContext, ws: WebSocket, requestedSessionId?: string | undefined): void;
|
|
48
|
+
export declare function handlePing(ctx: ConnectionContext, ws: WebSocket): void;
|
|
49
|
+
export declare function handleToolConfirmResult(ctx: ConnectionContext, id: string, decision: ConfirmDecision, requestedSessionId?: string | undefined): void;
|
|
50
|
+
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C;;;;;;;;;;;;;;;;;GAiBG;AAEH,+DAA+D;AAC/D,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/D,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,CAAC;IAC3D;;+CAE2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAC/C;AAED,wBAAgB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|
+
import type { WebSocket } from 'ws';
|
|
4
|
+
import type { WsCommon } from './index.js';
|
|
5
|
+
/**
|
|
6
|
+
* PR 5h of Issue #30: context-window WebSocket handlers — the live
|
|
7
|
+
* context (`context.clear`/`debug`/`compact`/`repair`) and the
|
|
8
|
+
* custom-context-mode CRUD (`context.modes.list`, `context.mode.switch`/
|
|
9
|
+
* `create`/`update`/`delete`).
|
|
10
|
+
*
|
|
11
|
+
* Former closure captures (`opts.agent`, `buildSessionStartPayload`, and
|
|
12
|
+
* the lazily-loaded `getCustomModeStore`) are `ContextHandlerContext`
|
|
13
|
+
* fields. The compactor is resolved off the agent container at call time,
|
|
14
|
+
* exactly as the inline cases did.
|
|
15
|
+
*/
|
|
16
|
+
export interface ContextHandlerContext extends WsCommon {
|
|
17
|
+
/** The running agent — context state/meta and the compactor container live on it. */
|
|
18
|
+
agent: Agent;
|
|
19
|
+
/** Build the reset session.start payload (runWebUI closure). */
|
|
20
|
+
buildSessionStart: (overrides?: Record<string, unknown>) => Promise<unknown>;
|
|
21
|
+
/** Lazily-loaded custom-context-mode store (runWebUI closure). */
|
|
22
|
+
getCustomModeStore: () => Promise<CustomModeStore>;
|
|
23
|
+
}
|
|
24
|
+
export declare function handleContextClear(ctx: ContextHandlerContext, ws: WebSocket): Promise<void>;
|
|
25
|
+
export declare function handleContextDebug(ctx: ContextHandlerContext, ws: WebSocket): void;
|
|
26
|
+
export declare function handleContextCompact(ctx: ContextHandlerContext, ws: WebSocket, aggressive: boolean): Promise<void>;
|
|
27
|
+
export declare function handleContextRepair(ctx: ContextHandlerContext, ws: WebSocket): void;
|
|
28
|
+
export declare function handleContextModesList(ctx: ContextHandlerContext, ws: WebSocket): Promise<void>;
|
|
29
|
+
export declare function handleContextModeSwitch(ctx: ContextHandlerContext, ws: WebSocket, id: string): Promise<void>;
|
|
30
|
+
export declare function handleContextModeCreate(ctx: ContextHandlerContext, ws: WebSocket, payload: {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
description: string;
|
|
34
|
+
thresholds: {
|
|
35
|
+
warn: number;
|
|
36
|
+
soft: number;
|
|
37
|
+
hard: number;
|
|
38
|
+
};
|
|
39
|
+
preserveK: number;
|
|
40
|
+
eliseThreshold: number;
|
|
41
|
+
}): Promise<void>;
|
|
42
|
+
export declare function handleContextModeUpdate(ctx: ContextHandlerContext, ws: WebSocket, payload: {
|
|
43
|
+
id: string;
|
|
44
|
+
name?: string | undefined;
|
|
45
|
+
description?: string | undefined;
|
|
46
|
+
thresholds?: {
|
|
47
|
+
warn?: number | undefined;
|
|
48
|
+
soft?: number | undefined;
|
|
49
|
+
hard?: number | undefined;
|
|
50
|
+
} | undefined;
|
|
51
|
+
preserveK?: number | undefined;
|
|
52
|
+
eliseThreshold?: number | undefined;
|
|
53
|
+
}): Promise<void>;
|
|
54
|
+
export declare function handleContextModeDelete(ctx: ContextHandlerContext, ws: WebSocket, id: string): Promise<void>;
|
|
55
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/webui-server/ws-handlers/context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EAKX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAOpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ;IACrD,qFAAqF;IACrF,KAAK,EAAE,KAAK,CAAC;IACb,gEAAgE;IAChE,iBAAiB,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7E,kEAAkE;IAClE,kBAAkB,EAAE,MAAM,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