figura-cli 0.20.0 → 0.22.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "figura-cli",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "Command-line client for the Figura visualization SaaS",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -28,16 +28,22 @@
28
28
  "node": ">=20"
29
29
  },
30
30
  "scripts": {
31
- "build": "bun run scripts/bundle-skill.mjs && bun build src/index.ts --target=node --minify --outfile=dist/index.js && bun build ../mcp/src/index.ts --target=node --minify --outfile=dist/mcp.js",
31
+ "build": "bun run scripts/bundle-skill.mjs && bun build src/index.ts --target=node --minify --external ws --outfile=dist/index.js && bun build ../mcp/src/index.ts --target=node --minify --outfile=dist/mcp.js",
32
32
  "dev": "bun run src/index.ts",
33
33
  "prepublishOnly": "bun run build"
34
34
  },
35
+ "dependencies": {
36
+ "ws": "^8.18.0"
37
+ },
35
38
  "devDependencies": {
36
39
  "@panofm/figura-core": "workspace:*",
37
40
  "@types/node": "^20.14.0",
41
+ "@types/ws": "^8.5.12",
38
42
  "axios": "^1.7.9",
43
+ "nostr-tools": "^2.10.4",
39
44
  "package-manager-detector": "^1.8.0",
40
45
  "postgres": "^3.4.9",
41
- "typescript": "^5.5.0"
46
+ "typescript": "^5.5.0",
47
+ "zod": "^3.25.76"
42
48
  }
43
49
  }
@@ -101,6 +101,9 @@ so you hand it the studied structure in the brief (see step 3, "Server render").
101
101
  wrong tenant). Tell the user to run `figura link` in this repo, then
102
102
  re-verify. If the response has no `binding` field (older CLI/MCP), confirm
103
103
  the team slug matches this project with the user before proceeding.
104
+ - **Update notice?** If the whoami response carries a `notice` field, relay it
105
+ to the user verbatim (a one-line "figura-mcp is behind / below min — run …"),
106
+ then proceed. It's a passive nudge, shown once per session — never a blocker.
104
107
 
105
108
  2. **Default — build it yourself, with YOUR Claude.** Fetch the **canonical
106
109
  authoring scaffold** — **`figura_fig_scaffold`** (CLI:
@@ -231,14 +234,10 @@ truncation, and doesn't need a library):
231
234
  status chip and ONE condensed context line (`+ / –`). This view is for
232
235
  scanning and picking a direction, not for reading detail. The grid must
233
236
  wrap to one column before it can overflow — **a fig never scrolls
234
- horizontally**, at any viewport. To shrink the framed phones, set the kit's
235
- **`--fig-scale`** custom property (e.g. `style="--fig-scale:.42"` on each
236
- `.fig-device`, or on the grid container it inherits) — Figura shrinks the
237
- whole framed phone and reserves the scaled layout box so the minis tile
238
- without overlapping. **Do NOT** write your own rule on `.fig-device`
239
- (a `width`/`height` or `transform: scale()`): `--fig-scale` is the one
240
- sanctioned scaling knob, and hand-sizing the frame fights the injected
241
- geometry.
237
+ horizontally**, at any viewport. To shrink the framed phones, wrap each in the
238
+ kit's **`.fig-mini`** wrapper (see "Scaling a framed device" below), never a
239
+ rule on `.fig-device` and never CSS `zoom` (zoom leaks an unzoomed
240
+ `scrollWidth` into horizontal overflow the exact thing this view forbids).
242
241
  - **Focus — full frame.** One state at a time behind state pills (Today / A /
243
242
  B / …), each state framed identically so flipping states in place reads as
244
243
  spot-the-difference. This is where the context lives, pinned on the frame
@@ -344,9 +343,28 @@ omit the whole-fig `<meta name="figura:artboard">`, the `.fig-device` /
344
343
  `data-device` frame markup (Figura stamps the bezel, Dynamic Island, and
345
344
  safe-area insets **before** your `<style>`, so you normally leave those classes
346
345
  alone — if you do style one, your rule wins by cascade and the frame still
347
- works; to shrink a frame use the `--fig-scale` custom property, never a
348
- hand-written `.fig-device` width/height/transform), the `figura:context` /
349
- `figura:feature` metas, and the valid devices all live in the canonical scaffold.
346
+ works; to shrink a frame use the `.fig-mini` wrapper, never a hand-written
347
+ `.fig-device` width/height/transform), the `figura:context` / `figura:feature`
348
+ metas, and the valid devices all live in the canonical scaffold.
349
+
350
+ **Scaling a framed device — use `.fig-mini`, never a rule on `.fig-device`.**
351
+ An overview grid needs shrunken frames, and the obvious way to write that is a
352
+ CSS rule on the injected class. Don't: your rule wins over the kit, so the frame
353
+ stops matching real device geometry — and `zoom` is worse, it leaks the unzoomed
354
+ width into scrollable overflow. The kit ships the wrapper instead:
355
+
356
+ ```html
357
+ <div class="fig-mini" style="--fig-scale:.34">
358
+ <div class="fig-device portrait" data-device="iphone-16">
359
+ <div class="fig-screen">…</div><div class="fig-di"></div><div class="fig-homebar"></div>
360
+ </div>
361
+ </div>
362
+ ```
363
+
364
+ `.fig-mini` scales its device with `transform` and takes the **scaled** layout
365
+ box, so a row of minis lays out at its visual size instead of reserving
366
+ full-size phones. Add `landscape` to the device (or the wrapper) and the box
367
+ flips with it. `--fig-scale` defaults to `.34`; set it per element.
350
368
 
351
369
  - **`figura_fig_scaffold`** (CLI: `figura fig scaffold`) is authoritative for the
352
370
  presentation model, the frame markup, and the output contract. Fetch it and