@lumerahq/cli 0.13.0 → 0.13.2

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.
@@ -136,20 +136,37 @@ async function registerDevApp(apiBase, token, appName, appTitle, appUrl) {
136
136
  throw new Error(`Failed to register app: ${await res.text()}`);
137
137
  }
138
138
  }
139
+ function detectRunner(projectRoot) {
140
+ if (existsSync(resolve(projectRoot, "bun.lockb")) || existsSync(resolve(projectRoot, "bun.lock"))) {
141
+ return ["bunx"];
142
+ }
143
+ if (existsSync(resolve(projectRoot, "pnpm-lock.yaml"))) {
144
+ return ["pnpm", "exec"];
145
+ }
146
+ try {
147
+ execSync("pnpm --version", { stdio: "ignore" });
148
+ return ["pnpm", "exec"];
149
+ } catch {
150
+ return ["bunx"];
151
+ }
152
+ }
139
153
  async function dev(options) {
140
154
  const {
141
155
  token,
142
156
  appName,
143
157
  appTitle,
144
158
  port,
159
+ host,
145
160
  appUrl = `http://localhost:${port}`,
146
161
  apiUrl
147
162
  } = options;
163
+ const projectRoot = process.cwd();
148
164
  console.log();
149
165
  console.log(pc.cyan(pc.bold(` ${appTitle} - Dev Server`)));
150
166
  console.log();
151
167
  console.log(pc.dim(" Configuration:"));
152
168
  console.log(pc.dim(` Port: ${port}`));
169
+ if (host) console.log(pc.dim(` Host: ${host}`));
153
170
  console.log(pc.dim(` URL: ${appUrl}`));
154
171
  console.log();
155
172
  console.log(pc.dim(" Registering app with Lumera..."));
@@ -175,7 +192,17 @@ async function dev(options) {
175
192
  ([key]) => safeEnvPrefixes.some((prefix) => key.startsWith(prefix)) || safeEnvKeys.includes(key)
176
193
  )
177
194
  );
178
- const vite = spawn("pnpm", ["exec", "vite", "--port", String(port)], {
195
+ const runner = detectRunner(projectRoot);
196
+ const viteArgs = ["vite", "--port", String(port)];
197
+ const sandboxConfig = resolve(projectRoot, "vite.sandbox.config.ts");
198
+ if (existsSync(sandboxConfig)) {
199
+ viteArgs.push("--config", "vite.sandbox.config.ts");
200
+ }
201
+ if (host) {
202
+ viteArgs.push("--host", host);
203
+ }
204
+ const [cmd, ...cmdArgs] = runner;
205
+ const vite = spawn(cmd, [...cmdArgs, ...viteArgs], {
179
206
  stdio: "inherit",
180
207
  env: {
181
208
  ...filteredEnv,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  dev
3
- } from "./chunk-CDZZ3JYU.js";
3
+ } from "./chunk-XTRDJLIA.js";
4
4
  import {
5
5
  createApiClient,
6
6
  loadEnv
@@ -49,6 +49,7 @@ ${pc.dim("Description:")}
49
49
 
50
50
  ${pc.dim("Options:")}
51
51
  --port <number> Dev server port (default: 8080)
52
+ --host <host> Host to bind to (e.g., 0.0.0.0 for all interfaces)
52
53
  --url <url> App URL for dev mode (default: http://localhost:{port})
53
54
  --skip-setup Skip auto-apply on first run
54
55
  --help, -h Show this help
@@ -140,12 +141,14 @@ async function dev2(args) {
140
141
  }
141
142
  }
142
143
  const port = Number(flags.port || process.env.PORT || "8080");
144
+ const host = typeof flags.host === "string" ? flags.host : void 0;
143
145
  const appUrl = typeof flags.url === "string" ? flags.url : process.env.APP_URL;
144
146
  await dev({
145
147
  token,
146
148
  appName,
147
149
  appTitle,
148
150
  port,
151
+ host,
149
152
  appUrl,
150
153
  apiUrl
151
154
  });
package/dist/index.js CHANGED
@@ -210,26 +210,26 @@ async function main() {
210
210
  switch (command) {
211
211
  // Resource commands
212
212
  case "plan":
213
- await import("./resources-JDUZSI43.js").then((m) => m.plan(args.slice(1)));
213
+ await import("./resources-TCYJ5AEO.js").then((m) => m.plan(args.slice(1)));
214
214
  break;
215
215
  case "apply":
216
- await import("./resources-JDUZSI43.js").then((m) => m.apply(args.slice(1)));
216
+ await import("./resources-TCYJ5AEO.js").then((m) => m.apply(args.slice(1)));
217
217
  break;
218
218
  case "pull":
219
- await import("./resources-JDUZSI43.js").then((m) => m.pull(args.slice(1)));
219
+ await import("./resources-TCYJ5AEO.js").then((m) => m.pull(args.slice(1)));
220
220
  break;
221
221
  case "destroy":
222
- await import("./resources-JDUZSI43.js").then((m) => m.destroy(args.slice(1)));
222
+ await import("./resources-TCYJ5AEO.js").then((m) => m.destroy(args.slice(1)));
223
223
  break;
224
224
  case "list":
225
- await import("./resources-JDUZSI43.js").then((m) => m.list(args.slice(1)));
225
+ await import("./resources-TCYJ5AEO.js").then((m) => m.list(args.slice(1)));
226
226
  break;
227
227
  case "show":
228
- await import("./resources-JDUZSI43.js").then((m) => m.show(args.slice(1)));
228
+ await import("./resources-TCYJ5AEO.js").then((m) => m.show(args.slice(1)));
229
229
  break;
230
230
  // Development
231
231
  case "dev":
232
- await import("./dev-LNH47WSS.js").then((m) => m.dev(args.slice(1)));
232
+ await import("./dev-LBWA7G6T.js").then((m) => m.dev(args.slice(1)));
233
233
  break;
234
234
  case "run":
235
235
  await import("./run-3UBV3SVA.js").then((m) => m.run(args.slice(1)));
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  deploy
3
- } from "./chunk-CDZZ3JYU.js";
3
+ } from "./chunk-XTRDJLIA.js";
4
4
  import {
5
5
  createApiClient,
6
6
  loadEnv
@@ -18,8 +18,19 @@ import {
18
18
  // src/commands/resources.ts
19
19
  import pc from "picocolors";
20
20
  import prompts from "prompts";
21
+ import { execFileSync, execSync } from "child_process";
21
22
  import { existsSync, readdirSync, readFileSync, writeFileSync, mkdirSync } from "fs";
22
23
  import { join, resolve } from "path";
24
+ function detectPackageManager() {
25
+ for (const pm of ["bun", "pnpm", "yarn", "npm"]) {
26
+ try {
27
+ execFileSync(pm, ["--version"], { stdio: "ignore" });
28
+ return pm;
29
+ } catch {
30
+ }
31
+ }
32
+ return "npm";
33
+ }
23
34
  function showPlanHelp() {
24
35
  console.log(`
25
36
  ${pc.dim("Usage:")}
@@ -711,9 +722,9 @@ async function applyApp(args) {
711
722
  const apiUrl = getApiUrl();
712
723
  if (!skipBuild) {
713
724
  console.log(pc.dim(" Building..."));
714
- const { execSync } = await import("child_process");
715
725
  try {
716
- execSync("pnpm build", { cwd: projectRoot, stdio: "inherit" });
726
+ const pm = detectPackageManager();
727
+ execSync(`${pm} run build`, { cwd: projectRoot, stdio: "inherit" });
717
728
  } catch {
718
729
  throw new Error("Build failed");
719
730
  }
@@ -898,6 +909,7 @@ async function planAgents(api, localAgents) {
898
909
  if (remote.name !== agent.name) diffs.push("name");
899
910
  if ((remote.description || "") !== (agent.description || "")) diffs.push("description");
900
911
  if ((remote.system_prompt || "").trim() !== systemPrompt.trim()) diffs.push("system_prompt");
912
+ if ((remote.model || "") !== (agent.model || "")) diffs.push("model");
901
913
  if (diffs.length > 0) {
902
914
  changes.push({ type: "update", resource: "agent", id: agent.external_id, name: agent.name, details: `changed: ${diffs.join(", ")}` });
903
915
  }
@@ -939,6 +951,7 @@ async function applyAgents(api, localAgents) {
939
951
  name: agent.name,
940
952
  description: agent.description || "",
941
953
  system_prompt: systemPrompt,
954
+ model: agent.model || "",
942
955
  skill_ids: skillIds
943
956
  };
944
957
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumerahq/cli",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "CLI for building and deploying Lumera apps",
5
5
  "type": "module",
6
6
  "engines": {