@crossworks/client-types 0.239.90 → 0.239.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossworks/client-types",
3
- "version": "0.239.90",
3
+ "version": "0.239.92",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
package/src/dto/access.ts CHANGED
@@ -269,7 +269,8 @@ export type SharedLinkRow = {
269
269
  };
270
270
 
271
271
  /** An old client link the brain retired (client logins C3, migration 0192):
272
- * it answers "Sign in as a client" now. No token: the link is dead. */
272
+ * it answers a plain 410 now. No token: the link is dead. GET
273
+ * /api/team-admin/shares sends `retired: []` since workspaces W5c. */
273
274
  export type RetiredClientLinkRow = {
274
275
  id: string;
275
276
  nodeId: string;
package/src/dto/client.ts CHANGED
@@ -1,175 +1,17 @@
1
1
  /**
2
- * The client API's wire shapes (client logins, Phase C2): what a CLIENT
3
- * login's app reads from /api/client/*, and what an admin reads and writes
4
- * about client logins in Team admin > Clients. A client reads items at
5
- * client level only (the brain enforces it with row security). Client DTOs
6
- * never carry a staff name or an author: clients see the brand name.
2
+ * The client wire shapes left after workspaces W5c. The client portal
3
+ * (/api/client/*), admin-issued sign-in links and Team admin > Clients were
4
+ * removed: a client login uses the one (app) shell (`Shell`, GET /api/shell).
5
+ * What stays: the email sign-in codes (any client login signs in with one),
6
+ * the admin's choice of the code sender, the label a redacted reference
7
+ * carries, and the row shapes the member files still name.
7
8
  */
8
- import type { ClientItemKind, MemberItemKind } from '../member-kinds';
9
+ import type { ClientItemKind } from '../member-kinds';
9
10
  import type { MemberItemPill, MemberSpaceItemRow } from './member';
10
- import type { TreeKind } from '../tree';
11
-
12
- /** GET /api/client/shell: who is signed in and the brain's brand. */
13
- export type ClientShell = {
14
- role: 'client';
15
- loginId: string;
16
- displayName: string | null;
17
- email: string;
18
- /** Append as `?at=` to /api/client/files/* and /api/client/draws/* srcs. */
19
- assetToken: string;
20
- siteName: string | null;
21
- colorTheme: string | null;
22
- fontLogo: string | null;
23
- fontTitle: string | null;
24
- fontUi: string | null;
25
- fontProse: string | null;
26
- fontSize: string | null;
27
- fontLogoSize: string | null;
28
- fontTitleSize: string | null;
29
- fontProseSize: string | null;
30
- logoVersion: string | null;
31
- logoDarkVersion: string | null;
32
- /** The kinds this login browses as a read-only folder tree (GET
33
- * /api/{member,client}/tree/:kind). Absent from brains before folder
34
- * sharing: the client keeps its flat lists there. */
35
- treeKinds?: TreeKind[];
36
- };
37
-
38
- /** One item in "Shared with you": an item at client level. */
39
- export type ClientSharedRow = {
40
- id: string;
41
- type: MemberItemKind;
42
- title: string;
43
- icon: string | null;
44
- /** Never sent since 0.232.333 (it was built from the unredacted text); do
45
- * not show it. Optional only so older clients still compile. */
46
- summary?: string | null;
47
- updatedAt: string;
48
- };
49
-
50
- /** GET /api/client/shared?kind=&q=&page= : newest first. */
51
- export type ClientSharedPage = {
52
- items: ClientSharedRow[];
53
- total: number;
54
- page: number;
55
- pageSize: number;
56
- };
57
-
58
- /** GET /api/client/shared/:id -> { item }. A page's doc and a note's text
59
- * come with every reference to something a client may not read replaced:
60
- * a mention chip or a link names "Private item" and points nowhere, an
61
- * embed of such an item is left out. */
62
- export type ClientSharedItem =
63
- | (ClientSharedRow & { type: 'page'; doc: unknown; folderId?: string | null })
64
- | (ClientSharedRow & { type: 'note'; content: string })
65
- | (ClientSharedRow & { type: 'table'; table: ClientSharedTable })
66
- | (ClientSharedRow & { type: 'draw' })
67
- | (ClientSharedRow & {
68
- type: 'file';
69
- filename: string;
70
- mimeType: string | null;
71
- sizeBytes: number | null;
72
- });
73
-
74
- /** One column of a client table: what the grid draws a header and a cell
75
- * with. No formula, no reference source, no options. */
76
- export type ClientSharedTableColumn = { id: string; name: string; type: string };
77
-
78
- /** One committed row of a client table. A cell that names an item the
79
- * client may not read (`/n/<id>`, `page:`, `media:`, `draw:`, `mention:`)
80
- * arrives as "Private item". */
81
- export type ClientSharedTableRow = {
82
- id: string;
83
- cells: Record<string, string | number | boolean | string[] | null>;
84
- };
85
-
86
- /** A client table (GET /api/client/shared/:id, type table): the committed
87
- * grid of one tab and nothing else about the table (no description, tags,
88
- * summary, visibility, level, app link or draft). The shape the member
89
- * reader draws (`data`, `docClipped`, `tabs`, `tabId`), so one viewer reads
90
- * both. `data` is a leading window when `docClipped`; `rowCount` is the
91
- * tab's true total. */
92
- export type ClientSharedTable = {
93
- data: {
94
- columns: ClientSharedTableColumn[];
95
- rows: ClientSharedTableRow[];
96
- /** Footer totals the owner set, by column id. */
97
- aggregates?: Record<string, string>;
98
- };
99
- docClipped?: boolean;
100
- /** The workbook's tabs in order (absent for a one-grid table). */
101
- tabs?: { id: string; name: string; rows: number; columns: number }[];
102
- /** Which tab `data` holds. */
103
- tabId?: string | null;
104
- rowCount?: number;
105
- };
106
11
 
107
12
  /** The label a client sees instead of a reference it may not read. */
108
13
  export const CLIENT_PRIVATE_LABEL = 'Private item';
109
14
 
110
- // ── Admin side: Team admin > Clients ────────────────────────────────────────
111
-
112
- /** A sign-in link an admin issued (the code itself is shown once, at issue). */
113
- export type ClientSigninLinkRow = {
114
- id: string;
115
- createdAt: string;
116
- expiresAt: string;
117
- };
118
-
119
- /** One client login, as Team admin > Clients lists it. */
120
- export type ClientLoginRow = {
121
- id: string;
122
- email: string;
123
- displayName: string | null;
124
- contactId: string | null;
125
- disabled: boolean;
126
- createdAt: string;
127
- lastLoginAt: string | null;
128
- /** The open (unused, unexpired, unrevoked) sign-in link, if any. */
129
- openLink: ClientSigninLinkRow | null;
130
- /** When a sign-in link of this login was last used. */
131
- lastLinkUsedAt: string | null;
132
- };
133
-
134
- /** GET /api/team-admin/clients. `reportAcknowledged`: an admin has checked
135
- * "What clients see" and nothing went to client since; until then Add
136
- * client and Issue sign-in link are refused (409 `report-not-acknowledged`). */
137
- export type ClientLoginList = {
138
- clients: ClientLoginRow[];
139
- reportAcknowledged: boolean;
140
- };
141
-
142
- /** POST /api/team-admin/clients { email, displayName?, contactId? }
143
- * -> { client }. The login has no password: it signs in with a link. */
144
- export type ClientLoginCreated = { client: ClientLoginRow };
145
-
146
- /** POST /api/team-admin/clients/:id/signin-link -> the link, ONCE. `path` is
147
- * the client-app path to hand the client (the code is its only secret);
148
- * 72 hours, one use. Any older open link of the login is revoked. Since
149
- * 0.232.333 the code rides in the fragment (`/client-signin#code=...`), so
150
- * it never reaches a server log; links issued before carry `?code=`. */
151
- export type ClientSigninLinkCreated = {
152
- link: ClientSigninLinkRow;
153
- code: string;
154
- path: string;
155
- };
156
-
157
- /** Why an admin's client action was refused (the 4xx `reason`). */
158
- export type ClientAdminRefusedReason =
159
- | 'report-not-acknowledged'
160
- | 'email-has-login'
161
- | 'contact-not-found'
162
- | 'contact-has-login'
163
- | 'no-email'
164
- | 'not-a-client'
165
- /** A contact-linked client's email must be one of the contact's addresses
166
- * (the mail gates know the client by its contact; audit B26). */
167
- | 'email-not-on-contact';
168
-
169
- /** POST /api/auth/client-link { code, email } -> 200 { ok: true } and the
170
- * session cookie (30 days), or one uniform 401 for every failure. */
171
- export type ClientLinkSignIn = { ok: true };
172
-
173
15
  // ── Email sign-in codes (C2b) ───────────────────────────────────────────────
174
16
 
175
17
  /** GET /api/auth/client-code: whether this brain sends sign-in codes (an
@@ -231,47 +73,6 @@ export type ClientSigninSenderPreview = {
231
73
  export type ClientSenderRefusedReason =
232
74
  'account-not-found' | 'account-cannot-send' | 'no-sent-folder' | 'folders-unreadable';
233
75
 
234
- // ── Client chat (client logins C4) ───────────────────────────────────────
235
-
236
- /** One message of a client's own chat thread. */
237
- export type ClientChatMessage = {
238
- id: string;
239
- direction: 'inbound' | 'outbound';
240
- text: string;
241
- status: 'pending' | 'complete' | 'failed';
242
- failed: boolean;
243
- createdAt: string;
244
- };
245
-
246
- /** GET /api/client/chat[?before=ISO]: the client's own thread with the
247
- * client-responder, newest page first (50 a page). `agent` null = the chat
248
- * is not open (no enabled client-level client-responder): the dock says so
249
- * and offers no input. Poll it (every few seconds while a reply is pending):
250
- * there is no live stream for clients. */
251
- export type ClientChatThread = {
252
- agent: { name: string } | null;
253
- messages: ClientChatMessage[];
254
- };
255
-
256
- /** POST /api/client/chat { text } -> 202: the turn is queued; the reply
257
- * lands in the thread. A retry with the same Idempotency-Key is the same
258
- * turn. */
259
- export type ClientChatQueued = { turnId: string };
260
-
261
- /** Why a client chat send was refused (the 4xx `reason`): 409 `chat-closed`
262
- * (no client-level agent), 409 `idempotency-key-reused`, 429 `rate-limited`
263
- * (6 a minute), 429 `daily_cap` or `token_budget` (the member caps, per
264
- * client login per UTC day). */
265
- export type ClientChatRefusedReason =
266
- 'chat-closed' | 'idempotency-key-reused' | 'rate-limited' | 'daily_cap' | 'token_budget';
267
-
268
- /** GET /api/team-admin/clients/usage: each client login's chat use today
269
- * (UTC) against the caps every client login has (the member caps). */
270
- export type ClientChatUsage = {
271
- limits: { dailyTurns: number; dailyTokens: number };
272
- rows: { loginId: string; turnsToday: number; tokensToday: number }[];
273
- };
274
-
275
76
  // ── The client's own items, My requests (client logins C5) ─────────────────
276
77
 
277
78
  /**
@@ -282,7 +83,8 @@ export type ClientChatUsage = {
282
83
  */
283
84
  export type ClientItemSource = 'own' | 'accepted';
284
85
 
285
- /** One row of GET /api/client/items. No level, no staff name. */
86
+ /** One row of the client's My requests (GET /api/client/items, 410 since
87
+ * W5c; the member files still build it). No level, no staff name. */
286
88
  export type ClientItemRow = {
287
89
  id: string;
288
90
  type: ClientItemKind;
@@ -298,45 +100,8 @@ export type ClientItemRow = {
298
100
  acceptedAt: string | null;
299
101
  };
300
102
 
301
- /** GET /api/client/items?kind=&q=&state=&page=: the client's own items and
302
- * their accepted items in ONE list, newest first. `state` is a
303
- * ClientItemFilter (default `all`). */
304
- export type ClientItemsPage = {
305
- items: ClientItemRow[];
306
- total: number;
307
- page: number;
308
- pageSize: number;
309
- };
310
-
311
- /**
312
- * The client's own space (/api/client/space*, /api/client/space-files): the
313
- * member space routes' shapes (MemberSpaceItem, MemberSpaceItemRow,
314
- * MemberSpaceList) for kinds page, note and file only. No share route: a
315
- * client's item is private until submitted, and a submitted item goes to the
316
- * reviewers (and members read it as a client request). Refusals (the 409
317
- * `reason`): the member ones, plus `quota` for the client caps: 20 MB a file,
318
- * 200 MB a client, 50 MB uploaded a day, 500 items, 10 submissions a day, 50
319
- * waiting for review, and one total for all client spaces of the brain. The
320
- * 200 MB and the total count page and note text too (C5 audit). A page
321
- * document over 500 KB serialized (draft or Save version), or a note over
322
- * 50,000 characters, is a 400 `too-large`. Any JSON body over the route's ceiling (8 MB)
323
- * is a 413 `body-too-large`.
324
- */
325
- export type ClientSpaceRefusedReason =
326
- | 'not-found'
327
- | 'frozen'
328
- | 'not-draft'
329
- | 'not-submitted'
330
- | 'unsaved-draft'
331
- | 'quota'
332
- | 'embed'
333
- | 'not-shared'
334
- | 'too-large'
335
- | 'invalid'
336
- | 'with-admin';
337
-
338
- /** GET /api/client/accepted/:id -> { item }: the version the client wrote
339
- * and an admin accepted (the snapshot taken at Accept, never the brain's
103
+ /** GET /api/client/accepted/:id (410 since W5c) -> { item }: the version
104
+ * the client wrote and an admin accepted (the snapshot taken at Accept, never the brain's
340
105
  * current version). A file's bytes: /api/client/files/:id while the brain
341
106
  * file still holds the bytes accepted (`changedByAdmin` otherwise). */
342
107
  export type ClientAcceptedItem =
@@ -357,44 +122,3 @@ export type ClientAcceptedBase = {
357
122
  acceptedAt: string | null;
358
123
  updatedAt: string;
359
124
  };
360
-
361
- // ── Team admin > Clients: storage (C5 audit) ──────────────────────────
362
-
363
- /**
364
- * GET /api/team-admin/clients/storage (admin only): what the client spaces
365
- * hold against the client limits. A client space counts files, page
366
- * documents (saved, draft and plain text) and note text, as stored.
367
- * `limits.totalBytes` is the brain-wide total for ALL client spaces (5 GB
368
- * unless the box sets MANTLE_CLIENT_SPACES_TOTAL_BYTES). A `former` row is a
369
- * deleted client's space: it still counts until its 30-day purge, and its
370
- * `loginId` is the space's id (the login row is gone).
371
- */
372
- export type ClientStorageUsage = {
373
- limits: {
374
- fileMaxBytes: number;
375
- perClientBytes: number;
376
- dailyUploadBytes: number;
377
- itemLimit: number;
378
- totalBytes: number;
379
- submitsPerDay: number;
380
- openSubmissions: number;
381
- };
382
- totalUsedBytes: number;
383
- rows: {
384
- loginId: string;
385
- name: string;
386
- usedBytes: number;
387
- uploadedTodayBytes: number;
388
- items: number;
389
- openSubmissions: number;
390
- former: boolean;
391
- }[];
392
- /** Quota refusals in the last 7 days, newest first, at most 50. */
393
- refusals: { at: string; loginId: string | null; reason: string }[];
394
- /** What the databases of the brain's CLIENT-level apps hold, in bytes,
395
- * as recorded at each app's last write. Clients write them, but they do
396
- * not count toward the client limits above: each app file has its own
397
- * cap (256 MB unless the box sets APP_SQL_MAX_DB_MB). Optional: an older
398
- * brain does not send it. */
399
- clientAppDbBytes?: number;
400
- };
@@ -1,16 +1,12 @@
1
1
  /**
2
2
  * Apps for members (member logins Phase 4b): what a MEMBER login's client
3
3
  * reads from /api/member/apps and /api/member/home, plus the admin's view of
4
- * member chats (/api/team-admin/member-chats). A member RUNS apps at team
5
- * level or lower with a green published build; it never creates, edits or
6
- * shares one. A CLIENT login runs apps at client level only (client logins
4
+ * member chats (/api/team-admin/member-chats). A member RUNS the brain apps
5
+ * a workspace of theirs holds, with a green published build (its own apps
6
+ * are the my-apps routes). A CLIENT login runs apps at client level only (client logins
7
7
  * C6, /api/client/apps).
8
8
  */
9
9
  import type { AppDataAccess, AppTint } from '../app-nav';
10
- import type { AccessLevel } from './access';
11
-
12
- /** The app levels a member may run: team and below (never admin). */
13
- export type MemberAppLevel = Exclude<AccessLevel, 'admin'>;
14
10
 
15
11
  /** One launcher card (GET /api/member/apps). */
16
12
  export type MemberAppCard = {
@@ -19,13 +15,11 @@ export type MemberAppCard = {
19
15
  icon: string | null;
20
16
  color: AppTint | null;
21
17
  description: string | null;
22
- audience: MemberAppLevel;
23
18
  updatedAt: string;
24
- /** The member only reads this app's data (client logins C6): true for a
25
- * public app, and for an app an admin marked informational. Off, the
26
- * member runs AND writes it (team and client apps). A write to a read-only
27
- * app answers 403 `{ ok: false, error, reason: 'read-only' }`. Absent from
28
- * an older brain: read as `audience !== 'team'`. */
19
+ /** The member only reads this app's data: no workspace of theirs holds it
20
+ * with Write on, or an admin marked it informational. Off, the member
21
+ * runs AND writes it. A write to a read-only app answers 403
22
+ * `{ ok: false, error, reason: 'read-only' }`. */
29
23
  dataReadOnly?: boolean;
30
24
  /** The same, as the R and R/W pill shows it (team apps Phase 3). Absent
31
25
  * from an older brain: show no pill. */
@@ -62,33 +56,6 @@ export type MemberAppList = {
62
56
  folders?: AppLauncherFolder[];
63
57
  };
64
58
 
65
- /** One launcher card of a CLIENT login (client logins C6, GET
66
- * /api/client/apps): an app at client level with a green published build.
67
- * No level and no author. `dataReadOnly`: the app is informational, and a
68
- * write answers 403 `{ ok: false, error, reason: 'read-only' }`. */
69
- export type ClientAppCard = {
70
- id: string;
71
- title: string;
72
- icon: string | null;
73
- color: AppTint | null;
74
- description: string | null;
75
- updatedAt: string;
76
- dataReadOnly: boolean;
77
- /** What the client may do with the app's data, as the R and R/W pill
78
- * shows it (team apps Phase 3). Absent from an older brain. */
79
- dataAccess?: AppDataAccess;
80
- };
81
-
82
- /** GET /api/client/apps: the apps a client may run, by title. The run routes
83
- * are the member routes' twins under `/api/client/apps/:id` (frame-ticket,
84
- * frame, tool-broker, db-broker), so the sandbox takes that as its API
85
- * base. */
86
- export type ClientAppList = {
87
- apps: ClientAppCard[];
88
- /** Where those apps sit (0.232.368 on; absent from an older brain). */
89
- folders?: AppLauncherFolder[];
90
- };
91
-
92
59
  /** The brain's pinned home app, when a member may run it. */
93
60
  export type MemberHomeApp = {
94
61
  appId: string;
package/src/dto/member.ts CHANGED
@@ -1,42 +1,13 @@
1
1
  /**
2
2
  * The member API's wire shapes (member logins, Phase 1): what a MEMBER login's
3
- * client reads from /api/member/*. A member reads team-level items only (the
4
- * brain enforces it with row security) and chats with the team-level agent in
5
- * its own thread.
3
+ * client reads from /api/member/*. A member reads what its workspaces hold
4
+ * (the brain enforces it with row security) and chats with the Team
5
+ * workspace's assistant in its own thread.
6
6
  */
7
- import type { AccessLevel, MemberItemAuthor } from './access';
7
+ import type { MemberItemAuthor } from './access';
8
8
  import type { MemberItemKind } from '../member-kinds';
9
- import type { TreeKind } from '../tree';
10
9
  export type { MemberItemFilter } from '../member-kinds';
11
10
 
12
- /** GET /api/member/shell */
13
- export type MemberShell = {
14
- role: 'member';
15
- loginId: string;
16
- displayName: string | null;
17
- email: string;
18
- avatar: { style: string; seed: string; parts: unknown } | null;
19
- avatarPhotoVersion: string | null;
20
- /** Append as `?at=` to /api/member/files/* and /api/member/draws/* srcs. */
21
- assetToken: string;
22
- siteName: string | null;
23
- colorTheme: string | null;
24
- fontLogo: string | null;
25
- fontTitle: string | null;
26
- fontUi: string | null;
27
- fontProse: string | null;
28
- fontSize: string | null;
29
- fontLogoSize: string | null;
30
- fontTitleSize: string | null;
31
- fontProseSize: string | null;
32
- logoVersion: string | null;
33
- logoDarkVersion: string | null;
34
- /** The kinds this login browses as a read-only folder tree (GET
35
- * /api/{member,client}/tree/:kind). Absent from brains before folder
36
- * sharing: the client keeps its flat lists there. */
37
- treeKinds?: TreeKind[];
38
- };
39
-
40
11
  export type MemberLibraryKind = MemberItemKind;
41
12
 
42
13
  export type MemberLibraryRow = {
@@ -45,9 +16,6 @@ export type MemberLibraryRow = {
45
16
  title: string;
46
17
  icon: string | null;
47
18
  summary: string | null;
48
- /** A member's Library holds team and client items (client logins,
49
- * decision 6): 'client' = a client login reads it too (the Client badge). */
50
- audience: 'team' | 'client';
51
19
  updatedAt: string;
52
20
  /** A member wrote it and an admin accepted it (the member-authored badge).
53
21
  * Absent from brains before 0.232.285. */
@@ -84,7 +52,8 @@ export type MemberChatMessage = {
84
52
  createdAt: string;
85
53
  };
86
54
 
87
- /** GET /api/member/chat. `agent` null = chat not open yet (no team-level agent). */
55
+ /** GET /api/member/chat. `agent` null = chat not open yet (the Team workspace
56
+ * has no assistant). */
88
57
  export type MemberChatThread = {
89
58
  agent: { slug: string; name: string } | null;
90
59
  messages: MemberChatMessage[];
@@ -103,7 +72,7 @@ export type MemberReviewState = 'draft' | 'submitted' | 'returned' | 'accepted'
103
72
  * opening it answers 409 `with-admin`). */
104
73
  export type MemberSpaceItemState = MemberReviewState | 'with-admin';
105
74
 
106
- /** One item of a personal space: GET /api/member/space[/team] rows. */
75
+ /** One item of a personal space: GET /api/member/space rows. */
107
76
  export type MemberSpaceItemRow = {
108
77
  id: string;
109
78
  type: MemberItemKind;
@@ -113,7 +82,7 @@ export type MemberSpaceItemRow = {
113
82
  reviewState: MemberSpaceItemState;
114
83
  submittedAt: string | null;
115
84
  returnedNote: string | null;
116
- /** The login that wrote it (team drafts show whose it is). */
85
+ /** The login that wrote it. */
117
86
  authorLoginId: string | null;
118
87
  /** Brains from the item-list alignment release on. */
119
88
  createdAt?: string;
@@ -121,7 +90,7 @@ export type MemberSpaceItemRow = {
121
90
  };
122
91
 
123
92
  /**
124
- * GET /api/member/space?kind=&q=&review=&page= (and /space/team). On the
93
+ * GET /api/member/space?kind=&q=&review=&page=. On the
125
94
  * member's own list, page 1 also carries the member's items an admin has
126
95
  * taken over (reviewState `with-admin`, before the own rows; `total` counts
127
96
  * them), unless `review=` names states without `with-admin`.
@@ -135,15 +104,16 @@ export type MemberSpaceList = {
135
104
 
136
105
  // ── An admin's private space and Take over (audit F07) ──────────────────
137
106
 
138
- /** Who wrote an item an admin took over from the Review queue. */
107
+ /** Who wrote an item an admin took over from the Review queue (Take over
108
+ * and review were removed in workspaces W5c; an item taken before that
109
+ * still names its author). */
139
110
  export type AdminTakenFrom = {
140
111
  /** The member login; null once that login is deleted. */
141
112
  loginId: string | null;
142
113
  /** Display name, else the email's local part; "Removed member" once the
143
114
  * login is deleted. */
144
115
  name: string;
145
- /** False when the member is deactivated, deleted or no longer a member:
146
- * give-back is refused (409 `author-inactive`), accept or delete it. */
116
+ /** Always false since W5c: Give back was removed. */
147
117
  canGiveBack: boolean;
148
118
  takenAt: string | null;
149
119
  };
@@ -166,25 +136,6 @@ export type AdminSpaceItem<TDoc = unknown, TTable = unknown> = {
166
136
  body: MemberSpaceItemBody<TDoc, TTable>;
167
137
  };
168
138
 
169
- /** An item that moved with a Take over or a Give back. */
170
- export type MovedSpaceItem = { id: string; type: MemberItemKind; title: string };
171
-
172
- /** POST /api/team-admin/submissions/:id/take-over -> 200 */
173
- export type TakeOverResult = {
174
- /** The taken item: now in the acting admin's private space, same id. */
175
- id: string;
176
- /** It and its bundle, in bundle order. */
177
- moved: MovedSpaceItem[];
178
- };
179
-
180
- /** POST /api/admin/space/:id/give-back { note } -> 200 */
181
- export type GiveBackResult = {
182
- id: string;
183
- /** Back in the member's space: the item `returned` with the note, the rest
184
- * of what was taken with it as drafts. */
185
- returned: MovedSpaceItem[];
186
- };
187
-
188
139
  /** A space file's metadata; the bytes stream from the item's bytes route. */
189
140
  export type MemberSpaceFile = {
190
141
  id: string;
@@ -216,12 +167,12 @@ export type MemberSpaceItemBody<TDoc = unknown, TTable = unknown> =
216
167
  };
217
168
  }
218
169
  | { type: 'note'; note: { content: string; title: string } }
219
- /** Null for a teammate: their drawing shows from its saved SVG route. */
170
+ /** Null when only the saved SVG route shows the drawing. */
220
171
  | { type: 'draw'; draw: { scene: TDoc; draft: TDoc | null; draftRev?: number } | null }
221
172
  | { type: 'table'; table: TTable }
222
173
  | { type: 'file'; file: MemberSpaceFile };
223
174
 
224
- /** GET /api/member/space/:id (and the team read): the row and its body. */
175
+ /** GET /api/member/space/:id: the row and its body. */
225
176
  export type MemberSpaceItem<TDoc = unknown, TTable = unknown> = {
226
177
  row: MemberSpaceItemRow;
227
178
  body: MemberSpaceItemBody<TDoc, TTable>;
@@ -229,18 +180,14 @@ export type MemberSpaceItem<TDoc = unknown, TTable = unknown> = {
229
180
 
230
181
  // ── Accepted items (member logins Phase 4, plan 6.2) ────────────────────
231
182
 
232
- /** An item this member wrote and an admin accepted into the brain. */
183
+ /** An item this member wrote and an admin accepted into the brain. No
184
+ * level (workspaces W5c): whether the member's Library holds it too is
185
+ * its row in GET /api/member/items (`source` 'library'). */
233
186
  export type MemberAcceptedRow = {
234
187
  id: string;
235
188
  type: MemberItemKind;
236
189
  title: string;
237
190
  icon: string | null;
238
- /** The level the admin chose: at team or lower it is in the Library too. */
239
- audience: AccessLevel;
240
- /** The share it takes from a folder holding it: in the Library at that
241
- * level too, whatever `audience` says. Absent from brains before folder
242
- * sharing. */
243
- inherited?: 'team' | 'client' | null;
244
191
  acceptedAt: string | null;
245
192
  updatedAt: string;
246
193
  };
@@ -255,7 +202,7 @@ export type MemberAcceptedPage = {
255
202
 
256
203
  /** GET /api/member/accepted/:id -> { item }: the version ACCEPTED (the
257
204
  * snapshot taken at Accept, brains from the take-over release; never the
258
- * brain's current version), whatever its level. A drawing shows from
205
+ * brain's current version), whoever reads it now. A drawing shows from
259
206
  * /api/member/draws/:id/svg, a file's bytes from /api/member/files/:id.
260
207
  * `changedByAdmin: true`: an admin changed the file (or a drawing with no
261
208
  * saved picture) since, so its bytes are not served any more; the metadata
@@ -276,13 +223,11 @@ export type MemberAcceptedItem =
276
223
  // ── One list of everything a member can see (item-list alignment) ───────
277
224
 
278
225
  /** Where a row of the one list comes from; it picks the item view that
279
- * opens it: `own` the member's editor, `team` a teammate's saved draft,
280
- * `library` the brain item, `accepted` the version this member wrote and an
281
- * admin accepted at a level above the Library's (admin or public),
282
- * `client-request` a client's SUBMITTED item (client logins C5, decision
283
- * 5 B), read only from /api/member/client-requests/:id; its `space` row
284
- * carries the review state, its `author` the client (role `client`). */
285
- export type MemberItemSource = 'own' | 'team' | 'library' | 'accepted' | 'client-request';
226
+ * opens it: `own` the member's editor, `library` the brain item, `accepted`
227
+ * the version this member wrote and an admin accepted, which the member's
228
+ * Library does not hold. (`team` and `client-request` rows went with review
229
+ * in workspaces W5c.) */
230
+ export type MemberItemSource = 'own' | 'library' | 'accepted';
286
231
 
287
232
  /** The small state pill a row wears beside its actions. Brain items (the
288
233
  * Library and accepted rows) wear none. */
@@ -298,29 +243,19 @@ export type MemberItemRow = {
298
243
  updatedAt: string;
299
244
  source: MemberItemSource;
300
245
  pill: MemberItemPill | null;
301
- /** The brain item's level (library and accepted rows); null on a draft. */
302
- audience: AccessLevel | null;
303
246
  /** A brain item a member wrote and an admin accepted: whose it is. */
304
247
  author: MemberItemAuthor | null;
305
248
  /** This member wrote it and an admin accepted it. */
306
249
  byMe: boolean;
307
- /** The personal-space row (own and team rows): sharing, review state, the
250
+ /** The personal-space row (own rows): sharing, review state, the
308
251
  * returned note, for the item view and the detail header. */
309
252
  space: MemberSpaceItemRow | null;
310
253
  };
311
254
 
312
- /** GET /api/member/client-requests/:id (client logins C5, decision 5 B): a
313
- * client's SUBMITTED item, read only, with its author (the client). File
314
- * bytes: /api/member/client-requests/:id/bytes. */
315
- export type MemberClientRequestItem<TDoc = unknown, TTable = unknown> = MemberSpaceItem<
316
- TDoc,
317
- TTable
318
- > & { author: MemberItemAuthor };
319
-
320
255
  /**
321
256
  * GET /api/member/items?kind=&q=&state=&page= (brains from the item-list
322
- * alignment release): the member's own items, teammates' shared drafts, the
323
- * Library and their accepted items above it, in ONE list, newest first.
257
+ * alignment release): the member's own items, the Library and their accepted
258
+ * items above it, in ONE list, newest first.
324
259
  * `state` is a MemberItemFilter (default `all`). Absent on older brains: the
325
260
  * client then falls back to the four source lists.
326
261
  */
package/src/dto/rows.ts CHANGED
@@ -672,82 +672,6 @@ export type TeamMemberActivity = {
672
672
  unread: number;
673
673
  };
674
674
 
675
- export type TeamRequest = {
676
- taskId: string;
677
- title: string;
678
- body: string;
679
- status: 'open' | 'done';
680
- priority: string;
681
- createdAt: string;
682
- /** Provenance from data.teamRequest. A member LOGIN's request (the only
683
- * kind filed since the team-code portal retired) has `loginId` set and
684
- * `contactId` null; a request from the old portal has a contact and no
685
- * login. Reply and "View their chat" apply when either is set. */
686
- contactId: string | null;
687
- /** The member login that filed it; null on a portal-era request. */
688
- loginId: string | null;
689
- contactName: string | null;
690
- /** When the owner last posted a resolution to the member for this request. */
691
- notifiedAt: string | null;
692
- /** True for a request a CLIENT login filed through the client-responder
693
- * (client logins C4, 0.232.336 on): the reply still goes into that
694
- * login's thread. Absent on older brains = a member's request. */
695
- fromClient?: boolean;
696
- };
697
-
698
- /** The newest thing waiting in one "needs you" queue: its title and who it
699
- * is from, never its content (a notification shows exactly this). */
700
- export type NeedsYouItem = {
701
- id: string;
702
- title: string;
703
- /** The member's display name (or the email's local part). */
704
- from: string;
705
- /** When it started waiting (submitted, or the request was filed). */
706
- at: string;
707
- /** A review item's kind: the workspace screen it is reviewed in
708
- * (workspace review pattern, 2026-10-09). Absent on a request, and on a
709
- * brain before it. */
710
- type?: 'page' | 'note' | 'table' | 'draw' | 'file';
711
- };
712
-
713
- /**
714
- * GET /api/team-admin/needs-you: what waits for an admin, as counts from
715
- * count queries (never a capped list), so every window and device shows the
716
- * same number. The owner live stream (/api/realtime) sends a change typed
717
- * `needs_you` whenever one of these counts may have moved; the client
718
- * refetches this. Admins only: a member login gets 403.
719
- */
720
- export type NeedsYou = {
721
- review: {
722
- /** Items members submitted (incl. taken items whose admin is gone). */
723
- submitted: number;
724
- /** Team-shared items deactivated logins left behind. */
725
- leftBehind: number;
726
- /** The newest submitted item, or null. */
727
- newest: NeedsYouItem | null;
728
- };
729
- requests: {
730
- /** Open (not done) team requests. */
731
- open: number;
732
- newest: NeedsYouItem | null;
733
- };
734
- /** Contacts whose sharing locked after 30 wrong codes in a day (contact
735
- * shares, migration 0214): the code opens nothing until the lock lapses
736
- * or an admin regenerates it. `newest.from` is empty. Absent from brains
737
- * before 0214. */
738
- sharing?: {
739
- locked: number;
740
- newest: NeedsYouItem | null;
741
- };
742
- /** Embedding or extraction provider failures an admin must act on
743
- * (migration 0230, docs/embeddings.md "Provider outages"). Absent from
744
- * brains before 0230; empty while all works. */
745
- providers?: ProviderAlert[];
746
- /** review.submitted + review.leftBehind + requests.open (+ sharing.locked)
747
- * (+ providers.length). */
748
- total: number;
749
- };
750
-
751
675
  /**
752
676
  * One open provider outage, as an admin sees it. `reason` is fixed text
753
677
  * chosen by `code`, never provider text: it is safe on a banner and a phone.
@@ -0,0 +1,60 @@
1
+ /**
2
+ * GET /api/shell: the chrome of the one (app) shell, for EVERY login (plan
3
+ * 7.1, workspaces W5c). An admin, a member and a client get the same shape;
4
+ * `role` says which. The brand (site name, theme, fonts, logo) is the
5
+ * brain's; the face (avatar, photo, starred screens) is the login's own.
6
+ * Before W5c a member read /api/member/shell and a client /api/client/shell;
7
+ * both now answer 410 code gone.
8
+ */
9
+ import type { TreeKind } from '../tree';
10
+ import type { ShellWorkspace, WorkspaceArea } from './workspaces';
11
+
12
+ /** Who is signed in, by role. */
13
+ export type ShellRole = 'admin' | 'member' | 'client';
14
+
15
+ /** What this brain can do, so a client branches on capability, not version. */
16
+ export type ShellFeatures = { recallV2: boolean };
17
+
18
+ export type Shell = {
19
+ role: ShellRole;
20
+ /** The login at the keyboard (the actor), never the anchor account. */
21
+ loginId: string;
22
+ /** Always true for a member or a client: onboarding is an admin's. */
23
+ onboarded: boolean;
24
+ features: ShellFeatures;
25
+ /** The generated avatar, from the login's own seed; null = initials. */
26
+ avatar: { style: string; seed: string; parts: unknown } | null;
27
+ /** The uploaded profile photo's cache-buster; null = none. */
28
+ avatarPhotoVersion: string | null;
29
+ /** Items waiting for the admin's approval. Always 0 for a member or a client. */
30
+ pendingApprovals: number;
31
+ /** The login's live workspaces (the switcher). */
32
+ workspaces: ShellWorkspace[];
33
+ /** The Admin areas the login holds. Always [] for a member or a client. */
34
+ areas: WorkspaceArea[];
35
+ /** Append as `?at=` to byte srcs an <img> cannot send a bearer with.
36
+ * Absent when it could not be minted. */
37
+ assetToken?: string;
38
+ /** The streamed upload cap, in bytes. */
39
+ maxUploadBytes: number;
40
+ displayName: string | null;
41
+ email: string | null;
42
+ /** The login's starred screens. [] when none. */
43
+ navFavorites: string[];
44
+ /** The kinds served as the item tree: the admin tree (/api/tree/:kind) for
45
+ * an admin, the reader tree for a member or a client. */
46
+ treeKinds: TreeKind[];
47
+ siteName: string | null;
48
+ peerName: string | null;
49
+ colorTheme: string | null;
50
+ fontLogo: string | null;
51
+ fontTitle: string | null;
52
+ fontUi: string | null;
53
+ fontProse: string | null;
54
+ fontSize: string | null;
55
+ fontLogoSize: string | null;
56
+ fontTitleSize: string | null;
57
+ fontProseSize: string | null;
58
+ logoVersion: string | null;
59
+ logoDarkVersion: string | null;
60
+ };
package/src/index.ts CHANGED
@@ -55,24 +55,12 @@ export type {
55
55
  SharedLinkRow,
56
56
  RetiredClientLinkRow,
57
57
  } from './dto/access';
58
- export type {
59
- AcceptConfirmLevelRefusal,
60
- AcceptPlace,
61
- AcceptPreview,
62
- AcceptRequest,
63
- AcceptVisibilityRefusal,
64
- ReviewAuthorRole,
65
- ReviewAuthorView,
66
- } from './dto/review';
67
58
  export type {
68
59
  AdminPrivateListRow,
69
60
  AdminSpaceItem,
70
61
  AdminSpaceItemRow,
71
62
  AdminSpaceList,
72
63
  AdminTakenFrom,
73
- GiveBackResult,
74
- MovedSpaceItem,
75
- TakeOverResult,
76
64
  MemberAcceptedItem,
77
65
  MemberAcceptedPage,
78
66
  MemberAcceptedRow,
@@ -88,22 +76,17 @@ export type {
88
76
  MemberLibraryPage,
89
77
  MemberLibraryRow,
90
78
  MemberReviewState,
91
- MemberShell,
92
79
  MemberSpaceFile,
93
80
  MemberSpaceItem,
94
81
  MemberSpaceItemBody,
95
82
  MemberSpaceItemRow,
96
- MemberClientRequestItem,
97
83
  MemberSpaceItemState,
98
84
  MemberSpaceList,
99
85
  MemberSpaceSharing,
100
86
  } from './dto/member';
101
87
  export type {
102
88
  AppLauncherFolder,
103
- ClientAppCard,
104
- ClientAppList,
105
89
  MemberAppCard,
106
- MemberAppLevel,
107
90
  MemberAppList,
108
91
  MemberChatArchiveMessage,
109
92
  MemberChatPortalThread,
@@ -143,13 +126,6 @@ export type {
143
126
  ApiV1Whoami,
144
127
  } from './dto/access-keys';
145
128
  export type {
146
- ClientAdminRefusedReason,
147
- ClientChatMessage,
148
- ClientChatQueued,
149
- ClientChatRefusedReason,
150
- ClientChatThread,
151
- ClientChatUsage,
152
- ClientLinkSignIn,
153
129
  ClientCodeAvailability,
154
130
  ClientCodeRequested,
155
131
  ClientCodeSignIn,
@@ -157,25 +133,10 @@ export type {
157
133
  ClientSigninSender,
158
134
  ClientSigninSenderPreview,
159
135
  ClientSenderRefusedReason,
160
- ClientLoginCreated,
161
- ClientLoginList,
162
- ClientLoginRow,
163
- ClientSharedItem,
164
- ClientSharedPage,
165
- ClientSharedRow,
166
- ClientSharedTable,
167
- ClientSharedTableColumn,
168
- ClientSharedTableRow,
169
- ClientShell,
170
- ClientSigninLinkCreated,
171
- ClientSigninLinkRow,
172
136
  ClientItemSource,
173
137
  ClientItemRow,
174
- ClientItemsPage,
175
- ClientSpaceRefusedReason,
176
138
  ClientAcceptedItem,
177
139
  ClientAcceptedBase,
178
- ClientStorageUsage,
179
140
  } from './dto/client';
180
141
 
181
142
  // Types only at the root; the runtime constants (APP_TINTS, limits) are the
@@ -243,6 +204,8 @@ export type {
243
204
  WorkspaceUserSearchResponse,
244
205
  WorkspaceUsersResponse,
245
206
  } from './dto/workspaces';
207
+ // GET /api/shell: the one shell, for every login (W5c).
208
+ export type { Shell, ShellFeatures, ShellRole } from './dto/shell';
246
209
  export type {
247
210
  GrantAddBody,
248
211
  GrantContactShare,
@@ -25,8 +25,6 @@ export const MEMBER_ITEM_FILTERS = [
25
25
  'with-admin',
26
26
  'brain',
27
27
  'by-me',
28
- // A client's submitted items (client logins C5, decision 5 B): read only.
29
- 'client-requests',
30
28
  ] as const;
31
29
  export type MemberItemFilter = (typeof MEMBER_ITEM_FILTERS)[number];
32
30
 
package/src/dto/review.ts DELETED
@@ -1,103 +0,0 @@
1
- /**
2
- * Member review, the admin side (`/api/team-admin/submissions/*` and the
3
- * admin's own Accept, `/api/admin/space/:id/accept`): the fields client
4
- * logins added (C1, audit A28). Additive only: every field is optional on
5
- * the wire, so an older brain or an older client keeps working.
6
- */
7
- import type { AccessItemView, AccessLevel } from './access';
8
- import type { TreeCrumb, TreeKind, TreeShareLevel, TreeVisibilityChange } from '../tree';
9
-
10
- /** Who wrote a reviewable item: a member or a client login. */
11
- export type ReviewAuthorRole = 'member' | 'client';
12
-
13
- /** GET /api/team-admin/submissions: a queue row's `author`. */
14
- export type ReviewAuthorView = {
15
- loginId: string | null;
16
- name: string;
17
- email: string | null;
18
- /** Deactivated, or the login is gone. */
19
- inactive: boolean;
20
- /** Member or client; null when the login is gone. Absent on brains
21
- * before client logins C1. */
22
- role?: ReviewAuthorRole | null;
23
- };
24
-
25
- /** GET /api/team-admin/submissions/:id/bundle: what Accept would move. */
26
- export type AcceptPreview = {
27
- items: { id: string; type: string; title: string }[];
28
- linksStayingBehind: number;
29
- /** Brain items in the embed closure of what Accept moves in, with their
30
- * CURRENT level. The client shows the ones above the chosen level: they
31
- * go DOWN with it and need a tick. */
32
- closure?: AccessItemView[];
33
- /** Where it lands by default (folder plan phase 5): the brain folder the
34
- * author filed it in (`folderId` null = the kind's top level), and the
35
- * author's own folders that become brain folders below it. Absent from
36
- * brains before the tree (pages joined it in folder phase 7). */
37
- place?: AcceptPlace;
38
- };
39
-
40
- export type AcceptPlace = {
41
- kind: TreeKind;
42
- folderId: string | null;
43
- /** The folder's crumbs, top-down, itself included. */
44
- crumbs: TreeCrumb[];
45
- creates: string[];
46
- /** The share it is read at there through a shared folder (null: none):
47
- * the item is read at the more open of this and the chosen level. Absent
48
- * from brains before the Accept visibility check. */
49
- share?: TreeShareLevel | null;
50
- };
51
-
52
- /** POST /api/team-admin/submissions/:id/accept and
53
- * POST /api/admin/space/:id/accept. */
54
- export type AcceptRequest = {
55
- audience?: AccessLevel;
56
- /** DEPRECATED (folder phase 7): pages do not nest; ignored. A page lands
57
- * like every tree kind (`folderId`). */
58
- parentPageId?: string | null;
59
- folderPath?: string | null;
60
- /** Where the item lands (folder plan phase 5): left out, in place; null,
61
- * the kind's top level; an id, a brain folder of its kind (the author's
62
- * own folders still go below it). The rest of the bundle lands in place. */
63
- folderId?: string | null;
64
- /** A client's item at client or public: the admin confirmed the level. */
65
- lowerConfirmed?: boolean;
66
- /** Ids of closure items the admin ticked (with `lowerConfirmed: true`).
67
- * For a client's item at client or public every closure item that goes
68
- * down must be here. */
69
- confirmedIds?: string[];
70
- /** The admin saw the `visibility` refusal's list and accepts that those
71
- * items are read above the chosen level where they land. */
72
- visibilityConfirmed?: boolean;
73
- /** The pin (workspace review pattern), required by the accept route: the
74
- * `submittedAt` of the version the admin was shown, null for a
75
- * left-behind item never submitted. Missing, or a different one now: 409
76
- * `changed`; nothing moved. */
77
- submittedAt?: string | null;
78
- };
79
-
80
- /** 409 from either Accept (brains with the Accept visibility check): the item, or something of its
81
- * bundle, lands in a shared folder and would be read above the chosen
82
- * level there. Nothing moved; repeat with `visibilityConfirmed: true`. */
83
- export type AcceptVisibilityRefusal = {
84
- error: string;
85
- reason: 'visibility';
86
- /** The first changes (at most TREE_VISIBILITY_LIST_MAX): `from` the
87
- * chosen level, `to` the level it would be read at. */
88
- changes: TreeVisibilityChange[];
89
- total: number;
90
- /** Brain items the bundle embeds that would be read through it at the
91
- * folder's share (migration 0208), `from` now, `to` then. Absent when
92
- * there are none, and from brains before it was listed. */
93
- alsoEmbeds?: TreeVisibilityChange[];
94
- };
95
-
96
- /** 409 from either Accept: a client's item at client or public without the
97
- * confirmation, or with a closure item that goes down not ticked. */
98
- export type AcceptConfirmLevelRefusal = {
99
- error: string;
100
- reason: 'confirm-level';
101
- /** The brain items that would go down with it (tick each one). */
102
- goingDown?: AccessItemView[];
103
- };