diff --git a/src/components/AgentProgressLine.tsx b/src/components/AgentProgressLine.tsx
index 8de2fb060..7580160e7 100644
--- a/src/components/AgentProgressLine.tsx
+++ b/src/components/AgentProgressLine.tsx
@@ -1,135 +1,105 @@
-import { c as _c } from "react/compiler-runtime";
-import * as React from 'react';
-import { Box, Text } from '../ink.js';
-import { formatNumber } from '../utils/format.js';
-import type { Theme } from '../utils/theme.js';
+import * as React from 'react'
+import { Box, Text } from '../ink.js'
+import { formatNumber } from '../utils/format.js'
+import type { Theme } from '../utils/theme.js'
+
type Props = {
- agentType: string;
- description?: string;
- name?: string;
- descriptionColor?: keyof Theme;
- taskDescription?: string;
- toolUseCount: number;
- tokens: number | null;
- color?: keyof Theme;
- isLast: boolean;
- isResolved: boolean;
- isError: boolean;
- isAsync?: boolean;
- shouldAnimate: boolean;
- lastToolInfo?: string | null;
- hideType?: boolean;
-};
-export function AgentProgressLine(t0) {
- const $ = _c(32);
- const {
- agentType,
- description,
- name,
- descriptionColor,
- taskDescription,
- toolUseCount,
- tokens,
- color,
- isLast,
- isResolved,
- isAsync: t1,
- lastToolInfo,
- hideType: t2
- } = t0;
- const isAsync = t1 === undefined ? false : t1;
- const hideType = t2 === undefined ? false : t2;
- const treeChar = isLast ? "\u2514\u2500" : "\u251C\u2500";
- const isBackgrounded = isAsync && isResolved;
- let t3;
- if ($[0] !== isBackgrounded || $[1] !== isResolved || $[2] !== lastToolInfo || $[3] !== taskDescription) {
- t3 = () => {
- if (!isResolved) {
- return lastToolInfo || "Initializing\u2026";
- }
- if (isBackgrounded) {
- return taskDescription ?? "Running in the background";
- }
- return "Done";
- };
- $[0] = isBackgrounded;
- $[1] = isResolved;
- $[2] = lastToolInfo;
- $[3] = taskDescription;
- $[4] = t3;
- } else {
- t3 = $[4];
- }
- const getStatusText = t3;
- let t4;
- if ($[5] !== treeChar) {
- t4 = {treeChar} ;
- $[5] = treeChar;
- $[6] = t4;
- } else {
- t4 = $[6];
- }
- const t5 = !isResolved;
- let t6;
- if ($[7] !== agentType || $[8] !== color || $[9] !== description || $[10] !== descriptionColor || $[11] !== hideType || $[12] !== name) {
- t6 = hideType ? <>{name ?? description ?? agentType}{name && description && : {description}}> : <>{agentType}{description && <>{" ("}{description}{")"}>}>;
- $[7] = agentType;
- $[8] = color;
- $[9] = description;
- $[10] = descriptionColor;
- $[11] = hideType;
- $[12] = name;
- $[13] = t6;
- } else {
- t6 = $[13];
- }
- let t7;
- if ($[14] !== isBackgrounded || $[15] !== tokens || $[16] !== toolUseCount) {
- t7 = !isBackgrounded && <>{" \xB7 "}{toolUseCount} tool {toolUseCount === 1 ? "use" : "uses"}{tokens !== null && <> · {formatNumber(tokens)} tokens>}>;
- $[14] = isBackgrounded;
- $[15] = tokens;
- $[16] = toolUseCount;
- $[17] = t7;
- } else {
- t7 = $[17];
- }
- let t8;
- if ($[18] !== t5 || $[19] !== t6 || $[20] !== t7) {
- t8 = {t6}{t7};
- $[18] = t5;
- $[19] = t6;
- $[20] = t7;
- $[21] = t8;
- } else {
- t8 = $[21];
- }
- let t9;
- if ($[22] !== t4 || $[23] !== t8) {
- t9 = {t4}{t8};
- $[22] = t4;
- $[23] = t8;
- $[24] = t9;
- } else {
- t9 = $[24];
- }
- let t10;
- if ($[25] !== getStatusText || $[26] !== isBackgrounded || $[27] !== isLast) {
- t10 = !isBackgrounded && {isLast ? " \u23BF " : "\u2502 \u23BF "}{getStatusText()};
- $[25] = getStatusText;
- $[26] = isBackgrounded;
- $[27] = isLast;
- $[28] = t10;
- } else {
- t10 = $[28];
- }
- let t11;
- if ($[29] !== t10 || $[30] !== t9) {
- t11 = {t9}{t10};
- $[29] = t10;
- $[30] = t9;
- $[31] = t11;
- } else {
- t11 = $[31];
- }
- return t11;
+ agentType: string
+ description?: string
+ name?: string
+ descriptionColor?: keyof Theme
+ taskDescription?: string
+ toolUseCount: number
+ tokens: number | null
+ color?: keyof Theme
+ isLast: boolean
+ isResolved: boolean
+ isError: boolean
+ isAsync?: boolean
+ shouldAnimate: boolean
+ lastToolInfo?: string | null
+ hideType?: boolean
+}
+
+export function AgentProgressLine({
+ agentType,
+ description,
+ name,
+ descriptionColor,
+ taskDescription,
+ toolUseCount,
+ tokens,
+ color,
+ isLast,
+ isResolved,
+ isError: _isError,
+ isAsync = false,
+ shouldAnimate: _shouldAnimate,
+ lastToolInfo,
+ hideType = false,
+}: Props): React.ReactNode {
+ const treeChar = isLast ? '└─' : '├─'
+ const isBackgrounded = isAsync && isResolved
+
+ // Determine the status text
+ const getStatusText = (): string => {
+ if (!isResolved) {
+ return lastToolInfo || 'Initializing…'
+ }
+ if (isBackgrounded) {
+ return taskDescription ?? 'Running in the background'
+ }
+ return 'Done'
+ }
+
+ return (
+
+
+ {treeChar}
+
+ {hideType ? (
+ <>
+ {name ?? description ?? agentType}
+ {name && description && : {description}}
+ >
+ ) : (
+ <>
+
+ {agentType}
+
+ {description && (
+ <>
+ {' ('}
+
+ {description}
+
+ {')'}
+ >
+ )}
+ >
+ )}
+ {!isBackgrounded && (
+ <>
+ {' · '}
+ {toolUseCount} tool {toolUseCount === 1 ? 'use' : 'uses'}
+ {tokens !== null && <> · {formatNumber(tokens)} tokens>}
+ >
+ )}
+
+
+ {!isBackgrounded && (
+
+ {isLast ? ' ⎿ ' : '│ ⎿ '}
+ {getStatusText()}
+
+ )}
+
+ )
}
diff --git a/src/components/App.tsx b/src/components/App.tsx
index dc83cdc29..45e97624a 100644
--- a/src/components/App.tsx
+++ b/src/components/App.tsx
@@ -1,55 +1,37 @@
-import { c as _c } from "react/compiler-runtime";
-import React from 'react';
-import { FpsMetricsProvider } from '../context/fpsMetrics.js';
-import { StatsProvider, type StatsStore } from '../context/stats.js';
-import { type AppState, AppStateProvider } from '../state/AppState.js';
-import { onChangeAppState } from '../state/onChangeAppState.js';
-import type { FpsMetrics } from '../utils/fpsTracker.js';
+import React from 'react'
+import { FpsMetricsProvider } from '../context/fpsMetrics.js'
+import { StatsProvider, type StatsStore } from '../context/stats.js'
+import { type AppState, AppStateProvider } from '../state/AppState.js'
+import { onChangeAppState } from '../state/onChangeAppState.js'
+import type { FpsMetrics } from '../utils/fpsTracker.js'
+
type Props = {
- getFpsMetrics: () => FpsMetrics | undefined;
- stats?: StatsStore;
- initialState: AppState;
- children: React.ReactNode;
-};
+ getFpsMetrics: () => FpsMetrics | undefined
+ stats?: StatsStore
+ initialState: AppState
+ children: React.ReactNode
+}
/**
* Top-level wrapper for interactive sessions.
* Provides FPS metrics, stats context, and app state to the component tree.
*/
-export function App(t0) {
- const $ = _c(9);
- const {
- getFpsMetrics,
- stats,
- initialState,
- children
- } = t0;
- let t1;
- if ($[0] !== children || $[1] !== initialState) {
- t1 = {children};
- $[0] = children;
- $[1] = initialState;
- $[2] = t1;
- } else {
- t1 = $[2];
- }
- let t2;
- if ($[3] !== stats || $[4] !== t1) {
- t2 = {t1};
- $[3] = stats;
- $[4] = t1;
- $[5] = t2;
- } else {
- t2 = $[5];
- }
- let t3;
- if ($[6] !== getFpsMetrics || $[7] !== t2) {
- t3 = {t2};
- $[6] = getFpsMetrics;
- $[7] = t2;
- $[8] = t3;
- } else {
- t3 = $[8];
- }
- return t3;
+export function App({
+ getFpsMetrics,
+ stats,
+ initialState,
+ children,
+}: Props): React.ReactNode {
+ return (
+
+
+
+ {children}
+
+
+
+ )
}
diff --git a/src/components/ApproveApiKey.tsx b/src/components/ApproveApiKey.tsx
index 1957075f9..990f0c14e 100644
--- a/src/components/ApproveApiKey.tsx
+++ b/src/components/ApproveApiKey.tsx
@@ -1,122 +1,79 @@
-import { c as _c } from "react/compiler-runtime";
-import React from 'react';
-import { Text } from '../ink.js';
-import { saveGlobalConfig } from '../utils/config.js';
-import { Select } from './CustomSelect/index.js';
-import { Dialog } from './design-system/Dialog.js';
+import React from 'react'
+import { Text } from '../ink.js'
+import { saveGlobalConfig } from '../utils/config.js'
+import { Select } from './CustomSelect/index.js'
+import { Dialog } from './design-system/Dialog.js'
+
type Props = {
- customApiKeyTruncated: string;
- onDone(approved: boolean): void;
-};
-export function ApproveApiKey(t0) {
- const $ = _c(17);
- const {
- customApiKeyTruncated,
- onDone
- } = t0;
- let t1;
- if ($[0] !== customApiKeyTruncated || $[1] !== onDone) {
- t1 = function onChange(value) {
- bb2: switch (value) {
- case "yes":
- {
- saveGlobalConfig(current_0 => ({
- ...current_0,
- customApiKeyResponses: {
- ...current_0.customApiKeyResponses,
- approved: [...(current_0.customApiKeyResponses?.approved ?? []), customApiKeyTruncated]
- }
- }));
- onDone(true);
- break bb2;
- }
- case "no":
- {
- saveGlobalConfig(current => ({
- ...current,
- customApiKeyResponses: {
- ...current.customApiKeyResponses,
- rejected: [...(current.customApiKeyResponses?.rejected ?? []), customApiKeyTruncated]
- }
- }));
- onDone(false);
- }
- }
- };
- $[0] = customApiKeyTruncated;
- $[1] = onDone;
- $[2] = t1;
- } else {
- t1 = $[2];
- }
- const onChange = t1;
- let t2;
- if ($[3] !== onChange) {
- t2 = () => onChange("no");
- $[3] = onChange;
- $[4] = t2;
- } else {
- t2 = $[4];
- }
- let t3;
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
- t3 = ANTHROPIC_API_KEY;
- $[5] = t3;
- } else {
- t3 = $[5];
- }
- let t4;
- if ($[6] !== customApiKeyTruncated) {
- t4 = {t3}: sk-ant-...{customApiKeyTruncated};
- $[6] = customApiKeyTruncated;
- $[7] = t4;
- } else {
- t4 = $[7];
- }
- let t5;
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
- t5 = Do you want to use this API key?;
- $[8] = t5;
- } else {
- t5 = $[8];
- }
- let t6;
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
- t6 = {
- label: "Yes",
- value: "yes"
- };
- $[9] = t6;
- } else {
- t6 = $[9];
- }
- let t7;
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
- t7 = [t6, {
- label: No (recommended),
- value: "no"
- }];
- $[10] = t7;
- } else {
- t7 = $[10];
- }
- let t8;
- if ($[11] !== onChange) {
- t8 =