agent-tower 0.6.0-beta.2 → 0.6.0-beta.3
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/app.d.ts.map +1 -1
- package/dist/app.js +10 -2
- package/dist/app.js.map +1 -1
- package/dist/app.test.js +10 -0
- package/dist/app.test.js.map +1 -1
- package/dist/core/container.d.ts +2 -0
- package/dist/core/container.d.ts.map +1 -1
- package/dist/core/container.js +9 -1
- package/dist/core/container.js.map +1 -1
- package/dist/executors/__tests__/codex.executor.test.js +50 -0
- package/dist/executors/__tests__/codex.executor.test.js.map +1 -1
- package/dist/executors/codex.executor.d.ts +2 -0
- package/dist/executors/codex.executor.d.ts.map +1 -1
- package/dist/executors/codex.executor.js +8 -0
- package/dist/executors/codex.executor.js.map +1 -1
- package/dist/executors/execution-env.d.ts +1 -1
- package/dist/executors/execution-env.d.ts.map +1 -1
- package/dist/executors/execution-env.js +2 -0
- package/dist/executors/execution-env.js.map +1 -1
- package/dist/mcp/http-client.d.ts +24 -0
- package/dist/mcp/http-client.d.ts.map +1 -1
- package/dist/mcp/http-client.js +66 -8
- package/dist/mcp/http-client.js.map +1 -1
- package/dist/mcp/http-client.test.d.ts +2 -0
- package/dist/mcp/http-client.test.d.ts.map +1 -0
- package/dist/mcp/http-client.test.js +67 -0
- package/dist/mcp/http-client.test.js.map +1 -0
- package/dist/mcp/index.js +9 -2
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +7 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/__tests__/workspace-services.test.d.ts +2 -0
- package/dist/mcp/tools/__tests__/workspace-services.test.d.ts.map +1 -0
- package/dist/mcp/tools/__tests__/workspace-services.test.js +84 -0
- package/dist/mcp/tools/__tests__/workspace-services.test.js.map +1 -0
- package/dist/mcp/tools/workspace-services.d.ts +6 -0
- package/dist/mcp/tools/workspace-services.d.ts.map +1 -0
- package/dist/mcp/tools/workspace-services.js +102 -0
- package/dist/mcp/tools/workspace-services.js.map +1 -0
- package/dist/mcp/types.d.ts +55 -2
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/types.js +29 -0
- package/dist/mcp/types.js.map +1 -1
- package/dist/middleware/__tests__/access-auth.test.js +229 -2
- package/dist/middleware/__tests__/access-auth.test.js.map +1 -1
- package/dist/middleware/access-auth.d.ts +7 -0
- package/dist/middleware/access-auth.d.ts.map +1 -1
- package/dist/middleware/access-auth.js +50 -9
- package/dist/middleware/access-auth.js.map +1 -1
- package/dist/prompts/agent-output-intents.d.ts +2 -0
- package/dist/prompts/agent-output-intents.d.ts.map +1 -0
- package/dist/prompts/agent-output-intents.js +11 -0
- package/dist/prompts/agent-output-intents.js.map +1 -0
- package/dist/prompts/agent-output-intents.test.d.ts +2 -0
- package/dist/prompts/agent-output-intents.test.d.ts.map +1 -0
- package/dist/prompts/agent-output-intents.test.js +12 -0
- package/dist/prompts/agent-output-intents.test.js.map +1 -0
- package/dist/prompts/workspace-background-service-policy.d.ts +9 -0
- package/dist/prompts/workspace-background-service-policy.d.ts.map +1 -0
- package/dist/prompts/workspace-background-service-policy.js +17 -0
- package/dist/prompts/workspace-background-service-policy.js.map +1 -0
- package/dist/prompts/workspace-background-service-policy.test.d.ts +2 -0
- package/dist/prompts/workspace-background-service-policy.test.d.ts.map +1 -0
- package/dist/prompts/workspace-background-service-policy.test.js +19 -0
- package/dist/prompts/workspace-background-service-policy.test.js.map +1 -0
- package/dist/routes/__tests__/previews.integration.test.js +1 -0
- package/dist/routes/__tests__/previews.integration.test.js.map +1 -1
- package/dist/routes/__tests__/previews.test.js +6 -1
- package/dist/routes/__tests__/previews.test.js.map +1 -1
- package/dist/routes/__tests__/providers.test.js +1 -0
- package/dist/routes/__tests__/providers.test.js.map +1 -1
- package/dist/routes/__tests__/sessions-visualizations.test.d.ts +2 -0
- package/dist/routes/__tests__/sessions-visualizations.test.d.ts.map +1 -0
- package/dist/routes/__tests__/sessions-visualizations.test.js +89 -0
- package/dist/routes/__tests__/sessions-visualizations.test.js.map +1 -0
- package/dist/routes/__tests__/workspace-services.test.d.ts +2 -0
- package/dist/routes/__tests__/workspace-services.test.d.ts.map +1 -0
- package/dist/routes/__tests__/workspace-services.test.js +148 -0
- package/dist/routes/__tests__/workspace-services.test.js.map +1 -0
- package/dist/routes/access-auth.d.ts.map +1 -1
- package/dist/routes/access-auth.js +24 -11
- package/dist/routes/access-auth.js.map +1 -1
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +3 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/previews.d.ts.map +1 -1
- package/dist/routes/previews.js +4 -6
- package/dist/routes/previews.js.map +1 -1
- package/dist/routes/sessions.d.ts.map +1 -1
- package/dist/routes/sessions.js +93 -0
- package/dist/routes/sessions.js.map +1 -1
- package/dist/routes/tasks.d.ts.map +1 -1
- package/dist/routes/tasks.js +2 -2
- package/dist/routes/tasks.js.map +1 -1
- package/dist/routes/workspace-services.d.ts +7 -0
- package/dist/routes/workspace-services.d.ts.map +1 -0
- package/dist/routes/workspace-services.js +129 -0
- package/dist/routes/workspace-services.js.map +1 -0
- package/dist/runtime/__tests__/acp-agent-definitions.test.js +43 -0
- package/dist/runtime/__tests__/acp-agent-definitions.test.js.map +1 -1
- package/dist/runtime/__tests__/acp-driver-lifecycle.test.js +61 -1
- package/dist/runtime/__tests__/acp-driver-lifecycle.test.js.map +1 -1
- package/dist/runtime/__tests__/acp-driver.test.js +2 -0
- package/dist/runtime/__tests__/acp-driver.test.js.map +1 -1
- package/dist/runtime/__tests__/acp-process-manager.test.js +40 -1
- package/dist/runtime/__tests__/acp-process-manager.test.js.map +1 -1
- package/dist/runtime/__tests__/acp-projector.test.js +55 -0
- package/dist/runtime/__tests__/acp-projector.test.js.map +1 -1
- package/dist/runtime/__tests__/runtime-coordinator.test.js +5 -2
- package/dist/runtime/__tests__/runtime-coordinator.test.js.map +1 -1
- package/dist/runtime/acp/acp-driver.js +79 -27
- package/dist/runtime/acp/acp-driver.js.map +1 -1
- package/dist/runtime/acp/agents/codex-frame-normalizer.d.ts +4 -0
- package/dist/runtime/acp/agents/codex-frame-normalizer.d.ts.map +1 -0
- package/dist/runtime/acp/agents/codex-frame-normalizer.js +51 -0
- package/dist/runtime/acp/agents/codex-frame-normalizer.js.map +1 -0
- package/dist/runtime/acp/agents/codex.d.ts.map +1 -1
- package/dist/runtime/acp/agents/codex.js +21 -0
- package/dist/runtime/acp/agents/codex.js.map +1 -1
- package/dist/runtime/acp/agents/types.d.ts +4 -0
- package/dist/runtime/acp/agents/types.d.ts.map +1 -1
- package/dist/runtime/acp/codex-provider-config.d.ts +1 -0
- package/dist/runtime/acp/codex-provider-config.d.ts.map +1 -1
- package/dist/runtime/acp/codex-provider-config.js +4 -0
- package/dist/runtime/acp/codex-provider-config.js.map +1 -1
- package/dist/runtime/acp/process-manager.d.ts +3 -0
- package/dist/runtime/acp/process-manager.d.ts.map +1 -1
- package/dist/runtime/acp/process-manager.js +31 -12
- package/dist/runtime/acp/process-manager.js.map +1 -1
- package/dist/runtime/acp/projector.d.ts.map +1 -1
- package/dist/runtime/acp/projector.js +71 -5
- package/dist/runtime/acp/projector.js.map +1 -1
- package/dist/runtime/contracts.d.ts +1 -0
- package/dist/runtime/contracts.d.ts.map +1 -1
- package/dist/runtime/runtime-coordinator.d.ts.map +1 -1
- package/dist/runtime/runtime-coordinator.js +1 -0
- package/dist/runtime/runtime-coordinator.js.map +1 -1
- package/dist/services/__tests__/access-auth.service.test.js +41 -0
- package/dist/services/__tests__/access-auth.service.test.js.map +1 -1
- package/dist/services/__tests__/agent-artifact.service.test.d.ts +2 -0
- package/dist/services/__tests__/agent-artifact.service.test.d.ts.map +1 -0
- package/dist/services/__tests__/agent-artifact.service.test.js +133 -0
- package/dist/services/__tests__/agent-artifact.service.test.js.map +1 -0
- package/dist/services/__tests__/agent-visualization.service.test.d.ts +2 -0
- package/dist/services/__tests__/agent-visualization.service.test.d.ts.map +1 -0
- package/dist/services/__tests__/agent-visualization.service.test.js +57 -0
- package/dist/services/__tests__/agent-visualization.service.test.js.map +1 -0
- package/dist/services/__tests__/preview-runtime-manager.test.js +5 -0
- package/dist/services/__tests__/preview-runtime-manager.test.js.map +1 -1
- package/dist/services/__tests__/project.service.test.js +6 -2
- package/dist/services/__tests__/project.service.test.js.map +1 -1
- package/dist/services/__tests__/provider-config.service.test.js +32 -0
- package/dist/services/__tests__/provider-config.service.test.js.map +1 -1
- package/dist/services/__tests__/session-manager.lifecycle.test.js +153 -1
- package/dist/services/__tests__/session-manager.lifecycle.test.js.map +1 -1
- package/dist/services/__tests__/session-manager.team-run.test.js +18 -5
- package/dist/services/__tests__/session-manager.team-run.test.js.map +1 -1
- package/dist/services/__tests__/task.service.test.js +16 -3
- package/dist/services/__tests__/task.service.test.js.map +1 -1
- package/dist/services/__tests__/workspace-background-process-manager.test.d.ts +2 -0
- package/dist/services/__tests__/workspace-background-process-manager.test.d.ts.map +1 -0
- package/dist/services/__tests__/workspace-background-process-manager.test.js +412 -0
- package/dist/services/__tests__/workspace-background-process-manager.test.js.map +1 -0
- package/dist/services/__tests__/workspace-background-service.service.test.d.ts +2 -0
- package/dist/services/__tests__/workspace-background-service.service.test.d.ts.map +1 -0
- package/dist/services/__tests__/workspace-background-service.service.test.js +418 -0
- package/dist/services/__tests__/workspace-background-service.service.test.js.map +1 -0
- package/dist/services/__tests__/workspace.service.test.js +137 -0
- package/dist/services/__tests__/workspace.service.test.js.map +1 -1
- package/dist/services/access-auth.service.d.ts +15 -1
- package/dist/services/access-auth.service.d.ts.map +1 -1
- package/dist/services/access-auth.service.js +75 -15
- package/dist/services/access-auth.service.js.map +1 -1
- package/dist/services/agent-artifact.service.d.ts +28 -0
- package/dist/services/agent-artifact.service.d.ts.map +1 -0
- package/dist/services/agent-artifact.service.js +287 -0
- package/dist/services/agent-artifact.service.js.map +1 -0
- package/dist/services/agent-visualization.service.d.ts +12 -0
- package/dist/services/agent-visualization.service.d.ts.map +1 -0
- package/dist/services/agent-visualization.service.js +239 -0
- package/dist/services/agent-visualization.service.js.map +1 -0
- package/dist/services/mcp-config.service.d.ts.map +1 -1
- package/dist/services/mcp-config.service.js +8 -1
- package/dist/services/mcp-config.service.js.map +1 -1
- package/dist/services/mcp-config.service.test.js +14 -0
- package/dist/services/mcp-config.service.test.js.map +1 -1
- package/dist/services/preview-runtime-manager.d.ts.map +1 -1
- package/dist/services/preview-runtime-manager.js +15 -12
- package/dist/services/preview-runtime-manager.js.map +1 -1
- package/dist/services/project.service.d.ts +4 -1
- package/dist/services/project.service.d.ts.map +1 -1
- package/dist/services/project.service.js +43 -32
- package/dist/services/project.service.js.map +1 -1
- package/dist/services/provider-config.service.d.ts.map +1 -1
- package/dist/services/provider-config.service.js +11 -0
- package/dist/services/provider-config.service.js.map +1 -1
- package/dist/services/session-manager.d.ts +34 -32
- package/dist/services/session-manager.d.ts.map +1 -1
- package/dist/services/session-manager.js +43 -23
- package/dist/services/session-manager.js.map +1 -1
- package/dist/services/task-cleanup.service.d.ts +4 -1
- package/dist/services/task-cleanup.service.d.ts.map +1 -1
- package/dist/services/task-cleanup.service.js +13 -1
- package/dist/services/task-cleanup.service.js.map +1 -1
- package/dist/services/task.service.d.ts +22 -20
- package/dist/services/task.service.d.ts.map +1 -1
- package/dist/services/task.service.js +21 -8
- package/dist/services/task.service.js.map +1 -1
- package/dist/services/workspace-background-process-manager.d.ts +66 -0
- package/dist/services/workspace-background-process-manager.d.ts.map +1 -0
- package/dist/services/workspace-background-process-manager.js +328 -0
- package/dist/services/workspace-background-process-manager.js.map +1 -0
- package/dist/services/workspace-background-service.service.d.ts +39 -0
- package/dist/services/workspace-background-service.service.d.ts.map +1 -0
- package/dist/services/workspace-background-service.service.js +520 -0
- package/dist/services/workspace-background-service.service.js.map +1 -0
- package/dist/services/workspace-lifecycle-barrier.d.ts +10 -0
- package/dist/services/workspace-lifecycle-barrier.d.ts.map +1 -0
- package/dist/services/workspace-lifecycle-barrier.js +35 -0
- package/dist/services/workspace-lifecycle-barrier.js.map +1 -0
- package/dist/services/workspace.service.d.ts +42 -36
- package/dist/services/workspace.service.d.ts.map +1 -1
- package/dist/services/workspace.service.js +100 -39
- package/dist/services/workspace.service.js.map +1 -1
- package/dist/socket/__tests__/socket-gateway.test.js +23 -0
- package/dist/socket/__tests__/socket-gateway.test.js.map +1 -1
- package/dist/socket/middleware/__tests__/auth.test.js +3 -3
- package/dist/socket/middleware/__tests__/auth.test.js.map +1 -1
- package/dist/utils/agent-api-credential.d.ts +11 -0
- package/dist/utils/agent-api-credential.d.ts.map +1 -0
- package/dist/utils/agent-api-credential.js +40 -0
- package/dist/utils/agent-api-credential.js.map +1 -0
- package/dist/utils/internal-api-token.d.ts +2 -0
- package/dist/utils/internal-api-token.d.ts.map +1 -1
- package/dist/utils/internal-api-token.js +2 -0
- package/dist/utils/internal-api-token.js.map +1 -1
- package/dist/utils/process-launch.d.ts.map +1 -1
- package/dist/utils/process-launch.js +156 -22
- package/dist/utils/process-launch.js.map +1 -1
- package/dist/utils/process-launch.test.js +7 -0
- package/dist/utils/process-launch.test.js.map +1 -1
- package/dist/utils/unix-process-identity.d.ts +23 -0
- package/dist/utils/unix-process-identity.d.ts.map +1 -0
- package/dist/utils/unix-process-identity.js +165 -0
- package/dist/utils/unix-process-identity.js.map +1 -0
- package/dist/web/assets/{AgentDemoPage-XrttOpQW.js → AgentDemoPage-CLemSpf6.js} +1 -1
- package/dist/web/assets/{AgentEnvironmentSettingsPage-CAo0bCpZ.js → AgentEnvironmentSettingsPage-CPggaJvZ.js} +1 -1
- package/dist/web/assets/{AgentLogo-BCwbooTN.js → AgentLogo-DJFjaRFS.js} +1 -1
- package/dist/web/assets/ConversationPage-CB4PoHYi.js +3 -0
- package/dist/web/assets/CreateTaskInput-CXWGjX_a.js +1 -0
- package/dist/web/assets/{DemoPage-DHMh9-zU.js → DemoPage-djW4NeHW.js} +3 -3
- package/dist/web/assets/{GeneralSettingsPage-DvWaqR9O.js → GeneralSettingsPage-0a2VgV74.js} +1 -1
- package/dist/web/assets/{Icons-DADUmnB1.js → Icons-tvQ3lNxT.js} +1 -1
- package/dist/web/assets/{LoadingPreviewPage-Dk91Ua1W.js → LoadingPreviewPage-D8GpQ-Ic.js} +1 -1
- package/dist/web/assets/McpSettingsPage-BxPMmwHH.js +1 -0
- package/dist/web/assets/{MemberAvatar-l-WCdlLA.js → MemberAvatar-JbGgXa3r.js} +1 -1
- package/dist/web/assets/{NotificationSettingsPage-Byu8b9X3.js → NotificationSettingsPage-BtN0fYTA.js} +1 -1
- package/dist/web/assets/{ProfileSettingsPage-BdylqWUj.js → ProfileSettingsPage-CVSHbAtS.js} +1 -1
- package/dist/web/assets/ProjectKanbanPage-Dq0pufE1.js +90 -0
- package/dist/web/assets/ProjectSettingsPage-CChSA5A4.js +2 -0
- package/dist/web/assets/ProviderSettingsPage-giXaDHmU.js +95 -0
- package/dist/web/assets/{SettingsMasterDetail-DTGIIGdI.js → SettingsMasterDetail-D-TeBuLx.js} +1 -1
- package/dist/web/assets/{TeamSettingsPage-BXuG4Bou.js → TeamSettingsPage-DNLp2l2E.js} +1 -1
- package/dist/web/assets/{arc-DrcjdWTE.js → arc-B5sdSA9b.js} +1 -1
- package/dist/web/assets/{architectureDiagram-3BPJPVTR-CAoBhXSL.js → architectureDiagram-3BPJPVTR-ClsPKWjN.js} +1 -1
- package/dist/web/assets/{arrow-left-CCWDjOmp.js → arrow-left-B7C-fOb5.js} +1 -1
- package/dist/web/assets/{blockDiagram-GPEHLZMM-CcTSBbUq.js → blockDiagram-GPEHLZMM-HHViBKvL.js} +1 -1
- package/dist/web/assets/{c4Diagram-AAUBKEIU-BuUKdgUg.js → c4Diagram-AAUBKEIU-CRreiVUs.js} +1 -1
- package/dist/web/assets/channel-Bhjxgyee.js +1 -0
- package/dist/web/assets/check-Dtr-nHO5.js +1 -0
- package/dist/web/assets/{chevron-down-BQcW9sFf.js → chevron-down-BZnZAd2n.js} +1 -1
- package/dist/web/assets/{chevron-right-pH923eYp.js → chevron-right-nnOI2p8q.js} +1 -1
- package/dist/web/assets/{chevron-up-DyQW115F.js → chevron-up-Cl6FGZ8R.js} +1 -1
- package/dist/web/assets/{chunk-2J33WTMH-BWNSmQa8.js → chunk-2J33WTMH-_s2AOnis.js} +1 -1
- package/dist/web/assets/{chunk-4BX2VUAB-Blldhw0k.js → chunk-4BX2VUAB-Ds1jhNjB.js} +1 -1
- package/dist/web/assets/{chunk-55IACEB6-hTffyPXL.js → chunk-55IACEB6-B2SvpbB1.js} +1 -1
- package/dist/web/assets/{chunk-727SXJPM-Cd48r7c-.js → chunk-727SXJPM-B6qjWdxn.js} +1 -1
- package/dist/web/assets/{chunk-AQP2D5EJ-BdDrOIL7.js → chunk-AQP2D5EJ-myECS-o9.js} +1 -1
- package/dist/web/assets/{chunk-FMBD7UC4-6XIvQYVJ.js → chunk-FMBD7UC4-CFDf13jX.js} +1 -1
- package/dist/web/assets/{chunk-ND2GUHAM-BJlcb_pB.js → chunk-ND2GUHAM-62aJufBH.js} +1 -1
- package/dist/web/assets/{chunk-QZHKN3VN-3TZzFkxK.js → chunk-QZHKN3VN-DEWvzHCx.js} +1 -1
- package/dist/web/assets/{circle-alert-oa-BQ5e7.js → circle-alert-BSGJzTSj.js} +1 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-BxnIeW8e.js +1 -0
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-BxnIeW8e.js +1 -0
- package/dist/web/assets/{code-block-OCS4YCEC-xJQWFyR7.js → code-block-OCS4YCEC-DWj3hzdw.js} +1 -1
- package/dist/web/assets/{confirm-dialog-CRiC3xBd.js → confirm-dialog-oStWxmjS.js} +1 -1
- package/dist/web/assets/{cose-bilkent-S5V4N54A-Cjcm-rW_.js → cose-bilkent-S5V4N54A-DNYqhVNu.js} +1 -1
- package/dist/web/assets/cssMode-Cn68yhOS.js +1 -0
- package/dist/web/assets/{dagre-BM42HDAG-YqubcAJi.js → dagre-BM42HDAG-gQbGUd4s.js} +1 -1
- package/dist/web/assets/{diagram-2AECGRRQ-Dk4ayFqg.js → diagram-2AECGRRQ-BeMaPQBR.js} +1 -1
- package/dist/web/assets/{diagram-5GNKFQAL-CQ0joYfB.js → diagram-5GNKFQAL-CStJaSd8.js} +1 -1
- package/dist/web/assets/{diagram-KO2AKTUF-DmuZzIdW.js → diagram-KO2AKTUF-BmEeaazt.js} +1 -1
- package/dist/web/assets/{diagram-LMA3HP47-YTPEfEZy.js → diagram-LMA3HP47-ClNnKUvt.js} +1 -1
- package/dist/web/assets/{diagram-OG6HWLK6-DmwRuz8-.js → diagram-OG6HWLK6-C24GKhLk.js} +1 -1
- package/dist/web/assets/{erDiagram-TEJ5UH35-LRL_DMXa.js → erDiagram-TEJ5UH35-6Xp8w1WL.js} +1 -1
- package/dist/web/assets/{flowDiagram-I6XJVG4X-ELBDyOvk.js → flowDiagram-I6XJVG4X-BCih6e9O.js} +1 -1
- package/dist/web/assets/folder-picker-DcY2P8zf.js +1 -0
- package/dist/web/assets/{freemarker2-DxJFkRz5.js → freemarker2-C6kMBtOW.js} +1 -1
- package/dist/web/assets/{ganttDiagram-6RSMTGT7-D0e9ILuF.js → ganttDiagram-6RSMTGT7-_9GX-BOi.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-PVQCEYII-Ck6OXXw0.js → gitGraphDiagram-PVQCEYII-DEe9VMLq.js} +1 -1
- package/dist/web/assets/handlebars-BxZgdhY8.js +1 -0
- package/dist/web/assets/html-bhMfD_X9.js +1 -0
- package/dist/web/assets/htmlMode-CC7AVUJ4.js +1 -0
- package/dist/web/assets/index-018g9RN4.css +1 -0
- package/dist/web/assets/{index-D9kBRMR0.js → index-ToY1NCNr.js} +3 -3
- package/dist/web/assets/{index-CjdqAcbu.js → index-cl-QFuts.js} +4 -4
- package/dist/web/assets/{infoDiagram-5YYISTIA-Cx8be-MV.js → infoDiagram-5YYISTIA-CU3D8SMZ.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-Dlc7akl7.js → ishikawaDiagram-YF4QCWOH-ClffgdSa.js} +1 -1
- package/dist/web/assets/javascript-8UIdW5Gd.js +1 -0
- package/dist/web/assets/{journeyDiagram-JHISSGLW-BVDSbS9-.js → journeyDiagram-JHISSGLW-Cy7Rr0_y.js} +1 -1
- package/dist/web/assets/{jsonMode-B5CJhoWd.js → jsonMode-JLBoaKf1.js} +1 -1
- package/dist/web/assets/{kanban-definition-UN3LZRKU-nFR0zB7B.js → kanban-definition-UN3LZRKU-14piuQEq.js} +1 -1
- package/dist/web/assets/{layers-Bo4aml98.js → layers-C93epAjs.js} +1 -1
- package/dist/web/assets/{linear-BCWZjcpP.js → linear-BtH62ya4.js} +1 -1
- package/dist/web/assets/liquid-BntTiwt7.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-Cbk7wEkj.js → lspLanguageFeatures-Dk65AKZD.js} +1 -1
- package/dist/web/assets/mdx-ToUKdFio.js +1 -0
- package/dist/web/assets/{mermaid-NOHMQCX5-DWQaYVL0.js → mermaid-NOHMQCX5-CPO3gPWp.js} +66 -65
- package/dist/web/assets/{message-square-DxbkpGqF.js → message-square-BBENHwpb.js} +1 -1
- package/dist/web/assets/{mindmap-definition-RKZ34NQL-LI7W1FIX.js → mindmap-definition-RKZ34NQL-gWYqFXbP.js} +1 -1
- package/dist/web/assets/{modal-Cymk-6Df.js → modal-D-sNOVPw.js} +1 -1
- package/dist/web/assets/{monaco-Bc-Z2u8N.js → monaco-B9Zd90UG.js} +3 -3
- package/dist/web/assets/{pencil-DOL2nlgg.js → pencil-BRPix314.js} +1 -1
- package/dist/web/assets/{pieDiagram-4H26LBE5-mgUzAFkk.js → pieDiagram-4H26LBE5-C3cHgEuO.js} +1 -1
- package/dist/web/assets/python-BeGIUwrY.js +1 -0
- package/dist/web/assets/{quadrantDiagram-W4KKPZXB-CaDF2kqA.js → quadrantDiagram-W4KKPZXB-DZFYp-mp.js} +1 -1
- package/dist/web/assets/razor-CnCuqD7W.js +1 -0
- package/dist/web/assets/{requirementDiagram-4Y6WPE33-DhmHdr_0.js → requirementDiagram-4Y6WPE33-DSQRXAFH.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-5OEKKPKP-B7qnGfue.js → sankeyDiagram-5OEKKPKP-CEXk2v3C.js} +1 -1
- package/dist/web/assets/{select-BpKQyMvD.js → select-CGNclv1f.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-3UESZ5HK-D2LhPgpM.js → sequenceDiagram-3UESZ5HK-CHVF_25M.js} +1 -1
- package/dist/web/assets/server-UA3ZvpjF.js +1 -0
- package/dist/web/assets/{stateDiagram-AJRCARHV-ClkO4Gu5.js → stateDiagram-AJRCARHV-TMqBR1_f.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-DqCjP1u1.js +1 -0
- package/dist/web/assets/{switch-BJ4Ar_OA.js → switch-C7qsQ1x2.js} +1 -1
- package/dist/web/assets/{textarea-DjwjAAG8.js → textarea-CDdCks2T.js} +1 -1
- package/dist/web/assets/{timeline-definition-PNZ67QCA-DhGIG-GC.js → timeline-definition-PNZ67QCA-CxC3mFt7.js} +1 -1
- package/dist/web/assets/{trash-2-R46i6Uus.js → trash-2-Bye7VGcW.js} +1 -1
- package/dist/web/assets/{tsMode-CKaqpIrz.js → tsMode-8nvc-x2E.js} +1 -1
- package/dist/web/assets/typescript-P7JXXc42.js +1 -0
- package/dist/web/assets/{upload-CgWqsmdI.js → upload-wJO5M1ZY.js} +1 -1
- package/dist/web/assets/{use-profiles-BlGgvdYm.js → use-profiles-CYJIKesy.js} +1 -1
- package/dist/web/assets/{use-projects-Cuv0A0RC.js → use-projects-Ds_YI2En.js} +1 -1
- package/dist/web/assets/{use-providers-DLcAY6E1.js → use-providers-B9FaTKyw.js} +1 -1
- package/dist/web/assets/{useNormalizedLogs-tfxFAJOF.js → useNormalizedLogs-B8um63GF.js} +1 -1
- package/dist/web/assets/{vennDiagram-CIIHVFJN-BngQhsYJ.js → vennDiagram-CIIHVFJN-DX0jm9G-.js} +1 -1
- package/dist/web/assets/{wardley-L42UT6IY-BEY6sftT.js → wardley-L42UT6IY-Ce-rqtq2.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-YWT4CUSO-IH_Yh-cw.js → wardleyDiagram-YWT4CUSO-Gpxnu2av.js} +1 -1
- package/dist/web/assets/xml-1G4iEdpK.js +1 -0
- package/dist/web/assets/{xychartDiagram-2RQKCTM6-BdrGFDsr.js → xychartDiagram-2RQKCTM6-COe6opx2.js} +1 -1
- package/dist/web/assets/yaml-HqUdsAk3.js +1 -0
- package/dist/web/index.html +2 -2
- package/node_modules/@agent-tower/shared/dist/agent-download-intent.d.ts +6 -0
- package/node_modules/@agent-tower/shared/dist/agent-download-intent.d.ts.map +1 -0
- package/node_modules/@agent-tower/shared/dist/agent-download-intent.js +46 -0
- package/node_modules/@agent-tower/shared/dist/agent-download-intent.js.map +1 -0
- package/node_modules/@agent-tower/shared/dist/index.d.ts +1 -0
- package/node_modules/@agent-tower/shared/dist/index.d.ts.map +1 -1
- package/node_modules/@agent-tower/shared/dist/index.js +1 -0
- package/node_modules/@agent-tower/shared/dist/index.js.map +1 -1
- package/node_modules/@agent-tower/shared/dist/provider-capabilities.d.ts +1 -0
- package/node_modules/@agent-tower/shared/dist/provider-capabilities.d.ts.map +1 -1
- package/node_modules/@agent-tower/shared/dist/provider-capabilities.js +4 -0
- package/node_modules/@agent-tower/shared/dist/provider-capabilities.js.map +1 -1
- package/node_modules/@agent-tower/shared/dist/types.d.ts +56 -2
- package/node_modules/@agent-tower/shared/dist/types.d.ts.map +1 -1
- package/node_modules/@agent-tower/shared/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20260728000000_add_agent_artifacts/migration.sql +23 -0
- package/prisma/schema.prisma +48 -0
- package/dist/web/assets/ConversationPage-kyHuICil.js +0 -3
- package/dist/web/assets/CreateTaskInput-B67vzMJD.js +0 -1
- package/dist/web/assets/McpSettingsPage-CH8jFyxp.js +0 -1
- package/dist/web/assets/ProjectKanbanPage--cx6wNDR.js +0 -90
- package/dist/web/assets/ProjectSettingsPage-6psG0Vfc.js +0 -2
- package/dist/web/assets/ProviderSettingsPage-BPEEkhtA.js +0 -93
- package/dist/web/assets/channel-Bh_PCZNP.js +0 -1
- package/dist/web/assets/check-BN_PVKzE.js +0 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-B0lQFDoP.js +0 -1
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-B0lQFDoP.js +0 -1
- package/dist/web/assets/copy-DaoAUKTO.js +0 -1
- package/dist/web/assets/cssMode-_D6u4YDd.js +0 -1
- package/dist/web/assets/folder-picker-WUhXxIM5.js +0 -1
- package/dist/web/assets/handlebars-djdO6ZKR.js +0 -1
- package/dist/web/assets/html-CHeBxmFi.js +0 -1
- package/dist/web/assets/htmlMode-SZh8FaPi.js +0 -1
- package/dist/web/assets/index-CjAJoGg5.css +0 -1
- package/dist/web/assets/javascript-l6fV6hf7.js +0 -1
- package/dist/web/assets/liquid-DkFOeJ6J.js +0 -1
- package/dist/web/assets/mdx-BOPNdexu.js +0 -1
- package/dist/web/assets/python-D_wlYLCL.js +0 -1
- package/dist/web/assets/razor-DBFVg4JU.js +0 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-YnSeSD_N.js +0 -1
- package/dist/web/assets/typescript-DsixnGVt.js +0 -1
- package/dist/web/assets/xml-dEcQ1gzo.js +0 -1
- package/dist/web/assets/yaml-BfGVqGj4.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{u as U,r as o,p as de,j as e,X as se,S as K,_ as ue,g as Q,s as H,l as W,T as me,B as z,$ as xe,a0 as pe,t as _}from"./index-D9kBRMR0.js";import{F as X,u as fe,a as he,b as ge,c as je}from"./use-projects-Cuv0A0RC.js";import{F as V,a as ve,b as be}from"./folder-picker-WUhXxIM5.js";import{P as re,T as ye}from"./trash-2-R46i6Uus.js";import{M as Y}from"./modal-Cymk-6Df.js";import{S as Ne}from"./SettingsMasterDetail-DTGIIGdI.js";import"./chevron-right-pH923eYp.js";import"./circle-alert-oa-BQ5e7.js";import"./check-BN_PVKzE.js";import"./arrow-left-CCWDjOmp.js";function Pe({value:t,onChange:y,repoPath:N,placeholder:k,disabled:a,disabledMessage:c}){const{t:d}=U(),[l,j]=o.useState(""),[h,n]=o.useState([]),[u,x]=o.useState(!1),[p,v]=o.useState(-1),b=o.useRef(null),E=o.useRef(null),R=o.useRef(void 0),q=o.useCallback(async s=>{if(a||!N||!s){n([]),x(!1);return}try{const i=await de.get("/filesystem/complete",{params:{basePath:N,prefix:s}});n(i.results),x(i.results.length>0),v(-1)}catch{n([]),x(!1)}},[a,N]);o.useEffect(()=>{if(clearTimeout(R.current),!l){n([]),x(!1);return}return R.current=setTimeout(()=>q(l),200),()=>clearTimeout(R.current)},[l,q]),o.useEffect(()=>{const s=i=>{E.current&&!E.current.contains(i.target)&&b.current&&!b.current.contains(i.target)&&x(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]);const w=s=>{if(a)return;const i=s.trim();!i||t.includes(i)||(y([...t,i]),j(""),x(!1),b.current?.focus())},S=s=>{a||y(t.filter((i,A)=>A!==s))},D=s=>{a||(s.type==="directory"?(j(s.path),b.current?.focus()):w(s.path))},M=(s,i)=>{a||(i.stopPropagation(),w(s.path.replace(/\/$/,"")))},F=s=>{s.nativeEvent.isComposing||s.nativeEvent.keyCode===229||a||(u&&h.length>0?s.key==="ArrowDown"?(s.preventDefault(),v(i=>Math.min(i+1,h.length-1))):s.key==="ArrowUp"?(s.preventDefault(),v(i=>Math.max(i-1,-1))):s.key==="Enter"?(s.preventDefault(),p>=0?D(h[p]):w(l)):s.key==="Escape"&&x(!1):s.key==="Enter"&&(s.preventDefault(),w(l)))};return e.jsxs("div",{children:[t.length>0&&e.jsx("div",{className:"border border-neutral-200 rounded-lg mb-2 divide-y divide-neutral-100",children:t.map((s,i)=>e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 group",children:[s.includes(".")&&!s.endsWith("/")?e.jsx(V,{size:14,className:"text-neutral-400 shrink-0"}):e.jsx(X,{size:14,className:"text-amber-500 shrink-0"}),e.jsx("span",{className:"text-sm font-mono text-neutral-700 truncate flex-1",children:s}),e.jsx("button",{onClick:()=>S(i),disabled:a,className:"p-0.5 text-neutral-300 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity shrink-0 disabled:cursor-not-allowed disabled:hover:text-neutral-300",children:e.jsx(se,{size:14})})]},s))}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:b,type:"text",value:l,onChange:s=>j(s.target.value),onKeyDown:F,onFocus:()=>{l&&h.length>0&&x(!0)},placeholder:k??d("输入文件路径..."),disabled:a,className:"flex-1 px-3 py-2 border border-neutral-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-1 focus:ring-neutral-300 disabled:cursor-not-allowed disabled:bg-neutral-50 disabled:text-neutral-400"}),e.jsxs("button",{onClick:()=>w(l),disabled:a||!l.trim(),className:"flex items-center gap-1 px-3 py-2 text-sm bg-neutral-900 text-white rounded-lg hover:bg-neutral-800 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(re,{size:14}),e.jsx("span",{children:d("添加")})]})]}),u&&e.jsx("div",{ref:E,className:"absolute z-50 left-0 right-0 mt-1 bg-white border border-neutral-200 rounded-lg shadow-lg max-h-[200px] overflow-y-auto",children:h.map((s,i)=>e.jsxs("button",{onClick:()=>D(s),className:`w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-neutral-50 transition-colors ${i===p?"bg-neutral-100":""}`,children:[s.type==="directory"?e.jsx(X,{size:14,className:"text-amber-500 shrink-0"}):e.jsx(V,{size:14,className:"text-neutral-400 shrink-0"}),e.jsx("span",{className:"font-mono text-neutral-700 truncate flex-1",children:s.path}),s.type==="directory"&&e.jsx("span",{onClick:A=>M(s,A),className:"p-0.5 text-neutral-300 hover:text-emerald-600 shrink-0",title:d("添加此目录"),children:e.jsx(ve,{size:14})})]},s.path))})]}),a&&c&&e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:c})]})}function ke({value:t,onChange:y}){const{t:N}=U(),[k,a]=o.useState(""),[c,d]=o.useState(""),l=()=>{const n=k.trim(),u=c.trim();!n||!u||(y([...t,{name:n,command:u}]),a(""),d(""))},j=n=>{y(t.filter((u,x)=>x!==n))},h=n=>{n.key==="Enter"&&!n.nativeEvent.isComposing&&n.nativeEvent.keyCode!==229&&(n.preventDefault(),l())};return e.jsxs("div",{children:[t.length>0&&e.jsx("div",{className:"border border-neutral-200 rounded-lg mb-2 divide-y divide-neutral-100",children:t.map((n,u)=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 group",children:[e.jsx("span",{className:"text-sm font-medium text-neutral-700 w-28 shrink-0 truncate",children:n.name}),e.jsx("span",{className:"text-sm font-mono text-neutral-500 flex-1 truncate",children:n.command}),e.jsx("button",{onClick:()=>j(u),className:"p-0.5 text-neutral-300 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:e.jsx(se,{size:14})})]},u))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:k,onChange:n=>a(n.target.value),onKeyDown:h,placeholder:N("名称"),className:"w-28 shrink-0 px-3 py-2 border border-neutral-200 rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-neutral-300"}),e.jsx("input",{type:"text",value:c,onChange:n=>d(n.target.value),onKeyDown:h,placeholder:N("命令"),className:"flex-1 px-3 py-2 border border-neutral-200 rounded-lg text-sm font-mono focus:outline-none focus:ring-1 focus:ring-neutral-300"}),e.jsxs("button",{onClick:l,disabled:!k.trim()||!c.trim(),className:"flex items-center gap-1 px-3 py-2 text-sm bg-neutral-900 text-white rounded-lg hover:bg-neutral-800 disabled:opacity-30 disabled:cursor-not-allowed transition-colors shrink-0",children:[e.jsx(re,{size:14}),e.jsx("span",{children:N("添加")})]})]})]})}function Z(t){return t?t.split(",").map(y=>y.trim()).filter(Boolean):[]}function ee(t){if(!t)return[];try{return JSON.parse(t)}catch{return[]}}function te(t){return typeof t.color!="string"||t.color.trim()===""?"bg-muted-foreground":t.color.startsWith("bg-")?t.color:t.color.startsWith("text-")?t.color.replace("text-","bg-"):"bg-muted-foreground"}function qe(){const{t}=U(),{data:y,isLoading:N}=fe({limit:100,includeArchived:!0}),k=he(),a=ge(),c=je(),[d,l]=o.useState(""),[j,h]=o.useState(null),[n,u]=o.useState({copyFiles:[],setupScript:"",quickCommands:[]}),[x,p]=o.useState(!1),[v,b]=o.useState(null),[E,R]=o.useState(!1),[q,w]=o.useState(!1),[S,D]=o.useState(!1),[M,F]=o.useState(!1),[s,i]=o.useState(""),[A,$]=o.useState(!1),C=y?.data??[],g=o.useMemo(()=>C.filter(r=>!r.archivedAt),[C]),I=o.useMemo(()=>C.filter(r=>r.archivedAt),[C]),f=g.find(r=>r.id===d),T=o.useMemo(()=>C.find(r=>r.id===v)??null,[v,C]);if(o.useEffect(()=>{!d&&g.length>0&&l(g[0].id)},[g,d]),o.useEffect(()=>{if(j){g.some(r=>r.id===j)&&(l(j),h(null));return}d&&!g.some(r=>r.id===d)&&(l(g[0]?.id??""),p(!1))},[g,j,d]),o.useEffect(()=>{f&&!x&&u({copyFiles:Z(f.copyFiles),setupScript:f.setupScript??"",quickCommands:ee(f.quickCommands)})},[f,x]),N)return e.jsx(K,{className:"max-w-5xl",children:e.jsx(ue,{})});if(C.length===0)return e.jsxs(K,{className:"max-w-5xl",children:[e.jsx(Q,{title:t("项目配置")}),e.jsx(H,{message:t("暂无项目,请先创建项目")})]});const ne=()=>{d&&k.mutate({id:d,copyFiles:n.copyFiles.length>0?n.copyFiles.join(", "):null,setupScript:n.setupScript.trim()||null,quickCommands:n.quickCommands.length>0?JSON.stringify(n.quickCommands):null},{onSuccess:()=>p(!1)})},oe=r=>{h(null),l(r),p(!1),$(!0)},ae=()=>{f&&(b(f.id),D(!1),F(!1),R(!0))},O=()=>{a.isPending||(R(!1),b(null),D(!1),F(!1))},ie=async()=>{if(v)try{await a.mutateAsync({id:v,deleteRepo:S}),_.success(t(S?"项目已删除,并清理了本地文件":"项目已删除")),p(!1),O()}catch{}},le=r=>{const m=I.find(P=>P.id===r);b(r),i(m?.repoDeletedAt?m.repoPath:""),w(!0)},L=()=>{c.isPending||(w(!1),b(null),i(""))},ce=async()=>{if(!(!v||T?.repoDeletedAt&&!s.trim()))try{const m=await c.mutateAsync({id:v,repoPath:s.trim()||void 0});_.success(t("项目已恢复"));for(const P of m.warnings)_.warning(P);p(!1),h(m.project.id),l(m.project.id),L()}catch{}},J=T?.name??t("this project"),G=!!T?.repoDeletedAt,B=f?.isGitRepo!==!1&&f?.worktreeReady!==!1;return e.jsxs(e.Fragment,{children:[e.jsxs(K,{className:"max-w-5xl",children:[e.jsx(Q,{title:t("项目配置")}),g.length===0&&I.length===0?e.jsx(H,{message:t("暂无项目,请先创建项目")}):e.jsx(Ne,{items:g,selectedId:d,onSelectItem:oe,getItemId:r=>r.id,mobileShowDetail:A,onMobileBack:()=>$(!1),renderListItem:(r,m)=>e.jsxs(e.Fragment,{children:[e.jsx("span",{className:W("h-2 w-2 rounded-full shrink-0",m?"bg-primary-foreground/60":te(r))}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-[13px] font-medium",children:r.name}),e.jsx("div",{className:W("truncate text-[11px] font-mono",m?"text-primary-foreground/70":"text-muted-foreground"),children:r.repoPath.split("/").pop()})]})]}),renderListFooter:I.length>0?()=>e.jsxs("div",{className:"pt-3 mt-2 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 mb-1",children:[e.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:t("已删除")}),e.jsx("span",{className:"rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:I.length})]}),I.map(r=>e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg px-3 py-2 text-muted-foreground",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("div",{className:"truncate text-[12px]",children:r.name})}),e.jsx("button",{onClick:()=>le(r.id),disabled:c.isPending,className:"shrink-0 text-[11px] hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60","aria-label":t("恢复项目"),children:e.jsx(pe,{size:12})})]},r.id))]}):void 0,renderDetail:r=>r?e.jsxs("div",{className:"p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:W("h-2.5 w-2.5 rounded-full shrink-0",te(r))}),e.jsx("h3",{className:"text-base font-semibold text-foreground",children:r.name}),r.isGitRepo===!1&&e.jsx("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:t("Local project")})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground font-mono mb-5",children:r.repoPath}),r.isGitRepo===!1&&e.jsx("div",{className:"mb-5 rounded-lg border border-info/25 bg-info/8 px-3 py-2 text-xs leading-relaxed text-info/90",children:t("Local projects only support local Solo tasks. Initialize Git to use worktrees and TeamRun.")}),e.jsxs("div",{className:"divide-y divide-border/60",children:[e.jsxs("div",{className:"py-5 first:pt-0",children:[e.jsxs("div",{className:"mb-3",children:[e.jsx("h3",{className:"text-[13px] font-medium text-foreground",children:t("自动复制文件")}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:t("创建 worktree 时自动从主仓库复制的文件或目录,适用于 .env、node_modules 等不在 git 管理中的文件。支持 glob。")})]}),e.jsx(Pe,{value:n.copyFiles,onChange:m=>{u(P=>({...P,copyFiles:m})),p(!0)},repoPath:r.repoPath,disabled:!B,disabledMessage:t("This setting applies only to Git worktree projects.")})]}),e.jsxs("div",{className:"py-5",children:[e.jsxs("div",{className:"mb-3",children:[e.jsx("h3",{className:"text-[13px] font-medium text-foreground",children:t("Setup 脚本")}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:t("创建 worktree 后自动执行的命令,每行一条。在 worktree 目录下执行,单条超时 5 分钟。")})]}),e.jsx("textarea",{value:n.setupScript,onChange:m=>{u(P=>({...P,setupScript:m.target.value})),p(!0)},placeholder:`pnpm install
|
|
2
|
-
pnpm run setup`,rows:4,disabled:!B,className:"w-full rounded-lg border border-input bg-muted/50 px-3 py-2 text-sm font-mono transition-colors focus:border-ring focus:bg-background focus:outline-none resize-none disabled:cursor-not-allowed disabled:opacity-50"}),!B&&e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:t("This setting applies only to Git worktree projects.")})]}),e.jsxs("div",{className:"py-5",children:[e.jsxs("div",{className:"mb-3",children:[e.jsx("h3",{className:"text-[13px] font-medium text-foreground",children:t("常用命令")}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:t("在终端中可快速执行的命令,不会自动运行。")})]}),e.jsx(ke,{value:n.quickCommands,onChange:m=>{u(P=>({...P,quickCommands:m})),p(!0)}})]})]}),e.jsx("div",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/10 p-4",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(me,{size:15,className:"text-destructive mt-0.5 shrink-0","aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[13px] font-medium text-foreground",children:t("删除项目")}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:t("项目将从默认列表隐藏,历史记录保留。可选同时删除本地文件。")})]})]}),e.jsxs(z,{size:"sm",variant:"destructive",className:"shrink-0",onClick:ae,disabled:a.isPending||c.isPending,children:[e.jsx(ye,{size:13}),t("删除项目")]})]})}),x&&e.jsx(xe,{saving:k.isPending,onSave:ne,onCancel:()=>{f&&u({copyFiles:Z(f.copyFiles),setupScript:f.setupScript??"",quickCommands:ee(f.quickCommands)}),p(!1)},className:"-mx-5"})]}):e.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:g.length>0?t("选择一个项目查看配置"):t("当前没有可配置的项目")})})]}),e.jsx(Y,{isOpen:E,onClose:O,title:t("Delete Project"),action:e.jsxs(e.Fragment,{children:[e.jsx(z,{variant:"outline",onClick:O,disabled:a.isPending,children:t("Cancel")}),e.jsx(z,{variant:"destructive",onClick:ie,disabled:a.isPending||S&&!M,children:a.isPending?t("Deleting..."):t("Delete Project")})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:t("项目「{title}」将从默认项目列表隐藏,但历史任务、workspace 和会话记录仍会保留。",{title:J})}),e.jsxs("label",{className:"flex items-start gap-3 rounded-lg border border-border bg-muted px-3 py-3",children:[e.jsx("input",{type:"checkbox",checked:S,onChange:r=>{D(r.target.checked),r.target.checked||F(!1)},className:"mt-0.5 h-4 w-4 rounded border-border accent-primary"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:t("同时删除本地项目文件")}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t("勾选后会删除项目路径指向的本地目录,并禁用代码/Git 相关能力。")})]})]}),S&&e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-3",children:[e.jsx("p",{className:"text-sm font-medium text-destructive",children:t("勾选后会连项目文件一起删除,请谨慎选择。")}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t("恢复该项目时需要重新绑定一个有效的项目路径。")}),e.jsxs("label",{className:"mt-3 flex items-start gap-2 text-xs text-foreground",children:[e.jsx("input",{type:"checkbox",checked:M,onChange:r=>F(r.target.checked),className:"mt-0.5 h-4 w-4 rounded border-border accent-primary"}),e.jsx("span",{children:t("我已确认这会删除本地项目文件")})]})]}),a.isError&&e.jsx("p",{className:"text-xs text-destructive",children:a.error instanceof Error?a.error.message:t("Failed to delete project")})]})}),e.jsx(Y,{isOpen:q,onClose:L,title:t("Restore Project"),action:e.jsxs(e.Fragment,{children:[e.jsx(z,{variant:"outline",onClick:L,disabled:c.isPending,children:t("Cancel")}),e.jsx(z,{onClick:ce,disabled:c.isPending||G&&!s.trim(),children:c.isPending?t("Restoring..."):t("Restore Project")})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:G?t("项目「{title}」的本地项目文件已删除。恢复前需要重新绑定一个有效的项目路径。",{title:J}):t("恢复后,项目会重新出现在默认项目列表中。")}),G&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-1.5",children:t("Project Path")}),e.jsx(be,{value:s,onChange:i,validationMode:"directory"}),e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:t("Agent Tower 会尽量校验项目 identity;如果 remote URL 或目录名不同,会给出警告但允许继续。")})]}),c.isError&&e.jsx("p",{className:"text-xs text-destructive",children:c.error instanceof Error?c.error.message:t("Failed to restore project")})]})})]})}export{qe as ProjectSettingsPage};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import{k as Ye,m as bt,q as yt,p as jt,u as Y,r as E,j as n,l as M,a4 as Ze,T as Te,I as le,B as O,a3 as wt,S as Me,_ as Nt,g as Et,ac as Pt,s as Ct,C as St,t as L,a0 as kt,i as Pe,ad as At,a9 as Ce}from"./index-D9kBRMR0.js";import{a as _t,b as Tt,u as Ot,c as It,d as Dt,e as Rt,f as Ut,g as Kt,h as Lt}from"./use-providers-DLcAY6E1.js";import{C as Bt}from"./confirm-dialog-CRiC3xBd.js";import{M as Oe}from"./modal-Cymk-6Df.js";import{S as ze}from"./select-BpKQyMvD.js";import{T as $e}from"./textarea-DjwjAAG8.js";import{S as He}from"./switch-BJ4Ar_OA.js";import{i as Ie,R as B,h as A,P as be,U as Mt,j as zt,k as $t}from"./mermaid-NOHMQCX5-DWQaYVL0.js";import{A as pe}from"./AgentLogo-BCwbooTN.js";import{C as Qe}from"./chevron-down-BQcW9sFf.js";import{S as Ft}from"./SettingsMasterDetail-DTGIIGdI.js";import{T as et,P as Se}from"./trash-2-R46i6Uus.js";import{U as Jt}from"./upload-CgWqsmdI.js";import{P as Wt}from"./pencil-DOL2nlgg.js";import"./check-BN_PVKzE.js";import"./chevron-right-pH923eYp.js";import"./arrow-left-CCWDjOmp.js";const Vt=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],qt=Ye("flask-conical",Vt);const Gt=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Xt=Ye("key-round",Gt);function Yt(e,t){let r=e.slice(0,t).split(/\r\n|\n|\r/g);return[r.length,r.pop().length+1]}function Zt(e,t,r){let s=e.split(/\r\n|\n|\r/g),o="",a=(Math.log10(t+1)|0)+1;for(let i=t-1;i<=t+1;i++){let c=s[i-1];c&&(o+=i.toString().padEnd(a," "),o+=": ",o+=c,o+=`
|
|
2
|
-
`,i===t&&(o+=" ".repeat(a+r+2),o+=`^
|
|
3
|
-
`))}return o}class w extends Error{line;column;codeblock;constructor(t,r){const[s,o]=Yt(r.toml,r.ptr),a=Zt(r.toml,s,o);super(`Invalid TOML document: ${t}
|
|
4
|
-
|
|
5
|
-
${a}`,r),this.line=s,this.column=o,this.codeblock=a}}function Ht(e,t){let r=0;for(;e[t-++r]==="\\";);return--r&&r%2}function ke(e,t=0,r=e.length){let s=e.indexOf(`
|
|
6
|
-
`,t);return e[s-1]==="\r"&&s--,s<=r?s:-1}function je(e,t){for(let r=t;r<e.length;r++){let s=e[r];if(s===`
|
|
7
|
-
`)return r;if(s==="\r"&&e[r+1]===`
|
|
8
|
-
`)return r+1;if(s<" "&&s!==" "||s==="")throw new w("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function V(e,t,r,s){let o;for(;(o=e[t])===" "||o===" "||!r&&(o===`
|
|
9
|
-
`||o==="\r"&&e[t+1]===`
|
|
10
|
-
`);)t++;return s||o!=="#"?t:V(e,je(e,t),r)}function Qt(e,t,r,s,o=!1){if(!s)return t=ke(e,t),t<0?e.length:t;for(let a=t;a<e.length;a++){let i=e[a];if(i==="#")a=ke(e,a);else{if(i===r)return a+1;if(i===s||o&&(i===`
|
|
11
|
-
`||i==="\r"&&e[a+1]===`
|
|
12
|
-
`))return a}}throw new w("cannot find end of structure",{toml:e,ptr:t})}function tt(e,t){let r=e[t],s=r===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):r;t+=s.length-1;do t=e.indexOf(s,++t);while(t>-1&&r!=="'"&&Ht(e,t));return t>-1&&(t+=s.length,s.length>1&&(e[t]===r&&t++,e[t]===r&&t++)),t}let en=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class ce extends Date{#t=!1;#n=!1;#e=null;constructor(t){let r=!0,s=!0,o="Z";if(typeof t=="string"){let a=t.match(en);a?(a[1]||(r=!1,t=`0000-01-01T${t}`),s=!!a[2],s&&t[10]===" "&&(t=t.replace(" ","T")),a[2]&&+a[2]>23?t="":(o=a[3]||null,t=t.toUpperCase(),!o&&s&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=r,this.#n=s,this.#e=o)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let r=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return r=this.#e[0]==="-"?r:-r,new Date(this.getTime()-r*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,r="Z"){let s=new ce(t);return s.#e=r,s}static wrapAsLocalDateTime(t){let r=new ce(t);return r.#e=null,r}static wrapAsLocalDate(t){let r=new ce(t);return r.#n=!1,r.#e=null,r}static wrapAsLocalTime(t){let r=new ce(t);return r.#t=!1,r.#e=null,r}}let tn=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,nn=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,rn=/^[+-]?0[0-9_]/,sn=/^[0-9a-f]{2,8}$/i,Fe={b:"\b",t:" ",n:`
|
|
13
|
-
`,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function nt(e,t=0,r=e.length){let s=e[t]==="'",o=e[t++]===e[t]&&e[t]===e[t+1];o&&(r-=2,e[t+=2]==="\r"&&t++,e[t]===`
|
|
14
|
-
`&&t++);let a=0,i,c="",d=t;for(;t<r-1;){let l=e[t++];if(l===`
|
|
15
|
-
`||l==="\r"&&e[t]===`
|
|
16
|
-
`){if(!o)throw new w("newlines are not allowed in strings",{toml:e,ptr:t-1})}else if(l<" "&&l!==" "||l==="")throw new w("control characters are not allowed in strings",{toml:e,ptr:t-1});if(i){if(i=!1,l==="x"||l==="u"||l==="U"){let m=e.slice(t,t+=l==="x"?2:l==="u"?4:8);if(!sn.test(m))throw new w("invalid unicode escape",{toml:e,ptr:a});try{c+=String.fromCodePoint(parseInt(m,16))}catch{throw new w("invalid unicode escape",{toml:e,ptr:a})}}else if(o&&(l===`
|
|
17
|
-
`||l===" "||l===" "||l==="\r")){if(t=V(e,t-1,!0),e[t]!==`
|
|
18
|
-
`&&e[t]!=="\r")throw new w("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});t=V(e,t)}else if(l in Fe)c+=Fe[l];else throw new w("unrecognized escape sequence",{toml:e,ptr:a});d=t}else!s&&l==="\\"&&(a=t-1,i=!0,c+=e.slice(d,a))}return c+e.slice(d,r-1)}function on(e,t,r,s){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return s?0n:0;let o=tn.test(e);if(o||nn.test(e)){if(rn.test(e))throw new w("leading zeroes are not allowed",{toml:t,ptr:r});e=e.replace(/_/g,"");let i=+e;if(isNaN(i))throw new w("invalid number",{toml:t,ptr:r});if(o){if((o=!Number.isSafeInteger(i))&&!s)throw new w("integer value cannot be represented losslessly",{toml:t,ptr:r});(o||s===!0)&&(i=BigInt(e))}return i}const a=new ce(e);if(!a.isValid())throw new w("invalid value",{toml:t,ptr:r});return a}function an(e,t,r){let s=e.slice(t,r),o=s.indexOf("#");return o>-1&&(je(e,o),s=s.slice(0,o)),[s.trimEnd(),o]}function De(e,t,r,s,o){if(s===0)throw new w("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let a=e[t];if(a==="["||a==="{"){let[d,l]=a==="["?dn(e,t,s,o):cn(e,t,s,o);if(r){if(l=V(e,l),e[l]===",")l++;else if(e[l]!==r)throw new w("expected comma or end of structure",{toml:e,ptr:l})}return[d,l]}let i;if(a==='"'||a==="'"){i=tt(e,t);let d=nt(e,t,i);if(r){if(i=V(e,i),e[i]&&e[i]!==","&&e[i]!==r&&e[i]!==`
|
|
19
|
-
`&&e[i]!=="\r")throw new w("unexpected character encountered",{toml:e,ptr:i});i+=+(e[i]===",")}return[d,i]}i=Qt(e,t,",",r);let c=an(e,t,i-+(e[i-1]===","));if(!c[0])throw new w("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return r&&c[1]>-1&&(i=V(e,t+c[1]),i+=+(e[i]===",")),[on(c[0],e,t,o),i]}let ln=/^[a-zA-Z0-9-_]+[ \t]*$/;function Ae(e,t,r="="){let s=t-1,o=[],a=e.indexOf(r,t);if(a<0)throw new w("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let i=e[t=++s];if(i!==" "&&i!==" ")if(i==='"'||i==="'"){if(i===e[t+1]&&i===e[t+2])throw new w("multiline strings are not allowed in keys",{toml:e,ptr:t});let c=tt(e,t);if(c<0)throw new w("unfinished string encountered",{toml:e,ptr:t});s=e.indexOf(".",c);let d=e.slice(c,s<0||s>a?a:s),l=ke(d);if(l>-1)throw new w("newlines are not allowed in keys",{toml:e,ptr:t+s+l});if(d.trimStart())throw new w("found extra tokens after the string part",{toml:e,ptr:c});if(a<c&&(a=e.indexOf(r,c),a<0))throw new w("incomplete key-value: cannot find end of key",{toml:e,ptr:t});o.push(nt(e,t,c))}else{s=e.indexOf(".",t);let c=e.slice(t,s<0||s>a?a:s);if(!ln.test(c))throw new w("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});o.push(c.trimEnd())}}while(s+1&&s<a);return[o,V(e,a+1,!0,!0)]}function cn(e,t,r,s){let o={},a=new Set,i;for(t++;(i=e[t++])!=="}"&&i;){if(i===",")throw new w("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=je(e,t);else if(i!==" "&&i!==" "&&i!==`
|
|
20
|
-
`&&i!=="\r"){let c,d=o,l=!1,[m,f]=Ae(e,t-1);for(let P=0;P<m.length;P++){if(P&&(d=l?d[c]:d[c]={}),c=m[P],(l=Object.hasOwn(d,c))&&(typeof d[c]!="object"||a.has(d[c])))throw new w("trying to redefine an already defined value",{toml:e,ptr:t});!l&&c==="__proto__"&&Object.defineProperty(d,c,{enumerable:!0,configurable:!0,writable:!0})}if(l)throw new w("trying to redefine an already defined value",{toml:e,ptr:t});let[v,y]=De(e,f,"}",r-1,s);a.add(v),d[c]=v,t=y}}if(!i)throw new w("unfinished table encountered",{toml:e,ptr:t});return[o,t]}function dn(e,t,r,s){let o=[],a;for(t++;(a=e[t++])!=="]"&&a;){if(a===",")throw new w("expected value, found comma",{toml:e,ptr:t-1});if(a==="#")t=je(e,t);else if(a!==" "&&a!==" "&&a!==`
|
|
21
|
-
`&&a!=="\r"){let i=De(e,t-1,"]",r-1,s);o.push(i[0]),t=i[1]}}if(!a)throw new w("unfinished array encountered",{toml:e,ptr:t});return[o,t]}function Je(e,t,r,s){let o=t,a=r,i,c=!1,d;for(let l=0;l<e.length;l++){if(l){if(o=c?o[i]:o[i]={},a=(d=a[i]).c,s===0&&(d.t===1||d.t===2))return null;if(d.t===2){let m=o.length-1;o=o[m],a=a[m].c}}if(i=e[l],(c=Object.hasOwn(o,i))&&a[i]?.t===0&&a[i]?.d)return null;c||(i==="__proto__"&&(Object.defineProperty(o,i,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,i,{enumerable:!0,configurable:!0,writable:!0})),a[i]={t:l<e.length-1&&s===2?3:s,d:!1,i:0,c:{}})}if(d=a[i],d.t!==s&&!(s===1&&d.t===3)||(s===2&&(d.d||(d.d=!0,o[i]=[]),o[i].push(o={}),d.c[d.i++]=d={t:1,d:!1,i:0,c:{}}),d.d))return null;if(d.d=!0,s===1)o=c?o[i]:o[i]={};else if(s===0&&c)return null;return[i,o,d.c]}function de(e,{maxDepth:t=1e3,integersAsBigInt:r}={}){let s={},o={},a=s,i=o;for(let c=V(e,0);c<e.length;){if(e[c]==="["){let d=e[++c]==="[",l=Ae(e,c+=+d,"]");if(d){if(e[l[1]-1]!=="]")throw new w("expected end of table declaration",{toml:e,ptr:l[1]-1});l[1]++}let m=Je(l[0],s,o,d?2:1);if(!m)throw new w("trying to redefine an already defined table or value",{toml:e,ptr:c});i=m[2],a=m[1],c=l[1]}else{let d=Ae(e,c),l=Je(d[0],a,i,0);if(!l)throw new w("trying to redefine an already defined table or value",{toml:e,ptr:c});let m=De(e,d[1],void 0,t,r);l[1][l[0]]=m[0],c=m[1]}if(c=V(e,c,!0),e[c]&&e[c]!==`
|
|
22
|
-
`&&e[c]!=="\r")throw new w("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:c});c=V(e,c)}return s}function un(){return bt({queryKey:yt.system.cursorAgentModels,queryFn:()=>jt.get("/system/cursor-agent-models"),staleTime:1e3*60*10})}function mn({value:e,onChange:t}){const{t:r}=Y(),{data:s,isLoading:o,isError:a}=un(),i=s?.models??[],[c,d]=E.useState(!1),[l,m]=E.useState(""),f=E.useMemo(()=>{const v=l.trim().toLowerCase();return v?i.filter(y=>y.id.toLowerCase().includes(v)||y.label.toLowerCase().includes(v)):i},[i,l]);return n.jsxs("div",{className:"flex flex-col gap-2 flex-1 min-w-0",children:[n.jsx("input",{type:"text",value:e,onChange:v=>{const y=v.target.value;t(y===""?void 0:y)},placeholder:r("留空为 auto;或直接输入模型 ID(与 cursor-agent --model 一致)"),className:"w-full px-3 py-1.5 text-sm border border-neutral-200 rounded focus:outline-none focus:ring-1 focus:ring-neutral-900 font-mono"}),n.jsxs("button",{type:"button",onClick:()=>d(v=>!v),disabled:o,className:"flex items-center gap-1 text-xs text-neutral-600 hover:text-neutral-900 disabled:opacity-50 w-fit",children:[n.jsx(Qe,{size:14,className:M("transition-transform",c&&"rotate-180")}),o?r("正在加载 cursor-agent 模型列表…"):c?r("收起列表"):r("从本机 cursor-agent 选择({count} 个)",{count:i.length})]}),c&&!o&&n.jsxs("div",{className:"rounded-lg border border-neutral-200 bg-white shadow-sm overflow-hidden",children:[n.jsx("input",{type:"text",value:l,onChange:v=>m(v.target.value),placeholder:r("筛选模型…"),className:"w-full px-3 py-2 text-sm border-b border-neutral-100 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-neutral-300"}),n.jsxs("div",{className:"max-h-[min(50vh,22rem)] overflow-y-auto py-1",children:[n.jsx("button",{type:"button",onClick:()=>{t(void 0),d(!1),m("")},className:M("w-full px-3 py-2 text-left text-sm hover:bg-neutral-50",e?"text-neutral-700":"bg-neutral-50 font-medium"),children:r("默认 (auto)")}),f.map(v=>n.jsxs("button",{type:"button",onClick:()=>{t(v.id),d(!1),m("")},className:M("w-full px-3 py-2 text-left text-sm hover:bg-neutral-50 border-t border-neutral-100",e===v.id?"bg-blue-50/80":""),children:[n.jsx("div",{className:"font-mono text-xs text-neutral-900 break-all",children:v.id}),n.jsx("div",{className:"text-xs text-neutral-500 mt-0.5 break-words",children:v.label})]},v.id)),f.length===0&&n.jsx("div",{className:"px-3 py-4 text-xs text-neutral-400 text-center",children:r("无匹配项")})]})]}),(a||s?.error)&&n.jsxs("p",{className:"text-xs text-amber-700",children:[r("无法从本机加载模型列表({error})。仍可手动输入;或在安装 cursor-agent 的机器上运行",{error:s?.error??r("请求失败")}),n.jsx("code",{className:"mx-0.5 bg-neutral-100 px-1 rounded text-[11px]",children:"cursor-agent --list-models"}),r("查看 ID。")]})]})}function fn(e){if(!e)return null;try{const t=new URL(e);return t.protocol!=="http:"&&t.protocol!=="https:"?null:`${t.origin}${t.pathname}`}catch{return null}}function pn(e,t){if(!e)return null;const r=new Date(e);return Number.isNaN(r.getTime())?null:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(r)}function xn({result:e}){const{locale:t,t:r}=Y(),s=fn(e.target?.endpoint),o=pn(e.testedAt,t);return n.jsx("div",{"data-provider-test-result":!0,className:M("rounded-lg border px-4 py-3 text-sm",e.ok?"border-success/30 bg-success/10 text-success":"border-warning/30 bg-warning/10 text-foreground"),children:n.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.ok?n.jsx(Ze,{size:16,className:"shrink-0"}):n.jsx(Te,{size:16,className:"shrink-0 text-warning"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"font-medium",children:e.ok?e.stage==="connection"?r("连接测试通过"):r("本机可用性检查通过"):r("配置检查未通过")}),n.jsx("div",{className:"mt-0.5 break-words text-xs opacity-80",children:e.summary}),(s||o)&&n.jsxs("dl",{className:"mt-2 grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1 text-xs opacity-80",children:[s&&n.jsxs(n.Fragment,{children:[n.jsx("dt",{className:"font-medium",children:r("测试对象")}),n.jsx("dd",{className:"min-w-0",children:n.jsx("code",{className:"break-all",children:s})})]}),o&&n.jsxs(n.Fragment,{children:[n.jsx("dt",{className:"font-medium",children:r("测试时间")}),n.jsx("dd",{className:"min-w-0 break-words",children:n.jsx("time",{dateTime:e.testedAt,children:o})})]})]}),!e.ok&&n.jsx("div",{className:"mt-1 text-xs opacity-80",children:r("测试失败不会阻止保存。")})]})]})})}function gn({options:e,value:t,onChange:r,label:s,efficiencyLabel:o,intelligenceLabel:a,followCliLabel:i,currentLabel:c,disabled:d=!1,error:l}){const m=e.findIndex(b=>b.value===t),f=t==="",v=E.useRef(m>=0?t:void 0),y=E.useRef(null),P=E.useRef(null),[_,I]=E.useState(!1);E.useEffect(()=>{m>=0&&(v.current=t)},[m,t]);const D=b=>{if(d||f||e.length===0)return;const k=e[Math.max(0,Math.min(e.length-1,b))];k&&k.value!==t&&r(k.value)},q=b=>{const k=P.current?.getBoundingClientRect();if(!k||k.width<=0)return;const ne=Math.max(0,Math.min(1,(b-k.left)/k.width));D(Math.round(ne*(e.length-1)))},K=m>=0?e[m]:void 0,z=m<0||e.length<2?0:m/(e.length-1)*100,$=E.useId(),G=`${$}-label`,F=`${$}-current`,R=`${$}-error`;return n.jsxs("div",{className:"space-y-2.5",children:[n.jsxs("div",{className:"flex min-h-8 items-center justify-between gap-3",children:[n.jsx("label",{id:G,className:"text-xs font-medium text-foreground",children:s}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:i}),n.jsx(He,{checked:f,disabled:d,onCheckedChange:b=>{r(b?"":v.current??e.find(k=>k.value==="medium")?.value??e[0]?.value??"")},"aria-label":i})]})]}),n.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground","aria-hidden":"true",children:[n.jsx("span",{children:o}),n.jsx("span",{children:a})]}),n.jsxs("div",{id:$,ref:P,role:"slider",tabIndex:f||d?-1:0,"aria-labelledby":G,"aria-disabled":f||d,"aria-valuemin":0,"aria-valuemax":Math.max(0,e.length-1),"aria-valuenow":m>=0?m:void 0,"aria-valuetext":K?`${K.label}, ${K.value}`:i,"aria-describedby":l?`${F} ${R}`:F,onKeyDown:b=>{if(f||d||m<0)return;let k=m;if(b.key==="ArrowLeft"||b.key==="ArrowDown")k-=1;else if(b.key==="ArrowRight"||b.key==="ArrowUp")k+=1;else if(b.key==="Home")k=0;else if(b.key==="End")k=e.length-1;else return;b.preventDefault(),D(k)},onPointerDown:b=>{f||d||(y.current=b.pointerId,I(!0),b.currentTarget.setPointerCapture?.(b.pointerId),q(b.clientX))},onPointerMove:b=>{y.current===b.pointerId&&q(b.clientX)},onPointerUp:b=>{y.current===b.pointerId&&(y.current=null,I(!1),b.currentTarget.releasePointerCapture?.(b.pointerId))},onPointerCancel:()=>{y.current=null,I(!1)},className:M("relative mx-2.5 flex h-11 touch-pan-y items-center outline-none select-none",f||d?"cursor-not-allowed opacity-55":"cursor-pointer","focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-2"),children:[n.jsx("div",{className:"absolute inset-x-0 h-1 rounded-full bg-border"}),!f&&n.jsx("div",{className:"absolute left-0 h-1 rounded-full bg-primary transition-[width] duration-150 motion-reduce:transition-none",style:{width:`${z}%`}}),e.map((b,k)=>n.jsx("span",{"aria-hidden":"true",className:M("absolute size-3 -translate-x-1/2 rounded-full border-2 transition-colors motion-reduce:transition-none",!f&&k<=m?"border-primary bg-primary":"border-border bg-background"),style:{left:`${e.length<2?0:k/(e.length-1)*100}%`}},b.value)),!f&&K&&n.jsx("span",{"aria-hidden":"true",className:M("absolute size-5 -translate-x-1/2 rounded-full border-[5px] border-primary bg-background shadow-sm transition-[left,transform] duration-150 motion-reduce:transition-none",_&&"scale-110"),style:{left:`${z}%`}})]}),n.jsx("div",{id:F,className:"min-h-5 text-center text-xs text-muted-foreground",children:f?i:`${c}: ${K?.label??t} (${K?.value??t})`}),l&&n.jsx("p",{id:R,role:"alert",className:"text-xs text-destructive",children:l})]})}function hn(e){if(!e)return null;const t=e.trim();if(!t.startsWith("http://")&&!t.startsWith("https://"))return"API URL must be a complete http:// or https:// URL";try{if(new URL(t).host)return null}catch{}return"API URL must be a complete http:// or https:// URL"}function vn(e,t,r){return r==="advanced"?"advanced":e?.write.action==="clear"?"unconfigured":e?.write.action==="replace"?e.value?"configured":"unconfigured":e?.configured||t?"configured":"unconfigured"}function bn(e,t,r,s){let o=e.config,a=e.settings;const i=c=>{o={...o},r?o[c]=r:delete o[c]};return t==="apiBaseUrl"&&s.apiBaseUrl?s.apiBaseUrl.kind==="config"?i(s.apiBaseUrl.path):s.apiBaseUrl.kind==="settings"&&(a=e.agentType==="CODEX"?Nn(a,r):fe(a,s.apiBaseUrl.path,r||void 0)):t==="model"?(s.model.kind==="config"?i(s.model.path):s.model.kind==="settings"&&(a=fe(a,s.model.path,r||void 0)),e.agentType==="CODEX"&&(a=fe(a,"model",void 0))):t==="reasoningEffort"&&s.reasoningEffort&&(s.reasoningEffort.kind==="config"?i(s.reasoningEffort.path):s.reasoningEffort.kind==="settings"&&(a=fe(a,s.reasoningEffort.path,r||void 0))),{...e,config:o,settings:a,simplified:{...e.simplified,[t]:r}}}function ve(e){let t="",r=!1;for(let s=0;s<e.length;s+=1){const o=e[s];if(r){r=!1;continue}if(t==='"'&&o==="\\"){r=!0;continue}if((o==='"'||o==="'")&&!t)t=o;else if(o===t)t="";else if(o==="#"&&!t)return{value:e.slice(0,s).trimEnd(),comment:e.slice(s)}}return{value:e.trimEnd(),comment:""}}function We(e){const t=[];let r=0,s="",o=!1;for(let a=0;a<=e.length;a+=1){const i=e[a]??".";if(o){o=!1;continue}if(s==='"'&&i==="\\"){o=!0;continue}if((i==='"'||i==="'")&&!s)s=i;else if(i===s)s="";else if(i==="."&&!s){const c=e.slice(r,a).trim();if(c.startsWith('"')&&c.endsWith('"'))try{t.push(JSON.parse(c))}catch{t.push(c.slice(1,-1))}else c.startsWith("'")&&c.endsWith("'")?t.push(c.slice(1,-1)):c&&t.push(c);r=a+1}}return t}function yn(e){let t="",r=!1;for(let s=0;s<e.length;s+=1){const o=e[s];if(r){r=!1;continue}if(t==='"'&&o==="\\"){r=!0;continue}if((o==='"'||o==="'")&&!t)t=o;else if(o===t)t="";else{if(o==="="&&!t)return s;if(o==="#"&&!t)return-1}}return-1}function Ve(e,t){return e.length===t.length&&e.every((r,s)=>r===t[s])}function jn(e,t){let r=t,s,o;for(let a=0;a<e.length;a+=1){const i=e[a];if(r){if(r==='"""'&&i==="\\"){a+=1;continue}const d=r[0];if(i===d){let l=a+1;for(;e[l]===d;)l+=1;if(l-a<r.length)continue;o??=l,r=void 0,a=l-1}continue}if(s){s==='"'&&i==="\\"?a+=1:i===s&&(s=void 0);continue}if(i==="#")break;const c=e.startsWith('"""',a)?'"""':e.startsWith("'''",a)?"'''":void 0;c?(r=c,a+=2):(i==='"'||i==="'")&&(s=i)}return{multiline:r,closingDelimiterEnd:o}}function wn(e){const t=[],r=new Map;let s,o;for(let a=0;a<e.length;a+=1){t[a]=s===void 0;const{multiline:i,closingDelimiterEnd:c}=jn(e[a],s);s===void 0&&i!==void 0&&(o=a),s!==void 0&&c!==void 0&&o!==void 0&&(r.set(o,{end:a,suffix:e[a].slice(c)}),o=void 0),s=i}return{structural:t,multilineSpanByStart:r}}function it(e,t,r){try{de(e)}catch{return e}const s=e.split(`
|
|
23
|
-
`),{structural:o,multilineSpanByStart:a}=wn(s);let i=[],c=t.length===1?-1:void 0;const d=[];for(let f=0;f<s.length;f+=1){if(!o[f])continue;const v=ve(s[f]).value.trim(),y=v.match(/^\[\[(.+)\]\]$/),P=y??v.match(/^\[(.+)\]$/);if(P){i=We(P[1]),!y&&Ve(i,t.slice(0,-1))&&(c=f);continue}const _=yn(s[f]);if(_<0)continue;const I=[...i,...We(s[f].slice(0,_))];if(Ve(I,t)){const D=a.get(f);d.push({index:f,equals:_,end:D?.end??f,closingSuffix:D?.suffix})}}if(d.length>1)return e;if(d.length===1){const f=d[0],v=s[f.index],y=v.slice(0,f.equals+1),P=v.slice(f.equals+1),_=P.match(/^\s*/)?.[0]??" ",{comment:I}=ve(P),D=f.end-f.index+1,q=f.closingSuffix??(I?` ${I}`:"");return r?s.splice(f.index,D,`${y}${_}${JSON.stringify(r)}${q}`):f.closingSuffix&&ve(f.closingSuffix).comment?s.splice(f.index,D,`${v.match(/^\s*/)?.[0]??""}${f.closingSuffix}`):I?s.splice(f.index,D,`${v.match(/^\s*/)?.[0]??""}${I}`):s.splice(f.index,D),s.join(`
|
|
24
|
-
`)}if(!r)return e;const l=`${t.at(-1)} = ${JSON.stringify(r)}`;if(t.length>1)return c===void 0?e:(s.splice(c+1,0,l),s.join(`
|
|
25
|
-
`));const m=s.findIndex((f,v)=>{if(!o[v])return!1;const y=ve(f).value.trim();return/^\[\[?.+\]\]?$/.test(y)});return m>=0?(s.splice(m,0,l),s.join(`
|
|
26
|
-
`)):e?e.endsWith(`
|
|
27
|
-
`)?`${e}${l}
|
|
28
|
-
`:`${e}
|
|
29
|
-
${l}`:l}function fe(e,t,r){return it(e,[t],r)}function Nn(e,t){let r;try{r=de(e)}catch{return e}const s=typeof r.model_provider=="string"&&r.model_provider.trim()?r.model_provider.trim():"openai",o=t.trim()||void 0;return s==="openai"?fe(e,"openai_base_url",o):Ie(s)?e:it(e,["model_providers",s,"base_url"],o)}function En(e,t){return rt(e,t.executionPermission)}function rt(e,t){const r=e[t.path];return r===void 0||r===!1?{enabled:!1,error:null}:r===!0?{enabled:!0,error:null}:{enabled:!1,error:`${t.path} must be true or false`}}function Pn(e,t,r){return{...e,config:{...e.config,[t.path]:r}}}function te(e,t){const r=t?.trim();return!!r&&e.trim()===r}function Cn(e,t){return te(e,t.apiKey?.envKey)}function ye(e,t){return e.sensitive||/key|token|secret|password|auth/i.test(e.key)||Cn(e.key,t)}function Sn(e,t){const r=e.simplified??{};return Object.entries(e.redactedEnv??{}).map(([s,o])=>({key:s,value:t.apiBaseUrl?.kind==="env"&&s===t.apiBaseUrl.path?r.apiBaseUrl??"":"",write:{action:"keep"},configured:o.configured,sensitive:ye({key:s,sensitive:o.sensitive},r)}))}function kn(e,t){return e.map(r=>ye(r,t)&&!r.sensitive?{...r,sensitive:!0}:r)}function An(){let e=0;return{begin:()=>(e+=1,e),invalidate:()=>{e+=1},isCurrent:t=>t===e}}function _n(e){const t=new Map;for(const o of e){const a=o.key.trim();if(!a)continue;const i=t.get(a)??[];i.push(o),t.set(a,i)}const r=(o,a)=>o<a?-1:o>a?1:0,s=(o,a)=>{const i=a.filter(m=>m.write.action!=="keep");if(i.length===0)return{action:"keep"};const c=i.filter(m=>m.key===o),d=c.length>0?c:i,l=d.find(m=>m.write.action==="clear");return l?l.write:[...d].sort((m,f)=>r(m.key,f.key)||r(m.write.action==="replace"?m.write.value:"",f.write.action==="replace"?f.write.value:""))[0].write};return Object.fromEntries([...t.entries()].sort(([o],[a])=>r(o,a)).map(([o,a])=>[o,s(o,a)]))}function Tn(e,t,r){return{...e,model:typeof t[r.model.path]=="string"?t[r.model.path]:"",reasoningEffort:r.reasoningEffort?.kind==="config"?typeof t[r.reasoningEffort.path]=="string"?t[r.reasoningEffort.path]:"":e.reasoningEffort}}function qe(e,t,r,s=new Set){if(r!=="CODEX")return e;const o=de(t),a=typeof o.model_provider=="string"&&o.model_provider.trim()?o.model_provider.trim():"openai",i=typeof o.model_reasoning_effort=="string"?o.model_reasoning_effort:"",c=v=>[...s].some(y=>te(y,v));if(a==="openai")return{...e,apiBaseUrl:typeof o.openai_base_url=="string"?o.openai_base_url:"",apiKey:{configured:te(e.apiKey?.envKey??"","OPENAI_API_KEY")?e.apiKey?.configured??!1:c("OPENAI_API_KEY"),envKey:"OPENAI_API_KEY"},reasoningEffort:i};if(Ie(a))return{...e,apiBaseUrl:void 0,apiKey:void 0,reasoningEffort:i};const d=o.model_providers,l=d&&typeof d=="object"&&!Array.isArray(d)?d[a]:void 0,m=l&&typeof l=="object"&&!Array.isArray(l)?l:{},f=typeof m.env_key=="string"&&m.env_key.trim()?m.env_key.trim():void 0;return{...e,apiBaseUrl:typeof m.base_url=="string"?m.base_url:"",apiKey:f?{configured:te(e.apiKey?.envKey??"",f)?e.apiKey?.configured??!1:c(f),envKey:f}:void 0,reasoningEffort:i}}function On(e){try{const t=de(e);return typeof t.model_provider=="string"&&Ie(t.model_provider.trim())}catch{return!1}}function In(e,t,r){try{if(e.agentType==="CLAUDE_CODE"&&(t==="apiBaseUrl"||t==="apiKey")){const s=JSON.parse(e.settings),o=t==="apiBaseUrl"?r.apiBaseUrl?.path:r.apiKey?.path,a=o?s.env?.[o]:void 0;return typeof a=="string"?a:void 0}if(e.agentType==="CODEX"&&(t==="model"||t==="reasoningEffort")){const s=de(e.settings),o=t==="model"?"model":r.reasoningEffort?.path,a=o?s[o]:void 0;return typeof a=="string"?a:void 0}}catch{return}}function Dn(e,t,r,s){if(r==="simple")return e;const o=In(e,t,s),a={...e.config},i={...e.simplified};let c=e.env;return t==="apiBaseUrl"&&s.apiBaseUrl?(o!==void 0&&(i.apiBaseUrl=o),c=c.map(d=>d.key===s.apiBaseUrl.path?{...d,value:"",write:{action:"clear"}}:d)):t==="apiKey"&&s.apiKey?(i.apiKey={configured:o!==void 0,envKey:s.apiKey.path},c=c.map(d=>d.key===s.apiKey.path?{...d,value:"",write:{action:"clear"}}:d)):t==="model"?(o!==void 0&&(i.model=o),delete a[s.model.path]):t==="reasoningEffort"&&o!==void 0&&(i.reasoningEffort=o),{...e,config:a,env:c,simplified:i}}const W={key:"appendPrompt",label:"追加 Prompt",type:"textarea",rows:3,placeholder:"追加到每次 prompt 末尾的文本"},st={[A.CLAUDE_CODE]:[{key:"dangerouslySkipPermissions",label:"跳过权限确认",type:"switch"},W],[A.GEMINI_CLI]:[{key:"yolo",label:"自动批准操作(YOLO)",type:"switch"},W],[A.CURSOR_AGENT]:[{key:"force",label:"强制执行",type:"switch"},W],[A.CODEX]:[{key:"dangerouslyBypassApprovalsAndSandbox",label:"跳过所有确认和沙盒",type:"switch"},{key:"disableResponsesWebsocket",label:"禁用 WebSocket",type:"switch"},{key:"profile",label:"Profile",type:"input",placeholder:"~/.codex/config.toml 中的 profile 名称"},W],[A.QWEN_CODE]:[W],[A.KIRO_CLI]:[{key:"trustAllTools",label:"信任所有工具",type:"switch"},W],[A.OPENCODE]:[{key:"autoApprove",label:"自动批准操作",type:"switch"},W],[A.PI_CODING_AGENT]:[{key:"autoApprove",label:"自动批准操作",type:"switch"},W],[A.GROK_BUILD]:[{key:"alwaysApprove",label:"始终批准操作",type:"switch"},W],[A.MINION_CODE]:[{key:"dangerouslySkipPermissions",label:"跳过权限确认",type:"switch"},W]};function Ge(){return{}}function ot(e,t){return{...t}}const Rn=JSON.stringify({env:{ANTHROPIC_API_KEY:"",ANTHROPIC_BASE_URL:""}},null,2),Un=`# Codex config.toml 配置片段 — 通过 -c 参数注入,不会修改 ~/.codex/config.toml
|
|
30
|
-
# 参考: https://developers.openai.com/codex/config-sample
|
|
31
|
-
|
|
32
|
-
# ─── 模型与推理 ─────────────────────────────────────────────
|
|
33
|
-
# model_reasoning_effort = "medium" # minimal | low | medium | high | xhigh
|
|
34
|
-
# model_reasoning_summary = "auto" # auto | concise | detailed | none
|
|
35
|
-
# model_verbosity = "medium" # low | medium | high
|
|
36
|
-
# service_tier = "flex" # fast | flex
|
|
37
|
-
|
|
38
|
-
# ─── 自定义 Model Provider ──────────────────────────────────
|
|
39
|
-
# model_provider = "azure"
|
|
40
|
-
#
|
|
41
|
-
# [model_providers.azure]
|
|
42
|
-
# name = "Azure OpenAI"
|
|
43
|
-
# base_url = "https://YOUR_PROJECT.openai.azure.com/openai"
|
|
44
|
-
# env_key = "AZURE_OPENAI_API_KEY"
|
|
45
|
-
# env_key_instructions = "Set AZURE_OPENAI_API_KEY in Provider env"
|
|
46
|
-
# wire_api = "responses"
|
|
47
|
-
# query_params = { api-version = "2025-04-01-preview" }
|
|
48
|
-
|
|
49
|
-
# ─── OpenAI 数据驻留 ────────────────────────────────────────
|
|
50
|
-
# [model_providers.openai-us]
|
|
51
|
-
# name = "OpenAI US"
|
|
52
|
-
# base_url = "https://us.api.openai.com/v1"
|
|
53
|
-
# wire_api = "responses"
|
|
54
|
-
# requires_openai_auth = true
|
|
55
|
-
|
|
56
|
-
# ─── 本地 OSS (Ollama) ──────────────────────────────────────
|
|
57
|
-
# [model_providers.ollama]
|
|
58
|
-
# name = "Ollama"
|
|
59
|
-
# base_url = "http://localhost:11434/v1"
|
|
60
|
-
# wire_api = "responses"
|
|
61
|
-
`,Kn=`# Codex config.toml snippet — injected through -c; ~/.codex/config.toml is not modified.
|
|
62
|
-
# Reference: https://developers.openai.com/codex/config-sample
|
|
63
|
-
|
|
64
|
-
# ─── Model and reasoning ────────────────────────────────────
|
|
65
|
-
# model_reasoning_effort = "medium" # minimal | low | medium | high | xhigh
|
|
66
|
-
# model_reasoning_summary = "auto" # auto | concise | detailed | none
|
|
67
|
-
# model_verbosity = "medium" # low | medium | high
|
|
68
|
-
# service_tier = "flex" # fast | flex
|
|
69
|
-
|
|
70
|
-
# ─── Custom Model Provider ──────────────────────────────────
|
|
71
|
-
# model_provider = "azure"
|
|
72
|
-
#
|
|
73
|
-
# [model_providers.azure]
|
|
74
|
-
# name = "Azure OpenAI"
|
|
75
|
-
# base_url = "https://YOUR_PROJECT.openai.azure.com/openai"
|
|
76
|
-
# env_key = "AZURE_OPENAI_API_KEY"
|
|
77
|
-
# env_key_instructions = "Set AZURE_OPENAI_API_KEY in Provider env"
|
|
78
|
-
# wire_api = "responses"
|
|
79
|
-
# query_params = { api-version = "2025-04-01-preview" }
|
|
80
|
-
|
|
81
|
-
# ─── OpenAI data residency ──────────────────────────────────
|
|
82
|
-
# [model_providers.openai-us]
|
|
83
|
-
# name = "OpenAI US"
|
|
84
|
-
# base_url = "https://us.api.openai.com/v1"
|
|
85
|
-
# wire_api = "responses"
|
|
86
|
-
# requires_openai_auth = true
|
|
87
|
-
|
|
88
|
-
# ─── Local OSS (Ollama) ─────────────────────────────────────
|
|
89
|
-
# [model_providers.ollama]
|
|
90
|
-
# name = "Ollama"
|
|
91
|
-
# base_url = "http://localhost:11434/v1"
|
|
92
|
-
# wire_api = "responses"
|
|
93
|
-
`;function Ln(e,t){return e===A.CLAUDE_CODE?Rn:e===A.CODEX?t==="zh-CN"?Un:Kn:""}function Bn(e){return e===A.CLAUDE_CODE||e===A.CODEX}const _e="::ACP";function Xe(e,t){return t===B.ACP?`${e}${_e}`:String(e)}function xe(e,t){const r=$t(e);return t===B.ACP?`${r} (ACP)`:r}function Mn(e){return e.endsWith(_e)?{agentType:e.slice(0,-_e.length),runtimeType:B.ACP}:{agentType:e,runtimeType:B.CLI}}function zn(e,t){if(!e.trim())return e;try{const r=JSON.parse(e);if(!r.env||typeof r.env!="object"||Array.isArray(r.env))return e;const s=r.env;return t in s?(delete s[t],JSON.stringify(r,null,2)):e}catch{return e}}const at=Object.values(st).flat().reduce((e,t)=>(e[t.key]||(e[t.key]=t.label),e),{});at.permissionMode="权限策略";const lt=Object.values(st).flat().reduce((e,t)=>(t.options&&(e[t.key]=Object.fromEntries(t.options.map(r=>[r.value,r.label]))),e),{});lt.permissionMode={ASK:"每次询问",AUTO_APPROVE:"自动批准"};function $n(e,t){if(typeof t=="boolean")return t?Ce("是"):Ce("否");if(typeof t=="string"&&t){const r=lt[e]?.[t];return r?Ce(r):t}return String(t)}function ee(e,t){return e instanceof Error?e.message:t}function Fn(e){return e==="apiBaseUrl"?"API 地址":e==="apiKey"?"API Key":e==="reasoningEffort"?"思考强度":e==="model"?"模型":e==="executionPermission"?"执行权限":e==="disableResponsesWebsocket"?"禁用 WebSocket":e}function Jn(e){return{minimal:"最低",low:"低",medium:"中",high:"高",xhigh:"超高",max:"最高"}[e]??e}function Wn(e){return`agent-tower-provider-backup-${e.replace(/[:.]/g,"-")}.json`}function Vn(e,t){const r=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),s=URL.createObjectURL(r),o=document.createElement("a");o.href=s,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(s)}function qn(e){switch(e){case"CREATE":return{label:"新增",className:"bg-success/10 text-success"};case"OVERWRITE":return{label:"覆盖",className:"bg-warning/10 text-warning"};case"SKIP":return{label:"跳过",className:"bg-muted text-muted-foreground"}}}function Gn({type:e}){const t=e==="LOGIN_DETECTED"||e==="INSTALLATION_FOUND";return n.jsx("span",{className:M("inline-block h-2 w-2 rounded-full shrink-0",t?"bg-success":"bg-border"),title:t?"Available":"Unavailable",children:n.jsx("span",{className:"sr-only",children:t?"Available":"Unavailable"})})}function Xn({type:e}){const{t}=Y();return e==="LOGIN_DETECTED"||e==="INSTALLATION_FOUND"?n.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-success/10 px-2 py-0.5 text-[11px] font-medium text-success",children:[n.jsx(Ze,{size:11,"aria-hidden":"true"}),t("可用")]}):n.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground",children:[n.jsx(At,{size:11,"aria-hidden":"true"}),t("不可用")]})}function Yn({title:e,status:t,defaultOpen:r=!1,children:s}){const[o,a]=E.useState(r);return n.jsxs("div",{className:"rounded-lg border border-border",children:[n.jsxs("button",{type:"button",onClick:()=>a(i=>!i),"aria-expanded":o,className:"w-full flex items-center justify-between rounded-lg px-4 py-2.5 text-sm font-medium text-foreground transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-inset",children:[n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("span",{children:e}),t]}),n.jsx(Qe,{size:14,"aria-hidden":"true",className:M("text-muted-foreground transition-transform motion-reduce:transition-none",o&&"rotate-180")})]}),o&&n.jsx("div",{className:"px-4 pb-4 space-y-3",children:s})]})}function Zn({isOpen:e,onClose:t,providerId:r,initialData:s,onSave:o}){const{locale:a,t:i}=Y(),{data:c}=_t(),d=Tt(),[l,m]=E.useState(s??{name:"",agentType:A.CLAUDE_CODE,runtimeType:B.CLI,config:Ge(),settings:"",env:[],simplified:{apiKey:{configured:!1,envKey:"ANTHROPIC_API_KEY"}},diagnostics:[],isDefault:!1}),[f,v]=E.useState(()=>JSON.stringify(l.config,null,2)),[y,P]=E.useState(""),[_,I]=E.useState(()=>l.diagnostics?.find(u=>u.field==="settings")?.message??""),[D,q]=E.useState(!1),[K,z]=E.useState(!1),[$,G]=E.useState(null),[F,R]=E.useState(()=>new Set),[b,k]=E.useState(()=>l.diagnostics?.filter(u=>u.code==="CONFLICT")??[]),[ne,ie]=E.useState({}),re=E.useRef(An()),C=c?.[l.agentType]??be[l.agentType],J=C.apiBaseUrl?hn(l.simplified.apiBaseUrl):null,Z=En(l.config,C),se=l.config.permissionMode??l.config.acpPermissionMode,we=se==="AUTO_APPROVE"?"AUTO_APPROVE":"ASK",H=l.runtimeType===B.ACP&&se!==void 0&&se!=="ASK"&&se!=="AUTO_APPROVE"?i("ACP 权限策略必须为 ASK 或 AUTO_APPROVE"):null,Q=C.disableResponsesWebsocket,h=Q?rt(l.config,Q):null,N=l.simplified.reasoningEffort??"",T=N&&!C.reasoningEffort?.options?.includes(N)?i("请选择当前 Agent 支持的思考强度档位"):null,X=u=>{re.current.invalidate(),u&&m(u),z(!0),G(null)},U=u=>{X(u)},Re=()=>{K&&!window.confirm(i("存在未保存的修改,确定放弃吗?"))||t()},ct=u=>l.env.find(p=>te(p.key,u)),ue=(u,p,g="")=>{if(p.action!=="keep"){const x=u===C.apiBaseUrl?.path?"apiBaseUrl":u===C.apiKey?.path?"apiKey":null;x&&ie(j=>{const S={...j};return delete S[x],S})}U(x=>{const j=x.env.findIndex(vt=>te(vt.key,u)),S=[...x.env],ae=j>=0?S[j]:null,me={key:ae?.key??u,value:g,write:p,configured:ae?.configured??!1,sensitive:te(u,x.simplified.apiKey?.envKey)||!!ae?.sensitive||/key|token|secret|password|auth/i.test(u)};j>=0?S[j]=me:S.push(me);const ht=x.agentType===A.CLAUDE_CODE&&p.action!=="keep"&&(u===C.apiBaseUrl?.path||u===C.apiKey?.path);return{...x,env:S,settings:ht?zn(x.settings,u):x.settings}})},ge=(u,p)=>{ie(g=>{if(!(u in g))return g;const x={...g};return delete x[u],x}),R(g=>new Set(g).add(u)),u==="apiBaseUrl"&&C.apiBaseUrl?.kind==="env"&&ue(C.apiBaseUrl.path,p?{action:"replace",value:p}:{action:"clear"},p),U(g=>{const x=bn(g,u,p,C);return x.config!==g.config&&v(JSON.stringify(x.config,null,2)),x})},dt=u=>{Q&&U(p=>{const g=Pn(p,Q,u);return v(JSON.stringify(g.config,null,2)),g})},ut=u=>{if(K&&!window.confirm(i("切换 Agent 类型会清空当前类型的配置,是否继续?")))return;const{agentType:p,runtimeType:g}=Mn(u),x=be[p],j=g===B.ACP?{permissionMode:"ASK"}:Ge(),S={...l,agentType:p,runtimeType:g,config:j,settings:"",env:[],simplified:{apiKey:x.apiKey?{configured:!1,envKey:x.apiKey.path}:void 0}};X(()=>S),v(JSON.stringify(j,null,2)),P(""),I(""),q(!1),R(new Set),k([]),ie({})},Ue=(u=!1)=>{let p=!y&&!Z.error&&!H&&!h?.error&&!T;const g=l.settings.trim();if(g&&(D||u))try{if(l.agentType===A.CODEX)de(g);else if(l.agentType===A.CLAUDE_CODE){const x=JSON.parse(g);if(!x||typeof x!="object"||Array.isArray(x))throw new Error(i("JSON 顶层必须是对象"))}I("")}catch(x){I(i("{format} 语法错误: {message}",{format:l.agentType===A.CODEX?"TOML":"JSON",message:x instanceof Error?x.message:String(x)})),p=!1}return p},Ke=()=>{const u=_n(l.env),p=Object.fromEntries([...F].map(g=>[g,l.simplified[g]]));return{providerId:r,name:l.name,agentType:l.agentType,runtimeType:l.runtimeType,env:u,config:l.config,settings:l.settings,simplified:F.size>0?p:void 0,conflictResolutions:ne,isDefault:l.isDefault}},mt=()=>{if(J||!Ue(!1))return;const p={...Ke()};delete p.providerId,r&&delete p.runtimeType,o(p)},ft=()=>{if(J||b.length>0||!Ue(!0))return;const u=re.current.begin();G(null),d.mutate(Ke(),{onSuccess:p=>{re.current.isCurrent(u)&&G(p)},onError:p=>{re.current.isCurrent(u)&&G({ok:!1,stage:"connection",errorKind:"unknown",summary:ee(p,i("测试配置失败"))})}})};if(!e)return null;const pt=Bn(l.agentType),he=l.agentType===A.CODEX,Ne=he&&On(l.settings),oe=l.simplified.apiKey?.envKey??C.apiKey?.path,Ee=oe?ct(oe):void 0,Le=vn(Ee,!!l.simplified.apiKey?.configured,ne.apiKey),xt=Le==="advanced",Be=Le!=="unconfigured",gt=!l.name.trim()||!!J||!!y||!!Z.error||!!H||!!h?.error||!!T||!!_&&D||b.length>0;return n.jsx(n.Fragment,{children:n.jsx(Oe,{isOpen:e,onClose:Re,title:i(s?"编辑 Provider":"新建 Provider"),className:"max-w-3xl",action:n.jsxs("div",{className:"flex w-full flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[n.jsxs(O,{variant:"outline",onClick:ft,disabled:d.isPending||!!J||!!y||!!Z.error||!!H||!!h?.error||!!T||!!_&&D||b.length>0,children:[d.isPending?n.jsx(wt,{className:"animate-spin"}):n.jsx(qt,{}),d.isPending?i("测试中..."):i("测试配置")]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(O,{variant:"outline",onClick:Re,children:i("取消")}),n.jsx(O,{onClick:mt,disabled:gt,children:i("保存 Provider")})]})]}),children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[n.jsxs("div",{children:[n.jsx("label",{htmlFor:"provider-name",className:"mb-1 block text-xs font-medium text-foreground",children:i("名称")}),n.jsx(le,{id:"provider-name",value:l.name,onChange:u=>U(p=>({...p,name:u.target.value})),placeholder:i("例如: Claude Code (官方)")})]}),!s&&n.jsxs("div",{children:[n.jsx("label",{className:"mb-1 block text-xs font-medium text-foreground",children:i("Agent 类型")}),n.jsx(ze,{value:Xe(l.agentType,l.runtimeType),onChange:ut,options:Mt.flatMap(u=>zt[u].map(p=>({value:Xe(u,p),label:xe(u,p),icon:n.jsx(pe,{agentType:u,className:"size-4"})}))),placeholder:i("选择 Agent 类型")})]}),s&&n.jsxs("div",{children:[n.jsx("label",{className:"mb-1 block text-xs font-medium text-foreground",children:i("Agent 类型")}),n.jsxs("div",{className:"flex h-9 items-center gap-2 rounded-lg border border-neutral-200 bg-muted/30 px-3 text-sm text-muted-foreground",children:[n.jsx(pe,{agentType:l.agentType,className:"size-4"}),n.jsx("span",{className:"min-w-0 truncate",children:xe(l.agentType,l.runtimeType)})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"checkbox",id:"isDefault",checked:l.isDefault,onChange:u=>U(p=>({...p,isDefault:u.target.checked})),className:"h-4 w-4 rounded border-border accent-primary"}),n.jsx("label",{htmlFor:"isDefault",className:"text-sm text-foreground",children:i("设为该类型的默认 Provider")})]}),n.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-muted/20 p-4",children:[n.jsx("div",{className:"text-sm font-medium text-foreground",children:i("基本配置")}),l.runtimeType===B.ACP&&n.jsxs("div",{children:[n.jsx("label",{className:"mb-1 block text-xs font-medium text-foreground",children:i("权限策略")}),n.jsx(ze,{value:we,onChange:u=>U(p=>{const g={...p.config,permissionMode:u};delete g.acpPermissionMode;const x={...p,config:g};return v(JSON.stringify(x.config,null,2)),x}),options:[{value:"ASK",label:i("每次询问")},{value:"AUTO_APPROVE",label:i("自动批准")}]}),H&&n.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive",children:H})]}),C.apiBaseUrl&&!Ne&&n.jsxs("div",{children:[n.jsx("label",{htmlFor:"provider-api-url",className:"mb-1 block text-xs font-medium text-foreground",children:i("API 地址")}),n.jsx(le,{id:"provider-api-url",type:"url",value:l.simplified.apiBaseUrl??"",onChange:u=>ge("apiBaseUrl",u.target.value),placeholder:C.apiBaseUrl.placeholder,"aria-invalid":!!J,"aria-describedby":J?"provider-api-url-error":void 0}),J&&n.jsx("p",{id:"provider-api-url-error",role:"alert",className:"mt-1 text-xs text-destructive",children:i("请输入以 http:// 或 https:// 开头的完整 API 地址")})]}),C.apiKey&&!Ne&&(l.agentType!==A.CODEX||!!l.simplified.apiKey)&&n.jsxs("div",{children:[n.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[n.jsx("label",{htmlFor:"provider-api-key",className:"text-xs font-medium text-foreground",children:"API Key"}),n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[n.jsx(Xt,{size:12}),i(xt?"由高级配置管理":Be?"已配置":"未配置")]})]}),Ee?.write.action==="replace"||!Be?n.jsxs("div",{className:"flex gap-2",children:[n.jsx(le,{id:"provider-api-key",type:"password",autoComplete:"new-password",value:Ee?.value??"",onChange:u=>ue(oe,{action:"replace",value:u.target.value},u.target.value),placeholder:i("输入 API Key")}),l.simplified.apiKey?.configured&&n.jsx(O,{variant:"outline",size:"sm",onClick:()=>ue(oe,{action:"keep"}),children:i("取消替换")})]}):n.jsxs("div",{className:"flex gap-2",children:[n.jsx(O,{variant:"outline",size:"sm",onClick:()=>ue(oe,{action:"replace",value:""}),children:i("替换")}),n.jsx(O,{variant:"outline",size:"sm",onClick:()=>{window.confirm(i("确定清除此 API Key?"))&&ue(oe,{action:"clear"})},children:i("清除")})]})]}),n.jsxs("div",{children:[n.jsx("label",{htmlFor:"provider-model",className:"mb-1 block text-xs font-medium text-foreground",children:i("模型")}),l.agentType===A.CURSOR_AGENT?n.jsx(mn,{value:l.simplified.model??"",onChange:u=>ge("model",u??"")}):n.jsx(le,{id:"provider-model",value:l.simplified.model??"",onChange:u=>ge("model",u.target.value),placeholder:C.model.placeholder})]}),C.reasoningEffort&&n.jsx(gn,{options:(C.reasoningEffort.options??[]).map(u=>({value:u,label:i(Jn(u))})),value:N,onChange:u=>ge("reasoningEffort",u),label:i("思考强度"),efficiencyLabel:i("更高效"),intelligenceLabel:i("更智能"),followCliLabel:i("跟随 CLI"),currentLabel:i("当前"),error:T}),Q&&h&&n.jsxs("section",{className:"border-t border-border pt-3",children:[n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-xs font-medium text-foreground",children:i("禁用 WebSocket")}),n.jsx("div",{className:"mt-0.5 text-xs text-muted-foreground",children:i(Ne?"当前原生 Provider 已使用非 WebSocket 传输;此开关不会添加额外运行时覆盖。":"仅禁用 Codex Responses API 的 WebSocket 传输;新启动和后续继续的请求将使用 HTTP。")})]}),n.jsx(He,{checked:h.enabled,disabled:!!h.error,onCheckedChange:dt,"aria-label":i("禁用 WebSocket")})]}),h.error&&n.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive",children:i("禁用 WebSocket 字段必须为 true 或 false,请在运行配置 JSON 中修正。")})]})]}),$&&n.jsx(xn,{result:$}),b.length>0&&n.jsxs("div",{className:"space-y-3 rounded-lg border border-warning/30 bg-warning/10 p-4",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[n.jsx(Te,{size:16,className:"text-warning"}),i("需要解决配置冲突")]}),b.map(u=>n.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-warning/20 bg-background/70 p-3 sm:flex-row sm:items-center sm:justify-between",children:[n.jsxs("div",{className:"text-xs text-muted-foreground",children:[n.jsx("span",{className:"font-medium text-foreground",children:i(Fn(u.field))})," · ",i("简化字段与高级配置值不同")]}),n.jsx("div",{className:"flex flex-wrap gap-2",children:["simple","advanced"].map(p=>n.jsx(O,{variant:"outline",size:"sm",onClick:()=>{const g=u.field,x=Dn(l,g,p,C);U(()=>x),v(JSON.stringify(x.config,null,2)),ie(j=>({...j,[g]:p})),p==="advanced"&&(g==="apiBaseUrl"||g==="model"||g==="reasoningEffort")&&R(j=>{const S=new Set(j);return S.delete(g),S}),k(j=>j.filter(S=>S.field!==g))},children:i(p==="simple"?"采用简化值":"保留高级值")},p))})]},u.field))]}),n.jsxs(Yn,{title:i("高级配置"),defaultOpen:!!y||!!_||!!Z.error||b.length>0,children:[n.jsxs("div",{children:[n.jsx("label",{className:"mb-1 block text-xs font-medium text-foreground",children:i("运行配置 (JSON)")}),n.jsx($e,{value:f,onChange:u=>{const p=u.target.value;v(p);try{const g=JSON.parse(p);if(!g||typeof g!="object"||Array.isArray(g))throw new Error(i("JSON 顶层必须是对象"));const x=g;P(""),R(j=>{const S=new Set(j).add("model");return C.reasoningEffort?.kind==="config"&&S.add("reasoningEffort"),S}),U(j=>({...j,config:x,simplified:Tn(j.simplified,x,C)}))}catch(g){X(),P(g instanceof Error?g.message:i("JSON 语法错误"))}},rows:7,className:"font-mono","aria-invalid":!!y}),y&&n.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive",children:y}),Z.error&&n.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive",children:i("执行权限字段必须为 true 或 false,请在运行配置 JSON 中修正。")})]}),n.jsxs("div",{className:"border-t border-border pt-3",children:[n.jsx("label",{className:"mb-2 block text-xs font-medium text-foreground",children:i("环境变量")}),n.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:[i("注入到 Agent 进程的环境变量。Codex 的")," ",n.jsx("code",{className:"rounded bg-muted px-1",children:"env_key"})," ",i("指定的是变量名,实际值需在此处设置。")]}),n.jsxs("div",{className:"space-y-2",children:[l.env.map((u,p)=>u.write.action!=="clear"&&n.jsxs("div",{className:"flex gap-2 items-center",children:[n.jsx(le,{value:u.key,disabled:u.configured,onChange:g=>{const x=g.target.value;U(j=>{const S=[...j.env],ae=S[p];if(!ae)return j;const me={...ae,key:x};return S[p]={...me,sensitive:ye(me,j.simplified)},{...j,env:S}})},placeholder:i("变量名,如 AZURE_OPENAI_API_KEY"),className:"flex-1 py-1.5 font-mono"}),n.jsx(le,{value:u.value,type:ye(u,l.simplified)?"password":"text",onChange:g=>{const x=[...l.env];x[p]={...x[p],value:g.target.value,write:{action:"replace",value:g.target.value}},U(j=>({...j,env:x,simplified:u.key===C.apiBaseUrl?.path?{...j.simplified,apiBaseUrl:g.target.value}:j.simplified})),u.key===C.apiBaseUrl?.path&&R(j=>new Set(j).add("apiBaseUrl"))},placeholder:u.configured&&u.write.action==="keep"?i("已配置,输入新值以替换"):i("值"),className:"flex-1 py-1.5 font-mono"}),n.jsx("button",{type:"button",onClick:()=>{const g=[...l.env];u.configured?g[p]={...u,value:"",write:{action:"clear"}}:g.splice(p,1),U(x=>({...x,env:g,simplified:u.key===C.apiBaseUrl?.path?{...x.simplified,apiBaseUrl:""}:x.simplified})),u.key===C.apiBaseUrl?.path&&R(x=>new Set(x).add("apiBaseUrl"))},"aria-label":i("删除"),className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:n.jsx(et,{size:14})})]},p)),n.jsxs(O,{variant:"outline",size:"sm",onClick:()=>U(u=>({...u,env:[...u.env,{key:"",value:"",write:{action:"replace",value:""},configured:!1,sensitive:!1}]})),children:[n.jsx(Se,{size:12,className:"mr-1"}),i("添加变量")]})]})]}),pt&&n.jsxs("div",{className:"border-t border-border pt-3",children:[n.jsx("label",{className:"mb-2 block text-xs font-medium text-foreground",children:i(he?"Agent 原生配置 (config.toml)":"Agent 原生配置 (settings.json)")}),n.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:he?n.jsxs(n.Fragment,{children:[i("直接填写 Codex")," ",n.jsx("code",{className:"rounded bg-muted px-1",children:"config.toml"})," ",i("格式的配置片段,由当前 Runtime 注入。不会修改你的")," ",n.jsx("code",{className:"rounded bg-muted px-1",children:"~/.codex/config.toml"})," ",i("文件。")]}):n.jsxs(n.Fragment,{children:[i("对应 Claude Code 的")," ",n.jsx("code",{className:"rounded bg-muted px-1",children:"~/.claude/settings.json"}),",",i("由当前 Runtime 注入。在")," ",n.jsx("code",{className:"rounded bg-muted px-1",children:"env"})," ",i("中设置 ANTHROPIC_API_KEY、ANTHROPIC_BASE_URL 等。")]})}),n.jsx($e,{value:l.settings,onChange:u=>{const p=u.target.value;q(!0),I("");let g;if(he)try{g=qe(l.simplified,p,A.CODEX),R(x=>new Set(x).add("reasoningEffort"))}catch{}U(x=>{const j=g===void 0?x.simplified:qe(x.simplified,p,A.CODEX,new Set(x.env.flatMap(S=>S.write.action==="clear"?[]:S.write.action==="replace"?S.value?[S.key]:[]:S.configured?[S.key]:[])));return{...x,settings:p,env:kn(x.env,j),simplified:j}})},rows:10,className:"font-mono",placeholder:Ln(l.agentType,a),"aria-invalid":!!_}),_&&n.jsx("p",{role:"alert",className:"mt-1 text-xs text-destructive",children:_})]})]})]})})})}function Hn({isOpen:e,onClose:t,onConfirm:r,acknowledged:s,onAcknowledgedChange:o,isLoading:a}){const{t:i}=Y();return n.jsx(Oe,{isOpen:e,onClose:t,title:i("导出 Provider 备份"),className:"max-w-xl",action:n.jsxs(n.Fragment,{children:[n.jsx(O,{variant:"outline",onClick:t,disabled:a,children:i("取消")}),n.jsx(O,{onClick:r,disabled:!s||a,children:i(a?"导出中...":"导出备份")})]}),children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-warning/30 bg-warning/10 px-4 py-3 text-sm text-foreground",children:[n.jsx(Te,{size:15,className:"mt-0.5 shrink-0 text-warning","aria-hidden":"true"}),n.jsx("span",{children:i("导出的备份文件将包含完整的 Provider 配置,包括环境变量、CLI settings 等敏感信息。任何拿到文件的人都可能直接使用这些 Provider。")})]}),n.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[n.jsx("p",{children:i("这个功能用于备份和迁移,不用于分享配置。")}),n.jsx("p",{children:i("导出内容只包含用户层配置:自定义 Provider,以及对内置 Provider 的覆盖。")})]}),n.jsxs("label",{className:"flex items-start gap-3 rounded-lg border border-border px-4 py-3 text-sm text-foreground",children:[n.jsx("input",{type:"checkbox",checked:s,onChange:c=>o(c.target.checked),className:"mt-0.5 h-4 w-4 rounded border-border accent-primary"}),n.jsx("span",{children:i("我已知晓该备份文件包含敏感信息,只会保存在安全位置。")})]})]})})}function Qn({isOpen:e,onClose:t,preview:r,backup:s,onConfirm:o,isLoading:a}){const{t:i}=Y();if(!r||!s)return null;const c=r.summary.create+r.summary.overwrite,d=[...r.items].sort((l,m)=>{const f={CREATE:0,OVERWRITE:1,SKIP:2};return f[l.action]-f[m.action]});return n.jsx(Oe,{isOpen:e,onClose:t,title:i("导入 Provider 备份"),className:"max-w-3xl",action:n.jsxs(n.Fragment,{children:[n.jsx(O,{variant:"outline",onClick:t,disabled:a,children:i("取消")}),n.jsx(O,{onClick:o,disabled:c===0||a,children:a?i("导入中..."):i("确认导入 {count} 项",{count:c})})]}),children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 px-4 py-3 text-sm text-muted-foreground",children:[n.jsx("div",{children:i("导出时间:{value}",{value:new Date(s.exportedAt).toLocaleString()})}),n.jsx("div",{children:i("模式:完整备份(含敏感信息)")}),n.jsx("div",{children:i("文件内 Provider 数量:{count}",{count:s.providers.length})})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{className:"rounded-lg border border-success/25 bg-success/10 px-4 py-3",children:[n.jsx("div",{className:"text-xs font-medium text-success",children:i("新增")}),n.jsx("div",{className:"text-lg font-semibold text-foreground",children:r.summary.create})]}),n.jsxs("div",{className:"rounded-lg border border-warning/25 bg-warning/10 px-4 py-3",children:[n.jsx("div",{className:"text-xs font-medium text-warning",children:i("覆盖")}),n.jsx("div",{className:"text-lg font-semibold text-foreground",children:r.summary.overwrite})]}),n.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 px-4 py-3",children:[n.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:i("跳过")}),n.jsx("div",{className:"text-lg font-semibold text-foreground",children:r.summary.skip})]})]}),n.jsx("div",{className:"max-h-[420px] overflow-y-auto space-y-3 pr-1",children:d.map(l=>{const m=qn(l.action);return n.jsxs("div",{className:"rounded-lg border border-border px-4 py-3",children:[n.jsx("div",{className:"flex items-center justify-between gap-3",children:n.jsxs("div",{className:"min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h4",{className:"truncate text-sm font-medium text-foreground",children:l.incoming.name}),n.jsx("span",{className:`inline-flex rounded-full px-2 py-0.5 text-[11px] font-medium ${m.className}`,children:i(m.label)})]}),n.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[n.jsx(pe,{agentType:l.incoming.agentType,className:"size-3.5"}),n.jsx("span",{className:"min-w-0 truncate",children:xe(l.incoming.agentType,l.incoming.runtimeType)})," · ",n.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:l.incoming.id})]})]})}),l.action==="OVERWRITE"&&l.existing&&n.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:i("将覆盖当前已有的 Provider:{name}",{name:l.existing.name})}),l.action==="SKIP"&&n.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:i("当前同 ID Provider 配置一致,本次不会重复写入。")}),l.action==="CREATE"&&n.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:i("当前不存在同 ID Provider,将直接新增。")})]},l.incoming.id)})})]})})}function ei({item:e,onEdit:t,onDelete:r}){const{t:s}=Y(),o=e.provider,a=e.availability,i=ot(o.agentType,o.config),c=be[o.agentType],d=Object.entries(i).filter(([m])=>m!=="cmd"&&m!==c.executionPermission.path),l=Object.keys(o.redactedEnv||{});return n.jsxs("div",{className:"min-w-0 space-y-6",children:[n.jsxs("div",{className:"flex min-w-0 flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[n.jsx("h3",{className:"min-w-0 truncate text-base font-semibold text-foreground",children:o.name}),n.jsx(Xn,{type:a.type})]}),n.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[n.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[n.jsx(pe,{agentType:o.agentType,className:"size-3.5"}),n.jsx("span",{className:"truncate",children:xe(o.agentType,o.runtimeType)})]}),o.isDefault&&n.jsx("span",{className:"rounded-full bg-primary/[0.06] px-2 py-0.5 text-[11px] font-medium text-primary",children:s("默认")}),o.builtIn&&n.jsx("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground",children:s("内置")})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 sm:shrink-0",children:[n.jsxs(O,{size:"sm",variant:"outline",onClick:t,children:[n.jsx(Wt,{size:13}),s("编辑")]}),n.jsxs(O,{size:"sm",variant:o.builtIn?"outline":"destructive",onClick:r,disabled:o.deletable===!1,children:[o.builtIn?n.jsx(kt,{size:13}):n.jsx(et,{size:13}),o.builtIn?s("恢复默认"):s("删除")]})]})]}),d.length>0&&n.jsxs("div",{children:[n.jsx(Pe,{className:"mb-3",children:s("运行配置")}),n.jsx("div",{className:"grid gap-px overflow-hidden rounded-lg border border-border bg-border/60",children:d.map(([m,f])=>n.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 bg-background px-4 py-2.5 sm:flex-row sm:items-center sm:gap-4",children:[n.jsx("span",{className:"min-w-0 break-words text-[13px] text-muted-foreground sm:w-32 sm:shrink-0",children:s(at[m]??m)}),n.jsx("span",{className:"min-w-0 max-w-full break-all font-mono text-[13px] text-foreground",children:$n(m,f)})]},m))})]}),l.length>0&&n.jsxs("div",{children:[n.jsx(Pe,{className:"mb-3",children:s("环境变量")}),n.jsx("div",{className:"grid gap-px overflow-hidden rounded-lg border border-border bg-border/60",children:l.map(m=>n.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 bg-background px-4 py-2.5 sm:gap-4",children:[n.jsx("span",{className:"min-w-0 max-w-full break-all font-mono text-[13px] text-foreground",children:m}),n.jsx("span",{className:"text-[13px] text-muted-foreground","aria-label":"hidden",children:"•••••"})]},m))})]}),o.settings?.trim()&&n.jsxs("div",{children:[n.jsx(Pe,{className:"mb-3",children:s("Agent 原生配置")}),n.jsx("div",{className:"rounded-lg border border-border bg-muted/40 p-4",children:n.jsx("pre",{className:"max-h-[200px] overflow-y-auto whitespace-pre-wrap break-all font-mono text-xs text-muted-foreground",children:o.settings})})]}),d.length===0&&l.length===0&&!o.settings?.trim()&&n.jsx("div",{className:"py-8 text-center text-sm text-muted-foreground",children:s('该 Provider 未配置额外参数。点击"编辑"添加运行配置、环境变量或 Agent 原生配置。')})]})}function vi(){const{t:e}=Y(),{data:t,isLoading:r}=Ot(),s=It(),o=Dt(),a=Rt(),i=Ut(),c=Kt(),d=Lt(),l=E.useRef(null),[m,f]=E.useState(null),[v,y]=E.useState(null),[P,_]=E.useState(null),[I,D]=E.useState(!1),[q,K]=E.useState(!1),[z,$]=E.useState(null),[G,F]=E.useState(!1),R=t??[],b=m??R[0]?.provider.id??null,k=h=>{s.mutate(h,{onSuccess:()=>y(null),onError:N=>L.error(ee(N,e("创建 Provider 失败")))})},ne=(h,N)=>{o.mutate({id:h,data:N},{onSuccess:()=>y(null),onError:T=>L.error(ee(T,e("更新 Provider 失败")))})},ie=h=>{if(!(h.deletable??!h.builtIn)){L.error(e("系统内置 Provider 不可删除"));return}_({id:h.id,name:h.name,builtIn:h.builtIn})},re=()=>{P&&a.mutate(P.id,{onSuccess:()=>{L.success(P.builtIn?e("已恢复默认 Provider 配置"):e("Provider 已删除")),b===P.id&&f(null),_(null),F(!1)},onError:h=>L.error(ee(h,e("删除 Provider 失败")))})},C=()=>{D(!1),K(!1)},J=()=>$(null),Z=()=>{i.mutate(void 0,{onSuccess:h=>{Vn(Wn(h.exportedAt),h),L.success(e("Provider 备份已导出")),C()},onError:h=>L.error(ee(h,e("导出 Provider 备份失败")))})},se=()=>{l.current&&(l.current.value="",l.current.click())},we=async h=>{const N=h.target.files?.[0];if(h.target.value="",!N)return;let T;try{T=JSON.parse(await N.text())}catch{L.error(e("备份文件不是有效的 JSON"));return}c.mutate(T,{onSuccess:X=>$({backup:T,preview:X}),onError:X=>L.error(ee(X,e("导入预览失败")))})},H=()=>{z&&d.mutate(z.backup,{onSuccess:h=>{const N=h.summary.create+h.summary.overwrite;L.success(N===0?e("导入完成,当前配置无需变更"):e("导入完成:新增 {create},覆盖 {overwrite},跳过 {skip}",{create:h.summary.create,overwrite:h.summary.overwrite,skip:h.summary.skip})),J()},onError:h=>L.error(ee(h,e("导入 Provider 备份失败")))})},Q=h=>{const N=h.provider,T=be[N.agentType],X=Sn(N,T);y({id:N.id,data:{name:N.name,agentType:N.agentType,runtimeType:N.runtimeType===B.ACP?B.ACP:B.CLI,config:ot(N.agentType,N.config),settings:N.settings??"",env:X,simplified:N.simplified??{},diagnostics:N.diagnostics,isDefault:N.isDefault}})};return r?n.jsx(Me,{className:"max-w-5xl",children:n.jsx(Nt,{})}):n.jsxs(Me,{className:"max-w-5xl",children:[n.jsx("input",{ref:l,type:"file",accept:".json,application/json",className:"hidden",onChange:we}),n.jsx(Et,{title:e("Agent 配置"),actions:n.jsxs(n.Fragment,{children:[n.jsxs(O,{variant:"outline",size:"sm",onClick:se,disabled:c.isPending||d.isPending,children:[n.jsx(Jt,{size:13}),e("导入")]}),n.jsxs(O,{variant:"outline",size:"sm",onClick:()=>D(!0),disabled:i.isPending,children:[n.jsx(Pt,{size:13}),e("导出")]}),n.jsxs(O,{size:"sm",onClick:()=>y({}),children:[n.jsx(Se,{size:13,className:"mr-1"}),e("新建")]})]})}),R.length===0?n.jsx(Ct,{icon:St,message:e("暂无 Agent 配置"),action:n.jsxs(O,{size:"sm",onClick:()=>y({}),children:[n.jsx(Se,{size:13,className:"mr-1"}),e("新建配置")]})}):n.jsx(Ft,{items:R,selectedId:b,onSelectItem:h=>{f(h),F(!0)},getItemId:h=>h.provider.id,mobileShowDetail:G,onMobileBack:()=>F(!1),renderListItem:(h,N)=>{const T=h.provider;return n.jsxs(n.Fragment,{children:[n.jsx(Gn,{type:h.availability.type}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-[13px] font-medium",children:T.name}),n.jsxs("div",{className:M("flex min-w-0 items-center gap-1.5 text-[11px]",N?"text-primary-foreground/60":"text-muted-foreground"),children:[n.jsx(pe,{agentType:T.agentType,className:"size-3.5",fallbackClassName:N?"text-primary-foreground/70":"text-muted-foreground"}),n.jsx("span",{className:"min-w-0 truncate",children:xe(T.agentType,T.runtimeType)})]})]}),T.isDefault&&n.jsx("span",{className:M("shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium",N?"bg-white/20 text-primary-foreground":"bg-primary/[0.06] text-primary"),children:e("默认")})]})},renderDetail:h=>h?n.jsx("div",{className:"min-w-0 p-5",children:n.jsx(ei,{item:h,onEdit:()=>Q(h),onDelete:()=>ie(h.provider)})}):n.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:e("选择一个 Provider 查看详情")})}),v&&n.jsx(Zn,{isOpen:!0,onClose:()=>y(null),providerId:v.id,initialData:v.data,onSave:h=>{v.id?ne(v.id,h):k(h)}}),n.jsx(Bt,{isOpen:P!==null,onClose:()=>{a.isPending||_(null)},onConfirm:re,title:P?.builtIn?e("恢复默认 Provider"):e("删除 Provider"),description:P?.builtIn?e('确定删除 "{name}" 的自定义覆盖,并恢复系统默认配置?',{name:P?.name}):e('确定删除 "{name}"?此操作不可撤销。',{name:P?.name}),confirmText:P?.builtIn?e("恢复默认"):e("删除"),cancelText:e("取消"),variant:"danger",isLoading:a.isPending}),n.jsx(Hn,{isOpen:I,onClose:C,onConfirm:Z,acknowledged:q,onAcknowledgedChange:K,isLoading:i.isPending}),n.jsx(Qn,{isOpen:!!z,onClose:J,preview:z?.preview??null,backup:z?.backup??null,onConfirm:H,isLoading:d.isPending})]})}export{Zn as ProviderFormModal,vi as ProviderSettingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as a,V as n}from"./index-CjdqAcbu.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as c}from"./index-D9kBRMR0.js";const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t=c("check",e);export{t as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-Cd48r7c-.js";import{_ as i}from"./index-CjdqAcbu.js";import"./chunk-FMBD7UC4-6XIvQYVJ.js";import"./chunk-ND2GUHAM-BJlcb_pB.js";import"./chunk-55IACEB6-hTffyPXL.js";import"./chunk-2J33WTMH-BWNSmQa8.js";import"./index-D9kBRMR0.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-Cd48r7c-.js";import{_ as i}from"./index-CjdqAcbu.js";import"./chunk-FMBD7UC4-6XIvQYVJ.js";import"./chunk-ND2GUHAM-BJlcb_pB.js";import"./chunk-55IACEB6-hTffyPXL.js";import"./chunk-2J33WTMH-BWNSmQa8.js";import"./index-D9kBRMR0.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as c}from"./index-D9kBRMR0.js";const e=[["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"}]],t=c("copy",e);export{t as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as g,l as o}from"./monaco-Bc-Z2u8N.js";import{C as l,H as h,D as c,a as u,R as f,b as _,c as w,d as k,F as v,e as D,S as P,f as R,g as I}from"./lspLanguageFeatures-Cbk7wEkj.js";import{h as oe,i as se,j as ne,t as ae,k as pe}from"./lspLanguageFeatures-Cbk7wEkj.js";import"./ProjectKanbanPage--cx6wNDR.js";import"./index-D9kBRMR0.js";import"./mermaid-NOHMQCX5-DWQaYVL0.js";import"./chevron-right-pH923eYp.js";import"./chevron-down-BQcW9sFf.js";import"./confirm-dialog-CRiC3xBd.js";import"./modal-Cymk-6Df.js";import"./Icons-DADUmnB1.js";import"./CreateTaskInput-B67vzMJD.js";import"./AgentLogo-BCwbooTN.js";import"./check-BN_PVKzE.js";import"./use-projects-Cuv0A0RC.js";import"./MemberAvatar-l-WCdlLA.js";import"./use-providers-DLcAY6E1.js";import"./trash-2-R46i6Uus.js";import"./useNormalizedLogs-tfxFAJOF.js";import"./folder-picker-WUhXxIM5.js";import"./circle-alert-oa-BQ5e7.js";import"./message-square-DxbkpGqF.js";import"./layers-Bo4aml98.js";import"./chevron-up-DyQW115F.js";import"./select-BpKQyMvD.js";import"./textarea-DjwjAAG8.js";import"./upload-CgWqsmdI.js";import"./arrow-left-CCWDjOmp.js";import"./copy-DaoAUKTO.js";const C=120*1e3;class A{constructor(n){this._defaults=n,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>C&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=g({moduleId:"vs/language/css/cssWorker",createWorker:()=>new Worker(new URL("/assets/css.worker-DBVD8oXr.js",import.meta.url),{type:"module"}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...n){let e;return this._getClient().then(a=>{e=a}).then(a=>{if(this._worker)return this._worker.withSyncedResources(n)}).then(a=>e)}}function te(s){const n=[],e=[],a=new A(s);n.push(a);const r=(...t)=>a.getLanguageServiceWorker(...t);function m(){const{languageId:t,modeConfiguration:i}=s;d(e),i.completionItems&&e.push(o.registerCompletionItemProvider(t,new l(r,["/","-",":"]))),i.hovers&&e.push(o.registerHoverProvider(t,new h(r))),i.documentHighlights&&e.push(o.registerDocumentHighlightProvider(t,new c(r))),i.definitions&&e.push(o.registerDefinitionProvider(t,new u(r))),i.references&&e.push(o.registerReferenceProvider(t,new f(r))),i.documentSymbols&&e.push(o.registerDocumentSymbolProvider(t,new _(r))),i.rename&&e.push(o.registerRenameProvider(t,new w(r))),i.colors&&e.push(o.registerColorProvider(t,new k(r))),i.foldingRanges&&e.push(o.registerFoldingRangeProvider(t,new v(r))),i.diagnostics&&e.push(new D(t,r,s.onDidChange)),i.selectionRanges&&e.push(o.registerSelectionRangeProvider(t,new P(r))),i.documentFormattingEdits&&e.push(o.registerDocumentFormattingEditProvider(t,new R(r))),i.documentRangeFormattingEdits&&e.push(o.registerDocumentRangeFormattingEditProvider(t,new I(r)))}return m(),n.push(p(e)),p(n)}function p(s){return{dispose:()=>d(s)}}function d(s){for(;s.length;)s.pop().dispose()}export{l as CompletionAdapter,u as DefinitionAdapter,D as DiagnosticsAdapter,k as DocumentColorAdapter,R as DocumentFormattingEditProvider,c as DocumentHighlightAdapter,oe as DocumentLinkAdapter,I as DocumentRangeFormattingEditProvider,_ as DocumentSymbolAdapter,v as FoldingRangeAdapter,h as HoverAdapter,f as ReferenceAdapter,w as RenameAdapter,P as SelectionRangeAdapter,A as WorkerManager,se as fromPosition,ne as fromRange,te as setupMode,ae as toRange,pe as toTextEdit};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as L,u as J,r,p as S,j as e,l as x,aa as G,a3 as D}from"./index-D9kBRMR0.js";import{F as b}from"./use-projects-Cuv0A0RC.js";import{C as R}from"./chevron-right-pH923eYp.js";import{C as V}from"./circle-alert-oa-BQ5e7.js";import{C as F}from"./check-BN_PVKzE.js";const O=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],se=L("file",O);const Q=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],re=L("folder-plus",Q);function T(l,u="git"){return u==="directory"||l.isGitRepo?"select-and-browse":"browse"}function ae({value:l,onChange:u,validationMode:i="git",placeholder:I}){const{t:h}=J(),[o,P]=r.useState(""),[j,A]=r.useState([]),[y,B]=r.useState(""),[_,U]=r.useState("/"),[N,K]=r.useState([]),[W,k]=r.useState(!1),[v,C]=r.useState(null),[f,g]=r.useState(l),[w,c]=r.useState(null),[Z,z]=r.useState(!1),E=r.useRef(!1);r.useEffect(()=>{g(l)},[l]);const a=r.useCallback(async t=>{k(!0),C(null);try{const s={};t&&(s.path=t);const n=await S.get("/filesystem/browse",{params:s});P(n.current),B(n.parent),U(n.sep||"/"),A(n.dirs),n.drives&&K(n.drives)}catch(s){C(s instanceof Error?s.message:"Failed to browse directory")}finally{k(!1)}},[]);r.useEffect(()=>{E.current||(E.current=!0,a())},[a]);const d=r.useCallback(async t=>{if(g(t),i==="directory"){u(t),c(null);return}z(!0),c(null);try{const s=await S.get("/filesystem/validate",{params:{path:t}});s.valid&&s.isGitRepo!==!1?(u(t),c(null)):c(s.error??"Not a Git repository")}catch(s){c(s instanceof Error?s.message:"Validation failed")}finally{z(!1)}},[u,i]),$=r.useCallback(t=>{T(t,i)==="select-and-browse"?(d(t.path),a(t.path)):(a(t.path),c(null))},[d,a,i]),p=_==="\\",m=r.useMemo(()=>o?o.split(/[\\/]/).filter(Boolean):[],[o]),q=r.useCallback(t=>{const s=m.slice(0,t+1);let n;p?(n=s.join("\\"),s.length===1&&/^[A-Za-z]:$/.test(s[0])&&(n+="\\")):n="/"+s.join("/"),a(n),c(null)},[m,a,p]),H=r.useCallback(t=>{if(t.key==="Enter"&&!t.nativeEvent.isComposing&&t.nativeEvent.keyCode!==229){t.preventDefault();const s=f.trim();s&&(a(s),d(s))}},[f,a,d]);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",value:f,onChange:t=>g(t.target.value),onKeyDown:H,placeholder:I??"e.g., /Users/me/projects/my-repo",className:x("w-full px-3 py-2 border rounded-lg text-sm font-mono focus:outline-none transition-colors pr-8",l?"border-emerald-300 bg-emerald-50/50 focus:border-emerald-400":"border-neutral-200 focus:border-neutral-400")}),l&&(i==="git"?e.jsx(G,{size:14,className:"absolute right-3 top-1/2 -translate-y-1/2 text-emerald-500"}):e.jsx(b,{size:14,className:"absolute right-3 top-1/2 -translate-y-1/2 text-emerald-500"}))]}),e.jsx("p",{className:"text-xs text-neutral-400",children:h(i==="git"?"Browse and select a Git repository, or type a path and press Enter":"Browse and select a directory, or type a path and press Enter")}),N.length>0&&e.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:N.map(t=>e.jsx("button",{onClick:()=>{a(t),c(null)},className:x("px-2 py-0.5 rounded text-xs font-mono transition-colors border",o.toUpperCase().startsWith(t.toUpperCase())?"bg-neutral-900 text-white border-neutral-900":"border-neutral-200 text-neutral-600 hover:bg-neutral-100"),children:t.replace("\\","")},t))}),e.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-neutral-500 overflow-x-auto pb-1 scrollbar-none",children:[!p&&e.jsx("button",{onClick:()=>a("/"),className:"hover:text-neutral-900 transition-colors flex-shrink-0 px-1 py-0.5 rounded hover:bg-neutral-100",children:"/"}),m.map((t,s)=>e.jsxs("span",{className:"flex items-center gap-0.5 flex-shrink-0",children:[(p?s>0:!0)&&e.jsx(R,{size:10,className:"text-neutral-300"}),e.jsx("button",{onClick:()=>q(s),className:x("px-1 py-0.5 rounded transition-colors truncate max-w-[120px]",s===m.length-1?"font-medium text-neutral-900":"hover:text-neutral-900 hover:bg-neutral-100"),children:t})]},s))]}),e.jsx("div",{className:"border border-neutral-200 rounded-lg overflow-hidden",children:e.jsx("div",{className:"max-h-[200px] overflow-y-auto",children:W?e.jsxs("div",{className:"flex items-center justify-center py-8 text-neutral-400",children:[e.jsx(D,{size:16,className:"animate-spin mr-2"}),e.jsx("span",{className:"text-xs",children:"Loading..."})]}):v?e.jsxs("div",{className:"flex items-center justify-center py-8 text-red-500 gap-2",children:[e.jsx(V,{size:14}),e.jsx("span",{className:"text-xs",children:v})]}):j.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-neutral-400",children:[e.jsx("span",{className:"text-xs",children:"No subdirectories"}),i==="directory"&&o&&e.jsxs("button",{type:"button",onClick:()=>d(o),className:x("inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition-colors",o===l?"border-emerald-200 bg-emerald-50 text-emerald-700":"border-neutral-200 bg-white text-neutral-700 hover:bg-neutral-50"),children:[e.jsx(F,{size:13}),e.jsx("span",{children:h("Select Current")})]})]}):e.jsxs("ul",{className:"divide-y divide-neutral-100",children:[o!==y&&e.jsx("li",{children:e.jsxs("button",{onClick:()=>a(y),className:"w-full flex items-center gap-2.5 px-3 py-2 text-left hover:bg-neutral-50 transition-colors group",children:[e.jsx(b,{size:14,className:"text-neutral-400 flex-shrink-0"}),e.jsx("span",{className:"text-xs text-neutral-500 group-hover:text-neutral-700",children:".."})]})}),j.map(t=>e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>$(t),className:x("w-full flex items-center gap-2.5 px-3 py-2 text-left transition-colors group",t.path===l?"bg-emerald-50":"hover:bg-neutral-50"),children:[t.isGitRepo?e.jsx(G,{size:14,className:"text-emerald-500 flex-shrink-0"}):e.jsx(b,{size:14,className:"text-neutral-400 flex-shrink-0"}),e.jsx("span",{className:x("text-xs truncate",t.path===l?"font-medium text-emerald-700":"text-neutral-700 group-hover:text-neutral-900"),children:t.name}),t.isGitRepo&&e.jsx("span",{className:"ml-auto flex-shrink-0 text-[10px] font-medium bg-emerald-100 text-emerald-600 px-1.5 py-0.5 rounded",children:"Git"}),!t.isGitRepo&&i!=="directory"&&e.jsx(R,{size:12,className:"ml-auto text-neutral-300 group-hover:text-neutral-400 flex-shrink-0"}),!t.isGitRepo&&i==="directory"&&e.jsx(F,{size:12,className:x("ml-auto flex-shrink-0",t.path===l?"text-emerald-500":"text-neutral-300 group-hover:text-neutral-400")})]})},t.path))]})})}),Z&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[e.jsx(D,{size:12,className:"animate-spin"}),e.jsx("span",{children:"Validating..."})]}),w&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-red-500",children:[e.jsx(V,{size:12}),e.jsx("span",{children:w})]})]})}export{se as F,re as a,ae as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as t}from"./monaco-Bc-Z2u8N.js";import"./ProjectKanbanPage--cx6wNDR.js";import"./index-D9kBRMR0.js";import"./mermaid-NOHMQCX5-DWQaYVL0.js";import"./chevron-right-pH923eYp.js";import"./chevron-down-BQcW9sFf.js";import"./confirm-dialog-CRiC3xBd.js";import"./modal-Cymk-6Df.js";import"./Icons-DADUmnB1.js";import"./CreateTaskInput-B67vzMJD.js";import"./AgentLogo-BCwbooTN.js";import"./check-BN_PVKzE.js";import"./use-projects-Cuv0A0RC.js";import"./MemberAvatar-l-WCdlLA.js";import"./use-providers-DLcAY6E1.js";import"./trash-2-R46i6Uus.js";import"./useNormalizedLogs-tfxFAJOF.js";import"./folder-picker-WUhXxIM5.js";import"./circle-alert-oa-BQ5e7.js";import"./message-square-DxbkpGqF.js";import"./layers-Bo4aml98.js";import"./chevron-up-DyQW115F.js";import"./select-BpKQyMvD.js";import"./textarea-DjwjAAG8.js";import"./upload-CgWqsmdI.js";import"./arrow-left-CCWDjOmp.js";import"./copy-DaoAUKTO.js";const e=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],C={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[["<!--","-->"],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:t.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:t.IndentAction.Indent}}]},j={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/<!DOCTYPE/,"metatag.html","@doctype"],[/<!--/,"comment.html","@commentHtml"],[/(<)(\w+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/</,"delimiter.html"],[/\{/,"delimiter.html"],[/[^<{]+/]],doctype:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{C as conf,j as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as t}from"./monaco-Bc-Z2u8N.js";import"./ProjectKanbanPage--cx6wNDR.js";import"./index-D9kBRMR0.js";import"./mermaid-NOHMQCX5-DWQaYVL0.js";import"./chevron-right-pH923eYp.js";import"./chevron-down-BQcW9sFf.js";import"./confirm-dialog-CRiC3xBd.js";import"./modal-Cymk-6Df.js";import"./Icons-DADUmnB1.js";import"./CreateTaskInput-B67vzMJD.js";import"./AgentLogo-BCwbooTN.js";import"./check-BN_PVKzE.js";import"./use-projects-Cuv0A0RC.js";import"./MemberAvatar-l-WCdlLA.js";import"./use-providers-DLcAY6E1.js";import"./trash-2-R46i6Uus.js";import"./useNormalizedLogs-tfxFAJOF.js";import"./folder-picker-WUhXxIM5.js";import"./circle-alert-oa-BQ5e7.js";import"./message-square-DxbkpGqF.js";import"./layers-Bo4aml98.js";import"./chevron-up-DyQW115F.js";import"./select-BpKQyMvD.js";import"./textarea-DjwjAAG8.js";import"./upload-CgWqsmdI.js";import"./arrow-left-CCWDjOmp.js";import"./copy-DaoAUKTO.js";const e=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],j={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["<!--","-->"]},brackets:[["<!--","-->"],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${e.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:t.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${e.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:t.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*<!--\\s*#region\\b.*-->"),end:new RegExp("^\\s*<!--\\s*#endregion\\b.*-->")}}},P={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/<!DOCTYPE/,"metatag","@doctype"],[/<!--/,"comment","@comment"],[/(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/</,"delimiter"],[/[^<]+/]],doctype:[[/[^>]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"module"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/'module'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}};export{j as conf,P as language};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as D,l as t}from"./monaco-Bc-Z2u8N.js";import{H as d,D as m,h as l,F as p,b as c,S as u,c as h,f as w,g as _,C as R}from"./lspLanguageFeatures-Cbk7wEkj.js";import{a as ie,e as oe,d as ne,R as se,i as ae,j as ge,t as de,k as me}from"./lspLanguageFeatures-Cbk7wEkj.js";import"./ProjectKanbanPage--cx6wNDR.js";import"./index-D9kBRMR0.js";import"./mermaid-NOHMQCX5-DWQaYVL0.js";import"./chevron-right-pH923eYp.js";import"./chevron-down-BQcW9sFf.js";import"./confirm-dialog-CRiC3xBd.js";import"./modal-Cymk-6Df.js";import"./Icons-DADUmnB1.js";import"./CreateTaskInput-B67vzMJD.js";import"./AgentLogo-BCwbooTN.js";import"./check-BN_PVKzE.js";import"./use-projects-Cuv0A0RC.js";import"./MemberAvatar-l-WCdlLA.js";import"./use-providers-DLcAY6E1.js";import"./trash-2-R46i6Uus.js";import"./useNormalizedLogs-tfxFAJOF.js";import"./folder-picker-WUhXxIM5.js";import"./circle-alert-oa-BQ5e7.js";import"./message-square-DxbkpGqF.js";import"./layers-Bo4aml98.js";import"./chevron-up-DyQW115F.js";import"./select-BpKQyMvD.js";import"./textarea-DjwjAAG8.js";import"./upload-CgWqsmdI.js";import"./arrow-left-CCWDjOmp.js";import"./copy-DaoAUKTO.js";const I=120*1e3;class f{constructor(o){this._defaults=o,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>I&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=D({moduleId:"vs/language/html/htmlWorker",createWorker:()=>new Worker(new URL("/assets/html.worker-CwpTb9lJ.js",import.meta.url),{type:"module"}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...o){let e;return this._getClient().then(r=>{e=r}).then(r=>{if(this._worker)return this._worker.withSyncedResources(o)}).then(r=>e)}}class v extends R{constructor(o){super(o,[".",":","<",'"',"=","/"])}}function $(i){const o=new f(i),e=(...n)=>o.getLanguageServiceWorker(...n);let r=i.languageId;t.registerCompletionItemProvider(r,new v(e)),t.registerHoverProvider(r,new d(e)),t.registerDocumentHighlightProvider(r,new m(e)),t.registerLinkProvider(r,new l(e)),t.registerFoldingRangeProvider(r,new p(e)),t.registerDocumentSymbolProvider(r,new c(e)),t.registerSelectionRangeProvider(r,new u(e)),t.registerRenameProvider(r,new h(e)),r==="html"&&(t.registerDocumentFormattingEditProvider(r,new w(e)),t.registerDocumentRangeFormattingEditProvider(r,new _(e)))}function ee(i){const o=[],e=[],r=new f(i);o.push(r);const n=(...s)=>r.getLanguageServiceWorker(...s);function P(){const{languageId:s,modeConfiguration:a}=i;k(e),a.completionItems&&e.push(t.registerCompletionItemProvider(s,new v(n))),a.hovers&&e.push(t.registerHoverProvider(s,new d(n))),a.documentHighlights&&e.push(t.registerDocumentHighlightProvider(s,new m(n))),a.links&&e.push(t.registerLinkProvider(s,new l(n))),a.documentSymbols&&e.push(t.registerDocumentSymbolProvider(s,new c(n))),a.rename&&e.push(t.registerRenameProvider(s,new h(n))),a.foldingRanges&&e.push(t.registerFoldingRangeProvider(s,new p(n))),a.selectionRanges&&e.push(t.registerSelectionRangeProvider(s,new u(n))),a.documentFormattingEdits&&e.push(t.registerDocumentFormattingEditProvider(s,new w(n))),a.documentRangeFormattingEdits&&e.push(t.registerDocumentRangeFormattingEditProvider(s,new _(n)))}return P(),o.push(g(e)),g(o)}function g(i){return{dispose:()=>k(i)}}function k(i){for(;i.length;)i.pop().dispose()}export{R as CompletionAdapter,ie as DefinitionAdapter,oe as DiagnosticsAdapter,ne as DocumentColorAdapter,w as DocumentFormattingEditProvider,m as DocumentHighlightAdapter,l as DocumentLinkAdapter,_ as DocumentRangeFormattingEditProvider,c as DocumentSymbolAdapter,p as FoldingRangeAdapter,d as HoverAdapter,se as ReferenceAdapter,h as RenameAdapter,u as SelectionRangeAdapter,f as WorkerManager,ae as fromPosition,ge as fromRange,ee as setupMode,$ as setupMode1,de as toRange,me as toTextEdit};
|