lecodes-cli 0.13.1 → 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.
package/dist/index.js CHANGED
@@ -43217,13 +43217,13 @@ This is an intent-capture stage — screens run on inline mock data, before any
43217
43217
  ## Read this first, then meta.json
43218
43218
 
43219
43219
  \`meta.json\` is the app map: every screen (position, description) and the edges between them
43220
- (navigation intent). **Read it before opening any screen file.** It is the human's file — the
43221
- canvas and the developer own positions and descriptions. When you create a screen, add its meta
43222
- entry **without a \`pos\`** and add edges — the board **auto-places it next to its flow neighbours**,
43223
- so you never hand-pick coordinates (you can't see the board, and positions are the human's to own).
43224
- \`lecodes design arrange --new\` optionally writes those auto-placements into meta.json; the developer's
43225
- ⇥ Arrange button re-tidies the whole board. Never reposition or rewrite existing human-authored
43226
- positions or descriptions.
43220
+ (navigation intent). **Read it before opening any screen file.** When you create a screen, add its
43221
+ meta entry **without a \`pos\`** and add edges — the board places it from its structure (its tab
43222
+ lane, its group region, its flow neighbours) and **persists that position itself**; you never
43223
+ hand-pick coordinates (you can't see the board). To tidy after a batch of changes, call the
43224
+ \`arrange_screens\` MCP tool (or \`lecodes design arrange\`) — the layout engine knows tab rails,
43225
+ group regions and flow direction. Never reposition or rewrite existing \`pos\` values or
43226
+ human-authored descriptions — positions the developer dragged are theirs.
43227
43227
 
43228
43228
  \`\`\`json
43229
43229
  {
@@ -43247,11 +43247,15 @@ positions or descriptions.
43247
43247
  - **An edge from a screen to itself** (\`"from": "home", "to": "home@empty"\`) is a *state link*: the
43248
43248
  board draws it as a chip on the activator element (clicking it switches the tile's state), never
43249
43249
  as an arrow. Use it to record "tapping X puts this screen into state Y".
43250
- - **Group each screen** you create by its user-facing area — \`"group": "Onboarding"\` — 2–6 screens
43251
- per group (Onboarding, Checkout, Settings…). Groups render as labeled regions and \`arrange\` lays
43252
- each out as its own sub-flow, so grouping keeps big boards legible. Semantic clustering is your
43253
- job (you're good at it); coordinates are \`arrange\`'s (it can see the board, you can't). Don't
43254
- regroup existing screens unless asked — groups are part of the human's map.
43250
+ - **Group only what the tab bar doesn't already section.** Screens on a tab bar are sectioned by
43251
+ their lanes — never set a \`group\` on a tab root or any screen that mounts the bar (a group that
43252
+ duplicates a lane draws nothing and gets flagged for deletion). Group the screens *outside* the
43253
+ bar by user-facing area — \`"group": "Onboarding"\` — 2–6 screens per group (Onboarding,
43254
+ Recovery, Pickers…; on an app with no tab bar that means every screen). Groups render as labeled
43255
+ regions and \`arrange\` lays each out as its own sub-flow, so grouping keeps big boards legible.
43256
+ Semantic clustering is your job (you're good at it); coordinates are \`arrange\`'s (it can see
43257
+ the board, you can't). Don't regroup existing screens unless asked — groups are part of the
43258
+ human's map.
43255
43259
  - **Tag a screen's \`role\`** in its meta entry — its *kind* (\`list\`, \`detail\`, \`form\`, \`auth\`,
43256
43260
  \`modal\`…). Optional, renders on the board, captures concept the screen source can't;
43257
43261
  \`lecodes design check\` lists screens still untagged (never blocking). *(A screen's **states** are
@@ -43332,6 +43336,8 @@ Most apps have one — declare it ONCE, in source, and never draw edges for it:
43332
43336
  - The canvas discovers all of this from the source (like screen states) and draws the bar as a
43333
43337
  **rail + lane bands** — tab switching needs NO edges, and \`design_state\` serves the discovered
43334
43338
  \`hubs\`. In the live prototype, tapping a tab button jumps the board to that tab's root screen.
43339
+ - The lane bands replace groups for bar screens: don't \`group\` anything that mounts the bar
43340
+ (see the meta.json section) — groups are for the flows *outside* the bar.
43335
43341
  - Style through theme variables: the bar reads \`var(--primaryColor)\`, \`var(--mutedColor)\`,
43336
43342
  \`var(--tabbarBg)\`, \`var(--screenBg)\` (with fallbacks) — one \`theme({ primaryColor: … })\` call
43337
43343
  restyles it app-wide. You may restyle \`shared/tabs.ts\` itself; keep the \`defineTabs({ … })\`
@@ -43497,8 +43503,8 @@ JSON by hand (a message missing its \`pending\` flag is never delivered, and not
43497
43503
  1. \`board_activity\` (if the server is up), then \`design_comments\` for anything open, then read
43498
43504
  \`meta.json\`, the \`shared/\` signatures, and only the screens you need.
43499
43505
  2. Create/edit screen files; register new screens in \`meta.json\` **without \`pos\`** and add edges —
43500
- they auto-place next to their neighbours on the board. (\`lecodes design arrange --new\` commits
43501
- those positions to meta.json if you want them written.)
43506
+ the board places them from their lane/group/flow structure and persists the result. After a
43507
+ larger batch, \`arrange_screens\` (MCP) or \`lecodes design arrange\` re-tidies the whole board.
43502
43508
  3. \`check_screens\` → \`render_screen\` (or \`lecodes design snapshot\`) → verify → fix.
43503
43509
  4. When the developer edits a description, text, or the flow on the canvas — visible in
43504
43510
  \`board_activity\` and in \`meta.json\`/the screen source — treat it as the updated spec.
@@ -43849,11 +43855,12 @@ var DEFAULT_DIR = "design", DEFAULT_PORT = 4477, getContext = (args) => {
43849
43855
  const designServer = await loadDesignServer(ctx);
43850
43856
  const onlyNew = flagBool(args, "new");
43851
43857
  const summary = designServer.arrangeDesign(ctx.designDir, { onlyNew });
43858
+ const score = summary.score ? ` (score ${summary.score.before.toFixed(0)} → ${summary.score.after.toFixed(0)}, lower is better)` : "";
43852
43859
  if (!summary.changed) {
43853
- log(onlyNew ? "No unplaced screens — nothing to arrange." : "Already tidy — the current layout wins, nothing moved.");
43860
+ log(onlyNew ? "No unplaced screens — nothing to arrange." : `Already in its arranged shape — nothing moved${score}.`);
43854
43861
  return;
43855
43862
  }
43856
- log(`${c.green("✓")} ${onlyNew ? "Placed" : "Arranged"} ${summary.moved} screen${summary.moved === 1 ? "" : "s"} in ${ctx.dirName}/meta.json.`);
43863
+ log(`${c.green("✓")} ${onlyNew ? "Placed" : "Arranged"} ${summary.moved} screen${summary.moved === 1 ? "" : "s"} in ${ctx.dirName}/meta.json${score}.`);
43857
43864
  }, share = async (ctx, args) => {
43858
43865
  if (!ctx.manifest) {
43859
43866
  throw new CliError("`lecodes design share` needs a cloned project. Run it inside one, and push the design first (lecodes push).");
@@ -45213,7 +45220,7 @@ var require_main = __commonJS((exports, module) => {
45213
45220
  // package.json
45214
45221
  var package_default = {
45215
45222
  name: "lecodes-cli",
45216
- version: "0.13.1",
45223
+ version: "0.13.2",
45217
45224
  dependencies: {
45218
45225
  "@letary/chisel": "^0.6.0",
45219
45226
  jimp: "^1.6.1"
@@ -45226,8 +45233,8 @@ var package_default = {
45226
45233
  sdk: "workspace:*"
45227
45234
  },
45228
45235
  peerDependencies: {
45229
- "lecodes-design": "^0.5.0",
45230
- "lecodes-renderer": "^0.8.0",
45236
+ "lecodes-design": "^0.6.0",
45237
+ "lecodes-renderer": "^0.8.1",
45231
45238
  "lecodes-3d-editor": "^0.2.0"
45232
45239
  },
45233
45240
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecodes-cli",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "dependencies": {
5
5
  "@letary/chisel": "^0.6.0",
6
6
  "jimp": "^1.6.1"
@@ -13,8 +13,8 @@
13
13
  "sdk": "workspace:*"
14
14
  },
15
15
  "peerDependencies": {
16
- "lecodes-design": "^0.5.0",
17
- "lecodes-renderer": "^0.8.0",
16
+ "lecodes-design": "^0.6.0",
17
+ "lecodes-renderer": "^0.8.1",
18
18
  "lecodes-3d-editor": "^0.2.0"
19
19
  },
20
20
  "bin": {