{"name":"agent-workbench-01","type":"registry:block","description":"Block: agent-workbench-01","dependencies":["@timui/core/agent-thread","@timui/react/agent"],"files":[{"path":"blocks/agent/agent-workbench-01.tsx","content":"'use client'\n\nimport type { AgentThread } from '@timui/core/agent-thread'\n\nimport { AgentThreadView, useAgentThreadController } from '@timui/react/agent'\n\nconst initialThread: AgentThread = {\n  id: 'refund-1842',\n  composer: '',\n  composerStatus: 'ready',\n  messages: [\n    {\n      id: 'user-1',\n      role: 'user',\n      status: 'idle',\n      parts: [{ type: 'text', text: 'Refund order 1842. The item arrived damaged.' }],\n    },\n    {\n      id: 'assistant-1',\n      role: 'assistant',\n      status: 'idle',\n      parts: [\n        {\n          type: 'plan',\n          steps: [\n            { id: 'lookup', label: 'Look up order 1842', status: 'done' },\n            { id: 'policy', label: 'Check the refund policy', status: 'done' },\n            { id: 'confirm', label: 'Wait for a person to approve the refund', status: 'running' },\n          ],\n        },\n        {\n          type: 'tool',\n          id: 'refund',\n          name: 'orders.refund',\n          status: 'pending',\n          input: 'id=1842 amount=48',\n          approvalId: 'refund-approval',\n        },\n        {\n          type: 'approval',\n          id: 'refund-approval',\n          title: 'Refund $48 to the original payment method',\n          description: 'The refund stays blocked until a person approves it.',\n          status: 'pending',\n        },\n        {\n          type: 'citations',\n          items: [\n            {\n              id: 'policy',\n              title: 'Damaged item refunds',\n              href: 'https://example.com/help/refunds',\n              source: 'Help center',\n            },\n          ],\n        },\n      ],\n    },\n  ],\n}\n\nexport default function AgentWorkbench01() {\n  const { thread, dispatch } = useAgentThreadController(initialThread)\n\n  return (\n    <section className=\"mx-auto flex min-h-dvh w-full max-w-2xl flex-col bg-background text-foreground\">\n      <header className=\"border-b px-4 py-4\">\n        <h1 className=\"text-base font-semibold\">Support agent</h1>\n        <p className=\"text-sm leading-6 text-muted-foreground\">Refund request for order 1842</p>\n      </header>\n      <AgentThreadView\n        className=\"flex flex-1 flex-col justify-between px-4 py-4\"\n        thread={thread}\n        onAction={dispatch}\n      />\n    </section>\n  )\n}\n","type":"registry:block","target":"components/blocks/agent/agent-workbench-01.tsx"}],"categories":["agent"],"registryDependencies":[],"meta":{"frameworks":["react"],"category":"agent","tags":["agent"],"clientOnly":true,"previewPath":"registry/default/blocks/agent/agent-workbench-01.tsx","isActive":true,"mdxBody":"```tsx\n'use client'\n\nimport type { AgentThread } from '@timui/core/agent-thread'\n\nimport { AgentThreadView, useAgentThreadController } from '@timui/react/agent'\n\nconst initialThread: AgentThread = {\n  id: 'refund-1842',\n  composer: '',\n  composerStatus: 'ready',\n  messages: [\n    {\n      id: 'user-1',\n      role: 'user',\n      status: 'idle',\n      parts: [{ type: 'text', text: 'Refund order 1842. The item arrived damaged.' }],\n    },\n    {\n      id: 'assistant-1',\n      role: 'assistant',\n      status: 'idle',\n      parts: [\n        {\n          type: 'plan',\n          steps: [\n            { id: 'lookup', label: 'Look up order 1842', status: 'done' },\n            { id: 'policy', label: 'Check the refund policy', status: 'done' },\n            { id: 'confirm', label: 'Wait for a person to approve the refund', status: 'running' },\n          ],\n        },\n        {\n          type: 'tool',\n          id: 'refund',\n          name: 'orders.refund',\n          status: 'pending',\n          input: 'id=1842 amount=48',\n          approvalId: 'refund-approval',\n        },\n        {\n          type: 'approval',\n          id: 'refund-approval',\n          title: 'Refund $48 to the original payment method',\n          description: 'The refund stays blocked until a person approves it.',\n          status: 'pending',\n        },\n        {\n          type: 'citations',\n          items: [\n            {\n              id: 'policy',\n              title: 'Damaged item refunds',\n              href: 'https://example.com/help/refunds',\n              source: 'Help center',\n            },\n          ],\n        },\n      ],\n    },\n  ],\n}\n\nexport default function AgentWorkbench01() {\n  const { thread, dispatch } = useAgentThreadController(initialThread)\n\n  return (\n    <section className=\"mx-auto flex min-h-dvh w-full max-w-2xl flex-col bg-background text-foreground\">\n      <header className=\"border-b px-4 py-4\">\n        <h1 className=\"text-base font-semibold\">Support agent</h1>\n        <p className=\"text-sm leading-6 text-muted-foreground\">Refund request for order 1842</p>\n      </header>\n      <AgentThreadView\n        className=\"flex flex-1 flex-col justify-between px-4 py-4\"\n        thread={thread}\n        onAction={dispatch}\n      />\n    </section>\n  )\n}\n\n```","title":"Agent Workbench · Support agent"}}