MCPcopy Create free account
hub / github.com/SethGammon/Citadel / createAgentRunEntry

Function createAgentRunEntry

core/telemetry/log.js:19–39  ·  view source on GitHub ↗
(args, options = {})

Source from the content-addressed store, hash-verified

17}
18
19function 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
41function logAgentRunEvent(args, options = {}) {
42 const projectRoot = options.projectRoot || process.env.CLAUDE_PROJECT_DIR || process.cwd();

Callers 1

logAgentRunEventFunction · 0.85

Calls 1

createIntegrityRecordFunction · 0.85

Tested by

no test coverage detected