@jetcrab/pi-desk 1.1.8-dev → 1.1.10

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.
Files changed (100) hide show
  1. package/docs/plugins.md +15 -1
  2. package/package.json +7 -7
  3. package/src/client/l2_biz/auth/l2-login-biz.ts +4 -1
  4. package/src/client/l2_biz/settings/hooks/l2-use-auth-settings.ts +18 -1
  5. package/src/client/l2_biz/settings/l2-auth-settings-biz.ts +18 -1
  6. package/src/client/l2_biz/settings/l2-auth-settings.tsx +19 -5
  7. package/src/client/l2_biz/workbench/file-workspace/l2-file-workspace-runtime.ts +144 -23
  8. package/src/client/l2_biz/workbench/file-workspace/l2-file-workspace-view.tsx +9 -5
  9. package/src/client/l2_biz/workbench/file-workspace/l2-project-file-browser.tsx +94 -5
  10. package/src/client/l2_biz/workbench/file-workspace/l2-project-preview-biz.ts +48 -0
  11. package/src/client/l2_biz/workbench/git-workspace/l2-git-workspace-runtime.ts +26 -8
  12. package/src/client/l2_biz/workbench/hooks/l2-workbench-chat-viewport.ts +70 -47
  13. package/src/client/l2_biz/workbench/l2-work-session-columns.tsx +1 -0
  14. package/src/client/l2_biz/workbench/l2-workbench-chat-view.tsx +18 -14
  15. package/src/client/l2_biz/workbench/l2-workbench.tsx +37 -6
  16. package/src/client/l3_modules/conversation/l3-conversation-messages.tsx +28 -9
  17. package/src/client/l3_modules/project-files/l3-project-file-browser.tsx +27 -15
  18. package/src/client/l3_modules/project-files/l3-project-file-runtime.ts +7 -0
  19. package/src/client/l4_foundation/ui/code/l4-code-preferences.ts +1 -1
  20. package/src/common/l2_biz/auth/l2-auth-contract.ts +14 -1
  21. package/src/common/l2_biz/auth/l2-auth-messages.ts +27 -10
  22. package/src/common/l3_modules/app-runtime/l3-app-runtime-contract.ts +4 -1
  23. package/src/common/l3_modules/conversation/l3-conversation-locale-messages.ts +4 -0
  24. package/src/common/l3_modules/project-files/l3-project-files-locale-messages.ts +8 -0
  25. package/src/common/l4_foundation/file/l4-project-preview-contract.ts +25 -0
  26. package/src/server/l1_entry/api/l1-auth-login-route.ts +20 -6
  27. package/src/server/l1_entry/api/l1-auth-settings-routes.ts +1 -1
  28. package/src/server/l1_entry/api/l1-project-route.ts +14 -5
  29. package/src/server/l1_entry/node/l1-server.ts +4 -7
  30. package/src/server/l2_biz/app-runtime/l2-app-runtime.ts +6 -1
  31. package/src/server/l2_biz/auth/l2-auth.ts +52 -2
  32. package/src/server/l2_biz/work-session/l2-work-session-chat-runtime.ts +28 -0
  33. package/src/server/l2_biz/work-session/l2-work-session-manage.ts +8 -0
  34. package/src/server/l3_modules/app-runtime/l3-app-notification-runtime.ts +48 -14
  35. package/src/server/l4_foundation/auth/l4-auth-config.ts +19 -3
  36. package/src/server/l4_foundation/pi/l4-pi-chat-worker.ts +2 -1
  37. package/src/server/l4_foundation/pi/l4-pi-global-runtime.js +3 -13
  38. package/src/server/l4_foundation/pi/l4-pi-session-plugin-runtime.ts +60 -0
  39. package/temp/build/pi-desk/release/.next/BUILD_ID +1 -1
  40. package/temp/build/pi-desk/release/.next/build-manifest.json +3 -3
  41. package/temp/build/pi-desk/release/.next/prerender-manifest.json +3 -3
  42. package/temp/build/pi-desk/release/.next/react-loadable-manifest.json +1 -1
  43. package/temp/build/pi-desk/release/.next/required-server-files.js +3 -3
  44. package/temp/build/pi-desk/release/.next/required-server-files.json +3 -3
  45. package/temp/build/pi-desk/release/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  46. package/temp/build/pi-desk/release/.next/server/app/_global-error.html +1 -1
  47. package/temp/build/pi-desk/release/.next/server/app/_global-error.rsc +1 -1
  48. package/temp/build/pi-desk/release/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  49. package/temp/build/pi-desk/release/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  50. package/temp/build/pi-desk/release/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  51. package/temp/build/pi-desk/release/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  52. package/temp/build/pi-desk/release/.next/server/app/api/auth/login/route.js +2 -4
  53. package/temp/build/pi-desk/release/.next/server/app/api/auth/logout/route.js +1 -1
  54. package/temp/build/pi-desk/release/.next/server/app/api/auth-settings/get/route.js +1 -1
  55. package/temp/build/pi-desk/release/.next/server/app/api/auth-settings/replace/route.js +1 -1
  56. package/temp/build/pi-desk/release/.next/server/app/api/health/route.js +1 -1
  57. package/temp/build/pi-desk/release/.next/server/app/api/project-files/reveal/route.js +1 -1
  58. package/temp/build/pi-desk/release/.next/server/app/login/page.js +1 -1
  59. package/temp/build/pi-desk/release/.next/server/app/login/page_client-reference-manifest.js +1 -1
  60. package/temp/build/pi-desk/release/.next/server/app/page.js +64 -64
  61. package/temp/build/pi-desk/release/.next/server/app/page_client-reference-manifest.js +1 -1
  62. package/temp/build/pi-desk/release/.next/server/chunks/23054.js +2 -2
  63. package/temp/build/pi-desk/release/.next/server/chunks/25406.js +7 -7
  64. package/temp/build/pi-desk/release/.next/server/chunks/35985.js +3 -3
  65. package/temp/build/pi-desk/release/.next/server/chunks/49900.js +4 -0
  66. package/temp/build/pi-desk/release/.next/server/chunks/5034.js +1 -0
  67. package/temp/build/pi-desk/release/.next/server/chunks/50520.js +1 -1
  68. package/temp/build/pi-desk/release/.next/server/chunks/61211.js +2 -0
  69. package/temp/build/pi-desk/release/.next/server/chunks/6917.js +1 -1
  70. package/temp/build/pi-desk/release/.next/server/chunks/77953.js +1 -0
  71. package/temp/build/pi-desk/release/.next/server/chunks/8584.js +1 -1
  72. package/temp/build/pi-desk/release/.next/server/chunks/92386.js +4 -4
  73. package/temp/build/pi-desk/release/.next/server/chunks/93049.js +1 -0
  74. package/temp/build/pi-desk/release/.next/server/chunks/94296.js +1 -1
  75. package/temp/build/pi-desk/release/.next/server/chunks/98227.js +3 -0
  76. package/temp/build/pi-desk/release/.next/server/instrumentation.js +1 -1
  77. package/temp/build/pi-desk/release/.next/server/middleware-build-manifest.js +1 -1
  78. package/temp/build/pi-desk/release/.next/server/middleware-react-loadable-manifest.js +1 -1
  79. package/temp/build/pi-desk/release/.next/server/pages/500.html +1 -1
  80. package/temp/build/pi-desk/release/.next/server/server-reference-manifest.json +1 -1
  81. package/temp/build/pi-desk/release/.next/static/chunks/45992-304a49aaaebd853e.js +13 -0
  82. package/temp/build/pi-desk/release/.next/static/chunks/{34903-e4205c0becabea76.js → 47340-c1c09c77c1a88514.js} +1 -1
  83. package/temp/build/pi-desk/release/.next/static/chunks/70669.07f3670bfb7d6dd2.js +1 -0
  84. package/temp/build/pi-desk/release/.next/static/chunks/app/{layout-586f6f88483051a7.js → layout-839162b6cfae8347.js} +1 -1
  85. package/temp/build/pi-desk/release/.next/static/chunks/app/login/page-4532a3bbee48e219.js +1 -0
  86. package/temp/build/pi-desk/release/.next/static/chunks/app/page-9f478658c50efdbe.js +158 -0
  87. package/temp/build/pi-desk/release/.next/static/chunks/{webpack-26261285e181235a.js → webpack-735430d61da52e9d.js} +1 -1
  88. package/temp/build/pi-desk/release/.next/static/css/8a41765636e09e52.css +1 -0
  89. package/temp/build/pi-desk/release/.next/trace-build +1 -1
  90. package/temp/build/pi-desk/release/.next/server/chunks/31442.js +0 -3
  91. package/temp/build/pi-desk/release/.next/server/chunks/37681.js +0 -1
  92. package/temp/build/pi-desk/release/.next/server/chunks/65589.js +0 -4
  93. package/temp/build/pi-desk/release/.next/server/chunks/99672.js +0 -1
  94. package/temp/build/pi-desk/release/.next/static/chunks/45992-a39a014497ec4dd1.js +0 -13
  95. package/temp/build/pi-desk/release/.next/static/chunks/70669.8b4231a8675499e0.js +0 -1
  96. package/temp/build/pi-desk/release/.next/static/chunks/app/login/page-bf893718bb151f3c.js +0 -1
  97. package/temp/build/pi-desk/release/.next/static/chunks/app/page-0f2cf68a4666420b.js +0 -158
  98. package/temp/build/pi-desk/release/.next/static/css/3213ee28336bddc2.css +0 -1
  99. /package/temp/build/pi-desk/release/.next/static/{-pemk30NXpiExEU5tjb1t → ZYtCj4W63FjXCrTLTDbvO}/_buildManifest.js +0 -0
  100. /package/temp/build/pi-desk/release/.next/static/{-pemk30NXpiExEU5tjb1t → ZYtCj4W63FjXCrTLTDbvO}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- <!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-26261285e181235a.js"/><script src="/_next/static/chunks/e388c842-1ca92f1ea0dfe8ee.js" async=""></script><script src="/_next/static/chunks/64444-3e955f910569274d.js" async=""></script><script src="/_next/static/chunks/main-app-6230945a5a062fce.js" async=""></script><script src="/_next/static/chunks/78923-17a9c337b29dcecd.js" async=""></script><script src="/_next/static/chunks/81881-f11dbe7dc0d04ed9.js" async=""></script><script src="/_next/static/chunks/app/error-0296a3b20cd1bf00.js" async=""></script><script src="/_next/static/chunks/app/not-found-2aab8b33ebbf3257.js" async=""></script><script src="/_next/static/chunks/app/global-error-6f5fc4928fd1966c.js" async=""></script><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-26261285e181235a.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[90184,[],\"\"]\n3:I[84845,[\"78923\",\"static/chunks/78923-17a9c337b29dcecd.js\",\"81881\",\"static/chunks/81881-f11dbe7dc0d04ed9.js\",\"18039\",\"static/chunks/app/error-0296a3b20cd1bf00.js\"],\"default\"]\n4:I[44478,[],\"\"]\n5:I[66999,[\"78923\",\"static/chunks/78923-17a9c337b29dcecd.js\",\"81881\",\"static/chunks/81881-f11dbe7dc0d04ed9.js\",\"24345\",\"static/chunks/app/not-found-2aab8b33ebbf3257.js\"],\"L1ErrorPage\"]\n6:I[14405,[],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\na:I[14405,[],\"ViewportBoundary\"]\nc:I[14405,[],\"MetadataBoundary\"]\ne:I[71713,[\"34219\",\"static/chunks/app/global-error-6f5fc4928fd1966c.js\"],\"default\"]\n9:X\n0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$3\",\"errorStyles\":[],\"errorScripts\":null,\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"$L5\",null,{\"notFound\":true}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],{},null,false,null]},null,false,\"$9\"]},null,false,\"$9\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Ld\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"-pemk30NXpiExEU5tjb1t\"}\n9:C\nb:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n8:null\nd:[]\n"])</script></body></html>
1
+ <!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-735430d61da52e9d.js"/><script src="/_next/static/chunks/e388c842-1ca92f1ea0dfe8ee.js" async=""></script><script src="/_next/static/chunks/64444-3e955f910569274d.js" async=""></script><script src="/_next/static/chunks/main-app-6230945a5a062fce.js" async=""></script><script src="/_next/static/chunks/78923-17a9c337b29dcecd.js" async=""></script><script src="/_next/static/chunks/81881-f11dbe7dc0d04ed9.js" async=""></script><script src="/_next/static/chunks/app/error-0296a3b20cd1bf00.js" async=""></script><script src="/_next/static/chunks/app/not-found-2aab8b33ebbf3257.js" async=""></script><script src="/_next/static/chunks/app/global-error-6f5fc4928fd1966c.js" async=""></script><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-735430d61da52e9d.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[90184,[],\"\"]\n3:I[84845,[\"78923\",\"static/chunks/78923-17a9c337b29dcecd.js\",\"81881\",\"static/chunks/81881-f11dbe7dc0d04ed9.js\",\"18039\",\"static/chunks/app/error-0296a3b20cd1bf00.js\"],\"default\"]\n4:I[44478,[],\"\"]\n5:I[66999,[\"78923\",\"static/chunks/78923-17a9c337b29dcecd.js\",\"81881\",\"static/chunks/81881-f11dbe7dc0d04ed9.js\",\"24345\",\"static/chunks/app/not-found-2aab8b33ebbf3257.js\"],\"L1ErrorPage\"]\n6:I[14405,[],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\na:I[14405,[],\"ViewportBoundary\"]\nc:I[14405,[],\"MetadataBoundary\"]\ne:I[71713,[\"34219\",\"static/chunks/app/global-error-6f5fc4928fd1966c.js\"],\"default\"]\n9:X\n0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$3\",\"errorStyles\":[],\"errorScripts\":null,\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"$L5\",null,{\"notFound\":true}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],{},null,false,null]},null,false,\"$9\"]},null,false,\"$9\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Ld\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"ZYtCj4W63FjXCrTLTDbvO\"}\n9:C\nb:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n8:null\nd:[]\n"])</script></body></html>
@@ -1 +1 @@
1
- {"node":{},"edge":{},"encryptionKey":"DKqYwm+whkrhPgDK5//4bHWWoG/pjwUnt1X6VTpUaLI="}
1
+ {"node":{},"edge":{},"encryptionKey":"/fd8p892vtIz9wzEXt8kfm3HiuLrGW14ND1bFZdLkkM="}
@@ -0,0 +1,13 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[45992],{267:(e,t,i)=>{"use strict";i.d(t,{R:()=>s});var n=i(38979),a=i(66453);let s=n.Ik({workId:n.Yj().trim().min(1),sessionId:a.$E,branchId:n.Yj().trim().min(1)}).strict()},1364:(e,t,i)=>{"use strict";i.d(t,{Ip:()=>f,JW:()=>h,K5:()=>y,Rc:()=>g,kt:()=>v,tz:()=>m});var n=i(7962);i(69266);var a=i(85137),s=i(79102),o=i(66467),r=i(60454),l=i(93750),c=i(39608),d=i(4947),u=i(49426),p=i(13464);function m({...e}){return(0,n.jsx)(a.D,{"data-slot":"context-menu",...e})}function h({...e}){return(0,n.jsx)(s.g,{"data-slot":"context-menu-portal",...e})}function g({className:e,...t}){return(0,n.jsx)(o.R,{"data-slot":"context-menu-trigger",className:(0,u.cn)("select-none",e),...t})}function f({className:e,align:t="start",alignOffset:i=4,side:a="right",sideOffset:o=0,finalFocus:c=!1,...d}){return(0,n.jsx)(s.g,{children:(0,n.jsx)(r.y,{className:"isolate z-50 outline-none",align:t,alignOffset:i,side:a,sideOffset:o,children:(0,n.jsx)(l._,{"data-slot":"context-menu-content",finalFocus:c,className:(0,u.cn)(p.hD,e),...d})})})}function v({className:e,inset:t,variant:i="default",...a}){return(0,n.jsx)(c.D,{"data-slot":"context-menu-item","data-inset":t,"data-variant":i,className:(0,u.cn)(p.S6,p.dQ,"group/context-menu-item",e),...a})}function y({className:e,...t}){return(0,n.jsx)(d.w,{"data-slot":"context-menu-separator",className:(0,u.cn)("-mx-1 my-1 h-px bg-border",e),...t})}},5011:(e,t,i)=>{"use strict";i.d(t,{P6:()=>O});var n=i(38979),a=i(68269),s=i(55438),o=i(9626);let r=n.Ik({source:a.Pi,cursor:a.UR}).strict(),l=n.Ik({subscriptions:n.YO(r).min(1)}).strict().superRefine((e,t)=>{let i=new Set;for(let[n,a]of e.subscriptions.entries())i.has(a.source.workId)&&t.addIssue({code:"custom",message:"subscriptions cannot contain duplicate workId values",path:["subscriptions",n,"source","workId"]}),i.add(a.source.workId)}),c=n.Ik({}).strict(),d=n.YO(a.wR).superRefine((e,t)=>{let i=new Set;for(let[n,a]of e.entries())n>0&&a.location.index!==e[n-1].location.index+1&&t.addIssue({code:"custom",message:"chat sync message indexes must be continuous",path:[n,"location","index"]}),i.has(a.location.entryId)&&t.addIssue({code:"custom",message:"chat sync entryId values must be unique",path:[n,"location","entryId"]}),i.add(a.location.entryId)}),u=n.Ik({type:n.eu("session_sync"),mode:n.eu("full"),baseCursor:n.ch(),messages:d,temporaryMessages:n.YO(a.yI),runtime:a.wf}).strict().superRefine((e,t)=>{e.messages[0]&&0!==e.messages[0].location.index&&t.addIssue({code:"custom",message:"full sync must start at index 0",path:["messages",0,"location","index"]})}),p=n.Ik({type:n.eu("session_sync"),mode:n.eu("incremental"),baseCursor:a.DK,messages:d,temporaryMessages:n.YO(a.yI),runtime:a.wf}).strict().superRefine((e,t)=>{let i=e.messages[0];i&&i.location.index!==e.baseCursor.index+1&&t.addIssue({code:"custom",message:"incremental sync must start after baseCursor",path:["messages",0,"location","index"]})}),m=n.KC([u,p]),h=s.hS,g=s.ef,f=s.gK,v=s.PS,y=n.Ik({type:n.eu("runtime_update"),runtime:a.wf}).strict(),x=n.KC([m,h,g,f,v,y]),b=n.Ik({source:a.Pi,event:x}).strict(),k=n.k5(["auto","follow_up"]),w=n.Ik({source:a.Pi,mode:k,text:n.Yj(),images:n.YO(a.xh).max(10)}).strict().refine(e=>e.text.trim().length>0||e.images.length>0,{message:"chat input requires text or images"}),C=n.Ik({tempId:a.R3.shape.tempId}).strict(),S=n.Ik({source:a.Pi}).strict(),j=n.Ik({}).strict(),I=S.extend({mode:a.TV.optional()}).strict(),R=S.extend({mode:a.TV}).strict(),F=n.Ik({}).strict(),P=n.Ik({}).strict(),M=n.Ik({text:n.Yj(),images:n.YO(a.xh)}).strict(),D=n.Ik({source:a.Pi,model:a.w$}).strict(),N=n.Ik({}).strict(),T=n.Ik({source:a.Pi,capabilityMode:a.wf.shape.capabilityMode}).strict(),E=n.Ik({}).strict();n.k5(["chat/subscribe","chat/send","chat/interrupt","chat/reload","chat/presentation-set","chat/compact","chat/queue-restore","chat/model-set","chat/capability-mode-set"]);let L=n.eu("chat/source-event"),O=Object.freeze({subscribe:(0,o.Vc)({path:"chat/subscribe",inputSchema:l,outputSchema:c,timeoutMs:125e3}),send:(0,o.Vc)({path:"chat/send",inputSchema:w,outputSchema:C,timeoutMs:12e4}),interrupt:(0,o.Vc)({path:"chat/interrupt",inputSchema:S,outputSchema:j}),reload:(0,o.Vc)({path:"chat/reload",inputSchema:I,outputSchema:F,timeoutMs:125e3}),presentationSet:(0,o.Vc)({path:"chat/presentation-set",inputSchema:R,outputSchema:F}),compact:(0,o.Vc)({path:"chat/compact",inputSchema:S,outputSchema:P,timeoutMs:6e5}),queueRestore:(0,o.Vc)({path:"chat/queue-restore",inputSchema:S,outputSchema:M}),modelSet:(0,o.Vc)({path:"chat/model-set",inputSchema:D,outputSchema:N}),capabilityModeSet:(0,o.Vc)({path:"chat/capability-mode-set",inputSchema:T,outputSchema:E}),sourceEvent:(0,o._G)({path:L.value,bodySchema:b})})},5464:(e,t,i)=>{"use strict";i.d(t,{Hl:()=>C,YM:()=>I,YV:()=>x,_Y:()=>S,hA:()=>w,uX:()=>R,vu:()=>j});var n=i(7962);i(69266);var a=i(76815),s=i(21702),o=i(60530),r=i(86023),l=i(57284),c=i(72512),d=i(49264),u=i(82611),p=i(40709),m=i(93061),h=i(87425),g=i(51173),f=i(49362),v=i(78121),y=i(49426);function x({onOpenChange:e,...t}){return(0,n.jsx)(a.D,{"data-slot":"app-dialog",...t,onOpenChange:(i,n)=>{i||!1===t.modal||"outside-press"!==n.reason||n.event.target instanceof Element&&"app-dialog-backdrop"===n.event.target.getAttribute("data-slot")?e?.(i,n):n.cancel()}})}function b({...e}){return(0,n.jsx)(s.Z,{"data-slot":"app-dialog-portal",...e})}function k({className:e,...t}){return(0,n.jsx)(o.X,{"data-slot":"app-dialog-backdrop",className:(0,y.cn)("fixed inset-0 z-[100] bg-black/35 duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function w({className:e,children:t,showCloseButton:i=!0,finalFocus:a=!1,backdropClassName:s,...o}){let{t:c}=(0,v.Bd)("common");return(0,n.jsxs)(b,{children:[(0,n.jsx)(k,{className:s,forceRender:!!s}),(0,n.jsxs)(r.h,{"data-slot":"app-dialog-content",finalFocus:a,className:(0,y.cn)("fixed top-1/2 left-1/2 z-[110] flex max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-[27.5rem] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border bg-popover text-sm text-popover-foreground shadow-lg outline-none duration-100 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o,children:[t,i?(0,n.jsxs)(l.H,{"data-slot":"app-dialog-close-button","aria-label":c("closeDialog"),title:c("closeDialog"),className:"absolute top-2 right-2 flex size-8 cursor-pointer items-center justify-center rounded-lg text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground active:bg-foreground/14 focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",children:[(0,n.jsx)(f.A,{className:"size-4"}),(0,n.jsx)("span",{className:"sr-only",children:c("closeDialog")})]}):null]})]})}function C({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"app-dialog-header",className:(0,y.cn)("flex shrink-0 flex-col gap-1.5",e),...t})}function S({className:e,children:t,...i}){return(0,n.jsxs)(u.V,{"data-slot":"app-dialog-body",className:(0,y.cn)("relative min-h-0 flex-1 overflow-hidden",e),...i,children:[(0,n.jsx)(p.B,{"data-slot":"app-dialog-body-viewport",className:"h-full max-h-[inherit] w-full overscroll-contain rounded-[inherit] outline-none focus-visible:ring-2 focus-visible:ring-ring",children:t}),(0,n.jsx)(m.V,{"data-slot":"app-dialog-body-scrollbar",orientation:"vertical",className:"flex h-full w-2.5 touch-none border-l border-l-transparent p-px select-none",children:(0,n.jsx)(h.l,{"data-slot":"app-dialog-body-thumb",className:"relative flex-1 rounded-full bg-muted-foreground/45 hover:bg-muted-foreground/70"})}),(0,n.jsx)(g.I,{})]})}function j({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"app-dialog-footer",className:(0,y.cn)("flex shrink-0 flex-wrap justify-end gap-2 border-t bg-popover px-4 py-3",e),...t})}function I({className:e,...t}){return(0,n.jsx)(c.L,{"data-slot":"app-dialog-title",className:(0,y.cn)("text-lg leading-[1.4] font-semibold",e),...t})}function R({className:e,...t}){return(0,n.jsx)(d.r,{"data-slot":"app-dialog-description",className:(0,y.cn)("text-sm leading-5 text-muted-foreground",e),...t})}},6397:(e,t,i)=>{"use strict";i.d(t,{HE:()=>a,IS:()=>n.Dl,Wu:()=>n.j0,f$:()=>n.Qg,rY:()=>n.a4});var n=i(84942);function a(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.name]))}},7237:(e,t,i)=>{"use strict";function n(e){let t=atob(e.data),i=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)i[e]=t.charCodeAt(e);return new Blob([i],{type:e.mimeType})}i.d(t,{E:()=>n})},13464:(e,t,i)=>{"use strict";i.d(t,{S6:()=>n,dQ:()=>a,hD:()=>s});let n="relative flex min-h-7 cursor-pointer items-center gap-2 rounded-md px-2 py-1 text-sm leading-5 outline-none select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a="data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive",s="z-50 max-h-(--available-height) min-w-60 max-w-[calc(100vw-2rem)] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none transition-[opacity,transform] duration-100 ease-out data-starting-style:scale-[0.98] data-starting-style:opacity-0 data-ending-style:scale-[0.98] data-ending-style:opacity-0 motion-reduce:transition-none"},15265:(e,t,i)=>{"use strict";i.d(t,{fD:()=>s,qf:()=>a});var n=i(38979);let a=n.KC([n.Yj(),n.Ik({default:n.Yj(),translations:n.g1(n.Yj().min(1).max(35),n.Yj()).refine(e=>Object.keys(e).length<=16,"too many translations")}).strict()]);function s(e,t){return"string"==typeof e?e:e.translations[t]??e.translations[t.split("-")[0]]??e.default}},15381:(e,t,i)=>{"use strict";i.d(t,{AA:()=>h,C3:()=>c,Kx:()=>l,MT:()=>u,MY:()=>g,_A:()=>d,eW:()=>o,ik:()=>r,jw:()=>m,kg:()=>f});var n=i(38979),a=i(66453),s=i(70698);let o=n.Yj().trim().min(1),r=a.m4,l=a.$E,c=a.Rv,d=n.Yj().trim().min(1),u=n.ai().int().nonnegative(),p=n.Ik({workId:o,cwd:r,sessionId:l}).strict();n.YO(p);let m=n.k5(["main_running","background_running","completed","idle"]),h=n.Ik({user:n.ai().int().nonnegative(),total:n.ai().int().nonnegative()}).strict().refine(e=>e.user<=e.total,{message:"user message count cannot exceed total message count"}),g=p.extend({branchId:d,projectName:n.Yj().trim().min(1),sessionTitle:n.Yj().trim().min(1).nullable(),status:m,messageCounts:h,lastMessageUpdatedAt:s.k.nullable()}).strict(),f=n.Ik({workSessions:n.YO(g),pinnedCount:u}).strict().refine(e=>e.pinnedCount<=e.workSessions.length,{message:"pinnedCount cannot exceed work session count",path:["pinnedCount"]});n.Ik({cwd:r,sessionId:l.optional()}).strict(),n.Ik({workSession:g}).strict(),n.Ik({workId:o}).strict(),n.Ik({workIds:n.YO(o),pinnedCount:u}).strict().superRefine((e,t)=>{new Set(e.workIds).size!==e.workIds.length&&t.addIssue({code:"custom",message:"workIds cannot contain duplicates",path:["workIds"]}),e.pinnedCount>e.workIds.length&&t.addIssue({code:"custom",message:"pinnedCount cannot exceed workIds length",path:["pinnedCount"]})}),n.KC([n.Ik({workId:o,cwd:r,sessionId:l}).strict(),n.Ik({workId:o}).strict()])},17511:(e,t,i)=>{"use strict";i.d(t,{Ik:()=>m,MG:()=>c,Sq:()=>u,iV:()=>h,oR:()=>g});var n=i(7962);i(69266);var a=i(73392),s=i(49426),o=i(86963),r=i(73429),l=i(68017);function c({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,s.cn)("group/input-group relative flex min-h-8 w-full min-w-0 items-center rounded-lg border border-input bg-card transition-colors duration-150 outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-muted has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:outline-2 has-[[data-slot=input-group-control]:focus-visible]:outline-solid has-[[data-slot=input-group-control]:focus-visible]:-outline-offset-2 has-[[data-slot=input-group-control]:focus-visible]:outline-ring has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}let d=(0,a.F)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function u({className:e,align:t="inline-start",...i}){return(0,n.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:(0,s.cn)(d({align:t}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...i})}let p=(0,a.F)("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"min-h-7 gap-2 rounded-md px-2",sm:"","icon-xs":"size-7 rounded-md p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function m({className:e,type:t="button",variant:i="ghost",size:a="xs",...r}){return(0,n.jsx)(o.$,{type:t,"data-size":a,variant:i,className:(0,s.cn)(p({size:a}),e),...r})}function h({className:e,...t}){return(0,n.jsx)(r.p,{"data-slot":"input-group-control",className:(0,s.cn)("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:outline-none focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0",e),...t})}function g({className:e,...t}){return(0,n.jsx)(l.T,{"data-slot":"input-group-control",className:(0,s.cn)("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:outline-none focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0",e),...t})}},18302:(e,t,i)=>{"use strict";function n(e,t,i){e.addCommand(t,i,"editorTextFocus && !findWidgetVisible && !suggestWidgetVisible && !renameInputVisible && !parameterHintsVisible && !referenceSearchVisible && !editorHoverVisible && !editorHoverFocused")}i.d(t,{e:()=>n})},20476:(e,t,i)=>{"use strict";i.d(t,{Wq:()=>d,ku:()=>p,lU:()=>u});var n=i(67765);let a="pi-super:image-preview-mode",s="compressed",o=new Set,r=s,l=!1;function c(){if(!l){l=!0;try{let e=n.p$.safeParse(window.localStorage.getItem(a));r=e.success?e.data:s}catch{r=s}}}function d(){return c(),r}function u(e){if(c(),r!==e){r=e;try{window.localStorage.setItem(a,e)}catch{}for(let e of[...o])e()}}function p(e){return o.add(e),()=>o.delete(e)}},24985:(e,t,i)=>{"use strict";i.d(t,{FJ:()=>x,Ww:()=>r,cP:()=>l,gf:()=>v,u2:()=>g,y2:()=>o,yl:()=>h,zp:()=>p,zt:()=>f});var n=i(38979),a=i(15265),s=i(67765);let o=100,r=s.rh,l=n.Yj().trim().min(1).max(1024),c=n.gM("type",[n.Ik({type:n.eu("branch"),name:l}).strict(),n.Ik({type:n.eu("detached"),commit:n.Yj().regex(/^[0-9a-f]{40,64}$/)}).strict()]),d=n.k5(["added","modified","deleted","renamed","unmerged","untracked"]),u=n.Ik({path:s._g,oldPath:s._g.nullable(),indexStatus:d.nullable(),worktreeStatus:d.nullable()}).strict(),p=n.Ik({root:r,state:n.eu("ready"),head:c,changes:n.YO(u).max(5e4)}).strict(),m=n.Ik({root:r,state:n.eu("unavailable"),message:a.qf.refine(e=>("string"==typeof e?[e]:[e.default,...Object.values(e.translations)]).every(e=>e.length>0&&e.length<=2e3))}).strict(),h=n.gM("state",[p.omit({changes:!0}),m]),g=n.gM("state",[p,m]),f=n.gM("type",[n.Ik({type:n.eu("local"),name:l}).strict(),n.Ik({type:n.eu("remote"),name:l}).strict()]),v=n.Ik({head:c,recent:n.YO(l).max(5),local:n.YO(l).max(1e4),remote:n.YO(l).max(1e4)}).strict(),y=n.Ik({path:s._g,content:n.Yj()}).strict(),x=n.gM("kind",[n.Ik({kind:n.eu("text"),original:y,modified:y}).strict(),n.Ik({kind:n.eu("binary")}).strict(),n.Ik({kind:n.eu("too_large")}).strict()])},26357:(e,t,i)=>{"use strict";i.d(t,{$:()=>n});let n=i(38979).k5(["off","minimal","low","medium","high","xhigh","max"])},31343:(e,t,i)=>{"use strict";i.d(t,{R:()=>n});let n={en:{terminal:"Terminal",newTerminal:"New terminal",terminalTabs:"Terminals",terminalActions:"Terminal actions",terminalDockBottom:"Dock at bottom",terminalDockRight:"Dock at right",terminalMaximize:"Maximize",terminalRestore:"Restore",terminalCollapse:"Collapse",terminalExpand:"Expand terminals ({{count}})",terminalCloseTab:"Close {{title}}",terminalRemove:"Remove exited terminal",terminalExited:"Exited",terminalExitCode:"Exit {{code}}",terminalOpening:"Opening terminal…",terminalReconnecting:"Reconnecting…",terminalSyncing:"Restoring terminal…",terminalLoadFailed:"Could not load terminal",terminalScreen:"Terminal screen",terminalInput:"Input",terminalResize:"Resize terminal",terminalKeyleft:"Left arrow",terminalKeyright:"Right arrow",terminalKeyup:"Up arrow",terminalKeydown:"Down arrow",toolsAndContext:"Tools and context",sessionContextDescription:"Tools, system instructions and services for this session",mcpSession:"Session MCP",modelAutomaticRouting:"Automatic routing",modelFixed:"Fixed models",modelChanging:"Changing model…",modelContextUnknown:"Context unknown",mcpSessionActions:"Session MCP actions",mcpStatus:"Status",mcpLogin:"Sign in",mcpReconnect:"Reconnect",mcpLogout:"Sign out",mcpServerName:"Server name",mcpServerNamePlaceholder:"Enter the configured server name",mcpServerNameInvalid:"Use letters, numbers, underscores and hyphens.",mcpLogoutConfirm:"Delete shared credentials. Other sessions may need to sign in again.",mcpExecute:"Run",mcpExecuting:"Running",mcpCommandUnavailable:"No MCP command is registered in this session.",nativeCommandOutput:"Session command output",nativeCommandOutputEmpty:"No session command output yet",searchToolsSources:"Search names, sources or descriptions",toolFilter:"Tool usage",allTools:"All tools",toolBlockedByMode:"Restricted by mode",toolSource:"Source",toolUnknown:"Unknown",toolActive:"Currently selected",toolInactive:"Not currently selected",toolModeUnknown:"Mode restriction unknown",toolNotBlocked:"Not restricted by mode",noRegisteredTools:"No tools registered in this session",toolExposureDirect:"Direct use",toolExposureModelOnly:"Model only",toolExposureCodemode:"Via scripts",toolExposureDeferred:"On-demand discovery",toolExposureHidden:"Unavailable",nativeUiTitle:"Plugin request",nativeUiInfo:"Additional information",nativeUiStatus:"Plugin status",nativeUiConfirm:"Confirm",nativeUiCancel:"Cancel",nativeUiReject:"Decline",nativeUiLater:"Later",nativeUiResume:"Continue",nativeUiPending:"{{count}} pending",nativeUiMore:"{{count}} more",nativeUiSubmit:"Submit",nativeUiSubmitting:"Submitting…",nativeUiDisconnected:"Waiting for connection. Your input is kept.",nativeUiUnknown:"Checking whether your answer was received. It will not be sent again automatically.",nativeUiFailed:"Could not load plugin interaction",nativeUiRetry:"Refresh status",nativeUiCountdown:"Cancels in {{seconds}}s",nativeUiStop:"Stop",nativeUiExpand:"Expand editor",nativeUiBack:"Back to chat",nativeUiDraft:"Suggested text",nativeUiAppend:"Append to draft",nativeUiReplace:"Replace draft",nativeUiDismiss:"Dismiss",nativeUiComposer:"Answer the pending question before sending more messages.",nativeUiAnswerExpired:"This question has ended.",thinkingOff:"Off",thinkingMinimal:"Minimal",thinkingLow:"Low",thinkingMedium:"Medium",thinkingHigh:"High",thinkingXhigh:"Very high",thinkingMax:"Maximum",selectModel:"Select model",thinkingLevel:"Thinking: {{level}}",imagePreview:"Preview {{name}}",imageRemove:"Remove {{name}}",imageProcessing:"Processing",imageFailed:"Failed",draftLoading:"Restoring draft…",draftFailed:"Could not restore draft. Retry first.",inputPlaceholder:"Message… Enter to send, Shift+Enter for a new line",more:"More",moreActions:"More actions",session:"Session",tools:"Tools",plugins:"Plugins",sessionBranch:"Session branches",switchBranch:"Switch session branch",clone:"Clone session",cloning:"Cloning session…",cloneEmpty:"No messages to clone yet",cloneTip:"Clone the current branch into a new session",replaceSession:"Replace with a new session",replacing:"Replacing…",systemContext:"View system context",readingContext:"Loading system context…",reloadPi:"Reload Pi configuration",restorePluginPresentation:"Restore plugin message views",initializationDegraded:"No-extension fallback",initializationDetails:"Reason for fallback",copyInitializationError:"Copy reason",initializationCopyFailed:"Could not copy the reason. Please select and copy it manually.",reloadingPi:"Reloading Pi configuration…",reloadPiTip:"Reload Pi configuration, extensions, Skills, prompts and context files",addImage:"Add image",chooseModel:"Select model and thinking level",currentModel:"Current model",allModels:"All models",modelsLoading:"Loading models…",modelsFailed:"Could not load models. Retry",noModels:"No authenticated models available",presets:"Common combinations",commonCombinationsEmpty:"No common combinations yet",configureCommonCombinations:"Set up common combinations",preparingContext:"Preparing context…",steerNow:"Guide the current response now",sendFollowUp:"Send after this turn",stopResponse:"Stop response",sending:"Sending message",send:"Send message",synchronizing:"Synchronizing session",noModelSelected:"No model selected",modelTooltip:"Current model: {{model}}. Choose another",operationFailed:"Action failed",modeChangeFailed:"Could not change capability mode",contextFailed:"Could not load system context",sendFailed:"Could not send message",confirmingSend:"Checking send result…",sendUnknown:"Send result unknown. Your message is saved locally. Check the conversation before restoring or deleting it.",sendFailure:"Send failed: {{error}}",unknownError:"Unknown error",restoreDraft:"Restore draft",delete:"Delete",retryDraft:"Retry restoring draft",composerRunning:"Message composer, running",composerCompleted:"Message composer, response ready",composer:"Message composer",escapeTwice:"Esc twice",thinkingLevels:"Thinking level",imagePreviewPending:"Images to send",tooManyImages:"Send at most 10 images at once. Remove some images first.",imageUnsupported:"The current model cannot receive images. Choose a model with image support.",imagesTooLarge:"Images cannot exceed 20 MB in total.",pluginRestoreFailed:"Could not load plugin state after restart",syncFailed:"Could not resynchronize work sessions",workSessionUpdateInvalid:"Work session update invalid; resynchronizing",appRuntimeUpdateInvalid:"Application update invalid; resynchronizing",projectDirectoriesFailed:"Could not load Pi projects",ignoredDirectoriesFailed:"Could not load ignored folders",browseDirectoryFailed:"Could not browse server folders",historyFailed:"Could not load past Pi sessions",chatSyncFailed:"Could not synchronize chat messages",taskSyncFailed:"Could not synchronize task details",replacedConnection:"Another connection replaced this page connection",connectionFailed:"Connection failed",realtimeFailed:"Could not connect to real-time work sessions",workSessionInitializing:"Work sessions are still initializing",sessionNotFound:"Session not found in the current work session",sortFailed:"Could not reorder work sessions",deleteFailed:"Could not delete work session",ignoreFailed:"Could not ignore folder",restoreIgnoredFailed:"Could not restore folder",autoPinFailed:"Session created, but could not pin it automatically",createFailed:"Could not create work session",replaceTargetMissing:"Replacement target is no longer available. Select a work session again.",replacementMissing:"Replacement work session not found",replaceFailed:"Could not replace work session",emptyReplacementMissing:"New empty work session not found",replaceEmptyFailed:"Could not replace with an empty session",sourceChanged:"Work session source changed.",invalidFilePath:"Invalid file path.",invalidToolFilePath:"Invalid tool file path.",noPreviewSession:"There is no work session to preview files.",noRevealSession:"There is no work session to locate files.",notificationActionFailed:"Could not perform notification action",notificationDeleteFailed:"Could not dismiss notification",closeSessionMenu:"Close work session menu",resizeSessionList:"Resize work session list",showSidebarMode:"Show {{name}}",sidebarContents:"Sidebar content",sidebarActions:"Sidebar actions",mainRunning:"Main session running",backgroundRunning:"Background task running",completedUnread:"Completed; not viewed yet",idle:"Idle",newSession:"New session",copiedProjectPath:"Project path copied.",copyProjectPathFailed:"Could not copy project path. Please copy it manually.",dragSession:"Drag to reorder {{name}}",dragOrder:"Drag to reorder",sessionMessages:"{{count}} messages \xb7 {{time}}",pinSession:"Pin {{name}}",unpinSession:"Unpin {{name}}",pin:"Pin session",unpin:"Unpin session",deleteSession:"Delete {{name}}",deleteSessionTitle:"Delete work session",copyProjectPath:"Copy project path",sidebarSessions:"Work sessions",sidebarFiles:"Project files",sidebarReplaceSession:"Replace work session",createSession:"Create work session",projectPreview:"Project preview",refreshFiles:"Refresh project files",pinnedBelow:"Pinned below",settings:"Settings",settingsWarning:"Settings, extension error",moreShortcuts:"More shortcuts",noSessions:"No work sessions yet",selectSessionFirst:"Select a work session first",shortcuts:"Shortcuts",gitStatusReadFailed:"Could not read Git status",gitOperationFailed:"Could not change Git branch",checkedOut:"Checked out {{name}}",switchedBranch:"Switched to {{name}}",branchCreated:"Created and switched to {{name}}",current:"Current",recent:"Recent",checkoutRemote:"Check out as local branch",switchGitBranch:"Switch to this branch",branchFromHere:"Create branch from here",gitBranches:"Git branches",readingRepos:"Loading repositories…",repositoryUnavailable:"Git unavailable",repositorySummary:"{{name}} \xb7 {{branch}}",repositoryCount_one:"{{count}} repository",repositoryCount_other:"{{count}} repositories",refreshBranches:"Refresh Git branches",close:"Close",repositories:"Repositories",unavailable:"Unavailable",backRepositories:"Back to repositories",chooseRepository:"Choose a repository",createBranch:"New branch",newBranchName:"New branch name",createAndSwitch:"Create and switch",cancel:"Cancel",searchBranches:"Search branches",loadingBranches:"Loading branches…",retry:"Retry",recentlyUsed:"Recently used",localBranches:"Local branches",remoteBranches:"Remote branches",noBranchMatches:"No matching branches",contextUsageWithIgnore:"Context {{percent}}%, estimated {{projected}}% after ignoring; ignored {{ignored}}, can ignore {{potential}}",contextUsageSimple:"Context {{percent}}% of {{limit}} tokens",contextDetails:"Context usage details",contextMetrics:"Current / Limit / Used",afterIgnore:"Estimated remaining",potentialIgnore:"Can ignore",alreadyIgnored:"Ignored",ignoreNow:"Ignore {{amount}} now",nothingToIgnore:"No context available to ignore",ignoring:"Ignoring…",ignore:"Ignore",compacting:"Compacting…",compact:"Compact",contextCritical:"Context usage is very high.",contextWarning:"Context is approaching its limit.",copySessionId:"Copy current session ID {{id}}",copySessionFailed:"Could not copy session ID. Please copy it manually.",currentSessionId:"Current session ID",copied:"Copied",clickToCopy:"Click to copy",copyCurrentPath:"Copy current path {{path}}",copyPathFailed:"Could not copy path. Please copy it manually.",currentPath:"Current path",copy:"Copy",contextCopyFailed:"Could not copy system context. Please copy it manually.",contextTitle:"System context",contextDescription:"System prompt and tool definitions used in the current model request",copyContext:"Copy system context",contextContents:"Context contents",systemPrompt:"System prompt",toolDefinitions:"{{count}} tool definitions",searchTools:"Search tool definitions",searchNames:"Search names or descriptions",charCount:"{{count}} characters",contextLoading:"Loading system context…",contextRetry:"Retry",emptyContent:"(empty)",contextTools:"Model context tools",parameterSchema:"Parameter schema",noMatchingTools:"No matching tools",noActiveTools:"No active tools",clearSearch:"Clear search",queueItems_one:"{{count}} item",queueItems_other:"{{count}} items",queueImages_one:"{{count}} image",queueImages_other:"{{count}} images",imageOnly:"Image-only message",noMessageText:"No text content",viewQueued:"View {{count}} queued messages",queuedCount:"{{count}} queued",queueCurrent:"Queued messages",queuePendingDescription:"Waiting messages will be handled in this order",queueSteer:"Guide now",queueSteerDescription:"Guide the current response",queueFollowUp:"Send later",queueFollowUpDescription:"Send in order after this turn",queueRestore:"Undo all and restore to draft",noticeInfo:"Information",noticeSuccess:"Success",noticeWarning:"Warning",noticeError:"Error",actionableNotice:"{{level}} notification: {{title}}. Activate to open",noticeLabel:"{{level}} notification: {{title}}",olderNotices:"Show {{count}} earlier notifications",deleteNotice:"Dismiss notification: {{title}}",dismissNotice:"Dismiss notification",hideSessionMenu:"Hide session menu",showSessionMenu:"Show session menu",openSessionFiles:"Open session files",sessionFiles:"Files \xb7 {{count}}",unpinWorkSession:"Unpin work session {{name}}",workSession:"Work session",loading:"Loading",chooseSession:"Choose a session",expandSession:"Expand session {{name}}",resizeColumns:"Resize columns {{left}} and {{right}}",emptySelectSession:"Choose a work session",emptyQuip0:"You bring the ideas. I'll bring the tinkering.",emptyQuip1:"Enough floating around. Let's make something.",emptyQuip2:"So, what are we tinkering with today?",emptyQuip3:"Your ideas. My keyboard.",emptyQuip4:"Brainstorming mode: hungry for ideas.",emptyQuip5:"Cute face. Surprisingly useful paws.",emptyQuip6:"Today's wild ideas may now take the stage.",emptyQuip7:"Let's turn that 'what if' into something real.",emptyQuip8:"You start it. I'll help get it rolling.",emptyQuip9:"Paws in position. Ready to work.",emptyQuip10:"Let's make something, then look thoughtful.",emptyQuip11:"Toss me an idea. I've got it.",emptyQuip12:"Wild ideas welcome. We'll figure out the rest.",emptyQuip13:"Let's turn 'maybe' into 'done'.",emptyQuip14:"Daydream break over. Brainstorming open.",emptyQuip15:"Got a bold idea? Let me sit down first.",emptyQuip16:"Not sleeping. Just loading ideas with my eyes closed.",emptyWakeReply:"I'm awake! Let's get to work.",emptyFishReply:"Coming right up!",emptyCuriousReply:"Oh, you really meant it!",emptyPartnerReply:"Got it. Let's do this.",emptyLoading:"Loading sessions…",file:"File",fileViewer:"{{name}} file viewer",collapseProjectTree:"Collapse project tree",expandProjectTree:"Expand project tree",exitExpanded:"Exit expanded view",expandFile:"Expand file",returnChat:"Back to chat",hideFile:"Hide file",chat:"Chat",collapse:"Collapse",browseProject:"Browse project folders",fileWorkspaceTitle:"Project files",resizeChatFile:"Resize chat and file panes",standaloneReadFailed:"Could not read file",standaloneViewer:"{{name}} standalone file preview",reloadFile:"Reload file",standaloneImage:"{{name}} image preview",standaloneHtml:"{{name}} HTML preview",loadingFile:"Loading file…",slashLoadingMore:"Loading more commands…",slashMoreFailed:"Could not load additional commands",slashCandidates:"Slash command suggestions",slashLoading:"Loading commands…",slashFailed:"Could not load commands",slashEmpty:"No matching commands",slashSummary:"{{commands}} commands \xb7 {{groups}} categories",slashCount:"{{count}} commands",slashUpDown:"↑↓ Select",slashEnter:"Enter Select",slashEscape:"Esc Close",slashGroupBuiltin:"Pi commands",slashGroupSkill:"Skills",slashGroupPrompt:"Prompt templates",slashGroupExtension:"Extension commands",reloadDescription:"Reload the latest Pi configuration and extensions",chatMessages:"{{name}} chat messages",sessionWindows:"Work session windows",fixedSession:"Pinned",primarySession:"Main session",sourceSyncing:"Session is synchronizing. Try again shortly.",draftSaveFailed:"Could not save draft",imageProcessFailed:"Could not process image",draftImage:"Draft image",uncertainRecovered:"A previous send had an unknown result. Check the conversation before sending again.",draftLoadFailed:"Could not load draft",imageAddLimit:"Add at most 10 images",imageUnavailable:"Image unavailable",imageAddOverflow:"10-image limit reached. Other images were not added.",resolveOutboxFirst:"Resolve the previous unconfirmed message first",emptyInput:"Enter text or add an image",imageSendLimit:"Send at most 10 images",imagesPending:"Images are still processing",imageProcessingFailed:"An image could not be processed",imageBytesLimit:"Images in one message cannot exceed 20 MB",messageBytesLimit:"Message exceeds 31 MB",outboxRestored:"Unconfirmed message restored to draft.",outboxDeleted:"Unconfirmed message deleted.",interruptFailed:"Could not interrupt the current response",restoredImage:"Restored image {{count}}",queuesRestored:"All queued messages restored to draft.",queueRestoreFailed:"Could not restore queued messages",modelCatalogFailed:"Could not load model catalog",setModelFailed:"Could not set model",imageIdentityInvalid:"Invalid chat image identity",localImagePending:"Local temporary image is not ready",imageFileFailed:"{{name}}: {{error}}",treeLoadFailed:"Could not load session tree",treeSourceInvalid:"Work session changed. Session tree is unavailable",treeDetailFailed:"Could not load entry details",branchTargetMissing:"Branched work session not found",branchOperationFailed:"Could not perform branch operation",interruptForBranchFailed:"Could not stop the current response",treeChanged:"Work session changed. Reopen the session tree",cloneUnavailable:"Work session changed. Cannot clone",branchUnavailable:"Work session changed. Cannot continue",branchChanged:"Work session changed. Try again",chatCacheMismatch:"Local chat cache does not match the synchronization cursor; resynchronizing",chatMessageMissing:"Chat message not found: {{index}}/{{entryId}}",gitNoProjectBranches:"This project is not bound to a work session. Git branches are unavailable.",gitBranchesReadFailed:"Could not read Git branches",gitNoProjectStatus:"This project is not bound to a work session. Git status is unavailable.",gitNoProjectOperation:"This project is not bound to a work session. Git actions are unavailable.",outboxMissing:"No unconfirmed message is available to restore",imageDecodeFailed:"Image could not be decoded",imageInvalidDimensions:"Invalid image dimensions",canvasUnavailable:"Browser could not create an image canvas",imageCompressFailed:"Browser could not compress image",imageTypeUnsupported:"Only JPEG, PNG, WebP, GIF or BMP images are supported",singleImageLimit:"Images must be 10 MB or smaller",compressedImageTooLarge:"Image still exceeds 10 MB after compression",compressedTypeUnsupported:"Unsupported compressed image format"},"zh-CN":{terminal:"终端",newTerminal:"新建终端",terminalTabs:"终端标签",terminalActions:"终端操作",terminalDockBottom:"停靠底部",terminalDockRight:"停靠右侧",terminalMaximize:"最大化",terminalRestore:"还原",terminalCollapse:"折叠终端",terminalExpand:"展开终端({{count}})",terminalCloseTab:"关闭 {{title}}",terminalRemove:"移除已退出终端",terminalExited:"已退出",terminalExitCode:"退出码 {{code}}",terminalOpening:"正在打开终端…",terminalReconnecting:"正在重新连接…",terminalSyncing:"正在恢复画面…",terminalLoadFailed:"终端加载失败",terminalScreen:"终端画面",terminalInput:"输入",terminalResize:"调整终端尺寸",terminalKeyleft:"向左",terminalKeyright:"向右",terminalKeyup:"向上",terminalKeydown:"向下",toolsAndContext:"工具与上下文",sessionContextDescription:"当前会话的工具、系统提示词和服务",mcpSession:"会话 MCP",modelAutomaticRouting:"自动路由",modelFixed:"固定模型",modelChanging:"正在切换模型…",modelContextUnknown:"上下文未知",mcpSessionActions:"MCP 会话操作",mcpStatus:"状态",mcpLogin:"登录",mcpReconnect:"重连",mcpLogout:"退出登录",mcpServerName:"服务名称",mcpServerNamePlaceholder:"输入已配置的服务名称",mcpServerNameInvalid:"服务名称只能包含字母、数字、下划线和连字符。",mcpLogoutConfirm:"删除共享登录凭据,其他会话下次访问也可能需要重新登录。",mcpExecute:"执行",mcpExecuting:"正在执行",mcpCommandUnavailable:"当前会话未注册 MCP 命令。",nativeCommandOutput:"会话命令输出",nativeCommandOutputEmpty:"暂无会话命令输出",searchToolsSources:"搜索名称、来源或描述",toolFilter:"工具使用方式",allTools:"全部工具",toolBlockedByMode:"受模式限制",toolSource:"来源",toolUnknown:"未知",toolActive:"当前已选用",toolInactive:"当前未选用",toolModeUnknown:"模式限制未知",toolNotBlocked:"未受模式限制",noRegisteredTools:"当前会话没有登记工具",toolExposureDirect:"直接使用",toolExposureModelOnly:"仅模型调用",toolExposureCodemode:"通过脚本调用",toolExposureDeferred:"按需发现",toolExposureHidden:"不可调用",nativeUiTitle:"插件请求",nativeUiInfo:"附加信息",nativeUiStatus:"插件状态",nativeUiConfirm:"确认",nativeUiCancel:"取消",nativeUiReject:"拒绝",nativeUiLater:"稍后处理",nativeUiResume:"继续处理",nativeUiPending:"{{count}} 项待处理",nativeUiMore:"另有 {{count}} 项",nativeUiSubmit:"提交",nativeUiSubmitting:"正在提交…",nativeUiDisconnected:"连接恢复后可继续,输入已保留。",nativeUiUnknown:"正在核对是否收到回答,不会自动重复提交。",nativeUiFailed:"无法加载插件交互",nativeUiRetry:"刷新状态",nativeUiCountdown:"{{seconds}} 秒后取消",nativeUiStop:"停止任务",nativeUiExpand:"展开编辑",nativeUiBack:"返回聊天",nativeUiDraft:"插件发来一段草稿",nativeUiAppend:"追加到草稿",nativeUiReplace:"替换草稿",nativeUiDismiss:"忽略",nativeUiComposer:"处理问题后可发送补充内容。",nativeUiAnswerExpired:"这个问题已结束。",thinkingOff:"关闭",thinkingMinimal:"最少",thinkingLow:"低",thinkingMedium:"中",thinkingHigh:"高",thinkingXhigh:"很高",thinkingMax:"最大",selectModel:"选择模型",thinkingLevel:"思考 {{level}}",imagePreview:"预览 {{name}}",imageRemove:"移除 {{name}}",imageProcessing:"处理中",imageFailed:"失败",draftLoading:"正在恢复草稿…",draftFailed:"草稿恢复失败,请先重试",inputPlaceholder:"输入消息,Enter 发送,Shift+Enter 换行",more:"更多",moreActions:"更多操作",session:"会话",tools:"工具",plugins:"插件",sessionBranch:"会话分支",switchBranch:"切换会话分支",clone:"克隆当前会话",cloning:"正在克隆当前会话",cloneEmpty:"当前会话还没有可克隆的消息",cloneTip:"克隆当前活动分支到新会话",replaceSession:"替换为新会话",replacing:"正在替换…",systemContext:"查看系统上下文",readingContext:"正在读取系统上下文…",reloadPi:"重载 Pi 配置",restorePluginPresentation:"恢复插件消息展示",initializationDegraded:"无扩展降级会话",initializationDetails:"降级原因",copyInitializationError:"复制原因",initializationCopyFailed:"复制原因失败,请选中文字后手动复制。",reloadingPi:"正在重载 Pi 配置…",reloadPiTip:"重新读取 Pi 的配置、扩展、Skills、提示模板和上下文文件",addImage:"添加图片",chooseModel:"选择模型与思考等级",currentModel:"当前模型",allModels:"全部模型",modelsLoading:"正在加载模型…",modelsFailed:"加载失败,点击重试",noModels:"没有已认证的可用模型",presets:"常用组合",commonCombinationsEmpty:"还没有常用组合",configureCommonCombinations:"设置常用组合",preparingContext:"正在准备上下文…",steerNow:"立即引导当前响应",sendFollowUp:"当前轮结束后发送",stopResponse:"停止当前响应",sending:"正在发送消息",send:"发送消息",synchronizing:"正在同步会话",noModelSelected:"尚未选择模型",modelTooltip:"当前模型:{{model}},点击切换",operationFailed:"操作失败",modeChangeFailed:"切换能力模式失败",contextFailed:"读取系统上下文失败",sendFailed:"发送消息失败",confirmingSend:"正在确认发送结果…",sendUnknown:"发送结果未知,内容仍保留在本机。请确认聊天记录后再恢复或删除。",sendFailure:"发送失败:{{error}}",unknownError:"未知错误",restoreDraft:"恢复草稿",delete:"删除",retryDraft:"重试恢复",composerRunning:"消息输入区,运行中",composerCompleted:"消息输入区,完成待查看",composer:"消息输入区",escapeTwice:"双击 Esc",thinkingLevels:"思考等级",imagePreviewPending:"待发送图片预览",tooManyImages:"单次最多发送 10 张图片,请先删除部分恢复内容。",imageUnsupported:"当前模型不支持图片输入,请切换到带图片图标的模型。",imagesTooLarge:"图片总量不能超过 20MB。",pluginRestoreFailed:"服务重启后读取插件状态失败",syncFailed:"重新同步工作会话失败",workSessionUpdateInvalid:"工作会话增量无效,正在重新同步",appRuntimeUpdateInvalid:"应用运行态增量无效,正在重新同步",projectDirectoriesFailed:"加载 Pi 目录失败",ignoredDirectoriesFailed:"加载忽略目录失败",browseDirectoryFailed:"浏览服务端目录失败",historyFailed:"加载 Pi 历史会话失败",chatSyncFailed:"聊天消息同步失败",taskSyncFailed:"任务详情同步失败",replacedConnection:"当前页面连接已被新的同 clientId 连接替换",connectionFailed:"连接失败",realtimeFailed:"工作会话实时连接失败",workSessionInitializing:"工作会话仍在初始化",sessionNotFound:"当前工作会话中未找到该会话",sortFailed:"更新会话排列失败",deleteFailed:"删除工作会话失败",ignoreFailed:"忽略目录失败",restoreIgnoredFailed:"恢复目录失败",autoPinFailed:"会话已创建,但自动固定失败",createFailed:"创建工作会话失败",replaceTargetMissing:"替换目标已失效,请关闭后重新选择工作会话",replacementMissing:"替换后的工作会话不存在",replaceFailed:"替换工作会话失败",emptyReplacementMissing:"替换后的空会话不存在",replaceEmptyFailed:"替换为空会话失败",sourceChanged:"工作会话来源已变化。",invalidFilePath:"文件路径无效。",invalidToolFilePath:"工具文件路径无效。",noPreviewSession:"当前没有可预览文件的工作会话。",noRevealSession:"当前没有可定位文件的工作会话。",notificationActionFailed:"通知操作执行失败",notificationDeleteFailed:"删除通知失败",closeSessionMenu:"关闭工作会话菜单",resizeSessionList:"调整工作会话列表宽度",showSidebarMode:"显示{{name}}",sidebarContents:"左侧栏内容",sidebarActions:"侧栏操作",mainRunning:"主会话运行中",backgroundRunning:"后台任务运行中",completedUnread:"完成待查看",idle:"空闲",newSession:"新会话",copiedProjectPath:"已复制项目路径。",copyProjectPathFailed:"复制项目路径失败,请手动复制。",dragSession:"拖拽调整工作会话 {{name}} 的顺序",dragOrder:"拖拽调整顺序",sessionMessages:"{{count}} 条消息 \xb7 {{time}}",pinSession:"固定工作会话 {{name}}",unpinSession:"取消固定工作会话 {{name}}",pin:"固定会话",unpin:"取消固定会话",deleteSession:"删除工作会话 {{name}}",deleteSessionTitle:"删除工作会话",copyProjectPath:"复制项目路径",sidebarSessions:"工作会话",sidebarFiles:"项目文件",sidebarReplaceSession:"替换工作会话",createSession:"新建工作会话",projectPreview:"项目预览",refreshFiles:"刷新项目文件",pinnedBelow:"以下固定",settings:"设置",settingsWarning:"设置,有扩展异常",moreShortcuts:"更多快捷入口",noSessions:"还没有工作会话",selectSessionFirst:"请先选择一个工作会话",shortcuts:"快捷入口",gitStatusReadFailed:"读取 Git 状态失败",gitOperationFailed:"Git 分支操作失败",checkedOut:"已检出 {{name}}",switchedBranch:"已切换到 {{name}}",branchCreated:"已创建并切换到 {{name}}",current:"当前",recent:"最近",checkoutRemote:"检出为本地分支",switchGitBranch:"切换到此分支",branchFromHere:"从此分支新建",gitBranches:"Git 分支",readingRepos:"正在读取仓库…",repositoryUnavailable:"Git 不可用",repositorySummary:"{{name}} \xb7 {{branch}}",repositoryCount_one:"{{count}} 个仓库",repositoryCount_other:"{{count}} 个仓库",refreshBranches:"刷新 Git 分支",close:"关闭",repositories:"仓库",unavailable:"不可用",backRepositories:"返回仓库列表",chooseRepository:"选择仓库",createBranch:"新建分支",newBranchName:"新分支名称",createAndSwitch:"创建并切换",cancel:"取消",searchBranches:"搜索分支",loadingBranches:"正在读取分支…",retry:"重试",recentlyUsed:"最近使用",localBranches:"本地分支",remoteBranches:"远程分支",noBranchMatches:"没有匹配分支",contextUsageWithIgnore:"上下文 {{percent}}%,忽略后预计 {{projected}}%,已忽略 {{ignored}},可忽略 {{potential}}",contextUsageSimple:"上下文 {{percent}}%,{{limit}} tokens",contextDetails:"上下文用量详情",contextMetrics:"当前占用 / 上限 / 使用百分比",afterIgnore:"忽略后预计保留",potentialIgnore:"可忽略",alreadyIgnored:"已忽略",ignoreNow:"立即忽略 {{amount}}",nothingToIgnore:"暂无可忽略上下文",ignoring:"忽略中…",ignore:"忽略",compacting:"压缩中…",compact:"压缩",contextCritical:"上下文占用已很高。",contextWarning:"上下文正在接近上限。",copySessionId:"复制当前会话 ID {{id}}",copySessionFailed:"复制当前会话 ID 失败,请手动复制。",currentSessionId:"当前会话 ID",copied:"已复制",clickToCopy:"点击复制",copyCurrentPath:"复制当前路径 {{path}}",copyPathFailed:"复制当前路径失败,请手动复制。",currentPath:"当前路径",copy:"复制",contextCopyFailed:"复制系统上下文失败,请手动复制。",contextTitle:"系统上下文",contextDescription:"当前模型请求使用的系统提示词和工具定义",copyContext:"复制系统上下文",contextContents:"上下文内容",systemPrompt:"系统提示词",toolDefinitions:"工具定义 \xb7 {{count}}",searchTools:"搜索工具定义",searchNames:"搜索名称或描述",charCount:"{{count}} 字符",contextLoading:"正在读取系统上下文…",contextRetry:"重试",emptyContent:"(空)",contextTools:"模型上下文工具",parameterSchema:"参数 Schema",noMatchingTools:"没有匹配的工具",noActiveTools:"当前没有启用工具",clearSearch:"清除搜索",queueItems_one:"{{count}} 条",queueItems_other:"{{count}} 条",queueImages_one:"{{count}} 张图片",queueImages_other:"{{count}} 张图片",imageOnly:"仅图片消息",noMessageText:"无文本内容",viewQueued:"查看 {{count}} 条排队消息",queuedCount:"排队 {{count}}",queueCurrent:"当前排队消息",queuePendingDescription:"等待中的消息会按下列顺序处理",queueSteer:"立即引导",queueSteerDescription:"用于引导当前响应",queueFollowUp:"后续发送",queueFollowUpDescription:"当前轮结束后依次发送",queueRestore:"撤销全部并恢复到草稿",noticeInfo:"信息",noticeSuccess:"成功",noticeWarning:"警告",noticeError:"错误",actionableNotice:"{{level}}通知:{{title}},点击处理",noticeLabel:"{{level}}通知:{{title}}",olderNotices:"展开 {{count}} 条更早通知",deleteNotice:"删除通知:{{title}}",dismissNotice:"删除通知",hideSessionMenu:"隐藏工作会话菜单",showSessionMenu:"显示工作会话菜单",openSessionFiles:"打开会话文件",sessionFiles:"文件 \xb7 {{count}}",unpinWorkSession:"取消固定工作会话 {{name}}",workSession:"工作会话",loading:"正在加载",chooseSession:"选择会话",expandSession:"展开会话 {{name}}",resizeColumns:"调整第 {{left}} 列与第 {{right}} 列宽度",emptySelectSession:"选择一个工作会话",emptyQuip0:"你负责脑洞,我负责折腾。",emptyQuip1:"不摸鱼了,整点活。",emptyQuip2:"说吧,今天捣鼓点什么?",emptyQuip3:"点子归你,敲键盘归我。",emptyQuip4:"脑洞已开,等你投喂。",emptyQuip5:"别看我可爱,活儿我也会干。",emptyQuip6:"今天的奇思妙想,请开始表演。",emptyQuip7:"来,把那个“要不试试”做出来。",emptyQuip8:"你先开个头,我来接着整。",emptyQuip9:"小爪子就位,准备开工。",emptyQuip10:"先整点东西,再假装深思熟虑。",emptyQuip11:"把想法丢过来,我接着。",emptyQuip12:"灵感可以离谱,咱们慢慢靠谱。",emptyQuip13:"今天也要把“不一定”变成“搞定”。",emptyQuip14:"摸鱼暂停,脑洞营业。",emptyQuip15:"有什么大胆的想法?我先坐稳。",emptyQuip16:"我没睡,只是在闭眼加载灵感。",emptyWakeReply:"醒了醒了,这就开工。",emptyFishReply:"来了来了!",emptyCuriousReply:"好家伙,来真的啊。",emptyPartnerReply:"收到,开整。",emptyLoading:"正在加载会话…",file:"文件",fileViewer:"{{name}} 文件查看器",collapseProjectTree:"收起项目目录",expandProjectTree:"展开项目目录",exitExpanded:"退出放大",expandFile:"放大文件",returnChat:"返回聊天",hideFile:"收起文件",chat:"聊天",collapse:"收起",browseProject:"预览项目目录",fileWorkspaceTitle:"项目文件",resizeChatFile:"调整聊天和文件宽度",standaloneReadFailed:"读取文件失败",standaloneViewer:"{{name}} 独立文件预览",reloadFile:"重新读取",standaloneImage:"{{name}} 图片预览",standaloneHtml:"{{name}} HTML 预览",loadingFile:"正在读取文件…",slashLoadingMore:"正在加载其他命令…",slashMoreFailed:"其他命令加载失败",slashCandidates:"Slash Command 候选",slashLoading:"正在加载命令…",slashFailed:"命令加载失败",slashEmpty:"无匹配命令",slashSummary:"{{commands}} 条命令 \xb7 {{groups}} 类",slashCount:"{{count}} 条命令",slashUpDown:"↑↓ 选择",slashEnter:"Enter 选择",slashEscape:"Esc 关闭",slashGroupBuiltin:"Pi 内置命令",slashGroupSkill:"Skills",slashGroupPrompt:"提示模板",slashGroupExtension:"扩展命令",reloadDescription:"重新读取 Pi 最新配置与扩展资源",chatMessages:"{{name}}聊天消息",sessionWindows:"工作会话窗口",fixedSession:"固定",primarySession:"主会话",sourceSyncing:"会话正在同步,请稍后重试",draftSaveFailed:"草稿保存失败",imageProcessFailed:"图片处理失败",draftImage:"草稿图片",uncertainRecovered:"已恢复上次发送状态未知的内容,请确认后重发。",draftLoadFailed:"加载草稿失败",imageAddLimit:"单次最多添加 10 张图片",imageUnavailable:"图片不可用",imageAddOverflow:"已达到 10 张图片上限,其余文件未添加",resolveOutboxFirst:"请先处理上一条待确认发送内容",emptyInput:"请输入文字或添加图片",imageSendLimit:"单次最多发送 10 张图片",imagesPending:"图片仍在处理中",imageProcessingFailed:"存在处理失败的图片",imageBytesLimit:"单次发送图片总量不能超过 20MB",messageBytesLimit:"聊天发送内容超过 31MB",outboxRestored:"待确认内容已恢复到草稿。",outboxDeleted:"待确认内容已删除。",interruptFailed:"打断当前响应失败",restoredImage:"恢复图片 {{count}}",queuesRestored:"全部排队消息已恢复到草稿。",queueRestoreFailed:"恢复全部排队消息失败",modelCatalogFailed:"加载模型目录失败",setModelFailed:"设置模型失败",imageIdentityInvalid:"聊天图片身份无效",localImagePending:"本机临时图片尚未就绪",imageFileFailed:"{{name}}:{{error}}",treeLoadFailed:"读取会话树失败",treeSourceInvalid:"工作会话已失效,无法打开会话树",treeDetailFailed:"读取节点详情失败",branchTargetMissing:"分支操作返回的目标工作会话不存在",branchOperationFailed:"执行分支操作失败",interruptForBranchFailed:"停止当前响应失败",treeChanged:"工作会话已经变化,请重新打开会话树",cloneUnavailable:"工作会话已失效,无法克隆",branchUnavailable:"工作会话已失效,无法继续操作",branchChanged:"工作会话已经变化,请重新操作",chatCacheMismatch:"本地缓存与聊天同步起点不一致,需要全量同步",chatMessageMissing:"聊天消息不存在:{{index}}/{{entryId}}",gitNoProjectBranches:"当前项目未绑定工作会话,暂时无法读取 Git 分支",gitBranchesReadFailed:"读取 Git 分支失败",gitNoProjectStatus:"当前项目未绑定工作会话,暂时无法读取 Git 状态",gitNoProjectOperation:"当前项目未绑定工作会话,暂时无法执行 Git 操作",outboxMissing:"没有可恢复的待确认发送内容",imageDecodeFailed:"图片无法解码",imageInvalidDimensions:"图片尺寸无效",canvasUnavailable:"浏览器无法创建图片画布",imageCompressFailed:"浏览器图片压缩失败",imageTypeUnsupported:"仅支持 JPEG、PNG、WebP、GIF 或 BMP 图片",singleImageLimit:"单张图片不能超过 10MB",compressedImageTooLarge:"图片压缩后仍超过 10MB",compressedTypeUnsupported:"图片压缩格式不受支持"}}},32892:(e,t,i)=>{"use strict";i.d(t,{Bc:()=>p,ZI:()=>g,k$:()=>h,m_:()=>m});var n=i(7962),a=i(82480),s=i(94970),o=i(68868),r=i(47716),l=i(64796),c=i(69036),d=i(76478),u=i(49426);function p({delay:e=0,...t}){return(0,n.jsx)(a.B,{"data-slot":"tooltip-provider",delay:e,...t})}function m({...e}){return(0,n.jsx)(s.s,{"data-slot":"tooltip",...e})}function h({...e}){return(0,n.jsx)(o.k,{"data-slot":"tooltip-trigger",...e})}function g({className:e,side:t="top",sideOffset:i=4,align:a="center",alignOffset:s=0,children:o,...p}){return(0,n.jsx)(r.K,{children:(0,n.jsx)(l.o,{align:a,alignOffset:s,side:t,sideOffset:i,className:"isolate z-50",children:(0,n.jsxs)(c.o,{"data-slot":"tooltip-content",className:(0,u.cn)("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-2 rounded-md bg-foreground px-2 py-1 text-xs leading-5 text-background duration-100 motion-reduce:animate-none has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...p,children:[o,(0,n.jsx)(d.P,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}},33550:(e,t,i)=>{"use strict";i.d(t,{E6:()=>g,TX:()=>y,ZQ:()=>f});var n=i(69266),a=i(38979);let s="pi-super:code-preferences",o=a.Ik({wrapLines:a.zM().default(!0),diffViewMode:a.k5(["side-by-side","inline"]).default("side-by-side"),collapseUnchanged:a.zM().default(!1)}),r=o.parse({}),l=new Set,c=null;function d(e){try{window.localStorage.setItem(s,JSON.stringify(e))}catch(e){console.warn("[Pi Desk][CodePreferences] 保存代码显示偏好失败",e)}}function u(){try{let e=window.localStorage.getItem(s);if(null!==e){let t=o.safeParse(JSON.parse(e));return t.success?t.data:r}let t=a.Ik({wrapLines:a.zM()}).safeParse(JSON.parse(window.localStorage.getItem("pi-super:project-preview:global")??"null"));if(t.success){let e={...r,wrapLines:t.data.wrapLines};return d(e),e}}catch{}return r}function p(e,t){return e?.wrapLines===t.wrapLines&&e.diffViewMode===t.diffViewMode&&e.collapseUnchanged===t.collapseUnchanged}function m(){for(let e of l)e()}function h(e){if(null!==e.key&&e.key!==s)return;let t=u();p(c,t)||(c=t,m())}function g(){return c??=u()}function f(e){let t=o.parse({...g(),...e});p(c,t)||(c=t,d(t),m())}function v(e){return 0===l.size&&(c=u(),window.addEventListener("storage",h)),l.add(e),()=>{l.delete(e),0===l.size&&window.removeEventListener("storage",h)}}function y(){return(0,n.useSyncExternalStore)(v,g,()=>r)}},35989:(e,t,i)=>{"use strict";i.d(t,{A_:()=>d,Hj:()=>l,XB:()=>u,eP:()=>h,iH:()=>p,lN:()=>m,oW:()=>r,oY:()=>o,ws:()=>c});var n=i(15265),a=i(93540),s=i(82075);function o(e){let t=new Map;for(let i of e){let e=i.split("/").filter(Boolean),n=t,a="";for(let[t,s]of e.entries()){a=a?`${a}/${s}`:s;let o=n.get(s);o||(o={name:s,path:a,branchName:null,children:new Map},n.set(s,o)),t===e.length-1&&(o.branchName=i),n=o.children}}return function e(t){return[...t].sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:"base"})).map(t=>({name:t.name,path:t.path,branchName:t.branchName,children:e(t.children.values())}))}(t.values())}function r(e,t){return(0,s._J)(e,t)}function l(e,t){return t.split("/").at(-1)||e}function c(e){return"branch"===e.type?e.name:`@ ${e.commit.slice(0,7)}`}function d(e,t,i="en"){if(0===t.length)return null;let s=a.C[i];if(1===t.length){let a=t[0],o=l(e,a.root);if("unavailable"===a.state){let e=s.gitUnavailable;return{full:a.root?`${o} \xb7 ${e}`:e,compact:"Git !",title:`${o}${"en"===i?": ":":"}${(0,n.fD)(a.message,i)}`,diverged:!0}}let r=c(a.head);return{full:a.root?`${o} \xb7 ${r}`:r,compact:r,title:`${s.gitBranches}: ${o} \xb7 ${r}`,diverged:"detached"===a.head.type}}let o=`${t.length} ${s.repositoriesUnit}`;return{full:o,compact:`Git ${t.length}`,title:`${s.gitBranches}: ${o}`,diverged:!1}}function u(e){let t=[e.indexStatus,e.worktreeStatus];return t.includes("unmerged")?"!":t.includes("deleted")?"D":t.includes("renamed")?"R":t.includes("added")?"A":t.includes("modified")?"M":"?"}function p(e){let t=u(e);return"D"===t?"text-muted-foreground":"?"===t?"text-red-600 dark:text-red-400":"A"===t?"text-emerald-600 dark:text-emerald-400":"!"===t?"text-violet-600 dark:text-violet-400":"text-blue-600 dark:text-blue-400"}function m(e,t,i){if(/^(?:[a-z]:|\/|\\\\)/i.test(t))return null;let n=/^[a-z]:[\\/]/i.test(e)||e.startsWith("\\\\"),a=e=>n?e.toLowerCase():e,s=[...i].sort((e,t)=>t.root.length-e.root.length).find(e=>!e.root||a(t).startsWith(`${a(e.root)}/`));if(!s)return null;let o=s.root?t.slice(s.root.length+1):t;return{repository:s,path:o,change:"ready"===s.state?s.changes.find(e=>a(e.path)===a(o)):void 0}}function h(e){return e.flatMap(e=>"ready"===e.state?e.changes.map(t=>({repositoryRoot:e.root,repository:e,path:t.path,projectPath:r(e.root,t.path),change:t})):[])}},36510:(e,t,i)=>{"use strict";i.d(t,{z:()=>a});let n=`<script>
2
+ window.addEventListener('keydown', function (event) {
3
+ if (event.defaultPrevented || event.isComposing || event.repeat) return;
4
+ if (event.key === 'Escape' && !event.ctrlKey && !event.altKey && !event.metaKey && !event.shiftKey) {
5
+ event.preventDefault();
6
+ window.parent.postMessage('pi-desk:file-escape', '*');
7
+ } else if (event.key === 'Tab' && event.ctrlKey && !event.altKey && !event.metaKey) {
8
+ event.preventDefault();
9
+ window.parent.postMessage('pi-desk:file-switch-pane', '*');
10
+ }
11
+ });
12
+ </script>`;function a(e){return`${e}
13
+ ${n}`}},38903:(e,t,i)=>{"use strict";i.d(t,{Y8:()=>n,c4:()=>s,eN:()=>o,qD:()=>a});let n="compact",a="pi-desk:display-size",s="pi-super:work-session-visual";function o(e,t){return"compact"===e||"standard"===e||"large"===e?e:null===e&&null!==t&&"object"==typeof t&&!Array.isArray(t)&&"chatSize"in t&&"large"===t.chatSize?"standard":n}},42515:(e,t,i)=>{"use strict";i.d(t,{OY:()=>u});var n=i(38979),a=i(267),s=i(9626);let o=n.Yj().trim().min(1).max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),r=n.g1(n.Yj(),n.Pq()),l=n.Ik({pluginName:o,method:o,scope:n.eu("global"),input:r}).strict(),c=n.Ik({pluginName:o,method:o,scope:n.eu("session"),source:a.R,input:r}).strict(),d=n.gM("scope",[l,c]),u=Object.freeze({invoke:(0,s.Vc)({path:"plugins/invoke",inputSchema:d,outputSchema:r})})},46782:(e,t,i)=>{"use strict";i.d(t,{P:()=>n});let n={en:{imagePreview:"Skill image preview",chooseFile:"Select a Skill file",chooseFileDescription:"Choose a Skill from your projects to view or edit its instructions, scripts and reference files.",global:"Global",project:"Project",package:"Package",local:"Local",saving:"Saving",switchingFile:"Switching files",unsavedChanges:"Unsaved changes",readOnlyFile:"Read-only file",fileSaved:"File saved",unsaved:"Unsaved",readOnly:"Read-only",saved:"Saved",copySkillPath:"Copy Skill file path",copyPath:"Copy file path",saveSkill:"Save Skill file",save:"Save",reload:"Reload",loadingFile:"Loading file…",fileSize:"{{size}} bytes",saveShortcut:"Ctrl / ⌘ S to save",wrapLines:"Wrap lines",retryFolder:"Retry folder",loadingFolder:"Loading folder…",skillFile:"Skill file: {{path}}",skillName:"Skill: {{name}}",emptyFolder:"Empty folder",folderTruncated:"Too many entries; showing part of the folder.",skillFolder:"Skill folder: {{path}}",packageSkill:"Skill from a package",globalSkills:"Global Skills",projectSkills:"Project Skills: {{name}}",skillsGroup:"Skills group: {{name}}",retryGroup:"Retry group",noSkillMatches:"No matching Skills in this group",noSkills:"No Skills found in this group",diagnostics_one:"{{count}} resource diagnostic",diagnostics_other:"{{count}} resource diagnostics",searchSkills:"Search projects or Skills",searchSkillsPlaceholder:"Search projects or Skills…",workspaceCount_one:"Current workspace \xb7 {{count}} project",workspaceCount_other:"Current workspace \xb7 {{count}} projects",workspaceEmpty:"No projects in this workspace. Global Skills are still available.",pathCopied:"File path copied",copyFailed:"Could not copy. Check browser clipboard permission.",skillsManagement:"Manage Skills",openSkillsFolder:"Open Skills folder",collapseSkillsFolder:"Collapse Skills folder",expandSkillsFolder:"Expand Skills folder",refreshSkillsFolder:"Refresh Skills folder",refreshFolder:"Refresh folder",skillsProjectFolder:"Skills project folder",skillsFolderTitle:"Skills folder",saveChangesTitle:"Save file changes?",saveChangesDescription:"Changes to {{path}} are not saved.",cancel:"Cancel",discard:"Discard changes",savingChanges:"Saving…",saveContinue:"Save and continue",saveFailed:"Could not save file",fileReadFailed:"Could not read file",skillsReadFailed:"Could not load Skills",directoryReadFailed:"Could not read folder"},"zh-CN":{imagePreview:"Skill 图片预览",chooseFile:"选择一个 Skill 文件",chooseFileDescription:"从项目目录中选择 Skill,查看和编辑它的说明、脚本与参考文件。",global:"全局",project:"项目",package:"包",local:"本地",saving:"正在保存",switchingFile:"正在切换文件",unsavedChanges:"有未保存修改",readOnlyFile:"文件只读",fileSaved:"文件已保存",unsaved:"未保存",readOnly:"只读",saved:"已保存",copySkillPath:"复制 Skill 文件路径",copyPath:"复制文件路径",saveSkill:"保存 Skill 文件",save:"保存",reload:"重新读取",loadingFile:"正在读取文件…",fileSize:"{{size}} 字节",saveShortcut:"Ctrl / ⌘ S 保存",wrapLines:"自动换行",retryFolder:"重试目录",loadingFolder:"正在读取目录…",skillFile:"Skill 文件:{{path}}",skillName:"Skill:{{name}}",emptyFolder:"空目录",folderTruncated:"目录项过多,仅显示部分内容。",skillFolder:"Skill 目录:{{path}}",packageSkill:"包提供的 Skill",globalSkills:"全局 Skills",projectSkills:"项目 Skills:{{name}}",skillsGroup:"Skills 分组:{{name}}",retryGroup:"重试分组",noSkillMatches:"此分组没有匹配的 Skill",noSkills:"此分组没有发现 Skills",diagnostics_one:"{{count}} 项资源诊断",diagnostics_other:"{{count}} 项资源诊断",searchSkills:"搜索项目或 Skill",searchSkillsPlaceholder:"搜索项目或 Skill…",workspaceCount_one:"当前工作区 \xb7 {{count}} 个项目",workspaceCount_other:"当前工作区 \xb7 {{count}} 个项目",workspaceEmpty:"工作区暂无项目,仍可管理全局 Skills。",pathCopied:"文件路径已复制",copyFailed:"复制失败,请检查浏览器剪贴板权限",skillsManagement:"Skills 管理",openSkillsFolder:"打开 Skills 目录",collapseSkillsFolder:"收起 Skills 目录",expandSkillsFolder:"展开 Skills 目录",refreshSkillsFolder:"刷新 Skills 目录",refreshFolder:"刷新目录",skillsProjectFolder:"Skills 项目目录",skillsFolderTitle:"Skills 目录",saveChangesTitle:"保存文件修改?",saveChangesDescription:"{{path}} 的修改尚未保存。",cancel:"取消",discard:"放弃修改",savingChanges:"正在保存…",saveContinue:"保存并继续",saveFailed:"保存失败",fileReadFailed:"读取文件失败",skillsReadFailed:"读取 Skills 失败",directoryReadFailed:"读取目录失败"}}},51821:(e,t,i)=>{"use strict";i.d(t,{G:()=>w,c:()=>k});var n=i(7962),a=i(96381),s=i(89261),o=i(42360),r=i(47800),l=i(82136),c=i(71859),d=i(73208),u=i(45968),p=i(85937),m=i(94173),h=i(27315),g=i(10672),f=i(49362),v=i(69266),y=i(78121),x=i(49426);function b(){let{t:e}=(0,y.Bd)("common"),t=a.I();return(0,n.jsx)(n.Fragment,{children:t.toasts.slice(0,3).map(t=>{let i=t.data?.level??"info";return(0,n.jsxs)(s.m,{toast:t,"data-pi-desk-toast":i,className:(0,x.cn)("pointer-events-auto flex w-full items-start gap-3 rounded-xl border bg-popover px-3 py-3 text-popover-foreground shadow-md transition-[transform,opacity] duration-200 data-starting-style:translate-y-2 data-starting-style:opacity-0 data-ending-style:translate-y-2 data-ending-style:opacity-0","error"===i?"border-destructive/40":"warning"===i?"border-status-warning/40":"border-border"),children:["error"===i?(0,n.jsx)(p.A,{className:"mt-0.5 size-4 shrink-0 text-destructive"}):"warning"===i?(0,n.jsx)(m.A,{className:"mt-0.5 size-4 shrink-0 text-status-warning"}):"success"===i?(0,n.jsx)(h.A,{className:"mt-0.5 size-4 shrink-0 text-status-success"}):(0,n.jsx)(g.A,{className:"mt-0.5 size-4 shrink-0 text-primary"}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)(o.S,{className:"text-sm leading-5 font-medium"}),(0,n.jsx)(r.a,{className:"mt-1 text-sm leading-5 text-muted-foreground"})]}),(0,n.jsx)(l.e,{"aria-label":e("closeNotice"),title:e("closeNotice"),className:"flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,n.jsx)(f.A,{className:"size-3.5"})})]},t.id)})})}function k({children:e}){return(0,n.jsxs)(c.t,{timeout:3e3,limit:3,children:[e,(0,n.jsx)(d.S,{children:(0,n.jsx)(u.U,{className:"fixed right-3 bottom-3 z-[200] flex w-[min(24rem,calc(100vw-1.5rem))] flex-col gap-2 outline-none sm:right-5 sm:bottom-5",children:(0,n.jsx)(b,{})})})]})}function w(){let{add:e}=a.I(),{t}=(0,y.Bd)("common");return(0,v.useMemo)(()=>{let i=i=>{let n=i.title.trim().slice(0,120),a=i.description?.trim().slice(0,320);return e({title:n||t("pluginNotice"),...a?{description:a}:{},type:i.level,..."error"===i.level||"warning"===i.level?{priority:"high"}:{},data:{level:i.level}})};return{show:i,success:e=>i({level:"success",title:e}),error:e=>i({level:"error",title:e})}},[e,t])}},55438:(e,t,i)=>{"use strict";i.d(t,{PS:()=>d,ef:()=>l,gK:()=>c,hS:()=>r,mv:()=>m});var n=i(38979),a=i(59605),s=i(70698),o=i(85232);let r=n.Ik({type:n.eu("message_start"),snapshot:a.s4}).strict(),l=n.Ik({type:n.eu("message_update"),location:a.fb,fixed:a.dG.optional(),summary:a.XW.optional(),detail:a.wH.optional(),increments:a.fK.optional()}).strict().superRefine((e,t)=>{if(!e.fixed&&!e.summary&&!e.detail&&!e.increments)return void t.addIssue({code:"custom",message:"message update requires a changed layer"});let i=[];for(let t of Object.keys(e.increments??{}))try{i.push({raw:t,parsed:(0,o.U)(t)})}catch{}for(let n of i){let i="summary"===n.parsed.root?Object.keys(e.summary??{}):Object.keys(e.detail??{}),a=n.parsed.segments[0];(0===n.parsed.segments.length||"string"==typeof a&&i.includes(a))&&t.addIssue({code:"custom",message:"replacement and increment paths cannot overlap",path:["increments",n.raw]})}for(let e=0;e<i.length;e+=1)for(let n=e+1;n<i.length;n+=1){let a=i[e],s=i[n];((0,o.v)(a.parsed,s.parsed)||(0,o.v)(s.parsed,a.parsed))&&t.addIssue({code:"custom",message:"increment parent and child paths cannot overlap",path:["increments",s.raw]})}}),c=n.Ik({type:n.eu("message_commit"),location:a.fb,durable:a.V6,fixed:n.Ik({timestampMs:s.k}).strict()}).strict(),d=n.Ik({type:n.eu("message_discard"),location:a.fb}).strict(),u=n.Ik({type:n.eu("durable_append"),messages:n.YO(a.mj).min(1)}).strict().superRefine((e,t)=>{let i=new Set;for(let[n,a]of e.messages.entries())n>0&&a.location.index!==e.messages[n-1].location.index+1&&t.addIssue({code:"custom",message:"durable append message indexes must be continuous",path:["messages",n,"location","index"]}),i.has(a.location.entryId)&&t.addIssue({code:"custom",message:"durable append entryId values must be unique",path:["messages",n,"location","entryId"]}),i.add(a.location.entryId)}),p=n.KC([r,l,c,d]),m=n.KC([u,p])},55945:(e,t,i)=>{"use strict";i.d(t,{F:()=>B});var n=i(7962),a=i(71057),s=i(14228),o=i(19932),r=i(49762),l=i(95526),c=i(14044),d=i(36670),u=i(65770),p=i(66584),m=i(31761),h=i(41148),g=i(49362),f=i(90213),v=i(69266),y=i(78121),x=i(15265),b=i(5816),k=i(49426),w=i(81649),C=i(50479);let S=(0,v.createContext)({expandedPaths:new Set,togglePath:()=>{}}),j=({expanded:e,defaultExpanded:t=new Set,selectedPath:i,onSelect:a,onExpandedChange:s,className:o,children:r,...l})=>{let[c,d]=(0,v.useState)(t),u=e??c,p=(0,v.useCallback)(e=>{let t=new Set(u);t.has(e)?t.delete(e):t.add(e),d(t),s?.(t)},[u,s]),m=(0,v.useMemo)(()=>({expandedPaths:u,onSelect:a,selectedPath:i,togglePath:p}),[u,a,i,p]);return(0,n.jsx)(S.Provider,{value:m,children:(0,n.jsx)("div",{className:(0,k.cn)("rounded-lg border bg-background font-sans text-sm",o),role:"tree",...l,children:(0,n.jsx)("div",{className:"p-2",children:r})})})},I=({className:e,children:t,...i})=>(0,n.jsx)("span",{className:(0,k.cn)("shrink-0",e),...i,children:t}),R=({className:e,children:t,...i})=>(0,n.jsx)("span",{className:(0,k.cn)("truncate",e),...i,children:t}),F=(0,v.createContext)({isExpanded:!1,name:"",path:""}),P=({path:e,name:t,className:i,children:a,...s})=>{let{expandedPaths:o,togglePath:r,selectedPath:l,onSelect:c}=(0,v.useContext)(S),u=o.has(e),m=l===e,h=(0,v.useCallback)(()=>{r(e)},[r,e]),g=(0,v.useCallback)(()=>{c?.(e)},[c,e]),f=(0,v.useMemo)(()=>({isExpanded:u,name:t,path:e}),[u,t,e]);return(0,n.jsx)(F.Provider,{value:f,children:(0,n.jsx)(w.Nt,{onOpenChange:h,open:u,children:(0,n.jsxs)("div",{className:(0,k.cn)("",i),role:"treeitem","aria-expanded":u,"aria-selected":m,tabIndex:0,...s,children:[(0,n.jsxs)("div",{className:(0,k.cn)("flex min-h-9 w-full items-center gap-2 rounded-md px-2 py-1 text-left transition-colors hover:bg-foreground/8",m&&"bg-accent"),children:[(0,n.jsx)(w.R6,{render:(0,n.jsx)("button",{className:"flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md border-none bg-transparent p-0 outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`${u?"收起":"展开"} ${t}`,type:"button"}),children:(0,n.jsx)(d.A,{className:(0,k.cn)("size-4 shrink-0 text-muted-foreground transition-transform",u&&"rotate-90")})}),(0,n.jsxs)("button",{className:"flex min-h-7 min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md border-none bg-transparent p-0 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:g,type:"button",children:[(0,n.jsx)(I,{children:u?(0,n.jsx)(C.A,{className:"size-4 text-muted-foreground"}):(0,n.jsx)(p.A,{className:"size-4 text-muted-foreground"})}),(0,n.jsx)(R,{children:t})]})]}),(0,n.jsx)(w.Ke,{children:(0,n.jsx)("div",{className:"ml-4 border-l pl-2",children:a})})]})})})},M=(0,v.createContext)({name:"",path:""}),D=({path:e,name:t,icon:i,className:a,children:s,...o})=>{let{selectedPath:r,onSelect:c}=(0,v.useContext)(S),d=r===e,u=(0,v.useCallback)(()=>{c?.(e)},[c,e]),p=(0,v.useCallback)(t=>{("Enter"===t.key||" "===t.key)&&c?.(e)},[c,e]),m=(0,v.useMemo)(()=>({name:t,path:e}),[t,e]);return(0,n.jsx)(M.Provider,{value:m,children:(0,n.jsx)("div",{className:(0,k.cn)("flex min-h-9 cursor-pointer items-center gap-2 rounded-md px-2 py-1 outline-none transition-colors hover:bg-foreground/8 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",d&&"bg-accent",a),onClick:u,onKeyDown:p,role:"treeitem","aria-selected":d,tabIndex:0,...o,children:s??(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"size-6 shrink-0"}),(0,n.jsx)(I,{children:i??(0,n.jsx)(l.A,{className:"size-4 text-muted-foreground"})}),(0,n.jsx)(R,{children:t})]})})})};var N=i(74675),T=i(86963),E=i(17511),L=i(35989),O=i(60682),z=i(82075);let A=[];function U(e){let t=e.split("/").at(-1)?.toLocaleLowerCase()??"",i=t.includes(".")?t.split(".").at(-1)??"":"";return["png","jpg","jpeg","webp","gif"].includes(i)?(0,n.jsx)(a.A,{className:"size-4 text-muted-foreground"}):"json"===i||"jsonl"===i?(0,n.jsx)(s.A,{className:"size-4 text-muted-foreground"}):["md","mdx","txt"].includes(i)?(0,n.jsx)(o.A,{className:"size-4 text-muted-foreground"}):["ts","tsx","js","jsx","mjs","cjs","py","go","rs","java","c","cpp","h","hpp","css","scss","html","xml","yaml","yml","toml","sql","sh"].includes(i)?(0,n.jsx)(r.A,{className:"size-4 text-muted-foreground"}):(0,n.jsx)(l.A,{className:"size-4 text-muted-foreground"})}function q(e){if(e)return(0,L.iH)(e.change)}function Y({state:e,onRetry:t}){let{t:i}=(0,y.Bd)("projectFiles");return e&&"idle"!==e.status&&"loading"!==e.status?"error"!==e.status?null:(0,n.jsx)("button",{type:"button",onClick:t,className:"min-h-8 w-full rounded px-2 text-left text-xs text-destructive hover:bg-destructive/10",children:i("retryReading",{error:e.error})}):(0,n.jsxs)("div",{className:"flex min-h-8 items-center gap-2 px-2 text-xs text-muted-foreground",children:[(0,n.jsx)(c.A,{className:"size-3.5 animate-spin"})," ",i("reading")]})}function B({cwd:e,projectName:t,runtime:i,gitRuntime:a,onOpenGitBranches:s,onFileOpened:o,rootTitle:r,gitReadOnly:l=!1}){let w,C,S,{t:F}=(0,y.Bd)("projectFiles"),{locale:M}=(0,b.i)();(0,v.useSyncExternalStore)(i.subscribe,i.getRevision,i.getRevision),(0,v.useSyncExternalStore)(a.subscribe,a.getRevision,a.getRevision);let W=i.state,_=a.getWorkspace(e),V=(0,v.useRef)(null),$=(0,v.useRef)(null),G=W.searchOpen,[K,Q]=(0,v.useState)({}),H=(e,t)=>{let i=K[e]??300;return i<t?(0,n.jsx)("button",{type:"button",className:"min-h-8 px-3 text-sm text-muted-foreground hover:bg-accent",onClick:t=>{t.stopPropagation(),Q(t=>({...t,[e]:i+300}))},children:F("showMore",{visible:i,total:t})}):null},J=W?.search.query??"",X=_?.snapshot.repositories??A,Z=(0,L.eP)(X),ee=new Map(Z.map(e=>[e.projectPath,e])),et=X.map(e=>e.root).filter(Boolean);(0,v.useEffect)(()=>{i.ensureRoot(),a.ensureSnapshot(e)},[e,a,i]),(0,v.useEffect)(()=>{let e=V.current;e&&W&&(e.scrollTop=W.treeScrollTop)},[W]),(0,v.useEffect)(()=>{if(!J.trim()||_?.changesOnly)return;let e=window.setTimeout(()=>void i.search(J),220);return()=>window.clearTimeout(e)},[_?.changesOnly,i,J]);let ei=[..._?.expandedRepositories??[]].join("\0");(0,v.useEffect)(()=>{if(_&&"repository"===_.layout)for(let e of _.expandedRepositories)i.ensureDirectory(e)},[ei,_,i]);let en=new Set(et),ea=new Map,es=new Set([...W.expandedPaths].map(e=>(0,z.Im)("directory",e))),eo=(e,t)=>{let n=new Set(W.expandedPaths);for(let i of e.paths)t?n.add(i):n.delete(i);i.setExpandedPaths(n,!1),t&&!_?.changesOnly&&i.expandDirectoryChain(e.path,en)},er=e=>{for(let[t,i]of[...ea].filter(([t])=>e.has((0,z.Im)("directory",t))!==W.expandedPaths.has(t)))eo(i,e.has((0,z.Im)("directory",t)))},el=e=>{i.openFile(e),o?.()},ec=e=>{i.openDiff(e.repositoryRoot,e.path),o?.()},ed=(t,a)=>(0,n.jsx)(O.J,{cwd:e,path:t.targetPath,type:"directory",trigger:a,expanded:W.expandedPaths.has(t.path),onToggle:()=>eo(t,!W.expandedPaths.has(t.path)),onReveal:i.canReveal?(e,t)=>i.revealFile(e,t):void 0},(0,z.Im)("directory",t.path)),eu=(t,a,s=null,o=!1)=>(0,n.jsx)(O.J,{cwd:e,path:t,type:"file",trigger:a,openLabel:F(o?"viewDiff":"openPreview"),onOpen:()=>o&&s?ec(s):el(t),oldPath:s?.change.oldPath?(0,z._J)(s.repositoryRoot,s.change.oldPath):void 0,onReveal:i.canReveal?(e,t)=>i.revealFile(e,t):void 0},(0,z.Im)("file",t)),ep=(e,t,i,a)=>eu(e,(0,n.jsxs)(D,{path:(0,z.Im)("file",e),name:t,title:e,"data-testid":`project-file-${e}`,onClick:()=>{a&&i?ec(i):el(e)},children:[(0,n.jsx)("span",{className:"size-6 shrink-0"}),(0,n.jsx)(I,{children:U(e)}),(0,n.jsx)(R,{"data-testid":`project-file-name-${e}`,className:(0,k.cn)("min-w-0 flex-1",q(i)),children:t}),i?(0,n.jsx)("span",{className:(0,k.cn)("text-xs tabular-nums",q(i)),"aria-label":F("gitStatus",{status:(0,L.XB)(i.change)}),children:(0,L.XB)(i.change)}):null]}),i,a),em=(e,t,a)=>{let s=W?.directories.get(e);if(s?.status!=="ready")return(0,n.jsx)(Y,{state:s,onRetry:()=>void i.ensureDirectory(e)});let o=a?s.entries.filter(i=>{let n;return n=(0,z._J)(e,i.name),!et.some(e=>e!==t&&n===e)}):s.entries;return(0,n.jsxs)(n.Fragment,{children:[o.slice(0,K[`directory:${e}`]??300).map(s=>{let o=(0,z._J)(e,s.name);if("file"===s.type)return ep(o,s.name,ee.get(o)??null,!1);let r=i.compactDirectory(o,en);return ea.set(o,r),ed(r,(0,n.jsx)(P,{path:(0,z.Im)("directory",o),name:r.label,title:r.targetPath,"data-testid":`project-folder-${o}`,children:em(r.targetPath,t,a)}))}),H(`directory:${e}`,o.length),s.truncated?(0,n.jsx)("p",{className:"px-2 py-2 text-xs leading-5 text-amber-600 dark:text-amber-400",children:F("directoryLimit")}):null,0===o.length?(0,n.jsx)("p",{className:"px-2 py-2 text-xs text-muted-foreground",children:F("emptyDirectory")}):null]})},eh=(e,t)=>{let i=e.get(t);if(!i)return null;let a=[...i.directories.keys()].sort(z.Kn),s=[...i.files].sort(z.Kn),o=K[`changes:${t}`]??300;return(0,n.jsxs)(n.Fragment,{children:[a.slice(0,o).map(t=>{let i=(0,z.xV)(t,e,en);return ea.set(t,i),ed(i,(0,n.jsx)(P,{path:(0,z.Im)("directory",t),name:i.label,title:i.targetPath,"data-testid":`project-folder-${t}`,children:eh(e,i.targetPath)}))}),s.slice(0,Math.max(0,o-a.length)).map(e=>ep(e,e.slice(e.lastIndexOf("/")+1),ee.get(e)??null,!0)),H(`changes:${t}`,a.length+s.length)]})},eg=e=>{if(e.startsWith("directory:")){let t=ea.get(e.slice(10));t&&eo(t,!W.expandedPaths.has(t.path));return}let t=e.slice(5),i=ee.get(t);_?.changesOnly&&i?ec(i):el(t)},ef=(o,r,c)=>{if(_?.changesOnly&&!o)return null;let h=_?.expandedRepositories.has(r)??!1,g=o?.state==="ready"?Z.filter(e=>e.repositoryRoot===r):[],f=g.length;if(_?.changesOnly&&o?.state==="ready"&&0===f)return null;let v=(0,z.OA)(g.map(e=>e.projectPath),r);return(0,n.jsxs)("section",{"data-testid":`project-git-repository-${r||"root"}`,className:"border-b last:border-b-0",children:[(0,n.jsxs)("div",{className:"flex min-h-8 items-center gap-1 px-1 py-0.5",children:[(0,n.jsxs)("button",{"data-testid":`project-git-repository-toggle-${r||"root"}`,type:"button",className:"flex min-w-0 flex-1 items-center gap-1 rounded-md px-1 py-0.5 text-left hover:bg-muted/60","aria-expanded":h,onClick:()=>{h&&i.cancelDirectoryExpansion(r),a.toggleRepository(e,r),h||i.ensureDirectory(r)},children:[(0,n.jsx)(d.A,{className:(0,k.cn)("size-3 shrink-0 text-muted-foreground transition-transform",h&&"rotate-90")}),o?(0,n.jsx)(u.A,{className:"size-4 shrink-0 text-muted-foreground"}):(0,n.jsx)(p.A,{className:"size-4 shrink-0 text-muted-foreground"}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",title:o&&r||t,children:c})]}),o?(0,n.jsxs)("button",{"data-testid":`project-git-branch-${r||"root"}`,type:"button",disabled:l||"ready"!==o.state,className:(0,k.cn)((0,T.r)({variant:"outline",size:"sm"}),"max-w-28 shrink gap-1 font-mono text-xs text-muted-foreground"),title:"ready"===o.state?F(l?"gitBranchReadOnly":"gitBranches"):(0,x.fD)(o.message,M),onClick:()=>s(r),children:[(0,n.jsx)(m.A,{className:"size-3 shrink-0"}),(0,n.jsx)("span",{className:"min-w-0 truncate",children:"ready"===o.state?(0,L.ws)(o.head):F("unavailable")}),f>0?(0,n.jsx)("span",{className:"rounded-md bg-muted px-1 text-xs text-status-warning",children:f}):null]}):null]}),h?_?.changesOnly?(0,n.jsx)(j,{className:"rounded-none border-0 bg-transparent px-1 pb-1",expanded:es,selectedPath:W?.activeDiff?(0,z.Im)("file",(0,L.oW)(W.activeDiff.repositoryRoot,W.activeDiff.path)):void 0,onExpandedChange:er,onSelect:eg,children:f>0?eh(v,r):(0,n.jsx)("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:F("noChanges")})}):(0,n.jsx)(j,{className:"rounded-none border-0 bg-transparent px-1 pb-1",expanded:es,selectedPath:W.activePath?(0,z.Im)("file",W.activePath):void 0,onExpandedChange:er,onSelect:eg,children:em(r,o?.root??null,!0)}):null]},o?`git:${r}`:"workspace")},ev=Z.filter(e=>e.projectPath.toLocaleLowerCase().includes(J.trim().toLocaleLowerCase())),ey=G&&!!J.trim(),ex=1===X.length&&X[0]?.root===""?X[0]:null,eb=X.length>0&&!ex,ek=eb?_?.layout??"directory":"directory";return(0,n.jsxs)("section",{className:"flex h-full min-h-0 flex-col bg-sidebar","aria-label":F("projectFiles",{name:t}),children:[(0,n.jsxs)("div",{className:"space-y-1.5 border-b px-2.5 py-2",children:[(0,n.jsxs)("div",{className:"flex min-h-7 min-w-0 items-center gap-2",children:[(0,n.jsx)(O.J,{cwd:e,path:"",type:"directory",onReveal:i.canReveal?(e,t)=>i.revealFile(e,t):void 0,trigger:r?(0,n.jsx)("div",{className:"flex min-w-0 flex-1",children:r}):(0,n.jsxs)("div",{tabIndex:0,className:"flex min-w-0 flex-1 items-baseline gap-1",children:[(0,n.jsx)("p",{className:"shrink-0 truncate text-xs font-semibold",title:t,children:t}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:"\xb7"}),(0,n.jsx)("p",{className:"min-w-0 truncate font-mono text-xs text-muted-foreground",title:e,children:(w=e.replaceAll("\\","/").split("/").filter(Boolean)).length<=2?e:`…/${w.slice(-2).join("/")}`})]})}),ex?(0,n.jsxs)("button",{type:"button",disabled:l||"ready"!==ex.state,className:(0,k.cn)((0,T.r)({variant:"outline",size:"sm"}),"max-w-32 shrink gap-1 font-mono text-xs text-muted-foreground"),title:"ready"===ex.state?F(l?"gitBranchReadOnly":"gitBranches"):(0,x.fD)(ex.message,M),onClick:()=>s(""),children:[(0,n.jsx)(m.A,{className:"size-3 shrink-0"}),(0,n.jsx)("span",{className:"truncate",children:"ready"===ex.state?(0,L.ws)(ex.head):F("unavailable")})]}):null]}),G?(0,n.jsxs)(E.MG,{children:[(0,n.jsx)(E.Sq,{children:(0,n.jsx)(h.A,{className:"size-3.5"})}),(0,n.jsx)(E.iV,{ref:$,"data-testid":"project-file-search",value:J,onChange:e=>i.setSearchQuery(e.target.value),onKeyDown:e=>{"Escape"===e.key&&(i.setSearchQuery(""),i.setSearchOpen(!1))},placeholder:F("searchFiles"),"aria-label":F("searchFiles")}),(0,n.jsx)(E.Sq,{align:"inline-end",children:(0,n.jsx)(E.Ik,{size:"icon-xs",onClick:()=>{i.setSearchQuery(""),i.setSearchOpen(!1)},"aria-label":F("closeSearch"),children:(0,n.jsx)(g.A,{})})})]}):(0,n.jsxs)("div",{className:"flex min-h-8 min-w-0 items-center gap-1.5",children:[eb?(0,n.jsx)("div",{className:"flex shrink-0 rounded-md border bg-background/55 p-0.5",role:"group","aria-label":F("layout"),children:["directory","repository"].map(t=>(0,n.jsx)("button",{"data-testid":`project-file-layout-${t}`,type:"button","aria-pressed":ek===t,className:(0,k.cn)((0,T.r)({variant:"ghost",size:"sm"}),ek===t&&"bg-accent text-accent-foreground"),onClick:()=>{i.cancelDirectoryExpansion(),a.setLayout(e,t)},children:F("directory"===t?"directory":"repository")},t))}):null,X.length>0?(0,n.jsxs)("button",{"data-testid":"project-git-changes-toggle",type:"button","aria-pressed":_?.changesOnly??!1,className:(0,k.cn)((0,T.r)({variant:"outline",size:"sm"}),"min-w-0 gap-1",_?.changesOnly&&"bg-accent text-accent-foreground"),onClick:()=>{i.cancelDirectoryExpansion(),a.setChangesOnly(e,!_?.changesOnly)},children:[(0,n.jsx)(f.A,{className:"size-3 shrink-0"}),(0,n.jsx)("span",{className:"truncate",children:F("changesOnly")}),(0,n.jsx)("span",{className:"rounded-md bg-muted px-1 font-mono text-xs",children:Z.length})]}):null,(0,n.jsx)("button",{type:"button",className:(0,k.cn)((0,T.r)({variant:"outline",size:"icon-sm"}),"ml-auto"),"aria-label":F("searchProject"),title:F("searchProject"),onClick:()=>{i.setSearchOpen(!0),requestAnimationFrame(()=>$.current?.focus())},children:(0,n.jsx)(h.A,{className:"size-3.5"})})]})]}),(0,n.jsxs)(N.V,{className:"min-h-0 flex-1",viewportClassName:"py-1.5",viewportRef:V,onViewportScroll:e=>i.setTreeScrollTop(e.currentTarget.scrollTop),children:[X.filter(e=>"unavailable"===e.state).map(e=>"unavailable"===e.state?(0,n.jsxs)("p",{role:"alert",className:"mx-2 mb-1 break-words rounded-md bg-muted px-2 py-2 text-sm text-destructive",children:[e.root||t,":",(0,x.fD)(e.message,M)]},e.root):null),_?.snapshot.status==="error"?(0,n.jsx)("p",{className:"mx-2 mb-1 rounded-md bg-muted px-2 py-2 text-sm text-destructive",children:_.snapshot.error}):null,ey?(0,n.jsx)("div",{className:"space-y-0.5 px-1",children:_?.changesOnly?ev.length>0?ev.map(e=>eu(e.projectPath,(0,n.jsxs)("button",{type:"button",className:"flex min-h-10 w-full items-center gap-2 rounded-lg px-2 text-left hover:bg-muted/70",onClick:()=>{ec(e)},title:e.projectPath,children:[U(e.projectPath),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:(0,k.cn)("block truncate text-xs font-medium",q(e)),children:e.projectPath.split("/").at(-1)}),(0,n.jsx)("span",{className:"mt-0.5 block truncate font-mono text-xs text-muted-foreground",children:e.projectPath})]})]}),e,!0)):(0,n.jsx)("p",{className:"px-2 py-5 text-center text-xs text-muted-foreground",children:F("noMatches")}):(0,n.jsxs)(n.Fragment,{children:[W?.search.status==="loading"?(0,n.jsxs)("div",{className:"flex min-h-10 items-center gap-2 px-2 text-xs text-muted-foreground",children:[(0,n.jsx)(c.A,{className:"size-3.5 animate-spin"})," ",F("searching")]}):null,W?.search.status==="error"?(0,n.jsx)("p",{className:"px-2 py-2 text-xs text-destructive",children:W.search.error}):null,W?.search.status==="ready"?W.search.matches.map(e=>{let t=ee.get(e)??null;return eu(e,(0,n.jsxs)("button",{"data-testid":`project-search-result-${e}`,type:"button",onClick:()=>{el(e)},className:"flex min-h-10 w-full items-center gap-2 rounded-lg px-2 text-left hover:bg-muted/70",title:e,children:[(0,n.jsx)("span",{className:"shrink-0",children:U(e)}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:(0,k.cn)("block truncate text-xs font-medium",q(t)),children:e.split("/").at(-1)}),(0,n.jsx)("span",{className:"mt-0.5 block truncate font-mono text-xs text-muted-foreground",children:e})]})]}))}):null,W?.search.status==="ready"&&0===W.search.matches.length?(0,n.jsx)("p",{className:"px-2 py-5 text-center text-xs text-muted-foreground",children:F("noMatches")}):null,W?.search.status==="ready"&&W.search.truncated?(0,n.jsx)("p",{className:"px-2 py-2 text-xs text-amber-600 dark:text-amber-400",children:F("resultLimit")}):null]})}):"repository"===ek?(C=X.some(e=>""===e.root),S=_?.changesOnly?X.filter(e=>"unavailable"===e.state||e.changes.length>0):X,(0,n.jsxs)("div",{className:"px-1",children:[C?null:ef(null,"",t),S.map(e=>ef(e,e.root,(0,L.Hj)(t,e.root))),_?.changesOnly&&0===S.length?(0,n.jsx)("p",{className:"px-2 py-5 text-center text-xs text-muted-foreground",children:F("noChangedFiles")}):null]})):(()=>{if(_?.changesOnly){let e=(0,z.OA)(Z.map(e=>e.projectPath));return(0,n.jsx)(j,{className:"rounded-none border-0 bg-transparent",expanded:es,selectedPath:W?.activeDiff?(0,z.Im)("file",(0,L.oW)(W.activeDiff.repositoryRoot,W.activeDiff.path)):W.activePath?(0,z.Im)("file",W.activePath):void 0,onExpandedChange:er,onSelect:eg,children:Z.length>0?eh(e,""):(0,n.jsx)("p",{className:"px-2 py-5 text-center text-xs text-muted-foreground",children:X.some(e=>"unavailable"===e.state)?F("incompleteRepository"):F("noChangedFiles")})})}return(0,n.jsx)(j,{className:"rounded-none border-0 bg-transparent",expanded:es,selectedPath:W.activePath?(0,z.Im)("file",W.activePath):void 0,onExpandedChange:er,onSelect:eg,children:em("",null,!1)})})()]})]})}},56592:(e,t,i)=>{"use strict";i.d(t,{h:()=>u});var n=i(93540),a=i(73230),s=i(7237),o=i(33550),r=i(93320),l=i(82075);function c(e,t){return(0,a.B)({msg:n.C["zh-CN"][e],i18n:{key:`projectFiles:${e}`,...t?{params:t}:{}}})}function d(e){return e instanceof Error?e.message:c("projectReadFailed")}class u{constructor(e,t,i){this.cwd=e,this.reader=t,this.options=i,this.state={tabs:[],activePath:null,directories:new Map,expandedPaths:new Set,treeScrollTop:0,search:{query:"",status:"idle",matches:[],truncated:!1,error:null},searchOpen:!1,documents:new Map,activeDiff:null},this.listeners=new Set,this.directoryRequests=new Map,this.compactRequests=new Map,this.documentRequests=new Map,this.closeMissing=new Set,this.restoredTabs=new Set,this.restoredEditorStates=new Map,this.restoredFileViewModes=new Map,this.searchRequest=null,this.diffRequest=null,this.revision=0,this.disposed=!1,this.subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e)),this.getRevision=()=>this.revision}setSearchOpen(e){this.state.searchOpen!==e&&(this.state.searchOpen=e,this.publish())}get canReveal(){return!!this.options.reveal}getBrowsingDocumentSettings(){let e={},t={};for(let i of this.state.tabs){let n=this.state.documents.get(i),a=n?.status==="text"?n.editorState:this.restoredEditorStates.get(i);a&&JSON.stringify(a).length<32768&&(e[i]=a);let s=n?.status==="text"?n.viewMode:this.restoredFileViewModes.get(i);s&&(t[i]=s)}return{editorStates:e,fileViewModes:t}}restoreBrowsing(e){for(let t of(this.state.tabs=[...e.tabs],e.tabs)){this.restoredTabs.add(t);let i=e.editorStates[t];i&&this.restoredEditorStates.set(t,i);let n=e.fileViewModes[t];n&&this.restoredFileViewModes.set(t,n)}for(let t of(this.state.activePath=e.activePath&&e.tabs.includes(e.activePath)?e.activePath:null,this.state.expandedPaths=new Set(e.expandedPaths),this.state.treeScrollTop=e.treeScrollTop,this.state.search={query:e.searchQuery,status:e.searchQuery?"loading":"idle",matches:[],truncated:!1,error:null},e.tabs))this.state.documents.set(t,{status:"unloaded"});for(let t of e.expandedPaths)this.ensureDirectory(t);e.activeDiff?this.openDiff(e.activeDiff.repositoryRoot,e.activeDiff.path,e.activeDiff.comparison):this.state.activePath&&this.ensureDocument(this.state.activePath)}async revealFile(e,t="file"){if(!this.options.reveal)throw Error(c("revealUnavailable"));await this.options.reveal(e,t)}ensureRoot(){return this.ensureDirectory("")}ensureDirectory(e){if(this.disposed||this.state.directories.get(e)?.status==="ready")return Promise.resolve();let t=this.directoryRequests.get(e);if(t)return t.promise;let i=new AbortController,n=Promise.resolve().then(async()=>{try{if(i.signal.aborted)return;let t=await this.reader.list(e,i.signal);if(this.directoryRequests.get(e)?.controller!==i)return;this.state.directories.set(e,{status:"ready",...t})}catch(t){if(this.directoryRequests.get(e)?.controller!==i)return;this.state.directories.set(e,{status:"error",error:d(t)})}this.directoryRequests.get(e)?.controller===i&&(this.directoryRequests.delete(e),this.publish())});return this.directoryRequests.set(e,{controller:i,promise:n}),this.state.directories.set(e,{status:"loading"}),this.publish(),n}setExpandedPaths(e,t=!0){let i=[...this.state.expandedPaths].filter(t=>!e.has(t));for(let t of(this.state.expandedPaths=new Set(e),this.compactRequests.keys()))i.some(e=>t===e||t.startsWith(`${e}/`))&&this.compactRequests.delete(t);if(this.publish(),t)for(let t of e)this.ensureDirectory(t)}cancelDirectoryExpansion(e=""){for(let t of this.compactRequests.keys())(!e||t===e||t.startsWith(`${e}/`))&&this.compactRequests.delete(t)}compactDirectory(e,t){return(0,l.rk)(e,e=>{let t=this.onlyDirectory(e);return t&&this.state.directories.has(t)?t:null},t)}async expandDirectoryChain(e,t){let i={};this.compactRequests.set(e,i);let n=e,a=16;for(;!this.disposed&&this.compactRequests.get(e)===i&&this.state.expandedPaths.has(e);){if(this.state.directories.get(n)?.status!=="ready"){if(a--<=0)break;await this.ensureDirectory(n)}if(this.compactRequests.get(e)!==i||this.disposed)return;let s=this.onlyDirectory(n);if(!s||t.has(n)||t.has(s)||a<=0&&this.state.directories.get(s)?.status!=="ready")break;this.state.expandedPaths.add(s),n=s,this.publish()}this.compactRequests.get(e)===i&&this.compactRequests.delete(e)}onlyDirectory(e){let t=this.state.directories.get(e);if(t?.status!=="ready"||t.truncated||1!==t.entries.length)return null;let i=t.entries[0];return"directory"===i.type?(0,l._J)(e,i.name):null}setTreeScrollTop(e){this.state.treeScrollTop=e}refreshTree(){for(let e of(this.compactRequests.clear(),this.directoryRequests.values()))e.controller.abort();this.directoryRequests.clear(),this.state.directories.clear(),this.cancelSearch(),this.state.search={query:this.state.search.query,status:this.state.search.query?"loading":"idle",matches:[],truncated:!1,error:null},this.publish(),this.ensureRoot().then(()=>{if(!this.disposed){for(let e of this.state.expandedPaths)this.ensureDirectory(e);this.state.search.query&&(this.cancelSearch(),this.state.search={...this.state.search,status:"loading"},this.search(this.state.search.query))}})}setSearchQuery(e){this.state.search.query!==e&&(this.cancelSearch(),this.state.search={query:e,status:e.trim()?"loading":"idle",matches:[],truncated:!1,error:null},this.publish())}async search(e){if(this.disposed||!e.trim()||this.state.search.query!==e||"ready"===this.state.search.status||this.searchRequest)return;let t=new AbortController;this.searchRequest=t,this.state.search={query:e,status:"loading",matches:[],truncated:!1,error:null},this.publish();try{let i=await this.reader.search(e.trim(),t.signal);if(this.searchRequest!==t)return;this.state.search={query:e,status:"ready",...i,error:null}}catch(i){if(this.searchRequest!==t)return;this.state.search={query:e,status:"error",matches:[],truncated:!1,error:d(i)}}this.searchRequest===t&&(this.searchRequest=null,this.publish())}openFile(e){var t;let i,n;if(this.disposed)return;let a=(t=this.cwd,i=e.replaceAll("\\","/"),n=`${t.replaceAll("\\","/").replace(/\/+$/,"")}/`,(/^[a-z]:\//i.test(n)||n.startsWith("//")?i.toLowerCase().startsWith(n.toLowerCase()):i.startsWith(n))?i.slice(n.length):i),s=/^[a-z]:[\\/]/i.test(this.cwd)||this.cwd.startsWith("\\\\")?this.state.tabs.find(e=>e.toLowerCase()===a.toLowerCase())??a:a;if(!this.state.tabs.includes(s)){if(this.options.maxTabs&&this.state.tabs.length>=this.options.maxTabs)return void this.options.onNotice?.(c("maxOpenFiles",{count:this.options.maxTabs}));this.state.tabs.push(s)}this.clearDiff(),this.state.documents.has(s)||this.state.documents.set(s,{status:"unloaded"}),this.state.activePath=s,this.publish(),this.ensureDocument(s)}closeTabs(e,t){let i=this.state,n=[...i.tabs,...i.activeDiff?[null]:[]],a=n.indexOf(e);if(a<0&&"all"!==t)return;let s=new Set(n.filter((i,n)=>"all"===t||("current"===t?i===e:"others"===t?i!==e:"left"===t?n<a:n>a)));if(!s.size)return;let o=i.activeDiff?null:i.activePath;for(let e of s){if(null===e){this.clearDiff();continue}this.documentRequests.get(e)?.abort(),this.documentRequests.delete(e),this.releaseDocument(i.documents.get(e)),i.documents.delete(e),this.restoredEditorStates.delete(e),this.restoredFileViewModes.delete(e),this.closeMissing.delete(e),this.restoredTabs.delete(e)}if(i.tabs=i.tabs.filter(e=>!s.has(e)),i.activePath&&s.has(i.activePath)){let e=n.indexOf(i.activePath);i.activePath=n.slice(e+1).find(e=>null!==e&&!s.has(e))??n.slice(0,e).reverse().find(e=>null!==e&&!s.has(e))??null}this.publish(),!i.activeDiff&&i.activePath&&o!==i.activePath&&this.ensureDocument(i.activePath)}reloadFile(e){this.state.tabs.includes(e)&&(this.invalidateDocument(e),this.publish(),this.ensureDocument(e))}async ensureDocument(e){if(this.disposed||!this.state.tabs.includes(e))return;let t=this.state.documents.get(e);if(t&&["loading","text","image"].includes(t.status))return;let i=new AbortController;this.documentRequests.set(e,i),this.state.documents.set(e,{status:"loading"}),this.publish();try{let t=await this.reader.get(e,this.options.imagePreviewMode(),i.signal);if(this.documentRequests.get(e)!==i)return;this.documentRequests.delete(e),this.closeMissing.delete(e),this.restoredTabs.delete(e),this.state.documents.set(e,"text"===t.kind?{status:"text",content:t.content,size:t.size,editorState:this.restoredEditorStates.get(e)??null,viewMode:this.restoredFileViewModes.get(e)??(this.options.htmlPreview&&/\.html?$/i.test(e)?"preview":"source")}:{status:"image",mimeType:t.mimeType,size:t.size,objectUrl:URL.createObjectURL((0,s.E)(t))})}catch(a){if(this.documentRequests.get(e)!==i)return;this.documentRequests.delete(e);let t=this.restoredTabs.delete(e),n=this.closeMissing.delete(e);if((t||n)&&a instanceof r.aw&&404===a.status&&"errors:fileMissing"===a.errorKey){this.closeTabs(e,"current"),n&&this.options.onNotice?.(c("branchFileClosed",{path:e}));return}console.warn("[Pi Desk][ProjectFile] 读取文件失败",{cwd:this.cwd,path:e,error:d(a)}),this.state.documents.set(e,{status:"error",error:d(a)})}this.publish()}async compareFile(e,t,i){let n=this.state.documents.get(e);if(this.disposed||i.aborted||n?.status!=="text")return;if(!t){n.comparison&&(delete n.comparison,this.publish());return}let a={status:"loading"};n.comparison=a,this.publish();let s=()=>!this.disposed&&!i.aborted&&this.state.documents.get(e)===n&&n.comparison===a;try{let e=await this.reader.diff(t.repositoryRoot,t.path,i);if(!s())return;"text"===e.kind?(n.content=e.modified.content,n.size=new TextEncoder().encode(e.modified.content).length,n.comparison={status:"ready",repositoryRoot:t.repositoryRoot,path:t.path,original:e.original}):n.comparison={status:"unavailable"}}catch(t){if(!s())return;console.warn("[Pi Desk][ProjectFile] 读取行变更失败",{cwd:this.cwd,path:e,error:d(t)}),n.comparison={status:"error",error:d(t)}}this.publish()}openFileDiff(e,t){let i=this.state.documents.get(e);if(this.disposed||i?.status!=="text"||i.comparison?.status!=="ready")return;let n=i.comparison;this.clearDiff(),this.state.activeDiff={status:"text",repositoryRoot:n.repositoryRoot,path:n.path,original:n.original,modified:{path:n.path,content:i.content},initialLine:t},this.publish()}openDiff(e,t,i,n){this.disposed||(this.clearDiff(),this.state.activeDiff={status:"loading",repositoryRoot:e,path:t,comparison:i,label:n},this.publish(),this.ensureDiff())}closeDiff(){this.closeTabs(null,"current")}reloadDiff(){let e=this.state.activeDiff;e&&(this.clearDiff(),this.state.activeDiff={...e,status:"loading"},this.publish(),this.ensureDiff())}saveDiffState(e,t){this.state.activeDiff===e&&(e.editorState=t)}setDiffViewMode(e){this.state.activeDiff&&(0,o.ZQ)({diffViewMode:e})}setDiffWrapLines(e){this.state.activeDiff&&(0,o.ZQ)({wrapLines:e})}setDiffCollapseUnchanged(e){this.state.activeDiff&&(0,o.ZQ)({collapseUnchanged:e})}handleGitBranchChanged(e){for(let t of(this.refreshTree(),this.state.tabs))(!e||t===e||t.startsWith(`${e}/`))&&(this.invalidateDocument(t),this.closeMissing.add(t));this.state.activeDiff?.repositoryRoot===e?this.reloadDiff():this.publish(),!this.state.activeDiff&&this.state.activePath&&this.ensureDocument(this.state.activePath)}saveEditorState(e,t){let i=this.state.documents.get(e);i?.status==="text"&&(i.editorState=t)}setWrapLines(e,t){this.state.documents.get(e)?.status==="text"&&(0,o.ZQ)({wrapLines:t})}setTextViewMode(e,t){let i=this.state.documents.get(e);i?.status==="text"&&i.viewMode!==t&&(i.viewMode=t,this.publish())}dispose(){for(let e of(this.disposed=!0,this.compactRequests.clear(),this.directoryRequests.values()))e.controller.abort();for(let e of(this.directoryRequests.clear(),this.documentRequests.values()))e.abort();for(let e of(this.documentRequests.clear(),this.cancelSearch(),this.clearDiff(),this.state.documents.values()))this.releaseDocument(e);this.state.documents.clear(),this.listeners.clear()}async ensureDiff(){let e=this.state.activeDiff;if(this.disposed||e?.status!=="loading"||this.diffRequest)return;let t=new AbortController;this.diffRequest=t;try{let i=await this.reader.diff(e.repositoryRoot,e.path,t.signal,e.comparison);if(this.diffRequest!==t)return;this.state.activeDiff="text"===i.kind?{...e,status:"text",original:i.original,modified:i.modified}:"metadata"===i.kind?{...e,status:"metadata",originalMetadata:i.original,modifiedMetadata:i.modified}:{...e,status:i.kind,error:null}}catch(i){if(this.diffRequest!==t)return;this.state.activeDiff={...e,status:"error",error:d(i)}}this.diffRequest===t&&(this.diffRequest=null,this.publish())}clearDiff(){this.diffRequest?.abort(),this.diffRequest=null,this.state.activeDiff=null}cancelSearch(){this.searchRequest?.abort(),this.searchRequest=null}invalidateDocument(e){this.documentRequests.get(e)?.abort(),this.documentRequests.delete(e);let t=this.state.documents.get(e);t?.status==="text"&&(t.editorState&&this.restoredEditorStates.set(e,t.editorState),this.restoredFileViewModes.set(e,t.viewMode)),this.releaseDocument(t),this.state.documents.set(e,{status:"unloaded"})}releaseDocument(e){e?.status==="image"&&URL.revokeObjectURL(e.objectUrl)}publish(){if(!this.disposed)for(let e of(this.revision+=1,this.listeners))e()}}},58840:(e,t,i)=>{"use strict";i.d(t,{k:()=>p});var n=i(7962),a=i(82028),s=i.n(a),o=i(69266),r=i(49426),l=i(5816);let c=[[".viewer-zoom-in","放大","Zoom in"],[".viewer-zoom-out","缩小","Zoom out"],[".viewer-one-to-one","原始尺寸","Actual size"],[".viewer-reset","重置","Reset"],[".viewer-prev","上一张","Previous image"],[".viewer-next","下一张","Next image"],[".viewer-rotate-left","向左旋转","Rotate left"],[".viewer-rotate-right","向右旋转","Rotate right"]];function d(e){return document.querySelector(`.${e}`)}function u(e,t){e?.querySelectorAll(".viewer-list > li").forEach((e,i)=>{let n="en"===t?`View image ${i+1}`:`查看第 ${i+1} 张图片`;e.setAttribute("aria-label",n),e.setAttribute("title",n)})}function p(e){let{locale:t}=(0,l.i)(),{slides:i,index:a=0,onIndexChange:p,className:m,thumbnails:h=!0,ariaLabel:g="en"===t?"Image preview":"图片预览"}=e,f="inline"===e.mode,v="inline"===e.mode||e.open,y="modal"===e.mode?e.onClose:void 0,x=i.length>1,b=Math.min(Math.max(a,0),Math.max(i.length-1,0)),k=`pi-desk-image-viewer-${(0,o.useId)().replaceAll(":","")}`,w=(0,o.useRef)(null),C=(0,o.useRef)(null),S=(0,o.useRef)(null),j=(0,o.useRef)(""),I=(0,o.useRef)(""),R=(0,o.useRef)(b),F=(0,o.useRef)(b),P=(0,o.useRef)(p),M=(0,o.useRef)(y),D=(0,o.useMemo)(()=>JSON.stringify(i.map(e=>[e.src,e.alt])),[i]),N=(0,r.cn)("pi-desk-image-viewer",f?"pi-desk-image-viewer-inline":"pi-desk-image-viewer-modal",k,m);if((0,o.useEffect)(()=>{I.current=D},[D]),(0,o.useEffect)(()=>{F.current=b},[b]),(0,o.useEffect)(()=>{P.current=p},[p]),(0,o.useEffect)(()=>{M.current=y},[y]),(0,o.useEffect)(()=>{let e=w.current;if(!e||!v||0===i.length)return;let n=!1,a=null,o=0,r=null,l=e=>{!("Escape"===e.key&&!e.defaultPrevented&&!e.isComposing&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&a?.fulled)||(e.preventDefault(),e.stopImmediatePropagation(),e.repeat||d(k)?.querySelector(".viewer-button")?.click())};window.addEventListener("keydown",l,!0);let p=()=>{if(n)return;let l=F.current;R.current=l;let p=window.matchMedia("(pointer: coarse)").matches||navigator.maxTouchPoints>0;a=new(s())(e,{inline:f,initialViewIndex:l,initialCoverage:f?.82:.88,minWidth:0,minHeight:0,minZoomRatio:.05,maxZoomRatio:8,zoomRatio:.12,zIndex:200,zIndexInline:1,backdrop:!f,button:!0,focus:!0,keyboard:!0,loading:!0,loop:!1,movable:!0,navbar:!!x&&!!h&&2,rotatable:!0,scalable:!1,slideOnTouch:x,title:!f&&1,toolbar:{prev:x,zoomOut:!0,zoomIn:!0,oneToOne:{show:2},reset:!0,rotateLeft:{show:2},rotateRight:{show:2},next:x},tooltip:!0,transition:!window.matchMedia("(prefers-reduced-motion: reduce)").matches,toggleOnDblclick:!p,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,className:N,ready:()=>(function(e,t,i,n,a,s){let o=d(e);if(!o)return;for(let[e,t,n]of(o.setAttribute("aria-label",i),o.setAttribute("lang",s),c)){let i=o.querySelector(e);if(!i)continue;let a="en"===s?n:t;i.setAttribute("aria-label",a),i.setAttribute("title",a)}u(o,s);let r=o.querySelector(".viewer-button");if(r){let e=()=>{let e=t?r.classList.contains("viewer-fullscreen-exit")?"en"===s?"Exit fullscreen":"退出全屏":"en"===s?"View image fullscreen":"全屏查看图片":"en"===s?"Close image preview":"关闭图片预览";r.setAttribute("aria-label",e),r.setAttribute("title",e)};e(),t&&r.addEventListener("click",()=>requestAnimationFrame(e))}if(n>1){let e=document.createElement("div");e.className="pi-desk-image-viewer-counter",e.dataset.piDeskViewerCounter="",e.setAttribute("aria-live","polite"),e.textContent=`${a+1} / ${n}`,o.appendChild(e)}})(k,f,g,i.length,l,t),view:e=>{let t=function(e){let t=e.detail;if("object"!=typeof t||null===t)return null;let i=Reflect.get(t,"index");return"number"==typeof i&&Number.isInteger(i)?i:null}(e);if(null!==t){var n;let e;x&&S.current&&(S.current.options.transition=!1),R.current=t,n=i.length,(e=d(k)?.querySelector("[data-pi-desk-viewer-counter]"))&&(e.textContent=`${t+1} / ${n}`),P.current?.(t)}},viewed:()=>{let e=S.current;if(!x||!e?.image)return;let t=window.matchMedia("(prefers-reduced-motion: reduce)").matches;e.options.transition=!t,t||(e.image.getBoundingClientRect(),e.image.classList.add("viewer-transition"),e.image.animate([{opacity:0},{opacity:1}],{duration:150,easing:"ease-out"}))},hidden:()=>M.current?.()}),S.current=a,j.current=I.current,f&&C.current?(r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=requestAnimationFrame(()=>a?.resize())})).observe(C.current):a.show()},m=Array.from(e.querySelectorAll("img"));return f&&m.some(e=>!e.complete)?Promise.all(m.map(e=>e.decode().catch(()=>void 0))).then(p):p(),()=>{n=!0,window.removeEventListener("keydown",l,!0),r?.disconnect(),cancelAnimationFrame(o),S.current===a&&(S.current=null),a?.destroy()}},[v,g,f,k,t,x,i.length,h,N]),(0,o.useEffect)(()=>{let e=S.current;if(!e||j.current===D)return;j.current=D;let i=R.current,n=w.current?.querySelectorAll("img")[i],a=e.image?.src!==n?.src||e.image?.alt!==n?.alt;a&&(e.viewed=!1),e.update(),a&&e.view(i),u(d(k),t)},[k,t,D]),(0,o.useEffect)(()=>{let e=S.current;e&&R.current!==b&&e.view(b)},[b]),0===i.length||!v)return null;let T=(0,n.jsx)("span",{ref:w,className:"pi-desk-image-viewer-source","aria-hidden":"true",children:i.map((e,t)=>(0,n.jsx)("img",{src:e.src,alt:e.alt,width:e.width,height:e.height,decoding:"async",draggable:!1},t))});return f?(0,n.jsx)("div",{ref:C,className:"pi-desk-image-viewer-host",role:"region","aria-label":g,tabIndex:0,onKeyDown:e=>{let t=S.current;!t||t.fulled||e.altKey||e.ctrlKey||e.metaKey||e.nativeEvent.isComposing||("ArrowLeft"===e.key||"ArrowRight"===e.key)&&(e.preventDefault(),e.stopPropagation(),"ArrowLeft"===e.key?t.prev(!1):t.next(!1))},children:T}):T}},59605:(e,t,i)=>{"use strict";i.d(t,{D8:()=>X,Er:()=>M,Gx:()=>z,Hf:()=>J,LJ:()=>c,OS:()=>Z,O_:()=>K,Ok:()=>V,Pc:()=>l,Px:()=>T,Qi:()=>O,RX:()=>ec,Rh:()=>B,Rk:()=>G,Rt:()=>Y,UT:()=>E,V6:()=>x,XW:()=>es,Xj:()=>$,aV:()=>A,ai:()=>q,bG:()=>Q,bN:()=>U,dG:()=>ea,fK:()=>el,fb:()=>y,lJ:()=>F,mh:()=>p,mj:()=>ei,ny:()=>_,q5:()=>I,s4:()=>et,sL:()=>H,s_:()=>R,wH:()=>eo});var n=i(38979),a=i(66453),s=i(67765),o=i(70698),r=i(85232);let l=n.Yj().uuid(),c=n.ai().int().nonnegative(),d=n.Yj().trim().min(3).max(129).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*\/[a-z0-9]+(?:-[a-z0-9]+)*$/),u=n.k5(["image/jpeg","image/png","image/webp","image/gif"]),p=n.Ik({mimeType:u,width:n.ai().int().positive(),height:n.ai().int().positive()}).strict(),m=n.k5(["running","completed","error","aborted"]),h=n.k5(["running","completed","error"]),g=n.ai().int().nonnegative().max(Number.MAX_SAFE_INTEGER),f=n.Ik({inputTokens:g,outputTokens:g,cacheReadTokens:g,costUsd:n.ai().finite().nonnegative()}).strict(),v=n.Yj().trim().min(1).nullable(),y=n.Ik({tempId:l}).strict(),x=n.Ik({index:c,entryId:a.Rv}).strict(),b=n.Ik({timestampMs:o.k.nullable(),type:n.eu("user"),viewKey:d,hasDetail:n.zM()}).strict(),k=n.Ik({timestampMs:o.k.nullable(),type:n.eu("assistant"),viewKey:d,status:m,hasDetail:n.zM(),usage:f}).strict(),w=n.Ik({timestampMs:o.k.nullable(),type:n.eu("tool"),viewKey:d,status:h,hasDetail:n.zM(),usage:f.nullable()}).strict(),C=n.Ik({timestampMs:o.k.nullable(),type:n.eu("bash"),viewKey:d,status:m,hasDetail:n.zM()}).strict(),S=n.Ik({timestampMs:o.k.nullable(),type:n.eu("custom"),viewKey:d,hasDetail:n.zM()}).strict();function j(e){let t=b.extend({timestampMs:e}).strict(),i=k.extend({timestampMs:e}).strict(),a=w.extend({timestampMs:e}).strict(),s=C.extend({timestampMs:e}).strict(),o=S.extend({timestampMs:e}).strict();return{user:t,assistant:i,tool:a,bash:s,custom:o,message:n.gM("type",[t,i,a,s,o])}}n.gM("type",[b,k,w,C,S]);let I=j(n.ch()).message,R=j(o.k).message,F=n.Ik({text:n.Yj(),images:n.YO(p)}).strict(),P=n.Ik({provider:n.Yj(),modelId:n.Yj()}).strict(),M=n.Ik({text:n.Yj(),errorMessage:n.Yj().nullable().default(null),model:P.nullable().optional()}).strict(),D={name:n.Yj().trim().min(1),reasoning:v,inputPreview:v,activity:v};function N(){return n.Ik({...D,path:s.eC.nullable()}).strict()}let T=n.Ik({...D,images:n.YO(p).optional()}).strict(),E=T,L=n.KC([n.Ik({startedAtMs:o.k}).strict(),n.Ik({durationMs:n.ai().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict()]),O=n.Ik({...D,timing:L.nullable()}).strict(),z=N().extend({images:n.YO(p).optional()}).strict(),A=N(),U=N(),q=n.Ik({command:n.Yj().min(1)}).strict(),Y=n.Ik({text:n.Yj()}).strict(),B=n.Ik({thinking:n.Yj()}).strict(),W=n.Ik({complete:n.zM(),calls:n.YO(n.Ik({name:n.Yj(),arguments:n.g1(n.Yj(),n.Pq()).optional(),argumentsBytes:n.ai().int().nonnegative().optional(),status:n.k5(["ok","error","unfinished"]),durationMs:n.ai().finite().nonnegative().optional(),error:n.Yj().optional()}).strict())}).strict(),_=n.Ik({output:n.Yj(),nestedCalls:W.optional()}).strict(),V=n.Ik({output:n.Yj()}).strict(),$=n.Ik({content:n.Yj()}).strict(),G=n.gM("kind",[n.Ik({kind:n.eu("diff"),content:n.Yj()}).strict(),n.Ik({kind:n.eu("output"),content:n.Yj()}).strict()]),K=n.gM("kind",[n.Ik({kind:n.eu("content"),content:n.Yj()}).strict(),n.Ik({kind:n.eu("output"),content:n.Yj()}).strict()]),Q=n.Ik({output:n.Yj()}).strict(),H=n.Ik({text:n.Yj().min(1)}).strict(),J=n.g1(n.Yj(),n.Pq()),X=n.g1(n.Yj(),n.Pq()),Z=n.KC([X,n.ch()]);function ee(e,t){return n.Ik({location:e,fixed:j(t).message,summary:J,detail:X.optional()}).strict().superRefine((e,t)=>{void 0===e.detail||e.fixed.hasDetail||t.addIssue({code:"custom",message:"message detail requires hasDetail=true",path:["detail"]})})}let et=ee(y,n.ch()),ei=ee(x,o.k);function en(e,t){0===Object.keys(e).length&&t.addIssue({code:"custom",message:"patch requires at least one changed field"})}let ea=n.Ik({viewKey:d.optional(),status:n.KC([m,h]).optional(),hasDetail:n.zM().optional(),usage:f.nullable().optional()}).strict().superRefine(en),es=n.g1(n.Yj(),n.Pq()).superRefine(en),eo=n.g1(n.Yj(),n.Pq()).superRefine(en),er=n.KC([n.Yj().min(1),n.YO(n.Pq()).min(1)]),el=n.g1(n.Yj(),er).superRefine((e,t)=>{for(let i of(en(e,t),Object.keys(e)))try{(0,r.U)(i)}catch(e){t.addIssue({code:"custom",message:e instanceof Error?e.message:"increment path is invalid",path:[i]})}}),ec=n.Ik({messages:n.YO(ei),temporaryMessages:n.YO(et)}).strict();n.Ik({index:c,entryId:a.Rv,detail:Z}).strict(),n.Ik({mimeType:u,data:n.Yj().min(1)}).strict()},60471:(e,t,i)=>{"use strict";i.d(t,{b:()=>u});var n=i(7962),a=i(46783),s=i(69266),o=i(78121),r=i(86963),l=i(89790),c=i(90434),d=i(49426);function u({value:e,options:t,onChange:i,ariaLabel:p,placeholder:m,searchPlaceholder:h,emptyText:g,disabled:f=!1,className:v}){let{t:y}=(0,o.Bd)("common"),[x,b]=(0,s.useState)(!1),k=t.find(t=>t.value===e);return(0,n.jsxs)(c.AM,{open:x,onOpenChange:b,children:[(0,n.jsx)(c.Wv,{render:(0,n.jsxs)(r.$,{type:"button",variant:"outline",role:"combobox","aria-label":p,"aria-expanded":x,disabled:f,className:(0,d.cn)("w-full min-w-0 justify-between border-input px-2.5 font-normal focus-visible:-outline-offset-2",v),children:[(0,n.jsx)("span",{className:(0,d.cn)("min-w-0 truncate",!k&&"text-muted-foreground"),children:k?.label??m??y("selectPlaceholder")}),(0,n.jsx)(a.A,{className:"text-muted-foreground"})]})}),(0,n.jsx)(c.hl,{align:"start",sideOffset:4,positionerClassName:"z-[120]",className:"w-(--anchor-width) max-w-[calc(100vw-2rem)] gap-0 p-0",children:(0,n.jsxs)(l.uB,{children:[(0,n.jsx)(l.G7,{placeholder:h??y("searchPlaceholder"),autoFocus:!0}),(0,n.jsxs)(l.oI,{className:"max-h-[min(20rem,var(--available-height))]",children:[(0,n.jsx)(l.xL,{children:g??y("noMatches")}),(0,n.jsx)(l.L$,{children:t.map(t=>(0,n.jsx)(l.h_,{value:`${t.label} ${t.description??""} ${t.value}`,"data-checked":t.value===e?"true":void 0,onSelect:()=>{i(t.value),b(!1)},children:(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block truncate",children:t.label}),t.description?(0,n.jsx)("span",{className:"mt-0.5 block truncate text-xs text-muted-foreground",children:t.description}):null]})},t.value))})]})]})})]})}},60682:(e,t,i)=>{"use strict";i.d(t,{J:()=>f});var n=i(7962),a=i(49762),s=i(86758),o=i(36670),r=i(50479),l=i(35995),c=i(69266),d=i(78121),u=i(99084),p=i(51821),m=i(1364),h=i(73165),g=i(93119);function f({cwd:e,path:t,type:i,trigger:v,openLabel:y,onOpen:x,expanded:b,onToggle:k,historical:w,oldPath:C,onReveal:S}){let{t:j}=(0,d.Bd)("projectFiles"),I=(0,p.G)(),[R,F]=(0,c.useState)(null),P=R??{cwd:e,path:t,type:i,oldPath:C},M=(0,c.useRef)(!1),D=(0,c.useRef)(""),N="file"===i?"file":"folder",T=e=>{(0,u.x)(e).then(e=>{e?I.success(j("copied")):I.error(j("copyFailed"))})},E=(P.path||P.cwd.replaceAll("\\","/")).split("/").filter(Boolean).at(-1)??P.cwd;return(0,n.jsxs)(m.tz,{onOpenChange:(n,a)=>{F(n?{cwd:e,path:t,type:i,oldPath:C}:null);let s=a.event;n&&("touch"===D.current||"pointerType"in s&&"touch"===s.pointerType||s.type.startsWith("touch"))&&(M.current=!0)},children:[(0,n.jsx)(m.Rc,{render:v,"data-project-path-menu-trigger":"",onPointerDown:e=>{D.current=e.pointerType,M.current=!1},onTouchEndCapture:e=>{let t=e.target;!R||!M.current||"touch"!==D.current||t instanceof Element&&t.closest("[data-project-path-menu-trigger]")===e.currentTarget&&e.cancelable&&e.preventDefault()},onClickCapture:e=>{M.current&&(e.preventDefault(),e.stopPropagation(),M.current=!1)},onKeyDownCapture:e=>{if(e.defaultPrevented||e.nativeEvent.isComposing)return;let t=e.target;if(!(t instanceof Element)||t.closest("[data-project-path-menu-trigger]")!==e.currentTarget||(D.current="keyboard",M.current=!1,"ContextMenu"!==e.key&&!("F10"===e.key&&e.shiftKey)))return;e.preventDefault(),e.stopPropagation();let i=t.getBoundingClientRect();e.currentTarget.dispatchEvent(new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,button:2,clientX:i.left+Math.min(i.width,120)/2,clientY:i.top+Math.min(i.height,36)/2}))}}),(0,n.jsxs)(h.D,{children:[x?(0,n.jsxs)(m.kt,{onClick:x,children:[(0,n.jsx)(a.A,{}),y??j("openPreview")]}):null,k?(0,n.jsxs)(m.kt,{onClick:k,children:[b?(0,n.jsx)(s.A,{}):(0,n.jsx)(o.A,{}),j(b?"collapse":"expand")]}):null,x||k?(0,n.jsx)(m.K5,{}):null,S?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(m.kt,{"data-testid":`project-${N}-reveal-${t}`,onClick:()=>{S&&S(P.path,P.type).then(()=>I.success(j("revealRequested"))).catch(e=>{I.error(e instanceof Error?e.message:j("revealFailed"))})},children:[(0,n.jsx)(r.A,{}),w?"directory"===i?j("openCurrentWorkspace"):j("locateCurrentWorkspace"):"directory"===i?j("openFolder"):j("openContainingFolder")]}),(0,n.jsx)(m.K5,{})]}):null,(0,n.jsxs)(m.kt,{"data-testid":`project-${N}-copy-address-${t}`,onClick:()=>T((0,g.$)(P.cwd,P.path)),children:[(0,n.jsx)(l.A,{}),j("copyAbsolutePath")]}),(0,n.jsxs)(m.kt,{onClick:()=>T(P.path||"."),children:[(0,n.jsx)(l.A,{}),j("copyRelativePath")]}),(0,n.jsxs)(m.kt,{onClick:()=>T(E),children:[(0,n.jsx)(l.A,{}),j("directory"===i?"copyFolderName":"copyFileName")]}),P.oldPath?(0,n.jsxs)(m.kt,{onClick:()=>T(P.oldPath),children:[(0,n.jsx)(l.A,{}),j("copyOldRelativePath")]}):null]})]})}},62851:(e,t,i)=>{"use strict";i.d(t,{$C:()=>I,GR:()=>f,Pq:()=>R,YT:()=>j});var n=i(38979),a=i(15710),s=i(6397),o=i(99739),r=i(70698);let l=n.Yj().uuid(),c=n.Yj().trim().min(1).max(256),d=n.k5(["info","success","warning","error"]),u=n.Yj().trim().min(1).max(120),p=n.Yj().trim().max(320).nullable(),m=n.Ik({type:n.eu("plugin"),pluginName:o.tv,name:o.f7,data:o.Dz}).strict(),h=n.Ik({notificationId:l,level:d,title:u,description:p,createdAt:r.k,event:m.nullable()}).strict(),g=n.g1(o.tv,o.Dz),f=n.Ik({mode:n.k5(["normal","basic"]).default("normal"),notifications:n.YO(h),plugins:g,capabilityModes:s.Wu,settings:a.J.default({region:{locale:"en",timeZone:"UTC"}})}).strict(),v=n.Ik({level:d.optional(),title:u.optional(),description:p.optional(),event:m.nullable().optional()}).strict().refine(e=>Object.keys(e).length>0,{message:"notification changes cannot be empty"}),y=n.Ik({type:n.eu("add"),notification:h}).strict(),x=n.Ik({type:n.eu("update"),notificationId:l,changes:v}).strict(),b=n.Ik({type:n.eu("delete"),notificationId:l}).strict(),k=n.gM("type",[y,x,b]),w=n.Ik({pluginName:o.tv,state:o.Dz.nullable()}).strict(),C=n.Ik({key:n.eu("capabilityModes"),update:s.Wu}).strict(),S=n.Ik({key:n.eu("settings"),update:a.J}).strict();n.gM("key",[S,C,n.Ik({key:n.eu("notifications"),update:k}).strict(),n.Ik({key:n.eu("plugins"),update:w}).strict()]);let j=n.KC([S.extend({type:n.eu("update")}),C.extend({type:n.eu("update")}),n.Ik({type:n.eu("replace"),runtime:f}).strict(),n.Ik({type:n.eu("update"),key:n.eu("notifications"),update:k}).strict(),n.Ik({type:n.eu("update"),key:n.eu("plugins"),update:w}).strict()]),I=n.gM("key",[n.Ik({key:n.eu("notifications"),update:b}).strict(),n.Ik({key:n.eu("settings"),update:n.Ik({region:a.a.unwrap().partial().strict().refine(e=>Object.keys(e).length>0,"地区更新不能为空")}).strict()}).strict()]),R=n.Ik({}).strict(),F=n.Ik({name:o.f7,data:o.Dz}).strict();n.Ik({key:c.optional(),level:d,title:u,description:n.Yj().trim().max(320).optional(),event:F.optional()}).strict(),n.Ik({level:d.optional(),title:u.optional(),description:p.optional()}).strict().refine(e=>Object.keys(e).length>0,{message:"plugin notification changes cannot be empty"})},66453:(e,t,i)=>{"use strict";i.d(t,{$E:()=>s,Rv:()=>o,m4:()=>a});var n=i(38979);let a=n.Yj().trim().min(1),s=n.Yj().trim().min(1),o=n.Yj().trim().min(1)},67765:(e,t,i)=>{"use strict";i.d(t,{CT:()=>m,JH:()=>g,NL:()=>o,_g:()=>d,eC:()=>u,gB:()=>r,ih:()=>v,jI:()=>f,p$:()=>p,rh:()=>c,uV:()=>a,xm:()=>s});var n=i(38979);let a=4096,s=5e3,o=5242880,r=1048576;function l(e,t){return""===e?t:!(e.length>a||e.startsWith("/")||e.includes("\\")||e.includes("\0")||/^[a-zA-Z]:/.test(e))&&e.split("/").every(e=>e.length>0&&"."!==e&&".."!==e)}let c=n.Yj().max(a).refine(e=>l(e,!0),"目录路径必须是规范相对路径"),d=n.Yj().min(1).max(a).refine(e=>l(e,!1),"文件路径必须是规范相对路径"),u=n.Yj().min(1).max(a).refine(e=>l(e,!1)||e.length>0&&e.length<=a&&!e.includes("\0")&&(e.startsWith("/")||e.startsWith("\\\\")||/^[a-zA-Z]:[\\/]/.test(e)),"预览路径必须是规范相对路径或绝对路径"),p=n.k5(["compressed","original"]),m=n.k5(["image/jpeg","image/png","image/webp","image/gif"]),h=n.Ik({name:n.Yj().min(1),type:n.k5(["directory","file"])}).strict(),g=n.Ik({entries:n.YO(h).max(s),truncated:n.zM()}).strict(),f=n.Ik({matches:n.YO(d).max(100),truncated:n.zM()}).strict(),v=n.gM("kind",[n.Ik({kind:n.eu("text"),content:n.Yj(),size:n.ai().int().nonnegative().max(o)}).strict(),n.Ik({kind:n.eu("image"),mimeType:m,data:n.Yj().min(1),size:n.ai().int().positive().max(0xa00000)}).strict()])},67796:(e,t,i)=>{"use strict";i.d(t,{W:()=>n,X:()=>a});let n={en:{calls:{title:"Model calls",loadedTitle:"Model calls \xb7 Loaded history",model:"Model",unknownModel:"Unknown model",input:"Input",output:"Output",cached:"Cache",cost:"Cost",error:"Failed",aborted:"Aborted",close:"Close model calls"},nestedCalls:"Nested calls",nestedCallsIncomplete:"Nested calls \xb7 Incomplete record",nestedStatus:{ok:"Completed",error:"Failed",unfinished:"Unfinished"},nestedArguments:"Arguments",nestedArgumentsBytes:"Arguments: {{count}} bytes",image:"Markdown image",imageUnavailable:"Image unavailable",previewImage:"Preview image: {{name}}",imagePreview:"Markdown image preview",codeCopyFailed:"Could not copy code. Please copy it manually.",detailFailed:"Could not load message details",messageCopyFailed:"Could not copy the message. Please copy it manually.",copied:"Copied",copyMessage:"Copy message",usage:"Input {{input}} / Output {{output}} / Cached input {{cached}} / {{cost}}",chatImage:"Chat image {{count}}",imageLoading:"Loading image…",previewImageNumber:"Preview image {{count}}",chatImagePreview:"Chat image preview",expand:"Show full message",collapse:"Collapse",thinking:"Thinking…",thinkingLoading:"Loading thoughts…",thinkingUnavailable:"Thoughts unavailable",thinkingProcess:"Reasoning",thinkingTruncated:"Showing the last {{count}} characters",copyThinking:"Copy full reasoning",streamInterrupted:"The response stream ended before the model completed its answer.",requestTimedOut:"The model did not complete its response in time.",modelFailed:"The model request failed without a detailed error.",toolResult:"{{name}} tool result",tool:"{{name}} tool",expandTool:"Expand {{name}} tool result",collapseTool:"Collapse {{name}} tool result",previewFile:"Preview current file",previewFilePath:"Preview current file: {{path}}",loadingResult:"Loading result…",emptyResult:"The tool result is empty",toolOutput:"Tool output",pideskHelp:"View command help",pideskVersion:"View Pi Desk version",pideskInfo:"View runtime environment",pideskReload:"Reload current session configuration",pideskListPlugins:"View plugins",pideskShowPlugin:"View plugin",pideskInstallPlugin:"Install plugin",pideskRemovePlugin:"Remove plugin",pidesk:{command:"Command",output:"Output",copyCommand:"Copy command",copyOutput:"Copy output",empty:"No output",noPlugins:"No plugins",unknownVersion:"Version unknown",updateChannel:"Following {{tag}}",targetVersion:"Available version {{version}}",restartRequired:"Pi Desk needs to be restarted",pluginDetail:"Plugin details",info:{version:"Version",environment:"Environment",mode:"Mode",cwd:"Project directory",agentDir:"Pi directory",docsDirectory:"Documentation directory"},environment:{development:"Development",production:"Production"},mode:{basic:"Basic mode",normal:"Normal mode"},kind:{package:"Package",extension:"Local extension"},status:{ready:"Loaded",available:"Available",disabled:"Disabled",failed:"Load failed"},action:{add:"Install",update:"Update",del:"Remove",apply:"Load changes"},phase:{queued:"Queued",checking:"Checking",applying:"Applying",waiting:"Waiting",failed:"Failed"},errorPhase:{package:"Package",entry:"Entry",setup:"Initialization",resources:"Resources",resolve:"Resolution",native:"Pi extension"}},loadingRead:"Loading file content…",readUnavailable:"File content unavailable",readEmpty:"File content is empty",readContent:"Read file content",loadingDiff:"Loading file diff…",diffUnavailable:"File diff unavailable",editDiff:"Edited file diff",editResult:"Edit tool result",loadingWrite:"Loading written content…",writeUnavailable:"Written content unavailable",writeEmpty:"Written content is empty",writeContent:"Written file content",writeResult:"Write tool result",emptyMessage:"Empty message",compactionSummary:"Context summary",compactionSummaryContent:"Context summary content",compactionRunning:"Summarizing context…",compactionComplete:"Context summary complete",compactionLoading:"Loading context summary…",compactionUnavailable:"Context summary unavailable",processGroup:"Activity",toolCalls_one:"{{count}} tool call",toolCalls_other:"{{count}} tool calls",viewFailed:"Message view failed to load",viewLoading:"Loading message…",messageContent:"Message content",useBasicPresentation:"Use basic message views",reservedView:"Reserved view",publicSnapshot:"Public snapshot",retry:"Retry",loadDetail:"Load details",declarationFailed:"Server message declaration failed",viewConflict:"Multiple message views have the same highest priority",viewMissing:"No message view registered for {{viewKey}}",nextUserMessage:"Go to next user message",bottom:"Go to bottom of chat",userNavigation:"User message navigation",previousUserMessage:"Go to previous user message",previousUserShort:"Previous user message"},"zh-CN":{calls:{title:"模型调用",loadedTitle:"模型调用 \xb7 已加载记录",model:"模型",unknownModel:"未知模型",input:"输入",output:"输出",cached:"缓存",cost:"费用",error:"失败",aborted:"已中止",close:"关闭模型调用"},nestedCalls:"嵌套调用",nestedCallsIncomplete:"嵌套调用 \xb7 记录未完整",nestedStatus:{ok:"完成",error:"失败",unfinished:"未完成"},nestedArguments:"调用参数",nestedArgumentsBytes:"参数 {{count}} 字节",image:"Markdown 图片",imageUnavailable:"图片暂不可用",previewImage:"预览图片:{{name}}",imagePreview:"Markdown 图片预览",codeCopyFailed:"复制代码失败,请手动复制。",detailFailed:"加载消息详情失败",messageCopyFailed:"复制消息失败,请手动复制。",copied:"已复制",copyMessage:"复制消息",usage:"输入 {{input}} / 输出 {{output}} / 输入缓存 {{cached}} / {{cost}}",chatImage:"聊天图片 {{count}}",imageLoading:"加载图片…",previewImageNumber:"预览第 {{count}} 张图片",chatImagePreview:"聊天图片预览",expand:"展开全文",collapse:"收起",thinking:"正在思考…",thinkingLoading:"正在加载思考内容…",thinkingUnavailable:"思考内容不可用",thinkingProcess:"思考过程",thinkingTruncated:"仅显示最近 {{count}} 个字符",copyThinking:"复制完整思考",streamInterrupted:"模型响应流意外中断:连接在回答完成前被关闭。",requestTimedOut:"模型请求超时:在限定时间内未收到完整响应。",modelFailed:"模型请求失败:服务端未提供具体错误信息。",toolResult:"{{name}} 工具结果",tool:"{{name}} 工具",expandTool:"展开 {{name}} 工具结果",collapseTool:"收起 {{name}} 工具结果",previewFile:"预览当前文件",previewFilePath:"预览当前文件 {{path}}",loadingResult:"正在加载结果…",emptyResult:"工具结果为空",toolOutput:"工具输出",pideskHelp:"查看命令帮助",pideskVersion:"查看 Pi Desk 版本",pideskInfo:"查看运行环境",pideskReload:"重载当前会话配置",pideskListPlugins:"查看插件列表",pideskShowPlugin:"查看插件",pideskInstallPlugin:"安装插件",pideskRemovePlugin:"卸载插件",pidesk:{command:"执行命令",output:"返回内容",copyCommand:"复制命令",copyOutput:"复制返回内容",empty:"无返回内容",noPlugins:"暂无插件",unknownVersion:"版本未知",updateChannel:"跟随 {{tag}}",targetVersion:"候选版本 {{version}}",restartRequired:"需要重启 Pi Desk",pluginDetail:"插件详情",info:{version:"版本",environment:"运行环境",mode:"运行模式",cwd:"项目目录",agentDir:"Pi 目录",docsDirectory:"文档目录"},environment:{development:"开发环境",production:"正式环境"},mode:{basic:"基础模式",normal:"正常模式"},kind:{package:"插件包",extension:"本地扩展"},status:{ready:"已加载",available:"可用",disabled:"已禁用",failed:"加载失败"},action:{add:"安装",update:"更新",del:"卸载",apply:"加载变更"},phase:{queued:"排队中",checking:"检查中",applying:"应用中",waiting:"等待中",failed:"失败"},errorPhase:{package:"插件包",entry:"入口",setup:"初始化",resources:"资源",resolve:"解析",native:"Pi 扩展"}},loadingRead:"正在加载读取内容…",readUnavailable:"读取内容不可用",readEmpty:"读取内容为空",readContent:"read 读取内容",loadingDiff:"正在加载文件差异…",diffUnavailable:"文件差异不可用",editDiff:"edit 文件差异",editResult:"edit 工具结果",loadingWrite:"正在加载写入内容…",writeUnavailable:"写入内容不可用",writeEmpty:"写入内容为空",writeContent:"write 写入内容",writeResult:"write 工具结果",emptyMessage:"空消息",compactionSummary:"上下文压缩摘要",compactionSummaryContent:"上下文压缩摘要内容",compactionRunning:"正在压缩上下文…",compactionComplete:"上下文压缩完成",compactionLoading:"正在加载压缩摘要…",compactionUnavailable:"压缩摘要不可用",processGroup:"处理过程",toolCalls_one:"{{count}} 次工具调用",toolCalls_other:"{{count}} 次工具调用",viewFailed:"消息视图加载失败",viewLoading:"正在加载消息…",messageContent:"消息内容",useBasicPresentation:"使用基础消息展示",reservedView:"保留视图",publicSnapshot:"公共 Snapshot",retry:"重试",loadDetail:"加载 Detail",declarationFailed:"服务端 Message Declaration 失败",viewConflict:"同最高优先级存在多个 Message View",viewMissing:"没有 Message View 声明:{{viewKey}}",nextUserMessage:"定位到下一条用户消息",bottom:"回到聊天底部",userNavigation:"用户消息导航",previousUserMessage:"定位到上一条用户消息",previousUserShort:"上一条用户消息"}},a={close:"关闭",copied:"已复制",copyCode:"复制代码",copyLink:"复制链接",copyTable:"复制表格",copyTableAsCsv:"复制为 CSV",copyTableAsMarkdown:"复制为 Markdown",copyTableAsTsv:"复制为 TSV",downloadDiagram:"下载图表",downloadDiagramAsMmd:"下载 Mermaid 文件",downloadDiagramAsPng:"下载 PNG",downloadDiagramAsSvg:"下载 SVG",downloadFile:"下载文件",downloadImage:"下载图片",downloadTable:"下载表格",downloadTableAsCsv:"下载 CSV",downloadTableAsMarkdown:"下载 Markdown",exitFullscreen:"退出全屏",externalLinkWarning:"即将打开外部链接",imageNotAvailable:"图片不可用",mermaidFormatMmd:"Mermaid 文件",mermaidFormatPng:"PNG 图片",mermaidFormatSvg:"SVG 图片",openExternalLink:"打开外部链接",openLink:"打开链接",tableFormatCsv:"CSV",tableFormatMarkdown:"Markdown",tableFormatTsv:"TSV",viewFullscreen:"全屏查看"}},68017:(e,t,i)=>{"use strict";i.d(t,{T:()=>s});var n=i(7962);i(69266);var a=i(49426);function s({className:e,...t}){return(0,n.jsx)("textarea",{"data-slot":"textarea",className:(0,a.cn)("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-card px-2.5 py-2 text-sm leading-5 transition-colors duration-150 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-2 focus-visible:outline-ring disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-50 aria-invalid:border-destructive aria-invalid:outline-destructive",e),...t})}},68269:(e,t,i)=>{"use strict";i.d(t,{$f:()=>f,DK:()=>k,Pi:()=>b,R3:()=>p,TV:()=>M,UR:()=>w,Y2:()=>h,ao:()=>m,lV:()=>g,oc:()=>N,w$:()=>I,wI:()=>v,wR:()=>x,wf:()=>D,xh:()=>C,yI:()=>y});var n=i(38979),a=i(6397),s=i(15381),o=i(59605),r=i(26357),l=i(267);let c=o.Pc,d=o.LJ,u=o.mh,p=o.fb,m=o.s_,h=o.Er,g=o.Hf,f=o.Rh,v=o.OS,y=o.s4,x=o.mj,b=l.R,k=n.Ik({index:d,entryId:s.C3}).strict(),w=n.KC([n.ch(),k]),C=u.extend({data:n.Yj().min(1)}).strict(),S=r.$,j=n.Ik({tempId:c,text:n.Yj(),images:n.YO(u).max(10)}).strict(),I=n.Ik({provider:n.Yj().trim().min(1),modelId:n.Yj().trim().min(1),thinkingLevel:S}).strict(),R=n.Ik({tokens:n.ai().int().nonnegative().max(Number.MAX_SAFE_INTEGER).nullable(),contextWindow:n.ai().int().positive().max(Number.MAX_SAFE_INTEGER)}).strict(),F=n.g1(n.Yj(),n.Pq()),P=n.g1(n.Yj().min(1),F),M=n.k5(["normal","basic"]),D=n.Ik({extensionMode:M.default("normal"),presentationMode:M.default("normal"),initializationError:n.Yj().max(32e3).nullable().default(null),queues:n.Ik({steering:n.YO(j),followUp:n.YO(j)}).strict(),model:I.nullable(),capabilityMode:a.rY.nullable(),contextUsage:R.nullable(),plugins:P}).strict(),N=o.RX.extend({runtime:D}).strict();n.Ik({sessionId:s.Kx,branchId:s._A,entryId:s.C3}).strict().extend({imageIndex:n.ai().int().nonnegative()}).strict()},70698:(e,t,i)=>{"use strict";i.d(t,{k:()=>n});let n=i(38979).ai().int().nonnegative().max(Number.MAX_SAFE_INTEGER)},72282:(e,t,i)=>{"use strict";i.d(t,{HK:()=>o,WM:()=>l,wV:()=>r});var n=i(7962),a=i(55493),s=i(49426);function o({className:e,...t}){return(0,n.jsx)(a.YJ,{"data-slot":"resizable-panel-group",className:(0,s.cn)("flex h-full w-full aria-[orientation=vertical]:flex-col",e),...t})}function r({...e}){return(0,n.jsx)(a.Zk,{"data-slot":"resizable-panel",...e})}function l({withHandle:e,className:t,...i}){return(0,n.jsx)(a.wv,{"data-slot":"resizable-handle",className:(0,s.cn)("relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",t),...i})}},73165:(e,t,i)=>{"use strict";i.d(t,{D:()=>d});var n=i(7962),a=i(60454),s=i(93750),o=i(74675),r=i(1364),l=i(49426),c=i(13464);function d({children:e}){return(0,n.jsx)(r.JW,{children:(0,n.jsx)(a.y,{className:"isolate z-[130] outline-none",side:"right",align:"start",alignOffset:4,children:(0,n.jsx)(s._,{"data-slot":"context-menu-content",finalFocus:!1,className:(0,l.cn)(c.hD,"flex flex-col overflow-hidden p-0"),children:(0,n.jsx)(o.V,{className:"min-h-0",viewportClassName:"p-1",children:e})})})})}},74052:(e,t,i)=>{"use strict";i.d(t,{Cy:()=>u,Is:()=>c,VS:()=>d,rg:()=>p});var n=i(7962),a=i(69266),s=i(96646);let o="pi-desk:theme-change",r=null;function l(e){let t=(0,s.Mj)(e,window.matchMedia("(prefers-color-scheme: dark)").matches);document.documentElement.classList.toggle("dark","dark"===t),document.documentElement.style.colorScheme=t}function c(){if(null!==r)return r;try{let e=window.localStorage.getItem(s.Tb);r=(0,s.Wv)(e)?e:s.Pl}catch{r=s.Pl}return r}function d(e){r=e;try{window.localStorage.setItem(s.Tb,e)}catch{}l(e),window.dispatchEvent(new Event(o))}function u(e){let t=t=>{t.key===s.Tb&&(r=(0,s.Wv)(t.newValue)?t.newValue:s.Pl,e())};return window.addEventListener(o,e),window.addEventListener("storage",t),()=>{window.removeEventListener(o,e),window.removeEventListener("storage",t)}}function p({children:e}){return(0,a.useEffect)(()=>{let e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>l(c()),i=u(t);return t(),e.addEventListener("change",t),()=>{i(),e.removeEventListener("change",t)}},[]),(0,n.jsx)(n.Fragment,{children:e})}},74166:(e,t,i)=>{"use strict";i.d(t,{Dq:()=>a,So:()=>o,t4:()=>s});var n=i(69266);let a=(0,n.createContext)(null);function s(){let e=(0,n.useContext)(a);if(!e)throw Error("Plugin Host Provider is missing");return e}function o(){let e=s(),t=(0,n.useCallback)(t=>e.subscribeRegistry(t),[e]),i=(0,n.useCallback)(()=>e.getRegistrySnapshot(),[e]);return(0,n.useSyncExternalStore)(t,i,i).descriptors}},74577:(e,t,i)=>{"use strict";i.d(t,{U:()=>n});let n={en:{statusRunning:"Running",statusCompleted:"Completed",statusFailed:"Failed",statusStopped:"Stopped",statusInterrupted:"Interrupted",seconds_one:"{{count}} second",seconds_other:"{{count}} seconds",minutes_one:"{{count}} minute",minutes_other:"{{count}} minutes",hours_one:"{{count}} hour",hours_other:"{{count}} hours",copyFailed:"Could not copy {{name}}. Please copy it manually.",copied:"{{name}} copied",copy:"Copy {{name}}",copiedShort:"Copied",clickToCopy:"Click to copy {{name}}",conversationDetails:"Task conversation",noMessages:"No conversation messages",interruptFailed:"Could not interrupt task",selectTask:"Select a task to see its details",confirmInterrupt:"Confirm interrupt",interrupt:"Interrupt",waitingOutput:"Waiting for output…",noDetails:"No task details to display",retry:"Retry",loadingDetail:"Loading task details…",refreshing:"Refreshing",title:"Task center",close:"Close task center",recordCount_one:"{{count}} task",recordCount_other:"{{count}} tasks",noTasks:"No tasks",back:"Back to task list",detail:"Task details",open:"Open task center",runningTime:"Duration {{duration}}, started {{time}}",runningCount_one:"{{count}} task running",runningCount_other:"{{count}} tasks running",detailUnavailable:"Task details are no longer available",detailResponseMissing:"Server did not return task details",detailLoadFailed:"Could not load task details",imageDurableOnly:"Task images are only available for saved messages",centerClosed:"Task center is closed"},"zh-CN":{statusRunning:"执行中",statusCompleted:"已完成",statusFailed:"失败",statusStopped:"已停止",statusInterrupted:"已中断",seconds_one:"{{count}} 秒",seconds_other:"{{count}} 秒",minutes_one:"{{count}} 分钟",minutes_other:"{{count}} 分钟",hours_one:"{{count}} 小时",hours_other:"{{count}} 小时",copyFailed:"复制{{name}}失败,请手动复制。",copied:"已复制{{name}}",copy:"复制{{name}}",copiedShort:"已复制",clickToCopy:"点击复制{{name}}",conversationDetails:"任务会话详情",noMessages:"暂无会话消息",interruptFailed:"打断任务失败",selectTask:"从左侧选择一个任务查看详情",confirmInterrupt:"确认打断",interrupt:"打断",waitingOutput:"等待输出…",noDetails:"该任务没有可展示的详情",retry:"重试",loadingDetail:"正在加载任务详情…",refreshing:"正在刷新",title:"任务中心",close:"关闭任务中心",recordCount_one:"{{count}} 条执行记录",recordCount_other:"{{count}} 条执行记录",noTasks:"暂无任务",back:"返回任务列表",detail:"任务详情",open:"打开任务中心",runningTime:"执行时长 {{duration}},启动时间 {{time}}",runningCount_one:"{{count}} 个任务执行中",runningCount_other:"{{count}} 个任务执行中",detailUnavailable:"任务详情已不可用",detailResponseMissing:"服务端未返回任务详情",detailLoadFailed:"加载任务详情失败",imageDurableOnly:"任务图片只支持当前 Durable 消息",centerClosed:"任务中心已关闭"}}},74675:(e,t,i)=>{"use strict";i.d(t,{V:()=>u});var n=i(7962);i(69266);var a=i(82611),s=i(40709),o=i(51173),r=i(49426),l=i(93061),c=i(87425);function d({className:e,orientation:t="vertical",...i}){return(0,n.jsx)(l.V,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:(0,r.cn)("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",e),...i,children:(0,n.jsx)(c.l,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function u({className:e,viewportClassName:t,viewportRef:i,onViewportScroll:l,children:c,...p}){return(0,n.jsxs)(a.V,{"data-slot":"l4-scroll-area",className:(0,r.cn)("relative min-h-0 overflow-hidden",e),...p,children:[(0,n.jsx)(s.B,{ref:i,"data-slot":"l4-scroll-area-viewport",className:(0,r.cn)("size-full rounded-[inherit] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",t),onScroll:l,children:c}),(0,n.jsx)(d,{className:"data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2.5 data-[orientation=vertical]:border-l data-[orientation=vertical]:border-l-transparent"}),(0,n.jsx)(o.I,{})]})}},79137:(e,t,i)=>{"use strict";async function n(e){let t="u"<typeof navigator?void 0:navigator.clipboard;if(t?.writeText)try{return await t.writeText(e),!0}catch{}if("u"<typeof document||!document.body)return!1;let i=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("textarea");n.value=e,n.setAttribute("readonly",""),n.setAttribute("aria-hidden","true"),n.style.position="fixed",n.style.top="-9999px",n.style.left="-9999px",n.style.width="1px",n.style.height="1px",n.style.opacity="0";try{return document.body.append(n),n.select(),n.setSelectionRange(0,n.value.length),document.execCommand("copy")}catch{return!1}finally{n.remove();try{i?.focus()}catch{}}}i.d(t,{h3:()=>n,qj:()=>a});class a extends Error{constructor(e){super(e.message,{cause:e.cause}),this.name="PiDeskBrowserPluginError",this.pluginName=e.pluginName,this.contributionName=e.contributionName??null,this.phase=e.phase}}},81649:(e,t,i)=>{"use strict";i.d(t,{Ke:()=>c,Nt:()=>r,R6:()=>l});var n=i(7962),a=i(87946),s=i(36700),o=i(14064);function r({...e}){return(0,n.jsx)(a.N,{"data-slot":"collapsible",...e})}function l({...e}){return(0,n.jsx)(s.R,{"data-slot":"collapsible-trigger",...e})}function c({...e}){return(0,n.jsx)(o.j,{"data-slot":"collapsible-content",...e})}},82075:(e,t,i)=>{"use strict";function n(e,t){return`${e}:${t}`}function a(e,t){return e?`${e}/${t}`:t}function s(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})}function o(e,t,i=new Set){let n=[e],a=e;for(;!i.has(a);){let e=t(a);if(!e||i.has(e)||!e.startsWith(`${a}/`))break;n.push(e),a=e}return{path:e,targetPath:a,paths:n,label:a.slice(e.lastIndexOf("/")+1)}}function r(e,t=""){let i={path:t,directories:new Map,files:[]},n=new Map([[t,i]]);for(let s of e){let e=(t?s.slice(t.length+1):s).split("/"),o=i;for(let t of e.slice(0,-1)){let e=a(o.path,t),i=n.get(e);i||(i={path:e,directories:new Map,files:[]},n.set(e,i),o.directories.set(e,i)),o=i}o.files.push(s)}return n}function l(e,t,i){return o(e,e=>{let i=t.get(e);return i&&0===i.files.length&&1===i.directories.size?i.directories.keys().next().value??null:null},i)}function c(e,t,i=""){let a=[],o=(i,r)=>{let c=e.get(i);if(c){for(let i of[...c.directories.keys()].sort(s)){let s=l(i,e),c=!s.paths.some(e=>t.has(e));a.push({key:n("directory",i),type:"directory",path:s.targetPath,label:s.label,depth:r,directory:s,expanded:c}),c&&o(s.targetPath,r+1)}for(let e of[...c.files].sort(s))a.push({key:n("file",e),type:"file",path:e,label:e.slice(e.lastIndexOf("/")+1),depth:r})}};return o(i,0),a}i.d(t,{Im:()=>n,Kn:()=>s,OA:()=>r,_J:()=>a,qV:()=>c,rk:()=>o,xV:()=>l})},82639:(e,t,i)=>{"use strict";i.d(t,{n:()=>n});let n={en:{common:{system:"Follow system",chinese:"简体中文",english:"English",unavailable:"Unavailable",close:"Close",closeDialog:"Close dialog",selectPlaceholder:"Select an option",searchPlaceholder:"Search…",noMatches:"No matches",cancel:"Cancel",delete:"Delete",retry:"Retry",save:"Save",reload:"Reload",loading:"Loading…",today:"Today",yesterday:"Yesterday",localeError:"Language settings could not be saved.",timeZoneError:"Time zone settings could not be saved.",languagePending:"Reload this page to use the selected language.",languagePendingNotice:"Language changed. Reload from settings when you are ready.",reloadConfirm:"Reload the page to change language? Unsaved changes in plugins may be lost.",reloadBlocked:"The draft could not be saved or a message send is still unresolved. Please try again later.",unknownError:"Something went wrong",errorDetails:"Error details",pluginNotice:"Plugin notification",closeNotice:"Close notification",duplicateRequest:"This request is already being processed",tooManyRequests:"Too many requests on this connection",socketUnavailable:"The connection is not ready",serverRequestFailed:"The server could not process this request",notFound:"Page not found",pageError:"This page could not be loaded",backHome:"Back to the workspace",recover:"Try again",authenticationRequired:"Please sign in",authUnavailable:"Sign-in service is not ready",shuttingDown:"The service is shutting down",codeReadOnly:"Read-only code file",codeLoading:"Loading code viewer…",codeFailed:"Could not load code viewer. Reopen the file.",skillEditor:"Skill file editor",editorLoading:"Loading editor…",editorFailed:"Could not load editor. Reopen the file.",gitDiffReadOnly:"Read-only Git diff",diffStatus:"Diff calculation status",diffCalculating:"Calculating differences…",diffCount_one:"{{count}} difference",diffCount_other:"{{count}} differences",diffLoading:"Loading diff…",diffFailed:"Could not load diff viewer. Reopen the file.",showPassword:"Show password",hidePassword:"Hide password",revealSecret:"Show text",hideSecret:"Hide text",socketConnectFailed:"WebSocket connection failed",socketDisconnected:"WebSocket connection closed",socketNotConnected:"WebSocket is not connected",socketRequestTimeout:"WebSocket request timed out: {{path}}",socketSendFailed:"Could not send WebSocket request",socketResponseMismatch:"WebSocket response did not match the request",socketResponseInvalid:"Invalid WebSocket response data",dbOpenTimeout:"Opening local chat storage timed out. Refresh the page and try again.",dbOpenBlocked:"Another Pi Desk tab is blocking local chat storage. Close that tab and try again.",dbOpenFailed:"Could not open local chat storage",dbDeleteTimeout:"Clearing local chat storage timed out. Close other Pi Desk tabs and try again.",dbDeleteBlocked:"Another Pi Desk tab is blocking local chat storage cleanup. Close that tab and try again.",dbDeleteFailed:"Could not clear local chat storage",dbRequestFailed:"Local chat storage request failed",dbTransactionAborted:"Local chat storage transaction was aborted",dbTransactionFailed:"Local chat storage transaction failed"}},"zh-CN":{common:{system:"跟随系统",chinese:"简体中文",english:"English",unavailable:"暂不可用",close:"关闭",closeDialog:"关闭弹窗",selectPlaceholder:"请选择",searchPlaceholder:"搜索…",noMatches:"没有匹配结果",cancel:"取消",delete:"删除",retry:"重试",save:"保存",reload:"重新加载",loading:"正在加载…",today:"今天",yesterday:"昨天",localeError:"语言设置未能保存。",timeZoneError:"时区设置未能保存。",languagePending:"重新加载页面以使用所选语言。",languagePendingNotice:"语言设置已变化,准备好后可在设置中重新加载。",reloadConfirm:"重新加载页面以切换语言?插件中未保存的内容可能丢失。",reloadBlocked:"草稿保存失败或消息发送结果尚未确定,请稍后重试。",unknownError:"操作失败",errorDetails:"错误详情",pluginNotice:"插件通知",closeNotice:"关闭提示",duplicateRequest:"requestId 正在处理中",tooManyRequests:"当前连接并发请求过多",socketUnavailable:"应用 WebSocket 尚未就绪",serverRequestFailed:"服务端请求处理失败",notFound:"找不到页面",pageError:"页面暂时无法加载",backHome:"返回工作台",recover:"重试",authenticationRequired:"请先登录",authUnavailable:"登录认证尚未就绪",shuttingDown:"服务正在关闭",codeReadOnly:"只读代码文件",codeLoading:"正在加载代码查看器…",codeFailed:"代码查看器加载失败,请重新打开文件。",skillEditor:"Skill 文件编辑器",editorLoading:"正在加载编辑器…",editorFailed:"编辑器加载失败,请重新打开文件。",gitDiffReadOnly:"只读 Git Diff",diffStatus:"差异计算状态",diffCalculating:"正在计算差异…",diffCount_one:"{{count}} 处差异",diffCount_other:"{{count}} 处差异",diffLoading:"正在加载 Diff…",diffFailed:"Diff 查看器加载失败,请重新打开。",showPassword:"显示密码",hidePassword:"隐藏密码",revealSecret:"显示原文",hideSecret:"隐藏原文",socketConnectFailed:"WebSocket 连接失败",socketDisconnected:"WebSocket 连接已断开",socketNotConnected:"WebSocket 尚未连接",socketRequestTimeout:"WebSocket 请求超时:{{path}}",socketSendFailed:"WebSocket 请求发送失败",socketResponseMismatch:"WebSocket 响应 path 与请求不一致",socketResponseInvalid:"WebSocket 响应数据无效",dbOpenTimeout:"打开本地聊天数据库超时,请刷新页面后重试",dbOpenBlocked:"本地聊天数据库打开或升级被其他 Pi Desk 页面阻塞,请关闭其他标签页后重试",dbOpenFailed:"打开 IndexedDB 失败",dbDeleteTimeout:"清理本地聊天数据库超时,请关闭其他 Pi Desk 页面后重试",dbDeleteBlocked:"本地聊天数据库清理被其他 Pi Desk 页面阻塞,请关闭其他标签页后重试",dbDeleteFailed:"清理 IndexedDB 失败",dbRequestFailed:"IndexedDB 请求失败",dbTransactionAborted:"IndexedDB 事务已中止",dbTransactionFailed:"IndexedDB 事务失败"}}}},84942:(e,t,i)=>{"use strict";i.d(t,{Dl:()=>h,Qg:()=>p,RC:()=>f,a4:()=>d,j0:()=>m});var n=i(38979);let a=n.Yj().min(1).max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),s=n.Yj().trim().min(1).max(256),o=n.Ik({allow:n.YO(s).max(5e3).optional(),deny:n.YO(s).max(5e3).optional()}).strict(),r=n.Ik({value:n.Yj().trim().min(1).max(256),label:n.Yj().trim().min(1).max(120).optional(),description:n.Yj().trim().max(1e3).optional()}).strict(),l=n.Ik({label:n.Yj().trim().min(1).max(120),options:n.YO(r).max(5e3)}).strict(),c=n.g1(a,l),d=n.Yj().min(1).max(64),u=n.Ik({name:n.Yj().trim().min(1).max(64),tools:o.optional(),skills:o.optional(),plugins:n.g1(a,n.g1(a,o)).optional()}).strict(),p=n.g1(d,u).refine(e=>Object.keys(e).length<=100,"最多保存 100 个能力模式").refine(e=>new Set(Object.values(e).map(e=>e.name)).size===Object.keys(e).length,"模式名称不能重复"),m=n.g1(d,u.shape.name),h=n.Ik({tools:n.YO(r),skills:n.YO(r),plugins:n.g1(a,c)}).strict();function g(e,t){let i=0,n=0,a=-1,s=0;for(;n<t.length;)if("*"===e[i])a=i++,s=n;else if(e[i]===t[n])i+=1,n+=1;else{if(!(a>=0))return!1;i=a+1,n=++s}for(;"*"===e[i];)i+=1;return i===e.length}function f(e,t){return(e?.allow===void 0||e.allow.some(e=>g(e,t)))&&!e?.deny?.some(e=>g(e,t))}n.Ik({tools:o,skills:o,capabilities:n.g1(a,o)}).strict()},85232:(e,t,i)=>{"use strict";function n(e){if(!/^(0|[1-9]\d*)$/.test(e))return e;let t=Number(e);if(!Number.isSafeInteger(t))throw Error(`Increment array index is invalid: ${e}`);return t}function a(e){if(!e||e.length>1024)throw Error("Increment path length is invalid");let t=[],i="",a=!1;for(let n of e){if(a){if("."!==n&&"\\"!==n)throw Error(`Increment path contains an invalid escape: \\${n}`);i+=n,a=!1;continue}if("\\"===n){a=!0;continue}if("."===n){if(!i)throw Error("Increment path contains an empty segment");t.push(i),i="";continue}i+=n}if(a)throw Error("Increment path ends with an escape");if(!i)throw Error("Increment path contains an empty segment");t.push(i);let s=t.shift();if("summary"!==s&&"detail"!==s)throw Error("Increment path root must be summary or detail");return{root:s,segments:t.map(n)}}function s(e,t){return e.root===t.root&&!(e.segments.length>t.segments.length)&&e.segments.every((e,i)=>e===t.segments[i])}i.d(t,{U:()=>a,v:()=>s})},86062:(e,t,i)=>{"use strict";i.d(t,{T8:()=>f,WW:()=>v,aD:()=>o,co:()=>p,lw:()=>y,ph:()=>g,xv:()=>d,yw:()=>m});var n=i(38979),a=i(67765),s=i(24985);let o=n.Yj().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),r=n.KC([o,n.eu("HEAD"),n.Yj().max(1024).regex(/^refs\/(?:heads|remotes)\/[^\0\r\n]+$/)]).refine(e=>!e.includes("..")&&!e.endsWith("/"),"Git 版本无效"),l=n.KC([n.Ik({commit:r,parent:o.optional()}).strict(),n.Ik({base:r,target:r,strategy:n.k5(["merge-base","direct"])}).strict()]),c=n.Ik({base:o.nullable(),target:o,original:o.nullable()}).strict(),d=n.Ik({baseCommit:o.nullable(),targetCommit:o,oldPath:a._g.optional()}).strict(),u=n.Ik({oid:o,parents:n.YO(o),subject:n.Yj(),author:n.Yj(),timestampMs:n.ai().int(),refs:n.YO(n.Yj())}).strict(),p=n.Ik({tip:r,exclude:r.optional(),query:n.Yj().trim().max(200).default(""),author:n.Yj().trim().max(200).optional(),page:n.Ik({index:n.ai().int().min(1).max(2e3),size:n.ai().int().min(1).max(100)}).strict()}).strict(),m=n.Ik({tip:o.nullable(),exclude:o.nullable(),items:n.YO(u),hasMore:n.zM(),truncated:n.zM()}).strict(),h=n.Ik({path:a._g,oldPath:a._g.nullable(),status:n.k5(["added","modified","deleted","renamed","type-changed"])}).strict(),g=n.Ik({selection:l,page:n.Ik({index:n.ai().int().min(1).max(5e4),size:n.ai().int().min(1).max(500)}).strict()}).strict(),f=n.Ik({comparison:c,commit:u.extend({message:n.Yj(),selectedParent:o.nullable()}).nullable(),items:n.YO(h),hasMore:n.zM(),truncated:n.zM()}).strict(),v=s.gf.extend({upstream:n.Ik({ref:n.Yj(),ahead:n.ai().int().nonnegative().nullable(),behind:n.ai().int().nonnegative().nullable()}).strict().nullable()}).strict(),y=n.KC([s.FJ,n.Ik({kind:n.eu("metadata"),original:n.Yj(),modified:n.Yj()}).strict()])},89790:(e,t,i)=>{"use strict";i.d(t,{G7:()=>d,L$:()=>m,h_:()=>h,oI:()=>u,uB:()=>c,xL:()=>p});var n=i(7962);i(69266);var a=i(30442),s=i(49426);i(5464);var o=i(17511),r=i(41148),l=i(90458);function c({className:e,...t}){return(0,n.jsx)(a.uB,{"data-slot":"command",className:(0,s.cn)("flex size-full flex-col overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground",e),...t})}function d({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,n.jsxs)(o.MG,{className:"has-[[data-slot=command-input]:focus-visible]:outline-2 has-[[data-slot=command-input]:focus-visible]:outline-solid has-[[data-slot=command-input]:focus-visible]:-outline-offset-2 has-[[data-slot=command-input]:focus-visible]:outline-ring",children:[(0,n.jsx)(a.uB.Input,{"data-slot":"command-input",className:(0,s.cn)("min-h-8 w-full bg-transparent px-2.5 text-sm leading-5 outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t}),(0,n.jsx)(o.Sq,{children:(0,n.jsx)(r.A,{className:"size-4 shrink-0 opacity-50"})})]})})}function u({className:e,...t}){return(0,n.jsx)(a.uB.List,{"data-slot":"command-list",className:(0,s.cn)("pi-desk-chat-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...t})}function p({className:e,...t}){return(0,n.jsx)(a.uB.Empty,{"data-slot":"command-empty",className:(0,s.cn)("py-6 text-center text-sm",e),...t})}function m({className:e,...t}){return(0,n.jsx)(a.uB.Group,{"data-slot":"command-group",className:(0,s.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...t})}function h({className:e,children:t,...i}){return(0,n.jsxs)(a.uB.Item,{"data-slot":"command-item",className:(0,s.cn)("group/command-item relative flex min-h-8 cursor-pointer items-center gap-2 rounded-md px-2 py-1 text-sm leading-5 outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[selected=true]:*:[svg]:text-foreground",e),...i,children:[t,(0,n.jsx)(l.A,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}},90064:e=>{e.exports={host:"l4-code-line-markers_host__BBo2H",added:"l4-code-line-markers_added__oTNsK",modified:"l4-code-line-markers_modified__PZnY_",deletedBefore:"l4-code-line-markers_deletedBefore___1b0w",deletedAfter:"l4-code-line-markers_deletedAfter__SEoHy"}},90434:(e,t,i)=>{"use strict";i.d(t,{AM:()=>u,Wv:()=>p,eO:()=>h,hl:()=>m});var n=i(7962);i(69266);var a=i(50960),s=i(40252),o=i(17596),r=i(80168),l=i(40287),c=i(76624),d=i(49426);function u({...e}){return(0,n.jsx)(a.y,{"data-slot":"popover",...e})}function p({...e}){return(0,n.jsx)(s.W,{"data-slot":"popover-trigger",...e})}function m({className:e,positionerClassName:t,align:i="center",alignOffset:a=0,side:s="bottom",sideOffset:c=4,finalFocus:u=!1,...p}){return(0,n.jsx)(o.i,{children:(0,n.jsx)(r.U,{align:i,alignOffset:a,side:s,sideOffset:c,className:(0,d.cn)("isolate z-50",t),children:(0,n.jsx)(l.i,{"data-slot":"popover-content",finalFocus:u,className:(0,d.cn)("z-50 flex w-80 max-w-[calc(100vw-2rem)] origin-(--transform-origin) flex-col gap-3 rounded-lg border border-border bg-popover p-3 text-sm text-popover-foreground shadow-md outline-hidden duration-100 motion-reduce:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...p})})})}function h({className:e,...t}){return(0,n.jsx)(c.e,{"data-slot":"popover-title",className:(0,d.cn)("font-medium",e),...t})}},90504:(e,t,i)=>{"use strict";i.d(t,{e:()=>p});var n=i(7962),a=i(14044),s=i(69266),o=i(78121),r=i(91182),l=i(18302),c=i(33550),d=i(90064),u=i.n(d);let p=(0,s.forwardRef)(function({path:e,content:t,size:d,savedState:p,onSaveState:m,onEscape:h,originalContent:g,onChanges:f,onOpenDiff:v},y){let{t:x}=(0,o.Bd)("common"),{t:b}=(0,o.Bd)("projectFiles"),{wrapLines:k}=(0,c.TX)(),w=(0,s.useRef)(null),C=(0,s.useRef)(null),S=(0,s.useRef)(m),j=(0,s.useRef)(k),I=(0,s.useRef)(p),R=(0,s.useRef)(h),F=(0,s.useRef)(null),P=(0,s.useRef)(f),M=(0,s.useRef)(v);(0,s.useEffect)(()=>{I.current=p,R.current=h,P.current=f,M.current=v},[f,h,v,p]);let[D,N]=(0,s.useState)("loading");return(0,s.useEffect)(()=>{S.current=m},[m]),(0,s.useEffect)(()=>{j.current=k},[k]),(0,s.useImperativeHandle)(y,()=>({openSearch(){C.current?.getAction("actions.find")?.run()},gotoLine(){C.current?.getAction("editor.action.gotoLine")?.run()},getSelectionText(){let e=C.current,t=e?.getModel(),i=e?.getSelection();return t&&i&&!i.isEmpty()?t.getValueInRange(i):""},getViewState:()=>C.current?.saveViewState()??null,focus(){C.current?.focus()},previousChange(){F.current?.previousChange()},nextChange(){F.current?.nextChange()}}),[]),(0,s.useEffect)(()=>{let n=w.current;if(!n)return;let a=!0,s=null,o=null,c=null,p=()=>void 0,m=()=>void 0;return queueMicrotask(()=>{a&&N("loading")}),(0,r.cu)().then(h=>{a&&(o=h.editor.createModel(t,(0,r.ix)(e,d),(0,r.B3)(h,e,"preview")),s=h.editor.create(n,{model:o,theme:(0,r.dC)(),readOnly:!0,domReadOnly:!0,editContext:!1,automaticLayout:!0,minimap:{enabled:!1},stickyScroll:{enabled:!1},scrollBeyondLastLine:!1,smoothScrolling:!0,wordWrap:j.current?"on":"off",wrappingIndent:"same",...(0,r.R)(),lineNumbersMinChars:3,lineDecorationsWidth:26,folding:d<=1048576,renderValidationDecorations:"off",renderWhitespace:"selection",bracketPairColorization:{enabled:d<=1048576},unicodeHighlight:{nonBasicASCII:!1},padding:{top:10,bottom:10},overviewRulerBorder:!1,contextmenu:!0,ariaLabel:x("codeReadOnly")}),I.current&&s.restoreViewState(I.current),R.current&&(0,l.e)(s,h.KeyCode.Escape,()=>R.current?.()),C.current=s,void 0!==g&&(F.current=c=function(e,t,n){let a=e.createDecorationsCollection(),s=e.getModel()?.getLineCount()??1,o=[],r=!0,l=null,c=null,d=[u().added,u().modified,u().deletedBefore,u().deletedAfter].map(e=>`.${e}`).join(","),p=e=>Math.min(s,"deleted"===e.kind?Math.max(1,e.modifiedStartLineNumber-1):e.modifiedStartLineNumber),m=()=>{null!==c&&clearTimeout(c),c=null,l?.terminate(),l=null},h=e=>{r&&(m(),o=e??[],a.set(o.map(e=>{let i="deleted"===e.kind,a=p(e),s=i?a:e.modifiedEndLineNumberExclusive-1,o=i?e.originalEndLineNumberExclusive-e.originalStartLineNumber:e.modifiedEndLineNumberExclusive-e.modifiedStartLineNumber,r={added:["#16803c","#59c77b"],modified:["#216bcc","#6aabff"],deleted:["#d12c38","#ff757f"]}[e.kind],l=i?1===e.modifiedStartLineNumber?u().deletedBefore:u().deletedAfter:u()[e.kind];return{range:new t.Range(a,1,s,1),options:{isWholeLine:!i,showIfCollapsed:!0,linesDecorationsClassName:i?void 0:l,firstLineDecorationClassName:i?l:void 0,linesDecorationsTooltip:n.tooltip(e.kind,o),overviewRuler:{color:r[0],darkColor:r[1],position:t.editor.OverviewRulerLane.Left}}}})),null===e&&console.warn("[Pi Desk][CodePreview] 行标记不可用,计算失败或超过限制",{path:n.path}),n.onChanges(e?.length??null))},g=e.onMouseDown(e=>{if(e.target.type!==t.editor.MouseTargetType.GUTTER_LINE_DECORATIONS||!e.target.element?.closest(d))return;let i=e.target.position?.lineNumber;void 0===i||o.find(e=>"deleted"===e.kind?p(e)===i:e.modifiedStartLineNumber<=i&&i<e.modifiedEndLineNumberExclusive)&&n.onOpenDiff(i)});try{(l=new Worker(i.tu(new URL(i.p+i.u(58779),i.b)),{type:void 0,name:"pi-desk-line-changes"})).onmessage=e=>h(e.data),l.onerror=()=>h(null),l.onmessageerror=()=>h(null),c=setTimeout(()=>h(null),3e3),l.postMessage({original:n.original,modified:n.modified})}catch{h(null)}let f=t=>{if(0===o.length)return;let i=e.getPosition()?.lineNumber??1,n=o.map(p),a="next"===t?n.find(e=>e>i)??n[0]:n.findLast(e=>e<i)??n[n.length-1];e.setPosition({lineNumber:a,column:1}),e.revealLineInCenter(a),e.focus()};return{previousChange(){f("previous")},nextChange(){f("next")},dispose(){r=!1,m(),g.dispose(),a.clear(),o=[]}}}(s,h,{path:e,original:g,modified:t,tooltip:(e,t)=>b({added:"gitAddedLines",modified:"gitModifiedLines",deleted:"gitDeletedLines"}[e],{count:t}),onChanges:e=>P.current?.(e),onOpenDiff:e=>M.current?.(e)})),p=(0,r.Tr)(e=>h.editor.setTheme(e)),m=(0,r.BK)(e=>s?.updateOptions(e)),N("ready"))}).catch(t=>{a&&(console.error("[Pi Desk][CodePreview] Monaco 加载失败",{path:e,errorName:t instanceof Error?t.name:"UnknownError"}),N("error"),void 0!==g&&P.current?.(null))}),()=>{a=!1,p(),m(),c?.dispose(),F.current=null,s&&(I.current=s.saveViewState(),S.current(e,I.current)),C.current=null,s?.dispose(),o?.dispose()}},[t,g,e,b,d,x]),(0,s.useEffect)(()=>{C.current?.updateOptions({wordWrap:k?"on":"off"})},[k]),(0,n.jsxs)("div",{"data-testid":"code-preview",className:"relative h-full min-h-0 w-full overflow-hidden bg-background",children:[(0,n.jsx)("div",{ref:w,className:`size-full ${u().host}`}),"loading"===D?(0,n.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center gap-2 bg-background text-sm text-muted-foreground",children:[(0,n.jsx)(a.A,{className:"size-4 animate-spin"})," ",x("codeLoading")]}):null,"error"===D?(0,n.jsx)("div",{className:"absolute inset-0 flex items-center justify-center p-6 text-center text-sm text-destructive",children:x("codeFailed")}):null]})})},90740:(e,t,i)=>{"use strict";i.d(t,{$y:()=>d,Ev:()=>c,Zi:()=>p,wm:()=>u});var n=i(7962),a=i(69266),s=i(38903);let o="pi-desk:display-size-change",r=null;function l(e){document.documentElement.dataset.piDeskDisplaySize=e}function c(){if(null!==r)return r;try{let e=window.localStorage.getItem(s.qD),t=null===e?JSON.parse(window.localStorage.getItem(s.c4)??"null"):null;r=(0,s.eN)(e,t)}catch{r=s.Y8}return r}function d(e){r=e;try{window.localStorage.setItem(s.qD,e)}catch{}l(e),window.dispatchEvent(new Event(o))}function u(e){let t=t=>{(null===t.key||t.key===s.qD||t.key===s.c4)&&(r=null,e())};return window.addEventListener(o,e),window.addEventListener("storage",t),()=>{window.removeEventListener(o,e),window.removeEventListener("storage",t)}}function p({children:e}){return(0,a.useEffect)(()=>{let e=()=>l(c()),t=u(e);return e(),t},[]),(0,n.jsx)(n.Fragment,{children:e})}},91182:(e,t,i)=>{"use strict";i.d(t,{B3:()=>p,BK:()=>o,R:()=>s,Tr:()=>u,cu:()=>c,dC:()=>d,ix:()=>m});var n=i(67765),a=i(48708);function s(){let e=Number.parseFloat(getComputedStyle(document.documentElement).fontSize)/16;return{fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',fontSize:14*e,lineHeight:Math.round(22*e)}}function o(e){let t=new MutationObserver(()=>e(s()));return t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-pi-desk-display-size"]}),()=>t.disconnect()}let r=null,l=0;function c(){return r||(r=(async()=>{(0,a.fx)()?.locale==="zh-CN"&&await i.e(12212).then(i.t.bind(i,12212,23));let{monaco:e}=await Promise.all([i.e(87221),i.e(46550),i.e(62134),i.e(38459),i.e(46270),i.e(95287),i.e(54206),i.e(87086)]).then(i.bind(i,87086));return globalThis.MonacoEnvironment={getWorker:(e,t)=>new Worker(i.tu(new URL(i.p+i.u(53291),i.b)),{type:void 0,name:t})},e})())}function d(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}function u(e){let t=new MutationObserver(()=>e(d()));return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()}function p(e,t,i){l+=1;let n=t.split("/").map(e=>encodeURIComponent(e)).join("/");return e.Uri.parse(`inmemory://pi-desk/${l}/${i}/${n}`)}function m(e,t){if(t>n.gB)return"plaintext";let i=e.replaceAll("\\","/").split("/").at(-1)?.toLocaleLowerCase()??"";return"dockerfile"===i?"dockerfile":"makefile"===i?"plaintext":({bat:"bat",c:"c",cc:"cpp",cjs:"javascript",cpp:"cpp",cs:"csharp",css:"css",dockerfile:"dockerfile",go:"go",h:"cpp",hpp:"cpp",htm:"html",html:"html",ini:"ini",java:"java",js:"javascript",json:"javascript",jsonl:"javascript",jsx:"javascript",kt:"kotlin",less:"less",lua:"lua",md:"markdown",mdx:"markdown",mjs:"javascript",php:"php",ps1:"powershell",py:"python",rb:"ruby",rs:"rust",scss:"scss",sh:"shell",sql:"sql",swift:"swift",toml:"ini",ts:"typescript",tsx:"typescript",txt:"plaintext",xml:"xml",yaml:"yaml",yml:"yaml"})[i.includes(".")?i.split(".").at(-1)??"":""]??"plaintext"}},91399:(e,t,i)=>{"use strict";i.d(t,{e4:()=>p,kM:()=>h});var n=i(38979),a=i(15381),s=i(62851),o=i(70698),r=i(9626);let l=n.Ik({}).strict(),c=n.Ik({workId:a.eW}).strict(),d=n.Ik({workId:a.eW}).strict(),u=n.Ik({cwd:a.ik.optional(),sessionId:a.Kx.optional(),branchId:n.Yj().min(1).optional(),projectName:n.Yj().trim().min(1).optional(),sessionTitle:n.Yj().trim().min(1).nullable().optional(),status:a.jw.optional(),messageCounts:a.AA.optional(),lastMessageUpdatedAt:o.k.nullable().optional()}).strict().refine(e=>Object.keys(e).length>0,{message:"work session changes cannot be empty"}),p=n.Ik({workSessions:n.YO(a.MY),pinnedCount:a.MT,appRuntime:s.GR}).strict().refine(e=>e.pinnedCount<=e.workSessions.length,{message:"pinnedCount cannot exceed work session count",path:["pinnedCount"]}),m=n.gM("type",[n.Ik({type:n.eu("snapshot"),workSessions:n.YO(a.MY),pinnedCount:a.MT}).strict().refine(e=>e.pinnedCount<=e.workSessions.length,{message:"pinnedCount cannot exceed work session count",path:["pinnedCount"]}),n.Ik({type:n.eu("update"),workId:a.eW,changes:u}).strict(),n.Ik({type:n.eu("delete"),workId:a.eW}).strict()]),h=Object.freeze({list:(0,r.Vc)({path:"work-sessions/list",inputSchema:l,outputSchema:p}),acknowledgeCompleted:(0,r.Vc)({path:"work-sessions/ack-completed",inputSchema:c,outputSchema:d}),update:(0,r._G)({path:"work-sessions/update",bodySchema:m})})},93119:(e,t,i)=>{"use strict";i.d(t,{$:()=>o,P:()=>s});var n=i(94853),a=i(93320);async function s(e,t,i,s){await (0,a.QL)(e,n.Ot,{...t,path:i,targetType:s})}function o(e,t){let i=/^[a-zA-Z]:[\\/]/.test(e)||e.startsWith("\\\\"),n=i?"\\":"/",a=(i?e.replaceAll("/","\\"):e).replace(/[\\/]+$/,"");return t?`${a}${n}${t.replaceAll("/",n)}`:/^[a-z]:$/i.test(a)?`${a}${n}`:a||n}},93320:(e,t,i)=>{"use strict";i.d(t,{QL:()=>o,Y4:()=>r,aw:()=>s});var n=i(73230),a=i(94853);class s extends Error{constructor(e,t,i,n=null){super(i),this.status=e,this.code=t,this.errorKey=n,this.name="L3ProjectRequestError"}}async function o(e,t,i,a){let o=await fetch(t.path,{method:"POST",headers:{"Content-Type":"application/json","X-Pi-Desk-Client-Id":e},body:JSON.stringify(t.request.parse(i)),signal:a}),r=await o.json();if(!o.ok||0!==r.code||null===r.data)throw new s(o.status,r.code,r.msg?(0,n.B)(r):"项目读取失败",r.i18n?.key??null);return t.response.parse(r.data)}function r(e,t){return{list:(i,n)=>o(e,a.Xe,{...t,path:i},n),search:(i,n)=>o(e,a.fg,{...t,query:i},n),get:(i,n,s)=>o(e,a.ZI,{...t,path:i,imagePreviewMode:n},s),snapshot:(i,n)=>o(e,a.p0,{...t,refresh:n},i),branches:(i,n)=>o(e,a.ry,{...t,repositoryRoot:i},n),log:(i,n,s)=>o(e,a.p3,{...t,repositoryRoot:i,...n},s),changes:(i,n,s)=>o(e,a.ys,{...t,repositoryRoot:i,...n},s),diff:(i,n,s,r)=>o(e,a.OC,{...t,repositoryRoot:i,path:n,comparison:r},s)}}},93540:(e,t,i)=>{"use strict";i.d(t,{C:()=>n});let n={en:{reading:"Loading…",retryReading:"{{error}}. Retry",showMore:"Show more ({{visible}} / {{total}})",viewDiff:"View diff",openPreview:"Open preview",gitStatus:"Git status {{status}}",directoryLimit:"This folder has many entries. Showing the first 5,000; use search to find more.",emptyDirectory:"Empty folder",incompleteRepository:"Some repositories could not be read. The change list may be incomplete.",noChangedFiles:"No changed files",noChanges:"No changes",gitBranches:"Git branches",gitBranchReadOnly:"Git branch (read-only)",selectPreviewDirectory:"Switch preview directory",previewDirectories:"Preview directories",sessionDirectory:"Original folder",unavailable:"Unavailable",projectFiles:"{{name}} project files",searchFiles:"Search filenames",closeSearch:"Close file search",layout:"File organization",directory:"Folders",repository:"Repositories",changesOnly:"Changes only",searchProject:"Search project files",noMatches:"No matching files",searching:"Searching…",resultLimit:"Showing the first 100 results.",copied:"Copied.",copyFailed:"Could not copy. Please try again.",revealRequested:"Opened the system file manager.",revealFailed:"Could not locate the file",collapse:"Collapse",expand:"Expand",openCurrentWorkspace:"Open current workspace folder",locateCurrentWorkspace:"Locate in current workspace",openFolder:"Open this folder",openContainingFolder:"Open containing folder",copyAbsolutePath:"Copy absolute path",copyRelativePath:"Copy relative path",copyFolderName:"Copy folder name",copyFileName:"Copy filename",copyOldRelativePath:"Copy original relative path",selectedCodeCopied:"Selected code copied.",allCodeCopied:"All code copied.",copyContentFailed:"Could not copy the file. Please copy it manually.",fileActions:"File actions",headToWorking:"HEAD ↔ working tree",gitChangesCount:"Against HEAD \xb7 {{count}} changes",gitChangesCompact:"{{count}} changes",gitMarkersLoading:"Comparing with HEAD…",gitMarkersFailed:"Could not read changes \xb7 Reload to retry",gitMarkersUnavailable:"Line change markers unavailable",gitAddedLines:"{{count}} lines added",gitModifiedLines:"{{count}} lines modified",gitDeletedLines:"{{count}} lines deleted",noDiffChanges:" \xb7 No content differences",previousChange:"Previous change",nextChange:"Next change",inlineDiff:"Switch to inline diff",sideBySideDiff:"Switch to side-by-side diff",wrapOff:"Turn off line wrapping",wrapOn:"Turn on line wrapping",expandUnchanged:"Expand unchanged content",collapseUnchanged:"Collapse unchanged content",reloadDiff:"Reload diff",htmlMode:"HTML display mode",previewMode:"Preview",sourceMode:"Source",findInFile:"Find in file",goToLine:"Go to line",copySelectionOrAll:"Copy selected or all content",reloadCurrentFile:"Reload this file",binaryDiffUnavailable:"Binary files cannot be diffed online.",largeDiffUnavailable:"Files over 5 MB cannot be diffed online.",readAgain:"Reload",noOpenFile:"No file open",imageViewer:"{{name}} image viewer",htmlPreview:"{{name}} HTML preview",loadingFile:"Loading file…",closeTab:"Close tab",closeOtherTabs:"Close other tabs",closeRightTabs:"Close tabs to the right",closeLeftTabs:"Close tabs to the left",closeAllTabs:"Close all tabs",openFiles:"Open files",closeDiff:"Close diff {{name}}",closeFile:"Close file {{name}}",collapseTabs:"Collapse tabs",expandTabs:"Expand tabs \xb7 {{count}}",gitUnavailable:"Git unavailable",repositoriesUnit:"repositories",projectReadFailed:"Could not read project",revealUnavailable:"File location is not available yet",maxOpenFiles:"At most {{count}} files can be open. Close some files first.",branchFileClosed:"File no longer exists on the selected branch and was closed: {{path}}"},"zh-CN":{reading:"正在读取…",retryReading:"{{error}},点击重试",showMore:"显示更多({{visible}} / {{total}})",viewDiff:"查看差异",openPreview:"打开预览",gitStatus:"Git 状态 {{status}}",directoryLimit:"该目录内容较多,仅显示前 5000 项,请使用搜索。",emptyDirectory:"空目录",incompleteRepository:"仓库读取不完整,无法确认全部变更",noChangedFiles:"没有变更文件",noChanges:"没有变更",gitBranches:"Git 分支",gitBranchReadOnly:"Git 分支(只读)",selectPreviewDirectory:"切换预览目录",previewDirectories:"预览目录",sessionDirectory:"原目录",unavailable:"不可用",projectFiles:"{{name}} 项目文件",searchFiles:"搜索文件名",closeSearch:"关闭文件搜索",layout:"文件组织方式",directory:"目录",repository:"仓库",changesOnly:"只看变更",searchProject:"搜索项目文件",noMatches:"没有匹配文件",searching:"正在搜索…",resultLimit:"结果较多,仅显示前 100 条。",copied:"已复制。",copyFailed:"复制失败,请重试。",revealRequested:"已请求运行端文件管理器定位。",revealFailed:"系统定位失败",collapse:"收起",expand:"展开",openCurrentWorkspace:"打开当前工作区目录",locateCurrentWorkspace:"在当前工作区定位",openFolder:"打开此文件夹",openContainingFolder:"打开所在文件夹",copyAbsolutePath:"复制绝对路径",copyRelativePath:"复制相对路径",copyFolderName:"复制目录名",copyFileName:"复制文件名",copyOldRelativePath:"复制原相对路径",selectedCodeCopied:"已复制选中代码。",allCodeCopied:"已复制全部代码。",copyContentFailed:"复制文件内容失败,请手动复制。",fileActions:"文件操作",headToWorking:"HEAD ↔ 工作区",gitChangesCount:"相对 HEAD \xb7 {{count}} 处变更",gitChangesCompact:"{{count}} 处变更",gitMarkersLoading:"正在与 HEAD 比较…",gitMarkersFailed:"变更读取失败 \xb7 刷新重试",gitMarkersUnavailable:"此文件无法显示行变更",gitAddedLines:"新增 {{count}} 行",gitModifiedLines:"修改 {{count}} 行",gitDeletedLines:"删除 {{count}} 行",noDiffChanges:" \xb7 当前比较无内容差异",previousChange:"上一个变更",nextChange:"下一个变更",inlineDiff:"切换为单栏 Diff",sideBySideDiff:"切换为左右 Diff",wrapOff:"关闭自动换行",wrapOn:"开启自动换行",expandUnchanged:"展开未变更内容",collapseUnchanged:"折叠未变更内容",reloadDiff:"重新加载 Diff",htmlMode:"HTML 显示方式",previewMode:"预览",sourceMode:"源码",findInFile:"在文件中查找",goToLine:"跳转到行",copySelectionOrAll:"复制选中内容或全部",reloadCurrentFile:"重新加载当前文件",binaryDiffUnavailable:"二进制文件暂不支持在线 Diff。",largeDiffUnavailable:"文件超过 5MB,暂不支持在线 Diff。",readAgain:"重新读取",noOpenFile:"尚未打开文件",imageViewer:"{{name}} 图片查看器",htmlPreview:"{{name}} HTML 预览",loadingFile:"正在读取文件…",closeTab:"关闭标签",closeOtherTabs:"关闭其他标签",closeRightTabs:"关闭右侧标签",closeLeftTabs:"关闭左侧标签",closeAllTabs:"关闭全部标签",openFiles:"已打开文件",closeDiff:"关闭 Diff {{name}}",closeFile:"关闭文件 {{name}}",collapseTabs:"收起标签",expandTabs:"展开标签 \xb7 {{count}}",gitUnavailable:"Git 不可用",repositoriesUnit:"个仓库",projectReadFailed:"读取项目失败",revealUnavailable:"系统定位尚未准备好",maxOpenFiles:"最多打开 {{count}} 个文件,请先关闭部分文件",branchFileClosed:"文件在切换后的分支中不存在,已关闭:{{path}}"}}},94853:(e,t,i)=>{"use strict";i.d(t,{OC:()=>b,Ot:()=>u,Xe:()=>p,ZI:()=>h,_X:()=>f,fg:()=>m,p0:()=>g,p3:()=>y,ry:()=>v,ys:()=>x});var n=i(38979),a=i(67765),s=i(24985),o=i(86062);let r=n.Ik({cwd:n.Yj().trim().min(1).max(4096),workId:n.Yj().trim().min(1).optional()}).strict(),l=r.extend({repositoryRoot:a.rh}),c=r.extend({path:a.eC,imagePreviewMode:a.p$}).superRefine((e,t)=>{e.workId||a._g.safeParse(e.path).success||t.addIssue({code:"custom",path:["path"],message:"独立项目预览只接受根内相对路径"})}),d=n.k5(["file","directory"]),u={path:"/api/project-files/reveal",request:r.extend({path:a.rh,targetType:d.optional()}).refine(e=>""!==e.path||"directory"===e.targetType,"文件路径不能为空"),response:n.Ik({}).strict()},p={path:"/api/project-files/list",request:r.extend({path:a.rh}).strict(),response:a.JH},m={path:"/api/project-files/search",request:r.extend({query:n.Yj().trim().min(1).max(200)}).strict(),response:a.jI},h={path:"/api/project-files/get",request:c,response:a.ih},g={path:"/api/project-git/get",request:r.extend({refresh:n.zM().optional()}).strict(),response:n.Ik({repositories:n.YO(s.u2).max(100)}).strict()},f={path:"/api/project-git-heads/get",request:r,response:n.Ik({repositories:n.YO(s.yl).max(s.y2)}).strict()},v={path:"/api/project-git-branches/list",request:l.strict(),response:o.WW},y={path:"/api/project-git-log/list",request:l.extend(o.co.shape).strict(),response:o.yw},x={path:"/api/project-git-changes/list",request:l.extend(o.ph.shape).strict(),response:o.T8},b={path:"/api/project-git-diff/get",request:l.extend({path:a._g,comparison:o.xv.optional()}).strict(),response:o.lw}},95826:(e,t,i)=>{"use strict";i.d(t,{QV:()=>b});var n=i(38979),a=i(267),s=i(9626),o=i(99739);let r=n.k5(["extension","prompt","skill"]),l=n.Ik({name:n.Yj().trim().min(1).max(128),description:n.Yj().max(500).nullable(),source:r}).strict(),c=n.Ik({source:a.R}).strict(),d=n.Ik({commands:n.YO(l)}).strict(),u=n.Ik({source:a.R,command:n.Yj().trim().min(1).max(128),args:n.Yj().max(32768).optional()}).strict(),p=n.Ik({}).strict(),m=n.Ik({name:n.Yj().trim().min(1).max(128),description:n.Yj(),parameters:o.Dz,active:n.zM(),exposure:n.k5(["direct","model-only","codemode","deferred","hidden"]),source:n.Yj().nullable(),blockedByMode:n.zM()}).strict(),h=n.Ik({source:a.R}).strict(),g=n.Ik({tools:n.YO(m)}).strict(),f=n.Ik({source:a.R,command:n.Yj().min(1).max(32768),excludeFromContext:n.zM()}).strict(),v=n.Ik({output:n.Yj(),exitCode:n.ai().int().nullable(),cancelled:n.zM(),truncated:n.zM(),fullOutputPath:n.Yj().nullable()}).strict(),y=n.Ik({source:a.R}).strict(),x=n.Ik({}).strict(),b=Object.freeze({commandsList:(0,s.Vc)({path:"pi/commands/list",inputSchema:c,outputSchema:d}),commandExecute:(0,s.Vc)({path:"pi/commands/execute",inputSchema:u,outputSchema:p,timeoutMs:3e5}),toolsList:(0,s.Vc)({path:"pi/tools/list",inputSchema:h,outputSchema:g}),bashExecute:(0,s.Vc)({path:"pi/bash/execute",inputSchema:f,outputSchema:v,timeoutMs:12e4}),bashAbort:(0,s.Vc)({path:"pi/bash/abort",inputSchema:y,outputSchema:x})})},96646:(e,t,i)=>{"use strict";i.d(t,{Mj:()=>r,Pl:()=>a,Tb:()=>n,Wv:()=>o});let n="pi-super-theme",a="dark",s=["system","light","dark"];function o(e){return s.some(t=>t===e)}function r(e,t){return"system"===e?t?"dark":"light":e}},99084:(e,t,i)=>{"use strict";i.d(t,{x:()=>a});var n=i(79137);function a(e){return(0,n.h3)(e)}},99739:(e,t,i)=>{"use strict";i.d(t,{Dz:()=>r,f7:()=>o,tv:()=>s});var n=i(38979);let a=n.Yj().trim().min(1).max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),s=a,o=a,r=n.g1(n.Yj(),n.Pq());n.Yj().trim().min(3).max(129).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*\/[a-z0-9]+(?:-[a-z0-9]+)*$/);let l=n.k5(["plugin","server","rocket","settings","panel","message","terminal","file","folder","bot","wrench","database","globe"]);n.gM("type",[n.Ik({type:n.eu("builtin"),name:l}).strict(),n.Ik({type:n.eu("svg"),content:n.Yj().trim().min(1).max(16384)}).strict()])}}]);