@substrio/sdk 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@substrio/sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Substrio JavaScript SDK: zero-dependency, AI-friendly database client",
5
5
  "homepage": "https://github.com/illtronicevents-a11y/substrio#readme",
6
6
  "bugs": "https://github.com/illtronicevents-a11y/substrio/issues",
@@ -10,18 +10,18 @@ export const SUBSTRIO_ERRORS = Object.freeze({
10
10
  NOT_IMPLEMENTED: Object.freeze({ hex: 0x0002, status: 501, message: "This feature is not implemented" }),
11
11
  SYSTEM_CLOSED: Object.freeze({ hex: 0x0100, status: 503, message: "Database system is closed" }),
12
12
  SYSTEM_ALREADY_OPEN: Object.freeze({ hex: 0x0101, status: 409, message: "Database system is already open" }),
13
- INVALID_ARGUMENT: Object.freeze({ hex: 0x0102, status: 400, message: "Invalid argument provided" }),
14
- INVALID_HANDLE: Object.freeze({ hex: 0x0103, status: 400, message: "Invalid handle" }),
13
+ INVALID_ARGUMENT: Object.freeze({ hex: 0x0102, status: 400, message: "That value is not accepted." }),
14
+ INVALID_HANDLE: Object.freeze({ hex: 0x0103, status: 400, message: "That handle is not open." }),
15
15
  THREAD_INIT_FAILED: Object.freeze({ hex: 0x0104, status: 500, message: "Thread initialization failed" }),
16
16
  SHUTDOWN_IN_PROGRESS: Object.freeze({ hex: 0x0105, status: 503, message: "System is shutting down" }),
17
- INTERNAL: Object.freeze({ hex: 0x0106, status: 500, message: "Internal server error" }),
17
+ INTERNAL: Object.freeze({ hex: 0x0106, status: 500, message: "Something went wrong on our side. Try again." }),
18
18
  NULL_TREE: Object.freeze({ hex: 0x0107, status: 500, message: "Index tree is not initialized" }),
19
19
  NULL_SYSTEM: Object.freeze({ hex: 0x0108, status: 500, message: "Tree is not bound to a system" }),
20
20
  BARRIER_UNSUPPORTED: Object.freeze({ hex: 0x0109, status: 500, message: "Process-wide memory barrier unavailable" }),
21
- STORAGE_IO: Object.freeze({ hex: 0x1000, status: 500, message: "Storage I/O error" }),
21
+ STORAGE_IO: Object.freeze({ hex: 0x1000, status: 500, message: "We could not read or save that just now. Try again." }),
22
22
  DISK_FULL: Object.freeze({ hex: 0x1001, status: 503, message: "Disk storage is full" }),
23
23
  FILE_NOT_FOUND: Object.freeze({ hex: 0x1002, status: 404, message: "File not found" }),
24
- PERMISSION_DENIED: Object.freeze({ hex: 0x1003, status: 403, message: "Permission denied" }),
24
+ PERMISSION_DENIED: Object.freeze({ hex: 0x1003, status: 403, message: "You do not have access to that." }),
25
25
  FILE_CORRUPT: Object.freeze({ hex: 0x1004, status: 500, message: "File is corrupted" }),
26
26
  MMAP_FAILED: Object.freeze({ hex: 0x1005, status: 500, message: "Memory mapping failed" }),
27
27
  FSYNC_FAILED: Object.freeze({ hex: 0x1006, status: 500, message: "File sync failed" }),
@@ -41,7 +41,7 @@ export const SUBSTRIO_ERRORS = Object.freeze({
41
41
  NO_ACTIVE_TRANSACTION: Object.freeze({ hex: 0x3006, status: 400, message: "No active transaction" }),
42
42
  LWW_STALE: Object.freeze({ hex: 0x3007, status: 409, message: "A newer version exists" }),
43
43
  CANCELLED: Object.freeze({ hex: 0x3008, status: 409, message: "Operation cancelled" }),
44
- KEY_NOT_FOUND: Object.freeze({ hex: 0x4000, status: 404, message: "Key not found" }),
44
+ KEY_NOT_FOUND: Object.freeze({ hex: 0x4000, status: 404, message: "We could not find that." }),
45
45
  KEY_TOO_LARGE: Object.freeze({ hex: 0x4001, status: 400, message: "Key exceeds maximum size" }),
46
46
  VALUE_TOO_LARGE: Object.freeze({ hex: 0x4002, status: 413, message: "Value exceeds maximum size" }),
47
47
  KEY_EMPTY: Object.freeze({ hex: 0x4003, status: 400, message: "Key cannot be empty" }),
@@ -62,18 +62,18 @@ export const SUBSTRIO_ERRORS = Object.freeze({
62
62
  ROW_STALE: Object.freeze({ hex: 0x4012, status: 409, message: "the document changed since this row was read: nothing was written, and the row now holds the document as it is; read it and write again" }),
63
63
  CURSOR_EXHAUSTED: Object.freeze({ hex: 0x5000, status: 200, message: "Cursor exhausted" }),
64
64
  CURSOR_INVALIDATED: Object.freeze({ hex: 0x5001, status: 409, message: "Cursor invalidated" }),
65
- INVALID_RANGE: Object.freeze({ hex: 0x5002, status: 400, message: "Invalid range" }),
65
+ INVALID_RANGE: Object.freeze({ hex: 0x5002, status: 400, message: "That range is not accepted." }),
66
66
  BATCH_OP_FAILED: Object.freeze({ hex: 0x5003, status: 500, message: "Batch operation failed" }),
67
67
  NODE_NOT_FOUND: Object.freeze({ hex: 0x6000, status: 404, message: "Node not found" }),
68
68
  EDGE_NOT_FOUND: Object.freeze({ hex: 0x6001, status: 404, message: "Edge not found" }),
69
69
  PROPERTY_NOT_FOUND: Object.freeze({ hex: 0x6002, status: 404, message: "Property not found" }),
70
- INVALID_EDGE: Object.freeze({ hex: 0x6003, status: 400, message: "Invalid edge" }),
70
+ INVALID_EDGE: Object.freeze({ hex: 0x6003, status: 400, message: "That edge is not accepted." }),
71
71
  PATH_NOT_FOUND: Object.freeze({ hex: 0x6004, status: 404, message: "Path not found" }),
72
72
  GRAPH_CYCLE_DETECTED: Object.freeze({ hex: 0x6005, status: 409, message: "Cycle detected" }),
73
73
  DIMENSION_MISMATCH: Object.freeze({ hex: 0x7000, status: 400, message: "Dimension mismatch" }),
74
74
  POINT_NOT_FOUND: Object.freeze({ hex: 0x7001, status: 404, message: "Point not found" }),
75
- INVALID_BOUNDS: Object.freeze({ hex: 0x7002, status: 400, message: "Invalid bounds" }),
76
- INVALID_RADIUS: Object.freeze({ hex: 0x7003, status: 400, message: "Invalid radius" }),
75
+ INVALID_BOUNDS: Object.freeze({ hex: 0x7002, status: 400, message: "Those bounds are not accepted." }),
76
+ INVALID_RADIUS: Object.freeze({ hex: 0x7003, status: 400, message: "That radius is not accepted." }),
77
77
  SCHEMA_VIOLATION: Object.freeze({ hex: 0x8000, status: 400, message: "Schema violation" }),
78
78
  TYPE_MISMATCH: Object.freeze({ hex: 0x8001, status: 400, message: "Type mismatch" }),
79
79
  CONSTRAINT_VIOLATION: Object.freeze({ hex: 0x8002, status: 409, message: "Constraint violation" }),
@@ -85,7 +85,7 @@ export const SUBSTRIO_ERRORS = Object.freeze({
85
85
  STORAGE_QUOTA_EXCEEDED: Object.freeze({ hex: 0x9000, status: 507, message: "Storage quota exceeded" }),
86
86
  DOCUMENT_QUOTA_EXCEEDED: Object.freeze({ hex: 0x9001, status: 507, message: "Document quota exceeded" }),
87
87
  BANDWIDTH_QUOTA_EXCEEDED: Object.freeze({ hex: 0x9002, status: 429, message: "Bandwidth quota exceeded" }),
88
- RATE_LIMIT_EXCEEDED: Object.freeze({ hex: 0x9003, status: 429, message: "Rate limit exceeded. Please slow down." }),
88
+ RATE_LIMIT_EXCEEDED: Object.freeze({ hex: 0x9003, status: 429, message: "Too many requests. Wait a moment and try again." }),
89
89
  REQUEST_TOO_LARGE: Object.freeze({ hex: 0x9004, status: 413, message: "Request payload too large" }),
90
90
  CONCURRENT_LIMIT: Object.freeze({ hex: 0x9005, status: 429, message: "Concurrent request limit exceeded" }),
91
91
  COLLECTION_LIMIT: Object.freeze({ hex: 0x9006, status: 413, message: "Collection limit exceeded" }),
@@ -102,16 +102,16 @@ export const SUBSTRIO_ERRORS = Object.freeze({
102
102
  REALTIME_LIMIT: Object.freeze({ hex: 0x9011, status: 429, message: "This tenant's realtime_connections_limit is at its cap" }),
103
103
  CRON_LIMIT: Object.freeze({ hex: 0x9012, status: 429, message: "This tenant's cron_limit is at its cap" }),
104
104
  SPACE_FULL: Object.freeze({ hex: 0x9013, status: 507, message: "The account's space is full: free space (delete data or an app) or raise the account's space" }),
105
- TOKEN_EXPIRED: Object.freeze({ hex: 0xA000, status: 401, message: "Authentication token has expired" }),
106
- TOKEN_INVALID: Object.freeze({ hex: 0xA001, status: 401, message: "Invalid authentication token" }),
107
- TOKEN_REVOKED: Object.freeze({ hex: 0xA002, status: 401, message: "Authentication token has been revoked" }),
108
- SESSION_EXPIRED: Object.freeze({ hex: 0xA003, status: 401, message: "Session has expired" }),
109
- ACCOUNT_SUSPENDED: Object.freeze({ hex: 0xA004, status: 403, message: "Account has been suspended" }),
105
+ TOKEN_EXPIRED: Object.freeze({ hex: 0xA000, status: 401, message: "Your sign-in has expired. Sign in again." }),
106
+ TOKEN_INVALID: Object.freeze({ hex: 0xA001, status: 401, message: "Your sign-in is not valid. Sign in again." }),
107
+ TOKEN_REVOKED: Object.freeze({ hex: 0xA002, status: 401, message: "Your sign-in was ended. Sign in again." }),
108
+ SESSION_EXPIRED: Object.freeze({ hex: 0xA003, status: 401, message: "Your session has expired. Sign in again." }),
109
+ ACCOUNT_SUSPENDED: Object.freeze({ hex: 0xA004, status: 403, message: "This account is suspended." }),
110
110
  TENANT_SUSPENDED: Object.freeze({ hex: 0xA005, status: 403, message: "Tenant has been suspended" }),
111
111
  IP_BLOCKED: Object.freeze({ hex: 0xA006, status: 403, message: "IP address is blocked" }),
112
- INSUFFICIENT_PERMISSIONS: Object.freeze({ hex: 0xA007, status: 403, message: "Insufficient permissions for this operation" }),
112
+ INSUFFICIENT_PERMISSIONS: Object.freeze({ hex: 0xA007, status: 403, message: "You do not have access to do that." }),
113
113
  CREDENTIAL_REQUIRED: Object.freeze({ hex: 0xA008, status: 401, message: "Authentication credentials required" }),
114
- OAUTH_INVALID: Object.freeze({ hex: 0xA009, status: 401, message: "Invalid OAuth token or code" }),
114
+ OAUTH_INVALID: Object.freeze({ hex: 0xA009, status: 401, message: "The sign-in provider's answer was not accepted. Try again." }),
115
115
  PROVIDER_NOT_CONFIGURED: Object.freeze({ hex: 0xA00A, status: 409, message: "Authentication provider not configured" }),
116
116
  PROVIDER_DISABLED: Object.freeze({ hex: 0xA00B, status: 403, message: "Authentication provider is disabled" }),
117
117
  TENANT_READ_ONLY: Object.freeze({ hex: 0xA00C, status: 423, message: "Tenant is read-only: writes are refused" }),
@@ -131,16 +131,25 @@ export const SUBSTRIO_ERRORS = Object.freeze({
131
131
  APPROVAL_MISMATCH: Object.freeze({ hex: 0xA01A, status: 403, message: "The approval names another call or another session: it works only for the exact call that asked for it" }),
132
132
  WEBHOOK_SIGNATURE_INVALID: Object.freeze({ hex: 0xA01B, status: 400, message: "The payment provider webhook's signature does not verify" }),
133
133
  BILLING_NOT_SET_UP: Object.freeze({ hex: 0xA01C, status: 503, message: "Billing is not set up: the payment provider's keys are not set" }),
134
+ EMAIL_TAKEN: Object.freeze({ hex: 0xA01D, status: 409, message: "That email already has an account. Sign in instead." }),
135
+ CREDENTIALS_MISMATCH: Object.freeze({ hex: 0xA01E, status: 401, message: "That email and password do not match." }),
136
+ PASSWORD_LENGTH: Object.freeze({ hex: 0xA01F, status: 400, message: "Use a password of 8 to 128 characters." }),
137
+ EMAIL_INVALID: Object.freeze({ hex: 0xA020, status: 400, message: "Enter a valid email address." }),
138
+ USER_NOT_FOUND: Object.freeze({ hex: 0xA021, status: 404, message: "We could not find that person." }),
139
+ ACCOUNT_LOCKED: Object.freeze({ hex: 0xA022, status: 423, message: "This account is locked. Reset your password to sign in again." }),
140
+ SECRET_KEY_IN_URL: Object.freeze({ hex: 0xA023, status: 400, message: "A secret key was sent in the URL (access_token): only a publishable key may be; send a secret key in the Authorization header, from a server" }),
141
+ RECIPIENT_UNSUBSCRIBED: Object.freeze({ hex: 0xA024, status: 409, message: "You turned off this app's email, so no code was sent. Ask for a link to turn it back on." }),
142
+ APP_OVER_PLAN: Object.freeze({ hex: 0xA025, status: 403, message: "This app is paused: the account's plan allows fewer apps than it owns. Move it into the first max_apps on the account's Apps page (account.apps.order), or upgrade." }),
134
143
  QUERY_TOO_COMPLEX: Object.freeze({ hex: 0xB000, status: 400, message: "Query is too complex" }),
135
144
  QUERY_TIMEOUT: Object.freeze({ hex: 0xB001, status: 504, message: "Query execution timed out" }),
136
145
  RESULT_SET_TOO_LARGE: Object.freeze({ hex: 0xB002, status: 413, message: "Result set exceeds maximum size" }),
137
146
  SORT_LIMIT_EXCEEDED: Object.freeze({ hex: 0xB003, status: 400, message: "Sort operation exceeds limit" }),
138
147
  SCAN_LIMIT_EXCEEDED: Object.freeze({ hex: 0xB004, status: 400, message: "Scan operation exceeds limit" }),
139
- INVALID_QUERY_SYNTAX: Object.freeze({ hex: 0xB005, status: 400, message: "Invalid query syntax" }),
148
+ INVALID_QUERY_SYNTAX: Object.freeze({ hex: 0xB005, status: 400, message: "That query does not parse." }),
140
149
  SQL_FAILED: Object.freeze({ hex: 0xB006, status: 400, message: "The SQL statement did not parse or run" }),
141
150
  TENANT_NOT_FOUND: Object.freeze({ hex: 0xC000, status: 404, message: "Tenant not found" }),
142
151
  TENANT_ALREADY_EXISTS: Object.freeze({ hex: 0xC001, status: 409, message: "Tenant already exists" }),
143
- TENANT_INVALID: Object.freeze({ hex: 0xC002, status: 400, message: "Invalid tenant" }),
152
+ TENANT_INVALID: Object.freeze({ hex: 0xC002, status: 400, message: "That app is not one this server knows." }),
144
153
  TENANT_CANNOT_DROP_DEFAULT: Object.freeze({ hex: 0xC003, status: 403, message: "Cannot drop the default tenant" }),
145
154
  COLLECTION_NOT_FOUND: Object.freeze({ hex: 0xC004, status: 404, message: "Collection not found" }),
146
155
  COLLECTION_ALREADY_EXISTS: Object.freeze({ hex: 0xC005, status: 409, message: "Collection already exists" }),
@@ -212,8 +221,9 @@ export const SUBSTRIO_ERRORS = Object.freeze({
212
221
  ROOT_DOMAIN_DISABLED: Object.freeze({ hex: 0xC04E, status: 409, message: "The root domain is disabled: no host is bound under it until the platform admin enables it" }),
213
222
  ROOT_DOMAIN_IN_USE: Object.freeze({ hex: 0xC04F, status: 409, message: "Test hosts are bound under the root domain (hosts is their count); they are removed with env.host.remove first" }),
214
223
  FEATURED_APP_NOT_FOUND: Object.freeze({ hex: 0xC050, status: 404, message: "No featured app has this name; featured.list names every one" }),
215
- FEATURED_NOT_ENABLED: Object.freeze({ hex: 0xC051, status: 409, message: "The account has not enabled this featured app; featured.enable it first" }),
216
224
  FEATURED_NEEDS_PLANS: Object.freeze({ hex: 0xC052, status: 400, message: "Only an app open to other accounts' keys whose plans file has a featured block (title, summary, admin) can be featured" }),
225
+ JET_KEY_NEEDS_APP: Object.freeze({ hex: 0xC053, status: 400, message: "A key for a featured app belongs to one of the account's apps; jet.key.create makes it for the app named" }),
226
+ FEATURED_ALWAYS_ON: Object.freeze({ hex: 0xC054, status: 409, message: "Every account has every featured app, always on: there is nothing to disable. A key stops with account.key.revoke" }),
217
227
  BILLING_KEY_NOT_TEST: Object.freeze({ hex: 0xC060, status: 503, message: "The payment provider key set is not a test key (sk_test_ or rk_test_); the platform takes test keys only, so nothing was sent" }),
218
228
  CART_EMPTY: Object.freeze({ hex: 0xC061, status: 400, message: "The cart buys nothing: name at least one plan in items, or funds" }),
219
229
  CART_PLAN_NOT_FOUND: Object.freeze({ hex: 0xC062, status: 400, message: "The app has no plan by this id; billing.catalog lists every plan" }),
@@ -229,11 +239,24 @@ export const SUBSTRIO_ERRORS = Object.freeze({
229
239
  PAYMENT_PROCESSING: Object.freeze({ hex: 0xC06C, status: 409, message: "The payment is still being processed by the provider; ask again shortly" }),
230
240
  SUBSCRIPTION_NONE: Object.freeze({ hex: 0xC06D, status: 404, message: "The account has no subscription to cancel" }),
231
241
  PROVIDER_ANSWER_INVALID: Object.freeze({ hex: 0xC06E, status: 503, message: "The payment provider's answer was not the object asked for (the field names it); nothing was applied, ask again" }),
242
+ PLAN_LIMIT: Object.freeze({ hex: 0xC06F, status: 409, message: "The account's plan allows no more of this (the field names it); account.plan.summary shows the plans that raise it" }),
243
+ SPACE_ADDON_NOT_ON_PLAN: Object.freeze({ hex: 0xC070, status: 400, message: "The plan the account would be on sells no space add-on; a plan with space_addon (Scale) does" }),
244
+ SPACE_ADDON_HELD: Object.freeze({ hex: 0xC071, status: 409, message: "The account holds space add-on blocks the new plan does not sell; release them first (a cart with space_blocks 0)" }),
245
+ SPACE_ADDON_IN_USE: Object.freeze({ hex: 0xC072, status: 409, message: "The account uses more than the space it would keep; delete data first, then release the blocks" }),
246
+ PLAN_NOT_ON_SALE: Object.freeze({ hex: 0xC073, status: 409, message: "This plan is priced but not on sale yet: it cannot be bought or moved to until the platform sells it (account.plan.summary shows what can be)" }),
232
247
  MCP_TOOL_NOT_FOUND: Object.freeze({ hex: 0xC080, status: 404, message: "The app's MCP manifest has no tool of this name; mcp.tool.list names the ones it has" }),
233
248
  MCP_TOOL_INVALID: Object.freeze({ hex: 0xC081, status: 400, message: "The tool is not one the app's /mcp can serve; field names the member at fault" }),
234
249
  MCP_TEST_USER_NOT_FOUND: Object.freeze({ hex: 0xC082, status: 404, message: "The app has no user of this id to call the tool as; user.list names its people" }),
235
250
  MCP_TOOL_FROM_ROUTE: Object.freeze({ hex: 0xC083, status: 409, message: "The tool is a route's own; its function takes it out with tools: {\"<route>\": false} (functions/<name>.json)" }),
251
+ MCP_RESULT_INVALID: Object.freeze({ hex: 0xC084, status: 502, message: "The app's function answered an _mcp that is no tools/call result; field names the member at fault" }),
252
+ MCP_OPERATIONS_IDENTITY_ONLY: Object.freeze({ hex: 0xC085, status: 403, message: "operations declares the platform's own operations: only the platform's identity app declares it" }),
253
+ MCP_LINK_NOT_LINKED: Object.freeze({ hex: 0xC086, status: 403, message: "The caller has no user of that app linked to their Substrio sign-in: they sign in there once" }),
254
+ MCP_LINK_NOT_OFFERED: Object.freeze({ hex: 0xC087, status: 404, message: "That app offers this app no such tool" }),
255
+ CALLER_USERS_REFUSED: Object.freeze({ hex: 0xC088, status: 403, message: "Only a featured app's entry, called by another app, reads that app's users; an app you merely use never reads yours" }),
256
+ NO_CALLER_APP: Object.freeze({ hex: 0xC089, status: 400, message: "This entry was called by no app (a route, a schedule or a direct call), so there are no caller users to read" }),
257
+ SELF_FIELD_REFUSED: Object.freeze({ hex: 0xC08A, status: 403, message: "The app has not marked this field of the person as one they may edit themself; field names it" }),
236
258
  KEY_AUTOMATION_NEEDS_PERSON: Object.freeze({ hex: 0xC090, status: 403, message: "Only a person signed in as themselves makes an automation key; a key, an agent or the system key makes agent keys" }),
259
+ MCP_IDENTITY_FUNCTION_NOT_DEPLOYED: Object.freeze({ hex: 0xC091, status: 500, message: "A function the release ships for the identity app was not deployed at start; the next start tries again" }),
237
260
  PACKAGE_REGISTRY_UNSET: Object.freeze({ hex: 0xC0A0, status: 503, message: "package.add has no registry: the platform setting package_registry_origin is unset" }),
238
261
  PACKAGE_UNKNOWN: Object.freeze({ hex: 0xC0A1, status: 404, message: "The registry has no package of that name" }),
239
262
  PACKAGE_NAME_INVALID: Object.freeze({ hex: 0xC0A2, status: 400, message: "Not an npm package name: lowercase letters, digits, - . _ ~, an optional @scope/" }),
@@ -245,11 +268,68 @@ export const SUBSTRIO_ERRORS = Object.freeze({
245
268
  PACKAGE_INTEGRITY_MISMATCH: Object.freeze({ hex: 0xC0A8, status: 502, message: "The tarball's SHA-512 is not the registry's dist.integrity, or the registry gives no sha512" }),
246
269
  PACKAGE_TARBALL_INVALID: Object.freeze({ hex: 0xC0A9, status: 502, message: "The tarball is not a gzip tar of a package: a link, an unsafe path, or no package.json" }),
247
270
  PACKAGE_TOO_LARGE: Object.freeze({ hex: 0xC0AA, status: 413, message: "The package unpacks past 256 MiB, or its metadata past 64 MiB" }),
271
+ ADOPT_DISABLED: Object.freeze({ hex: 0xC0B0, status: 409, message: "This server adopts no file: it was started without --adopt-dir (or its kernel has no openat2); file.upload stores the bytes instead" }),
272
+ ADOPT_SOURCE_NOT_FOUND: Object.freeze({ hex: 0xC0B1, status: 404, message: "No file of this name is beneath the server's adopt directory; source names it relative to that directory" }),
273
+ ADOPT_SOURCE_OUTSIDE: Object.freeze({ hex: 0xC0B2, status: 400, message: "The source is outside the server's adopt directory (an absolute name, or .. past it)" }),
274
+ ADOPT_SOURCE_SYMLINK: Object.freeze({ hex: 0xC0B3, status: 400, message: "The source's name passes a symbolic link; name the file itself" }),
275
+ ADOPT_SOURCE_NOT_REGULAR: Object.freeze({ hex: 0xC0B4, status: 400, message: "The source is not a regular file (a directory, a pipe, a device or a socket)" }),
276
+ ADOPT_SOURCE_LINKED: Object.freeze({ hex: 0xC0B5, status: 409, message: "The source has another name (a hard link), which would stay a writable name of the stored file; remove the other name first" }),
277
+ ADOPT_CROSS_DEVICE: Object.freeze({ hex: 0xC0B6, status: 409, message: "The source is on another filesystem than the app's file store, so it cannot be renamed in; move it onto the store's filesystem first" }),
278
+ ADOPT_SOURCE_CHANGED: Object.freeze({ hex: 0xC0B7, status: 409, message: "The source was written, or its name moved, while it was hashed; adopt it again once nothing writes it" }),
279
+ CONSOLE_LINK_NEEDS_PERSON: Object.freeze({ hex: 0xC0B8, status: 403, message: "Only a person mints a console link: an agent session for its own person, or the person signed in to the console; a key, the master key or an agent token is no person" }),
280
+ CONSOLE_LINK_UNKNOWN: Object.freeze({ hex: 0xC0B9, status: 404, message: "No live console link has this token: it is mistyped, or a newer link replaced it; the agent mints a new one" }),
281
+ CONSOLE_LINK_USED: Object.freeze({ hex: 0xC0BA, status: 410, message: "This console link was already used; each signs in once, so the agent mints a new one" }),
282
+ CONSOLE_LINK_EXPIRED: Object.freeze({ hex: 0xC0BB, status: 410, message: "This console link is past its life; the agent mints a new one" }),
283
+ CONSOLE_LINK_STEP_UP: Object.freeze({ hex: 0xC0BC, status: 403, message: "This session came from your agent's console link: sign in again with your email code or second factor to decide approvals or make an automation key" }),
284
+ AGENT_CODE_INVALID: Object.freeze({ hex: 0xC0BD, status: 401, message: "This connect code is unknown, already used or past its life; ask your owner for a new one on the console's Agents page" }),
285
+ AGENT_ALREADY_CONNECTED: Object.freeze({ hex: 0xC0BE, status: 409, message: "This connection already acts for your owner, so the connect code is not needed and was not used. A substrio_ae_ code is for an agent with no connection" }),
286
+ AGENT_TOOL_UNKNOWN: Object.freeze({ hex: 0xC0BF, status: 404, message: "No tool of this name reaches this credential; GET /v1/_agent/tools names the ones that do" }),
287
+ CPU_HISTORY_OFF: Object.freeze({ hex: 0xC0C0, status: 409, message: "This server keeps no usage minutes (usage_history_minutes is 0), so it has no CPU a minute to answer; tenant.usage has the totals" }),
288
+ SUBSCRIPTION_NOT_FOUND: Object.freeze({ hex: 0xC0C1, status: 404, message: "There is no subscription of yours by this id; subscriptions.mine lists them" }),
289
+ PLAN_FEATURE_REQUIRED: Object.freeze({ hex: 0xC0C2, status: 403, message: "Your plan at this app does not include this feature; the app's plans name the ones that do" }),
290
+ SUBSCRIBERS_NOT_VISIBLE: Object.freeze({ hex: 0xC0C3, status: 403, message: "Only the selling app and the apps of its own account read its subscribers" }),
291
+ SUBSCRIPTION_PERSON_REQUIRED: Object.freeze({ hex: 0xC0C4, status: 403, message: "This is a person's own call: sign in as the person (an agent or a key cannot buy or list for them)" }),
292
+ PLAN_FEATURE_UNKNOWN: Object.freeze({ hex: 0xC0C5, status: 403, message: "The route's plan gate names a feature the app's plans file does not have" }),
293
+ FILE_EXISTS: Object.freeze({ hex: 0xC0C6, status: 409, message: "A file already exists at the destination path; choose another path, or move with replace: true" }),
294
+ APP_NOT_NAMED: Object.freeze({ hex: 0xC0C7, status: 400, message: "This call runs at an app and the request names none: send X-Substrio-Tenant: <app>, or call the app's own host" }),
295
+ SYSTEM_PROTECTED: Object.freeze({ hex: 0xC0C8, status: 403, message: "This account or app is the platform's own and cannot be deleted" }),
296
+ SHELL_SYNTAX: Object.freeze({ hex: 0xC0D0, status: 400, message: "The command is not in the shell's grammar (the detail says where); nothing ran" }),
297
+ SHELL_UNKNOWN_COMMAND: Object.freeze({ hex: 0xC0D1, status: 400, message: "The shell has no such command; the detail lists the ones it has" }),
298
+ SHELL_UNKNOWN_VARIABLE: Object.freeze({ hex: 0xC0D2, status: 400, message: "The shell has no such variable: PWD HOME SRC SITE FILES BRANCH and ? are the ones it has" }),
299
+ SHELL_PATH_OUTSIDE: Object.freeze({ hex: 0xC0D3, status: 400, message: "The path is under no mount: /src, /site and /files are the shell's whole file system" }),
300
+ SHELL_READ_ONLY: Object.freeze({ hex: 0xC0D4, status: 400, message: "/site is the live release, read only: change /src and ship a version" }),
301
+ SHELL_WRITE_NOT_GRANTED: Object.freeze({ hex: 0xC0D5, status: 403, message: "The command writes, and the caller's grant reads only; nothing landed" }),
302
+ SHELL_FILES_DELETE: Object.freeze({ hex: 0xC0D6, status: 403, message: "A stored file is deleted with file.delete, which asks a person first; nothing landed" }),
303
+ SHELL_OFFSET_WRITES: Object.freeze({ hex: 0xC0D7, status: 400, message: "offset continues a command's output, and this command writes: run it without offset" }),
304
+ SHELL_CPU_BUDGET: Object.freeze({ hex: 0xC0D8, status: 408, message: "The command ran past the shell's CPU budget; nothing landed: narrow it" }),
305
+ SHELL_PIPE_BUDGET: Object.freeze({ hex: 0xC0D9, status: 413, message: "One stage of the command wrote past the shell's pipe budget; nothing landed: narrow it" }),
306
+ DASHBOARD_INVALID: Object.freeze({ hex: 0xC0E0, status: 400, message: "The app's dashboard file is not one the console can draw; field names the path in it (nav[2].panels[0].source.route) and the detail what is wrong" }),
307
+ REGION_NOT_FOUND: Object.freeze({ hex: 0xC0F0, status: 404, message: "No region of this slug; region.list names them" }),
308
+ REGION_IN_USE: Object.freeze({ hex: 0xC0F1, status: 409, message: "A host still names this region; host.update moves or clears it first" }),
309
+ REGION_LIMIT: Object.freeze({ hex: 0xC0F2, status: 409, message: "The platform holds the most regions it can; region.remove frees one" }),
310
+ REGION_UNAVAILABLE: Object.freeze({ hex: 0xC0F3, status: 409, message: "This region is not offered: it is hidden, unknown or serves no apps yet; region.choices lists the ones you can pick" }),
311
+ REGION_FULL: Object.freeze({ hex: 0xC0F4, status: 409, message: "Every host in this region is at its app limit; pick another region from region.choices or try again later" }),
312
+ HOST_NOT_PROBED: Object.freeze({ hex: 0xC0F5, status: 409, message: "This host has not been probed, so its CPU and systemd are unknown; host.probe first" }),
313
+ HOST_NO_SYSTEMD: Object.freeze({ hex: 0xC0F6, status: 409, message: "This host runs no systemd, which a node's service needs" }),
314
+ HOST_NGINX_PRESENT: Object.freeze({ hex: 0xC0F7, status: 409, message: "nginx is installed or running on this host; the platform serves :80 and :443 itself and never shares a host with a proxy" }),
315
+ RELEASE_NOT_FOUND: Object.freeze({ hex: 0xC0F8, status: 404, message: "The master holds no release of this id; release.list names them" }),
316
+ RELEASE_NOT_PACKED: Object.freeze({ hex: 0xC0F9, status: 409, message: "This release has no packed tarball (.tar.zst and .sha256) beside its folder, so it cannot be sent to a host" }),
317
+ RELEASE_ISA_UNKNOWN: Object.freeze({ hex: 0xC0FA, status: 409, message: "This release's manifest names no instruction set, so no host can be checked against it" }),
318
+ HOST_CPU_MISSING: Object.freeze({ hex: 0xC0FB, status: 409, message: "This host's CPU lacks features the release needs; the detail names them" }),
319
+ HOST_NODE_LIMIT: Object.freeze({ hex: 0xC0FC, status: 409, message: "This host holds the most nodes it can; host.node.undeploy frees a slot" }),
320
+ NODE_BUSY: Object.freeze({ hex: 0xC0FD, status: 409, message: "A deploy or undeploy of this node is under way; host.node.list shows when it ends" }),
248
321
  TEST_TENANT_REQUIRED: Object.freeze({ hex: 0xC570, status: 403, message: "Only a test tenant (tenant.create test=true) has fetch stubs and a clock" }),
322
+ ARCHIVE_INVALID: Object.freeze({ hex: 0xC580, status: 400, message: "The archive is not one app.archive made, or an entry does not match its manifest.json; detail names the entry. Nothing was written" }),
323
+ ARCHIVE_PASSPHRASE_WRONG: Object.freeze({ hex: 0xC581, status: 400, message: "The X-Substrio-Passphrase header does not open the archive's sealed.bin; send the passphrase it was downloaded with, or none to restore without the sealed part. Nothing was written" }),
324
+ WASM_MODULE_INVALID: Object.freeze({ hex: 0xC590, status: 400, message: "The Wasm module is not valid, lacks an export the platform calls (substrio_fetch, substrio_in, substrio_alloc, memory) or imports something the platform does not provide; the detail names it. Nothing was deployed" }),
325
+ WASM_COMPILE_FAILED: Object.freeze({ hex: 0xC591, status: 422, message: "The Wasm module is valid but was not compiled within the deploy's time and memory limits. Nothing was deployed" }),
326
+ WASM_CELLS_UNSUPPORTED: Object.freeze({ hex: 0xC592, status: 409, message: "This server runs tenant code in cells, where a Wasm function cannot run yet. Nothing was deployed" }),
327
+ RUST_COMPILE_FAILED: Object.freeze({ hex: 0xC593, status: 422, message: "The Rust source did not compile; the detail is the compiler's own diagnostics, with the line and column of each error. Nothing was deployed" }),
328
+ RUST_TOOLCHAIN_UNAVAILABLE: Object.freeze({ hex: 0xC594, status: 503, message: "This server cannot compile Rust: its release has no Rust toolchain (a release ships one; a dev build needs SUBSTRIO_RUST), or the tools jail could not run it (the detail says why). Nothing was deployed" }),
249
329
  SERIALIZATION: Object.freeze({ hex: 0xF000, status: 500, message: "Serialization error" }),
250
330
  DESERIALIZATION: Object.freeze({ hex: 0xF001, status: 400, message: "Deserialization error" }),
251
331
  PIPELINE_TOO_LARGE: Object.freeze({ hex: 0xF002, status: 400, message: "Pipeline too large" }),
252
- INVALID_JSON: Object.freeze({ hex: 0xF003, status: 400, message: "Invalid JSON" }),
332
+ INVALID_JSON: Object.freeze({ hex: 0xF003, status: 400, message: "The request body is not valid JSON." }),
253
333
  EMPTY_PAYLOAD: Object.freeze({ hex: 0xF004, status: 400, message: "Request payload is empty" }),
254
334
  BODY_REQUIRED: Object.freeze({ hex: 0xF005, status: 400, message: "Request body is required" }),
255
335
  METHOD_NOT_ALLOWED: Object.freeze({ hex: 0xF006, status: 405, message: "HTTP method not allowed" }),