Class DemoResource
java.lang.Object
ai.redouble.demo.quarkus.DemoResource
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA refusal body in the shape the page reads: the rule it broke undermessage.static final record -
Constructor Summary
ConstructorsConstructorDescriptionDemoResource(NucleoRuntime runtime, FileIndex index, CatalogAdmin admin, com.fasterxml.jackson.databind.ObjectMapper json, DemoCorpus corpus) -
Method Summary
Modifier and TypeMethodDescriptionagent()jakarta.ws.rs.core.Responseagent(AgentRequest input) The demo agent run, streamed as it happens: the engine'sAgentTracewrites 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.ask(QuickLLMQuestionInput input) jakarta.ws.rs.core.Responsebenchmark(BenchmarkRequest input) The benchmark, streamed as it runs: the demo agent wrapped in the runtime'sBenchmark, one query answered on the strongest model the deployment serves and then on every open model of every rung, judged blind, through the engine'sBenchmarkRace.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.decide()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.jakarta.ws.rs.core.ResponseThe decision agent run, streamed as it happens: the engine'sDecisionTracewrites the lines to a queue, and the response drains the queue until the trace ends it.discover()The discovery, on a click instead of a terminal: the sharedCatalogAdminlists and pings only the providers whose credentials are new or changed this session, writes the result to the deployment'smodels.jsonand adopts it live.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.extract(ExtractRequest input) One grade's order of the deployment's own catalog file, set from the page or cleared.One pin of the deployment's own catalog file, set or cleared from the page: the embeddings entry or the decision entry.pricing(PricingRequest input) search(DemoResource.SearchRequest input) skills()status()
-
Constructor Details
-
DemoResource
@Inject public DemoResource(NucleoRuntime runtime, FileIndex index, CatalogAdmin admin, com.fasterxml.jackson.databind.ObjectMapper json, DemoCorpus corpus)
-
-
Method Details
-
skills
-
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'sAgentTracewrites 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'sBenchmark, one query answered on the strongest model the deployment serves and then on every open model of every rung, judged blind, through the engine'sBenchmarkRace. Refused before the stream opens when no model can race, since that race could only fail. -
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 sharedCatalogAdminholds the rules and the answer rides back with the fresh status. -
discover
The discovery, on a click instead of a terminal: the sharedCatalogAdminlists and pings only the providers whose credentials are new or changed this session, writes the result to the deployment'smodels.jsonand 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
-
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'sDecisionTracewrites 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.
-