@openchamber/web 2.0.2 → 2.0.4
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/bin/lib/DOCUMENTATION.md +1 -1
- package/bin/lib/commands-connect-url.js +6 -5
- package/bin/lib/commands-tunnel.js +24 -5
- package/dist/assets/{CodeMirrorCommentWidgets-CmKmyb9T.js → CodeMirrorCommentWidgets-C_zL-eri.js} +1 -1
- package/dist/assets/{DiffView-8-PFpZ2p.js → DiffView-BeN2_YYF.js} +3 -3
- package/dist/assets/FilesView-CN34wm_N.js +17 -0
- package/dist/assets/{GitView-DNUSu00w.js → GitView-DLDazOo1.js} +4 -4
- package/dist/assets/{GuestAttachDialog-Cv6QzjHC.js → GuestAttachDialog-C0xe_Lyy.js} +1 -1
- package/dist/assets/{GuestSurfacePane-Bt3jB_Ye.js → GuestSurfacePane-BdaurnDr.js} +1 -1
- package/dist/assets/{JsonTreeView-BlyHTRhM.js → JsonTreeView-B1Xq-k2t.js} +1 -1
- package/dist/assets/LinearIssuesView-BryoAHow.js +1 -0
- package/dist/assets/{MarkdownImageGallery-2UXJF-5B.js → MarkdownImageGallery-DfuEoaGq.js} +1 -1
- package/dist/assets/MarkdownRendererImpl-B_ZcWOvX.js +12 -0
- package/dist/assets/OnboardingScreen-C22bGmnP.js +1 -0
- package/dist/assets/{PatchDiff-ByvnbG5T.js → PatchDiff-0xd6UeFB.js} +1 -1
- package/dist/assets/{PierreDiffViewer-BXieg0mH.js → PierreDiffViewer-BC950e3F.js} +3 -3
- package/dist/assets/PlanView-B7Xgihqk.js +5 -0
- package/dist/assets/PluginPane-2C71F8uF.js +3 -0
- package/dist/assets/SettingsView-m_zoFiaT.js +30 -0
- package/dist/assets/{SettingsWindow-BIz224xs.js → SettingsWindow-CofS020b.js} +1 -1
- package/dist/assets/{SubmoduleDiffSummary-CXKmlps9.js → SubmoduleDiffSummary-BSA9gnIO.js} +1 -1
- package/dist/assets/{ToolOutputDialog-BsgAK8xu.js → ToolOutputDialog-DprkVKcj.js} +7 -7
- package/dist/assets/{ToolPartDiffPreview-vdPObXOf.js → ToolPartDiffPreview-Dq0go_fX.js} +2 -2
- package/dist/assets/{VirtualizedFileDiff-BkFNKWS5.js → VirtualizedFileDiff-Kp8hKJdT.js} +1 -1
- package/dist/assets/WalkthroughView-DGnTzqIU.js +4 -0
- package/dist/assets/{appThemeRegistry-aHUNHoqP.js → appThemeRegistry-BdEHBA4s.js} +1 -1
- package/dist/assets/{commitAndPush-Bon9r94r.js → commitAndPush-LwtVa2Oc.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-DKqr_1AQ.js → computeVirtualFileMetrics-6V1xNpO9.js} +2 -2
- package/dist/assets/de-DlgBHUAI.js +10 -0
- package/dist/assets/es-BC8G41U8.js +16 -0
- package/dist/assets/fr-I0z3vVjy.js +14 -0
- package/dist/assets/index-CgR5rJq_.js +41 -0
- package/dist/assets/{index-DpFttslC.js → index-CmNPYddV.js} +1 -1
- package/dist/assets/index-adyy_sEk.css +1 -0
- package/dist/assets/{isDiffPlainText-kzAgpIgi.js → isDiffPlainText-1bXcWCrw.js} +1 -1
- package/dist/assets/{isFilePlainText-Uj6y-jzz.js → isFilePlainText-CBAppvy1.js} +1 -1
- package/dist/assets/ja-BIElEsY8.js +16 -0
- package/dist/assets/ko-DRnnHetA.js +16 -0
- package/dist/assets/{main-CbfMxn-I.js → main-CzjTMTfW.js} +2 -2
- package/dist/assets/main-DVX34beR.js +886 -0
- package/dist/assets/markdownCore-Cxbkn5NR.js +7 -0
- package/dist/assets/{miniChat-CiAKBC10.js → miniChat-CP68IL8Q.js} +2 -2
- package/dist/assets/{mobile-CsT4sJwC.js → mobile-BrlBrNfZ.js} +2 -2
- package/dist/assets/nl-DzUV-kwp.js +16 -0
- package/dist/assets/{patchFileDiff-DeaE08W0.js → patchFileDiff-pqRSHLHI.js} +2 -2
- package/dist/assets/pl-Bb-cb7k7.js +16 -0
- package/dist/assets/pt-BR-CyIWrTcE.js +16 -0
- package/dist/assets/renderElectronMiniChatApp-DKIilR7N.js +2 -0
- package/dist/assets/renderMobileApp-B0z6-x58.js +25 -0
- package/dist/assets/runtimeEndpointReset-uu1DBwLL.js +52 -0
- package/dist/assets/{scheduledTasksApi-BZCNJ588.js → scheduledTasksApi-BuzWT445.js} +1 -1
- package/dist/assets/{shikiHighlight-BSUEa3yF.js → shikiHighlight-BWGrY5YU.js} +1 -1
- package/dist/assets/{textMateThemeFromAppTheme-CsATFZIV.js → textMateThemeFromAppTheme-BSUFChBY.js} +1 -1
- package/dist/assets/tr-DXEDSoYO.js +7 -0
- package/dist/assets/uk-C8hN--q_.js +16 -0
- package/dist/assets/useAppFontEffects-Dsl_sLrj.js +7366 -0
- package/dist/assets/useInlineCommentController-d5vntsQ_.js +2 -0
- package/dist/assets/{useRootScrollLock-Cp1eFoM2.js → useRootScrollLock-2rd5Y6gR.js} +2 -2
- package/dist/assets/{vendor-base-ui-CsXYnR5c.js → vendor-base-ui-DnNniUWp.js} +1 -1
- package/dist/assets/{vendor-codemirror-language-data-BwwommM0.js → vendor-codemirror-language-data-B1EetJur.js} +2 -2
- package/dist/assets/vendor-opencode-client-DSZl7jSi.js +12 -0
- package/dist/assets/{vendor-tanstack-react-virtual-ClYN8CzB.js → vendor-tanstack-react-virtual--0sBrLRh.js} +1 -1
- package/dist/assets/{vendor-tanstack-virtual-core-BewVQryB.js → vendor-tanstack-virtual-core-BoA4iGMw.js} +1 -1
- package/dist/assets/{vendor-zod-BSoePkpP.js → vendor-zod-CxRSdNoV.js} +4 -4
- package/dist/assets/{web-components-D3Yjr4Zx.js → web-components-ngpHPEDU.js} +1 -1
- package/dist/assets/zh-CN-CtzXdjMZ.js +16 -0
- package/dist/assets/zh-TW-Ds0CADSz.js +16 -0
- package/dist/index.html +5 -5
- package/dist/mini-chat.html +5 -5
- package/dist/mobile.html +5 -5
- package/package.json +5 -5
- package/server/index.js +82 -4
- package/server/lib/agent-tool/DOCUMENTATION.md +8 -1
- package/server/lib/agent-tool/runtime.js +13 -4
- package/server/lib/agent-tool/runtime.test.js +15 -0
- package/server/lib/context-obligatory/DOCUMENTATION.md +10 -7
- package/server/lib/context-obligatory/runtime.js +2 -1
- package/server/lib/context-obligatory/runtime.test.js +76 -30
- package/server/lib/dictation/DOCUMENTATION.md +4 -1
- package/server/lib/dictation/openai-compatible-session.js +7 -0
- package/server/lib/enterprise-mode.d.ts +30 -0
- package/server/lib/enterprise-mode.js +253 -0
- package/server/lib/enterprise-mode.test.js +247 -0
- package/server/lib/event-stream/translate-v2.js +6 -0
- package/server/lib/event-stream/translate-v2.test.js +6 -0
- package/server/lib/git/DOCUMENTATION.md +2 -1
- package/server/lib/git/routes.js +44 -1
- package/server/lib/git/routes.test.js +98 -1
- package/server/lib/git/service.js +146 -11
- package/server/lib/git/service.test.js +195 -0
- package/server/lib/github/routes.js +9 -19
- package/server/lib/github/routes.test.js +112 -0
- package/server/lib/guests/DOCUMENTATION.md +4 -2
- package/server/lib/guests/background.test.js +1 -1
- package/server/lib/guests/catalog.js +56 -2
- package/server/lib/guests/catalog.test.js +24 -1
- package/server/lib/guests/clone-network.test.js +52 -0
- package/server/lib/guests/clone.js +30 -4
- package/server/lib/guests/enterprise.js +68 -0
- package/server/lib/guests/enterprise.test.js +106 -0
- package/server/lib/guests/grant-scope.js +8 -2
- package/server/lib/guests/grant-scope.test.js +9 -0
- package/server/lib/guests/html-styles.js +16 -2
- package/server/lib/guests/html-styles.test.js +53 -4
- package/server/lib/guests/install.js +10 -0
- package/server/lib/guests/persist.js +1 -0
- package/server/lib/guests/routes.js +40 -5
- package/server/lib/guests/updates.js +9 -2
- package/server/lib/notifications/DOCUMENTATION.md +1 -1
- package/server/lib/notifications/runtime.js +22 -8
- package/server/lib/notifications/trigger-runtime.test.js +45 -0
- package/server/lib/openchamber-sessions/session-metadata-store.js +27 -0
- package/server/lib/openchamber-sessions/session-metadata-store.test.js +18 -0
- package/server/lib/opencode/DOCUMENTATION.md +13 -9
- package/server/lib/opencode/auth-state-runtime.js +2 -2
- package/server/lib/opencode/config-paths.test.js +1 -0
- package/server/lib/opencode/env-runtime.js +26 -3
- package/server/lib/opencode/env-runtime.test.js +57 -0
- package/server/lib/opencode/feature-routes-runtime.js +2 -0
- package/server/lib/opencode/hmr-state-runtime.js +4 -3
- package/server/lib/opencode/lifecycle.js +10 -5
- package/server/lib/opencode/lifecycle.test.js +6 -2
- package/server/lib/opencode/managed-config-file.js +2 -1
- package/server/lib/opencode/managed-config-file.test.js +18 -0
- package/server/lib/opencode/npm-registry-config.d.ts +1 -0
- package/server/lib/opencode/npm-registry-config.js +123 -0
- package/server/lib/opencode/npm-registry-config.test.js +167 -0
- package/server/lib/opencode/npm-registry.js +5 -6
- package/server/lib/opencode/npm-registry.test.js +30 -0
- package/server/lib/opencode/openchamber-routes.js +8 -0
- package/server/lib/opencode/project-icon-routes.js +2 -2
- package/server/lib/opencode/project-icon-routes.test.js +44 -0
- package/server/lib/opencode/provider-source-route.test.js +32 -0
- package/server/lib/opencode/routes.js +17 -2
- package/server/lib/opencode/settings-helpers.js +26 -3
- package/server/lib/opencode/settings-helpers.test.js +12 -5
- package/server/lib/opencode/settings-registry.json +35 -1
- package/server/lib/opencode/settings-runtime.js +1 -0
- package/server/lib/opencode/shutdown-runtime.js +2 -0
- package/server/lib/opencode/static-routes-runtime.js +9 -1
- package/server/lib/opencode/static-routes-runtime.test.js +58 -1
- package/server/lib/package-manager.js +4 -1
- package/server/lib/package-manager.test.js +24 -0
- package/server/lib/permission-auto-accept/DOCUMENTATION.md +23 -15
- package/server/lib/permission-auto-accept/modes.js +26 -0
- package/server/lib/permission-auto-accept/runtime.js +146 -40
- package/server/lib/permission-auto-accept/runtime.test.js +93 -9
- package/server/lib/quota/DOCUMENTATION.md +6 -0
- package/server/lib/quota/providers/zhipuai-coding-plan.js +74 -30
- package/server/lib/quota/providers/zhipuai-coding-plan.test.js +124 -0
- package/server/lib/relay/DOCUMENTATION.md +1 -1
- package/server/lib/relay/service.js +32 -12
- package/server/lib/relay/service.test.js +30 -0
- package/server/lib/routing/DOCUMENTATION.md +150 -41
- package/server/lib/routing/classifier.js +156 -0
- package/server/lib/routing/defaults.js +27 -0
- package/server/lib/routing/jev.js +5 -17
- package/server/lib/routing/routes.http.test.js +9 -0
- package/server/lib/routing/routes.js +27 -1
- package/server/lib/routing/runtime.js +199 -33
- package/server/lib/routing/runtime.test.js +299 -15
- package/server/lib/routing/store.js +57 -0
- package/server/lib/routing/store.test.js +37 -0
- package/server/lib/session-assist/DOCUMENTATION.md +17 -7
- package/server/lib/session-assist/context.js +42 -2
- package/server/lib/session-assist/context.test.js +38 -1
- package/server/lib/session-assist/runtime.js +57 -13
- package/server/lib/session-assist/runtime.test.js +45 -0
- package/server/lib/session-goal/DOCUMENTATION.md +47 -22
- package/server/lib/session-goal/audit.js +112 -0
- package/server/lib/session-goal/audit.test.js +58 -0
- package/server/lib/session-goal/runtime.js +113 -134
- package/server/lib/session-goal/runtime.test.js +146 -13
- package/server/lib/session-lineage.js +52 -0
- package/server/lib/session-lineage.test.js +45 -0
- package/server/lib/session-work/DOCUMENTATION.md +108 -0
- package/server/lib/session-work/questions.js +126 -0
- package/server/lib/session-work/runtime.js +278 -0
- package/server/lib/session-work/runtime.test.js +255 -0
- package/server/lib/session-work/state.js +48 -0
- package/server/lib/session-work/state.test.js +34 -0
- package/server/lib/small-model/DOCUMENTATION.md +14 -7
- package/server/lib/small-model/client.js +7 -4
- package/server/lib/small-model/index.js +11 -21
- package/server/lib/small-model/index.test.js +13 -26
- package/server/lib/spaces/DOCUMENTATION.md +79 -25
- package/server/lib/spaces/gatekeeper-channel.js +63 -11
- package/server/lib/spaces/gatekeeper-channel.test.js +34 -4
- package/server/lib/spaces/gatekeeper-program.cjs +64 -13
- package/server/lib/spaces/gatekeeper-program.test.js +115 -3
- package/server/lib/spaces/host.js +58 -13
- package/server/lib/spaces/host.test.js +34 -1
- package/server/lib/spaces/idle-stop.js +98 -0
- package/server/lib/spaces/idle-stop.test.js +130 -0
- package/server/lib/spaces/journey.js +427 -17
- package/server/lib/spaces/journey.test.js +592 -5
- package/server/lib/spaces/layout.js +27 -6
- package/server/lib/spaces/manager.test.js +1 -1
- package/server/lib/spaces/places/contract-suite.js +4 -2
- package/server/lib/spaces/places/docker-live-support.js +27 -4
- package/server/lib/spaces/places/docker.js +32 -5
- package/server/lib/spaces/places/docker.test.js +38 -8
- package/server/lib/spaces/places/escape-suite.js +32 -0
- package/server/lib/spaces/places/fake-docker.js +3 -1
- package/server/lib/spaces/places/grants.docker.live.test.js +197 -0
- package/server/lib/spaces/places/memory-place.js +3 -3
- package/server/lib/spaces/places/sessions.docker.live.test.js +4 -2
- package/server/lib/spaces/routes.js +49 -1
- package/server/lib/spaces/routes.test.js +31 -3
- package/server/lib/spaces/space-opencode.js +52 -0
- package/server/lib/spaces/space-opencode.test.js +41 -0
- package/server/lib/spaces/space-records.js +90 -2
- package/server/lib/spaces/space-records.test.js +58 -1
- package/server/lib/spaces/space-server.js +13 -1
- package/server/lib/spaces/space-server.test.js +13 -0
- package/server/lib/spaces/space-setup.js +173 -0
- package/server/lib/spaces/space-setup.test.js +174 -0
- package/server/lib/tts/DOCUMENTATION.md +3 -0
- package/server/lib/tts/base-url.js +8 -0
- package/server/lib/tts/routes.js +13 -1
- package/server/lib/tts/routes.test.js +26 -0
- package/server/lib/tunnels/DOCUMENTATION.md +2 -0
- package/server/lib/tunnels/routes.js +14 -0
- package/server/lib/tunnels/routes.test.js +26 -0
- package/server/lib/walkthrough/index.js +11 -7
- package/server/lib/walkthrough/jobs.test.js +8 -0
- package/server/lib/walkthrough/languages.js +1 -0
- package/server/lib/walkthrough/routes.js +7 -1
- package/dist/assets/FilesView-0Ie20mEk.js +0 -17
- package/dist/assets/LinearIssuesView-CSl2MUfA.js +0 -1
- package/dist/assets/MarkdownRendererImpl-DVHqZoug.js +0 -12
- package/dist/assets/OnboardingScreen-CIdXJpfc.js +0 -1
- package/dist/assets/PlanView-DEIi3Q7M.js +0 -5
- package/dist/assets/PluginPane-BEPUWVho.js +0 -3
- package/dist/assets/SettingsView-CiNh-RbW.js +0 -30
- package/dist/assets/WalkthroughView-6oE-MuDL.js +0 -4
- package/dist/assets/de-CgAJ51z7.js +0 -10
- package/dist/assets/es-zGi_ravM.js +0 -16
- package/dist/assets/fr-CPfogrWx.js +0 -14
- package/dist/assets/index-CHfphYL3.js +0 -41
- package/dist/assets/index-DvMJ3w6V.css +0 -1
- package/dist/assets/ja-DMk6wd-U.js +0 -16
- package/dist/assets/ko-BFpzJ8jc.js +0 -16
- package/dist/assets/main-anyZFMIs.js +0 -896
- package/dist/assets/markdownCore-CmM47cAE.js +0 -7
- package/dist/assets/pl-VdRPcZrB.js +0 -16
- package/dist/assets/pt-BR-BRys_lOW.js +0 -16
- package/dist/assets/renderElectronMiniChatApp-C5677jy0.js +0 -2
- package/dist/assets/renderMobileApp-D4dBBAqQ.js +0 -25
- package/dist/assets/runtimeEndpointReset-5r0hkd-2.js +0 -27
- package/dist/assets/tr-CA9ckNnm.js +0 -7
- package/dist/assets/uk-byjR-y8D.js +0 -16
- package/dist/assets/useAppFontEffects-BWQZ5DeI.js +0 -7341
- package/dist/assets/useInlineCommentController-DlFyVfBu.js +0 -2
- package/dist/assets/vendor-opencode-client-DYdsLbCM.js +0 -12
- package/dist/assets/zh-CN-DRabgxdG.js +0 -16
- package/dist/assets/zh-TW-rbY5c9UK.js +0 -16
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{r as u,j as s,f as G}from"./vendor-react-BUCujlKS.js";import{f as ee,l as ft,I as j,ea as xt,B,h as J,ay as rs,ae as kt,af as bt,ag as vt,aA as ns,aj as as,ak as is,K as ve,al as ls,_ as cs,J as us,as as it,at as lt,av as ct,aw as ut,cb as dt,ax as he,bi as pt,o as ds}from"./useAppFontEffects-BWQZ5DeI.js";import{f as ps,u as hs,b as ms,a as gs,c as fs,B as xs,C as ks,P as ht}from"./patchFileDiff-DeaE08W0.js";import{h as wt,v as bs,u as me,e6 as vs,e5 as ws}from"./index-CHfphYL3.js";import{u as L,W as ys}from"./main-anyZFMIs.js";import{P as js}from"./PierreDiffViewer-BXieg0mH.js";import{k as Ss,j as Ns}from"./runtimeEndpointReset-5r0hkd-2.js";import"./vendor-scheduler-7OC5HNn7.js";import"./vendor-zod-BSoePkpP.js";import"./vendor-simplewebauthn-browser-VDA66rT_.js";import"./vendor-vite-runtime-DD1OZmLC.js";import"./vendor-zustand-BAGL70zf.js";import"./vendor-base-ui-CsXYnR5c.js";import"./vendor-floating-ui-utils-D6FqdtJt.js";import"./vendor-floating-ui-react-dom-DxYCWdHj.js";import"./vendor-floating-ui-dom-BTvzWks8.js";import"./vendor-floating-ui-core-PuGzNPnN.js";import"./vendor-use-sync-external-store-D6wYuSt-.js";import"./vendor-class-variance-authority-5VPnzWs2.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-dnd-kit-core-BZknOX2w.js";import"./vendor-dnd-kit-utilities-B_MdXhJC.js";import"./vendor-dnd-kit-accessibility-BHxJPORy.js";import"./vendor-dnd-kit-sortable-CsEagZ81.js";import"./vendor-tanstack-react-virtual-ClYN8CzB.js";import"./vendor-tanstack-virtual-core-BewVQryB.js";import"./vendor-framer-motion-Bq3iTZ6r.js";import"./vendor-motion-dom-DcCgeG69.js";import"./vendor-motion-utils-BGh8QBgx.js";import"./contextPanelEmbeddedChat-CirXEPJq.js";import"./vendor-sonner-DFyL3AvE.js";import"./vendor-cmdk-DgLInKvT.js";import"./vendor-radix-ui-react-dialog-B94Bt2qq.js";import"./vendor-radix-ui-primitive-Dc_FVRD7.js";import"./vendor-radix-ui-react-compose-refs-DcAh5WdT.js";import"./vendor-radix-ui-react-context-Czxm7Z62.js";import"./vendor-radix-ui-react-id-f5BLKEVw.js";import"./vendor-radix-ui-react-use-layout-effect-D_3IhJdJ.js";import"./vendor-radix-ui-react-use-controllable-state-BFT5YmkA.js";import"./vendor-radix-ui-react-dismissable-layer-D7kXcwgJ.js";import"./vendor-radix-ui-react-primitive-DhVoX9SD.js";import"./vendor-radix-ui-react-slot-BQgQOasS.js";import"./vendor-radix-ui-react-use-callback-ref-BZPnuXAC.js";import"./vendor-radix-ui-react-use-escape-keydown-oph88g-F.js";import"./vendor-radix-ui-react-focus-scope-CiaxW4dD.js";import"./vendor-radix-ui-react-portal-BMJYHWck.js";import"./vendor-radix-ui-react-presence-CNxf-uq4.js";import"./vendor-radix-ui-react-focus-guards-B6qJXYua.js";import"./vendor-react-remove-scroll-DO7dCTnK.js";import"./vendor-tslib-De9GV7Vy.js";import"./vendor-react-remove-scroll-bar-BcFYyj3E.js";import"./vendor-react-style-singleton-q6EMHnwf.js";import"./vendor-get-nonce-C-Z93AgS.js";import"./vendor-use-sidecar-zDC0RhA3.js";import"./vendor-use-callback-ref-D3RC8gqK.js";import"./vendor-aria-hidden-DvXkyWUv.js";import"./vendor-codemirror-language-BgPj_McA.js";import"./vendor-lezer-common-B3-cUCR_.js";import"./vendor-codemirror-state-C9awkmn-.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./vendor-codemirror-view-CiLROUVV.js";import"./vendor-style-mod-NZ5MEPvj.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";import"./vendor-lezer-highlight-CDMHUZ74.js";import"./vendor-codemirror-lang-javascript-Cc2ZYbgX.js";import"./vendor-lezer-javascript-D7Tj24ot.js";import"./vendor-lezer-lr-bhwg1HMg.js";import"./vendor-codemirror-autocomplete-DzPz9Wgq.js";import"./vendor-codemirror-lang-json-CMBS2tG9.js";import"./vendor-lezer-json-Iaex0UN-.js";import"./vendor-codemirror-lang-css-O0cZX78y.js";import"./vendor-lezer-css-C5xB6jxd.js";import"./vendor-codemirror-lang-html-CfgK872x.js";import"./vendor-lezer-html-C0I1p52t.js";import"./vendor-codemirror-lang-markdown-BPGOH9ye.js";import"./vendor-lezer-markdown-C6g-d6P3.js";import"./vendor-codemirror-language-data-BwwommM0.js";import"./vendor-codemirror-lang-python-HahnQaAS.js";import"./vendor-lezer-python-CvuFxeZl.js";import"./vendor-codemirror-commands-B7H_j0iU.js";import"./vendor-legendapp-list-BuBPBC3R.js";import"./vendor-tailwind-merge-CPcsbTWB.js";import"./vendor-fuse.js-Dw8P0qyA.js";import"./PluginPane-BEPUWVho.js";import"./VirtualizedFileDiff-BkFNKWS5.js";import"./web-components-D3Yjr4Zx.js";import"./computeVirtualFileMetrics-DKqr_1AQ.js";import"./vendor-shiki-Bbf2GEcE.js";import"./vendor-shikijs-core-CGM_jqPK.js";import"./vendor-shikijs-types-CPSbSeK6.js";import"./vendor-shikijs-vscode-textmate-BgLrS_2D.js";import"./vendor-hast-util-to-html-BKBhbTDb.js";import"./vendor-html-void-elements-CkdplsNl.js";import"./vendor-property-information-rJCbAzvX.js";import"./vendor-zwitch-C2o2j-tx.js";import"./vendor-stringify-entities-CsH1VEn9.js";import"./vendor-character-entities-legacy-BpoLgcEt.js";import"./vendor-character-entities-html4-D7taRCQ7.js";import"./vendor-ccount-c2V3InAJ.js";import"./vendor-comma-separated-tokens-D8TqSuIK.js";import"./vendor-space-separated-tokens-DD3iYX1K.js";import"./vendor-hast-util-whitespace-D4Wp6AEg.js";import"./vendor-shikijs-engine-oniguruma-DPWuIF1G.js";import"./themeResolver-BmJyTmjJ.js";import"./vendor-pierre-theming-C6Z4M5_u.js";import"./vendor-shikijs-engine-javascript-Cme4830A.js";import"./vendor-oniguruma-to-es-DLBnFDCE.js";import"./vendor-oniguruma-parser-C0D4_9rT.js";import"./vendor-regex-BBWcyTkg.js";import"./vendor-regex-utilities-2BQyy0xI.js";import"./vendor-regex-recursion-JU4mF-dD.js";import"./vendor-shikijs-transformers-CZWsLLKm.js";import"./isDiffPlainText-kzAgpIgi.js";import"./vendor-diff-C3JhlQdm.js";import"./vendor-opencode-client-DYdsLbCM.js";import"./vendor-katex-CHD9BdDO.js";import"./useRootScrollLock-Cp1eFoM2.js";import"./scheduledTasksApi-BZCNJ588.js";import"./vendor-cron-parser-CjvYVigk.js";import"./vendor-luxon-BZ0puJYg.js";import"./Virtualizer-D_a8gKmg.js";import"./useInlineCommentController-DlFyVfBu.js";import"./appThemeRegistry-aHUNHoqP.js";import"./textMateThemeFromAppTheme-CsATFZIV.js";import"./GuestAttachDialog-Cv6QzjHC.js";const Cs=n=>{if(!n?.walkthrough)return null;const t=new Map(n.hunks.map(a=>[a.id,a])),e=new Set,o=[],l=[];for(const[a,h]of n.walkthrough.chapters.entries()){const c=[];for(const g of h.stops){const m=[],p=[];for(const i of g.hunkIds){const w=t.get(i);w?(m.push(w),e.add(i)):p.push(i)}const f={stop:g,chapter:h,chapterIndex:a,position:o.length+1,hunks:m,missingHunkIds:p,isStale:p.length>0};o.push(f),c.push(f)}l.push({chapter:h,stops:c})}return{walkthrough:n.walkthrough,stops:o,chapters:l,uncoveredHunks:n.hunks.filter(a=>!e.has(a.id)),staleStopCount:o.filter(a=>a.isStale).length,isStale:o.some(a=>a.isStale)}},Rs=n=>{const t=new Map;for(const e of n){const o=t.get(e.path);if(o){o.added+=e.added,o.deleted+=e.deleted;continue}t.set(e.path,{path:e.path,added:e.added,deleted:e.deleted})}return[...t.values()]},yt=n=>{const t=[];for(const e of n){const o=t.at(-1);if(o&&o.path===e.path){o.hunks.push(e);continue}t.push({path:e.path,hunks:[e]})}return t},Ms=n=>{if(n.length===0)return"";if(n.length===1)return n[0].patch;const t=n[0].patch,e=t.indexOf(`
|
|
2
|
-
@@`);if(e===-1)return t;const o=t.slice(0,e),l=n.map(a=>{const h=a.patch.indexOf(`
|
|
3
|
-
@@`);return h===-1?"":a.patch.slice(h+1)});return`${o}
|
|
4
|
-
${l.join("")}`},Is=n=>n?`${n.providerID}/${n.modelID}`:"",Ts=({reason:n,model:t,requiredChars:e,availableChars:o,onRetry:l})=>{const{t:a}=ee(),h=ft(k=>k.modelsMetadata),[c,g]=u.useState(void 0),[m,p]=u.useState(!1),f=n==="context-too-small"||n==="structured-output-unsupported"||n==="output-exhausted";u.useEffect(()=>{if(!f||c!==void 0)return;let k=!1;return(async()=>{try{const x=await wt("/api/small-model",{method:"GET",headers:{Accept:"application/json"}});if(!x.ok)return;const M=await x.json().catch(()=>null);!k&&Array.isArray(M?.authenticatedProviders)&&g(M.authenticatedProviders.filter(I=>typeof I=="string"))}catch{}})(),()=>{k=!0}},[f,c]);const i=u.useCallback(async(k,x)=>{if(!k||!x||m)return;const M=`${k}/${x}`;p(!0);try{await bs({walkthroughModelOverride:M}),l()}catch(I){console.warn("Failed to save small model override:",I)}finally{p(!1)}},[l,m]),w=u.useCallback((k,x)=>h.get(`${k}/${x}`)?.structured_output!==!1,[h]),b=Is(t),v=()=>{if(n==="no-model")return a("walkthrough.blocked.noModel.description");if(n==="empty-diff")return a("walkthrough.blocked.emptyDiff.description");if(n==="only-generated")return a("walkthrough.blocked.onlyGenerated.description");if(n==="server-unsupported")return a("walkthrough.blocked.serverUnsupported.description");if(n==="output-exhausted")return b?a("walkthrough.blocked.outputExhausted.description",{model:b}):a("walkthrough.blocked.outputExhausted.descriptionUnknownModel");if(n==="structured-output-unsupported")return b?a("walkthrough.blocked.structuredOutput.description",{model:b}):a("walkthrough.blocked.structuredOutput.descriptionUnknownModel");const k=Math.ceil((e??0)/1e3),x=Math.ceil((o??0)/1e3);return b?a("walkthrough.blocked.contextTooSmall.description",{model:b,required:k,available:x}):a("walkthrough.blocked.contextTooSmall.descriptionUnknownModel",{required:k,available:x})},y=()=>a(n==="no-model"?"walkthrough.blocked.noModel.title":n==="empty-diff"?"walkthrough.blocked.emptyDiff.title":n==="only-generated"?"walkthrough.blocked.onlyGenerated.title":n==="server-unsupported"?"walkthrough.blocked.serverUnsupported.title":n==="output-exhausted"?"walkthrough.blocked.outputExhausted.title":n==="structured-output-unsupported"?"walkthrough.blocked.structuredOutput.title":"walkthrough.blocked.contextTooSmall.title");return s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center",children:[s.jsx(j,{name:n==="empty-diff"||n==="only-generated"?"information":"error-warning",className:"size-6 text-muted-foreground"}),s.jsx("h3",{className:"typography-ui-label font-semibold text-foreground",children:y()}),s.jsx("p",{className:"typography-meta max-w-md text-muted-foreground",children:v()}),f&&s.jsxs("div",{className:"flex flex-col items-center gap-2 pt-2",children:[s.jsx("span",{className:"typography-micro text-muted-foreground",children:a("walkthrough.blocked.chooseModel")}),s.jsx(xt,{providerId:t?.providerID??"",modelId:t?.modelID??"",onChange:(k,x)=>{i(k,x)},allowedProviderIds:c??[],isModelAllowed:w})]}),(n==="empty-diff"||n==="only-generated"||n==="server-unsupported")&&s.jsx(B,{type:"button",variant:"outline",size:"sm",onClick:l,children:a("walkthrough.action.refresh")})]})},Ps=[{labelKey:"walkthrough.stage.collecting"},{labelKey:"walkthrough.stage.asking"},{labelKey:"walkthrough.stage.assembling"}],Es=n=>{const t=G.c(6),{progress:e}=n,{t:o}=ee(),{completedCount:l,activeIndex:a}=e;let h;t[0]!==a||t[1]!==l||t[2]!==o?(h=Ps.map((g,m)=>{const p=m<l,f=a===m;return s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:p?s.jsx(j,{name:"check",className:"size-3.5 text-status-success"}):f?s.jsx(j,{name:"loader-4",className:"size-3.5 animate-spin text-[var(--status-info)]"}):s.jsx("span",{className:"size-1.5 rounded-full bg-surface-muted"})}),s.jsx("span",{className:J("typography-meta",f?"text-foreground":p?"text-muted-foreground":"text-muted-foreground/60"),children:o(g.labelKey)})]},g.labelKey)}),t[0]=a,t[1]=l,t[2]=o,t[3]=h):h=t[3];let c;return t[4]!==h?(c=s.jsx("ul",{className:"flex flex-col gap-2 text-left",children:h}),t[4]=h,t[5]=c):c=t[5],c},ae=["collecting","asking","assembling"],Oe=450,As=n=>n==="retrying"?ae.indexOf("asking"):n?ae.indexOf(n):-1,zs=(n,t)=>Math.min(n+1,t),Os=(n,t)=>{const e=G.c(17),[o,l]=u.useState(-1),a=u.useRef(0);let h;e[0]!==t||e[1]!==o||e[2]!==n?(h=t?Math.max(As(n),0):o<0?-1:ae.length,e[0]=t,e[1]=o,e[2]=n,e[3]=h):h=e[3];const c=h;let g,m;e[4]!==t||e[5]!==o||e[6]!==c?(g=()=>{if(c<=o){c<o&&t&&(l(c),a.current=Date.now());return}const k=Date.now()-a.current,x=()=>{a.current=Date.now(),l(I=>zs(I,c))};if(o<0||k>=Oe){x();return}const M=setTimeout(x,Oe-k);return()=>clearTimeout(M)},m=[t,o,c],e[4]=t,e[5]=o,e[6]=c,e[7]=g,e[8]=m):(g=e[7],m=e[8]),u.useEffect(g,m);let p,f;e[9]!==t||e[10]!==o?(p=()=>{if(t||o<ae.length)return;const k=setTimeout(()=>l(-1),Oe);return()=>clearTimeout(k)},f=[t,o],e[9]=t,e[10]=o,e[11]=p,e[12]=f):(p=e[11],f=e[12]),u.useEffect(p,f);const i=o>=ae.length,w=Math.max(0,Math.min(o,ae.length)),b=i||o<0?null:o,v=!t&&o>=0;let y;return e[13]!==w||e[14]!==b||e[15]!==v?(y={completedCount:w,activeIndex:b,holding:v},e[13]=w,e[14]=b,e[15]=v,e[16]=y):y=e[16],y},jt=u.memo(function(t){const e=G.c(11),{path:o,hunks:l,renderSideBySide:a,wrapLines:h}=t;let c;if(e[0]!==l||e[1]!==o){const f=Ms(l);c=f?ps(o,f):void 0,e[0]=l,e[1]=o,e[2]=c}else c=e[2];const g=c;if(!g)return null;let m;e[3]!==o?(m=rs(o)||"",e[3]=o,e[4]=m):m=e[4];let p;return e[5]!==g||e[6]!==o||e[7]!==a||e[8]!==m||e[9]!==h?(p=s.jsx(js,{original:"",modified:"",fileDiff:g,language:m,fileName:o,renderSideBySide:a,wrapLines:h,layout:"inline"}),e[5]=g,e[6]=o,e[7]=a,e[8]=m,e[9]=h,e[10]=p):p=e[10],p}),He=n=>`walkthrough-stop-${n}`,Hs={critical:"border border-[var(--interactive-border)] font-medium text-foreground",normal:"bg-surface-muted text-muted-foreground",context:"bg-surface-muted text-muted-foreground"},Ls=n=>{const t=G.c(22),{stopView:e}=n,{t:o}=ee(),{stop:l}=e;let a;t[0]!==e.position?(a=s.jsx("span",{className:"typography-micro flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full bg-surface-muted px-1.5 tabular-nums text-muted-foreground",children:e.position}),t[0]=e.position,t[1]=a):a=t[1];let h;t[2]!==l.title?(h=s.jsx("h3",{className:"typography-ui-label font-semibold text-foreground",children:l.title}),t[2]=l.title,t[3]=h):h=t[3];let c;t[4]!==l.importance||t[5]!==o?(c=l.importance!=="normal"&&s.jsxs(kt,{children:[s.jsx(bt,{className:J("typography-micro flex h-5 items-center rounded px-1.5 leading-none",Hs[l.importance]),children:l.importance==="critical"?o("walkthrough.importance.critical"):o("walkthrough.importance.context")}),s.jsx(vt,{className:"max-w-64",children:s.jsx("p",{className:"typography-micro leading-tight",children:l.importance==="critical"?o("walkthrough.importance.criticalHint"):o("walkthrough.importance.contextHint")})})]}),t[4]=l.importance,t[5]=o,t[6]=c):c=t[6];let g;t[7]!==a||t[8]!==h||t[9]!==c?(g=s.jsxs("div",{className:"flex items-center gap-2",children:[a,h,c]}),t[7]=a,t[8]=h,t[9]=c,t[10]=g):g=t[10];let m;t[11]!==l.prose?(m=s.jsx("p",{className:"typography-body text-muted-foreground",children:l.prose}),t[11]=l.prose,t[12]=m):m=t[12];let p;t[13]!==e.hunks||t[14]!==e.isStale||t[15]!==e.missingHunkIds||t[16]!==o?(p=e.isStale&&s.jsxs("p",{className:"typography-meta flex items-center gap-1.5 text-status-warning",children:[s.jsx(j,{name:"error-warning",className:"size-3.5 shrink-0"}),e.hunks.length===0?o("walkthrough.stop.staleAll"):o("walkthrough.stop.stalePartial",{count:e.missingHunkIds.length})]}),t[13]=e.hunks,t[14]=e.isStale,t[15]=e.missingHunkIds,t[16]=o,t[17]=p):p=t[17];let f;return t[18]!==g||t[19]!==m||t[20]!==p?(f=s.jsxs("header",{className:"flex flex-col gap-2 px-4 pt-5 pb-3",children:[g,m,p]}),t[18]=g,t[19]=m,t[20]=p,t[21]=f):f=t[21],f},St=n=>{const t=G.c(2),{path:e}=n;let o;return t[0]!==e?(o=s.jsxs("div",{className:"sticky top-0 z-10 flex items-center gap-1.5 border-b border-[var(--interactive-border)]/35 bg-[var(--surface-elevated)]/90 px-4 py-1.5 backdrop-blur-md supports-[backdrop-filter]:bg-[var(--surface-elevated)]/80",children:[s.jsx(ns,{filePath:e,className:"size-3.5 shrink-0"}),s.jsx("span",{className:"typography-meta truncate font-mono text-foreground",children:e})]}),t[0]=e,t[1]=o):o=t[1],o},Ds=n=>{const t=G.c(11),{hunks:e,renderSideBySide:o,wrapLines:l}=n;let a;t[0]!==e?(a=yt(e),t[0]=e,t[1]=a):a=t[1];const h=a;let c;if(t[2]!==o||t[3]!==h||t[4]!==l){let m;t[6]!==o||t[7]!==l?(m=(p,f)=>s.jsxs("div",{children:[s.jsx(St,{path:p.path}),s.jsx(jt,{path:p.path,hunks:p.hunks,renderSideBySide:o,wrapLines:l})]},`${p.path}-${f}`),t[6]=o,t[7]=l,t[8]=m):m=t[8],c=h.map(m),t[2]=o,t[3]=h,t[4]=l,t[5]=c}else c=t[5];let g;return t[9]!==c?(g=s.jsx(s.Fragment,{children:c}),t[9]=c,t[10]=g):g=t[10],g},Bs=u.memo(function(t){const e=G.c(35),{view:o,activeStopId:l,scrollToStopId:a,onActiveStopChange:h,onScrollHandled:c,renderSideBySide:g,wrapLines:m}=t,{t:p}=ee(),f=u.useRef(null),[i,w]=u.useState(!1),b=u.useRef(null),v=u.useRef(null);let y,k;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=()=>()=>{v.current!==null&&window.clearTimeout(v.current)},k=[],e[0]=y,e[1]=k):(y=e[0],k=e[1]),u.useEffect(y,k);let x,M;e[2]!==c||e[3]!==a?(x=()=>{if(!a)return;const R=document.getElementById(He(a));R&&(b.current=a,R.scrollIntoView({behavior:"auto",block:"start"}),v.current!==null&&window.clearTimeout(v.current),v.current=window.setTimeout(()=>{b.current=null,v.current=null},250)),c()},M=[a,c],e[2]=c,e[3]=a,e[4]=x,e[5]=M):(x=e[4],M=e[5]),u.useEffect(x,M);let I;e[6]!==h?(I=R=>{const T=R.filter(Ws).sort($s)[0];if(!T)return;const q=T.target.getAttribute("data-stop-id");if(!q)return;const X=b.current;if(X){q===X&&(b.current=null);return}h(q)},e[6]=h,e[7]=I):I=e[7];const te=I;let W,se;e[8]!==te||e[9]!==o.stops?(W=()=>{const R=f.current;if(!R)return;const T=new IntersectionObserver(te,{root:R,rootMargin:"0px 0px -70% 0px",threshold:0});for(const q of o.stops){const X=document.getElementById(He(q.stop.id));X&&T.observe(X)}return()=>T.disconnect()},se=[te,o.stops],e[8]=te,e[9]=o.stops,e[10]=W,e[11]=se):(W=e[10],se=e[11]),u.useEffect(W,se);let O;e[12]!==o.uncoveredHunks?(O=yt(o.uncoveredHunks),e[12]=o.uncoveredHunks,e[13]=O):O=e[13];const z=O;let H;if(e[14]!==l||e[15]!==g||e[16]!==p||e[17]!==o.stops||e[18]!==m){let R;e[20]!==l||e[21]!==g||e[22]!==p||e[23]!==m?(R=T=>s.jsxs("section",{id:He(T.stop.id),"data-stop-id":T.stop.id,className:J("border-b border-border/60",l===T.stop.id&&"bg-interactive-selection/5"),children:[s.jsx(Ls,{stopView:T}),T.hunks.length>0?s.jsx(Ds,{hunks:T.hunks,renderSideBySide:g,wrapLines:m}):s.jsx("p",{className:"typography-meta px-4 pb-4 text-muted-foreground",children:p("walkthrough.stop.noCode")})]},T.stop.id),e[20]=l,e[21]=g,e[22]=p,e[23]=m,e[24]=R):R=e[24],H=o.stops.map(R),e[14]=l,e[15]=g,e[16]=p,e[17]=o.stops,e[18]=m,e[19]=H}else H=e[19];let $;e[25]!==g||e[26]!==p||e[27]!==i||e[28]!==z||e[29]!==o.uncoveredHunks.length||e[30]!==m?($=o.uncoveredHunks.length>0&&s.jsxs("section",{className:"border-b border-border/60",children:[s.jsxs(B,{type:"button",variant:"ghost",className:"h-auto w-full justify-start gap-2 px-4 py-3",onClick:()=>w(Gs),"aria-expanded":i,children:[s.jsx(j,{name:i?"arrow-down-s":"arrow-right-s",className:"size-4 shrink-0"}),s.jsx("span",{className:"typography-ui-label text-muted-foreground",children:p("walkthrough.uncovered.title",{count:o.uncoveredHunks.length})})]}),!i&&s.jsx("p",{className:"typography-meta px-4 pb-3 pl-10 text-muted-foreground",children:p("walkthrough.uncovered.description")}),i&&z.map((R,T)=>s.jsxs("div",{children:[s.jsx(St,{path:R.path}),s.jsx(jt,{path:R.path,hunks:R.hunks,renderSideBySide:g,wrapLines:m})]},`${R.path}-${T}`))]}),e[25]=g,e[26]=p,e[27]=i,e[28]=z,e[29]=o.uncoveredHunks.length,e[30]=m,e[31]=$):$=e[31];let oe;return e[32]!==$||e[33]!==H?(oe=s.jsxs("div",{ref:f,className:"min-h-0 flex-1 overflow-y-auto","data-diff-virtual-root":!0,"data-diff-virtual-content":!0,children:[H,$]}),e[32]=$,e[33]=H,e[34]=oe):oe=e[34],oe});function Ws(n){return n.isIntersecting}function $s(n,t){return n.boundingClientRect.top-t.boundingClientRect.top}function Gs(n){return!n}const qs={bug:"bug",wrench:"tools",path:"compass-3",flask:"flask",doc:"file-text",gear:"settings-3"},Fs=n=>{const t=G.c(30),{stopView:e,isActive:o,isVisited:l,onSelect:a,activeRef:h}=n,{t:c}=ee();let g;if(t[0]!==h||t[1]!==o||t[2]!==l||t[3]!==a||t[4]!==e.hunks||t[5]!==e.isStale||t[6]!==e.position||t[7]!==e.stop.title||t[8]!==c){const m=Rs(e.hunks),p=o&&"bg-interactive-selection text-interactive-selection-foreground";let f;t[10]!==p?(f=J("flex w-full flex-col gap-1 rounded px-2 py-1.5 text-left transition-colors","hover:bg-interactive-hover",p),t[10]=p,t[11]=f):f=t[11];const i=o?"bg-interactive-selection-foreground/20":l?"bg-status-success/15 text-status-success":"bg-surface-muted text-muted-foreground";let w;t[12]!==i?(w=J("typography-micro flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full px-1 tabular-nums",i),t[12]=i,t[13]=w):w=t[13];let b;t[14]!==o||t[15]!==l||t[16]!==e.position?(b=l&&!o?s.jsx(j,{name:"check",className:"size-2.5"}):e.position,t[14]=o,t[15]=l,t[16]=e.position,t[17]=b):b=t[17];let v;t[18]!==w||t[19]!==b?(v=s.jsx("span",{className:w,children:b}),t[18]=w,t[19]=b,t[20]=v):v=t[20];let y;t[21]!==e.stop.title?(y=s.jsx("span",{className:"typography-meta truncate font-medium",children:e.stop.title}),t[21]=e.stop.title,t[22]=y):y=t[22];let k;t[23]!==e.isStale||t[24]!==c?(k=e.isStale&&s.jsx(j,{name:"error-warning",className:"size-3 shrink-0 text-status-warning","aria-label":c("walkthrough.stop.staleShort")}),t[23]=e.isStale,t[24]=c,t[25]=k):k=t[25];let x;t[26]!==v||t[27]!==y||t[28]!==k?(x=s.jsxs("span",{className:"flex items-center gap-2",children:[v,y,k]}),t[26]=v,t[27]=y,t[28]=k,t[29]=x):x=t[29],g=s.jsx("li",{children:s.jsxs("button",{ref:o?h:void 0,type:"button",onClick:a,"aria-current":o?"step":void 0,className:f,children:[x,m.length>0&&s.jsxs("span",{className:"typography-micro flex flex-col gap-0.5 pl-6 text-muted-foreground",children:[m.slice(0,3).map(_s),m.length>3&&s.jsx("span",{children:c("walkthrough.toc.moreFiles",{count:m.length-3})})]})]})}),t[0]=h,t[1]=o,t[2]=l,t[3]=a,t[4]=e.hunks,t[5]=e.isStale,t[6]=e.position,t[7]=e.stop.title,t[8]=c,t[9]=g}else g=t[9];return g},Us=u.memo(function(t){const e=G.c(20),{view:o,activeStopId:l,visitedStopIds:a,onSelectStop:h,width:c}=t,{t:g}=ee(),m=u.useRef(null);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{m.current?.scrollIntoView({block:"nearest"})},e[0]=p):p=e[0];let f;e[1]!==l?(f=[l],e[1]=l,e[2]=f):f=e[2],u.useEffect(p,f);let i;e[3]!==c?(i={width:c},e[3]=c,e[4]=i):i=e[4];let w;e[5]!==o.walkthrough.focus?(w=o.walkthrough.focus&&s.jsx("p",{className:"typography-meta px-2 pb-3 pt-1 text-muted-foreground",children:o.walkthrough.focus}),e[5]=o.walkthrough.focus,e[6]=w):w=e[6];let b;e[7]!==l||e[8]!==h||e[9]!==o.chapters||e[10]!==a?(b=o.chapters.map(k=>{const{chapter:x,stops:M}=k;return s.jsxs("section",{className:"pb-3",children:[s.jsxs("h4",{className:"typography-micro flex items-center gap-1.5 px-2 py-1 font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(j,{name:qs[x.icon]??"file-text",className:"size-3 shrink-0"}),s.jsx("span",{className:"truncate",children:x.title})]}),s.jsx("ul",{className:"flex flex-col gap-0.5",children:M.map(I=>s.jsx(Fs,{stopView:I,isActive:l===I.stop.id,isVisited:a.has(I.stop.id),onSelect:()=>h(I.stop.id),activeRef:m},I.stop.id))})]},x.id)}),e[7]=l,e[8]=h,e[9]=o.chapters,e[10]=a,e[11]=b):b=e[11];let v;e[12]!==g||e[13]!==o.uncoveredHunks.length?(v=o.uncoveredHunks.length>0&&s.jsx("p",{className:"typography-micro mt-auto px-2 pt-3 text-muted-foreground",children:g("walkthrough.toc.uncovered",{count:o.uncoveredHunks.length})}),e[12]=g,e[13]=o.uncoveredHunks.length,e[14]=v):v=e[14];let y;return e[15]!==i||e[16]!==w||e[17]!==b||e[18]!==v?(y=s.jsxs("nav",{className:"flex shrink-0 flex-col overflow-y-auto border-r border-border/60 p-2",style:i,children:[w,b,v]}),e[15]=i,e[16]=w,e[17]=b,e[18]=v,e[19]=y):y=e[19],y});function _s(n){return s.jsx("span",{className:"truncate font-mono",children:n.path},n.path)}const Ks=["all","staged","working"],Vs="https://docs.openchamber.dev/walkthrough/",mt="typography-meta font-normal text-muted-foreground",gt=720,ne=180,Le=.5,Js=680,xn=({directory:n,visible:t=!0})=>{const{t:e,locale:o,locales:l,label:a}=ee(),h=u.useRef(null),[c,g]=u.useState(0),{rootIsGitRepo:m,gitDirectory:p,nestedRepos:f}=as(n||null,{enabled:t}),i=p??n;u.useEffect(()=>{const r=h.current;if(!r||typeof ResizeObserver>"u")return;const N=new ResizeObserver(A=>{g(A[0]?.contentRect.width??0)});return N.observe(r),()=>N.disconnect()},[]);const w=me(r=>r.walkthroughTocWidth),b=me(r=>r.setWalkthroughTocWidth),[v,y]=u.useState(!1),k=c===0||c>=gt,x=c>0&&c<Js,M=Math.min(Math.max(w,ne),Math.max(ne,(c||gt)*Le)),I=u.useCallback(r=>{r.preventDefault();const N=r.clientX,A=M,Z=Math.max(ne,(h.current?.clientWidth??0)*Le);y(!0);const at=ss=>{const os=Math.min(Z,Math.max(ne,A+ss.clientX-N));b(os)},be=()=>{y(!1),window.removeEventListener("pointermove",at),window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",be)};window.addEventListener("pointermove",at),window.addEventListener("pointerup",be),window.addEventListener("pointercancel",be)},[b,M]),te=u.useCallback(r=>{const N=r.shiftKey?40:10,A=r.key==="ArrowLeft"?-N:r.key==="ArrowRight"?N:0;if(A===0)return;r.preventDefault();const Z=Math.max(ne,(h.current?.clientWidth??0)*Le);b(Math.min(Z,Math.max(ne,M+A)))},[b,M]),[W,se]=u.useState("all"),[O,z]=u.useState(null),[H,$]=u.useState(null),[oe,R]=u.useState(null),[T,q]=u.useState(()=>new Set),X=me(r=>r.diffLayoutPreference),Nt=me(r=>r.diffWrapLines),Ct=X==="side-by-side",P=L(r=>r.requestedSource[i]),ie=L(r=>r.clearRequestedSource),Rt=me(r=>r.openContextPanelTab),Mt=is(i||null),ge=ve(r=>r.runtimeKey),[It,Tt]=u.useState(0);u.useEffect(()=>vs(r=>{r===ws(i,ge)&&Tt(N=>N+1)}),[i,ge]);const Pt=ls(i||null),Et=hs(r=>r.setOverride),De=ve(r=>r.ensureAll),{git:Be}=cs();u.useEffect(()=>{t&&i&&De(i,Be)},[i,De,Be,t]);const E=Mt?.current??null,fe=O?.directory===i&&O.kind==="commit"&&!P,Q=fe||P?.kind==="commit",F=ms(i||null,E,t&&Q,P?.kind==="commit"?P.hash:void 0),U=F.selectedCommit?.hash??(P?.kind==="commit"?P.hash:null),{base:le,resolved:At,revision:zt}=gs(i||null,E,t),_=u.useMemo(()=>!E||!le||le===E?null:{kind:"branch",baseRef:le,headRef:E},[le,E]),we=O?.directory===i&&O.kind==="pr"&&!P,K=we||P?.kind==="pr",re=fs(i||null,E,t&&K,P?.kind==="pr"?P:void 0),V=re.selectedSource,C=u.useMemo(()=>K&&V?V:Q&&U?{kind:"commit",hash:U}:P?.kind==="branch"?_??P:P??{kind:"working-tree",scope:W},[_,Q,K,P,W,U,V]),xe=O?.directory===i&&O.kind==="branch"&&!P,ye=xe||C.kind==="branch",We=xe||C.kind==="branch"&&!_,$e=fe||Q&&!U,Ge=K&&!V,ce=We||$e||Ge,Ot=u.useCallback(r=>{z(null),ie(i),se(r)},[ie,i]),d=L(r=>r.getEntry(i,C)),je=L(r=>r.load),qe=L(r=>r.generate),Ht=L(r=>r.cancel),Y=L(r=>r.requestSource);u.useEffect(()=>{!we||!V||(Y(i,V),z(null))},[we,i,Y,V]),u.useEffect(()=>{!xe||!_||(Y(i,_),z(null))},[_,xe,i,Y]),u.useEffect(()=>{!fe||!U||(Y(i,{kind:"commit",hash:U}),z(null))},[fe,i,Y,U]);const Lt=L(r=>r.selectModel),ue=L(r=>r.getSelectedModel(i,C)),Dt=L(r=>r.selectLanguage),Se=L(r=>r.getSelectedLanguage(i,C)),Ne=d.result?.language,D=Se&&l.includes(Se)?Se:Ne&&l.includes(Ne)?Ne:o,Bt=C.kind==="branch"?zt:"",Fe=C.kind==="pr"?It:0,Ue=u.useRef(null);u.useEffect(()=>{if(!(!t||ce)){if(C.kind==="pr"){const r=JSON.stringify([ge,i,C,D,ue,Fe]);if(Ue.current===r)return;Ue.current=r}je(i,C,{language:D})}},[D,ce,i,je,C,ue,Bt,t,ge,Fe]);const S=u.useMemo(()=>ce?null:Cs(d.result),[ce,d.result]),Ce=d.result?.generatedAt,_e=u.useRef(void 0);u.useEffect(()=>{_e.current!==Ce&&(_e.current=Ce,q(new Set),$(S?.stops[0]?.stop.id??null))},[Ce,S]);const Re=u.useCallback(r=>{$(r),q(N=>{if(N.has(r))return N;const A=new Set(N);return A.add(r),A})},[]),Me=u.useCallback(r=>{Re(r),R(r)},[Re]),Ke=u.useCallback(r=>{if(!S||S.stops.length===0)return;const N=S.stops.findIndex(Z=>Z.stop.id===H),A=Math.min(S.stops.length-1,Math.max(0,(N<0?0:N)+r));Me(S.stops[A].stop.id)},[H,Me,S]),[Wt,Ve]=u.useState(!1),[$t,Je]=u.useState(!1),Gt=K?"pr":Q?"commit":ye?"branch":C.kind==="working-tree"?C.scope:C.kind,qt=K?e("session.githubIntegration.tabs.pullRequests"):Q?e("commitComparison.mode"):ye?e("walkthrough.scope.branch"):C.kind==="pr"?e("walkthrough.scope.pullRequest",{number:C.number}):e(W==="all"?"walkthrough.scope.all":W==="staged"?"walkthrough.scope.staged":"walkthrough.scope.working"),Xe=ft(r=>r.modelsMetadata),[de,Ft]=u.useState(void 0),Ie=r=>!r||de===void 0?!1:de.includes(r),Ut=d.readiness?.model&&d.readiness.model.hasLogin!==!1&&Ie(d.readiness.model.providerID)?`${d.readiness.model.providerID}/${d.readiness.model.modelID}`:void 0,_t=d.result?.model&&Ie(d.result.model.providerID)?`${d.result.model.providerID}/${d.result.model.modelID}`:void 0,ke=(ue&&Ie(ue.split("/")[0])?ue:void 0)??_t??Ut,[Kt,...Vt]=(ke??"").split("/"),Qe=Vt.join("/");u.useEffect(()=>{if(de!==void 0)return;let r=!1;return(async()=>{try{const N=await wt("/api/small-model",{method:"GET",headers:{Accept:"application/json"}});if(!N.ok)return;const A=await N.json().catch(()=>null);!r&&Array.isArray(A?.authenticatedProviders)&&Ft(A.authenticatedProviders.filter(Z=>typeof Z=="string"))}catch{}})(),()=>{r=!0}},[de]);const Jt=u.useCallback((r,N)=>Xe.get(`${r}/${N}`)?.structured_output!==!1,[Xe]),Ye=d.status==="generating",Ze=d.result?.model?`${d.result.model.providerID}/${d.result.model.modelID}`:void 0,Te=d.result?.language,Pe=Te&&l.includes(Te)?Te:void 0,et=d.status==="ready"&&!!S,Ee=et&&!!Pe&&Pe!==D,tt=et&&!!Ze&&!!ke&&Ze!==ke,st=Os(d.stage,d.status==="generating"),ot=u.useRef(!1),rt=u.useRef(d.status);u.useEffect(()=>{rt.current!=="generating"&&d.status==="generating"&&(ot.current=!S),rt.current=d.status},[d.status,S]);const Xt=ot.current&&(d.status==="generating"||st.holding),Ae=d.error?.code==="context-too-small"||d.error?.code==="structured-output-unsupported"||d.error?.code==="no-model"||d.error?.code==="empty-diff"||d.error?.code==="only-generated"||d.error?.code==="output-exhausted"||d.error?.code==="server-unsupported"?d.error.code:d.readiness&&!d.readiness.ready&&!S&&d.readiness.reason!=="no-provider-login"?d.readiness.reason:void 0,Qt=d.error?.model??d.readiness?.model,Yt=d.error?.requiredChars??d.readiness?.requiredChars,Zt=d.error?.availableChars??d.readiness?.availableChars,pe=ce||!ke||!!(d.readiness&&!d.readiness.ready),ze=u.useCallback(r=>{pe||qe(i,C,{force:r,language:D})},[D,i,qe,pe,C]),nt=us(p||null),es=ve(r=>r.ensureNestedRepos),ts=ve(r=>r.selectNestedRepo);return m===!1&&nt!==!0?s.jsx(Ss,{rootIsGitRepo:m,resolvedIsGitRepo:nt,nestedRepos:f,onRetryDiscovery:()=>{n&&es(n,{force:!0})}}):s.jsxs("div",{ref:h,className:"flex h-full min-h-0 flex-col",children:[s.jsxs("header",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-border/60 px-3 py-2",children:[m===!1&&Array.isArray(f)&&f.length>0?s.jsx(Ns,{repositories:f,selectedRepository:p??null,onSelectRepository:r=>{n&&ts(n,r)},repositoryRoot:n??void 0}):null,s.jsxs(it,{open:Wt,onOpenChange:Ve,children:[s.jsx(lt,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex h-8 flex-shrink-0 items-center gap-1.5 rounded-md px-2 typography-ui-label font-semibold text-foreground outline-none hover:bg-interactive-hover focus-visible:ring-2 focus-visible:ring-ring","aria-label":e("walkthrough.scope.selectorAria"),children:[s.jsx("span",{className:"whitespace-nowrap",children:qt}),s.jsx(j,{name:"arrow-down-s",className:"size-4 flex-shrink-0 opacity-60"})]})}),s.jsx(ct,{align:"start",className:"w-48",children:s.jsxs(ut,{value:Gt,onValueChange:r=>{if(Ve(!1),r==="commit"){ie(i),z({directory:i,kind:"commit"});return}if(r==="branch"){_?(z(null),Y(i,_)):(ie(i),z({directory:i,kind:"branch"}));return}if(r==="pr"){ie(i),z({directory:i,kind:"pr"});return}Ot(r)},children:[s.jsx(dt,{className:mt,children:e("walkthrough.scope.group.workingTree")}),Ks.map(r=>s.jsx(he,{value:r,children:e(r==="all"?"walkthrough.scope.all":r==="staged"?"walkthrough.scope.staged":"walkthrough.scope.working")},r)),E&&s.jsxs(s.Fragment,{children:[s.jsx(pt,{}),s.jsx(he,{value:"branch",children:e("walkthrough.scope.branch")})]}),s.jsx(pt,{}),s.jsx(he,{value:"commit",children:e("commitComparison.mode")}),s.jsx(he,{value:"pr",children:e("session.githubIntegration.tabs.pullRequests")})]})})]}),ye&&s.jsx(xs,{branches:Pt?.all??[],currentBranch:E,base:le,onSelect:r=>{i&&E&&Et(i,E,r)}},JSON.stringify([i,E])),Q&&s.jsx(ks,{commits:F.commits,selectedHash:U,loading:F.loading,error:F.error,onSelect:F.select,onRefresh:()=>{F.refresh()}},JSON.stringify([i,E])),K&&s.jsx(ht,{comparison:re},JSON.stringify([i,E])),s.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-1",children:[K&&V&&s.jsxs(B,{variant:"ghost",size:"sm","aria-label":e("contextPanel.mode.diff"),title:e("contextPanel.mode.diff"),onClick:()=>Rt(n,{mode:"diff",diffScope:"pr"}),children:[s.jsx(j,{name:"arrow-left-right",className:"size-4"}),!x&&e("contextPanel.mode.diff")]}),s.jsxs(kt,{children:[s.jsx(bt,{asChild:!0,children:s.jsx(B,{type:"button",variant:"ghost",size:"sm","aria-label":e("walkthrough.help.guide"),onClick:()=>{ds(Vs)},children:s.jsx(j,{name:"question",className:"size-4"})})}),s.jsx(vt,{children:s.jsx("p",{className:"typography-micro leading-tight",children:e("walkthrough.help.guide")})})]}),s.jsxs(it,{open:$t,onOpenChange:Je,children:[s.jsx(lt,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex h-8 min-w-0 flex-shrink items-center gap-1.5 rounded-md px-2 typography-ui-label text-muted-foreground outline-none hover:bg-interactive-hover hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring","aria-label":e("walkthrough.language.selectorAria"),title:x?a(D):void 0,children:[s.jsx(j,{name:"global",className:"size-4 flex-shrink-0 opacity-70"}),!x&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate",children:a(D)}),s.jsx(j,{name:"arrow-down-s",className:"size-4 flex-shrink-0 opacity-60"})]})]})}),s.jsxs(ct,{align:"end",className:"w-48",children:[s.jsx(dt,{className:mt,children:e("walkthrough.language.menuLabel")}),s.jsx(ut,{value:D,onValueChange:r=>{Je(!1),Dt(i,C,r)},children:l.map(r=>s.jsx(he,{value:r,children:a(r)},r))})]})]}),s.jsx(xt,{providerId:Kt??"",modelId:Qe,onChange:(r,N)=>{Lt(i,C,r&&N?`${r}/${N}`:null)},allowedProviderIds:de??[],isModelAllowed:Jt,tooltipsEnabled:!1,dropdownPortalToBody:!0,compact:x,className:J("h-8 min-w-0",!x&&"max-w-48")}),S&&s.jsxs(s.Fragment,{children:[s.jsx(B,{type:"button",variant:"ghost",size:"sm","aria-label":e("walkthrough.action.previous"),onClick:()=>Ke(-1),children:s.jsx(j,{name:"arrow-right-s",className:"size-4 rotate-180"})}),s.jsx(B,{type:"button",variant:"ghost",size:"sm","aria-label":e("walkthrough.action.next"),onClick:()=>Ke(1),children:s.jsx(j,{name:"arrow-right-s",className:"size-4"})})]}),Ye?s.jsx(B,{type:"button",variant:"outline",size:"sm","aria-label":x?e("walkthrough.action.cancel"):void 0,title:x?e("walkthrough.action.cancel"):void 0,onClick:()=>Ht(i,C),children:x?s.jsx(j,{name:"stop",className:"size-3.5"}):e("walkthrough.action.cancel")}):s.jsxs(B,{type:"button",variant:"outline",size:"sm",className:pe?"border-border text-muted-foreground":ys,disabled:pe,"aria-label":x?e(S?"walkthrough.action.regenerate":"walkthrough.action.generate"):void 0,title:x?e(S?"walkthrough.action.regenerate":"walkthrough.action.generate"):void 0,onClick:()=>ze(!!S),children:[s.jsx(j,{name:S?"refresh":"route",className:"size-3.5"}),!x&&e(S?"walkthrough.action.regenerate":"walkthrough.action.generate")]})]})]}),d.status==="generating"&&S&&s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border/60 bg-[var(--status-info-background)] px-3 py-2",children:[s.jsx(j,{name:"loader-4",className:"size-4 shrink-0 animate-spin text-[var(--status-info)]"}),s.jsx("span",{className:"typography-meta text-foreground",children:d.stage==="collecting"?e("walkthrough.stage.collecting"):d.stage==="assembling"?e("walkthrough.stage.assembling"):e("walkthrough.stage.asking")})]}),(Ee||tt)&&s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border/60 bg-[var(--status-info-background)] px-3 py-2",children:[s.jsx(j,{name:"information",className:"size-4 shrink-0 text-[var(--status-info)]"}),s.jsx("span",{className:"typography-meta text-foreground",children:Ee&&tt?e("walkthrough.missing.languageAndModel"):Ee?e("walkthrough.missing.language",{requested:a(D),shown:a(Pe)}):e("walkthrough.missing.model",{model:Qe})}),s.jsx(B,{type:"button",variant:"ghost",size:"xs",className:"ml-auto",disabled:pe,onClick:()=>ze(!1),children:e("walkthrough.action.generate")})]}),S?.isStale&&d.status!=="generating"&&s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border/60 bg-status-warning/10 px-3 py-2",children:[s.jsx(j,{name:"error-warning",className:"size-4 shrink-0 text-status-warning"}),s.jsx("span",{className:"typography-meta text-foreground",children:e("walkthrough.stale.banner",{count:S.staleStopCount})}),s.jsx(B,{type:"button",variant:"ghost",size:"xs",className:"ml-auto",disabled:Ye,onClick:()=>ze(!0),children:e("walkthrough.action.regenerate")})]}),d.error&&!Ae&&d.error.code!=="no-provider-login"&&s.jsxs("div",{className:"flex shrink-0 items-start gap-2 border-b border-border/60 bg-status-error/10 px-3 py-2",children:[s.jsx(j,{name:"error-warning",className:"mt-0.5 size-4 shrink-0 text-status-error"}),s.jsx("span",{className:"typography-meta line-clamp-2 text-foreground",title:d.error.message,children:d.error.message})]}),s.jsx("div",{className:J("flex min-h-0 flex-1",k?"flex-row":"flex-col"),children:Ge?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center",children:[s.jsx("p",{className:"typography-meta text-muted-foreground",children:re.error??(re.loading?e("session.githubPrPicker.loading.pullRequests"):e("pullRequestComparison.select"))}),!re.loading&&s.jsx(ht,{comparison:re})]}):$e?s.jsx("div",{className:"flex flex-1 items-center justify-center gap-2 p-8 typography-meta text-muted-foreground",children:F.loading?s.jsx(j,{name:"loader-4",className:"size-6 animate-spin"}):F.error??e("commitComparison.noCommits")}):We?s.jsx("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center",children:!At&&E?s.jsx(j,{name:"loader-4",className:"size-6 animate-spin text-muted-foreground"}):s.jsx("p",{className:"typography-meta text-muted-foreground",children:e("gitView.pr.toast.baseBranchRequired")})}):Ae?s.jsx(Ts,{reason:Ae,model:Qt,requiredChars:Yt,availableChars:Zt,onRetry:()=>{je(i,C)}}):Xt?s.jsx("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8",children:s.jsx(Es,{progress:st})}):S?s.jsxs(s.Fragment,{children:[k&&s.jsxs(s.Fragment,{children:[s.jsx(Us,{view:S,activeStopId:H,visitedStopIds:T,onSelectStop:Me,width:M}),s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":e("walkthrough.toc.resize"),tabIndex:0,onPointerDown:I,onKeyDown:te,className:J("group relative w-1 shrink-0 cursor-col-resize","before:absolute before:inset-y-0 before:-left-1 before:-right-1 before:content-['']","hover:bg-interactive-selection focus-visible:bg-interactive-selection focus-visible:outline-none",v&&"bg-interactive-selection")})]}),s.jsx(Bs,{view:S,activeStopId:H,scrollToStopId:oe,onActiveStopChange:Re,onScrollHandled:()=>R(null),renderSideBySide:Ct,wrapLines:Nt})]}):s.jsx("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center",children:d.status==="loading"?s.jsx(j,{name:"loader-4",className:"size-6 animate-spin text-muted-foreground"}):s.jsxs(s.Fragment,{children:[s.jsx(j,{name:"route",className:"size-6 text-muted-foreground"}),s.jsx("h3",{className:"typography-ui-label font-semibold text-foreground",children:e("walkthrough.empty.title")}),s.jsx("p",{className:"typography-meta max-w-md text-muted-foreground",children:e("walkthrough.empty.description")})]})})})]})};export{xn as WalkthroughView};
|