@wireweave/agent-prompts 0.1.1-beta.0 → 0.1.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/README.md +17 -18
- package/package.json +36 -36
package/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# @wireweave/agent-prompts
|
|
2
2
|
|
|
3
|
-
Canonical grammar prompts
|
|
3
|
+
Canonical grammar-guide prompts that teach an LLM to generate Wireweave DSL.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Exports the Wireweave DSL grammar guide as ready-to-inject prompt strings. Each function returns a single Markdown-flavoured string that you drop verbatim into an LLM system message so the model emits valid `.wf` wireframes — including the multi-page canvas model (multiple top-level `page` declarations, `at(x, y)` positioning, `viewport="WxH"`).
|
|
8
|
+
|
|
9
|
+
It is the single source of truth for the grammar guide; downstream consumers (`agent-harness`, `api-server`, future plugins) import it so they stay in sync with `@wireweave/core`. The package has no runtime dependencies.
|
|
4
10
|
|
|
5
11
|
## Install
|
|
6
12
|
|
|
@@ -8,36 +14,29 @@ Canonical grammar prompts for LLM agents that generate Wireweave DSL. The packag
|
|
|
8
14
|
pnpm add @wireweave/agent-prompts
|
|
9
15
|
```
|
|
10
16
|
|
|
11
|
-
##
|
|
17
|
+
## Usage
|
|
12
18
|
|
|
13
19
|
```ts
|
|
14
20
|
import { buildGrammarPrompt, buildCompactGrammarPrompt } from '@wireweave/agent-prompts'
|
|
15
21
|
|
|
16
|
-
// Full
|
|
22
|
+
// Full guide (~180 lines) — generation phase.
|
|
17
23
|
const system = buildGrammarPrompt()
|
|
18
24
|
|
|
19
|
-
// Compact
|
|
25
|
+
// Compact guide (~60 lines) — analyze / plan phases, fewer tokens.
|
|
20
26
|
const compact = buildCompactGrammarPrompt()
|
|
21
27
|
```
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
## API
|
|
30
|
+
|
|
31
|
+
### `buildGrammarPrompt(): string`
|
|
24
32
|
|
|
25
|
-
|
|
33
|
+
The full grammar guide for the generation phase. Covers syntax structure, the multi-page canvas model, the renderer surface (`render` / `renderCanvas` / `renderPage`), the layout / content / form / nav / data / feedback / overlay / utility component contracts, and how to map common UI concepts to DSL components.
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
- **Multi-page canvas** — multiple top-level `page` declarations, `at(x, y)` positioning, `viewport="WxH"`.
|
|
29
|
-
- Renderer surface from `@wireweave/core`: `render(doc)` / `renderCanvas(doc)` / `renderPage(page)`.
|
|
30
|
-
- Layout / content / form / nav / data / feedback / overlay / utility component contracts.
|
|
31
|
-
- Mapping common UI concepts to DSL components.
|
|
35
|
+
### `buildCompactGrammarPrompt(): string`
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
A condensed grammar guide for the analyze / plan phases, where the full guide is more than needed.
|
|
34
38
|
|
|
35
|
-
|
|
36
|
-
`api-server/src/services/guide.ts`, `api-server/src/agent/prompts.ts`, and
|
|
37
|
-
`agent-harness/wireweave/src/guide.ts`. The agent-harness copy drifted to a
|
|
38
|
-
pre-3.0 single-page-only definition, which silently broke multi-screen
|
|
39
|
-
wireframe generation. Pulling the guide into its own package gives a single
|
|
40
|
-
versioned export every downstream consumer can pin.
|
|
39
|
+
Part of the [Wireweave monorepo](https://github.com/wireweave/wireweave).
|
|
41
40
|
|
|
42
41
|
## License
|
|
43
42
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wireweave/agent-prompts",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Canonical grammar prompts for LLM agents generating Wireweave DSL (multi-page aware)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -22,23 +22,6 @@
|
|
|
22
22
|
"files": [
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build": "tsup",
|
|
27
|
-
"test": "vitest run",
|
|
28
|
-
"test:watch": "vitest",
|
|
29
|
-
"typecheck": "tsc --noEmit",
|
|
30
|
-
"lint": "eslint .",
|
|
31
|
-
"lint:fix": "eslint . --fix",
|
|
32
|
-
"format": "prettier --write .",
|
|
33
|
-
"format:check": "prettier --check .",
|
|
34
|
-
"knip": "knip",
|
|
35
|
-
"publint": "publint",
|
|
36
|
-
"packlint": "packlint check",
|
|
37
|
-
"clean": "rm -rf dist",
|
|
38
|
-
"release": "release-it",
|
|
39
|
-
"release:beta": "release-it --preRelease=beta",
|
|
40
|
-
"prepare": "husky"
|
|
41
|
-
},
|
|
42
25
|
"lint-staged": {
|
|
43
26
|
"*.{ts,js,mjs,cjs}": [
|
|
44
27
|
"eslint --fix",
|
|
@@ -49,23 +32,21 @@
|
|
|
49
32
|
]
|
|
50
33
|
},
|
|
51
34
|
"devDependencies": {
|
|
52
|
-
"@commitlint/cli": "^21.
|
|
53
|
-
"@commitlint/config-conventional": "^21.
|
|
35
|
+
"@commitlint/cli": "^21.2.2",
|
|
36
|
+
"@commitlint/config-conventional": "^21.2.2",
|
|
54
37
|
"@eslint/js": "^10.0.1",
|
|
55
38
|
"@packlint/cli": "^0.0.2",
|
|
56
|
-
"@
|
|
57
|
-
"
|
|
58
|
-
"eslint": "^10.4.0",
|
|
39
|
+
"@types/node": "^22.20.2",
|
|
40
|
+
"eslint": "^10.10.0",
|
|
59
41
|
"husky": "^9.1.7",
|
|
60
|
-
"knip": "^6.
|
|
61
|
-
"lint-staged": "^
|
|
62
|
-
"prettier": "^3.
|
|
63
|
-
"publint": "^0.3.
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"typescript": "^
|
|
67
|
-
"
|
|
68
|
-
"vitest": "^3.1.1"
|
|
42
|
+
"knip": "^6.35.1",
|
|
43
|
+
"lint-staged": "^16.4.0",
|
|
44
|
+
"prettier": "^3.9.6",
|
|
45
|
+
"publint": "^0.3.24",
|
|
46
|
+
"tsup": "^8.5.1",
|
|
47
|
+
"typescript": "^5.9.3",
|
|
48
|
+
"typescript-eslint": "^8.70.0",
|
|
49
|
+
"vitest": "^4.1.11"
|
|
69
50
|
},
|
|
70
51
|
"keywords": [
|
|
71
52
|
"wireframe",
|
|
@@ -79,10 +60,29 @@
|
|
|
79
60
|
"license": "MIT",
|
|
80
61
|
"repository": {
|
|
81
62
|
"type": "git",
|
|
82
|
-
"url": "git+https://github.com/wireweave/
|
|
63
|
+
"url": "git+https://github.com/wireweave/wireweave.git",
|
|
64
|
+
"directory": "packages/agent-prompts"
|
|
83
65
|
},
|
|
84
66
|
"bugs": {
|
|
85
|
-
"url": "https://github.com/wireweave/
|
|
67
|
+
"url": "https://github.com/wireweave/wireweave/issues"
|
|
86
68
|
},
|
|
87
|
-
"homepage": "https://
|
|
88
|
-
|
|
69
|
+
"homepage": "https://docs.wireweave.org",
|
|
70
|
+
"engines": {
|
|
71
|
+
"node": ">=22.13.0"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build": "tsup",
|
|
75
|
+
"test": "vitest run",
|
|
76
|
+
"test:watch": "vitest",
|
|
77
|
+
"typecheck": "tsc --noEmit",
|
|
78
|
+
"lint": "eslint .",
|
|
79
|
+
"lint:fix": "eslint . --fix",
|
|
80
|
+
"format": "prettier --write .",
|
|
81
|
+
"format:check": "prettier --check .",
|
|
82
|
+
"knip": "knip",
|
|
83
|
+
"publint": "publint --strict",
|
|
84
|
+
"packlint": "packlint check",
|
|
85
|
+
"clean": "rm -rf dist",
|
|
86
|
+
"postbuild": "node ../../scripts/dist-freshness-gate.mjs --write ."
|
|
87
|
+
}
|
|
88
|
+
}
|