Roo-Code/src/hooks/tracePostWriteHook.ts
Yakob Dereje 3db3b0112a feat: implement deterministic hook system and intent-traceability ledger
- Added SelectActiveIntentTool for handshake protocol
- Implemented middleware gatekeeper in tool execution pipeline
- Integrated RecordAgentTraceTool for SHA-256 content hashing
- Created .orchestration/ artifacts for machine-readable audit trails
2026-02-21 23:00:24 +03:00

21 lines
581 B
TypeScript

import { appendAgentTrace } from "../core/trace/AgentTraceSerializer"
import type { HookResult, TraceHookContext } from "./types"
export async function runTracePostWriteHook(context: TraceHookContext): Promise<HookResult> {
try {
await appendAgentTrace({
workspaceRoot: context.workspaceRoot,
activeIntentId: context.activeIntentId,
filePath: context.filePath,
content: context.content,
toolName: context.toolName,
})
return { ok: true }
} catch (error) {
return {
ok: false,
error: error instanceof Error ? error.message : String(error),
}
}
}