@farmslot/recipe-cli 0.4.1 → 0.6.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.
- package/CHANGELOG.md +32 -0
- package/README.md +11 -11
- package/dist/harness/acceptance-ledger.d.ts +18 -0
- package/dist/harness/acceptance-ledger.d.ts.map +1 -0
- package/dist/harness/acceptance-ledger.js +119 -0
- package/dist/harness/acceptance-ledger.js.map +1 -0
- package/dist/harness/adapter-plugins.d.ts +105 -0
- package/dist/harness/adapter-plugins.d.ts.map +1 -0
- package/dist/harness/adapter-plugins.js +388 -0
- package/dist/harness/adapter-plugins.js.map +1 -0
- package/dist/harness/catalog.d.ts +71 -0
- package/dist/harness/catalog.d.ts.map +1 -0
- package/dist/harness/catalog.js +280 -0
- package/dist/harness/catalog.js.map +1 -0
- package/dist/harness/commands/call.d.ts +18 -0
- package/dist/harness/commands/call.d.ts.map +1 -0
- package/dist/harness/commands/call.js +667 -0
- package/dist/harness/commands/call.js.map +1 -0
- package/dist/harness/commands/discover.d.ts +29 -0
- package/dist/harness/commands/discover.d.ts.map +1 -0
- package/dist/harness/commands/discover.js +563 -0
- package/dist/harness/commands/discover.js.map +1 -0
- package/dist/harness/commands/run.d.ts +40 -0
- package/dist/harness/commands/run.d.ts.map +1 -0
- package/dist/harness/commands/run.js +760 -0
- package/dist/harness/commands/run.js.map +1 -0
- package/dist/harness/heal-bounds.d.ts +8 -0
- package/dist/harness/heal-bounds.d.ts.map +1 -1
- package/dist/harness/heal-bounds.js +10 -0
- package/dist/harness/heal-bounds.js.map +1 -1
- package/dist/harness/host.d.ts +5 -0
- package/dist/harness/host.d.ts.map +1 -1
- package/dist/harness/host.js +7 -0
- package/dist/harness/host.js.map +1 -1
- package/dist/harness/index.d.ts +10 -1
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js +10 -1
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/live-adapter-contract.d.ts +9 -0
- package/dist/harness/live-adapter-contract.d.ts.map +1 -1
- package/dist/harness/live-adapter-contract.js +38 -7
- package/dist/harness/live-adapter-contract.js.map +1 -1
- package/dist/harness/network-observation.d.ts +16 -0
- package/dist/harness/network-observation.d.ts.map +1 -0
- package/dist/harness/network-observation.js +197 -0
- package/dist/harness/network-observation.js.map +1 -0
- package/dist/harness/plugin-imports.d.ts +23 -0
- package/dist/harness/plugin-imports.d.ts.map +1 -0
- package/dist/harness/plugin-imports.js +126 -0
- package/dist/harness/plugin-imports.js.map +1 -0
- package/dist/harness/recipe-library.d.ts +65 -0
- package/dist/harness/recipe-library.d.ts.map +1 -0
- package/dist/harness/recipe-library.js +182 -0
- package/dist/harness/recipe-library.js.map +1 -0
- package/dist/harness/recipe-validation.d.ts +29 -0
- package/dist/harness/recipe-validation.d.ts.map +1 -0
- package/dist/harness/recipe-validation.js +291 -0
- package/dist/harness/recipe-validation.js.map +1 -0
- package/dist/harness/run-engine.d.ts +98 -0
- package/dist/harness/run-engine.d.ts.map +1 -0
- package/dist/harness/run-engine.js +632 -0
- package/dist/harness/run-engine.js.map +1 -0
- package/dist/harness/run-observers.d.ts +10 -0
- package/dist/harness/run-observers.d.ts.map +1 -0
- package/dist/harness/run-observers.js +24 -0
- package/dist/harness/run-observers.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
// Platform adapters a recipe library declares in recipe-library.json `adapters`
|
|
2
|
+
// (ADR L4). A declared adapter loads only when a command selects it: its module
|
|
3
|
+
// resolves inside the library root, is imported, checked against the SDK and
|
|
4
|
+
// composed on the adapter it `extends`, then registered with the host's
|
|
5
|
+
// built-ins. The library digest the run records covers the module.
|
|
6
|
+
//
|
|
7
|
+
// Trust: plugins load only from the operator's libraries (--library, the
|
|
8
|
+
// operator's RECIPE_LIBRARY_PATH or else the personal library, and what the host
|
|
9
|
+
// configures), never from a task-local library beside a recipe or a library the
|
|
10
|
+
// host discovered on its own, so loading one is trusted like installing it. Each
|
|
11
|
+
// plugin's digest binds what the run approves (see `adapterPlugin`), the plugin
|
|
12
|
+
// may import from disk only the files that digest covers (plugin-imports.ts),
|
|
13
|
+
// and `adapterPluginChecks` names it in the doctor report.
|
|
14
|
+
import { createHash } from 'node:crypto';
|
|
15
|
+
import fs from 'node:fs';
|
|
16
|
+
import path from 'node:path';
|
|
17
|
+
import { pathToFileURL } from 'node:url';
|
|
18
|
+
import { ADAPTER_SDK_VERSION, } from '@farmslot/adapter-sdk';
|
|
19
|
+
import { digestLibraryAdapter, libraryAdapterFiles, parseRecipeLibraryPath, personalRecipeLibraryRoot, readRecipeLibraryManifest, RECIPE_LIBRARY_MANIFEST_FILE, RecipeTrustError, resolveRecipeLibrarySources, } from '@farmslot/recipe-runner';
|
|
20
|
+
import { adapterForPlatform, harnessAdapters } from './adapters.js';
|
|
21
|
+
import { harnessHost } from './host.js';
|
|
22
|
+
import { CliError, isRecord } from './parse-args.js';
|
|
23
|
+
import { canFencePluginImports, fencePluginImports } from './plugin-imports.js';
|
|
24
|
+
import { EXIT } from './shared.js';
|
|
25
|
+
/** A declared adapter that cannot be selected. */
|
|
26
|
+
export class AdapterPluginError extends CliError {
|
|
27
|
+
constructor(code, message, userAction) {
|
|
28
|
+
super(message, EXIT.usage);
|
|
29
|
+
this.name = 'AdapterPluginError';
|
|
30
|
+
this.code = code;
|
|
31
|
+
this.userAction = userAction;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Every adapter id `--adapter` accepts: the registered adapters, then the ids
|
|
36
|
+
* the libraries declare (`declaredAdapterIds`). Reads recipe-library.json only;
|
|
37
|
+
* imports nothing. The libraries are resolved as recipes resolve them: `libraries`
|
|
38
|
+
* (--library), then RECIPE_LIBRARY_PATH entries they don't rename, else the
|
|
39
|
+
* personal library; then `configured`.
|
|
40
|
+
*/
|
|
41
|
+
export function adapterChoices(libraries = [], options = {}) {
|
|
42
|
+
const sources = withConfigured(librarySourcesSync(libraries, options.env), options.configured);
|
|
43
|
+
return [...new Set([...harnessAdapters().list(), ...declaredAdapterIds(sources)])];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The adapter ids these libraries declare in recipe-library.json `adapters`,
|
|
47
|
+
* read without importing anything. A library without a readable manifest
|
|
48
|
+
* declares nothing here; selecting one of its adapters reports the error.
|
|
49
|
+
*/
|
|
50
|
+
export function declaredAdapterIds(sources) {
|
|
51
|
+
return [...new Set(sources.flatMap((source) => declaredIdsIn(source.root)))];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The adapter a command's tokens select, the way commands resolve it: the last
|
|
55
|
+
* `--adapter`, else the adapter of the last `--platform`. Tokens after `--` are
|
|
56
|
+
* passthrough and select nothing.
|
|
57
|
+
*/
|
|
58
|
+
export function selectedAdapterId(tokens) {
|
|
59
|
+
return (lastOptionValue(tokens, '--adapter') ??
|
|
60
|
+
adapterForPlatform(lastOptionValue(tokens, '--platform')));
|
|
61
|
+
}
|
|
62
|
+
/** The plugin the loader registered under `id` in the host's registry, if any. */
|
|
63
|
+
export function adapterPlugin(id) {
|
|
64
|
+
return loadedInto(harnessAdapters()).get(id);
|
|
65
|
+
}
|
|
66
|
+
/** Every plugin the loader registered in the host's registry, in load order. */
|
|
67
|
+
export function loadedAdapterPlugins() {
|
|
68
|
+
return [...loadedInto(harnessAdapters()).values()];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* One passing, non-required doctor check per loaded plugin, naming its library,
|
|
72
|
+
* module and digest, so the report shows which plugin code this process runs.
|
|
73
|
+
*/
|
|
74
|
+
export function adapterPluginChecks() {
|
|
75
|
+
return loadedAdapterPlugins().map((plugin) => ({
|
|
76
|
+
id: `adapter-plugin:${plugin.id}`,
|
|
77
|
+
status: 'pass',
|
|
78
|
+
required: false,
|
|
79
|
+
message: `adapter ${plugin.id} is loaded from library ${plugin.library} (${plugin.module}), ${plugin.digest}`,
|
|
80
|
+
detail: plugin.root,
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Make `id` resolvable: a no-op for an absent id or a registered one, else load
|
|
85
|
+
* the one declaration for it (and what it extends) and register it. A built-in
|
|
86
|
+
* id that a library also declares is a conflict.
|
|
87
|
+
*/
|
|
88
|
+
export async function ensureAdapterLoaded(id, options = {}) {
|
|
89
|
+
if (id === undefined)
|
|
90
|
+
return;
|
|
91
|
+
const registry = harnessAdapters();
|
|
92
|
+
if (loadedInto(registry).has(id))
|
|
93
|
+
return;
|
|
94
|
+
if (registry.has(id)) {
|
|
95
|
+
// A built-in: refuse a library that claims its id; never block it on a library error.
|
|
96
|
+
const claims = (await declarations(options, { lenient: true })).filter((d) => d.id === id);
|
|
97
|
+
if (claims.length > 0)
|
|
98
|
+
throw builtinConflict(id, claims);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const declared = await declarations(options, { lenient: false });
|
|
102
|
+
// An id nobody declares is left to the command's own adapter validation.
|
|
103
|
+
if (!declared.some((declaration) => declaration.id === id))
|
|
104
|
+
return;
|
|
105
|
+
await load(id, declared, options, []);
|
|
106
|
+
}
|
|
107
|
+
/** The plugins the loader registered, per host registry. */
|
|
108
|
+
const loaded = new WeakMap();
|
|
109
|
+
function loadedInto(registry) {
|
|
110
|
+
let plugins = loaded.get(registry);
|
|
111
|
+
if (!plugins)
|
|
112
|
+
loaded.set(registry, (plugins = new Map()));
|
|
113
|
+
return plugins;
|
|
114
|
+
}
|
|
115
|
+
async function load(id, declared, options, chain) {
|
|
116
|
+
const registry = harnessAdapters();
|
|
117
|
+
if (registry.has(id)) {
|
|
118
|
+
const claims = declared.filter((d) => d.id === id);
|
|
119
|
+
if (!loadedInto(registry).has(id) && claims.length > 0)
|
|
120
|
+
throw builtinConflict(id, claims);
|
|
121
|
+
return registry.get(id);
|
|
122
|
+
}
|
|
123
|
+
const claims = declared.filter((d) => d.id === id);
|
|
124
|
+
if (claims.length === 0) {
|
|
125
|
+
// Only an `extends` reaches here: ensureAdapterLoaded loads declared ids.
|
|
126
|
+
throw new AdapterPluginError('ADAPTER_EXTENDS_UNKNOWN', `adapter '${chain.at(-1)}' extends '${id}', which no registered adapter or library declares.`, `register '${id}' or put the library that declares it on RECIPE_LIBRARY_PATH`);
|
|
127
|
+
}
|
|
128
|
+
if (claims.length > 1)
|
|
129
|
+
throw new AdapterPluginError('ADAPTER_ID_CONFLICT', `adapter '${id}' is declared by more than one library: ${claims.map((d) => d.library).join(', ')}.`, `keep '${id}' in one library on RECIPE_LIBRARY_PATH`);
|
|
130
|
+
if (chain.includes(id))
|
|
131
|
+
throw new AdapterPluginError('ADAPTER_EXTENDS_UNKNOWN', `adapter '${id}' extends itself through ${[...chain, id].join(' → ')}.`, 'break the extends cycle in recipe-library.json');
|
|
132
|
+
const declaration = claims[0];
|
|
133
|
+
const parent = declaration.extends
|
|
134
|
+
? await load(declaration.extends, declared, options, [...chain, id])
|
|
135
|
+
: undefined;
|
|
136
|
+
// The digest is taken before the import, so it covers the code that loads.
|
|
137
|
+
const digest = await pluginDigest(declaration, loadedInto(registry).get(declaration.extends ?? ''));
|
|
138
|
+
const plugin = await importDeclared(declaration);
|
|
139
|
+
const composed = parent ? composeAdapter(parent, plugin) : plugin;
|
|
140
|
+
assertAdapterMembers(composed, declaration);
|
|
141
|
+
const adopted = options.adopt ? options.adopt(composed) : composed;
|
|
142
|
+
registry.register(adopted);
|
|
143
|
+
loadedInto(registry).set(id, {
|
|
144
|
+
id,
|
|
145
|
+
library: declaration.library,
|
|
146
|
+
root: declaration.root,
|
|
147
|
+
module: declaration.module,
|
|
148
|
+
...(declaration.extends ? { extends: declaration.extends } : {}),
|
|
149
|
+
digest,
|
|
150
|
+
});
|
|
151
|
+
return adopted;
|
|
152
|
+
}
|
|
153
|
+
async function pluginDigest(declaration, parent) {
|
|
154
|
+
const files = await digestLibraryAdapter(declaration.root, declaration);
|
|
155
|
+
const identity = [
|
|
156
|
+
declaration.library,
|
|
157
|
+
fs.realpathSync(declaration.root),
|
|
158
|
+
declaration.id,
|
|
159
|
+
files,
|
|
160
|
+
parent?.digest ?? '',
|
|
161
|
+
].join('\0');
|
|
162
|
+
return `sha256:${createHash('sha256').update(identity).digest('hex')}`;
|
|
163
|
+
}
|
|
164
|
+
async function importDeclared(declaration) {
|
|
165
|
+
// recipe-library.json validation already proved the module resolves inside the root.
|
|
166
|
+
const file = fs.realpathSync(path.resolve(declaration.root, declaration.module));
|
|
167
|
+
if (!canFencePluginImports())
|
|
168
|
+
throw new AdapterPluginError('ADAPTER_PLUGIN_LOAD_FAILED', `adapter '${declaration.id}' from library ${declaration.library} needs Node.js 22.15 or later (module.registerHooks fences a plugin's imports); this is ${process.version}.`, 'upgrade Node.js to 22.15 or later');
|
|
169
|
+
// The plugin may import from disk only the files its digest covers.
|
|
170
|
+
const covered = await libraryAdapterFiles(declaration.root, declaration);
|
|
171
|
+
const moduleDir = path.posix.dirname(path
|
|
172
|
+
.relative(declaration.root, path.resolve(declaration.root, declaration.module))
|
|
173
|
+
.split(path.sep)
|
|
174
|
+
.join('/'));
|
|
175
|
+
const inModuleDir = (relative) => moduleDir === '.' ? !relative.startsWith('actions/') : relative.startsWith(`${moduleDir}/`);
|
|
176
|
+
const real = (relative) => fs.realpathSync(path.join(declaration.root, relative));
|
|
177
|
+
fencePluginImports({
|
|
178
|
+
id: declaration.id,
|
|
179
|
+
library: declaration.library,
|
|
180
|
+
root: fs.realpathSync(declaration.root),
|
|
181
|
+
moduleFiles: new Set(covered.filter(inModuleDir).map(real)),
|
|
182
|
+
files: new Set(covered.map(real)),
|
|
183
|
+
hostURL: pathToFileURL(path.join(harnessHost().packageRoot, 'package.json')).href,
|
|
184
|
+
hostRoot: fs.realpathSync(harnessHost().packageRoot),
|
|
185
|
+
});
|
|
186
|
+
let module;
|
|
187
|
+
try {
|
|
188
|
+
module = (await import(pathToFileURL(file).href));
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
// The fence's refusal keeps its code: the plugin imports code its digest misses.
|
|
192
|
+
if (error instanceof RecipeTrustError)
|
|
193
|
+
throw error;
|
|
194
|
+
throw new AdapterPluginError('ADAPTER_PLUGIN_LOAD_FAILED', `adapter '${declaration.id}' from library ${declaration.library} failed to load: ${error instanceof Error ? error.message : String(error)}`, `fix ${declaration.module} in ${declaration.root}`);
|
|
195
|
+
}
|
|
196
|
+
const exportName = declaration.export ?? 'default';
|
|
197
|
+
const value = module[exportName];
|
|
198
|
+
const where = `${declaration.module} (library ${declaration.library})`;
|
|
199
|
+
if (!isRecord(value))
|
|
200
|
+
throw new AdapterPluginError('ADAPTER_PLUGIN_INVALID', `adapter '${declaration.id}': ${where} has no ${exportName === 'default' ? 'default export' : `export '${exportName}'`} holding an adapter.`, `export the adapter from ${declaration.module}, or fix "export" in ${RECIPE_LIBRARY_MANIFEST_FILE}`);
|
|
201
|
+
if (value.id !== declaration.id)
|
|
202
|
+
throw new AdapterPluginError('ADAPTER_PLUGIN_INVALID', `adapter '${declaration.id}': ${where} exports an adapter with id '${String(value.id)}'.`, `make the adapter's id '${declaration.id}', or declare it under its own id`);
|
|
203
|
+
if (value.sdkVersion !== ADAPTER_SDK_VERSION)
|
|
204
|
+
throw new AdapterPluginError('ADAPTER_SDK_UNSUPPORTED', `adapter '${declaration.id}' targets adapter SDK ${String(value.sdkVersion)}; ${harnessHost().name} implements ${ADAPTER_SDK_VERSION}.`, `use a version of library ${declaration.library} built for adapter SDK ${ADAPTER_SDK_VERSION}`);
|
|
205
|
+
if (value.extends !== undefined && value.extends !== declaration.extends)
|
|
206
|
+
throw new AdapterPluginError('ADAPTER_PLUGIN_INVALID', `adapter '${declaration.id}' extends '${String(value.extends)}' in code but '${declaration.extends ?? 'nothing'}' in ${RECIPE_LIBRARY_MANIFEST_FILE}.`, `make "extends" in ${RECIPE_LIBRARY_MANIFEST_FILE} match the adapter`);
|
|
207
|
+
return value;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* `child` on top of `parent`: the child's members replace the parent's, except
|
|
211
|
+
* three that append, parent first: the action manifests (`actions.manifestPaths`),
|
|
212
|
+
* the action implementations (`actions.adapters`) and the doctor checks (`doctor`).
|
|
213
|
+
*/
|
|
214
|
+
export function composeAdapter(parent, child) {
|
|
215
|
+
const parentActions = parent.actions;
|
|
216
|
+
const childActions = child.actions ?? {};
|
|
217
|
+
const manifestPaths = (actions) => actions.manifestPaths?.() ?? (actions.manifestPath ? [actions.manifestPath()] : []);
|
|
218
|
+
return {
|
|
219
|
+
...parent,
|
|
220
|
+
...child,
|
|
221
|
+
extends: parent.id,
|
|
222
|
+
actions: {
|
|
223
|
+
...parentActions,
|
|
224
|
+
...childActions,
|
|
225
|
+
manifestPaths: () => [
|
|
226
|
+
...new Set([...manifestPaths(parentActions), ...manifestPaths(childActions)]),
|
|
227
|
+
],
|
|
228
|
+
async adapters() {
|
|
229
|
+
return [
|
|
230
|
+
...((await parentActions.adapters?.()) ?? []),
|
|
231
|
+
...((await childActions.adapters?.()) ?? []),
|
|
232
|
+
];
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
async doctor(target) {
|
|
236
|
+
return [
|
|
237
|
+
...((await parent.doctor?.(target)) ?? []),
|
|
238
|
+
...((await child.doctor?.(target)) ?? []),
|
|
239
|
+
];
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
// What the commands call on every adapter; the SDK types mark the rest optional.
|
|
244
|
+
const REQUIRED_FUNCTIONS = [
|
|
245
|
+
'resolveSlotPorts',
|
|
246
|
+
'runtimeStatus',
|
|
247
|
+
'logSources',
|
|
248
|
+
'appLogSource',
|
|
249
|
+
'launch',
|
|
250
|
+
];
|
|
251
|
+
const REQUIRED_OBJECTS = ['devServer', 'hints', 'actions', 'harness', 'runtimeContext'];
|
|
252
|
+
function assertAdapterMembers(adapter, declaration) {
|
|
253
|
+
const record = adapter;
|
|
254
|
+
const actions = isRecord(record.actions) ? record.actions : {};
|
|
255
|
+
const missing = [
|
|
256
|
+
...REQUIRED_FUNCTIONS.filter((member) => typeof record[member] !== 'function'),
|
|
257
|
+
...REQUIRED_OBJECTS.filter((member) => !isRecord(record[member])),
|
|
258
|
+
...(typeof actions.manifestPath === 'function' ? [] : ['actions.manifestPath']),
|
|
259
|
+
...(Array.isArray(actions.semantic) ? [] : ['actions.semantic']),
|
|
260
|
+
...(isRecord(actions.cdpTarget) ? [] : ['actions.cdpTarget']),
|
|
261
|
+
...(typeof record.headless === 'boolean' ? [] : ['headless']),
|
|
262
|
+
];
|
|
263
|
+
if (missing.length > 0)
|
|
264
|
+
throw new AdapterPluginError('ADAPTER_PLUGIN_INVALID', `adapter '${declaration.id}' from library ${declaration.library} lacks ${missing.join(', ')}.`, declaration.extends
|
|
265
|
+
? `add the members to ${declaration.module}`
|
|
266
|
+
: `add the members to ${declaration.module}, or extend an adapter that has them`);
|
|
267
|
+
}
|
|
268
|
+
function builtinConflict(id, claims) {
|
|
269
|
+
return new AdapterPluginError('ADAPTER_ID_CONFLICT', `adapter '${id}' is built into ${harnessHost().name}; library ${claims.map((d) => d.library).join(', ')} may not declare it.`, `rename the adapter in ${claims[0].root}/${RECIPE_LIBRARY_MANIFEST_FILE}`);
|
|
270
|
+
}
|
|
271
|
+
async function declarations(options, mode) {
|
|
272
|
+
// No recipePath: a task-local library beside a recipe never declares adapters.
|
|
273
|
+
const sources = withConfigured(await resolveRecipeLibrarySources({
|
|
274
|
+
cliEntries: [...(options.libraries ?? [])],
|
|
275
|
+
...(options.env ? { env: options.env } : {}),
|
|
276
|
+
}), options.configured);
|
|
277
|
+
const declared = [];
|
|
278
|
+
for (const source of sources) {
|
|
279
|
+
let manifest;
|
|
280
|
+
try {
|
|
281
|
+
manifest = await readRecipeLibraryManifest(source.root);
|
|
282
|
+
}
|
|
283
|
+
catch (error) {
|
|
284
|
+
// Selecting a built-in only looks for libraries that claim its id, so a
|
|
285
|
+
// broken library never blocks it; selecting a plugin reports the error.
|
|
286
|
+
if (mode.lenient)
|
|
287
|
+
continue;
|
|
288
|
+
throw error;
|
|
289
|
+
}
|
|
290
|
+
for (const [id, declaration] of Object.entries(manifest?.adapters ?? {})) {
|
|
291
|
+
declared.push({ ...declaration, id, library: libraryName(source), root: source.root });
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return declared;
|
|
295
|
+
}
|
|
296
|
+
function libraryName(source) {
|
|
297
|
+
return source.name ?? path.basename(source.root);
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* `resolveRecipeLibrarySources` without the file system, for the grammar: the
|
|
301
|
+
* `--library` entries, then the RECIPE_LIBRARY_PATH entries they don't rename,
|
|
302
|
+
* else the personal library.
|
|
303
|
+
*/
|
|
304
|
+
function librarySourcesSync(libraries, env = process.env) {
|
|
305
|
+
const flagged = libraries.flatMap((entry) => safeParse(entry));
|
|
306
|
+
const renamed = new Set(flagged.map(libraryName));
|
|
307
|
+
const environment = safeParse(env.RECIPE_LIBRARY_PATH ?? '').filter((source) => !renamed.has(libraryName(source)));
|
|
308
|
+
const explicit = [...flagged, ...environment];
|
|
309
|
+
if (explicit.length > 0)
|
|
310
|
+
return explicit;
|
|
311
|
+
const personal = personalRecipeLibraryRoot(env);
|
|
312
|
+
return fs.existsSync(personal) ? [{ name: 'personal', root: personal }] : [];
|
|
313
|
+
}
|
|
314
|
+
function withConfigured(sources, configured = []) {
|
|
315
|
+
const result = [...sources];
|
|
316
|
+
for (const source of configured) {
|
|
317
|
+
const present = result.some((existing) => libraryName(existing) === libraryName(source) ||
|
|
318
|
+
path.resolve(existing.root) === path.resolve(source.root));
|
|
319
|
+
if (!present)
|
|
320
|
+
result.push(source);
|
|
321
|
+
}
|
|
322
|
+
return result;
|
|
323
|
+
}
|
|
324
|
+
function safeParse(value) {
|
|
325
|
+
try {
|
|
326
|
+
return parseRecipeLibraryPath(value);
|
|
327
|
+
}
|
|
328
|
+
catch {
|
|
329
|
+
// A malformed entry adds no adapter ids to the grammar; the command that
|
|
330
|
+
// resolves its libraries reports RECIPE_LIBRARY_PATH_INVALID itself.
|
|
331
|
+
return [];
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function declaredIdsIn(root) {
|
|
335
|
+
let text;
|
|
336
|
+
try {
|
|
337
|
+
text = fs.readFileSync(path.join(root, RECIPE_LIBRARY_MANIFEST_FILE), 'utf8');
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
// A library without recipe-library.json declares no adapters.
|
|
341
|
+
if (error.code === 'ENOENT')
|
|
342
|
+
return [];
|
|
343
|
+
throw error;
|
|
344
|
+
}
|
|
345
|
+
try {
|
|
346
|
+
const value = JSON.parse(text);
|
|
347
|
+
return isRecord(value) && isRecord(value.adapters) ? Object.keys(value.adapters) : [];
|
|
348
|
+
}
|
|
349
|
+
catch {
|
|
350
|
+
// Invalid JSON declares nothing for the grammar, so `--adapter core` still
|
|
351
|
+
// validates; selecting a plugin reads the manifest strictly and reports it.
|
|
352
|
+
return [];
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
function lastOptionValue(tokens, name) {
|
|
356
|
+
let value;
|
|
357
|
+
for (let index = 0; index < tokens.length; index += 1) {
|
|
358
|
+
const token = tokens[index];
|
|
359
|
+
if (token === '--')
|
|
360
|
+
break;
|
|
361
|
+
if (token === name && tokens[index + 1] !== undefined)
|
|
362
|
+
value = tokens[(index += 1)];
|
|
363
|
+
else if (token.startsWith(`${name}=`))
|
|
364
|
+
value = token.slice(name.length + 1);
|
|
365
|
+
}
|
|
366
|
+
return value;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Print a refused adapter selection: the `--json` envelope or the human line.
|
|
370
|
+
* Takes any error with a `code` and `userAction` (the loader's, and the library
|
|
371
|
+
* reader's RECIPE_SOURCE_INVALID); returns the exit code.
|
|
372
|
+
*/
|
|
373
|
+
export function adapterSelectionFailureOut(json, command, error) {
|
|
374
|
+
if (json) {
|
|
375
|
+
console.log(JSON.stringify({
|
|
376
|
+
schemaVersion: 1,
|
|
377
|
+
command,
|
|
378
|
+
status: 'fail',
|
|
379
|
+
exitCode: EXIT.usage,
|
|
380
|
+
error: { code: error.code, message: error.message, userAction: error.userAction },
|
|
381
|
+
}, null, 2));
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
console.error(`✗ ${harnessHost().name} ${command}: ${error.message}\n Next: ${error.userAction}`);
|
|
385
|
+
}
|
|
386
|
+
return EXIT.usage;
|
|
387
|
+
}
|
|
388
|
+
//# sourceMappingURL=adapter-plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter-plugins.js","sourceRoot":"","sources":["../../src/harness/adapter-plugins.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gFAAgF;AAChF,6EAA6E;AAC7E,wEAAwE;AACxE,mEAAmE;AACnE,EAAE;AACF,yEAAyE;AACzE,iFAAiF;AACjF,gFAAgF;AAChF,iFAAiF;AACjF,gFAAgF;AAChF,8EAA8E;AAC9E,2DAA2D;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,mBAAmB,GAGpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,4BAA4B,EAG5B,gBAAgB,EAChB,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE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AAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE;SAClF,EACD,IAAI,EACJ,CAAC,CACF,CACF,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CACX,KAAK,WAAW,EAAE,CAAC,IAAI,IAAI,OAAO,KAAK,KAAK,CAAC,OAAO,aAAa,KAAK,CAAC,UAAU,EAAE,CACpF,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type RecipeActionManifestDocument, type RecipeExecutionCapability, type RecipeSourceProvenance } from '@farmslot/protocol';
|
|
2
|
+
import type { RecipeLibrarySource } from '@farmslot/recipe-runner';
|
|
3
|
+
import { type ActionMatrixRow } from '../action-catalog.js';
|
|
4
|
+
/** Where one resolved action came from. */
|
|
5
|
+
export interface ActionCapabilitySource {
|
|
6
|
+
name: string;
|
|
7
|
+
tier: 'official' | 'personal' | 'team' | 'canonical' | 'task';
|
|
8
|
+
manifestPath: string;
|
|
9
|
+
shadows?: string[];
|
|
10
|
+
trust?: RecipeSourceProvenance['trust'];
|
|
11
|
+
implementationRoot?: string;
|
|
12
|
+
digest?: string;
|
|
13
|
+
resolveDigest?: () => Promise<string>;
|
|
14
|
+
}
|
|
15
|
+
export interface ResolvedActionManifest {
|
|
16
|
+
manifest: RecipeActionManifestDocument;
|
|
17
|
+
actionSources: Map<string, ActionCapabilitySource>;
|
|
18
|
+
}
|
|
19
|
+
export interface RecipeCatalog {
|
|
20
|
+
/** The library the host ships: its source name, root, and the namespace of its action names. */
|
|
21
|
+
bundledLibrary: {
|
|
22
|
+
name: string;
|
|
23
|
+
root: string;
|
|
24
|
+
actionNamespace: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* The adapter's action manifest merged across the library sources (the
|
|
28
|
+
* bundled one last), or the override manifest with its task action root.
|
|
29
|
+
*/
|
|
30
|
+
resolveActionManifest(adapter: string, overridePath?: string, sources?: readonly RecipeLibrarySource[], taskActionRoot?: string): Promise<ResolvedActionManifest>;
|
|
31
|
+
/** Throws when the manifest document is invalid. */
|
|
32
|
+
validateManifest(manifest: RecipeActionManifestDocument): Promise<unknown>;
|
|
33
|
+
/** The execution capabilities the host enforces for a bundled action. */
|
|
34
|
+
actionCapabilities(action: string): readonly RecipeExecutionCapability[];
|
|
35
|
+
}
|
|
36
|
+
export interface DescribedAction {
|
|
37
|
+
name: string;
|
|
38
|
+
kind: 'official' | 'custom';
|
|
39
|
+
category: string;
|
|
40
|
+
description: string;
|
|
41
|
+
fields: string[];
|
|
42
|
+
schema?: unknown;
|
|
43
|
+
examples?: unknown;
|
|
44
|
+
result_cases?: string[];
|
|
45
|
+
source: string;
|
|
46
|
+
sourceTier: ActionCapabilitySource['tier'];
|
|
47
|
+
sourceManifest: string;
|
|
48
|
+
shadows: string[];
|
|
49
|
+
capabilities: RecipeExecutionCapability[];
|
|
50
|
+
}
|
|
51
|
+
/** `--library` arguments that reproduce the non-bundled sources of a lookup. */
|
|
52
|
+
export declare function actionLibraryContextArgs(catalog: RecipeCatalog, librarySources?: readonly RecipeLibrarySource[]): string;
|
|
53
|
+
/** Every action across the registered adapters, with the adapters that declare it. */
|
|
54
|
+
export declare function resolveActionCapabilityMatrix(catalog: RecipeCatalog, librarySources?: readonly RecipeLibrarySource[]): Promise<ActionMatrixRow[]>;
|
|
55
|
+
export declare function describeManifestActions(catalog: RecipeCatalog, manifest: unknown, actionSources?: ReadonlyMap<string, ActionCapabilitySource>): DescribedAction[];
|
|
56
|
+
/**
|
|
57
|
+
* One action in full, as `actions --action <name>` and `call <action> --help`
|
|
58
|
+
* print it: the call form, description, source and adapter, risk, result
|
|
59
|
+
* cases, fields with their types, up to two authored examples, and the first
|
|
60
|
+
* one as a runnable call with its recipe node. `actionNames` is the adapter's
|
|
61
|
+
* vocabulary, which decides whether the short name is unambiguous.
|
|
62
|
+
*/
|
|
63
|
+
export declare function renderActionDetail(entry: DescribedAction, adapter: string, target: string, executable: string, actionNames: readonly string[]): string;
|
|
64
|
+
/** The authored example as a human block: the call that runs it and its recipe node. */
|
|
65
|
+
export declare function renderHumanActionExample(entry: DescribedAction, adapter: string, target: string, executable: string): string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* A runnable `call` for the action's authored example; `preferredValues` pick
|
|
68
|
+
* the closest example and override its values.
|
|
69
|
+
*/
|
|
70
|
+
export declare function actionExampleCommand(entry: DescribedAction, adapter: string, target: string, executable: string, preferredValues?: Record<string, unknown>): string | undefined;
|
|
71
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/harness/catalog.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,sBAAsB,CAAC;AAS9B,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAC9D,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,4BAA4B,CAAC;I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