Files
Phantom/scripts/log-execution.cjs
NW 863a67db8e config: full APAW agent infrastructure + Phantom project files
- Added all agent definitions (.kile/agents/*.md)
- Added commands, rules, skills, shared modules
- Added src/, scripts/, tests/, docker/, agent-evolution/
- Extracted 3 archives: website/, workspace/, release/
- Created .env with Gitea creds for UniqueSoft/Phantom
- Created docs/ with project-specific guides
- Added .gitignore for node_modules
2026-05-18 17:53:59 +01:00

42 lines
1.2 KiB
JavaScript

const fs = require('fs');
const path = require('path');
const LOG_FILE = '.kilo/logs/agent-executions.jsonl';
function logExecution(data) {
const entry = {
ts: new Date().toISOString(),
agent: data.agent || 'unknown',
issue: data.issue || 0,
project: data.project || 'UniqueSoft/APAW',
task: data.task || 'unknown',
subtask_type: data.subtask_type || 'general',
duration_ms: data.duration_ms || 0,
tokens_used: data.tokens_used || 0,
status: data.status || 'unknown',
files: data.files || [],
score: data.score || 0,
next_agent: data.next_agent || null
};
fs.appendFileSync(LOG_FILE, JSON.stringify(entry) + '\n');
return entry;
}
// CLI usage
if (require.main === module) {
const args = {};
for (let i = 2; i < process.argv.length; i += 2) {
const key = process.argv[i].replace(/^--/, '');
const val = process.argv[i + 1];
if (key === 'files') args[key] = val.split(',');
else if (key === 'issue' || key === 'duration_ms' || key === 'tokens_used' || key === 'score') args[key] = parseInt(val) || 0;
else args[key] = val;
}
const entry = logExecution(args);
console.log('Logged:', entry.ts, entry.agent, entry.status);
}
module.exports = { logExecution };