davsclaus opened a new pull request, #26680:
URL: https://github.com/apache/camel/pull/26680
## Summary
The init block of a simple expression (`$init{ ... }init$`) assigns local
variables with `:=` and declares local custom functions with `~:=` (usually a
`~>` chain), but the catalog had no operator entry for either — `simple.json`
knew `~>` and `?~>` (with examples) and nothing else. So nothing that reads the
catalog knew the init block existed: `camel_catalog_doc` / `tui_catalog_doc`
(the `operatorSyntax` summary and `optionsFilter`), the generated JS validator,
the MCP server and any external agent fetching the catalog. The docs were the
only source, and `docPage=advanced` is the whole 24 KB simple-advanced page.
- `SimpleOperatorConstants`: `:=` and `~:=` declared with `kind=init`,
syntax and complete examples (the blog's `cleanName` and the unit test's
`clean`/`count`), regenerated into `simple.json` and the JS validator (which
only tokenises binary/logical kinds, so the new kind is data only).
- `camel_catalog_doc simple optionsFilter=init` now returns both operators
in full (~150 tokens); the unfiltered summary lists `$name := expr;` and `$name
~:= expr ~> expr;` — test added in `CatalogDocsTest`.
- Docs: the two operators in the operators table with links to the init
block sections; the unfinished sentence, `a lso` and `$nane` fixed in "Init
Blocks with custom functions".
Deliberately **not** in this PR (recorded on the JIRA): an always-on primer
line in the TUI system prompt and init-block special-casing in `AnswerChecks` —
they would cost tokens on every turn for a feature a local-model user asks for
rarely, and there is no observed failure yet; the catalog entry is fetched only
when asked. The multi-line (`expression: |`) gap in `camel validate yaml` found
during the analysis is
[CAMEL-24875](https://issues.apache.org/jira/browse/CAMEL-24875).
## Tests
`CatalogDocsTest`, `CatalogDocExamplesTest`, `CamelCatalogTest`,
`CamelCatalogJsonSchemaTest`, `DocExamplesXmlSchemaTest`,
`DocExamplesJavaImportsTest` pass.
_Claude Code on behalf of davsclaus_
🤖 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]