regionclaw 0.0.19 → 0.0.21

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.
Files changed (44) hide show
  1. package/apps/ui/src/components/regionclaw-update-banner.tsx +38 -10
  2. package/bin/regionclaw.js +3 -1
  3. package/dist/ui/BUILD_ID +1 -1
  4. package/dist/ui/build-manifest.json +3 -3
  5. package/dist/ui/server/app/(app)/dashboard/page.js +2 -2
  6. package/dist/ui/server/app/(app)/dashboard/page.js.nft.json +1 -1
  7. package/dist/ui/server/app/(app)/dashboard/page_client-reference-manifest.js +1 -1
  8. package/dist/ui/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/dist/ui/server/app/_global-error.html +1 -1
  10. package/dist/ui/server/app/_global-error.rsc +1 -1
  11. package/dist/ui/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/dist/ui/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  13. package/dist/ui/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  14. package/dist/ui/server/app/_global-error.segments/_head.segment.rsc +1 -1
  15. package/dist/ui/server/app/_global-error.segments/_index.segment.rsc +1 -1
  16. package/dist/ui/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/dist/ui/server/app/_not-found/page.js +2 -2
  18. package/dist/ui/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/dist/ui/server/app/_not-found.html +1 -1
  20. package/dist/ui/server/app/_not-found.rsc +5 -5
  21. package/dist/ui/server/app/_not-found.segments/_full.segment.rsc +5 -5
  22. package/dist/ui/server/app/_not-found.segments/_head.segment.rsc +1 -1
  23. package/dist/ui/server/app/_not-found.segments/_index.segment.rsc +5 -5
  24. package/dist/ui/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  25. package/dist/ui/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  26. package/dist/ui/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  27. package/dist/ui/server/app/login/page.js +1 -1
  28. package/dist/ui/server/app/login/page.js.nft.json +1 -1
  29. package/dist/ui/server/app/login/page_client-reference-manifest.js +1 -1
  30. package/dist/ui/server/app/page.js +1 -1
  31. package/dist/ui/server/app/page_client-reference-manifest.js +1 -1
  32. package/dist/ui/server/app/setup/page.js +1 -1
  33. package/dist/ui/server/app/setup/page.js.nft.json +1 -1
  34. package/dist/ui/server/app/setup/page_client-reference-manifest.js +1 -1
  35. package/dist/ui/server/chunks/{353.js → 313.js} +1 -1
  36. package/dist/ui/server/middleware-build-manifest.js +1 -1
  37. package/dist/ui/server/pages/404.html +1 -1
  38. package/dist/ui/server/pages/500.html +1 -1
  39. package/dist/ui/static/chunks/app/(app)/{layout-82cf93d9a66acd5d.js → layout-97b7aad9af7774cd.js} +1 -1
  40. package/dist/ui/static/chunks/app/{layout-812a5dd3c2548265.js → layout-3d1ba533ac2879b9.js} +1 -1
  41. package/dist/ui/static/chunks/{webpack-95e4dbce7bf11a3e.js → webpack-aeb6fe2403cfa38a.js} +1 -1
  42. package/package.json +1 -1
  43. /package/dist/ui/static/{8XzvPZcI7BAp44cFrlmSD → K80LYO_dQPGtPZuV6HX5L}/_buildManifest.js +0 -0
  44. /package/dist/ui/static/{8XzvPZcI7BAp44cFrlmSD → K80LYO_dQPGtPZuV6HX5L}/_ssgManifest.js +0 -0
@@ -50,10 +50,13 @@ export function RegionClawUpdateBanner() {
50
50
 
51
51
  async function loadStatus() {
52
52
  try {
53
- const response = await fetch("/api/update/status", {
54
- method: "GET",
55
- credentials: "same-origin",
56
- cache: "no-store",
53
+ const response = await fetchWithTimeout("/api/update/status", {
54
+ timeoutMs: 3_000,
55
+ init: {
56
+ method: "GET",
57
+ credentials: "same-origin",
58
+ cache: "no-store",
59
+ },
57
60
  });
58
61
  const payload = (await response.json()) as UpdateStatus;
59
62
  if (!cancelled) {
@@ -85,10 +88,13 @@ export function RegionClawUpdateBanner() {
85
88
 
86
89
  while (Date.now() - startedAt < 120_000) {
87
90
  try {
88
- const response = await fetch("/api/update/status", {
89
- method: "GET",
90
- credentials: "same-origin",
91
- cache: "no-store",
91
+ const response = await fetchWithTimeout("/api/update/status", {
92
+ timeoutMs: 1_200,
93
+ init: {
94
+ method: "GET",
95
+ credentials: "same-origin",
96
+ cache: "no-store",
97
+ },
92
98
  });
93
99
 
94
100
  if (response.ok) {
@@ -97,7 +103,7 @@ export function RegionClawUpdateBanner() {
97
103
  const nextUrl = new URL(window.location.href);
98
104
  nextUrl.searchParams.set("regionclawUpdated", targetVersion);
99
105
  nextUrl.searchParams.set("regionclawReloadedAt", String(Date.now()));
100
- window.location.assign(nextUrl.toString());
106
+ window.location.replace(nextUrl.toString());
101
107
  return;
102
108
  }
103
109
  }
@@ -105,7 +111,7 @@ export function RegionClawUpdateBanner() {
105
111
  // RegionClaw is probably restarting; keep polling.
106
112
  }
107
113
 
108
- await new Promise((resolve) => setTimeout(resolve, 2_000));
114
+ await new Promise((resolve) => setTimeout(resolve, 500));
109
115
  }
110
116
 
111
117
  toast.error("RegionClaw restarted too slowly. Refresh the page manually.");
@@ -231,3 +237,25 @@ export function RegionClawUpdateBanner() {
231
237
  </div>
232
238
  );
233
239
  }
240
+
241
+ async function fetchWithTimeout(
242
+ input: RequestInfo | URL,
243
+ options: {
244
+ timeoutMs: number;
245
+ init?: RequestInit;
246
+ },
247
+ ) {
248
+ const controller = new AbortController();
249
+ const timeoutId = setTimeout(() => {
250
+ controller.abort();
251
+ }, options.timeoutMs);
252
+
253
+ try {
254
+ return await fetch(input, {
255
+ ...options.init,
256
+ signal: controller.signal,
257
+ });
258
+ } finally {
259
+ clearTimeout(timeoutId);
260
+ }
261
+ }
package/bin/regionclaw.js CHANGED
@@ -287,7 +287,9 @@ async function stopRunningProcess(payload) {
287
287
  };
288
288
  }
289
289
 
290
- for (let attempt = 0; attempt < 40; attempt += 1) {
290
+ const gracefulAttempts = isPortListening(payload.host, payload.port) ? 40 : 8;
291
+
292
+ for (let attempt = 0; attempt < gracefulAttempts; attempt += 1) {
291
293
  if (!isPidRunning(payload.pid)) {
292
294
  clearRuntimeState(payload.pid);
293
295
  return {
package/dist/ui/BUILD_ID CHANGED
@@ -1 +1 @@
1
- 8XzvPZcI7BAp44cFrlmSD
1
+ K80LYO_dQPGtPZuV6HX5L
@@ -4,11 +4,11 @@
4
4
  ],
5
5
  "devFiles": [],
6
6
  "lowPriorityFiles": [
7
- "static/8XzvPZcI7BAp44cFrlmSD/_buildManifest.js",
8
- "static/8XzvPZcI7BAp44cFrlmSD/_ssgManifest.js"
7
+ "static/K80LYO_dQPGtPZuV6HX5L/_buildManifest.js",
8
+ "static/K80LYO_dQPGtPZuV6HX5L/_ssgManifest.js"
9
9
  ],
10
10
  "rootMainFiles": [
11
- "static/chunks/webpack-95e4dbce7bf11a3e.js",
11
+ "static/chunks/webpack-aeb6fe2403cfa38a.js",
12
12
  "static/chunks/628c8b96-cdfc45e32fce7014.js",
13
13
  "static/chunks/16-7d9bc77e936a4cb6.js",
14
14
  "static/chunks/main-app-e0f42b94daafe3ad.js"