@agent-native/core 0.55.0 → 0.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/action-ui.d.ts +17 -0
- package/dist/action-ui.d.ts.map +1 -0
- package/dist/action-ui.js +23 -0
- package/dist/action-ui.js.map +1 -0
- package/dist/action.d.ts +8 -1
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +3 -0
- package/dist/action.js.map +1 -1
- package/dist/agent/production-agent.d.ts +2 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +7 -1
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts +4 -0
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +4 -0
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/agent/types.d.ts +2 -0
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +6 -4
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/chat/index.d.ts +5 -3
- package/dist/client/chat/index.d.ts.map +1 -1
- package/dist/client/chat/index.js +4 -3
- package/dist/client/chat/index.js.map +1 -1
- package/dist/client/chat/run-recovery.d.ts.map +1 -1
- package/dist/client/chat/run-recovery.js +9 -5
- package/dist/client/chat/run-recovery.js.map +1 -1
- package/dist/client/chat/runtime.d.ts +354 -0
- package/dist/client/chat/runtime.d.ts.map +1 -0
- package/dist/client/chat/runtime.js +2 -0
- package/dist/client/chat/runtime.js.map +1 -0
- package/dist/client/chat/tool-call-display.d.ts +4 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +6 -5
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/chat/tool-render-registry.d.ts +11 -0
- package/dist/client/chat/tool-render-registry.d.ts.map +1 -1
- package/dist/client/chat/tool-render-registry.js +47 -1
- package/dist/client/chat/tool-render-registry.js.map +1 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.js +73 -18
- package/dist/client/chat/widgets/builtin-tool-renderers.js.map +1 -1
- package/dist/client/chat/widgets/data-widget-types.d.ts +1 -51
- package/dist/client/chat/widgets/data-widget-types.d.ts.map +1 -1
- package/dist/client/chat/widgets/data-widget-types.js +1 -92
- package/dist/client/chat/widgets/data-widget-types.js.map +1 -1
- package/dist/client/chat-view-transition.d.ts +12 -0
- package/dist/client/chat-view-transition.d.ts.map +1 -1
- package/dist/client/chat-view-transition.js +16 -0
- package/dist/client/chat-view-transition.js.map +1 -1
- package/dist/client/index.d.ts +5 -3
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +4 -3
- package/dist/client/index.js.map +1 -1
- package/dist/client/route-state.d.ts.map +1 -1
- package/dist/client/route-state.js +2 -15
- package/dist/client/route-state.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts +3 -0
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +2 -0
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/data-widgets/index.d.ts +326 -0
- package/dist/data-widgets/index.d.ts.map +1 -0
- package/dist/data-widgets/index.js +232 -0
- package/dist/data-widgets/index.js.map +1 -0
- package/dist/index.browser.d.ts +2 -0
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +2 -0
- package/dist/index.browser.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +160 -0
- package/dist/provider-api/corpus-jobs.d.ts.map +1 -1
- package/dist/provider-api/corpus-jobs.js +44 -0
- package/dist/provider-api/corpus-jobs.js.map +1 -1
- package/dist/provider-api/index.d.ts +39 -0
- package/dist/provider-api/index.d.ts.map +1 -1
- package/dist/provider-api/index.js +53 -0
- package/dist/provider-api/index.js.map +1 -1
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +5 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +5 -0
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/styles/agent-native.css +9 -2
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +1 -0
- package/dist/vite/client.js.map +1 -1
- package/docs/content/actions.md +52 -0
- package/docs/content/components.md +24 -1
- package/docs/content/drop-in-agent.md +9 -2
- package/docs/content/faq.md +5 -4
- package/docs/content/getting-started.md +39 -88
- package/docs/content/key-concepts.md +22 -22
- package/docs/content/mcp-apps.md +1 -1
- package/docs/content/native-chat-ui.md +210 -0
- package/docs/content/what-is-agent-native.md +2 -2
- package/package.json +2 -1
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
export { AgentChatHome, type AgentChatHomeProps } from "../AgentChatHome.js";
|
|
2
2
|
export { AgentChatSurface, AgentPanel, AgentSidebar, AgentToggleButton, focusAgentChat, type AgentChatSurfaceMode, type AgentChatSurfaceProps, type AgentPanelProps, type AgentSidebarProps, } from "../AgentPanel.js";
|
|
3
|
-
export { AGENT_CHAT_VIEW_TRANSITION_CLASS, AGENT_CHAT_VIEW_TRANSITION_NAME, getAgentChatViewTransitionStyle, startAgentChatViewTransition, supportsAgentChatViewTransition, type AgentChatViewTransition, type AgentChatViewTransitionOptions, } from "../chat-view-transition.js";
|
|
3
|
+
export { AGENT_CHAT_VIEW_TRANSITION_CLASS, AGENT_CHAT_VIEW_TRANSITION_NAME, getAgentChatViewTransitionStyle, navigateWithAgentChatViewTransition, startAgentChatViewTransition, supportsAgentChatViewTransition, type AgentChatViewTransition, type AgentChatViewTransitionOptions, } from "../chat-view-transition.js";
|
|
4
4
|
export { AssistantChat, clearChatStorage, type AssistantChatProps, type AssistantChatHandle, type AssistantChatAdapterContext, } from "../AssistantChat.js";
|
|
5
5
|
export { MultiTabAssistantChat, type MultiTabAssistantChatProps, type MultiTabAssistantChatHeaderProps, } from "../MultiTabAssistantChat.js";
|
|
6
6
|
export { createAgentChatAdapter, type AgentChatSurfaceKind, type CreateAgentChatAdapterOptions, } from "../agent-chat-adapter.js";
|
|
7
7
|
export { codeAgentTranscriptEventsToContent, createCodeAgentChatAdapter, type CodeAgentChatController, type CodeAgentChatControlResult, type CodeAgentChatFollowUpMode, type CodeAgentChatTranscriptEvent, type CreateCodeAgentChatAdapterOptions, } from "../code-agent-chat-adapter.js";
|
|
8
|
+
export type * from "./runtime.js";
|
|
8
9
|
export { sendToAgentChat, type AgentChatMessage } from "../agent-chat.js";
|
|
9
10
|
export { useAgentChatGenerating } from "../use-agent-chat.js";
|
|
10
11
|
export { useSendToAgentChat } from "../use-send-to-agent-chat.js";
|
|
11
12
|
export { requestAgentSidebarOpen, SIDEBAR_STATE_CHANGE_EVENT, setAgentSidebarOpenPreference, type AgentSidebarStateChangeDetail, type AgentSidebarStateMode, type AgentSidebarStateSource, } from "../agent-sidebar-state.js";
|
|
12
|
-
export { clearReservedToolRenderersForTests, clearToolRenderersForTests, registerReservedToolRenderer, registerToolRenderer, resolveToolRenderer, type ToolRendererComponent, type ToolRendererContext, type ToolRendererMatch, type ToolRendererProps, type ToolRendererRegistration, } from "./tool-render-registry.js";
|
|
13
|
-
export {
|
|
13
|
+
export { clearReservedToolRenderersForTests, clearToolRenderersForTests, registerActionChatRenderer, registerFallbackToolRenderer, registerReservedActionChatRenderer, registerReservedFallbackToolRenderer, registerReservedToolRenderer, registerToolRenderer, resolveToolRenderer, type ActionChatRendererRegistration, type ToolRendererComponent, type ToolRendererContext, type ToolRendererMatch, type ToolRendererProps, type ToolRendererRegistration, } from "./tool-render-registry.js";
|
|
14
|
+
export { ACTION_CHAT_UI_DATA_CHART_RENDERER, ACTION_CHAT_UI_DATA_INSIGHTS_RENDERER, ACTION_CHAT_UI_DATA_TABLE_RENDERER, ACTION_CHAT_UI_DATA_WIDGET_RENDERER, type ActionChatUIConfig, } from "../../action-ui.js";
|
|
15
|
+
export { DATA_CHART_WIDGET, DATA_INSIGHTS_WIDGET, DATA_TABLE_WIDGET, createDataChartWidgetResult, createDataInsightsWidgetResult, createDataTableWidgetResult, dataChartWidgetResultSchema, dataChartWidgetSchema, dataInsightsWidgetResultSchema, dataTableWidgetResultSchema, dataTableWidgetSchema, dataWidgetResultSchema, isDataChartWidget, isDataTableWidget, isDataWidgetResult, normalizeDataWidgetKind, normalizeDataWidgetResult, type DataChartSeriesDefinition, type DataChartWidget, type DataChartWidgetResult, type DataChartWidgetResultInput, type DataInsightsWidgetResult, type DataInsightsWidgetResultInput, type DataTableColumn, type DataTableWidget, type DataTableWidgetResult, type DataTableWidgetResultInput, type DataWidgetDisplay, type DataWidgetKind, type DataWidgetResult, type DataWidgetResultMetadata, } from "./widgets/data-widget-types.js";
|
|
14
16
|
export { useChatModels, type UseChatModelsResult, type EngineModelGroup, } from "../use-chat-models.js";
|
|
15
17
|
export { useChatThreads, type ChatThreadScope, type ChatThreadSnapshot, type ChatThreadSummary, type ChatThreadData, type UseChatThreadsOptions, } from "../use-chat-threads.js";
|
|
16
18
|
export * from "../composer/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/chat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gCAAgC,EAChC,+BAA+B,EAC/B,+BAA+B,EAC/B,4BAA4B,EAC5B,+BAA+B,EAC/B,KAAK,uBAAuB,EAC5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K,gBAAgB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,qBAAqB,GAC3B,MAAM,wBAAwB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { AgentChatHome } from "../AgentChatHome.js";
|
|
2
2
|
export { AgentChatSurface, AgentPanel, AgentSidebar, AgentToggleButton, focusAgentChat, } from "../AgentPanel.js";
|
|
3
|
-
export { AGENT_CHAT_VIEW_TRANSITION_CLASS, AGENT_CHAT_VIEW_TRANSITION_NAME, getAgentChatViewTransitionStyle, startAgentChatViewTransition, supportsAgentChatViewTransition, } from "../chat-view-transition.js";
|
|
3
|
+
export { AGENT_CHAT_VIEW_TRANSITION_CLASS, AGENT_CHAT_VIEW_TRANSITION_NAME, getAgentChatViewTransitionStyle, navigateWithAgentChatViewTransition, startAgentChatViewTransition, supportsAgentChatViewTransition, } from "../chat-view-transition.js";
|
|
4
4
|
export { AssistantChat, clearChatStorage, } from "../AssistantChat.js";
|
|
5
5
|
export { MultiTabAssistantChat, } from "../MultiTabAssistantChat.js";
|
|
6
6
|
export { createAgentChatAdapter, } from "../agent-chat-adapter.js";
|
|
@@ -9,8 +9,9 @@ export { sendToAgentChat } from "../agent-chat.js";
|
|
|
9
9
|
export { useAgentChatGenerating } from "../use-agent-chat.js";
|
|
10
10
|
export { useSendToAgentChat } from "../use-send-to-agent-chat.js";
|
|
11
11
|
export { requestAgentSidebarOpen, SIDEBAR_STATE_CHANGE_EVENT, setAgentSidebarOpenPreference, } from "../agent-sidebar-state.js";
|
|
12
|
-
export { clearReservedToolRenderersForTests, clearToolRenderersForTests, registerReservedToolRenderer, registerToolRenderer, resolveToolRenderer, } from "./tool-render-registry.js";
|
|
13
|
-
export {
|
|
12
|
+
export { clearReservedToolRenderersForTests, clearToolRenderersForTests, registerActionChatRenderer, registerFallbackToolRenderer, registerReservedActionChatRenderer, registerReservedFallbackToolRenderer, registerReservedToolRenderer, registerToolRenderer, resolveToolRenderer, } from "./tool-render-registry.js";
|
|
13
|
+
export { ACTION_CHAT_UI_DATA_CHART_RENDERER, ACTION_CHAT_UI_DATA_INSIGHTS_RENDERER, ACTION_CHAT_UI_DATA_TABLE_RENDERER, ACTION_CHAT_UI_DATA_WIDGET_RENDERER, } from "../../action-ui.js";
|
|
14
|
+
export { DATA_CHART_WIDGET, DATA_INSIGHTS_WIDGET, DATA_TABLE_WIDGET, createDataChartWidgetResult, createDataInsightsWidgetResult, createDataTableWidgetResult, dataChartWidgetResultSchema, dataChartWidgetSchema, dataInsightsWidgetResultSchema, dataTableWidgetResultSchema, dataTableWidgetSchema, dataWidgetResultSchema, isDataChartWidget, isDataTableWidget, isDataWidgetResult, normalizeDataWidgetKind, normalizeDataWidgetResult, } from "./widgets/data-widget-types.js";
|
|
14
15
|
export { useChatModels, } from "../use-chat-models.js";
|
|
15
16
|
export { useChatThreads, } from "../use-chat-threads.js";
|
|
16
17
|
export * from "../composer/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/chat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA2B,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,cAAc,GAKf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gCAAgC,EAChC,+BAA+B,EAC/B,+BAA+B,EAC/B,4BAA4B,EAC5B,+BAA+B,GAGhC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,aAAa,EACb,gBAAgB,GAIjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,GAGtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,sBAAsB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AiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,2BAA2B,EAC3B,8BAA8B,EAC9B,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,EACrB,8BAA8B,EAC9B,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,GAe1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,aAAa,GAGd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,GAMf,MAAM,wBAAwB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC","sourcesContent":["export { AgentChatHome, type AgentChatHomeProps } from \"../AgentChatHome.js\";\nexport {\n AgentChatSurface,\n AgentPanel,\n AgentSidebar,\n AgentToggleButton,\n focusAgentChat,\n type AgentChatSurfaceMode,\n type AgentChatSurfaceProps,\n type AgentPanelProps,\n type AgentSidebarProps,\n} from \"../AgentPanel.js\";\nexport {\n AGENT_CHAT_VIEW_TRANSITION_CLASS,\n AGENT_CHAT_VIEW_TRANSITION_NAME,\n getAgentChatViewTransitionStyle,\n navigateWithAgentChatViewTransition,\n startAgentChatViewTransition,\n supportsAgentChatViewTransition,\n type AgentChatViewTransition,\n type AgentChatViewTransitionOptions,\n} from \"../chat-view-transition.js\";\nexport {\n AssistantChat,\n clearChatStorage,\n type AssistantChatProps,\n type AssistantChatHandle,\n type AssistantChatAdapterContext,\n} from \"../AssistantChat.js\";\nexport {\n MultiTabAssistantChat,\n type MultiTabAssistantChatProps,\n type MultiTabAssistantChatHeaderProps,\n} from \"../MultiTabAssistantChat.js\";\nexport {\n createAgentChatAdapter,\n type AgentChatSurfaceKind,\n type CreateAgentChatAdapterOptions,\n} from \"../agent-chat-adapter.js\";\nexport {\n codeAgentTranscriptEventsToContent,\n createCodeAgentChatAdapter,\n type CodeAgentChatController,\n type CodeAgentChatControlResult,\n type CodeAgentChatFollowUpMode,\n type CodeAgentChatTranscriptEvent,\n type CreateCodeAgentChatAdapterOptions,\n} from \"../code-agent-chat-adapter.js\";\nexport type * from \"./runtime.js\";\nexport { sendToAgentChat, type AgentChatMessage } from \"../agent-chat.js\";\nexport { useAgentChatGenerating } from \"../use-agent-chat.js\";\nexport { useSendToAgentChat } from \"../use-send-to-agent-chat.js\";\nexport {\n requestAgentSidebarOpen,\n SIDEBAR_STATE_CHANGE_EVENT,\n setAgentSidebarOpenPreference,\n type AgentSidebarStateChangeDetail,\n type AgentSidebarStateMode,\n type AgentSidebarStateSource,\n} from \"../agent-sidebar-state.js\";\nexport {\n clearReservedToolRenderersForTests,\n clearToolRenderersForTests,\n registerActionChatRenderer,\n registerFallbackToolRenderer,\n registerReservedActionChatRenderer,\n registerReservedFallbackToolRenderer,\n registerReservedToolRenderer,\n registerToolRenderer,\n resolveToolRenderer,\n type ActionChatRendererRegistration,\n type ToolRendererComponent,\n type ToolRendererContext,\n type ToolRendererMatch,\n type ToolRendererProps,\n type ToolRendererRegistration,\n} from \"./tool-render-registry.js\";\nexport {\n ACTION_CHAT_UI_DATA_CHART_RENDERER,\n ACTION_CHAT_UI_DATA_INSIGHTS_RENDERER,\n ACTION_CHAT_UI_DATA_TABLE_RENDERER,\n ACTION_CHAT_UI_DATA_WIDGET_RENDERER,\n type ActionChatUIConfig,\n} from \"../../action-ui.js\";\nexport {\n DATA_CHART_WIDGET,\n DATA_INSIGHTS_WIDGET,\n DATA_TABLE_WIDGET,\n createDataChartWidgetResult,\n createDataInsightsWidgetResult,\n createDataTableWidgetResult,\n dataChartWidgetResultSchema,\n dataChartWidgetSchema,\n dataInsightsWidgetResultSchema,\n dataTableWidgetResultSchema,\n dataTableWidgetSchema,\n dataWidgetResultSchema,\n isDataChartWidget,\n isDataTableWidget,\n isDataWidgetResult,\n normalizeDataWidgetKind,\n normalizeDataWidgetResult,\n type DataChartSeriesDefinition,\n type DataChartWidget,\n type DataChartWidgetResult,\n type DataChartWidgetResultInput,\n type DataInsightsWidgetResult,\n type DataInsightsWidgetResultInput,\n type DataTableColumn,\n type DataTableWidget,\n type DataTableWidgetResult,\n type DataTableWidgetResultInput,\n type DataWidgetDisplay,\n type DataWidgetKind,\n type DataWidgetResult,\n type DataWidgetResultMetadata,\n} from \"./widgets/data-widget-types.js\";\nexport {\n useChatModels,\n type UseChatModelsResult,\n type EngineModelGroup,\n} from \"../use-chat-models.js\";\nexport {\n useChatThreads,\n type ChatThreadScope,\n type ChatThreadSnapshot,\n type ChatThreadSummary,\n type ChatThreadData,\n type UseChatThreadsOptions,\n} from \"../use-chat-threads.js\";\nexport * from \"../composer/index.js\";\nexport * from \"../conversation/index.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-recovery.d.ts","sourceRoot":"","sources":["../../../src/client/chat/run-recovery.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-recovery.d.ts","sourceRoot":"","sources":["../../../src/client/chat/run-recovery.tsx"],"names":[],"mappings":"AAmCA,MAAM,MAAM,aAAa,GAAG;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvD,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAgBF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAc3E;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,GAAG,IAAI,CAgCzE;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,GACf,KAAK,GAAG,MAAM,GAAG,IAAI,CASvB;AA4DD,wBAAgB,iBAAiB,CAAC,EAChC,OAAmB,EACnB,WAAW,GACZ,EAAE;IACD,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B,2CAgGA;AAaD,wBAAgB,aAAa,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,2CAoG1E;AAID,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,WAAW,GACZ,EAAE;IACD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,2CAmDA;AAID,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,UAAU,EACV,OAAO,EACP,MAAM,EACN,SAAS,GACV,EAAE;IACD,IAAI,EAAE,YAAY,CAAC;IACnB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;IACxD,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,2CAgNA;AAID,wBAAgB,qBAAqB,CAAC,EACpC,IAAI,EACJ,UAAU,GACX,EAAE;IACD,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,2CA0KA;AAID,wBAAgB,eAAe,CAAC,EAC9B,gBAAgB,EAChB,eAAe,EACf,aAAa,GACd,EAAE;IACD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,2CAyCA"}
|
|
@@ -9,7 +9,7 @@ import { saveAgentEngineApiKey, } from "../agent-engine-key.js";
|
|
|
9
9
|
import { cn } from "../utils.js";
|
|
10
10
|
import { writeClipboardText } from "../clipboard.js";
|
|
11
11
|
import { agentNativePath } from "../api-path.js";
|
|
12
|
-
import { IconLoader2, IconCheck, IconCopy, IconX, IconChevronDown, IconExternalLink, IconKey, IconGitFork,
|
|
12
|
+
import { IconLoader2, IconCheck, IconCopy, IconX, IconChevronDown, IconExternalLink, IconKey, IconGitFork, IconGauge, IconSettings, IconArrowRight, IconAlertTriangle, IconPlayerPlay, IconRefresh, IconPlus, IconClipboardList, } from "@tabler/icons-react";
|
|
13
13
|
// ─── Metadata extractors ──────────────────────────────────────────────────────
|
|
14
14
|
export function getLoopLimitMetadata(message) {
|
|
15
15
|
const meta = message?.metadata;
|
|
@@ -105,9 +105,13 @@ export function BuilderConnectCta({ variant = "primary", onConnected, }) {
|
|
|
105
105
|
trackingSource: "assistant_chat_builder_cta",
|
|
106
106
|
onConnected,
|
|
107
107
|
});
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
if (variant === "compact") {
|
|
109
|
+
if (configured) {
|
|
110
|
+
return (_jsxs("span", { className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-2.5 text-[11px] font-medium text-foreground", children: [_jsx(IconCheck, { size: 11, className: "text-emerald-500" }), orgName ? `Connected to ${orgName}` : "Connected"] }));
|
|
111
|
+
}
|
|
112
|
+
return (_jsxs("div", { className: "flex min-w-0 flex-col items-start gap-1 sm:items-end", children: [_jsx("button", { type: "button", onClick: () => start(), disabled: connecting, className: "inline-flex h-8 shrink-0 items-center gap-1 rounded-md bg-foreground px-3 text-[11px] font-medium text-background hover:opacity-90 disabled:cursor-wait disabled:opacity-60", "aria-busy": connecting, children: connecting ? (_jsxs(_Fragment, { children: [_jsx(IconLoader2, { size: 10, className: "animate-spin" }), "Waiting\u2026"] })) : ("Connect Builder.io") }), error && (_jsx("p", { className: "max-w-[13rem] text-[10px] leading-snug text-destructive sm:text-right", children: error }))] }));
|
|
113
|
+
}
|
|
114
|
+
const containerClass = "flex items-center gap-3 rounded-md border border-border px-3 py-3";
|
|
111
115
|
if (configured) {
|
|
112
116
|
return (_jsxs("div", { className: containerClass, children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "text-xs font-medium text-foreground", children: "Builder.io" }), _jsx("p", { className: "text-[11px] text-muted-foreground mt-0.5", children: orgName ? `Connected — ${orgName}` : "Connected" })] }), _jsxs("span", { className: "ml-auto inline-flex items-center gap-1 shrink-0 rounded-md bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-500", children: [_jsx(IconCheck, { size: 10 }), "Connected"] })] }));
|
|
113
117
|
}
|
|
@@ -179,7 +183,7 @@ export function BuilderSetupCard({ onConnected, bouncePulse, }) {
|
|
|
179
183
|
void el.offsetWidth;
|
|
180
184
|
el.classList.add("animate-bounce-once");
|
|
181
185
|
}, [bouncePulse]);
|
|
182
|
-
return (
|
|
186
|
+
return (_jsx("div", { ref: cardRef, className: "mx-auto w-full max-w-[34rem] px-3 pb-2", children: _jsxs("div", { className: "rounded-lg border border-border/80 bg-background/80 p-3 shadow-sm backdrop-blur", children: [_jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("h3", { className: "text-[13px] font-medium text-foreground", children: "Connect AI" }), _jsx("p", { className: "mt-0.5 text-[11px] leading-relaxed text-muted-foreground", children: "Use Builder.io, or add an Anthropic/OpenAI key." })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(BuilderConnectCta, { variant: "compact", onConnected: onConnected }), _jsx("button", { type: "button", onClick: () => setKeyOpen((open) => !open), className: "inline-flex h-8 shrink-0 items-center rounded-md border border-border bg-background px-3 text-[11px] font-medium text-foreground hover:bg-accent", "aria-expanded": keyOpen, children: "Use API key" })] })] }), keyOpen ? (_jsx("div", { className: "mt-3", children: _jsx(ApiKeyConnect, { onConnected: onConnected }) })) : null] }) }));
|
|
183
187
|
}
|
|
184
188
|
// ─── RunErrorRecoveryCard ─────────────────────────────────────────────────────
|
|
185
189
|
export function RunErrorRecoveryCard({ info, onContinue, onRetry, onFork, onD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AAO,CACL,cAAK,SAAS,EAAC,oBAAoB,YACjC,cAAK,SAAS,EAAC,+EAA+E,YAC5F,eAAK,SAAS,EAAC,2BAA2B,aACxC,eAAM,SAAS,EAAC,8GAA8G,YAC5H,KAAC,iBAAiB,IAAC,IAAI,EAAE,EAAE,GAAI,GAC1B,EACP,eAAK,SAAS,EAAC,gBAAgB,aAC7B,YAAG,SAAS,EAAC,qCAAqC,YAC/C,gBAAgB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,GAClD,EACJ,YAAG,SAAS,EAAC,sDAAsD,YAChE,gBAAgB;oCACf,CAAC,CAAC,0CAA0C;oCAC5C,CAAC,CAAC,4DAA4D,GAC9D,IACA,EACL,gBAAgB,CAAC,CAAC,CAAC,CAClB,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,eAAe,EACxB,SAAS,EAAC,kIAAkI,aAE5I,KAAC,cAAc,IAAC,IAAI,EAAE,EAAE,GAAI,sBAErB,CACV,CAAC,CAAC,CAAC,CACF,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,aAAa,EACtB,SAAS,EAAC,sJAAsJ,oBAGhK,KAAC,cAAc,IAAC,IAAI,EAAE,EAAE,GAAI,IACrB,CACV,IACG,GACF,GACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Owns: run-error metadata extractors, recovery helpers, RunErrorRecoveryCard,\n// LoopLimitContinueCard, BuilderConnectCta, BuilderSetupCard, ApiKeyConnect,\n// PlanModeCallout, and getLoopLimitMetadata / getRunErrorMetadata exports used\n// by AssistantChatInner.\n\nimport { useState, useEffect, useCallback, useRef } from \"react\";\nimport { useBuilderConnectFlow } from \"../settings/useBuilderStatus.js\";\nimport {\n saveAgentEngineApiKey,\n type AgentEngineProvider,\n} from \"../agent-engine-key.js\";\nimport { cn } from \"../utils.js\";\nimport { writeClipboardText } from \"../clipboard.js\";\nimport { agentNativePath } from \"../api-path.js\";\nimport {\n IconLoader2,\n IconCheck,\n IconCopy,\n IconX,\n IconChevronDown,\n IconExternalLink,\n IconKey,\n IconGitFork,\n IconMessage,\n IconGauge,\n IconSettings,\n IconArrowRight,\n IconAlertTriangle,\n IconPlayerPlay,\n IconRefresh,\n IconPlus,\n IconClipboardList,\n} from \"@tabler/icons-react\";\n\n// ─── Type definitions ─────────────────────────────────────────────────────────\n\nexport type LoopLimitInfo = { maxIterations?: number };\n\nexport type RunErrorInfo = {\n message: string;\n details?: string;\n errorCode?: string;\n runId?: string;\n recoverable?: boolean;\n};\n\ninterface AgentLoopSettingsResponse {\n maxIterations: number;\n defaultMaxIterations: number;\n minMaxIterations: number;\n maxMaxIterations: number;\n scope: \"org\" | \"user\" | \"default\";\n source: \"org\" | \"user\" | \"env\" | \"default\";\n canUpdate: boolean;\n orgName?: string | null;\n role?: string | null;\n}\n\n// ─── Metadata extractors ──────────────────────────────────────────────────────\n\nexport function getLoopLimitMetadata(message: unknown): LoopLimitInfo | null {\n const meta = (message as { metadata?: unknown })?.metadata as\n | {\n custom?: { loopLimit?: LoopLimitInfo };\n loopLimit?: LoopLimitInfo;\n }\n | undefined;\n const loopLimit = meta?.custom?.loopLimit ?? meta?.loopLimit;\n if (!loopLimit || typeof loopLimit !== \"object\") return null;\n return {\n ...(typeof loopLimit.maxIterations === \"number\"\n ? { maxIterations: loopLimit.maxIterations }\n : {}),\n };\n}\n\nexport function getRunErrorMetadata(message: unknown): RunErrorInfo | null {\n const meta = (message as { metadata?: unknown })?.metadata as\n | {\n custom?: { runError?: RunErrorInfo; runId?: unknown };\n runError?: RunErrorInfo;\n runId?: unknown;\n }\n | undefined;\n const runError = meta?.custom?.runError ?? meta?.runError;\n if (!runError || typeof runError !== \"object\") return null;\n const messageText =\n typeof runError.message === \"string\" ? runError.message : \"\";\n if (!messageText) return null;\n const runId =\n typeof runError.runId === \"string\"\n ? runError.runId\n : typeof meta?.custom?.runId === \"string\"\n ? meta.custom.runId\n : typeof meta?.runId === \"string\"\n ? meta.runId\n : undefined;\n return {\n message: messageText,\n ...(typeof runError.details === \"string\"\n ? { details: runError.details }\n : {}),\n ...(typeof runError.errorCode === \"string\"\n ? { errorCode: runError.errorCode }\n : {}),\n ...(runId ? { runId } : {}),\n ...(runError.recoverable ? { recoverable: true } : {}),\n };\n}\n\nexport function getRequestModeMetadata(\n message: unknown,\n): \"act\" | \"plan\" | null {\n const meta = (message as { metadata?: unknown })?.metadata as\n | {\n custom?: { requestMode?: unknown };\n requestMode?: unknown;\n }\n | undefined;\n const requestMode = meta?.custom?.requestMode ?? meta?.requestMode;\n return requestMode === \"act\" || requestMode === \"plan\" ? requestMode : null;\n}\n\n// ─── Run error classifiers ────────────────────────────────────────────────────\n\nfunction isBuilderReconnectRunError(info: RunErrorInfo): boolean {\n const code = (info.errorCode ?? \"\").toLowerCase();\n const message = info.message.toLowerCase();\n const isAuthCode =\n code === \"authentication_error\" ||\n code === \"unauthorized\" ||\n code === \"http_401\" ||\n code === \"http_403\";\n return (\n code === \"builder_auth_error\" ||\n message.includes(\"builder authentication failed\") ||\n (isAuthCode &&\n (message.includes(\"invalid token\") ||\n message.includes(\"personal access token\")))\n );\n}\n\nfunction isProviderQueryRunError(info: RunErrorInfo): boolean {\n const text = [info.errorCode, info.message, info.details]\n .filter(Boolean)\n .join(\"\\n\")\n .toLowerCase();\n return (\n text.includes(\"bigquery\") ||\n text.includes(\"sql\") ||\n text.includes(\"query\") ||\n text.includes(\"schema\") ||\n text.includes(\"syntax\") ||\n text.includes(\"unknown column\") ||\n text.includes(\"unknown table\") ||\n text.includes(\"type mismatch\")\n );\n}\n\nfunction isConnectionRecoveryRunError(info: RunErrorInfo): boolean {\n const code = (info.errorCode ?? \"\").toLowerCase();\n const message = info.message.toLowerCase();\n return (\n code === \"connection_error\" ||\n message.includes(\"connection kept failing\") ||\n message.includes(\"automatic recovery attempts\")\n );\n}\n\n// ─── BuilderConnectCta ────────────────────────────────────────────────────────\n// Renders a single row with left-aligned copy and a right-aligned action.\n// Click opens the Builder CLI-auth popup via the shared\n// `useBuilderConnectFlow` hook (which owns the synchronous window.open,\n// the 2s status poll, and the focus-refresh). On success the hook broadcasts\n// a config-change event so the chat clears its local `missingApiKey` gate.\n//\n// Desktop note: when this component runs inside the Electron shell, the\n// window.open call is intercepted by the main process's webview popup handler,\n// which opens the flow in an Electron BrowserWindow that shares the webview's\n// session. See packages/desktop-app/src/main/index.ts.\n\nexport function BuilderConnectCta({\n variant = \"primary\",\n onConnected,\n}: {\n variant?: \"primary\" | \"compact\";\n onConnected?: () => void;\n}) {\n const { configured, orgName, connecting, error, start } =\n useBuilderConnectFlow({\n trackingSource: \"assistant_chat_builder_cta\",\n onConnected,\n });\n\n const containerClass =\n variant === \"compact\"\n ? \"flex items-center gap-3 rounded-md border border-border bg-background/70 px-3 py-2.5\"\n : \"flex items-center gap-3 rounded-md border border-border px-3 py-3\";\n\n if (configured) {\n return (\n <div className={containerClass}>\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-xs font-medium text-foreground\">Builder.io</div>\n <p className=\"text-[11px] text-muted-foreground mt-0.5\">\n {orgName ? `Connected — ${orgName}` : \"Connected\"}\n </p>\n </div>\n <span className=\"ml-auto inline-flex items-center gap-1 shrink-0 rounded-md bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-500\">\n <IconCheck size={10} />\n Connected\n </span>\n </div>\n );\n }\n\n return (\n <div className={containerClass}>\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-xs font-medium text-foreground\">\n Connect Builder.io\n </div>\n <p className=\"text-[11px] text-muted-foreground mt-0.5 max-w-[220px]\">\n Free credits for LLM, hosting, and more — no API key needed\n </p>\n {error && <p className=\"mt-1 text-[10px] text-destructive\">{error}</p>}\n </div>\n <button\n type=\"button\"\n onClick={() => start()}\n disabled={connecting}\n className=\"ml-auto inline-flex items-center gap-1 shrink-0 rounded-md bg-foreground px-3 py-1.5 text-[11px] font-medium no-underline text-background hover:opacity-90 disabled:opacity-60 disabled:cursor-wait\"\n aria-busy={connecting}\n >\n {connecting ? (\n <>\n <IconLoader2 size={10} className=\"animate-spin\" />\n Waiting…\n </>\n ) : (\n <>\n Connect\n <IconExternalLink size={10} />\n </>\n )}\n </button>\n </div>\n );\n}\n\n// ─── ApiKeyConnect ────────────────────────────────────────────────────────────\n\nconst API_KEY_PROVIDERS: Array<{\n value: AgentEngineProvider;\n label: string;\n placeholder: string;\n}> = [\n { value: \"anthropic\", label: \"Anthropic\", placeholder: \"sk-ant-…\" },\n { value: \"openai\", label: \"OpenAI\", placeholder: \"sk-…\" },\n];\n\nexport function ApiKeyConnect({ onConnected }: { onConnected?: () => void }) {\n const [provider, setProvider] = useState<AgentEngineProvider>(\"anthropic\");\n const [apiKey, setApiKey] = useState(\"\");\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const active = API_KEY_PROVIDERS.find((p) => p.value === provider)!;\n\n const handleSave = useCallback(async () => {\n if (!apiKey.trim() || saving) return;\n setSaving(true);\n setError(null);\n try {\n await saveAgentEngineApiKey({ provider, apiKey });\n setApiKey(\"\");\n onConnected?.();\n } catch (err) {\n setError(err instanceof Error ? err.message : \"Could not save the key.\");\n } finally {\n setSaving(false);\n }\n }, [apiKey, onConnected, provider, saving]);\n\n return (\n <div className=\"rounded-md border border-border bg-background/60 p-3\">\n <div className=\"mb-2 flex items-center gap-1.5 text-[11px] font-medium text-foreground\">\n <IconKey size={12} strokeWidth={1.9} />\n Use your own API key\n </div>\n <p className=\"mb-2.5 text-[11px] leading-relaxed text-muted-foreground\">\n Stored securely for this app only.\n </p>\n <div\n role=\"tablist\"\n aria-label=\"API key provider\"\n className=\"mb-2 inline-flex rounded-md border border-border bg-muted/40 p-0.5\"\n >\n {API_KEY_PROVIDERS.map((option) => {\n const selected = option.value === provider;\n return (\n <button\n key={option.value}\n type=\"button\"\n role=\"tab\"\n aria-selected={selected}\n onClick={() => {\n setProvider(option.value);\n setError(null);\n }}\n className={cn(\n \"rounded px-2.5 py-1 text-[11px] font-medium transition-colors\",\n selected\n ? \"bg-background text-foreground shadow-sm\"\n : \"text-muted-foreground hover:text-foreground\",\n )}\n >\n {option.label}\n </button>\n );\n })}\n </div>\n <div className=\"flex items-center gap-2\">\n <input\n type=\"password\"\n value={apiKey}\n autoComplete=\"off\"\n spellCheck={false}\n placeholder={active.placeholder}\n onChange={(e) => {\n setApiKey(e.target.value);\n if (error) setError(null);\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n void handleSave();\n }\n }}\n className=\"h-8 min-w-0 flex-1 rounded-md border border-input bg-background px-2.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 focus:ring-offset-background\"\n />\n <button\n type=\"button\"\n onClick={handleSave}\n disabled={!apiKey.trim() || saving}\n className=\"inline-flex h-8 shrink-0 items-center gap-1 rounded-md bg-foreground px-3 text-[11px] font-medium text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60\"\n >\n {saving ? (\n <>\n <IconLoader2 size={11} className=\"animate-spin\" />\n Saving…\n </>\n ) : (\n \"Save\"\n )}\n </button>\n </div>\n {error ? (\n <p className=\"mt-2 text-[11px] text-destructive\">{error}</p>\n ) : null}\n </div>\n );\n}\n\n// ─── BuilderSetupCard ─────────────────────────────────────────────────────────\n\nexport function BuilderSetupCard({\n onConnected,\n bouncePulse,\n}: {\n onConnected?: () => void;\n bouncePulse?: number;\n}) {\n // Progressive disclosure: the card leads with one-click Builder connect while\n // keeping the bring-your-own-key path close by.\n const [keyOpen, setKeyOpen] = useState(false);\n\n const cardRef = useRef<HTMLDivElement>(null);\n // Replay the bounce keyframe each time bouncePulse increments. Toggling the\n // class off-then-on (with a forced reflow) restarts the animation even when\n // the value changes back-to-back.\n useEffect(() => {\n if (!bouncePulse) return;\n const el = cardRef.current;\n if (!el) return;\n el.classList.remove(\"animate-bounce-once\");\n void el.offsetWidth;\n el.classList.add(\"animate-bounce-once\");\n }, [bouncePulse]);\n\n return (\n <div\n ref={cardRef}\n className=\"mx-auto my-4 w-full max-w-[34rem] rounded-lg border border-border/80 bg-card/80 p-3 shadow-sm backdrop-blur\"\n >\n <div className=\"mb-2.5 flex items-center gap-2.5\">\n <div className=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted\">\n <IconMessage className=\"h-4.5 w-4.5 text-muted-foreground\" />\n </div>\n <div className=\"min-w-0\">\n <h3 className=\"text-[13px] font-medium text-foreground\">\n Connect an agent engine\n </h3>\n <p className=\"mt-0.5 text-[11px] leading-relaxed text-muted-foreground\">\n Use Builder-hosted models or paste your own Anthropic/OpenAI key.\n </p>\n </div>\n </div>\n\n <div className=\"space-y-2.5\">\n <BuilderConnectCta variant=\"compact\" onConnected={onConnected} />\n\n {keyOpen ? (\n <ApiKeyConnect onConnected={onConnected} />\n ) : (\n <div className=\"flex justify-center\">\n <button\n type=\"button\"\n onClick={() => setKeyOpen(true)}\n className=\"text-[11px] text-muted-foreground underline-offset-2 hover:text-foreground hover:underline\"\n >\n Or paste your own Anthropic or OpenAI key\n </button>\n </div>\n )}\n </div>\n </div>\n );\n}\n\n// ─── RunErrorRecoveryCard ─────────────────────────────────────────────────────\n\nexport function RunErrorRecoveryCard({\n info,\n onContinue,\n onRetry,\n onFork,\n onDismiss,\n}: {\n info: RunErrorInfo;\n onContinue: () => void;\n onRetry: () => void;\n onFork?: () => void | boolean | Promise<void | boolean>;\n onDismiss: () => void;\n}) {\n const [detailsOpen, setDetailsOpen] = useState(false);\n const [copied, setCopied] = useState(false);\n const [forking, setForking] = useState(false);\n const [forkError, setForkError] = useState<string | null>(null);\n const builderReconnect = useBuilderConnectFlow({\n trackingSource: \"assistant_chat_reconnect_error\",\n });\n const canRecover = info.recoverable === true;\n const shouldShowBuilderReconnect = isBuilderReconnectRunError(info);\n const builderReconnectResolved =\n shouldShowBuilderReconnect &&\n builderReconnect.hasFetchedStatus &&\n builderReconnect.configured;\n const isQueryError = isProviderQueryRunError(info);\n const isConnectionRecoveryError = isConnectionRecoveryRunError(info);\n const copyLabel =\n info.runId || info.errorCode || info.details ? \"Copy debug\" : \"Copy\";\n const copyDetails = useCallback(() => {\n const text = [\n info.message,\n info.errorCode ? `Code: ${info.errorCode}` : \"\",\n info.runId ? `Run: ${info.runId}` : \"\",\n info.details ? `Details:\\n${info.details}` : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\\n\");\n void writeClipboardText(text).then((ok) => {\n if (!ok) return;\n setCopied(true);\n setTimeout(() => setCopied(false), 1200);\n });\n }, [info]);\n const startNewChat = useCallback(() => {\n window.dispatchEvent(new CustomEvent(\"agent-chat:new-chat\"));\n onDismiss();\n }, [onDismiss]);\n\n const handleFork = useCallback(async () => {\n if (!onFork || forking) return;\n setForking(true);\n setForkError(null);\n try {\n const result = await onFork();\n if (result === false) {\n setForkError(\"Could not fork this chat. Try starting a new chat.\");\n }\n } catch {\n setForkError(\"Could not fork this chat. Try starting a new chat.\");\n } finally {\n setForking(false);\n }\n }, [forking, onFork]);\n\n useEffect(() => {\n if (builderReconnectResolved) {\n onDismiss();\n }\n }, [builderReconnectResolved, onDismiss]);\n\n return (\n <div className=\"rounded-lg border border-amber-500/25 bg-amber-500/[0.06] p-3 text-sm\">\n <div className=\"flex items-start gap-2\">\n <span className=\"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-amber-500/10 text-amber-700 dark:text-amber-300\">\n <IconAlertTriangle size={14} />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"font-medium text-foreground\">\n {canRecover\n ? \"The agent stopped before finishing\"\n : \"The agent hit an error\"}\n </div>\n <p className=\"mt-1 text-xs leading-relaxed text-muted-foreground\">\n {info.message}\n </p>\n {shouldShowBuilderReconnect && !builderReconnectResolved && (\n <p className=\"mt-2 text-xs leading-relaxed text-muted-foreground\">\n The current Builder.io or model-provider credential was rejected.\n Reconnect Builder.io, then retry this message.\n </p>\n )}\n {isConnectionRecoveryError && (\n <p className=\"mt-2 text-xs leading-relaxed text-muted-foreground\">\n If retry lands on the same error, start a new chat session and\n continue from what already changed.\n </p>\n )}\n {(info.runId || info.errorCode || info.details) && (\n <button\n type=\"button\"\n onClick={() => setDetailsOpen((v) => !v)}\n className=\"mt-2 inline-flex items-center gap-1 text-[11px] font-medium text-muted-foreground hover:text-foreground\"\n >\n <IconChevronDown\n size={12}\n className={cn(\n \"transition-transform\",\n detailsOpen && \"rotate-180\",\n )}\n />\n Details\n </button>\n )}\n {detailsOpen && (\n <div className=\"mt-2 rounded-md border border-border/60 bg-background/70 p-2 font-mono text-[11px] leading-relaxed text-muted-foreground\">\n {info.runId && <div>run: {info.runId}</div>}\n {info.errorCode && <div>code: {info.errorCode}</div>}\n {info.details && (\n <pre className=\"mt-2 max-h-28 overflow-auto whitespace-pre-wrap break-words font-mono\">\n {info.details}\n </pre>\n )}\n </div>\n )}\n </div>\n <button\n type=\"button\"\n onClick={onDismiss}\n aria-label=\"Dismiss\"\n className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-background/80 hover:text-foreground\"\n >\n <IconX size={14} />\n </button>\n </div>\n <div className=\"mt-3 flex flex-wrap items-center gap-2\">\n {shouldShowBuilderReconnect && !builderReconnectResolved && (\n <button\n type=\"button\"\n onClick={() => builderReconnect.start()}\n disabled={builderReconnect.connecting}\n className=\"inline-flex h-8 items-center gap-1.5 rounded-md bg-foreground px-3 text-xs font-medium text-background hover:opacity-90 disabled:cursor-wait disabled:opacity-70\"\n >\n {builderReconnect.connecting ? (\n <IconLoader2 size={13} className=\"animate-spin\" />\n ) : (\n <IconExternalLink size={13} />\n )}\n {builderReconnect.connecting\n ? \"Connecting Builder.io\"\n : \"Reconnect Builder.io\"}\n </button>\n )}\n {canRecover && (\n <>\n <button\n type=\"button\"\n onClick={onContinue}\n className=\"inline-flex h-8 items-center gap-1.5 rounded-md bg-foreground px-3 text-xs font-medium text-background hover:opacity-90\"\n >\n <IconPlayerPlay size={13} />\n Continue\n </button>\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent\"\n >\n <IconRefresh size={13} />\n {isQueryError ? \"Diagnose and retry\" : \"Retry\"}\n </button>\n </>\n )}\n {canRecover && isConnectionRecoveryError && (\n <button\n type=\"button\"\n onClick={startNewChat}\n className=\"inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent\"\n >\n <IconPlus size={13} />\n New chat\n </button>\n )}\n {canRecover && onFork && !isConnectionRecoveryError && (\n <button\n type=\"button\"\n onClick={handleFork}\n disabled={forking}\n title=\"Fork this conversation into a separate chat thread.\"\n aria-label=\"Fork this conversation into a separate chat thread\"\n className=\"inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent disabled:cursor-wait disabled:opacity-70\"\n >\n {forking ? (\n <IconLoader2 size={13} className=\"animate-spin\" />\n ) : (\n <IconGitFork size={13} />\n )}\n {forking ? \"Forking...\" : \"Fork chat\"}\n </button>\n )}\n <button\n type=\"button\"\n onClick={copyDetails}\n className=\"ml-auto inline-flex h-8 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium text-muted-foreground hover:bg-background/80 hover:text-foreground\"\n >\n {copied ? <IconCheck size={13} /> : <IconCopy size={13} />}\n {copied ? \"Copied\" : copyLabel}\n </button>\n </div>\n {shouldShowBuilderReconnect && builderReconnect.error && (\n <p className=\"mt-2 text-xs leading-relaxed text-red-500\">\n {builderReconnect.error}\n </p>\n )}\n {forkError && (\n <p className=\"mt-2 text-xs leading-relaxed text-red-500\">{forkError}</p>\n )}\n </div>\n );\n}\n\n// ─── LoopLimitContinueCard ────────────────────────────────────────────────────\n\nexport function LoopLimitContinueCard({\n info,\n onContinue,\n}: {\n info: LoopLimitInfo;\n onContinue: () => void;\n}) {\n const [settings, setSettings] = useState<AgentLoopSettingsResponse | null>(\n null,\n );\n const [value, setValue] = useState(\"\");\n const [saving, setSaving] = useState(false);\n const [saved, setSaved] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const load = useCallback(() => {\n let cancelled = false;\n fetch(agentNativePath(\"/_agent-native/agent-loop-settings\"))\n .then((r) => (r.ok ? r.json() : null))\n .then((data: AgentLoopSettingsResponse | null) => {\n if (cancelled || !data) return;\n setSettings(data);\n setValue(String(data.maxIterations));\n })\n .catch(() => {\n if (!cancelled) setValue(String(info.maxIterations ?? \"\"));\n });\n return () => {\n cancelled = true;\n };\n }, [info.maxIterations]);\n\n useEffect(() => load(), [load]);\n\n const currentLimit = settings?.maxIterations ?? info.maxIterations;\n const numericValue = Number(value);\n const hasPendingChange =\n !!settings &&\n settings.canUpdate &&\n Number.isInteger(numericValue) &&\n numericValue !== settings.maxIterations;\n const scopeLabel =\n settings?.scope === \"org\"\n ? settings.orgName\n ? `${settings.orgName} org`\n : \"org\"\n : \"your account\";\n\n const saveLimit = useCallback(async (): Promise<boolean> => {\n if (!settings?.canUpdate) return false;\n setSaving(true);\n setSaved(false);\n setError(null);\n try {\n const res = await fetch(\n agentNativePath(\"/_agent-native/agent-loop-settings\"),\n {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ maxIterations: numericValue }),\n },\n );\n const body = await res.json().catch(() => ({}));\n if (!res.ok) {\n throw new Error(body?.error ?? `Save failed (${res.status})`);\n }\n setSettings(body as AgentLoopSettingsResponse);\n setValue(String((body as AgentLoopSettingsResponse).maxIterations));\n setSaved(true);\n window.dispatchEvent(\n new CustomEvent(\"agent-loop-settings:changed\", { detail: body }),\n );\n setTimeout(() => setSaved(false), 2000);\n return true;\n } catch (err) {\n setError(err instanceof Error ? err.message : \"Save failed\");\n return false;\n } finally {\n setSaving(false);\n }\n }, [numericValue, settings?.canUpdate]);\n\n const handleContinue = useCallback(async () => {\n if (hasPendingChange) {\n const ok = await saveLimit();\n if (!ok) return;\n }\n onContinue();\n }, [hasPendingChange, onContinue, saveLimit]);\n\n const openSettings = useCallback(() => {\n try {\n window.location.hash = \"agent-limits\";\n } catch {}\n window.dispatchEvent(new CustomEvent(\"agent-panel:open-settings\"));\n }, []);\n\n return (\n <div className=\"rounded-lg border border-amber-500/25 bg-amber-500/[0.06] px-3 py-3 shadow-sm\">\n <div className=\"flex items-start gap-2.5\">\n <span className=\"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-amber-500/10 text-amber-600 dark:text-amber-400\">\n <IconGauge size={14} />\n </span>\n <div className=\"min-w-0\">\n <p className=\"text-sm font-medium text-foreground\">\n Step limit reached\n </p>\n <p className=\"mt-0.5 text-xs leading-relaxed text-muted-foreground\">\n The agent used{\" \"}\n {currentLimit\n ? `${currentLimit.toLocaleString()} steps`\n : \"all available steps\"}\n . Keep going in a fresh turn, or raise the {scopeLabel} limit first.\n </p>\n </div>\n </div>\n\n <div className=\"mt-3 flex flex-wrap items-end gap-2\">\n <label className=\"min-w-[116px] flex-1 space-y-1\">\n <span className=\"text-[10px] font-medium uppercase tracking-wide text-muted-foreground\">\n Max steps\n </span>\n <input\n type=\"number\"\n min={settings?.minMaxIterations ?? 1}\n max={settings?.maxMaxIterations ?? 1000}\n value={value}\n disabled={!settings?.canUpdate || saving}\n onChange={(e) => {\n setValue(e.target.value);\n setError(null);\n }}\n className=\"h-8 w-full rounded-md border border-border bg-background px-2 text-xs text-foreground outline-none focus:ring-1 focus:ring-ring disabled:opacity-60\"\n />\n </label>\n <button\n type=\"button\"\n onClick={saveLimit}\n disabled={!hasPendingChange || saving}\n className=\"inline-flex h-8 items-center gap-1 rounded-md border border-border px-2.5 text-xs font-medium text-foreground hover:bg-accent disabled:opacity-50\"\n >\n {saving ? (\n <IconLoader2 size={12} className=\"animate-spin\" />\n ) : saved ? (\n <IconCheck size={12} />\n ) : (\n \"Save\"\n )}\n </button>\n <button\n type=\"button\"\n onClick={openSettings}\n className=\"inline-flex h-8 items-center gap-1 rounded-md border border-border px-2.5 text-xs font-medium text-muted-foreground hover:bg-accent hover:text-foreground\"\n >\n <IconSettings size={12} />\n Settings\n </button>\n <button\n type=\"button\"\n onClick={handleContinue}\n disabled={saving}\n className=\"ml-auto inline-flex h-8 items-center gap-1 rounded-md bg-foreground px-3 text-xs font-medium text-background hover:opacity-90 disabled:opacity-60\"\n >\n {hasPendingChange ? \"Save and keep going\" : \"Keep going\"}\n <IconArrowRight size={12} />\n </button>\n </div>\n\n {settings && !settings.canUpdate && (\n <p className=\"mt-2 text-[11px] text-muted-foreground\">\n Only organization owners and admins can change this limit.\n </p>\n )}\n {error && <p className=\"mt-2 text-[11px] text-destructive\">{error}</p>}\n </div>\n );\n}\n\n// ─── PlanModeCallout ──────────────────────────────────────────────────────────\n\nexport function PlanModeCallout({\n canImplementPlan,\n onImplementPlan,\n onSwitchToAct,\n}: {\n canImplementPlan: boolean;\n onImplementPlan: () => void;\n onSwitchToAct: () => void;\n}) {\n return (\n <div className=\"shrink-0 px-3 pt-2\">\n <div className=\"rounded-lg border border-blue-500/25 bg-blue-500/[0.06] px-3 py-2.5 shadow-sm\">\n <div className=\"flex items-center gap-2.5\">\n <span className=\"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-blue-500/10 text-blue-600 dark:text-blue-300\">\n <IconClipboardList size={15} />\n </span>\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-medium text-foreground\">\n {canImplementPlan ? \"Plan ready\" : \"Plan mode is on\"}\n </p>\n <p className=\"mt-0.5 text-xs leading-relaxed text-muted-foreground\">\n {canImplementPlan\n ? \"Switch to Act and run the proposed plan.\"\n : \"The next turn will stay read-only until you switch to Act.\"}\n </p>\n </div>\n {canImplementPlan ? (\n <button\n type=\"button\"\n onClick={onImplementPlan}\n className=\"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md bg-foreground px-3 text-xs font-medium text-background hover:opacity-90\"\n >\n <IconPlayerPlay size={13} />\n Implement Plan\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={onSwitchToAct}\n className=\"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent\"\n >\n Act\n <IconArrowRight size={13} />\n </button>\n )}\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"run-recovery.js","sourceRoot":"","sources":["../../../src/client/chat/run-recovery.tsx"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,6EAA6E;AAC7E,+EAA+E;AAC/E,yBAAyB;AAEzB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACL,qBAAqB,GAEtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,WAAW,EACX,SAAS,EACT,QAAQ,EACR,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,SAAS,EACT,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,QAAQ,EACR,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AA0B7B,iFAAiF;AAEjF,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAI,OAAkC,EAAE,QAKrC,CAAC;IACd,MAAM,SAAS,GAAG,IAAI,EAAE,MAAM,EAAE,SAAS,IAAI,IAAI,EAAE,SAAS,CAAC;IAC7D,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC7D,OAAO;QACL,GAAG,CAAC,OAAO,SAAS,CAAC,aAAa,KAAK,QAAQ;YAC7C,CAAC,CAAC,EAAE,aAAa,EAAE,SAAS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AAC,CAAC,CAAC,CAClB,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,eAAe,EACxB,SAAS,EAAC,kIAAkI,aAE5I,KAAC,cAAc,IAAC,IAAI,EAAE,EAAE,GAAI,sBAErB,CACV,CAAC,CAAC,CAAC,CACF,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,aAAa,EACtB,SAAS,EAAC,sJAAsJ,oBAGhK,KAAC,cAAc,IAAC,IAAI,EAAE,EAAE,GAAI,IACrB,CACV,IACG,GACF,GACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Owns: run-error metadata extractors, recovery helpers, RunErrorRecoveryCard,\n// LoopLimitContinueCard, BuilderConnectCta, BuilderSetupCard, ApiKeyConnect,\n// PlanModeCallout, and getLoopLimitMetadata / getRunErrorMetadata exports used\n// by AssistantChatInner.\n\nimport { useState, useEffect, useCallback, useRef } from \"react\";\nimport { useBuilderConnectFlow } from \"../settings/useBuilderStatus.js\";\nimport {\n saveAgentEngineApiKey,\n type AgentEngineProvider,\n} from \"../agent-engine-key.js\";\nimport { cn } from \"../utils.js\";\nimport { writeClipboardText } from \"../clipboard.js\";\nimport { agentNativePath } from \"../api-path.js\";\nimport {\n IconLoader2,\n IconCheck,\n IconCopy,\n IconX,\n IconChevronDown,\n IconExternalLink,\n IconKey,\n IconGitFork,\n IconGauge,\n IconSettings,\n IconArrowRight,\n IconAlertTriangle,\n IconPlayerPlay,\n IconRefresh,\n IconPlus,\n IconClipboardList,\n} from \"@tabler/icons-react\";\n\n// ─── Type definitions ─────────────────────────────────────────────────────────\n\nexport type LoopLimitInfo = { maxIterations?: number };\n\nexport type RunErrorInfo = {\n message: string;\n details?: string;\n errorCode?: string;\n runId?: string;\n recoverable?: boolean;\n};\n\ninterface AgentLoopSettingsResponse {\n maxIterations: number;\n defaultMaxIterations: number;\n minMaxIterations: number;\n maxMaxIterations: number;\n scope: \"org\" | \"user\" | \"default\";\n source: \"org\" | \"user\" | \"env\" | \"default\";\n canUpdate: boolean;\n orgName?: string | null;\n role?: string | null;\n}\n\n// ─── Metadata extractors ──────────────────────────────────────────────────────\n\nexport function getLoopLimitMetadata(message: unknown): LoopLimitInfo | null {\n const meta = (message as { metadata?: unknown })?.metadata as\n | {\n custom?: { loopLimit?: LoopLimitInfo };\n loopLimit?: LoopLimitInfo;\n }\n | undefined;\n const loopLimit = meta?.custom?.loopLimit ?? meta?.loopLimit;\n if (!loopLimit || typeof loopLimit !== \"object\") return null;\n return {\n ...(typeof loopLimit.maxIterations === \"number\"\n ? { maxIterations: loopLimit.maxIterations }\n : {}),\n };\n}\n\nexport function getRunErrorMetadata(message: unknown): RunErrorInfo | null {\n const meta = (message as { metadata?: unknown })?.metadata as\n | {\n custom?: { runError?: RunErrorInfo; runId?: unknown };\n runError?: RunErrorInfo;\n runId?: unknown;\n }\n | undefined;\n const runError = meta?.custom?.runError ?? meta?.runError;\n if (!runError || typeof runError !== \"object\") return null;\n const messageText =\n typeof runError.message === \"string\" ? runError.message : \"\";\n if (!messageText) return null;\n const runId =\n typeof runError.runId === \"string\"\n ? runError.runId\n : typeof meta?.custom?.runId === \"string\"\n ? meta.custom.runId\n : typeof meta?.runId === \"string\"\n ? meta.runId\n : undefined;\n return {\n message: messageText,\n ...(typeof runError.details === \"string\"\n ? { details: runError.details }\n : {}),\n ...(typeof runError.errorCode === \"string\"\n ? { errorCode: runError.errorCode }\n : {}),\n ...(runId ? { runId } : {}),\n ...(runError.recoverable ? { recoverable: true } : {}),\n };\n}\n\nexport function getRequestModeMetadata(\n message: unknown,\n): \"act\" | \"plan\" | null {\n const meta = (message as { metadata?: unknown })?.metadata as\n | {\n custom?: { requestMode?: unknown };\n requestMode?: unknown;\n }\n | undefined;\n const requestMode = meta?.custom?.requestMode ?? meta?.requestMode;\n return requestMode === \"act\" || requestMode === \"plan\" ? requestMode : null;\n}\n\n// ─── Run error classifiers ────────────────────────────────────────────────────\n\nfunction isBuilderReconnectRunError(info: RunErrorInfo): boolean {\n const code = (info.errorCode ?? \"\").toLowerCase();\n const message = info.message.toLowerCase();\n const isAuthCode =\n code === \"authentication_error\" ||\n code === \"unauthorized\" ||\n code === \"http_401\" ||\n code === \"http_403\";\n return (\n code === \"builder_auth_error\" ||\n message.includes(\"builder authentication failed\") ||\n (isAuthCode &&\n (message.includes(\"invalid token\") ||\n message.includes(\"personal access token\")))\n );\n}\n\nfunction isProviderQueryRunError(info: RunErrorInfo): boolean {\n const text = [info.errorCode, info.message, info.details]\n .filter(Boolean)\n .join(\"\\n\")\n .toLowerCase();\n return (\n text.includes(\"bigquery\") ||\n text.includes(\"sql\") ||\n text.includes(\"query\") ||\n text.includes(\"schema\") ||\n text.includes(\"syntax\") ||\n text.includes(\"unknown column\") ||\n text.includes(\"unknown table\") ||\n text.includes(\"type mismatch\")\n );\n}\n\nfunction isConnectionRecoveryRunError(info: RunErrorInfo): boolean {\n const code = (info.errorCode ?? \"\").toLowerCase();\n const message = info.message.toLowerCase();\n return (\n code === \"connection_error\" ||\n message.includes(\"connection kept failing\") ||\n message.includes(\"automatic recovery attempts\")\n );\n}\n\n// ─── BuilderConnectCta ────────────────────────────────────────────────────────\n// Renders a single row with left-aligned copy and a right-aligned action.\n// Click opens the Builder CLI-auth popup via the shared\n// `useBuilderConnectFlow` hook (which owns the synchronous window.open,\n// the 2s status poll, and the focus-refresh). On success the hook broadcasts\n// a config-change event so the chat clears its local `missingApiKey` gate.\n//\n// Desktop note: when this component runs inside the Electron shell, the\n// window.open call is intercepted by the main process's webview popup handler,\n// which opens the flow in an Electron BrowserWindow that shares the webview's\n// session. See packages/desktop-app/src/main/index.ts.\n\nexport function BuilderConnectCta({\n variant = \"primary\",\n onConnected,\n}: {\n variant?: \"primary\" | \"compact\";\n onConnected?: () => void;\n}) {\n const { configured, orgName, connecting, error, start } =\n useBuilderConnectFlow({\n trackingSource: \"assistant_chat_builder_cta\",\n onConnected,\n });\n\n if (variant === \"compact\") {\n if (configured) {\n return (\n <span className=\"inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-2.5 text-[11px] font-medium text-foreground\">\n <IconCheck size={11} className=\"text-emerald-500\" />\n {orgName ? `Connected to ${orgName}` : \"Connected\"}\n </span>\n );\n }\n\n return (\n <div className=\"flex min-w-0 flex-col items-start gap-1 sm:items-end\">\n <button\n type=\"button\"\n onClick={() => start()}\n disabled={connecting}\n className=\"inline-flex h-8 shrink-0 items-center gap-1 rounded-md bg-foreground px-3 text-[11px] font-medium text-background hover:opacity-90 disabled:cursor-wait disabled:opacity-60\"\n aria-busy={connecting}\n >\n {connecting ? (\n <>\n <IconLoader2 size={10} className=\"animate-spin\" />\n Waiting…\n </>\n ) : (\n \"Connect Builder.io\"\n )}\n </button>\n {error && (\n <p className=\"max-w-[13rem] text-[10px] leading-snug text-destructive sm:text-right\">\n {error}\n </p>\n )}\n </div>\n );\n }\n\n const containerClass =\n \"flex items-center gap-3 rounded-md border border-border px-3 py-3\";\n\n if (configured) {\n return (\n <div className={containerClass}>\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-xs font-medium text-foreground\">Builder.io</div>\n <p className=\"text-[11px] text-muted-foreground mt-0.5\">\n {orgName ? `Connected — ${orgName}` : \"Connected\"}\n </p>\n </div>\n <span className=\"ml-auto inline-flex items-center gap-1 shrink-0 rounded-md bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-500\">\n <IconCheck size={10} />\n Connected\n </span>\n </div>\n );\n }\n\n return (\n <div className={containerClass}>\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-xs font-medium text-foreground\">\n Connect Builder.io\n </div>\n <p className=\"text-[11px] text-muted-foreground mt-0.5 max-w-[220px]\">\n Free credits for LLM, hosting, and more — no API key needed\n </p>\n {error && <p className=\"mt-1 text-[10px] text-destructive\">{error}</p>}\n </div>\n <button\n type=\"button\"\n onClick={() => start()}\n disabled={connecting}\n className=\"ml-auto inline-flex items-center gap-1 shrink-0 rounded-md bg-foreground px-3 py-1.5 text-[11px] font-medium no-underline text-background hover:opacity-90 disabled:opacity-60 disabled:cursor-wait\"\n aria-busy={connecting}\n >\n {connecting ? (\n <>\n <IconLoader2 size={10} className=\"animate-spin\" />\n Waiting…\n </>\n ) : (\n <>\n Connect\n <IconExternalLink size={10} />\n </>\n )}\n </button>\n </div>\n );\n}\n\n// ─── ApiKeyConnect ────────────────────────────────────────────────────────────\n\nconst API_KEY_PROVIDERS: Array<{\n value: AgentEngineProvider;\n label: string;\n placeholder: string;\n}> = [\n { value: \"anthropic\", label: \"Anthropic\", placeholder: \"sk-ant-…\" },\n { value: \"openai\", label: \"OpenAI\", placeholder: \"sk-…\" },\n];\n\nexport function ApiKeyConnect({ onConnected }: { onConnected?: () => void }) {\n const [provider, setProvider] = useState<AgentEngineProvider>(\"anthropic\");\n const [apiKey, setApiKey] = useState(\"\");\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const active = API_KEY_PROVIDERS.find((p) => p.value === provider)!;\n\n const handleSave = useCallback(async () => {\n if (!apiKey.trim() || saving) return;\n setSaving(true);\n setError(null);\n try {\n await saveAgentEngineApiKey({ provider, apiKey });\n setApiKey(\"\");\n onConnected?.();\n } catch (err) {\n setError(err instanceof Error ? err.message : \"Could not save the key.\");\n } finally {\n setSaving(false);\n }\n }, [apiKey, onConnected, provider, saving]);\n\n return (\n <div className=\"rounded-md border border-border bg-background/60 p-3\">\n <div className=\"mb-2 flex items-center gap-1.5 text-[11px] font-medium text-foreground\">\n <IconKey size={12} strokeWidth={1.9} />\n Use your own API key\n </div>\n <p className=\"mb-2.5 text-[11px] leading-relaxed text-muted-foreground\">\n Stored securely for this app only.\n </p>\n <div\n role=\"tablist\"\n aria-label=\"API key provider\"\n className=\"mb-2 inline-flex rounded-md border border-border bg-muted/40 p-0.5\"\n >\n {API_KEY_PROVIDERS.map((option) => {\n const selected = option.value === provider;\n return (\n <button\n key={option.value}\n type=\"button\"\n role=\"tab\"\n aria-selected={selected}\n onClick={() => {\n setProvider(option.value);\n setError(null);\n }}\n className={cn(\n \"rounded px-2.5 py-1 text-[11px] font-medium transition-colors\",\n selected\n ? \"bg-background text-foreground shadow-sm\"\n : \"text-muted-foreground hover:text-foreground\",\n )}\n >\n {option.label}\n </button>\n );\n })}\n </div>\n <div className=\"flex items-center gap-2\">\n <input\n type=\"password\"\n value={apiKey}\n autoComplete=\"off\"\n spellCheck={false}\n placeholder={active.placeholder}\n onChange={(e) => {\n setApiKey(e.target.value);\n if (error) setError(null);\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n void handleSave();\n }\n }}\n className=\"h-8 min-w-0 flex-1 rounded-md border border-input bg-background px-2.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 focus:ring-offset-background\"\n />\n <button\n type=\"button\"\n onClick={handleSave}\n disabled={!apiKey.trim() || saving}\n className=\"inline-flex h-8 shrink-0 items-center gap-1 rounded-md bg-foreground px-3 text-[11px] font-medium text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60\"\n >\n {saving ? (\n <>\n <IconLoader2 size={11} className=\"animate-spin\" />\n Saving…\n </>\n ) : (\n \"Save\"\n )}\n </button>\n </div>\n {error ? (\n <p className=\"mt-2 text-[11px] text-destructive\">{error}</p>\n ) : null}\n </div>\n );\n}\n\n// ─── BuilderSetupCard ─────────────────────────────────────────────────────────\n\nexport function BuilderSetupCard({\n onConnected,\n bouncePulse,\n}: {\n onConnected?: () => void;\n bouncePulse?: number;\n}) {\n // Progressive disclosure: the card leads with one-click Builder connect while\n // keeping the bring-your-own-key path close by.\n const [keyOpen, setKeyOpen] = useState(false);\n\n const cardRef = useRef<HTMLDivElement>(null);\n // Replay the bounce keyframe each time bouncePulse increments. Toggling the\n // class off-then-on (with a forced reflow) restarts the animation even when\n // the value changes back-to-back.\n useEffect(() => {\n if (!bouncePulse) return;\n const el = cardRef.current;\n if (!el) return;\n el.classList.remove(\"animate-bounce-once\");\n void el.offsetWidth;\n el.classList.add(\"animate-bounce-once\");\n }, [bouncePulse]);\n\n return (\n <div ref={cardRef} className=\"mx-auto w-full max-w-[34rem] px-3 pb-2\">\n <div className=\"rounded-lg border border-border/80 bg-background/80 p-3 shadow-sm backdrop-blur\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"min-w-0\">\n <h3 className=\"text-[13px] font-medium text-foreground\">\n Connect AI\n </h3>\n <p className=\"mt-0.5 text-[11px] leading-relaxed text-muted-foreground\">\n Use Builder.io, or add an Anthropic/OpenAI key.\n </p>\n </div>\n <div className=\"flex flex-wrap items-center gap-2\">\n <BuilderConnectCta variant=\"compact\" onConnected={onConnected} />\n <button\n type=\"button\"\n onClick={() => setKeyOpen((open) => !open)}\n className=\"inline-flex h-8 shrink-0 items-center rounded-md border border-border bg-background px-3 text-[11px] font-medium text-foreground hover:bg-accent\"\n aria-expanded={keyOpen}\n >\n Use API key\n </button>\n </div>\n </div>\n\n {keyOpen ? (\n <div className=\"mt-3\">\n <ApiKeyConnect onConnected={onConnected} />\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n\n// ─── RunErrorRecoveryCard ─────────────────────────────────────────────────────\n\nexport function RunErrorRecoveryCard({\n info,\n onContinue,\n onRetry,\n onFork,\n onDismiss,\n}: {\n info: RunErrorInfo;\n onContinue: () => void;\n onRetry: () => void;\n onFork?: () => void | boolean | Promise<void | boolean>;\n onDismiss: () => void;\n}) {\n const [detailsOpen, setDetailsOpen] = useState(false);\n const [copied, setCopied] = useState(false);\n const [forking, setForking] = useState(false);\n const [forkError, setForkError] = useState<string | null>(null);\n const builderReconnect = useBuilderConnectFlow({\n trackingSource: \"assistant_chat_reconnect_error\",\n });\n const canRecover = info.recoverable === true;\n const shouldShowBuilderReconnect = isBuilderReconnectRunError(info);\n const builderReconnectResolved =\n shouldShowBuilderReconnect &&\n builderReconnect.hasFetchedStatus &&\n builderReconnect.configured;\n const isQueryError = isProviderQueryRunError(info);\n const isConnectionRecoveryError = isConnectionRecoveryRunError(info);\n const copyLabel =\n info.runId || info.errorCode || info.details ? \"Copy debug\" : \"Copy\";\n const copyDetails = useCallback(() => {\n const text = [\n info.message,\n info.errorCode ? `Code: ${info.errorCode}` : \"\",\n info.runId ? `Run: ${info.runId}` : \"\",\n info.details ? `Details:\\n${info.details}` : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\\n\");\n void writeClipboardText(text).then((ok) => {\n if (!ok) return;\n setCopied(true);\n setTimeout(() => setCopied(false), 1200);\n });\n }, [info]);\n const startNewChat = useCallback(() => {\n window.dispatchEvent(new CustomEvent(\"agent-chat:new-chat\"));\n onDismiss();\n }, [onDismiss]);\n\n const handleFork = useCallback(async () => {\n if (!onFork || forking) return;\n setForking(true);\n setForkError(null);\n try {\n const result = await onFork();\n if (result === false) {\n setForkError(\"Could not fork this chat. Try starting a new chat.\");\n }\n } catch {\n setForkError(\"Could not fork this chat. Try starting a new chat.\");\n } finally {\n setForking(false);\n }\n }, [forking, onFork]);\n\n useEffect(() => {\n if (builderReconnectResolved) {\n onDismiss();\n }\n }, [builderReconnectResolved, onDismiss]);\n\n return (\n <div className=\"rounded-lg border border-amber-500/25 bg-amber-500/[0.06] p-3 text-sm\">\n <div className=\"flex items-start gap-2\">\n <span className=\"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-amber-500/10 text-amber-700 dark:text-amber-300\">\n <IconAlertTriangle size={14} />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"font-medium text-foreground\">\n {canRecover\n ? \"The agent stopped before finishing\"\n : \"The agent hit an error\"}\n </div>\n <p className=\"mt-1 text-xs leading-relaxed text-muted-foreground\">\n {info.message}\n </p>\n {shouldShowBuilderReconnect && !builderReconnectResolved && (\n <p className=\"mt-2 text-xs leading-relaxed text-muted-foreground\">\n The current Builder.io or model-provider credential was rejected.\n Reconnect Builder.io, then retry this message.\n </p>\n )}\n {isConnectionRecoveryError && (\n <p className=\"mt-2 text-xs leading-relaxed text-muted-foreground\">\n If retry lands on the same error, start a new chat session and\n continue from what already changed.\n </p>\n )}\n {(info.runId || info.errorCode || info.details) && (\n <button\n type=\"button\"\n onClick={() => setDetailsOpen((v) => !v)}\n className=\"mt-2 inline-flex items-center gap-1 text-[11px] font-medium text-muted-foreground hover:text-foreground\"\n >\n <IconChevronDown\n size={12}\n className={cn(\n \"transition-transform\",\n detailsOpen && \"rotate-180\",\n )}\n />\n Details\n </button>\n )}\n {detailsOpen && (\n <div className=\"mt-2 rounded-md border border-border/60 bg-background/70 p-2 font-mono text-[11px] leading-relaxed text-muted-foreground\">\n {info.runId && <div>run: {info.runId}</div>}\n {info.errorCode && <div>code: {info.errorCode}</div>}\n {info.details && (\n <pre className=\"mt-2 max-h-28 overflow-auto whitespace-pre-wrap break-words font-mono\">\n {info.details}\n </pre>\n )}\n </div>\n )}\n </div>\n <button\n type=\"button\"\n onClick={onDismiss}\n aria-label=\"Dismiss\"\n className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-background/80 hover:text-foreground\"\n >\n <IconX size={14} />\n </button>\n </div>\n <div className=\"mt-3 flex flex-wrap items-center gap-2\">\n {shouldShowBuilderReconnect && !builderReconnectResolved && (\n <button\n type=\"button\"\n onClick={() => builderReconnect.start()}\n disabled={builderReconnect.connecting}\n className=\"inline-flex h-8 items-center gap-1.5 rounded-md bg-foreground px-3 text-xs font-medium text-background hover:opacity-90 disabled:cursor-wait disabled:opacity-70\"\n >\n {builderReconnect.connecting ? (\n <IconLoader2 size={13} className=\"animate-spin\" />\n ) : (\n <IconExternalLink size={13} />\n )}\n {builderReconnect.connecting\n ? \"Connecting Builder.io\"\n : \"Reconnect Builder.io\"}\n </button>\n )}\n {canRecover && (\n <>\n <button\n type=\"button\"\n onClick={onContinue}\n className=\"inline-flex h-8 items-center gap-1.5 rounded-md bg-foreground px-3 text-xs font-medium text-background hover:opacity-90\"\n >\n <IconPlayerPlay size={13} />\n Continue\n </button>\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent\"\n >\n <IconRefresh size={13} />\n {isQueryError ? \"Diagnose and retry\" : \"Retry\"}\n </button>\n </>\n )}\n {canRecover && isConnectionRecoveryError && (\n <button\n type=\"button\"\n onClick={startNewChat}\n className=\"inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent\"\n >\n <IconPlus size={13} />\n New chat\n </button>\n )}\n {canRecover && onFork && !isConnectionRecoveryError && (\n <button\n type=\"button\"\n onClick={handleFork}\n disabled={forking}\n title=\"Fork this conversation into a separate chat thread.\"\n aria-label=\"Fork this conversation into a separate chat thread\"\n className=\"inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent disabled:cursor-wait disabled:opacity-70\"\n >\n {forking ? (\n <IconLoader2 size={13} className=\"animate-spin\" />\n ) : (\n <IconGitFork size={13} />\n )}\n {forking ? \"Forking...\" : \"Fork chat\"}\n </button>\n )}\n <button\n type=\"button\"\n onClick={copyDetails}\n className=\"ml-auto inline-flex h-8 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium text-muted-foreground hover:bg-background/80 hover:text-foreground\"\n >\n {copied ? <IconCheck size={13} /> : <IconCopy size={13} />}\n {copied ? \"Copied\" : copyLabel}\n </button>\n </div>\n {shouldShowBuilderReconnect && builderReconnect.error && (\n <p className=\"mt-2 text-xs leading-relaxed text-red-500\">\n {builderReconnect.error}\n </p>\n )}\n {forkError && (\n <p className=\"mt-2 text-xs leading-relaxed text-red-500\">{forkError}</p>\n )}\n </div>\n );\n}\n\n// ─── LoopLimitContinueCard ────────────────────────────────────────────────────\n\nexport function LoopLimitContinueCard({\n info,\n onContinue,\n}: {\n info: LoopLimitInfo;\n onContinue: () => void;\n}) {\n const [settings, setSettings] = useState<AgentLoopSettingsResponse | null>(\n null,\n );\n const [value, setValue] = useState(\"\");\n const [saving, setSaving] = useState(false);\n const [saved, setSaved] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const load = useCallback(() => {\n let cancelled = false;\n fetch(agentNativePath(\"/_agent-native/agent-loop-settings\"))\n .then((r) => (r.ok ? r.json() : null))\n .then((data: AgentLoopSettingsResponse | null) => {\n if (cancelled || !data) return;\n setSettings(data);\n setValue(String(data.maxIterations));\n })\n .catch(() => {\n if (!cancelled) setValue(String(info.maxIterations ?? \"\"));\n });\n return () => {\n cancelled = true;\n };\n }, [info.maxIterations]);\n\n useEffect(() => load(), [load]);\n\n const currentLimit = settings?.maxIterations ?? info.maxIterations;\n const numericValue = Number(value);\n const hasPendingChange =\n !!settings &&\n settings.canUpdate &&\n Number.isInteger(numericValue) &&\n numericValue !== settings.maxIterations;\n const scopeLabel =\n settings?.scope === \"org\"\n ? settings.orgName\n ? `${settings.orgName} org`\n : \"org\"\n : \"your account\";\n\n const saveLimit = useCallback(async (): Promise<boolean> => {\n if (!settings?.canUpdate) return false;\n setSaving(true);\n setSaved(false);\n setError(null);\n try {\n const res = await fetch(\n agentNativePath(\"/_agent-native/agent-loop-settings\"),\n {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ maxIterations: numericValue }),\n },\n );\n const body = await res.json().catch(() => ({}));\n if (!res.ok) {\n throw new Error(body?.error ?? `Save failed (${res.status})`);\n }\n setSettings(body as AgentLoopSettingsResponse);\n setValue(String((body as AgentLoopSettingsResponse).maxIterations));\n setSaved(true);\n window.dispatchEvent(\n new CustomEvent(\"agent-loop-settings:changed\", { detail: body }),\n );\n setTimeout(() => setSaved(false), 2000);\n return true;\n } catch (err) {\n setError(err instanceof Error ? err.message : \"Save failed\");\n return false;\n } finally {\n setSaving(false);\n }\n }, [numericValue, settings?.canUpdate]);\n\n const handleContinue = useCallback(async () => {\n if (hasPendingChange) {\n const ok = await saveLimit();\n if (!ok) return;\n }\n onContinue();\n }, [hasPendingChange, onContinue, saveLimit]);\n\n const openSettings = useCallback(() => {\n try {\n window.location.hash = \"agent-limits\";\n } catch {}\n window.dispatchEvent(new CustomEvent(\"agent-panel:open-settings\"));\n }, []);\n\n return (\n <div className=\"rounded-lg border border-amber-500/25 bg-amber-500/[0.06] px-3 py-3 shadow-sm\">\n <div className=\"flex items-start gap-2.5\">\n <span className=\"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-amber-500/10 text-amber-600 dark:text-amber-400\">\n <IconGauge size={14} />\n </span>\n <div className=\"min-w-0\">\n <p className=\"text-sm font-medium text-foreground\">\n Step limit reached\n </p>\n <p className=\"mt-0.5 text-xs leading-relaxed text-muted-foreground\">\n The agent used{\" \"}\n {currentLimit\n ? `${currentLimit.toLocaleString()} steps`\n : \"all available steps\"}\n . Keep going in a fresh turn, or raise the {scopeLabel} limit first.\n </p>\n </div>\n </div>\n\n <div className=\"mt-3 flex flex-wrap items-end gap-2\">\n <label className=\"min-w-[116px] flex-1 space-y-1\">\n <span className=\"text-[10px] font-medium uppercase tracking-wide text-muted-foreground\">\n Max steps\n </span>\n <input\n type=\"number\"\n min={settings?.minMaxIterations ?? 1}\n max={settings?.maxMaxIterations ?? 1000}\n value={value}\n disabled={!settings?.canUpdate || saving}\n onChange={(e) => {\n setValue(e.target.value);\n setError(null);\n }}\n className=\"h-8 w-full rounded-md border border-border bg-background px-2 text-xs text-foreground outline-none focus:ring-1 focus:ring-ring disabled:opacity-60\"\n />\n </label>\n <button\n type=\"button\"\n onClick={saveLimit}\n disabled={!hasPendingChange || saving}\n className=\"inline-flex h-8 items-center gap-1 rounded-md border border-border px-2.5 text-xs font-medium text-foreground hover:bg-accent disabled:opacity-50\"\n >\n {saving ? (\n <IconLoader2 size={12} className=\"animate-spin\" />\n ) : saved ? (\n <IconCheck size={12} />\n ) : (\n \"Save\"\n )}\n </button>\n <button\n type=\"button\"\n onClick={openSettings}\n className=\"inline-flex h-8 items-center gap-1 rounded-md border border-border px-2.5 text-xs font-medium text-muted-foreground hover:bg-accent hover:text-foreground\"\n >\n <IconSettings size={12} />\n Settings\n </button>\n <button\n type=\"button\"\n onClick={handleContinue}\n disabled={saving}\n className=\"ml-auto inline-flex h-8 items-center gap-1 rounded-md bg-foreground px-3 text-xs font-medium text-background hover:opacity-90 disabled:opacity-60\"\n >\n {hasPendingChange ? \"Save and keep going\" : \"Keep going\"}\n <IconArrowRight size={12} />\n </button>\n </div>\n\n {settings && !settings.canUpdate && (\n <p className=\"mt-2 text-[11px] text-muted-foreground\">\n Only organization owners and admins can change this limit.\n </p>\n )}\n {error && <p className=\"mt-2 text-[11px] text-destructive\">{error}</p>}\n </div>\n );\n}\n\n// ─── PlanModeCallout ──────────────────────────────────────────────────────────\n\nexport function PlanModeCallout({\n canImplementPlan,\n onImplementPlan,\n onSwitchToAct,\n}: {\n canImplementPlan: boolean;\n onImplementPlan: () => void;\n onSwitchToAct: () => void;\n}) {\n return (\n <div className=\"shrink-0 px-3 pt-2\">\n <div className=\"rounded-lg border border-blue-500/25 bg-blue-500/[0.06] px-3 py-2.5 shadow-sm\">\n <div className=\"flex items-center gap-2.5\">\n <span className=\"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-blue-500/10 text-blue-600 dark:text-blue-300\">\n <IconClipboardList size={15} />\n </span>\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-medium text-foreground\">\n {canImplementPlan ? \"Plan ready\" : \"Plan mode is on\"}\n </p>\n <p className=\"mt-0.5 text-xs leading-relaxed text-muted-foreground\">\n {canImplementPlan\n ? \"Switch to Act and run the proposed plan.\"\n : \"The next turn will stay read-only until you switch to Act.\"}\n </p>\n </div>\n {canImplementPlan ? (\n <button\n type=\"button\"\n onClick={onImplementPlan}\n className=\"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md bg-foreground px-3 text-xs font-medium text-background hover:opacity-90\"\n >\n <IconPlayerPlay size={13} />\n Implement Plan\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={onSwitchToAct}\n className=\"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-accent\"\n >\n Act\n <IconArrowRight size={13} />\n </button>\n )}\n </div>\n </div>\n </div>\n );\n}\n"]}
|