@haus-tech/haus-workflow 6.1.0 → 6.3.0

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.
@@ -0,0 +1,369 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/WeAreHausTech/haus-workflow/library/schemas/localdev.v2.schema.json",
4
+ "title": "haus localdev.yml (version 2)",
5
+ "description": "The CLI-parsed part of .haus-workflow/localdev.yml (ADR-0163). Only `version`, `instance` and the templates in `env` are validated by the CLI (src/workspace/env/manifest.ts, which is the enforcement); every other top-level key is agent-interpreted by the clone skill and left open here. Templates: {{slug}}, {{port.<name>}}, {{db.<name>}}, {{redis.<name>.db}}, {{search.<name>.prefix}}, {{site.<name>.url|host|root}}.",
6
+ "type": "object",
7
+ "properties": {
8
+ "version": {
9
+ "enum": [1, 2]
10
+ },
11
+ "instance": {
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "description": "Per-worktree environment. A repo file may declare only ports and processes.",
15
+ "properties": {
16
+ "ports": {
17
+ "type": "object",
18
+ "propertyNames": {
19
+ "type": "string",
20
+ "pattern": "^[a-z0-9][a-z0-9_-]*$"
21
+ },
22
+ "additionalProperties": {
23
+ "type": "integer",
24
+ "minimum": 1,
25
+ "maximum": 65535
26
+ },
27
+ "maxProperties": 20,
28
+ "description": "name -> main-checkout port; a worktree gets lease base + declaration index"
29
+ },
30
+ "datastores": {
31
+ "type": "object",
32
+ "propertyNames": {
33
+ "type": "string",
34
+ "pattern": "^[a-z0-9][a-z0-9_-]*$"
35
+ },
36
+ "additionalProperties": {
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "required": ["engine"],
40
+ "properties": {
41
+ "engine": {
42
+ "enum": [
43
+ "mariadb",
44
+ "mysql",
45
+ "postgres",
46
+ "redis",
47
+ "elasticsearch",
48
+ "opensearch",
49
+ "mssql"
50
+ ]
51
+ },
52
+ "compose": {
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "required": ["project", "service"],
56
+ "properties": {
57
+ "project": {
58
+ "type": "string",
59
+ "minLength": 1
60
+ },
61
+ "service": {
62
+ "type": "string",
63
+ "minLength": 1
64
+ },
65
+ "file": {
66
+ "type": "string",
67
+ "minLength": 1,
68
+ "description": "Compose file, relative to the workspace root, passed as -f when env up has to create the engine (for a non-default name such as docker-compose.local.yml)."
69
+ }
70
+ }
71
+ },
72
+ "native": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": ["host", "port"],
76
+ "description": "An engine on the host, outside Docker (mariadb, mysql, elasticsearch, opensearch). haus never starts it; SQL credentials come only from MYSQL_USER / MYSQL_PWD or ~/.my.cnf.",
77
+ "properties": {
78
+ "host": {
79
+ "type": "string",
80
+ "pattern": "^[A-Za-z0-9._:-]+$"
81
+ },
82
+ "port": {
83
+ "type": "integer",
84
+ "minimum": 1,
85
+ "maximum": 65535
86
+ },
87
+ "client": {
88
+ "type": "string",
89
+ "pattern": "^[A-Za-z0-9._/+-]+$",
90
+ "description": "mysql/mariadb client: a command on PATH or an absolute path (default: mysql or mariadb on PATH)"
91
+ }
92
+ }
93
+ },
94
+ "port": {
95
+ "type": "integer",
96
+ "minimum": 1,
97
+ "maximum": 65535,
98
+ "description": "The engine port. Optional with native: (defaults to native.port)."
99
+ },
100
+ "isolation": {
101
+ "enum": ["database", "db-index", "key-prefix", "prefix", "container"],
102
+ "description": "Default per engine: database (SQL, mssql included), db-index (redis), prefix (search). container has no driver yet."
103
+ },
104
+ "prefix": {
105
+ "type": "string",
106
+ "description": "The main checkout's index or key prefix (default empty)."
107
+ }
108
+ },
109
+ "oneOf": [
110
+ {
111
+ "required": ["compose", "port"]
112
+ },
113
+ {
114
+ "required": ["native"]
115
+ }
116
+ ]
117
+ }
118
+ },
119
+ "databases": {
120
+ "type": "object",
121
+ "propertyNames": {
122
+ "type": "string",
123
+ "pattern": "^[a-z0-9][a-z0-9_-]*$"
124
+ },
125
+ "additionalProperties": {
126
+ "type": "object",
127
+ "additionalProperties": false,
128
+ "required": ["on", "name"],
129
+ "properties": {
130
+ "on": {
131
+ "type": "string",
132
+ "description": "A datastore name"
133
+ },
134
+ "name": {
135
+ "type": "string",
136
+ "minLength": 1
137
+ },
138
+ "perWorktree": {
139
+ "enum": ["clone", "empty"],
140
+ "default": "clone"
141
+ }
142
+ }
143
+ }
144
+ },
145
+ "sites": {
146
+ "type": "object",
147
+ "propertyNames": {
148
+ "type": "string",
149
+ "pattern": "^[a-z0-9][a-z0-9_-]*$"
150
+ },
151
+ "additionalProperties": {
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "required": ["kind", "root", "host"],
155
+ "properties": {
156
+ "kind": {
157
+ "const": "herd"
158
+ },
159
+ "mode": {
160
+ "enum": ["per-worktree", "shared-lock"],
161
+ "default": "per-worktree"
162
+ },
163
+ "root": {
164
+ "type": "string",
165
+ "minLength": 1,
166
+ "description": "Relative path inside the repo; no leading / and no .."
167
+ },
168
+ "host": {
169
+ "type": "string",
170
+ "minLength": 1,
171
+ "description": "May use templates, e.g. {{slug}}.shop.se"
172
+ },
173
+ "mainHost": {
174
+ "type": "string",
175
+ "description": "The main checkout's host (default: basename of root)"
176
+ },
177
+ "secure": {
178
+ "type": "boolean",
179
+ "default": false
180
+ },
181
+ "php": {
182
+ "type": ["string", "number"]
183
+ },
184
+ "copy": {
185
+ "enum": ["cow", "none"],
186
+ "description": "cow clones the main docroot; none uses the worktree folder as it is (the default, and required, for bedrock-env and laravel-env, whose root is a member repo)."
187
+ },
188
+ "share": {
189
+ "type": "array",
190
+ "items": {
191
+ "type": "string",
192
+ "minLength": 1
193
+ }
194
+ },
195
+ "plugins": {
196
+ "type": "object",
197
+ "additionalProperties": {
198
+ "type": "string",
199
+ "minLength": 1
200
+ }
201
+ },
202
+ "config": {
203
+ "type": "object",
204
+ "additionalProperties": false,
205
+ "required": ["kind"],
206
+ "properties": {
207
+ "kind": {
208
+ "enum": ["wp-config-override", "bedrock-env", "laravel-env"],
209
+ "description": "wp-config-override writes wp-config.haus-instance.php; bedrock-env and laravel-env write the defines into the site repo's .env (instance-owned keys)."
210
+ },
211
+ "defines": {
212
+ "type": "object",
213
+ "propertyNames": {
214
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
215
+ },
216
+ "additionalProperties": {
217
+ "type": "string"
218
+ }
219
+ }
220
+ }
221
+ },
222
+ "after": {
223
+ "type": "array",
224
+ "items": {
225
+ "type": "string",
226
+ "minLength": 1
227
+ }
228
+ }
229
+ }
230
+ }
231
+ },
232
+ "processes": {
233
+ "type": "object",
234
+ "propertyNames": {
235
+ "type": "string",
236
+ "pattern": "^[a-z0-9][a-z0-9_-]*$"
237
+ },
238
+ "additionalProperties": {
239
+ "type": "object",
240
+ "additionalProperties": false,
241
+ "required": ["start"],
242
+ "properties": {
243
+ "repo": {
244
+ "type": "string",
245
+ "description": "Required in the workspace file; defaults to the owning repo in a repo file. In a single-repo project (ADR-0167), the folder inside the repo the process runs in (`.` for the root)"
246
+ },
247
+ "start": {
248
+ "type": "string",
249
+ "minLength": 1
250
+ },
251
+ "port": {
252
+ "type": "string",
253
+ "description": "A name from instance.ports"
254
+ },
255
+ "health": {
256
+ "type": "string"
257
+ },
258
+ "healthTimeoutSec": {
259
+ "type": "number",
260
+ "exclusiveMinimum": 0,
261
+ "default": 120
262
+ },
263
+ "optional": {
264
+ "type": "boolean",
265
+ "default": false
266
+ }
267
+ }
268
+ }
269
+ },
270
+ "copyLocal": {
271
+ "type": "array",
272
+ "items": {
273
+ "type": "object",
274
+ "additionalProperties": false,
275
+ "required": ["repo", "path"],
276
+ "properties": {
277
+ "repo": {
278
+ "type": "string",
279
+ "minLength": 1
280
+ },
281
+ "path": {
282
+ "type": "string",
283
+ "minLength": 1,
284
+ "description": "Relative path inside the repo; no leading / and no .."
285
+ }
286
+ }
287
+ }
288
+ },
289
+ "teardown": {
290
+ "type": "array",
291
+ "items": {
292
+ "type": "string",
293
+ "minLength": 1
294
+ },
295
+ "description": "Shell commands (templated) env down --destroy and env gc --write run after stopping processes and before dropping databases; workspace file only, must be idempotent"
296
+ },
297
+ "after": {
298
+ "type": "array",
299
+ "items": {
300
+ "type": "string",
301
+ "minLength": 1
302
+ },
303
+ "description": "Shell commands (templated) env up runs once per environment in the worktree root, after the .env files and .haus-env.json are written (for example seeding a per-worktree bucket from the main one, ADR-0167); a failed one is retried by the next env up; workspace file only, must be idempotent"
304
+ }
305
+ }
306
+ },
307
+ "env": {
308
+ "type": "array",
309
+ "items": {
310
+ "type": "object",
311
+ "required": ["sinks"],
312
+ "properties": {
313
+ "value": {
314
+ "type": ["string", "number"]
315
+ },
316
+ "source": {
317
+ "type": "object",
318
+ "required": ["provides"],
319
+ "properties": {
320
+ "repo": {
321
+ "type": "string"
322
+ },
323
+ "provides": {
324
+ "type": "string"
325
+ }
326
+ }
327
+ },
328
+ "sinks": {
329
+ "type": "array",
330
+ "items": {
331
+ "type": "object",
332
+ "required": ["repo", "key"],
333
+ "properties": {
334
+ "repo": {
335
+ "type": "string",
336
+ "minLength": 1,
337
+ "description": "A member repo (id or folder) in a workspace; in a single-repo project (ADR-0167) a folder inside the repo in canonical form, `.` for the root or `apps/server` for a monorepo app, whose .env receives the key"
338
+ },
339
+ "key": {
340
+ "type": "string",
341
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
342
+ }
343
+ }
344
+ }
345
+ }
346
+ },
347
+ "anyOf": [
348
+ {
349
+ "required": ["value"]
350
+ },
351
+ {
352
+ "required": ["source"]
353
+ }
354
+ ]
355
+ }
356
+ }
357
+ },
358
+ "if": {
359
+ "required": ["instance"]
360
+ },
361
+ "then": {
362
+ "properties": {
363
+ "version": {
364
+ "const": 2
365
+ }
366
+ },
367
+ "required": ["version"]
368
+ }
369
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haus-tech/haus-workflow",
3
- "version": "6.1.0",
3
+ "version": "6.3.0",
4
4
  "description": "Haus AI workflow CLI for Claude Code.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,6 +16,7 @@
16
16
  "scripts/postinstall.mjs",
17
17
  "library/global",
18
18
  "library/catalog",
19
+ "library/schemas",
19
20
  "README.md",
20
21
  "CHANGELOG.md",
21
22
  "docs/before-you-start.md",
@@ -28,6 +29,7 @@
28
29
  "test:quick": "node scripts/test-fast.mjs --quick",
29
30
  "test:full": "node scripts/run-tests.mjs tests/**/*.test.js",
30
31
  "test:coverage": "c8 yarn test:full",
32
+ "test:integration": "HAUS_INTEGRATION=1 node scripts/run-tests.mjs tests/integration/*.int.test.js",
31
33
  "coverage:check": "c8 --check-coverage yarn test:full",
32
34
  "lint": "eslint src --cache --cache-location .eslintcache",
33
35
  "format:check": "prettier --check --cache --cache-location .prettiercache .",