@vite-hub/presets 0.1.0 → 0.4.1
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 +171 -35
- package/dist/babysitter/server.d.ts +59 -6
- package/dist/babysitter/server.js +2 -2
- package/dist/babysitter-DQeA81N0.js +2541 -0
- package/dist/babysitter.d.ts +200 -18
- package/dist/babysitter.js +2 -2
- package/dist/error-diagnostics-o3pHscWs.js +729 -0
- package/dist/host-DH0o7xSq.js +695 -0
- package/dist/labeller.d.ts +47 -3
- package/dist/labeller.js +115 -33
- package/dist/{admission-DBJdt-CX.d.ts → pr-workspaces-CMdQ9U15.d.ts} +375 -88
- package/dist/server-ILDJE5V7.js +12254 -0
- package/dist/workspace.js +2 -5
- package/package.json +17 -18
- package/dist/babysitter-B4D1zeYf.js +0 -715
- package/dist/host-CH0L3VC9.js +0 -438
- package/dist/server-DDmyZ98B.js +0 -6745
|
@@ -0,0 +1,729 @@
|
|
|
1
|
+
import { hasRuntimeType, hasRuntimeType as hasRuntimeType$1 } from "@vite-hub/runtime/internal/runtime-type";
|
|
2
|
+
import { defineErrors } from "@vite-hub/runtime";
|
|
3
|
+
//#region src/internal/runtime-type.ts
|
|
4
|
+
function isRuntimeRecord(value) {
|
|
5
|
+
return value !== null && hasRuntimeType(value, "object");
|
|
6
|
+
}
|
|
7
|
+
function isRuntimeNumber(value) {
|
|
8
|
+
return hasRuntimeType(value, "number");
|
|
9
|
+
}
|
|
10
|
+
function isRuntimeString(value) {
|
|
11
|
+
return hasRuntimeType(value, "string");
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/error-diagnostics.ts
|
|
15
|
+
const presetsErrorDiagnostics = /*#__PURE__*/ defineErrors({
|
|
16
|
+
docs: "https://vitehub.dev/docs/presets/diagnostics",
|
|
17
|
+
codes: {
|
|
18
|
+
PRESETS_BABYSITTER_REPOSITORIES_INVALID: {
|
|
19
|
+
why: "Babysitter filter.repository.allow lists no \"owner/name\" repository.",
|
|
20
|
+
fix: "List repositories as \"owner/name\", or remove filter.repository.allow so the Babysitter serves every repository that its GitHub App can access."
|
|
21
|
+
},
|
|
22
|
+
PRESETS_LABELLER_ACTIONS_INVALID: {
|
|
23
|
+
why: "[vitehub] Labeller actions must be an object.",
|
|
24
|
+
fix: "Set the Labeller actions option to an object keyed by declared label names, such as { Receipts: { archive: true } }, or leave it out."
|
|
25
|
+
},
|
|
26
|
+
PRESETS_LABELLER_ACTION_FLAG_INVALID: {
|
|
27
|
+
why: ({ name, key }) => `[vitehub] Labeller ${name} ${key} must be a boolean.`,
|
|
28
|
+
fix: "Set archive, read, star, and trash to true or false in the rule or action that the message names, or leave them out."
|
|
29
|
+
},
|
|
30
|
+
PRESETS_LABELLER_ACTION_INVALID: {
|
|
31
|
+
why: ({ label }) => `[vitehub] Labeller action "${label}" must be an object.`,
|
|
32
|
+
fix: "Set the action that the message names to an object, such as { archive: true, read: true }."
|
|
33
|
+
},
|
|
34
|
+
PRESETS_LABELLER_ACTION_LABEL_UNDECLARED: {
|
|
35
|
+
why: ({ label }) => `[vitehub] Labeller action "${label}" refers to an undeclared label.`,
|
|
36
|
+
fix: "Add the label that the message names to the Labeller labels option, or remove its entry from actions."
|
|
37
|
+
},
|
|
38
|
+
PRESETS_LABELLER_BODY_LIMIT_INVALID: {
|
|
39
|
+
why: ({ max }) => `[vitehub] Labeller bodyLimit must be an integer from 1 to ${max}.`,
|
|
40
|
+
fix: "Set the Labeller bodyLimit option to a whole number of characters from 1 to 100000, or leave it out to keep the default."
|
|
41
|
+
},
|
|
42
|
+
PRESETS_LABELLER_CLEANUP_AGENT_INVALID: {
|
|
43
|
+
why: "[vitehub] cleanupLabeller() expects an Agent that extends labeller.",
|
|
44
|
+
fix: "Pass the Agent Definition that you made with defineAgent({ extends: labeller, ... }) to cleanupLabeller(), such as the default export of server/agents/inbox.ts."
|
|
45
|
+
},
|
|
46
|
+
PRESETS_LABELLER_CLEANUP_INVALID: {
|
|
47
|
+
why: "[vitehub] Labeller cleanup must be an object.",
|
|
48
|
+
fix: "Set the Labeller cleanup option to an object of rules, such as { promotions: { label: \"Promotions\", olderThan: 14 } }, or leave it out."
|
|
49
|
+
},
|
|
50
|
+
PRESETS_LABELLER_CLEANUP_LABEL_NAME_INVALID: {
|
|
51
|
+
why: ({ name }) => `[vitehub] Labeller cleanup rule "${name}" needs a label name without quotes, backslashes, or control characters.`,
|
|
52
|
+
fix: "Rename the label of the cleanup rule that the message names, in labels and in the rule, without quotes, backslashes, or control characters."
|
|
53
|
+
},
|
|
54
|
+
PRESETS_LABELLER_CLEANUP_LABEL_UNDECLARED: {
|
|
55
|
+
why: ({ name }) => `[vitehub] Labeller cleanup rule "${name}" refers to an undeclared label.`,
|
|
56
|
+
fix: "Set label of the cleanup rule that the message names to a name from the Labeller labels option."
|
|
57
|
+
},
|
|
58
|
+
PRESETS_LABELLER_CLEANUP_OLDER_THAN_INVALID: {
|
|
59
|
+
why: ({ name }) => `[vitehub] Labeller cleanup rule "${name}" needs olderThan as a positive whole number of days.`,
|
|
60
|
+
fix: "Set olderThan of the cleanup rule that the message names to a whole number of days, such as 14."
|
|
61
|
+
},
|
|
62
|
+
PRESETS_LABELLER_LABELS_INVALID: {
|
|
63
|
+
why: "[vitehub] Labeller labels must be an object.",
|
|
64
|
+
fix: "Set the Labeller labels option to an object keyed by label name, such as { Work: { description: \"Work mail\" } }."
|
|
65
|
+
},
|
|
66
|
+
PRESETS_LABELLER_LABEL_COUNT_INVALID: {
|
|
67
|
+
why: "[vitehub] Labeller labels must contain between 1 and 254 labels.",
|
|
68
|
+
fix: "Declare from 1 to 254 labels in the labels option of the Agent that extends labeller."
|
|
69
|
+
},
|
|
70
|
+
PRESETS_LABELLER_LABEL_NAME_INVALID: {
|
|
71
|
+
why: ({ name }) => `[vitehub] Labeller label "${name}" is reserved or invalid.`,
|
|
72
|
+
fix: "Rename the label that the message names. Use 1 to 225 characters without control characters, and do not use a Gmail system label such as INBOX, SPAM, or NONE."
|
|
73
|
+
},
|
|
74
|
+
PRESETS_LABELLER_LABEL_SETTINGS_INVALID: {
|
|
75
|
+
why: ({ name }) => `[vitehub] Labeller label "${name}" must be an object.`,
|
|
76
|
+
fix: "Set the label that the message names to an object, such as { description: \"Purchases and invoices\" }."
|
|
77
|
+
},
|
|
78
|
+
PRESETS_LABELLER_MIN_CONFIDENCE_INVALID: {
|
|
79
|
+
why: "[vitehub] Labeller minConfidence must be between 0 and 1.",
|
|
80
|
+
fix: "Set the Labeller minConfidence option to a number from 0 to 1, such as 0.6, or leave it out to keep the default."
|
|
81
|
+
},
|
|
82
|
+
PRESETS_LABELLER_OPTION_NOT_BOOLEAN: {
|
|
83
|
+
why: ({ key }) => `[vitehub] Labeller ${key} must be a boolean.`,
|
|
84
|
+
fix: "Set the Labeller option that the message names to true or false, or leave it out to keep the default."
|
|
85
|
+
},
|
|
86
|
+
PRESETS_LABELLER_PATTERN_INVALID: {
|
|
87
|
+
why: ({ max }) => `[vitehub] Labeller patterns must be non-empty strings of at most ${max} characters.`,
|
|
88
|
+
fix: "Give each rule pattern as a non-empty string of at most 256 characters, or a non-empty array of such strings."
|
|
89
|
+
},
|
|
90
|
+
PRESETS_LABELLER_REGEX_ESCAPE_INVALID: {
|
|
91
|
+
why: "[vitehub] Labeller regex patterns may only escape literal regex characters.",
|
|
92
|
+
fix: "Escape only literal regex characters in the pattern, such as \\. or \\/. Classes such as \\d and back-references such as \\1 are not supported."
|
|
93
|
+
},
|
|
94
|
+
PRESETS_LABELLER_REGEX_FLAGS_INVALID: {
|
|
95
|
+
why: "[vitehub] Labeller regex patterns use only bounded syntax and the i, m, s, and u flags.",
|
|
96
|
+
fix: "Write the regex pattern as /source/flags with at most 256 source characters and only the i, m, s, and u flags, such as /invoice/i."
|
|
97
|
+
},
|
|
98
|
+
PRESETS_LABELLER_REGEX_INVALID: {
|
|
99
|
+
why: "[vitehub] Labeller regex pattern is invalid.",
|
|
100
|
+
fix: "Fix the regex pattern of the rule so that new RegExp() accepts it, or use a plain string pattern."
|
|
101
|
+
},
|
|
102
|
+
PRESETS_LABELLER_REGEX_SYNTAX_UNSUPPORTED: {
|
|
103
|
+
why: "[vitehub] Labeller regex patterns may not use repetition or grouping.",
|
|
104
|
+
fix: "Remove (), [], {}, *, +, and ? from the regex pattern, or list several plain patterns in an array instead."
|
|
105
|
+
},
|
|
106
|
+
PRESETS_LABELLER_RULES_INVALID: {
|
|
107
|
+
why: "[vitehub] Labeller rules must be an object.",
|
|
108
|
+
fix: "Set the Labeller rules option to an object keyed by rule name, such as { receipts: { subject: \"invoice\", label: \"Receipts\" } }, or leave it out."
|
|
109
|
+
},
|
|
110
|
+
PRESETS_LABELLER_RULE_HEADER_INVALID: {
|
|
111
|
+
why: ({ name }) => `[vitehub] Labeller rule "${name}" has an invalid header name.`,
|
|
112
|
+
fix: "Use non-empty header names of at most 1000 characters in the header field of the rule that the message names, such as { \"List-Id\": \"news\" }."
|
|
113
|
+
},
|
|
114
|
+
PRESETS_LABELLER_RULE_INVALID: {
|
|
115
|
+
why: ({ name }) => `[vitehub] Labeller rule "${name}" must be an object.`,
|
|
116
|
+
fix: "Set the rule that the message names to an object with match fields and a label, such as { from: \"billing@\", label: \"Receipts\" }."
|
|
117
|
+
},
|
|
118
|
+
PRESETS_LABELLER_RULE_LABEL_MISSING: {
|
|
119
|
+
why: ({ name }) => `[vitehub] Labeller rule "${name}" must declare a label before enabling actions.`,
|
|
120
|
+
fix: "Add label to the rule that the message names, or remove its archive, read, star, and trash actions."
|
|
121
|
+
},
|
|
122
|
+
PRESETS_LABELLER_RULE_LABEL_UNDECLARED: {
|
|
123
|
+
why: ({ name }) => `[vitehub] Labeller rule "${name}" refers to an undeclared label.`,
|
|
124
|
+
fix: "Set label of the rule that the message names to a name from the Labeller labels option, or add that label to labels."
|
|
125
|
+
},
|
|
126
|
+
PRESETS_LABELLER_RULE_NESTING_TOO_DEEP: {
|
|
127
|
+
why: "[vitehub] Labeller rules may nest at most eight not clauses.",
|
|
128
|
+
fix: "Nest at most eight not clauses in one rule. Split the rule into several rules instead."
|
|
129
|
+
},
|
|
130
|
+
PRESETS_MERGE_DRAFT_AUTHORS_INVALID: {
|
|
131
|
+
why: "Babysitter merge.markDraftsReady must be an array of GitHub logins.",
|
|
132
|
+
fix: "Set merge.markDraftsReady to non-empty GitHub logins, such as [\"octocat\", \"renovate[bot]\"], or remove it."
|
|
133
|
+
},
|
|
134
|
+
PRESETS_BABYSITTER_OPTION_INVALID: {
|
|
135
|
+
why: ({ option, expected }) => `Babysitter ${option} must be ${expected}.`,
|
|
136
|
+
fix: ({ option, expected }) => `Set ${option} to ${expected} in the Babysitter options, or leave it out to keep the default.`
|
|
137
|
+
},
|
|
138
|
+
PRESETS_BABYSITTER_ENV_MISSING: {
|
|
139
|
+
why: ({ variables }) => `The Babysitter cannot start without ${variables.join(", ")}.`,
|
|
140
|
+
fix: "Set each listed variable on the host, or declare it in env.server.github. Create the GitHub App, its private key and its webhook secret as the Babysitter guide's Minimal setup shows."
|
|
141
|
+
},
|
|
142
|
+
PRESETS_GITHUB_APP_OWNER_MISSING: {
|
|
143
|
+
why: "`createGitHubAppCredentials()` got `installationId` without `owner`. An installation belongs to one repository owner.",
|
|
144
|
+
fix: "Pass `owner`, the repository owner of the installation, or map owners to installations in `installations`."
|
|
145
|
+
},
|
|
146
|
+
PRESETS_BABYSITTER_PLACEMENT_CAPACITY: {
|
|
147
|
+
why: ({ reason }) => reason,
|
|
148
|
+
fix: "The Babysitter retries the pull request after `retryAfterMs`. To run more passes at once, add hosts or slots to the placement."
|
|
149
|
+
},
|
|
150
|
+
PRESETS_REVIEW_OUTCOME_INVALID: {
|
|
151
|
+
why: "Review thread outcome must be one of fixed, disproved, declined, pre-existing, duplicate.",
|
|
152
|
+
fix: "Set outcome to fixed, disproved, declined, pre-existing, or duplicate."
|
|
153
|
+
},
|
|
154
|
+
PRESETS_REVIEW_REASON_REQUIRED: {
|
|
155
|
+
why: ({ outcome }) => `A ${outcome} review thread needs a one-sentence reason.`,
|
|
156
|
+
fix: "Pass a non-empty reason that explains the outcome. Only fixed may omit the reason."
|
|
157
|
+
},
|
|
158
|
+
PRESETS_REVIEW_SEVERE_DECLINED: {
|
|
159
|
+
why: "A valid P0 or P1 finding cannot be declined, whatever the review push budget.",
|
|
160
|
+
fix: "Fix the finding in this pull request, or answer it as disproved, pre-existing or duplicate with the evidence. When the finding is valid but lower than P1, start the reason with that class, such as \"P2: ...\"."
|
|
161
|
+
},
|
|
162
|
+
PRESETS_REVIEW_MENTION_FORBIDDEN: {
|
|
163
|
+
why: "Comments cannot contain GitHub mentions; use the guarded mention capability.",
|
|
164
|
+
fix: "Remove rendered GitHub mentions from the reason. Use mentionOnPullRequest for an allowed notification."
|
|
165
|
+
},
|
|
166
|
+
PRESETS_REVIEW_CURSOR_INVALID: {
|
|
167
|
+
why: "GitHub returned an invalid review comment cursor.",
|
|
168
|
+
fix: "Retry the operation to read the thread again. If the cursor is still missing or repeated, check the GitHub API response before resolving the thread."
|
|
169
|
+
},
|
|
170
|
+
PRESETS_AUTO_MERGE_HEAD_UNCONFIRMED: {
|
|
171
|
+
why: "GitHub did not confirm the expected pull request head.",
|
|
172
|
+
fix: "Read the pull request again. If its head changed, stop this pass; the Babysitter starts a new pass for the new head."
|
|
173
|
+
},
|
|
174
|
+
PRESETS_AUTO_MERGE_REF_CHANGED: {
|
|
175
|
+
why: "Pull request ref changed during auto-merge admission.",
|
|
176
|
+
fix: "Stop this pass. Someone pushed to the pull request or changed its base branch, and the Babysitter starts a new pass for the new head."
|
|
177
|
+
},
|
|
178
|
+
PRESETS_AUTO_MERGE_UNCONFIRMED: {
|
|
179
|
+
why: "GitHub did not confirm native auto-merge was enabled.",
|
|
180
|
+
fix: "Turn on Allow auto-merge in the repository settings, check that the GitHub App has Pull requests: write permission, and request auto-merge again."
|
|
181
|
+
},
|
|
182
|
+
PRESETS_CHECKS_READ_INCOMPLETE: {
|
|
183
|
+
why: ({ warnings }) => `GitHub could not read every check: ${warnings}`,
|
|
184
|
+
fix: "Give the GitHub App Checks: read and Commit statuses: read permission on the repository, then read the base checks again."
|
|
185
|
+
},
|
|
186
|
+
PRESETS_COMMENT_MENTION_FORBIDDEN: {
|
|
187
|
+
why: "Comments cannot contain GitHub mentions; use the guarded mention capability.",
|
|
188
|
+
fix: "Remove the @mentions from the commentOnPullRequest body. Use mentionOnPullRequest to notify an allowed login."
|
|
189
|
+
},
|
|
190
|
+
PRESETS_GITHUB_GRAPHQL_FAILED: {
|
|
191
|
+
why: ({ errors }) => errors || "GitHub could not complete the pull request operation.",
|
|
192
|
+
fix: "Read the GitHub error in the message. Check that the GitHub App has Pull requests: write permission on the repository, then retry the operation."
|
|
193
|
+
},
|
|
194
|
+
PRESETS_GITHUB_PAGINATION_INVALID: {
|
|
195
|
+
why: ({ detail }) => `GitHub ${detail}.`,
|
|
196
|
+
fix: "Retry the operation. If it fails again, check the GitHub status page; the Babysitter retries the pull request on its next pass."
|
|
197
|
+
},
|
|
198
|
+
PRESETS_GITHUB_QUERY_FAILED: {
|
|
199
|
+
why: "GitHub could not complete the pull request query.",
|
|
200
|
+
fix: "Check that the GitHub App has Pull requests: read and Checks: read permission on the repository. The Babysitter retries the pull request on its next pass."
|
|
201
|
+
},
|
|
202
|
+
PRESETS_GITHUB_RESPONSE_INVALID: {
|
|
203
|
+
why: ({ part }) => `GitHub returned an invalid ${part}.`,
|
|
204
|
+
fix: "Retry later; the Babysitter retries the pull request on its next pass. If it keeps failing, check the GitHub status page and that the GitHub App can read the repository's pull requests."
|
|
205
|
+
},
|
|
206
|
+
PRESETS_MENTION_BODY_MENTION: {
|
|
207
|
+
why: "Mention body must not contain another mention.",
|
|
208
|
+
fix: "Remove the other @mentions from the mentionOnPullRequest body. Call mentionOnPullRequest once for each allowed login."
|
|
209
|
+
},
|
|
210
|
+
PRESETS_MENTION_LOGIN_NOT_ALLOWED: {
|
|
211
|
+
why: "GitHub login is not in the configured mention allowlist.",
|
|
212
|
+
fix: "Mention only a login from the Babysitter mentionAllowlist option, or add the login to mentionAllowlist."
|
|
213
|
+
},
|
|
214
|
+
PRESETS_OPERATION_BASE_CHANGED: {
|
|
215
|
+
why: "Pull request base changed; discard this base CI comparison.",
|
|
216
|
+
fix: "Stop comparing with the base checks in this pass. The base branch no longer contains the assigned base commit, and the next pass gets a new base."
|
|
217
|
+
},
|
|
218
|
+
PRESETS_OPERATION_BASE_MISSING: {
|
|
219
|
+
why: "This worker has no assigned base commit for CI comparison.",
|
|
220
|
+
fix: "Do not call readBaseCheckEvidence or readBaseCheckLogs in this pass. Use readCheckLogs for the checks of the pull request head."
|
|
221
|
+
},
|
|
222
|
+
PRESETS_OPERATION_FILTER_MISMATCH: {
|
|
223
|
+
why: "Pull request no longer matches the configured filter.",
|
|
224
|
+
fix: "Stop this pass. The pull request changed and no longer matches the Babysitter filter option, so the Babysitter does not request auto-merge."
|
|
225
|
+
},
|
|
226
|
+
PRESETS_OPERATION_HEAD_CHANGED: {
|
|
227
|
+
why: "Pull request head changed; discard this worker's operations.",
|
|
228
|
+
fix: "Stop this pass and do not push. Someone pushed to the pull request, and the Babysitter starts a new pass for the new head."
|
|
229
|
+
},
|
|
230
|
+
PRESETS_OPERATION_PULL_REQUEST_CLOSED: {
|
|
231
|
+
why: "Pull request is no longer open and ready for repair.",
|
|
232
|
+
fix: "Stop this pass. The pull request was merged or closed; reopen it if the Babysitter must continue."
|
|
233
|
+
},
|
|
234
|
+
PRESETS_OPERATION_UNAVAILABLE: {
|
|
235
|
+
why: ({ operation }) => `This worker has no ${operation} operation.`,
|
|
236
|
+
fix: "Do not call that operation in this pass. The Babysitter gives it only when the install option or the pass allows it; report the change you need instead."
|
|
237
|
+
},
|
|
238
|
+
PRESETS_PULL_REQUEST_BODY_CHANGED: {
|
|
239
|
+
why: "Pull request body changed while validating the update; retry.",
|
|
240
|
+
fix: "Call updatePullRequest again. Someone edited the pull request body at the same time."
|
|
241
|
+
},
|
|
242
|
+
PRESETS_PULL_REQUEST_BODY_MENTION: {
|
|
243
|
+
why: "Pull request bodies cannot add GitHub mentions; use the guarded mention capability.",
|
|
244
|
+
fix: "Remove the new @mentions from the updatePullRequest body. Use mentionOnPullRequest to notify an allowed login."
|
|
245
|
+
},
|
|
246
|
+
PRESETS_PULL_REQUEST_INPUT_EMPTY: {
|
|
247
|
+
why: ({ name }) => `${name} must not be empty.`,
|
|
248
|
+
fix: "Pass a non-empty value for the field that the message names."
|
|
249
|
+
},
|
|
250
|
+
PRESETS_PULL_REQUEST_UPDATE_EMPTY: {
|
|
251
|
+
why: "Provide a pull request title or body.",
|
|
252
|
+
fix: "Pass title, body, or both to updatePullRequest."
|
|
253
|
+
},
|
|
254
|
+
PRESETS_REPAIR_BASE_REVERTED: {
|
|
255
|
+
why: ({ files }) => `The merge result undoes changes that already landed on the base since this PR branched:\n${files}`,
|
|
256
|
+
fix: "Read the base commits for each listed file (git log -p HEAD..MERGE_HEAD -- <file>) and apply this PR's change on top of the base version. When this PR deliberately replaces that base change, pass the file in commitRepair baseOverrides with a one-sentence reason."
|
|
257
|
+
},
|
|
258
|
+
PRESETS_REPAIR_CONFLICTS_UNRESOLVED: {
|
|
259
|
+
why: ({ files }) => `Resolve the remaining merge conflicts and call commitRepair with their file paths: ${files}`,
|
|
260
|
+
fix: "Remove the conflict markers from each file that the message lists, then call commitRepair again with those file paths."
|
|
261
|
+
},
|
|
262
|
+
PRESETS_REPAIR_INDEX_CHANGED: {
|
|
263
|
+
why: "Repair index changed during dependency validation.",
|
|
264
|
+
fix: "Do not run Git commands while commitRepair runs. Call commitRepair again."
|
|
265
|
+
},
|
|
266
|
+
PRESETS_REPAIR_INPUT_MISSING: {
|
|
267
|
+
why: "A repair message and explicit file paths are required.",
|
|
268
|
+
fix: "Pass a non-empty message and the paths of the changed files to commitRepair."
|
|
269
|
+
},
|
|
270
|
+
PRESETS_REPAIR_MERGE_CHANGED: {
|
|
271
|
+
why: "Prepared merge metadata or index changed outside the host repair tools.",
|
|
272
|
+
fix: "Do not run git add, git reset, git merge, or git commit yourself. Stage and commit the merge only with commitRepair."
|
|
273
|
+
},
|
|
274
|
+
PRESETS_REPAIR_PATH_DIRECTORY: {
|
|
275
|
+
why: "Repair paths must name individual files.",
|
|
276
|
+
fix: "List each changed file in commitRepair paths, not its directory."
|
|
277
|
+
},
|
|
278
|
+
PRESETS_REPAIR_PATH_INVALID: {
|
|
279
|
+
why: "Repair paths must name files inside the assigned checkout.",
|
|
280
|
+
fix: "Pass paths relative to the checkout root, such as src/index.ts, without .., .git, or a leading slash."
|
|
281
|
+
},
|
|
282
|
+
PRESETS_REPAIR_STAGED_CHANGES: {
|
|
283
|
+
why: "Repair checkout contains unrelated staged changes.",
|
|
284
|
+
fix: "Do not stage files with git add. Pass the files to commit in commitRepair paths; commitRepair stages them."
|
|
285
|
+
},
|
|
286
|
+
PRESETS_REVIEW_THREAD_NOT_FOUND: {
|
|
287
|
+
why: "Review thread does not belong to this pull request.",
|
|
288
|
+
fix: "Pass the ID of a review thread from this pull request to resolveReviewThread. Read the review threads again to get it."
|
|
289
|
+
},
|
|
290
|
+
PRESETS_WORKFLOW_RUN_BASE_MISMATCH: {
|
|
291
|
+
why: "Workflow run does not belong to this pull request's exact base commit.",
|
|
292
|
+
fix: "Pass the ID of a workflow run from readBaseCheckEvidence to readBaseCheckLogs."
|
|
293
|
+
},
|
|
294
|
+
PRESETS_WORKFLOW_RUN_HEAD_MISMATCH: {
|
|
295
|
+
why: "Workflow run does not belong to this pull request head.",
|
|
296
|
+
fix: "Pass the ID of a workflow run of the current pull request head to readCheckLogs."
|
|
297
|
+
},
|
|
298
|
+
PRESETS_WORKFLOW_RUN_ID_INVALID: {
|
|
299
|
+
why: "Expected a positive workflow run ID.",
|
|
300
|
+
fix: "Pass the numeric workflow run ID from the check details URL, such as 1234567890."
|
|
301
|
+
},
|
|
302
|
+
PRESETS_WORKSPACE_GIT_INVALID: {
|
|
303
|
+
why: "Provider workspace must use an independent Git directory.",
|
|
304
|
+
fix: "Pass a workspace directory whose .git is a directory, or that has no .git. Do not use a Git worktree or a submodule there."
|
|
305
|
+
},
|
|
306
|
+
PRESETS_WORKSPACE_OVERLAPS_CHECKOUT: {
|
|
307
|
+
why: "Provider workspace must be separate from prepared checkout.",
|
|
308
|
+
fix: "Pass a workspace directory outside the checkout to prepareWorkspace(), and do not use a parent of the checkout."
|
|
309
|
+
},
|
|
310
|
+
PRESETS_MERGE_BYPASS_CHECKS_INVALID: {
|
|
311
|
+
why: "Babysitter merge.bypassInheritedChecks must map repositories to check names.",
|
|
312
|
+
fix: "Set merge.bypassInheritedChecks to an object whose keys are owner/name repositories and whose values are arrays of non-empty required check names, such as { 'acme/app': ['ci'] }."
|
|
313
|
+
},
|
|
314
|
+
PRESETS_BABYSITTER_AGENT_INVALID: {
|
|
315
|
+
why: "Babysitter runtime requires a configured Babysitter Agent Definition.",
|
|
316
|
+
fix: "Pass the Agent Definition that you made with defineAgent({ extends: babysitter, ... }) as agent to createBabysitterRuntime()."
|
|
317
|
+
},
|
|
318
|
+
PRESETS_BABYSITTER_BASE_COMMIT_UNREADABLE: {
|
|
319
|
+
why: "Conflict repair requires the exact live base branch commit.",
|
|
320
|
+
fix: "Check that the base branch of the pull request still exists and that the GitHub App has Contents: read permission. The Babysitter retries the pull request on its next pass."
|
|
321
|
+
},
|
|
322
|
+
PRESETS_BABYSITTER_DIRECT_MERGE_CLAIM_LOST: {
|
|
323
|
+
why: "The direct merge claim of this pull request changed before the Babysitter could record that GitHub enqueued the merge.",
|
|
324
|
+
fix: "Let the Babysitter retry the pull request on its next pass. If this repeats, check that only one Babysitter runtime uses the inbox database."
|
|
325
|
+
},
|
|
326
|
+
PRESETS_BABYSITTER_DRIVER_UNSUPPORTED: {
|
|
327
|
+
why: "Babysitter requires a Codex or Claude Code driver for its isolated Git checkout.",
|
|
328
|
+
fix: "Set driver to \"codex\" or \"claude-code\" in the Babysitter options, and do not replace the driver of the Agent that extends babysitter."
|
|
329
|
+
},
|
|
330
|
+
PRESETS_BABYSITTER_EXTERNAL_STATE_MISSING: {
|
|
331
|
+
why: "Missing external pull-request state.",
|
|
332
|
+
fix: "Check that the pull request of the wait still exists and that the GitHub App can read its repository. The Babysitter checks the wait again later."
|
|
333
|
+
},
|
|
334
|
+
PRESETS_BABYSITTER_GITHUB_LIST_MISSING: {
|
|
335
|
+
why: ({ path }) => `GitHub did not return a list for ${path}.`,
|
|
336
|
+
fix: "Check that the GitHub App can read the repository that the path names. The Babysitter retries on its next pass; if it keeps failing, check the GitHub status page."
|
|
337
|
+
},
|
|
338
|
+
PRESETS_BABYSITTER_IGNORE_AUTHORS_INVALID: {
|
|
339
|
+
why: "[vitehub] Babysitter ignoreFeedbackAuthors must list GitHub logins.",
|
|
340
|
+
fix: "Set ignoreFeedbackAuthors in the Babysitter options to an array of GitHub logins, such as [\"renovate[bot]\"], without empty strings."
|
|
341
|
+
},
|
|
342
|
+
PRESETS_BABYSITTER_INSTALL_COMMAND_FAILED: {
|
|
343
|
+
why: ({ output }) => output || "Dependency installation failed.",
|
|
344
|
+
fix: "Run the install.command of the Babysitter options in a checkout of the pull request and fix the failure that the output shows. The pull request waits and retries."
|
|
345
|
+
},
|
|
346
|
+
PRESETS_BABYSITTER_LIFECYCLE_LABELS_CONFLICT: {
|
|
347
|
+
why: "[vitehub] Configure Babysitter lifecycle labels or filter.labels, not both.",
|
|
348
|
+
fix: "Keep lifecycle.labels or filter.labels in the Babysitter options and remove the other one."
|
|
349
|
+
},
|
|
350
|
+
PRESETS_BABYSITTER_MERGE_QUEUE_QUERY_FAILED: {
|
|
351
|
+
why: ({ errors }) => `GitHub merge queue query failed: ${errors}`,
|
|
352
|
+
fix: "Read the GitHub error in the message and check that the GitHub App has Pull requests: read permission. The Babysitter retries the merge on its next pass."
|
|
353
|
+
},
|
|
354
|
+
PRESETS_BABYSITTER_NO_FINDINGS_PREFIX_EMPTY: {
|
|
355
|
+
why: "[vitehub] Babysitter noFindingsReviews cannot contain an empty prefix.",
|
|
356
|
+
fix: "Remove the empty string from noFindingsReviews in the Babysitter options, or give each entry the text that starts a no-findings review."
|
|
357
|
+
},
|
|
358
|
+
PRESETS_BABYSITTER_RECONCILE_STALLED: {
|
|
359
|
+
why: ({ step, minutes }) => `The Babysitter reconcile waited ${minutes} minutes in its ${step} step, so the Babysitter stopped it.`,
|
|
360
|
+
fix: "Read the babysitter.reconcile.stalled event: it names the step and the pull request that did not answer. The next reconcile claims work again. If the same step stalls again, find the request or lock in that step that never settles and give it a timeout."
|
|
361
|
+
},
|
|
362
|
+
PRESETS_BABYSITTER_TOOL_FIELD_INVALID: {
|
|
363
|
+
why: ({ key, expected }) => `${key} must be ${expected}.`,
|
|
364
|
+
fix: "Pass the field that the message names as a string in the tool input. Only a body may be empty."
|
|
365
|
+
},
|
|
366
|
+
PRESETS_BABYSITTER_TOOL_FIELD_MISSING: {
|
|
367
|
+
why: ({ key }) => `Missing ${key}.`,
|
|
368
|
+
fix: "Add the field that the message names to the tool input."
|
|
369
|
+
},
|
|
370
|
+
PRESETS_BABYSITTER_TOOL_PATHS_MISSING: {
|
|
371
|
+
why: "Expected explicit repair paths.",
|
|
372
|
+
fix: "Pass paths to commitRepair as an array of file path strings, such as { message: \"fix: lint\", paths: [\"src/index.ts\"] }."
|
|
373
|
+
},
|
|
374
|
+
PRESETS_BABYSITTER_TOOL_RUN_ID_MISSING: {
|
|
375
|
+
why: "Expected a run ID.",
|
|
376
|
+
fix: "Pass runId as a number, the workflow run ID from the check details URL, to readCheckLogs or readBaseCheckLogs."
|
|
377
|
+
},
|
|
378
|
+
PRESETS_BABYSITTER_TOOL_UPDATE_EMPTY: {
|
|
379
|
+
why: "Expected a title or body.",
|
|
380
|
+
fix: "Pass title, body, or both to updatePullRequest."
|
|
381
|
+
},
|
|
382
|
+
PRESETS_BABYSITTER_WAKE_REPOSITORY_UNKNOWN: {
|
|
383
|
+
why: "External wake repository is outside the configured repositories.",
|
|
384
|
+
fix: "Wait only on pull requests and checks in repositories that the Babysitter serves, or add the repository to filter.repository.allow and install the GitHub App on it."
|
|
385
|
+
},
|
|
386
|
+
PRESETS_DAILY_PUSH_BUDGET_SPENT: {
|
|
387
|
+
why: ({ count, nextAt }) => `Daily push budget spent: this PR has ${count} repair pushes in the last 24 hours, and the next push is allowed at ${nextAt}.`,
|
|
388
|
+
fix: "Do not push or commit again in this pass. Reply to and resolve the remaining review threads, then report the current PR head as reviewedHead."
|
|
389
|
+
},
|
|
390
|
+
PRESETS_BABYSITTER_MAIN_REPAIR_NEEDS_PREFIX: {
|
|
391
|
+
why: "Babysitter mainRepair needs a mainRepairBranchPrefix: repair PRs are opened on branches with that prefix.",
|
|
392
|
+
fix: "Set mainRepairBranchPrefix, such as \"repair-main-\", or set mainRepair to false."
|
|
393
|
+
},
|
|
394
|
+
PRESETS_BABYSITTER_MINOR_ROUNDS_NEED_BUDGET: {
|
|
395
|
+
why: "Babysitter minorReviewRounds needs a reviewPushBudget: settled rounds spend that budget.",
|
|
396
|
+
fix: "Set reviewPushBudget to a positive integer, or set minorReviewRounds to false."
|
|
397
|
+
},
|
|
398
|
+
PRESETS_DEPENDENCY_PATCH_MISSING: {
|
|
399
|
+
why: ({ path }) => `Dependency patch ${path} does not exist in this checkout.`,
|
|
400
|
+
fix: "Restore the patch file, or remove its entry from patchedDependencies."
|
|
401
|
+
},
|
|
402
|
+
PRESETS_DEPENDENCY_REFRESH_LIMIT: {
|
|
403
|
+
why: ({ limit }) => `refreshDependencies already ran ${limit} time${limit === 1 ? "" : "s"} in this pass, the limit.`,
|
|
404
|
+
fix: "Do not call refreshDependencies again. Read .git/vitehub-install.json for the last install result, then commit your dependency fixes and let hosted CI validate them, or report the install failure as the blocker."
|
|
405
|
+
},
|
|
406
|
+
PRESETS_BABYSITTER_STACK_REPAIR_NEEDS_DIRECT_MERGE: {
|
|
407
|
+
why: "Babysitter repairStackChildren requires merge: \"direct\": only a direct merge stops a stack child from merging into its parent's branch.",
|
|
408
|
+
fix: "Set merge to \"direct\" or { strategy: \"direct\" }, or set repairStackChildren to false."
|
|
409
|
+
},
|
|
410
|
+
PRESETS_BABYSITTER_ADMISSION_CHECK_INVALID: {
|
|
411
|
+
why: "Invalid admission.check result. Expected undefined or { reason, detail, retryAt }.",
|
|
412
|
+
fix: "Return undefined from the Babysitter admission.check function, or a pause object with a non-empty reason string, an optional detail string, and an optional retryAt timestamp in milliseconds."
|
|
413
|
+
},
|
|
414
|
+
PRESETS_BABYSITTER_CHECKOUT_POOL_REPLACED: {
|
|
415
|
+
why: ({ path }) => `[vitehub] Refusing to clean replaced Babysitter checkout pool: ${path}`,
|
|
416
|
+
fix: "Stop every other process that uses the Babysitter data directory, remove the directory that the message names, and start the Babysitter again."
|
|
417
|
+
},
|
|
418
|
+
PRESETS_BABYSITTER_CHECKOUT_POOL_UNSAFE: {
|
|
419
|
+
why: ({ root }) => `[vitehub] Refusing to clean unsafe Babysitter checkout pool: ${root}`,
|
|
420
|
+
fix: "Replace the path that the message names with a real directory, or remove it. The Babysitter keeps its checkout pool there and does not follow symbolic links."
|
|
421
|
+
},
|
|
422
|
+
PRESETS_BABYSITTER_GITHUB_CURSOR_INVALID: {
|
|
423
|
+
why: ({ kind }) => `Invalid ${kind} cursor`,
|
|
424
|
+
fix: "Retry later; the Babysitter reads the pull requests again on its next pass. If it keeps failing, check the GitHub status page."
|
|
425
|
+
},
|
|
426
|
+
PRESETS_BABYSITTER_GITHUB_HEAD_MISSING: {
|
|
427
|
+
why: "GitHub returned no pull request head.",
|
|
428
|
+
fix: "Check that the head branch or fork of the pull request still exists. Restore it, or close the pull request."
|
|
429
|
+
},
|
|
430
|
+
PRESETS_BABYSITTER_GITHUB_QUERY_FAILED: {
|
|
431
|
+
why: ({ query, errors }) => `GitHub ${query} query failed: ${errors}`,
|
|
432
|
+
fix: "Read the GitHub error in the message and check that the GitHub App has Pull requests: read permission on the repository. The Babysitter retries on its next pass."
|
|
433
|
+
},
|
|
434
|
+
PRESETS_BABYSITTER_HOST_EXECUTABLE_UNAVAILABLE: {
|
|
435
|
+
why: ({ program, problem }) => `The host executable ${program} ${problem}.`,
|
|
436
|
+
fix: "Install the executable that the message names in the PATH of the trusted host service. A script must start with an interpreter line, such as #!/usr/bin/env node. Model passes wait until this check succeeds."
|
|
437
|
+
},
|
|
438
|
+
PRESETS_BABYSITTER_INBOX_STORAGE_MISSING: {
|
|
439
|
+
why: "PullRequestInbox requires exactly one of path or storage.",
|
|
440
|
+
fix: "Set inboxPath, a private node:sqlite file, or inboxStorage, such as agentState.extension(\"babysitter\"), in the createBabysitterRuntime() options."
|
|
441
|
+
},
|
|
442
|
+
PRESETS_BABYSITTER_PROMPT_TOO_LARGE: {
|
|
443
|
+
why: ({ characters, bytes, limit }) => `GitHubPullRequest prompt exceeds transport safety limit: ${characters} characters, ${bytes} UTF-8 bytes; limit ${limit}. All review/comment bodies were retained. No truncated prompt was sent.`,
|
|
444
|
+
fix: "Shorten or hide the longest comments and review bodies on the pull request, or split it into smaller pull requests. The Babysitter does not cut feedback."
|
|
445
|
+
},
|
|
446
|
+
PRESETS_DEPENDENCY_CHECKS_INCOMPLETE: {
|
|
447
|
+
why: ({ warnings }) => `Dependency checks are incomplete: ${warnings}`,
|
|
448
|
+
fix: "Give the GitHub App Checks: read and Commit statuses: read permission on the repository of the dependency. The Babysitter checks the wait again later."
|
|
449
|
+
},
|
|
450
|
+
PRESETS_FEEDBACK_CHANGED: {
|
|
451
|
+
why: "Feedback changed during pagination. Read again from offset zero.",
|
|
452
|
+
fix: "Call readFeedback again with offset 0 and no version, then continue with the new version."
|
|
453
|
+
},
|
|
454
|
+
PRESETS_FEEDBACK_NOT_FOUND: {
|
|
455
|
+
why: "Feedback is absent or deleted from the assigned PR snapshot.",
|
|
456
|
+
fix: "Pass to readFeedback the id and kind of a comment, review, or review comment from the pull request context of this pass."
|
|
457
|
+
},
|
|
458
|
+
PRESETS_FEEDBACK_OFFSET_INVALID: {
|
|
459
|
+
why: "Feedback offset exceeds the body length.",
|
|
460
|
+
fix: "Pass an offset that is at most the body length, such as next.offset of the last readFeedback result."
|
|
461
|
+
},
|
|
462
|
+
PRESETS_FEEDBACK_VERSION_MISSING: {
|
|
463
|
+
why: "Continue with the version returned by the first feedback read.",
|
|
464
|
+
fix: "Pass next.version from the last readFeedback result together with next.offset."
|
|
465
|
+
},
|
|
466
|
+
PRESETS_SANDBOX_BUNDLE_MISSING: {
|
|
467
|
+
why: "The repair Sandbox bundle is unavailable.",
|
|
468
|
+
fix: "Call commitRepair or pushRepair again. If it fails again, check that the Sandbox provider can read files from the Sandbox workspace."
|
|
469
|
+
},
|
|
470
|
+
PRESETS_SANDBOX_COMMIT_EXPORT_FAILED: {
|
|
471
|
+
why: ({ stderr }) => `Cannot export the repair Sandbox commit: ${stderr}`,
|
|
472
|
+
fix: "Commit the repair in the Sandbox checkout on top of the assigned head, without rewriting earlier commits, then call commitRepair or pushRepair again."
|
|
473
|
+
},
|
|
474
|
+
PRESETS_SANDBOX_COMMIT_MISSING: {
|
|
475
|
+
why: "The repair Sandbox did not return a commit SHA.",
|
|
476
|
+
fix: "Check that the Sandbox workspace is a Git checkout with a commit at HEAD, then call commitRepair or pushRepair again."
|
|
477
|
+
},
|
|
478
|
+
PRESETS_SANDBOX_HEAD_CHANGED: {
|
|
479
|
+
why: "The repair Sandbox HEAD changed during export.",
|
|
480
|
+
fix: "Do not commit in the Sandbox while commitRepair or pushRepair runs. Call it again."
|
|
481
|
+
},
|
|
482
|
+
PRESETS_SANDBOX_REPAIR_DESTINATION_CHANGED: {
|
|
483
|
+
why: "Repair destination parent changed during transfer.",
|
|
484
|
+
fix: "Do not move or link directories in the checkout while commitRepair runs. Call commitRepair again."
|
|
485
|
+
},
|
|
486
|
+
PRESETS_SANDBOX_REPAIR_DESTINATION_OUTSIDE: {
|
|
487
|
+
why: "Repair destination parent must stay inside the checkout.",
|
|
488
|
+
fix: "Remove the symbolic link in the parent path of the repair file, so that the file stays inside the checkout."
|
|
489
|
+
},
|
|
490
|
+
PRESETS_SANDBOX_REPAIR_FILE_MISSING: {
|
|
491
|
+
why: "The repair Sandbox file disappeared during transfer.",
|
|
492
|
+
fix: "Do not delete repair files while commitRepair runs. Call commitRepair again with the files that exist."
|
|
493
|
+
},
|
|
494
|
+
PRESETS_SANDBOX_REPAIR_PARENT_INVALID: {
|
|
495
|
+
why: "Repair Sandbox parent must be a regular directory.",
|
|
496
|
+
fix: "Replace the file or symbolic link in the parent path of the repair file with a directory in the Sandbox checkout."
|
|
497
|
+
},
|
|
498
|
+
PRESETS_SANDBOX_REPAIR_PATH_DIRECTORY: {
|
|
499
|
+
why: "Repair paths must name individual files.",
|
|
500
|
+
fix: "List each changed file in the repair paths, not its directory."
|
|
501
|
+
},
|
|
502
|
+
PRESETS_SANDBOX_REPAIR_PATH_INVALID: {
|
|
503
|
+
why: "Repair paths must name files inside the assigned checkout.",
|
|
504
|
+
fix: "Pass repair paths relative to the checkout root, such as src/index.ts, without .., .git, or a leading slash."
|
|
505
|
+
},
|
|
506
|
+
PRESETS_SANDBOX_SYNC_FAILED: {
|
|
507
|
+
why: ({ stderr }) => `Cannot synchronize repair Sandbox files: ${stderr}`,
|
|
508
|
+
fix: "Read the Sandbox error in the message, check that the repair files are readable in the Sandbox, and call commitRepair again."
|
|
509
|
+
},
|
|
510
|
+
PRESETS_REVIEW_COMMENT_MISSING: {
|
|
511
|
+
why: "Review thread has no comment to answer.",
|
|
512
|
+
fix: "Read the review thread again and use a thread that contains a review comment. Do not record an outcome until its reply can be posted."
|
|
513
|
+
},
|
|
514
|
+
PRESETS_BABYSITTER_STATUS_INVALID: {
|
|
515
|
+
why: "Babysitter status must be an object whose comment and checkRun fields are booleans.",
|
|
516
|
+
fix: "Pass status: { comment?: boolean, checkRun?: boolean }, or leave status out to post both the activity comment and the babysitter check run."
|
|
517
|
+
},
|
|
518
|
+
PRESETS_CHECK_LOG_SELECTION_INVALID: {
|
|
519
|
+
why: ({ reason }) => `readCheckLogs got an invalid line selection: ${reason}`,
|
|
520
|
+
fix: "Pass tailLines from 1 to 1000 alone, or startLine with an optional endLine at most 999 lines after it."
|
|
521
|
+
},
|
|
522
|
+
PRESETS_CHECK_LOG_START_PAST_END: {
|
|
523
|
+
why: ({ startLine, totalLines }) => `startLine ${startLine} is past the log's ${totalLines} lines.`,
|
|
524
|
+
fix: "Pick a startLine from the totalLines of an earlier readCheckLogs result, or pass tailLines to read the end of the log."
|
|
525
|
+
},
|
|
526
|
+
PRESETS_CHECKOUT_CLEANUP_FAILED: {
|
|
527
|
+
why: ({ checkout }) => `[vitehub] Could not locate disposable checkout for cleanup: ${checkout}`,
|
|
528
|
+
fix: "Check that no other process moves or deletes the checkout directory while a pass runs, then remove the directory that the message names."
|
|
529
|
+
},
|
|
530
|
+
PRESETS_COREPACK_MISSING: {
|
|
531
|
+
why: "Babysitter host installation requires Corepack in PATH. Install Corepack on the trusted host; Node 25 and newer do not bundle it.",
|
|
532
|
+
fix: "Run `npm install --global corepack` on the Babysitter host and check that `corepack --version` works in the PATH of the host process. The pull request waits and retries."
|
|
533
|
+
},
|
|
534
|
+
PRESETS_DEPENDENCIES_NOT_CURRENT: {
|
|
535
|
+
why: "Dependency inputs changed or installation failed. Call refreshDependencies and rerun validation before committing.",
|
|
536
|
+
fix: "Call refreshDependencies, read .git/vitehub-install.json for the install result, and run validation again before you commit."
|
|
537
|
+
},
|
|
538
|
+
PRESETS_DEPENDENCY_GIT_HOST_LOCAL: {
|
|
539
|
+
why: "Host-local Git dependencies are not allowed.",
|
|
540
|
+
fix: "Replace the git: or git+file: dependency in the pull request with a registry version or an https:// tarball URL."
|
|
541
|
+
},
|
|
542
|
+
PRESETS_DEPENDENCY_GIT_UNSUPPORTED: {
|
|
543
|
+
why: "Git dependencies require preparation inside the provider sandbox.",
|
|
544
|
+
fix: "Replace the Git dependency in the pull request with a registry version, a pkg.pr.new URL, or a GitHub archive or release tarball URL."
|
|
545
|
+
},
|
|
546
|
+
PRESETS_DEPENDENCY_HOST_UNTRUSTED: {
|
|
547
|
+
why: "Dependency downloads require a trusted HTTPS registry or forge.",
|
|
548
|
+
fix: "Download the dependency over https:// from registry.npmjs.org, registry.yarnpkg.com, pkg.pr.new, github.com, or codeload.github.com, with no port and no credentials in the URL."
|
|
549
|
+
},
|
|
550
|
+
PRESETS_DEPENDENCY_INPUTS_CHANGED: {
|
|
551
|
+
why: "Dependency inputs changed during installation. Call refreshDependencies again before validation.",
|
|
552
|
+
fix: "Do not edit package.json, lockfiles, or workspace files while the install runs. Call refreshDependencies again, then run validation."
|
|
553
|
+
},
|
|
554
|
+
PRESETS_DEPENDENCY_INPUT_SYMLINK: {
|
|
555
|
+
why: "Dependency inputs must not be symbolic links.",
|
|
556
|
+
fix: "Replace the symbolic link with a regular file for each package.json, lockfile, .npmrc, .yarnrc.yml, and pnpm-workspace.yaml in the checkout."
|
|
557
|
+
},
|
|
558
|
+
PRESETS_DEPENDENCY_PATCHES_INVALID: {
|
|
559
|
+
why: "Dependency patches must be a path mapping.",
|
|
560
|
+
fix: "Set patchedDependencies to an object that maps each package to a patch file path in the checkout, such as { \"pkg@1.0.0\": \"patches/pkg.patch\" }."
|
|
561
|
+
},
|
|
562
|
+
PRESETS_DEPENDENCY_PATCH_NOT_FILE: {
|
|
563
|
+
why: "Dependency patches must be regular files.",
|
|
564
|
+
fix: "Point each patchedDependencies entry at a regular patch file in the checkout, not a directory or a special file."
|
|
565
|
+
},
|
|
566
|
+
PRESETS_DEPENDENCY_PATCH_PATH_INVALID: {
|
|
567
|
+
why: "Dependency patches must reference checkout files.",
|
|
568
|
+
fix: "Set each patchedDependencies value to a patch file path string, or to { path } with that string."
|
|
569
|
+
},
|
|
570
|
+
PRESETS_DEPENDENCY_PATH_HOST_LOCAL: {
|
|
571
|
+
why: "Host-local dependency paths are not allowed.",
|
|
572
|
+
fix: "Use a relative path inside the checkout, such as ./packages/lib. Do not use ~, //, a drive letter, or backslashes."
|
|
573
|
+
},
|
|
574
|
+
PRESETS_DEPENDENCY_PATH_OUTSIDE: {
|
|
575
|
+
why: "Host-local dependency paths must stay inside the checkout.",
|
|
576
|
+
fix: "Change the file:, link:, portal:, or workspace path so that it resolves to a directory inside the checkout."
|
|
577
|
+
},
|
|
578
|
+
PRESETS_DEPENDENCY_PROTOCOL_UNSUPPORTED: {
|
|
579
|
+
why: "Unsupported dependency source protocol; downloads require a trusted HTTPS registry or forge.",
|
|
580
|
+
fix: "Use a registry version or one of the npm:, workspace:, catalog:, file:, link:, portal:, or https: protocols for the dependency."
|
|
581
|
+
},
|
|
582
|
+
PRESETS_DEPENDENCY_SYMLINK_OUTSIDE: {
|
|
583
|
+
why: "Host-local dependency symlinks must stay inside the checkout.",
|
|
584
|
+
fix: "Remove the symbolic link that points outside the checkout, or point it at a directory inside the checkout."
|
|
585
|
+
},
|
|
586
|
+
PRESETS_DEPENDENCY_URL_INVALID: {
|
|
587
|
+
why: "Dependency downloads require a trusted HTTPS URL with forward slashes.",
|
|
588
|
+
fix: "Write the dependency URL as https://host/path with forward slashes and no backslashes."
|
|
589
|
+
},
|
|
590
|
+
PRESETS_GITHUB_APP_CREDENTIALS_INCOMPLETE: {
|
|
591
|
+
why: "GitHub App appId, installationId, and privateKey must be configured together.",
|
|
592
|
+
fix: "Return appId, installationId, and privateKey together from the credentials() option of createGitHubHost(), or return only token."
|
|
593
|
+
},
|
|
594
|
+
PRESETS_GITHUB_APP_NUMBER_INVALID: {
|
|
595
|
+
why: ({ name }) => `${name} must be a positive integer.`,
|
|
596
|
+
fix: "Set appId and installationId to the numeric IDs from the GitHub App settings and its installation, such as VITEHUB_GITHUB_APP_ID=123456."
|
|
597
|
+
},
|
|
598
|
+
PRESETS_GITHUB_APP_REQUEST_FAILED: {
|
|
599
|
+
why: ({ status }) => `GitHub App request /app failed with ${status}.`,
|
|
600
|
+
fix: "Check that VITEHUB_GITHUB_APP_ID and VITEHUB_GITHUB_PRIVATE_KEY belong to the same GitHub App and that the key is not revoked. Read error.cause for the GitHub response."
|
|
601
|
+
},
|
|
602
|
+
PRESETS_GITHUB_APP_RESPONSE_INVALID: {
|
|
603
|
+
why: "GitHub App request /app returned a response that the host cannot read.",
|
|
604
|
+
fix: "Retry later. If it fails again, read error.cause for the GitHub response and check the GitHub status page."
|
|
605
|
+
},
|
|
606
|
+
PRESETS_GITHUB_APP_TOKEN_FAILED: {
|
|
607
|
+
why: ({ status }) => `GitHub App token request failed with ${status}.`,
|
|
608
|
+
fix: "Check that the GitHub App is installed on the repository owner, that the installation ID is current, and that the private key is valid. Read error.cause for the GitHub response."
|
|
609
|
+
},
|
|
610
|
+
PRESETS_GITHUB_APP_TOKEN_MISSING: {
|
|
611
|
+
why: "GitHub App token response did not include a token.",
|
|
612
|
+
fix: "Retry later. If it fails again, check that the GitHub App installation is not suspended, and read error.cause for the GitHub response."
|
|
613
|
+
},
|
|
614
|
+
PRESETS_GITHUB_AUTH_MISSING: {
|
|
615
|
+
why: "GitHub authentication is not configured. Set VITEHUB_GITHUB_TOKEN or GitHub App credentials.",
|
|
616
|
+
fix: "Set VITEHUB_GITHUB_TOKEN, or return a token or GitHub App credentials from the credentials() option of createGitHubHost(). A repository outside the App owner needs the token."
|
|
617
|
+
},
|
|
618
|
+
PRESETS_GITHUB_DEPENDENCY_CONFLICT: {
|
|
619
|
+
why: ({ file }) => `Resolve dependency conflicts in ${file} and call refreshDependencies before validation.`,
|
|
620
|
+
fix: "Remove the merge conflict markers from the dependency file that the message names, then call `refreshDependencies` again."
|
|
621
|
+
},
|
|
622
|
+
PRESETS_GITHUB_HOST_APP_OWNER_MISSING: {
|
|
623
|
+
why: "GitHub App owner must be configured with App credentials.",
|
|
624
|
+
fix: "Return owner, the repository owner of the installation, with appId, installationId, and privateKey from the credentials() option of createGitHubHost()."
|
|
625
|
+
},
|
|
626
|
+
PRESETS_GITHUB_INSTALL_FAILED: {
|
|
627
|
+
why: ({ detail }) => `Frozen dependency installation failed: ${detail}`,
|
|
628
|
+
fix: "Read error.cause for the package manager output. Fix the lockfile or package.json of the pull request when `kind` is `input`. A retry helps when `retryable` is true, such as for installer capacity or the network."
|
|
629
|
+
},
|
|
630
|
+
PRESETS_GITHUB_REPOSITORY_INVALID: {
|
|
631
|
+
why: "Expected a GitHub repository in owner/name form.",
|
|
632
|
+
fix: "Pass repository and headRepository as \"owner/name\", such as \"vite-hub/vitehub\"."
|
|
633
|
+
},
|
|
634
|
+
PRESETS_INSTALL_OUTPUT_CHANGED: {
|
|
635
|
+
why: "Dependency output directory changed during installation.",
|
|
636
|
+
fix: "Do not create, move, or delete workspace package directories while the install runs. Call refreshDependencies again."
|
|
637
|
+
},
|
|
638
|
+
PRESETS_LINKED_BIN_CHANGED: {
|
|
639
|
+
why: "Linked dependency bin target changed during snapshot validation.",
|
|
640
|
+
fix: "Do not edit the bin files of linked dependencies while validation runs. Run validation again."
|
|
641
|
+
},
|
|
642
|
+
PRESETS_LINKED_BIN_GIT_METADATA: {
|
|
643
|
+
why: "Linked dependency bin targets must not read Git metadata.",
|
|
644
|
+
fix: "Change the bin field of the linked package so that no target is inside a .git directory."
|
|
645
|
+
},
|
|
646
|
+
PRESETS_LINKED_BIN_INVALID: {
|
|
647
|
+
why: "Linked dependency bin targets must be file paths.",
|
|
648
|
+
fix: "Set the bin field of the linked package to a file path string, or to an object whose values are file path strings."
|
|
649
|
+
},
|
|
650
|
+
PRESETS_LINKED_BIN_NOT_FILE: {
|
|
651
|
+
why: "Linked dependency bin targets must be regular files.",
|
|
652
|
+
fix: "Point each bin entry of the linked package at a regular file, not a directory or a symbolic link."
|
|
653
|
+
},
|
|
654
|
+
PRESETS_LINKED_BIN_OUTSIDE: {
|
|
655
|
+
why: "Linked dependency bin targets must stay inside the checkout.",
|
|
656
|
+
fix: "Point each bin entry of the linked package at a file inside the checkout."
|
|
657
|
+
},
|
|
658
|
+
PRESETS_LOCAL_DEPENDENCY_CONTENTS_INVALID: {
|
|
659
|
+
why: "Local dependency contents must be regular files and directories.",
|
|
660
|
+
fix: "Remove symbolic links, sockets, and other special files from the file: dependency directory."
|
|
661
|
+
},
|
|
662
|
+
PRESETS_LOCKFILE_MISSING: {
|
|
663
|
+
why: "Frozen dependency installation requires a supported lockfile.",
|
|
664
|
+
fix: "Commit pnpm-lock.yaml, package-lock.json, npm-shrinkwrap.json, or yarn.lock at the checkout root, or set install to false in the Babysitter options."
|
|
665
|
+
},
|
|
666
|
+
PRESETS_NPM_CONFIG_UNSUPPORTED: {
|
|
667
|
+
why: ({ key }) => `Unsupported project npm configuration: ${key}. Host-local configuration paths and package-manager extensions are not allowed.`,
|
|
668
|
+
fix: "Remove the setting that the message names from .npmrc. The host accepts only hoisting, peer, workspace, node-linker, and trust-policy settings."
|
|
669
|
+
},
|
|
670
|
+
PRESETS_NPM_VERSION_UNSUPPORTED: {
|
|
671
|
+
why: "Host installation requires npm 7 or newer; older npm can execute repository onload scripts.",
|
|
672
|
+
fix: "Set packageManager in package.json to npm 7 or newer, such as \"npm@11.6.3\"."
|
|
673
|
+
},
|
|
674
|
+
PRESETS_NPM_WORKSPACE_LINK_INVALID: {
|
|
675
|
+
why: "npm workspace links must reference checkout-relative paths.",
|
|
676
|
+
fix: "Run npm install in the checkout to write package-lock.json again, so that each link entry has a relative resolved path."
|
|
677
|
+
},
|
|
678
|
+
PRESETS_PACKAGE_MANAGER_UNSUPPORTED: {
|
|
679
|
+
why: "packageManager must select an official matching package-manager version.",
|
|
680
|
+
fix: "Set packageManager in package.json to <name>@<x.y.z> with an optional +sha hash, where <name> is the package manager of the committed lockfile, such as \"pnpm@10.34.6\"."
|
|
681
|
+
},
|
|
682
|
+
PRESETS_PNPM_CONFIG_UNSUPPORTED: {
|
|
683
|
+
why: ({ key }) => `Unsupported project pnpm configuration: ${key}. Host-local configuration paths and package-manager extensions are not allowed.`,
|
|
684
|
+
fix: "Remove the setting that the message names from pnpm-workspace.yaml, or give it a supported value. Boolean settings take true or false."
|
|
685
|
+
},
|
|
686
|
+
PRESETS_PULL_REQUEST_HEAD_CHANGED: {
|
|
687
|
+
why: ({ expected, actual }) => `Pull request head changed from ${expected} to ${actual}.`,
|
|
688
|
+
fix: "Read the pull request again and pass its current headSha to withPullRequestCheckout()."
|
|
689
|
+
},
|
|
690
|
+
PRESETS_PULL_REQUEST_HEAD_REF_INVALID: {
|
|
691
|
+
why: "A pull request headRef cannot start with a dash.",
|
|
692
|
+
fix: "Pass the branch name of the pull request head as headRef, without a leading dash."
|
|
693
|
+
},
|
|
694
|
+
PRESETS_PULL_REQUEST_HEAD_REF_MISSING: {
|
|
695
|
+
why: "A pull request headRef is required when headRepository is supplied.",
|
|
696
|
+
fix: "Pass headRef, the branch name of the pull request head, together with headRepository to withPullRequestCheckout()."
|
|
697
|
+
},
|
|
698
|
+
PRESETS_PULL_REQUEST_HEAD_SHA_INVALID: {
|
|
699
|
+
why: "A pull request headSha must be a full Git commit SHA.",
|
|
700
|
+
fix: "Pass the 40-character head commit SHA of the pull request as headSha."
|
|
701
|
+
},
|
|
702
|
+
PRESETS_PULL_REQUEST_PUSH_TARGET_MISSING: {
|
|
703
|
+
why: "Pull request source repository and branch are required to push.",
|
|
704
|
+
fix: "Pass headRepository and headRef of the pull request to withPullRequestCheckout() before you call push()."
|
|
705
|
+
},
|
|
706
|
+
PRESETS_PUSH_TARGET_HEAD_INVALID: {
|
|
707
|
+
why: "Push target did not return a full Git commit SHA.",
|
|
708
|
+
fix: "Commit your changes in the push target first, and use a SHA-1 Git repository."
|
|
709
|
+
},
|
|
710
|
+
PRESETS_PUSH_TARGET_INVALID: {
|
|
711
|
+
why: "Push target must be the root of its prepared Git checkout.",
|
|
712
|
+
fix: "Pass the root directory of the prepared checkout or workspace to push(), not a subdirectory."
|
|
713
|
+
},
|
|
714
|
+
PRESETS_YARN_LOCKFILE_INVALID: {
|
|
715
|
+
why: "Invalid Yarn lockfile stanza; dependency fields must be structured.",
|
|
716
|
+
fix: "Run yarn install in the checkout to write yarn.lock again, and commit the result."
|
|
717
|
+
},
|
|
718
|
+
PRESETS_YARN_OUTPUT_INVALID: {
|
|
719
|
+
why: "Yarn installation output must use a regular checkout directory.",
|
|
720
|
+
fix: "Make .yarn a regular directory in the checkout, not a file or a symbolic link."
|
|
721
|
+
},
|
|
722
|
+
PRESETS_YARN_PATCH_SELECTOR_INVALID: {
|
|
723
|
+
why: "Yarn dependency patches must use project-relative ~/ selectors; parent package filesystems cannot be fingerprinted by the host.",
|
|
724
|
+
fix: "Write each patch: path in the Yarn descriptor as ~/<path from the project root>, such as patch:pkg@npm:1.0.0#~/.yarn/patches/pkg.patch."
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
//#endregion
|
|
729
|
+
export { isRuntimeString as a, isRuntimeRecord as i, hasRuntimeType$1 as n, isRuntimeNumber as r, presetsErrorDiagnostics as t };
|