@crossworks/client-types 0.239.100 → 0.300.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/dto/access-keys.ts +12 -12
- package/src/dto/access.ts +4 -8
- package/src/dto/agent-graph.ts +0 -11
- package/src/dto/logins.ts +11 -11
- package/src/dto/member-apps.ts +5 -6
- package/src/dto/rows.ts +0 -11
- package/src/dto/shell.ts +1 -1
- package/src/dto/workspaces.ts +1 -1
- package/src/tree.ts +3 -9
package/package.json
CHANGED
package/src/dto/access-keys.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Inbound API keys on the wire (migration 0232, plan page 1e62e204): the
|
|
3
3
|
* Settings > API access screen, and the public API v1 answers about keys.
|
|
4
4
|
*
|
|
5
|
-
* A key acts as the ONE login that made it
|
|
6
|
-
*
|
|
5
|
+
* A key acts as the ONE login that made it, as that login is now, and can
|
|
6
|
+
* only narrow it: `access` (read or read_write) and `areas` (null = every area). It is
|
|
7
7
|
* a Bearer on /api/v1/* and /api/mcp, nowhere else. The secret is in the
|
|
8
8
|
* create answer once; no other answer carries it or its hash.
|
|
9
9
|
*
|
|
@@ -31,7 +31,7 @@ export type AccessKeyArea = (typeof ACCESS_KEY_AREAS)[number];
|
|
|
31
31
|
|
|
32
32
|
export type AccessKeyAccess = 'read' | 'read_write';
|
|
33
33
|
|
|
34
|
-
export type AccessKeyRole = 'admin' | 'member'
|
|
34
|
+
export type AccessKeyRole = 'admin' | 'member';
|
|
35
35
|
|
|
36
36
|
export type AccessKeyStatus = 'active' | 'expired' | 'revoked';
|
|
37
37
|
|
|
@@ -46,7 +46,8 @@ export type AccessKeyView = {
|
|
|
46
46
|
access: AccessKeyAccess;
|
|
47
47
|
/** null = every area. */
|
|
48
48
|
areas: AccessKeyArea[] | null;
|
|
49
|
-
/**
|
|
49
|
+
/** A key of a login in Admin with the keys area, on /api/mcp: risky
|
|
50
|
+
* tools allowed by name (the admin gate still decides each call). */
|
|
50
51
|
riskyTools: string[];
|
|
51
52
|
status: AccessKeyStatus;
|
|
52
53
|
/** ISO time; null = never expires. */
|
|
@@ -58,21 +59,20 @@ export type AccessKeyView = {
|
|
|
58
59
|
revokedAt: string | null;
|
|
59
60
|
};
|
|
60
61
|
|
|
61
|
-
/** GET /api/access-keys. A member
|
|
62
|
-
*
|
|
62
|
+
/** GET /api/access-keys. A member gets their own keys; an admin gets every
|
|
63
|
+
* key on the brain. */
|
|
63
64
|
export type AccessKeyList = {
|
|
64
65
|
keys: AccessKeyView[];
|
|
65
|
-
/** The caller's
|
|
66
|
+
/** The caller's kind: an admin sees every key. */
|
|
66
67
|
role: AccessKeyRole;
|
|
67
68
|
areas: AccessKeyArea[];
|
|
68
69
|
/** The expiry a key gets when the create names none. */
|
|
69
70
|
defaultExpiryDays: number;
|
|
70
71
|
/** The longest expiry the caller may pick, in days; null = any, "never"
|
|
71
|
-
* included
|
|
72
|
-
*
|
|
72
|
+
* included: a login in the Admin workspace with its keys area (W8a, never
|
|
73
|
+
* the role). Everyone else's keys last at most 90 days. */
|
|
73
74
|
maxExpiryDays: number | null;
|
|
74
|
-
/** Whether the create needs the caller's password
|
|
75
|
-
* a client has none). */
|
|
75
|
+
/** Whether the create needs the caller's password: always since W8a. */
|
|
76
76
|
needsPassword: boolean;
|
|
77
77
|
};
|
|
78
78
|
|
|
@@ -85,7 +85,7 @@ export type AccessKeyCreateInput = {
|
|
|
85
85
|
areas: AccessKeyArea[] | null;
|
|
86
86
|
/** Omitted = the default (90); null = never; else 1 to 3650 days. */
|
|
87
87
|
expiresInDays?: number | null;
|
|
88
|
-
/** Only for
|
|
88
|
+
/** Only for a login in the Admin workspace with its keys area (W8a). */
|
|
89
89
|
riskyTools?: string[];
|
|
90
90
|
/** The caller's password, when `needsPassword` (never stored, never
|
|
91
91
|
* logged). */
|
package/src/dto/access.ts
CHANGED
|
@@ -13,12 +13,12 @@ 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 Access control
|
|
16
|
+
/** One item as the old Access control listed it (gone since W5b2: the
|
|
17
|
+
* routes answer 410). Its level went from the wire in W8c. */
|
|
17
18
|
export type AccessItemView = {
|
|
18
19
|
id: string;
|
|
19
20
|
type: string;
|
|
20
21
|
title: string;
|
|
21
|
-
audience: AccessLevel;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
/** The item's link. `path` is server-relative (`/s/<token>`). */
|
|
@@ -129,9 +129,8 @@ export type AccessLoweredView = {
|
|
|
129
129
|
to: AccessLevel;
|
|
130
130
|
};
|
|
131
131
|
|
|
132
|
-
/** PATCH /api/access/nodes/:id
|
|
133
|
-
* `withClosure` only
|
|
134
|
-
* drawing's or note's embeds always follow it down. */
|
|
132
|
+
/** The old PATCH /api/access/nodes/:id (gone since W5b2: 410).
|
|
133
|
+
* `withClosure` only mattered for a folder (its contents). */
|
|
135
134
|
export type AccessNodeUpdate = {
|
|
136
135
|
item: AccessItemView;
|
|
137
136
|
/** Everything lowered with it, at its new level: the embeds that followed
|
|
@@ -177,9 +176,6 @@ export type ClientReportRef = {
|
|
|
177
176
|
* is not the brain's (a personal item), whose title is never shown. */
|
|
178
177
|
type: string | null;
|
|
179
178
|
title: string | null;
|
|
180
|
-
/** The item's level; null when it is not a brain item (a personal item,
|
|
181
|
-
* or gone). */
|
|
182
|
-
audience: AccessLevel | null;
|
|
183
179
|
};
|
|
184
180
|
|
|
185
181
|
/** One item at client level, as the report lists it. */
|
package/src/dto/agent-graph.ts
CHANGED
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
* public surface is byte-identical — only the file a symbol lives in moved.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import type { AccessLevel } from './access';
|
|
13
|
-
|
|
14
12
|
// ── Skills ────────────────────────────────────────────────────────────────────
|
|
15
13
|
|
|
16
14
|
/** A skill as returned by `GET /api/skills`. */
|
|
@@ -197,15 +195,6 @@ export interface ToolGroupDTO {
|
|
|
197
195
|
/** Set when the group is an API integration; null for capability-only bundles. */
|
|
198
196
|
integration: ToolGroupIntegrationDTO | null;
|
|
199
197
|
enabled: boolean;
|
|
200
|
-
/** The group's level: an agent or a team app may hold it only at or above
|
|
201
|
-
* it, and team apps call only built-in tools in an enabled group at team
|
|
202
|
-
* level or below. A CONNECTOR group's level also decides who may use its
|
|
203
|
-
* tools in apps and over their own MCP (team apps Phase 2): members at
|
|
204
|
-
* team level or lower, clients at client level, contact links at
|
|
205
|
-
* public; single http tools follow External access. Absent from servers
|
|
206
|
-
* before it shipped. Set it with
|
|
207
|
-
* `PATCH /api/access/tool-groups/:slug { audience }`. */
|
|
208
|
-
audience?: AccessLevel;
|
|
209
198
|
createdAt: string;
|
|
210
199
|
updatedAt: string;
|
|
211
200
|
}
|
package/src/dto/logins.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Login
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Login kinds on the wire. Two: an admin and a member. The client login and
|
|
3
|
+
* its email-code sign-in went in workspaces W8a: a login carries no
|
|
4
|
+
* permission of its own, what it reads and may do comes from its
|
|
5
|
+
* workspaces. A route that is not for the caller's kind answers 403 with
|
|
6
|
+
* one of the reasons below.
|
|
6
7
|
*/
|
|
7
8
|
|
|
8
9
|
/** Who a login is. The brain reads it from the login row on every request. */
|
|
9
|
-
export type LoginKind = 'admin' | 'member'
|
|
10
|
+
export type LoginKind = 'admin' | 'member';
|
|
10
11
|
|
|
11
|
-
/** The `reason` of a 403 a gate answers a login of the wrong
|
|
12
|
-
* `member-login` from an admin route, `admin-login` from a member route
|
|
13
|
-
|
|
14
|
-
export type LoginRefusedReason = 'member-login' | 'admin-login' | 'client-login';
|
|
12
|
+
/** The `reason` of a 403 a gate answers a login of the wrong kind with:
|
|
13
|
+
* `member-login` from an admin route, `admin-login` from a member route. */
|
|
14
|
+
export type LoginRefusedReason = 'member-login' | 'admin-login';
|
|
15
15
|
|
|
16
16
|
/** The body of that 403. */
|
|
17
17
|
export type LoginRefused = {
|
|
@@ -21,8 +21,8 @@ export type LoginRefused = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
/** The 400 POST /api/users/:id/password answers when the target does not sign
|
|
24
|
-
* in with a password: a
|
|
25
|
-
*
|
|
24
|
+
* in with a password: a role this brain does not know. An admin's or a
|
|
25
|
+
* member's password can be reset. */
|
|
26
26
|
export type PasswordResetRefused = {
|
|
27
27
|
error: string;
|
|
28
28
|
reason: 'not-a-password-login';
|
package/src/dto/member-apps.ts
CHANGED
|
@@ -86,13 +86,12 @@ export type MemberChatRow = {
|
|
|
86
86
|
name: string;
|
|
87
87
|
email: string;
|
|
88
88
|
/** False when the login is disabled or no longer a member (its old
|
|
89
|
-
* thread still shows).
|
|
90
|
-
* team member (client logins audit B26). */
|
|
89
|
+
* thread still shows). */
|
|
91
90
|
active: boolean;
|
|
92
|
-
/** The login's role, named (0.232.333 on): 'member' for the team;
|
|
93
|
-
* for a
|
|
94
|
-
*
|
|
95
|
-
role?: 'member'
|
|
91
|
+
/** The login's role, named (0.232.333 on): 'member' for the team; absent
|
|
92
|
+
* for a former member who is an admin now (its old thread still shows).
|
|
93
|
+
* (No login is a client since workspaces W8a.) */
|
|
94
|
+
role?: 'member';
|
|
96
95
|
lastMessageAt: string | null;
|
|
97
96
|
lastMessageText: string | null;
|
|
98
97
|
lastMessageDirection: 'inbound' | 'outbound' | null;
|
package/src/dto/rows.ts
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import type { AppNav, AppOpenStat, AppTint } from '../app-nav';
|
|
14
|
-
import type { AccessLevel } from './access';
|
|
15
14
|
import type { ListChips, ListWorkspace } from './grants';
|
|
16
15
|
|
|
17
16
|
// ── Row/DTO shapes moved from the server packages (jackdaw split P0) ─────────
|
|
@@ -138,8 +137,6 @@ export type PageRow = {
|
|
|
138
137
|
summary: string | null;
|
|
139
138
|
visibility: PageVisibility;
|
|
140
139
|
width: PageWidth;
|
|
141
|
-
/** Access level (admin > team > client > public); the owner UI's badge. */
|
|
142
|
-
audience: AccessLevel;
|
|
143
140
|
/** A read-only snapshot copy of an accepted item (data.snapshot_of,
|
|
144
141
|
* workspaces W6b fix round 1): nobody edits it, moves it out of its
|
|
145
142
|
* private workspace or shares it; its author may delete it. Absent on
|
|
@@ -189,14 +186,6 @@ export type AppRow = {
|
|
|
189
186
|
shareMode: ShareMode | null;
|
|
190
187
|
/** Whether this app is the designated Team Hub (prefs.teamHubAppId). */
|
|
191
188
|
isHub: boolean;
|
|
192
|
-
/** The old access level badge. Not sent since workspaces W5b2 (grants
|
|
193
|
-
* decide who reads an app: the list's `workspaces` chips and `hasLink`);
|
|
194
|
-
* the field goes in W8. */
|
|
195
|
-
audience?: AccessLevel;
|
|
196
|
-
/** Not sent since W5b2 (with the level badge). */
|
|
197
|
-
inherited?: 'team' | 'client' | null;
|
|
198
|
-
/** Not sent since W5b2 (with the level badge). */
|
|
199
|
-
embedded?: 'team' | 'client' | null;
|
|
200
189
|
/** A live open public link exists (not revoked, not expired): the
|
|
201
190
|
* "Public" pill. Absent from a brain before W5b2. */
|
|
202
191
|
hasLink?: boolean;
|
package/src/dto/shell.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { TreeKind } from '../tree';
|
|
|
10
10
|
import type { ShellWorkspace, WorkspaceArea } from './workspaces';
|
|
11
11
|
|
|
12
12
|
/** Who is signed in, by role. */
|
|
13
|
-
export type ShellRole = 'admin' | 'member'
|
|
13
|
+
export type ShellRole = 'admin' | 'member';
|
|
14
14
|
|
|
15
15
|
/** What this brain can do, so a client branches on capability, not version. */
|
|
16
16
|
export type ShellFeatures = { recallV2: boolean };
|
package/src/dto/workspaces.ts
CHANGED
|
@@ -166,7 +166,7 @@ export type ShellWorkspaces = { workspaces: ShellWorkspace[]; areas: WorkspaceAr
|
|
|
166
166
|
* `brainId` is left out only while the database is behind the code.
|
|
167
167
|
*/
|
|
168
168
|
export type AuthWhoami = {
|
|
169
|
-
role: 'admin' | 'member'
|
|
169
|
+
role: 'admin' | 'member';
|
|
170
170
|
loginId: string;
|
|
171
171
|
email: string;
|
|
172
172
|
displayName: string | null;
|
package/src/tree.ts
CHANGED
|
@@ -75,11 +75,6 @@ export type TreeKindSpec = {
|
|
|
75
75
|
shareable: boolean;
|
|
76
76
|
/** The item orders offered, the first being the default. */
|
|
77
77
|
sorts: readonly TreeSort[];
|
|
78
|
-
/** Which levels a folder of this kind may be shared at. Absent means both
|
|
79
|
-
* of TREE_SHARE_LEVELS. Recall is team-only: a client agent matching the
|
|
80
|
-
* owner's prompts is the case the Recall v1 plan deferred. Enforced where
|
|
81
|
-
* folders are shared (phase 4). */
|
|
82
|
-
shareLevels?: readonly TreeShareLevel[];
|
|
83
78
|
};
|
|
84
79
|
|
|
85
80
|
export const TREE_KIND_SPECS: Readonly<Record<TreeKind, TreeKindSpec>> = {
|
|
@@ -162,15 +157,14 @@ export const TREE_KIND_SPECS: Readonly<Record<TreeKind, TreeKindSpec>> = {
|
|
|
162
157
|
},
|
|
163
158
|
// The tree lists maps only; a map's cards are recall_nodes rows, never
|
|
164
159
|
// nodes, so they never appear as items.
|
|
165
|
-
// Not shareable YET:
|
|
166
|
-
//
|
|
167
|
-
//
|
|
160
|
+
// Not shareable YET: a map is granted beyond Admin only once Recall R6
|
|
161
|
+
// lets a workspace's assistant read maps. Until then the tree must not
|
|
162
|
+
// offer it.
|
|
168
163
|
recall: {
|
|
169
164
|
kind: 'recall',
|
|
170
165
|
root: 'recall',
|
|
171
166
|
nodeType: 'recall',
|
|
172
167
|
shareable: false,
|
|
173
|
-
shareLevels: ['team'],
|
|
174
168
|
sorts: ['name', 'updated'],
|
|
175
169
|
},
|
|
176
170
|
};
|