Class: Ask::CodingHarness::Server
- Inherits:
-
Roda
- Object
- Roda
- Ask::CodingHarness::Server
- Defined in:
- lib/ask/coding_harness/server.rb
Overview
HTTP API + static file server for the coding harness.
Endpoints:
GET /api/config — models, adapter, workspace, features
GET /api/workspace — workspace name, root, git branch
GET /api/conversations — list conversations (archived filter)
GET /api/conversations/:id — conversation with messages
PATCH /api/conversations/:id — rename
DELETE /api/conversations/:id — delete
POST /api/conversations/:id/archive — toggle archive
PATCH/DELETE /api/conversations/:id/messages/:index — edit/trim
POST /api/chat — send a message, stream events via SSE
POST /api/conversations/:id/approvals/:actionId/approve|reject
POST /api/conversations/:id/approvals/approve-all
POST /api/conversations/:id/plan/approve|reject
POST /api/conversations/:id/abort
GET /* — static frontend (PWA), SPA fallback
Class Method Summary collapse
-
.build(config:, store:, runner:) ⇒ Object
Build a server instance wired to the given components.
-
.public_dir ⇒ Object
Built frontend (PWA).
Class Method Details
.build(config:, store:, runner:) ⇒ Object
Build a server instance wired to the given components. Tests build servers with fakes; the CLI builds with the real store + runner.
54 55 56 57 58 59 60 |
# File 'lib/ask/coding_harness/server.rb', line 54 def self.build(config:, store:, runner:) Class.new(self) do define_method(:harness_config) { config } define_method(:harness_store) { store } define_method(:harness_runner) { runner } end end |
.public_dir ⇒ Object
Built frontend (PWA). Shipped inside the gem.
28 29 30 |
# File 'lib/ask/coding_harness/server.rb', line 28 def self.public_dir File.("../../../public", __dir__) end |