@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,50 @@
|
|
|
1
|
+
.st {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: baseline;
|
|
4
|
+
gap: 7px;
|
|
5
|
+
padding: 2px 8px;
|
|
6
|
+
font-size: 10px;
|
|
7
|
+
letter-spacing: 0.14em;
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
color: var(--muted);
|
|
10
|
+
background: var(--wash);
|
|
11
|
+
}
|
|
12
|
+
.st i {
|
|
13
|
+
align-self: center;
|
|
14
|
+
width: 7px;
|
|
15
|
+
height: 7px;
|
|
16
|
+
border-radius: 50%;
|
|
17
|
+
background: currentColor;
|
|
18
|
+
}
|
|
19
|
+
.st.running {
|
|
20
|
+
color: var(--acc);
|
|
21
|
+
background: var(--accbg);
|
|
22
|
+
}
|
|
23
|
+
.st.running i {
|
|
24
|
+
width: 9px;
|
|
25
|
+
height: 9px;
|
|
26
|
+
background: none;
|
|
27
|
+
border: 1.5px solid currentColor;
|
|
28
|
+
border-top-color: transparent;
|
|
29
|
+
animation: spin 1s linear infinite;
|
|
30
|
+
}
|
|
31
|
+
.st.waiting {
|
|
32
|
+
color: var(--warn);
|
|
33
|
+
background: var(--warnbg);
|
|
34
|
+
}
|
|
35
|
+
.st.completed {
|
|
36
|
+
color: var(--ok);
|
|
37
|
+
background: var(--okbg);
|
|
38
|
+
}
|
|
39
|
+
.st.failed {
|
|
40
|
+
color: var(--bad);
|
|
41
|
+
background: var(--badbg);
|
|
42
|
+
}
|
|
43
|
+
.st.queued i,
|
|
44
|
+
.st.cancelled i {
|
|
45
|
+
background: none;
|
|
46
|
+
border: 1.5px solid currentColor;
|
|
47
|
+
}
|
|
48
|
+
.stats .st {
|
|
49
|
+
justify-self: start;
|
|
50
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import './status.css';
|
|
2
|
+
import type { TaskState } from '@coder/client/types';
|
|
3
|
+
|
|
4
|
+
export function Status({ status }: { status: TaskState }) {
|
|
5
|
+
return (
|
|
6
|
+
<span class={`st ${status}`}>
|
|
7
|
+
<i />
|
|
8
|
+
{STATUS_LABEL[status] ?? status}
|
|
9
|
+
</span>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const STATUS_LABEL: Record<TaskState, string> = {
|
|
14
|
+
queued: 'waiting for slot',
|
|
15
|
+
running: 'running',
|
|
16
|
+
waiting: 'needs approval',
|
|
17
|
+
completed: 'completed',
|
|
18
|
+
failed: 'failed',
|
|
19
|
+
cancelled: 'cancelled',
|
|
20
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { TaskRow } from '@coder/client/types';
|
|
2
|
+
|
|
3
|
+
/** Task statuses a list filters by. */
|
|
4
|
+
export const STATUSES: Array<[string, string]> = [
|
|
5
|
+
['', 'Recent'],
|
|
6
|
+
['active', 'Active'],
|
|
7
|
+
['waiting', 'Needs approval'],
|
|
8
|
+
['running', 'Running'],
|
|
9
|
+
['queued', 'Queued'],
|
|
10
|
+
['completed', 'Completed'],
|
|
11
|
+
['failed', 'Failed'],
|
|
12
|
+
['cancelled', 'Cancelled'],
|
|
13
|
+
['archived', 'Archived'],
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
/** The list request's filters; "archived" is its own switch, not a status. */
|
|
17
|
+
export function listFilters<T extends { status: string }>(
|
|
18
|
+
filters: T,
|
|
19
|
+
): Omit<T, 'status'> & { status?: string; archived?: boolean } {
|
|
20
|
+
const { status, ...rest } = filters;
|
|
21
|
+
return status === 'archived' ? { ...rest, archived: true } : { ...rest, status };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Where tasks come from besides platforms, which join by their integration id. */
|
|
25
|
+
export const SOURCES: Array<[string, string]> = [
|
|
26
|
+
['', 'All sources'],
|
|
27
|
+
['dashboard', 'Dashboard'],
|
|
28
|
+
['cli', 'CLI'],
|
|
29
|
+
['schedule', 'Schedule'],
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
export const sourceLabel = (value: string) =>
|
|
33
|
+
(SOURCES.find(([key]) => key === value) ?? [value, value])[1];
|
|
34
|
+
|
|
35
|
+
export const taskActive = (task: TaskRow) =>
|
|
36
|
+
task.status === 'queued' || task.status === 'running' || task.status === 'waiting';
|
|
37
|
+
|
|
38
|
+
export const taskTitle = (task: TaskRow) =>
|
|
39
|
+
task.task.name?.trim() ||
|
|
40
|
+
task.task.prompt?.trim() ||
|
|
41
|
+
task.task.event?.text?.trim() ||
|
|
42
|
+
`${task.task.event?.type ?? 'task'} on ${task.task.agent}`;
|
|
43
|
+
|
|
44
|
+
/** A folder path's last segment. */
|
|
45
|
+
export const folderName = (path: string) => path.split(/[\\/]/).filter(Boolean).at(-1) ?? path;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
.tasks {
|
|
2
|
+
table-layout: fixed;
|
|
3
|
+
min-width: 720px;
|
|
4
|
+
}
|
|
5
|
+
.tasks th:nth-child(2) {
|
|
6
|
+
width: 160px;
|
|
7
|
+
}
|
|
8
|
+
.tasks th:nth-child(3) {
|
|
9
|
+
width: 140px;
|
|
10
|
+
}
|
|
11
|
+
.tasks th:nth-child(4) {
|
|
12
|
+
width: 130px;
|
|
13
|
+
}
|
|
14
|
+
.tasks th:nth-child(5) {
|
|
15
|
+
width: 150px;
|
|
16
|
+
}
|
|
17
|
+
.tasks td {
|
|
18
|
+
padding-block: 9px;
|
|
19
|
+
vertical-align: middle;
|
|
20
|
+
}
|
|
21
|
+
.tasks .cover {
|
|
22
|
+
display: -webkit-box;
|
|
23
|
+
-webkit-box-orient: vertical;
|
|
24
|
+
-webkit-line-clamp: 2;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
overflow-wrap: anywhere;
|
|
27
|
+
}
|
|
28
|
+
.tasks td:first-child .sub {
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
text-overflow: ellipsis;
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
}
|
|
33
|
+
.tasks td:first-child .sub {
|
|
34
|
+
margin-top: 1px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@media (max-width: 760px) {
|
|
38
|
+
.tasks {
|
|
39
|
+
min-width: 0;
|
|
40
|
+
}
|
|
41
|
+
.tasks td:nth-child(3) {
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-self: end;
|
|
45
|
+
}
|
|
46
|
+
.tasks td.when,
|
|
47
|
+
.tasks td.num {
|
|
48
|
+
font-size: 11.5px;
|
|
49
|
+
}
|
|
50
|
+
.tasks td.num {
|
|
51
|
+
justify-self: end;
|
|
52
|
+
color: var(--muted);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
.source {
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: 6px;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
}
|
|
61
|
+
.source .ic {
|
|
62
|
+
color: var(--dim);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* a row's menu waits at its right edge, above the cover link, and shows on hover, focus or while open */
|
|
66
|
+
.tasks th.num,
|
|
67
|
+
.tasks td.num {
|
|
68
|
+
padding-right: 64px;
|
|
69
|
+
}
|
|
70
|
+
.tasks td.num {
|
|
71
|
+
position: relative;
|
|
72
|
+
}
|
|
73
|
+
.row-acts {
|
|
74
|
+
position: absolute;
|
|
75
|
+
top: 50%;
|
|
76
|
+
right: 8px;
|
|
77
|
+
z-index: 1;
|
|
78
|
+
translate: 0 -50%;
|
|
79
|
+
opacity: 0;
|
|
80
|
+
transition: opacity 0.12s;
|
|
81
|
+
}
|
|
82
|
+
.tasks tr:is(:hover, :focus-within) .row-acts,
|
|
83
|
+
.row-acts:has(.pop:popover-open) {
|
|
84
|
+
opacity: 1;
|
|
85
|
+
}
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import './tasks-list.css';
|
|
4
|
+
|
|
5
|
+
import { useEffect, useState } from 'preact/hooks';
|
|
6
|
+
|
|
7
|
+
import { client } from '@/utils/client';
|
|
8
|
+
import { formatCount, formatDate, formatDay, formatDuration } from '@/utils/format';
|
|
9
|
+
import { iClock, iDots, iMonitor, iPlug, iTerminal } from '@/comps/ui/icons';
|
|
10
|
+
import { Menu, MenuItem, MenuRadio } from '@/comps/ui/menu';
|
|
11
|
+
import { Link } from '@wular/pnext/link';
|
|
12
|
+
import { usePaged } from '@/utils/paged';
|
|
13
|
+
import type { TaskCounts, TaskRow, TasksPage } from '@coder/client/types';
|
|
14
|
+
import { Card, Empty } from '@/comps/ui/card';
|
|
15
|
+
import { Id } from '@/comps/ui/badge';
|
|
16
|
+
import { ConfirmDialog } from '@/comps/ui/confirm';
|
|
17
|
+
import { ErrorText } from '@/comps/ui/field';
|
|
18
|
+
import { approvalParts } from '@/app/dash/tasks/[id]/task-actions';
|
|
19
|
+
import { reasonText } from '@/utils/format';
|
|
20
|
+
import { Status } from './status';
|
|
21
|
+
import { Icon } from '@/comps/ui/icon';
|
|
22
|
+
import { Select } from '@/comps/ui/select';
|
|
23
|
+
import { taskActive } from '@/app/dash/tasks/list/task';
|
|
24
|
+
import { taskTitle } from '@/app/dash/tasks/list/task';
|
|
25
|
+
import { LIST_PAGE } from '@/utils/paged';
|
|
26
|
+
import { Search, Toolbar, queryOf, useFilters } from '@/comps/ui/toolbar';
|
|
27
|
+
import { Tail } from '@/comps/ui/tail';
|
|
28
|
+
import {
|
|
29
|
+
SOURCES,
|
|
30
|
+
STATUSES,
|
|
31
|
+
folderName,
|
|
32
|
+
listFilters,
|
|
33
|
+
sourceLabel,
|
|
34
|
+
} from '@/app/dash/tasks/list/task';
|
|
35
|
+
import { NeedsCredential } from '@/app/dash/tasks/composer';
|
|
36
|
+
|
|
37
|
+
type Keys = 'q' | 'status' | 'source' | 'agent';
|
|
38
|
+
|
|
39
|
+
const SOURCE_ICONS: Record<string, string> = {
|
|
40
|
+
dashboard: iMonitor,
|
|
41
|
+
cli: iTerminal,
|
|
42
|
+
schedule: iClock,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** How often a list with running tasks refreshes their status. */
|
|
46
|
+
const LIVE_MS = 4000;
|
|
47
|
+
|
|
48
|
+
/** How long ago, under a day; the date after that. */
|
|
49
|
+
function ago(value: number, now: number, tz: string) {
|
|
50
|
+
const minutes = Math.round((now - value) / 60_000);
|
|
51
|
+
if (minutes < 1) return 'just now';
|
|
52
|
+
if (minutes < 60) return `${minutes} min ago`;
|
|
53
|
+
if (minutes < 1440) return `${Math.round(minutes / 60)} h ago`;
|
|
54
|
+
return formatDay(value, tz);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function TaskRowView({
|
|
58
|
+
task,
|
|
59
|
+
back,
|
|
60
|
+
scoped,
|
|
61
|
+
tz,
|
|
62
|
+
now,
|
|
63
|
+
onDone,
|
|
64
|
+
onError,
|
|
65
|
+
}: {
|
|
66
|
+
task: TaskRow;
|
|
67
|
+
onDone: (what: RowAction) => void;
|
|
68
|
+
onError: (message: string) => void;
|
|
69
|
+
/** The list to return to, when it is not the plain Tasks page. */
|
|
70
|
+
back?: string;
|
|
71
|
+
/** On an agent's own list, which names no agent. */
|
|
72
|
+
scoped?: boolean;
|
|
73
|
+
tz: string;
|
|
74
|
+
now: number;
|
|
75
|
+
}) {
|
|
76
|
+
const elapsed =
|
|
77
|
+
task.startedAt === undefined ? undefined : (task.finishedAt ?? now) - task.startedAt;
|
|
78
|
+
const source = task.task.event?.integration ?? task.task.source ?? 'dashboard';
|
|
79
|
+
const kind = task.task.event?.type ?? (task.task.flow === 'default' ? undefined : task.task.flow);
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<tr>
|
|
83
|
+
<td>
|
|
84
|
+
<Link
|
|
85
|
+
class="cover"
|
|
86
|
+
href="/dash/tasks/[id]"
|
|
87
|
+
params={{ id: task.task.id }}
|
|
88
|
+
search={back ? { back } : undefined}
|
|
89
|
+
>
|
|
90
|
+
{taskTitle(task)}
|
|
91
|
+
</Link>
|
|
92
|
+
<span class="sub">
|
|
93
|
+
{scoped ? null : `${task.task.agent} · `}
|
|
94
|
+
<Id value={task.task.id} />
|
|
95
|
+
{kind ? ` · ${kind}` : null}
|
|
96
|
+
{task.task.cwd ? (
|
|
97
|
+
<span title={task.task.cwd}>{` · ${folderName(task.task.cwd)}`}</span>
|
|
98
|
+
) : null}
|
|
99
|
+
</span>
|
|
100
|
+
</td>
|
|
101
|
+
<td>
|
|
102
|
+
<Status status={task.status} />
|
|
103
|
+
</td>
|
|
104
|
+
<td>
|
|
105
|
+
<span class="source" title={sourceLabel(source)}>
|
|
106
|
+
<Icon d={SOURCE_ICONS[source] ?? iPlug} />
|
|
107
|
+
{sourceLabel(source)}
|
|
108
|
+
</span>
|
|
109
|
+
</td>
|
|
110
|
+
<td class="when" title={formatDate(task.createdAt, tz)}>
|
|
111
|
+
{ago(task.createdAt, now, tz)}
|
|
112
|
+
</td>
|
|
113
|
+
<td class="num">
|
|
114
|
+
{formatDuration(elapsed)}
|
|
115
|
+
<span class="row-acts">
|
|
116
|
+
<RowActions task={task} onDone={onDone} onError={onError} />
|
|
117
|
+
</span>
|
|
118
|
+
</td>
|
|
119
|
+
</tr>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Stop, Archive and Delete behind a row's ⋯ menu; the list hears what happened and drops or refreshes the row. */
|
|
124
|
+
type RowAction = 'cancel' | 'archive' | 'delete' | 'approve';
|
|
125
|
+
|
|
126
|
+
function RowActions({
|
|
127
|
+
task,
|
|
128
|
+
onDone,
|
|
129
|
+
onError,
|
|
130
|
+
}: {
|
|
131
|
+
task: TaskRow;
|
|
132
|
+
onDone: (what: RowAction) => void;
|
|
133
|
+
onError: (message: string) => void;
|
|
134
|
+
}) {
|
|
135
|
+
const [deleting, setDeleting] = useState<'ask' | 'busy'>();
|
|
136
|
+
const act = (what: RowAction, decision?: 'accept' | 'decline') => {
|
|
137
|
+
onError('');
|
|
138
|
+
const call =
|
|
139
|
+
what === 'approve'
|
|
140
|
+
? client.tasks.approve(
|
|
141
|
+
task.task.id,
|
|
142
|
+
approvalParts(task.approval).id ?? '',
|
|
143
|
+
decision ?? 'decline',
|
|
144
|
+
)
|
|
145
|
+
: what === 'delete'
|
|
146
|
+
? client.tasks.delete(task.task.id)
|
|
147
|
+
: client.tasks[what](task.task.id);
|
|
148
|
+
|
|
149
|
+
void call
|
|
150
|
+
.then(
|
|
151
|
+
() => onDone(what),
|
|
152
|
+
reason => onError(reasonText(reason)),
|
|
153
|
+
)
|
|
154
|
+
.finally(() => setDeleting(undefined));
|
|
155
|
+
};
|
|
156
|
+
return (
|
|
157
|
+
<>
|
|
158
|
+
<Menu summary={<Icon d={iDots} />} summaryClass="icon-btn" label="Task actions" align="right">
|
|
159
|
+
{task.approval ? (
|
|
160
|
+
<MenuItem title="Approve" onClick={() => act('approve', 'accept')} />
|
|
161
|
+
) : null}
|
|
162
|
+
{task.approval ? <MenuItem title="Deny" onClick={() => act('approve', 'decline')} /> : null}
|
|
163
|
+
{taskActive(task) ? <MenuItem title="Stop" onClick={() => act('cancel')} /> : null}
|
|
164
|
+
{task.archivedAt ? null : <MenuItem title="Archive" onClick={() => act('archive')} />}
|
|
165
|
+
<MenuItem title="Delete" danger onClick={() => setDeleting('ask')} />
|
|
166
|
+
</Menu>
|
|
167
|
+
<ConfirmDialog
|
|
168
|
+
open={Boolean(deleting)}
|
|
169
|
+
title="Delete this task?"
|
|
170
|
+
body="Its conversation, activity and diff go with it."
|
|
171
|
+
confirmLabel="Delete"
|
|
172
|
+
busy={deleting === 'busy'}
|
|
173
|
+
onConfirm={() => {
|
|
174
|
+
setDeleting('busy');
|
|
175
|
+
act('delete');
|
|
176
|
+
}}
|
|
177
|
+
onClose={() => setDeleting(undefined)}
|
|
178
|
+
/>
|
|
179
|
+
</>
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** Tasks newest first, in pages as the list scrolls; search and filters run on the server, running ones stay live. */
|
|
184
|
+
export function TasksList({
|
|
185
|
+
first,
|
|
186
|
+
platforms,
|
|
187
|
+
agents = [],
|
|
188
|
+
filters,
|
|
189
|
+
agent,
|
|
190
|
+
head,
|
|
191
|
+
missing,
|
|
192
|
+
tz,
|
|
193
|
+
now,
|
|
194
|
+
}: {
|
|
195
|
+
first: TasksPage;
|
|
196
|
+
/** Platform ids, the sources besides the dashboard, CLI and schedule. */
|
|
197
|
+
platforms: [string, string][];
|
|
198
|
+
/** Every agent's id, for the agent filter. */
|
|
199
|
+
agents?: [string, string][];
|
|
200
|
+
filters: Record<Keys, string>;
|
|
201
|
+
agent?: string;
|
|
202
|
+
/** On the tasks page the toolbar is the page head. */
|
|
203
|
+
head?: { title: string };
|
|
204
|
+
/** No credential can run a task yet. */
|
|
205
|
+
missing?: boolean;
|
|
206
|
+
tz: string;
|
|
207
|
+
now: number;
|
|
208
|
+
}) {
|
|
209
|
+
const { values, set, query } = useFilters<Keys>(filters);
|
|
210
|
+
const initial = queryOf(filters);
|
|
211
|
+
const scope = agent ? `&agent=${encodeURIComponent(agent)}` : '';
|
|
212
|
+
const path = agent ? `/dash/agents/${encodeURIComponent(agent)}/tasks` : '/dash/tasks';
|
|
213
|
+
const back = query || agent ? `${path}${query ? `?${query}` : ''}` : undefined;
|
|
214
|
+
const options = {
|
|
215
|
+
limit: LIST_PAGE,
|
|
216
|
+
summary: true,
|
|
217
|
+
counts: true,
|
|
218
|
+
...listFilters(values),
|
|
219
|
+
agent: agent ?? values.agent,
|
|
220
|
+
};
|
|
221
|
+
const list = usePaged<TaskRow>({
|
|
222
|
+
name: `tasks${scope}`,
|
|
223
|
+
fetchPage: cursor => client.tasks.list({ ...options, cursor }),
|
|
224
|
+
query,
|
|
225
|
+
first,
|
|
226
|
+
initial,
|
|
227
|
+
});
|
|
228
|
+
const [fresh, setFresh] = useState<{
|
|
229
|
+
rows: Record<string, TaskRow>;
|
|
230
|
+
counts?: TaskCounts;
|
|
231
|
+
query?: string;
|
|
232
|
+
}>({ rows: {} });
|
|
233
|
+
const [gone, setGone] = useState<string[]>([]);
|
|
234
|
+
// Rows hidden after an archive or delete come back into view when the filters change.
|
|
235
|
+
useEffect(() => setGone([]), [query]);
|
|
236
|
+
const [actionError, setActionError] = useState('');
|
|
237
|
+
const rows = list.rows
|
|
238
|
+
.filter(task => !gone.includes(task.task.id))
|
|
239
|
+
.map(task => fresh.rows[task.task.id] ?? task);
|
|
240
|
+
const counts =
|
|
241
|
+
(fresh.query === query ? fresh.counts : undefined) ??
|
|
242
|
+
(list.meta.counts as TaskCounts | undefined);
|
|
243
|
+
const live = rows.some(taskActive) || !!counts?.active;
|
|
244
|
+
|
|
245
|
+
// Running tasks' status follows while they run; the rows themselves stay where they are.
|
|
246
|
+
useEffect(() => {
|
|
247
|
+
if (!live) return;
|
|
248
|
+
|
|
249
|
+
const byId = (items: TaskRow[]) => Object.fromEntries(items.map(row => [row.task.id, row]));
|
|
250
|
+
const timer = setInterval(() => {
|
|
251
|
+
void Promise.all([
|
|
252
|
+
client.tasks.list({ ...options, cursor: '' }),
|
|
253
|
+
// A row whose status leaves the filter still takes its new status.
|
|
254
|
+
options.status
|
|
255
|
+
? client.tasks.list({ ...options, status: undefined, counts: false, cursor: '' })
|
|
256
|
+
: undefined,
|
|
257
|
+
])
|
|
258
|
+
.then(([page, recent]) =>
|
|
259
|
+
setFresh(current => ({
|
|
260
|
+
rows: { ...current.rows, ...byId(recent?.items ?? []), ...byId(page.items) },
|
|
261
|
+
counts: page.counts,
|
|
262
|
+
query,
|
|
263
|
+
})),
|
|
264
|
+
)
|
|
265
|
+
.catch(() => {});
|
|
266
|
+
}, LIVE_MS);
|
|
267
|
+
return () => clearInterval(timer);
|
|
268
|
+
}, [live, query, agent]);
|
|
269
|
+
|
|
270
|
+
return (
|
|
271
|
+
<>
|
|
272
|
+
<Toolbar head={head}>
|
|
273
|
+
<Search value={values.q} label="Search tasks" onInput={value => set('q', value, 250)} />
|
|
274
|
+
<Select
|
|
275
|
+
label="Status"
|
|
276
|
+
value={values.status}
|
|
277
|
+
options={STATUSES}
|
|
278
|
+
onChange={value => set('status', value)}
|
|
279
|
+
/>
|
|
280
|
+
<Menu
|
|
281
|
+
class="filter-more"
|
|
282
|
+
label="More filters"
|
|
283
|
+
summaryClass={`field-btn${values.source || values.agent ? ' on' : ''}`}
|
|
284
|
+
summary="Filter"
|
|
285
|
+
>
|
|
286
|
+
<p class="pop-label">Source</p>
|
|
287
|
+
<div role="group" aria-label="Source">
|
|
288
|
+
{[...SOURCES, ...platforms].map(([value, label]) => (
|
|
289
|
+
<MenuRadio
|
|
290
|
+
key={value}
|
|
291
|
+
on={values.source === value}
|
|
292
|
+
onPick={() => set('source', value)}
|
|
293
|
+
>
|
|
294
|
+
{label}
|
|
295
|
+
</MenuRadio>
|
|
296
|
+
))}
|
|
297
|
+
</div>
|
|
298
|
+
{agent ? null : (
|
|
299
|
+
<>
|
|
300
|
+
<p class="pop-label">Agent</p>
|
|
301
|
+
<div role="group" aria-label="Agent">
|
|
302
|
+
{[
|
|
303
|
+
['', 'All agents'] as [string, string],
|
|
304
|
+
...(values.agent && !agents.some(([id]) => id === values.agent)
|
|
305
|
+
? [[values.agent, values.agent] as [string, string]]
|
|
306
|
+
: []),
|
|
307
|
+
...agents,
|
|
308
|
+
].map(([value, label]) => (
|
|
309
|
+
<MenuRadio
|
|
310
|
+
key={value}
|
|
311
|
+
on={values.agent === value}
|
|
312
|
+
onPick={() => set('agent', value)}
|
|
313
|
+
>
|
|
314
|
+
{label}
|
|
315
|
+
</MenuRadio>
|
|
316
|
+
))}
|
|
317
|
+
</div>
|
|
318
|
+
</>
|
|
319
|
+
)}
|
|
320
|
+
</Menu>
|
|
321
|
+
</Toolbar>
|
|
322
|
+
{missing ? <NeedsCredential /> : null}
|
|
323
|
+
<Card
|
|
324
|
+
title="Tasks"
|
|
325
|
+
count={counts ? formatCount(counts.all) : undefined}
|
|
326
|
+
actions={
|
|
327
|
+
counts ? (
|
|
328
|
+
<>
|
|
329
|
+
<ErrorText value={actionError} />
|
|
330
|
+
{counts.active ? (
|
|
331
|
+
<button type="button" class="badge acc" onClick={() => set('status', 'active')}>
|
|
332
|
+
{formatCount(counts.active)} active
|
|
333
|
+
</button>
|
|
334
|
+
) : null}
|
|
335
|
+
{counts.waiting ? (
|
|
336
|
+
<button type="button" class="badge warn" onClick={() => set('status', 'waiting')}>
|
|
337
|
+
{formatCount(counts.waiting)} awaiting approval
|
|
338
|
+
</button>
|
|
339
|
+
) : null}
|
|
340
|
+
</>
|
|
341
|
+
) : undefined
|
|
342
|
+
}
|
|
343
|
+
>
|
|
344
|
+
{rows.length ? (
|
|
345
|
+
<div class="table-scroll">
|
|
346
|
+
<table class="rows tasks stacked" aria-busy={list.stale}>
|
|
347
|
+
<thead>
|
|
348
|
+
<tr>
|
|
349
|
+
<th>Task</th>
|
|
350
|
+
<th>Status</th>
|
|
351
|
+
<th>Source</th>
|
|
352
|
+
<th>Created</th>
|
|
353
|
+
<th class="num">Duration</th>
|
|
354
|
+
</tr>
|
|
355
|
+
</thead>
|
|
356
|
+
<tbody>
|
|
357
|
+
{rows.map(task => (
|
|
358
|
+
<TaskRowView
|
|
359
|
+
key={task.task.id}
|
|
360
|
+
task={task}
|
|
361
|
+
back={back}
|
|
362
|
+
scoped={Boolean(agent)}
|
|
363
|
+
tz={tz}
|
|
364
|
+
now={now}
|
|
365
|
+
onError={setActionError}
|
|
366
|
+
onDone={what => {
|
|
367
|
+
// An archived row leaves every view but the archive; a stopped one just refreshes.
|
|
368
|
+
if (what === 'delete' || (what === 'archive' && values.status !== 'archived'))
|
|
369
|
+
setGone(current => [...current, task.task.id]);
|
|
370
|
+
void client.tasks
|
|
371
|
+
.list({ ...options, cursor: '' })
|
|
372
|
+
.then(page =>
|
|
373
|
+
setFresh(current => ({
|
|
374
|
+
rows: {
|
|
375
|
+
...current.rows,
|
|
376
|
+
...Object.fromEntries(page.items.map(row => [row.task.id, row])),
|
|
377
|
+
},
|
|
378
|
+
counts: page.counts,
|
|
379
|
+
query,
|
|
380
|
+
})),
|
|
381
|
+
)
|
|
382
|
+
.catch(() => {});
|
|
383
|
+
}}
|
|
384
|
+
/>
|
|
385
|
+
))}
|
|
386
|
+
</tbody>
|
|
387
|
+
</table>
|
|
388
|
+
</div>
|
|
389
|
+
) : list.stale ? null : query ? (
|
|
390
|
+
<Empty title="No tasks match">Try another search or filter.</Empty>
|
|
391
|
+
) : (
|
|
392
|
+
<Empty title="No tasks yet">
|
|
393
|
+
{agent
|
|
394
|
+
? 'Tasks appear here as this agent runs.'
|
|
395
|
+
: 'Type what you want done in the box above and press Enter. Tasks from the dashboard, the CLI and platforms like GitHub show up here, newest first.'}
|
|
396
|
+
</Empty>
|
|
397
|
+
)}
|
|
398
|
+
<Tail noun="tasks" {...list} />
|
|
399
|
+
</Card>
|
|
400
|
+
</>
|
|
401
|
+
);
|
|
402
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import './tasks-list.css';
|
|
2
|
+
import { dynamic } from '@wular/pnext/dynamic';
|
|
3
|
+
|
|
4
|
+
import { zoneOf } from '@/utils/format';
|
|
5
|
+
import { LIST_PAGE } from '@/utils/paged';
|
|
6
|
+
import { load } from '@/api/load';
|
|
7
|
+
import { Settle } from '@/comps/frame/stream';
|
|
8
|
+
import { LoadingCard, LoadingToolbar } from '@/comps/frame/loading-card';
|
|
9
|
+
import { SOURCES, STATUSES, listFilters } from '@/app/dash/tasks/list/task';
|
|
10
|
+
|
|
11
|
+
// Rows arrive rendered; paging and filters hydrate once the list is in view.
|
|
12
|
+
const TasksList = dynamic(() => import('./tasks-list').then(m => m.TasksList), {
|
|
13
|
+
load: 'visible',
|
|
14
|
+
ssr: true,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/** A task list before it arrives; an agent's own tab has no head and no agent filter. */
|
|
18
|
+
export function TasksLoading({ head, agent }: { head?: { title: string }; agent?: boolean }) {
|
|
19
|
+
return (
|
|
20
|
+
<>
|
|
21
|
+
<LoadingToolbar head={head} search="Search tasks" selects={[STATUSES[0]![1]]} more />
|
|
22
|
+
<LoadingCard title="Tasks" label="Loading tasks" />
|
|
23
|
+
</>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** The tasks the address bar's filters select; the page starts these loads before it renders. */
|
|
28
|
+
export function loadTasks(
|
|
29
|
+
request: Request,
|
|
30
|
+
agent?: string,
|
|
31
|
+
agentChoices?: Promise<[string, string][]>,
|
|
32
|
+
) {
|
|
33
|
+
const params = new URL(request.url).searchParams;
|
|
34
|
+
const filters = {
|
|
35
|
+
q: params.get('q') ?? '',
|
|
36
|
+
status: params.get('status') ?? '',
|
|
37
|
+
source: params.get('source') ?? '',
|
|
38
|
+
agent: agent ? '' : (params.get('agent') ?? ''),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const first = load(request).tasks.list({
|
|
42
|
+
cursor: '',
|
|
43
|
+
limit: LIST_PAGE,
|
|
44
|
+
summary: true,
|
|
45
|
+
counts: true,
|
|
46
|
+
...listFilters(filters),
|
|
47
|
+
agent: agent ?? filters.agent,
|
|
48
|
+
});
|
|
49
|
+
const catalog = load(request).integrations.list();
|
|
50
|
+
// The agent filter's choices; an agent's own tab has none.
|
|
51
|
+
const agents = agent
|
|
52
|
+
? undefined
|
|
53
|
+
: (agentChoices ??
|
|
54
|
+
load(request)
|
|
55
|
+
.agents.list({ cursor: '', limit: 100 })
|
|
56
|
+
.then(
|
|
57
|
+
page => page.items.map((row): [string, string] => [row.id, row.name]),
|
|
58
|
+
() => [],
|
|
59
|
+
));
|
|
60
|
+
return { filters, first, catalog, agents, tz: zoneOf(request) };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function TasksSection({
|
|
64
|
+
tasks: { filters, first, catalog, agents, tz },
|
|
65
|
+
agent,
|
|
66
|
+
head,
|
|
67
|
+
missing,
|
|
68
|
+
}: {
|
|
69
|
+
tasks: ReturnType<typeof loadTasks>;
|
|
70
|
+
agent?: string;
|
|
71
|
+
head?: { title: string };
|
|
72
|
+
/** No credential can run a task yet. */
|
|
73
|
+
missing?: Promise<boolean>;
|
|
74
|
+
}) {
|
|
75
|
+
return (
|
|
76
|
+
<Settle
|
|
77
|
+
load={() =>
|
|
78
|
+
Promise.all([first, catalog.catch(() => []), agents, missing]).then(
|
|
79
|
+
([page, integrations, ids, needs]) => (
|
|
80
|
+
<TasksList
|
|
81
|
+
first={page}
|
|
82
|
+
platforms={integrations.map((entry): [string, string] => [entry.id, entry.name])}
|
|
83
|
+
agents={ids}
|
|
84
|
+
filters={filters}
|
|
85
|
+
agent={agent}
|
|
86
|
+
head={head}
|
|
87
|
+
missing={needs}
|
|
88
|
+
tz={tz}
|
|
89
|
+
now={Date.now()}
|
|
90
|
+
/>
|
|
91
|
+
),
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
/>
|
|
95
|
+
);
|
|
96
|
+
}
|