@lumerahq/cli 0.20.0-dev.0 → 0.20.0-dev.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.
@@ -43,16 +43,20 @@ async function flags(subcommand, args) {
43
43
  process.exit(1);
44
44
  }
45
45
  const defIdx = args.indexOf("--default");
46
+ if (defIdx !== -1 && args[defIdx + 1] === void 0) {
47
+ console.error(pc.red("--default requires a value"));
48
+ process.exit(1);
49
+ }
46
50
  const fallback = defIdx !== -1 ? args[defIdx + 1] : void 0;
47
51
  const all = featureFlags();
48
52
  if (!(key in all)) {
49
53
  if (fallback !== void 0) {
50
- console.log(fallback);
54
+ emit(fallback);
51
55
  return;
52
56
  }
53
57
  process.exit(1);
54
58
  }
55
- printValue(all[key]);
59
+ emit(all[key]);
56
60
  break;
57
61
  }
58
62
  case void 0:
@@ -81,7 +85,11 @@ async function flags(subcommand, args) {
81
85
  function formatValue(v) {
82
86
  return typeof v === "string" ? v : JSON.stringify(v);
83
87
  }
84
- function printValue(v) {
88
+ function emit(v) {
89
+ if (process.env.LUMERA_JSON === "1") {
90
+ console.log(JSON.stringify(v));
91
+ return;
92
+ }
85
93
  console.log(formatValue(v));
86
94
  }
87
95
  export {
package/dist/index.js CHANGED
@@ -255,7 +255,7 @@ async function main() {
255
255
  break;
256
256
  // Project
257
257
  case "init":
258
- await import("./init-FXG2BFGT.js").then((m) => m.init(args.slice(1)));
258
+ await import("./init-ZFBNNPDX.js").then((m) => m.init(args.slice(1)));
259
259
  break;
260
260
  case "register":
261
261
  await import("./register-OOU477QY.js").then((m) => m.register(args.slice(1)));
@@ -279,7 +279,7 @@ async function main() {
279
279
  break;
280
280
  // Feature flags (read the in-sandbox snapshot)
281
281
  case "flags":
282
- await import("./flags-AVQEXEDT.js").then((m) => m.flags(subcommand, args.slice(2)));
282
+ await import("./flags-UZW4D2SO.js").then((m) => m.flags(subcommand, args.slice(2)));
283
283
  break;
284
284
  // Auth
285
285
  case "login":
@@ -27,7 +27,7 @@ import pc from "picocolors";
27
27
  import prompts from "prompts";
28
28
  import { execSync } from "child_process";
29
29
  import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, rmSync, readlinkSync, symlinkSync } from "fs";
30
- import { dirname, join, resolve } from "path";
30
+ import { join, resolve } from "path";
31
31
  function toTitleCase(str) {
32
32
  return str.split(/[-_]/).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
33
33
  }
@@ -44,83 +44,44 @@ var TEMPLATE_EXCLUDE = /* @__PURE__ */ new Set(["template.json"]);
44
44
  var TEMPLATE_RENAMES = /* @__PURE__ */ new Map([["_gitignore", ".gitignore"]]);
45
45
  var TEMPLATE_RAW_COPY = /* @__PURE__ */ new Set(["pnpm-lock.yaml"]);
46
46
  var STUDIO_PROBLEM_FIRST_FLAG = "studio_problem_first";
47
- var MEMORY_AGENTS_SECTION = `## Project Memory
47
+ var PROBLEM_FIRST_AGENTS_MD = `# {{projectTitle}}
48
48
 
49
- This project may use repo-backed memory in \`memory/\`.
49
+ This file is project-specific durable memory for future Studio agent sessions.
50
+ Keep it concise and update it only with context that is not obvious from the
51
+ file tree alone.
50
52
 
51
- Before substantial work, read \`memory/README.md\` if it exists, then any
52
- relevant memory files.
53
+ ## Purpose
53
54
 
54
- Update memory when the user confirms a durable project decision, workflow
55
- rule, data contract, naming convention, recurring assumption, or correction
56
- that should survive future sessions.
55
+ Describe the business problem this workspace solves and who uses it.
57
56
 
58
- Do not store secrets, credentials, tokens, private keys, or raw sensitive
59
- source files in memory.
57
+ ## Business Workflow
60
58
 
61
- If a memory item affects app behavior, do not rely only on repo memory.
62
- Persist it to the app's runtime source of truth, such as collections or config,
63
- and expose it in the app UI or a clear review/edit path.
59
+ Capture the durable workflow, domain terms, review expectations, and important
60
+ edge cases.
64
61
 
65
- Summarize memory updates in your final response.
66
- `;
67
- var MEMORY_FILES = /* @__PURE__ */ new Map([
68
- ["README.md", `# Project Memory
69
-
70
- Repo-backed memory keeps durable project context available across agent
71
- sessions. Keep it concise and reviewable.
72
-
73
- Use this folder for:
74
- - confirmed project decisions
75
- - durable workflow rules and mappings
76
- - data contracts and source-file assumptions
77
- - runbooks for recurring work
78
- - open questions that should carry forward
62
+ ## Domain Notes
79
63
 
80
- Do not store secrets, credentials, tokens, private keys, or raw sensitive source
81
- files here.
64
+ Record user-specific terminology, assumptions, constraints, and preferences
65
+ that future agents should preserve.
82
66
 
83
- If a memory item affects app behavior, also persist it to the app's runtime
84
- source of truth, such as collections or config, and expose it in the app UI or a
85
- clear review/edit path.
86
- `],
87
- ["project-context.md", `# Project Context
67
+ ## Project Conventions
88
68
 
89
- Summarize what this app does, who uses it, and the recurring workflow it
90
- supports.
91
- `],
92
- ["decisions.md", `# Decisions
69
+ Document non-obvious architecture, naming, validation, or UX conventions that
70
+ should guide future changes.
93
71
 
94
- Record durable decisions that future sessions should preserve.
72
+ ## Validation
95
73
 
96
- | Date | Decision | Reason |
97
- | --- | --- | --- |
98
- `],
99
- ["open-questions.md", `# Open Questions
74
+ List the commands or checks that should pass before changes are considered
75
+ done.
100
76
 
101
- Track unresolved questions that should be answered before durable workflow
102
- behavior is finalized.
103
- `],
104
- ["rules/README.md", `# Rules
77
+ ## Decisions and Follow-ups
105
78
 
106
- Document durable business rules, validation rules, thresholds, and exception
107
- handling expectations.
108
- `],
109
- ["mappings/README.md", `# Mappings
79
+ Record durable decisions and unresolved questions that should carry forward.
110
80
 
111
- Document source-to-target mappings, normalization rules, and user-approved
112
- corrections.
113
- `],
114
- ["data-contracts/README.md", `# Data Contracts
115
-
116
- Document expected source files, required columns, data types, and known source
117
- system assumptions.
118
- `],
119
- ["runbooks/README.md", `# Runbooks
120
-
121
- Document repeatable operating steps for recurring workflows.
122
- `]
123
- ]);
81
+ Do not use this file as a generic Lumera platform manual, tool guide, or code
82
+ index. Do not store secrets, credentials, tokens, private keys, or transient
83
+ chat summaries.
84
+ `;
124
85
  function copyDir(src, dest, replacements, isRoot = true) {
125
86
  if (!existsSync(dest)) {
126
87
  mkdirSync(dest, { recursive: true });
@@ -170,24 +131,9 @@ async function isStudioProblemFirstScaffoldEnabled(targetDir) {
170
131
  return false;
171
132
  }
172
133
  }
173
- function writeFileIfMissing(path, content) {
174
- if (existsSync(path)) return;
175
- mkdirSync(dirname(path), { recursive: true });
176
- writeFileSync(path, content);
177
- }
178
- function applyProblemFirstMemoryScaffold(projectRoot) {
134
+ function applyProblemFirstProjectInstructionsScaffold(projectRoot, replacements) {
179
135
  const agentsMdPath = join(projectRoot, "AGENTS.md");
180
- if (existsSync(agentsMdPath)) {
181
- const agentsMd = readFileSync(agentsMdPath, "utf-8");
182
- if (!agentsMd.includes("## Project Memory")) {
183
- writeFileSync(agentsMdPath, `${agentsMd.trimEnd()}
184
-
185
- ${MEMORY_AGENTS_SECTION}`);
186
- }
187
- }
188
- for (const [relativePath, content] of MEMORY_FILES) {
189
- writeFileIfMissing(join(projectRoot, "memory", relativePath), content);
190
- }
136
+ writeFileSync(agentsMdPath, processTemplate(PROBLEM_FIRST_AGENTS_MD, replacements));
191
137
  }
192
138
  function isGitInstalled() {
193
139
  try {
@@ -484,7 +430,7 @@ async function init(args) {
484
430
  const problemFirstScaffold = await isStudioProblemFirstScaffoldEnabled(targetDir);
485
431
  copyDir(templateDir, targetDir, replacements);
486
432
  if (problemFirstScaffold) {
487
- applyProblemFirstMemoryScaffold(targetDir);
433
+ applyProblemFirstProjectInstructionsScaffold(targetDir, replacements);
488
434
  }
489
435
  ensureClaudeInstructionsLink(targetDir);
490
436
  const installCommand = existsSync(join(targetDir, "pnpm-lock.yaml")) ? "pnpm install --frozen-lockfile" : "pnpm install";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumerahq/cli",
3
- "version": "0.20.0-dev.0",
3
+ "version": "0.20.0-dev.2",
4
4
  "description": "CLI for building and deploying Lumera apps",
5
5
  "type": "module",
6
6
  "engines": {
@@ -24,7 +24,7 @@
24
24
  "check:ci": "biome check . && tsr generate && tsc --noEmit"
25
25
  },
26
26
  "dependencies": {
27
- "@lumerahq/ui": "^0.10.0",
27
+ "@lumerahq/ui": "^0.11.1",
28
28
  "@tanstack/react-query": "^5.90.11",
29
29
  "@tanstack/react-router": "1.155.0",
30
30
  "clsx": "^2.1.1",
@@ -40,7 +40,12 @@ function RouteRestorer() {
40
40
  if (isFirstLoad.current) {
41
41
  isFirstLoad.current = false;
42
42
  const savedRoute = localStorage.getItem(ROUTE_STORAGE_KEY);
43
- if (savedRoute && savedRoute !== '/' && router.state.location.pathname === '/') {
43
+ if (
44
+ !isEmbedded() &&
45
+ savedRoute &&
46
+ savedRoute !== '/' &&
47
+ router.state.location.pathname === '/'
48
+ ) {
44
49
  router.navigate({ to: savedRoute });
45
50
  }
46
51
  }