mapples 0.2.0-beta.4 → 0.2.0-beta.6

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.
Files changed (93) hide show
  1. package/README.md +42 -0
  2. package/dist/api/agent.d.ts +84 -0
  3. package/dist/api/agent.js +92 -0
  4. package/dist/api/agent.js.map +1 -0
  5. package/dist/api/client.d.ts +3 -0
  6. package/dist/api/client.js +2 -0
  7. package/dist/api/client.js.map +1 -1
  8. package/dist/api/commit.js +1 -0
  9. package/dist/api/commit.js.map +1 -1
  10. package/dist/api/objects.d.ts +12 -0
  11. package/dist/api/objects.js +2 -0
  12. package/dist/api/objects.js.map +1 -1
  13. package/dist/api/txPlan.d.ts +15 -0
  14. package/dist/api/txPlan.js +196 -0
  15. package/dist/api/txPlan.js.map +1 -0
  16. package/dist/commands/agent.d.ts +2 -0
  17. package/dist/commands/agent.js +76 -0
  18. package/dist/commands/agent.js.map +1 -0
  19. package/dist/commands/create.js +1 -0
  20. package/dist/commands/create.js.map +1 -1
  21. package/dist/commands/impl/adoptImpl.js +3 -0
  22. package/dist/commands/impl/adoptImpl.js.map +1 -1
  23. package/dist/commands/impl/agentImpl.d.ts +10 -0
  24. package/dist/commands/impl/agentImpl.js +349 -0
  25. package/dist/commands/impl/agentImpl.js.map +1 -0
  26. package/dist/commands/impl/createImpl.js +19 -0
  27. package/dist/commands/impl/createImpl.js.map +1 -1
  28. package/dist/commands/impl/initImpl.js +19 -0
  29. package/dist/commands/impl/initImpl.js.map +1 -1
  30. package/dist/commands/impl/syncImpl.js +9 -3
  31. package/dist/commands/impl/syncImpl.js.map +1 -1
  32. package/dist/commands/init.js +1 -0
  33. package/dist/commands/init.js.map +1 -1
  34. package/dist/index.js +12 -1
  35. package/dist/index.js.map +1 -1
  36. package/dist/merge/applyOps.d.ts +4 -1
  37. package/dist/merge/applyOps.js +42 -30
  38. package/dist/merge/applyOps.js.map +1 -1
  39. package/dist/merge/childrenOrder.d.ts +13 -0
  40. package/dist/merge/childrenOrder.js +51 -0
  41. package/dist/merge/childrenOrder.js.map +1 -0
  42. package/dist/project/agentState.d.ts +24 -0
  43. package/dist/project/agentState.js +42 -0
  44. package/dist/project/agentState.js.map +1 -0
  45. package/dist/project/secret.d.ts +6 -2
  46. package/dist/project/secret.js +11 -5
  47. package/dist/project/secret.js.map +1 -1
  48. package/dist/services/adoptService.js +11 -0
  49. package/dist/services/adoptService.js.map +1 -1
  50. package/dist/services/agentInstall.d.ts +35 -0
  51. package/dist/services/agentInstall.js +180 -0
  52. package/dist/services/agentInstall.js.map +1 -0
  53. package/dist/services/agentLease.d.ts +2 -0
  54. package/dist/services/agentLease.js +32 -0
  55. package/dist/services/agentLease.js.map +1 -0
  56. package/dist/services/clientFactory.d.ts +2 -0
  57. package/dist/services/clientFactory.js +16 -1
  58. package/dist/services/clientFactory.js.map +1 -1
  59. package/dist/services/scaffold.js +4 -0
  60. package/dist/services/scaffold.js.map +1 -1
  61. package/dist/services/syncEngine.js +91 -42
  62. package/dist/services/syncEngine.js.map +1 -1
  63. package/dist/types.d.ts +11 -0
  64. package/dist/types.js.map +1 -1
  65. package/dist/ui/report.d.ts +7 -0
  66. package/dist/ui/report.js +8 -0
  67. package/dist/ui/report.js.map +1 -1
  68. package/package.json +3 -3
  69. package/templates/claude/CLAUDE.md +7 -0
  70. package/templates/claude/mapples.md +118 -0
  71. package/templates/claude/mcp.json +11 -0
  72. package/templates/claude/skills/mapples-conventions/SKILL.md +136 -0
  73. package/templates/claude/skills/mapples-design/SKILL.md +218 -0
  74. package/templates/claude/skills/mapples-design/reference/component-library.md +128 -0
  75. package/templates/claude/skills/mapples-design/reference/design-tokens.md +132 -0
  76. package/templates/claude/skills/mapples-design/reference/layout-contract.md +227 -0
  77. package/templates/claude/skills/mapples-design/reference/lint-checklist.md +51 -0
  78. package/templates/claude/skills/mapples-design/reference/plan.md +95 -0
  79. package/templates/claude/skills/mapples-design/reference/playbooks/empty-states.md +14 -0
  80. package/templates/claude/skills/mapples-design/reference/playbooks/forms-and-auth.md +22 -0
  81. package/templates/claude/skills/mapples-design/reference/playbooks/home-dashboard.md +14 -0
  82. package/templates/claude/skills/mapples-design/reference/playbooks/list-and-detail.md +18 -0
  83. package/templates/claude/skills/mapples-design/reference/playbooks/microcopy.md +20 -0
  84. package/templates/claude/skills/mapples-design/reference/playbooks/navigation-chrome.md +21 -0
  85. package/templates/claude/skills/mapples-design/reference/playbooks/onboarding-flow.md +15 -0
  86. package/templates/claude/skills/mapples-design/reference/playbooks/screen-flow-wiring.md +37 -0
  87. package/templates/claude/skills/mapples-design/reference/playbooks/settings-profile.md +16 -0
  88. package/templates/claude/skills/mapples-design/reference/playbooks/stats-and-progress.md +17 -0
  89. package/templates/claude/skills/mapples-design/reference/playbooks/visual-hierarchy.md +18 -0
  90. package/templates/claude/skills/mapples-design/reference/style-guides.md +92 -0
  91. package/templates/claude/skills/mapples-sync/SKILL.md +92 -0
  92. package/templates/gitignore +2 -0
  93. package/templates/package.json +1 -0
@@ -0,0 +1,21 @@
1
+ <!-- GENERATED by Mapples __CLI_VERSION__ — re-run mapples agent install --force to refresh -->
2
+ # Navigation chrome
3
+
4
+ Headers, tab bars, chips, badges and breadcrumbs: navigator options vs content-sized elements.
5
+
6
+ Two kinds of chrome, two mechanisms — never mix them up:
7
+ - Stack headers and tab bars belong to the NAVIGATOR. In this version they are set in Creator (navigator options: header visible/title/colors/back, tab bar colors/labels; route options: title, tab label, tab icon asset) and land in the CLI-owned `_layout.tsx` on the next sync — you cannot set them from code, and you must not edit the layouts. Describe the intended chrome per section in `design.md` under `## Navigation chrome` (which sections hide the header, tab labels and icon concepts, modal routes) so the user applies it. A hand-built header row on a screen whose stack also shows a header gives two headers: design for one — the default root layout hides headers (`headerShown: false`), so in-content `TopAppBar` is the norm for apps born from `mapples create`.
8
+ - Tab icons require an icon ASSET in Creator; an `Icon` element or a glyph name does nothing there. Note the icon concept per tab in `design.md`; keep tab labels short and distinct — never fake a tab bar from a row of buttons on the page.
9
+ - Everything inside the content area (chips, pills, badges, breadcrumbs, in-content title rows) is a CONTENT-SIZED library element: never width 100% inside a row or a horizontal scroll; never a `Button` where a `Chip` is meant.
10
+
11
+ Recipes:
12
+ - Chip row: `ChipGroup` {options: [{label, value, iconName?}], value, variant "filter", scrollable true} — it scrolls full-bleed itself; single chips are `Chip` {label, variant "assist" | "suggestion"}.
13
+ - Count badge: `IconButton` {iconName, badgeCount, accessibilityLabel} or `Avatar` {badgeCount}; a standalone `Badge` {count} elsewhere. Digits only ("99+" past the max); no badge at zero.
14
+ - Status pill (tags, "New", "Ready"): `Badge` {label, variant "text", tone} or `Chip` {variant "suggestion"}; at most two pills per row — never three lines of pills.
15
+ - Breadcrumbs: `Breadcrumbs` {items: [{label, value}], separator "chevron", maxItems 4}; the last item is the current page. Never as the screen's only title.
16
+ - In-content title row (only when the stack header is hidden): `TopAppBar` {title, showBack true, actions: [{iconName, value}], variant "small"}; the root keeps its safe-area `paddingTop` (≥ 48).
17
+ - In-content tabs inside ONE screen: `Tabs` {items: [{label, value}], value} with each panel shown for one value (bind `$data={{ _visible: … }}` only when the project has the variable; otherwise design the first panel); a `BottomNavigationBar` is only for a single-page demo of a tab shell — real tabs are a tabs navigator (a `(group)/` with a `<Tabs />` layout).
18
+
19
+ Pitfalls: chips built from Pressables; a badge drawn from Views; breadcrumbs typeset as a Headline; a header built twice (TopAppBar + stack header); `Tabs` or `BottomNavigationBar` used instead of a navigator.
20
+
21
+ > Not ported (Creator-only): `set_navigator_options` / `set_route_options` and the `ref(theme:…)` / `ref(icon:…)` value syntax.
@@ -0,0 +1,15 @@
1
+ <!-- GENERATED by Mapples __CLI_VERSION__ — re-run mapples agent install --force to refresh -->
2
+ # Onboarding flow
3
+
4
+ Welcome/intro flows: 2–3 value-prop screens with hero, dots and CTA arc.
5
+
6
+ Value first: each screen sells ONE benefit from the brief — never a feature tour of the whole app. 2–3 screens maximum; every extra screen loses users.
7
+
8
+ Structure per screen (root column, `justifyContent: 'space-between'`, screen padding 20–24, `paddingTop` ≥ 64, `paddingBottom` 32):
9
+ 1. Top bar: a right-aligned `TextLink` {label "Skip", tone "neutral", underline false} on every screen except the last.
10
+ 2. Hero block (`alignItems: 'center'`, gap 16): ONE hero — either a `GradientBackground` circle 96–120 holding an `Icon` glyph 44–56 (`styleSvg.color` a light hex), or an edge-to-edge photo band (`Image` with a picsum `source`, height 260–320, bottom-only corner radius 24). Then a centered Headline (≤ 5 words, the benefit, not the feature) and one Body line (≤ 2 lines, `theme.text.secondary`).
11
+ 3. Bottom block (gap 16, `alignItems: 'center'`): a `PageControl` {count, value, variant "bars"} — then the primary `Button` {variant "filled", size "lg", fullWidth true}.
12
+
13
+ CTA copy arc: "Continue" on middle screens; the LAST screen carries the real ask — "Get started" primary plus a `TextLink` "Sign in" row underneath for returning users.
14
+
15
+ Pitfalls: no emoji heroes; one hero per screen, never hero + photo; dots and button positions must not shift between screens (same bottom block on all three); wire screen→screen and last screen→auth or home in the wiring phase (`$actions` navigate + `router.push`).
@@ -0,0 +1,37 @@
1
+ <!-- GENERATED by Mapples __CLI_VERSION__ — re-run mapples agent install --force to refresh -->
2
+ # Screen flow wiring
3
+
4
+ Wiring flows: every CTA connected, entries set, a walkable prototype.
5
+
6
+ A project becomes a product when every path is walkable. After the screens exist, wire them — this is as much the design as the pixels.
7
+
8
+ How a connection is written (both halves, on the element's primary event):
9
+
10
+ ```tsx
11
+ import { router } from 'expo-router';
12
+ // …
13
+ <Button
14
+ label="Add to order"
15
+ variant="filled"
16
+ size="lg"
17
+ fullWidth
18
+ onPress={() => router.push('/(main)/cart')}
19
+ $actions={{ onPress: { type: 'mapples:navigate', staticData: { pageUuid: '<uuid>' } } }}
20
+ />
21
+ ```
22
+
23
+ `$actions` is the Creator connection (the storyboard arrow); `onPress` is the runtime handler. The `pageUuid` is the `uuid` field of `.mapples/base/pages/<pageId>.json`, where `<pageId>` is the key in `.mapples/pages.json` whose `file` is the target route file. Rows use `ListItem`'s `onPress`, cards `MediaCard`'s / `Card`'s `onPress`.
24
+
25
+ The contract:
26
+ - Every PRIMARY `Button` navigates to a real page: onboarding Continue → next screen, Get started → auth or home, list row / card → its detail, detail CTA → the flow it starts (cart, booking, player). No dead primary buttons, ever.
27
+ - Secondary paths too: Skip → where Continue ultimately lands; Sign in ↔ Create account cross-links; back is implied by the stack — never draw a back button into the tree (the shell provides it).
28
+ - Every screen is REACHABLE: if nothing navigates to a screen in the plan, either wire the entry that was missed or question why the screen exists.
29
+ - Every flow has an EXIT: the last onboarding screen leaves onboarding; a completed form lands somewhere meaningful (a success state or the content it created), not back at the empty form.
30
+ - Entries: the app must open on the value, not on a settings screen. The initial section/route is a navigator option set in Creator — state the intended entry in `design.md` under `## Navigation chrome` (the scaffold's `index.tsx` of the initial section is the natural default).
31
+ - Presentation: multi-screen interruptions and create-flows present as modal ROUTES (a navigator option — describe them in `design.md`); browsing pushes. Confirmations, pickers and quick details stay on the screen as `Dialog` / `BottomSheet` / `ActionSheet` with `visible={false}`, or bound through `$data={{ visible: { key: 'vars.<name>', active: true } }}` when the project has the variable — an overlay nobody can open or close is a dead end.
32
+
33
+ Verify like a user: after wiring, walk the golden path mentally from the entry screen — first open → core value → primary action → done. Name the connection chain; every hop must exist. Then `mapples sync --yes --json` and check that `pushedOps` covers every `$actions` you added (an action on an element without a `$sid` yet lands on the sync after the element is tagged).
34
+
35
+ Pitfalls: wiring only the happy screen and leaving detail pages orphaned; two buttons navigating to the same place with different labels; a tab bar plus in-content navigation to the same sections.
36
+
37
+ > Not ported (Creator-only): `set_initial_route`, `set_entry_page`, `set_route_presentation`, `layout_storyboard`, `add_connection {action: {kind: "setState"}}` variable creation.
@@ -0,0 +1,16 @@
1
+ <!-- GENERATED by Mapples __CLI_VERSION__ — re-run mapples agent install --force to refresh -->
2
+ # Settings and profile
3
+
4
+ Settings and profile screens: grouped cards, icon rows, switches, sign out.
5
+
6
+ Root: vertical `ScrollView`, `contentContainerStyle` {gap: 24, padding: 20, paddingBottom: 40}.
7
+
8
+ Profile header (when the app has accounts): centered column gap 8 — `Avatar` {size "xl", source a picsum "portrait" seed, or name for initials}, name Subtitle, email/handle Caption in `theme.text.secondary`. A `TextLink` "Edit profile" or `Button` {variant "outlined", size "sm"} under it.
9
+
10
+ Groups: one `List` {variant "inset", header "PREFERENCES" | "ACCOUNT" | "ABOUT"} per group — the List draws the surface and the dividers (no gaps between rows — the list is the unit).
11
+
12
+ Row anatomy: `ListItem` {leadingIconName, title, subtitle only for rows that need explanation, trailing "switch" for toggles, trailing "chevron" for navigation rows, trailing "text" + trailingText ("English") for pickers}. Keep one icon tint system across the groups.
13
+
14
+ The destructive row: "Sign out" / "Delete account" as a `ListItem` {tone "error"} in its own last `List` — never mixed into a normal group.
15
+
16
+ Pitfalls: no more than 5–6 rows per list; switches bind to real variables only when the project has them (`$data`), otherwise leave them unwired rather than faking state; app version as a final centered Caption is a nice close.
@@ -0,0 +1,17 @@
1
+ <!-- GENERATED by Mapples __CLI_VERSION__ — re-run mapples agent install --force to refresh -->
2
+ # Stats and progress
3
+
4
+ Numbers, balances, goals: stat cards, progress bars, streaks — no fake charts.
5
+
6
+ Numbers are the hero — let one big value carry each block.
7
+
8
+ The hero number: a `StatTile` {label "BONUS BALANCE", value "1,240", unit "pts", caption, trend, trendValue, iconName, variant "elevated"} — or, for a brand-coloured hero, a `Card` with a deep brand-hex fill holding an Overline label and a Headline-sized value (fontSize 40–56 via a `styleTypography` override) with its unit in a Subtitle beside it (`flexDirection: 'row'`, `alignItems: 'flex-end'`, gap 8).
9
+ - CONTRAST RULE: on a dark/brand fill, text is white/near-white hexes; on a light card, `theme.text` tokens. Never white text on a light background — if a gradient supplies the dark fill, the SAME node needs a solid dark `backgroundColor` fallback.
10
+
11
+ Progress: `ProgressBar` {value, max, showLabel} for goals and uploads, `ProgressCircle` {value, size 72, showLabel} for rings. Under it one Caption: how far to the goal ("30 to go for a free coffee").
12
+
13
+ Stat rows/grid: 2–3 `StatTile` in a row (`flexDirection: 'row'`, gap 12, each flex 1). Streaks: a row of 7 day-dots (24 circles — filled `theme.primary.main` for done, tinted for not, an `Icon` "checkmark" glyph 12 inside filled ones).
14
+
15
+ Simple comparisons only: horizontal bar rows (Label + track/fill pair per row). Do NOT fake line/pie charts out of Views — if the product truly needs charts, say so instead of drawing a lie.
16
+
17
+ Pitfalls: multiple hero numbers competing on one screen (pick one, demote the rest to the row/grid); percent fills must come from the actual data in the copy; progress color and CTA color should match so the goal reads as reachable.
@@ -0,0 +1,18 @@
1
+ <!-- GENERATED by Mapples __CLI_VERSION__ — re-run mapples agent install --force to refresh -->
2
+ # Visual hierarchy
3
+
4
+ Cross-screen craft: one focal point, the type ladder, grouping, squint-test review.
5
+
6
+ A screen reads in ONE glance-order: focal point → supporting context → actions. Design that order deliberately; never let it emerge by accident.
7
+
8
+ The focal point: exactly one per screen — the Headline, the hero photo, or the big number. Everything else steps down. Two elements fighting for attention (two Headlines, a hero photo AND a huge stat) is the most common failure: pick one, demote the other a full ladder step.
9
+
10
+ The type ladder is strict: Headline (page title / hero claim, once) → Subtitle (section titles) → Body (reading text) → Label (row titles, buttons) → Caption (meta, secondary) → Overline (section eyebrows, uppercase). Never skip sideways — a section title is always Subtitle, a row title always Label, on every screen of the app. Emphasis inside a level comes from color (`theme.text.primary` vs secondary vs tertiary), not from inventing new sizes.
11
+
12
+ Grouping is proximity before boxes: related items sit close (gap 4–8), groups separate wide (24–32). Reach for a card or divider only when spacing alone cannot carry the grouping. Within a group, align to ONE left edge; icon centers align to the text they accompany.
13
+
14
+ Weight discipline: at most two font weights visible per screen region. Color accents (`theme.primary.main`) mark interactive or key items ONLY — an accent on decoration teaches users to ignore it.
15
+
16
+ The squint test (run it on every re-read of a finished file): blur your eyes at the screen as the phone would draw it. You should still see WHERE to look first and WHAT is tappable. If everything blurs into even gray noise, the hierarchy is flat — raise the focal point, quiet the rest. If one block screams that is not the primary action, swap emphasis.
17
+
18
+ Pitfalls: three or more text sizes inside one card; every row shouting in bold; accents on more than ~10 percent of the screen; centered text mixed with left-aligned text in the same block.
@@ -0,0 +1,92 @@
1
+ <!-- GENERATED by Mapples __CLI_VERSION__ — re-run mapples agent install --force to refresh -->
2
+ # Style guides (phase 1)
3
+
4
+ Ported from the Creator's design setup (`service--mapples-ai` `design/generate.ts`): first art
5
+ directions, then one compact style guide per direction. The user picks one; the full token set
6
+ (phase 2) realizes exactly that guide.
7
+
8
+ ## 1. Art directions
9
+
10
+ Act as a creative director choosing art directions for this mobile app's design system.
11
+
12
+ Propose exactly **3** art directions FOR THIS PRODUCT — grounded in its domain, audience and
13
+ mood, never a generic template menu. Make them genuinely different from each other: vary palette
14
+ temperature, typography class (serif / geometric sans / humanist sans / rounded / mono accents),
15
+ shape language (sharp ↔ pill), and density (airy ↔ compact). Each direction: a short evocative
16
+ name (2–40 chars, e.g. "Neon Court") and one tight clause (≤ 25 words) of concrete visual moves:
17
+ palette temperature, typography class, shape language, density.
18
+
19
+ ## 2. Style guide per direction
20
+
21
+ Act as a senior product designer sketching a compact style guide for this mobile app, for ONE
22
+ direction at a time. Make it unmistakably different from the other directions and from a
23
+ default blue Material palette.
24
+
25
+ Rules:
26
+
27
+ - Colors are hex. The preview maps are BOTH light and dark; dark is a real dark design (dark
28
+ surfaces, lighter text), not an inversion. `text` must have ≥ 4.5:1 contrast against
29
+ `background`; `onPrimary` against `primary` likewise.
30
+ - Fonts come ONLY from the bundled library (family + weight). Pick pairings that fit the
31
+ direction; body fonts must be sans or a highly legible serif.
32
+ - `iconFamily` comes ONLY from the icon library. Pick the pack whose stroke weight and shape
33
+ language match the direction (thin strokes for airy directions, solid glyphs for bold ones).
34
+ - `instructions` are the seed for the FULL design system generated later: palette logic,
35
+ typography roles, shape language (including the elevation language — soft shadows vs flat
36
+ borders/contrasting surfaces, with flat a first-class choice — and radius feel), spacing feel,
37
+ component character, one explicit don't. Concrete, 60–100 words, no marketing language.
38
+
39
+ Shape of one guide (write it into `design.md` when chosen):
40
+
41
+ ```md
42
+ ### <Name> — <direction in a few words>
43
+ Rationale: <one sentence why it fits the product>
44
+ Preview light: background #… card #… text #… textMuted #… primary #… onPrimary #… accent #…
45
+ Preview dark: background #… card #… text #… textMuted #… primary #… onPrimary #… accent #…
46
+ Radius: <0–32> · Fonts: headline <Family Weight> / body <Family Weight> / button <Family Weight>
47
+ Icon family: <key>
48
+ Instructions: <60–100 words>
49
+ ```
50
+
51
+ ## Font library
52
+
53
+ `"<Family>-<Weight>"` is the registered React Native family name (`Manrope-SemiBold`). Weights:
54
+ Regular, Medium, SemiBold, Bold unless noted.
55
+
56
+ | Family | Category | Character | Pairs with |
57
+ | --- | --- | --- | --- |
58
+ | Inter | sans | neutral, highly legible UI sans | Playfair Display, Fraunces, IBM Plex Mono |
59
+ | Manrope | sans | modern geometric, friendly tech | Fraunces, Inter, IBM Plex Mono |
60
+ | DM Sans (`DMSans`) | sans | low-contrast geometric, calm product UI | Playfair Display, Fraunces |
61
+ | Plus Jakarta Sans (`PlusJakartaSans`) | sans | rounded geometric, startup/fintech | Inter, Fraunces |
62
+ | Poppins | sans | round geometric, playful consumer apps | Nunito, Inter |
63
+ | Nunito | sans | soft rounded terminals, approachable | Poppins, Outfit |
64
+ | Space Grotesk (`SpaceGrotesk`) | sans | quirky technical grotesk, dev tools | Inter, IBM Plex Mono |
65
+ | Sora | sans | wide geometric display sans, bold headlines | Inter, DM Sans |
66
+ | Outfit | sans | clean geometric display, fashion/lifestyle | DM Sans, Nunito |
67
+ | Playfair Display (`PlayfairDisplay`) | serif — Regular/SemiBold/Bold | high-contrast editorial serif for headlines | Inter, DM Sans |
68
+ | Fraunces | serif — Regular/SemiBold/Bold | soft wonky serif, warm and characterful | Manrope, Inter, DM Sans |
69
+ | IBM Plex Mono (`IBMPlexMono`) | mono — Regular/Medium | monospace for code, data and labels | Inter, Space Grotesk |
70
+
71
+ ## Icon library
72
+
73
+ | Key | Character |
74
+ | --- | --- |
75
+ | ionicons | iOS-flavored rounded glyphs with filled and -outline pairs; safe modern default |
76
+ | material-icons | Google Material: solid, geometric, compact |
77
+ | material-design-icons | community Material superset; huge coverage, filled and outline variants |
78
+ | feather | thin 2px stroke outlines; minimal and airy |
79
+ | lucide | Feather's successor; consistent strokes, wide coverage |
80
+ | ant-design | clean enterprise outlines; restrained and precise |
81
+ | entypo | thick rounded solid glyphs; friendly and bold |
82
+ | octicons | GitHub's set; crisp outlines tuned for small sizes |
83
+ | fontawesome5-solid | Font Awesome 5 solid: heavy filled, classic |
84
+ | fontawesome6-solid | Font Awesome 6 solid: heavy filled, modern |
85
+ | simple-line-icons | ultra-light elegant line icons |
86
+
87
+ The icon family is a project setting in Creator; from code, `Icon iconName="…"` uses the glyph
88
+ names of that family (ionicons names like `home-outline`, `search`, `chevron-forward` when in
89
+ doubt). An unknown name renders as a broken glyph — prefer a common name over a guessed one.
90
+
91
+ > Not ported (Creator-only): the streaming preview cards, the `repairViolations` pass and the
92
+ > four-guide generation count (three here, so the table fits a chat reply).
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: mapples-sync
3
+ description: Running `mapples sync` from an agent — the --yes --json invocation, the JSON report fields, exit codes 0/1/2/3/4, and what to do on conflicts, deprecated files, NON_LITERAL_PROP warnings, read-scoped keys and offline runs. Use before and after every sync in a Mapples-linked app.
4
+ ---
5
+ <!-- GENERATED by Mapples __CLI_VERSION__ — re-run mapples agent install --force to refresh -->
6
+ # mapples sync
7
+
8
+ `mapples sync` is the only way changes reach Creator. Run it from the app root as
9
+
10
+ ```bash
11
+ mapples sync --yes --json
12
+ ```
13
+
14
+ - `--yes` accepts every adoption proposal (new route files, pages, components) without a prompt —
15
+ required, because you have no TTY. Add `--no-adopt` to push edits to managed files only and
16
+ leave new files untouched (e.g. a helper you do not want on the canvas yet).
17
+ - `--json` prints one JSON report and nothing else. Always parse it; never rely on the exit
18
+ code alone.
19
+ - The CLI is on the app's `devDependencies`; use `npx mapples …` (or `yarn mapples …`) when the
20
+ bare command is not on the PATH.
21
+
22
+ ## What one run does
23
+
24
+ 1. Adopts new files (`--yes`): react-native primitives become `@mapples/ui` elements with
25
+ `styled` props; a new file under the routes dir joins the navigator of its directory (a new
26
+ `(group)/` with a generated-header `_layout.tsx` becomes its own navigator).
27
+ 2. Extracts every managed file; elements without `$sid` are tagged and the file is rewritten.
28
+ 3. Pulls Creator's changes since the last sync, 3-way merges per element and prop, writes remote
29
+ changes into your files surgically.
30
+ 4. Pushes your edits as JPATCH transactions (retrying on 409), updates `.mapples/head`,
31
+ `pages.json`, `components.json`, `base/`.
32
+
33
+ ## The report
34
+
35
+ ```json
36
+ {
37
+ "pulledOps": 0, "pushedOps": 42, "head": "b3:…", "offline": false, "exitCode": 0,
38
+ "files": [{ "file": "app/index.tsx", "action": "updated", "detail": "tagged 12 new element(s)" }],
39
+ "conflicts": [{ "file": "app/index.tsx", "sid": "nd_…", "reason": "same-prop", "props": ["text"], "deprecatedTo": "app/_depr_20260916120000_index.tsx.old", "detail": "…" }],
40
+ "warnings": [{ "file": "app/index.tsx", "kind": "NON_LITERAL_PROP", "sid": "nd_…", "prop": "text", "detail": "…" }],
41
+ "dropped": [{ "index": 3, "id": "nd_…", "reason": "…", "op": { "op": "update", "entity": "RenderNode" } }],
42
+ "serverWarnings": ["CHILDREN_REBASED …"],
43
+ "notes": ["navigation: app/(main)/ had no navigator — created tabs navigator “Main” on “Root” (kind read from its _layout.tsx)"]
44
+ }
45
+ ```
46
+
47
+ | Field | Read it as |
48
+ | --- | --- |
49
+ | `files[].action` | `created` / `updated` / `regenerated` (from Creator after a conflict) / `deprecated` (your version moved to `_depr_…`) |
50
+ | `conflicts[]` | both sides changed the same prop or one deleted what the other edited — the file was deprecated and regenerated |
51
+ | `warnings[]` | lossy steps: `NON_LITERAL_PROP` (an expression prop stays code-only), `UNKNOWN_ELEMENT_WITH_SID`, … |
52
+ | `dropped[]` | ops the server skipped (target gone) — the change did not land |
53
+ | `serverWarnings[]` | e.g. `CHILDREN_REBASED`: the server reordered children after a concurrent edit |
54
+ | `offline` | true = nothing reached the server; ops parked in `.mapples/outbox/` and drained next run |
55
+ | `notes[]` | navigator creation, agent-lease heartbeat misses, rebases |
56
+
57
+ ## Exit codes
58
+
59
+ | Code | Meaning | Do |
60
+ | --- | --- | --- |
61
+ | 0 | synced | read `pushedOps`, `files`, `warnings` |
62
+ | 1 | error (bad key, malformed file, server refusal) | read stderr; fix the cause; never retry blindly |
63
+ | 2 | synced **with conflicts** | for every `conflicts[]` entry: diff `deprecatedTo` against the regenerated file, re-apply your intent onto the new file, sync again |
64
+ | 3 | agent lease gone (from `mapples agent …`) | stop working, tell the user Creator disconnected the agent |
65
+ | 4 | project busy (from `mapples agent start`) | another agent session holds the project — ask before `--takeover` |
66
+
67
+ ## After a sync
68
+
69
+ - **Re-read every file the report lists** before editing it again — `$sid`s were added, Creator's
70
+ edits were written in, the marker may have moved.
71
+ - `NON_LITERAL_PROP` on something you meant to be a literal: replace the expression with the
72
+ literal value (`text={title}` → `text="Today"`), sync again.
73
+ - A `deprecated` file with no conflict entry means the CLI had to own that position (a layout
74
+ you wrote without the generated header): let the generated file stand.
75
+ - `pushedOps: 0` after you changed a managed file means the extraction saw nothing: check that
76
+ the elements are Mapples imports with literal props, and that the file has no syntax error
77
+ (the report lists `SYNTAX_ERROR` warnings).
78
+ - `offline: true`: run again once online; do not edit `.mapples/outbox/`.
79
+
80
+ ## Errors you may see
81
+
82
+ - `push rejected: API key is read-scoped …` — the `MAPPLES_SECRET` / `.mapples/secret` key can
83
+ only read. Ask the user for a read & write key (Creator → Project → Settings → API keys) and
84
+ to restart with `MAPPLES_SECRET=<key> claude`; do not edit `.mapples/secret` yourself.
85
+ - `no .mapples/config.json` — you are not in the app root, or the app is not linked; do not run
86
+ `mapples init` on your own — ask.
87
+ - `HEAD_MISMATCH … could not be committed after 5 rebases` — Creator is being edited at the same
88
+ time; wait a moment and sync again.
89
+
90
+ Never delete `.mapples/head`, `.mapples/base/`, `.mapples/pages.json` or `.mapples/components.json`
91
+ to "fix" a sync — that discards the merge base and turns the next run into a cold bootstrap that
92
+ can deprecate every file.
@@ -7,3 +7,5 @@ web-build/
7
7
  .mapples/outbox/
8
8
  # project API secret — never commit
9
9
  .mapples/secret
10
+ # agent-session lease state — local only
11
+ .mapples/agent.json
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@mapples/action": "^1.1.2",
14
+ "@mapples/components": "^1.2.1",
14
15
  "@mapples/form": "^1.2.0",
15
16
  "@mapples/inlang": "^1.2.0",
16
17
  "@mapples/render": "^1.2.0",