davsclaus opened a new pull request, #29596:
URL: https://github.com/apache/camel/pull/29596
_Claude Code on behalf of davsclaus_
From walking the contracts and AI examples in the TUI.
**Contract-first REST in About (camel-jbang-core)**
contracts/openapi-server serves `stock-api.json` with
```yaml
- rest:
openApi:
specification: stock-api.json
```
and About said "nothing from outside": the source analysis read the REST
verbs written in the DSL, not the contract.
- New `RestContracts`: the readers (YAML, XML, Java) record the contract,
and `ProjectOverview.analyze`, which knows the project directory, reads it
(JSON or YAML, in the project or next to the route file) and puts a REST
operation per operation of the contract in its place: the method, the path
under the server path of the contract (`servers: url:
http://localhost:8080/api` → `/api/stock/{sku}`), and `direct:<operationId>`.
About, the diagram and the summary get the operations as they get a REST DSL
written out. A contract that is not there has no operations.
- `RouteComponents` names `rest` and `rest-openapi` for it.
- About's Last 5m leaves out the route Camel adds to serve a contract (`from
rest-openapi:`), which hands each request to the route of its operation: 6
reservations were counted as 12 exchanges.
Live: In has `GET /api/stock`, `GET /api/stock/{sku}` and `POST
/api/stock/{sku}/reserve` (6 calls from openapi-client), and Last 5m says 6
exchanges.
**AI tool icon**
In has 🤖 for an AI tool (`ai-tool:stock_level` of ai/mcp-server) and an AI
model, not `•`.
**`tui_send_message` returns the answer**
It answered only `success`. It now sends InOut to a `direct:` route, which
the send waits for anyway, and returns the answer under `message` (`"body":
{"value": "Hello Claus!"}` from showcase/tui-hello-world). A new `reply`
argument decides for other endpoints; over a broker InOut is request-reply, so
it is off by default there. `RuntimeHelper.sendMessage` has the overload.
Tests: `RestContractsTest` (YAML, XML, Java, a missing contract, the
components), `AboutViewTest.theOperationsOfAContractComeInAndAreCountedOnce`,
`aRouteAnAiAgentCallsAsAToolHasTheIconOfAi`,
`RuntimeHelperTest.aSendWithReplyAsksForTheAnswerOfTheRoute`,
`aSendWithoutReplyDoesNotWaitForAnAnswer`. camel-jbang-core and the TUI suite
pass locally (except the two `DoctorRepositoryTest` failures of my local
repository setup). The tool schemas stay within the prompt budget of
`AiPanelPromptBudgetTest`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]