Class DemoResource

java.lang.Object
ai.redouble.demo.quarkus.DemoResource

@Path("/") public class DemoResource extends Object
The doors of the demo under Quarkus: the same engine the Spring host serves, behind JAX-RS instead of Spring MVC. The read-side (GET /status, /skills, /agent) is computed by the shared DemoApi, and the catalog lifecycle the page drives (POST /connect, /discover, /catalog/entry, /catalog/order, /catalog/pin) by the shared CatalogAdmin over this host's SessionCredentials, so neither can drift from the Spring host or the page; this class maps the routes to them and maps a refusal to its status code, carrying the rule it broke as {"message": ...}. The write-side that runs a job, where a request builds a Tool or a Doer and submits it to the dispatcher, is the demonstration of using the runtime under Quarkus and lives here: POST /ask runs the quick-question tool, POST /agent runs the demo agent, and POST /extract, /search and /pricing are the extraction demo. A refusal comes back with the runtime's own message, which says what to provide.
Since:
0.1 (2026-09-22)
Author:
Andrey Santrosyan
  • Constructor Details

  • Method Details

    • skills

      @GET @Path("skills") @Produces("application/json") public List<SkillEntry> skills()
    • agent

      @GET @Path("agent") @Produces("application/json") public AgentCapabilities agent()
    • agent

      @POST @Path("agent") @Consumes("application/json") @Produces("application/x-ndjson") public jakarta.ws.rs.core.Response agent(AgentRequest input)
      The demo agent run, streamed as it happens: the engine's AgentTrace writes the lines to a queue, and the response drains the queue until the trace ends it, the same as the Spring host's stream and the decision run below. The grade is the caller's; the agent declares MEDIUM and a request naming a rung runs it there.
    • benchmark

      @POST @Path("benchmark") @Consumes("application/json") @Produces("application/x-ndjson") public jakarta.ws.rs.core.Response benchmark(BenchmarkRequest input)
      The benchmark, streamed as it runs: the demo agent wrapped in the runtime's Benchmark, one query answered on the strongest model the deployment serves and then on every open model of every rung, judged blind, through the engine's BenchmarkRace. Refused before the stream opens when no model can race, since that race could only fail.
    • status

      @GET @Path("status") @Produces("application/json") public RuntimeStatus status()
    • connect

      @POST @Path("connect") @Consumes("application/json") @Produces("application/json") public ConnectOutcome connect(ConnectRequest input)
      Credentials pasted into the page, held for this process only (SessionCredentials: a runtime config source, never a file, never echoed back), then tested right then. The shared CatalogAdmin holds the rules and the answer rides back with the fresh status.
    • discover

      @POST @Path("discover") @Produces("application/json") public DiscoverOutcome discover()
      The discovery, on a click instead of a terminal: the shared CatalogAdmin lists and pings only the providers whose credentials are new or changed this session, writes the result to the deployment's models.json and adopts it live. The click is the authorization.
    • editEntry

      @POST @Path("catalog/entry") @Consumes("application/json") @Produces("application/json") public RuntimeStatus editEntry(EntryEdit edit)
      One entry of the deployment's own catalog file, edited from the page: its grade, its status (OPEN or DISABLED), its input or output price, or a confirmation of its inferred facts; a null leaves the field alone. A refused edit is a 400; an edit with no file of the deployment's own to land in is a 409.
    • pin

      @POST @Path("catalog/pin") @Consumes("application/json") @Produces("application/json") public RuntimeStatus pin(PinEdit edit)
      One pin of the deployment's own catalog file, set or cleared from the page: the embeddings entry or the decision entry.
    • order

      @POST @Path("catalog/order") @Consumes("application/json") @Produces("application/json") public RuntimeStatus order(OrderEdit edit)
      One grade's order of the deployment's own catalog file, set from the page or cleared.
    • ask

      @POST @Path("ask") @Consumes("application/json") @Produces("application/json") public QuickAnswer ask(QuickLLMQuestionInput input)
    • extract

      @POST @Path("extract") @Consumes("application/json") @Produces("application/json") public ExtractReport extract(ExtractRequest input)
    • search

      @POST @Path("search") @Consumes("application/json") @Produces("application/json") public List<FileIndex.Hit> search(DemoResource.SearchRequest input)
    • pricing

      @POST @Path("pricing") @Consumes("application/json") @Produces("application/json") public PricingReport pricing(PricingRequest input)
    • decidePrices

      @POST @Path("decide-prices") @Consumes("application/json") @Produces("application/json") public PricingReport decidePrices(PricingRequest input)
      The pricing run with its grouping put to a decision model: the same doer, reading tier and report, the names grouped by verdicts.
    • decide

      @GET @Path("decide") @Produces("application/json") public DecideCapabilities decide()
    • decideRun

      @POST @Path("decide") @Produces("application/x-ndjson") public jakarta.ws.rs.core.Response decideRun()
      The decision agent run, streamed as it happens: the engine's DecisionTrace writes the lines to a queue, and the response drains the queue until the trace ends it. The stream ends from the run's own terminal event; the handle's holder ends it itself only when that event never reached the stream, as the Spring host does.