@coffre/ui 0.4.4 → 0.4.6

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 (85) hide show
  1. package/dist/chunks/{audit-sentence-BhHmvQX_.js → audit-sentence-DIztXvbU.js} +11 -2
  2. package/dist/chunks/audit-sentence-DIztXvbU.js.map +1 -0
  3. package/dist/chunks/{connected-apps-D8Df97-F.js → connected-apps-AZsX9Zvv.js} +2 -2
  4. package/dist/chunks/{connected-apps-D8Df97-F.js.map → connected-apps-AZsX9Zvv.js.map} +1 -1
  5. package/dist/chunks/{delete-place-LYN7z7xb.js → delete-place-D6LIZkg9.js} +4 -4
  6. package/dist/chunks/delete-place-D6LIZkg9.js.map +1 -0
  7. package/dist/chunks/{directory-v87HGjEn.js → directory-B6FuiCir.js} +5 -5
  8. package/dist/chunks/directory-B6FuiCir.js.map +1 -0
  9. package/dist/chunks/{folders-CbGU0xOz.js → folders-DvSqBhuu.js} +3 -3
  10. package/dist/chunks/folders-DvSqBhuu.js.map +1 -0
  11. package/dist/chunks/{offboarding-DdnmRV1f.js → offboarding-CLJaNTcD.js} +6 -6
  12. package/dist/chunks/offboarding-CLJaNTcD.js.map +1 -0
  13. package/dist/chunks/{principal-page-BubEO6-b.js → principal-page-1yMztIcc.js} +8 -8
  14. package/dist/chunks/principal-page-1yMztIcc.js.map +1 -0
  15. package/dist/chunks/{references-DPSYdWOk.js → references-DWDnXNoW.js} +3 -3
  16. package/dist/chunks/references-DWDnXNoW.js.map +1 -0
  17. package/dist/index.d.ts +5 -0
  18. package/dist/index.js +2 -2
  19. package/dist/index.js.map +1 -1
  20. package/dist/pages/account.js +8 -8
  21. package/dist/pages/account.js.map +1 -1
  22. package/dist/pages/approval.js +55 -23
  23. package/dist/pages/approval.js.map +1 -1
  24. package/dist/pages/audit.js +4 -4
  25. package/dist/pages/audit.js.map +1 -1
  26. package/dist/pages/device-login.js +5 -4
  27. package/dist/pages/device-login.js.map +1 -1
  28. package/dist/pages/environment.js +9 -13
  29. package/dist/pages/environment.js.map +1 -1
  30. package/dist/pages/login.js +3 -3
  31. package/dist/pages/login.js.map +1 -1
  32. package/dist/pages/oauth-authorize.js +9 -14
  33. package/dist/pages/oauth-authorize.js.map +1 -1
  34. package/dist/pages/project-access.js +2 -2
  35. package/dist/pages/project-environments.js +7 -7
  36. package/dist/pages/project-environments.js.map +1 -1
  37. package/dist/pages/project-settings.js +6 -6
  38. package/dist/pages/project-settings.js.map +1 -1
  39. package/dist/pages/project.js +1 -1
  40. package/dist/pages/project.js.map +1 -1
  41. package/dist/pages/projects.js +4 -4
  42. package/dist/pages/projects.js.map +1 -1
  43. package/dist/pages/service-account.js +5 -5
  44. package/dist/pages/service-account.js.map +1 -1
  45. package/dist/pages/service-accounts.js +2 -2
  46. package/dist/pages/settings.js +4 -4
  47. package/dist/pages/settings.js.map +1 -1
  48. package/dist/pages/unregistered.js +3 -3
  49. package/dist/pages/unregistered.js.map +1 -1
  50. package/dist/pages/user.js +1 -1
  51. package/dist/pages/users.js +2 -2
  52. package/package.json +3 -3
  53. package/src/components/connected-apps.tsx +1 -1
  54. package/src/components/delete-place.tsx +4 -5
  55. package/src/components/directory.tsx +5 -6
  56. package/src/components/folders.tsx +2 -2
  57. package/src/components/offboarding.tsx +5 -5
  58. package/src/components/principal-page.tsx +3 -3
  59. package/src/components/references.tsx +2 -2
  60. package/src/components/route-states.tsx +4 -5
  61. package/src/components/service-tokens.tsx +1 -1
  62. package/src/components/trusted-workloads.tsx +3 -3
  63. package/src/lib/approval.ts +23 -0
  64. package/src/lib/audit-sentences.ts +5 -0
  65. package/src/pages/account.tsx +7 -7
  66. package/src/pages/approval.tsx +21 -20
  67. package/src/pages/audit.tsx +3 -3
  68. package/src/pages/device-login.tsx +3 -5
  69. package/src/pages/environment.tsx +8 -15
  70. package/src/pages/login.tsx +5 -10
  71. package/src/pages/oauth-authorize.tsx +7 -11
  72. package/src/pages/project-environments.tsx +6 -6
  73. package/src/pages/project-settings.tsx +5 -7
  74. package/src/pages/project.tsx +2 -2
  75. package/src/pages/projects.tsx +3 -3
  76. package/src/pages/settings.tsx +4 -4
  77. package/src/pages/unregistered.tsx +3 -5
  78. package/src/styles/globals.css +12 -7
  79. package/dist/chunks/audit-sentence-BhHmvQX_.js.map +0 -1
  80. package/dist/chunks/delete-place-LYN7z7xb.js.map +0 -1
  81. package/dist/chunks/directory-v87HGjEn.js.map +0 -1
  82. package/dist/chunks/folders-CbGU0xOz.js.map +0 -1
  83. package/dist/chunks/offboarding-DdnmRV1f.js.map +0 -1
  84. package/dist/chunks/principal-page-BubEO6-b.js.map +0 -1
  85. package/dist/chunks/references-DPSYdWOk.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { s as memberRef } from "../chunks/page-DvsgZ2Hd.js";
2
2
  import { t as pageRoute } from "../chunks/page-route-Drfw7lmn.js";
3
- import { n as PrincipalLayout, r as ActionsLog, t as PrincipalAccess } from "../chunks/principal-page-BubEO6-b.js";
3
+ import { n as PrincipalLayout, r as ActionsLog, t as PrincipalAccess } from "../chunks/principal-page-1yMztIcc.js";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/pages/user.tsx
6
6
  var Route = pageRoute();
@@ -1,8 +1,8 @@
1
1
  import { i as PageHeader, n as ClosedDoor, rt as Users, u as useCoffre } from "../chunks/page-DvsgZ2Hd.js";
2
2
  import { p as queries } from "../chunks/queries-Dew8mIeo.js";
3
3
  import { t as useShell } from "../chunks/use-shell-Dkv89nW1.js";
4
- import { t as DirectoryTable } from "../chunks/directory-v87HGjEn.js";
5
- import { n as RemovedList } from "../chunks/offboarding-DdnmRV1f.js";
4
+ import { t as DirectoryTable } from "../chunks/directory-B6FuiCir.js";
5
+ import { n as RemovedList } from "../chunks/offboarding-CLJaNTcD.js";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { useSuspenseQuery } from "@tanstack/react-query";
8
8
  //#region src/pages/users.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffre/ui",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "coffre's pages, for a deployment's own TanStack Start app: its router, and a Vite plugin for its build.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -44,8 +44,8 @@
44
44
  "@tanstack/router-core": "1.171.15",
45
45
  "lucide-react": "1.47.0",
46
46
  "sonner": "2.0.7",
47
- "@coffre/client": "0.4.4",
48
- "@coffre/core": "0.4.4"
47
+ "@coffre/client": "0.4.6",
48
+ "@coffre/core": "0.4.6"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@tanstack/react-query": "5.103.1",
@@ -108,7 +108,7 @@ export function ConnectedAppsCard<TData>({
108
108
  )}
109
109
  , last used{' '}
110
110
  {app.lastUsedAt === null ? 'never' : <Timestamp iso={app.lastUsedAt} display="relative" />},
111
- stops at its next request. To use it again, connect it again.
111
+ will stop working. To use it again, connect it again.
112
112
  </>
113
113
  }
114
114
  confirmLabel="Disconnect"
@@ -60,8 +60,7 @@ export function DeletePlaceDialog({
60
60
  </div>
61
61
  <div className="dialog-body">
62
62
  <Notice tone="bad">
63
- Nothing brings it back. Backups of the database taken before now still hold its
64
- encrypted values; only they, with the vault key, could restore them.
63
+ Nothing brings it back, except a database backup from before now, with the vault key.
65
64
  </Notice>
66
65
  </div>
67
66
  <form
@@ -126,7 +125,7 @@ function DeletionSummary({ deletion, what }: { deletion: Deletion; what: 'projec
126
125
  <ul className="deletion-summary">
127
126
  <li>
128
127
  <strong>Erased:</strong> the values of {count(deletion.versions, 'secret version')}
129
- {environments}, ciphertext and wrapped key both.
128
+ {environments}.
130
129
  </li>
131
130
  <li>
132
131
  <strong>Revoked:</strong> {count(deletion.grants.length, 'grant')}
@@ -160,8 +159,8 @@ function DeletionSummary({ deletion, what }: { deletion: Deletion; what: 'projec
160
159
  )}
161
160
  <li>
162
161
  <strong>Kept, names only:</strong> the {what} and its {count(deletion.keys, 'key')}, as{' '}
163
- <span className="mono">{deletion.tombstone}</span>, so the audit log still reads. Its
164
- name is free to use again.
162
+ <span className="mono">{deletion.tombstone}</span>, for the audit log. Its name is free
163
+ to use again.
165
164
  </li>
166
165
  {deletion.stranded.length > 0 && (
167
166
  <li>
@@ -67,8 +67,8 @@ export function DirectoryTable({
67
67
  : 'No service accounts yet'
68
68
  }
69
69
  >
70
- {hasRemoved ? `Add a ${KIND[principalType]}` : `Add the first ${KIND[principalType]}`} to let
71
- it through the door. Project access is a separate step, granted from each project's page.
70
+ {hasRemoved ? `Add a ${KIND[principalType]}` : `Add the first ${KIND[principalType]}`}, then
71
+ grant it project access from each project's page.
72
72
  </EmptyState>
73
73
  ) : (
74
74
  <div className="dt-wrap">
@@ -277,7 +277,7 @@ export function InstanceRole({ principal }: { principal: DirectoryPrincipal }) {
277
277
  label={
278
278
  <>
279
279
  Their record was changed outside coffre, so the vault refuses them
280
- everything. Remove them to start them over, then add them again.
280
+ everything. To start over, remove them and add them again.
281
281
  </>
282
282
  }
283
283
  >
@@ -293,8 +293,7 @@ export function InstanceRole({ principal }: { principal: DirectoryPrincipal }) {
293
293
  <Toggletip
294
294
  label={
295
295
  <>
296
- Set by <code>rootAdmins</code> in the vault's configuration, so it
297
- cannot be changed or removed here.
296
+ Set by <code>rootAdmins</code> in the vault's configuration, not here.
298
297
  </>
299
298
  }
300
299
  >
@@ -498,7 +497,7 @@ export function AddPrincipal({ principalType }: { principalType: PrincipalType }
498
497
  open={open}
499
498
  onOpenChange={(next) => (next ? setOpen(true) : close())}
500
499
  title={`Add a ${kind}`}
501
- description={`This lets the ${kind} through the door and nothing more. Grant project access from its page or from each project's.`}
500
+ description={`This gives the ${kind} no project access. Grant it afterwards, from its page or a project's.`}
502
501
  >
503
502
  <form
504
503
  className="form"
@@ -83,7 +83,7 @@ export function FolderMenu({
83
83
  open={renaming}
84
84
  onOpenChange={setRenaming}
85
85
  title={`Rename ${folder}`}
86
- description={`Its ${items} move with it. A folder only arranges the list: nothing else changes.`}
86
+ description={`Its ${items} move with it. Nothing else changes.`}
87
87
  >
88
88
  <form
89
89
  className="form"
@@ -172,7 +172,7 @@ export function MoveToFolder({
172
172
  open={open}
173
173
  onOpenChange={onOpenChange}
174
174
  title={`Move ${what} to a folder`}
175
- description="A folder arranges the list. It changes nothing else: names, values and access stay as they are."
175
+ description="Folders only arrange the list: names, values and access stay as they are."
176
176
  >
177
177
  <form
178
178
  className="form"
@@ -41,8 +41,8 @@ export function RemovedNotice({ report }: { report: PrincipalReport }) {
41
41
  )}
42
42
  .{' '}
43
43
  {person
44
- ? 'Their project access, sessions, CLI logins, linked sign-in accounts and connected apps were revoked at the same time, so adding them again starts from nothing.'
45
- : 'Its project access and every token issued to it were revoked at the same time, so adding it again starts from nothing.'}
44
+ ? 'Their project access, sessions, CLI logins, linked sign-in accounts and connected apps were revoked, so adding them again starts from nothing.'
45
+ : 'Its project access and every token issued to it were revoked, so adding it again starts from nothing.'}
46
46
  </Notice>
47
47
  </div>
48
48
  );
@@ -119,7 +119,7 @@ function ConsiderRotating({ report, person }: { report: PrincipalReport; person:
119
119
  <Card
120
120
  labelledBy="seen-values"
121
121
  title="Consider rotating"
122
- description={`Values ${they} read or wrote that nobody has changed since, so ${they} may still hold them. Rotate each where it comes from, such as a new API key or database password, then save the new value here and it leaves this list.`}
122
+ description={`Values ${they} read or wrote that nobody has changed since. Rotate each at its source, such as a new API key or database password, then save the new value here.`}
123
123
  actions={
124
124
  report.rotated > 0 && (
125
125
  <span className="card-aside">{report.rotated} already rotated</span>
@@ -183,7 +183,7 @@ function MadeReferences({ report }: { report: PrincipalReport }) {
183
183
  <Card
184
184
  labelledBy="made-references"
185
185
  title="References they made"
186
- description="Each belongs to the environment that holds it, like a value, and stays when they leave: whoever reads that environment reads another secret through it. Review them; the source's access managers, or whoever writes where one is held, can break it."
186
+ description="These stay after they leave, and whoever reads a reference's environment reads its source through it. Review them: the source's access managers, or whoever writes where one is held, can break it."
187
187
  >
188
188
  <div className="dt-wrap">
189
189
  <table className="dt stacks">
@@ -219,7 +219,7 @@ function IssuedTokens({ report }: { report: PrincipalReport }) {
219
219
  <Card
220
220
  labelledBy="issued-tokens"
221
221
  title="Bearer tokens they issued"
222
- description="Bearer tokens they issued to service accounts that still work. Each was shown to them once, when it was made; revoke any they may have kept a copy of."
222
+ description="These still work, and they saw each one when it was issued. Revoke any they may have kept."
223
223
  >
224
224
  <div className="dt-wrap">
225
225
  <table className="dt report-tokens">
@@ -320,8 +320,8 @@ function MemberApps({ principalId, apps }: { principalId: string; apps: Principa
320
320
  <ConnectedAppsCard
321
321
  apps={apps}
322
322
  change={disconnectMemberApp(useCoffre(), memberRef('user', principalId))}
323
- description="AI assistants and other MCP clients they connected. Each acts as them, never beyond their access. Disconnecting one stops it at its next request; removing them disconnects every one."
324
- empty="They have connected none. An app connects only after they approve it on coffre's page."
323
+ description="AI assistants and other MCP clients they connected. Removing them disconnects every one."
324
+ empty="They have connected none."
325
325
  />
326
326
  );
327
327
  }
@@ -382,7 +382,7 @@ function EditAccess({
382
382
  Edit access for <span className="mono">{principalId}</span>
383
383
  </>
384
384
  }
385
- description={`Set what this ${kind} can reach on each project you manage, and until when. Saving applies only what you changed.`}
385
+ description={`Set what this ${kind} can reach on each project you manage, and until when.`}
386
386
  wide
387
387
  >
388
388
  <form
@@ -141,7 +141,7 @@ export function MakeReference({
141
141
  open={open}
142
142
  onOpenChange={onOpenChange}
143
143
  title={`Make ${holder.split('/')[2]} a reference`}
144
- description={`Whoever can read ${holderEnvironment} will read the secret you name, as it changes, even without access to its project. It takes your own read on that secret.`}
144
+ description={`Whoever can read ${holderEnvironment} will read the secret you name, as it changes, even without access to its project. You need read access to that secret.`}
145
145
  >
146
146
  <form
147
147
  className="form"
@@ -204,7 +204,7 @@ export function ReferencesInto({ project }: { project: string }) {
204
204
  <Card
205
205
  labelledBy="references-into"
206
206
  title="Also readable through references"
207
- description={`Secrets of ${project} that others read through references held elsewhere. Who reads a reference's environment reads its source, with no grant here.`}
207
+ description={`Secrets of ${project} that references elsewhere read. Whoever reads a reference's environment reads its source, with no grant here.`}
208
208
  >
209
209
  <div className="dt-wrap">
210
210
  <table className="dt stacks">
@@ -15,8 +15,8 @@ export function NotFound() {
15
15
  </Link>
16
16
  }
17
17
  >
18
- There is no page at this address. If you followed a link to a project or
19
- environment, it may have been renamed or archived since.
18
+ If you followed a link to a project or environment, it may have been renamed or
19
+ archived.
20
20
  </ClosedDoor>
21
21
  );
22
22
  }
@@ -52,9 +52,8 @@ export function RouteError({ reset }: ErrorComponentProps) {
52
52
  </>
53
53
  }
54
54
  >
55
- coffre could not load what this page needs, and nothing was read or written. If you
56
- typed this address, check it; if it keeps happening, the service or its database may
57
- be unavailable.
55
+ coffre could not load this page, and nothing was read or written. If it keeps
56
+ happening, the service or its database may be down.
58
57
  </ClosedDoor>
59
58
  );
60
59
  }
@@ -108,7 +108,7 @@ export function ServiceTokens({ serviceId, tokens }: { serviceId: string; tokens
108
108
  </>
109
109
  )}
110
110
  .{' '}
111
- Whatever uses it is refused from its next request. Issue a new token first if the
111
+ Whatever uses it is refused at once. Issue a new token first if the
112
112
  service account should keep working.
113
113
  </>
114
114
  }
@@ -28,7 +28,7 @@ export function TrustedWorkloads({ serviceId, bindings }: { serviceId: string; b
28
28
  <Card
29
29
  labelledBy="trusted-workloads"
30
30
  title="Sign in with OIDC"
31
- description="The way with nothing to store: CI runs sign in as this service account with the ID token their platform signs, when every claim of a trust binding matches. Recommended wherever the CI signs one."
31
+ description="CI runs sign in as this service account with their platform's ID token, when it matches a trust binding. There is nothing to store, so prefer it wherever the CI supports it."
32
32
  >
33
33
  {bindings.length === 0 ? (
34
34
  <EmptyState title="No trust bindings">
@@ -100,7 +100,7 @@ export function TrustedWorkloads({ serviceId, bindings }: { serviceId: string; b
100
100
  It was last used <Timestamp iso={binding.lastUsedAt} display="relative" />.
101
101
  </>
102
102
  )}{' '}
103
- A binding removed is never trusted again; to trust the runs again, add a new one.
103
+ To trust these runs again, add a new binding.
104
104
  </>
105
105
  }
106
106
  confirmLabel="Remove binding"
@@ -264,7 +264,7 @@ function TrustWorkload({ serviceId }: { serviceId: string }) {
264
264
  {field('Owner ID', 'ownerId', { mono: true })}
265
265
  </div>
266
266
  <p className="hint">
267
- Bindings name IDs, which unlike names nobody else can take over. For a private repository:{' '}
267
+ Bindings use IDs, since a name can pass to someone else. For a private repository:{' '}
268
268
  <span className="mono">gh api repos/{form.repository.trim() || 'acme/api'} --jq '.id, .owner.id'</span>
269
269
  </p>
270
270
  <ErrorLine error={lookup.error} />
@@ -0,0 +1,23 @@
1
+ import type { ApprovalView } from '@coffre/client';
2
+
3
+ /**
4
+ * What the approval page says once an approval no longer waits: its title,
5
+ * and what became of it. Approved with no outcome yet, coffre is making
6
+ * the change; a minute on with none, the server reports it failed, its
7
+ * outcome unknown, and the page says coffre doesn't know whether it was made.
8
+ */
9
+ export function settled(view: Pick<ApprovalView, 'status' | 'outcome'>): { title: string; text: string } {
10
+ if (view.outcome?.error === 'unknown_outcome') {
11
+ return { title: 'This change may not have been made', text: "You approved it, but coffre doesn't know whether it was made. Check before approving it again." };
12
+ }
13
+ if (view.status === 'approved' && view.outcome === null) return { title: 'You approved this', text: 'coffre is making the change. Refresh in a moment to see how it went.' };
14
+ const title = {
15
+ pending: 'Waiting for you',
16
+ approved: 'You approved this',
17
+ denied: 'You denied this',
18
+ cancelled: 'The app cancelled this',
19
+ failed: 'This change failed',
20
+ expired: 'This approval expired',
21
+ }[view.status];
22
+ return { title, text: view.outcome?.text ?? (view.status === 'expired' ? 'Nothing changed. The app can ask again.' : 'Nothing changed.') };
23
+ }
@@ -321,6 +321,8 @@ const TEMPLATES: Record<string, Template> = {
321
321
  'mcp.approve': { did: 'approved', tried: 'approve', what: ({ entry }) => tool(entry), then: ({ entry }) => [` for ${text(entry.metadata.clientName) ?? 'an app'}`] },
322
322
  'mcp.deny': { did: 'turned down', tried: 'turn down', what: ({ entry }) => tool(entry), then: ({ entry }) => [` for ${text(entry.metadata.clientName) ?? 'an app'}`] },
323
323
  'mcp.view': { did: 'opened an approval', tried: 'open an approval', what: () => [] },
324
+ // The app's prompt declined, which cancels the approval it would have opened.
325
+ 'mcp.cancel': { did: 'cancelled', tried: 'cancel', what: ({ entry }) => tool(entry), then: ({ entry }) => via(entry) },
324
326
  'mcp.disconnect': {
325
327
  did: 'disconnected',
326
328
  tried: 'disconnect',
@@ -427,6 +429,9 @@ const REASONS: Record<string, string> = {
427
429
  too_many_approvals: 'too many changes waiting for approval',
428
430
  request_state: 'its retry did not match its call',
429
431
  changed: 'the change was not the one shown',
432
+ replaced: 'what it replaces changed since it was shown',
433
+ unconfirmed: 'what it replaces could not be read',
434
+ disconnected: 'the app was disconnected',
430
435
  };
431
436
 
432
437
  /** What a missing permission meant, from the app's `missing_<permission>`. */
@@ -180,7 +180,7 @@ function SigninAccountsCard({
180
180
  <Card
181
181
  labelledBy="signin-accounts"
182
182
  title="Sign-in accounts"
183
- description="coffre recognises you by these accounts, never by an email address alone. A new account is linked here, while you are signed in."
183
+ description="You can sign in with any of these. Link another below."
184
184
  >
185
185
  {(linked !== undefined || message !== null) && (
186
186
  <div className="card-body">
@@ -316,7 +316,7 @@ function Sessions({
316
316
  <Card
317
317
  labelledBy="sessions"
318
318
  title="Sessions"
319
- description="Browsers and command lines signed in as you. Ending one signs it out at its next request."
319
+ description="Browsers and command lines signed in as you."
320
320
  >
321
321
  {sessions.length === 0 ? (
322
322
  <EmptyState title="No sessions">Nothing is signed in as you right now.</EmptyState>
@@ -395,8 +395,8 @@ function Sessions({
395
395
  </>
396
396
  )}
397
397
  , last active{' '}
398
- <Timestamp iso={session.lastUsedAt ?? session.createdAt} display="relative" />, is
399
- signed out at its next request.
398
+ <Timestamp iso={session.lastUsedAt ?? session.createdAt} display="relative" />, will be
399
+ signed out.
400
400
  </>
401
401
  }
402
402
  confirmLabel="End session"
@@ -427,7 +427,7 @@ function ConnectAnApp({ url }: { url: string }) {
427
427
  <Card
428
428
  labelledBy="connect"
429
429
  title="Connect an app"
430
- description="Claude, or another MCP client, connects at this address. It asks you to approve it here, then acts as you."
430
+ description="Claude, or any other MCP client, connects at this address once you approve it."
431
431
  >
432
432
  <dl className="facts">
433
433
  <Fact label="MCP URL">
@@ -465,8 +465,8 @@ function ConnectedApps() {
465
465
  <ConnectedAppsCard
466
466
  apps={apps.ok ? apps.apps : { error: apps.error }}
467
467
  change={disconnectApp(client)}
468
- description="Each acts as you, never beyond your access, and every call it makes is in the audit log. Disconnecting one stops it at its next request."
469
- empty="An app you connect shows here once you approve it."
468
+ description="Every call an app makes is in the audit log."
469
+ empty="Apps you connect show here."
470
470
  />
471
471
  );
472
472
  }
@@ -1,6 +1,7 @@
1
1
  import { useState } from 'react';
2
2
  import type { ApprovalView, Decision } from '@coffre/client';
3
3
 
4
+ import { settled } from '../lib/approval';
4
5
  import { failureMessage, statusOf, useCoffre } from '../lib/coffre';
5
6
  import { ClosedDoor } from '../components/page';
6
7
  import { CopyButton, ErrorLine, Notice, Spinner, Timestamp } from '../components/ui';
@@ -33,25 +34,16 @@ export function ApprovalPage() {
33
34
  return <Approve view={view} onDecided={setDecided} />;
34
35
  }
35
36
 
36
- const SETTLED: Record<Exclude<ApprovalView['status'], 'pending'>, string> = {
37
- approved: 'You approved this',
38
- denied: 'You denied this',
39
- cancelled: 'The app cancelled this',
40
- failed: 'This change failed',
41
- expired: 'This approval expired',
42
- };
43
-
44
37
  function Settled({ view }: { view: ApprovalView }) {
45
- const status = view.status as keyof typeof SETTLED;
38
+ const { title, text } = settled(view);
46
39
  return (
47
40
  <ClosedDoor
48
- icon={status === 'approved' ? <CheckCircle size={18} /> : <SlashCircle size={18} />}
41
+ icon={view.status === 'approved' ? <CheckCircle size={18} /> : <SlashCircle size={18} />}
49
42
  label="Approve a change"
50
- title={SETTLED[status]}
43
+ title={title}
51
44
  >
52
45
  <p>
53
- {view.client.name} asked to {view.summary}.{' '}
54
- {view.outcome?.text ?? (status === 'expired' ? 'Nothing changed. The app can ask again.' : 'Nothing changed.')}
46
+ {view.client.name} asked to {view.summary}. {text}
55
47
  </p>
56
48
  </ClosedDoor>
57
49
  );
@@ -68,7 +60,7 @@ function Decided({ decision, reveal }: { decision: Decision; reveal: boolean })
68
60
  {!(reveal && done) && <p>{decision.outcome.text}</p>}
69
61
  {decision.shown.length > 0 && (
70
62
  <>
71
- <Notice tone="warn">{reveal ? 'Shown here only, and logged as your reveal: the app does not get it.' : 'Shown once, here only: copy it now. The app does not get it.'}</Notice>
63
+ <Notice tone="warn">{reveal ? 'Shown only to you, here. The app does not get it.' : 'Shown once, here only: copy it now. The app does not get it.'}</Notice>
72
64
  <dl className="facts device-facts">
73
65
  {decision.shown.map((line) => (
74
66
  <div className="fact" key={line.label}>
@@ -82,7 +74,7 @@ function Decided({ decision, reveal }: { decision: Decision; reveal: boolean })
82
74
  </dl>
83
75
  </>
84
76
  )}
85
- <p>You can close this tab: the app hears the outcome when it asks.</p>
77
+ <p>You can close this tab and go back to the app.</p>
86
78
  </ClosedDoor>
87
79
  );
88
80
  }
@@ -103,6 +95,7 @@ function Approve({ view, onDecided }: { view: ApprovalView; onDecided: (decision
103
95
  await coffre.approvals.decide(view.id, {
104
96
  approve,
105
97
  digest: view.digest,
98
+ basis: view.basis,
106
99
  ...(approve && asksValue !== null ? { value } : {}),
107
100
  }),
108
101
  );
@@ -121,8 +114,10 @@ function Approve({ view, onDecided }: { view: ApprovalView; onDecided: (decision
121
114
  <p className="signin-lede">
122
115
  {client.name} asks to <strong>{view.summary}</strong>.{' '}
123
116
  {reveal
124
- ? 'Reveal shows it here, to you, logged as your reveal; it is never sent to the app.'
125
- : 'Read what it does: nothing changes until you approve, and then coffre makes it, as you.'}
117
+ ? view.reveals
118
+ ? 'Reveal shows it to you, here. The app holds Reveal values, so it can read it too.'
119
+ : 'Reveal shows it only to you, here. The app never gets it.'
120
+ : 'Nothing changes until you approve.'}
126
121
  </p>
127
122
  </div>
128
123
 
@@ -141,8 +136,11 @@ function Approve({ view, onDecided }: { view: ApprovalView; onDecided: (decision
141
136
  {view.details.map((line) => (
142
137
  <div className="fact" key={line.label}>
143
138
  <dt>{line.label}</dt>
144
- <dd className={line.kind === 'mono' ? 'mono' : undefined}>
145
- {line.kind === 'time' ? <Timestamp iso={line.value} /> : line.value}
139
+ <dd>
140
+ <span className={line.kind === 'mono' ? 'mono' : undefined}>
141
+ {line.kind === 'time' ? <Timestamp iso={line.value} /> : line.value}
142
+ </span>
143
+ {line.note !== undefined && <small className={line.warn === true ? 'approval-note approval-warn' : 'approval-note'}>{line.note}</small>}
146
144
  </dd>
147
145
  </div>
148
146
  ))}
@@ -172,6 +170,9 @@ function Approve({ view, onDecided }: { view: ApprovalView; onDecided: (decision
172
170
  )}
173
171
 
174
172
  <div className="consent-notices">
173
+ {!view.ready && (
174
+ <Notice tone="warn">coffre couldn't read what this change replaces, so it can't be approved yet. Reload to try again.</Notice>
175
+ )}
175
176
  {client.registration === 'dcr' && (
176
177
  <Notice tone="warn">This app registered itself: its name is its own claim. Approve only what you asked it to do.</Notice>
177
178
  )}
@@ -185,7 +186,7 @@ function Approve({ view, onDecided }: { view: ApprovalView; onDecided: (decision
185
186
  </button>
186
187
  <button
187
188
  className="btn btn-primary"
188
- disabled={pending !== null || (asksValue !== null && value === '')}
189
+ disabled={pending !== null || !view.ready || (asksValue !== null && value === '')}
189
190
  onClick={() => void decide(true)}
190
191
  >
191
192
  {pending === 'approve' && <Spinner />}
@@ -136,7 +136,7 @@ export function AuditPage() {
136
136
  {shown.length === 0 ? (
137
137
  <EmptyState title={deniedOnly ? 'No denials recorded' : 'Nothing recorded yet'}>
138
138
  {deniedOnly
139
- ? 'Every decision reaches this log, refusals included. An empty page means nobody has been turned away.'
139
+ ? 'Nobody has been turned away.'
140
140
  : 'The log fills as people read and write secrets and change who has access.'}
141
141
  </EmptyState>
142
142
  ) : (
@@ -378,7 +378,7 @@ function ChainStatus({ chain, onRetry }: { chain: ChainResult | undefined; onRet
378
378
  return (
379
379
  <Toggletip
380
380
  align="end"
381
- label="Owners and root admins see whether the log is intact. Checking it means recomputing every entry, and you read only your projects' part of it."
381
+ label="Only owners and root admins can check the log: it takes every entry, and you see only your projects'."
382
382
  >
383
383
  <button type="button" className="chain-note">
384
384
  <Info size={14} />
@@ -393,7 +393,7 @@ function ChainStatus({ chain, onRetry }: { chain: ChainResult | undefined; onRet
393
393
  <div className="chain">
394
394
  <Toggletip
395
395
  align="end"
396
- label={`coffre could not check the log: ${chain.problem}. The entries below loaded, but whether they are intact is unknown until it can.`}
396
+ label={`coffre could not check the log: ${chain.problem}. The entries below are unverified.`}
397
397
  >
398
398
  <button type="button" className="chain-flag chain-flag-warn">
399
399
  <AlertTriangle size={14} />
@@ -32,9 +32,8 @@ export function DevicePage() {
32
32
  return (
33
33
  <ClosedDoor icon={<SlashCircle size={18} />} label="coffre CLI" title="Sign-in refused">
34
34
  <p>
35
- The terminal that asked gets nothing. If you did not run <span className="mono">coffre
36
- login</span> yourself, someone may be trying to get you to approve theirs; the refusal is
37
- in the audit log.
35
+ The terminal gets nothing. If you did not run <span className="mono">coffre login</span>{' '}
36
+ yourself, someone may be trying to get you to approve theirs.
38
37
  </p>
39
38
  </ClosedDoor>
40
39
  );
@@ -134,8 +133,7 @@ function Approve({
134
133
  </h1>
135
134
  <p className="signin-lede">
136
135
  Only if you just ran <span className="mono">coffre login</span> yourself and it shows
137
- this code. It gets your access, in your name, for {sessionDays} days or until you end it
138
- from your account page.
136
+ this code. It gets your access for {sessionDays} days.
139
137
  </p>
140
138
  </div>
141
139
 
@@ -450,8 +450,8 @@ function EnvironmentLedger({
450
450
  {active.length === 0 && drafts.length === 0 ? (
451
451
  <EmptyState title="No secrets yet">
452
452
  {canWrite
453
- ? 'Add them one by one, or import an existing .env file. Nothing is written until you save, or until you have seen the import plan.'
454
- : 'Nothing has been written to this environment, and adding the first secret needs secret.write.'}
453
+ ? 'Add them one by one, or import a .env file.'
454
+ : 'Adding secrets here needs secret.write.'}
455
455
  </EmptyState>
456
456
  ) : (
457
457
  <div className="dt-wrap">
@@ -1409,7 +1409,7 @@ function DraftRow({
1409
1409
  {(keyProblem !== null || isNewVersion) && (
1410
1410
  <span className={`edit-note${keyProblem !== null ? ' edit-note-error' : ''}`}>
1411
1411
  {keyProblem ??
1412
- 'This name already exists here. Saving appends a new version to it rather than creating a second secret.'}
1412
+ 'This name exists here already. Saving adds a new version to it.'}
1413
1413
  </span>
1414
1414
  )}
1415
1415
  </div>
@@ -1683,13 +1683,11 @@ function VersionHistory({
1683
1683
  }
1684
1684
  body={
1685
1685
  <>
1686
- The current pointer moves to v{version.version}. Nothing is copied
1687
- or deleted, every version stays readable, and the next write
1688
- continues the numbering forward. Anything reading{' '}
1686
+ v{version.version} becomes current, and anything reading{' '}
1689
1687
  <span className="mono">
1690
1688
  {project}/{environment}
1691
1689
  </span>{' '}
1692
- picks up the change immediately.
1690
+ gets it at once. Every version stays.
1693
1691
  </>
1694
1692
  }
1695
1693
  confirmLabel={`Roll back to v${version.version}`}
@@ -1725,9 +1723,6 @@ function VersionHistory({
1725
1723
  <ErrorLine error={error} />
1726
1724
  </div>
1727
1725
  )}
1728
- <p className="history-note">
1729
- Metadata only. Listing versions decrypts nothing.
1730
- </p>
1731
1726
  </div>
1732
1727
  );
1733
1728
  }
@@ -1829,10 +1824,8 @@ function ImportEnv({ project, environment }: { project: string; environment: str
1829
1824
  wide
1830
1825
  description={
1831
1826
  <>
1832
- Paste a .env file. It is read by the CLI’s own parser, so this page and the CLI
1833
- cannot disagree about what it means, and malformed lines are reported rather
1834
- than guessed at. coffre compares it with the current values without sending any
1835
- to this page.
1827
+ Paste a .env file. coffre parses it as the CLI does and compares it with the current
1828
+ values, without sending them to this page.
1836
1829
  </>
1837
1830
  }
1838
1831
  >
@@ -1881,7 +1874,7 @@ function ImportEnv({ project, environment }: { project: string; environment: str
1881
1874
  )}
1882
1875
 
1883
1876
  {plan !== null && plan.entries.length > 0 && changes.length === 0 && (
1884
- <Notice tone="good">Every key already has this value. There is nothing to write.</Notice>
1877
+ <Notice tone="good">Every key already has this value.</Notice>
1885
1878
  )}
1886
1879
 
1887
1880
  {problems.length > 0 && (