INNER CODE UNIT · TypeScript
isMutationTool
celia-sh/Novella · .pi/extensions/trellis/index.ts:225
function isMutationTool(t: ToolTrace) {
return t.name === "edit" || t.name === "write";
}
function isValidationCommand(t: ToolTrace) {
const c = bashCommand(t);
return /\b(test|typecheck|lint|build|gofmt|go test|npm run|pnpm|vitest|tsc)\b/.test(
c,
);
}
function isInspectionCommand(t: ToolTrace) {
const c = bashCommand(t);
return /\b(rg|grep|find|git diff|git status|ls|tree)\b/.test(c);
}
function thinkingIntent(text: string) {
const s = text.toLowerCase();
if (/error|failed|failure|panic|exception|报错|失败|错误|异常/.test(s))
return "Analyzing failure cause";
if (/test|verify|check|typecheck|lint|验证|测试|检查/.test(s))