@co0ontty/wand 4.104.1 → 4.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +3 -3
- package/dist/provider-catalog.d.ts +2 -7
- package/dist/provider-catalog.js +13 -7
- package/dist/server-workspace-routes.js +12 -27
- package/dist/structured-provider-common.d.ts +1 -1
- package/dist/structured-provider-common.js +4 -27
- package/dist/task-comment-dispatch.js +0 -3
- package/dist/web-ui/content/login.js +4 -4
- package/dist/web-ui/content/module-manifest.json +1 -1
- package/dist/web-ui/content/modules/{58866143a3365521 → 0341f0d00f88a16f}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{91ee32135a3582b0 → 0567e161e2cca41e}/chunk.js +1 -1
- package/dist/web-ui/content/modules/069f5a4267b0a9e3/runtime.js +279 -0
- package/dist/web-ui/content/modules/{2afbc201474adacc → 084dca1ea52bf38e}/login-visual.js +1 -1
- package/dist/web-ui/content/modules/0d62c22b7aed5f1f/host-bridge.js +1 -0
- package/dist/web-ui/content/modules/{30169d15cea782f0 → 0d7f7d954382dc42}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{3d10e3f6f6f92b55 → 0da28408ec089cf7}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{57d68f0a47e8fd7c → 130e8905cc7f639c}/toast-region.js +1 -1
- package/dist/web-ui/content/modules/{79b0c18f2bf35740 → 186d6e3b44a3c539}/host.js +1 -1
- package/dist/web-ui/content/modules/{d7b540917fb90755 → 1870280f0e783c62}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{3bd3c84c4257ba0d → 1a0b5db535599f72}/chunk.js +1 -1
- package/dist/web-ui/content/modules/1cf252d2f64a6279/chunk.js +7 -0
- package/dist/web-ui/content/modules/1d1dc0fd8a0210aa/composer-surface-adapter.js +1 -0
- package/dist/web-ui/content/modules/{907dcf0ea5b5f23f → 2061d4a88875b9f9}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{2a47853ca7752c1f → 22497085d7cdd83b}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{12e91deb96ace24d → 23f15023aa2279a3}/shell-file-panel-drawer.js +1 -1
- package/dist/web-ui/content/modules/{15279373f0e1461f → 2cab58e5d148844c}/host.js +1 -1
- package/dist/web-ui/content/modules/{6b0bafa239dfe4e2 → 32edeb64dbf339f6}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{e01769df89873feb → 33daaeb4bf68c7ba}/chunk.js +1 -1
- package/dist/web-ui/content/modules/37da177222b6308d/workspaces-panel.js +4 -0
- package/dist/web-ui/content/modules/3af7facf8a7588c7/chunk.js +1 -0
- package/dist/web-ui/content/modules/3b95dc1376e932ea/host.js +1 -0
- package/dist/web-ui/content/modules/{a685793c5d9b90d1 → 3cbbad48df7998f8}/chunk.js +1 -1
- package/dist/web-ui/content/modules/41cf79c899bc83c8/host.js +1 -0
- package/dist/web-ui/content/modules/{bb59e8cb4323bf06 → 444af9de1698eea0}/host.js +1 -1
- package/dist/web-ui/content/modules/452327275cc5d8f8/host.js +1 -0
- package/dist/web-ui/content/modules/{9661b076f08e64b4 → 466310a17dac465f}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{b358eaf2e45849a6 → 46f1b6c3274d399b}/host.js +1 -1
- package/dist/web-ui/content/modules/47998d82dc65bfeb/sidebar-peek.js +1 -0
- package/dist/web-ui/content/modules/{47af6b35e1d01ea7 → 486a828390c5d44d}/host.js +1 -1
- package/dist/web-ui/content/modules/{7f32261c1627c3cd → 4cc15b385bc6cc32}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{f36b4d3d44491852 → 4d5ab67f6c0ce19f}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a41351130003e6bb → 54aaf60ac85dcb2b}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{0c04f94bbfd39a2f → 54c22eddaf009d00}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{e43af4aa407885fd → 55b931232c672f4f}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{ee893f06cdb2b4f7 → 583049de28ef2b02}/panel.js +1 -1
- package/dist/web-ui/content/modules/{da1aa5fa0186fea7 → 5a2a58334d63e127}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{39faef0cffbad28e → 5ba0668f5a22133b}/home.js +2 -2
- package/dist/web-ui/content/modules/{37abb74d1a0a0791 → 6b41e59ab342482f}/notice-view.js +1 -1
- package/dist/web-ui/content/modules/{805b859b1b76ce4d → 6b5445f41bef0a66}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{5e7104e569359449 → 6e8395f61c89b5aa}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{bfe51130a84795fb → 6f74cede70164e19}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{c03e0f84f798d33a → 704690f5d6ab9157}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{38bb024e09cb5d5d → 70715360138f4d99}/host.js +2 -2
- package/dist/web-ui/content/modules/{5de35db482fb1a42 → 78d06dfdc4b13d78}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{033e0a741edd2ba1 → 7994dec16e8b1039}/page.js +3 -3
- package/dist/web-ui/content/modules/{be497f1d39753979 → 7dce56c1987e8d43}/chunk.js +1 -1
- package/dist/web-ui/content/modules/7edec8f23f8e0834/chunk.js +1 -0
- package/dist/web-ui/content/modules/80e92c14a6789896/progress.js +1 -0
- package/dist/web-ui/content/modules/{c3e0de0a61f0db34 → 8a828b4d087667dd}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{8f0d4e22c18a58b0 → 8b2f9a027ae1d7eb}/chunk.js +1 -1
- package/dist/web-ui/content/modules/8d6f223764846e18/brand-identity.js +1 -0
- package/dist/web-ui/content/modules/{d3cc94cf4a47a12a → 9136bae16758fd4c}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a1715be0f97c2479 → 93fa5c35e4bcab96}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{55a47b6e2c2016f2 → 96fe39f39930d9e4}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{5c9e8245d4a8a312 → 99e5cdf0c3bd0e3d}/sha256.js +1 -1
- package/dist/web-ui/content/modules/{5bb5db89a343817f → 9db41ad5ac96ffa2}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{b7aeeb22bf604ec7 → 9f4e26a1c1867d65}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{02fad74223254019 → a073cb6d182ccd32}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{3a72b79418f0f80a → a8cba9f1d6b49ef1}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{8ea498cf092dba30 → a97b3b9b68f9ca38}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{601a2767ae24d1cb → aa7d409d04bbd736}/chunk.js +1 -1
- package/dist/web-ui/content/modules/ac34ed6692b43ede/dropdown-surface.js +1 -0
- package/dist/web-ui/content/modules/{ce90d0b55bbe6430 → aff19b31898aa157}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{3a2fa12c8b537964 → b2f6e088e6e45878}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{5743d8116d15696b → b4446bf92e182bfb}/employee-card.js +1 -1
- package/dist/web-ui/content/modules/{d9019922118b2c37 → b79c15aace456028}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{d4b07cef43d36e79 → b8c18baf7cfb61b1}/chat-render.js +1 -1
- package/dist/web-ui/content/modules/{5472191457a926d3 → b8c447171e3d60a0}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a63f0b3d73d97e0b → b945370f1fa784f9}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{684db83476dcba20 → ba5fa76884e1f806}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a59c83b5b5b85da2 → bb1bb9460cc10fbe}/host.js +1 -1
- package/dist/web-ui/content/modules/{217595f72a1c3fc5 → bc28252270bcc51a}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{fa79ed5d045c24dd → be7f1f9183a1247f}/chunk.js +1 -1
- package/dist/web-ui/content/modules/bf0b693a654e2655/host.js +75 -0
- package/dist/web-ui/content/modules/{d856bfc56bea5f20 → bf7449bcf95e1454}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{af6ff78aeb782cf2 → c0384ffb4ef740a0}/host.js +1 -1
- package/dist/web-ui/content/modules/{d274491ffc8ee646 → c091efd46e221c29}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{3d5c498522b48225 → c1ec2ebce8ea5dd8}/dialog-modal.js +1 -1
- package/dist/web-ui/content/modules/{2460e872ab3a1f37 → c2f7bb50118f1603}/chunk.js +1 -1
- package/dist/web-ui/content/modules/c369ce4eb71277e6/host.js +1 -0
- package/dist/web-ui/content/modules/{84358b5b729cbe48 → c46b3501573953e9}/chunk.js +1 -1
- package/dist/web-ui/content/modules/c577ad641502d509/panel-host.js +1 -0
- package/dist/web-ui/content/modules/c75976857c18f251/host.js +1 -0
- package/dist/web-ui/content/modules/{4841e45cb7c5cc67 → c8eaffbedda0d3d0}/queue-view-adapter.js +1 -1
- package/dist/web-ui/content/modules/{20483d6e57cfe9d7 → cadd26ae50359434}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{7ae83a3f06f2daa3 → d37ff6684c9aeeec}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a33666b143331cd6 → d48c1f89342bc4bc}/workspace-window.js +1 -1
- package/dist/web-ui/content/modules/{6bd6ee3c9f05e2f5 → d569c96d4acfdec3}/chunk.js +1 -1
- package/dist/web-ui/content/modules/d7cdd7dca9a0c9f8/chunk.js +1 -0
- package/dist/web-ui/content/modules/{578703196f82222d → d859a83f486aab23}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{acda148b7423bdab → d8b258a6455d77da}/host.js +1 -1
- package/dist/web-ui/content/modules/d937e939122180b9/host.js +1 -0
- package/dist/web-ui/content/modules/{c3e1f083e07d6840 → df5d48b4ff04b443}/library-bridge.js +1 -1
- package/dist/web-ui/content/modules/e020beea3e7da7db/chunk.js +1 -0
- package/dist/web-ui/content/modules/{e0ab9fa5a8882433 → e0a1ae9163e77556}/host.js +1 -1
- package/dist/web-ui/content/modules/e2feda63a603c64e/group-editor.js +1 -0
- package/dist/web-ui/content/modules/{a2be1fd01cf06837 → e4503f8e6379ccdc}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{d857ea8244b1026e → e70296674a841d60}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{17603a34d545c784 → ec2f6b23d12d3a15}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{85181d84d5ce62b3 → ede751e1f2500d03}/employee-profile.js +1 -1
- package/dist/web-ui/content/modules/{97ef63ff1f0784d9 → ee4301b734e2fd43}/chunk.js +1 -1
- package/dist/web-ui/content/modules/f4e6095edc32562c/markdown.js +1 -0
- package/dist/web-ui/content/modules/{9eb83751622e2b97 → f7f0710962cab0e0}/chunk.js +1 -1
- package/dist/web-ui/content/modules/fe30627fc1e59d4f/chunk.js +1 -0
- package/dist/web-ui/content/modules/ffbd3bcaecd8e814/task-board-host.js +10 -0
- package/dist/web-ui/embedded-assets.d.ts +413 -413
- package/dist/web-ui/embedded-assets.js +4 -4
- package/dist/web-ui/group-chat-visibility.d.ts +8 -0
- package/dist/web-ui/group-chat-visibility.js +8 -0
- package/dist/web-ui/provider-identity.d.ts +3 -4
- package/dist/web-ui/provider-identity.js +3 -7
- package/package.json +1 -1
- package/dist/web-ui/content/modules/1f041aa8d3673d93/chunk.js +0 -1
- package/dist/web-ui/content/modules/2230c51655163cf3/runtime.js +0 -279
- package/dist/web-ui/content/modules/3d4451bc069c1498/chunk.js +0 -1
- package/dist/web-ui/content/modules/426b8133daebff78/host.js +0 -1
- package/dist/web-ui/content/modules/455436229dc57d7f/sidebar-peek.js +0 -1
- package/dist/web-ui/content/modules/46de3c2e2ca680c1/host.js +0 -1
- package/dist/web-ui/content/modules/497789a07177ed7b/chunk.js +0 -1
- package/dist/web-ui/content/modules/6687ad7aa57f443b/task-board-host.js +0 -22
- package/dist/web-ui/content/modules/87edd7cc79811bb8/composer-surface-adapter.js +0 -1
- package/dist/web-ui/content/modules/916021ce252882ca/chunk.js +0 -1
- package/dist/web-ui/content/modules/92df279c40bc4218/host.js +0 -1
- package/dist/web-ui/content/modules/99e48e07517d3f83/dropdown-surface.js +0 -1
- package/dist/web-ui/content/modules/a750f4868304b089/host.js +0 -1
- package/dist/web-ui/content/modules/abfe4b88dcd89d88/host.js +0 -1
- package/dist/web-ui/content/modules/b32c9addcd31f54b/panel-host.js +0 -1
- package/dist/web-ui/content/modules/bad2c42c7ddeab94/host.js +0 -1
- package/dist/web-ui/content/modules/bfa8e2c827201374/chunk.js +0 -1
- package/dist/web-ui/content/modules/c118e0c96bc023ee/host-bridge.js +0 -1
- package/dist/web-ui/content/modules/c3512b18c4c0e4ac/brand-identity.js +0 -1
- package/dist/web-ui/content/modules/cd5e90a37ccdf2dc/group-editor.js +0 -1
- package/dist/web-ui/content/modules/cdb8281bb89da303/chunk.js +0 -1
- package/dist/web-ui/content/modules/d90e77f9f8d4f1ec/workspaces-panel.js +0 -4
- package/dist/web-ui/content/modules/de977ff0b3ad3882/progress.js +0 -1
- package/dist/web-ui/content/modules/e25dea52e13504b6/markdown.js +0 -1
- package/dist/web-ui/content/modules/f2bdbdc4a1141826/host.js +0 -69
|
@@ -1 +1 @@
|
|
|
1
|
-
import"/assets/modules/907dcf0ea5b5f23f/chunk.js";import{shared72_a as c,shared72_b as y}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared52_a as m,shared52_c as a,shared52_d as N}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared81_a as T}from"/assets/modules/2230c51655163cf3/runtime.js";import{a as q}from"/assets/modules/91ee32135a3582b0/chunk.js";import{a as D}from"/assets/modules/3a2fa12c8b537964/chunk.js";import"/assets/modules/9eb83751622e2b97/chunk.js";import"/assets/modules/578703196f82222d/chunk.js";import"/assets/modules/02fad74223254019/chunk.js";import"/assets/modules/0c04f94bbfd39a2f/chunk.js";import"/assets/modules/d9019922118b2c37/chunk.js";import"/assets/modules/a41351130003e6bb/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared83_a as z}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared54_a as I}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/c03e0f84f798d33a/chunk.js";import"/assets/modules/be497f1d39753979/chunk.js";import"/assets/modules/a63f0b3d73d97e0b/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/ce90d0b55bbe6430/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared55_a as w}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared60_a as R}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/684db83476dcba20/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/e01769df89873feb/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared42_j as E}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared47_a as _}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared61_a as k}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared13_zb as j}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared11_a as te}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared5_c as A,shared5_d as C}from"/assets/modules/2230c51655163cf3/runtime.js";var l=A(te(),1);function J(e){return e.sessionId.trim()?e.sessionStatus==="running"?{allowed:!1,reason:"\u4F1A\u8BDD\u4ECD\u5728\u8FD0\u884C\uFF0C\u8BF7\u7ED3\u675F\u540E\u518D\u5408\u5E76\u6216\u6E05\u7406\u3002"}:e.mergeStatus==="merging"?{allowed:!1,reason:"Worktree \u6B63\u5728\u5408\u5E76\uFF0C\u8BF7\u7B49\u5F85\u5F53\u524D\u64CD\u4F5C\u5B8C\u6210\u3002"}:e.intent==="cleanup"?e.cleanupPending===!0?{allowed:!0,reason:""}:{allowed:!1,reason:"\u5F53\u524D worktree \u65E0\u9700\u8865\u507F\u6E05\u7406\u3002"}:!e.sourceBranch?.trim()||!e.worktreePath?.trim()?{allowed:!1,reason:"\u8BE5\u4F1A\u8BDD\u6CA1\u6709\u53EF\u5408\u5E76\u7684 worktree \u4FE1\u606F\u3002"}:e.mergeStatus==="merged"?e.cleanupPending?{allowed:!1,reason:"\u5206\u652F\u5DF2\u7ECF\u5408\u5E76\uFF0C\u8BF7\u6539\u4E3A\u91CD\u8BD5 worktree \u6E05\u7406\u3002"}:{allowed:!1,reason:"\u8BE5 worktree \u5DF2\u5B8C\u6210\u5408\u5E76\u548C\u6E05\u7406\u3002"}:{allowed:!0,reason:""}:{allowed:!1,reason:"\u672A\u627E\u5230\u5BF9\u5E94\u4F1A\u8BDD\u3002"}}function L(e){return!!e&&e.ok&&e.recommendedAction==="merge"&&e.aheadCount>0&&!e.hasUncommittedChanges&&!e.hasConflicts}function V(e){let r=e.targetBranch||"\u4E3B\u5206\u652F";return e.cleanupDone?`\u5DF2\u5408\u5E76\u5230 ${r} \u5E76\u5B8C\u6210 worktree \u6E05\u7406\u3002`:`\u5DF2\u5408\u5E76\u5230 ${r}\uFF0C\u4F46\u5DE5\u4F5C\u6811\u4ECD\u5F85\u6E05\u7406\u3002`}function G(e){return e.ok?`\u68C0\u67E5\u901A\u8FC7\uFF0C\u53EF\u5C06 ${e.aheadCount} \u4E2A\u63D0\u4EA4\u5408\u5E76\u5230 ${e.targetBranch||"\u76EE\u6807\u5206\u652F"}\u3002`:e.reason?e.reason:e.hasUncommittedChanges?"Worktree \u4E2D\u4ECD\u6709\u672A\u63D0\u4EA4\u6539\u52A8\uFF0C\u8BF7\u5148\u63D0\u4EA4\u540E\u518D\u5408\u5E76\u3002":e.hasConflicts?"\u68C0\u6D4B\u5230\u51B2\u7A81\u98CE\u9669\uFF0C\u8BF7\u5148\u624B\u52A8\u5904\u7406\u3002":e.aheadCount<=0?"\u5F53\u524D worktree \u6CA1\u6709\u53EF\u5408\u5E76\u7684\u65B0\u63D0\u4EA4\u3002":"\u5F53\u524D worktree \u6682\u4E0D\u53EF\u5408\u5E76\u3002"}function oe(e){return e==="noop"||e==="resolve-conflict"?e:"merge"}function ne(e){return Array.isArray(e)?e.flatMap(r=>!m(r)||typeof r.hash!="string"||!r.hash?[]:[{hash:r.hash,shortHash:a(r.shortHash,r.hash.slice(0,7)),subject:a(r.subject,a(r.message))}]):[]}function se(e){let r=m(e)?e:{};return{ok:r.ok===!0,sourceBranch:a(r.sourceBranch),targetBranch:a(r.targetBranch),worktreePath:a(r.worktreePath),repoRoot:a(r.repoRoot),hasUncommittedChanges:r.hasUncommittedChanges===!0,aheadCount:Math.max(0,N(r.aheadCount)),hasConflicts:r.hasConflicts===!0,recommendedAction:oe(r.recommendedAction),reason:a(r.reason),commits:ne(r.commits)}}function K(e){let r=m(e)?e:{};return{ok:r.ok===!0,sourceBranch:a(r.sourceBranch),targetBranch:a(r.targetBranch),repoRoot:a(r.repoRoot),mergeCommit:a(r.mergeCommit),mergedAt:a(r.mergedAt),cleanupDone:r.cleanupDone===!0,conflict:r.conflict===!0,errorCode:a(r.errorCode),reason:a(r.reason)}}var g=class extends Error{constructor(o,n="",i=null,v=0){super(o);C(this,"code",n);C(this,"result",i);C(this,"status",v);this.name="WorktreeMergeRepositoryError"}};async function $(e,r){let o;try{o=await e.json()}catch{throw new g(`${r} (HTTP ${e.status})`,"",null,e.status)}let n=m(o)?o:{};if(!e.ok||typeof n.error=="string")throw new g(a(n.error,`${r} (HTTP ${e.status})`),a(n.errorCode),m(n.result)?K(n.result):null,e.status);return n}var F=class{constructor(r=(o,n)=>globalThis.fetch(o,n)){C(this,"fetchImpl",r)}async inspect(r,o={}){let n=await this.fetchImpl(`/api/sessions/${encodeURIComponent(r)}/worktree/merge/check`,{method:"POST",credentials:"same-origin",signal:o.signal}),i=await $(n,"\u65E0\u6CD5\u68C0\u67E5 worktree \u5408\u5E76\u72B6\u6001\u3002");if(!m(i.result))throw new g("\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u5408\u5E76\u68C0\u67E5\u7ED3\u679C\u3002");return se(i.result)}async merge(r){let o=await this.fetchImpl(`/api/sessions/${encodeURIComponent(r)}/worktree/merge`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:"{}"}),n=await $(o,"\u65E0\u6CD5\u5408\u5E76 worktree\u3002");if(!m(n.result))throw new g("\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE worktree \u5408\u5E76\u7ED3\u679C\u3002");return K(n.result)}async cleanup(r){let o=await this.fetchImpl(`/api/sessions/${encodeURIComponent(r)}/worktree/cleanup`,{method:"POST",credentials:"same-origin"});return{ok:(await $(o,"\u65E0\u6CD5\u6E05\u7406 worktree\u3002")).ok===!0}}},Q=new F;var t=A(j(),1);function d({label:e,value:r,tone:o}){return(0,t.jsxs)(k,{justify:"space-between",align:"baseline",gap:12,wrap:!0,children:[(0,t.jsx)(R.Text,{type:"secondary",children:e}),(0,t.jsx)(R.Text,{type:o==="error"?"danger":o,strong:!0,style:{overflowWrap:"anywhere"},children:r||"-"})]})}function ae({inspection:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d,{label:"\u76EE\u6807\u5206\u652F",value:e.targetBranch}),(0,t.jsx)(d,{label:"\u5F85\u5408\u5E76\u63D0\u4EA4",value:String(e.aheadCount)}),(0,t.jsx)(d,{label:"\u672A\u63D0\u4EA4\u6539\u52A8",value:e.hasUncommittedChanges?"\u6709":"\u65E0",tone:e.hasUncommittedChanges?"warning":"success"}),(0,t.jsx)(d,{label:"\u51B2\u7A81\u98CE\u9669",value:e.hasConflicts?"\u6709":"\u65E0",tone:e.hasConflicts?"error":"success"}),e.commits.length>0?(0,t.jsx)(q,{size:"small","aria-labelledby":"worktree-merge-commits-title",title:(0,t.jsxs)("span",{id:"worktree-merge-commits-title",children:["\u5F85\u5408\u5E76\u63D0\u4EA4\u5217\u8868\uFF08",e.commits.length,"\uFF09"]}),children:(0,t.jsx)(D,{className:"wand-worktree-commit-list",size:"small","aria-label":"\u5F85\u5408\u5E76\u63D0\u4EA4",children:e.commits.map(r=>(0,t.jsx)(D.Item,{children:(0,t.jsxs)(k,{gap:12,align:"baseline",children:[(0,t.jsx)(R.Text,{code:!0,children:r.shortHash}),(0,t.jsx)(R.Text,{strong:!0,style:{overflowWrap:"anywhere"},children:r.subject||r.hash})]})},r.hash))})}):null,(0,t.jsx)(w,{type:e.ok?"success":e.hasConflicts?"error":"warning",title:G(e)})]})}function Re({repository:e=Q}){let r=(0,l.useSyncExternalStore)(y.subscribe,y.getSnapshot,y.getSnapshot),o=r.context,n=(0,l.useMemo)(()=>o?J(o):{allowed:!1,reason:""},[o]),[i,v]=(0,l.useState)(null),[p,x]=(0,l.useState)(null),[M,S]=(0,l.useState)(!1),[u,W]=(0,l.useState)(!1),[O,h]=(0,l.useState)(""),[U,B]=(0,l.useState)(""),H=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!r.open||!o)return;let s=new AbortController;return v(null),x(null),W(!1),h(""),B(""),!n.allowed||o.intent==="cleanup"?(S(!1),()=>s.abort()):(S(!0),e.inspect(o.sessionId,{signal:s.signal}).then(f=>{s.signal.aborted||(v(f),y.getRuntime()?.onRepositoryChanged(o.sessionId))}).catch(f=>{s.signal.aborted||h(T(f,"\u65E0\u6CD5\u68C0\u67E5 worktree \u5408\u5E76\u72B6\u6001\u3002"))}).finally(()=>{s.signal.aborted||S(!1)}),()=>s.abort())},[n.allowed,o?.intent,o?.sessionId,r.open,r.revision,e]),(0,l.useEffect)(()=>{if(!r.open||M)return;let s=window.requestAnimationFrame(()=>H.current?.focus());return()=>window.cancelAnimationFrame(s)},[r.open,M,i,p]);function P(s){y.getRuntime()?.onRepositoryChanged(s)}async function X(){if(!(!o||u||!L(i))){c.setDismissable(!1),W(!0),h("");try{let s=await e.merge(o.sessionId);x(s),P(o.sessionId),B(V(s)),s.cleanupDone&&(await new Promise(f=>{window.setTimeout(f,E)}),c.close())}catch(s){s instanceof g&&s.result&&(x(s.result),P(o.sessionId)),h(T(s,"\u65E0\u6CD5\u5408\u5E76 worktree\u3002"))}finally{c.setDismissable(!0),W(!1)}}}async function Y(){if(!(!o||u)){c.setDismissable(!1),W(!0),h("");try{if(!(await e.cleanup(o.sessionId)).ok)throw new Error("\u65E0\u6CD5\u6E05\u7406 worktree\u3002");P(o.sessionId),B("\u5DF2\u5B8C\u6210 worktree \u6E05\u7406\u3002"),await new Promise(f=>{window.setTimeout(f,E)}),c.close()}catch(s){h(T(s,"\u65E0\u6CD5\u6E05\u7406 worktree\u3002"))}finally{c.setDismissable(!0),W(!1)}}}let b=o?.intent==="cleanup"||p!=null&&p.cleanupDone===!1&&!!p.mergeCommit,Z=n.allowed&&L(i),ee=b?"\u6E05\u7406 Worktree":"\u5408\u5E76 Worktree",re=b?"\u5B8C\u6210\u5DF2\u5408\u5E76\u5206\u652F\u9057\u7559\u7684 worktree \u6E05\u7406\u3002":"\u68C0\u67E5\u5F53\u524D\u4EFB\u52A1\u5206\u652F\u5E76\u5B89\u5168\u5408\u5E76\u5230\u76EE\u6807\u5206\u652F\u3002";return(0,t.jsx)(z,{open:r.open,onOpenChange:s=>{s||c.close()},title:ee,description:re,className:"wand-ui-dialog-content wand-task-library-dialog wand-worktree-library-dialog",closeLabel:"\u5173\u95ED Worktree \u5408\u5E76",testId:"worktree-merge-dialog",dismissable:!u,children:(0,t.jsxs)(k,{vertical:!0,gap:16,children:[(0,t.jsxs)(k,{vertical:!0,gap:12,"aria-busy":M||u,children:[o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d,{label:"\u6765\u6E90\u5206\u652F",value:i?.sourceBranch||o.sourceBranch||"-"}),(0,t.jsx)(d,{label:"\u5DE5\u4F5C\u76EE\u5F55",value:i?.worktreePath||o.worktreePath||"-"})]}):null,n.allowed?M?(0,t.jsx)(_,{tip:"\u6B63\u5728\u68C0\u67E5 worktree \u5408\u5E76\u72B6\u6001\u2026",children:(0,t.jsx)("div",{style:{minHeight:70},role:"status",children:"\u6B63\u5728\u68C0\u67E5 worktree \u5408\u5E76\u72B6\u6001\u2026"})}):i&&!b?(0,t.jsx)(ae,{inspection:i}):b?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d,{label:"\u76EE\u6807\u5206\u652F",value:p?.targetBranch||o?.targetBranch||"\u4E3B\u5206\u652F"}),p?.mergeCommit?(0,t.jsx)(d,{label:"\u5408\u5E76\u63D0\u4EA4",value:p.mergeCommit.slice(0,12)}):null,(0,t.jsx)(w,{type:"warning",showIcon:!0,title:"\u5408\u5E76\u7ED3\u679C\u5DF2\u7ECF\u4FDD\u7559\uFF1B\u6B64\u64CD\u4F5C\u53EA\u91CD\u8BD5\u5220\u9664\u9057\u7559 worktree \u548C\u4EFB\u52A1\u5206\u652F\u3002"})]}):null:(0,t.jsx)(w,{type:"warning",showIcon:!0,role:"status",title:n.reason}),U?(0,t.jsx)(w,{type:"success",showIcon:!0,role:"status",title:U}):null,O?(0,t.jsx)(w,{type:"error",showIcon:!0,role:"alert",title:O}):null]}),(0,t.jsxs)(k,{justify:"flex-end",gap:8,children:[(0,t.jsx)(I,{ref:H,kind:"secondary",disabled:u,onClick:()=>c.close(),children:n.allowed?"\u53D6\u6D88":"\u5173\u95ED"}),b&&n.allowed?(0,t.jsx)(I,{kind:"primary",disabled:u,onClick:()=>{Y()},children:u?"\u6E05\u7406\u4E2D\u2026":"\u91CD\u8BD5\u6E05\u7406"}):o?.intent==="merge"&&n.allowed?(0,t.jsx)(I,{kind:"primary",disabled:!Z||u||M,onClick:()=>{X()},children:u?"\u5408\u5E76\u4E2D\u2026":"\u786E\u8BA4\u5408\u5E76\u5E76\u6E05\u7406"}):null]})]})})}export{Re as WorktreeMergeHost};
|
|
1
|
+
import"/assets/modules/2061d4a88875b9f9/chunk.js";import{shared72_a as c,shared72_b as y}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared52_a as m,shared52_c as a,shared52_d as N}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared81_a as T}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{a as q}from"/assets/modules/0567e161e2cca41e/chunk.js";import{a as D}from"/assets/modules/b2f6e088e6e45878/chunk.js";import"/assets/modules/f7f0710962cab0e0/chunk.js";import"/assets/modules/d859a83f486aab23/chunk.js";import"/assets/modules/a073cb6d182ccd32/chunk.js";import"/assets/modules/54c22eddaf009d00/chunk.js";import"/assets/modules/b79c15aace456028/chunk.js";import"/assets/modules/54aaf60ac85dcb2b/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared83_a as z}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared54_a as I}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import"/assets/modules/704690f5d6ab9157/chunk.js";import"/assets/modules/7dce56c1987e8d43/chunk.js";import"/assets/modules/b945370f1fa784f9/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import"/assets/modules/aff19b31898aa157/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared55_a as w}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared60_a as R}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import"/assets/modules/ba5fa76884e1f806/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import"/assets/modules/33daaeb4bf68c7ba/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared42_j as E}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared47_a as _}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared61_a as k}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared13_zb as j}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared11_a as te}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared5_c as A,shared5_d as C}from"/assets/modules/069f5a4267b0a9e3/runtime.js";var l=A(te(),1);function J(e){return e.sessionId.trim()?e.sessionStatus==="running"?{allowed:!1,reason:"\u4F1A\u8BDD\u4ECD\u5728\u8FD0\u884C\uFF0C\u8BF7\u7ED3\u675F\u540E\u518D\u5408\u5E76\u6216\u6E05\u7406\u3002"}:e.mergeStatus==="merging"?{allowed:!1,reason:"Worktree \u6B63\u5728\u5408\u5E76\uFF0C\u8BF7\u7B49\u5F85\u5F53\u524D\u64CD\u4F5C\u5B8C\u6210\u3002"}:e.intent==="cleanup"?e.cleanupPending===!0?{allowed:!0,reason:""}:{allowed:!1,reason:"\u5F53\u524D worktree \u65E0\u9700\u8865\u507F\u6E05\u7406\u3002"}:!e.sourceBranch?.trim()||!e.worktreePath?.trim()?{allowed:!1,reason:"\u8BE5\u4F1A\u8BDD\u6CA1\u6709\u53EF\u5408\u5E76\u7684 worktree \u4FE1\u606F\u3002"}:e.mergeStatus==="merged"?e.cleanupPending?{allowed:!1,reason:"\u5206\u652F\u5DF2\u7ECF\u5408\u5E76\uFF0C\u8BF7\u6539\u4E3A\u91CD\u8BD5 worktree \u6E05\u7406\u3002"}:{allowed:!1,reason:"\u8BE5 worktree \u5DF2\u5B8C\u6210\u5408\u5E76\u548C\u6E05\u7406\u3002"}:{allowed:!0,reason:""}:{allowed:!1,reason:"\u672A\u627E\u5230\u5BF9\u5E94\u4F1A\u8BDD\u3002"}}function L(e){return!!e&&e.ok&&e.recommendedAction==="merge"&&e.aheadCount>0&&!e.hasUncommittedChanges&&!e.hasConflicts}function V(e){let r=e.targetBranch||"\u4E3B\u5206\u652F";return e.cleanupDone?`\u5DF2\u5408\u5E76\u5230 ${r} \u5E76\u5B8C\u6210 worktree \u6E05\u7406\u3002`:`\u5DF2\u5408\u5E76\u5230 ${r}\uFF0C\u4F46\u5DE5\u4F5C\u6811\u4ECD\u5F85\u6E05\u7406\u3002`}function G(e){return e.ok?`\u68C0\u67E5\u901A\u8FC7\uFF0C\u53EF\u5C06 ${e.aheadCount} \u4E2A\u63D0\u4EA4\u5408\u5E76\u5230 ${e.targetBranch||"\u76EE\u6807\u5206\u652F"}\u3002`:e.reason?e.reason:e.hasUncommittedChanges?"Worktree \u4E2D\u4ECD\u6709\u672A\u63D0\u4EA4\u6539\u52A8\uFF0C\u8BF7\u5148\u63D0\u4EA4\u540E\u518D\u5408\u5E76\u3002":e.hasConflicts?"\u68C0\u6D4B\u5230\u51B2\u7A81\u98CE\u9669\uFF0C\u8BF7\u5148\u624B\u52A8\u5904\u7406\u3002":e.aheadCount<=0?"\u5F53\u524D worktree \u6CA1\u6709\u53EF\u5408\u5E76\u7684\u65B0\u63D0\u4EA4\u3002":"\u5F53\u524D worktree \u6682\u4E0D\u53EF\u5408\u5E76\u3002"}function oe(e){return e==="noop"||e==="resolve-conflict"?e:"merge"}function ne(e){return Array.isArray(e)?e.flatMap(r=>!m(r)||typeof r.hash!="string"||!r.hash?[]:[{hash:r.hash,shortHash:a(r.shortHash,r.hash.slice(0,7)),subject:a(r.subject,a(r.message))}]):[]}function se(e){let r=m(e)?e:{};return{ok:r.ok===!0,sourceBranch:a(r.sourceBranch),targetBranch:a(r.targetBranch),worktreePath:a(r.worktreePath),repoRoot:a(r.repoRoot),hasUncommittedChanges:r.hasUncommittedChanges===!0,aheadCount:Math.max(0,N(r.aheadCount)),hasConflicts:r.hasConflicts===!0,recommendedAction:oe(r.recommendedAction),reason:a(r.reason),commits:ne(r.commits)}}function K(e){let r=m(e)?e:{};return{ok:r.ok===!0,sourceBranch:a(r.sourceBranch),targetBranch:a(r.targetBranch),repoRoot:a(r.repoRoot),mergeCommit:a(r.mergeCommit),mergedAt:a(r.mergedAt),cleanupDone:r.cleanupDone===!0,conflict:r.conflict===!0,errorCode:a(r.errorCode),reason:a(r.reason)}}var g=class extends Error{constructor(o,n="",i=null,v=0){super(o);C(this,"code",n);C(this,"result",i);C(this,"status",v);this.name="WorktreeMergeRepositoryError"}};async function $(e,r){let o;try{o=await e.json()}catch{throw new g(`${r} (HTTP ${e.status})`,"",null,e.status)}let n=m(o)?o:{};if(!e.ok||typeof n.error=="string")throw new g(a(n.error,`${r} (HTTP ${e.status})`),a(n.errorCode),m(n.result)?K(n.result):null,e.status);return n}var F=class{constructor(r=(o,n)=>globalThis.fetch(o,n)){C(this,"fetchImpl",r)}async inspect(r,o={}){let n=await this.fetchImpl(`/api/sessions/${encodeURIComponent(r)}/worktree/merge/check`,{method:"POST",credentials:"same-origin",signal:o.signal}),i=await $(n,"\u65E0\u6CD5\u68C0\u67E5 worktree \u5408\u5E76\u72B6\u6001\u3002");if(!m(i.result))throw new g("\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u5408\u5E76\u68C0\u67E5\u7ED3\u679C\u3002");return se(i.result)}async merge(r){let o=await this.fetchImpl(`/api/sessions/${encodeURIComponent(r)}/worktree/merge`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:"{}"}),n=await $(o,"\u65E0\u6CD5\u5408\u5E76 worktree\u3002");if(!m(n.result))throw new g("\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE worktree \u5408\u5E76\u7ED3\u679C\u3002");return K(n.result)}async cleanup(r){let o=await this.fetchImpl(`/api/sessions/${encodeURIComponent(r)}/worktree/cleanup`,{method:"POST",credentials:"same-origin"});return{ok:(await $(o,"\u65E0\u6CD5\u6E05\u7406 worktree\u3002")).ok===!0}}},Q=new F;var t=A(j(),1);function d({label:e,value:r,tone:o}){return(0,t.jsxs)(k,{justify:"space-between",align:"baseline",gap:12,wrap:!0,children:[(0,t.jsx)(R.Text,{type:"secondary",children:e}),(0,t.jsx)(R.Text,{type:o==="error"?"danger":o,strong:!0,style:{overflowWrap:"anywhere"},children:r||"-"})]})}function ae({inspection:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d,{label:"\u76EE\u6807\u5206\u652F",value:e.targetBranch}),(0,t.jsx)(d,{label:"\u5F85\u5408\u5E76\u63D0\u4EA4",value:String(e.aheadCount)}),(0,t.jsx)(d,{label:"\u672A\u63D0\u4EA4\u6539\u52A8",value:e.hasUncommittedChanges?"\u6709":"\u65E0",tone:e.hasUncommittedChanges?"warning":"success"}),(0,t.jsx)(d,{label:"\u51B2\u7A81\u98CE\u9669",value:e.hasConflicts?"\u6709":"\u65E0",tone:e.hasConflicts?"error":"success"}),e.commits.length>0?(0,t.jsx)(q,{size:"small","aria-labelledby":"worktree-merge-commits-title",title:(0,t.jsxs)("span",{id:"worktree-merge-commits-title",children:["\u5F85\u5408\u5E76\u63D0\u4EA4\u5217\u8868\uFF08",e.commits.length,"\uFF09"]}),children:(0,t.jsx)(D,{className:"wand-worktree-commit-list",size:"small","aria-label":"\u5F85\u5408\u5E76\u63D0\u4EA4",children:e.commits.map(r=>(0,t.jsx)(D.Item,{children:(0,t.jsxs)(k,{gap:12,align:"baseline",children:[(0,t.jsx)(R.Text,{code:!0,children:r.shortHash}),(0,t.jsx)(R.Text,{strong:!0,style:{overflowWrap:"anywhere"},children:r.subject||r.hash})]})},r.hash))})}):null,(0,t.jsx)(w,{type:e.ok?"success":e.hasConflicts?"error":"warning",title:G(e)})]})}function Re({repository:e=Q}){let r=(0,l.useSyncExternalStore)(y.subscribe,y.getSnapshot,y.getSnapshot),o=r.context,n=(0,l.useMemo)(()=>o?J(o):{allowed:!1,reason:""},[o]),[i,v]=(0,l.useState)(null),[p,x]=(0,l.useState)(null),[M,S]=(0,l.useState)(!1),[u,W]=(0,l.useState)(!1),[O,h]=(0,l.useState)(""),[U,B]=(0,l.useState)(""),H=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!r.open||!o)return;let s=new AbortController;return v(null),x(null),W(!1),h(""),B(""),!n.allowed||o.intent==="cleanup"?(S(!1),()=>s.abort()):(S(!0),e.inspect(o.sessionId,{signal:s.signal}).then(f=>{s.signal.aborted||(v(f),y.getRuntime()?.onRepositoryChanged(o.sessionId))}).catch(f=>{s.signal.aborted||h(T(f,"\u65E0\u6CD5\u68C0\u67E5 worktree \u5408\u5E76\u72B6\u6001\u3002"))}).finally(()=>{s.signal.aborted||S(!1)}),()=>s.abort())},[n.allowed,o?.intent,o?.sessionId,r.open,r.revision,e]),(0,l.useEffect)(()=>{if(!r.open||M)return;let s=window.requestAnimationFrame(()=>H.current?.focus());return()=>window.cancelAnimationFrame(s)},[r.open,M,i,p]);function P(s){y.getRuntime()?.onRepositoryChanged(s)}async function X(){if(!(!o||u||!L(i))){c.setDismissable(!1),W(!0),h("");try{let s=await e.merge(o.sessionId);x(s),P(o.sessionId),B(V(s)),s.cleanupDone&&(await new Promise(f=>{window.setTimeout(f,E)}),c.close())}catch(s){s instanceof g&&s.result&&(x(s.result),P(o.sessionId)),h(T(s,"\u65E0\u6CD5\u5408\u5E76 worktree\u3002"))}finally{c.setDismissable(!0),W(!1)}}}async function Y(){if(!(!o||u)){c.setDismissable(!1),W(!0),h("");try{if(!(await e.cleanup(o.sessionId)).ok)throw new Error("\u65E0\u6CD5\u6E05\u7406 worktree\u3002");P(o.sessionId),B("\u5DF2\u5B8C\u6210 worktree \u6E05\u7406\u3002"),await new Promise(f=>{window.setTimeout(f,E)}),c.close()}catch(s){h(T(s,"\u65E0\u6CD5\u6E05\u7406 worktree\u3002"))}finally{c.setDismissable(!0),W(!1)}}}let b=o?.intent==="cleanup"||p!=null&&p.cleanupDone===!1&&!!p.mergeCommit,Z=n.allowed&&L(i),ee=b?"\u6E05\u7406 Worktree":"\u5408\u5E76 Worktree",re=b?"\u5B8C\u6210\u5DF2\u5408\u5E76\u5206\u652F\u9057\u7559\u7684 worktree \u6E05\u7406\u3002":"\u68C0\u67E5\u5F53\u524D\u4EFB\u52A1\u5206\u652F\u5E76\u5B89\u5168\u5408\u5E76\u5230\u76EE\u6807\u5206\u652F\u3002";return(0,t.jsx)(z,{open:r.open,onOpenChange:s=>{s||c.close()},title:ee,description:re,className:"wand-ui-dialog-content wand-task-library-dialog wand-worktree-library-dialog",closeLabel:"\u5173\u95ED Worktree \u5408\u5E76",testId:"worktree-merge-dialog",dismissable:!u,children:(0,t.jsxs)(k,{vertical:!0,gap:16,children:[(0,t.jsxs)(k,{vertical:!0,gap:12,"aria-busy":M||u,children:[o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d,{label:"\u6765\u6E90\u5206\u652F",value:i?.sourceBranch||o.sourceBranch||"-"}),(0,t.jsx)(d,{label:"\u5DE5\u4F5C\u76EE\u5F55",value:i?.worktreePath||o.worktreePath||"-"})]}):null,n.allowed?M?(0,t.jsx)(_,{tip:"\u6B63\u5728\u68C0\u67E5 worktree \u5408\u5E76\u72B6\u6001\u2026",children:(0,t.jsx)("div",{style:{minHeight:70},role:"status",children:"\u6B63\u5728\u68C0\u67E5 worktree \u5408\u5E76\u72B6\u6001\u2026"})}):i&&!b?(0,t.jsx)(ae,{inspection:i}):b?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d,{label:"\u76EE\u6807\u5206\u652F",value:p?.targetBranch||o?.targetBranch||"\u4E3B\u5206\u652F"}),p?.mergeCommit?(0,t.jsx)(d,{label:"\u5408\u5E76\u63D0\u4EA4",value:p.mergeCommit.slice(0,12)}):null,(0,t.jsx)(w,{type:"warning",showIcon:!0,title:"\u5408\u5E76\u7ED3\u679C\u5DF2\u7ECF\u4FDD\u7559\uFF1B\u6B64\u64CD\u4F5C\u53EA\u91CD\u8BD5\u5220\u9664\u9057\u7559 worktree \u548C\u4EFB\u52A1\u5206\u652F\u3002"})]}):null:(0,t.jsx)(w,{type:"warning",showIcon:!0,role:"status",title:n.reason}),U?(0,t.jsx)(w,{type:"success",showIcon:!0,role:"status",title:U}):null,O?(0,t.jsx)(w,{type:"error",showIcon:!0,role:"alert",title:O}):null]}),(0,t.jsxs)(k,{justify:"flex-end",gap:8,children:[(0,t.jsx)(I,{ref:H,kind:"secondary",disabled:u,onClick:()=>c.close(),children:n.allowed?"\u53D6\u6D88":"\u5173\u95ED"}),b&&n.allowed?(0,t.jsx)(I,{kind:"primary",disabled:u,onClick:()=>{Y()},children:u?"\u6E05\u7406\u4E2D\u2026":"\u91CD\u8BD5\u6E05\u7406"}):o?.intent==="merge"&&n.allowed?(0,t.jsx)(I,{kind:"primary",disabled:!Z||u||M,onClick:()=>{X()},children:u?"\u5408\u5E76\u4E2D\u2026":"\u786E\u8BA4\u5408\u5E76\u5E76\u6E05\u7406"}):null]})]})})}export{Re as WorktreeMergeHost};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
2
|
const __wandCssTextPool = Object.freeze([".conversation-root{--conversation-inset:clamp(16px,3vw,48px);background:var(--bg-primary)}.conversation-root .conversation-heading{padding:20px var(--conversation-inset) 16px;border:0}.conversation-root .conversation-heading-copy{min-width:0}.conversation-root .conversation-heading-avatar-slot{width:48px;height:48px;flex:none;display:grid;place-items:center}.conversation-root .conversation-heading-title{height:auto;min-height:28px;font-size:20px;line-height:1.5;font-weight:600;max-width:100%}.conversation-root .conversation-heading-title-text{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation-root .conversation-heading-title,.conversation-root .conversation-submit-labelled.ant-btn,.conversation-root .conversation-config-trigger.ant-btn{transition-property:color,background-color,border-color,box-shadow,opacity}.conversation-root .conversation-heading-context{margin-block-start:2px;font-size:13px}.conversation-root .conversation-heading-context{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation-root .conversation-message-scroll{--conversation-scroll-pad-top:20px;position:relative;padding-block:var(--conversation-scroll-pad-top) 28px}.conversation-root .conversation-message-scroll>*{padding-inline:var(--conversation-inset)}.conversation-root .conversation-message-scroll>.sidebar-projection-swap{display:flex;flex:1 0 auto;flex-direction:column;min-height:100%}.conversation-root .conversation-message-scroll>.sidebar-projection-swap>.sidebar-projection-current{display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.conversation-root .conversation-message-scroll>.conversation-empty{overflow-anchor:none;margin-block:0}.conversation-root .conversation-message-scroll>.conversation-empty:first-child{position:absolute;inset-block-start:var(--conversation-scroll-pad-top);inset-inline:0}.conversation-root .team-chat-stream{gap:20px}.conversation-history-more{display:flex;justify-content:center;padding-block:2px}.conversation-history-more .ant-btn{color:var(--text-secondary);font-size:var(--font-size-xs)}.conversation-root .conversation-session-reply{margin-block:4px 12px}.conversation-root .conversation-reply-context{font-size:12px}.conversation-root .conversation-reply-body{font-size:15px;line-height:1.8}.conversation-root .conversation-reply-body :is(p,ul,ol){margin-block:0 16px}.conversation-root .conversation-reply-body :is(h1,h2,h3){margin-block:24px 12px;line-height:1.4}.conversation-root .conversation-reply-body :is(pre,table){max-width:100%}.conversation-root .conversation-reply-footer{padding-block:4px;font-size:12px}.conversation-root .conversation-reply-footer .ant-btn{color:var(--accent);font-weight:600}.conversation-continue-arrow{transform:rotate(90deg)}.conversation-root .conversation-composer{padding:8px var(--conversation-inset) max(12px,var(--wand-safe-bottom,0px));background:transparent}.conversation-root .conversation-input-wrap{margin-block-start:42px}.conversation-root .conversation-runtime-summary-slot{height:24px;margin-block-start:-56px;display:flex;align-items:center;justify-content:flex-end}.conversation-root .conversation-sender.ant-sender{border:0;border-radius:16px;background:var(--bg-surface);padding:16px 16px 10px;box-shadow:0 4px 20px color-mix(in srgb,var(--text-primary) 8%,transparent)}.conversation-root .conversation-sender.ant-sender:focus-within{box-shadow:0 4px 20px color-mix(in srgb,var(--text-primary) 8%,transparent),0 0 0 2px var(--border-focus)}.conversation-root .conversation-sender.ant-sender:has(textarea:focus):before{content:none}.conversation-root .conversation-companion.ant-btn{position:absolute;inset-inline-start:-12px;inset-block-start:-62px;width:80px;height:62px;padding:0;border:0;background:transparent;z-index:1}.conversation-root .conversation-companion .composer-floating-avatar{inset:0;width:80px;height:80px;pointer-events:none}.conversation-root .conversation-input-wrap>.composer-usage-line{inset-inline:76px 0;inset-block-start:-30px;overflow:visible}.conversation-root .conversation-input-hint{display:block;padding:6px 8px 0;font-size:11px}.conversation-root .conversation-action-row{gap:8px}.conversation-root .conversation-action-row>.ant-flex{min-width:0;flex-wrap:wrap}.conversation-root .conversation-submit-labelled.ant-btn{width:auto;min-width:32px;padding-inline:12px;gap:6px}.conversation-submit-labels{display:inline-grid}.conversation-submit-label{grid-area:1 / 1;font-size:12px}.conversation-submit-label:not([data-active]){visibility:hidden}.conversation-config-trigger.ant-btn{height:32px;min-height:32px;padding-inline:6px;font-size:12px}.conversation-preference-details{width:min(340px,calc(100vw - 48px));max-height:45dvh;overflow:auto}.conversation-preference-details .conversation-continue-work{width:100%;max-width:100%;display:flex;justify-content:flex-start;gap:0;overflow:hidden}.conversation-preference-details .ant-typography{white-space:normal;overflow-wrap:anywhere}.conversation-group-mosaic{display:grid;align-content:center;gap:1px;padding:2px;border-radius:12px;background:var(--bg-tertiary);box-sizing:border-box;overflow:hidden}.conversation-group-cell{position:relative;aspect-ratio:1;min-width:0;min-height:0;display:grid;place-items:center;overflow:hidden;border-radius:4px}.conversation-group-cell>span{position:absolute;display:block;transform-origin:center}@media(max-width:640px){.conversation-root .conversation-heading{padding-block:10px}.conversation-root .conversation-heading-title{font-size:17px}.conversation-root .conversation-message-scroll{--conversation-scroll-pad-top:12px;padding-block:var(--conversation-scroll-pad-top) 20px}.conversation-root .conversation-sender.ant-sender{padding:12px 10px 8px;border-radius:12px}.conversation-root .conversation-submit-label{display:none}.conversation-root .conversation-submit-labelled.ant-btn{padding-inline:0;width:var(--composer-control-height)}.conversation-root .conversation-input-hint{display:none}}\n"]);
|
|
3
|
-
import{c as u}from"/assets/modules/
|
|
3
|
+
import{c as u}from"/assets/modules/8b2f9a027ae1d7eb/chunk.js";import{F as p,b as l}from"/assets/modules/d7cdd7dca9a0c9f8/chunk.js";import{shared114_o as f}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared20_l as m,shared20_m as g,shared20_n as x}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared135_a as r}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared48_b as b}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared13_zb as h}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared5_c as v}from"/assets/modules/069f5a4267b0a9e3/runtime.js";var t=v(h(),1);function j(o,e){return o&&e?{...o,...e,kind:"structured",mode:l(e.provider,o.mode)}:o}function P({agent:o,catalog:e,disabled:a,cliOnly:y=!1,onChange:w}){let d=u(o,e),s=[...f(e,o.provider)];s.some(n=>n.value===o.model)||s.push({value:o.model,label:o.model});let k=p(o.provider,e,o.model,o.thinkingEffort).map(n=>n.value==="off"?{...n,label:"\u81EA\u52A8\uFF08\u6A21\u578B\u9ED8\u8BA4\uFF09"}:n),c=n=>w({provider:n.provider,engine:n.engine,model:n.model,thinkingEffort:n.thinkingEffort});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r,{ariaLabel:"\u672C\u9875\u6267\u884C\u5DE5\u5177",value:x(o.provider,o.engine),options:m.filter(n=>!y||n.engine!=="sdk").map(n=>({value:n.id,label:n.label})),className:"conversation-runtime-select conversation-tool-select",triggerKind:"ghost",side:"top",disabled:a,onValueChange:n=>{let i=g(n);i&&c({...o,provider:i.provider,engine:i.engine,model:"default",thinkingEffort:"off",mode:l(i.provider,o.mode)})}}),(0,t.jsx)(r,{ariaLabel:"\u672C\u9875\u6A21\u578B",value:o.model,options:s,displayValue:d.model,className:"conversation-runtime-select conversation-model-select",triggerKind:"ghost",side:"top",disabled:a,searchable:!0,searchPlaceholder:"\u641C\u7D22\u672C\u9875\u6A21\u578B",onValueChange:n=>{let i=p(o.provider,e,n).some(E=>E.value===o.thinkingEffort);c({...o,model:n,thinkingEffort:i?o.thinkingEffort:"off"})}}),(0,t.jsx)(r,{ariaLabel:"\u672C\u9875\u601D\u8003\u6DF1\u5EA6",value:o.thinkingEffort,options:k,displayValue:`\u601D\u8003\uFF1A${d.thinking}`,className:"conversation-runtime-select conversation-thinking-select",triggerKind:"ghost",side:"top",disabled:a,onValueChange:n=>c({...o,thinkingEffort:n})})]})}function V(){b("wand-conversation-home",__wandCssTextPool[0])}export{j as a,P as b,V as c};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
2
|
const __wandCssTextPool = Object.freeze([".wand-settings-library-grid,.wand-settings-library-default-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr));gap:16px}.wand-settings-library-field{margin-bottom:0;min-width:0}.wand-settings-library-number,.wand-settings-library-select,.wand-settings-library-select>button{width:100%}.wand-settings-library-save-bar{display:flex;flex-direction:column;align-items:flex-start;gap:12px}.wand-settings-library-action-label{display:grid}.wand-settings-library-action-label>span{grid-area:1/1}.wand-settings-library-action-measure{visibility:hidden}\n"]);
|
|
3
|
-
import{a as A}from"/assets/modules/
|
|
3
|
+
import{a as A}from"/assets/modules/4cc15b385bc6cc32/chunk.js";import{a as y}from"/assets/modules/aa7d409d04bbd736/chunk.js";import{h as F}from"/assets/modules/b79c15aace456028/chunk.js";import{shared135_a as T}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared25_a as k}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared54_a as N}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared55_a as C}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared42_h as v,shared42_i as S}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared48_b as L}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared13_zb as R}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared11_a as B}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared5_c as h}from"/assets/modules/069f5a4267b0a9e3/runtime.js";var l=h(B(),1);var e=h(R(),1);typeof document<"u"&&L("wand-settings-field-styles",__wandCssTextPool[0]);function q({title:t,description:n,action:i,children:a}){return(0,e.jsxs)("section",{className:"wand-settings-library-section","aria-label":t,children:[(0,e.jsxs)("div",{className:"wand-settings-library-section-heading",children:[(0,e.jsx)("h3",{children:t}),i]}),n?(0,e.jsx)("p",{children:n}):null,(0,e.jsx)(y,{component:!1,layout:"vertical",children:(0,e.jsx)("div",{className:"wand-settings-library-section-body",children:a})})]})}function z({children:t}){return(0,e.jsx)("div",{className:"wand-settings-library-grid",children:t})}function J({label:t,hint:n,error:i,htmlFor:a,children:s}){return(0,e.jsx)(y.Item,{label:t,htmlFor:a,layout:"vertical",validateStatus:i?"error":void 0,help:i||n,className:"wand-settings-library-field",children:s})}function K({id:t,value:n,onChange:i,type:a="text",placeholder:s,disabled:r,invalid:o,autoComplete:g,min:m,max:b,list:p}){let[c,u]=(0,l.useState)(!1);return a==="number"?(0,e.jsx)(A,{id:t,value:n===""?null:String(n),stringMode:!0,className:"wand-settings-library-number",min:m===void 0?void 0:String(m),max:b===void 0?void 0:String(b),disabled:r,placeholder:s,status:o?"error":void 0,"aria-invalid":o||void 0,autoComplete:g,onChange:d=>i(d===null?"":String(d))}):(0,e.jsx)(k,{id:t,type:a==="password"&&c?"text":a,value:n,placeholder:s,disabled:r,status:o?"error":void 0,"aria-invalid":o||void 0,autoComplete:g,list:p,spellCheck:!1,suffix:a==="password"?(0,e.jsx)(N,{type:"button",kind:"ghost",className:"wand-settings-library-secret-toggle",disabled:r,"aria-controls":t,"aria-pressed":c,"aria-label":c?"\u9690\u85CF\u654F\u611F\u5185\u5BB9":"\u663E\u793A\u654F\u611F\u5185\u5BB9",onClick:()=>u(d=>!d),children:c?"\u9690\u85CF":"\u663E\u793A"}):void 0,onChange:d=>i(d.currentTarget.value)})}function Q({id:t,ariaLabel:n,value:i,options:a,onChange:s,disabled:r,searchable:o,searchPlaceholder:g}){return(0,e.jsx)("div",{id:t,className:"wand-settings-library-select",children:(0,e.jsx)(T,{ariaLabel:n,value:i,options:a,disabled:r,searchable:o,searchPlaceholder:g,onValueChange:s})})}function U({label:t,description:n,checked:i,onCheckedChange:a,disabled:s}){return(0,e.jsxs)("div",{className:"wand-settings-library-toggle-row",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("strong",{children:t}),n?(0,e.jsx)("span",{children:n}):null]}),(0,e.jsx)(F,{ariaLabel:t,checked:i,disabled:s,onCheckedChange:a})]})}function I({children:t,tone:n="info"}){return t?(0,e.jsx)(C,{type:n,title:t,role:"status","aria-live":"polite",showIcon:!0}):null}function E(t,n){let[i,a]=(0,l.useState)(null),s=(0,l.useRef)(!1),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>()=>{r.current!==null&&window.clearTimeout(r.current)},[]),(0,l.useEffect)(()=>{if(t){s.current=!0,a(null),r.current!==null&&(window.clearTimeout(r.current),r.current=null);return}!s.current||n!=="success"&&n!=="error"||(s.current=!1,a(n),r.current!==null&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>{r.current=null,a(null)},n==="error"?S:v))},[t,n]),i}function X({label:t,pending:n=!1,disabled:i,onSave:a,status:s,tone:r}){return(0,e.jsxs)("div",{className:"wand-settings-library-save-bar",children:[(0,e.jsx)(M,{kind:"primary",pending:n,settled:r==="error"?"error":r==="success"||r==="warning"?"success":null,disabled:i,pendingLabel:"\u4FDD\u5B58\u4E2D\u2026",successLabel:"\u5DF2\u4FDD\u5B58",errorLabel:"\u4FDD\u5B58\u5931\u8D25",onClick:a,children:t}),(0,e.jsx)(I,{tone:r,children:s})]})}function M({children:t,pending:n=!1,settled:i=null,pendingLabel:a="\u5904\u7406\u4E2D\u2026",successLabel:s="\u5DF2\u5B8C\u6210",errorLabel:r="\u5931\u8D25",onClick:o,disabled:g,...m}){let b=E(n,i),[p,c]=(0,l.useState)(null),u=(0,l.useRef)(null);(0,l.useEffect)(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]);let d=p??b,w=f=>{u.current!==null&&window.clearTimeout(u.current),c(f),u.current=window.setTimeout(()=>{u.current=null,c(null)},f==="error"?S:v)};return(0,e.jsx)(N,{...m,className:["wand-settings-library-action",m.className].filter(Boolean).join(" "),"aria-busy":n||void 0,"aria-live":"polite",disabled:g||n||d==="success",onClick:o?async f=>{try{let x=await o(f);x===!1?w("error"):x===!0&&w("success")}catch{w("error")}}:void 0,children:(0,e.jsxs)("span",{className:"wand-settings-library-action-label",children:[(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:t}),(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:a}),(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:s}),(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:r}),(0,e.jsx)("span",{children:n?a:d==="success"?s:d==="error"?r:t})]})})}export{q as a,z as b,J as c,K as d,Q as e,U as f,I as g,X as h,M as i};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
|
|
2
|
+
const __wandCssTextPool = Object.freeze([".wand-new-session-library-dialog .ant-modal-body{scroll-padding-bottom:64px}.wand-new-session-summary{padding-bottom:16px;border-bottom:1px solid var(--border-subtle)}.wand-new-session-summary dl{display:grid;gap:4px;margin:0;font-size:12px}.wand-new-session-summary dl>div{display:grid;grid-template-columns:60px minmax(0,1fr);gap:8px}.wand-new-session-summary dt{color:var(--text-secondary)}.wand-new-session-summary dd{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.wand-new-session-summary .wand-new-session-permission-warning{color:var(--danger)}.wand-new-session-summary .wand-new-session-permission-detail{margin:4px 0 0;font-size:12px;line-height:1.5}.wand-new-session-permission-context dl{margin-bottom:8px}.wand-new-session-subject-collapse .ant-collapse-header-text{min-width:0}.wand-new-session-summary .ant-segmented{min-height:36px}.wand-new-session-library-dialog .ant-input-affix-wrapper,.wand-new-session-library-dialog .ant-input:not(.ant-input-affix-wrapper .ant-input),.wand-new-session-library-dialog .wand-ui-select-trigger{min-height:36px}.wand-new-session-library-dialog .ant-form-item{margin-bottom:12px}.wand-new-session-primary-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.wand-new-session-primary-fields.is-single{grid-template-columns:minmax(0,1fr)}.wand-new-session-primary-fields .ant-form-item{margin-bottom:0}.wand-execution-subject-picker .wand-ui-search{margin-bottom:12px}.wand-execution-subject-picker .ant-form-item{margin-bottom:0}.wand-execution-subject-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 12px}.wand-execution-subject-grid .ant-radio-wrapper{margin:0;min-width:0;padding-block:4px;align-items:center}.wand-execution-subject-grid .ant-radio-wrapper>span:last-child{flex:1;min-width:0}.wand-execution-subject-label .ant-typography{font-size:12px}.wand-execution-subject-label>svg,.wand-execution-subject-label>img{flex-shrink:0}.wand-new-session-logo-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:8px}@media(max-width:540px){.wand-execution-subject-grid,.wand-new-session-primary-fields{grid-template-columns:minmax(0,1fr)}.wand-new-session-logo-bar{flex-wrap:wrap}}@media(pointer:coarse){.wand-execution-subject-grid .ant-radio-wrapper{min-height:44px}.wand-new-session-logo-toggle{min-width:44px;min-height:44px}}\n"]);
|
|
3
|
+
import{b as to,c as Pt}from"/assets/modules/bc28252270bcc51a/chunk.js";import{a as Ot}from"/assets/modules/4d5ab67f6c0ce19f/chunk.js";import{a as Wt}from"/assets/modules/d37ff6684c9aeeec/chunk.js";import{a as no,b as oo,c as ao}from"/assets/modules/e020beea3e7da7db/chunk.js";import"/assets/modules/8b2f9a027ae1d7eb/chunk.js";import{a as Rn,b as En,c as zn,e as Yn,f as Qn,g as Xn}from"/assets/modules/1cf252d2f64a6279/chunk.js";import{a as Un,d as _n}from"/assets/modules/fe30627fc1e59d4f/chunk.js";import{a as ze}from"/assets/modules/7edec8f23f8e0834/chunk.js";import{a as Ae,b as Kn}from"/assets/modules/9136bae16758fd4c/chunk.js";import{c as pt}from"/assets/modules/cadd26ae50359434/chunk.js";import{a as tt}from"/assets/modules/93fa5c35e4bcab96/chunk.js";import{a as Tt,b as Nt}from"/assets/modules/c46b3501573953e9/chunk.js";import{D as In,R as Sn,S as Tn,T as Nn,a as kn,b as ct,i as hn,m as bn,t as vn,u as xn,w as Cn}from"/assets/modules/d7cdd7dca9a0c9f8/chunk.js";import"/assets/modules/2061d4a88875b9f9/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared110_e as qn,shared110_f as eo}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared49_b as Gn,shared49_d as Jn}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared112_c as Zn}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared98_a as h,shared98_b as ve}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared65_a as dt}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared113_b as Be}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared87_a as Bn,shared87_c as Rt}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared106_b as M}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared107_g as et,shared107_h as $n,shared107_i as Hn}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared114_k as Ht,shared114_o as yn}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared116_c as bt}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared50_k as Me,shared50_r as qe}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared17_f as Yt}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared86_d as pn}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared19_a as Mn}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared20_a as mn,shared20_d as un,shared20_e as fn,shared20_l as ht,shared20_n as wn,shared20_o as st}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared67_a as lt}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared51_f as vt}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared79_a as Qt}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared52_a as gn,shared52_c as $t}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared81_a as De}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{b as Vn}from"/assets/modules/e4503f8e6379ccdc/chunk.js";import"/assets/modules/5a2a58334d63e127/chunk.js";import{a as be}from"/assets/modules/aa7d409d04bbd736/chunk.js";import"/assets/modules/bf7449bcf95e1454/chunk.js";import{c as Ze}from"/assets/modules/d859a83f486aab23/chunk.js";import"/assets/modules/a073cb6d182ccd32/chunk.js";import"/assets/modules/54c22eddaf009d00/chunk.js";import{h as Ct,i as It}from"/assets/modules/b79c15aace456028/chunk.js";import"/assets/modules/54aaf60ac85dcb2b/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared120_a as jn}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared135_a as Re}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared23_b as ne,shared23_c as Fn}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared24_a as Qe,shared24_b as Xe,shared24_j as Ln}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared54_a as U,shared54_b as Jt}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared41_c as x}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import"/assets/modules/704690f5d6ab9157/chunk.js";import"/assets/modules/a8cba9f1d6b49ef1/chunk.js";import"/assets/modules/7dce56c1987e8d43/chunk.js";import"/assets/modules/b945370f1fa784f9/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{b as An}from"/assets/modules/aff19b31898aa157/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared55_a as te}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared60_a as B}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{a as Et}from"/assets/modules/0d7f7d954382dc42/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import"/assets/modules/6b5445f41bef0a66/chunk.js";import"/assets/modules/a97b3b9b68f9ca38/chunk.js";import"/assets/modules/9db41ad5ac96ffa2/chunk.js";import"/assets/modules/ec2f6b23d12d3a15/chunk.js";import"/assets/modules/55b931232c672f4f/chunk.js";import"/assets/modules/1a0b5db535599f72/chunk.js";import"/assets/modules/0da28408ec089cf7/chunk.js";import"/assets/modules/b8c447171e3d60a0/chunk.js";import"/assets/modules/ba5fa76884e1f806/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import"/assets/modules/6e8395f61c89b5aa/chunk.js";import"/assets/modules/33daaeb4bf68c7ba/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared42_B as Dn,shared42_p as Gt}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared47_a as Fe}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared48_b as St}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared61_a as T}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared13_K as xt,shared13_N as On,shared13_a as Vt,shared13_ga as Wn,shared13_la as Pn,shared13_zb as we}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared11_a as Ye}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared5_c as Y,shared5_d as Kt}from"/assets/modules/069f5a4267b0a9e3/runtime.js";var f=Y(Ye(),1);var se=Y(Ye());var{Option:ro}=Ze;function io(e){return e?.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}var Co=(e,n)=>{let{prefixCls:l,className:d,style:b,popupClassName:t,dropdownClassName:k,children:_,dataSource:o,rootClassName:O,dropdownStyle:re,dropdownRender:z,popupRender:K,onDropdownVisibleChange:D,onOpenChange:$,styles:C,classNames:le,popupMatchSelectWidth:G,dropdownMatchSelectWidth:A}=e,g=On(_),fe=K||z,ie=$||D,de=G??A,J;g.length===1&&se.isValidElement(g[0])&&!io(g[0])&&([J]=g);let oe=J?()=>J:void 0,Z;g.length&&io(g[0])?Z=_:Z=o?o.map(I=>{if(se.isValidElement(I))return I;switch(typeof I){case"string":return se.createElement(ro,{key:I,value:I},I);case"object":{let{value:q}=I;return se.createElement(ro,{key:q,value:q},I.text)}default:return}}):[];let{getPrefixCls:Ce}=se.useContext(Pn),H=Ce("select",l),Ie={...e,popupRender:fe,onOpenChange:ie,popupMatchSelectWidth:de},[E,W]=Wn([le],[C],{props:Ie},{popup:{_default:"root"}}),Se=se.useMemo(()=>({root:Vt(`${H}-auto-complete`,d,O,E.root,{[`${H}-customize`]:J}),prefix:E.prefix,input:E.input,placeholder:E.placeholder,content:E.content,clear:E.clear,popup:{root:Vt(t,k,E.popup.root),list:E.popup.list,listItem:E.popup.listItem}}),[H,d,O,E,t,k]),m=se.useMemo(()=>({root:{...W.root,...b},input:W.input,prefix:W.prefix,placeholder:W.placeholder,content:W.content,clear:W.clear,popup:{root:{...re,...W.popup.root},list:W.popup.list,listItem:W.popup.listItem}}),[W,b,re]);return se.createElement(Ze,{ref:n,suffixIcon:null,...xt(e,["dataSource","dropdownClassName","popupClassName","onDropdownVisibleChange","onOpenChange"]),prefixCls:H,classNames:Se,styles:m,mode:Ze.SECRET_COMBOBOX_MODE_DO_NOT_USE,popupRender:fe,onOpenChange:ie,popupMatchSelectWidth:de,getInputElement:oe},Z)},Io=se.forwardRef(Co),Xt=Io;var{Option:So}=Ze,To=An(Xt,"popupAlign",e=>xt(e,["visible"])),Zt=Xt;Zt.Option=So;Zt._InternalPanelDoNotUseOrYouWillBeFired=To;var Dt=Zt;typeof document<"u"&&St("wand-new-session-layout",__wandCssTextPool[0]);var Ee=Y(Ye(),1);var No="wand-global",qt="AI \u56E2\u961F\u9700\u8981\u5148\u9009\u62E9\u5DF2\u6709\u9879\u76EE\u3002";function so(e,n){return!e||n==="global"||e===No?"":e}var Qo=[...ht.map(e=>({value:e.id,label:e.label,description:e.description})),{value:"shell",label:"\u7A7A\u767D\u7EC8\u7AEF",description:"\u4EC5\u542F\u52A8\u7CFB\u7EDF Shell"}];var lo=[{value:"structured",label:"\u5BF9\u8BDD",description:"\u9605\u8BFB\u56DE\u590D\u3001\u67E5\u770B\u5DE5\u5177\u6267\u884C\u8FC7\u7A0B"},{value:"pty",label:"\u7EC8\u7AEF",description:"\u4F7F\u7528\u547D\u4EE4\u884C\u5DE5\u5177\u7684\u4EA4\u4E92\u754C\u9762"}];var u=Y(we(),1),co=[...ht.map(e=>({id:e.id,provider:e.provider,engine:e.engine,label:e.label,description:e.description,structuredOnly:e.engine==="sdk"})),{id:"shell",provider:"shell",label:"\u7A7A\u767D\u7EC8\u7AEF",description:"\u4EC5\u542F\u52A8\u7CFB\u7EDF Shell"}];function en(e,...n){let l=n.join(" ").toLocaleLowerCase();return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean).every(d=>l.includes(d))}function po({selectedSubject:e,kind:n,model:l,disabled:d=!1,teams:b=null,teamWorkspaceId:t="",showModel:k=!0,showKind:_=!0,onSubjectChange:o,onKindChange:O,onModelChange:re}){let{employees:z,loading:K}=qe(),D=tt(),$=Tt(!0),C=Nt(co,$??{},m=>m.provider),le=t==="",[G,A]=Ee.useState(""),g=Ee.useRef(null);Ee.useEffect(()=>{g.current?.focus({preventScroll:!0})},[]),Ln(!!G,()=>{A(""),g.current?.focus({preventScroll:!0})});let fe=z.filter(m=>!m.archivedAt&&en(G,"\u7845\u57FA\u5458\u5DE5",m.name,m.duty,...m.agents.map(I=>st(I.provider,I.engine)))),ie=b?.filter(m=>en(G,"AI \u56E2\u961F",m.name,m.detail??""))??[],de=C.filter(m=>en(G,"\u6267\u884C\u5DE5\u5177 CLI",m.label,m.description)),J=de.length>0||n!=="pty"&&(fe.length>0||ie.length>0),[oe,Z]=Ee.useState("claude"),[Ce,H]=Ee.useState(null);Ee.useEffect(()=>{e.type==="cli"&&e.id!=="shell"&&Z(e.id)},[e]);let Ie=m=>{d||(O(m),m==="pty"&&(e.type==="employee"||e.type==="team")?(o({type:"cli",id:oe}),H("\u5DF2\u5207\u56DE\u547D\u4EE4\u884C\u5DE5\u5177\uFF1A\u7EC8\u7AEF\u4E0D\u652F\u6301\u5458\u5DE5\u548C\u56E2\u961F\u3002")):m==="pty"&&e.engine==="sdk"?(o({type:"cli",id:e.id}),H("\u5DF2\u5207\u56DE Pi CLI\uFF1AWand Agent \u4EC5\u652F\u6301\u5BF9\u8BDD\u3002")):H(null))},E=n==="pty",W=e.type==="cli"?e.id==="shell"?"shell":wn(e.id,e.engine):"",Se=(m,I,q)=>(0,u.jsxs)(T,{align:"center",gap:8,className:"wand-execution-subject-label",children:[m,(0,u.jsxs)(T,{vertical:!0,style:{minWidth:0},children:[(0,u.jsx)(B.Text,{strong:!0,ellipsis:!0,title:I,children:I}),q?(0,u.jsx)(B.Text,{type:"secondary",ellipsis:!0,title:q,children:q}):null]})]});return(0,u.jsx)(Dn,{children:(0,u.jsxs)(T,{vertical:!0,gap:12,className:"wand-execution-subject-picker",children:[_?(0,u.jsx)(be.Item,{label:"\u4F1A\u8BDD\u7C7B\u578B",children:(0,u.jsx)(Fn,{block:!0,"aria-label":"\u4F1A\u8BDD\u7C7B\u578B",value:n,disabled:d,options:lo.map(m=>({value:m.value,label:(0,u.jsx)("span",{title:m.description,children:m.label})})),onChange:m=>Ie(m)})}):null,(0,u.jsxs)(be.Item,{label:"\u6267\u884C\u5BF9\u8C61",children:[(0,u.jsx)(jn,{value:G,onValueChange:A,disabled:d,inputRef:g,label:"\u641C\u7D22\u6267\u884C\u5BF9\u8C61",placeholder:"\u641C\u7D22\u5458\u5DE5\u3001\u56E2\u961F\u6216\u5DE5\u5177"}),Ce?(0,u.jsx)(te,{type:"warning",showIcon:!0,title:Ce}):null,(0,u.jsx)(pt.Group,{value:`${e.type}:${e.type==="cli"?W:e.id}`,disabled:d,"aria-label":"\u6267\u884C\u5BF9\u8C61",style:{width:"100%"},onChange:m=>{let I=String(m.target.value),q=I.indexOf(":"),ge=I.slice(0,q),Te=I.slice(q+1);if(H(null),ge==="cli"){let ke=co.find(Oe=>Oe.id===Te);if(ke){ke.structuredOnly&&n!=="structured"?(O("structured"),H(ke.id==="wand-agent"?"Wand Agent \u4F7F\u7528\u5BF9\u8BDD\u754C\u9762\u3002":null)):H(null),o({type:"cli",id:ke.provider,...ke.engine?{engine:ke.engine}:{}});return}}o({type:ge,id:Te})},children:(0,u.jsxs)(T,{vertical:!0,gap:12,children:[!E&&(!G.trim()||fe.length>0)?(0,u.jsxs)(T,{vertical:!0,gap:8,role:"group","aria-label":"\u7845\u57FA\u5458\u5DE5",children:[(0,u.jsx)(B.Text,{strong:!0,children:"\u7845\u57FA\u5458\u5DE5"}),K?(0,u.jsx)(Fe,{size:"small"}):null,(0,u.jsx)("div",{className:"wand-execution-subject-grid",children:fe.map(m=>(0,u.jsx)(pt,{value:`employee:${m.id}`,children:Se((0,u.jsx)(Me,{employee:m,size:"md"}),m.name,m.duty||(m.agents[0]?`\u9996\u9009\uFF1A${st(m.agents[0].provider,m.agents[0].engine)}`:"\u667A\u80FD\u52A9\u624B"))},m.id))}),!K&&z.every(m=>!!m.archivedAt)?(0,u.jsxs)("div",{children:[(0,u.jsx)("span",{children:"\u8FD8\u6CA1\u6709\u7845\u57FA\u5458\u5DE5"}),(0,u.jsx)(U,{kind:"ghost",onClick:()=>Be.open("","","teams"),children:"\u62DB\u8058\u5458\u5DE5"})]}):null]}):null,!E&&ie.length>0?(0,u.jsxs)(T,{vertical:!0,gap:8,role:"group","aria-label":"AI \u56E2\u961F",children:[(0,u.jsx)(B.Text,{strong:!0,children:"AI \u56E2\u961F"}),(0,u.jsx)("div",{className:"wand-execution-subject-grid",children:ie.map(m=>(0,u.jsx)(pt,{value:`team:${m.id}`,disabled:d||le,title:le?qt:void 0,children:Se((0,u.jsx)(x,{name:"parallel",size:18}),m.name,m.detail)},m.id))}),le?(0,u.jsx)("p",{role:"status",children:qt}):null]}):null,de.length>0?(0,u.jsxs)(T,{vertical:!0,gap:8,role:"group","aria-label":"CLI \u5DE5\u5177",children:[(0,u.jsx)(B.Text,{strong:!0,children:"\u6267\u884C\u5DE5\u5177"}),(0,u.jsx)("div",{className:"wand-execution-subject-grid",children:de.map(m=>{let I=m.structuredOnly&&E;return(0,u.jsx)(pt,{value:`cli:${m.id}`,disabled:d||I,title:I?"Wand Agent \u4EC5\u652F\u6301\u5BF9\u8BDD":void 0,children:Se(m.id==="shell"?(0,u.jsx)(x,{name:"terminal",size:18}):m.engine==="sdk"?(0,u.jsx)(x,{name:"spark",size:18}):(0,u.jsx)(Mn,{provider:m.provider,className:"wand-subject-provider"}),m.label,m.description)},m.id)})})]}):null,J?null:(0,u.jsx)(B.Text,{type:"secondary",role:"status",children:"\u6CA1\u6709\u5339\u914D\u7684\u6267\u884C\u5BF9\u8C61\uFF0C\u8BF7\u66F4\u6362\u5173\u952E\u8BCD\u6216\u6E05\u7A7A\u641C\u7D22\u3002"})]})}),E?(0,u.jsx)(B.Paragraph,{type:"secondary",children:"\u7EC8\u7AEF\u76F4\u63A5\u4F7F\u7528\u547D\u4EE4\u884C\u5DE5\u5177\u3002\u8981\u4F7F\u7528\u5458\u5DE5\u3001\u56E2\u961F\u6216 Wand Agent\uFF0C\u8BF7\u9009\u62E9\u201C\u5BF9\u8BDD\u201D\u3002"}):null]}),k&&e.type==="cli"&&e.id!=="shell"?(0,u.jsx)(be.Item,{label:"\u6A21\u578B",extra:"\u6240\u9009\u6A21\u578B\u968F\u4F1A\u8BDD\u542F\u52A8\u4E00\u8D77\u63D0\u4EA4\uFF1B\u300C\u8DDF\u968F\u670D\u52A1\u7AEF\u9ED8\u8BA4\u300D\u6CBF\u7528\u670D\u52A1\u7AEF\u914D\u7F6E\u7684\u9ED8\u8BA4\u6A21\u578B\u3002",children:(0,u.jsx)(Re,{value:l||Ht,options:yn(D,e.id),ariaLabel:"\u6A21\u578B",searchable:!0,searchPlaceholder:"\u641C\u7D22\u6A21\u578B",disabled:d,className:"wand-workspace-agent-model-select",onValueChange:re})}):null]})})}var tn=(e,n)=>globalThis.fetch(e,n),Ro=["structured","pty"],Eo=["default","full-access","auto-edit","native","managed"];function nn(e,n,l){return typeof e=="string"&&n.includes(e)?e:l}function mo(e){return{defaultProvider:nn(e.defaultProvider,mn,"claude"),defaultSessionKind:nn(e.defaultSessionKind,Ro,"structured"),defaultMode:nn(e.defaultMode,Eo,"default"),defaultCwd:$t(e.defaultCwd),defaultEngine:e.defaultEngine==="sdk"?"sdk":"cli"}}function uo(e){return Array.isArray(e)?e.flatMap(n=>!gn(n)||typeof n.path!="string"||!n.path.trim()?[]:[{path:n.path,name:$t(n.name,n.path.split("/").filter(Boolean).at(-1)??n.path)}]):[]}function Oo(e){return e==="codex"?["full-access"]:e==="opencode"||e==="grok"||e==="pi"?["default","full-access","managed"]:e==="qoder"?["default","full-access","auto-edit","managed"]:["default","full-access","auto-edit","native","managed"]}function At(e,n,l="default"){let d=Oo(e);return d.includes(n)?n:d.includes(l)?l:d[0]}function fo(e,n,l,d={}){let b=e.cwd.trim()||l.effectiveCwd.trim()||n.defaultCwd,t={cols:Number.isFinite(d.cols)&&(d.cols??0)>0?d.cols:void 0,rows:Number.isFinite(d.rows)&&(d.rows??0)>0?d.rows:void 0},k={cwd:b,worktreeEnabled:e.worktreeEnabled===!0,sessionSource:"interactive",...e.workspaceId?{workspaceId:e.workspaceId}:{},...e.workspaceTaskId?{workspaceTaskId:e.workspaceTaskId}:{}};if(e.kind==="shell")return{...k,...t,kind:"shell",shell:!0,mode:"default"};let _=At(e.provider,e.mode,n.defaultMode),o={...k,provider:e.provider,mode:_},O=(e.model??"").trim()||(l.selectedModels?.[e.provider]??"").trim();if(e.kind==="pty")return{...o,...t,kind:"pty",command:un(e.provider),model:O||void 0,...l.thinkingEffort?.trim()?{thinkingEffort:l.thinkingEffort.trim()}:{}};let re=l.thinkingEffort?.trim(),z=!!(e.employeeId&&e.specifiedCli),K=e.provider==="pi"&&e.engine==="sdk"?{engine:"sdk"}:{};return{...o,...K,kind:"structured",runner:fn(e.provider),model:e.employeeId&&!e.specifiedCli?void 0:O||void 0,thinkingEffort:re||void 0,...e.employeeId?{employeeId:e.employeeId,overrideCli:z}:{}}}var on=class{constructor(n=tn){Kt(this,"fetchImpl",n);Kt(this,"preferenceWrite",Promise.resolve())}async loadConfig(n={}){if(await this.preferenceWrite.catch(()=>{}),this.fetchImpl===tn){let d=await Gn();return n.signal?.throwIfAborted(),mo(d)}let l=await this.fetchImpl("/api/config",{credentials:"same-origin",signal:n.signal});return mo(await vt(l))}async load(n={}){let l=await this.loadConfig(n),d=await this.fetchImpl("/api/recent-paths",{credentials:"same-origin",signal:n.signal}).then(async b=>b.ok?uo(await b.json()):[]).catch(b=>{if(n.signal?.aborted)throw b;return[]});return{config:l,recentPaths:d}}savePreferences(n){if(Object.keys(n).length===0)return this.preferenceWrite;let l=this.preferenceWrite.catch(()=>{}).then(async()=>{let d=await this.fetchImpl("/api/settings/config",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(n)});await vt(d),this.fetchImpl===tn&&Jn()});return this.preferenceWrite=l,l}async suggestPaths(n,l={}){let d=await this.fetchImpl(`/api/path-suggestions?q=${encodeURIComponent(n.trim())}`,{credentials:"same-origin",signal:l.signal});return d.ok?uo(await d.json()):[]}async create(n){let l=n.kind==="structured",d="/api/sessions",b=l?{kind:"structured",cwd:n.cwd,mode:n.mode,provider:n.provider,runner:n.runner,engine:n.engine,worktreeEnabled:n.worktreeEnabled,model:n.model,thinkingEffort:n.thinkingEffort,employeeId:n.employeeId,overrideCli:n.overrideCli,...n.workspaceId?{workspaceId:n.workspaceId}:{},...n.workspaceTaskId?{workspaceTaskId:n.workspaceTaskId}:{},sessionSource:n.sessionSource}:{kind:"pty",command:n.kind==="pty"?n.command:void 0,provider:n.kind==="pty"?n.provider:void 0,shell:n.kind==="shell"||void 0,cwd:n.cwd,mode:n.mode,worktreeEnabled:n.worktreeEnabled,model:n.kind==="pty"?n.model:void 0,thinkingEffort:n.kind==="pty"?n.thinkingEffort:void 0,cols:n.cols,rows:n.rows,...n.workspaceId?{workspaceId:n.workspaceId}:{},...n.workspaceTaskId?{workspaceTaskId:n.workspaceTaskId}:{},sessionSource:n.sessionSource},t=await this.fetchImpl(d,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(b)}),k=await vt(t);if(typeof k.id!="string"||!k.id)throw new Error("\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u65B0\u4F1A\u8BDD ID\u3002");return k}},mt=new on;async function wo(e,n,l){if(e.workspaceTaskId||e.taskName===void 0)return e;let d=e.taskName.trim();if(!d)throw new Error("\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0\u3002");let b={name:d,cwd:n,worktree:!1},t=e.workspaceId?await l.createTask(e.workspaceId,b):await l.createStandaloneTask(b);if(!t.id)throw new Error("\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u65B0\u4EFB\u52A1 ID\uFF0C\u8BF7\u5237\u65B0\u4EFB\u52A1\u5217\u8868\u6838\u5BF9\u540E\u518D\u521B\u5EFA\u4F1A\u8BDD\u3002");return{...e,taskName:d,workspaceId:t.workspaceId,workspaceTaskId:t.id,cwd:t.cwd}}var go=Y(Ye(),1);var ue=Y(we(),1);function an({form:e,initialName:n,disabled:l,cwd:d,onChange:b,onCreateTask:t,inline:k}){let{groups:_,loading:o,error:O,reload:re}=Zn(),[z,K]=go.useState(!1),D=_.flatMap(A=>A.tasks.filter(g=>!g.archived).map(g=>({task:g,group:A}))),$=D.find(({task:A})=>A.id===e.workspaceTaskId),C=e.workspaceTaskId?$?.task.name||e.taskName||n||"\u6240\u9009\u4EFB\u52A1":e.taskName!==void 0?e.taskName||"\u65B0\u5EFA\u4EFB\u52A1\u2026":"\u9ED8\u8BA4\u4EFB\u52A1",le=(0,ue.jsx)(Re,{ariaLabel:"\u6240\u5C5E\u4EFB\u52A1",className:"wand-new-session-model-select",disabled:l,searchable:!0,searchPlaceholder:"\u641C\u7D22\u4EFB\u52A1",value:e.workspaceTaskId||(e.taskName!==void 0?"new":""),options:[{value:"",label:"\u9ED8\u8BA4\u4EFB\u52A1"},{value:"new",label:"\u65B0\u5EFA\u4EFB\u52A1\u2026"},...e.workspaceTaskId&&!$?[{value:e.workspaceTaskId,label:e.taskName||n||"\u5F53\u524D\u4EFB\u52A1"}]:[],...D.map(({task:A,group:g})=>({value:A.id,label:A.name,group:g.workspaceName}))],onValueChange:A=>{let g=D.find(({task:fe})=>fe.id===A);g?(b({...e,workspaceTaskId:g.task.id,workspaceId:g.task.workspaceId,taskName:void 0,cwd:g.task.worktree?.path||g.task.cwd||g.group.workspaceCwd}),k&&K(!1)):A==="new"?(K(!1),t()):A===""&&(b({...e,workspaceTaskId:void 0,workspaceId:$&&!$.group.synthetic&&!$.group.global?$.group.workspaceId:e.workspaceId,cwd:e.workspaceTaskId?e.cwd:$?.group.workspaceCwd||d,taskName:void 0}),k&&K(!1))}}),G=(0,ue.jsxs)(T,{vertical:!0,gap:8,style:k?{minWidth:260,padding:4}:void 0,children:[(0,ue.jsx)(be.Item,{label:"\u6240\u5C5E\u4EFB\u52A1",style:{marginBottom:0},children:le}),o?(0,ue.jsx)("span",{role:"status",children:"\u6B63\u5728\u52A0\u8F7D\u5DF2\u6709\u4EFB\u52A1\u2026"}):null,O?(0,ue.jsx)(te,{type:"warning",title:O,action:(0,ue.jsx)(U,{size:"small",onClick:()=>{re()},children:"\u91CD\u8BD5"})}):null]});return k?(0,ue.jsx)(ne,{ariaLabel:"\u9009\u62E9\u6240\u5C5E\u4EFB\u52A1",side:"bottom",open:z,onOpenChange:K,trigger:(0,ue.jsxs)("button",{type:"button",disabled:l,className:"new-work-inline-trigger new-work-inline-task",title:`\u6240\u5C5E\u4EFB\u52A1\uFF1A${C}\uFF0C\u70B9\u51FB\u66F4\u6362`,"aria-label":"\u6240\u5C5E\u4EFB\u52A1",children:[(0,ue.jsx)(x,{name:"clipboard",size:14,className:"new-work-inline-task-icon"}),(0,ue.jsx)("span",{className:"new-work-inline-task-name",children:C}),(0,ue.jsx)(x,{name:"chevronDown",size:12,className:"new-work-inline-arrow"})]}),children:G}):G}function Lt(){St("wand-new-work",`
|
|
4
|
+
.new-work-page { position:absolute; inset:0; z-index:8; display:flex; flex-direction:column; min-width:0; min-height:0; overflow:auto; background:var(--bg-primary); }
|
|
5
|
+
.new-work-heading { min-height:44px; padding:0 var(--wand-page-inset); flex-shrink:0; }
|
|
6
|
+
.new-work-page-label { font-size:12px; color:var(--text-secondary); }
|
|
7
|
+
.new-work-context { flex:1 0 auto; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:20px; padding:24px var(--wand-page-inset); text-align:center; }
|
|
8
|
+
.new-work-context h1 { margin:0; max-width:100%; font-size:clamp(20px,2.5vw,28px); font-weight:400; line-height:1.7; color:var(--text-primary); overflow-wrap:anywhere; }
|
|
9
|
+
.new-work-context h1 > span { text-decoration:underline; text-decoration-color:var(--border-default); text-underline-offset:5px; }
|
|
10
|
+
.new-work-inline-trigger { display:inline-flex; align-items:center; justify-content:center; vertical-align:middle; border:1px solid transparent; background:transparent; padding:2px 8px; margin:0 8px; font:inherit; color:inherit; cursor:pointer; border-radius:20px; line-height:inherit; gap:6px; transition:all 0.15s ease; }
|
|
11
|
+
.new-work-inline-trigger:disabled { cursor:default; opacity:0.65; }
|
|
12
|
+
.new-work-inline-trigger:hover:not(:disabled) { background:var(--bg-secondary); border-color:var(--border-subtle); }
|
|
13
|
+
.new-work-inline-trigger:focus-visible { outline:2px solid var(--wand-accent, #3b82f6); outline-offset:2px; }
|
|
14
|
+
.new-work-inline-avatar { padding:2px 8px 2px 2px; }
|
|
15
|
+
.new-work-inline-avatar .wand-employee-avatar { transform:none; }
|
|
16
|
+
.new-work-inline-avatar-fallback { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:50%; background:var(--bg-secondary); color:var(--text-secondary); }
|
|
17
|
+
.new-work-inline-directory { border-radius:8px; padding:2px 8px; }
|
|
18
|
+
.new-work-inline-directory > span { text-decoration:underline; text-decoration-color:var(--border-default); text-underline-offset:5px; transition:color 0.15s ease, text-decoration-color 0.15s ease; }
|
|
19
|
+
.new-work-inline-directory:hover:not(:disabled) > span { text-decoration-color:var(--text-primary); color:var(--text-primary); }
|
|
20
|
+
.new-work-inline-task { border-radius:8px; padding:2px 8px; }
|
|
21
|
+
.new-work-inline-task-name { text-decoration:underline; text-decoration-color:var(--border-default); text-underline-offset:5px; transition:color 0.15s ease, text-decoration-color 0.15s ease; }
|
|
22
|
+
.new-work-inline-task:hover:not(:disabled) .new-work-inline-task-name { text-decoration-color:var(--text-primary); color:var(--text-primary); }
|
|
23
|
+
.new-work-inline-task-icon { color:var(--text-secondary); flex-shrink:0; transition:color 0.15s ease; }
|
|
24
|
+
.new-work-inline-task:hover:not(:disabled) .new-work-inline-task-icon { color:var(--text-primary); }
|
|
25
|
+
.new-work-inline-arrow { color:var(--text-secondary); opacity:0.8; transition:color 0.15s ease, opacity 0.15s ease, transform 0.15s ease; flex-shrink:0; }
|
|
26
|
+
.new-work-inline-trigger:hover:not(:disabled) .new-work-inline-arrow { color:var(--text-primary); opacity:1; }
|
|
27
|
+
.new-work-page .new-work-composer { width:100%; max-width:800px; box-sizing:border-box; margin-inline:auto; padding:0 var(--wand-page-inset) max(12px,var(--wand-safe-bottom,0px)); flex-shrink:0; }
|
|
28
|
+
.new-work-context-bar { display:flex; align-items:center; gap:4px; min-width:0; margin-inline:12px; padding:2px 8px 8px; border-radius:16px 16px 0 0; background:var(--bg-secondary); }
|
|
29
|
+
.new-work-location { display:flex; align-items:center; min-width:0; flex:1; gap:4px; }
|
|
30
|
+
.new-work-page .new-work-person.ant-btn { min-width:0; max-width:180px; height:32px; padding-inline:6px; gap:6px; font-size:12px; }
|
|
31
|
+
.new-work-person .wand-employee-avatar { transform:none; }
|
|
32
|
+
.new-work-person-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
33
|
+
.new-work-page .new-work-directory.ant-btn { min-width:0; max-width:240px; height:32px; padding-inline:6px; font-size:12px; color:var(--text-primary); }
|
|
34
|
+
.new-work-directory.ant-btn > span:not(.wand-ui-icon) { overflow:hidden; text-overflow:ellipsis; }
|
|
35
|
+
.new-work-subject { width:min(560px,calc(100vw - 48px)); max-height:60dvh; overflow:auto; }
|
|
36
|
+
.new-work-paths { width:min(440px,calc(100vw - 48px)); max-height:60dvh; overflow:auto; }
|
|
37
|
+
.new-work-paths > .ant-btn { justify-content:flex-start; overflow:hidden; }
|
|
38
|
+
.new-work-page .conversation-input-wrap,
|
|
39
|
+
.new-work-page .conversation-input-wrap:has(.conversation-runtime-summary):not(:has(.composer-floating-avatar)) { margin-block-start:-1px; }
|
|
40
|
+
.new-work-page .conversation-sender.ant-sender { border:1px solid var(--border-subtle); border-radius:24px; padding:14px 12px 8px; }
|
|
41
|
+
.new-work-page .conversation-sender .ant-sender-input { min-height:48px; }
|
|
42
|
+
.new-work-page .conversation-sender .ant-sender-footer { padding-top:8px; }
|
|
43
|
+
.new-work-page .conversation-runtime-summary { position:static; width:auto; max-width:100%; height:auto; gap:2px; }
|
|
44
|
+
.new-work-page .conversation-runtime-summary .conversation-runtime-select { height:32px; min-height:32px; font-size:12px; }
|
|
45
|
+
.new-work-page .conversation-runtime-summary .conversation-tool-select { flex:0 1 96px; }
|
|
46
|
+
.new-work-page .conversation-runtime-summary .conversation-model-select { flex:0 1 180px; }
|
|
47
|
+
.new-work-page .conversation-runtime-summary .conversation-thinking-select { flex:0 1 108px; }
|
|
48
|
+
.new-work-page .conversation-action-row { gap:4px; }
|
|
49
|
+
.new-work-page .new-work-actions { flex:none; }
|
|
50
|
+
.new-work-page .new-work-send-actions { min-width:0; justify-content:flex-end; }
|
|
51
|
+
.new-work-submit-status { padding:0 12px 8px; font-size:12px; }
|
|
52
|
+
.new-work-submit-status [role="status"] { min-height:1.5em; }
|
|
53
|
+
.new-work-permission { display:inline-flex; align-items:center; gap:4px; font-size:12px; color:var(--text-secondary); white-space:nowrap; }
|
|
54
|
+
.new-work-permission[data-automatic="true"] { color:var(--warning); }
|
|
55
|
+
.new-work-page .conversation-submit.ant-btn { border-radius:50%; }
|
|
56
|
+
@media(max-width:700px) {
|
|
57
|
+
.new-work-context { gap:16px; }
|
|
58
|
+
.new-work-context-bar { margin-inline:8px; padding-inline:4px; }
|
|
59
|
+
.new-work-page .new-work-person.ant-btn { max-width:140px; }
|
|
60
|
+
.new-work-page .conversation-action-row { flex-wrap:wrap; }
|
|
61
|
+
.new-work-page .new-work-send-actions { flex:1; }
|
|
62
|
+
.new-work-page .conversation-runtime-summary { flex-wrap:wrap; justify-content:flex-end; }
|
|
63
|
+
.new-work-page .conversation-runtime-summary .conversation-runtime-select { flex:0 1 auto; max-width:140px; }
|
|
64
|
+
.new-work-page .new-work-actions .composer-edit-action { display:none; }
|
|
65
|
+
}
|
|
66
|
+
@media(pointer:coarse) {
|
|
67
|
+
.new-work-page :is(.new-work-person,.new-work-directory,.conversation-runtime-summary .conversation-runtime-select) { min-height:44px; height:44px; }
|
|
68
|
+
}
|
|
69
|
+
`)}function rn({provider:e,mode:n,kind:l,engine:d}){return e==="codex"?"Codex \u81EA\u52A8\u6279\u51C6\u5DE5\u5177\u8C03\u7528\uFF0C\u5E76\u5173\u95ED Codex \u7684\u6C99\u76D2\u9650\u5236\u3002":e==="opencode"?n==="full-access"||n==="managed"||n==="auto-edit"?"OpenCode \u81EA\u52A8\u6279\u51C6\u672A\u663E\u5F0F\u62D2\u7EDD\u7684\u6743\u9650\u8BF7\u6C42\u3002":l==="structured"?"OpenCode \u4F7F\u7528\u81EA\u8EAB\u6743\u9650\u914D\u7F6E\uFF1B\u5BF9\u8BDD\u4E2D\u672A\u6279\u51C6\u7684\u5DE5\u5177\u8C03\u7528\u4F1A\u88AB\u62D2\u7EDD\u3002":"OpenCode \u4F7F\u7528\u81EA\u8EAB\u6743\u9650\u914D\u7F6E\uFF0C\u5728\u7EC8\u7AEF\u4E2D\u5904\u7406\u6743\u9650\u786E\u8BA4\u3002":e==="grok"?n==="full-access"||n==="managed"?"Grok \u81EA\u52A8\u6279\u51C6\u5DE5\u5177\u6743\u9650\u8BF7\u6C42\u3002":"Grok \u4F7F\u7528\u81EA\u8EAB\u6743\u9650\u914D\u7F6E\uFF1B\u9700\u8981\u786E\u8BA4\u7684\u64CD\u4F5C\u53EF\u80FD\u7B49\u5F85\u6216\u88AB\u963B\u6B62\u3002":e==="qoder"?"Qoder \u5728\u6240\u6709\u6A21\u5F0F\u4E0B\u90FD\u8DF3\u8FC7\u5DE5\u5177\u6743\u9650\u786E\u8BA4\u3002":e==="pi"?d==="sdk"?"Wand Agent \u5728 Wand \u5185\u6267\u884C\uFF0C\u4F7F\u7528\u5F53\u524D\u4F1A\u8BDD\u914D\u7F6E\u7684\u5DE5\u5177\u4E0E\u6269\u5C55\u3002":"Pi CLI \u4F7F\u7528\u81EA\u8EAB\u5DE5\u5177\u4E0E\u6269\u5C55\u914D\u7F6E\u3002":n==="full-access"?"Claude \u81EA\u52A8\u6279\u51C6\u5DE5\u5177\u6743\u9650\u8BF7\u6C42\uFF0C\u53EF\u8FDE\u7EED\u6267\u884C\u4FEE\u6539\u3002":n==="auto-edit"?"Claude \u81EA\u52A8\u6279\u51C6\u6587\u4EF6\u7F16\u8F91\uFF1B\u5176\u4ED6\u5DE5\u5177\u6309\u5F53\u524D\u4F1A\u8BDD\u6743\u9650\u7B56\u7565\u5904\u7406\u3002":n==="managed"?"Claude \u6309\u76EE\u6807\u8FDE\u7EED\u6267\u884C\uFF0C\u5E76\u81EA\u52A8\u6279\u51C6\u5DE5\u5177\u6743\u9650\u8BF7\u6C42\uFF1B\u7F3A\u5C11\u5FC5\u8981\u4FE1\u606F\u6216\u5DE5\u5177\u5931\u8D25\u65F6\u4ECD\u53EF\u80FD\u505C\u6B62\u3002":"Claude \u4FDD\u7559\u5DE5\u5177\u6267\u884C\u65B9\u5F0F\uFF0C\u64CD\u4F5C\u8BF7\u6C42\u6309\u5F53\u524D\u4F1A\u8BDD\u6743\u9650\u7B56\u7565\u5904\u7406\u3002"}function ko(e){return e.kind!=="shell"&&(e.mode==="full-access"||e.mode==="managed"||e.provider==="codex"||e.provider==="qoder")}var nt=Y(Ye(),1);var Ft=Y(we(),1),jt=nt.forwardRef(function({text:n,onTextChange:l,onSubmit:d,disabled:b,placeholder:t,ariaLabel:k="\u5DE5\u4F5C\u5185\u5BB9",expanded:_=!1,footer:o,header:O,children:re},z){let K=nt.useRef(null),D=Xe();nt.useImperativeHandle(z,()=>({get inputElement(){return K.current?.inputElement}}),[]);let $=()=>{!b&&!D.isComposing()&&d()};return(0,Ft.jsxs)("div",{className:"conversation-input-wrap","data-composer-expanded":"true","data-editor-expanded":_,onCompositionStartCapture:D.onCompositionStart,onCompositionEndCapture:D.onCompositionEnd,children:[re,(0,Ft.jsx)(Vn,{ref:K,className:"conversation-sender",value:n,readOnly:b,placeholder:t,"aria-label":k,suffix:!1,autoSize:{minRows:2,maxRows:_?24:4},onChange:l,onSubmit:$,submitType:"enter",header:O,footer:o,onKeyDown:C=>{if(D.shouldIgnore(C))return!1;if(C.key==="Enter")return C.shiftKey||C.altKey||C.ctrlKey||C.metaKey||(C.preventDefault(),$()),!1}})]})});var w=Y(Ye(),1);var yo=Y(we(),1);function Mt({task:e,options:n,disabled:l}){return(0,yo.jsx)(It,{ariaLabel:"\u65B0\u5EFA\u5DE5\u4F5C\u65B9\u5F0F",value:e?"task":"work",onValueChange:d=>h.open({...n,newTask:d==="task"}),tabs:[{value:"work",label:"\u5F00\u59CB\u5DE5\u4F5C",content:null,disabled:l},{value:"task",label:"\u521B\u5EFA\u4EFB\u52A1",content:null,disabled:l}]})}function ho(e){let n=e?.status;return!n||n<400||n>=500||n===408||n===409}function sn(e,n,l){let{agentOverride:d,...b}=e.subject,t=e.subject.type==="employee"&&e.employeeOverride?{...b,agentOverride:e.agent}:b;return{workspaceId:e.workspaceId||null,title:e.title.trim(),description:n.trim(),status:e.status,priority:e.priority,labels:e.labels.split(/[,,]/).map(k=>k.trim()).filter(Boolean),dueDate:e.dueDate||null,milestoneId:e.milestoneId||null,parentTaskId:e.parentTaskId||null,...t.type==="cli"?{agent:e.agent}:{},executionSubject:t,rememberAgentDefaults:t.type==="cli"&&l}}var r=Y(we(),1),ot=new Map,zt=new Map;function xe(e){return e.trim().replace(/\/+$/,"")||"/"}function ut(e){return no(Un.getSnapshot().items,e||null)?.id||""}function bo({options:e}){let n=`${e.taskDraft?.workspaceId||e.workspaceId||e.initialCwd||"global"}:${e.taskDraft?.parentTaskId||"root"}`,l=e.taskDraft?.draftKey||bt(`new-work:task:${n}`,null),d=e.taskDraft?.scope||`task:${l}`,b=w.useCallback(()=>M.revision(l),[l]);w.useSyncExternalStore(M.subscribe,b,b);let t=M.read(l),k=w.useRef(null),_=Ot(l,()=>k.current?.inputElement),[o,O]=w.useState(()=>{let a=ot.get(d);if(!a)return null;if(!e.taskDraft?.draftKey){let y=e.taskDraft;return{...a,...y?.status!==void 0?{status:y.status}:{},...y?.priority!==void 0?{priority:y.priority}:{},...y?.milestoneId!==void 0?{milestoneId:y.milestoneId}:{},...y?.parentTaskId!==void 0?{parentTaskId:y.parentTaskId}:{}}}let c=e.taskDraft.workspaceId??e.workspaceId??a.workspaceId,v=c!==a.workspaceId||e.initialCwd&&xe(e.initialCwd)!==xe(a.cwd),S=e.taskDraft.executionSubject??a.subject;return{...a,workspaceId:c,cwd:e.initialCwd||a.cwd,subject:S,agent:e.taskDraft.agent??a.agent,employeeOverride:!!S.agentOverride,...v?{parentTaskId:"",milestoneId:ut(c)}:{}}}),re=w.useRef(ot.has(d)),[z,K]=w.useState([]),[D,$]=w.useState([]),[C,le]=w.useState([]),[G,A]=w.useState(null),[g,fe]=w.useState(!0),[ie,de]=w.useState(!1),[J,oe]=w.useState(""),[Z,Ce]=w.useState(()=>h.getUnknownCreation(`draft:${l}`)?.message||h.getUnknownCreation(d)?.message||""),[H,Ie]=w.useState(()=>zt.get(d)??null),E=h.getAcceptedCreation(l),[W,Se]=w.useState(!1),[m,I]=w.useState(!1),[q,ge]=w.useState(!1),[Te,ke]=w.useState(!1),[Oe,Ue]=w.useState(!1),[Bt,Ut]=w.useState(!1),[ae,_e]=w.useState(!1),[Ke,V]=w.useState(!1),[ft,j]=w.useState(!1),[Le,at]=w.useState([]),We=w.useRef(!1),ye=w.useRef(!0),ce=w.useRef(!!o),{employees:N,loading:P,error:pe}=qe({enabled:!0}),wt=tt(!0),gt=Tt(!0),$e=Nt(hn,gt||{},a=>a.provider).map(a=>({value:a.value,label:a.label})),rt=Xe();w.useLayoutEffect(()=>{Wt(),Pt(),Lt()},[]),w.useEffect(()=>(ye.current=!0,()=>{ye.current=!1}),[]),w.useEffect(()=>{o&&ot.set(d,o)},[o,d]),w.useEffect(()=>{let a=new AbortController;return Promise.all([ze.workspaces(),ze.list(),et.list(),ze.agentDefaults(),mt.load({signal:a.signal})]).then(([c,v,S,y,Pe])=>{if(a.signal.aborted)return;K(c),$(v),le(S),A(Pe),O(X=>{if(X){let je=!X.workspaceId&&X.cwd.trim()?c.find(xo=>xe(xo.cwd)===xe(X.cwd)):void 0;return je?{...X,workspaceId:je.id,milestoneId:ut(je.id)}:X}let ee=e.taskDraft,ln=ee?.workspaceId||e.workspaceId||"",dn=c.find(je=>je.id===ln)?.cwd||e.initialCwd||(ee&&"workspaceId"in ee?"":ve.getRuntime()?.getContext().effectiveCwd||Pe.config.defaultCwd),vo=c.find(je=>xe(je.cwd)===xe(dn)),cn=ee?.agent||y;return{workspaceId:ln||vo?.id||"",cwd:dn,title:ee?.title||"",status:ee?.status||"backlog",priority:ee?.priority||kn,dueDate:"",labels:"",milestoneId:ee?.milestoneId||"",parentTaskId:ee?.parentTaskId||"",agent:cn,subject:ee?.executionSubject||(e.initialEmployeeId?{type:"employee",id:e.initialEmployeeId}:{type:"cli",id:cn.provider}),employeeOverride:!!ee?.executionSubject?.agentOverride}});let L=M.read(l);!e.taskDraft?.draftKey&&L.revision===0&&!L.text&&e.taskDraft?.description&&M.edit(l,{text:e.taskDraft.description})}).catch(c=>{a.signal.aborted||oe(De(c,"\u4EFB\u52A1\u914D\u7F6E\u8BFB\u53D6\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u65B0\u5EFA\u3002"))}).finally(()=>{a.signal.aborted||fe(!1)}),()=>a.abort()},[]),w.useEffect(()=>{if(!o||g||P||ce.current)return;if(ce.current=!0,e.initialEmployeeId||e.taskDraft?.executionSubject){let S=o.subject.type==="employee"?N.find(y=>y.id===o.subject.id):void 0;S?.agents[0]&&!o.employeeOverride&&O(y=>y&&{...y,agent:S.agents[0]});return}let a=Yn(),c=Xn({},a?.subject.type==="cli"?null:a,o.agent,{employees:pe?null:N,teams:C}),v=c.subject.type==="employee"?N.find(S=>S.id===c.subject.id):void 0;O(S=>S&&{...S,subject:c.subject,agent:v?.agents[0]??c.agent})},[o,g,P,pe,N,C,e]),w.useEffect(()=>{if(!Oe&&!Ke||!o)return;let a=new AbortController,c=window.setTimeout(()=>{mt.suggestPaths(o.cwd,{signal:a.signal}).then(v=>{a.signal.aborted||at(v)}).catch(()=>{})},120);return()=>{a.abort(),clearTimeout(c)}},[Oe,Ke,o?.cwd]);let kt=oo(o?.workspaceId||null,!g);ao(!g&&!re.current,kt,a=>O(c=>c&&!c.milestoneId?{...c,milestoneId:a}:c));let me=a=>{R||O(c=>c&&{...c,...a})},he=o?.subject.type==="employee"?N.find(a=>a.id===o.subject.id):void 0,He=o?.subject.type==="team"?C.find(a=>a.id===o.subject.id):void 0,R=ie||!!Z||!!H||!!E,Ve=a=>{if(!ho(a))return;let c="\u521B\u5EFA\u7ED3\u679C\u672A\u786E\u8BA4\uFF0C\u8BF7\u5148\u6838\u5BF9\u4EFB\u52A1\u5217\u8868\uFF0C\u4E0D\u8981\u91CD\u590D\u521B\u5EFA\uFF1B\u672C\u9875\u8349\u7A3F\u4FDD\u7559\u3002";h.markUnknownCreation({scope:d,message:c}),h.markUnknownCreation({scope:`draft:${l}`,message:c}),M.edit(l,{text:t.text,expectedRevision:t.revision,persist:!1}),Ce(c)},yt=a=>{zt.delete(d),h.close(),Be.open(a.workspaceId||""),pn({task:a.id})},it=async()=>{let a=h.getUnknownCreation(`draft:${l}`)||h.getUnknownCreation(d);if(a){Ce(a.message);return}if(!o||We.current||R||g||P||!o.title.trim()&&!t.text.trim())return;if(W&&!t.text.trim()){oe("\u521B\u5EFA\u5E76\u5F00\u59CB\u6267\u884C\u9700\u8981\u586B\u5199\u672C\u6B21\u4EA4\u4ED8\u76EE\u6807\u3002");return}if(t.attachments.length){oe("\u4EFB\u52A1\u8BA1\u5212\u6682\u4E0D\u4FDD\u5B58\u9644\u4EF6\u3002\u8BF7\u5207\u56DE\u5F00\u59CB\u5DE5\u4F5C\uFF0C\u9644\u4EF6\u4E0E\u8F93\u5165\u4F1A\u4E00\u5E76\u4FDD\u7559\u3002");return}if(o.subject.type==="employee"&&!he){oe("\u6240\u9009\u5458\u5DE5\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002");return}if(o.subject.type==="team"&&!He){oe("\u6240\u9009\u56E2\u961F\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002");return}if(W&&he&&!he.agents.length){oe("\u6240\u9009\u5458\u5DE5\u5C1A\u672A\u914D\u7F6E\u6267\u884C\u5DE5\u5177\uFF0C\u8BF7\u66F4\u6362\u5458\u5DE5\u3002");return}We.current=!0,de(!0),oe(""),h.setDismissable(!1);let c=o;try{if(W){let L=await Qt.dialog({title:"\u786E\u8BA4\u521B\u5EFA\u5E76\u5F00\u59CB\u6267\u884C",description:`\u5C06\u521B\u5EFA\u4EFB\u52A1\u5E76\u65B0\u5EFA\u4E00\u6B21\u6267\u884C\u3002
|
|
70
|
+
${o.title.trim()}
|
|
71
|
+
${t.text.trim()}
|
|
72
|
+
${En(o.agent,o.employeeOverride?void 0:he)}
|
|
73
|
+
${He?.name||""}
|
|
74
|
+
\u4E3B\u76EE\u6807\u7EA6\u675F\uFF1A${D.find(X=>X.id===o.parentTaskId)?.description||"\u65E0\u7236\u4EFB\u52A1"}
|
|
75
|
+
\u786E\u8BA4\u540E\u6CBF\u7528\u5DF2\u6709\u6743\u9650\u4E0E\u8D39\u7528\u8FB9\u754C\u3002`,actions:[{label:"\u53D6\u6D88",value:!1,autoFocus:!0},{label:"\u521B\u5EFA\u5E76\u5F00\u59CB\u6267\u884C",value:!0,kind:"primary"}]});if(L.dismissed===!0||L.action!==!0)return}if(!c.workspaceId&&c.cwd.trim()){let X=(await ze.workspaces()).find(ee=>xe(ee.cwd)===xe(c.cwd));if(!X)try{if(X=await dt.create({name:c.cwd.trim().split("/").filter(Boolean).at(-1)||"\u5DE5\u4F5C\u76EE\u5F55",cwd:c.cwd.trim()}),!X?.id)throw Object.assign(new Error("\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u9879\u76EE ID\uFF0C\u8BF7\u6838\u5BF9\u76EE\u5F55\u5217\u8868\u3002"),{status:200})}catch(ee){throw Ve(ee),ee}c={...c,workspaceId:X.id,cwd:X.cwd},ot.set(d,c),O(c)}let v=sn(c,t.text,m),S=v.executionSubject,y=await ze.create(v).then(L=>{if(!L?.id)throw Object.assign(new Error("\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u4EFB\u52A1 ID\uFF0C\u8BF7\u6838\u5BF9\u4EFB\u52A1\u5217\u8868\u3002"),{status:200});return L}).catch(L=>{throw Ve(L),L});zt.set(d,y),Ie(y);let Pe="";if(W)try{await ze.dispatch(y.id,S.type==="cli"||c.employeeOverride?c.agent:null,{subject:S,prompt:Rn(y,D.find(L=>L.id===y.parentTaskId),t.text),workspaceId:y.workspaceId}),Qn({agent:c.agent,subject:S})}catch(L){Pe=De(L,"\u4EFB\u52A1\u5DF2\u521B\u5EFA\uFF0C\u4F46\u542F\u52A8\u6267\u884C\u5931\u8D25\u3002\u8BF7\u5728\u4EFB\u52A1\u8BE6\u60C5\u4E2D\u6838\u5BF9\u6267\u884C\u8BB0\u5F55\u3002")}if(M.edit(l,{acknowledgeRevision:t.revision}),ot.delete(d),lt(),Pe){oe(`\u4EFB\u52A1\u5DF2\u521B\u5EFA\u3002${Pe} \u8BF7\u6253\u5F00\u5DF2\u521B\u5EFA\u7684\u4EFB\u52A1\uFF0C\u4E0D\u8981\u91CD\u590D\u521B\u5EFA\u3002`);return}if(zt.delete(d),q){let L={...c,title:""};ot.set(d,L),O(L),Ie(null),Qt.toast(`\u5DF2\u521B\u5EFA\u4EFB\u52A1\u300C${y.title}\u300D`,{tone:"success"})}else yt(y)}catch(v){ye.current&&oe(De(v,"\u521B\u5EFA\u672A\u5B8C\u6210\uFF0C\u8349\u7A3F\u5DF2\u4FDD\u7559\u3002"))}finally{We.current=!1,h.setDismissable(!0),ye.current&&de(!1)}};if(g||P)return(0,r.jsxs)(T,{align:"center",justify:"center",flex:1,role:"status",children:[(0,r.jsx)(Fe,{}),(0,r.jsx)("span",{children:"\u6B63\u5728\u8BFB\u53D6\u4EFB\u52A1\u914D\u7F6E\u2026"})]});if(!o)return(0,r.jsx)(te,{type:"error",title:J||"\u4EFB\u52A1\u914D\u7F6E\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u65B0\u5EFA\u3002"});let Ge=z.find(a=>a.id===o.workspaceId)?.name||o.cwd.split("/").filter(Boolean).at(-1)||"\u9009\u62E9\u76EE\u5F55",Je=he?.name||He?.name||In(o.agent.provider,o.agent.engine),s=W?"\u521B\u5EFA\u5E76\u5F00\u59CB\u6267\u884C":"\u4EC5\u521B\u5EFA\u4EFB\u52A1",p=a=>{let v=z.find(S=>xe(S.cwd)===xe(a))?.id||"";me({cwd:a,workspaceId:v,...v===o.workspaceId?{}:{parentTaskId:"",milestoneId:ut(v)}})},Q=(0,r.jsxs)(T,{vertical:!0,gap:12,className:"new-work-paths",children:[(0,r.jsx)(B.Text,{strong:!0,children:"\u8FD0\u884C\u76EE\u5F55"}),(0,r.jsx)(Dt,{value:o.cwd,options:Le.map(a=>({value:a.path})),onChange:p,children:(0,r.jsx)(Qe,{autoFocus:!0,"aria-label":"\u65B0\u5DE5\u4F5C\u8FD0\u884C\u76EE\u5F55\u8DEF\u5F84",placeholder:"\u8F93\u5165\u76EE\u5F55\u8DEF\u5F84",onCompositionStart:rt.onCompositionStart,onCompositionEnd:rt.onCompositionEnd,onKeyDown:a=>{rt.shouldIgnore(a)||a.key==="Enter"&&(a.preventDefault(),Ue(!1),V(!1))}})}),G?.recentPaths.map(a=>(0,r.jsx)(U,{kind:"ghost",title:a.path,onClick:()=>{p(a.path),Ue(!1),V(!1)},children:a.path},a.path)),(0,r.jsx)(U,{onClick:()=>{Ue(!1),V(!1)},children:"\u5B8C\u6210"})]}),F=(0,r.jsx)(Gt,{owner:"task-create-properties",children:(0,r.jsx)(be,{layout:"vertical",component:!1,children:(0,r.jsxs)(T,{vertical:!0,gap:12,className:"task-board-create-library-dialog new-work-paths",children:[(0,r.jsx)(B.Text,{strong:!0,children:"\u4EFB\u52A1\u5C5E\u6027"}),(0,r.jsx)(be.Item,{label:"\u4EFB\u52A1\u6807\u9898\uFF08\u53EF\u9009\uFF09",style:{marginBottom:0},children:(0,r.jsx)(Qe,{autoFocus:!0,className:"task-board-create-title-input","aria-label":"\u4EFB\u52A1\u6807\u9898",value:o.title,maxLength:240,disabled:R,placeholder:"\u4E0D\u586B\u5199\u5219\u6309\u63CF\u8FF0\u81EA\u52A8\u751F\u6210",onChange:a=>me({title:a.currentTarget.value.replace(/\n/g,"")})})}),(0,r.jsxs)("div",{className:"task-board-create-properties",children:[(0,r.jsx)(Ae,{label:"\u9879\u76EE\u76EE\u5F55",children:(0,r.jsx)(Re,{ariaLabel:"\u6307\u5B9A\u9879\u76EE\u76EE\u5F55",value:Tn(o.workspaceId),options:Sn(z),searchable:!0,searchPlaceholder:"\u641C\u7D22\u9879\u76EE",disabled:R,onValueChange:a=>{let c=Nn(a)||"",v=z.find(S=>S.id===c);me({workspaceId:c,cwd:v?.cwd||"",...c===o.workspaceId?{}:{parentTaskId:"",milestoneId:ut(c)}})}})}),(0,r.jsx)(Ae,{label:"\u7236\u4EFB\u52A1",children:(0,r.jsx)(Re,{ariaLabel:"\u5F52\u5C5E\u7236\u4EFB\u52A1",value:o.parentTaskId||vn,options:xn(D,o.workspaceId||void 0,null,o.parentTaskId),searchable:!0,searchPlaceholder:"\u641C\u7D22\u4E3B\u4EFB\u52A1\u7F16\u53F7\u6216\u6807\u9898",disabled:R,onValueChange:a=>{let c=D.find(S=>S.id===a),v=z.find(S=>S.id===c?.workspaceId);me({parentTaskId:c?.id||"",...c?{workspaceId:c.workspaceId||"",cwd:v?.cwd||o.cwd,milestoneId:c.milestoneId||(c.workspaceId===o.workspaceId?o.milestoneId:ut(c.workspaceId||""))}:{}})}})}),(0,r.jsx)(Ae,{label:"\u4EFB\u52A1\u72B6\u6001",children:(0,r.jsx)(Re,{ariaLabel:"\u72B6\u6001",value:o.status,options:bn.map(a=>({value:a.status,label:a.label})),disabled:R,onValueChange:a=>me({status:a})})}),(0,r.jsx)(Ae,{label:"\u4F18\u5148\u7EA7",children:(0,r.jsx)(Re,{ariaLabel:"\u4F18\u5148\u7EA7",value:o.priority,options:Cn.map(a=>({value:a.value,label:a.label})),disabled:R,onValueChange:a=>me({priority:a})})}),(0,r.jsx)(Ae,{label:"\u622A\u6B62\u65E5\u671F",children:(0,r.jsx)(zn,{ariaLabel:"\u622A\u6B62\u65E5\u671F",value:o.dueDate,popupOwner:"task-create-properties",disabled:R,onValueChange:a=>me({dueDate:a})})}),(0,r.jsx)(Ae,{label:"\u8FED\u4EE3",children:(0,r.jsx)(_n,{value:o.milestoneId||null,workspaceId:o.workspaceId||null,disabled:R,onChange:a=>me({milestoneId:a||""})})}),(0,r.jsx)(Ae,{label:"\u6807\u7B7E",children:(0,r.jsx)(Qe,{"aria-label":"\u4EFB\u52A1\u6807\u7B7E",value:o.labels,placeholder:"\u7528\u9017\u53F7\u5206\u9694",disabled:R,onChange:a=>me({labels:a.currentTarget.value})})})]}),(0,r.jsx)(Ct,{checked:q,onCheckedChange:ge,ariaLabel:"\u521B\u5EFA\u66F4\u591A",label:"\u521B\u5EFA\u540E\u7EE7\u7EED\u521B\u5EFA",disabled:R})]})})}),Ne=(0,r.jsx)(Gt,{owner:"task-create-subject",children:(0,r.jsx)(be,{layout:"vertical",component:!1,children:(0,r.jsxs)(T,{vertical:!0,gap:12,className:"new-work-subject task-board-create-assign-controls",children:[(0,r.jsx)(B.Text,{strong:!0,children:"\u6267\u884C\u5BF9\u8C61"}),(0,r.jsx)(Kn,{agent:o.agent,catalog:wt,providerOptions:$e,ariaPrefix:"\u4EFB\u52A1",disabled:R,teams:C,teamId:o.subject.type==="team"?o.subject.id:"",employees:N,employeeId:o.subject.type==="employee"?o.subject.id:"",employeeOverride:o.employeeOverride,onTeamChange:()=>{},onEmployeeChange:()=>{},onChange:(a,c,v)=>{me({agent:a,subject:c||o.subject,employeeOverride:v===!0})}}),o.subject.type==="cli"?(0,r.jsxs)(r.Fragment,{children:[o.agent.mode==="full-access"?(0,r.jsx)(te,{type:"warning",className:"task-board-create-permission-note",title:"\u5B8C\u5168\u8BBF\u95EE\uFF1A\u5DE5\u5177\u4F1A\u81EA\u52A8\u786E\u8BA4\u6743\u9650\u8BF7\u6C42\u3002"}):null,(0,r.jsx)(Ct,{checked:m,onCheckedChange:I,ariaLabel:"\u540C\u65F6\u8BBE\u4E3A\u4EE5\u540E\u9ED8\u8BA4",label:"\u540C\u65F6\u8BBE\u4E3A\u4EE5\u540E\u9ED8\u8BA4",disabled:R}),(0,r.jsx)(B.Text,{type:"secondary",children:"\u521B\u5EFA\u6210\u529F\u540E\u751F\u6548\uFF1B\u4E0D\u6539\u53D8\u5DF2\u6709\u4EFB\u52A1\u6216\u4F1A\u8BDD\u3002"})]}):null]})})});return(0,r.jsxs)("section",{className:"new-work-page conversation-root task-create-page","aria-label":"\u65B0\u5EFA\u5DE5\u4F5C",children:[(0,r.jsxs)("div",{className:"new-work-context",children:[(0,r.jsx)(Mt,{task:!0,options:{...e,initialKind:e.initialKind||void 0,initialCwd:o.cwd,workspaceId:o.workspaceId,initialEmployeeId:o.subject.type==="employee"?o.subject.id:"",taskDraft:{...e.taskDraft,draftKey:l,scope:d,title:o.title,description:t.text,workspaceId:o.workspaceId,status:o.status,priority:o.priority,parentTaskId:o.parentTaskId,milestoneId:o.milestoneId,executionSubject:sn(o,t.text,!1).executionSubject,agent:o.agent}},disabled:R}),(0,r.jsxs)("h1",{children:["\u4ECA\u5929\u4F60\u60F3\u4E0E",(0,r.jsx)(ne,{ariaLabel:"\u9009\u62E9\u65B0\u5DE5\u4F5C\u5458\u5DE5",popupOwner:"task-create-subject",side:"bottom",open:ae,onOpenChange:_e,trigger:(0,r.jsxs)("button",{type:"button",disabled:R,className:"new-work-inline-trigger new-work-inline-avatar",title:`\u5F53\u524D\uFF1A${Je}\uFF0C\u70B9\u51FB\u66F4\u6362`,"aria-label":`\u9009\u62E9\u5458\u5DE5\uFF1A\u5F53\u524D\u4E3A ${Je}`,children:[he?(0,r.jsx)(Me,{employee:he,size:"sm"}):(0,r.jsx)("span",{className:"new-work-inline-avatar-fallback",children:(0,r.jsx)(x,{name:"spark"})}),(0,r.jsx)(x,{name:"chevronDown",size:12,className:"new-work-inline-arrow"})]}),children:Ne}),"\u5728",(0,r.jsx)(ne,{ariaLabel:"\u9009\u62E9\u65B0\u5DE5\u4F5C\u8FD0\u884C\u76EE\u5F55",side:"bottom",open:Ke,onOpenChange:V,trigger:(0,r.jsxs)("button",{type:"button",disabled:R,className:"new-work-inline-trigger new-work-inline-directory",title:o.cwd,"aria-label":`\u9009\u62E9\u8FD0\u884C\u76EE\u5F55\uFF1A\u5F53\u524D\u4E3A ${Ge}`,children:[(0,r.jsx)("span",{children:Ge}),(0,r.jsx)(x,{name:"chevronDown",size:12,className:"new-work-inline-arrow"})]}),children:Q}),"\u7684",(0,r.jsx)(ne,{ariaLabel:"\u7F16\u8F91\u65B0\u4EFB\u52A1",popupOwner:"task-create-properties",side:"bottom",open:ft,onOpenChange:j,trigger:(0,r.jsxs)("button",{type:"button",disabled:R,className:"new-work-inline-trigger new-work-inline-task",title:`\u4EFB\u52A1\u6807\u9898\uFF1A${o.title||"\u65B0\u4EFB\u52A1"}\uFF0C\u70B9\u51FB\u7F16\u8F91`,"aria-label":"\u4EFB\u52A1\u6807\u9898",children:[(0,r.jsx)(x,{name:"clipboard",size:14,className:"new-work-inline-task-icon"}),(0,r.jsx)("span",{className:"new-work-inline-task-name",children:o.title||"\u65B0\u4EFB\u52A1"}),(0,r.jsx)(x,{name:"chevronDown",size:12,className:"new-work-inline-arrow"})]}),children:F}),"\u4E2D\u521B\u9020\u4E9B\u4EC0\u4E48\uFF1F"]})]}),(0,r.jsxs)("div",{className:"conversation-composer new-work-composer",children:[(0,r.jsxs)("div",{className:"new-work-context-bar",children:[(0,r.jsx)("div",{className:"new-work-location",children:(0,r.jsx)(ne,{ariaLabel:"\u65B0\u5DE5\u4F5C\u8FD0\u884C\u76EE\u5F55",side:"top",open:Oe,onOpenChange:Ue,trigger:(0,r.jsxs)(U,{kind:"ghost",disabled:R,className:"new-work-directory",title:o.cwd,children:[(0,r.jsx)(x,{name:"folder"}),(0,r.jsx)("span",{children:Ge}),(0,r.jsx)(x,{name:"chevronDown",size:12})]}),children:Q})}),(0,r.jsx)(ne,{ariaLabel:"\u65B0\u5DE5\u4F5C\u6267\u884C\u5BF9\u8C61",popupOwner:"task-create-subject",side:"top",open:Bt,onOpenChange:Ut,trigger:(0,r.jsxs)(U,{kind:"ghost",disabled:R,className:"new-work-person",children:[(0,r.jsx)(x,{name:"spark"}),(0,r.jsx)("span",{className:"new-work-person-name",children:Je}),(0,r.jsx)(x,{name:"chevronDown",size:14})]}),children:Ne}),(0,r.jsx)(ne,{ariaLabel:"\u4EFB\u52A1\u5C5E\u6027",popupOwner:"task-create-properties",side:"top",open:Te,onOpenChange:ke,trigger:(0,r.jsxs)(U,{kind:"ghost",disabled:R,"aria-label":"\u4EFB\u52A1\u5C5E\u6027",children:[(0,r.jsx)(x,{name:"gear"}),"\u5C5E\u6027"]}),children:F})]}),pe?(0,r.jsx)(te,{type:"warning",title:pe}):null,J?(0,r.jsx)(te,{type:"error",role:"alert",title:J}):null,Z?(0,r.jsx)(te,{type:"warning",role:"status",title:Z}):null,t.attachments.length?(0,r.jsx)(te,{type:"info",title:"\u9644\u4EF6\u4FDD\u7559\u5728\u5F00\u59CB\u5DE5\u4F5C\u4E2D\uFF1B\u4EFB\u52A1\u8BA1\u5212\u53EA\u4FDD\u5B58\u6587\u5B57\u3002"}):null,H?(0,r.jsx)(U,{onClick:()=>yt(H),children:"\u6253\u5F00\u5DF2\u521B\u5EFA\u7684\u4EFB\u52A1"}):null,E?(0,r.jsx)(te,{type:"info",title:"\u6B64\u8349\u7A3F\u5DF2\u521B\u5EFA\u5DE5\u4F5C\uFF0C\u8BF7\u56DE\u5230\u5F00\u59CB\u5DE5\u4F5C\u6253\u5F00\u5DF2\u6709\u4F1A\u8BDD\u3002",action:(0,r.jsx)(U,{onClick:()=>h.open({...e,initialKind:e.initialKind||void 0,newTask:!1,taskDraft:{...e.taskDraft,draftKey:l}}),children:"\u6253\u5F00\u5DF2\u521B\u5EFA\u7684\u5DE5\u4F5C"})}):null,(0,r.jsx)(jt,{ref:k,expanded:_.expanded,text:t.text,onTextChange:a=>{M.edit(l,{text:a})},disabled:R,placeholder:"\u968F\u5FC3\u8F93\u5165\uFF0C\u63CF\u8FF0\u4F60\u60F3\u5B8C\u6210\u7684\u4E8B\u2026",ariaLabel:"\u4EFB\u52A1\u63CF\u8FF0",onSubmit:()=>{it()},header:t.attachments.length?(0,r.jsx)(Et,{items:t.attachments.map((a,c)=>({index:c,name:a.name,sizeLabel:`${a.size} B`,previewUrl:a.previewUrl||null})),onRemove:a=>{R||M.edit(l,{removeAttachment:a})}}):null,footer:(0,r.jsxs)(T,{justify:"space-between",align:"center",wrap:!0,gap:8,className:"conversation-action-row task-board-create-footer",children:[(0,r.jsxs)(T,{align:"center",gap:8,children:[(0,r.jsx)(Ct,{checked:W,onCheckedChange:Se,ariaLabel:"\u4FDD\u5B58\u5E76\u6D3E\u53D1",disabled:R}),(0,r.jsx)(B.Text,{children:W?"\u521B\u5EFA\u5E76\u5F00\u59CB\u6267\u884C":"\u4EC5\u521B\u5EFA\u4EFB\u52A1"}),(0,r.jsx)("span",{className:"composer-edit-action",children:_.control})]}),(0,r.jsx)(Rt,{stops:!1,phase:ie?"sending":Z?"unknown":J?"failed":"idle",label:s,disabled:R||!!t.attachments.length||!o.title.trim()&&!t.text.trim()||W&&!t.text.trim(),disabledReason:Z||(t.attachments.length?"\u8BF7\u56DE\u5F00\u59CB\u5DE5\u4F5C\u53D1\u9001\u9644\u4EF6\uFF0C\u6216\u5148\u79FB\u9664\u9644\u4EF6\u3002":!o.title.trim()&&!t.text.trim()?"\u8BF7\u586B\u5199\u4EFB\u52A1\u6807\u9898\u6216\u63CF\u8FF0\u3002":"\u8BF7\u586B\u5199\u672C\u6B21\u4EA4\u4ED8\u76EE\u6807\u3002"),onClick:()=>{it()}})]})})]})]})}var i=Y(we(),1);function ki(e){let n=f.useSyncExternalStore(ve.subscribe,ve.getSnapshot,ve.getSnapshot),l=f.useSyncExternalStore(M.subscribeReady,M.ready,()=>!1),d=f.useContext(qn);return n.open?(0,i.jsxs)(i.Fragment,{children:[!d&&(0,i.jsx)(eo,{}),l?n.newTask?(0,i.jsx)(bo,{options:n},n.revision):(0,i.jsx)(Wo,{...e},n.revision):(0,i.jsxs)(T,{align:"center",justify:"center",flex:1,role:"status",children:[(0,i.jsx)(Fe,{}),(0,i.jsx)("span",{children:"\u6B63\u5728\u51C6\u5907\u8F93\u5165\u670D\u52A1\u2026"})]})]}):null}function Wo({repository:e=mt}){let n=ve.getSnapshot(),l=n.taskDraft?.draftKey||bt(`new-work:${n.workspaceTaskId||n.workspaceId||"standalone"}`,null),[d,b]=f.useState(null),[t,k]=f.useState(null),[_,o]=f.useState(""),[O,re]=f.useState(!0),[z,K]=f.useState(!1),[D,$]=f.useState(()=>(h.getUnknownCreation(`draft:${l}`)||h.getUnknownCreation(n.workspaceTaskId||n.workspaceId||"standalone"))?.message||""),C=f.useRef(h.getAcceptedCreation(l)||null),le=f.useRef(!1),G=f.useRef(!0),[A,g]=f.useState(!1),[fe,ie]=f.useState(!1),[de,J]=f.useState(!1),[oe,Z]=f.useState(!1),[Ce,H]=f.useState(!1),[Ie,E]=f.useState(!1),[W,Se]=f.useState([]),m=f.useRef(null),I=Xe(),q=f.useRef(null),{employees:ge,loading:Te,error:ke}=qe({enabled:!0}),Oe=Hn(!n.workspaceTaskId&&!n.newTask),[Ue,Bt]=f.useState([]);f.useEffect(()=>{let s=!0;return dt.list().then(p=>{s&&Bt(p)}).catch(()=>{}),()=>{s=!1}},[]);let Ut=tt(!0),[ae,_e]=f.useState(()=>{let s=n.taskDraft?.executionSubject,p=s?.type==="employee"?s.agentOverride:s?.type==="cli"?n.taskDraft?.agent:void 0;return p?{provider:p.provider,engine:p.engine,model:p.model,thinkingEffort:p.thinkingEffort}:void 0}),Ke=f.useCallback(()=>M.revision(l),[l]);f.useSyncExternalStore(M.subscribe,Ke,Ke);let V=M.read(l),ft=Ot(l,()=>m.current?.inputElement);f.useLayoutEffect(()=>{Wt(),Pt(),Lt()},[]),f.useEffect(()=>(G.current=!0,()=>{G.current=!1}),[]),f.useEffect(()=>{let s=new AbortController;return e.load({signal:s.signal}).then(p=>{if(s.signal.aborted)return;b(p);let Q=ve.getRuntime()?.getContext(),F=n.taskDraft?.executionSubject,Ne=F?.type==="employee"?F.agentOverride:F?.type==="cli"?n.taskDraft?.agent:void 0,a=Ne?.provider||p.config.defaultProvider;k({provider:a,engine:Ne?.engine||p.config.defaultEngine,model:Ne?.model||"default",kind:n.initialKind||"structured",employeeId:F?.type==="employee"?F.id:F?void 0:n.initialEmployeeId||void 0,teamId:F?.type==="team"?F.id:void 0,specifiedCli:F?.type==="cli"||!!F?.agentOverride,mode:At(a,Ne?.mode||p.config.defaultMode),cwd:n.initialCwd||Q?.effectiveCwd||p.config.defaultCwd,worktreeEnabled:!1,workspaceId:n.workspaceId||void 0,workspaceTaskId:n.workspaceTaskId||void 0,taskName:n.newTask?"":void 0})}).catch(p=>{s.signal.aborted||o(De(p,"\u914D\u7F6E\u8BFB\u53D6\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u65B0\u5EFA\u3002"))}).finally(()=>{s.signal.aborted||re(!1)}),()=>s.abort()},[e]),f.useEffect(()=>{if(!t||Te||t.kind!=="structured"||t.employeeId||t.teamId||t.specifiedCli)return;let s=ge.find(p=>p.id===Yt)??ge[0];s&&k(p=>p&&{...p,employeeId:s.id})},[!!t,Te]),f.useEffect(()=>{if(!A&&!de||!t)return;let s=new AbortController,p=window.setTimeout(()=>{e.suggestPaths(t.cwd,{signal:s.signal}).then(Q=>{s.signal.aborted||Se(Q)}).catch(()=>{})},120);return()=>{s.abort(),clearTimeout(p)}},[A,de,t?.cwd,e]);let j=ge.find(s=>s.id===t?.employeeId),Le=Oe?.find(s=>s.id===t?.teamId),at=Ue.find(s=>s.cwd.replace(/\/+$/,"")===t?.cwd.trim().replace(/\/+$/,"")),We=n.workspaceTaskId||n.newTask?"":so(t?.workspaceId||at?.id,at?.kind),ye=t?.specifiedCli?{provider:t.provider,engine:t.engine,model:t.model||"default",thinkingEffort:ae?.thinkingEffort||"off",mode:ct(t.provider,t.mode),kind:"structured"}:j?.agents[0]??(t?{provider:t.provider,engine:t.engine,model:t.model||"default",thinkingEffort:"off",mode:ct(t.provider,t.mode),kind:"structured"}:void 0),ce=ye&&ae?{...ye,...ae,mode:ct(ae.provider,ye.mode)}:ye,N=z||!!D||!!C.current,P=t&&ae&&t.kind!=="shell"?{...t,provider:ae.provider,engine:t.kind==="pty"?"cli":ae.engine,model:ae.model,mode:ct(ae.provider,ye?.mode||t.mode),specifiedCli:!0}:t,pe=P&&{...P,provider:P.specifiedCli||!j?P.provider:ce?.provider||P.provider,engine:P.specifiedCli||!j?P.engine:ce?.engine||P.engine,mode:At(P.specifiedCli||!j?P.provider:ce?.provider||P.provider,P.specifiedCli||!j?P.mode:ce?.mode||P.mode)},wt=!t||!d?"\u5DE5\u4F5C\u914D\u7F6E\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u65B0\u5EFA\u3002":t.cwd.trim()?t.taskName!==void 0&&!t.taskName.trim()?"\u8BF7\u5148\u8F93\u5165\u4EFB\u52A1\u540D\u79F0\uFF0C\u6216\u9009\u62E9\u9ED8\u8BA4\u4EFB\u52A1\u3002":t.kind==="structured"&&!V.text.trim()&&!V.attachments.length?"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u5185\u5BB9\u6216\u6DFB\u52A0\u9644\u4EF6\u3002":t.kind==="structured"&&t.employeeId&&!j?"\u5F53\u524D\u5458\u5DE5\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u5458\u5DE5\u6216\u6267\u884C\u5DE5\u5177\u3002":t.kind==="structured"&&j&&!j.agents.length?"\u5F53\u524D\u5458\u5DE5\u6CA1\u6709\u6267\u884C\u914D\u7F6E\uFF0C\u8BF7\u66F4\u6362\u5458\u5DE5\u6216\u914D\u7F6E\u5019\u9009\u5DE5\u5177\u3002":t.kind==="structured"&&!j&&!Le&&!t.specifiedCli?"\u8BF7\u5148\u9009\u62E9\u5458\u5DE5\u3001\u56E2\u961F\u6216\u6267\u884C\u5DE5\u5177\u3002":t.teamId&&!We?"\u56E2\u961F\u5DE5\u4F5C\u9700\u8981\u5DF2\u6709\u9879\u76EE\uFF0C\u8BF7\u66F4\u6362\u8FD0\u884C\u76EE\u5F55\u3002":t.teamId&&V.attachments.length?"\u56E2\u961F\u5DE5\u4F5C\u6682\u4E0D\u652F\u6301\u9644\u4EF6\uFF0C\u8BF7\u5148\u79FB\u9664\u9644\u4EF6\u3002":"":"\u8BF7\u5148\u9009\u62E9\u8FD0\u884C\u76EE\u5F55\u3002",gt=!wt,$e=D||(C.current?"\u5DE5\u4F5C\u5DF2\u521B\u5EFA\uFF0C\u8BF7\u6253\u5F00\u5DF2\u521B\u5EFA\u7684\u5DE5\u4F5C\uFF1B\u4E0D\u8981\u91CD\u590D\u63D0\u4EA4\u3002":"")||(z?"\u6B63\u5728\u521B\u5EFA\u5DE5\u4F5C\uFF0C\u8BF7\u52FF\u91CD\u590D\u63D0\u4EA4\u3002":""),rt=$e||wt,kt=f.useId(),me=s=>{ie(!1),g(!1),H(!1),E(!1),Z(!1),J(!1),k(p=>p&&{...p,kind:s,teamId:void 0,employeeId:s==="structured"?j?.id||ge.find(Q=>Q.id===Yt)?.id||ge[0]?.id:void 0,mode:p.mode==="full-access"?"default":p.mode,engine:s==="pty"?"cli":p.engine})},he=s=>{let p=s?.status;if(p&&p>=400&&p<500&&p!==408&&p!==409)return;let Q="\u521B\u5EFA\u7ED3\u679C\u672A\u786E\u8BA4\uFF0C\u8BF7\u5148\u6838\u5BF9\u4EFB\u52A1\u548C\u4F1A\u8BDD\u5217\u8868\uFF0C\u4E0D\u8981\u91CD\u590D\u521B\u5EFA\uFF1B\u672C\u9875\u8F93\u5165\u4FDD\u7559\u3002";h.markUnknownCreation({scope:n.workspaceTaskId||n.workspaceId||"standalone",message:Q}),h.markUnknownCreation({scope:`draft:${l}`,message:Q}),t?.teamId&&M.edit(l,{text:V.text,expectedRevision:V.revision,persist:!1}),$(Q)},He=async()=>{let s=n.workspaceTaskId||n.workspaceId||"standalone",p=h.getUnknownCreation(`draft:${l}`)||h.getUnknownCreation(s);if(p){$(p.message);return}if(!t||!d||le.current||D||!gt)return;let Q=ve.getRuntime();if(!Q){o("\u8FD0\u884C\u73AF\u5883\u672A\u5C31\u7EEA\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u8BD5\uFF1B\u8349\u7A3F\u4FDD\u7559\u3002");return}le.current=!0,K(!0),o(""),ie(!1),g(!1),H(!1),E(!1),Z(!1),J(!1),h.setDismissable(!1);try{if(t.teamId){if(V.attachments.length)throw new Error("\u56E2\u961F\u65B0\u5DE5\u4F5C\u6682\u4E0D\u652F\u6301\u9644\u4EF6\uFF0C\u8BF7\u5148\u79FB\u9664\u9644\u4EF6\u540E\u5F00\u5DE5\u3002");if(!We)throw new Error("\u56E2\u961F\u5DE5\u4F5C\u9700\u8981\u5DF2\u5B58\u5728\u7684\u9879\u76EE\uFF0C\u8BF7\u66F4\u6362\u8FD0\u884C\u76EE\u5F55\u540E\u91CD\u8BD5\u3002");let c=await et.startDirect(t.teamId,{workspaceId:We,note:V.text}).then(v=>{if(!v?.run?.id)throw new Error("\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u56E2\u961F\u8FD0\u884C ID\u3002");return v}).catch(v=>{throw he(v),v});await et.settle("success"),M.edit(l,{acknowledgeRevision:V.revision}),h.close(),c.run.chatSessionId?Be.open("","","teamchat",c.run.id):Be.open("","","teams"),lt();return}let F=await wo(t,t.cwd,dt);if(F!==t&&(k(F),lt()),!C.current){let c=ae&&F.kind!=="shell",v=c?{...F,provider:P.provider,engine:P.engine,model:P.model,mode:P.mode,specifiedCli:!0}:F,S={...Q.getContext(),thinkingEffort:c?ae.thinkingEffort:ye?.thinkingEffort||"off"},y=fo(v,d.config,S),Pe=await Q.prepareCreate(y.kind,y);y.kind!=="structured"&&Object.assign(y,Pe);let L;try{L=await e.create(y)}catch(X){throw he(X),X}C.current={request:y,created:L},h.setAcceptedCreation(l,C.current)}let{request:Ne,created:a}=C.current;await Q.completeCreate(Ne,a,V.text||V.attachments.length?{key:l,revision:V.revision}:void 0),h.setAcceptedCreation(l,null),h.close()}catch(F){t.teamId&&await et.settle("error"),G.current&&o(De(F,"\u521B\u5EFA\u672A\u5B8C\u6210\uFF0C\u8F93\u5165\u5DF2\u4FDD\u7559\u3002"))}finally{le.current=!1,h.setDismissable(!0),G.current&&K(!1)}},R=t?.kind==="shell"?"\u8F93\u5165\u542F\u52A8\u540E\u8981\u6267\u884C\u7684\u547D\u4EE4\uFF08\u53EF\u9009\uFF09\u2026":t?.kind==="pty"?"\u8F93\u5165\u8981\u4EA4\u7ED9 CLI \u7684\u5185\u5BB9\uFF08\u53EF\u9009\uFF09\u2026":"\u968F\u5FC3\u8F93\u5165\uFF0C\u63CF\u8FF0\u4F60\u60F3\u5B8C\u6210\u7684\u4E8B\u2026",Ve=at?.name||t?.cwd.trim().split("/").filter(Boolean).at(-1)||"Wand",yt=pe?.kind==="shell"?"\u7CFB\u7EDF Shell":{managed:"\u6258\u7BA1\u6267\u884C","full-access":"\u5B8C\u5168\u8BBF\u95EE","auto-edit":"\u81EA\u52A8\u7F16\u8F91",native:"\u539F\u751F\u6A21\u5F0F",default:"\u6807\u51C6\u6743\u9650"}[pe?.mode||"default"],it={initialCwd:t?.cwd,initialEmployeeId:t?.employeeId,initialKind:t?.kind,workspaceId:t?.workspaceId,taskDraft:{...n.taskDraft,draftKey:l,workspaceId:t?.workspaceId||"",executionSubject:t?.teamId?{type:"team",id:t.teamId}:t?.employeeId?{type:"employee",id:t.employeeId,...ae&&ce?{agentOverride:ce}:{}}:t?.specifiedCli?{type:"cli",id:t.provider}:void 0,agent:ce}},_t=()=>{h.open({...it,newTask:!0})},Ge=d&&t?(0,i.jsxs)(T,{vertical:!0,gap:12,className:"new-work-paths",children:[(0,i.jsx)(B.Text,{strong:!0,children:"\u8FD0\u884C\u76EE\u5F55"}),(0,i.jsx)(Dt,{value:t.cwd,options:W.map(s=>({value:s.path})),onChange:s=>k({...t,cwd:s,workspaceId:void 0}),children:(0,i.jsx)(Qe,{autoFocus:!0,"aria-label":"\u65B0\u5DE5\u4F5C\u8FD0\u884C\u76EE\u5F55\u8DEF\u5F84",placeholder:"\u8F93\u5165\u76EE\u5F55\u8DEF\u5F84",onCompositionStart:I.onCompositionStart,onCompositionEnd:I.onCompositionEnd,onKeyDown:s=>{s.key==="Enter"&&!I.shouldIgnore(s)&&(s.preventDefault(),g(!1),J(!1))}})}),d.recentPaths.map(s=>(0,i.jsx)(U,{kind:"ghost",title:s.path,onClick:()=>{k({...t,cwd:s.path,workspaceId:void 0}),g(!1),J(!1)},children:s.path},s.path)),(0,i.jsx)(U,{onClick:()=>{g(!1),J(!1)},children:"\u5B8C\u6210"})]}):null,Je=(0,i.jsx)("div",{className:"new-work-subject",children:(0,i.jsx)(po,{selectedSubject:t?.teamId?{type:"team",id:t.teamId}:t?.specifiedCli&&!t.employeeId?{type:"cli",id:t.provider,engine:t.engine}:{type:"employee",id:t?.employeeId||""},kind:"structured",model:"default",showKind:!1,showModel:!1,teams:Oe?.map($n),teamWorkspaceId:We,onKindChange:me,onModelChange:()=>{},onSubjectChange:s=>{s.type!=="cli"&&_e(void 0),s.type==="cli"&&s.id!=="shell"&&_e({provider:s.id,engine:s.engine,model:"default",thinkingEffort:"off"}),k(p=>p&&(s.type==="employee"?{...p,employeeId:s.id,teamId:void 0,specifiedCli:!1}:s.type==="team"?{...p,teamId:s.id,employeeId:void 0,specifiedCli:!1}:{...p,employeeId:void 0,teamId:void 0,specifiedCli:!0,kind:s.id==="shell"?"shell":p.kind,provider:s.id==="shell"?p.provider:s.id,engine:s.engine,mode:p.mode==="full-access"?"default":p.mode})),ie(!1),Z(!1)}})});return(0,i.jsx)("section",{className:"new-work-page conversation-root","aria-label":"\u65B0\u5EFA\u5DE5\u4F5C",children:O||Te?(0,i.jsxs)(T,{align:"center",justify:"center",flex:1,children:[(0,i.jsx)(Fe,{}),(0,i.jsx)("span",{children:"\u6B63\u5728\u8BFB\u53D6\u5DE5\u4F5C\u914D\u7F6E\u2026"})]}):t&&d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"new-work-context",children:[n.workspaceTaskId?null:(0,i.jsx)(Mt,{task:!1,options:it,disabled:N}),(0,i.jsx)("h1",{children:t.kind==="structured"?(0,i.jsxs)(i.Fragment,{children:["\u4ECA\u5929\u4F60\u60F3\u4E0E",(0,i.jsx)(ne,{ariaLabel:"\u9009\u62E9\u65B0\u5DE5\u4F5C\u5458\u5DE5",side:"bottom",open:oe,onOpenChange:Z,trigger:(0,i.jsxs)("button",{type:"button",disabled:N,className:"new-work-inline-trigger new-work-inline-avatar",title:`\u5F53\u524D\uFF1A${j?.name||Le?.name||"\u9009\u62E9\u5458\u5DE5"}\uFF0C\u70B9\u51FB\u66F4\u6362`,"aria-label":`\u9009\u62E9\u5458\u5DE5\uFF1A\u5F53\u524D\u4E3A ${j?.name||Le?.name||"\u9ED8\u8BA4\u4F19\u4F34"}`,children:[j?(0,i.jsx)(Me,{employee:j,size:"sm"}):(0,i.jsx)("span",{className:"new-work-inline-avatar-fallback",children:(0,i.jsx)(x,{name:"spark"})}),(0,i.jsx)(x,{name:"chevronDown",size:12,className:"new-work-inline-arrow"})]}),children:Je}),"\u5728",(0,i.jsx)(ne,{ariaLabel:"\u9009\u62E9\u65B0\u5DE5\u4F5C\u8FD0\u884C\u76EE\u5F55",side:"bottom",open:de,onOpenChange:J,trigger:(0,i.jsxs)("button",{type:"button",disabled:N||!!t.workspaceTaskId,className:"new-work-inline-trigger new-work-inline-directory",title:t.cwd,"aria-label":`\u9009\u62E9\u8FD0\u884C\u76EE\u5F55\uFF1A\u5F53\u524D\u4E3A ${Ve}`,children:[(0,i.jsx)("span",{children:Ve}),(0,i.jsx)(x,{name:"chevronDown",size:12,className:"new-work-inline-arrow"})]}),children:Ge}),"\u7684",(0,i.jsx)(an,{form:t,initialName:n.taskName,disabled:N||!!n.workspaceTaskId,cwd:t.cwd,onChange:k,onCreateTask:_t,inline:!0}),"\u4E2D\u521B\u9020\u4E9B\u4EC0\u4E48\uFF1F"]}):t.kind==="pty"?"\u4ECE\u8FD9\u91CC\u5F00\u59CB CLI \u5DE5\u4F5C":"\u4ECE\u8FD9\u91CC\u6253\u5F00\u7A7A\u767D\u7EC8\u7AEF"}),n.workspaceTaskId?(0,i.jsx)(B.Text,{type:"secondary",children:"\u5F53\u524D\u4EFB\u52A1\u4F7F\u7528\u65E2\u6709\u5DE5\u4F5C\u76EE\u5F55"}):null,t.kind!=="structured"?(0,i.jsx)(an,{form:t,initialName:n.taskName,disabled:N||!!n.workspaceTaskId,cwd:t.cwd,onChange:k,onCreateTask:_t}):null]}),(0,i.jsxs)("div",{className:"conversation-composer new-work-composer",children:[$e?(0,i.jsx)(T,{vertical:!0,gap:4,className:"new-work-submit-status",id:kt,children:(0,i.jsx)(B.Text,{type:D?"warning":"secondary",role:"status",children:$e})}):null,(0,i.jsxs)("div",{className:"new-work-context-bar",children:[(0,i.jsx)("div",{className:"new-work-location",children:(0,i.jsx)(ne,{ariaLabel:"\u65B0\u5DE5\u4F5C\u8FD0\u884C\u76EE\u5F55",side:"top",open:A,onOpenChange:g,trigger:(0,i.jsxs)(U,{kind:"ghost",disabled:N||!!t.workspaceTaskId,className:"new-work-directory",title:t.cwd,children:[(0,i.jsx)(x,{name:"folder"}),(0,i.jsx)("span",{children:Ve}),(0,i.jsx)(x,{name:"chevronDown",size:12})]}),children:Ge})}),t.kind==="structured"?(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ne,{ariaLabel:"\u65B0\u5DE5\u4F5C\u6267\u884C\u5BF9\u8C61",side:"top",open:fe,onOpenChange:ie,trigger:(0,i.jsxs)(U,{kind:"ghost",disabled:N,className:"new-work-person",children:[j?(0,i.jsx)(Me,{employee:j,size:"sm"}):(0,i.jsx)(x,{name:"spark"}),(0,i.jsx)("span",{className:"new-work-person-name",title:j?.name||Le?.name,children:j?.name||Le?.name||(t.specifiedCli?st(t.provider,t.engine):"\u9009\u62E9\u5458\u5DE5")}),(0,i.jsx)(x,{name:"chevronDown",size:14})]}),children:Je})}):null,(0,i.jsx)(ne,{ariaLabel:"\u65B0\u5DE5\u4F5C\u754C\u9762\u8BBE\u7F6E",side:"top",open:Ce,onOpenChange:H,trigger:(0,i.jsx)(Jt,{"aria-label":"\u65B0\u5DE5\u4F5C\u8BBE\u7F6E",disabled:N,children:(0,i.jsx)(x,{name:"gear"})}),children:(0,i.jsxs)(T,{vertical:!0,gap:12,children:[(0,i.jsx)(B.Text,{strong:!0,children:"\u5DE5\u4F5C\u7C7B\u578B"}),(0,i.jsx)(It,{ariaLabel:"\u5DE5\u4F5C\u7C7B\u578B",value:t.kind,onValueChange:s=>me(s),tabs:[{value:"structured",label:"\u5BF9\u8BDD",content:null,disabled:N},{value:"pty",label:"CLI \u7EC8\u7AEF",content:null,disabled:N},{value:"shell",label:"\u7A7A\u767D\u7EC8\u7AEF",content:null,disabled:N}]})]})})]}),ke?(0,i.jsx)(te,{type:"error",title:ke}):null,_?(0,i.jsx)(te,{type:"error",role:"alert",title:_}):null,C.current?(0,i.jsx)(U,{onClick:()=>{let s=C.current;ve.getRuntime()?.completeCreate(s.request,s.created).then(()=>{h.setAcceptedCreation(l,null),h.close()}).catch(p=>o(De(p,"\u6253\u5F00\u5DE5\u4F5C\u5931\u8D25\uFF0C\u8BF7\u4ECE\u4F1A\u8BDD\u5217\u8868\u91CD\u8BD5\u3002")))},children:"\u6253\u5F00\u5DF2\u521B\u5EFA\u7684\u5DE5\u4F5C\uFF08\u672C\u9875\u8349\u7A3F\u4FDD\u7559\uFF09"}):null,(0,i.jsx)(jt,{ref:m,text:V.text,disabled:N,placeholder:R,expanded:ft.expanded,onTextChange:s=>M.edit(l,{text:s}),onSubmit:()=>{He()},header:V.attachments.length?(0,i.jsx)(Et,{items:V.attachments.map((s,p)=>({index:p,name:s.name,sizeLabel:`${s.size} B`,previewUrl:s.previewUrl||null})),onRemove:s=>{N||M.edit(l,{removeAttachment:s})}}):null,footer:(0,i.jsxs)(T,{justify:"space-between",align:"center",className:"conversation-action-row",children:[(0,i.jsxs)(T,{gap:4,align:"center",className:"new-work-actions",children:[(0,i.jsx)(ne,{ariaLabel:"\u65B0\u5DE5\u4F5C\u66F4\u591A\u9009\u9879",side:"top",open:Ie,onOpenChange:E,trigger:(0,i.jsx)(Jt,{"aria-label":"\u66F4\u591A\u65B0\u5DE5\u4F5C\u9009\u9879",disabled:N,children:(0,i.jsx)(Bn,{active:Ie,from:"plus",to:"close"})}),children:(0,i.jsxs)(T,{vertical:!0,gap:12,children:[(0,i.jsxs)(U,{disabled:N||t.kind==="shell",onClick:()=>{E(!1),q.current?.click()},children:[(0,i.jsx)(x,{name:"paperclip"}),"\u6DFB\u52A0\u9644\u4EF6"]}),pe?(0,i.jsx)(B.Text,{type:"secondary",children:rn(pe)}):null,j&&(ae||t.specifiedCli)?(0,i.jsx)(U,{"aria-label":"\u6062\u590D\u5458\u5DE5\u9ED8\u8BA4\u6267\u884C\u914D\u7F6E",disabled:N,onClick:()=>{_e(void 0),k(s=>s&&{...s,specifiedCli:!1}),E(!1)},children:"\u6062\u590D\u5458\u5DE5\u9ED8\u8BA4\u6267\u884C\u914D\u7F6E"}):null]})}),(0,i.jsxs)("span",{className:"new-work-permission","data-automatic":!t.teamId&&pe&&ko(pe),title:t.teamId?"\u56E2\u961F\u6210\u5458\u5206\u522B\u4F7F\u7528\u5404\u81EA\u7684\u6267\u884C\u914D\u7F6E":pe?rn(pe):void 0,children:[(0,i.jsx)(x,{name:"shield",size:14}),t.teamId?"\u56E2\u961F\u914D\u7F6E":yt]}),(0,i.jsx)("span",{className:"composer-edit-action",children:ft.control})]}),(0,i.jsxs)(T,{gap:4,align:"center",className:"new-work-send-actions",children:[t.kind!=="shell"&&ce&&!t.teamId?(0,i.jsx)("div",{className:"conversation-runtime-summary",children:(0,i.jsx)(to,{agent:t.kind==="pty"?{...ce,engine:"cli"}:ce,catalog:Ut,disabled:N,cliOnly:t.kind==="pty",onChange:_e})}):null,(0,i.jsx)(Rt,{stops:!1,phase:z?"sending":_?"failed":"idle",label:t.kind==="structured"?"\u5F00\u59CB\u5DE5\u4F5C":"\u6253\u5F00\u7EC8\u7AEF",disabled:N||!gt,disabledReason:rt,descriptionId:$e?kt:void 0,onClick:()=>{He()}})]})]})}),(0,i.jsx)("input",{ref:q,hidden:!0,type:"file",multiple:!0,onChange:s=>{if(!N)for(let p of Array.from(s.currentTarget.files||[]))M.edit(l,{addAttachment:{file:p,name:p.name,size:p.size}});s.currentTarget.value=""}})]})]}):(0,i.jsx)(te,{type:"error",title:_||"\u914D\u7F6E\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u65B0\u5EFA\u3002"})})}export{ki as NewSessionHost};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{shared36_e as rt}from"/assets/modules/
|
|
1
|
+
import{shared36_e as rt}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared13_aa as nt,shared13_y as ot}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared11_a as mt}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared5_c as ht}from"/assets/modules/069f5a4267b0a9e3/runtime.js";var V=ht(mt());var lt=t=>typeof t=="object"&&t!=null&&t.nodeType===1,it=(t,o)=>(!o||t!=="hidden")&&t!=="visible"&&t!=="clip",L=(t,o)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){let r=getComputedStyle(t,null);return it(r.overflowY,o)||it(r.overflowX,o)||(i=>{let n=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(i);return!!n&&(n.clientHeight<i.scrollHeight||n.clientWidth<i.scrollWidth)})(t)}return!1},D=(t,o,r,i,n,e,s,c)=>e<t&&s>o||e>t&&s<o?0:e<=t&&c<=r||s>=o&&c>=r?e-t-i:s>o&&c<r||e<t&&c>r?s-o+n:0,pt=t=>{let o=t.parentElement;return o??(t.getRootNode().host||null)},G=(t,o)=>{var r,i,n,e;if(typeof document>"u")return[];let{scrollMode:s,block:c,inline:f,boundary:j,skipOverflowHiddenElements:at}=o,ut=typeof j=="function"?j:p=>p!==j;if(!lt(t))throw new TypeError("Invalid target");let A=document.scrollingElement||document.documentElement,M=[],d=t;for(;lt(d)&&ut(d);){if(d=pt(d),d===A){M.push(d);break}d!=null&&d===document.body&&L(d)&&!L(document.documentElement)||d!=null&&L(d,at)&&M.push(d)}let g=(i=(r=window.visualViewport)==null?void 0:r.width)!=null?i:innerWidth,w=(e=(n=window.visualViewport)==null?void 0:n.height)!=null?e:innerHeight,{scrollX:b,scrollY:F}=window,{height:y,width:I,top:v,right:O,bottom:P,left:R}=t.getBoundingClientRect(),{top:K,right:Q,bottom:U,left:Z}=(p=>{let l=window.getComputedStyle(p);return{top:parseFloat(l.scrollMarginTop)||0,right:parseFloat(l.scrollMarginRight)||0,bottom:parseFloat(l.scrollMarginBottom)||0,left:parseFloat(l.scrollMarginLeft)||0}})(t),a=c==="start"||c==="nearest"?v-K:c==="end"?P+U:v+y/2-K+U,u=f==="center"?R+I/2-Z+Q:f==="end"?O+Q:R-Z,$=[];for(let p=0;p<M.length;p++){let l=M[p],{height:W,width:N,top:H,right:X,bottom:Y,left:x}=l.getBoundingClientRect();if(s==="if-needed"&&v>=0&&R>=0&&P<=w&&O<=g&&(l===A&&!L(l)||v>=H&&P<=Y&&R>=x&&O<=X))return $;let _=getComputedStyle(l),E=parseInt(_.borderLeftWidth,10),T=parseInt(_.borderTopWidth,10),k=parseInt(_.borderRightWidth,10),B=parseInt(_.borderBottomWidth,10),h=0,m=0,C="offsetWidth"in l?l.offsetWidth-l.clientWidth-E-k:0,S="offsetHeight"in l?l.offsetHeight-l.clientHeight-T-B:0,q="offsetWidth"in l?l.offsetWidth===0?0:N/l.offsetWidth:0,z="offsetHeight"in l?l.offsetHeight===0?0:W/l.offsetHeight:0;if(A===l)h=c==="start"?a:c==="end"?a-w:c==="nearest"?D(F,F+w,w,T,B,F+a,F+a+y,y):a-w/2,m=f==="start"?u:f==="center"?u-g/2:f==="end"?u-g:D(b,b+g,g,E,k,b+u,b+u+I,I),h=Math.max(0,h+F),m=Math.max(0,m+b);else{h=c==="start"?a-H-T:c==="end"?a-Y+B+S:c==="nearest"?D(H,Y,W,T,B+S,a,a+y,y):a-(H+W/2)+S/2,m=f==="start"?u-x-E:f==="center"?u-(x+N/2)+C/2:f==="end"?u-X+k+C:D(x,X,N,E,k+C,u,u+I,I);let{scrollLeft:tt,scrollTop:et}=l;h=z===0?0:Math.max(0,Math.min(et+h/z,l.scrollHeight-W/z+S)),m=q===0?0:Math.max(0,Math.min(tt+m/q,l.scrollWidth-N/q+C)),a+=et-h,u+=tt-m}$.push({el:l,top:h,left:m})}return $};var gt=t=>t===!1?{block:"end",inline:"nearest"}:(o=>o===Object(o)&&Object.keys(o).length!==0)(t)?t:{block:"start",inline:"nearest"};function st(t,o){if(!t.isConnected||!(n=>{let e=n;for(;e&&e.parentNode;){if(e.parentNode===document)return!0;e=e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}return!1})(t))return;let r=(n=>{let e=window.getComputedStyle(n);return{top:parseFloat(e.scrollMarginTop)||0,right:parseFloat(e.scrollMarginRight)||0,bottom:parseFloat(e.scrollMarginBottom)||0,left:parseFloat(e.scrollMarginLeft)||0}})(t);if((n=>typeof n=="object"&&typeof n.behavior=="function")(o))return o.behavior(G(t,o));let i=typeof o=="boolean"||o==null?void 0:o.behavior;for(let{el:n,top:e,left:s}of G(t,gt(o))){let c=e-r.top+r.bottom,f=s-r.left+r.right;n.scroll({top:c,left:f,behavior:i})}}var wt=["parentNode"],bt="form_item";function J(t){return t===void 0||t===!1?[]:Array.isArray(t)?t:[t]}function ct(t,o){if(!t.length)return;let r=t.join("_");return o?`${o}_${r}`:wt.includes(r)?`${bt}_${r}`:r}function vt(t,o,r,i,n,e){let s=i;return e!==void 0?s=e:r.validating?s="validating":t.length?s="error":o.length?s="warning":(r.touched||n&&r.validated)&&(s="success"),s}function ft(t){return J(t).join("_")}function dt(t,o){let r=o.getFieldInstance(t),i=ot(r);if(i)return i;let n=ct(J(t),o.__INTERNAL__.name);if(n)return document.getElementById(n)}function Ft(t){let[o]=rt(),r=V.useRef({}),i=V.useMemo(()=>t??{...o,__INTERNAL__:{itemRef:n=>e=>{let s=ft(n);e?r.current[s]=e:delete r.current[s]}},scrollToField:(n,e={})=>{let{focus:s,...c}=e,f=dt(n,i);f&&(st(f,{scrollMode:"if-needed",block:"nearest",...c}),s&&i.focusField(n))},focusField:n=>{let e=i.getFieldInstance(n);nt(e?.focus)?e.focus():dt(n,i)?.focus?.()},getFieldInstance:n=>{let e=ft(n);return r.current[e]}},[t,o]);return[i]}export{J as a,ct as b,vt as c,ft as d,Ft as e};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
const __wandCssTextPool = Object.freeze([".wand-code-editor-host[hidden]{display:none!important}.wand-code-editor-body{position:relative;flex:1 1 auto;min-height:0;overflow:hidden;display:flex;background:var(--bg-primary, #fff)}.wand-code-editor-lines{flex:0 0 auto;margin:0;padding:12px 8px 12px 12px;text-align:right;color:var(--text-muted, #999);font-family:var(--font-mono, ui-monospace, monospace);line-height:1.55;white-space:pre;user-select:none;overflow:hidden;tab-size:2}.wand-code-editor-area{position:relative;flex:1 1 auto;min-width:0;overflow:auto}.wand-code-editor-markdown{flex:1 1 auto;min-width:0;min-height:0;overflow:auto;background:var(--bg-primary, #fff);overscroll-behavior:contain}.wand-code-editor-markdown:focus-visible{outline:2px solid var(--accent, #2563eb);outline-offset:-2px}.wand-code-editor-content,.wand-code-editor-textarea{margin:0;padding:12px 14px;border:0;font-family:var(--font-mono, ui-monospace, monospace);font-size:inherit;line-height:1.55;white-space:pre;tab-size:2;word-break:normal;overflow-wrap:normal}.wand-code-editor-content{position:absolute;inset:0;pointer-events:none;color:var(--text-primary, #111);overflow:hidden;scrollbar-gutter:stable}.wand-code-editor-content code{font-family:inherit}.wand-code-editor-textarea{position:absolute;inset:0;width:100%;height:100%;background:transparent;color:transparent;caret-color:var(--text-primary, #111);resize:none;outline:none;overflow:auto;scrollbar-gutter:stable}.wand-code-editor-textarea::selection{background:var(--selection-bg)}.wand-code-editor-host.wrap .wand-code-editor-content,.wand-code-editor-host.wrap .wand-code-editor-textarea{white-space:pre-wrap;overflow-wrap:break-word}.wand-code-editor-content .wand-file-preview-syntax-keyword{color:var(--syntax-keyword)}.wand-code-editor-content .wand-file-preview-syntax-string{color:var(--syntax-string)}.wand-code-editor-content .wand-file-preview-syntax-number{color:var(--syntax-number)}.wand-code-editor-content .wand-file-preview-syntax-comment{color:var(--syntax-comment);font-style:italic}.wand-code-editor-content .wand-file-preview-syntax-operator{color:var(--syntax-operator)}.wand-code-editor-content mark.wand-code-editor-hit{background:var(--find-highlight-bg);color:inherit;border-radius:2px}.wand-code-editor-content mark.wand-code-editor-hit.active{background:var(--find-active-bg);box-shadow:0 0 0 1px var(--warning)}\n"]);
|
|
3
|
-
import{
|
|
3
|
+
import{shared109_a as L,shared109_b as V,shared109_c as z,shared109_d as N}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{a as O}from"/assets/modules/54c22eddaf009d00/chunk.js";import{a as H}from"/assets/modules/b79c15aace456028/chunk.js";import"/assets/modules/54aaf60ac85dcb2b/chunk.js";import{shared46_a as j}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared121_a as D}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared24_a as A}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared54_a as k,shared54_b as E}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared41_c as R}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import"/assets/modules/7dce56c1987e8d43/chunk.js";import"/assets/modules/b945370f1fa784f9/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import"/assets/modules/aff19b31898aa157/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{a as Q,d as q}from"/assets/modules/96fe39f39930d9e4/chunk.js";import"/assets/modules/d569c96d4acfdec3/chunk.js";import"/assets/modules/c2f7bb50118f1603/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared78_j as B,shared78_l as _}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared55_a as W}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared60_a as I}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import"/assets/modules/33daaeb4bf68c7ba/chunk.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared47_a as K}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared61_a as b}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import "/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared13_zb as $}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared11_a as P}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared5_c as F}from"/assets/modules/069f5a4267b0a9e3/runtime.js";var x=F(P(),1),h=F(P(),1);var X=__wandCssTextPool[0];var t=F($(),1);function s(e){z.execute(e)}function J(e,a){let u=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),d=a;for(let c=u.nextNode();c;c=u.nextNode()){let l=c.textContent?.length??0;if(d>=l){d-=l;continue}let i=e.ownerDocument.createRange();i.setStart(c,Math.min(d,l)),i.setEnd(c,Math.min(d+1,l));let o=i.getBoundingClientRect();return o.height>0||o.width>0?o:null}return null}function U({content:e,ranges:a,activeRange:u}){let d=_(e);if(a.length===0)return(0,t.jsx)("code",{children:d.map((o,v)=>o.kind?(0,t.jsx)("span",{className:`wand-file-preview-syntax-${o.kind}`,children:o.value},v):(0,t.jsx)(h.Fragment,{children:o.value},v))});let c=[],l=0,i=0;return d.forEach((o,v)=>{let f=l,p=l+o.value.length;for(l=p;i<a.length&&a[i].end<=f;)i+=1;let w=[],m=f;for(let n=i;n<a.length&&a[n].start<p;n+=1){let r=a[n],y=Math.max(r.start,f),g=Math.min(r.end,p);y>m&&w.push({value:e.slice(m,y),hit:-1}),g>y&&w.push({value:e.slice(y,g),hit:n}),m=Math.max(m,g)}m<p&&w.push({value:e.slice(m,p),hit:-1}),w.forEach((n,r)=>{let y=n.hit>=0?(0,t.jsx)("mark",{className:`wand-code-editor-hit${n.hit===u?" active":""}`,children:n.value}):n.value,g=`${v}-${r}`;c.push(o.kind?(0,t.jsx)("span",{className:`wand-file-preview-syntax-${o.kind}`,children:y},g):(0,t.jsx)(h.Fragment,{children:y},g))})}),(0,t.jsx)("code",{children:c})}var S="wand-code-editor-panel";function Y({snapshot:e,editorRef:a,ranges:u,activeRange:d}){let c=(0,h.useRef)(null),l=(0,h.useRef)(null);if((0,h.useEffect)(()=>{let f=a.current,p=c.current,w=u[d];if(!f||!p||!w)return;let m=J(p,w.start);if(!m)return;let n=p.getBoundingClientRect(),r=m.top-n.top+p.scrollTop,y=m.left-n.left+p.scrollLeft;f.scrollTop=Math.max(0,r-f.clientHeight/2+m.height/2),f.scrollLeft=Math.max(0,y-f.clientWidth/2+m.width/2)},[a,u,d]),e.status==="loading")return(0,t.jsxs)(b,{id:S,align:"center",justify:"center",gap:"small",style:{flex:1},className:"wand-code-editor-state",role:"status",children:[(0,t.jsx)(K,{size:"small","aria-hidden":"true"}),"\u6B63\u5728\u6253\u5F00\u6587\u4EF6\u2026"]});if(e.status==="error")return(0,t.jsxs)(b,{id:S,vertical:!0,align:"center",justify:"center",gap:"small",style:{flex:1},className:"wand-code-editor-state error",role:"alert",children:[(0,t.jsx)(R,{name:"warning",size:20}),(0,t.jsx)("strong",{children:e.failure?.message||"\u6253\u5F00\u6587\u4EF6\u5931\u8D25"}),e.activePath?(0,t.jsx)(k,{kind:"ghost",size:"small",onClick:()=>{z.open(e.activePath)},children:"\u91CD\u65B0\u52A0\u8F7D"}):null]});let i=e.file;if(!i)return(0,t.jsx)(b,{id:S,justify:"center",align:"center",style:{flex:1},children:(0,t.jsx)(O,{className:"wand-code-editor-state",description:"\u9009\u62E9\u6587\u4EF6\u540E\u5C06\u5728\u8FD9\u91CC\u7F16\u8F91\u3002"})});if(e.preview&&B(i))return(0,t.jsx)("div",{id:S,className:"wand-code-editor-markdown",tabIndex:0,"aria-label":`${i.name} \u9884\u89C8`,children:(0,t.jsx)(q,{content:i.draft,fontSize:e.fontSize,wrap:e.wrap})});let o=i.draft,v=Math.max(1,o.split(`
|
|
4
4
|
`).length);return(0,t.jsxs)("div",{id:S,className:"wand-code-editor-body",style:{fontSize:`${e.fontSize}px`},children:[(0,t.jsx)("pre",{ref:l,className:"wand-code-editor-lines","aria-hidden":"true",style:{fontSize:`${e.fontSize}px`},children:Array.from({length:v},(f,p)=>p+1).join(`
|
|
5
5
|
`)}),(0,t.jsxs)("div",{className:"wand-code-editor-area",children:[(0,t.jsx)("pre",{ref:c,className:"wand-code-editor-content","aria-hidden":"true",children:(0,t.jsx)(U,{content:o,ranges:u,activeRange:d})}),(0,t.jsx)("textarea",{ref:a,className:"resize-none wand-code-editor-textarea","aria-label":`\u7F16\u8F91 ${i.name}`,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,wrap:"off",value:o,onChange:f=>s({type:"change",value:f.currentTarget.value}),onKeyDown:f=>ee(f,o),onScroll:f=>{let p=f.currentTarget,w=c.current;w&&(w.scrollTop=p.scrollTop,w.scrollLeft=p.scrollLeft);let m=l.current;m&&(m.scrollTop=p.scrollTop)}})]})]})}function Z({snapshot:e,matchCount:a,activeIndex:u,activeLine:d,inputRef:c}){let l=e.findQuery.length>0,i=a>L;return(0,t.jsxs)(b,{wrap:!0,align:"center",gap:"small",className:"wand-code-editor-find",style:{padding:"4px 12px",flexShrink:0},children:[(0,t.jsx)(R,{name:"search",size:14}),(0,t.jsx)(A,{ref:c,className:"wand-code-editor-find-input",style:{flex:"1 1 180px",minWidth:0,maxWidth:320},inputSize:"sm",type:"text",value:e.findQuery,"aria-label":"\u5728\u6587\u4EF6\u4E2D\u67E5\u627E",placeholder:"\u5728\u6587\u4EF6\u4E2D\u67E5\u627E",autoComplete:"off",spellCheck:!1,onChange:o=>s({type:"find.set",query:o.currentTarget.value}),onKeyDown:o=>{o.nativeEvent.isComposing||o.key==="Enter"&&(o.preventDefault(),s({type:"find.step",delta:o.shiftKey?-1:1}))}}),(0,t.jsx)(I.Text,{type:l&&a===0?"danger":"secondary",className:`wand-code-editor-find-count${l&&a===0?" empty":""}`,title:i?"\u5339\u914D\u8FC7\u591A\uFF0C\u53EA\u9AD8\u4EAE\u5F53\u524D\u9879":void 0,"aria-live":"polite",children:l?a===0?"\u65E0\u7ED3\u679C":`${u+1}/${a}`:""}),l&&d!==null?(0,t.jsxs)(I.Text,{type:"secondary",className:"wand-code-editor-find-line",children:["\u7B2C ",d," \u884C"]}):null,(0,t.jsx)(E,{title:"\u4E0A\u4E00\u4E2A\u5339\u914D (\u21E7\u21B5)","aria-label":"\u4E0A\u4E00\u4E2A\u5339\u914D",disabled:a===0,onClick:()=>s({type:"find.step",delta:-1}),children:"\u2191"}),(0,t.jsx)(E,{title:"\u4E0B\u4E00\u4E2A\u5339\u914D (\u21B5)","aria-label":"\u4E0B\u4E00\u4E2A\u5339\u914D",disabled:a===0,onClick:()=>s({type:"find.step",delta:1}),children:"\u2193"}),(0,t.jsx)(E,{kind:e.findCaseSensitive?"primary":"ghost",title:"\u533A\u5206\u5927\u5C0F\u5199","aria-label":"\u533A\u5206\u5927\u5C0F\u5199","aria-pressed":e.findCaseSensitive,onClick:()=>s({type:"find.case.toggle"}),children:"Aa"}),(0,t.jsx)(E,{title:"\u5173\u95ED\u67E5\u627E (Esc)","aria-label":"\u5173\u95ED\u67E5\u627E",onClick:()=>s({type:"find.close"}),children:(0,t.jsx)(R,{name:"close",size:12})})]})}function ee(e,a){if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()==="s"){e.preventDefault(),e.stopPropagation(),s({type:"save"});return}if(e.key==="Tab"){if(e.nativeEvent.isComposing)return;e.preventDefault();let u=e.currentTarget,d=u.selectionStart,c=u.selectionEnd,l=`${a.slice(0,d)} ${a.slice(c)}`;s({type:"change",value:l}),requestAnimationFrame(()=>{u.selectionStart=d+2,u.selectionEnd=d+2});return}}function ge(){let e=(0,h.useSyncExternalStore)(N.subscribe,N.getSnapshot,N.getSnapshot),a=(0,h.useRef)(null),u=(0,h.useRef)(null),d=(0,h.useRef)(!1),c=e.file,l=c?B(c):!1,i=l&&e.preview,o=c?.draft??"",v=x.useMemo(()=>{if(!e.findOpen||!e.findQuery)return{count:0,ranges:[],activeRange:-1,activeIndex:-1};let n=V(o,e.findQuery,{caseSensitive:e.findCaseSensitive});if(n.length===0)return{count:0,ranges:[],activeRange:-1,activeIndex:-1};let r=Math.min(Math.max(e.findIndex,0),n.length-1);return n.length>L?{count:n.length,ranges:[n[r]],activeRange:0,activeIndex:r}:{count:n.length,ranges:n,activeRange:r,activeIndex:r}},[e.findOpen,e.findQuery,e.findCaseSensitive,e.findIndex,o]);(0,h.useEffect)(()=>{let n=d.current&&!e.saving;d.current=e.saving,n&&e.status==="ready"&&document.activeElement===document.body&&a.current?.focus()},[e.saving,e.status]),(0,h.useEffect)(()=>{if(e.findOpen){let n=u.current;n?.focus(),n?.select();return}e.status!=="ready"||!e.file||document.activeElement?.getAttribute("role")!=="tab"&&a.current?.focus()},[e.findOpen,e.activePath,e.status,e.preview]),(0,h.useEffect)(()=>{if(e.status!=="ready")return;let n=a.current;n&&(n.scrollTop=0)},[e.activePath,e.status]);function f(){i&&s({type:"preview.toggle"}),s({type:"find.open"})}function p(n){let r=document.activeElement;z.execute({type:"close",path:n}).then(y=>{y||requestAnimationFrame(()=>{let g=document.activeElement,M=a.current?.closest(".wand-code-editor-host");r instanceof HTMLElement&&r.isConnected&&(g===document.body||g&&M?.contains(g))&&r.focus({preventScroll:!0})})})}function w(n){if(!n.nativeEvent.isComposing){if((n.ctrlKey||n.metaKey)&&n.key.toLowerCase()==="f"){n.preventDefault(),n.stopPropagation();let r=a.current,y=r&&r.selectionEnd>r.selectionStart?r.value.slice(r.selectionStart,r.selectionEnd):"";f(),y&&!y.includes(`
|
|
6
6
|
`)&&s({type:"find.set",query:y});return}if(n.key==="Escape"){if(n.preventDefault(),n.stopPropagation(),e.findOpen){s({type:"find.close"});return}e.activePath&&p(e.activePath)}}}let m=!e.open||!e.activePath;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("style",{id:"wand-code-editor-styles",children:[X,Q]}),(0,t.jsxs)(b,{vertical:!0,className:`wand-code-editor-host${e.wrap?" wrap":""}`,hidden:m,onKeyDownCapture:w,"aria-hidden":m,style:{position:"absolute",inset:0,zIndex:40,background:"var(--bg-primary)",minHeight:0},children:[e.tabs.length>0&&(0,t.jsx)(D,{className:"wand-code-editor-tabs",type:"editable-card",hideAdd:!0,size:"small",activeKey:e.activePath??void 0,"aria-label":"\u6253\u5F00\u7684\u6587\u4EF6",onChange:n=>s({type:"activate",path:n}),onEdit:(n,r)=>{r==="remove"&&typeof n=="string"&&p(n)},items:e.tabs.map(n=>({key:n.path,label:(0,t.jsx)("span",{className:`wand-code-editor-tab${e.activePath===n.path?" active":""}`,title:n.path,children:(0,t.jsx)(j,{dot:n.dirty,offset:[4,0],children:(0,t.jsx)("span",{className:"wand-code-editor-tab-name",children:n.name})})}),closeIcon:(0,t.jsx)(R,{name:"close",size:12})})),style:{flexShrink:0},styles:{header:{margin:0},body:{display:"none"}},renderTabBar:(n,r)=>(0,t.jsx)(r,{...n,children:y=>{let g=e.tabs.find(C=>C.path===y.key),M=y;return x.cloneElement(M,{},x.Children.map(M.props.children,C=>{if(!x.isValidElement(C))return C;let T=C;return T.props.role==="tab"?x.cloneElement(T,{"aria-controls":S,"aria-label":g?.dirty?`${g.name}\uFF0C\u672A\u4FDD\u5B58`:g?.name,onFocus:G=>{T.props.onFocus?.(G),g&&s({type:"activate",path:g.path})}}):T.type==="button"?x.cloneElement(T,{className:`${T.props.className??""} wand-code-editor-tab-close`,"aria-label":`\u5173\u95ED ${g?.name??"\u6587\u4EF6"}`}):C}))}})}),e.file&&(0,t.jsxs)(b,{wrap:!0,align:"center",gap:"small",className:"wand-code-editor-toolbar","aria-label":"\u7F16\u8F91\u5668\u5DE5\u5177\u680F",style:{padding:"8px 12px",flexShrink:0},children:[(0,t.jsx)(H,{className:"wand-code-editor-dirty-mark",size:"sm",tone:e.file.dirty?"warning":"success",children:e.file.dirty?"\u25CF \u672A\u4FDD\u5B58":"\u5DF2\u4FDD\u5B58"}),(0,t.jsx)("span",{style:{flex:1}}),(0,t.jsx)(k,{size:"small",kind:"primary",loading:e.saving,disabled:e.saving||!e.file.dirty,onClick:()=>s({type:"save"}),children:e.saving?"\u4FDD\u5B58\u4E2D\u2026":"\u4FDD\u5B58 (\u2318S)"}),(0,t.jsx)(k,{size:"small",disabled:e.saving||!e.file.dirty,onClick:()=>s({type:"revert"}),children:"\u64A4\u9500\u6539\u52A8"}),l?(0,t.jsx)(k,{size:"small",kind:i?"primary":"secondary","aria-pressed":i,title:i?"\u663E\u793A Markdown \u6E90\u7801":"\u6E32\u67D3 Markdown \u9884\u89C8",onClick:()=>s({type:"preview.toggle"}),children:"\u9884\u89C8"}):null,(0,t.jsx)(k,{size:"small",kind:e.findOpen?"primary":"secondary",onClick:f,"aria-pressed":e.findOpen,title:"\u5728\u6587\u4EF6\u4E2D\u67E5\u627E (\u2318F)",children:"\u67E5\u627E \u2318F"}),(0,t.jsx)(k,{size:"small",kind:e.wrap?"primary":"secondary",onClick:()=>s({type:"wrap.toggle"}),"aria-pressed":e.wrap,children:"\u81EA\u52A8\u6362\u884C"}),(0,t.jsx)(E,{"aria-label":"\u7F29\u5C0F\u5B57\u53F7",onClick:()=>s({type:"font.adjust",delta:-1}),children:"A\u2212"}),(0,t.jsx)("span",{role:"status","aria-label":`\u5B57\u53F7 ${e.fontSize}`,children:e.fontSize}),(0,t.jsx)(E,{"aria-label":"\u653E\u5927\u5B57\u53F7",onClick:()=>s({type:"font.adjust",delta:1}),children:"A+"})]}),e.status==="ready"&&e.failure?(0,t.jsx)(W,{className:"wand-code-editor-inline-error",type:"error",showIcon:!0,title:e.failure.message}):null,e.findOpen&&e.file?(0,t.jsx)(Z,{snapshot:e,matchCount:v.count,activeIndex:v.activeIndex<0?0:v.activeIndex,activeLine:v.count>0&&v.activeRange>=0?v.ranges[v.activeRange]?.line??null:null,inputRef:u}):null,(0,t.jsx)(Y,{snapshot:e,editorRef:a,ranges:v.ranges,activeRange:v.activeRange})]})]})}export{ge as CodeEditorHost};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{shared13_h as f}from"/assets/modules/
|
|
1
|
+
import{shared13_h as f}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared11_a as a}from"/assets/modules/069f5a4267b0a9e3/runtime.js";import{shared5_c as c}from"/assets/modules/069f5a4267b0a9e3/runtime.js";var s=c(a());function R(t,r,n){return(0,s.useMemo)(()=>({...{trap:r??!0,focusTriggerAfterClose:n??!0},...t}),[t,r,n])}var e=c(a());function m(){}var p=e.createContext({add:m,remove:m});function x(t){let r=e.useContext(p),n=e.useRef(null);return f(o=>{if(o){let u=t?o.querySelector(t):o;u&&(r.add(u),n.current=u)}else r.remove(n.current)})}export{R as a,x as b};
|