@coffre/ui 0.1.18 → 0.3.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.
Files changed (236) hide show
  1. package/README.md +23 -3
  2. package/dist/{server/_coffre/assets/affordances-CKANXDTG.js → chunks/affordances-DAvsVz7u.js} +12 -7
  3. package/dist/chunks/affordances-DAvsVz7u.js.map +1 -0
  4. package/dist/chunks/directory-CSjWWUQ1.js +370 -0
  5. package/dist/chunks/directory-CSjWWUQ1.js.map +1 -0
  6. package/dist/{server/_coffre/assets/grants-DdKT11Ny.js → chunks/grants-saMQagmG.js} +41 -39
  7. package/dist/chunks/grants-saMQagmG.js.map +1 -0
  8. package/dist/chunks/icons-D-PfAfnH.js +203 -0
  9. package/dist/chunks/icons-D-PfAfnH.js.map +1 -0
  10. package/dist/chunks/mounted-jJmqqV_n.js +17 -0
  11. package/dist/chunks/mounted-jJmqqV_n.js.map +1 -0
  12. package/dist/{server/_coffre/assets/offboarding-CRz-K82H.js → chunks/offboarding-C6l30DZR.js} +70 -69
  13. package/dist/chunks/offboarding-C6l30DZR.js.map +1 -0
  14. package/dist/chunks/page-C5HcNqf2.js +190 -0
  15. package/dist/chunks/page-C5HcNqf2.js.map +1 -0
  16. package/dist/chunks/page-route-Drfw7lmn.js +20 -0
  17. package/dist/chunks/page-route-Drfw7lmn.js.map +1 -0
  18. package/dist/{server/_coffre/assets/principal-page-C-EFwJQw.js → chunks/principal-page-D_91OA0l.js} +105 -103
  19. package/dist/chunks/principal-page-D_91OA0l.js.map +1 -0
  20. package/dist/{server/_coffre/assets → chunks}/project-environments-lEzFHUt4.js +2 -0
  21. package/dist/chunks/project-environments-lEzFHUt4.js.map +1 -0
  22. package/dist/chunks/queries-CQ81o4so.js +376 -0
  23. package/dist/chunks/queries-CQ81o4so.js.map +1 -0
  24. package/dist/{server/_coffre/assets/row-state-C2P57xT1.js → chunks/row-state-0PsrEzOL.js} +22 -21
  25. package/dist/chunks/row-state-0PsrEzOL.js.map +1 -0
  26. package/dist/{server/_coffre/assets → chunks}/signin-errors-BEFlVDbQ.js +2 -0
  27. package/dist/chunks/signin-errors-BEFlVDbQ.js.map +1 -0
  28. package/dist/chunks/theme-B2vQolVR.js +86 -0
  29. package/dist/chunks/theme-B2vQolVR.js.map +1 -0
  30. package/dist/chunks/ui-DixXLQvQ.js +405 -0
  31. package/dist/chunks/ui-DixXLQvQ.js.map +1 -0
  32. package/dist/{server/_coffre/assets/use-action-B-xpvVRO.js → chunks/use-action-CWsg_YWU.js} +8 -6
  33. package/dist/chunks/use-action-CWsg_YWU.js.map +1 -0
  34. package/dist/{server/_coffre/assets/use-change-C8BCf3oU.js → chunks/use-change-c6CeLRin.js} +10 -474
  35. package/dist/chunks/use-change-c6CeLRin.js.map +1 -0
  36. package/dist/chunks/use-shell-jxd7Tzd-.js +26 -0
  37. package/dist/chunks/use-shell-jxd7Tzd-.js.map +1 -0
  38. package/dist/{server/_coffre/assets → chunks}/validation-BQtqPe2V.js +2 -0
  39. package/dist/chunks/validation-BQtqPe2V.js.map +1 -0
  40. package/dist/index.d.ts +386 -18
  41. package/dist/index.js +1147 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/pages/account.d.ts +9 -0
  44. package/dist/pages/account.js +334 -0
  45. package/dist/pages/account.js.map +1 -0
  46. package/dist/pages/audit.d.ts +3 -0
  47. package/dist/{server/_coffre/assets/audit-qB9G2AQJ.js → pages/audit.js} +102 -100
  48. package/dist/pages/audit.js.map +1 -0
  49. package/dist/pages/device-login.d.ts +9 -0
  50. package/dist/pages/device-login.js +211 -0
  51. package/dist/pages/device-login.js.map +1 -0
  52. package/dist/pages/environment.d.ts +3 -0
  53. package/dist/{server/_coffre/assets/projects._project._environment-C6uybzeU.js → pages/environment.js} +323 -469
  54. package/dist/pages/environment.js.map +1 -0
  55. package/dist/pages/login.d.ts +10 -0
  56. package/dist/pages/login.js +104 -0
  57. package/dist/pages/login.js.map +1 -0
  58. package/dist/pages/project.d.ts +2 -0
  59. package/dist/{server/_coffre/assets/projects._project.index-3CXwkyTh.js → pages/project.js} +223 -225
  60. package/dist/pages/project.js.map +1 -0
  61. package/dist/pages/projects.d.ts +3 -0
  62. package/dist/{server/_coffre/assets/projects.index-iSoBpRFz.js → pages/projects.js} +83 -81
  63. package/dist/pages/projects.js.map +1 -0
  64. package/dist/pages/settings.d.ts +3 -0
  65. package/dist/{server/_coffre/assets/settings-BDQTF5XW.js → pages/settings.js} +20 -18
  66. package/dist/pages/settings.js.map +1 -0
  67. package/dist/pages/token.d.ts +3 -0
  68. package/dist/{server/_coffre/assets/tokens._token-CrBMpcbN.js → pages/token.js} +198 -267
  69. package/dist/pages/token.js.map +1 -0
  70. package/dist/pages/tokens.d.ts +3 -0
  71. package/dist/pages/tokens.js +39 -0
  72. package/dist/pages/tokens.js.map +1 -0
  73. package/dist/pages/unregistered.d.ts +8 -0
  74. package/dist/pages/unregistered.js +54 -0
  75. package/dist/pages/unregistered.js.map +1 -0
  76. package/dist/pages/user.d.ts +3 -0
  77. package/dist/pages/user.js +16 -0
  78. package/dist/pages/user.js.map +1 -0
  79. package/dist/pages/users.d.ts +3 -0
  80. package/dist/pages/users.js +39 -0
  81. package/dist/pages/users.js.map +1 -0
  82. package/dist/project-BqIy8gYR.d.ts +5 -0
  83. package/dist/vite.d.ts +16 -0
  84. package/dist/vite.js +52 -0
  85. package/package.json +36 -21
  86. package/src/assets/icon.svg +1 -0
  87. package/src/components/affordances.ts +10 -4
  88. package/src/components/command-palette.tsx +229 -203
  89. package/src/components/directory.tsx +34 -38
  90. package/src/components/principal.tsx +7 -3
  91. package/src/components/service-tokens.tsx +3 -2
  92. package/src/components/shell.tsx +89 -127
  93. package/src/components/theme.tsx +14 -81
  94. package/src/components/ui.tsx +97 -68
  95. package/src/index.ts +29 -0
  96. package/src/layout.tsx +113 -0
  97. package/src/lib/coffre.ts +8 -4
  98. package/src/lib/mounted.ts +13 -0
  99. package/src/lib/page-context.ts +31 -0
  100. package/src/lib/page-route.ts +22 -0
  101. package/src/lib/preferences.tsx +46 -0
  102. package/src/options.ts +240 -0
  103. package/src/{routes → pages}/account.tsx +7 -24
  104. package/src/{routes → pages}/audit.tsx +5 -16
  105. package/src/{routes/auth.device.tsx → pages/device-login.tsx} +8 -21
  106. package/src/{routes/projects.$project.$environment.tsx → pages/environment.tsx} +43 -52
  107. package/src/{routes → pages}/login.tsx +5 -16
  108. package/src/{routes/projects.$project.index.tsx → pages/project.tsx} +38 -50
  109. package/src/{routes/projects.index.tsx → pages/projects.tsx} +2 -7
  110. package/src/{routes → pages}/settings.tsx +3 -10
  111. package/src/{routes/tokens.$token.tsx → pages/token.tsx} +6 -7
  112. package/src/{routes/tokens.index.tsx → pages/tokens.tsx} +3 -8
  113. package/src/{routes → pages}/unregistered.tsx +1 -6
  114. package/src/pages/user.tsx +10 -0
  115. package/src/{routes/users.index.tsx → pages/users.tsx} +3 -8
  116. package/src/register.ts +55 -0
  117. package/src/router.tsx +31 -62
  118. package/src/styles/globals.css +104 -46
  119. package/src/vite.ts +78 -0
  120. package/dist/client/.assetsignore +0 -2
  121. package/dist/client/_coffre/assets/account-BoLGAxbD.js +0 -2
  122. package/dist/client/_coffre/assets/account-CnnuRTDB.js +0 -1
  123. package/dist/client/_coffre/assets/affordances-CEafRJcN.js +0 -1
  124. package/dist/client/_coffre/assets/audit-CHSvKLWX.js +0 -1
  125. package/dist/client/_coffre/assets/audit-Cn4hmS4u.js +0 -2
  126. package/dist/client/_coffre/assets/auth.device-Co5vrpaA.js +0 -2
  127. package/dist/client/_coffre/assets/auth.device-DAlqWacc.js +0 -1
  128. package/dist/client/_coffre/assets/directory-H8Eh3MnS.js +0 -1
  129. package/dist/client/_coffre/assets/dist-Braunv_x.js +0 -1
  130. package/dist/client/_coffre/assets/globals-CpMrgkV6.css +0 -1
  131. package/dist/client/_coffre/assets/grants-DPDxJXU1.js +0 -1
  132. package/dist/client/_coffre/assets/icons-Dc_-t0lp.js +0 -1
  133. package/dist/client/_coffre/assets/index-sUCIXRgJ.js +0 -12
  134. package/dist/client/_coffre/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
  135. package/dist/client/_coffre/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
  136. package/dist/client/_coffre/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
  137. package/dist/client/_coffre/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
  138. package/dist/client/_coffre/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
  139. package/dist/client/_coffre/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
  140. package/dist/client/_coffre/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
  141. package/dist/client/_coffre/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
  142. package/dist/client/_coffre/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  143. package/dist/client/_coffre/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  144. package/dist/client/_coffre/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  145. package/dist/client/_coffre/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  146. package/dist/client/_coffre/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  147. package/dist/client/_coffre/assets/link-DBINMwm6.js +0 -1
  148. package/dist/client/_coffre/assets/login-BZFYfL1Y.js +0 -1
  149. package/dist/client/_coffre/assets/login-CYCKWTOD.js +0 -2
  150. package/dist/client/_coffre/assets/offboarding-Bwpftp3g.js +0 -1
  151. package/dist/client/_coffre/assets/page-C_hnzdaR.js +0 -1
  152. package/dist/client/_coffre/assets/preload-helper-CLkO85Nq.js +0 -1
  153. package/dist/client/_coffre/assets/principal-page-DLho8TSJ.js +0 -1
  154. package/dist/client/_coffre/assets/project-environments-CfIH5kFM.js +0 -1
  155. package/dist/client/_coffre/assets/projects._project._environment-DHRRvQw0.js +0 -3
  156. package/dist/client/_coffre/assets/projects._project._environment-TLI-RjBZ.js +0 -2
  157. package/dist/client/_coffre/assets/projects._project.index-BO-8FZIY.js +0 -2
  158. package/dist/client/_coffre/assets/projects._project.index-DGl921dP.js +0 -1
  159. package/dist/client/_coffre/assets/projects.index-BDn7Bhoo.js +0 -1
  160. package/dist/client/_coffre/assets/row-state-DJ-KLamZ.js +0 -1
  161. package/dist/client/_coffre/assets/settings-q9G1QvR_.js +0 -1
  162. package/dist/client/_coffre/assets/signin-errors-CroZWZgm.js +0 -1
  163. package/dist/client/_coffre/assets/suspense-O8sP0mEC.js +0 -1
  164. package/dist/client/_coffre/assets/tokens._token-B_qczpT9.js +0 -2
  165. package/dist/client/_coffre/assets/tokens._token-T-sqwMbz.js +0 -2
  166. package/dist/client/_coffre/assets/tokens.index-CcXSZnAG.js +0 -1
  167. package/dist/client/_coffre/assets/ui-BXP2IqrW.js +0 -46
  168. package/dist/client/_coffre/assets/unregistered-D2JXJ90x.js +0 -1
  169. package/dist/client/_coffre/assets/use-action-BpzKWhgg.js +0 -1
  170. package/dist/client/_coffre/assets/use-change-CKj3Inq9.js +0 -1
  171. package/dist/client/_coffre/assets/use-shell-W0SusPkz.js +0 -1
  172. package/dist/client/_coffre/assets/useQuery-B-lxFSES.js +0 -1
  173. package/dist/client/_coffre/assets/useSuspenseQuery-BZ-nzHST.js +0 -1
  174. package/dist/client/_coffre/assets/users._user-Bb3BGYHl.js +0 -1
  175. package/dist/client/_coffre/assets/users._user-DXmvKrzE.js +0 -2
  176. package/dist/client/_coffre/assets/users.index-BvzP3qwW.js +0 -1
  177. package/dist/client/_coffre/assets/validation-9Cl_XS-l.js +0 -1
  178. package/dist/server/.vite/manifest.json +0 -668
  179. package/dist/server/_coffre/assets/_tanstack-start-manifest_v-GsKnGGRy.js +0 -162
  180. package/dist/server/_coffre/assets/account-CV-a2IU2.js +0 -329
  181. package/dist/server/_coffre/assets/account-hk6wcIXU.js +0 -162
  182. package/dist/server/_coffre/assets/async-local-storage-C10uQtMM.js +0 -3108
  183. package/dist/server/_coffre/assets/audit-C1_Ej6YB.js +0 -31
  184. package/dist/server/_coffre/assets/auth.device-6JRrWbSV.js +0 -210
  185. package/dist/server/_coffre/assets/auth.device-CLoAxC2T.js +0 -29
  186. package/dist/server/_coffre/assets/directory-B-_rqsPx.js +0 -371
  187. package/dist/server/_coffre/assets/dist-CnnV3t2g.js +0 -908
  188. package/dist/server/_coffre/assets/empty-plugin-adapters-Cq4--YW-.js +0 -5
  189. package/dist/server/_coffre/assets/globals-CpMrgkV6.css +0 -1
  190. package/dist/server/_coffre/assets/icons-DOFT-eWB.js +0 -1704
  191. package/dist/server/_coffre/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
  192. package/dist/server/_coffre/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
  193. package/dist/server/_coffre/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
  194. package/dist/server/_coffre/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
  195. package/dist/server/_coffre/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
  196. package/dist/server/_coffre/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
  197. package/dist/server/_coffre/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
  198. package/dist/server/_coffre/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
  199. package/dist/server/_coffre/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  200. package/dist/server/_coffre/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  201. package/dist/server/_coffre/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  202. package/dist/server/_coffre/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  203. package/dist/server/_coffre/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  204. package/dist/server/_coffre/assets/lazyRouteComponent-CqBNCGuZ.js +0 -480
  205. package/dist/server/_coffre/assets/link-42ZWdjzZ.js +0 -422
  206. package/dist/server/_coffre/assets/login-DRKUKkaW.js +0 -22
  207. package/dist/server/_coffre/assets/login-DnwxVl4Y.js +0 -102
  208. package/dist/server/_coffre/assets/matchContext-qLfYbC6_.js +0 -56
  209. package/dist/server/_coffre/assets/page-D6n45dcK.js +0 -3561
  210. package/dist/server/_coffre/assets/projects._project._environment-CS8DdSMY.js +0 -48
  211. package/dist/server/_coffre/assets/projects._project.index-BGfcNpj0.js +0 -23
  212. package/dist/server/_coffre/assets/react-dom-bBoJXlK2.js +0 -1718
  213. package/dist/server/_coffre/assets/router-9BTgJhWG.js +0 -2322
  214. package/dist/server/_coffre/assets/start-DR3rN0St.js +0 -4
  215. package/dist/server/_coffre/assets/suspense-C-2QfDd2.js +0 -602
  216. package/dist/server/_coffre/assets/tokens._token-rY86Cjgp.js +0 -10
  217. package/dist/server/_coffre/assets/tokens.index-Bq5qDW9q.js +0 -37
  218. package/dist/server/_coffre/assets/ui-Cc0CGMtr.js +0 -14881
  219. package/dist/server/_coffre/assets/unregistered-D9ZKLOPJ.js +0 -53
  220. package/dist/server/_coffre/assets/use-shell-DwOzEi87.js +0 -462
  221. package/dist/server/_coffre/assets/useQuery-CTe86qFq.js +0 -8
  222. package/dist/server/_coffre/assets/useRouter-CaUSUNsw.js +0 -473
  223. package/dist/server/_coffre/assets/useSuspenseQuery-CSoHzrMb.js +0 -117
  224. package/dist/server/_coffre/assets/users._user-BmLKYeo_.js +0 -10
  225. package/dist/server/_coffre/assets/users._user-BmiHwQx3.js +0 -14
  226. package/dist/server/_coffre/assets/users.index-BiEax90r.js +0 -37
  227. package/dist/server/index.js +0 -13911
  228. package/src/assets/favicon-32.png +0 -0
  229. package/src/components/agentation.tsx +0 -34
  230. package/src/entry.ts +0 -19
  231. package/src/routeTree.gen.ts +0 -367
  232. package/src/routes/__root.tsx +0 -169
  233. package/src/routes/access.tsx +0 -11
  234. package/src/routes/index.tsx +0 -15
  235. package/src/routes/users.$user.tsx +0 -13
  236. package/src/types.ts +0 -21
Binary file
@@ -1,34 +0,0 @@
1
- import { lazy, Suspense } from 'react';
2
- import { ClientOnly } from '@tanstack/react-router';
3
-
4
- // Point-and-click UI feedback overlay (agentation.com): you annotate the page,
5
- // the agent reads the annotations over MCP from the annotation server on
6
- // 127.0.0.1:4747. Dev-only. The toolbar reaches that server through the dev
7
- // server's `/_agentation` proxy (dev/vite.config.ts) rather than at localhost
8
- // directly, so annotating through a tunnel lands on this machine too.
9
- //
10
- // The ternary is what keeps it out of production: import.meta.env.DEV is
11
- // replaced with a literal at build time, so the dynamic import is unreachable
12
- // in the prod build and Rollup drops the chunk entirely.
13
- const Toolbar = import.meta.env.DEV
14
- ? lazy(() => import('agentation').then((m) => ({ default: m.Agentation })))
15
- : () => null;
16
-
17
- export function Agentation() {
18
- if (!import.meta.env.DEV) return null;
19
-
20
- return (
21
- // The toolbar reads the DOM and portals into document.body, so it must not
22
- // run during SSR or the hydration pass.
23
- <ClientOnly>
24
- <Suspense fallback={null}>
25
- <SameOriginToolbar />
26
- </Suspense>
27
- </ClientOnly>
28
- );
29
- }
30
-
31
- /** Reads the page's origin, so it renders only inside ClientOnly, never on the server. */
32
- function SameOriginToolbar() {
33
- return <Toolbar endpoint={`${window.location.origin}/_agentation`} />;
34
- }
package/src/entry.ts DELETED
@@ -1,19 +0,0 @@
1
- import handler from '@tanstack/react-start/server-entry';
2
-
3
- import type { Ui } from './types.ts';
4
-
5
- /**
6
- * `@coffre/ui`: Start's handler for the pages, nothing else. The server
7
- * around it answers `/api` and sign-in, and hands every other GET here with
8
- * the request's nonce and API client; see `router.tsx`.
9
- */
10
- export function createUi(): Ui {
11
- return { fetch: async (request, init) => handler.fetch(request, init) };
12
- }
13
-
14
- // The build's Worker entry must have a default `fetch`. Nothing deploys the
15
- // UI alone: without a client from the server a page has no API to ask.
16
- export default {
17
- fetch: (request: Request) =>
18
- new Response('coffre/ui renders pages for @coffre/server; it does not run alone', { status: 501 }),
19
- };
@@ -1,367 +0,0 @@
1
- /* eslint-disable */
2
-
3
- // @ts-nocheck
4
-
5
- // noinspection JSUnusedGlobalSymbols
6
-
7
- // This file was automatically generated by TanStack Router.
8
- // You should NOT make any changes in this file as it will be overwritten.
9
- // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
10
-
11
- import { Route as rootRouteImport } from './routes/__root'
12
- import { Route as IndexRouteImport } from './routes/index'
13
- import { Route as AccessRouteImport } from './routes/access'
14
- import { Route as AccountRouteImport } from './routes/account'
15
- import { Route as AuditRouteImport } from './routes/audit'
16
- import { Route as LoginRouteImport } from './routes/login'
17
- import { Route as SettingsRouteImport } from './routes/settings'
18
- import { Route as UnregisteredRouteImport } from './routes/unregistered'
19
- import { Route as AuthDeviceRouteImport } from './routes/auth.device'
20
- import { Route as ProjectsIndexRouteImport } from './routes/projects.index'
21
- import { Route as TokensIndexRouteImport } from './routes/tokens.index'
22
- import { Route as TokensTokenRouteImport } from './routes/tokens.$token'
23
- import { Route as UsersIndexRouteImport } from './routes/users.index'
24
- import { Route as UsersUserRouteImport } from './routes/users.$user'
25
- import { Route as ProjectsProjectIndexRouteImport } from './routes/projects.$project.index'
26
- import { Route as ProjectsProjectEnvironmentRouteImport } from './routes/projects.$project.$environment'
27
-
28
- const IndexRoute = IndexRouteImport.update({
29
- id: '/',
30
- path: '/',
31
- getParentRoute: () => rootRouteImport,
32
- } as any)
33
- const AccessRoute = AccessRouteImport.update({
34
- id: '/access',
35
- path: '/access',
36
- getParentRoute: () => rootRouteImport,
37
- } as any)
38
- const AccountRoute = AccountRouteImport.update({
39
- id: '/account',
40
- path: '/account',
41
- getParentRoute: () => rootRouteImport,
42
- } as any)
43
- const AuditRoute = AuditRouteImport.update({
44
- id: '/audit',
45
- path: '/audit',
46
- getParentRoute: () => rootRouteImport,
47
- } as any)
48
- const LoginRoute = LoginRouteImport.update({
49
- id: '/login',
50
- path: '/login',
51
- getParentRoute: () => rootRouteImport,
52
- } as any)
53
- const SettingsRoute = SettingsRouteImport.update({
54
- id: '/settings',
55
- path: '/settings',
56
- getParentRoute: () => rootRouteImport,
57
- } as any)
58
- const UnregisteredRoute = UnregisteredRouteImport.update({
59
- id: '/unregistered',
60
- path: '/unregistered',
61
- getParentRoute: () => rootRouteImport,
62
- } as any)
63
- const AuthDeviceRoute = AuthDeviceRouteImport.update({
64
- id: '/auth/device',
65
- path: '/auth/device',
66
- getParentRoute: () => rootRouteImport,
67
- } as any)
68
- const ProjectsIndexRoute = ProjectsIndexRouteImport.update({
69
- id: '/projects/',
70
- path: '/projects/',
71
- getParentRoute: () => rootRouteImport,
72
- } as any)
73
- const TokensIndexRoute = TokensIndexRouteImport.update({
74
- id: '/tokens/',
75
- path: '/tokens/',
76
- getParentRoute: () => rootRouteImport,
77
- } as any)
78
- const TokensTokenRoute = TokensTokenRouteImport.update({
79
- id: '/tokens/$token',
80
- path: '/tokens/$token',
81
- getParentRoute: () => rootRouteImport,
82
- } as any)
83
- const UsersIndexRoute = UsersIndexRouteImport.update({
84
- id: '/users/',
85
- path: '/users/',
86
- getParentRoute: () => rootRouteImport,
87
- } as any)
88
- const UsersUserRoute = UsersUserRouteImport.update({
89
- id: '/users/$user',
90
- path: '/users/$user',
91
- getParentRoute: () => rootRouteImport,
92
- } as any)
93
- const ProjectsProjectIndexRoute = ProjectsProjectIndexRouteImport.update({
94
- id: '/projects/$project/',
95
- path: '/projects/$project/',
96
- getParentRoute: () => rootRouteImport,
97
- } as any)
98
- const ProjectsProjectEnvironmentRoute =
99
- ProjectsProjectEnvironmentRouteImport.update({
100
- id: '/projects/$project/$environment',
101
- path: '/projects/$project/$environment',
102
- getParentRoute: () => rootRouteImport,
103
- } as any)
104
-
105
- export interface FileRoutesByFullPath {
106
- '/': typeof IndexRoute
107
- '/access': typeof AccessRoute
108
- '/account': typeof AccountRoute
109
- '/audit': typeof AuditRoute
110
- '/login': typeof LoginRoute
111
- '/settings': typeof SettingsRoute
112
- '/unregistered': typeof UnregisteredRoute
113
- '/auth/device': typeof AuthDeviceRoute
114
- '/tokens/$token': typeof TokensTokenRoute
115
- '/users/$user': typeof UsersUserRoute
116
- '/projects/': typeof ProjectsIndexRoute
117
- '/tokens/': typeof TokensIndexRoute
118
- '/users/': typeof UsersIndexRoute
119
- '/projects/$project/$environment': typeof ProjectsProjectEnvironmentRoute
120
- '/projects/$project/': typeof ProjectsProjectIndexRoute
121
- }
122
- export interface FileRoutesByTo {
123
- '/': typeof IndexRoute
124
- '/access': typeof AccessRoute
125
- '/account': typeof AccountRoute
126
- '/audit': typeof AuditRoute
127
- '/login': typeof LoginRoute
128
- '/settings': typeof SettingsRoute
129
- '/unregistered': typeof UnregisteredRoute
130
- '/auth/device': typeof AuthDeviceRoute
131
- '/tokens/$token': typeof TokensTokenRoute
132
- '/users/$user': typeof UsersUserRoute
133
- '/projects': typeof ProjectsIndexRoute
134
- '/tokens': typeof TokensIndexRoute
135
- '/users': typeof UsersIndexRoute
136
- '/projects/$project/$environment': typeof ProjectsProjectEnvironmentRoute
137
- '/projects/$project': typeof ProjectsProjectIndexRoute
138
- }
139
- export interface FileRoutesById {
140
- __root__: typeof rootRouteImport
141
- '/': typeof IndexRoute
142
- '/access': typeof AccessRoute
143
- '/account': typeof AccountRoute
144
- '/audit': typeof AuditRoute
145
- '/login': typeof LoginRoute
146
- '/settings': typeof SettingsRoute
147
- '/unregistered': typeof UnregisteredRoute
148
- '/auth/device': typeof AuthDeviceRoute
149
- '/tokens/$token': typeof TokensTokenRoute
150
- '/users/$user': typeof UsersUserRoute
151
- '/projects/': typeof ProjectsIndexRoute
152
- '/tokens/': typeof TokensIndexRoute
153
- '/users/': typeof UsersIndexRoute
154
- '/projects/$project/$environment': typeof ProjectsProjectEnvironmentRoute
155
- '/projects/$project/': typeof ProjectsProjectIndexRoute
156
- }
157
- export interface FileRouteTypes {
158
- fileRoutesByFullPath: FileRoutesByFullPath
159
- fullPaths:
160
- | '/'
161
- | '/access'
162
- | '/account'
163
- | '/audit'
164
- | '/login'
165
- | '/settings'
166
- | '/unregistered'
167
- | '/auth/device'
168
- | '/tokens/$token'
169
- | '/users/$user'
170
- | '/projects/'
171
- | '/tokens/'
172
- | '/users/'
173
- | '/projects/$project/$environment'
174
- | '/projects/$project/'
175
- fileRoutesByTo: FileRoutesByTo
176
- to:
177
- | '/'
178
- | '/access'
179
- | '/account'
180
- | '/audit'
181
- | '/login'
182
- | '/settings'
183
- | '/unregistered'
184
- | '/auth/device'
185
- | '/tokens/$token'
186
- | '/users/$user'
187
- | '/projects'
188
- | '/tokens'
189
- | '/users'
190
- | '/projects/$project/$environment'
191
- | '/projects/$project'
192
- id:
193
- | '__root__'
194
- | '/'
195
- | '/access'
196
- | '/account'
197
- | '/audit'
198
- | '/login'
199
- | '/settings'
200
- | '/unregistered'
201
- | '/auth/device'
202
- | '/tokens/$token'
203
- | '/users/$user'
204
- | '/projects/'
205
- | '/tokens/'
206
- | '/users/'
207
- | '/projects/$project/$environment'
208
- | '/projects/$project/'
209
- fileRoutesById: FileRoutesById
210
- }
211
- export interface RootRouteChildren {
212
- IndexRoute: typeof IndexRoute
213
- AccessRoute: typeof AccessRoute
214
- AccountRoute: typeof AccountRoute
215
- AuditRoute: typeof AuditRoute
216
- LoginRoute: typeof LoginRoute
217
- SettingsRoute: typeof SettingsRoute
218
- UnregisteredRoute: typeof UnregisteredRoute
219
- AuthDeviceRoute: typeof AuthDeviceRoute
220
- TokensTokenRoute: typeof TokensTokenRoute
221
- UsersUserRoute: typeof UsersUserRoute
222
- ProjectsIndexRoute: typeof ProjectsIndexRoute
223
- TokensIndexRoute: typeof TokensIndexRoute
224
- UsersIndexRoute: typeof UsersIndexRoute
225
- ProjectsProjectEnvironmentRoute: typeof ProjectsProjectEnvironmentRoute
226
- ProjectsProjectIndexRoute: typeof ProjectsProjectIndexRoute
227
- }
228
-
229
- declare module '@tanstack/react-router' {
230
- interface FileRoutesByPath {
231
- '/': {
232
- id: '/'
233
- path: '/'
234
- fullPath: '/'
235
- preLoaderRoute: typeof IndexRouteImport
236
- parentRoute: typeof rootRouteImport
237
- }
238
- '/access': {
239
- id: '/access'
240
- path: '/access'
241
- fullPath: '/access'
242
- preLoaderRoute: typeof AccessRouteImport
243
- parentRoute: typeof rootRouteImport
244
- }
245
- '/account': {
246
- id: '/account'
247
- path: '/account'
248
- fullPath: '/account'
249
- preLoaderRoute: typeof AccountRouteImport
250
- parentRoute: typeof rootRouteImport
251
- }
252
- '/audit': {
253
- id: '/audit'
254
- path: '/audit'
255
- fullPath: '/audit'
256
- preLoaderRoute: typeof AuditRouteImport
257
- parentRoute: typeof rootRouteImport
258
- }
259
- '/login': {
260
- id: '/login'
261
- path: '/login'
262
- fullPath: '/login'
263
- preLoaderRoute: typeof LoginRouteImport
264
- parentRoute: typeof rootRouteImport
265
- }
266
- '/settings': {
267
- id: '/settings'
268
- path: '/settings'
269
- fullPath: '/settings'
270
- preLoaderRoute: typeof SettingsRouteImport
271
- parentRoute: typeof rootRouteImport
272
- }
273
- '/unregistered': {
274
- id: '/unregistered'
275
- path: '/unregistered'
276
- fullPath: '/unregistered'
277
- preLoaderRoute: typeof UnregisteredRouteImport
278
- parentRoute: typeof rootRouteImport
279
- }
280
- '/auth/device': {
281
- id: '/auth/device'
282
- path: '/auth/device'
283
- fullPath: '/auth/device'
284
- preLoaderRoute: typeof AuthDeviceRouteImport
285
- parentRoute: typeof rootRouteImport
286
- }
287
- '/projects/': {
288
- id: '/projects/'
289
- path: '/projects'
290
- fullPath: '/projects/'
291
- preLoaderRoute: typeof ProjectsIndexRouteImport
292
- parentRoute: typeof rootRouteImport
293
- }
294
- '/tokens/': {
295
- id: '/tokens/'
296
- path: '/tokens'
297
- fullPath: '/tokens/'
298
- preLoaderRoute: typeof TokensIndexRouteImport
299
- parentRoute: typeof rootRouteImport
300
- }
301
- '/tokens/$token': {
302
- id: '/tokens/$token'
303
- path: '/tokens/$token'
304
- fullPath: '/tokens/$token'
305
- preLoaderRoute: typeof TokensTokenRouteImport
306
- parentRoute: typeof rootRouteImport
307
- }
308
- '/users/': {
309
- id: '/users/'
310
- path: '/users'
311
- fullPath: '/users/'
312
- preLoaderRoute: typeof UsersIndexRouteImport
313
- parentRoute: typeof rootRouteImport
314
- }
315
- '/users/$user': {
316
- id: '/users/$user'
317
- path: '/users/$user'
318
- fullPath: '/users/$user'
319
- preLoaderRoute: typeof UsersUserRouteImport
320
- parentRoute: typeof rootRouteImport
321
- }
322
- '/projects/$project/': {
323
- id: '/projects/$project/'
324
- path: '/projects/$project'
325
- fullPath: '/projects/$project/'
326
- preLoaderRoute: typeof ProjectsProjectIndexRouteImport
327
- parentRoute: typeof rootRouteImport
328
- }
329
- '/projects/$project/$environment': {
330
- id: '/projects/$project/$environment'
331
- path: '/projects/$project/$environment'
332
- fullPath: '/projects/$project/$environment'
333
- preLoaderRoute: typeof ProjectsProjectEnvironmentRouteImport
334
- parentRoute: typeof rootRouteImport
335
- }
336
- }
337
- }
338
-
339
- const rootRouteChildren: RootRouteChildren = {
340
- IndexRoute: IndexRoute,
341
- AccessRoute: AccessRoute,
342
- AccountRoute: AccountRoute,
343
- AuditRoute: AuditRoute,
344
- LoginRoute: LoginRoute,
345
- SettingsRoute: SettingsRoute,
346
- UnregisteredRoute: UnregisteredRoute,
347
- AuthDeviceRoute: AuthDeviceRoute,
348
- TokensTokenRoute: TokensTokenRoute,
349
- UsersUserRoute: UsersUserRoute,
350
- ProjectsIndexRoute: ProjectsIndexRoute,
351
- TokensIndexRoute: TokensIndexRoute,
352
- UsersIndexRoute: UsersIndexRoute,
353
- ProjectsProjectEnvironmentRoute: ProjectsProjectEnvironmentRoute,
354
- ProjectsProjectIndexRoute: ProjectsProjectIndexRoute,
355
- }
356
- export const routeTree = rootRouteImport
357
- ._addFileChildren(rootRouteChildren)
358
- ._addFileTypes<FileRouteTypes>()
359
-
360
- import type { getRouter } from './router.tsx'
361
- import type { createStart } from '@tanstack/react-start'
362
- declare module '@tanstack/react-start' {
363
- interface Register {
364
- ssr: true
365
- router: Awaited<ReturnType<typeof getRouter>>
366
- }
367
- }
@@ -1,169 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import {
3
- createRootRouteWithContext,
4
- HeadContent,
5
- Outlet,
6
- redirect,
7
- ScriptOnce,
8
- Scripts,
9
- useRouterState,
10
- } from '@tanstack/react-router';
11
- import { Toaster } from 'sonner';
12
- import globalsCss from '../styles/globals.css?url';
13
- import { loadShell } from '../lib/queries';
14
- import { useShell } from '../lib/use-shell';
15
- import type { RouterContext } from '../router';
16
- import { Brand, Shell, sidebarBootScript } from '../components/shell';
17
- import { TooltipProvider } from '../components/ui';
18
- import { ThemeToggle, themeBootScript } from '../components/theme';
19
- import { Agentation } from '../components/agentation';
20
- import { LiveRegion } from '../components/row-state';
21
- import { markSvg } from '../components/mark';
22
- import faviconPng from '../assets/favicon-32.png?url';
23
- import appleTouchIcon from '../assets/apple-touch-icon.png?url';
24
-
25
- export const Route = createRootRouteWithContext<RouterContext>()({
26
- head: () => ({
27
- meta: [
28
- { charSet: 'utf-8' },
29
- { name: 'viewport', content: 'width=device-width, initial-scale=1' },
30
- { title: 'coffre' },
31
- { name: 'description', content: 'Secrets, with an audit log' },
32
- ],
33
- links: [
34
- { rel: 'stylesheet', href: globalsCss },
35
- // Inline, so the icons need no route of their own: in Cloudflare mode
36
- // every path but the health checks is behind Access. Vite inlines the
37
- // PNGs too, being small. The PNG is for browsers without SVG icons;
38
- // sized, so the others still pick the SVG.
39
- { rel: 'icon', type: 'image/png', sizes: '32x32', href: faviconPng },
40
- { rel: 'icon', type: 'image/svg+xml', href: `data:image/svg+xml,${encodeURIComponent(markSvg(16, { adaptive: true }))}` },
41
- { rel: 'apple-touch-icon', href: appleTouchIcon },
42
- ],
43
- }),
44
-
45
- // Identity and the project tree, which the shell needs on every screen.
46
- loader: async ({ context: { client, queryClient }, location }) => {
47
- const shell = await loadShell(queryClient, client);
48
-
49
- if (shell.registrationRequired && location.pathname !== '/unregistered') {
50
- throw redirect({ to: '/unregistered' });
51
- }
52
-
53
- // Signed out, the app has nothing to show. Letting it be browsed anyway
54
- // put a "you are not signed in" notice in the middle of every page, which
55
- // reads as a broken screen rather than as a closed door. Where they were
56
- // headed rides along so signing in resumes it.
57
- if (shell.principal === null && location.pathname !== '/login') {
58
- throw redirect({ to: '/login', search: { next: location.href } });
59
- }
60
-
61
- // Once the API has authenticated the caller, the sign-in page, or behind
62
- // Access the page explaining why it could not, has no place on screen.
63
- if (shell.principal !== null && location.pathname === '/login') {
64
- throw redirect({ to: '/projects' });
65
- }
66
- if (
67
- shell.principal !== null &&
68
- !shell.registrationRequired &&
69
- location.pathname === '/unregistered'
70
- ) {
71
- throw redirect({ to: '/projects' });
72
- }
73
- },
74
-
75
- shellComponent: RootDocument,
76
- component: RootComponent,
77
- });
78
-
79
- function RootDocument({ children }: { children: ReactNode }) {
80
- return (
81
- <html lang="en" suppressHydrationWarning>
82
- <head>
83
- <HeadContent />
84
- {/* Must run before first paint; see the comments on each script.
85
- ScriptOnce gives them the page's CSP nonce, and removes them
86
- once run so hydration finds nothing to reconcile. */}
87
- <ScriptOnce>{themeBootScript}</ScriptOnce>
88
- <ScriptOnce>{sidebarBootScript}</ScriptOnce>
89
- </head>
90
- <body>
91
- {children}
92
- <Scripts />
93
- </body>
94
- </html>
95
- );
96
- }
97
-
98
- function Toasts() {
99
- return (
100
- <Toaster
101
- position="bottom-right"
102
- gap={10}
103
- offset={20}
104
- toastOptions={{
105
- duration: 4200,
106
- unstyled: true,
107
- classNames: {
108
- toast: 'toast',
109
- title: 'toast-title',
110
- description: 'toast-description',
111
- actionButton: 'toast-action',
112
- success: 'toast-success',
113
- error: 'toast-error',
114
- },
115
- }}
116
- />
117
- );
118
- }
119
-
120
- function RootComponent() {
121
- const { principal, instanceRole, projects, capabilities, instance } = useShell();
122
- const pathname = useRouterState({ select: (state) => state.location.pathname });
123
-
124
- // Sign-in gets no navigation. Every destination in the sidebar and the
125
- // command palette bounces straight back here while you are signed out, so
126
- // offering them is a loop dressed up as navigation. The brand stays, as a
127
- // mark rather than a link, so the page is still recognisably this app.
128
- // Approving a CLI sign-in is the same kind of single-purpose stop.
129
- if (pathname === '/login' || pathname === '/unregistered' || pathname === '/auth/device') {
130
- return (
131
- <TooltipProvider>
132
- <div className="solo">
133
- <div className="solo-top">
134
- <Brand />
135
- <ThemeToggle />
136
- </div>
137
- <main className="solo-main" id="content">
138
- <Outlet />
139
- </main>
140
- </div>
141
- <Toasts />
142
- <LiveRegion />
143
- <Agentation />
144
- </TooltipProvider>
145
- );
146
- }
147
-
148
- return (
149
- <TooltipProvider>
150
- <a className="skip-link" href="#content">
151
- Skip to content
152
- </a>
153
-
154
- <Shell
155
- projects={projects}
156
- principal={principal}
157
- instanceRole={instanceRole}
158
- capabilities={capabilities}
159
- instance={instance}
160
- >
161
- <Outlet />
162
- </Shell>
163
-
164
- <Toasts />
165
- <LiveRegion />
166
- <Agentation />
167
- </TooltipProvider>
168
- );
169
- }
@@ -1,11 +0,0 @@
1
- import { createFileRoute, redirect } from '@tanstack/react-router';
2
-
3
- /**
4
- * The directory used to be one page here. It is now Users and Tokens; the
5
- * old address still lands somewhere sensible for bookmarks and links.
6
- */
7
- export const Route = createFileRoute('/access')({
8
- beforeLoad: () => {
9
- throw redirect({ to: '/users' });
10
- },
11
- });
@@ -1,15 +0,0 @@
1
- import { createFileRoute, redirect } from '@tanstack/react-router';
2
-
3
- /**
4
- * The root is the project list, one level up.
5
- *
6
- * Projects live under `/projects/:slug` rather than at `/:slug` so that a
7
- * project may be called `audit` or `login` without shadowing the page of that
8
- * name. Nothing renders here; `/` only exists so the obvious URL still lands
9
- * somewhere.
10
- */
11
- export const Route = createFileRoute('/')({
12
- beforeLoad: () => {
13
- throw redirect({ to: '/projects' });
14
- },
15
- });
@@ -1,13 +0,0 @@
1
- import { createFileRoute } from '@tanstack/react-router';
2
- import { PrincipalPage } from '../components/principal-page';
3
- import { loadPrincipal } from '../lib/queries';
4
-
5
- export const Route = createFileRoute('/users/$user')({
6
- loader: ({ context: { client, queryClient }, params }) => loadPrincipal(queryClient, client, 'user', params.user),
7
- component: UserPage,
8
- });
9
-
10
- function UserPage() {
11
- const { user } = Route.useParams();
12
- return <PrincipalPage principalType="user" principalId={user} />;
13
- }
package/src/types.ts DELETED
@@ -1,21 +0,0 @@
1
- // `@coffre/ui`'s public types, which its `.d.ts` is built from. The package
2
- // itself is the Start build of `entry.ts`.
3
- import type { CoffreClient } from '@coffre/client';
4
-
5
- export type { CoffreClient };
6
-
7
- /** What each page request needs from the server around it. */
8
- export type UiContext = {
9
- /** This response's Content-Security-Policy nonce, put on every script the page renders. */
10
- cspNonce: string;
11
- /** The API as the visitor, which every loader reads through; see `@coffre/server`. */
12
- client: CoffreClient;
13
- };
14
-
15
- /** coffre's pages: HTML for a GET or HEAD, with no API, database or configuration of its own. */
16
- export type Ui = {
17
- fetch(request: Request, init: { context: UiContext }): Promise<Response>;
18
- };
19
-
20
- /** The pages' handler. Its static files are in `dist/client`, served under `/_coffre/`. */
21
- export declare function createUi(): Ui;