@wular/coder 0.3.18 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -16
- package/bin/coder.mjs +3 -1
- package/dist/actions-Mk3FSlpJ.js +20 -0
- package/dist/adapter-B0oYCI0S.js +1 -0
- package/dist/adapter-BKVzTDnn.js +1 -0
- package/dist/adapter-DPInwbJG.js +1 -0
- package/dist/adapter-DaiJMOYo.js +1 -0
- package/dist/adapter-PeKziOUg.js +1 -0
- package/dist/add-BxpLHnvD.js +1 -0
- package/dist/add-CE-70LFs.js +1 -0
- package/dist/add-U-pty9qJ.js +6 -0
- package/dist/add-ej0X9e3a.js +1 -0
- package/dist/add-json-CEa-6luW.js +1 -0
- package/dist/agent-BsYx3Odz.js +3 -0
- package/dist/agent-JdtZozvP.js +1 -0
- package/dist/alias-DX-Bm86x.js +2 -0
- package/dist/app-BT5f7zL5.js +1 -0
- package/dist/approvals-C-AvFt6s.js +2 -0
- package/dist/approve-DOmpQRNd.js +2 -0
- package/dist/apps-CjfrZyM5.js +1 -0
- package/dist/archive-BUB8gFKD.js +4 -0
- package/dist/archive-BziJ1rQ-.js +3 -0
- package/dist/archive-sweep-CtBcARgN.js +1 -0
- package/dist/args-BOEEdpWk.js +1 -0
- package/dist/ask-dE3U3ss2.js +4 -0
- package/dist/auth-BFny--17.js +1 -0
- package/dist/auth-DWHIzqbA.js +1 -0
- package/dist/builtin/coder/agent.json +24 -0
- package/dist/builtin/coder/system.md +17 -0
- package/dist/chat-3Znsevah.js +1 -0
- package/dist/chat-B_yhNTo0.js +13 -0
- package/dist/chat-bridge-BS9WtP3X.js +2 -0
- package/dist/cli-BilSDkvE.js +9 -0
- package/dist/cli.d.ts +71 -1
- package/dist/cli.js +1 -91
- package/dist/client-D9IoAuDD.js +1 -0
- package/dist/config-Da_cwoxI.js +3 -0
- package/dist/create-C_iMJV4Y.js +1 -0
- package/dist/credentials-B1jv6dkg.js +1 -0
- package/dist/dash/manifest.json +3427 -0
- package/dist/dash/public/assets/apple-touch-icon.png +0 -0
- package/dist/dash/public/assets/chunks/agent-pills-c9c4ac4d4a10df83.js +1 -0
- package/dist/dash/public/assets/chunks/agent-settings-form-8be2ddab074aba6d.js +1 -0
- package/dist/dash/public/assets/chunks/agents-grid-951584b6f4c4314e.js +1 -0
- package/dist/dash/public/assets/chunks/badge-676b01e0c615bf7b.js +1 -0
- package/dist/dash/public/assets/chunks/card-e0901d68b79dfa93.js +1 -0
- package/dist/dash/public/assets/chunks/combo-41234c24668b1db1.js +1 -0
- package/dist/dash/public/assets/chunks/composer-5534be50bc12385e.js +1 -0
- package/dist/dash/public/assets/chunks/composer-d10d4b1d54c4f751.js +1 -0
- package/dist/dash/public/assets/chunks/composer-data-6f7608fed13f3dd7.js +1 -0
- package/dist/dash/public/assets/chunks/confirm-f2fe4ba9905a89c6.js +1 -0
- package/dist/dash/public/assets/chunks/connect-apps-aa2a3d82e48ed8c3.js +1 -0
- package/dist/dash/public/assets/chunks/connect-repositories-5389ec8701a3deac.js +1 -0
- package/dist/dash/public/assets/chunks/credentials-list-bc5bfcab058176c5.js +2 -0
- package/dist/dash/public/assets/chunks/custom-range-4761ab14f05149df.js +1 -0
- package/dist/dash/public/assets/chunks/editor-bfe8cd854f8001be.js +7 -0
- package/dist/dash/public/assets/chunks/engines-list-f1191390f5715b39.js +1 -0
- package/dist/dash/public/assets/chunks/field-901f1f35c18c39c9.js +1 -0
- package/dist/dash/public/assets/chunks/format-eb03fc9d9744d960.js +1 -0
- package/dist/dash/public/assets/chunks/heads-f3bcd289663d48fa.js +1 -0
- package/dist/dash/public/assets/chunks/instructions-052fa45a9daf6db6.js +2 -0
- package/dist/dash/public/assets/chunks/instructions-d0a4b0d95009c262.js +1 -0
- package/dist/dash/public/assets/chunks/list-1d259660d7612c5f.js +1 -0
- package/dist/dash/public/assets/chunks/mcp-list-e3bebbbe831393b8.js +1 -0
- package/dist/dash/public/assets/chunks/model-options-15c53331a2f28a4f.js +1 -0
- package/dist/dash/public/assets/chunks/models-list-44f857a469ca04d5.js +1 -0
- package/dist/dash/public/assets/chunks/paged-bc6fa0c2b9d52ed7.js +1 -0
- package/dist/dash/public/assets/chunks/platform-actions-d1426602049926d2.js +1 -0
- package/dist/dash/public/assets/chunks/runners-list-1901af8a5dea1f09.js +1 -0
- package/dist/dash/public/assets/chunks/runtime-246221e985d863e5-1.js +2 -0
- package/dist/dash/public/assets/chunks/segmented-358ff2b4992b8384.js +1 -0
- package/dist/dash/public/assets/chunks/select-7ae25fd8a7d6c338.js +1 -0
- package/dist/dash/public/assets/chunks/sentinel-c972a33dc69a5135.js +1 -0
- package/dist/dash/public/assets/chunks/shared-init-246221e985d863e5-2.js +1 -0
- package/dist/dash/public/assets/chunks/shared-init-88cce66bb3cfe1e5.js +5 -0
- package/dist/dash/public/assets/chunks/shared-init-8f2ac936c95a7f7b.js +1 -0
- package/dist/dash/public/assets/chunks/shared-init-ffb3397e494137c9.js +2 -0
- package/dist/dash/public/assets/chunks/tail-7c27aab8ba268bd9.js +1 -0
- package/dist/dash/public/assets/chunks/task-actions-8e1d93c788d001df.js +1 -0
- package/dist/dash/public/assets/chunks/task-fa8b82e95e771c4a.js +1 -0
- package/dist/dash/public/assets/chunks/task-view-6d7618d2820a5cb4.js +3 -0
- package/dist/dash/public/assets/chunks/tasks-list-f4784e5cbd0ed785.js +1 -0
- package/dist/dash/public/assets/chunks/toolbar-a75d2570f07cbb70.js +1 -0
- package/dist/dash/public/assets/chunks/versions-list-fc2e0d2a7382e049.js +1 -0
- package/dist/dash/public/assets/chunks/wular-pnext-246221e985d863e5-0.js +1 -0
- package/dist/dash/public/assets/connect-382b1729a7ae7808.css +1 -0
- package/dist/dash/public/assets/dash-9e02d5d1a6d42ee3.css +1 -0
- package/dist/dash/public/assets/dash-account-04859899c1838ada.css +1 -0
- package/dist/dash/public/assets/dash-agents-9e678137267dec07.css +1 -0
- package/dist/dash/public/assets/dash-agents-new-26fa27b17ef9b8d8.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-b975c48f8abf3444.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-edit-e13fda599bb04843.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-platforms-70292932cb27bc96.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-settings-71f9a86251723fcc.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-tasks-fb8eb2ed71006601.css +1 -0
- package/dist/dash/public/assets/dash-agents-param-slug-usage-7c8740f1cdd52c71.css +1 -0
- package/dist/dash/public/assets/dash-settings-8eb818da462227e8.css +1 -0
- package/dist/dash/public/assets/dash-settings-param-tab-849a1a9542e273f5.css +1 -0
- package/dist/dash/public/assets/dash-tasks-81e510e0b6931b42.css +1 -0
- package/dist/dash/public/assets/dash-tasks-param-id-bbd2a83342f2ec10.css +1 -0
- package/dist/dash/public/assets/dash-usage-8e0259e03eaed1bd.css +1 -0
- package/dist/dash/public/assets/favicon.ico +0 -0
- package/dist/dash/public/assets/favicon.svg +1 -0
- package/dist/dash/public/assets/fonts/LICENSE-fira-code +93 -0
- package/dist/dash/public/assets/fonts/fira-code-latin-400-normal-717ee080.woff2 +0 -0
- package/dist/dash/public/assets/fonts/fira-code-latin-500-normal-530b6706.woff2 +0 -0
- package/dist/dash/public/assets/fonts/fira-code-latin-700-normal-98730669.woff2 +0 -0
- package/dist/dash/public/assets/global-d2adbf01910d9df5.css +1 -0
- package/dist/dash/public/assets/login-c129b1ce237be260.css +1 -0
- package/dist/dash/public/assets/pnext-client-03b03b254e525e82.js +1 -0
- package/dist/dash/public/assets/pnext-client-1b9ab0963a8ff77b.js +1 -0
- package/dist/dash/public/assets/pnext-client-1c7859bb888f4ef0.js +1 -0
- package/dist/dash/public/assets/pnext-client-3c748afe963fb05d.js +1 -0
- package/dist/dash/public/assets/pnext-client-4f47c2cae220f107.js +1 -0
- package/dist/dash/public/assets/pnext-client-6ab9fd9b53b794d2.js +1 -0
- package/dist/dash/public/assets/pnext-client-6c241786342498e4.js +1 -0
- package/dist/dash/public/assets/pnext-client-80b56d420f02b808.js +1 -0
- package/dist/dash/public/assets/pnext-client-83135c17bae850a3.js +1 -0
- package/dist/dash/public/assets/pnext-client-8e6fa4302ae0396f.js +1 -0
- package/dist/dash/public/assets/pnext-client-932c9d8cc0717fc8.js +1 -0
- package/dist/dash/public/assets/pnext-client-a42ae63d4de113f9.js +1 -0
- package/dist/dash/public/assets/pnext-client-d2ee6f8c1e337032.js +1 -0
- package/dist/dash/public/assets/pnext-client-d513f65ec23b7f20.js +1 -0
- package/dist/dash/public/assets/pnext-client-ecb88e2a8a109954.js +1 -0
- package/dist/dash/public/assets/pnext-client-f1545ee6270bbf9a.js +1 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/boot-B2MFTRO2.js +30 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/build-tier-XJJSL5FR.js +2704 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-2HFY3DQT.js +208 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-2ICEVELW.js +834 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-3UPROT2C.js +35 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-4P5CMIYT.js +1582 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-4TKZKZ3Q.js +131 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-5RDEILQB.js +437 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-62KEQM43.js +25 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-6KQSWT6D.js +831 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-7DCNCW6O.js +724 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-B4THCTQP.js +22 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-C2LIV2MM.js +172 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-CCATPVTW.js +378 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-COXJAPTU.js +89 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-E6IXL2NJ.js +6270 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-FLGRBFAH.js +1198 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-FTJVHFWD.js +61 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-H523KSIH.js +5151 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-HT6KKX6A.js +20 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-JESFYECC.js +438 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-JRPJM2XY.js +17 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-L2IWDUXG.js +107 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-L5P4Y4UC.js +183 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-NQE46AZN.js +647 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-PA4QEARJ.js +129 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-PZ5AXOLW.js +7146 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-SNVPTULL.js +2397 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-T3QZT3PG.js +220 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-VC5O2SDP.js +72 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-WZX4V6CM.js +231 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-XUUIDXY5.js +627 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-ZHFDO3PR.js +265 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/compile-CE2DN7ZA.js +18 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/config-UREY7XJT.js +16 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/config-loader-UI2XE3PZ.js +17 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/entry.js +219 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/generate-I2PPTDFD.js +16 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/modules-UVOCE4C2.js +48 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/pipeline-UW47K537.js +963 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/proxy-ITGOVJBW.js +26 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/register-4SA55SWT.js +12579 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/router-JNKHLBCZ.js +505 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/routes-PD6J2NXW.js +54 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/tsconfig-defaults-ZXEH7RQK.js +15 -0
- package/dist/default-Bobztoxf.js +1 -0
- package/dist/default-vYPT26DR.js +1 -0
- package/dist/delete-D8gEwoOj.js +4 -0
- package/dist/delete-z1_86nf6.js +2 -0
- package/dist/disable-DVKd-0Xb.js +1 -0
- package/dist/discover-Df-a8K4R.js +3 -0
- package/dist/discover-Dvr_3_Xr.js +1 -0
- package/dist/dispatch-BKeAch9E.js +14 -0
- package/dist/docs-BX65z2Iu.js +2 -0
- package/dist/docs-DKJnqZqt.js +2 -0
- package/dist/enable-C8Zf_wpN.js +1 -0
- package/dist/env-CRf6wkM2.js +1 -0
- package/dist/exec-RZFLclKX.js +11 -0
- package/dist/executor-BvAA7Cgw.js +10 -0
- package/dist/flow/builtin/review.d.ts +157 -0
- package/dist/flow/builtin/review.js +19 -0
- package/dist/flow/index.d.ts +1 -1
- package/dist/flow/index.js +1 -1
- package/dist/flow-17k25MHt.js +1 -0
- package/dist/github-actions-DwUzm4hC.js +24 -0
- package/dist/http-Bkg_OQ6r.js +1 -0
- package/dist/{index-BQ-b77or.d.ts → index-CZjFX5zV.d.ts} +116 -238
- package/dist/init-CoMfFxbG.js +1 -0
- package/dist/integrations-5xCaXSd-.js +1 -0
- package/dist/integrations-BAgdVDhj.js +5 -0
- package/dist/lib/broker.js +3 -3
- package/dist/list-BAKvxSbh.js +4 -0
- package/dist/list-BYiG8Zav.js +2 -0
- package/dist/list-BxEywhHU.js +1 -0
- package/dist/list-C5w01-8q.js +1 -0
- package/dist/list-CIW2joV1.js +1 -0
- package/dist/list-DX-z3SBp.js +3 -0
- package/dist/list-DpCf4G-H.js +4 -0
- package/dist/list-VToARh3C.js +1 -0
- package/dist/load-BpEsAn51.js +2 -0
- package/dist/local-H3uvqEbq.js +1 -0
- package/dist/log-view-dg0TlKLA.js +1 -0
- package/dist/login-BFxX4jJy.js +1 -0
- package/dist/login-DkkslfBx.js +1 -0
- package/dist/logout-BHAtw4Z8.js +1 -0
- package/dist/maintenance-C5FklUw3.js +1 -0
- package/dist/match-CXAjDhg7.js +1 -0
- package/dist/mcp-BgKb2Cdk.js +1 -0
- package/dist/mcp-CCZOAo06.js +1 -0
- package/dist/mcp-server-DGzme0YX.js +1 -0
- package/dist/migrate-C4vM7DQN.js +2 -0
- package/dist/migrate-N-85_N7J.js +1 -0
- package/dist/model-Bs1StDo3.js +1 -0
- package/dist/models-_5LVGC3m.js +1 -0
- package/dist/output-BKeyLbvt.js +5 -0
- package/dist/prompt-CEuBMNhk.js +7 -0
- package/dist/push-CUC55Bqd.js +1 -0
- package/dist/queue-6io_NOP3.js +116 -0
- package/dist/refresh-BIrmrWYq.js +1 -0
- package/dist/remote-miQNTVRa.js +1 -0
- package/dist/remove-B93LNkZI.js +1 -0
- package/dist/remove-C5_xggx7.js +1 -0
- package/dist/remove-CuH8a3L9.js +1 -0
- package/dist/remove-eQ8y5C5p.js +1 -0
- package/dist/rename-CYfy03FE.js +1 -0
- package/dist/result-BEtQZHaY.js +5 -0
- package/dist/result-BzaM3inj.js +15 -0
- package/dist/resume-DYzKvyEw.js +3 -0
- package/dist/review-oIBeECZE.js +7 -0
- package/dist/rolldown-runtime-DT7IzrpZ.js +1 -0
- package/dist/rotate-key-IdMYH7gg.js +1 -0
- package/dist/run-BDYl0CKl.js +2 -0
- package/dist/run-CTtd0Znc.js +5 -0
- package/dist/run-CawRGnOg.js +2 -0
- package/dist/runner-D7ScbIHJ.js +1 -0
- package/dist/runner-sUpWJ_k0.js +1 -0
- package/dist/schema-CU2iFkp8.js +1 -0
- package/dist/sdk.d.ts +1166 -191
- package/dist/sdk.js +1 -1
- package/dist/serve-BTeomYxW.js +1 -0
- package/dist/serve-CE8YV2e9.js +1 -0
- package/dist/serve-CPnmrKyf.js +2 -0
- package/dist/serve-CQKZxzFE.js +4 -0
- package/dist/serve-GmRO89s5.js +12 -0
- package/dist/server-Kb22cWfF.js +1 -0
- package/dist/setup-host-GFTUzzZJ.js +6 -0
- package/dist/shared-DVtzWhUT.js +1 -0
- package/dist/show-CMUg8SJu.js +1 -0
- package/dist/show-COTZEYgc.js +1 -0
- package/dist/status-D26U--p8.js +1 -0
- package/dist/steer-C6uARLp5.js +4 -0
- package/dist/stop-BrGI3hSS.js +1 -0
- package/dist/stop-ByCAlbmN.js +3 -0
- package/dist/store-B94tSate.js +42 -0
- package/dist/store-DzqXS2wT.js +8 -0
- package/dist/task-C6VAg5WU.js +1 -0
- package/dist/task-CgOKgkEG.js +1 -0
- package/dist/task-DeglY79z.js +5 -0
- package/dist/test-NEbhlxvo.js +1 -0
- package/dist/tools-D0Zfs8Hx.js +1 -0
- package/dist/types-D0q15RJa.js +1 -0
- package/dist/types-I5Cwtl_K.d.ts +389 -0
- package/dist/unalias-C9NqmSDq.js +1 -0
- package/dist/update-BTxYQj7Z.js +2 -0
- package/dist/upgrade-hA0yWBvx.js +2 -0
- package/dist/usage-BhqoCjvE.js +1 -0
- package/dist/usage-C4d9X2Uq.js +1 -0
- package/dist/watch-CSdj24ct.js +5 -0
- package/dist/watch-DtRuC0Wc.js +8 -0
- package/dist/wire-BeT1Axeo.js +1 -0
- package/dist/worker-CXndxmGF.js +9 -0
- package/dist/worker-DX7P9kWl.js +1 -0
- package/dist/workflow-Dcmdooi8.js +1 -0
- package/docs/agents/coder.md +26 -0
- package/docs/agents/index.md +120 -0
- package/docs/config.md +51 -30
- package/docs/dash.md +64 -0
- package/docs/flows.md +20 -15
- package/docs/mcp.md +62 -0
- package/docs/models.md +41 -23
- package/docs/review.md +41 -0
- package/docs/sdk.md +57 -38
- package/docs/self-host.md +188 -0
- package/migrations/0000_initial.sql +252 -0
- package/migrations/meta/0000_snapshot.json +1787 -0
- package/migrations/meta/_journal.json +13 -0
- package/package.json +37 -7
- package/plugins/agents/skills/coder/SKILL.md +14 -60
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/commands/setup.md +2 -2
- package/plugins/claude/skills/dispatch/SKILL.md +14 -58
- package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
- package/plugins/cursor/README.md +5 -5
- package/plugins/cursor/assets/logo.png +0 -0
- package/plugins/cursor/skills/coder/SKILL.md +14 -59
- package/src/client/index.ts +573 -0
- package/src/client/types.ts +506 -0
- package/src/core/errors.ts +72 -0
- package/src/core/task/log-view.ts +173 -0
- package/src/server/auth/sign-in.ts +14 -0
- package/src/server/dash/api/load.ts +62 -0
- package/src/server/dash/api/types.ts +11 -0
- package/src/server/dash/app/connect/page.tsx +42 -0
- package/src/server/dash/app/dash/account/loading.tsx +11 -0
- package/src/server/dash/app/dash/account/notify.tsx +42 -0
- package/src/server/dash/app/dash/account/page.css +81 -0
- package/src/server/dash/app/dash/account/page.tsx +126 -0
- package/src/server/dash/app/dash/account/sign-out.tsx +24 -0
- package/src/server/dash/app/dash/agents/(list)/agent-menu.tsx +10 -0
- package/src/server/dash/app/dash/agents/(list)/agents-grid.tsx +143 -0
- package/src/server/dash/app/dash/agents/(list)/connect-apps.tsx +46 -0
- package/src/server/dash/app/dash/agents/(list)/loading.tsx +14 -0
- package/src/server/dash/app/dash/agents/(list)/page.css +72 -0
- package/src/server/dash/app/dash/agents/(list)/page.tsx +89 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/layout.tsx +135 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/loading.tsx +5 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/page.css +21 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/page.tsx +173 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/platforms/loading.tsx +18 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/platforms/page.css +87 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/platforms/page.tsx +258 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/platforms/platform-actions.tsx +111 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/settings/agent-settings-form.css +114 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/settings/agent-settings-form.tsx +294 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/settings/loading.tsx +5 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/settings/page.tsx +54 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/tasks/loading.tsx +5 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/tasks/page.tsx +14 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/usage/loading.tsx +31 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/usage/page.css +12 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/usage/page.tsx +163 -0
- package/src/server/dash/app/dash/agents/[slug]/(tabs)/versions-list.tsx +53 -0
- package/src/server/dash/app/dash/agents/[slug]/edit/loading.tsx +31 -0
- package/src/server/dash/app/dash/agents/[slug]/edit/page.tsx +91 -0
- package/src/server/dash/app/dash/agents/agent/agent-pills.css +27 -0
- package/src/server/dash/app/dash/agents/agent/agent-pills.tsx +133 -0
- package/src/server/dash/app/dash/agents/agent/hero.css +40 -0
- package/src/server/dash/app/dash/agents/agent/hero.tsx +60 -0
- package/src/server/dash/app/dash/agents/agent/instructions.css +29 -0
- package/src/server/dash/app/dash/agents/agent/instructions.tsx +82 -0
- package/src/server/dash/app/dash/agents/editor/connect-repositories.ts +16 -0
- package/src/server/dash/app/dash/agents/editor/editor.css +263 -0
- package/src/server/dash/app/dash/agents/editor/editor.tsx +774 -0
- package/src/server/dash/app/dash/agents/editor/import-picker.css +48 -0
- package/src/server/dash/app/dash/agents/editor/import-picker.tsx +253 -0
- package/src/server/dash/app/dash/agents/editor/names.ts +35 -0
- package/src/server/dash/app/dash/agents/new/loading.tsx +25 -0
- package/src/server/dash/app/dash/agents/new/page.tsx +72 -0
- package/src/server/dash/app/dash/layout.css +265 -0
- package/src/server/dash/app/dash/layout.tsx +332 -0
- package/src/server/dash/app/dash/page.tsx +14 -0
- package/src/server/dash/app/dash/settings/[tab]/credentials-list.css +94 -0
- package/src/server/dash/app/dash/settings/[tab]/credentials-list.tsx +619 -0
- package/src/server/dash/app/dash/settings/[tab]/credentials.tsx +36 -0
- package/src/server/dash/app/dash/settings/[tab]/engines-list.css +16 -0
- package/src/server/dash/app/dash/settings/[tab]/engines-list.tsx +135 -0
- package/src/server/dash/app/dash/settings/[tab]/list.css +98 -0
- package/src/server/dash/app/dash/settings/[tab]/list.tsx +215 -0
- package/src/server/dash/app/dash/settings/[tab]/loading.tsx +6 -0
- package/src/server/dash/app/dash/settings/[tab]/mcp-list.css +43 -0
- package/src/server/dash/app/dash/settings/[tab]/mcp-list.tsx +290 -0
- package/src/server/dash/app/dash/settings/[tab]/models-list.tsx +513 -0
- package/src/server/dash/app/dash/settings/[tab]/page.tsx +89 -0
- package/src/server/dash/app/dash/settings/[tab]/runners-list.css +153 -0
- package/src/server/dash/app/dash/settings/[tab]/runners-list.tsx +457 -0
- package/src/server/dash/app/dash/settings/layout.tsx +50 -0
- package/src/server/dash/app/dash/settings/model-options.ts +117 -0
- package/src/server/dash/app/dash/settings/page.tsx +7 -0
- package/src/server/dash/app/dash/settings/settings-head.tsx +24 -0
- package/src/server/dash/app/dash/settings/tunnel-guide.tsx +28 -0
- package/src/server/dash/app/dash/tasks/[id]/activity.tsx +202 -0
- package/src/server/dash/app/dash/tasks/[id]/loading.tsx +31 -0
- package/src/server/dash/app/dash/tasks/[id]/page.tsx +30 -0
- package/src/server/dash/app/dash/tasks/[id]/task-actions.tsx +164 -0
- package/src/server/dash/app/dash/tasks/[id]/task-view.css +407 -0
- package/src/server/dash/app/dash/tasks/[id]/task-view.tsx +513 -0
- package/src/server/dash/app/dash/tasks/composer-data.ts +96 -0
- package/src/server/dash/app/dash/tasks/composer.css +316 -0
- package/src/server/dash/app/dash/tasks/composer.tsx +890 -0
- package/src/server/dash/app/dash/tasks/list/status.css +50 -0
- package/src/server/dash/app/dash/tasks/list/status.tsx +20 -0
- package/src/server/dash/app/dash/tasks/list/task.ts +45 -0
- package/src/server/dash/app/dash/tasks/list/tasks-list.css +85 -0
- package/src/server/dash/app/dash/tasks/list/tasks-list.tsx +402 -0
- package/src/server/dash/app/dash/tasks/list/tasks-section.tsx +96 -0
- package/src/server/dash/app/dash/tasks/page.tsx +53 -0
- package/src/server/dash/app/dash/token-from-hash.tsx +17 -0
- package/src/server/dash/app/dash/usage/custom-range.tsx +63 -0
- package/src/server/dash/app/dash/usage/day-chart.css +109 -0
- package/src/server/dash/app/dash/usage/day-chart.tsx +110 -0
- package/src/server/dash/app/dash/usage/loading.tsx +17 -0
- package/src/server/dash/app/dash/usage/metric.ts +13 -0
- package/src/server/dash/app/dash/usage/page.tsx +117 -0
- package/src/server/dash/app/dash/usage/range-bar.css +13 -0
- package/src/server/dash/app/dash/usage/range-bar.tsx +69 -0
- package/src/server/dash/app/dash/usage/stats.css +52 -0
- package/src/server/dash/app/dash/usage/stats.tsx +19 -0
- package/src/server/dash/app/dash/usage/top-agents.css +40 -0
- package/src/server/dash/app/dash/usage/top-agents.tsx +138 -0
- package/src/server/dash/app/dash/usage/usage.css +0 -0
- package/src/server/dash/app/globals.css +692 -0
- package/src/server/dash/app/layout.tsx +52 -0
- package/src/server/dash/app/login/page.css +26 -0
- package/src/server/dash/app/login/page.tsx +57 -0
- package/src/server/dash/app/page.tsx +5 -0
- package/src/server/dash/app/responsive.css +49 -0
- package/src/server/dash/app/zone.tsx +13 -0
- package/src/server/dash/comps/frame/auth-panel.css +60 -0
- package/src/server/dash/comps/frame/auth-panel.tsx +44 -0
- package/src/server/dash/comps/frame/drawer.css +28 -0
- package/src/server/dash/comps/frame/drawer.tsx +39 -0
- package/src/server/dash/comps/frame/heads.ts +41 -0
- package/src/server/dash/comps/frame/loading-card.tsx +65 -0
- package/src/server/dash/comps/frame/page-head.css +83 -0
- package/src/server/dash/comps/frame/page-head.tsx +71 -0
- package/src/server/dash/comps/frame/stream.tsx +50 -0
- package/src/server/dash/comps/frame/task-toasts.tsx +214 -0
- package/src/server/dash/comps/frame/theme-choices.tsx +46 -0
- package/src/server/dash/comps/nav/current-link.tsx +53 -0
- package/src/server/dash/comps/nav/side-toggle.tsx +30 -0
- package/src/server/dash/comps/nav/to.ts +22 -0
- package/src/server/dash/comps/ui/badge.css +64 -0
- package/src/server/dash/comps/ui/badge.tsx +41 -0
- package/src/server/dash/comps/ui/card.css +93 -0
- package/src/server/dash/comps/ui/card.tsx +77 -0
- package/src/server/dash/comps/ui/collapse.css +32 -0
- package/src/server/dash/comps/ui/collapse.tsx +49 -0
- package/src/server/dash/comps/ui/combo.tsx +154 -0
- package/src/server/dash/comps/ui/confirm.css +36 -0
- package/src/server/dash/comps/ui/confirm.tsx +67 -0
- package/src/server/dash/comps/ui/field.css +25 -0
- package/src/server/dash/comps/ui/field.tsx +34 -0
- package/src/server/dash/comps/ui/icon.css +22 -0
- package/src/server/dash/comps/ui/icon.tsx +17 -0
- package/src/server/dash/comps/ui/icons.ts +44 -0
- package/src/server/dash/comps/ui/menu.css +178 -0
- package/src/server/dash/comps/ui/menu.tsx +152 -0
- package/src/server/dash/comps/ui/segmented.css +44 -0
- package/src/server/dash/comps/ui/segmented.tsx +58 -0
- package/src/server/dash/comps/ui/select.css +103 -0
- package/src/server/dash/comps/ui/select.tsx +250 -0
- package/src/server/dash/comps/ui/sentinel.css +58 -0
- package/src/server/dash/comps/ui/sentinel.tsx +67 -0
- package/src/server/dash/comps/ui/tabs.css +81 -0
- package/src/server/dash/comps/ui/tabs.tsx +32 -0
- package/src/server/dash/comps/ui/tail.css +12 -0
- package/src/server/dash/comps/ui/tail.tsx +37 -0
- package/src/server/dash/comps/ui/toast.css +72 -0
- package/src/server/dash/comps/ui/toolbar.css +143 -0
- package/src/server/dash/comps/ui/toolbar.tsx +93 -0
- package/src/server/dash/package.json +5 -0
- package/src/server/dash/pnext-env.d.ts +4 -0
- package/src/server/dash/pnext.config.ts +5 -0
- package/src/server/dash/public/assets/apple-touch-icon.png +0 -0
- package/src/server/dash/public/assets/favicon.ico +0 -0
- package/src/server/dash/public/assets/favicon.svg +1 -0
- package/src/server/dash/public/assets/fonts/LICENSE-fira-code +93 -0
- package/src/server/dash/public/assets/fonts/fira-code-latin-400-normal-717ee080.woff2 +0 -0
- package/src/server/dash/public/assets/fonts/fira-code-latin-500-normal-530b6706.woff2 +0 -0
- package/src/server/dash/public/assets/fonts/fira-code-latin-700-normal-98730669.woff2 +0 -0
- package/src/server/dash/tsconfig.json +10 -0
- package/src/server/dash/utils/client.ts +19 -0
- package/src/server/dash/utils/format.ts +75 -0
- package/src/server/dash/utils/paged.ts +184 -0
- package/src/server/dash/utils/range.ts +117 -0
- package/dist/app-server-CW93J9zJ.js +0 -3
- package/dist/runtime-D-U1DNkI.js +0 -26
- package/dist/upgrade-DOj06r5b.js +0 -37
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
import { SerializedMessage, SerializedThread } from "chat";
|
|
3
|
+
//#region src/core/config.d.ts
|
|
4
|
+
declare const engineSchema: z.ZodMiniEnum<{
|
|
5
|
+
codex: "codex";
|
|
6
|
+
claude: "claude";
|
|
7
|
+
custom: "custom";
|
|
8
|
+
}>;
|
|
9
|
+
declare const effortSchema: z.ZodMiniEnum<{
|
|
10
|
+
low: "low";
|
|
11
|
+
medium: "medium";
|
|
12
|
+
high: "high";
|
|
13
|
+
}>;
|
|
14
|
+
declare const permissionSchema: z.ZodMiniEnum<{
|
|
15
|
+
"read-only": "read-only";
|
|
16
|
+
"workspace-write": "workspace-write";
|
|
17
|
+
auto: "auto";
|
|
18
|
+
}>;
|
|
19
|
+
declare const customModelSchema: z.ZodMiniObject<{
|
|
20
|
+
baseUrl: z.ZodMiniURL;
|
|
21
|
+
model: z.ZodMiniString<string>;
|
|
22
|
+
envKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
23
|
+
wireApi: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
24
|
+
chat: "chat";
|
|
25
|
+
responses: "responses";
|
|
26
|
+
}>>;
|
|
27
|
+
disabled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
/** The merged, effective shape (everything present after DEFAULT_CONFIG). */
|
|
30
|
+
declare const mcpEntrySchema: z.ZodMiniObject<{
|
|
31
|
+
command: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
32
|
+
args: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
33
|
+
env: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
34
|
+
url: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
35
|
+
type: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
36
|
+
stdio: "stdio";
|
|
37
|
+
http: "http";
|
|
38
|
+
sse: "sse";
|
|
39
|
+
}>>;
|
|
40
|
+
headers: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
41
|
+
tools: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
42
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
declare const effectiveConfigSchema: z.ZodMiniObject<{
|
|
45
|
+
chain: z.ZodMiniArray<z.ZodMiniEnum<{
|
|
46
|
+
codex: "codex";
|
|
47
|
+
claude: "claude";
|
|
48
|
+
custom: "custom";
|
|
49
|
+
}>>;
|
|
50
|
+
engines: z.ZodMiniObject<{
|
|
51
|
+
codex: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
52
|
+
model: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
53
|
+
effort: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
54
|
+
low: "low";
|
|
55
|
+
medium: "medium";
|
|
56
|
+
high: "high";
|
|
57
|
+
}>>;
|
|
58
|
+
permissions: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
59
|
+
"read-only": "read-only";
|
|
60
|
+
"workspace-write": "workspace-write";
|
|
61
|
+
auto: "auto";
|
|
62
|
+
}>>;
|
|
63
|
+
network: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
64
|
+
}, z.core.$strict>>;
|
|
65
|
+
claude: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
66
|
+
model: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
67
|
+
effort: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
68
|
+
low: "low";
|
|
69
|
+
medium: "medium";
|
|
70
|
+
high: "high";
|
|
71
|
+
}>>;
|
|
72
|
+
permissions: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
73
|
+
"read-only": "read-only";
|
|
74
|
+
"workspace-write": "workspace-write";
|
|
75
|
+
auto: "auto";
|
|
76
|
+
}>>;
|
|
77
|
+
}, z.core.$strict>>;
|
|
78
|
+
custom: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
79
|
+
model: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
80
|
+
effort: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
81
|
+
low: "low";
|
|
82
|
+
medium: "medium";
|
|
83
|
+
high: "high";
|
|
84
|
+
}>>;
|
|
85
|
+
permissions: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
86
|
+
"read-only": "read-only";
|
|
87
|
+
"workspace-write": "workspace-write";
|
|
88
|
+
auto: "auto";
|
|
89
|
+
}>>;
|
|
90
|
+
}, z.core.$strict>>;
|
|
91
|
+
}, z.core.$strict>;
|
|
92
|
+
models: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
93
|
+
baseUrl: z.ZodMiniURL;
|
|
94
|
+
model: z.ZodMiniString<string>;
|
|
95
|
+
envKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
96
|
+
wireApi: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
97
|
+
chat: "chat";
|
|
98
|
+
responses: "responses";
|
|
99
|
+
}>>;
|
|
100
|
+
disabled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
101
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
102
|
+
provider: z.ZodMiniEnum<{
|
|
103
|
+
codex: "codex";
|
|
104
|
+
claude: "claude";
|
|
105
|
+
}>;
|
|
106
|
+
model: z.ZodMiniString<string>;
|
|
107
|
+
effort: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
108
|
+
low: "low";
|
|
109
|
+
medium: "medium";
|
|
110
|
+
high: "high";
|
|
111
|
+
}>>;
|
|
112
|
+
disabled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
113
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
114
|
+
disabled: z.ZodMiniBoolean<boolean>;
|
|
115
|
+
}, z.core.$strict>]>>>;
|
|
116
|
+
agents: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniObject<{
|
|
117
|
+
engine: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
118
|
+
model: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
119
|
+
effort: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
120
|
+
low: "low";
|
|
121
|
+
medium: "medium";
|
|
122
|
+
high: "high";
|
|
123
|
+
}>>;
|
|
124
|
+
permissions: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
125
|
+
"read-only": "read-only";
|
|
126
|
+
"workspace-write": "workspace-write";
|
|
127
|
+
auto: "auto";
|
|
128
|
+
}>>;
|
|
129
|
+
runner: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
130
|
+
local: "local";
|
|
131
|
+
"local-docker": "local-docker";
|
|
132
|
+
"vercel-sandbox": "vercel-sandbox";
|
|
133
|
+
"github-actions": "github-actions";
|
|
134
|
+
}>>;
|
|
135
|
+
integrations: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
136
|
+
allowedTools: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniEnum<{
|
|
137
|
+
observe: "observe";
|
|
138
|
+
comment: "comment";
|
|
139
|
+
write: "write";
|
|
140
|
+
}>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
141
|
+
allowedEvents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
142
|
+
}, z.core.$strict>>>;
|
|
143
|
+
}, z.core.$strict>]>>>;
|
|
144
|
+
mcp: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
145
|
+
command: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
146
|
+
args: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
147
|
+
env: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
148
|
+
url: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
149
|
+
type: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
150
|
+
stdio: "stdio";
|
|
151
|
+
http: "http";
|
|
152
|
+
sse: "sse";
|
|
153
|
+
}>>;
|
|
154
|
+
headers: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
|
|
155
|
+
tools: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
156
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
157
|
+
}, z.core.$strict>>>;
|
|
158
|
+
approvals: z.ZodMiniObject<{
|
|
159
|
+
escalationTimeoutMs: z.ZodMiniNumber<number>;
|
|
160
|
+
allowedNetworkHosts: z.ZodMiniArray<z.ZodMiniString<string>>;
|
|
161
|
+
}, z.core.$strict>;
|
|
162
|
+
}, z.core.$strict>;
|
|
163
|
+
type McpConfigEntry = z.infer<typeof mcpEntrySchema>;
|
|
164
|
+
type Engine = z.infer<typeof engineSchema>;
|
|
165
|
+
type Effort = z.infer<typeof effortSchema>;
|
|
166
|
+
type Permission = z.infer<typeof permissionSchema>;
|
|
167
|
+
type CustomModelConfig = z.infer<typeof customModelSchema>;
|
|
168
|
+
type CoderConfig = z.infer<typeof effectiveConfigSchema>;
|
|
169
|
+
/** Flags of `coder mcp add`: a remote `url` or a stdio `command`; env, header and tools are comma lists. */
|
|
170
|
+
interface McpAddOptions {
|
|
171
|
+
url?: string;
|
|
172
|
+
transport?: string;
|
|
173
|
+
header?: string;
|
|
174
|
+
env?: string;
|
|
175
|
+
tools?: string;
|
|
176
|
+
command?: string[];
|
|
177
|
+
user?: boolean;
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/client/types.d.ts
|
|
181
|
+
type RunnerKind = 'local' | 'local-docker' | 'vercel-sandbox' | 'github-actions' | 'http';
|
|
182
|
+
interface RunnerSpec {
|
|
183
|
+
kind: RunnerKind;
|
|
184
|
+
name: string;
|
|
185
|
+
description: string;
|
|
186
|
+
connect: 'pair' | 'fields';
|
|
187
|
+
/** One or two sentences on what this kind needs and where to get it. */
|
|
188
|
+
help?: string;
|
|
189
|
+
fields: Array<{
|
|
190
|
+
key: string;
|
|
191
|
+
label: string;
|
|
192
|
+
secret?: boolean;
|
|
193
|
+
placeholder?: string;
|
|
194
|
+
optional?: boolean;
|
|
195
|
+
hint?: string;
|
|
196
|
+
}>;
|
|
197
|
+
available: boolean;
|
|
198
|
+
reason?: string;
|
|
199
|
+
}
|
|
200
|
+
interface RunnerRow {
|
|
201
|
+
id: string;
|
|
202
|
+
kind: RunnerKind;
|
|
203
|
+
name: string;
|
|
204
|
+
scope: 'personal' | 'workspace';
|
|
205
|
+
default: boolean;
|
|
206
|
+
online: boolean;
|
|
207
|
+
lastSeen?: number;
|
|
208
|
+
config: Record<string, string>;
|
|
209
|
+
createdAt: number;
|
|
210
|
+
}
|
|
211
|
+
interface RunnerPairing {
|
|
212
|
+
token: string;
|
|
213
|
+
expiresAt: number;
|
|
214
|
+
command: string;
|
|
215
|
+
}
|
|
216
|
+
interface RunnerInput {
|
|
217
|
+
kind: RunnerKind;
|
|
218
|
+
name: string;
|
|
219
|
+
scope: RunnerRow['scope'];
|
|
220
|
+
config: Record<string, string>;
|
|
221
|
+
}
|
|
222
|
+
interface RunnerUpdate {
|
|
223
|
+
name?: string;
|
|
224
|
+
default?: true;
|
|
225
|
+
config?: Record<string, string>;
|
|
226
|
+
}
|
|
227
|
+
interface RunnerTest {
|
|
228
|
+
ok: boolean;
|
|
229
|
+
detail: string;
|
|
230
|
+
ms: number;
|
|
231
|
+
}
|
|
232
|
+
interface ProbeResult {
|
|
233
|
+
reachable: boolean;
|
|
234
|
+
modelListed: boolean | null;
|
|
235
|
+
/** Model ids the endpoint lists, or null when it has no list. */
|
|
236
|
+
models: string[] | null;
|
|
237
|
+
detail: string;
|
|
238
|
+
}
|
|
239
|
+
interface LocalFolder {
|
|
240
|
+
path: string;
|
|
241
|
+
name: string;
|
|
242
|
+
recent?: number;
|
|
243
|
+
/** The git URL a cloned checkout came from. */
|
|
244
|
+
url?: string;
|
|
245
|
+
}
|
|
246
|
+
interface LocalFolders {
|
|
247
|
+
current: LocalFolder;
|
|
248
|
+
recent: LocalFolder[];
|
|
249
|
+
/** The machine can open its own folder dialog. */
|
|
250
|
+
picker: boolean;
|
|
251
|
+
}
|
|
252
|
+
interface TaskTurn {
|
|
253
|
+
prompt: string;
|
|
254
|
+
result?: {
|
|
255
|
+
ok?: boolean;
|
|
256
|
+
output?: string;
|
|
257
|
+
diff?: string;
|
|
258
|
+
} | string;
|
|
259
|
+
error?: string;
|
|
260
|
+
finishedAt?: number;
|
|
261
|
+
/** First log sequence after this turn. */
|
|
262
|
+
logSeq?: number;
|
|
263
|
+
}
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region src/core/task/log-view.d.ts
|
|
266
|
+
interface TaskLogEntry {
|
|
267
|
+
at?: string;
|
|
268
|
+
message?: string;
|
|
269
|
+
kind?: string;
|
|
270
|
+
[key: string]: unknown;
|
|
271
|
+
}
|
|
272
|
+
interface TokenUsage {
|
|
273
|
+
input: number;
|
|
274
|
+
cachedInput: number;
|
|
275
|
+
output: number;
|
|
276
|
+
total: number;
|
|
277
|
+
}
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region src/core/types.d.ts
|
|
280
|
+
/** An extra MCP server attached to a task, with the tools the engine may call. */
|
|
281
|
+
/** One MCP server in the `.mcp.json` entry shape: stdio (`command`) or remote (`url`). */
|
|
282
|
+
interface McpServerSpec {
|
|
283
|
+
name: string;
|
|
284
|
+
command?: string;
|
|
285
|
+
args?: string[];
|
|
286
|
+
/** Values may hold `${VAR}` placeholders, resolved from the environment at spawn time. */
|
|
287
|
+
env?: Record<string, string>;
|
|
288
|
+
/** Remote server; `type` defaults to `http` (streamable HTTP), `sse` for legacy servers. */
|
|
289
|
+
url?: string;
|
|
290
|
+
type?: 'stdio' | 'http' | 'sse';
|
|
291
|
+
headers?: Record<string, string>;
|
|
292
|
+
/** Tool allowlist; omit or empty for every tool the server offers. */
|
|
293
|
+
tools?: string[];
|
|
294
|
+
}
|
|
295
|
+
type TaskKind = 'task';
|
|
296
|
+
type TaskStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
297
|
+
/** A persisted task record (task.json). Most fields accrete over the lifecycle. */
|
|
298
|
+
interface Task {
|
|
299
|
+
id: string;
|
|
300
|
+
createdAt: string;
|
|
301
|
+
updatedAt?: string;
|
|
302
|
+
status: TaskStatus;
|
|
303
|
+
kind?: TaskKind;
|
|
304
|
+
name?: string | null;
|
|
305
|
+
engine?: Engine;
|
|
306
|
+
prompt?: string;
|
|
307
|
+
outputSchema?: object;
|
|
308
|
+
currentPrompt?: string | null;
|
|
309
|
+
system?: string | null;
|
|
310
|
+
model?: string | null;
|
|
311
|
+
effort?: Effort | null;
|
|
312
|
+
permissions?: Permission;
|
|
313
|
+
resumeThreadId?: string | null;
|
|
314
|
+
cwd?: string;
|
|
315
|
+
background?: boolean;
|
|
316
|
+
pid?: number | null;
|
|
317
|
+
dispatchId?: string;
|
|
318
|
+
threadId?: string | null;
|
|
319
|
+
turnId?: string | null;
|
|
320
|
+
steerEndpoint?: string | null;
|
|
321
|
+
completedAt?: string;
|
|
322
|
+
resumedAt?: string;
|
|
323
|
+
error?: string;
|
|
324
|
+
fallbacks?: Array<{
|
|
325
|
+
engine: Engine;
|
|
326
|
+
detail: string;
|
|
327
|
+
next: Engine;
|
|
328
|
+
}>;
|
|
329
|
+
archived?: boolean;
|
|
330
|
+
archivedAt?: string;
|
|
331
|
+
simulateApproval?: boolean;
|
|
332
|
+
flowRunId?: string;
|
|
333
|
+
agentId?: string;
|
|
334
|
+
source?: string;
|
|
335
|
+
author?: string;
|
|
336
|
+
repo?: string;
|
|
337
|
+
mcp?: McpServerSpec[];
|
|
338
|
+
addDirs?: string[];
|
|
339
|
+
}
|
|
340
|
+
/** The outcome of running one engine turn. status 0 == success. */
|
|
341
|
+
interface TurnResult {
|
|
342
|
+
status: number;
|
|
343
|
+
threadId: string | null;
|
|
344
|
+
turnId?: string | null;
|
|
345
|
+
finalMessage?: string;
|
|
346
|
+
touchedFiles?: string[];
|
|
347
|
+
tokens?: TokenUsage | null;
|
|
348
|
+
/** The model that ran the turn (tokens are only comparable per model). */
|
|
349
|
+
model?: string | null;
|
|
350
|
+
error?: {
|
|
351
|
+
message?: string;
|
|
352
|
+
} | null;
|
|
353
|
+
[key: string]: unknown;
|
|
354
|
+
}
|
|
355
|
+
/** Whether an engine binary is installed and usable. */
|
|
356
|
+
interface Availability {
|
|
357
|
+
available: boolean;
|
|
358
|
+
detail: string;
|
|
359
|
+
}
|
|
360
|
+
/** A persisted approval escalation and its answer, if any. */
|
|
361
|
+
interface Approval {
|
|
362
|
+
id: string;
|
|
363
|
+
summary: string;
|
|
364
|
+
/** Where an escalated command runs. */
|
|
365
|
+
cwd?: string;
|
|
366
|
+
createdAt?: string;
|
|
367
|
+
response?: {
|
|
368
|
+
decision: string;
|
|
369
|
+
} | null;
|
|
370
|
+
[key: string]: unknown;
|
|
371
|
+
}
|
|
372
|
+
/** A [flag-or-command, description] pair rendered in help tables. */
|
|
373
|
+
type HelpRow = [string, string];
|
|
374
|
+
/** Help metadata for one command. */
|
|
375
|
+
interface CommandHelpSpec {
|
|
376
|
+
usage: string;
|
|
377
|
+
summary?: string;
|
|
378
|
+
flags?: HelpRow[];
|
|
379
|
+
globalFlags?: HelpRow[];
|
|
380
|
+
exitCodes?: HelpRow[];
|
|
381
|
+
examples?: HelpRow[];
|
|
382
|
+
/** Environment variables the command reads: name → what it does. */
|
|
383
|
+
env?: HelpRow[];
|
|
384
|
+
seeAlso?: string;
|
|
385
|
+
}
|
|
386
|
+
/** A subcommand handler. Receives the argv slice after the command name. */
|
|
387
|
+
type CommandHandler = (argv: string[]) => Promise<void> | void;
|
|
388
|
+
//#endregion
|
|
389
|
+
export { CustomModelConfig as C, Permission as D, McpConfigEntry as E, CoderConfig as S, McpAddOptions as T, RunnerRow as _, HelpRow as a, RunnerUpdate as b, TurnResult as c, LocalFolder as d, LocalFolders as f, RunnerPairing as g, RunnerKind as h, CommandHelpSpec as i, TaskLogEntry as l, RunnerInput as m, Availability as n, Task as o, ProbeResult as p, CommandHandler as r, TaskStatus as s, Approval as t, TokenUsage as u, RunnerSpec as v, Effort as w, TaskTurn as x, RunnerTest as y };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./cli-BilSDkvE.js";import{o as t}from"./models-_5LVGC3m.js";import{n}from"./add-U-pty9qJ.js";import{t as r}from"./remove-C5_xggx7.js";const i=e({name:`model unalias`,help:{usage:`coder model unalias <name> [--workspace]`,summary:`Remove a user-defined alias.`,flags:[[`--workspace`,`target <repo>/.coder/config.json instead of the user file`]]},options:n,args:1,run:({options:e,args:[n],cwd:r})=>t(r,n,e),print:e=>r(`unaliased`,e.unaliased,e.file)});export{i as commandModelUnalias};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./cli-BilSDkvE.js";import{s as t}from"./models-_5LVGC3m.js";import{a as n,i as r,n as i,r as a}from"./add-U-pty9qJ.js";const o=e({name:`model update`,help:{usage:`coder model update <name> [--base-url <url>] [--model <id>] [--env-key VAR]`,summary:`Update a configured custom model. Only the flags you pass change; the endpoint
|
|
2
|
+
is re-probed and the wire protocol re-detected.`,flags:[[`--base-url <url>`,`new API base`],[`--model <id>`,`new provider model id`],[`--env-key <VAR>`,`new API-key env var`],[`--workspace`,`write to <repo>/.coder/config.json instead of the user file`]]},options:i,args:1,run:({options:e,args:[r],cwd:i})=>t(i,r,n(e)),json:a,print:e=>r(e,`updated`)});export{o as commandModelUpdate};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{T as e}from"./dispatch-BKeAch9E.js";import{i as t}from"./cli-BilSDkvE.js";import{f as n,p as r,t as i}from"./output-BKeyLbvt.js";import{n as a,s as o}from"./args-BOEEdpWk.js";import s from"node:process";const c=t({name:`upgrade`,globalFlags:{json:!1,cwd:!1},help:{usage:`coder upgrade [--cli-only] [--plugins-only] [--codex] [--claude] [--pm <mgr>]`,summary:`Update the coder CLI through whichever package manager installed it, then refresh
|
|
2
|
+
the host plugins to match. Alias: update.`,flags:[[`--cli-only`,`update just the CLI`],[`--plugins-only`,`refresh just the host plugins`],[`--codex`,`limit the refresh to the Agent Skills copy (Codex, Pi, ...)`],[`--claude`,`limit the refresh to the Claude Code plugin`],[`--pm <npm|pnpm|yarn|bun>`,`force a package manager instead of auto-detecting`]]},options:{pm:o,"cli-only":a,"plugins-only":a,codex:a,claude:a},run:({options:t})=>e({...t,cliOnly:t[`cli-only`],pluginsOnly:t[`plugins-only`]},l),print:u});function l(e){s.stdout.write(`${r.bold(`Updating coder CLI`)} ${r.dim(`${e}...`)}\n`)}function u(e){let t=r.bold,a=r.dim,o=(e,n)=>n&&e&&n!==e?`${e} ${a(`->`)} ${t(n)}`:`${n??e??`?`} ${a(`(unchanged)`)}`,c=(e,t)=>`${t.installed?n(`${e} ${o(t.from,t.to)} ${a(`- ${t.note}`)}`):i(`${e} ${t.note}`)}\n`;e.cli&&s.stdout.write(e.cli.changed?`${n(`coder CLI ${o(e.cli.from,e.cli.to)}`)}\n`:`${n(`coder CLI ${e.cli.from} ${a(`(already latest)`)}`)}\n`),e.claudePlugin&&s.stdout.write(c(`claude plugin`,e.claudePlugin)),e.agentsSkill&&s.stdout.write(c(`agents skill `,e.agentsSkill))}const d=async()=>(await import(`./refresh-BIrmrWYq.js`)).commandRefreshUpdate,f=Object.assign(async e=>e[0]===`refresh`?(await d())(e.slice(1)):c(e),c,{subcommands:{refresh:d}});export{f as commandUpgrade};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DT7IzrpZ.js";import{a as t,i as n}from"./load-BpEsAn51.js";import{a as r,d as i,f as a,n as o,u as s}from"./http-Bkg_OQ6r.js";import{g as c}from"./store-DzqXS2wT.js";var l=e({addUsage:()=>f,leaders:()=>m,readUsage:()=>x,readUsageTotals:()=>S,timeZone:()=>d,usageReport:()=>b,usageSummary:()=>_,usageTotals:()=>p});function u(e){return typeof e==`number`?e:!e||typeof e!=`object`||Array.isArray(e)?0:`total`in e&&typeof e.total==`number`?e.total:Object.values(e).reduce((e,t)=>e+u(t),0)}function d(e){if(!e)return`UTC`;try{return new Intl.DateTimeFormat(`en`,{timeZone:e}),e}catch{return`UTC`}}const f=(e,t)=>{e.tasks+=t.tasks,e.runnerMs+=t.runnerMs,e.tokenCount+=t.tokenCount};async function p(e,t){if(e.usageTotals)return e.usageTotals(t);if(t.top){let{top:n,...r}=t,i=(await p(e,{...r,by:`agent`,parts:void 0})).sort((e,t)=>t[n.by]-e[n.by]||e.key.localeCompare(t.key)).slice(0,n.count).map(e=>e.key);return p(e,{...r,parts:i})}let n=d(t.tz),r=new Intl.DateTimeFormat(`en-CA`,{timeZone:n,year:`numeric`,month:`2-digit`,day:`2-digit`}),i=new Set(t.parts),a=new Map;for(let{value:n}of await e.list(`usage`)){if(n.at<t.since||t.until!==void 0&&n.at>=t.until||t.agent&&n.agent!==t.agent)continue;let e=t.by===`agent`?n.agent:t.by===`installation`?n.installationId??`none`:t.by===`engine`?n.engine??`unknown`:r.format(n.at),o={tasks:1,runnerMs:n.runnerElapsedMs,tokenCount:u(n.tokens)},s=a.get(e)??{key:e,tasks:0,runnerMs:0,tokenCount:0};f(s,o),i.has(n.agent)&&(s.parts??={},f(s.parts[n.agent]??={tasks:0,runnerMs:0,tokenCount:0},o)),a.set(e,s)}return[...a.values()].sort((e,t)=>e.key.localeCompare(t.key))}function m(e,t){let n=new Map;for(let r of e)for(let[e,i]of Object.entries(r.parts??{}))n.set(e,(n.get(e)??0)+i[t]);return[...n].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e])=>e)}function h(e,t){if(typeof t==`number`)return(typeof e==`number`?e:0)+t;if(!t||typeof t!=`object`||Array.isArray(t))return e;let n=e&&typeof e==`object`&&!Array.isArray(e)?{...e}:{};for(let[e,r]of Object.entries(t))n[e]=h(n[e],r);return n}function g(e,t){let n=new Map;for(let r of e){let e=t===`agent`?r.agent:t===`installation`?r.installationId??`none`:r.engine??`unknown`,i=n.get(e)??{key:e,tasks:0,runnerMs:0};i.tasks++,i.runnerMs+=r.runnerElapsedMs,r.tokens!==void 0&&(i.tokens=h(i.tokens,r.tokens)),n.set(e,i)}return[...n.values()].sort((e,t)=>e.key.localeCompare(t.key))}function _(e,t,n){let r=e.filter(e=>e.at>=t);return{since:t,totals:n?g(r,n):{agent:g(r,`agent`),installation:g(r,`installation`),engine:g(r,`engine`)}}}const v={tasks:`tasks`,runner:`runnerMs`,tokens:`tokenCount`},y={tokens:e=>e.tokenCount,tasks:e=>e.tasks,runner:e=>e.runnerMs,name:e=>e.key};async function b(e,c){let l=e=>c.searchParams.get(e),u=Number(l(`since`)??0),f=l(`until`)===null?void 0:Number(l(`until`)),h=l(`by`)??`agent`;if(!Number.isFinite(u)||f!==void 0&&!Number.isFinite(f)||![`agent`,`installation`,`engine`,`day`].includes(h))return r({error:`Invalid usage query`},400);let g=l(`parts`)?.split(`,`).filter(Boolean),_=Math.min(Number(l(`top`)??0),8),b=v[l(`sort`)??`tokens`]??`tokenCount`,x=await p(e.store,{by:h,since:u,...f===void 0?{}:{until:f},...l(`agent`)?{agent:l(`agent`)}:{},...h===`day`?{tz:d(l(`tz`))}:{},...g?.length?{parts:g.slice(0,20)}:{},..._>0?{top:{count:_,by:b}}:{}}),S={since:u,...f===void 0?{}:{until:f}};if(h===`agent`){let r=new Set(e.local?(await t(e.local.cwd,e.integrations)).map(e=>e.id):(await e.store.list(`agent`)).map(e=>e.id));for(let e of Object.keys(n()))r.add(e);for(let e of x)r.has(e.key)||(e.deleted=!0)}if(_>0)return r({...S,totals:x,top:m(x,b)});if(!a(c)||h!==`agent`)return r({...S,totals:x});let C=y[l(`sort`)??`tokens`]??y.tokens,w=l(`sort`)===`name`,T=l(`q`)?.trim().toLowerCase(),E=([e,t],[n,r])=>(e<n?-1:+(e>n))*(w?1:-1)||t.localeCompare(r),D=e=>[C(e),e.key],O=o(c),k=x.filter(e=>!T||e.key.toLowerCase().includes(T)).filter(e=>!O||E(D(e),O)>0).sort((e,t)=>E(D(e),D(t))),A=i(c),j=e=>x.reduce((t,n)=>t+e(n),0);return r({...S,...s(k.slice(0,A+1),A,D),summary:{agents:x.length,tasks:j(e=>e.tasks),runnerMs:j(e=>e.runnerMs),tokenCount:j(e=>e.tokenCount)}})}async function x(e,t,n,i){t.local&&await c(t);let a=i.searchParams.get(`installation`),o=await t.store.list(`usage`);return r(a?o.filter(e=>e.value.installationId===a):o)}async function S(e,t,n,i){t.local&&await c(t);let a=Number(i.searchParams.get(`since`)??0),o=i.searchParams.get(`by`);if([`until`,`agent`,`tz`,`parts`,`top`,`cursor`].some(e=>i.searchParams.has(e))||o===`day`)return b(t,i);if(!Number.isFinite(a)||o&&![`agent`,`installation`,`engine`].includes(o))return r({error:`Invalid usage query`},400);let s=(await t.store.list(`usage`)).map(e=>e.value);return r(_(s,a,o))}export{l as a,d as i,x as n,S as r,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t}from"./cli-BilSDkvE.js";import{g as n,p as r}from"./output-BKeyLbvt.js";import{i,n as a,s as o,t as s}from"./args-BOEEdpWk.js";import c from"node:process";const l={server:i,workspace:o,yes:a};function u(e,t){let i=Array.isArray(e.totals)?e.totals.map(e=>({group:t??``,...e})):Object.entries(e.totals).flatMap(([e,t])=>t.map(t=>({group:e,...t})));if(!i.length)return void c.stdout.write(`${r.dim(`No usage in this period.`)}\n`);c.stdout.write(`${n([{header:`by`,value:e=>e.group},{header:`key`,value:e=>e.key,paint:e=>r.cyan(e)},{header:`tasks`,value:e=>String(e.tasks)},{header:`runner ms`,value:e=>String(e.runnerMs)},{header:`tokens`,value:e=>e.tokens===void 0?``:JSON.stringify(e.tokens)}],i,r)}\n`)}const d=e({name:`agent usage`,help:{usage:`coder agent usage [--since 7d|24h|<ms>] [--by agent|installation|engine] [--server [url]] [--json] [--cwd <dir>]`,flags:[[`--since <period|ms>`,`period such as 7d or 24h, or milliseconds since epoch`],[`--by <group>`,`agent, installation, or engine`],t]},options:{...s,...l,since:o,by:o},run:async({options:e,cwd:t})=>{let{agents:n}=await import(`./agent-BsYx3Odz.js`).then(e=>e.t);return n.usage({...e,cwd:t,organization:e.workspace,since:e.since??`7d`})},print:(e,{options:t})=>u(e,t.by)});export{d as commandAgentUsage};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{Ht as e}from"./dispatch-BKeAch9E.js";import{i as t}from"./cli-BilSDkvE.js";import{_ as n,a as r,b as i,c as a,h as o,l as s,n as c,p as l,s as u,u as d,v as f,y as p}from"./output-BKeyLbvt.js";import{l as m,t as h}from"./args-BOEEdpWk.js";import g from"node:process";const _=t({name:`flow watch`,help:{usage:`coder flow watch [run-id] [--tail <n|all>] [--json]`,summary:`Watch a flow run live: replay its progress lines from the start, then keep
|
|
2
|
+
following while it runs (Ctrl-C detaches; it keeps running). Blocks until it
|
|
3
|
+
finishes; exits 0 on success, 1 otherwise. Defaults to the most recent run.
|
|
4
|
+
For the result alone, prefer \`coder flow result\`. Alias: stream.`,flags:[[`--tail <n|all>`,`replay only the last n events first (default: all)`]],examples:[[`coder flow watch`,`follow the most recent run to completion`]]},options:{...h,tail:m},args:1,run:async({options:e,args:[t]})=>{let{watchRun:n}=await import(`./executor-BvAA7Cgw.js`).then(e=>e.y);return N(n(t,{tail:e.tail}),{json:e.json,stream:!0})}}),v=[`⣾`,`⣽`,`⣻`,`⢿`,`⡿`,`⣟`,`⣯`,`⣷`];function y(e,t=!1){let n=l;return t?c(`[${x(e)}]`,10):e===`completed`?n.bold(n.green(`✔`)):e===`failed`||e===`cancelled`||e===`stopped`?n.bold(n.red(`✘`)):e===`running`?n.bold(n.cyan(`●`)):n.dim(`○`)}function b(){return c(`[start]`,10)}function x(e){return e===`completed`?`done`:e===`cancelled`?`failed`:e}function S(e,t){return e??t.replace(/\s+/g,` `).trim().slice(0,60)}function C(e,t,n,r,i,a){let o=l,u=c(t??n,32);return[`${e} ${a?o.bold(u):u}`,o.dim(c(n,24)),o.light(c(i??``,20)),r?o.light(`${s(r.total)} tok`):``].join(` `).trimEnd()}function w(e,t=!1){let n=l;return`${y(e.ok?`completed`:`failed`,t)} ${n.dim(`gate`)} ${n.light(e.cmd)}${e.ok?``:n.dim(` · exit ${e.code}`)}`}function T(e,t,n){let i=l,a=n!==void 0&&n>=1e3?i.dim(` · ${r(n)}`):``;return`${t} ${i.dim(`gate`)} ${i.light(e)}${a}`}function E(e,t=!1){return l.dim(`${`│ `.repeat(e)}${t?`└─`:`├─`}`)}function D(e){return l.dim(`${`│ `.repeat(e)}│ `)}function O(e){return`${` `.repeat(e.depth)}${e.log?`${c(`[log]`,10)} `:``}${e.body}`}function k(e,t,n=!1){return n?O(e):`${e.log?D(e.depth):E(e.depth,t)} ${e.body}`}function A(e){return l.dim(`${`│ `.repeat(Math.max(0,e))}│`)}var j=class{stream;names=new Map;active=new Map;activeGates=new Map;pending;previews=new Map;frame=0;hasCommitted=!1;timer;tty;region;constructor(e=g.stdout){this.stream=e,this.tty=!!e.isTTY,this.region=new n(e)}emit(e){let t=l;switch(e.kind){case`task-start`:{let t={name:S(e.name,e.prompt),engine:e.engine,depth:e.depth??0};if(this.names.set(e.taskId,t),!this.tty){this.final(t.depth,C(b(),t.name,e.taskId,null,t.engine));return}this.active.set(e.taskId,t),this.spin(!0),this.repaint();return}case`task-end`:{this.active.delete(e.taskId),this.previews.delete(e.taskId),this.idle();let t=this.names.get(e.taskId);this.final(t?.depth??0,C(y(e.status,!this.tty),t?.name??null,e.taskId,e.tokens,t?.engine));return}case`gate-start`:{let t={cmd:e.cmd,depth:e.depth??0,startedAt:Date.now()};if(!this.tty){this.final(t.depth,T(t.cmd,b()));return}this.activeGates.set(e.gateId,t),this.spin(!0),this.repaint();return}case`gate`:e.gateId&&this.activeGates.delete(e.gateId),this.idle(),this.final(e.depth??0,w(e,!this.tty));return;case`log`:for(let n of e.message.split(`
|
|
5
|
+
`))this.final(e.depth??0,t.light(n),!0);return;case`flow-start`:this.final(e.depth-1,t.bold(`flow ${e.name}`));return;case`replay`:this.final(0,t.dim(`replayed ${e.count} steps from journal`),!0)}}done(){this.spin(!1),this.flush(0),this.tty&&this.repaint(),this.region.done()}flush(e){this.pending&&=(this.region.commit(`${k(this.pending,e<this.pending.depth,!this.tty)}\n`),this.hasCommitted=!0,void 0)}final(e,t,n=!1){if(!this.tty){this.region.commit(`${O({depth:e,body:t,log:n})}\n`),this.hasCommitted=!0;return}this.flush(e),this.pending={depth:e,body:t,log:n},this.tty&&this.repaint()}repaint(){let e=[],t=[];if(this.pending){let n=k(this.pending,!1);e.push(n),t.push(n)}let n=this.timer?l.bold(l.cyan(v[this.frame%v.length])):y(`running`);for(let[r,i]of this.active){let a=`${E(i.depth??0)} ${C(n,i.name,r,null,i.engine,!0)}`;(e.length||this.hasCommitted)&&e.push(A(i.depth??0)),e.push(a),t.push(a);let o=this.previews.get(r);o&&e.push(`${D(i.depth??0)} ${l.dim(o)}`)}for(let r of this.activeGates.values()){let i=`${E(r.depth)} ${T(r.cmd,n,Date.now()-r.startedAt)}`;(e.length||this.hasCommitted)&&e.push(A(r.depth)),e.push(i),t.push(i)}let r=(i(this.stream)??1/0)-1,a=e.length<=r?e:t;if(a.length>r){let e=Math.max(0,r-1);a=[l.dim(`… +${a.length-e} more running`),...a.slice(-e)]}this.region.set(a)}refreshPreviews(){for(let t of this.active.keys())try{let n=e(g.cwd(),t,1)[0]?.message?.replace(/\s+/g,` `).trim();if(!n)continue;let r=(p(this.stream)??120)-8;this.previews.set(t,n.length>r?`${n.slice(0,r-1)}…`:n)}catch{}}idle(){!this.active.size&&!this.activeGates.size&&this.spin(!1)}spin(e){e&&!this.timer?this.timer=setInterval(()=>{this.frame++,this.frame%4==0&&this.refreshPreviews(),this.repaint()},120).unref():!e&&this.timer&&(clearInterval(this.timer),this.timer=void 0)}};function M(e,t){if(t){o(e);return}let n=!g.stdout.isTTY,r=n?``:`${l.dim(`└─`)} `;g.stdout.write(`${r}${y(`completed`,n)} run ${l.cyan(e.runId)} completed ${l.dim(`(${e.taskCount} tasks)`)}\n`),g.stdout.write(`\n${a(e.result)}\n`),P(e.tokens)}async function N(e,t){let{runId:n}=e.record,r=!!(t.stream&&t.json);!t.json&&e.record.status===`running`&&g.stderr.write(`${l.dim(`[flow]`)} Run ${l.cyan(n)} started and is waiting to finish. Press Ctrl-C to detach. It keeps running.\n\n`);let i=t.json?()=>{}:f(),a=()=>{i(),r||(g.stderr.write(`\n${l.dim(`[flow] Detached. The run is still going.`)}\n`),g.stderr.write(`\n${u([`Result: coder flow result ${n}`,`Stop it: coder flow stop ${n}`],l)}\n`)),g.exit(130)};g.on(`SIGINT`,a);let s=new j;for await(let n of e.events)r?g.stdout.write(`${JSON.stringify(n)}\n`):t.json||s.emit(n);s.done(),i(),g.off(`SIGINT`,a);let c=e.final();r&&(g.stdout.write(`${JSON.stringify(F(c))}\n`),g.exit(c.status===`completed`?0:1)),c.status===`completed`&&(M({runId:n,name:c.name,status:`completed`,result:c.result,tokens:c.ledger,taskCount:c.taskCount},t.json),g.exit(0)),c.status===`stopped`&&(t.json?o({runId:n,name:c.name,status:`stopped`,taskCount:c.taskCount}):g.stdout.write(`\n${l.dim(`[flow] Run ${n} stopped.`)}\n\n${u([`Resume: coder flow resume ${n}`],l)}\n`),g.exit(1)),g.stdout.write(`\n${l.red(`error:`)} ${c.error??`unknown error`}\n`),g.stdout.write(`\n${u([`Resume: coder flow resume ${n}`],l)}\n`),g.exit(1)}function P(e){let t=Object.keys(e);if(t.length){g.stdout.write(`\n${l.bold(`Tokens:`)}\n`);for(let n of t)g.stdout.write(` ${l.dim(d(e[n],n))}\n`)}}function F(e){let{steps:t,events:n,...r}=e;return r}export{j as FlowStepRenderer,_ as commandWatch,w as gateLine,T as gateRunningLine,O as paintPlain,N as printFollow,P as printLedger,M as printRunSummary,F as resultJson,y as stepSymbol,S as taskLabel,C as taskLine};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{Dn as e,cn as t}from"./dispatch-BKeAch9E.js";import{i as n,r}from"./cli-BilSDkvE.js";import{p as i,y as a}from"./output-BKeyLbvt.js";import{i as o,l as s,n as c,s as l,t as u}from"./args-BOEEdpWk.js";import{LogRenderer as d,finalMessageLine as f,printOutcome as p,promptBlock as m,taskHeaderLines as h,taskSummaryLines as g,trimStep as _}from"./result-BzaM3inj.js";import v from"node:process";import*as y from"zod/mini";const b={server:o,workspace:l,yes:c};function x(e,t){let n=e.level===`sys`?t.dim(`· ${e.line}`):e.level===`err`?t.light(e.line):e.line;v.stdout.write(`${n}\n`)}async function S(n,r,o){if(`attempts`in n.task){for await(let e of n.events)o.json?v.stdout.write(`${JSON.stringify(e,null,2)}\n`):x(e,i);let e=await n.final();o.json||p(e,i),v.exit(0)}let s=n.task,c=o.trim===void 0?500:o.trim===`none`?1/0:o.trim,l=await d.create({cwd:s.cwd??r,startedAt:Date.parse(s.createdAt??``)||void 0,trim:c,explicitTrim:o.trim!==void 0,width:a()});if(!o.json){let e=[...h(s,{status:s.status}),...t.includes(s.status)?[i.dim(`Watching. Press Ctrl-C to stop.`)]:[],...s.prompt?m(s.prompt,i,{truncate:!1}):[],``];v.stdout.write(`${e.join(`
|
|
2
|
+
`)}\n`)}let u=null,y=null,b=e=>{let t=l.render(e);t.length&&v.stdout.write(`${t.join(`
|
|
3
|
+
`)}\n`)};for await(let e of n.events){let t=e;if(t.kind===`usage`&&t.tokens&&(u=t.tokens),o.json){let e=t.kind===`steer`?1/0:c,n=t.message?{...t,message:_(t.message,e,{plain:!0})}:t;v.stdout.write(`${JSON.stringify(n)}\n`);continue}t.kind!==`usage`&&(y&&=(b(y),null),t.kind===`assistant`?y=t:b(t))}let{status:S,result:C,task:w}=await n.final();if(o.json)v.stdout.write(`${JSON.stringify({taskId:s.id,status:S,result:C},null,2)}\n`);else{let t=S===`completed`?`(no final message)`:`(task ${S})`,n=g(w,{tokens:C?.tokens??u,tokenModel:C?.model,files:C?.touchedFiles?.map(t=>e(s.cwd??r,t)),statusChanged:S!==s.status});n.length&&v.stderr.write(`\n${n.join(`
|
|
4
|
+
`)}\n`);let i=f(C,w.error,t),a=y?String(y.message??``):``;v.stdout.write(`\n${i.trim()?i:a}\n`)}v.exit(S===`completed`?0:1)}const C=n({name:`task watch`,help:{usage:`coder task watch [task-id] [--server [url]]`,summary:`Stream a running task's transcript live (for you/debugging), then print its
|
|
5
|
+
final answer. Replays the last line first so the current step is visible;
|
|
6
|
+
--tail <n> replays the last n lines (--tail all for the whole transcript).
|
|
7
|
+
Blocks until it finishes; exits 0 on success, 1 otherwise. For the answer
|
|
8
|
+
alone, prefer \`coder result\`. Alias: stream.`,flags:[[`--tail <n|all>`,`replay the last n log lines first (default: 1)`],[`--trim <n|none>`,`budget for tool output and thinking (default: 1200 chars, 12 lines)`],r],examples:[[`coder task watch`,`follow the most recent task to completion`]]},options:{...u,tail:s,trim:y.optional(y.union([y.literal(`none`),y.coerce.number().check(y.int(),y.positive())],{error:`expected a positive integer or "none"`})),...b},args:1,async run({options:e,args:[t],cwd:n}){let{tasks:r}=await import(`./task-C6VAg5WU.js`).then(e=>e.t);await S(await r.watch(t,{...e,organization:e.workspace}),n,e)}});export{C as commandWatch,x as printLine};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Q as e}from"./dispatch-BKeAch9E.js";import t from"node:process";async function n(n,r,i){let a=n.envKey?t.env[n.envKey]:void 0,o=!1;for(let t of e(n.baseUrl,r))try{let e=await fetch(t,{method:`POST`,headers:{"content-type":`application/json`,...a?{Authorization:`Bearer ${a}`}:{}},body:JSON.stringify(i),signal:AbortSignal.timeout(5e3)});if(o=!0,e.status!==404&&e.status!==405&&e.status!==501)return{baseUrl:t.slice(0,-(r.length+1))}}catch{}return{reachable:o}}async function r(e){let t=await n(e,`responses`,{model:e.model,input:[],stream:!1});if(`baseUrl`in t)return{wireApi:`responses`,baseUrl:t.baseUrl};let r=await n(e,`chat/completions`,{model:e.model,messages:[],stream:!1});return`baseUrl`in r?{wireApi:`chat`,baseUrl:r.baseUrl}:t.reachable||r.reachable?{wireApi:`chat`}:null}export{r as t};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{F as e,I as t,J as n,M as r,O as i,On as a,Ot as o,Qt as s,S as c,Tt as l,_ as u,ft as d,in as f,l as p,mt as m,nt as h,pt as g,sn as _,tn as v,tt as y,ut as b,zt as x}from"./dispatch-BKeAch9E.js";import{t as S}from"./chat-bridge-BS9WtP3X.js";import{t as C}from"./wire-BeT1Axeo.js";import w from"node:path";import T from"node:process";import E from"node:fs";function D(e){if(e.resumeThreadId)return e.currentPrompt??e.prompt??``;let t=e.system?`\n-------\n${e.system}`:``;return`<system>
|
|
2
|
+
You are running inside a coder task: do the work yourself, directly.
|
|
3
|
+
Do not load the coder skill (recursive), and never dispatch through the \`coder\` CLI - nested dispatch is disabled.
|
|
4
|
+
When finished, provide a concise implementation result summary.
|
|
5
|
+
Your turn is one-shot: background processes will not re-invoke you after it ends, so verify synchronously before finishing.
|
|
6
|
+
Never run git write operations (commit, checkout, stash, reset, rebase, merge, push, etc.); leave changes uncommitted for the caller to review.${e.agentId?"\nFlows are the exception: run one from your shell with `coder flow run <name> --wait --json --args '<json>'`; it runs as a script in your sandbox.":``}${t}
|
|
7
|
+
</system>
|
|
8
|
+
|
|
9
|
+
${e.prompt??``}`}function O(e,t){let n=0;return()=>{Date.now()-n>=1e4&&(n=Date.now(),f(e,t))}}function k(e,t,{echo:n}){return r=>{let i=typeof r==`string`?{message:r}:r;l(e,t,i),n&&i.message&&T.stderr.write(`[coder] ${i.message}\n`)}}async function A(i,a,{echo:o}){let c=v(i),f=s(i,a.id),x=h(i),w=k(i,a.id,{echo:o}),E=n[a.permissions??`auto`]??n.auto,A=E.approvalPolicy===`never`?void 0:u({workspaceRoot:c,taskDir:f,mode:E.approvalMode,escalationTimeoutMs:x.approvals.escalationTimeoutMs,allowedNetworkHosts:x.approvals.allowedNetworkHosts,onEvent:e=>{l(i,a.id,e),o&&e.message&&T.stderr.write(`[coder] ${e.message}\n`)}}),j=a.model?x.models?.[a.model]:void 0,N=j&&y(j)?j:void 0;if(N&&!N.wireApi&&a.model){let e=await C(N);e&&(N={...N,...e},x.models[a.model]=N,b(i,a.model,e),l(i,a.id,{kind:`info`,message:`detected wire api for ${a.model}: ${e.wireApi} @ ${N.baseUrl}`}))}if(N?.envKey&&!T.env[N.envKey])throw Error(`Missing environment variable: \`${N.envKey}\`.`);let P=N?await S(N,N.wireApi??`chat`):null,F=m(x,a.model,P??void 0),I=t(i,a);try{let t=await r(i,{prompt:D(a),outputSchema:a.outputSchema,model:F?.model??d(a.model),modelProvider:F?.modelProvider??null,configOverrides:I?{...F?.configOverrides,"shell_environment_policy.set":{[e]:I}}:F?.configOverrides??null,effort:a.effort,sandbox:E.sandbox,approvalPolicy:E.approvalPolicy,networkAccess:g(a.permissions??`auto`,x.engines.codex?.network),approvalsReviewer:E.approvalMode===`auto`?`auto_review`:null,mcpServers:p(a.mcp),writableRoots:[...E.sandbox===`read-only`?[]:a.addDirs??[],...I?[I]:[]],onApprovalRequest:A,onHeartbeat:O(i,a.id),resumeThreadId:a.resumeThreadId??null,onControlReady:(e,t,n)=>{_(i,a.id,{status:`running`,steerEndpoint:e,threadId:t,turnId:n})},onProgress:e=>{w(e);let t=typeof e==`object`?e.threadId:null,n=typeof e==`object`?e.turnId:null;(t||n)&&_(i,a.id,{status:`running`,...t?{threadId:t}:{},...n?{turnId:n}:{}})}});return _(i,a.id,{status:t.status===0?`completed`:`failed`,threadId:t.threadId,turnId:t.turnId,steerEndpoint:null,completedAt:new Date().toISOString()}),M(i,a,f,t),t}finally{_(i,a.id,{steerEndpoint:null}),await P?.close()}}async function j(r,a,{echo:o}){let c=s(r,a.id),l=h(r),u=k(r,a.id,{echo:o}),d=n[a.permissions??`auto`]??n.auto,f=t(r,a);try{let t=await i(r,{prompt:D(a),outputSchema:a.outputSchema,model:a.model,effort:a.effort,permissions:a.permissions,approvalTaskId:d.approvalMode===`auto`?a.id:null,allowedNetworkHosts:l.approvals.allowedNetworkHosts,additionalDirectories:a.addDirs,...f?{writableDirectories:[f],env:{[e]:f}}:{},mcpServers:p(a.mcp),taskRoot:c,resumeSessionId:a.resumeThreadId??null,onHeartbeat:O(r,a.id),onSteerReady:e=>{_(r,a.id,{status:`running`,steerEndpoint:e})},onProgress:e=>{u(e),e.threadId&&_(r,a.id,{status:`running`,threadId:e.threadId})}});return _(r,a.id,{status:t.status===0?`completed`:`failed`,threadId:t.threadId,steerEndpoint:null,completedAt:new Date().toISOString()}),M(r,a,c,t),t}finally{_(r,a.id,{steerEndpoint:null})}}function M(e,t,n,r){a(w.join(n,`result.json`),r);let i={at:new Date().toISOString(),prompt:t.currentPrompt??t.prompt??null,...r};E.appendFileSync(w.join(n,`results.jsonl`),`${JSON.stringify(i)}\n`,`utf8`)}function N(e){return e.engine===`claude`?j:A}async function P(e,t){for(let n=0;n<2;){let r=x(e,t);if(!r||r.status===`failed`||r.status===`cancelled`)return;let i=o(e,t);if(i.length===0){n+=1,await new Promise(e=>setTimeout(e,300));continue}n=0;for(let n of i){let i=_(e,t,{status:`running`,currentPrompt:n,resumeThreadId:r.threadId??null});l(e,t,{message:`Running steered follow-up.`});try{await N(i)(e,i,{echo:!1})}catch(n){let r=n instanceof Error?n.message:String(n);_(e,t,{status:`failed`,error:r}),l(e,t,{kind:`error`,message:r});return}}}}async function F(e,t,n){if(t.dispatchId&&!t.resumedAt)try{E.writeFileSync(w.join(s(e,t.id),`start-${t.dispatchId}`),``,{flag:`wx`})}catch(e){if(e.code===`EEXIST`)return;throw e}_(e,t.id,{status:`running`,pid:T.pid});let r=()=>{},i;try{if(r=n(e,t),t.name?.startsWith(`agent:`)){let{startInboxControl:n,applyTaskMessage:r}=await import(`./task-DeglY79z.js`).then(e=>e.d);i=n(s(e,t.id),t.name.slice(6),n=>r(e,x(e,t.id)??t,n))}if(t.simulateApproval){let n=await c(s(e,t.id),{onEvent:n=>l(e,t.id,n)});if(l(e,t.id,{message:`simulated approval: ${n}`}),n===`decline`){_(e,t.id,{status:`cancelled`,completedAt:new Date().toISOString(),error:`simulated approval denied`});return}}await N(t)(e,t,{echo:!1}),await P(e,t.id)}catch(n){let r=n instanceof Error?n.message:String(n);throw _(e,t.id,{status:`failed`,error:r}),l(e,t.id,{kind:`error`,message:r}),n}finally{r(),await i?.close()}}export{F as runWorker};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{zt as e}from"./dispatch-BKeAch9E.js";import{i as t}from"./cli-BilSDkvE.js";import{i as n}from"./output-BKeyLbvt.js";import{s as r}from"./args-BOEEdpWk.js";import i from"node:process";const a=t({name:`task worker`,options:{cwd:r},args:1,async run({args:[t],cwd:r}){let{startAgentMailbox:a}=await import(`./exec-RZFLclKX.js`).then(e=>e.i),{runWorker:o}=await import(`./worker-CXndxmGF.js`),s=e(r,t);s||n(`Worker: task ${t} not found.`),await o(r,s,a).catch(()=>i.exit(1))}});export{a as commandWorker};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./cli-BilSDkvE.js";import t from"node:process";const n=e({name:`server workflow`,globalFlags:{json:!1,cwd:!1},help:{usage:`coder server workflow`,summary:`Print the workflow the github-actions runner dispatches. Save it as .github/workflows/coder-agent.yml in every repo the agent runs on, and set RUNNER=github-actions on the server.`,examples:[[`coder server workflow > .github/workflows/coder-agent.yml`,`add it to a repo`]]},options:{},run:async()=>{let{ACTIONS_WORKFLOW_YAML:e}=await import(`./github-actions-DwUzm4hC.js`).then(e=>e.r);return e},print:e=>t.stdout.write(e)});export{n as commandServerWorkflow};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# The `coder` agent
|
|
2
|
+
|
|
3
|
+
The built-in agent. On the hosted service it has an install link per platform; self-hosters create its shared apps once per server with `coder server app create <integration>` ([Self-hosting](../self-host.md#after-the-first-start)). Tune or disable it under `agents.coder` in `.coder/config.json` ([Usage](index.md#usage)).
|
|
4
|
+
|
|
5
|
+
## On GitHub
|
|
6
|
+
|
|
7
|
+
- A pull request opening, updating, or becoming ready runs the [review flow](../review.md) read-only and posts inline comments with a sticky summary. Reruns update the summary and never repeat a finding.
|
|
8
|
+
- A review request for the agent does the same.
|
|
9
|
+
- A mention (`@<app>` from a repository owner or member) answers from the diff and the repository, or makes the requested change on a branch and links the pull request.
|
|
10
|
+
|
|
11
|
+
## On Slack
|
|
12
|
+
|
|
13
|
+
- A mention or a direct message reads the thread and the linked repository, then answers, makes the change and links the pull request, or asks one clarifying question.
|
|
14
|
+
- Replies stay in the thread they were asked in, in Slack's style, with short paragraphs and code spans and no headings.
|
|
15
|
+
- When the workspace has connected GitHub from the [dashboard](../dash.md), it can read and change code there.
|
|
16
|
+
|
|
17
|
+
## What it runs with
|
|
18
|
+
|
|
19
|
+
| | |
|
|
20
|
+
| ----------- | ----------------------------------------------------------------- |
|
|
21
|
+
| Permissions | `workspace-write`; `read-only` for pull-request reviews |
|
|
22
|
+
| Tools | GitHub `write`, Slack `comment` |
|
|
23
|
+
| Flows | `review` |
|
|
24
|
+
| Engine | the workspace's default [credential](../self-host.md#credentials) |
|
|
25
|
+
|
|
26
|
+
The definition is `src/agent/builtin/coder/{agent.json,system.md}` in the package; a custom agent is the same two files in your repo ([Your own agents](index.md#your-own-agents)).
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Agents
|
|
2
|
+
|
|
3
|
+
An agent is a reusable teammate. Its `system.md` holds the standing instructions every task starts from: who it is, what it knows, how it answers. Its definition adds engine, model, effort and permissions defaults, the MCP servers it attaches and the [flows](../flows.md) it may run. Run it from the CLI with `coder task run --agent <id> "…"`, where flags override the defaults, from the [dashboard](../dash.md), or from platform events like a Slack DM or a GitHub pull request.
|
|
4
|
+
|
|
5
|
+
Connected to a platform, an agent listens for the events its triggers name. Each event runs as a task with a fresh checkout, the agent's instructions, the event as its request, and only the platform tools the agent declared; the reply goes back to the thread. A bigger task can run a flow instead, with the event as its `args`.
|
|
6
|
+
|
|
7
|
+
On each platform an agent is its own app, a GitHub App or a Slack app for example, so it has its own handle and permissions and runs only where it is installed. Agents run on a Coder server: the hosted one, [your own](../self-host.md), or this machine's [dashboard](../dash.md).
|
|
8
|
+
|
|
9
|
+
## Built-in agent
|
|
10
|
+
|
|
11
|
+
[`coder`](coder.md) answers engineering questions, reviews pull requests, and makes requested changes. It is on by default wherever its apps are installed; tune or disable it under `agents.coder` in `.coder/config.json` ([Usage](#usage)).
|
|
12
|
+
|
|
13
|
+
## Your own agents
|
|
14
|
+
|
|
15
|
+
An agent comes from one of two sources:
|
|
16
|
+
|
|
17
|
+
- **Dashboard**: made in the agent editor on the [dashboard](../dash.md).
|
|
18
|
+
- **Repository**: `coder agent init` scaffolds one, asking its id, platforms, triggers and tools. It is a folder `.coder/agents/<id>/` with an `agent.json` and a `system.md`. A folder in `$CODER_HOME/agents/<id>/` (default `~/.coder/agents`) is yours in every repo, and a repo's folder of the same id wins.
|
|
19
|
+
|
|
20
|
+
Here is a helper that answers in Slack and on GitHub issues:
|
|
21
|
+
|
|
22
|
+
`.coder/agents/helper/agent.json`
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"name": "Helper",
|
|
27
|
+
"description": "Answers engineering questions about acme/app.",
|
|
28
|
+
"permissions": "read-only",
|
|
29
|
+
"integrations": {
|
|
30
|
+
"slack": {
|
|
31
|
+
"triggers": { "mention": true, "message": { "match": "^help\\b" } },
|
|
32
|
+
"tools": "comment"
|
|
33
|
+
},
|
|
34
|
+
"github": { "triggers": ["mention"], "tools": "observe" }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`.coder/agents/helper/system.md`
|
|
40
|
+
|
|
41
|
+
```md
|
|
42
|
+
You answer questions about acme/app from its source. Cite file paths.
|
|
43
|
+
If asked to change code, describe the change and stop; never promise a PR.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
From there:
|
|
47
|
+
|
|
48
|
+
1. Get the agent to a server. A local server reads it from the repo on disk. A cloud server imports it from the dashboard and again on each push to the agents repo once the agent's GitHub App is installed there; `coder agent push` uploads it without a repo.
|
|
49
|
+
2. On the dashboard, the agent's Platforms tab creates its app on each platform it uses and installs it; the app's credentials go straight to the server.
|
|
50
|
+
3. Events now reach the server, a task runs on its runner, and the reply is posted back. `coder agent run helper <event.json> --server --wait` fires one by hand; without `--server` it runs offline, platform tools off, reply printed. `--server` means `CODER_SERVER`, else the hosted service; give it a URL to pick another.
|
|
51
|
+
|
|
52
|
+
Only pushes to the agents repo's configured branch are imported. An app created before push events existed needs the `push` event enabled once in its GitHub App settings.
|
|
53
|
+
|
|
54
|
+
### Definition
|
|
55
|
+
|
|
56
|
+
`agent.json`. The folder name is the id; the built-in id `coder` is reserved.
|
|
57
|
+
|
|
58
|
+
| Key | Values | Purpose |
|
|
59
|
+
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
60
|
+
| `name`, `description` | Text | App name and handle; the description is added to the prompt |
|
|
61
|
+
| `engine`, `model`, `effort` | As in `coder task run` | Engine defaults |
|
|
62
|
+
| `permissions` | `read-only` (default), `workspace-write`, `auto` | Agent sandbox mode inside the checkout |
|
|
63
|
+
| `integrations.<id>.triggers` | Event names from the [integration](#integrations): a list, or a map of event → `true`, a flow name (repo `.coder/flows` or built-in such as `review`), or `{ "flow", "match", "permissions", "actAs" }` | A list or `true` runs the agent, a flow name runs that flow, `match` is a regex the event text must pass, `permissions` overrides the agent's for this event, `"actAs": "requester"` uses the requester's own GitHub token |
|
|
64
|
+
| `integrations.<id>.tools` | `observe` (default), `comment`, `write`, or tool names from the [integration](#integrations) | Platform actions the agent uses; also the app's permissions |
|
|
65
|
+
| `mcp` | A map of MCP servers in the `.mcp.json` entry shape, as in `coder mcp` | Servers every task of the agent attaches |
|
|
66
|
+
|
|
67
|
+
`permissions` is about the checkout, `tools` is about the platform. An agent can run any [flow](../flows.md#flows-run-by-an-agent), and the tasks it starts never exceed the agent's `permissions`. The server versions imported definitions and activates a new version when their content changes; recreate the app only when `triggers` or `tools` change.
|
|
68
|
+
|
|
69
|
+
## Usage
|
|
70
|
+
|
|
71
|
+
How a repo runs an agent goes under `agents` in its `.coder/config.json` ([Configuration](../config.md)), one entry per agent id. No entry or `true` runs the agent as defined, `false` disables it, an object overrides it:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"agents": {
|
|
76
|
+
"coder": { "model": "sol" },
|
|
77
|
+
"helper": { "integrations": { "slack": { "allowedEvents": ["mention"] } } }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
| Key | Values | Purpose |
|
|
83
|
+
| ------------------------------------------ | ------------------- | ---------------------------------------------------------- |
|
|
84
|
+
| `engine`, `model`, `effort`, `permissions` | As above | Override the definition |
|
|
85
|
+
| `integrations.<id>.allowedTools` | Preset or tool list | Cap the definition's tools; omit to allow all it asks for |
|
|
86
|
+
| `integrations.<id>.allowedEvents` | Event names | Cap the definition's events; omit to allow all it asks for |
|
|
87
|
+
|
|
88
|
+
Unknown ids, integrations, events, tools, and keys fail validation. Usage is read from the repo the event came from.
|
|
89
|
+
|
|
90
|
+
## CLI
|
|
91
|
+
|
|
92
|
+
| Command | Purpose |
|
|
93
|
+
| ------------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
94
|
+
| `coder agent list [--server [url]]` | List agents, with active versions on a server |
|
|
95
|
+
| `coder agent show <id> [--server [url]]` | One agent in full: settings, integrations, triggers, tools |
|
|
96
|
+
| `coder agent init [id]` | Scaffold an agent folder; interactive without flags |
|
|
97
|
+
| `coder agent push [id] [--server [url]]` | Upload one agent, or all of them, without a source repo |
|
|
98
|
+
| `coder agent run <agent> <event.json> [--server [url] [--wait]]` | Run a recorded event through an agent, on a server or offline |
|
|
99
|
+
| `coder agent usage [--since 7d] [--by agent\|installation\|engine]` | Aggregate usage of this machine's tasks, or a server's with `--server` |
|
|
100
|
+
| `coder agent integrations <list\|show <id>>` | Integrations with their events and tool presets |
|
|
101
|
+
| `coder task run --agent <id> "…"` | Run an agent's definition locally; flags override it |
|
|
102
|
+
|
|
103
|
+
## Integrations
|
|
104
|
+
|
|
105
|
+
An integration gives an agent two things:
|
|
106
|
+
|
|
107
|
+
1. **Chat.** The agent's own app on the platform. Its events start tasks, and the reply goes back to the same thread. Only linked workspace members can address an agent.
|
|
108
|
+
2. **Platform tools.** Actions beyond replying, through the platform's own MCP server or API. They run outside the agent's sandbox, with a token narrowed to the task, and the token never reaches the agent. The presets add up: `comment` includes `observe`, and `write` includes `comment`.
|
|
109
|
+
|
|
110
|
+
| Platform | App | Events | Tools |
|
|
111
|
+
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
112
|
+
| GitHub | A [GitHub App](https://docs.github.com/en/apps/sharing-github-apps/registering-a-github-app-from-a-manifest) per agent | `mention`, `pull_request`, `issue`, `comment` | GitHub's [MCP server](https://github.com/github/github-mcp-server); `observe` runs it read-only |
|
|
113
|
+
| Slack | A [Slack app](https://api.slack.com/reference/manifests) per agent | `mention`, `message`, `reaction`, `command` | `slack_api(method, args)` over the [Web API](https://api.slack.com/methods), with writes limited to the event's thread |
|
|
114
|
+
| Microsoft Teams | An [Azure Bot](https://learn.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration) you create, with its endpoint at `<PUBLIC_URL>/hooks/teams?app=<app id>` | `mention`, `message`, `reaction` | None yet |
|
|
115
|
+
| Gmail | Your Google OAuth client plus a [Pub/Sub push](https://developers.google.com/workspace/gmail/api/guides/push) to `<PUBLIC_URL>/hooks/gmail?app=<client id>` | `mail`: only from linked senders whose domain passes DMARC | None yet |
|
|
116
|
+
| Linear | Your [Linear OAuth app](https://linear.app/developers/agents), with webhooks to `<PUBLIC_URL>/hooks/linear?app=<client id>` | `mention`: an agent session | None yet |
|
|
117
|
+
|
|
118
|
+
`coder agent integrations show <id>` lists each event and each preset's exact tools or scopes. A host turns platforms off with `SERVER_INTEGRATIONS` ([Self-hosting](../self-host.md)).
|
|
119
|
+
|
|
120
|
+
Need another integration or a missing event or tool? [Open an issue](https://github.com/muzam1l/coder/issues).
|