(args, options = {})
| 17 | } |
| 18 | |
| 19 | function createAgentRunEntry(args, options = {}) { |
| 20 | return createIntegrityRecord({ |
| 21 | schema: SCHEMA_VERSION, |
| 22 | timestamp: options.timestamp || new Date().toISOString(), |
| 23 | event: args.event, |
| 24 | agent: args.agent || 'unknown', |
| 25 | session: args.session || null, |
| 26 | duration_ms: Number.isFinite(args.duration) ? args.duration : null, |
| 27 | status: args.status || null, |
| 28 | meta: args.meta || null, |
| 29 | campaign_slug: args.campaign_slug || null, |
| 30 | }, { |
| 31 | run_id: args.run_id || options.run_id, |
| 32 | agent_id: args.agent_id || options.agent_id, |
| 33 | task_id: args.task_id || options.task_id, |
| 34 | parent_id: args.parent_id || options.parent_id, |
| 35 | source_event_id: args.source_event_id || options.source_event_id, |
| 36 | hmacKey: options.hmacKey, |
| 37 | hmacKeyId: options.hmacKeyId, |
| 38 | }); |
| 39 | } |
| 40 | |
| 41 | function logAgentRunEvent(args, options = {}) { |
| 42 | const projectRoot = options.projectRoot || process.env.CLAUDE_PROJECT_DIR || process.cwd(); |
no test coverage detected