module.exports=[897667,a=>{"use strict";let b=new(a.i(52350)).ClaudeCliAdapter;async function c(d,e,f={}){let g="";try{let{query:c}=await a.A(719041),h=b.resolveCommand();for await(let a of c({prompt:d,options:{tools:f.tools??[],allowedTools:f.allowedTools??[],maxTurns:f.maxTurns??1,cwd:e,pathToClaudeCodeExecutable:h,sessionPersistence:!1}}))if("assistant"===a.type){let b=a.message.content.filter(a=>"text"===a.type);g+=b.map(a=>a.text??"").join("")}else if("result"===a.type){let b="string"==typeof a.result?a.result:"";b&&!g&&(g=b)}return g.trim()||null}catch(a){if(a.message?.includes("maximum number of turns")&&g.trim())return g.trim();return console.error("[aiQuery] Failed:",a.message,a.stack?.slice(0,300)),null}}async function d(a,b){let d=`以下是一次AI编程助手的终端会话记录。请用一句简短的中文总结这次会话做了什么（不超过50字，只回答总结内容，不要加引号或前缀）：

\`\`\`
${a.slice(-5e3)}
\`\`\``,e=await c(d,b);return e&&e.replace(/^[#*\->"'\s]+/,"").trim()||null}async function e(a,b,d){let e=a.slice(-8e3),f=d?`
Session summary: ${d}`:"",g=`You are analyzing a completed AI coding session. Extract reusable insights.
${f}

Terminal log (last 8000 chars):
\`\`\`
${e}
\`\`\`

Respond ONLY with valid JSON matching this schema (no markdown, no explanation):
{
  "summary": "one-sentence summary of what was accomplished",
  "insights": [
    { "type": "pattern|pitfall|decision|tool|reference", "content": "description" }
  ],
  "shouldCreateNote": true/false,
  "noteTitle": "short title for the note (only if shouldCreateNote is true)"
}

Rules:
- Set shouldCreateNote=true ONLY if there are genuinely reusable insights (architectural decisions, non-obvious pitfalls, useful patterns, important tool discoveries)
- Trivial sessions (simple formatting, single-line edits, routine commits) should have shouldCreateNote=false
- insights array can be empty if nothing notable
- Keep each insight concise (1-2 sentences)`,h=await c(g,b);if(!h)return null;try{let a=h,b=a.match(/\{[\s\S]*\}/);b&&(a=b[0]);let c=JSON.parse(a);if("string"!=typeof c.summary||"boolean"!=typeof c.shouldCreateNote)return console.error("[generateDreamingInsight] Invalid response structure"),null;return c}catch(a){return console.error("[generateDreamingInsight] JSON parse failed:",a.message),null}}a.s(["aiQuery",0,c,"generateDreamingInsight",0,e,"generateSummaryFromLog",0,d])},719041,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]__0ti8vng._.js","server/chunks/ssr/07-d_@anthropic-ai_claude-agent-sdk_sdk_mjs_0myippv._.js"].map(b=>a.l(b))).then(()=>b(845454)))}];

//# sourceMappingURL=_05xdaz3._.js.map