@openhands/agent-canvas 1.5.1 → 1.5.2
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 +1 -1
- package/README.windows.md +2 -2
- package/build/assets/{active-backend-context-B8rMv0X9.js → active-backend-context-DHhm10VS.js} +1 -1
- package/build/assets/{add-backend-modal-CxC7BNEc.js → add-backend-modal-BoMkMyLB.js} +1 -1
- package/build/assets/{agent-profiles-settings-BJb8YXR1.js → agent-profiles-settings-CYPloKYK.js} +1 -1
- package/build/assets/{agent-server-compatibility-BWN-EIQn.js → agent-server-compatibility-C0MtTTwb.js} +1 -1
- package/build/assets/{agent-server-conversation-service.api-DSPIkMwJ.js → agent-server-conversation-service.api-lzc8dabY.js} +3 -3
- package/build/assets/{agent-settings-CgCnqaAA.js → agent-settings-GwiXe_6k.js} +1 -1
- package/build/assets/agent-settings-OdsyI2gX.js +1 -0
- package/build/assets/{api-key-entry-screen-iZc7n8AI.js → api-key-entry-screen-2gsoZAOK.js} +1 -1
- package/build/assets/{app-settings-B5zyipxJ.js → app-settings-CD9euh81.js} +1 -1
- package/build/assets/{automation-detail-CZsu2CoM.js → automation-detail-Bn8q0AG3.js} +1 -1
- package/build/assets/{automation-export-BwRX6H32.js → automation-export-Djc8Tf0M.js} +1 -1
- package/build/assets/{automations-list-lHAVzMoA.js → automations-list-Dtiolk1h.js} +1 -1
- package/build/assets/{backend-form-modal-RGcu909r.js → backend-form-modal-B8GtBA-J.js} +1 -1
- package/build/assets/{backend-synced-settings-badge-BSfN0AZA.js → backend-synced-settings-badge-yVh6Kf4E.js} +1 -1
- package/build/assets/{client-source-BZK8vRs2.js → client-source-CtQjJEy6.js} +1 -1
- package/build/assets/{cloud-funnel-analytics-Zcv57hfT.js → cloud-funnel-analytics-uzzLlLuj.js} +1 -1
- package/build/assets/{condenser-settings-BGlWn93P.js → condenser-settings-Q1rHh4Qe.js} +1 -1
- package/build/assets/conversation-B8d8_Upd.js +1 -0
- package/build/assets/{conversation-BoCYx8n2.js → conversation-Lmqm6VJC.js} +20 -20
- package/build/assets/conversation-panel-B8n40Swu.js +1 -0
- package/build/assets/{conversation-service.api-_f9GlIEi.js → conversation-service.api-D8QU-BiL.js} +1 -1
- package/build/assets/{entry.client-DNlPGxsu.js → entry.client-Dnnak-Hq.js} +1 -1
- package/build/assets/{extensions-hub-CCbLA7IM.js → extensions-hub-DqvwvpCi.js} +1 -1
- package/build/assets/{extensions-navigation-CPNjMNvR.js → extensions-navigation-BMc9Nluv.js} +1 -1
- package/build/assets/{files-tab-y4K7EXBO.js → files-tab-BAkaV4aO.js} +1 -1
- package/build/assets/{git-provider-icon-ITvsH4Ko.js → git-provider-icon-xvbukHaT.js} +1 -1
- package/build/assets/{home-BwbeOWwU.js → home-D01kSnmo.js} +1 -1
- package/build/assets/home-NZO2bF4N.js +1 -0
- package/build/assets/index-home-BsI6i0TC.js +1 -0
- package/build/assets/{install-server-modal-Qk1gwyI8.js → install-server-modal-BYjqoRyX.js} +1 -1
- package/build/assets/{launch-CAGavYl-.js → launch-DlXspDku.js} +1 -1
- package/build/assets/{lesson-plan-DMCPdtrf.js → lesson-plan-cNUjpdFx.js} +1 -1
- package/build/assets/{llm-not-configured-banner-C1ktyb3C.js → llm-not-configured-banner-DUPyoFIZ.js} +7 -7
- package/build/assets/{llm-settings-DFkJQr_w.js → llm-settings-Cs_iieFY.js} +1 -1
- package/build/assets/llm-settings-J2ke2foG.js +1 -0
- package/build/assets/{llm-subscription-service-Casyzgn1.js → llm-subscription-service-C0zN0-rH.js} +1 -1
- package/build/assets/{manage-backends-modal-CKQ46rvw.js → manage-backends-modal-nMoCZ2a0.js} +1 -1
- package/build/assets/{manifest-03478bbf.js → manifest-f1b46f62.js} +1 -1
- package/build/assets/{mcp-BapoJsDc.js → mcp-kZM-cAZw.js} +1 -1
- package/build/assets/{messages-CUBFMY5o.js → messages-CJAv5n4j.js} +1 -1
- package/build/assets/{model-selector-DJrMrFAr.js → model-selector-D51W2Q9b.js} +1 -1
- package/build/assets/{onboarding-6NMkdNxV.js → onboarding-Dx8n8HFr.js} +1 -1
- package/build/assets/{onboarding-modal-Q4AnpIdg.js → onboarding-modal-Bxuxpfdz.js} +1 -1
- package/build/assets/{organization-service.api-vrRNwOma.js → organization-service.api-Da2jiuBS.js} +1 -1
- package/build/assets/{path-utils-PNfCKQDV.js → path-utils-D53ZHUQU.js} +1 -1
- package/build/assets/{planner-tab-ByOw1he8.js → planner-tab-BM-pKx0z.js} +1 -1
- package/build/assets/{plugins-management-service-B75jyC56.js → plugins-management-service-DISfOL13.js} +1 -1
- package/build/assets/{profiles-service.api-BQTklD5D.js → profiles-service.api-DWetW2TL.js} +1 -1
- package/build/assets/{providers-DfTB2gPd.js → providers-C7lMslCi.js} +1 -1
- package/build/assets/{proxy-B3tCGf0X.js → proxy-G4ce0fnQ.js} +1 -1
- package/build/assets/{recommended-automations-launcher-Bj7PuHY1.js → recommended-automations-launcher-BWRRvMPE.js} +1 -1
- package/build/assets/{root-layout-DfYVlcRG.js → root-layout-ClEl-JlJ.js} +2 -2
- package/build/assets/{root-CDnuTToz.js → root-oT83qVlk.js} +2 -2
- package/build/assets/{schema-field-CUwk4wrQ.js → schema-field-CwdqUOnE.js} +1 -1
- package/build/assets/{sdk-section-page-DLLNrYjI.js → sdk-section-page-Cwj0T4gF.js} +1 -1
- package/build/assets/{secrets-service-CvyPWJhg.js → secrets-service-Ch7RH8eH.js} +1 -1
- package/build/assets/{secrets-settings-CHy72A5C.js → secrets-settings-Bc_pBX6F.js} +1 -1
- package/build/assets/{settings-index-BKDl2CQ-.js → settings-index-BzSIM1-N.js} +1 -1
- package/build/assets/{settings-modal-DeK11CyT.js → settings-modal-BnZ7mMu7.js} +1 -1
- package/build/assets/{settings-B9S8UVQr.js → settings-n9a395O0.js} +1 -1
- package/build/assets/{settings-service.api-DXk5TdeJ.js → settings-service.api-DPTFyRXL.js} +1 -1
- package/build/assets/{shared-conversation-9atDzTR4.js → shared-conversation-CIDDti9I.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-giMMZctn.js → sidebar-mobile-menu-toggle-CTX7J4wM.js} +1 -1
- package/build/assets/{skills-plugins-Tropusio.js → skills-plugins-HZEbNDmX.js} +1 -1
- package/build/assets/{skills-settings-BvzBBCWk.js → skills-settings-BdqijFlC.js} +1 -1
- package/build/assets/{telemetry-C5JMEfqB.js → telemetry-SHxpVxk8.js} +1 -1
- package/build/assets/{terminal-DRXt2Lr4.js → terminal-BDTa1HEr.js} +1 -1
- package/build/assets/{use-acp-credential-form-Bm8qXdlc.js → use-acp-credential-form-DHd_Id-q.js} +1 -1
- package/build/assets/{use-activate-agent-profile-DlykqEfN.js → use-activate-agent-profile-BRDdSwQ0.js} +1 -1
- package/build/assets/{use-active-agent-profile-hI-x-UBa.js → use-active-agent-profile-BMDTXsay.js} +1 -1
- package/build/assets/{use-active-conversation-2qeez40F.js → use-active-conversation-BbeVgedA.js} +1 -1
- package/build/assets/{use-agent-profiles-0pr5bLS7.js → use-agent-profiles-Dn_S_Tkz.js} +1 -1
- package/build/assets/{use-agent-state-C6peDXUm.js → use-agent-state-5qM3X30V.js} +1 -1
- package/build/assets/{use-backends-health-CLHPitJM.js → use-backends-health-BagmAE_W.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-Ck_bsNbH.js → use-can-manage-org-profiles-CyYqfzeo.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-DUCSxNjY.js → use-cloud-current-user-id-BwMX7jHW.js} +1 -1
- package/build/assets/{use-config-B5r8erYt.js → use-config-B39iHYFi.js} +1 -1
- package/build/assets/{use-create-conversation-r1JHfKO5.js → use-create-conversation-CkKUQVbP.js} +1 -1
- package/build/assets/{use-create-secret-Cf2N11d2.js → use-create-secret-DEgM0MXZ.js} +1 -1
- package/build/assets/{use-handle-plan-click-CsAW3FlH.js → use-handle-plan-click-BFcE0Xms.js} +1 -1
- package/build/assets/{use-llm-profiles-Dr5__SlZ.js → use-llm-profiles-CgRtnj74.js} +1 -1
- package/build/assets/{use-plugins-marketplace-BplU65ae.js → use-plugins-marketplace-DOJp9rlE.js} +1 -1
- package/build/assets/use-runtime-is-ready-ziHQvXZQ.js +1 -0
- package/build/assets/{use-save-agent-profile-RqUGqTv6.js → use-save-agent-profile-i4FcEP98.js} +1 -1
- package/build/assets/{use-save-settings-Chvzeu2s.js → use-save-settings-DiDEbIJw.js} +1 -1
- package/build/assets/{use-settings-CyxSlyTQ.js → use-settings-BeJap6YL.js} +1 -1
- package/build/assets/{use-settings-nav-items-zEkSO_Bf.js → use-settings-nav-items-D5JJjFHJ.js} +1 -1
- package/build/assets/{use-skills-xrVoKYrF.js → use-skills-Blpg2BqE.js} +1 -1
- package/build/assets/{use-tracking-D2Qg5Lpd.js → use-tracking-DFoPQUSU.js} +1 -1
- package/build/assets/{use-user-conversation-CnE4zhOA.js → use-user-conversation-BrN2xeQU.js} +1 -1
- package/build/assets/{verification-settings-CfkrXoSa.js → verification-settings-C8KzAdAX.js} +1 -1
- package/build/index.html +4 -4
- package/config/defaults.json +1 -1
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +1 -1
- package/dist/config/defaults.js.map +1 -1
- package/dist/hooks/query/use-task-polling.cjs +1 -1
- package/dist/hooks/query/use-task-polling.cjs.map +1 -1
- package/dist/hooks/query/use-task-polling.d.ts +19 -3
- package/dist/hooks/query/use-task-polling.js +36 -35
- package/dist/hooks/query/use-task-polling.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/routes/conversation.cjs +1 -1
- package/dist/routes/conversation.cjs.map +1 -1
- package/dist/routes/conversation.js +1 -1
- package/dist/routes/conversation.js.map +1 -1
- package/package.json +1 -1
- package/build/assets/agent-settings-DDkSavD7.js +0 -1
- package/build/assets/conversation-DgHqMjnY.js +0 -1
- package/build/assets/conversation-panel-78Rxh_-I.js +0 -1
- package/build/assets/home-DKPGQ5P3.js +0 -1
- package/build/assets/index-home-Bko2Itv5.js +0 -1
- package/build/assets/llm-settings-BBsZFi9l.js +0 -1
- package/build/assets/use-runtime-is-ready-vCFOcLFa.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-task-polling.js","names":[],"sources":["../../../src/hooks/query/use-task-polling.ts"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef } from \"react\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport AgentServerConversationService from \"#/api/conversation-service/agent-server-conversation-service.api\";\nimport type { AppConversationStartTask } from \"#/api/conversation-service/agent-server-conversation-service.types\";\nimport {\n getStoredConversationMetadata,\n setStoredConversationMetadata,\n toPluginCoordinates,\n} from \"#/api/conversation-metadata-store\";\nimport { useNavigation } from \"#/context/navigation-context\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport {\n consumePendingTaskDraft,\n setConversationState,\n} from \"#/utils/conversation-local-storage\";\nimport { useOptimisticUserMessageStore } from \"#/stores/optimistic-user-message-store\";\nimport { trackCloudConversationReady } from \"#/services/cloud-funnel-analytics\";\nimport { flushPendingTaskAttachments } from \"#/utils/flush-pending-task-attachments\";\nimport {\n clearPendingTaskMessageLink,\n consumeScheduledPendingTaskMessageReassign,\n linkPendingTaskMessages,\n schedulePendingTaskMessageReassign,\n} from \"#/utils/pending-task-message-link\";\n\nconst storeTaskPlugins = (\n task: AppConversationStartTask,\n conversationId: string,\n) => {\n const plugins = task.request.plugins?.map(toPluginCoordinates);\n if (!plugins?.length) return;\n\n const metadata = getStoredConversationMetadata(conversationId);\n setStoredConversationMetadata(conversationId, {\n ...metadata,\n selected_repository:\n metadata?.selected_repository ?? task.request.selected_repository ?? null,\n selected_branch:\n metadata?.selected_branch ?? task.request.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? task.request.git_provider ?? null,\n plugins,\n });\n};\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"use-task-polling.js","names":[],"sources":["../../../src/hooks/query/use-task-polling.ts"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef } from \"react\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport AgentServerConversationService from \"#/api/conversation-service/agent-server-conversation-service.api\";\nimport type { AppConversationStartTask } from \"#/api/conversation-service/agent-server-conversation-service.types\";\nimport {\n getStoredConversationMetadata,\n setStoredConversationMetadata,\n toPluginCoordinates,\n} from \"#/api/conversation-metadata-store\";\nimport { useNavigation } from \"#/context/navigation-context\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport {\n consumePendingTaskDraft,\n setConversationState,\n} from \"#/utils/conversation-local-storage\";\nimport { useOptimisticUserMessageStore } from \"#/stores/optimistic-user-message-store\";\nimport { trackCloudConversationReady } from \"#/services/cloud-funnel-analytics\";\nimport { flushPendingTaskAttachments } from \"#/utils/flush-pending-task-attachments\";\nimport {\n clearPendingTaskMessageLink,\n consumeScheduledPendingTaskMessageReassign,\n linkPendingTaskMessages,\n schedulePendingTaskMessageReassign,\n} from \"#/utils/pending-task-message-link\";\n\nconst storeTaskPlugins = (\n task: AppConversationStartTask,\n conversationId: string,\n) => {\n const plugins = task.request.plugins?.map(toPluginCoordinates);\n if (!plugins?.length) return;\n\n const metadata = getStoredConversationMetadata(conversationId);\n setStoredConversationMetadata(conversationId, {\n ...metadata,\n selected_repository:\n metadata?.selected_repository ?? task.request.selected_repository ?? null,\n selected_branch:\n metadata?.selected_branch ?? task.request.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? task.request.git_provider ?? null,\n plugins,\n });\n};\n\n/**\n * Read the shared polling state for a V1 conversation start task.\n *\n * This hook:\n * - Detects if the conversationId URL param is a task ID (format: \"task-{uuid}\")\n * - Polls the V1 start task API every 3 seconds until status is READY or ERROR\n * - Exposes task status and details for UI components to show loading states and errors\n *\n * URL patterns:\n * - /conversations/task-{uuid} → Polls start task, then navigates to /conversations/{conversation-id}\n * - /conversations/{uuid or hex} → No polling (handled by useActiveConversation)\n *\n * The conversation route mounts useTaskPollingController once to own READY\n * side effects; other components can consume this hook without repeating them.\n */\nexport const useTaskPolling = () => {\n // Optional: the chat input shell renders on the home page too; polling\n // simply no-ops when there's no conversation id yet.\n const { conversationId } = useOptionalConversationId();\n\n // Check if this is a task ID (format: \"task-{uuid}\")\n const isTask = !!conversationId && conversationId.startsWith(\"task-\");\n const taskId = isTask ? conversationId!.replace(\"task-\", \"\") : null;\n\n // Poll the task if this is a task ID\n const taskQuery = useQuery({\n queryKey: [\"start-task\", taskId],\n queryFn: async () => {\n if (!taskId) return null;\n return AgentServerConversationService.getStartTask(taskId);\n },\n enabled: !!taskId,\n refetchInterval: (query) => {\n const task = query.state.data;\n if (!task) return false;\n\n // Stop polling if ready or error\n if (task.status === \"READY\" || task.status === \"ERROR\") {\n return false;\n }\n\n // Poll every 3 seconds while task is in progress\n return 3000;\n },\n retry: false,\n });\n\n return {\n isTask,\n taskId,\n conversationId: isTask ? null : (conversationId ?? null),\n task: taskQuery.data,\n taskStatus: taskQuery.data?.status,\n taskDetail: taskQuery.data?.detail,\n taskError: taskQuery.error,\n isLoadingTask: taskQuery.isLoading,\n // Repository information from task request\n repositoryInfo: {\n selectedRepository: taskQuery.data?.request?.selected_repository,\n selectedBranch: taskQuery.data?.request?.selected_branch,\n gitProvider: taskQuery.data?.request?.git_provider,\n },\n };\n};\n\n/** Own the task lifecycle side effects once at the conversation route. */\nexport const useTaskPollingController = () => {\n const polling = useTaskPolling();\n const { task, taskId } = polling;\n const { conversationId } = useOptionalConversationId();\n const { navigate } = useNavigation();\n const handledReadyTaskIdRef = useRef<string | null>(null);\n\n // Reassign optimistic pending messages before paint on the real conversation\n // route. Doing this in the ready handler before navigate leaves a frame where\n // the URL still points at `task-{uuid}` but pending is keyed to the real id.\n useLayoutEffect(() => {\n if (!conversationId) {\n return;\n }\n\n const pendingReassign =\n consumeScheduledPendingTaskMessageReassign(conversationId);\n if (!pendingReassign) {\n return;\n }\n\n useOptimisticUserMessageStore\n .getState()\n .reassignPendingMessages(\n pendingReassign.fromConversationId,\n pendingReassign.toConversationId,\n );\n clearPendingTaskMessageLink(pendingReassign.toConversationId);\n }, [conversationId]);\n\n // Navigate to conversation ID when task is ready\n useEffect(() => {\n const appConversationId = task?.app_conversation_id;\n if (\n !taskId ||\n task?.status !== \"READY\" ||\n !appConversationId ||\n handledReadyTaskIdRef.current === taskId\n ) {\n return;\n }\n\n handledReadyTaskIdRef.current = taskId;\n trackCloudConversationReady(taskId, appConversationId);\n storeTaskPlugins(task, appConversationId);\n\n void (async () => {\n await flushPendingTaskAttachments(taskId, appConversationId);\n\n const taskConversationId = `task-${taskId}`;\n linkPendingTaskMessages(appConversationId, taskConversationId);\n schedulePendingTaskMessageReassign(taskConversationId, appConversationId);\n\n const pendingDraft = consumePendingTaskDraft(taskId);\n if (pendingDraft) {\n setConversationState(appConversationId, {\n draftMessage: pendingDraft,\n });\n }\n\n navigate(`/conversations/${appConversationId}`, { replace: true });\n })();\n }, [task, taskId, navigate]);\n\n return polling;\n};\n"],"mappings":";;;;;;;;;;;;AAyBA,IAAM,KACJ,GACA,MACG;CACH,IAAM,IAAU,EAAK,QAAQ,SAAS,IAAI,EAAoB;AAC9D,KAAI,CAAC,GAAS,OAAQ;CAEtB,IAAM,IAAW,EAA8B,EAAe;AAC9D,GAA8B,GAAgB;EAC5C,GAAG;EACH,qBACE,GAAU,uBAAuB,EAAK,QAAQ,uBAAuB;EACvE,iBACE,GAAU,mBAAmB,EAAK,QAAQ,mBAAmB;EAC/D,cAAc,GAAU,gBAAgB,EAAK,QAAQ,gBAAgB;EACrE;EACD,CAAC;GAkBS,UAAuB;CAGlC,IAAM,EAAE,sBAAmB,GAA2B,EAGhD,IAAS,CAAC,CAAC,KAAkB,EAAe,WAAW,QAAQ,EAC/D,IAAS,IAAS,EAAgB,QAAQ,SAAS,GAAG,GAAG,MAGzD,IAAY,EAAS;EACzB,UAAU,CAAC,cAAc,EAAO;EAChC,SAAS,YACF,IACE,EAA+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AE,SAAS,IAAM,CAAC;MAChE;IACH;EAAC;EAAM;EAAQ;EAAS,CAAC,EAErB"}
|
package/dist/package.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`./_virtual/_rolldown/runtime.cjs`);var e={name:`@openhands/agent-canvas`,version:`1.5.
|
|
1
|
+
require(`./_virtual/_rolldown/runtime.cjs`);var e={name:`@openhands/agent-canvas`,version:`1.5.2`,description:`Agent Canvas UI for OpenHands - run AI coding agents with a visual interface`,license:`MIT`,private:!1,type:`module`,repository:{type:`git`,url:`https://github.com/OpenHands/agent-canvas`},homepage:`https://github.com/OpenHands/agent-canvas#readme`,bugs:{url:`https://github.com/OpenHands/agent-canvas/issues`},bin:{"agent-canvas":`bin/agent-canvas.mjs`},engines:{node:`>=22.12.0`},dependencies:{"@heroui/react":`2.8.10`,"@microlink/react-json-view":`1.31.20`,"@monaco-editor/react":`4.7.0`,"@openhands/extensions":`0.9.0`,"@openhands/typescript-client":`1.34.0`,"@react-router/node":`7.17.0`,"@react-router/serve":`7.17.0`,"@tailwindcss/vite":`4.2.4`,"@tanstack/react-query":`5.100.9`,"@types/shell-quote":`1.7.5`,"@uidotdev/usehooks":`2.4.1`,"@xterm/addon-fit":`0.11.0`,"@xterm/xterm":`6.0.0`,axios:`1.16.0`,"class-variance-authority":`0.7.1`,clsx:`2.1.1`,downshift:`9.3.2`,"framer-motion":`12.38.0`,httpxy:`0.5.3`,i18next:`26.0.8`,"i18next-browser-languagedetector":`8.2.1`,"i18next-http-backend":`4.0.0`,isbot:`5.1.39`,"lucide-react":`1.14.0`,"monaco-editor":`0.55.1`,"posthog-js":`1.372.6`,react:`19.2.5`,"react-dom":`19.2.5`,"react-hot-toast":`2.6.0`,"react-i18next":`17.0.6`,"react-icons":`5.6.0`,"react-markdown":`10.1.0`,"react-router":`7.17.0`,"react-syntax-highlighter":`16.1.1`,"rehype-raw":`7.0.0`,"rehype-sanitize":`6.0.0`,"remark-breaks":`4.0.0`,"remark-gfm":`4.0.1`,"shell-quote":`1.8.4`,sirv:`3.0.2`,"sirv-cli":`3.0.1`,"socket.io-client":`4.8.3`,"tailwind-merge":`3.5.0`,"tailwind-scrollbar":`4.0.2`,"unist-util-visit":`5.1.0`,uuid:`14.0.0`,vite:`8.0.10`,winston:`3.19.0`,"winston-daily-rotate-file":`5.0.0`,zustand:`5.0.12`},scripts:{dev:`node --env-file-if-exists=.env scripts/dev-with-automation.mjs`,"dev:static":`node --env-file-if-exists=.env scripts/dev-static.mjs`,"dev:extra-backend":`node --env-file-if-exists=.env scripts/dev-extra-backend.mjs`,"dev:minimal":`node --env-file-if-exists=.env scripts/dev-safe.mjs`,"dev:frontend":`npm run make-i18n && cross-env VITE_MOCK_API=false react-router dev`,"dev:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router dev`,build:`npm run build:app`,"build:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router build`,start:`npx sirv-cli build/ --single`,test:`npm run make-i18n && vitest run`,"test:e2e":`playwright test --pass-with-no-tests`,"test:e2e:live":`node --env-file-if-exists=.env tests/e2e/live/scripts/run-live-e2e.mjs`,"test:e2e:mock-llm":`playwright test --config=playwright.mock-llm.config.ts`,"test:e2e:mock-llm:docker":`playwright test --config=playwright.mock-llm-docker.config.ts`,"test:coverage":`npm run make-i18n && vitest run --coverage`,dev_wsl:`VITE_WATCH_USE_POLLING=true vite`,preview:`vite preview`,"make-i18n":`node scripts/make-i18n-translations.cjs`,prelint:`npm run make-i18n`,lint:`npm run typecheck && eslint src && prettier --check src/**/*.{ts,tsx}`,"lint:fix":`eslint src --fix && prettier --write src/**/*.{ts,tsx}`,prepare:`husky`,typecheck:`react-router typegen && tsc`,"typecheck:staged":`react-router typegen && npx tsc --noEmit --skipLibCheck`,"check-translation-completeness":`node scripts/check-translation-completeness.cjs`,"build:app":`npm run make-i18n && react-router build`,"build:lib":`npm run make-i18n && react-router typegen && cross-env BUILD_LIB=true vite build && tsc -p tsconfig.lib.json`,"build:docker":`node scripts/docker-build.mjs`,"example:acp-docker:env":`node scripts/gen-acp-docker-env.mjs`},"lint-staged":{"src/**/*.{ts,tsx,js}":[`eslint --fix`,`prettier --write`],"src/**/*.{ts,tsx}":[`node scripts/run-staged-typecheck.mjs`],"src/**/*":[`npm run check-translation-completeness`]},devDependencies:{"@eslint/eslintrc":`3.3.1`,"@eslint/js":`9.39.4`,"@mswjs/socket.io-binding":`0.2.0`,"@playwright/test":`1.59.1`,"@react-router/dev":`7.17.0`,"@tailwindcss/typography":`0.5.19`,"@tanstack/eslint-plugin-query":`5.100.9`,"@testing-library/dom":`10.4.1`,"@testing-library/jest-dom":`6.9.1`,"@testing-library/react":`16.3.2`,"@testing-library/user-event":`14.6.1`,"@types/mdast":`4.0.4`,"@types/node":`25.6.0`,"@types/react":`19.2.14`,"@types/react-dom":`19.2.3`,"@types/react-syntax-highlighter":`15.5.13`,"@typescript-eslint/eslint-plugin":`8.59.2`,"@typescript-eslint/parser":`8.59.2`,"@vercel/react-router":`1.3.0`,"@vitest/coverage-v8":`4.1.5`,"cross-env":`10.1.0`,eslint:`9.39.4`,"eslint-config-prettier":`10.1.8`,"eslint-import-resolver-typescript":`4.4.4`,"eslint-plugin-i18next":`6.1.4`,"eslint-plugin-import-x":`4.16.2`,"eslint-plugin-jsx-a11y":`6.10.2`,"eslint-plugin-prettier":`5.5.5`,"eslint-plugin-react":`7.37.5`,"eslint-plugin-react-hooks":`7.1.1`,"eslint-plugin-unused-imports":`4.4.1`,globals:`16.5.0`,husky:`9.1.7`,jsdom:`29.1.1`,"lint-staged":`16.4.0`,msw:`2.14.2`,"postcss-prefix-selector":`2.1.1`,prettier:`3.8.3`,tailwindcss:`4.2.4`,typescript:`6.0.3`,"vite-plugin-svgr":`5.2.0`,vitest:`4.1.5`},packageManager:`npm@10.5.0`,volta:{node:`22.12.0`},msw:{workerDirectory:[`public`]},overrides:{"@vercel/static-config":{ajv:`8.20.0`},dompurify:`3.4.7`},main:`./dist/index.cjs`,module:`./dist/index.js`,types:`./dist/index.d.ts`,files:[`dist`,`bin`,`build`,`config`,`scripts`,`tools`],exports:{".":{types:`./dist/index.d.ts`,import:`./dist/index.js`,require:`./dist/index.cjs`},"./browser":{types:`./dist/components/browser/index.d.ts`,import:`./dist/components/browser/index.js`,require:`./dist/components/browser/index.cjs`},"./conversation":{types:`./dist/components/conversation/index.d.ts`,import:`./dist/components/conversation/index.js`,require:`./dist/components/conversation/index.cjs`},"./files":{types:`./dist/components/files/index.d.ts`,import:`./dist/components/files/index.js`,require:`./dist/components/files/index.cjs`},"./settings":{types:`./dist/components/settings/index.d.ts`,import:`./dist/components/settings/index.js`,require:`./dist/components/settings/index.cjs`},"./sidebar":{types:`./dist/components/sidebar/index.d.ts`,import:`./dist/components/sidebar/index.js`,require:`./dist/components/sidebar/index.cjs`},"./terminal":{types:`./dist/components/terminal/index.d.ts`,import:`./dist/components/terminal/index.js`,require:`./dist/components/terminal/index.cjs`},"./i18n":{types:`./dist/i18n/index.d.ts`,import:`./dist/i18n/index.js`,require:`./dist/i18n/index.cjs`},"./package.json":`./package.json`},peerDependencies:{react:`19.2.5`,"react-dom":`19.2.5`,"react-router":`7.17.0`}};exports.default=e;
|
|
2
2
|
//# sourceMappingURL=package.cjs.map
|
package/dist/package.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@openhands/agent-canvas\",\n \"version\": \"1.5.
|
|
1
|
+
{"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@openhands/agent-canvas\",\n \"version\": \"1.5.2\",\n \"description\": \"Agent Canvas UI for OpenHands - run AI coding agents with a visual interface\",\n \"license\": \"MIT\",\n \"private\": false,\n \"type\": \"module\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/OpenHands/agent-canvas\"\n },\n \"homepage\": \"https://github.com/OpenHands/agent-canvas#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/OpenHands/agent-canvas/issues\"\n },\n \"bin\": {\n \"agent-canvas\": \"bin/agent-canvas.mjs\"\n },\n \"engines\": {\n \"node\": \">=22.12.0\"\n },\n \"dependencies\": {\n \"@heroui/react\": \"2.8.10\",\n \"@microlink/react-json-view\": \"1.31.20\",\n \"@monaco-editor/react\": \"4.7.0\",\n \"@openhands/extensions\": \"0.9.0\",\n \"@openhands/typescript-client\": \"1.34.0\",\n \"@react-router/node\": \"7.17.0\",\n \"@react-router/serve\": \"7.17.0\",\n \"@tailwindcss/vite\": \"4.2.4\",\n \"@tanstack/react-query\": \"5.100.9\",\n \"@types/shell-quote\": \"1.7.5\",\n \"@uidotdev/usehooks\": \"2.4.1\",\n \"@xterm/addon-fit\": \"0.11.0\",\n \"@xterm/xterm\": \"6.0.0\",\n \"axios\": \"1.16.0\",\n \"class-variance-authority\": \"0.7.1\",\n \"clsx\": \"2.1.1\",\n \"downshift\": \"9.3.2\",\n \"framer-motion\": \"12.38.0\",\n \"httpxy\": \"0.5.3\",\n \"i18next\": \"26.0.8\",\n \"i18next-browser-languagedetector\": \"8.2.1\",\n \"i18next-http-backend\": \"4.0.0\",\n \"isbot\": \"5.1.39\",\n \"lucide-react\": \"1.14.0\",\n \"monaco-editor\": \"0.55.1\",\n \"posthog-js\": \"1.372.6\",\n \"react\": \"19.2.5\",\n \"react-dom\": \"19.2.5\",\n \"react-hot-toast\": \"2.6.0\",\n \"react-i18next\": \"17.0.6\",\n \"react-icons\": \"5.6.0\",\n \"react-markdown\": \"10.1.0\",\n \"react-router\": \"7.17.0\",\n \"react-syntax-highlighter\": \"16.1.1\",\n \"rehype-raw\": \"7.0.0\",\n \"rehype-sanitize\": \"6.0.0\",\n \"remark-breaks\": \"4.0.0\",\n \"remark-gfm\": \"4.0.1\",\n \"shell-quote\": \"1.8.4\",\n \"sirv\": \"3.0.2\",\n \"sirv-cli\": \"3.0.1\",\n \"socket.io-client\": \"4.8.3\",\n \"tailwind-merge\": \"3.5.0\",\n \"tailwind-scrollbar\": \"4.0.2\",\n \"unist-util-visit\": \"5.1.0\",\n \"uuid\": \"14.0.0\",\n \"vite\": \"8.0.10\",\n \"winston\": \"3.19.0\",\n \"winston-daily-rotate-file\": \"5.0.0\",\n \"zustand\": \"5.0.12\"\n },\n \"scripts\": {\n \"dev\": \"node --env-file-if-exists=.env scripts/dev-with-automation.mjs\",\n \"dev:static\": \"node --env-file-if-exists=.env scripts/dev-static.mjs\",\n \"dev:extra-backend\": \"node --env-file-if-exists=.env scripts/dev-extra-backend.mjs\",\n \"dev:minimal\": \"node --env-file-if-exists=.env scripts/dev-safe.mjs\",\n \"dev:frontend\": \"npm run make-i18n && cross-env VITE_MOCK_API=false react-router dev\",\n \"dev:mock\": \"npm run make-i18n && cross-env VITE_MOCK_API=true react-router dev\",\n \"build\": \"npm run build:app\",\n \"build:mock\": \"npm run make-i18n && cross-env VITE_MOCK_API=true react-router build\",\n \"start\": \"npx sirv-cli build/ --single\",\n \"test\": \"npm run make-i18n && vitest run\",\n \"test:e2e\": \"playwright test --pass-with-no-tests\",\n \"test:e2e:live\": \"node --env-file-if-exists=.env tests/e2e/live/scripts/run-live-e2e.mjs\",\n \"test:e2e:mock-llm\": \"playwright test --config=playwright.mock-llm.config.ts\",\n \"test:e2e:mock-llm:docker\": \"playwright test --config=playwright.mock-llm-docker.config.ts\",\n \"test:coverage\": \"npm run make-i18n && vitest run --coverage\",\n \"dev_wsl\": \"VITE_WATCH_USE_POLLING=true vite\",\n \"preview\": \"vite preview\",\n \"make-i18n\": \"node scripts/make-i18n-translations.cjs\",\n \"prelint\": \"npm run make-i18n\",\n \"lint\": \"npm run typecheck && eslint src && prettier --check src/**/*.{ts,tsx}\",\n \"lint:fix\": \"eslint src --fix && prettier --write src/**/*.{ts,tsx}\",\n \"prepare\": \"husky\",\n \"typecheck\": \"react-router typegen && tsc\",\n \"typecheck:staged\": \"react-router typegen && npx tsc --noEmit --skipLibCheck\",\n \"check-translation-completeness\": \"node scripts/check-translation-completeness.cjs\",\n \"build:app\": \"npm run make-i18n && react-router build\",\n \"build:lib\": \"npm run make-i18n && react-router typegen && cross-env BUILD_LIB=true vite build && tsc -p tsconfig.lib.json\",\n \"build:docker\": \"node scripts/docker-build.mjs\",\n \"example:acp-docker:env\": \"node scripts/gen-acp-docker-env.mjs\"\n },\n \"lint-staged\": {\n \"src/**/*.{ts,tsx,js}\": [\n \"eslint --fix\",\n \"prettier --write\"\n ],\n \"src/**/*.{ts,tsx}\": [\n \"node scripts/run-staged-typecheck.mjs\"\n ],\n \"src/**/*\": [\n \"npm run check-translation-completeness\"\n ]\n },\n \"devDependencies\": {\n \"@eslint/eslintrc\": \"3.3.1\",\n \"@eslint/js\": \"9.39.4\",\n \"@mswjs/socket.io-binding\": \"0.2.0\",\n \"@playwright/test\": \"1.59.1\",\n \"@react-router/dev\": \"7.17.0\",\n \"@tailwindcss/typography\": \"0.5.19\",\n \"@tanstack/eslint-plugin-query\": \"5.100.9\",\n \"@testing-library/dom\": \"10.4.1\",\n \"@testing-library/jest-dom\": \"6.9.1\",\n \"@testing-library/react\": \"16.3.2\",\n \"@testing-library/user-event\": \"14.6.1\",\n \"@types/mdast\": \"4.0.4\",\n \"@types/node\": \"25.6.0\",\n \"@types/react\": \"19.2.14\",\n \"@types/react-dom\": \"19.2.3\",\n \"@types/react-syntax-highlighter\": \"15.5.13\",\n \"@typescript-eslint/eslint-plugin\": \"8.59.2\",\n \"@typescript-eslint/parser\": \"8.59.2\",\n \"@vercel/react-router\": \"1.3.0\",\n \"@vitest/coverage-v8\": \"4.1.5\",\n \"cross-env\": \"10.1.0\",\n \"eslint\": \"9.39.4\",\n \"eslint-config-prettier\": \"10.1.8\",\n \"eslint-import-resolver-typescript\": \"4.4.4\",\n \"eslint-plugin-i18next\": \"6.1.4\",\n \"eslint-plugin-import-x\": \"4.16.2\",\n \"eslint-plugin-jsx-a11y\": \"6.10.2\",\n \"eslint-plugin-prettier\": \"5.5.5\",\n \"eslint-plugin-react\": \"7.37.5\",\n \"eslint-plugin-react-hooks\": \"7.1.1\",\n \"eslint-plugin-unused-imports\": \"4.4.1\",\n \"globals\": \"16.5.0\",\n \"husky\": \"9.1.7\",\n \"jsdom\": \"29.1.1\",\n \"lint-staged\": \"16.4.0\",\n \"msw\": \"2.14.2\",\n \"postcss-prefix-selector\": \"2.1.1\",\n \"prettier\": \"3.8.3\",\n \"tailwindcss\": \"4.2.4\",\n \"typescript\": \"6.0.3\",\n \"vite-plugin-svgr\": \"5.2.0\",\n \"vitest\": \"4.1.5\"\n },\n \"packageManager\": \"npm@10.5.0\",\n \"volta\": {\n \"node\": \"22.12.0\"\n },\n \"msw\": {\n \"workerDirectory\": [\n \"public\"\n ]\n },\n \"overrides\": {\n \"@vercel/static-config\": {\n \"ajv\": \"8.20.0\"\n },\n \"dompurify\": \"3.4.7\"\n },\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"files\": [\n \"dist\",\n \"bin\",\n \"build\",\n \"config\",\n \"scripts\",\n \"tools\"\n ],\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\"\n },\n \"./browser\": {\n \"types\": \"./dist/components/browser/index.d.ts\",\n \"import\": \"./dist/components/browser/index.js\",\n \"require\": \"./dist/components/browser/index.cjs\"\n },\n \"./conversation\": {\n \"types\": \"./dist/components/conversation/index.d.ts\",\n \"import\": \"./dist/components/conversation/index.js\",\n \"require\": \"./dist/components/conversation/index.cjs\"\n },\n \"./files\": {\n \"types\": \"./dist/components/files/index.d.ts\",\n \"import\": \"./dist/components/files/index.js\",\n \"require\": \"./dist/components/files/index.cjs\"\n },\n \"./settings\": {\n \"types\": \"./dist/components/settings/index.d.ts\",\n \"import\": \"./dist/components/settings/index.js\",\n \"require\": \"./dist/components/settings/index.cjs\"\n },\n \"./sidebar\": {\n \"types\": \"./dist/components/sidebar/index.d.ts\",\n \"import\": \"./dist/components/sidebar/index.js\",\n \"require\": \"./dist/components/sidebar/index.cjs\"\n },\n \"./terminal\": {\n \"types\": \"./dist/components/terminal/index.d.ts\",\n \"import\": \"./dist/components/terminal/index.js\",\n \"require\": \"./dist/components/terminal/index.cjs\"\n },\n \"./i18n\": {\n \"types\": \"./dist/i18n/index.d.ts\",\n \"import\": \"./dist/i18n/index.js\",\n \"require\": \"./dist/i18n/index.cjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"peerDependencies\": {\n \"react\": \"19.2.5\",\n \"react-dom\": \"19.2.5\",\n \"react-router\": \"7.17.0\"\n }\n}\n"],"mappings":""}
|
package/dist/package.js
CHANGED
package/dist/package.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@openhands/agent-canvas\",\n \"version\": \"1.5.
|
|
1
|
+
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@openhands/agent-canvas\",\n \"version\": \"1.5.2\",\n \"description\": \"Agent Canvas UI for OpenHands - run AI coding agents with a visual interface\",\n \"license\": \"MIT\",\n \"private\": false,\n \"type\": \"module\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/OpenHands/agent-canvas\"\n },\n \"homepage\": \"https://github.com/OpenHands/agent-canvas#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/OpenHands/agent-canvas/issues\"\n },\n \"bin\": {\n \"agent-canvas\": \"bin/agent-canvas.mjs\"\n },\n \"engines\": {\n \"node\": \">=22.12.0\"\n },\n \"dependencies\": {\n \"@heroui/react\": \"2.8.10\",\n \"@microlink/react-json-view\": \"1.31.20\",\n \"@monaco-editor/react\": \"4.7.0\",\n \"@openhands/extensions\": \"0.9.0\",\n \"@openhands/typescript-client\": \"1.34.0\",\n \"@react-router/node\": \"7.17.0\",\n \"@react-router/serve\": \"7.17.0\",\n \"@tailwindcss/vite\": \"4.2.4\",\n \"@tanstack/react-query\": \"5.100.9\",\n \"@types/shell-quote\": \"1.7.5\",\n \"@uidotdev/usehooks\": \"2.4.1\",\n \"@xterm/addon-fit\": \"0.11.0\",\n \"@xterm/xterm\": \"6.0.0\",\n \"axios\": \"1.16.0\",\n \"class-variance-authority\": \"0.7.1\",\n \"clsx\": \"2.1.1\",\n \"downshift\": \"9.3.2\",\n \"framer-motion\": \"12.38.0\",\n \"httpxy\": \"0.5.3\",\n \"i18next\": \"26.0.8\",\n \"i18next-browser-languagedetector\": \"8.2.1\",\n \"i18next-http-backend\": \"4.0.0\",\n \"isbot\": \"5.1.39\",\n \"lucide-react\": \"1.14.0\",\n \"monaco-editor\": \"0.55.1\",\n \"posthog-js\": \"1.372.6\",\n \"react\": \"19.2.5\",\n \"react-dom\": \"19.2.5\",\n \"react-hot-toast\": \"2.6.0\",\n \"react-i18next\": \"17.0.6\",\n \"react-icons\": \"5.6.0\",\n \"react-markdown\": \"10.1.0\",\n \"react-router\": \"7.17.0\",\n \"react-syntax-highlighter\": \"16.1.1\",\n \"rehype-raw\": \"7.0.0\",\n \"rehype-sanitize\": \"6.0.0\",\n \"remark-breaks\": \"4.0.0\",\n \"remark-gfm\": \"4.0.1\",\n \"shell-quote\": \"1.8.4\",\n \"sirv\": \"3.0.2\",\n \"sirv-cli\": \"3.0.1\",\n \"socket.io-client\": \"4.8.3\",\n \"tailwind-merge\": \"3.5.0\",\n \"tailwind-scrollbar\": \"4.0.2\",\n \"unist-util-visit\": \"5.1.0\",\n \"uuid\": \"14.0.0\",\n \"vite\": \"8.0.10\",\n \"winston\": \"3.19.0\",\n \"winston-daily-rotate-file\": \"5.0.0\",\n \"zustand\": \"5.0.12\"\n },\n \"scripts\": {\n \"dev\": \"node --env-file-if-exists=.env scripts/dev-with-automation.mjs\",\n \"dev:static\": \"node --env-file-if-exists=.env scripts/dev-static.mjs\",\n \"dev:extra-backend\": \"node --env-file-if-exists=.env scripts/dev-extra-backend.mjs\",\n \"dev:minimal\": \"node --env-file-if-exists=.env scripts/dev-safe.mjs\",\n \"dev:frontend\": \"npm run make-i18n && cross-env VITE_MOCK_API=false react-router dev\",\n \"dev:mock\": \"npm run make-i18n && cross-env VITE_MOCK_API=true react-router dev\",\n \"build\": \"npm run build:app\",\n \"build:mock\": \"npm run make-i18n && cross-env VITE_MOCK_API=true react-router build\",\n \"start\": \"npx sirv-cli build/ --single\",\n \"test\": \"npm run make-i18n && vitest run\",\n \"test:e2e\": \"playwright test --pass-with-no-tests\",\n \"test:e2e:live\": \"node --env-file-if-exists=.env tests/e2e/live/scripts/run-live-e2e.mjs\",\n \"test:e2e:mock-llm\": \"playwright test --config=playwright.mock-llm.config.ts\",\n \"test:e2e:mock-llm:docker\": \"playwright test --config=playwright.mock-llm-docker.config.ts\",\n \"test:coverage\": \"npm run make-i18n && vitest run --coverage\",\n \"dev_wsl\": \"VITE_WATCH_USE_POLLING=true vite\",\n \"preview\": \"vite preview\",\n \"make-i18n\": \"node scripts/make-i18n-translations.cjs\",\n \"prelint\": \"npm run make-i18n\",\n \"lint\": \"npm run typecheck && eslint src && prettier --check src/**/*.{ts,tsx}\",\n \"lint:fix\": \"eslint src --fix && prettier --write src/**/*.{ts,tsx}\",\n \"prepare\": \"husky\",\n \"typecheck\": \"react-router typegen && tsc\",\n \"typecheck:staged\": \"react-router typegen && npx tsc --noEmit --skipLibCheck\",\n \"check-translation-completeness\": \"node scripts/check-translation-completeness.cjs\",\n \"build:app\": \"npm run make-i18n && react-router build\",\n \"build:lib\": \"npm run make-i18n && react-router typegen && cross-env BUILD_LIB=true vite build && tsc -p tsconfig.lib.json\",\n \"build:docker\": \"node scripts/docker-build.mjs\",\n \"example:acp-docker:env\": \"node scripts/gen-acp-docker-env.mjs\"\n },\n \"lint-staged\": {\n \"src/**/*.{ts,tsx,js}\": [\n \"eslint --fix\",\n \"prettier --write\"\n ],\n \"src/**/*.{ts,tsx}\": [\n \"node scripts/run-staged-typecheck.mjs\"\n ],\n \"src/**/*\": [\n \"npm run check-translation-completeness\"\n ]\n },\n \"devDependencies\": {\n \"@eslint/eslintrc\": \"3.3.1\",\n \"@eslint/js\": \"9.39.4\",\n \"@mswjs/socket.io-binding\": \"0.2.0\",\n \"@playwright/test\": \"1.59.1\",\n \"@react-router/dev\": \"7.17.0\",\n \"@tailwindcss/typography\": \"0.5.19\",\n \"@tanstack/eslint-plugin-query\": \"5.100.9\",\n \"@testing-library/dom\": \"10.4.1\",\n \"@testing-library/jest-dom\": \"6.9.1\",\n \"@testing-library/react\": \"16.3.2\",\n \"@testing-library/user-event\": \"14.6.1\",\n \"@types/mdast\": \"4.0.4\",\n \"@types/node\": \"25.6.0\",\n \"@types/react\": \"19.2.14\",\n \"@types/react-dom\": \"19.2.3\",\n \"@types/react-syntax-highlighter\": \"15.5.13\",\n \"@typescript-eslint/eslint-plugin\": \"8.59.2\",\n \"@typescript-eslint/parser\": \"8.59.2\",\n \"@vercel/react-router\": \"1.3.0\",\n \"@vitest/coverage-v8\": \"4.1.5\",\n \"cross-env\": \"10.1.0\",\n \"eslint\": \"9.39.4\",\n \"eslint-config-prettier\": \"10.1.8\",\n \"eslint-import-resolver-typescript\": \"4.4.4\",\n \"eslint-plugin-i18next\": \"6.1.4\",\n \"eslint-plugin-import-x\": \"4.16.2\",\n \"eslint-plugin-jsx-a11y\": \"6.10.2\",\n \"eslint-plugin-prettier\": \"5.5.5\",\n \"eslint-plugin-react\": \"7.37.5\",\n \"eslint-plugin-react-hooks\": \"7.1.1\",\n \"eslint-plugin-unused-imports\": \"4.4.1\",\n \"globals\": \"16.5.0\",\n \"husky\": \"9.1.7\",\n \"jsdom\": \"29.1.1\",\n \"lint-staged\": \"16.4.0\",\n \"msw\": \"2.14.2\",\n \"postcss-prefix-selector\": \"2.1.1\",\n \"prettier\": \"3.8.3\",\n \"tailwindcss\": \"4.2.4\",\n \"typescript\": \"6.0.3\",\n \"vite-plugin-svgr\": \"5.2.0\",\n \"vitest\": \"4.1.5\"\n },\n \"packageManager\": \"npm@10.5.0\",\n \"volta\": {\n \"node\": \"22.12.0\"\n },\n \"msw\": {\n \"workerDirectory\": [\n \"public\"\n ]\n },\n \"overrides\": {\n \"@vercel/static-config\": {\n \"ajv\": \"8.20.0\"\n },\n \"dompurify\": \"3.4.7\"\n },\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"files\": [\n \"dist\",\n \"bin\",\n \"build\",\n \"config\",\n \"scripts\",\n \"tools\"\n ],\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\"\n },\n \"./browser\": {\n \"types\": \"./dist/components/browser/index.d.ts\",\n \"import\": \"./dist/components/browser/index.js\",\n \"require\": \"./dist/components/browser/index.cjs\"\n },\n \"./conversation\": {\n \"types\": \"./dist/components/conversation/index.d.ts\",\n \"import\": \"./dist/components/conversation/index.js\",\n \"require\": \"./dist/components/conversation/index.cjs\"\n },\n \"./files\": {\n \"types\": \"./dist/components/files/index.d.ts\",\n \"import\": \"./dist/components/files/index.js\",\n \"require\": \"./dist/components/files/index.cjs\"\n },\n \"./settings\": {\n \"types\": \"./dist/components/settings/index.d.ts\",\n \"import\": \"./dist/components/settings/index.js\",\n \"require\": \"./dist/components/settings/index.cjs\"\n },\n \"./sidebar\": {\n \"types\": \"./dist/components/sidebar/index.d.ts\",\n \"import\": \"./dist/components/sidebar/index.js\",\n \"require\": \"./dist/components/sidebar/index.cjs\"\n },\n \"./terminal\": {\n \"types\": \"./dist/components/terminal/index.d.ts\",\n \"import\": \"./dist/components/terminal/index.js\",\n \"require\": \"./dist/components/terminal/index.cjs\"\n },\n \"./i18n\": {\n \"types\": \"./dist/i18n/index.d.ts\",\n \"import\": \"./dist/i18n/index.js\",\n \"require\": \"./dist/i18n/index.cjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"peerDependencies\": {\n \"react\": \"19.2.5\",\n \"react-dom\": \"19.2.5\",\n \"react-router\": \"7.17.0\"\n }\n}\n"],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../node_modules/react-i18next/dist/es/useTranslation.cjs`),n=require(`../i18n/declaration.cjs`),r=require(`../types/agent-state.cjs`),i=require(`../hooks/use-conversation-id.cjs`),a=require(`../stores/command-store.cjs`),o=require(`../stores/conversation-store.cjs`),s=require(`../stores/agent-store.cjs`),c=require(`../stores/conversation-state-store.cjs`),l=require(`../utils/custom-toast-handlers.cjs`),u=require(`../contexts/active-backend-context.cjs`),d=require(`../api/backend-registry/last-conversation-store.cjs`),f=require(`../stores/error-message-store.cjs`),p=require(`../api/cloud/conversation-service.api.cjs`),m=require(`../hooks/query/use-active-conversation.cjs`),h=require(`../wrapper/event-handler.cjs`),g=require(`../hooks/query/use-task-polling.cjs`),_=require(`../hooks/query/use-is-authed.cjs`),v=require(`../components/features/conversation/conversation-main/conversation-main.cjs`),y=require(`../components/features/conversation/conversation-main/conversation-mobile-panel-page.cjs`),b=require(`../contexts/websocket-provider-wrapper.cjs`);let x=require(`react`);x=e.__toESM(x,1);let S=require(`react/jsx-runtime`),C=require(`react-router`);function w(){let{t:e}=t.useTranslation(`openhands`),{conversationId:w}=i.useConversationId(),T=(0,C.useMatch)(`/conversations/:conversationId/panel`),{isTask:E,taskStatus:D,taskDetail:O}=g.
|
|
1
|
+
const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../node_modules/react-i18next/dist/es/useTranslation.cjs`),n=require(`../i18n/declaration.cjs`),r=require(`../types/agent-state.cjs`),i=require(`../hooks/use-conversation-id.cjs`),a=require(`../stores/command-store.cjs`),o=require(`../stores/conversation-store.cjs`),s=require(`../stores/agent-store.cjs`),c=require(`../stores/conversation-state-store.cjs`),l=require(`../utils/custom-toast-handlers.cjs`),u=require(`../contexts/active-backend-context.cjs`),d=require(`../api/backend-registry/last-conversation-store.cjs`),f=require(`../stores/error-message-store.cjs`),p=require(`../api/cloud/conversation-service.api.cjs`),m=require(`../hooks/query/use-active-conversation.cjs`),h=require(`../wrapper/event-handler.cjs`),g=require(`../hooks/query/use-task-polling.cjs`),_=require(`../hooks/query/use-is-authed.cjs`),v=require(`../components/features/conversation/conversation-main/conversation-main.cjs`),y=require(`../components/features/conversation/conversation-main/conversation-mobile-panel-page.cjs`),b=require(`../contexts/websocket-provider-wrapper.cjs`);let x=require(`react`);x=e.__toESM(x,1);let S=require(`react/jsx-runtime`),C=require(`react-router`);function w(){let{t:e}=t.useTranslation(`openhands`),{conversationId:w}=i.useConversationId(),T=(0,C.useMatch)(`/conversations/:conversationId/panel`),{isTask:E,taskStatus:D,taskDetail:O}=g.useTaskPollingController(),k=u.useActiveBackend(),A=x.default.useRef(k.backend.id),j=x.default.useRef(k.orgId),M=A.current!==k.backend.id||j.current!==k.orgId,{data:N,isFetched:P}=m.useActiveConversation(),{data:F}=_.useIsAuthed(),{resetConversationState:I}=o.useConversationStore(),L=(0,C.useNavigate)(),R=(0,C.useLocation)(),z=a.useCommandStore(e=>e.clearTerminal),B=c.useConversationStateStore(e=>e.reset),V=s.useAgentStore(e=>e.setCurrentAgentState),H=f.useErrorMessageStore(e=>e.removeErrorMessage);x.default.useEffect(()=>{z(),I(),B(),V(r.AgentState.LOADING),H()},[w,z,I,B,V,H]),x.default.useEffect(()=>{if(E&&D===`ERROR`){l.displayErrorToast(O||e(n.I18nKey.CONVERSATION$FAILED_TO_START_FROM_TASK));let t=R.state?.resumedFromConversationId;L(t?`/conversations/${t}`:`/conversations`,{replace:!0})}},[E,D,O,e,L,R.state]),x.default.useEffect(()=>{!P||!F||M||N||(d.clearLastConversationId(k.backend.id,k.orgId),l.displayErrorToast(e(n.I18nKey.CONVERSATION$NOT_EXIST_OR_NO_PERMISSION)),L(`/conversations`))},[N,P,F,L,e,M,k.backend.id,k.orgId]),x.default.useEffect(()=>{M||w&&(w.startsWith(`task-`)||d.setLastConversationId(k.backend.id,k.orgId,w))},[w,M,k.backend.id,k.orgId]);let U=x.default.useRef(null);return x.default.useEffect(()=>{!P||!N||k.backend.kind===`cloud`&&N.sandbox_status===`PAUSED`&&N.sandbox_id&&U.current!==N.id&&(U.current=N.id,p.resumeCloudSandbox(N.sandbox_id).catch(()=>{l.displayErrorToast(e(n.I18nKey.CONVERSATION$FAILED_TO_START_FROM_TASK))}))},[P,N?.id,N?.sandbox_status,N?.sandbox_id,k.backend.kind,e]),M?null:(0,S.jsx)(b.WebSocketProviderWrapper,{conversationId:w,children:(0,S.jsx)(h.EventHandler,{children:(0,S.jsx)(`div`,{"data-testid":`app-route`,className:`flex h-full flex-col`,children:T?(0,S.jsx)(y.ConversationMobilePanelPage,{onNavigateBack:()=>L(`/conversations/${w}`)}):(0,S.jsx)(v.ConversationMain,{})})})})}function T(){return(0,S.jsx)(w,{})}exports.default=T;
|
|
2
2
|
//# sourceMappingURL=conversation.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.cjs","names":[],"sources":["../../src/routes/conversation.tsx"],"sourcesContent":["import React from \"react\";\nimport { useNavigate, useLocation, useMatch } from \"react-router\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useConversationId } from \"#/hooks/use-conversation-id\";\nimport { useCommandStore } from \"#/stores/command-store\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { useAgentStore } from \"#/stores/agent-store\";\nimport { useConversationStateStore } from \"#/stores/conversation-state-store\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport {\n clearLastConversationId,\n setLastConversationId,\n} from \"#/api/backend-registry/last-conversation-store\";\nimport { AgentState } from \"#/types/agent-state\";\n\nimport { EventHandler } from \"../wrapper/event-handler\";\n\nimport { useActiveConversation } from \"#/hooks/query/use-active-conversation\";\nimport { useTaskPolling } from \"#/hooks/query/use-task-polling\";\n\nimport { displayErrorToast } from \"#/utils/custom-toast-handlers\";\nimport { useIsAuthed } from \"#/hooks/query/use-is-authed\";\nimport { ConversationMain } from \"#/components/features/conversation/conversation-main/conversation-main\";\nimport { ConversationMobilePanelPage } from \"#/components/features/conversation/conversation-main/conversation-mobile-panel-page\";\n\nimport { WebSocketProviderWrapper } from \"#/contexts/websocket-provider-wrapper\";\nimport { useErrorMessageStore } from \"#/stores/error-message-store\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { resumeCloudSandbox } from \"#/api/cloud/conversation-service.api\";\n\nfunction AppContent() {\n const { t } = useTranslation(\"openhands\");\n const { conversationId } = useConversationId();\n const panelViewMatch = useMatch(\"/conversations/:conversationId/panel\");\n\n const { isTask, taskStatus, taskDetail } = useTaskPolling();\n\n // The conversationId in the URL belongs to whichever backend was\n // active when the route first mounted. If the user switches backends\n // while this route is still mounted, the id is meaningless under the\n // new backend — disable the active-conversation fetch (and its 404\n // toast) so we don't fire a request that the BackendSelector's\n // redirect will immediately navigate away from anyway. Mirrors the\n // same guard in `routes/automation-detail.tsx`.\n const active = useActiveBackend();\n const mountedBackendId = React.useRef(active.backend.id);\n const mountedOrgId = React.useRef(active.orgId);\n const backendChanged =\n mountedBackendId.current !== active.backend.id ||\n mountedOrgId.current !== active.orgId;\n\n const { data: conversation, isFetched } = useActiveConversation();\n const { data: isAuthed } = useIsAuthed();\n const { resetConversationState } = useConversationStore();\n const navigate = useNavigate();\n const location = useLocation();\n const clearTerminal = useCommandStore((state) => state.clearTerminal);\n const resetConversationRuntimeState = useConversationStateStore(\n (state) => state.reset,\n );\n const setCurrentAgentState = useAgentStore(\n (state) => state.setCurrentAgentState,\n );\n const removeErrorMessage = useErrorMessageStore(\n (state) => state.removeErrorMessage,\n );\n\n // Per-conversation UI/runtime resets. The event store is cleared separately,\n // inside ConversationWebSocketProvider, so the clear is ordered *before* the\n // preloaded-history re-seed (see the note there) — clearing it here would run\n // too late and wipe the freshly seeded history on a conversation switch.\n React.useEffect(() => {\n clearTerminal();\n resetConversationState();\n resetConversationRuntimeState();\n setCurrentAgentState(AgentState.LOADING);\n removeErrorMessage();\n }, [\n conversationId,\n clearTerminal,\n resetConversationState,\n resetConversationRuntimeState,\n setCurrentAgentState,\n removeErrorMessage,\n ]);\n\n React.useEffect(() => {\n if (isTask && taskStatus === \"ERROR\") {\n displayErrorToast(\n taskDetail || t(I18nKey.CONVERSATION$FAILED_TO_START_FROM_TASK),\n );\n // Navigate back to the original conversation when a resume task fails so\n // the user isn't stranded at the dead task-{id} URL. The resume effect's\n // ref prevents it from immediately retrying once we land there.\n const resumedFrom = (location.state as Record<string, unknown> | null)\n ?.resumedFromConversationId as string | undefined;\n navigate(\n resumedFrom ? `/conversations/${resumedFrom}` : \"/conversations\",\n { replace: true },\n );\n }\n }, [isTask, taskStatus, taskDetail, t, navigate, location.state]);\n\n React.useEffect(() => {\n if (!isFetched || !isAuthed) return;\n // The BackendSelector is in the middle of redirecting us away from\n // this route — don't toast/navigate based on a 404 that's just\n // \"this id doesn't exist on the new backend\".\n if (backendChanged) return;\n\n if (!conversation) {\n // Clear the per-backend \"last selected\" slot so the next switch\n // to this backend doesn't try to revisit a stale id.\n clearLastConversationId(active.backend.id, active.orgId);\n displayErrorToast(t(I18nKey.CONVERSATION$NOT_EXIST_OR_NO_PERMISSION));\n navigate(\"/conversations\");\n }\n }, [\n conversation,\n isFetched,\n isAuthed,\n navigate,\n t,\n backendChanged,\n active.backend.id,\n active.orgId,\n ]);\n\n // Remember the most recently selected conversation for the current\n // (backend, org) so flipping back to this backend later restores the\n // user to where they left off. Skip while a backend switch is in\n // flight: the id in the URL is from the previous backend and would\n // otherwise overwrite the new backend's memory.\n React.useEffect(() => {\n if (backendChanged) return;\n if (!conversationId) return;\n if (conversationId.startsWith(\"task-\")) return;\n setLastConversationId(active.backend.id, active.orgId, conversationId);\n }, [conversationId, backendChanged, active.backend.id, active.orgId]);\n\n // Cloud conversation resume: mirrors OpenHands' useSandboxRecovery.\n //\n // When the cloud API reports sandbox_status === \"PAUSED\" the sandbox is\n // sleeping. The correct wake-up call is POST /api/v1/sandboxes/{id}/resume\n // (a lightweight unpause). The previous approach — creating a new start task\n // via POST /api/v1/app-conversations — was wrong: it tries to provision a\n // fresh conversation in the sandbox and is subject to a 120-second cold-start\n // timeout that can fail. The resume endpoint simply unpauses the existing one.\n //\n // After calling resume we stay on the current URL. The 3-second refetch\n // interval in useActiveConversation (active while conversation_url is null)\n // polls until conversation_url populates, then the WebSocket connects.\n //\n // A ref guards against duplicate triggers per unique conversation.id within\n // the same route-mount lifetime.\n const resumeTriggeredForRef = React.useRef<string | null>(null);\n React.useEffect(() => {\n if (!isFetched || !conversation) return;\n if (active.backend.kind !== \"cloud\") return;\n if (conversation.sandbox_status !== \"PAUSED\") return; // only resume PAUSED sandboxes\n if (!conversation.sandbox_id) return; // no sandbox to resume\n if (resumeTriggeredForRef.current === conversation.id) return; // already sent\n\n resumeTriggeredForRef.current = conversation.id;\n\n resumeCloudSandbox(conversation.sandbox_id).catch(() => {\n displayErrorToast(t(I18nKey.CONVERSATION$FAILED_TO_START_FROM_TASK));\n });\n }, [\n isFetched,\n conversation?.id,\n conversation?.sandbox_status,\n conversation?.sandbox_id,\n active.backend.kind,\n t,\n ]);\n\n // A backend switch is in flight (BackendSelector flips the active backend\n // and redirects to /conversations on the next tick). The conversationId in\n // the URL belongs to the *previous* backend, so unmount the whole\n // conversation subtree now — before any per-conversation query (history,\n // metrics, sub-conversations, runtime info, …) re-fires against a backend\n // the id is foreign to. Those foreign fetches fail response validation and\n // surface \"agent server returned data this UI does not understand\". This is\n // deterministic regardless of the navigate-vs-setActive render race: React\n // re-renders this parent before its children, so returning null removes them\n // before they can issue the request.\n if (backendChanged) {\n return null;\n }\n\n const content = (\n <EventHandler>\n <div data-testid=\"app-route\" className=\"flex h-full flex-col\">\n {panelViewMatch ? (\n <ConversationMobilePanelPage\n onNavigateBack={() => navigate(`/conversations/${conversationId}`)}\n />\n ) : (\n <ConversationMain />\n )}\n </div>\n </EventHandler>\n );\n\n return (\n <WebSocketProviderWrapper conversationId={conversationId}>\n {content}\n </WebSocketProviderWrapper>\n );\n}\n\nexport function ConversationView() {\n return <AppContent />;\n}\n\nexport default ConversationView;\n"],"mappings":"8sCA+BA,SAAS,GAAa,CACpB,GAAM,CAAE,KAAM,EAAA,eAAe,YAAY,CACnC,CAAE,kBAAmB,EAAA,mBAAmB,CACxC,GAAA,EAAA,EAAA,UAA0B,uCAAuC,CAEjE,CAAE,SAAQ,aAAY,cAAe,EAAA,gBAAgB,CASrD,EAAS,EAAA,kBAAkB,CAC3B,EAAmB,EAAA,QAAM,OAAO,EAAO,QAAQ,GAAG,CAClD,EAAe,EAAA,QAAM,OAAO,EAAO,MAAM,CACzC,EACJ,EAAiB,UAAY,EAAO,QAAQ,IAC5C,EAAa,UAAY,EAAO,MAE5B,CAAE,KAAM,EAAc,aAAc,EAAA,uBAAuB,CAC3D,CAAE,KAAM,GAAa,EAAA,aAAa,CAClC,CAAE,0BAA2B,EAAA,sBAAsB,CACnD,GAAA,EAAA,EAAA,cAAwB,CACxB,GAAA,EAAA,EAAA,cAAwB,CACxB,EAAgB,EAAA,gBAAiB,GAAU,EAAM,cAAc,CAC/D,EAAgC,EAAA,0BACnC,GAAU,EAAM,MAClB,CACK,EAAuB,EAAA,cAC1B,GAAU,EAAM,qBAClB,CACK,EAAqB,EAAA,qBACxB,GAAU,EAAM,mBAClB,CAMD,EAAA,QAAM,cAAgB,CACpB,GAAe,CACf,GAAwB,CACxB,GAA+B,CAC/B,EAAqB,EAAA,WAAW,QAAQ,CACxC,GAAoB,EACnB,CACD,EACA,EACA,EACA,EACA,EACA,EACD,CAAC,CAEF,EAAA,QAAM,cAAgB,CACpB,GAAI,GAAU,IAAe,QAAS,CACpC,EAAA,kBACE,GAAc,EAAE,EAAA,QAAQ,uCAAuC,CAChE,CAID,IAAM,EAAe,EAAS,OAC1B,0BACJ,EACE,EAAc,kBAAkB,IAAgB,iBAChD,CAAE,QAAS,GAAM,CAClB,GAEF,CAAC,EAAQ,EAAY,EAAY,EAAG,EAAU,EAAS,MAAM,CAAC,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Ac,CAAA"}
|
|
1
|
+
{"version":3,"file":"conversation.cjs","names":[],"sources":["../../src/routes/conversation.tsx"],"sourcesContent":["import React from \"react\";\nimport { useNavigate, useLocation, useMatch } from \"react-router\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useConversationId } from \"#/hooks/use-conversation-id\";\nimport { useCommandStore } from \"#/stores/command-store\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { useAgentStore } from \"#/stores/agent-store\";\nimport { useConversationStateStore } from \"#/stores/conversation-state-store\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport {\n clearLastConversationId,\n setLastConversationId,\n} from \"#/api/backend-registry/last-conversation-store\";\nimport { AgentState } from \"#/types/agent-state\";\n\nimport { EventHandler } from \"../wrapper/event-handler\";\n\nimport { useActiveConversation } from \"#/hooks/query/use-active-conversation\";\nimport { useTaskPollingController } from \"#/hooks/query/use-task-polling\";\n\nimport { displayErrorToast } from \"#/utils/custom-toast-handlers\";\nimport { useIsAuthed } from \"#/hooks/query/use-is-authed\";\nimport { ConversationMain } from \"#/components/features/conversation/conversation-main/conversation-main\";\nimport { ConversationMobilePanelPage } from \"#/components/features/conversation/conversation-main/conversation-mobile-panel-page\";\n\nimport { WebSocketProviderWrapper } from \"#/contexts/websocket-provider-wrapper\";\nimport { useErrorMessageStore } from \"#/stores/error-message-store\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { resumeCloudSandbox } from \"#/api/cloud/conversation-service.api\";\n\nfunction AppContent() {\n const { t } = useTranslation(\"openhands\");\n const { conversationId } = useConversationId();\n const panelViewMatch = useMatch(\"/conversations/:conversationId/panel\");\n\n const { isTask, taskStatus, taskDetail } = useTaskPollingController();\n\n // The conversationId in the URL belongs to whichever backend was\n // active when the route first mounted. If the user switches backends\n // while this route is still mounted, the id is meaningless under the\n // new backend — disable the active-conversation fetch (and its 404\n // toast) so we don't fire a request that the BackendSelector's\n // redirect will immediately navigate away from anyway. Mirrors the\n // same guard in `routes/automation-detail.tsx`.\n const active = useActiveBackend();\n const mountedBackendId = React.useRef(active.backend.id);\n const mountedOrgId = React.useRef(active.orgId);\n const backendChanged =\n mountedBackendId.current !== active.backend.id ||\n mountedOrgId.current !== active.orgId;\n\n const { data: conversation, isFetched } = useActiveConversation();\n const { data: isAuthed } = useIsAuthed();\n const { resetConversationState } = useConversationStore();\n const navigate = useNavigate();\n const location = useLocation();\n const clearTerminal = useCommandStore((state) => state.clearTerminal);\n const resetConversationRuntimeState = useConversationStateStore(\n (state) => state.reset,\n );\n const setCurrentAgentState = useAgentStore(\n (state) => state.setCurrentAgentState,\n );\n const removeErrorMessage = useErrorMessageStore(\n (state) => state.removeErrorMessage,\n );\n\n // Per-conversation UI/runtime resets. The event store is cleared separately,\n // inside ConversationWebSocketProvider, so the clear is ordered *before* the\n // preloaded-history re-seed (see the note there) — clearing it here would run\n // too late and wipe the freshly seeded history on a conversation switch.\n React.useEffect(() => {\n clearTerminal();\n resetConversationState();\n resetConversationRuntimeState();\n setCurrentAgentState(AgentState.LOADING);\n removeErrorMessage();\n }, [\n conversationId,\n clearTerminal,\n resetConversationState,\n resetConversationRuntimeState,\n setCurrentAgentState,\n removeErrorMessage,\n ]);\n\n React.useEffect(() => {\n if (isTask && taskStatus === \"ERROR\") {\n displayErrorToast(\n taskDetail || t(I18nKey.CONVERSATION$FAILED_TO_START_FROM_TASK),\n );\n // Navigate back to the original conversation when a resume task fails so\n // the user isn't stranded at the dead task-{id} URL. The resume effect's\n // ref prevents it from immediately retrying once we land there.\n const resumedFrom = (location.state as Record<string, unknown> | null)\n ?.resumedFromConversationId as string | undefined;\n navigate(\n resumedFrom ? `/conversations/${resumedFrom}` : \"/conversations\",\n { replace: true },\n );\n }\n }, [isTask, taskStatus, taskDetail, t, navigate, location.state]);\n\n React.useEffect(() => {\n if (!isFetched || !isAuthed) return;\n // The BackendSelector is in the middle of redirecting us away from\n // this route — don't toast/navigate based on a 404 that's just\n // \"this id doesn't exist on the new backend\".\n if (backendChanged) return;\n\n if (!conversation) {\n // Clear the per-backend \"last selected\" slot so the next switch\n // to this backend doesn't try to revisit a stale id.\n clearLastConversationId(active.backend.id, active.orgId);\n displayErrorToast(t(I18nKey.CONVERSATION$NOT_EXIST_OR_NO_PERMISSION));\n navigate(\"/conversations\");\n }\n }, [\n conversation,\n isFetched,\n isAuthed,\n navigate,\n t,\n backendChanged,\n active.backend.id,\n active.orgId,\n ]);\n\n // Remember the most recently selected conversation for the current\n // (backend, org) so flipping back to this backend later restores the\n // user to where they left off. Skip while a backend switch is in\n // flight: the id in the URL is from the previous backend and would\n // otherwise overwrite the new backend's memory.\n React.useEffect(() => {\n if (backendChanged) return;\n if (!conversationId) return;\n if (conversationId.startsWith(\"task-\")) return;\n setLastConversationId(active.backend.id, active.orgId, conversationId);\n }, [conversationId, backendChanged, active.backend.id, active.orgId]);\n\n // Cloud conversation resume: mirrors OpenHands' useSandboxRecovery.\n //\n // When the cloud API reports sandbox_status === \"PAUSED\" the sandbox is\n // sleeping. The correct wake-up call is POST /api/v1/sandboxes/{id}/resume\n // (a lightweight unpause). The previous approach — creating a new start task\n // via POST /api/v1/app-conversations — was wrong: it tries to provision a\n // fresh conversation in the sandbox and is subject to a 120-second cold-start\n // timeout that can fail. The resume endpoint simply unpauses the existing one.\n //\n // After calling resume we stay on the current URL. The 3-second refetch\n // interval in useActiveConversation (active while conversation_url is null)\n // polls until conversation_url populates, then the WebSocket connects.\n //\n // A ref guards against duplicate triggers per unique conversation.id within\n // the same route-mount lifetime.\n const resumeTriggeredForRef = React.useRef<string | null>(null);\n React.useEffect(() => {\n if (!isFetched || !conversation) return;\n if (active.backend.kind !== \"cloud\") return;\n if (conversation.sandbox_status !== \"PAUSED\") return; // only resume PAUSED sandboxes\n if (!conversation.sandbox_id) return; // no sandbox to resume\n if (resumeTriggeredForRef.current === conversation.id) return; // already sent\n\n resumeTriggeredForRef.current = conversation.id;\n\n resumeCloudSandbox(conversation.sandbox_id).catch(() => {\n displayErrorToast(t(I18nKey.CONVERSATION$FAILED_TO_START_FROM_TASK));\n });\n }, [\n isFetched,\n conversation?.id,\n conversation?.sandbox_status,\n conversation?.sandbox_id,\n active.backend.kind,\n t,\n ]);\n\n // A backend switch is in flight (BackendSelector flips the active backend\n // and redirects to /conversations on the next tick). The conversationId in\n // the URL belongs to the *previous* backend, so unmount the whole\n // conversation subtree now — before any per-conversation query (history,\n // metrics, sub-conversations, runtime info, …) re-fires against a backend\n // the id is foreign to. Those foreign fetches fail response validation and\n // surface \"agent server returned data this UI does not understand\". This is\n // deterministic regardless of the navigate-vs-setActive render race: React\n // re-renders this parent before its children, so returning null removes them\n // before they can issue the request.\n if (backendChanged) {\n return null;\n }\n\n const content = (\n <EventHandler>\n <div data-testid=\"app-route\" className=\"flex h-full flex-col\">\n {panelViewMatch ? (\n <ConversationMobilePanelPage\n onNavigateBack={() => navigate(`/conversations/${conversationId}`)}\n />\n ) : (\n <ConversationMain />\n )}\n </div>\n </EventHandler>\n );\n\n return (\n <WebSocketProviderWrapper conversationId={conversationId}>\n {content}\n </WebSocketProviderWrapper>\n );\n}\n\nexport function ConversationView() {\n return <AppContent />;\n}\n\nexport default ConversationView;\n"],"mappings":"8sCA+BA,SAAS,GAAa,CACpB,GAAM,CAAE,KAAM,EAAA,eAAe,YAAY,CACnC,CAAE,kBAAmB,EAAA,mBAAmB,CACxC,GAAA,EAAA,EAAA,UAA0B,uCAAuC,CAEjE,CAAE,SAAQ,aAAY,cAAe,EAAA,0BAA0B,CAS/D,EAAS,EAAA,kBAAkB,CAC3B,EAAmB,EAAA,QAAM,OAAO,EAAO,QAAQ,GAAG,CAClD,EAAe,EAAA,QAAM,OAAO,EAAO,MAAM,CACzC,EACJ,EAAiB,UAAY,EAAO,QAAQ,IAC5C,EAAa,UAAY,EAAO,MAE5B,CAAE,KAAM,EAAc,aAAc,EAAA,uBAAuB,CAC3D,CAAE,KAAM,GAAa,EAAA,aAAa,CAClC,CAAE,0BAA2B,EAAA,sBAAsB,CACnD,GAAA,EAAA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,EAAa,iBAAmB,UAC/B,EAAa,YACd,EAAsB,UAAY,EAAa,KAEnD,EAAsB,QAAU,EAAa,GAE7C,EAAA,mBAAmB,EAAa,WAAW,CAAC,UAAY,CACtD,EAAA,kBAAkB,EAAE,EAAA,QAAQ,uCAAuC,CAAC,EACpE,GACD,CACD,EACA,GAAc,GACd,GAAc,eACd,GAAc,WACd,EAAO,QAAQ,KACf,EACD,CAAC,CAYE,EACK,MAkBP,EAAA,EAAA,KAAC,EAAA,yBAAD,CAA0C,2BACvC,EAAA,EAAA,KAfF,EAAA,aAAD,CAAA,UACE,EAAA,EAAA,KAAC,MAAD,CAAK,cAAY,YAAY,UAAU,gCACpC,GACC,EAAA,EAAA,KAAC,EAAA,4BAAD,CACE,mBAAsB,EAAS,kBAAkB,IAAiB,CAClE,CAAA,EAEF,EAAA,EAAA,KAAC,EAAA,iBAAD,EAAoB,CAAA,CAElB,CAAA,CACO,CAKZ,CACwB,CAAA,CAI/B,SAAgB,GAAmB,CACjC,OAAO,EAAA,EAAA,KAAC,EAAD,EAAc,CAAA"}
|
|
@@ -13,7 +13,7 @@ import { useErrorMessageStore as f } from "../stores/error-message-store.js";
|
|
|
13
13
|
import { resumeCloudSandbox as p } from "../api/cloud/conversation-service.api.js";
|
|
14
14
|
import { useActiveConversation as m } from "../hooks/query/use-active-conversation.js";
|
|
15
15
|
import { EventHandler as h } from "../wrapper/event-handler.js";
|
|
16
|
-
import {
|
|
16
|
+
import { useTaskPollingController as g } from "../hooks/query/use-task-polling.js";
|
|
17
17
|
import { useIsAuthed as _ } from "../hooks/query/use-is-authed.js";
|
|
18
18
|
import { ConversationMain as v } from "../components/features/conversation/conversation-main/conversation-main.js";
|
|
19
19
|
import { ConversationMobilePanelPage as y } from "../components/features/conversation/conversation-main/conversation-mobile-panel-page.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.js","names":[],"sources":["../../src/routes/conversation.tsx"],"sourcesContent":["import React from \"react\";\nimport { useNavigate, useLocation, useMatch } from \"react-router\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useConversationId } from \"#/hooks/use-conversation-id\";\nimport { useCommandStore } from \"#/stores/command-store\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { useAgentStore } from \"#/stores/agent-store\";\nimport { useConversationStateStore } from \"#/stores/conversation-state-store\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport {\n clearLastConversationId,\n setLastConversationId,\n} from \"#/api/backend-registry/last-conversation-store\";\nimport { AgentState } from \"#/types/agent-state\";\n\nimport { EventHandler } from \"../wrapper/event-handler\";\n\nimport { useActiveConversation } from \"#/hooks/query/use-active-conversation\";\nimport { useTaskPolling } from \"#/hooks/query/use-task-polling\";\n\nimport { displayErrorToast } from \"#/utils/custom-toast-handlers\";\nimport { useIsAuthed } from \"#/hooks/query/use-is-authed\";\nimport { ConversationMain } from \"#/components/features/conversation/conversation-main/conversation-main\";\nimport { ConversationMobilePanelPage } from \"#/components/features/conversation/conversation-main/conversation-mobile-panel-page\";\n\nimport { WebSocketProviderWrapper } from \"#/contexts/websocket-provider-wrapper\";\nimport { useErrorMessageStore } from \"#/stores/error-message-store\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { resumeCloudSandbox } from \"#/api/cloud/conversation-service.api\";\n\nfunction AppContent() {\n const { t } = useTranslation(\"openhands\");\n const { conversationId } = useConversationId();\n const panelViewMatch = useMatch(\"/conversations/:conversationId/panel\");\n\n const { isTask, taskStatus, taskDetail } = useTaskPolling();\n\n // The conversationId in the URL belongs to whichever backend was\n // active when the route first mounted. If the user switches backends\n // while this route is still mounted, the id is meaningless under the\n // new backend — disable the active-conversation fetch (and its 404\n // toast) so we don't fire a request that the BackendSelector's\n // redirect will immediately navigate away from anyway. Mirrors the\n // same guard in `routes/automation-detail.tsx`.\n const active = useActiveBackend();\n const mountedBackendId = React.useRef(active.backend.id);\n const mountedOrgId = React.useRef(active.orgId);\n const backendChanged =\n mountedBackendId.current !== active.backend.id ||\n mountedOrgId.current !== active.orgId;\n\n const { data: conversation, isFetched } = useActiveConversation();\n const { data: isAuthed } = useIsAuthed();\n const { resetConversationState } = useConversationStore();\n const navigate = useNavigate();\n const location = useLocation();\n const clearTerminal = useCommandStore((state) => state.clearTerminal);\n const resetConversationRuntimeState = useConversationStateStore(\n (state) => state.reset,\n );\n const setCurrentAgentState = useAgentStore(\n (state) => state.setCurrentAgentState,\n );\n const removeErrorMessage = useErrorMessageStore(\n (state) => state.removeErrorMessage,\n );\n\n // Per-conversation UI/runtime resets. The event store is cleared separately,\n // inside ConversationWebSocketProvider, so the clear is ordered *before* the\n // preloaded-history re-seed (see the note there) — clearing it here would run\n // too late and wipe the freshly seeded history on a conversation switch.\n React.useEffect(() => {\n clearTerminal();\n resetConversationState();\n resetConversationRuntimeState();\n setCurrentAgentState(AgentState.LOADING);\n removeErrorMessage();\n }, [\n conversationId,\n clearTerminal,\n resetConversationState,\n resetConversationRuntimeState,\n setCurrentAgentState,\n removeErrorMessage,\n ]);\n\n React.useEffect(() => {\n if (isTask && taskStatus === \"ERROR\") {\n displayErrorToast(\n taskDetail || t(I18nKey.CONVERSATION$FAILED_TO_START_FROM_TASK),\n );\n // Navigate back to the original conversation when a resume task fails so\n // the user isn't stranded at the dead task-{id} URL. The resume effect's\n // ref prevents it from immediately retrying once we land there.\n const resumedFrom = (location.state as Record<string, unknown> | null)\n ?.resumedFromConversationId as string | undefined;\n navigate(\n resumedFrom ? `/conversations/${resumedFrom}` : \"/conversations\",\n { replace: true },\n );\n }\n }, [isTask, taskStatus, taskDetail, t, navigate, location.state]);\n\n React.useEffect(() => {\n if (!isFetched || !isAuthed) return;\n // The BackendSelector is in the middle of redirecting us away from\n // this route — don't toast/navigate based on a 404 that's just\n // \"this id doesn't exist on the new backend\".\n if (backendChanged) return;\n\n if (!conversation) {\n // Clear the per-backend \"last selected\" slot so the next switch\n // to this backend doesn't try to revisit a stale id.\n clearLastConversationId(active.backend.id, active.orgId);\n displayErrorToast(t(I18nKey.CONVERSATION$NOT_EXIST_OR_NO_PERMISSION));\n navigate(\"/conversations\");\n }\n }, [\n conversation,\n isFetched,\n isAuthed,\n navigate,\n t,\n backendChanged,\n active.backend.id,\n active.orgId,\n ]);\n\n // Remember the most recently selected conversation for the current\n // (backend, org) so flipping back to this backend later restores the\n // user to where they left off. Skip while a backend switch is in\n // flight: the id in the URL is from the previous backend and would\n // otherwise overwrite the new backend's memory.\n React.useEffect(() => {\n if (backendChanged) return;\n if (!conversationId) return;\n if (conversationId.startsWith(\"task-\")) return;\n setLastConversationId(active.backend.id, active.orgId, conversationId);\n }, [conversationId, backendChanged, active.backend.id, active.orgId]);\n\n // Cloud conversation resume: mirrors OpenHands' useSandboxRecovery.\n //\n // When the cloud API reports sandbox_status === \"PAUSED\" the sandbox is\n // sleeping. The correct wake-up call is POST /api/v1/sandboxes/{id}/resume\n // (a lightweight unpause). The previous approach — creating a new start task\n // via POST /api/v1/app-conversations — was wrong: it tries to provision a\n // fresh conversation in the sandbox and is subject to a 120-second cold-start\n // timeout that can fail. The resume endpoint simply unpauses the existing one.\n //\n // After calling resume we stay on the current URL. The 3-second refetch\n // interval in useActiveConversation (active while conversation_url is null)\n // polls until conversation_url populates, then the WebSocket connects.\n //\n // A ref guards against duplicate triggers per unique conversation.id within\n // the same route-mount lifetime.\n const resumeTriggeredForRef = React.useRef<string | null>(null);\n React.useEffect(() => {\n if (!isFetched || !conversation) return;\n if (active.backend.kind !== \"cloud\") return;\n if (conversation.sandbox_status !== \"PAUSED\") return; // only resume PAUSED sandboxes\n if (!conversation.sandbox_id) return; // no sandbox to resume\n if (resumeTriggeredForRef.current === conversation.id) return; // already sent\n\n resumeTriggeredForRef.current = conversation.id;\n\n resumeCloudSandbox(conversation.sandbox_id).catch(() => {\n displayErrorToast(t(I18nKey.CONVERSATION$FAILED_TO_START_FROM_TASK));\n });\n }, [\n isFetched,\n conversation?.id,\n conversation?.sandbox_status,\n conversation?.sandbox_id,\n active.backend.kind,\n t,\n ]);\n\n // A backend switch is in flight (BackendSelector flips the active backend\n // and redirects to /conversations on the next tick). The conversationId in\n // the URL belongs to the *previous* backend, so unmount the whole\n // conversation subtree now — before any per-conversation query (history,\n // metrics, sub-conversations, runtime info, …) re-fires against a backend\n // the id is foreign to. Those foreign fetches fail response validation and\n // surface \"agent server returned data this UI does not understand\". This is\n // deterministic regardless of the navigate-vs-setActive render race: React\n // re-renders this parent before its children, so returning null removes them\n // before they can issue the request.\n if (backendChanged) {\n return null;\n }\n\n const content = (\n <EventHandler>\n <div data-testid=\"app-route\" className=\"flex h-full flex-col\">\n {panelViewMatch ? (\n <ConversationMobilePanelPage\n onNavigateBack={() => navigate(`/conversations/${conversationId}`)}\n />\n ) : (\n <ConversationMain />\n )}\n </div>\n </EventHandler>\n );\n\n return (\n <WebSocketProviderWrapper conversationId={conversationId}>\n {content}\n </WebSocketProviderWrapper>\n );\n}\n\nexport function ConversationView() {\n return <AppContent />;\n}\n\nexport default ConversationView;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAS,IAAa;CACpB,IAAM,EAAE,SAAM,EAAe,YAAY,EACnC,EAAE,sBAAmB,GAAmB,EACxC,IAAiB,EAAS,uCAAuC,EAEjE,EAAE,WAAQ,eAAY,kBAAe,GAAgB,EASrD,IAAS,GAAkB,EAC3B,IAAmB,EAAM,OAAO,EAAO,QAAQ,GAAG,EAClD,IAAe,EAAM,OAAO,EAAO,MAAM,EACzC,IACJ,EAAiB,YAAY,EAAO,QAAQ,MAC5C,EAAa,YAAY,EAAO,OAE5B,EAAE,MAAM,GAAc,iBAAc,GAAuB,EAC3D,EAAE,MAAM,MAAa,GAAa,EAClC,EAAE,8BAA2B,GAAsB,EACnD,IAAW,GAAa,EACxB,IAAW,GAAa,EACxB,IAAgB,GAAiB,MAAU,EAAM,cAAc,EAC/D,IAAgC,GACnC,MAAU,EAAM,MAClB,EACK,IAAuB,GAC1B,MAAU,EAAM,qBAClB,EACK,IAAqB,GACxB,MA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EAA0C;YAd1C,kBAAC,GAAD,EAAA,UACE,kBAAC,OAAD;GAAK,eAAY;GAAY,WAAU;aACpC,IACC,kBAAC,GAAD,EACE,sBAAsB,EAAS,kBAAkB,IAAiB,EAClE,CAAA,GAEF,kBAAC,GAAD,EAAoB,CAAA;GAElB,CAAA,EACO,CAKZ;EACwB,CAAA;;AAI/B,SAAgB,IAAmB;AACjC,QAAO,kBAAC,GAAD,EAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"conversation.js","names":[],"sources":["../../src/routes/conversation.tsx"],"sourcesContent":["import React from \"react\";\nimport { useNavigate, useLocation, useMatch } from \"react-router\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useConversationId } from \"#/hooks/use-conversation-id\";\nimport { useCommandStore } from \"#/stores/command-store\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { useAgentStore } from \"#/stores/agent-store\";\nimport { useConversationStateStore } from \"#/stores/conversation-state-store\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport {\n clearLastConversationId,\n setLastConversationId,\n} from \"#/api/backend-registry/last-conversation-store\";\nimport { AgentState } from \"#/types/agent-state\";\n\nimport { EventHandler } from \"../wrapper/event-handler\";\n\nimport { useActiveConversation } from \"#/hooks/query/use-active-conversation\";\nimport { useTaskPollingController } from \"#/hooks/query/use-task-polling\";\n\nimport { displayErrorToast } from \"#/utils/custom-toast-handlers\";\nimport { useIsAuthed } from \"#/hooks/query/use-is-authed\";\nimport { ConversationMain } from \"#/components/features/conversation/conversation-main/conversation-main\";\nimport { ConversationMobilePanelPage } from \"#/components/features/conversation/conversation-main/conversation-mobile-panel-page\";\n\nimport { WebSocketProviderWrapper } from \"#/contexts/websocket-provider-wrapper\";\nimport { useErrorMessageStore } from \"#/stores/error-message-store\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { resumeCloudSandbox } from \"#/api/cloud/conversation-service.api\";\n\nfunction AppContent() {\n const { t } = useTranslation(\"openhands\");\n const { conversationId } = useConversationId();\n const panelViewMatch = useMatch(\"/conversations/:conversationId/panel\");\n\n const { isTask, taskStatus, taskDetail } = useTaskPollingController();\n\n // The conversationId in the URL belongs to whichever backend was\n // active when the route first mounted. If the user switches backends\n // while this route is still mounted, the id is meaningless under the\n // new backend — disable the active-conversation fetch (and its 404\n // toast) so we don't fire a request that the BackendSelector's\n // redirect will immediately navigate away from anyway. Mirrors the\n // same guard in `routes/automation-detail.tsx`.\n const active = useActiveBackend();\n const mountedBackendId = React.useRef(active.backend.id);\n const mountedOrgId = React.useRef(active.orgId);\n const backendChanged =\n mountedBackendId.current !== active.backend.id ||\n mountedOrgId.current !== active.orgId;\n\n const { data: conversation, isFetched } = useActiveConversation();\n const { data: isAuthed } = useIsAuthed();\n const { resetConversationState } = useConversationStore();\n const navigate = useNavigate();\n const location = useLocation();\n const clearTerminal = useCommandStore((state) => state.clearTerminal);\n const resetConversationRuntimeState = useConversationStateStore(\n (state) => state.reset,\n );\n const setCurrentAgentState = useAgentStore(\n (state) => state.setCurrentAgentState,\n );\n const removeErrorMessage = useErrorMessageStore(\n (state) => state.removeErrorMessage,\n );\n\n // Per-conversation UI/runtime resets. The event store is cleared separately,\n // inside ConversationWebSocketProvider, so the clear is ordered *before* the\n // preloaded-history re-seed (see the note there) — clearing it here would run\n // too late and wipe the freshly seeded history on a conversation switch.\n React.useEffect(() => {\n clearTerminal();\n resetConversationState();\n resetConversationRuntimeState();\n setCurrentAgentState(AgentState.LOADING);\n removeErrorMessage();\n }, [\n conversationId,\n clearTerminal,\n resetConversationState,\n resetConversationRuntimeState,\n setCurrentAgentState,\n removeErrorMessage,\n ]);\n\n React.useEffect(() => {\n if (isTask && taskStatus === \"ERROR\") {\n displayErrorToast(\n taskDetail || t(I18nKey.CONVERSATION$FAILED_TO_START_FROM_TASK),\n );\n // Navigate back to the original conversation when a resume task fails so\n // the user isn't stranded at the dead task-{id} URL. The resume effect's\n // ref prevents it from immediately retrying once we land there.\n const resumedFrom = (location.state as Record<string, unknown> | null)\n ?.resumedFromConversationId as string | undefined;\n navigate(\n resumedFrom ? `/conversations/${resumedFrom}` : \"/conversations\",\n { replace: true },\n );\n }\n }, [isTask, taskStatus, taskDetail, t, navigate, location.state]);\n\n React.useEffect(() => {\n if (!isFetched || !isAuthed) return;\n // The BackendSelector is in the middle of redirecting us away from\n // this route — don't toast/navigate based on a 404 that's just\n // \"this id doesn't exist on the new backend\".\n if (backendChanged) return;\n\n if (!conversation) {\n // Clear the per-backend \"last selected\" slot so the next switch\n // to this backend doesn't try to revisit a stale id.\n clearLastConversationId(active.backend.id, active.orgId);\n displayErrorToast(t(I18nKey.CONVERSATION$NOT_EXIST_OR_NO_PERMISSION));\n navigate(\"/conversations\");\n }\n }, [\n conversation,\n isFetched,\n isAuthed,\n navigate,\n t,\n backendChanged,\n active.backend.id,\n active.orgId,\n ]);\n\n // Remember the most recently selected conversation for the current\n // (backend, org) so flipping back to this backend later restores the\n // user to where they left off. Skip while a backend switch is in\n // flight: the id in the URL is from the previous backend and would\n // otherwise overwrite the new backend's memory.\n React.useEffect(() => {\n if (backendChanged) return;\n if (!conversationId) return;\n if (conversationId.startsWith(\"task-\")) return;\n setLastConversationId(active.backend.id, active.orgId, conversationId);\n }, [conversationId, backendChanged, active.backend.id, active.orgId]);\n\n // Cloud conversation resume: mirrors OpenHands' useSandboxRecovery.\n //\n // When the cloud API reports sandbox_status === \"PAUSED\" the sandbox is\n // sleeping. The correct wake-up call is POST /api/v1/sandboxes/{id}/resume\n // (a lightweight unpause). The previous approach — creating a new start task\n // via POST /api/v1/app-conversations — was wrong: it tries to provision a\n // fresh conversation in the sandbox and is subject to a 120-second cold-start\n // timeout that can fail. The resume endpoint simply unpauses the existing one.\n //\n // After calling resume we stay on the current URL. The 3-second refetch\n // interval in useActiveConversation (active while conversation_url is null)\n // polls until conversation_url populates, then the WebSocket connects.\n //\n // A ref guards against duplicate triggers per unique conversation.id within\n // the same route-mount lifetime.\n const resumeTriggeredForRef = React.useRef<string | null>(null);\n React.useEffect(() => {\n if (!isFetched || !conversation) return;\n if (active.backend.kind !== \"cloud\") return;\n if (conversation.sandbox_status !== \"PAUSED\") return; // only resume PAUSED sandboxes\n if (!conversation.sandbox_id) return; // no sandbox to resume\n if (resumeTriggeredForRef.current === conversation.id) return; // already sent\n\n resumeTriggeredForRef.current = conversation.id;\n\n resumeCloudSandbox(conversation.sandbox_id).catch(() => {\n displayErrorToast(t(I18nKey.CONVERSATION$FAILED_TO_START_FROM_TASK));\n });\n }, [\n isFetched,\n conversation?.id,\n conversation?.sandbox_status,\n conversation?.sandbox_id,\n active.backend.kind,\n t,\n ]);\n\n // A backend switch is in flight (BackendSelector flips the active backend\n // and redirects to /conversations on the next tick). The conversationId in\n // the URL belongs to the *previous* backend, so unmount the whole\n // conversation subtree now — before any per-conversation query (history,\n // metrics, sub-conversations, runtime info, …) re-fires against a backend\n // the id is foreign to. Those foreign fetches fail response validation and\n // surface \"agent server returned data this UI does not understand\". This is\n // deterministic regardless of the navigate-vs-setActive render race: React\n // re-renders this parent before its children, so returning null removes them\n // before they can issue the request.\n if (backendChanged) {\n return null;\n }\n\n const content = (\n <EventHandler>\n <div data-testid=\"app-route\" className=\"flex h-full flex-col\">\n {panelViewMatch ? (\n <ConversationMobilePanelPage\n onNavigateBack={() => navigate(`/conversations/${conversationId}`)}\n />\n ) : (\n <ConversationMain />\n )}\n </div>\n </EventHandler>\n );\n\n return (\n <WebSocketProviderWrapper conversationId={conversationId}>\n {content}\n </WebSocketProviderWrapper>\n );\n}\n\nexport function ConversationView() {\n return <AppContent />;\n}\n\nexport default ConversationView;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAS,IAAa;CACpB,IAAM,EAAE,SAAM,EAAe,YAAY,EACnC,EAAE,sBAAmB,GAAmB,EACxC,IAAiB,EAAS,uCAAuC,EAEjE,EAAE,WAAQ,eAAY,kBAAe,GAA0B,EAS/D,IAAS,GAAkB,EAC3B,IAAmB,EAAM,OAAO,EAAO,QAAQ,GA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EAAM,OAAsB,KAAK;AAkD/D,QAjDA,EAAM,gBAAgB;AAChB,GAAC,KAAa,CAAC,KACf,EAAO,QAAQ,SAAS,WACxB,EAAa,mBAAmB,YAC/B,EAAa,cACd,EAAsB,YAAY,EAAa,OAEnD,EAAsB,UAAU,EAAa,IAE7C,EAAmB,EAAa,WAAW,CAAC,YAAY;AACtD,KAAkB,EAAE,EAAQ,uCAAuC,CAAC;IACpE;IACD;EACD;EACA,GAAc;EACd,GAAc;EACd,GAAc;EACd,EAAO,QAAQ;EACf;EACD,CAAC,EAYE,IACK,OAkBP,kBAAC,GAAD;EAA0C;YAd1C,kBAAC,GAAD,EAAA,UACE,kBAAC,OAAD;GAAK,eAAY;GAAY,WAAU;aACpC,IACC,kBAAC,GAAD,EACE,sBAAsB,EAAS,kBAAkB,IAAiB,EAClE,CAAA,GAEF,kBAAC,GAAD,EAAoB,CAAA;GAElB,CAAA,EACO,CAKZ;EACwB,CAAA;;AAI/B,SAAgB,IAAmB;AACjC,QAAO,kBAAC,GAAD,EAAc,CAAA"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./agent-settings-CgCnqaAA.js";export{e as default,t as handle};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./conversation-BoCYx8n2.js";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./conversation-BoCYx8n2.js";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./home-BwbeOWwU.js";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./home-BwbeOWwU.js";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./llm-settings-DFkJQr_w.js";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{T as e,b as t,w as n}from"./utils-DB9LsAzA.js";import{t as r}from"./use-active-conversation-2qeez40F.js";import{t as i}from"./use-agent-state-C6peDXUm.js";var a=({allowAgentError:a=!1}={})=>{let{data:o}=r(),{curAgentState:s}=i(),c=a?e:n;return t(o?.execution_status)&&!c.includes(s)};export{a as t};
|