@agent-spaces/server 0.3.61 → 0.3.63
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/adapters/agent-runtime-types.js +12 -0
- package/dist/adapters/claude-code-runtime/index.js +22 -0
- package/dist/adapters/claude-code-runtime/sdk-config.js +34 -10
- package/dist/adapters/codex-runtime.js +2 -2
- package/dist/adapters/git.js +29 -13
- package/dist/adapters/langchain-runtime.js +2 -2
- package/dist/adapters/open-agent-sdk-runtime.js +2 -2
- package/dist/agents/agent-message-parts.js +27 -3
- package/dist/agents/commit-agent.js +1 -0
- package/dist/agents/issue-agent-progress.js +4 -2
- package/dist/agents/issue-agent-runner.js +5 -5
- package/dist/agents/issue-task-controller.js +95 -14
- package/dist/app.js +74 -5
- package/dist/package.json +1 -1
- package/dist/routes/agent-sse.js +4 -2
- package/dist/routes/channel.js +21 -4
- package/dist/routes/file.js +87 -1
- package/dist/routes/hooks.js +88 -0
- package/dist/routes/issue.js +59 -1
- package/dist/routes/output-style.js +48 -0
- package/dist/routes/prompt-template.js +2 -2
- package/dist/routes/skill.js +97 -3
- package/dist/routes/task.js +13 -1
- package/dist/services/agent.js +45 -16
- package/dist/services/hook-engine.js +118 -0
- package/dist/services/issue.js +6 -0
- package/dist/services/notification-hub/bot-agent.js +1 -0
- package/dist/services/output-style.js +134 -0
- package/dist/services/persistent-agent-context.js +37 -4
- package/dist/services/prompt-template.js +2 -2
- package/dist/services/skill.js +275 -40
- package/dist/storage/hook-store.js +55 -0
- package/dist/web/404.html +1 -1
- package/dist/web/__next.__PAGE__.txt +4 -4
- package/dist/web/__next._full.txt +25 -23
- package/dist/web/__next._head.txt +4 -4
- package/dist/web/__next._index.txt +13 -13
- package/dist/web/__next._tree.txt +2 -2
- package/dist/web/_next/static/chunks/0-1bfvfwifh-m.js +1 -0
- package/dist/web/_next/static/chunks/0-f~0xmwl__u5.js +1 -0
- package/dist/web/_next/static/chunks/0.n~yfwf4~6w-.js +1 -0
- package/dist/web/_next/static/chunks/002_j970b9gdx.js +1 -0
- package/dist/web/_next/static/chunks/014x2qbuiszni.js +3 -0
- package/dist/web/_next/static/chunks/01iqv28_snwus.js +1 -0
- package/dist/web/_next/static/chunks/02c22g~xd-y30.js +19 -0
- package/dist/web/_next/static/chunks/02mf61htij8g0.js +31 -0
- package/dist/web/_next/static/chunks/03scq1-0ykve3.js +1 -0
- package/dist/web/_next/static/chunks/046me66nilkff.js +1 -0
- package/dist/web/_next/static/chunks/04v-pqqs-2lvp.css +1 -0
- package/dist/web/_next/static/chunks/05f8cnmzqd5wb.js +1 -0
- package/dist/web/_next/static/chunks/{0zd1o3u04~qvo.js → 05psi2gtx~bev.js} +7 -7
- package/dist/web/_next/static/chunks/{12odetnu-lyrr.js → 06whz1~s_7pva.js} +12 -12
- package/dist/web/_next/static/chunks/06w~.izyfylap.js +1 -0
- package/dist/web/_next/static/chunks/08kfx8on9oty~.js +1 -0
- package/dist/web/_next/static/chunks/09t62a89~jesc.js +3 -0
- package/dist/web/_next/static/chunks/09y_3krccdd~u.js +1 -0
- package/dist/web/_next/static/chunks/{0njy89g5coeyi.js → 0_8dm7bxp18xo.js} +6 -6
- package/dist/web/_next/static/chunks/0_e~hmntdfop9.js +1 -0
- package/dist/web/_next/static/chunks/0_udc.6.tueey.js +1 -0
- package/dist/web/_next/static/chunks/0_vi1a~g4wx46.js +3 -0
- package/dist/web/_next/static/chunks/{05iy4.c-1cfhd.js → 0aa6bcdmtpekn.js} +1 -1
- package/dist/web/_next/static/chunks/{0tvd~rxgf0oh_.js → 0bbmx45w_h5np.js} +1 -1
- package/dist/web/_next/static/chunks/0cke33d38fnby.js +90 -0
- package/dist/web/_next/static/chunks/{0w1iudd1d46sw.js → 0ctg5qmw7uu.1.js} +2 -2
- package/dist/web/_next/static/chunks/0cyq~8xb~r5fc.js +1 -0
- package/dist/web/_next/static/chunks/0ewceguykiut5.js +1 -0
- package/dist/web/_next/static/chunks/0fxa1edqr7dve.js +1 -0
- package/dist/web/_next/static/chunks/{0202ia13sijwb.js → 0h18ej5yf974e.js} +1 -1
- package/dist/web/_next/static/chunks/0hra80eyuu37u.js +1 -0
- package/dist/web/_next/static/chunks/0i39jifmxla7q.js +1 -0
- package/dist/web/_next/static/chunks/0ie7y4k2ncvnn.js +1 -0
- package/dist/web/_next/static/chunks/0igc~uli58ncw.js +2 -0
- package/dist/web/_next/static/chunks/0kof5qdg8c2-k.js +71 -0
- package/dist/web/_next/static/chunks/{08o-zmr-40r5g.js → 0m11vvph7q94-.js} +1 -1
- package/dist/web/_next/static/chunks/0msb2mi3hiu5_.js +67 -0
- package/dist/web/_next/static/chunks/0np.d~hc1-pmh.js +4 -0
- package/dist/web/_next/static/chunks/{0qpq0~_58fe9a.js → 0oaq67r7ix.vg.js} +1 -1
- package/dist/web/_next/static/chunks/0ogpc3f3keopc.js +3 -0
- package/dist/web/_next/static/chunks/{0d_dp_4ofz0l3.css → 0ojcao3hdm36s.css} +0 -1
- package/dist/web/_next/static/chunks/0p1n8bvfnpl41.js +1 -0
- package/dist/web/_next/static/chunks/{0gig.k.rq8d0x.js → 0ppr271hz0xoq.js} +1 -1
- package/dist/web/_next/static/chunks/0s_dva~eh2yhi.js +3 -0
- package/dist/web/_next/static/chunks/0typj55ox8d5i.js +1 -0
- package/dist/web/_next/static/chunks/0w2p4ldi2aymp.js +1 -0
- package/dist/web/_next/static/chunks/{0..g0jl-8qup7.js → 0xoo17yef_b8g.js} +1 -1
- package/dist/web/_next/static/chunks/0xt-8wk21gs7g.js +1 -0
- package/dist/web/_next/static/chunks/0y09i51u6ixq5.js +1 -0
- package/dist/web/_next/static/chunks/0za1r07-6az6w.js +1 -0
- package/dist/web/_next/static/chunks/0zc0xgp5ourcn.js +1 -0
- package/dist/web/_next/static/chunks/0zmhdridea1s5.js +90 -0
- package/dist/web/_next/static/chunks/0~u.5r3-t7179.js +1 -0
- package/dist/web/_next/static/chunks/10.alq.6stmld.js +1 -0
- package/dist/web/_next/static/chunks/11-czmcci_55y.js +1 -0
- package/dist/web/_next/static/chunks/11b3zgk1etlkw.js +7 -0
- package/dist/web/_next/static/chunks/11k-.49r~1mfm.js +1 -0
- package/dist/web/_next/static/chunks/11qp8r5dotf7d.js +1 -0
- package/dist/web/_next/static/chunks/128ugqd34tr_-.js +1 -0
- package/dist/web/_next/static/chunks/12mxlicp247c8.js +1 -0
- package/dist/web/_next/static/chunks/135w27dd8c19s.js +5 -0
- package/dist/web/_next/static/chunks/13~y-b.b9rrw4.js +1 -0
- package/dist/web/_next/static/chunks/{0jokpgh485~28.js → 14hqmid8q4apf.js} +11 -11
- package/dist/web/_next/static/chunks/16sg-lflc8csx.js +1 -0
- package/dist/web/_next/static/chunks/176dc-dtokxxi.js +16 -0
- package/dist/web/_next/static/chunks/17g-0pqre.anw.js +1 -0
- package/dist/web/_next/static/chunks/17oc2l.ekcs8b.css +1 -0
- package/dist/web/_next/static/chunks/{turbopack-0lrdxynxb9-1t.js → turbopack-0ndm2zc_pdptk.js} +1 -1
- package/dist/web/_not-found/__next._full.txt +29 -30
- package/dist/web/_not-found/__next._head.txt +4 -4
- package/dist/web/_not-found/__next._index.txt +13 -13
- package/dist/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/dist/web/_not-found/__next._not-found.txt +3 -3
- package/dist/web/_not-found/__next._tree.txt +2 -2
- package/dist/web/_not-found.html +1 -1
- package/dist/web/_not-found.txt +29 -30
- package/dist/web/icons/file_type_audio.svg +3 -1
- package/dist/web/icons/file_type_video.svg +10 -1
- package/dist/web/index.html +1 -1
- package/dist/web/index.txt +25 -23
- package/dist/web/login/__next._full.txt +30 -28
- package/dist/web/login/__next._head.txt +4 -4
- package/dist/web/login/__next._index.txt +13 -13
- package/dist/web/login/__next._tree.txt +2 -2
- package/dist/web/login/__next.login.__PAGE__.txt +4 -4
- package/dist/web/login/__next.login.txt +3 -3
- package/dist/web/login.html +1 -1
- package/dist/web/login.txt +30 -28
- package/dist/web/settings/__next._full.txt +32 -31
- package/dist/web/settings/__next._head.txt +4 -4
- package/dist/web/settings/__next._index.txt +13 -13
- package/dist/web/settings/__next._tree.txt +2 -2
- package/dist/web/settings/__next.settings.__PAGE__.txt +4 -4
- package/dist/web/settings/__next.settings.txt +5 -5
- package/dist/web/settings/agents/__next._full.txt +35 -34
- package/dist/web/settings/agents/__next._head.txt +4 -4
- package/dist/web/settings/agents/__next._index.txt +13 -13
- package/dist/web/settings/agents/__next._tree.txt +2 -2
- package/dist/web/settings/agents/__next.settings.agents.__PAGE__.txt +4 -4
- package/dist/web/settings/agents/__next.settings.agents.txt +3 -3
- package/dist/web/settings/agents/__next.settings.txt +5 -5
- package/dist/web/settings/agents.html +1 -1
- package/dist/web/settings/agents.txt +35 -34
- package/dist/web/settings/mcps/__next._full.txt +35 -34
- package/dist/web/settings/mcps/__next._head.txt +4 -4
- package/dist/web/settings/mcps/__next._index.txt +13 -13
- package/dist/web/settings/mcps/__next._tree.txt +2 -2
- package/dist/web/settings/mcps/__next.settings.mcps.__PAGE__.txt +4 -4
- package/dist/web/settings/mcps/__next.settings.mcps.txt +3 -3
- package/dist/web/settings/mcps/__next.settings.txt +5 -5
- package/dist/web/settings/mcps.html +1 -1
- package/dist/web/settings/mcps.txt +35 -34
- package/dist/web/settings/models/__next._full.txt +35 -34
- package/dist/web/settings/models/__next._head.txt +4 -4
- package/dist/web/settings/models/__next._index.txt +13 -13
- package/dist/web/settings/models/__next._tree.txt +2 -2
- package/dist/web/settings/models/__next.settings.models.__PAGE__.txt +4 -4
- package/dist/web/settings/models/__next.settings.models.txt +3 -3
- package/dist/web/settings/models/__next.settings.txt +5 -5
- package/dist/web/settings/models.html +1 -1
- package/dist/web/settings/models.txt +35 -34
- package/dist/web/settings/output-styles/__next._full.txt +43 -0
- package/dist/web/settings/output-styles/__next._head.txt +6 -0
- package/dist/web/settings/output-styles/__next._index.txt +15 -0
- package/dist/web/settings/output-styles/__next._tree.txt +8 -0
- package/dist/web/settings/output-styles/__next.settings.output-styles.__PAGE__.txt +9 -0
- package/dist/web/settings/output-styles/__next.settings.output-styles.txt +5 -0
- package/dist/web/settings/output-styles/__next.settings.txt +7 -0
- package/dist/web/settings/output-styles.html +1 -0
- package/dist/web/settings/output-styles.txt +43 -0
- package/dist/web/settings/prompts/__next._full.txt +35 -34
- package/dist/web/settings/prompts/__next._head.txt +4 -4
- package/dist/web/settings/prompts/__next._index.txt +13 -13
- package/dist/web/settings/prompts/__next._tree.txt +2 -2
- package/dist/web/settings/prompts/__next.settings.prompts.__PAGE__.txt +4 -4
- package/dist/web/settings/prompts/__next.settings.prompts.txt +3 -3
- package/dist/web/settings/prompts/__next.settings.txt +5 -5
- package/dist/web/settings/prompts.html +1 -1
- package/dist/web/settings/prompts.txt +35 -34
- package/dist/web/settings/providers/__next._full.txt +35 -34
- package/dist/web/settings/providers/__next._head.txt +4 -4
- package/dist/web/settings/providers/__next._index.txt +13 -13
- package/dist/web/settings/providers/__next._tree.txt +2 -2
- package/dist/web/settings/providers/__next.settings.providers.__PAGE__.txt +4 -4
- package/dist/web/settings/providers/__next.settings.providers.txt +3 -3
- package/dist/web/settings/providers/__next.settings.txt +5 -5
- package/dist/web/settings/providers.html +1 -1
- package/dist/web/settings/providers.txt +35 -34
- package/dist/web/settings/skills/__next._full.txt +35 -34
- package/dist/web/settings/skills/__next._head.txt +4 -4
- package/dist/web/settings/skills/__next._index.txt +13 -13
- package/dist/web/settings/skills/__next._tree.txt +2 -2
- package/dist/web/settings/skills/__next.settings.skills.__PAGE__.txt +4 -4
- package/dist/web/settings/skills/__next.settings.skills.txt +3 -3
- package/dist/web/settings/skills/__next.settings.txt +5 -5
- package/dist/web/settings/skills.html +1 -1
- package/dist/web/settings/skills.txt +35 -34
- package/dist/web/settings.html +1 -1
- package/dist/web/settings.txt +32 -31
- package/dist/web/workflows/__next._full.txt +32 -30
- package/dist/web/workflows/__next._head.txt +4 -4
- package/dist/web/workflows/__next._index.txt +13 -13
- package/dist/web/workflows/__next._tree.txt +2 -2
- package/dist/web/workflows/__next.workflows.__PAGE__.txt +4 -4
- package/dist/web/workflows/__next.workflows.txt +3 -3
- package/dist/web/workflows.html +1 -1
- package/dist/web/workflows.txt +32 -30
- package/dist/web/workspace/_/__next._full.txt +30 -70
- package/dist/web/workspace/_/__next._head.txt +4 -4
- package/dist/web/workspace/_/__next._index.txt +13 -13
- package/dist/web/workspace/_/__next._tree.txt +2 -17
- package/dist/web/workspace/_/__next.workspace.$d$id.__PAGE__.txt +3 -18
- package/dist/web/workspace/_/__next.workspace.$d$id.txt +3 -3
- package/dist/web/workspace/_/__next.workspace.txt +3 -3
- package/dist/web/workspace/_.html +1 -1
- package/dist/web/workspace/_.txt +30 -70
- package/dist/web/workspaces/__next._full.txt +31 -29
- package/dist/web/workspaces/__next._head.txt +4 -4
- package/dist/web/workspaces/__next._index.txt +13 -13
- package/dist/web/workspaces/__next._tree.txt +2 -2
- package/dist/web/workspaces/__next.workspaces.__PAGE__.txt +4 -4
- package/dist/web/workspaces/__next.workspaces.txt +3 -3
- package/dist/web/workspaces.html +1 -1
- package/dist/web/workspaces.txt +31 -29
- package/dist/ws/agent-runner.js +55 -33
- package/dist/ws/message-parts.js +61 -2
- package/package.json +1 -1
- package/public/output-styles/carmack-mode.md +381 -0
- package/public/output-styles/codex-rigor-mode.md +114 -0
- package/public/output-styles/dhh-mode.md +265 -0
- package/public/output-styles/evan-you-mode.md +539 -0
- package/public/output-styles/index.json +37 -0
- package/public/output-styles/jobs-mode.md +369 -0
- package/public/output-styles/linus-mode.md +135 -0
- package/public/output-styles/uncle-bob-mode.md +221 -0
- package/public/prompt/andrej-karpathy-skills.md +65 -0
- package/public/prompt/claude-token-efficient-coding.md +35 -0
- package/public/prompt/index.json +12 -0
- package/public/skills/index.json +92 -0
- package/public/skills/planning-with-files/planning-with-files-zh/SKILL.md +243 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.ps1 +44 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.sh +46 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.ps1 +124 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.sh +124 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/session-catchup.py +438 -0
- package/public/skills/planning-with-files/planning-with-files-zh/templates/findings.md +29 -0
- package/public/skills/planning-with-files/planning-with-files-zh/templates/progress.md +40 -0
- package/public/skills/planning-with-files/planning-with-files-zh/templates/task_plan.md +58 -0
- package/public/skills/superpowers/brainstorming/SKILL.md +164 -0
- package/public/skills/superpowers/brainstorming/scripts/frame-template.html +214 -0
- package/public/skills/superpowers/brainstorming/scripts/helper.js +88 -0
- package/public/skills/superpowers/brainstorming/scripts/server.cjs +354 -0
- package/public/skills/superpowers/brainstorming/scripts/start-server.sh +148 -0
- package/public/skills/superpowers/brainstorming/scripts/stop-server.sh +56 -0
- package/public/skills/superpowers/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/public/skills/superpowers/brainstorming/visual-companion.md +287 -0
- package/public/skills/superpowers/dispatching-parallel-agents/SKILL.md +182 -0
- package/public/skills/superpowers/executing-plans/SKILL.md +70 -0
- package/public/skills/superpowers/finishing-a-development-branch/SKILL.md +251 -0
- package/public/skills/superpowers/receiving-code-review/SKILL.md +213 -0
- package/public/skills/superpowers/requesting-code-review/SKILL.md +103 -0
- package/public/skills/superpowers/requesting-code-review/code-reviewer.md +168 -0
- package/public/skills/superpowers/subagent-driven-development/SKILL.md +279 -0
- package/public/skills/superpowers/subagent-driven-development/code-quality-reviewer-prompt.md +25 -0
- package/public/skills/superpowers/subagent-driven-development/implementer-prompt.md +113 -0
- package/public/skills/superpowers/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/public/skills/superpowers/systematic-debugging/CREATION-LOG.md +119 -0
- package/public/skills/superpowers/systematic-debugging/SKILL.md +296 -0
- package/public/skills/superpowers/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/public/skills/superpowers/systematic-debugging/condition-based-waiting.md +115 -0
- package/public/skills/superpowers/systematic-debugging/defense-in-depth.md +122 -0
- package/public/skills/superpowers/systematic-debugging/find-polluter.sh +63 -0
- package/public/skills/superpowers/systematic-debugging/root-cause-tracing.md +169 -0
- package/public/skills/superpowers/systematic-debugging/test-academic.md +14 -0
- package/public/skills/superpowers/systematic-debugging/test-pressure-1.md +58 -0
- package/public/skills/superpowers/systematic-debugging/test-pressure-2.md +68 -0
- package/public/skills/superpowers/systematic-debugging/test-pressure-3.md +69 -0
- package/public/skills/superpowers/test-driven-development/SKILL.md +371 -0
- package/public/skills/superpowers/test-driven-development/testing-anti-patterns.md +299 -0
- package/public/skills/superpowers/using-git-worktrees/SKILL.md +215 -0
- package/public/skills/superpowers/using-superpowers/SKILL.md +117 -0
- package/public/skills/superpowers/using-superpowers/references/codex-tools.md +59 -0
- package/public/skills/superpowers/using-superpowers/references/copilot-tools.md +42 -0
- package/public/skills/superpowers/using-superpowers/references/gemini-tools.md +51 -0
- package/public/skills/superpowers/verification-before-completion/SKILL.md +139 -0
- package/public/skills/superpowers/writing-plans/SKILL.md +152 -0
- package/public/skills/superpowers/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/public/skills/superpowers/writing-skills/SKILL.md +655 -0
- package/public/skills/superpowers/writing-skills/anthropic-best-practices.md +1150 -0
- package/public/skills/superpowers/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/public/skills/superpowers/writing-skills/graphviz-conventions.dot +172 -0
- package/public/skills/superpowers/writing-skills/persuasion-principles.md +187 -0
- package/public/skills/superpowers/writing-skills/render-graphs.js +168 -0
- package/public/skills/superpowers/writing-skills/testing-skills-with-subagents.md +384 -0
- package/dist/web/_next/static/chunks/0-1pn22sg~67u.js +0 -2
- package/dist/web/_next/static/chunks/01gi~q0c6ez6..js +0 -1
- package/dist/web/_next/static/chunks/03me5_ir..2ix.js +0 -1
- package/dist/web/_next/static/chunks/05eu2fdixf7c9.js +0 -1
- package/dist/web/_next/static/chunks/0_-c.y2qq4ax4.js +0 -270
- package/dist/web/_next/static/chunks/0_g3irbniww6d.js +0 -3
- package/dist/web/_next/static/chunks/0cs830n97dgjy.js +0 -1
- package/dist/web/_next/static/chunks/0g-0n6glz_z6w.js +0 -1
- package/dist/web/_next/static/chunks/0gyede80jpy3n.js +0 -4
- package/dist/web/_next/static/chunks/0hrbuvzuxrjfl.js +0 -1
- package/dist/web/_next/static/chunks/0ju52ko_nh7gi.js +0 -1
- package/dist/web/_next/static/chunks/0mny8i81aenx3.js +0 -1
- package/dist/web/_next/static/chunks/0nsu~f3voe~0i.js +0 -5
- package/dist/web/_next/static/chunks/0sz8_nijfiz0p.js +0 -1
- package/dist/web/_next/static/chunks/0u7_qd9hzqwac.js +0 -1
- package/dist/web/_next/static/chunks/0w3o.7vi.dlm6.js +0 -1
- package/dist/web/_next/static/chunks/0wv0h27jafag4.js +0 -1
- package/dist/web/_next/static/chunks/0wwvc4zc2q6bn.js +0 -1
- package/dist/web/_next/static/chunks/0x4b-a2ixww6m.js +0 -1
- package/dist/web/_next/static/chunks/0xwqf.llmm_u2.js +0 -31
- package/dist/web/_next/static/chunks/0~w6ugk9s5p-h.css +0 -1
- package/dist/web/_next/static/chunks/125nunjfj2fj0.js +0 -1
- package/dist/web/_next/static/chunks/1285yqy_oirb-.js +0 -1
- package/dist/web/_next/static/chunks/13ess~4pdmxma.js +0 -1
- package/dist/web/_next/static/chunks/14n8i2xz4_y-e.js +0 -1
- package/public/avatars/1777813826407-bea0ja-minimax.svg +0 -1
- package/public/avatars/1777813967088-3xlvd0-minimax.svg +0 -1
- package/public/avatars/1777814041714-yp0qeq-minimax.svg +0 -1
- package/public/avatars/1777904986095-rg26je-icon.png +0 -0
- package/public/avatars/1778953228323-5je54x-user.jpg +0 -0
- package/public/avatars/1778954057880-g01q6y-user.jpg +0 -0
- /package/dist/web/_next/static/{HUlYEknPhyW7dRmJ5mFdG → OoXAsPtrUWjC1l898FSvI}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{HUlYEknPhyW7dRmJ5mFdG → OoXAsPtrUWjC1l898FSvI}/_clientMiddlewareManifest.js +0 -0
- /package/dist/web/_next/static/{HUlYEknPhyW7dRmJ5mFdG → OoXAsPtrUWjC1l898FSvI}/_ssgManifest.js +0 -0
- /package/public/avatars/{1777815865622-08wp9m-user.jpg → user.jpg} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,972846,e=>{"use strict";var t=e.i(912248);e.s(["X",()=>t.default])},604921,e=>{"use strict";var t=e.i(764556),r=e.i(92615),n=e.i(422561),o=e.i(516366),a=e.i(454889),i=e.i(232449),l=e.i(526850),s=e.i(410421),u=e.i(922970),c=e.i(602453),d=e.i(742665),f=e.i(134055);let h=a.isMac&&a.isSafari;e.s(["useFocus",0,function(e,a={}){let v="rootStore"in e?e.rootStore:e,{events:p,dataRef:m}=v.context,{enabled:g=!0,delay:w}=a,x=t.useRef(!1),b=t.useRef(null),y=(0,i.useTimeout)(),S=t.useRef(!0);t.useEffect(()=>{let e=v.select("domReferenceElement");if(!g)return;let t=(0,r.getWindow)(e);return(0,o.mergeCleanups)((0,n.addEventListener)(t,"blur",function(){let e=v.select("domReferenceElement");!v.select("open")&&(0,r.isHTMLElement)(e)&&e===(0,s.activeElement)((0,l.ownerDocument)(e))&&(x.current=!0)}),h&&(0,n.addEventListener)(t,"keydown",function(){S.current=!0},!0),h&&(0,n.addEventListener)(t,"pointerdown",function(){S.current=!1},!0))},[v,g]),t.useEffect(()=>{if(g)return p.on("openchange",e),()=>{p.off("openchange",e)};function e(e){if(e.reason===d.REASONS.triggerPress||e.reason===d.REASONS.escapeKey){let e=v.select("domReferenceElement");(0,r.isElement)(e)&&(b.current=e,x.current=!0)}}},[p,g,v]);let E=t.useMemo(()=>({onMouseLeave(){x.current=!1,b.current=null},onFocus(e){let t=e.currentTarget;if(x.current){if(b.current===t)return;x.current=!1,b.current=null}let n=(0,s.getTarget)(e.nativeEvent);if((0,r.isElement)(n)){if(h&&!e.relatedTarget){if(!S.current&&!(0,u.isTypeableElement)(n))return}else if(!(0,u.matchesFocusVisible)(n))return}let o=(0,u.isTargetInsideEnabledTrigger)(e.relatedTarget,v.context.triggerElements),{nativeEvent:a,currentTarget:i}=e,l="function"==typeof w?w():w;v.select("open")&&o||0===l||void 0===l?v.setOpen(!0,(0,c.createChangeEventDetails)(d.REASONS.triggerFocus,a,i)):y.start(l,()=>{x.current||v.setOpen(!0,(0,c.createChangeEventDetails)(d.REASONS.triggerFocus,a,i))})},onBlur(e){x.current=!1,b.current=null;let t=e.relatedTarget,n=e.nativeEvent,o=(0,r.isElement)(t)&&t.hasAttribute((0,f.createAttribute)("focus-guard"))&&"outside"===t.getAttribute("data-type");y.start(0,()=>{let e=v.select("domReferenceElement"),r=(0,s.activeElement)((0,l.ownerDocument)(e));if(!t&&r===e||(0,s.contains)(m.current.floatingContext?.refs.floating.current,r)||(0,s.contains)(e,r)||o)return;let a=t??r;(0,u.isTargetInsideEnabledTrigger)(a,v.context.triggerElements)||v.setOpen(!1,(0,c.createChangeEventDetails)(d.REASONS.triggerFocus,n))})}}),[m,v,y,w]);return t.useMemo(()=>g?{reference:E,trigger:E}:{},[g,E])}])},932031,942917,e=>{"use strict";let t=(0,e.i(433721).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["default",0,t],942917),e.s(["ChevronRightIcon",0,t],932031)},917955,e=>{"use strict";var t=e.i(344180),r=e.i(648224),n=e.i(465458);e.i(932031),e.i(299648),e.s(["DropdownMenu",0,function({...e}){return(0,t.jsx)(r.Menu.Root,{"data-slot":"dropdown-menu",...e})},"DropdownMenuContent",0,function({align:e="start",alignOffset:o=0,side:a="bottom",sideOffset:i=4,className:l,...s}){return(0,t.jsx)(r.Menu.Portal,{children:(0,t.jsx)(r.Menu.Positioner,{className:"isolate z-50 outline-none",align:e,alignOffset:o,side:a,sideOffset:i,children:(0,t.jsx)(r.Menu.Popup,{"data-slot":"dropdown-menu-content",className:(0,n.cn)("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",l),...s})})})},"DropdownMenuGroup",0,function({...e}){return(0,t.jsx)(r.Menu.Group,{"data-slot":"dropdown-menu-group",...e})},"DropdownMenuItem",0,function({className:e,inset:o,variant:a="default",...i}){return(0,t.jsx)(r.Menu.Item,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":a,className:(0,n.cn)("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...i})},"DropdownMenuLabel",0,function({className:e,inset:o,...a}){return(0,t.jsx)(r.Menu.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":o,className:(0,n.cn)("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",e),...a})},"DropdownMenuSeparator",0,function({className:e,...o}){return(0,t.jsx)(r.Menu.Separator,{"data-slot":"dropdown-menu-separator",className:(0,n.cn)("-mx-1 my-1 h-px bg-border",e),...o})},"DropdownMenuShortcut",0,function({className:e,...r}){return(0,t.jsx)("span",{"data-slot":"dropdown-menu-shortcut",className:(0,n.cn)("ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",e),...r})},"DropdownMenuTrigger",0,function({...e}){return(0,t.jsx)(r.Menu.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}])},137340,288556,e=>{"use strict";let t=(0,e.i(433721).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["default",0,t],288556),e.s(["Trash2",0,t],137340)},816709,e=>{"use strict";var t=e.i(764556);let r=e=>{let t,r=new Set,n=(e,n)=>{let o="function"==typeof e?e(t):e;if(!Object.is(o,t)){let e=t;t=(null!=n?n:"object"!=typeof o||null===o)?o:Object.assign({},t,o),r.forEach(r=>r(t,e))}},o=()=>t,a={setState:n,getState:o,getInitialState:()=>i,subscribe:e=>(r.add(e),()=>r.delete(e))},i=t=e(n,o,a);return a},n=e=>{let n=e?r(e):r,o=e=>(function(e,r=e=>e){let n=t.default.useSyncExternalStore(e.subscribe,t.default.useCallback(()=>r(e.getState()),[e,r]),t.default.useCallback(()=>r(e.getInitialState()),[e,r]));return t.default.useDebugValue(n),n})(n,e);return Object.assign(o,n),o};e.s(["create",0,e=>e?n(e):n],816709)},433721,e=>{"use strict";var t=e.i(764556);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),n=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,t.createContext)({}),i=(0,t.forwardRef)(({color:e,size:n,strokeWidth:i,absoluteStrokeWidth:l,className:s="",children:u,iconNode:c,...d},f)=>{let{size:h=24,strokeWidth:v=2,absoluteStrokeWidth:p=!1,color:m="currentColor",className:g=""}=(0,t.useContext)(a)??{},w=l??p?24*Number(i??v)/Number(n??h):i??v;return(0,t.createElement)("svg",{ref:f,...o,width:n??h??o.width,height:n??h??o.height,stroke:e??m,strokeWidth:w,className:r("lucide",g,s),...!u&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(d)&&{"aria-hidden":"true"},...d},[...c.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(u)?u:[u]])});e.s(["default",0,(e,o)=>{let a=(0,t.forwardRef)(({className:a,...l},s)=>(0,t.createElement)(i,{ref:s,iconNode:o,className:r(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,a),...l}));return a.displayName=n(e),a}],433721)},250226,e=>{"use strict";let t=(0,e.i(816709).create)(e=>({activePanel:"channel-list",setActivePanel:t=>e({activePanel:t}),overlays:[],registerOverlay:(t,r,n)=>e(e=>{if(n?.ignoreBack)return e;let o=e.overlays.findIndex(e=>e.id===t);if(-1===o)return{overlays:[...e.overlays,{id:t,close:r}]};let a=[...e.overlays];return a[o]={id:t,close:r},{overlays:a}}),unregisterOverlay:t=>e(e=>({overlays:e.overlays.filter(e=>e.id!==t)})),handleBackAction:()=>{let{overlays:r,activePanel:n}=t.getState(),o=r[r.length-1];return o?(o.close(),!0):"issue-detail"===n?(e({activePanel:"issue-list"}),!0):"chat"===n&&(e({activePanel:"channel-list"}),!0)}}));e.s(["useMobilePanelStore",0,t])},523592,e=>{"use strict";var t=e.i(8890);let r="agent-spaces-servers",n="agent-spaces-active-server",o="active-server";function a(){let e=t.default.env.NEXT_PUBLIC_SERVER_URL?.trim();if(e)return e.replace(/\/$/,"");let{hostname:r,port:n}=window.location;return("localhost"===r||"127.0.0.1"===r)&&"3000"===n?`http://${r}:3100`:window.location.origin}let i=[{id:"default",name:"Default",url:a()}];function l(){try{let e=localStorage.getItem(r);return e?JSON.parse(e).map(e=>"default"!==e.id||e.url?e:{...e,url:a()}):i}catch{return i}}function s(){return localStorage.getItem(n)||"default"}function u(){let e=l(),t=s();return e.find(e=>e.id===t)||e[0]||null}function c(){return u()?.url??null}e.s(["getActiveServer",0,u,"getActiveServerUrl",0,c,"loadActiveId",0,s,"loadServers",0,l,"resolveServerAssetUrl",0,function(e){if(!e)return"";if(/^(?:[a-z][a-z\d+\-.]*:)?\/\//i.test(e)||e.startsWith("data:")||e.startsWith("blob:"))return e;let t=c();return t?`${t.replace(/\/$/,"")}${e.startsWith("/")?"":"/"}${e}`:e},"saveActiveId",0,function(e){localStorage.setItem(n,e)},"saveServers",0,function(e){localStorage.setItem(r,JSON.stringify(e))},"setActiveServerCookie",0,function(e){e?document.cookie=`${o}=${encodeURIComponent(e)}; path=/; max-age=31536000; SameSite=Lax`:document.cookie=`${o}=; path=/; max-age=0`}])},50153,e=>{"use strict";let t=(0,e.i(433721).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",0,t])},189131,e=>{"use strict";var t=e.i(764556);let r=t.createContext(void 0);e.s(["useDirection",0,function(){let e=t.useContext(r);return e?.direction??"ltr"}])},459250,e=>{"use strict";var t=e.i(764556);let r=t.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});e.s(["CompositeListContext",0,r,"useCompositeListContext",0,function(){return t.useContext(r)}])},296615,e=>{"use strict";var t,r=e.i(764556),n=e.i(277642),o=e.i(459250);let a=((t={})[t.None=0]="None",t[t.GuessFromOrder=1]="GuessFromOrder",t);e.s(["useCompositeListItem",0,function(e={}){let{label:t,metadata:i,textRef:l,indexGuessBehavior:s,index:u}=e,{register:c,unregister:d,subscribeMapChange:f,elementsRef:h,labelsRef:v,nextIndexRef:p}=(0,o.useCompositeListContext)(),m=r.useRef(-1),[g,w]=r.useState(u??(s===a.GuessFromOrder?()=>{if(-1===m.current){let e=p.current;p.current+=1,m.current=e}return m.current}:-1)),x=r.useRef(null),b=r.useCallback(e=>{if(x.current=e,-1!==g&&null!==e&&(h.current[g]=e,v)){let r=void 0!==t;v.current[g]=r?t:l?.current?.textContent??e.textContent}},[g,h,v,t,l]);return(0,n.useIsoLayoutEffect)(()=>{if(null!=u)return;let e=x.current;if(e)return c(e,i),()=>{d(e)}},[u,c,d,i]),(0,n.useIsoLayoutEffect)(()=>{if(null==u)return f(e=>{let t=x.current?e.get(x.current)?.index:null;null!=t&&w(t)})},[u,f,w]),r.useMemo(()=>({ref:b,index:g}),[g,b])}])},756432,e=>{"use strict";var t=e.i(764556),r=e.i(549154),n=e.i(29905),o=e.i(277642),a=e.i(459250),i=e.i(344180);function l(){return new Map}function s(){return new Set}function u(e,t){let r=e.compareDocumentPosition(t);return r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS?1:0}e.s(["CompositeList",0,function(e){let{children:c,elementsRef:d,labelsRef:f,onMapChange:h}=e,v=(0,n.useStableCallback)(h),p=t.useRef(0),m=(0,r.useRefWithInit)(s).current,g=(0,r.useRefWithInit)(l).current,[w,x]=t.useState(0),b=t.useRef(w),y=(0,n.useStableCallback)((e,t)=>{g.set(e,t??null),b.current+=1,x(b.current)}),S=(0,n.useStableCallback)(e=>{g.delete(e),b.current+=1,x(b.current)}),E=t.useMemo(()=>{let e=new Map;return Array.from(g.keys()).filter(e=>e.isConnected).sort(u).forEach((t,r)=>{let n=g.get(t)??{};e.set(t,{...n,index:r})}),e},[g,w]);(0,o.useIsoLayoutEffect)(()=>{if("function"!=typeof MutationObserver||0===E.size)return;let e=new MutationObserver(e=>{let t=new Set,r=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(r),e.addedNodes.forEach(r)}),0===t.size&&(b.current+=1,x(b.current))});return E.forEach((t,r)=>{r.parentElement&&e.observe(r.parentElement,{childList:!0})}),()=>{e.disconnect()}},[E]),(0,o.useIsoLayoutEffect)(()=>{b.current===w&&(d.current.length!==E.size&&(d.current.length=E.size),f&&f.current.length!==E.size&&(f.current.length=E.size),p.current=E.size),v(E)},[v,E,d,f,w]),(0,o.useIsoLayoutEffect)(()=>()=>{d.current=[]},[d]),(0,o.useIsoLayoutEffect)(()=>()=>{f&&(f.current=[])},[f]);let C=(0,n.useStableCallback)(e=>(m.add(e),()=>{m.delete(e)}));(0,o.useIsoLayoutEffect)(()=>{m.forEach(e=>e(E))},[m,E]);let M=t.useMemo(()=>({register:y,unregister:S,subscribeMapChange:C,elementsRef:d,labelsRef:f,nextIndexRef:p}),[y,S,C,d,f,p]);return(0,i.jsx)(a.CompositeListContext.Provider,{value:M,children:c})}])},530909,e=>{"use strict";var t=e.i(764556),r=e.i(204133),n=e.i(352360),o=e.i(296615);e.s(["useCompositeItem",0,function(e={}){let{highlightItemOnHover:a,highlightedIndex:i,onHighlightedIndexChange:l}=(0,n.useCompositeRootContext)(),{ref:s,index:u}=(0,o.useCompositeListItem)(e),c=i===u,d=t.useRef(null),f=(0,r.useMergedRefs)(s,d);return{compositeProps:t.useMemo(()=>({tabIndex:c?0:-1,onFocus(){l(u)},onMouseMove(){let e=d.current;if(!a||!e)return;let t=e.hasAttribute("disabled")||"true"===e.ariaDisabled;c||t||e.focus()}}),[c,l,u,a]),compositeRef:f,index:u}}])},355819,e=>{"use strict";let t=(0,e.i(816709).create)((e,t)=>({agents:[],loaded:!1,loading:!1,ensure:async()=>{let{loaded:r,loading:n}=t();if(!r&&!n){e({loading:!0});try{let t=await fetch("/api/agents/presets");if(!t.ok)return;let r=await t.json();e({agents:r,loaded:!0})}catch{}finally{e({loading:!1})}}},toggleEnabled:async r=>{let n=t().agents.find(e=>e.id===r);if(!n)return;let o=!n.enabled;e(e=>({agents:e.agents.map(e=>e.id===r?{...e,enabled:o}:e)}));try{(await fetch(`/api/agents/presets/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,enabled:o})})).ok||e(e=>({agents:e.agents.map(e=>e.id===r?{...e,enabled:n.enabled}:e)}))}catch{e(e=>({agents:e.agents.map(e=>e.id===r?{...e,enabled:n.enabled}:e)}))}}}));e.s(["findAgentById",0,function(e){return t.getState().agents.find(t=>t.id===e)},"useAgentStore",0,t])},611176,e=>{"use strict";var t=e.i(344180),r=e.i(764556),n=e.i(465458),o=e.i(523592),a=e.i(355819);let i=[[/generativelanguage\.googleapis\.com/i,"gemini"],[/aiplatform\.googleapis\.com/i,"google"],[/api\.anthropic\.com/i,"anthropic"],[/api\.openai\.com/i,"openai"],[/api\.deepseek\.com/i,"deepseek"],[/open\.bigmodel\.cn/i,"zhipu"],[/api\.moonshot\.cn/i,"kimi"],[/dashscope\.aliyuncs\.com/i,"alibaba"],[/dashscope\.com/i,"alibaba"],[/aip\.baidubce\.com/i,"baidu"],[/ark\.cn-beijing\.volces\.com/i,"doubao"],[/api\.coze\./i,"doubao"],[/api\.minimax\.chat/i,"minimax"],[/api\.minimaxi\.com/i,"minimax"],[/api\.mistral\.ai/i,"mistral"],[/api\.groq\.com/i,"xai"],[/api\.x\.ai/i,"xai"],[/openrouter\.ai/i,"openrouter"],[/api\.siliconflow\.cn/i,"siliconflow"],[/localhost.*11434/i,"ollama"],[/127\.0\.0\.1.*11434/i,"ollama"],[/api\.cohere\./i,"cohere"],[/api-inference\.huggingface\.co/i,"huggingface"],[/openai\.azure\.com/i,"azure"],[/\.openai\.azure\.com/i,"azure"],[/bedrock-runtime\..*\.amazonaws\.com/i,"aws"],[/api\.huawei\./i,"huawei"],[/hunyuan\.tencentcloudapi\.com/i,"tencent"],[/api\.01\.ai/i,"yi"],[/api\.stepfun\.com/i,"stepfun"],[/api\.novita\.ai/i,"novita"],[/integrate\.api\.nvidia\.com/i,"nvidia"],[/api\.cloudflare\.com\/client\/v4\/accounts/i,"cloudflare"],[/meta\.llama/i,"meta"]];e.s(["AgentIcon",0,function({agentId:e,name:l,avatarUrl:s,apiBase:u,className:c,onClick:d}){let f,h=(0,a.useAgentStore)(e=>e.agents),[v,p]=(0,r.useState)(!1),[m,g]=(0,r.useState)(!1),w=e?h.find(t=>t.id===e):void 0,x=l||w?.name||e||"?",b=s??w?.avatarUrl,y=u??w?.apiBase,S=!v&&(0,o.resolveServerAssetUrl)(b)||(m?"":(f=function(e){if(!e)return"";for(let[t,r]of i)if(t.test(e))return r;return""}(y))?(0,o.resolveServerAssetUrl)(`/static/provider-icons/${f}.svg`):"");(0,r.useEffect)(()=>{p(!1),g(!1)},[b,y]);let E=x.charAt(0).toUpperCase();return(0,t.jsx)("div",{onClick:d,className:(0,n.cn)("flex items-center justify-center overflow-hidden rounded-lg bg-muted shrink-0",S&&"bg-transparent",!d&&"pointer-events-none",d&&"cursor-pointer hover:opacity-80 transition-opacity",c),children:S?(0,t.jsx)("img",{src:S,alt:x,className:"size-full object-cover rounded-[inherit]",onError:()=>{!v&&b?p(!0):g(!0)}}):(0,t.jsx)("span",{className:"text-xs font-semibold select-none",children:E})})}])},394394,e=>{"use strict";var t=e.i(764556);let r=t.createContext(void 0),n={disableStyleElements:!1};e.s(["useCSPContext",0,function(){return t.useContext(r)??n}])},464111,e=>{"use strict";e.s(["clamp",0,function(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}])},191118,e=>{"use strict";var t,r,n,o,a,i=e.i(344180);e.s([],556166),e.i(556166),e.i(8890);var l=e.i(764556),s=e.i(29905),u=e.i(232449),c=e.i(267805);let d=l.createContext(void 0);function f(){let e=l.useContext(d);if(void 0===e)throw Error((0,c.default)(53));return e}var h=e.i(969490);let v=((t={}).scrollAreaCornerHeight="--scroll-area-corner-height",t.scrollAreaCornerWidth="--scroll-area-corner-width",t);function p(e,t,r){if(!e)return 0;let n=getComputedStyle(e),o="x"===r?"Inline":"Block";return"x"===r&&"margin"===t?2*parseFloat(n[`${t}InlineStart`]):parseFloat(n[`${t}${o}Start`])+parseFloat(n[`${t}${o}End`])}let m=((r={}).orientation="data-orientation",r.hovering="data-hovering",r.scrolling="data-scrolling",r.hasOverflowX="data-has-overflow-x",r.hasOverflowY="data-has-overflow-y",r.overflowXStart="data-overflow-x-start",r.overflowXEnd="data-overflow-x-end",r.overflowYStart="data-overflow-y-start",r.overflowYEnd="data-overflow-y-end",r),g="base-ui-disable-scrollbar";var w=e.i(139236);let x=((n={}).scrolling="data-scrolling",n.hasOverflowX="data-has-overflow-x",n.hasOverflowY="data-has-overflow-y",n.overflowXStart="data-overflow-x-start",n.overflowXEnd="data-overflow-x-end",n.overflowYStart="data-overflow-y-start",n.overflowYEnd="data-overflow-y-end",n),b={hasOverflowX:e=>e?{[x.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[x.hasOverflowY]:""}:null,overflowXStart:e=>e?{[x.overflowXStart]:""}:null,overflowXEnd:e=>e?{[x.overflowXEnd]:""}:null,overflowYStart:e=>e?{[x.overflowYStart]:""}:null,overflowYEnd:e=>e?{[x.overflowYEnd]:""}:null,cornerHidden:()=>null};var y=e.i(410421),S=e.i(394394);let E={x:0,y:0},C={width:0,height:0},M={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},R={x:!0,y:!0,corner:!0},O=l.forwardRef(function(e,t){let r,{render:n,className:o,overflowEdgeThreshold:a,style:c,...f}=e,x=function(e){if("number"==typeof e){let t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}(a),O=(0,w.useBaseUiId)(),A=(0,u.useTimeout)(),N=(0,u.useTimeout)(),{nonce:I,disableStyleElements:T}=(0,S.useCSPContext)(),[k,L]=l.useState(!1),[P,z]=l.useState(!1),[W,j]=l.useState(!1),[X,$]=l.useState(!1),[Y,D]=l.useState(!1),[H,U]=l.useState(C),[_,F]=l.useState(C),[B,G]=l.useState(M),[V,K]=l.useState(R),q=l.useRef(null),J=l.useRef(null),Z=l.useRef(null),Q=l.useRef(null),ee=l.useRef(null),et=l.useRef(null),er=l.useRef(null),en=l.useRef(!1),eo=l.useRef(0),ea=l.useRef(0),ei=l.useRef(0),el=l.useRef(0),es=l.useRef("vertical"),eu=l.useRef(E),ec=(0,s.useStableCallback)(e=>{let t=e.x-eu.current.x,r=e.y-eu.current.y;eu.current=e,0!==r&&(j(!0),A.start(500,()=>{j(!1)})),0!==t&&(z(!0),N.start(500,()=>{z(!1)}))}),ed=(0,s.useStableCallback)(e=>{0===e.button&&(en.current=!0,eo.current=e.clientY,ea.current=e.clientX,es.current=e.currentTarget.getAttribute(m.orientation),J.current&&(ei.current=J.current.scrollTop,el.current=J.current.scrollLeft),ee.current&&"vertical"===es.current&&ee.current.setPointerCapture(e.pointerId),et.current&&"horizontal"===es.current&&et.current.setPointerCapture(e.pointerId))}),ef=(0,s.useStableCallback)(e=>{if(!en.current)return;let t=e.clientY-eo.current,r=e.clientX-ea.current;if(J.current){let n=J.current.scrollHeight,o=J.current.clientHeight,a=J.current.scrollWidth,i=J.current.clientWidth;if(ee.current&&Z.current&&"vertical"===es.current){let r=p(Z.current,"padding","y"),a=p(ee.current,"margin","y"),i=ee.current.offsetHeight,l=Z.current.offsetHeight-i-r-a;J.current.scrollTop=ei.current+t/l*(n-o),e.preventDefault(),j(!0),A.start(500,()=>{j(!1)})}if(et.current&&Q.current&&"horizontal"===es.current){let t=p(Q.current,"padding","x"),n=p(et.current,"margin","x"),o=et.current.offsetWidth,l=Q.current.offsetWidth-o-t-n;J.current.scrollLeft=el.current+r/l*(a-i),e.preventDefault(),z(!0),N.start(500,()=>{z(!1)})}}}),eh=(0,s.useStableCallback)(e=>{en.current=!1,ee.current&&"vertical"===es.current&&ee.current.releasePointerCapture(e.pointerId),et.current&&"horizontal"===es.current&&et.current.releasePointerCapture(e.pointerId)});function ev(e){$("touch"===e.pointerType)}function ep(e){ev(e),"touch"!==e.pointerType&&L((0,y.contains)(q.current,e.target))}let em=l.useMemo(()=>({scrolling:P||W,hasOverflowX:!V.x,hasOverflowY:!V.y,overflowXStart:B.xStart,overflowXEnd:B.xEnd,overflowYStart:B.yStart,overflowYEnd:B.yEnd,cornerHidden:V.corner}),[P,W,V.x,V.y,V.corner,B]),eg={role:"presentation",onPointerEnter:ep,onPointerMove:ep,onPointerDown:ev,onPointerLeave(){L(!1)},style:{position:"relative",[v.scrollAreaCornerHeight]:`${H.height}px`,[v.scrollAreaCornerWidth]:`${H.width}px`}},ew=(0,h.useRenderElement)("div",e,{state:em,ref:[t,q],props:[eg,f],stateAttributesMapping:b}),ex=l.useMemo(()=>({handlePointerDown:ed,handlePointerMove:ef,handlePointerUp:eh,handleScroll:ec,cornerSize:H,setCornerSize:U,thumbSize:_,setThumbSize:F,hasMeasuredScrollbar:Y,setHasMeasuredScrollbar:D,touchModality:X,cornerRef:er,scrollingX:P,setScrollingX:z,scrollingY:W,setScrollingY:j,hovering:k,setHovering:L,viewportRef:J,rootRef:q,scrollbarYRef:Z,scrollbarXRef:Q,thumbYRef:ee,thumbXRef:et,rootId:O,hiddenState:V,setHiddenState:K,overflowEdges:B,setOverflowEdges:G,viewportState:em,overflowEdgeThreshold:x}),[ed,ef,eh,ec,H,_,Y,X,P,z,W,j,k,L,O,V,B,em,x]);return(0,i.jsxs)(d.Provider,{value:ex,children:[!T&&(r=I,(0,i.jsx)("style",{nonce:r,href:g,precedence:"base-ui:low",children:`.${g}{scrollbar-width:none}.${g}::-webkit-scrollbar{display:none}`})),ew]})});var A=e.i(277642),N=e.i(454889);let I=l.createContext(void 0);var T=e.i(189131),k=e.i(464111);let L=((o={}).scrollAreaOverflowXStart="--scroll-area-overflow-x-start",o.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",o.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",o.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",o);function P(e,t){if(t<=0)return 0;let r=(0,k.clamp)(e,0,t),n=t-r,o=r<=1,a=n<=1;return o&&a?r<=n?0:t:o?0:a?t:r}let z=!1,W=l.forwardRef(function(e,t){let{render:r,className:n,style:o,...a}=e,{viewportRef:c,scrollbarYRef:d,scrollbarXRef:v,thumbYRef:m,thumbXRef:w,cornerRef:x,cornerSize:y,setCornerSize:S,setThumbSize:E,rootId:C,setHiddenState:M,hiddenState:R,setHasMeasuredScrollbar:O,handleScroll:W,setHovering:j,setOverflowEdges:X,overflowEdges:$,overflowEdgeThreshold:Y,scrollingX:D,scrollingY:H}=f(),U=(0,T.useDirection)(),_=l.useRef(!0),F=l.useRef([NaN,NaN,NaN,NaN]),B=(0,u.useTimeout)(),G=(0,u.useTimeout)(),V=(0,s.useStableCallback)(()=>{var e;let t,r,n=c.current,o=d.current,a=v.current,i=m.current,l=w.current,s=x.current;if(!n)return;let u=n.scrollHeight,f=n.scrollWidth,h=n.clientHeight,g=n.clientWidth,b=n.scrollTop,C=n.scrollLeft,R=F.current,A=Number.isNaN(R[0]);if(R[0]=h,R[1]=u,R[2]=g,R[3]=f,A&&O(!0),0===u||0===f)return;let N=(t=(e=n).clientHeight>=e.scrollHeight,{y:t,x:r=e.clientWidth>=e.scrollWidth,corner:t||r}),I=N.y,T=N.x,z=g/f,W=h/u,j=Math.max(0,f-g),$=Math.max(0,u-h),D=0,H=0;!T&&(D=P("rtl"===U?(0,k.clamp)(-C,0,j):(0,k.clamp)(C,0,j),j),H=j-D);let _=I?0:(0,k.clamp)(b,0,$),B=I?0:P(_,$),G=I?0:$-B,V=T?0:g,K=I?0:h,q=0,J=0;T||I||(q=o?.offsetWidth||0,J=a?.offsetHeight||0);let Z=0===y.width&&0===y.height,Q=Z?q:0,ee=Z?J:0,et=p(a,"padding","x"),er=p(o,"padding","y"),en=p(l,"margin","x"),eo=p(i,"margin","y"),ea=V-et-en,ei=K-er-eo,el=a?Math.min(a.offsetWidth-Q,ea):ea,es=o?Math.min(o.offsetHeight-ee,ei):ei,eu=Math.max(16,el*z),ec=Math.max(16,es*W);if(E(e=>e.height===ec&&e.width===eu?e:{width:eu,height:ec}),o&&i){let e=o.offsetHeight-ec-er-eo,t=u-h,r=Math.min(e,Math.max(0,(0===t?0:b/t)*e));i.style.transform=`translate3d(0,${r}px,0)`}if(a&&l){let e=a.offsetWidth-eu-et-en,t=f-g,r=0===t?0:C/t,n="rtl"===U?(0,k.clamp)(r*e,-e,0):(0,k.clamp)(r*e,0,e);l.style.transform=`translate3d(${n}px,0,0)`}for(let[e,t]of[[L.scrollAreaOverflowXStart,D],[L.scrollAreaOverflowXEnd,H],[L.scrollAreaOverflowYStart,B],[L.scrollAreaOverflowYEnd,G]])n.style.setProperty(e,`${t}px`);s&&(T||I?S({width:0,height:0}):T||I||S({width:q,height:J})),M(e=>{var t,r;return t=e,r=N,t.y===r.y&&t.x===r.x&&t.corner===r.corner?t:r});let ed={xStart:!T&&D>Y.xStart,xEnd:!T&&H>Y.xEnd,yStart:!I&&B>Y.yStart,yEnd:!I&&G>Y.yEnd};X(e=>e.xStart===ed.xStart&&e.xEnd===ed.xEnd&&e.yStart===ed.yStart&&e.yEnd===ed.yEnd?e:ed)});function K(){_.current=!1}(0,A.useIsoLayoutEffect)(()=>{c.current&&(z||N.isWebKit||("u">typeof CSS&&"registerProperty"in CSS&&[L.scrollAreaOverflowXStart,L.scrollAreaOverflowXEnd,L.scrollAreaOverflowYStart,L.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),z=!0))},[c]),(0,A.useIsoLayoutEffect)(()=>{queueMicrotask(V)},[V,R,U]),(0,A.useIsoLayoutEffect)(()=>{c.current?.matches(":hover")&&j(!0)},[c,j]),l.useEffect(()=>{let e=c.current;if("u"<typeof ResizeObserver||!e)return;let t=!1,r=new ResizeObserver(()=>{if(!t){t=!0;let r=F.current;if(r[0]===e.clientHeight&&r[1]===e.scrollHeight&&r[2]===e.clientWidth&&r[3]===e.scrollWidth)return}V()});return r.observe(e),G.start(0,()=>{let t=e.getAnimations({subtree:!0});0!==t.length&&Promise.allSettled(t.map(e=>e.finished)).then(V).catch(()=>{})}),()=>{r.disconnect(),G.clear()}},[V,c,G]);let q={role:"presentation",...C&&{"data-id":`${C}-viewport`},tabIndex:R.x&&R.y?-1:0,className:g,style:{overflow:"scroll"},onScroll(){c.current&&(V(),_.current||W({x:c.current.scrollLeft,y:c.current.scrollTop}),B.start(100,()=>{_.current=!0}))},onWheel:K,onTouchMove:K,onPointerMove:K,onPointerEnter:K,onKeyDown:K},J=l.useMemo(()=>({scrolling:D||H,hasOverflowX:!R.x,hasOverflowY:!R.y,overflowXStart:$.xStart,overflowXEnd:$.xEnd,overflowYStart:$.yStart,overflowYEnd:$.yEnd,cornerHidden:R.corner}),[D,H,R.x,R.y,R.corner,$]),Z=(0,h.useRenderElement)("div",e,{ref:[t,c],state:J,props:[q,a],stateAttributesMapping:b}),Q=l.useMemo(()=>({computeThumbPosition:V}),[V]);return(0,i.jsx)(I.Provider,{value:Q,children:Z})});var j=e.i(422561);let X=l.createContext(void 0),$=((a={}).scrollAreaThumbHeight="--scroll-area-thumb-height",a.scrollAreaThumbWidth="--scroll-area-thumb-width",a),Y=l.forwardRef(function(e,t){let{render:r,className:n,orientation:o="vertical",keepMounted:a=!1,style:s,...u}=e,{hovering:c,scrollingX:d,scrollingY:m,hiddenState:g,overflowEdges:w,scrollbarYRef:x,scrollbarXRef:S,viewportRef:E,thumbYRef:C,thumbXRef:M,handlePointerDown:R,handlePointerUp:O,rootId:A,thumbSize:N,hasMeasuredScrollbar:I}=f(),k={hovering:c,scrolling:{horizontal:d,vertical:m}[o],orientation:o,hasOverflowX:!g.x,hasOverflowY:!g.y,overflowXStart:w.xStart,overflowXEnd:w.xEnd,overflowYStart:w.yStart,overflowYEnd:w.yEnd,cornerHidden:g.corner},L=(0,T.useDirection)();l.useEffect(()=>{let e=E.current,t="vertical"===o?x.current:S.current;if(t)return(0,j.addEventListener)(t,"wheel",function(r){if(e&&t&&!r.ctrlKey){if(r.preventDefault(),"vertical"===o){if(0===e.scrollTop&&r.deltaY<0)return}else if(0===e.scrollLeft&&r.deltaX<0)return;if("vertical"===o){if(e.scrollTop===e.scrollHeight-e.clientHeight&&r.deltaY>0)return}else if(e.scrollLeft===e.scrollWidth-e.clientWidth&&r.deltaX>0)return;"vertical"===o?e.scrollTop+=r.deltaY:e.scrollLeft+=r.deltaX}},{passive:!1})},[o,S,x,E]);let P={...A&&{"data-id":`${A}-scrollbar`},onPointerDown(e){if(0!==e.button)return;let t=(0,y.getTarget)(e.nativeEvent),r="vertical"===o?C.current:M.current;if(!(r&&(0,y.contains)(r,t))&&E.current){if(C.current&&x.current&&"vertical"===o){let t=p(C.current,"margin","y"),r=p(x.current,"padding","y"),n=C.current.offsetHeight,o=x.current.getBoundingClientRect(),a=e.clientY-o.top-n/2-r+t/2,i=E.current.scrollHeight,l=E.current.clientHeight,s=x.current.offsetHeight-n-r-t;E.current.scrollTop=a/s*(i-l)}if(M.current&&S.current&&"horizontal"===o){let t,r=p(M.current,"margin","x"),n=p(S.current,"padding","x"),o=M.current.offsetWidth,a=S.current.getBoundingClientRect(),i=e.clientX-a.left-o/2-n+r/2,l=E.current.scrollWidth,s=E.current.clientWidth,u=i/(S.current.offsetWidth-o-n-r);"rtl"===L?(t=(1-u)*(l-s),E.current.scrollLeft<=0&&(t=-t)):t=u*(l-s),E.current.scrollLeft=t}R(e)}},onPointerUp:O,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",visibility:I||a?void 0:"hidden",..."vertical"===o&&{top:0,bottom:`var(${v.scrollAreaCornerHeight})`,insetInlineEnd:0,[$.scrollAreaThumbHeight]:`${N.height}px`},..."horizontal"===o&&{insetInlineStart:0,insetInlineEnd:`var(${v.scrollAreaCornerWidth})`,bottom:0,[$.scrollAreaThumbWidth]:`${N.width}px`}}},z=(0,h.useRenderElement)("div",e,{ref:[t,"vertical"===o?x:S],state:k,props:[P,u],stateAttributesMapping:b}),W=l.useMemo(()=>({orientation:o}),[o]),Y="vertical"===o?g.y:g.x;return a||!Y?(0,i.jsx)(X.Provider,{value:W,children:z}):null}),D=l.forwardRef(function(e,t){let{render:r,className:n,style:o,...a}=e,i=l.useRef(null),{computeThumbPosition:s}=function(){let e=l.useContext(I);if(void 0===e)throw Error((0,c.default)(55));return e}(),{viewportState:u}=f();return(0,A.useIsoLayoutEffect)(()=>{if("u"<typeof ResizeObserver)return;let e=!1,t=new ResizeObserver(()=>{if(!e){e=!0;return}s()});return i.current&&t.observe(i.current),()=>{t.disconnect()}},[s]),(0,h.useRenderElement)("div",e,{ref:[t,i],state:u,stateAttributesMapping:b,props:[{role:"presentation",style:{minWidth:"fit-content"}},a]})}),H=l.forwardRef(function(e,t){let{render:r,className:n,style:o,...a}=e,{thumbYRef:i,thumbXRef:s,handlePointerDown:u,handlePointerMove:d,handlePointerUp:v,setScrollingX:p,setScrollingY:m,hasMeasuredScrollbar:g}=f(),{orientation:w}=function(){let e=l.useContext(X);if(void 0===e)throw Error((0,c.default)(54));return e}();return(0,h.useRenderElement)("div",e,{ref:[t,"vertical"===w?i:s],state:{orientation:w},props:[{onPointerDown:u,onPointerMove:d,onPointerUp(e){"vertical"===w&&m(!1),"horizontal"===w&&p(!1),v(e)},style:{visibility:g?void 0:"hidden",..."vertical"===w&&{height:`var(${$.scrollAreaThumbHeight})`},..."horizontal"===w&&{width:`var(${$.scrollAreaThumbWidth})`}}},a]})}),U=l.forwardRef(function(e,t){let{render:r,className:n,style:o,...a}=e,{cornerRef:i,cornerSize:l,hiddenState:s}=f(),u=(0,h.useRenderElement)("div",e,{ref:[t,i],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:l.width,height:l.height}},a]});return s.corner?null:u});e.s(["Content",0,D,"Corner",0,U,"Root",0,O,"Scrollbar",0,Y,"Thumb",0,H,"Viewport",0,W],787180);var _=e.i(787180),_=_,F=e.i(465458);function B({className:e,orientation:t="vertical",...r}){return(0,i.jsx)(_.Scrollbar,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:(0,F.cn)("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",e),...r,children:(0,i.jsx)(_.Thumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}e.s(["ScrollArea",0,function({className:e,children:t,...r}){return(0,i.jsxs)(_.Root,{"data-slot":"scroll-area",className:(0,F.cn)("relative overflow-hidden",e),...r,children:[(0,i.jsx)(_.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:t}),(0,i.jsx)(B,{}),(0,i.jsx)(_.Corner,{})]})}],191118)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,76703,e=>{"use strict";var t,i=e.i(281482),o=e.i(487106),r=e.i(79522),n=e.i(589377),s=e.i(362361),a=e.i(193391),d=e.i(781808);e.i(693162);var l=e.i(323249),u=e.i(600345),h=e.i(597556),p=e.i(905670),c=e.i(922292),g=e.i(611130),v=e.i(603358);e.i(1391);var E=e.i(891110),m=e.i(488259),S=e.i(731931),f=e.i(168363),P=e.i(865384),C=e.i(474320),w=e.i(399362),y=e.i(553638),I=e.i(1125),D=e.i(74304),R=e.i(83190),A=e.i(9753);e.i(601293),e.i(168221),e.i(771275),e.i(354244);var _=e.i(865562),T=e.i(425761);let G=new class{constructor(){this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=T.unsupported,this.isTransient=()=>!1,this.windowId=_.mainWindow.vscodeWindowId,this.createEditorActions=T.unsupported,this.onDidFocus=d.Event.None,this.onDidOpenEditorFail=d.Event.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.setActive=T.unsupported,this.notifyIndexChanged=T.unsupported,this.relayout=T.unsupported,this.dispose=T.unsupported,this.toJSON=T.unsupported,this.minimumWidth=0,this.maximumWidth=1/0,this.minimumHeight=0,this.maximumHeight=1/0,this.onDidChange=d.Event.None,this.layout=T.unsupported,this.onDidModelChange=d.Event.None,this.onWillDispose=d.Event.None,this.onDidActiveEditorChange=d.Event.None,this.onWillCloseEditor=d.Event.None,this.onDidCloseEditor=d.Event.None,this.onWillMoveEditor=d.Event.None,this.onWillOpenEditor=d.Event.None,this.id=0,this.index=0,this.label="main",this.ariaLabel="main",this.activeEditorPane=void 0,this.activeEditor=null,this.previewEditor=null,this.count=0,this.isEmpty=!1,this.isLocked=!1,this.stickyCount=0,this.editors=[],this.getEditors=()=>[],this.findEditors=()=>[],this.getEditorByIndex=()=>void 0,this.getIndexOfEditor=T.unsupported,this.openEditor=T.unsupported,this.openEditors=T.unsupported,this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>!1,this.contains=()=>!1,this.moveEditor=T.unsupported,this.moveEditors=T.unsupported,this.copyEditor=T.unsupported,this.copyEditors=T.unsupported,this.closeEditor=T.unsupported,this.closeEditors=T.unsupported,this.closeAllEditors=T.unsupported,this.replaceEditors=T.unsupported,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=T.unsupported,this.isLast=T.unsupported}get groupsView(){return(0,T.unsupported)()}notifyLabelChanged(){}get titleHeight(){return(0,T.unsupported)()}get element(){return(0,T.unsupported)()}get scopedContextKeyService(){return o.StandaloneServices.get(A.IContextKeyService)}focus(){}};class x{constructor(e,t){this.input=e,this.editor=t,this.onDidChangeControl=d.Event.None,this.onDidChangeSizeConstraints=d.Event.None,this.onDidFocus=d.Event.None,this.onDidBlur=d.Event.None,this.options=void 0,this.group=G,this.scopedContextKeyService=void 0,this.getViewState=T.unsupported,this.isVisible=T.unsupported,this.hasFocus=T.unsupported,this.getId=T.unsupported,this.getTitle=T.unsupported,this.focus=T.unsupported}get minimumWidth(){return h.DEFAULT_EDITOR_MIN_DIMENSIONS.width}get maximumWidth(){return h.DEFAULT_EDITOR_MAX_DIMENSIONS.width}get minimumHeight(){return h.DEFAULT_EDITOR_MIN_DIMENSIONS.height}get maximumHeight(){return h.DEFAULT_EDITOR_MAX_DIMENSIONS.height}getControl(){return this.editor}}let b=class extends v.EditorService{constructor(e,t,i,s,d,h,p,g,v,E,m,S,f){super(void 0,i,s,d,h,p,g,v,E,m,S),this._isEditorPartVisible=t,this.openEditor=function(e,t,i){return async function(s,d,h){let p,g=(0,a.isEditorInput)(s)?d:s.options;(0,n.isPreferredGroup)(d)&&(h=d);let v=(0,a.isResourceEditorInput)(s)||(0,a.isEditorInput)(s)?s.resource:void 0;if(null==v||!e.canHandleResource(v))return await t(s,d,h);if(null==(p=o.StandaloneServices.get(r.ICodeEditorService).listCodeEditors().find(e=>e instanceof c.StandaloneEditor&&null!=e.getModel()&&e.getModel().uri.toString()===v.toString()))){let o=await t(s,d,h);if(null!=o)return o;let r=await e.createModelReference(v);if(null==(p=await i?.(r,g,h===n.SIDE_GROUP)))return void r.dispose()}return null!=g&&(0,l.applyTextEditorOptions)(g,p,u.ScrollType.Immediate),g?.preserveFocus||(p.focus(),p.getContainerDomNode().scrollIntoView()),new x((0,a.isEditorInput)(s)?s:void 0,p)}}(f,this.openEditor.bind(this),e)}get activeTextEditorControl(){let e=o.StandaloneServices.get(r.ICodeEditorService).getFocusedCodeEditor();return null!=e&&e instanceof c.StandaloneCodeEditor?e:super.activeTextEditorControl}async openEditor(e,t,i){if(this._isEditorPartVisible())return await super.openEditor(e,t,i)}};b=(0,i.__decorate)([(0,i.__param)(2,E.IEditorGroupsService),(0,i.__param)(3,m.IInstantiationService),(0,i.__param)(4,y.IFileService),(0,i.__param)(5,S.IConfigurationService),(0,i.__param)(6,w.IWorkspaceContextService),(0,i.__param)(7,C.IUriIdentityService),(0,i.__param)(8,P.IEditorResolverService),(0,i.__param)(9,f.IWorkspaceTrustRequestService),(0,i.__param)(10,D.IHostService),(0,i.__param)(11,I.ITextEditorService),(0,i.__param)(12,p.ITextModelService)],b);class O{constructor(e,t,i){this.editor=e,this.input=t,this.group=i,this.onDidChangeControl=d.Event.None,this.options=void 0,this.minimumWidth=0,this.maximumWidth=1/0,this.minimumHeight=0,this.maximumHeight=1/0,this.onDidChangeSizeConstraints=d.Event.None,this.scopedContextKeyService=void 0,this.onDidFocus=this.editor.onDidFocusEditorWidget,this.onDidBlur=this.editor.onDidBlurEditorWidget}getControl(){return this.editor}getViewState(){}isVisible(){return!0}hasFocus(){return this.editor.hasWidgetFocus()}getId(){return this.editor.getId()}getTitle(){}focus(){this.editor.focus()}}let k=t=class extends g.Disposable{constructor(e,i,o,r,n,s){super(),this.editor=e,this.openEditorFallback=i,this.scopedContextKeyService=r,this.editorService=n,this.textModelService=s,this.active=!1,this.selectedEditors=[],this.isSelected=()=>!1,this.setSelection=T.unsupported,this.isTransient=()=>!1,this.windowId=_.mainWindow.vscodeWindowId,this.onDidFocus=this.editor.onDidFocusEditorWidget,this.onDidOpenEditorFail=d.Event.None,this.whenRestored=Promise.resolve(),this.disposed=!1,this.notifyIndexChanged=T.unsupported,this.relayout=T.unsupported,this.toJSON=T.unsupported,this.minimumWidth=0,this.maximumWidth=1/0,this.minimumHeight=0,this.maximumHeight=1/0,this.onDidChange=this.editor.onDidLayoutChange,this.layout=()=>this.editor.layout(),this._onDidModelChange=new d.Emitter,this.onDidModelChange=this._onDidModelChange.event,this.onWillDispose=this.editor.onDidDispose,this._onDidActiveEditorChange=new d.Emitter,this.onDidActiveEditorChange=this._onDidActiveEditorChange.event,this.onWillCloseEditor=d.Event.None,this._onDidCloseEditor=new d.Emitter,this.onDidCloseEditor=this._onDidCloseEditor.event,this.onWillMoveEditor=d.Event.None,this._onWillOpenEditor=new d.Emitter,this.onWillOpenEditor=this._onWillOpenEditor.event,this.id=--t.idCounter,this.index=-1,this.label=`standalone editor ${-this.id}`,this.ariaLabel=`standalone editor ${-this.id}`,this.previewEditor=null,this.isLocked=!0,this.stickyCount=0,this.getEditors=()=>this.editors,this.findEditors=e=>null!=this.pane&&e.toString()===this.pane.input.resource.toString()?[this.pane.input]:[],this.getEditorByIndex=e=>null!=this.pane&&0===e?this.pane.input:void 0,this.getIndexOfEditor=e=>null!=this.pane&&this.pane.input===e?0:-1,this.openEditor=async(e,t)=>{if(!e.isDisposed()&&e instanceof R.TextResourceEditorInput){if(e.resource.toString()===this.pane?.input.resource.toString())return this.focus(),this.pane;if(null!=this.openEditorFallback){let i=await this.textModelService.createModelReference(e.resource),o=await this.openEditorFallback(i,t,!1);return null==o?void i.dispose():new x(e,o)}}},this.openEditors=async e=>{if(1===e.length)return await this.openEditor(e[0].editor)},this.isPinned=()=>!1,this.isSticky=()=>!1,this.isActive=()=>this.editor.hasWidgetFocus(),this.contains=e=>null!=this.pane&&this.pane.input===e,this.moveEditor=T.unsupported,this.moveEditors=T.unsupported,this.copyEditor=T.unsupported,this.copyEditors=T.unsupported,this.closeEditor=T.unsupported,this.closeEditors=T.unsupported,this.closeAllEditors=T.unsupported,this.replaceEditors=T.unsupported,this.pinEditor=()=>{},this.stickEditor=()=>{},this.unstickEditor=()=>{},this.lock=()=>{},this.isFirst=T.unsupported,this.isLast=T.unsupported;const l=t=>{let i=o.createInstance(R.TextResourceEditorInput,t,void 0,void 0,void 0,void 0);this._onWillOpenEditor.fire({editor:i,groupId:this.id}),this.pane=new O(e,i,this),this._onDidModelChange.fire({kind:a.GroupModelChangeKind.EDITOR_OPEN,editor:i,editorIndex:0}),this._onDidActiveEditorChange.fire({editor:i})},u=e=>{if(null!=this.pane&&this.pane.input.resource.toString()===e.toString()){let e=this.pane;this.pane=void 0,this._onDidModelChange.fire({kind:a.GroupModelChangeKind.EDITOR_CLOSE,editorIndex:0}),this._onDidActiveEditorChange.fire({editor:void 0}),this._onDidCloseEditor.fire({context:a.EditorCloseContext.UNKNOWN,editor:e.input,groupId:this.id,index:0,sticky:!1})}};e.onDidChangeModel(e=>{null!=e.oldModelUrl&&u(e.oldModelUrl),null!=e.newModelUrl&&l(e.newModelUrl)}),this._register({dispose:()=>{let t=e.getModel();null!=t&&u(t.uri)}});const h=e.getModel();if(null!=h){const t=o.createInstance(R.TextResourceEditorInput,h.uri,void 0,void 0,void 0,void 0);this.pane=new O(e,t,this)}}get groupsView(){return(0,T.unsupported)()}notifyLabelChanged(){}createEditorActions(){return{actions:{primary:[],secondary:[]},onDidChange:d.Event.None}}get titleHeight(){return(0,T.unsupported)()}setActive(e){this.active=e}get element(){return this.editor.getContainerDomNode()}get activeEditorPane(){return this.pane}get activeEditor(){return this.pane?.input??null}get count(){return+(null!=this.pane)}get isEmpty(){return null==this.pane}get editors(){return null!=this.pane?[this.pane.input]:[]}focus(){this.editor.focus(),this.editor.getContainerDomNode().scrollIntoView()}};k.idCounter=0,k=t=(0,i.__decorate)([(0,i.__param)(2,m.IInstantiationService),(0,i.__param)(3,A.IContextKeyService),(0,i.__param)(4,s.IEditorService),(0,i.__param)(5,p.ITextModelService)],k);let L=class extends g.Disposable{constructor(e,t,i,n){super(),this.delegate=e,this.openEditorFallback=i,this.instantiationService=n,this._serviceBrand=void 0,this.additionalGroups=[],this.activeGroupOverride=void 0,this.onDidCreateAuxiliaryEditorPart=this.delegate.onDidCreateAuxiliaryEditorPart,this.onDidChangeGroupMaximized=this.delegate.onDidChangeGroupMaximized,this._onDidChangeActiveGroup=new d.Emitter,this.onDidChangeActiveGroup=d.Event.any(this._onDidChangeActiveGroup.event,this.delegate.onDidChangeActiveGroup),this._onDidAddGroup=new d.Emitter,this.onDidAddGroup=d.Event.any(this._onDidAddGroup.event,this.delegate.onDidAddGroup),this._onDidRemoveGroup=new d.Emitter,this.onDidRemoveGroup=d.Event.any(this._onDidRemoveGroup.event,this.delegate.onDidRemoveGroup),this.onDidMoveGroup=this.delegate.onDidMoveGroup,this.onDidActivateGroup=this.delegate.onDidActivateGroup,this.onDidChangeGroupIndex=this.delegate.onDidChangeGroupIndex,this.onDidChangeGroupLocked=this.delegate.onDidChangeGroupLocked,this.getLayout=()=>this.delegate.getLayout(),this.getGroups=e=>[...this.delegate.getGroups(e),...this.additionalGroups],this.getGroup=e=>this.delegate.getGroup(e)??this.additionalGroups.find(t=>t.id===e),this.activateGroup=(...e)=>this.delegate.activateGroup(...e),this.getSize=(...e)=>this.delegate.getSize(...e),this.setSize=(...e)=>this.delegate.setSize(...e),this.arrangeGroups=(...e)=>this.delegate.arrangeGroups(...e),this.applyLayout=(...e)=>this.delegate.applyLayout(...e),this.setGroupOrientation=(...e)=>this.delegate.setGroupOrientation(...e),this.findGroup=(...e)=>this.delegate.findGroup(...e),this.addGroup=(...e)=>this.delegate.addGroup(...e),this.removeGroup=(...e)=>this.delegate.removeGroup(...e),this.moveGroup=(...e)=>this.delegate.moveGroup(...e),this.mergeGroup=(...e)=>this.delegate.mergeGroup(...e),this.mergeAllGroups=(...e)=>this.delegate.mergeAllGroups(...e),this.copyGroup=(...e)=>this.delegate.copyGroup(...e),this.onDidChangeEditorPartOptions=this.delegate.onDidChangeEditorPartOptions,this.enforcePartOptions=(...e)=>this.delegate.enforcePartOptions(...e),setTimeout(()=>{let e=o.StandaloneServices.get(r.ICodeEditorService),i=e=>{if(e instanceof c.StandaloneEditor){let i,o=e=>{let t=null!=e?this.additionalGroups.find(t=>t.editor===e):void 0;this.activeGroupOverride!==t&&(this.activeGroupOverride=t,this._onDidChangeActiveGroup.fire(this.activeGroup))},r=e=>{t||this.activeGroupOverride!==this.additionalGroups.find(t=>t.editor===e)||o(void 0)},s=()=>{null!=i&&window.clearTimeout(i),o(e)},a=()=>{null!=i&&window.clearTimeout(i),i=window.setTimeout(()=>{i=void 0,r(e)},100)};e.onDidDispose(()=>{r(e)}),e.onDidFocusEditorText(s),e.onDidFocusEditorWidget(s),e.onDidBlurEditorText(a),e.onDidBlurEditorWidget(a),e.hasWidgetFocus()&&s();let d=n.createInstance(k,e,this.openEditorFallback);this.additionalGroups.push(d),this._onDidAddGroup.fire(d)}},s=e=>{if(e instanceof c.StandaloneEditor){let t=this.additionalGroups.find(t=>t.editor===e);null!=t&&(t.dispose(),this.activeGroupOverride===t&&(this.activeGroupOverride=void 0,this._onDidChangeActiveGroup.fire(this.activeGroup)),this.additionalGroups=this.additionalGroups.filter(e=>e!==t),this._onDidRemoveGroup.fire(t))}};this._register(e.onCodeEditorAdd(i)),this._register(e.onCodeEditorRemove(s)),e.listCodeEditors().forEach(i)})}getScopedInstantiationService(){return this.instantiationService}registerContextKeyProvider(e){return this.delegate.registerContextKeyProvider(e)}saveWorkingSet(e){return this.delegate.saveWorkingSet(e)}getWorkingSets(){return this.delegate.getWorkingSets()}applyWorkingSet(e){return this.delegate.applyWorkingSet(e)}deleteWorkingSet(e){return this.delegate.deleteWorkingSet(e)}get isReady(){return this.delegate.isReady}get whenReady(){return this.delegate.whenReady}get whenRestored(){return this.delegate.whenRestored}get hasRestorableState(){return this.delegate.hasRestorableState}get parts(){return this.delegate.parts}createAuxiliaryEditorPart(e){return this.delegate.createAuxiliaryEditorPart(e)}get mainPart(){return this.delegate.mainPart}getPart(e){return this.delegate.getPart(e)}toggleMaximizeGroup(e){return this.delegate.toggleMaximizeGroup(e)}toggleExpandGroup(e){return this.delegate.toggleExpandGroup(e)}createEditorDropTarget(e,t){return this.delegate.createEditorDropTarget(e,t)}get groups(){return[...this.additionalGroups,...this.delegate.groups]}get activeGroup(){return this.activeGroupOverride??this.delegate.activeGroup}get sideGroup(){return this.delegate.sideGroup}get count(){return this.delegate.count+this.additionalGroups.length}get orientation(){return this.delegate.orientation}get partOptions(){return this.delegate.partOptions}};L=(0,i.__decorate)([(0,i.__param)(3,m.IInstantiationService)],L),e.s(["MonacoDelegateEditorGroupsService",0,L,"MonacoEditorService",0,b,"fakeActiveGroup",0,G])},108792,e=>{"use strict";var t=e.i(281482),i=e.i(454514),o=e.i(590746),r=e.i(40577),n=e.i(354244),s=e.i(802136),a=e.i(487106),d=e.i(731931),l=e.i(253642),u=e.i(553638),h=e.i(526097),p=e.i(488259),c=e.i(947278),g=e.i(853457),v=e.i(701575),E=e.i(140889),m=e.i(578953),S=e.i(399362);e.i(292663),e.i(786896);var f=e.i(244416);e.i(139359);var P=e.i(900340),C=e.i(410676),w=e.i(681874),y=e.i(193391),I=e.i(305063),D=e.i(447186);e.i(456592);var R=e.i(1391),A=e.i(891110),_=e.i(362361),T=e.i(981399),G=e.i(100882),x=e.i(683578),b=e.i(278725),O=e.i(34422),k=e.i(130722);e.i(106452);var L=e.i(211971);e.i(836088);var W=e.i(930941),V=e.i(76703),B=e.i(765129);function M(e){let t=e.getContainer()?.parentNode;null!=t&&e.layout(Math.max(e.minimumWidth,Math.min(e.maximumWidth,t.offsetWidth)),Math.max(e.minimumHeight,Math.min(e.maximumHeight,t.offsetHeight)),t.offsetTop,t.offsetLeft)}function N(e,t){e.oncontextmenu=()=>!1,t.onDidVisibilityChange(e=>{e&&M(t)}),M(t)}function F(e){return a.StandaloneServices.get(c.ILayoutService).getPart(e)}function K(e,t){let i,o=F(e);if(null==o)throw Error("Part not found");return t.append(o.getContainer()),(i=new ResizeObserver(()=>M(o))).observe(t),{dispose:()=>i.disconnect()}}function U(){let e=a.StandaloneServices.get(A.IEditorGroupsService).mainPart.getContainer();return null!=e&&!!e.isConnected&&(null!=e.checkVisibility?e.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):e.offsetHeight>0&&e.offsetWidth>0)}e.i(490499),e.i(243529),e.i(83190),e.i(240159),e.i(46373),e.i(456076),e.i(781112),e.i(976098),e.i(443483);let H=class extends V.MonacoDelegateEditorGroupsService{constructor(e,t){super(t.createInstance(P.EditorParts),!1,e,t),this.restoreGroup=(...e)=>this.delegate.restoreGroup(...e)}getId(){return"standalone"}updateStyles(){}registerPart(e){return this.delegate.registerPart(e)}bind(e,t){return this.delegate.bind(e,t)}get activePart(){return this.delegate.activePart}};H=(0,t.__decorate)([(0,t.__param)(1,p.IInstantiationService)],H);let z=e=>e;function Y(e,t,i){return null!=i&&(z="boolean"==typeof i?e=>({...e,editor:{...e.editor,restoreEditors:i}}):i),{...(0,B.default)(t),...(0,W.default)({isKeybindingConfigurationVisible:U,shouldUseGlobalPicker:U}),...(0,L.default)({shouldUseGlobalKeybindings:U}),[A.IEditorGroupsService.toString()]:new h.SyncDescriptor(H,[e],!1),[_.IEditorService.toString()]:new h.SyncDescriptor(V.MonacoEditorService,[e,U],!1)}}(0,k.onRenderWorkbench)(async e=>{let t=e.get(O.IPaneCompositePartService),a=e.get(D.IViewDescriptorService),h=e.get(b.ILifecycleService),p=e.get(E.IStorageService),P=e.get(A.IEditorGroupsService),k=e.get(_.IEditorService),L=e.get(g.ILogService),W=e.get(T.IExtensionService),V=e.get(l.IEnvironmentService),B=e.get(S.IWorkspaceContextService),M=e.get(d.IConfigurationService),F=e.get(u.IFileService),K=e.get(c.ILayoutService);async function U(e,t){if(null!=t){let o=(0,i.coalesce)(await (0,y.pathsToEditors)(t.filesToMerge,e,L));if(4===o.length&&(0,y.isResourceEditorInput)(o[0])&&(0,y.isResourceEditorInput)(o[1])&&(0,y.isResourceEditorInput)(o[2])&&(0,y.isResourceEditorInput)(o[3]))return[{editor:{input1:{resource:o[0].resource},input2:{resource:o[1].resource},base:{resource:o[2].resource},result:{resource:o[3].resource},options:{pinned:!0}}}];let r=(0,i.coalesce)(await (0,y.pathsToEditors)(t.filesToDiff,e,L));if(2===r.length)return[{editor:{original:{resource:r[0].resource},modified:{resource:r[1].resource},options:{pinned:!0}}}];let n=[],s=await (0,y.pathsToEditors)(t.filesToOpenOrCreate,e,L);for(let e=0;e<s.length;e++){let i=s[e];null!=i&&n.push({editor:i,viewColumn:t.filesToOpenOrCreate?.[e].viewColumn})}return n}return B.getWorkbenchState()===m.WorkbenchState.EMPTY&&"newUntitledFile"===M.getValue("workbench.startupEditor")?P.mainPart.hasRestorableState?[]:[{editor:{resource:void 0}}]:[]}let H=function(){let e=V.options?.defaultLayout;if((e?.editors!=null&&e.editors.length>0||e?.layout?.editors!=null)&&(e.force||p.isNew(v.StorageScope.WORKSPACE)))return{layout:e.layout?.editors,filesToOpenOrCreate:e.editors?.map(e=>({viewColumn:e.viewColumn,fileUri:s.URI.revive(e.uri),openOnlyIfExists:e.openOnlyIfExists,options:e.options}))};let{filesToOpenOrCreate:t,filesToDiff:i,filesToMerge:o}=V;if(null!=t||null!=i||null!=o)return{filesToOpenOrCreate:t,filesToDiff:i,filesToMerge:o}}();null!=H&&L.info("Initial editor state",H);let Y={layout:{editors:H?.layout},editor:{restoreEditors:!(0,m.isTemporaryWorkspace)(B.getWorkspace())&&("preserve"===M.getValue("window.restoreWindows")||void 0===H),editorsToOpen:U(F,H)},views:{defaults:function(e,t){let i=e.options?.defaultLayout;if(null==i||!i.force&&!t.isNew(v.StorageScope.WORKSPACE))return;let{views:o}=i;if(null!=o&&o.length>0)return o.map(e=>e.id)}(V,p),containerToRestore:{}}};function j(e){return a.getDefaultViewContainer(e)??a.getViewContainersByLocation(e)[0]}if(K.isVisible(G.Parts.SIDEBAR_PART)){let e;e=!V.isBuilt||h.startupKind===x.StartupKind.ReloadedWindow||n.isWeb?p.get(w.SidebarPart.activeViewletSettingsKey,v.StorageScope.WORKSPACE,j(I.ViewContainerLocation.Sidebar)?.id):j(I.ViewContainerLocation.Sidebar)?.id,Y.views.containerToRestore.sideBar=e}if(K.isVisible(G.Parts.PANEL_PART)){let e=p.get(C.PanelPart.activePanelSettingsKey,v.StorageScope.WORKSPACE,j(I.ViewContainerLocation.Panel)?.id);Y.views.containerToRestore.panel=e}if(K.isVisible(G.Parts.AUXILIARYBAR_PART)){let e=p.get(f.AuxiliaryBarPart.activeViewSettingsKey,v.StorageScope.WORKSPACE,j(I.ViewContainerLocation.AuxiliaryBar)?.id);Y.views.containerToRestore.auxiliaryBar=e}null==(Y=z(Y)).views.containerToRestore.sideBar&&K.setPartHidden(!0,G.Parts.SIDEBAR_PART),null==Y.views.containerToRestore.panel&&K.setPartHidden(!0,G.Parts.PANEL_PART),null==Y.views.containerToRestore.auxiliaryBar&&K.setPartHidden(!0,G.Parts.AUXILIARYBAR_PART);let X=document.createElement("div");for(let{id:e,role:t,classes:i,options:o,getPosition:r,onDidChangePosition:n}of(X.style.display="none",document.body.append(X),[{id:G.Parts.TITLEBAR_PART,role:"none",classes:["titlebar"]},{id:G.Parts.BANNER_PART,role:"banner",classes:["banner"]},{id:G.Parts.ACTIVITYBAR_PART,role:"none",classes:["activitybar"],getPosition:()=>K.getSideBarPosition(),onDidChangePosition:K.onDidChangeSideBarPosition},{id:G.Parts.SIDEBAR_PART,role:"none",classes:["sidebar"],getPosition:()=>K.getSideBarPosition(),onDidChangePosition:K.onDidChangeSideBarPosition},{id:G.Parts.EDITOR_PART,role:"main",classes:["editor"],options:{restorePreviousState:Y.editor.restoreEditors}},{id:G.Parts.PANEL_PART,role:"none",classes:["panel","basepanel"],getPosition:()=>K.getPanelPosition(),onDidChangePosition:K.onDidChangePanelPosition},{id:G.Parts.AUXILIARYBAR_PART,role:"none",classes:["auxiliarybar","basepanel"],getPosition:()=>K.getSideBarPosition()===G.Position.LEFT?G.Position.RIGHT:G.Position.LEFT,onDidChangePosition:K.onDidChangeSideBarPosition},{id:G.Parts.STATUSBAR_PART,role:"status",classes:["statusbar"]}])){let s=K.getPart(e);if(null!=s){let a=function(e,t,i){let o=document.createElement("status"===t?"footer":"div");return o.classList.add("part","monaco-workbench-part",...i),o.id=e,o.setAttribute("role",t),"status"===t&&o.setAttribute("aria-live","off"),o}(e,t,i);if(s.create(a,o),N(a,s),s.layout(9999,9999,0,0),X.append(a),null!=r){let e=r();s.element.classList.add((0,G.positionToString)(e)),n?.(()=>{s.element.classList.remove((0,G.positionToString)(e)),e=r(),s.element.classList.add((0,G.positionToString)(e))})}}}let J=[],$=[];J.push((async()=>{let e;(0,r.mark)("code/willRestoreEditors"),await P.mainPart.whenReady,(0,r.mark)("code/restoreEditors/editorGroupsReady"),Y.layout?.editors!=null&&P.applyLayout(Y.layout.editors);let t=await Y.editor.editorsToOpen;if((0,r.mark)("code/restoreEditors/editorsToOpenResolved"),t.length>0){let i=P.getGroups(R.GroupsOrder.GRID_APPEARANCE),o=new Map;for(let e of t){let t=i[(e.viewColumn??1)-1],r=o.get(t.id);null==r&&(r=new Set,o.set(t.id,r)),r.add(e.editor)}e=Promise.all(Array.from(o).map(async([e,t])=>{try{await k.openEditors(Array.from(t),e,{validateTrust:!0})}catch(e){L.error(e)}}))}$.push(Promise.all([e?.finally(()=>(0,r.mark)("code/restoreEditors/editorsOpened")),P.mainPart.whenRestored.finally(()=>(0,r.mark)("code/restoreEditors/editorGroupsRestored"))]).finally(()=>{(0,r.mark)("code/didRestoreEditors")}))})());let q=(async()=>{if(null!=Y.views.defaults&&Y.views.defaults.length>0){(0,r.mark)("code/willOpenDefaultViews");let e=[],t=t=>{let i=a.getViewLocationById(t.id);if(null!==i){let o=a.getViewContainerByViewId(t.id);if(null!=o){t.order>=(e[i]?.order??0)&&(e[i]={id:o.id,order:t.order});let r=a.getViewContainerModel(o);return r.setCollapsed(t.id,!1),r.setVisible(t.id,!0),!0}}return!1},i=[...Y.views.defaults].reverse().map((e,t)=>({id:e,order:t})),o=i.length;for(;o>0;)t(i[--o])&&i.splice(o,1);if(i.length>0){await W.whenInstalledExtensionsRegistered();let e=i.length;for(;e>0;)t(i[--e])&&i.splice(e,1)}null!=e[I.ViewContainerLocation.Sidebar]&&(Y.views.containerToRestore.sideBar=e[I.ViewContainerLocation.Sidebar].id),null!=e[I.ViewContainerLocation.Panel]&&(Y.views.containerToRestore.panel=e[I.ViewContainerLocation.Panel].id),null!=e[I.ViewContainerLocation.AuxiliaryBar]&&(Y.views.containerToRestore.auxiliaryBar=e[I.ViewContainerLocation.AuxiliaryBar].id),(0,r.mark)("code/didOpenDefaultViews")}})();J.push(q),J.push((async()=>{await q,null==Y.views.containerToRestore.sideBar||((0,r.mark)("code/willRestoreViewlet"),null==await t.openPaneComposite(Y.views.containerToRestore.sideBar,I.ViewContainerLocation.Sidebar)&&await t.openPaneComposite(j(I.ViewContainerLocation.Sidebar)?.id,I.ViewContainerLocation.Sidebar),(0,r.mark)("code/didRestoreViewlet"))})()),J.push((async()=>{await q,null==Y.views.containerToRestore.panel||((0,r.mark)("code/willRestorePanel"),null==await t.openPaneComposite(Y.views.containerToRestore.panel,I.ViewContainerLocation.Panel)&&await t.openPaneComposite(j(I.ViewContainerLocation.Panel)?.id,I.ViewContainerLocation.Panel),(0,r.mark)("code/didRestorePanel"))})()),J.push((async()=>{await q,null==Y.views.containerToRestore.auxiliaryBar||((0,r.mark)("code/willRestoreAuxiliaryBar"),null==await t.openPaneComposite(Y.views.containerToRestore.auxiliaryBar,I.ViewContainerLocation.AuxiliaryBar)&&await t.openPaneComposite(j(I.ViewContainerLocation.AuxiliaryBar)?.id,I.ViewContainerLocation.AuxiliaryBar),(0,r.mark)("code/didRestoreAuxiliaryBar"))})()),await o.Promises.settled(J),await o.Promises.settled($)}),e.s(["attachPart",0,K,"default",0,Y,"isEditorPartVisible",0,U,"onPartVisibilityChange",0,function(e,t){let i=F(e);if(null==i)throw Error("Part not found");return i.onDidVisibilityChange(t)},"renderActivitybarPar",0,function(e){return K(G.Parts.ACTIVITYBAR_PART,e)},"renderAuxiliaryPart",0,function(e){return K(G.Parts.AUXILIARYBAR_PART,e)},"renderEditorPart",0,function(e){return K(G.Parts.EDITOR_PART,e)},"renderPanelPart",0,function(e){return K(G.Parts.PANEL_PART,e)},"renderPart",0,N,"renderSidebarPart",0,function(e){return K(G.Parts.SIDEBAR_PART,e)},"renderStatusBarPart",0,function(e){return K(G.Parts.STATUSBAR_PART,e)}],474151),e.i(474151),e.s(["default",0,Y],108792)},576061,e=>{e.v(t=>Promise.all(["static/chunks/04fk~8rnrvs44.js"].map(t=>e.l(t))).then(()=>t(836670)))},510304,e=>{e.v(t=>Promise.all(["static/chunks/0j00r2f_n-.lx.js"].map(t=>e.l(t))).then(()=>t(193971)))},833255,e=>{e.v(t=>Promise.all(["static/chunks/07xvadmf~8bow.js","static/chunks/0a1rewz7xr-xi.js"].map(t=>e.l(t))).then(()=>t(140976)))}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,625873,e=>{"use strict";var t=e.i(344180),s=e.i(764556),n=e.i(244073),a=e.i(209988),i=e.i(260218),l=e.i(191118),r=e.i(513501),o=e.i(989484),c=e.i(193251),d=e.i(973370),m=e.i(887354),p=e.i(681622),h=e.i(917955),u=e.i(611176),x=e.i(255742),f=e.i(973767),g=e.i(129981),j=e.i(601039),y=e.i(977694),v=e.i(137340),N=e.i(401058),k=e.i(451534);let w=(0,e.i(433721).default)("file-archive",[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]]);var b=e.i(327962),C=e.i(62669),S=e.i(465458),z=e.i(256186),T=e.i(650654),D=e.i(992764);function I({items:e,onItemsChange:a,onConfirm:r,onCancel:o,defaultGroup:c}){let d=(0,n.useTranslations)("skills"),[m,h]=(0,s.useState)(""),[u,x]=(0,s.useState)(new Set),f=(t,s)=>{a(e.map(e=>e.id===t?{...e,...s}:e))},g=e.filter(e=>e.selected).length;return(0,t.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 pt-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:d("importPreviewTitle")}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)(i.Button,{variant:"ghost",size:"sm",onClick:()=>{a(e.map(e=>({...e,selected:!0})))},children:d("importPreviewSelectAll")}),(0,t.jsx)(i.Button,{variant:"ghost",size:"sm",onClick:()=>{a(e.map(e=>({...e,selected:!1})))},children:d("importPreviewDeselectAll")})]}),(0,t.jsx)(p.Input,{value:m,onChange:e=>h(e.target.value),placeholder:c||d("importPreviewGroupPlaceholder"),className:"h-7 text-sm w-32"})]}),0===e.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-muted-foreground text-sm",children:d("importPreviewEmpty")}):(0,t.jsx)(l.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsx)("div",{className:"space-y-2 pr-2",children:e.map(s=>{let n=u.has(s.id);return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"checkbox",checked:s.selected,onChange:()=>{var t;f(t=s.id,{selected:!e.find(e=>e.id===t).selected})},className:"mt-0.5 size-3.5 accent-primary shrink-0"}),(0,t.jsx)(p.Input,{value:s.name,onChange:e=>f(s.id,{name:e.target.value}),placeholder:d("importPreviewNamePlaceholder"),className:"h-7 text-sm flex-1"}),(0,t.jsx)(p.Input,{value:s.group,onChange:e=>f(s.id,{group:e.target.value}),placeholder:d("importPreviewGroupPlaceholder"),className:"h-7 text-sm w-32"}),(0,t.jsx)("button",{type:"button",onClick:()=>{var e;return e=s.id,void x(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},className:"p-1 rounded hover:bg-accent shrink-0",children:n?(0,t.jsx)(T.ChevronDown,{className:"size-3.5 text-muted-foreground"}):(0,t.jsx)(D.ChevronRight,{className:"size-3.5 text-muted-foreground"})})]}),(0,t.jsx)(z.Collapsible,{open:n,children:(0,t.jsx)(z.CollapsibleContent,{children:(0,t.jsxs)("pre",{className:"mt-2 p-2 bg-muted rounded text-xs overflow-auto max-h-48 whitespace-pre-wrap",children:[s.content.slice(0,2e3),s.content.length>2e3?"\n...":""]})})})]},s.id)})})}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-2 mt-2 border-t",children:[(0,t.jsx)(i.Button,{variant:"outline",size:"sm",onClick:o,children:d("importPreviewCancel")}),(0,t.jsx)(i.Button,{size:"sm",onClick:()=>{let t=e.filter(e=>e.selected).map(e=>({...e,group:e.group||m}));0!==t.length&&r(t)},disabled:0===g,children:d("importPreviewConfirm",{selected:g,total:e.length})})]})]})}function A({skills:r,agents:c,loading:z,syncLoading:T,onToggleFavorite:D,onDelete:$,onEdit:F,onBind:B,onImportBatch:P,onImportFromGit:L,onSyncCheck:M,onBindAll:O}){let U=(0,n.useTranslations)("skills"),R=(0,n.useTranslations)("common"),[_,E]=(0,s.useState)(""),[G,J]=(0,s.useState)("all"),[H,K]=(0,s.useState)(""),[W,q]=(0,s.useState)(""),V=(0,s.useRef)(null),Z=(0,s.useRef)(null),Q=(0,s.useRef)(null),[X,Y]=(0,s.useState)([]),[ee,et]=(0,s.useState)(!1),[es,en]=(0,s.useState)(""),[ea,ei]=(0,s.useState)(""),[el,er]=(0,s.useState)(!1),[eo,ec]=(0,s.useState)(!1),ed=Array.from(new Set(r.map(e=>e.group).filter(Boolean))),em=r.filter(e=>{if(_){let t=_.toLowerCase();if(!e.name.toLowerCase().includes(t)&&!e.content.toLowerCase().includes(t))return!1}if("favorites"===G&&!e.favorited||"agent"===G&&H&&!e.boundAgents.some(e=>e.id===H))return!1;if(W){if("__none__"===W){if(e.group)return!1}else if(e.group!==W)return!1}return!0}),ep=async e=>{let t=e.target.files;if(!t||0===t.length)return;let s=[];for(let e of Array.from(t)){let t=await e.text(),n=e.name.replace(/\.md$/i,"");s.push({id:`md-${n}-${Math.random().toString(36).slice(2,8)}`,name:n,group:"",content:t,selected:!0,sourceName:e.name})}Y(s),en(""),et(!0),e.target.value=""},eh=async e=>{let t=e.target.files;if(!t||0===t.length)return;let s=new Map;for(let e of Array.from(t)){let t=e.webkitRelativePath.split("/")[0];s.has(t)||s.set(t,[]),s.get(t).push(e)}let n=[];for(let[e,t]of s){let s=t.find(e=>"SKILL.md"===e.name);if(s||(s=t.find(e=>e.name.endsWith(".md"))),!s)continue;let a=await s.text();n.push({id:`folder-${e}-${Math.random().toString(36).slice(2,8)}`,name:e,group:"",content:a,selected:!0,sourceName:e})}Y(n),en(""),et(!0),e.target.value=""},eu=async t=>{let s=t.target.files?.[0];if(s){try{let t=(await e.A(980476)).default,n=await t.loadAsync(s),a=s.name.replace(/\.zip$/i,""),i=new Map;n.forEach((e,t)=>{if(t.dir)return;let s=e.split("/").pop()||"",n=e.substring(0,e.lastIndexOf("/"));if(!n){if(s.endsWith(".md")&&"SKILL.md"!==s){let t=s.replace(/\.md$/i,"");i.has(t)||i.set(t,[]),i.get(t).push({file:s,path:e})}return}let a=n.split("/")[0];i.has(a)||i.set(a,[]),i.get(a).push({file:s,path:e})});let l=[];for(let[e,t]of i){let s=t.find(e=>"SKILL.md"===e.file);if(s||(s=t.find(e=>e.file.endsWith(".md"))),!s)continue;let a=await n.file(s.path).async("string");l.push({id:`zip-${e}-${Math.random().toString(36).slice(2,8)}`,name:e,group:"",content:a,selected:!0,sourceName:e})}Y(l),en(a),et(!0)}catch(e){console.error("Failed to extract ZIP:",e)}t.target.value=""}},ex=async()=>{let e=ea.trim();if(!e)return;er(!0);let t=await L(e);if(er(!1),t&&t.length>0){let s=e.split("/").pop()?.replace(/\.git$/i,"")||"";Y(t),en(s),et(!0),ec(!1)}ei("")};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:V,type:"file",accept:".md",multiple:!0,className:"hidden",onChange:ep}),(0,t.jsx)("input",{ref:Z,type:"file",className:"hidden",onChange:eh,webkitdirectory:"",directory:""}),(0,t.jsx)("input",{ref:Q,type:"file",accept:".zip",className:"hidden",onChange:eu}),(0,t.jsxs)("div",{className:"flex items-center gap-2 ml-auto shrink-0 pt-2",children:[(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",onClick:M,disabled:T,children:[(0,t.jsx)(j.RefreshCw,{className:(0,S.cn)("size-3.5 mr-1",T&&"animate-spin")}),U("syncToAgents")]}),(0,t.jsxs)(h.DropdownMenu,{children:[(0,t.jsx)(h.DropdownMenuTrigger,{render:(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",children:[(0,t.jsx)(g.Upload,{className:"size-3.5 mr-1"}),U("import")]})}),(0,t.jsxs)(h.DropdownMenuContent,{align:"end",children:[(0,t.jsxs)(h.DropdownMenuItem,{onClick:()=>V.current?.click(),children:[(0,t.jsx)(o.FileText,{className:"size-3.5 mr-1.5"}),U("importFromMd")]}),(0,t.jsxs)(h.DropdownMenuItem,{onClick:()=>Z.current?.click(),children:[(0,t.jsx)(k.FolderOpen,{className:"size-3.5 mr-1.5"}),U("importFromFolder")]}),(0,t.jsxs)(h.DropdownMenuItem,{onClick:()=>Q.current?.click(),children:[(0,t.jsx)(w,{className:"size-3.5 mr-1.5"}),U("importFromZip")]}),(0,t.jsxs)(h.DropdownMenuItem,{onClick:()=>ec(!0),disabled:el,children:[(0,t.jsx)(b.GitBranch,{className:"size-3.5 mr-1.5"}),U("importFromGit")]})]})]})]}),ee?(0,t.jsx)(I,{items:X,onItemsChange:Y,onConfirm:e=>{P(e),et(!1),Y([])},onCancel:()=>{et(!1),Y([])},defaultGroup:es}):(0,t.jsxs)("div",{className:"flex flex-1 min-h-0 gap-4 pt-2",children:[(0,t.jsx)(l.ScrollArea,{className:"hidden md:block w-44 shrink-0",children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 pr-2",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)(i.Button,{variant:"all"!==G||W?"ghost":"secondary",size:"sm",className:"w-full justify-start",onClick:()=>{J("all"),K(""),q("")},children:[(0,t.jsx)(o.FileText,{className:"size-3.5 mr-1.5"}),U("filterAll")]}),(0,t.jsxs)(i.Button,{variant:"favorites"===G?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>{J("favorites"),K(""),q("")},children:[(0,t.jsx)(x.Star,{className:"size-3.5 mr-1.5"}),U("filterFavorites")]})]}),c.length>0&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground px-2",children:U("filterByAgent")}),c.map(e=>(0,t.jsxs)(i.Button,{variant:"agent"===G&&H===e.id?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>{J("agent"),K(e.id),q("")},children:[(0,t.jsx)(u.AgentIcon,{agentId:e.id,name:e.name,avatarUrl:e.avatarUrl,className:"size-4 mr-1.5 rounded-full"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]},e.id))]}),ed.length>0&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground px-2",children:U("filterGroups")}),ed.map(e=>(0,t.jsxs)(i.Button,{variant:W===e?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>{q(W===e?"":e),J("all"),K("")},children:[(0,t.jsx)(d.Folder,{className:"size-3.5 mr-1.5"}),(0,t.jsx)("span",{className:"truncate",children:e})]},e)),r.some(e=>!e.group)&&(0,t.jsxs)(i.Button,{variant:"__none__"===W?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>{q("__none__"===W?"":"__none__"),J("all"),K("")},children:[(0,t.jsx)(o.FileText,{className:"size-3.5 mr-1.5"}),U("filterNoGroup")]})]})]})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col gap-3 min-h-0",children:[(0,t.jsxs)("div",{className:"flex md:hidden flex-col gap-2",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(m.Search,{className:"size-3.5 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(p.Input,{value:_,onChange:e=>E(e.target.value),placeholder:U("search"),className:"pl-8"})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsxs)("div",{className:"flex rounded-lg border border-input p-0.5",children:[(0,t.jsx)("button",{type:"button",className:(0,S.cn)("px-2.5 py-1 rounded-md text-xs font-medium transition-colors","all"!==G||W?"text-muted-foreground hover:text-foreground":"bg-muted"),onClick:()=>{J("all"),K(""),q("")},children:U("filterAll")}),(0,t.jsxs)("button",{type:"button",className:(0,S.cn)("px-2.5 py-1 rounded-md text-xs font-medium transition-colors","favorites"===G?"bg-muted":"text-muted-foreground hover:text-foreground"),onClick:()=>{J("favorites"),K(""),q("")},children:[(0,t.jsx)(x.Star,{className:"size-3 inline-block mr-0.5 -mt-px"}),U("filterFavorites")]})]})})]}),(0,t.jsxs)("div",{className:"hidden md:block relative",children:[(0,t.jsx)(m.Search,{className:"size-3.5 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(p.Input,{value:_,onChange:e=>E(e.target.value),placeholder:U("search"),className:"pl-8"})]}),(0,t.jsx)(l.ScrollArea,{className:"flex-1 min-h-0",children:z?(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:R("loading")}):0===em.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:U("empty")}):(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 pr-2",children:em.map(e=>(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-background p-4 hover:bg-accent/30 transition-colors cursor-pointer",onClick:()=>F(e),children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"font-medium text-sm",children:e.name}),e.group&&(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium",children:e.group}),(0,t.jsx)("button",{type:"button",className:"flex items-center justify-center size-5 rounded hover:bg-accent",onClick:t=>{t.stopPropagation(),D(e)},children:e.favorited?(0,t.jsx)(x.Star,{className:"size-3.5 text-yellow-500 fill-yellow-500"}):(0,t.jsx)(f.StarOff,{className:"size-3.5 text-muted-foreground"})})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.description||e.content.slice(0,120).replace(/^#\s+/,"")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",onClick:()=>B(e),children:[(0,t.jsx)(y.Rocket,{className:"size-3.5 mr-1"}),U("apply")]}),(0,t.jsxs)(h.DropdownMenu,{children:[(0,t.jsx)(h.DropdownMenuTrigger,{render:(0,t.jsx)(i.Button,{variant:"ghost",size:"icon",className:"size-7"}),children:(0,t.jsx)(N.MoreVertical,{className:"size-3.5"})}),(0,t.jsxs)(h.DropdownMenuContent,{align:"end",children:[(0,t.jsxs)(h.DropdownMenuItem,{onClick:()=>fetch(`/api/skills/${encodeURIComponent(e.name)}/reveal`,{method:"POST"}),children:[(0,t.jsx)(k.FolderOpen,{className:"size-3.5 mr-1.5"}),U("revealFolder")]}),(0,t.jsxs)(h.DropdownMenuItem,{className:"text-destructive focus:text-destructive",onClick:()=>$(e),children:[(0,t.jsx)(v.Trash2,{className:"size-3.5 mr-1.5"}),U("delete")]})]})]})]})]}),e.boundAgents.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-2.5 pt-2.5 border-t border-border/50",children:[e.boundAgents.map(e=>(0,t.jsx)(u.AgentIcon,{agentId:e.id,name:e.name,avatarUrl:e.avatarUrl,className:"size-5 rounded-full"},e.id)),(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-1",children:e.boundAgents.length})]})]},e.name))})}),(0,t.jsx)("div",{className:"hidden md:flex items-center justify-end gap-3 pt-2 border-t shrink-0",children:(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",onClick:O,disabled:0===em.length,children:[(0,t.jsx)(y.Rocket,{className:"size-3.5 mr-1"}),U("applyAllToAgent")]})})]})]}),(0,t.jsx)(a.Dialog,{open:eo,onOpenChange:ec,children:(0,t.jsxs)(a.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsxs)(a.DialogHeader,{children:[(0,t.jsx)(a.DialogTitle,{children:U("importFromGit")}),(0,t.jsx)(a.DialogDescription,{children:U("importFromGitDesc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(p.Input,{value:ea,onChange:e=>ei(e.target.value),placeholder:"https://github.com/user/skills-repo.git",onKeyDown:e=>{"Enter"===e.key&&ex()},disabled:el,autoFocus:!0}),(0,t.jsx)(i.Button,{onClick:ex,disabled:el||!ea.trim(),children:el?(0,t.jsx)(C.Loader2,{className:"size-4 animate-spin"}):U("import")})]})]})})]})}var $=e.i(887836),F=e.i(984178),B=e.i(383171),P=e.i(415955),L=e.i(932031),M=e.i(111343),O=e.i(564822);e.i(462506);let U=(0,$.default)(()=>e.A(863812).then(e=>e.default),{loadableGenerated:{modules:[158480]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Loading editor..."})});function R({node:e,depth:s,selectedPath:n,onSelect:a,expandedPaths:i,toggleExpand:l}){let r=i.has(e.path),o=n===e.path;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:(0,S.cn)("flex items-center gap-1 rounded px-2 py-1 cursor-pointer hover:bg-muted/50 text-sm",o&&"bg-muted"),style:{paddingLeft:`${12*s+8}px`},onClick:()=>{e.isDirectory?l(e.path):a(e)},children:[e.isDirectory&&(0,t.jsx)(L.ChevronRightIcon,{className:(0,S.cn)("size-3.5 shrink-0 text-muted-foreground transition-transform",r&&"rotate-90")}),!e.isDirectory&&(0,t.jsx)("span",{className:"size-3.5 shrink-0"}),e.isDirectory?r?(0,t.jsx)(P.FolderOpenIcon,{className:"size-4 text-blue-500 shrink-0"}):(0,t.jsx)(B.FolderIcon,{className:"size-4 text-blue-500 shrink-0"}):(0,t.jsx)(F.FileIcon,{className:"size-4 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]}),e.isDirectory&&r&&e.children.map(e=>(0,t.jsx)(R,{node:e,depth:s+1,selectedPath:n,onSelect:a,expandedPaths:i,toggleExpand:l},e.path))]})}function _({skill:e,content:l,onContentChange:r,onClose:o,onSave:c}){let d=(0,n.useTranslations)("skills"),m=(0,n.useTranslations)("common"),p=(0,O.useIsMobile)(),[h,u]=(0,s.useState)([]),[x,f]=(0,s.useState)(null),[g,j]=(0,s.useState)({}),[y,v]=(0,s.useState)(new Set),[N,k]=(0,s.useState)(!1),[w,b]=(0,s.useState)(new Set),z=(0,s.useRef)(new Set);(0,s.useEffect)(()=>{if(!e)return;f(null),j({}),b(new Set),v(new Set),u([]),z.current=new Set,k(!0);let t=e.name;fetch(`/api/skills/${encodeURIComponent(t)}/files`).then(e=>e.ok?e.json():[]).then(e=>{u(e),v(new Set(e.filter(e=>e.isDirectory&&!e.path.includes("/")).map(e=>e.path)));let s=e.find(e=>"SKILL.md"===e.path&&!e.isDirectory)||e.find(e=>!e.isDirectory);if(!s)return void k(!1);f(s.path);let n=s.path.split("/").map(encodeURIComponent).join("/");fetch(`/api/skills/${encodeURIComponent(t)}/files/${n}`).then(e=>e.ok?e.json():null).then(e=>{e&&(j({[s.path]:e.content}),z.current.add(s.path))}).catch(()=>{}).finally(()=>k(!1))}).catch(()=>{u([]),k(!1)})},[e]);let T=(0,s.useCallback)((e,t)=>{if(z.current.has(t))return;z.current.add(t),k(!0);let s=t.split("/").map(encodeURIComponent).join("/");fetch(`/api/skills/${encodeURIComponent(e)}/files/${s}`).then(e=>e.ok?e.json():null).then(e=>{e&&j(s=>({...s,[t]:e.content}))}).catch(()=>{}).finally(()=>k(!1))},[]),D=(0,s.useMemo)(()=>(function(e){let t=[],s=new Map;for(let n of e){let e=n.path.split("/"),a=t;for(let t=0;t<e.length;t++){let i=e.slice(0,t+1).join("/"),l=t<e.length-1||n.isDirectory,r=a.find(s=>s.name===e[t]);if(r)a=r.children;else{let n={name:e[t],path:i,isDirectory:l,children:[]};a.push(n),l&&s.set(i,n),a=n.children}}}return t})(h),[h]),I=t=>{!t.isDirectory&&(f(t.path),e&&T(e.name,t.path))},A=e=>{v(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},$=x?g[x]??"":"",F=x?({md:"markdown",markdown:"markdown",json:"json",js:"javascript",ts:"typescript",tsx:"typescript",jsx:"javascript",py:"python",sh:"shell",bash:"shell",yaml:"yaml",yml:"yaml",xml:"xml",html:"html",css:"css",sql:"sql"})[x.split(".").pop()?.toLowerCase()||""]||"plaintext":"markdown",B=e=>{if(!x)return;let t=e||"";j(e=>({...e,[x]:t})),b(e=>new Set(e).add(x)),r(t)},P=async()=>{if(!e||!x)return;let t=g[x];if(void 0===t)return;let s=x.split("/").map(encodeURIComponent).join("/");(await fetch(`/api/skills/${encodeURIComponent(e.name)}/files/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t})})).ok&&(b(e=>{let t=new Set(e);return t.delete(x),t}),c())},L=(0,s.useMemo)(()=>h.filter(e=>!e.isDirectory),[h]);return(0,t.jsx)(a.Dialog,{open:!!e,onOpenChange:e=>{e||o()},children:(0,t.jsxs)(a.DialogContent,{className:"!w-[85vw] !max-w-[85vw] !h-[85vh] flex flex-col",children:[(0,t.jsx)(a.DialogHeader,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between pr-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(a.DialogTitle,{children:d("editTitle",{name:e?.name||""})}),(0,t.jsx)(a.DialogDescription,{children:d("editDescription")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[w.size>0&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[w.size," unsaved"]}),(0,t.jsxs)(i.Button,{size:"sm",onClick:P,disabled:!x||!w.has(x??""),children:[(0,t.jsx)(M.Save,{className:"size-3.5 mr-1"}),m("save")]})]})]})}),p?(0,t.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col pt-2",children:[(0,t.jsx)("div",{className:"flex overflow-x-auto border-b gap-0.5 px-1 shrink-0",children:L.map(e=>(0,t.jsx)("button",{className:(0,S.cn)("shrink-0 px-3 py-1.5 text-xs rounded-t transition-colors whitespace-nowrap",x===e.path?"bg-muted font-medium":"text-muted-foreground hover:text-foreground",w.has(e.path)&&'after:content-[""] after:inline-block after:size-1.5 after:bg-orange-500 after:rounded-full after:ml-1'),onClick:()=>I({name:e.name,path:e.path,isDirectory:!1,children:[]}),children:e.name},e.path))}),(0,t.jsx)("div",{className:"flex-1 min-h-0",children:N?(0,t.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,t.jsx)(C.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):(0,t.jsx)(U,{height:"100%",language:F,value:$,onChange:B,theme:"vs-dark",options:{fontSize:13,minimap:{enabled:!1},scrollBeyondLastLine:!1,padding:{top:8},renderLineHighlight:"gutter",wordWrap:"on"}})})]}):(0,t.jsxs)("div",{className:"flex-1 min-h-0 flex gap-0 pt-2 border rounded-md overflow-hidden",children:[(0,t.jsxs)("div",{className:"w-48 shrink-0 border-r bg-muted/20 overflow-y-auto py-1",children:[D.map(e=>(0,t.jsx)(R,{node:e,depth:0,selectedPath:x??"",onSelect:I,expandedPaths:y,toggleExpand:A},e.path)),0===h.length&&(0,t.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No files"})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0",children:N?(0,t.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,t.jsx)(C.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):(0,t.jsx)(U,{height:"100%",language:F,value:$,onChange:B,theme:"vs-dark",options:{fontSize:13,minimap:{enabled:!1},scrollBeyondLastLine:!1,padding:{top:8},renderLineHighlight:"gutter",wordWrap:"on"}})})]})]})})}var E=e.i(239340);function G({skill:e,titleOverride:s,descriptionOverride:a,agents:i,selected:l,onToggle:r,onClose:o,onConfirm:c}){let d=(0,n.useTranslations)("skills"),m=(0,n.useTranslations)("common");return(0,t.jsx)(E.AgentPickerDialog,{open:!!e,onClose:o,onConfirm:c,title:s||d("bindTitle",{name:e?.name||""}),description:a||d("bindDescription"),agents:i,selected:l,onToggle:r,cancelText:m("cancel"),confirmText:m("confirm")})}function J({open:e,onOpenChange:s,items:r,selected:o,onToggle:c,onConfirm:d}){let m=(0,n.useTranslations)("skills"),p=(0,n.useTranslations)("common");return(0,t.jsx)(a.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(a.DialogContent,{className:"sm:max-w-lg",children:[(0,t.jsxs)(a.DialogHeader,{children:[(0,t.jsx)(a.DialogTitle,{children:m("syncTitle")}),(0,t.jsx)(a.DialogDescription,{children:m("syncDescription")})]}),(0,t.jsxs)("div",{className:"space-y-3 pt-2",children:[0===r.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-muted-foreground text-sm",children:m("syncEmpty")}):(0,t.jsx)(l.ScrollArea,{className:"max-h-72",children:(0,t.jsx)("div",{className:"space-y-1",children:r.map(e=>{let s=`${e.agentId}::${e.skillName}`;return(0,t.jsxs)("button",{type:"button",onClick:()=>c(e.agentId,e.skillName),className:"flex items-center gap-3 w-full px-2 py-1.5 rounded-md hover:bg-muted text-left text-sm transition-colors",children:[(0,t.jsx)("div",{className:(0,S.cn)("flex items-center justify-center size-4 rounded border shrink-0",o.has(s)?"bg-primary border-primary text-primary-foreground":"border-input")}),(0,t.jsx)(u.AgentIcon,{agentId:e.agentId,name:e.agentName,className:"size-5 rounded-full"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.agentName}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs shrink-0",children:[e.skillName,".md"]})]},s)})})}),r.length>0&&(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,t.jsx)(i.Button,{variant:"outline",onClick:()=>s(!1),children:p("cancel")}),(0,t.jsx)(i.Button,{onClick:d,disabled:0===o.size,children:m("syncConfirm")})]})]})]})})}e.s(["SkillsDialog",0,function({open:e,onOpenChange:h,standalone:u}){let x=(0,n.useTranslations)("skills"),f=(0,n.useTranslations)("common"),[g,j]=(0,s.useState)("local"),{skills:y,setSkills:v,agents:N,loading:k,fetchSkills:w,storeSkills:b,storeLoading:C,importingPaths:S,importFromStore:z}=function(e,t){let[n,a]=(0,s.useState)([]),[i,l]=(0,s.useState)([]),[r,o]=(0,s.useState)(!1),[c,d]=(0,s.useState)([]),[m,p]=(0,s.useState)(!1),[h,u]=(0,s.useState)(new Set),x=(0,s.useCallback)(async()=>{o(!0);try{let e=await fetch("/api/skills");e.ok&&a(await e.json())}catch{}o(!1)},[]),f=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/agents/presets");if(e.ok){let t=await e.json();l(t.map(e=>({id:e.id,name:e.name,avatarUrl:e.avatarUrl,description:e.description})))}}catch{}},[]),g=(0,s.useCallback)(async()=>{p(!0);try{let e=await fetch("/public/skills/index.json");e.ok&&d(await e.json())}catch{}p(!1)},[]);(0,s.useEffect)(()=>{(e||t)&&(x(),f(),g())},[e,t,x,f,g]);let j=new Set(n.map(e=>e.name)),y=async e=>{if(j.has(e.id)||h.has(e.path))return!1;u(t=>new Set(t).add(e.path));try{if((await fetch("/api/skills/import-store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e.path,group:e.group})})).ok)return await x(),!0}catch{}return u(t=>{let s=new Set(t);return s.delete(e.path),s}),!1};return{skills:n,setSkills:a,agents:i,loading:r,fetchSkills:x,storeSkills:c,storeLoading:m,importingPaths:h,importFromStore:y}}(e,u),T={toggleFavorite:async e=>{try{let t=await fetch(`/api/skills/${encodeURIComponent(e.name)}/favorite`,{method:"POST"});if(t.ok){let{favorited:s}=await t.json();v(t=>t.map(t=>t.name===e.name?{...t,favorited:s}:t))}}catch{}},deleteSkill:async e=>{try{(await fetch(`/api/skills/${encodeURIComponent(e.name)}`,{method:"DELETE"})).ok&&v(t=>t.filter(t=>t.name!==e.name))}catch{}},saveEdit:async(e,t)=>{try{if((await fetch(`/api/skills/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t})})).ok)return v(s=>s.map(s=>s.name===e?{...s,content:t}:s)),!0}catch{}return!1},importBatch:async e=>{let t=e.map(e=>({name:e.name,content:e.content,group:e.group}));try{(await fetch("/api/skills/import-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:t})})).ok&&w()}catch{}},importFromGit:async e=>{try{let t=await fetch("/api/skills/import-git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})});if(!t.ok)return null;return(await t.json()).map(e=>({id:`git-${e.name}-${Math.random().toString(36).slice(2,8)}`,name:e.name,group:"",content:e.content,selected:!0,sourceName:e.name}))}catch{}return null},bindConfirm:async(e,t,s)=>{for(let n of s){let s=e.boundAgents.some(e=>e.id===n.id),a=t.includes(n.id);if(s&&!a){let t=await fetch(`/api/agents/presets/${n.id}`);if(!t.ok)continue;let s=await t.json(),a=(s.skills||[]).filter(t=>t.replace(/\.md$/i,"")!==e.name);await fetch(`/api/agents/presets/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,skills:a})})}else if(!s&&a){let t=await fetch(`/api/agents/presets/${n.id}`);if(!t.ok)continue;let s=await t.json();if(!(s.skills||[]).map(e=>e.replace(/\.md$/i,"")).includes(e.name)){let t=[...s.skills||[],e.name];await fetch(`/api/agents/presets/${n.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,skills:t})})}}}w()},applyAllToAgent:async(e,t)=>{try{let s=await fetch(`/api/agents/presets/${e}`);if(!s.ok)return;let n=await s.json(),a=new Set((n.skills||[]).map(e=>e.replace(/\.md$/i,""))),i=[...n.skills||[]];for(let e of t)a.has(e)||i.push(e);await fetch(`/api/agents/presets/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,skills:i})}),w()}catch{}},syncCheck:async()=>{let e=await fetch("/api/skills/sync-check");return e.ok?e.json():[]},syncConfirm:async e=>{let t=await fetch("/api/skills/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:e.map(e=>({agentId:e.agentId,skillName:e.skillName}))})});return t.ok&&w(),t.ok}},[D,I]=(0,s.useState)(null),[$,F]=(0,s.useState)(""),[B,P]=(0,s.useState)(null),[L,M]=(0,s.useState)([]),[O,U]=(0,s.useState)([]),[R,E]=(0,s.useState)(new Set),[H,K]=(0,s.useState)(!1),[W,q]=(0,s.useState)(!1),[V,Z]=(0,s.useState)(""),[Q,X]=(0,s.useState)(""),Y="__bind_all__",ee=B?.name===Y,et=async()=>{!D||await T.saveEdit(D.name,$)&&I(null)},es=async()=>{if(B){if(ee){let e=y.map(e=>e.name);for(let t of L)await T.applyAllToAgent(t,e)}else await T.bindConfirm(B,L,N);P(null)}},en=async()=>{q(!0);let e=await T.syncCheck();e.length>0&&(U(e),E(new Set(e.map(e=>`${e.agentId}::${e.skillName}`))),K(!0)),q(!1)},ea=async()=>{let e=O.filter(e=>R.has(`${e.agentId}::${e.skillName}`));0===e.length||await T.syncConfirm(e)&&K(!1)},ei=(u||e)&&!B&&!D,el=Array.from(new Set(b.map(e=>e.group).filter(Boolean))),er=new Set(y.map(e=>e.name)),eo=b.filter(e=>{if(V&&e.group!==V)return!1;if(Q){let t=Q.toLowerCase();if(!e.name.toLowerCase().includes(t)&&!e.id.toLowerCase().includes(t)&&!e.group.toLowerCase().includes(t))return!1}return!0}),ec=async e=>{await z(e)},ed=(0,t.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-1",children:[["local",o.FileText,x("tabLocal")],["store",r.Store,x("tabStore")]].map(([e,s,n])=>(0,t.jsxs)("button",{onClick:()=>j(e),className:`flex items-center gap-1.5 px-3 py-2 text-sm font-medium border-b-2 transition-colors ${g===e?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(s,{className:"size-3.5"}),n]},e))}),em=(0,t.jsxs)("div",{className:"flex flex-1 min-h-0 gap-4 pt-2",children:[el.length>0&&(0,t.jsx)(l.ScrollArea,{className:"hidden md:block w-44 shrink-0",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 pr-2",children:[(0,t.jsxs)(i.Button,{variant:V?"ghost":"secondary",size:"sm",className:"w-full justify-start",onClick:()=>Z(""),children:[(0,t.jsx)(o.FileText,{className:"size-3.5 mr-1.5"}),x("filterAll")]}),el.map(e=>(0,t.jsxs)(i.Button,{variant:V===e?"secondary":"ghost",size:"sm",className:"w-full justify-start",onClick:()=>Z(V===e?"":e),children:[(0,t.jsx)(d.Folder,{className:"size-3.5 mr-1.5"}),(0,t.jsx)("span",{className:"truncate",children:e})]},e))]})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col min-h-0",children:[(0,t.jsxs)("div",{className:"relative mb-3",children:[(0,t.jsx)(m.Search,{className:"size-3.5 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(p.Input,{value:Q,onChange:e=>X(e.target.value),placeholder:x("search"),className:"pl-8"})]}),(0,t.jsx)(l.ScrollArea,{className:"flex-1",children:C?(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:f("loading")}):0===eo.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-muted-foreground text-sm",children:x("storeEmpty")}):(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 pr-2",children:eo.map(e=>{let s=er.has(e.id),n=S.has(e.path);return(0,t.jsx)("div",{className:"rounded-xl border border-border bg-background p-4 hover:bg-accent/30 transition-colors",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(r.Store,{className:"size-3.5 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"font-medium text-sm",children:e.name}),(0,t.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium",children:e.group})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:e.id})]}),(0,t.jsx)(i.Button,{variant:s?"ghost":"outline",size:"sm",className:"shrink-0",disabled:s||n,onClick:()=>ec(e),children:s?x("imported"):n?x("importing"):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.Download,{className:"size-3.5 mr-1"}),x("importTo")]})})]})},e.path)})})})]})]}),ep=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.DialogHeader,{children:(0,t.jsxs)("div",{className:"hidden md:block",children:[u?(0,t.jsx)("h2",{className:"text-base font-semibold",children:x("title")}):(0,t.jsx)(a.DialogTitle,{children:x("title")}),u?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("description")}):(0,t.jsx)(a.DialogDescription,{children:x("description")})]})}),ed,(0,t.jsx)("div",{className:"flex flex-1 min-h-0 flex-col",children:"local"===g?(0,t.jsx)(A,{skills:y,agents:N,loading:k,syncLoading:W,onToggleFavorite:T.toggleFavorite,onDelete:T.deleteSkill,onEdit:e=>{I(e),F(e.content)},onBind:e=>{P(e),M(e.boundAgents.map(e=>e.id))},onImportBatch:T.importBatch,onImportFromGit:T.importFromGit,onSyncCheck:en,onBindAll:()=>{P({name:Y,description:"",filename:"",content:"",favorited:!1,group:"",boundAgents:[]}),M([])}}):em})]});return(0,t.jsxs)(t.Fragment,{children:[u&&ei&&(0,t.jsx)("div",{className:"h-full flex flex-col",children:ep}),!u&&(0,t.jsx)(a.Dialog,{open:ei,onOpenChange:h,children:(0,t.jsx)(a.DialogContent,{className:"!w-[80vw] !max-w-[80vw] !h-[80vh] flex flex-col overflow-hidden",children:ep})}),(0,t.jsx)(_,{skill:D,content:$,onContentChange:F,onClose:()=>I(null),onSave:et}),(0,t.jsx)(G,{skill:B,titleOverride:ee?x("applyAllToAgent"):void 0,descriptionOverride:ee?x("applyAllToAgentDescription"):void 0,agents:N,selected:L,onToggle:e=>M(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),onClose:()=>P(null),onConfirm:es}),(0,t.jsx)(J,{open:H,onOpenChange:K,items:O,selected:R,onToggle:(e,t)=>{let s=`${e}::${t}`;E(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},onConfirm:ea})]})}],625873)}]);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,788010,e=>{"use strict";var t=e.i(344180),a=e.i(465458);e.s(["Textarea",0,function({className:e,...s}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,a.cn)("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...s})}])},226624,e=>{"use strict";var t,a=e.i(344180);e.s([],916562),e.i(916562),e.i(8890);var s=e.i(764556),i=e.i(535270),r=e.i(29905),l=e.i(204133),n=e.i(277642),d=e.i(236706),o=e.i(863728),c=e.i(969490),u=e.i(370383),m=e.i(139236),p=e.i(931709),h=e.i(267805);let x=s.createContext(void 0);var g=e.i(438904);let v=((t={}).checked="data-checked",t.unchecked="data-unchecked",t.disabled="data-disabled",t.readonly="data-readonly",t.required="data-required",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t),f={...g.fieldValidityMapping,checked:e=>e?{[v.checked]:""}:{[v.unchecked]:""}};var b=e.i(125231),y=e.i(975698),j=e.i(380414),k=e.i(443124),N=e.i(575665),w=e.i(602453),C=e.i(742665),S=e.i(638144);let z=s.forwardRef(function(e,t){let{checked:h,className:g,defaultChecked:v,"aria-labelledby":z,form:M,id:T,inputRef:P,name:D,nativeButton:B=!1,onCheckedChange:I,readOnly:A=!1,required:K=!1,disabled:E=!1,render:L,uncheckedValue:R,value:O,style:U,...q}=e,{clearErrors:F}=(0,j.useFormContext)(),{state:_,setTouched:V,setDirty:$,validityData:H,setFilled:J,setFocused:G,shouldValidateOnChange:Q,validationMode:W,disabled:X,name:Y,validation:Z}=(0,b.useFieldRootContext)(),{labelId:ee}=(0,k.useLabelableContext)(),et=X||E,ea=Y??D,es=(0,r.useStableCallback)(I),ei=s.useRef(null),er=(0,l.useMergedRefs)(ei,P,Z.inputRef),el=s.useRef(null),en=(0,m.useBaseUiId)(),ed=(0,N.useLabelableId)({id:T,implicit:!1,controlRef:el}),eo=B?void 0:ed,[ec,eu]=(0,i.useControlled)({controlled:h,default:!!v,name:"Switch",state:"checked"});(0,y.useRegisterFieldControl)(el,{id:en,value:ec}),(0,n.useIsoLayoutEffect)(()=>{ei.current&&J(ei.current.checked)},[ei,J]),(0,S.useValueChanged)(ec,()=>{F(ea),$(ec!==H.initialValue),J(ec),Q()?Z.commit(ec):Z.commit(ec,!0)});let{getButtonProps:em,buttonRef:ep}=(0,p.useButton)({disabled:et,native:B}),eh=function(e,t,a,i=!0,r){let[l,d]=s.useState(),o=(0,m.useBaseUiId)(r?`${r}-label`:void 0),c=e??t??l;return(0,n.useIsoLayoutEffect)(()=>{let s=e||t||!i?void 0:function(e,t){let a=function(e){if(!e)return;let t=e.parentElement;if(t&&"LABEL"===t.tagName)return t;let a=e.id;if(a){let t=e.nextElementSibling;if(t&&t.htmlFor===a)return t}let s=e.labels;return s&&s[0]}(e);if(a)return!a.id&&t&&(a.id=t),a.id||void 0}(a.current,o);l!==s&&d(s)}),c}(z,ee,ei,!B,eo),ex=s.useMemo(()=>(0,u.mergeProps)({checked:ec,disabled:et,form:M,id:eo,name:ea,required:K,style:ea?d.visuallyHiddenInput:d.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:er,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(A)return void e.preventDefault();let t=e.currentTarget.checked,a=(0,w.createChangeEventDetails)(C.REASONS.none,e.nativeEvent);es?.(t,a),a.isCanceled||eu(t)},onFocus(){el.current?.focus()}},Z.getInputValidationProps,void 0!==O?{value:O}:o.EMPTY_OBJECT),[ec,et,M,er,eo,ea,es,A,K,eu,Z,O]),eg=s.useMemo(()=>({..._,checked:ec,disabled:et,readOnly:A,required:K}),[_,ec,et,A,K]),ev=(0,c.useRenderElement)("span",e,{state:eg,ref:[t,el,ep],props:[{id:B?ed:en,role:"switch","aria-checked":ec,"aria-readonly":A||void 0,"aria-required":K||void 0,"aria-labelledby":eh,onFocus(){et||G(!0)},onBlur(){let e=ei.current;e&&!et&&(V(!0),G(!1),"onBlur"===W&&Z.commit(e.checked))},onClick(e){A||et||(e.preventDefault(),ei.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},Z.getValidationProps,q,em],stateAttributesMapping:f});return(0,a.jsxs)(x.Provider,{value:eg,children:[ev,!ec&&ea&&void 0!==R&&(0,a.jsx)("input",{type:"hidden",form:M,name:ea,value:R}),(0,a.jsx)("input",{...ex,suppressHydrationWarning:!0})]})}),M=s.forwardRef(function(e,t){let{render:a,className:i,style:r,...l}=e,{state:n}=(0,b.useFieldRootContext)(),d=function(){let e=s.useContext(x);if(void 0===e)throw Error((0,h.default)(63));return e}(),o={...n,...d};return(0,c.useRenderElement)("span",e,{state:o,ref:t,stateAttributesMapping:f,props:l})});e.s(["Root",0,z,"Thumb",0,M],695728);var T=e.i(695728),T=T,P=e.i(465458);e.s(["Switch",0,function({className:e,size:t="default",...s}){return(0,a.jsx)(T.Root,{"data-slot":"switch","data-size":t,className:(0,P.cn)("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...s,children:(0,a.jsx)(T.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}],226624)},357301,e=>{"use strict";let t=(0,e.i(433721).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],357301)},562918,928542,e=>{"use strict";var t=e.i(370383),a=e.i(969490);function s(e){return(0,a.useRenderElement)(e.defaultTagName??"div",e,e)}e.s(["useRender",0,s],928542);var i=e.i(294237),r=e.i(465458);let l=(0,i.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:a="default",render:i,...n}){return s({defaultTagName:"span",props:(0,t.mergeProps)({className:(0,r.cn)(l({variant:a}),e)},n),render:i,state:{slot:"badge",variant:a}})}],562918)},368942,e=>{"use strict";let t=(0,e.i(816709).create)((e,t)=>({models:[],providers:[],loaded:!1,ensure:async()=>{if(!t().loaded)try{let[t,a]=await Promise.all([fetch("/api/models").then(e=>e.json()),fetch("/api/providers").then(e=>e.json())]);e({models:t,providers:a,loaded:!0})}catch{}},addModel:t=>e(e=>({models:[...e.models,t]})),updateModel:t=>e(e=>({models:e.models.map(e=>e.id===t.id?t:e)})),removeModel:t=>e(e=>({models:e.models.filter(e=>e.id!==t)})),addProvider:t=>e(e=>({providers:[...e.providers,t]})),updateProvider:t=>e(e=>({providers:e.providers.map(e=>e.id===t.id?t:e)})),removeProvider:t=>e(e=>({providers:e.providers.filter(e=>e.id!==t)}))}));e.s(["useLLMStore",0,t])},188815,e=>{"use strict";var t=e.i(344180),a=e.i(764556),s=e.i(465458),i=e.i(681622),r=e.i(344118),l=e.i(650654),n=e.i(953700);e.s(["SearchSelect",0,function({value:e,onChange:d,options:o,placeholder:c="Select...",searchPlaceholder:u="Search...",allowCustom:m=!0,className:p}){let h=(0,a.useRef)(null),[x,g]=(0,a.useState)(!1),[v,f]=(0,a.useState)("");(0,a.useEffect)(()=>{let e=e=>{h.current&&!h.current.contains(e.target)&&g(!1)};return x&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[x]);let b=o.filter(e=>(e.label??e.value).toLowerCase().includes(v.toLowerCase())),y=o.some(e=>e.value.toLowerCase()===v.toLowerCase()),j=o.find(t=>t.value===e),k=e&&!o.some(t=>t.value===e),N=e=>{d(e),g(!1),f("")};return(0,t.jsxs)("div",{ref:h,className:(0,s.cn)("relative",p),children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{g(!0),f("")},className:(0,s.cn)("flex h-8 w-full items-center justify-between gap-2 rounded-lg border border-input bg-transparent px-2.5 text-sm outline-none hover:bg-muted/50 focus-visible:border-ring dark:bg-input/30"),children:[(0,t.jsx)("span",{className:(0,s.cn)("truncate",!e&&"text-muted-foreground"),children:j?j.label??j.value:k?e:c}),(0,t.jsx)(l.ChevronDown,{className:"size-3.5 shrink-0 opacity-50"})]}),x&&(0,t.jsxs)("div",{className:"absolute inset-x-0 top-full z-50 mt-1 rounded-lg border bg-popover p-1 shadow-md",children:[(0,t.jsx)(i.Input,{value:v,onChange:e=>f(e.target.value),placeholder:u,className:"h-7 text-xs",onKeyDown:e=>{"Enter"===e.key&&m&&v.trim()&&(e.preventDefault(),N(v.trim())),"Escape"===e.key&&g(!1)},autoFocus:!0}),(0,t.jsxs)("div",{className:"mt-1 max-h-48 overflow-y-auto",children:[b.map(a=>(0,t.jsxs)("button",{type:"button",className:(0,s.cn)("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs hover:bg-muted/50",e===a.value&&"bg-muted"),onClick:()=>N(a.value),children:[(0,t.jsx)(r.Check,{className:(0,s.cn)("size-3 shrink-0",e===a.value?"opacity-100":"opacity-0")}),(0,t.jsx)("span",{className:"truncate",children:a.label??a.value})]},a.value)),m&&v.trim()&&!y&&(0,t.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs text-primary hover:bg-muted/50",onClick:()=>N(v.trim()),children:[(0,t.jsx)(n.Plus,{className:"size-3 shrink-0"}),(0,t.jsxs)("span",{className:"truncate",children:['Use "',v.trim(),'"']})]}),!b.length&&!v.trim()&&(0,t.jsx)("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No results"})]})]})]})}])},325443,946899,e=>{"use strict";let t=(0,e.i(433721).default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["default",0,t],946899),e.s(["Bot",0,t],325443)},426022,e=>{"use strict";let t=(0,e.i(433721).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],426022)},159619,839374,e=>{"use strict";let t=(0,e.i(433721).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["default",0,t],839374),e.s(["Copy",0,t],159619)},444433,e=>{"use strict";e.s(["BUILT_IN_AGENT_TOOLS",0,[{name:"CreateCurrentChannelIssue",label:"Create Current Issue",description:"Create and bind an issue for the current channel."},{name:"ViewCurrentChannelIssue",label:"View Current Issue",description:"View the issue and comments bound to the current channel."},{name:"AddCurrentChannelComment",label:"Add Current Comment",description:"Add a comment to the issue bound to the current channel."},{name:"ReadTerminalOutput",label:"Read Terminal Output",description:"Read paginated terminal output by session ID. Defaults to the newest 100 lines."},{name:"ListQuickCommands",label:"List Quick Commands",description:"List all quick commands for a workspace with their running status."},{name:"RunQuickCommand",label:"Run Quick Command",description:"Start a quick command by its ID. Returns the terminal session ID."},{name:"StopQuickCommand",label:"Stop Quick Command",description:"Stop a running quick command by its ID."}]])},212068,e=>{"use strict";let t=(0,e.i(433721).default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);e.s(["default",0,t])},673478,e=>{"use strict";let t=(0,e.i(433721).default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);e.s(["Cpu",0,t],673478)},558680,e=>{"use strict";let t=(0,e.i(433721).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["default",0,t])},650654,e=>{"use strict";var t=e.i(558680);e.s(["ChevronDown",()=>t.default])},129981,e=>{"use strict";let t=(0,e.i(433721).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],129981)},656744,e=>{"use strict";let t=(0,e.i(433721).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["default",0,t])},415360,e=>{"use strict";var t=e.i(656744);e.s(["Sparkles",()=>t.default])},588591,e=>{"use strict";var t=e.i(344180),a=e.i(764556),s=e.i(244073),i=e.i(355819),r=e.i(209988),l=e.i(260218),n=e.i(788010),d=e.i(917955),o=e.i(465458),c=e.i(767467),u=e.i(325443),m=e.i(650654),p=e.i(953700),h=e.i(357301),x=e.i(433721);let g=(0,x.default)("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);var v=e.i(444433);let f={agent:"bg-gray-500/10 text-gray-600 border-gray-200",scheduler:"bg-blue-500/10 text-blue-600 border-blue-200",task_creator:"bg-green-500/10 text-green-600 border-green-200",bot:"bg-cyan-500/10 text-cyan-600 border-cyan-200"},b=[{value:"anthropic-messages",labelKey:"anthropicMessages"},{value:"openai-chat-completions",labelKey:"openaiChatCompletions"},{value:"openai-responses",labelKey:"openaiResponses"},{value:"openai-responses-to-anthropic-messages",labelKey:"openaiResponsesToAnthropic"},{value:"openai-chat-completions-to-anthropic-messages",labelKey:"openaiChatToAnthropic"},{value:"gemini-generate-content",labelKey:"geminiGenerateContent"}],y=[{value:"claude-code",labelKey:"claudeCode"},{value:"open-agent-sdk",labelKey:"openAgentSdk"},{value:"codex",labelKey:"codex"},{value:"langchain",labelKey:"langchain"}],j=["agent","scheduler","task_creator","bot"],k=(v.BUILT_IN_AGENT_TOOLS??[]).map(e=>e.name),N=new Set(["openai-responses-to-anthropic-messages","openai-chat-completions-to-anthropic-messages"]);function w(e){return{mcpServers:Object.fromEntries(e.map(e=>[e,{}]))}}function C(e){return e.map(e=>({name:`${e}.md`,content:`# ${e}
|
|
2
|
+
`}))}let S={agent:{name:"Agent",role:"agent",description:"通用 Agent,可在 workflow 中承担任意执行节点",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:w([]),skills:C(["coding","debugging","testing"]),tools:k,systemPrompt:"你是通用 Agent。根据 issue 和当前任务上下文完成被分配的工作,遵循项目规范,必要时修改代码、运行验证,并清晰汇报结果。",outputStyle:"",temperature:.3,maxTokens:8192,enabled:!0},scheduler:{name:"Scheduler",role:"scheduler",description:"任务调度者,负责任务分发和协调",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:w([]),skills:C(["planning","task-split"]),tools:k,systemPrompt:"你是调度者 Agent。负责接收用户任务,分析任务类型,分发给合适的执行者。你需要跟踪任务状态,确保所有子任务按时完成。",outputStyle:"",temperature:.3,maxTokens:4096,enabled:!0},task_creator:{name:"Task Creator",role:"task_creator",description:"任务创建者,负责把 issue 拆成可执行任务",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:w([]),skills:C(["planning","task-split"]),tools:k,systemPrompt:"你是任务创建者 Agent。负责读取 issue 上下文,把需求拆分为少量可执行任务,并用系统工具写入任务列表。只创建真正需要独立执行的任务,避免把细碎步骤拆成任务。",outputStyle:"",temperature:.3,maxTokens:4096,enabled:!0},bot:{name:"Bot Agent",role:"bot",description:"消息机器人,负责处理外部聊天平台中的用户消息",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"anthropic-messages",modelId:"claude-sonnet-4-6",apiBase:"",apiKey:"",workingDir:"",mcps:{},skills:[],tools:k,systemPrompt:"你是 Agent Spaces 的消息机器人。你会简洁回答来自外部聊天平台的用户消息。不要执行危险操作;需要用户提供更多信息时直接询问。",outputStyle:"",temperature:.3,maxTokens:4096,enabled:!0}};function z(e){var t,a;return{...e,name:e.name||"New Agent",description:e.description||"",avatarUrl:e.avatarUrl||"",runtimeKind:e.runtimeKind||"open-agent-sdk",modelProvider:e.modelProvider||"",modelId:e.modelId||"claude-sonnet-4-6",apiBase:e.apiBase||"",apiKey:e.apiKey||"",workingDir:e.workingDir||"",mcps:(t=e.mcps)||{},skills:Array.isArray(a=e.skills)?a.map(e=>"string"==typeof e?{name:e.endsWith(".md")?e:`${e}.md`}:e):[],tools:function(e){if(!Array.isArray(e))return k;let t=new Set((v.BUILT_IN_AGENT_TOOLS??[]).map(e=>e.name));return e.filter(e=>t.has(e))}(e.tools),systemPrompt:e.systemPrompt||"",outputStyle:e.outputStyle||"",temperature:e.temperature??.3,maxTokens:e.maxTokens??4096,enabled:e.enabled??!0}}function M(e){return{id:`draft-${e}-${Date.now()}`,...S[e],mcps:structuredClone(S[e].mcps),skills:S[e].skills.map(e=>({...e})),tools:[...S[e].tools]}}function T(){return{id:`draft-empty-${Date.now()}`,name:"",role:"agent",description:"",avatarUrl:"",runtimeKind:"claude-code",modelProvider:"",modelId:"",apiBase:"",apiKey:"",workingDir:"",mcps:{},skills:[],tools:k,systemPrompt:"",outputStyle:"",temperature:.3,maxTokens:4096,enabled:!0}}function P({icon:e,title:a,children:s}){return(0,t.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground uppercase tracking-wider",children:[e,a]}),s]})}function D({label:e,children:a}){return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:e}),a]})}var B=e.i(611176),I=e.i(562918),A=e.i(226624),K=e.i(159619),E=e.i(137340);function L({agents:e,onSelect:a,onDelete:i,onToggleEnabled:r}){let n=(0,s.useTranslations)("agent");return(0,t.jsxs)("div",{className:"flex flex-col p-2",children:[e.map(e=>{let s="agent-generator"===e.id;return(0,t.jsxs)("div",{className:(0,o.cn)("group flex items-center gap-3 rounded-lg px-3 py-2.5 hover:bg-muted/50 cursor-pointer transition-colors",!e.enabled&&!s&&"opacity-50"),onClick:()=>a(e),children:[(0,t.jsx)(B.AgentIcon,{name:e.name,avatarUrl:e.avatarUrl,apiBase:e.apiBase,className:"size-8"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,t.jsx)(I.Badge,{variant:"outline",className:"text-[10px] h-4 px-1.5",children:s?"system":e.role})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.description||n("list.noDescription")})]}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground font-mono",children:e.modelId.split("-").slice(0,2).join("-")}),(0,t.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,t.jsx)(A.Switch,{size:"sm",checked:s||e.enabled,disabled:s,onCheckedChange:()=>r?.(e.id)})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-xs",className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:t=>{t.stopPropagation(),navigator.clipboard.writeText(e.id)},children:(0,t.jsx)(K.Copy,{className:"size-3"})}),!s&&(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-xs",className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:t=>{t.stopPropagation(),i(e.id)},children:(0,t.jsx)(E.Trash2,{className:"size-3 text-destructive"})})]},e.id)}),0===e.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,t.jsx)(u.Bot,{className:"size-10 mb-2 opacity-30"}),(0,t.jsx)("p",{className:"text-sm",children:n("list.empty")})]})]})}var R=e.i(368942),O=e.i(681622),U=e.i(188815),q=e.i(972846),F=e.i(673478);let _=(0,x.default)("plug-zap",[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]]);var V=e.i(451534),$=e.i(212068),$=$,H=e.i(415360),J=e.i(426022);let G=(0,x.default)("sliders-vertical",[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]]);var Q=e.i(129981);function W({agent:e,roleOptions:i,testing:r,testResult:d,onChange:c,onMcpChange:u,onAddSkillFiles:m,onRemoveSkill:p,onTestConnection:h}){let x=(0,s.useTranslations)("agent"),[g,f]=(0,a.useState)(()=>JSON.stringify(e.mcps,null,2)),[j,k]=(0,a.useState)(null),[N,w]=(0,a.useState)([]),{models:C,providers:S,ensure:z}=(0,R.useLLMStore)(),M=C.filter(e=>!e.embedding);(0,a.useEffect)(()=>{z()},[z]);let T=(0,a.useCallback)(e=>{c("apiBase",e.apiBase),c("apiKey",e.apiKey);let t=M.filter(t=>t.provider===e.name).map(e=>({value:e.modelId,label:e.name}));w(t),t.length>0&&c("modelId",t[0].value)},[M,c]),I=async e=>{if(!e?.length)return;let t=Array.from(e).filter(e=>e.name.toLowerCase().endsWith(".md"));m(await Promise.all(t.map(async e=>({name:e.name,content:await e.text()}))))};return(0,t.jsxs)("div",{className:"flex flex-col gap-5 p-5",children:[(0,t.jsxs)(P,{icon:(0,t.jsx)(J.MessageSquare,{className:"size-3.5"}),title:x("detail.basic"),children:[(0,t.jsxs)("div",{className:"flex items-start gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1.5",children:[(0,t.jsx)(B.AgentIcon,{name:e.name,avatarUrl:e.avatarUrl,apiBase:e.apiBase,className:"size-16 rounded-xl border border-input"}),(0,t.jsxs)("label",{className:"text-[10px] text-primary cursor-pointer hover:underline",children:[x("detail.uploadAvatar"),(0,t.jsx)("input",{type:"file",accept:"image/*",className:"hidden",onChange:async e=>{let t=e.target.files?.[0];if(!t)return;let a=new FileReader;a.onload=async()=>{try{let e=await fetch("/api/upload/avatar",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataUrl:a.result,filename:t.name})}),s=await e.json();s.url&&c("avatarUrl",s.url)}catch{}},a.readAsDataURL(t),e.target.value=""}})]}),e.avatarUrl&&(0,t.jsx)("button",{type:"button",className:"text-[10px] text-destructive hover:underline",onClick:()=>c("avatarUrl",""),children:x("detail.removeAvatar")})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col gap-2.5",children:[(0,t.jsx)(D,{label:x("detail.name"),children:(0,t.jsx)(O.Input,{value:e.name,onChange:e=>c("name",e.target.value)})}),(0,t.jsx)(D,{label:x("detail.role"),children:(0,t.jsx)("select",{value:e.role,onChange:e=>c("role",e.target.value),className:"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm outline-none focus-visible:border-ring dark:bg-input/30",children:i.map(e=>(0,t.jsx)("option",{value:e,children:e},e))})})]})]}),(0,t.jsx)(D,{label:x("detail.description"),children:(0,t.jsx)(O.Input,{value:e.description,onChange:e=>c("description",e.target.value)})}),(0,t.jsx)(D,{label:x("detail.agentRuntime"),children:(0,t.jsx)(U.SearchSelect,{value:e.runtimeKind??"",onChange:e=>c("runtimeKind",e),options:y.map(e=>({value:e.value,label:x(`runtime.${e.labelKey}`)})),placeholder:x("detail.runtimePlaceholder"),searchPlaceholder:x("detail.runtimeSearchPlaceholder"),allowCustom:!1})})]}),(0,t.jsx)(P,{icon:(0,t.jsx)(V.FolderOpen,{className:"size-3.5"}),title:x("detail.workingDirectory"),children:(0,t.jsx)(O.Input,{value:e.workingDir,onChange:e=>c("workingDir",e.target.value),placeholder:x("detail.workingDirPlaceholder")})}),(0,t.jsx)(P,{icon:(0,t.jsx)(H.Sparkles,{className:"size-3.5"}),title:x("detail.systemPrompt"),children:(0,t.jsx)(n.Textarea,{value:e.systemPrompt,onChange:e=>c("systemPrompt",e.target.value),placeholder:x("detail.systemPromptPlaceholder"),className:"min-h-24 text-xs"})}),(0,t.jsx)(P,{icon:(0,t.jsx)(H.Sparkles,{className:"size-3.5"}),title:x("detail.outputStyle"),children:(0,t.jsx)(n.Textarea,{value:e.outputStyle,onChange:e=>c("outputStyle",e.target.value),placeholder:x("detail.outputStylePlaceholder"),className:"min-h-24 text-xs"})}),(0,t.jsxs)(P,{icon:(0,t.jsx)($.default,{className:"size-3.5"}),title:x("detail.mcpServers"),children:[(0,t.jsx)(n.Textarea,{value:g,onChange:e=>(e=>{f(e);try{let t=JSON.parse(e);if(!t||"object"!=typeof t||Array.isArray(t))throw Error("MCP config must be a JSON object");k(null),u(t)}catch(e){k(e instanceof Error?e.message:"Invalid JSON")}})(e.target.value),placeholder:'{\n "mcpServers": {}\n}',className:"min-h-28 font-mono text-xs"}),j&&(0,t.jsx)("div",{className:"text-xs text-destructive",children:j})]}),(0,t.jsx)(P,{icon:(0,t.jsx)($.default,{className:"size-3.5"}),title:x("detail.tools"),children:(0,t.jsx)("div",{className:"grid gap-2",children:(v.BUILT_IN_AGENT_TOOLS??[]).map(a=>(0,t.jsxs)("label",{className:"flex cursor-pointer items-start gap-2 rounded-lg border border-input px-3 py-2 hover:bg-muted/50",children:[(0,t.jsx)("input",{type:"checkbox",checked:e.tools.includes(a.name),onChange:()=>{var t;let s;return t=a.name,void((s=new Set(e.tools)).has(t)?s.delete(t):s.add(t),c("tools",(v.BUILT_IN_AGENT_TOOLS??[]).map(e=>e.name).filter(e=>s.has(e))))},className:"mt-0.5 size-3.5"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block text-xs font-medium",children:a.label}),(0,t.jsx)("span",{className:"block text-[11px] text-muted-foreground",children:a.description})]})]},a.name))})}),(0,t.jsxs)(P,{icon:(0,t.jsx)(F.Cpu,{className:"size-3.5"}),title:x("detail.skills"),children:[(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2",children:e.skills.map((e,a)=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md border px-2 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground",children:[e.name,(0,t.jsx)("button",{type:"button",onClick:()=>p(a),className:"hover:text-destructive",children:(0,t.jsx)(q.X,{className:"size-2.5"})})]},a))}),(0,t.jsxs)("label",{className:"flex h-8 cursor-pointer items-center justify-center gap-2 rounded-lg border border-dashed border-input text-xs text-muted-foreground hover:bg-muted/50",children:[(0,t.jsx)(Q.Upload,{className:"size-3.5"}),x("detail.uploadSkills"),(0,t.jsx)("input",{type:"file",accept:".md,text/markdown",multiple:!0,className:"hidden",onChange:e=>{I(e.target.files),e.target.value=""}})]})]}),(0,t.jsxs)(P,{icon:(0,t.jsx)(G,{className:"size-3.5"}),title:x("detail.model"),children:[(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsx)(D,{label:x("detail.provider"),children:(0,t.jsx)(U.SearchSelect,{value:S.find(t=>t.apiBase===e.apiBase&&t.apiKey===e.apiKey)?.name||"",onChange:e=>{let t=S.find(t=>t.name===e);t&&T(t)},options:S.map(e=>({value:e.name,label:e.name})),placeholder:x("detail.providerPlaceholder"),searchPlaceholder:x("detail.providerSearchPlaceholder"),allowCustom:!1})}),(0,t.jsx)(D,{label:x("detail.modelField"),children:(0,t.jsx)(U.SearchSelect,{value:e.modelId,onChange:e=>c("modelId",e),options:N.length>0?N:[{value:e.modelId||"",label:e.modelId||x("detail.selectProviderFirst")}],placeholder:x("detail.modelPlaceholder"),searchPlaceholder:x("detail.modelSearchPlaceholder")})}),(0,t.jsx)(D,{label:x("detail.apiMessageType"),children:(0,t.jsx)(U.SearchSelect,{value:e.modelProvider||"",onChange:e=>c("modelProvider",e),options:b.map(e=>({value:e.value,label:x(`provider.${e.labelKey}`)})),placeholder:x("detail.apiMessageTypePlaceholder"),searchPlaceholder:x("detail.apiMessageTypeSearchPlaceholder"),allowCustom:!1})}),(0,t.jsx)(D,{label:x("detail.apiBase"),children:(0,t.jsx)(O.Input,{value:e.apiBase,onChange:e=>c("apiBase",e.target.value),placeholder:x("detail.apiBasePlaceholder"),className:"h-7 text-xs"})}),(0,t.jsx)(D,{label:x("detail.apiKey"),children:(0,t.jsx)(O.Input,{type:"password",value:e.apiKey,onChange:e=>c("apiKey",e.target.value),placeholder:x("detail.apiKeyPlaceholder"),className:"h-7 text-xs"})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:x("detail.validateHelper")}),(0,t.jsxs)(l.Button,{type:"button",variant:"outline",size:"sm",onClick:h,disabled:r||!e.apiBase||!e.apiKey||!e.modelId,children:[(0,t.jsx)(_,{className:"size-3.5"}),r?x("detail.testing"):x("detail.test")]})]}),d&&(0,t.jsxs)("div",{className:(0,o.cn)("rounded-md border px-3 py-2 text-xs",d.success?"border-green-500/30 bg-green-500/10 text-green-700":"border-destructive/30 bg-destructive/10 text-destructive"),children:[d.message,d.debug&&(0,t.jsxs)("div",{className:"mt-2 space-y-1 font-mono text-[10px] opacity-80",children:[d.debug.status&&(0,t.jsxs)("div",{children:[x("debug.status")," ",d.debug.status]}),d.debug.provider&&(0,t.jsxs)("div",{children:[x("debug.provider")," ",d.debug.provider]}),d.debug.requestUrl&&(0,t.jsxs)("div",{children:[x("debug.url")," ",d.debug.requestUrl]}),d.debug.model&&(0,t.jsxs)("div",{children:[x("debug.model")," ",d.debug.model]}),d.debug.responseBody&&(0,t.jsxs)("div",{className:"max-h-20 overflow-auto whitespace-pre-wrap",children:[x("debug.body")," ",d.debug.responseBody]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(D,{label:x("detail.temperature"),children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"range",min:0,max:2,step:.1,value:e.temperature,onChange:e=>c("temperature",parseFloat(e.target.value)),className:"flex-1"}),(0,t.jsx)("span",{className:"text-xs font-mono w-8 text-right",children:e.temperature})]})}),(0,t.jsx)(D,{label:x("detail.maxTokens"),children:(0,t.jsx)(O.Input,{type:"number",value:e.maxTokens,onChange:e=>c("maxTokens",parseInt(e.target.value)||0),className:"h-7 text-xs"})})]})]})]})}let X=new Set(["agent-generator","commit-agent"]);e.s(["AgentDialog",0,function({open:e,onOpenChange:x,roleFilter:v,initialAgentId:b,standalone:y}){let k=(0,s.useTranslations)("agent"),w=(0,s.useTranslations)("common"),[C,S]=(0,a.useState)([]),[P,D]=(0,a.useState)(null),[B,I]=(0,a.useState)(null),[A,K]=(0,a.useState)(!1),[E,R]=(0,a.useState)(!1),[O,U]=(0,a.useState)(!1),[q,F]=(0,a.useState)(!1),[_,V]=(0,a.useState)(""),[$,H]=(0,a.useState)(!1),[J,G]=(0,a.useState)(null),[Q,Y]=(0,a.useState)(null),[Z,ee]=(0,a.useState)(0),et=v?new Set(Array.isArray(v)?v:[v]):null,ea=et?C.filter(e=>X.has(e.id)||et.has(e.role)):C,es=et?j.filter(e=>et.has(e)):j;(0,a.useEffect)(()=>{if(!e)return;let t=new AbortController;return queueMicrotask(()=>{K(!0),Y(null)}),fetch("/api/agents/presets",{signal:t.signal}).then(async e=>{if(!e.ok)throw Error(await e.text());return e.json()}).then(e=>{let t=e.map(z);if(S(t),b){let e=t.find(e=>e.id===b);e&&(D(e),I({...e}))}}).catch(e=>{"AbortError"!==e.name&&Y(k("error.loadFailed"))}).finally(()=>K(!1)),()=>t.abort()},[e,b,k]);let ei=()=>{D(null),I(null),G(null)},er=async()=>{if(B){R(!0),Y(null);try{let e=B.id.startsWith("draft-"),t=function(e){let{id:t,...a}=e;return{...a,modelProvider:a.modelProvider||void 0}}(B),a=await fetch(e?"/api/agents/presets":`/api/agents/presets/${B.id}`,{method:e?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e?t:B)});if(!a.ok)throw Error(await a.text());let s=await a.json(),r=z(s);S(t=>e?[...t,r]:t.map(e=>e.id===r.id?r:e)),i.useAgentStore.setState(t=>({agents:e?[...t.agents,s]:t.agents.map(e=>e.id===s.id?s:e)})),D(null),I(null)}catch{Y(k("error.saveFailed"))}finally{R(!1)}}},el=async()=>{if(B){U(!0),G(null),Y(null);try{let e=await fetch("/api/agents/presets/test-connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)}),t=await e.json();G({success:!!t.success,message:t.message||t.error||k("error.connectionTestFailed"),debug:t.debug?{...t.debug,status:e.status}:{status:e.status}})}catch(e){G({success:!1,message:e instanceof Error?e.message:k("error.connectionTestFailed")})}finally{U(!1)}}},en=e=>{let t="empty"===e?T():M(e);Y(null),D(t),I({...t})},ed=async()=>{let e=_.trim();if(e){H(!0),Y(null);try{let t=await fetch("/api/agents/presets/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e})}),a=await t.json();if(!t.ok)throw Error(a.error||"Failed to generate agent");let s=B??(es[0]?M(es[0]):T()),i={...s,name:a.name?.trim()||s.name,description:a.description?.trim()||s.description,systemPrompt:a.systemPrompt?.trim()||s.systemPrompt};D(i),I(i),F(!1),V(""),G(null)}catch(e){Y(e instanceof Error?e.message:"智能创建 Agent 失败")}finally{H(!1)}}},eo=async e=>{X.has(e)||(S(t=>t.map(t=>t.id===e?{...t,enabled:!t.enabled}:t)),await i.useAgentStore.getState().toggleEnabled(e))},ec=async e=>{if(!X.has(e)){if(e.startsWith("draft-")){D(null),I(null);return}R(!0),Y(null);try{let t=await fetch(`/api/agents/presets/${e}`,{method:"DELETE"});if(!t.ok)throw Error(await t.text());S(t=>t.filter(t=>t.id!==e)),i.useAgentStore.setState(t=>({agents:t.agents.filter(t=>t.id!==e)})),P?.id===e&&(D(null),I(null))}catch{Y(k("error.deleteFailed"))}finally{R(!1)}}},eu=()=>{if(!P||!B)return;let{modelProvider:e,modelId:t,apiBase:a,apiKey:s,runtimeKind:i}=B;I({...P,modelProvider:e,modelId:t,apiBase:a,apiKey:s,runtimeKind:i}),G(null),ee(e=>e+1)},em=(0,t.jsxs)(t.Fragment,{children:[!y&&(0,t.jsxs)("div",{className:"flex items-center gap-3 border-b px-5 pr-12 py-4",children:[P?(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:ei,children:(0,t.jsx)(c.ArrowLeft,{className:"size-4"})}):(0,t.jsx)("div",{className:"flex size-7 items-center justify-center rounded-lg bg-primary/10",children:(0,t.jsx)(u.Bot,{className:"size-4 text-primary"})}),(0,t.jsxs)(r.DialogHeader,{className:"flex-1 space-y-0",children:[(0,t.jsx)(r.DialogTitle,{className:"text-base",children:P?B?.name??"":k("dialog.title")}),(0,t.jsx)(r.DialogDescription,{className:"text-xs",children:P?k("dialog.editDescription"):k("dialog.listDescription")})]}),P&&X.has(P.id)&&(0,t.jsxs)(l.Button,{variant:"outline",size:"sm",disabled:E,onClick:eu,children:[(0,t.jsx)(h.RotateCcw,{className:"size-3.5"}),w("reset")]}),P&&(0,t.jsxs)(l.Button,{variant:"outline",size:"sm",disabled:E||$,onClick:()=>F(!0),children:[(0,t.jsx)(g,{className:"size-3.5"}),"智能创建"]}),!P&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(l.Button,{variant:"outline",size:"sm",disabled:E||$,onClick:()=>F(!0),children:[(0,t.jsx)(g,{className:"size-3.5"}),"智能创建"]}),(0,t.jsxs)(d.DropdownMenu,{children:[(0,t.jsx)(d.DropdownMenuTrigger,{render:(0,t.jsxs)(l.Button,{variant:"outline",size:"sm",disabled:E,children:[(0,t.jsx)(p.Plus,{className:"size-3.5"}),k("dialog.add"),(0,t.jsx)(m.ChevronDown,{className:"size-3.5"})]})}),(0,t.jsx)(d.DropdownMenuContent,{side:"bottom",align:"end",className:"w-44",children:(0,t.jsxs)(d.DropdownMenuGroup,{children:[!et&&(0,t.jsxs)(d.DropdownMenuItem,{className:"gap-2",onClick:()=>en("empty"),children:[(0,t.jsx)("span",{className:"size-2 rounded-full bg-muted"}),(0,t.jsx)("span",{children:k("dialog.addEmpty")})]}),j.map(e=>(0,t.jsxs)(d.DropdownMenuItem,{className:"gap-2",onClick:()=>en(e),children:[(0,t.jsx)("span",{className:(0,o.cn)("size-2 rounded-full",f[e].split(" ")[0])}),(0,t.jsx)("span",{className:"capitalize",children:k(`role.${e}.name`)})]},e))]})})]})]})]}),y&&!P&&(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-b",children:[(0,t.jsxs)(l.Button,{variant:"outline",size:"sm",disabled:E||$,onClick:()=>F(!0),children:[(0,t.jsx)(g,{className:"size-3.5"}),"智能创建"]}),(0,t.jsxs)(d.DropdownMenu,{children:[(0,t.jsx)(d.DropdownMenuTrigger,{render:(0,t.jsxs)(l.Button,{variant:"outline",size:"sm",disabled:E,children:[(0,t.jsx)(p.Plus,{className:"size-3.5"}),k("dialog.add"),(0,t.jsx)(m.ChevronDown,{className:"size-3.5"})]})}),(0,t.jsx)(d.DropdownMenuContent,{side:"bottom",align:"end",className:"w-44",children:(0,t.jsxs)(d.DropdownMenuGroup,{children:[!et&&(0,t.jsxs)(d.DropdownMenuItem,{className:"gap-2",onClick:()=>en("empty"),children:[(0,t.jsx)("span",{className:"size-2 rounded-full bg-muted"}),(0,t.jsx)("span",{children:k("dialog.addEmpty")})]}),j.map(e=>(0,t.jsxs)(d.DropdownMenuItem,{className:"gap-2",onClick:()=>en(e),children:[(0,t.jsx)("span",{className:(0,o.cn)("size-2 rounded-full",f[e].split(" ")[0])}),(0,t.jsx)("span",{className:"capitalize",children:k(`role.${e}.name`)})]},e))]})})]})]}),y&&P&&(0,t.jsxs)("div",{className:"flex items-center gap-3 px-5 py-3 border-b",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:ei,children:(0,t.jsx)(c.ArrowLeft,{className:"size-4"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h2",{className:"text-base font-medium truncate",children:B?.name??""}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:k("dialog.editDescription")})]}),X.has(P.id)&&(0,t.jsxs)(l.Button,{variant:"outline",size:"sm",disabled:E,onClick:eu,children:[(0,t.jsx)(h.RotateCcw,{className:"size-3.5"}),w("reset")]}),(0,t.jsxs)(l.Button,{variant:"outline",size:"sm",disabled:E||$,onClick:()=>F(!0),children:[(0,t.jsx)(g,{className:"size-3.5"}),"智能创建"]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[Q&&(0,t.jsx)("div",{className:"mx-5 mt-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:Q}),A?(0,t.jsx)("div",{className:"flex flex-col p-2 space-y-1",children:Array.from({length:5},(e,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-lg px-3 py-2.5",children:[(0,t.jsx)("div",{className:"size-8 rounded-full bg-muted animate-pulse"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-4 w-20 rounded bg-muted animate-pulse"}),(0,t.jsx)("div",{className:"h-4 w-10 rounded-full bg-muted animate-pulse"})]}),(0,t.jsx)("div",{className:"h-3 w-32 rounded bg-muted animate-pulse"})]}),(0,t.jsx)("div",{className:"h-3 w-12 rounded bg-muted animate-pulse"})]},a))}):P?B?(0,t.jsx)(W,{agent:B,roleOptions:es,testing:O,testResult:J,onChange:(e,t)=>{I(a=>{if(!a)return a;if("modelProvider"===e)return{...a,modelProvider:t,runtimeKind:t&&N.has(t)?"claude-code":a.runtimeKind};return"runtimeKind"===e?{...a,runtimeKind:t}:{...a,[e]:t}})},onMcpChange:e=>{I(t=>t?{...t,mcps:e}:t)},onAddSkillFiles:e=>{if(!B)return;let t=new Set(B.skills.map(e=>e.name));I(a=>a?{...a,skills:[...a.skills.filter(t=>!e.some(e=>e.name===t.name)),...e.filter(e=>e.name&&!t.has(e.name)),...e.filter(e=>t.has(e.name))]}:a)},onRemoveSkill:e=>{B&&I(t=>t?{...t,skills:t.skills.filter((t,a)=>a!==e)}:t)},onTestConnection:el},`${B.id}-${Z}`):null:(0,t.jsx)(L,{agents:ea,onSelect:e=>{D(e),I({...e})},onDelete:ec,onToggleEnabled:eo})]}),P&&(0,t.jsxs)("div",{className:"flex justify-end gap-2 border-t px-5 py-3",children:[(0,t.jsx)(l.Button,{variant:"outline",size:"sm",onClick:ei,disabled:E,children:w("cancel")}),(0,t.jsx)(l.Button,{size:"sm",onClick:er,disabled:E,children:w(E?"saving":"save")})]}),(0,t.jsx)(r.Dialog,{open:q,onOpenChange:F,children:(0,t.jsxs)(r.DialogContent,{className:"sm:max-w-lg",children:[(0,t.jsxs)(r.DialogHeader,{children:[(0,t.jsx)(r.DialogTitle,{children:"智能创建 Agent"}),(0,t.jsx)(r.DialogDescription,{children:"输入 Agent 的职责、使用场景和约束,系统会生成名称、描述和 Markdown 系统提示。"})]}),(0,t.jsx)(n.Textarea,{value:_,onChange:e=>V(e.target.value),placeholder:"例如:创建一个代码评审 Agent,专注发现 TypeScript/React 项目中的缺陷、回归风险和缺失测试。",className:"min-h-32 text-sm"}),(0,t.jsxs)(r.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>F(!1),disabled:$,children:w("cancel")}),(0,t.jsx)(l.Button,{onClick:ed,disabled:$||!_.trim(),children:$?"生成中...":"生成"})]})]})})]});return y?(0,t.jsx)("div",{className:"h-full flex flex-col",children:em}):(0,t.jsx)(r.Dialog,{open:e,onOpenChange:e=>{e||ei(),x(e)},children:(0,t.jsx)(r.DialogContent,{className:"sm:max-w-2xl max-h-[85vh] flex flex-col p-0 gap-0",children:em})})}],588591)}]);
|