@farmslot/recipe-cli 0.5.0 → 0.7.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 (53) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +11 -11
  3. package/dist/harness/acceptance-ledger.d.ts +18 -0
  4. package/dist/harness/acceptance-ledger.d.ts.map +1 -0
  5. package/dist/harness/acceptance-ledger.js +119 -0
  6. package/dist/harness/acceptance-ledger.js.map +1 -0
  7. package/dist/harness/adapter-plugins.d.ts +105 -0
  8. package/dist/harness/adapter-plugins.d.ts.map +1 -0
  9. package/dist/harness/adapter-plugins.js +388 -0
  10. package/dist/harness/adapter-plugins.js.map +1 -0
  11. package/dist/harness/command-contract.d.ts +69 -0
  12. package/dist/harness/command-contract.d.ts.map +1 -0
  13. package/dist/harness/command-contract.js +243 -0
  14. package/dist/harness/command-contract.js.map +1 -0
  15. package/dist/harness/commands/call.d.ts.map +1 -1
  16. package/dist/harness/commands/call.js +131 -127
  17. package/dist/harness/commands/call.js.map +1 -1
  18. package/dist/harness/commands/run.d.ts.map +1 -1
  19. package/dist/harness/commands/run.js +158 -125
  20. package/dist/harness/commands/run.js.map +1 -1
  21. package/dist/harness/harness-cli.d.ts +82 -0
  22. package/dist/harness/harness-cli.d.ts.map +1 -0
  23. package/dist/harness/harness-cli.js +319 -0
  24. package/dist/harness/harness-cli.js.map +1 -0
  25. package/dist/harness/index.d.ts +6 -3
  26. package/dist/harness/index.d.ts.map +1 -1
  27. package/dist/harness/index.js +5 -2
  28. package/dist/harness/index.js.map +1 -1
  29. package/dist/harness/live-adapter-contract.d.ts +9 -0
  30. package/dist/harness/live-adapter-contract.d.ts.map +1 -1
  31. package/dist/harness/live-adapter-contract.js +38 -7
  32. package/dist/harness/live-adapter-contract.js.map +1 -1
  33. package/dist/harness/network-observation.d.ts +1 -4
  34. package/dist/harness/network-observation.d.ts.map +1 -1
  35. package/dist/harness/network-observation.js +3 -8
  36. package/dist/harness/network-observation.js.map +1 -1
  37. package/dist/harness/plugin-imports.d.ts +23 -0
  38. package/dist/harness/plugin-imports.d.ts.map +1 -0
  39. package/dist/harness/plugin-imports.js +126 -0
  40. package/dist/harness/plugin-imports.js.map +1 -0
  41. package/dist/harness/recipe-validation.d.ts +2 -0
  42. package/dist/harness/recipe-validation.d.ts.map +1 -1
  43. package/dist/harness/recipe-validation.js +42 -0
  44. package/dist/harness/recipe-validation.js.map +1 -1
  45. package/dist/harness/run-engine.d.ts +27 -8
  46. package/dist/harness/run-engine.d.ts.map +1 -1
  47. package/dist/harness/run-engine.js +86 -86
  48. package/dist/harness/run-engine.js.map +1 -1
  49. package/dist/harness/run-observers.d.ts +1 -4
  50. package/dist/harness/run-observers.d.ts.map +1 -1
  51. package/dist/harness/run-observers.js +6 -3
  52. package/dist/harness/run-observers.js.map +1 -1
  53. package/package.json +3 -3
@@ -0,0 +1,82 @@
1
+ import type { AdapterRegistry } from '@farmslot/adapter-sdk';
2
+ import { type AdapterLoadOptions } from './adapter-plugins.js';
3
+ import type { RecipeCatalog } from './catalog.js';
4
+ import { type CommandContract } from './command-contract.js';
5
+ import { type HarnessHostConfig } from './host.js';
6
+ interface CommandBase {
7
+ name: string;
8
+ /** `now`: process.exit(code) at once. `code`: set process.exitCode and let open work drain. */
9
+ exit?: 'now' | 'code';
10
+ /** Whether the host's `beforeDispatch` hook runs for this command. Default true. */
11
+ nudge?: boolean;
12
+ /** `argv` is everything after the command token. A thrown error exits with its `exitCode`, else 1. */
13
+ run(argv: string[]): number | Promise<number>;
14
+ }
15
+ /** A command the grouped help lists and the public grammar checks. Default exit: `code`. */
16
+ export interface PublicHarnessCommand extends CommandBase {
17
+ hidden?: false;
18
+ aliases?: readonly string[];
19
+ summary: string;
20
+ example: string;
21
+ /** Printed for `<command> --help`. */
22
+ helpText: string;
23
+ contract: CommandContract;
24
+ /** Runs before the grammar check, library hydration and commander (a bootstrap command). */
25
+ raw?: boolean;
26
+ }
27
+ /** Real routing absent from the help, with its own private grammar. Default exit: `now`. */
28
+ export interface HiddenHarnessCommand extends CommandBase {
29
+ hidden: true;
30
+ }
31
+ export type HarnessCommand = PublicHarnessCommand | HiddenHarnessCommand;
32
+ export type HelpPaint = (style: string, text: string) => string;
33
+ export interface HarnessHelpGroup {
34
+ title: string;
35
+ blurb: string;
36
+ commands: readonly string[];
37
+ }
38
+ export interface HarnessHelp {
39
+ /** The commander program description. */
40
+ description: string;
41
+ /** The lines above the groups. */
42
+ intro(paint: HelpPaint): string[];
43
+ groups: readonly HarnessHelpGroup[];
44
+ /** The lines below the groups, after one blank line. */
45
+ footer(paint: HelpPaint): string[];
46
+ /** The adapter a runtime context's `platform` names, when it is not an adapter id. */
47
+ slotAdapter?(platform: string): string | undefined;
48
+ }
49
+ export interface HarnessCliOptions {
50
+ host: HarnessHostConfig;
51
+ adapters: AdapterRegistry;
52
+ /** Makes every library this machine resolves visible (RECIPE_LIBRARY_PATH) before dispatch. */
53
+ libraries?: {
54
+ hydrate(target: string): Promise<void>;
55
+ };
56
+ /** Public commands in the order "Valid commands" lists them, plus hidden ones. */
57
+ commands: readonly HarnessCommand[];
58
+ help: HarnessHelp;
59
+ /** Runs once per invocation before any command (an update nudge). */
60
+ beforeDispatch?(argv: readonly string[]): void;
61
+ /** When set, `call <action> --help` renders the action's fields above call's help. */
62
+ catalog?: RecipeCatalog;
63
+ /** Turns a library-declared adapter into the host's adapter before it registers. */
64
+ adopt?: AdapterLoadOptions['adopt'];
65
+ /** Libraries the host configures (a config file), searched after the others for adapters. */
66
+ configuredLibraries?(): AdapterLoadOptions['configured'];
67
+ /** Retired option spellings and their replacements, for the unknown-option suggestion. */
68
+ replacedOptions?: Readonly<Record<string, string>>;
69
+ }
70
+ export interface HarnessCliResult {
71
+ exitCode: number;
72
+ exit: 'now' | 'code';
73
+ }
74
+ export interface HarnessCli {
75
+ /** Parse and dispatch `argv` (without node and script); never exits the process. */
76
+ main(argv: readonly string[]): Promise<HarnessCliResult>;
77
+ /** `main(process.argv.slice(2))`, then exit as the command asked. */
78
+ run(argv?: readonly string[]): Promise<void>;
79
+ }
80
+ export declare function createHarnessCli(options: HarnessCliOptions): HarnessCli;
81
+ export {};
82
+ //# sourceMappingURL=harness-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"harness-cli.d.ts","sourceRoot":"","sources":["../../src/harness/harness-cli.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAM7D,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAwB,KAAK,iBAAiB,EAAe,MAAM,WAAW,CAAC;AAMtF,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,+FAA+F;IAC/F,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACtB,oFAAoF;IACpF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sGAAsG;IACtG,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/C;AAED,4FAA4F;AAC5F,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,4FAA4F;IAC5F,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,4FAA4F;AAC5F,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD,MAAM,EAAE,IAAI,CAAC;C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CAAC;IACzD,0FAA0F;IAC1F,eAAe,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,oFAAoF;IACpF,IAAI,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACzD,qEAAqE;IACrE,GAAG,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9C;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAkIvE"}
@@ -0,0 +1,319 @@
1
+ // createHarnessCli: the generic front door a product harness presets. It owns
2
+ // the commander program, grouped and per-command help, the version line, the
3
+ // strict public grammar, library hydration and dispatch; the host supplies its
4
+ // identity, adapters, commands and help prose.
5
+ import fs from 'node:fs';
6
+ import path from 'node:path';
7
+ import { Command, CommanderError } from 'commander';
8
+ import { RecipeTrustError } from '@farmslot/recipe-runner';
9
+ import { RECIPE_CLI_VERSION } from '../version.js';
10
+ import { handleCallHelp } from './commands/call.js';
11
+ import { AdapterPluginError, adapterSelectionFailureOut, ensureAdapterLoaded, selectedAdapterId, } from './adapter-plugins.js';
12
+ import { configureHarnessAdapters, detectAdapter, harnessAdapter } from './adapters.js';
13
+ import { color } from './cli-color.js';
14
+ import { optionValues, validatePublicInvocation, } from './command-contract.js';
15
+ import { withCommandJournal } from './command-journal.js';
16
+ import { configureHarnessHost, hostEnvName } from './host.js';
17
+ import { JsonStreamWriter } from './json-stream.js';
18
+ import { DEFAULT_RECIPE_RUNTIME_DIR } from './paths.js';
19
+ const RECIPE_CLI_PACKAGE = '@farmslot/recipe-cli';
20
+ export function createHarnessCli(options) {
21
+ const host = configureHarnessHost(options.host);
22
+ configureHarnessAdapters(options.adapters);
23
+ const publicCommands = options.commands.filter((command) => !command.hidden);
24
+ const find = (token) => token === undefined
25
+ ? undefined
26
+ : (options.commands.find((command) => command.name === token) ??
27
+ publicCommands.find((command) => command.aliases?.includes(token)));
28
+ const version = readPackageVersion(host.packageRoot);
29
+ // `--version --verbose` adds the recipe-cli a preset runs on; `--version`
30
+ // stays the one line scripts compare.
31
+ const verboseVersion = host.packageName === RECIPE_CLI_PACKAGE
32
+ ? version
33
+ : `${version}\n${RECIPE_CLI_PACKAGE} ${RECIPE_CLI_VERSION}`;
34
+ const renderHelp = () => groupedHelp(options.help, publicCommands);
35
+ async function main(argv) {
36
+ // The libraries the operator started the command with: plugins load only
37
+ // from these, never from the ones library hydration discovers.
38
+ const operatorEnv = { ...process.env };
39
+ const command = find(argv[0]);
40
+ if (argv.length > 0 && command?.nudge !== false)
41
+ options.beforeDispatch?.(argv);
42
+ if (argv.length === 0) {
43
+ process.stdout.write(renderHelp());
44
+ return { exitCode: 0, exit: 'now' };
45
+ }
46
+ // Commander prints `--version` and exits at the flag, so it never sees `--verbose`.
47
+ if ((argv[0] === '--version' || argv[0] === '-v') && argv.slice(1).includes('--verbose')) {
48
+ process.stdout.write(`${verboseVersion}\n`);
49
+ return { exitCode: 0, exit: 'now' };
50
+ }
51
+ if (command && !command.hidden && command.raw) {
52
+ return { exitCode: await dispatch(command, argv), exit: exitOf(command) };
53
+ }
54
+ // Public commands use a strict grammar before commander can consume a typo
55
+ // as a value. Hidden commands keep their private grammar.
56
+ if (!command?.hidden) {
57
+ const usageError = validatePublicInvocation(argv, publicCommands, {
58
+ replacedOptions: options.replacedOptions,
59
+ });
60
+ if (usageError) {
61
+ writeUsageError(host.name, usageError, requested(argv, '--json'), requested(argv, '--json-stream'));
62
+ return { exitCode: 2, exit: 'now' };
63
+ }
64
+ }
65
+ await options.libraries?.hydrate(targetFromArgv(argv));
66
+ // A library-declared adapter loads only when the command selects it.
67
+ if (command) {
68
+ const refused = await loadSelectedAdapter(command.name, argv, {
69
+ adopt: options.adopt,
70
+ configured: options.configuredLibraries?.(),
71
+ env: operatorEnv,
72
+ });
73
+ if (refused !== undefined)
74
+ return { exitCode: refused, exit: 'now' };
75
+ }
76
+ // Leaves own --help after `--`; commander would intercept it.
77
+ if (command && hasPassthroughHelp(argv)) {
78
+ return { exitCode: await dispatch(command, argv), exit: 'now' };
79
+ }
80
+ // `call <action> --help` renders the action's field schema; commander would
81
+ // show only the generic call help, which follows it.
82
+ const call = publicCommands.find((entry) => entry.name === 'call');
83
+ if (options.catalog && call && isCallActionHelp(argv)) {
84
+ const catalog = options.catalog;
85
+ const exitCode = await mapErrors(() => handleCallHelp(argv.slice(1), call.helpText, { catalog }));
86
+ return { exitCode, exit: 'now' };
87
+ }
88
+ let result = { exitCode: 0, exit: 'code' };
89
+ const program = new Command();
90
+ program
91
+ .name(host.name)
92
+ .description(options.help.description)
93
+ .version(version, '-v, --version', `Print the ${host.name} version`)
94
+ .addHelpCommand(false)
95
+ .helpOption('-h, --help', 'Show grouped help')
96
+ .showHelpAfterError(`(run \`${host.name} --help\` for the full surface)`)
97
+ .configureHelp({ formatHelp: renderHelp })
98
+ .exitOverride();
99
+ for (const entry of options.commands) {
100
+ const registered = entry.hidden
101
+ ? program.command(entry.name, { hidden: true }).allowUnknownOption().helpOption(false)
102
+ : program
103
+ .command(entry.name)
104
+ .description(entry.summary)
105
+ .allowUnknownOption()
106
+ .helpOption('-h, --help', 'Show command help')
107
+ .configureHelp({ formatHelp: () => `${entry.helpText}\n` });
108
+ if (!entry.hidden && entry.aliases?.length)
109
+ registered.aliases([...entry.aliases]);
110
+ registered.argument('[args...]').action(async () => {
111
+ const exitCode = entry.hidden
112
+ ? await dispatch(entry, argv)
113
+ : await withCommandJournal(entry.name, argv, () => dispatch(entry, argv));
114
+ result = { exitCode, exit: exitOf(entry) };
115
+ });
116
+ }
117
+ try {
118
+ await program.parseAsync([...argv], { from: 'user' });
119
+ }
120
+ catch (error) {
121
+ // Help, version and commander's own errors end here after printing.
122
+ if (error instanceof CommanderError)
123
+ return { exitCode: error.exitCode, exit: 'now' };
124
+ throw error;
125
+ }
126
+ return result;
127
+ }
128
+ return {
129
+ main,
130
+ async run(argv = process.argv.slice(2)) {
131
+ const { exitCode, exit } = await main(argv);
132
+ if (exit === 'now')
133
+ process.exit(exitCode);
134
+ process.exitCode = exitCode;
135
+ },
136
+ };
137
+ }
138
+ // Loads the adapter the command selects (`selectedAdapterId`), if a library
139
+ // declares it. A refused plugin prints its code and next step; returns that exit.
140
+ async function loadSelectedAdapter(command, argv, load) {
141
+ const tokens = argv.slice(1);
142
+ const selected = selectedAdapterId(tokens);
143
+ if (selected === undefined)
144
+ return undefined;
145
+ try {
146
+ await ensureAdapterLoaded(selected, { ...load, libraries: optionValues(tokens, '--library') });
147
+ return undefined;
148
+ }
149
+ catch (error) {
150
+ // A refused plugin, or the library reader's refusal of its source.
151
+ if (error instanceof AdapterPluginError || error instanceof RecipeTrustError) {
152
+ const failure = { code: error.code, message: error.message, userAction: error.userAction };
153
+ if (requested(argv, '--json-stream')) {
154
+ const stream = new JsonStreamWriter(command, true);
155
+ stream.error(failure);
156
+ stream.complete('fail', 2);
157
+ return 2;
158
+ }
159
+ return adapterSelectionFailureOut(requested(argv, '--json'), command, failure);
160
+ }
161
+ return mapErrors(() => {
162
+ throw error;
163
+ });
164
+ }
165
+ }
166
+ function exitOf(command) {
167
+ return command.exit ?? (command.hidden ? 'now' : 'code');
168
+ }
169
+ function dispatch(command, argv) {
170
+ return mapErrors(() => command.run(argv.slice(1)));
171
+ }
172
+ // The one place a command's failure becomes an exit code: a CliError carries
173
+ // its own (usage 2, validation 5), anything else is 1.
174
+ async function mapErrors(execute) {
175
+ try {
176
+ return await execute();
177
+ }
178
+ catch (error) {
179
+ console.error(error instanceof Error ? error.message : String(error));
180
+ return error !== null &&
181
+ typeof error === 'object' &&
182
+ 'exitCode' in error &&
183
+ typeof error.exitCode === 'number'
184
+ ? error.exitCode
185
+ : 1;
186
+ }
187
+ }
188
+ // The host's own version. `host.packageRoot` is required config, so a missing or
189
+ // unreadable package.json is a host wiring error, not a version to guess.
190
+ function readPackageVersion(packageRoot) {
191
+ const file = path.join(packageRoot, 'package.json');
192
+ const parsed = JSON.parse(fs.readFileSync(file, 'utf8'));
193
+ if (typeof parsed.version !== 'string')
194
+ throw new Error(`${file} has no version.`);
195
+ return parsed.version;
196
+ }
197
+ function groupedHelp(help, commands) {
198
+ const out = (style, text) => color(style, text, { stream: process.stdout });
199
+ const lines = [...help.intro(out)];
200
+ const binEnv = hostEnvName('BIN');
201
+ const bin = process.env[binEnv];
202
+ const runMode = process.env[hostEnvName('RUN_MODE')];
203
+ if (bin) {
204
+ lines.push('');
205
+ lines.push(`${out('warn', 'DEV OVERRIDE ACTIVE')} — this run is served by ${binEnv}=${out('path', bin)} (unset it to return to the installed/global bin).`);
206
+ }
207
+ if (bin && runMode) {
208
+ lines.push(`${out('label', 'running from:')} ${out('path', runMode)} (source checkout; dist shadows src when both exist)`);
209
+ }
210
+ const slotLine = detectedSlotLine(out, help.slotAdapter);
211
+ if (slotLine) {
212
+ lines.push('');
213
+ lines.push(slotLine);
214
+ }
215
+ for (const group of help.groups) {
216
+ lines.push('');
217
+ lines.push(`${out('label', group.title)} — ${group.blurb}:`);
218
+ for (const name of group.commands) {
219
+ const command = commands.find((entry) => entry.name === name);
220
+ lines.push(` ${out('cmd', name.padEnd(10))} ${command?.summary ?? ''}`);
221
+ lines.push(` ${out('comment', command?.example ?? '')}`);
222
+ }
223
+ }
224
+ lines.push('');
225
+ lines.push(...help.footer(out));
226
+ return `${lines.join('\n')}\n`;
227
+ }
228
+ // The slot context the orchestrator's prepare wrote into the checkout, when
229
+ // help runs from inside one. Presence-gated: no context, no line.
230
+ function detectedSlotLine(out, slotAdapter) {
231
+ const ctxPath = path.join(process.cwd(), process.env.RECIPE_RUNTIME_DIR || DEFAULT_RECIPE_RUNTIME_DIR, 'agentic-runtime.json');
232
+ let ctx;
233
+ try {
234
+ ctx = JSON.parse(fs.readFileSync(ctxPath, 'utf8'));
235
+ }
236
+ catch (error) {
237
+ // No context file, or one mid-write: no slot line. Anything else is a bug.
238
+ if (error instanceof SyntaxError || error.code === 'ENOENT') {
239
+ return null;
240
+ }
241
+ throw error;
242
+ }
243
+ if (ctx === null || typeof ctx !== 'object')
244
+ return null;
245
+ const platform = typeof ctx.platform === 'string' ? ctx.platform : undefined;
246
+ const adapter = (platform ? slotAdapter?.(platform) : undefined) ?? detectAdapter(process.cwd());
247
+ const parts = [];
248
+ if (ctx.slotId)
249
+ parts.push(`slot ${out('ok', String(ctx.slotId))}`);
250
+ if (ctx.simulator)
251
+ parts.push(`device ${out('ok', String(ctx.simulator))}`);
252
+ const devServerPort = ctx.watcherPort ?? ctx.devServerPort ?? ctx.metroPort;
253
+ const surface = adapter ? harnessAdapter(adapter) : undefined;
254
+ if (surface && !surface.headless && devServerPort) {
255
+ parts.push(`${surface.devServer.label} :${out('ok', String(devServerPort))}`);
256
+ }
257
+ if (ctx.gitBranch)
258
+ parts.push(`branch ${out('info', String(ctx.gitBranch))}`);
259
+ if (parts.length === 0)
260
+ return null;
261
+ return `${out('label', 'SLOT')} — this checkout is a prepared slot: ${parts.join(' · ')}`;
262
+ }
263
+ function writeUsageError(hostName, error, json, jsonStream) {
264
+ if (jsonStream) {
265
+ const stream = new JsonStreamWriter(error.command, true);
266
+ stream.error({ code: error.code, message: error.message, userAction: error.userAction });
267
+ stream.complete('fail', 2);
268
+ }
269
+ else if (json) {
270
+ process.stdout.write(`${JSON.stringify({
271
+ schemaVersion: 1,
272
+ command: error.command,
273
+ status: 'fail',
274
+ error: { code: error.code, message: error.message, userAction: error.userAction },
275
+ exitCode: 2,
276
+ }, null, 2)}\n`);
277
+ }
278
+ else {
279
+ const scope = error.command === hostName ? '' : ` ${error.command}`;
280
+ process.stderr.write(`✗ ${hostName}${scope}: ${error.message}\n Next: ${error.userAction}\n`);
281
+ }
282
+ }
283
+ // The checkout a run is about, read before commander parses: library locations
284
+ // resolve against it and every command accepts the same --target spelling.
285
+ function targetFromArgv(argv) {
286
+ const index = argv.indexOf('--target');
287
+ const separate = index !== -1 ? argv[index + 1] : undefined;
288
+ const inline = argv
289
+ .find((argument) => argument.startsWith('--target='))
290
+ ?.slice('--target='.length);
291
+ return path.resolve(separate ?? inline ?? process.cwd());
292
+ }
293
+ function beforePassthrough(argv) {
294
+ const divider = argv.indexOf('--');
295
+ return divider === -1 ? argv : argv.slice(0, divider);
296
+ }
297
+ function hasPassthroughHelp(argv) {
298
+ const divider = argv.indexOf('--');
299
+ if (divider === -1)
300
+ return false;
301
+ return argv.slice(divider + 1).some((arg) => arg === '-h' || arg === '--help');
302
+ }
303
+ // Requires the grammar call enforces (the action first, before flags), so
304
+ // `call --help` still gets commander's generic call help.
305
+ function isCallActionHelp(argv) {
306
+ if (argv[0] !== 'call')
307
+ return false;
308
+ if (!argv[1] || argv[1].startsWith('-'))
309
+ return false;
310
+ const scope = beforePassthrough(argv);
311
+ return scope.includes('--help') || scope.includes('-h');
312
+ }
313
+ function requested(argv, option) {
314
+ const scope = beforePassthrough(argv);
315
+ return option === '--json'
316
+ ? scope.some((argument) => argument === '--json' || argument.startsWith('--json='))
317
+ : scope.includes('--json-stream');
318
+ }
319
+ //# sourceMappingURL=harness-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"harness-cli.js","sourceRoot":"","sources":["../../src/harness/harness-cli.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,+EAA+E;AAC/E,+CAA+C;AAC/C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AA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,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,SAAS,CAAC,IAAuB,EAAE,MAAkC;IAC5E,MAAM,KAAK,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO,MAAM,KAAK,QAAQ;QACxB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QACnF,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;AACtC,CAAC"}
@@ -1,8 +1,10 @@
1
+ export { adapterChoices, type AdapterLibraryOptions, type AdapterLoadOptions, adapterPlugin, adapterPluginChecks, AdapterPluginError, type AdapterPluginErrorCode, adapterSelectionFailureOut, composeAdapter, type DeclaredAdapter, declaredAdapterIds, ensureAdapterLoaded, type LoadedAdapterPlugin, loadedAdapterPlugins, selectedAdapterId, } from './adapter-plugins.js';
1
2
  export { adapterDetectNext, adapterFlags, adapterForPlatform, adapterPortFlags, assertAdapter, configureHarnessAdapters, detectAdapter, harnessAdapter, harnessAdapters, isPlatformTarget, undetectedAdapterMessage, } from './adapters.js';
2
3
  export { type ArtifactManifestEntry, indexArtifactManifest, readContainedJsonArtifact, writeContainedArtifact, } from './artifact-files.js';
3
4
  export { type ActionCapabilitySource, type DescribedAction, describeManifestActions, type RecipeCatalog, type ResolvedActionManifest, } from './catalog.js';
4
5
  export { acquireCheckoutLock, type CheckoutLock, type CheckoutLockFailure, trackCheckoutChild, } from './checkout-lock.js';
5
6
  export { classifyLogEvent, color, colorEnabled, colorHumanMessage, colorKv, colorLogEvent, colorStatusWord, stripAnsi, } from './cli-color.js';
7
+ export { booleanOption, type CliUsageError, type CliUsageErrorCode, type CommandContract, type ContractedCommand, type ContractFailures, contractOptions, type ContractValidationOptions, optionalValueOption, type OptionSpec, optionValues, type PositionalSpec, publicCommandTokens, validatePublicInvocation, valueOption, } from './command-contract.js';
6
8
  export { COMMAND_JOURNAL_FILE, commandJournalPath, type CommandJournalRecord, isSensitiveKey, readCommandJournal, recordCommandEvidence, recordCommandOutput, recordCommandStage, redactCommandArgs, redactStructuredValue, withCommandJournal, } from './command-journal.js';
7
9
  export { type CallCommandOptions, handleCall, handleCallHelp } from './commands/call.js';
8
10
  export { handleActions } from './commands/discover.js';
@@ -12,21 +14,22 @@ export { handleReload } from './commands/reload.js';
12
14
  export { type DeviceTargeting, handleRun, type RunCommandOptions, type RunPlanStep, } from './commands/run.js';
13
15
  export { handleStop, type StopCommandOptions, type StoppedCompanion } from './commands/stop.js';
14
16
  export { captureExecutionProvenance, type ExecutionProvenanceDrift, executionProvenanceDrift, type ExecutionProvenanceInput, type ExecutionProvenancePhase, type ExecutionProvenanceRecord, type ExecutionProvenanceSnapshot, ProvenanceDriftError, type SourceProvenanceSnapshot, writeExecutionProvenance, } from './execution-provenance.js';
17
+ export { createHarnessCli, type HarnessCli, type HarnessCliOptions, type HarnessCliResult, type HarnessCommand, type HarnessHelp, type HarnessHelpGroup, type HelpPaint, type HiddenHarnessCommand, type PublicHarnessCommand, } from './harness-cli.js';
15
18
  export { checkHealBounds, classifyFailure, conciseFailureForHuman, ensureOverlay, type FailureClass, newHealState, parseHeal, recipeRunning, } from './heal-bounds.js';
16
19
  export { configureHarnessHost, type HarnessHost, harnessHost, type HarnessHostConfig, hostEnvName, recipeEnvName, validateRelativeRecipePath, } from './host.js';
17
20
  export { JsonStreamWriter } from './json-stream.js';
18
21
  export { leafStartFailureMessage, missingShellLeafMessage, resolveLeafInvoke, shellLeafMissing, } from './leaf-invoke.js';
19
22
  export { gitLibraryProvenance } from './library-provenance.js';
20
- export { liveAdapterProcessTimeoutMs, type LiveAdapterRun, type PreparedLiveAdapter, prepareLiveAdapterScript, resolveLiveAdapter, runLiveAdapterScript, } from './live-adapter-contract.js';
23
+ export { liveAdapterProcessTimeoutMs, type LiveAdapterRun, type PreparedLiveAdapter, prepareLiveAdapterScript, resolveLiveAdapter, resolveTsxBin, runLiveAdapterScript, } from './live-adapter-contract.js';
21
24
  export { runNetworkCaptureAction } from './network-observation.js';
22
25
  export { argValue, handleHarness, type HarnessAction, hasArg, type OverlayCommandOptions, type OverlayInstallContext, readRuntimeContextField, resolveRuntimeContextPath, } from './overlay.js';
23
26
  export { actionManifestPathOption, adapterOption, applyRuntimeDirOption, applyWatcherPortOption, CliError, type CliOptions, type CliOptionValue, isRecord, optionFlag, optionString, optionStrings, parseArgs, type ParseArgsOptions, type ParsedArgs, parsePort, parseRecipeParamAssignments, requiredOption, resolveAdapter, shellQuote, shellQuoteArg, targetPath, usageError, } from './parse-args.js';
24
27
  export { DEFAULT_RECIPE_HARNESS_ROOT, DEFAULT_RECIPE_RUNTIME_DIR, harnessExecutable, recipeHarnessPath, recipeHarnessRoot, recipeRuntimeDir, recipeRuntimePath, } from './paths.js';
25
28
  export { describeRunnableRecipe, listRunnableRecipes, type RecipeParameterSummary, resolveLibrarySources, runnableLibraryRecipes, type RunnableRecipe, type RunnableRecipeDetail, } from './recipe-library.js';
26
- export { resolveRecipeParamValue, type RunRecipeStaticValidation, validateActionInputs, validateRunRecipeStatic, } from './recipe-validation.js';
29
+ export { resolveRecipeParamValue, type RunRecipeStaticValidation, validateActionInputs, validateCommandNodes, validateRunRecipeStatic, } from './recipe-validation.js';
27
30
  export { captureHelperPath, captureHelperSupportsCapability, captureHelperSupportsRecordSessionSnapshots, createRecordingTargetProvider, } from './recording-target.js';
28
31
  export { beginRunDiagnostics, type CaptureEvidence, type ClassifiedConsoleRecord, collectRunDiagnostics, type ConsoleAllowlist, type ConsoleAllowlistMatch, type ConsoleCaptureSpec, type ConsoleClassifier, type ConsoleEventKey, type ConsoleRecord, finishRunDiagnostics, formatRunDiagnosticsForHuman, readRunDiagnosticsDocument, type RecipeRunEvidence, type RunDiagnosticBaseline, type RunDiagnosticsDocument, type RunSideFinding, verifyConsoleCapture, } from './run-diagnostics.js';
29
- export { activateRecipeRuntimeEnvironment, preflightRecipe, type PreparedRecipeExecution, type RecipeEngine, type RecipeEngineRunOptions, type RecipeRunnerOptions, runRecipe, } from './run-engine.js';
32
+ export { activateRecipeRuntimeEnvironment, preflightRecipe, type PreparedRecipeExecution, type RecipeEngine, type RecipeEngineRunOptions, type RecipeRunnerOptions, runRecipe, type TrustedMutationAuthorizeContext, type TrustedMutationLoadInput, } from './run-engine.js';
30
33
  export { recipeRunOptionsFromCli } from './run-options.js';
31
34
  export { type ActiveRecipeRecording, captureActiveRecipeRecordingSnapshot, type RecipeRecordingOptions, startRecipeRecording, stopRecipeRecording, } from './run-recording.js';
32
35
  export { executedBrowser, indexProductProvenanceArtifact, recipeCdpPorts, type RunReport, writeRunReport, } from './run-report.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/harness/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,uBAAuB,EACvB,KAAK,aAAa,EAClB,KAAK,sBAAsB,GAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,iBAAiB,EACjB,OAAO,EACP,aAAa,EACb,eAAe,EACf,SAAS,GACV,MAAM,g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wB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,0BAA0B,EAC1B,KAAK,kBAAkB,EACvB,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/harness/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,0BAA0B,EAC1B,cAAc,EACd,KAAK,eAAe,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,mBAAmB,EACxB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,uBAAuB,EACvB,KAAK,aAAa,EAClB,KAAK,sBAAsB,GAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,iBAAiB,EACjB,OAAO,EACP,aAAa,EACb,eAAe,EACf,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,eAA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,EAC3B,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,8BAA8B,EAC9B,cAAc,EACd,KAAK,SAAS,EACd,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,IAAI,EACJ,IAAI,EACJ,KAAK,WAAW,EAChB,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,KAAK,YAAY,EACjB,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,GAAG,EACH,KAAK,qBAAqB,EAC1B,QAAQ,EACR,QAAQ,EACR,wBAAwB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,0BAA0B,EAC1B,KAAK,kBAAkB,EACvB,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
@@ -1,11 +1,13 @@
1
1
  // Generic harness support shared by every host CLI (`farmslot-recipe`, product
2
2
  // presets such as `mm-harness`): host identity, runtime paths, the resumability
3
3
  // journal, the checkout lock, JSON streaming and colour output.
4
+ export { adapterChoices, adapterPlugin, adapterPluginChecks, AdapterPluginError, adapterSelectionFailureOut, composeAdapter, declaredAdapterIds, ensureAdapterLoaded, loadedAdapterPlugins, selectedAdapterId, } from './adapter-plugins.js';
4
5
  export { adapterDetectNext, adapterFlags, adapterForPlatform, adapterPortFlags, assertAdapter, configureHarnessAdapters, detectAdapter, harnessAdapter, harnessAdapters, isPlatformTarget, undetectedAdapterMessage, } from './adapters.js';
5
6
  export { indexArtifactManifest, readContainedJsonArtifact, writeContainedArtifact, } from './artifact-files.js';
6
7
  export { describeManifestActions, } from './catalog.js';
7
8
  export { acquireCheckoutLock, trackCheckoutChild, } from './checkout-lock.js';
8
9
  export { classifyLogEvent, color, colorEnabled, colorHumanMessage, colorKv, colorLogEvent, colorStatusWord, stripAnsi, } from './cli-color.js';
10
+ export { booleanOption, contractOptions, optionalValueOption, optionValues, publicCommandTokens, validatePublicInvocation, valueOption, } from './command-contract.js';
9
11
  export { COMMAND_JOURNAL_FILE, commandJournalPath, isSensitiveKey, readCommandJournal, recordCommandEvidence, recordCommandOutput, recordCommandStage, redactCommandArgs, redactStructuredValue, withCommandJournal, } from './command-journal.js';
10
12
  export { handleCall, handleCallHelp } from './commands/call.js';
11
13
  export { handleActions } from './commands/discover.js';
@@ -15,18 +17,19 @@ export { handleReload } from './commands/reload.js';
15
17
  export { handleRun, } from './commands/run.js';
16
18
  export { handleStop } from './commands/stop.js';
17
19
  export { captureExecutionProvenance, executionProvenanceDrift, ProvenanceDriftError, writeExecutionProvenance, } from './execution-provenance.js';
20
+ export { createHarnessCli, } from './harness-cli.js';
18
21
  export { checkHealBounds, classifyFailure, conciseFailureForHuman, ensureOverlay, newHealState, parseHeal, recipeRunning, } from './heal-bounds.js';
19
22
  export { configureHarnessHost, harnessHost, hostEnvName, recipeEnvName, validateRelativeRecipePath, } from './host.js';
20
23
  export { JsonStreamWriter } from './json-stream.js';
21
24
  export { leafStartFailureMessage, missingShellLeafMessage, resolveLeafInvoke, shellLeafMissing, } from './leaf-invoke.js';
22
25
  export { gitLibraryProvenance } from './library-provenance.js';
23
- export { liveAdapterProcessTimeoutMs, prepareLiveAdapterScript, resolveLiveAdapter, runLiveAdapterScript, } from './live-adapter-contract.js';
26
+ export { liveAdapterProcessTimeoutMs, prepareLiveAdapterScript, resolveLiveAdapter, resolveTsxBin, runLiveAdapterScript, } from './live-adapter-contract.js';
24
27
  export { runNetworkCaptureAction } from './network-observation.js';
25
28
  export { argValue, handleHarness, hasArg, readRuntimeContextField, resolveRuntimeContextPath, } from './overlay.js';
26
29
  export { actionManifestPathOption, adapterOption, applyRuntimeDirOption, applyWatcherPortOption, CliError, isRecord, optionFlag, optionString, optionStrings, parseArgs, parsePort, parseRecipeParamAssignments, requiredOption, resolveAdapter, shellQuote, shellQuoteArg, targetPath, usageError, } from './parse-args.js';
27
30
  export { DEFAULT_RECIPE_HARNESS_ROOT, DEFAULT_RECIPE_RUNTIME_DIR, harnessExecutable, recipeHarnessPath, recipeHarnessRoot, recipeRuntimeDir, recipeRuntimePath, } from './paths.js';
28
31
  export { describeRunnableRecipe, listRunnableRecipes, resolveLibrarySources, runnableLibraryRecipes, } from './recipe-library.js';
29
- export { resolveRecipeParamValue, validateActionInputs, validateRunRecipeStatic, } from './recipe-validation.js';
32
+ export { resolveRecipeParamValue, validateActionInputs, validateCommandNodes, validateRunRecipeStatic, } from './recipe-validation.js';
30
33
  export { captureHelperPath, captureHelperSupportsCapability, captureHelperSupportsRecordSessionSnapshots, createRecordingTargetProvider, } from './recording-target.js';
31
34
  export { beginRunDiagnostics, collectRunDiagnostics, finishRunDiagnostics, formatRunDiagnosticsForHuman, readRunDiagnosticsDocument, verifyConsoleCapture, } from './run-diagnostics.js';
32
35
  export { activateRecipeRuntimeEnvironment, preflightRecipe, runRecipe, } from './run-engine.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/harness/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,gFAAgF;AAChF,gEAAgE;AAChE,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,uBAAuB,GAGxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EAGnB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,iBA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d,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,IAAI,EACJ,IAAI,EAEJ,UAAU,EACV,mBAAmB,EACnB,cAAc,EAEd,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,GAAG,EAEH,QAAQ,EACR,QAAQ,EACR,wBAAwB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,0BAA0B,EAE1B,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/harness/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,gFAAgF;AAChF,gEAAgE;AAChE,OAAO,EACL,cAAc,EAGd,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAElB,0BAA0B,EAC1B,cAAc,EAEd,kBAAkB,EAClB,mBAAmB,EAEnB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,uBAAuB,GAGxB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EAGnB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,iBAAiB,EACjB,OAAO,EACP,aAAa,EACb,eAAe,EACf,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,a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,oCAAoC,EAEpC,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,8BAA8B,EAC9B,cAAc,EAEd,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,IAAI,EACJ,IAAI,EAEJ,UAAU,EACV,mBAAmB,EACnB,cAAc,EAEd,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,GAAG,EAEH,QAAQ,EACR,QAAQ,EACR,wBAAwB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,0BAA0B,EAE1B,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
@@ -1,4 +1,6 @@
1
1
  import type { ActionExecutionContext } from '@farmslot/recipe-runner';
2
+ /** The live script files tried for `action`, in order; the first that exists runs. */
3
+ export declare function candidatePaths(platform: string, action: string, namespace: string, runtimeEnv?: NodeJS.ProcessEnv): string[];
2
4
  export interface PreparedLiveAdapter {
3
5
  action: string;
4
6
  platform: string;
@@ -13,6 +15,13 @@ export declare function prepareLiveAdapterScript({ platform, action, namespace,
13
15
  implementationRoot: string;
14
16
  allowRuntimeImports?: boolean;
15
17
  }): Promise<PreparedLiveAdapter | null>;
18
+ /**
19
+ * The tsx a live adapter script runs under, or null. Exported so a readiness
20
+ * check asks the same question execution does. Order: the `TSX_BIN` seam, the
21
+ * target checkout's own tsx (a thin-installed slot has it; a published host
22
+ * need not ship one), the host package's tsx, then the caller's candidates.
23
+ */
24
+ export declare function resolveTsxBin(tsxCandidates: readonly string[], projectRoot?: string): string | null;
16
25
  export declare function resolveLiveAdapter(platform: string, action: string, namespace: string, runtimeEnv?: NodeJS.ProcessEnv): Promise<string | null>;
17
26
  export interface LiveAdapterRun {
18
27
  platform: string;
@@ -1 +1 @@
1
-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