lsp-preview_mutation
Preview an in-memory SDK mutation of an ExerisDomain source file and get a unified diff with outcome details before applying changes yourself.
Instructions
Preview how the SDK's canonical writer would change an @ExerisDomain source file for one mutation, applied in memory. Returns { result, sourcePath, diff }: a unified diff and the SDK outcome in result.outcome — SUCCESS, CONFLICT (the source drifted from the baseline; the result carries baseline, current and intended values), VALIDATION_ERROR, or NO_BASELINE. Nothing is written: apply the diff with your own file tools. For a stale-free preview, pass the entity's last-emitted metadata as baselineJson and the sourceDigest from lsp-describe_domain as concurrencyToken.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"qualifiedName": "<qualifiedName>",
"op": "<op>"
},
"name": "lsp-preview_mutation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | One SDK MutationOp, discriminated by `op`: addField, removeField, renameField, changeFieldType, addRelationship, removeRelationship, changeRelationshipCardinality, addAction, removeAction. Every op carries a `path`, e.g. {"op":"renameField","path":"/entities/Order/fields/total","newName":"amount"}. | |
| baselineJson | No | The entity's last-emitted `target/classes/exeris-metadata/<entity>.json` (see `build-get_domain_metadata`), as a string. The base of the three-way drift check. | |
| qualifiedName | Yes | Fully-qualified Java class name of the target domain. | |
| concurrencyToken | No | The `sourceDigest` returned by `lsp-describe_domain` for this domain. |