@farmslot/recipe-cli 0.1.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 +15 -0
- package/LICENSE +21 -0
- package/README.md +53 -0
- package/bin/farmslot-recipe.mjs +10 -0
- package/dist/cli.d.ts +12 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +54 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands.d.ts +13 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +393 -0
- package/dist/commands.js.map +1 -0
- package/dist/composition.d.ts +21 -0
- package/dist/composition.d.ts.map +1 -0
- package/dist/composition.js +232 -0
- package/dist/composition.js.map +1 -0
- package/dist/discovery-error.d.ts +8 -0
- package/dist/discovery-error.d.ts.map +1 -0
- package/dist/discovery-error.js +10 -0
- package/dist/discovery-error.js.map +1 -0
- package/dist/discovery-index.d.ts +63 -0
- package/dist/discovery-index.d.ts.map +1 -0
- package/dist/discovery-index.js +407 -0
- package/dist/discovery-index.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/libraries.d.ts +18 -0
- package/dist/libraries.d.ts.map +1 -0
- package/dist/libraries.js +102 -0
- package/dist/libraries.js.map +1 -0
- package/dist/render.d.ts +9 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +165 -0
- package/dist/render.js.map +1 -0
- package/dist/search.d.ts +8 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +90 -0
- package/dist/search.js.map +1 -0
- package/dist/template.d.ts +12 -0
- package/dist/template.d.ts.map +1 -0
- package/dist/template.js +74 -0
- package/dist/template.js.map +1 -0
- package/dist/types.d.ts +262 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +4 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +12 -0
- package/dist/version.js.map +1 -0
- package/package.json +71 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@farmslot/recipe-cli` are tracked here.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
- Active-development baseline; add user-facing changes here before release or package publication.
|
|
8
|
+
|
|
9
|
+
## 0.1.0 - 2026-10-02
|
|
10
|
+
|
|
11
|
+
- Add the `farmslot-recipe` front door, moved from `@farmslot/recipe-harness`: `run` and `validate` as before, plus library-wide discovery with stable `--json` envelopes. `actions`, `list`, `describe`, `explain`, `search`, `template` and `completions` resolve every library on `RECIPE_LIBRARY_PATH` and `--library`, show precedence, shadows, namespaced `<library>.<ref>` ids and library digests, and work for a library with no platform adapter. Discovery and `run` resolve refs, platform aliases and ids identically; every failure prints the `--json` error envelope, and usage errors (malformed `--library` included) exit 2. `search` finds shadowed recipes by id, `explain --strict` exits 3 on gaps, and each command loads a library set once per platform.
|
|
12
|
+
- `assessRecipe` accepts any `RecipeReadinessView` (`{ resolution, manifest }`), so a host can judge readiness on its own single-platform resolution against the manifest its runner executes. `buildDiscoveryIndex` vouches only for the `packageVersions` the host passes, so a library's `requires` gives discovery and the host's `run` the same answer; `farmslot-recipe` still vouches for itself.
|
|
13
|
+
- Export `assessRecipe` so host CLIs can judge any resolved recipe, a qualified alias included, with the same readiness rule as `list`.
|
|
14
|
+
- `search` without `--platform` finds shadowed platform-only recipes by their `<library>.<ref>` id, listing each id once.
|
|
15
|
+
- Publish with protocol 0.34.0 and recipe-harness 0.22.0 so consumers share one protocol and runtime.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arthur Breton
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# @farmslot/recipe-cli
|
|
2
|
+
|
|
3
|
+
The `farmslot-recipe` command: run and validate Recipe Protocol v1 recipes, and discover what
|
|
4
|
+
your recipe libraries offer. Discovery needs only a library on disk: no app, device or platform
|
|
5
|
+
adapter.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm i -D @farmslot/recipe-cli
|
|
9
|
+
export RECIPE_LIBRARY_PATH="hello=./recipe-library"
|
|
10
|
+
npx farmslot-recipe list
|
|
11
|
+
npx farmslot-recipe actions
|
|
12
|
+
npx farmslot-recipe describe hello.greet
|
|
13
|
+
npx farmslot-recipe explain greet-twice --param guest=Ada
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
| command | answers |
|
|
17
|
+
| ------------------------- | --------------------------------------------------------------------------- |
|
|
18
|
+
| `actions` | every action the libraries declare or this CLI handles, with its parameters |
|
|
19
|
+
| `list` | recipes across all libraries, with variants and whether they can run |
|
|
20
|
+
| `describe <name>` | parameters, examples, outputs, callers and variants of a recipe or action |
|
|
21
|
+
| `explain <recipe>` | the resolved call graph, parameter flow, required actions and gaps |
|
|
22
|
+
| `search <text>` | ids, descriptions and parameter names |
|
|
23
|
+
| `template <name>` | a ready-to-edit workflow node and recipe skeleton |
|
|
24
|
+
| `completions [bash\|zsh]` | a shell completion script |
|
|
25
|
+
|
|
26
|
+
Every command takes `--library name=path` (repeatable), `--platform <id>` and `--json`.
|
|
27
|
+
|
|
28
|
+
Docs: https://farmslot.io/docs/reference/recipe-discovery
|
|
29
|
+
|
|
30
|
+
## Source layout
|
|
31
|
+
|
|
32
|
+
| path | owns |
|
|
33
|
+
| --------------------------------------------------- | --------------------------------------------------------------------------- |
|
|
34
|
+
| `src/cli.ts` | the `farmslot-recipe` program: the runner's `run`/`validate` plus discovery |
|
|
35
|
+
| `src/commands.ts` | discovery command registration, JSON envelopes and errors |
|
|
36
|
+
| `src/libraries.ts` | library resolution: precedence, overrides, digests, `requires` checks |
|
|
37
|
+
| `src/discovery-index.ts` | the recipe and action index for one platform view |
|
|
38
|
+
| `src/composition.ts` | composition, callers and `explain` |
|
|
39
|
+
| `src/search.ts`, `src/template.ts`, `src/render.ts` | search ranking, skeletons, text output |
|
|
40
|
+
| `src/types.ts` | the documented `--json` schema |
|
|
41
|
+
|
|
42
|
+
## Maintenance rules
|
|
43
|
+
|
|
44
|
+
- Discovery is generic. Product names, platforms and actions come from libraries, never from this package.
|
|
45
|
+
- Library loading, recipe identity and precedence belong to `@farmslot/recipe-harness`; this package reads them and must not re-implement them.
|
|
46
|
+
- `--json` envelopes are a contract: add fields freely, but bump `DISCOVERY_SCHEMA_VERSION` before removing or renaming one.
|
|
47
|
+
- Discovery never runs actions or loads adapter code.
|
|
48
|
+
|
|
49
|
+
## Local quality
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
yarn workspace @farmslot/recipe-cli quality
|
|
53
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runRecipeCli } from '../dist/cli.js';
|
|
3
|
+
|
|
4
|
+
try {
|
|
5
|
+
await runRecipeCli(process.argv.slice(2));
|
|
6
|
+
} catch (error) {
|
|
7
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
8
|
+
console.error(message);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Command } from 'commander';
|
|
2
|
+
export interface RecipeCliOptions {
|
|
3
|
+
commandName?: string;
|
|
4
|
+
}
|
|
5
|
+
/** The `farmslot-recipe` program: the runner's run/validate plus the discovery commands. */
|
|
6
|
+
export declare function createRecipeCliProgram(options?: RecipeCliOptions): Command;
|
|
7
|
+
/**
|
|
8
|
+
* Run the CLI. Argument errors exit 2; with --json they print the error envelope instead of
|
|
9
|
+
* commander's usage text.
|
|
10
|
+
*/
|
|
11
|
+
export declare function runRecipeCli(argv: string[], options?: RecipeCliOptions): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAkB,MAAM,WAAW,CAAC;AAQzD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,4FAA4F;AAC5F,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAe9E;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BhG"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CommanderError } from 'commander';
|
|
2
|
+
import { createStandardCoreAdapters } from '@farmslot/recipe-harness';
|
|
3
|
+
import { createRecipeHarnessProgram } from '@farmslot/recipe-harness/cli';
|
|
4
|
+
import { printFailure, registerDiscoveryCommands } from './commands.js';
|
|
5
|
+
import { RECIPE_CLI_PACKAGE_VERSIONS, RECIPE_CLI_VERSION } from './version.js';
|
|
6
|
+
/** The `farmslot-recipe` program: the runner's run/validate plus the discovery commands. */
|
|
7
|
+
export function createRecipeCliProgram(options = {}) {
|
|
8
|
+
const commandName = options.commandName ?? 'farmslot-recipe';
|
|
9
|
+
const program = createRecipeHarnessProgram({
|
|
10
|
+
commandName,
|
|
11
|
+
description: 'Farmslot recipe CLI: run, validate and discover recipes and actions',
|
|
12
|
+
version: RECIPE_CLI_VERSION,
|
|
13
|
+
packageVersions: RECIPE_CLI_PACKAGE_VERSIONS,
|
|
14
|
+
});
|
|
15
|
+
registerDiscoveryCommands(program, {
|
|
16
|
+
commandName,
|
|
17
|
+
// `run` registers the standard core handlers, so discovery reports the same set.
|
|
18
|
+
handlers: createStandardCoreAdapters().map((adapter) => adapter.action),
|
|
19
|
+
packageVersions: RECIPE_CLI_PACKAGE_VERSIONS,
|
|
20
|
+
});
|
|
21
|
+
return program;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Run the CLI. Argument errors exit 2; with --json they print the error envelope instead of
|
|
25
|
+
* commander's usage text.
|
|
26
|
+
*/
|
|
27
|
+
export async function runRecipeCli(argv, options = {}) {
|
|
28
|
+
const program = createRecipeCliProgram(options);
|
|
29
|
+
const json = argv.includes('--json');
|
|
30
|
+
for (const command of [program, ...program.commands]) {
|
|
31
|
+
command.exitOverride();
|
|
32
|
+
if (json)
|
|
33
|
+
command.configureOutput({ writeErr: () => undefined });
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
await program.parseAsync(argv, { from: 'user' });
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
if (!(error instanceof CommanderError))
|
|
40
|
+
throw error;
|
|
41
|
+
// --help and --version end through the same override with exit code 0.
|
|
42
|
+
if (error.exitCode === 0)
|
|
43
|
+
return;
|
|
44
|
+
const command = program.commands.find((entry) => entry.name() === argv[0])?.name() ?? null;
|
|
45
|
+
if (json)
|
|
46
|
+
printFailure(command, {
|
|
47
|
+
code: 'DISCOVERY_USAGE',
|
|
48
|
+
message: error.message.replace(/^error: /u, ''),
|
|
49
|
+
userAction: `${program.name()} ${command ?? ''} --help`.replace(/ {2}/gu, ' '),
|
|
50
|
+
}, true);
|
|
51
|
+
process.exitCode = 2;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAM/E,4FAA4F;AAC5F,MAAM,UAAU,sBAAsB,CAAC,UAA4B,EAAE;IACnE,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,iBAAiB,CAAC;IAC7D,MAAM,OAAO,GAAG,0BAA0B,CAAC;QACzC,WAAW;QACX,WAAW,EAAE,qEAAqE;QAClF,OAAO,EAAE,kBAAkB;QAC3B,eAAe,EAAE,2BAA2B;KAC7C,CAAC,CAAC;IACH,yBAAyB,CAAC,OAAO,EAAE;QACjC,WAAW;QACX,iFAAiF;QACjF,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,CAAC,WAAW,EAAE,EAAE,CAAC;gBAC/C,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,IAAI,OAAO,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;aAC/E,EACD,IAAI,CACL,CAAC;QACJ,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Command } from 'commander';
|
|
2
|
+
import { type DiscoveryErrorEnvelope } from './types.js';
|
|
3
|
+
export interface DiscoveryCommandContext {
|
|
4
|
+
/** Binary name used in printed commands. */
|
|
5
|
+
commandName: string;
|
|
6
|
+
/** Actions with a handler registered by the host CLI. */
|
|
7
|
+
handlers?: readonly string[];
|
|
8
|
+
/** Package versions the host provides for checking each library's `requires`. */
|
|
9
|
+
packageVersions?: Readonly<Record<string, string>>;
|
|
10
|
+
}
|
|
11
|
+
export declare function registerDiscoveryCommands(program: Command, context: DiscoveryCommandContext): void;
|
|
12
|
+
export declare function printFailure(command: string | null, error: DiscoveryErrorEnvelope['error'], json: boolean): void;
|
|
13
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAyCzC,OAAO,EAOL,KAAK,sBAAsB,EAO5B,MAAM,YAAY,CAAC;AAQpB,MAAM,WAAW,uBAAuB;IACtC,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,iFAAiF;IACjF,eAAe,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,uBAAuB,GAC/B,IAAI,CAkNN;AAuQD,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,KAAK,EAAE,sBAAsB,CAAC,OAAO,CAAC,EACtC,IAAI,EAAE,OAAO,GACZ,IAAI,CASN"}
|
package/dist/commands.js
ADDED
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import { parseRecipeLibraryPath, RecipeResolutionError, RecipeTrustError, } from '@farmslot/recipe-harness';
|
|
2
|
+
import { parseRecipeParamAssignments } from '@farmslot/recipe-harness/cli/support';
|
|
3
|
+
import { actionCallers, explainRecipe, recipeCallers, recipeComposition } from './composition.js';
|
|
4
|
+
import { DiscoveryError } from './discovery-error.js';
|
|
5
|
+
import { assessRecipe, buildDiscoveryIndex, findRecipe, libraryInfos, recipeSummary, shadowedRecipes, suggestNames, } from './discovery-index.js';
|
|
6
|
+
import { PRECEDENCE_RULES } from './libraries.js';
|
|
7
|
+
import { renderActions, renderDescribeAction, renderDescribeRecipe, renderExplain, renderLibraries, renderList, renderSearch, } from './render.js';
|
|
8
|
+
import { searchIndex } from './search.js';
|
|
9
|
+
import { actionTemplateNode, recipeSkeleton, recipeTemplateNode, requiredAssignments, shellQuote, } from './template.js';
|
|
10
|
+
import { DISCOVERY_SCHEMA_VERSION, } from './types.js';
|
|
11
|
+
export function registerDiscoveryCommands(program, context) {
|
|
12
|
+
const index = (options) => {
|
|
13
|
+
for (const entry of options.library) {
|
|
14
|
+
try {
|
|
15
|
+
parseRecipeLibraryPath(entry);
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
// A malformed --library value is an argument error, reported before any loading.
|
|
19
|
+
if (!(error instanceof RecipeResolutionError))
|
|
20
|
+
throw error;
|
|
21
|
+
throw new DiscoveryError('DISCOVERY_USAGE', error.message, error.userAction);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return buildDiscoveryIndex({
|
|
25
|
+
libraries: options.library,
|
|
26
|
+
...(options.platform ? { platform: options.platform } : {}),
|
|
27
|
+
...(context.handlers ? { handlers: context.handlers } : {}),
|
|
28
|
+
...(context.packageVersions ? { packageVersions: context.packageVersions } : {}),
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
const invocation = (options) => ({
|
|
32
|
+
commandName: context.commandName,
|
|
33
|
+
libraries: options.library,
|
|
34
|
+
platform: options.platform ?? null,
|
|
35
|
+
});
|
|
36
|
+
viewOptions(program.command('actions'))
|
|
37
|
+
.description('List every action the resolved libraries declare or this CLI handles')
|
|
38
|
+
.option('--source <library>', 'Only actions owned by this library')
|
|
39
|
+
.action(handle('actions', async (options) => {
|
|
40
|
+
const view = await index(options);
|
|
41
|
+
const actions = [...view.actions.values()]
|
|
42
|
+
.filter((action) => !options.source || action.source === options.source)
|
|
43
|
+
.map(summarizeAction);
|
|
44
|
+
const envelope = {
|
|
45
|
+
...ok('actions'),
|
|
46
|
+
platform: view.platform,
|
|
47
|
+
libraries: libraryInfos(view),
|
|
48
|
+
actions,
|
|
49
|
+
};
|
|
50
|
+
print(options, envelope, () => [
|
|
51
|
+
...renderLibraries(envelope.libraries),
|
|
52
|
+
...renderActions(actions, view.platform),
|
|
53
|
+
]);
|
|
54
|
+
}));
|
|
55
|
+
viewOptions(program.command('list'))
|
|
56
|
+
.description('List recipes from the resolved libraries, namespaced, with their variants')
|
|
57
|
+
.option('--source <library>', 'Only recipes resolved from this library')
|
|
58
|
+
.option('--runnable', 'Only recipes that validate against the declared actions in this view')
|
|
59
|
+
.action(handle('list', async (options) => {
|
|
60
|
+
const view = await index(options);
|
|
61
|
+
const recipes = [...view.recipes.values()].filter((recipe) => (!options.source || recipe.source === options.source) &&
|
|
62
|
+
(!options.runnable || recipe.runnable === true));
|
|
63
|
+
const envelope = {
|
|
64
|
+
...ok('list'),
|
|
65
|
+
platform: view.platform,
|
|
66
|
+
platforms: view.platforms,
|
|
67
|
+
libraries: libraryInfos(view),
|
|
68
|
+
recipes,
|
|
69
|
+
};
|
|
70
|
+
print(options, envelope, () => [
|
|
71
|
+
...renderLibraries(envelope.libraries, PRECEDENCE_RULES),
|
|
72
|
+
...renderList(recipes, view.platform, view.platforms),
|
|
73
|
+
]);
|
|
74
|
+
}));
|
|
75
|
+
viewOptions(program.command('describe'))
|
|
76
|
+
.description('Describe an action or recipe: parameters, examples, outputs, callers, variants')
|
|
77
|
+
.argument('<name>', 'Action name, recipe ref, or <library>.<ref>')
|
|
78
|
+
.option('--kind <kind>', 'recipe or action, when a name is both')
|
|
79
|
+
.action(handle('describe', async (name, options) => {
|
|
80
|
+
const view = await index(options);
|
|
81
|
+
const target = await resolveTarget(view, name, options.kind, 'describe', context);
|
|
82
|
+
const envelope = {
|
|
83
|
+
...ok('describe'),
|
|
84
|
+
platform: view.platform,
|
|
85
|
+
libraries: libraryInfos(view),
|
|
86
|
+
kind: target.kind,
|
|
87
|
+
...(target.kind === 'recipe'
|
|
88
|
+
? { recipe: describeRecipe(view, target, invocation(options)) }
|
|
89
|
+
: { action: describeAction(view, target.action) }),
|
|
90
|
+
};
|
|
91
|
+
print(options, envelope, () => envelope.recipe
|
|
92
|
+
? renderDescribeRecipe(envelope.recipe)
|
|
93
|
+
: renderDescribeAction(envelope.action));
|
|
94
|
+
}));
|
|
95
|
+
viewOptions(program.command('explain'))
|
|
96
|
+
.description('Show the resolved composition graph of a recipe without a target')
|
|
97
|
+
.argument('<recipe>', 'Recipe ref, platform alias, or <library>.<ref>')
|
|
98
|
+
.option('--param <key=value>', 'Root recipe parameter (repeatable)', collect, [])
|
|
99
|
+
.option('--strict', 'Exit 3 when anything is missing (parameters, recipes, actions, problems)')
|
|
100
|
+
.action(handle('explain', async (name, options) => {
|
|
101
|
+
const view = await index(options);
|
|
102
|
+
const params = parseParams(options.param, context.commandName);
|
|
103
|
+
const target = await resolveTarget(view, name, 'recipe', 'explain', context);
|
|
104
|
+
if (target.kind !== 'recipe')
|
|
105
|
+
throw new Error('unreachable: explain resolves recipes only');
|
|
106
|
+
const envelope = {
|
|
107
|
+
...ok('explain'),
|
|
108
|
+
libraries: libraryInfos(view),
|
|
109
|
+
...explainRecipe(view, target.match.recipe, params),
|
|
110
|
+
};
|
|
111
|
+
print(options, envelope, () => renderExplain(envelope));
|
|
112
|
+
// Without --strict, explain is a report: callers must read missing.* themselves.
|
|
113
|
+
const { parameters, recipes, actions, problems } = envelope.missing;
|
|
114
|
+
if (options.strict &&
|
|
115
|
+
parameters.length + recipes.length + actions.length + problems.length > 0)
|
|
116
|
+
process.exitCode = 3;
|
|
117
|
+
}));
|
|
118
|
+
viewOptions(program.command('search'))
|
|
119
|
+
.description('Search action and recipe ids, descriptions and parameters')
|
|
120
|
+
.argument('<text...>', 'Search terms; every term must match')
|
|
121
|
+
.action(handle('search', async (text, options) => {
|
|
122
|
+
const view = await index(options);
|
|
123
|
+
const query = text.join(' ');
|
|
124
|
+
const envelope = {
|
|
125
|
+
...ok('search'),
|
|
126
|
+
platform: view.platform,
|
|
127
|
+
query,
|
|
128
|
+
results: searchIndex(view, query, await shadowedRecipes(view)),
|
|
129
|
+
};
|
|
130
|
+
print(options, envelope, () => renderSearch(envelope.results, query));
|
|
131
|
+
}));
|
|
132
|
+
viewOptions(program.command('template'))
|
|
133
|
+
.description('Print a ready-to-edit workflow node and recipe skeleton for an action or recipe')
|
|
134
|
+
.argument('<name>', 'Action name, recipe ref, or <library>.<ref>')
|
|
135
|
+
.option('--kind <kind>', 'recipe or action, when a name is both')
|
|
136
|
+
.action(handle('template', async (name, options) => {
|
|
137
|
+
const view = await index(options);
|
|
138
|
+
const target = await resolveTarget(view, name, options.kind, 'template', context);
|
|
139
|
+
const envelope = target.kind === 'recipe'
|
|
140
|
+
? recipeTemplate(view, target, invocation(options))
|
|
141
|
+
: actionTemplate(view, target.action, invocation(options));
|
|
142
|
+
print(options, envelope, () => [
|
|
143
|
+
'Node:',
|
|
144
|
+
...indent(JSON.stringify(envelope.node, null, 2)),
|
|
145
|
+
'Recipe:',
|
|
146
|
+
...indent(JSON.stringify(envelope.recipe, null, 2)),
|
|
147
|
+
`Run: ${envelope.runCommand}`,
|
|
148
|
+
]);
|
|
149
|
+
}));
|
|
150
|
+
viewOptions(program.command('completions'))
|
|
151
|
+
.description('Print a bash/zsh completion script, or completion candidates from the index')
|
|
152
|
+
.argument('[shell]', 'bash or zsh', 'bash')
|
|
153
|
+
.option('--candidates <kind>', 'Print candidates instead: commands, actions or recipes')
|
|
154
|
+
.action(handle('completions', async (shell, options) => {
|
|
155
|
+
if (!options.candidates) {
|
|
156
|
+
if (shell !== 'bash' && shell !== 'zsh')
|
|
157
|
+
throw new DiscoveryError('DISCOVERY_USAGE', `Unsupported shell ${shell}.`, `${context.commandName} completions bash`);
|
|
158
|
+
const script = completionScript(context.commandName, shell);
|
|
159
|
+
const envelope = {
|
|
160
|
+
...ok('completions'),
|
|
161
|
+
kind: 'script',
|
|
162
|
+
shell,
|
|
163
|
+
script,
|
|
164
|
+
};
|
|
165
|
+
print(options, envelope, () => [script]);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const kind = options.candidates;
|
|
169
|
+
if (kind !== 'commands' && kind !== 'actions' && kind !== 'recipes')
|
|
170
|
+
throw new DiscoveryError('DISCOVERY_USAGE', `Unknown candidate kind ${kind}.`, `${context.commandName} completions --candidates recipes`);
|
|
171
|
+
const candidates = kind === 'commands'
|
|
172
|
+
? program.commands.map((command) => command.name()).sort()
|
|
173
|
+
: kind === 'actions'
|
|
174
|
+
? [...(await index(options)).actions.keys()]
|
|
175
|
+
: recipeCandidates(await index(options));
|
|
176
|
+
const envelope = { ...ok('completions'), kind, candidates };
|
|
177
|
+
print(options, envelope, () => candidates);
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
/** Every name `run`, `describe` and `explain` accept: refs, platform aliases and library ids. */
|
|
181
|
+
function recipeCandidates(view) {
|
|
182
|
+
const names = new Set(view.resolution.recipes.keys());
|
|
183
|
+
for (const recipe of view.recipes.values()) {
|
|
184
|
+
names.add(recipe.ref);
|
|
185
|
+
names.add(recipe.id);
|
|
186
|
+
for (const shadow of recipe.shadows)
|
|
187
|
+
names.add(`${shadow}.${recipe.ref}`);
|
|
188
|
+
}
|
|
189
|
+
return [...names].sort();
|
|
190
|
+
}
|
|
191
|
+
function viewOptions(command) {
|
|
192
|
+
return command
|
|
193
|
+
.option('--library <entry>', 'Recipe library as name=path or path (repeatable; earlier wins; replaces a RECIPE_LIBRARY_PATH entry with the same name)', collect, [])
|
|
194
|
+
.option('--platform <id>', 'Platform view: platform variants and platform action manifests')
|
|
195
|
+
.option('--json', 'Print the stable JSON envelope');
|
|
196
|
+
}
|
|
197
|
+
async function resolveTarget(view, name, kind, command, context) {
|
|
198
|
+
if (kind !== undefined && kind !== 'recipe' && kind !== 'action')
|
|
199
|
+
throw new DiscoveryError('DISCOVERY_USAGE', `--kind must be recipe or action.`, `${context.commandName} ${command} ${name} --kind recipe`);
|
|
200
|
+
const recipe = kind === 'action' ? undefined : await findRecipe(view, name);
|
|
201
|
+
const action = kind === 'recipe' ? undefined : view.actions.get(name);
|
|
202
|
+
if (recipe && action)
|
|
203
|
+
throw new DiscoveryError('DISCOVERY_NAME_AMBIGUOUS', `${name} is both a recipe and an action.`, `${context.commandName} ${command} ${name} --kind recipe`);
|
|
204
|
+
if (recipe)
|
|
205
|
+
return { kind: 'recipe', name, match: recipe };
|
|
206
|
+
if (action)
|
|
207
|
+
return { kind: 'action', action };
|
|
208
|
+
if (kind !== 'action' && view.recipes.get(name)?.runnable === null) {
|
|
209
|
+
const platforms = view.recipes.get(name).variants.map((variant) => variant.platform);
|
|
210
|
+
throw new DiscoveryError('RECIPE_PLATFORM_REQUIRED', `Recipe ${name} only exists as platform variants: ${platforms.join(', ')}.`, `${context.commandName} ${command} ${name} --platform ${platforms[0]}`);
|
|
211
|
+
}
|
|
212
|
+
const candidates = [
|
|
213
|
+
...(kind === 'action' ? [] : recipeCandidates(view)),
|
|
214
|
+
...(kind === 'recipe' ? [] : view.actions.keys()),
|
|
215
|
+
];
|
|
216
|
+
const suggestions = suggestNames(name, candidates);
|
|
217
|
+
throw new DiscoveryError('DISCOVERY_NOT_FOUND', `No ${kind ?? 'recipe or action'} named ${name}${view.platform ? ` for platform ${view.platform}` : ''}.`, suggestions.length > 0
|
|
218
|
+
? `did you mean ${suggestions.join(', ')}? Inspect: ${context.commandName} search ${shellQuote(name)}`
|
|
219
|
+
: `${context.commandName} search ${shellQuote(name)}`);
|
|
220
|
+
}
|
|
221
|
+
/** Whether the matched recipe is what its plain ref resolves to in this view. */
|
|
222
|
+
function isPrecedenceWinner(view, match) {
|
|
223
|
+
return view.resolution.recipes.get(match.recipe.ref)?.path === match.recipe.path;
|
|
224
|
+
}
|
|
225
|
+
function recipeTemplate(view, target, invocation) {
|
|
226
|
+
const { recipe } = target.match;
|
|
227
|
+
if (!isPrecedenceWinner(view, target.match)) {
|
|
228
|
+
// Call nodes resolve refs by precedence, so a node cannot select a shadowed recipe.
|
|
229
|
+
const winner = view.resolution.recipes.get(recipe.ref);
|
|
230
|
+
throw new DiscoveryError('RECIPE_SHADOWED', `${target.name} is shadowed by library ${winner.source}; a call node with ref ${recipe.ref} would run that recipe instead.`, `rank ${recipe.source} first with --library ${recipe.source}=<path>, or rename the recipe`);
|
|
231
|
+
}
|
|
232
|
+
const summary = recipeSummary(recipe);
|
|
233
|
+
const node = recipeTemplateNode(recipe.ref, summary.parameters);
|
|
234
|
+
return {
|
|
235
|
+
...ok('template'),
|
|
236
|
+
platform: view.platform,
|
|
237
|
+
kind: 'recipe',
|
|
238
|
+
name: recipe.ref,
|
|
239
|
+
node,
|
|
240
|
+
recipe: recipeSkeleton(`Calls ${recipe.ref}`, node),
|
|
241
|
+
runCommand: runCommand(invocation, target.name, summary.parameters),
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
function actionTemplate(view, action, invocation) {
|
|
245
|
+
const node = actionTemplateNode(action);
|
|
246
|
+
const file = `./${action.name.replaceAll(/[^A-Za-z0-9_-]+/gu, '-')}.recipe.json`;
|
|
247
|
+
return {
|
|
248
|
+
...ok('template'),
|
|
249
|
+
platform: view.platform,
|
|
250
|
+
kind: 'action',
|
|
251
|
+
name: action.name,
|
|
252
|
+
node,
|
|
253
|
+
recipe: recipeSkeleton(`Runs ${action.name}`, node),
|
|
254
|
+
runCommand: runCommand(invocation, file, []),
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function describeRecipe(view, target, invocation) {
|
|
258
|
+
const { recipe, resolvedBy } = target.match;
|
|
259
|
+
const summary = recipeSummary(recipe);
|
|
260
|
+
const indexed = view.recipes.get(recipe.aliasFor ?? recipe.ref);
|
|
261
|
+
const problems = assessRecipe(view, recipe);
|
|
262
|
+
return {
|
|
263
|
+
...summary,
|
|
264
|
+
variants: indexed?.variants ?? [],
|
|
265
|
+
runnable: problems.length === 0,
|
|
266
|
+
problems,
|
|
267
|
+
path: recipe.path,
|
|
268
|
+
resolvedBy,
|
|
269
|
+
proofTargets: recipe.document.proofTargets ?? null,
|
|
270
|
+
...recipeComposition(recipe.document, view.resolution.recipes),
|
|
271
|
+
callers: recipeCallers(view, recipe.ref),
|
|
272
|
+
runCommand: runCommand(invocation, target.name, summary.parameters),
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function describeAction(view, action) {
|
|
276
|
+
return { ...action, callers: actionCallers(view, action.name) };
|
|
277
|
+
}
|
|
278
|
+
function summarizeAction(action) {
|
|
279
|
+
const { schema: _schema, examples: _examples, ...summary } = action;
|
|
280
|
+
return summary;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* A `run` command that resolves the same recipe: the name as given (ref, alias or id), the same
|
|
284
|
+
* --library entries, and the platform. `run` still selects variants with --adapter and needs an
|
|
285
|
+
* explicit action manifest.
|
|
286
|
+
*/
|
|
287
|
+
function runCommand(invocation, recipe, parameters) {
|
|
288
|
+
return [
|
|
289
|
+
invocation.commandName,
|
|
290
|
+
'run',
|
|
291
|
+
shellQuote(recipe),
|
|
292
|
+
...requiredAssignments(parameters),
|
|
293
|
+
...invocation.libraries.flatMap((entry) => ['--library', shellQuote(entry)]),
|
|
294
|
+
'--action-manifest',
|
|
295
|
+
'<manifest.json>',
|
|
296
|
+
'--artifacts-dir',
|
|
297
|
+
'<dir>',
|
|
298
|
+
...(invocation.platform ? ['--adapter', invocation.platform] : []),
|
|
299
|
+
].join(' ');
|
|
300
|
+
}
|
|
301
|
+
function parseParams(assignments, commandName) {
|
|
302
|
+
try {
|
|
303
|
+
return parseRecipeParamAssignments(assignments);
|
|
304
|
+
}
|
|
305
|
+
catch (error) {
|
|
306
|
+
// The parser reports malformed key=value input; that is a usage error, not a crash.
|
|
307
|
+
if (!(error instanceof Error))
|
|
308
|
+
throw error;
|
|
309
|
+
throw new DiscoveryError('DISCOVERY_USAGE', error.message, `${commandName} explain <recipe> --param key=value`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
function ok(command) {
|
|
313
|
+
return { schemaVersion: DISCOVERY_SCHEMA_VERSION, command, status: 'ok' };
|
|
314
|
+
}
|
|
315
|
+
function print(options, envelope, text) {
|
|
316
|
+
console.log(options.json ? JSON.stringify(envelope, null, 2) : text().join('\n'));
|
|
317
|
+
}
|
|
318
|
+
function indent(text) {
|
|
319
|
+
return text.split('\n').map((line) => ` ${line}`);
|
|
320
|
+
}
|
|
321
|
+
function collect(value, previous) {
|
|
322
|
+
return [...previous, value];
|
|
323
|
+
}
|
|
324
|
+
const USAGE_CODES = new Set([
|
|
325
|
+
'DISCOVERY_USAGE',
|
|
326
|
+
'DISCOVERY_NOT_FOUND',
|
|
327
|
+
'DISCOVERY_NAME_AMBIGUOUS',
|
|
328
|
+
'RECIPE_PLATFORM_REQUIRED',
|
|
329
|
+
'RECIPE_SHADOWED',
|
|
330
|
+
// A malformed --library or RECIPE_LIBRARY_PATH entry is an argument problem.
|
|
331
|
+
'RECIPE_LIBRARY_PATH_INVALID',
|
|
332
|
+
]);
|
|
333
|
+
/**
|
|
334
|
+
* Wrap an action so every failure prints the error envelope (`--json`) or one readable error.
|
|
335
|
+
* Exit 2 is a usage or lookup problem; exit 1 is an invalid library or an unexpected failure.
|
|
336
|
+
*/
|
|
337
|
+
function handle(command, action) {
|
|
338
|
+
return async (...args) => {
|
|
339
|
+
try {
|
|
340
|
+
await action(...args);
|
|
341
|
+
}
|
|
342
|
+
catch (error) {
|
|
343
|
+
const options = args.find((arg) => typeof arg === 'object' && arg !== null && !Array.isArray(arg));
|
|
344
|
+
const typed = error instanceof DiscoveryError ||
|
|
345
|
+
error instanceof RecipeResolutionError ||
|
|
346
|
+
error instanceof RecipeTrustError;
|
|
347
|
+
const failure = typed
|
|
348
|
+
? { code: error.code, message: error.message, userAction: error.userAction }
|
|
349
|
+
: {
|
|
350
|
+
code: 'DISCOVERY_FAILED',
|
|
351
|
+
message: error instanceof Error ? error.message : String(error),
|
|
352
|
+
userAction: 'fix the library or file named above, then rerun the command',
|
|
353
|
+
};
|
|
354
|
+
// An untyped failure keeps its stack on stderr so the cause is never hidden.
|
|
355
|
+
if (!typed)
|
|
356
|
+
console.error(error instanceof Error ? error.stack : error);
|
|
357
|
+
printFailure(command, failure, options?.json === true);
|
|
358
|
+
process.exitCode = USAGE_CODES.has(failure.code) ? 2 : 1;
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
export function printFailure(command, error, json) {
|
|
363
|
+
const envelope = {
|
|
364
|
+
schemaVersion: DISCOVERY_SCHEMA_VERSION,
|
|
365
|
+
command,
|
|
366
|
+
status: 'fail',
|
|
367
|
+
error,
|
|
368
|
+
};
|
|
369
|
+
if (json)
|
|
370
|
+
console.log(JSON.stringify(envelope, null, 2));
|
|
371
|
+
else
|
|
372
|
+
console.error(`Error [${error.code}]: ${error.message}\nNext: ${error.userAction}`);
|
|
373
|
+
}
|
|
374
|
+
function completionScript(commandName, shell) {
|
|
375
|
+
const fn = `_${commandName.replaceAll(/[^A-Za-z0-9]/gu, '_')}_complete`;
|
|
376
|
+
return [
|
|
377
|
+
...(shell === 'zsh' ? ['autoload -U +X bashcompinit && bashcompinit'] : []),
|
|
378
|
+
`${fn}() {`,
|
|
379
|
+
' local cur="${COMP_WORDS[COMP_CWORD]}" words=""',
|
|
380
|
+
' if [ "$COMP_CWORD" -eq 1 ]; then',
|
|
381
|
+
` words="$(${commandName} completions --candidates commands 2>/dev/null)"`,
|
|
382
|
+
' else',
|
|
383
|
+
' case "${COMP_WORDS[1]}" in',
|
|
384
|
+
` run|explain) words="$(${commandName} completions --candidates recipes 2>/dev/null)" ;;`,
|
|
385
|
+
` describe|template) words="$(${commandName} completions --candidates recipes 2>/dev/null) $(${commandName} completions --candidates actions 2>/dev/null)" ;;`,
|
|
386
|
+
' esac',
|
|
387
|
+
' fi',
|
|
388
|
+
' COMPREPLY=($(compgen -W "$words" -- "$cur"))',
|
|
389
|
+
'}',
|
|
390
|
+
`complete -F ${fn} ${commandName}`,
|
|
391
|
+
].join('\n');
|
|
392
|
+
}
|
|
393
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,UAAU,EAEV,YAAY,EAEZ,aAAa,EACb,eAAe,EACf,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EACL,aAAa,EACb,oBAA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