@openhands/agent-canvas 1.0.0-alpha.6 → 1.0.0-alpha.7
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 +41 -7
- package/bin/agent-canvas.mjs +9 -2
- package/build/assets/automation-detail-D7GEU0vR.js +1 -0
- package/build/assets/automations-list-CkVNsgzm.js +1 -0
- package/build/assets/conversation-COZAKz_K.js +1 -0
- package/build/assets/{conversation-D8scXOe7.js → conversation-DWcvnmds.js} +3 -1
- package/build/assets/conversation-panel-CZDStT0b.js +1 -0
- package/build/assets/conversation-websocket-context-DulnrIHh.js +3 -0
- package/build/assets/edit-automation-modal-C3bFxS2f.js +1 -0
- package/build/assets/git-control-bar-branch-button-Bm6rzSpo.js +27 -0
- package/build/assets/{home-D9fJfhQA.js → home-DR11ejqB.js} +1 -1
- package/build/assets/{manifest-6400820c.js → manifest-f041e61a.js} +1 -1
- package/build/assets/{messages-BfaEAG2q.js → messages-v-q35ObG.js} +1 -1
- package/build/assets/{root-6AdVEJBT.js → root-D2PVd51i.js} +1 -1
- package/build/assets/root-layout-B4QioBS6.js +2 -0
- package/build/assets/{shared-conversation-BfZNCsvo.js → shared-conversation-DQlzwdpo.js} +1 -1
- package/build/index.html +3 -3
- package/dist/components/features/backends/backend-selector.cjs +1 -1
- package/dist/components/features/backends/backend-selector.cjs.map +1 -1
- package/dist/components/features/backends/backend-selector.js +95 -95
- package/dist/components/features/backends/backend-selector.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-actions.js +118 -118
- package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
- package/dist/components/features/chat/components/slash-command-menu.cjs +1 -1
- package/dist/components/features/chat/components/slash-command-menu.cjs.map +1 -1
- package/dist/components/features/chat/components/slash-command-menu.js +1 -1
- package/dist/components/features/chat/components/slash-command-menu.js.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.d.ts +1 -2
- package/dist/components/features/sidebar/sidebar-rail-body.js +104 -104
- package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
- package/dist/components/features/sidebar/sidebar.cjs +1 -1
- package/dist/components/features/sidebar/sidebar.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar.js +82 -83
- package/dist/components/features/sidebar/sidebar.js.map +1 -1
- package/dist/contexts/conversation-websocket-context.cjs +3 -3
- package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
- package/dist/contexts/conversation-websocket-context.js +36 -36
- package/dist/contexts/conversation-websocket-context.js.map +1 -1
- package/dist/hooks/query/use-local-git-info.cjs +3 -1
- package/dist/hooks/query/use-local-git-info.cjs.map +1 -1
- package/dist/hooks/query/use-local-git-info.d.ts +2 -2
- package/dist/hooks/query/use-local-git-info.js +27 -24
- package/dist/hooks/query/use-local-git-info.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/stores/error-message-store.cjs +1 -1
- package/dist/stores/error-message-store.cjs.map +1 -1
- package/dist/stores/error-message-store.d.ts +10 -1
- package/dist/stores/error-message-store.js +16 -3
- package/dist/stores/error-message-store.js.map +1 -1
- package/package.json +1 -1
- package/scripts/dev-static.mjs +6 -0
- package/scripts/dev-with-automation.mjs +6 -0
- package/scripts/static-server.mjs +85 -4
- package/build/assets/automation-detail-CQrtk33s.js +0 -1
- package/build/assets/automations-list-COmogz0S.js +0 -1
- package/build/assets/conversation-CeGMBOyB.js +0 -1
- package/build/assets/conversation-panel-DMz46ji-.js +0 -1
- package/build/assets/conversation-websocket-context-B0Gd3yiT.js +0 -3
- package/build/assets/edit-automation-modal-DnTHJrf1.js +0 -1
- package/build/assets/git-control-bar-branch-button-DhpPgadK.js +0 -27
- package/build/assets/root-layout-DvYGxAnr.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-local-git-info.js","names":[],"sources":["../../../src/hooks/query/use-local-git-info.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { useRef } from \"react\";\n\nimport type { CommandResult } from \"#/api/runtime-service/agent-server-runtime-service\";\nimport { getAgentServerWorkingDir } from \"#/api/agent-server-config\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useActiveConversation } from \"#/hooks/query/use-active-conversation\";\nimport { useRuntimeIsReady } from \"#/hooks/use-runtime-is-ready\";\nimport { useBashCommandRunner } from \"#/hooks/use-bash-command-runner\";\nimport { Provider } from \"#/types/settings\";\nimport { parseGitRemoteUrl } from \"#/utils/parse-git-remote-url\";\n\nexport interface LocalGitInfo {\n repository: string | null;\n branch: string | null;\n provider: Provider | null;\n remoteUrl: string | null;\n}\n\nconst EMPTY_LOCAL_GIT_INFO: LocalGitInfo = {\n repository: null,\n branch: null,\n provider: null,\n remoteUrl: null,\n};\n\ntype RunCommand = (\n command: string,\n cwd: string,\n timeout: number,\n) => Promise<CommandResult>;\n\
|
|
1
|
+
{"version":3,"file":"use-local-git-info.js","names":[],"sources":["../../../src/hooks/query/use-local-git-info.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { useRef } from \"react\";\n\nimport type { CommandResult } from \"#/api/runtime-service/agent-server-runtime-service\";\nimport { getAgentServerWorkingDir } from \"#/api/agent-server-config\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useActiveConversation } from \"#/hooks/query/use-active-conversation\";\nimport { useRuntimeIsReady } from \"#/hooks/use-runtime-is-ready\";\nimport { useBashCommandRunner } from \"#/hooks/use-bash-command-runner\";\nimport { Provider } from \"#/types/settings\";\nimport { parseGitRemoteUrl } from \"#/utils/parse-git-remote-url\";\n\nexport interface LocalGitInfo {\n repository: string | null;\n branch: string | null;\n provider: Provider | null;\n remoteUrl: string | null;\n}\n\nconst EMPTY_LOCAL_GIT_INFO: LocalGitInfo = {\n repository: null,\n branch: null,\n provider: null,\n remoteUrl: null,\n};\n\ntype RunCommand = (\n command: string,\n cwd: string,\n timeout: number,\n) => Promise<CommandResult>;\n\n// Single shell script that replaces the former probeGitInfoAtDir +\n// probeNestedRepoInDir pair. It runs as one bash WebSocket round-trip:\n// 1. Read the origin remote URL and current branch at the workspace root.\n// 2. If neither is set, search for exactly one nested git repo up to 4\n// levels deep and repeat the probe there.\n// Output: two lines — <remote-url>\\n<branch> — either may be empty.\nconst GIT_INFO_COMMAND = [\n \"r=$(git remote get-url origin 2>/dev/null)\",\n \"b=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)\",\n 'if [ -z \"$r$b\" ]; then',\n \"n=$(find . -mindepth 2 -maxdepth 4 -name .git 2>/dev/null | cut -c3- | sed 's|/.git$||' | sort -u)\",\n \"c=$(printf '%s\\\\n' \\\"$n\\\" | grep -c '[^[:space:]]')\",\n 'if [ \"$c\" = \"1\" ] && [ -n \"$n\" ]; then',\n 'r=$(git -C \"$n\" remote get-url origin 2>/dev/null)',\n 'b=$(git -C \"$n\" rev-parse --abbrev-ref HEAD 2>/dev/null)',\n \"fi\",\n \"fi\",\n 'printf \\'%s\\\\n%s\\' \"$r\" \"$b\"',\n].join(\"\\n\");\n\nasync function probeGitInfo(\n run: RunCommand,\n directory: string,\n): Promise<LocalGitInfo> {\n const result = await run(GIT_INFO_COMMAND, directory, 10);\n if (result.exit_code !== 0) return EMPTY_LOCAL_GIT_INFO;\n\n const nl = result.stdout.indexOf(\"\\n\");\n const remoteUrl = (\n nl >= 0 ? result.stdout.slice(0, nl) : result.stdout\n ).trim();\n const rawBranch = (nl >= 0 ? result.stdout.slice(nl + 1) : \"\").trim();\n const branch = rawBranch && rawBranch !== \"HEAD\" ? rawBranch : null;\n\n if (!remoteUrl && !branch) return EMPTY_LOCAL_GIT_INFO;\n\n const parsedRemote = parseGitRemoteUrl(remoteUrl);\n return {\n repository: parsedRemote?.repository ?? null,\n provider: parsedRemote?.provider ?? null,\n remoteUrl: remoteUrl || null,\n branch,\n };\n}\n\n/**\n * Probe git metadata for a **local** backend's workspace checkout by\n * shelling out via the agent server using a single consolidated bash\n * script (see `GIT_INFO_COMMAND`).\n *\n * Local-only by design. On cloud backends the conversation metadata\n * (`selected_repository`, `git_provider`, `selected_branch`) is the\n * source of truth, and probing via `/api/bash/execute_bash_command`\n * would (a) leak the user's local `getAgentServerWorkingDir()` path to\n * the cloud runtime when `workspace.working_dir` is missing, and\n * (b) hit a bash endpoint we don't want the frontend driving on cloud.\n *\n * On local, we keep the probe enabled until the active conversation\n * has a complete repo tuple so the control bar can recover from\n * partial metadata hydration after connect/clone flows.\n *\n * Returns `null` fields when the working dir is not a git checkout —\n * callers should treat that the same as \"no repo detected\".\n */\nexport const useLocalGitInfo = () => {\n const { data: conversation } = useActiveConversation();\n const runtimeIsReady = useRuntimeIsReady();\n const { backend } = useActiveBackend();\n const isLocalBackend = backend.kind === \"local\";\n\n const conversationId = conversation?.id;\n const conversationUrl = conversation?.conversation_url;\n const sessionApiKey = conversation?.session_api_key;\n const workingDir =\n conversation?.workspace?.working_dir?.trim() || getAgentServerWorkingDir();\n const hasConversationRepo = !!conversation?.selected_repository;\n const hasConversationProvider = !!conversation?.git_provider;\n const hasConversationBranch = !!conversation?.selected_branch;\n\n const queryEnabled =\n isLocalBackend &&\n runtimeIsReady &&\n !!conversationId &&\n (!hasConversationRepo ||\n !hasConversationProvider ||\n !hasConversationBranch);\n\n // Persistent WebSocket connection to the bash-events endpoint. The\n // connection is opened when the query is enabled and closed on unmount or\n // when the conversation changes.\n const runCommand = useBashCommandRunner(\n conversationUrl,\n sessionApiKey,\n queryEnabled,\n );\n\n // Keep a ref so queryFn can call the latest runner without capturing it\n // as a queryKey dependency (runCommand is stable but the linter can't\n // infer that).\n const runCommandRef = useRef(runCommand);\n runCommandRef.current = runCommand;\n\n // runCommandRef is a ref (always stable); the linter cannot infer this so\n // we disable the exhaustive-deps check here.\n // eslint-disable-next-line @tanstack/query/exhaustive-deps\n return useQuery<LocalGitInfo>({\n queryKey: [\n \"local-git-info\",\n conversationId,\n conversationUrl,\n sessionApiKey,\n workingDir,\n ],\n queryFn: async () => {\n const run: RunCommand = (command, cwd, timeout) =>\n runCommandRef.current(command, cwd, timeout);\n return probeGitInfo(run, workingDir);\n },\n enabled: queryEnabled,\n retry: false,\n // Re-probe the workspace every 10s so the UI reflects branch/repo\n // changes (e.g. `git checkout`, adding a remote) without requiring a\n // manual refresh when there is no `selected_repository` recorded on\n // the conversation. Commands now run over the persistent WebSocket\n // connection rather than individual REST calls.\n staleTime: 10_000,\n refetchInterval: 10_000,\n gcTime: 1000 * 60 * 5,\n meta: { disableToast: true },\n });\n};\n"],"mappings":";;;;;;;;;AAmBA,IAAM,IAAqC;CACzC,YAAY;CACZ,QAAQ;CACR,UAAU;CACV,WAAW;CACZ,EAcK,IAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC,KAAK,KAAK;AAEZ,eAAe,EACb,GACA,GACuB;CACvB,IAAM,IAAS,MAAM,EAAI,GAAkB,GAAW,GAAG;AACzD,KAAI,EAAO,cAAc,EAAG,QAAO;CAEnC,IAAM,IAAK,EAAO,OAAO,QAAQ,KAAK,EAChC,KACJ,KAAM,IAAI,EAAO,OAAO,MAAM,GAAG,EAAG,GAAG,EAAO,QAC9C,MAAM,EACF,KAAa,KAAM,IAAI,EAAO,OAAO,MAAM,IAAK,EAAE,GAAG,IAAI,MAAM,EAC/D,IAAS,KAAa,MAAc,SAAS,IAAY;AAE/D,KAAI,CAAC,KAAa,CAAC,EAAQ,QAAO;CAElC,IAAM,IAAe,EAAkB,EAAU;AACjD,QAAO;EACL,YAAY,GAAc,cAAc;EACxC,UAAU,GAAc,YAAY;EACpC,WAAW,KAAa;EACxB;EACD;;AAsBH,IAAa,UAAwB;CACnC,IAAM,EAAE,MAAM,MAAiB,GAAuB,EAChD,IAAiB,GAAmB,EACpC,EAAE,eAAY,GAAkB,EAChC,IAAiB,EAAQ,SAAS,SAElC,IAAiB,GAAc,IAC/B,IAAkB,GAAc,kBAChC,IAAgB,GAAc,iBAC9B,IACJ,GAAc,WAAW,aAAa,MAAM,IAAI,GAA0B,EACtE,IAAsB,CAAC,CAAC,GAAc,qBACtC,IAA0B,CAAC,CAAC,GAAc,cAC1C,IAAwB,CAAC,CAAC,GAAc,iBAExC,IACJ,KACA,KACA,CAAC,CAAC,MACD,CAAC,KACA,CAAC,KACD,CAAC,IAKC,IAAa,EACjB,GACA,GACA,EACD,EAKK,IAAgB,EAAO,EAAW;AAMxC,QALA,EAAc,UAAU,GAKjB,EAAuB;EAC5B,UAAU;GACR;GACA;GACA;GACA;GACA;GACD;EACD,SAAS,YAGA,GAFkB,GAAS,GAAK,MACrC,EAAc,QAAQ,GAAS,GAAK,EAAQ,EACrB,EAAW;EAEtC,SAAS;EACT,OAAO;EAMP,WAAW;EACX,iBAAiB;EACjB,QAAQ,MAAO,KAAK;EACpB,MAAM,EAAE,cAAc,IAAM;EAC7B,CAAC"}
|
package/dist/package.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`./_virtual/_rolldown/runtime.cjs`);var e={name:`@openhands/agent-canvas`,version:`1.0.0-alpha.
|
|
1
|
+
require(`./_virtual/_rolldown/runtime.cjs`);var e={name:`@openhands/agent-canvas`,version:`1.0.0-alpha.7`,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":`git+https://github.com/OpenHands/extensions.git#b8c1869ec9dea4467bb27d5754dc695d14e27889`,"@openhands/typescript-client":`1.23.3`,"@react-router/node":`7.14.2`,"@react-router/serve":`7.14.2`,"@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`,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.14.2`,"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.3`,"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`,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:snapshots":`playwright test tests/e2e/snapshots --project=chromium --retries=0`,"test:e2e:snapshots:update":`playwright test tests/e2e/snapshots --project=chromium --update-snapshots`,"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_APP_ENV=production vite build && tsc -p tsconfig.lib.json`,"build:docker":`node scripts/docker-build.mjs`},"lint-staged":{"src/**/*.{ts,tsx,js}":[`eslint --fix`,`prettier --write`],"src/**/*.{ts,tsx}":[`bash -c 'npm run typecheck:staged'`],"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.14.2`,"@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:{dompurify:`3.3.2`},main:`./dist/index.cjs`,module:`./dist/index.js`,types:`./dist/index.d.ts`,files:[`dist`,`bin`,`build`,`config`,`scripts`],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.14.2`}};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.0.0-alpha.
|
|
1
|
+
{"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@openhands/agent-canvas\",\n \"version\": \"1.0.0-alpha.7\",\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\": \"git+https://github.com/OpenHands/extensions.git#b8c1869ec9dea4467bb27d5754dc695d14e27889\",\n \"@openhands/typescript-client\": \"1.23.3\",\n \"@react-router/node\": \"7.14.2\",\n \"@react-router/serve\": \"7.14.2\",\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 \"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.14.2\",\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.3\",\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 \"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:snapshots\": \"playwright test tests/e2e/snapshots --project=chromium --retries=0\",\n \"test:e2e:snapshots:update\": \"playwright test tests/e2e/snapshots --project=chromium --update-snapshots\",\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_APP_ENV=production vite build && tsc -p tsconfig.lib.json\",\n \"build:docker\": \"node scripts/docker-build.mjs\"\n },\n \"lint-staged\": {\n \"src/**/*.{ts,tsx,js}\": [\n \"eslint --fix\",\n \"prettier --write\"\n ],\n \"src/**/*.{ts,tsx}\": [\n \"bash -c 'npm run typecheck:staged'\"\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.14.2\",\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 \"dompurify\": \"3.3.2\"\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 ],\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.14.2\"\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.0.0-alpha.
|
|
1
|
+
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@openhands/agent-canvas\",\n \"version\": \"1.0.0-alpha.7\",\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\": \"git+https://github.com/OpenHands/extensions.git#b8c1869ec9dea4467bb27d5754dc695d14e27889\",\n \"@openhands/typescript-client\": \"1.23.3\",\n \"@react-router/node\": \"7.14.2\",\n \"@react-router/serve\": \"7.14.2\",\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 \"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.14.2\",\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.3\",\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 \"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:snapshots\": \"playwright test tests/e2e/snapshots --project=chromium --retries=0\",\n \"test:e2e:snapshots:update\": \"playwright test tests/e2e/snapshots --project=chromium --update-snapshots\",\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_APP_ENV=production vite build && tsc -p tsconfig.lib.json\",\n \"build:docker\": \"node scripts/docker-build.mjs\"\n },\n \"lint-staged\": {\n \"src/**/*.{ts,tsx,js}\": [\n \"eslint --fix\",\n \"prettier --write\"\n ],\n \"src/**/*.{ts,tsx}\": [\n \"bash -c 'npm run typecheck:staged'\"\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.14.2\",\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 \"dompurify\": \"3.3.2\"\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 ],\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.14.2\"\n }\n}\n"],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../node_modules/zustand/esm/react.cjs`);var t={errorMessage:null},n=e.create(e=>({...t,setErrorMessage:t=>e(()=>({errorMessage:t})),removeErrorMessage:()=>e(()=>({errorMessage:null}))}));exports.useErrorMessageStore=n;
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../node_modules/zustand/esm/react.cjs`);var t={errorMessage:null,errorType:null},n=e.create(e=>({...t,setErrorMessage:(t,n=`conversation`)=>e(()=>({errorMessage:t,errorType:n})),removeErrorMessage:()=>e(()=>({errorMessage:null,errorType:null})),clearConnectionError:()=>e(e=>e.errorType===`connection`?{errorMessage:null,errorType:null}:e)}));exports.useErrorMessageStore=n;
|
|
2
2
|
//# sourceMappingURL=error-message-store.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-message-store.cjs","names":[],"sources":["../../src/stores/error-message-store.ts"],"sourcesContent":["import { create } from \"zustand\";\n\ninterface ErrorMessageState {\n errorMessage: string | null;\n}\n\ninterface ErrorMessageActions {\n setErrorMessage: (message: string) => void;\n removeErrorMessage: () => void;\n}\n\ntype ErrorMessageStore = ErrorMessageState & ErrorMessageActions;\n\nconst initialState: ErrorMessageState = {\n errorMessage: null,\n};\n\nexport const useErrorMessageStore = create<ErrorMessageStore>((set) => ({\n ...initialState,\n\n setErrorMessage: (message: string) =>\n set(() => ({\n errorMessage: message,\n })),\n\n removeErrorMessage: () =>\n set(() => ({\n errorMessage: null,\n })),\n}));\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"error-message-store.cjs","names":[],"sources":["../../src/stores/error-message-store.ts"],"sourcesContent":["import { create } from \"zustand\";\n\n/**\n * \"connection\" errors auto-clear once connectivity recovers; \"conversation\"\n * errors (e.g. a wrong API key) are sticky and clear only on an explicit user\n * action (dismiss, retry, new message).\n */\nexport type ErrorMessageType = \"connection\" | \"conversation\";\n\ninterface ErrorMessageState {\n errorMessage: string | null;\n errorType: ErrorMessageType | null;\n}\n\ninterface ErrorMessageActions {\n setErrorMessage: (message: string, type?: ErrorMessageType) => void;\n removeErrorMessage: () => void;\n /** Clears the error only when it is a transient connection error. */\n clearConnectionError: () => void;\n}\n\ntype ErrorMessageStore = ErrorMessageState & ErrorMessageActions;\n\nconst initialState: ErrorMessageState = {\n errorMessage: null,\n errorType: null,\n};\n\nexport const useErrorMessageStore = create<ErrorMessageStore>((set) => ({\n ...initialState,\n\n setErrorMessage: (message: string, type: ErrorMessageType = \"conversation\") =>\n set(() => ({\n errorMessage: message,\n errorType: type,\n })),\n\n removeErrorMessage: () =>\n set(() => ({\n errorMessage: null,\n errorType: null,\n })),\n\n clearConnectionError: () =>\n set((state) =>\n state.errorType === \"connection\"\n ? { errorMessage: null, errorType: null }\n : state,\n ),\n}));\n"],"mappings":"sGAuBA,IAAM,EAAkC,CACtC,aAAc,KACd,UAAW,KACZ,CAEY,EAAuB,EAAA,OAA2B,IAAS,CACtE,GAAG,EAEH,iBAAkB,EAAiB,EAAyB,iBAC1D,OAAW,CACT,aAAc,EACd,UAAW,EACZ,EAAE,CAEL,uBACE,OAAW,CACT,aAAc,KACd,UAAW,KACZ,EAAE,CAEL,yBACE,EAAK,GACH,EAAM,YAAc,aAChB,CAAE,aAAc,KAAM,UAAW,KAAM,CACvC,EACL,CACJ,EAAE"}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "connection" errors auto-clear once connectivity recovers; "conversation"
|
|
3
|
+
* errors (e.g. a wrong API key) are sticky and clear only on an explicit user
|
|
4
|
+
* action (dismiss, retry, new message).
|
|
5
|
+
*/
|
|
6
|
+
export type ErrorMessageType = "connection" | "conversation";
|
|
1
7
|
interface ErrorMessageState {
|
|
2
8
|
errorMessage: string | null;
|
|
9
|
+
errorType: ErrorMessageType | null;
|
|
3
10
|
}
|
|
4
11
|
interface ErrorMessageActions {
|
|
5
|
-
setErrorMessage: (message: string) => void;
|
|
12
|
+
setErrorMessage: (message: string, type?: ErrorMessageType) => void;
|
|
6
13
|
removeErrorMessage: () => void;
|
|
14
|
+
/** Clears the error only when it is a transient connection error. */
|
|
15
|
+
clearConnectionError: () => void;
|
|
7
16
|
}
|
|
8
17
|
type ErrorMessageStore = ErrorMessageState & ErrorMessageActions;
|
|
9
18
|
export declare const useErrorMessageStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ErrorMessageStore>>;
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import { create as e } from "../node_modules/zustand/esm/react.js";
|
|
2
2
|
//#region src/stores/error-message-store.ts
|
|
3
|
-
var t = {
|
|
3
|
+
var t = {
|
|
4
|
+
errorMessage: null,
|
|
5
|
+
errorType: null
|
|
6
|
+
}, n = e((e) => ({
|
|
4
7
|
...t,
|
|
5
|
-
setErrorMessage: (t) => e(() => ({
|
|
6
|
-
|
|
8
|
+
setErrorMessage: (t, n = "conversation") => e(() => ({
|
|
9
|
+
errorMessage: t,
|
|
10
|
+
errorType: n
|
|
11
|
+
})),
|
|
12
|
+
removeErrorMessage: () => e(() => ({
|
|
13
|
+
errorMessage: null,
|
|
14
|
+
errorType: null
|
|
15
|
+
})),
|
|
16
|
+
clearConnectionError: () => e((e) => e.errorType === "connection" ? {
|
|
17
|
+
errorMessage: null,
|
|
18
|
+
errorType: null
|
|
19
|
+
} : e)
|
|
7
20
|
}));
|
|
8
21
|
//#endregion
|
|
9
22
|
export { n as useErrorMessageStore };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-message-store.js","names":[],"sources":["../../src/stores/error-message-store.ts"],"sourcesContent":["import { create } from \"zustand\";\n\ninterface ErrorMessageState {\n errorMessage: string | null;\n}\n\ninterface ErrorMessageActions {\n setErrorMessage: (message: string) => void;\n removeErrorMessage: () => void;\n}\n\ntype ErrorMessageStore = ErrorMessageState & ErrorMessageActions;\n\nconst initialState: ErrorMessageState = {\n errorMessage: null,\n};\n\nexport const useErrorMessageStore = create<ErrorMessageStore>((set) => ({\n ...initialState,\n\n setErrorMessage: (message: string) =>\n set(() => ({\n errorMessage: message,\n })),\n\n removeErrorMessage: () =>\n set(() => ({\n errorMessage: null,\n })),\n}));\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"error-message-store.js","names":[],"sources":["../../src/stores/error-message-store.ts"],"sourcesContent":["import { create } from \"zustand\";\n\n/**\n * \"connection\" errors auto-clear once connectivity recovers; \"conversation\"\n * errors (e.g. a wrong API key) are sticky and clear only on an explicit user\n * action (dismiss, retry, new message).\n */\nexport type ErrorMessageType = \"connection\" | \"conversation\";\n\ninterface ErrorMessageState {\n errorMessage: string | null;\n errorType: ErrorMessageType | null;\n}\n\ninterface ErrorMessageActions {\n setErrorMessage: (message: string, type?: ErrorMessageType) => void;\n removeErrorMessage: () => void;\n /** Clears the error only when it is a transient connection error. */\n clearConnectionError: () => void;\n}\n\ntype ErrorMessageStore = ErrorMessageState & ErrorMessageActions;\n\nconst initialState: ErrorMessageState = {\n errorMessage: null,\n errorType: null,\n};\n\nexport const useErrorMessageStore = create<ErrorMessageStore>((set) => ({\n ...initialState,\n\n setErrorMessage: (message: string, type: ErrorMessageType = \"conversation\") =>\n set(() => ({\n errorMessage: message,\n errorType: type,\n })),\n\n removeErrorMessage: () =>\n set(() => ({\n errorMessage: null,\n errorType: null,\n })),\n\n clearConnectionError: () =>\n set((state) =>\n state.errorType === \"connection\"\n ? { errorMessage: null, errorType: null }\n : state,\n ),\n}));\n"],"mappings":";;AAuBA,IAAM,IAAkC;CACtC,cAAc;CACd,WAAW;CACZ,EAEY,IAAuB,GAA2B,OAAS;CACtE,GAAG;CAEH,kBAAkB,GAAiB,IAAyB,mBAC1D,SAAW;EACT,cAAc;EACd,WAAW;EACZ,EAAE;CAEL,0BACE,SAAW;EACT,cAAc;EACd,WAAW;EACZ,EAAE;CAEL,4BACE,GAAK,MACH,EAAM,cAAc,eAChB;EAAE,cAAc;EAAM,WAAW;EAAM,GACvC,EACL;CACJ,EAAE"}
|
package/package.json
CHANGED
package/scripts/dev-static.mjs
CHANGED
|
@@ -388,6 +388,12 @@ function startStaticServer(config) {
|
|
|
388
388
|
"0.0.0.0",
|
|
389
389
|
"--port",
|
|
390
390
|
String(config.vitePort),
|
|
391
|
+
// Inject the runtime session key so the pre-built frontend can
|
|
392
|
+
// authenticate to agent-server without VITE_SESSION_API_KEY being baked
|
|
393
|
+
// into the bundle at publish time.
|
|
394
|
+
...(config.sessionApiKey
|
|
395
|
+
? ["--session-api-key", config.sessionApiKey]
|
|
396
|
+
: []),
|
|
391
397
|
"--route",
|
|
392
398
|
`/api/automation=http://localhost:${config.autoBackendPort}`,
|
|
393
399
|
"--route",
|
|
@@ -1061,6 +1061,12 @@ function startStaticFrontend(config, staticDir) {
|
|
|
1061
1061
|
"0.0.0.0",
|
|
1062
1062
|
"--port",
|
|
1063
1063
|
String(config.vitePort),
|
|
1064
|
+
// Inject the runtime session key so the pre-built frontend can
|
|
1065
|
+
// authenticate to agent-server without VITE_SESSION_API_KEY being baked
|
|
1066
|
+
// into the bundle at publish time.
|
|
1067
|
+
...(config.sessionApiKey
|
|
1068
|
+
? ["--session-api-key", config.sessionApiKey]
|
|
1069
|
+
: []),
|
|
1064
1070
|
// Proxy routes to backends (same as ingress but for direct access to vitePort)
|
|
1065
1071
|
"--route",
|
|
1066
1072
|
`/api/automation=http://localhost:${config.autoBackendPort}`,
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
import { createServer, request as httpRequest } from "node:http";
|
|
31
31
|
import { createReadStream } from "node:fs";
|
|
32
|
-
import { stat } from "node:fs/promises";
|
|
32
|
+
import { readFile, stat } from "node:fs/promises";
|
|
33
33
|
import { extname, isAbsolute, normalize, relative, resolve } from "node:path";
|
|
34
34
|
import process from "node:process";
|
|
35
35
|
import { pathToFileURL } from "node:url";
|
|
@@ -72,6 +72,7 @@ export function parseArgs(argv = process.argv.slice(2)) {
|
|
|
72
72
|
host: "0.0.0.0",
|
|
73
73
|
dir: "build",
|
|
74
74
|
routes: {},
|
|
75
|
+
sessionApiKey: null,
|
|
75
76
|
};
|
|
76
77
|
|
|
77
78
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -104,6 +105,9 @@ export function parseArgs(argv = process.argv.slice(2)) {
|
|
|
104
105
|
config.routes[prefix] = url;
|
|
105
106
|
break;
|
|
106
107
|
}
|
|
108
|
+
case "--session-api-key":
|
|
109
|
+
config.sessionApiKey = argv[++i] || null;
|
|
110
|
+
break;
|
|
107
111
|
case "-h":
|
|
108
112
|
case "--help":
|
|
109
113
|
showHelp();
|
|
@@ -129,6 +133,9 @@ OPTIONS:
|
|
|
129
133
|
-d, --dir <dir> Directory to serve (default: build)
|
|
130
134
|
-r, --route <prefix=url> Proxy <prefix> (and subpaths) to <url>;
|
|
131
135
|
may be repeated. WebSockets supported.
|
|
136
|
+
--session-api-key <key> Inject session API key into index.html so the
|
|
137
|
+
pre-built frontend authenticates to agent-server
|
|
138
|
+
without needing VITE_SESSION_API_KEY baked in.
|
|
132
139
|
-h, --help Show this help
|
|
133
140
|
|
|
134
141
|
ROUTING:
|
|
@@ -140,6 +147,70 @@ ROUTING:
|
|
|
140
147
|
`);
|
|
141
148
|
}
|
|
142
149
|
|
|
150
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
151
|
+
// Runtime config injection
|
|
152
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Build a tiny inline script that seeds the session API key into the
|
|
156
|
+
* `openhands-agent-server-config` localStorage entry the first time the page
|
|
157
|
+
* loads. Only writes if no key is already stored — explicit user overrides
|
|
158
|
+
* (set via Settings > Agent Server in the UI) are always preserved.
|
|
159
|
+
*
|
|
160
|
+
* This lets the pre-built static binary work without needing VITE_SESSION_API_KEY
|
|
161
|
+
* baked into the bundle at publish time: the runtime key is injected here instead.
|
|
162
|
+
*/
|
|
163
|
+
function makeConfigInjectionScript(sessionApiKey) {
|
|
164
|
+
if (!sessionApiKey) return "";
|
|
165
|
+
// JSON.stringify produces a properly escaped JS string literal.
|
|
166
|
+
const keyLiteral = JSON.stringify(sessionApiKey);
|
|
167
|
+
return (
|
|
168
|
+
`<script>` +
|
|
169
|
+
`(function(){` +
|
|
170
|
+
`try{` +
|
|
171
|
+
`var _k='openhands-agent-server-config',` +
|
|
172
|
+
`_c=JSON.parse(localStorage.getItem(_k)||'{}');` +
|
|
173
|
+
`if(!_c.sessionApiKey){` +
|
|
174
|
+
`_c.sessionApiKey=${keyLiteral};` +
|
|
175
|
+
`localStorage.setItem(_k,JSON.stringify(_c));` +
|
|
176
|
+
`}` +
|
|
177
|
+
`}catch(e){}` +
|
|
178
|
+
`}());` +
|
|
179
|
+
`</script>`
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Serve index.html with the runtime session key injected into <head>.
|
|
185
|
+
* Returns true if the response was written, false if the file was not found.
|
|
186
|
+
*/
|
|
187
|
+
async function serveInjectedIndexHtml(req, res, indexPath, sessionApiKey) {
|
|
188
|
+
let content;
|
|
189
|
+
try {
|
|
190
|
+
content = await readFile(indexPath, "utf8");
|
|
191
|
+
} catch {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const script = makeConfigInjectionScript(sessionApiKey);
|
|
196
|
+
// Inject right before </head> so the key is available before any app code runs.
|
|
197
|
+
// replace() targets the first (and only) </head> in well-formed HTML.
|
|
198
|
+
const injected = content.includes("</head>")
|
|
199
|
+
? content.replace("</head>", `${script}\n</head>`)
|
|
200
|
+
: content.includes("</body>")
|
|
201
|
+
? content.replace("</body>", `${script}\n</body>`)
|
|
202
|
+
: script + content;
|
|
203
|
+
|
|
204
|
+
const buf = Buffer.from(injected, "utf8");
|
|
205
|
+
res.writeHead(200, {
|
|
206
|
+
"Content-Type": "text/html; charset=utf-8",
|
|
207
|
+
"Content-Length": buf.length,
|
|
208
|
+
"Cache-Control": "no-cache",
|
|
209
|
+
});
|
|
210
|
+
if (req.method !== "HEAD") res.end(buf);
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
|
|
143
214
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
144
215
|
// Router (kept structurally identical to scripts/ingress.mjs)
|
|
145
216
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -322,7 +393,7 @@ async function serveFile(req, res, filePath, urlPath) {
|
|
|
322
393
|
return true;
|
|
323
394
|
}
|
|
324
395
|
|
|
325
|
-
async function handleStatic(req, res, dirAbs) {
|
|
396
|
+
async function handleStatic(req, res, dirAbs, sessionApiKey = null) {
|
|
326
397
|
const rawPath = req.url.split("?")[0];
|
|
327
398
|
let urlPath;
|
|
328
399
|
try {
|
|
@@ -346,6 +417,12 @@ async function handleStatic(req, res, dirAbs) {
|
|
|
346
417
|
filePath = resolve(filePath, "index.html");
|
|
347
418
|
}
|
|
348
419
|
|
|
420
|
+
// Serve index.html with runtime key injection when a session key is configured.
|
|
421
|
+
if (sessionApiKey && filePath.endsWith("index.html")) {
|
|
422
|
+
if (await serveInjectedIndexHtml(req, res, filePath, sessionApiKey)) return;
|
|
423
|
+
// Fall through to regular serveFile (handles 404 path correctly).
|
|
424
|
+
}
|
|
425
|
+
|
|
349
426
|
if (await serveFile(req, res, filePath, urlPath)) return;
|
|
350
427
|
|
|
351
428
|
// SPA fallback: only for non-asset requests, and not for non-GET/HEAD.
|
|
@@ -354,7 +431,10 @@ async function handleStatic(req, res, dirAbs) {
|
|
|
354
431
|
!looksLikeAssetRequest(urlPath)
|
|
355
432
|
) {
|
|
356
433
|
const indexPath = resolve(dirAbs, "index.html");
|
|
357
|
-
if (
|
|
434
|
+
if (sessionApiKey) {
|
|
435
|
+
if (await serveInjectedIndexHtml(req, res, indexPath, sessionApiKey))
|
|
436
|
+
return;
|
|
437
|
+
} else if (await serveFile(req, res, indexPath, "/")) return;
|
|
358
438
|
}
|
|
359
439
|
|
|
360
440
|
res.writeHead(404, { "Content-Type": "text/plain; charset=utf-8" });
|
|
@@ -368,6 +448,7 @@ async function handleStatic(req, res, dirAbs) {
|
|
|
368
448
|
export function startStaticServer(config) {
|
|
369
449
|
const route = createRouter(config.routes);
|
|
370
450
|
const dirAbs = resolve(config.dir);
|
|
451
|
+
const sessionApiKey = config.sessionApiKey || null;
|
|
371
452
|
|
|
372
453
|
const server = createServer((req, res) => {
|
|
373
454
|
const backend = route(req.url);
|
|
@@ -375,7 +456,7 @@ export function startStaticServer(config) {
|
|
|
375
456
|
proxyRequest(req, res, backend);
|
|
376
457
|
return;
|
|
377
458
|
}
|
|
378
|
-
handleStatic(req, res, dirAbs).catch((err) => {
|
|
459
|
+
handleStatic(req, res, dirAbs, sessionApiKey).catch((err) => {
|
|
379
460
|
console.error(`Static handler error for ${req.url}:`, err);
|
|
380
461
|
if (!res.headersSent) {
|
|
381
462
|
res.writeHead(500);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n,P as r}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as i}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-DlKA6SoO.js";import{o as a,t as o}from"./declaration-C9nuq2Dj.js";import{t as s}from"./useTranslation-01pF7z10.js";import{n as c,r as l}from"./custom-toast-handlers-BYxhSr3t.js";import{t as u}from"./utils-Czcl6buL.js";import{c as d,i as f,t as p}from"./agent-server-client-options-8OJSXbm8.js";import{n as m}from"./active-backend-context-CkP3ZEJs.js";import{d as h}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-BJm2mGIp.js";import{n as g}from"./navigation-context-BFjstyH6.js";import{t as _}from"./navigation-link-DFQ7YcWq.js";import{n as v,r as y}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~pfbaerbd-zhv9fooy.js";import{t as b}from"./proxy-BMZyC45G.js";import{t as x}from"./u-edit-BPFJBd34.js";import{t as S}from"./terminal-DGuR4559.js";import{t as C}from"./use-user-conversation-BCYpbPT1.js";import{t as w}from"./toggle-switch-gj6T-wsU.js";import{t as T}from"./x-mark-CZ57VvRX.js";import{t as E}from"./clock-DfoVUZVq.js";import{_ as ee,a as D,b as O,c as k,g as te,h as A,i as ne,l as j,n as re,o as M,p as ie,r as ae,s as N,t as oe,u as P,v as se,y as ce}from"./edit-automation-modal-DnTHJrf1.js";import{t as F}from"./automation-XLxhq3I8.js";var I=e(t()),L=a(),le=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15.75 19.5 8.25 12l7.5-7.5`})});function R(){let{t:e}=s(`openhands`);return(0,L.jsxs)(_,{to:`/automations`,className:`inline-flex items-center gap-1.5 text-sm text-muted hover:text-foreground`,children:[(0,L.jsx)(le,{className:`size-4`}),e(o.AUTOMATIONS$DETAIL$BACK_TO_LIST)]})}var ue=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3`})});function z({active:e}){let{t}=s(`openhands`);return(0,L.jsx)(`span`,{"data-testid":e?`active-status-badge-active`:`active-status-badge-inactive`,className:u(`inline-flex items-center rounded-full px-3 py-1 text-xs font-medium`,e?`bg-[var(--oh-success)]/15 text-[var(--oh-success)]`:`bg-surface-raised text-muted`),children:t(e?o.AUTOMATIONS$DETAIL$ACTIVE:o.AUTOMATIONS$DETAIL$INACTIVE)})}function B({automation:e,onToggle:t,onEdit:n,onDelete:r,onRunNow:i,isRunningNow:a=!1}){let{t:c}=s(`openhands`),l=j(`manage_automations`),u=[...n?[{label:c(o.AUTOMATIONS$EDIT),icon:(0,L.jsx)(x,{className:`size-4`}),onClick:n}]:[],{label:e.enabled?c(o.AUTOMATIONS$TURN_OFF):c(o.AUTOMATIONS$TURN_ON),icon:(0,L.jsx)(N,{className:`size-4`}),onClick:t},{label:c(o.AUTOMATIONS$DOWNLOAD_TARBALL),icon:(0,L.jsx)(ue,{className:`size-4`}),onClick:()=>{O.downloadTarball(e.id,e.name)}},{label:c(o.AUTOMATIONS$DELETE),icon:(0,L.jsx)(M,{className:`size-4`}),onClick:r}];return(0,L.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,L.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e.name}),(0,L.jsx)(z,{active:e.enabled})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&i&&(0,L.jsx)(`button`,{type:`button`,className:`rounded-md border border-[var(--oh-border)] px-3 py-1.5 text-sm font-medium text-content transition-colors hover:bg-surface-raised disabled:cursor-not-allowed disabled:opacity-60`,disabled:a,onClick:i,children:a?`Starting…`:`Run now`}),l&&(0,L.jsx)(w,{enabled:e.enabled,label:e.enabled?c(o.AUTOMATIONS$TURN_OFF):c(o.AUTOMATIONS$TURN_ON),onToggle:t}),l&&(0,L.jsx)(P,{items:u})]})]})})}function V({icon:e,title:t,children:n}){return(0,L.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,L.jsx)(`span`,{className:`size-4 text-muted`,children:e}),(0,L.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t})]}),(0,L.jsx)(`div`,{className:`px-5 py-5`,children:n})]})}function H({prompt:e}){let{t}=s(`openhands`);return(0,L.jsx)(V,{icon:(0,L.jsx)(S,{className:`size-4`}),title:t(o.AUTOMATIONS$DETAIL$PROMPT),children:(0,L.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6 text-content`,children:e})})}var U=e=>(0,L.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.204-.107-.397.165-.71.505-.78.929l-.15.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z`}),(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z`})]}),de=e=>(0,L.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 3v12m0 0a3 3 0 1 0 3 3M6 15a3 3 0 0 1 3-3h6a3 3 0 0 0 3-3V3m0 0a3 3 0 1 0 0 0`}),(0,L.jsx)(`circle`,{cx:6,cy:3,r:2}),(0,L.jsx)(`circle`,{cx:18,cy:3,r:2}),(0,L.jsx)(`circle`,{cx:9,cy:18,r:2})]}),W=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),G=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5`})}),fe=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0`})});function K({icon:e,label:t,children:n}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`size-3.5 text-muted`,children:e}),(0,L.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:t})]}),(0,L.jsx)(`div`,{className:`text-sm text-content`,children:n})]})}function pe({branch:e}){return(0,L.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-surface-raised px-2.5 py-0.5 text-xs text-muted`,children:e})}function me({automation:e}){let{t}=s(`openhands`),n=e.trigger.schedule??``;e.trigger.schedule_human&&(n=e.timezone?`${e.trigger.schedule_human} (${e.timezone})`:e.trigger.schedule_human);let r=e.trigger.type===`cron`?`Schedule`:e.trigger.type;return(0,L.jsx)(V,{icon:(0,L.jsx)(U,{className:`size-4`}),title:t(o.AUTOMATIONS$DETAIL$CONFIGURATION),children:(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-5`,children:[e.repository&&(0,L.jsx)(K,{icon:(0,L.jsx)(de,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$REPOSITORIES),children:(0,L.jsxs)(`span`,{className:`flex items-center gap-1`,children:[e.repository,e.branch&&(0,L.jsx)(pe,{branch:e.branch})]})}),(0,L.jsx)(K,{icon:(0,L.jsx)(W,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$TRIGGER),children:r}),(0,L.jsx)(K,{icon:(0,L.jsx)(G,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$SCHEDULE),children:n}),(0,L.jsx)(K,{icon:(0,L.jsx)(k,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$MODEL),children:e.model??`Active profile`}),e.notification&&(0,L.jsx)(K,{icon:(0,L.jsx)(fe,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$NOTIFICATION),children:e.notification})]})})}var he=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z`})});function q({name:e}){return(0,L.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-[var(--oh-surface-deep)] px-3.5 py-1.5 text-sm text-content`,children:e})}function ge({plugins:e}){let{t}=s(`openhands`);return(0,L.jsx)(V,{icon:(0,L.jsx)(he,{className:`size-4`}),title:t(o.AUTOMATIONS$DETAIL$PLUGINS),children:(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,L.jsx)(q,{name:e},e))})})}var J=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182`})});function Y(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`short`,day:`numeric`})}function _e(e,t,n){let r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5),s=Math.floor(r/864e5);return i<1?n(o.AUTOMATIONS$DETAIL$TIME_JUST_NOW):i<60?n(o.AUTOMATIONS$DETAIL$TIME_MINUTES_AGO,{count:i}):a<24?n(o.AUTOMATIONS$DETAIL$TIME_HOURS_AGO,{count:a}):s===1?n(o.AUTOMATIONS$DETAIL$TIME_YESTERDAY):s<7?n(o.AUTOMATIONS$DETAIL$TIME_DAYS_AGO,{count:s}):Y(e,t)}function ve({createdAt:e,lastRunAt:t}){let{t:n,i18n:r}=s(`openhands`),i=r.language;return(0,L.jsx)(V,{icon:(0,L.jsx)(J,{className:`size-4`}),title:n(o.AUTOMATIONS$DETAIL$ACTIVITY),children:(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4`,children:[(0,L.jsx)(K,{icon:(0,L.jsx)(G,{className:`size-3.5`}),label:n(o.AUTOMATIONS$DETAIL$CREATED),children:Y(e,i)}),(0,L.jsx)(K,{icon:(0,L.jsx)(E,{className:`size-3.5`}),label:n(o.AUTOMATIONS$DETAIL$LAST_RUN),children:t?_e(t,i,n):n(o.AUTOMATIONS$DETAIL$TIME_NEVER)})]})})}var ye=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),be={[F.COMPLETED]:{label:o.AUTOMATIONS$DETAIL$SUCCESSFUL,style:`border-[var(--oh-success)]/50 bg-[var(--oh-success)]/10 text-[var(--oh-success)]`},[F.FAILED]:{label:o.AUTOMATIONS$DETAIL$FAILED,style:`border-[var(--oh-danger)]/50 bg-[var(--oh-danger)]/10 text-danger`},[F.PENDING]:{label:o.AUTOMATIONS$DETAIL$PENDING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`},[F.RUNNING]:{label:o.AUTOMATIONS$DETAIL$RUNNING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`}};function xe({status:e}){switch(e){case F.COMPLETED:return(0,L.jsx)(W,{"data-testid":`run-status-icon-completed`,className:`size-3.5`});case F.FAILED:return(0,L.jsx)(ye,{"data-testid":`run-status-icon-failed`,className:`size-3.5`});default:return(0,L.jsx)(E,{"data-testid":`run-status-icon-pending`,className:`size-3.5`})}}function Se({status:e}){let{t}=s(`openhands`),n=be[e];return(0,L.jsxs)(`span`,{className:u(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium`,n.style),children:[(0,L.jsx)(xe,{status:e}),t(n.label)]})}var Ce=20;function we(e){return e.kind===`BashOutput`}var Te=class e{static async listOutputs(t,n,r){let i=[],a;for(let o=0;o<Ce;o+=1){let o=await e.searchEvents(t,n,{kind__eq:`BashOutput`,command_id__eq:r,sort_order:`TIMESTAMP`,...a?{page_id:a}:{}});if(o.items.forEach(e=>{we(e)&&i.push(e)}),!o.next_page_id)break;a=o.next_page_id}return i}static async searchEvents(e,t,n){let r=d().backend;if(r.kind===`cloud`){if(!e)throw Error(`BashService.listOutputs requires a conversation URL on cloud backends`);let i=new URLSearchParams;return Object.entries(n).forEach(([e,t])=>{t!=null&&i.set(e,String(t))}),b({backend:r,method:`GET`,hostOverride:f(e),path:`/api/bash/bash_events/search?${i.toString()}`,authMode:`session-api-key`,sessionApiKey:t})}return new h(p({...e?{conversationUrl:e}:{},sessionApiKey:t})).searchEvents(n)}},Ee=[`bash-command-logs`];function De(e){switch(e){case`MISSING`:return`missing`;case`PAUSED`:return`paused`;case`STARTING`:return`starting`;case`ERROR`:return`errored`;case`RUNNING`:case null:case void 0:default:return null}}function Oe(e){if(!y.isAxiosError(e))return null;if(!e.response)return`unreachable`;let t=e.response.status;return t===404||t>=500?`unreachable`:null}function ke(e){let{conversationId:t,bashCommandId:n,enabled:r=!0}=e,a=m(),o=C(t??null),s=o.data,c=s?.conversation_url??null,l=s?.session_api_key??null,u=a.backend.kind===`cloud`,d=o.isFetched,f=null,p=!1;u&&d&&(s?f=De(s.sandbox_status)??(s.conversation_url?null:`missing`):p=!0);let h=r&&!!n&&(u?!!c:!0)&&!f&&!p,g=i({queryKey:[...Ee,n,c,l,a.backend.id,a.orgId],queryFn:()=>Te.listOutputs(c,l,n),enabled:h,staleTime:60*1e3,gcTime:300*1e3,retry:!1}),_=u?Oe(g.error):null,v=f??_;return{data:g.data,error:_?null:g.error,isFetching:g.isFetching,isPending:g.isPending,isResolvingConversation:u&&o.isPending,conversationMissing:p,sandboxIssue:v}}var Ae={missing:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_MISSING,paused:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_PAUSED,starting:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_STARTING,errored:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_ERROR,unreachable:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_UNREACHABLE};function X(e,t){return[...e].sort((e,t)=>{let n=e.timestamp.localeCompare(t.timestamp);return n===0?(e.order??0)-(t.order??0):n}).map(e=>e[t]??``).join(``)}function je({conversationId:e,bashCommandId:t,isOpen:n,onClose:r}){let{t:i}=s(`openhands`),[a,c]=(0,I.useState)(`stdout`),{data:l,isFetching:u,isResolvingConversation:d,sandboxIssue:f,conversationMissing:p,error:m}=ke({conversationId:e,bashCommandId:t,enabled:n});(0,I.useEffect)(()=>{n&&c(`stdout`)},[n,t]),(0,I.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,r]);let{stdout:h,stderr:g}=(0,I.useMemo)(()=>l?{stdout:X(l,`stdout`),stderr:X(l,`stderr`)}:{stdout:``,stderr:``},[l]);if(!n)return null;let _=d||u&&!l,v=!t,y=a===`stdout`?h:g,b=`border-b-2 px-3 py-2 text-sm font-normal transition-colors focus:outline-none`,x=`border-[var(--oh-primary)] text-white`,S=`border-transparent text-muted hover:text-content`;return(0,L.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,role:`dialog`,"aria-modal":`true`,"aria-label":i(o.AUTOMATIONS$DETAIL$LOGS_TITLE),children:[(0,L.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:r,onKeyDown:e=>{e.key===`Escape`&&r()},role:`presentation`}),(0,L.jsxs)(`div`,{className:`relative flex max-h-[80vh] w-full max-w-3xl flex-col rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:r,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":i(o.AUTOMATIONS$CANCEL),children:(0,L.jsx)(T,{className:`size-5`})}),(0,L.jsx)(`h2`,{className:`pr-8 text-lg font-medium text-white`,children:i(o.AUTOMATIONS$DETAIL$LOGS_TITLE)}),(0,L.jsxs)(`div`,{role:`tablist`,"aria-label":i(o.AUTOMATIONS$DETAIL$LOGS_TITLE),className:`mt-4 flex gap-1 border-b border-[var(--oh-border)]`,children:[(0,L.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a===`stdout`,"aria-controls":`run-logs-panel-stdout`,id:`run-logs-tab-stdout`,tabIndex:a===`stdout`?0:-1,onClick:()=>c(`stdout`),className:`${b} ${a===`stdout`?x:S}`,children:i(o.AUTOMATIONS$DETAIL$LOGS_TAB_OUTPUT)}),(0,L.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a===`stderr`,"aria-controls":`run-logs-panel-stderr`,id:`run-logs-tab-stderr`,tabIndex:a===`stderr`?0:-1,onClick:()=>c(`stderr`),className:`${b} ${a===`stderr`?x:S}`,children:i(o.AUTOMATIONS$DETAIL$LOGS_TAB_ERROR)})]}),(0,L.jsxs)(`div`,{role:`tabpanel`,id:`run-logs-panel-${a}`,"aria-labelledby":`run-logs-tab-${a}`,className:`mt-3 min-h-[12rem] flex-1 overflow-auto rounded-lg border border-[var(--oh-border)] bg-black/40 p-4 font-mono text-xs`,children:[v&&(0,L.jsx)(`p`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_NO_COMMAND)}),!v&&p&&(0,L.jsx)(`p`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_CONVERSATION_MISSING)}),!v&&!p&&f&&(0,L.jsx)(`p`,{"data-testid":`run-logs-sandbox-issue-${f}`,className:`text-muted italic`,children:i(Ae[f])}),!v&&!p&&!f&&_&&(0,L.jsx)(`p`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_LOADING)}),!v&&!p&&!f&&!_&&m&&!l&&(0,L.jsxs)(`p`,{className:`text-danger`,children:[i(o.AUTOMATIONS$DETAIL$LOGS_ERROR),`: `,String(m)]}),!_&&!f&&l&&(0,L.jsx)(`pre`,{"data-testid":`run-logs-output-${a}`,className:`whitespace-pre-wrap break-words ${a===`stderr`?`text-danger`:`text-content`}`,children:y.length>0?y:(0,L.jsx)(`span`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_EMPTY)})})]})]})]})}function Me(e,t){return new Date(e).toLocaleDateString(t,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function Ne(e){return`/conversations/${e}`}function Pe({run:e}){let{t,i18n:n}=s(`openhands`),r=!!e.conversation_id,i=!!e.bash_command_id,[a,c]=(0,I.useState)(!1),l=Me(e.started_at,n.language),u=i?(0,L.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),e.preventDefault(),c(!0)},className:`rounded-md p-1 text-muted hover:bg-surface-raised hover:text-foreground focus:bg-surface-raised focus:outline-none`,"aria-label":t(o.AUTOMATIONS$DETAIL$LOGS_VIEW,{timestamp:l}),title:t(o.AUTOMATIONS$DETAIL$LOGS_VIEW_SHORT),children:(0,L.jsx)(S,{className:`size-4`})}):null,d=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`span`,{className:`text-sm text-content`,children:l}),!r&&(0,L.jsxs)(`span`,{className:`text-xs text-muted italic`,children:[`(`,t(o.AUTOMATIONS$DETAIL$NO_CONVERSATION),`)`]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[u,(0,L.jsx)(Se,{status:e.status})]})]});return(0,L.jsxs)(L.Fragment,{children:[r&&e.conversation_id?(0,L.jsx)(`a`,{href:Ne(e.conversation_id),className:`flex items-center justify-between px-5 py-3 transition-colors cursor-pointer hover:bg-surface-raised focus:bg-surface-raised focus:outline-none`,"aria-label":`View conversation for run at ${l}`,children:d}):(0,L.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 cursor-default`,children:d}),i&&(0,L.jsx)(je,{conversationId:e.conversation_id,bashCommandId:e.bash_command_id,isOpen:a,onClose:()=>c(!1)})]})}var Z=20;function Fe({automationId:e}){let{t}=s(`openhands`),[n,r]=(0,I.useState)(Z),{data:i,isLoading:a}=ce({id:e,limit:n,offset:0}),c=i?i.total>i.runs.length:!1;return(0,L.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,L.jsx)(`span`,{className:`size-4 text-muted`,children:(0,L.jsx)(J,{className:`size-4`})}),(0,L.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t(o.AUTOMATIONS$DETAIL$ACTIVITY_LOG)})]}),a&&(0,L.jsx)(`div`,{className:`space-y-1 p-5`,children:Array.from({length:3}).map((e,t)=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,L.jsx)(`div`,{className:`h-5 w-64 animate-pulse rounded bg-surface-raised`}),(0,L.jsx)(`div`,{className:`h-6 w-24 animate-pulse rounded-full bg-surface-raised`})]},`skeleton-${t}`))}),!a&&i?.runs.length===0&&(0,L.jsx)(`p`,{className:`px-5 py-8 text-center text-sm text-muted`,children:t(o.AUTOMATIONS$DETAIL$NO_RUNS)}),!a&&i&&i.runs.length>0&&(0,L.jsxs)(`div`,{children:[i.runs.map((e,t)=>(0,L.jsx)(`div`,{className:t>0?`border-t border-[var(--oh-border)]`:``,children:(0,L.jsx)(Pe,{run:e})},e.id)),c&&(0,L.jsx)(`div`,{className:`border-t border-[var(--oh-border)] px-5 py-3`,children:(0,L.jsx)(`button`,{type:`button`,onClick:()=>r(e=>e+Z),className:`text-sm text-muted hover:text-foreground`,children:t(o.AUTOMATIONS$DETAIL$LOAD_MORE_RUNS)})})]})]})}function Q({className:e}){return(0,L.jsx)(`div`,{className:u(`animate-pulse rounded bg-surface-raised`,e)})}function $(){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`detail-skeleton`,children:[(0,L.jsx)(Q,{className:`h-5 w-40`}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(Q,{className:`h-6 w-48`}),(0,L.jsx)(Q,{className:`h-6 w-16 rounded-full`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(Q,{className:`h-6 w-11 rounded-full`}),(0,L.jsx)(Q,{className:`h-8 w-8`})]})]}),(0,L.jsx)(Q,{className:`h-5 w-96`}),(0,L.jsx)(Q,{className:`h-36 w-full rounded-2xl`}),(0,L.jsx)(Q,{className:`h-72 w-full rounded-2xl`}),(0,L.jsx)(Q,{className:`h-32 w-full rounded-2xl`}),(0,L.jsx)(Q,{className:`h-40 w-full rounded-2xl`})]})}function Ie(){let{t:e}=s(`openhands`);return(0,L.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,L.jsx)(D,{className:`size-12 text-muted`}),(0,L.jsx)(`p`,{className:`mt-4 text-sm font-medium text-content`,children:e(o.AUTOMATIONS$DETAIL$NOT_FOUND_TITLE)}),(0,L.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:e(o.AUTOMATIONS$DETAIL$NOT_FOUND_MESSAGE)}),(0,L.jsx)(`div`,{className:`mt-6`,children:(0,L.jsx)(R,{})})]})}var Le=n(function(){let{t:e}=s(`openhands`),{automationId:t}=r(),{navigate:n}=g(),[i,a]=(0,I.useState)(!1),[u,d]=(0,I.useState)(!1),{data:f,isLoading:p,refetch:h}=ie(),_=f?.status===`ok`,y=m(),b=(0,I.useRef)(y.backend.id).current!==y.backend.id,{data:x,isLoading:S,isError:C,error:w,refetch:T}=se({id:t??``,enabled:_&&!b}),E=ee(),D=A(),O=te(),k=C&&v(w)&&w.response?.status===404;if(p)return(0,L.jsx)(`div`,{className:`min-h-full`,children:(0,L.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,L.jsx)($,{})})});if(!_)return(0,L.jsx)(`div`,{className:`min-h-full`,children:(0,L.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,L.jsx)(ae,{onRetry:h})})});if(S)return(0,L.jsx)(`div`,{className:`min-h-full`,children:(0,L.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,L.jsx)($,{})})});if(k)return(0,L.jsx)(`div`,{className:`min-h-full`,children:(0,L.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,L.jsx)(Ie,{})})});if(C||!x)return(0,L.jsx)(`div`,{className:`min-h-full`,children:(0,L.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,L.jsx)(ne,{onRetry:()=>T()})})});let j=()=>{E.mutate({id:x.id,enabled:!x.enabled})},M=()=>{D.mutate(x.id,{onSuccess:()=>{n?.(`/automations`)}})},N=()=>{O.mutate(x.id,{onSuccess:()=>{l(e(o.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{c(v(t)?t.response?.data?.message||t.message||e(o.AUTOMATIONS$RUN_NOW_ERROR):t.message||e(o.AUTOMATIONS$RUN_NOW_ERROR))}})},P=y.backend.kind===`local`;return(0,L.jsx)(`div`,{className:`min-h-full`,children:(0,L.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,L.jsx)(R,{}),(0,L.jsx)(B,{automation:x,onToggle:j,onEdit:P?()=>d(!0):void 0,onDelete:()=>a(!0),onRunNow:N,isRunningNow:O.isPending}),x.prompt&&(0,L.jsx)(H,{prompt:x.prompt}),(0,L.jsx)(me,{automation:x}),x.plugins&&x.plugins.length>0&&(0,L.jsx)(ge,{plugins:x.plugins}),(0,L.jsx)(ve,{createdAt:x.created_at,lastRunAt:x.last_triggered_at}),(0,L.jsx)(Fe,{automationId:x.id}),(0,L.jsx)(re,{automationName:x.name,isOpen:i,onConfirm:M,onCancel:()=>a(!1)}),P&&(0,L.jsx)(oe,{automation:x,isOpen:u,onClose:()=>d(!1)})]})})})});export{Le as default};
|