INNER CODE UNIT · TypeScript
thinkingIntent
celia-sh/Novella · .pi/extensions/trellis/index.ts:238
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))
return "Planning verification steps";
if (/plan|approach|design|strategy|方案|计划|思路|设计/.test(s))
return "Structuring the implementation approach";
if (/implement|change|edit|modify|refactor|实现|修改|重构/.test(s))
return "Reasoning through code changes";
if (/inspect|search|locate|read|context|定位|搜索|阅读|上下文/.test(s))
return "Locating relevant context";
return "";
}
function behaviorSummary(r: RunState) {
if (r.status === "succeeded") return "Task completed and result returned";
if (r.status === "failed")
return "Task failed and error details were retained";