@crossworks/client-types 0.400.28 → 0.400.31

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/src/dto/rows.ts CHANGED
@@ -57,7 +57,7 @@ export type TaskTodo = {
57
57
 
58
58
  /** Mirrors @mantle/db `NodeCommentAuthorKind`. `client` stays for the wire
59
59
  * contract (additive only) and for the comments a client login wrote
60
- * before workspaces W8a removed the role; no new comment gets it. */
60
+ * before the role was removed; no new comment gets it. */
61
61
  export type NodeCommentAuthorKind = 'owner' | 'member' | 'agent' | 'client';
62
62
 
63
63
  /**
@@ -140,8 +140,8 @@ export type PageRow = {
140
140
  summary: string | null;
141
141
  visibility: PageVisibility;
142
142
  width: PageWidth;
143
- /** A read-only snapshot copy of an accepted item (data.snapshot_of,
144
- * workspaces W6b fix round 1): nobody edits it, moves it out of its
143
+ /** A read-only snapshot copy of an accepted item (data.snapshot_of):
144
+ * nobody edits it, moves it out of its
145
145
  * private workspace or shares it; its author may delete it. Absent on
146
146
  * every other item. */
147
147
  readOnly?: true;
@@ -162,7 +162,7 @@ export type PageListRow = PageRow & {
162
162
  };
163
163
 
164
164
  /** A row of GET /api/pages (and of /api/notes, on its note row): the item
165
- * with its workspace chips and link pill (W5b2 contract changes 5 and 14).
165
+ * with its workspace chips and link pill.
166
166
  * The caller's own private rows carry them too, empty. */
167
167
  export type PagesListRow = PageRow & ListChips;
168
168
 
@@ -188,25 +188,25 @@ export type AppRow = {
188
188
  */
189
189
  shareMode: ShareMode | null;
190
190
  /** Whether this app is the home app of a workspace the reader sees (its
191
- * landing page, set on the workspace screen; task d78e7bde). */
191
+ * landing page, set on the workspace screen). */
192
192
  isHub: boolean;
193
193
  /** A live open public link exists (not revoked, not expired): the
194
- * "Public" pill. Absent from a brain before W5b2. */
194
+ * "Public" pill. Absent from an older brain. */
195
195
  hasLink?: boolean;
196
- /** Informational (client logins C6): members and clients only read the
197
- * app's data, whatever the grants' Write says. It changes no grant
198
- * (contract change 36): off, a member writes where a workspace of
199
- * theirs holds the app with Write on. Set with PATCH /api/apps/:id
196
+ /** Informational: members and clients only read the app's data,
197
+ * whatever the grants' Write says. It changes no grant (contract change
198
+ * 36): off, a member writes where a workspace of theirs holds the app
199
+ * with Write on. Set with PATCH /api/apps/:id
200
200
  * `{ dataReadOnly }`. Absent from an older brain: read as false. */
201
201
  dataReadOnly?: boolean;
202
- /** MCP access (team apps Phase 1, migration 0234): a member's or client's
202
+ /** MCP access (migration 0234): a member's or client's
203
203
  * MCP connection may reach this app's data (the app_data_* tools), at
204
204
  * the app's level, read or write by the login's Write switch and
205
205
  * `dataReadOnly`. Off by default. Set with PATCH /api/apps/:id
206
206
  * `{ mcpAccess }`. Absent from an older brain: read as false (and the
207
207
  * switch is not shown). */
208
208
  mcpAccess?: boolean;
209
- /** The author ceiling (team apps Phase 3, migration 0235): 'team' = the
209
+ /** The author ceiling (migration 0235): 'team' = the
210
210
  * app runs its tools at team rules for every runner, admins too (a
211
211
  * member wrote it, or its code came from a copy, an import or a
212
212
  * member-era restore). An admin lifts it with PATCH /api/apps/:id
@@ -225,7 +225,7 @@ export type AppRow = {
225
225
  /** A workspace as a list row's chip names it (the same as ListWorkspace). */
226
226
  export type WorkspaceChip = ListWorkspace;
227
227
 
228
- /** One row of GET /api/apps (workspaces W5b2): the chips every list row
228
+ /** One row of GET /api/apps: the chips every list row
229
229
  * carries (ListChips, lib/list-workspaces.ts). */
230
230
  export type AppListRow = AppRow & ListChips;
231
231
 
@@ -254,7 +254,7 @@ export type AppDetail = AppRow & {
254
254
  };
255
255
 
256
256
  /**
257
- * One entry on an app's History line (apps snapshots, Phase 2). A VERSION
257
+ * One entry on an app's History line. A VERSION
258
258
  * (`trigger` 'publish') is the code a publish made live; a SNAPSHOT (the
259
259
  * owner's, or one taken automatically before a restore or a schema change)
260
260
  * also holds a copy of the app's database. `seq` is the number the owner sees
@@ -294,9 +294,9 @@ export type AppSnapshot = {
294
294
  export type AppRestoreMode = 'code' | 'data' | 'full';
295
295
 
296
296
  /**
297
- * One entry on a table's History line (apps first-class plan, Phase 4). A
298
- * `commit` entry is the published table a commit replaced (kept by
299
- * itself, the newest 20); a `manual` one the owner took. Each holds a copy
297
+ * One entry on a table's History line. A `commit` entry is the published
298
+ * table a commit replaced (kept by itself, the newest 20); a `manual` one
299
+ * the owner took. Each holds a copy
300
300
  * of the whole workbook. `seq` is the number the owner sees (v1, v2 …).
301
301
  */
302
302
  export type TableSnapshot = {
@@ -312,6 +312,14 @@ export type TableSnapshot = {
312
312
  bytes: number | null;
313
313
  };
314
314
 
315
+ /** The client's UI sounds, per login (ProfilePreferences.sounds). */
316
+ export type SoundPreference = {
317
+ /** Every sound, the call ring included. */
318
+ enabled: boolean;
319
+ /** 0..1, on top of each sound's own level. */
320
+ volume: number;
321
+ };
322
+
315
323
  export type ProfilePreferences = {
316
324
  /** IANA timezone, e.g. 'Africa/Johannesburg'. UTC when not set. */
317
325
  timezone: string;
@@ -406,6 +414,10 @@ export type ProfilePreferences = {
406
414
  * the assistant's real knowledge of the user comes from the Journal identity
407
415
  * block; this is for greetings/UI. */
408
416
  displayName?: string;
417
+ /** Who this login is to the team ("Developer", "Jason's wife"): its
418
+ * person card's description, open to every login and agent that may see
419
+ * the card (PERSON_DESCRIPTION_MAX, person-description.ts). Unset: none. */
420
+ description?: string;
409
421
  /** Custom site name rendered as the header wordmark in place of "mantle" —
410
422
  * a per-box label (e.g. 'Refinery') so anyone with several brains can see at
411
423
  * a glance which one they're on. Cosmetic only; unset ⇒ the Mantle wordmark.
@@ -582,7 +594,7 @@ export type ProfilePreferences = {
582
594
  * group grant, so the switch can't be bypassed by a manifest change. Flip it
583
595
  * from the Team admin surface. */
584
596
  teamPrivateReads?: boolean;
585
- /** RETIRED (task d78e7bde, migration 0276): the brain-wide members' home
597
+ /** RETIRED (migration 0276): the brain-wide members' home
586
598
  * app. 0276 made it the Team workspace's home app
587
599
  * (workspaces.landing_app_id); nothing reads it any more. It stays in
588
600
  * the stored preferences so a rollback finds it. Read via
@@ -607,6 +619,11 @@ export type ProfilePreferences = {
607
619
  /** Per-login: sidebar favourite hrefs, in order. Moved server-side from the
608
620
  * web client's localStorage so they follow the person across devices. */
609
621
  navFavorites?: string[];
622
+ /** Per-login: the client's UI sounds (on/off and a volume), so the choice
623
+ * follows the person across browsers and devices. Unset until the login
624
+ * first changes it (the client's default applies). Written by
625
+ * PUT /api/profile/sounds; read via projectSounds, never raw. */
626
+ sounds?: SoundPreference;
610
627
  /** Per-login: open count + last-opened instant per app id, feeding the
611
628
  * "Most used" and "Recent" filters. Written by recordAppOpen. */
612
629
  appOpens?: Record<string, AppOpenStat>;
@@ -659,10 +676,8 @@ export type CuratedTeamSection = {
659
676
  };
660
677
 
661
678
  /** One contact's OLD team portal chat (the roster `team_chat_list` reads).
662
- * Since team codes were retired (member logins Phase 6, migration 0178) the
663
- * roster is every contact with portal chat, not every code holder. It was
664
- * also Team admin's "Chat archive" (GET /api/team-admin/members) until that
665
- * tab and its route were removed on 2026-10-09; the data stays. */
679
+ * Team codes are retired (migration 0178): the roster is every contact
680
+ * with portal chat, not every code holder. */
666
681
  export type TeamMemberActivity = {
667
682
  contactId: string;
668
683
  /** Contact node title; '(deleted contact)' can't occur here: portal chat
@@ -1015,7 +1030,7 @@ export interface OnboardingModelChoices {
1015
1030
  *
1016
1031
  * public — anyone with the link (the original model).
1017
1032
  *
1018
- * 'team' is retired (member logins Phase 6 stage 6): members read team items
1033
+ * 'team' is retired: members read team items
1019
1034
  * by level with their own logins. Migration 0176 revoked every team link, no
1020
1035
  * link is created or switched to team (PATCH /api/shares answers 400
1021
1036
  * `team-links-retired`), and an old team `/s` link shows a "sign in as a
@@ -1026,10 +1041,9 @@ export type ShareMode = 'public';
1026
1041
 
1027
1042
  /**
1028
1043
  * Why a link was refused (the `reason` of a 400 from the share routes):
1029
- * `team-links-retired` for a team link (member logins Phase 6), and
1030
- * `client-links-retired` for any link on an item at client level (client
1031
- * logins C1): client means signed-in clients, and public is the only level
1032
- * with an open link.
1044
+ * `team-links-retired` for a team link, and `client-links-retired` for any
1045
+ * link on an item at client level: client means signed-in clients, and
1046
+ * public is the only level with an open link.
1033
1047
  */
1034
1048
  export type ShareRetiredReason = 'team-links-retired' | 'client-links-retired';
1035
1049
 
package/src/dto/shell.ts CHANGED
@@ -1,10 +1,9 @@
1
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.
2
+ * GET /api/shell: the chrome of the one (app) shell, for EVERY login. An
3
+ * admin, a member and a client get the same shape; `role` says which. The
4
+ * brand (site name, theme, fonts, logo) is the brain's; the face (avatar,
5
+ * photo, starred screens) is the login's own. /api/member/shell and
6
+ * /api/client/shell answer 410 code gone.
8
7
  */
9
8
  import type { TreeKind } from '../tree';
10
9
  import type { LoginRole } from '../role-names';
@@ -27,7 +26,7 @@ export type Shell = {
27
26
  loginId: string;
28
27
  /** Whether this login is the brain's owner (its anchor login): only the
29
28
  * owner's app deletes are purged after 30 days; anyone else's stay in the
30
- * trash until the owner deletes them for good (W6b fix round 2). */
29
+ * trash until the owner deletes them for good. */
31
30
  isOwner: boolean;
32
31
  /** Always true for a member or a client: onboarding is an admin's. */
33
32
  onboarded: boolean;
package/src/dto/views.ts CHANGED
@@ -89,8 +89,8 @@ export type AgentSpend = {
89
89
  tokensIn: number;
90
90
  tokensOut: number;
91
91
  cacheReadTokens: number;
92
- /** Embedding input tokens, apart from the completion tokens above (A10 #5).
93
- * Absent from a server before it. */
92
+ /** Embedding input tokens, apart from the completion tokens above.
93
+ * Absent from an older server. */
94
94
  tokensEmbed?: number;
95
95
  runs: number;
96
96
  };
@@ -127,8 +127,8 @@ export type DailySpend = {
127
127
  tokensIn: number;
128
128
  tokensOut: number;
129
129
  cacheReadTokens: number;
130
- /** Embedding input tokens, apart from the completion tokens above (A10 #5).
131
- * Absent from a server before it. */
130
+ /** Embedding input tokens, apart from the completion tokens above.
131
+ * Absent from an older server. */
132
132
  tokensEmbed?: number;
133
133
  runs: number;
134
134
  };
@@ -646,11 +646,10 @@ export type SystemHealth = {
646
646
  connections: number | null;
647
647
  cacheHitPct: number | null;
648
648
  topTables: { name: string; bytes: number }[];
649
- /** Who the app's system pool logs in as (workspaces arch A9):
650
- * 'runtime' = mantle_runtime, not a superuser and owning no table (a
651
- * box after its roll, MANTLE_DB_RUNTIME_ROLE=1); 'superuser' = the
652
- * migrator's superuser (before the roll); 'other' = anything else.
653
- * Absent from a server before A9. */
649
+ /** Who the app's system pool logs in as: 'runtime' = mantle_runtime,
650
+ * not a superuser and owning no table (MANTLE_DB_RUNTIME_ROLE=1);
651
+ * 'superuser' = the migrator's superuser; 'other' = anything else.
652
+ * Absent from an older server. */
654
653
  role?: { mode: 'runtime' | 'superuser' | 'other'; user: string } | null;
655
654
  };
656
655
  storage: {
@@ -783,15 +782,15 @@ export type AgentTelegramChat = {
783
782
  label: string;
784
783
  status: 'pending' | 'allowed' | 'denied';
785
784
  lastMessageAt: string | null;
786
- /** The user the chat is paired to (workspaces W7d), null when none
785
+ /** The user the chat is paired to, null when none
787
786
  * (pending, blocked, or its login is gone). */
788
787
  loginId: string | null;
789
788
  /** That user's name, else email, for the list; null with no login. */
790
789
  pairedTo: string | null;
791
790
  };
792
791
 
793
- /** One of the signed-in user's own paired Telegram chats (workspaces W7d,
794
- * GET /api/telegram/my-chats). */
792
+ /** One of the signed-in user's own paired Telegram chats (GET
793
+ * /api/telegram/my-chats). */
795
794
  export type MyTelegramChat = {
796
795
  id: string;
797
796
  telegramChatId: string;
@@ -803,7 +802,7 @@ export type MyTelegramChat = {
803
802
  lastMessageAt: string | null;
804
803
  };
805
804
 
806
- /** A chat on a bot the signed-in user moderates (workspaces W7d, GET
805
+ /** A chat on a bot the signed-in user moderates (GET
807
806
  * /api/telegram/moderated-chats): a Moderator of the bot's assistant's
808
807
  * workspace, or an Admin user with the users area, blocks or unpairs it. */
809
808
  export type ModeratedTelegramChat = AgentTelegramChat & {
@@ -812,8 +811,8 @@ export type ModeratedTelegramChat = AgentTelegramChat & {
812
811
  agentSlug: string | null;
813
812
  };
814
813
 
815
- /** What POST /api/telegram/pair answers WITHOUT `confirm` (W7d fix round 1,
816
- * M3): what the code would pair, so the user sees whose chat it is before it
814
+ /** What POST /api/telegram/pair answers WITHOUT `confirm`: what the code
815
+ * would pair, so the user sees whose chat it is before it
817
816
  * becomes theirs. Nothing is paired. Confirm with the same code,
818
817
  * `confirm: true` and this `previewToken` (a confirm without it is 400). */
819
818
  export type TelegramPairPreview = {
@@ -823,20 +822,20 @@ export type TelegramPairPreview = {
823
822
  /** True when the chat is already paired to this user. */
824
823
  already: boolean;
825
824
  /** The Telegram chat: `label` is its checked @username, else "chat <id>"
826
- * (W7d+e: never the free title); `title` is its free title, at most 64
825
+ * (never the free title); `title` is its free title, at most 64
827
826
  * characters, or null: show it as plain text only, never as markup or a
828
827
  * link; and its id. */
829
828
  chat: { label: string; title: string | null; telegramChatId: string };
830
829
  /** The bot the chat is on (its @username). */
831
830
  bot: { name: string };
832
831
  agentName: string | null;
833
- /** Send back with the confirm (required since W7d+e): it then pairs this
832
+ /** Send back with the confirm (required): it then pairs this
834
833
  * chat and no other, for this code, within ten minutes of the preview. */
835
834
  previewToken: string;
836
835
  };
837
836
 
838
- /** What POST /api/telegram/pair answers with `confirm: true` (workspaces
839
- * W7d): the chat is paired to this user. */
837
+ /** What POST /api/telegram/pair answers with `confirm: true`: the chat is
838
+ * paired to this user. */
840
839
  export type TelegramPairResult = {
841
840
  ok: true;
842
841
  /** True when the chat was already paired to this user (no change). */
@@ -1003,8 +1002,8 @@ export type Traffic = {
1003
1002
  tokensIn: number;
1004
1003
  tokensOut: number;
1005
1004
  tokensCacheRead: number;
1006
- /** Embedding input tokens, apart from the completion tokens above (A10 #5).
1007
- * Absent from a server before it. */
1005
+ /** Embedding input tokens, apart from the completion tokens above.
1006
+ * Absent from an older server. */
1008
1007
  tokensEmbed?: number;
1009
1008
  };
1010
1009
 
@@ -1044,7 +1043,7 @@ export type StudioAgentDetail = {
1044
1043
  maxIterations?: number;
1045
1044
  /** Whether this is a manifest agent that can be reset to its canonical default. */
1046
1045
  resettable: boolean;
1047
- /** The base system prompt (editable prose in Phase 2). */
1046
+ /** The base system prompt (editable prose). */
1048
1047
  systemPrompt: string;
1049
1048
  /** The enabled, attached skills in composition order. */
1050
1049
  skillBlocks: ComposedSkillBlock[];
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Search across workspaces (task f26a516e). A search (GET /api/search, and
3
- * GET /api/tree/:kind/search asked with `across=1`) looks in every
4
- * workspace the caller reads, not only the one picked in the switcher. The
5
- * database's row rules decide what the caller reads; the switcher's
6
- * workspace (`ws`) only orders the hits: its own come first. Each hit names
7
- * the workspace it opens in, so a client tags a hit from another workspace
8
- * and switches there before it opens it.
2
+ * Search across workspaces (docs/folder-tree.md). A search (GET
3
+ * /api/search, and GET /api/tree/:kind/search asked with `across=1`) looks
4
+ * in every workspace the caller reads, not only the one picked in the
5
+ * switcher. The database's row rules decide what the caller reads; the
6
+ * switcher's workspace (`ws`) only orders the hits: its own come first.
7
+ * Each hit names the workspace it opens in, so a client tags a hit from
8
+ * another workspace and switches there before it opens it.
9
9
  *
10
10
  * Every field here is optional on the wire: a brain before it sends none,
11
11
  * and a client then shows no tag and does not switch.
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Workspace management on the wire (workspaces plan page 4887b8e7, phase
3
- * W5a): /api/workspaces and the two fields /api/shell adds. Users are flat;
4
- * every permission is set on a workspace screen (users, Moderator ticks,
5
- * resources) or, from W5b, on an item's Grant Access panel.
2
+ * Workspace management on the wire (docs/workspaces.md): /api/workspaces
3
+ * and the two fields /api/shell adds. Users are flat; every permission is
4
+ * set on a workspace screen (users, Moderator ticks, resources) or on an
5
+ * item's Grant Access panel.
6
6
  *
7
7
  * Every refusal is `{ error, code }` with 400, 403, 404 or 409. A workspace
8
8
  * or login the caller may not see answers 404, never 403.
@@ -10,8 +10,8 @@
10
10
  import type { AppTint } from '../app-nav';
11
11
  import type { LoginRole } from '../role-names';
12
12
 
13
- /** The Admin areas (plan 1.4), the one list of them (A10 #13: the brain's
14
- * SCOPE_AREAS, adminUserSql and the route classes read it). An Admin
13
+ /** The Admin areas, the one list of them (the brain's SCOPE_AREAS,
14
+ * adminUserSql and the route classes read it). An Admin
15
15
  * workspace user has all of them unless a per-user switch turns one off
16
16
  * (none can be switched off yet). In this order on the wire (the shell's
17
17
  * `areas`). */
@@ -30,7 +30,7 @@ export function isWorkspaceArea(v: unknown): v is WorkspaceArea {
30
30
  export type WorkspaceKind = 'admin' | 'team' | 'private' | 'other';
31
31
 
32
32
  /**
33
- * A workspace's look (task 5edc9149): on every workspace the brain lists
33
+ * A workspace's look: on every workspace the brain lists
34
34
  * (this list and screen, /api/shell's switcher list, and the chips of the
35
35
  * lists and the tree). `color` is a tint key of the folder palette, `icon`
36
36
  * an emoji or `lucide:<name>`, the folder vocabulary; null = the default:
@@ -56,8 +56,7 @@ export type Workspace = WorkspaceLook & {
56
56
  isAdmin: boolean;
57
57
  /** The built-in workspace: Admin only since migration 0286 (Team too
58
58
  * before). It cannot be renamed or archived (hide Rename and Archive
59
- * there). Its connectors are attached here like any workspace's since
60
- * W5b2. */
59
+ * there). Its connectors are attached here like any workspace's. */
61
60
  builtIn: boolean;
62
61
  /** Always false since migration 0286 (it marked the built-in Team
63
62
  * workspace, where every Admin workspace user was a Moderator). */
@@ -87,7 +86,7 @@ export type WorkspaceUser = {
87
86
  * Team workspace by being an Admin user). Only an Admin user ticks or
88
87
  * clears Moderator now (403 admin_only for anyone else). */
89
88
  adminViaArea: boolean;
90
- /** Who added them ("Added by NAME on DATE", plan S1): `name` is the
89
+ /** Who added them ("Added by NAME on DATE"): `name` is the
91
90
  * display name or else the email. null when unknown (the adder's login
92
91
  * is gone, or a migration or bridge added them). */
93
92
  addedBy: { loginId: string; name: string } | null;
@@ -116,7 +115,7 @@ export type WorkspaceDetailResponse = {
116
115
  /** The assistant has history (threads or messages): it cannot be swapped
117
116
  * or removed, only cloned to use elsewhere. */
118
117
  hasHistory: boolean;
119
- /** The workspace's landing page (task d78e7bde): its home app, or null
118
+ /** The workspace's landing page: its home app, or null
120
119
  * for the built-in Desk. Absent from an older brain. */
121
120
  landingApp?: WorkspaceLandingApp | null;
122
121
  };
@@ -224,15 +223,15 @@ export type ShellWorkspace = WorkspaceLook & {
224
223
  name: string;
225
224
  isAdmin: boolean;
226
225
  moderator: boolean;
227
- /** The login's own private workspace ("<name> (only you)", W6b): match
228
- * on this, never on the name (W6b fix round 1). Absent on any other. */
226
+ /** The login's own private workspace ("<name> (only you)"): match on
227
+ * this, never on the name. Absent on any other. */
229
228
  private?: true;
230
229
  };
231
230
  export type ShellWorkspaces = { workspaces: ShellWorkspace[]; areas: WorkspaceArea[] };
232
231
 
233
232
  /**
234
- * GET /api/auth/whoami (the phone app's first call with a bearer, workspaces
235
- * W7e): who the credential is, and the same workspaces, areas and owner
233
+ * GET /api/auth/whoami (the phone app's first call with a bearer): who the
234
+ * credential is, and the same workspaces, areas and owner
236
235
  * flag GET /api/shell gives (its builder). `areas` is empty for a login
237
236
  * outside the Admin workspace; `isOwner` is the brain's anchor login.
238
237
  * `brainId` is left out only while the database is behind the code.
package/src/index.ts CHANGED
@@ -6,10 +6,10 @@
6
6
  * Pure types: ZERO runtime, ZERO dependencies. That's the whole point — a client
7
7
  * component can name a row shape without importing `@mantle/db` (which drags
8
8
  * `postgres` into the browser bundle). This is the single source of truth for the
9
- * frontend/backend contract as screens move to client data-fetching (Phase 2 ·
10
- * Task 4); the server aliases its summary types to these so drift is a type error.
9
+ * frontend/backend contract as screens move to client data-fetching; the
10
+ * server aliases its summary types to these so drift is a type error.
11
11
  *
12
- * Since the jackdaw-repo-split P0 this package is the CONTRACT package: subpath
12
+ * This package is the CONTRACT package: subpath
13
13
  * modules (`version`, `turn-streaming`, `traces-format`, `types/*`, `lib/*`, …)
14
14
  * carry the small dependency-free constants and helpers both sides of the wire
15
15
  * share. This root index stays types-only; subpaths may hold runtime code but
@@ -228,7 +228,7 @@ export type {
228
228
  TreeVisibilityRefusal,
229
229
  TreeWorkspaceChange,
230
230
  } from './tree';
231
- // Role and actor names (A10 #13). Types only; the lists (LOGIN_ROLES,
231
+ // Role and actor names. Types only; the lists (LOGIN_ROLES,
232
232
  // HISTORY_ACTORS, RECALL_ACTOR_KINDS) are the `@mantle/client-types/role-names`
233
233
  // subpath. RecallActorKind comes through ./dto/recall.
234
234
  export type { HistoryActor, LoginRole } from './role-names';
@@ -264,7 +264,7 @@ export type {
264
264
  WorkspaceUserSearchResponse,
265
265
  WorkspaceUsersResponse,
266
266
  } from './dto/workspaces';
267
- // GET /api/shell: the one shell, for every login (W5c).
267
+ // GET /api/shell: the one shell, for every login.
268
268
  export type { Shell, ShellFeatures, ShellRole } from './dto/shell';
269
269
  // GET and PUT /api/profile/home-desk: the login's Desk, compare-and-set.
270
270
  export type { HomeDesk, HomeDeskItem, HomeDeskPutBody, HomeDeskState } from './dto/home-desk';
@@ -292,7 +292,7 @@ export type {
292
292
  ListWorkspace,
293
293
  ListWsEcho,
294
294
  } from './dto/grants';
295
- // Search across workspaces (task f26a516e).
295
+ // Search across workspaces.
296
296
  export type {
297
297
  ElsewhereCount,
298
298
  HitWorkspace,
package/src/kind-lists.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  /**
2
- * The kind lists that were written by hand across the repo (arch plan A10
3
- * #12), each now a filter over one field of the kind registry (./kinds).
2
+ * The kind lists of the repo, each a filter over one field of the kind
3
+ * registry (./kinds).
4
4
  * Every list is in registry order (the Drizzle enum's) unless it says
5
5
  * otherwise; the code asks each one for membership only.
6
6
  *
7
- * kind-lists.test.ts pins every list to its value on main v0.300.46 and
8
- * names, cell by cell, the few that changed with the move.
7
+ * kind-lists.test.ts pins every list's value.
9
8
  *
10
9
  * Pure and dependency free: the `@mantle/client-types/kind-lists` subpath.
11
10
  */
package/src/kinds.ts CHANGED
@@ -14,15 +14,14 @@
14
14
  * (@mantle/content-core/profile-projections), teamHidden;
15
15
  * - MEMBER_ITEM_KINDS and CLIENT_ITEM_KINDS (./member-kinds), library: kept
16
16
  * one pair release, then they go with the field;
17
- * - the lists of ./kind-lists (A10 #12): extract, corpusMap, contextRef,
17
+ * - the lists of ./kind-lists: extract, corpusMap, contextRef,
18
18
  * embeds, mentionTarget, linkServes, exportAs, accepted, searchTool,
19
19
  * peerPick, documentTitle. A literal list of kind names anywhere else is
20
20
  * an arch count pinned at 0 (eslint-rules/arch-counts.mjs handKindLists);
21
- * - what a write re-indexes (A10 #7): `indexed`, read by markContentChanged
21
+ * - what a write re-indexes: `indexed`, read by markContentChanged
22
22
  * (@mantle/db) and indexWorkFor below; a hand re-index anywhere else is
23
23
  * an arch count pinned at 0 (eslint-rules/no-hand-reindex.mjs).
24
24
  *
25
- * Each field holds the value the code had when the registry came in (A1).
26
25
  * Who may share or see a kind changes here only as a reviewed diff of the
27
26
  * snapshot tests (kinds.test.ts and the tests next to each derived list),
28
27
  * never as a side effect of another list.
@@ -75,20 +74,19 @@ export type KindSpec = {
75
74
  /** The kind's item routes: the content prefix (`:id` follows it; the
76
75
  * member route lists are generated from it, route-scope.ts) and the
77
76
  * public API v1 prefix. Null where the kind has none. Nothing reads `v1`
78
- * yet: A4 generates the content rows of ROUTE_POLICY from both (plan v2,
79
- * section 7; D3, v1 answers as its base route). */
77
+ * yet. */
80
78
  readonly route: { readonly content: string | null; readonly v1: string | null };
81
79
  /** Hidden from a team surface: 'never' (opt-in or not), 'private-corpus'
82
80
  * (unless the owner opted in, teamPrivateReads), or not. */
83
81
  readonly teamHidden: 'never' | 'private-corpus' | false;
84
82
  /** The old Library lists: in MEMBER_ITEM_KINDS at `order`, and in
85
- * CLIENT_ITEM_KINDS too when `client`. Kept one pair release (A1), then
83
+ * CLIENT_ITEM_KINDS too when `client`. Kept one pair release, then
86
84
  * removed with them. */
87
85
  readonly library: { readonly order: number; readonly client: boolean } | false;
88
86
 
89
- // ── A10 #12: the hand kind lists, now fields (./kind-lists derives them).
90
- // Each holds the value its list had on main v0.300.46 (kind-lists.test.ts
91
- // RECORDED), except the changes that test names.
87
+ // ── The kind lists, as fields (./kind-lists derives them).
88
+ // Each holds the value kind-lists.test.ts RECORDED, except the changes
89
+ // that test names.
92
90
 
93
91
  /** The extractor reads it by default (DEFAULT_EXTRACT_TYPES, a worker's
94
92
  * `target_types` overrides), and the integrity view lists it
@@ -123,20 +121,19 @@ export type KindSpec = {
123
121
  /** Its title names a document, not a thing the user does (entity-names). */
124
122
  readonly documentTitle: boolean;
125
123
 
126
- // ── A10 #7: what a write re-indexes.
124
+ // ── What a write re-indexes.
127
125
 
128
126
  /** Every field a write of this kind may change, with the index work its
129
127
  * change redoes (markContentChanged, @mantle/db): 'embed', 'extract', or
130
128
  * false (the field feeds no index). A write names the fields it changed;
131
129
  * the most work any of them asks for is done once. Each value holds what
132
- * main did at v0.300.48, where a10-content-changed.main.json was
133
- * recorded, except the cells
130
+ * a10-content-changed.main.json recorded, except the cells
134
131
  * a10-content-changed.changes.json names. Turning a field to 'extract'
135
132
  * makes every save of it a model call: a cost decision, never a tidy-up. */
136
133
  readonly indexed: Readonly<Record<string, IndexWork | false>>;
137
134
  };
138
135
 
139
- /** What a change of an indexed field makes the extractor redo (A10 #7).
136
+ /** What a change of an indexed field makes the extractor redo.
140
137
  * 'embed': the vector only, rebuilt from the title and the summary the item
141
138
  * keeps, or with none from the title and the text read locally (one
142
139
  * embedding on the local embedder, never a model call; a table also
@@ -840,7 +837,7 @@ export type KindsWhere<P> = { [K in ItemKind]: Kinds[K] extends P ? K : never }[
840
837
  * the lists derived here (their snapshot tests say so). Frozen: several
841
838
  * names share one list (DEFAULT_EXTRACT_TYPES and LANDED_TYPES are both
842
839
  * EXTRACT_KINDS), so a caller that sorted or pushed onto its own would
843
- * change every other's (low round, F4). */
840
+ * change every other's. */
844
841
  export function kindsWhere<K extends ItemKind = ItemKind>(
845
842
  pick: (spec: KindSpec, type: ItemKind) => boolean,
846
843
  ): readonly [K, ...K[]] {
@@ -900,7 +897,7 @@ export function treeKindsBy(key: 'order' | 'liveOrder'): readonly RegistryTreeKi
900
897
  .map((t) => t.kind as RegistryTreeKind);
901
898
  }
902
899
 
903
- // ── A10 #7: what a write re-indexes ─────────────────────────────────────────
900
+ // ── What a write re-indexes ─────────────────────────────────────────────────
904
901
 
905
902
  /** The fields a write of kind `K` may name (its `indexed` keys). */
906
903
  export type IndexedField<K extends ItemKind> = keyof Kinds[K]['indexed'] & string;
@@ -1,12 +1,11 @@
1
1
  /**
2
2
  * The kinds of item a member works with: what a personal space holds and
3
3
  * what the Library lists. The ONE list, for the brain (member-space.ts,
4
- * member-library.ts) and the client alike (audit M2); a runtime constant, so
4
+ * member-library.ts) and the client alike; a runtime constant, so
5
5
  * it is the `@mantle/client-types/member-kinds` subpath.
6
6
  *
7
- * DEPRECATED (workspaces arch A1): derived from the kind registry's `library`
8
- * field (./kinds) and kept exported for one pair release, then removed. Use
9
- * the registry.
7
+ * DEPRECATED: derived from the kind registry's `library` field (./kinds)
8
+ * and kept exported for one pair release, then removed. Use the registry.
10
9
  */
11
10
  import {
12
11
  ITEM_KINDS,
@@ -0,0 +1,47 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import {
3
+ normalizePersonDescription,
4
+ PERSON_DESCRIPTION_MAX,
5
+ personDescriptionLength,
6
+ projectPersonDescription,
7
+ } from './person-description';
8
+
9
+ describe('a person description', () => {
10
+ it('is one line: white space runs, newlines and tabs become one space', () => {
11
+ expect(normalizePersonDescription(' Dev\n\tops lead \r\n')).toBe('Dev ops lead');
12
+ expect(normalizePersonDescription('a
b
c')).toBe('a b c');
13
+ });
14
+
15
+ it('drops control and format characters, so nothing hides or reorders text', () => {
16
+ // U+0000 (which jsonb refuses), a bidi override, isolates and marks.
17
+ expect(normalizePersonDescription('Finance\u0000 ‮regnam‬')).toBe('Finance regnam');
18
+ expect(normalizePersonDescription('⁦a⁩‎b‏c؜d')).toBe('abcd');
19
+ // Zero-width space, non-joiner, word joiner, byte order mark, soft hyphen.
20
+ expect(normalizePersonDescription('a​b‌c⁠de­f')).toBe('abcdef');
21
+ expect(normalizePersonDescription('\u0007\u001B\u007F\u0085')).toBe('');
22
+ // A joiner outside an emoji is invisible text too.
23
+ expect(normalizePersonDescription('ad‍min')).toBe('admin');
24
+ });
25
+
26
+ it('keeps an emoji whole, its joiners and its variation selector included', () => {
27
+ const family = '\u{1F468}‍\u{1F469}‍\u{1F467}';
28
+ const heart = '❤️‍\u{1F525}';
29
+ expect(normalizePersonDescription(`${family} dad`)).toBe(`${family} dad`);
30
+ expect(normalizePersonDescription(heart)).toBe(heart);
31
+ });
32
+
33
+ it('projects nothing visible as none, and caps by code point, never inside one', () => {
34
+ expect(projectPersonDescription(' ​\n ')).toBeNull();
35
+ expect(projectPersonDescription(42)).toBeNull();
36
+ expect(projectPersonDescription(' Developer ')).toBe('Developer');
37
+ const long = projectPersonDescription('\u{1F600}'.repeat(PERSON_DESCRIPTION_MAX + 1))!;
38
+ expect(personDescriptionLength(long)).toBe(PERSON_DESCRIPTION_MAX);
39
+ expect(long).toBe('\u{1F600}'.repeat(PERSON_DESCRIPTION_MAX));
40
+ // A stored value from before the rule reads clean.
41
+ expect(projectPersonDescription('Ops‮\nlead')).toBe('Ops lead');
42
+ });
43
+
44
+ it('counts code points: an emoji is one', () => {
45
+ expect(personDescriptionLength('\u{1F600}ab')).toBe(3);
46
+ });
47
+ });