mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-26 01:11:20 +00:00
- 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
30 lines
724 B
TypeScript
30 lines
724 B
TypeScript
import { INVALID_ACTIVE_INTENT_ERROR, loadIntentContext } from "../core/intent/IntentContextLoader"
|
|
|
|
import type { IntentHookContext, HookResult } from "./types"
|
|
|
|
export async function runIntentPreflightHook(context: IntentHookContext): Promise<HookResult> {
|
|
const activeIntentId = String(context.activeIntentId ?? "").trim()
|
|
if (!activeIntentId) {
|
|
return {
|
|
ok: false,
|
|
error: INVALID_ACTIVE_INTENT_ERROR,
|
|
}
|
|
}
|
|
|
|
try {
|
|
const intentContext = await loadIntentContext(context.workspaceRoot, activeIntentId)
|
|
if (!intentContext) {
|
|
return {
|
|
ok: false,
|
|
error: INVALID_ACTIVE_INTENT_ERROR,
|
|
}
|
|
}
|
|
|
|
return { ok: true }
|
|
} catch {
|
|
return {
|
|
ok: false,
|
|
error: INVALID_ACTIVE_INTENT_ERROR,
|
|
}
|
|
}
|
|
}
|