@wrongstack/webui-server 0.295.0 → 0.296.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/dist/index.js +16915 -13874
  2. package/dist/index.js.map +4 -4
  3. package/dist/protocol/client-conversation.d.ts +1 -1
  4. package/dist/protocol/client-conversation.d.ts.map +1 -1
  5. package/dist/protocol/client-integrations.d.ts +1 -1
  6. package/dist/protocol/client-integrations.d.ts.map +1 -1
  7. package/dist/protocol/client-operations.d.ts +2 -2
  8. package/dist/protocol/client-operations.d.ts.map +1 -1
  9. package/dist/protocol/client-workspace.d.ts +1 -1
  10. package/dist/protocol/client-workspace.d.ts.map +1 -1
  11. package/dist/protocol/index.d.ts +1 -0
  12. package/dist/protocol/index.d.ts.map +1 -1
  13. package/dist/protocol/index.js +64 -1
  14. package/dist/protocol/index.js.map +3 -3
  15. package/dist/protocol/projections.d.ts +2 -0
  16. package/dist/protocol/projections.d.ts.map +1 -1
  17. package/dist/protocol/registry.d.ts +2 -2
  18. package/dist/protocol/registry.d.ts.map +1 -1
  19. package/dist/protocol/replay-payload.d.ts +41 -0
  20. package/dist/protocol/replay-payload.d.ts.map +1 -0
  21. package/dist/protocol/server-conversation.d.ts +1 -1
  22. package/dist/protocol/server-conversation.d.ts.map +1 -1
  23. package/dist/protocol/server-integrations.d.ts +1 -1
  24. package/dist/protocol/server-integrations.d.ts.map +1 -1
  25. package/dist/protocol/server-operations.d.ts +1 -1
  26. package/dist/protocol/server-operations.d.ts.map +1 -1
  27. package/dist/protocol/server-workspace.d.ts +2 -2
  28. package/dist/protocol/server-workspace.d.ts.map +1 -1
  29. package/dist/protocol/version.d.ts +5 -1
  30. package/dist/protocol/version.d.ts.map +1 -1
  31. package/dist/server/agent-roster-handlers.d.ts +36 -1
  32. package/dist/server/agent-roster-handlers.d.ts.map +1 -1
  33. package/dist/server/backend-services.d.ts.map +1 -1
  34. package/dist/server/brain-handlers.d.ts.map +1 -1
  35. package/dist/server/chronicle-routes.d.ts +2 -3
  36. package/dist/server/chronicle-routes.d.ts.map +1 -1
  37. package/dist/server/client-presence.d.ts +2 -2
  38. package/dist/server/client-presence.d.ts.map +1 -1
  39. package/dist/server/codebase-index-server-control.d.ts +15 -0
  40. package/dist/server/codebase-index-server-control.d.ts.map +1 -0
  41. package/dist/server/codebase-indexing.d.ts.map +1 -1
  42. package/dist/server/codemap-cache.d.ts +14 -0
  43. package/dist/server/codemap-cache.d.ts.map +1 -0
  44. package/dist/server/codemap-handlers.d.ts +5 -6
  45. package/dist/server/codemap-handlers.d.ts.map +1 -1
  46. package/dist/server/collaboration-ws-handler.d.ts.map +1 -1
  47. package/dist/server/connection-handler.d.ts +9 -1
  48. package/dist/server/connection-handler.d.ts.map +1 -1
  49. package/dist/server/connection-lifecycle.d.ts +76 -0
  50. package/dist/server/connection-lifecycle.d.ts.map +1 -1
  51. package/dist/server/connections-health-route.d.ts +46 -0
  52. package/dist/server/connections-health-route.d.ts.map +1 -0
  53. package/dist/server/context-editor.d.ts +114 -0
  54. package/dist/server/context-editor.d.ts.map +1 -0
  55. package/dist/server/context-meta.d.ts.map +1 -1
  56. package/dist/server/conversation-operations.d.ts.map +1 -1
  57. package/dist/server/deadcode-handlers.d.ts +8 -0
  58. package/dist/server/deadcode-handlers.d.ts.map +1 -0
  59. package/dist/server/embedded-host-adapters.d.ts +11 -1
  60. package/dist/server/embedded-host-adapters.d.ts.map +1 -1
  61. package/dist/server/embedded-lifecycle.d.ts.map +1 -1
  62. package/dist/server/embedded-message-router.d.ts +4 -0
  63. package/dist/server/embedded-message-router.d.ts.map +1 -1
  64. package/dist/server/entry.js +14952 -12161
  65. package/dist/server/entry.js.map +4 -4
  66. package/dist/server/goal-routes.d.ts +2 -2
  67. package/dist/server/goal-routes.d.ts.map +1 -1
  68. package/dist/server/goal-ws-handler.d.ts +20 -1
  69. package/dist/server/goal-ws-handler.d.ts.map +1 -1
  70. package/dist/server/handlers.js +0 -1
  71. package/dist/server/handlers.js.map +2 -2
  72. package/dist/server/http-server/api-handlers.d.ts +1 -1
  73. package/dist/server/http-server/api-handlers.d.ts.map +1 -1
  74. package/dist/server/http-server.d.ts.map +1 -1
  75. package/dist/server/index.d.ts +6 -2
  76. package/dist/server/index.d.ts.map +1 -1
  77. package/dist/server/kanban-board-watcher.d.ts +10 -0
  78. package/dist/server/kanban-board-watcher.d.ts.map +1 -0
  79. package/dist/server/kanban-daemon-subscriber.d.ts +3 -0
  80. package/dist/server/kanban-daemon-subscriber.d.ts.map +1 -0
  81. package/dist/server/kanban-decomposition-routes.d.ts +10 -0
  82. package/dist/server/kanban-decomposition-routes.d.ts.map +1 -0
  83. package/dist/server/kanban-dispatch.d.ts +1 -0
  84. package/dist/server/kanban-dispatch.d.ts.map +1 -1
  85. package/dist/server/kanban-route-helpers.d.ts +17 -0
  86. package/dist/server/kanban-route-helpers.d.ts.map +1 -0
  87. package/dist/server/kanban-route-pagination.d.ts +16 -0
  88. package/dist/server/kanban-route-pagination.d.ts.map +1 -0
  89. package/dist/server/kanban-route-protocol.d.ts +2 -0
  90. package/dist/server/kanban-route-protocol.d.ts.map +1 -0
  91. package/dist/server/kanban-routes.d.ts +2 -15
  92. package/dist/server/kanban-routes.d.ts.map +1 -1
  93. package/dist/server/kanban-run-mirror.d.ts.map +1 -1
  94. package/dist/server/kanban-supervisor.d.ts.map +1 -1
  95. package/dist/server/kanban-task-routes.d.ts +10 -0
  96. package/dist/server/kanban-task-routes.d.ts.map +1 -0
  97. package/dist/server/mailbox-handlers.d.ts +3 -3
  98. package/dist/server/mailbox-handlers.d.ts.map +1 -1
  99. package/dist/server/message-dispatcher.d.ts.map +1 -1
  100. package/dist/server/mode-handlers.d.ts +4 -6
  101. package/dist/server/mode-handlers.d.ts.map +1 -1
  102. package/dist/server/model-catalog-search.d.ts +17 -0
  103. package/dist/server/model-catalog-search.d.ts.map +1 -0
  104. package/dist/server/model-operations.d.ts +2 -0
  105. package/dist/server/model-operations.d.ts.map +1 -1
  106. package/dist/server/network-info.d.ts +50 -0
  107. package/dist/server/network-info.d.ts.map +1 -0
  108. package/dist/server/pre-context-services.d.ts +1 -1
  109. package/dist/server/pre-context-services.d.ts.map +1 -1
  110. package/dist/server/pref-helpers.d.ts +7 -7
  111. package/dist/server/pref-helpers.d.ts.map +1 -1
  112. package/dist/server/project-handlers.d.ts +3 -2
  113. package/dist/server/project-handlers.d.ts.map +1 -1
  114. package/dist/server/provider-handlers.d.ts +10 -0
  115. package/dist/server/provider-handlers.d.ts.map +1 -1
  116. package/dist/server/provider-keys.d.ts +2 -0
  117. package/dist/server/provider-keys.d.ts.map +1 -1
  118. package/dist/server/provider-routes.d.ts +9 -0
  119. package/dist/server/provider-routes.d.ts.map +1 -1
  120. package/dist/server/routes.d.ts +8 -3
  121. package/dist/server/routes.d.ts.map +1 -1
  122. package/dist/server/sdd-board-ws-handler.d.ts.map +1 -1
  123. package/dist/server/sdd-wizard-wiring.d.ts +17 -1
  124. package/dist/server/sdd-wizard-wiring.d.ts.map +1 -1
  125. package/dist/server/sdd-wizard-ws-handler.d.ts +41 -8
  126. package/dist/server/sdd-wizard-ws-handler.d.ts.map +1 -1
  127. package/dist/server/session-handlers.d.ts +13 -3
  128. package/dist/server/session-handlers.d.ts.map +1 -1
  129. package/dist/server/session-history.d.ts +3 -0
  130. package/dist/server/session-history.d.ts.map +1 -1
  131. package/dist/server/session-routes.d.ts +3 -0
  132. package/dist/server/session-routes.d.ts.map +1 -1
  133. package/dist/server/setup-events-core-watchers.d.ts +15 -0
  134. package/dist/server/setup-events-core-watchers.d.ts.map +1 -0
  135. package/dist/server/setup-events-fleet-broadcaster.d.ts +15 -0
  136. package/dist/server/setup-events-fleet-broadcaster.d.ts.map +1 -0
  137. package/dist/server/setup-events-provider-handlers.d.ts +19 -0
  138. package/dist/server/setup-events-provider-handlers.d.ts.map +1 -0
  139. package/dist/server/setup-events-session-helpers.d.ts +10 -0
  140. package/dist/server/setup-events-session-helpers.d.ts.map +1 -0
  141. package/dist/server/setup-events-status-watcher.d.ts +15 -0
  142. package/dist/server/setup-events-status-watcher.d.ts.map +1 -0
  143. package/dist/server/setup-events-watcher.d.ts +3 -0
  144. package/dist/server/setup-events-watcher.d.ts.map +1 -1
  145. package/dist/server/setup-events.d.ts +1 -1
  146. package/dist/server/setup-events.d.ts.map +1 -1
  147. package/dist/server/skills-handlers.d.ts.map +1 -1
  148. package/dist/server/standalone-session-identity.d.ts +10 -6
  149. package/dist/server/standalone-session-identity.d.ts.map +1 -1
  150. package/dist/server/start-webui.d.ts.map +1 -1
  151. package/dist/server/types.d.ts +2 -0
  152. package/dist/server/types.d.ts.map +1 -1
  153. package/dist/server/ws-auth.d.ts.map +1 -1
  154. package/dist/server/ws-payload-preferences.d.ts +13 -0
  155. package/dist/server/ws-payload-preferences.d.ts.map +1 -0
  156. package/dist/server/ws-payload-validation.d.ts +2 -5
  157. package/dist/server/ws-payload-validation.d.ts.map +1 -1
  158. package/package.json +10 -10
@@ -1,5 +1,5 @@
1
- export declare const CLIENT_MESSAGE_TYPES: readonly ["abort", "ping", "user_message", "tool.confirm_result", "completion.request", "model.switch", "model.refine", "autonomy.switch", "context.clear", "context.compact", "context.debug", "context.mode.create", "context.mode.delete", "context.mode.switch", "context.mode.update", "context.modes.list", "context.repair", "mode.switch", "modes.list", "session.checkpoints", "session.delete", "session.new", "session.rename", "session.resume", "session.rewind", "session.save", "sessions.list", "side_effects.list", "stats.get", "todo.update", "todos.clear", "todos.get", "todos.remove", "collab.join", "collab.leave", "collab.annotate", "collab.resolve", "collab.request_pause", "collab.resume", "collab.grant_control", "collab.inject_tool", "mailbox.agents", "mailbox.clear", "mailbox.compact", "mailbox.messages", "mailbox.purge", "mailbox.send", "files.list", "files.read", "files.tree", "files.write", "git.changes", "git.diff", "git.info", "projects.add", "projects.list", "projects.select", "working_dir.set", "worktree.cleanup", "worktree.diff", "worktree.merge", "worktree.remove", "worktree.scan", "shell.open", "process.kill", "process.killAll", "process.list", "terminal.close", "terminal.create", "terminal.input", "terminal.resize", "diag.get", "key.add", "key.delete", "key.set_active", "key.update", "prefs.get", "prefs.update", "provider.add", "provider.clear_models", "provider.models", "provider.probe", "provider.remove", "provider.undo_clear", "provider.update", "providers.list", "providers.saved", "tool.disable", "tool.enable", "tools.list", "webui.shutdown", "goal-state.get", "goal.addTask", "goal.assignTask", "goal.clear", "goal.get", "goal.list", "goal.load", "goal.moveTask", "goal.pause", "goal.resume", "goal.retryTask", "goal.revert", "goal.runTask", "goal.save", "goal.selectPhase", "goal.start", "goal.state", "goal.status", "goal.stop", "goal.taskStatus", "goal.toggleAutonomous", "plan.get", "plan.item.update", "plan.template_use", "task.update", "tasks.get", "sdd.board.cancel_task", "sdd.board.cleanup_worktrees", "sdd.board.delete_task", "sdd.board.destroy", "sdd.board.get", "sdd.board.list", "sdd.board.pause", "sdd.board.reassign", "sdd.board.resume", "sdd.board.retry", "sdd.board.retry_all_failed", "sdd.board.rollback", "sdd.board.set_task_fallbacks", "sdd.board.set_task_model", "sdd.board.set_task_verification", "sdd.board.split_task", "sdd.board.stop", "sdd.run.start", "sdd.spec.approve", "sdd.spec.get", "sdd.spec.message", "sdd.spec.start", "specs.get", "specs.list", "specs.taskStatus", "brain.ask", "brain.config.get", "brain.config.set", "brain.risk", "brain.status", "chronicle.facet", "chronicle.facets", "chronicle.graph", "chronicle.query", "config.doctor", "design.list", "design.materialize", "design.set", "design.state", "design.swap", "design.tune", "design.use", "design.verify", "memory.list", "memory.sage.backfillRecoverable", "memory.sage.candidateResolve", "memory.sage.delete", "memory.sage.forFile", "memory.sage.get", "memory.sage.graph", "memory.sage.list", "memory.sage.listPage", "memory.sage.recover", "memory.sage.remember", "memory.sage.update", "auth.oauth.cancel", "auth.oauth.code", "auth.oauth.start", "mcp.add", "mcp.disable", "mcp.discover", "mcp.enable", "mcp.list", "mcp.prompt.get", "mcp.prompts", "mcp.remove", "mcp.resource.read", "mcp.resources", "mcp.restart", "mcp.sleep", "mcp.update", "mcp.wake", "prompts.content", "prompts.create", "prompts.favorite", "prompts.list", "prompts.recent", "prompts.search", "prompts.used", "skills.content", "skills.create", "skills.edit", "skills.export", "skills.install", "skills.list", "skills.uninstall", "skills.update"];
2
- export declare const SERVER_MESSAGE_TYPES: readonly ["error", "log", "pong", "side_effects", "agent.status_changed", "agent.timeline.message", "client.status_update", "compaction.failed", "completion.result", "context.compacted", "context.debug", "context.mode.changed", "context.modes.list", "context.repaired", "ctx.max_context", "ctx.pct", "delegate.completed", "delegate.started", "iteration.completed", "iteration.limit_reached", "iteration.started", "model.refine_result", "modes.list", "provider.active_blocked", "provider.error", "provider.fallback", "provider.response", "provider.retry", "provider.status_changed", "provider.stream_error", "provider.text_delta", "provider.thinking_delta", "run.result", "session.checkpoints", "session.damaged", "session.end", "session.rewound", "session.start", "session.stats", "sessions.list", "sessions.status_update", "stats.get", "token.cost_estimate_unavailable", "token.threshold", "tool.confirm_needed", "tool.disabled", "tool.enabled", "tool.executed", "tool.loop_detected", "tool.progress", "tool.started", "tools.list", "trust.persisted", "collab.annotation.added", "collab.annotation.resolved", "collab.event", "collab.injection.granted", "collab.participant.joined", "collab.participant.left", "collab.pause.granted", "collab.pause.released", "collab.state", "mailbox.agent_registered", "mailbox.agents", "mailbox.cleared", "mailbox.compacted", "mailbox.event", "mailbox.messages", "mailbox.sent", "mailbox.purged", "mailbox.received", "subagent.budget_extended", "subagent.event", "checkpoint.written", "codemap.file_event", "codemap.tool_executed", "codemap.tool_started", "file.saved", "files.list", "files.read", "files.tree", "files.written", "git.changes", "git.diff", "git.info", "process.list", "projects.added", "projects.list", "projects.selected", "terminal.exit", "terminal.output", "working_dir.changed", "worktree.cleanup_result", "worktree.diff_result", "worktree.event", "worktree.merge_result", "worktree.orphans", "worktree.state", "auth.oauth.status", "diag.get", "key.operation_result", "prefs.updated", "provider.catalog", "provider.models", "provider.probe", "providers.saved", "budget.decision", "budget.threshold_reached", "coordinator.stats", "coordinator.status", "eternal.iteration", "fleet.concurrency_update", "goal-state.updated", "goal.list", "goal.paused", "goal.resumed", "goal.saved", "goal.error", "goal.stopped", "goal.failed", "goal.completed", "goal.cleared", "goal.reverted", "goal.progress", "goal.state", "in_flight.ended", "in_flight.started", "plan.updated", "task.completed", "task.failed", "task.pending", "task.started", "tasks.updated", "todos.cleared", "todos.updated", "kanban.task.activity", "sdd.board.lifecycle_result", "sdd.board.list", "sdd.board.snapshot", "sdd.run.started", "sdd.spec.agent_text", "sdd.spec.error", "sdd.spec.snapshot", "specs.detail", "specs.list", "consensus.vote_cast", "consensus.vote_initiated", "consensus.vote_resolved", "cron.job_fired", "cron.snapshot", "techstack.job.cancelled", "techstack.job.failed", "techstack.job.progress", "techstack.job.started", "techstack.report.delivered", "techstack.report.ready", "techstack.snapshot.updated", "techstack.workspace.completed", "brain.answer", "brain.config", "brain.event", "brain.status", "chronicle.error", "chronicle.facet_result", "chronicle.facets_result", "chronicle.graph_result", "chronicle.query_result", "config.doctor.result", "design.list", "design.materialize", "design.set", "design.state", "design.swap", "design.tune", "design.use", "design.verify", "memory.event", "memory.list", "memory.sage.backfillRecoverable", "memory.sage.candidateResolve", "memory.sage.delete", "memory.sage.forFile", "memory.sage.get", "memory.sage.graph", "memory.sage.list", "memory.sage.listPage", "memory.sage.recover", "memory.sage.remember", "memory.sage.update", "mcp.content.error", "mcp.content.selected", "mcp.list", "mcp.operation_result", "mcp.prompts", "mcp.resources", "mcp.server.added", "mcp.server.connected", "mcp.server.disconnected", "mcp.server.discovered", "mcp.server.error", "mcp.server.reconnected", "mcp.server.removed", "mcp.server.sleeping", "mcp.server.updated", "mcp.server.waking", "prompts.content", "prompts.created", "prompts.favorite", "prompts.list", "prompts.recent", "prompts.search", "prompts.used", "skills.content", "skills.created", "skills.edited", "skills.exported", "skills.installed", "skills.list", "skills.uninstalled", "skills.updated"];
1
+ export declare const CLIENT_MESSAGE_TYPES: readonly ["abort", "ping", "user_message", "tool.confirm_result", "completion.request", "model.switch", "model.refine", "autonomy.switch", "context.clear", "context.compact", "context.debug", "context.editor.open", "context.editor.validate", "context.editor.apply", "context.mode.create", "context.mode.delete", "context.mode.switch", "context.mode.update", "context.modes.list", "context.repair", "mode.switch", "modes.list", "session.checkpoints", "session.delete", "session.new", "session.rename", "session.resume", "session.rewind", "session.save", "sessions.list", "side_effects.list", "stats.get", "todo.update", "todos.clear", "todos.get", "todos.remove", "collab.join", "collab.leave", "collab.annotate", "collab.resolve", "collab.request_pause", "collab.resume", "collab.grant_control", "collab.inject_tool", "mailbox.agents", "mailbox.clear", "mailbox.compact", "mailbox.messages", "mailbox.purge", "mailbox.send", "files.list", "files.read", "files.tree", "files.write", "git.changes", "git.diff", "git.info", "projects.add", "projects.list", "projects.select", "working_dir.set", "worktree.cleanup", "worktree.diff", "worktree.merge", "worktree.remove", "worktree.scan", "shell.open", "process.kill", "process.killAll", "process.list", "terminal.close", "terminal.create", "terminal.input", "terminal.resize", "codebase.index.server.shutdown", "connections.health", "diag.get", "key.add", "key.delete", "key.set_active", "key.update", "prefs.get", "prefs.update", "provider.add", "provider.clear_models", "provider.models", "provider.models.search", "provider.probe", "provider.remove", "provider.status.clear", "provider.status.get", "provider.status.retry", "provider.undo_clear", "provider.update", "providers.list", "providers.saved", "tool.disable", "tool.enable", "tools.list", "webui.shutdown", "goal-state.get", "goal.addTask", "goal.assess", "goal.assignTask", "goal.clear", "goal.get", "goal.list", "goal.load", "goal.moveTask", "goal.pause", "goal.resume", "goal.retryTask", "goal.revert", "goal.runTask", "goal.save", "goal.selectPhase", "goal.start", "goal.state", "goal.status", "goal.stop", "goal.taskStatus", "goal.toggleAutonomous", "plan.get", "plan.item.update", "plan.template_use", "task.update", "tasks.get", "sdd.board.cancel_task", "sdd.board.cleanup_worktrees", "sdd.board.delete_task", "sdd.board.destroy", "sdd.board.get", "sdd.board.list", "sdd.board.pause", "sdd.board.reassign", "sdd.board.resume", "sdd.board.retry", "sdd.board.retry_all_failed", "sdd.board.rollback", "sdd.board.set_task_fallbacks", "sdd.board.set_task_model", "sdd.board.set_task_verification", "sdd.board.split_task", "sdd.board.stop", "sdd.run.from_graph", "sdd.run.from_spec", "sdd.run.start", "sdd.spec.approve", "sdd.spec.discard", "sdd.spec.get", "sdd.spec.message", "sdd.spec.start", "specs.get", "specs.list", "specs.taskStatus", "brain.ask", "brain.config.get", "brain.config.set", "brain.risk", "brain.status", "chronicle.facet", "chronicle.facets", "chronicle.graph", "chronicle.metrics", "chronicle.query", "chronicle.status", "config.doctor", "design.list", "design.materialize", "design.set", "design.state", "design.swap", "design.tune", "design.use", "design.verify", "memory.list", "memory.sage.backfillRecoverable", "memory.sage.candidateResolve", "memory.sage.delete", "memory.sage.forFile", "memory.sage.get", "memory.sage.graph", "memory.sage.list", "memory.sage.listPage", "memory.sage.recover", "memory.sage.remember", "memory.sage.update", "auth.oauth.cancel", "auth.oauth.code", "auth.oauth.start", "mcp.add", "mcp.disable", "mcp.discover", "mcp.enable", "mcp.list", "mcp.prompt.get", "mcp.prompts", "mcp.remove", "mcp.resource.read", "mcp.resources", "mcp.restart", "mcp.sleep", "mcp.update", "mcp.wake", "prompts.content", "prompts.create", "prompts.favorite", "prompts.list", "prompts.recent", "prompts.search", "prompts.used", "skills.content", "skills.create", "skills.edit", "skills.export", "skills.install", "skills.list", "skills.uninstall", "skills.update"];
2
+ export declare const SERVER_MESSAGE_TYPES: readonly ["error", "log", "pong", "side_effects", "agent.status_changed", "agent.timeline.message", "client.status_update", "compaction.failed", "completion.result", "context.compacted", "context.debug", "context.editor.snapshot", "context.editor.validation", "context.editor.applied", "context.mode.changed", "context.modes.list", "context.repaired", "ctx.max_context", "ctx.pct", "delegate.completed", "delegate.started", "iteration.completed", "iteration.limit_reached", "iteration.started", "model.refine_result", "modes.list", "provider.active_blocked", "provider.error", "provider.fallback", "provider.response", "provider.retry", "provider.status_changed", "provider.stream_error", "provider.text_delta", "provider.thinking_delta", "run.result", "session.checkpoints", "session.damaged", "session.end", "session.rewound", "session.start", "session.stats", "sessions.list", "sessions.status_update", "stats.get", "token.cost_estimate_unavailable", "token.threshold", "tool.confirm_needed", "tool.disabled", "tool.enabled", "tool.executed", "tool.loop_detected", "tool.progress", "tool.started", "tools.list", "trust.persisted", "collab.annotation.added", "collab.annotation.resolved", "collab.event", "collab.injection.granted", "collab.participant.joined", "collab.participant.left", "collab.pause.granted", "collab.pause.released", "collab.state", "mailbox.agent_registered", "mailbox.agents", "mailbox.cleared", "mailbox.compacted", "mailbox.event", "mailbox.messages", "mailbox.sent", "mailbox.purged", "mailbox.received", "subagent.budget_extended", "subagent.event", "checkpoint.written", "codemap.file_event", "codemap.index_updated", "codemap.tool_executed", "codemap.tool_started", "file.saved", "files.list", "files.read", "files.tree", "files.written", "git.changes", "git.diff", "git.info", "process.list", "projects.added", "projects.list", "projects.selected", "terminal.exit", "terminal.output", "working_dir.changed", "worktree.cleanup_result", "worktree.diff_result", "worktree.event", "worktree.merge_result", "worktree.orphans", "worktree.state", "auth.oauth.status", "codebase.index.server.shutdown_result", "connections.health_error", "connections.health_result", "diag.get", "key.operation_result", "model.switch_result", "prefs.updated", "provider.catalog", "provider.models", "provider.models.search_result", "provider.probe", "provider.status.snapshot", "providers.saved", "budget.decision", "budget.threshold_reached", "coordinator.stats", "coordinator.status", "eternal.iteration", "fleet.concurrency_update", "goal-state.updated", "goal.assess.result", "goal.list", "goal.paused", "goal.resumed", "goal.saved", "goal.error", "goal.stopped", "goal.failed", "goal.completed", "goal.cleared", "goal.reverted", "goal.progress", "goal.state", "in_flight.ended", "in_flight.started", "plan.updated", "task.completed", "task.failed", "task.pending", "task.started", "tasks.updated", "todos.cleared", "todos.updated", "kanban.task.activity", "sdd.board.lifecycle_result", "sdd.board.list", "sdd.board.snapshot", "sdd.run.started", "sdd.spec.agent_text", "sdd.spec.error", "sdd.spec.snapshot", "specs.detail", "specs.list", "consensus.vote_cast", "consensus.vote_initiated", "consensus.vote_resolved", "cron.job_fired", "cron.snapshot", "techstack.job.cancelled", "techstack.job.failed", "techstack.job.progress", "techstack.job.started", "techstack.report.delivered", "techstack.report.ready", "techstack.snapshot.updated", "techstack.workspace.completed", "brain.answer", "brain.config", "brain.event", "brain.status", "chronicle.error", "chronicle.facet_result", "chronicle.facets_result", "chronicle.graph_result", "chronicle.metrics_result", "chronicle.query_result", "chronicle.status_result", "config.doctor.result", "design.list", "design.materialize", "design.set", "design.state", "design.swap", "design.tune", "design.use", "design.verify", "memory.event", "memory.list", "memory.sage.backfillRecoverable", "memory.sage.candidateResolve", "memory.sage.delete", "memory.sage.forFile", "memory.sage.get", "memory.sage.graph", "memory.sage.list", "memory.sage.listPage", "memory.sage.recover", "memory.sage.remember", "memory.sage.update", "mcp.content.error", "mcp.content.selected", "mcp.list", "mcp.operation_result", "mcp.prompts", "mcp.resources", "mcp.server.added", "mcp.server.connected", "mcp.server.disconnected", "mcp.server.discovered", "mcp.server.error", "mcp.server.reconnected", "mcp.server.removed", "mcp.server.sleeping", "mcp.server.updated", "mcp.server.waking", "prompts.content", "prompts.created", "prompts.favorite", "prompts.list", "prompts.recent", "prompts.search", "prompts.used", "skills.content", "skills.created", "skills.edited", "skills.exported", "skills.installed", "skills.list", "skills.uninstalled", "skills.updated"];
3
3
  export type ExactClientMessageType = (typeof CLIENT_MESSAGE_TYPES)[number];
4
4
  export type ExactServerMessageType = (typeof SERVER_MESSAGE_TYPES)[number];
5
5
  export declare function isRegisteredMessageType(type: string, direction: 'client' | 'server'): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/protocol/registry.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,oBAAoB,0kHASvB,CAAC;AAEX,eAAO,MAAM,oBAAoB,w0IAUvB,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3E,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAK3E,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAO7F"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/protocol/registry.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,oBAAoB,s6HASvB,CAAC;AAEX,eAAO,MAAM,oBAAoB,srJAUvB,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3E,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAK3E,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAO7F"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Replay payload assembly for `session.start`.
3
+ *
4
+ * Two servers build this frame — the standalone WebUI server and the
5
+ * CLI-hosted bridge — and they had already drifted (one fell back to the live
6
+ * in-memory conversation, the other did not; only one applied the message cap
7
+ * consistently). Both now call this, so the wire shape has a single definition.
8
+ *
9
+ * `replayMarkers` carries audit markers (compaction, mode switch, skill
10
+ * activation, subagent lifecycle, provider retries, truncation) that a live
11
+ * client renders as they stream in. Without them a reconnect or a session
12
+ * resume silently drops everything except the conversation, so the same
13
+ * session reads differently before and after a reload. Only the *projected*
14
+ * markers cross the wire — never the raw event stream — so a 50k-event session
15
+ * still costs a few dozen short strings.
16
+ */
17
+ import type { Message, SessionEvent, SessionMarker, Usage } from '@wrongstack/core/types';
18
+ /**
19
+ * Upper bound on replayed conversation messages. A very long session would
20
+ * otherwise push a multi-megabyte frame on every connect; the full transcript
21
+ * remains on disk and in the session store.
22
+ */
23
+ export declare const REPLAY_MESSAGE_CAP = 2000;
24
+ export interface ReplaySource {
25
+ messages: readonly Message[];
26
+ /** Raw JSONL events, when the caller loaded them. Markers are projected from these. */
27
+ events?: readonly SessionEvent[] | undefined;
28
+ usage?: Usage | undefined;
29
+ }
30
+ export interface ReplayPayloadFields {
31
+ replayMessages?: Message[] | undefined;
32
+ replayMarkers?: SessionMarker[] | undefined;
33
+ replayUsage?: Usage | undefined;
34
+ }
35
+ /**
36
+ * Build the replay fields of a `session.start` payload. Fields are omitted
37
+ * rather than sent empty, so an existing client's "did the server send a
38
+ * replay?" checks keep working unchanged.
39
+ */
40
+ export declare function buildReplayPayload(source: ReplaySource): ReplayPayloadFields;
41
+ //# sourceMappingURL=replay-payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-payload.d.ts","sourceRoot":"","sources":["../../src/protocol/replay-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAO1F;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,OAAQ,CAAC;AAExC,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;IAC7B,uFAAuF;IACvF,MAAM,CAAC,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,CAAC;IAC7C,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,cAAc,CAAC,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;IACvC,aAAa,CAAC,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;IAC5C,WAAW,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,mBAAmB,CA8B5E"}
@@ -1,3 +1,3 @@
1
- export declare const SERVER_CONVERSATION_MESSAGE_TYPES: readonly ['error', 'log', 'pong', 'side_effects', 'agent.status_changed', 'agent.timeline.message', 'client.status_update', 'compaction.failed', 'completion.result', 'context.compacted', 'context.debug', 'context.mode.changed', 'context.modes.list', 'context.repaired', 'ctx.max_context', 'ctx.pct', 'delegate.completed', 'delegate.started', 'iteration.completed', 'iteration.limit_reached', 'iteration.started', 'model.refine_result', 'modes.list', 'provider.active_blocked', 'provider.error', 'provider.fallback', 'provider.response', 'provider.retry', 'provider.status_changed', 'provider.stream_error', 'provider.text_delta', 'provider.thinking_delta', 'run.result', 'session.checkpoints', 'session.damaged', 'session.end', 'session.rewound', 'session.start', 'session.stats', 'sessions.list', 'sessions.status_update', 'stats.get', 'token.cost_estimate_unavailable', 'token.threshold', 'tool.confirm_needed', 'tool.disabled', 'tool.enabled', 'tool.executed', 'tool.loop_detected', 'tool.progress', 'tool.started', 'tools.list', 'trust.persisted'];
1
+ export declare const SERVER_CONVERSATION_MESSAGE_TYPES: readonly ['error', 'log', 'pong', 'side_effects', 'agent.status_changed', 'agent.timeline.message', 'client.status_update', 'compaction.failed', 'completion.result', 'context.compacted', 'context.debug', 'context.editor.snapshot', 'context.editor.validation', 'context.editor.applied', 'context.mode.changed', 'context.modes.list', 'context.repaired', 'ctx.max_context', 'ctx.pct', 'delegate.completed', 'delegate.started', 'iteration.completed', 'iteration.limit_reached', 'iteration.started', 'model.refine_result', 'modes.list', 'provider.active_blocked', 'provider.error', 'provider.fallback', 'provider.response', 'provider.retry', 'provider.status_changed', 'provider.stream_error', 'provider.text_delta', 'provider.thinking_delta', 'run.result', 'session.checkpoints', 'session.damaged', 'session.end', 'session.rewound', 'session.start', 'session.stats', 'sessions.list', 'sessions.status_update', 'stats.get', 'token.cost_estimate_unavailable', 'token.threshold', 'tool.confirm_needed', 'tool.disabled', 'tool.enabled', 'tool.executed', 'tool.loop_detected', 'tool.progress', 'tool.started', 'tools.list', 'trust.persisted'];
2
2
  export declare const SERVER_COLLABORATION_MESSAGE_TYPES: readonly ['collab.annotation.added', 'collab.annotation.resolved', 'collab.event', 'collab.injection.granted', 'collab.participant.joined', 'collab.participant.left', 'collab.pause.granted', 'collab.pause.released', 'collab.state', 'mailbox.agent_registered', 'mailbox.agents', 'mailbox.cleared', 'mailbox.compacted', 'mailbox.event', 'mailbox.messages', 'mailbox.sent', 'mailbox.purged', 'mailbox.received', 'subagent.budget_extended', 'subagent.event'];
3
3
  //# sourceMappingURL=server-conversation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-conversation.d.ts","sourceRoot":"","sources":["../../src/protocol/server-conversation.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iCAAiC,YAC5C,OAAO,EACP,KAAK,EACL,MAAM,EACN,cAAc,EACd,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,WAAW,EACX,iCAAiC,EACjC,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,iBAAiB,CACT,CAAC;AAEX,eAAO,MAAM,kCAAkC,YAC7C,yBAAyB,EACzB,4BAA4B,EAC5B,cAAc,EACd,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACd,0BAA0B,EAC1B,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,EAC1B,gBAAgB,CACR,CAAC"}
1
+ {"version":3,"file":"server-conversation.d.ts","sourceRoot":"","sources":["../../src/protocol/server-conversation.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iCAAiC,YAC5C,OAAO,EACP,KAAK,EACL,MAAM,EACN,cAAc,EACd,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,WAAW,EACX,iCAAiC,EACjC,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,iBAAiB,CACT,CAAC;AAEX,eAAO,MAAM,kCAAkC,YAC7C,yBAAyB,EACzB,4BAA4B,EAC5B,cAAc,EACd,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACd,0BAA0B,EAC1B,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,EAC1B,gBAAgB,CACR,CAAC"}
@@ -1,3 +1,3 @@
1
- export declare const SERVER_KNOWLEDGE_MESSAGE_TYPES: readonly ['brain.answer', 'brain.config', 'brain.event', 'brain.status', 'chronicle.error', 'chronicle.facet_result', 'chronicle.facets_result', 'chronicle.graph_result', 'chronicle.query_result', 'config.doctor.result', 'design.list', 'design.materialize', 'design.set', 'design.state', 'design.swap', 'design.tune', 'design.use', 'design.verify', 'memory.event', 'memory.list', 'memory.sage.backfillRecoverable', 'memory.sage.candidateResolve', 'memory.sage.delete', 'memory.sage.forFile', 'memory.sage.get', 'memory.sage.graph', 'memory.sage.list', 'memory.sage.listPage', 'memory.sage.recover', 'memory.sage.remember', 'memory.sage.update'];
1
+ export declare const SERVER_KNOWLEDGE_MESSAGE_TYPES: readonly ['brain.answer', 'brain.config', 'brain.event', 'brain.status', 'chronicle.error', 'chronicle.facet_result', 'chronicle.facets_result', 'chronicle.graph_result', 'chronicle.metrics_result', 'chronicle.query_result', 'chronicle.status_result', 'config.doctor.result', 'design.list', 'design.materialize', 'design.set', 'design.state', 'design.swap', 'design.tune', 'design.use', 'design.verify', 'memory.event', 'memory.list', 'memory.sage.backfillRecoverable', 'memory.sage.candidateResolve', 'memory.sage.delete', 'memory.sage.forFile', 'memory.sage.get', 'memory.sage.graph', 'memory.sage.list', 'memory.sage.listPage', 'memory.sage.recover', 'memory.sage.remember', 'memory.sage.update'];
2
2
  export declare const SERVER_EXTENSION_MESSAGE_TYPES: readonly ['mcp.content.error', 'mcp.content.selected', 'mcp.list', 'mcp.operation_result', 'mcp.prompts', 'mcp.resources', 'mcp.server.added', 'mcp.server.connected', 'mcp.server.disconnected', 'mcp.server.discovered', 'mcp.server.error', 'mcp.server.reconnected', 'mcp.server.removed', 'mcp.server.sleeping', 'mcp.server.updated', 'mcp.server.waking', 'prompts.content', 'prompts.created', 'prompts.favorite', 'prompts.list', 'prompts.recent', 'prompts.search', 'prompts.used', 'skills.content', 'skills.created', 'skills.edited', 'skills.exported', 'skills.installed', 'skills.list', 'skills.uninstalled', 'skills.updated'];
3
3
  //# sourceMappingURL=server-integrations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-integrations.d.ts","sourceRoot":"","sources":["../../src/protocol/server-integrations.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,YACzC,cAAc,EACd,cAAc,EACd,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,YAAY,EACZ,eAAe,EACf,cAAc,EACd,aAAa,EACb,iCAAiC,EACjC,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,CACZ,CAAC;AAEX,eAAO,MAAM,8BAA8B,YACzC,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,gBAAgB,CACR,CAAC"}
1
+ {"version":3,"file":"server-integrations.d.ts","sourceRoot":"","sources":["../../src/protocol/server-integrations.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,YACzC,cAAc,EACd,cAAc,EACd,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,YAAY,EACZ,eAAe,EACf,cAAc,EACd,aAAa,EACb,iCAAiC,EACjC,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,CACZ,CAAC;AAEX,eAAO,MAAM,8BAA8B,YACzC,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,gBAAgB,CACR,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare const SERVER_GOAL_MESSAGE_TYPES: readonly ['budget.decision', 'budget.threshold_reached', 'coordinator.stats', 'coordinator.status', 'eternal.iteration', 'fleet.concurrency_update', 'goal-state.updated', 'goal.list', 'goal.paused', 'goal.resumed', 'goal.saved', 'goal.error', 'goal.stopped', 'goal.failed', 'goal.completed', 'goal.cleared', 'goal.reverted', 'goal.progress', 'goal.state', 'in_flight.ended', 'in_flight.started', 'plan.updated', 'task.completed', 'task.failed', 'task.pending', 'task.started', 'tasks.updated', 'todos.cleared', 'todos.updated'];
1
+ export declare const SERVER_GOAL_MESSAGE_TYPES: readonly ['budget.decision', 'budget.threshold_reached', 'coordinator.stats', 'coordinator.status', 'eternal.iteration', 'fleet.concurrency_update', 'goal-state.updated', 'goal.assess.result', 'goal.list', 'goal.paused', 'goal.resumed', 'goal.saved', 'goal.error', 'goal.stopped', 'goal.failed', 'goal.completed', 'goal.cleared', 'goal.reverted', 'goal.progress', 'goal.state', 'in_flight.ended', 'in_flight.started', 'plan.updated', 'task.completed', 'task.failed', 'task.pending', 'task.started', 'tasks.updated', 'todos.cleared', 'todos.updated'];
2
2
  export declare const SERVER_SDD_MESSAGE_TYPES: readonly ['kanban.task.activity', 'sdd.board.lifecycle_result', 'sdd.board.list', 'sdd.board.snapshot', 'sdd.run.started', 'sdd.spec.agent_text', 'sdd.spec.error', 'sdd.spec.snapshot', 'specs.detail', 'specs.list'];
3
3
  export declare const SERVER_AUTOMATION_MESSAGE_TYPES: readonly ['consensus.vote_cast', 'consensus.vote_initiated', 'consensus.vote_resolved', 'cron.job_fired', 'cron.snapshot', 'techstack.job.cancelled', 'techstack.job.failed', 'techstack.job.progress', 'techstack.job.started', 'techstack.report.delivered', 'techstack.report.ready', 'techstack.snapshot.updated', 'techstack.workspace.completed'];
4
4
  //# sourceMappingURL=server-operations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-operations.d.ts","sourceRoot":"","sources":["../../src/protocol/server-operations.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,YACpC,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,EAC1B,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,CACP,CAAC;AAEX,eAAO,MAAM,wBAAwB,YACnC,sBAAsB,EACtB,4BAA4B,EAC5B,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,YAAY,CACJ,CAAC;AAEX,eAAO,MAAM,+BAA+B,YAC1C,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,4BAA4B,EAC5B,+BAA+B,CACvB,CAAC"}
1
+ {"version":3,"file":"server-operations.d.ts","sourceRoot":"","sources":["../../src/protocol/server-operations.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,YACpC,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,CACP,CAAC;AAEX,eAAO,MAAM,wBAAwB,YACnC,sBAAsB,EACtB,4BAA4B,EAC5B,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,YAAY,CACJ,CAAC;AAEX,eAAO,MAAM,+BAA+B,YAC1C,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,4BAA4B,EAC5B,+BAA+B,CACvB,CAAC"}
@@ -1,3 +1,3 @@
1
- export declare const SERVER_WORKSPACE_MESSAGE_TYPES: readonly ['checkpoint.written', 'codemap.file_event', 'codemap.tool_executed', 'codemap.tool_started', 'file.saved', 'files.list', 'files.read', 'files.tree', 'files.written', 'git.changes', 'git.diff', 'git.info', 'process.list', 'projects.added', 'projects.list', 'projects.selected', 'terminal.exit', 'terminal.output', 'working_dir.changed', 'worktree.cleanup_result', 'worktree.diff_result', 'worktree.event', 'worktree.merge_result', 'worktree.orphans', 'worktree.state'];
2
- export declare const SERVER_CONFIGURATION_MESSAGE_TYPES: readonly ['auth.oauth.status', 'diag.get', 'key.operation_result', 'prefs.updated', 'provider.catalog', 'provider.models', 'provider.probe', 'providers.saved'];
1
+ export declare const SERVER_WORKSPACE_MESSAGE_TYPES: readonly ['checkpoint.written', 'codemap.file_event', 'codemap.index_updated', 'codemap.tool_executed', 'codemap.tool_started', 'file.saved', 'files.list', 'files.read', 'files.tree', 'files.written', 'git.changes', 'git.diff', 'git.info', 'process.list', 'projects.added', 'projects.list', 'projects.selected', 'terminal.exit', 'terminal.output', 'working_dir.changed', 'worktree.cleanup_result', 'worktree.diff_result', 'worktree.event', 'worktree.merge_result', 'worktree.orphans', 'worktree.state'];
2
+ export declare const SERVER_CONFIGURATION_MESSAGE_TYPES: readonly ['auth.oauth.status', 'codebase.index.server.shutdown_result', 'connections.health_error', 'connections.health_result', 'diag.get', 'key.operation_result', 'model.switch_result', 'prefs.updated', 'provider.catalog', 'provider.models', 'provider.models.search_result', 'provider.probe', 'provider.status.snapshot', 'providers.saved'];
3
3
  //# sourceMappingURL=server-workspace.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-workspace.d.ts","sourceRoot":"","sources":["../../src/protocol/server-workspace.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,YACzC,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,CACR,CAAC;AAEX,eAAO,MAAM,kCAAkC,YAC7C,mBAAmB,EACnB,UAAU,EACV,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,CACT,CAAC"}
1
+ {"version":3,"file":"server-workspace.d.ts","sourceRoot":"","sources":["../../src/protocol/server-workspace.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,YACzC,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,CACR,CAAC;AAEX,eAAO,MAAM,kCAAkC,YAC7C,mBAAmB,EACnB,uCAAuC,EACvC,0BAA0B,EAC1B,2BAA2B,EAC3B,UAAU,EACV,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,+BAA+B,EAC/B,gBAAgB,EAChB,0BAA0B,EAC1B,iBAAiB,CACT,CAAC"}
@@ -1,6 +1,10 @@
1
1
  export declare const SURFACE_PROTOCOL_VERSION: 1;
2
2
  export declare const SURFACE_PROTOCOL_MIN_VERSION: 1;
3
- export declare const SURFACE_PROTOCOL_CAPABILITIES: readonly ['protocol.directional-decoder', 'protocol.recursive-key-safety', 'chronicle.query', 'chronicle.facet', 'chronicle.facets', 'chronicle.graph'];
3
+ export declare const SURFACE_PROTOCOL_CAPABILITIES: readonly ['protocol.directional-decoder', 'protocol.recursive-key-safety', 'chronicle.query', 'chronicle.facet', 'chronicle.facets', 'chronicle.graph', 'chronicle.metrics', 'chronicle.status', 'connections.health',
4
+ /** Interview resume/discard + lastAgentText/lastRunId continuity. */
5
+ 'sdd.interview.continuity',
6
+ /** Launch multi-agent runs from a graph id or resolved spec id. */
7
+ 'sdd.run.from_graph'];
4
8
  export type SurfaceProtocolCapability = (typeof SURFACE_PROTOCOL_CAPABILITIES)[number];
5
9
  export interface ProtocolAdvertisement {
6
10
  protocolVersion?: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/protocol/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,EAAG,CAAU,CAAC;AACnD,eAAO,MAAM,4BAA4B,EAAG,CAAU,CAAC;AAEvD,eAAO,MAAM,6BAA6B,YACxC,8BAA8B,EAC9B,+BAA+B,EAC/B,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,CACT,CAAC;AAEX,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvF,MAAM,WAAW,qBAAqB;IACpC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CACtD;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EA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3,7 @@
3
3
  * to the WebUI for monitoring and editing custom roster agents.
4
4
  *
5
5
  * Message types (client → server):
6
- * agent-roster.list → { roles: string[] }
6
+ * agent-roster.list → { roles, stats, catalog }
7
7
  * agent-roster.stats → { role stats }
8
8
  * agent-roster.llm-improve { role, prompt } → LLM-suggested changes
9
9
  * agent-roster.update-identity { role, content } → saved path
@@ -12,15 +12,50 @@
12
12
  * agent-roster.create { name, role?, baseRole?, purpose, taskTypes } → cloned project role
13
13
  * agent-roster.reset { role } → removed paths
14
14
  * agent-roster.capture { role, output? } → captured count
15
+ * agent-roster.consolidate { role } → consolidation instruction + metadata
16
+ * agent-roster.save-consolidated { role, content, trigger?, model? } → saved path + stats
17
+ * agent-roster.read-consolidated { role } → consolidated content + metadata
18
+ * agent-roster.clear-consolidated { role } → cleared
15
19
  */
20
+ import type { Provider } from '@wrongstack/core/types';
16
21
  import type { WebSocket } from 'ws';
17
22
  import type { WSServerMessage } from './types.js';
23
+ /**
24
+ * Resolved LLM handle used for headless (chat-free) consolidation. Both the
25
+ * embedded and standalone routers can supply this from the active agent
26
+ * context (`agent.ctx.provider` / `agent.ctx.model`).
27
+ */
28
+ export interface AgentRosterLlm {
29
+ provider: Provider;
30
+ model: string;
31
+ }
18
32
  export interface AgentRosterHandlerOptions {
19
33
  projectRoot: string | (() => string);
34
+ /**
35
+ * Resolves the LLM used to synthesize consolidations directly on the server,
36
+ * without routing the instruction back through the chat loop. When it
37
+ * returns undefined (no active model), the handler degrades gracefully to
38
+ * returning the instruction for a caller-driven consolidation.
39
+ */
40
+ getLlm?: () => AgentRosterLlm | undefined;
41
+ /**
42
+ * Broadcasts a message to every connected client. Used to push
43
+ * `agent-roster.updated` after a headless consolidation so other open
44
+ * clients refresh the affected roster card without a manual reload.
45
+ */
46
+ broadcast?: (msg: WSServerMessage) => void;
20
47
  }
21
48
  export declare class AgentRosterWSHandler {
22
49
  private readonly getProjectRoot;
50
+ private readonly getLlm;
51
+ private readonly broadcast;
23
52
  constructor(opts: AgentRosterHandlerOptions);
53
+ /**
54
+ * Run the consolidation LLM synthesis headlessly and return the cleaned
55
+ * document text. Returns undefined when no LLM is available so the caller
56
+ * can fall back to the instruction-only path.
57
+ */
58
+ private synthesizeConsolidation;
24
59
  /** Handle an incoming client message. Returns a response payload. */
25
60
  handleMessage(_ws: WebSocket, type: string, payload: unknown): Promise<WSServerMessage>;
26
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"agent-roster-handlers.d.ts","sourceRoot":"","sources":["../../src/server/agent-roster-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAsBH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAC;CACtC;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAe;IAE9C,YAAY,IAAI,EAAE,yBAAyB,EAG1C;IAED,qEAAqE;IAC/D,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAmP5F;CACF"}
1
+ {"version":3,"file":"agent-roster-handlers.d.ts","sourceRoot":"","sources":["../../src/server/agent-roster-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA6BH,OAAO,KAAK,EAAE,QAAQ,EAAW,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,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le';
2
2
  import type { WebSocket } from 'ws';
3
3
  import type { WSClientMessage, WSServerMessage } from './types.js';
4
- export type ChronicleRouteEngine = Pick<ChronicleQueryEngine, 'query' | 'facet' | 'facets' | 'graph' | 'diagnostics'>;
5
4
  export interface ChronicleRouteContext {
6
5
  getProjectRoot: () => string;
7
6
  send: (ws: WebSocket, message: WSServerMessage) => void;
8
- getEngine?: (() => Promise<ChronicleRouteEngine>) | undefined;
7
+ getChronicleAccess?: (() => Pick<ChronicleProjectAccess, 'mode' | 'call'>) | undefined;
9
8
  }
10
9
  /** Canonical Chronicle query/facet/graph handler shared by every WebUI host. */
11
10
  export declare function handleChronicleRoute(ctx: ChronicleRouteContext, ws: WebSocket, message: WSClientMessage): Promise<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"chronicle-routes.d.ts","sourceRoot":"","sources":["../../src/server/chronicle-routes.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,oBAAoB,EACpB,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,CACvD,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,MAAM,CAAC;IAC7B,IAAI,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IACxD,SAAS,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,oBAAoB,CAAC,CAAC,GAAG,SAAS,CAAC;CAC/D;AAyBD,gFAAgF;AAChF,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,qBAAqB,EAC1B,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,OAAO,CAAC,CA4ElB"}
1
+ {"version":3,"file":"chronicle-routes.d.ts","sourceRoot":"","sources":["../../src/server/chronicle-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,sBAAsB,EAG5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,MAAM,CAAC;IAC7B,IAAI,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IACxD,kBAAkB,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;CACxF;AAwBD,gFAAgF;AAChF,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,qBAAqB,EAC1B,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,OAAO,CAAC,CA0LlB"}
@@ -1,4 +1,4 @@
1
- import { GlobalMailbox } from '@wrongstack/core/coordination';
1
+ import { type RemoteMailbox } from '@wrongstack/core/coordination';
2
2
  import type { Config } from '@wrongstack/core/types';
3
3
  import type { CreateHqPublisherOptions, HqPublisher } from '@wrongstack/core/hq';
4
4
  import type { EventBus } from '@wrongstack/core/kernel';
@@ -16,7 +16,7 @@ export interface WebuiClientPresenceDeps {
16
16
  hqSessionId: string;
17
17
  getSessionId: () => string;
18
18
  startHqConnection: (options: WebuiHqConnectionOptions) => WebuiHqConnection;
19
- createCommandHandler?: ((mailbox: GlobalMailbox) => NonNullable<CreateHqPublisherOptions['onCommand']>) | undefined;
19
+ createCommandHandler?: ((mailbox: RemoteMailbox) => NonNullable<CreateHqPublisherOptions['onCommand']>) | undefined;
20
20
  }
21
21
  export interface WebuiClientPresence {
22
22
  register(): Promise<string | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"client-presence.d.ts","sourceRoot":"","sources":["../../src/server/client-presence.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EAEd,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EACV,wBAAwB,EAExB,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAIxD,MAAM,WAAW,iBAAiB;IAChC,YAAY,IAAI,WAAW,GAAG,SAAS,CAAC;IACxC,IAAI,IAAI,IAAI,CAAC;CACd;AAED,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,wBAAwB,EAAE,eAAe,CAAC,GAAG;IACvF,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,WAAW,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC5D,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,MAAM,EAAE,QAAQ,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,iBAAiB,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,iBAAiB,CAAC;IAC5E,oBAAoB,CAAC,EACjB,CAAC,CAAC,OAAO,EAAE,aAAa,KAAK,WAAW,CAAC,wBAAwB,CAAC,WAAW,CAAC,CAAC,CAAC,GAChF,SAAS,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACnC,UAAU,IAAI,IAAI,CAAC;CACpB;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,uBAAuB,GAAG,mBAAmB,CAsF5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,15 @@
1
+ import type { TrustBoundary } from '@wrongstack/core/security';
2
+ import type { Logger } from '@wrongstack/core/types';
3
+ import type { WebSocket } from 'ws';
4
+ import type { WSClientMessage, WSServerMessage } from './types.js';
5
+ export interface CodebaseIndexServerControlDeps {
6
+ trustBoundary: TrustBoundary;
7
+ logger?: Logger | undefined;
8
+ getProjectRoot(): string;
9
+ getIndexDir(): string | undefined;
10
+ send(ws: WebSocket, message: WSServerMessage): void;
11
+ backend: 'standalone' | 'cli-embedded';
12
+ }
13
+ /** Handle the WebSocket control message that stops this project's index server. */
14
+ export declare function handleCodebaseIndexServerControl(ws: WebSocket, message: WSClientMessage, deps: CodebaseIndexServerControlDeps): Promise<boolean>;
15
+ //# sourceMappingURL=codebase-index-server-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codebase-index-server-control.d.ts","sourceRoot":"","sources":["../../src/server/codebase-index-server-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,WAAW,8BAA8B;IAC7C,aAAa,EAAE,aAAa,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,cAAc,IAAI,MAAM,CAAC;IACzB,WAAW,IAAI,MAAM,GAAG,SAAS,CAAC;IAClC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IACpD,OAAO,EAAE,YAAY,GAAG,cAAc,CAAC;CACxC;AAED,mFAAmF;AACnF,wBAAsB,gCAAgC,CACpD,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,8BAA8B,GACnC,OAAO,CAAC,OAAO,CAAC,CA2ClB"}
@@ -1 +1 @@
1
- {"version":3,"file":"codebase-indexing.d.ts","sourceRoot":"","sources":["../../src/server/codebase-indexing.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAuBrE,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE;QAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,SAAS,CAAA;KAAE,CAAC;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,yBAAyB,GAAG,qBAAqB,CA4IjG"}
1
+ {"version":3,"file":"codebase-indexing.d.ts","sourceRoot":"","sources":["../../src/server/codebase-indexing.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAoBrE,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE;QAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,SAAS,CAAA;KAAE,CAAC;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,yBAAyB,GAAG,qBAAqB,CAgLjG"}
@@ -0,0 +1,14 @@
1
+ export interface CodemapCacheEntry {
2
+ version: string;
3
+ /** Pre-serialized JSON body — avoids re-stringify on cache hits. */
4
+ body: string;
5
+ }
6
+ /** Filesystem fingerprint of the index DB used as the cache generation key. */
7
+ export declare function indexDbVersion(projectRoot: string, indexDir?: string): string;
8
+ export declare function codemapCacheKey(projectRoot: string, indexDir: string | undefined, scope: string): string;
9
+ export declare function getCachedCodemapBody(key: string, version: string): string | undefined;
10
+ export declare function setCachedCodemapBody(key: string, version: string, body: string): void;
11
+ /** Test / process-shutdown helper. */
12
+ export declare function clearCodemapGraphCache(): void;
13
+ export declare function codemapGraphCacheSize(): number;
14
+ //# sourceMappingURL=codemap-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codemap-cache.d.ts","sourceRoot":"","sources":["../../src/server/codemap-cache.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;CACd;AAID,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ7E;AAED,wBAAgB,eAAe,CAC7B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,KAAK,EAAE,MAAM,GACZ,MAAM,CAER;AAED,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAWpB;AAED,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACX,IAAI,CAQN;AAED,sCAAsC;AACtC,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C"}
@@ -2,9 +2,8 @@
2
2
  * CodeMap HTTP handlers — serve the dependency graph at three drill-down
3
3
  * levels (package → file → symbol) from the codebase index SQLite store.
4
4
  *
5
- * Each handler opens a short-lived `IndexStore`, queries the graph, and
6
- * returns JSON. The graph data feeds the React Flow `CodeMap` component
7
- * in the WebUI.
5
+ * Each handler queries via the graph services and returns JSON. Results are
6
+ * cached in-process and invalidated when `index.db` mtime/size changes.
8
7
  *
9
8
  * Endpoints:
10
9
  * GET /api/codemap/packages — package-level graph
@@ -18,9 +17,9 @@ export interface CodemapHandlerDeps {
18
17
  indexDir?: string | undefined;
19
18
  }
20
19
  /** GET /api/codemap/packages — workspace-level package dependency graph. */
21
- export declare function handleCodemapPackages(res: http.ServerResponse, deps: CodemapHandlerDeps): void;
20
+ export declare function handleCodemapPackages(res: http.ServerResponse, deps: CodemapHandlerDeps): Promise<void>;
22
21
  /** GET /api/codemap/files?package=<name> — file-level graph within a package. */
23
- export declare function handleCodemapFiles(res: http.ServerResponse, deps: CodemapHandlerDeps, pkg: string): void;
22
+ export declare function handleCodemapFiles(res: http.ServerResponse, deps: CodemapHandlerDeps, pkg: string): Promise<void>;
24
23
  /** GET /api/codemap/symbols?file=<path> — symbol-level graph within a file. */
25
- export declare function handleCodemapSymbols(res: http.ServerResponse, deps: CodemapHandlerDeps, file: string): void;
24
+ export declare function handleCodemapSymbols(res: http.ServerResponse, deps: CodemapHandlerDeps, file: string): Promise<void>;
26
25
  //# sourceMappingURL=codemap-handlers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codemap-handlers.d.ts","sourceRoot":"","sources":["../../src/server/codemap-handlers.ts"],"names":[],"mappings":"AAAA;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B;;;;;;OAMG;IACH,OAAO,CAAC,0BAA0B;CAgCnC"}
@@ -1,5 +1,5 @@
1
1
  import type { Context } from '@wrongstack/core/agent';
2
- import type { Message, TokenCounter, Usage } from '@wrongstack/core/types';
2
+ import type { Message, SessionEvent, TokenCounter, Usage } from '@wrongstack/core/types';
3
3
  import type { WebSocket } from 'ws';
4
4
  import type { CollaborationWebSocketHandler } from './collaboration-ws-handler.js';
5
5
  import type { GoalWebSocketHandler } from './goal-ws-handler.js';
@@ -17,6 +17,7 @@ export interface ConnectionHandlerOptions {
17
17
  context: Context;
18
18
  loadReplay?: (() => Promise<{
19
19
  messages: Message[];
20
+ events?: readonly SessionEvent[] | undefined;
20
21
  usage?: Usage | undefined;
21
22
  } | null>) | undefined;
22
23
  clients: Map<WebSocket, ConnectedClient>;
@@ -29,6 +30,13 @@ export interface ConnectionHandlerOptions {
29
30
  collabHandler: CollaborationWebSocketHandler;
30
31
  terminalHandler: TerminalWebSocketHandler;
31
32
  handleMessage: (ws: WebSocket, client: ConnectedClient, msg: WSClientMessage) => Promise<void>;
33
+ /**
34
+ * Forwarded to the connection lifecycle as `onSecurityRejection`. When set,
35
+ * the callback fires on every `unsafe_key` or `too_deep` decoder rejection
36
+ * with connection-context details. See the lifecycle option's doc comment
37
+ * for design constraints (fire-and-forget, no await).
38
+ */
39
+ onSecurityRejection?: (event: import('./connection-lifecycle.js').SecurityRejectionEvent) => void;
32
40
  }
33
41
  export declare function createConnectionHandler(options: ConnectionHandlerOptions): (ws: WebSocket) => void;
34
42
  //# sourceMappingURL=connection-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection-handler.d.ts","sourceRoot":"","sources":["../../src/server/connection-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,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AAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACxD,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EACP,CAAC,MAAM,OAAO,CAAC;QACb,QAAQ,EAAE,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,CAAC;QAC7C,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;KAC3B,GAAG,IAAI,CAAC,CAAC,GACV,SAAS,CAAC;IACd,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IACzC,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC7C,WAAW,EAAE,oBAAoB,CAAC;IAClC,YAAY,EAAE,qBAAqB,CAAC;IACpC,eAAe,EAAE,wBAAwB,CAAC;IAC1C,gBAAgB,EAAE,yBAAyB,CAAC;IAC5C,eAAe,EAAE,wBAAwB,CAAC;IAC1C,aAAa,EAAE,6BAA6B,CAAC;IAC7C,eAAe,EAAE,wBAAwB,CAAC;IAC1C,aAAa,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,2BAA2B,EAAE,sBAAsB,KAAK,IAAI,CAAC;CACnG;AAsBD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,wBAAwB,GAChC,CAAC,EAAE,EAAE,SAAS,KAAK,IAAI,CAoFzB"}
@@ -15,6 +15,42 @@ type DecodeResult<Message> = {
15
15
  ok: false;
16
16
  issue: ProtocolIssue;
17
17
  };
18
+ /**
19
+ * Payload delivered to the `onSecurityRejection` callback when the decoder
20
+ * trips a security-relevant issue code (`unsafe_key` or `too_deep`).
21
+ */
22
+ export interface SecurityRejectionEvent {
23
+ /** Decoder issue code that triggered the alert. */
24
+ issueCode: string;
25
+ /** Human-readable issue message from the decoder. */
26
+ issueMessage: string;
27
+ /** Event name logged alongside this rejection. */
28
+ eventName: string;
29
+ /** Per-connection id — `undefined` when the client lacks this field. */
30
+ connectionId?: string;
31
+ /** Session id bound to this connection — `null` when the client has none. */
32
+ sessionId?: string | null;
33
+ /** Agent id from the server-wide client context. */
34
+ agentId?: string;
35
+ /** Project root from the server-wide client context. */
36
+ projectRoot?: string;
37
+ }
38
+ /**
39
+ * Minimum shape a client must expose for verbose logging to attach
40
+ * per-connection identity to rejection logs. The connection lifecycle
41
+ * reads these fields defensively (`?.connId`, `?.sessionId`), so any
42
+ * subset is fine — but consumers should declare the shape on their
43
+ * `Client` type to make the contract explicit and avoid silent drops
44
+ * when fields are renamed.
45
+ */
46
+ export interface ClientWithConnectionInfo {
47
+ /** Unique per-connection id — defaults to `undefined` when absent. */
48
+ connId?: string;
49
+ /** Session id bound to this connection — may be `null` when not yet known. */
50
+ sessionId?: string | null;
51
+ /** Remote socket address captured when the connection is accepted. */
52
+ remoteAddress?: string;
53
+ }
18
54
  export interface ConnectionLifecycleOptions<Client, Request, Message> {
19
55
  clients: Map<WebSocket, Client>;
20
56
  pendingConfirms: Map<string, PendingConfirm>;
@@ -32,7 +68,47 @@ export interface ConnectionLifecycleOptions<Client, Request, Message> {
32
68
  rateLimitWindowMs?: number;
33
69
  confirmDrainGraceMs?: number;
34
70
  rateLimitMessage?: string;
71
+ /**
72
+ * Enrich rejection/parse-failure logs with per-connection context so the
73
+ * server can identify the sender of unknown client message types. When
74
+ * false (default), the original `{ level, event, message }` shape is
75
+ * preserved for back-compat with downstream log consumers.
76
+ */
77
+ verboseWsLogging?: boolean;
78
+ /**
79
+ * Connection-level context attached to verbose rejection logs. Note that
80
+ * per-connection identity (`connectionId`, `sessionId`) is sourced from the
81
+ * `client` argument of `logRejection` directly, so it does not need to be
82
+ * duplicated here.
83
+ */
84
+ clientContext?: {
85
+ agentId?: string;
86
+ projectRoot?: string;
87
+ };
88
+ /**
89
+ * Optional consumer-supplied log sink. Honored by every error-emitting
90
+ * branch (`webui_server.client_socket_error`, `message_handler_failed`,
91
+ * `session_start_payload_failed`, and the verbose rejection path under
92
+ * `verboseWsLogging`). The `error` argument is typed `unknown` and is the
93
+ * standard Error / string for the three standard branches, while the
94
+ * verbose rejection branch passes the enriched structured payload object
95
+ * (with `connectionId`, `sessionId`, `agentId`, `code`, `type`, etc.) so
96
+ * downstream sinks can index/filter on the extra fields.
97
+ */
35
98
  log?: (level: 'warn' | 'error', event: string, error: unknown) => void;
99
+ /**
100
+ * Called when the decoder reports a security-tripwire issue code
101
+ * (`unsafe_key` or `too_deep`). The caller (typically `start-webui.ts`
102
+ * via the connection handler) can use this to send a `to:'*' audience:'leaders'`
103
+ * mailbox message so the running agent-loop is notified immediately of
104
+ * possible exploit attempts or runaway payloads.
105
+ *
106
+ * The callback is fire-and-forget from the lifecycle's perspective: it is
107
+ * invoked with bare `void` (no await) so a slow or throwing consumer never
108
+ * delays the message handler. Wrap any async work in a promise that is
109
+ * intentionally not awaited.
110
+ */
111
+ onSecurityRejection?: ((event: SecurityRejectionEvent) => void) | undefined;
36
112
  }
37
113
  /**
38
114
  * Canonical WebSocket lifecycle: protection, auth, registration, protocol