[
https://issues.apache.org/jira/browse/CAMEL-25442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18126846#comment-18126846
]
Claus Ibsen commented on CAMEL-25442:
-------------------------------------
Fixed on main in
https://github.com/apache/camel/commit/728b01afd74762e70a6ca0af1ccc8537e743890a
: a {{directory}} passed to {{camel_write_file}}, {{camel_edit_file}} or
{{camel_save_project_summary}} is taken as the integration whose sources it
holds (the source directory of a running integration or an open project,
compared after resolving symlinks and {{..}}), and the write goes through the
same confirm dialog, or live replay in the editor, as any other AI write. Any
other directory is refused and nothing is written. The project summary is saved
only for the selected integration.
A {{confirm=false}} from a model does not skip the dialog (only the user's
{{/write auto}} does), the file must stay inside the directory, and the MCP
server (also used by ACP agents) and the built-in AI panel both go through this
path. Covered by {{TuiFileToolsTest}} and {{McpFacadeWriteFileTest}}.
_Claude Code on behalf of davsclaus_
> camel-jbang-plugin-tui - route AI file writes through the confirm dialog when
> a directory argument is given
> -----------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-25442
> URL: https://issues.apache.org/jira/browse/CAMEL-25442
> Project: Camel
> Issue Type: Improvement
> Components: camel-jbang
> Reporter: Andrea Cosentino
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.24.0
>
>
> The TUI's camel_write_file / camel_edit_file / camel_save_project_summary go
> through the user confirm dialog (McpFacade) when they target the selected
> integration, but when a 'directory' argument is supplied they take the shared
> executor path (TuiToolRegistry.executeSharedWithTuiExtras ->
> AuthoringTools.writeFile), which does not show that dialog, and the directory
> is not confined to the integration's source directory
> (ToolContext.resolveDirectory accepts any existing directory).
> For consistency, a write that carries a 'directory' argument should go
> through the same confirm/replay path, or be confined to the selected
> integration's source directory.
> Module: dsl/camel-jbang/camel-jbang-plugin-tui,
> dsl/camel-jbang/camel-jbang-core (AuthoringTools).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)