larkup 0.4.50 → 0.4.51

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 (70) hide show
  1. package/.next/standalone/apps/web/.next/BUILD_ID +1 -1
  2. package/.next/standalone/apps/web/.next/app-path-routes-manifest.json +18 -18
  3. package/.next/standalone/apps/web/.next/build-manifest.json +2 -2
  4. package/.next/standalone/apps/web/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/apps/web/.next/required-server-files.json +1 -1
  6. package/.next/standalone/apps/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/apps/web/.next/server/app/_global-error.html +1 -1
  8. package/.next/standalone/apps/web/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  11. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/apps/web/.next/server/app/_not-found.html +1 -1
  14. package/.next/standalone/apps/web/.next/server/app/_not-found.rsc +2 -2
  15. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  16. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  17. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  18. package/.next/standalone/apps/web/.next/server/app/add/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/apps/web/.next/server/app/add.html +1 -1
  20. package/.next/standalone/apps/web/.next/server/app/add.rsc +2 -2
  21. package/.next/standalone/apps/web/.next/server/app/add.segments/_full.segment.rsc +2 -2
  22. package/.next/standalone/apps/web/.next/server/app/add.segments/_tree.segment.rsc +1 -1
  23. package/.next/standalone/apps/web/.next/server/app/add.segments/add/__PAGE__.segment.rsc +2 -2
  24. package/.next/standalone/apps/web/.next/server/app/chat/[id]/page_client-reference-manifest.js +1 -1
  25. package/.next/standalone/apps/web/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  26. package/.next/standalone/apps/web/.next/server/app/chat.html +1 -1
  27. package/.next/standalone/apps/web/.next/server/app/chat.rsc +2 -2
  28. package/.next/standalone/apps/web/.next/server/app/chat.segments/_full.segment.rsc +2 -2
  29. package/.next/standalone/apps/web/.next/server/app/chat.segments/_tree.segment.rsc +1 -1
  30. package/.next/standalone/apps/web/.next/server/app/chat.segments/chat/__PAGE__.segment.rsc +2 -2
  31. package/.next/standalone/apps/web/.next/server/app/data/page_client-reference-manifest.js +1 -1
  32. package/.next/standalone/apps/web/.next/server/app/data.html +1 -1
  33. package/.next/standalone/apps/web/.next/server/app/data.rsc +2 -2
  34. package/.next/standalone/apps/web/.next/server/app/data.segments/_full.segment.rsc +2 -2
  35. package/.next/standalone/apps/web/.next/server/app/data.segments/_tree.segment.rsc +1 -1
  36. package/.next/standalone/apps/web/.next/server/app/data.segments/data/__PAGE__.segment.rsc +2 -2
  37. package/.next/standalone/apps/web/.next/server/app/index.html +1 -1
  38. package/.next/standalone/apps/web/.next/server/app/index.rsc +2 -2
  39. package/.next/standalone/apps/web/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  40. package/.next/standalone/apps/web/.next/server/app/index.segments/_full.segment.rsc +2 -2
  41. package/.next/standalone/apps/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  42. package/.next/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  44. package/.next/standalone/apps/web/.next/server/app/settings.html +1 -1
  45. package/.next/standalone/apps/web/.next/server/app/settings.rsc +2 -2
  46. package/.next/standalone/apps/web/.next/server/app/settings.segments/_full.segment.rsc +2 -2
  47. package/.next/standalone/apps/web/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  48. package/.next/standalone/apps/web/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  49. package/.next/standalone/apps/web/.next/server/app/widget-demo/page_client-reference-manifest.js +1 -1
  50. package/.next/standalone/apps/web/.next/server/app/widget-demo.html +1 -1
  51. package/.next/standalone/apps/web/.next/server/app/widget-demo.rsc +2 -2
  52. package/.next/standalone/apps/web/.next/server/app/widget-demo.segments/_full.segment.rsc +2 -2
  53. package/.next/standalone/apps/web/.next/server/app/widget-demo.segments/_tree.segment.rsc +1 -1
  54. package/.next/standalone/apps/web/.next/server/app/widget-demo.segments/widget-demo/__PAGE__.segment.rsc +2 -2
  55. package/.next/standalone/apps/web/.next/server/app-paths-manifest.json +18 -18
  56. package/.next/standalone/apps/web/.next/server/chunks/309.js +1 -1
  57. package/.next/standalone/apps/web/.next/server/middleware-build-manifest.js +1 -1
  58. package/.next/standalone/apps/web/.next/server/pages/404.html +1 -1
  59. package/.next/standalone/apps/web/.next/server/pages/500.html +1 -1
  60. package/.next/standalone/apps/web/.next/server/preview-props.json +3 -3
  61. package/.next/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
  62. package/.next/standalone/apps/web/.next/static/chunks/app/{layout-614a36b83ada6ceb.js → layout-72c0f3f6723d5c44.js} +1 -1
  63. package/.next/standalone/apps/web/bin/larkup.js +52 -12
  64. package/.next/standalone/apps/web/lib/release-metadata.test.ts +7 -2
  65. package/.next/standalone/apps/web/package.json +1 -1
  66. package/.next/standalone/apps/web/server.js +1 -1
  67. package/bin/larkup.js +52 -12
  68. package/package.json +3 -3
  69. /package/.next/standalone/apps/web/.next/static/{YhZYLHkRObR01YpuQvCP6 → 65ELnOs_x6XQ7dO3mtxDx}/_buildManifest.js +0 -0
  70. /package/.next/standalone/apps/web/.next/static/{YhZYLHkRObR01YpuQvCP6 → 65ELnOs_x6XQ7dO3mtxDx}/_ssgManifest.js +0 -0
package/bin/larkup.js CHANGED
@@ -34,7 +34,6 @@ if (command === '--version' || command === '-v') {
34
34
  process.exit(1);
35
35
  }
36
36
  await migrateLegacyRuntimeState();
37
- await prepareLocalAnalysisRuntime();
38
37
  const child = spawn(process.execPath, [standaloneServer], {
39
38
  cwd: packageDir,
40
39
  stdio: 'inherit',
@@ -47,6 +46,11 @@ if (command === '--version' || command === '-v') {
47
46
  });
48
47
  child.once('exit', (code) => process.exit(code ?? 0));
49
48
 
49
+ // Start the browser-facing application immediately. The local analysis
50
+ // environment is warmed through the running server so an analysis request
51
+ // can share that same in-process setup instead of starting a second install.
52
+ void prepareLocalAnalysisRuntime(url);
53
+
50
54
  if (process.env.CI !== 'true' && process.env.LARKUP_NO_OPEN !== '1') {
51
55
  void openWhenReady(url);
52
56
  }
@@ -199,20 +203,43 @@ async function migrateLegacyRuntimeState() {
199
203
  }
200
204
 
201
205
  /**
202
- * Prepare the managed Python environment before the browser can submit an
203
- * analysis request. A fresh Windows install may need several minutes to fetch
204
- * pandas, numpy, and the other pinned wheels; doing that inside the streamed
205
- * chat request can outlive the model step even though installation succeeds.
206
+ * Warm the managed Python environment after the application starts. A fresh
207
+ * Windows install may need several minutes to fetch pandas, numpy, and the
208
+ * other pinned wheels, but that work must not block the UI from opening.
206
209
  *
207
- * This launcher is used only by the local npm application. Managed Cloud hosts
208
- * start their configured remote sandbox adapters through the server runtime
209
- * and never enter this path.
210
+ * Going through the existing sandbox API keeps setup in the server process.
211
+ * If chat analysis starts while warmup is running, both calls share the same
212
+ * cached setup promise. Managed Cloud and configured remote backends are
213
+ * detected by the health response and never enter the local setup path.
210
214
  */
211
- async function prepareLocalAnalysisRuntime() {
212
- console.log(`\x1b[38;2;223;156;32mPreparing local analysis runtime…\x1b[0m`);
215
+ async function prepareLocalAnalysisRuntime(url) {
213
216
  try {
214
- const { SandboxManager } = await import('@larkup/sandbox');
215
- await new SandboxManager({ backend: 'local' }).setup();
217
+ const health = await waitForSandboxApi(url);
218
+ if (!health || health.backend !== 'local') return;
219
+
220
+ console.log(`\x1b[38;2;223;156;32mPreparing local analysis runtime in the background…\x1b[0m`);
221
+ console.log('Larkup is ready to open; analysis tools will activate when setup finishes.');
222
+
223
+ const startedAt = Date.now();
224
+ const progress = setInterval(() => {
225
+ const elapsedSeconds = Math.floor((Date.now() - startedAt) / 1_000);
226
+ const elapsed =
227
+ elapsedSeconds < 60 ? `${elapsedSeconds}s` : `${Math.floor(elapsedSeconds / 60)} min`;
228
+ console.log(`Still preparing local analysis runtime (${elapsed})…`);
229
+ }, 30_000);
230
+
231
+ try {
232
+ const response = await fetch(new URL('/api/sandbox?action=setup', url), {
233
+ method: 'POST',
234
+ });
235
+ const result = await response.json().catch(() => ({}));
236
+ if (!response.ok) {
237
+ throw new Error(result.error || `setup request failed with HTTP ${response.status}`);
238
+ }
239
+ } finally {
240
+ clearInterval(progress);
241
+ }
242
+
216
243
  console.log(`\x1b[32mLocal analysis runtime ready.\x1b[0m`);
217
244
  } catch (error) {
218
245
  const message = error instanceof Error ? error.message : String(error);
@@ -221,6 +248,19 @@ async function prepareLocalAnalysisRuntime() {
221
248
  }
222
249
  }
223
250
 
251
+ async function waitForSandboxApi(url) {
252
+ for (let attempt = 0; attempt < 120; attempt += 1) {
253
+ try {
254
+ const response = await fetch(new URL('/api/sandbox', url));
255
+ if (response.ok) return await response.json();
256
+ } catch {
257
+ // The standalone server is still starting.
258
+ }
259
+ await new Promise((resolve) => setTimeout(resolve, 250));
260
+ }
261
+ return undefined;
262
+ }
263
+
224
264
  async function activeProjectConfig() {
225
265
  const root = projectRoot();
226
266
  const entries = await fs.readdir(root, { withFileTypes: true }).catch(() => []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larkup",
3
- "version": "0.4.50",
3
+ "version": "0.4.51",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },
@@ -71,9 +71,9 @@
71
71
  "zod": "^4.4.3",
72
72
  "zustand": "^5.0.14",
73
73
  "@larkup/workspace-ui": "0.2.0",
74
+ "@larkup/runtime-kit": "0.3.0",
74
75
  "@larkup/workspace-server": "0.2.30",
75
- "@larkup/workspace-app": "0.2.12",
76
- "@larkup/runtime-kit": "0.3.0"
76
+ "@larkup/workspace-app": "0.2.12"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@tailwindcss/postcss": "^4.2.0",