feat: outils gestion fichiers dans le VWB (📁 Fichiers)
- 5 actions : lister, créer dossier, déplacer, copier, classer par extension - Exécution sur Windows via agent port 5006 - Sécurité chemins (bloque C:\Windows, /etc, etc.) - Propriétés panel + preview canvas pour chaque action Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -360,6 +360,53 @@ VWB_ACTION_CONTRACTS: Dict[str, ActionContract] = {
|
||||
required_params=[],
|
||||
optional_params=["prompt", "context", "model", "temperature"],
|
||||
),
|
||||
|
||||
# --- ACTIONS GESTION DE FICHIERS ---
|
||||
"file_list_dir": ActionContract(
|
||||
action_type="file_list_dir",
|
||||
description="Lister les fichiers d'un dossier",
|
||||
required_params=["path"],
|
||||
optional_params=["pattern"],
|
||||
param_validators={"path": lambda p: bool(p and isinstance(p, str) and p.strip())}
|
||||
),
|
||||
|
||||
"file_create_dir": ActionContract(
|
||||
action_type="file_create_dir",
|
||||
description="Créer un dossier (et les sous-dossiers si nécessaire)",
|
||||
required_params=["path"],
|
||||
optional_params=[],
|
||||
param_validators={"path": lambda p: bool(p and isinstance(p, str) and p.strip())}
|
||||
),
|
||||
|
||||
"file_move": ActionContract(
|
||||
action_type="file_move",
|
||||
description="Déplacer ou renommer un fichier",
|
||||
required_params=["source", "destination"],
|
||||
optional_params=[],
|
||||
param_validators={
|
||||
"source": lambda p: bool(p and isinstance(p, str) and p.strip()),
|
||||
"destination": lambda p: bool(p and isinstance(p, str) and p.strip()),
|
||||
}
|
||||
),
|
||||
|
||||
"file_copy": ActionContract(
|
||||
action_type="file_copy",
|
||||
description="Copier un fichier vers un autre emplacement",
|
||||
required_params=["source", "destination"],
|
||||
optional_params=[],
|
||||
param_validators={
|
||||
"source": lambda p: bool(p and isinstance(p, str) and p.strip()),
|
||||
"destination": lambda p: bool(p and isinstance(p, str) and p.strip()),
|
||||
}
|
||||
),
|
||||
|
||||
"file_sort_by_ext": ActionContract(
|
||||
action_type="file_sort_by_ext",
|
||||
description="Classer les fichiers par extension dans des sous-dossiers",
|
||||
required_params=["source_dir"],
|
||||
optional_params=["create_subdirs"],
|
||||
param_validators={"source_dir": lambda p: bool(p and isinstance(p, str) and p.strip())}
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user