@fungi.computer/tourtois 0.29.3 → 0.30.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/dist/OysterComputers.js +13 -0
- package/package.json +2 -2
package/dist/OysterComputers.js
CHANGED
|
@@ -37,6 +37,11 @@ const computerRunStateSchema = z.looseObject({
|
|
|
37
37
|
});
|
|
38
38
|
const missingRuntime = z.strictObject({ error: z.literal("no_runtime") });
|
|
39
39
|
const switchUnavailable = z.strictObject({ error: z.literal("unavailable") });
|
|
40
|
+
/** The Team already runs its limit of Computers; `reason` says what lifts it. */
|
|
41
|
+
const capacityRefusal = z.looseObject({
|
|
42
|
+
error: z.literal("capacity"),
|
|
43
|
+
reason: z.string().min(1).max(1_024),
|
|
44
|
+
});
|
|
40
45
|
/**
|
|
41
46
|
* The host answered that this Computer has no such switch (a local trial's
|
|
42
47
|
* own machine has no sleep or egress policy). Unlike a failed check, there
|
|
@@ -63,6 +68,14 @@ async function request(url, init) {
|
|
|
63
68
|
if (response.status === 409 &&
|
|
64
69
|
switchUnavailable.safeParse(await response.clone().json()).success)
|
|
65
70
|
throw new SwitchUnavailable();
|
|
71
|
+
if (response.status === 429) {
|
|
72
|
+
const refused = capacityRefusal.safeParse(await response.clone().json());
|
|
73
|
+
if (refused.success)
|
|
74
|
+
throw new AppError(refused.data.reason, {
|
|
75
|
+
code: "HOST_FAILURE",
|
|
76
|
+
retryable: false,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
66
79
|
if (!response.ok)
|
|
67
80
|
throw new AppError(`Computer request refused (${String(response.status)}).`, {
|
|
68
81
|
code: response.status === 401 || response.status === 403
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/tourtois",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"description": "Tourtois: the trusted desktop shell for Oyster and Fungi, with host-supplied Settings sections",
|
|
6
6
|
"type": "module",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"react": "^18.3.1 || ^19.2.0"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@fungi.computer/oyster": "0.
|
|
109
|
+
"@fungi.computer/oyster": "0.48.0",
|
|
110
110
|
"@cloudflare/workers-types": "5.20260828.1",
|
|
111
111
|
"@fungi.computer/forage": "0.3.13",
|
|
112
112
|
"@fungi.computer/mycelium": "0.4.7",
|