Script agency-archivist: compatibilità universale e {project}/

- extract_archive.js: --client → --project, rimossa dipendenza da .openclaw
- scan_resources.js: --client → --project, basePath configurabile
- generate_catalog.js: --client → --project, basePath configurabile
- Environment variable: AGENCY_PROJECTS_BASE per specificare base directory
- Default: current working directory (compatibile con qualsiasi sistema)
- Percorsi aggiornati: clients/{client}/ → {project}/
- Documentazione script aggiornata (usage, options, examples)

Vantaggi:
 Compatibile con OpenClaw e altri sistemi
 Non richiede struttura .openclaw/workspace
 Configurabile via ENV o --base-path
 Funziona in qualsiasi directory di progetto
This commit is contained in:
AgentePotente 2026-03-11 00:48:40 +01:00
parent f0605645d3
commit 0b4c56d744
3 changed files with 68 additions and 55 deletions

View file

@ -3,8 +3,8 @@
* scan_resources.js Scansiona risorse ed estrae metadata
*
* Usage:
* node scan_resources.js --client <client_name> --pass 1|2
* node scan_resources.js --client demo_co_srl --pass 1
* node scan_resources.js --project <project_name> --pass 1|2
* node scan_resources.js --project demo_co_srl --pass 1
*
* Options:
* --pass 1 Solo metadata base (veloce)
@ -343,39 +343,42 @@ function saveMetadata(resources, outputPath) {
function main() {
const args = process.argv.slice(2);
let client = null;
let project = null;
let passLevel = 1;
let vision = false;
let outputPath = null;
let verbose = false;
let basePath = process.env.AGENCY_PROJECTS_BASE || process.cwd();
for (let i = 0; i < args.length; i++) {
if (args[i] === '--client' && args[i + 1]) {
client = args[++i];
if (args[i] === '--project' && args[i + 1]) {
project = args[++i];
} else if (args[i] === '--pass' && args[i + 1]) {
passLevel = parseInt(args[++i]);
} else if (args[i] === '--vision') {
vision = true;
} else if (args[i] === '--output' && args[i + 1]) {
outputPath = args[++i];
} else if (args[i] === '--base-path' && args[i + 1]) {
basePath = args[++i];
} else if (args[i] === '--verbose') {
verbose = true;
}
}
if (!client) {
console.error('Usage: node scan_resources.js --client <client_name>');
console.error('Options: --pass 1|2, --vision, --output, --verbose');
if (!project) {
console.error('Usage: node scan_resources.js --project <project_name>');
console.error('Options: --base-path <dir>, --pass 1|2, --vision, --output, --verbose');
console.error('Environment: AGENCY_PROJECTS_BASE (opzionale)');
process.exit(1);
}
// Path
const workspace = path.join(os.homedir(), '.openclaw', 'workspace', 'agency-skills-suite');
const clientDir = path.join(workspace, 'clients', client);
const assetsDir = path.join(clientDir, 'assets');
const projectDir = path.join(basePath, project);
const assetsDir = path.join(projectDir, 'assets');
if (!fs.existsSync(clientDir)) {
console.error(`❌ Cartella cliente non trovata: ${clientDir}`);
if (!fs.existsSync(projectDir)) {
console.error(`❌ Cartella progetto non trovata: ${projectDir}`);
process.exit(1);
}
@ -419,7 +422,7 @@ function main() {
console.log(` 🎬 Video: ${videos.length}`);
console.log(` 📄 Documenti: ${docs.length}`);
console.log(` 💾 Metadata: ${outputPath}`);
console.log(`\n👉 Prossimo step: node scripts/generate_catalog.js --client ${client}`);
console.log(`\n👉 Prossimo step: node scripts/generate_catalog.js --project ${project}`);
}
main();