@bakers-build/core 0.8.0 → 0.8.1-next.10

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.
Files changed (37) hide show
  1. package/dist/src/cli/bakers-dir.d.ts +8 -8
  2. package/dist/src/cli/bakers-dir.js +30 -33
  3. package/dist/src/cli/config-inventory.d.ts +2 -0
  4. package/dist/src/cli/config-inventory.js +45 -72
  5. package/dist/src/cli/config-report.d.ts +2 -2
  6. package/dist/src/cli/config-source.js +1 -1
  7. package/dist/src/cli/config-validate.d.ts +49 -0
  8. package/dist/src/cli/config-validate.js +400 -0
  9. package/dist/src/cli/import-config.d.ts +2 -2
  10. package/dist/src/cli/import-config.js +5 -5
  11. package/dist/src/cli/load-bakers-config.d.ts +2 -2
  12. package/dist/src/cli/load-bakers-config.js +20 -49
  13. package/dist/src/cli/machine-connection.d.ts +2 -0
  14. package/dist/src/cli/machine-connection.js +47 -0
  15. package/dist/src/cli/machine-context.d.ts +9 -12
  16. package/dist/src/cli/machine-context.js +12 -18
  17. package/dist/src/cli/version-check.d.ts +1 -1
  18. package/dist/src/cli/version-check.js +1 -1
  19. package/dist/src/config-types.generated.d.ts +175 -0
  20. package/dist/src/config-types.generated.js +3 -0
  21. package/dist/src/core/logger.d.ts +3 -3
  22. package/dist/src/core/logger.js +5 -5
  23. package/dist/src/core/proc.d.ts +1 -1
  24. package/dist/src/core/proc.js +8 -5
  25. package/dist/src/index.d.ts +4 -1
  26. package/dist/src/index.js +3 -3
  27. package/dist/src/plugins/discover-addons.d.ts +2 -2
  28. package/dist/src/plugins/discover-addons.js +9 -9
  29. package/dist/src/plugins/preset.d.ts +9 -20
  30. package/dist/src/plugins/preset.js +6 -6
  31. package/dist/src/plugins/scoped-addons.d.ts +5 -14
  32. package/dist/src/plugins/scoped-addons.js +11 -36
  33. package/package.json +6 -4
  34. package/schema/connection.schema.json +57 -0
  35. package/schema/harness-options.schema.json +78 -0
  36. package/schema/machine.schema.json +81 -0
  37. package/schema/project.schema.json +262 -0
@@ -0,0 +1,262 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://bakers.build/schema/project.schema.json",
4
+ "title": "ProjectConfig",
5
+ "description": "A project's committed conductor configuration: .bakers/project.config.js and its variants .bakers/project.<name>.config.js.",
6
+ "type": "object",
7
+ "properties": {
8
+ "schema_version": {
9
+ "const": 1,
10
+ "description": "Configuration schema version."
11
+ },
12
+ "project": {
13
+ "type": "object",
14
+ "description": "The bakers.build project this repository belongs to.",
15
+ "properties": {
16
+ "name": {
17
+ "$ref": "#/$defs/nonempty",
18
+ "description": "Project name on the server; BAKERS_PROJECT overrides it."
19
+ },
20
+ "workspace": {
21
+ "$ref": "#/$defs/nonempty",
22
+ "description": "Team workspace the project belongs to."
23
+ }
24
+ },
25
+ "required": [
26
+ "name"
27
+ ],
28
+ "additionalProperties": false
29
+ },
30
+ "permissions": {
31
+ "$ref": "#/$defs/permissions"
32
+ },
33
+ "addons": {
34
+ "type": "array",
35
+ "description": "Addons this project uses.",
36
+ "items": {
37
+ "$ref": "#/$defs/addon"
38
+ }
39
+ },
40
+ "server": {
41
+ "$ref": "#/$defs/slot",
42
+ "description": "Explicit server slot; wins over an addon's."
43
+ },
44
+ "executor": {
45
+ "$ref": "#/$defs/slot",
46
+ "description": "Explicit executor slot; the machine's wins over it."
47
+ },
48
+ "worktree": {
49
+ "$ref": "#/$defs/slot",
50
+ "description": "Explicit worktree slot; wins over an addon's."
51
+ },
52
+ "states": {
53
+ "type": "array",
54
+ "description": "States this conductor serves; empty or absent serves all.",
55
+ "items": {
56
+ "$ref": "#/$defs/nonempty"
57
+ }
58
+ },
59
+ "prompt": {
60
+ "type": "string",
61
+ "description": "Agent prompt; placeholders {identifier}, {state}, {run_uuid}, {ticket_uuid}."
62
+ },
63
+ "poll_interval_ms": {
64
+ "type": "integer",
65
+ "minimum": 1,
66
+ "description": "Poll interval in milliseconds. Default 5000."
67
+ },
68
+ "lease_seconds": {
69
+ "type": "integer",
70
+ "minimum": 1,
71
+ "description": "Run lease in seconds. Default 300."
72
+ },
73
+ "restart_on_change": {
74
+ "type": "boolean",
75
+ "description": "Restart the foreground conductor when a config file changes. Default true."
76
+ },
77
+ "capture_logs": {
78
+ "type": "boolean",
79
+ "description": "Upload transcripts where the server allows it. Default true."
80
+ },
81
+ "hooks": {
82
+ "type": "object",
83
+ "description": "Shell commands the conductor runs in a ticket's worktree.",
84
+ "properties": {
85
+ "after_create": {
86
+ "type": "string"
87
+ },
88
+ "before_run": {
89
+ "type": "string"
90
+ },
91
+ "after_run": {
92
+ "type": "string"
93
+ },
94
+ "after_done": {
95
+ "type": "string"
96
+ },
97
+ "on_freeze": {
98
+ "type": "string"
99
+ },
100
+ "on_resume": {
101
+ "type": "string"
102
+ },
103
+ "provision_up": {
104
+ "description": "Command, or commands by profile, offered to runs as provision_up(profile?).",
105
+ "anyOf": [
106
+ {
107
+ "type": "string"
108
+ },
109
+ {
110
+ "type": "object",
111
+ "additionalProperties": {
112
+ "type": "string"
113
+ }
114
+ }
115
+ ]
116
+ }
117
+ },
118
+ "additionalProperties": false
119
+ },
120
+ "marketplaces": {
121
+ "type": "array",
122
+ "description": "Agent plugin marketplaces every run of this project installs.",
123
+ "items": {
124
+ "type": "object",
125
+ "properties": {
126
+ "url": {
127
+ "type": "string",
128
+ "pattern": "^(https?://|ssh://|git@[^:\\s]+:)\\S+$",
129
+ "description": "a remote Git URL (https, ssh or git@)"
130
+ },
131
+ "ref": {
132
+ "$ref": "#/$defs/nonempty",
133
+ "description": "Branch or tag."
134
+ },
135
+ "plugins": {
136
+ "type": "array",
137
+ "minItems": 1,
138
+ "items": {
139
+ "$ref": "#/$defs/nonempty"
140
+ }
141
+ }
142
+ },
143
+ "required": [
144
+ "url",
145
+ "ref",
146
+ "plugins"
147
+ ],
148
+ "additionalProperties": false
149
+ }
150
+ },
151
+ "select_agent": {
152
+ "function": true,
153
+ "description": "Function choosing the agent for a ticket; replaces the shipped selection."
154
+ }
155
+ },
156
+ "required": [
157
+ "project"
158
+ ],
159
+ "additionalProperties": false,
160
+ "$defs": {
161
+ "nonempty": {
162
+ "type": "string",
163
+ "minLength": 1,
164
+ "pattern": "\\S"
165
+ },
166
+ "permissions": {
167
+ "type": "object",
168
+ "description": "Shared run permissions for every agent.",
169
+ "properties": {
170
+ "mode": {
171
+ "enum": [
172
+ "sandbox",
173
+ "system",
174
+ "yolo"
175
+ ]
176
+ },
177
+ "sandbox": {
178
+ "type": "object",
179
+ "properties": {
180
+ "deny_read": {
181
+ "$ref": "#/$defs/string_list"
182
+ },
183
+ "allow_write": {
184
+ "$ref": "#/$defs/string_list"
185
+ },
186
+ "trusted_commands": {
187
+ "$ref": "#/$defs/string_list"
188
+ }
189
+ },
190
+ "additionalProperties": false
191
+ }
192
+ },
193
+ "additionalProperties": false
194
+ },
195
+ "string_list": {
196
+ "type": "array",
197
+ "items": {
198
+ "type": "string"
199
+ }
200
+ },
201
+ "addon": {
202
+ "description": "A package name, or { use, alias?, with? }.",
203
+ "if": {
204
+ "type": "string"
205
+ },
206
+ "then": {
207
+ "$ref": "#/$defs/nonempty"
208
+ },
209
+ "else": {
210
+ "type": "object",
211
+ "properties": {
212
+ "use": {
213
+ "$ref": "#/$defs/nonempty"
214
+ },
215
+ "alias": {
216
+ "$ref": "#/$defs/nonempty"
217
+ },
218
+ "with": {
219
+ "description": "The addon's options."
220
+ },
221
+ "priority": {
222
+ "function": true
223
+ }
224
+ },
225
+ "required": [
226
+ "use"
227
+ ],
228
+ "additionalProperties": false
229
+ }
230
+ },
231
+ "slot": {
232
+ "description": "{ use, export?, with? }, or a constructed plugin carrying its kind.",
233
+ "if": {
234
+ "type": "object",
235
+ "required": [
236
+ "kind"
237
+ ]
238
+ },
239
+ "then": {
240
+ "type": "object"
241
+ },
242
+ "else": {
243
+ "type": "object",
244
+ "properties": {
245
+ "use": {
246
+ "$ref": "#/$defs/nonempty"
247
+ },
248
+ "export": {
249
+ "$ref": "#/$defs/nonempty"
250
+ },
251
+ "with": {
252
+ "description": "Options passed to the factory."
253
+ }
254
+ },
255
+ "required": [
256
+ "use"
257
+ ],
258
+ "additionalProperties": false
259
+ }
260
+ }
261
+ }
262
+ }