contractspec 0.0.0-canary-20251226144930 → 0.0.0-canary-20260113170453
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/CHANGELOG.md +216 -9
- package/QUICK_START.md +21 -21
- package/README.md +10 -5
- package/bin/contractspec.mjs +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,219 @@
|
|
|
1
1
|
# contractspec
|
|
2
2
|
|
|
3
|
-
## 0.0.0-canary-
|
|
3
|
+
## 0.0.0-canary-20260113170453
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- caf8701: feat: add cli vibe command to run workflow
|
|
8
|
+
- c69b849: feat: add api web services (mcp & website)
|
|
9
|
+
- 42b8d78: feat: add cli `contractspec vibe` workflow to simplify usage
|
|
10
|
+
- fd38e85: feat: auto-fix contractspec issues
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- e7ded36: feat: improve stability (adding ts-morph)
|
|
15
|
+
- c231a8b: test: improve workspace stability
|
|
16
|
+
- Updated dependencies [e7ded36]
|
|
17
|
+
- Updated dependencies [caf8701]
|
|
18
|
+
- Updated dependencies [c69b849]
|
|
19
|
+
- Updated dependencies [c231a8b]
|
|
20
|
+
- Updated dependencies [42b8d78]
|
|
21
|
+
- Updated dependencies [fd38e85]
|
|
22
|
+
- @contractspec/app.cli-contractspec@0.0.0-canary-20260113170453
|
|
23
|
+
|
|
24
|
+
## 1.46.2
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 7e21625: feat: library services (landing page & api)
|
|
29
|
+
- Updated dependencies [7e21625]
|
|
30
|
+
- @contractspec/app.cli-contractspec@1.46.2
|
|
31
|
+
|
|
32
|
+
## 1.46.1
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- 2d8a72b: fix: mcp for presentation
|
|
37
|
+
- Updated dependencies [2d8a72b]
|
|
38
|
+
- @contractspec/app.cli-contractspec@1.46.1
|
|
39
|
+
|
|
40
|
+
## 1.46.0
|
|
41
|
+
|
|
42
|
+
### Minor Changes
|
|
43
|
+
|
|
44
|
+
- 07cb19b: feat: feat: cleaude code & opencode integrations
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- Updated dependencies [07cb19b]
|
|
49
|
+
- @contractspec/app.cli-contractspec@1.46.0
|
|
50
|
+
|
|
51
|
+
## 1.45.6
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- a913074: feat: improve ai agents rules management"
|
|
56
|
+
- Updated dependencies [a913074]
|
|
57
|
+
- @contractspec/app.cli-contractspec@1.45.6
|
|
58
|
+
|
|
59
|
+
## 1.45.5
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- 9ddd7fa: feat: improve versioning
|
|
64
|
+
- Updated dependencies [9ddd7fa]
|
|
65
|
+
- @contractspec/app.cli-contractspec@1.45.5
|
|
66
|
+
|
|
67
|
+
## 1.45.4
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- fix: github action
|
|
72
|
+
- Updated dependencies
|
|
73
|
+
- @contractspec/app.cli-contractspec@1.45.4
|
|
74
|
+
|
|
75
|
+
## 1.45.3
|
|
76
|
+
|
|
77
|
+
### Patch Changes
|
|
78
|
+
|
|
79
|
+
- e74ea9e: feat: version management
|
|
80
|
+
- Updated dependencies [e74ea9e]
|
|
81
|
+
- @contractspec/app.cli-contractspec@1.45.3
|
|
82
|
+
|
|
83
|
+
## 1.45.2
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- 39ca241: code cleaning
|
|
88
|
+
- Updated dependencies [39ca241]
|
|
89
|
+
- @contractspec/app.cli-contractspec@1.45.2
|
|
90
|
+
|
|
91
|
+
## 1.45.1
|
|
92
|
+
|
|
93
|
+
### Patch Changes
|
|
94
|
+
|
|
95
|
+
- feat: improve app config and examples contracts
|
|
96
|
+
- Updated dependencies
|
|
97
|
+
- @contractspec/app.cli-contractspec@1.45.1
|
|
98
|
+
|
|
99
|
+
## 1.45.0
|
|
100
|
+
|
|
101
|
+
### Minor Changes
|
|
102
|
+
|
|
103
|
+
- e73ca1d: feat: improve app config and examples contracts
|
|
104
|
+
feat: Contract layers support (features, examples, app-configs)
|
|
105
|
+
|
|
106
|
+
### New CLI Commands
|
|
107
|
+
- `contractspec list layers` - List all contract layers with filtering
|
|
108
|
+
|
|
109
|
+
### Enhanced Commands
|
|
110
|
+
- `contractspec ci` - New `layers` check category validates features/examples/config
|
|
111
|
+
- `contractspec doctor` - New `layers` health checks
|
|
112
|
+
- `contractspec integrity` - Now shows layer statistics
|
|
113
|
+
|
|
114
|
+
### New APIs
|
|
115
|
+
- `discoverLayers()` - Scan workspace for all layer files
|
|
116
|
+
- `scanExampleSource()` - Parse ExampleSpec from source code
|
|
117
|
+
- `isExampleFile()` - Check if file is an example spec
|
|
118
|
+
|
|
119
|
+
### Patch Changes
|
|
120
|
+
|
|
121
|
+
- Updated dependencies [e73ca1d]
|
|
122
|
+
- @contractspec/app.cli-contractspec@1.45.0
|
|
123
|
+
|
|
124
|
+
## 1.44.1
|
|
125
|
+
|
|
126
|
+
### Patch Changes
|
|
127
|
+
|
|
128
|
+
- 3c594fb: fix
|
|
129
|
+
- Updated dependencies [3c594fb]
|
|
130
|
+
- @contractspec/app.cli-contractspec@1.44.1
|
|
131
|
+
|
|
132
|
+
## 1.44.0
|
|
133
|
+
|
|
134
|
+
### Minor Changes
|
|
135
|
+
|
|
136
|
+
- 5f3a868: chore: isolate branding to contractspec.io
|
|
137
|
+
|
|
138
|
+
### Patch Changes
|
|
139
|
+
|
|
140
|
+
- Updated dependencies [5f3a868]
|
|
141
|
+
- @contractspec/app.cli-contractspec@1.44.0
|
|
142
|
+
|
|
143
|
+
## 1.43.4
|
|
144
|
+
|
|
145
|
+
### Patch Changes
|
|
146
|
+
|
|
147
|
+
- 9216062: fix: cross-platform compatibility
|
|
148
|
+
- Updated dependencies [9216062]
|
|
149
|
+
- @contractspec/app.cli-contractspec@1.43.4
|
|
150
|
+
|
|
151
|
+
## 1.43.3
|
|
152
|
+
|
|
153
|
+
### Patch Changes
|
|
154
|
+
|
|
155
|
+
- 24d9759: improve documentation
|
|
156
|
+
- Updated dependencies [24d9759]
|
|
157
|
+
- @contractspec/app.cli-contractspec@1.43.3
|
|
158
|
+
|
|
159
|
+
## 1.43.2
|
|
160
|
+
|
|
161
|
+
### Patch Changes
|
|
162
|
+
|
|
163
|
+
- e147271: fix: improve stability
|
|
164
|
+
- Updated dependencies [e147271]
|
|
165
|
+
- @contractspec/app.cli-contractspec@1.43.2
|
|
166
|
+
|
|
167
|
+
## 1.43.1
|
|
168
|
+
|
|
169
|
+
### Patch Changes
|
|
170
|
+
|
|
171
|
+
- f28fdad: fix
|
|
172
|
+
- Updated dependencies [f28fdad]
|
|
173
|
+
- @contractspec/app.cli-contractspec@1.43.1
|
|
174
|
+
|
|
175
|
+
## 1.43.0
|
|
176
|
+
|
|
177
|
+
### Minor Changes
|
|
178
|
+
|
|
179
|
+
- 042d072: feat: schema declaration using json schema, including zod
|
|
180
|
+
|
|
181
|
+
### Patch Changes
|
|
182
|
+
|
|
183
|
+
- Updated dependencies [042d072]
|
|
184
|
+
- @contractspec/app.cli-contractspec@1.43.0
|
|
185
|
+
|
|
186
|
+
## 1.42.10
|
|
187
|
+
|
|
188
|
+
### Patch Changes
|
|
189
|
+
|
|
190
|
+
- 1e6a0f1: fix: mcp server
|
|
191
|
+
- Updated dependencies [1e6a0f1]
|
|
192
|
+
- @contractspec/app.cli-contractspec@1.42.10
|
|
193
|
+
|
|
194
|
+
## 1.42.9
|
|
195
|
+
|
|
196
|
+
### Patch Changes
|
|
197
|
+
|
|
198
|
+
- 9281db7: fix ModelRegistry
|
|
199
|
+
- Updated dependencies [9281db7]
|
|
200
|
+
- @contractspec/app.cli-contractspec@1.42.9
|
|
201
|
+
|
|
202
|
+
## 1.42.8
|
|
203
|
+
|
|
204
|
+
### Patch Changes
|
|
205
|
+
|
|
206
|
+
- e07b5ac: fix
|
|
207
|
+
- Updated dependencies [e07b5ac]
|
|
208
|
+
- @contractspec/app.cli-contractspec@1.42.8
|
|
209
|
+
|
|
210
|
+
## 1.42.7
|
|
4
211
|
|
|
5
212
|
### Patch Changes
|
|
6
213
|
|
|
7
214
|
- e9b575d: fix release
|
|
8
215
|
- Updated dependencies [e9b575d]
|
|
9
|
-
- @
|
|
216
|
+
- @contractspec/app.cli-contractspec@1.42.7
|
|
10
217
|
|
|
11
218
|
## 1.42.6
|
|
12
219
|
|
|
@@ -14,7 +221,7 @@
|
|
|
14
221
|
|
|
15
222
|
- 1500242: fix tooling
|
|
16
223
|
- Updated dependencies [1500242]
|
|
17
|
-
- @
|
|
224
|
+
- @contractspec/app.cli-contractspec@1.42.6
|
|
18
225
|
|
|
19
226
|
## 1.42.5
|
|
20
227
|
|
|
@@ -22,7 +229,7 @@
|
|
|
22
229
|
|
|
23
230
|
- 1299719: fix vscode
|
|
24
231
|
- Updated dependencies [1299719]
|
|
25
|
-
- @
|
|
232
|
+
- @contractspec/app.cli-contractspec@1.42.5
|
|
26
233
|
|
|
27
234
|
## 1.42.4
|
|
28
235
|
|
|
@@ -30,7 +237,7 @@
|
|
|
30
237
|
|
|
31
238
|
- ac28b99: fix: generate from openapi
|
|
32
239
|
- Updated dependencies [ac28b99]
|
|
33
|
-
- @
|
|
240
|
+
- @contractspec/app.cli-contractspec@1.42.4
|
|
34
241
|
|
|
35
242
|
## 1.42.3
|
|
36
243
|
|
|
@@ -38,7 +245,7 @@
|
|
|
38
245
|
|
|
39
246
|
- 3f5d015: fix(tooling): cicd
|
|
40
247
|
- Updated dependencies [3f5d015]
|
|
41
|
-
- @
|
|
248
|
+
- @contractspec/app.cli-contractspec@1.42.3
|
|
42
249
|
|
|
43
250
|
## 1.42.2
|
|
44
251
|
|
|
@@ -46,7 +253,7 @@
|
|
|
46
253
|
|
|
47
254
|
- 1f9ac4c: fix
|
|
48
255
|
- Updated dependencies [1f9ac4c]
|
|
49
|
-
- @
|
|
256
|
+
- @contractspec/app.cli-contractspec@1.42.2
|
|
50
257
|
|
|
51
258
|
## 1.42.1
|
|
52
259
|
|
|
@@ -54,7 +261,7 @@
|
|
|
54
261
|
|
|
55
262
|
- f043995: Fix release
|
|
56
263
|
- Updated dependencies [f043995]
|
|
57
|
-
- @
|
|
264
|
+
- @contractspec/app.cli-contractspec@1.42.1
|
|
58
265
|
|
|
59
266
|
## 1.42.0
|
|
60
267
|
|
|
@@ -65,4 +272,4 @@
|
|
|
65
272
|
### Patch Changes
|
|
66
273
|
|
|
67
274
|
- Updated dependencies [8eefd9c]
|
|
68
|
-
- @
|
|
275
|
+
- @contractspec/app.cli-contractspec@1.42.0
|
package/QUICK_START.md
CHANGED
|
@@ -6,8 +6,8 @@ Get started with contracts-cli in 5 minutes.
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
cd packages/lssm/tools/contracts-cli
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
bun install
|
|
10
|
+
bun build
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## First Spec
|
|
@@ -15,7 +15,7 @@ pnpm build
|
|
|
15
15
|
### 1. Create a spec interactively
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
|
|
18
|
+
contractspec create
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Follow the prompts:
|
|
@@ -32,7 +32,7 @@ This creates: `src/interactions/commands/user-signup.contracts.ts`
|
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
34
|
export ANTHROPIC_API_KEY=your-key-here
|
|
35
|
-
|
|
35
|
+
bun exec contractspec create --ai
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
Describe what you want:
|
|
@@ -43,7 +43,7 @@ Review and accept the AI-generated spec!
|
|
|
43
43
|
### 3. Generate handler
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
|
|
46
|
+
bun exec contractspec build src/interactions/commands/user-signup.contracts.ts
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
This generates:
|
|
@@ -53,7 +53,7 @@ This generates:
|
|
|
53
53
|
### 4. Validate
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
|
|
56
|
+
bun exec contractspec validate src/interactions/commands/user-signup.contracts.ts
|
|
57
57
|
# You'll be prompted to validate the spec only or the implementation as well.
|
|
58
58
|
```
|
|
59
59
|
|
|
@@ -75,7 +75,7 @@ ollama pull codellama
|
|
|
75
75
|
### Generate with Ollama
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
|
-
|
|
78
|
+
bun exec contractspec create --ai --provider ollama --model codellama
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
No API keys needed! Everything runs locally.
|
|
@@ -100,18 +100,18 @@ Now commands use these defaults:
|
|
|
100
100
|
|
|
101
101
|
```bash
|
|
102
102
|
# Uses Claude from config
|
|
103
|
-
|
|
103
|
+
bun exec contractspec create --ai
|
|
104
104
|
|
|
105
105
|
# Override with Ollama
|
|
106
|
-
|
|
106
|
+
bun exec contractspec create --ai --provider ollama
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
## Next Steps
|
|
110
110
|
|
|
111
111
|
1. **Complete the TODO items** in generated files
|
|
112
112
|
2. **Implement handler logic** with real business rules
|
|
113
|
-
3. **Run tests**: `
|
|
114
|
-
4. **Validate**: `
|
|
113
|
+
3. **Run tests**: `bun test`
|
|
114
|
+
4. **Validate**: `bun exec contractspec validate src/**/*.contracts.ts`
|
|
115
115
|
5. **Register in registry** and mount REST/GraphQL adapters
|
|
116
116
|
|
|
117
117
|
## Common Workflows
|
|
@@ -119,27 +119,27 @@ pnpm exec contractspec create --ai --provider ollama
|
|
|
119
119
|
### Create Event
|
|
120
120
|
|
|
121
121
|
```bash
|
|
122
|
-
|
|
122
|
+
bun exec contractspec create --type event
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
### Build Presentation Component
|
|
126
126
|
|
|
127
127
|
```bash
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
bun exec contractspec create --type presentation
|
|
129
|
+
bun exec contractspec build src/presentations/user-profile.presentation.ts
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
### Multi-Spec Workflow
|
|
133
133
|
|
|
134
134
|
```bash
|
|
135
135
|
# Create operation spec
|
|
136
|
-
|
|
136
|
+
bun exec contractspec create --type operation --ai
|
|
137
137
|
|
|
138
138
|
# Create related event spec
|
|
139
|
-
|
|
139
|
+
bun exec contractspec create --type event --ai
|
|
140
140
|
|
|
141
141
|
# Generate all implementations
|
|
142
|
-
|
|
142
|
+
bun exec contractspec build src/contracts/**/*.ts
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
## Tips
|
|
@@ -155,19 +155,19 @@ pnpm exec contractspec build src/contracts/**/*.ts
|
|
|
155
155
|
**No AI provider?**
|
|
156
156
|
```bash
|
|
157
157
|
# Use interactive wizard instead
|
|
158
|
-
|
|
158
|
+
bun exec contractspec create
|
|
159
159
|
```
|
|
160
160
|
|
|
161
161
|
**Can't find contractspec?**
|
|
162
162
|
```bash
|
|
163
|
-
# Use
|
|
164
|
-
|
|
163
|
+
# Use bun exec
|
|
164
|
+
bun exec contractspec --help
|
|
165
165
|
```
|
|
166
166
|
|
|
167
167
|
**Import errors?**
|
|
168
168
|
```bash
|
|
169
169
|
# Install dependencies
|
|
170
|
-
|
|
170
|
+
bun add @contractspec/lib.contracts @contractspec/lib.schema
|
|
171
171
|
```
|
|
172
172
|
|
|
173
173
|
Happy contract authoring! 🎉
|
package/README.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# ContractSpec
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/contractspec)
|
|
4
|
+
[](https://www.npmjs.com/package/contractspec)
|
|
5
|
+
[](https://deepwiki.com/lssm-tech/contractspec)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Website: https://contractspec.io/
|
|
4
9
|
|
|
5
10
|
|
|
6
11
|
**Stabilize your AI-generated code** — Define contracts once, generate consistent code across API, DB, UI, and events. Safe regeneration. No lock-in.
|
|
@@ -321,7 +326,7 @@ contractspec ci --format json
|
|
|
321
326
|
contractspec ci --format sarif --output results.sarif
|
|
322
327
|
|
|
323
328
|
# Skip doctor checks
|
|
324
|
-
contractspec ci
|
|
329
|
+
contractspec ci
|
|
325
330
|
|
|
326
331
|
# Run only structure and integrity checks
|
|
327
332
|
contractspec ci --checks structure,integrity
|
|
@@ -561,9 +566,9 @@ contractspec build spec.ts --provider openai --model gpt-3.5-turbo
|
|
|
561
566
|
|
|
562
567
|
### Import errors in generated code
|
|
563
568
|
|
|
564
|
-
Make sure `@
|
|
569
|
+
Make sure `@contractspec/lib.contracts` and `@contractspec/lib.schema` are installed:
|
|
565
570
|
```bash
|
|
566
|
-
|
|
571
|
+
bun add @contractspec/lib.contracts @contractspec/lib.schema
|
|
567
572
|
```
|
|
568
573
|
|
|
569
574
|
## Contributing
|
|
@@ -573,7 +578,7 @@ Contributions welcome! Please:
|
|
|
573
578
|
1. Follow existing code style
|
|
574
579
|
2. Add tests for new features
|
|
575
580
|
3. Update documentation
|
|
576
|
-
4. Ensure all tests pass: `
|
|
581
|
+
4. Ensure all tests pass: `bun test`
|
|
577
582
|
|
|
578
583
|
## Agent Modes Deep Dive
|
|
579
584
|
|
package/bin/contractspec.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contractspec",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20260113170453",
|
|
4
4
|
"description": "CLI tool for creating, building, and validating contract specifications",
|
|
5
5
|
"bin": {
|
|
6
6
|
"contractspec": "./bin/contractspec.mjs"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@
|
|
9
|
+
"@contractspec/app.cli-contractspec": "0.0.0-canary-20260113170453"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
|
|
@@ -25,9 +25,10 @@
|
|
|
25
25
|
"registry": "https://registry.npmjs.org/"
|
|
26
26
|
},
|
|
27
27
|
"license": "MIT",
|
|
28
|
+
"homepage": "https://contractspec.io",
|
|
28
29
|
"repository": {
|
|
29
30
|
"type": "git",
|
|
30
31
|
"url": "https://github.com/lssm-tech/contractspec.git",
|
|
31
|
-
"directory": "packages/apps/contractspec"
|
|
32
|
+
"directory": "packages/apps-registry/contractspec"
|
|
32
33
|
}
|
|
33
34
|
}
|