@wular/coder 0.3.17 → 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-bHl6RBZ2.js +0 -3
- package/dist/runtime-X5Bgf1qH.js +0 -26
- package/dist/upgrade-piLxMgEv.js +0 -37
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import './page.css';
|
|
2
|
+
import { dynamic } from '@wular/pnext/dynamic';
|
|
3
|
+
|
|
4
|
+
import { formatDay, zoneOf } from '@/utils/format';
|
|
5
|
+
import { Link } from '@wular/pnext/link';
|
|
6
|
+
import { load } from '@/api/load';
|
|
7
|
+
import type { AgentRow, VersionRow, Paged } from '@coder/client/types';
|
|
8
|
+
import { Card, Empty } from '@/comps/ui/card';
|
|
9
|
+
import { Settle } from '@/comps/frame/stream';
|
|
10
|
+
import { loadAgent } from '@/api/load';
|
|
11
|
+
import { editableAgent } from '@/api/types';
|
|
12
|
+
import { LIST_PAGE } from '@/utils/paged';
|
|
13
|
+
import { ENGINE_NAMES, defaultLabel } from '@/app/dash/settings/model-options';
|
|
14
|
+
import type { Defaults } from '@/app/dash/tasks/composer';
|
|
15
|
+
|
|
16
|
+
const VersionsList = dynamic(() => import('./versions-list').then(m => m.VersionsList), {
|
|
17
|
+
load: 'visible',
|
|
18
|
+
ssr: true,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const Instructions = dynamic(() =>
|
|
22
|
+
import('@/app/dash/agents/agent/instructions').then(m => m.Instructions),
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const KIND: Record<string, string> = {
|
|
26
|
+
builtin: 'Built-in agent',
|
|
27
|
+
upload: 'Dashboard agent',
|
|
28
|
+
repo: 'Repository agent',
|
|
29
|
+
home: 'Local agent',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** Details, instructions and version history: the agent and its versions. */
|
|
33
|
+
function OverviewBody({
|
|
34
|
+
agent,
|
|
35
|
+
history,
|
|
36
|
+
defaults,
|
|
37
|
+
tz,
|
|
38
|
+
}: {
|
|
39
|
+
agent: AgentRow;
|
|
40
|
+
history: Paged<VersionRow>;
|
|
41
|
+
defaults: Defaults;
|
|
42
|
+
tz: string;
|
|
43
|
+
}) {
|
|
44
|
+
const current = history.items.find(version => version.version === agent.currentVersion);
|
|
45
|
+
const definition = agent.definition;
|
|
46
|
+
const engine = agent.settings?.engine ?? definition?.engine;
|
|
47
|
+
const base = defaults.engines[engine ?? defaults.engine];
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<Card title="Details">
|
|
52
|
+
<dl class="facts body">
|
|
53
|
+
<div>
|
|
54
|
+
<dt>Type</dt>
|
|
55
|
+
<dd>
|
|
56
|
+
{agent.local && agent.source === 'repo'
|
|
57
|
+
? 'Repo agent'
|
|
58
|
+
: agent.local && agent.source === 'upload'
|
|
59
|
+
? 'Local agent'
|
|
60
|
+
: (KIND[agent.source] ?? agent.source)}
|
|
61
|
+
</dd>
|
|
62
|
+
</div>
|
|
63
|
+
<div>
|
|
64
|
+
<dt>Engine</dt>
|
|
65
|
+
<dd>{engine ?? defaultLabel(ENGINE_NAMES[defaults.engine] ?? defaults.engine)}</dd>
|
|
66
|
+
</div>
|
|
67
|
+
<div>
|
|
68
|
+
<dt>Model</dt>
|
|
69
|
+
<dd>{agent.settings?.model ?? definition?.model ?? defaultLabel(base?.model)}</dd>
|
|
70
|
+
</div>
|
|
71
|
+
<div>
|
|
72
|
+
<dt>Effort</dt>
|
|
73
|
+
<dd>{agent.settings?.effort ?? definition?.effort ?? defaultLabel(base?.effort)}</dd>
|
|
74
|
+
</div>
|
|
75
|
+
<div>
|
|
76
|
+
<dt>Permissions</dt>
|
|
77
|
+
<dd>
|
|
78
|
+
{agent.settings?.permissions ?? definition?.permissions ?? defaultLabel('read-only')}
|
|
79
|
+
</dd>
|
|
80
|
+
</div>
|
|
81
|
+
{agent.local ? (
|
|
82
|
+
agent.commit && (
|
|
83
|
+
<div>
|
|
84
|
+
<dt>Commit</dt>
|
|
85
|
+
<dd>{agent.commit.slice(0, 7)}</dd>
|
|
86
|
+
</div>
|
|
87
|
+
)
|
|
88
|
+
) : (
|
|
89
|
+
<div>
|
|
90
|
+
<dt>Version</dt>
|
|
91
|
+
<dd>
|
|
92
|
+
v{agent.currentVersion}
|
|
93
|
+
{current ? `, ${formatDay(current.createdAt, tz)}` : ''}
|
|
94
|
+
</dd>
|
|
95
|
+
</div>
|
|
96
|
+
)}
|
|
97
|
+
</dl>
|
|
98
|
+
</Card>
|
|
99
|
+
<Card
|
|
100
|
+
title="Instructions"
|
|
101
|
+
actions={
|
|
102
|
+
editableAgent(agent) ? (
|
|
103
|
+
<Link
|
|
104
|
+
class="btn ghost sm"
|
|
105
|
+
href="/dash/agents/[slug]/edit"
|
|
106
|
+
params={{ slug: agent.id }}
|
|
107
|
+
search={{ section: 'instructions' }}
|
|
108
|
+
>
|
|
109
|
+
Edit
|
|
110
|
+
</Link>
|
|
111
|
+
) : agent.sourceUrl ? (
|
|
112
|
+
<a class="btn ghost sm" href={agent.sourceUrl} target="_blank" rel="noreferrer">
|
|
113
|
+
Open source
|
|
114
|
+
</a>
|
|
115
|
+
) : undefined
|
|
116
|
+
}
|
|
117
|
+
>
|
|
118
|
+
{agent.systemPrompt?.trim() ? (
|
|
119
|
+
<Instructions text={agent.systemPrompt.trim()} />
|
|
120
|
+
) : (
|
|
121
|
+
<Empty title="No instructions yet">
|
|
122
|
+
The agent starts every task from a blank prompt.
|
|
123
|
+
</Empty>
|
|
124
|
+
)}
|
|
125
|
+
</Card>
|
|
126
|
+
{agent.local ? null : (
|
|
127
|
+
<Card title="Version history" count={agent.currentVersion}>
|
|
128
|
+
<p class="body muted">
|
|
129
|
+
Each publish adds a version. New tasks run on the current one, and the list shows when
|
|
130
|
+
each went live.
|
|
131
|
+
</p>
|
|
132
|
+
<VersionsList agent={agent.id} current={agent.currentVersion} first={history} tz={tz} />
|
|
133
|
+
</Card>
|
|
134
|
+
)}
|
|
135
|
+
</>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export default async function AgentPage({
|
|
140
|
+
request,
|
|
141
|
+
params,
|
|
142
|
+
}: {
|
|
143
|
+
request?: Request;
|
|
144
|
+
params: Promise<Record<string, string | string[]>>;
|
|
145
|
+
}) {
|
|
146
|
+
if (!request) return null;
|
|
147
|
+
const { slug: raw } = await params;
|
|
148
|
+
const slug = Array.isArray(raw) ? raw[0]! : raw!;
|
|
149
|
+
const tz = zoneOf(request);
|
|
150
|
+
const agent = loadAgent(request, slug);
|
|
151
|
+
const versions = load(request).agents.versions(slug, { cursor: '', limit: LIST_PAGE });
|
|
152
|
+
const config = load(request)
|
|
153
|
+
.config.get()
|
|
154
|
+
.catch(() => undefined);
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<Settle
|
|
158
|
+
load={() =>
|
|
159
|
+
Promise.all([agent, versions, config]).then(([row, history, shown]) => (
|
|
160
|
+
<OverviewBody
|
|
161
|
+
agent={row}
|
|
162
|
+
history={history}
|
|
163
|
+
defaults={{
|
|
164
|
+
engine: shown?.effective.chain?.[0] ?? 'claude',
|
|
165
|
+
engines: shown?.effective.engines ?? {},
|
|
166
|
+
}}
|
|
167
|
+
tz={tz}
|
|
168
|
+
/>
|
|
169
|
+
))
|
|
170
|
+
}
|
|
171
|
+
/>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LoadingCard } from '@/comps/frame/loading-card';
|
|
2
|
+
|
|
3
|
+
export const Lead = () => (
|
|
4
|
+
<p class="tab-lead">
|
|
5
|
+
Each platform gets its own app named after the agent. Install an app wherever the agent should
|
|
6
|
+
work.
|
|
7
|
+
</p>
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
/** The platforms tab before its apps arrive. */
|
|
11
|
+
export default function PlatformsLoading() {
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<Lead />
|
|
15
|
+
<LoadingCard label="Loading platforms" />
|
|
16
|
+
</>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
.tab-lead {
|
|
2
|
+
color: var(--muted);
|
|
3
|
+
max-width: 72ch;
|
|
4
|
+
}
|
|
5
|
+
.more-list .inst {
|
|
6
|
+
padding: 4px 6px;
|
|
7
|
+
}
|
|
8
|
+
.plat td:first-child b {
|
|
9
|
+
margin-right: 8px;
|
|
10
|
+
}
|
|
11
|
+
.plat .where {
|
|
12
|
+
min-width: 150px;
|
|
13
|
+
}
|
|
14
|
+
.inst {
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
.inst + .inst {
|
|
18
|
+
margin-top: 8px;
|
|
19
|
+
}
|
|
20
|
+
.where .more {
|
|
21
|
+
display: inline-block;
|
|
22
|
+
margin-top: 8px;
|
|
23
|
+
}
|
|
24
|
+
.plat .acts {
|
|
25
|
+
width: 1%;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
}
|
|
28
|
+
.plat .acts > .badge {
|
|
29
|
+
margin-right: 10px;
|
|
30
|
+
}
|
|
31
|
+
.plat .acts .btn {
|
|
32
|
+
min-width: 92px;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
}
|
|
35
|
+
.plat .acts .menu {
|
|
36
|
+
display: inline-block;
|
|
37
|
+
margin-left: 4px;
|
|
38
|
+
}
|
|
39
|
+
.plat .acts .pop {
|
|
40
|
+
text-align: left;
|
|
41
|
+
white-space: normal;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@media (max-width: 1180px) {
|
|
45
|
+
.stacked.early thead {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
.stacked.early tr {
|
|
49
|
+
display: grid;
|
|
50
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
51
|
+
gap: 8px 12px;
|
|
52
|
+
padding: 14px 16px;
|
|
53
|
+
border-bottom: 1px solid var(--line);
|
|
54
|
+
}
|
|
55
|
+
.stacked.early td {
|
|
56
|
+
padding: 0;
|
|
57
|
+
border: 0;
|
|
58
|
+
min-width: 0;
|
|
59
|
+
}
|
|
60
|
+
.stacked.early td:first-child {
|
|
61
|
+
grid-column: 1 / -1;
|
|
62
|
+
}
|
|
63
|
+
.plat.early td:first-child {
|
|
64
|
+
grid-row: 1;
|
|
65
|
+
grid-column: 1;
|
|
66
|
+
}
|
|
67
|
+
/* a long platform name wraps instead of running under the actions */
|
|
68
|
+
.plat.early td:first-child .pf {
|
|
69
|
+
white-space: normal;
|
|
70
|
+
}
|
|
71
|
+
.plat.early .acts {
|
|
72
|
+
grid-row: 1;
|
|
73
|
+
grid-column: 2;
|
|
74
|
+
width: auto;
|
|
75
|
+
}
|
|
76
|
+
.plat.early td:nth-child(2) {
|
|
77
|
+
grid-column: 1;
|
|
78
|
+
}
|
|
79
|
+
.plat.early td:nth-child(3) {
|
|
80
|
+
grid-column: 2;
|
|
81
|
+
justify-self: end;
|
|
82
|
+
}
|
|
83
|
+
.plat.early td:nth-child(4),
|
|
84
|
+
.plat.early .where {
|
|
85
|
+
grid-column: 1 / -1;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import './page.css';
|
|
2
|
+
import { dynamic } from '@wular/pnext/dynamic';
|
|
3
|
+
|
|
4
|
+
import { formatDay, zoneOf } from '@/utils/format';
|
|
5
|
+
import { Link } from '@wular/pnext/link';
|
|
6
|
+
import { encodeDefinition, load, unwrap } from '@/api/load';
|
|
7
|
+
import type {
|
|
8
|
+
AppRow,
|
|
9
|
+
AgentRow,
|
|
10
|
+
InstallationRow,
|
|
11
|
+
IntegrationInfo,
|
|
12
|
+
Reach,
|
|
13
|
+
} from '@coder/client/types';
|
|
14
|
+
import { Card, Empty } from '@/comps/ui/card';
|
|
15
|
+
import { Badge, Chips } from '@/comps/ui/badge';
|
|
16
|
+
import { MoreList } from '@/comps/ui/menu';
|
|
17
|
+
import { Settle } from '@/comps/frame/stream';
|
|
18
|
+
import { loadAgent } from '@/api/load';
|
|
19
|
+
import { needsTunnel } from '@/api/types';
|
|
20
|
+
import { editableAgent } from '@/api/types';
|
|
21
|
+
import { TunnelGuide } from '@/app/dash/settings/tunnel-guide';
|
|
22
|
+
import { Platform } from '@/app/dash/agents/agent/agent-pills';
|
|
23
|
+
import { Lead } from './loading';
|
|
24
|
+
|
|
25
|
+
const PlatformActions = dynamic(() => import('./platform-actions').then(m => m.PlatformActions));
|
|
26
|
+
|
|
27
|
+
const eventNames = (events: unknown): string[] =>
|
|
28
|
+
Array.isArray(events)
|
|
29
|
+
? events.map(String)
|
|
30
|
+
: events && typeof events === 'object'
|
|
31
|
+
? Object.keys(events)
|
|
32
|
+
: [];
|
|
33
|
+
|
|
34
|
+
const REACH_BADGE: Record<Reach, { tone?: 'ok' | 'warn'; label: string }> = {
|
|
35
|
+
installed: { tone: 'ok', label: 'installed' },
|
|
36
|
+
created: { tone: 'warn', label: 'app created' },
|
|
37
|
+
none: { label: 'not set up' },
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** Organizations this workspace already works in on `integration`, where a new app could live. */
|
|
41
|
+
const organizationsOn = (
|
|
42
|
+
integration: string,
|
|
43
|
+
catalog: IntegrationInfo[],
|
|
44
|
+
everywhere: InstallationRow[],
|
|
45
|
+
) =>
|
|
46
|
+
catalog.find(entry => entry.id === integration)?.organizationApps
|
|
47
|
+
? [
|
|
48
|
+
...new Set(
|
|
49
|
+
everywhere
|
|
50
|
+
.filter(
|
|
51
|
+
entry =>
|
|
52
|
+
entry.integration === integration &&
|
|
53
|
+
entry.account.type &&
|
|
54
|
+
entry.account.type !== 'User',
|
|
55
|
+
)
|
|
56
|
+
.map(entry => entry.account.login),
|
|
57
|
+
),
|
|
58
|
+
].sort()
|
|
59
|
+
: [];
|
|
60
|
+
|
|
61
|
+
/** One row per platform: what wakes it, its access, the app, where it is installed, and the next step. */
|
|
62
|
+
function Platforms({
|
|
63
|
+
agent,
|
|
64
|
+
apps,
|
|
65
|
+
installations,
|
|
66
|
+
everywhere,
|
|
67
|
+
catalog,
|
|
68
|
+
tz,
|
|
69
|
+
}: {
|
|
70
|
+
agent: AgentRow;
|
|
71
|
+
apps: AppRow[];
|
|
72
|
+
installations: InstallationRow[];
|
|
73
|
+
everywhere: InstallationRow[];
|
|
74
|
+
catalog: IntegrationInfo[];
|
|
75
|
+
tz: string;
|
|
76
|
+
}) {
|
|
77
|
+
const declared = agent.definition?.integrations ?? {};
|
|
78
|
+
const ids = Object.keys(declared).sort();
|
|
79
|
+
if (!ids.length)
|
|
80
|
+
return (
|
|
81
|
+
<Empty title="This agent listens nowhere yet">
|
|
82
|
+
{editableAgent(agent) ? (
|
|
83
|
+
<Link
|
|
84
|
+
class="btn outline sm"
|
|
85
|
+
href="/dash/agents/[slug]/edit"
|
|
86
|
+
params={{ slug: agent.id }}
|
|
87
|
+
search={{ section: 'platforms' }}
|
|
88
|
+
>
|
|
89
|
+
Pick a platform
|
|
90
|
+
</Link>
|
|
91
|
+
) : (
|
|
92
|
+
'Its definition declares no platform.'
|
|
93
|
+
)}
|
|
94
|
+
</Empty>
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
const def = agent.definition ? encodeDefinition(agent.definition) : '';
|
|
98
|
+
const createUrl = (integration: string) => {
|
|
99
|
+
const params = new URLSearchParams({ agent: agent.id, def });
|
|
100
|
+
if (agent.source === 'repo' && agent.repo) {
|
|
101
|
+
params.set('repo', agent.repo);
|
|
102
|
+
params.set('branch', apps.find(app => app.branch)?.branch ?? 'main');
|
|
103
|
+
}
|
|
104
|
+
return `/create/${encodeURIComponent(integration)}?${params}`;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<Card>
|
|
109
|
+
<div class="table-scroll">
|
|
110
|
+
<table class="plat stacked early">
|
|
111
|
+
<thead>
|
|
112
|
+
<tr>
|
|
113
|
+
<th>Platform</th>
|
|
114
|
+
<th>Wakes on</th>
|
|
115
|
+
<th>Access</th>
|
|
116
|
+
<th>App</th>
|
|
117
|
+
<th>Installed on</th>
|
|
118
|
+
<th />
|
|
119
|
+
</tr>
|
|
120
|
+
</thead>
|
|
121
|
+
<tbody>
|
|
122
|
+
{ids.map(id => {
|
|
123
|
+
const own = apps.filter(app => app.integration === id);
|
|
124
|
+
const installs = installations.filter(entry => own.some(app => app.id === entry.app));
|
|
125
|
+
const state: Reach = !own.length ? 'none' : installs.length ? 'installed' : 'created';
|
|
126
|
+
const narrowed = agent.settings?.integrations?.[id];
|
|
127
|
+
const events = narrowed?.allowedEvents ?? eventNames(declared[id]?.triggers);
|
|
128
|
+
const tools = narrowed?.allowedTools ?? declared[id]?.tools;
|
|
129
|
+
const place = (entry: InstallationRow) => (
|
|
130
|
+
<span key={entry.id} class="inst">
|
|
131
|
+
<b>{entry.account.login}</b>
|
|
132
|
+
<span class="sub">
|
|
133
|
+
{[
|
|
134
|
+
entry.account.type?.toLowerCase(),
|
|
135
|
+
[entry.settings?.configRepo, entry.settings?.engine, entry.settings?.effort]
|
|
136
|
+
.filter(Boolean)
|
|
137
|
+
.join(', '),
|
|
138
|
+
]
|
|
139
|
+
.filter(Boolean)
|
|
140
|
+
.join(' · ') || 'account'}
|
|
141
|
+
</span>
|
|
142
|
+
</span>
|
|
143
|
+
);
|
|
144
|
+
return (
|
|
145
|
+
<tr key={id}>
|
|
146
|
+
<td>
|
|
147
|
+
<Platform id={id} info={catalog.find(entry => entry.id === id)} state={state} />
|
|
148
|
+
</td>
|
|
149
|
+
<td>
|
|
150
|
+
<Chips values={events} />
|
|
151
|
+
</td>
|
|
152
|
+
<td class="muted">
|
|
153
|
+
{typeof tools === 'string'
|
|
154
|
+
? tools
|
|
155
|
+
: Array.isArray(tools)
|
|
156
|
+
? `${tools.length} tools`
|
|
157
|
+
: 'observe'}
|
|
158
|
+
</td>
|
|
159
|
+
<td>
|
|
160
|
+
{own.length ? (
|
|
161
|
+
own.map(app => (
|
|
162
|
+
<span key={app.id} class="inst">
|
|
163
|
+
<b>{app.name}</b>
|
|
164
|
+
<span class="sub">created {formatDay(app.createdAt, tz)}</span>
|
|
165
|
+
</span>
|
|
166
|
+
))
|
|
167
|
+
) : (
|
|
168
|
+
<span class="muted">No app yet</span>
|
|
169
|
+
)}
|
|
170
|
+
</td>
|
|
171
|
+
<td class="where">
|
|
172
|
+
{installs.length ? (
|
|
173
|
+
<>
|
|
174
|
+
{installs.slice(0, 2).map(place)}
|
|
175
|
+
{installs.length > 2 ? (
|
|
176
|
+
<MoreList label={`+${installs.length - 2} more`}>
|
|
177
|
+
{installs.slice(2).map(place)}
|
|
178
|
+
</MoreList>
|
|
179
|
+
) : null}
|
|
180
|
+
</>
|
|
181
|
+
) : (
|
|
182
|
+
<span class="muted">{own.length ? 'Not installed' : 'Not available'}</span>
|
|
183
|
+
)}
|
|
184
|
+
</td>
|
|
185
|
+
<td class="acts">
|
|
186
|
+
<Badge tone={REACH_BADGE[state].tone}>{REACH_BADGE[state].label}</Badge>
|
|
187
|
+
<PlatformActions
|
|
188
|
+
integration={id}
|
|
189
|
+
apps={own.map(app => ({
|
|
190
|
+
id: app.id,
|
|
191
|
+
name: app.name,
|
|
192
|
+
}))}
|
|
193
|
+
installed={installs.length > 0}
|
|
194
|
+
createUrl={createUrl(id)}
|
|
195
|
+
owners={organizationsOn(id, catalog, everywhere)}
|
|
196
|
+
/>
|
|
197
|
+
</td>
|
|
198
|
+
</tr>
|
|
199
|
+
);
|
|
200
|
+
})}
|
|
201
|
+
</tbody>
|
|
202
|
+
</table>
|
|
203
|
+
</div>
|
|
204
|
+
</Card>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export default async function AgentPlatformsPage({
|
|
209
|
+
request,
|
|
210
|
+
params,
|
|
211
|
+
}: {
|
|
212
|
+
request?: Request;
|
|
213
|
+
params: Promise<Record<string, string | string[]>>;
|
|
214
|
+
}) {
|
|
215
|
+
if (!request) return null;
|
|
216
|
+
const { slug: raw } = await params;
|
|
217
|
+
const slug = Array.isArray(raw) ? raw[0]! : raw!;
|
|
218
|
+
const tz = zoneOf(request);
|
|
219
|
+
const agent = loadAgent(request, slug);
|
|
220
|
+
const apps = load(request).apps.list(slug).then(unwrap);
|
|
221
|
+
const everywhere = load(request).installations.list().then(unwrap);
|
|
222
|
+
const catalog = load(request)
|
|
223
|
+
.integrations.list()
|
|
224
|
+
.catch(() => []);
|
|
225
|
+
const me = load(request)
|
|
226
|
+
.me()
|
|
227
|
+
.catch(() => undefined);
|
|
228
|
+
const port = new URL(request.url).port || '8787';
|
|
229
|
+
apps.catch(() => {});
|
|
230
|
+
everywhere.catch(() => {});
|
|
231
|
+
|
|
232
|
+
return (
|
|
233
|
+
<>
|
|
234
|
+
<Lead />
|
|
235
|
+
<Settle
|
|
236
|
+
load={() =>
|
|
237
|
+
Promise.all([agent, apps, everywhere, catalog, me]).then(
|
|
238
|
+
([row, own, all, integrations, who]) => (
|
|
239
|
+
<>
|
|
240
|
+
<Platforms
|
|
241
|
+
agent={row}
|
|
242
|
+
apps={own}
|
|
243
|
+
installations={all.filter(
|
|
244
|
+
entry => !entry.deletedAt && own.some(app => app.id === entry.app),
|
|
245
|
+
)}
|
|
246
|
+
everywhere={all.filter(entry => !entry.deletedAt)}
|
|
247
|
+
catalog={integrations}
|
|
248
|
+
tz={tz}
|
|
249
|
+
/>
|
|
250
|
+
{who && needsTunnel(who) ? <TunnelGuide port={port} /> : null}
|
|
251
|
+
</>
|
|
252
|
+
),
|
|
253
|
+
)
|
|
254
|
+
}
|
|
255
|
+
/>
|
|
256
|
+
</>
|
|
257
|
+
);
|
|
258
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState } from 'preact/hooks';
|
|
4
|
+
|
|
5
|
+
import { client } from '@/utils/client';
|
|
6
|
+
import { iDots, iPlus, iSpark } from '@/comps/ui/icons';
|
|
7
|
+
import { reasonText } from '@/utils/format';
|
|
8
|
+
import { ErrorText } from '@/comps/ui/field';
|
|
9
|
+
import { Icon } from '@/comps/ui/icon';
|
|
10
|
+
import { Menu, MenuItem } from '@/comps/ui/menu';
|
|
11
|
+
|
|
12
|
+
/** The one next step for a platform, and the rarer ones in its row menu. */
|
|
13
|
+
export function PlatformActions({
|
|
14
|
+
integration,
|
|
15
|
+
apps,
|
|
16
|
+
installed,
|
|
17
|
+
createUrl,
|
|
18
|
+
owners = [],
|
|
19
|
+
}: {
|
|
20
|
+
integration: string;
|
|
21
|
+
apps: Array<{ id: string; name: string }>;
|
|
22
|
+
installed: boolean;
|
|
23
|
+
createUrl: string;
|
|
24
|
+
/** Organizations the app could live under instead of your own account. */
|
|
25
|
+
owners?: string[];
|
|
26
|
+
}) {
|
|
27
|
+
const [error, setError] = useState('');
|
|
28
|
+
const [busy, setBusy] = useState(false);
|
|
29
|
+
const where = (owner = '') =>
|
|
30
|
+
owner ? `${createUrl}&owner=${encodeURIComponent(owner)}` : createUrl;
|
|
31
|
+
const install = (app: string) => {
|
|
32
|
+
setBusy(true);
|
|
33
|
+
setError('');
|
|
34
|
+
void client.apps
|
|
35
|
+
.install(app, location.pathname)
|
|
36
|
+
.then(({ url }) => {
|
|
37
|
+
location.href = url;
|
|
38
|
+
})
|
|
39
|
+
.catch(reason => {
|
|
40
|
+
setBusy(false);
|
|
41
|
+
setError(reasonText(reason));
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
// The organization the workspace already works in is preselected; the menu holds the other places.
|
|
45
|
+
if (!apps.length)
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
<a
|
|
49
|
+
class="btn sm"
|
|
50
|
+
href={where(owners[0])}
|
|
51
|
+
title={owners[0] ? `Creates the app in ${owners[0]}` : undefined}
|
|
52
|
+
>
|
|
53
|
+
Create app
|
|
54
|
+
</a>
|
|
55
|
+
{owners.length ? (
|
|
56
|
+
<Menu
|
|
57
|
+
summaryClass="icon-btn"
|
|
58
|
+
label={`Where the ${integration} app lives`}
|
|
59
|
+
wide
|
|
60
|
+
summary={<Icon d={iDots} />}
|
|
61
|
+
>
|
|
62
|
+
{[...owners.slice(1), ''].map(name => (
|
|
63
|
+
<MenuItem
|
|
64
|
+
key={name}
|
|
65
|
+
icon={iSpark}
|
|
66
|
+
href={where(name)}
|
|
67
|
+
title={name ? `Create in ${name}` : 'Create under your account'}
|
|
68
|
+
sub="The app is private to where it lives."
|
|
69
|
+
/>
|
|
70
|
+
))}
|
|
71
|
+
</Menu>
|
|
72
|
+
) : null}
|
|
73
|
+
</>
|
|
74
|
+
);
|
|
75
|
+
return (
|
|
76
|
+
<>
|
|
77
|
+
{installed ? null : (
|
|
78
|
+
<button type="button" class="btn sm" disabled={busy} onClick={() => install(apps[0]!.id)}>
|
|
79
|
+
Install
|
|
80
|
+
</button>
|
|
81
|
+
)}
|
|
82
|
+
<Menu
|
|
83
|
+
summaryClass="icon-btn"
|
|
84
|
+
label={`More for ${integration}`}
|
|
85
|
+
wide
|
|
86
|
+
summary={<Icon d={iDots} />}
|
|
87
|
+
>
|
|
88
|
+
{apps.map(app => (
|
|
89
|
+
<MenuItem
|
|
90
|
+
key={app.id}
|
|
91
|
+
icon={iPlus}
|
|
92
|
+
title={
|
|
93
|
+
apps.length > 1
|
|
94
|
+
? `Install ${app.name} on another account`
|
|
95
|
+
: 'Install on another account'
|
|
96
|
+
}
|
|
97
|
+
sub="Add this app to more repositories, another org, or another workspace."
|
|
98
|
+
onClick={() => install(app.id)}
|
|
99
|
+
/>
|
|
100
|
+
))}
|
|
101
|
+
<MenuItem
|
|
102
|
+
icon={iSpark}
|
|
103
|
+
href={where(owners[0])}
|
|
104
|
+
title={`Create another ${integration} app`}
|
|
105
|
+
sub="A separate app for an account this one cannot be installed on."
|
|
106
|
+
/>
|
|
107
|
+
</Menu>
|
|
108
|
+
<ErrorText value={error} />
|
|
109
|
+
</>
|
|
110
|
+
);
|
|
111
|
+
}
|