@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,173 @@
|
|
|
1
|
+
import type { TaskLog } from '../../client/types';
|
|
2
|
+
|
|
3
|
+
export interface TaskLogEntry {
|
|
4
|
+
at?: string;
|
|
5
|
+
message?: string;
|
|
6
|
+
kind?: string;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface TokenUsage {
|
|
11
|
+
input: number;
|
|
12
|
+
cachedInput: number;
|
|
13
|
+
output: number;
|
|
14
|
+
total: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface TaskDisplayRow {
|
|
18
|
+
seq: number;
|
|
19
|
+
at: number;
|
|
20
|
+
kind:
|
|
21
|
+
| 'assistant'
|
|
22
|
+
| 'tool'
|
|
23
|
+
| 'tool-result'
|
|
24
|
+
| 'approval'
|
|
25
|
+
| 'status'
|
|
26
|
+
| 'error'
|
|
27
|
+
| 'line'
|
|
28
|
+
| 'reasoning'
|
|
29
|
+
| 'steer'
|
|
30
|
+
| 'usage';
|
|
31
|
+
title: string;
|
|
32
|
+
detail?: string;
|
|
33
|
+
tone?: 'muted' | 'error' | 'warning';
|
|
34
|
+
sourceKind: string;
|
|
35
|
+
separated: boolean;
|
|
36
|
+
durationMs?: number;
|
|
37
|
+
tool?: string;
|
|
38
|
+
exitCode?: number;
|
|
39
|
+
tokens?: TokenUsage;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const isApproval = (kind: string) =>
|
|
43
|
+
kind.includes('approval') || kind === 'sidecar-decision' || kind === 'auto-review';
|
|
44
|
+
|
|
45
|
+
function stripCwd(text: string, cwd?: string): string {
|
|
46
|
+
return cwd ? text.split(`${cwd}/`).join('').split(cwd).join('.') : text;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Decode structured runner output without treating arbitrary JSON as an event. */
|
|
50
|
+
export function logEntry(line: string): TaskLogEntry | undefined {
|
|
51
|
+
try {
|
|
52
|
+
const value: unknown = JSON.parse(line);
|
|
53
|
+
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
54
|
+
const kind = 'kind' in value && typeof value.kind === 'string' ? value.kind : undefined;
|
|
55
|
+
const message =
|
|
56
|
+
'message' in value && typeof value.message === 'string' ? value.message : undefined;
|
|
57
|
+
if (kind !== undefined || message !== undefined)
|
|
58
|
+
return {
|
|
59
|
+
...value,
|
|
60
|
+
kind,
|
|
61
|
+
message,
|
|
62
|
+
at: 'at' in value && typeof value.at === 'string' ? value.at : undefined,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
} catch {}
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** One reducer per transcript, also used by the terminal renderer. */
|
|
70
|
+
export class LogView {
|
|
71
|
+
private prevKind: string | null = null;
|
|
72
|
+
private lastAssistant = '';
|
|
73
|
+
private lastTool: string | null = null;
|
|
74
|
+
private lastToolText = '';
|
|
75
|
+
private lastUsageTotal = 0;
|
|
76
|
+
|
|
77
|
+
constructor(private readonly cwd?: string) {}
|
|
78
|
+
|
|
79
|
+
get lastAssistantMessage(): string {
|
|
80
|
+
return this.lastAssistant;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
reduce(record: TaskLog): TaskDisplayRow[] {
|
|
84
|
+
const entry = record.entry;
|
|
85
|
+
const sourceKind = entry ? String(entry.kind ?? 'status') : 'line';
|
|
86
|
+
const row: TaskDisplayRow = {
|
|
87
|
+
seq: record.seq,
|
|
88
|
+
at: record.at,
|
|
89
|
+
kind: 'status',
|
|
90
|
+
title: '',
|
|
91
|
+
sourceKind,
|
|
92
|
+
separated: false,
|
|
93
|
+
tone: 'muted',
|
|
94
|
+
};
|
|
95
|
+
if (!entry) {
|
|
96
|
+
row.kind = record.level === 'err' ? 'error' : record.level === 'sys' ? 'status' : 'line';
|
|
97
|
+
row.title = stripCwd(record.line, this.cwd);
|
|
98
|
+
if (record.level === 'err') row.tone = 'error';
|
|
99
|
+
} else if (sourceKind === 'usage') {
|
|
100
|
+
const tokens = entry.tokens as TokenUsage | undefined;
|
|
101
|
+
if (!tokens) return [];
|
|
102
|
+
const seeded = this.lastUsageTotal > 0;
|
|
103
|
+
const grown = tokens.total - this.lastUsageTotal;
|
|
104
|
+
if (!seeded || grown < Math.max(20_000, this.lastUsageTotal * 0.2)) {
|
|
105
|
+
this.lastUsageTotal = Math.max(this.lastUsageTotal, tokens.total);
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
this.lastUsageTotal = tokens.total;
|
|
109
|
+
row.kind = 'usage';
|
|
110
|
+
row.tokens = tokens;
|
|
111
|
+
row.title = `ctx ${tokenCount(tokens.input + tokens.cachedInput)} · out ${tokenCount(tokens.output)}`;
|
|
112
|
+
} else if (isApproval(sourceKind) && (entry.decision || !entry.message)) {
|
|
113
|
+
row.kind = 'approval';
|
|
114
|
+
const label =
|
|
115
|
+
sourceKind === 'sidecar-decision'
|
|
116
|
+
? 'sidecar'
|
|
117
|
+
: sourceKind === 'auto-review'
|
|
118
|
+
? 'auto-review'
|
|
119
|
+
: 'approval';
|
|
120
|
+
const risk = entry.riskLevel ? `(${String(entry.riskLevel)} risk)` : '';
|
|
121
|
+
const summary = stripCwd(entry.summary ? String(entry.summary) : '', this.cwd);
|
|
122
|
+
const target = summary.slice(summary.indexOf(': ') + 2);
|
|
123
|
+
const shown = summary && target && this.lastToolText.includes(target) ? '' : summary;
|
|
124
|
+
const method = shown ? '' : String(entry.method ?? '');
|
|
125
|
+
row.title = `${[label, String(entry.decision ?? ''), risk, method].filter(Boolean).join(' ')}${shown ? ` · ${shown}` : ''}`;
|
|
126
|
+
row.detail = stripCwd(entry.reason ? String(entry.reason) : '', this.cwd);
|
|
127
|
+
} else {
|
|
128
|
+
const raw = entry.message ? String(entry.message) : String(entry.kind ?? '');
|
|
129
|
+
if (!raw && !(sourceKind === 'tool-result' && (entry.exitCode != null || entry.isError)))
|
|
130
|
+
return [];
|
|
131
|
+
row.title = stripCwd(raw, this.cwd);
|
|
132
|
+
if (sourceKind === 'assistant') {
|
|
133
|
+
row.kind = 'assistant';
|
|
134
|
+
row.tone = undefined;
|
|
135
|
+
this.lastAssistant = row.title;
|
|
136
|
+
} else if (sourceKind === 'error' || sourceKind === 'steer') {
|
|
137
|
+
row.kind = sourceKind;
|
|
138
|
+
row.tone = sourceKind === 'error' ? 'error' : 'warning';
|
|
139
|
+
} else if (sourceKind === 'reasoning') {
|
|
140
|
+
row.kind = 'reasoning';
|
|
141
|
+
row.durationMs = typeof entry.durationMs === 'number' ? entry.durationMs : 0;
|
|
142
|
+
} else if (sourceKind === 'tool') {
|
|
143
|
+
row.kind = 'tool';
|
|
144
|
+
this.lastTool = entry.tool ? String(entry.tool) : null;
|
|
145
|
+
this.lastToolText = row.title;
|
|
146
|
+
} else if (sourceKind === 'tool-result') {
|
|
147
|
+
row.kind = 'tool-result';
|
|
148
|
+
row.exitCode = typeof entry.exitCode === 'number' ? entry.exitCode : undefined;
|
|
149
|
+
row.tone =
|
|
150
|
+
(row.exitCode !== undefined && row.exitCode !== 0) || entry.isError === true
|
|
151
|
+
? 'error'
|
|
152
|
+
: 'muted';
|
|
153
|
+
row.durationMs = typeof entry.durationMs === 'number' ? entry.durationMs : 0;
|
|
154
|
+
const tool = entry.tool ? String(entry.tool) : null;
|
|
155
|
+
if (tool && tool !== this.lastTool) row.tool = tool;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (this.prevKind !== null) {
|
|
159
|
+
row.separated =
|
|
160
|
+
['assistant', 'error', 'steer'].includes(sourceKind) ||
|
|
161
|
+
(sourceKind === 'reasoning' && this.prevKind !== 'reasoning') ||
|
|
162
|
+
(sourceKind === 'tool' && ['assistant', 'reasoning'].includes(this.prevKind));
|
|
163
|
+
}
|
|
164
|
+
this.prevKind = sourceKind;
|
|
165
|
+
return [row];
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function tokenCount(n: number): string {
|
|
170
|
+
if (n < 1000) return String(n);
|
|
171
|
+
if (n < 1_000_000) return `${(n / 1000).toFixed(n < 10_000 ? 1 : 0)}k`;
|
|
172
|
+
return `${(n / 1_000_000).toFixed(1)}M`;
|
|
173
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Prefix of Coder's cookies, so another app on the host never collides. */
|
|
2
|
+
export const COOKIE_PREFIX = 'coder';
|
|
3
|
+
|
|
4
|
+
export function safeReturnPath(candidate: string | null, origin: string): string {
|
|
5
|
+
const value = candidate ?? '/dash';
|
|
6
|
+
try {
|
|
7
|
+
const target = new URL(value, origin);
|
|
8
|
+
return target.origin === origin && !value.includes('\\') && !/^\/[/\\]/.test(target.pathname)
|
|
9
|
+
? `${target.pathname}${target.search}${target.hash}`
|
|
10
|
+
: '/dash';
|
|
11
|
+
} catch {
|
|
12
|
+
return '/dash';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ServerClient, ClientError } from '@coder/client';
|
|
2
|
+
import { CoderError } from '@coder/core/errors';
|
|
3
|
+
import type { StoredRow } from '@coder/client/types';
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
var __coder: { handle(request: Request): Promise<Response> } | undefined;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function encodeDefinition(definition: unknown): string {
|
|
10
|
+
return Buffer.from(JSON.stringify(definition), 'utf8').toString('base64url');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const clientKey = Symbol('coder.dashboard.client');
|
|
14
|
+
type RenderRequest = Request & { [clientKey]?: ServerClient };
|
|
15
|
+
|
|
16
|
+
/** One client per render request, with shared in-process GETs and the caller's cookie and scope. */
|
|
17
|
+
export function load(request: Request): ServerClient {
|
|
18
|
+
const render = request as RenderRequest;
|
|
19
|
+
let client = render[clientKey];
|
|
20
|
+
if (client) return client;
|
|
21
|
+
const reads = new Map<string, Promise<Response>>();
|
|
22
|
+
client = new ServerClient(
|
|
23
|
+
'',
|
|
24
|
+
{ cookie: true },
|
|
25
|
+
{
|
|
26
|
+
fetch: async (input, init) => {
|
|
27
|
+
const handle = globalThis.__coder?.handle;
|
|
28
|
+
if (!handle)
|
|
29
|
+
throw new CoderError('server', 'Dashboard server is not ready.', { status: 503 });
|
|
30
|
+
const url = new URL(String(input), request.url).href;
|
|
31
|
+
const headers = new Headers(init?.headers);
|
|
32
|
+
headers.set('cookie', request.headers.get('cookie') ?? '');
|
|
33
|
+
const scope = request.headers.get('x-coder-request-scope');
|
|
34
|
+
if (scope) headers.set('x-coder-request-scope', scope);
|
|
35
|
+
const read = !init?.method || init.method === 'GET';
|
|
36
|
+
let pending = read ? reads.get(url) : undefined;
|
|
37
|
+
if (!pending) {
|
|
38
|
+
pending = handle(new Request(url, { ...init, headers }));
|
|
39
|
+
if (read) reads.set(url, pending);
|
|
40
|
+
pending.catch(error =>
|
|
41
|
+
console.error(`dashboard load failed: ${init?.method ?? 'GET'} ${url}`, error),
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
return (await pending).clone();
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
);
|
|
48
|
+
render[clientKey] = client;
|
|
49
|
+
return client;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const signedOut = (error: unknown) =>
|
|
53
|
+
error instanceof ClientError &&
|
|
54
|
+
error.status === 401 &&
|
|
55
|
+
!/^Bearer(?:\s|$)/i.test(error.authenticate ?? '');
|
|
56
|
+
|
|
57
|
+
export const unwrap = <T>(rows: Array<StoredRow<T>>) => rows.map(row => row.value);
|
|
58
|
+
export function loadAgent(request: Request, slug: string) {
|
|
59
|
+
const path = new URL(request.url).pathname;
|
|
60
|
+
const content = path === `/dash/agents/${encodeURIComponent(slug)}` || path.endsWith('/edit');
|
|
61
|
+
return load(request).agents.get(slug, { versions: false, content });
|
|
62
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Me, AgentRow } from '@coder/client/types';
|
|
2
|
+
|
|
3
|
+
/** A server on this machine, using its own engine logins and config. */
|
|
4
|
+
export const localServer = (me: Me) => me.mode === 'local';
|
|
5
|
+
|
|
6
|
+
/** A server on this machine that platforms cannot reach yet: no public PUBLIC_URL. */
|
|
7
|
+
export const needsTunnel = (me: Me) =>
|
|
8
|
+
localServer(me) && !/^https:\/\/(?!localhost|127\.|\[::1\])/.test(me.server?.url ?? '');
|
|
9
|
+
|
|
10
|
+
export const editableAgent = (agent: Pick<AgentRow, 'source' | 'local'>) =>
|
|
11
|
+
agent.source === 'upload' || agent.source === 'home' || (agent.local && agent.source === 'repo');
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState } from 'preact/hooks';
|
|
4
|
+
|
|
5
|
+
import { ErrorText } from '@/comps/ui/field';
|
|
6
|
+
import { client } from '@/utils/client';
|
|
7
|
+
import { reasonText } from '@/utils/format';
|
|
8
|
+
import { AuthPanel } from '@/comps/frame/auth-panel';
|
|
9
|
+
|
|
10
|
+
export default function LinkPage() {
|
|
11
|
+
const [error, setError] = useState('');
|
|
12
|
+
const [done, setDone] = useState('');
|
|
13
|
+
const token =
|
|
14
|
+
typeof location === 'undefined'
|
|
15
|
+
? ''
|
|
16
|
+
: (new URLSearchParams(location.search).get('token') ?? '');
|
|
17
|
+
return (
|
|
18
|
+
<AuthPanel
|
|
19
|
+
tag="connect"
|
|
20
|
+
title="Connect your account"
|
|
21
|
+
lead={done || 'Link this platform identity to your signed-in Coder account.'}
|
|
22
|
+
>
|
|
23
|
+
{done ? null : (
|
|
24
|
+
<button
|
|
25
|
+
type="button"
|
|
26
|
+
class="btn wide"
|
|
27
|
+
onClick={() =>
|
|
28
|
+
void client
|
|
29
|
+
.linkAccount(token)
|
|
30
|
+
.then(result =>
|
|
31
|
+
setDone(`${result.platform} account ${result.platformUserId} is connected.`),
|
|
32
|
+
)
|
|
33
|
+
.catch(reason => setError(reasonText(reason)))
|
|
34
|
+
}
|
|
35
|
+
>
|
|
36
|
+
Connect
|
|
37
|
+
</button>
|
|
38
|
+
)}
|
|
39
|
+
<ErrorText value={error} />
|
|
40
|
+
</AuthPanel>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Loading } from '@/comps/ui/card';
|
|
2
|
+
import { Page, PageHead } from '@/comps/frame/page-head';
|
|
3
|
+
|
|
4
|
+
export default function AccountLoading() {
|
|
5
|
+
return (
|
|
6
|
+
<Page>
|
|
7
|
+
<PageHead title="Account" lead={' '} />
|
|
8
|
+
<Loading label="Loading account" />
|
|
9
|
+
</Page>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from 'preact/hooks';
|
|
4
|
+
|
|
5
|
+
import { NOTIFY } from '@/comps/frame/task-toasts';
|
|
6
|
+
|
|
7
|
+
/** Browser notifications for watched tasks, off until asked for; the permission prompt shows once. */
|
|
8
|
+
export function NotifySwitch() {
|
|
9
|
+
const [on, setOn] = useState(false);
|
|
10
|
+
const [blocked, setBlocked] = useState(false);
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (typeof Notification === 'undefined') return setBlocked(true);
|
|
14
|
+
setBlocked(Notification.permission === 'denied');
|
|
15
|
+
setOn(localStorage.getItem(NOTIFY) === '1' && Notification.permission === 'granted');
|
|
16
|
+
}, []);
|
|
17
|
+
|
|
18
|
+
const toggle = async (input: HTMLInputElement) => {
|
|
19
|
+
if (input.checked && Notification.permission === 'default')
|
|
20
|
+
await Notification.requestPermission();
|
|
21
|
+
const next = input.checked && Notification.permission === 'granted';
|
|
22
|
+
if (next) localStorage.setItem(NOTIFY, '1');
|
|
23
|
+
else localStorage.removeItem(NOTIFY);
|
|
24
|
+
input.checked = next;
|
|
25
|
+
setOn(next);
|
|
26
|
+
setBlocked(Notification.permission === 'denied');
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<label class="notify">
|
|
31
|
+
<input
|
|
32
|
+
type="checkbox"
|
|
33
|
+
role="switch"
|
|
34
|
+
class="switch"
|
|
35
|
+
checked={on}
|
|
36
|
+
disabled={blocked}
|
|
37
|
+
onChange={event => void toggle(event.currentTarget)}
|
|
38
|
+
/>
|
|
39
|
+
{blocked ? 'Notifications are blocked in this browser' : 'Notify me when a task finishes'}
|
|
40
|
+
</label>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* account sheet and people */
|
|
2
|
+
.sheet > div {
|
|
3
|
+
display: grid;
|
|
4
|
+
grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
|
|
5
|
+
gap: 24px;
|
|
6
|
+
padding: 20px;
|
|
7
|
+
border-top: 1px solid var(--line);
|
|
8
|
+
}
|
|
9
|
+
.sheet > div:first-child {
|
|
10
|
+
border-top: 0;
|
|
11
|
+
}
|
|
12
|
+
.sheet .label b {
|
|
13
|
+
display: block;
|
|
14
|
+
font-size: 10.5px;
|
|
15
|
+
font-weight: 500;
|
|
16
|
+
}
|
|
17
|
+
.sheet .label span {
|
|
18
|
+
display: block;
|
|
19
|
+
margin-top: 6px;
|
|
20
|
+
color: var(--muted);
|
|
21
|
+
}
|
|
22
|
+
.sheet .value {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: 12px;
|
|
26
|
+
min-width: 0;
|
|
27
|
+
}
|
|
28
|
+
.sheet .value b,
|
|
29
|
+
.sheet .value .muted {
|
|
30
|
+
display: block;
|
|
31
|
+
}
|
|
32
|
+
.sheet .notify {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: 10px;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
.sheet input.switch {
|
|
39
|
+
appearance: none;
|
|
40
|
+
position: relative;
|
|
41
|
+
flex: none;
|
|
42
|
+
width: 30px;
|
|
43
|
+
height: 18px;
|
|
44
|
+
margin: 0;
|
|
45
|
+
border: 1px solid var(--line2);
|
|
46
|
+
background: var(--wash2);
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
.sheet input.switch::after {
|
|
50
|
+
content: "";
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: 2px;
|
|
53
|
+
left: 2px;
|
|
54
|
+
width: 12px;
|
|
55
|
+
height: 12px;
|
|
56
|
+
background: var(--muted);
|
|
57
|
+
transition: transform 0.15s;
|
|
58
|
+
}
|
|
59
|
+
.sheet input.switch:checked {
|
|
60
|
+
border-color: var(--deep);
|
|
61
|
+
background: var(--deep);
|
|
62
|
+
}
|
|
63
|
+
.sheet input.switch:checked::after {
|
|
64
|
+
transform: translateX(12px);
|
|
65
|
+
background: #fff;
|
|
66
|
+
}
|
|
67
|
+
.sheet input.switch:focus-visible {
|
|
68
|
+
outline: 2px solid var(--acc);
|
|
69
|
+
outline-offset: 2px;
|
|
70
|
+
}
|
|
71
|
+
.sheet input.switch:disabled {
|
|
72
|
+
opacity: 0.5;
|
|
73
|
+
cursor: default;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@media (max-width: 760px) {
|
|
77
|
+
.sheet > div {
|
|
78
|
+
grid-template-columns: minmax(0, 1fr);
|
|
79
|
+
gap: 12px;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import './page.css';
|
|
2
|
+
import type { ComponentChildren } from 'preact';
|
|
3
|
+
|
|
4
|
+
import { iKey } from '@/comps/ui/icons';
|
|
5
|
+
import { load } from '@/api/load';
|
|
6
|
+
import { initial, reasonText } from '@/utils/format';
|
|
7
|
+
import { Badge } from '@/comps/ui/badge';
|
|
8
|
+
import { SignOut } from '@/app/dash/account/sign-out';
|
|
9
|
+
import { Page, PageHead } from '@/comps/frame/page-head';
|
|
10
|
+
import { Icon } from '@/comps/ui/icon';
|
|
11
|
+
import { Card } from '@/comps/ui/card';
|
|
12
|
+
import { NotifySwitch } from './notify';
|
|
13
|
+
|
|
14
|
+
function Row({
|
|
15
|
+
label,
|
|
16
|
+
hint,
|
|
17
|
+
children,
|
|
18
|
+
}: {
|
|
19
|
+
label: string;
|
|
20
|
+
hint: string;
|
|
21
|
+
children: ComponentChildren;
|
|
22
|
+
}) {
|
|
23
|
+
return (
|
|
24
|
+
<div>
|
|
25
|
+
<div class="label">
|
|
26
|
+
<b>{label}</b>
|
|
27
|
+
<span>{hint}</span>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="value">{children}</div>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default async function AccountPage({ request }: { request?: Request }) {
|
|
35
|
+
if (!request) return null;
|
|
36
|
+
try {
|
|
37
|
+
const me = await load(request).me();
|
|
38
|
+
const tokenMode = !me.user;
|
|
39
|
+
const local = me.mode === 'local';
|
|
40
|
+
const organization = me.organization;
|
|
41
|
+
const name = organization?.name ?? organization?.slug ?? 'Local server';
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Page>
|
|
45
|
+
<PageHead
|
|
46
|
+
title="Account"
|
|
47
|
+
lead={
|
|
48
|
+
tokenMode
|
|
49
|
+
? `This ${local ? 'local' : 'memory'} server keeps no accounts. The admin token is its only key.`
|
|
50
|
+
: 'Who you are on this server and which workspace you act in.'
|
|
51
|
+
}
|
|
52
|
+
/>
|
|
53
|
+
<div class="sheet frame">
|
|
54
|
+
<Row
|
|
55
|
+
label={tokenMode ? 'Access' : 'Profile'}
|
|
56
|
+
hint={
|
|
57
|
+
tokenMode
|
|
58
|
+
? 'Accepted from loopback only, kept in a cookie.'
|
|
59
|
+
: 'From the account you signed in with.'
|
|
60
|
+
}
|
|
61
|
+
>
|
|
62
|
+
<span class="avatar">{me.user ? initial(me.user.name) : <Icon d={iKey} />}</span>
|
|
63
|
+
<div class="grow">
|
|
64
|
+
<b>{me.user ? me.user.name : 'Admin token'}</b>
|
|
65
|
+
<span class="muted">
|
|
66
|
+
{me.user ? me.user.email : local ? 'Local server' : 'Local memory server'}
|
|
67
|
+
</span>
|
|
68
|
+
</div>
|
|
69
|
+
</Row>
|
|
70
|
+
{local ? null : (
|
|
71
|
+
<Row
|
|
72
|
+
label="Workspace"
|
|
73
|
+
hint="Agents, credentials, and tasks belong to it. Switch it from the menu at the top right."
|
|
74
|
+
>
|
|
75
|
+
<span class="avatar">{initial(name)}</span>
|
|
76
|
+
<div class="grow">
|
|
77
|
+
<b>{name}</b>
|
|
78
|
+
{organization?.slug && organization.slug !== name ? (
|
|
79
|
+
<span class="muted">{organization.slug}</span>
|
|
80
|
+
) : null}
|
|
81
|
+
</div>
|
|
82
|
+
{organization?.role ? <Badge>{organization.role}</Badge> : null}
|
|
83
|
+
</Row>
|
|
84
|
+
)}
|
|
85
|
+
<Row
|
|
86
|
+
label="Notifications"
|
|
87
|
+
hint="Toasts show in the dashboard either way. This also uses your browser's notifications."
|
|
88
|
+
>
|
|
89
|
+
<NotifySwitch />
|
|
90
|
+
</Row>
|
|
91
|
+
<Row
|
|
92
|
+
label="Session"
|
|
93
|
+
hint={
|
|
94
|
+
tokenMode
|
|
95
|
+
? 'Forgetting the token signs this browser out until it is entered again.'
|
|
96
|
+
: 'Signing out ends this browser session only.'
|
|
97
|
+
}
|
|
98
|
+
>
|
|
99
|
+
{tokenMode ? (
|
|
100
|
+
<form action="/dash/token" method="post">
|
|
101
|
+
<input type="hidden" name="token" value="" />
|
|
102
|
+
<input type="hidden" name="return" value="/dash" />
|
|
103
|
+
<button class="btn outline">Forget token</button>
|
|
104
|
+
</form>
|
|
105
|
+
) : (
|
|
106
|
+
<SignOut class="btn secondary-danger">Sign out</SignOut>
|
|
107
|
+
)}
|
|
108
|
+
</Row>
|
|
109
|
+
</div>
|
|
110
|
+
</Page>
|
|
111
|
+
);
|
|
112
|
+
} catch (error) {
|
|
113
|
+
return <LoadFailure error={error} />;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function LoadFailure({ error }: { error: unknown }) {
|
|
118
|
+
return (
|
|
119
|
+
<Page>
|
|
120
|
+
<PageHead title="Could not load this page" />
|
|
121
|
+
<Card tone="danger">
|
|
122
|
+
<p class="body prose">{reasonText(error)}</p>
|
|
123
|
+
</Card>
|
|
124
|
+
</Page>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { ComponentChildren } from 'preact';
|
|
4
|
+
|
|
5
|
+
import { signOut } from '@/utils/client';
|
|
6
|
+
import { iOut } from '@/comps/ui/icons';
|
|
7
|
+
import { Icon } from '@/comps/ui/icon';
|
|
8
|
+
|
|
9
|
+
export function SignOut({
|
|
10
|
+
class: cls,
|
|
11
|
+
icon,
|
|
12
|
+
children,
|
|
13
|
+
}: {
|
|
14
|
+
class: string;
|
|
15
|
+
icon?: boolean;
|
|
16
|
+
children: ComponentChildren;
|
|
17
|
+
}) {
|
|
18
|
+
return (
|
|
19
|
+
<button type="button" class={cls} onClick={() => void signOut().catch(() => location.reload())}>
|
|
20
|
+
{icon ? <Icon d={iOut} /> : null}
|
|
21
|
+
{children}
|
|
22
|
+
</button>
|
|
23
|
+
);
|
|
24
|
+
}
|