davsclaus opened a new pull request, #29661: URL: https://github.com/apache/camel/pull/29661
Found while walking the tabs for [CAMEL-26864](https://issues.apache.org/jira/browse/CAMEL-26864): `tui_get_diagram` has returned "No diagram available" every time since #23772 removed the text diagram, as `DiagramTab.getTableDataAsJson` returns null. It now returns the diagram the Diagram tab draws, as JSON, at the level the tab is at (`level`), so an agent can read it, or sketch it in any way it likes or is asked to: - **architecture:** the groups, each with its `name`, `routes`, `entryPoints`, `systems` and AI text, and the links between them - **topology:** the routes and their edges, as `tui_get_topology` has them - **route:** the steps of the route in the order they are drawn, each with `id`, `type`, `label`, its `parent` and its `children` in order (the branches of a `choice` are its children), `uri`, the source `line`, and its numbers Each box says where it is drawn: `row`, `col`, `height` and `width` in characters, with the top left box at 0,0. A box folded away has no position. From the hello integration of the issue, at the route level: ``` hello from row 0 col 22 children setBody1, choice1 setBody1 setBody row 4 col 22 choice1 choice row 9 col 22 children when1, otherwise1 when1 when row 14 col 0 children to1 to1 to row 18 col 0 (5 exchanges) otherwise1 otherwise row 14 col 44 children log1 log1 log row 18 col 44 (41 exchanges) ``` The code is in a new `DiagramJson`, as `DiagramSupport` is at its size cap. `tui_get_table` on the Diagram tab gives the same. The tool's description is kept short, as the full prompt of the AI panel is at its token budget (`AiPanelPromptBudgetTest`). Checked live on all three levels against the integration of the issue. Tests: `DiagramJsonTest`. _Claude Code on behalf of Claus Ibsen_ 🤖 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]
