@farmslot/recipe-cli 0.8.0 → 0.9.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.
Files changed (97) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/harness/adapter-plugins.d.ts +1 -0
  3. package/dist/harness/adapter-plugins.d.ts.map +1 -1
  4. package/dist/harness/adapter-plugins.js +3 -0
  5. package/dist/harness/adapter-plugins.js.map +1 -1
  6. package/dist/harness/adapters.d.ts +0 -2
  7. package/dist/harness/adapters.d.ts.map +1 -1
  8. package/dist/harness/adapters.js +0 -4
  9. package/dist/harness/adapters.js.map +1 -1
  10. package/dist/harness/command-contract.d.ts +16 -1
  11. package/dist/harness/command-contract.d.ts.map +1 -1
  12. package/dist/harness/command-contract.js +8 -0
  13. package/dist/harness/command-contract.js.map +1 -1
  14. package/dist/harness/commands/call.d.ts.map +1 -1
  15. package/dist/harness/commands/call.js +30 -9
  16. package/dist/harness/commands/call.js.map +1 -1
  17. package/dist/harness/commands/checklist.d.ts +16 -0
  18. package/dist/harness/commands/checklist.d.ts.map +1 -0
  19. package/dist/harness/commands/checklist.js +171 -0
  20. package/dist/harness/commands/checklist.js.map +1 -0
  21. package/dist/harness/commands/doctor.d.ts +45 -0
  22. package/dist/harness/commands/doctor.d.ts.map +1 -0
  23. package/dist/harness/commands/doctor.js +591 -0
  24. package/dist/harness/commands/doctor.js.map +1 -0
  25. package/dist/harness/commands/execution-template.d.ts +2 -0
  26. package/dist/harness/commands/execution-template.d.ts.map +1 -0
  27. package/dist/harness/commands/execution-template.js +27 -0
  28. package/dist/harness/commands/execution-template.js.map +1 -0
  29. package/dist/harness/commands/launch.js +3 -0
  30. package/dist/harness/commands/launch.js.map +1 -1
  31. package/dist/harness/commands/prepare.d.ts +35 -0
  32. package/dist/harness/commands/prepare.d.ts.map +1 -0
  33. package/dist/harness/commands/prepare.js +570 -0
  34. package/dist/harness/commands/prepare.js.map +1 -0
  35. package/dist/harness/commands/recipe-quality.d.ts +13 -0
  36. package/dist/harness/commands/recipe-quality.d.ts.map +1 -0
  37. package/dist/harness/commands/recipe-quality.js +112 -0
  38. package/dist/harness/commands/recipe-quality.js.map +1 -0
  39. package/dist/harness/commands/run.d.ts.map +1 -1
  40. package/dist/harness/commands/run.js +13 -1
  41. package/dist/harness/commands/run.js.map +1 -1
  42. package/dist/harness/commands/status-watch.d.ts +20 -0
  43. package/dist/harness/commands/status-watch.d.ts.map +1 -0
  44. package/dist/harness/commands/status-watch.js +402 -0
  45. package/dist/harness/commands/status-watch.js.map +1 -0
  46. package/dist/harness/commands/status.d.ts +5 -0
  47. package/dist/harness/commands/status.d.ts.map +1 -0
  48. package/dist/harness/commands/status.js +167 -0
  49. package/dist/harness/commands/status.js.map +1 -0
  50. package/dist/harness/commands/task-init.d.ts +5 -0
  51. package/dist/harness/commands/task-init.d.ts.map +1 -0
  52. package/dist/harness/commands/task-init.js +54 -0
  53. package/dist/harness/commands/task-init.js.map +1 -0
  54. package/dist/harness/doctor-report.d.ts +58 -0
  55. package/dist/harness/doctor-report.d.ts.map +1 -0
  56. package/dist/harness/doctor-report.js +154 -0
  57. package/dist/harness/doctor-report.js.map +1 -0
  58. package/dist/harness/harness-cli.d.ts +10 -1
  59. package/dist/harness/harness-cli.d.ts.map +1 -1
  60. package/dist/harness/harness-cli.js +4 -6
  61. package/dist/harness/harness-cli.js.map +1 -1
  62. package/dist/harness/heal-bounds.d.ts.map +1 -1
  63. package/dist/harness/heal-bounds.js +6 -0
  64. package/dist/harness/heal-bounds.js.map +1 -1
  65. package/dist/harness/index.d.ts +15 -3
  66. package/dist/harness/index.d.ts.map +1 -1
  67. package/dist/harness/index.js +14 -2
  68. package/dist/harness/index.js.map +1 -1
  69. package/dist/harness/json-stream.d.ts +7 -1
  70. package/dist/harness/json-stream.d.ts.map +1 -1
  71. package/dist/harness/json-stream.js +12 -0
  72. package/dist/harness/json-stream.js.map +1 -1
  73. package/dist/harness/paths.d.ts +2 -0
  74. package/dist/harness/paths.d.ts.map +1 -1
  75. package/dist/harness/paths.js +2 -0
  76. package/dist/harness/paths.js.map +1 -1
  77. package/dist/harness/readiness.d.ts +31 -0
  78. package/dist/harness/readiness.d.ts.map +1 -0
  79. package/dist/harness/readiness.js +12 -0
  80. package/dist/harness/readiness.js.map +1 -0
  81. package/dist/harness/recording-target.d.ts +11 -0
  82. package/dist/harness/recording-target.d.ts.map +1 -1
  83. package/dist/harness/recording-target.js +31 -2
  84. package/dist/harness/recording-target.js.map +1 -1
  85. package/dist/harness/run-engine.d.ts.map +1 -1
  86. package/dist/harness/run-engine.js.map +1 -1
  87. package/dist/harness/run-options.js +2 -11
  88. package/dist/harness/run-options.js.map +1 -1
  89. package/dist/harness/stage-progress.d.ts +25 -0
  90. package/dist/harness/stage-progress.d.ts.map +1 -0
  91. package/dist/harness/stage-progress.js +162 -0
  92. package/dist/harness/stage-progress.js.map +1 -0
  93. package/dist/harness/task-view.d.ts +142 -0
  94. package/dist/harness/task-view.d.ts.map +1 -0
  95. package/dist/harness/task-view.js +451 -0
  96. package/dist/harness/task-view.js.map +1 -0
  97. package/package.json +2 -2
@@ -0,0 +1,591 @@
1
+ // doctor — readiness for a checkout without launching anything: the shared and
2
+ // platform checks, the runtime probe, the devices, and what to run next.
3
+ // --expect-live turns it into an exit-coded liveness gate; --print-ready prints
4
+ // only Farmslot's health.ready_indicator; --fix repairs what it can.
5
+ import { execFileSync } from 'node:child_process';
6
+ import fs from 'node:fs';
7
+ import { adapterPluginChecks } from '../adapter-plugins.js';
8
+ import { adapterDetectNext, adapterForPlatform, assertAdapter, detectAdapter, harnessAdapter, undetectedAdapterMessage, } from '../adapters.js';
9
+ import { acquireCheckoutLock } from '../checkout-lock.js';
10
+ import { color } from '../cli-color.js';
11
+ import { createDoctorReport, requiredDoctorCheckSummary, } from '../doctor-report.js';
12
+ import { ensureOverlay, newHealState, recipeRunning } from '../heal-bounds.js';
13
+ import { harnessHost, hostEnvName } from '../host.js';
14
+ import { resolveRuntimeContextPath } from '../overlay.js';
15
+ import { actionManifestPathOption, applyRuntimeDirOption, optionFlag, optionString, shellQuote, targetPath, } from '../parse-args.js';
16
+ import { adapterReadiness, renderFeatureFlagLine, } from '../readiness.js';
17
+ import { checkoutBusyOut, EXIT, usageOut } from '../shared.js';
18
+ import { createStageReporter } from '../stage-progress.js';
19
+ // --expect-live may carry the slot's ports on the flag line (hooks template
20
+ // {{cdp_port}}/{{port}}); apply them AFTER resolveSlotPorts so an explicit flag
21
+ // wins over the checkout/pool-resolved port, matching launch/run precedence. A
22
+ // CDP readiness probe only reaches CDP when CDP_PORT is set, so without this the
23
+ // liveness answer would fall back to "unverified" and fail closed.
24
+ function applyDoctorRuntimePorts(options) {
25
+ const cdpPort = optionString(options, 'cdpPort');
26
+ if (cdpPort) {
27
+ process.env.CDP_PORT = cdpPort;
28
+ process.env.RECIPE_CDP_PORT = cdpPort;
29
+ }
30
+ const watcherPort = optionString(options, 'watcherPort') ??
31
+ optionString(options, 'port') ??
32
+ optionString(options, 'metroPort');
33
+ if (watcherPort) {
34
+ process.env.WATCHER_PORT = watcherPort;
35
+ process.env.METRO_PORT = watcherPort;
36
+ process.env.RECIPE_WATCHER_PORT = watcherPort;
37
+ }
38
+ }
39
+ function executableName() {
40
+ const executable = process.env[hostEnvName('EXECUTABLE')];
41
+ return executable ? shellQuote(executable) : harnessHost().name;
42
+ }
43
+ export async function handleDoctor({ options }, commandOptions) {
44
+ applyRuntimeDirOption(options);
45
+ const host = harnessHost().name;
46
+ const target = targetPath(options);
47
+ const json = optionFlag(options, 'json');
48
+ const printReady = optionFlag(options, 'printReady');
49
+ // Farmslot health_check uses --print-ready alone; it implies the exit-coded live probe.
50
+ const expectLive = optionFlag(options, 'expectLive') || printReady;
51
+ const allDevices = optionFlag(options, 'allDevices');
52
+ const platformOption = optionString(options, 'platform');
53
+ const explicitAdapter = optionString(options, 'adapter') ?? adapterForPlatform(platformOption);
54
+ const adapter = explicitAdapter ?? detectAdapter(target);
55
+ if (!adapter) {
56
+ return usageOut(json, 'doctor', undetectedAdapterMessage(target), adapterDetectNext());
57
+ }
58
+ assertAdapter(adapter);
59
+ const surface = harnessAdapter(adapter);
60
+ const readiness = adapterReadiness(surface);
61
+ if (!fs.existsSync(target)) {
62
+ return usageOut(json, 'doctor', `target does not exist: ${target}`, `pass --target <${harnessHost().product.toLowerCase()}-checkout> pointing to an existing checkout`);
63
+ }
64
+ if (printReady && json) {
65
+ return usageOut(json, 'doctor', '--print-ready owns stdout for Farmslot health_check; drop --json (use --expect-live --json for the doctor envelope)', `${host} doctor --print-ready --adapter <adapter> --target <path>`);
66
+ }
67
+ const actionManifestPath = actionManifestPathOption(options, adapter);
68
+ const manifestValidation = await commandOptions.manifest(adapter, optionString(options, 'actionManifest'));
69
+ const flags = commandOptions.featureFlags;
70
+ const orphanField = commandOptions.orphanDevServers?.field ?? 'orphanDevServers';
71
+ const orphanLabel = commandOptions.orphanDevServers?.label ?? 'orphan dev server';
72
+ if (optionFlag(options, 'fix')) {
73
+ surface.resolveSlotPorts(target);
74
+ const preview = commandOptions.previewDevice?.('doctor', adapter, options);
75
+ if (preview && !preview.ok) {
76
+ return usageOut(json, 'doctor', preview.message, preview.userAction);
77
+ }
78
+ applyDoctorRuntimePorts(options);
79
+ const lock = acquireCheckoutLock(target, 'doctor-fix');
80
+ if ('message' in lock) {
81
+ return checkoutBusyOut(json, 'doctor', lock.message, lock.path);
82
+ }
83
+ let fixed;
84
+ let failed;
85
+ try {
86
+ ({ fixed, failed } = await runDoctorFix(adapter, target, manifestValidation, json, commandOptions.fix));
87
+ }
88
+ finally {
89
+ lock.release();
90
+ }
91
+ const result = createDoctorReport(adapter, target, manifestValidation, actionManifestPath, undefined, commandOptions.report);
92
+ let runtime;
93
+ let runtimeProbeError;
94
+ try {
95
+ runtime = await surface.runtimeStatus(target);
96
+ }
97
+ catch (error) {
98
+ runtimeProbeError = error instanceof Error ? error.message : String(error);
99
+ }
100
+ const ready = runtime?.decision === 'ready';
101
+ const block = readiness.runtimeBlock?.(target, runtime);
102
+ if (block)
103
+ failed.push(block.id);
104
+ const nextActions = doctorFixNextActions(failed, adapter, target, block, commandOptions.fix);
105
+ if (failed.length === 0 && !ready && runtime?.nextAction)
106
+ nextActions.push(runtime.nextAction);
107
+ const status = result.status === 'pass' && failed.length === 0 ? 'pass' : 'fail';
108
+ const retryDoctor = `${host} doctor --fix --adapter ${adapter} --target ${shellQuote(target)} --json`;
109
+ const fixUserAction = commandOptions.fix?.userAction?.(failed, retryDoctor) ?? nextActions[0] ?? retryDoctor;
110
+ const error = status === 'fail'
111
+ ? {
112
+ code: 'DOCTOR_FIX_INCOMPLETE',
113
+ message: 'doctor --fix could not make every required check pass',
114
+ userAction: fixUserAction,
115
+ }
116
+ : undefined;
117
+ if (json)
118
+ console.log(JSON.stringify({
119
+ ...result,
120
+ status,
121
+ fixed,
122
+ failed,
123
+ ready,
124
+ runtime,
125
+ ...(runtimeProbeError ? { runtimeProbeError } : {}),
126
+ nextActions,
127
+ ...(error ? { error } : {}),
128
+ }, null, 2));
129
+ else {
130
+ const mode = typeof result.compatibilityMode === 'string' ? ` ${result.compatibilityMode}` : '';
131
+ console.log(`${status} ${adapter}${mode} ready=${ready} manifest=${actionManifestPath} fixed=[${fixed.join(',')}] failed=[${failed.join(',')}]`);
132
+ if (runtime) {
133
+ console.log(`runtime: decision=${runtime.decision}${runtime.reasonCode ? ` (${runtime.reasonCode})` : ''}`);
134
+ for (const reason of runtime.reasons)
135
+ console.log(` ${reason}`);
136
+ }
137
+ else if (runtimeProbeError) {
138
+ console.log(`runtime probe failed: ${runtimeProbeError}`);
139
+ }
140
+ for (const action of nextActions)
141
+ console.error(` Next: ${action}`);
142
+ }
143
+ return status === 'pass' ? 0 : 1;
144
+ }
145
+ const result = createDoctorReport(adapter, target, manifestValidation, actionManifestPath, platformOption, commandOptions.report);
146
+ // Before the slot-port resolve below, which hydrates the env from the context
147
+ // file and would make every file value look like a live env override.
148
+ const view = commandOptions.checkoutView?.(target, adapter);
149
+ const missingRequiredTool = result.checks.find((check) => check.required &&
150
+ check.status === 'fail' &&
151
+ check.id.startsWith('device-tool-') &&
152
+ check.userAction);
153
+ if (missingRequiredTool) {
154
+ const error = {
155
+ code: 'DOCTOR_CHECKS_FAILED',
156
+ message: missingRequiredTool.message,
157
+ userAction: missingRequiredTool.userAction,
158
+ };
159
+ if (json) {
160
+ console.log(JSON.stringify({ ...result, ready: false, error }, null, 2));
161
+ }
162
+ else {
163
+ console.error(`✗ doctor: ${error.message}\n Next: ${error.userAction}`);
164
+ }
165
+ return EXIT.runtime;
166
+ }
167
+ let runtime;
168
+ let runtimeProbeError;
169
+ try {
170
+ surface.resolveSlotPorts(target);
171
+ // doctor previews the same device run/call would use, and the host refuses
172
+ // device options a platform has no devices for.
173
+ const preview = commandOptions.previewDevice?.('doctor', adapter, options);
174
+ if (preview && !preview.ok) {
175
+ if (json)
176
+ console.log(JSON.stringify({
177
+ schemaVersion: 1,
178
+ command: 'doctor',
179
+ adapter,
180
+ target,
181
+ error: {
182
+ code: preview.code,
183
+ message: preview.message,
184
+ userAction: preview.userAction,
185
+ },
186
+ }, null, 2));
187
+ else
188
+ console.error(`✗ doctor: ${preview.message}\n Next: ${preview.userAction}`);
189
+ return EXIT.usage;
190
+ }
191
+ applyDoctorRuntimePorts(options);
192
+ runtime = await surface.runtimeStatus(target);
193
+ }
194
+ catch (error) {
195
+ runtimeProbeError = error instanceof Error ? error.message : String(error);
196
+ }
197
+ const runtimeCheck = doctorRuntimeCheck(runtime, runtimeProbeError, expectLive);
198
+ const checks = [
199
+ ...result.checks,
200
+ runtimeCheck,
201
+ ...((await readiness.liveChecks?.(target)) ?? []),
202
+ ...(await platformDoctorChecks(adapter, target)),
203
+ // Which library plugin code this process loaded: library, module and digest.
204
+ ...adapterPluginChecks(),
205
+ ];
206
+ const requiredChecks = requiredDoctorCheckSummary(checks);
207
+ const doctorResult = {
208
+ ...result,
209
+ status: requiredChecks.status,
210
+ checks,
211
+ requiredChecks,
212
+ };
213
+ // Dev servers a killed/superseded launch left behind on other ports. doctor
214
+ // surfaces them (stop reaps them) so they never silently pile up.
215
+ const orphans = readiness.orphanDevServers?.(target, process.env.WATCHER_PORT) ?? [];
216
+ // Screen-Recording / capture readiness (macOS): shell the capture-helper doctor
217
+ // so a denied Screen-Recording grant surfaces as a WARN with the grant step,
218
+ // rather than only failing later inside ui.screenshot/--record.
219
+ const capture = captureHealth(readiness.captureProviders);
220
+ // The connected devices (id/name/state + which one is the selected target), so
221
+ // operators see what run/call would target. A platform without devices has none.
222
+ const deviceSource = await readiness.devices?.();
223
+ const deviceView = deviceSource ? deviceSource.view(allDevices) : null;
224
+ const liveView = deviceSource && deviceView ? await deviceSource.live(target, deviceView) : null;
225
+ const devices = liveView?.devicesWithLive ?? deviceView?.devices ?? [];
226
+ const additionalReachableDevices = liveView?.additionalReachableDevices ?? [];
227
+ const discovery = deviceView?.deviceDiscoveryErrors.length
228
+ ? { deviceDiscoveryErrors: deviceView.deviceDiscoveryErrors }
229
+ : {};
230
+ // --expect-live: exit-coded liveness gate (prepare recovery, scripts that only need pass/fail).
231
+ // --print-ready: Farmslot health_check mode — implies --expect-live and prints
232
+ // the platform's ready indicator on stdout.
233
+ if (expectLive) {
234
+ return emitExpectLive({
235
+ adapter,
236
+ target,
237
+ runtime,
238
+ result: doctorResult,
239
+ orphans: { [orphanField]: orphans },
240
+ capture,
241
+ devices,
242
+ additionalReachableDevices,
243
+ json,
244
+ printReady,
245
+ discovery,
246
+ });
247
+ }
248
+ const advisory = commandOptions.advisory?.(target) ?? [];
249
+ // Which A/B variant this slot is currently pinned to: a pinned record is a
250
+ // file read; otherwise the live device probe that already ran above answers
251
+ // (doctor and status are held to one probe each). `null` is "no runtime
252
+ // answered", rendered as (no runtime), never as 0 overrides.
253
+ const pinnedFlags = readiness.pinnedFlags?.(target) ?? null;
254
+ const featureFlags = flags
255
+ ? pinnedFlags
256
+ ? flags.report(pinnedFlags.overrides, pinnedFlags)
257
+ : flags.report(liveView?.featureFlags ?? null)
258
+ : undefined;
259
+ const doctorUserAction = doctorResult.checks.find((check) => check.required && check.status === 'fail' && check.userAction)?.userAction ??
260
+ `${host} doctor --fix --adapter ${adapter} --target ${shellQuote(target)} --json`;
261
+ const doctorError = doctorResult.status === 'fail'
262
+ ? {
263
+ code: 'DOCTOR_CHECKS_FAILED',
264
+ message: 'one or more required doctor checks failed',
265
+ userAction: doctorUserAction,
266
+ }
267
+ : undefined;
268
+ const next = doctorError?.userAction ??
269
+ discovery.deviceDiscoveryErrors?.[0]?.userAction ??
270
+ (runtime?.decision === 'ready' ? undefined : runtime?.nextAction);
271
+ if (json) {
272
+ console.log(JSON.stringify({
273
+ ...doctorResult,
274
+ ready: runtime?.decision === 'ready',
275
+ runtime,
276
+ ...(view ? { view: view.json } : {}),
277
+ [orphanField]: orphans,
278
+ capture,
279
+ ...Object.fromEntries(advisory.map((section) => [section.key, section.value])),
280
+ ...(featureFlags ? { featureFlags } : {}),
281
+ devices,
282
+ additionalReachableDevices,
283
+ ...discovery,
284
+ ...(next ? { next } : {}),
285
+ ...(doctorError ? { error: doctorError } : {}),
286
+ }, null, 2));
287
+ }
288
+ else {
289
+ const out = (style, text) => color(style, text, { stream: process.stdout });
290
+ const stateStyle = (value, good) => value === good ? 'ok' : 'warn';
291
+ const mode = typeof doctorResult.compatibilityMode === 'string'
292
+ ? ` ${doctorResult.compatibilityMode}`
293
+ : '';
294
+ console.log(`${out(doctorResult.status === 'pass' ? 'ok' : 'err', doctorResult.status)} ${out('bold', adapter)}${mode} ${out('dim', `manifest=${actionManifestPath}`)}`);
295
+ console.log(`${out('label', 'harness:')} ${doctorResult.runner.packageName}@${doctorResult.runner.version} ` +
296
+ `${out('accent', doctorResult.runner.installKind)} ${out('dim', `executable=${doctorResult.runner.executablePath}`)}`);
297
+ if (runtime) {
298
+ const provisionedDepsPending = runtime.reasonCode === 'app-installed-deps-pending';
299
+ const decisionStyle = provisionedDepsPending
300
+ ? 'info'
301
+ : runtime.decision === 'ready'
302
+ ? 'ok'
303
+ : runtime.decision === 'blocked'
304
+ ? 'err'
305
+ : 'warn';
306
+ const depsStyle = provisionedDepsPending ? 'info' : stateStyle(runtime.deps, 'current');
307
+ const devServerStyle = provisionedDepsPending ? 'info' : undefined;
308
+ const devServer = runtime.devServer
309
+ ? ` ${runtime.devServer.label}=${out(devServerStyle ?? stateStyle(runtime.devServer.status, 'up'), runtime.devServer.status)}`
310
+ : '';
311
+ console.log(`${out('label', 'runtime:')} decision=${out(decisionStyle, runtime.decision)}${runtime.reasonCode ? ` ${out('dim', `(${runtime.reasonCode})`)}` : ''} deps=${out(depsStyle, runtime.deps ?? 'unknown')}${devServer}`);
312
+ for (const reason of runtime.reasons)
313
+ console.log(` ${out('dim', reason)}`);
314
+ }
315
+ else if (runtimeProbeError) {
316
+ console.log(`${out('err', 'runtime probe failed:')} ${out('dim', runtimeProbeError)}`);
317
+ }
318
+ if (view)
319
+ console.log(view.text);
320
+ if (featureFlags)
321
+ renderFeatureFlagLine(featureFlags, out);
322
+ for (const line of readiness.lines?.(target) ?? [])
323
+ console.log(line);
324
+ if (orphans.length > 0) {
325
+ console.log(`${out('warn', `${orphanLabel}:`)} ${orphans.length} leaked bundler(s) for this checkout (pids ${orphans.join(', ')})`);
326
+ console.log(` ${out('dim', `Next: ${host} stop # reaps every bundler this checkout leaked`)}`);
327
+ }
328
+ if (capture)
329
+ renderCaptureHealth(capture, out);
330
+ for (const section of advisory)
331
+ section.render(out);
332
+ if (deviceSource) {
333
+ if (deviceView)
334
+ deviceSource.renderList(deviceView, out);
335
+ if (additionalReachableDevices.length > 0)
336
+ deviceSource.renderAdditional(additionalReachableDevices, out);
337
+ if (liveView)
338
+ deviceSource.renderLive(deviceView?.devices ?? [], liveView.liveMap, out);
339
+ }
340
+ if (next)
341
+ console.log(` ${out('dim', `Next: ${next}`)}`);
342
+ }
343
+ return doctorResult.status === 'pass' ? 0 : 1;
344
+ }
345
+ // The platform's own checks (a library plugin's, and what it extends). Checks
346
+ // that throw are a required failure in the report, not a crash.
347
+ async function platformDoctorChecks(adapter, target) {
348
+ try {
349
+ return (await harnessAdapter(adapter).doctor?.(target)) ?? [];
350
+ }
351
+ catch (error) {
352
+ return [
353
+ {
354
+ id: `adapter-plugin:${adapter}:doctor`,
355
+ status: 'fail',
356
+ required: true,
357
+ message: `${adapter}'s doctor checks failed to run.`,
358
+ detail: error instanceof Error ? error.message : String(error),
359
+ userAction: `fix the doctor() of the ${adapter} adapter, then rerun ${harnessHost().name} doctor --adapter ${adapter}`,
360
+ },
361
+ ];
362
+ }
363
+ }
364
+ function doctorRuntimeCheck(runtime, error, expectLive) {
365
+ if (error) {
366
+ return {
367
+ id: 'runtime',
368
+ status: 'fail',
369
+ required: true,
370
+ message: 'Runtime readiness probe failed.',
371
+ detail: error,
372
+ };
373
+ }
374
+ const ready = runtime?.decision === 'ready';
375
+ return {
376
+ id: 'runtime',
377
+ status: ready ? 'pass' : 'fail',
378
+ required: expectLive,
379
+ message: ready
380
+ ? 'Runtime is ready.'
381
+ : `Runtime is not ready${runtime?.reasonCode ? ` (${runtime.reasonCode})` : '.'}`,
382
+ detail: runtime?.reasons.join(' | ') || 'Runtime readiness probe returned no result.',
383
+ };
384
+ }
385
+ // Recovery commands embed the resolved --adapter and absolute --target so each
386
+ // runs verbatim from any cwd without relying on adapter re-detection. They are
387
+ // prefixed with the resolved executable (<PREFIX>_EXECUTABLE, set by the host's
388
+ // bin) so they also run in task-local installs where the host is not on PATH;
389
+ // the host name is the fallback only for direct helper invocations.
390
+ export function doctorFixNextActions(failed, adapter, target,
391
+ // The platform's runtime block (readiness.runtimeBlock), when doctor found one.
392
+ block, fix) {
393
+ const executable = executableName();
394
+ const scope = `--adapter ${adapter} --target ${shellQuote(target)}`;
395
+ const actions = [
396
+ ...(fix?.nextActions?.(failed, { adapter, target, executable, scope }) ?? []),
397
+ ];
398
+ if (failed.includes('runtime-context')) {
399
+ actions.push(`inspect ${shellQuote(resolveRuntimeContextPath(target))}, then retry ${executable} doctor --fix ${scope}`);
400
+ }
401
+ if (failed.includes('overlay'))
402
+ actions.push(`${executable} install ${scope}`);
403
+ if (block?.userAction && failed.includes(block.id))
404
+ actions.push(block.userAction);
405
+ return actions;
406
+ }
407
+ // Print a teaching stderr escape for --expect-live / --print-ready failures.
408
+ function emitExpectLiveVerdict(adapter, target, runtime, verdict) {
409
+ const out = (style, text) => color(style, text, { stream: process.stderr });
410
+ const detail = runtime
411
+ ? `${runtime.decision}${runtime.reasonCode ? ` (${runtime.reasonCode})` : ''}`
412
+ : 'runtime probe unavailable';
413
+ console.error(`${out('err', verdict)} ${out('bold', adapter)} ${detail} ${out('dim', target)}`);
414
+ for (const reason of runtime?.reasons ?? [])
415
+ console.error(` ${out('dim', reason)}`);
416
+ console.error(` Next: ${runtime?.nextAction ?? harnessAdapter(adapter).hints.runtimeProbeRecovery(target)}`);
417
+ }
418
+ // Emit the --expect-live answer: with --json the doctor envelope goes to stdout and
419
+ // the exit code carries the live answer; with --print-ready stdout is only the
420
+ // Farmslot ready_indicator line. Fail closed when the runtime probe is unavailable.
421
+ function emitExpectLive(input) {
422
+ const { adapter, target, runtime, json, printReady } = input;
423
+ const live = runtime?.decision === 'ready';
424
+ if (printReady) {
425
+ if (live) {
426
+ // A platform without an indicator is never ready for Farmslot's health check.
427
+ const indicator = adapterReadiness(harnessAdapter(adapter)).readyIndicator?.(input.devices) ?? '';
428
+ if (indicator) {
429
+ console.log(indicator);
430
+ return EXIT.ok;
431
+ }
432
+ emitExpectLiveVerdict(adapter, target, runtime, 'not-ready');
433
+ return EXIT.runtime;
434
+ }
435
+ emitExpectLiveVerdict(adapter, target, runtime, 'not-live');
436
+ return EXIT.runtime;
437
+ }
438
+ if (json) {
439
+ const userAction = runtime?.nextAction ?? harnessAdapter(adapter).hints.runtimeProbeRecovery(target);
440
+ const error = live
441
+ ? undefined
442
+ : { code: 'RUNTIME_NOT_LIVE', message: `${adapter} runtime is not live`, userAction };
443
+ console.log(JSON.stringify({
444
+ ...input.result,
445
+ ready: live,
446
+ runtime,
447
+ ...input.orphans,
448
+ capture: input.capture,
449
+ devices: input.devices,
450
+ additionalReachableDevices: input.additionalReachableDevices,
451
+ ...input.discovery,
452
+ ...(error ? { error } : {}),
453
+ }, null, 2));
454
+ return live ? EXIT.ok : EXIT.runtime;
455
+ }
456
+ const out = (style, text) => color(style, text, { stream: process.stdout });
457
+ if (live) {
458
+ console.log(`${out('ok', 'live')} ${out('bold', adapter)} runtime ready`);
459
+ return EXIT.ok;
460
+ }
461
+ emitExpectLiveVerdict(adapter, target, runtime, 'not-live');
462
+ return EXIT.runtime;
463
+ }
464
+ function captureHealth(providers) {
465
+ if (!providers)
466
+ return null;
467
+ const fallback = [...providers];
468
+ const helper = captureHelperHealth();
469
+ if (!helper) {
470
+ return {
471
+ status: 'fallback',
472
+ failing: [],
473
+ screenshots: { available: true, providers: fallback },
474
+ recording: { available: false, provider: null },
475
+ };
476
+ }
477
+ return {
478
+ status: helper.status,
479
+ failing: helper.failing,
480
+ screenshots: { available: true, providers: ['capture-helper', ...fallback] },
481
+ recording: {
482
+ available: helper.status === 'pass',
483
+ provider: helper.status === 'pass' ? 'capture-helper' : null,
484
+ },
485
+ };
486
+ }
487
+ function captureHelperHealth() {
488
+ if (process.platform !== 'darwin')
489
+ return null;
490
+ const bin = process.env.CAPTURE_HELPER_PATH || 'capture-helper';
491
+ try {
492
+ const out = execFileSync(bin, ['doctor', '--json'], {
493
+ encoding: 'utf8',
494
+ timeout: 10000,
495
+ stdio: ['ignore', 'pipe', 'ignore'],
496
+ });
497
+ const parsed = JSON.parse(out);
498
+ const failing = (parsed.checks ?? [])
499
+ .filter((c) => c.required === true && c.ok === false)
500
+ .map((c) => c.name ?? c.id ?? 'check');
501
+ return { status: parsed.ok === true && failing.length === 0 ? 'pass' : 'warn', failing };
502
+ }
503
+ catch {
504
+ return null;
505
+ }
506
+ }
507
+ function renderCaptureHealth(capture, out) {
508
+ const video = capture.recording.available ? 'capture-helper' : 'unavailable';
509
+ console.log(`${out('label', 'capture:')} ${out(capture.status === 'pass' ? 'ok' : 'warn', capture.status)} ` +
510
+ `${out('dim', `(screenshots: ${capture.screenshots.providers.join(' → ')}; video: ${video})`)}`);
511
+ if (capture.status === 'warn') {
512
+ if (capture.failing.length > 0)
513
+ console.log(` ${out('dim', `failing: ${capture.failing.join(', ')}`)}`);
514
+ console.log(` ${out('dim', 'Next: grant Screen Recording (System Settings → Privacy & Security → Screen Recording), or run: capture-helper doctor --open-permissions')}`);
515
+ }
516
+ else if (capture.status === 'fallback') {
517
+ console.log(` ${out('dim', 'Next: screenshots work without capture-helper; install/configure capture-helper only when recipe video is required')}`);
518
+ }
519
+ }
520
+ async function runDoctorFix(adapter, target, manifestValidation, json, fix) {
521
+ const fixed = [];
522
+ const failed = [];
523
+ if (recipeRunning(target)) {
524
+ failed.push('recipe-running');
525
+ return { fixed, failed };
526
+ }
527
+ if (Number(manifestValidation.summary?.errors ?? 0) > 0)
528
+ failed.push('manifest');
529
+ // One stage per fix, on stderr, so a slow repair shows which one is running.
530
+ const repairs = adapterReadiness(harnessAdapter(adapter)).fixes ?? [];
531
+ const stages = createStageReporter();
532
+ const total = 2 + repairs.length + (fix?.repair ? 1 : 0);
533
+ let index = 0;
534
+ const stage = (name) => stages.stage(name, { index: ++index, total });
535
+ const reason = (error) => (error instanceof Error ? error.message : String(error));
536
+ try {
537
+ const contextStage = stage('runtime-context');
538
+ try {
539
+ harnessAdapter(adapter).resolveSlotPorts(target);
540
+ const runtimeContext = fix?.ensureRuntimeContext?.(target, adapter);
541
+ if (runtimeContext?.created)
542
+ fixed.push('runtime-context');
543
+ contextStage.done(runtimeContext?.created ? 'created' : undefined);
544
+ }
545
+ catch (error) {
546
+ failed.push('runtime-context');
547
+ contextStage.failed(reason(error));
548
+ }
549
+ for (const repair of repairs) {
550
+ const repairStage = stage(repair.id);
551
+ try {
552
+ const repaired = await repair.apply(target);
553
+ if (repaired)
554
+ fixed.push(repair.id);
555
+ repairStage.done(repaired ? 'fixed' : undefined);
556
+ }
557
+ catch (error) {
558
+ failed.push(repair.id);
559
+ repairStage.failed(reason(error));
560
+ }
561
+ }
562
+ const overlayStage = stage('overlay');
563
+ const state = newHealState();
564
+ const ensured = await ensureOverlay(adapter, target, 'infra-only', state, json);
565
+ if (!ensured.ok) {
566
+ failed.push('overlay');
567
+ overlayStage.failed(ensured.error);
568
+ }
569
+ else {
570
+ if (state.mutations.length > 0)
571
+ fixed.push('overlay');
572
+ overlayStage.done(state.mutations.length > 0 ? 'installed' : undefined);
573
+ }
574
+ const hostStage = fix?.repair ? stage('host repair') : undefined;
575
+ const host = fix?.repair?.(target, adapter, json);
576
+ if (host) {
577
+ fixed.push(...host.fixed);
578
+ failed.push(...host.failed);
579
+ if (host.failed.length > 0)
580
+ hostStage?.failed(host.failed.join(', '));
581
+ else
582
+ hostStage?.done(host.fixed.length > 0 ? `fixed ${host.fixed.join(', ')}` : undefined);
583
+ }
584
+ }
585
+ finally {
586
+ // A fix that threw leaves its stage open; end it with the command.
587
+ stages.close('failed', 'doctor --fix stopped');
588
+ }
589
+ return { fixed, failed };
590
+ }
591
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../src/harness/commands/doctor.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,yEAAyE;AACzE,gFAAgF;AAChF,qEAAqE;AAErE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,SAAS,CAAC;AAIzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,cAAc,EACd,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,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AO,EAAE,IAAI,CAAC,CAAC;QAClD,IAAI,IAAI,EAAE,CAAC;YACT,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5B,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;gBAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;;gBACjE,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC;YAAS,CAAC;QACT,mEAAmE;QACnE,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function handleExecutionTemplate(argv: string[]): Promise<number>;
2
+ //# sourceMappingURL=execution-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-template.d.ts","sourceRoot":"","sources":["../../../src/harness/commands/execution-template.ts"],"names":[],"mappings":"AASA,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAuB7E"}