@haystackeditor/cli 0.19.0 → 0.20.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,35 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://docs.haystackeditor.com/cli/schemas/init.v1.json",
4
+ "title": "Haystack init: this repository's setup for `haystack verify`",
5
+ "description": "Machine-readable output of `haystack init --json`. `changes` are the project-local changes init planned (made when status is done); `onboarding` is the base's OnboardingStatusV1 (onboarding_contracts.ts, APP-ONBOARDING-V1) as POST /api/agent/cloud-verifier/onboarding returns it, null unless status is done. Exit codes: 0 done (onboarding running or ready), 1 failed (the error envelope), 2 planned (nothing written; run with --yes), 3 done but onboarding blocked, 4 login-required, 5 app-required (install the Haystack GitHub App), 6 done but onboarding stopped before finishing (run init again).",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema_version", "status", "repository", "changes", "notices", "onboarding"],
9
+ "properties": {
10
+ "schema_version": { "const": "1.0.0" },
11
+ "status": { "enum": ["done", "planned", "login-required", "app-required"] },
12
+ "repository": { "type": "string" },
13
+ "changes": {
14
+ "type": "array",
15
+ "items": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": ["path", "action", "reason", "diff"],
19
+ "properties": {
20
+ "path": { "type": "string" },
21
+ "action": { "enum": ["create", "update"] },
22
+ "reason": { "type": "string" },
23
+ "diff": { "type": "array", "items": { "type": "string" } }
24
+ }
25
+ }
26
+ },
27
+ "notices": { "type": "array", "items": { "type": "string" } },
28
+ "onboarding": {
29
+ "oneOf": [
30
+ { "type": "null" },
31
+ { "$ref": "verify.v1.json#/$defs/onboardingStatus" }
32
+ ]
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://docs.haystackeditor.com/cli/schemas/login.v1.json",
4
+ "title": "Haystack login: a GitHub device-flow sign-in",
5
+ "description": "Machine-readable output of `haystack login --json`. With --no-wait, status is pending and carries the URL to open and the code to enter (never the device code); the next `haystack login` finishes it. Otherwise status is logged-in with the account signed in.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema_version", "status", "verificationUri", "userCode", "expiresAt", "login"],
9
+ "properties": {
10
+ "schema_version": { "const": "1.0.0" },
11
+ "status": { "enum": ["pending", "logged-in"] },
12
+ "verificationUri": { "type": ["string", "null"] },
13
+ "userCode": { "type": ["string", "null"] },
14
+ "expiresAt": { "type": ["string", "null"], "format": "date-time" },
15
+ "login": { "type": ["string", "null"] }
16
+ }
17
+ }
@@ -0,0 +1,86 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://docs.haystackeditor.com/cli/schemas/verify-answer.v1.json",
4
+ "title": "Haystack verify answer: the repository's onboarding facts after an answer",
5
+ "description": "Machine-readable output of `haystack verify answer <question-id> <choice> --json`: OnboardingFactsView (onboarding_contracts.ts, APP-ONBOARDING-V1) as POST /api/agent/cloud-verifier/onboarding/answers returns it.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema_version",
10
+ "facts"
11
+ ],
12
+ "properties": {
13
+ "schema_version": {
14
+ "const": "1.0.0"
15
+ },
16
+ "facts": {
17
+ "type": "object",
18
+ "required": [
19
+ "repository",
20
+ "facts",
21
+ "factsDigest",
22
+ "openQuestions"
23
+ ],
24
+ "properties": {
25
+ "repository": {
26
+ "type": "string"
27
+ },
28
+ "factsDigest": {
29
+ "type": "string",
30
+ "pattern": "^[0-9a-f]{64}$"
31
+ },
32
+ "facts": {
33
+ "type": "object",
34
+ "required": [
35
+ "dbProfile",
36
+ "answers"
37
+ ],
38
+ "properties": {
39
+ "dbProfile": {
40
+ "oneOf": [
41
+ {
42
+ "type": "null"
43
+ },
44
+ {
45
+ "type": "string",
46
+ "pattern": "^[0-9a-f]{64}$"
47
+ }
48
+ ]
49
+ },
50
+ "answers": {
51
+ "type": "object",
52
+ "additionalProperties": {
53
+ "type": "string"
54
+ }
55
+ }
56
+ }
57
+ },
58
+ "openQuestions": {
59
+ "type": "array",
60
+ "items": {
61
+ "type": "object",
62
+ "required": [
63
+ "id",
64
+ "message",
65
+ "choices"
66
+ ],
67
+ "properties": {
68
+ "id": {
69
+ "type": "string"
70
+ },
71
+ "message": {
72
+ "type": "string"
73
+ },
74
+ "choices": {
75
+ "type": "array",
76
+ "items": {
77
+ "type": "string"
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://docs.haystackeditor.com/cli/schemas/verify-onboarding.v1.json",
4
+ "title": "Haystack verify onboarding: the onboarding of this checkout's base",
5
+ "description": "Machine-readable output of `haystack verify onboarding --json`: OnboardingStatusV1 (onboarding_contracts.ts, APP-ONBOARDING-V1) of the base `haystack verify` would use, as GET /api/agent/cloud-verifier/onboarding?repository=&baseCommit= returns it.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema_version", "onboarding"],
9
+ "properties": {
10
+ "schema_version": { "const": "1.0.0" },
11
+ "onboarding": { "$ref": "verify.v1.json#/$defs/onboardingStatus" }
12
+ }
13
+ }
@@ -2,12 +2,33 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://docs.haystackeditor.com/cli/schemas/verify.v1.json",
4
4
  "title": "Haystack verify: the crawl of the current change (CRAWL-V1)",
5
- "description": "Machine-readable output of `haystack verify --json`: the caller's crawl of the exact captured checkout (its code and its change title), as GET /api/agent/cloud-verifier/crawls?repository=&workCommit= or, for a crawl the command just submitted, GET /api/agent/cloud-verifier/crawls/:runId?repository= returns it, or null when no crawl of the capture could be started. The crawl shapes mirror infra/lambda/haystack-design-verifier-shared/crawl_contracts.ts (with amendments 1, 8 and 9); that file wins where they differ.",
5
+ "description": "Machine-readable output of `haystack verify --json`: the caller's crawl of the exact captured checkout (its code and its change title), as GET /api/agent/cloud-verifier/crawls?repository=&workCommit= or, for a crawl the command just submitted, GET /api/agent/cloud-verifier/crawls/:runId?repository= returns it, or null when no crawl of the capture could be started. The crawl shapes mirror infra/lambda/haystack-design-verifier-shared/crawl_contracts.ts (with amendments 1, 8, 9, 10 and 11); that file wins where they differ. Crawl amendment 11 (schema 1.0.1): when the capture's base is not onboarded yet, `onboarding` is the base's OnboardingStatusV1 (onboarding_contracts.ts, APP-ONBOARDING-V1) and `crawl` is null until the app is ready; it is null when onboarding was not involved.",
6
6
  "type": "object",
7
7
  "additionalProperties": false,
8
8
  "required": ["schema_version", "crawl"],
9
9
  "properties": {
10
- "schema_version": { "const": "1.0.0" },
10
+ "onboarding": {
11
+ "oneOf": [
12
+ {
13
+ "type": "null"
14
+ },
15
+ {
16
+ "$ref": "#/$defs/onboardingStatus"
17
+ }
18
+ ]
19
+ },
20
+ "schema_version": { "const": "1.0.2" },
21
+ "change": {
22
+ "description": "Schema 1.0.2: what this verify checked: the capture's base commit (where HEAD meets origin's default branch), its work commit (committed and uncommitted changes), and the files that differ between them.",
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": ["baseCommit", "workCommit", "files"],
26
+ "properties": {
27
+ "baseCommit": { "$ref": "#/$defs/commit" },
28
+ "workCommit": { "$ref": "#/$defs/commit" },
29
+ "files": { "type": "array", "items": { "type": "string" } }
30
+ }
31
+ },
11
32
  "crawl": {
12
33
  "oneOf": [
13
34
  { "type": "null" },
@@ -16,6 +37,253 @@
16
37
  }
17
38
  },
18
39
  "$defs": {
40
+ "onboardingBlock": {
41
+ "type": "object",
42
+ "required": [
43
+ "kind",
44
+ "stage",
45
+ "reason",
46
+ "evidence",
47
+ "ask"
48
+ ],
49
+ "properties": {
50
+ "kind": {
51
+ "enum": [
52
+ "not-enabled",
53
+ "no-web-app",
54
+ "unsupported",
55
+ "question",
56
+ "outside-credential",
57
+ "outside-dependency",
58
+ "evidence-too-large",
59
+ "budget",
60
+ "proof-failed"
61
+ ]
62
+ },
63
+ "stage": {
64
+ "enum": [
65
+ "admission",
66
+ "inventory",
67
+ "plan",
68
+ "runtime",
69
+ "boot",
70
+ "data",
71
+ "accounts",
72
+ "workflow",
73
+ "publish",
74
+ "cleanup"
75
+ ]
76
+ },
77
+ "reason": {
78
+ "type": "string"
79
+ },
80
+ "evidence": {
81
+ "$ref": "#/$defs/strings"
82
+ },
83
+ "names": {
84
+ "$ref": "#/$defs/strings"
85
+ },
86
+ "ask": {
87
+ "oneOf": [
88
+ {
89
+ "type": "null"
90
+ },
91
+ {
92
+ "type": "object",
93
+ "required": [
94
+ "message"
95
+ ],
96
+ "properties": {
97
+ "message": {
98
+ "type": "string"
99
+ },
100
+ "command": {
101
+ "type": "string"
102
+ },
103
+ "question": {
104
+ "type": "object",
105
+ "required": [
106
+ "id",
107
+ "choices"
108
+ ],
109
+ "properties": {
110
+ "id": {
111
+ "type": "string"
112
+ },
113
+ "choices": {
114
+ "$ref": "#/$defs/strings"
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+ ]
121
+ }
122
+ }
123
+ },
124
+ "onboardingStatus": {
125
+ "type": "object",
126
+ "required": [
127
+ "version",
128
+ "repository",
129
+ "baseCommit",
130
+ "state",
131
+ "onboardRunId",
132
+ "recordDigest",
133
+ "checkpoint",
134
+ "block",
135
+ "dataAbsences",
136
+ "versionChoices"
137
+ ],
138
+ "properties": {
139
+ "version": {
140
+ "const": "app-onboarding-v1"
141
+ },
142
+ "repository": {
143
+ "type": "string"
144
+ },
145
+ "baseCommit": {
146
+ "$ref": "#/$defs/commit"
147
+ },
148
+ "state": {
149
+ "enum": [
150
+ "ready",
151
+ "onboarding",
152
+ "blocked",
153
+ "incomplete",
154
+ "cancelled",
155
+ "not-started"
156
+ ]
157
+ },
158
+ "onboardRunId": {
159
+ "oneOf": [
160
+ {
161
+ "type": "null"
162
+ },
163
+ {
164
+ "type": "string",
165
+ "pattern": "^ob_[0-9a-f]{48}$"
166
+ }
167
+ ]
168
+ },
169
+ "recordDigest": {
170
+ "oneOf": [
171
+ {
172
+ "type": "null"
173
+ },
174
+ {
175
+ "type": "string",
176
+ "pattern": "^[0-9a-f]{64}$"
177
+ }
178
+ ]
179
+ },
180
+ "checkpoint": {
181
+ "oneOf": [
182
+ {
183
+ "type": "null"
184
+ },
185
+ {
186
+ "type": "object",
187
+ "required": [
188
+ "status",
189
+ "stage",
190
+ "execution",
191
+ "owned"
192
+ ],
193
+ "properties": {
194
+ "status": {
195
+ "enum": [
196
+ "queued",
197
+ "running",
198
+ "cleanup-pending",
199
+ "published",
200
+ "reused",
201
+ "blocked",
202
+ "incomplete",
203
+ "cancelled"
204
+ ]
205
+ },
206
+ "stage": {
207
+ "enum": [
208
+ "inventory",
209
+ "plan",
210
+ "runtime",
211
+ "boot",
212
+ "data",
213
+ "accounts",
214
+ "workflow",
215
+ "publish",
216
+ "cleanup"
217
+ ]
218
+ },
219
+ "owned": {
220
+ "$ref": "#/$defs/strings"
221
+ },
222
+ "execution": {
223
+ "type": "object",
224
+ "required": [
225
+ "stages"
226
+ ],
227
+ "properties": {
228
+ "stages": {
229
+ "type": "array",
230
+ "items": {
231
+ "type": "object",
232
+ "required": [
233
+ "stage",
234
+ "status"
235
+ ],
236
+ "properties": {
237
+ "stage": {
238
+ "enum": [
239
+ "inventory",
240
+ "plan",
241
+ "runtime",
242
+ "boot",
243
+ "data",
244
+ "accounts",
245
+ "workflow",
246
+ "publish",
247
+ "cleanup"
248
+ ]
249
+ },
250
+ "status": {
251
+ "enum": [
252
+ "pending",
253
+ "running",
254
+ "ok",
255
+ "reused",
256
+ "failed",
257
+ "blocked"
258
+ ]
259
+ }
260
+ }
261
+ }
262
+ }
263
+ }
264
+ }
265
+ }
266
+ }
267
+ ]
268
+ },
269
+ "block": {
270
+ "oneOf": [
271
+ {
272
+ "type": "null"
273
+ },
274
+ {
275
+ "$ref": "#/$defs/onboardingBlock"
276
+ }
277
+ ]
278
+ },
279
+ "dataAbsences": {
280
+ "$ref": "#/$defs/strings"
281
+ },
282
+ "versionChoices": {
283
+ "$ref": "#/$defs/strings"
284
+ }
285
+ }
286
+ },
19
287
  "runId": { "type": "string", "pattern": "^cv_[0-9a-f]{48}$" },
20
288
  "commit": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
21
289
  "count": { "type": "integer", "minimum": 0 },