@wular/coder 0.4.1 → 0.4.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.
Files changed (244) hide show
  1. package/README.md +69 -70
  2. package/dist/{add-ej0X9e3a.js → add-C2y-mVzl.js} +1 -1
  3. package/dist/{add-U-pty9qJ.js → add-CLYTF_up.js} +1 -1
  4. package/dist/{add-CE-70LFs.js → add-DRsPpQFl.js} +1 -1
  5. package/dist/{add-BxpLHnvD.js → add-DkpUwhtO.js} +1 -1
  6. package/dist/{add-json-CEa-6luW.js → add-json-5uPnWPoD.js} +1 -1
  7. package/dist/{agent-BsYx3Odz.js → agent-hw3zKw8y.js} +1 -1
  8. package/dist/{agent-JdtZozvP.js → agent-r5mMcehf.js} +1 -1
  9. package/dist/{alias-DX-Bm86x.js → alias-_0Rwf2cA.js} +1 -1
  10. package/dist/{app-BT5f7zL5.js → app-oE8G1-bi.js} +1 -1
  11. package/dist/{approvals-C-AvFt6s.js → approvals-DbVrsxec.js} +1 -1
  12. package/dist/{approve-DOmpQRNd.js → approve-DeAhFL-m.js} +1 -1
  13. package/dist/{apps-CjfrZyM5.js → apps-eujHiNca.js} +1 -1
  14. package/dist/{archive-BziJ1rQ-.js → archive-BCUfymIB.js} +1 -1
  15. package/dist/{archive-BUB8gFKD.js → archive-DZ6vpMHb.js} +1 -1
  16. package/dist/{archive-sweep-CtBcARgN.js → archive-sweep-Cxbh8yAI.js} +1 -1
  17. package/dist/{ask-dE3U3ss2.js → ask-BU2WVxVM.js} +1 -1
  18. package/dist/auth-CBWTmAPA.js +1 -0
  19. package/dist/{auth-BFny--17.js → auth-Dmn2U7rr.js} +1 -1
  20. package/dist/{cli-BilSDkvE.js → cli-DWCR7iqa.js} +1 -1
  21. package/dist/cli.js +1 -1
  22. package/dist/{config-Da_cwoxI.js → config-12pK4qW7.js} +1 -1
  23. package/dist/{create-C_iMJV4Y.js → create-D3f6q0Yq.js} +1 -1
  24. package/dist/credentials-l6dsrZLL.js +1 -0
  25. package/dist/dash/manifest.json +744 -858
  26. package/dist/dash/public/assets/chunks/{agent-pills-c9c4ac4d4a10df83.js → agent-pills-dd0b7643e125bbf1.js} +1 -1
  27. package/dist/dash/public/assets/chunks/{agent-settings-form-8be2ddab074aba6d.js → agent-settings-form-45ae6aeaaed2b568.js} +1 -1
  28. package/dist/dash/public/assets/chunks/{agents-grid-951584b6f4c4314e.js → agents-grid-b906da80c31fc035.js} +1 -1
  29. package/dist/dash/public/assets/chunks/{combo-41234c24668b1db1.js → combo-952a457d52360d88.js} +1 -1
  30. package/dist/dash/public/assets/chunks/{composer-d10d4b1d54c4f751.js → composer-49f9e7c5c4dfda3b.js} +1 -1
  31. package/dist/dash/public/assets/chunks/{composer-5534be50bc12385e.js → composer-f331d00837143aee.js} +1 -1
  32. package/dist/dash/public/assets/chunks/{connect-apps-aa2a3d82e48ed8c3.js → connect-apps-661f3b3a85f1776a.js} +1 -1
  33. package/dist/dash/public/assets/chunks/{credentials-list-bc5bfcab058176c5.js → credentials-list-e6177d0943517929.js} +2 -2
  34. package/dist/dash/public/assets/chunks/{custom-range-4761ab14f05149df.js → custom-range-03ba6fb2ade7d282.js} +1 -1
  35. package/dist/dash/public/assets/chunks/{editor-bfe8cd854f8001be.js → editor-34cb529d6d8a4b09.js} +1 -1
  36. package/dist/dash/public/assets/chunks/{engines-list-f1191390f5715b39.js → engines-list-2f1acee3ecc8461a.js} +1 -1
  37. package/dist/dash/public/assets/chunks/{heads-f3bcd289663d48fa.js → heads-1570a3a6db331979.js} +1 -1
  38. package/dist/dash/public/assets/chunks/{list-1d259660d7612c5f.js → list-87b359bebd26986a.js} +1 -1
  39. package/dist/dash/public/assets/chunks/{mcp-list-e3bebbbe831393b8.js → mcp-list-b42f0d2ee463b37d.js} +1 -1
  40. package/dist/dash/public/assets/chunks/{models-list-44f857a469ca04d5.js → models-list-0669d26fd662aec3.js} +1 -1
  41. package/dist/dash/public/assets/chunks/{platform-actions-d1426602049926d2.js → platform-actions-c92ca3c6198a9387.js} +1 -1
  42. package/dist/dash/public/assets/chunks/{runners-list-1901af8a5dea1f09.js → runners-list-9fffa50432c470c9.js} +1 -1
  43. package/dist/dash/public/assets/chunks/{select-7ae25fd8a7d6c338.js → select-1013702bdfb1ade4.js} +1 -1
  44. package/dist/dash/public/assets/chunks/shared-init-20e199043ff5d00f.js +2 -0
  45. package/dist/dash/public/assets/chunks/{task-actions-8e1d93c788d001df.js → task-actions-a9603d520434baab.js} +1 -1
  46. package/dist/dash/public/assets/chunks/{task-view-6d7618d2820a5cb4.js → task-view-f7039cb330bcb0b5.js} +3 -3
  47. package/dist/dash/public/assets/chunks/{tasks-list-f4784e5cbd0ed785.js → tasks-list-2a905b4a0c3a9042.js} +1 -1
  48. package/dist/dash/public/assets/chunks/{toolbar-a75d2570f07cbb70.js → toolbar-f964fa864699f095.js} +1 -1
  49. package/dist/dash/public/assets/dash-49ca85b59ac65c20.css +1 -0
  50. package/dist/dash/public/assets/dash-account-96fc41be318839fa.css +1 -0
  51. package/dist/dash/public/assets/dash-agents-290a7b21c7dc0c92.css +1 -0
  52. package/dist/dash/public/assets/dash-agents-new-a7a07bf4ebda24c2.css +1 -0
  53. package/dist/dash/public/assets/dash-agents-param-slug-69a72fb0bbd14cc2.css +1 -0
  54. package/dist/dash/public/assets/dash-agents-param-slug-edit-397bdfb2f0ca328c.css +1 -0
  55. package/dist/dash/public/assets/dash-agents-param-slug-platforms-a7b3b7247c27f1d2.css +1 -0
  56. package/dist/dash/public/assets/dash-agents-param-slug-settings-8389b7d0555e8ccf.css +1 -0
  57. package/dist/dash/public/assets/dash-agents-param-slug-tasks-5987b8aea5e8f30d.css +1 -0
  58. package/dist/dash/public/assets/dash-agents-param-slug-usage-19abc69e1d4e6b0a.css +1 -0
  59. package/dist/dash/public/assets/dash-settings-53b8e6a8f656fa1a.css +1 -0
  60. package/dist/dash/public/assets/dash-settings-param-tab-ac61fdfdd6fd533f.css +1 -0
  61. package/dist/dash/public/assets/dash-tasks-cc0b1d32874b731c.css +1 -0
  62. package/dist/dash/public/assets/dash-tasks-param-id-02b8c7bd99cc1090.css +1 -0
  63. package/dist/dash/public/assets/dash-usage-884943221f76ad93.css +1 -0
  64. package/dist/dash/public/assets/pnext-client-17ba55bb57a1f4da.js +1 -0
  65. package/dist/dash/public/assets/{pnext-client-1b9ab0963a8ff77b.js → pnext-client-1afa4148bea69ad2.js} +1 -1
  66. package/dist/dash/public/assets/pnext-client-2693db10b197ade1.js +1 -0
  67. package/dist/dash/public/assets/pnext-client-43f52a07f8067b1b.js +1 -0
  68. package/dist/dash/public/assets/pnext-client-4594b693fe612835.js +1 -0
  69. package/dist/dash/public/assets/pnext-client-73f73e24f8141fb6.js +1 -0
  70. package/dist/dash/public/assets/pnext-client-7574da4651b40eae.js +1 -0
  71. package/dist/dash/public/assets/pnext-client-7b3a2c1092cbbb02.js +1 -0
  72. package/dist/dash/public/assets/pnext-client-816fe5fc96d3f768.js +1 -0
  73. package/dist/dash/public/assets/pnext-client-86cb956b448b0887.js +1 -0
  74. package/dist/dash/public/assets/pnext-client-8b64e3c030164288.js +1 -0
  75. package/dist/dash/public/assets/pnext-client-8f6161084c595a22.js +1 -0
  76. package/dist/dash/public/assets/pnext-client-9203ec11926e5d04.js +1 -0
  77. package/dist/dash/public/assets/pnext-client-a38b446f941d44df.js +1 -0
  78. package/dist/dash/public/assets/pnext-client-bd8d51aaa095e8a4.js +1 -0
  79. package/dist/dash/public/assets/pnext-client-e9821d1f1bdb281d.js +1 -0
  80. package/dist/dash/server/bundle-0.1.6-b29ec45cb963d47f/entry.js +2 -0
  81. package/dist/{default-vYPT26DR.js → default-CwQXCtoB.js} +1 -1
  82. package/dist/{default-Bobztoxf.js → default-De8FXiWz.js} +1 -1
  83. package/dist/{delete-z1_86nf6.js → delete-BD6AnCLg.js} +1 -1
  84. package/dist/{delete-D8gEwoOj.js → delete-cS01oOIb.js} +1 -1
  85. package/dist/{disable-DVKd-0Xb.js → disable-BMWWeYFQ.js} +1 -1
  86. package/dist/{discover-Df-a8K4R.js → discover-Cfx5RPU7.js} +1 -1
  87. package/dist/{docs-DKJnqZqt.js → docs-DWegDRiu.js} +1 -1
  88. package/dist/{enable-C8Zf_wpN.js → enable-Cfzeau2x.js} +1 -1
  89. package/dist/{flow-17k25MHt.js → flow-kAxxVOiR.js} +1 -1
  90. package/dist/{init-CoMfFxbG.js → init-C4tDFH4G.js} +1 -1
  91. package/dist/integrations-D-L3uQRj.js +1 -0
  92. package/dist/{list-BYiG8Zav.js → list-5Ljf9TxF.js} +2 -2
  93. package/dist/{list-BAKvxSbh.js → list-COAo7eZd.js} +1 -1
  94. package/dist/{list-DX-z3SBp.js → list-DuPqU3fk.js} +1 -1
  95. package/dist/{list-C5w01-8q.js → list-DzGuMkQy.js} +1 -1
  96. package/dist/{list-VToARh3C.js → list-J8d_zh-o.js} +1 -1
  97. package/dist/{list-BxEywhHU.js → list-vOvIpbOH.js} +1 -1
  98. package/dist/{list-CIW2joV1.js → list-vpyS-hv8.js} +1 -1
  99. package/dist/{list-DpCf4G-H.js → list-way5oLO0.js} +1 -1
  100. package/dist/{login-DkkslfBx.js → login-BBw95-S3.js} +1 -1
  101. package/dist/{login-BFxX4jJy.js → login-CNmeRAL7.js} +1 -1
  102. package/dist/{logout-BHAtw4Z8.js → logout-j0dTo_Ib.js} +1 -1
  103. package/dist/{maintenance-C5FklUw3.js → maintenance-DkLVtqM7.js} +1 -1
  104. package/dist/{mcp-CCZOAo06.js → mcp-CsmBtlW9.js} +1 -1
  105. package/dist/{migrate-C4vM7DQN.js → migrate-D4nzYhk8.js} +1 -1
  106. package/dist/{model-Bs1StDo3.js → model-B79MFtRV.js} +1 -1
  107. package/dist/{push-CUC55Bqd.js → push-DbdnbZYt.js} +1 -1
  108. package/dist/{queue-6io_NOP3.js → queue-C9fSdE_X.js} +27 -27
  109. package/dist/refresh-BDmap1RA.js +1 -0
  110. package/dist/{remove-B93LNkZI.js → remove-BNzbUhaK.js} +1 -1
  111. package/dist/{remove-eQ8y5C5p.js → remove-CLpL12Ya.js} +1 -1
  112. package/dist/{remove-CuH8a3L9.js → remove-CaYH9Cna.js} +1 -1
  113. package/dist/{remove-C5_xggx7.js → remove-D-QeeZQL.js} +1 -1
  114. package/dist/{rename-CYfy03FE.js → rename-Bhcb4t9F.js} +1 -1
  115. package/dist/{result-BEtQZHaY.js → result-BfTfJayl.js} +1 -1
  116. package/dist/{result-BzaM3inj.js → result-D8DsvJDu.js} +1 -1
  117. package/dist/{resume-DYzKvyEw.js → resume-aZ8yWDBh.js} +1 -1
  118. package/dist/{review-oIBeECZE.js → review-BEhDcX4b.js} +1 -1
  119. package/dist/{rotate-key-IdMYH7gg.js → rotate-key-BqnKhTK8.js} +1 -1
  120. package/dist/{run-CTtd0Znc.js → run-BWbabvub.js} +1 -1
  121. package/dist/{run-CawRGnOg.js → run-BdPjxaZU.js} +1 -1
  122. package/dist/{run-BDYl0CKl.js → run-Dqe38jX8.js} +1 -1
  123. package/dist/runner-BPpiJvHx.js +1 -0
  124. package/dist/sdk.js +1 -1
  125. package/dist/{serve-CPnmrKyf.js → serve-C0WC-QrV.js} +2 -2
  126. package/dist/{serve-GmRO89s5.js → serve-CcObDKKQ.js} +1 -1
  127. package/dist/{serve-CE8YV2e9.js → serve-Ck95047c.js} +1 -1
  128. package/dist/{serve-CQKZxzFE.js → serve-DA5I2qXj.js} +2 -2
  129. package/dist/{server-Kb22cWfF.js → server-BxLFZL80.js} +1 -1
  130. package/dist/{setup-host-GFTUzzZJ.js → setup-host-DLd_j2Uw.js} +1 -1
  131. package/dist/{shared-DVtzWhUT.js → shared-BLkGRKty.js} +1 -1
  132. package/dist/{show-COTZEYgc.js → show-DzoQIs75.js} +1 -1
  133. package/dist/{show-CMUg8SJu.js → show-FC3dJcD-.js} +1 -1
  134. package/dist/{status-D26U--p8.js → status-BU3DR1XU.js} +1 -1
  135. package/dist/{steer-C6uARLp5.js → steer-P_38hRRD.js} +1 -1
  136. package/dist/{stop-BrGI3hSS.js → stop-BJGDRPsp.js} +1 -1
  137. package/dist/{stop-ByCAlbmN.js → stop-BWY6k6v5.js} +1 -1
  138. package/dist/{store-DzqXS2wT.js → store-B3ZHoBJY.js} +4 -4
  139. package/dist/{store-B94tSate.js → store-BLi19UDE.js} +1 -1
  140. package/dist/{task-CgOKgkEG.js → task-b2BK481M.js} +1 -1
  141. package/dist/{test-NEbhlxvo.js → test-BrSrhop9.js} +1 -1
  142. package/dist/{tools-D0Zfs8Hx.js → tools-CgswhJzh.js} +1 -1
  143. package/dist/{unalias-C9NqmSDq.js → unalias-mMHXqok7.js} +1 -1
  144. package/dist/{update-BTxYQj7Z.js → update-DbOWToPy.js} +1 -1
  145. package/dist/{upgrade-hA0yWBvx.js → upgrade-D6oC9HQI.js} +2 -2
  146. package/dist/{usage-BhqoCjvE.js → usage-Cb8Dtv9V.js} +1 -1
  147. package/dist/{usage-C4d9X2Uq.js → usage-DMs-IIJC.js} +1 -1
  148. package/dist/{watch-DtRuC0Wc.js → watch-BcMQXGYO.js} +1 -1
  149. package/dist/{watch-CSdj24ct.js → watch-eE2XiwsC.js} +1 -1
  150. package/dist/{worker-DX7P9kWl.js → worker-DrucI22w.js} +1 -1
  151. package/dist/{workflow-Dcmdooi8.js → workflow-Cshghoas.js} +1 -1
  152. package/docs/cli.md +145 -0
  153. package/package.json +3 -2
  154. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  155. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  156. package/src/core/defaults.ts +25 -0
  157. package/src/server/dash/app/dash/layout.css +58 -1
  158. package/src/server/dash/app/dash/layout.tsx +16 -4
  159. package/src/server/dash/app/dash/settings/[tab]/page.tsx +1 -1
  160. package/src/server/dash/comps/nav/side-toggle.tsx +1 -1
  161. package/src/server/dash/comps/ui/menu.tsx +5 -1
  162. package/src/server/dash/comps/ui/toast.css +3 -2
  163. package/dist/auth-DWHIzqbA.js +0 -1
  164. package/dist/credentials-B1jv6dkg.js +0 -1
  165. package/dist/dash/public/assets/chunks/shared-init-ffb3397e494137c9.js +0 -2
  166. package/dist/dash/public/assets/dash-9e02d5d1a6d42ee3.css +0 -1
  167. package/dist/dash/public/assets/dash-account-04859899c1838ada.css +0 -1
  168. package/dist/dash/public/assets/dash-agents-9e678137267dec07.css +0 -1
  169. package/dist/dash/public/assets/dash-agents-new-26fa27b17ef9b8d8.css +0 -1
  170. package/dist/dash/public/assets/dash-agents-param-slug-b975c48f8abf3444.css +0 -1
  171. package/dist/dash/public/assets/dash-agents-param-slug-edit-e13fda599bb04843.css +0 -1
  172. package/dist/dash/public/assets/dash-agents-param-slug-platforms-70292932cb27bc96.css +0 -1
  173. package/dist/dash/public/assets/dash-agents-param-slug-settings-71f9a86251723fcc.css +0 -1
  174. package/dist/dash/public/assets/dash-agents-param-slug-tasks-fb8eb2ed71006601.css +0 -1
  175. package/dist/dash/public/assets/dash-agents-param-slug-usage-7c8740f1cdd52c71.css +0 -1
  176. package/dist/dash/public/assets/dash-settings-8eb818da462227e8.css +0 -1
  177. package/dist/dash/public/assets/dash-settings-param-tab-849a1a9542e273f5.css +0 -1
  178. package/dist/dash/public/assets/dash-tasks-81e510e0b6931b42.css +0 -1
  179. package/dist/dash/public/assets/dash-tasks-param-id-bbd2a83342f2ec10.css +0 -1
  180. package/dist/dash/public/assets/dash-usage-8e0259e03eaed1bd.css +0 -1
  181. package/dist/dash/public/assets/pnext-client-03b03b254e525e82.js +0 -1
  182. package/dist/dash/public/assets/pnext-client-1c7859bb888f4ef0.js +0 -1
  183. package/dist/dash/public/assets/pnext-client-3c748afe963fb05d.js +0 -1
  184. package/dist/dash/public/assets/pnext-client-4f47c2cae220f107.js +0 -1
  185. package/dist/dash/public/assets/pnext-client-6ab9fd9b53b794d2.js +0 -1
  186. package/dist/dash/public/assets/pnext-client-6c241786342498e4.js +0 -1
  187. package/dist/dash/public/assets/pnext-client-80b56d420f02b808.js +0 -1
  188. package/dist/dash/public/assets/pnext-client-83135c17bae850a3.js +0 -1
  189. package/dist/dash/public/assets/pnext-client-8e6fa4302ae0396f.js +0 -1
  190. package/dist/dash/public/assets/pnext-client-932c9d8cc0717fc8.js +0 -1
  191. package/dist/dash/public/assets/pnext-client-a42ae63d4de113f9.js +0 -1
  192. package/dist/dash/public/assets/pnext-client-d2ee6f8c1e337032.js +0 -1
  193. package/dist/dash/public/assets/pnext-client-d513f65ec23b7f20.js +0 -1
  194. package/dist/dash/public/assets/pnext-client-ecb88e2a8a109954.js +0 -1
  195. package/dist/dash/public/assets/pnext-client-f1545ee6270bbf9a.js +0 -1
  196. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/boot-B2MFTRO2.js +0 -30
  197. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/build-tier-XJJSL5FR.js +0 -2704
  198. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-2HFY3DQT.js +0 -208
  199. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-2ICEVELW.js +0 -834
  200. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-3UPROT2C.js +0 -35
  201. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-4P5CMIYT.js +0 -1582
  202. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-4TKZKZ3Q.js +0 -131
  203. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-5RDEILQB.js +0 -437
  204. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-62KEQM43.js +0 -25
  205. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-6KQSWT6D.js +0 -831
  206. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-7DCNCW6O.js +0 -724
  207. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-B4THCTQP.js +0 -22
  208. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-C2LIV2MM.js +0 -172
  209. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-CCATPVTW.js +0 -378
  210. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-COXJAPTU.js +0 -89
  211. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-E6IXL2NJ.js +0 -6270
  212. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-FLGRBFAH.js +0 -1198
  213. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-FTJVHFWD.js +0 -61
  214. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-H523KSIH.js +0 -5151
  215. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-HT6KKX6A.js +0 -20
  216. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-JESFYECC.js +0 -438
  217. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-JRPJM2XY.js +0 -17
  218. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-L2IWDUXG.js +0 -107
  219. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-L5P4Y4UC.js +0 -183
  220. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-NQE46AZN.js +0 -647
  221. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-PA4QEARJ.js +0 -129
  222. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-PZ5AXOLW.js +0 -7146
  223. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-SNVPTULL.js +0 -2397
  224. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-T3QZT3PG.js +0 -220
  225. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-VC5O2SDP.js +0 -72
  226. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-WZX4V6CM.js +0 -231
  227. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-XUUIDXY5.js +0 -627
  228. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-ZHFDO3PR.js +0 -265
  229. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/compile-CE2DN7ZA.js +0 -18
  230. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/config-UREY7XJT.js +0 -16
  231. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/config-loader-UI2XE3PZ.js +0 -17
  232. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/entry.js +0 -219
  233. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/generate-I2PPTDFD.js +0 -16
  234. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/modules-UVOCE4C2.js +0 -48
  235. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/pipeline-UW47K537.js +0 -963
  236. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/proxy-ITGOVJBW.js +0 -26
  237. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/register-4SA55SWT.js +0 -12579
  238. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/router-JNKHLBCZ.js +0 -505
  239. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/routes-PD6J2NXW.js +0 -54
  240. package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/tsconfig-defaults-ZXEH7RQK.js +0 -15
  241. package/dist/integrations-5xCaXSd-.js +0 -1
  242. package/dist/refresh-BIrmrWYq.js +0 -1
  243. package/dist/runner-D7ScbIHJ.js +0 -1
  244. package/src/server/dash/app/dash/token-from-hash.tsx +0 -17
package/README.md CHANGED
@@ -2,47 +2,48 @@
2
2
 
3
3
  # Coder
4
4
 
5
- **Delegate coding to supervised subagents of any model from your favorite harness.**
5
+ **The runtime for agents, your rules, any model, everywhere.**
6
6
 
7
7
  </div>
8
8
 
9
+ Coder turns any model into an agent you own. One runtime and one set of rules, with full control of every task, whether it runs in your local harness, from your own code, or always on in Coder Cloud.
10
+
9
11
  ## Why Coder
10
12
 
11
- - **Any harness, any model.** One runtime for Claude Code, Codex and more, dispatching to Codex, Claude, any OpenAI-compatible endpoint, or local models. Pick per task.
12
- - **Clean context.** Your conversation stays about intent and orchestration; implementation details live in the subagents.
13
- - **Fast dispatch.** Handoffs are instant, and light enough to spin up a large number of subagents at once.
14
- - **Fully controlled tasks.** Unified permissions across engines (_Read-only_, _Workspace-write_, _Auto_), live visibility into every task, and mid-run steering.
15
- - **Flows and SDK.** Orchestrate whole waves of tasks from a plain TypeScript file, or drive everything from your own code.
16
- - **Agents.** Customizable agents that answer on GitHub, Slack and other platforms, hosted or self-hosted, and run the same from your terminal. The built-in `coder` agent answers questions, reviews pull requests, and makes requested changes.
13
+ - **Any harness, any model.** Claude Code, Codex or any other harness, running any model from your subscriptions, an API endpoint, or your own machine. Pick per task.
14
+ - **Clean context.** Your conversation stays about intent. The work happens in subagents, and only the result comes back.
15
+ - **Fast dispatch.** Handoffs are instant, and light enough to run many agents at once.
16
+ - **Fully controlled.** One permission model across every engine, live visibility into every task, and steering mid-run.
17
+ - **Always on.** Your agents run in the cloud, connected to GitHub, Slack and any other app, each task in its own workspace with only the access you grant.
18
+ - **Your agents, your team.** Build agents with their own instructions, triggers and tools, and share them, with their credentials, across your workspace.
19
+ - **Flows and SDK.** Orchestrate whole waves of tasks from one TypeScript file, or drive everything from your own code.
20
+ - **Built-in review.** Review any diff with a read-only agent that checks every finding against your repo.
17
21
 
18
22
  ## Get started
19
23
 
20
- **1. Install into your host.**
24
+ | I want to | Start with |
25
+ | ---------------------------------------------------------------------------------- | ----------------------------------------------- |
26
+ | Hand tasks off from Claude Code, Codex or another harness | [In your local harness](#in-your-local-harness) |
27
+ | Run my agents always on in the cloud, connected to GitHub, Slack and any other app | [Coder Cloud](#coder-cloud) |
28
+ | Script tasks, reviews and flows from code | [From code](#from-code) |
29
+ | Run it on my own servers | [Self-host](#self-host) |
21
30
 
22
- **Claude Code** - from inside a session:
31
+ ## In your local harness
23
32
 
24
- ```
25
- /plugin marketplace add muzam1l/coder
26
- /plugin install coder@coder-plugins
27
- /reload-plugins
28
- /coder:setup
29
- ```
30
-
31
- Or from the shell:
33
+ **Install.**
32
34
 
33
35
  ```bash
34
36
  npm install -g @wular/coder
35
- coder setup-host claude
36
37
  ```
37
38
 
38
- **Others** - Codex, Pi, OpenCode, and anything else that reads the Agent Skills standard dir (`~/.agents/skills`):
39
+ **Add it to your host.**
39
40
 
40
- ```bash
41
- npm install -g @wular/coder
42
- coder setup-host agents
43
- ```
41
+ | Host | Install |
42
+ | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
43
+ | Claude Code | `coder setup-host claude`<br>or, inside Claude Code:<br>`/plugin marketplace add muzam1l/coder`<br>`/plugin install coder@coder-plugins`<br>`/coder:setup` |
44
+ | Codex, Pi, OpenCode and any host that reads `~/.agents/skills` | `coder setup-host agents` |
44
45
 
45
- **2. Connect at least one engine.** Either an engine CLI, logged in, to use that subscription:
46
+ **Connect a model.** Coder uses the engines you're signed in to, or your own model ([Models](docs/models.md)).
46
47
 
47
48
  ```bash
48
49
  npm install -g @openai/codex && codex login
@@ -50,47 +51,66 @@ npm install -g @openai/codex && codex login
50
51
  npm install -g @anthropic-ai/claude-code && claude auth login
51
52
  ```
52
53
 
53
- Or a local/provider model of your own (see [Models](docs/models.md)). `coder setup-host` checks what's ready.
54
-
55
- **3. Ask your host to use it:**
54
+ **Use it.** Ask your host:
56
55
 
57
56
  > Use Coder to explain the directory structure of the workspace.
58
57
 
59
- Or make it the default in AGENTS.md/CLAUDE.md:
60
-
61
- > Always use Coder for all implementation and system exploring tasks.
58
+ To make it the default, add this line to your project's `AGENTS.md` or `CLAUDE.md`:
62
59
 
63
- Recommended setup: Claude Code as host (fable low/medium) and Codex (sol) as engine - best for performance and cost distribution.
60
+ ```md
61
+ Always use Coder for implementation and exploration.
62
+ ```
64
63
 
65
- ## Staying up to date
64
+ Every task runs under the permissions you set and stays yours to watch, steer or stop. See them all in the browser:
66
65
 
67
66
  ```bash
68
- coder upgrade
67
+ coder dash
69
68
  ```
70
69
 
71
- Updates the CLI through whichever package manager installed it and refreshes the host plugins to match. See `coder upgrade --help` for narrowing flags. Set `CODER_NO_UPDATE_CHECK=1` to silence the update notice.
70
+ > **Recommended setup:** Claude Code as the host (Fable, low or medium effort) and Codex (sol) as the engine, the best split of performance and cost.
71
+
72
+ [Models](docs/models.md) · [Configuration](docs/config.md) · [MCP](docs/mcp.md)
73
+
74
+ ## Coder Cloud
75
+
76
+ Your agents, always on at **[coder.wular.ai](https://coder.wular.ai)** or [on your own servers](#self-host). Connect GitHub, Slack or any other app, and they work right inside it.
77
+
78
+ - **Your agents.** Instructions, triggers and tools, set in the dashboard or in `.coder/agents/` in your repo.
79
+ - **Every app, one dashboard.** GitHub, Slack and the rest of the integration catalog.
80
+ - **Scoped access.** Each task gets a fresh workspace and a platform token limited to that task.
81
+ - **A built-in agent.** `coder` answers questions, reviews pull requests, and opens them for requested changes.
72
82
 
73
- ## Agents
83
+ [Dashboard](docs/dash.md) · [Agents](docs/agents/index.md)
74
84
 
75
- An agent is standing instructions plus its engine, tools and flows, and it works everywhere. In the cloud it answers events on GitHub, Slack and other platforms, like a pull request opening or a DM, on your own subscription or key, hosted or self-hosted. In your terminal, `coder task run --agent <id>` runs the same agent, and `coder dash` gives it a local dashboard. Install the built-in `coder` agent or write your own.
85
+ ## From code
76
86
 
77
- See [Agents](docs/agents/index.md) to install, define, and configure agents, [Dashboard](docs/dash.md) for a local UI over the CLI (`coder dash`), and [Self-hosting](docs/self-host.md) to run your own instance. The built-in `coder` agent works across GitHub and Slack and runs the [review flow](docs/review.md) for pull requests.
87
+ Your host drives tasks itself, but everything is scriptable:
88
+
89
+ ```bash
90
+ coder run "<text>" # dispatch a task (--wait to block for the answer)
91
+ coder list # recent tasks (running + just stopped)
92
+ coder result [task-id] # status + final answer (--wait blocks until done)
93
+ coder task steer <task-id> "<text>" # continue a task with new instructions
94
+ coder task ask <task-id> "<question>" # ask about a task without interrupting it
95
+ coder task stop <task-id> # interrupt it
96
+ coder task watch [task-id] # stream the live transcript
97
+ coder review --pr 42 --post # read-only review, posted inline
98
+ ```
78
99
 
79
- ## Flows
100
+ Any `[task-id]` defaults to the most recent task.
80
101
 
81
- For well-defined workflows, ask your host to write a flow. A Coder flow is a TypeScript file that fans out coders at scale with built-in support for deterministic verification gates, crash/resume handling, etc. Ask like:
102
+ For a repeatable workflow, ask your host to write a flow:
82
103
 
83
104
  > Create a Coder flow that fixes every failing test file: one task per file, gated on its tests passing.
84
105
 
85
- The harness authors the flow, you can review or tweak it, and it runs with live status and mid-run steering like any coder task. A generated flow looks like this:
106
+ A flow is one TypeScript file that fans out tasks, with verification gates and resume after a crash:
86
107
 
87
108
  ```ts
88
- // .coder/flows/first.ts
109
+ // .coder/flows/fix-tests.ts
89
110
  import { z } from 'zod';
90
111
  import { task, gate, pipeline } from '@wular/coder/flow';
91
112
 
92
113
  const failing = await task('Run `bun test` and list the failing test files.', {
93
- name: 'Find failing tests',
94
114
  returns: z.object({ files: z.array(z.string()) }),
95
115
  });
96
116
 
@@ -101,37 +121,16 @@ export default await pipeline(
101
121
  );
102
122
  ```
103
123
 
104
- See [Flows](docs/flows.md), or the [SDK](docs/sdk.md) to drive everything from your own code.
105
-
106
- ## Configuration
107
-
108
- Machine defaults live in `~/.coder/config.json`; `.coder/config.json` in a repo overrides per project. See [Configuration](docs/config.md).
109
-
110
- ## Advanced usage
124
+ [CLI](docs/cli.md) · [Flows](docs/flows.md) · [Review](docs/review.md) · [SDK](docs/sdk.md)
111
125
 
112
- You rarely need these - the host agent drives tasks itself - but everything is scriptable:
126
+ ## Self-host
113
127
 
114
- ```bash
115
- coder run "<text>" # dispatch a task (--wait to block for the answer)
116
- coder list # list recent tasks (by default running + just stopped)
117
- coder result [task-id] # status + final answer (--wait blocks until done)
118
- coder task steer <task-id> "<text>" # continue a task with new instructions
119
- coder task ask <task-id> "<question>" # ask about a task without interrupting it
120
- coder task stop <task-id> # interrupt it
121
- coder task watch [task-id] # stream the live transcript
122
- coder task approve <task-id> <appr-id> # answer an escalated permission (--deny)
128
+ Run all of Coder Cloud on your own infrastructure: one server, one Postgres database, and your tasks running wherever you choose, from Docker and Vercel Sandbox to GitHub Actions or a teammate's machine. Deploy it in one click on Vercel or anywhere Bun runs.
123
129
 
124
- coder flow run <name|path> --wait # run a flow (--dry-run to preview prompts)
125
- coder flow list # recent flow runs
126
- coder flow discover # flows runnable here (workspace + global)
127
- coder flow result [run-id] # progress and result across the whole wave
128
- coder flow watch [run-id] # watch the wave live (replay + follow)
129
- coder flow stop [run-id] # stop a run and its tasks
130
- coder flow resume [run-id] # continue a crashed or edited run
130
+ [Self-hosting](docs/self-host.md) · [Vercel template](src/server/deploy/vercel/README.md)
131
131
 
132
- coder docs [topic] # print bundled docs (flows, review, sdk, config, models)
133
- ```
132
+ ## Docs
134
133
 
135
- Any `[task-id]` defaults to the most recent task.
134
+ Everything else is at **[coder.wular.ai/docs](https://coder.wular.ai/docs)**.
136
135
 
137
- Full docs: `coder --help`.
136
+ `coder --help` lists every command, and `coder docs [topic]` prints the bundled guides. `coder upgrade` keeps the CLI and host plugins current.
@@ -1 +1 @@
1
- import{i as e,t}from"./cli-BilSDkvE.js";import{p as n}from"./output-BKeyLbvt.js";import{c as r,n as i,s as a}from"./args-BOEEdpWk.js";import{credentialOptions as o}from"./remove-eQ8y5C5p.js";import s from"node:process";const c=e({name:`credentials add`,globalFlags:{cwd:!1},help:{usage:`coder credentials add [label] --engine <claude|codex|custom> --env <NAME> [--env <NAME> ...] [--value <secret|->] [--workspace] [--no-check] [--default] [--server [url]]`,summary:`Store an API key, encrypted on the server, as your personal credential or with --workspace for every member. The value comes from the named environment variable unless --value says otherwise, and is never printed. Without subscription sign-in on the server, CLAUDE_CODE_OAUTH_TOKEN takes your own claude setup-token output.`,examples:[[`ANTHROPIC_API_KEY=sk-... coder credentials add --engine claude --env ANTHROPIC_API_KEY`,`your own API key, read from the environment`],[`OPENAI_API_KEY=sk-... coder credentials add team --engine codex --env OPENAI_API_KEY --workspace`,`a workspace key every member's tasks can use`],[`pbpaste | coder credentials add router --engine custom --env OPENROUTER_API_KEY --value -`,`any provider, value from stdin`]],flags:[[`--env <NAME>`,`one environment variable name; repeat for more (reads that variable by default)`],[`--engine <name>`,`claude, codex, or custom`],[`--value <secret|->`,`literal values land in shell history and are visible to other processes; use - for stdin or prefer environment variables`],[`--workspace`,`a workspace credential; owners and admins only`],[`--no-check`,`skip the provider credential check`],[`--default`,`make this the default for its engine`],t]},options:{...o,engine:a,env:r,value:a,"no-check":i,default:i},args:1,run:async({options:e,args:[t]})=>{let{addCredential:n}=await import(`./remote-miQNTVRa.js`).then(e=>e.a);return n(t,{...e,env:e.env??[],noCheck:e[`no-check`]})},print:(e,{options:t})=>s.stdout.write(`Added ${t.workspace?`workspace`:`personal`} credential ${n.bold(e.label)}.\n`)});export{c as commandCredentialsAdd};
1
+ import{i as e,t}from"./cli-DWCR7iqa.js";import{p as n}from"./output-BKeyLbvt.js";import{c as r,n as i,s as a}from"./args-BOEEdpWk.js";import{credentialOptions as o}from"./remove-CLpL12Ya.js";import s from"node:process";const c=e({name:`credentials add`,globalFlags:{cwd:!1},help:{usage:`coder credentials add [label] --engine <claude|codex|custom> --env <NAME> [--env <NAME> ...] [--value <secret|->] [--workspace] [--no-check] [--default] [--server [url]]`,summary:`Store an API key, encrypted on the server, as your personal credential or with --workspace for every member. The value comes from the named environment variable unless --value says otherwise, and is never printed. Without subscription sign-in on the server, CLAUDE_CODE_OAUTH_TOKEN takes your own claude setup-token output.`,examples:[[`ANTHROPIC_API_KEY=sk-... coder credentials add --engine claude --env ANTHROPIC_API_KEY`,`your own API key, read from the environment`],[`OPENAI_API_KEY=sk-... coder credentials add team --engine codex --env OPENAI_API_KEY --workspace`,`a workspace key every member's tasks can use`],[`pbpaste | coder credentials add router --engine custom --env OPENROUTER_API_KEY --value -`,`any provider, value from stdin`]],flags:[[`--env <NAME>`,`one environment variable name; repeat for more (reads that variable by default)`],[`--engine <name>`,`claude, codex, or custom`],[`--value <secret|->`,`literal values land in shell history and are visible to other processes; use - for stdin or prefer environment variables`],[`--workspace`,`a workspace credential; owners and admins only`],[`--no-check`,`skip the provider credential check`],[`--default`,`make this the default for its engine`],t]},options:{...o,engine:a,env:r,value:a,"no-check":i,default:i},args:1,run:async({options:e,args:[t]})=>{let{addCredential:n}=await import(`./remote-miQNTVRa.js`).then(e=>e.a);return n(t,{...e,env:e.env??[],noCheck:e[`no-check`]})},print:(e,{options:t})=>s.stdout.write(`Added ${t.workspace?`workspace`:`personal`} credential ${n.bold(e.label)}.\n`)});export{c as commandCredentialsAdd};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DT7IzrpZ.js";import{i as t}from"./cli-BilSDkvE.js";import{p as n}from"./output-BKeyLbvt.js";import{n as r,s as i,t as a}from"./args-BOEEdpWk.js";import{t as o}from"./models-_5LVGC3m.js";import s from"node:process";var c=e({commandModelAdd:()=>d,modelOptions:()=>l,modelSavedJson:()=>f,printModelSaved:()=>p,writeOptions:()=>u});const l={...a,"base-url":i,model:i,"env-key":i,workspace:r},u=e=>({baseUrl:e[`base-url`],model:e.model,envKey:e[`env-key`],workspace:e.workspace}),d=t({name:`model add`,help:{usage:`coder model add <name> --base-url <url> --model <id> [--env-key VAR]`,summary:`Connect a custom model behind an OpenAI-compatible endpoint (Ollama, LM Studio,
1
+ import{t as e}from"./rolldown-runtime-DT7IzrpZ.js";import{i as t}from"./cli-DWCR7iqa.js";import{p as n}from"./output-BKeyLbvt.js";import{n as r,s as i,t as a}from"./args-BOEEdpWk.js";import{t as o}from"./models-_5LVGC3m.js";import s from"node:process";var c=e({commandModelAdd:()=>d,modelOptions:()=>l,modelSavedJson:()=>f,printModelSaved:()=>p,writeOptions:()=>u});const l={...a,"base-url":i,model:i,"env-key":i,workspace:r},u=e=>({baseUrl:e[`base-url`],model:e.model,envKey:e[`env-key`],workspace:e.workspace}),d=t({name:`model add`,help:{usage:`coder model add <name> --base-url <url> --model <id> [--env-key VAR]`,summary:`Connect a custom model behind an OpenAI-compatible endpoint (Ollama, LM Studio,
2
2
  vLLM, OpenRouter, ...). It currently runs on the codex engine pointed at your
3
3
  URL and is usable anywhere a model is: --model <name>, --engine custom, or as an
4
4
  agent default in config. Alias: \`coder model setup\`.`,flags:[[`--base-url <url>`,`OpenAI-compatible API base (e.g. http://localhost:11434/v1)`],[`--model <id>`,`the provider's model id (e.g. qwen2.5-coder:32b)`],[`--env-key <VAR>`,`env var holding the API key (omit for keyless local endpoints)`],[`--workspace`,`write to <repo>/.coder/config.json instead of the user file`]],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`]]},options:l,args:1,run:({options:e,args:[t],cwd:n})=>o(n,t,u(e)),json:f,print:e=>p(e,`saved`)});function f({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 p({name:e,entry:t,file:r,probe:i,codex:a,install:o,nativeResponses:c,keyMissing:l},u){let d=n,f=e=>` ${d.green(`✔`)} ${e}`,p=e=>` ${d.red(`✘`)} ${e}`,m=[`${u} ${d.cyan(e)} -> ${t.model} @ ${t.baseUrl} ${d.dim(`(${r})`)}`,``,i.reachable?f(`${i.detail} ${d.dim(`(${c?`responses api, direct`:`chat api, auto-translated`})`)}`):p(i.detail),a.available?f(o?.installed?`${o.note} ${d.dim(`(${a.detail})`)}`:`codex engine ${d.dim(`(${a.detail})`)}`):p(o?.note??`codex CLI not installed - run: npm install -g @openai/codex`)];l&&m.push(p(`env var ${t.envKey} is not set in this shell`)),m.push(``,d.dim([`Use it: coder run --model ${e} "<task>"`,`Make default: coder config set engines.custom.model ${e}`].join(`
@@ -1 +1 @@
1
- import{rt as e}from"./dispatch-BKeAch9E.js";import{i as t}from"./cli-BilSDkvE.js";import{n,s as r,t as i}from"./args-BOEEdpWk.js";import a from"node:process";const o=({name:e,file:t})=>a.stdout.write(`Added MCP server "${e}" to ${t}. Attach with --mcp ${e}.\n`),s=a=>t({name:`mcp add`,help:{usage:`coder mcp add <name> [--tools a,b] [--user] (--url <url> [--header K=V] [--transport http|sse] | [--env K=V] -- <command> [args...])`,summary:"Save an MCP server under `mcp.<name>`: a remote url, or the command to spawn after `--`.",flags:[[`--url <url>`,`remote server (streamable HTTP by default)`],[`--header <K=V,...>`,"request headers for a remote server; values may hold ${VAR}"],[`--transport <http|sse>`,`remote transport (default: http)`],[`--env <K=V,...>`,"environment for a stdio server; values may hold ${VAR} or ${VAR:-default}"],[`--tools <a,b>`,`tool allowlist (default: every tool the server offers)`],[`--user`,`write ~/.coder config instead of the repo`]],examples:[[`coder mcp add docs -- npx -y docs-mcp`,`then: coder run --mcp docs "..."`]]},options:{...i,env:r,header:r,url:r,transport:r,tools:r,user:n},args:1,run:({options:t,args:[n],cwd:r})=>e(r,n,{...t,command:a}),print:o}),c=Object.assign(e=>{let t=e.indexOf(`--`);return s(t===-1?[]:e.slice(t+1))(t===-1?e:e.slice(0,t))},s([]));export{c as commandMcpAdd,o as printAdded};
1
+ import{rt as e}from"./dispatch-BKeAch9E.js";import{i as t}from"./cli-DWCR7iqa.js";import{n,s as r,t as i}from"./args-BOEEdpWk.js";import a from"node:process";const o=({name:e,file:t})=>a.stdout.write(`Added MCP server "${e}" to ${t}. Attach with --mcp ${e}.\n`),s=a=>t({name:`mcp add`,help:{usage:`coder mcp add <name> [--tools a,b] [--user] (--url <url> [--header K=V] [--transport http|sse] | [--env K=V] -- <command> [args...])`,summary:"Save an MCP server under `mcp.<name>`: a remote url, or the command to spawn after `--`.",flags:[[`--url <url>`,`remote server (streamable HTTP by default)`],[`--header <K=V,...>`,"request headers for a remote server; values may hold ${VAR}"],[`--transport <http|sse>`,`remote transport (default: http)`],[`--env <K=V,...>`,"environment for a stdio server; values may hold ${VAR} or ${VAR:-default}"],[`--tools <a,b>`,`tool allowlist (default: every tool the server offers)`],[`--user`,`write ~/.coder config instead of the repo`]],examples:[[`coder mcp add docs -- npx -y docs-mcp`,`then: coder run --mcp docs "..."`]]},options:{...i,env:r,header:r,url:r,transport:r,tools:r,user:n},args:1,run:({options:t,args:[n],cwd:r})=>e(r,n,{...t,command:a}),print:o}),c=Object.assign(e=>{let t=e.indexOf(`--`);return s(t===-1?[]:e.slice(t+1))(t===-1?e:e.slice(0,t))},s([]));export{c as commandMcpAdd,o as printAdded};
@@ -1 +1 @@
1
- import{xt as e}from"./dispatch-BKeAch9E.js";import{i as t,t as n}from"./cli-BilSDkvE.js";import{c as r,s as i}from"./args-BOEEdpWk.js";import{runnerOptions as a}from"./remove-B93LNkZI.js";import o from"node:process";const s=t({name:`runner add`,globalFlags:{cwd:!1},args:1,help:{usage:`coder runner add <kind> [--name <name>] [--scope <scope>] [--field key=value …] [--server [url]] [--json]`,summary:`Connect a runner. Secret fields read environment variables with key=env:VARIABLE. Adding local prints a pairing command.`,flags:[[`--name <name>`,`runner display name`],[`--scope <scope>`,`personal or workspace`],[`--field key=value`,`repeat for each field, use env:VARIABLE for secrets`],n]},options:{...a,name:i,scope:i,field:r},async run({options:t,args:[n]}){if(!n)throw new e(`invalid-option`,`Missing runner kind.`);let{addRunnerFields:r}=await import(`./runner-sUpWJ_k0.js`).then(e=>e.a);return r(n,t)},print:e=>o.stdout.write(`${`command`in e?e.command:`Added ${e.name} (${e.id}).`}\n`)});export{s as commandRunnerAdd};
1
+ import{xt as e}from"./dispatch-BKeAch9E.js";import{i as t,t as n}from"./cli-DWCR7iqa.js";import{c as r,s as i}from"./args-BOEEdpWk.js";import{runnerOptions as a}from"./remove-BNzbUhaK.js";import o from"node:process";const s=t({name:`runner add`,globalFlags:{cwd:!1},args:1,help:{usage:`coder runner add <kind> [--name <name>] [--scope <scope>] [--field key=value …] [--server [url]] [--json]`,summary:`Connect a runner. Secret fields read environment variables with key=env:VARIABLE. Adding local prints a pairing command.`,flags:[[`--name <name>`,`runner display name`],[`--scope <scope>`,`personal or workspace`],[`--field key=value`,`repeat for each field, use env:VARIABLE for secrets`],n]},options:{...a,name:i,scope:i,field:r},async run({options:t,args:[n]}){if(!n)throw new e(`invalid-option`,`Missing runner kind.`);let{addRunnerFields:r}=await import(`./runner-sUpWJ_k0.js`).then(e=>e.a);return r(n,t)},print:e=>o.stdout.write(`${`command`in e?e.command:`Added ${e.name} (${e.id}).`}\n`)});export{s as commandRunnerAdd};
@@ -1 +1 @@
1
- import{it as e}from"./dispatch-BKeAch9E.js";import{i as t}from"./cli-BilSDkvE.js";import{n,t as r}from"./args-BOEEdpWk.js";import{printAdded as i}from"./add-CE-70LFs.js";const a=t({name:`mcp add-json`,help:{usage:`coder mcp add-json <name> '<json entry>' [--user]`,summary:`Save an entry pasted from any .mcp.json (command/args/env or url/headers, plus tools).`,flags:[[`--user`,`write ~/.coder config instead of the repo`]]},options:{...r,user:n},args:2,run:({options:t,args:[n,r],cwd:i})=>e(i,n,r,t),print:i});export{a as commandMcpAddJson};
1
+ import{it as e}from"./dispatch-BKeAch9E.js";import{i as t}from"./cli-DWCR7iqa.js";import{n,t as r}from"./args-BOEEdpWk.js";import{printAdded as i}from"./add-DRsPpQFl.js";const a=t({name:`mcp add-json`,help:{usage:`coder mcp add-json <name> '<json entry>' [--user]`,summary:`Save an entry pasted from any .mcp.json (command/args/env or url/headers, plus tools).`,flags:[[`--user`,`write ~/.coder config instead of the repo`]]},options:{...r,user:n},args:2,run:({options:t,args:[n,r],cwd:i})=>e(i,n,r,t),print:i});export{a as commandMcpAddJson};
@@ -1,3 +1,3 @@
1
1
  import{t as e}from"./rolldown-runtime-DT7IzrpZ.js";import{xt as t}from"./dispatch-BKeAch9E.js";import{t as n}from"./types-D0q15RJa.js";import{a as r}from"./load-BpEsAn51.js";import{i,n as a}from"./remote-miQNTVRa.js";import{t as o}from"./integrations-BAgdVDhj.js";import{a as s,r as c}from"./exec-RZFLclKX.js";import{c as l,o as u,u as d}from"./task-DeglY79z.js";import{n as f}from"./match-CXAjDhg7.js";import p from"node:path";import m from"node:process";import h from"node:fs";import{spawn as g}from"node:child_process";import _ from"node:os";import v from"node:fs/promises";const y=/\x1b\[[0-9;?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[()][A-Z0-9]|\r/g;function b(e,t){if(e===`codex`)return{file:`codex`,args:[`login`,`--device-auth`],env:{CODEX_HOME:t}};let n=`stty cols 4000 rows 50 2>/dev/null; exec claude setup-token`;return{file:`sh`,args:[`-c`,`cat | { ${m.platform===`darwin`?`script -q /dev/null sh -c '${n}'`:`script -qfec '${n}' /dev/null`}; kill 0; }`],env:{CLAUDE_CONFIG_DIR:t,BROWSER:`true`}}}function x(e){try{return JSON.parse(Buffer.from(String(e).split(`.`)[1]??``,`base64url`).toString())}catch{return{}}}function S(e){let t=x(JSON.parse(e).tokens?.id_token),n=t[`https://api.openai.com/auth`];return{...typeof t.email==`string`?{email:t.email}:{},...typeof n?.chatgpt_plan_type==`string`?{plan:n.chatgpt_plan_type}:{}}}function C(e,t){let n=t.replace(y,``),r=/\x1b\]8;[^;]*;(https:\/\/[^\x07\x1b]+)(?:\x07|\x1b\\)/.exec(t)?.[1],i=e===`claude`?r??/https:\/\/\S*(?:oauth|authorize)\S*(?=\s)/.exec(n)?.[0]:/https:\/\/\S+(?=\s)/.exec(n)?.[0],a=e===`codex`?/\b[A-Z0-9]{4,}-[A-Z0-9]{4,}\b/.exec(n)?.[0]:void 0;if(!(!i||e===`codex`&&!a))return{url:i,...a?{code:a}:{}}}async function w(e,t){let{server:n,token:r}=d();delete m.env.CODER_TASK_TOKEN,delete m.env.CODER_LOGIN;let i=new AbortController,a=async(t,a)=>{let o=await fetch(`${n}/logins/${encodeURIComponent(e)}${t}`,{method:a===void 0?`GET`:`POST`,...t?{signal:i.signal}:{},headers:{authorization:`Bearer ${r}`,...a===void 0?{}:{"content-type":`application/json`}},...a===void 0?{}:{body:JSON.stringify(a)}});if(!o.ok)throw Error(`Coder server answered ${o.status}`);return await o.json()},{engine:o}=await a(``),s=await v.mkdtemp(p.join(t,`.login-`)),c=b(o,s),l=g(c.file,c.args,{env:{...m.env,...c.env},stdio:[`pipe`,`pipe`,`pipe`],detached:!0}),u=()=>{try{m.kill(-l.pid,`SIGTERM`)}catch{}},f=``,h=``,_=!1,x=new Promise((e,t)=>{l.once(`error`,t),l.once(`close`,e)}),w=setTimeout(u,6e5),T=async()=>{for(;!i.signal.aborted;){let{code:e}=await a(`/input`);if(e)return void l.stdin.write(`${e}\r`)}},E=e=>{if(f+=e.toString(),h=f.replace(y,``),!_){let e=C(o,f);e&&(_=!0,m.stdout.write(`Sign-in link ready
2
2
  `),a(``,e).catch(()=>u()),o===`claude`&&T().catch(()=>{i.signal.aborted||u()}))}o===`claude`&&/sk-ant-oat[\w-]+\s/.test(h)&&u()};l.stdout.on(`data`,E),l.stderr.on(`data`,E);try{let e=await x;i.abort();let t=/sk-ant-oat[A-Za-z0-9_-]+/.exec(h)?.[0];if(o===`claude`&&t){let e=/[\w.+-]+@[\w-]+(?:\.[\w-]+)+/.exec(h)?.[0];await a(``,{result:{env:{CLAUDE_CODE_OAUTH_TOKEN:t},...e?{account:{email:e}}:{}}})}else if(o===`codex`&&e===0){let e=await v.readFile(p.join(s,`auth.json`),`utf8`);await a(``,{result:{env:{CODEX_AUTH_JSON:e},account:S(e)}})}else await a(``,{error:_?`Sign-in did not finish. Start again.`:`${o} sign-in could not start.`}).catch(()=>{});m.stdout.write(`Sign-in finished
3
- `)}finally{clearTimeout(w),i.abort(),u(),await v.rm(s,{recursive:!0,force:!0})}}var T=e({agentIdError:()=>k,agents:()=>P,regexError:()=>A});const E=e=>e.cwd?p.resolve(e.cwd):m.cwd(),D=e=>(Array.isArray(e)?e:(e??``).split(`,`)).map(e=>e.trim()).filter(Boolean),O=/^[a-z0-9][a-z0-9_-]*$/;function k(e,t){if(!O.test(t))return`Use lowercase letters, digits, - or _, starting with a letter or digit.`;let n=p.join(e,`.coder`,`agents`,t);if(h.existsSync(n)&&h.readdirSync(n).length>0)return`${p.relative(e,n)} is not empty; clear it to start over, or edit what is there.`}function A(e){try{new RegExp(e);return}catch{return`Not a valid regular expression.`}}function j(e,t){let n=o[e]?.sample;return{integration:e,type:t,appId:`${e}:sample`,installationId:`sample`,deliveryId:`sample-1`,actor:{id:`user-1`,login:`someone`,role:`member`},text:`Replace me with the text a real event would carry.`,...n?{chat:{thread:{_type:`chat:Thread`,adapterName:e,channelId:n.slice(0,n.lastIndexOf(`:`)),id:n,isDM:!1}}}:{}}}async function M(e,r={}){let i=E(r);if(!e&&r.askId&&(e=await r.askId(e=>k(i,e))),!e)throw new t(`invalid-option`,`Missing agent id.`,{hint:`Usage: coder agent init <id>`});let a=k(i,e);if(a)throw new t(`invalid-option`,a.includes(`not empty`)?a:`Agent id "${e}": ${a}`);let s=p.join(i,`.coder`,`agents`,e),c=r.askPicks?await r.askPicks(e):{...r.name?{name:r.name}:{},integrations:D(r.integrations).length?D(r.integrations):[Object.keys(o)[0]],events:{},matches:{},tools:r.tools??`comment`};if(!n.includes(c.tools))throw new t(`invalid-option`,`Unknown preset "${c.tools}"; valid: ${n.join(`, `)}`);let l={},u=D(r.triggers),d=e=>Object.keys(o[e]?.events??{});for(let e of c.integrations)if(!o[e])throw new t(`invalid-option`,`Unknown integration "${e}"; valid: ${Object.keys(o).join(`, `)}`);for(let e of u)if(!c.integrations.some(t=>d(t).includes(e)))throw new t(`invalid-option`,`No chosen integration has event "${e}".`,{hint:`Events per integration: coder agent integrations show <id>`});let f=Object.fromEntries(D(r.match).map(e=>{let n=e.indexOf(`=`);if(n<1)throw new t(`invalid-option`,`Bad --match "${e}"; use event=regex.`);let r=e.slice(n+1);if(A(r))throw new t(`invalid-option`,`Bad --match for ${e.slice(0,n)}: ${A(r)}`);return[e.slice(0,n),r]}));for(let e of c.integrations){let n=d(e),r=c.events[e]??(u.length?u.filter(e=>n.includes(e)):[n.includes(`mention`)?`mention`:n[0]]);for(let i of r)if(!n.includes(i))throw new t(`invalid-option`,`${e} has no event "${i}"; valid: ${n.join(`, `)}`);let i={...f,...c.matches[e]??{}},a=r.filter(e=>i[e]);r.length&&(l[e]={triggers:a.length?Object.fromEntries(r.map(e=>[e,!i[e]||{match:i[e]}])):r,tools:c.tools})}let m={...c.name?{name:c.name}:{},...r.description?{description:r.description}:{},permissions:r.permissions??`read-only`,integrations:l};await v.mkdir(s,{recursive:!0}),await v.writeFile(p.join(s,`agent.json`),`${JSON.stringify(m,null,2)}\n`),await v.writeFile(p.join(s,`system.md`),`You are ${c.name??e}.\n`);let h=p.join(_.tmpdir(),`coder-agent-samples`,e),g=[];for(let[e,t]of Object.entries(l)){let n=(Array.isArray(t.triggers)?t.triggers:Object.keys(t.triggers??{}))[0];await v.mkdir(h,{recursive:!0});let r=p.join(h,`sample-${e}-${n}.json`);await v.writeFile(r,`${JSON.stringify(j(e,n),null,2)}\n`),g.push(r)}return{id:e,dir:s,files:[`agent.json`,`system.md`],samples:g,integrations:Object.keys(l)}}function N(e){if(e===void 0||typeof e==`number`)return e;if(/^\d+$/.test(e))return Number(e);let n=/^(\d+)([dh])$/.exec(e);if(!n)throw new t(`invalid-option`,`Invalid --since value.`,{hint:`Use 7d, 24h, or milliseconds since epoch`});return Date.now()-Number(n[1])*(n[2]===`d`?864e5:36e5)}const P={list:(e={})=>e.server===void 0?r(E(e),o):a(e).agents.list(),async show(e,n={}){if(!e)throw new t(`invalid-option`,`Missing agent id.`,{hint:`Usage: coder agent show <id>`});if(n.server===void 0){let i=(await r(E(n),o)).find(t=>t.id===e);if(!i)throw new t(`invalid-option`,`No agent named "${e}".`,{hint:`List agents: coder agent list`});return i}let i=a(n),s=await i.agents.get(e),c=await i.agents.version(e,s.currentVersion);return{...s,definition:c.definition}},init:M,push:(e,t={})=>i(a(t),E(t),e),async run(e,n,i={}){if(i.wait&&i.server===void 0)throw new t(`invalid-option`,`--wait needs --server.`,{hint:`Offline runs print their reply as they finish`});if(!e||!n)throw new t(`invalid-option`,`Missing agent id or event file.`,{hint:`Usage: coder agent run <agent> <event.json>`});let l=E(i),u=typeof n==`string`?JSON.parse(await v.readFile(p.resolve(l,n),`utf8`)):n;if(i.server!==void 0){let t=a(i),n=await t.tasks.create({agent:e,event:u});if(!i.wait||!n.tasks.length)return n;let r=[];for(let e of n.tasks){let n=await t.tasks.wait(e,{onLog:i.onLog});r.push(n),i.onDone?.(n)}return r}let d=await r(l,o),m=d.find(t=>t.id===e);if(!m)throw new t(`invalid-option`,`No agent named "${e}".`);let h=f(u,d).find(t=>t.agent.id===e),g=i.flow??h?.flow;if(!g)throw new t(`invalid-option`,`Agent "${e}" does not match event "${u.type}".`);return c({cwd:l,agent:e,flow:g,task:{...s(m,g,u),tools:{},...h?.permissions?{permissions:h.permissions}:{}},post:!1})},runTask(e,t={}){let n=E(t);return m.env.CODER_LOGIN?w(e,n):m.env.CODER_PREPARE?u(e,n):l(e,n)},async usage(e={}){if(e.by&&![`agent`,`installation`,`engine`].includes(e.by))throw new t(`invalid-option`,`Invalid --by value.`,{hint:`Use agent, installation, or engine`});let n=e.by;if(e.server!==void 0)return a(e).usage({since:N(e.since),by:n});let[{localUsage:r},{usageSummary:i}]=await Promise.all([import(`./store-DzqXS2wT.js`).then(e=>e.p),import(`./usage-BhqoCjvE.js`).then(e=>e.a)]);return i(r(E(e)).map(([,e])=>e),N(e.since)??0,n)},integrations:{list:()=>Object.entries(o).map(([e,t])=>({id:e,description:t.description,events:Object.keys(t.events),tools:t.tools.presets.write})),show(e){if(!e)throw new t(`invalid-option`,`Missing integration id.`,{hint:`Usage: coder agent integrations show <id>`});let n=o[e];if(!n)throw new t(`invalid-option`,`Unknown integration "${e}".`,{hint:`List integrations: coder agent integrations list`});return{id:e,events:Object.fromEntries(Object.entries(n.events).map(([e,t])=>[e,t.description])),tools:n.tools.presets}}}};export{P as n,T as t};
3
+ `)}finally{clearTimeout(w),i.abort(),u(),await v.rm(s,{recursive:!0,force:!0})}}var T=e({agentIdError:()=>k,agents:()=>P,regexError:()=>A});const E=e=>e.cwd?p.resolve(e.cwd):m.cwd(),D=e=>(Array.isArray(e)?e:(e??``).split(`,`)).map(e=>e.trim()).filter(Boolean),O=/^[a-z0-9][a-z0-9_-]*$/;function k(e,t){if(!O.test(t))return`Use lowercase letters, digits, - or _, starting with a letter or digit.`;let n=p.join(e,`.coder`,`agents`,t);if(h.existsSync(n)&&h.readdirSync(n).length>0)return`${p.relative(e,n)} is not empty; clear it to start over, or edit what is there.`}function A(e){try{new RegExp(e);return}catch{return`Not a valid regular expression.`}}function j(e,t){let n=o[e]?.sample;return{integration:e,type:t,appId:`${e}:sample`,installationId:`sample`,deliveryId:`sample-1`,actor:{id:`user-1`,login:`someone`,role:`member`},text:`Replace me with the text a real event would carry.`,...n?{chat:{thread:{_type:`chat:Thread`,adapterName:e,channelId:n.slice(0,n.lastIndexOf(`:`)),id:n,isDM:!1}}}:{}}}async function M(e,r={}){let i=E(r);if(!e&&r.askId&&(e=await r.askId(e=>k(i,e))),!e)throw new t(`invalid-option`,`Missing agent id.`,{hint:`Usage: coder agent init <id>`});let a=k(i,e);if(a)throw new t(`invalid-option`,a.includes(`not empty`)?a:`Agent id "${e}": ${a}`);let s=p.join(i,`.coder`,`agents`,e),c=r.askPicks?await r.askPicks(e):{...r.name?{name:r.name}:{},integrations:D(r.integrations).length?D(r.integrations):[Object.keys(o)[0]],events:{},matches:{},tools:r.tools??`comment`};if(!n.includes(c.tools))throw new t(`invalid-option`,`Unknown preset "${c.tools}"; valid: ${n.join(`, `)}`);let l={},u=D(r.triggers),d=e=>Object.keys(o[e]?.events??{});for(let e of c.integrations)if(!o[e])throw new t(`invalid-option`,`Unknown integration "${e}"; valid: ${Object.keys(o).join(`, `)}`);for(let e of u)if(!c.integrations.some(t=>d(t).includes(e)))throw new t(`invalid-option`,`No chosen integration has event "${e}".`,{hint:`Events per integration: coder agent integrations show <id>`});let f=Object.fromEntries(D(r.match).map(e=>{let n=e.indexOf(`=`);if(n<1)throw new t(`invalid-option`,`Bad --match "${e}"; use event=regex.`);let r=e.slice(n+1);if(A(r))throw new t(`invalid-option`,`Bad --match for ${e.slice(0,n)}: ${A(r)}`);return[e.slice(0,n),r]}));for(let e of c.integrations){let n=d(e),r=c.events[e]??(u.length?u.filter(e=>n.includes(e)):[n.includes(`mention`)?`mention`:n[0]]);for(let i of r)if(!n.includes(i))throw new t(`invalid-option`,`${e} has no event "${i}"; valid: ${n.join(`, `)}`);let i={...f,...c.matches[e]??{}},a=r.filter(e=>i[e]);r.length&&(l[e]={triggers:a.length?Object.fromEntries(r.map(e=>[e,!i[e]||{match:i[e]}])):r,tools:c.tools})}let m={...c.name?{name:c.name}:{},...r.description?{description:r.description}:{},permissions:r.permissions??`read-only`,integrations:l};await v.mkdir(s,{recursive:!0}),await v.writeFile(p.join(s,`agent.json`),`${JSON.stringify(m,null,2)}\n`),await v.writeFile(p.join(s,`system.md`),`You are ${c.name??e}.\n`);let h=p.join(_.tmpdir(),`coder-agent-samples`,e),g=[];for(let[e,t]of Object.entries(l)){let n=(Array.isArray(t.triggers)?t.triggers:Object.keys(t.triggers??{}))[0];await v.mkdir(h,{recursive:!0});let r=p.join(h,`sample-${e}-${n}.json`);await v.writeFile(r,`${JSON.stringify(j(e,n),null,2)}\n`),g.push(r)}return{id:e,dir:s,files:[`agent.json`,`system.md`],samples:g,integrations:Object.keys(l)}}function N(e){if(e===void 0||typeof e==`number`)return e;if(/^\d+$/.test(e))return Number(e);let n=/^(\d+)([dh])$/.exec(e);if(!n)throw new t(`invalid-option`,`Invalid --since value.`,{hint:`Use 7d, 24h, or milliseconds since epoch`});return Date.now()-Number(n[1])*(n[2]===`d`?864e5:36e5)}const P={list:(e={})=>e.server===void 0?r(E(e),o):a(e).agents.list(),async show(e,n={}){if(!e)throw new t(`invalid-option`,`Missing agent id.`,{hint:`Usage: coder agent show <id>`});if(n.server===void 0){let i=(await r(E(n),o)).find(t=>t.id===e);if(!i)throw new t(`invalid-option`,`No agent named "${e}".`,{hint:`List agents: coder agent list`});return i}let i=a(n),s=await i.agents.get(e),c=await i.agents.version(e,s.currentVersion);return{...s,definition:c.definition}},init:M,push:(e,t={})=>i(a(t),E(t),e),async run(e,n,i={}){if(i.wait&&i.server===void 0)throw new t(`invalid-option`,`--wait needs --server.`,{hint:`Offline runs print their reply as they finish`});if(!e||!n)throw new t(`invalid-option`,`Missing agent id or event file.`,{hint:`Usage: coder agent run <agent> <event.json>`});let l=E(i),u=typeof n==`string`?JSON.parse(await v.readFile(p.resolve(l,n),`utf8`)):n;if(i.server!==void 0){let t=a(i),n=await t.tasks.create({agent:e,event:u});if(!i.wait||!n.tasks.length)return n;let r=[];for(let e of n.tasks){let n=await t.tasks.wait(e,{onLog:i.onLog});r.push(n),i.onDone?.(n)}return r}let d=await r(l,o),m=d.find(t=>t.id===e);if(!m)throw new t(`invalid-option`,`No agent named "${e}".`);let h=f(u,d).find(t=>t.agent.id===e),g=i.flow??h?.flow;if(!g)throw new t(`invalid-option`,`Agent "${e}" does not match event "${u.type}".`);return c({cwd:l,agent:e,flow:g,task:{...s(m,g,u),tools:{},...h?.permissions?{permissions:h.permissions}:{}},post:!1})},runTask(e,t={}){let n=E(t);return m.env.CODER_LOGIN?w(e,n):m.env.CODER_PREPARE?u(e,n):l(e,n)},async usage(e={}){if(e.by&&![`agent`,`installation`,`engine`].includes(e.by))throw new t(`invalid-option`,`Invalid --by value.`,{hint:`Use agent, installation, or engine`});let n=e.by;if(e.server!==void 0)return a(e).usage({since:N(e.since),by:n});let[{localUsage:r},{usageSummary:i}]=await Promise.all([import(`./store-B3ZHoBJY.js`).then(e=>e.p),import(`./usage-Cb8Dtv9V.js`).then(e=>e.a)]);return i(r(E(e)).map(([,e])=>e),N(e.since)??0,n)},integrations:{list:()=>Object.entries(o).map(([e,t])=>({id:e,description:t.description,events:Object.keys(t.events),tools:t.tools.presets.write})),show(e){if(!e)throw new t(`invalid-option`,`Missing integration id.`,{hint:`Usage: coder agent integrations show <id>`});let n=o[e];if(!n)throw new t(`invalid-option`,`Unknown integration "${e}".`,{hint:`List integrations: coder agent integrations list`});return{id:e,events:Object.fromEntries(Object.entries(n.events).map(([e,t])=>[e,t.description])),tools:n.tools.presets}}}};export{P as n,T as t};
@@ -1 +1 @@
1
- import{s as e}from"./cli-BilSDkvE.js";const t=e(`agent`,{tools:async()=>(await import(`./tools-D0Zfs8Hx.js`)).commandTools,list:async()=>(await import(`./list-BYiG8Zav.js`)).commandAgentList,ls:async()=>(await import(`./list-BYiG8Zav.js`)).commandAgentList,show:async()=>(await import(`./show-CMUg8SJu.js`)).commandAgentShow,run:async()=>(await import(`./run-CawRGnOg.js`)).commandAgentRun,init:async()=>(await import(`./init-CoMfFxbG.js`)).commandAgentInit,push:async()=>(await import(`./push-CUC55Bqd.js`)).commandAgentPush,usage:async()=>(await import(`./usage-C4d9X2Uq.js`)).commandAgentUsage,integrations:async()=>(await import(`./integrations-5xCaXSd-.js`)).commandAgentIntegrations},{menu:[{usage:`list`,blurb:`list local or server-owned agents`},{usage:`show <id>`,blurb:`one agent in full: settings, integrations, triggers, tools`},{usage:`init [id]`,blurb:`scaffold an agent folder in .coder/agents`},{usage:`push [id]`,blurb:`upload workspace agents to a Coder server`},{usage:`integrations <list|show>`,blurb:`the integration catalog: coder agent integrations --help`},{usage:`run <agent> <event.json>`,blurb:`run a recorded event through an agent, offline or on a server`},{usage:`usage`,blurb:`aggregate usage by agent, installation, or engine`}],description:[`Define and run agents from the CLI, the dashboard, or on GitHub, Slack and other platforms.`]},{aliases:{ls:`list`},nested:[`integrations`]});export{t as commandAgent};
1
+ import{s as e}from"./cli-DWCR7iqa.js";const t=e(`agent`,{tools:async()=>(await import(`./tools-CgswhJzh.js`)).commandTools,list:async()=>(await import(`./list-5Ljf9TxF.js`)).commandAgentList,ls:async()=>(await import(`./list-5Ljf9TxF.js`)).commandAgentList,show:async()=>(await import(`./show-FC3dJcD-.js`)).commandAgentShow,run:async()=>(await import(`./run-BdPjxaZU.js`)).commandAgentRun,init:async()=>(await import(`./init-C4tDFH4G.js`)).commandAgentInit,push:async()=>(await import(`./push-DbdnbZYt.js`)).commandAgentPush,usage:async()=>(await import(`./usage-DMs-IIJC.js`)).commandAgentUsage,integrations:async()=>(await import(`./integrations-D-L3uQRj.js`)).commandAgentIntegrations},{menu:[{usage:`list`,blurb:`list local or server-owned agents`},{usage:`show <id>`,blurb:`one agent in full: settings, integrations, triggers, tools`},{usage:`init [id]`,blurb:`scaffold an agent folder in .coder/agents`},{usage:`push [id]`,blurb:`upload workspace agents to a Coder server`},{usage:`integrations <list|show>`,blurb:`the integration catalog: coder agent integrations --help`},{usage:`run <agent> <event.json>`,blurb:`run a recorded event through an agent, offline or on a server`},{usage:`usage`,blurb:`aggregate usage by agent, installation, or engine`}],description:[`Define and run agents from the CLI, the dashboard, or on GitHub, Slack and other platforms.`]},{aliases:{ls:`list`},nested:[`integrations`]});export{t as commandAgent};
@@ -1,2 +1,2 @@
1
- import{i as e}from"./cli-BilSDkvE.js";import{p as t}from"./output-BKeyLbvt.js";import{n}from"./models-_5LVGC3m.js";import{n as r}from"./add-U-pty9qJ.js";import i from"node:process";const a=e({name:`model alias`,help:{usage:`coder model alias <name> <spec> [--workspace]`,summary:`Save an alias for an engine spec, e.g. fast -> codex:luna. An alias may reuse a
1
+ import{i as e}from"./cli-DWCR7iqa.js";import{p as t}from"./output-BKeyLbvt.js";import{n}from"./models-_5LVGC3m.js";import{n as r}from"./add-CLYTF_up.js";import i from"node:process";const a=e({name:`model alias`,help:{usage:`coder model alias <name> <spec> [--workspace]`,summary:`Save an alias for an engine spec, e.g. fast -> codex:luna. An alias may reuse a
2
2
  built-in name to override it.`,flags:[[`--workspace`,`target <repo>/.coder/config.json instead of the user file`]]},options:r,args:2,run:({options:e,args:[t,r],cwd:i})=>n(i,t,r,e),print:o});function o(e){let n=t,r=`${e.provider} ${e.model}${e.effort?` (${e.effort})`:``}`;i.stdout.write(`aliased ${n.cyan(e.alias)} -> ${e.provider}:${e.model}${e.effort?`:${e.effort}`:``} ${n.dim(`= ${r}`)} ${n.dim(`(${e.file})`)}\n`)}export{a as commandModelAlias};
@@ -1 +1 @@
1
- import{s as e}from"./cli-BilSDkvE.js";const t=e(`server app`,{create:async()=>(await import(`./create-C_iMJV4Y.js`)).commandServerAppCreate},{menu:[{usage:`create <integration>`,blurb:`create the built-in agent's public app`}],description:[`The built-in agent's apps, one per platform, shared by every workspace on this server.`],exampleCommand:`server app create`});export{t as commandServerApp};
1
+ import{s as e}from"./cli-DWCR7iqa.js";const t=e(`server app`,{create:async()=>(await import(`./create-D3f6q0Yq.js`)).commandServerAppCreate},{menu:[{usage:`create <integration>`,blurb:`create the built-in agent's public app`}],description:[`The built-in agent's apps, one per platform, shared by every workspace on this server.`],exampleCommand:`server app create`});export{t as commandServerApp};
@@ -1,2 +1,2 @@
1
- import{wt as e}from"./dispatch-BKeAch9E.js";import{i as t,r as n}from"./cli-BilSDkvE.js";import{a as r,p as i,s as a}from"./output-BKeyLbvt.js";import{i as o,n as s,s as c,t as l}from"./args-BOEEdpWk.js";import u from"node:process";const d={server:o,workspace:c,yes:s};function f(e,t){let n=i;if(!t.length)return void u.stdout.write(`${n.dim(`No approvals for task ${e}.`)}\n`);for(let e of t){let t=e.answered??`pending`;u.stdout.write(`${n.cyan(e.id)} ${t.padEnd(8)} ${n.dim(String(e.summary??``))}\n`)}let r=t.filter(e=>!e.answered);if(r.length){let e=r.length===1?r[0].id:`<approval-id>`;u.stdout.write(`\n${a([`Answer: coder task approve ${e} [--deny]`],n)}\n`)}}function p(t){let n=i;if(!t.length)return void u.stdout.write(`${n.dim(`No pending approvals.`)}\n\n${a([`Check tasks: coder task list`],n)}\n`);let o={id:Math.max(11,...t.map(e=>e.id.length)),task:Math.max(7,...t.map(e=>e.taskId.length))};u.stdout.write(n.bold(n.light(`${`approval-id`.padEnd(o.id)} ${`task-id`.padEnd(o.task)} age summary\n`)));for(let i of t){let t=i.createdAt?r(e(i.createdAt)):`-`;u.stdout.write(`${n.cyan(i.id.padEnd(o.id))} ${n.cyan(i.taskId.padEnd(o.task))} ${t.padEnd(5)} ${n.light(i.summary)}\n`)}let s=t.length===1?t[0].id:`<approval-id>`;u.stdout.write(`\n${a([`Answer: coder task approve ${s} [--deny]`],n)}\n`)}const m=t({name:`task approvals`,help:{usage:`coder task approvals [task-id] [--server [url]]`,summary:`Without a task id: pending approvals across all tasks. With one: that task's
1
+ import{wt as e}from"./dispatch-BKeAch9E.js";import{i as t,r as n}from"./cli-DWCR7iqa.js";import{a as r,p as i,s as a}from"./output-BKeyLbvt.js";import{i as o,n as s,s as c,t as l}from"./args-BOEEdpWk.js";import u from"node:process";const d={server:o,workspace:c,yes:s};function f(e,t){let n=i;if(!t.length)return void u.stdout.write(`${n.dim(`No approvals for task ${e}.`)}\n`);for(let e of t){let t=e.answered??`pending`;u.stdout.write(`${n.cyan(e.id)} ${t.padEnd(8)} ${n.dim(String(e.summary??``))}\n`)}let r=t.filter(e=>!e.answered);if(r.length){let e=r.length===1?r[0].id:`<approval-id>`;u.stdout.write(`\n${a([`Answer: coder task approve ${e} [--deny]`],n)}\n`)}}function p(t){let n=i;if(!t.length)return void u.stdout.write(`${n.dim(`No pending approvals.`)}\n\n${a([`Check tasks: coder task list`],n)}\n`);let o={id:Math.max(11,...t.map(e=>e.id.length)),task:Math.max(7,...t.map(e=>e.taskId.length))};u.stdout.write(n.bold(n.light(`${`approval-id`.padEnd(o.id)} ${`task-id`.padEnd(o.task)} age summary\n`)));for(let i of t){let t=i.createdAt?r(e(i.createdAt)):`-`;u.stdout.write(`${n.cyan(i.id.padEnd(o.id))} ${n.cyan(i.taskId.padEnd(o.task))} ${t.padEnd(5)} ${n.light(i.summary)}\n`)}let s=t.length===1?t[0].id:`<approval-id>`;u.stdout.write(`\n${a([`Answer: coder task approve ${s} [--deny]`],n)}\n`)}const m=t({name:`task approvals`,help:{usage:`coder task approvals [task-id] [--server [url]]`,summary:`Without a task id: pending approvals across all tasks. With one: that task's
2
2
  permission escalations and how each was answered.`,flags:[n]},options:{...l,...d},args:1,run:async({options:e,args:[t]})=>{let{tasks:n}=await import(`./task-C6VAg5WU.js`).then(e=>e.t);return n.approvals(t,{...e,organization:e.workspace})},json:(e,{options:t,args:[n]})=>t.server===void 0&&n?e.map(({taskId:e,...t})=>t):t.server===void 0?e.map(({taskId:e,id:t,summary:n,createdAt:r})=>({taskId:e,id:t,summary:n,createdAt:r})):e,print(e,{options:t,args:[n]}){if(t.server===void 0)return n?f(n,e):p(e);if(!e.length)return void u.stdout.write(`${i.dim(`No pending approvals.`)}\n\n${a([`Check tasks: coder task list`],i)}\n`);for(let t of e)u.stdout.write(`${t.taskId} ${JSON.stringify(t)}\n`)}});export{m as commandApprovals};
@@ -1,2 +1,2 @@
1
- import{i as e,r as t}from"./cli-BilSDkvE.js";import{p as n}from"./output-BKeyLbvt.js";import{i as r,n as i,s as a,t as o}from"./args-BOEEdpWk.js";import s from"node:process";const c={server:r,workspace:a,yes:i},l=e({name:`task approve`,help:{usage:`coder task approve [task-id] <approval-id> [--deny] [--server [url]]`,summary:`Answer an escalated permission request. Accepts by default; --deny rejects it.
1
+ import{i as e,r as t}from"./cli-DWCR7iqa.js";import{p as n}from"./output-BKeyLbvt.js";import{i as r,n as i,s as a,t as o}from"./args-BOEEdpWk.js";import s from"node:process";const c={server:r,workspace:a,yes:i},l=e({name:`task approve`,help:{usage:`coder task approve [task-id] <approval-id> [--deny] [--server [url]]`,summary:`Answer an escalated permission request. Accepts by default; --deny rejects it.
2
2
  Approval ids are unique, so the task id is optional.`,flags:[[`--deny`,`reject the request instead of accepting`],t]},options:{...o,deny:i,...c},args:2,run:async({options:e,args:[t,n]})=>{let{tasks:r}=await import(`./task-C6VAg5WU.js`).then(e=>e.t);return r.approve(t,n,{...e,organization:e.workspace})},print:(e,{options:t,args:r})=>s.stdout.write(t.server===void 0?`${t.deny?`Denied`:`Approved`} ${n.cyan(e.approvalId)} on task ${n.cyan(e.taskId)}.\n`:`${t.deny?`Denied`:`Approved`} ${n.cyan(r[1])}.\n`)});export{l as commandApprove};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DT7IzrpZ.js";import{xt as t}from"./dispatch-BKeAch9E.js";import{i as n,t as r}from"./load-BpEsAn51.js";import{n as i}from"./integrations-BAgdVDhj.js";import{o as a}from"./local-H3uvqEbq.js";import{Un as o,Zn as s,t as c}from"./store-DzqXS2wT.js";import{n as l}from"./env-CRf6wkM2.js";import u from"node:process";var d=e({serverAppLink:()=>f});async function f(e,d={}){let f=l(d.env??u.env),p=i(f.integrations);if(!p[e])throw new t(`invalid-option`,`Unknown integration "${e}".`,{hint:`Pick one of ${Object.keys(p).join(`, `)}.`});if(!f.databaseUrl||!f.publicUrl)throw new t(`invalid-option`,`Built-in apps need the server database and address.`,{hint:`Set DATABASE_URL and PUBLIC_URL as the server has them.`});let m={...n()[r].json,...d.name?{name:d.name}:{}},h={agent:r,def:a(m),...d.owner?{owner:d.owner}:{},public:!0},g=await c(f);try{let t=g.defaultOrganizationId,n={config:f,organizationId:t,store:g.store(t)},r=await s(n,`create`,`*`,o(e,h)),i=new URLSearchParams({agent:h.agent,def:h.def,...h.owner?{owner:h.owner}:{},public:`1`,tx:r});return{url:`${f.publicUrl.replace(/\/$/,``)}/create/${e}?${i}`}}finally{await g.close()}}export{f as n,d as t};
1
+ import{t as e}from"./rolldown-runtime-DT7IzrpZ.js";import{xt as t}from"./dispatch-BKeAch9E.js";import{i as n,t as r}from"./load-BpEsAn51.js";import{n as i}from"./integrations-BAgdVDhj.js";import{o as a}from"./local-H3uvqEbq.js";import{Un as o,Zn as s,t as c}from"./store-B3ZHoBJY.js";import{n as l}from"./env-CRf6wkM2.js";import u from"node:process";var d=e({serverAppLink:()=>f});async function f(e,d={}){let f=l(d.env??u.env),p=i(f.integrations);if(!p[e])throw new t(`invalid-option`,`Unknown integration "${e}".`,{hint:`Pick one of ${Object.keys(p).join(`, `)}.`});if(!f.databaseUrl||!f.publicUrl)throw new t(`invalid-option`,`Built-in apps need the server database and address.`,{hint:`Set DATABASE_URL and PUBLIC_URL as the server has them.`});let m={...n()[r].json,...d.name?{name:d.name}:{}},h={agent:r,def:a(m),...d.owner?{owner:d.owner}:{},public:!0},g=await c(f);try{let t=g.defaultOrganizationId,n={config:f,organizationId:t,store:g.store(t)},r=await s(n,`create`,`*`,o(e,h)),i=new URLSearchParams({agent:h.agent,def:h.def,...h.owner?{owner:h.owner}:{},public:`1`,tx:r});return{url:`${f.publicUrl.replace(/\/$/,``)}/create/${e}?${i}`}}finally{await g.close()}}export{f as n,d as t};
@@ -1,3 +1,3 @@
1
- import{i as e}from"./cli-BilSDkvE.js";import{p as t}from"./output-BKeyLbvt.js";import{n,t as r}from"./args-BOEEdpWk.js";import i from"node:process";const a=e=>e===1?``:`s`,o=e({name:`flow archive`,help:{usage:`coder flow archive <run-id> | coder flow archive --all-stopped`,summary:`Archive a flow run so it drops out of the default list (see it again with
1
+ import{i as e}from"./cli-DWCR7iqa.js";import{p as t}from"./output-BKeyLbvt.js";import{n,t as r}from"./args-BOEEdpWk.js";import i from"node:process";const a=e=>e===1?``:`s`,o=e({name:`flow archive`,help:{usage:`coder flow archive <run-id> | coder flow archive --all-stopped`,summary:`Archive a flow run so it drops out of the default list (see it again with
2
2
  \`coder flow list --archived [--limit N]\`). Pass --all-stopped to archive every
3
3
  finished run. A running run must be stopped first.`,flags:[[`--all-stopped`,`archive every stopped (finished) run`]]},options:{...r,"all-stopped":n},args:1,run:async({options:e,args:[t]})=>{let{archiveRuns:n}=await import(`./executor-BvAA7Cgw.js`).then(e=>e.y);return n(t,{allStopped:e[`all-stopped`]})},print(e){if(!(`count`in e))return void i.stdout.write(`Archived run ${t.cyan(e.runId)}.\n`);i.stdout.write(e.count?`Archived ${e.count} stopped run${a(e.count)}.\n`:`${t.dim(`No stopped runs to archive.`)}\n`)}});export{o as commandArchive,a as plural};
@@ -1,4 +1,4 @@
1
- import{i as e,r as t}from"./cli-BilSDkvE.js";import{p as n}from"./output-BKeyLbvt.js";import{i as r,n as i,s as a,t as o}from"./args-BOEEdpWk.js";import s from"node:process";const c={server:r,workspace:a,yes:i},l=e=>e===1?``:`s`,u=e({name:`task archive`,help:{usage:`coder task archive <task-id> | coder task archive --all-stopped [--server [url]]`,summary:`Archive a task session so it drops out of the default list (see it again with
1
+ import{i as e,r as t}from"./cli-DWCR7iqa.js";import{p as n}from"./output-BKeyLbvt.js";import{i as r,n as i,s as a,t as o}from"./args-BOEEdpWk.js";import s from"node:process";const c={server:r,workspace:a,yes:i},l=e=>e===1?``:`s`,u=e({name:`task archive`,help:{usage:`coder task archive <task-id> | coder task archive --all-stopped [--server [url]]`,summary:`Archive a task session so it drops out of the default list (see it again with
2
2
  \`coder task list --archived [--limit N]\`). Pass --all-stopped to archive every
3
3
  finished task. A running task keeps running; steering an archived task
4
4
  brings it back.`,flags:[[`--all-stopped`,`archive every stopped (finished) task`],t]},options:{...o,"all-stopped":i,...c},args:1,run:async({options:e,args:[t]})=>{let{tasks:n}=await import(`./task-C6VAg5WU.js`).then(e=>e.t);return n.archive(t,{...e,organization:e.workspace,allStopped:e[`all-stopped`]})},print(e,{options:t}){if(e.count===void 0)return void s.stdout.write(`Archived task ${n.cyan(e.taskId)}.\n`);s.stdout.write(t.server===void 0?e.count?`Archived ${e.count} stopped task${l(e.count)}.\n`:`${n.dim(`No stopped tasks to archive.`)}\n`:`Archived ${e.count} server task${l(e.count)}.\n`)}});export{u as commandArchive,l as plural};
@@ -1 +1 @@
1
- import{i as e}from"./cli-BilSDkvE.js";import{n as t,s as n}from"./args-BOEEdpWk.js";const r=e({name:`task archive-sweep`,options:{cwd:n,flows:t},args:1/0,run:async({options:e,args:t,cwd:n})=>{let{archiveFlagged:r}=await import(`./actions-Mk3FSlpJ.js`).then(e=>e.t),{archiveFlaggedRuns:i}=await import(`./executor-BvAA7Cgw.js`).then(e=>e.y);return e.flows?i(t):r(n,t)}});export{r as commandArchiveSweep};
1
+ import{i as e}from"./cli-DWCR7iqa.js";import{n as t,s as n}from"./args-BOEEdpWk.js";const r=e({name:`task archive-sweep`,options:{cwd:n,flows:t},args:1/0,run:async({options:e,args:t,cwd:n})=>{let{archiveFlagged:r}=await import(`./actions-Mk3FSlpJ.js`).then(e=>e.t),{archiveFlaggedRuns:i}=await import(`./executor-BvAA7Cgw.js`).then(e=>e.y);return e.flows?i(t):r(n,t)}});export{r as commandArchiveSweep};
@@ -1,4 +1,4 @@
1
- import{i as e,r as t}from"./cli-BilSDkvE.js";import{p as n}from"./output-BKeyLbvt.js";import{i as r,n as i,s as a,t as o}from"./args-BOEEdpWk.js";import{idAndText as s}from"./steer-C6uARLp5.js";import c from"node:process";const l={server:r,workspace:a,yes:i},u=e({name:`task ask`,help:{usage:`coder task ask <task-id> "<question>" [--server [url]]`,summary:`Answer a question ABOUT a task without touching it: a read-only sidecar reads
1
+ import{i as e,r as t}from"./cli-DWCR7iqa.js";import{p as n}from"./output-BKeyLbvt.js";import{i as r,n as i,s as a,t as o}from"./args-BOEEdpWk.js";import{idAndText as s}from"./steer-P_38hRRD.js";import c from"node:process";const l={server:r,workspace:a,yes:i},u=e({name:`task ask`,help:{usage:`coder task ask <task-id> "<question>" [--server [url]]`,summary:`Answer a question ABOUT a task without touching it: a read-only sidecar reads
2
2
  the task's progress log, result, and workspace and answers; the task never
3
3
  sees the question and its thread is not steered. Works whether the task is
4
4
  running or stopped. To change what the task does, use \`coder task steer\`.`,flags:[[`--model <alias|slug>`,`sidecar model (default: the task's own)`],[`--effort <low|medium|high>`,`sidecar reasoning effort`],t],examples:[[`coder task ask task-abc "what approach did you take and why?"`,`probe a decision without derailing the task`]]},options:{...o,model:a,effort:a,...l},args:1/0,async run({options:e,args:t}){let{tasks:r}=await import(`./task-C6VAg5WU.js`).then(e=>e.t),{id:i,text:a}=s(t,`Missing task id or question.`,[`Usage: coder task ask <task-id> "<question>"`,`Help: coder task ask --help`]);return r.ask(i,a,{...e,organization:e.workspace,onAsking:t=>e.json||c.stderr.write(`${n.dim(`[coder]`)} asking about task ${n.cyan(t)} (read-only sidecar; the task is not interrupted)...\n`)})},json:({ok:e,...t})=>t,print(e,{options:t,args:[r]}){if(t.server!==void 0)return void c.stdout.write(`Asked server task ${n.cyan(r)}.\n`);let{answer:i,error:a}=e;i?c.stdout.write(`\n${i}\n`):c.stdout.write(`${n.dim(`(no answer)`)}${a?` ${n.red(a)}`:``}\n`)},exit:(e,{options:t})=>t.server===void 0?+!e.ok:void 0});export{u as commandAsk};
@@ -0,0 +1 @@
1
+ import{s as e}from"./cli-DWCR7iqa.js";const t=e(`auth`,{login:async()=>(await import(`./login-CNmeRAL7.js`)).commandLogin,logout:async()=>(await import(`./logout-j0dTo_Ib.js`)).commandLogout,status:async()=>(await import(`./status-BU3DR1XU.js`)).commandStatus},{menu:[{usage:`login`,blurb:`sign in through the browser`},{usage:`logout`,blurb:`sign out and forget the saved session`},{usage:`status`,blurb:`show where you are signed in`}],description:[`Sign in to Coder and manage saved server sessions.`],exampleCommand:`auth login`});export{t as commandAuth};
@@ -1 +1 @@
1
- import{i as e,l as t}from"./http-Bkg_OQ6r.js";import{Ft as n,dn as r,un as i}from"./store-DzqXS2wT.js";import{c as a}from"./schema-CU2iFkp8.js";import{a as o,i as s,o as c}from"./serve-CQKZxzFE.js";import{createECDH as l,hkdfSync as u}from"node:crypto";import*as d from"openid-client";import{and as f,eq as p}from"drizzle-orm";import{EncryptJWT as m,calculateJwkThumbprint as h,createRemoteJWKSet as g,jwtDecrypt as _,jwtVerify as v}from"jose";const y=(e,t)=>new Uint8Array(u(`sha256`,e,``,t,32));async function b(e){let t=y(e,`coder oidc client key`),n=l(`prime256v1`);n.setPrivateKey(t);let r=n.getPublicKey(),i={kty:`EC`,crv:`P-256`,x:Buffer.from(r.subarray(1,33)).toString(`base64url`),y:Buffer.from(r.subarray(33)).toString(`base64url`)},a=await crypto.subtle.importKey(`jwk`,{...i,d:Buffer.from(t).toString(`base64url`)},{name:`ECDSA`,namedCurve:`P-256`},!1,[`sign`]),o=await h(i);return{key:a,kid:o,jwk:{...i,kid:o,alg:`ES256`,use:`sig`}}}async function x(e){let t=[e.encryptionKey,e.previousEncryptionKey].filter(e=>!!e),n=await Promise.all(t.map(b));return{cookie:t.map(e=>y(e,`coder session cookie`)),client:n[0],jwks:{keys:n.map(e=>e.jwk)}}}const S=`${i}.session`,C=`${i}.oidc`,w=3800,T=2592e3,E=()=>Math.floor(Date.now()/1e3);function D(e){let t=new Map;for(let n of(e.get(`cookie`)??``).split(/;\s*/)){let e=n.indexOf(`=`);e>0&&t.set(n.slice(0,e),n.slice(e+1))}return t}function O(e){let t=[];for(;e.has(`${S}.${t.length}`);)t.push(`${S}.${t.length}`);return t}function k(e){let t=D(e);return t.get(S)??(O(t).map(e=>t.get(e)).join(``)||void 0)}function A(e){return Array.isArray(e)?e.flatMap(e=>typeof e?.id==`string`&&typeof e.role==`string`?[{id:e.id,slug:String(e.slug??e.id),name:String(e.name??e.slug??e.id),role:e.role}]:[]):[]}function j(e,t,n){let r=e.get(`x-coder-organization`),i=r?t.organizations.find(e=>e.slug===r||e.id===r):t.organizations.find(e=>e.id===n)??t.organizations[0];return i?{...t,organizationId:i.id,role:i.role}:r?{...t,organizationDenied:!0}:t}async function M(i,l){let u=l.auth.wular.url,h=l.publicUrl,y=new URL(h).origin,b=h.startsWith(`https:`),M=await x(l),N=`${h}${s}`,P=(e,t,n)=>`${e}=${t}; Path=/; HttpOnly; SameSite=Lax; Max-Age=${n}${b?`; Secure`:``}`,F=(e,t)=>new m(e).setProtectedHeader({alg:`dir`,enc:`A256GCM`}).setIssuedAt().setExpirationTime(`${t}s`).encrypt(M.cookie[0]);async function I(e){if(e)for(let t of M.cookie)try{return(await _(e,t)).payload}catch{}}async function L(e,t){let n=await F(t,T),r=O(D(e));if(n.length<=w)return[P(S,n,T),...r.map(e=>P(e,``,0))];let i=n.match(RegExp(`.{1,${w}}`,`g`));return[P(S,``,0),...i.map((e,t)=>P(`${S}.${t}`,e,T)),...r.slice(i.length).map(e=>P(e,``,0))]}let R=e=>[S,...O(D(e))].map(e=>P(e,``,0)),z,B=()=>z??=d.discovery(new URL(u),`${h}${c}`,void 0,d.PrivateKeyJwt(M.client),new URL(u).protocol===`http:`?{execute:[d.allowInsecureRequests]}:void 0).catch(e=>{throw z=void 0,e}),V,H=async()=>V??=g(new URL((await B()).serverMetadata().jwks_uri));function U(e,t){let n=e.claims();if(!n)throw Error(`Wular Auth returned no ID token`);let r=A(n.organizations);return{sub:n.sub,name:typeof n.name==`string`?n.name:``,email:typeof n.email==`string`?n.email:``,orgs:r,org:r.some(e=>e.id===t?.org)?t.org:r[0]?.id,exp_at:E()+(e.expires_in??600),at:E(),rt:e.refresh_token??t?.rt,idt:e.id_token??t?.idt}}let W=new Map;function G(e){let t=e.rt;if(!t)return Promise.resolve(void 0);let n=W.get(t);return n||(n=B().then(e=>d.refreshTokenGrant(e,t)).then(t=>U(t,e)).catch(()=>{W.delete(t)}),W.set(t,n),setTimeout(()=>W.delete(t),6e4).unref?.()),n}async function K(e,t,n){let r=(await H().then(t=>v(e,t,{issuer:u,audience:y,typ:`at+jwt`})).catch(()=>void 0))?.payload;if(!r?.sub)return;let i={user:{id:r.sub,name:``,email:``},organizations:A(r.organizations)};return n&&E()-(r.iat??0)>60?{...i,stale:!0}:j(t,i)}async function q(e){let t=await B().catch(()=>void 0);if(!t)return Response.redirect(`${h}/login?error=unavailable`,302);let n={verifier:d.randomPKCECodeVerifier(),state:d.randomState(),nonce:d.randomNonce(),return:r(e.searchParams.get(`return`),y)},i=d.buildAuthorizationUrl(t,{redirect_uri:N,scope:o,code_challenge:await d.calculatePKCECodeChallenge(n.verifier),code_challenge_method:`S256`,state:n.state,nonce:n.nonce});return new Response(null,{status:302,headers:{location:i.href,"set-cookie":P(C,await F(n,600),600)}})}async function J(e,t){let n=e=>{let t=new Headers({location:`/login?error=${encodeURIComponent(e)}`});return t.append(`set-cookie`,P(C,``,0)),new Response(null,{status:302,headers:t})},r=await I(D(e.headers).get(C));if(!r)return n(`expired`);let i=t.searchParams.get(`error`);if(i)return n(i);let a;try{a=U(await d.authorizationCodeGrant(await B(),new URL(`${N}${t.search}`),{pkceCodeVerifier:r.verifier,expectedState:r.state,expectedNonce:r.nonce,idTokenExpected:!0}))}catch{return n(`sign_in_failed`)}let o=new Headers({location:r.return});o.append(`set-cookie`,P(C,``,0));for(let t of await L(e.headers,a))o.append(`set-cookie`,t);return new Response(null,{status:302,headers:o})}async function Y(t){if(!n(t,h))return e();let r=await I(k(t.headers)),i=await B().catch(()=>void 0),a=`${h}/?signed_out=1`,o=i?.serverMetadata().end_session_endpoint&&r?.idt?d.buildEndSessionUrl(i,{id_token_hint:r.idt,post_logout_redirect_uri:a}).href:a,s=Response.json({url:o});for(let e of R(t.headers))s.headers.append(`set-cookie`,e);return s}return{issuer:u,jwks:M.jwks,handler(e){let n=new URL(e.url);return n.pathname===`/api/auth/sign-in`&&e.method===`GET`?q(n):n.pathname===`/api/auth/callback`&&e.method===`GET`?J(e,n):n.pathname===`/api/auth/sign-out`&&e.method===`POST`?Y(e):Promise.resolve(t())},async session(e,t=!1){let n=e.get(`authorization`);if(n?.startsWith(`Bearer `))return K(n.slice(7),e,t);let r=await I(k(e));if(!r)return;let i;if(r.exp_at<=E()||t&&E()-r.at>60){if(r=await G(r),!r)return;i=await L(e,r)}return j(e,{user:{id:r.sub,name:r.name,email:r.email},organizations:r.orgs,...i?{cookies:i}:{}},r.org)},async setOrganization(e,t){let n=await I(k(e)),r=n?.orgs.find(e=>e.slug===t);if(!(!n||!r))return{...r,cookies:await L(e,{...n,org:r.id})}},async link(e,t,n,r={}){let o={name:e.name,email:e.email,...r.organizations?{organizations:r.organizations}:{},...r.token?{token:r.token}:{}};await i.insert(a).values({platform:t,platformUserId:n,userId:e.id,...o}).onConflictDoUpdate({target:[a.platform,a.platformUserId],set:o,setWhere:p(a.userId,e.id)});let[s]=await i.select({userId:a.userId}).from(a).where(f(p(a.platform,t),p(a.platformUserId,n)));return s?.userId===e.id?`linked`:`taken`},async linkedUser(e,t){let[n]=await i.select({id:a.userId,name:a.name,email:a.email,organizations:a.organizations,token:a.token}).from(a).where(f(p(a.platform,e),p(a.platformUserId,t)));return n&&{id:n.id,name:n.name,email:n.email,...n.organizations?{organizations:n.organizations}:{},...n.token?{token:n.token}:{}}}}}export{M as createAuth};
1
+ import{i as e,l as t}from"./http-Bkg_OQ6r.js";import{Ft as n,dn as r,un as i}from"./store-B3ZHoBJY.js";import{c as a}from"./schema-CU2iFkp8.js";import{a as o,i as s,o as c}from"./serve-DA5I2qXj.js";import{createECDH as l,hkdfSync as u}from"node:crypto";import*as d from"openid-client";import{and as f,eq as p}from"drizzle-orm";import{EncryptJWT as m,calculateJwkThumbprint as h,createRemoteJWKSet as g,jwtDecrypt as _,jwtVerify as v}from"jose";const y=(e,t)=>new Uint8Array(u(`sha256`,e,``,t,32));async function b(e){let t=y(e,`coder oidc client key`),n=l(`prime256v1`);n.setPrivateKey(t);let r=n.getPublicKey(),i={kty:`EC`,crv:`P-256`,x:Buffer.from(r.subarray(1,33)).toString(`base64url`),y:Buffer.from(r.subarray(33)).toString(`base64url`)},a=await crypto.subtle.importKey(`jwk`,{...i,d:Buffer.from(t).toString(`base64url`)},{name:`ECDSA`,namedCurve:`P-256`},!1,[`sign`]),o=await h(i);return{key:a,kid:o,jwk:{...i,kid:o,alg:`ES256`,use:`sig`}}}async function x(e){let t=[e.encryptionKey,e.previousEncryptionKey].filter(e=>!!e),n=await Promise.all(t.map(b));return{cookie:t.map(e=>y(e,`coder session cookie`)),client:n[0],jwks:{keys:n.map(e=>e.jwk)}}}const S=`${i}.session`,C=`${i}.oidc`,w=3800,T=2592e3,E=()=>Math.floor(Date.now()/1e3);function D(e){let t=new Map;for(let n of(e.get(`cookie`)??``).split(/;\s*/)){let e=n.indexOf(`=`);e>0&&t.set(n.slice(0,e),n.slice(e+1))}return t}function O(e){let t=[];for(;e.has(`${S}.${t.length}`);)t.push(`${S}.${t.length}`);return t}function k(e){let t=D(e);return t.get(S)??(O(t).map(e=>t.get(e)).join(``)||void 0)}function A(e){return Array.isArray(e)?e.flatMap(e=>typeof e?.id==`string`&&typeof e.role==`string`?[{id:e.id,slug:String(e.slug??e.id),name:String(e.name??e.slug??e.id),role:e.role}]:[]):[]}function j(e,t,n){let r=e.get(`x-coder-organization`),i=r?t.organizations.find(e=>e.slug===r||e.id===r):t.organizations.find(e=>e.id===n)??t.organizations[0];return i?{...t,organizationId:i.id,role:i.role}:r?{...t,organizationDenied:!0}:t}async function M(i,l){let u=l.auth.wular.url,h=l.publicUrl,y=new URL(h).origin,b=h.startsWith(`https:`),M=await x(l),N=`${h}${s}`,P=(e,t,n)=>`${e}=${t}; Path=/; HttpOnly; SameSite=Lax; Max-Age=${n}${b?`; Secure`:``}`,F=(e,t)=>new m(e).setProtectedHeader({alg:`dir`,enc:`A256GCM`}).setIssuedAt().setExpirationTime(`${t}s`).encrypt(M.cookie[0]);async function I(e){if(e)for(let t of M.cookie)try{return(await _(e,t)).payload}catch{}}async function L(e,t){let n=await F(t,T),r=O(D(e));if(n.length<=w)return[P(S,n,T),...r.map(e=>P(e,``,0))];let i=n.match(RegExp(`.{1,${w}}`,`g`));return[P(S,``,0),...i.map((e,t)=>P(`${S}.${t}`,e,T)),...r.slice(i.length).map(e=>P(e,``,0))]}let R=e=>[S,...O(D(e))].map(e=>P(e,``,0)),z,B=()=>z??=d.discovery(new URL(u),`${h}${c}`,void 0,d.PrivateKeyJwt(M.client),new URL(u).protocol===`http:`?{execute:[d.allowInsecureRequests]}:void 0).catch(e=>{throw z=void 0,e}),V,H=async()=>V??=g(new URL((await B()).serverMetadata().jwks_uri));function U(e,t){let n=e.claims();if(!n)throw Error(`Wular Auth returned no ID token`);let r=A(n.organizations);return{sub:n.sub,name:typeof n.name==`string`?n.name:``,email:typeof n.email==`string`?n.email:``,orgs:r,org:r.some(e=>e.id===t?.org)?t.org:r[0]?.id,exp_at:E()+(e.expires_in??600),at:E(),rt:e.refresh_token??t?.rt,idt:e.id_token??t?.idt}}let W=new Map;function G(e){let t=e.rt;if(!t)return Promise.resolve(void 0);let n=W.get(t);return n||(n=B().then(e=>d.refreshTokenGrant(e,t)).then(t=>U(t,e)).catch(()=>{W.delete(t)}),W.set(t,n),setTimeout(()=>W.delete(t),6e4).unref?.()),n}async function K(e,t,n){let r=(await H().then(t=>v(e,t,{issuer:u,audience:y,typ:`at+jwt`})).catch(()=>void 0))?.payload;if(!r?.sub)return;let i={user:{id:r.sub,name:``,email:``},organizations:A(r.organizations)};return n&&E()-(r.iat??0)>60?{...i,stale:!0}:j(t,i)}async function q(e){let t=await B().catch(()=>void 0);if(!t)return Response.redirect(`${h}/login?error=unavailable`,302);let n={verifier:d.randomPKCECodeVerifier(),state:d.randomState(),nonce:d.randomNonce(),return:r(e.searchParams.get(`return`),y)},i=d.buildAuthorizationUrl(t,{redirect_uri:N,scope:o,code_challenge:await d.calculatePKCECodeChallenge(n.verifier),code_challenge_method:`S256`,state:n.state,nonce:n.nonce});return new Response(null,{status:302,headers:{location:i.href,"set-cookie":P(C,await F(n,600),600)}})}async function J(e,t){let n=e=>{let t=new Headers({location:`/login?error=${encodeURIComponent(e)}`});return t.append(`set-cookie`,P(C,``,0)),new Response(null,{status:302,headers:t})},r=await I(D(e.headers).get(C));if(!r)return n(`expired`);let i=t.searchParams.get(`error`);if(i)return n(i);let a;try{a=U(await d.authorizationCodeGrant(await B(),new URL(`${N}${t.search}`),{pkceCodeVerifier:r.verifier,expectedState:r.state,expectedNonce:r.nonce,idTokenExpected:!0}))}catch{return n(`sign_in_failed`)}let o=new Headers({location:r.return});o.append(`set-cookie`,P(C,``,0));for(let t of await L(e.headers,a))o.append(`set-cookie`,t);return new Response(null,{status:302,headers:o})}async function Y(t){if(!n(t,h))return e();let r=await I(k(t.headers)),i=await B().catch(()=>void 0),a=`${h}/?signed_out=1`,o=i?.serverMetadata().end_session_endpoint&&r?.idt?d.buildEndSessionUrl(i,{id_token_hint:r.idt,post_logout_redirect_uri:a}).href:a,s=Response.json({url:o});for(let e of R(t.headers))s.headers.append(`set-cookie`,e);return s}return{issuer:u,jwks:M.jwks,handler(e){let n=new URL(e.url);return n.pathname===`/api/auth/sign-in`&&e.method===`GET`?q(n):n.pathname===`/api/auth/callback`&&e.method===`GET`?J(e,n):n.pathname===`/api/auth/sign-out`&&e.method===`POST`?Y(e):Promise.resolve(t())},async session(e,t=!1){let n=e.get(`authorization`);if(n?.startsWith(`Bearer `))return K(n.slice(7),e,t);let r=await I(k(e));if(!r)return;let i;if(r.exp_at<=E()||t&&E()-r.at>60){if(r=await G(r),!r)return;i=await L(e,r)}return j(e,{user:{id:r.sub,name:r.name,email:r.email},organizations:r.orgs,...i?{cookies:i}:{}},r.org)},async setOrganization(e,t){let n=await I(k(e)),r=n?.orgs.find(e=>e.slug===t);if(!(!n||!r))return{...r,cookies:await L(e,{...n,org:r.id})}},async link(e,t,n,r={}){let o={name:e.name,email:e.email,...r.organizations?{organizations:r.organizations}:{},...r.token?{token:r.token}:{}};await i.insert(a).values({platform:t,platformUserId:n,userId:e.id,...o}).onConflictDoUpdate({target:[a.platform,a.platformUserId],set:o,setWhere:p(a.userId,e.id)});let[s]=await i.select({userId:a.userId}).from(a).where(f(p(a.platform,t),p(a.platformUserId,n)));return s?.userId===e.id?`linked`:`taken`},async linkedUser(e,t){let[n]=await i.select({id:a.userId,name:a.name,email:a.email,organizations:a.organizations,token:a.token}).from(a).where(f(p(a.platform,e),p(a.platformUserId,t)));return n&&{id:n.id,name:n.name,email:n.email,...n.organizations?{organizations:n.organizations}:{},...n.token?{token:n.token}:{}}}}}export{M as createAuth};
@@ -1,4 +1,4 @@
1
- import{E as e,bn as t,nt as n,vn as r,xt as i}from"./dispatch-BKeAch9E.js";import{a,c as o,l as s,p as c,r as l,t as u}from"./prompt-CEuBMNhk.js";import{h as d,i as f,p,r as m,s as h}from"./output-BKeyLbvt.js";import{a as g}from"./args-BOEEdpWk.js";import _ from"node:path";import v from"node:process";import{pathToFileURL as y}from"node:url";import*as b from"zod/mini";const x=async()=>(await import(`./task-CgOKgkEG.js`)).commandTaskGroup,S=async()=>(await import(`./setup-host-GFTUzzZJ.js`)).commandSetupHost,C=async()=>(await import(`./server-Kb22cWfF.js`)).commandServer,w=async()=>(await import(`./upgrade-hA0yWBvx.js`)).commandUpgrade,T={task:x,flow:async()=>(await import(`./flow-17k25MHt.js`)).commandFlow,run:async()=>(await import(`./run-BDYl0CKl.js`)).commandTask,list:async()=>(await import(`./list-BAKvxSbh.js`)).commandTasks,result:async()=>(await import(`./result-BzaM3inj.js`)).commandResult,config:async()=>(await import(`./config-Da_cwoxI.js`)).commandConfig,"setup-host":S,"host-setup":S,setup:S,model:async()=>(await import(`./model-Bs1StDo3.js`)).commandModel,mcp:async()=>(await import(`./mcp-CCZOAo06.js`)).commandMcpConfig,docs:async()=>(await import(`./docs-DKJnqZqt.js`)).commandDocs,review:async()=>(await import(`./review-oIBeECZE.js`)).commandReview,agent:async()=>(await import(`./agent-JdtZozvP.js`)).commandAgent,server:C,dash:async()=>{let e=await C(),t=await e.subcommands.serve();return Object.assign(t=>e([`serve`,...t]),{commandName:t.commandName,help:t.help})},runner:async()=>(await import(`./runner-D7ScbIHJ.js`)).commandRunner,auth:async()=>(await import(`./auth-DWHIzqbA.js`)).commandAuth,credentials:async()=>(await import(`./credentials-B1jv6dkg.js`)).commandCredentials,upgrade:w,update:w},E={title:`Coder`,usageLine:`coder <command>`,description:`Delegate a coding task to the best available engine and steer it while it runs.`,commands:[{usage:`dash`,blurb:`your tasks, agents and settings in the browser`},{usage:`run "<text>"`,blurb:`run a task (background; --wait blocks)`},{usage:`list`,blurb:`list recent tasks (by default running + just stopped)`},{usage:`result [task-id]`,blurb:`status + final answer (--wait blocks)`},{usage:`task <cmd>`,blurb:`run, list, result, watch, steer, stop, approve, ...`},{usage:`flow <cmd>`,blurb:`run, list, watch, result, resume, stop, discover, ...`},{usage:`agent <cmd>`,blurb:`list, show, init, push, run, usage, integrations`},{usage:`credentials <cmd>`,blurb:`engine credentials: list, add, login, remove, default`},{usage:`server <cmd>`,blurb:`self-host Coder: serve, migrate, rotate-key`},{usage:`runner <cmd>`,blurb:`run your server's tasks on this machine: serve, list, ...`},{usage:`auth <cmd>`,blurb:`sign in to Coder: login, logout, status`},{usage:`review [--base <ref> | --pr <n>]`,blurb:`review changed code with a built-in flow`},{usage:`config <list|get|set|unset> [<key> [value]]`,blurb:`read or write config`},{usage:`model <list|add|alias|disable>`,blurb:`manage models: built-ins, aliases, custom endpoints`},{usage:`mcp <add|add-json|list|rm>`,blurb:`MCP servers tasks can attach by name (--mcp <name>)`},{usage:`docs [topic]`,blurb:`print bundled documentation (for agents to read)`},{usage:`upgrade [--cli-only|--plugins-only]`,blurb:`update the CLI and host plugins (alias: update)`}],start:[{usage:`coder setup-host [claude|agents]`,blurb:`"claude" for Claude Code, "agents" for any ~/.agents host (Codex, Pi, ...)`},{usage:`coder run --engine [codex|claude] "<task>"`,blurb:`run a task on that engine's default model`},{usage:`coder task result <task-id> --wait`,blurb:`wait for the answer; returns early if the task needs your approval`}],agents:[{usage:`coder docs skill [--claude]`,blurb:`load the skill once`}],usage:[{usage:`coder <command> --help`,blurb:`flags and details for any command`}]};function D(e,t,n=t.cyan){let r=Math.max(0,...e.map(e=>e.usage.length))+2;return e.map(e=>` ${n(e.usage.padEnd(r))}${t.dim(e.blurb)}${e.note?` ${t.light(e.note)}`:``}`)}function O(e,t,n){return[``,n.bold(`${e}:`),...t]}function k(e,t,n={}){let r=p;return`${[r.bold(`Usage:`),` ${n.usage??`coder ${e} <subcommand>`}`,...n.description?.length?[``,...n.description]:[],...O(`Subcommands`,D(t,r),r),...n.examples?.length?O(`Examples`,n.examples.flatMap(([e,t])=>[` ${r.cyan(e)}`,` ${r.dim(t)}`]),r):[],...n.seeAlso?O(`Related`,n.seeAlso.split(` · `).map(e=>` ${r.cyan(`coder ${e}`)}`),r):[],``,h([`Details on a subcommand: coder ${e} <subcommand> --help`],r,r.cyan)].join(`
1
+ import{E as e,bn as t,nt as n,vn as r,xt as i}from"./dispatch-BKeAch9E.js";import{a,c as o,l as s,p as c,r as l,t as u}from"./prompt-CEuBMNhk.js";import{h as d,i as f,p,r as m,s as h}from"./output-BKeyLbvt.js";import{a as g}from"./args-BOEEdpWk.js";import _ from"node:path";import v from"node:process";import{pathToFileURL as y}from"node:url";import*as b from"zod/mini";const x=async()=>(await import(`./task-b2BK481M.js`)).commandTaskGroup,S=async()=>(await import(`./setup-host-DLd_j2Uw.js`)).commandSetupHost,C=async()=>(await import(`./server-BxLFZL80.js`)).commandServer,w=async()=>(await import(`./upgrade-D6oC9HQI.js`)).commandUpgrade,T={task:x,flow:async()=>(await import(`./flow-kAxxVOiR.js`)).commandFlow,run:async()=>(await import(`./run-Dqe38jX8.js`)).commandTask,list:async()=>(await import(`./list-COAo7eZd.js`)).commandTasks,result:async()=>(await import(`./result-D8DsvJDu.js`)).commandResult,config:async()=>(await import(`./config-12pK4qW7.js`)).commandConfig,"setup-host":S,"host-setup":S,setup:S,model:async()=>(await import(`./model-B79MFtRV.js`)).commandModel,mcp:async()=>(await import(`./mcp-CsmBtlW9.js`)).commandMcpConfig,docs:async()=>(await import(`./docs-DWegDRiu.js`)).commandDocs,review:async()=>(await import(`./review-BEhDcX4b.js`)).commandReview,agent:async()=>(await import(`./agent-r5mMcehf.js`)).commandAgent,server:C,dash:async()=>{let e=await C(),t=await e.subcommands.serve();return Object.assign(t=>e([`serve`,...t]),{commandName:t.commandName,help:t.help})},runner:async()=>(await import(`./runner-BPpiJvHx.js`)).commandRunner,auth:async()=>(await import(`./auth-CBWTmAPA.js`)).commandAuth,credentials:async()=>(await import(`./credentials-l6dsrZLL.js`)).commandCredentials,upgrade:w,update:w},E={title:`Coder`,usageLine:`coder <command>`,description:`Delegate a coding task to the best available engine and steer it while it runs.`,commands:[{usage:`dash`,blurb:`your tasks, agents and settings in the browser`},{usage:`run "<text>"`,blurb:`run a task (background; --wait blocks)`},{usage:`list`,blurb:`list recent tasks (by default running + just stopped)`},{usage:`result [task-id]`,blurb:`status + final answer (--wait blocks)`},{usage:`task <cmd>`,blurb:`run, list, result, watch, steer, stop, approve, ...`},{usage:`flow <cmd>`,blurb:`run, list, watch, result, resume, stop, discover, ...`},{usage:`agent <cmd>`,blurb:`list, show, init, push, run, usage, integrations`},{usage:`credentials <cmd>`,blurb:`engine credentials: list, add, login, remove, default`},{usage:`server <cmd>`,blurb:`self-host Coder: serve, migrate, rotate-key`},{usage:`runner <cmd>`,blurb:`run your server's tasks on this machine: serve, list, ...`},{usage:`auth <cmd>`,blurb:`sign in to Coder: login, logout, status`},{usage:`review [--base <ref> | --pr <n>]`,blurb:`review changed code with a built-in flow`},{usage:`config <list|get|set|unset> [<key> [value]]`,blurb:`read or write config`},{usage:`model <list|add|alias|disable>`,blurb:`manage models: built-ins, aliases, custom endpoints`},{usage:`mcp <add|add-json|list|rm>`,blurb:`MCP servers tasks can attach by name (--mcp <name>)`},{usage:`docs [topic]`,blurb:`print bundled documentation (for agents to read)`},{usage:`upgrade [--cli-only|--plugins-only]`,blurb:`update the CLI and host plugins (alias: update)`}],start:[{usage:`coder setup-host [claude|agents]`,blurb:`"claude" for Claude Code, "agents" for any ~/.agents host (Codex, Pi, ...)`},{usage:`coder run --engine [codex|claude] "<task>"`,blurb:`run a task on that engine's default model`},{usage:`coder task result <task-id> --wait`,blurb:`wait for the answer; returns early if the task needs your approval`}],agents:[{usage:`coder docs skill [--claude]`,blurb:`load the skill once`}],usage:[{usage:`coder <command> --help`,blurb:`flags and details for any command`}]};function D(e,t,n=t.cyan){let r=Math.max(0,...e.map(e=>e.usage.length))+2;return e.map(e=>` ${n(e.usage.padEnd(r))}${t.dim(e.blurb)}${e.note?` ${t.light(e.note)}`:``}`)}function O(e,t,n){return[``,n.bold(`${e}:`),...t]}function k(e,t,n={}){let r=p;return`${[r.bold(`Usage:`),` ${n.usage??`coder ${e} <subcommand>`}`,...n.description?.length?[``,...n.description]:[],...O(`Subcommands`,D(t,r),r),...n.examples?.length?O(`Examples`,n.examples.flatMap(([e,t])=>[` ${r.cyan(e)}`,` ${r.dim(t)}`]),r):[],...n.seeAlso?O(`Related`,n.seeAlso.split(` · `).map(e=>` ${r.cyan(`coder ${e}`)}`),r):[],``,h([`Details on a subcommand: coder ${e} <subcommand> --help`],r,r.cyan)].join(`
2
2
  `)}\n`}function A(e,t){if(!t)return null;let n=p,r=([e,t])=>({usage:e,blurb:t}),i=[n.bold(`Usage:`),` ${t.usage}`];t.summary&&i.push(``,t.summary),t.flags?.length&&i.push(...O(`Flags`,D(t.flags.map(r),n),n)),t.globalFlags?.length&&i.push(...O(`Global flags`,D(t.globalFlags.map(r),n),n)),t.exitCodes?.length&&i.push(...O(`Exit codes`,D(t.exitCodes.map(r),n),n)),t.env?.length&&i.push(...O(`Environment`,D(t.env.map(r),n),n)),t.examples?.length&&i.push(...O(`Examples`,t.examples.flatMap(([e,t])=>[` ${n.cyan(e)}`,` ${n.dim(t)}`]),n));let a=e.includes(` `)?[`${e.slice(0,e.lastIndexOf(` `))} --help`]:t.seeAlso?.split(` · `)??[];return a.length&&i.push(...O(`Related`,a.map(e=>` ${n.cyan(`coder ${e}`)}`),n)),`${i.join(`
3
3
  `)}\n`}function j(e,t){let n=p,{start:r,agents:i,usage:a,commands:o,globals:s}=e,c=D([...r,...i,...a,...o,...s],n),l=(e,t)=>c.slice(e,e+t);return`${[`${n.bold(e.title)} ${n.dim(`v${t}`)}`,e.description,...O(`Get started`,l(0,r.length),n),...O(`Agents`,l(r.length,i.length),n),...O(`Usage`,[` ${e.usageLine}`,...l(r.length+i.length,a.length)],n),...O(`Commands`,l(r.length+i.length+a.length,o.length),n),...O(`Global`,c.slice(-s.length),n)].join(`
4
4
  `)}\n`}function M(e){let t=e.indexOf(`--`),n=t===-1?e:e.slice(0,t);return n.includes(`-h`)||n.includes(`--help`)}const N=`Use luna or sonnet for mechanical work; sol or opus is the default.
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./cli-BilSDkvE.js";export{c as CREDENTIAL_SERVER_FLAG,i as MODEL_HINT,o as SERVER_FLAG,n as command,e as confirmServer,a as getCommandHelp,s as group,t as main,r as renderHelp,l as renderTopHelp};
2
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./cli-DWCR7iqa.js";export{c as CREDENTIAL_SERVER_FLAG,i as MODEL_HINT,o as SERVER_FLAG,n as command,e as confirmServer,a as getCommandHelp,s as group,t as main,r as renderHelp,l as renderTopHelp};
@@ -1,3 +1,3 @@
1
- import{X as e,Z as t,ht as n,nt as r,xt as i}from"./dispatch-BKeAch9E.js";import{f as a,i as o}from"./cli-BilSDkvE.js";import{h as s,p as c}from"./output-BKeyLbvt.js";import{n as l,t as u}from"./args-BOEEdpWk.js";import d from"node:process";const f=e=>new i(`invalid-option`,`Usage: ${e}`);function p(e){try{return JSON.parse(e)}catch{return e.includes(`,`)?e.split(`,`).map(e=>e.trim()).filter(Boolean):e}}const m=o({name:`config`,help:{usage:`coder config <list|get|set|unset> [<key> [value]] [--workspace]`,summary:"Read or write configuration. `list` prints the effective config; get/set/unset\ntarget a dotted key (e.g. engines.codex.model). Writes go to ~/.coder/config.json.",flags:[[`--workspace`,`target <repo>/.coder/config.json instead of the user file`]],examples:[[`coder config list`,`print the effective config`],[`coder config set chain codex,claude`,`set the engine fallback chain`],[`coder config get engines.codex.model`,`read one value`]]},options:{...u,workspace:l},args:1/0,run({options:n,args:[i,a,...o],cwd:s}){if(!(!i||i===`help`)){if(i===`list`)return{action:i,config:r(s)};if(i===`get`){if(!a)throw f(`coder config get <key> (e.g. chain, engines.codex.model)`);return{action:i,value:e(s,a)}}if(i!==`set`&&i!==`unset`)throw f(`coder config <list|get|set|unset> [<key> [value]] [--workspace]`);if(!a||i===`set`&&o.length===0)throw f(`coder config ${i} <key>${i===`set`?` <value>`:``}`);return{action:i,set:t(s,a,p(o.join(` `)),{workspace:n.workspace,unset:i===`unset`})}}},json(e){let t=e;return t.action===`list`?t.config:t.action===`get`?t.value??null:t.set},print(e){if(!e)return void d.stdout.write(a(`config`,m.help));if(e.action===`list`)return h(e.config,n());if(e.action===`get`)return g(e.value);_(e.set)}});function h(e,t){let n=c,r=e=>[e?.model,e?.effort,e?.permissions].filter(Boolean).join(`/`)||`-`;d.stdout.write([`${n.dim(`chain`)} ${e.chain.join(` -> `)}`,`${n.dim(`codex`)} ${r(e.engines.codex)}`,`${n.dim(`claude`)} ${r(e.engines.claude)}`,`${n.dim(`approvals`)} timeout=${e.approvals.escalationTimeoutMs}ms hosts=[${e.approvals.allowedNetworkHosts.join(`, `)}]`,`${n.dim(`file`)} ${t}`].join(`
1
+ import{X as e,Z as t,ht as n,nt as r,xt as i}from"./dispatch-BKeAch9E.js";import{f as a,i as o}from"./cli-DWCR7iqa.js";import{h as s,p as c}from"./output-BKeyLbvt.js";import{n as l,t as u}from"./args-BOEEdpWk.js";import d from"node:process";const f=e=>new i(`invalid-option`,`Usage: ${e}`);function p(e){try{return JSON.parse(e)}catch{return e.includes(`,`)?e.split(`,`).map(e=>e.trim()).filter(Boolean):e}}const m=o({name:`config`,help:{usage:`coder config <list|get|set|unset> [<key> [value]] [--workspace]`,summary:"Read or write configuration. `list` prints the effective config; get/set/unset\ntarget a dotted key (e.g. engines.codex.model). Writes go to ~/.coder/config.json.",flags:[[`--workspace`,`target <repo>/.coder/config.json instead of the user file`]],examples:[[`coder config list`,`print the effective config`],[`coder config set chain codex,claude`,`set the engine fallback chain`],[`coder config get engines.codex.model`,`read one value`]]},options:{...u,workspace:l},args:1/0,run({options:n,args:[i,a,...o],cwd:s}){if(!(!i||i===`help`)){if(i===`list`)return{action:i,config:r(s)};if(i===`get`){if(!a)throw f(`coder config get <key> (e.g. chain, engines.codex.model)`);return{action:i,value:e(s,a)}}if(i!==`set`&&i!==`unset`)throw f(`coder config <list|get|set|unset> [<key> [value]] [--workspace]`);if(!a||i===`set`&&o.length===0)throw f(`coder config ${i} <key>${i===`set`?` <value>`:``}`);return{action:i,set:t(s,a,p(o.join(` `)),{workspace:n.workspace,unset:i===`unset`})}}},json(e){let t=e;return t.action===`list`?t.config:t.action===`get`?t.value??null:t.set},print(e){if(!e)return void d.stdout.write(a(`config`,m.help));if(e.action===`list`)return h(e.config,n());if(e.action===`get`)return g(e.value);_(e.set)}});function h(e,t){let n=c,r=e=>[e?.model,e?.effort,e?.permissions].filter(Boolean).join(`/`)||`-`;d.stdout.write([`${n.dim(`chain`)} ${e.chain.join(` -> `)}`,`${n.dim(`codex`)} ${r(e.engines.codex)}`,`${n.dim(`claude`)} ${r(e.engines.claude)}`,`${n.dim(`approvals`)} timeout=${e.approvals.escalationTimeoutMs}ms hosts=[${e.approvals.allowedNetworkHosts.join(`, `)}]`,`${n.dim(`file`)} ${t}`].join(`
2
2
  `)+`
3
3
  `)}function g(e){if(e===null||typeof e==`object`&&e!==void 0)return s(e);d.stdout.write(`${e===void 0?`(unset)`:String(e)}\n`)}function _(e){let t=c,n=e.unset?`unset ${t.cyan(e.key)}`:`${t.cyan(e.key)} = ${JSON.stringify(e.value)}`;d.stdout.write(`${n} ${t.dim(`(${e.file})`)}\n`)}export{m as commandConfig};
@@ -1 +1 @@
1
- import{xt as e}from"./dispatch-BKeAch9E.js";import{i as t}from"./prompt-CEuBMNhk.js";import{i as n}from"./cli-BilSDkvE.js";import{n as r,s as i}from"./args-BOEEdpWk.js";import a from"node:process";const o=n({name:`server app create`,globalFlags:{cwd:!1},help:{usage:`coder server app create <integration> [--org <org>] [--name <name>] [--json]`,summary:`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.`,flags:[[`--org <org>`,`create it under this organization instead of your own account`],[`--name <name>`,`the app's name and handle (default Coder)`]],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`],[`coder server app create slack`,`the Slack app`]]},options:{org:i,name:i,json:r},args:1,async run({options:t,args:[n]}){let{serverAppLink:r}=await import(`./apps-CjfrZyM5.js`).then(e=>e.t);if(!n)throw new e(`invalid-option`,`Missing integration, such as github or slack.`);return r(n,{owner:t.org,name:t.name})},json:({url:e})=>({ok:!0,url:e}),print({url:e}){a.stdout.write(`Open this page to create the app (valid 10 minutes):\n${e}\n`),t(e)}});export{o as commandServerAppCreate};
1
+ import{xt as e}from"./dispatch-BKeAch9E.js";import{i as t}from"./prompt-CEuBMNhk.js";import{i as n}from"./cli-DWCR7iqa.js";import{n as r,s as i}from"./args-BOEEdpWk.js";import a from"node:process";const o=n({name:`server app create`,globalFlags:{cwd:!1},help:{usage:`coder server app create <integration> [--org <org>] [--name <name>] [--json]`,summary:`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.`,flags:[[`--org <org>`,`create it under this organization instead of your own account`],[`--name <name>`,`the app's name and handle (default Coder)`]],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`],[`coder server app create slack`,`the Slack app`]]},options:{org:i,name:i,json:r},args:1,async run({options:t,args:[n]}){let{serverAppLink:r}=await import(`./apps-eujHiNca.js`).then(e=>e.t);if(!n)throw new e(`invalid-option`,`Missing integration, such as github or slack.`);return r(n,{owner:t.org,name:t.name})},json:({url:e})=>({ok:!0,url:e}),print({url:e}){a.stdout.write(`Open this page to create the app (valid 10 minutes):\n${e}\n`),t(e)}});export{o as commandServerAppCreate};
@@ -0,0 +1 @@
1
+ import{s as e}from"./cli-DWCR7iqa.js";const t=e(`credentials`,{list:async()=>(await import(`./list-vOvIpbOH.js`)).commandCredentialsList,add:async()=>(await import(`./add-C2y-mVzl.js`)).commandCredentialsAdd,login:async()=>(await import(`./login-BBw95-S3.js`)).commandCredentialsLogin,remove:async()=>(await import(`./remove-CLpL12Ya.js`)).commandCredentialsRemove,default:async()=>(await import(`./default-CwQXCtoB.js`)).commandCredentialsDefault},void 0,{help:{usage:`coder credentials [list|add|login|remove|default] ...`,summary:`Manage engine credentials. 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 default for the engine, else the workspace's.`}});export{t as commandCredentials};