@lumerahq/cli 0.24.1 → 0.24.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.
@@ -3,7 +3,7 @@ import {
3
3
  getCredentials,
4
4
  getTokenSource,
5
5
  init_auth
6
- } from "./chunk-ZH3NVYEQ.js";
6
+ } from "./chunk-JLVVHTBY.js";
7
7
  import {
8
8
  fetchWithRetry
9
9
  } from "./chunk-FJFIWC7G.js";
@@ -4,11 +4,11 @@ import {
4
4
  import {
5
5
  createApiClient,
6
6
  isApiErrorStatus
7
- } from "./chunk-HTPNRY3F.js";
7
+ } from "./chunk-FHHWIV4C.js";
8
8
  import {
9
9
  findProjectRoot,
10
10
  getAppName
11
- } from "./chunk-ZH3NVYEQ.js";
11
+ } from "./chunk-JLVVHTBY.js";
12
12
 
13
13
  // src/commands/deps.ts
14
14
  import pc from "picocolors";
@@ -2,7 +2,7 @@ import {
2
2
  getCredentials,
3
3
  getToken,
4
4
  init_auth
5
- } from "./chunk-ZH3NVYEQ.js";
5
+ } from "./chunk-JLVVHTBY.js";
6
6
  import {
7
7
  fetchWithRetry
8
8
  } from "./chunk-FJFIWC7G.js";
@@ -14,6 +14,9 @@ __export(auth_exports, {
14
14
  import { existsSync, readFileSync } from "fs";
15
15
  import { homedir } from "os";
16
16
  import { join } from "path";
17
+ function getRuntimeCredsPath() {
18
+ return process.env.LUMERA_CREDENTIALS_PATH?.trim() || null;
19
+ }
17
20
  function getLocalCredsPath(cwd = process.cwd()) {
18
21
  return join(cwd, ".lumera", "credentials.json");
19
22
  }
@@ -21,6 +24,14 @@ function getToken(cwd = process.cwd()) {
21
24
  if (process.env.LUMERA_TOKEN) {
22
25
  return process.env.LUMERA_TOKEN;
23
26
  }
27
+ const runtimeCredsPath = getRuntimeCredsPath();
28
+ if (runtimeCredsPath && existsSync(runtimeCredsPath)) {
29
+ try {
30
+ const creds = JSON.parse(readFileSync(runtimeCredsPath, "utf-8"));
31
+ if (creds.token) return creds.token;
32
+ } catch {
33
+ }
34
+ }
24
35
  const localCredsPath = getLocalCredsPath(cwd);
25
36
  if (existsSync(localCredsPath)) {
26
37
  try {
@@ -44,6 +55,14 @@ function getTokenSource(cwd = process.cwd()) {
44
55
  if (process.env.LUMERA_TOKEN) {
45
56
  return "environment (LUMERA_TOKEN)";
46
57
  }
58
+ const runtimeCredsPath = getRuntimeCredsPath();
59
+ if (runtimeCredsPath && existsSync(runtimeCredsPath)) {
60
+ try {
61
+ const creds = JSON.parse(readFileSync(runtimeCredsPath, "utf-8"));
62
+ if (creds.token) return `runtime (${runtimeCredsPath})`;
63
+ } catch {
64
+ }
65
+ }
47
66
  const localCredsPath = getLocalCredsPath(cwd);
48
67
  if (existsSync(localCredsPath)) {
49
68
  try {
@@ -62,6 +81,14 @@ function getTokenSource(cwd = process.cwd()) {
62
81
  return null;
63
82
  }
64
83
  function getCredentials(cwd = process.cwd()) {
84
+ const runtimeCredsPath = getRuntimeCredsPath();
85
+ if (runtimeCredsPath && existsSync(runtimeCredsPath)) {
86
+ try {
87
+ const creds = JSON.parse(readFileSync(runtimeCredsPath, "utf-8"));
88
+ if (creds.token) return creds;
89
+ } catch {
90
+ }
91
+ }
65
92
  const localCredsPath = getLocalCredsPath(cwd);
66
93
  if (existsSync(localCredsPath)) {
67
94
  try {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  userContextHeaders
3
- } from "./chunk-HTPNRY3F.js";
3
+ } from "./chunk-FHHWIV4C.js";
4
4
  import {
5
5
  fetchWithRetry
6
6
  } from "./chunk-FJFIWC7G.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getBaseUrl
3
- } from "./chunk-ZH3NVYEQ.js";
3
+ } from "./chunk-JLVVHTBY.js";
4
4
  import {
5
5
  fetchWithRetry
6
6
  } from "./chunk-FJFIWC7G.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  deps,
3
3
  syncDeps
4
- } from "./chunk-3ESHIPZH.js";
4
+ } from "./chunk-7ZTCXKII.js";
5
5
  import "./chunk-2CR762KB.js";
6
- import "./chunk-HTPNRY3F.js";
7
- import "./chunk-ZH3NVYEQ.js";
6
+ import "./chunk-FHHWIV4C.js";
7
+ import "./chunk-JLVVHTBY.js";
8
8
  import "./chunk-FJFIWC7G.js";
9
9
  import "./chunk-PNKVD2UK.js";
10
10
  export {
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  dev
3
- } from "./chunk-I7QEYKS7.js";
3
+ } from "./chunk-KBNM6R5X.js";
4
4
  import {
5
5
  syncDeps
6
- } from "./chunk-3ESHIPZH.js";
6
+ } from "./chunk-7ZTCXKII.js";
7
7
  import {
8
8
  loadEnv
9
9
  } from "./chunk-2CR762KB.js";
10
10
  import {
11
11
  createApiClient
12
- } from "./chunk-HTPNRY3F.js";
12
+ } from "./chunk-FHHWIV4C.js";
13
13
  import {
14
14
  findProjectRoot,
15
15
  getApiUrl,
@@ -17,7 +17,7 @@ import {
17
17
  getAppTitle,
18
18
  getToken,
19
19
  init_auth
20
- } from "./chunk-ZH3NVYEQ.js";
20
+ } from "./chunk-JLVVHTBY.js";
21
21
  import "./chunk-FJFIWC7G.js";
22
22
  import "./chunk-PNKVD2UK.js";
23
23
 
@@ -6,7 +6,7 @@ import pc from "picocolors";
6
6
  // src/lib/flags.ts
7
7
  import { readFileSync, statSync } from "fs";
8
8
  var ENV_PATH = "LUMERA_FEATURE_FLAGS_PATH";
9
- var DEFAULT_PATH = "/opt/lumera/feature-flags/flags.json";
9
+ var DEFAULT_PATH = "/lumera_state/feature-flags/flags.json";
10
10
  function flagsPath() {
11
11
  return process.env[ENV_PATH] || DEFAULT_PATH;
12
12
  }
package/dist/index.js CHANGED
@@ -6,17 +6,18 @@ import "./chunk-PNKVD2UK.js";
6
6
 
7
7
  // src/index.ts
8
8
  import { readFileSync as readFileSync2 } from "fs";
9
- import { dirname, join as join2 } from "path";
9
+ import { dirname as dirname2, join as join2 } from "path";
10
10
  import { fileURLToPath } from "url";
11
11
  import pc from "picocolors";
12
12
 
13
13
  // src/lib/update-check.ts
14
14
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
15
15
  import { homedir } from "os";
16
- import { join } from "path";
16
+ import { dirname, join } from "path";
17
17
  var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
18
18
  function getCachePath() {
19
- return join(homedir(), ".lumera", "update-check.json");
19
+ const stateRoot = process.env.LUMERA_STATE_DIR?.trim();
20
+ return stateRoot ? join(stateRoot, "cli", "update-check.json") : join(homedir(), ".lumera", "update-check.json");
20
21
  }
21
22
  function readCache() {
22
23
  const cachePath = getCachePath();
@@ -28,7 +29,7 @@ function readCache() {
28
29
  }
29
30
  }
30
31
  function writeCache(data) {
31
- const dir = join(homedir(), ".lumera");
32
+ const dir = dirname(getCachePath());
32
33
  mkdirSync(dir, { recursive: true });
33
34
  writeFileSync(getCachePath(), JSON.stringify(data));
34
35
  }
@@ -69,7 +70,7 @@ async function checkForUpdate(currentVersion) {
69
70
  }
70
71
 
71
72
  // src/index.ts
72
- var __dirname = dirname(fileURLToPath(import.meta.url));
73
+ var __dirname = dirname2(fileURLToPath(import.meta.url));
73
74
  var pkg = JSON.parse(readFileSync2(join2(__dirname, "..", "package.json"), "utf-8"));
74
75
  var VERSION = pkg.version;
75
76
  var rawArgs = process.argv.slice(2);
@@ -226,70 +227,70 @@ async function main() {
226
227
  switch (command) {
227
228
  // Resource commands
228
229
  case "plan":
229
- await import("./resources-CGMBV3T6.js").then((m) => m.plan(args.slice(1)));
230
+ await import("./resources-A5T7SNOH.js").then((m) => m.plan(args.slice(1)));
230
231
  break;
231
232
  case "apply":
232
- await import("./resources-CGMBV3T6.js").then((m) => m.apply(args.slice(1)));
233
+ await import("./resources-A5T7SNOH.js").then((m) => m.apply(args.slice(1)));
233
234
  break;
234
235
  case "pull":
235
- await import("./resources-CGMBV3T6.js").then((m) => m.pull(args.slice(1)));
236
+ await import("./resources-A5T7SNOH.js").then((m) => m.pull(args.slice(1)));
236
237
  break;
237
238
  case "destroy":
238
- await import("./resources-CGMBV3T6.js").then((m) => m.destroy(args.slice(1)));
239
+ await import("./resources-A5T7SNOH.js").then((m) => m.destroy(args.slice(1)));
239
240
  break;
240
241
  case "list":
241
- await import("./resources-CGMBV3T6.js").then((m) => m.list(args.slice(1)));
242
+ await import("./resources-A5T7SNOH.js").then((m) => m.list(args.slice(1)));
242
243
  break;
243
244
  case "show":
244
- await import("./resources-CGMBV3T6.js").then((m) => m.show(args.slice(1)));
245
+ await import("./resources-A5T7SNOH.js").then((m) => m.show(args.slice(1)));
245
246
  break;
246
247
  case "diff":
247
- await import("./resources-CGMBV3T6.js").then((m) => m.diff(args.slice(1)));
248
+ await import("./resources-A5T7SNOH.js").then((m) => m.diff(args.slice(1)));
248
249
  break;
249
250
  // Development
250
251
  case "dev":
251
- await import("./dev-VWHFYKGC.js").then((m) => m.dev(args.slice(1)));
252
+ await import("./dev-N5CEEMFC.js").then((m) => m.dev(args.slice(1)));
252
253
  break;
253
254
  case "run":
254
- await import("./run-DJXAXDD2.js").then((m) => m.run(args.slice(1)));
255
+ await import("./run-WHVUVIYB.js").then((m) => m.run(args.slice(1)));
255
256
  break;
256
257
  // Project
257
258
  case "init":
258
- await import("./init-RPJHBBWD.js").then((m) => m.init(args.slice(1)));
259
+ await import("./init-B4DXTC7L.js").then((m) => m.init(args.slice(1)));
259
260
  break;
260
261
  case "register":
261
- await import("./register-OOU477QY.js").then((m) => m.register(args.slice(1)));
262
+ await import("./register-HRLBT4FI.js").then((m) => m.register(args.slice(1)));
262
263
  break;
263
264
  case "templates":
264
265
  await import("./templates-LNUOTNLN.js").then((m) => m.templates(subcommand, args.slice(2)));
265
266
  break;
266
267
  case "status":
267
- await import("./status-X7WQYX2L.js").then((m) => m.status(args.slice(1)));
268
+ await import("./status-NPNIY3QP.js").then((m) => m.status(args.slice(1)));
268
269
  break;
269
270
  case "migrate":
270
- await import("./migrate-NCZKP7FM.js").then((m) => m.migrate(args.slice(1)));
271
+ await import("./migrate-NEG3HKH4.js").then((m) => m.migrate(args.slice(1)));
271
272
  break;
272
273
  // Skills
273
274
  case "skills":
274
- await import("./skills-REOKLNEF.js").then((m) => m.skills(subcommand, args.slice(2)));
275
+ await import("./skills-PXZHERAS.js").then((m) => m.skills(subcommand, args.slice(2)));
275
276
  break;
276
277
  // Dependencies
277
278
  case "deps":
278
- await import("./deps-HWO6X5WM.js").then((m) => m.deps(args.slice(1)));
279
+ await import("./deps-IYUORT55.js").then((m) => m.deps(args.slice(1)));
279
280
  break;
280
281
  // Feature flags (read the in-sandbox snapshot)
281
282
  case "flags":
282
- await import("./flags-UZW4D2SO.js").then((m) => m.flags(subcommand, args.slice(2)));
283
+ await import("./flags-3KYOBHVA.js").then((m) => m.flags(subcommand, args.slice(2)));
283
284
  break;
284
285
  // Auth
285
286
  case "login":
286
- await import("./auth-NI7JTMJM.js").then((m) => m.login(args.slice(1)));
287
+ await import("./auth-MJO5DFOF.js").then((m) => m.login(args.slice(1)));
287
288
  break;
288
289
  case "logout":
289
- await import("./auth-NI7JTMJM.js").then((m) => m.logout(args.slice(1)));
290
+ await import("./auth-MJO5DFOF.js").then((m) => m.logout(args.slice(1)));
290
291
  break;
291
292
  case "whoami":
292
- await import("./auth-NI7JTMJM.js").then((m) => m.whoami());
293
+ await import("./auth-MJO5DFOF.js").then((m) => m.whoami());
293
294
  break;
294
295
  // Convenience aliases
295
296
  case "help":
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  installAllSkills,
3
3
  syncClaudeMd
4
- } from "./chunk-HU7RYLUF.js";
4
+ } from "./chunk-VL5GDJKU.js";
5
5
  import {
6
6
  spinner
7
7
  } from "./chunk-BHYDYR75.js";
8
8
  import {
9
9
  createApiClient,
10
10
  validateProjectNameLength
11
- } from "./chunk-HTPNRY3F.js";
11
+ } from "./chunk-FHHWIV4C.js";
12
12
  import {
13
13
  getToken,
14
14
  init_auth,
15
15
  setProjectId
16
- } from "./chunk-ZH3NVYEQ.js";
16
+ } from "./chunk-JLVVHTBY.js";
17
17
  import "./chunk-FJFIWC7G.js";
18
18
  import {
19
19
  listAllTemplates,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  detectProjectVersion,
3
3
  findProjectRoot
4
- } from "./chunk-ZH3NVYEQ.js";
4
+ } from "./chunk-JLVVHTBY.js";
5
5
  import "./chunk-PNKVD2UK.js";
6
6
 
7
7
  // src/commands/migrate.ts
@@ -7,13 +7,13 @@ import {
7
7
  import {
8
8
  createApiClient,
9
9
  validateProjectExternalId
10
- } from "./chunk-HTPNRY3F.js";
10
+ } from "./chunk-FHHWIV4C.js";
11
11
  import {
12
12
  findProjectRoot,
13
13
  getAppName,
14
14
  getProjectId,
15
15
  setProjectId
16
- } from "./chunk-ZH3NVYEQ.js";
16
+ } from "./chunk-JLVVHTBY.js";
17
17
  import "./chunk-FJFIWC7G.js";
18
18
  import "./chunk-PNKVD2UK.js";
19
19
 
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  deploy
3
- } from "./chunk-I7QEYKS7.js";
3
+ } from "./chunk-KBNM6R5X.js";
4
4
  import {
5
5
  syncDeps
6
- } from "./chunk-3ESHIPZH.js";
6
+ } from "./chunk-7ZTCXKII.js";
7
7
  import {
8
8
  loadEnv
9
9
  } from "./chunk-2CR762KB.js";
@@ -11,7 +11,7 @@ import {
11
11
  ApiError,
12
12
  createApiClient,
13
13
  validateCollectionNameLength
14
- } from "./chunk-HTPNRY3F.js";
14
+ } from "./chunk-FHHWIV4C.js";
15
15
  import {
16
16
  findProjectRoot,
17
17
  getApiUrl,
@@ -20,7 +20,7 @@ import {
20
20
  getProjectId,
21
21
  getToken,
22
22
  init_auth
23
- } from "./chunk-ZH3NVYEQ.js";
23
+ } from "./chunk-JLVVHTBY.js";
24
24
  import {
25
25
  fetchWithRetry
26
26
  } from "./chunk-FJFIWC7G.js";
@@ -3,14 +3,14 @@ import {
3
3
  } from "./chunk-2CR762KB.js";
4
4
  import {
5
5
  createApiClient
6
- } from "./chunk-HTPNRY3F.js";
6
+ } from "./chunk-FHHWIV4C.js";
7
7
  import {
8
8
  findProjectRoot,
9
9
  getApiUrl,
10
10
  getAppName,
11
11
  getToken,
12
12
  init_auth
13
- } from "./chunk-ZH3NVYEQ.js";
13
+ } from "./chunk-JLVVHTBY.js";
14
14
  import {
15
15
  fetchWithRetry
16
16
  } from "./chunk-FJFIWC7G.js";
@@ -8,8 +8,8 @@ import {
8
8
  slugToDirName,
9
9
  slugToFilename,
10
10
  syncClaudeMd
11
- } from "./chunk-HU7RYLUF.js";
12
- import "./chunk-ZH3NVYEQ.js";
11
+ } from "./chunk-VL5GDJKU.js";
12
+ import "./chunk-JLVVHTBY.js";
13
13
  import "./chunk-FJFIWC7G.js";
14
14
  import "./chunk-PNKVD2UK.js";
15
15
 
@@ -8,7 +8,7 @@ import {
8
8
  getTokenSource,
9
9
  init_auth,
10
10
  readPackageJson
11
- } from "./chunk-ZH3NVYEQ.js";
11
+ } from "./chunk-JLVVHTBY.js";
12
12
  import {
13
13
  fetchWithRetry
14
14
  } from "./chunk-FJFIWC7G.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumerahq/cli",
3
- "version": "0.24.1",
3
+ "version": "0.24.2",
4
4
  "description": "CLI for building and deploying Lumera apps",
5
5
  "type": "module",
6
6
  "engines": {
@@ -10,4 +10,3 @@ __pycache__
10
10
  uv.lock
11
11
  src/routeTree.gen.ts
12
12
  .tanstack/
13
- .pi/sessions/