@wular/coder 0.4.4 → 0.4.6
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/{add-DTwoL7vJ.js → add-BIp1t_pT.js} +1 -1
- package/dist/{add-cdKdz3K0.js → add-CKENklTr.js} +1 -1
- package/dist/{add-Bffwutko.js → add-DrbKvzAF.js} +1 -1
- package/dist/{add-Bz8uaOcu.js → add-KkLx1WbE.js} +1 -1
- package/dist/{add-json-BIcbE3Nf.js → add-json-GHTfZV_U.js} +1 -1
- package/dist/{agent-DQK_S1PE.js → agent-CR8UFMa-.js} +1 -1
- package/dist/{agent-BcXXkOmD.js → agent-D0pQ_ewc.js} +1 -1
- package/dist/{alias-KQ85bphl.js → alias--pfI-nvH.js} +1 -1
- package/dist/{app-DaccLHrx.js → app-C7sw1ZkI.js} +1 -1
- package/dist/{approvals-CZt_aPCy.js → approvals-9-G-QxOy.js} +1 -1
- package/dist/{approve-DxjyXd66.js → approve-CAk8qPqG.js} +1 -1
- package/dist/{apps-eueTmHR5.js → apps-CaHoLNE7.js} +1 -1
- package/dist/{archive-C3JazQuo.js → archive-Ylxh0HIl.js} +1 -1
- package/dist/{archive-C9yrU4Wg.js → archive-fs5RjYHc.js} +1 -1
- package/dist/{archive-sweep-CHbOP-p6.js → archive-sweep-BrqWj4kr.js} +1 -1
- package/dist/{ask-DdYrvsTk.js → ask-Dmk0HGtI.js} +1 -1
- package/dist/{auth-q8CROpG-.js → auth-CS0cH0gq.js} +1 -1
- package/dist/auth-cZ0FrkBv.js +1 -0
- package/dist/{cli-msOzZFXW.js → cli-IfrPgeYz.js} +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/dist/{config-BllYHi8S.js → config-Duf8jCkd.js} +1 -1
- package/dist/{create-BYki3g42.js → create-Ik613gJw.js} +1 -1
- package/dist/credentials-Dxpb5jCT.js +1 -0
- package/dist/dash/standalone/server/manifest.json +774 -774
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/agents/(list)/page.8f85fbaff456c5fe.js +2 -2
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/agents/[slug]/(tabs)/layout.d3aec63db0f5230d.js +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/agents/[slug]/(tabs)/page.7fd1bfcf08e25919.js +2 -2
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/agents/[slug]/(tabs)/platforms/page.31687af871d75d39.js +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/agents/[slug]/(tabs)/settings/page.1ed5379637860fab.js +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/agents/[slug]/edit/page.1798dbd9cd334e8f.js +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/agents/new/page.44f60b1a32344f70.js +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/settings/[tab]/credentials.6423846391b20446.js +2 -2
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/settings/[tab]/page.04b07f9c365be073.js +4 -4
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/tasks/[id]/page.d1ded90712ca586f.js +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/tasks/list/tasks-list.9698bdff71c3b3c7.js +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/tasks/list/tasks-section.c77194f05c3f58fb.js +1 -1
- package/dist/dash/standalone/static/assets/chunks/{agent-pills-9f0b2f5ae78f8034.js → agent-pills-65087e563e7f928c.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{agent-settings-form-8b9eb7a50b6353c8.js → agent-settings-form-51f5d16c5b35b0c4.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{agents-grid-ec0a1369f485e044.js → agents-grid-8d8fb47aa05c1022.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{badge-97931d920966447a.js → badge-b8e1e1429e8418e8.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{card-a390b476c49de404.js → card-abb16544e8e5a5e0.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{combo-0c5bac507d410ec8.js → combo-0feaff3c2ab55606.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{composer-2c92fc6e47ca91ca.js → composer-08a1aad17120af8a.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/composer-261cde2206340a07.js +1 -0
- package/dist/dash/standalone/static/assets/chunks/{confirm-a7e97c1e3e7b1d98.js → confirm-d804955ec454f00f.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{connect-apps-70717f2cb7ae1e00.js → connect-apps-c4b8fc9d3a25e545.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{connect-repositories-6edbbdd3d805d960.js → connect-repositories-2cf520006ed18949.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{credentials-list-c59af917890a58af.js → credentials-list-a1b81c1b630a8415.js} +2 -2
- package/dist/dash/standalone/static/assets/chunks/{custom-range-80abdcdffdfe237f.js → custom-range-79011164d1e2529c.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{editor-40545d274265dd1a.js → editor-b86137d54feb4ba1.js} +4 -4
- package/dist/dash/standalone/static/assets/chunks/{engines-list-7aaf3d15897cb0aa.js → engines-list-0cf0dd6427e45add.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{field-b36938a3bc00cd3f.js → field-329f272ef3edae30.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{filter-c0ae37317df5452c.js → filter-673d0e6dbc95293c.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{heads-bdff7195a22cb2bd.js → heads-bdb3900291e3ba2c.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{instructions-5d6b6a16fc5275a6.js → instructions-7f289881a4d96d85.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/instructions-c175184f89172c15.js +1 -0
- package/dist/dash/standalone/static/assets/chunks/{list-d0b7c0b48892cfe6.js → list-074a086ab5e19d77.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{mcp-list-25126d98a226b790.js → mcp-list-c97f883efa3f7d03.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{models-list-6dfcd14261a538f5.js → models-list-3f869a70740e4244.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{platform-actions-b8a76b633d3d5ffc.js → platform-actions-b317343915219089.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{runners-list-6723c3760642534a.js → runners-list-33a7339bd7cb3e18.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{segmented-1155c44ecf78eec1.js → segmented-c9d58f98a7d32b4d.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{select-dfbd5abe28b9ac3b.js → select-f4ea2f12a2298e4a.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{sentinel-4c64ec1196343d0e.js → sentinel-9e882d8ad784d4bd.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/shared-init-bee5eaed36ee3dc4.js +5 -0
- package/dist/dash/standalone/static/assets/chunks/{shared-init-d2e3dd1b398d7232.js → shared-init-cf66e1c1a2f30ef1.js} +2 -2
- package/dist/dash/standalone/static/assets/chunks/{tail-3e63ab86a13c8c38.js → tail-5a5f739bca637202.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{task-actions-a8e0042e51f40a41.js → task-actions-37ed047ca8c5b129.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{task-view-9da31d3338604fed.js → task-view-efe402c64d6a3c9b.js} +4 -4
- package/dist/dash/standalone/static/assets/chunks/{tasks-list-07e674d269ecdf31.js → tasks-list-eae2a32d61b437c5.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{toolbar-7e424f4c5bb3db9a.js → toolbar-7aee851cfcc688cc.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{versions-list-714c7f458a9370fc.js → versions-list-836e397952b5d251.js} +1 -1
- package/dist/dash/standalone/static/assets/pnext-client-00c2425020b8564c.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-091090fd50a6c9cd.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-0b8b6a688cfb5246.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-0cc2ff4668470e6f.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-11f56cbcfd2a3fca.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-146cb2e293fd710e.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-1cdaef1ffee188d4.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-3298ffa52f79e244.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-415baafb72caaf21.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-50de47aa1f3aed6f.js +1 -0
- package/dist/dash/standalone/static/assets/{pnext-client-4f5740d5c6a84a21.js → pnext-client-802be87d22e144c4.js} +1 -1
- package/dist/dash/standalone/static/assets/pnext-client-9ec55ee4d6315657.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-9fb279f4c6135368.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-a543b7bfddcdae35.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-a9f7e73b9a3252b9.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-e9f4f42456943129.js +1 -0
- package/dist/{default-aLeIO8IR.js → default-BfXXngYf.js} +1 -1
- package/dist/{default-fMaQH1wm.js → default-zMKQ15xH.js} +1 -1
- package/dist/{delete-Cj16PYaw.js → delete-BbsEN7tF.js} +1 -1
- package/dist/{delete-DNj3leWA.js → delete-CZuI4sJi.js} +1 -1
- package/dist/{disable-CQg5Vybq.js → disable-B860lJDh.js} +1 -1
- package/dist/{discover-bVM8EJEz.js → discover-tM_915iZ.js} +1 -1
- package/dist/{docs-CqeYenUp.js → docs-BdmVTydv.js} +1 -1
- package/dist/{enable-8m3z7i3i.js → enable-DD4OsTnA.js} +1 -1
- package/dist/flow/index.d.ts +1 -1
- package/dist/{flow-DeCL3x2p.js → flow-DwhBWoSx.js} +1 -1
- package/dist/{index-Xe8n_t2Z.d.ts → index-JcLiq1ac.d.ts} +1 -1
- package/dist/{init-BujliQ7q.js → init-Bo3RS_va.js} +1 -1
- package/dist/integrations-CstFKLTr.js +1 -0
- package/dist/{list-QLTjk5SN.js → list-Bu1S3hPM.js} +1 -1
- package/dist/{list-CXu4cr8D.js → list-CLVoliXi.js} +1 -1
- package/dist/{list-BdiYneg5.js → list-DWeYdLMU.js} +1 -1
- package/dist/{list-DbY1jyj3.js → list-DYzczkQZ.js} +2 -2
- package/dist/{list-DhVfqr0A.js → list-DaQ14K1K.js} +1 -1
- package/dist/{list-DGoVY-ao.js → list-DhJOorrE.js} +1 -1
- package/dist/{list-DyqtSWvn.js → list-Motuarjd.js} +1 -1
- package/dist/{list-vKOTwd4G.js → list-P1Zi9bhT.js} +1 -1
- package/dist/{login-otJB9SYu.js → login-C-VTh_6i.js} +1 -1
- package/dist/{login-BzdlmD_o.js → login-KHrM3MI3.js} +1 -1
- package/dist/{logout-DOrRoxDV.js → logout-CqUKg0lc.js} +1 -1
- package/dist/{maintenance-Bg_FzXSq.js → maintenance-CVfHIraw.js} +1 -1
- package/dist/{mcp-xSvAWiXX.js → mcp-DCydEehH.js} +1 -1
- package/dist/{migrate-CN-fdMV9.js → migrate-DPprwsbm.js} +1 -1
- package/dist/{model-BJ-Sokha.js → model-_e9f9Oth.js} +1 -1
- package/dist/{push-Cg7-XT5h.js → push-HLTHyhsP.js} +1 -1
- package/dist/{queue-yo-Z8TaE.js → queue-EvplGOuk.js} +2 -2
- package/dist/refresh-ZbMy3Y9T.js +1 -0
- package/dist/{remove-DgMg_OOu.js → remove-B6PskfkD.js} +1 -1
- package/dist/{remove-BuaShRZ3.js → remove-CC7UyWNI.js} +1 -1
- package/dist/{remove-C8Rm8KP-.js → remove-CWd4Qs4F.js} +1 -1
- package/dist/{remove-CcMma1x3.js → remove-CZmO4BSd.js} +1 -1
- package/dist/{rename-C0vNcl8e.js → rename-ODyRelrw.js} +1 -1
- package/dist/{result-C6ovl_Dn.js → result-CRIAetqH.js} +1 -1
- package/dist/{result-oQey_hdw.js → result-DtXZusqj.js} +1 -1
- package/dist/{resume-T_TXWfqE.js → resume-CI-swBxa.js} +1 -1
- package/dist/{review-CCs6XUSO.js → review-IRsckIiU.js} +1 -1
- package/dist/{rotate-key-CYimsQR5.js → rotate-key-CmvHXXnp.js} +1 -1
- package/dist/{run-BFYg-zZt.js → run-Dd9HdNSL.js} +1 -1
- package/dist/{run-D7F7JPV6.js → run-FYA9XIij.js} +1 -1
- package/dist/{run-hiPyO7js.js → run-IWXjB5OD.js} +1 -1
- package/dist/runner-CbDswgji.js +1 -0
- package/dist/sdk.d.ts +2 -2
- package/dist/sdk.js +1 -1
- package/dist/{serve-C-AD60Wa.js → serve-CML2mkKG.js} +1 -1
- package/dist/{serve-BgGXjT_O.js → serve-CY46ohfr.js} +1 -1
- package/dist/{serve-GIK3fqKA.js → serve-D_XiZzYd.js} +2 -2
- package/dist/{serve-K3BVTcDI.js → serve-t38OrDrk.js} +2 -2
- package/dist/{server-DQTGc55C.js → server-83YZ2Kkh.js} +1 -1
- package/dist/{setup-host-By8-gv_v.js → setup-host-DRuUX8zg.js} +1 -1
- package/dist/{shared-TznJgMFW.js → shared-D64pQ0XU.js} +1 -1
- package/dist/{show-C9ojrH5W.js → show-DlKWR0Hy.js} +1 -1
- package/dist/{show-o4yXzSWZ.js → show-aCUICSoc.js} +1 -1
- package/dist/{status-BBW7Qyde.js → status-C09SKASS.js} +1 -1
- package/dist/{steer-D47cuggj.js → steer-BGKYpW4T.js} +1 -1
- package/dist/{stop-CD2JW6dI.js → stop-CiAJVnU2.js} +1 -1
- package/dist/{stop-7brPdki9.js → stop-svJYkhTt.js} +1 -1
- package/dist/{store-BCBTo0rl.js → store-B0RLMUR9.js} +1 -1
- package/dist/{store-qp7UE2ES.js → store-Cxc2GYyj.js} +2 -2
- package/dist/{task-CyrDqqf8.js → task-DvPkqHCF.js} +1 -1
- package/dist/{test-BcFQUHRo.js → test-9FHRw5Jc.js} +1 -1
- package/dist/{tools-D20XYPnO.js → tools-DhlrB8xV.js} +1 -1
- package/dist/{types-DMGBYB_K.d.ts → types-CdIo1Zbm.d.ts} +2 -2
- package/dist/{unalias-G3sM8fVw.js → unalias-D6UESHzK.js} +1 -1
- package/dist/{update-JvgB6Xws.js → update-DTYOhoQC.js} +1 -1
- package/dist/{upgrade-DN3hXDdo.js → upgrade-BOYs5Vyi.js} +2 -2
- package/dist/{usage-C1oN2W9c.js → usage-BlT_poNA.js} +1 -1
- package/dist/{usage-DR3wWtYD.js → usage-Bw7fQeFC.js} +1 -1
- package/dist/{watch-DDmHonTf.js → watch-BlGYjH88.js} +1 -1
- package/dist/{watch-DYkC6Q2q.js → watch-Y82ubvGH.js} +1 -1
- package/dist/{worker-CaNTsqcD.js → worker-4TKVAB01.js} +1 -1
- package/dist/{workflow-7rqzHHWZ.js → workflow-Mi1OCrOI.js} +1 -1
- package/package.json +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
- package/dist/auth-FTKev9__.js +0 -1
- package/dist/credentials-DLMuf9OT.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/composer-e73a0b422a64d24b.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/instructions-439881899f58791f.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/shared-init-66a0fdc8472e9b2f.js +0 -5
- package/dist/dash/standalone/static/assets/pnext-client-0d42268f5239b3d5.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-0f7a0ab40127bf71.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-19cd968a8d93b747.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-34bb66f5f37ae387.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-4f02d1eb5fdd8301.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-5398aea4b83e1bd3.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-6a3da44efd3d46e0.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-6c93bd1923a32212.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-76bea765346a5ac5.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-8a37985a7a1612d0.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-9849ecdcc3e58c7a.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-b7e97e8b42c8b547.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-cf0e73abe71d8cf4.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-d0c44499e53177b1.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-dca2adeac8045fa7.js +0 -1
- package/dist/integrations-6kXL9hRo.js +0 -1
- package/dist/refresh-CmBQALAW.js +0 -1
- package/dist/runner-D5jaEfhG.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use client";import{a as j}from"./segmented-
|
|
1
|
+
"use client";import{a as j}from"./segmented-c9d58f98a7d32b4d.js";import{a as xe,c as oe,d as Le}from"./heads-bdb3900291e3ba2c.js";import{a as Ee,b as Ae,c as Te}from"./agent-pills-65087e563e7f928c.js";import{c as U}from"./toolbar-7aee851cfcc688cc.js";import{a as se}from"./paged-3ddb6077bef42752.js";import{a as ne}from"./badge-b8e1e1429e8418e8.js";import{b as Oe}from"./instructions-7f289881a4d96d85.js";import{a as Ce}from"./connect-repositories-2cf520006ed18949.js";import{c as ee,e as te,f as Se,g as Ie,h as Re,i as Pe}from"./model-options-15c53331a2f28a4f.js";import{a as ke}from"./select-f4ea2f12a2298e4a.js";import{a as Z,c as K}from"./card-abb16544e8e5a5e0.js";import{a as A,b as $}from"./field-329f272ef3edae30.js";import{f as H,g as D}from"./format-b19b8eec331414f4.js";import{a as we}from"./sentinel-9e882d8ad784d4bd.js";import{$6a as W}from"./shared-init-cf66e1c1a2f30ef1.js";import"./wular-pnext-37175329f2865f15-0.js";import{$1a as ye}from"./shared-init-cf66e1c1a2f30ef1.js";import"./shared-init-cf66e1c1a2f30ef1.js";import{$4e as X,$4m as _,$4r as be,$4u as ve}from"./shared-init-cf66e1c1a2f30ef1.js";import{$2a as T}from"./shared-init-bee5eaed36ee3dc4.js";import{$1b as q}from"./shared-init-bee5eaed36ee3dc4.js";import{$0a as e}from"./shared-init-bee5eaed36ee3dc4.js";import"./shared-init-37175329f2865f15-2.js";import"./shared-init-37175329f2865f15-2.js";import{$1c as E,$1g as y,$1i as B}from"./shared-init-8f2ac936c95a7f7b.js";function De({agent:s,actions:o,back:c}){return e(E,{children:[e(we,{}),e("header",{class:"hero",children:[e("span",{class:"hero-mark",children:H(s.name)}),e("div",{class:"grow",children:[c,e("div",{class:"title-row",children:[e("h1",{children:s.name}),e(Te,{agent:s})]}),e("p",{class:"lead",children:s.description??"No description yet."})]}),o?e("div",{class:"actions",children:o}):null]})]})}function Ne({port:s}){return e(Z,{title:"Receive platform events",children:e("div",{class:"guide",children:[e("p",{children:["Platforms reach this server through a public address. Expose port ",s," with one of these."]}),e("ul",{class:"steps-list",children:[e("li",{children:e("code",{children:["ngrok http ",s]})}),e("li",{children:e("code",{children:["cloudflared tunnel --url http://localhost:",s]})}),e("li",{children:"VS Code's Ports panel, with the port's visibility set to Public"})]}),e("p",{children:["Then restart with ",e("code",{children:"PUBLIC_URL=<tunnel URL> coder server serve"}),". The tunnel serves only webhooks and app setup, never this dashboard."]})]})})}var $e=/^[\w.-]+\/[\w.-]+$/,nt=s=>/^[0-9a-f]{12,}$/i.test(s)?s.slice(0,7):s;function ot({preview:s,onDone:o}){let[c,l]=y(new Set),[f,i]=y(!1),[b,g]=y("");if(B(()=>l(new Set),[s.repo]),s.error)return e($,{value:s.error});if(!s.agents)return e(K,{label:`Reading ${s.repo}`,h:180});if(!s.agents.length)return e("p",{class:"muted",children:[s.repo," has no agents yet. Add a folder per agent under ",e("code",{children:".coder/agents"}),", with an ",e("code",{children:"agent.json"})," and a ",e("code",{children:"system.md"}),"."]});let w=s.agents.filter(p=>!p.taken&&!c.has(p.id)).map(p=>p.id);return e("form",{class:"import-agents",onSubmit:async p=>{if(p.preventDefault(),!!w.length){i(!0),g("");try{let{imported:k}=await q.agents.import(s.repo,void 0,w);o(k)}catch(k){i(!1),g(D(k))}}},children:[e("ul",{class:"picks-list",children:s.agents.map(p=>e("li",{children:e("label",{class:"check",children:[e("input",{type:"checkbox",checked:!p.taken&&!c.has(p.id),disabled:p.taken,onChange:k=>{let S=new Set(c);k.currentTarget.checked?S.delete(p.id):S.add(p.id),l(S)}}),e("span",{children:[e("b",{children:p.name})," ",e("span",{class:"id",children:p.id}),p.version?e("span",{class:"badge",children:["v",p.version,p.commit?` \xB7 ${nt(p.commit)}`:""]}):null,e("small",{children:p.taken?"An agent with this id already exists here.":p.description??"No description."})]})]})},p.id))}),e("p",{class:"muted",children:["Each push to ",s.repo," that changes an agent publishes its new version here."]}),e("div",{class:"form-actions end",children:[e($,{value:b}),e("button",{class:"btn",disabled:f||!w.length,children:["Import ",w.length===1?"1 agent":`${w.length} agents`]})]})]})}function qe({connected:s,connectLabel:o,tunnel:c,port:l}){let f=W(),[i,b]=y(),[g,w]=y(""),[p,k]=y(),[S,v]=y("");B(()=>{s&&q.repositories.list().then(se(performance.now())).then(d=>b(d.map(P=>P.repo))).catch(d=>{b([]),v(D(d))})},[]);let R=d=>{k({repo:d}),q.agents.preview(d).then(se(performance.now())).then(({agents:P})=>k(L=>L?.repo===d?{repo:d,agents:P}:L)).catch(P=>k(L=>L?.repo===d?{repo:d,error:D(P)}:L))},V=d=>d.length===1?f.push("/dash/agents/[slug]",{params:{slug:d[0]}}):f.push("/dash/agents"),n=g.trim().toLowerCase(),C=(i??[]).filter(d=>d.toLowerCase().includes(n)),x=$e.test(g.trim())&&!i?.includes(g.trim())?g.trim():"";return e("div",{class:"import",children:[e("div",{class:"import-repos",children:[s?e(U,{value:g,label:"Search repositories or type owner/repo",onInput:w}):e(E,{children:[e("div",{class:"notice soft",children:[e(T,{d:_}),e("span",{class:"grow",children:"Connect to list your repositories here."}),e("button",{type:"button",class:"btn outline sm",onClick:()=>void Ce("/dash/agents/new?template=import").catch(d=>v(D(d))),children:o})]}),e("form",{class:"with-btn",onSubmit:d=>{d.preventDefault(),$e.test(g.trim())&&R(g.trim())},children:[e("input",{class:"mono","aria-label":"Repository",placeholder:"owner/repo",autocomplete:"off",value:g,onInput:d=>w(d.currentTarget.value)}),e("button",{class:"btn outline",children:"Look up"})]})]}),e($,{value:S}),s?e("div",{class:"repo-list scroll-box",role:"list",children:i?e(E,{children:[x?e("button",{type:"button",class:"pop-item","aria-pressed":p?.repo===x,onClick:()=>R(x),children:[e(T,{d:_}),e("span",{class:"grow",children:x})]}):null,C.map(d=>e("button",{type:"button",class:"pop-item","aria-pressed":p?.repo===d,onClick:()=>R(d),children:[e(T,{d:_}),e("span",{class:"grow",children:d})]},d)),!C.length&&!x?e("p",{class:"pop-note",children:"No repository matches. Type owner/repo to use another."}):null]}):e(K,{label:"Loading repositories",h:240})}):null,!s&&c?e(Ne,{port:l}):null]}),e("div",{class:"import-preview",children:p?e(E,{children:[e("h3",{children:["Agents in ",p.repo]}),e(ot,{preview:p,onDone:V})]}):e("p",{class:"muted",children:"Pick a repository to see the agents in its .coder/agents folder."})})]})}var Be=[["Brisk","Calm","Clever","Keen","Nimble","Quiet","Steady","Swift","Tidy","Bright","Patient","Lucky"],["Heron","Otter","Falcon","Lynx","Badger","Relay","Beacon","Compass","Lantern","Pilot","Sparrow","Harbor"]],je=s=>s[Math.floor(Math.random()*s.length)],Fe=()=>`${je(Be[0])} ${je(Be[1])}`;var Me=[["read-only","Read only"],["workspace-write","Edit files"],["auto","Auto"]],rt={"read-only":"reads the repository and changes nothing","workspace-write":"edits files inside the repository",auto:"edits files, reaches the network, and asks when it needs more"},it=[["low","Low"],["medium","Medium"],["high","High"]],F=["observe","comment","write"],He={observe:["Observe","reads the platform only"],comment:["Comment","also replies and reacts"],write:["Write","also changes code there, like opening pull requests"]},at=[["blank","Blank","start from nothing"],["helper","Slack helper","answers questions in chat"],["reviewer","Reviewer","reviews pull requests"]],lt=6,ct=`Review each pull request for bugs, risky changes and missing tests.
|
|
2
2
|
Comment on the lines that matter and keep it short.
|
|
3
3
|
When mentioned, answer questions about the code and cite file paths.`,pt=`Answer the team's questions in the thread.
|
|
4
4
|
Read the code before you answer, cite file paths, and say when you are unsure.
|
|
5
|
-
If asked to change code, describe the change and stop.`,dt={mention:"replies to @mentions",pull_request:"reviews pull requests",issue:"triages issues",comment:"reads comments",message:"reads messages",reaction:"answers reactions",command:"runs slash commands"},mt=s=>Array.isArray(s)?s.map(String):s&&typeof s=="object"?Object.keys(s):[],We=s=>s.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);function ut(s,o){let c=s?.definition,l={name:s?.name??o,id:s?.id??We(o),description:s?.description??c?.description??"",platforms:[],events:{},match:{},tools:{},permissions:c?.permissions??"read-only",systemPrompt:s?.systemPrompt??"",engine:c?.engine??"",model:c?.model??"",effort:c?.effort??""};for(let[f,i]of Object.entries(c?.integrations??{})){if(l.platforms.push(f),l.events[f]=mt(i.triggers),l.match[f]={},i.triggers&&!Array.isArray(i.triggers))for(let[b,g]of Object.entries(i.triggers))g&&typeof g=="object"&&"match"in g&&(l.match[f][b]=String(g.match));l.tools[f]=i.tools}return l}var Ke=s=>Object.entries(s?.events??{}).filter(([,o])=>!o.noisy).map(([o])=>o);function _e(s,o){let c=l=>{let f=o.filter(l).map(i=>i.id);return{platforms:f,events:Object.fromEntries(f.map(i=>[i,Ke(o.find(b=>b.id===i))])),tools:Object.fromEntries(f.map(i=>[i,"comment"])),match:{}}};return s==="reviewer"?{...c(l=>"pull_request"in l.events),description:"Reviews pull requests and answers questions about the code.",systemPrompt:ct}:s==="helper"?{...c(l=>l.id==="slack"),description:"Answers the team's questions in chat.",systemPrompt:pt}:{platforms:[],events:{},tools:{},match:{},description:"",systemPrompt:""}}function ft(s,o,c){let l=s?.triggers&&!Array.isArray(s.triggers)?s.triggers:{},f=Object.fromEntries(o.map(i=>{let b=l[i],g=c[i]?.trim(),w=b&&typeof b=="object"?{...b}:{};return g?w.match=g:delete w.match,Object.keys(w).length?[i,w]:[i,b===void 0||typeof b=="object"?!0:b]}));return Object.values(f).every(i=>i===!0)?o:f}function gt(s){let o=s.platforms.filter(l=>s.events[l]?.length).map(l=>`${s.events[l].map(f=>dt[f]??f.replace(/_/g," ")).join(" and ")} in ${l}`),c=o.length?o.join(", "):"runs from the dashboard and the CLI";return`${c.charAt(0).toUpperCase()}${c.slice(1)}.`}var ht=(s=[],o=[])=>s.length===o.length&&s.every(c=>o.includes(c));function bt(s){if(!s)return[];let o=F.filter((c,l)=>!l||!ht(s.presets[c],s.presets[F[l-1]]));return o.length>1?o:[]}var vt=(s,o)=>s.filter(c=>F.indexOf(c)<=F.indexOf(o)).at(-1)??"";function $s({catalog:s,agent:o,suggested:c="",section:l,models:f,defaults:i={engine:"",engines:{},builtin:{}},template:b,connected:g=!1,connectLabel:w="Connect",tunnel:p=!1,port:k=""}){let S=
|
|
6
|
-
`,...a?{name:a}:{},...n.description.trim()?{description:n.description.trim()}:{}}),v&&n.platforms.length?S.push("/dash/agents/[slug]/platforms",{params:{slug:h}}):S.push("/dash/agents/[slug]",{params:{slug:h}})}catch(u){ie(!1),z(D(u))}},ue=e(E,{children:[e($,{value:ze}),v?e("button",{type:"button",class:"btn outline","aria-pressed":R==="import",onClick:()=>de("import"),children:"Import from repo"}):null,v?null:e(
|
|
7
|
-
You answer questions about acme/app from its source. Cite file paths.`,value:n.systemPrompt,onInput:t=>N("systemPrompt",t.currentTarget.value)}):e("div",{class:"body md md-preview",children:n.systemPrompt.trim()?Oe(n.systemPrompt):e("p",{class:"muted",children:"Nothing written yet."})})]}),e("section",{id:"agent-platforms",class:"form-part",children:[e("div",{class:"part-head",onKeyDown:t=>t.key==="Enter"&&t.preventDefault(),children:[e("h2",{children:"Where it listens"}),s.length>lt?e(U,{value:re,label:"Search platforms",onInput:Ue}):null]}),e("p",{class:"muted",children:"Each platform becomes an app, set up on the next page. With none it runs from the dashboard and the CLI."}),e("ul",{class:"listen",children:[he.map(t=>{let r=n.platforms.includes(t.id),m=n.events[t.id]??[],h=Object.entries(t.events);return e("li",{class:r?"on":void 0,children:[e("label",{class:"listen-row",children:[e("span",{class:"pf-mark","aria-hidden":"true",children:e(Ee,{brand:t.brand})}),e("span",{class:"grow",children:[e("b",{children:t.name}),e("small",{title:t.description,children:t.description})]}),e("input",{type:"checkbox",role:"switch",class:"switch",name:"platform",value:t.id,checked:r,onChange:a=>Xe(t.id,a.currentTarget.checked)})]}),r?e("div",{class:"triggers",children:[e("div",{class:"chips",role:"group","aria-label":`What wakes it on ${t.id}`,children:h.map(([a,u])=>{let O=m.includes(a);return e("button",{type:"button",class:"chip","aria-pressed":O,title:u.description,onClick:()=>Ze(t.id,a,!O),children:a.replace(/_/g," ")},a)})}),h.filter(([a,u])=>u.noisy&&m.includes(a)).map(([a])=>e("label",{class:"match",children:[e("span",{children:a.replace(/_/g," ")}),e("input",{class:"mono",name:`match:${t.id}:${a}`,placeholder:"only when the text matches, like ^help\\b","aria-label":`Text filter for ${a} on ${t.id}`,value:n.match[t.id]?.[a]??"",onInput:u=>et(t.id,a,u.currentTarget.value)})]},a))]}):null]},t.id)}),he.length?null:e("li",{class:"listen-none muted",children:"No platform matches."})]}),Y.length?e(A,{label:"Platform access",hint:He[ce]?.[1]??"differs between platforms",group:!0,children:e(j,{label:"Platform access",options:Y.map(t=>[t,He[t][0]]),value:ce,onChange:t=>N("tools",Object.fromEntries(n.platforms.map(r=>[r,t])))})}):null]}),e("details",{id:"agent-run",class:"form-part run",open:l==="run",children:[e("summary",{children:[e("h2",{children:"Run settings"}),e("span",{class:"grow muted",children:Je}),e(T,{d:X})]}),e("div",{class:"run-body",children:[e("div",{class:"fields",children:[e(A,{label:"Engine and model",hint:"what runs each task",group:!0,children:e(ke,{label:"Model",value:Ie(n.engine,n.model),options:Se(f,te(Qe)),headings:Pe(f),action:{label:"Add models",icon:
|
|
5
|
+
If asked to change code, describe the change and stop.`,dt={mention:"replies to @mentions",pull_request:"reviews pull requests",issue:"triages issues",comment:"reads comments",message:"reads messages",reaction:"answers reactions",command:"runs slash commands"},mt=s=>Array.isArray(s)?s.map(String):s&&typeof s=="object"?Object.keys(s):[],We=s=>s.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);function ut(s,o){let c=s?.definition,l={name:s?.name??o,id:s?.id??We(o),description:s?.description??c?.description??"",platforms:[],events:{},match:{},tools:{},permissions:c?.permissions??"read-only",systemPrompt:s?.systemPrompt??"",engine:c?.engine??"",model:c?.model??"",effort:c?.effort??""};for(let[f,i]of Object.entries(c?.integrations??{})){if(l.platforms.push(f),l.events[f]=mt(i.triggers),l.match[f]={},i.triggers&&!Array.isArray(i.triggers))for(let[b,g]of Object.entries(i.triggers))g&&typeof g=="object"&&"match"in g&&(l.match[f][b]=String(g.match));l.tools[f]=i.tools}return l}var Ke=s=>Object.entries(s?.events??{}).filter(([,o])=>!o.noisy).map(([o])=>o);function _e(s,o){let c=l=>{let f=o.filter(l).map(i=>i.id);return{platforms:f,events:Object.fromEntries(f.map(i=>[i,Ke(o.find(b=>b.id===i))])),tools:Object.fromEntries(f.map(i=>[i,"comment"])),match:{}}};return s==="reviewer"?{...c(l=>"pull_request"in l.events),description:"Reviews pull requests and answers questions about the code.",systemPrompt:ct}:s==="helper"?{...c(l=>l.id==="slack"),description:"Answers the team's questions in chat.",systemPrompt:pt}:{platforms:[],events:{},tools:{},match:{},description:"",systemPrompt:""}}function ft(s,o,c){let l=s?.triggers&&!Array.isArray(s.triggers)?s.triggers:{},f=Object.fromEntries(o.map(i=>{let b=l[i],g=c[i]?.trim(),w=b&&typeof b=="object"?{...b}:{};return g?w.match=g:delete w.match,Object.keys(w).length?[i,w]:[i,b===void 0||typeof b=="object"?!0:b]}));return Object.values(f).every(i=>i===!0)?o:f}function gt(s){let o=s.platforms.filter(l=>s.events[l]?.length).map(l=>`${s.events[l].map(f=>dt[f]??f.replace(/_/g," ")).join(" and ")} in ${l}`),c=o.length?o.join(", "):"runs from the dashboard and the CLI";return`${c.charAt(0).toUpperCase()}${c.slice(1)}.`}var ht=(s=[],o=[])=>s.length===o.length&&s.every(c=>o.includes(c));function bt(s){if(!s)return[];let o=F.filter((c,l)=>!l||!ht(s.presets[c],s.presets[F[l-1]]));return o.length>1?o:[]}var vt=(s,o)=>s.filter(c=>F.indexOf(c)<=F.indexOf(o)).at(-1)??"";function $s({catalog:s,agent:o,suggested:c="",section:l,models:f,defaults:i={engine:"",engines:{},builtin:{}},template:b,connected:g=!1,connectLabel:w="Connect",tunnel:p=!1,port:k=""}){let S=W(),v=!o,[R,V]=y(b??"blank"),[n,C]=y(()=>({...ut(o,c),...v?_e(b??"blank",s):{}})),[x,d]=y(!1),[P,L]=y("write"),[re,Ue]=y(""),[Ve,ie]=y(!1),[ze,z]=y(""),N=(t,r)=>C(m=>({...m,[t]:r})),G=(t,r=n.tools[t])=>Array.isArray(r)?"custom":r??"observe",Q=n.platforms.length?G(n.platforms[0]):"comment",Ge=n.platforms.every(t=>G(t)===Q),ae=n.platforms.map(t=>[t,bt(s.find(r=>r.id===t))]).filter(([,t])=>t.length),Y=F.filter(t=>ae.some(([,r])=>r.includes(t))),le=new Set(ae.map(([t])=>G(t))),ce=le.size===1?vt(Y,[...le][0]):"",pe=(t,r)=>Object.entries(i.builtin[t]??{}).find(([,m])=>m===r)?.[0]??r,M=n.engine||i.engine,J=i.engines[M]??{},Qe=[ee[i.engine]??i.engine,pe(i.engine,i.engines[i.engine]?.model)].filter(Boolean).join(" \xB7 "),Ye=Me.find(([t])=>t===n.permissions),Je=[ee[M]??M,n.model||pe(M,J.model),n.effort||J.effort,Ye?.[1].toLowerCase()].filter(Boolean).join(" \xB7 ");B(()=>{if(!l)return;let t=document.getElementById(`agent-${l}`);t?.scrollIntoView({block:"start"}),t?.querySelector("input, textarea, button")?.focus({preventScroll:!0})},[]);let de=t=>{V(t),t!=="import"&&C(r=>({...r,..._e(t,s)}))},me=t=>C(r=>({...r,name:t,...v&&!x?{id:We(t)}:{}})),Xe=(t,r)=>C(m=>{let h=Object.keys(s.find(a=>a.id===t)?.events??{});return{...m,platforms:r?s.map(a=>a.id).filter(a=>a===t||m.platforms.includes(a)):m.platforms.filter(a=>a!==t),events:r&&!m.events[t]?.length?{...m.events,[t]:Ke(s.find(a=>a.id===t))}:m.events,tools:r&&!m.tools[t]?{...m.tools,[t]:Ge&&Q!=="custom"?Q:"comment"}:m.tools}}),Ze=(t,r,m)=>C(h=>{let a=h.events[t]??[],u=m?h.match:{...h.match,[t]:{...h.match[t],[r]:""}};return{...h,events:{...h.events,[t]:m?[...new Set([...a,r])]:a.filter(O=>O!==r)},match:u}}),et=(t,r,m)=>C(h=>({...h,match:{...h.match,[t]:{...h.match[t],[r]:m}}})),tt=async()=>{let t=n.platforms.find(u=>!n.events[u]?.length);if(t)return z(`Pick at least one event on ${t}, or turn ${t} off.`);let r={};for(let u of n.platforms)r[u]={triggers:ft(o?.definition?.integrations?.[u],n.events[u]??[],n.match[u]??{}),tools:n.tools[u]};let m={...o?.definition,integrations:r,permissions:n.permissions};for(let u of["name","description","engine","model","effort"]){let O=n[u].trim();O?m[u]=O:delete m[u]}let h=v?n.id:o.id,a=n.name.trim();ie(!0),z("");try{let u=o?.files;await q.agents.put(h,{definition:m,...u?{files:u}:{},systemPrompt:n.systemPrompt.trim()?n.systemPrompt:`You are ${a||h}.
|
|
6
|
+
`,...a?{name:a}:{},...n.description.trim()?{description:n.description.trim()}:{}}),v&&n.platforms.length?S.push("/dash/agents/[slug]/platforms",{params:{slug:h}}):S.push("/dash/agents/[slug]",{params:{slug:h}})}catch(u){ie(!1),z(D(u))}},ue=e(E,{children:[e($,{value:ze}),v?e("button",{type:"button",class:"btn outline","aria-pressed":R==="import",onClick:()=>de("import"),children:"Import from repo"}):null,v?null:e(ye,{class:"btn ghost",href:"/dash/agents/[slug]",params:{slug:o.id},children:"Cancel"}),e("button",{class:"btn",disabled:Ve||!n.name.trim()||R==="import",children:v?"Create agent":"Publish new version"})]}),fe=v?e(Le,{...xe.newAgent,back:e(oe,{href:"/dash/agents",params:{},label:"Agents"}),actions:ue}):e(De,{agent:o,back:e(oe,{href:"/dash/agents/[slug]",params:{slug:o.id},label:o.name}),actions:ue}),ge=v?e("div",{class:"templates",role:"radiogroup","aria-label":"Start from",children:at.map(([t,r,m])=>e("button",{type:"button",role:"radio","aria-checked":R===t,class:"tile",onClick:()=>de(t),children:[e("b",{children:r}),e("small",{children:m})]},t))}):null;if(R==="import"&&v)return e("div",{class:"agent-new",children:[fe,ge,e(qe,{connected:g,connectLabel:w,tunnel:p,port:k})]});let st=re.trim().toLowerCase(),he=s.filter(t=>`${t.id} ${t.description}`.toLowerCase().includes(st));return e("form",{class:"agent-new",onSubmit:t=>{t.preventDefault(),tt()},children:[fe,ge,e("div",{class:"agent-form",children:[e("div",{class:"agent-main",children:[e("section",{id:"agent-name",class:"form-part",children:[e("h2",{children:"Name and description"}),e("div",{class:"fields",children:[e(A,{label:"Name",hint:"its handle on every platform",children:e("span",{class:"with-btn",children:[e("input",{name:"name",required:!0,value:n.name,onInput:t=>me(t.currentTarget.value)}),v?e("button",{type:"button",class:"btn outline",title:"Suggest another name",onClick:()=>me(Fe()),children:[e(T,{d:ve}),"Suggest"]}):null]})}),v?e(A,{label:"Id",hint:"the folder and command name",children:e("input",{class:"mono",name:"id",required:!0,pattern:"[a-z0-9][a-z0-9_\\-]*",autocomplete:"off",value:n.id,onInput:t=>{d(!0),N("id",t.currentTarget.value)}})}):e("div",{class:"field",children:[e("span",{children:["Id ",e("small",{children:"fixed once created"})]}),e("p",{class:"fixed mono",children:o.id})]})]}),e(A,{label:"Description",hint:"optional, shown in lists and added to the prompt",children:e("input",{name:"description",maxLength:240,placeholder:"Answers engineering questions about acme/app.",value:n.description,onInput:t=>N("description",t.currentTarget.value)})})]}),e("section",{id:"agent-instructions",class:"form-part",children:[e("div",{class:"part-head",children:[e("h2",{children:"Instructions"}),e(j,{label:"Instructions view",options:[["write","Write"],["preview","Preview"]],value:P,onChange:L})]}),P==="write"?e("textarea",{name:"systemPrompt",rows:10,"aria-label":"Instructions",placeholder:`Markdown. The system prompt every task starts from.
|
|
7
|
+
You answer questions about acme/app from its source. Cite file paths.`,value:n.systemPrompt,onInput:t=>N("systemPrompt",t.currentTarget.value)}):e("div",{class:"body md md-preview",children:n.systemPrompt.trim()?Oe(n.systemPrompt):e("p",{class:"muted",children:"Nothing written yet."})})]}),e("section",{id:"agent-platforms",class:"form-part",children:[e("div",{class:"part-head",onKeyDown:t=>t.key==="Enter"&&t.preventDefault(),children:[e("h2",{children:"Where it listens"}),s.length>lt?e(U,{value:re,label:"Search platforms",onInput:Ue}):null]}),e("p",{class:"muted",children:"Each platform becomes an app, set up on the next page. With none it runs from the dashboard and the CLI."}),e("ul",{class:"listen",children:[he.map(t=>{let r=n.platforms.includes(t.id),m=n.events[t.id]??[],h=Object.entries(t.events);return e("li",{class:r?"on":void 0,children:[e("label",{class:"listen-row",children:[e("span",{class:"pf-mark","aria-hidden":"true",children:e(Ee,{brand:t.brand})}),e("span",{class:"grow",children:[e("b",{children:t.name}),e("small",{title:t.description,children:t.description})]}),e("input",{type:"checkbox",role:"switch",class:"switch",name:"platform",value:t.id,checked:r,onChange:a=>Xe(t.id,a.currentTarget.checked)})]}),r?e("div",{class:"triggers",children:[e("div",{class:"chips",role:"group","aria-label":`What wakes it on ${t.id}`,children:h.map(([a,u])=>{let O=m.includes(a);return e("button",{type:"button",class:"chip","aria-pressed":O,title:u.description,onClick:()=>Ze(t.id,a,!O),children:a.replace(/_/g," ")},a)})}),h.filter(([a,u])=>u.noisy&&m.includes(a)).map(([a])=>e("label",{class:"match",children:[e("span",{children:a.replace(/_/g," ")}),e("input",{class:"mono",name:`match:${t.id}:${a}`,placeholder:"only when the text matches, like ^help\\b","aria-label":`Text filter for ${a} on ${t.id}`,value:n.match[t.id]?.[a]??"",onInput:u=>et(t.id,a,u.currentTarget.value)})]},a))]}):null]},t.id)}),he.length?null:e("li",{class:"listen-none muted",children:"No platform matches."})]}),Y.length?e(A,{label:"Platform access",hint:He[ce]?.[1]??"differs between platforms",group:!0,children:e(j,{label:"Platform access",options:Y.map(t=>[t,He[t][0]]),value:ce,onChange:t=>N("tools",Object.fromEntries(n.platforms.map(r=>[r,t])))})}):null]}),e("details",{id:"agent-run",class:"form-part run",open:l==="run",children:[e("summary",{children:[e("h2",{children:"Run settings"}),e("span",{class:"grow muted",children:Je}),e(T,{d:X})]}),e("div",{class:"run-body",children:[e("div",{class:"fields",children:[e(A,{label:"Engine and model",hint:"what runs each task",group:!0,children:e(ke,{label:"Model",value:Ie(n.engine,n.model),options:Se(f,te(Qe)),headings:Pe(f),action:{label:"Add models",icon:be,onPick:()=>S.push("/dash/settings/[tab]",{params:{tab:"models"}})},onChange:t=>C(r=>({...r,...Re(t)}))})}),e(A,{label:"Effort",hint:"how hard the model thinks",group:!0,children:e(j,{label:"Effort",options:[["",te(J.effort)],...it],value:n.effort,onChange:t=>N("effort",t)})})]}),e(A,{label:"Repository access",hint:rt[n.permissions],group:!0,children:e(j,{label:"Repository access",options:Me,value:n.permissions,onChange:t=>N("permissions",t)})})]})]})]}),e("aside",{class:"agent-side","aria-label":"Preview",children:[e("span",{class:"side-label",children:"Preview"}),e("div",{class:"agent-card preview",children:[e("div",{class:"bc-head",children:[e("span",{class:"mark",children:H(n.name)}),e("div",{class:"grow",children:[e("h3",{children:n.name.trim()||"Unnamed agent"}),e("span",{class:"pills",children:[e(ne,{children:"dashboard"}),o?.local?null:e(ne,{children:["v",v?1:o.currentVersion+1]})]})]})]}),e("div",{class:"lead-clamp",children:e("span",{children:n.description.trim()||"No description yet."})}),n.platforms.length?e("span",{class:"pfs",children:n.platforms.map(t=>e(Ae,{id:t,info:s.find(r=>r.id===t),state:"none"},t))}):e("span",{class:"pfs muted",children:"Listens nowhere yet"})]}),e("p",{class:"summary",children:gt(n)})]})]})]})}export{$s as AgentEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a as m,b as k,c as N,e as C,g as u,h as g}from"./list-
|
|
1
|
+
"use client";import{a as m,b as k,c as N,e as C,g as u,h as g}from"./list-074a086ab5e19d77.js";import"./confirm-d804955ec454f00f.js";import{a as p}from"./badge-b8e1e1429e8418e8.js";import{b as c,c as f,e as S}from"./model-options-15c53331a2f28a4f.js";import{a as w}from"./select-f4ea2f12a2298e4a.js";import"./card-abb16544e8e5a5e0.js";import"./field-329f272ef3edae30.js";import"./format-b19b8eec331414f4.js";import{$0b as d}from"./shared-init-cf66e1c1a2f30ef1.js";import"./shared-init-cf66e1c1a2f30ef1.js";import"./shared-init-bee5eaed36ee3dc4.js";import"./shared-init-bee5eaed36ee3dc4.js";import{$0a as t}from"./shared-init-bee5eaed36ee3dc4.js";import{$1c as a,$1g as E}from"./shared-init-8f2ac936c95a7f7b.js";function D({first:s,defaults:R}){let[h,v]=E(""),n=m(s.config),o=n.value.chain??s.effective.chain??c,l=n.value.approvals?.allowedNetworkHosts??[],y=[...o.filter(e=>c.includes(e)),...c.filter(e=>!o.includes(e))],I=(e,i)=>(s.config.engines?.[e]?.[i]?void 0:s.effective.engines?.[e]?.[i])??R[e]?.[i],b=(e,i,L)=>t("label",{children:[i,t(w,{label:`${f[e]} ${i}`,value:n.value.engines?.[e]?.[i]??"",options:[["",S(I(e,i)??(i==="permissions"?"auto":void 0))],...L.map(r=>[r,r])],onChange:r=>void n.patch({engines:{[e]:{[i]:r||null}}})})]});return t(a,{children:[t(g,{title:"Engines",count:o.length,error:n.error,children:y.map(e=>t(u,{title:f[e],badges:t(a,{children:[o[0]===e?t(p,{tone:"acc",children:"default"}):null,o.includes(e)?null:t(p,{children:"off"})]}),sub:t("span",{class:"inline-picks",children:[b(e,"effort",k),b(e,"permissions",N)]}),actions:o[0]===e?null:t("button",{type:"button",class:"btn secondary sm",disabled:h===e,"aria-busy":h===e,onClick:()=>{v(e),n.patch({chain:[e,...o.filter(i=>i!==e)]}).finally(()=>v(""))},children:"Make default"}),menu:o.includes(e)?o.length>1?t(d,{title:"Disable",onClick:()=>void n.patch({chain:o.filter(i=>i!==e)})}):void 0:t(d,{title:"Enable",onClick:()=>void n.patch({chain:[...o,e]})})},e))}),t(g,{title:"Allowed network hosts",count:l.length,error:"",add:t(C,{fields:[["host","Host, like registry.npmjs.org"]],onAdd:({host:e})=>n.patch({approvals:{allowedNetworkHosts:[...new Set([...l,e])]}})}),children:l.map(e=>t(u,{title:e,remove:{title:`Remove ${e}?`,body:"Tasks lose access to it.",onRemove:()=>n.patch({approvals:{allowedNetworkHosts:l.filter(i=>i!==e)}})}},e))})]})}export{D as EnginesList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$
|
|
1
|
+
import{$0a as n}from"./shared-init-bee5eaed36ee3dc4.js";function s({label:e,hint:l,group:r,children:o}){return n(r?"div":"label",{class:"field",children:[n("span",{children:[e,l?n("small",{children:l}):null]}),o]})}function m({value:e}){return e?n("p",{class:"flash err",role:"alert",children:e}):null}export{s as a,m as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as L}from"./paged-3ddb6077bef42752.js";import{$0a as A,$0d as T}from"./shared-init-
|
|
1
|
+
import{f as L}from"./paged-3ddb6077bef42752.js";import{$0a as A,$0d as T}from"./shared-init-cf66e1c1a2f30ef1.js";import{$4d as P,$4f as v,$4o as D,$4v as H}from"./shared-init-cf66e1c1a2f30ef1.js";import{$2a as R}from"./shared-init-bee5eaed36ee3dc4.js";import{$0a as n}from"./shared-init-bee5eaed36ee3dc4.js";import{$1c as w,$1g as K,$1i as F,$1k as O}from"./shared-init-8f2ac936c95a7f7b.js";var q="coder:filters",W=5,M=5;function B(o,r){if(o.length<=M)return o;let s=o.slice(0,M),i=o.find(([u])=>u===r);return i&&!s.includes(i)?[...s.slice(0,M-1),i]:s}var Q=o=>o.options.filter(([r])=>r).length>=W;function X(o,r,s={}){return r?o.options.find(([i])=>i===r)?.[1]??s[`${o.key}:${r}`]??r:"Any"}function _(o,r,s={}){return o.filter(i=>r[i.key]).map(i=>{let u=X(i,r[i.key],s);return{key:i.key,text:i.inline?u:`${i.label}: ${u}`}})}function j(o,r,s){let i=s.trim().toLowerCase(),u=r.filter(([,a])=>a.toLowerCase().includes(i)),f=[...u,...o.filter(([a])=>!u.some(([t])=>t===a))];return{shown:f.slice(0,L),more:f.length>L}}function S(){try{return JSON.parse(localStorage.getItem(q)??"{}")??{}}catch{return{}}}function z(o,r){let s=S();s[o]=[r,...(s[o]??[]).filter(([i])=>i!==r[0])].slice(0,5),localStorage.setItem(q,JSON.stringify(s))}function le({name:o,facets:r,values:s,onChange:i}){let[u,f]=K({}),a=(c,p)=>f(y=>({...y,...Object.fromEntries(p.map(([E,k])=>[`${c}:${E}`,k]))}));F(()=>{let c=S();for(let p of r)a(p.key,c[`${o}:${p.key}`]??[])},[]);let t=_(r,s,u);return n(w,{children:[n(A,{class:"filter-more",summaryClass:`field-btn${t.length?" on":""}`,summary:t.length?`Filter \xB7 ${t.length}`:"Filter",children:n(G,{name:o,facets:r,values:s,seen:u,onFound:a,onPick:(c,[p,y])=>{!c.inline&&p!==s[c.key]&&(z(`${o}:${c.key}`,[p,y]),a(c.key,[[p,y]])),i(c.key,c.inline||p!==s[c.key]?p:"")}})}),n("span",{class:"filter-chips",children:t.map(c=>n("button",{type:"button",class:"chip",title:c.text,"aria-label":`Clear ${c.text}`,onClick:()=>i(c.key,""),children:[n("span",{class:"grow",children:c.text}),n(R,{d:D})]},c.key))})]})}function G({name:o,facets:r,values:s,seen:i,onFound:u,onPick:f}){let a=O(null),[t,c]=K(),[p,y]=K(""),[E,k]=K(),$=O(0),N=O(),h=p.trim(),C=e=>a.current?.querySelector(e)?.focus(),b=e=>{e&&(N.current=e.key),c(e),y(""),k(void 0)};F(()=>{let e=a.current.closest("[popover]"),l=g=>{g.newState==="open"?C(".pop-item"):b()};return e.addEventListener("toggle",l),()=>e.removeEventListener("toggle",l)},[]),F(()=>{a.current?.closest(":popover-open")&&C(t?"input":`[data-facet="${N.current}"]`)},[t]),F(()=>{if(!t?.search||!h)return;let e=++$.current,l=setTimeout(()=>void t.search(h,L+1).then(g=>{$.current===e&&(k(g),u(t.key,g))},()=>$.current===e&&k([])),200);return()=>clearTimeout(l)},[t,h]);let U=t?t.search&&h?E??[]:t.options.filter(([e,l])=>e&&l.toLowerCase().includes(h.toLowerCase())):[],x=t?j(U,S()[`${o}:${t.key}`]??[],h):{shown:[],more:!1},I=!!(t?.search&&h&&!E);return n("div",{ref:a,class:"filter-panel",onKeyDown:e=>{let l=[...a.current.querySelectorAll("input, .pop-item")],g=l.indexOf(document.activeElement),m=e.target,d=e.key;if(d==="ArrowDown")l[(g+1)%l.length]?.focus();else if(d==="ArrowUp")l[(g-1+l.length)%l.length]?.focus();else if(d==="ArrowRight"&&m.dataset.facet)m.click();else if(d==="ArrowLeft"&&t&&m.tagName!=="INPUT")b();else if(d==="Enter"&&m.tagName==="INPUT")C("[role=menuitemradio]");else if(d==="Escape"&&t)e.stopPropagation(),b();else return;e.preventDefault()},children:t?n(w,{children:[n("button",{type:"button",class:"pop-item","data-keep":!0,onClick:()=>b(),children:[n(R,{d:P}),n("span",{class:"grow",children:t.label})]}),Q(t)?n("label",{class:"search",children:[n(R,{d:H}),n("input",{type:"search",value:p,placeholder:`Find ${t.label.toLowerCase()}`,"aria-label":`Find ${t.label.toLowerCase()}`,autocomplete:"off",onInput:e=>y(e.currentTarget.value)})]}):null,n("div",{role:"group","aria-label":t.label,"aria-busy":I,children:x.shown.map(([e,l])=>n(T,{icon:t.icon?.(e),on:s[t.key]===e,onPick:()=>f(t,[e,l]),children:l},e))}),x.more?n("p",{class:"pop-note",children:"Type to find more."}):!x.shown.length&&!I?n("p",{class:"pop-note",children:"Nothing matches."}):null]}):r.map(e=>{let l=e.options.filter(([m])=>e.inline||m);if(!l.length)return null;let g=B(l,s[e.key]);return n(w,{children:[n("p",{class:"pop-label",children:e.label}),n("div",{role:"group","aria-label":e.label,children:g.map(([m,d])=>n(T,{icon:e.icon?.(m),on:s[e.key]===m,onPick:()=>f(e,[m,d]),children:d},m))}),l.length>g.length?n("button",{type:"button",class:"pop-item","data-keep":!0,"data-facet":e.key,"aria-haspopup":"true",onClick:()=>b(e),children:[n("span",{class:"grow",children:"More"}),n("span",{class:"muted",children:l.length-g.length}),n(R,{d:v})]}):null]},e.key)})})}export{le as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"./sentinel-
|
|
1
|
+
import{a as h}from"./sentinel-9e882d8ad784d4bd.js";import{$1a as c}from"./shared-init-cf66e1c1a2f30ef1.js";import{$4d as p}from"./shared-init-cf66e1c1a2f30ef1.js";import{$2a as d}from"./shared-init-bee5eaed36ee3dc4.js";import{$0a as t}from"./shared-init-bee5eaed36ee3dc4.js";import{$1c as l}from"./shared-init-8f2ac936c95a7f7b.js";var i={agents:{title:"Agents",lead:"Each agent listens on the platforms it declares and answers as itself."},tasks:{title:"Tasks"},newAgent:{title:"New agent",lead:"Start from a template or a repository. Everything but the name has a sensible default."},usage:{title:"Usage",lead:"Tasks, runner time, and tokens by agent. Pick a range, or open an agent for its breakdown."}};function u(r,a){let s=r?.match(/^\/dash\/tasks\/([^\/?]+)$/);if(s)return{href:"/dash/tasks/[id]",params:{id:decodeURIComponent(s[1])},label:"Task"};let e=r?.match(/^\/dash\/(usage|agents|tasks)(?:\?(.*))?$/);if(!e)return a;let n=new URLSearchParams(e[2]??""),o=i[e[1]].title;return e[1]==="usage"?{href:"/dash/usage",params:{},search:n,label:o}:e[1]==="agents"?{href:"/dash/agents",params:{},search:n,label:o}:{href:"/dash/tasks",params:{},search:n,label:o}}function f(r){if(!r?.startsWith("/"))return;let a=new URL(r,"http://dash");if(a.origin!=="http://dash"||!/^\/dash(\/|$)/.test(a.pathname))return;let[,,s,e]=a.pathname.split("/"),n=i[s]?.title??"Back";if(s==="agents"&&e)try{n=decodeURIComponent(e)}catch{}return{to:{href:a.pathname,search:a.searchParams},label:n}}function E({label:r,back:a,...s}){let e=f(a),n=e?.label??r;return t(c,{class:"back","aria-label":n,...e?.to??s,children:[t(d,{d:p}),t("span",{children:n})]})}function x({title:r,lead:a,actions:s,meta:e,back:n}){return t(l,{children:[t(h,{}),t("header",{class:"head",children:[t("div",{children:[n,t("div",{class:"title-row",children:[t("h1",{children:r}),e?t("div",{class:"meta",children:e}):null]}),a?t("p",{class:"lead",children:a}):null]}),s?t("div",{class:"actions",children:s}):null]})]})}export{i as a,u as b,E as c,x as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$
|
|
1
|
+
import{$0a as t}from"./shared-init-bee5eaed36ee3dc4.js";import{$1b as g,$1g as a,$1j as C,$1k as b}from"./shared-init-8f2ac936c95a7f7b.js";function x({lines:c=10,class:e,children:o}){let n=b(null),[p,h]=a(!1),[l,u]=a(!1);return C(()=>{let s=n.current,i=()=>h(l||s.scrollHeight>s.clientHeight+1);i();let r=new ResizeObserver(i);return r.observe(s),()=>r.disconnect()},[o,l]),t("div",{class:`collapse${p?" long":""}${l?" open":""}`,style:`--lines:${c}`,children:[t("div",{class:e?`collapse-box ${e}`:"collapse-box",ref:n,children:o}),p?t("button",{type:"button",class:"btn ghost sm more-toggle","aria-expanded":l,onClick:()=>u(!l),children:l?"Show less":"Show more"}):null]})}var v=/`([^`\n]+)`|\*\*(.+?)\*\*|__(.+?)__|\*(\S(?:.*?\S)?)\*|(?<!\w)_(\S(?:.*?\S)?)_(?!\w)|\[([^\]\n]+)\]\(([^)\s]+)\)/g,S=/^(?:https?:|mailto:)/i,_=/^\s*(```|~~~)/,$=/^(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/,E=/^\s*(?:([-*+])|\d+[.)])\s+(.*)$/,w=/^\s*(?:#{1,6}\s|```|~~~|[-*+]\s|\d+[.)]\s)/;function d(c){let e=[],o=0;for(let n of c.matchAll(v)){let[p,h,l,u,s,i,r,f]=n;n.index>o&&e.push(c.slice(o,n.index)),h?e.push(t("code",{children:h})):l||u?e.push(t("strong",{children:d(l||u)})):s||i?e.push(t("em",{children:d(s||i)})):S.test(f)?e.push(t("a",{class:"link",href:f,target:"_blank",rel:"noopener noreferrer",children:d(r)})):e.push(...d(r)),o=n.index+p.length}return o<c.length&&e.push(c.slice(o)),e}function y(c){let e=c.split(/\r?\n/),o=[];for(let n=0;n<e.length;){let p=e[n],h=_.exec(p),l=$.exec(p),u=E.exec(p);if(h){let s=e.findIndex((r,f)=>f>n&&r.trim().startsWith(h[1])),i=s<0?e.length:s;o.push(t("pre",{children:t("code",{children:e.slice(n+1,i).join(`
|
|
2
2
|
`)})})),n=i+1}else if(l)o.push(g(`h${Math.min(l[1].length+2,6)}`,null,d(l[2]))),n++;else if(u){let s=!u[1],i=[];for(let r;(r=E.exec(e[n]??""))&&!r[1]===s;n++)i.push(t("li",{children:d(r[2])}));o.push(s?t("ol",{children:i}):t("ul",{children:i}))}else if(!p.trim())n++;else{let s=[];for(;e[n]?.trim()&&(!s.length||!w.test(e[n]));n++)s.length&&s.push(t("br",{})),s.push(...d(e[n]));o.push(t("p",{children:s}))}}return o}function z({text:c}){return t(x,{class:"body md",children:y(c)})}export{x as a,y as b,z as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{b as a,c as b}from"./instructions-7f289881a4d96d85.js";import"./shared-init-bee5eaed36ee3dc4.js";import"./shared-init-8f2ac936c95a7f7b.js";export{b as Instructions,a as markdown};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as w}from"./confirm-
|
|
1
|
+
import{a as w}from"./confirm-d804955ec454f00f.js";import{a as h}from"./card-abb16544e8e5a5e0.js";import{b}from"./field-329f272ef3edae30.js";import{g as d}from"./format-b19b8eec331414f4.js";import{$0a as v,$0b as R}from"./shared-init-cf66e1c1a2f30ef1.js";import{$4q as g}from"./shared-init-cf66e1c1a2f30ef1.js";import{$2a as C}from"./shared-init-bee5eaed36ee3dc4.js";import{$1b as y}from"./shared-init-bee5eaed36ee3dc4.js";import{$0a as o}from"./shared-init-bee5eaed36ee3dc4.js";import{$1g as u,$1k as f}from"./shared-init-8f2ac936c95a7f7b.js";function T(r,s){if(!s||typeof s!="object"||Array.isArray(s))return s;let e=r&&typeof r=="object"&&!Array.isArray(r)?{...r}:{};for(let[n,t]of Object.entries(s))t===null?delete e[n]:e[n]=T(e[n],t);return e}function q(r){let[s,e]=u(r),[n,t]=u(""),i=f(0),a=f(r);return{value:s,error:n,patch:l=>{let p=++i.current;return t(""),e(m=>T(m,l)),y.config.patch(l).then(m=>(a.current=m,p===i.current&&e(m),!0),m=>(p===i.current&&(e(a.current),t(d(m))),!1))}}}var B=["low","medium","high"],N=["read-only","workspace-write","auto"];function z(r){let[s,e]=u(r),[n,t]=u("");return{value:s,setValue:e,error:n,setError:t,send:async(a,c)=>{t("");try{let l=await a();return c&&e(c(l)),!0}catch(l){return t(d(l)),!1}}}}function G({fields:r,onAdd:s}){return o("form",{class:"add-row",method:"post",onSubmit:async e=>{e.preventDefault();let n=e.currentTarget,t=Object.fromEntries([...new FormData(n)].map(([i,a])=>[i,String(a).trim()]));Object.values(t).some(i=>!i)||await s(t)&&n.reset()},children:[r.map(([e,n])=>o("input",{name:e,placeholder:n,"aria-label":n,autocomplete:"off"},e)),o("button",{class:"btn",children:"Add"})]})}function A(r){let[s,e]=u(!1),[n,t]=u(!1);if(!r)return{};let{title:i,body:a,label:c="Remove",onRemove:l}=r;return{item:o(R,{title:c,danger:!0,onClick:()=>e(!0)}),dialog:s?o(w,{open:!0,title:i,body:a,confirmLabel:c,busy:n,onClose:()=>e(!1),onConfirm:()=>{t(!0),l().finally(()=>{t(!1),e(!1)})}}):null}}function H({title:r,badges:s,sub:e,actions:n,menu:t,remove:i}){let a=A(i);return o("tr",{children:[o("td",{children:[o("span",{class:"row-title",children:[o("b",{children:r}),s]}),e?o("span",{class:"sub mono",children:e}):null]}),o("td",{class:"acts",children:[n,t||a.item?o(v,{summaryClass:"icon-btn",label:"Actions",summary:o(C,{d:g}),children:[t,a.item]}):null,a.dialog]})]})}function J({title:r,count:s,error:e,children:n,add:t}){return o(h,{title:r,count:s,actions:o(b,{value:e}),children:[o("div",{class:"table-scroll",children:o("table",{class:"rows settings",children:o("tbody",{children:n})})}),t]})}export{q as a,B as b,N as c,z as d,G as e,A as f,H as g,J as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{d as B,g as H,h as _}from"./list-
|
|
1
|
+
"use client";import{d as B,g as H,h as _}from"./list-074a086ab5e19d77.js";import"./confirm-d804955ec454f00f.js";import{c as O}from"./toolbar-7aee851cfcc688cc.js";import{a as q}from"./paged-3ddb6077bef42752.js";import{a as F}from"./badge-b8e1e1429e8418e8.js";import{a as j}from"./card-abb16544e8e5a5e0.js";import{a as v,b as x}from"./field-329f272ef3edae30.js";import{g as P}from"./format-b19b8eec331414f4.js";import"./sentinel-9e882d8ad784d4bd.js";import"./shared-init-cf66e1c1a2f30ef1.js";import"./shared-init-cf66e1c1a2f30ef1.js";import"./shared-init-bee5eaed36ee3dc4.js";import{$1b as k}from"./shared-init-bee5eaed36ee3dc4.js";import{$0a as e}from"./shared-init-bee5eaed36ee3dc4.js";import{$1c as y,$1g as h,$1k as M}from"./shared-init-8f2ac936c95a7f7b.js";var J=r=>r.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40),K=r=>(r.match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(i=>i.replace(/^(["'])(.*)\1$/,"$2")),Y=["docs","search","browser","files"],ee=r=>r.type??(r.url?"http":"stdio"),z=r=>r.url??[r.command,...(r.args??[]).map(i=>i.replace(/\{((?:runtime|package):[^}]+)\}/g,(n,d)=>`{${r.argumentInputs?.find(o=>o.name===d)?.label??d}}`))].join(" ").trim();function w({kind:r,list:i}){return e(y,{children:i.map(n=>e(v,{label:e("span",{class:"mono",children:n.label??n.name}),hint:n.description??(n.required?"required":"optional"),children:e("input",{name:`${r}:${n.name}`,type:n.secret?"password":"text",placeholder:n.placeholder,defaultValue:r==="arg"?n.placeholder:void 0,autocomplete:"off",required:n.required})},n.name))})}function te({onAdd:r,error:i,taken:n}){let[d,o]=h(""),[s,m]=h(),[a,R]=h(),[N,S]=h(!1),T=M(),b=M(null),C=t=>{m({q:t}),k.mcp.search(t.trim()).then(q(performance.now())).then(l=>m(c=>c?.q===t?{q:t,items:l}:c)).catch(l=>m(c=>c?.q===t?{q:t,error:P(l)}:c))},D=t=>{if(o(t),clearTimeout(T.current),!t.trim())return m(void 0);T.current=setTimeout(()=>C(t),250)},U=t=>{R(t),m(void 0),o("");let l=b.current.elements;l.namedItem("name").value=J(t.title),l.namedItem("target").value=z(t),requestAnimationFrame(()=>{let c=b.current;(c?.querySelector("input[name^='arg:'], input[name^='env:'], input[name^='header:']")??c?.querySelector("button"))?.focus()})};return e(j,{title:"Add an MCP server",actions:e(x,{value:i}),children:[e("div",{class:"registry",children:[e(O,{value:d,label:"Search the MCP registry",onInput:D}),s?e("div",{class:"registry-results scroll-box","aria-live":"polite","aria-busy":!s.items&&!s.error,children:s.error?e("div",{class:"registry-note err",role:"alert",children:[e("span",{class:"grow",children:s.error}),e("button",{type:"button",class:"btn ghost sm",onClick:()=>C(s.q),children:"Retry"})]}):s.items?s.items.length?s.items.map(t=>e("button",{type:"button",class:"pop-item rich",onClick:()=>U(t),children:e("span",{class:"grow",children:[e("b",{children:t.title})," ",e(F,{children:t.type}),e("small",{children:t.description||t.name})]})},t.name)):e("p",{class:"registry-note",children:"No server in the registry matches. Type its command or URL below."}):e("div",{role:"status","aria-label":"Searching the registry",children:[0,1,2].map(t=>e("div",{class:"skel",children:[e("i",{}),e("i",{})]},t))})}):null]}),e("form",{ref:b,class:"add-form",method:"post",onSubmit:async t=>{t.preventDefault();let l=[...new FormData(t.currentTarget)].map(([p,u])=>[p,String(u).trim()]),c=p=>l.find(([u])=>u===p)?.[1]??"",E=p=>Object.fromEntries(l.filter(([u,f])=>u.startsWith(p)&&f).map(([u,f])=>[u.slice(p.length),f])),I=c("name"),g=c("target");if(!I||!g)return;let W=a?.command?z(a):void 0,Z=a&&g===W?[a.command,...a.args??[]]:K(g),[Q,...L]=Z.map(p=>p.replace(/\{((?:runtime|package):[^}]+)\}/g,(u,f)=>c(`arg:${f}`))),A=E("env:"),$=E("header:"),V=/^https?:\/\//.test(g)?{url:g,...a?.url===g?{type:a.type}:{},...Object.keys($).length?{headers:$}:{}}:{command:Q,...L.length?{args:L}:{},...Object.keys(A).length?{env:A}:{}};S(!0);let X=await r({name:I,...V,...a?.description?{description:a.description}:{}});S(!1),X&&(b.current?.reset(),R(void 0))},children:e("div",{class:"add-grid",children:[e(v,{label:"Name",children:e("input",{name:"name",placeholder:Y.find(t=>!n.includes(t)),autocomplete:"off",pattern:"[A-Za-z0-9][A-Za-z0-9_\\-]*"})}),e(v,{label:"Command or URL",hint:a?a.description:void 0,children:e("input",{name:"target",class:"mono",placeholder:"npx -y @acme/mcp or https://mcp.acme.dev",autocomplete:"off"})}),e(w,{kind:"arg",list:a?.argumentInputs??[]}),e(w,{kind:"env",list:a?.env??[]}),e(w,{kind:"header",list:a?.headers??[]}),e("button",{class:"btn",disabled:N,children:"Add"})]})})]})}function ge({first:r}){let i=B(r),n=o=>o.mcp??{},d=Object.entries(i.value);return e(y,{children:[e(te,{error:i.error,taken:d.map(([o])=>o),onAdd:o=>i.send(()=>k.mcp.add(o),n)}),e(_,{title:"MCP servers",count:d.length,error:"",children:d.map(([o,s])=>{let m=s.url??[s.command,...s.args??[]].join(" ");return e(H,{title:o,badges:e(F,{children:ee(s)}),sub:s.description?e(y,{children:[e("span",{class:"plain",children:s.description}),e("br",{}),m]}):m,remove:{title:`Remove ${o}?`,body:"New tasks no longer attach it.",onRemove:()=>i.send(()=>k.mcp.remove(o),n)}},o)})})]})}export{ge as McpList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a as X}from"./combo-
|
|
1
|
+
"use client";import{a as X}from"./combo-0feaff3c2ab55606.js";import{a as Y,d as Z,g as J,h as W}from"./list-074a086ab5e19d77.js";import"./confirm-d804955ec454f00f.js";import{a as B}from"./badge-b8e1e1429e8418e8.js";import{b as $,c as _,e as G,j as V}from"./model-options-15c53331a2f28a4f.js";import{a as F}from"./select-f4ea2f12a2298e4a.js";import{a as H,c as q}from"./card-abb16544e8e5a5e0.js";import{a as p,b as x}from"./field-329f272ef3edae30.js";import{g as z}from"./format-b19b8eec331414f4.js";import{$0b as D}from"./shared-init-cf66e1c1a2f30ef1.js";import"./shared-init-cf66e1c1a2f30ef1.js";import"./shared-init-bee5eaed36ee3dc4.js";import{$1b as P}from"./shared-init-bee5eaed36ee3dc4.js";import{$0a as e}from"./shared-init-bee5eaed36ee3dc4.js";import{$1c as M,$1g as c,$1k as j}from"./shared-init-8f2ac936c95a7f7b.js";var ne=[["custom","Custom endpoint"],["claude","Claude"],["codex","Codex"]],le={claude:"sonnet",codex:"sol"},se=[["low","Low"],["medium","Medium"],["high","High"]],re=[["personal","Just me"],["workspace","Workspace"]],L=V,Q={id:"other",name:"Other",baseUrl:"",envKey:"",needsKey:!0},ee=v=>v.split("/").pop().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),ae=(v,m)=>v.find(C=>!(C in m));function ie({builtin:v,credentials:m,admin:C,taken:T,efforts:d,error:a,onAdd:y}){let[f,E]=c("custom"),i=f==="custom"?"custom":"alias",k=e(p,{label:"Engine",group:!0,children:e(F,{label:"Engine",options:ne,value:f,onChange:E})}),[b,U]=c(""),[o,t]=c(!1),[s,n]=c(0),h=v[f]??{},w=h[le[f]]??Object.values(h)[0];return e(H,{title:"Add a model",actions:e(x,{value:a}),children:e("form",{class:"add-form",method:"post",onSubmit:async A=>{A.preventDefault();let g=A.currentTarget,r=Object.fromEntries([...new FormData(g)].map(([R,S])=>[R,String(S).trim()]));if(i==="custom"&&!r.name&&(r.name=ee(r.model??"")),!r.name||!r.model||i==="custom"&&!r.baseUrl)return;t(!0);let I=i==="alias"?await y(()=>P.models.alias(r.name,[f,r.model,b].filter(Boolean).join(":"))):await y(async()=>{let R=r.envKey||"OPENAI_API_KEY";return r.key&&await P.credentials.add({env:{[R]:r.key},engine:"custom",label:L.find(S=>S.id===r.provider)?.name,workspace:r.scope==="workspace"}),P.models.add({name:r.name,baseUrl:r.baseUrl,model:r.model,envKey:R})});t(!1),I&&(g.reset(),n(s+1))},children:i==="alias"?e("div",{class:"add-grid",children:[k,e(p,{label:"Name",children:e("input",{name:"name",placeholder:ae(["fast","deep","quick"],T),autocomplete:"off",pattern:"[a-z0-9][a-z0-9\\-]*"})}),e(p,{label:"Model id",children:e("input",{name:"model",placeholder:w??"model id",autocomplete:"off"})}),e(p,{label:"Effort",hint:"optional",group:!0,children:e(F,{label:"Effort",options:[["",G(d[f])],...se],value:b,onChange:U})}),e("button",{class:"btn",disabled:o,children:"Add"})]}):e(de,{engine:k,credentials:m,admin:C,taken:T,busy:o},s)})})}function de({engine:v,credentials:m,admin:C,taken:T,busy:d}){let[a,y]=c(L[0]??Q),[f,E]=c(a.baseUrl),[i,k]=c(a.envKey),[b,U]=c(""),[o,t]=c("personal"),[s,n]=c(null),h=j(0),[w,A]=c(""),g=l=>!!l&&!!m?.some(u=>u.env.includes(l)),[r,I]=c(!1),R=j(),S=(l,u,O)=>{let te=++h.current;if(!l.trim())return n(null);I(!0),P.models.probe({baseUrl:l.trim(),...u.trim()?{envKey:u.trim()}:{},...O.trim()?{key:O.trim()}:{}}).catch(K=>({reachable:!1,modelListed:null,models:null,detail:z(K)})).then(K=>{te===h.current&&(I(!1),n(K.models?{...K,models:[...K.models].sort()}:K))})},N=(l,u,O)=>{clearTimeout(R.current),R.current=setTimeout(()=>S(l,u,O),250)},oe=s?s.reachable?s.models?`${s.models.length} listed`:"reachable, no model list":/HTTP 40[13]/.test(s.detail)?"key rejected":s.detail:void 0;return e(M,{children:[e("div",{class:"add-grid",children:[v,e(p,{label:"Provider",group:!0,children:e(F,{label:"Provider",name:"provider",options:L.map(l=>[l.id,l.name]),value:a.id,onChange:l=>{let u=L.find(O=>O.id===l)??Q;y(u),E(u.baseUrl),k(u.envKey),n(null),(b.trim()||g(u.envKey)||!u.needsKey)&&S(u.baseUrl,u.envKey,b)}})}),e(p,{label:"Model name",hint:"optional",children:e("input",{name:"name",placeholder:ee(w)||"short name like kimi",autocomplete:"off",pattern:"[a-z0-9][a-z0-9\\-]*"})})]}),e("div",{class:"add-grid",children:[a.needsKey&&m?e(p,{label:"API key",hint:e(M,{children:[g(i)?`optional, your saved ${i}`:`saved as ${i}`,a.keyUrl?e(M,{children:[", ",e("a",{class:"link",href:a.keyUrl,target:"_blank",rel:"noopener noreferrer",children:"get a key"})]}):null]}),children:e("input",{name:"key",type:"password",autocomplete:"off",placeholder:g(i)?"Optional":`${a.name} API key`,value:b,onInput:l=>{U(l.currentTarget.value),N(f,i,l.currentTarget.value)}})}):null,e(p,{label:"Model id",group:!0,hint:r?e(q,{label:"Fetching models",inline:!0,dots:!0}):oe,children:e(X,{label:"Model id",onOpen:()=>{!s&&!r&&S(f,i,b)},name:"model",options:s?.models??[],placeholder:s?.models?.[0]??"qwen3-coder",value:w,onChange:A})}),a.needsKey&&m&&C?e(p,{label:"Scope",group:!0,children:e(F,{label:"Scope",name:"scope",options:re,value:o,onChange:t})}):null]}),e("div",{class:"add-foot",children:[e("details",{class:"add-more",open:a.id==="other"||void 0,children:[e("summary",{children:"Advanced"}),e("div",{class:"add-grid",children:[e(p,{label:"Base URL",children:e("input",{name:"baseUrl",type:"url",placeholder:"http://localhost:11434/v1",autocomplete:"off",value:f,onInput:l=>{E(l.currentTarget.value),N(l.currentTarget.value,i,b)}})}),e(p,{label:"Key variable",children:e("input",{name:"envKey",class:"mono",placeholder:"OPENAI_API_KEY",autocomplete:"off",pattern:"[A-Za-z_][A-Za-z0-9_]*",value:i,onInput:l=>k(l.currentTarget.value)})})]})]}),e("button",{class:"btn",disabled:d,children:"Add model"})]})]})}function Ee({first:v,config:m,credentials:C,admin:T}){let d=Z(v),a=Y(m.config),y=o=>({...d.value,models:o.models??{}}),f=o=>a.value.engines?.[o]?.model??m.effective.engines?.[o]?.model,E=o=>d.value.models[o]?.disabled===!0,i=a.value.chain??m.effective.chain??$,k=Object.entries(d.value.models).filter(([,o])=>o.provider||o.baseUrl),b=[...Object.entries(d.value.builtin).flatMap(([o,t])=>Object.entries(t).filter(([s])=>!k.some(([n])=>n===s)).map(([s,n])=>({name:s,engine:o,target:n,entry:d.value.models[s],removable:!1}))),...k.map(([o,t])=>({name:o,engine:t.provider??"custom",target:t.baseUrl?`${t.model} \xB7 ${t.baseUrl}`:`${t.model}${t.effort?` \xB7 ${t.effort}`:""}`,entry:t,removable:!0}))],U=[...new Set([...i,...$])].map(o=>[o,b.filter(t=>t.engine===o)]).filter(([,o])=>o.length);return e(M,{children:[e(ie,{builtin:d.value.builtin,credentials:C,admin:T,taken:{...d.value.models,...Object.assign({},...Object.values(d.value.builtin))},efforts:Object.fromEntries($.map(o=>[o,a.value.engines?.[o]?.effort??m.effective.engines?.[o]?.effort])),error:d.error,onAdd:o=>d.send(o,y)}),U.map(([o,t],s)=>e(W,{title:_[o]??o,count:t.length,error:s?"":a.error,children:t.map(({name:n,target:h,entry:w,removable:A})=>{let g=[n,h].includes(f(o)??"");return e(J,{title:n,badges:e(M,{children:[g&&i[0]===o?e(B,{tone:"acc",children:"default for new tasks"}):null,g&&i[0]!==o?e(B,{children:["default for ",_[o]??o]}):null,w?.disabled?e(B,{children:"off"}):null]}),sub:h===n?void 0:`\u2192 ${h}`,actions:g||w?.disabled?null:e("button",{type:"button",class:"btn ghost sm",onClick:()=>void a.patch({engines:{[o]:{model:n}}}),children:"Make default"}),menu:e(D,{title:E(n)?"Enable":"Disable",onClick:()=>void d.send(()=>P.models[E(n)?"enable":"disable"](n),y)}),remove:A?{title:`Remove ${n}?`,body:"Tasks that ask for it stop running.",onRemove:()=>d.send(()=>P.models.remove(n),y)}:void 0},n)})},o))]})}export{Ee as ModelsList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{b as C}from"./field-
|
|
1
|
+
"use client";import{b as C}from"./field-329f272ef3edae30.js";import{g as $}from"./format-b19b8eec331414f4.js";import{$0a as h,$0b as r}from"./shared-init-cf66e1c1a2f30ef1.js";import{$4l as m,$4q as p,$4r as k}from"./shared-init-cf66e1c1a2f30ef1.js";import{$2a as u}from"./shared-init-bee5eaed36ee3dc4.js";import{$1b as g}from"./shared-init-bee5eaed36ee3dc4.js";import{$0a as t}from"./shared-init-bee5eaed36ee3dc4.js";import{$1c as l,$1g as c}from"./shared-init-8f2ac936c95a7f7b.js";function D({integration:a,apps:o,installed:I,createUrl:d,owners:n=[]}){let[v,f]=c(""),[M,b]=c(!1),i=(e="")=>e?`${d}&owner=${encodeURIComponent(e)}`:d,y=e=>{b(!0),f(""),g.apps.install(e,location.pathname).then(({url:s})=>{location.href=s}).catch(s=>{b(!1),f($(s))})};return o.length?t(l,{children:[I?null:t("button",{type:"button",class:"btn sm",disabled:M,onClick:()=>y(o[0].id),children:"Install"}),t(h,{summaryClass:"icon-btn",label:`More for ${a}`,wide:!0,summary:t(u,{d:p}),children:[o.map(e=>t(r,{icon:k,title:o.length>1?`Install ${e.name} on another account`:"Install on another account",sub:"Add this app to more repositories, another org, or another workspace.",onClick:()=>y(e.id)},e.id)),t(r,{icon:m,href:i(n[0]),title:`Create another ${a} app`,sub:"A separate app for an account this one cannot be installed on."})]}),t(C,{value:v})]}):t(l,{children:[t("a",{class:"btn sm",href:i(n[0]),title:n[0]?`Creates the app in ${n[0]}`:void 0,children:"Create app"}),n.length?t(h,{summaryClass:"icon-btn",label:`Where the ${a} app lives`,wide:!0,summary:t(u,{d:p}),children:[...n.slice(1),""].map(e=>t(r,{icon:m,href:i(e),title:e?`Create in ${e}`:"Create under your account",sub:"The app is private to where it lives."},e))}):null]})}export{D as PlatformActions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{f as Z}from"./list-
|
|
1
|
+
"use client";import{f as Z}from"./list-074a086ab5e19d77.js";import"./confirm-d804955ec454f00f.js";import{a as _}from"./badge-b8e1e1429e8418e8.js";import{d as Y}from"./composer-data-6f7608fed13f3dd7.js";import"./model-options-15c53331a2f28a4f.js";import{a as N}from"./select-f4ea2f12a2298e4a.js";import{a as X,c as K}from"./card-abb16544e8e5a5e0.js";import{a as B,b as I}from"./field-329f272ef3edae30.js";import{d as L,g as C}from"./format-b19b8eec331414f4.js";import{$0a as $,$0b as x}from"./shared-init-cf66e1c1a2f30ef1.js";import{$4A as M,$4B as Q,$4e as H,$4i as q,$4l as z,$4m as G,$4p as O,$4q as J,$4r as U,$4x as V}from"./shared-init-cf66e1c1a2f30ef1.js";import{$2a as b}from"./shared-init-bee5eaed36ee3dc4.js";import{$1b as u,$1d as A}from"./shared-init-bee5eaed36ee3dc4.js";import{$0a as e}from"./shared-init-bee5eaed36ee3dc4.js";import{$1c as T,$1g as l,$1i as E,$1k as j}from"./shared-init-8f2ac936c95a7f7b.js";var W={local:q,"local-docker":V,"vercel-sandbox":z,"github-actions":G,http:M},oe=new Set(["default","local"]),ee=[["personal","Just me"],["workspace","Workspace"]],ae=new Set(["owner","admin"]),re=n=>Date.now()-n<6e4?"just now":`${L(Date.now()-n).replace(/\.\d/,"")} ago`;function ie({runner:n,tested:s}){return s==="testing"?e("span",{class:"sub runner-status",children:[e("i",{class:"dot"}),"Testing\u2026"]}):s?e("span",{class:`sub runner-status ${s.ok?"ok":"bad"}`,children:[e("i",{class:"dot"}),s.ok?`Reached in ${L(s.ms)}`:s.detail]}):e("span",{class:`sub runner-status${n.online?" ok":""}`,children:[e("i",{class:"dot"}),n.online?"Online":n.lastSeen?`Last seen ${re(n.lastSeen)}`:"Not seen yet"]})}function le({runner:n,manage:s,onChange:i,onError:g}){let[k,c]=l(!1),[d,r]=l(!1),[v,a]=l(),m=j(null);E(()=>m.current?.select(),[d]);let R=oe.has(n.id),y=Z(s&&!R?{title:`Remove ${n.name}?`,body:"Its tasks go to another runner.",onRemove:()=>i(()=>u.runners.remove(n.id))}:void 0),p=()=>{a("testing"),u.runners.test(n.id).then(a,f=>{a(void 0),g(C(f))})};return e("tr",{children:[e("td",{children:[e("span",{class:"row-title",children:[e("b",{class:"runner-name",children:[e(b,{d:W[n.kind]??M}),d?e("input",{class:"runner-rename","aria-label":"Runner name",defaultValue:n.name,ref:m,onKeyDown:f=>{let o=f.currentTarget.value.trim();f.key==="Escape"&&r(!1),f.key==="Enter"&&o&&i(()=>u.runners.update(n.id,{name:o})).then(()=>r(!1))},onBlur:()=>r(!1)}):n.name]}),e(_,{children:n.scope}),n.default?e(_,{tone:"acc",children:"default"}):null]}),e(ie,{runner:n,tested:v})]}),e("td",{class:"acts",children:[n.default||!s?null:e("button",{type:"button",class:"btn secondary sm",disabled:k,"aria-busy":k,onClick:()=>{c(!0),i(()=>u.runners.update(n.id,{default:!0})).finally(()=>c(!1))},children:"Make default"}),e($,{summaryClass:"icon-btn",label:"Actions",summary:e(b,{d:J}),children:[e(x,{title:"Test",onClick:p}),s&&!R?e(x,{title:"Rename",onClick:()=>r(!0)}):null,y.item]}),y.dialog]})]})}function F({value:n}){let[s,i]=l(!1);return e("div",{class:"runner-cmd",children:[e("code",{children:n}),e("button",{type:"button",class:s?"icon-btn copied":"icon-btn","aria-label":s?"Copied":"Copy command",title:s?"Copied":"Copy command",onClick:()=>void navigator.clipboard.writeText(n).then(()=>i(!0)),children:e(b,{d:s?O:Q})})]})}function ue({pairing:n,onCancel:s}){return e("div",{class:"runner-pair",children:[e("details",{class:"runner-step",children:[e("summary",{children:"Install the Coder CLI on that computer, if it is not there yet"}),e(F,{value:"npm install -g @wular/coder"})]}),e("div",{class:"runner-step",children:[e("p",{children:"Run this there. The token works once and expires in 15 minutes."}),e(F,{value:n.command})]}),e("details",{class:"runner-step",children:[e("summary",{children:"Behind a firewall? This server has to reach that computer over HTTPS"}),e("p",{children:["Open a tunnel on that computer first, then add its address to the command above as"," ",e("code",{children:"--runner-url"}),"."]}),e(F,{value:"cloudflared tunnel --url http://localhost:4100"})]}),e("div",{class:"runner-wait",children:[e(K,{label:"Waiting for that computer to connect",inline:!0,dots:!0}),e("button",{type:"button",class:"btn secondary-danger sm",onClick:s,children:"Cancel"})]})]})}function de({catalog:n,admin:s,personal:i,known:g,onAdded:k}){let[c,d]=l(),[r,v]=l(i?"personal":"workspace"),[a,m]=l(!1),[R,y]=l(""),[p,f]=l(),o=n.find(t=>t.kind===c);E(()=>{if(!p)return;let t=Math.min(p.expiresAt,Date.now()+15*6e4),w=!0,D=A(async()=>{if(Date.now()>t)return P();let S=await u.runners.list();!w||!S.items.some(h=>!g.includes(h.id))||(k(S),P())},2e3);return()=>{w=!1,D()}},[p]);let P=()=>{f(void 0),d(void 0)},ne=t=>{y(""),f(void 0),d(t.kind),t.connect==="pair"&&(m(!0),u.runners.pair({scope:r}).then(f,w=>{d(void 0),y(C(w))}).finally(()=>m(!1)))};return e("form",{class:"runner-add",method:"post",onSubmit:async t=>{if(t.preventDefault(),!o||a)return;let w=Object.fromEntries([...new FormData(t.currentTarget)].map(([h,te])=>[h,String(te).trim()])),{name:D,...S}=w;m(!0),y("");try{await u.runners.add({kind:o.kind,name:D||o.name,scope:r,config:Object.fromEntries(Object.entries(S).filter(([,h])=>h))}),k(await u.runners.list()),d(void 0)}catch(h){y(C(h))}m(!1)},children:[e("div",{class:"runner-pick",children:[e($,{summaryClass:"btn secondary",label:"Runner kind",align:"left",wide:!0,summary:e(T,{children:[e(b,{d:o?W[o.kind]:U}),o?o.name:"Add a runner",e(b,{d:H})]}),children:n.filter(t=>t.available).map(t=>e("button",{type:"button",role:"menuitemradio","aria-checked":t.kind===c,class:"pop-item rich",onClick:()=>ne(t),children:[e(b,{d:W[t.kind]??M}),e("span",{class:"grow",children:[t.name,e("small",{children:t.available?t.description:t.reason})]}),e(b,{d:O})]},t.kind))}),o?.connect==="fields"?e(T,{children:[o.help?e("p",{class:"muted runner-help",children:o.help}):null,e("div",{class:"add-grid",children:[e(B,{label:"Name",hint:"shown in the list",children:e("input",{name:"name",placeholder:o.name,autocomplete:"off"})}),o.fields.map(t=>e(B,{label:t.label,hint:t.hint??(t.optional?"optional":void 0),children:e("input",{name:t.key,type:t.secret?"password":"text",placeholder:t.placeholder,required:!t.optional,autocomplete:"off"})},`${o.kind}:${t.key}`))]})]}):null,o?.connect==="fields"?e("div",{class:"runner-foot",children:[e(I,{value:R}),i?e(N,{label:"Who can use this runner",options:ee,value:s?r:"personal",onChange:v,disabled:!s}):null,e("button",{class:"btn","aria-busy":a,disabled:a,children:"Add runner"})]}):e(T,{children:[o&&i?e(N,{label:"Who can use this runner",options:ee,value:s?r:"personal",onChange:v,disabled:!s||!!p}):null,a&&!p?e(K,{label:"Pairing",inline:!0}):null,e(I,{value:R})]})]}),p?e(ue,{pairing:p,onCancel:P}):null]})}function Ie({first:n,me:s}){let[i,g]=l(n),[k,c]=l(""),d=!s.user||ae.has(s.organization?.role??""),r=Y(i.items);E(()=>A(()=>u.runners.list().then(g),3e4),[]);let v=async a=>{c("");try{return await a(),g(await u.runners.list()),!0}catch(m){return c(C(m)),!1}};return e(X,{title:"Runners",count:r.length,actions:e(I,{value:k}),children:[e("div",{class:"table-scroll",children:e("table",{class:"rows settings",children:e("tbody",{children:r.map(a=>e(le,{runner:a,manage:a.scope==="personal"||d,onChange:v,onError:c},a.id))})})}),e(de,{catalog:i.catalog,admin:d,personal:!!s.user,known:r.map(a=>a.id),onAdded:g})]})}export{Ie as RunnersList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$
|
|
1
|
+
import{$0a as o}from"./shared-init-bee5eaed36ee3dc4.js";function p({label:u,options:t,value:a,onChange:l,class:s,disabled:c}){let i=Math.max(0,t.findIndex(([e])=>e===a));return o("div",{class:s?`seg-btns ${s}`:"seg-btns",role:"radiogroup","aria-label":u,onKeyDown:e=>{let r=e.currentTarget.closest("form");if(e.key==="Enter"&&r)return e.preventDefault(),r.requestSubmit();let n={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];if(!n)return;e.preventDefault();let d=(i+n+t.length)%t.length;l(t[d][0]),e.currentTarget.children[d]?.focus()},children:t.map(([e,r],n)=>o("button",{type:"button",role:"radio","aria-checked":e===a,tabIndex:n===i?0:-1,disabled:c,onClick:()=>l(e),children:r},e))})}export{p as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$
|
|
1
|
+
import{$4e as S,$4p as T,$4r as W}from"./shared-init-cf66e1c1a2f30ef1.js";import{$2a as M}from"./shared-init-bee5eaed36ee3dc4.js";import{$0a as r}from"./shared-init-bee5eaed36ee3dc4.js";import{$1c as R,$1g as b,$1j as D,$1k as x,$1m as U}from"./shared-init-8f2ac936c95a7f7b.js";var z=10;function ne({label:$,options:o,value:P,defaultValue:B,onChange:F,name:L,disabled:V,headings:C,subs:k,action:c}){let[q,G]=b(B??o[0]?.[0]??""),u=Math.max(0,o.findIndex(([t])=>t===(P??q))),A=o[u]?.[0]??"",[a,K]=b(!1),[i,l]=b(u),[H,N]=b(""),w=x(null),p=x(null),v=x({text:"",at:0}),f=U(),h=(t=u)=>{l(t),K(!0)},m=(t=!0)=>{K(!1),t&&w.current?.focus()},g=t=>{if(c&&t===o.length){m(),c.onPick();return}let s=o[t]?.[0];m(),!(s===void 0||s===A)&&(P===void 0&&G(s),F?.(s))},O=(t,s)=>{let e=Date.now(),n=e-v.current.at>600?t:v.current.text+t;v.current={text:n,at:e};let d=/^(.)\1*$/.test(n)?n[0]:n,E=d.length===1?s+1:s;for(let y=0;y<o.length;y++){let I=(E+y)%o.length;if(o[I][1].toLowerCase().startsWith(d.toLowerCase()))return I}return-1},J=t=>{let s=o.length-1+(c?1:0),e=t.key;if(!a){if(["ArrowDown","ArrowUp","Enter"," "].includes(e))h();else if(e==="Home")h(0);else if(e==="End")h(s);else if(e.length===1&&!t.ctrlKey&&!t.metaKey){let n=O(e,u);if(n>=0)h(n);else return}else return;t.preventDefault();return}if(e==="ArrowDown")l(Math.min(s,i+1));else if(e==="ArrowUp"&&t.altKey)g(i);else if(e==="ArrowUp")l(Math.max(0,i-1));else if(e==="Home")l(0);else if(e==="End")l(s);else if(e==="PageDown")l(Math.min(s,i+z));else if(e==="PageUp")l(Math.max(0,i-z));else if(e==="Enter"||e===" "&&Date.now()-v.current.at>600)g(i);else if(e==="Escape")t.stopPropagation(),m();else if(e==="Tab"){g(i);return}else if(e.length===1&&!t.ctrlKey&&!t.metaKey){let n=O(e,i);n>=0&&l(n)}else return;t.preventDefault()};return D(()=>{if(!a)return;p.current?.showPopover();let t=()=>{let e=w.current?.getBoundingClientRect(),n=p.current;if(!e||!n)return;let d=innerHeight-e.bottom-12,E=d<Math.min(n.scrollHeight,240)&&e.top>d;N(`left:${Math.round(Math.min(e.left,innerWidth-n.offsetWidth-8))}px;min-width:${Math.round(e.width)}px;`+(E?`bottom:${Math.round(innerHeight-e.top+4)}px;max-height:${Math.round(Math.min(560,e.top-12))}px`:`top:${Math.round(e.bottom+4)}px;max-height:${Math.round(Math.min(560,d))}px`))};t();let s=e=>{let n=e.target;!w.current?.contains(n)&&!p.current?.contains(n)&&m(!1)};return addEventListener("resize",t),addEventListener("scroll",t,!0),document.addEventListener("pointerdown",s),()=>{removeEventListener("resize",t),removeEventListener("scroll",t,!0),document.removeEventListener("pointerdown",s)}},[a]),D(()=>{a&&p.current?.querySelector(`[data-index="${i}"]`)?.scrollIntoView({block:"nearest"})},[a,i,H]),r("span",{class:"select",children:[r("button",{ref:w,type:"button",role:"combobox","data-keep":!0,"aria-label":$,"aria-haspopup":"listbox","aria-expanded":a,"aria-controls":`${f}-list`,"aria-activedescendant":a?`${f}-${i}`:void 0,disabled:V,onClick:t=>{t.preventDefault(),a?m():h()},onKeyDown:J,children:[r("span",{class:"grow",children:o[u]?.[1]??""}),r(M,{d:S})]}),L?r("input",{type:"hidden",name:L,value:A}):null,a?r("div",{ref:p,id:`${f}-list`,class:"pop select-pop",popover:"manual",role:"listbox","aria-label":$,style:H||"visibility:hidden",onMouseDown:t=>t.preventDefault(),children:[o.map(([t,s],e)=>r(R,{children:[C?.[t]?r("p",{class:"pop-label",children:C[t]}):null,r("div",{id:`${f}-${e}`,"data-index":e,role:"option","aria-selected":e===u,class:e===i?"pop-item on":"pop-item",onPointerMove:()=>e!==i&&l(e),onClick:n=>{n.preventDefault(),g(e)},children:[r("span",{class:"grow",children:[s,k?.[t]?r("small",{class:"pop-path",children:r("bdi",{dir:"ltr",children:k[t]})}):null]}),r(M,{d:T})]})]},t)),c?r("div",{id:`${f}-${o.length}`,"data-index":o.length,role:"option","aria-selected":!1,class:i===o.length?"pop-item action on":"pop-item action",onPointerMove:()=>i!==o.length&&l(o.length),onClick:t=>{t.preventDefault(),g(o.length)},children:[r(M,{d:c.icon??W}),r("span",{class:"grow",children:c.label})]}):null]}):null]})}export{ne as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$
|
|
1
|
+
import{$0a as p}from"./shared-init-bee5eaed36ee3dc4.js";import{$1i as g,$1k as u}from"./shared-init-8f2ac936c95a7f7b.js";function L(){let c=u(null);return g(()=>{let r=c.current,e=r.nextElementSibling??r.parentElement.nextElementSibling,t=e.closest(".page"),h=()=>{let s=e.classList.contains("stuck"),o=e.offsetHeight;e.classList.toggle("stuck",!s);let n=e.offsetHeight;return e.classList.toggle("stuck",s),Math.max(0,s?n-o:o-n)},i,l=()=>{i?.disconnect();let s=56-h();i=new IntersectionObserver(([o])=>{let n=!o.isIntersecting&&o.boundingClientRect.top<s;if(n===e.classList.contains("stuck"))return;let d=e.offsetHeight;t&&(t.style.paddingBottom=`${d}px`),e.classList.toggle("stuck",n),e.style.marginBottom=n?`${d-e.offsetHeight}px`:"",t&&(t.style.paddingBottom="")},{rootMargin:`${-s}px 0px 0px 0px`}),i.observe(r)};l();let f=e.offsetWidth,a=new ResizeObserver(()=>{t?.style.setProperty("--head",`${e.offsetHeight}px`),e.offsetWidth!==f&&(f=e.offsetWidth,l())});return a.observe(e,{box:"border-box"}),()=>{i?.disconnect(),a.disconnect(),t?.style.removeProperty("--head")}},[]),p("i",{class:"sentinel",ref:c})}export{L as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{$1a as u}from"./shared-init-8f2ac936c95a7f7b.js";var v=0;function m(e,t,s,n,i,a){t||(t={});var r,d,h=t;if("ref"in h)for(d in h={},t)d=="ref"?r=t[d]:h[d]=t[d];var c={type:e,props:h,key:s,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--v,__i:-1,__u:0,__source:i,__self:a};if(typeof e=="function"&&(r=e.defaultProps))for(d in r)h[d]===void 0&&(h[d]=r[d]);return u.vnode&&u.vnode(c),c}var l=class extends Error{code;hint;taskId;payload;approval;result;runId;status;constructor(e,t,s={}){super(t),this.name="CoderError",this.code=e,Object.assign(this,s)}},w=class extends l{constructor(e,t,s="",n){super("server",t,{status:e,...n?{hint:n}:{}}),this.authenticate=s}};function k(e){try{let t=new URL(e).hostname.toLowerCase();return t==="localhost"||t==="[::1]"||/^127(?:\.\d{1,3}){3}$/.test(t)}catch{return!1}}function $(e){let t;try{t=new URL(e)}catch{throw new l("invalid-option","Give the server as a URL, e.g. https://agents.example.com.")}if(t.protocol!=="https:"&&!(t.protocol==="http:"&&k(t.origin)))throw new l("invalid-option","Coder servers require HTTPS unless they are loopback.",{hint:"Use https://, or http://localhost for a local server."});if(t.username||t.password||t.search||t.hash)throw new l("invalid-option","The server must be an origin without credentials, query, or fragment.");return t.toString().replace(/\/+$/,"")}var p=(e,t,s)=>`/admin/credentials/${encodeURIComponent(e)}${t}${s?"?workspace":""}`,o=(e,t)=>{let s=new URLSearchParams;"cursor"in t&&typeof t.cursor=="string"&&s.set("cursor",t.cursor);for(let[n,i]of Object.entries(t))n!=="cursor"&&i!==void 0&&i!==!1&&i!==""&&s.set(n,i===!0?"1":Array.isArray(i)?i.join(","):String(i));return`${e}?${s}`},q=new Set(["completed","failed","cancelled"]),y=class{url;fetchImpl;organization;renewal;onError;token;cookie;constructor(e,t,s={}){if(this.cookie="cookie"in t,this.url=e?$(e):"",!this.cookie&&!this.url)throw new l("invalid-option","Bearer clients need a server URL.");this.token="token"in t?t.token:void 0,this.fetchImpl=s.fetch??((n,i)=>fetch(n,i)),this.organization=s.organization,this.renewal=s.renewal,this.onError=s.onError}request(e,t={}){let s=this.read(e,t);return s.catch(()=>{}),s}async read(e,t){this.renewal&&this.renewal.expiresAt()-Date.now()<3e4&&(this.token=await this.renewal.renew());let s=await this.send(e,t);s.status===401&&this.renewal&&/invalid_token/.test(s.headers.get("www-authenticate")??"")&&(this.token=await this.renewal.renew(),s=await this.send(e,t));let n=await s.text().catch(()=>""),i={},a;try{n&&s.status!==204&&(i=JSON.parse(n))}catch{if(s.ok)throw new l("server",`The server answered ${s.status} with a body that is not JSON.`);this.cookie&&n&&(a=n)}if(!s.ok){let r=new w(s.status,i.error??i.message??a??`The server answered ${s.status}.`,s.headers.get("www-authenticate")??"",i.hint);throw this.onError?.(r),r}return i}send(e,t){let s=new Headers(t.headers);return t.body&&!s.has("content-type")&&s.set("content-type","application/json"),this.cookie||s.set("authorization",`Bearer ${this.token}`),this.organization&&s.set("x-coder-organization",this.organization),this.fetchImpl(`${this.url}${e}`,{...t,headers:s,...this.cookie?{credentials:"same-origin"}:{}}).catch(n=>{throw n instanceof l||n.name==="AbortError"?n:new l("server",this.url?`No Coder server answers at ${this.url}: ${n.message}`:"The server did not answer. Check the connection and try again.")})}post(e,t){return this.request(e,{method:"POST",...t!==void 0?{body:JSON.stringify(t)}:{}})}me(){return this.request("/me")}info(){return this.request("/api/auth/capabilities")}linkAccount(e){return this.post("/connect",{token:e})}signOut(){return this.post("/api/auth/sign-out",{})}agents={list:e=>this.request(o("/admin/agents",{...e,...e?.connect?{connect:1}:{}})),get:(e,t)=>this.request(o(`/admin/agents/${encodeURIComponent(e)}`,{...t?.versions===!1?{versions:0}:{},...t?.content===!1?{content:0}:{}})),versions:(e,t={})=>this.request(o(`/admin/agents/${encodeURIComponent(e)}/versions`,t)),remove:e=>this.request(`/admin/agents/${encodeURIComponent(e)}`,{method:"DELETE"}),preview:(e,t)=>this.request(o("/admin/agents/import",{repo:e,ref:t})),version:(e,t)=>this.request(`/admin/agents/${encodeURIComponent(e)}/versions/${t}`),put:(e,t)=>this.request(`/admin/agents/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}).then(s=>({id:e,version:s.version,unchanged:s.unchanged})),settings:(e,t)=>this.request(`/admin/agents/${encodeURIComponent(e)}/settings`,{method:"PATCH",body:JSON.stringify(t)}),import:(e,t,s)=>this.post("/admin/agents/import",{repo:e,ref:t,...s?{agents:s}:{}})};folders={list:()=>this.request("/admin/folders"),check:e=>this.post("/admin/folders/check",{path:e}),clone:e=>this.post("/admin/folders/clone",{url:e}),pick:()=>this.post("/admin/folders/pick",{})};tasks={run:e=>this.post("/admin/tasks",e),list:e=>this.request(o("/admin/tasks",{limit:20,...e,...e?.archived?{archived:1}:{},...e?.summary?{summary:1}:{},...e?.counts?{counts:1}:{}})),get:e=>this.request(`/admin/tasks/${encodeURIComponent(e)}`),logs:(e,t=-1,s)=>this.request(o(`/admin/tasks/${encodeURIComponent(e)}/logs`,{after:t,limit:s})),stream:(e,t=-1,s)=>this.send(`/admin/tasks/${encodeURIComponent(e)}/stream?after=${t}`,{headers:{accept:"text/event-stream"},signal:s}),events:(e,t,s)=>this.send(o("/admin/events",{tasks:e}),{headers:{accept:"text/event-stream",...t?{"last-event-id":t}:{}},signal:s}),cancel:e=>this.post(`/admin/tasks/${encodeURIComponent(e)}/cancel`),steer:(e,t,s={})=>this.post(`/admin/tasks/${encodeURIComponent(e)}/steer`,{text:t,...s}),ask:(e,t)=>this.post(`/admin/tasks/${encodeURIComponent(e)}/ask`,{question:t}),approve:(e,t,s)=>this.post(`/admin/tasks/${encodeURIComponent(e)}/approve`,{approvalId:t,decision:s}),archive:e=>this.post(`/admin/tasks/${encodeURIComponent(e)}/archive`),delete:e=>this.request(`/admin/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),create:e=>this.post("/admin/tasks",e),wait:async(e,t={})=>{let s=-1;for(;;){let n=await this.tasks.stream(e,s);if(!n.ok||!n.body){let a=await this.tasks.get(e);if(q.has(a.status))return a;if(n.status===401)continue;throw new l("server",`The task stream answered ${n.status}.`)}let i=!1;for await(let a of g(n.body))if(a.event==="log"){let r=JSON.parse(a.data);s=r.seq,t.onLog?.(r)}else a.event==="end"&&(i=!0);if(i)return this.tasks.get(e)}}};credentials={list:e=>this.request(o("/admin/credentials",e??{})),add:e=>this.post("/admin/credentials",e),remove:(e,{workspace:t}={})=>this.request(p(e,"",t),{method:"DELETE"}),setDefault:(e,{workspace:t}={})=>this.post(p(e,"/default",t)),login:e=>this.post("/admin/logins",{engine:e}),loginStatus:e=>this.request(`/admin/logins/${encodeURIComponent(e)}`),loginCode:(e,t)=>this.post(`/admin/logins/${encodeURIComponent(e)}`,{code:t}),cancelLogin:e=>this.request(`/admin/logins/${encodeURIComponent(e)}`,{method:"DELETE"})};runners={list:()=>this.request("/admin/runners"),add:e=>this.post("/admin/runners",e),pair:e=>this.post("/admin/runners/pair",e),update:(e,t)=>this.request(`/admin/runners/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)}),test:e=>this.post(`/admin/runners/${encodeURIComponent(e)}/test`,{}),remove:e=>this.request(`/admin/runners/${encodeURIComponent(e)}`,{method:"DELETE"})};integrations={list:()=>this.request("/admin/integrations")};repositories={list:()=>this.request("/admin/repositories")};engines={status:()=>this.request("/admin/engines/status"),login:e=>this.post(`/admin/engines/${encodeURIComponent(e)}/login`,{}),logout:e=>this.post(`/admin/engines/${encodeURIComponent(e)}/logout`,{})};apps={list:e=>this.request(o("/admin/apps",{agent:e})),install:(e,t)=>this.post(o(`/admin/apps/${encodeURIComponent(e)}/install`,{back:t}))};installations={list:e=>this.request(o("/admin/installations",{agent:e}))};connections={add:e=>this.post("/admin/connections",e)};config={get:()=>this.request("/admin/config"),put:e=>this.request("/admin/config",{method:"PUT",body:JSON.stringify(e)}),patch:e=>this.request("/admin/config",{method:"PATCH",headers:{"content-type":"application/merge-patch+json"},body:JSON.stringify(e)})};models={list:()=>this.request("/admin/models"),add:e=>this.post("/admin/models",e),probe:e=>this.post("/admin/models/probe",e),remove:e=>this.request(`/admin/models/${encodeURIComponent(e)}`,{method:"DELETE"}),alias:(e,t)=>this.post(`/admin/models/${encodeURIComponent(e)}/alias`,{spec:t}),enable:e=>this.post(`/admin/models/${encodeURIComponent(e)}/enable`),disable:e=>this.post(`/admin/models/${encodeURIComponent(e)}/disable`)};mcp={list:()=>this.request("/admin/mcp"),add:e=>this.post("/admin/mcp",e),remove:e=>this.request(`/admin/mcp/${encodeURIComponent(e)}`,{method:"DELETE"}),search:e=>this.request(o("/admin/mcp-registry",{q:e}))};flows={list:e=>this.request(o("/admin/flows",{repo:e})),run:(e,t)=>this.post(`/admin/flows/${encodeURIComponent(e)}/run`,t)};pulls={list:e=>this.request(o("/admin/pulls",{repo:e}))};review(e){return this.post("/admin/review",e)}usage(e={}){return this.request(o("/admin/usage/totals",{...e,since:e.since??Date.now()-10080*60*1e3}))}usageRows(e){return this.request(o("/admin/usage",{installation:e}))}};async function*g(e){let t=new TextDecoder,s="";for await(let n of e){s+=t.decode(n,{stream:!0});let i;for(;(i=s.indexOf(`
|
|
2
|
+
|
|
3
|
+
`))>=0;){let a=s.slice(0,i);s=s.slice(i+2);let r="message",d,h=[];for(let c of a.split(`
|
|
4
|
+
`))c.startsWith("event: ")?r=c.slice(7):c.startsWith("data: ")?h.push(c.slice(6)):c.startsWith("id: ")&&(d=c.slice(4));(h.length||d)&&(yield{event:r,data:h.join(`
|
|
5
|
+
`),...d?{id:d}:{}})}}}var f=new y("",{cookie:!0},{onError(e){e.status===401&&(e.authenticate||/^Sign in/.test(e.message))&&(location.href=`/login?return=${encodeURIComponent(location.pathname+location.search)}`)}});async function C(){let{url:e}=await f.signOut();location.href=e??"/?signed_out=1"}function U(e,t){let s,n=!1,i=()=>{n||(s=setTimeout(a,t))},a=()=>{if(document.visibilityState==="hidden")return i();e().catch(()=>{}).finally(i)};return i(),()=>{n=!0,clearTimeout(s)}}function I({d:e,class:t}){return m("svg",{class:t?`ic ${t}`:"ic",viewBox:"0 0 24 24","aria-hidden":"true",children:m("path",{d:e})})}function R(){return m("svg",{class:"coder-mark",viewBox:"0 0 16 16","aria-hidden":"true",children:m("path",{d:"M5 0h3v3h-3zM9 0h3v3h-3zM13 0h3v3h-3zM0 4h3v3h-3zM0 9h3v3h-3zM5 13h3v3h-3zM9 13h3v3h-3zM13 13h3v3h-3z"})})}export{m as $0a,g as $1a,f as $1b,C as $1c,U as $1d,I as $2a,R as $2b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var Le="M12 8V4H8M6 8h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2ZM2 14h2M20 14h2M15 13v2M9 13v2",Se="M22 12h-4l-3 9L9 3l-3 9H2",Ce="M3 3v18h18M18 17V9M13 17V5M8 17v-3",H="m15 18-6-6 6-6",Pe="m6 9 6 6 6-6",j="m9 18 6-6-6-6",R="M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M6.3 17.7l-1.4 1.4M19.1 4.9l-1.4 1.4",O="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",N="M4 4h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1ZM8 20h8M12 16v4",Te="M2 15.5a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0M21 2l-9.6 9.6M15.5 7.5l3 3L22 7l-3-3",V="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9",Ie="m12 3 1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9ZM19 3v4M17 5h4",Ae="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.7-.9l-.8-1.2A2 2 0 0 0 7.9 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2ZM10 13a2 2 0 1 0 4 0a2 2 0 1 0 -4 0M14 13h3M7 13h3",U="M4 6h16M4 12h16M4 18h16",He="M18 6 6 18M6 6l12 12",_="M20 6 9 17l-5-5",je="M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",Re="M12 5v14M5 12h14",Oe="M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12Z",Ne="M4 12h12M12 6l6 6-6 6",Ve="M16 4h4v4M20 4l-7 7M4 20l6-6M16 20h4v-4M20 20l-5-5M4 4l5 5",Ue="M4 11a7 7 0 1 0 14 0a7 7 0 1 0 -14 0M20 20l-3.5-3.5",qe="m21.7 18-8-14a2 2 0 0 0-3.4 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.7-3M12 9v4M12 17h.01",Ze="m4 17 6-6-6-6M12 19h8",Be="M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.7-.9l-.8-1.2A2 2 0 0 0 7.9 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",De="M12 7v5l3 2M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",We="M9 2v6M15 2v6M6 8h12v4a6 6 0 0 1-12 0ZM12 18v4",Fe="M9 9h11v11H9ZM5 15H4V4h11v1",ze="M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6";import{$1a as q}from"./shared-init-66a0fdc8472e9b2f.js";import{$2a as h}from"./shared-init-66a0fdc8472e9b2f.js";import{$1c as Ke,$1k as Xe,$1m as ne}from"./shared-init-8f2ac936c95a7f7b.js";function Je({summary:e,summaryClass:t,label:r,tip:a,align:n="right",wide:s,class:i,children:l}){let f=ne();return h("span",{class:`menu ${n}${i?` ${i}`:""}`,children:[h("button",{popovertarget:f,type:"button",class:t,"aria-label":r,title:a?void 0:r,"data-tip":a,children:e}),h("div",{id:f,class:s?"pop wide":"pop",popover:"auto",onBeforeToggle:m=>{if(m.newState!=="open")return;let w=m.currentTarget,o=w.parentElement?.querySelector("button")?.getBoundingClientRect();if(!o)return;let d=n==="up"?o.top-20:window.innerHeight-o.bottom-20;w.style.maxHeight=`${Math.max(120,Math.round(d))}px`},onClick:m=>{m.target.closest("a, button:not([data-keep])")&&m.currentTarget.hidePopover()},children:l})]})}function Ye({icon:e,title:t,sub:r,href:a,onClick:n,danger:s}){let i=h(Ke,{children:[e?h(q,{d:e}):null,h("span",{class:"grow",children:[t,r?h("small",{children:r}):null]})]}),l=`pop-item${r?" rich":""}${s?" danger":""}`;return a?h("a",{class:l,href:a,.../^https?:\/\//.test(a)?{target:"_blank",rel:"noreferrer"}:{},children:i}):h("button",{type:"button",class:l,onClick:n,children:i})}function Ge({label:e,children:t}){let r=ne(),a=Xe(null),n=s=>i=>{i.pointerType==="mouse"&&a.current.togglePopover(s)};return h("span",{class:"more",onPointerEnter:n(!0),onPointerLeave:n(!1),children:[h("button",{popovertarget:r,type:"button",children:e}),h("div",{id:r,ref:a,class:"more-list scroll-box",popover:"auto",children:t})]})}function Qe({on:e,onPick:t,icon:r,children:a}){return h("button",{type:"button",role:"menuitemradio","aria-checked":e,class:e?"pop-item on":"pop-item",onClick:t,children:[typeof r=="string"?h(q,{d:r}):r,h("span",{class:"grow",children:a}),e?h(q,{d:_}):null]})}function L(e,t={}){let r=tt(at(e,t.params??{})),a=nt(t.search),n=ot(t.hash);return`${r}${a}${n}`}function et(){return window.__PNEXT_TRAILING_SLASH__===!0}function B(){let e=window.__PNEXT_PREFETCH__;return e===void 0?"visible":e}function tt(e){let[,t="",r=""]=/^([^?#]*)([\s\S]*)$/.exec(e)??[];return t.startsWith("/")?et()?t==="/"||t.endsWith("/")||/\.[^/]+$/.test(t)?e:`${t}/${r}`:t==="/"||!t.endsWith("/")||/\.[^/]+\/$/.test(t)?e:`${t.replace(/\/+$/,"")}${r}`:e}function at(e,t){let r=e.replace(/\[\[\.\.\.([^\]]+)\]\]/g,(a,n)=>Z(t[n],!0)).replace(/\[\.\.\.([^\]]+)\]/g,(a,n)=>Z(t[n],!0)).replace(/\[([^\]]+)\]/g,(a,n)=>Z(t[n],!1));return rt(r)}function rt(e){return e.length<=1?e:e.replace(/\/+$/,"")||"/"}function Z(e,t){if(Array.isArray(e)){let r=e.map(a=>encodeURIComponent(a));return t?r.join("/"):r[0]??""}return encodeURIComponent(e??"")}function nt(e){if(!e)return"";let t=(e instanceof URLSearchParams?e:st(e)).toString();return t?`?${t}`:""}function st(e){let t=new URLSearchParams;for(let[r,a]of Object.entries(e)){let n=Array.isArray(a)?a:[a];for(let s of n)s!=null&&t.append(r,String(s))}return t}function ot(e){return e?e.startsWith("#")?e:`#${e}`:""}import{$1b as it,$1i as lt,$1k as ct}from"./shared-init-8f2ac936c95a7f7b.js";function S({href:e,params:t,prefetch:r,replace:a,scroll:n,search:s,hash:i,onClick:l,onNavigate:f,onPrefetchStart:m,onPrefetchFinish:w,children:o,...d}){let u=L(e,{params:t??{},search:s,hash:i}),p=r??B(),E=dt(m,w);return it("a",{...d,ref:E,href:u,"data-pnext-link":!0,"data-prefetch":p===!1?"false":p,"data-pnext-replace":a?"true":void 0,"data-pnext-scroll":n===!1?"false":void 0,onClick:c=>{let b=c;if(l?.(b),b.defaultPrevented||!f||!pt(b))return;let x=ut();f(x),x.defaultPrevented&&b.preventDefault()}},o)}function dt(e,t){let r=ct(null);return lt(()=>{let a=r.current;if(!a||!e&&!t)return;let n=()=>e?.(),s=()=>t?.();return a.addEventListener("pnext:prefetchstart",n),a.addEventListener("pnext:prefetchfinish",s),()=>{a.removeEventListener("pnext:prefetchstart",n),a.removeEventListener("pnext:prefetchfinish",s)}},[e,t]),r}function ut(){return{defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}}}function pt(e){return e.button===0&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.currentTarget.target&&!e.currentTarget.download}import{f as ht,i as ft,j as se,k as oe}from"./wular-pnext-37175329f2865f15-0.js";import{$1a as de,$1b as mt}from"./shared-init-37175329f2865f15-2.js";import{$0a as vt,$0d as wt}from"./shared-init-37175329f2865f15-2.js";import{$1a as gt,$1g as ue,$1i as pe}from"./shared-init-8f2ac936c95a7f7b.js";var I=class extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}},bt=class extends URLSearchParams{append(){throw new I}delete(){throw new I}set(){throw new I}sort(){throw new I}};ht();function W(){return yt}var yt={push(e,...[t]){ce(D(e,t),"push",t?.scroll)},replace(e,...[t]){ce(D(e,t),"replace",t?.scroll)},prefetch(e,...[t]){mt(D(e,t),{strict:!0,full:t?.kind==="full",onInvalidate:t?.onInvalidate})},refresh(){de(window.location.href,{replace:!0,scroll:!1})},back(){window.history.back()},forward(){window.history.forward()},get bfcacheId(){return kt().bfcacheId??""}};function D(e,t){return Mt(t)?L(e,t):String(e)}function Mt(e){return!!(e&&("params"in e||"search"in e||"hash"in e))}function $(){return he().pathname}function $t(){return new bt(he().search)}function F(){let e=gt,t=e.__h,r;e.__h=(s,...i)=>{r=s.__P,t?.(s,...i)};let[a,n]=ue(!1);return e.__h=t,pe(()=>{let s=r?.closest("a[data-pnext-link]");if(!s)return;let i=s.__pnextHints??=new Set;return i.add(n),()=>i.delete(n)},[]),{pending:a}}function he(){let e=le(),[,t]=ue(()=>ie(e));return pe(()=>{Et();let r=()=>t(a=>{let n=ie(le());return a===n?a:n});return se().add(r),r(),()=>se().delete(r)},[]),e}function ie(e){return`${e.pathname}${e.search}${e.hash}`}function le(){return{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash}}function kt(){let e=history.state??{},t=window.__PNEXT_ROUTE__??{},r=typeof e.__pnextBfcacheId=="string"?e.__pnextBfcacheId:void 0;return r?{...t,bfcacheId:r}:t}function ce(e,t,r=!0){if(wt(e))return;let a=new URL(e,window.location.href);if(a.origin!==window.location.origin){let n=globalThis;n.__pnextMpaNavigation=(n.__pnextMpaNavigation??0)+1,requestAnimationFrame(()=>requestAnimationFrame(()=>{t==="replace"?window.location.replace(a.href):window.location.assign(a.href)}));return}if(a.pathname!==window.location.pathname||a.search!==window.location.search){de(a.href,{replace:t==="replace",scroll:r});return}t==="replace"?window.history.replaceState(history.state,"",a):window.history.pushState(history.state,"",a),ft(a,{scroll:r}),vt.settleLink?.()}function Et(){if(window.__PNEXT_HISTORY_PATCHED__)return;window.__PNEXT_HISTORY_PATCHED__=!0;let e=window.history.pushState.bind(window.history),t=window.history.replaceState.bind(window.history);function r(a){let n=window.history.state??{},s={};for(let l of Object.keys(n))l.startsWith("__pnext")&&(s[l]=n[l]);if(Object.keys(s).length===0)return a;let i=a??{};return Object.keys(i).some(l=>l.startsWith("__pnext"))?a:{...i,...s}}window.history.pushState=function(a,n,s){let i=window.location.href,l=e(r(a),n,s);return window.location.href!==i&&oe(),l},window.history.replaceState=function(a,n,s){let i=window.location.href,l=t(r(a),n,s);return window.location.href!==i&&oe(),l}}import{$1a as C}from"./shared-init-66a0fdc8472e9b2f.js";import{$0c as xt}from"./shared-init-66a0fdc8472e9b2f.js";import{$2a as v}from"./shared-init-66a0fdc8472e9b2f.js";import{$1c as fe,$1g as K,$1i as z,$1j as _t,$1k as Lt}from"./shared-init-8f2ac936c95a7f7b.js";var St=e=>{let t=e.params??{};return e.href.replace(/\[([^\]]+)\]/g,(r,a)=>encodeURIComponent(String(t[a]??"")))};function Ct(e,t){let r=new URLSearchParams((e instanceof URLSearchParams,e));for(let[a,n]of Object.entries(t))r.set(a,n);return r}function Pt({within:e,children:t,onClick:r,...a}){let n=$(),s=n===St(a)||e!==void 0&&(n===e||n.startsWith(`${e}/`)),i=Lt(null);return v(S,{...a,"aria-current":s?"page":void 0,onClick:l=>{i.current=l.currentTarget,r?.(l)},children:[t,v(Tt,{anchor:i,current:s})]})}function Tt({anchor:e,current:t}){let{pending:r}=F();return _t(()=>{e.current&&(r&&!t?e.current.setAttribute("data-pending",""):e.current.removeAttribute("data-pending"))},[r,t]),null}var It=3600*24*365,At=[["light","Light",R],["dark","Dark",O],["system","System",N]];function Ht({theme:e}){let[t,r]=K(e),a=n=>{let s=document.documentElement;n==="system"?delete s.dataset.theme:s.dataset.theme=n,document.cookie=`theme=${n}; path=/; max-age=${It}; samesite=lax`,r(n)};return v(fe,{children:At.map(([n,s,i])=>v("button",{type:"button",class:"pop-item",role:"menuitemradio","aria-checked":t===n,onClick:()=>a(n),children:[v(C,{d:i}),v("span",{class:"grow",children:s}),v(C,{d:_})]},n))})}function jt({class:e,icon:t,children:r}){return v("button",{type:"button",class:e,onClick:()=>void xt().catch(()=>location.reload()),children:[t?v(C,{d:V}):null,r]})}function Rt(){let[e,t]=K(!1),r=$();return z(()=>t(!1),[r]),z(()=>{if(document.documentElement.classList.toggle("drawer",e),!e)return;let a=n=>n.key==="Escape"&&t(!1);return addEventListener("keydown",a),()=>removeEventListener("keydown",a)},[e]),v(fe,{children:[v("button",{type:"button",class:"icon-btn only-m","aria-label":"Open navigation",onClick:()=>t(!e),children:v(C,{d:U})}),v("div",{class:"scrim",onClick:()=>t(!1)})]})}var Ot="side";function Nt({collapsed:e}){let[t,r]=K(e);return z(()=>{let a=document.querySelector(".app");if(!a)return;let n=()=>r(a.classList.contains("side-min"));n();let s=new MutationObserver(n);return s.observe(a,{attributes:!0,attributeFilter:["class"]}),()=>s.disconnect()},[]),v("button",{type:"button",class:"icon-btn side-toggle","aria-label":t?"Expand sidebar":"Collapse sidebar","data-tip":t?"Expand sidebar":"Collapse sidebar",onClick:()=>{let a=!t;document.querySelector(".app")?.classList.toggle("side-min",a),document.cookie=`${Ot}=${a?"min":"max"}; path=/; max-age=31536000; samesite=lax`},children:v(C,{d:t?j:H})})}import{$0a as Vt,$0b as Ut}from"./shared-init-66a0fdc8472e9b2f.js";import{$2a as g}from"./shared-init-66a0fdc8472e9b2f.js";import{$1g as me,$1i as M,$1k as k}from"./shared-init-8f2ac936c95a7f7b.js";function be({status:e}){return g("span",{class:`st ${e}`,children:[g("i",{}),ye[e]??e]})}var ye={queued:"waiting for slot",running:"running",waiting:"needs approval",completed:"completed",failed:"failed",cancelled:"cancelled"},P="coder:watched",Me="coder:notify",A="coder:toast",ee=new Set(["completed","failed","cancelled"]),qt=new Set([...ee,"waiting"]),Zt=20,ve=3,Bt=8e3,we="coder:events",X="coder:task",J="coder:task-replay",Y="coder:task-reset",G="coder:task-resync",Dt=6e4,Wt=200,Q=()=>{try{return JSON.parse(localStorage.getItem(P)??"{}")??{}}catch{return{}}},$e=e=>{let t=Object.entries(e).sort(([,r],[,a])=>a.at-r.at).slice(0,Zt);localStorage.setItem(P,JSON.stringify(Object.fromEntries(t))),dispatchEvent(new Event(P))},ke=(e,t,r)=>dispatchEvent(new CustomEvent(A,{detail:{title:e,line:t,err:r}})),Ft=(e,t)=>ke(e,t,!0);function Ee(e,t,r){let a=Q(),n=a[e];!n&&ee.has(t)||n?.status===t&&(!r||n.title===r)||(a[e]={title:r||n?.title||e,status:t,at:n?.at??Date.now()},$e(a))}var ge=e=>/^\/dash\/tasks\/([^/]+)$/.exec(e)?.[1];function zt(e){let t=n=>typeof n=="string"?n.trim().split(`
|
|
2
|
-
`)[0]:"",r=e.approval??{},a=typeof e.result=="object"?e.result?.output:e.result;return e.status==="waiting"?t(r.summary)||t(r.reason)||t(r.kind)||"It is waiting for your approval.":e.status==="completed"?t(a)||"It finished.":t(e.error)||(e.status==="failed"?"It failed.":"It was stopped.")}function
|
|
1
|
+
var Le="M12 8V4H8M6 8h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2ZM2 14h2M20 14h2M15 13v2M9 13v2",Se="M22 12h-4l-3 9L9 3l-3 9H2",Ce="M3 3v18h18M18 17V9M13 17V5M8 17v-3",H="m15 18-6-6 6-6",Pe="m6 9 6 6 6-6",j="m9 18 6-6-6-6",R="M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M6.3 17.7l-1.4 1.4M19.1 4.9l-1.4 1.4",O="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",N="M4 4h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1ZM8 20h8M12 16v4",Te="M2 15.5a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0M21 2l-9.6 9.6M15.5 7.5l3 3L22 7l-3-3",V="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9",Ie="m12 3 1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9ZM19 3v4M17 5h4",Ae="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.7-.9l-.8-1.2A2 2 0 0 0 7.9 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2ZM10 13a2 2 0 1 0 4 0a2 2 0 1 0 -4 0M14 13h3M7 13h3",U="M4 6h16M4 12h16M4 18h16",He="M18 6 6 18M6 6l12 12",x="M20 6 9 17l-5-5",je="M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",Re="M12 5v14M5 12h14",Oe="M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12Z",Ne="M4 12h12M12 6l6 6-6 6",Ve="M16 4h4v4M20 4l-7 7M4 20l6-6M16 20h4v-4M20 20l-5-5M4 4l5 5",Ue="M4 11a7 7 0 1 0 14 0a7 7 0 1 0 -14 0M20 20l-3.5-3.5",qe="m21.7 18-8-14a2 2 0 0 0-3.4 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.7-3M12 9v4M12 17h.01",Ze="m4 17 6-6-6-6M12 19h8",Be="M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.7-.9l-.8-1.2A2 2 0 0 0 7.9 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",De="M12 7v5l3 2M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",We="M9 2v6M15 2v6M6 8h12v4a6 6 0 0 1-12 0ZM12 18v4",Ke="M9 9h11v11H9ZM5 15H4V4h11v1",ze="M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6";import{$2a as q}from"./shared-init-bee5eaed36ee3dc4.js";import{$0a as h}from"./shared-init-bee5eaed36ee3dc4.js";import{$1c as Fe,$1k as Xe,$1m as ne}from"./shared-init-8f2ac936c95a7f7b.js";function Je({summary:e,summaryClass:t,label:r,tip:a,align:n="right",wide:s,class:i,children:l}){let f=ne();return h("span",{class:`menu ${n}${i?` ${i}`:""}`,children:[h("button",{popovertarget:f,type:"button",class:t,"aria-label":r,title:a?void 0:r,"data-tip":a,children:e}),h("div",{id:f,class:s?"pop wide":"pop",popover:"auto",onBeforeToggle:m=>{if(m.newState!=="open")return;let w=m.currentTarget,o=w.parentElement?.querySelector("button")?.getBoundingClientRect();if(!o)return;let d=n==="up"?o.top-20:window.innerHeight-o.bottom-20;w.style.maxHeight=`${Math.max(120,Math.round(d))}px`},onClick:m=>{m.target.closest("a, button:not([data-keep])")&&m.currentTarget.hidePopover()},children:l})]})}function Ye({icon:e,title:t,sub:r,href:a,onClick:n,danger:s}){let i=h(Fe,{children:[e?h(q,{d:e}):null,h("span",{class:"grow",children:[t,r?h("small",{children:r}):null]})]}),l=`pop-item${r?" rich":""}${s?" danger":""}`;return a?h("a",{class:l,href:a,.../^https?:\/\//.test(a)?{target:"_blank",rel:"noreferrer"}:{},children:i}):h("button",{type:"button",class:l,onClick:n,children:i})}function Ge({label:e,children:t}){let r=ne(),a=Xe(null),n=s=>i=>{i.pointerType==="mouse"&&a.current.togglePopover(s)};return h("span",{class:"more",onPointerEnter:n(!0),onPointerLeave:n(!1),children:[h("button",{popovertarget:r,type:"button",children:e}),h("div",{id:r,ref:a,class:"more-list scroll-box",popover:"auto",children:t})]})}function Qe({on:e,onPick:t,icon:r,children:a}){return h("button",{type:"button",role:"menuitemradio","aria-checked":e,class:e?"pop-item on":"pop-item",onClick:t,children:[typeof r=="string"?h(q,{d:r}):r,h("span",{class:"grow",children:a}),e?h(q,{d:x}):null]})}function L(e,t={}){let r=tt(at(e,t.params??{})),a=nt(t.search),n=ot(t.hash);return`${r}${a}${n}`}function et(){return window.__PNEXT_TRAILING_SLASH__===!0}function B(){let e=window.__PNEXT_PREFETCH__;return e===void 0?"visible":e}function tt(e){let[,t="",r=""]=/^([^?#]*)([\s\S]*)$/.exec(e)??[];return t.startsWith("/")?et()?t==="/"||t.endsWith("/")||/\.[^/]+$/.test(t)?e:`${t}/${r}`:t==="/"||!t.endsWith("/")||/\.[^/]+\/$/.test(t)?e:`${t.replace(/\/+$/,"")}${r}`:e}function at(e,t){let r=e.replace(/\[\[\.\.\.([^\]]+)\]\]/g,(a,n)=>Z(t[n],!0)).replace(/\[\.\.\.([^\]]+)\]/g,(a,n)=>Z(t[n],!0)).replace(/\[([^\]]+)\]/g,(a,n)=>Z(t[n],!1));return rt(r)}function rt(e){return e.length<=1?e:e.replace(/\/+$/,"")||"/"}function Z(e,t){if(Array.isArray(e)){let r=e.map(a=>encodeURIComponent(a));return t?r.join("/"):r[0]??""}return encodeURIComponent(e??"")}function nt(e){if(!e)return"";let t=(e instanceof URLSearchParams?e:st(e)).toString();return t?`?${t}`:""}function st(e){let t=new URLSearchParams;for(let[r,a]of Object.entries(e)){let n=Array.isArray(a)?a:[a];for(let s of n)s!=null&&t.append(r,String(s))}return t}function ot(e){return e?e.startsWith("#")?e:`#${e}`:""}import{$1b as it,$1i as lt,$1k as ct}from"./shared-init-8f2ac936c95a7f7b.js";function S({href:e,params:t,prefetch:r,replace:a,scroll:n,search:s,hash:i,onClick:l,onNavigate:f,onPrefetchStart:m,onPrefetchFinish:w,children:o,...d}){let u=L(e,{params:t??{},search:s,hash:i}),p=r??B(),E=dt(m,w);return it("a",{...d,ref:E,href:u,"data-pnext-link":!0,"data-prefetch":p===!1?"false":p,"data-pnext-replace":a?"true":void 0,"data-pnext-scroll":n===!1?"false":void 0,onClick:c=>{let b=c;if(l?.(b),b.defaultPrevented||!f||!pt(b))return;let _=ut();f(_),_.defaultPrevented&&b.preventDefault()}},o)}function dt(e,t){let r=ct(null);return lt(()=>{let a=r.current;if(!a||!e&&!t)return;let n=()=>e?.(),s=()=>t?.();return a.addEventListener("pnext:prefetchstart",n),a.addEventListener("pnext:prefetchfinish",s),()=>{a.removeEventListener("pnext:prefetchstart",n),a.removeEventListener("pnext:prefetchfinish",s)}},[e,t]),r}function ut(){return{defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}}}function pt(e){return e.button===0&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.currentTarget.target&&!e.currentTarget.download}import{f as ht,i as ft,j as se,k as oe}from"./wular-pnext-37175329f2865f15-0.js";import{$1a as de,$1b as mt}from"./shared-init-37175329f2865f15-2.js";import{$0a as vt,$0d as wt}from"./shared-init-37175329f2865f15-2.js";import{$1a as gt,$1g as ue,$1i as pe}from"./shared-init-8f2ac936c95a7f7b.js";var I=class extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}},bt=class extends URLSearchParams{append(){throw new I}delete(){throw new I}set(){throw new I}sort(){throw new I}};ht();function W(){return yt}var yt={push(e,...[t]){ce(D(e,t),"push",t?.scroll)},replace(e,...[t]){ce(D(e,t),"replace",t?.scroll)},prefetch(e,...[t]){mt(D(e,t),{strict:!0,full:t?.kind==="full",onInvalidate:t?.onInvalidate})},refresh(){de(window.location.href,{replace:!0,scroll:!1})},back(){window.history.back()},forward(){window.history.forward()},get bfcacheId(){return kt().bfcacheId??""}};function D(e,t){return Mt(t)?L(e,t):String(e)}function Mt(e){return!!(e&&("params"in e||"search"in e||"hash"in e))}function $(){return he().pathname}function $t(){return new bt(he().search)}function K(){let e=gt,t=e.__h,r;e.__h=(s,...i)=>{r=s.__P,t?.(s,...i)};let[a,n]=ue(!1);return e.__h=t,pe(()=>{let s=r?.closest("a[data-pnext-link]");if(!s)return;let i=s.__pnextHints??=new Set;return i.add(n),()=>i.delete(n)},[]),{pending:a}}function he(){let e=le(),[,t]=ue(()=>ie(e));return pe(()=>{Et();let r=()=>t(a=>{let n=ie(le());return a===n?a:n});return se().add(r),r(),()=>se().delete(r)},[]),e}function ie(e){return`${e.pathname}${e.search}${e.hash}`}function le(){return{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash}}function kt(){let e=history.state??{},t=window.__PNEXT_ROUTE__??{},r=typeof e.__pnextBfcacheId=="string"?e.__pnextBfcacheId:void 0;return r?{...t,bfcacheId:r}:t}function ce(e,t,r=!0){if(wt(e))return;let a=new URL(e,window.location.href);if(a.origin!==window.location.origin){let n=globalThis;n.__pnextMpaNavigation=(n.__pnextMpaNavigation??0)+1,requestAnimationFrame(()=>requestAnimationFrame(()=>{t==="replace"?window.location.replace(a.href):window.location.assign(a.href)}));return}if(a.pathname!==window.location.pathname||a.search!==window.location.search){de(a.href,{replace:t==="replace",scroll:r});return}t==="replace"?window.history.replaceState(history.state,"",a):window.history.pushState(history.state,"",a),ft(a,{scroll:r}),vt.settleLink?.()}function Et(){if(window.__PNEXT_HISTORY_PATCHED__)return;window.__PNEXT_HISTORY_PATCHED__=!0;let e=window.history.pushState.bind(window.history),t=window.history.replaceState.bind(window.history);function r(a){let n=window.history.state??{},s={};for(let l of Object.keys(n))l.startsWith("__pnext")&&(s[l]=n[l]);if(Object.keys(s).length===0)return a;let i=a??{};return Object.keys(i).some(l=>l.startsWith("__pnext"))?a:{...i,...s}}window.history.pushState=function(a,n,s){let i=window.location.href,l=e(r(a),n,s);return window.location.href!==i&&oe(),l},window.history.replaceState=function(a,n,s){let i=window.location.href,l=t(r(a),n,s);return window.location.href!==i&&oe(),l}}import{$2a as C}from"./shared-init-bee5eaed36ee3dc4.js";import{$1c as _t}from"./shared-init-bee5eaed36ee3dc4.js";import{$0a as v}from"./shared-init-bee5eaed36ee3dc4.js";import{$1c as fe,$1g as F,$1i as z,$1j as xt,$1k as Lt}from"./shared-init-8f2ac936c95a7f7b.js";var St=3600*24*365,Ct=[["light","Light",R],["dark","Dark",O],["system","System",N]];function Pt({theme:e}){let[t,r]=F(e),a=n=>{let s=document.documentElement;n==="system"?delete s.dataset.theme:s.dataset.theme=n,document.cookie=`theme=${n}; path=/; max-age=${St}; samesite=lax`,r(n)};return v(fe,{children:Ct.map(([n,s,i])=>v("button",{type:"button",class:"pop-item",role:"menuitemradio","aria-checked":t===n,onClick:()=>a(n),children:[v(C,{d:i}),v("span",{class:"grow",children:s}),v(C,{d:x})]},n))})}function Tt({class:e,icon:t,children:r}){return v("button",{type:"button",class:e,onClick:()=>void _t().catch(()=>location.reload()),children:[t?v(C,{d:V}):null,r]})}function It(){let[e,t]=F(!1),r=$();return z(()=>t(!1),[r]),z(()=>{if(document.documentElement.classList.toggle("drawer",e),!e)return;let a=n=>n.key==="Escape"&&t(!1);return addEventListener("keydown",a),()=>removeEventListener("keydown",a)},[e]),v(fe,{children:[v("button",{type:"button",class:"icon-btn only-m","aria-label":"Open navigation",onClick:()=>t(!e),children:v(C,{d:U})}),v("div",{class:"scrim",onClick:()=>t(!1)})]})}var At="side";function Ht({collapsed:e}){let[t,r]=F(e);return z(()=>{let a=document.querySelector(".app");if(!a)return;let n=()=>r(a.classList.contains("side-min"));n();let s=new MutationObserver(n);return s.observe(a,{attributes:!0,attributeFilter:["class"]}),()=>s.disconnect()},[]),v("button",{type:"button",class:"icon-btn side-toggle","aria-label":t?"Expand sidebar":"Collapse sidebar","data-tip":t?"Expand sidebar":"Collapse sidebar",onClick:()=>{let a=!t;document.querySelector(".app")?.classList.toggle("side-min",a),document.cookie=`${At}=${a?"min":"max"}; path=/; max-age=31536000; samesite=lax`},children:v(C,{d:t?j:H})})}var jt=e=>{let t=e.params??{};return e.href.replace(/\[([^\]]+)\]/g,(r,a)=>encodeURIComponent(String(t[a]??"")))};function Rt(e,t){let r=new URLSearchParams((e instanceof URLSearchParams,e));for(let[a,n]of Object.entries(t))r.set(a,n);return r}function Ot({within:e,children:t,onClick:r,...a}){let n=$(),s=n===jt(a)||e!==void 0&&(n===e||n.startsWith(`${e}/`)),i=Lt(null);return v(S,{...a,"aria-current":s?"page":void 0,onClick:l=>{i.current=l.currentTarget,r?.(l)},children:[t,v(Nt,{anchor:i,current:s})]})}function Nt({anchor:e,current:t}){let{pending:r}=K();return xt(()=>{e.current&&(r&&!t?e.current.setAttribute("data-pending",""):e.current.removeAttribute("data-pending"))},[r,t]),null}import{$1a as Vt,$1b as Ut}from"./shared-init-bee5eaed36ee3dc4.js";import{$0a as g}from"./shared-init-bee5eaed36ee3dc4.js";import{$1g as me,$1i as M,$1k as k}from"./shared-init-8f2ac936c95a7f7b.js";function be({status:e}){return g("span",{class:`st ${e}`,children:[g("i",{}),ye[e]??e]})}var ye={queued:"waiting for slot",running:"running",waiting:"needs approval",completed:"completed",failed:"failed",cancelled:"cancelled"},P="coder:watched",Me="coder:notify",A="coder:toast",ee=new Set(["completed","failed","cancelled"]),qt=new Set([...ee,"waiting"]),Zt=20,ve=3,Bt=8e3,we="coder:events",X="coder:task",J="coder:task-replay",Y="coder:task-reset",G="coder:task-resync",Dt=6e4,Wt=200,Q=()=>{try{return JSON.parse(localStorage.getItem(P)??"{}")??{}}catch{return{}}},$e=e=>{let t=Object.entries(e).sort(([,r],[,a])=>a.at-r.at).slice(0,Zt);localStorage.setItem(P,JSON.stringify(Object.fromEntries(t))),dispatchEvent(new Event(P))},ke=(e,t,r)=>dispatchEvent(new CustomEvent(A,{detail:{title:e,line:t,err:r}})),Kt=(e,t)=>ke(e,t,!0);function Ee(e,t,r){let a=Q(),n=a[e];!n&&ee.has(t)||n?.status===t&&(!r||n.title===r)||(a[e]={title:r||n?.title||e,status:t,at:n?.at??Date.now()},$e(a))}var ge=e=>/^\/dash\/tasks\/([^/]+)$/.exec(e)?.[1];function zt(e){let t=n=>typeof n=="string"?n.trim().split(`
|
|
2
|
+
`)[0]:"",r=e.approval??{},a=typeof e.result=="object"?e.result?.output:e.result;return e.status==="waiting"?t(r.summary)||t(r.reason)||t(r.kind)||"It is waiting for your approval.":e.status==="completed"?t(a)||"It finished.":t(e.error)||(e.status==="failed"?"It failed.":"It was stopped.")}function _e(e,t,r){let a=k({on:e,reset:t,resync:r});a.current={on:e,reset:t,resync:r},M(()=>{let n=l=>a.current.on(l.detail),s=()=>a.current.reset?.(),i=()=>a.current.resync?.();return addEventListener(X,n),addEventListener(Y,s),addEventListener(G,i),dispatchEvent(new CustomEvent(J,{detail:l=>a.current.on(l)})),()=>{removeEventListener(X,n),removeEventListener(Y,s),removeEventListener(G,i)}},[])}function Ft(e,t){let r=k(e);r.current=e;let a=k(),n=[...e].sort().join(",");M(()=>{let s=new Map,i=c=>{s.delete(c.id),s.set(c.id,c),s.size>Wt&&s.delete(s.keys().next().value),dispatchEvent(new CustomEvent(X,{detail:c}))},l=c=>{for(let b of s.values())c.detail(b)};addEventListener(J,l);let f=typeof BroadcastChannel<"u"&&navigator.locks?new BroadcastChannel(we):void 0,m=new AbortController,w,o=()=>{},d,u=c=>{w=c.id??w,c.event&&i(c.event),c.resync&&dispatchEvent(new Event(G)),c.reset&&(s.clear(),dispatchEvent(new Event(Y)))};f?.addEventListener("message",({data:c})=>{if(!c.hello)return u(c);d??=setTimeout(()=>{d=void 0,a.current?.abort.abort(),o()},300)}),f?.postMessage({hello:!0});let p=async()=>{t.current=!0;let c=setInterval(()=>{f?.postMessage({resync:!0}),u({resync:!0})},Dt);try{await E()}finally{clearInterval(c)}},E=async()=>{for(;!m.signal.aborted;){let c=new AbortController,b=()=>c.abort();m.signal.addEventListener("abort",b);let _=r.current;a.current={key:[..._].sort().join(","),abort:c};let te=1e3;try{let y=await Ut.tasks.events(_,w,c.signal);if(y.status===404)return void(t.current=!1);if(!y.ok||!y.body)te=[401,403].includes(y.status)?6e4:5e3;else for await(let{event:T,data:xe,id:ae}of Vt(y.body)){if(c.signal.aborted)break;let re={...ae?{id:ae}:{},...T==="task"?{event:JSON.parse(xe)}:{},...T==="reset"?{reset:!0}:{}};f?.postMessage(re),u(re)}}catch{}m.signal.removeEventListener("abort",b),!c.signal.aborted&&(await new Promise(y=>{let T=setTimeout(y,te);o=()=>{clearTimeout(T),y()}}),o=()=>{})}};return f?navigator.locks.request(we,{signal:m.signal},p).catch(()=>{}):p(),()=>{m.abort(),o(),clearTimeout(d),f?.close(),removeEventListener(J,l)}},[]),M(()=>{a.current&&a.current.key!==n&&a.current.abort.abort()},[n])}function Xt({toast:e,dismiss:t}){return M(()=>{let r=setTimeout(()=>t(e.key),Bt);return()=>clearTimeout(r)},[]),g("div",{class:e.err?"toast err":"toast",onClick:()=>t(e.key),children:[g("p",{class:"toast-head",children:[e.id?g(S,{class:"cover",href:"/dash/tasks/[id]",params:{id:e.id},children:e.title}):g("span",{class:"cover",children:e.title}),e.status?g(be,{status:e.status}):null]}),g("p",{class:"toast-line",children:e.line})]})}function Jt(){let e=$(),t=W(),[r,a]=me({}),[n,s]=me([]),i=k(ge(e));i.current=ge(e);let l=k({}),f=k(!1);M(()=>{let o=()=>{let d=Q();for(let[u,p]of Object.entries(d))l.current[u]??=p.status;a(d)};return o(),addEventListener(P,o),addEventListener("storage",o),()=>{removeEventListener(P,o),removeEventListener("storage",o)}},[]),M(()=>{let o=d=>{let u=d.detail;s(p=>[{key:`${A}:${Date.now()}`,...u},...p].slice(0,ve))};return addEventListener(A,o),()=>removeEventListener(A,o)},[]),M(()=>{if(!n.length)return;let o=d=>d.key==="Escape"&&s([]);return addEventListener("keydown",o),()=>removeEventListener("keydown",o)},[n.length]);let m=o=>s(d=>d.filter(u=>u.key!==o));_e(o=>{let d=Q(),u=d[o.id];if(!u)return;if(o.deleted)return delete d[o.id],$e(d);let p=l.current[o.id]??u.status;l.current[o.id]=o.status,p!==o.status&&w(o.id,{...o,result:o.result??void 0,error:o.error??void 0},u)});let w=(o,d,u)=>{if(Ee(o,d.status),!qt.has(d.status)||i.current===o)return;let p={key:`${o}:${Date.now()}`,id:o,title:u.title,status:d.status,line:zt(d)};if(s(c=>[p,...c].slice(0,ve)),!f.current||localStorage.getItem(Me)!=="1"||typeof Notification>"u"||Notification.permission!=="granted")return;let E=new Notification(`${p.title} (${ye[p.status]})`,{body:p.line,tag:o});E.onclick=()=>{focus(),t.push("/dash/tasks/[id]",{params:{id:o}})}};return Ft(Object.entries(r).filter(([,o])=>!ee.has(o.status)).map(([o])=>o),f),g("section",{class:"toasts","aria-label":"Task updates","aria-live":"polite",children:n.map(o=>g(Xt,{toast:o,dismiss:m},o.key))})}export{Je as $0a,Ye as $0b,Ge as $0c,Qe as $0d,S as $1a,L as $2a,B as $2b,Pt as $3a,Tt as $3b,It as $3c,Ht as $3d,Rt as $3e,Ot as $3f,We as $4A,Ke as $4B,ze as $4C,Le as $4a,Se as $4b,Ce as $4c,H as $4d,Pe as $4e,j as $4f,R as $4g,O as $4h,N as $4i,Te as $4j,V as $4k,Ie as $4l,Ae as $4m,U as $4n,He as $4o,x as $4p,je as $4q,Re as $4r,Oe as $4s,Ne as $4t,Ve as $4u,Ue as $4v,qe as $4w,Ze as $4x,Be as $4y,De as $4z,be as $5a,Me as $5b,ke as $5c,Kt as $5d,Ee as $5e,_e as $5f,Jt as $5g,W as $6a,$ as $6b,$t as $6c,K as $6d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o}from"./card-
|
|
1
|
+
import{c as o}from"./card-abb16544e8e5a5e0.js";import{$0a as t}from"./shared-init-bee5eaed36ee3dc4.js";import{$1c as n}from"./shared-init-8f2ac936c95a7f7b.js";function p({sentinel:i,more:l,busy:r,error:e,retry:a,noun:s}){return!l&&!e?null:t("div",{class:e?"tail err":"tail",ref:i,role:"status",children:e?t(n,{children:[e," ",t("button",{type:"button",class:"btn ghost sm",onClick:a,children:"Retry"})]}):r?t(o,{label:`Loading more ${s}`,inline:!0}):null})}export{p as a};
|