@wular/coder 0.5.0 → 0.5.2
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/{actions-CkMAM1Km.js → actions-C35tq9KH.js} +2 -2
- package/dist/{agent-Bi5nbUhA.js → agent-BZR4Eqdc.js} +1 -1
- package/dist/{app-server-BTpa5GBV.js → app-server-dnlLhhZb.js} +1 -1
- package/dist/{approvals-CRwkc9vB.js → approvals-C8XV7CK2.js} +1 -1
- package/dist/apps-CCqOsEZH.js +18 -0
- package/dist/async-BP5q3Une.js +3 -0
- package/dist/{auth-oCvlHitk.js → auth-CJOm9_Vh.js} +1 -1
- package/dist/builtin/coder/system.md +6 -3
- package/dist/{chat-4AiZEqKh.js → chat-BD2Fu3jU.js} +1 -1
- package/dist/cli.js +3 -3
- package/dist/{cmd-Cu3OquA_.js → cmd-BH1bmZGs.js} +34 -34
- package/dist/{config-D_RuO6gX.js → config-_32PHl9g.js} +1 -1
- package/dist/{connection-BXjn7gCC.js → connection-DNzNYpha.js} +1 -1
- package/dist/{connections-Cswv7r8Z.js → connections-B90TemYf.js} +1 -1
- package/dist/{context-CFrDYenS.js → context-DVGPu7f_.js} +1 -1
- package/dist/dash/standalone/server/build-index.json +1 -1
- package/dist/dash/standalone/server/manifest.json +1406 -1406
- package/dist/dash/standalone/server/modules-server-server-react-server/src/client/{index.54c45900f2153d34.js → index.a036e2c6ae93ec75.js} +3 -5
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/api/{load.252f972b42c690e2.js → load.3e1c235ecb89201a.js} +2 -2
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/create/[id]/{page.11efd0e175db9053.js → page.ff03c26886d248d2.js} +3 -3
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/account/{notify.59ae138dc182d7c3.js → notify.5b9c5a4ab975b01e.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/account/{page.e9386951cedea737.js → page.6e80433ca86c927d.js} +3 -3
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/account/{sign-out.713d3ec10951fde5.js → sign-out.e419e0eae59a1394.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/(list)/{agents-grid.f989d6f2d9ece6e4.js → agents-grid.53dc6597be8d6049.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/(list)/{page.0f88720e52db99a2.js → page.82a238c790c19a6c.js} +6 -6
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/(tabs)/{layout.8d2f0997462fc958.js → layout.4a5c6f90ebaccf6f.js} +7 -7
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/(tabs)/{page.bc93891522c8120d.js → page.ed696703c6fb5796.js} +7 -7
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/(tabs)/platforms/{page.cf5cf9afe38ab0e4.js → page.12dbb62edaa16b4f.js} +11 -11
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/(tabs)/platforms/{platform-actions.c44c7df7841719f2.js → platform-actions.1e7bb5f00112eeac.js} +3 -3
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/(tabs)/platforms/{platform-step.6e90cbfe308f28a0.js → platform-step.45adc3fb28e7d33b.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/(tabs)/settings/{agent-settings-form.61de585104c2be10.js → agent-settings-form.1693e7dc34f5b94a.js} +16 -17
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/(tabs)/settings/{page.4d06f759984a63b3.js → page.fbbcdf8fde222f1e.js} +8 -9
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/(tabs)/tasks/{loading.ea2925eab1d2e594.js → loading.099f0e549e964a5c.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/(tabs)/tasks/{page.fb069bf82b727d27.js → page.577e64210260faf2.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/(tabs)/usage/{page.0a472a0e269b8c01.js → page.2d10853615403293.js} +3 -3
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/(tabs)/{versions-list.7ef7dfd5d8f5de43.js → versions-list.e6088baf4de7f41e.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/edit/{loading.007326a04f05d46c.js → loading.f0dfaf4552b8cde1.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/edit/{page.a26aa7bc6ab655f0.js → page.9f09979ad3435fe3.js} +6 -6
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/platforms/[app]/{app-cards.361918fe58349aa1.js → app-cards.adaebe98ec9d32e8.js} +2 -2
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/[slug]/platforms/[app]/{page.3f60cf67517d0d31.js → page.e2dc60bbcac65b1f.js} +3 -3
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/agent/{agent-toggle.ffbf9a8b8b2fbde7.js → agent-toggle.d795b7112534872c.js} +2 -2
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/agent/{hero.0ae015a4fbe6321e.js → hero.b74c6eb40c45b498.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/editor/{connect-repositories.9abe365f0098d358.js → connect-repositories.e27bcba279f82d7b.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/editor/{editor.6548f8f757578f90.js → editor.288736c2a52c7df4.js} +8 -8
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/editor/{import-picker.577b1d84c7ab84e1.js → import-picker.58bad50dd8e60d63.js} +3 -3
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/agents/new/{page.2b326d00ccef5544.js → page.83a490948f585e69.js} +4 -4
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/{layout.45a09107b19f0a7e.js → layout.61ad05aceb425910.js} +3 -3
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/operator/{operator-apps.f8d679f2d06b0ebc.js → operator-apps.6f71999915848a2c.js} +6 -6
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/operator/{page.5aa3ddc669366703.js → page.4758811b7fc86d84.js} +5 -5
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/{page.5a5188f0fc75dcd2.js → page.7de674df6cd0e824.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/settings/[tab]/{advanced-list.73cdadb2968a39d2.js → advanced-list.851275e04f8e7305.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/settings/[tab]/{connection-add.353ec01fbb814f78.js → connection-add.45a224c5e612b15f.js} +4 -4
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/settings/[tab]/{connections-list.cf4061ae909272c3.js → connections-list.6cacd41c18de261d.js} +5 -5
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/settings/[tab]/{credentials-list.fc4cff0289267551.js → credentials-list.79a1355d894b8642.js} +4 -4
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/settings/[tab]/{credentials.db01de2581ac65f3.js → credentials.30db114aef2c6ff6.js} +8 -8
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/settings/[tab]/{list.e7d6a422f6a869ea.js → list.fa3b9eff6657bc57.js} +3 -3
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/settings/[tab]/{models-list.acb92b39cab1d11c.js → models-list.2a8f6a5679fc5c4d.js} +6 -6
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/settings/[tab]/{page.95fe939e36e5be55.js → page.7681780b48e2aa3e.js} +13 -13
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/settings/[tab]/{runners-list.5764eac3307d67cc.js → runners-list.e9834546550a3c2c.js} +6 -6
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/settings/[tab]/{secrets-list.d316bb157f747f6c.js → secrets-list.ff9f3b3d88f2b8df.js} +4 -4
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/settings/{layout.4eb70f2de8674f93.js → layout.3f8a61434ceaa186.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/settings/{model-options.dc630cb6e2cbf83a.js → model-options.0d6077fe68db3af9.js} +2 -5
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/settings/{model-pick.a143e77f5ed5f9d3.js → model-pick.695538b2edf9dd15.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/settings/{page.70cad0e981c33fa5.js → page.e439da4bae9d6d6c.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/setup/{create-link.18bd2b92cd23b73f.js → create-link.371225925a83e900.js} +3 -3
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/setup/{outcome-toast.95f7be49430248eb.js → outcome-toast.c7d02e38464dec0b.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/setup/{page.e39ee9236664d043.js → page.885e5ae7913d8f5b.js} +4 -4
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/tasks/[id]/{activity.441e82ab00344fb2.js → activity.f8d48c80747830ee.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/tasks/[id]/{page.24e121ea6eb578ba.js → page.70ce5ef3bcf56310.js} +6 -6
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/tasks/[id]/{task-actions.4a4052a38db4bad3.js → task-actions.783070d7dbd198e4.js} +4 -4
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/tasks/[id]/{task-view.0cd3ec2655f44cc7.js → task-view.db256c7f111b8f23.js} +22 -57
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/tasks/{composer-data.73225456d60d63e3.js → composer-data.c16854be11a561e4.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/tasks/{composer.ee326fbf5e526fb1.js → composer.6a331de70f3baff4.js} +24 -82
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/tasks/list/{pending-approvals.7607998094780fdd.js → pending-approvals.7ff2eadf13a3ee90.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/tasks/list/{tasks-list.e486cbd16ea3e963.js → tasks-list.57c90c66384141a0.js} +8 -8
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/tasks/list/{tasks-section.01510523d1556d59.js → tasks-section.22e4f86847e1a3e2.js} +4 -4
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/tasks/{page.ede64f82388f9480.js → page.c6b9db3ca88aaa1f.js} +3 -3
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/usage/{page.0499098badd3f5f8.js → page.743fe359f09f5648.js} +2 -2
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/comps/frame/{stream.e3800e736f832124.js → stream.c7ffa724145ce870.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/comps/frame/{task-toasts.3b7eeee29fc327de.js → task-toasts.b0ba5a1b4976ae27.js} +47 -20
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/utils/{action.f22057e7dfac40fe.js → action.44115286faf6c0f8.js} +1 -1
- package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/utils/{client.c8d7efefb6194d7d.js → client.b9225923da59febe.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{advanced-list-850a950afe4f6996.js → advanced-list-4a393f37c461986f.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{agent-pills-9f6fa120182db948.js → agent-pills-f07bea43753a9342.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/agent-settings-form-6c1b6776328cd046.js +1 -0
- package/dist/dash/standalone/static/assets/chunks/{agent-toggle-521136f20a71400d.js → agent-toggle-dabbca2fe4006852.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{agents-grid-bcd13cd7a46224a6.js → agents-grid-a9440caa1768bfd8.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{back-2d67134b122334f4.js → back-8ca96656264a0d1c.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{chain-hint-53675e299a865420.js → chain-hint-c7994aad798ef430.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{combo-cb2c62fe580a8903.js → combo-7b125f3927083749.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/composer-3efd63e2e0192937.js +1 -0
- package/dist/dash/standalone/static/assets/chunks/composer-a6cf207b9c69b43f.js +1 -0
- package/dist/dash/standalone/static/assets/chunks/{composer-data-890f71bade4f0616.js → composer-data-b05f3d93fdc472d7.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{confirm-d6b2c5b1deccd1e8.js → confirm-6e26ab941d655b9f.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{connect-repositories-226bf70aa81c29d8.js → connect-repositories-90f1aedea6de7a99.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{connections-list-a33d6637e2d52fcf.js → connections-list-90935e956e8f4626.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{copy-294c6052b3b69424.js → copy-38fa78628f39ec10.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/create-link-a3c963721aa06a72.js +1 -0
- package/dist/dash/standalone/static/assets/chunks/{credentials-list-90fc1c6d202e1461.js → credentials-list-ae950b9891d30c29.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{custom-range-efa1b6a71ba84597.js → custom-range-e9185a23187b3fe6.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{editor-53a3e1a893644fff.js → editor-e0cc472111713852.js} +3 -3
- package/dist/dash/standalone/static/assets/chunks/{field-4d374d5ed3f43d7e.js → field-444bab2e16b91c26.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/instructions-7d9131eb37c4619e.js +1 -0
- package/dist/dash/standalone/static/assets/chunks/{instructions-d3dc01b2f90820db.js → instructions-9f173d4229d9b77e.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{list-16247e39898cd20e.js → list-84356c9286747b10.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/model-options-5e07b3318d69d218.js +1 -0
- package/dist/dash/standalone/static/assets/chunks/{models-list-6d93523660503dfb.js → models-list-eca9705ab89a2ce5.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/outcome-dialog-3006ae63624b3940.js +1 -0
- package/dist/dash/standalone/static/assets/chunks/{outcome-dialog-755fc581cbc2836e.js → outcome-dialog-c4d61a288688f53a.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/outcome-toast-ba59a3c06c25f0fd.js +1 -0
- package/dist/dash/standalone/static/assets/chunks/platform-actions-0c61a03082f9d169.js +1 -0
- package/dist/dash/standalone/static/assets/chunks/{platform-actions-08e9b3816dcd62b1.js → platform-actions-267a43c805e3c3a6.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{platform-step-5881a8be1e761e00.js → platform-step-adfc87c1fa86e7e1.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/platform-step-fd1616528b2f6f12.js +1 -0
- package/dist/dash/standalone/static/assets/chunks/{runners-list-dd759d408c643a29.js → runners-list-c858c5546c6fd513.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{runtime-9b28886f3cbe0ed3-1.js → runtime-3fcac605fffcc273-1.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{secrets-list-be1f634a1b077baa.js → secrets-list-06cd41b5a2627452.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{segmented-f646bfa8aa0aa449.js → segmented-15503e745dd97f56.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{shared-init-b42d2c06c25d1e2b.js → shared-init-02666a6f76606589.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/shared-init-3fcac605fffcc273-2.js +1 -0
- package/dist/dash/standalone/static/assets/chunks/shared-init-7a7f1e623f0f5861.js +9 -0
- package/dist/dash/standalone/static/assets/chunks/{shared-init-953965859f7bf6b9.js → shared-init-a69029db2d72fb52.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/side-toggle-800f7bacd6de5aa8.js +1 -0
- package/dist/dash/standalone/static/assets/chunks/{tail-d13c4cc0cf11ffd1.js → tail-3024b828bce41f94.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{task-423e6a3f2527f534.js → task-1e6f9ba22fb5e29f.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{task-actions-5917357eac6504ca.js → task-actions-c8fe1201a56901d9.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/task-view-531e243f8222f802.js +3 -0
- package/dist/dash/standalone/static/assets/chunks/{tasks-list-2c5ce592e00fda45.js → tasks-list-5373f9a2772a386a.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{versions-list-177ae397ad64dcea.js → versions-list-6642a24e9cef352b.js} +1 -1
- package/dist/dash/standalone/static/assets/chunks/{wular-pnext-9b28886f3cbe0ed3-0.js → wular-pnext-3fcac605fffcc273-0.js} +1 -1
- package/dist/dash/standalone/static/assets/{dash-param-org-agents-param-slug-00243b34eb094b95.css → dash-param-org-agents-param-slug-dd4ac319a0d62432.css} +1 -1
- package/dist/dash/standalone/static/assets/{dash-param-org-agents-param-slug-settings-9f8faa8f7d714699.css → dash-param-org-agents-param-slug-platforms-9d2e1439f3f7e81b.css} +1 -1
- package/dist/dash/standalone/static/assets/{dash-param-org-agents-param-slug-usage-0e037c66e3977f33.css → dash-param-org-agents-param-slug-settings-f21d4fcd3948139b.css} +1 -1
- package/dist/dash/standalone/static/assets/{dash-param-org-agents-param-slug-tasks-129adcdc293ceac8.css → dash-param-org-agents-param-slug-tasks-c8d6aa06f6e75f4c.css} +1 -1
- package/dist/dash/standalone/static/assets/dash-param-org-agents-param-slug-usage-9cc128ba8af6ef62.css +1 -0
- package/dist/dash/standalone/static/assets/{dash-param-org-tasks-8a44e171984d32a1.css → dash-param-org-tasks-be3cb3d64573f3d9.css} +1 -1
- package/dist/dash/standalone/static/assets/{dash-param-org-tasks-param-id-b9d3a7a1bd1dd666.css → dash-param-org-tasks-param-id-c20a0537bc82620d.css} +1 -1
- package/dist/dash/standalone/static/assets/pnext-client-02b9bb5ae78a37d6.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-063d14b5b5c893a3.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-1710a65c5b8280af.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-2936b44e963219bc.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-2f14cc4bf71bf456.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-2f81535a69d0c8a3.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-368d90341055d7ff.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-58e0efbceb6c595f.js +1 -0
- package/dist/dash/standalone/static/assets/{pnext-client-7ecbd7a0cbe4e231.js → pnext-client-5fc693a6184e48a4.js} +1 -1
- package/dist/dash/standalone/static/assets/pnext-client-6ee756a74310a9fe.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-713f7a6bc55d23fb.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-7c91f8543cd360fa.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-827b030f2c8e738e.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-8b165b7e5c14a1f3.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-95a81597ac1bdea0.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-a4c2fb8a94ccce04.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-a7faaaf8c4cc8145.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-bab8ffb68e7dd229.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-d9fab2611c2e7246.js +1 -0
- package/dist/dash/standalone/static/assets/pnext-client-f3804c9ffb299fe0.js +1 -0
- package/dist/{definition-4on4SG5J.js → definition-D0OpQfGX.js} +1 -1
- package/dist/{discover-DvzAbQvU.js → discover-BfYHHJN_.js} +1 -1
- package/dist/{dispatch-BaW2X6Sc.js → dispatch-BkoIU4GU.js} +2 -2
- package/dist/{docs-CbgaMPvq.js → docs-CxklYa3P.js} +1 -1
- package/dist/{drive-Tk6JvQK5.js → drive-MggMiKA0.js} +1 -1
- package/dist/env-BwFCHakK.js +1 -0
- package/dist/{exec-CAaYFJD1.js → exec-CNygM6yF.js} +2 -2
- package/dist/{executor-Chc0zawh.js → executor-Ds4wDCzV.js} +6 -6
- package/dist/flow/builtin/review/index.d.ts +2 -2
- package/dist/flow/builtin/review/index.js +10 -15
- package/dist/flow/index.d.ts +2 -2
- package/dist/flow/index.js +1 -1
- package/dist/{hook-COWDSO4a.js → hook-CVJU-ZD0.js} +1 -1
- package/dist/{index-ezhbF5wC.d.ts → index-CTAQrCRU.d.ts} +71 -66
- package/dist/integrations-DSZSa8Rc.js +9 -0
- package/dist/lib/broker.js +1 -1
- package/dist/{load-PqaDHiHX.js → load-BtIDghgd.js} +2 -2
- package/dist/{local-BzZuOwgI.js → local-CqOUpEtl.js} +1 -1
- package/dist/{local-BMGcCk8N.js → local-DFrTuJFN.js} +1 -1
- package/dist/{login-BDKTNynK.js → login-93jO9qjx.js} +1 -1
- package/dist/maintenance-BuDKnfc7.js +1 -0
- package/dist/{mcp-BNz_l5TV2.js → mcp-CTVOR7r6.js} +1 -1
- package/dist/{mcp-BGam3G_B.js → mcp-EwT2mCaa.js} +1 -1
- package/dist/{mcp-BGx48pyR.js → mcp-cEIva8Pd.js} +6 -4
- package/dist/{models-D1NXi6ni.js → models-mKyePWrV.js} +1 -1
- package/dist/{permission-BkYxjiFR.js → permission-F6F25GJU.js} +1 -1
- package/dist/post-DLenID75.js +11 -0
- package/dist/{refresh-yfEi5SQs.js → refresh-CWEpTAkD.js} +1 -1
- package/dist/{remote-rArUa01V.js → remote-BDMuKaON.js} +1 -1
- package/dist/remote-Cl-j8r3W.js +1 -0
- package/dist/{runner-DG9jrX5H.js → runner-DK0jnzPr.js} +1 -1
- package/dist/runner.json +1 -1
- package/dist/runner.tgz +0 -0
- package/dist/schema.js +1 -1
- package/dist/sdk.d.ts +49 -45
- package/dist/sdk.js +1 -1
- package/dist/serve-Cqlkgdfd.js +8 -0
- package/dist/{serve-B-5rDiZm.js → serve-DHe6dZM6.js} +1 -1
- package/dist/{session-Dtje9y-r.js → session-BMbMzzPu.js} +1 -1
- package/dist/{sessions-DIz9fyRN.js → sessions-BGUfSe8L.js} +1 -1
- package/dist/{shared--aE4olIO.js → shared-D-KqAi7b.js} +1 -1
- package/dist/{sign-in-wWkyaq5X.js → sign-in-Dv-rdYD4.js} +2 -2
- package/dist/{state-Br-Fuaxg.js → state-CxAUec80.js} +1 -1
- package/dist/store-BpDipcKB.js +349 -0
- package/dist/{task-CFt85vTy.js → task-BRHXn5y1.js} +1 -1
- package/dist/task-CzXNLREX.js +7 -0
- package/dist/{tool-search-BkdgVolu.js → tool-search-C9Ty3hhL.js} +1 -1
- package/dist/{tools-oQvFAnh5.js → tools-BCm26CeV.js} +1 -1
- package/dist/{tools-DNgEptor.js → tools-C69W1B6S.js} +1 -1
- package/dist/{tools-search-D1zArRyJ.js → tools-search-BDaeCoWe.js} +1 -1
- package/dist/{turn-Cc-v-eSy.js → turn-eI4iRPsq.js} +1 -1
- package/dist/{update-check-UyRob3yy.js → update-check-Bap3dwaj.js} +1 -1
- package/dist/{views-3TxH367C.js → views-Bxm_5J6T.js} +1 -1
- package/dist/worker-DGhRPDDt.js +7 -0
- package/dist/{worker-BMuKKiIa.js → worker-DHNBRRl-.js} +1 -1
- package/docs/agents/coder.md +1 -1
- package/docs/cli/index.md +5 -3
- package/docs/connections.md +1 -1
- package/docs/flows.md +1 -1
- package/docs/review.md +36 -8
- package/docs/self-host.md +2 -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/apps-B6mUToTa.js +0 -18
- package/dist/async-CNhQ4wyZ.js +0 -3
- package/dist/dash/standalone/static/assets/chunks/agent-settings-form-a8ee12513a02b1c5.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/composer-4a46a458495ce3ba.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/composer-92553de43276510b.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/create-link-b2480a7601967e94.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/instructions-734d21dfb8f6393e.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/model-options-d29e934a3de20ab4.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/outcome-dialog-77e13c848000a3dc.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/outcome-toast-9d5e9713c23882f5.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/platform-actions-832904f5694ef902.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/platform-step-29469fd4eaddc42a.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/shared-init-926144b364908b3c.js +0 -9
- package/dist/dash/standalone/static/assets/chunks/shared-init-9b28886f3cbe0ed3-2.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/side-toggle-8c21d39a1e284887.js +0 -1
- package/dist/dash/standalone/static/assets/chunks/task-view-c6ee43d2ddb6db90.js +0 -3
- package/dist/dash/standalone/static/assets/dash-param-org-agents-param-slug-platforms-25ae07e0b3f5b252.css +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-095026242a079175.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-1dfeb8c3ef155f87.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-2358423351524403.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-28a6557216627768.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-31a4ee73945fee19.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-3dfdc76bb8712b82.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-4355ac87961d78c1.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-43c7a0046572e0c9.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-53dc7db68d67e0b1.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-5835cb35488bdf7f.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-638b390bc23ab1ae.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-67f832c6c51a66cd.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-6fc99f0abe77c2ea.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-7d99965f28ac7604.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-8250bd3b86d038a3.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-bfd06805a43c6dee.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-ce2943f17e9d9ac3.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-ed31510d4615a5a5.js +0 -1
- package/dist/dash/standalone/static/assets/pnext-client-f0496bf51e161ddd.js +0 -1
- package/dist/env-_AxrvBXP.js +0 -1
- package/dist/integrations-BVmsk64f.js +0 -9
- package/dist/maintenance-d43Ml540.js +0 -1
- package/dist/remote-BbXx6S9P.js +0 -1
- package/dist/serve-CvnrGAj7.js +0 -12
- package/dist/store-CzQLgCzt.js +0 -352
- package/dist/task-N0qhnKpK.js +0 -7
- package/dist/worker-CIHY9L42.js +0 -7
- /package/dist/dash/standalone/server/modules-server-server-react-server/src/core/{types.5bf5a41cedb54154.js → types.9d22123d6296f5af.js} +0 -0
- /package/dist/dash/standalone/server/modules-server-server-react-server/src/server/dash/app/dash/[org]/tasks/[id]/{task-view.aae9fa481b9015d1.css.pnext-asset.js → task-view.440367ae07204ee7.css.pnext-asset.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{En as e,P as t,T as n,a as r,b as i,bn as a,c as o,d as s,da as c,f as l,h as u,i as d,j as f,k as p,l as m,n as h,o as g,p as _,r as v,s as y,t as b,u as x,ua as ee,v as S,va as te,x as ne}from"./args-CJsHYWbt.js";import{t as C}from"./errors-DK_trCff.js";import{S as re,_ as ie,a as w,b as ae,c as oe,d as se,f as T,g as E,h as D,l as ce,m as O,n as k,o as le,p as A,r as j,t as M,u as N,v as ue,x as de,y as P}from"./output-BKeyLbvt.js";import{a as fe,i as pe,n as me,o as he,r as ge}from"./prompt-CpwbsEWM.js";import{MODEL_HINT as _e,command as F,group as I,nextSteps as L,t as ve}from"./cli.js";import{M as ye,V as be,ft as xe,g as Se,i as R,mt as Ce,ot as z,p as we,ut as Te,vt as Ee}from"./state-
|
|
2
|
-
`);let n=A;H.stdout.write(E([{header:`id`,value:e=>e.id,paint:e=>n.cyan(e)},{header:`name`,value:e=>e.name},{header:`source`,value:e=>e.source,paint:e=>n.light(e)},...t?[{header:`version`,value:e=>String(e.version)}]:[],{header:`description`,value:e=>e.description??`-`}],e,n))}const We=F({name:`list`,description:`list local or server-owned agents`,usage:`Without --server, one row per built-in and workspace agent. With --server, list the agent records and current versions owned by that Coder server.`,access:`read`,args:o,run:async({options:e,cwd:t})=>{let{agents:n}=await import(`./agent-
|
|
1
|
+
import{En as e,P as t,T as n,a as r,b as i,bn as a,c as o,d as s,da as c,f as l,h as u,i as d,j as f,k as p,l as m,n as h,o as g,p as _,r as v,s as y,t as b,u as x,ua as ee,v as S,va as te,x as ne}from"./args-CJsHYWbt.js";import{t as C}from"./errors-DK_trCff.js";import{S as re,_ as ie,a as w,b as ae,c as oe,d as se,f as T,g as E,h as D,l as ce,m as O,n as k,o as le,p as A,r as j,t as M,u as N,v as ue,x as de,y as P}from"./output-BKeyLbvt.js";import{a as fe,i as pe,n as me,o as he,r as ge}from"./prompt-CpwbsEWM.js";import{MODEL_HINT as _e,command as F,group as I,nextSteps as L,t as ve}from"./cli.js";import{M as ye,V as be,ft as xe,g as Se,i as R,mt as Ce,ot as z,p as we,ut as Te,vt as Ee}from"./state-CxAUec80.js";import{c as De}from"./session-BMbMzzPu.js";import{a as B}from"./approvals-C8XV7CK2.js";import V from"node:path";import H from"node:process";import Oe from"node:fs";import ke from"node:os";function Ae(e){let t=A;H.stdout.write(E([{header:`id`,value:e=>e.id,paint:e=>t.cyan(e)},{header:`description`,value:e=>e.description},{header:`events`,value:e=>e.events.join(`, `)},{header:`tools`,value:e=>e.tools.join(`, `)}],e,{style:t,border:!0}))}const je=F({name:`list`,description:`list integrations with their events and tools`,usage:"One row per integration: its id, the events an agent can wire, and every tool it offers; `show` splits the tools by preset.",access:`read`,globalFlags:{cwd:!1},run:async()=>{let{agents:e}=await import(`./agent-BZR4Eqdc.js`).then(e=>e.t);return e.integrations.list()},next:()=>L([`Event descriptions and the tools each preset allows: coder agent integrations show <id>`]),print:Ae});function Me(e){let t=A,n=[...Object.entries(e.events).map(([e,t])=>({kind:`event`,name:e,does:t})),...Object.entries(e.tools).map(([e])=>({kind:`tools`,name:e===`read-only`?`Read-only`:`Auto`,does:e===`read-only`?`Platform tools marked read-only`:`All platform tools`}))];H.stdout.write(E([{header:`kind`,value:e=>e.kind,paint:e=>t.light(e)},{header:`name`,value:e=>e.name},{header:`does`,value:e=>e.does}],n,t))}const Ne=F({name:`show`,description:`events and tools of one integration`,usage:`Describe one integration: each event with what triggers it, and the tools each access (read-only, auto) allows.`,access:`read`,args:{id:x(`the integration`)},globalFlags:{cwd:!1},cli:{positional:[`id`],examples:[`coder agent integrations show github # the GitHub integration in full`]},run:async({args:[e]})=>{let{agents:t}=await import(`./agent-BZR4Eqdc.js`).then(e=>e.t);return t.integrations.show(e)},print:Me}),Pe=I({name:`integrations`,description:`the integration catalog: events and tool presets`,usage:`The platforms an agent can listen to and act on: their events and tool presets.`,commands:[je,Ne],aliases:{ls:`list`}}),U=e=>(e??``).split(`,`).map(e=>e.trim()).filter(Boolean);function Fe(e){return Object.fromEntries(U(e).map(e=>{let t=e.indexOf(`=`);if(t<1)throw new C(`invalid-option`,`Bad --match "${e}"; use event=regex.`);let n=e.slice(t+1);if(y(n))throw new C(`invalid-option`,`Bad --match for ${e.slice(0,t)}: ${y(n)}`);return[e.slice(0,t),n]}))}const Ie={auto:`Auto`,"read-only":`Read-only`};function Le(e,t){let n=A;H.stdout.write(`Created ${n.cyan(t)}.\n`)}function Re(e,t){let{id:n,samples:r,integrations:i}=e,a=V.relative(t,e.dir),o=L(i.length?[`1. Write ${a}/system.md. Try it with no server: coder task run --agent ${n} "<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 (${i.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 ${n} ${r[0]??`<event.json>`} --server <url>`,`[Read the agent guide](https://github.com/muzam1l/coder/blob/main/docs/agents/index.md)`,`Agents: coder docs agents`]:[`1. Write ${a}/system.md. Try it with no server: coder task run --agent ${n} "<task>"`,`2. Give the agent a platform under "integrations" in ${a}/agent.json, then run init again or follow the guide: coder agent integrations list`,`[Read the agent guide](https://github.com/muzam1l/coder/blob/main/docs/agents/index.md)`,`Agents: coder docs agents`]);return i.length&&(o[1].usage=`coder dash`),o}async function ze(e){let{INTEGRATIONS:t}=await import(`./integrations-DSZSa8Rc.js`).then(e=>e.r),n=A;H.stdout.write(`Creating ${n.cyan(`.coder/agents/${e}`)}. Pick what the agent listens to and what it may do; flags skip these questions.\n\n`);let r=await fe({title:`Integrations`,hint:`Platforms the agent listens to and acts on. Add or remove them later in agent.json.`,multi:!0,selected:[Object.keys(t)[0]],options:Object.values(t).map(e=>({value:e.id,hint:e.description}))}),i={},a={};for(let e of r){let n=t[e],r=Object.keys(n.events),o=await he({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.filter(e=>!n.events[e].noisy),options:Object.entries(n.events).map(([e,t])=>({value:e,hint:t.description,...t.noisy?{input:{label:`match`,value:`^help\\b`,placeholder:`tab to add a match`,validate:y}}:{}}))});i[e]=o.values,a[e]=o.inputs}let[o]=await fe({title:`Access`,hint:`What every task of the agent may do; Auto lets the engine review what leaves the sandbox, Read-only allows only reads and read-only tools.`,selected:[`auto`],options:Object.keys(Ie).map(e=>({value:e,label:Ie[e]}))}),s=await me(`Display name`,e,void 0,`Shown in replies and app names.`);return{...s===e?{}:{name:s},integrations:r,events:i,matches:a,access:o}}const Be=F({name:`init`,description:`scaffold an agent folder in .coder/agents`,usage:"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 access when run in a terminal without them.",access:`write`,approvalPolicy:{handoff:{page:`/agents/new`,label:`Create agent`,action:`create`,args:[`id`,`name`,`description`,`integrations`,`events`,`access`,`match`],button:`Create agent`}},args:{id:x(`the agent id: its folder under .coder/agents`),integrations:x(`platforms the agent listens to (see coder agent integrations list)`,`<a,b>`),events:x(`events that start tasks, applied to each integration that has them (default: mention)`,`<a,b>`),access:x(`read-only or auto, for its tasks, platforms and connections (default: auto)`,`<read-only|auto>`),name:x(`display name used in replies (default: the id)`,`<text>`),description:x(`one line for agent list`,`<text>`),match:x(`start tasks only for event text matching a regex, as event=regex pairs`,`<a=re,b=re>`),yes:v(`skip the questions and take the defaults`)},cli:{positional:[`id`],examples:[`coder agent init # answer the questions, id included`,`coder agent init triage --integrations github --events issue,mention --access read-only # no questions`]},run:async({options:e,args:[t],cwd:n,tool:r})=>{let{agents:i}=await import(`./agent-BZR4Eqdc.js`).then(e=>e.t),a=!r&&ge()&&!e.yes;return i.init(t,{name:e.name,description:e.description,access:e.access,integrations:U(e.integrations),events:U(e.events),matches:Fe(e.match),cwd:n,...a?{askId:e=>me(`Agent id`,``,e,`Folder name under .coder/agents and the name used in commands.`)}:{},...a&&!e.integrations?{askPicks:ze}:{}})},json:(e,{cwd:t})=>({id:e.id,dir:V.relative(t,e.dir),files:e.files,samples:e.samples}),next:({result:e,args:t})=>Re(e,t.cwd?V.resolve(t.cwd):H.cwd()),print:(e,{cwd:t})=>Le(e,V.relative(t,e.dir))}),Ve=e=>`builtin`in e,He=e=>e.map(e=>Ve(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 Ue(e,t){if(!e.length)return void H.stdout.write(`No agents configured.
|
|
2
|
+
`);let n=A;H.stdout.write(E([{header:`id`,value:e=>e.id,paint:e=>n.cyan(e)},{header:`name`,value:e=>e.name},{header:`source`,value:e=>e.source,paint:e=>n.light(e)},...t?[{header:`version`,value:e=>String(e.version)}]:[],{header:`description`,value:e=>e.description??`-`}],e,n))}const We=F({name:`list`,description:`list local or server-owned agents`,usage:`Without --server, one row per built-in and workspace agent. With --server, list the agent records and current versions owned by that Coder server.`,access:`read`,args:o,run:async({options:e,cwd:t})=>{let{agents:n}=await import(`./agent-BZR4Eqdc.js`).then(e=>e.t);return n.list({...e,cwd:t,organization:e.workspace})},json:e=>He(e),next:({result:e,args:t})=>t.server!==void 0||!e.length?[]:L([`An agent's settings, events, and tools: coder agent show <id>`,`Scaffold a new agent in this repo: coder agent init <id>`]),print:(e,{options:t})=>Ue(He(e),t.server!==void 0)}),Ge=F({name:`push`,description:`upload workspace agents to a Coder server`,usage:`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.`,access:`write`,approvalPolicy:`deny`,args:{id:x(`the agent (default: every workspace agent)`),...o},cli:{positional:[`id`],examples:[`coder agent push helper # upload helper`]},run:async({options:e,args:[t],cwd:n})=>{let{agents:r}=await import(`./agent-BZR4Eqdc.js`).then(e=>e.t);return r.push(t,{...e,cwd:n,organization:e.workspace})},print:e=>{for(let t of e){H.stdout.write(t.unchanged?`Pushed ${A.bold(t.id)} unchanged (version ${t.version})\n`:`Pushed ${A.bold(t.id)} as version ${t.version}\n`);for(let e of t.apps??[])e.error?H.stderr.write(`${e.error}\n`):e.drift&&H.stderr.write(`${e.name} needs changes on ${e.integration}; open it on the agent's Platforms tab and click Update.\n`)}}});function W(e,t,n,r=A){let i=e?.error?.message??t;return e?.finalMessage||(i?`${r.red(`error:`)} ${i}`:n)}const Ke=1e3;function qe(e,t=A,{truncate:n=!0}={}){let r=e=>e.split(`
|
|
3
3
|
`).map(e=>` ${t.dim(e)}`);return!n||e.length<=Ke?[t.dim(`prompt:`),...r(e)]:[t.dim(`prompt:`),...r(e.slice(0,500).trimEnd()),t.light(` … <${e.length-Ke} chars trimmed> …`),...r(e.slice(-500).trimStart())]}function Je(e,t=A){let n=[];e.access&&n.push([`access`,e.access]),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 Ye(e){return e.createdAt&&e.completedAt?Date.parse(e.completedAt)-Date.parse(e.createdAt):null}function Xe(e,t){if(t)return e.createdAt?`started ${w(R(e.createdAt))} ago`:``;let n=Ye(e);return[e.completedAt?`finished ${w(R(e.completedAt))} ago`:``,n!==null&&n>=0?`took ${w(n)}`:``].filter(Boolean).join(` · `)}function Ze(e,{status:t,tokens:n,tokenModel:r,live:i=!1,style:a=A}){let o=Xe(e,z.includes(e.status)||t===`waiting-approval`),s=e=>a.dim(e.padEnd(8));return[`${s(`task`)} ${a.cyan(e.id)}`,...e.name?[`${s(`name`)} ${e.name}`]:[],`${s(`status`)} ${O(t)}${o?` ${a.dim(`(${o})`)}`:``}`,`${s(`engine`)} ${Se(e)}`,...Je(e,a),...n?[`${s(`tokens`)} ${i?se(n):N(n,r??e.model)}${i?a.dim(` (so far)`):``}`]:[]]}function Qe(e,{tokens:t,tokenModel:n,statusChanged:r=!0,style:i=A}){let a=e=>i.dim(e.padEnd(8)),o=Ye(e);return[...r?[`${a(`status`)} ${O(e.status)}${o!==null&&o>=0?` ${i.dim(`(took ${w(o)})`)}`:``}`]:[],...t?[`${a(`tokens`)} ${N(t,n??e.model)}`]:[]]}function G(e,t=300,{plain:n=!1,style:r=A}={}){if(e.length<=t)return e;let i=`<${e.length-t} more chars>`;return`${e.slice(0,t)} ${n?i:r.dim(i)}`}const K=` `.repeat(8),$e={assistant:`●`,reasoning:`✻`,tool:`→`,"tool-result":` `,usage:`·`,status:`·`,info:`·`,error:`✘`,steer:`⚑`};function et(e,t){let n=/^\x1b\[[0-9;]*m/.exec(t(``))?.[0];return t(n&&e.includes(q)?e.split(q).join(`${q}${n}`):e)}const q=`\x1B[0m`;function J(e,t,n,r,i=r.dim){if(!e)return``;let a=(e.length>t?e.slice(0,t):e).split(`
|
|
4
4
|
`).map(e=>et(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(`
|
|
5
5
|
`):a.join(`
|
|
@@ -21,7 +21,7 @@ JSON and MCP return a summary and the complete answer, without engine diagnostic
|
|
|
21
21
|
or raw diffs. Use --tail for progress; answers are never truncated.
|
|
22
22
|
|
|
23
23
|
Run each --wait in its own background shell, one per task. Never wait on several
|
|
24
|
-
tasks in one call, or their approvals and answers never reach you one by one.`,access:`read`,args:{"task-id":x(`the task (default: the most recent)`),wait:v(`block until the task finishes or needs an approval, then print`),turns:v(`every turn's answer (a steered task accretes turns)`),tail:l(`include the last n progress-log steps (default: 0, final result only)`),...o},cli:{positional:[`task-id`],exit:[[0,`The task completed successfully.`],[1,`The task failed or was cancelled.`],[4,`An approval is pending; answer it, then run --wait again.`]],examples:[`coder result <task-id> --wait # block until the task finishes, print the answer`,`coder result <task-id> --turns # every turn's answer for a steered task`]},run:async({options:e,args:[t]})=>{let{tasks:n}=await import(`./task-
|
|
24
|
+
tasks in one call, or their approvals and answers never reach you one by one.`,access:`read`,args:{"task-id":x(`the task (default: the most recent)`),wait:v(`block until the task finishes or needs an approval, then print`),turns:v(`every turn's answer (a steered task accretes turns)`),tail:l(`include the last n progress-log steps (default: 0, final result only)`),...o},cli:{positional:[`task-id`],exit:[[0,`The task completed successfully.`],[1,`The task failed or was cancelled.`],[4,`An approval is pending; answer it, then run --wait again.`]],examples:[`coder result <task-id> --wait # block until the task finishes, print the answer`,`coder result <task-id> --turns # every turn's answer for a steered task`]},run:async({options:e,args:[t]})=>{let{tasks:n}=await import(`./task-BRHXn5y1.js`).then(e=>e.t);return await n.result(t,{...e,organization:e.workspace,onWaiting:e=>H.stderr.write(`${A.dim(`[coder] waiting for task ${e} to finish...`)}\n`)})},json:(e,{options:t})=>rt(e,t),next:({result:e,args:t})=>ot(e,t),print:(e,{options:t,cwd:n,next:r})=>it(e,n,t,r),exit:(e,{options:t})=>t.wait?e.task.status===`completed`?0:1:void 0});function ot(e,t){let{task:n}=e,r=m(t),i=(e.pendingApprovals??[]).map(e=>({usage:`coder task approve ${n.id} ${e.id}${r}`,blurb:`(--deny to reject)`,cli:{layout:`inline`,prefix:` `,slot:`approval:${e.id}`}}));return!t.turns&&e.result&&(e.turns?.length??0)>1&&i.push(...L([`Turn ${e.turns.length} of ${e.turns.length}. All answers are in coder task result ${n.id} --turns.`],{layout:`plain`,dim:!0,prefix:``,slot:`turns`}).map(e=>({...e,usage:`coder task result ${n.id} --turns${r}`}))),z.includes(n.status)?t.wait?i:[...i,Y(n.id,t,`Wait in its own background shell, one per task; do not poll: coder task result ${n.id} --wait`),...L([`Follow live: coder task watch ${n.id}${r}`,...e.stalled?[`Check the transcript: coder task result ${n.id} --tail all${r}`]:[]])]:[...i,...X(n.id,t)]}function st(e,t){let n=e.level===`sys`?t.dim(`· ${e.line}`):e.level===`err`?t.light(e.line):e.line;H.stdout.write(`${n}\n`)}async function ct(e,t,n,r){let i=n.trim===void 0?500:n.trim===`none`?1/0:n.trim,a=e.task,o=await tt.create({cwd:a.cwd??t,startedAt:Date.parse(a.createdAt??``)||void 0,trim:i,explicitTrim:n.trim!==void 0,width:P()});if(!n.json){let e=[...Ze(a,{status:a.status}),...z.includes(a.status)?[A.dim(`Watching. Press Ctrl-C to stop.`)]:[],...a.prompt?qe(a.prompt,A,{truncate:!1}):[],``];H.stdout.write(`${e.join(`
|
|
25
25
|
`)}\n`)}let s=null,c=null,l=e=>{let t=o.render(e);t.length&&H.stdout.write(`${t.join(`
|
|
26
26
|
`)}\n`)};for await(let t of e.events){let e=t;if(e.kind===`usage`&&e.tokens&&(s=e.tokens),n.json){let t=e.kind===`steer`?1/0:i,n=e.message?{...e,message:G(e.message,t,{plain:!0})}:e;H.stdout.write(`${JSON.stringify(n)}\n`);continue}e.kind!==`usage`&&(c&&=(l(c),null),e.kind===`assistant`?c=e:l(e))}let{status:u,result:d,task:f}=await e.final();if(n.json)H.stdout.write(`${JSON.stringify({taskId:a.id,status:u,result:d},null,2)}\n`);else{let e=u===`completed`?`(no final message)`:`(task ${u})`,t=Qe(f,{tokens:d?.tokens??s,tokenModel:d?.model,statusChanged:u!==a.status});t.length&&H.stderr.write(`\n${t.join(`
|
|
27
27
|
`)}\n`);let n=W(d,f.error,e),r=c?String(c.message??``):``;H.stdout.write(`\n${n.trim()?n:r}\n`)}H.exit(u===`completed`?0:1)}async function lt(e,t,n){let r=[];for await(let t of e.events)r.push(t);let{task:i}=e,a=n===void 0?``:n===!0?` --server`:` --server ${n}`;return{taskId:i.id,status:i.status,events:r,...z.includes(i.status)?{next:`coder task watch ${i.id} --from ${t+r.length}${a}`}:{}}}async function ut(e,t){let n=await tt.create({cwd:t,trim:500,explicitTrim:!1,width:P()});for(let t of e.events){let e=n.render(t);e.length&&H.stdout.write(`${e.join(`
|
|
@@ -32,68 +32,68 @@ Blocks until it finishes; exits 0 on success, 1 otherwise. For the answer
|
|
|
32
32
|
alone, prefer \`coder result\`. Alias: stream.
|
|
33
33
|
|
|
34
34
|
With --from <n>, or as a tool, it returns the log from event n on without
|
|
35
|
-
following, and \`next\`: the command that continues it while the task runs.`,access:`read`,approvalPolicy:`deny`,args:{"task-id":x(`the task (default: the most recent)`),tail:l(`replay the last n log lines first (default: 1)`),trim:b(n(t([ne(`none`),_().check(i(),e())],{error:`expected a positive integer or "none"`})),`budget for tool output and thinking (default: 1200 chars, 12 lines)`,`<n|none>`),from:b(n(_().check(i(),a())),`return the log from event n on instead of following it`,`<n>`),...o},cli:{positional:[`task-id`],examples:[`coder task watch # follow the most recent task to completion`,`coder task watch <task-id> --from 0 --json # the log so far, and the command that continues it`]},async run({options:e,args:[t],cwd:n,tool:r,next:i}){let{tasks:a}=await import(`./task-
|
|
35
|
+
following, and \`next\`: the command that continues it while the task runs.`,access:`read`,approvalPolicy:`deny`,args:{"task-id":x(`the task (default: the most recent)`),tail:l(`replay the last n log lines first (default: 1)`),trim:b(n(t([ne(`none`),_().check(i(),e())],{error:`expected a positive integer or "none"`})),`budget for tool output and thinking (default: 1200 chars, 12 lines)`,`<n|none>`),from:b(n(_().check(i(),a())),`return the log from event n on instead of following it`,`<n>`),...o},cli:{positional:[`task-id`],examples:[`coder task watch # follow the most recent task to completion`,`coder task watch <task-id> --from 0 --json # the log so far, and the command that continues it`]},async run({options:e,args:[t],cwd:n,tool:r,next:i}){let{tasks:a}=await import(`./task-BRHXn5y1.js`).then(e=>e.t),o=e.from??(r?0:void 0),s=await a.watch(t,{...e,from:o,organization:e.workspace});if(o!==void 0)return lt(s,o,e.server);await ct(s,n,e,i)},next({result:e,args:t}){return e&&e.next?L([`Continue: ${e.next}`]):[]},print:(e,{cwd:t})=>e&&ut(e,t)});function ft(e,{finalMessage:t,error:n}){let r=A,i=e.startedAt===void 0?``:w((e.finishedAt??Date.now())-e.startedAt);H.stdout.write(`${r.bold(e.task.id)} ${O(e.status)}${n?` ${r.red(n)}`:``}${i?` ${r.dim(`took ${i}`)}`:``}\n`),e.credential&&H.stdout.write(`${r.dim(`credential`)} ${e.credential}\n`),t&&H.stdout.write(`\n${r.bold(`Reply`)}\n${t.trim()}\n`)}const pt=F({name:`run`,description:`run a recorded event through an agent, offline or on a server`,usage:`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.`,access:`write`,approvalPolicy:`deny`,args:{agent:x(`the agent id`),file:x(`the event JSON file`),server:g(`act on your Coder server`,`[url]`),workspace:x(`with --server: the workspace to act in (default: the saved one)`,`<slug>`),yes:v(`with --server: connect to a server used for the first time without asking`),wait:v(`with --server: follow the task log here until it finishes, then print the reply`),task:x(`a runner's form: run that server task here`,`<id>`)},cli:{positional:[`agent`,`file`],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`]},run:async({options:e,args:[t,n],cwd:r,tool:i,next:a})=>{if(e.task)return(await import(`./runner-DK0jnzPr.js`).then(e=>e.t)).runAssignedTask(e.task,r);let{agents:o}=await import(`./agent-BZR4Eqdc.js`).then(e=>e.t),{remoteAnswer:s}=await import(`./remote-BDMuKaON.js`).then(e=>e.s),c=await o.run(t,n,{...e,cwd:r,organization:e.workspace,...e.json||i?{}:{onLog:e=>st(e,A),onDone:e=>{ft(e,s(e)),a(e)}}});return Array.isArray(c)?c.map(s):c},json:e=>Array.isArray(e)&&e.length===1?e[0]:e,next({result:e,args:t}){if(t.task)return[];let n=e;if(Array.isArray(n))return t.wait?n.flatMap(e=>[`completed`,`failed`,`cancelled`].includes(e.status)?X(e.taskId,t).map(e=>({...e,cli:{...e.cli,hidden:!0}})):[]):[];if(`attempts`in n){let e=n;return[`completed`,`failed`,`cancelled`].includes(e.status)?X(e.task.id,t):[]}return`tasks`in n&&n.tasks.length?L([`Watch it: coder task watch ${n.tasks[0]} --server ${De(t.server)}`]):[]},print(e,{options:t}){let n=e;if(!(t.task||Array.isArray(n))){if(`tasks`in n){if(!n.tasks.length)return void H.stdout.write(`The server accepted the event but no agent matched it.
|
|
36
36
|
`);H.stdout.write(`${A.bold(`Queued on the server`)} as task ${n.tasks.join(`, `)}.\n`);return}n.reply===void 0?n.result!==void 0&&H.stdout.write(`${JSON.stringify(n.result,null,2)}\n`):H.stdout.write(`${n.reply.trim()}\n`)}}}),mt=F({name:`settings`,description:`change an agent's settings on your Coder server`,usage:`Set the model, access, connections or events of an agent in the
|
|
37
37
|
saved workspace, or publish its next version with new instructions or matches.
|
|
38
|
-
Settings you leave out stay as they are.`,access:`write`,approvalPolicy:`ask`,args:{id:x(`the agent`),model:r(),access:x(`read-only or auto, at most its definition`,`<read-only|auto>`),connections:x(`the connections its tasks may use, by id`,`<a,b>`),events:x(`the events it answers on a platform`,`<platform=a,b>`),instructions:x(`its system prompt, published as its next version`,`<text>`),match:x(`start tasks only for event text matching a regex, as event=regex pairs`,`<a=re,b=re>`),...h},globalFlags:{cwd:!1},cli:{positional:[`id`],examples:[`coder agent settings helper --model sonnet # a cheaper model for a simple agent`]},run:async({options:{connections:e,events:t,match:n,...r},args:[i]})=>{let{agents:a}=await import(`./agent-
|
|
38
|
+
Settings you leave out stay as they are.`,access:`write`,approvalPolicy:`ask`,args:{id:x(`the agent`),model:r(),access:x(`read-only or auto, at most its definition`,`<read-only|auto>`),connections:x(`the connections its tasks may use, by id`,`<a,b>`),events:x(`the events it answers on a platform`,`<platform=a,b>`),instructions:x(`its system prompt, published as its next version`,`<text>`),match:x(`start tasks only for event text matching a regex, as event=regex pairs`,`<a=re,b=re>`),...h},globalFlags:{cwd:!1},cli:{positional:[`id`],examples:[`coder agent settings helper --model sonnet # a cheaper model for a simple agent`]},run:async({options:{connections:e,events:t,match:n,...r},args:[i]})=>{let{agents:a}=await import(`./agent-BZR4Eqdc.js`).then(e=>e.t),[o,s]=t?.split(`=`)??[];return a.settings(i,{...r,...e===void 0?{}:{connections:U(e)},...o&&s!==void 0?{events:{[o]:U(s)}}:{},matches:Fe(n)})},print:e=>{let{engine:t,model:n,effort:r}=e.settings??{};H.stdout.write(`Agent ${A.cyan(e.id)} runs on ${[t,n,r].filter(Boolean).join(`/`)||`its defaults`}.\n`)}});function ht(e,t){return Ve(e)?{id:e.id,name:e.name,source:e.builtin?`builtin`:`repo`,...e.dir&&!e.builtin?{dir:V.relative(t,e.dir)}:{},definition:e.definition,...e.usage?{usage:e.usage}:{}}:{id:e.id,name:e.name,source:e.source,definition:e.definition,...e.settings?{usage:e.settings}:{},...e.installations?{installations:e.installations}:{}}}function gt(e){let t=A,{definition:n,usage:r}=e,i=`dir`in e?e.dir:void 0,a=[[`name`,e.name],[`source`,i?`${e.source} (${i})`:e.source],[`description`,n.description],[`access`,r?.access===`read-only`||n.access===`read-only`?`Read-only`:`Auto`],[`model`,r?.engine||r?.model?[r.engine,r.model,r.effort].filter(Boolean).join(`/`):n.model]],o=Math.max(...a.map(([e])=>e.length))+2;for(let[e,n]of a)n&&H.stdout.write(`${t.dim(e.padEnd(o))}${n}\n`);let s=Object.entries(n.integrations).map(([e,t])=>{let n=r?.integrations?.[e],i=Array.isArray(t.events)?t.events:Object.keys(t.events??{});return{id:e,events:(n?.allowedEvents?i.filter(e=>n.allowedEvents.includes(e)):i).join(`, `)||`-`}});H.stdout.write(`\n${E([{header:`integration`,value:e=>e.id,paint:e=>t.cyan(e)},{header:`events`,value:e=>e.events}],s,{style:t,border:!0})}`);let c=`installations`in e?e.installations??[]:[];c.length&&H.stdout.write(`\n${E([{header:`integration`,value:e=>e.integration,paint:e=>t.cyan(e)},{header:`account`,value:e=>e.account},{header:`app`,value:e=>e.app}],c,{style:t,border:!0})}`)}const _t=F({name:`show`,description:`one agent in full: settings, integrations, events, tools, installations`,usage:[`Describe one agent as it will run here, or its active version on a server.`,`It lists its settings, access and per-integration events, and on a server its installations.`].join(` `),access:`read`,args:{id:x(`the agent`),...o},cli:{positional:[`id`],examples:[`coder agent show coder # what the built-in agent listens to and may do`]},run:async({options:e,args:[t],cwd:n})=>{let{agents:r}=await import(`./agent-BZR4Eqdc.js`).then(e=>e.t);return r.show(t,{...e,cwd:n,organization:e.workspace})},json:(e,{cwd:t})=>ht(e,t),print:(e,{cwd:t})=>gt(ht(e,t))});function vt(e,t){let n=Array.isArray(e.totals)?e.totals.map(e=>({group:t??``,...e})):Object.entries(e.totals).flatMap(([e,t])=>t.map(t=>({group:e,...t})));if(!n.length)return void H.stdout.write(`${A.dim(`No usage in this period.`)}\n`);H.stdout.write(`${E([{header:`by`,value:e=>e.group},{header:`key`,value:e=>e.key,paint:e=>A.cyan(e)},{header:`tasks`,value:e=>String(e.tasks)},{header:`runner ms`,value:e=>String(e.runnerMs)},{header:`tokens`,value:e=>e.tokens===void 0?``:JSON.stringify(e.tokens)}],n,A)}\n`)}function yt(e){if(/^\d+$/.test(e))return Number(e);let t=/^(\d+)([dh])$/.exec(e);if(!t)throw new C(`invalid-option`,`Invalid --since value.`,{hint:`Use 7d, 24h, or milliseconds since epoch`});return Date.now()-Number(t[1])*(t[2]===`d`?864e5:36e5)}const bt=F({name:`usage`,description:`aggregate usage by agent, installation, or engine`,access:`read`,args:{since:x(`period such as 7d or 24h, or milliseconds since epoch`,`<period|ms>`),by:x(`agent, installation, or engine`,`<group>`),...o},run:async({options:e,cwd:t})=>{let{agents:n}=await import(`./agent-BZR4Eqdc.js`).then(e=>e.t);return n.usage({...e,cwd:t,organization:e.workspace,since:yt(e.since??`7d`)})},print:(e,{options:t})=>vt(e,t.by)}),xt=I({name:`agent`,description:`define and run agents`,usage:`Define and run agents from the CLI, the dashboard, or on GitHub, Slack and other platforms.`,commands:[We,_t,mt,Be,Ge,pt,bt],namespaces:[Pe],aliases:{ls:`list`}}),St=e=>{throw e instanceof C&&e.code===`login-failed`?new C(`invalid-option`,e.message,e.hint?{hint:e.hint}:{}):e},Ct=F({name:`login`,description:`sign in through the browser`,usage:`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.`,access:`write`,approvalPolicy:`deny`,args:{...o,device:v(`show a code to approve on another device; the default without a local browser`)},globalFlags:{cwd:!1},cli:{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`]},run:async({options:e,tool:t})=>{let{hasBrowser:n,sessions:r}=await import(`./sign-in-Dv-rdYD4.js`).then(e=>e.n),i=t?H.stderr:H.stdout;return r.login({server:e.server,yes:e.yes,device:e.device||!n(),open:e=>{i.write(`Opening your browser to sign in. If it does not open, visit\n${A.light(e)}\n`),pe(e)},onCode:(e,t)=>i.write(`Confirm this code in your browser: ${A.bold(e)}\n${A.light(t)}\n`),organization:e.workspace,...ge()?{chooseOrganization:async e=>{let[t]=await fe({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 t}}:{}}).catch(St)},json:e=>({server:e.server,user:e.user,organization:e.organization}),print:e=>{let t=A;H.stdout.write(`${t.green(`✔`)} Signed in to ${t.bold(e.server)} as ${e.user.email}${e.organization?` ${t.dim(`· ${e.organization.name}`)}`:``}\n`)}}),wt=F({name:`logout`,description:`sign out and forget the saved session`,usage:`Revoke the saved session for that server at Wular Auth and forget its tokens.`,access:`write`,approvalPolicy:`deny`,args:{server:g(`sign out of this Coder server (default: the hosted one)`,`[url]`),yes:v(`connect to a server used for the first time without asking`)},globalFlags:{cwd:!1},run:async({options:e})=>{let{sessions:t}=await import(`./sign-in-Dv-rdYD4.js`).then(e=>e.n);return t.logout(e).catch(St)},print:e=>H.stdout.write(`Signed out of ${e.server}.\n`)}),Tt=F({name:`status`,description:`show where you are signed in`,usage:`List saved sessions with their server, user, and workspace.`,access:`read`,approvalPolicy:`deny`,globalFlags:{cwd:!1},cli:{env:[[`CODER_SERVER`,`the server to use instead of https://coder.wular.ai`]]},run:async()=>{let{sessions:e}=await import(`./sign-in-Dv-rdYD4.js`).then(e=>e.n);return e.status()},next:({result:e})=>Object.keys(e).length?[]:L([`Sign in: coder auth login`]),print:e=>{let t=A,n=Object.entries(e);if(!n.length)return void H.stdout.write(`${t.dim(`Not signed in`)}\n`);H.stdout.write(`${E([{header:`server`,value:([e])=>e,paint:e=>t.cyan(e)},{header:`user`,value:([,e])=>e.user.email},{header:`workspace`,value:([,e])=>e.organization?`${e.organization.name} (${e.organization.slug})`:`-`}],n,t)}\n`)}}),Et=I({name:`auth`,description:`sign in to Coder and manage saved server sessions`,commands:[Ct,wt,Tt]}),Dt=e=>new C(`invalid-option`,`Usage: ${e}`);function Ot(e){try{return JSON.parse(e)}catch{return e.includes(`,`)?e.split(`,`).map(e=>e.trim()).filter(Boolean):e}}const kt=F({name:`config`,description:`read or write config`,usage:`Read or write configuration. \`list\` prints the effective config; get/set/unset
|
|
39
39
|
target a dotted key (e.g. chain); migrate rewrites the file at this Coder's config
|
|
40
|
-
version. Writes go to ~/.coder/config.json.`,access:`write`,approvalPolicy:`deny`,args:{action:x(`list, get, set, unset or migrate`),key:x(`a dotted key, such as chain or reviewModel`),value:s(`with set: the value; JSON, or a comma list`),workspace:v(`target <repo>/.coder/config.json instead of the user file`)},cli:{positional:[`action`,`key`,`value`],examples:[`coder config list # print the effective config`,`coder config set chain codex/sol,claude/opus # the default model, then its fallbacks`,`coder config get reviewModel # read one value`,`coder config migrate --workspace # rewrite the repo file at config version 1`]},async run({options:e,args:[t,n,...r],cwd:i}){if(!t||t===`help`)return;let{config:a,migrateConfigFile:o,resolveUserConfigFile:s}=await import(`./config-
|
|
40
|
+
version. Writes go to ~/.coder/config.json.`,access:`write`,approvalPolicy:`deny`,args:{action:x(`list, get, set, unset or migrate`),key:x(`a dotted key, such as chain or reviewModel`),value:s(`with set: the value; JSON, or a comma list`),workspace:v(`target <repo>/.coder/config.json instead of the user file`)},cli:{positional:[`action`,`key`,`value`],examples:[`coder config list # print the effective config`,`coder config set chain codex/sol,claude/opus # the default model, then its fallbacks`,`coder config get reviewModel # read one value`,`coder config migrate --workspace # rewrite the repo file at config version 1`]},async run({options:e,args:[t,n,...r],cwd:i}){if(!t||t===`help`)return;let{config:a,migrateConfigFile:o,resolveUserConfigFile:s}=await import(`./config-_32PHl9g.js`).then(e=>e.y);if(t===`migrate`)return{action:t,...o(i,e.workspace)};if(t===`list`)return{action:t,config:a.get(void 0,{cwd:i}),file:s()};if(t===`get`){if(!n)throw Dt(`coder config get <key> (e.g. chain, reviewModel)`);return{action:t,value:a.get(n,{cwd:i})}}if(t!==`set`&&t!==`unset`)throw Dt(`coder config <list|get|set|unset|migrate> [<key> [value]] [--workspace]`);if(!n||t===`set`&&r.length===0)throw Dt(`coder config ${t} <key>${t===`set`?` <value>`:``}`);return{action:t,set:a.set(n,Ot(r.join(` `)),{cwd:i,workspace:e.workspace,unset:t===`unset`})}},json(e){let t=e;return t.action===`list`?t.config:t.action===`get`?t.value??null:t.action===`migrate`?{file:t.file,version:t.version,notes:t.notes}:t.set},print(e){if(!e)return void H.stdout.write(ve(kt));if(e.action===`list`)return At(e.config,e.file);if(e.action===`get`)return jt(e.value);if(e.action===`migrate`)return void H.stdout.write([...e.notes,e.version===1?`${e.file} is already config version 1.`:`Rewrote ${e.file} from config version ${e.version} to 1.`].join(`
|
|
41
41
|
`)+`
|
|
42
42
|
`);Mt(e.set)}});function At(e,t){let n=A;H.stdout.write([`${n.dim(`chain`)} ${e.chain.join(` -> `)}`,`${n.dim(`review`)} ${e.reviewModel}`,`${n.dim(`network`)} hosts=[${e.network.allowedHosts.join(`, `)}]`,`${n.dim(`file`)} ${t}`].join(`
|
|
43
43
|
`)+`
|
|
44
44
|
`)}function jt(e){if(e===null||typeof e==`object`&&e!==void 0)return D(e);H.stdout.write(`${e===void 0?`(unset)`:String(e)}\n`)}function Mt(e){let t=A,n=e.unset?`unset ${t.cyan(e.key)}`:`${t.cyan(e.key)} = ${JSON.stringify(e.value)}`;H.stdout.write(`${n} ${t.dim(`(${e.file})`)}\n`)}async function Nt(e){let{openUrl:t}=await import(`./prompt-CpwbsEWM.js`).then(e=>e.s);H.stderr.write(`Sign in at ${j.cyan(e)}\n`),t(e)&&H.stderr.write(j.dim(`Opened it in the browser. Waiting...
|
|
45
|
-
`))}async function Pt(){let{askSecret:e}=await import(`./prompt-CpwbsEWM.js`).then(e=>e.s);return e(`Key`)}function Ft(e){return e.provider===`env`?`Task secret ${e.env}`:e.provider===`mcp`?`MCP server ${e.url??e.command}`:`${e.provider} account${e.account?` ${e.account}`:``}`}async function It(){throw new C(`invalid-option`,`A tool cannot read a key from stdin or a prompt.`,{hint:`Keep the key in an environment variable and pass --env, or run it in a terminal`})}const Lt=F({name:`add`,description:`connect a platform account or an MCP server`,usage:["Connect a platform account by its name (OAuth in the browser), or an MCP server at --url or started by the command after `--`.",`Platform accounts are personal and take no scope flag; MCP servers default to workspace scope, with --personal for personal scope.`,`A remote MCP server is checked for OAuth, open access or a key; a needed key is read from stdin or a prompt.`,`With --key, the key goes in --header (default Authorization) or --env.`,`Signing in needs --server.`].join(` `),access:`write`,approvalPolicy:{handoff:{page:`/settings/connections`,label:`Add the connection`,action:`add`,args:[`name`,`url`,`access`,`tools`,`personal`]}},args:{name:f().check(S(`the connection name; a platform name connects that account`),p(e=>![`coder`,`task`,`conversation`,`coder-approval`].includes(e),`The names coder, task, conversation and coder-approval are reserved for Coder MCP servers.`),p(e=>!/-user$/i.test(e.trim()),`Names ending in -user are kept for members' own connections`)),command:s("a stdio MCP server to start; on the command line, the words after `--`"),env:x(`the task-secret variable, or where a stdio server reads its key`,`<NAME>`),url:x(`a remote MCP server (streamable HTTP by default)`),header:x(`the header a remote server reads its key from (default: Authorization)`,`<NAME>`),key:v(`read a key from stdin or a prompt, never from a flag value`),auth:x(`override MCP authentication (default: detected for --url, none for a command)`,`<oauth|key|none>`),access:x(`read-only keeps only read-only tools (default: auto, which follows the task)`,`<read-only|auto>`),tools:x(`tool allowlist; a read-only stdio server needs one`,`<a,b>`),credential:x(`the credential a task secret reads`,`<id>`),personal:v(`a personal connection instead of the workspace's`),...o},cli:{positional:[`name`],examples:[`pbpaste | coder connection add docs --key --env DOCS_TOKEN -- npx -y docs-mcp # a stdio server with its key from stdin`,`coder connection add github --server # a member's GitHub account on the Coder server`]},run:async({options:e,args:[t],cwd:n,tool:r})=>{let{connection:i}=await import(`./connection-BXjn7gCC.js`).then(e=>e.n),a=r?It:Pt;return i.add(t,{...e,cwd:n,command:e.command??[],auth:e.auth,access:e.access,tools:e.tools?.split(`,`).map(e=>e.trim()).filter(Boolean),key:e.key?await a():void 0,askKey:a,onAuthorize:r?void 0:Nt})},print:e=>H.stdout.write(`Connected ${A.bold(e.id)}, ${Ft(e)}.\n`)}),Rt=e=>{let t=e.indexOf(`--`);return Lt(t===-1?e:[...e.slice(0,t),...e.slice(t+1).flatMap(e=>[`--command`,e])])};Object.defineProperty(Rt,"name",{value:Lt.name,writable:!0,enumerable:!0});const zt=Object.assign(Rt,Lt),Bt=F({name:`approve`,description:`approve a repository MCP server on this machine`,usage:`Approve an MCP server this repository or one of its agents declares, on this machine. A changed endpoint or command needs approval again.`,access:`write`,approvalPolicy:`deny`,args:{name:f().check(S(`the MCP server`)),agent:x(`select the agent when names have different definitions`,`<id>`)},cli:{positional:[`name`]},run:async({cwd:e,args:[t],options:n})=>{let{connection:r}=await import(`./connection-BXjn7gCC.js`).then(e=>e.n);return r.approve(t,{cwd:e,agent:n.agent})},print:({name:e})=>H.stdout.write(`Approved MCP server "${e}" on this machine.\n`)});function Vt({connections:e,declared:t=[]}){let n=A;H.stdout.write(e.length?E([{header:`name`,value:e=>e.id,paint:e=>n.cyan(e)},{header:`connects`,value:e=>Ft(e),paint:e=>n.light(e)},{header:`access`,value:e=>e.access===`read-only`?`Read-only`:`Auto`},{header:`scope`,value:e=>e.scope},{header:`owner`,value:e=>e.owner?.name??e.owner?.id??``},{header:`status`,value:e=>e.status}],e,n):`${n.dim(`No connections.`)}\n`),t.length&&H.stdout.write(`\n${n.bold(`Declared in this repository`)}\n${E([{header:`name`,value:e=>e.name,paint:e=>n.cyan(e)},{header:`in`,value:e=>e.source},{header:`runs`,value:e=>e.target,paint:e=>n.light(e)},{header:`here`,value:e=>e.approved?`approved`:`needs approval`}],t,n)}`)}const Ht=F({name:`list`,description:`list connections and the MCP servers this repository declares`,usage:[`Every workspace connection and every member's own, with its status.`,`In a task, one it is not granted is disabled, and one it has names its tool search server.`,`On this machine, also the MCP servers this repository and its agents declare, with whether each is approved here.`].join(` `),access:`read`,args:o,run:async({options:e,cwd:t})=>{let{connection:n}=await import(`./connection-BXjn7gCC.js`).then(e=>e.n);return n.list({...e,cwd:t})},next:({result:{connections:e,declared:t=[]}})=>L([...t.filter(e=>!e.approved).map(e=>`Approve: coder connection approve ${e.name}`),...e.filter(e=>e.status===`needs-auth`&&!e.agent&&(!e.owner||e.asker)).map(e=>`Reconnect: coder connection reconnect ${e.id}${e.owner?` --personal`:``}`),...e.length?[]:[`Add one: coder connection add <name> --url <url>`]]),print:Vt}),Ut=F({name:`reconnect`,description:`give a connection a new key, or sign in again`,usage:[`Give a key connection its new key, read from stdin or a prompt, or sign in to an OAuth connection again in the browser.`,`The credential a task secret reads gets the new value, so every connection reading it rotates.`,`With --personal, the asking member's own connection of that name.`].join(` `),access:`write`,approvalPolicy:{handoff:{page:`/settings/connections`,label:`Reconnect the connection`,action:`reconnect`,args:[`name`]}},args:{name:f().check(S(`the connection`)),personal:v(`the asking member's own connection instead of the workspace's`),...o},cli:{positional:[`name`],examples:[`pbpaste | coder connection reconnect groq # the new key from the clipboard`]},run:async({options:e,args:[t],cwd:n,tool:r})=>{let{connection:i}=await import(`./connection-BXjn7gCC.js`).then(e=>e.n);return i.reconnect(t,{...e,cwd:n,askKey:r?It:Pt,onAuthorize:r?void 0:Nt})},print:e=>H.stdout.write(`Reconnected ${A.bold(e.id)}.\n`)}),Wt=F({name:`rm`,description:`remove a connection`,usage:[`Remove a connection. The credential a task secret reads stays.`,`With --personal, the asking member's own connection of that name.`].join(` `),access:`write`,approvalPolicy:{handoff:{page:`/settings/connections`,label:`Remove the connection`,action:`delete`,args:[`name`],button:`Remove`}},args:{name:f().check(S(`the connection`)),personal:v(`the asking member's own connection instead of the workspace's`),...o},cli:{positional:[`name`]},run:async({options:e,args:[t],cwd:n})=>{let{connection:r}=await import(`./connection-BXjn7gCC.js`).then(e=>e.n);return r.remove(t,{...e,cwd:n})},print:e=>H.stdout.write(`Removed ${A.bold(e.id)}.\n`)}),Gt=I({name:`connection`,description:`platform accounts and MCP servers tasks use`,usage:[`Connections give tasks access to a service through a platform account or an MCP server.`,"They live in ~/.coder, or on the Coder server with --server, and tasks may use them unless an agent or `coder task run --connections` narrows the set."].join(` `),commands:[zt,Ht,Wt,Ut,Bt],aliases:{ls:`list`,remove:`rm`}}),Kt=F({name:`add`,description:`store an API key or subscription for one variable`,usage:`Store the key of one environment variable, encrypted on the server, as your own or with --workspace for every member. A key saved for that variable in the same scope is replaced. Where the server has subscription sign-in on, CLAUDE_CODE_OAUTH_TOKEN takes your own claude setup-token output.`,access:`write`,approvalPolicy:{handoff:{page:`/settings/credentials`,label:`Add the credential`,action:`add`,args:[`env`]}},args:{env:x(`the variable tasks read the key as (reads that variable by default)`,`<NAME>`),value:x(`literal values land in shell history and are visible to other processes; use - for stdin or prefer environment variables`,`<secret|->`),workspace:v(`a workspace key; owners and admins only`),"no-check":v(`skip the provider key check`),...h},globalFlags:{cwd:!1},cli:{examples:[`ANTHROPIC_API_KEY=sk-... coder credentials add --env ANTHROPIC_API_KEY # your own Claude key, read from the environment`,`OPENAI_API_KEY=sk-... coder credentials add --env OPENAI_API_KEY --workspace # a workspace key every member's tasks can use`,`pbpaste | coder credentials add --env OPENROUTER_API_KEY --value - # a key for custom models, value from stdin`]},run:async({options:e,tool:t})=>{let{addCredential:n}=await import(`./remote-BbXx6S9P.js`).then(e=>e.a);if(t&&e.value===`-`)throw new C(`invalid-option`,`A tool cannot read the key from stdin.`,{hint:`Set the variable in the environment, or run it in a terminal`});return n({...e,noCheck:e[`no-check`]})},print:(e,{options:t})=>H.stdout.write(`${e.replaced?`Replaced`:`Added`} ${t.workspace?`workspace`:`personal`} ${A.bold(e.name)}.\n`)});function qt(e){if(!e.length)return void H.stdout.write(`${A.dim(`No engine credentials.`)}\n`);H.stdout.write(`${E([{header:`variable`,value:e=>e.subscription?`${e.name} subscription`:e.name,paint:e=>A.cyan(e)},{header:`scope`,value:e=>e.scope},{header:`value`,value:e=>e.masked},{header:`account`,value:e=>[e.account?.email,e.account?.plan].filter(Boolean).join(` `)}],e,A)}\n`)}const Jt=F({name:`list`,description:`list your keys and the workspace keys, by variable`,access:`read`,args:h,globalFlags:{cwd:!1},run:async({options:e})=>{let{credentials:t}=await import(`./remote-BbXx6S9P.js`).then(e=>e.a);return t.list(e)},print:qt});function Yt(e){e.url&&H.stderr.write(`Open ${A.cyan(e.url)}\n`),e.code&&H.stderr.write(`Enter the code ${A.bold(e.code)}\n`)}async function Xt(){let e=(await import(`node:readline/promises`)).createInterface({input:H.stdin,output:H.stderr}),t=(await e.question(`Paste the code from the sign-in page `)).trim();return e.close(),t}function Zt(e){if(e.state===`failed`)return void H.stderr.write(`${j.red(e.error??`Sign-in failed.`)}\n`);H.stdout.write(`Signed in. Your ${A.bold(e.engine)} subscription is saved.\n`)}const Qt=F({name:`login`,description:`sign in to a claude or codex subscription on the server`,usage:`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 replaces your subscription for that engine. Needs CLAUDE_SUBSCRIPTIONS=1 or CODEX_SUBSCRIPTIONS=1 on the server.`,access:`write`,approvalPolicy:{handoff:{page:`/settings/credentials`,label:`Connect the engine`,action:`engine`,args:[`engine`]}},args:{engine:n(f()).check(S(`claude or codex`)),...h},globalFlags:{cwd:!1},cli:{positional:[`engine`]},mcp:!1,run:async({options:e,args:[t]})=>{let{loginCredential:n}=await import(`./remote-BbXx6S9P.js`).then(e=>e.a);return n(t,{...e,onStart:e=>H.once(`SIGINT`,()=>void e().finally(()=>H.exit(130))),onOpen:Yt,code:Xt})},next:({result:e})=>e.state===`failed`?L([`Try again`],{stream:`stderr`}):[],print:Zt,exit:(e,{options:t})=>!t.json&&e.state===`failed`?1:void 0}),$t=F({name:`remove`,description:`remove the key of one variable`,usage:`Remove the key of one environment variable.`,access:`write`,approvalPolicy:{handoff:{page:`/settings/credentials`,label:`Remove the credential`,action:`delete`,args:[`NAME`],button:`Remove`}},args:{NAME:f().check(S(`the variable`)),workspace:v(`the workspace key of that variable`),...h},globalFlags:{cwd:!1},cli:{positional:[`NAME`]},async run({options:e,args:[t]}){let{credentials:n}=await import(`./remote-BbXx6S9P.js`).then(e=>e.a);return n.remove(t,e)},print:(e,{args:[t]})=>H.stdout.write(`Removed ${A.bold(t)}.\n`)}),en=I({name:`credentials`,description:`engine credentials: subscriptions and API keys`,usage:`Manage subscriptions and API keys, one per variable in each scope. Your personal ones are yours alone; workspace ones serve every member, and only owners and admins change them. A task runs on its requester's own, else the workspace's.`,commands:[Jt,Kt,Qt,$t]}),tn=F({name:`docs`,description:`print bundled documentation (for agents to read)`,usage:"Print bundled documentation. With no topic, list the available topics; with a\ntopic, print that doc's raw markdown to stdout (unstyled, for an agent to\nconsume). Topics with sub-pages list them as `<topic>/<page>` (also accepted as\n`<topic>-<page>`). `coder docs skill` prints the host skill so an engine can\nload it once per session (--claude for the Claude Code flavor).",access:`read`,approvalPolicy:`deny`,args:{topic:x(`the doc to print (default: list the topics)`),claude:v(`with the skill topic: print the Claude Code flavor`)},globalFlags:{cwd:!1},cli:{positional:[`topic`],examples:[`coder docs # list the available topics`,`coder docs flows # print the Flows doc`,`coder docs review # print the Review doc`]},run:async({options:e,args:[t]})=>{let{docsCore:n}=await import(`./docs-CbgaMPvq.js`).then(e=>e.r);return n(t,e)},next:({result:e})=>`content`in e?[]:L([`Read a topic: coder docs <topic>`]),print:e=>H.stdout.write(`content`in e?e.content.endsWith(`
|
|
45
|
+
`))}async function Pt(){let{askSecret:e}=await import(`./prompt-CpwbsEWM.js`).then(e=>e.s);return e(`Key`)}function Ft(e){return e.provider===`env`?`Task secret ${e.env}`:e.provider===`mcp`?`MCP server ${e.url??e.command}`:`${e.provider} account${e.account?` ${e.account}`:``}`}async function It(){throw new C(`invalid-option`,`A tool cannot read a key from stdin or a prompt.`,{hint:`Keep the key in an environment variable and pass --env, or run it in a terminal`})}const Lt=F({name:`add`,description:`connect a platform account or an MCP server`,usage:["Connect a platform account by its name (OAuth in the browser), or an MCP server at --url or started by the command after `--`.",`Platform accounts are personal and take no scope flag; MCP servers default to workspace scope, with --personal for personal scope.`,`A remote MCP server is checked for OAuth, open access or a key; a needed key is read from stdin or a prompt.`,`With --key, the key goes in --header (default Authorization) or --env.`,`Signing in needs --server.`].join(` `),access:`write`,approvalPolicy:{handoff:{page:`/settings/connections`,label:`Add the connection`,action:`add`,args:[`name`,`url`,`access`,`tools`,`personal`]}},args:{name:f().check(S(`the connection name; a platform name connects that account`),p(e=>![`coder`,`task`,`conversation`,`coder-approval`].includes(e),`The names coder, task, conversation and coder-approval are reserved for Coder MCP servers.`),p(e=>!/-user$/i.test(e.trim()),`Names ending in -user are kept for members' own connections`)),command:s("a stdio MCP server to start; on the command line, the words after `--`"),env:x(`the task-secret variable, or where a stdio server reads its key`,`<NAME>`),url:x(`a remote MCP server (streamable HTTP by default)`),header:x(`the header a remote server reads its key from (default: Authorization)`,`<NAME>`),key:v(`read a key from stdin or a prompt, never from a flag value`),auth:x(`override MCP authentication (default: detected for --url, none for a command)`,`<oauth|key|none>`),access:x(`read-only keeps only read-only tools (default: auto, which follows the task)`,`<read-only|auto>`),tools:x(`tool allowlist; a read-only stdio server needs one`,`<a,b>`),credential:x(`the credential a task secret reads`,`<id>`),personal:v(`a personal connection instead of the workspace's`),...o},cli:{positional:[`name`],examples:[`pbpaste | coder connection add docs --key --env DOCS_TOKEN -- npx -y docs-mcp # a stdio server with its key from stdin`,`coder connection add github --server # a member's GitHub account on the Coder server`]},run:async({options:e,args:[t],cwd:n,tool:r})=>{let{connection:i}=await import(`./connection-DNzNYpha.js`).then(e=>e.n),a=r?It:Pt;return i.add(t,{...e,cwd:n,command:e.command??[],auth:e.auth,access:e.access,tools:e.tools?.split(`,`).map(e=>e.trim()).filter(Boolean),key:e.key?await a():void 0,askKey:a,onAuthorize:r?void 0:Nt})},print:e=>H.stdout.write(`Connected ${A.bold(e.id)}, ${Ft(e)}.\n`)}),Rt=e=>{let t=e.indexOf(`--`);return Lt(t===-1?e:[...e.slice(0,t),...e.slice(t+1).flatMap(e=>[`--command`,e])])};Object.defineProperty(Rt,"name",{value:Lt.name,writable:!0,enumerable:!0});const zt=Object.assign(Rt,Lt),Bt=F({name:`approve`,description:`approve a repository MCP server on this machine`,usage:`Approve an MCP server this repository or one of its agents declares, on this machine. A changed endpoint or command needs approval again.`,access:`write`,approvalPolicy:`deny`,args:{name:f().check(S(`the MCP server`)),agent:x(`select the agent when names have different definitions`,`<id>`)},cli:{positional:[`name`]},run:async({cwd:e,args:[t],options:n})=>{let{connection:r}=await import(`./connection-DNzNYpha.js`).then(e=>e.n);return r.approve(t,{cwd:e,agent:n.agent})},print:({name:e})=>H.stdout.write(`Approved MCP server "${e}" on this machine.\n`)});function Vt({connections:e,declared:t=[]}){let n=A;H.stdout.write(e.length?E([{header:`name`,value:e=>e.id,paint:e=>n.cyan(e)},{header:`connects`,value:e=>Ft(e),paint:e=>n.light(e)},{header:`access`,value:e=>e.access===`read-only`?`Read-only`:`Auto`},{header:`scope`,value:e=>e.scope},{header:`owner`,value:e=>e.owner?.name??e.owner?.id??``},{header:`status`,value:e=>e.status}],e,n):`${n.dim(`No connections.`)}\n`),t.length&&H.stdout.write(`\n${n.bold(`Declared in this repository`)}\n${E([{header:`name`,value:e=>e.name,paint:e=>n.cyan(e)},{header:`in`,value:e=>e.source},{header:`runs`,value:e=>e.target,paint:e=>n.light(e)},{header:`here`,value:e=>e.approved?`approved`:`needs approval`}],t,n)}`)}const Ht=F({name:`list`,description:`list connections and the MCP servers this repository declares`,usage:[`Every workspace connection and every member's own, with its status.`,`In a task, one it is not granted is disabled, and one it has names its tool search server.`,`On this machine, also the MCP servers this repository and its agents declare, with whether each is approved here.`].join(` `),access:`read`,args:o,run:async({options:e,cwd:t})=>{let{connection:n}=await import(`./connection-DNzNYpha.js`).then(e=>e.n);return n.list({...e,cwd:t})},next:({result:{connections:e,declared:t=[]}})=>L([...t.filter(e=>!e.approved).map(e=>`Approve: coder connection approve ${e.name}`),...e.filter(e=>e.status===`needs-auth`&&!e.agent&&(!e.owner||e.asker)).map(e=>`Reconnect: coder connection reconnect ${e.id}${e.owner?` --personal`:``}`),...e.length?[]:[`Add one: coder connection add <name> --url <url>`]]),print:Vt}),Ut=F({name:`reconnect`,description:`give a connection a new key, or sign in again`,usage:[`Give a key connection its new key, read from stdin or a prompt, or sign in to an OAuth connection again in the browser.`,`The credential a task secret reads gets the new value, so every connection reading it rotates.`,`With --personal, the asking member's own connection of that name.`].join(` `),access:`write`,approvalPolicy:{handoff:{page:`/settings/connections`,label:`Reconnect the connection`,action:`reconnect`,args:[`name`]}},args:{name:f().check(S(`the connection`)),personal:v(`the asking member's own connection instead of the workspace's`),...o},cli:{positional:[`name`],examples:[`pbpaste | coder connection reconnect groq # the new key from the clipboard`]},run:async({options:e,args:[t],cwd:n,tool:r})=>{let{connection:i}=await import(`./connection-DNzNYpha.js`).then(e=>e.n);return i.reconnect(t,{...e,cwd:n,askKey:r?It:Pt,onAuthorize:r?void 0:Nt})},print:e=>H.stdout.write(`Reconnected ${A.bold(e.id)}.\n`)}),Wt=F({name:`rm`,description:`remove a connection`,usage:[`Remove a connection. The credential a task secret reads stays.`,`With --personal, the asking member's own connection of that name.`].join(` `),access:`write`,approvalPolicy:{handoff:{page:`/settings/connections`,label:`Remove the connection`,action:`delete`,args:[`name`],button:`Remove`}},args:{name:f().check(S(`the connection`)),personal:v(`the asking member's own connection instead of the workspace's`),...o},cli:{positional:[`name`]},run:async({options:e,args:[t],cwd:n})=>{let{connection:r}=await import(`./connection-DNzNYpha.js`).then(e=>e.n);return r.remove(t,{...e,cwd:n})},print:e=>H.stdout.write(`Removed ${A.bold(e.id)}.\n`)}),Gt=I({name:`connection`,description:`platform accounts and MCP servers tasks use`,usage:[`Connections give tasks access to a service through a platform account or an MCP server.`,"They live in ~/.coder, or on the Coder server with --server, and tasks may use them unless an agent or `coder task run --connections` narrows the set."].join(` `),commands:[zt,Ht,Wt,Ut,Bt],aliases:{ls:`list`,remove:`rm`}}),Kt=F({name:`add`,description:`store an API key or subscription for one variable`,usage:`Store the key of one environment variable, encrypted on the server, as your own or with --workspace for every member. A key saved for that variable in the same scope is replaced. Where the server has subscription sign-in on, CLAUDE_CODE_OAUTH_TOKEN takes your own claude setup-token output.`,access:`write`,approvalPolicy:{handoff:{page:`/settings/credentials`,label:`Add the credential`,action:`add`,args:[`env`]}},args:{env:x(`the variable tasks read the key as (reads that variable by default)`,`<NAME>`),value:x(`literal values land in shell history and are visible to other processes; use - for stdin or prefer environment variables`,`<secret|->`),workspace:v(`a workspace key; owners and admins only`),"no-check":v(`skip the provider key check`),...h},globalFlags:{cwd:!1},cli:{examples:[`ANTHROPIC_API_KEY=sk-... coder credentials add --env ANTHROPIC_API_KEY # your own Claude key, read from the environment`,`OPENAI_API_KEY=sk-... coder credentials add --env OPENAI_API_KEY --workspace # a workspace key every member's tasks can use`,`pbpaste | coder credentials add --env OPENROUTER_API_KEY --value - # a key for custom models, value from stdin`]},run:async({options:e,tool:t})=>{let{addCredential:n}=await import(`./remote-Cl-j8r3W.js`).then(e=>e.a);if(t&&e.value===`-`)throw new C(`invalid-option`,`A tool cannot read the key from stdin.`,{hint:`Set the variable in the environment, or run it in a terminal`});return n({...e,noCheck:e[`no-check`]})},print:(e,{options:t})=>H.stdout.write(`${e.replaced?`Replaced`:`Added`} ${t.workspace?`workspace`:`personal`} ${A.bold(e.name)}.\n`)});function qt(e){if(!e.length)return void H.stdout.write(`${A.dim(`No engine credentials.`)}\n`);H.stdout.write(`${E([{header:`variable`,value:e=>e.subscription?`${e.name} subscription`:e.name,paint:e=>A.cyan(e)},{header:`scope`,value:e=>e.scope},{header:`value`,value:e=>e.masked},{header:`account`,value:e=>[e.account?.email,e.account?.plan].filter(Boolean).join(` `)}],e,A)}\n`)}const Jt=F({name:`list`,description:`list your keys and the workspace keys, by variable`,access:`read`,args:h,globalFlags:{cwd:!1},run:async({options:e})=>{let{credentials:t}=await import(`./remote-Cl-j8r3W.js`).then(e=>e.a);return t.list(e)},print:qt});function Yt(e){e.url&&H.stderr.write(`Open ${A.cyan(e.url)}\n`),e.code&&H.stderr.write(`Enter the code ${A.bold(e.code)}\n`)}async function Xt(){let e=(await import(`node:readline/promises`)).createInterface({input:H.stdin,output:H.stderr}),t=(await e.question(`Paste the code from the sign-in page `)).trim();return e.close(),t}function Zt(e){if(e.state===`failed`)return void H.stderr.write(`${j.red(e.error??`Sign-in failed.`)}\n`);H.stdout.write(`Signed in. Your ${A.bold(e.engine)} subscription is saved.\n`)}const Qt=F({name:`login`,description:`sign in to a claude or codex subscription on the server`,usage:`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 replaces your subscription for that engine. Needs CLAUDE_SUBSCRIPTIONS=1 or CODEX_SUBSCRIPTIONS=1 on the server.`,access:`write`,approvalPolicy:{handoff:{page:`/settings/credentials`,label:`Connect the engine`,action:`engine`,args:[`engine`]}},args:{engine:n(f()).check(S(`claude or codex`)),...h},globalFlags:{cwd:!1},cli:{positional:[`engine`]},mcp:!1,run:async({options:e,args:[t]})=>{let{loginCredential:n}=await import(`./remote-Cl-j8r3W.js`).then(e=>e.a);return n(t,{...e,onStart:e=>H.once(`SIGINT`,()=>void e().finally(()=>H.exit(130))),onOpen:Yt,code:Xt})},next:({result:e})=>e.state===`failed`?L([`Try again`],{stream:`stderr`}):[],print:Zt,exit:(e,{options:t})=>!t.json&&e.state===`failed`?1:void 0}),$t=F({name:`remove`,description:`remove the key of one variable`,usage:`Remove the key of one environment variable.`,access:`write`,approvalPolicy:{handoff:{page:`/settings/credentials`,label:`Remove the credential`,action:`delete`,args:[`NAME`],button:`Remove`}},args:{NAME:f().check(S(`the variable`)),workspace:v(`the workspace key of that variable`),...h},globalFlags:{cwd:!1},cli:{positional:[`NAME`]},async run({options:e,args:[t]}){let{credentials:n}=await import(`./remote-Cl-j8r3W.js`).then(e=>e.a);return n.remove(t,e)},print:(e,{args:[t]})=>H.stdout.write(`Removed ${A.bold(t)}.\n`)}),en=I({name:`credentials`,description:`engine credentials: subscriptions and API keys`,usage:`Manage subscriptions and API keys, one per variable in each scope. Your personal ones are yours alone; workspace ones serve every member, and only owners and admins change them. A task runs on its requester's own, else the workspace's.`,commands:[Jt,Kt,Qt,$t]}),tn=F({name:`docs`,description:`print bundled documentation (for agents to read)`,usage:"Print bundled documentation. With no topic, list the available topics; with a\ntopic, print that doc's raw markdown to stdout (unstyled, for an agent to\nconsume). Topics with sub-pages list them as `<topic>/<page>` (also accepted as\n`<topic>-<page>`). `coder docs skill` prints the host skill so an engine can\nload it once per session (--claude for the Claude Code flavor).",access:`read`,approvalPolicy:`deny`,args:{topic:x(`the doc to print (default: list the topics)`),claude:v(`with the skill topic: print the Claude Code flavor`)},globalFlags:{cwd:!1},cli:{positional:[`topic`],examples:[`coder docs # list the available topics`,`coder docs flows # print the Flows doc`,`coder docs review # print the Review doc`]},run:async({options:e,args:[t]})=>{let{docsCore:n}=await import(`./docs-CxklYa3P.js`).then(e=>e.r);return n(t,e)},next:({result:e})=>`content`in e?[]:L([`Read a topic: coder docs <topic>`]),print:e=>H.stdout.write(`content`in e?e.content.endsWith(`
|
|
46
46
|
`)?e.content:`${e.content}\n`:nn(e.topics))});function nn(e){let t=A,n=e=>e.includes(`/`)?` ${e}`:e;return E([{header:`topic`,value:e=>n(e.name),paint:e=>t.cyan(e)},{header:`about`,value:e=>e.description,paint:e=>t.light(e)}],e,t)}const rn=e=>e===1?``:`s`,an=F({name:`archive`,description:`hide a run (or all stopped) from the list`,usage:`Archive a flow run so it drops out of the default list (see it again with
|
|
47
47
|
\`coder flow list --archived [--limit N]\`). Pass --all-stopped to archive every
|
|
48
|
-
finished run. A running run must be stopped first.`,access:`write`,approvalPolicy:`deny`,args:{"run-id":x(`the run to archive`),"all-stopped":v(`archive every stopped (finished) run`)},cli:{positional:[`run-id`]},run:async({options:e,args:[t]})=>{let{archiveRuns:n}=await import(`./executor-
|
|
48
|
+
finished run. A running run must be stopped first.`,access:`write`,approvalPolicy:`deny`,args:{"run-id":x(`the run to archive`),"all-stopped":v(`archive every stopped (finished) run`)},cli:{positional:[`run-id`]},run:async({options:e,args:[t]})=>{let{archiveRuns:n}=await import(`./executor-Ds4wDCzV.js`).then(e=>e.A);return n(t,{allStopped:e[`all-stopped`]})},print(e){if(!(`count`in e))return void H.stdout.write(`Archived run ${A.cyan(e.runId)}.\n`);H.stdout.write(e.count?`Archived ${e.count} stopped run${rn(e.count)}.\n`:`${A.dim(`No stopped runs to archive.`)}\n`)}}),on=F({name:`delete`,description:`delete a run's record (or all archived)`,usage:`Delete a flow run's record from disk (its journal, events, and logs). This is
|
|
49
49
|
permanent; the run's tasks are ordinary tasks and are not touched. Pass
|
|
50
50
|
--all-archived to delete every archived run at once. A running run must be
|
|
51
|
-
stopped first.`,access:`write`,approvalPolicy:`deny`,args:{"run-id":x(`the run to delete`),"all-archived":v(`delete every archived run`)},cli:{positional:[`run-id`]},run:async({options:e,args:[t]})=>{let{deleteRuns:n}=await import(`./executor-
|
|
52
|
-
.coder/flows/ (walking up to the repo root) and global flows in ~/.coder/flows/.`,access:`read`,approvalPolicy:`deny`,run:async({cwd:e})=>{let{discoverFlows:t}=await import(`./discover-
|
|
51
|
+
stopped first.`,access:`write`,approvalPolicy:`deny`,args:{"run-id":x(`the run to delete`),"all-archived":v(`delete every archived run`)},cli:{positional:[`run-id`]},run:async({options:e,args:[t]})=>{let{deleteRuns:n}=await import(`./executor-Ds4wDCzV.js`).then(e=>e.A);return n(t,{allArchived:e[`all-archived`]})},print(e){if(!(`count`in e))return void H.stdout.write(`Deleted run ${A.cyan(e.runId)}.\n`);H.stdout.write(e.count?`Deleted ${e.count} archived run${rn(e.count)}.\n`:`${A.dim(`No archived runs to delete.`)}\n`)}}),sn=F({name:`discover`,description:`list flows runnable here (workspace + global)`,usage:`List every flow discoverable from the current directory: workspace flows in
|
|
52
|
+
.coder/flows/ (walking up to the repo root) and global flows in ~/.coder/flows/.`,access:`read`,approvalPolicy:`deny`,run:async({cwd:e})=>{let{discoverFlows:t}=await import(`./discover-BfYHHJN_.js`).then(e=>e.r);return t(e)},next:({result:e})=>L(e.length?[`Run one: coder flow run <name>`,`Recent runs: coder flow list`]:[`Authoring guide: coder docs flows`]),print:(e,{cwd:t})=>cn(e,t)});function cn(e,t){if(!e.length){H.stdout.write(`No flows found in .coder/flows/ (workspace) or ~/.coder/flows/ (global).
|
|
53
53
|
`);return}let n=A;H.stdout.write(E([{header:`name`,value:e=>e.name,paint:e=>n.cyan(e)},{header:`scope`,value:e=>e.scope,paint:e=>n.light(e)},{header:`path`,value:e=>e.scope===`workspace`?V.relative(t,e.path)||e.path:e.path.replace(ke.homedir(),`~`),paint:e=>n.light(e)}],e,n))}const ln=F({name:`watch`,description:`watch a run live (replay + follow)`,usage:`Watch a flow run live: replay its progress lines from the start, then keep
|
|
54
54
|
following while it runs (Ctrl-C detaches; it keeps running). Blocks until it
|
|
55
55
|
finishes; exits 0 on success, 1 otherwise. Defaults to the most recent run.
|
|
56
56
|
For the result alone, prefer \`coder flow result\`. Alias: stream.
|
|
57
57
|
|
|
58
58
|
With --from <n>, or as a tool, it returns the events from event n on without
|
|
59
|
-
following, and \`next\`: the command that continues them while the run goes on.`,access:`read`,approvalPolicy:`deny`,args:{"run-id":x(`the run (default: the most recent)`),tail:l(`replay only the last n events first (default: all)`),from:b(n(_().check(i(),a())),`return the events from event n on instead of following them`,`<n>`)},cli:{positional:[`run-id`],examples:[`coder flow watch # follow the most recent run to completion`,`coder flow watch <run-id> --from 0 --json # the events so far, and the command that continues them`]},async run({options:e,args:[t],tool:n,next:r}){let{watchRun:i}=await import(`./executor-
|
|
59
|
+
following, and \`next\`: the command that continues them while the run goes on.`,access:`read`,approvalPolicy:`deny`,args:{"run-id":x(`the run (default: the most recent)`),tail:l(`replay only the last n events first (default: all)`),from:b(n(_().check(i(),a())),`return the events from event n on instead of following them`,`<n>`)},cli:{positional:[`run-id`],examples:[`coder flow watch # follow the most recent run to completion`,`coder flow watch <run-id> --from 0 --json # the events so far, and the command that continues them`]},async run({options:e,args:[t],tool:n,next:r}){let{watchRun:i}=await import(`./executor-Ds4wDCzV.js`).then(e=>e.A),a=e.from??(n?0:void 0),o=i(t,{tail:e.tail,from:a});if(a===void 0)return Cn(o,{json:e.json,stream:!0},r);let s=[];for await(let e of o.events)s.push(e);let{runId:c,status:l}=o.record;return{runId:c,status:l,events:s,...l===`running`?{next:`coder flow watch ${c} --from ${a+s.length}`}:{}}},next:({result:e})=>Dn(e),print(e){let t=new xn;for(let n of e.events)t.emit(n);t.done()}}),un=[`⣾`,`⣽`,`⣻`,`⢿`,`⡿`,`⣟`,`⣯`,`⣷`];function Z(e,t=!1){let n=A;return t?k(`[${fn(e)}]`,10):e===`completed`?n.bold(n.green(`✔`)):e===`failed`||e===`cancelled`||e===`stopped`?n.bold(n.red(`✘`)):e===`running`?n.bold(n.cyan(`●`)):n.dim(`○`)}function dn(){return k(`[start]`,10)}function fn(e){return e===`completed`?`done`:e===`cancelled`?`failed`:e}function pn(e,t){return e??t.replace(/\s+/g,` `).trim().slice(0,60)}function Q(e,t,n,r,i,a){let o=A,s=k(t??n,32);return[`${e} ${a?o.bold(s):s}`,o.dim(k(n,24)),o.light(k(i??``,20)),r?o.light(`${ce(r.total)} tok`):``].join(` `).trimEnd()}function mn(e,t=!1){let n=A;return`${Z(e.ok?`completed`:`failed`,t)} ${n.dim(`gate`)} ${n.light(e.cmd)}${e.ok?``:n.dim(` · exit ${e.code}`)}`}function hn(e,t,n){let r=A,i=n!==void 0&&n>=1e3?r.dim(` · ${w(n)}`):``;return`${t} ${r.dim(`gate`)} ${r.light(e)}${i}`}function gn(e,t=!1){return A.dim(`${`│ `.repeat(e)}${t?`└─`:`├─`}`)}function _n(e){return A.dim(`${`│ `.repeat(e)}│ `)}function vn(e){return`${` `.repeat(e.depth)}${e.log?`${k(`[log]`,10)} `:``}${e.body}`}function yn(e,t,n=!1){return n?vn(e):`${e.log?_n(e.depth):gn(e.depth,t)} ${e.body}`}function bn(e){return A.dim(`${`│ `.repeat(Math.max(0,e))}│`)}var xn=class{stream;names=new Map;active=new Map;activeGates=new Map;pending;previews=new Map;tails=new Map;previewWatchers=new Map;frame=0;hasCommitted=!1;timer;tty;region;constructor(e=H.stdout){this.stream=e,this.tty=!!e.isTTY,this.region=new ie(e)}emit(e){let t=A;switch(e.kind){case`task-start`:{let t={name:pn(e.name,e.prompt),engine:e.engine,depth:e.depth??0};if(this.names.set(e.taskId,t),!this.tty){this.final(t.depth,Q(dn(),t.name,e.taskId,null,t.engine));return}this.active.set(e.taskId,t),this.previewWatchers.get(e.taskId)?.close(),this.previewWatchers.set(e.taskId,Ee(be(H.cwd(),e.taskId),t=>{t&&t!==`log.jsonl`||(this.refreshPreviews(e.taskId),this.repaint())})),this.refreshPreviews(e.taskId),this.spin(!0),this.repaint();return}case`task-end`:{this.active.delete(e.taskId),this.previews.delete(e.taskId),this.tails.delete(e.taskId),this.previewWatchers.get(e.taskId)?.close(),this.previewWatchers.delete(e.taskId),this.idle();let t=this.names.get(e.taskId);this.final(t?.depth??0,Q(Z(e.status,!this.tty),t?.name??null,e.taskId,e.tokens,t?.engine));return}case`gate-start`:{let t={cmd:e.cmd,depth:e.depth??0,startedAt:Date.now()};if(!this.tty){this.final(t.depth,hn(t.cmd,dn()));return}this.activeGates.set(e.gateId,t),this.spin(!0),this.repaint();return}case`gate`:e.gateId&&this.activeGates.delete(e.gateId),this.idle(),this.final(e.depth??0,mn(e,!this.tty));return;case`log`:for(let n of e.message.split(`
|
|
60
60
|
`))this.final(e.depth??0,t.light(n),!0);return;case`flow-start`:this.final(e.depth-1,t.bold(`flow ${e.name}`));return;case`replay`:this.final(0,t.dim(`replayed ${e.count} steps from journal`),!0)}}done(){this.spin(!1);for(let e of this.previewWatchers.values())e.close();this.previewWatchers.clear(),this.flush(0),this.tty&&this.repaint(),this.region.done()}flush(e){this.pending&&=(this.region.commit(`${yn(this.pending,e<this.pending.depth,!this.tty)}\n`),this.hasCommitted=!0,void 0)}final(e,t,n=!1){if(!this.tty){this.region.commit(`${vn({depth:e,body:t,log:n})}\n`),this.hasCommitted=!0;return}this.flush(e),this.pending={depth:e,body:t,log:n},this.tty&&this.repaint()}repaint(){let e=[],t=[];if(this.pending){let n=yn(this.pending,!1);e.push(n),t.push(n)}let n=this.timer?A.bold(A.cyan(un[this.frame%un.length])):Z(`running`);for(let[r,i]of this.active){let a=`${gn(i.depth??0)} ${Q(n,i.name,r,null,i.engine,!0)}`;(e.length||this.hasCommitted)&&e.push(bn(i.depth??0)),e.push(a),t.push(a);let o=this.previews.get(r);o&&e.push(`${_n(i.depth??0)} ${A.dim(o)}`)}for(let r of this.activeGates.values()){let i=`${gn(r.depth)} ${hn(r.cmd,n,Date.now()-r.startedAt)}`;(e.length||this.hasCommitted)&&e.push(bn(r.depth)),e.push(i),t.push(i)}let r=(ae(this.stream)??1/0)-1,i=e.length<=r?e:t;if(i.length>r){let e=Math.max(0,r-1);i=[A.dim(`… +${i.length-e} more running`),...i.slice(-e)]}this.region.set(i)}refreshPreviews(e){try{let t=this.tails.get(e),n;if(!t){let r=V.join(be(H.cwd(),e),`log.jsonl`),i=Oe.existsSync(r)?Oe.statSync(r).size:0;n=ye(H.cwd(),e,1)[0],t=Ce(r,i),this.tails.set(e,t)}for(let e of t())try{n=JSON.parse(e)}catch{n={message:e}}let r=n?.message?.replace(/\s+/g,` `).trim();if(!r)return;let i=(P(this.stream)??120)-8;this.previews.set(e,r.length>i?`${r.slice(0,i-1)}…`:r)}catch{}}idle(){!this.active.size&&!this.activeGates.size&&this.spin(!1)}spin(e){e&&!this.timer?this.timer=setInterval(()=>{this.frame++,this.repaint()},120).unref():!e&&this.timer&&(clearInterval(this.timer),this.timer=void 0)}};function Sn(e,t){if(t){D(e);return}let n=!H.stdout.isTTY,r=n?``:`${A.dim(`└─`)} `;H.stdout.write(`${r}${Z(`completed`,n)} run ${A.cyan(e.runId)} completed ${A.dim(`(${e.taskCount} tasks)`)}\n`),H.stdout.write(`\n${oe(e.result)}\n`),wn(e.tokens)}async function Cn(e,t,n){let{runId:r}=e.record,i=!!(t.stream&&t.json);!t.json&&e.record.status===`running`&&H.stderr.write(`${A.dim(`[flow]`)} Run ${A.cyan(r)} started and is waiting to finish. Press Ctrl-C to detach. It keeps running.\n\n`);let a=t.json?()=>{}:ue(),o=()=>{a(),i||(H.stderr.write(`\n${A.dim(`[flow] Detached. The run is still going.`)}\n`),n({runId:r,status:`running`,phase:`detached`},{stream:`stderr`,style:`stdout`,force:!0})),H.exit(130)};H.on(`SIGINT`,o);let s=new xn;for await(let n of e.events)i?H.stdout.write(`${JSON.stringify(n)}\n`):t.json||s.emit(n);s.done(),a(),H.off(`SIGINT`,o);let c=e.final();i&&(H.stdout.write(`${JSON.stringify(En(c))}\n`),H.exit(c.status===`completed`?0:1)),c.status===`completed`&&(Sn({runId:r,name:c.name,status:`completed`,result:c.result,tokens:c.ledger,taskCount:c.taskCount},t.json),H.exit(0)),c.status===`stopped`&&(t.json?D({runId:r,name:c.name,status:`stopped`,taskCount:c.taskCount}):H.stdout.write(`\n${A.dim(`[flow] Run ${r} stopped.`)}\n`),n(c),H.exit(1)),H.stdout.write(`\n${A.red(`error:`)} ${c.error??`unknown error`}\n`),n(c,{force:!0}),H.exit(1)}function wn(e){let t=Object.keys(e);if(t.length){H.stdout.write(`\n${A.bold(`Tokens:`)}\n`);for(let n of t)H.stdout.write(` ${A.dim(N(e[n],n))}\n`)}}function Tn(e){let{runId:t,name:n,status:r,startedAt:i,endedAt:a,taskCount:o,ledger:s,error:c,archived:l,archivedAt:u}=e;return{runId:t,name:n,status:r,startedAt:i,endedAt:a,taskCount:o,ledger:s,error:c,archived:l,archivedAt:u}}function En(e){return{...Tn(e),result:e.result}}function Dn(e){return e.next?L([`Continue: ${e.next}`]):e.status===`running`?L(e.phase===`detached`?[`Result: coder flow result ${e.runId}`,`Stop it: coder flow stop ${e.runId}`]:[`Result: coder flow result ${e.runId}`,`Runs: coder flow list`]):e.status===`stopped`||e.status===`failed`?L([`Resume: coder flow resume ${e.runId}`]):[]}const On=F({name:`list`,description:`recent flow runs (by default running + just stopped)`,usage:`List recent flow runs, most recent first: running runs plus ones that ended
|
|
61
|
-
within the last 30 minutes. Older runs auto-archive and move to --archived.`,access:`read`,approvalPolicy:`deny`,args:{archived:v(`show archived runs (auto-archived or via flow archive)`),limit:d(`show at most n runs (default all)`)},run:async({options:e})=>{let{collectFlowRuns:t}=await import(`./executor-
|
|
61
|
+
within the last 30 minutes. Older runs auto-archive and move to --archived.`,access:`read`,approvalPolicy:`deny`,args:{archived:v(`show archived runs (auto-archived or via flow archive)`),limit:d(`show at most n runs (default all)`)},run:async({options:e})=>{let{collectFlowRuns:t}=await import(`./executor-Ds4wDCzV.js`).then(e=>e.A);return t(e)},json:e=>e.runs.map(Tn),next:({result:e})=>L(e.runs.length?[`Result: coder flow result <run-id>`,`Tasks: coder list`,`Runnable flows: coder flow discover`]:[`Run one: coder flow run <name>`,`Runnable flows: coder flow discover`]),print:(e,{options:t})=>kn(e,t)});function kn({runs:e,clipped:t},n){if(!e.length){H.stdout.write(n.archived?`No archived flow runs.
|
|
62
62
|
`:`No recent flow runs.
|
|
63
63
|
`);return}let r=A;H.stdout.write(`${E([{header:`run-id`,value:e=>e.runId,max:28,paint:e=>r.cyan(e)},{header:`name`,value:e=>e.name,max:30},{header:`status`,value:e=>e.status,paint:(e,t)=>O(t.status,e.length)},{header:`tasks`,value:e=>`${e.taskCount} tasks`,paint:e=>r.light(e)},{header:`tokens`,value:e=>{let t=Object.values(e.ledger).reduce((e,t)=>e+t.total,0);return t?`${ce(t)} tok`:`-`},paint:e=>r.light(e)},{header:`age`,value:e=>w(R(e.startedAt)),paint:e=>r.light(e)}],e,r)}\n`),t&&H.stdout.write(r.dim(`\n... ${t} more not shown (--limit ${n.limit})\n`))}const An=F({name:`result`,description:`progress and result of a run`,usage:`Show a flow run's status and result, with its tasks, gates, and token ledger.
|
|
64
64
|
--tail <n> caps the step rows (0 for the result alone). Defaults to the most
|
|
65
|
-
recent run. To watch a run live, prefer \`coder flow watch\`.`,access:`read`,approvalPolicy:`deny`,args:{"run-id":x(`the run (default: the most recent)`),tail:l(`show the last n step rows (default: all; 0 hides them)`)},cli:{positional:[`run-id`],examples:[`coder flow result --tail 0 # the most recent run's result, no step rows`]},async run({options:e,args:[t]}){let{runResult:n}=await import(`./executor-
|
|
65
|
+
recent run. To watch a run live, prefer \`coder flow watch\`.`,access:`read`,approvalPolicy:`deny`,args:{"run-id":x(`the run (default: the most recent)`),tail:l(`show the last n step rows (default: all; 0 hides them)`)},cli:{positional:[`run-id`],examples:[`coder flow result --tail 0 # the most recent run's result, no step rows`]},async run({options:e,args:[t]}){let{runResult:n}=await import(`./executor-Ds4wDCzV.js`).then(e=>e.A),r=n(t);if(!r&&!e.json)throw new C(`flow-failed`,t?`No flow run "${t}".`:`No flow runs yet.`,{hint:`Run one: coder flow run <name>`});return r},json:e=>e&&En(e),next:({result:e})=>e?L(e.status===`running`?[`Follow live: coder flow watch ${e.runId}`,`Stop it: coder flow stop ${e.runId}`]:e.status===`stopped`||e.status===`failed`?[`Resume: coder flow resume ${e.runId}`]:[]):[],print:(e,{options:t})=>Mn(e,t.tail)});function jn(e,t=!1){let n=A;if(t)return e.map(vn);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 Mn(e,t=`all`){let n=A,r=!H.stdout.isTTY;H.stdout.write(`${n.bold(`Flow`)} ${n.cyan(e.name)} ${n.dim(`(${e.runId})`)}. ${n.bold(O(e.status))}\n`);let i=e.steps,a=i.filter(e=>xe.includes(e.status)).length,o=e.status===`running`?`${a}/${i.length} tasks`:`${e.taskCount} tasks`;if(H.stdout.write(`${n.dim(`started ${e.startedAt}${e.endedAt?` · ended ${e.endedAt}`:``} · ${o}`)}\n`),t!==0){let a=new Map,o=new Map,s=new Map,c=[];for(let t of e.events)if(t.kind===`task-start`){let e={name:pn(t.name,t.prompt),engine:t.engine,depth:t.depth??0};a.set(t.taskId,e),o.set(t.taskId,e)}else if(t.kind===`task-end`){o.delete(t.taskId);let e=a.get(t.taskId);c.push({depth:e?.depth??0,body:Q(Z(t.status,r),e?.name??null,t.taskId,t.tokens,e?.engine)})}else if(t.kind===`gate-start`)s.set(t.gateId,{cmd:t.cmd,depth:t.depth??0});else if(t.kind===`gate`)t.gateId&&s.delete(t.gateId),c.push({depth:t.depth??0,body:mn(t,r)});else if(t.kind===`log`)for(let e of t.message.split(`
|
|
66
66
|
`))c.push({depth:t.depth??0,body:n.light(e),log:!0});else t.kind===`flow-start`&&c.push({depth:t.depth-1,body:n.bold(`flow ${t.name}`)});for(let[e,t]of o)c.push({depth:t.depth??0,body:Q(Z(`running`,r),t.name,e,null,t.engine)+(r?``:` ${n.light(`running`)}`)});for(let e of s.values())c.push({depth:e.depth,body:hn(e.cmd,Z(`running`,r))+(r?``:` ${n.light(`running`)}`)});if(!c.length)for(let e of t===`all`?i:i.slice(-t))c.push({depth:0,body:Q(Z(e.status,r),e.name,e.taskId??`-`,e.tokens)});let l=jn(c,r),u=t===`all`?l:l.slice(-t);u.length&&H.stdout.write(`\n${u.join(`
|
|
67
67
|
`)}\n`)}e.endedAt&&e.result!==void 0&&H.stdout.write(`\n${n.bold(`Result:`)}\n${oe(e.result)}\n`),e.error&&H.stdout.write(`\n${n.red(`error:`)} ${e.error}\n`),wn(e.ledger)}const Nn={wait:v(`follow the run in the foreground (Ctrl-C detaches; it keeps running)`),args:x(`the flow's input as a JSON value (or pass bare key=value pairs)`,`<json>`),concurrency:x(`tasks running at once (default: CPU count)`,`<n>`),"max-tasks":x(`total tasks the run may dispatch (default: CPU count x 10)`,`<n>`),"dry-run":v(`print every resolved prompt and gate command without dispatching`)};function Pn(e){let t={};for(let n of e){let e=n.indexOf(`=`);if(e===-1)throw new C(`invalid-option`,`Invalid argument "${n}": expected key=value.`,{hint:`Help: coder flow run --help`});let r=n.slice(0,e),i=n.slice(e+1);try{t[r]=JSON.parse(i)}catch{t[r]=i}}return t}function Fn(e,t){if(e!==void 0)try{return JSON.parse(e)}catch(e){throw new C(`invalid-option`,`Invalid --args JSON: ${e instanceof Error?e.message:String(e)}`)}return t.length?Pn(t):{}}const In=e=>e?Number(e):void 0,Ln=(e,t)=>({cwd:t,dryRun:e[`dry-run`],concurrency:In(e.concurrency),maxTasks:In(e[`max-tasks`]),detached:!0,wait:e.wait}),Rn=(e,t)=>e[`dry-run`]&&!e.json&&!t?Vn():{},zn=F({name:`run`,description:`run a flow in the background (--wait to follow it live)`,usage:`Run a flow: a TypeScript file that orchestrates many coder tasks with gates,
|
|
68
68
|
journaling, and resume. Prints the run id and orchestrates in the background;
|
|
69
69
|
--wait follows the run in the foreground with live progress (Ctrl-C detaches;
|
|
70
70
|
it keeps running), and \`coder flow watch\` shows the same lines any time.
|
|
71
|
-
Stop a run with \`coder flow stop\`.`,access:`write`,approvalPolicy:`deny`,args:{flow:f().check(S(`the flow: a discovered name or a path`)),inputs:s(`the flow's input as bare key=value pairs`),...Nn},cli:{positional:[`flow`,`inputs`],examples:[`coder flow run audit-routes --wait # run a discovered flow`,`coder flow run ./scratch/one-off.ts --wait # run a flow by path`,`coder flow run verify --args '{"clusters":["a","b"]}' --wait # pass structured input`]},async run({options:e,args:[t,...n],cwd:r,tool:i,next:a}){let{startRun:o}=await import(`./executor-
|
|
71
|
+
Stop a run with \`coder flow stop\`.`,access:`write`,approvalPolicy:`deny`,args:{flow:f().check(S(`the flow: a discovered name or a path`)),inputs:s(`the flow's input as bare key=value pairs`),...Nn},cli:{positional:[`flow`,`inputs`],examples:[`coder flow run audit-routes --wait # run a discovered flow`,`coder flow run ./scratch/one-off.ts --wait # run a flow by path`,`coder flow run verify --args '{"clusters":["a","b"]}' --wait # pass structured input`]},async run({options:e,args:[t,...n],cwd:r,tool:i,next:a}){let{startRun:o}=await import(`./executor-Ds4wDCzV.js`).then(e=>e.A);return Bn(await o(t,{...Ln(e,r),args:Fn(e.args,n)},Rn(e,i)),e,i,a)},next:({result:e})=>Dn(e),print:e=>e.status===`running`?Hn(e):Sn(e)});async function Bn(e,t,n,r){if(e.status!==`running`||!e.watch)return e;if(!n)return Cn(e.watch,t,r);for await(let t of e.watch.events);let i=e.watch.final();if(i.status!==`completed`)throw new C(`flow-failed`,i.error??`Flow ${i.runId} ${i.status}.`,{runId:i.runId,hint:`Resume: coder flow resume ${i.runId}`});return{runId:i.runId,name:i.name,status:`completed`,result:i.result,tokens:i.ledger,taskCount:i.taskCount}}function Vn(){let e=new xn;return{onEvent:t=>e.emit(t)}}function Hn(e){H.stdout.write(`${A.dim(`[flow]`)} run ${A.cyan(e.runId)} started in the background (running).\n`)}const Un=F({name:`resume`,description:`continue a stopped or edited run`,usage:`Re-run a flow from its journal: finished steps replay instantly, the first
|
|
72
72
|
changed or new step onward runs live. Defaults to the most recent run.
|
|
73
|
-
Accepts the same flags as flow run.`,access:`write`,approvalPolicy:`deny`,args:{"run-id":x(`the run (default: the most recent)`),...Nn},cli:{positional:[`run-id`],examples:[`coder flow resume # continue the most recent run`]},async run({options:e,args:[t],cwd:n,tool:r,next:i}){let{resumeRun:a}=await import(`./executor-
|
|
73
|
+
Accepts the same flags as flow run.`,access:`write`,approvalPolicy:`deny`,args:{"run-id":x(`the run (default: the most recent)`),...Nn},cli:{positional:[`run-id`],examples:[`coder flow resume # continue the most recent run`]},async run({options:e,args:[t],cwd:n,tool:r,next:i}){let{resumeRun:a}=await import(`./executor-Ds4wDCzV.js`).then(e=>e.A);return Bn(await a(t,{...Ln(e,n),...e.args===void 0?{}:{args:Fn(e.args,[])}},Rn(e,r)),e,r,i)},next:({result:e})=>Dn(e),print:e=>e.status===`running`?Hn(e):Sn(e)}),Wn=F({name:`stop`,description:`stop a run and its still-running tasks`,usage:`Stop a running flow: signal the orchestrator so it stops dispatching, stamp the
|
|
74
74
|
run stopped, and stop its still-running tasks. Defaults to the most recent run;
|
|
75
|
-
the journal stays ready for \`coder flow resume\`.`,access:`write`,approvalPolicy:`deny`,args:{"run-id":x(`the run (default: the most recent)`),"keep-tasks":v(`leave the run's still-running tasks running`)},cli:{positional:[`run-id`]},run:async({options:e,args:[t]})=>{let{stopRun:n}=await import(`./executor-
|
|
75
|
+
the journal stays ready for \`coder flow resume\`.`,access:`write`,approvalPolicy:`deny`,args:{"run-id":x(`the run (default: the most recent)`),"keep-tasks":v(`leave the run's still-running tasks running`)},cli:{positional:[`run-id`]},run:async({options:e,args:[t]})=>{let{stopRun:n}=await import(`./executor-Ds4wDCzV.js`).then(e=>e.n);return n(t,{keepTasks:e[`keep-tasks`]})},next:({result:e})=>L([`Resume: coder flow resume ${e.runId}`]),print:Gn});function Gn(e){let t=A;e.status===`failed`?H.stdout.write(`${t.dim(`[flow]`)} Run ${t.cyan(e.runId)} orchestrator died. Marked ${O(`failed`)}.\n`):H.stdout.write(`${t.dim(`[flow]`)} run ${t.cyan(e.runId)} ${O(e.status)}.\n`),e.stoppedTasks.length&&H.stdout.write(`${t.dim(`[flow]`)} stopped tasks: ${e.stoppedTasks.join(`, `)}\n`),e.keptTasks.length&&H.stdout.write(`${t.dim(`[flow]`)} left running: ${e.keptTasks.join(`, `)}\n`)}const Kn=I({name:`flow`,description:`orchestrate many coder tasks from one TypeScript file`,usage:`Orchestrate many coder tasks with a plain TypeScript file: dispatch, gates,
|
|
76
76
|
concurrency, journaling, and resume. Flows live in .coder/flows/ (workspace)
|
|
77
77
|
or ~/.coder/flows/ (global). See \`coder docs flows\`.`,commands:[zn,On,sn,An,ln,Wn,Un,an,on],aliases:{stream:`watch`,ls:`list`}}),qn=()=>H.env.CODER_MCP_MODE===`cloud`,Jn=F({name:`mcp`,description:`serve Coder's commands as MCP tools over stdio`,usage:[`Serve Coder's commands as MCP tools over stdio, so a harness can run them.`,``,`Commands return their JSON payloads and next steps. Load docs with load_skill;`,`blocking commands keep their CLI flags and behavior, subject to the client's tool timeout.`].join(`
|
|
78
78
|
`),access:`write`,approvalPolicy:`deny`,globalFlags:{json:!1,cwd:!1},mcp:!1,cli:{examples:[`claude mcp add coder -- coder mcp # run Coder from Claude Code`]},async run(){if(H.stdin.isTTY){H.stdout.write(`coder mcp is the MCP server your host starts; it waits for an MCP client on stdin.
|
|
79
79
|
Add it to your host with \`coder setup-host\`, or by hand: claude mcp add coder -- coder mcp
|
|
80
|
-
`);return}let{app:e,cloudApp:t}=await import(`./context-
|
|
80
|
+
`);return}let{app:e,cloudApp:t}=await import(`./context-DVGPu7f_.js`),{serve:n}=await import(`./serve-DoYbHm_k.js`);await n(qn()?t:e,`stdio`)}}),$=v(`target <repo>/.coder/config.json instead of the user file`),Yn=b(n(_().check(i(),e())),`the model's context window in tokens; filled from the provider when it reports one`,`<tokens>`),Xn=e=>({baseUrl:e[`base-url`],model:e.model,envKey:e[`env-key`],contextWindow:e[`context-window`],workspace:e.workspace}),Zn=F({name:`add`,description:`connect a model`,usage:`Connect a custom model behind an OpenAI-compatible endpoint (Ollama, LM Studio,
|
|
81
81
|
vLLM, OpenRouter, ...). It currently runs on the codex engine pointed at your
|
|
82
82
|
URL and is usable anywhere a model is: --model <name> or --model custom/<name>, or as an
|
|
83
|
-
agent default in config. Alias: \`coder model setup\`.`,access:`write`,approvalPolicy:{handoff:{page:`/settings/models`,label:`Add the model`,action:`add`,args:[`name`,`base-url`,`model`,`env-key`,`context-window`]}},args:{name:x(`the name to dispatch it by`),"base-url":x(`OpenAI-compatible API base (e.g. http://localhost:11434/v1)`,`<url>`),model:x(`the provider's model id (e.g. qwen2.5-coder:32b)`,`<id>`),"env-key":x(`env var holding the API key (omit for keyless local endpoints)`,`<VAR>`),"context-window":Yn,workspace:v(`write to <repo>/.coder/config.json instead of the user file`)},cli:{positional:[`name`],examples:[`coder model add qwen --base-url http://localhost:11434/v1 --model qwen2.5-coder:32b # local Ollama model, no key`,`coder model add kimi --base-url https://openrouter.ai/api/v1 --model moonshotai/kimi-k2 --env-key OPENROUTER_API_KEY # third-party provider via OpenRouter`,`coder run --model qwen "explain this repo" # dispatch a task on it`]},run:async({options:e,args:[t],cwd:n})=>{let{models:r}=await import(`./models-
|
|
83
|
+
agent default in config. Alias: \`coder model setup\`.`,access:`write`,approvalPolicy:{handoff:{page:`/settings/models`,label:`Add the model`,action:`add`,args:[`name`,`base-url`,`model`,`env-key`,`context-window`]}},args:{name:x(`the name to dispatch it by`),"base-url":x(`OpenAI-compatible API base (e.g. http://localhost:11434/v1)`,`<url>`),model:x(`the provider's model id (e.g. qwen2.5-coder:32b)`,`<id>`),"env-key":x(`env var holding the API key (omit for keyless local endpoints)`,`<VAR>`),"context-window":Yn,workspace:v(`write to <repo>/.coder/config.json instead of the user file`)},cli:{positional:[`name`],examples:[`coder model add qwen --base-url http://localhost:11434/v1 --model qwen2.5-coder:32b # local Ollama model, no key`,`coder model add kimi --base-url https://openrouter.ai/api/v1 --model moonshotai/kimi-k2 --env-key OPENROUTER_API_KEY # third-party provider via OpenRouter`,`coder run --model qwen "explain this repo" # dispatch a task on it`]},run:async({options:e,args:[t],cwd:n})=>{let{models:r}=await import(`./models-mKyePWrV.js`).then(e=>e.r);return r.add(t,{...Xn(e),cwd:n})},json:Qn,next:({result:e})=>er(e),print:(e,{next:t})=>$n(e,`saved`,()=>t(e,{slot:`codex`}))});function Qn({name:e,entry:t,file:n,probe:r,codex:i,install:a,ready:o}){return{name:e,...t,file:n,probe:r,codex:i,...a?{codexInstall:a}:{},ready:o}}function $n({name:e,entry:t,file:n,probe:r,codex:i,install:a,nativeResponses:o,keyMissing:s},c,l){let u=A,d=e=>` ${u.green(`✔`)} ${e}`,f=e=>` ${u.red(`✘`)} ${e}`,p=[`${c} ${u.cyan(e)} -> ${t.model} @ ${t.baseUrl}${t.contextWindow?`, ${t.contextWindow} tokens`:``} ${u.dim(`(${n})`)}`,``,r.reachable?d(`${r.detail} ${u.dim(`(${o?`responses api, direct`:`chat api, auto-translated`})`)}`):f(r.detail),i.available?d(a?.installed?`${a.note} ${u.dim(`(${i.detail})`)}`:`codex engine ${u.dim(`(${i.detail})`)}`):a?.note?f(a.note):null];p.at(-1)===null&&(p.pop(),H.stdout.write(`${p.join(`
|
|
84
84
|
`)}\n`),p.length=0,l()),s&&p.push(f(`env var ${t.envKey} is not set in this shell`)),p.length&&H.stdout.write(`${p.join(`
|
|
85
85
|
`)}\n`)}function er({name:e,codex:t,install:n}){return[...!t.available&&!n?.note?[{usage:`npm install -g @openai/codex`,blurb:`codex CLI not installed`,cli:{text:` ${A.red(`✘`)} codex CLI not installed - run: npm install -g @openai/codex`,layout:`plain`,prefix:``,slot:`codex`}}]:[],...L([`Use it: coder run --model ${e} "<task>"`,`Make default: coder config set engines.custom.model ${e}`],{layout:`plain`,dim:!0})]}const tr=F({name:`alias`,description:`name a spec, e.g. fast codex/luna`,usage:`Save an alias for an engine spec, e.g. fast -> codex/luna. An alias may reuse a
|
|
86
|
-
built-in name to override it; an engine name sets what that bare engine runs.`,access:`write`,approvalPolicy:`ask`,args:{name:x(`the alias`),spec:x(`the engine spec, such as codex/luna`),workspace:$},cli:{positional:[`name`,`spec`]},run:async({options:e,args:[t,n],cwd:r})=>{let{models:i}=await import(`./models-
|
|
87
|
-
models on this machine are probed; --server lists the workspace's.`,access:`read`,args:o,run:async({options:e,cwd:t})=>{let{models:n}=await import(`./models-
|
|
88
|
-
`).trimEnd()}\n`)}const ur=F({name:`unalias`,description:`remove an alias`,usage:`Remove a user-defined alias.`,access:`write`,approvalPolicy:{handoff:{page:`/settings/models`,label:`Remove the alias`,action:`delete`,args:[`name`],button:`Remove`}},args:{name:x(`the alias`),workspace:$},cli:{positional:[`name`]},run:async({options:e,args:[t],cwd:n})=>{let{models:r}=await import(`./models-
|
|
89
|
-
is re-probed and the wire protocol re-detected.`,access:`write`,approvalPolicy:`ask`,args:{name:x(`the custom model`),"base-url":x(`new API base`,`<url>`),model:x(`new provider model id`,`<id>`),"env-key":x(`new API-key env var`,`<VAR>`),"context-window":Yn,workspace:v(`write to <repo>/.coder/config.json instead of the user file`)},cli:{positional:[`name`]},run:async({options:e,args:[t],cwd:n})=>{let{models:r}=await import(`./models-
|
|
86
|
+
built-in name to override it; an engine name sets what that bare engine runs.`,access:`write`,approvalPolicy:`ask`,args:{name:x(`the alias`),spec:x(`the engine spec, such as codex/luna`),workspace:$},cli:{positional:[`name`,`spec`]},run:async({options:e,args:[t,n],cwd:r})=>{let{models:i}=await import(`./models-mKyePWrV.js`).then(e=>e.r);return i.alias(t,n,{...e,cwd:r})},print:e=>`alias`in e&&nr(e)});function nr(e){let t=A;H.stdout.write(`aliased ${t.cyan(e.alias)} -> ${e.model} ${t.dim(`(${e.file})`)}\n`)}const rr=F({name:`remove`,description:`delete a custom model`,usage:`Remove a configured custom model.`,access:`write`,approvalPolicy:{handoff:{page:`/settings/models`,label:`Remove the model`,action:`delete`,args:[`name`],button:`Remove`}},args:{name:x(`the custom model`),workspace:$},cli:{positional:[`name`]},run:async({options:e,args:[t],cwd:n})=>{let{models:r}=await import(`./models-mKyePWrV.js`).then(e=>e.r);return r.remove(t,{...e,cwd:n})},print:e=>ir(`removed`,e.removed,e.file)});function ir(e,t,n){H.stdout.write(`${e} ${A.cyan(t)} ${A.dim(`(${n})`)}\n`)}const ar=(e,t,n)=>F({name:e?`disable`:`enable`,description:t,usage:n,access:`write`,approvalPolicy:`ask`,args:{name:x(`a built-in, custom model, or alias`),workspace:$},cli:{positional:[`name`]},run:async({options:t,args:[n],cwd:r})=>{let{models:i}=await import(`./models-mKyePWrV.js`).then(e=>e.r);return i[e?`disable`:`enable`](n,{...t,cwd:r})},json:t=>`file`in t?{[e?`disabled`:`enabled`]:t.name,file:t.file}:t,print:t=>`file`in t&&ir(e?`disabled`:`enabled`,t.name,t.file)}),or=ar(!0,`turn off a model (built-in, custom, or alias)`,`Disable a model - built-in, custom, or alias. Requests for it fail until re-enabled.`),sr=ar(!1,`re-enable a disabled model`),cr=F({name:`list`,description:`list built-ins, custom models, and aliases`,usage:`List built-in aliases, configured custom models, and user aliases. Only custom
|
|
87
|
+
models on this machine are probed; --server lists the workspace's.`,access:`read`,args:o,run:async({options:e,cwd:t})=>{let{models:n}=await import(`./models-mKyePWrV.js`).then(e=>e.r);return n.list({...e,cwd:t})},next:()=>L([`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>"`]),print:lr});function lr(e){let t=A,n=e=>e?` ${t.dim(`(disabled)`)}`:``,r=[],i=(e,i)=>{r.push(t.bold(e));for(let e of i)`overrides`in e?r.push(` ${e.disabled?t.dim(`∅`):t.cyan(`↳`)} ${e.alias.padEnd(14)} ${t.dim(`-> ${e.spec} (overrides ${e.overrides})`)}${n(e.disabled)}`):`builtin`in e?r.push(` ${e.disabled?t.dim(`∅`):t.green(`✔`)} ${e.alias.padEnd(14)} ${t.dim(`-> ${e.model}`)}${n(e.disabled)}`):r.push(` ${e.disabled?t.dim(`∅`):t.cyan(`↳`)} ${e.alias.padEnd(14)} ${t.dim(`-> ${e.spec}`)}${n(e.disabled)}`);r.push(``)};i(`Codex models`,e.codex),i(`Claude models`,e.claude),r.push(t.bold(`Custom models`),``),e.custom.length||r.push(t.dim(` None.`));for(let{name:i,probe:a,...o}of e.custom){let e=o.disabled?t.dim(`∅`):a?a.reachable?t.green(`✔`):t.red(`✘`):t.dim(`·`);r.push(` ${e} ${i.padEnd(14)} ${o.model} ${t.dim(`@ ${o.baseUrl}${o.contextWindow?`, ${o.contextWindow} tokens`:``}.${a?` ${a.detail}`:``}`)}${n(o.disabled)}`)}if(r.push(``),e.toggles){r.push(t.bold(`Other`),``);for(let i of e.toggles)r.push(` ${i.disabled?t.dim(`∅`):t.green(`✔`)} ${i.name.padEnd(14)} ${t.dim(`raw model id`)}${n(i.disabled)}`);r.push(``)}H.stdout.write(`${r.join(`
|
|
88
|
+
`).trimEnd()}\n`)}const ur=F({name:`unalias`,description:`remove an alias`,usage:`Remove a user-defined alias.`,access:`write`,approvalPolicy:{handoff:{page:`/settings/models`,label:`Remove the alias`,action:`delete`,args:[`name`],button:`Remove`}},args:{name:x(`the alias`),workspace:$},cli:{positional:[`name`]},run:async({options:e,args:[t],cwd:n})=>{let{models:r}=await import(`./models-mKyePWrV.js`).then(e=>e.r);return r.unalias(t,{...e,cwd:n})},print:e=>ir(`unaliased`,e.unaliased,e.file)}),dr=F({name:`update`,description:`change a model in place`,usage:`Update a configured custom model. Only the flags you pass change; the endpoint
|
|
89
|
+
is re-probed and the wire protocol re-detected.`,access:`write`,approvalPolicy:`ask`,args:{name:x(`the custom model`),"base-url":x(`new API base`,`<url>`),model:x(`new provider model id`,`<id>`),"env-key":x(`new API-key env var`,`<VAR>`),"context-window":Yn,workspace:v(`write to <repo>/.coder/config.json instead of the user file`)},cli:{positional:[`name`]},run:async({options:e,args:[t],cwd:n})=>{let{models:r}=await import(`./models-mKyePWrV.js`).then(e=>e.r),{server:i}=e;return r.update(t,{...Xn(e),cwd:n,server:i})},json:e=>`entry`in e?Qn(e):e,next:({result:e})=>`entry`in e?er(e):[],print:(e,{next:t})=>`entry`in e&&$n(e,`updated`,()=>t(e,{slot:`codex`}))}),fr=I({name:`model`,description:`manage models: built-ins, aliases, custom endpoints`,usage:"Manage the models coder can dispatch to. `add` connects any OpenAI-compatible\nendpoint (Ollama, vLLM, OpenRouter, ...) as the custom engine, alongside the\nbuilt-in codex/claude models. Name your own shortcuts with `alias`\n(e.g. fast -> codex/luna); disable/enable turns any model off and on.",commands:[cr,Zn,dr,rr,or,sr,tr,ur],aliases:{ls:`list`}}),pr=F({name:`review`,description:`review changed code with a built-in flow`,usage:`Review changed code with a read-only agent. Every reported finding is checked
|
|
90
90
|
against the repository. Runs the built-in \`review\` flow. A local review covers
|
|
91
91
|
everything since the merge-base with the origin default branch, including
|
|
92
92
|
uncommitted and untracked files. Changed submodules are reviewed file by file.
|
|
93
|
-
PR reviews can post
|
|
93
|
+
PR reviews can post one review with inline comments, never repeating a finding.
|
|
94
94
|
|
|
95
|
-
Related: \`coder flow watch\`, \`coder docs review\`.`,access:`write`,approvalPolicy:`deny`,args:{base:x(`local comparison base (default: merge-base with origin default)`,`<ref>`),head:x(`review commits through this ref only (default: the working tree)`,`<ref>`),pr:x(`review a pull request by number (origin repo) or URL; GitHub via gh for now`,`<n|url>`),since:x(`keep only PR files and hunks changed since this commit`,`<sha>`),path:s(`review only this path, relative to cwd (repeatable)`,`<p>`),exclude:s(`leave this path out, relative to cwd (repeatable)`,`<p>`),post:v(`post
|
|
96
|
-
`);for(let n of e.warnings)H.stdout.write(` ${t.yellow(`!`)} ${n}\n`);e.cacheMigration?.then(e=>{(e.tasks||e.flows||e.files)&&H.stdout.write(`\n moved ${e.tasks.toLocaleString(`en-US`)} archived tasks to ${e.cache}\n`)}).catch(e=>H.stderr.write(`\n Cache migration failed: ${e instanceof Error?e.message:String(e)}\n`))}const Dr=F({name:`serve`,description:`run the server`,usage:`Run the Coder server on Bun: the address platforms deliver events to, the dashboard, and the worker that runs tasks. With DATABASE_URL it is a full server with sign-in and workspaces. Without one it is the dashboard for this machine's CLI: its config, agents, tasks and engine logins, on loopback only. --memory makes a throwaway test server that keeps everything in memory. Configured through the environment; every variable is in coder docs self-host.`,access:`write`,approvalPolicy:`deny`,args:{port:b(n(_().check(i(),e())),`listen port (default: PORT, else the port in a localhost PUBLIC_URL, else 8787)`,`<n>`),host:x(`listen address (default: HOST, else 127.0.0.1 without a database, else every interface)`,`<address>`),memory:v(`a throwaway test server: everything in memory, no sign-in, admin token only`),runner:x(`local, local-docker, vercel-sandbox, github-actions, or http`,`<name>`)},mcp:!1,cli:{env:[[`PUBLIC_URL`,`the address platforms and browsers reach the server at (default http://localhost:<port>)`],[`PORT`,`listen port, as hosts set it (default 8787)`],[`HOST`,`listen address, as --host`],[`DATABASE_URL`,`Postgres, set up with drizzle-kit push; turns on sign-in and workspaces`],[`AUTH_WULAR_URL`,`the Wular Auth issuer people sign in with (default https://auth.wular.ai)`],[`SERVER_ENCRYPTION_KEY`,`encrypts stored secrets and derives the sign-in keys; required with DATABASE_URL (openssl rand -base64 32)`],[`RUNNER`,`where tasks run: local (default), local-docker, vercel-sandbox, github-actions, http`],[`MAX_TASKS, TASK_TIMEOUT, TASK_STALL, TASK_ATTEMPTS`,`runner capacity and lifecycle limits`],[`ADMIN_TOKEN`,`local and memory servers: the dashboard and CLI key; minted and shown when unset`],[`CODER_CACHE_HOME`,`archived tasks, flows and usage (default OS cache directory/wular-coder)`],[`WORK_DIR`,`where the local runner keeps task work folders`],[`SERVER_NAME`,`what the dashboard calls this server (default Coder)`]],examples:[`PUBLIC_URL=https://abc.ngrok.app coder server serve # receive GitHub and Slack events through a tunnel; the tunnel serves only their webhooks and callbacks`,`PUBLIC_URL=https://agents.example.com DATABASE_URL=postgres://... coder server serve # on your own host, backed by Postgres`]},async run({options:e,cwd:t}){let{rerunUnderBun:n}=await import(`./env-
|
|
95
|
+
Related: \`coder flow watch\`, \`coder docs review\`.`,access:`write`,approvalPolicy:`deny`,args:{base:x(`local comparison base (default: merge-base with origin default)`,`<ref>`),head:x(`review commits through this ref only (default: the working tree)`,`<ref>`),pr:x(`review a pull request by number (origin repo) or URL; GitHub via gh for now`,`<n|url>`),since:x(`keep only PR files and hunks changed since this commit`,`<sha>`),path:s(`review only this path, relative to cwd (repeatable)`,`<p>`),exclude:s(`leave this path out, relative to cwd (repeatable)`,`<p>`),post:v(`post the review on the pull request, as the signed-in gh user`),run:x(`with --post, post this finished review run instead of reviewing again`,`<id>`),md:v(`markdown output (the default)`),model:r(`for the review task (default: reviewModel)`),depth:b(n(u([`low`,`medium`,`high`])),`what to report: low only critical and major, high nits too (default: medium)`,`<low|medium|high>`)},cli:{examples:[`coder review # review the branch plus uncommitted work`,`coder review --base main # review everything since main locally`,`coder review --path src --exclude src/gen # review src without generated code`,`coder review --pr 42 --post # review and post to pull request 42`,`coder review --depth high # report nits too`,`coder review --post --run <id> # post a finished review run`]},async run({options:e,cwd:t}){let{review:n}=await import(`./executor-Ds4wDCzV.js`).then(e=>e.n);if(e.json&&e.md)throw new C(`invalid-option`,`--json and --md are mutually exclusive.`);let{run:r,md:i,json:a,...o}=e;if(r===void 0)return n.run({...o,cwd:t});if(!o.post)throw new C(`invalid-option`,`--run needs --post.`);let{postReviewRun:s}=await import(`./flow/builtin/review/index.js`);return s(r,t)},print:async e=>{let{renderReviewMarkdown:t}=await import(`./flow/builtin/review/index.js`);H.stdout.write(t(e))}}),mr=F({name:`add`,description:`connect a runner`,usage:`Connect a runner. Secret fields read environment variables with key=env:VARIABLE. Adding local prints a pairing command.`,access:`write`,approvalPolicy:{handoff:{page:`/settings/runners`,label:`Add the runner`,action:`add`,args:[`kind`,`name`,`scope`]}},args:{kind:f().check(S(`the runner kind, such as local or http`)),name:x(`runner display name`),scope:x(`personal or workspace`),field:s(`repeat for each field, use env:VARIABLE for secrets`,`key=value`),...h},globalFlags:{cwd:!1},cli:{positional:[`kind`]},async run({options:e,args:[t]}){let{addRunnerFields:n}=await import(`./runner-DK0jnzPr.js`).then(e=>e.t);return n(t,e)},print:e=>H.stdout.write(`${`command`in e?e.command:`Added ${e.name} (${e.id}).`}\n`)}),hr=F({name:`default`,description:`set the default in its scope`,usage:`Use this runner by default within its scope.`,access:`write`,approvalPolicy:`ask`,args:{id:f().check(S(`the runner`)),...h},globalFlags:{cwd:!1},cli:{positional:[`id`]},async run({options:e,args:[t]}){let{runners:n}=await import(`./runner-DK0jnzPr.js`).then(e=>e.t);return n.default(t,e)},print:e=>H.stdout.write(`Default runner ${e.name}.\n`)});function gr({items:e}){if(!e.length)return void H.stdout.write(`${A.dim(`No runners.`)}\n`);H.stdout.write(`${E([{header:`id`,value:e=>e.id,paint:e=>A.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,A)}\n`)}const _r=F({name:`list`,description:`list your runners and the workspace's`,access:`read`,args:h,globalFlags:{cwd:!1},run:async({options:e})=>{let{listRunners:t}=await import(`./runner-DK0jnzPr.js`).then(e=>e.t);return t(e)},print:gr}),vr=F({name:`remove`,description:`remove a runner`,access:`write`,approvalPolicy:{handoff:{page:`/settings/runners`,label:`Remove the runner`,action:`delete`,args:[`id`],button:`Remove`}},args:{id:f().check(S(`the runner`)),...h},globalFlags:{cwd:!1},cli:{positional:[`id`]},async run({options:e,args:[t]}){let{removeRunner:n}=await import(`./runner-DK0jnzPr.js`).then(e=>e.t);return n(t,e)},print:(e,{args:[t]})=>H.stdout.write(`Removed ${A.bold(t)}.\n`)}),yr=F({name:`rename`,description:`rename a runner`,access:`write`,approvalPolicy:`deny`,args:{id:f().check(S(`the runner`)),name:f().check(S(`its new name`)),...h},globalFlags:{cwd:!1},cli:{positional:[`id`,`name`]},async run({options:e,args:[t,n]}){let{runners:r}=await import(`./runner-DK0jnzPr.js`).then(e=>e.t);return r.rename(t,n,e)},print:(e,{args:[t]})=>H.stdout.write(`Renamed ${t} to ${A.bold(e.name)}.\n`)}),br=F({name:`serve`,description:`run your server's tasks on this machine`,usage:`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.`,access:`write`,approvalPolicy:`deny`,args:{url:x(`the HTTPS address the server reaches this runner at`,`<public url>`),token:x(`one-use pairing token, --url is the Coder server`,`<token>`),"runner-url":x(`public tunnel address when pairing, or CODER_RUNNER_URL`,`<url>`),port:b(n(_().check(i(),e())),`local port the tunnel forwards to (default 4100)`,`<n>`),name:x(`shown in the dashboard (default: this machine's hostname)`),workspace:v(`run every member's tasks, not only yours (owners and admins)`),...h},mcp:!1,cli:{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`]},async run({options:e}){let{serveRunner:t}=await import(`./serve-DHe6dZM6.js`).then(e=>e.n),n=await t({...e,runnerUrl:e[`runner-url`]}),r=()=>void n.close().finally(()=>H.exit(0));return H.once(`SIGINT`,r),H.once(`SIGTERM`,r),n},json:({server:e,close:t,...n})=>({ok:!0,...n}),next:()=>L([`Tasks run here with this machine's own claude and codex logins`,`Stop with Ctrl-C; the server marks the runner offline`],{prefix:``,paint:`cyan`}),print:e=>H.stdout.write(`Runner ${A.bold(e.name)} serves ${e.server} at ${A.cyan(e.config.url??``)} (${e.scope}), listening on localhost:${e.port}.\n`)}),xr=F({name:`test`,description:`check a runner connection`,usage:`Check the runner connection.`,access:`read`,approvalPolicy:`deny`,args:{id:f().check(S(`the runner`)),...h},globalFlags:{cwd:!1},cli:{positional:[`id`]},async run({options:e,args:[t]}){let{testRunner:n}=await import(`./runner-DK0jnzPr.js`).then(e=>e.t);return n(t,e)},print:e=>H.stdout.write(`${e.ok?`OK`:`Failed`} ${e.detail} (${e.ms} ms).\n`)}),Sr=I({name:`runner`,description:`run your server's tasks on this machine`,usage:`Run your Coder server's tasks on your own machine, reached through any tunnel.`,commands:[mr,hr,xr,br,_r,yr,vr]}),Cr=F({name:`create`,description:`create the built-in agent's public app`,usage:`Open the page that creates the built-in agent's public app on a platform, once per server. Every workspace then connects it from its dashboard with one click. Run it where the server's environment is set.`,access:`write`,approvalPolicy:`deny`,args:{integration:f().check(S(`the platform, such as github`)),org:x(`create it under this organization instead of your own account`),name:x(`the app's name and handle (default Coder)`)},globalFlags:{cwd:!1},cli:{positional:[`integration`],env:[[`DATABASE_URL`,`the server's Postgres`],[`PUBLIC_URL`,`the server's address, which goes into the app`]],examples:[`coder server app create github --name wular-coder # the hosted GitHub App`]},async run({options:e,args:[t]}){let{serverAppLink:n}=await import(`./apps-CCqOsEZH.js`).then(e=>e.t);return n(t,{owner:e.org,name:e.name})},json:({url:e})=>({ok:!0,url:e}),print({url:e}){H.stdout.write(`Open this page to create the app (valid 10 minutes):\n${e}\n`),pe(e)}}),wr=I({name:`app`,description:`the built-in agent's public apps`,usage:`The built-in agent's apps, one per platform, shared by every workspace on this server.`,commands:[Cr]}),Tr=F({name:`rotate-key`,description:`re-seal secrets with SERVER_ENCRYPTION_KEY`,usage:`Re-seal stored app, installation, engine, and linked user secrets with the current key.`,access:`write`,approvalPolicy:`deny`,globalFlags:{cwd:!1},cli:{env:[[`SERVER_ENCRYPTION_KEY`,`the new key`],[`SERVER_ENCRYPTION_KEY_PREVIOUS`,`the old key, still accepted while rotating`]]},run:async()=>{let{rotateKey:e}=await import(`./maintenance-BuDKnfc7.js`);return e()},json:({moved:e})=>({ok:!0,moved:e}),print:({moved:e})=>H.stdout.write(`Re-sealed ${e} secret${e===1?``:`s`}.\n`)});function Er(e){let t=A,n=[...e.publicUrl===e.address?[]:[[`public`,e.publicUrl]],[`store`,e.database??(e.mode===`local`?we():e.store)],[`runner`,e.runner],...e.signIn?[[`sign-in`,e.signIn]]:[],...e.mintedToken?[[`token`,e.mintedToken]]:[]],r=Math.max(...n.map(([e])=>e.length))+2;H.stdout.write(`${t.bold({local:`Coder local server`,memory:`Coder test server`,cloud:`Coder server`}[e.mode])} ${t.dim(`listening on ${e.address}`)}\n`);for(let[e,i]of n)H.stdout.write(` ${t.light(e.padEnd(r))}${i}\n`);e.warnings.length&&H.stdout.write(`
|
|
96
|
+
`);for(let n of e.warnings)H.stdout.write(` ${t.yellow(`!`)} ${n}\n`);e.cacheMigration?.then(e=>{(e.tasks||e.flows||e.files)&&H.stdout.write(`\n moved ${e.tasks.toLocaleString(`en-US`)} archived tasks to ${e.cache}\n`)}).catch(e=>H.stderr.write(`\n Cache migration failed: ${e instanceof Error?e.message:String(e)}\n`))}const Dr=F({name:`serve`,description:`run the server`,usage:`Run the Coder server on Bun: the address platforms deliver events to, the dashboard, and the worker that runs tasks. With DATABASE_URL it is a full server with sign-in and workspaces. Without one it is the dashboard for this machine's CLI: its config, agents, tasks and engine logins, on loopback only. --memory makes a throwaway test server that keeps everything in memory. Configured through the environment; every variable is in coder docs self-host.`,access:`write`,approvalPolicy:`deny`,args:{port:b(n(_().check(i(),e())),`listen port (default: PORT, else the port in a localhost PUBLIC_URL, else 8787)`,`<n>`),host:x(`listen address (default: HOST, else 127.0.0.1 without a database, else every interface)`,`<address>`),memory:v(`a throwaway test server: everything in memory, no sign-in, admin token only`),runner:x(`local, local-docker, vercel-sandbox, github-actions, or http`,`<name>`)},mcp:!1,cli:{env:[[`PUBLIC_URL`,`the address platforms and browsers reach the server at (default http://localhost:<port>)`],[`PORT`,`listen port, as hosts set it (default 8787)`],[`HOST`,`listen address, as --host`],[`DATABASE_URL`,`Postgres, set up with drizzle-kit push; turns on sign-in and workspaces`],[`AUTH_WULAR_URL`,`the Wular Auth issuer people sign in with (default https://auth.wular.ai)`],[`SERVER_ENCRYPTION_KEY`,`encrypts stored secrets and derives the sign-in keys; required with DATABASE_URL (openssl rand -base64 32)`],[`RUNNER`,`where tasks run: local (default), local-docker, vercel-sandbox, github-actions, http`],[`MAX_TASKS, TASK_TIMEOUT, TASK_STALL, TASK_ATTEMPTS`,`runner capacity and lifecycle limits`],[`ADMIN_TOKEN`,`local and memory servers: the dashboard and CLI key; minted and shown when unset`],[`CODER_CACHE_HOME`,`archived tasks, flows and usage (default OS cache directory/wular-coder)`],[`WORK_DIR`,`where the local runner keeps task work folders`],[`SERVER_NAME`,`what the dashboard calls this server (default Coder)`]],examples:[`PUBLIC_URL=https://abc.ngrok.app coder server serve # receive GitHub and Slack events through a tunnel; the tunnel serves only their webhooks and callbacks`,`PUBLIC_URL=https://agents.example.com DATABASE_URL=postgres://... coder server serve # on your own host, backed by Postgres`]},async run({options:e,cwd:t}){let{rerunUnderBun:n}=await import(`./env-BwFCHakK.js`).then(e=>e.t);if(await n(),e.memory&&!H.env.ADMIN_TOKEN&&!H.stdout.isTTY)throw new C(`invalid-option`,`Memory server needs an admin token: set ADMIN_TOKEN, or run in a terminal to get a printed one.`);let{serve:r}=await import(`./serve-Cqlkgdfd.js`),i=await r({cwd:t,port:e.port,...e.host?{host:e.host}:{},...e.runner?{runner:e.runner}:{},...e.memory?{memory:!0}:{}}),a=()=>void i.close().finally(()=>H.exit(0));return H.once(`SIGINT`,a),H.once(`SIGTERM`,a),i},json:e=>({ok:!0,address:e.address,publicUrl:e.publicUrl,runner:e.runner,store:e.store,mode:e.mode,maxTasks:e.maxTasks,...e.signIn?{signIn:e.signIn}:{},...e.mintedToken?{adminToken:e.mintedToken}:{},warnings:e.warnings}),next:({result:e})=>e.mode===`memory`?L([`the CLI reaches this server with its token in ADMIN_TOKEN: coder task list --server ${e.publicUrl}`]):[],print:Er,afterNext(e){let t=A;if(e.dashboard){let n=H.stdout.isTTY&&pe(e.dashboard);H.stdout.write(n?`\nOpening the dashboard in your browser. If it doesn't open, go to:\n ${e.dashboard}\n`:`\n ${t.light(`dashboard`)} ${e.dashboard}\n`)}}}),Or=F({name:`workflow`,description:`print the GitHub Actions workflow for RUNNER=github-actions`,usage:`Print the workflow the github-actions runner dispatches. Save it as .github/workflows/coder-agent.yml in every repo the agent runs on, and set RUNNER=github-actions on the server.`,access:`read`,approvalPolicy:`deny`,globalFlags:{json:!1,cwd:!1},cli:{examples:[`coder server workflow > .github/workflows/coder-agent.yml # add it to a repo`]},run:async()=>{let{actionsWorkflow:e}=await import(`./github-actions-2RjyRseX.js`).then(e=>e.i);return e()},print:e=>H.stdout.write(e)}),kr=I({name:`server`,description:`self-host Coder: the server, its dashboard and sign-in`,usage:`Self-host Coder: the server your agents and platform apps talk to, with a dashboard and sign-in. We run one as the hosted service; you can run your own.`,namespaces:[wr],commands:[Dr,Tr,Or]}),Ar=F({name:`setup-host`,description:`check engines and install the host plugin or skill`,usage:`Set up coder in your host: check engines and auth, seed the config, and
|
|
97
97
|
install the host plugin/skill for the named host(s). Claude Code gets its
|
|
98
98
|
marketplace plugin; "agents" installs a skill into ~/.agents/skills for
|
|
99
99
|
every host that reads the Agent Skills standard dir (Codex, Pi, OpenCode,
|
|
@@ -102,21 +102,21 @@ With no host, checks, seeds and registers available Codex and Cursor hosts.
|
|
|
102
102
|
|
|
103
103
|
To add the MCP server by hand: claude mcp add coder -- coder mcp, codex mcp
|
|
104
104
|
add coder -- coder mcp, or for Cursor "coder": { "command": "coder", "args":
|
|
105
|
-
["mcp"] } under mcpServers in ~/.cursor/mcp.json. Restart running sessions after.`,access:`write`,approvalPolicy:`deny`,args:{hosts:s(`claude, agents, codex, cursor (one or more)`)},cli:{positional:[`hosts`],examples:[`coder setup-host claude # install the Claude Code plugin`,`coder setup-host agents # install the shared skill and register MCP with available Codex`,`coder setup-host codex cursor # install the skill and register MCP with both hosts`]},run:async({options:e,args:t,cwd:n,tool:r})=>{let{setupHostCore:i}=await import(`./dispatch-
|
|
105
|
+
["mcp"] } under mcpServers in ~/.cursor/mcp.json. Restart running sessions after.`,access:`write`,approvalPolicy:`deny`,args:{hosts:s(`claude, agents, codex, cursor (one or more)`)},cli:{positional:[`hosts`],examples:[`coder setup-host claude # install the Claude Code plugin`,`coder setup-host agents # install the shared skill and register MCP with available Codex`,`coder setup-host codex cursor # install the skill and register MCP with both hosts`]},run:async({options:e,args:t,cwd:n,tool:r})=>{let{setupHostCore:i}=await import(`./dispatch-BkoIU4GU.js`).then(e=>e.k);return i(n,{...e,hosts:t},()=>e.json||r||jr())},next({result:e}){return[...[`codex`,`claude`].flatMap(t=>Nr(e,t)),...L([`custom models (local/provider endpoints): coder model --help`],{layout:`plain`,dim:!0,prefix:` `,slot:`models`}),...L([`(coder config set <key> <value> to change)`],{layout:`plain`,dim:!0,prefix:` ${A.dim(e.configFile)} `,slot:`config`}).map(e=>({...e,usage:`coder config set <key> <value>`})),...L([e.ready?`ready - try: coder run --wait "explain this repo's layout"`:`not ready - install an engine CLI to run tasks: codex (npm install -g @openai/codex, then codex login) or claude (npm install -g @anthropic-ai/claude-code, then claude auth login)`],{layout:e.ready?`good`:`bad`,prefix:``})]},print:(e,{next:t})=>Mr(e,t)});function jr(){H.stdout.write(`${A.bold(`Coder host setup`)}\n\n`)}function Mr(e,t){let n=A.bold,r=A.dim,{codex:i,codexUpdate:a,config:o,claudePlugin:s,agentsSkill:c}=e,l=[];H.stdout.write(`${n(`Available Engines`)}\n`);for(let n of[`codex`,`claude`]){let i=e[n];!i.available||!i.loggedIn?t(e,{slot:n}):H.stdout.write(`${T(`${n.padEnd(8)}${r(`${i.detail}; ${i.auth}`)}`)}\n`)}t(e,{slot:`models`}),a?.updated?l.push(T(`codex ${r(`updated ${a.from} -> ${i.detail} (GPT-6 support)`)}`)):a&&l.push(M(`codex ${a.note}`)),l.push(``),l.push(n(`Config`),` chain: ${o.chain.join(` -> `)} review: ${o.reviewModel}`),H.stdout.write(`${l.join(`
|
|
106
106
|
`)}\n`),l.length=0,t(e,{slot:`config`}),l.push(``);let u=[[`claude plugin`,s??null],[`agents skill `,c??null]];for(let[e,t]of u)t&&l.push(t.installed?T(`${e} ${r(t.note)}`):M(`${e} ${t.note}`),``);l.push(...e.mcp.map(e=>e.installed?T(e.note):M(e.note))),l.length&&H.stdout.write(`${l.join(`
|
|
107
|
-
`)}\n`)}function Nr(e,t){let n=e[t];if(n.available&&n.loggedIn)return[];let r=n.available?t===`codex`?`codex login`:`claude auth login`:`npm install -g ${t===`codex`?`@openai/codex`:`@anthropic-ai/claude-code`}`,i=n.available?`${t.padEnd(8)}not logged in${t===`codex`?` ${A.dim(`(${n.auth})`)}`:``} - run: ${r}`:`${t.padEnd(8)}CLI not installed - run: ${r}`;return[{usage:r,blurb:`${t} ${n.available?`not logged in`:`CLI not installed`}`,cli:{text:i,layout:`bad`,prefix:``,slot:t}}]}const Pr={accept:`approved`,decline:`denied`,closed:`stopped`},Fr=e=>e.answered?Pr[e.answered]:`pending`,Ir=e=>e.scope?` ${A.dim(`${e.approvers} approves this ${e.scope} change`)}`:``;function Lr(e,t){let n=A;if(!t.length)return void H.stdout.write(`${n.dim(`No approvals for task ${e}.`)}\n`);for(let e of t){let t=e.deniedReason?` ${n.dim(`denied: ${e.deniedReason}`)}`:``;H.stdout.write(`${n.cyan(e.id)} ${Fr(e).padEnd(8)} ${n.light(e.reason)}${Ir(e)}${t}\n${B(e.actions)}\n`)}}function Rr(e,t){let n=A;if(!e.length)return void H.stdout.write(`${n.dim(t?`No denied approvals.`:`No pending approvals.`)}\n`);for(let t of e){let e=t.createdAt?` ${n.dim(w(R(t.createdAt)))}`:``;H.stdout.write(`${n.cyan(t.id)} task ${n.cyan(t.taskId)}${e} ${n.light(t.reason)}${Ir(t)}\n${B(t.actions)}\n`)}}const zr=F({name:`approvals`,description:`pending approvals (all tasks, or one)`,usage:`List pending approvals across all tasks, --denied the denied ones (still answerable), or every approval of one task.`,access:`read`,args:{"task-id":x(`one task (default: approvals of every task)`),denied:v(`denied approvals instead of pending ones`),...o},cli:{positional:[`task-id`]},run:async({options:e,args:[t]})=>{let{tasks:n}=await import(`./task-
|
|
107
|
+
`)}\n`)}function Nr(e,t){let n=e[t];if(n.available&&n.loggedIn)return[];let r=n.available?t===`codex`?`codex login`:`claude auth login`:`npm install -g ${t===`codex`?`@openai/codex`:`@anthropic-ai/claude-code`}`,i=n.available?`${t.padEnd(8)}not logged in${t===`codex`?` ${A.dim(`(${n.auth})`)}`:``} - run: ${r}`:`${t.padEnd(8)}CLI not installed - run: ${r}`;return[{usage:r,blurb:`${t} ${n.available?`not logged in`:`CLI not installed`}`,cli:{text:i,layout:`bad`,prefix:``,slot:t}}]}const Pr={accept:`approved`,decline:`denied`,closed:`stopped`},Fr=e=>e.answered?Pr[e.answered]:`pending`,Ir=e=>e.scope?` ${A.dim(`${e.approvers} approves this ${e.scope} change`)}`:``;function Lr(e,t){let n=A;if(!t.length)return void H.stdout.write(`${n.dim(`No approvals for task ${e}.`)}\n`);for(let e of t){let t=e.deniedReason?` ${n.dim(`denied: ${e.deniedReason}`)}`:``;H.stdout.write(`${n.cyan(e.id)} ${Fr(e).padEnd(8)} ${n.light(e.reason)}${Ir(e)}${t}\n${B(e.actions)}\n`)}}function Rr(e,t){let n=A;if(!e.length)return void H.stdout.write(`${n.dim(t?`No denied approvals.`:`No pending approvals.`)}\n`);for(let t of e){let e=t.createdAt?` ${n.dim(w(R(t.createdAt)))}`:``;H.stdout.write(`${n.cyan(t.id)} task ${n.cyan(t.taskId)}${e} ${n.light(t.reason)}${Ir(t)}\n${B(t.actions)}\n`)}}const zr=F({name:`approvals`,description:`pending approvals (all tasks, or one)`,usage:`List pending approvals across all tasks, --denied the denied ones (still answerable), or every approval of one task.`,access:`read`,args:{"task-id":x(`one task (default: approvals of every task)`),denied:v(`denied approvals instead of pending ones`),...o},cli:{positional:[`task-id`]},run:async({options:e,args:[t]})=>{let{tasks:n}=await import(`./task-BRHXn5y1.js`).then(e=>e.t);return n.approvals(t,{...e,organization:e.workspace})},json:(e,{args:[t]})=>t?e.map(({taskId:e,...t})=>t):e,next({result:e,args:t}){let n=m(t);if(!e.length)return t[`task-id`]?[]:L([`Check tasks: coder task list${n}`]);let r=e.length===1?t.server===void 0?e[0].id:`${e[0].taskId} ${e[0].id}`:t.server===void 0?`<approval-id>`:`<task-id> <approval-id>`;return L([`Answer: coder task approve ${r} [--deny --reason "<why>"]${n}`])},print:(e,{args:[t],options:n})=>t?Lr(t,e):Rr(e,!!n.denied)}),Br=F({name:`approve`,description:`answer an escalation`,usage:`Answer an escalation the task raised. Accepts by default; --deny rejects it, --reason says why.
|
|
108
108
|
Works any time, also after a deny: the task gets the decision as a message.
|
|
109
|
-
Approval ids are unique, so the task id is optional.`,access:`write`,args:{"task-id":x(`the task, or the approval id alone`),"approval-id":x(`the approval to answer`),deny:v(`reject the request instead of accepting`),reason:x(`why it is denied; the task reads it`),...o},cli:{positional:[`task-id`,`approval-id`]},run:async({options:e,args:[t,n]})=>{let{tasks:r}=await import(`./task-
|
|
109
|
+
Approval ids are unique, so the task id is optional.`,access:`write`,args:{"task-id":x(`the task, or the approval id alone`),"approval-id":x(`the approval to answer`),deny:v(`reject the request instead of accepting`),reason:x(`why it is denied; the task reads it`),...o},cli:{positional:[`task-id`,`approval-id`]},run:async({options:e,args:[t,n]})=>{let{tasks:r}=await import(`./task-BRHXn5y1.js`).then(e=>e.t);return r.approve(t,n,{...e,organization:e.workspace})},print:({taskId:e,approvalId:t},{options:n})=>H.stdout.write(`${n.deny?`Denied`:`Approved`} ${A.cyan(t)} on task ${A.cyan(e)}; the task has been told.\n`)}),Vr=e=>e===1?``:`s`,Hr=F({name:`archive`,description:`archive a session (or --all-stopped)`,usage:`Archive a task session so it drops out of the default list (see it again with
|
|
110
110
|
\`coder task list --archived [--limit N]\`). Pass --all-stopped to archive every
|
|
111
111
|
finished task. A running task keeps running; steering an archived task
|
|
112
|
-
brings it back.`,access:`write`,args:{"task-id":x(`the task to archive`),"all-stopped":v(`archive every stopped (finished) task`),...o},cli:{positional:[`task-id`]},run:async({options:e,args:[t]})=>{let{tasks:n}=await import(`./task-
|
|
112
|
+
brings it back.`,access:`write`,args:{"task-id":x(`the task to archive`),"all-stopped":v(`archive every stopped (finished) task`),...o},cli:{positional:[`task-id`]},run:async({options:e,args:[t]})=>{let{tasks:n}=await import(`./task-BRHXn5y1.js`).then(e=>e.t);return n.archive(t,{...e,organization:e.workspace,allStopped:e[`all-stopped`]})},print(e){if(e.count===void 0)return void H.stdout.write(`Archived task ${A.cyan(e.taskId)}.\n`);H.stdout.write(e.count?`Archived ${e.count} stopped task${Vr(e.count)}.\n`:`${A.dim(`No stopped tasks to archive.`)}\n`)}});function Ur(e,t,n){let[r,...i]=e,a=i.join(` `).trim();if(!r||!a)throw new C(`invalid-option`,t,{hint:n});return{id:r,text:a}}function Wr(e,t=!1){let{taskId:n,steered:r}=e;if(r===`queued`){H.stdout.write(`${A.dim(`[coder]`)} follow-up queued for task ${A.cyan(n)}; it runs when the current turn finishes.\n`),t&&H.stdout.write(`\n${A.dim(`[coder] --wait is not available for a queued follow-up.`)}\n`);return}if(!t){H.stdout.write(r===`live`?`${A.dim(`[coder]`)} steered follow-up into running task ${A.cyan(n)}.\n`:`${A.dim(`[coder]`)} resumed task ${A.cyan(n)} with the follow-up (same thread, same id).\n`);return}H.stdout.write(`\n${e.finalMessage||`(no final message)`}\n\n`),H.stderr.write(`${A.dim(`[coder] task=${n} status=${e.status??`unknown`}`)}\n`)}const Gr=F({name:`steer`,description:`continue a task's thread`,usage:`Continue a task's thread with new instructions. They are injected into a live Codex or
|
|
113
113
|
Claude turn at its next tool boundary and queued across a startup or completion race.
|
|
114
114
|
A stopped, finished, or archived task resumes on the same task id. It reuses the
|
|
115
|
-
task's engine, model, and access unless overridden.`,access:`write`,args:{"task-id":x(`the task to continue`),text:s(`the follow-up instructions`),wait:v(`run in the foreground and block until the answer is ready`),model:r(`for this follow-up`),access:x(`lower the task's access for this follow-up`,`<read-only|auto>`),...o},cli:{positional:[`task-id`,`text`],examples:[`coder task steer task-abc "now add tests" # continue that task with a follow-up`]},async run({options:e,args:t}){let{tasks:n}=await import(`./task-
|
|
115
|
+
task's engine, model, and access unless overridden.`,access:`write`,args:{"task-id":x(`the task to continue`),text:s(`the follow-up instructions`),wait:v(`run in the foreground and block until the answer is ready`),model:r(`for this follow-up`),access:x(`lower the task's access for this follow-up`,`<read-only|auto>`),...o},cli:{positional:[`task-id`,`text`],examples:[`coder task steer task-abc "now add tests" # continue that task with a follow-up`]},async run({options:e,args:t}){let{tasks:n}=await import(`./task-BRHXn5y1.js`).then(e=>e.t),{id:r,text:i}=Ur(t,`Missing task id or follow-up text.`,[`Usage: coder task steer <task-id> "<follow-up>" [--wait]`,`Help: coder task steer --help`]);return n.steer(r,i,{...e,access:e.access,organization:e.workspace})},json:(e,{options:t})=>!t.wait||e.steered===`queued`?e:{taskId:e.taskId,status:e.status??null,finalMessage:e.finalMessage??null},next({result:e,args:t}){return e.steered===`queued`&&!t.wait?[]:t.wait&&e.steered!==`queued`?X(e.taskId,t).map(e=>({...e,cli:{...e.cli,stream:`stderr`}})):[Y(e.taskId,t,`Wait in its own background shell, one per task: coder task result ${e.taskId} --wait`)]},print:(e,{options:t})=>Wr(e,t.wait),exit(e,{options:t}){if(t.wait&&e.steered!==`queued`)return e.status===`completed`?0:1}}),Kr=F({name:`ask`,description:`ask about a task without interrupting it`,usage:`Answer a question ABOUT a task without touching it: a read-only sidecar reads
|
|
116
116
|
the task's progress log, result, and workspace and answers; the task never
|
|
117
117
|
sees the question and its thread is not steered. Works whether the task is
|
|
118
|
-
running or stopped. To change what the task does, use \`coder task steer\`.`,access:`read`,args:{"task-id":x(`the task to ask about`),question:s(`the question`),model:r(`for the sidecar (default: the task's own)`),...o},cli:{positional:[`task-id`,`question`],examples:[`coder task ask task-abc "what approach did you take and why?" # probe a decision without derailing the task`]},async run({options:e,args:t}){let{tasks:n}=await import(`./task-
|
|
119
|
-
delete every archived task at once. A running task must be stopped first.`,access:`write`,approvalPolicy:{handoff:{page:`/tasks/:task-id`,label:`Delete the task`,action:`delete`,args:[`task-id`],button:`Delete`}},args:{"task-id":x(`the task to delete`),"all-archived":v(`delete every archived task`),...o},cli:{positional:[`task-id`]},run:async({options:e,args:[t]})=>{let{tasks:n}=await import(`./task-
|
|
118
|
+
running or stopped. To change what the task does, use \`coder task steer\`.`,access:`read`,args:{"task-id":x(`the task to ask about`),question:s(`the question`),model:r(`for the sidecar (default: the task's own)`),...o},cli:{positional:[`task-id`,`question`],examples:[`coder task ask task-abc "what approach did you take and why?" # probe a decision without derailing the task`]},async run({options:e,args:t}){let{tasks:n}=await import(`./task-BRHXn5y1.js`).then(e=>e.t),{id:r,text:i}=Ur(t,`Missing task id or question.`,[`Usage: coder task ask <task-id> "<question>"`,`Help: coder task ask --help`]);return n.ask(r,i,{...e,organization:e.workspace,onAsking:t=>e.json||H.stderr.write(`${A.dim(`[coder]`)} asking about task ${A.cyan(t)} (read-only sidecar; the task is not interrupted)...\n`)})},json:({ok:e,...t})=>t,print({answer:e,error:t}){e?H.stdout.write(`\n${e}\n`):H.stdout.write(`${A.dim(`(no answer)`)}${t?` ${A.red(t)}`:``}\n`)},exit:e=>+!e.ok}),qr=F({name:`delete`,description:`delete a session (or --all-archived)`,usage:`Delete a task's session from disk. This is permanent. Pass --all-archived to
|
|
119
|
+
delete every archived task at once. A running task must be stopped first.`,access:`write`,approvalPolicy:{handoff:{page:`/tasks/:task-id`,label:`Delete the task`,action:`delete`,args:[`task-id`],button:`Delete`}},args:{"task-id":x(`the task to delete`),"all-archived":v(`delete every archived task`),...o},cli:{positional:[`task-id`]},run:async({options:e,args:[t]})=>{let{tasks:n}=await import(`./task-BRHXn5y1.js`).then(e=>e.t);return n.delete(t,{...e,organization:e.workspace,allArchived:e[`all-archived`]})},print(e){if(e.count===void 0)return void H.stdout.write(`Deleted task ${A.cyan(e.taskId)}.\n`);H.stdout.write(e.count?`Deleted ${e.count} archived task${Vr(e.count)}.\n`:`${A.dim(`No archived tasks to delete.`)}\n`)}});function Jr(e,t,n){let r=A;if(!e.length){let e=t.archived?`archived tasks`:t.running?`running tasks`:t.stopped?`recently stopped tasks`:`recent tasks`;H.stdout.write(`No ${e}.\n`);return}let i=[{header:`task-id`,value:e=>e.taskId,paint:e=>r.cyan(e),max:28},{header:`status`,value:e=>e.status,paint:(e,t)=>O(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=>r.light(e),max:26},{header:`cwd`,value:e=>e.cwd?V.basename(e.cwd):`-`,paint:e=>r.light(e),max:24},{header:`name`,value:e=>{let t=e.archived?` ${r.dim(`(archived)`)}`:``;return`${e.name?e.name:r.light(e.prompt)}${e.idleMs!==null&&e.idleMs>=12e4?` ${(e.idleMs>6e5?r.red:r.dim)(`· idle ${w(e.idleMs)}`)}`:``}${t}`}}],a=[],o=new Map;for(let t of e){if(!t.flowRunId){let e=a.at(-1);e&&!e.header?e.rows.push(t):a.push({rows:[t]});continue}let e=o.get(t.flowRunId);if(!e){let i=n(t.flowRunId);e={header:i?`(${r.bold(t.flowRunId)} ${i.status}. Flow ${i.name})`:`(${r.bold(t.flowRunId)} flow)`,rows:[]},o.set(t.flowRunId,e),a.push(e)}e.rows.push(t)}H.stdout.write(E(i,a,r))}const Yr=F({name:`list`,description:`list recent tasks (by default running + just stopped)`,usage:`List recent tasks across all workspaces, most recent first: running tasks plus
|
|
120
120
|
ones stopped within the last 30 minutes. Older stopped tasks auto-archive and
|
|
121
|
-
move to --archived. Shortcut: \`coder list\`.`,access:`read`,args:{running:v(`show only running tasks`),stopped:v(`show only recently stopped tasks (not yet archived)`),archived:v(`show only archived tasks (auto-archived or via task archive)`),limit:d(`tasks per page (default: 50; all for every task)`),cursor:x(`continue from the previous page cursor`),dir:x(`only tasks launched in that workspace`),...o},run:async({options:e})=>{let{tasks:t}=await import(`./task-
|
|
122
|
-
the host plugins to match.`,access:`write`,approvalPolicy:`deny`,args:{"cli-only":v(`update just the CLI`),"plugins-only":v(`refresh just the host plugins`),codex:v(`limit the refresh to the Agent Skills copy (Codex, Pi, ...)`),claude:v(`limit the refresh to the Claude Code plugin`),pm:x(`force a package manager instead of auto-detecting`,`<npm|pnpm|yarn|bun>`)},globalFlags:{json:!1,cwd:!1},run:async({options:e,tool:t})=>{let{upgradeCore:n}=await import(`./dispatch-
|
|
121
|
+
move to --archived. Shortcut: \`coder list\`.`,access:`read`,args:{running:v(`show only running tasks`),stopped:v(`show only recently stopped tasks (not yet archived)`),archived:v(`show only archived tasks (auto-archived or via task archive)`),limit:d(`tasks per page (default: 50; all for every task)`),cursor:x(`continue from the previous page cursor`),dir:x(`only tasks launched in that workspace`),...o},run:async({options:e})=>{let{tasks:t}=await import(`./task-BRHXn5y1.js`).then(e=>e.t);return t.list({...e,organization:e.workspace})},next({result:e,args:t}){let n=m(t),r=L(e.items.length?[`Result: coder task result <task-id>${n}`,...t.archived?[]:[`Older tasks: coder task list --archived [--limit N]${n}`]]:e.items.archived?[`${e.items.archived} archived: coder task list --archived [--limit N]${n}`]:[]);return e.next&&r.push(...L([`Next page: coder task list --cursor ${e.next} --limit ${t.limit??50}${t.running?` --running`:``}${t.stopped?` --stopped`:``}${t.archived?` --archived`:``}${t.dir?` --dir ${JSON.stringify(t.dir)}`:``}${n}`],{layout:`plain`})),r},async print(e,{options:t}){let{readFlowRecord:n}=await import(`./executor-Ds4wDCzV.js`).then(e=>e.A);Jr(e.items,t,n)}});function Xr(e,t={}){let n=Y(e,t,`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.`);n.cli={...n.cli,layout:`rows`,title:`Next step`};let r=m(t);return[n,...[{usage:`coder task steer ${e} "<follow-up>"${r}`,blurb:`steer the task with a message (use 'ask' without interrupting main thread)`},{usage:`coder task stop ${e}${r}`,blurb:`stop the task`},{usage:`coder task list${r}`,blurb:`recent tasks`},{usage:`coder task --help`,blurb:`all task commands`}].map(e=>({...e,cli:{layout:`rows`,title:`Related`}}))]}function Zr(e,t){H.stdout.write(`${A.dim(`[coder]`)} task ${A.blue(e)} started in the background (${t}).\n`)}function Qr(e){H.stderr.write(`${A.dim(`[coder]`)} Task ${A.cyan(e)} started and is waiting to finish. Press Ctrl-C to detach. It keeps running.\n`)}function $r(e){H.stderr.write(`\n${A.dim(`[coder] Detached. The task is still running.`)}\n`)}function ei(e){H.stdout.write(`\n${W({finalMessage:e.finalMessage??void 0},e.error,`(no final message)`)}\n\n`);let t=e.tokens?` tokens=${N(e.tokens,e.model)}`:``;H.stderr.write(`${A.dim(`[coder] task=${e.taskId} status=${e.status}${t}`)}\n`)}const ti=F({name:`run`,description:`run a task (background; --wait blocks)`,usage:`Dispatch a coding task to the configured engine. Backgrounds by default and\nprints a task id locally or with --server; --wait follows it to 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${_e}`,access:`write`,args:{prompt:s(`the task text`),"output-schema":x(`JSON Schema for the task answer`,`<json>`),name:x(`label the task (shown in list/result)`),agent:x(`run as that agent: its system.md, engine settings, MCP servers and flows; flags override them`,`<id>`),"append-system":x(`standing instructions appended to Coder's system prompt (kept out of prompt previews)`,`<text>`),wait:v(`follow the task until the answer is ready`),model:r(),access:x(`read-only also restricts platforms and connections; auto lets the engine review what leaves the sandbox (default: auto)`,`<read-only|auto>`),mcp:x('attach MCP servers from `mcp` in .coder/config.json by name (or all), or an inline JSON array [{"name","command","args","env","tools"}]; none by default, all adds your engine\'s own MCP servers',`<names|all|json>`),connections:x(`use only these connections (coder connection list), within the agent's`,`<ids>`),"add-dir":s(`give the task another directory beyond --cwd (repeatable); read-only can only read it, auto can also write`,`<dir>`),server:g(`run the task on your Coder server and print its id (--wait follows it)`,`[url]`),workspace:x(`with --server: the workspace to run in (default: the saved one)`,`<slug>`),yes:v(`with --server: connect to a server used for the first time without asking`),repo:x(`with --server: check out a repo from the workspace's installs`,`<owner/name>`),runner:x(`with --server: where it runs (a runner kind or a registered runner)`)},cli:{positional:[`prompt`],exit:[[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 --append-system "tests live in test/, don't touch anything outside of it" "rename foo to bar" # pick an engine via its model alias; --append-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`]},async run({options:e,args:t,tool:n,next:r}){let{tasks:i}=await import(`./task-BRHXn5y1.js`).then(e=>e.t),a=e.json,o;return n||H.on(`SIGINT`,()=>{o&&($r(o),r({taskId:o,phase:`detached`},{stream:`stderr`,force:!0})),H.exit(130)}),i.run(t.join(` `).trim(),{cwd:e.cwd,agent:e.agent,outputSchema:e[`output-schema`]?JSON.parse(e[`output-schema`]):void 0,model:e.model,access:e.access,name:e.name,appendSystem:e[`append-system`],mcp:e.mcp,connections:e.connections?.split(`,`).map(e=>e.trim()).filter(Boolean),addDirs:e[`add-dir`],wait:!!e.wait,repo:e.repo,runner:e.runner,server:e.server,yes:e.yes,organization:e.workspace,onFallback:({model:e,detail:t,next:n})=>H.stderr.write(`[coder] ${e} failed (${t}); falling back to ${n}.\n`),onNote:e=>H.stderr.write(`[coder] ${e}\n`),onWaiting:e=>{o=e,!a&&!n&&(Qr(e),r({taskId:e,phase:`waiting`},{stream:`stderr`,style:`stdout`}))}})},next({result:e,args:t}){let n=e.phase,r=e.taskId;return n===`detached`?[Y(r,t,`Wait in its own background shell, one per task: coder task result ${r} --wait`)]:n===`waiting`?Xr(r,t):t.wait?X(r,t).map(e=>({...e,cli:{...e.cli,stream:`stderr`}})):Xr(r,t)},print(e,{options:t}){t.wait?ei(e):Zr(e.taskId,e.status)},exit:(e,{options:t})=>t.wait?e.status===`completed`?0:1:void 0}),ni=F({name:`stop`,description:`interrupt a running task`,usage:`Interrupt a running task and mark it cancelled.`,access:`write`,args:{"task-id":x(`the task to stop`),...o},cli:{positional:[`task-id`]},run:async({options:e,args:[t]})=>{let{tasks:n}=await import(`./task-BRHXn5y1.js`).then(e=>e.t);return n.stop(t,{...e,organization:e.workspace})},print:({taskId:e,interrupt:t})=>H.stdout.write(`Stopped task ${A.cyan(e)} ${A.dim(`(${t})`)}\n`)}),ri=I({name:`task`,description:`run, follow and steer coding tasks`,commands:[ti,Yr,at,dt,Gr,Kr,ni,Hr,qr,zr,Br],aliases:{stream:`watch`,ls:`list`}}),ii=F({name:`upgrade`,description:`update the CLI and host plugins`,usage:`Update the coder CLI through whichever package manager installed it, then refresh
|
|
122
|
+
the host plugins to match.`,access:`write`,approvalPolicy:`deny`,args:{"cli-only":v(`update just the CLI`),"plugins-only":v(`refresh just the host plugins`),codex:v(`limit the refresh to the Agent Skills copy (Codex, Pi, ...)`),claude:v(`limit the refresh to the Claude Code plugin`),pm:x(`force a package manager instead of auto-detecting`,`<npm|pnpm|yarn|bun>`)},globalFlags:{json:!1,cwd:!1},run:async({options:e,tool:t})=>{let{upgradeCore:n}=await import(`./dispatch-BkoIU4GU.js`).then(e=>e.k);return n({...e,cliOnly:e[`cli-only`],pluginsOnly:e[`plugins-only`]},t?()=>{}:ai)},print:oi});function ai(e){H.stdout.write(`${A.bold(`Updating coder CLI`)} ${A.dim(`${e}...`)}\n`)}function oi(e){let t=A.bold,n=A.dim,r=(e,r)=>r&&e&&r!==e?`${e} ${n(`->`)} ${t(r)}`:`${r??e??`?`} ${n(`(unchanged)`)}`,i=(e,t)=>`${t.installed?T(`${e} ${r(t.from,t.to)} ${n(`- ${t.note}`)}`):M(`${e} ${t.note}`)}\n`;e.cli&&H.stdout.write(e.cli.changed?`${T(`coder CLI ${r(e.cli.from,e.cli.to)}`)}\n`:`${T(`coder CLI ${e.cli.from} ${n(`(already latest)`)}`)}\n`),e.claudePlugin&&H.stdout.write(i(`claude plugin`,e.claudePlugin)),e.agentsSkill&&H.stdout.write(i(`agents skill `,e.agentsSkill))}const si=te({name:ee,description:c,namespaces:[ri,Kn,xt,en,kr,Sr,Et,fr,Gt],commands:[pr,kt,Ar,tn,ii,Jn]}),ci={run:[`task`,`run`],list:[`task`,`list`],result:[`task`,`result`],dash:[`server`,`serve`]};export{ci as SHORTCUTS,si as cli};
|