@crossworks/client-types 0.707.0 → 0.708.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/decision-models.ts +27 -2
- package/src/dto/access-keys.ts +4 -3
- package/src/dto/agent-graph.ts +3 -1
- package/src/dto/file-status.ts +18 -0
- package/src/dto/logins.ts +10 -0
- package/src/dto/workspaces.ts +21 -8
- package/src/index.ts +1 -0
- package/src/model-pools-data.json +84 -0
- package/src/model-pools.ts +16 -0
package/package.json
CHANGED
package/src/decision-models.ts
CHANGED
|
@@ -50,6 +50,11 @@ export type DecisionModelProfile = {
|
|
|
50
50
|
/** A start value for passage scoring's threshold where Jev's 1.5 drops
|
|
51
51
|
* right passages. Tune it with eval:route. */
|
|
52
52
|
thresholdStart?: number;
|
|
53
|
+
/** Takes a picture in the state (an `image_url` part, PNG or JPEG, within
|
|
54
|
+
* DECISION_PICTURE_LIMITS). From OpenRouter's multimodal decisions table
|
|
55
|
+
* (2026-11-19) and one measured use (`scan_read_check`). `decide()`
|
|
56
|
+
* sends a picture only to such a model. */
|
|
57
|
+
pictures?: true;
|
|
53
58
|
/** Its place in the shipped decider pool. A product decision (2026-10-30),
|
|
54
59
|
* not a ranking: re-curation offers only these, in this order. */
|
|
55
60
|
poolPosition?: number;
|
|
@@ -65,11 +70,12 @@ export const DECISION_MODEL_PROFILES: readonly DecisionModelProfile[] = [
|
|
|
65
70
|
id: '~typesafe/jev-latest',
|
|
66
71
|
status: 'works',
|
|
67
72
|
privacy: 'zdr',
|
|
73
|
+
pictures: true,
|
|
68
74
|
poolPosition: 0,
|
|
69
75
|
note: 'the shipped default',
|
|
70
76
|
},
|
|
71
|
-
{ id: 'typesafe/jev-1.14', status: 'works', privacy: 'zdr' },
|
|
72
|
-
{ id: 'typesafe/jev-1.13', status: 'works', privacy: 'zdr' },
|
|
77
|
+
{ id: 'typesafe/jev-1.14', status: 'works', privacy: 'zdr', pictures: true },
|
|
78
|
+
{ id: 'typesafe/jev-1.13', status: 'works', privacy: 'zdr', pictures: true },
|
|
73
79
|
{
|
|
74
80
|
id: 'perplexity/pplx-decider-v1.2',
|
|
75
81
|
status: 'works',
|
|
@@ -160,6 +166,25 @@ export function decisionModelRefusal(model: string | null | undefined): string |
|
|
|
160
166
|
);
|
|
161
167
|
}
|
|
162
168
|
|
|
169
|
+
/** Whether a decision model takes a picture in its state (its profile says
|
|
170
|
+
* `pictures`). An untested model does not: a picture is never sent to it. */
|
|
171
|
+
export function decisionModelTakesPictures(model: string | null | undefined): boolean {
|
|
172
|
+
return decisionModelProfile(model)?.pictures === true;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** What a picture in a decision state may be (OpenRouter's multimodal
|
|
176
|
+
* decisions table for TypeSafe, 2026-11-19): a PNG or JPEG data URL, 256 to
|
|
177
|
+
* 1,568 pixels a side, 78,400 to 2,458,624 pixels in all, 16 MiB at most.
|
|
178
|
+
* `decide()` refuses one outside these, sending nothing; the picture helper
|
|
179
|
+
* of @mantle/decisions shrinks a larger one first. */
|
|
180
|
+
export const DECISION_PICTURE_LIMITS = {
|
|
181
|
+
minSide: 256,
|
|
182
|
+
maxSide: 1568,
|
|
183
|
+
minPixels: 78_400,
|
|
184
|
+
maxPixels: 2_458_624,
|
|
185
|
+
maxBytes: 16 * 1024 * 1024,
|
|
186
|
+
} as const;
|
|
187
|
+
|
|
163
188
|
/** The size of one decision request a model takes. Null = no limit is known,
|
|
164
189
|
* so the use's own size stands. */
|
|
165
190
|
export type DecisionRequestLimits = {
|
package/src/dto/access-keys.ts
CHANGED
|
@@ -62,11 +62,12 @@ export type AccessKeyView = {
|
|
|
62
62
|
revokedAt: string | null;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
/** GET /api/access-keys.
|
|
66
|
-
*
|
|
65
|
+
/** GET /api/access-keys. The keys area (a System user) gets every key on
|
|
66
|
+
* the brain; every other login gets its own. */
|
|
67
67
|
export type AccessKeyList = {
|
|
68
68
|
keys: AccessKeyView[];
|
|
69
|
-
/** The caller's kind:
|
|
69
|
+
/** The caller's kind, for display: which keys it sees follows the keys
|
|
70
|
+
* area, never this role. */
|
|
70
71
|
role: AccessKeyRole;
|
|
71
72
|
areas: AccessKeyArea[];
|
|
72
73
|
/** The expiry a key gets when the create names none. */
|
package/src/dto/agent-graph.ts
CHANGED
|
@@ -224,7 +224,9 @@ export type AiWorkerKind =
|
|
|
224
224
|
| 'search_advanced'
|
|
225
225
|
| 'narrator'
|
|
226
226
|
| 'suggester'
|
|
227
|
-
| 'decider'
|
|
227
|
+
| 'decider'
|
|
228
|
+
| 'translator'
|
|
229
|
+
| 'scan_reader';
|
|
228
230
|
|
|
229
231
|
/** An AI worker as returned by `GET /api/ai-workers`. `params` is jsonb (shape
|
|
230
232
|
* varies by kind) — kept loose here; the form narrows per kind. */
|
package/src/dto/file-status.ts
CHANGED
|
@@ -147,6 +147,24 @@ export type FileProcessing = {
|
|
|
147
147
|
* `readBy`: the pipeline and version that built it (null before stamps
|
|
148
148
|
* or when not built). `tables`: what it extracted, each tab and its
|
|
149
149
|
* rows; only when built and readable by the caller (as the Data view). */
|
|
150
|
+
/** A PDF book (read by the book reader): how its pages were read, counted
|
|
151
|
+
* from its database (docs/ai-workers.md, "The Scan reader"): `text` (text
|
|
152
|
+
* layer), `ocr` (local OCR, a book read by an older reader), `blank`,
|
|
153
|
+
* `scanReader` (the Agent pdf-page-read's read of a scanned page),
|
|
154
|
+
* `vision` (its description of a figure), `unread` (marked for the Agent,
|
|
155
|
+
* with no text: not read yet, no Scan reader, or a read judged bad). Left
|
|
156
|
+
* out for any other file. */
|
|
157
|
+
bookPages?: {
|
|
158
|
+
text: number;
|
|
159
|
+
ocr: number;
|
|
160
|
+
blank: number;
|
|
161
|
+
scanReader: number;
|
|
162
|
+
vision: number;
|
|
163
|
+
unread: number;
|
|
164
|
+
/** There are unread pages and this brain has no Scan reader: that is
|
|
165
|
+
* why (an OpenRouter key and the Scan reader worker read them). */
|
|
166
|
+
noScanReader?: true;
|
|
167
|
+
};
|
|
150
168
|
database: {
|
|
151
169
|
state: DataFileState;
|
|
152
170
|
bytes: number | null;
|
package/src/dto/logins.ts
CHANGED
|
@@ -31,3 +31,13 @@ export type PasswordResetRefused = {
|
|
|
31
31
|
reason: 'not-a-password-login';
|
|
32
32
|
message: string;
|
|
33
33
|
};
|
|
34
|
+
|
|
35
|
+
/** The 403 an act on a System user's login answers a caller who is not a
|
|
36
|
+
* System user (a password reset, a disable or enable, a session end, a
|
|
37
|
+
* role change, a device revoke, the company sign-in link, a delete; on
|
|
38
|
+
* the Users screen and on the Admin workspace's user list). Your own
|
|
39
|
+
* login is never refused. */
|
|
40
|
+
export type SystemUserTargetRefused = {
|
|
41
|
+
error: string;
|
|
42
|
+
code: 'system_user_target';
|
|
43
|
+
};
|
package/src/dto/workspaces.ts
CHANGED
|
@@ -11,10 +11,11 @@ import type { AppTint } from '../app-nav';
|
|
|
11
11
|
import type { LoginRole } from '../role-names';
|
|
12
12
|
|
|
13
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
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* adminUserSql and the route classes read it). An Admin workspace user
|
|
15
|
+
* holds `users`; the other four (settings, assistants, connectors, keys)
|
|
16
|
+
* only while they are also a user of the System workspace. A per-user
|
|
17
|
+
* switch on the Admin row can turn one off (no screen sets it yet). In
|
|
18
|
+
* this order on the wire (the shell's `areas`). */
|
|
18
19
|
export const WORKSPACE_AREAS = ['settings', 'users', 'assistants', 'connectors', 'keys'] as const;
|
|
19
20
|
export type WorkspaceArea = (typeof WORKSPACE_AREAS)[number];
|
|
20
21
|
|
|
@@ -54,9 +55,15 @@ export type Workspace = WorkspaceLook & {
|
|
|
54
55
|
assistant: { id: string; name: string } | null;
|
|
55
56
|
/** The Admin workspace: its users manage the brain (requireArea). */
|
|
56
57
|
isAdmin: boolean;
|
|
57
|
-
/** The
|
|
58
|
-
*
|
|
59
|
-
*
|
|
58
|
+
/** The System workspace: a subset of the Admin users who hold the
|
|
59
|
+
* technical areas (settings, assistants, connectors, keys). Only a
|
|
60
|
+
* System user adds someone, and only an Admin user can be added; there
|
|
61
|
+
* is no Moderator tick to set (every user is one). Absent (read it as
|
|
62
|
+
* false) on any other workspace and from a brain before it. */
|
|
63
|
+
isSystem?: boolean;
|
|
64
|
+
/** The built-in workspaces: Admin, and System (Team too before 0286).
|
|
65
|
+
* They cannot be renamed or archived (hide Rename and Archive there).
|
|
66
|
+
* Their connectors are attached here like any workspace's. */
|
|
60
67
|
builtIn: boolean;
|
|
61
68
|
/** Always false since migration 0286 (it marked the built-in Team
|
|
62
69
|
* workspace, where every Admin workspace user was a Moderator). */
|
|
@@ -222,6 +229,8 @@ export type ShellWorkspace = WorkspaceLook & {
|
|
|
222
229
|
id: string;
|
|
223
230
|
name: string;
|
|
224
231
|
isAdmin: boolean;
|
|
232
|
+
/** The System workspace (see Workspace.isSystem). Absent on any other. */
|
|
233
|
+
isSystem?: true;
|
|
225
234
|
moderator: boolean;
|
|
226
235
|
/** The login's own private workspace ("<name> (only you)"): match on
|
|
227
236
|
* this, never on the name. Absent on any other. */
|
|
@@ -305,6 +314,10 @@ export type WorkspaceErrorCode =
|
|
|
305
314
|
| 'resource_exists'
|
|
306
315
|
| 'landing_app_not_held'
|
|
307
316
|
| 'landing_app_not_ready'
|
|
308
|
-
| 'rate_limited'
|
|
317
|
+
| 'rate_limited'
|
|
318
|
+
| 'system_users_only'
|
|
319
|
+
| 'not_admin_user'
|
|
320
|
+
| 'last_system_user'
|
|
321
|
+
| 'system_user_target';
|
|
309
322
|
|
|
310
323
|
export type WorkspaceError = { error: string; code: WorkspaceErrorCode };
|
package/src/index.ts
CHANGED
|
@@ -217,6 +217,7 @@ export type {
|
|
|
217
217
|
LoginRefused,
|
|
218
218
|
LoginRefusedReason,
|
|
219
219
|
PasswordResetRefused,
|
|
220
|
+
SystemUserTargetRefused,
|
|
220
221
|
} from './dto/logins';
|
|
221
222
|
// Inbound API keys (0232). Types at the root; the runtime ACCESS_KEY_AREAS
|
|
222
223
|
// is the `@mantle/client-types/dto/access-keys` subpath.
|
|
@@ -1112,6 +1112,27 @@
|
|
|
1112
1112
|
"rating": 2,
|
|
1113
1113
|
"note": "intelligence index 37.3; busier than most of the ranked field; 1M+ context"
|
|
1114
1114
|
},
|
|
1115
|
+
{
|
|
1116
|
+
"pool": "scan_reader",
|
|
1117
|
+
"position": 0,
|
|
1118
|
+
"name": "Meta: Llama 3.1 8B Instruct",
|
|
1119
|
+
"vendor": "Meta",
|
|
1120
|
+
"routes": [
|
|
1121
|
+
{
|
|
1122
|
+
"provider": "openrouter",
|
|
1123
|
+
"model": "meta-llama/llama-3.1-8b-instruct"
|
|
1124
|
+
}
|
|
1125
|
+
],
|
|
1126
|
+
"pricing": {
|
|
1127
|
+
"inputPerM": 0.02,
|
|
1128
|
+
"outputPerM": 0.04,
|
|
1129
|
+
"currency": "USD",
|
|
1130
|
+
"capturedAt": "2026-11-19T09:00:00.000Z",
|
|
1131
|
+
"source": "openrouter"
|
|
1132
|
+
},
|
|
1133
|
+
"rating": 5,
|
|
1134
|
+
"note": "the shipped default: the text model behind the mistral-ocr PDF parser (params.engine), which bills $2 per 1,000 pages; it answers 16 tokens, the text is the parser's"
|
|
1135
|
+
},
|
|
1115
1136
|
{
|
|
1116
1137
|
"pool": "image_gen",
|
|
1117
1138
|
"position": 0,
|
|
@@ -2018,6 +2039,69 @@
|
|
|
2018
2039
|
"rating": 2,
|
|
2019
2040
|
"note": "busier than most of the ranked field; free tier: rate-limited, use as a fallback not a default"
|
|
2020
2041
|
},
|
|
2042
|
+
{
|
|
2043
|
+
"pool": "translator",
|
|
2044
|
+
"position": 0,
|
|
2045
|
+
"name": "Google: Gemini 3.1 Flash Lite",
|
|
2046
|
+
"vendor": "Google",
|
|
2047
|
+
"routes": [
|
|
2048
|
+
{
|
|
2049
|
+
"provider": "openrouter",
|
|
2050
|
+
"model": "google/gemini-3.1-flash-lite"
|
|
2051
|
+
}
|
|
2052
|
+
],
|
|
2053
|
+
"pricing": {
|
|
2054
|
+
"inputPerM": 0.25,
|
|
2055
|
+
"outputPerM": 1.5,
|
|
2056
|
+
"currency": "USD",
|
|
2057
|
+
"capturedAt": "2026-11-19T00:00:00.000Z",
|
|
2058
|
+
"source": "openrouter"
|
|
2059
|
+
},
|
|
2060
|
+
"rating": 5,
|
|
2061
|
+
"note": "the shipped default for this pool (owner's pick 2026-11-19); 1M context, 65,536 output tokens"
|
|
2062
|
+
},
|
|
2063
|
+
{
|
|
2064
|
+
"pool": "translator",
|
|
2065
|
+
"position": 1,
|
|
2066
|
+
"name": "Mistral: Mistral Small 2603",
|
|
2067
|
+
"vendor": "Mistral",
|
|
2068
|
+
"routes": [
|
|
2069
|
+
{
|
|
2070
|
+
"provider": "openrouter",
|
|
2071
|
+
"model": "mistralai/mistral-small-2603"
|
|
2072
|
+
}
|
|
2073
|
+
],
|
|
2074
|
+
"pricing": {
|
|
2075
|
+
"inputPerM": 0.15,
|
|
2076
|
+
"outputPerM": 0.6,
|
|
2077
|
+
"currency": "USD",
|
|
2078
|
+
"capturedAt": "2026-11-19T00:00:00.000Z",
|
|
2079
|
+
"source": "openrouter"
|
|
2080
|
+
},
|
|
2081
|
+
"rating": 4,
|
|
2082
|
+
"note": "the shipped fallback: takes a part only when the primary fails it; 262k context"
|
|
2083
|
+
},
|
|
2084
|
+
{
|
|
2085
|
+
"pool": "translator",
|
|
2086
|
+
"position": 2,
|
|
2087
|
+
"name": "Mistral: Mistral Medium 3.5",
|
|
2088
|
+
"vendor": "Mistral",
|
|
2089
|
+
"routes": [
|
|
2090
|
+
{
|
|
2091
|
+
"provider": "openrouter",
|
|
2092
|
+
"model": "mistralai/mistral-medium-3-5"
|
|
2093
|
+
}
|
|
2094
|
+
],
|
|
2095
|
+
"pricing": {
|
|
2096
|
+
"inputPerM": 1.5,
|
|
2097
|
+
"outputPerM": 7.5,
|
|
2098
|
+
"currency": "USD",
|
|
2099
|
+
"capturedAt": "2026-11-19T00:00:00.000Z",
|
|
2100
|
+
"source": "openrouter"
|
|
2101
|
+
},
|
|
2102
|
+
"rating": 4,
|
|
2103
|
+
"note": "the shipped high model: quality 'high' only, for terminology or style work"
|
|
2104
|
+
},
|
|
2021
2105
|
{
|
|
2022
2106
|
"pool": "decider",
|
|
2023
2107
|
"position": 0,
|
package/src/model-pools.ts
CHANGED
|
@@ -96,6 +96,14 @@ export const MODEL_POOLS: readonly ModelPoolDef[] = [
|
|
|
96
96
|
group: 'workers',
|
|
97
97
|
modality: { input: ['image'], output: 'text' },
|
|
98
98
|
},
|
|
99
|
+
{
|
|
100
|
+
id: 'scan_reader',
|
|
101
|
+
label: 'Scan reader',
|
|
102
|
+
description:
|
|
103
|
+
'Reads the text of every scanned page of a PDF book through the mistral-ocr PDF parser, at about half the vision price. This is the cheap text model the parsed page is handed to (its short answer is not used); text-only, so no picture is forwarded.',
|
|
104
|
+
group: 'workers',
|
|
105
|
+
modality: TEXT_OUT,
|
|
106
|
+
},
|
|
99
107
|
{
|
|
100
108
|
id: 'image_gen',
|
|
101
109
|
label: 'Image generation',
|
|
@@ -150,6 +158,14 @@ export const MODEL_POOLS: readonly ModelPoolDef[] = [
|
|
|
150
158
|
group: 'workers',
|
|
151
159
|
modality: TEXT_OUT,
|
|
152
160
|
},
|
|
161
|
+
{
|
|
162
|
+
id: 'translator',
|
|
163
|
+
label: 'Translator',
|
|
164
|
+
description:
|
|
165
|
+
'Translates text and items for the translate tool. A long text goes in parts sized by the model\u2019s output limit, so a large output limit means fewer parts. The worker also names a fallback model and a high-quality model.',
|
|
166
|
+
group: 'workers',
|
|
167
|
+
modality: TEXT_OUT,
|
|
168
|
+
},
|
|
153
169
|
{
|
|
154
170
|
id: 'decider',
|
|
155
171
|
label: 'Decider (typed decisions)',
|