@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/package.json +1 -1
- package/src/app-nav.ts +5 -5
- package/src/app-viewer.ts +2 -2
- package/src/dto/access-keys.ts +6 -6
- package/src/dto/access.ts +13 -13
- package/src/dto/agent-graph.ts +2 -2
- package/src/dto/calls.ts +6 -6
- package/src/dto/client.ts +4 -4
- package/src/dto/file-deletes.ts +4 -4
- package/src/dto/grants.ts +12 -12
- package/src/dto/heartbeats.ts +2 -2
- package/src/dto/logins.ts +2 -2
- package/src/dto/member-apps.ts +6 -6
- package/src/dto/member-invites.ts +1 -1
- package/src/dto/member-mcp.ts +8 -9
- package/src/dto/member.ts +13 -13
- package/src/dto/messenger.ts +13 -10
- package/src/dto/people.ts +7 -2
- package/src/dto/rows.ts +41 -27
- package/src/dto/shell.ts +6 -7
- package/src/dto/views.ts +21 -22
- package/src/dto/workspace-hits.ts +7 -7
- package/src/dto/workspaces.ts +14 -15
- package/src/index.ts +6 -6
- package/src/kind-lists.ts +3 -4
- package/src/kinds.ts +12 -15
- package/src/member-kinds.ts +3 -4
- package/src/person-description.test.ts +47 -0
- package/src/person-description.ts +67 -0
- package/src/profile-flags.ts +5 -5
- package/src/role-names.ts +8 -11
- package/src/tree.ts +18 -19
- package/src/turn-streaming.ts +4 -4
- package/src/types/recall.ts +3 -7
package/package.json
CHANGED
package/src/app-nav.ts
CHANGED
|
@@ -101,9 +101,9 @@ export type AppOpenStat = { n: number; at: string };
|
|
|
101
101
|
/** Slim app row for navigation surfaces: everything the tree needs to render
|
|
102
102
|
* and search, nothing it doesn't. */
|
|
103
103
|
/**
|
|
104
|
-
* What the VIEWER may do with an app's data
|
|
105
|
-
*
|
|
106
|
-
*
|
|
104
|
+
* What the VIEWER may do with an app's data: read only, or read and change.
|
|
105
|
+
* The brain works it out per viewer with the same rule its database brokers
|
|
106
|
+
* apply; a client only shows it (the R and R/W pill).
|
|
107
107
|
*/
|
|
108
108
|
export type AppDataAccess = 'read' | 'read_write';
|
|
109
109
|
|
|
@@ -122,8 +122,8 @@ export type AppNavItem = {
|
|
|
122
122
|
* owner broker always writes, so 'read_write'. Absent from an older brain
|
|
123
123
|
* (show no pill). */
|
|
124
124
|
dataAccess?: AppDataAccess;
|
|
125
|
-
/** The app's MCP access switch
|
|
126
|
-
*
|
|
125
|
+
/** The app's MCP access switch: members' and clients' MCP may reach its
|
|
126
|
+
* data. Absent from an older brain. */
|
|
127
127
|
mcpAccess?: boolean;
|
|
128
128
|
/** Whether that switch reaches anyone now: on, published and below
|
|
129
129
|
* admin (members' and clients' MCP reach only such an app). Absent from
|
package/src/app-viewer.ts
CHANGED
|
@@ -14,8 +14,8 @@ import type { LoginRole } from './role-names';
|
|
|
14
14
|
/** The kind of viewer: a login (its role: the owner or an admin login, a
|
|
15
15
|
* member login), a Contact share's contact, or an open /s link (no person).
|
|
16
16
|
* `client` stays for the wire contract (additive only): a client login was
|
|
17
|
-
* a viewer kind
|
|
18
|
-
*
|
|
17
|
+
* a viewer kind before the role was removed, and an app may still test
|
|
18
|
+
* `:host_me_kind` for it. No brain answers it now. */
|
|
19
19
|
export type AppViewerKind = LoginRole | 'client' | 'contact' | 'public';
|
|
20
20
|
|
|
21
21
|
export type AppViewer = {
|
package/src/dto/access-keys.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Inbound API keys on the wire (migration 0232
|
|
2
|
+
* Inbound API keys on the wire (migration 0232): the
|
|
3
3
|
* Settings > API access screen, and the public API v1 answers about keys.
|
|
4
4
|
*
|
|
5
5
|
* A key acts as the ONE login that made it, as that login is now, and can
|
|
@@ -25,7 +25,7 @@ export const ACCESS_KEY_AREAS = [
|
|
|
25
25
|
'contacts',
|
|
26
26
|
'journal',
|
|
27
27
|
'apps',
|
|
28
|
-
// The data of mini apps opened to MCP (
|
|
28
|
+
// The data of mini apps opened to MCP (the app_data_* tools).
|
|
29
29
|
'app_data',
|
|
30
30
|
] as const;
|
|
31
31
|
export type AccessKeyArea = (typeof ACCESS_KEY_AREAS)[number];
|
|
@@ -71,10 +71,10 @@ export type AccessKeyList = {
|
|
|
71
71
|
/** The expiry a key gets when the create names none. */
|
|
72
72
|
defaultExpiryDays: number;
|
|
73
73
|
/** The longest expiry the caller may pick, in days; null = any, "never"
|
|
74
|
-
* included: a login in the Admin workspace with its keys area (
|
|
75
|
-
*
|
|
74
|
+
* included: a login in the Admin workspace with its keys area (never the
|
|
75
|
+
* role). Everyone else's keys last at most 90 days. */
|
|
76
76
|
maxExpiryDays: number | null;
|
|
77
|
-
/** Whether the create needs the caller's password: always
|
|
77
|
+
/** Whether the create needs the caller's password: always. */
|
|
78
78
|
needsPassword: boolean;
|
|
79
79
|
};
|
|
80
80
|
|
|
@@ -87,7 +87,7 @@ export type AccessKeyCreateInput = {
|
|
|
87
87
|
areas: AccessKeyArea[] | null;
|
|
88
88
|
/** Omitted = the default (90); null = never; else 1 to 3650 days. */
|
|
89
89
|
expiresInDays?: number | null;
|
|
90
|
-
/** Only for a login in the Admin workspace with its keys area
|
|
90
|
+
/** Only for a login in the Admin workspace with its keys area. */
|
|
91
91
|
riskyTools?: string[];
|
|
92
92
|
/** The caller's password, when `needsPassword` (never stored, never
|
|
93
93
|
* logged). */
|
package/src/dto/access.ts
CHANGED
|
@@ -13,8 +13,8 @@ import type { AccessContactShare } from './contact-shares';
|
|
|
13
13
|
export const ACCESS_LEVELS = ['admin', 'team', 'client', 'public'] as const;
|
|
14
14
|
export type AccessLevel = (typeof ACCESS_LEVELS)[number];
|
|
15
15
|
|
|
16
|
-
/** One item as the old Access control listed it (gone
|
|
17
|
-
*
|
|
16
|
+
/** One item as the old Access control listed it (gone: the routes answer
|
|
17
|
+
* 410). It carries no level on the wire. */
|
|
18
18
|
export type AccessItemView = {
|
|
19
19
|
id: string;
|
|
20
20
|
type: string;
|
|
@@ -33,17 +33,17 @@ export type AccessLinkView = {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
/** GET /api/access/nodes/:id */
|
|
36
|
-
/** Who wrote a brain item, when a member wrote it and an admin accepted it
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
36
|
+
/** Who wrote a brain item, when a member wrote it and an admin accepted it:
|
|
37
|
+
* the member-authored badge. `name` is the login's display name ("A member"
|
|
38
|
+
* without one, "A client" for a client without one, "Removed member" once
|
|
39
|
+
* deleted). `role` names the author's role: show "Client", never
|
|
40
|
+
* "A member", for a client; null once the login is deleted, and absent
|
|
41
|
+
* from an older brain. */
|
|
42
42
|
export type MemberItemAuthor = {
|
|
43
43
|
name: string;
|
|
44
44
|
acceptedAt: string | null;
|
|
45
45
|
/** `client` stays for the wire contract (additive only): the client role
|
|
46
|
-
* is gone
|
|
46
|
+
* is gone and no brain answers it now. */
|
|
47
47
|
role?: 'member' | 'client' | null;
|
|
48
48
|
};
|
|
49
49
|
|
|
@@ -131,7 +131,7 @@ export type AccessLoweredView = {
|
|
|
131
131
|
to: AccessLevel;
|
|
132
132
|
};
|
|
133
133
|
|
|
134
|
-
/** The old PATCH /api/access/nodes/:id (gone
|
|
134
|
+
/** The old PATCH /api/access/nodes/:id (gone: 410).
|
|
135
135
|
* `withClosure` only mattered for a folder (its contents). */
|
|
136
136
|
export type AccessNodeUpdate = {
|
|
137
137
|
item: AccessItemView;
|
|
@@ -266,9 +266,9 @@ export type SharedLinkRow = {
|
|
|
266
266
|
canWrite?: boolean;
|
|
267
267
|
};
|
|
268
268
|
|
|
269
|
-
/** An old client link the brain retired (
|
|
270
|
-
*
|
|
271
|
-
*
|
|
269
|
+
/** An old client link the brain retired (migration 0192): it answers a
|
|
270
|
+
* plain 410 now. No token: the link is dead. GET /api/team-admin/shares
|
|
271
|
+
* always sends `retired: []`. */
|
|
272
272
|
export type RetiredClientLinkRow = {
|
|
273
273
|
id: string;
|
|
274
274
|
nodeId: string;
|
package/src/dto/agent-graph.ts
CHANGED
|
@@ -82,8 +82,8 @@ export interface ToolDTO {
|
|
|
82
82
|
/** "External access" on an outside tool (mcp or http): everyone a shared
|
|
83
83
|
* app that declares it reaches (members, clients, contacts on a contact
|
|
84
84
|
* link) may call it. Null when off. Set it with
|
|
85
|
-
* `PUT /api/tools/:id/external-access`. On a CONNECTOR tool (mcp)
|
|
86
|
-
*
|
|
85
|
+
* `PUT /api/tools/:id/external-access`. On a CONNECTOR tool (mcp) it
|
|
86
|
+
* is the READ-ONLY MARK: the connector's level
|
|
87
87
|
* decides who may use the tool, and on = a read, off = a write (apps
|
|
88
88
|
* may write; a login's MCP needs its Write switch). */
|
|
89
89
|
externalAccess?: ToolExternalAccessDTO | null;
|
package/src/dto/calls.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Calls between people (
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Calls between people (docs/messenger.md, "Calls"): a call is a LiveKit
|
|
3
|
+
* room named after a messenger conversation. The routes live under
|
|
4
|
+
* /api/messenger; the brain mints every token and never hands out an admin
|
|
5
|
+
* grant. The system lines that mark a call ride the message
|
|
6
6
|
* stream (MessengerMessage.event, dto/messenger.ts).
|
|
7
7
|
*/
|
|
8
8
|
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
export type MessengerCapabilities = {
|
|
11
11
|
/** The Calls service is on for this brain: show the Call button. */
|
|
12
12
|
calls: boolean;
|
|
13
|
-
/** The agent worker is registered on this box
|
|
13
|
+
/** The agent worker is registered on this box: show the assistant
|
|
14
14
|
* row's Call button only then. */
|
|
15
15
|
callsAgent: boolean;
|
|
16
|
-
/** Always false
|
|
16
|
+
/** Always false: calls are voice only. */
|
|
17
17
|
video: false;
|
|
18
18
|
};
|
|
19
19
|
|
package/src/dto/client.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The client wire shapes left after
|
|
2
|
+
* The client wire shapes left after the client portal went. The portal
|
|
3
3
|
* (/api/client/*), admin-issued sign-in links and Team admin > Clients were
|
|
4
4
|
* removed: a client login uses the one (app) shell (`Shell`, GET /api/shell).
|
|
5
5
|
* What stays: the email sign-in codes (any client login signs in with one),
|
|
@@ -83,8 +83,8 @@ export type ClientSenderRefusedReason =
|
|
|
83
83
|
*/
|
|
84
84
|
export type ClientItemSource = 'own' | 'accepted';
|
|
85
85
|
|
|
86
|
-
/** One row of the client's My requests (GET /api/client/items, 410
|
|
87
|
-
*
|
|
86
|
+
/** One row of the client's My requests (GET /api/client/items, 410 now;
|
|
87
|
+
* the member files still build it). No level, no staff name. */
|
|
88
88
|
export type ClientItemRow = {
|
|
89
89
|
id: string;
|
|
90
90
|
type: ClientItemKind;
|
|
@@ -100,7 +100,7 @@ export type ClientItemRow = {
|
|
|
100
100
|
acceptedAt: string | null;
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
/** GET /api/client/accepted/:id (410
|
|
103
|
+
/** GET /api/client/accepted/:id (410 now) -> { item }: the version
|
|
104
104
|
* the client wrote and an admin accepted (the snapshot taken at Accept, never the brain's
|
|
105
105
|
* current version). A file's bytes: /api/client/files/:id while the brain
|
|
106
106
|
* file still holds the bytes accepted (`changedByAdmin` otherwise). */
|
package/src/dto/file-deletes.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A file delete's answers (
|
|
3
|
-
*
|
|
2
|
+
* A file delete's answers (docs/actors.md, "Who may do what"): what the
|
|
3
|
+
* client reads back from
|
|
4
4
|
* DELETE /api/files/files (bulk) and DELETE /api/files/files/:id?cascade=1.
|
|
5
5
|
*
|
|
6
6
|
* No name or id of an item the caller's scope does not read is ever in an
|
|
@@ -60,7 +60,7 @@ export type BulkDeleteCascadeResponse = {
|
|
|
60
60
|
reapedTotal: number;
|
|
61
61
|
/** Derived items kept because the caller may not delete them (in a
|
|
62
62
|
* workspace it does not manage, or one it does not read): left in place,
|
|
63
|
-
* over every file
|
|
63
|
+
* over every file. */
|
|
64
64
|
keptTotal: number;
|
|
65
65
|
refused: BulkDeleteRefusal[];
|
|
66
66
|
};
|
|
@@ -72,6 +72,6 @@ export type FileCascadeDeleteResponse = {
|
|
|
72
72
|
/** Derived items the reap could not delete (audit-visible). */
|
|
73
73
|
skipped: number;
|
|
74
74
|
/** Derived items kept because the caller may not delete them: a count,
|
|
75
|
-
* never a name
|
|
75
|
+
* never a name. */
|
|
76
76
|
kept: number;
|
|
77
77
|
};
|
package/src/dto/grants.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The Grant Access panel on the wire
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
2
|
+
* The Grant Access panel on the wire: /api/grants. An item is shared by a
|
|
3
|
+
* grant to a workspace; each grant has its own Write switch. Every item has
|
|
4
|
+
* ONE home workspace: only Moderators of the home manage the item's grants.
|
|
5
|
+
* Folders pass their grants to what is inside them (rows "via folder"); a
|
|
6
|
+
* row taken away from a folder-derived grant stays as "Removed here" until
|
|
7
|
+
* restored.
|
|
8
8
|
*
|
|
9
9
|
* Permissions are set in exactly two places: the workspace screen and this
|
|
10
10
|
* panel. Every refusal is `{ error, code }` with 400, 403, 404 or 409; an
|
|
@@ -96,7 +96,7 @@ export type GrantsResponse = {
|
|
|
96
96
|
app?: { mcpAccess: boolean };
|
|
97
97
|
/** Folders, when the caller may add items there: every workspace a new
|
|
98
98
|
* item placed in it takes (its rows not removed there, the home's
|
|
99
|
-
* included), named even where the caller is not a user
|
|
99
|
+
* included), named even where the caller is not a user. */
|
|
100
100
|
placesInto?: GrantWorkspaceRef[];
|
|
101
101
|
};
|
|
102
102
|
|
|
@@ -188,15 +188,14 @@ export type GrantErrorCode =
|
|
|
188
188
|
|
|
189
189
|
export type GrantError = { error: string; code: GrantErrorCode };
|
|
190
190
|
|
|
191
|
-
// ── Lists
|
|
191
|
+
// ── Lists ────────────────────────────────────────────────────────────────────
|
|
192
192
|
|
|
193
193
|
/** A workspace chip on a list row, with the workspace's look (its colour
|
|
194
194
|
* and icon, WorkspaceLook) from a brain that has one. */
|
|
195
195
|
export type ListWorkspace = WorkspaceLook & { id: string; name: string };
|
|
196
196
|
|
|
197
197
|
/**
|
|
198
|
-
* What the caller may do with an item, and what the item is
|
|
199
|
-
* 1): on every list row and item response of pages, notes, drawings,
|
|
198
|
+
* What the caller may do with an item, and what the item is: on every list row and item response of pages, notes, drawings,
|
|
200
199
|
* tables, files and apps, on the tree's items and folders, and on GET
|
|
201
200
|
* /api/nodes/:id. Set by the server on each of those; optional in the type
|
|
202
201
|
* only so older shapes still parse.
|
|
@@ -213,8 +212,9 @@ export type ItemCaps = {
|
|
|
213
212
|
readOnly?: true;
|
|
214
213
|
/** The brain item a read-only copy copies (the accepted item). */
|
|
215
214
|
snapshotOf?: string;
|
|
216
|
-
/** A member app that was in its author's trash when the spaces
|
|
217
|
-
* folded
|
|
215
|
+
/** A member app that was in its author's trash when the personal spaces
|
|
216
|
+
* were folded into workspaces: show it as "was in your trash" with
|
|
217
|
+
* Delete. */
|
|
218
218
|
trashedBeforeFold?: true;
|
|
219
219
|
};
|
|
220
220
|
|
package/src/dto/heartbeats.ts
CHANGED
|
@@ -52,7 +52,7 @@ export interface HeartbeatDTO {
|
|
|
52
52
|
quietHours: HeartbeatQuietHoursDTO | null;
|
|
53
53
|
earliestAt: string | null;
|
|
54
54
|
cooldownMinutes: number | null;
|
|
55
|
-
/** Empty for a login that is not the heartbeat's maker
|
|
55
|
+
/** Empty for a login that is not the heartbeat's maker:
|
|
56
56
|
* `stateHidden` is then true. */
|
|
57
57
|
state: Record<string, unknown>;
|
|
58
58
|
/** The state is another login's, so it is not shown (and an empty `state`
|
|
@@ -61,7 +61,7 @@ export interface HeartbeatDTO {
|
|
|
61
61
|
status: 'active' | 'paused' | 'completed' | 'cancelled';
|
|
62
62
|
completionReason: string | null;
|
|
63
63
|
/** The login that set up what this heartbeat does, when it is not the
|
|
64
|
-
* brain owner
|
|
64
|
+
* brain owner: the tick fires it in that login's scope.
|
|
65
65
|
* Null: the brain owner's. */
|
|
66
66
|
createdBy: string | null;
|
|
67
67
|
createdAt: string;
|
package/src/dto/logins.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Login kinds on the wire. Two: an admin and a member.
|
|
3
|
-
*
|
|
2
|
+
* Login kinds on the wire. Two: an admin and a member. There is no client
|
|
3
|
+
* login and no email-code sign-in: a login carries no
|
|
4
4
|
* permission of its own, what it reads and may do comes from its
|
|
5
5
|
* workspaces. A route that is not for the caller's kind answers 403 with
|
|
6
6
|
* one of the reasons below.
|
package/src/dto/member-apps.ts
CHANGED
|
@@ -21,8 +21,8 @@ export type MemberAppCard = {
|
|
|
21
21
|
* runs AND writes it. A write to a read-only app answers 403
|
|
22
22
|
* `{ ok: false, error, reason: 'read-only' }`. */
|
|
23
23
|
dataReadOnly?: boolean;
|
|
24
|
-
/** The same, as the R and R/W pill shows it
|
|
25
|
-
*
|
|
24
|
+
/** The same, as the R and R/W pill shows it. Absent from an older brain:
|
|
25
|
+
* show no pill. */
|
|
26
26
|
dataAccess?: AppDataAccess;
|
|
27
27
|
};
|
|
28
28
|
|
|
@@ -78,8 +78,8 @@ export type MemberHomeData<THub = unknown> =
|
|
|
78
78
|
{ homeApp: MemberHomeApp; hub: THub } | { homeApp: null; hub: null };
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
* GET /api/home?ws=<id>: the landing page of a workspace, for every login
|
|
82
|
-
*
|
|
81
|
+
* GET /api/home?ws=<id>: the landing page of a workspace, for every login.
|
|
82
|
+
* Without `ws` it is "All my workspaces": the built-in
|
|
83
83
|
* Desk over every workspace of the login, never a home app.
|
|
84
84
|
*
|
|
85
85
|
* `ws` echoes the workspace asked for (null: all). `homeApp` is the
|
|
@@ -113,7 +113,7 @@ export type MemberChatRow = {
|
|
|
113
113
|
active: boolean;
|
|
114
114
|
/** The login's role, named (0.232.333 on): 'member' for the team; absent
|
|
115
115
|
* for a former member who is an admin now (its old thread still shows).
|
|
116
|
-
* (No login is a client
|
|
116
|
+
* (No login is a client.) */
|
|
117
117
|
role?: 'member';
|
|
118
118
|
lastMessageAt: string | null;
|
|
119
119
|
lastMessageText: string | null;
|
|
@@ -132,7 +132,7 @@ export type MemberChatArchiveMessage = {
|
|
|
132
132
|
createdAt: string;
|
|
133
133
|
};
|
|
134
134
|
|
|
135
|
-
/** The selected login's OLD team portal chat (
|
|
135
|
+
/** The selected login's OLD team portal chat (team codes are retired): the
|
|
136
136
|
* thread its contact had with the team code before the invite made it a
|
|
137
137
|
* login. History only, for the admin: never part of the member's live
|
|
138
138
|
* thread, never shown to the member, never in the agent's context. Show it
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Member invites
|
|
2
|
+
* Member invites: an admin invites a person, who
|
|
3
3
|
* opens the invite link, sets a password and becomes a MEMBER login.
|
|
4
4
|
*
|
|
5
5
|
* Admin: /api/team-admin/invites (create, list, revoke). Public, no session:
|
package/src/dto/member-mcp.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A member's own view of Settings > MCP
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* A member's own view of Settings > MCP: GET /api/member/mcp. The member
|
|
3
|
+
* reads their access here; an admin sets it. The only thing a member
|
|
4
|
+
* changes is their own connected clients (DELETE
|
|
5
|
+
* /api/member/mcp/clients/:id).
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/** One MCP client the member connected: their live OAuth grants on it. */
|
|
@@ -27,11 +27,10 @@ export type MemberMcpView = {
|
|
|
27
27
|
access: { enabled: boolean; writeEnabled: boolean };
|
|
28
28
|
/** The clients this member connected, never another login's. */
|
|
29
29
|
clients: MemberMcpClient[];
|
|
30
|
-
/** The connectors (outside data sources) the member's workspaces hold
|
|
31
|
-
*
|
|
32
|
-
* tools.
|
|
33
|
-
*
|
|
34
|
-
* over MCP. Absent from a brain before Phase 2. */
|
|
30
|
+
/** The connectors (outside data sources) the member's workspaces hold:
|
|
31
|
+
* their MCP and their apps may use these tools. Read tools carry the
|
|
32
|
+
* admin's read-only mark; write tools need Write on over MCP. Absent
|
|
33
|
+
* from a brain without connector support. */
|
|
35
34
|
connectors?: MemberMcpConnector[];
|
|
36
35
|
};
|
|
37
36
|
|
package/src/dto/member.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The member API's wire shapes
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* The member API's wire shapes: what a MEMBER login's client reads from
|
|
3
|
+
* /api/member/*. A member reads what its workspaces hold (the brain
|
|
4
|
+
* enforces it with row security) and chats with the Team workspace's
|
|
5
|
+
* assistant in its own thread.
|
|
6
6
|
*/
|
|
7
7
|
import type { MemberItemAuthor } from './access';
|
|
8
8
|
import type { MemberItemKind } from '../member-kinds';
|
|
@@ -59,7 +59,7 @@ export type MemberChatThread = {
|
|
|
59
59
|
messages: MemberChatMessage[];
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
// ── Personal spaces
|
|
62
|
+
// ── Personal spaces ──────────────────────────────────────────────────────
|
|
63
63
|
|
|
64
64
|
export type MemberSpaceSharing = 'private' | 'team';
|
|
65
65
|
/** A personal item's review state as the brain stores it. `taken` (brains
|
|
@@ -102,18 +102,18 @@ export type MemberSpaceList = {
|
|
|
102
102
|
pageSize: number;
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
-
// ── An admin's private space and Take over
|
|
105
|
+
// ── An admin's private space and Take over ──────────────────────────────
|
|
106
106
|
|
|
107
107
|
/** Who wrote an item an admin took over from the Review queue (Take over
|
|
108
|
-
* and
|
|
109
|
-
*
|
|
108
|
+
* and the queue are gone; an item taken over earlier still names its
|
|
109
|
+
* author). */
|
|
110
110
|
export type AdminTakenFrom = {
|
|
111
111
|
/** The member login; null once that login is deleted. */
|
|
112
112
|
loginId: string | null;
|
|
113
113
|
/** Display name, else the email's local part; "Removed member" once the
|
|
114
114
|
* login is deleted. */
|
|
115
115
|
name: string;
|
|
116
|
-
/** Always false
|
|
116
|
+
/** Always false: Give back was removed. */
|
|
117
117
|
canGiveBack: boolean;
|
|
118
118
|
takenAt: string | null;
|
|
119
119
|
};
|
|
@@ -178,10 +178,10 @@ export type MemberSpaceItem<TDoc = unknown, TTable = unknown> = {
|
|
|
178
178
|
body: MemberSpaceItemBody<TDoc, TTable>;
|
|
179
179
|
};
|
|
180
180
|
|
|
181
|
-
// ── Accepted items
|
|
181
|
+
// ── Accepted items ──────────────────────────────────────────────────────
|
|
182
182
|
|
|
183
183
|
/** An item this member wrote and an admin accepted into the brain. No
|
|
184
|
-
* level
|
|
184
|
+
* level: whether the member's Library holds it too is
|
|
185
185
|
* its row in GET /api/member/items (`source` 'library'). */
|
|
186
186
|
export type MemberAcceptedRow = {
|
|
187
187
|
id: string;
|
|
@@ -225,8 +225,8 @@ export type MemberAcceptedItem =
|
|
|
225
225
|
/** Where a row of the one list comes from; it picks the item view that
|
|
226
226
|
* opens it: `own` the member's editor, `library` the brain item, `accepted`
|
|
227
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
|
|
229
|
-
*
|
|
228
|
+
* Library does not hold. (`team` and `client-request` rows went with
|
|
229
|
+
* review.) */
|
|
230
230
|
export type MemberItemSource = 'own' | 'library' | 'accepted';
|
|
231
231
|
|
|
232
232
|
/** The small state pill a row wears beside its actions. Brain items (the
|
package/src/dto/messenger.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The messenger (
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* people chats.
|
|
2
|
+
* The messenger (docs/messenger.md): direct chats and groups between the
|
|
3
|
+
* logins of one brain, under /api/messenger/*. The chat with an assistant
|
|
4
|
+
* stays in assistant_messages; the list shows each such thread as a row of
|
|
5
|
+
* kind 'agent' beside the people chats.
|
|
7
6
|
*
|
|
8
7
|
* Every number that orders a chat is a seq: the conversation's last_seq,
|
|
9
8
|
* a message's seq, a participant's read cursor. Clocks never order.
|
|
@@ -19,8 +18,7 @@ export type MessengerAuthorKind = 'login' | 'agent' | 'system';
|
|
|
19
18
|
|
|
20
19
|
export type MessengerParticipantKind = 'login' | 'agent';
|
|
21
20
|
|
|
22
|
-
/** An agent reply's state
|
|
23
|
-
* 'complete'. */
|
|
21
|
+
/** An agent reply's state; a person's message is always 'complete'. */
|
|
24
22
|
export type MessengerMessageStatus = 'complete' | 'pending' | 'failed';
|
|
25
23
|
|
|
26
24
|
/** The last line of a conversation, kept in its row by the send. */
|
|
@@ -53,6 +51,9 @@ export type MessengerParticipant = {
|
|
|
53
51
|
* `avatarPhotoVersion` is for the caller). null: no photo. The photo
|
|
54
52
|
* outranks the avatar. */
|
|
55
53
|
photoVersion?: string | null;
|
|
54
|
+
/** Logins only: who the person is to the team (their card's
|
|
55
|
+
* description, person-description.ts); null when none is set. */
|
|
56
|
+
description?: string | null;
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
/** One row of GET /api/messenger/conversations. */
|
|
@@ -101,9 +102,9 @@ export type MessengerConversation = {
|
|
|
101
102
|
archivedAt: string | null;
|
|
102
103
|
lastSeq: number;
|
|
103
104
|
lastMessageAt: string | null;
|
|
104
|
-
/** The bound workspace
|
|
105
|
+
/** The bound workspace, or null. */
|
|
105
106
|
workspaceId: string | null;
|
|
106
|
-
/** The group's agent
|
|
107
|
+
/** The group's agent, or null. */
|
|
107
108
|
agentId: string | null;
|
|
108
109
|
participants: MessengerParticipant[];
|
|
109
110
|
/** My own participant row. */
|
|
@@ -141,7 +142,7 @@ export type MessengerMessage = {
|
|
|
141
142
|
via: string | null;
|
|
142
143
|
/** '' once deleted. */
|
|
143
144
|
body: string;
|
|
144
|
-
/** Attachment ids
|
|
145
|
+
/** Attachment ids. */
|
|
145
146
|
attachments: string[];
|
|
146
147
|
mentions: MessengerMention[];
|
|
147
148
|
replyToSeq: number | null;
|
|
@@ -230,6 +231,8 @@ export type MessengerDirectoryEntry = {
|
|
|
230
231
|
avatar?: MessengerAvatar | null;
|
|
231
232
|
/** Logins only, as on a participant. */
|
|
232
233
|
photoVersion?: string | null;
|
|
234
|
+
/** Logins only, as on a participant: who the person is to the team. */
|
|
235
|
+
description?: string | null;
|
|
233
236
|
};
|
|
234
237
|
|
|
235
238
|
export type MessengerDirectoryResponse = { entries: MessengerDirectoryEntry[] };
|
package/src/dto/people.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* People (
|
|
2
|
+
* People (docs/messenger.md, "People"): what a person shares
|
|
3
3
|
* with its team, under /api/people/*. Every login is approved by hand, so a
|
|
4
|
-
* person's card (its name, avatar, photo and presence; later a
|
|
4
|
+
* person's card (its name, description, avatar, photo and presence; later a
|
|
5
|
+
* status) is
|
|
5
6
|
* open to the logins that may see it, and to nobody else: itself, the
|
|
6
7
|
* people sharing a live workspace with it (an Admin user sees every usable
|
|
7
8
|
* login), and the people of its chats. A login the caller may not see and a
|
|
@@ -32,6 +33,10 @@ export type PersonCard = {
|
|
|
32
33
|
/** The login id. */
|
|
33
34
|
id: string;
|
|
34
35
|
name: string;
|
|
36
|
+
/** Who the person is to the team: a job title, a role or a relationship
|
|
37
|
+
* ("Developer", "Jason's wife"), as they or an admin wrote it. null: none
|
|
38
|
+
* set. Agents read the same text (messenger_directory). */
|
|
39
|
+
description: string | null;
|
|
35
40
|
/** null: the client draws initials. */
|
|
36
41
|
avatar: PersonAvatar | null;
|
|
37
42
|
/** The uploaded photo's version, the `v` of GET /api/people/:id/photo?v=
|