@genex-ai/cli-demo 1.13.1-dev.558 → 1.14.0-dev.560

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.
@@ -1,13 +1,13 @@
1
1
  import {
2
- BLENDER_SETUP_HINT,
3
2
  SHEET_FORMATS,
4
3
  acquireSeat,
5
4
  blenderCall,
6
5
  blenderEndpoint,
6
+ blenderSetupHint,
7
7
  isRenderMode,
8
8
  sceneSummary,
9
9
  sheetOf
10
- } from "./chunk-WXHTNSFB.js";
10
+ } from "./chunk-2UJK5OCB.js";
11
11
  import {
12
12
  getCliVersion
13
13
  } from "./chunk-HYCSNWYX.js";
@@ -178,7 +178,7 @@ async function handle(msg) {
178
178
  if (!tool) return fail(id, -32602, `Unknown tool: ${name}`);
179
179
  const base = await mcpEndpoint();
180
180
  if (!base) {
181
- return reply(id, { content: [{ type: "text", text: BLENDER_SETUP_HINT }], isError: true });
181
+ return reply(id, { content: [{ type: "text", text: blenderSetupHint() }], isError: true });
182
182
  }
183
183
  try {
184
184
  return reply(id, await tool.run(args, base));
@@ -124,13 +124,20 @@ function blenderEndpoint() {
124
124
  const raw = process.env.GENEX_BLENDER_URL?.trim();
125
125
  return raw ? raw.replace(/\/+$/, "") : void 0;
126
126
  }
127
- var BLENDER_SETUP_HINT = [
128
- "GENEX_BLENDER_URL is not set \u2014 there is no hosted Blender service yet.",
129
- " Start one locally:",
130
- " docker build --platform=linux/amd64 -t genex-blender:m0 apps/blender-service",
131
- " docker run -d --platform=linux/amd64 -p 8099:8080 genex-blender:m0",
132
- " export GENEX_BLENDER_URL=http://localhost:8099"
133
- ].join("\n");
127
+ function blenderSetupHint() {
128
+ if (process.env.GENEX_HOSTED_SESSION === "1") {
129
+ return [
130
+ "The Blender lane is off on this stand \u2014 there is no seat to acquire.",
131
+ " Build the space in code instead ($genex-threejs-procedural-assets); do not wait for it."
132
+ ].join("\n");
133
+ }
134
+ return [
135
+ "No Blender endpoint. Run the service against your own Blender in another terminal:",
136
+ " npx genex blender serve",
137
+ " export GENEX_BLENDER_URL=http://localhost:8088",
138
+ " GENEX_BLENDER_URL may also point at any running genex-blender service."
139
+ ].join("\n");
140
+ }
134
141
  var SHEET_FORMATS = ["webp", "png"];
135
142
  function sheetOf(r) {
136
143
  if (r.contactSheet?.b64) return { b64: r.contactSheet.b64, mime: r.contactSheet.mime };
@@ -198,7 +205,8 @@ async function blenderCall(base, route, body) {
198
205
  seat ? `${route} refused the seat token (401) \u2014 the seat may have been closed; run the command again to acquire a new one` : `${route} refused the request (401) \u2014 set GENEX_BLENDER_SECRET to the service's secret`
199
206
  );
200
207
  }
201
- throw new Error(`${route} failed (${res.status}): ${json.error ?? text.slice(0, 200)}`);
208
+ const detail = typeof json.detail === "string" ? ` \u2014 ${json.detail}` : "";
209
+ throw new Error(`${route} failed (${res.status}): ${json.error ?? text.slice(0, 200)}${detail}`);
202
210
  }
203
211
  return json;
204
212
  } catch (err) {
@@ -431,7 +439,7 @@ export {
431
439
  RENDER_MODES,
432
440
  isRenderMode,
433
441
  blenderEndpoint,
434
- BLENDER_SETUP_HINT,
442
+ blenderSetupHint,
435
443
  SHEET_FORMATS,
436
444
  sheetOf,
437
445
  sheetExt,