@coffre/ui 0.6.1 → 0.7.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 (119) hide show
  1. package/dist/chunks/{audit-sentence-CUUMshIp.js → audit-sentence-C1_gRxWW.js} +91 -26
  2. package/dist/chunks/audit-sentence-C1_gRxWW.js.map +1 -0
  3. package/dist/chunks/{connected-apps-DTpatjge.js → connected-apps-Bn5rEoV2.js} +4 -4
  4. package/dist/chunks/{connected-apps-DTpatjge.js.map → connected-apps-Bn5rEoV2.js.map} +1 -1
  5. package/dist/chunks/{delete-place-SOOYVt6A.js → delete-place-CQCDHkne.js} +4 -4
  6. package/dist/chunks/{delete-place-SOOYVt6A.js.map → delete-place-CQCDHkne.js.map} +1 -1
  7. package/dist/chunks/{directory-DrtdKny2.js → directory-BQNOdze_.js} +22 -19
  8. package/dist/chunks/directory-BQNOdze_.js.map +1 -0
  9. package/dist/chunks/{folders-hR2Lnk0k.js → folders-Dw240WMJ.js} +2 -2
  10. package/dist/chunks/{folders-hR2Lnk0k.js.map → folders-Dw240WMJ.js.map} +1 -1
  11. package/dist/chunks/{grants-DDBui9YD.js → grants-CJIBrkod.js} +5 -5
  12. package/dist/chunks/{grants-DDBui9YD.js.map → grants-CJIBrkod.js.map} +1 -1
  13. package/dist/chunks/multi-combobox-CsIXihuc.js +99 -0
  14. package/dist/chunks/multi-combobox-CsIXihuc.js.map +1 -0
  15. package/dist/chunks/{offboarding-C7ECW5o0.js → offboarding-CrgwaetA.js} +4 -4
  16. package/dist/chunks/offboarding-CrgwaetA.js.map +1 -0
  17. package/dist/chunks/personal-tokens-B8rkT-DI.js +138 -0
  18. package/dist/chunks/personal-tokens-B8rkT-DI.js.map +1 -0
  19. package/dist/chunks/{principal-page-CB6dAABC.js → principal-page-DDmmV1KQ.js} +37 -27
  20. package/dist/chunks/principal-page-DDmmV1KQ.js.map +1 -0
  21. package/dist/chunks/{project-page-BHNUvr2L.js → project-page-BI--vjt3.js} +2 -2
  22. package/dist/chunks/{project-page-BHNUvr2L.js.map → project-page-BI--vjt3.js.map} +1 -1
  23. package/dist/chunks/{queries-DgQo3mC-.js → queries-epz4MIuW.js} +103 -18
  24. package/dist/chunks/queries-epz4MIuW.js.map +1 -0
  25. package/dist/chunks/{references-BQc35Q9g.js → references-DImfw0cz.js} +4 -4
  26. package/dist/chunks/{references-BQc35Q9g.js.map → references-DImfw0cz.js.map} +1 -1
  27. package/dist/chunks/{role-field-BfWRCqzl.js → role-field-C1KhNaIR.js} +2 -2
  28. package/dist/chunks/{role-field-BfWRCqzl.js.map → role-field-C1KhNaIR.js.map} +1 -1
  29. package/dist/chunks/{row-state-Zf3kZVhd.js → row-state-BsIHspy4.js} +2 -2
  30. package/dist/chunks/{row-state-Zf3kZVhd.js.map → row-state-BsIHspy4.js.map} +1 -1
  31. package/dist/chunks/{theme-B6-V9JvY.js → theme-3b4DnCow.js} +2 -2
  32. package/dist/chunks/{theme-B6-V9JvY.js.map → theme-3b4DnCow.js.map} +1 -1
  33. package/dist/chunks/{ui-Br-dNUTc.js → ui-2kwXXfrX.js} +95 -22
  34. package/dist/chunks/ui-2kwXXfrX.js.map +1 -0
  35. package/dist/chunks/{use-action-DthL5hL8.js → use-action-BB-RcHo1.js} +2 -2
  36. package/dist/chunks/{use-action-DthL5hL8.js.map → use-action-BB-RcHo1.js.map} +1 -1
  37. package/dist/chunks/{use-change-By4cG8bT.js → use-change-CQyDpCqw.js} +323 -31
  38. package/dist/chunks/use-change-CQyDpCqw.js.map +1 -0
  39. package/dist/chunks/{use-shell-D6kjSPls.js → use-shell-C_NmvCt_.js} +2 -2
  40. package/dist/chunks/{use-shell-D6kjSPls.js.map → use-shell-C_NmvCt_.js.map} +1 -1
  41. package/dist/index.d.ts +46 -164
  42. package/dist/index.js +143 -129
  43. package/dist/index.js.map +1 -1
  44. package/dist/pages/account.d.ts +1 -1
  45. package/dist/pages/account.js +29 -12
  46. package/dist/pages/account.js.map +1 -1
  47. package/dist/pages/approval.js +1 -1
  48. package/dist/pages/audit.js +96 -90
  49. package/dist/pages/audit.js.map +1 -1
  50. package/dist/pages/device-login.js +1 -1
  51. package/dist/pages/environment.js +949 -412
  52. package/dist/pages/environment.js.map +1 -1
  53. package/dist/pages/login.js +2 -2
  54. package/dist/pages/oauth-authorize.js +1 -1
  55. package/dist/pages/project-access.js +9 -9
  56. package/dist/pages/project-access.js.map +1 -1
  57. package/dist/pages/project-environments.js +112 -64
  58. package/dist/pages/project-environments.js.map +1 -1
  59. package/dist/pages/project-settings.d.ts +1 -1
  60. package/dist/pages/project-settings.js +54 -75
  61. package/dist/pages/project-settings.js.map +1 -1
  62. package/dist/pages/project.js +3 -7
  63. package/dist/pages/project.js.map +1 -1
  64. package/dist/pages/projects.js +50 -77
  65. package/dist/pages/projects.js.map +1 -1
  66. package/dist/pages/service-account.js +284 -160
  67. package/dist/pages/service-account.js.map +1 -1
  68. package/dist/pages/service-accounts.js +4 -4
  69. package/dist/pages/settings.js +5 -5
  70. package/dist/pages/unregistered.js +1 -1
  71. package/dist/pages/user.js +5 -5
  72. package/dist/pages/users.js +4 -4
  73. package/package.json +3 -3
  74. package/src/components/actions-log.tsx +3 -2
  75. package/src/components/command-palette.tsx +4 -5
  76. package/src/components/directory.tsx +7 -14
  77. package/src/components/generate-value.tsx +15 -7
  78. package/src/components/missing.tsx +63 -67
  79. package/src/components/offboarding.tsx +1 -1
  80. package/src/components/personal-tokens.tsx +131 -0
  81. package/src/components/principal-page.tsx +30 -17
  82. package/src/components/regenerate.tsx +72 -0
  83. package/src/components/service-tokens.tsx +5 -14
  84. package/src/components/shell.tsx +79 -75
  85. package/src/components/trusted-workloads.tsx +179 -19
  86. package/src/components/ui.tsx +35 -25
  87. package/src/lib/audit-sentences.ts +100 -12
  88. package/src/lib/bindings.ts +41 -3
  89. package/src/lib/changes.ts +215 -29
  90. package/src/lib/clipboard.ts +40 -0
  91. package/src/lib/copy-attempts.ts +103 -0
  92. package/src/lib/dismissal.ts +24 -0
  93. package/src/lib/generate.ts +3 -146
  94. package/src/lib/optimistic.ts +3 -1
  95. package/src/lib/queries.ts +121 -17
  96. package/src/lib/recipes.ts +63 -0
  97. package/src/lib/reveal.ts +7 -1
  98. package/src/lib/row-reads.ts +64 -0
  99. package/src/lib/secret-edit-batch.ts +64 -5
  100. package/src/options.ts +43 -51
  101. package/src/pages/account.tsx +27 -5
  102. package/src/pages/audit.tsx +38 -31
  103. package/src/pages/environment.tsx +655 -121
  104. package/src/pages/project-access.tsx +1 -1
  105. package/src/pages/project-environments.tsx +92 -45
  106. package/src/pages/project-settings.tsx +9 -20
  107. package/src/pages/project.tsx +1 -5
  108. package/src/pages/projects.tsx +13 -28
  109. package/src/parity.ts +20 -4
  110. package/src/styles/globals.css +143 -131
  111. package/dist/chunks/audit-sentence-CUUMshIp.js.map +0 -1
  112. package/dist/chunks/directory-DrtdKny2.js.map +0 -1
  113. package/dist/chunks/offboarding-C7ECW5o0.js.map +0 -1
  114. package/dist/chunks/principal-page-CB6dAABC.js.map +0 -1
  115. package/dist/chunks/project-environments-lEzFHUt4.js +0 -11
  116. package/dist/chunks/project-environments-lEzFHUt4.js.map +0 -1
  117. package/dist/chunks/queries-DgQo3mC-.js.map +0 -1
  118. package/dist/chunks/ui-Br-dNUTc.js.map +0 -1
  119. package/dist/chunks/use-change-By4cG8bT.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,12 +1,11 @@
1
- import { n as isActiveAccessibleEnvironment } from "./chunks/project-environments-lEzFHUt4.js";
1
+ import { E as isActiveAccessibleEnvironment, S as tabOpens, _ as projectOf, c as loadEnvironment, d as loadProject, f as loadServiceDirectory, h as loadSignIn, l as loadMember, m as loadShell, n as createQueryClient, p as loadSettings, r as hasAppsTab, s as loadDirectory, u as loadPrincipal, v as queries } from "./chunks/queries-epz4MIuW.js";
2
2
  import { t as useMounted } from "./chunks/mounted-jJmqqV_n.js";
3
- import { _ as rememberSidebar, d as Tip, g as browserPreferences, h as PreferencesContext, o as MenuPopup, p as TooltipProvider, v as rememberTheme, y as usePreferences } from "./chunks/ui-Br-dNUTc.js";
3
+ import { _ as PreferencesContext, b as rememberTheme, d as Tip, o as MenuPopup, p as TooltipProvider, v as browserPreferences, x as usePreferences, y as rememberSidebar } from "./chunks/ui-2kwXXfrX.js";
4
4
  import { a as administrationEntries, t as AdministrationItems } from "./chunks/affordances-Dtyha68j.js";
5
5
  import { $ as SlashCircle, B as Monitor, E as Folder, J as Search, M as Key, N as Layers, O as GitHub, P as Ledger, Q as SignOut, R as Mark, U as PanelLeft, V as Moon, Y as Settings, _ as Check, at as UserCog, d as Tile, et as Sun, l as uiResult, m as AlertTriangle, n as ClosedDoor, ot as Users, s as memberRef, st as X, u as useCoffre, x as ChevronsUpDown, z as Menu$1 } from "./chunks/page-JTORvh-N.js";
6
- import { n as ThemeMenuItems, r as ThemeToggle } from "./chunks/theme-B6-V9JvY.js";
7
- import { n as LiveRegion } from "./chunks/row-state-Zf3kZVhd.js";
8
- import { c as loadDirectory, d as loadServiceDirectory, f as loadSettings, g as queries, h as projectOf, l as loadMember, n as createQueryClient, p as loadShell, r as hasAppsTab, s as loadAccess, u as loadProject, y as signInWays } from "./chunks/queries-DgQo3mC-.js";
9
- import { t as useShell } from "./chunks/use-shell-D6kjSPls.js";
6
+ import { n as ThemeMenuItems, r as ThemeToggle } from "./chunks/theme-3b4DnCow.js";
7
+ import { n as LiveRegion } from "./chunks/row-state-BsIHspy4.js";
8
+ import { t as useShell } from "./chunks/use-shell-C_NmvCt_.js";
10
9
  import { t as loginSearch } from "./chunks/signin-errors-TlQmQe0t.js";
11
10
  import { useEffect, useMemo, useRef, useState } from "react";
12
11
  import { Link, Outlet, createRouter as createRouter$1, redirect, useNavigate, useRouter, useRouterState } from "@tanstack/react-router";
@@ -62,7 +61,7 @@ function CommandPalette({ projects, capabilities }) {
62
61
  {
63
62
  value: "Environments",
64
63
  items: active.flatMap((project) => project.environments.filter(isActiveAccessibleEnvironment).map((environment) => ({
65
- value: `${project.slug}/${environment.slug} ${environment.name}`,
64
+ value: `${project.slug}/${environment.slug}`,
66
65
  icon: /* @__PURE__ */ jsx(Layers, { size: 15 }),
67
66
  label: /* @__PURE__ */ jsxs("span", {
68
67
  className: "mono",
@@ -86,13 +85,12 @@ function CommandPalette({ projects, capabilities }) {
86
85
  {
87
86
  value: "Projects",
88
87
  items: active.map((project) => ({
89
- value: `${project.slug} ${project.name}`,
88
+ value: project.slug,
90
89
  icon: /* @__PURE__ */ jsx(Folder, { size: 15 }),
91
90
  label: /* @__PURE__ */ jsx("span", {
92
91
  className: "mono",
93
92
  children: project.slug
94
93
  }),
95
- hint: project.name,
96
94
  path: "/projects/$project",
97
95
  run: closing(() => navigate({
98
96
  to: "/projects/$project",
@@ -137,11 +135,14 @@ function CommandPalette({ projects, capabilities }) {
137
135
  }, {
138
136
  value: "audit denials denied refused",
139
137
  icon: /* @__PURE__ */ jsx(SlashCircle, { size: 15 }),
140
- label: "Audit, denials only",
138
+ label: "Audit, denials",
141
139
  path: "/audit",
142
140
  run: closing(() => navigate({
143
141
  to: "/audit",
144
- search: { decision: "deny" }
142
+ search: {
143
+ decision: "deny",
144
+ detail: "1"
145
+ }
145
146
  }))
146
147
  }]
147
148
  }),
@@ -595,14 +596,17 @@ function Breadcrumbs({ pathname, projects, canListPrincipals }) {
595
596
  children: /* @__PURE__ */ jsx("span", {
596
597
  className: "crumb-link",
597
598
  "aria-current": "page",
598
- children: /* @__PURE__ */ jsx("span", { children: projectSlug })
599
+ children: /* @__PURE__ */ jsx("span", {
600
+ className: "crumb-name",
601
+ children: projectSlug
602
+ })
599
603
  })
600
604
  })
601
605
  ]
602
606
  });
603
607
  }
604
608
  if (section !== "projects" || projectSlug === void 0) return null;
605
- const active = projects.filter((project) => project.archivedAt === null);
609
+ const listed = projects.filter((project) => project.archivedAt === null || project.slug === projectSlug);
606
610
  const project = projects.find((entry) => entry.slug === projectSlug);
607
611
  return /* @__PURE__ */ jsxs("nav", {
608
612
  className: "crumbs",
@@ -621,7 +625,7 @@ function Breadcrumbs({ pathname, projects, canListPrincipals }) {
621
625
  /* @__PURE__ */ jsx(ProjectCrumb, {
622
626
  slug: projectSlug,
623
627
  current: environmentSlug === void 0,
624
- projects: active
628
+ projects: listed
625
629
  }),
626
630
  environmentSlug !== void 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
627
631
  className: "crumb-sep",
@@ -635,97 +639,106 @@ function Breadcrumbs({ pathname, projects, canListPrincipals }) {
635
639
  ]
636
640
  });
637
641
  }
642
+ /**
643
+ * The project you are in, one button that lists every project. Its own
644
+ * page, all its environments, is the current one in that list. Each entry
645
+ * is a link, so the router fetches its page as it is pointed at or focused.
646
+ */
638
647
  function ProjectCrumb({ slug, current, projects }) {
639
- const navigate = useNavigate();
640
- return /* @__PURE__ */ jsxs("span", {
641
- className: "crumb",
642
- children: [/* @__PURE__ */ jsxs(Link, {
643
- className: "crumb-link",
644
- to: "/projects/$project",
645
- params: { project: slug },
646
- "aria-current": current ? "page" : void 0,
647
- children: [/* @__PURE__ */ jsx(Tile, { name: slug }), /* @__PURE__ */ jsx("span", {
648
- className: "crumb-project-name",
648
+ return /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Menu.Trigger, {
649
+ className: "crumb-link crumb-switch crumb-project",
650
+ "aria-label": `${slug}, switch project`,
651
+ "aria-current": current ? "page" : void 0,
652
+ children: [
653
+ /* @__PURE__ */ jsx(Tile, { name: slug }),
654
+ /* @__PURE__ */ jsx("span", {
655
+ className: "crumb-name crumb-project-name",
649
656
  children: slug
650
- })]
651
- }), /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsx(Menu.Trigger, {
652
- className: "crumb-switch",
653
- "aria-label": "Switch project",
654
- children: /* @__PURE__ */ jsx(ChevronsUpDown, { size: 14 })
655
- }), /* @__PURE__ */ jsx(MenuPopup, {
656
- align: "start",
657
- children: /* @__PURE__ */ jsxs(Menu.Group, { children: [/* @__PURE__ */ jsx(Menu.GroupLabel, {
658
- className: "menu-label",
659
- children: "Projects"
660
- }), projects.map((project) => /* @__PURE__ */ jsxs(Menu.Item, {
661
- className: "menu-item",
662
- onClick: () => navigate({
663
- to: "/projects/$project",
664
- params: { project: project.slug }
665
- }),
666
- children: [
667
- /* @__PURE__ */ jsx(Tile, { name: project.slug }),
668
- project.slug,
669
- /* @__PURE__ */ jsx("span", {
670
- className: "menu-hint",
671
- children: project.name
672
- }),
673
- project.slug === slug && /* @__PURE__ */ jsx(Check, {
674
- size: 14,
675
- className: "menu-check"
676
- })
677
- ]
678
- }, project.slug))] })
679
- })] })]
680
- });
657
+ }),
658
+ /* @__PURE__ */ jsx(ChevronsUpDown, {
659
+ size: 14,
660
+ className: "crumb-chevron"
661
+ })
662
+ ]
663
+ }), /* @__PURE__ */ jsx(MenuPopup, {
664
+ align: "start",
665
+ children: /* @__PURE__ */ jsxs(Menu.Group, { children: [/* @__PURE__ */ jsx(Menu.GroupLabel, {
666
+ className: "menu-label",
667
+ children: "Projects"
668
+ }), projects.map((project) => /* @__PURE__ */ jsxs(Menu.LinkItem, {
669
+ className: "menu-item",
670
+ closeOnClick: true,
671
+ render: /* @__PURE__ */ jsx(Link, {
672
+ to: "/projects/$project",
673
+ params: { project: project.slug }
674
+ }),
675
+ children: [
676
+ /* @__PURE__ */ jsx(Tile, { name: project.slug }),
677
+ project.slug,
678
+ project.slug === slug && /* @__PURE__ */ jsx(Check, {
679
+ size: 14,
680
+ className: "menu-check"
681
+ })
682
+ ]
683
+ }, project.slug))] })
684
+ })] });
681
685
  }
686
+ /** The environment you are in, one button that lists its siblings you can open, as links like the project's. */
682
687
  function EnvironmentCrumb({ projectSlug, slug, environments }) {
683
- const navigate = useNavigate();
684
- return /* @__PURE__ */ jsxs("span", {
685
- className: "crumb",
688
+ if (environments.length === 0) return /* @__PURE__ */ jsx("span", {
689
+ className: "crumb-link",
690
+ "aria-current": "page",
691
+ children: /* @__PURE__ */ jsx("span", {
692
+ className: "crumb-name",
693
+ children: slug
694
+ })
695
+ });
696
+ return /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Menu.Trigger, {
697
+ className: "crumb-link crumb-switch",
698
+ "aria-label": `${slug}, switch environment`,
699
+ "aria-current": "page",
686
700
  children: [/* @__PURE__ */ jsx("span", {
687
- className: "crumb-link",
688
- "aria-current": "page",
689
- children: /* @__PURE__ */ jsx("span", { children: slug })
690
- }), environments.length > 0 && /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsx(Menu.Trigger, {
691
- className: "crumb-switch",
692
- "aria-label": "Switch environment",
693
- children: /* @__PURE__ */ jsx(ChevronsUpDown, { size: 14 })
694
- }), /* @__PURE__ */ jsx(MenuPopup, {
695
- align: "start",
696
- children: /* @__PURE__ */ jsxs(Menu.Group, { children: [/* @__PURE__ */ jsxs(Menu.GroupLabel, {
697
- className: "menu-label",
698
- children: ["Environments in ", projectSlug]
699
- }), environments.map((environment) => /* @__PURE__ */ jsxs(Menu.Item, {
700
- className: "menu-item",
701
- onClick: () => navigate({
702
- to: "/projects/$project/$environment",
703
- params: {
704
- project: projectSlug,
705
- environment: environment.slug
706
- }
701
+ className: "crumb-name",
702
+ children: slug
703
+ }), /* @__PURE__ */ jsx(ChevronsUpDown, {
704
+ size: 14,
705
+ className: "crumb-chevron"
706
+ })]
707
+ }), /* @__PURE__ */ jsx(MenuPopup, {
708
+ align: "start",
709
+ children: /* @__PURE__ */ jsxs(Menu.Group, { children: [/* @__PURE__ */ jsxs(Menu.GroupLabel, {
710
+ className: "menu-label",
711
+ children: ["Environments in ", projectSlug]
712
+ }), environments.map((environment) => /* @__PURE__ */ jsxs(Menu.LinkItem, {
713
+ className: "menu-item",
714
+ closeOnClick: true,
715
+ render: /* @__PURE__ */ jsx(Link, {
716
+ to: "/projects/$project/$environment",
717
+ params: {
718
+ project: projectSlug,
719
+ environment: environment.slug
720
+ }
721
+ }),
722
+ children: [
723
+ /* @__PURE__ */ jsx("span", {
724
+ className: "mono",
725
+ children: environment.slug
707
726
  }),
708
- children: [
709
- /* @__PURE__ */ jsx("span", {
710
- className: "mono",
711
- children: environment.slug
712
- }),
713
- /* @__PURE__ */ jsxs("span", {
714
- className: "menu-hint",
715
- children: [
716
- environment.details?.secretCount ?? 0,
717
- " secret",
718
- environment.details?.secretCount === 1 ? "" : "s"
719
- ]
720
- }),
721
- environment.slug === slug && /* @__PURE__ */ jsx(Check, {
722
- size: 14,
723
- className: "menu-check"
724
- })
725
- ]
726
- }, environment.slug))] })
727
- })] })]
728
- });
727
+ /* @__PURE__ */ jsxs("span", {
728
+ className: "menu-hint",
729
+ children: [
730
+ environment.details?.secretCount ?? 0,
731
+ " secret",
732
+ environment.details?.secretCount === 1 ? "" : "s"
733
+ ]
734
+ }),
735
+ environment.slug === slug && /* @__PURE__ */ jsx(Check, {
736
+ size: 14,
737
+ className: "menu-check"
738
+ })
739
+ ]
740
+ }, environment.slug))] })
741
+ })] });
729
742
  }
730
743
  //#endregion
731
744
  //#region src/layout.tsx
@@ -1041,11 +1054,9 @@ async function projectTab(context, slug, permission) {
1041
1054
  /** `/projects/$project/$environment`. */
1042
1055
  var environment = {
1043
1056
  validateSearch: (search) => ({ filter: typeof search.filter === "string" && search.filter !== "" ? search.filter : void 0 }),
1044
- loader: async ({ context, params }) => {
1057
+ loader: ({ context, params }) => {
1045
1058
  const { coffre, queryClient } = coffreOf(context);
1046
- const secrets = await queryClient.fetchQuery(queries.secrets(coffre, params));
1047
- if (secrets.ok) await Promise.all([queryClient.fetchQuery(queries.references(coffre, `${params.project}/${params.environment}`)), queryClient.fetchQuery(queries.missing(coffre, params))]);
1048
- return secrets;
1059
+ return loadEnvironment(queryClient, coffre, params);
1049
1060
  }
1050
1061
  };
1051
1062
  /** `/audit`. */
@@ -1053,7 +1064,7 @@ var audit = {
1053
1064
  validateSearch: (search) => ({
1054
1065
  decision: search.decision === "deny" ? "deny" : void 0,
1055
1066
  actorId: typeof search.actorId === "string" && search.actorId !== "" ? search.actorId : void 0,
1056
- detail: search.detail === "1" ? "1" : void 0
1067
+ detail: search.detail === "1" || search.decision === "deny" ? "1" : void 0
1057
1068
  }),
1058
1069
  loaderDeps: ({ search }) => search,
1059
1070
  loader: ({ context, deps }) => {
@@ -1066,20 +1077,22 @@ var users = { loader: ({ context }) => {
1066
1077
  const { coffre, queryClient } = coffreOf(context);
1067
1078
  return loadDirectory(queryClient, coffre);
1068
1079
  } };
1069
- /** `/users/$user`, the layout of a user's tabs: who they are to the instance, for owners. */
1080
+ /**
1081
+ * `/users/$user`, the layout of a user's tabs: who they are to the instance,
1082
+ * for owners, and their access, for whoever manages it. Its tabs read what
1083
+ * it read from the cache (`Freshness`), so each opens at once.
1084
+ */
1070
1085
  var user = { loader: ({ context, params }) => {
1071
1086
  const { coffre, queryClient } = coffreOf(context);
1072
- return loadMember(queryClient, coffre, memberRef("user", params.user));
1073
- } };
1074
- /** `/users/$user/`, their access on every project where you manage it. */
1075
- var userAccess = { loader: ({ context, params }) => {
1076
- const { coffre, queryClient } = coffreOf(context);
1077
- return loadAccess(queryClient, coffre, memberRef("user", params.user));
1087
+ return loadPrincipal(queryClient, coffre, "user", params.user);
1078
1088
  } };
1089
+ /** `/users/$user/`, their access on every project where you manage it, which its layout reads. */
1090
+ var userAccess = {};
1079
1091
  /** `/users/$user/activity`, for whoever reads the audit log; the others are sent to the first tab. */
1080
1092
  var userActivity = { loader: async ({ context, params }) => {
1081
1093
  const { coffre, queryClient } = coffreOf(context);
1082
- if (!(await loadShell(queryClient, coffre)).capabilities.canReadAudit) throw redirect({
1094
+ const reads = async (freshness) => (await loadShell(queryClient, coffre, freshness)).capabilities.canReadAudit;
1095
+ if (!await tabOpens(reads)) throw redirect({
1083
1096
  to: "/users/$user",
1084
1097
  params
1085
1098
  });
@@ -1092,7 +1105,11 @@ var userActivity = { loader: async ({ context, params }) => {
1092
1105
  */
1093
1106
  var userApps = { loader: async ({ context, params }) => {
1094
1107
  const { coffre, queryClient } = coffreOf(context);
1095
- if (!hasAppsTab(await loadShell(queryClient, coffre), await loadMember(queryClient, coffre, memberRef("user", params.user)))) throw redirect({
1108
+ const has = async (freshness) => {
1109
+ const [shell, report] = await Promise.all([loadShell(queryClient, coffre, freshness), loadMember(queryClient, coffre, memberRef("user", params.user), freshness)]);
1110
+ return hasAppsTab(shell, report);
1111
+ };
1112
+ if (!await tabOpens(has)) throw redirect({
1096
1113
  to: "/users/$user",
1097
1114
  params
1098
1115
  });
@@ -1104,12 +1121,13 @@ var serviceAccounts = { loader: ({ context }) => {
1104
1121
  } };
1105
1122
  /**
1106
1123
  * `/service-accounts/$account`, the layout of a service account's tabs: who
1107
- * it is to the instance, for owners, and what it holds, for whoever manages it.
1124
+ * it is to the instance, for owners, what it holds, and how it signs in, for
1125
+ * whoever manages it. Its tabs read what it read from the cache
1126
+ * (`Freshness`), so each opens at once.
1108
1127
  */
1109
- var serviceAccount = { loader: async ({ context, params }) => {
1128
+ var serviceAccount = { loader: ({ context, params }) => {
1110
1129
  const { coffre, queryClient } = coffreOf(context);
1111
- const member = memberRef("service", params.account);
1112
- await Promise.all([loadMember(queryClient, coffre, member), loadAccess(queryClient, coffre, member)]);
1130
+ return loadPrincipal(queryClient, coffre, "service", params.account);
1113
1131
  } };
1114
1132
  /**
1115
1133
  * `/service-accounts/$account/`, how it signs in: its trusted workloads and
@@ -1118,24 +1136,19 @@ var serviceAccount = { loader: async ({ context, params }) => {
1118
1136
  */
1119
1137
  var serviceAccountSignIn = { loader: async ({ context, params }) => {
1120
1138
  const { coffre, queryClient } = coffreOf(context);
1121
- const member = memberRef("service", params.account);
1122
- const [shell, access] = await Promise.all([loadShell(queryClient, coffre), loadAccess(queryClient, coffre, member)]);
1123
- const ways = signInWays(shell, access);
1124
- if (ways === null) throw redirect({
1139
+ const shows = async (freshness) => await loadSignIn(queryClient, coffre, memberRef("service", params.account), freshness) !== null;
1140
+ if (!await tabOpens(shows)) throw redirect({
1125
1141
  to: "/service-accounts/$account/access",
1126
1142
  params
1127
1143
  });
1128
- await Promise.all([queryClient.fetchQuery(queries.credentials(coffre, member, ways.tokens)), queryClient.fetchQuery(queries.bindings(coffre, member, ways.workloads))]);
1129
- } };
1130
- /** `/service-accounts/$account/access`. */
1131
- var serviceAccountAccess = { loader: ({ context, params }) => {
1132
- const { coffre, queryClient } = coffreOf(context);
1133
- return loadAccess(queryClient, coffre, memberRef("service", params.account));
1134
1144
  } };
1145
+ /** `/service-accounts/$account/access`, which its layout reads. */
1146
+ var serviceAccountAccess = {};
1135
1147
  /** `/service-accounts/$account/activity`, as a user's. */
1136
1148
  var serviceAccountActivity = { loader: async ({ context, params }) => {
1137
1149
  const { coffre, queryClient } = coffreOf(context);
1138
- if (!(await loadShell(queryClient, coffre)).capabilities.canReadAudit) throw redirect({
1150
+ const reads = async (freshness) => (await loadShell(queryClient, coffre, freshness)).capabilities.canReadAudit;
1151
+ if (!await tabOpens(reads)) throw redirect({
1139
1152
  to: "/service-accounts/$account",
1140
1153
  params
1141
1154
  });
@@ -1173,7 +1186,8 @@ var accountProfile = {
1173
1186
  var accountSessions = { loader: async ({ context }) => {
1174
1187
  const { coffre, queryClient } = coffreOf(context);
1175
1188
  if (!await ownSignIn(context)) throw redirect({ to: "/account" });
1176
- await queryClient.fetchQuery(queries.sessions(coffre));
1189
+ const { principal } = await loadShell(queryClient, coffre);
1190
+ await Promise.all([queryClient.fetchQuery(queries.sessions(coffre)), ...principal?.type === "user" ? [queryClient.fetchQuery(queries.credentials(coffre, memberRef("user", principal.id), true))] : []]);
1177
1191
  } };
1178
1192
  /** `/account/apps`, how to connect an MCP client and the ones you connected, where the deployment serves MCP. */
1179
1193
  var accountApps = { loader: async ({ context }) => {