@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 +1 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,r}from"./prompt-K7-bKcTC.js";import{i}from"./cli-
|
|
1
|
+
import{a as e,n as t,o as n,r}from"./prompt-K7-bKcTC.js";import{i}from"./cli-IfrPgeYz.js";import{p as a,s as o}from"./output-BKeyLbvt.js";import{n as s,s as c,t as l}from"./args-DEMOfLz2.js";import u from"node:path";import d from"node:process";const f={observe:`read the platform only`,comment:`also post replies and reactions`,write:`also push, branch, and open or merge pull requests`};function p(e,t){let n=a,{id:r,samples:i,integrations:s}=e;d.stdout.write(`Created ${n.cyan(t)}.\n`);let c=s.length?[`1. Write ${t}/system.md. Try it with no server: coder task run --agent ${r} "<task>"`,`2. Run it on a server: coder dash on this machine reads it from this repo; a cloud server imports it from the dashboard or with coder agent push.`,`3. On the dashboard, create the agent's app on each platform it uses (${s.join(`, `)}) from its Platforms tab, and install it.`,`4. Fire an event by hand, or leave --server out to run it offline: coder agent run ${r} ${i[0]??`<event.json>`} --server <url>`,`Guide: https://github.com/muzam1l/coder/blob/main/docs/agents/index.md`,`Agents: coder docs agents`]:[`1. Write ${t}/system.md. Try it with no server: coder task run --agent ${r} "<task>"`,`2. Give the agent a platform under "integrations" in ${t}/agent.json, then run init again or follow the guide: coder agent integrations list`,`Guide: https://github.com/muzam1l/coder/blob/main/docs/agents/index.md`,`Agents: coder docs agents`];d.stdout.write(`\n${o(c,n)}\n`)}async function m(r){let{regexError:i}=await import(`./agent-D0pQ_ewc.js`).then(e=>e.t),{INTEGRATIONS:o}=await import(`./integrations-B2CavXR1.js`).then(e=>e.r),{PRESETS:s}=await import(`./types-D0q15RJa.js`).then(e=>e.n),c=a;d.stdout.write(`Creating ${c.cyan(`.coder/agents/${r}`)}. Pick what the agent listens to and what it may do; flags skip these questions.\n\n`);let l=await e({title:`Integrations`,hint:`Platforms the agent listens to and acts on. Add or remove them later in agent.json.`,multi:!0,selected:[Object.keys(o)[0]],options:Object.values(o).map(e=>({value:e.id,hint:e.description}))}),u={},p={};for(let e of l){let t=o[e],r=Object.keys(t.events),a=await n({title:`${e} events`,hint:`What wakes the agent on ${e}; each event runs the agent with that event as its prompt.`,multi:!0,required:!0,selected:[r.includes(`mention`)?`mention`:r[0]],options:Object.entries(t.events).map(([e,t])=>({value:e,hint:t.description,...t.noisy?{input:{label:`match`,value:`^help\\b`,placeholder:`tab to add a match`,validate:i}}:{}}))});u[e]=a.values,p[e]=a.inputs}let[m]=l.length?await e({title:`Tools`,hint:`What the agent may do on its platforms; comment suits most agents.`,selected:[`comment`],options:s.map(e=>({value:e,hint:f[e]}))}):[`comment`],h=await t(`Display name`,r,void 0,`Shown in replies and app names.`);return{...h===r?{}:{name:h},integrations:l,events:u,matches:p,tools:m}}const h=i({name:`agent init`,help:{usage:`coder agent init [id] [--integrations a,b] [--triggers a,b] [--tools <preset>] [--name <text>] [--description <text>] [--permissions <mode>] [--yes]`,summary:"Create .coder/agents/<id>/ with an agent.json built from the integration catalog, a system.md to write the prompt in, and one sample event per integration for `coder agent run`. Asks for the id, integrations, events, and tools when run in a terminal without them.",flags:[[`--integrations <a,b>`,`platforms the agent listens to (see coder agent integrations list)`],[`--triggers <a,b>`,`events that start tasks, applied to each integration that has them (default: mention)`],[`--tools <preset>`,`observe, comment, or write (default: comment)`],[`--name <text>`,`display name used in replies (default: the id)`],[`--description <text>`,`one line for agent list`],[`--permissions <mode>`,`engine permission mode (default: read-only)`],[`--yes`,`skip the questions and take the defaults`]],examples:[[`coder agent init`,`answer the questions, id included`],[`coder agent init triage --integrations github --triggers issue,mention --tools comment`,`no questions`]]},options:{...l,name:c,description:c,integrations:c,triggers:c,tools:c,permissions:c,match:c,yes:s},args:1,run:async({options:e,args:[n],cwd:i})=>{let{agents:a}=await import(`./agent-D0pQ_ewc.js`).then(e=>e.t),o=r()&&!e.yes;return a.init(n,{...e,cwd:i,permissions:e.permissions,...o?{askId:e=>t(`Agent id`,``,e,`Folder name under .coder/agents and the name used in commands.`)}:{},...o&&!e.integrations?{askPicks:m}:{}})},json:(e,{cwd:t})=>({id:e.id,dir:u.relative(t,e.dir),files:e.files,samples:e.samples}),print:(e,{cwd:t})=>p(e,u.relative(t,e.dir))});export{h as commandAgentInit};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e}from"./cli-IfrPgeYz.js";const t=e(`agent integrations`,{list:async()=>(await import(`./list-DaQ14K1K.js`)).commandIntegrationsList,ls:async()=>(await import(`./list-DaQ14K1K.js`)).commandIntegrationsList,show:async()=>(await import(`./show-DlKWR0Hy.js`)).commandIntegrationsShow},{menu:[{usage:`list`,blurb:`list integrations with their events and tools`},{usage:`show <id>`,blurb:`events and tools of one integration`}],description:[`The platforms an agent can listen to and act on: their events and tool presets.`]},{aliases:{ls:`list`}});export{t as commandAgentIntegrations};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{i as e,n as t}from"./cli-
|
|
1
|
+
import{i as e,n as t}from"./cli-IfrPgeYz.js";import{p as n,s as r}from"./output-BKeyLbvt.js";import{r as i}from"./models-DGPrMV51.js";import{n as a}from"./add-CKENklTr.js";import o from"node:process";const s=e({name:`model list`,help:{usage:`coder model list [--json]`,summary:`List built-in aliases, configured custom models, and user aliases. Only custom\nmodels are probed.\n\n${t}`},options:a,run:({cwd:e})=>i(e),print:c});function c(e){let i=n,a=e=>e?` ${i.dim(`(disabled)`)}`:``,s=[],c=(e,t)=>{s.push(i.bold(e));for(let e of t)`overrides`in e?s.push(` ${e.disabled?i.dim(`∅`):i.cyan(`↳`)} ${e.alias.padEnd(14)} ${i.dim(`-> ${e.spec} (overrides ${e.overrides})`)}${a(e.disabled)}`):`builtin`in e?s.push(` ${e.disabled?i.dim(`∅`):i.green(`✔`)} ${e.alias.padEnd(14)} ${i.dim(`-> ${e.model}`)}${a(e.disabled)}`):s.push(` ${e.disabled?i.dim(`∅`):i.cyan(`↳`)} ${e.alias.padEnd(14)} ${i.dim(`-> ${e.spec}`)}${a(e.disabled)}`);s.push(``)};c(`Codex models`,e.codex),c(`Claude models`,e.claude),s.push(i.bold(`Custom models`),``),e.custom.length||s.push(i.dim(` None.`));for(let{name:t,probe:n,...r}of e.custom){let e=r.disabled?i.dim(`∅`):n.reachable?i.green(`✔`):i.red(`✘`);s.push(` ${e} ${t.padEnd(14)} ${r.model} ${i.dim(`@ ${r.baseUrl}. ${n.detail}`)}${a(r.disabled)}`)}if(s.push(``),e.toggles){s.push(i.bold(`Other`),``);for(let t of e.toggles)s.push(` ${t.disabled?i.dim(`∅`):i.green(`✔`)} ${t.name.padEnd(14)} ${i.dim(`raw model id`)}${a(t.disabled)}`);s.push(``)}s.push(...t.split(`
|
|
2
2
|
`),``,r([`Add a custom model: coder model add <name> --base-url <url> --model <id> [--env-key VAR]`,`Alias a model, e.g. fast codex:luna: coder model alias <name> <spec>`,`Run with a model: coder run --model <name> "<task>"`],i)),o.stdout.write(`${s.join(`
|
|
3
3
|
`)}\n`)}export{s as commandModelList};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./dispatch-YW1aqjEg.js";import{i as e,r as t}from"./cli-
|
|
1
|
+
import"./dispatch-YW1aqjEg.js";import{i as e,r as t}from"./cli-IfrPgeYz.js";import{a as n,g as r,m as i,p as a,s as o}from"./output-BKeyLbvt.js";import{i as s,n as c,r as l,s as u}from"./args-DEMOfLz2.js";import{c as d,o as f}from"./result-DtXZusqj.js";import p from"node:path";import m from"node:process";const h={server:s,workspace:u,yes:c};function g(e){if(!e.length)return void m.stdout.write(`No server tasks.
|
|
2
2
|
`);let t=a;m.stdout.write(r([{header:`task-id`,value:e=>e.task.id,paint:e=>t.cyan(e)},{header:`status`,value:e=>e.status,paint:e=>d(e,t)},{header:`agent`,value:e=>e.task.agent},{header:`source`,value:e=>e.task.source},{header:`request`,value:e=>(e.task.prompt??(e.task.event?`${e.task.event.type}: ${e.task.event.text}`:`-`)).slice(0,80)},{header:`reply`,value:e=>f(e)??`-`}],e,t))}function _(e,t,s){let c=a;if(!e.length){let n=t.archived?`archived tasks`:t.running?`running tasks`:t.stopped?`recently stopped tasks`:`recent tasks`;m.stdout.write(`No ${n}.\n`),e.archived&&m.stdout.write(`\n${o([`${e.archived} archived: coder task list --archived [--limit N]`],c)}\n`);return}let l=[{header:`task-id`,value:e=>e.taskId,paint:e=>c.cyan(e),max:28},{header:`status`,value:e=>e.status,paint:(e,t)=>i(t.status,e.length),max:16},{header:`engine`,value:e=>(e.engine===`custom`&&e.model?e.model:(e.engine??`-`)+(e.model?`/${e.model}`:``))+(e.effort?`/${e.effort}`:``),paint:e=>c.light(e),max:26},{header:`cwd`,value:e=>e.cwd?p.basename(e.cwd):`-`,paint:e=>c.light(e),max:24},{header:`name`,value:e=>{let t=e.archived?` ${c.dim(`(archived)`)}`:``;return`${e.name?e.name:c.light(e.prompt)}${e.idleMs!==null&&e.idleMs>=12e4?` ${(e.idleMs>6e5?c.red:c.dim)(`· idle ${n(e.idleMs)}`)}`:``}${t}`}}],u=[],d=new Map;for(let t of e){if(!t.flowRunId){let e=u.at(-1);e&&!e.header?e.rows.push(t):u.push({rows:[t]});continue}let e=d.get(t.flowRunId);if(!e){let n=s(t.flowRunId);e={header:n?`(${c.bold(t.flowRunId)} ${n.status}. Flow ${n.name})`:`(${c.bold(t.flowRunId)} flow)`,rows:[]},d.set(t.flowRunId,e),u.push(e)}e.rows.push(t)}m.stdout.write(r(l,u,c)),e.clipped&&m.stdout.write(c.dim(`\n... ${e.clipped} more not shown (--limit ${t.limit===`all`?void 0:t.limit})\n`));let f=[`Result: coder task result <task-id>`];t.archived||f.push(`Older tasks: coder task list --archived [--limit N]`),m.stdout.write(`\n${o(f,c)}\n`)}const v=e({name:`task list`,help:{usage:`coder task list [--running] [--stopped] [--archived [--limit N]] [--server [url]]`,summary:`List recent tasks across all workspaces, most recent first: running tasks plus
|
|
3
3
|
ones stopped within the last 30 minutes. Older stopped tasks auto-archive and
|
|
4
4
|
move to --archived. Shortcut: \`coder list\`.`,flags:[[`--running`,`show only running tasks`],[`--stopped`,`show only recently stopped tasks (not yet archived)`],[`--archived`,`show only archived tasks (auto-archived or via task archive)`],[`--limit <n|all>`,`show at most n tasks (default all)`],[`--dir <dir>`,`only tasks launched in that workspace`],t]},options:{cwd:u,dir:u,limit:l,json:c,running:c,stopped:c,archived:c,...h},run:async({options:e})=>{let{tasks:t}=await import(`./task-DEp3GHwH.js`).then(e=>e.t);return t.list({...e,organization:e.workspace})},async print(e,{options:t}){if(t.server!==void 0)return g(e);let{readFlowRecord:n}=await import(`./executor-HWnIIYUL.js`).then(e=>e.b);_(e,t,n)}});export{v as commandTasks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./cli-
|
|
1
|
+
import{i as e,t}from"./cli-IfrPgeYz.js";import{g as n,p as r}from"./output-BKeyLbvt.js";import{runnerOptions as i}from"./remove-CZmO4BSd.js";import a from"node:process";function o({items:e}){if(!e.length)return void a.stdout.write(`${r.dim(`No runners.`)}\n`);a.stdout.write(`${n([{header:`id`,value:e=>e.id,paint:e=>r.cyan(e)},{header:`name`,value:e=>e.name},{header:`scope`,value:e=>e.scope},{header:`status`,value:e=>e.online?`online`:`offline`},{header:`kind`,value:e=>e.kind},{header:`default`,value:e=>e.default?`yes`:``}],e,r)}\n`)}const s=e({name:`runner list`,globalFlags:{cwd:!1},help:{usage:`coder runner list [--server [url]] [--json]`,flags:[t]},options:i,run:async({options:e})=>{let{listRunners:t}=await import(`./runner-c-2w6Eoj.js`).then(e=>e.a);return t(e)},print:o});export{s as commandRunnerList};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e,r as t}from"./cli-
|
|
2
|
-
`);let a=r;l.stdout.write(n([{header:`id`,value:e=>e.id,paint:e=>a.cyan(e)},{header:`name`,value:e=>e.name},{header:`source`,value:e=>e.source,paint:e=>a.light(e)},...t?[{header:`version`,value:e=>String(e.version)}]:[],{header:`description`,value:e=>e.description??`-`}],e,a)),!t&&l.stdout.write(`\n${i([`An agent's settings, triggers, and tools: coder agent show <id>`,`Scaffold a new agent in this repo: coder agent init <id>`],a)}\n`)}const m=e({name:`agent list`,help:{usage:`coder agent list [--server [url]] [--json] [--cwd <dir>]`,summary:`Without --server, one row per built-in and workspace agent. With --server, list the agent records and current versions owned by that Coder server.`,flags:[t]},options:{...c,...u},run:async({options:e,cwd:t})=>{let{agents:n}=await import(`./agent-
|
|
1
|
+
import{i as e,r as t}from"./cli-IfrPgeYz.js";import{g as n,p as r,s as i}from"./output-BKeyLbvt.js";import{i as a,n as o,s,t as c}from"./args-DEMOfLz2.js";import l from"node:process";const u={server:a,workspace:s,yes:o},d=e=>`builtin`in e,f=e=>e.map(e=>d(e)?{id:e.id,name:e.name,source:e.builtin?`builtin`:`repo`,description:e.definition.description??null}:{id:e.id,name:e.name,source:e.source,version:e.currentVersion,description:e.description??null});function p(e,t){if(!e.length)return void l.stdout.write(`No agents configured.
|
|
2
|
+
`);let a=r;l.stdout.write(n([{header:`id`,value:e=>e.id,paint:e=>a.cyan(e)},{header:`name`,value:e=>e.name},{header:`source`,value:e=>e.source,paint:e=>a.light(e)},...t?[{header:`version`,value:e=>String(e.version)}]:[],{header:`description`,value:e=>e.description??`-`}],e,a)),!t&&l.stdout.write(`\n${i([`An agent's settings, triggers, and tools: coder agent show <id>`,`Scaffold a new agent in this repo: coder agent init <id>`],a)}\n`)}const m=e({name:`agent list`,help:{usage:`coder agent list [--server [url]] [--json] [--cwd <dir>]`,summary:`Without --server, one row per built-in and workspace agent. With --server, list the agent records and current versions owned by that Coder server.`,flags:[t]},options:{...c,...u},run:async({options:e,cwd:t})=>{let{agents:n}=await import(`./agent-D0pQ_ewc.js`).then(e=>e.t);return n.list({...e,cwd:t,organization:e.workspace})},json:e=>f(e),print:(e,{options:t})=>p(f(e),t.server!==void 0)});export{m as commandAgentList,d as isLocal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./cli-
|
|
1
|
+
import{i as e}from"./cli-IfrPgeYz.js";import{g as t,p as n,s as r}from"./output-BKeyLbvt.js";import{n as i}from"./args-DEMOfLz2.js";import a from"node:process";function o(e){let i=n;a.stdout.write(t([{header:`id`,value:e=>e.id,paint:e=>i.cyan(e)},{header:`description`,value:e=>e.description},{header:`events`,value:e=>e.events.join(`, `)},{header:`tools`,value:e=>e.tools.join(`, `)}],e,{style:i,border:!0})),a.stdout.write(`\n${r([`Event descriptions and the tools each preset allows: coder agent integrations show <id>`],i)}\n`)}const s=e({name:`agent integrations list`,globalFlags:{cwd:!1},help:{usage:`coder agent integrations list [--json]`,summary:"One row per integration: its id, the events an agent can wire, and every tool it offers; `show` splits the tools by preset."},options:{json:i},run:async()=>{let{agents:e}=await import(`./agent-D0pQ_ewc.js`).then(e=>e.t);return e.integrations.list()},print:o});export{s as commandIntegrationsList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./cli-
|
|
1
|
+
import{i as e,t}from"./cli-IfrPgeYz.js";import{g as n,p as r}from"./output-BKeyLbvt.js";import{n as i,o as a}from"./args-DEMOfLz2.js";import o from"node:process";function s(e){if(!e.length)return void o.stdout.write(`${r.dim(`No engine credentials.`)}\n`);o.stdout.write(`${n([{header:`label`,value:e=>e.label,paint:e=>r.cyan(e)},{header:`engine`,value:e=>e.engine},{header:`scope`,value:e=>e.scope},{header:`default`,value:e=>e.isDefault?`✔`:``},{header:`value`,value:e=>e.masked},{header:`account`,value:e=>[e.account?.email,e.account?.plan].filter(Boolean).join(` `)}],e,r)}\n`)}const c=e({name:`credentials list`,globalFlags:{cwd:!1},help:{usage:`coder credentials list [--server [url]] [--json]`,flags:[t]},options:{json:i,server:a,yes:i},run:async({options:e})=>{let{connect:t}=await import(`./remote-AcWWfKVS.js`).then(e=>e.a);return t(e).credentials.list()},print:s});export{c as commandCredentialsList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{at as e}from"./dispatch-YW1aqjEg.js";import{i as t}from"./cli-
|
|
1
|
+
import{at as e}from"./dispatch-YW1aqjEg.js";import{i as t}from"./cli-IfrPgeYz.js";import{g as n,p as r,s as i}from"./output-BKeyLbvt.js";import{t as a}from"./args-DEMOfLz2.js";import o from"node:process";const s=t({name:`mcp list`,help:{usage:`coder mcp list [--json] [--cwd <dir>]`,summary:`List MCP servers from the merged user and repo config.`},options:a,run:({cwd:t})=>e(t),print:c});function c(e){let t=r,a=Object.keys(e);if(!a.length)return void o.stdout.write(`No MCP servers configured.\n\n${i([`Add a server: coder mcp add <name> -- <command>`],t)}\n`);o.stdout.write(n([{header:`name`,value:e=>e.name,paint:e=>t.cyan(e)},{header:`target`,value:e=>e.entry.url??[e.entry.command,...e.entry.args??[]].join(` `),paint:e=>t.light(e)},{header:`tools`,value:e=>e.entry.tools?.join(`, `)??`-`,paint:e=>t.light(e)}],a.map(t=>({name:t,entry:e[t]})),t))}export{s as commandMcpList};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Tt as e}from"./dispatch-YW1aqjEg.js";import{i as t}from"./cli-
|
|
1
|
+
import{Tt as e}from"./dispatch-YW1aqjEg.js";import{i as t}from"./cli-IfrPgeYz.js";import{a as n,l as r,m as i,n as a,p as o,s}from"./output-BKeyLbvt.js";import{n as c,r as l,t as u}from"./args-DEMOfLz2.js";import d from"node:process";const f=t({name:`flow list`,help:{usage:`coder flow list [--archived] [--limit N] [--json]`,summary:`List recent flow runs, most recent first: running runs plus ones that ended
|
|
2
2
|
within the last 30 minutes. Older runs auto-archive and move to --archived.`,flags:[[`--archived`,`show archived runs (auto-archived or via flow archive)`],[`--limit <n|all>`,`show at most n runs (default all)`]]},options:{...u,archived:c,limit:l},run:async({options:e})=>{let{collectFlowRuns:t}=await import(`./executor-HWnIIYUL.js`).then(e=>e.b);return t(e)},json:e=>e.runs,print:(e,{options:t})=>p(e,t)});function p({runs:t,clipped:c},l){if(!t.length){d.stdout.write(l.archived?`No archived flow runs.
|
|
3
3
|
`:`No recent flow runs.
|
|
4
4
|
`),d.stdout.write(`\n${s([`Run one: coder flow run <name>`,`Runnable flows: coder flow discover`],o)}\n`);return}let u=o,f=(e,t,n)=>Math.min(t,Math.max(e,...n.map(e=>e.length))),p={id:f(6,28,t.map(e=>e.runId)),name:f(4,30,t.map(e=>e.name))};d.stdout.write(u.bold(u.light(`${`run-id`.padEnd(p.id)} ${`name`.padEnd(p.name)} ${`status`.padEnd(10)} ${`tasks`.padEnd(9)} ${`tokens`.padEnd(10)} age\n`)));for(let o of t){let t=Object.values(o.ledger).reduce((e,t)=>e+t.total,0);d.stdout.write(`${u.cyan(a(o.runId,p.id))} ${a(o.name,p.name)} ${i(o.status,10)} ${u.light(a(`${o.taskCount} tasks`,9))} ${u.light(a(t?`${r(t)} tok`:`-`,10))} ${u.light(n(e(o.startedAt)))}\n`)}c&&d.stdout.write(u.dim(`\n... ${c} more not shown (--limit ${l.limit})\n`)),d.stdout.write(`\n${s([`Result: coder flow result <run-id>`,`Tasks: coder list`,`Runnable flows: coder flow discover`],u)}\n`)}export{f as commandList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./cli-
|
|
1
|
+
import{i as e,t}from"./cli-IfrPgeYz.js";import{p as n,r,s as i}from"./output-BKeyLbvt.js";import{n as a,o}from"./args-DEMOfLz2.js";import s from"node:process";import c from"node:readline/promises";function l(e){e.url&&s.stderr.write(`Open ${n.cyan(e.url)}\n`),e.code&&s.stderr.write(`Enter the code ${n.bold(e.code)}\n`)}async function u(){let e=c.createInterface({input:s.stdin,output:s.stderr}),t=(await e.question(`Paste the code from the sign-in page `)).trim();return e.close(),t}function d(e){if(e.state===`failed`)return void s.stderr.write(`${r.red(e.error??`Sign-in failed.`)}\n\n${i([`Try again`],r)}\n`);s.stdout.write(`Signed in. Personal credential ${n.bold(e.label??e.engine)} is your ${e.engine} default.\n`)}const f=e({name:`credentials login`,globalFlags:{cwd:!1},help:{usage:`coder credentials login <claude|codex> [--server [url]] [--json]`,summary:`Runs the official claude or codex sign-in on the server's runner, prints the sign-in link or device code, and waits. Claude asks you to paste the code the sign-in page shows. The result is your personal default for that engine. Needs CLAUDE_SUBSCRIPTIONS=1 or CODEX_SUBSCRIPTIONS=1 on the server.`,flags:[t]},options:{json:a,server:o,yes:a},args:1,run:async({options:e,args:[t]})=>{let{loginCredential:n}=await import(`./remote-AcWWfKVS.js`).then(e=>e.a);return n(t,{...e,onStart:e=>s.once(`SIGINT`,()=>void e().finally(()=>s.exit(130))),onOpen:l,code:u})},print:d,exit:(e,{options:t})=>!t.json&&e.state===`failed`?1:void 0});export{f as commandCredentialsLogin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{St as e}from"./dispatch-YW1aqjEg.js";import{a as t,i as n,r}from"./prompt-K7-bKcTC.js";import{i,r as a}from"./cli-
|
|
1
|
+
import{St as e}from"./dispatch-YW1aqjEg.js";import{a as t,i as n,r}from"./prompt-K7-bKcTC.js";import{i,r as a}from"./cli-IfrPgeYz.js";import{p as o}from"./output-BKeyLbvt.js";import{i as s,n as c,s as l}from"./args-DEMOfLz2.js";import u from"node:process";const d=t=>{throw t instanceof e&&t.code===`login-failed`?new e(`invalid-option`,t.message,t.hint?{hint:t.hint}:{}):t},f=i({name:`auth login`,globalFlags:{cwd:!1},help:{usage:`coder auth login [--server [url]] [--workspace <slug>] [--device] [--json]`,summary:`Sign in with Wular Auth in your browser. The CLI keeps the tokens in ~/.coder/session.json, and commands that talk to a server then act as you.`,flags:[a,[`--device`,`show a code to approve on another device; the default without a local browser`]],env:[[`CODER_SERVER`,`the server to use instead of https://coder.wular.ai`]],examples:[[`coder auth login`,`sign in to the hosted service`],[`coder auth login --server https://agents.example.com`,`sign in to a self-hosted server`]]},options:{json:c,server:s,workspace:l,yes:c,device:c},run:async({options:e})=>{let{hasBrowser:i,sessions:a}=await import(`./remote-AcWWfKVS.js`).then(e=>e.c);return a.login({server:e.server,yes:e.yes,device:e.device||!i(),open:e=>{u.stdout.write(`Opening your browser to sign in. If it does not open, visit\n${o.light(e)}\n`),n(e)},onCode:(e,t)=>u.stdout.write(`Confirm this code in your browser: ${o.bold(e)}\n${o.light(t)}\n`),organization:e.workspace,...r()?{chooseOrganization:async e=>{let[n]=await t({title:`Workspace`,hint:`Commands for this server use this workspace by default.`,options:e.map(e=>({value:e.slug,label:e.name,hint:e.slug}))});return n}}:{}}).catch(d)},json:e=>({server:e.server,user:e.user,organization:e.organization}),print:e=>{let t=o;u.stdout.write(`${t.green(`✔`)} Signed in to ${t.bold(e.server)} as ${e.user.email}${e.organization?` ${t.dim(`· ${e.organization.name}`)}`:``}\n`)}});export{f as commandLogin,d as ownHint};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,r as t}from"./cli-
|
|
1
|
+
import{i as e,r as t}from"./cli-IfrPgeYz.js";import{i as n,n as r}from"./args-DEMOfLz2.js";import{ownHint as i}from"./login-KHrM3MI3.js";import a from"node:process";const o=e({name:`auth logout`,globalFlags:{cwd:!1},help:{usage:`coder auth logout [--server [url]] [--json]`,summary:`Revoke the saved session for that server at Wular Auth and forget its tokens.`,flags:[t]},options:{json:r,server:n,yes:r},run:async({options:e})=>{let{sessions:t}=await import(`./remote-AcWWfKVS.js`).then(e=>e.c);return t.logout(e).catch(i)},print:e=>a.stdout.write(`Signed out of ${e.server}.\n`)});export{o as commandLogout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DT7IzrpZ.js";import{St as t}from"./dispatch-YW1aqjEg.js";import{Bn as n,In as r,Rn as i,ft as a,n as o,t as s,zn as c}from"./store-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DT7IzrpZ.js";import{St as t}from"./dispatch-YW1aqjEg.js";import{Bn as n,In as r,Rn as i,ft as a,n as o,t as s,zn as c}from"./store-Cxc2GYyj.js";import{n as l}from"./env-LsVTi18f.js";import{c as u,d,i as f}from"./schema-DoNO0dPh.js";import{n as p,t as m}from"./migrate-DAC6sFgg.js";import{v as h}from"./shared-D64pQ0XU.js";import g from"node:process";import{eq as _,isNotNull as v,like as y}from"drizzle-orm";var b=e({migrate:()=>S,rotateKey:()=>C});async function x(e){try{return await e()}catch(e){throw e instanceof t?e:new t(`server`,e instanceof Error?e.message:String(e))}}function S(e={}){return x(async()=>{let n=l(e.env??g.env);if(!n.databaseUrl)throw new t(`invalid-option`,`No database to migrate.`,{hint:`Set DATABASE_URL to the Postgres the server uses.`});let r=await o(n);try{return await p(r,m(n.databaseUrl))}finally{await r.close()}})}function C(e={}){return x(async()=>{let o=l(e.env??g.env);if(!o.encryptionKey)throw new t(`invalid-option`,`SERVER_ENCRYPTION_KEY is required to rotate keys.`,{hint:`Set the new key in SERVER_ENCRYPTION_KEY and the old key in SERVER_ENCRYPTION_KEY_PREVIOUS.`});let p=await s(o);try{let e=new Set([p.defaultOrganizationId]);if(p.connection){let t=p.connection.db,[n,r]=await Promise.all([t.selectDistinct({id:d.organizationId}).from(d),t.select({key:f.key}).from(f).where(y(f.key,`o:%,"config"]:workspace`))]);for(let t of n)e.add(t.id);for(let t of r){let n;try{n=JSON.parse(t.key.slice(2,-10))}catch{continue}Array.isArray(n)&&n.length===2&&typeof n[0]==`string`&&n[1]===`config`&&t.key===h(n[0],`config`,`workspace`)&&e.add(n[0])}}let t=0;for(let n of e)t+=await a(p.store(n),o);let s=p.connection?.db,l=c(o.encryptionKey);for(let e of s?await s.select().from(u).where(v(u.token)):[])n(o,e.token)!==l&&(await s.update(u).set({token:i(o,r(o,e.token))}).where(_(u.id,e.id)),t++);return{moved:t}}finally{await p.close()}})}export{S as n,C as r,b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./cli-
|
|
1
|
+
import{s as e}from"./cli-IfrPgeYz.js";const t=e(`mcp`,{serve:async()=>(await import(`./serve-CML2mkKG.js`)).commandMcp,add:async()=>(await import(`./add-DrbKvzAF.js`)).commandMcpAdd,"add-json":async()=>(await import(`./add-json-GHTfZV_U.js`)).commandMcpAddJson,list:async()=>(await import(`./list-Motuarjd.js`)).commandMcpList,ls:async()=>(await import(`./list-Motuarjd.js`)).commandMcpList,rm:async()=>(await import(`./remove-CC7UyWNI.js`)).commandMcpRemove,remove:async()=>(await import(`./remove-CC7UyWNI.js`)).commandMcpRemove},{menu:[{usage:`add <name> (--url <url> | -- <command> [args])`,blurb:`add a server`},{usage:`add-json <name> '<json>'`,blurb:`add a server from a .mcp.json entry`},{usage:`list`,blurb:`list configured servers`},{usage:`rm <name>`,blurb:`remove a server`}],details:!0},{aliases:{ls:`list`,remove:`rm`},help:{usage:`coder mcp <add|add-json|list|rm>`,summary:"Manage the `mcp` map in .coder/config.json (or ~/.coder with --user). Entries use the .mcp.json shape (stdio command or remote url) plus an optional tools allowlist; attach them with `coder task run --mcp <names|all>`.",examples:[[`coder mcp add docs -- npx -y docs-mcp`,`add a stdio server from its command line`],[`coder mcp add linear --url https://mcp.linear.app/mcp`,`add a remote server; the engine handles its OAuth login`],[`coder mcp add-json github '{"url":"https://api.githubcopilot.com/mcp/","headers":{"Authorization":"Bearer \${GH_TOKEN}"}}'`,`paste an entry from any .mcp.json`],[`coder run --mcp docs,linear "find why uploads fail"`,`attach by name`]],seeAlso:`task run`}});export{t as commandMcpConfig};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./cli-
|
|
1
|
+
import{i as e}from"./cli-IfrPgeYz.js";import{n as t}from"./args-DEMOfLz2.js";import n from"node:process";const r=e({name:`server migrate`,globalFlags:{cwd:!1},help:{usage:`coder server migrate [--json]`,summary:`Create or update the tables in the Postgres at DATABASE_URL. Run it before the first start and after every upgrade; the server only warns when it is behind.`,env:[[`DATABASE_URL`,`the Postgres to migrate`]],examples:[[`DATABASE_URL=postgres://... coder server migrate`,`bring a database up to date`]]},options:{json:t},run:async()=>{let{migrate:e}=await import(`./maintenance-CVfHIraw.js`).then(e=>e.t);return e()},json:({applied:e})=>({ok:!0,applied:e}),print:({applied:e})=>n.stdout.write(e?`Applied ${e} migration${e===1?``:`s`}.\n`:`Database is up to date.
|
|
2
2
|
`)});export{r as commandServerMigrate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./cli-
|
|
1
|
+
import{s as e}from"./cli-IfrPgeYz.js";const t=e(`model`,{list:async()=>(await import(`./list-Bu1S3hPM.js`)).commandModelList,ls:async()=>(await import(`./list-Bu1S3hPM.js`)).commandModelList,add:async()=>(await import(`./add-CKENklTr.js`).then(e=>e.t)).commandModelAdd,setup:async()=>(await import(`./add-CKENklTr.js`).then(e=>e.t)).commandModelAdd,update:async()=>(await import(`./update-DTYOhoQC.js`)).commandModelUpdate,remove:async()=>(await import(`./remove-CWd4Qs4F.js`).then(e=>e.n)).commandModelRemove,disable:async()=>(await import(`./disable-B860lJDh.js`)).commandModelDisable,enable:async()=>(await import(`./enable-DD4OsTnA.js`)).commandModelEnable,alias:async()=>(await import(`./alias--pfI-nvH.js`)).commandModelAlias,unalias:async()=>(await import(`./unalias-D6UESHzK.js`)).commandModelUnalias},{menu:[{usage:`list`,blurb:`list built-ins, custom models, and aliases`},{usage:`add <name> --base-url <url> --model <id> [--env-key VAR]`,blurb:`connect a model (alias: setup)`},{usage:`update <name> [--base-url|--model|--env-key]`,blurb:`change a model in place`},{usage:`remove <name>`,blurb:`delete a custom model`},{usage:`disable <name>`,blurb:`turn off a model (built-in, custom, or alias)`},{usage:`enable <name>`,blurb:`re-enable a disabled model`},{usage:`alias <name> <spec>`,blurb:`name a spec, e.g. fast codex:luna`},{usage:`unalias <name>`,blurb:`remove an alias`}],description:["Manage the models coder can dispatch to. `add` connects any OpenAI-compatible",`endpoint (Ollama, vLLM, OpenRouter, ...) as the custom engine, alongside the`,"built-in codex/claude models. Name your own shortcuts with `alias`",`(e.g. fast -> codex:luna); disable/enable turns any model off and on.`]});export{t as commandModel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,r as t}from"./cli-
|
|
1
|
+
import{i as e,r as t}from"./cli-IfrPgeYz.js";import{p as n}from"./output-BKeyLbvt.js";import{i as r,n as i,s as a,t as o}from"./args-DEMOfLz2.js";import s from"node:process";const c=e({name:`agent push`,help:{usage:`coder agent push [id] [--server [url]] [--json] [--cwd <dir>]`,summary:`Upload one workspace agent, or every agent in .coder/agents when no id is given. The server creates a new immutable version only when its definition, prompt, or files changed.`,flags:[t],examples:[[`coder agent push helper`,`upload helper`]]},options:{...o,server:r,workspace:a,yes:i},args:1,run:async({options:e,args:[t],cwd:n})=>{let{agents:r}=await import(`./agent-D0pQ_ewc.js`).then(e=>e.t);return r.push(t,{...e,cwd:n,organization:e.workspace})},print:e=>{for(let t of e)s.stdout.write(t.unchanged?`Pushed ${n.bold(t.id)} unchanged (version ${t.version})\n`:`Pushed ${n.bold(t.id)} as version ${t.version}\n`)}});export{c as commandAgentPush};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Ct as e,pn as t,xt as n}from"./dispatch-YW1aqjEg.js";import{Hn as r,a as i,u as a}from"./store-
|
|
1
|
+
import{Ct as e,pn as t,xt as n}from"./dispatch-YW1aqjEg.js";import{Hn as r,a as i,u as a}from"./store-Cxc2GYyj.js";import{_ as o,g as s,h as c,i as l,m as u,o as d,p as f,s as p}from"./schema-DoNO0dPh.js";import{i as m,r as h,t as g}from"./client-31YzOj-i.js";import{b as _,c as v,f as y,m as b,v as x,y as S}from"./shared-D64pQ0XU.js";import{randomBytes as C}from"node:crypto";import{and as w,asc as T,desc as E,eq as D,getTableColumns as O,gt as k,ilike as A,inArray as j,isNotNull as M,isNull as N,lt as P,or as F,sql as I}from"drizzle-orm";import{CasingCache as L}from"drizzle-orm/casing";function R(e,t){if(typeof t==`number`)return I`to_jsonb(coalesce(case when jsonb_typeof(${e}) = 'number' then (${e} #>> '{}')::numeric end, 0) + ${t}::numeric)`;if(!t||typeof t!=`object`||Array.isArray(t))return e;let n=Object.entries(t).map(([t,n])=>I`${t}::text, ${R(I`(${e} -> ${t}::text)`,n)}`);return I`(case when jsonb_typeof(${e}) = 'object' then ${e} else '{}'::jsonb end || jsonb_build_object(${I.join(n,I`, `)}))`}const z=e=>I`(case ${e} ${I.join([...i,...t].map(e=>I`when ${e} then ${I.raw(String(n(e)))}`),I` `)} end)`,B=e=>I`date_trunc('milliseconds', ${e})`,V=e=>[T(z(e.status)),E(B(e.createdAt)),E(e.publicId)];var H=class{db;constructor(e){this.db=e}async metrics(e,t){let n=await this.db.select({status:f.status,total:I`count(*)::int`,recent:I`count(*) filter (where ${f.createdAt} >= ${new Date(t).toISOString()}::timestamptz)::int`}).from(f).where(D(f.organizationId,e)).groupBy(f.status),r={tasks:{queued:0,running:0,waiting:0,completed:0,failed:0,cancelled:0},queueDepth:0};for(let e of n)r.tasks[e.status]=e.recent,e.status===`queued`&&(r.queueDepth=e.total);return r}where(e,t){return w(D(f.organizationId,e),D(f.publicId,t))}fence(e,t,n={}){return w(this.where(e,t),n.generation===void 0?void 0:D(f.generation,n.generation),n.attempts===void 0?void 0:D(f.attempts,n.attempts),n.tokenHash===void 0?void 0:n.tokenHash===null?N(f.tokenHash):D(f.tokenHash,n.tokenHash),n.handle===void 0?void 0:n.handle===null?N(f.handle):D(f.handle,n.handle),n.lastSeenAt===void 0?void 0:n.lastSeenAt===null?N(f.lastSeenAt):D(f.lastSeenAt,new Date(n.lastSeenAt)),n.updatedAt===void 0?void 0:D(f.updatedAt,new Date(n.updatedAt)),n.statuses?j(f.status,n.statuses):void 0)}async enqueue(e,t,n,r,i){let a=this.insertion(e,t,n,r,i),[o]=i===void 0?await b(this.db,a):await h(this.db,[I`select pg_advisory_xact_lock(1, hashtext(${e}))`],a);if(!o?.allowed)throw Error(`Organization task queue is full`);return!!o.inserted}insertion(e,t,n,r,i,a){let o=t.event,s=new Date(n).toISOString(),c=e=>I`${e===void 0?null:JSON.stringify(e)}::jsonb`,m=r?I`
|
|
2
2
|
receipt as (
|
|
3
3
|
insert into ${l} (key, value, expires_at)
|
|
4
4
|
select ${x(e,`delivery`,r.key)}, ${c({at:n})}, ${new Date(n+r.ttlMs).toISOString()}::timestamptz
|
|
@@ -48,7 +48,7 @@ import{Ct as e,pn as t,xt as n}from"./dispatch-YW1aqjEg.js";import{Hn as r,a as
|
|
|
48
48
|
from picked where ${f.id} = picked.id returning ${f}.*
|
|
49
49
|
) select to_jsonb(claimed) as record, exists (select 1 from ${f} where status = 'queued' and id <> claimed.id
|
|
50
50
|
and ${i===void 0?I`true`:I`(select count(*) from ${f} active where active.organization_id = ${f.organizationId} and active.status in ('running', 'waiting')) + case when ${f.organizationId} = claimed.organization_id then 1 else 0 end < ${i}`})
|
|
51
|
-
and ${t===void 0?I`true`:I`(select count(*) from ${f} where status in ('running', 'waiting')) + 1 < ${t}`} as more from claimed`,[l]=await h(this.db,t===void 0&&i===void 0?[]:[I`select pg_advisory_xact_lock(2, 0)`],c);if(!l)return;let u=new L(g),d=Object.fromEntries(Object.entries(O(f)).map(([e,t])=>{let n=l.record[u.getColumnCasing(t)];return[e,n===null?null:t.mapFromDriverValue(n)]}));return{organizationId:d.organizationId,status:_(d),token:r(d.publicId,d.organizationId,d.attempts,o).token,more:l.more}}async touch(e,t,n,r,i,a=!1){let o=j(f.status,[`running`,`waiting`]),s=new Date(i).toISOString(),[c]=await this.db.update(f).set({lastSeenAt:I`case when ${o} then ${s}::timestamptz else ${f.lastSeenAt} end`,updatedAt:I`case when ${o} then ${s}::timestamptz else ${f.updatedAt} end`}).where(this.fence(e,t,{tokenHash:n,attempts:r,statuses:a?[`running`,`waiting`,`completed`,`failed`,`cancelled`]:[`running`,`waiting`]})).returning();return c&&_(c)}async patchTask(e,t,n,r,i={}){let{answer:a,archivedAt:o,autoArchived:s,lastSeenAt:c,...l}=n,[u]=await this.db.update(f).set({...Object.fromEntries(Object.entries(l).map(([e,t])=>[e,t??null])),...a===void 0?{}:{answer:I`coalesce(${f.answer}, '[]'::jsonb) || ${JSON.stringify([a])}::jsonb`},...Object.hasOwn(n,`archivedAt`)?{archivedAt:o===void 0?null:new Date(o)}:{},...Object.hasOwn(n,`lastSeenAt`)?{lastSeenAt:c===void 0?null:new Date(c)}:{},updatedAt:new Date(r)}).where(this.fence(e,t,i)).returning({id:f.id});return!!u}async archiveStopped(n,r,i){await this.db.update(f).set({archivedAt:new Date(r)}).where(w(D(f.organizationId,n),i?j(f.publicId,i):void 0,N(f.archivedAt),j(f.status,[...t]),P(I`coalesce(${f.finishedAt}, ${f.updatedAt})`,new Date(r-e))))}async requeue(e,t,n,r={}){let[i]=await this.db.update(f).set({status:`queued`,lockedAt:null,handle:null,tokenHash:null,lastSeenAt:null,updatedAt:new Date(n)}).where(this.fence(e,t,{...r,statuses:[`running`,`waiting`]})).returning({id:f.id});return!!i}async finish(e,t,n,r,i={}){let a=new Date(r),[o]=await this.db.update(f).set({status:n.status,result:n.result??null,error:n.error??null,tokens:n.tokens??null,lastSeenAt:a,lockedAt:null,finishedAt:a,updatedAt:a}).where(this.fence(e,t,{...i,statuses:[`queued`,`running`,`waiting`]})).returning({id:f.id});return!!o}async continueTask(e,t,n,r,i){let a=I`(select value from ${l} where key = ${S(e,`note`)} ||
|
|
51
|
+
and ${t===void 0?I`true`:I`(select count(*) from ${f} where status in ('running', 'waiting')) + 1 < ${t}`} as more from claimed`,[l]=await h(this.db,t===void 0&&i===void 0?[]:[I`select pg_advisory_xact_lock(2, 0)`],c);if(!l)return;let u=new L(g),d=Object.fromEntries(Object.entries(O(f)).map(([e,t])=>{let n=l.record[u.getColumnCasing(t)];return[e,n===null?null:t.mapFromDriverValue(n)]}));return{organizationId:d.organizationId,status:_(d),token:r(d.publicId,d.organizationId,d.attempts,o).token,more:l.more}}async touch(e,t,n,r,i,a=!1){let o=j(f.status,[`running`,`waiting`]),s=new Date(i).toISOString(),[c]=await this.db.update(f).set({lastSeenAt:I`case when ${o} then ${s}::timestamptz else ${f.lastSeenAt} end`,updatedAt:I`case when ${o} then ${s}::timestamptz else ${f.updatedAt} end`}).where(this.fence(e,t,{tokenHash:n,attempts:r,statuses:a?[`running`,`waiting`,`completed`,`failed`,`cancelled`]:[`running`,`waiting`]})).returning();return c&&_(c)}async patchTask(e,t,n,r,i={}){let{answer:a,archivedAt:o,autoArchived:s,lastSeenAt:c,...l}=n,[u]=await this.db.update(f).set({...Object.fromEntries(Object.entries(l).map(([e,t])=>[e,t??null])),...a===void 0?{}:{answer:I`coalesce(${f.answer}, '[]'::jsonb) || ${JSON.stringify([a])}::jsonb`},...Object.hasOwn(n,`archivedAt`)?{archivedAt:o===void 0?null:new Date(o)}:{},...Object.hasOwn(n,`lastSeenAt`)?{lastSeenAt:c===void 0?null:new Date(c)}:{},updatedAt:new Date(r)}).where(this.fence(e,t,i)).returning({id:f.id});return!!u}async archiveStopped(n,r,i){await this.db.update(f).set({archivedAt:new Date(r)}).where(w(D(f.organizationId,n),i?j(f.publicId,i):void 0,N(f.archivedAt),j(f.status,[...t]),P(I`coalesce(${f.finishedAt}, ${f.updatedAt})`,I`${new Date(r-e).toISOString()}::timestamptz`)))}async requeue(e,t,n,r={}){let[i]=await this.db.update(f).set({status:`queued`,lockedAt:null,handle:null,tokenHash:null,lastSeenAt:null,updatedAt:new Date(n)}).where(this.fence(e,t,{...r,statuses:[`running`,`waiting`]})).returning({id:f.id});return!!i}async finish(e,t,n,r,i={}){let a=new Date(r),[o]=await this.db.update(f).set({status:n.status,result:n.result??null,error:n.error??null,tokens:n.tokens??null,lastSeenAt:a,lockedAt:null,finishedAt:a,updatedAt:a}).where(this.fence(e,t,{...i,statuses:[`queued`,`running`,`waiting`]})).returning({id:f.id});return!!o}async continueTask(e,t,n,r,i){let a=I`(select value from ${l} where key = ${S(e,`note`)} ||
|
|
52
52
|
case when ${f.source} = ${f.event}->>'integration' then
|
|
53
53
|
(${f.event}->>'appId') || ':' || (${f.event}->>'installationId') || ':' || coalesce(${f.event}->'chat'->'thread'->>'id', ${f.event}->>'deliveryId')
|
|
54
54
|
else 'task:' || ${f.publicId} end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e,wn as t}from"./dispatch-YW1aqjEg.js";import{i as n}from"./cli-IfrPgeYz.js";const r=n({name:`upgrade refresh`,options:{},run:()=>e(t())});export{r as commandRefreshUpdate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{St as e}from"./dispatch-YW1aqjEg.js";import{i as t,t as n}from"./cli-
|
|
1
|
+
import{St as e}from"./dispatch-YW1aqjEg.js";import{i as t,t as n}from"./cli-IfrPgeYz.js";import{p as r}from"./output-BKeyLbvt.js";import{n as i,o as a}from"./args-DEMOfLz2.js";import o from"node:process";const s={json:i,server:a,workspace:i,yes:i},c=()=>new e(`invalid-option`,`Missing credential label.`),l=t({name:`credentials remove`,globalFlags:{cwd:!1},help:{usage:`coder credentials remove <label> [--workspace] [--server [url]] [--json]`,flags:[[`--workspace`,`the workspace credential of that label`],n]},options:s,args:1,async run({options:e,args:[t]}){let{connect:n}=await import(`./remote-AcWWfKVS.js`).then(e=>e.a);if(!t)throw c();return n(e).credentials.remove(t,e)},print:(e,{args:[t]})=>o.stdout.write(`Removed ${r.bold(t)}.\n`)});export{l as commandCredentialsRemove,s as credentialOptions,c as missingLabel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ot as e}from"./dispatch-YW1aqjEg.js";import{i as t}from"./cli-
|
|
1
|
+
import{ot as e}from"./dispatch-YW1aqjEg.js";import{i as t}from"./cli-IfrPgeYz.js";import{n,t as r}from"./args-DEMOfLz2.js";import i from"node:process";const a=t({name:`mcp remove`,helpName:`mcp rm`,help:{usage:`coder mcp rm <name> [--user] [--cwd <dir>]`,summary:"Remove `mcp.<name>` from the repo config (or the user config with --user).",flags:[[`--user`,`edit ~/.coder config`]]},options:{...r,user:n},args:1,run:({options:t,args:[n],cwd:r})=>e(r,n,t),print:({name:e,file:t})=>i.stdout.write(`Removed MCP server "${e}" from ${t}.\n`)});export{a as commandMcpRemove};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DT7IzrpZ.js";import{i as t}from"./cli-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DT7IzrpZ.js";import{i as t}from"./cli-IfrPgeYz.js";import{p as n}from"./output-BKeyLbvt.js";import{i as r}from"./models-DGPrMV51.js";import{n as i}from"./add-CKENklTr.js";import a from"node:process";var o=e({commandModelRemove:()=>s,printModelChange:()=>c});const s=t({name:`model remove`,help:{usage:`coder model remove <name>`,summary:`Remove a configured custom model.`,flags:[[`--workspace`,`target <repo>/.coder/config.json instead of the user file`]]},options:i,args:1,run:({options:e,args:[t],cwd:n})=>r(n,t,e),print:e=>c(`removed`,e.removed,e.file)});function c(e,t,r){a.stdout.write(`${e} ${n.cyan(t)} ${n.dim(`(${r})`)}\n`)}export{o as n,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{St as e}from"./dispatch-YW1aqjEg.js";import{i as t,t as n}from"./cli-
|
|
1
|
+
import{St as e}from"./dispatch-YW1aqjEg.js";import{i as t,t as n}from"./cli-IfrPgeYz.js";import{p as r}from"./output-BKeyLbvt.js";import{n as i,o as a}from"./args-DEMOfLz2.js";import o from"node:process";const s={json:i,server:a,yes:i},c=t({name:`runner remove`,globalFlags:{cwd:!1},help:{usage:`coder runner remove <id> [--server [url]] [--json]`,flags:[n]},options:s,args:1,async run({options:t,args:[n]}){let{removeRunner:r}=await import(`./runner-c-2w6Eoj.js`).then(e=>e.a);if(!n)throw new e(`invalid-option`,`Missing runner id.`);return r(n,t)},print:(e,{args:[t]})=>o.stdout.write(`Removed ${r.bold(t)}.\n`)});export{c as commandRunnerRemove,s as runnerOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{St as e}from"./dispatch-YW1aqjEg.js";import{i as t,t as n}from"./cli-
|
|
1
|
+
import{St as e}from"./dispatch-YW1aqjEg.js";import{i as t,t as n}from"./cli-IfrPgeYz.js";import{p as r}from"./output-BKeyLbvt.js";import{runnerOptions as i}from"./remove-CZmO4BSd.js";import a from"node:process";const o=t({name:`runner rename`,globalFlags:{cwd:!1},help:{usage:`coder runner rename <id> <name> [--server [url]] [--json]`,flags:[n]},options:i,args:2,async run({options:t,args:[n,r]}){let{updateRunner:i}=await import(`./runner-c-2w6Eoj.js`).then(e=>e.a);if(!n||!r)throw new e(`invalid-option`,`Usage: coder runner rename <id> <name>`);return i(n,{name:r},t)},print:(e,{args:[t]})=>a.stdout.write(`Renamed ${t} to ${r.bold(e.name)}.\n`)});export{o as commandRunnerRename};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{St as e,pn as t}from"./dispatch-YW1aqjEg.js";import{i as n}from"./cli-
|
|
1
|
+
import{St as e,pn as t}from"./dispatch-YW1aqjEg.js";import{i as n}from"./cli-IfrPgeYz.js";import{c as r,m as i,p as a,s as o}from"./output-BKeyLbvt.js";import{l as s,t as c}from"./args-DEMOfLz2.js";import{gateLine as l,gateRunningLine as u,paintPlain as d,printLedger as f,resultJson as p,stepSymbol as m,taskLabel as h,taskLine as g}from"./watch-BlGYjH88.js";import _ from"node:process";const v=n({name:`flow result`,help:{usage:`coder flow result [run-id] [--tail <n|all>] [--json]`,summary:`Show a flow run's status and result, with its tasks, gates, and token ledger.
|
|
2
2
|
--tail <n> caps the step rows (0 for the result alone). Defaults to the most
|
|
3
3
|
recent run. To watch a run live, prefer \`coder flow watch\`.`,flags:[[`--tail <n|all>`,`show the last n step rows (default: all; 0 hides them)`]],examples:[[`coder flow result --tail 0`,`the most recent run's result, no step rows`]]},options:{...c,tail:s},args:1,async run({options:t,args:[n]}){let{runResult:r}=await import(`./executor-HWnIIYUL.js`).then(e=>e.b),i=r(n);if(!i&&!t.json)throw new e(`flow-failed`,n?`No flow run "${n}".`:`No flow runs yet.`,{hint:`Run one: coder flow run <name>`});return i},json:e=>e&&p(e),print:(e,{options:t})=>b(e,t.tail)});function y(e,t=!1){let n=a;if(t)return e.map(d);let r=(t,n)=>{for(let r=t+1;r<e.length;r+=1){let t=e[r].depth;if(t<n)return!1;if(t===n)return!0}return!1};return e.map((e,t)=>{let i=``;for(let n=0;n<e.depth;n+=1)i+=r(t,n)?`│ `:` `;return i+=e.log?`│ `:r(t,e.depth)?`├─`:`└─`,`${n.dim(i)} ${e.body}`})}function b(e,n=`all`){let s=a,c=!_.stdout.isTTY;_.stdout.write(`${s.bold(`Flow`)} ${s.cyan(e.name)} ${s.dim(`(${e.runId})`)}. ${s.bold(i(e.status))}\n`);let d=e.steps,p=d.filter(e=>t.includes(e.status)).length,v=e.status===`running`?`${p}/${d.length} tasks`:`${e.taskCount} tasks`;if(_.stdout.write(`${s.dim(`started ${e.startedAt}${e.endedAt?` · ended ${e.endedAt}`:``} · ${v}`)}\n`),n!==0){let t=new Map,r=new Map,i=new Map,a=[];for(let n of e.events)if(n.kind===`task-start`){let e={name:h(n.name,n.prompt),engine:n.engine,depth:n.depth??0};t.set(n.taskId,e),r.set(n.taskId,e)}else if(n.kind===`task-end`){r.delete(n.taskId);let e=t.get(n.taskId);a.push({depth:e?.depth??0,body:g(m(n.status,c),e?.name??null,n.taskId,n.tokens,e?.engine)})}else if(n.kind===`gate-start`)i.set(n.gateId,{cmd:n.cmd,depth:n.depth??0});else if(n.kind===`gate`)n.gateId&&i.delete(n.gateId),a.push({depth:n.depth??0,body:l(n,c)});else if(n.kind===`log`)for(let e of n.message.split(`
|
|
4
4
|
`))a.push({depth:n.depth??0,body:s.light(e),log:!0});else n.kind===`flow-start`&&a.push({depth:n.depth-1,body:s.bold(`flow ${n.name}`)});for(let[e,t]of r)a.push({depth:t.depth??0,body:g(m(`running`,c),t.name,e,null,t.engine)+(c?``:` ${s.light(`running`)}`)});for(let e of i.values())a.push({depth:e.depth,body:u(e.cmd,m(`running`,c))+(c?``:` ${s.light(`running`)}`)});if(!a.length)for(let e of n===`all`?d:d.slice(-n))a.push({depth:0,body:g(m(e.status,c),e.name,e.taskId??`-`,e.tokens)});let o=y(a,c),f=n===`all`?o:o.slice(-n);f.length&&_.stdout.write(`\n${f.join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DT7IzrpZ.js";import{Ft as t,Tt as n,fn as r,jn as i}from"./dispatch-YW1aqjEg.js";import{i as a,r as o}from"./cli-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DT7IzrpZ.js";import{Ft as t,Tt as n,fn as r,jn as i}from"./dispatch-YW1aqjEg.js";import{i as a,r as o}from"./cli-IfrPgeYz.js";import{S as s,a as c,d as l,m as u,o as d,p as f,s as p,u as m,x as h,y as g}from"./output-BKeyLbvt.js";import{i as _,l as v,n as y,s as b,t as x}from"./args-DEMOfLz2.js";import S from"node:process";var C=e({LogRenderer:()=>z,OUTPUT_PREVIEW_CHARS:()=>500,commandResult:()=>q,finalMessageLine:()=>T,finishedHints:()=>U,printOutcome:()=>W,promptBlock:()=>D,replyOf:()=>H,statusStyle:()=>B,taskHeaderLines:()=>A,taskSummaryLines:()=>M,trimStep:()=>N});const w={server:_,workspace:b,yes:y};function T(e,t,n,r=f){let i=e?.error?.message??t;return e?.finalMessage||(i?`${r.red(`error:`)} ${i}`:n)}const E=1e3;function D(e,t=f,{truncate:n=!0}={}){let r=e=>e.split(`
|
|
2
2
|
`).map(e=>` ${t.dim(e)}`);return!n||e.length<=E?[t.dim(`prompt:`),...r(e)]:[t.dim(`prompt:`),...r(e.slice(0,500).trimEnd()),t.light(` … <${e.length-E} chars trimmed> …`),...r(e.slice(-500).trimStart())]}function O(e,t=f){let n=[];e.permissions&&n.push([`perms`,e.permissions]),e.cwd&&n.push([`cwd`,e.cwd]);for(let t of e.addDirs??[])n.push([`add-dir`,t]);return n.map(([e,n])=>`${t.dim(e.padEnd(8))} ${n}`)}function k(e,t){if(t)return e.createdAt?`started ${c(n(e.createdAt))} ago`:``;let r=e.createdAt&&e.completedAt?Date.parse(e.completedAt)-Date.parse(e.createdAt):null;return[e.completedAt?`finished ${c(n(e.completedAt))} ago`:``,r!==null&&r>=0?`took ${c(r)}`:``].filter(Boolean).join(` · `)}function A(e,{status:n,tokens:i,tokenModel:a,files:o,live:s=!1,style:c=f}){let d=k(e,r.includes(e.status)||n===`waiting-approval`),p=e=>c.dim(e.padEnd(8));return[`${p(`task`)} ${c.cyan(e.id)}`,...e.name?[`${p(`name`)} ${e.name}`]:[],`${p(`status`)} ${u(n)}${d?` ${c.dim(`(${d})`)}`:``}`,`${p(`engine`)} ${t(e)}`,...O(e,c),...i?[`${p(`tokens`)} ${s?l(i):m(i,a??e.model)}${s?c.dim(` (so far)`):``}`]:[],...j(o,p,c)]}const j=(e,t,n)=>e?.length?[`${t(`files`)} ${e.join(`, `)} ${n.dim(`(shell edits not included)`)}`]:[];function M(e,{tokens:t,tokenModel:n,files:r,statusChanged:i=!0,style:a=f}){let o=e=>a.dim(e.padEnd(8)),s=e.createdAt&&e.completedAt?Date.parse(e.completedAt)-Date.parse(e.createdAt):null;return[...i?[`${o(`status`)} ${u(e.status)}${s!==null&&s>=0?` ${a.dim(`(took ${c(s)})`)}`:``}`]:[],...t?[`${o(`tokens`)} ${m(t,n??e.model)}`]:[],...j(r,o,a)]}function N(e,t=300,{plain:n=!1,style:r=f}={}){if(e.length<=t)return e;let i=`<${e.length-t} more chars>`;return`${e.slice(0,t)} ${n?i:r.dim(i)}`}const P=` `.repeat(8),F={assistant:`●`,reasoning:`✻`,tool:`→`,"tool-result":` `,usage:`·`,status:`·`,info:`·`,error:`✘`,steer:`⚑`};function I(e,t){let n=/^\x1b\[[0-9;]*m/.exec(t(``))?.[0];return t(n&&e.includes(L)?e.split(L).join(`${L}${n}`):e)}const L=`\x1B[0m`;function R(e,t,n,r,i=r.dim){if(!e)return``;let a=(e.length>t?e.slice(0,t):e).split(`
|
|
3
3
|
`).map(e=>I(e,i));return e.length>t&&(a[a.length-1]+=` ${r.light(`<${e.length-t} more chars>`)}`),a.length>n?[...a.slice(0,n),r.light(`… +${a.length-n} more lines`)].join(`
|
|
4
4
|
`):a.join(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{i as e}from"./cli-
|
|
1
|
+
import{i as e}from"./cli-IfrPgeYz.js";import{printFollow as t,printRunSummary as n}from"./watch-BlGYjH88.js";import{RUN_FLAGS as r,hooks as i,parseRunArgs as a,printDetached as o,runOptions as s}from"./run-Dd9HdNSL.js";const c=e({name:`flow resume`,help:{usage:`coder flow resume [run-id] [--wait] [--json] [--dry-run]`,summary:`Re-run a flow from its journal: finished steps replay instantly, the first
|
|
2
2
|
changed or new step onward runs live. Defaults to the most recent run.
|
|
3
3
|
Accepts the same flags as flow run.`,flags:[[`--wait`,`follow the run in the foreground (Ctrl-C detaches; it keeps running)`],[`--concurrency <n>`,`tasks running at once`],[`--max-tasks <n>`,`total tasks the run may dispatch`]],examples:[[`coder flow resume`,`continue the most recent run`]]},options:r,args:1,async run({options:e,args:[n],cwd:r}){let{resumeRun:o}=await import(`./executor-HWnIIYUL.js`).then(e=>e.b),c=await o(n,{...s(e,r),...e.args===void 0?{}:{args:a(e.args,[])}},i(e));return c.status===`running`&&c.watch&&await t(c.watch,e),c},print:e=>e.status===`running`?o(e):n(e)});export{c as commandResume};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{St as e}from"./dispatch-YW1aqjEg.js";import{i as t}from"./cli-
|
|
1
|
+
import{St as e}from"./dispatch-YW1aqjEg.js";import{i as t}from"./cli-IfrPgeYz.js";import{c as n,n as r,s as i,t as a}from"./args-DEMOfLz2.js";import o from"node:process";import*as s from"zod/mini";function c(e){let{summary:t}=e,n=`\`${t.baseSha}\`${t.worktree?` through the working tree`:`..\`${t.headSha}\``}`,r=(t.warnings??[]).flatMap(e=>[e,``]);if(t.worktree&&!t.files)return`${[`# Coder review`,``,`Nothing to review from ${n}.`,``,...r,`Flow run: \`${e.runId}\``].join(`
|
|
2
2
|
`)}\n`;let i=[`# Coder review`,``,`Reviewed ${n}${t.model?` with ${t.model}`:``} in ${(t.elapsedMs/1e3).toFixed(1)}s.`,``,...r,...e.findings.length?e.findings.flatMap(e=>[`- **${e.severity.toUpperCase()}** [\`${e.file}:${e.line}\`]. ${e.summary}`,` ${e.failure_scenario}`]):[`No findings after checking against the repository.`]];return t.posted!==void 0&&i.push(``,`Posted ${t.posted} new inline comment${t.posted===1?``:`s`}.`),i.push(``,`Flow run: \`${e.runId}\``),`${i.join(`
|
|
3
3
|
`)}\n`}const l=t({name:`review`,help:{usage:`coder review [--base <ref>] [--head <ref>] [--pr <n|url>] [--since <sha>] [--path <p>]... [--exclude <p>]... [--post] [--json|--md] [--engine <name>] [--model <alias|slug>] [--effort <low|medium|high>] [--cwd <dir>]`,summary:`Review changed code with a read-only agent. Every reported finding is checked
|
|
4
4
|
against the repository. Runs the built-in \`review\` flow. A local review covers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./cli-
|
|
1
|
+
import{i as e}from"./cli-IfrPgeYz.js";import{n as t}from"./args-DEMOfLz2.js";import n from"node:process";const r=e({name:`server rotate-key`,globalFlags:{cwd:!1},help:{usage:`coder server rotate-key [--json]`,summary:`Re-seal stored app, installation, engine, and linked user secrets with the current key.`,env:[[`SERVER_ENCRYPTION_KEY`,`the new key`],[`SERVER_ENCRYPTION_KEY_PREVIOUS`,`the old key, still accepted while rotating`]]},options:{json:t},run:async()=>{let{rotateKey:e}=await import(`./maintenance-CVfHIraw.js`).then(e=>e.t);return e()},json:({moved:e})=>({ok:!0,moved:e}),print:({moved:e})=>n.stdout.write(`Re-sealed ${e} secret${e===1?``:`s`}.\n`)});export{r as commandServerRotateKey};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{St as e}from"./dispatch-YW1aqjEg.js";import{i as t}from"./cli-
|
|
1
|
+
import{St as e}from"./dispatch-YW1aqjEg.js";import{i as t}from"./cli-IfrPgeYz.js";import{p as n,s as r}from"./output-BKeyLbvt.js";import{n as i,s as a,t as o}from"./args-DEMOfLz2.js";import{FlowStepRenderer as s,printFollow as c,printRunSummary as l}from"./watch-BlGYjH88.js";import u from"node:process";const d={...o,args:a,wait:i,concurrency:a,"max-tasks":a,"dry-run":i};function f(t){let n={};for(let r of t){let t=r.indexOf(`=`);if(t===-1)throw new e(`invalid-option`,`Invalid argument "${r}": expected key=value.`,{hint:`Help: coder flow run --help`});let i=r.slice(0,t),a=r.slice(t+1);try{n[i]=JSON.parse(a)}catch{n[i]=a}}return n}function p(t,n){if(t!==void 0)try{return JSON.parse(t)}catch(t){throw new e(`invalid-option`,`Invalid --args JSON: ${t instanceof Error?t.message:String(t)}`)}return n.length?f(n):{}}const m=e=>e?Number(e):void 0,h=(e,t)=>({cwd:t,dryRun:e[`dry-run`],concurrency:m(e.concurrency),maxTasks:m(e[`max-tasks`]),argv:u.argv.slice(2),wait:e.wait}),g=e=>e[`dry-run`]&&!e.json?v():{},_=t({name:`flow run`,help:{usage:`coder flow run <name|path> [--args '<json>' | key=value...] [--wait] [--concurrency N] [--max-tasks N] [--json] [--dry-run]`,summary:`Run a flow: a TypeScript file that orchestrates many coder tasks with gates,
|
|
2
2
|
journaling, and resume. Prints the run id and orchestrates in the background;
|
|
3
3
|
--wait follows the run in the foreground with live progress (Ctrl-C detaches;
|
|
4
4
|
it keeps running), and \`coder flow watch\` shows the same lines any time.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e}from"./prompt-K7-bKcTC.js";import{i as t,r as n}from"./cli-
|
|
1
|
+
import{p as e}from"./prompt-K7-bKcTC.js";import{i as t,r as n}from"./cli-IfrPgeYz.js";import{p as r,s as i}from"./output-BKeyLbvt.js";import{i as a,n as o,s,t as c}from"./args-DEMOfLz2.js";import{i as l}from"./result-DtXZusqj.js";import{printLine as u}from"./watch-Y82ubvGH.js";import d from"node:process";const f={...c,flow:s,server:a,workspace:s,wait:o,task:s,yes:o},p=t({name:`agent run --task`,options:f,run:async({options:e,cwd:t})=>{let{agents:n}=await import(`./agent-D0pQ_ewc.js`).then(e=>e.t);return n.runTask(e.task,{cwd:t})}}),m=t({name:`agent run`,help:{usage:`coder agent run <agent> <file> [--server [url] [--wait]] [--flow <name>] [--json] [--cwd <dir>]`,summary:`Run a recorded platform event (AgentEvent JSON) through an agent. With --server it goes through your Coder server exactly like a webhook: real app, tokens, runner, and the reply is posted. Without it the engine runs here on the agent's prompt and this checkout, platform tools off, and the reply is printed.`,flags:[n,[`--wait`,`with --server: follow the task log here until it finishes, then print the reply`],[`--flow <name>`,`override the matched flow`]],examples:[[`coder agent run helper sample-slack-mention.json`,`offline: print what the agent would reply`],[`coder agent run helper event.json --server`,`for real, through the server`]]},options:f,args:2,run:async({options:e,args:[t,n],cwd:i})=>{let{agents:a}=await import(`./agent-D0pQ_ewc.js`).then(e=>e.t);return a.run(t,n,{...e,cwd:i,organization:e.workspace,...e.json?{}:{onLog:e=>u(e,r),onDone:e=>l(e,r)}})},json:e=>Array.isArray(e)&&e.length===1?e[0]:e,print(t,{options:n}){if(!Array.isArray(t)){if(`tasks`in t){if(!t.tasks.length)return void d.stdout.write(`The server accepted the event but no agent matched it.
|
|
2
2
|
`);d.stdout.write(`${r.bold(`Queued on the server`)} as task ${t.tasks.join(`, `)}.\n\n${i([`Watch it: coder task watch ${t.tasks[0]} --server ${e(n.server)}`],r)}\n`);return}t.reply===void 0?t.result!==void 0&&d.stdout.write(`${JSON.stringify(t.result,null,2)}\n`):d.stdout.write(`${t.reply.trim()}\n`)}}}),h=Object.assign(e=>(e.some(e=>e===`--task`||e.startsWith(`--task=`))?p:m)(e),{commandName:`agent run`,help:m.help});export{h as commandAgentRun};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as e,i as t,n,p as r}from"./cli-
|
|
1
|
+
import{d as e,i as t,n,p as r}from"./cli-IfrPgeYz.js";import{p as i,r as a,s as o,u as s}from"./output-BKeyLbvt.js";import{c,i as l,n as u,s as d,t as f}from"./args-DEMOfLz2.js";import{i as p,r as m}from"./result-DtXZusqj.js";import{printLine as h}from"./watch-Y82ubvGH.js";import{TASK_FLAGS as g}from"./task-DvPkqHCF.js";import _ from"node:process";function v(t){let n=e([{usage:`coder task result ${t} --wait`,blurb:`run this in its own background shell, one per task (never wait on several tasks in one call). Returns with the answer or a pending approval.`},{usage:`coder task steer ${t} "<follow-up>"`,blurb:`steer the task with a message (use 'ask' without interrupting main thread)`},{usage:`coder task stop ${t}`,blurb:`stop the task`},{usage:`coder task list`,blurb:`recent tasks`},{usage:`coder task --help`,blurb:`all task commands`}],i,i.blue);return[...r(`Next step`,n.slice(0,1),i),...r(`Related`,n.slice(1),i)].join(`
|
|
2
2
|
`)}function y(e,t){_.stdout.write(`${i.dim(`[coder]`)} task ${i.blue(e)} started in the background (${t}).\n`),_.stdout.write(`${v(e)}\n`)}function b(e){_.stderr.write(`${i.dim(`[coder]`)} Task ${i.cyan(e)} started and is waiting to finish. Press Ctrl-C to detach. It keeps running.\n`),_.stderr.write(`${v(e)}\n`)}function x(e){_.stderr.write(`\n${i.dim(`[coder] Detached. The task is still running.`)}\n\n${o([`Wait in its own background shell, one per task: coder task result ${e} --wait`],a)}\n`)}function S(e){_.stdout.write(`\n${e.finalMessage||(e.error?`${i.red(`error:`)} ${e.error}`:`(no final message)`)}\n\n`);let t=e.tokens?` tokens=${s(e.tokens,e.model)}`:``;_.stderr.write(`${i.dim(`[coder] task=${e.taskId} status=${e.status}${t}`)}\n\n${m(e.taskId,a)}\n`)}const C=t({name:`task run`,help:{usage:`coder task run "<task text>"`,summary:`Dispatch a coding task to the configured engine. Backgrounds by default and\nprints a task id; --wait runs in the foreground and prints the answer.\nShortcut: \`coder run "<text>"\`.\n\nWriting a task: one task per focused goal, independent goals as parallel runs.\nThe worker starts with nothing but the text, so include the goal, file paths,\nconstraints and any context only you have. Delegate rather than doing the work\nyourself first, however small it looks.\n\nWaiting: run \`coder task result <task-id> --wait\` in its own background shell, one\nper task. Never wait on several tasks in one call, or their approvals and answers\nnever reach you one by one.\n\n${n}`,flags:[[`--output-schema <json>`,`JSON Schema for the task answer`],[`--name <name>`,`label the task (shown in list/result)`],[`--agent <id>`,`run as that agent: its system.md, engine settings, MCP servers and flows; flags override them`],[`--system <text>`,`standing instructions prepended to the task (kept out of prompt previews)`],...g,[`--server [url] [--workspace <slug>]`,`run the task on your Coder server and follow it here (--background prints its id)`],[`--repo <owner/name>`,`with --server: check out a repo from the workspace's installs`],[`--runner <name>`,`with --server: where it runs (a runner kind or a registered runner)`]],exitCodes:[[`0`,`The task started, or --wait printed a successful answer.`],[`1`,`Dispatch or the task failed.`],[`3`,`No engine could start; follow fallback.instructions in the JSON payload.`],[`4`,`An approval is pending; answer it, then run result --wait again.`],[`130`,`The foreground wait was detached and the task is still running.`]],examples:[[`coder run "add a /health endpoint"`,`dispatch in the background, print a task id`],[`coder result <task-id> --wait`,`then block until it finishes and print the answer`],[`coder run --wait "fix the failing test"`,`or block on the run itself`],[`coder task run --model luna --system "tests live in test/, don't touch anything outside of it" "rename foo to bar"`,`pick an engine via its model alias; --system adds standing instructions`],[`coder task run --agent reviewer "review the last commit"`,`run a repo agent from .coder/agents/reviewer`],[`coder run --add-dir ../api --add-dir ../shared "update the client for the new endpoint"`,`let the task reach sibling repos too`]]},options:{...f,agent:d,"output-schema":d,engine:d,model:d,effort:d,permissions:d,host:d,name:d,system:d,mcp:d,"add-dir":c,background:u,wait:u,"simulate-approval":u,server:l,workspace:d,yes:u,repo:d,runner:d},args:1/0,async run({options:e,args:t}){let{tasks:n}=await import(`./task-DEp3GHwH.js`).then(e=>e.t),r=e.json,a;return _.on(`SIGINT`,()=>{a&&x(a),_.exit(130)}),n.run(t.join(` `).trim(),{cwd:e.cwd,agent:e.agent,outputSchema:e[`output-schema`]?JSON.parse(e[`output-schema`]):void 0,engine:e.engine,model:e.model,effort:e.effort,permissions:e.permissions,name:e.name,system:e.system,mcp:e.mcp,addDirs:e[`add-dir`],wait:e.server===void 0?e.wait:!e.background,simulateApproval:e[`simulate-approval`],repo:e.repo,runner:e.runner,server:e.server,yes:e.yes,organization:e.workspace,onFallback:({engine:e,detail:t,next:n})=>_.stderr.write(`[coder] ${e} failed to start (${t}); falling back to ${n}.\n`),onNote:e=>_.stderr.write(`[coder] ${e}\n`),onWaiting:e=>{a=e,r||b(e)},onLog:e=>r?_.stdout.write(`${JSON.stringify(e,null,2)}\n`):h(e,i)})},print(e,{options:t}){if(`attempts`in e)return t.background?void _.stdout.write(`${e.task.id}\n`):p(e,i);t.wait?S(e):y(e.taskId,e.status)},exit:(e,{options:t})=>(`attempts`in e?!t.background:t.wait)?e.status===`completed`?0:1:void 0});export{C as commandTask};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e}from"./cli-IfrPgeYz.js";const t=e(`runner`,{add:async()=>(await import(`./add-KkLx1WbE.js`)).commandRunnerAdd,default:async()=>(await import(`./default-BfXXngYf.js`)).commandRunnerDefault,test:async()=>(await import(`./test-9FHRw5Jc.js`)).commandRunnerTest,serve:async()=>(await import(`./serve-CY46ohfr.js`)).commandRunnerServe,list:async()=>(await import(`./list-DWeYdLMU.js`)).commandRunnerList,rename:async()=>(await import(`./rename-ODyRelrw.js`)).commandRunnerRename,remove:async()=>(await import(`./remove-CZmO4BSd.js`)).commandRunnerRemove},{menu:[{usage:`add <kind>`,blurb:`connect a runner`},{usage:`default <id>`,blurb:`set the default in its scope`},{usage:`test <id>`,blurb:`check a runner connection`},{usage:`serve --url <public url>`,blurb:`run your server's tasks on this machine`},{usage:`list`,blurb:`list your runners and the workspace's`},{usage:`rename <id> <name>`,blurb:`rename a runner`},{usage:`remove <id>`,blurb:`remove a runner`}],description:[`Run your Coder server's tasks on your own machine, reached through any tunnel.`],exampleCommand:`runner serve`});export{t as commandRunner};
|
package/dist/sdk.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as CoderConfig, D as McpConfigEntry, E as McpAddOptions, O as Permission, S as TaskTurn, T as Effort, _ as RunnerPairing, b as RunnerTest, c as TaskStatus$1, d as TokenUsage, f as LocalFolder, g as RunnerKind, h as RunnerInput, l as TurnResult, m as ProbeResult, n as Availability, p as LocalFolders, s as Task, t as Approval, u as TaskLogEntry, v as RunnerRow, w as CustomModelConfig, x as RunnerUpdate, y as RunnerSpec } from "./types-
|
|
1
|
+
import { C as CoderConfig, D as McpConfigEntry, E as McpAddOptions, O as Permission, S as TaskTurn, T as Effort, _ as RunnerPairing, b as RunnerTest, c as TaskStatus$1, d as TokenUsage, f as LocalFolder, g as RunnerKind, h as RunnerInput, l as TurnResult, m as ProbeResult, n as Availability, p as LocalFolders, s as Task, t as Approval, u as TaskLogEntry, v as RunnerRow, w as CustomModelConfig, x as RunnerUpdate, y as RunnerSpec } from "./types-CdIo1Zbm.js";
|
|
2
2
|
import { ReviewArgs, ReviewResult } from "./flow/builtin/review.js";
|
|
3
|
-
import { C as FlowStep, a as readTurnResults, b as FlowEvent, c as archiveRuns, d as RunSummary, f as StopSummary, i as readTask, l as deleteRuns, n as flowSdk, o as CoderError, r as TaskResult, s as RunResult$1, u as RunOptions, x as FlowRecord, y as DiscoveredFlow } from "./index-
|
|
3
|
+
import { C as FlowStep, a as readTurnResults, b as FlowEvent, c as archiveRuns, d as RunSummary, f as StopSummary, i as readTask, l as deleteRuns, n as flowSdk, o as CoderError, r as TaskResult, s as RunResult$1, u as RunOptions, x as FlowRecord, y as DiscoveredFlow } from "./index-JcLiq1ac.js";
|
|
4
4
|
import "zod/mini";
|
|
5
5
|
import { Message, SerializedMessage, SerializedThread } from "chat";
|
|
6
6
|
import "drizzle-orm";
|
package/dist/sdk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,St as t,X as n,Y as r,at as i,nt as a,ot as o,rt as s,w as c}from"./dispatch-YW1aqjEg.js";import{n as l,r as u,s as ee,t as d}from"./remote-AcWWfKVS.js";import{n as f}from"./executor-HWnIIYUL.js";import{n as p}from"./agent-
|
|
1
|
+
import{C as e,St as t,X as n,Y as r,at as i,nt as a,ot as o,rt as s,w as c}from"./dispatch-YW1aqjEg.js";import{n as l,r as u,s as ee,t as d}from"./remote-AcWWfKVS.js";import{n as f}from"./executor-HWnIIYUL.js";import{n as p}from"./agent-D0pQ_ewc.js";import{t as m}from"./docs-Byrpar10.js";import{a as h,i as g,n as _,o as v,r as y,s as b,t as x}from"./models-DGPrMV51.js";import{n as S}from"./task-DEp3GHwH.js";import C from"./flow/index.js";import{i as w,n as T,o as E,r as D,s as O,t as k}from"./runner-c-2w6Eoj.js";import{t as A}from"./serve-xMihn4g-.js";import{t as j}from"./github-actions-CvLya8ve.js";import{n as M}from"./apps-CaHoLNE7.js";import{n as N,r as P}from"./maintenance-CVfHIraw.js";import{r as F,t as I}from"./serve-D_XiZzYd.js";import L from"node:path";import R from"node:process";function z(e){return e?L.resolve(e):R.cwd()}const B=S,V={add:(e,t)=>x(z(t.cwd),e,t),update:(e,t)=>b(z(t.cwd),e,t),remove:(e,t={})=>g(z(t.cwd),e,t),list:(e={})=>y(z(e.cwd)),alias:(e,t,n={})=>_(z(n.cwd),e,t,n),unalias:(e,t={})=>v(z(t.cwd),e,t),disable:(e,t={})=>h(z(t.cwd),e,!0,t),enable:(e,t={})=>h(z(t.cwd),e,!1,t)},H={get:(e,t={})=>r(z(t.cwd),e),set:(e,t,r={})=>n(z(r.cwd),e,t,r)},U={add:(e,t)=>a(z(t.cwd),e,t),addJson:(e,t,n={})=>s(z(n.cwd),e,t,n),list:(e={})=>i(z(e.cwd)),remove:(e,t={})=>o(z(t.cwd),e,t)};function W(t=[],n={}){return e(z(n.cwd),{hosts:t})}function G(e={}){return c(e)}function K(e,t={}){return m(e,t)}const q={async run(e={}){let t=await f(`review`,{cwd:e.cwd,args:e});return{...t.result,runId:t.runId}}},J=ee,Y={serve:I,migrate:N,rotateKey:P,workflow:()=>j,app:{create:M},handler:F},X={list:(e={})=>l(e).credentials.list(),add:d,remove:(e,t={})=>l(t).credentials.remove(e,t),default:(e,t={})=>l(t).credentials.setDefault(e,t),login:u},Z={list:(e={})=>l(e).folders.list(),check:(e,t={})=>l(t).folders.check(e)},Q={list:T,add:k,pair:D,update:O,default:(e,t={})=>O(e,{default:!0},t),test:E,rename:(e,t,n={})=>O(e,{name:t},n),remove:w,serve:A},$=p;var te={task:B,flow:C,model:V,config:H,mcp:U,setupHost:W,upgrade:G,docs:K,review:q,auth:J,agent:$,credentials:X,folders:Z,runner:Q,server:Y};export{t as CoderError,$ as agent,J as auth,H as config,X as credentials,te as default,K as docs,C as flow,Z as folders,U as mcp,V as model,q as review,Q as runner,Y as server,W as setupHost,B as task,G as upgrade};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{An as e,Et as t,Mn as n,Vt as r,W as i,_ as a,an as o,nn as s,tt as c,v as l,wn as u,y as d}from"./dispatch-YW1aqjEg.js";import{i as f}from"./cli-
|
|
1
|
+
import{An as e,Et as t,Mn as n,Vt as r,W as i,_ as a,an as o,nn as s,tt as c,v as l,wn as u,y as d}from"./dispatch-YW1aqjEg.js";import{i as f}from"./cli-IfrPgeYz.js";import{s as p}from"./args-DEMOfLz2.js";import{n as m}from"./mcp-server-DGzme0YX.js";import h from"node:path";import g from"node:fs";import{spawn as _}from"node:child_process";import{randomUUID as v}from"node:crypto";function y(e){return h.join(e,`sidecar.json`)}function b(t){return e(y(t))??{sessionId:null,declineStreak:0}}async function x(e){let t=h.join(e,`sidecar.lock`),n=Date.now()+12e4;for(;;)try{return g.mkdirSync(t),()=>{try{g.rmdirSync(t)}catch{}}}catch{try{if(Date.now()-g.statSync(t).mtimeMs>9e4){g.rmdirSync(t);continue}}catch{continue}if(Date.now()>n)throw Error(`sidecar lock wait timed out`);await new Promise(e=>setTimeout(e,250))}}function S(e,t,n,r){return[`-p`,r,`--output-format`,`json`,`--model`,`sonnet`,`--effort`,`low`,`--strict-mcp-config`,`--no-chrome`,`--mcp-config`,`{"mcpServers":{}}`,`--settings`,`{"disableClaudeAiConnectors":true}`,n?`--resume`:`--session-id`,t,...i,`--add-dir`,e]}function C(e,t,n,r,i){let a=S(t,n,r,i);return new Promise((t,n)=>{let r=_(`claude`,a,{cwd:e,stdio:[`ignore`,`pipe`,`pipe`]}),i=``,o=``,s=setTimeout(()=>{r.kill(`SIGKILL`),n(Error(`sidecar call timed out`))},12e4);r.stdout.on(`data`,e=>i+=e),r.stderr.on(`data`,e=>o+=e),r.on(`error`,e=>{clearTimeout(s),n(e)}),r.on(`close`,e=>{if(clearTimeout(s),e!==0){n(Error(`sidecar claude exited ${e}: ${o.trim().slice(0,200)}`));return}try{let e=JSON.parse(i);if(e.is_error){n(Error(`sidecar turn errored: ${String(e.result??``).slice(0,200)}`));return}t(String(e.result??``))}catch{n(Error(`sidecar returned unparseable output`))}})})}function w(e){let t=e.match(/\{[^{}]*"decision"[^{}]*\}/);if(!t)return null;try{let e=JSON.parse(t[0]);if(e.decision===`accept`||e.decision===`decline`||e.decision===`escalate`)return{decision:e.decision,reason:String(e.reason??``)}}catch{}return null}async function T(e,t,r){let i=null;try{i=await x(t);let a=b(t);if(a.declineStreak>=3)return{decision:`escalate`,reason:`sidecar decline streak; needs human review`};if(!a.sessionId){let i=v();await C(e,t,i,!1,`You are the approval reviewer for a "coder" background coding task. The task runs inside an OS sandbox; you review only actions that escape it.
|
|
2
2
|
|
|
3
3
|
Rules:
|
|
4
4
|
- git stays read-only: decline any git write (commit/push/checkout/reset/...).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./cli-
|
|
1
|
+
import{i as e,t}from"./cli-IfrPgeYz.js";import{p as n,s as r}from"./output-BKeyLbvt.js";import{n as i,o as a,s as o,t as s}from"./args-DEMOfLz2.js";import c from"node:process";import*as l from"zod/mini";const u=e({name:`runner serve`,help:{usage:`coder runner serve --url <public url> [--token <token>] [--runner-url <url>] [--port <n>] [--name <name>] [--workspace] [--server [url]] [--json]`,summary:`Run tasks on this machine with its own claude and codex logins. Expose the port with any tunnel (cloudflared, ngrok, Tailscale Funnel or a public VS Code port) and pass the tunnel's URL; each start registers the current URL, so a changing tunnel URL is fine. Choose a default with coder runner default. Tasks use their named runner, the agent setting, your default, the workspace default, then the server default.`,flags:[[`--url <public url>`,`the HTTPS address the server reaches this runner at`],[`--token <token>`,`one-use pairing token, --url is the Coder server`],[`--runner-url <url>`,`public tunnel address when pairing, or CODER_RUNNER_URL`],[`--port <n>`,`local port the tunnel forwards to (default 4100)`],[`--name <name>`,`shown in the dashboard (default: this machine's hostname)`],[`--workspace`,`run every member's tasks, not only yours (owners and admins)`],t],examples:[[`cloudflared tunnel --url http://localhost:4100`,`expose the port in one terminal`],[`coder runner serve --url https://abc.trycloudflare.com`,`then serve through it`]]},options:{...s,port:l.optional(l.coerce.number().check(l.int(),l.positive())),url:o,name:o,token:o,"runner-url":o,workspace:i,server:a,yes:i},async run({options:e}){let{serveRunner:t}=await import(`./serve-xMihn4g-.js`).then(e=>e.n),n=await t({...e,runnerUrl:e[`runner-url`]}),r=()=>void n.close().finally(()=>c.exit(0));return c.once(`SIGINT`,r),c.once(`SIGTERM`,r),n},json:({server:e,close:t,...n})=>({ok:!0,...n}),print:e=>c.stdout.write(`Runner ${n.bold(e.name)} serves ${e.server} at ${n.cyan(e.config.url??``)} (${e.scope}), listening on localhost:${e.port}.\n${r([`Tasks run here with this machine's own claude and codex logins`,`Stop with Ctrl-C; the server marks the runner offline`],n,n.cyan)}\n`)});export{u as commandRunnerServe};
|