```interact
slider pace range=0.5..2 step=0.25 default=1 label="节奏"
timer t range=0..10 step=0.04 speed=40 label="运行"
computed tt = mod(t * pace, 10)
interpolate mx over tt: (0,95) -> (0.55,95) -> (0.7,110) -> (1.9,110) -> (2.4,280) -> (3.0,280) -> (3.5,280) -> (4.3,280) -> (4.8,280) -> (5.3,450) -> (6.1,450) -> (6.5,450) -> (6.9,450) -> (7.35,110) -> (7.6,110) -> (8.05,280) -> (8.5,450) -> (8.9,450) -> (9.15,538) -> (9.55,538) -> (10,538)
interpolate my over tt: (0,60) -> (0.55,150) -> (0.7,176) -> (1.9,176) -> (2.4,176) -> (3.0,176) -> (3.5,342) -> (4.3,342) -> (4.8,176) -> (5.3,176) -> (6.1,176) -> (6.5,290) -> (6.9,290) -> (7.35,290) -> (7.6,176) -> (8.05,176) -> (8.5,176) -> (8.9,290) -> (9.15,290) -> (9.55,86) -> (10,86)
step cap over tt: (0,"一条消息进来了") -> (0.7,"思考 · 规划下一步") -> (2.4,"行动 · 选工具、组调用") -> (3.5,"工具执行 · 搜索、跑代码、取数据") -> (4.8,"结果回来了") -> (5.3,"观察 · 解析结果、更新状态") -> (6.5,"完成了吗？还没 · 再来一轮") -> (7.6,"第二轮 · 思考、行动、观察") -> (8.9,"完成了吗？是") -> (9.5,"输出 · 答案交付")
computed iter = tt < 7.35 ? 1 : 2
computed gTrig = tt < 0.6 ? 1 : 0
computed gThink = (tt >= 0.7 && tt < 1.9) || (tt >= 7.6 && tt < 7.95) ? 1 : 0
computed gAct = (tt >= 2.4 && tt < 3.0) || (tt >= 8.05 && tt < 8.35) ? 1 : 0
computed gTools = tt >= 3.5 && tt < 4.3 ? 1 : 0
computed gObs = (tt >= 5.3 && tt < 6.1) || (tt >= 8.5 && tt < 8.8) ? 1 : 0
computed gDone = (tt >= 6.5 && tt < 6.9) || (tt >= 8.9 && tt < 9.2) ? 1 : 0
computed gOut = tt >= 9.5 ? 1 : 0
computed gNo = tt >= 6.9 && tt < 7.6 ? 1 : 0
computed gYes = tt >= 9.15 ? 1 : 0
computed sThink = 0.4 + gThink * 0.6
computed sAct = 0.4 + gAct * 0.6
computed sObs = 0.4 + gObs * 0.6
computed sTools = 0.45 + gTools * 0.55
computed sDone = 0.45 + gDone * 0.55
computed sOut = 0.45 + gOut * 0.55
computed sTrig = 0.45 + gTrig * 0.55
computed hThink = gThink * 0.3
computed hAct = gAct * 0.3
computed hObs = gObs * 0.3
computed hTools = gTools * 0.3
computed hOut = gOut * 0.35
computed th1 = gThink * (0.35 + 0.35 * sin(tt * 10))
computed th2 = gThink * (0.35 + 0.35 * sin(tt * 10 + 2))
computed th3 = gThink * (0.35 + 0.35 * sin(tt * 10 + 4))
computed rot = mod(tt * 140, 360)
interpolate mcy over tt: (0,326) -> (0.9,326) -> (1.7,242) -> (10,242)
computed mco = tt >= 0.9 && tt < 1.7 ? 0.9 : 0
interpolate msy over tt: (0,242) -> (5.5,242) -> (6.0,326) -> (10,326)
computed mso = tt >= 5.5 && tt < 6.0 ? 0.9 : 0
template svg: <svg viewBox="0 0 560 430" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="会动的 agent loop">
  <defs>
    <linearGradient id="albg" x1="0" y1="0" x2="0" y2="1">
      <stop offset="0" stop-color="#12112a"/>
      <stop offset="1" stop-color="#0c0b1d"/>
    </linearGradient>
    <radialGradient id="alorb" cx="0.35" cy="0.3" r="1">
      <stop offset="0" stop-color="#ffffff"/>
      <stop offset="0.55" stop-color="#cfc6ff"/>
      <stop offset="1" stop-color="#8b7cf8"/>
    </radialGradient>
  </defs>
  <rect x="0" y="0" width="560" height="430" rx="14" fill="url(#albg)"/>
  <text x="280" y="30" text-anchor="middle" font-size="13.5" letter-spacing="0.5" fill="#dfe3f7">{cap}</text>
  <text x="530" y="30" text-anchor="end" font-size="9.5" fill="#7c82a3">第 {iter} / 2 轮</text>
  <rect x="40" y="48" width="110" height="34" rx="9" fill="#12203a" stroke="#3ecf8e" stroke-opacity="{sTrig}" stroke-width="1.5"/>
  <path d="M61,54 l-9,13 h6 l-3,10 9,-13 h-6 l3,-10 z" fill="#3ecf8e" opacity="{sTrig}"/>
  <text x="72" y="69" font-size="11.5" fill="#d9f7e9">触发</text>
  <line x1="95" y1="82" x2="95" y2="112" stroke="#3f4a78" stroke-width="1.5"/>
  <path d="M95,118 l-4.5,-8 l9,0 z" fill="#3f4a78"/>
  <rect x="430" y="48" width="110" height="34" rx="9" fill="#12203a" stroke="#5ea8ff" stroke-opacity="{sOut}" stroke-width="1.5"/>
  <rect x="430" y="48" width="110" height="34" rx="9" fill="none" stroke="#ffd98a" stroke-width="5" opacity="{hOut}"/>
  <path d="M440,70 L457,61 L451,76 L447,70.5 Z" fill="#7fc0ff" opacity="{sOut}"/>
  <text x="464" y="69" font-size="11.5" fill="#dbe9ff">输出</text>
  <rect x="30" y="118" width="500" height="120" rx="12" fill="#141a36" stroke="#5b8cff" stroke-opacity="0.5" stroke-width="1.5"/>
  <text x="46" y="136" font-size="9" letter-spacing="2.5" fill="#6f7ba3">AGENT LOOP</text>
  <rect x="55" y="146" width="110" height="60" rx="10" fill="none" stroke="#9db4ff" stroke-width="6" opacity="{hThink}"/>
  <rect x="55" y="146" width="110" height="60" rx="10" fill="#181f42" stroke="#7aa2ff" stroke-opacity="{sThink}" stroke-width="1.5"/>
  <circle cx="79" cy="171" r="5.5" fill="none" stroke="#9db4ff" stroke-width="1.8" opacity="{sThink}"/>
  <path d="M76.5,179 h5 M77.5,182.5 h3" stroke="#9db4ff" stroke-width="1.6" stroke-linecap="round" opacity="{sThink}"/>
  <text x="95" y="172" font-size="12.5" fill="#e6ebff">思考</text>
  <text x="95" y="188" font-size="8.5" fill="#8a93b8">规划 · 推理</text>
  <circle cx="98" cy="198" r="2.2" fill="#9db4ff" opacity="{th1}"/>
  <circle cx="110" cy="198" r="2.2" fill="#9db4ff" opacity="{th2}"/>
  <circle cx="122" cy="198" r="2.2" fill="#9db4ff" opacity="{th3}"/>
  <rect x="225" y="146" width="110" height="60" rx="10" fill="none" stroke="#9db4ff" stroke-width="6" opacity="{hAct}"/>
  <rect x="225" y="146" width="110" height="60" rx="10" fill="#181f42" stroke="#7aa2ff" stroke-opacity="{sAct}" stroke-width="1.5"/>
  <circle cx="249" cy="171" r="7" fill="none" stroke="#9db4ff" stroke-width="1.8" opacity="{sAct}"/>
  <path d="M246.5,167 l7,4 -7,4 z" fill="#9db4ff" opacity="{sAct}"/>
  <text x="265" y="172" font-size="12.5" fill="#e6ebff">行动</text>
  <text x="265" y="188" font-size="8.5" fill="#8a93b8">选工具 · 调用</text>
  <rect x="395" y="146" width="110" height="60" rx="10" fill="none" stroke="#9db4ff" stroke-width="6" opacity="{hObs}"/>
  <rect x="395" y="146" width="110" height="60" rx="10" fill="#181f42" stroke="#7aa2ff" stroke-opacity="{sObs}" stroke-width="1.5"/>
  <path d="M411,171 q8,-7.5 16,0 q-8,7.5 -16,0 z" fill="none" stroke="#9db4ff" stroke-width="1.7" opacity="{sObs}"/>
  <circle cx="419" cy="171" r="2.3" fill="#9db4ff" opacity="{sObs}"/>
  <text x="435" y="172" font-size="12.5" fill="#e6ebff">观察</text>
  <text x="435" y="188" font-size="8.5" fill="#8a93b8">解析结果</text>
  <line x1="165" y1="176" x2="219" y2="176" stroke="#3f4a78" stroke-width="1.5"/>
  <path d="M225,176 l-8,-4.5 l0,9 z" fill="#3f4a78"/>
  <line x1="335" y1="176" x2="389" y2="176" stroke="#3f4a78" stroke-width="1.5"/>
  <path d="M395,176 l-8,-4.5 l0,9 z" fill="#3f4a78"/>
  <line x1="450" y1="206" x2="450" y2="264" stroke="#3f4a78" stroke-width="1.5"/>
  <path d="M450,268 L478,292 L450,316 L422,292 Z" fill="#122a22" stroke="#3ecf8e" stroke-opacity="{sDone}" stroke-width="1.5"/>
  <text x="450" y="296" text-anchor="middle" font-size="10.5" fill="#c9f2df">完成？</text>
  <line x1="422" y1="292" x2="110" y2="292" stroke="#3f4a78" stroke-width="1.2" stroke-dasharray="5 5"/>
  <line x1="110" y1="292" x2="110" y2="214" stroke="#3f4a78" stroke-width="1.2" stroke-dasharray="5 5"/>
  <path d="M110,208 l-4.5,8 l9,0 z" fill="#3f4a78"/>
  <text x="255" y="284" text-anchor="middle" font-size="8.5" fill="#e08f8f" opacity="{gNo}">没完 · 再来一轮</text>
  <line x1="478" y1="292" x2="538" y2="292" stroke="#3f4a78" stroke-width="1.2"/>
  <line x1="538" y1="292" x2="538" y2="90" stroke="#3f4a78" stroke-width="1.2"/>
  <path d="M538,84 l-4.5,8 l9,0 z" fill="#3f4a78"/>
  <text x="505" y="284" text-anchor="middle" font-size="9" fill="#7fe0b2" opacity="{gYes}">是</text>
  <line x1="90" y1="238" x2="90" y2="330" stroke="#3f4a78" stroke-width="1.2" stroke-dasharray="2 4"/>
  <line x1="280" y1="206" x2="280" y2="330" stroke="#3f4a78" stroke-width="1.2" stroke-dasharray="2 4"/>
  <rect x="40" y="330" width="130" height="64" rx="10" fill="#181433" stroke="#8b7cf8" stroke-opacity="0.6" stroke-width="1.5"/>
  <ellipse cx="66" cy="353" rx="7" ry="2.6" fill="none" stroke="#b9aaff" stroke-width="1.6" opacity="0.9"/>
  <path d="M59,353 v13 M73,353 v13 M59,366 q7,4.5 14,0" fill="none" stroke="#b9aaff" stroke-width="1.6" opacity="0.9"/>
  <text x="84" y="358" font-size="12" fill="#e9e4ff">记忆</text>
  <text x="84" y="374" font-size="8.5" fill="#8a93b8">上下文 · 存储</text>
  <circle cx="90" cy="{mcy}" r="3" fill="#b9aaff" opacity="{mco}"/>
  <circle cx="90" cy="{msy}" r="3" fill="#b9aaff" opacity="{mso}"/>
  <rect x="225" y="330" width="110" height="64" rx="10" fill="none" stroke="#8fe6ff" stroke-width="6" opacity="{hTools}"/>
  <rect x="225" y="330" width="110" height="64" rx="10" fill="#0f2030" stroke="#5ec9f0" stroke-opacity="{sTools}" stroke-width="1.5"/>
  <circle cx="250" cy="362" r="4" fill="none" stroke="#5ec9f0" stroke-width="1.8" opacity="{sTools}"/>
  <path d="M250,356.5 v-3.5 M250,367.5 v3.5 M245.2,359.2 l-3,-1.8 M254.8,364.8 l3,1.8 M245.2,364.8 l-3,1.8 M254.8,359.2 l3,-1.8" stroke="#5ec9f0" stroke-width="1.8" stroke-linecap="round" opacity="{sTools}" transform="rotate({rot} 250 362)"/>
  <text x="266" y="358" font-size="12" fill="#dff4ff">工具</text>
  <text x="266" y="374" font-size="8.5" fill="#8a93b8">搜索 · 代码</text>
  <circle cx="{mx}" cy="{my}" r="11" fill="#8b7cf8" opacity="0.18"/>
  <circle cx="{mx}" cy="{my}" r="6.5" fill="#a795fb" opacity="0.4"/>
  <circle cx="{mx}" cy="{my}" r="3.5" fill="url(#alorb)"/>
</svg>
```
