{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ag-ui",
  "title": "AG-UI Adapter",
  "author": "Diogo Esteves <https://github.com/dgesteves>",
  "description": "useAgUiAgent: renders any AG-UI agent (LangGraph, CrewAI, Mastra, Pydantic AI) with these components, interrupts as approvals.",
  "dependencies": [],
  "files": [
    {
      "path": "packages/signoff-ui/src/use-ag-ui-agent.ts",
      "content": "'use client';\n\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useSyncExternalStore } from 'react';\nimport type { ChatStatus, RunUsage, UIMessage } from './lib/ai-types';\nimport {\n  answerAgUiInterrupt,\n  createAgUiRun,\n  fromAgUiMessages,\n  getAgUiResume,\n  reduceAgUiRun,\n  reopenAgUiInterrupts,\n  type AgUiApprovalResponse,\n  type AgUiEvent,\n  type AgUiInterrupt,\n  type AgUiMessage,\n  type AgUiResumeEntry,\n  type AgUiRunState,\n} from './lib/ag-ui';\n\n/** What `useAgUiAgent` uses of an agent. Any `@ag-ui/client` agent fits: `HttpAgent`, or an integration's own `AbstractAgent`. */\nexport interface AgUiAgentLike {\n  messages: readonly AgUiMessage[];\n  pendingInterrupts?: readonly AgUiInterrupt[] | undefined;\n  subscribe(subscriber: AgUiSubscriber): { unsubscribe(): void };\n  runAgent(parameters?: { resume?: AgUiResumeEntry[] }): Promise<unknown>;\n  abortRun?(): void;\n}\n\n/** The subscriber callbacks `useAgUiAgent` registers (a subset of `@ag-ui/client`'s `AgentSubscriber`). */\nexport interface AgUiSubscriber {\n  onRunInitialized?(params: { messages: readonly AgUiMessage[]; input?: { runId?: string } }): void;\n  onEvent?(params: { event: AgUiEvent }): void;\n  onMessagesChanged?(params: { messages: readonly AgUiMessage[] }): void;\n  onRunFailed?(params: { error: Error }): void;\n  onRunFinalized?(params: { messages: readonly AgUiMessage[]; input?: { runId?: string } }): void;\n}\n\nexport interface UseAgUiAgentOptions {\n  /**\n   * Starts the run that resumes the agent once every open interrupt has an answer. By default the\n   * hook calls `agent.runAgent({ resume })`, which sends no tools, context or forwarded props, so a\n   * run you started with them resumes without them. Pass the ones your runs send:\n   * `(parameters) => agent.runAgent({ ...parameters, tools, context })`. In CopilotKit, resume\n   * through it, so the run gets the frontend tools you registered:\n   * `(parameters) => copilotkit.runAgent({ agent, ...parameters })`.\n   */\n  runAgent?: ((parameters: { resume: AgUiResumeEntry[] }) => Promise<unknown>) | undefined;\n}\n\nexport interface UseAgUiAgentResult {\n  /** The conversation as AI SDK messages: pass each to `AgentMessage`. */\n  messages: UIMessage[];\n  /** `useChat`-style status, for `deriveAgentState` and `AgentStatus`. */\n  status: ChatStatus;\n  /** Why the run failed, or why the answers to its interrupts didn't go (`status` is then `error`). */\n  error: AgUiRunState['error'];\n  /** Token usage summed over the runs seen, for `RunMeter`. */\n  usage: RunUsage | undefined;\n  /** The step in progress, e.g. a LangGraph node. */\n  step: string | undefined;\n  /** Open interrupts. Those bound to a tool call show as approval cards; answer the rest with `resolve`. */\n  interrupts: AgUiInterrupt[];\n  /**\n   * Answer a tool-call interrupt. Pass it as `AgentMessage`'s `onToolApproval`. The agent resumes\n   * once every open interrupt has an answer, since AG-UI resumes them all in one run. The first\n   * answer stands: another one for the same interrupt is ignored. If the run that resumes fails or\n   * is stopped before it finishes, its interrupts are open again, and `error` says why it failed:\n   * the promise doesn't reject. The card of a call that hasn't run asks again. A call that ran\n   * shows its result instead, with no card: answer its interrupt with `resolve`, as the client\n   * turns down any run that doesn't. A denial of an expired interrupt (`expiresAt`) cancels it, and\n   * an approval of one is refused, as AG-UI takes only a cancellation then.\n   */\n  respond: (response: AgUiApprovalResponse) => Promise<void>;\n  /** Answer any interrupt with your own payload (match its `responseSchema`), as `respond` does. */\n  resolve: (entry: AgUiResumeEntry) => Promise<void>;\n  /**\n   * Arguments a person edited for a tool call, sent as the approval payload's `editedArgs` (and as\n   * `input`, deprecated) when it is approved. Pass it as `AgentMessage`'s `onToolInputEdit`, so\n   * approval cards offer editing.\n   */\n  editInput: (toolCallId: string, input: unknown) => void;\n  /**\n   * Abort the run in progress, even before the server has answered. It ends like a cancelled run:\n   * what was streaming stays cut off, which `deriveAgentState` reads as `stopped`. A stopped resume\n   * opens its interrupts again, as the client still holds them: see `respond`.\n   */\n  stop: () => void;\n}\n\nconst CANCELLED = { type: 'RUN_FINISHED', outcome: { type: 'cancelled' } };\n\nconst useIsoLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\ninterface Snapshot {\n  messages: readonly AgUiMessage[];\n  run: AgUiRunState;\n}\n\n/** The agent's messages and run state as an external store, subscribed while a component reads it. */\nfunction createStore(agent: AgUiAgentLike) {\n  let snapshot: Snapshot = { messages: [...agent.messages], run: createAgUiRun(agent.pendingInterrupts) };\n  const listeners = new Set<() => void>();\n  let subscription: { unsubscribe(): void } | undefined;\n  /** Edited arguments by tool call id, until the approval that carries them is answered. */\n  const edits = new Map<string, unknown>();\n  const set = (next: Partial<Snapshot>) => {\n    snapshot = { ...snapshot, ...next };\n    for (const listener of listeners) listener();\n  };\n  const update = (next: (run: AgUiRunState) => AgUiRunState) => {\n    set({ run: next(snapshot.run) });\n  };\n  /** The interrupts the resume in flight answers, until its run starts (RUN_STARTED replaces them). */\n  let resuming: readonly AgUiInterrupt[] | undefined;\n  /**\n   * The last run seen starting (`onRunInitialized`), and whether a resume has been asked for and\n   * hasn't started yet. `@ag-ui/client` doesn't wait on `onRunFinalized`, so a run's can come once an\n   * answer right after its `RUN_FINISHED` has started the next run: it is left out then.\n   */\n  let runId: string | undefined;\n  let waiting = false;\n  /** If the resume never started, take its answers back, so they can be given again. */\n  const rollBack = (error?: AgUiRunState['error']) => {\n    const answered = resuming;\n    resuming = undefined;\n    if (!answered || snapshot.run.interrupts !== answered) return false;\n    update((run) => ({ ...reopenAgUiInterrupts(run), ...(error && { status: 'error' as const, error }) }));\n    return true;\n  };\n\n  return {\n    getSnapshot: () => snapshot,\n    subscribe(listener: () => void) {\n      listeners.add(listener);\n      if (!subscription) {\n        // Catch up on anything that happened before the first subscriber.\n        snapshot = { ...snapshot, messages: [...agent.messages] };\n        subscription = agent.subscribe({\n          onRunInitialized: ({ messages, input }) => {\n            runId = input?.runId;\n            waiting = false;\n            set({ messages: [...messages], run: { ...snapshot.run, status: 'submitted', error: undefined } });\n          },\n          onEvent: ({ event }) => {\n            update((run) => reduceAgUiRun(run, event));\n          },\n          onMessagesChanged: ({ messages }) => {\n            set({ messages: [...messages] });\n          },\n          onRunFailed: ({ error }) => {\n            // stop() before the server answered: the fetch's AbortError comes here, not as RUN_ERROR.\n            update((run) =>\n              error.name === 'AbortError'\n                ? reduceAgUiRun(run, CANCELLED)\n                : { ...reduceAgUiRun(run, { type: 'RUN_ERROR' }), error: { message: error.message || 'Run failed' } },\n            );\n          },\n          onRunFinalized: ({ messages, input }) => {\n            // A late one, from a run before the newest: what it would cancel, take back or reopen is the newer run's.\n            const id = input?.runId;\n            if (id !== undefined && (waiting || (runId !== undefined && id !== runId))) return;\n            set({ messages: [...messages] });\n            // Aborted runs end without RUN_FINISHED: as a cancelled run, what was streaming stays cut off.\n            update((run) =>\n              run.status === 'submitted' || run.status === 'streaming' ? reduceAgUiRun(run, CANCELLED) : run,\n            );\n            // A resumed run that ended before it started (failed or stopped) never gave the agent its answers.\n            rollBack();\n            // One that started and ended without RUN_FINISHED (failed or stopped) leaves the client holding the\n            // interrupts, and it turns down a run that doesn't answer them: open them again. A call that hasn't\n            // run asks again; one that ran shows its result, and the app answers its interrupt with resolve.\n            const pending = agent.pendingInterrupts ?? [];\n            if (pending.length > 0 && snapshot.run.interrupts.length === 0)\n              update((run) => reopenAgUiInterrupts(run, pending, snapshot.messages));\n          },\n        });\n      }\n      return () => {\n        listeners.delete(listener);\n        if (listeners.size === 0) {\n          subscription?.unsubscribe();\n          subscription = undefined;\n        }\n      };\n    },\n    /** Record an answer; returns the resume entries once every open interrupt has one, the first time only. */\n    answer(response: AgUiApprovalResponse | AgUiResumeEntry) {\n      let answer = response;\n      if (!('interruptId' in response)) {\n        const toolCallId = snapshot.run.interrupts.find((i) => i.id === response.id)?.toolCallId;\n        if (toolCallId && edits.has(toolCallId)) {\n          if (response.approved && response.input === undefined) answer = { ...response, input: edits.get(toolCallId) };\n          edits.delete(toolCallId);\n        }\n      }\n      const run = answerAgUiInterrupt(snapshot.run, answer);\n      // Not open, or answered already: the resume, if any, is on its way.\n      if (run === snapshot.run) return undefined;\n      set({ run });\n      const resume = getAgUiResume(run);\n      if (resume) {\n        resuming = run.interrupts;\n        waiting = true;\n      }\n      return resume;\n    },\n    /** The run that resumes failed: before it started, its answers are taken back. */\n    fail(error: unknown) {\n      const message = (error instanceof Error && error.message) || 'Run failed';\n      if (!rollBack({ message }) && snapshot.run.status !== 'error')\n        update((run) => ({ ...run, status: 'error', error: { message } }));\n    },\n    editInput(toolCallId: string, input: unknown) {\n      edits.set(toolCallId, input);\n    },\n  };\n}\n\n/**\n * Render an AG-UI agent with these components: its messages as AI SDK parts, run status, usage,\n * and tool-call interrupts as approvals.\n *\n * ```tsx\n * const agent = useMemo(() => new HttpAgent({ url: '/api/agent' }), []);\n * const { messages, status, respond } = useAgUiAgent(agent);\n * ```\n *\n * When your runs send tools or context, pass `runAgent` so the run that resumes an interrupt sends\n * them too.\n */\nexport function useAgUiAgent(agent: AgUiAgentLike, options: UseAgUiAgentOptions = {}): UseAgUiAgentResult {\n  const store = useMemo(() => createStore(agent), [agent]);\n  const { messages, run } = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);\n\n  // The latest render's runAgent, so an inline function doesn't make respond a new one each render.\n  const runAgent = useRef(options.runAgent);\n  useIsoLayoutEffect(() => {\n    runAgent.current = options.runAgent;\n  });\n  const answer = useCallback(\n    async (response: AgUiApprovalResponse | AgUiResumeEntry) => {\n      const resume = store.answer(response);\n      if (!resume) return;\n      try {\n        await (runAgent.current ? runAgent.current({ resume }) : agent.runAgent({ resume }));\n      } catch (error) {\n        // In `error`, as useChat reports a failed request: the cards call respond without catching.\n        store.fail(error);\n      }\n    },\n    [agent, store],\n  );\n\n  return {\n    messages: useMemo(() => fromAgUiMessages(messages, run), [messages, run]),\n    status: run.status,\n    error: run.error,\n    usage: run.usage,\n    step: run.step,\n    interrupts: run.interrupts,\n    respond: answer,\n    resolve: answer,\n    editInput: store.editInput,\n    stop: useCallback(() => agent.abortRun?.(), [agent]),\n  };\n}\n",
      "type": "registry:component",
      "target": "components/signoff-ui/use-ag-ui-agent.ts"
    },
    {
      "path": "packages/signoff-ui/src/lib/ag-ui.ts",
      "content": "/**\n * AG-UI to AI SDK message parts, so the components render any AG-UI agent (LangGraph, CrewAI,\n * Mastra, Pydantic AI...). The types below mirror the parts of AG-UI 1.0 that are read\n * here, structurally, so `@ag-ui/core` and `@ag-ui/client` objects fit without either being a\n * dependency. The AI SDK types come from ./ai-types, so the entry needs no `ai` either.\n */\nimport type { ChatStatus, DynamicToolUIPart, RunUsage, SubagentPart, SubagentStatus, UIMessage } from './ai-types';\nimport { addUsage } from './usage';\n\n/** An AG-UI event. Only `type` is required here; the fields each event type carries are read as needed. */\nexport interface AgUiEvent {\n  type: string;\n}\n\nexport interface AgUiToolCall {\n  id: string;\n  function: { name: string; arguments: string };\n}\n\n/** Text, image, audio, video or document content (AG-UI `ContentPart`). */\nexport interface AgUiContentPart {\n  type: string;\n  text?: string;\n  source?: { type: string; value: string; mimeType?: string };\n}\n\n/** Any AG-UI message: user, assistant, reasoning, tool, activity, system or developer. */\nexport interface AgUiMessage {\n  id: string;\n  role: string;\n  content?: unknown;\n  toolCalls?: readonly AgUiToolCall[];\n  toolCallId?: string;\n  error?: string;\n  activityType?: string;\n  /** The sub-agent that wrote it. Absent for the agent's own messages. */\n  subagentRunId?: string;\n}\n\n/** A pause for human input (AG-UI `Interrupt`). `toolCallId` binds it to a tool call to approve. */\nexport interface AgUiInterrupt {\n  id: string;\n  reason: string;\n  message?: string;\n  toolCallId?: string;\n  responseSchema?: Record<string, unknown>;\n  /** When it expires (ISO 8601). From then on AG-UI takes only a cancellation for it. */\n  expiresAt?: string | undefined;\n}\n\n/** An answer to an interrupt, sent in `RunAgentInput.resume` (AG-UI `ResumeEntry`). */\nexport interface AgUiResumeEntry {\n  interruptId: string;\n  status: 'resolved' | 'cancelled';\n  payload?: unknown;\n}\n\n/** AG-UI `TokenUsage`. Totals include cached and reasoning tokens, as in the AI SDK. */\nexport interface AgUiTokenUsage {\n  inputTokens?: number;\n  outputTokens?: number;\n  totalTokens?: number;\n  reasoningTokens?: number;\n  cachedInputTokens?: number;\n  cacheWriteInputTokens?: number;\n}\n\n/** A decision on a tool-call interrupt, as the tool part shows it. */\nexport interface AgUiApproval {\n  /** The interrupt id, which is also the approval id `ToolApprovalCard` responds with. */\n  id: string;\n  /** Undefined while nobody has answered. */\n  approved?: boolean | undefined;\n  reason?: string | undefined;\n  /** The interrupt's message, e.g. \"Send email to a@b.com?\". */\n  requestReason?: string | undefined;\n}\n\n/** A sub-agent the runs started (`SUBAGENT_STARTED`), and how it ended. */\nexport interface AgUiSubagent {\n  subagentRunId: string;\n  /** Undefined until its `SUBAGENT_STARTED` arrives. */\n  name?: string | undefined;\n  /** The tool call that started it, which it nests under. */\n  parentToolCallId?: string | undefined;\n  /** The sub-agent that started it, when one did. */\n  parentSubagentRunId?: string | undefined;\n  /** `running` from its start or its first event, then `done` or `suspended` (`SUBAGENT_FINISHED`), or `error`. */\n  status: SubagentStatus;\n  /** From `SUBAGENT_ERROR`. */\n  error?: { message: string; code?: string | undefined } | undefined;\n}\n\n/** What the event stream says about runs, beyond the messages themselves. */\nexport interface AgUiRunState {\n  /** `useChat`-style: `submitted` until content streams, `ready` once the run ends, `error` after `RUN_ERROR`. */\n  status: ChatStatus;\n  error?: { message: string; code?: string | undefined } | undefined;\n  /** Token usage summed over the runs seen, for `RunMeter`. */\n  usage?: RunUsage | undefined;\n  /** The step in progress (`STEP_STARTED`), e.g. a LangGraph node. */\n  step?: string | undefined;\n  /** Interrupts the last run ended with. The next run must answer all of them. */\n  interrupts: AgUiInterrupt[];\n  /** Answers given so far to `interrupts`, by interrupt id. */\n  answers: Record<string, AgUiResumeEntry>;\n  /** Tool-call interrupts and their decisions, by tool call id. Kept across runs. */\n  approvals: Record<string, AgUiApproval>;\n  /**\n   * Text and reasoning messages, and tool calls, still streaming. A cancelled run (`RUN_FINISHED`\n   * with a `cancelled` outcome) leaves them as they were, cut off, until the next run starts.\n   */\n  streaming: { messages: string[]; toolCalls: string[] };\n  /** Sub-agents, in the order they were first seen. Kept across runs. */\n  subagents?: AgUiSubagent[] | undefined;\n}\n\nexport function createAgUiRun(interrupts: readonly AgUiInterrupt[] = []): AgUiRunState {\n  return withInterrupts(\n    {\n      status: 'ready',\n      interrupts: [],\n      answers: {},\n      approvals: {},\n      streaming: { messages: [], toolCalls: [] },\n      subagents: [],\n    },\n    interrupts,\n  );\n}\n\nfunction withInterrupts(run: AgUiRunState, interrupts: readonly AgUiInterrupt[]): AgUiRunState {\n  const approvals = { ...run.approvals };\n  for (const interrupt of interrupts) {\n    if (interrupt.toolCallId)\n      approvals[interrupt.toolCallId] = { id: interrupt.id, requestReason: interrupt.message ?? undefined };\n  }\n  return { ...run, interrupts: [...interrupts], answers: {}, approvals };\n}\n\n/** Fields read from events, all optional so one shape covers every event type. */\ninterface EventFields {\n  type: string;\n  messageId?: string;\n  toolCallId?: string;\n  stepName?: string;\n  message?: string;\n  code?: string;\n  usage?: readonly AgUiTokenUsage[];\n  outcome?: { type: string; interrupts?: readonly AgUiInterrupt[] };\n  subagentRunId?: string;\n  name?: string;\n  parentToolCallId?: string;\n  parentSubagentRunId?: string;\n}\n\nconst add = (list: string[], id: string | undefined) => (id === undefined || list.includes(id) ? list : [...list, id]);\nconst remove = (list: string[], id: string | undefined) => (list.includes(id!) ? list.filter((x) => x !== id) : list);\n\nconst ended = (status: SubagentStatus) => status === 'done' || status === 'error';\n\n/** The run with sub-agent `id` changed, or added first (running) when it is new. */\nfunction withSubagent(run: AgUiRunState, id: string, change: (subagent: AgUiSubagent) => AgUiSubagent) {\n  const list = run.subagents ?? [];\n  const at = list.findIndex((s) => s.subagentRunId === id);\n  const current = list[at] ?? { subagentRunId: id, status: 'running' };\n  const next = change(current);\n  if (next === current && at !== -1) return run;\n  return { ...run, subagents: at === -1 ? [...list, next] : list.map((s, i) => (i === at ? next : s)) };\n}\n\n/**\n * Fold one AG-UI event into the run state. Pure, so it fits `useReducer` or any store;\n * `useAgUiAgent` uses it with an `@ag-ui/client` agent.\n */\nexport function reduceAgUiRun(run: AgUiRunState, event: AgUiEvent): AgUiRunState {\n  const e = event as EventFields;\n  const id = e.subagentRunId;\n  if (id !== undefined) {\n    switch (e.type) {\n      case 'SUBAGENT_STARTED':\n        return withSubagent(run, id, (s) => ({\n          ...s,\n          name: e.name,\n          parentToolCallId: e.parentToolCallId,\n          parentSubagentRunId: e.parentSubagentRunId,\n          // An end that arrived first stands; a suspended sub-agent starts again.\n          status: ended(s.status) ? s.status : 'running',\n        }));\n      case 'SUBAGENT_FINISHED':\n        return withSubagent(run, id, (s) =>\n          ended(s.status) ? s : { ...s, status: e.outcome?.type === 'suspended' ? 'suspended' : 'done' },\n        );\n      case 'SUBAGENT_ERROR':\n        return withSubagent(run, id, (s) =>\n          ended(s.status) ? s : { ...s, status: 'error', error: { message: e.message ?? '', code: e.code } },\n        );\n    }\n    // Its work, maybe before its start event: it is running.\n    run = withSubagent(run, id, (s) => (s.status === 'suspended' ? { ...s, status: 'running' } : s));\n  }\n  const { messages, toolCalls } = run.streaming;\n  const streaming = (next: Partial<AgUiRunState['streaming']>): AgUiRunState => ({\n    ...run,\n    status: 'streaming',\n    streaming: { messages, toolCalls, ...next },\n  });\n  switch (e.type) {\n    case 'RUN_STARTED':\n      return {\n        ...run,\n        status: 'submitted',\n        error: undefined,\n        step: undefined,\n        interrupts: [],\n        answers: {},\n        streaming: { messages: [], toolCalls: [] },\n      };\n    case 'TEXT_MESSAGE_START':\n    case 'TEXT_MESSAGE_CHUNK':\n    case 'REASONING_START':\n    case 'REASONING_MESSAGE_START':\n    case 'REASONING_MESSAGE_CHUNK':\n      return streaming({ messages: add(messages, e.messageId) });\n    case 'TEXT_MESSAGE_END':\n    case 'REASONING_MESSAGE_END':\n    case 'REASONING_END':\n      return { ...run, streaming: { messages: remove(messages, e.messageId), toolCalls } };\n    case 'TOOL_CALL_START':\n    case 'TOOL_CALL_CHUNK':\n      return streaming({ toolCalls: add(toolCalls, e.toolCallId) });\n    case 'TOOL_CALL_END':\n    case 'TOOL_CALL_RESULT':\n      return { ...run, streaming: { messages, toolCalls: remove(toolCalls, e.toolCallId) } };\n    case 'TEXT_MESSAGE_CONTENT':\n    case 'REASONING_MESSAGE_CONTENT':\n    case 'TOOL_CALL_ARGS':\n      return run.status === 'streaming' ? run : { ...run, status: 'streaming' };\n    case 'STEP_STARTED':\n      return { ...run, step: e.stepName };\n    case 'STEP_FINISHED':\n      return run.step === e.stepName ? { ...run, step: undefined } : run;\n    case 'RUN_FINISHED': {\n      // A cancelled run stopped part-way: what was still streaming stays unfinished, as after the AI\n      // SDK's stop(), so deriveAgentState reads it as stopped rather than done.\n      const ended = endRun(run, e.usage, e.outcome?.type === 'cancelled');\n      return e.outcome?.type === 'interrupt' ? withInterrupts(ended, e.outcome.interrupts ?? []) : ended;\n    }\n    case 'RUN_ERROR':\n      // HttpAgent reports its own abortRun() as an error with code `abort`: the run was stopped, not failed.\n      if (e.code === 'abort') return endRun(run, e.usage, true);\n      return { ...endRun(run, e.usage), status: 'error', error: { message: e.message ?? 'Run failed', code: e.code } };\n    default:\n      return run;\n  }\n}\n\nfunction endRun(run: AgUiRunState, usage: readonly AgUiTokenUsage[] | undefined, cancelled = false): AgUiRunState {\n  let total = run.usage;\n  for (const entry of usage ?? []) total = addUsage(total, fromAgUiUsage(entry));\n  const streaming = cancelled ? run.streaming : { messages: [], toolCalls: [] };\n  return { ...run, status: 'ready', step: undefined, usage: total, streaming };\n}\n\n/** An AG-UI `TokenUsage` entry as AI SDK usage. */\nexport function fromAgUiUsage(usage: AgUiTokenUsage): RunUsage {\n  return {\n    inputTokens: usage.inputTokens,\n    outputTokens: usage.outputTokens,\n    totalTokens: usage.totalTokens,\n    inputTokenDetails: { cacheReadTokens: usage.cachedInputTokens, cacheWriteTokens: usage.cacheWriteInputTokens },\n    outputTokenDetails: { reasoningTokens: usage.reasoningTokens },\n  };\n}\n\n/** A tool approval, as `ToolApprovalCard` and `AgentMessage`'s `onToolApproval` give it. */\nexport interface AgUiApprovalResponse {\n  id: string;\n  approved: boolean;\n  reason?: string | undefined;\n  /** Arguments the person edited, sent with an approval as the payload's `editedArgs` (and `input`, deprecated). */\n  input?: unknown;\n}\n\n/**\n * Record an answer to an open interrupt. A tool approval becomes the conventional\n * `{ approved, reason? }` payload, with `editedArgs` when the person edited the arguments: AG-UI's\n * approve-with-edits field, a full replacement of the call's arguments. The same arguments go as\n * `input` too, the name earlier versions sent, which is deprecated. Pass a resume entry for other\n * interrupts.\n *\n * The first answer to an interrupt stands: for another one, or one that isn't open, the run comes\n * back unchanged, so it can't start a second resume. Once an interrupt's `expiresAt` has passed\n * (at `now`), AG-UI takes only a cancellation for it: a denial goes as one, and an approval or a\n * resolved entry is refused, with `status: 'error'` and an `interrupt_expired` error saying so.\n */\nexport function answerAgUiInterrupt(\n  run: AgUiRunState,\n  answer: AgUiApprovalResponse | AgUiResumeEntry,\n  now: number = Date.now(),\n): AgUiRunState {\n  let entry: AgUiResumeEntry =\n    'interruptId' in answer\n      ? answer\n      : {\n          interruptId: answer.id,\n          status: 'resolved',\n          payload: {\n            approved: answer.approved,\n            ...(answer.reason ? { reason: answer.reason } : {}),\n            ...(answer.approved && answer.input !== undefined ? { editedArgs: answer.input, input: answer.input } : {}),\n          },\n        };\n  const interrupt = run.interrupts.find((i) => i.id === entry.interruptId);\n  if (!interrupt || run.answers[interrupt.id]) return run;\n  if (interrupt.expiresAt !== undefined && Date.parse(interrupt.expiresAt) <= now) {\n    const decision = 'interruptId' in answer ? undefined : answer;\n    if (entry.status === 'resolved' && decision?.approved !== false) {\n      const message = `Interrupt ${interrupt.id} expired at ${interrupt.expiresAt}: it can only be ${decision ? 'denied' : 'cancelled'} now.`;\n      return { ...run, status: 'error', error: { message, code: 'interrupt_expired' } };\n    }\n    entry = { ...entry, status: 'cancelled' };\n  }\n  const approvals = { ...run.approvals };\n  const approval = interrupt.toolCallId ? approvals[interrupt.toolCallId] : undefined;\n  if (interrupt.toolCallId && approval) {\n    const payload = entry.payload as { approved?: unknown; reason?: unknown } | undefined;\n    approvals[interrupt.toolCallId] = {\n      ...approval,\n      approved: entry.status === 'resolved' && payload?.approved === true,\n      reason: typeof payload?.reason === 'string' ? payload.reason : undefined,\n    };\n  }\n  return { ...run, answers: { ...run.answers, [entry.interruptId]: entry }, approvals };\n}\n\n/** The resume entries for the next run, once every open interrupt has an answer. */\nexport function getAgUiResume(run: AgUiRunState): AgUiResumeEntry[] | undefined {\n  if (run.interrupts.length === 0) return undefined;\n  const entries = run.interrupts.map((i) => run.answers[i.id]);\n  return entries.every((e) => e !== undefined) ? entries : undefined;\n}\n\n/**\n * The open interrupts, or the ones given, with their answers taken back, as before anyone answered:\n * for a resume that never started, or one that started and ended without `RUN_FINISHED`. A call\n * with a result in `messages` keeps its decision for display, as the agent acted on it: the\n * timeline still says it was approved (or denied), and no card asks again.\n */\nexport function reopenAgUiInterrupts(\n  run: AgUiRunState,\n  interrupts: readonly AgUiInterrupt[] = run.interrupts,\n  messages: readonly AgUiMessage[] = [],\n): AgUiRunState {\n  const reopened = withInterrupts(run, interrupts);\n  for (const m of messages) {\n    const decided = m.role === 'tool' ? run.approvals[m.toolCallId!] : undefined;\n    if (decided?.approved !== undefined) reopened.approvals[m.toolCallId!] = decided;\n  }\n  return reopened;\n}\n\ntype Part = UIMessage['parts'][number];\n\n/** A sub-agent's messages, its part, and the parts its first message would have joined. */\ninterface Gathered {\n  messages: AgUiMessage[];\n  part: SubagentPart;\n  at?: Part[];\n}\n\n/**\n * AG-UI messages as AI SDK `UIMessage`s: each user message, then the assistant, reasoning, tool and\n * activity messages after it grouped into one assistant message, the way the AI SDK groups a\n * multi-step run. Tool calls become dynamic tool parts with their results; with the run state,\n * streaming flags and tool-call interrupts (as approvals) are applied too. Activity messages become\n * `data-${activityType}` parts. System and developer messages are left out.\n *\n * A sub-agent's messages become one `data-signoff-subagent` part, after the tool call that started\n * it (`SUBAGENT_STARTED`'s `parentToolCallId`), which may be another sub-agent's, or else where its\n * first message was. `ToolCallTimeline` nests its calls under that call. A user message of its own,\n * the task its parent gave it, is left out, and doesn't end the parent's turn.\n */\nexport function fromAgUiMessages(messages: readonly AgUiMessage[], run?: AgUiRunState): UIMessage[] {\n  const out: UIMessage[] = [];\n  const results = new Map<string, AgUiMessage>();\n  for (const message of messages)\n    if (message.role === 'tool' && message.toolCallId) results.set(message.toolCallId, message);\n  const streaming = (id: string) => run?.streaming.messages.includes(id) === true;\n  let group: UIMessage | undefined;\n  const assistant = (id: string) => {\n    if (!group) {\n      group = { id, role: 'assistant', parts: [] };\n      out.push(group);\n    }\n    return group.parts;\n  };\n  // Sub-agents in the order they started, then any known only from their messages.\n  const known = run?.subagents ?? [];\n  const subagents = new Map<string, Gathered>();\n  const gather = (id: string) => {\n    if (!subagents.has(id))\n      subagents.set(id, { messages: [], part: { type: 'data-signoff-subagent', id } as SubagentPart });\n    return subagents.get(id)!;\n  };\n  for (const subagent of known) gather(subagent.subagentRunId);\n\n  /** Adds an assistant, reasoning or activity message's parts. */\n  const convert = (message: AgUiMessage, parts: () => Part[]) => {\n    switch (message.role) {\n      case 'assistant': {\n        const into = parts();\n        const text = typeof message.content === 'string' ? message.content : '';\n        if (text) into.push({ type: 'text', text, state: streaming(message.id) ? 'streaming' : 'done' });\n        for (const call of message.toolCalls ?? []) into.push(toolPart(call, results.get(call.id), run));\n        break;\n      }\n      case 'reasoning': {\n        const text = typeof message.content === 'string' ? message.content : '';\n        if (text) parts().push({ type: 'reasoning', text, state: streaming(message.id) ? 'streaming' : 'done' });\n        break;\n      }\n      case 'activity':\n        parts().push({\n          type: `data-${message.activityType ?? 'activity'}`,\n          id: message.id,\n          data: message.content,\n        } as Part);\n        break;\n    }\n  };\n\n  for (const message of messages) {\n    // A sub-agent's user message is the task its parent gave it, not the person's: it stays inside\n    // the sub-agent, which shows what it did, and the parent's turn goes on.\n    if (message.role === 'user' && message.subagentRunId === undefined) {\n      group = undefined;\n      out.push({ id: message.id, role: 'user', parts: userParts(message.content) });\n    } else if (message.subagentRunId === undefined) {\n      convert(message, () => assistant(message.id));\n    } else if (message.role !== 'tool') {\n      const found = gather(message.subagentRunId);\n      if (!found.at) {\n        found.at = assistant(message.id);\n        found.at.push(found.part);\n      }\n      found.messages.push(message);\n    }\n  }\n\n  for (const [id, { messages: own, part }] of subagents) {\n    const parts: Part[] = [];\n    for (const message of own) convert(message, () => parts);\n    const state = known.find((s) => s.subagentRunId === id);\n    part.data = {\n      subagentRunId: id,\n      parentToolCallId: state?.parentToolCallId,\n      name: state?.name,\n      // Without its events (history from before this page), it is running while one of its calls is.\n      status:\n        state?.status ??\n        (parts.some((p) => p.type === 'dynamic-tool' && !p.state.startsWith('output')) ? 'running' : 'done'),\n      errorText: state?.error?.message || undefined,\n      parts,\n    };\n  }\n\n  // Each goes after the call that started it, in the turn or in another sub-agent, never in itself.\n  const homes = [...out.map((m) => m.parts), ...[...subagents.values()].map((found) => found.part.data.parts)];\n  const holds = (part: SubagentPart, parts: Part[]): boolean =>\n    part.data.parts === parts ||\n    part.data.parts.some((p) => p.type === 'data-signoff-subagent' && holds(p as SubagentPart, parts));\n  for (const { part, at } of subagents.values()) {\n    for (const parts of homes) {\n      let index = afterCall(parts, part.data.parentToolCallId);\n      if (index === -1 || holds(part, parts)) continue;\n      const from = at?.indexOf(part) ?? -1;\n      if (from !== -1) {\n        at!.splice(from, 1);\n        if (at === parts && from < index) index--;\n      }\n      parts.splice(index, 0, part);\n      break;\n    }\n  }\n  return out;\n}\n\n/** Where a sub-agent started by `callId` goes in `parts`: after it and the sub-agents it started before. */\nfunction afterCall(parts: readonly Part[], callId: string | undefined): number {\n  let at = parts.findIndex((p) => p.type === 'dynamic-tool' && p.toolCallId === callId);\n  if (at === -1) return -1;\n  while ((parts[at + 1] as SubagentPart | undefined)?.data?.parentToolCallId === callId) at++;\n  return at + 1;\n}\n\nfunction userParts(content: unknown): Part[] {\n  if (typeof content === 'string') return content ? [{ type: 'text', text: content }] : [];\n  if (!Array.isArray(content)) return [];\n  const parts: Part[] = [];\n  for (const part of content as AgUiContentPart[]) {\n    if (part.type === 'text' && part.text) parts.push({ type: 'text', text: part.text });\n    else if (part.source && (part.source.type === 'url' || part.source.type === 'data')) {\n      const mediaType =\n        part.source.mimeType ?? (part.type === 'document' ? 'application/octet-stream' : `${part.type}/*`);\n      const url = part.source.type === 'url' ? part.source.value : `data:${mediaType};base64,${part.source.value}`;\n      parts.push({ type: 'file', mediaType, url });\n    }\n  }\n  return parts;\n}\n\nfunction toolPart(call: AgUiToolCall, result: AgUiMessage | undefined, run: AgUiRunState | undefined): Part {\n  const base = { type: 'dynamic-tool' as const, toolName: call.function.name, toolCallId: call.id };\n  const approval = run?.approvals[call.id];\n  const decided = approval && { id: approval.id, requestReason: approval.requestReason, reason: approval.reason };\n  const streaming = run?.streaming.toolCalls.includes(call.id) === true && !result;\n  const input = streaming ? parsePartialJson(call.function.arguments) : parseArguments(call.function.arguments);\n  // Denied, or the interrupt cancelled: the resumed run may still post a result for the call, but it was a no.\n  if (approval?.approved === false)\n    return { ...base, state: 'output-denied', input, approval: { ...decided!, approved: false } } as Part;\n  let part: DynamicToolUIPart;\n  if (result?.error) {\n    part = { ...base, state: 'output-error', input, errorText: result.error };\n  } else if (result) {\n    part = { ...base, state: 'output-available', input, output: parseOutput(result.content) };\n  } else if (streaming) {\n    return { ...base, state: 'input-streaming', input };\n  } else if (!approval) {\n    return { ...base, state: 'input-available', input };\n  } else if (approval.approved === undefined) {\n    return { ...base, state: 'approval-requested', input, approval: { ...decided!, reason: undefined } } as Part;\n  } else {\n    return { ...base, state: 'approval-responded', input, approval: { ...decided!, approved: true } } as Part;\n  }\n  // A call that ran after its approval keeps it, so the timeline can say who approved it.\n  return approval?.approved ? ({ ...part, approval: { ...decided!, approved: true } } as Part) : part;\n}\n\nfunction parseArguments(text: string): unknown {\n  if (!text.trim()) return {};\n  try {\n    return JSON.parse(text) as unknown;\n  } catch {\n    return text;\n  }\n}\n\n/** Tool results arrive as strings; JSON objects and arrays are parsed so the timeline can show them as data. */\nfunction parseOutput(content: unknown): unknown {\n  if (Array.isArray(content)) {\n    const parts = content as AgUiContentPart[];\n    return parts.every((p) => p.type === 'text') ? parseOutput(parts.map((p) => p.text ?? '').join('')) : content;\n  }\n  if (typeof content !== 'string' || !/^\\s*[[{]/.test(content)) return content;\n  try {\n    return JSON.parse(content) as unknown;\n  } catch {\n    return content;\n  }\n}\n\n/**\n * Parse JSON that may be cut off mid-stream, such as tool arguments as they arrive: open strings,\n * arrays and objects are closed, and a trailing key or partial literal is dropped.\n * `{\"query\": \"stre` gives `{ query: 'stre' }`. Returns `undefined` when nothing parses.\n */\nexport function parsePartialJson(text: string): unknown {\n  if (!text.trim()) return undefined;\n  try {\n    return JSON.parse(text) as unknown;\n  } catch {\n    // Cut off: repair below.\n  }\n  let body = text;\n  const { inString, escaped } = scan(body);\n  // A cut-off \\u escape goes, unless its backslash is itself escaped (C:\\\\u...).\n  if (inString)\n    body = `${(escaped ? body.slice(0, -1) : body).replace(/(^|[^\\\\])((?:\\\\\\\\)*)\\\\u[0-9a-fA-F]{0,3}$/, '$1$2')}\"`;\n  for (;;) {\n    try {\n      return JSON.parse(body + scan(body).closers) as unknown;\n    } catch {\n      const trimmed = trimLast(body);\n      if (trimmed === body) return undefined;\n      body = trimmed;\n    }\n  }\n}\n\nfunction scan(text: string) {\n  const stack: string[] = [];\n  let inString = false;\n  let escaped = false;\n  for (const ch of text) {\n    if (inString) {\n      if (escaped) escaped = false;\n      else if (ch === '\\\\') escaped = true;\n      else if (ch === '\"') inString = false;\n    } else if (ch === '\"') inString = true;\n    else if (ch === '{') stack.push('}');\n    else if (ch === '[') stack.push(']');\n    else if (ch === '}' || ch === ']') stack.pop();\n  }\n  return { inString, escaped, closers: stack.reverse().join('') };\n}\n\n/** Drop the last incomplete token: a comma, a key and its colon, a string, or a partial number or literal. */\nfunction trimLast(body: string): string {\n  const t = body.trimEnd();\n  if (t.endsWith(',')) return t.slice(0, -1);\n  if (t.endsWith(':')) return t.slice(0, -1).replace(/\"(?:[^\"\\\\]|\\\\.)*\"\\s*$/, '');\n  if (t.endsWith('\"')) return t.replace(/\"(?:[^\"\\\\]|\\\\.)*\"$/, '');\n  return t.replace(/[^\\s,:[\\]{}\"]+$/, '');\n}\n",
      "type": "registry:lib",
      "target": "components/signoff-ui/lib/ag-ui.ts"
    },
    {
      "path": "packages/signoff-ui/src/lib/ai-types.ts",
      "content": "/**\n * The AI SDK types the AG-UI and ACP adapters return, declared here so those entries import nothing\n * from `ai`, an optional peer that their apps need not install. Each is the part of the AI SDK 6 and 7\n * type of the same name that the adapters produce, so what they return goes to `AgentMessage`,\n * `useChat` and anything else typed with `ai` as it is (test/peer-dependencies.test.ts checks it).\n */\n\n/** The AI SDK's `ChatStatus`. */\nexport type ChatStatus = 'submitted' | 'streaming' | 'ready' | 'error';\n\n/** The AI SDK's `LanguageModelUsage`, without the provider's `raw` usage. */\nexport interface LanguageModelUsage {\n  inputTokens: number | undefined;\n  inputTokenDetails: {\n    noCacheTokens: number | undefined;\n    cacheReadTokens: number | undefined;\n    cacheWriteTokens: number | undefined;\n  };\n  outputTokens: number | undefined;\n  outputTokenDetails: {\n    textTokens: number | undefined;\n    reasoningTokens: number | undefined;\n  };\n  totalTokens: number | undefined;\n}\n\n/** Token usage, compatible with the AI SDK `LanguageModelUsage` shape (the same type as lib/ai.ts's). */\nexport type RunUsage = {\n  inputTokens?: number | undefined;\n  outputTokens?: number | undefined;\n  totalTokens?: number | undefined;\n  inputTokenDetails?: Partial<LanguageModelUsage['inputTokenDetails']> | undefined;\n  outputTokenDetails?: Partial<LanguageModelUsage['outputTokenDetails']> | undefined;\n};\n\n/** What AI SDK 7 adds to a tool call's approval, which AI SDK 6 leaves out. */\ntype ApprovalExtras = { requestReason?: string; isAutomatic?: boolean };\n/** A tool call's approval, once answered. */\ntype Answered<Approved extends boolean> = { id: string; approved: Approved; reason?: string } & ApprovalExtras;\n\n/**\n * The AI SDK's `DynamicToolUIPart`, a tool call in each of its states. A streaming call's `input` is\n * there even when undefined: AI SDK 6.0.0 requires the key, later releases make it optional.\n */\nexport type DynamicToolUIPart = {\n  type: 'dynamic-tool';\n  toolName: string;\n  toolCallId: string;\n  title?: string;\n  providerExecuted?: boolean;\n} & (\n  | { state: 'input-streaming'; input: unknown; output?: never; errorText?: never; approval?: never }\n  | { state: 'input-available'; input: unknown; output?: never; errorText?: never; approval?: never }\n  | {\n      state: 'approval-requested';\n      input: unknown;\n      output?: never;\n      errorText?: never;\n      approval: { id: string; approved?: never; reason?: never } & ApprovalExtras;\n    }\n  | { state: 'approval-responded'; input: unknown; output?: never; errorText?: never; approval: Answered<boolean> }\n  | { state: 'output-available'; input: unknown; output: unknown; errorText?: never; approval?: Answered<true> }\n  | { state: 'output-error'; input: unknown; output?: never; errorText: string; approval?: Answered<true> }\n  | { state: 'output-denied'; input: unknown; output?: never; errorText?: never; approval: Answered<false> }\n);\n\n/** The parts the adapters make: text, reasoning, files, tool calls, and `data-*` parts such as sub-agents. */\nexport type UIMessagePart =\n  | { type: 'text'; text: string; state?: 'streaming' | 'done' }\n  | { type: 'reasoning'; text: string; state?: 'streaming' | 'done' }\n  | { type: 'file'; mediaType: string; filename?: string; url: string }\n  | DynamicToolUIPart\n  | { type: `data-${string}`; id?: string; data: unknown };\n\n/** The AI SDK's `UIMessage`, with the parts above. */\nexport interface UIMessage {\n  id: string;\n  role: 'system' | 'user' | 'assistant';\n  metadata?: unknown;\n  parts: UIMessagePart[];\n}\n\n/** Where a sub-agent is: working, finished, failed, or paused until a later run (AG-UI's `suspended`). */\nexport type SubagentStatus = 'running' | 'done' | 'error' | 'suspended';\n\n/** A sub-agent's work, in its parent's message (lib/ai.ts's `SubagentPart`, with these parts). */\nexport interface SubagentPart {\n  type: 'data-signoff-subagent';\n  id?: string;\n  data: {\n    subagentRunId: string;\n    parentToolCallId?: string | undefined;\n    name?: string | undefined;\n    status: SubagentStatus;\n    errorText?: string | undefined;\n    parts: UIMessagePart[];\n  };\n}\n",
      "type": "registry:lib",
      "target": "components/signoff-ui/lib/ai-types.ts"
    },
    {
      "path": "packages/signoff-ui/src/lib/usage.ts",
      "content": "import type { LanguageModelUsage, RunUsage } from './ai-types';\n\n/** USD per million tokens. */\nexport interface ModelPricing {\n  input: number;\n  output: number;\n  /** Price for cache-read input tokens. Defaults to `input`. */\n  cachedInput?: number | undefined;\n  /** Price for input tokens written to the prompt cache (e.g. 1.25x input on Anthropic). Defaults to `input`. */\n  cacheWrite?: number | undefined;\n}\n\nexport interface CostBreakdown {\n  /** Input tokens that were neither read from nor written to the cache. */\n  input: number;\n  cachedInput: number;\n  cacheWrite: number;\n  output: number;\n  total: number;\n}\n\n/** Estimate the cost of a run from AI SDK usage and per-million-token pricing. */\nexport function estimateCost(usage: RunUsage | undefined, pricing: ModelPricing): CostBreakdown {\n  const inputTokens = usage?.inputTokens ?? 0;\n  // `inputTokens` includes cache reads and writes; never count more of either than it holds.\n  const cached = Math.min(usage?.inputTokenDetails?.cacheReadTokens ?? 0, inputTokens);\n  const written = Math.min(usage?.inputTokenDetails?.cacheWriteTokens ?? 0, inputTokens - cached);\n  const fresh = inputTokens - cached - written;\n  const output = usage?.outputTokens ?? 0;\n  const c = {\n    input: (fresh * pricing.input) / 1e6,\n    cachedInput: (cached * (pricing.cachedInput ?? pricing.input)) / 1e6,\n    cacheWrite: (written * (pricing.cacheWrite ?? pricing.input)) / 1e6,\n    output: (output * pricing.output) / 1e6,\n  };\n  return { ...c, total: c.input + c.cachedInput + c.cacheWrite + c.output };\n}\n\nconst sum = (a: number | undefined, b: number | undefined) =>\n  a === undefined && b === undefined ? undefined : (a ?? 0) + (b ?? 0);\n\n/**\n * Add two usages field by field. A run that continues after an approval or a\n * client-side tool is a new request with its own `totalUsage`, and `useChat`\n * replaces `metadata.usage` rather than adding to it, so sum on the server:\n * `addUsage(lastMessage.metadata?.usage, part.totalUsage)`.\n */\nexport function addUsage(a: RunUsage | undefined, b: RunUsage | undefined): LanguageModelUsage {\n  return {\n    inputTokens: sum(a?.inputTokens, b?.inputTokens),\n    inputTokenDetails: {\n      noCacheTokens: sum(a?.inputTokenDetails?.noCacheTokens, b?.inputTokenDetails?.noCacheTokens),\n      cacheReadTokens: sum(a?.inputTokenDetails?.cacheReadTokens, b?.inputTokenDetails?.cacheReadTokens),\n      cacheWriteTokens: sum(a?.inputTokenDetails?.cacheWriteTokens, b?.inputTokenDetails?.cacheWriteTokens),\n    },\n    outputTokens: sum(a?.outputTokens, b?.outputTokens),\n    outputTokenDetails: {\n      textTokens: sum(a?.outputTokenDetails?.textTokens, b?.outputTokenDetails?.textTokens),\n      reasoningTokens: sum(a?.outputTokenDetails?.reasoningTokens, b?.outputTokenDetails?.reasoningTokens),\n    },\n    totalTokens: sum(a?.totalTokens, b?.totalTokens),\n  };\n}\n",
      "type": "registry:lib",
      "target": "components/signoff-ui/lib/usage.ts"
    }
  ],
  "cssVars": {
    "theme": {
      "color-signoff-bg": "var(--signoff-bg)",
      "color-signoff-surface": "var(--signoff-surface)",
      "color-signoff-surface-2": "var(--signoff-surface-2)",
      "color-signoff-border": "var(--signoff-border)",
      "color-signoff-border-strong": "var(--signoff-border-strong)",
      "color-signoff-fg": "var(--signoff-fg)",
      "color-signoff-fg-muted": "var(--signoff-fg-muted)",
      "color-signoff-fg-subtle": "var(--signoff-fg-subtle)",
      "color-signoff-accent": "var(--signoff-accent)",
      "color-signoff-accent-fg": "var(--signoff-accent-fg)",
      "color-signoff-on-accent": "var(--signoff-on-accent)",
      "color-signoff-hot": "var(--signoff-hot)",
      "color-signoff-hot-fg": "var(--signoff-hot-fg)",
      "color-signoff-on-hot": "var(--signoff-on-hot)",
      "color-signoff-warn": "var(--signoff-warn)",
      "color-signoff-warn-fg": "var(--signoff-warn-fg)",
      "color-signoff-ring": "var(--signoff-ring)",
      "color-signoff-add": "var(--signoff-add-bg)",
      "color-signoff-add-strong": "var(--signoff-add-strong)",
      "color-signoff-del": "var(--signoff-del-bg)",
      "color-signoff-del-strong": "var(--signoff-del-strong)",
      "color-signoff-chart-input": "var(--signoff-chart-input)",
      "color-signoff-chart-output": "var(--signoff-chart-output)",
      "color-signoff-code-keyword": "var(--signoff-code-keyword)",
      "color-signoff-code-string": "var(--signoff-code-string)",
      "color-signoff-code-number": "var(--signoff-code-number)",
      "color-signoff-code-comment": "var(--signoff-code-comment)",
      "color-signoff-code-punctuation": "var(--signoff-code-punctuation)",
      "radius-signoff": "var(--signoff-radius)",
      "font-signoff-sans": "var(--signoff-font-sans)",
      "font-signoff-mono": "var(--signoff-font-mono)",
      "animate-signoff-shimmer": "signoff-shimmer 2.2s linear infinite",
      "animate-signoff-ping": "signoff-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite",
      "animate-signoff-spin": "signoff-spin 0.9s linear infinite",
      "animate-signoff-blink": "signoff-blink 1.1s steps(2, start) infinite",
      "animate-signoff-enter": "signoff-enter 0.32s cubic-bezier(0.2, 0.7, 0.2, 1) backwards",
      "animate-signoff-indeterminate": "signoff-indeterminate 1.4s ease-in-out infinite",
      "animate-signoff-expand": "signoff-expand 0.22s cubic-bezier(0.2, 0.7, 0.2, 1)",
      "animate-signoff-collapse": "signoff-collapse 0.18s ease-in"
    },
    "light": {
      "signoff-bg": "#ffffff",
      "signoff-surface": "#f6f7f9",
      "signoff-surface-2": "#eef0f3",
      "signoff-border": "#e2e5ea",
      "signoff-border-strong": "#cdd2d9",
      "signoff-fg": "#0d0f12",
      "signoff-fg-muted": "#4b5563",
      "signoff-fg-subtle": "#5f6875",
      "signoff-accent": "#0e7490",
      "signoff-accent-fg": "#155e75",
      "signoff-on-accent": "#ffffff",
      "signoff-hot": "#be185d",
      "signoff-hot-fg": "#9d174d",
      "signoff-on-hot": "#ffffff",
      "signoff-warn": "#b45309",
      "signoff-warn-fg": "#92400e",
      "signoff-ring": "#0e7490",
      "signoff-add-bg": "rgb(8 145 178 / 0.08)",
      "signoff-add-strong": "rgb(8 145 178 / 0.16)",
      "signoff-del-bg": "rgb(190 24 93 / 0.07)",
      "signoff-del-strong": "rgb(190 24 93 / 0.14)",
      "signoff-chart-input": "#0891b2",
      "signoff-chart-output": "#db2777",
      "signoff-code-keyword": "#155e75",
      "signoff-code-string": "#9a3412",
      "signoff-code-number": "#9d174d",
      "signoff-code-comment": "#525b67",
      "signoff-code-punctuation": "#4b5563",
      "signoff-radius": "0.75rem",
      "signoff-font-sans": "var(--font-sans, var(--font-geist-sans, ui-sans-serif, system-ui, sans-serif))",
      "signoff-font-mono": "var(--font-mono, var(--font-geist-mono, ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace))"
    },
    "dark": {
      "signoff-bg": "#0d0f12",
      "signoff-surface": "#181c22",
      "signoff-surface-2": "#1e232a",
      "signoff-border": "#262b33",
      "signoff-border-strong": "#353c47",
      "signoff-fg": "#e8eaed",
      "signoff-fg-muted": "#a1a9b4",
      "signoff-fg-subtle": "#8b94a0",
      "signoff-accent": "#22d3ee",
      "signoff-accent-fg": "#67e8f9",
      "signoff-on-accent": "#0d0f12",
      "signoff-hot": "#f0468a",
      "signoff-hot-fg": "#f472a8",
      "signoff-on-hot": "#0d0f12",
      "signoff-warn": "#fbbf24",
      "signoff-warn-fg": "#fcd34d",
      "signoff-ring": "#67e8f9",
      "signoff-add-bg": "rgb(34 211 238 / 0.08)",
      "signoff-add-strong": "rgb(34 211 238 / 0.14)",
      "signoff-del-bg": "rgb(240 70 138 / 0.08)",
      "signoff-del-strong": "rgb(240 70 138 / 0.26)",
      "signoff-chart-input": "#11a2bc",
      "signoff-chart-output": "#f0468a",
      "signoff-code-keyword": "#67e8f9",
      "signoff-code-string": "#f5c27a",
      "signoff-code-number": "#f9a8d4",
      "signoff-code-comment": "#a1a9b4",
      "signoff-code-punctuation": "#a1a9b4"
    }
  },
  "css": {
    "@keyframes signoff-shimmer": {
      "from": {
        "background-position": "200% 0"
      },
      "to": {
        "background-position": "-200% 0"
      }
    },
    "@keyframes signoff-ping": {
      "0%": {
        "transform": "scale(1)",
        "opacity": "0.7"
      },
      "80%, 100%": {
        "transform": "scale(2.2)",
        "opacity": "0"
      }
    },
    "@keyframes signoff-spin": {
      "to": {
        "transform": "rotate(360deg)"
      }
    },
    "@keyframes signoff-blink": {
      "to": {
        "visibility": "hidden"
      }
    },
    "@keyframes signoff-enter": {
      "from": {
        "opacity": "0",
        "transform": "translateY(4px)"
      },
      "to": {
        "opacity": "1",
        "transform": "none"
      }
    },
    "@keyframes signoff-expand": {
      "from": {
        "height": "0",
        "opacity": "0"
      },
      "to": {
        "height": "var(--radix-collapsible-content-height)",
        "opacity": "1"
      }
    },
    "@keyframes signoff-collapse": {
      "from": {
        "height": "var(--radix-collapsible-content-height)",
        "opacity": "1"
      },
      "to": {
        "height": "0",
        "opacity": "0"
      }
    },
    "@keyframes signoff-indeterminate": {
      "0%": {
        "transform": "translateX(-100%)"
      },
      "100%": {
        "transform": "translateX(250%)"
      }
    }
  },
  "type": "registry:component",
  "meta": {
    "version": "0.14.1",
    "unreleasedChanges": false
  }
}
