@wireweave/agent-prompts 0.2.0-beta.4 → 0.2.0-beta.5

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
@@ -88,6 +88,13 @@ Screens in one .wf file share a shell (header, sidebar, footer). Restating it on
88
88
  - use NAME(arg="value") { \u2026 } \u2014 draw a component defined above. Arguments are parenthesized name=value pairs; the optional braces fill the component's slots.
89
89
  - page "Title" uses=NAME { \u2026 } \u2014 draw this page inside layout NAME. The page body holds only what is unique to that screen.
90
90
  - repeat N { \u2026 } \u2014 draw the body N times. N is a bare non-negative integer, NOT quoted and NOT an attribute. Use it instead of pasting the same child N times.
91
+ - page "Title" variants=[loading, empty, ready] { \u2026 } \u2014 draw this page once per named state, as that many separate screens. The names are bare identifiers in brackets. Use this for a screen's loading / empty / populated / error conditions INSTEAD of states= + visibleWhen + a toggle button: a variant needs no switching control, so the wireframe shows no UI the product does not have, and every condition is visible at once instead of one at a time. Each screen is addressed as "id#variant" (quoted, e.g. navigate="orders#empty"); plain navigate=orders reaches the first variant.
92
+
93
+ \`\`\`
94
+ page "Orders" id=orders variants=[loading, empty, ready] {
95
+ main { table [["Order", "Status"], ["1001", "Shipped"]] }
96
+ }
97
+ \`\`\`
91
98
 
92
99
  \`\`\`
93
100
  layout app {
@@ -332,6 +339,7 @@ function buildCompactGrammarPrompt() {
332
339
  - Use viewport="WxH" per page; omit at() to auto-flow, use at(x, y) to pin.
333
340
  - Multi-view apps default to separate top-level pages (not sidebar collapse).
334
341
 
342
+ # VARIANTS: page "T" variants=[loading, empty, ready] { \u2026 } draws that page once per named state as that many separate screens (names are bare identifiers in brackets). Prefer it over states=+visibleWhen+a toggle for a screen's loading/empty/populated/error conditions \u2014 no switching control has to exist in the wireframe, and all conditions are visible at once. Address one as navigate="id#variant"; plain navigate=id reaches the first.
335
343
  # REUSE: layout NAME { \u2026 } defines a shared shell (name is a bare identifier, not a quoted string); slot marks where a referencing page's own content goes inside that shell (bare keyword, no name, no braces); component NAME { \u2026 } defines a reusable fragment; use NAME(arg="value") { \u2026 } draws that fragment, passing parenthesized arguments and optionally filling its slots; page "Title" uses=NAME draws that page inside the layout and states only its own content. layout/component are top-level siblings of page. Two or more pages sharing a shell \u2192 define a layout instead of repeating it.
336
344
  repeat N { \u2026 } draws its body N times \u2014 write repeat 6 { use skeletonCard() } instead of pasting six copies. N is a bare integer. There is NO index variable (repeat 6 as i fails to parse) and every copy is identical, so write items out individually when they differ.
337
345
  # PARAMETERS: component NAME(label: string, to: string) { \u2026 } declares typed parameters (string/number/boolean); inside the body "$label" stands for the passed value. ALWAYS quote the reference \u2014 navigate="$to" and target="$to" work anywhere, including nested effect targets. NEVER write it bare (navigate=$to): an identifier cannot start with $, so the file fails to parse. A reference must be the whole value ("go to $to" is literal text), and every "$name" must match a declared parameter or validation fails.
package/dist/index.js CHANGED
@@ -61,6 +61,13 @@ Screens in one .wf file share a shell (header, sidebar, footer). Restating it on
61
61
  - use NAME(arg="value") { \u2026 } \u2014 draw a component defined above. Arguments are parenthesized name=value pairs; the optional braces fill the component's slots.
62
62
  - page "Title" uses=NAME { \u2026 } \u2014 draw this page inside layout NAME. The page body holds only what is unique to that screen.
63
63
  - repeat N { \u2026 } \u2014 draw the body N times. N is a bare non-negative integer, NOT quoted and NOT an attribute. Use it instead of pasting the same child N times.
64
+ - page "Title" variants=[loading, empty, ready] { \u2026 } \u2014 draw this page once per named state, as that many separate screens. The names are bare identifiers in brackets. Use this for a screen's loading / empty / populated / error conditions INSTEAD of states= + visibleWhen + a toggle button: a variant needs no switching control, so the wireframe shows no UI the product does not have, and every condition is visible at once instead of one at a time. Each screen is addressed as "id#variant" (quoted, e.g. navigate="orders#empty"); plain navigate=orders reaches the first variant.
65
+
66
+ \`\`\`
67
+ page "Orders" id=orders variants=[loading, empty, ready] {
68
+ main { table [["Order", "Status"], ["1001", "Shipped"]] }
69
+ }
70
+ \`\`\`
64
71
 
65
72
  \`\`\`
66
73
  layout app {
@@ -305,6 +312,7 @@ function buildCompactGrammarPrompt() {
305
312
  - Use viewport="WxH" per page; omit at() to auto-flow, use at(x, y) to pin.
306
313
  - Multi-view apps default to separate top-level pages (not sidebar collapse).
307
314
 
315
+ # VARIANTS: page "T" variants=[loading, empty, ready] { \u2026 } draws that page once per named state as that many separate screens (names are bare identifiers in brackets). Prefer it over states=+visibleWhen+a toggle for a screen's loading/empty/populated/error conditions \u2014 no switching control has to exist in the wireframe, and all conditions are visible at once. Address one as navigate="id#variant"; plain navigate=id reaches the first.
308
316
  # REUSE: layout NAME { \u2026 } defines a shared shell (name is a bare identifier, not a quoted string); slot marks where a referencing page's own content goes inside that shell (bare keyword, no name, no braces); component NAME { \u2026 } defines a reusable fragment; use NAME(arg="value") { \u2026 } draws that fragment, passing parenthesized arguments and optionally filling its slots; page "Title" uses=NAME draws that page inside the layout and states only its own content. layout/component are top-level siblings of page. Two or more pages sharing a shell \u2192 define a layout instead of repeating it.
309
317
  repeat N { \u2026 } draws its body N times \u2014 write repeat 6 { use skeletonCard() } instead of pasting six copies. N is a bare integer. There is NO index variable (repeat 6 as i fails to parse) and every copy is identical, so write items out individually when they differ.
310
318
  # PARAMETERS: component NAME(label: string, to: string) { \u2026 } declares typed parameters (string/number/boolean); inside the body "$label" stands for the passed value. ALWAYS quote the reference \u2014 navigate="$to" and target="$to" work anywhere, including nested effect targets. NEVER write it bare (navigate=$to): an identifier cannot start with $, so the file fails to parse. A reference must be the whole value ("go to $to" is literal text), and every "$name" must match a declared parameter or validation fails.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wireweave/agent-prompts",
3
- "version": "0.2.0-beta.4",
3
+ "version": "0.2.0-beta.5",
4
4
  "description": "Canonical grammar prompts for LLM agents generating Wireweave DSL (multi-page aware)",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -52,7 +52,7 @@
52
52
  "typescript": "^5.7.2",
53
53
  "typescript-eslint": "^8.60.0",
54
54
  "vitest": "^3.1.1",
55
- "@wireweave/core": "3.1.0-beta.7"
55
+ "@wireweave/core": "3.1.0-beta.8"
56
56
  },
57
57
  "keywords": [
58
58
  "wireframe",