@wular/coder 0.3.18 → 0.4.0
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-69c965aae1737cef.js +1 -0
- package/dist/dash/public/assets/chunks/agent-settings-form-a1ce70812eea3f20.js +1 -0
- package/dist/dash/public/assets/chunks/agents-grid-f62180478e43c192.js +1 -0
- package/dist/dash/public/assets/chunks/badge-d07f35e9abc80e14.js +1 -0
- package/dist/dash/public/assets/chunks/card-be04148b64223a52.js +1 -0
- package/dist/dash/public/assets/chunks/combo-32c321a7a84fa902.js +1 -0
- package/dist/dash/public/assets/chunks/composer-aec9c3c691f1f79a.js +1 -0
- package/dist/dash/public/assets/chunks/composer-data-6f7608fed13f3dd7.js +1 -0
- package/dist/dash/public/assets/chunks/composer-e56860d72742379e.js +1 -0
- package/dist/dash/public/assets/chunks/confirm-b4e2c16aef4b3431.js +1 -0
- package/dist/dash/public/assets/chunks/connect-apps-a5a63941e287c33f.js +1 -0
- package/dist/dash/public/assets/chunks/connect-repositories-e4c049b5b4384623.js +1 -0
- package/dist/dash/public/assets/chunks/credentials-list-2b7d0c771b89f9c5.js +2 -0
- package/dist/dash/public/assets/chunks/custom-range-53b70e0d9eeae84e.js +1 -0
- package/dist/dash/public/assets/chunks/editor-691d2bcecb1ecb87.js +7 -0
- package/dist/dash/public/assets/chunks/engines-list-a5fe1671601ce3b0.js +1 -0
- package/dist/dash/public/assets/chunks/field-9e12e5fc8774b6e5.js +1 -0
- package/dist/dash/public/assets/chunks/format-eb03fc9d9744d960.js +1 -0
- package/dist/dash/public/assets/chunks/heads-4041a925d63ab116.js +1 -0
- package/dist/dash/public/assets/chunks/instructions-4e0d18b9b40edbd7.js +2 -0
- package/dist/dash/public/assets/chunks/instructions-b00959bd4bb70502.js +1 -0
- package/dist/dash/public/assets/chunks/list-d7eb9e02cf261fbe.js +1 -0
- package/dist/dash/public/assets/chunks/mcp-list-a450533109045ef5.js +1 -0
- package/dist/dash/public/assets/chunks/model-options-15c53331a2f28a4f.js +1 -0
- package/dist/dash/public/assets/chunks/models-list-1e273c6843858148.js +1 -0
- package/dist/dash/public/assets/chunks/paged-bc6fa0c2b9d52ed7.js +1 -0
- package/dist/dash/public/assets/chunks/platform-actions-87f3f76ec1b840cb.js +1 -0
- package/dist/dash/public/assets/chunks/runners-list-fc7cdae4fa93e78b.js +1 -0
- package/dist/dash/public/assets/chunks/runtime-246221e985d863e5-1.js +2 -0
- package/dist/dash/public/assets/chunks/segmented-6091dfb2f954799f.js +1 -0
- package/dist/dash/public/assets/chunks/select-dd09a6b9544cfde2.js +1 -0
- package/dist/dash/public/assets/chunks/sentinel-ff7143a47fd22835.js +1 -0
- package/dist/dash/public/assets/chunks/shared-init-246221e985d863e5-2.js +1 -0
- package/dist/dash/public/assets/chunks/shared-init-8f2ac936c95a7f7b.js +1 -0
- package/dist/dash/public/assets/chunks/shared-init-986901c810947c12.js +5 -0
- package/dist/dash/public/assets/chunks/shared-init-baceed9fd2d43661.js +2 -0
- package/dist/dash/public/assets/chunks/tail-5a5bfcd308535d70.js +1 -0
- package/dist/dash/public/assets/chunks/task-actions-7919ca0e901131f4.js +1 -0
- package/dist/dash/public/assets/chunks/task-fa8b82e95e771c4a.js +1 -0
- package/dist/dash/public/assets/chunks/task-view-e8a0f99c992fa11e.js +3 -0
- package/dist/dash/public/assets/chunks/tasks-list-7b72f5b295349532.js +1 -0
- package/dist/dash/public/assets/chunks/toolbar-9b18a5d26dee37c3.js +1 -0
- package/dist/dash/public/assets/chunks/versions-list-8cdf3a41c56b2152.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-073464b8f422ef57.js +1 -0
- package/dist/dash/public/assets/pnext-client-0b6720fdec66eeb0.js +1 -0
- package/dist/dash/public/assets/pnext-client-1e9cb2f4f6387a87.js +1 -0
- package/dist/dash/public/assets/pnext-client-2f0e78dd006fed0f.js +1 -0
- package/dist/dash/public/assets/pnext-client-3c62e2aa2cbe9fe1.js +1 -0
- package/dist/dash/public/assets/pnext-client-43a88896ed42dd39.js +1 -0
- package/dist/dash/public/assets/pnext-client-4cf2e27d0b9c0365.js +1 -0
- package/dist/dash/public/assets/pnext-client-587008fa987d3073.js +1 -0
- package/dist/dash/public/assets/pnext-client-676360cc86f31573.js +1 -0
- package/dist/dash/public/assets/pnext-client-813427605f424145.js +1 -0
- package/dist/dash/public/assets/pnext-client-82de7cf6dfc35b98.js +1 -0
- package/dist/dash/public/assets/pnext-client-831e8004c09f0b5b.js +1 -0
- package/dist/dash/public/assets/pnext-client-9b557fe468a45ca3.js +1 -0
- package/dist/dash/public/assets/pnext-client-ab7c900c802fe827.js +1 -0
- package/dist/dash/public/assets/pnext-client-d87d00e402811f0c.js +1 -0
- package/dist/dash/public/assets/pnext-client-fbdb7c1da7eda7e5.js +1 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/boot-B2MFTRO2.js +28 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/build-tier-XJJSL5FR.js +2702 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-2HFY3DQT.js +206 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-2ICEVELW.js +832 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-3UPROT2C.js +33 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-4P5CMIYT.js +1580 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-4TKZKZ3Q.js +129 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-5RDEILQB.js +435 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-62KEQM43.js +23 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-6KQSWT6D.js +829 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-7DCNCW6O.js +722 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-B4THCTQP.js +20 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-C2LIV2MM.js +170 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-CCATPVTW.js +376 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-COXJAPTU.js +87 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-E6IXL2NJ.js +6268 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-FLGRBFAH.js +1196 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-FTJVHFWD.js +59 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-H523KSIH.js +5149 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-HT6KKX6A.js +18 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-JESFYECC.js +436 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-JRPJM2XY.js +15 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-L2IWDUXG.js +105 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-L5P4Y4UC.js +181 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-NQE46AZN.js +645 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-PA4QEARJ.js +127 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-PZ5AXOLW.js +7144 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-SNVPTULL.js +2395 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-T3QZT3PG.js +218 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-VC5O2SDP.js +70 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-WZX4V6CM.js +229 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-XUUIDXY5.js +625 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/chunk-ZHFDO3PR.js +263 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/compile-CE2DN7ZA.js +16 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/config-UREY7XJT.js +14 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/config-loader-UI2XE3PZ.js +15 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/entry.js +217 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/generate-I2PPTDFD.js +14 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/modules-UVOCE4C2.js +46 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/pipeline-UW47K537.js +961 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/proxy-ITGOVJBW.js +24 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/register-4SA55SWT.js +12577 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/router-JNKHLBCZ.js +503 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/routes-PD6J2NXW.js +52 -0
- package/dist/dash/server/bundle-0.1.5-1508b6c99c0d1e68/tsconfig-defaults-ZXEH7RQK.js +13 -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-DT7EST00.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-Dve7Z0ZP.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,24 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DT7IzrpZ.js";import{a as t,i as n,n as r,o as i}from"./local-H3uvqEbq.js";var a=e({ACTIONS_WORKFLOW_YAML:()=>o,GithubActionsRunner:()=>c});const o=`name: Coder agent
|
|
2
|
+
run-name: Coder agent \${{ inputs.task }}
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
task: { required: true, type: string }
|
|
7
|
+
server: { required: true, type: string }
|
|
8
|
+
token: { required: true, type: string }
|
|
9
|
+
mode: { required: true, type: string }
|
|
10
|
+
jobs:
|
|
11
|
+
run:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/setup-node@v4
|
|
15
|
+
with: { node-version: 22 }
|
|
16
|
+
- run: npm i -g @wular/coder @anthropic-ai/claude-code @openai/codex
|
|
17
|
+
${n().map(e=>` - run: sudo sh -c '${e}'\n`).join(``)} - run: coder agent run --task "$TASK"
|
|
18
|
+
env:
|
|
19
|
+
TASK: \${{ inputs.task }}
|
|
20
|
+
CODER_SERVER: \${{ inputs.server }}
|
|
21
|
+
CODER_TASK_TOKEN: \${{ inputs.token }}
|
|
22
|
+
CODER_INBOX_MODE: \${{ inputs.mode }}
|
|
23
|
+
`,s=e=>t(e);var c=class{options;kind=`github-actions`;fetcher;constructor(e={}){this.options=e,this.fetcher=e.fetch??fetch}async request(e,t={},n=1e4){if(!this.options.token)throw Error(`RUNNER_CONFIG.token is required for github-actions`);let r=AbortSignal.timeout(n);for(let n=0;;n++){let i=await this.fetcher(`https://api.github.com${e}`,{...t,signal:r,redirect:`manual`,headers:{accept:`application/vnd.github+json`,authorization:`Bearer ${this.options.token}`,"content-type":`application/json`,"user-agent":`coder`,"x-github-api-version":`2022-11-28`,...t.headers}});if((t.method??`GET`)!==`GET`||n===2||i.status!==429&&i.status<500)return i;let a=Number(i.headers.get(`retry-after`));await i.body?.cancel(),await new Promise((e,t)=>{let i=()=>{clearTimeout(s),r.removeEventListener(`abort`,o)},o=()=>{i(),t(r.reason)},s=setTimeout(()=>{i(),e()},Number.isFinite(a)&&a>0?a*1e3:100*2**n);r.addEventListener(`abort`,o,{once:!0}),r.aborted&&o()})}}async start(e,t){let n=this.options.repo??(e.event?.repo&&`${e.event.repo.owner}/${e.event.repo.name}`);if(!n)throw Error(`The github-actions runner requires a repository`);let r=Date.now()+(this.options.lookupTimeoutMs??25e3),a=encodeURIComponent(this.options.workflow??`coder-agent.yml`),o=e.event?.repo,s=this.options.ref??(o&&`${o.owner}/${o.name}`===n?o.defaultBranch:void 0);if(!s){let e=await this.request(`/repos/${n}`,{},Math.max(1,r-Date.now()));if(!e.ok)throw Error(`GitHub repository lookup failed: ${e.status}`);let t=await e.json();if(!t.default_branch)throw Error(`GitHub repository has no default branch`);s=t.default_branch}let c=`/repos/${n}/actions/workflows/${a}/runs?event=workflow_dispatch&per_page=100&branch=${encodeURIComponent(s)}`,l=await this.request(c,{},Math.max(1,r-Date.now()));if(!l.ok)throw Error(`GitHub workflow run lookup failed: ${l.status}`);let u=await l.json(),d=Math.max(0,...u.workflow_runs.map(e=>e.id)),f=await this.request(`/repos/${n}/actions/workflows/${a}/dispatches`,{method:`POST`,body:JSON.stringify({ref:s,inputs:{task:e.id,server:t.CODER_SERVER,token:t.CODER_TASK_TOKEN,mode:t.CODER_INBOX_MODE}})},Math.max(1,r-Date.now()));if(f.status!==204)throw Error(`GitHub workflow dispatch failed: ${f.status}`);do{for(let t=1;Date.now()<r;t++){let a=await this.request(`${c}&page=${t}`,{},Math.max(1,r-Date.now()));if(!a.ok)throw Error(`GitHub workflow run lookup failed: ${a.status}`);let o=(await a.json()).workflow_runs.find(t=>t.id>d&&t.display_title===`Coder agent ${e.id}`);if(o)return i({repo:n,run:o.id});if(!a.headers.get(`link`)?.includes(`rel="next"`))break}await new Promise(e=>setTimeout(e,Math.min(this.options.pollIntervalMs??1e3,Math.max(0,r-Date.now()))))}while(Date.now()<r);throw Error(`GitHub workflow run for task ${e.id} was not found before timeout`)}async status(e){let{repo:t,run:n}=s(e),r=await this.request(`/repos/${t}/actions/runs/${n}`);if(r.status===404)return{state:`exited`,code:1};if(!r.ok)throw Error(`GitHub workflow status failed: ${r.status}`);let i=await r.json();return i.status===`completed`?{state:`exited`,code:i.conclusion===`success`?0:1}:{state:`running`}}async logs(e,t=-1){let{repo:n,run:i}=s(e),a=[];for(let e=1;;e++){let t=await this.request(`/repos/${n}/actions/runs/${i}/jobs?per_page=100&page=${e}`);if(!t.ok)throw Error(`GitHub workflow jobs failed: ${t.status}`);let r=await t.json();if(a.push(...r.jobs),!t.headers.get(`link`)?.includes(`rel="next"`))break}let o=[];for(let e of a.sort((e,t)=>e.id-t.id)){let r=await this.request(`/repos/${n}/actions/jobs/${e.id}/logs`);if(r.status===404)return{lines:[],next:t};if(r.status===302&&r.headers.get(`location`)){let e=await this.fetcher(r.headers.get(`location`),{redirect:`manual`,signal:AbortSignal.timeout(1e4)});if(!e.ok)throw Error(`GitHub job log download failed: ${e.status}`);o.push(await e.text())}else if(r.ok)o.push(await r.text());else throw Error(`GitHub job logs failed: ${r.status}`)}let c=r(o.join(`
|
|
24
|
+
`));return{lines:c.slice(t+1),next:Math.max(t,c.length-1)}}async stop(e){let{repo:t,run:n}=s(e),r=await this.request(`/repos/${t}/actions/runs/${n}/cancel`,{method:`POST`});if(r.status!==202&&r.status!==409)throw Error(`GitHub workflow cancellation failed: ${r.status}`)}};export{c as n,a as r,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,o as t}from"./local-H3uvqEbq.js";import{Readable as n}from"node:stream";import{pipeline as r}from"node:stream/promises";function i(e,t=200,n={}){return new Response(JSON.stringify(e),{status:t,headers:{"content-type":`application/json`,...n}})}const a=e=>e.searchParams.has(`cursor`);function o(t){if(t)try{return e(t)}catch{return}}const s=e=>o(e.searchParams.get(`cursor`));function c(e,t=50,n=200){let r=Number(e.searchParams.get(`limit`)??t);return Number.isInteger(r)&&r>0?Math.min(r,n):t}function l(e,n,r){let i=e.slice(0,n);return{items:i,...e.length>n?{next:t(r(i.at(-1)))}:{}}}const u=(e,t=302)=>new Response(null,{status:t,headers:{location:e}}),d=()=>new Response(`Forbidden`,{status:403}),f=()=>new Response(`Not found`,{status:404}),p=()=>new Response(`Method not allowed`,{status:405}),m=e=>u(`/login?return=${encodeURIComponent(`${e.pathname}${e.search}`)}`),h=e=>e.startsWith(`/api/auth`)?65536:1048576;async function g(e,t,n){let r=Number(t??0);if(Number.isFinite(r)&&r>n)throw Object.assign(Error(`Payload too large`),{status:413});let i=[],a=0;for await(let t of e){if(a+=t.byteLength,a>n)throw Object.assign(Error(`Payload too large`),{status:413});i.push(t)}let o=new Uint8Array(a),s=0;for(let e of i)o.set(e,s),s+=e.byteLength;return o}function _(e){let t=new Headers;for(let[n,r]of Object.entries(e))r!==void 0&&t.set(n,Array.isArray(r)?r.join(`, `):r);return t}async function v(e,t){let n=e.url??`/`,r=await g(e,e.headers[`content-length`],t);return new Request(`http://${e.headers.host??`localhost`}${n}`,{method:e.method,headers:_(e.headers),body:r.byteLength?Buffer.from(r):void 0})}function y(e,{limit:t,admit:i=()=>!0}){return async(a,o)=>{if(!i(a))return void o.writeHead(404).end(`Not found`);try{let i=await e(await v(a,t(a.url??`/`)),a.socket.remoteAddress?.replace(/^::ffff:/,``)),s=Object.fromEntries(i.headers.entries()),c=i.headers.getSetCookie();c.length&&(s[`set-cookie`]=c),o.writeHead(i.status,s),i.body?await r(n.fromWeb(i.body),o).catch(()=>{}):o.end()}catch(e){if(o.headersSent)return void o.destroy();let t=typeof e==`object`&&e&&`status`in e;t||console.error(`coder server: request failed`,e);let n=t?e instanceof Error?e.message:String(e):`Internal server error`;o.writeHead(t?Number(e.status):500,{"content-type":`application/json`}),o.end(JSON.stringify({error:n}))}}}async function b(e,t){if(e.method===`GET`||e.method===`HEAD`||!e.body)return e;try{let n=await g(e.body,e.headers.get(`content-length`)??void 0,t);return new Request(e.url,{method:e.method,headers:e.headers,body:n.byteLength?Buffer.from(n):void 0,signal:e.signal})}catch(e){if(e.status===413)return new Response(`Payload too large`,{status:413});throw e}}export{i as a,p as c,c as d,a as f,d as i,f as l,m,s as n,b as o,u as p,o as r,y as s,h as t,l as u};
|
|
@@ -1,196 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Strict schema for a config object (a file's contents or the merged result).
|
|
5
|
-
* Unknown keys and out-of-range values are errors, not warnings. These schemas
|
|
6
|
-
* are the source of truth for the config domain types (types.ts re-exports the
|
|
7
|
-
* z.infer'd types).
|
|
8
|
-
*/
|
|
9
|
-
declare const engineSchema: z.ZodMiniEnum<{
|
|
10
|
-
codex: "codex";
|
|
11
|
-
claude: "claude";
|
|
12
|
-
}>;
|
|
13
|
-
declare const agentSchema: z.ZodMiniEnum<{
|
|
14
|
-
codex: "codex";
|
|
15
|
-
claude: "claude";
|
|
16
|
-
custom: "custom";
|
|
17
|
-
}>;
|
|
18
|
-
declare const effortSchema: z.ZodMiniEnum<{
|
|
19
|
-
low: "low";
|
|
20
|
-
medium: "medium";
|
|
21
|
-
high: "high";
|
|
22
|
-
}>;
|
|
23
|
-
declare const permissionSchema: z.ZodMiniEnum<{
|
|
24
|
-
"read-only": "read-only";
|
|
25
|
-
"workspace-write": "workspace-write";
|
|
26
|
-
auto: "auto";
|
|
27
|
-
}>;
|
|
28
|
-
declare const customModelSchema: z.ZodMiniObject<{
|
|
29
|
-
baseUrl: z.ZodMiniURL;
|
|
30
|
-
model: z.ZodMiniString<string>;
|
|
31
|
-
envKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
32
|
-
wireApi: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
33
|
-
chat: "chat";
|
|
34
|
-
responses: "responses";
|
|
35
|
-
}>>;
|
|
36
|
-
disabled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
37
|
-
}, z.core.$strict>;
|
|
38
|
-
/** The merged, effective shape (everything present after DEFAULT_CONFIG). */
|
|
39
|
-
declare const effectiveConfigSchema: z.ZodMiniObject<{
|
|
40
|
-
chain: z.ZodMiniArray<z.ZodMiniEnum<{
|
|
41
|
-
codex: "codex";
|
|
42
|
-
claude: "claude";
|
|
43
|
-
custom: "custom";
|
|
44
|
-
}>>;
|
|
45
|
-
agents: z.ZodMiniObject<{
|
|
46
|
-
codex: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
47
|
-
model: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
48
|
-
effort: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
49
|
-
low: "low";
|
|
50
|
-
medium: "medium";
|
|
51
|
-
high: "high";
|
|
52
|
-
}>>;
|
|
53
|
-
permissions: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
54
|
-
"read-only": "read-only";
|
|
55
|
-
"workspace-write": "workspace-write";
|
|
56
|
-
auto: "auto";
|
|
57
|
-
}>>;
|
|
58
|
-
}, z.core.$strict>>;
|
|
59
|
-
claude: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
60
|
-
model: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
61
|
-
effort: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
62
|
-
low: "low";
|
|
63
|
-
medium: "medium";
|
|
64
|
-
high: "high";
|
|
65
|
-
}>>;
|
|
66
|
-
permissions: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
67
|
-
"read-only": "read-only";
|
|
68
|
-
"workspace-write": "workspace-write";
|
|
69
|
-
auto: "auto";
|
|
70
|
-
}>>;
|
|
71
|
-
}, z.core.$strict>>;
|
|
72
|
-
custom: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
73
|
-
model: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
74
|
-
effort: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
75
|
-
low: "low";
|
|
76
|
-
medium: "medium";
|
|
77
|
-
high: "high";
|
|
78
|
-
}>>;
|
|
79
|
-
permissions: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
80
|
-
"read-only": "read-only";
|
|
81
|
-
"workspace-write": "workspace-write";
|
|
82
|
-
auto: "auto";
|
|
83
|
-
}>>;
|
|
84
|
-
}, z.core.$strict>>;
|
|
85
|
-
}, z.core.$strict>;
|
|
86
|
-
models: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
87
|
-
baseUrl: z.ZodMiniURL;
|
|
88
|
-
model: z.ZodMiniString<string>;
|
|
89
|
-
envKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
90
|
-
wireApi: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
91
|
-
chat: "chat";
|
|
92
|
-
responses: "responses";
|
|
93
|
-
}>>;
|
|
94
|
-
disabled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
95
|
-
}, z.core.$strict>, z.ZodMiniObject<{
|
|
96
|
-
provider: z.ZodMiniEnum<{
|
|
97
|
-
codex: "codex";
|
|
98
|
-
claude: "claude";
|
|
99
|
-
}>;
|
|
100
|
-
model: z.ZodMiniString<string>;
|
|
101
|
-
effort: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
102
|
-
low: "low";
|
|
103
|
-
medium: "medium";
|
|
104
|
-
high: "high";
|
|
105
|
-
}>>;
|
|
106
|
-
disabled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
107
|
-
}, z.core.$strict>, z.ZodMiniObject<{
|
|
108
|
-
disabled: z.ZodMiniBoolean<boolean>;
|
|
109
|
-
}, z.core.$strict>]>>>;
|
|
110
|
-
approvals: z.ZodMiniObject<{
|
|
111
|
-
escalationTimeoutMs: z.ZodMiniNumber<number>;
|
|
112
|
-
allowedNetworkHosts: z.ZodMiniArray<z.ZodMiniString<string>>;
|
|
113
|
-
}, z.core.$strict>;
|
|
114
|
-
}, z.core.$strict>;
|
|
115
|
-
type Engine = z.infer<typeof engineSchema>;
|
|
116
|
-
type Agent = z.infer<typeof agentSchema>;
|
|
117
|
-
type Effort = z.infer<typeof effortSchema>;
|
|
118
|
-
type Permission = z.infer<typeof permissionSchema>;
|
|
119
|
-
type CustomModelConfig = z.infer<typeof customModelSchema>;
|
|
120
|
-
type CoderConfig = z.infer<typeof effectiveConfigSchema>;
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region src/lib/types.d.ts
|
|
123
|
-
type JobKind = 'task';
|
|
124
|
-
type JobStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
125
|
-
/** A persisted job record (job.json). Most fields accrete over the lifecycle. */
|
|
126
|
-
interface Job {
|
|
127
|
-
id: string;
|
|
128
|
-
createdAt: string;
|
|
129
|
-
updatedAt?: string;
|
|
130
|
-
status: JobStatus;
|
|
131
|
-
kind?: JobKind;
|
|
132
|
-
name?: string | null;
|
|
133
|
-
agent?: Agent;
|
|
134
|
-
engine?: Engine;
|
|
135
|
-
prompt?: string;
|
|
136
|
-
currentPrompt?: string | null;
|
|
137
|
-
system?: string | null;
|
|
138
|
-
model?: string | null;
|
|
139
|
-
effort?: Effort | null;
|
|
140
|
-
permissions?: Permission;
|
|
141
|
-
resumeThreadId?: string | null;
|
|
142
|
-
cwd?: string;
|
|
143
|
-
background?: boolean;
|
|
144
|
-
pid?: number | null;
|
|
145
|
-
threadId?: string | null;
|
|
146
|
-
turnId?: string | null;
|
|
147
|
-
steerEndpoint?: string | null;
|
|
148
|
-
completedAt?: string;
|
|
149
|
-
resumedAt?: string;
|
|
150
|
-
error?: string;
|
|
151
|
-
archived?: boolean;
|
|
152
|
-
archivedAt?: string;
|
|
153
|
-
simulateApproval?: boolean;
|
|
154
|
-
flowRunId?: string;
|
|
155
|
-
}
|
|
156
|
-
/** Normalized token usage for one turn, summed across the engine's threads. */
|
|
157
|
-
interface TokenUsage {
|
|
158
|
-
input: number;
|
|
159
|
-
cachedInput: number;
|
|
160
|
-
output: number;
|
|
161
|
-
total: number;
|
|
162
|
-
}
|
|
163
|
-
/** The outcome of running one engine turn. status 0 == success. */
|
|
164
|
-
interface TurnResult {
|
|
165
|
-
status: number;
|
|
166
|
-
threadId: string | null;
|
|
167
|
-
turnId?: string | null;
|
|
168
|
-
finalMessage?: string;
|
|
169
|
-
touchedFiles?: string[];
|
|
170
|
-
tokens?: TokenUsage | null;
|
|
171
|
-
/** The model that ran the turn (tokens are only comparable per model). */
|
|
172
|
-
model?: string | null;
|
|
173
|
-
error?: {
|
|
174
|
-
message?: string;
|
|
175
|
-
} | null;
|
|
176
|
-
[key: string]: unknown;
|
|
177
|
-
}
|
|
178
|
-
/** Whether an engine binary is installed and usable. */
|
|
179
|
-
interface Availability {
|
|
180
|
-
available: boolean;
|
|
181
|
-
detail: string;
|
|
182
|
-
}
|
|
183
|
-
/** A persisted approval escalation and its answer, if any. */
|
|
184
|
-
interface Approval {
|
|
185
|
-
id: string;
|
|
186
|
-
summary: string;
|
|
187
|
-
createdAt?: string;
|
|
188
|
-
response?: {
|
|
189
|
-
decision: string;
|
|
190
|
-
} | null;
|
|
191
|
-
[key: string]: unknown;
|
|
192
|
-
}
|
|
193
|
-
//#endregion
|
|
1
|
+
import { c as TurnResult, l as TaskLogEntry, o as Task, s as TaskStatus, u as TokenUsage } from "./types-Dve7Z0ZP.js";
|
|
2
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
194
3
|
//#region src/flow/types.d.ts
|
|
195
4
|
/** Anything with zod's parse shape; the flow runtime never imports zod itself. */
|
|
196
5
|
interface FlowSchema<T> {
|
|
@@ -211,7 +20,7 @@ interface GateResult {
|
|
|
211
20
|
}
|
|
212
21
|
/** Options shared with `coder run`, plus `returns`. */
|
|
213
22
|
interface FlowTaskOptions<T = unknown> {
|
|
214
|
-
|
|
23
|
+
engine?: string;
|
|
215
24
|
model?: string;
|
|
216
25
|
effort?: string;
|
|
217
26
|
permissions?: string;
|
|
@@ -219,6 +28,7 @@ interface FlowTaskOptions<T = unknown> {
|
|
|
219
28
|
system?: string;
|
|
220
29
|
resume?: string;
|
|
221
30
|
cwd?: string;
|
|
31
|
+
addDirs?: string[];
|
|
222
32
|
returns?: FlowSchema<T>;
|
|
223
33
|
}
|
|
224
34
|
type FlowRunStatus = 'queued' | 'running' | 'completed' | 'failed' | 'stopped';
|
|
@@ -232,7 +42,7 @@ type FlowEvent = {
|
|
|
232
42
|
taskId: string;
|
|
233
43
|
name?: string;
|
|
234
44
|
prompt: string;
|
|
235
|
-
|
|
45
|
+
engine?: string;
|
|
236
46
|
depth?: number;
|
|
237
47
|
} | {
|
|
238
48
|
kind: 'task-end';
|
|
@@ -263,6 +73,16 @@ type FlowEvent = {
|
|
|
263
73
|
kind: 'replay';
|
|
264
74
|
count: number;
|
|
265
75
|
};
|
|
76
|
+
interface JournalEntry {
|
|
77
|
+
seq: number;
|
|
78
|
+
kind: 'task' | 'gate' | 'flow';
|
|
79
|
+
fingerprint: string;
|
|
80
|
+
result: unknown;
|
|
81
|
+
taskId?: string;
|
|
82
|
+
tokens?: TokenUsage | null;
|
|
83
|
+
startedAt: string;
|
|
84
|
+
endedAt: string;
|
|
85
|
+
}
|
|
266
86
|
/** flow.json: the persisted run record. */
|
|
267
87
|
interface FlowRecord {
|
|
268
88
|
runId: string;
|
|
@@ -295,7 +115,8 @@ interface FlowStep {
|
|
|
295
115
|
interface DiscoveredFlow {
|
|
296
116
|
name: string;
|
|
297
117
|
path: string;
|
|
298
|
-
|
|
118
|
+
/** `builtin` flows ship with coder; their `path` is `builtin:<name>`. */
|
|
119
|
+
scope: 'workspace' | 'global' | 'builtin';
|
|
299
120
|
}
|
|
300
121
|
//#endregion
|
|
301
122
|
//#region src/flow/runtime.d.ts
|
|
@@ -312,7 +133,7 @@ declare function task<T>(prompt: string, opts: FlowTaskOptions<T> & {
|
|
|
312
133
|
/** Dispatch one coder task and await its result. Mirrors `coder run`. */
|
|
313
134
|
declare function task(prompt: string, opts?: FlowTaskOptions): Promise<FlowTaskResult>;
|
|
314
135
|
/**
|
|
315
|
-
* Run a shell command as a checkpoint. Never throws
|
|
136
|
+
* Run a shell command as a checkpoint. Never throws. Inspect `ok`/`code`.
|
|
316
137
|
* output is captured (capped) and journaled for resume.
|
|
317
138
|
*/
|
|
318
139
|
declare function gate(cmd: string, opts?: {
|
|
@@ -334,15 +155,25 @@ declare function pipeline<T>(items: T[], ...stages: Stage[]): Promise<any[]>;
|
|
|
334
155
|
declare function log(msg: string): void;
|
|
335
156
|
/**
|
|
336
157
|
* Run another flow inline as a sub-step and return its result. Nesting is one
|
|
337
|
-
* level deep
|
|
158
|
+
* level deep. A subflow cannot call `flow()` itself.
|
|
338
159
|
*/
|
|
339
160
|
declare function flow(name: string, args?: unknown): Promise<unknown>;
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/flow/executor.d.ts
|
|
340
163
|
interface RunOptions {
|
|
164
|
+
runId?: string;
|
|
341
165
|
args?: unknown;
|
|
342
166
|
concurrency?: number;
|
|
343
167
|
maxTasks?: number;
|
|
344
168
|
dryRun?: boolean;
|
|
345
169
|
cwd?: string;
|
|
170
|
+
/** Platform credential for built-in integrations; never persisted with the run. */
|
|
171
|
+
integrationToken?: string;
|
|
172
|
+
/** The agent whose permissions cap every task this run starts. */
|
|
173
|
+
ceiling?: {
|
|
174
|
+
agent: string;
|
|
175
|
+
permissions: string;
|
|
176
|
+
};
|
|
346
177
|
}
|
|
347
178
|
interface RunSummary {
|
|
348
179
|
runId: string;
|
|
@@ -359,22 +190,51 @@ interface StopSummary {
|
|
|
359
190
|
keptTasks: string[];
|
|
360
191
|
}
|
|
361
192
|
//#endregion
|
|
362
|
-
//#region src/
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
kind
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
193
|
+
//#region src/flow/runs.d.ts
|
|
194
|
+
/** A run's record with its step rows, trimmed journal and recorded events. */
|
|
195
|
+
type RunResult = FlowRecord & {
|
|
196
|
+
steps: FlowStep[];
|
|
197
|
+
journal: Array<Pick<JournalEntry, 'kind' | 'taskId' | 'tokens'>>;
|
|
198
|
+
events: FlowEvent[];
|
|
199
|
+
};
|
|
200
|
+
type Archived = {
|
|
201
|
+
runId: string;
|
|
202
|
+
archived: true;
|
|
203
|
+
};
|
|
204
|
+
type ArchivedAll = {
|
|
205
|
+
archived: string[];
|
|
206
|
+
count: number;
|
|
207
|
+
};
|
|
208
|
+
/** Archive one stopped run, or with `allStopped` every one. */
|
|
209
|
+
declare function archiveRuns(runId: string, opts?: {
|
|
210
|
+
allStopped?: false;
|
|
211
|
+
}): Archived;
|
|
212
|
+
declare function archiveRuns(runId: string | undefined, opts: {
|
|
213
|
+
allStopped: true;
|
|
214
|
+
}): ArchivedAll;
|
|
215
|
+
declare function archiveRuns(runId?: string, opts?: {
|
|
216
|
+
allStopped?: boolean;
|
|
217
|
+
}): Archived | ArchivedAll;
|
|
218
|
+
type Deleted = {
|
|
219
|
+
runId: string;
|
|
220
|
+
deleted: boolean;
|
|
221
|
+
};
|
|
222
|
+
type DeletedAll = {
|
|
223
|
+
deleted: string[];
|
|
224
|
+
count: number;
|
|
225
|
+
};
|
|
226
|
+
/** Delete one stopped run's record (its tasks are left alone), or with `allArchived` every archived one. */
|
|
227
|
+
declare function deleteRuns(runId: string, opts?: {
|
|
228
|
+
allArchived?: false;
|
|
229
|
+
}): Deleted;
|
|
230
|
+
declare function deleteRuns(runId: string | undefined, opts: {
|
|
231
|
+
allArchived: true;
|
|
232
|
+
}): DeletedAll;
|
|
233
|
+
declare function deleteRuns(runId?: string, opts?: {
|
|
234
|
+
allArchived?: boolean;
|
|
235
|
+
}): Deleted | DeletedAll;
|
|
376
236
|
//#endregion
|
|
377
|
-
//#region src/
|
|
237
|
+
//#region src/core/errors.d.ts
|
|
378
238
|
/** The run-native-subagent fallback payload the CLI prints on exit 3. */
|
|
379
239
|
interface FallbackPayload {
|
|
380
240
|
error: string;
|
|
@@ -382,17 +242,18 @@ interface FallbackPayload {
|
|
|
382
242
|
action: 'run-native-subagent';
|
|
383
243
|
reason: 'no-engine-available';
|
|
384
244
|
permissions: string;
|
|
245
|
+
instructions: string;
|
|
385
246
|
note: string;
|
|
386
247
|
system?: string;
|
|
387
248
|
task: string;
|
|
388
249
|
};
|
|
389
250
|
}
|
|
390
|
-
/**
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
*/
|
|
395
|
-
|
|
251
|
+
/** Recoverable errors with CLI exit codes. */
|
|
252
|
+
type CoderErrorCode = 'nested-dispatch' | 'invalid-option' | 'read-only-unavailable' | 'startup-failed' | 'chain-exhausted' | 'approval-pending' | 'task-failed' | 'flow-failed' |
|
|
253
|
+
/** A Coder server refused or failed a request; `status` carries the HTTP status. */
|
|
254
|
+
'server' |
|
|
255
|
+
/** Sign-in to a server did not complete. */
|
|
256
|
+
'login-failed';
|
|
396
257
|
declare class CoderError extends Error {
|
|
397
258
|
code: CoderErrorCode;
|
|
398
259
|
hint?: string | string[];
|
|
@@ -403,11 +264,15 @@ declare class CoderError extends Error {
|
|
|
403
264
|
approval?: {
|
|
404
265
|
id: string;
|
|
405
266
|
summary: string;
|
|
267
|
+
cwd?: string | null;
|
|
268
|
+
networkHost?: string | null;
|
|
406
269
|
};
|
|
407
270
|
/** task-failed (flow task()): the failed task's result. */
|
|
408
271
|
result?: unknown;
|
|
409
272
|
/** flow-failed: the run to resume. */
|
|
410
273
|
runId?: string;
|
|
274
|
+
/** server: the HTTP status the server answered with. */
|
|
275
|
+
status?: number;
|
|
411
276
|
constructor(code: CoderErrorCode, message: string, extra?: {
|
|
412
277
|
hint?: string | string[];
|
|
413
278
|
taskId?: string;
|
|
@@ -415,21 +280,42 @@ declare class CoderError extends Error {
|
|
|
415
280
|
approval?: {
|
|
416
281
|
id: string;
|
|
417
282
|
summary: string;
|
|
283
|
+
cwd?: string | null;
|
|
284
|
+
networkHost?: string | null;
|
|
418
285
|
};
|
|
419
286
|
result?: unknown;
|
|
420
287
|
runId?: string;
|
|
288
|
+
status?: number;
|
|
421
289
|
});
|
|
422
290
|
}
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region src/core/state.d.ts
|
|
293
|
+
interface TurnResultEntry {
|
|
294
|
+
at?: string;
|
|
295
|
+
prompt?: string | null;
|
|
296
|
+
finalMessage?: string;
|
|
297
|
+
status?: number;
|
|
298
|
+
tokens?: TurnResult['tokens'];
|
|
299
|
+
model?: TurnResult['model'];
|
|
300
|
+
[key: string]: unknown;
|
|
301
|
+
}
|
|
302
|
+
declare function readTurnResults(cwd: string, taskId: string): TurnResultEntry[];
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region src/core/dispatch.d.ts
|
|
423
305
|
interface TaskResult {
|
|
424
306
|
taskId: string;
|
|
425
|
-
status:
|
|
307
|
+
status: TaskStatus;
|
|
426
308
|
result: TurnResult | null;
|
|
427
309
|
/** The last `tail` progress-log entries; [] at the default tail of 0. */
|
|
428
|
-
steps:
|
|
310
|
+
steps: TaskLogEntry[];
|
|
429
311
|
/** One entry per finished turn (a steered task accretes turns). */
|
|
430
312
|
turns: TurnResultEntry[];
|
|
431
|
-
|
|
313
|
+
task: Task;
|
|
432
314
|
}
|
|
315
|
+
/** Read a task's current state and result.json without waiting. `tail` fills `steps`. */
|
|
316
|
+
declare function readTask(cwd: string, taskId: string, opts?: {
|
|
317
|
+
tail?: number | 'all';
|
|
318
|
+
}): TaskResult;
|
|
433
319
|
//#endregion
|
|
434
320
|
//#region src/flow/index.d.ts
|
|
435
321
|
/**
|
|
@@ -444,16 +330,14 @@ declare const flowSdk: {
|
|
|
444
330
|
/** Recent flow runs (mirrors `coder flow list`). */
|
|
445
331
|
list(opts?: {
|
|
446
332
|
archived?: boolean;
|
|
447
|
-
limit?: number;
|
|
333
|
+
limit?: number | "all";
|
|
448
334
|
}): FlowRecord[];
|
|
449
335
|
/** Flows discoverable from a directory (workspace + global). */
|
|
450
336
|
discover(cwd?: string): DiscoveredFlow[];
|
|
451
|
-
/** A run's record
|
|
337
|
+
/** A run's record with its step rows, journal and events (omit the id for the most recent run). `tail` caps steps (default 'all'; 0 → []). */
|
|
452
338
|
result(runId?: string, opts?: {
|
|
453
339
|
tail?: number | "all";
|
|
454
|
-
}):
|
|
455
|
-
steps: FlowStep[];
|
|
456
|
-
}) | null;
|
|
340
|
+
}): RunResult | null;
|
|
457
341
|
/** Follow a run live: an async iterable of flow events, ending when the run is terminal. `tail` replays only the last n (default 'all'). */
|
|
458
342
|
stream(runId?: string, opts?: {
|
|
459
343
|
tail?: number | "all";
|
|
@@ -464,16 +348,10 @@ declare const flowSdk: {
|
|
|
464
348
|
}): Promise<StopSummary>;
|
|
465
349
|
/** Continue a stopped or edited run from its journal and await the result. */
|
|
466
350
|
resume(runId?: string, opts?: RunOptions): Promise<RunSummary>;
|
|
467
|
-
/** Archive a run (hide it from the default list). A running run must be stopped first. */
|
|
468
|
-
archive
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
};
|
|
472
|
-
/** Delete a run's record from disk (its tasks are left alone). A running run must be stopped first. */
|
|
473
|
-
delete(runId: string): {
|
|
474
|
-
runId: string;
|
|
475
|
-
deleted: boolean;
|
|
476
|
-
};
|
|
351
|
+
/** Archive a run (hide it from the default list), or with `allStopped` every stopped one. A running run must be stopped first. */
|
|
352
|
+
archive: typeof archiveRuns;
|
|
353
|
+
/** Delete a run's record from disk (its tasks are left alone), or with `allArchived` every archived one. A running run must be stopped first. */
|
|
354
|
+
delete: typeof deleteRuns;
|
|
477
355
|
};
|
|
478
356
|
//#endregion
|
|
479
|
-
export {
|
|
357
|
+
export { FlowTaskResult as C, FlowTaskOptions as S, task as _, readTurnResults as a, FlowRecord as b, archiveRuns as c, RunSummary as d, StopSummary as f, pipeline as g, log as h, readTask as i, deleteRuns as l, gate as m, flowSdk as n, CoderError as o, flow as p, TaskResult as r, RunResult as s, args as t, RunOptions as u, DiscoveredFlow as v, GateResult as w, FlowStep as x, FlowEvent as y };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,n as t,o as n,r}from"./prompt-CEuBMNhk.js";import{i}from"./cli-BilSDkvE.js";import{p as a,s as o}from"./output-BKeyLbvt.js";import{n as s,s as c,t as l}from"./args-BOEEdpWk.js";import u from"node:path";import d from"node:process";const f={observe:`read the platform only`,comment:`also post replies and reactions`,write:`also push, branch, and open or merge pull requests`};function p(e,t){let n=a,{id:r,samples:i,integrations:s}=e;d.stdout.write(`Created ${n.cyan(t)}.\n`);let c=s.length?[`1. Write ${t}/system.md. Try it with no server: coder task run --agent ${r} "<task>"`,`2. Run it on a server: coder dash on this machine reads it from this repo; a cloud server imports it from the dashboard or with coder agent push.`,`3. On the dashboard, create the agent's app on each platform it uses (${s.join(`, `)}) from its Platforms tab, and install it.`,`4. Fire an event by hand, or leave --server out to run it offline: coder agent run ${r} ${i[0]??`<event.json>`} --server <url>`,`Guide: https://github.com/muzam1l/coder/blob/main/docs/agents/index.md`,`Agents: coder docs agents`]:[`1. Write ${t}/system.md. Try it with no server: coder task run --agent ${r} "<task>"`,`2. Give the agent a platform under "integrations" in ${t}/agent.json, then run init again or follow the guide: coder agent integrations list`,`Guide: https://github.com/muzam1l/coder/blob/main/docs/agents/index.md`,`Agents: coder docs agents`];d.stdout.write(`\n${o(c,n)}\n`)}async function m(r){let{regexError:i}=await import(`./agent-BsYx3Odz.js`).then(e=>e.t),{INTEGRATIONS:o}=await import(`./integrations-BAgdVDhj.js`).then(e=>e.r),{PRESETS:s}=await import(`./types-D0q15RJa.js`).then(e=>e.n),c=a;d.stdout.write(`Creating ${c.cyan(`.coder/agents/${r}`)}. Pick what the agent listens to and what it may do; flags skip these questions.\n\n`);let l=await e({title:`Integrations`,hint:`Platforms the agent listens to and acts on. Add or remove them later in agent.json.`,multi:!0,selected:[Object.keys(o)[0]],options:Object.values(o).map(e=>({value:e.id,hint:e.description}))}),u={},p={};for(let e of l){let t=o[e],r=Object.keys(t.events),a=await n({title:`${e} events`,hint:`What wakes the agent on ${e}; each event runs the agent with that event as its prompt.`,multi:!0,required:!0,selected:[r.includes(`mention`)?`mention`:r[0]],options:Object.entries(t.events).map(([e,t])=>({value:e,hint:t.description,...t.noisy?{input:{label:`match`,value:`^help\\b`,placeholder:`tab to add a match`,validate:i}}:{}}))});u[e]=a.values,p[e]=a.inputs}let[m]=l.length?await e({title:`Tools`,hint:`What the agent may do on its platforms; comment suits most agents.`,selected:[`comment`],options:s.map(e=>({value:e,hint:f[e]}))}):[`comment`],h=await t(`Display name`,r,void 0,`Shown in replies and app names.`);return{...h===r?{}:{name:h},integrations:l,events:u,matches:p,tools:m}}const h=i({name:`agent init`,help:{usage:`coder agent init [id] [--integrations a,b] [--triggers a,b] [--tools <preset>] [--name <text>] [--description <text>] [--permissions <mode>] [--yes]`,summary:"Create .coder/agents/<id>/ with an agent.json built from the integration catalog, a system.md to write the prompt in, and one sample event per integration for `coder agent run`. Asks for the id, integrations, events, and tools when run in a terminal without them.",flags:[[`--integrations <a,b>`,`platforms the agent listens to (see coder agent integrations list)`],[`--triggers <a,b>`,`events that start tasks, applied to each integration that has them (default: mention)`],[`--tools <preset>`,`observe, comment, or write (default: comment)`],[`--name <text>`,`display name used in replies (default: the id)`],[`--description <text>`,`one line for agent list`],[`--permissions <mode>`,`engine permission mode (default: read-only)`],[`--yes`,`skip the questions and take the defaults`]],examples:[[`coder agent init`,`answer the questions, id included`],[`coder agent init triage --integrations github --triggers issue,mention --tools comment`,`no questions`]]},options:{...l,name:c,description:c,integrations:c,triggers:c,tools:c,permissions:c,match:c,yes:s},args:1,run:async({options:e,args:[n],cwd:i})=>{let{agents:a}=await import(`./agent-BsYx3Odz.js`).then(e=>e.t),o=r()&&!e.yes;return a.init(n,{...e,cwd:i,permissions:e.permissions,...o?{askId:e=>t(`Agent id`,``,e,`Folder name under .coder/agents and the name used in commands.`)}:{},...o&&!e.integrations?{askPicks:m}:{}})},json:(e,{cwd:t})=>({id:e.id,dir:u.relative(t,e.dir),files:e.files,samples:e.samples}),print:(e,{cwd:t})=>p(e,u.relative(t,e.dir))});export{h as commandAgentInit};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e}from"./cli-BilSDkvE.js";const t=e(`agent integrations`,{list:async()=>(await import(`./list-VToARh3C.js`)).commandIntegrationsList,ls:async()=>(await import(`./list-VToARh3C.js`)).commandIntegrationsList,show:async()=>(await import(`./show-COTZEYgc.js`)).commandIntegrationsShow},{menu:[{usage:`list`,blurb:`list integrations with their events and tools`},{usage:`show <id>`,blurb:`events and tools of one integration`}],description:[`The platforms an agent can listen to and act on: their events and tool presets.`]},{aliases:{ls:`list`}});export{t as commandAgentIntegrations};
|