@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,114 @@
|
|
|
1
|
+
.checks {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
gap: 8px 20px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* vertical section tabs */
|
|
8
|
+
.vsettings {
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-columns: 220px minmax(0, 1fr);
|
|
11
|
+
}
|
|
12
|
+
.tabs.vertical {
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: 2px;
|
|
15
|
+
padding: 16px 12px;
|
|
16
|
+
box-shadow: none;
|
|
17
|
+
border-right: 1px solid var(--line);
|
|
18
|
+
}
|
|
19
|
+
/* section tabs stay in view beside a long panel */
|
|
20
|
+
.page .tabs.vertical {
|
|
21
|
+
top: var(--stuck);
|
|
22
|
+
align-self: start;
|
|
23
|
+
height: auto;
|
|
24
|
+
overflow: visible;
|
|
25
|
+
background: none;
|
|
26
|
+
}
|
|
27
|
+
.tabs.vertical .tabs-label {
|
|
28
|
+
padding: 12px 10px 6px;
|
|
29
|
+
font-size: 10px;
|
|
30
|
+
color: var(--dim);
|
|
31
|
+
}
|
|
32
|
+
.tabs-label:first-child {
|
|
33
|
+
padding-top: 0;
|
|
34
|
+
}
|
|
35
|
+
.tabs.vertical > button {
|
|
36
|
+
height: 34px;
|
|
37
|
+
padding: 0 10px;
|
|
38
|
+
margin: 0;
|
|
39
|
+
border-bottom: 0;
|
|
40
|
+
border-left: 2px solid transparent;
|
|
41
|
+
text-align: left;
|
|
42
|
+
text-transform: none;
|
|
43
|
+
letter-spacing: 0;
|
|
44
|
+
font-size: 13px;
|
|
45
|
+
}
|
|
46
|
+
.tabs.vertical > button:hover {
|
|
47
|
+
background: var(--wash);
|
|
48
|
+
}
|
|
49
|
+
.tabs.vertical > button[aria-current] {
|
|
50
|
+
background: var(--wash2);
|
|
51
|
+
border-left-color: var(--deep);
|
|
52
|
+
}
|
|
53
|
+
.vsearch {
|
|
54
|
+
position: absolute;
|
|
55
|
+
top: 16px;
|
|
56
|
+
right: 24px;
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: 12px;
|
|
60
|
+
}
|
|
61
|
+
.tabs.vertical > button.miss {
|
|
62
|
+
opacity: 0.4;
|
|
63
|
+
}
|
|
64
|
+
.vbody {
|
|
65
|
+
position: relative;
|
|
66
|
+
display: grid;
|
|
67
|
+
align-content: start;
|
|
68
|
+
gap: 18px;
|
|
69
|
+
padding: 24px;
|
|
70
|
+
min-width: 0;
|
|
71
|
+
}
|
|
72
|
+
.vpanel {
|
|
73
|
+
display: grid;
|
|
74
|
+
gap: 16px;
|
|
75
|
+
}
|
|
76
|
+
.vpanel h2 {
|
|
77
|
+
font-size: 16px;
|
|
78
|
+
font-weight: 700;
|
|
79
|
+
}
|
|
80
|
+
.save {
|
|
81
|
+
padding-top: 16px;
|
|
82
|
+
border-top: 1px solid var(--line);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@media (max-width: 760px) {
|
|
86
|
+
.vsettings {
|
|
87
|
+
grid-template-columns: minmax(0, 1fr);
|
|
88
|
+
}
|
|
89
|
+
.page .tabs.vertical {
|
|
90
|
+
position: static;
|
|
91
|
+
flex-direction: row;
|
|
92
|
+
overflow-x: auto;
|
|
93
|
+
padding: 8px;
|
|
94
|
+
border-right: 0;
|
|
95
|
+
border-bottom: 1px solid var(--line);
|
|
96
|
+
}
|
|
97
|
+
.tabs.vertical .tabs-label {
|
|
98
|
+
display: none;
|
|
99
|
+
}
|
|
100
|
+
.tabs.vertical > button {
|
|
101
|
+
flex: none;
|
|
102
|
+
border-left: 0;
|
|
103
|
+
border-bottom: 2px solid transparent;
|
|
104
|
+
}
|
|
105
|
+
.tabs.vertical > button[aria-current] {
|
|
106
|
+
border-bottom-color: var(--deep);
|
|
107
|
+
}
|
|
108
|
+
.vbody {
|
|
109
|
+
padding: 18px 16px;
|
|
110
|
+
}
|
|
111
|
+
.vsearch {
|
|
112
|
+
position: static;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import './agent-settings-form.css';
|
|
4
|
+
|
|
5
|
+
import { useLayoutEffect, useRef, useState } from 'preact/hooks';
|
|
6
|
+
|
|
7
|
+
import { client } from '@/utils/client';
|
|
8
|
+
import type { AgentRow, AgentSettings } from '@coder/client/types';
|
|
9
|
+
import { reasonText } from '@/utils/format';
|
|
10
|
+
import { ErrorText, Field } from '@/comps/ui/field';
|
|
11
|
+
import { Chips } from '@/comps/ui/badge';
|
|
12
|
+
import { Select, type Option } from '@/comps/ui/select';
|
|
13
|
+
import { Search } from '@/comps/ui/toolbar';
|
|
14
|
+
import {
|
|
15
|
+
ENGINE_NAMES,
|
|
16
|
+
defaultLabel,
|
|
17
|
+
modelHeadings,
|
|
18
|
+
modelOptions,
|
|
19
|
+
modelValue,
|
|
20
|
+
splitModel,
|
|
21
|
+
} from '@/app/dash/settings/model-options';
|
|
22
|
+
import type { Defaults } from '@/app/dash/tasks/composer';
|
|
23
|
+
|
|
24
|
+
const EFFORTS = ['low', 'medium', 'high'];
|
|
25
|
+
const PERMISSIONS = ['read-only', 'workspace-write', 'auto'];
|
|
26
|
+
const PRESETS = ['observe', 'comment', 'write'];
|
|
27
|
+
|
|
28
|
+
const eventNames = (events: unknown): string[] =>
|
|
29
|
+
Array.isArray(events)
|
|
30
|
+
? events.map(String)
|
|
31
|
+
: events && typeof events === 'object'
|
|
32
|
+
? Object.keys(events)
|
|
33
|
+
: [];
|
|
34
|
+
|
|
35
|
+
function Choice({
|
|
36
|
+
name,
|
|
37
|
+
label,
|
|
38
|
+
hint,
|
|
39
|
+
value,
|
|
40
|
+
options,
|
|
41
|
+
blank,
|
|
42
|
+
}: {
|
|
43
|
+
name: string;
|
|
44
|
+
label: string;
|
|
45
|
+
hint?: string;
|
|
46
|
+
value?: string;
|
|
47
|
+
options: string[];
|
|
48
|
+
blank: string;
|
|
49
|
+
}) {
|
|
50
|
+
const list = value && !options.includes(value) ? [...options, value] : options;
|
|
51
|
+
return (
|
|
52
|
+
<Field label={label} hint={hint} group>
|
|
53
|
+
<Select
|
|
54
|
+
name={name}
|
|
55
|
+
label={label}
|
|
56
|
+
defaultValue={value ?? ''}
|
|
57
|
+
options={[['', blank], ...list.map((option): Option => [option, option])]}
|
|
58
|
+
/>
|
|
59
|
+
</Field>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** How this agent runs here: engine settings, then one tab per platform to narrow access and events. One Save. */
|
|
64
|
+
export function AgentSettingsForm({
|
|
65
|
+
agent,
|
|
66
|
+
models,
|
|
67
|
+
defaults,
|
|
68
|
+
runners,
|
|
69
|
+
}: {
|
|
70
|
+
agent: AgentRow;
|
|
71
|
+
models: Record<string, string[]>;
|
|
72
|
+
defaults: Defaults;
|
|
73
|
+
runners: Option[];
|
|
74
|
+
}) {
|
|
75
|
+
const [panel, setPanel] = useState(0);
|
|
76
|
+
const [error, setError] = useState('');
|
|
77
|
+
const [saved, setSaved] = useState('');
|
|
78
|
+
const [busy, setBusy] = useState(false);
|
|
79
|
+
const [query, setQuery] = useState('');
|
|
80
|
+
const [hits, setHits] = useState<number[]>();
|
|
81
|
+
const form = useRef<HTMLFormElement>(null);
|
|
82
|
+
const settings = agent.settings ?? {};
|
|
83
|
+
const [model, setModel] = useState(modelValue(settings.engine, settings.model));
|
|
84
|
+
const declared = agent.definition?.integrations ?? {};
|
|
85
|
+
const platforms = Object.keys(declared).sort();
|
|
86
|
+
const own = agent.definition;
|
|
87
|
+
const engine = own?.engine ?? defaults.engine;
|
|
88
|
+
|
|
89
|
+
// Filters every panel's fields by label and current value, and moves to a panel that has a match.
|
|
90
|
+
useLayoutEffect(() => {
|
|
91
|
+
const needle = query.trim().toLowerCase();
|
|
92
|
+
const found: number[] = [];
|
|
93
|
+
form.current!.querySelectorAll('.vpanel').forEach((section, index) => {
|
|
94
|
+
let any = false;
|
|
95
|
+
section.querySelectorAll<HTMLElement>('.field').forEach(field => {
|
|
96
|
+
const values = [...field.querySelectorAll('input')].map(input => input.value).join(' ');
|
|
97
|
+
const match = !needle || `${field.textContent} ${values}`.toLowerCase().includes(needle);
|
|
98
|
+
field.hidden = !match;
|
|
99
|
+
any ||= match;
|
|
100
|
+
});
|
|
101
|
+
if (any) found.push(index);
|
|
102
|
+
});
|
|
103
|
+
setHits(needle ? found : undefined);
|
|
104
|
+
if (needle && found.length && !found.includes(panel)) setPanel(found[0]!);
|
|
105
|
+
}, [query]);
|
|
106
|
+
|
|
107
|
+
const submit = async (event: SubmitEvent) => {
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
const values = new FormData(event.currentTarget as HTMLFormElement);
|
|
110
|
+
const text = (key: string) => String(values.get(key) ?? '').trim();
|
|
111
|
+
const next: AgentSettings = {};
|
|
112
|
+
for (const key of ['effort', 'permissions', 'runner'] as const)
|
|
113
|
+
if (text(key)) next[key] = text(key);
|
|
114
|
+
const picked = splitModel(model);
|
|
115
|
+
if (picked.engine) next.engine = picked.engine;
|
|
116
|
+
if (picked.model) next.model = picked.model;
|
|
117
|
+
for (const id of platforms) {
|
|
118
|
+
const current = settings.integrations?.[id] ?? {};
|
|
119
|
+
const entry: NonNullable<AgentSettings['integrations']>[string] = {};
|
|
120
|
+
if (Array.isArray(current.allowedTools)) entry.allowedTools = current.allowedTools;
|
|
121
|
+
else if (text(`tools:${id}`)) entry.allowedTools = text(`tools:${id}`);
|
|
122
|
+
const names = eventNames(declared[id]?.triggers);
|
|
123
|
+
const picked = values.getAll(`event:${id}`).map(String);
|
|
124
|
+
if (names.length && picked.length < names.length) entry.allowedEvents = picked;
|
|
125
|
+
if (Object.keys(entry).length) (next.integrations ??= {})[id] = entry;
|
|
126
|
+
}
|
|
127
|
+
setBusy(true);
|
|
128
|
+
setError('');
|
|
129
|
+
setSaved('');
|
|
130
|
+
try {
|
|
131
|
+
await client.agents.settings(agent.id, next);
|
|
132
|
+
setSaved('Saved. New tasks use these settings.');
|
|
133
|
+
} catch (reason) {
|
|
134
|
+
setError(reasonText(reason));
|
|
135
|
+
}
|
|
136
|
+
setBusy(false);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<form ref={form} class="vsettings card frame" onSubmit={submit}>
|
|
141
|
+
<nav class="tabs vertical" aria-label="Settings sections">
|
|
142
|
+
<p class="tabs-label">Runtime</p>
|
|
143
|
+
<button
|
|
144
|
+
type="button"
|
|
145
|
+
aria-current={panel === 0 ? 'true' : undefined}
|
|
146
|
+
class={hits && !hits.includes(0) ? 'miss' : undefined}
|
|
147
|
+
onClick={() => setPanel(0)}
|
|
148
|
+
>
|
|
149
|
+
How it runs
|
|
150
|
+
</button>
|
|
151
|
+
{platforms.length ? <p class="tabs-label">Platforms</p> : null}
|
|
152
|
+
{platforms.map((id, index) => (
|
|
153
|
+
<button
|
|
154
|
+
key={id}
|
|
155
|
+
type="button"
|
|
156
|
+
aria-current={panel === index + 1 ? 'true' : undefined}
|
|
157
|
+
class={hits && !hits.includes(index + 1) ? 'miss' : undefined}
|
|
158
|
+
onClick={() => setPanel(index + 1)}
|
|
159
|
+
>
|
|
160
|
+
{id}
|
|
161
|
+
</button>
|
|
162
|
+
))}
|
|
163
|
+
</nav>
|
|
164
|
+
<div class="vbody">
|
|
165
|
+
<div class="vsearch">
|
|
166
|
+
<Search value={query} label="Search settings" onInput={setQuery} />
|
|
167
|
+
{hits && !hits.length ? <span class="muted">No setting matches.</span> : null}
|
|
168
|
+
</div>
|
|
169
|
+
<section class="vpanel" hidden={panel !== 0}>
|
|
170
|
+
<h2>How it runs</h2>
|
|
171
|
+
<p class="muted">Anything left on Default follows the agent's own definition.</p>
|
|
172
|
+
<div class="fields">
|
|
173
|
+
<Field label="Model" hint="picking a model picks its engine" group>
|
|
174
|
+
<Select
|
|
175
|
+
label="Model"
|
|
176
|
+
value={model}
|
|
177
|
+
options={[
|
|
178
|
+
...modelOptions(
|
|
179
|
+
models,
|
|
180
|
+
defaultLabel(
|
|
181
|
+
[
|
|
182
|
+
ENGINE_NAMES[engine] ?? engine,
|
|
183
|
+
own?.model ?? defaults.engines[engine]?.model,
|
|
184
|
+
]
|
|
185
|
+
.filter(Boolean)
|
|
186
|
+
.join(' · '),
|
|
187
|
+
),
|
|
188
|
+
),
|
|
189
|
+
...(!settings.engine && settings.model
|
|
190
|
+
? [[modelValue(undefined, settings.model), settings.model] as Option]
|
|
191
|
+
: []),
|
|
192
|
+
]}
|
|
193
|
+
headings={modelHeadings(models)}
|
|
194
|
+
onChange={setModel}
|
|
195
|
+
/>
|
|
196
|
+
</Field>
|
|
197
|
+
<Choice
|
|
198
|
+
name="effort"
|
|
199
|
+
label="Effort"
|
|
200
|
+
value={settings.effort}
|
|
201
|
+
options={EFFORTS}
|
|
202
|
+
blank={defaultLabel(
|
|
203
|
+
own?.effort ?? defaults.engines[splitModel(model).engine ?? engine]?.effort,
|
|
204
|
+
)}
|
|
205
|
+
/>
|
|
206
|
+
<Choice
|
|
207
|
+
name="permissions"
|
|
208
|
+
label="Permissions"
|
|
209
|
+
hint="what the runner may change in the checkout"
|
|
210
|
+
value={settings.permissions}
|
|
211
|
+
options={PERMISSIONS}
|
|
212
|
+
blank={defaultLabel(own?.permissions ?? 'read-only')}
|
|
213
|
+
/>
|
|
214
|
+
{runners.length > 1 ? (
|
|
215
|
+
<Field label="Runs on" group>
|
|
216
|
+
<Select
|
|
217
|
+
name="runner"
|
|
218
|
+
label="Runs on"
|
|
219
|
+
defaultValue={settings.runner ?? ''}
|
|
220
|
+
options={runners}
|
|
221
|
+
/>
|
|
222
|
+
</Field>
|
|
223
|
+
) : null}
|
|
224
|
+
</div>
|
|
225
|
+
</section>
|
|
226
|
+
{platforms.map((id, index) => {
|
|
227
|
+
const current = settings.integrations?.[id] ?? {};
|
|
228
|
+
const names = eventNames(declared[id]?.triggers);
|
|
229
|
+
const allowed = current.allowedEvents;
|
|
230
|
+
const tools = declared[id]?.tools;
|
|
231
|
+
return (
|
|
232
|
+
<section key={id} class="vpanel" hidden={panel !== index + 1}>
|
|
233
|
+
<h2>{id}</h2>
|
|
234
|
+
<p class="muted">
|
|
235
|
+
Narrow what the agent does here. Only the events its definition declares can be
|
|
236
|
+
picked.
|
|
237
|
+
</p>
|
|
238
|
+
{Array.isArray(current.allowedTools) ? (
|
|
239
|
+
<div class="field">
|
|
240
|
+
<span>Platform access</span>
|
|
241
|
+
<Chips values={current.allowedTools} />
|
|
242
|
+
</div>
|
|
243
|
+
) : (
|
|
244
|
+
<Choice
|
|
245
|
+
name={`tools:${id}`}
|
|
246
|
+
label="Platform access"
|
|
247
|
+
hint="observe reads, comment also replies, write also pushes and merges"
|
|
248
|
+
value={
|
|
249
|
+
typeof current.allowedTools === 'string' ? current.allowedTools : undefined
|
|
250
|
+
}
|
|
251
|
+
options={PRESETS}
|
|
252
|
+
blank={defaultLabel(
|
|
253
|
+
typeof tools === 'string' ? tools : tools ? 'custom' : 'observe',
|
|
254
|
+
)}
|
|
255
|
+
/>
|
|
256
|
+
)}
|
|
257
|
+
{names.length ? (
|
|
258
|
+
<div class="field">
|
|
259
|
+
<span>
|
|
260
|
+
Events <small>all declared events unless you narrow it</small>
|
|
261
|
+
</span>
|
|
262
|
+
<div class="checks">
|
|
263
|
+
{names.map(name => (
|
|
264
|
+
<label key={name} class="check">
|
|
265
|
+
<input
|
|
266
|
+
type="checkbox"
|
|
267
|
+
name={`event:${id}`}
|
|
268
|
+
value={name}
|
|
269
|
+
defaultChecked={!allowed || allowed.includes(name)}
|
|
270
|
+
/>
|
|
271
|
+
{name}
|
|
272
|
+
</label>
|
|
273
|
+
))}
|
|
274
|
+
</div>
|
|
275
|
+
</div>
|
|
276
|
+
) : null}
|
|
277
|
+
</section>
|
|
278
|
+
);
|
|
279
|
+
})}
|
|
280
|
+
<div class="form-actions save">
|
|
281
|
+
<button class="btn" disabled={busy}>
|
|
282
|
+
Save
|
|
283
|
+
</button>
|
|
284
|
+
<ErrorText value={error} />
|
|
285
|
+
{saved ? (
|
|
286
|
+
<span class="flash" role="status">
|
|
287
|
+
{saved}
|
|
288
|
+
</span>
|
|
289
|
+
) : null}
|
|
290
|
+
</div>
|
|
291
|
+
</div>
|
|
292
|
+
</form>
|
|
293
|
+
);
|
|
294
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { dynamic } from '@wular/pnext/dynamic';
|
|
2
|
+
|
|
3
|
+
import { load } from '@/api/load';
|
|
4
|
+
import { Settle } from '@/comps/frame/stream';
|
|
5
|
+
import { loadAgent } from '@/api/load';
|
|
6
|
+
import { NO_MODELS, modelsByEngine } from '@/app/dash/settings/model-options';
|
|
7
|
+
import { runnerOptions } from '@/app/dash/tasks/composer-data';
|
|
8
|
+
|
|
9
|
+
const AgentSettingsForm = dynamic(() =>
|
|
10
|
+
import('./agent-settings-form').then(m => m.AgentSettingsForm),
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export default async function AgentSettingsPage({
|
|
14
|
+
request,
|
|
15
|
+
params,
|
|
16
|
+
}: {
|
|
17
|
+
request?: Request;
|
|
18
|
+
params: Promise<Record<string, string | string[]>>;
|
|
19
|
+
}) {
|
|
20
|
+
if (!request) return null;
|
|
21
|
+
const { slug: raw } = await params;
|
|
22
|
+
const slug = Array.isArray(raw) ? raw[0]! : raw!;
|
|
23
|
+
const agent = loadAgent(request, slug);
|
|
24
|
+
const models = load(request)
|
|
25
|
+
.models.list()
|
|
26
|
+
.catch(() => NO_MODELS);
|
|
27
|
+
const config = load(request)
|
|
28
|
+
.config.get()
|
|
29
|
+
.catch(() => undefined);
|
|
30
|
+
const runners = load(request)
|
|
31
|
+
.runners.list()
|
|
32
|
+
.then(
|
|
33
|
+
rows => rows.items,
|
|
34
|
+
() => [],
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Settle
|
|
39
|
+
load={() =>
|
|
40
|
+
Promise.all([agent, models, config, runners]).then(([row, shape, shown, rows]) => (
|
|
41
|
+
<AgentSettingsForm
|
|
42
|
+
agent={row}
|
|
43
|
+
models={modelsByEngine(shape)}
|
|
44
|
+
defaults={{
|
|
45
|
+
engine: shown?.effective.chain?.[0] ?? 'claude',
|
|
46
|
+
engines: shown?.effective.engines ?? {},
|
|
47
|
+
}}
|
|
48
|
+
runners={runnerOptions(rows)}
|
|
49
|
+
/>
|
|
50
|
+
))
|
|
51
|
+
}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TasksSection, loadTasks } from '@/app/dash/tasks/list/tasks-section';
|
|
2
|
+
|
|
3
|
+
export default async function AgentTasksPage({
|
|
4
|
+
request,
|
|
5
|
+
params,
|
|
6
|
+
}: {
|
|
7
|
+
request?: Request;
|
|
8
|
+
params: Promise<Record<string, string | string[]>>;
|
|
9
|
+
}) {
|
|
10
|
+
if (!request) return null;
|
|
11
|
+
const { slug: raw } = await params;
|
|
12
|
+
const slug = Array.isArray(raw) ? raw[0]! : raw!;
|
|
13
|
+
return <TasksSection tasks={loadTasks(request, slug)} agent={slug} />;
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import '@/comps/ui/segmented.css';
|
|
2
|
+
import '@/app/dash/usage/range-bar.css';
|
|
3
|
+
import { LoadingRange } from '@/app/dash/usage/range-bar';
|
|
4
|
+
import { Stat, Stats } from '@/app/dash/usage/stats';
|
|
5
|
+
import { Card, Loading } from '@/comps/ui/card';
|
|
6
|
+
import { BLANK } from '@/comps/frame/loading-card';
|
|
7
|
+
|
|
8
|
+
/** The usage tab's shape before its numbers arrive: totals, the day chart and the two breakdowns, blank. */
|
|
9
|
+
export default function AgentUsageLoading() {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<LoadingRange />
|
|
13
|
+
<Stats label="Totals">
|
|
14
|
+
{['Tasks', 'Runner time', 'Tokens', 'Average task'].map(label => (
|
|
15
|
+
<Stat key={label} label={label} value={BLANK} />
|
|
16
|
+
))}
|
|
17
|
+
</Stats>
|
|
18
|
+
<Card title="Tasks per day">
|
|
19
|
+
<Loading label="Loading usage" h={232} />
|
|
20
|
+
</Card>
|
|
21
|
+
<div class="grid-2">
|
|
22
|
+
<Card title="By installation">
|
|
23
|
+
<Loading label="Loading installations" h={173} />
|
|
24
|
+
</Card>
|
|
25
|
+
<Card title="By engine">
|
|
26
|
+
<Loading label="Loading engines" h={173} />
|
|
27
|
+
</Card>
|
|
28
|
+
</div>
|
|
29
|
+
</>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import '@/comps/ui/segmented.css';
|
|
2
|
+
import '@/app/dash/usage/range-bar.css';
|
|
3
|
+
import './page.css';
|
|
4
|
+
import { formatCount, formatDuration, zoneOf } from '@/utils/format';
|
|
5
|
+
import { daysIn, rangeFor } from '@/utils/range';
|
|
6
|
+
import { load } from '@/api/load';
|
|
7
|
+
import type { UsageTotal } from '@coder/client/types';
|
|
8
|
+
import { Card, Empty } from '@/comps/ui/card';
|
|
9
|
+
import { Stat, Stats } from '@/app/dash/usage/stats';
|
|
10
|
+
import { Settle } from '@/comps/frame/stream';
|
|
11
|
+
import { unwrap } from '@/api/load';
|
|
12
|
+
import { DayChart } from '@/app/dash/usage/day-chart';
|
|
13
|
+
import { RangeBar } from '@/app/dash/usage/range-bar';
|
|
14
|
+
|
|
15
|
+
function Breakdown({
|
|
16
|
+
title,
|
|
17
|
+
head,
|
|
18
|
+
rows,
|
|
19
|
+
label,
|
|
20
|
+
}: {
|
|
21
|
+
title: string;
|
|
22
|
+
head: string;
|
|
23
|
+
rows: UsageTotal[];
|
|
24
|
+
label: (key: string) => { name: string; sub?: string };
|
|
25
|
+
}) {
|
|
26
|
+
const sorted = [...rows].sort((a, b) => b.tokenCount - a.tokenCount || b.tasks - a.tasks);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Card title={title} count={rows.length}>
|
|
30
|
+
{rows.length ? (
|
|
31
|
+
<div class="table-scroll scroll-box" style="--max:420px">
|
|
32
|
+
<table>
|
|
33
|
+
<thead>
|
|
34
|
+
<tr>
|
|
35
|
+
<th>{head}</th>
|
|
36
|
+
<th class="num">Tasks</th>
|
|
37
|
+
<th class="num">Runner time</th>
|
|
38
|
+
<th class="num">Tokens</th>
|
|
39
|
+
</tr>
|
|
40
|
+
</thead>
|
|
41
|
+
<tbody>
|
|
42
|
+
{sorted.map(row => {
|
|
43
|
+
const { name, sub } = label(row.key);
|
|
44
|
+
return (
|
|
45
|
+
<tr key={row.key}>
|
|
46
|
+
<td>
|
|
47
|
+
{name}
|
|
48
|
+
{sub ? <span class="sub">{sub}</span> : null}
|
|
49
|
+
</td>
|
|
50
|
+
<td class="num">{formatCount(row.tasks)}</td>
|
|
51
|
+
<td class="num">{formatDuration(row.runnerMs)}</td>
|
|
52
|
+
<td class="num">{formatCount(row.tokenCount)}</td>
|
|
53
|
+
</tr>
|
|
54
|
+
);
|
|
55
|
+
})}
|
|
56
|
+
</tbody>
|
|
57
|
+
</table>
|
|
58
|
+
</div>
|
|
59
|
+
) : (
|
|
60
|
+
<Empty title="Nothing in this range" />
|
|
61
|
+
)}
|
|
62
|
+
</Card>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** One agent's usage: the range at once, then figures and tasks per day, then where and on what it ran. */
|
|
67
|
+
export default async function AgentUsagePage({
|
|
68
|
+
request,
|
|
69
|
+
params,
|
|
70
|
+
}: {
|
|
71
|
+
request?: Request;
|
|
72
|
+
params: Promise<Record<string, string | string[]>>;
|
|
73
|
+
}) {
|
|
74
|
+
if (!request) return null;
|
|
75
|
+
const { slug: raw } = await params;
|
|
76
|
+
const slug = Array.isArray(raw) ? raw[0]! : raw!;
|
|
77
|
+
const tz = zoneOf(request);
|
|
78
|
+
const range = rangeFor(request, tz);
|
|
79
|
+
|
|
80
|
+
const totals = (by: 'day' | 'installation' | 'engine') =>
|
|
81
|
+
load(request)
|
|
82
|
+
.usage({
|
|
83
|
+
by,
|
|
84
|
+
since: range.since,
|
|
85
|
+
until: range.until,
|
|
86
|
+
agent: slug,
|
|
87
|
+
...(by === 'day' ? { tz } : {}),
|
|
88
|
+
})
|
|
89
|
+
.then(value => value.totals);
|
|
90
|
+
const data = Promise.all([totals('day'), totals('installation'), totals('engine')]);
|
|
91
|
+
const installations = load(request).installations.list(slug).then(unwrap);
|
|
92
|
+
data.catch(() => {});
|
|
93
|
+
installations.catch(() => {});
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<>
|
|
97
|
+
<RangeBar
|
|
98
|
+
range={range}
|
|
99
|
+
to={{ href: '/dash/agents/[slug]/usage', params: { slug } }}
|
|
100
|
+
tz={tz}
|
|
101
|
+
/>
|
|
102
|
+
<Settle
|
|
103
|
+
load={() =>
|
|
104
|
+
Promise.all([data, installations]).then(([[days, where, engines], installed]) => {
|
|
105
|
+
const sum = (pick: (row: UsageTotal) => number) =>
|
|
106
|
+
engines.reduce((total, row) => total + pick(row), 0);
|
|
107
|
+
const tasks = sum(row => row.tasks);
|
|
108
|
+
const runner = sum(row => row.runnerMs);
|
|
109
|
+
const place = (key: string) => {
|
|
110
|
+
const found = installed.find(entry => entry.id === key);
|
|
111
|
+
return found
|
|
112
|
+
? { name: found.account.login, sub: found.integration }
|
|
113
|
+
: { name: key, sub: 'removed installation' };
|
|
114
|
+
};
|
|
115
|
+
return (
|
|
116
|
+
<>
|
|
117
|
+
<Stats label="Totals">
|
|
118
|
+
<Stat label="Tasks" value={formatCount(tasks)} />
|
|
119
|
+
<Stat label="Runner time" value={formatDuration(runner)} />
|
|
120
|
+
<Stat label="Tokens" value={formatCount(sum(row => row.tokenCount))} />
|
|
121
|
+
<Stat
|
|
122
|
+
label="Average task"
|
|
123
|
+
value={tasks ? formatDuration(runner / tasks) : 'Not available'}
|
|
124
|
+
/>
|
|
125
|
+
</Stats>
|
|
126
|
+
<Card title="Tasks per day">
|
|
127
|
+
<div class="body">
|
|
128
|
+
{tasks ? (
|
|
129
|
+
<DayChart
|
|
130
|
+
days={daysIn(range, tz)}
|
|
131
|
+
totals={days}
|
|
132
|
+
metric="tasks"
|
|
133
|
+
label="Tasks per day"
|
|
134
|
+
/>
|
|
135
|
+
) : (
|
|
136
|
+
<Empty title="Nothing ran in this range">
|
|
137
|
+
Pick a longer range, or run a task.
|
|
138
|
+
</Empty>
|
|
139
|
+
)}
|
|
140
|
+
</div>
|
|
141
|
+
</Card>
|
|
142
|
+
<div class="grid-2">
|
|
143
|
+
<Breakdown
|
|
144
|
+
title="By installation"
|
|
145
|
+
head="Installed on"
|
|
146
|
+
rows={where}
|
|
147
|
+
label={place}
|
|
148
|
+
/>
|
|
149
|
+
<Breakdown
|
|
150
|
+
title="By engine"
|
|
151
|
+
head="Engine"
|
|
152
|
+
rows={engines}
|
|
153
|
+
label={key => ({ name: key })}
|
|
154
|
+
/>
|
|
155
|
+
</div>
|
|
156
|
+
</>
|
|
157
|
+
);
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
/>
|
|
161
|
+
</>
|
|
162
|
+
);
|
|
163
|
+
}
|