@wireweave/agent-prompts 0.2.0-beta.0 → 0.2.0-beta.1

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.cjs CHANGED
@@ -78,8 +78,31 @@ Renderer modes (the host picks one; you only need to emit valid pages):
78
78
  - renderCanvas(doc) \u2014 composes all pages into one bounded canvas.
79
79
  - renderPage(page) \u2014 single-page export primitive (1 page = 1 file).
80
80
 
81
+ # SHARED PAGE LAYOUTS
82
+ When several pages share a shell, define it once as a top-level layout and put
83
+ the varying page content at its slot. Layout definitions and pages are siblings;
84
+ a layout is not a screen by itself.
85
+
86
+ - layout NAME { ... slot ... } \u2014 a named page shell. NAME is a bare identifier.
87
+ - slot \u2014 a bare positional marker inside a layout. It takes no name and no braces.
88
+ - page "Title" uses=NAME { ... } \u2014 draw the page inside layout NAME; the page body
89
+ contains only the content unique to that screen.
90
+
91
+ Example:
92
+
93
+ \`\`\`
94
+ layout app {
95
+ header { title "Acme" }
96
+ slot
97
+ footer { text "\xA9 2026 Acme" }
98
+ }
99
+
100
+ page "Home" uses=app { text "Welcome back" }
101
+ page "Docs" uses=app { text "Getting started" }
102
+ \`\`\`
103
+
81
104
  # LAYOUT COMPONENTS
82
- page: Root container. Attrs: title (string arg), at(x, y), viewport, width, height (pixels), device (mobile/tablet/desktop preset), centered (boolean).
105
+ page: Root container. Attrs: title (string arg), uses (layout name), at(x, y), viewport, width, height (pixels), device (mobile/tablet/desktop preset), centered (boolean).
83
106
  header: Top section. Attrs: h (height), p (padding), border (boolean, default true).
84
107
  main: Primary content. Attrs: p, scroll (boolean).
85
108
  footer: Bottom section. Attrs: h, p, border.
@@ -266,7 +289,8 @@ function buildCompactGrammarPrompt() {
266
289
  - Use viewport="WxH" per page; omit at() to auto-flow, use at(x, y) to pin.
267
290
  - Multi-view apps default to separate top-level pages (not sidebar collapse).
268
291
 
269
- # LAYOUT: page(at, viewport, width, height, device, centered), header(h, border), main(p, scroll), footer(h, border), sidebar(w, border, position), section, row(gap, justify, align, wrap), col(gap, flex, span), stack, relative
292
+ # SHARED PAGE LAYOUTS: layout NAME { \u2026 slot \u2026 } defines a top-level shell; slot is a bare marker with no name or braces; page "Title" uses=NAME { \u2026 } places that page inside the shell. Layouts and pages are top-level siblings.
293
+ # LAYOUT: page(at, viewport, width, height, device, centered, uses), header(h, border), main(p, scroll), footer(h, border), sidebar(w, border, position), section, row(gap, justify, align, wrap), col(gap, flex, span), stack, relative
270
294
  # CONTAINERS: card(p, shadow), modal(w, id), drawer(w, position, id), accordion
271
295
  # TEXT: text(size, weight, muted), title(level), link(href)
272
296
  # VISUAL: icon(Lucide name), avatar(size), badge(variant), image, placeholder(h, w)
package/dist/index.js CHANGED
@@ -51,8 +51,31 @@ Renderer modes (the host picks one; you only need to emit valid pages):
51
51
  - renderCanvas(doc) \u2014 composes all pages into one bounded canvas.
52
52
  - renderPage(page) \u2014 single-page export primitive (1 page = 1 file).
53
53
 
54
+ # SHARED PAGE LAYOUTS
55
+ When several pages share a shell, define it once as a top-level layout and put
56
+ the varying page content at its slot. Layout definitions and pages are siblings;
57
+ a layout is not a screen by itself.
58
+
59
+ - layout NAME { ... slot ... } \u2014 a named page shell. NAME is a bare identifier.
60
+ - slot \u2014 a bare positional marker inside a layout. It takes no name and no braces.
61
+ - page "Title" uses=NAME { ... } \u2014 draw the page inside layout NAME; the page body
62
+ contains only the content unique to that screen.
63
+
64
+ Example:
65
+
66
+ \`\`\`
67
+ layout app {
68
+ header { title "Acme" }
69
+ slot
70
+ footer { text "\xA9 2026 Acme" }
71
+ }
72
+
73
+ page "Home" uses=app { text "Welcome back" }
74
+ page "Docs" uses=app { text "Getting started" }
75
+ \`\`\`
76
+
54
77
  # LAYOUT COMPONENTS
55
- page: Root container. Attrs: title (string arg), at(x, y), viewport, width, height (pixels), device (mobile/tablet/desktop preset), centered (boolean).
78
+ page: Root container. Attrs: title (string arg), uses (layout name), at(x, y), viewport, width, height (pixels), device (mobile/tablet/desktop preset), centered (boolean).
56
79
  header: Top section. Attrs: h (height), p (padding), border (boolean, default true).
57
80
  main: Primary content. Attrs: p, scroll (boolean).
58
81
  footer: Bottom section. Attrs: h, p, border.
@@ -239,7 +262,8 @@ function buildCompactGrammarPrompt() {
239
262
  - Use viewport="WxH" per page; omit at() to auto-flow, use at(x, y) to pin.
240
263
  - Multi-view apps default to separate top-level pages (not sidebar collapse).
241
264
 
242
- # LAYOUT: page(at, viewport, width, height, device, centered), header(h, border), main(p, scroll), footer(h, border), sidebar(w, border, position), section, row(gap, justify, align, wrap), col(gap, flex, span), stack, relative
265
+ # SHARED PAGE LAYOUTS: layout NAME { \u2026 slot \u2026 } defines a top-level shell; slot is a bare marker with no name or braces; page "Title" uses=NAME { \u2026 } places that page inside the shell. Layouts and pages are top-level siblings.
266
+ # LAYOUT: page(at, viewport, width, height, device, centered, uses), header(h, border), main(p, scroll), footer(h, border), sidebar(w, border, position), section, row(gap, justify, align, wrap), col(gap, flex, span), stack, relative
243
267
  # CONTAINERS: card(p, shadow), modal(w, id), drawer(w, position, id), accordion
244
268
  # TEXT: text(size, weight, muted), title(level), link(href)
245
269
  # VISUAL: icon(Lucide name), avatar(size), badge(variant), image, placeholder(h, w)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wireweave/agent-prompts",
3
- "version": "0.2.0-beta.0",
3
+ "version": "0.2.0-beta.1",
4
4
  "description": "Canonical grammar prompts for LLM agents generating Wireweave DSL (multi-page aware)",
5
5
  "type": "module",
6
6
  "sideEffects": false,