Claus Ibsen created CAMEL-25259:
-----------------------------------

             Summary: DSL extensions - a model, catalog kind and SPI for the 
mini DSLs features add to route files (design)
                 Key: CAMEL-25259
                 URL: https://issues.apache.org/jira/browse/CAMEL-25259
             Project: Camel
          Issue Type: New Feature
          Components: camel-core-api, camel-jbang, camel-ai
            Reporter: Claus Ibsen


A feature can add its own declarations to route files, a small DSL of its own 
beside the routes. camel-semantic is the first: its questions are written as 
{{- semantic:}} in YAML, {{<semantic>}} in XML, and 
{{semanticQuestions(this)...register()}} in Java.

Today the shape of such a mini DSL is described three times, by hand:
* {{@YamlType}} schema stubs for YAML;
* a hand-written XML parser, without an XSD;
* a Java builder.

The YAML DSL schema only picks it up because the camel-yaml-dsl build lists 
camel-semantic as a plugin dependency, which is specific to this one feature. 
Nothing in the catalog describes it, so camel-jbang (dependency detection, 
conversion, validation), the MCP tools, the source editor and AI agents do not 
know it exists.

This ticket is the design for making these "DSL extensions" first class, 
written as {{design/dsl-extensions.adoc}}:
* one annotated model in the feature's own module as the source of truth;
* the YAML schema, XSD and catalog JSON generated from it;
* a new catalog kind with samples in each DSL;
* a runtime SPI for tooling that reads route files without running them 
(CAMEL-25257).

camel-jbang, the MCP tools, the validator and the source editor then learn 
about an extension from the catalog, with no code specific to the feature.

One goal is that agentic coding with a local model (one that knows nothing 
about semantic or system-one models) can write such declarations correctly. 
That needs the same closed contract, sample and validation loop it already has 
for EIPs.

Design first; implementation tickets follow once it is agreed.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to