mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-14 04:08:28 +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
844 B
TypeScript
30 lines
844 B
TypeScript
export type SemanticChangeType = "REFACTOR" | "EVOLUTION"
|
|
|
|
const REFACTOR_PATTERN = /\b(refactor|rewrite|rename|restructure|cleanup|simplif(y|ication))\b/i
|
|
|
|
function toSearchText(value: unknown): string {
|
|
if (typeof value === "string") {
|
|
return value
|
|
}
|
|
|
|
if (Array.isArray(value)) {
|
|
return value.map((item) => toSearchText(item)).join(" ")
|
|
}
|
|
|
|
if (value && typeof value === "object") {
|
|
return Object.values(value as Record<string, unknown>)
|
|
.map((item) => toSearchText(item))
|
|
.join(" ")
|
|
}
|
|
|
|
return ""
|
|
}
|
|
|
|
export function classifySemanticChange(input: {
|
|
intentTitle?: unknown
|
|
intentOperations?: unknown
|
|
filePath?: string
|
|
}): SemanticChangeType {
|
|
const corpus = [input.intentTitle, input.intentOperations, input.filePath].map((v) => toSearchText(v)).join(" ")
|
|
return REFACTOR_PATTERN.test(corpus) ? "REFACTOR" : "EVOLUTION"
|
|
}
|