@farmslot/protocol 0.10.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -1
- package/README.md +12 -4
- package/dist/contracts/runs.d.ts +1 -1
- package/dist/contracts/runs.d.ts.map +1 -1
- package/dist/recipe/artifact.d.ts.map +1 -1
- package/dist/recipe/artifact.js +153 -20
- package/dist/recipe/artifact.js.map +1 -1
- package/dist/recipe/common.d.ts +27 -36
- package/dist/recipe/common.d.ts.map +1 -1
- package/dist/recipe/common.js +0 -3
- package/dist/recipe/common.js.map +1 -1
- package/dist/recipe/digest.d.ts +5 -0
- package/dist/recipe/digest.d.ts.map +1 -0
- package/dist/recipe/digest.js +26 -0
- package/dist/recipe/digest.js.map +1 -0
- package/dist/recipe/document.d.ts +4 -20
- package/dist/recipe/document.d.ts.map +1 -1
- package/dist/recipe/document.js +160 -123
- package/dist/recipe/document.js.map +1 -1
- package/dist/recipe/index.d.ts +5 -3
- package/dist/recipe/index.d.ts.map +1 -1
- package/dist/recipe/index.js +5 -3
- package/dist/recipe/index.js.map +1 -1
- package/dist/recipe/manifest.d.ts +0 -1
- package/dist/recipe/manifest.d.ts.map +1 -1
- package/dist/recipe/manifest.js +68 -45
- package/dist/recipe/manifest.js.map +1 -1
- package/dist/recipe/params.d.ts +9 -0
- package/dist/recipe/params.d.ts.map +1 -0
- package/dist/recipe/params.js +264 -0
- package/dist/recipe/params.js.map +1 -0
- package/dist/recipe/trust.d.ts +5 -3
- package/dist/recipe/trust.d.ts.map +1 -1
- package/dist/recipe/trust.js.map +1 -1
- package/dist/recipe/workflow.d.ts +13 -30
- package/dist/recipe/workflow.d.ts.map +1 -1
- package/dist/recipe/workflow.js +200 -526
- package/dist/recipe/workflow.js.map +1 -1
- package/dist/rpc/dispatch.d.ts +8 -0
- package/dist/rpc/dispatch.d.ts.map +1 -1
- package/package.json +4 -1
- package/schemas/recipe-v1.schema.json +119 -197
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/recipe/common.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAChD,eAAO,MAAM,0BAA0B,sDAAsD,CAAC;AAC9F,eAAO,MAAM,2BAA2B;;CAE9B,CAAC;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/recipe/common.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAChD,eAAO,MAAM,0BAA0B,sDAAsD,CAAC;AAC9F,eAAO,MAAM,2BAA2B;;CAE9B,CAAC;AAEX,eAAO,MAAM,uBAAuB,ybAgC1B,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1E,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAClE,eAAO,MAAM,qBAAqB,sCAAuC,CAAC;AAC1E,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1E,MAAM,MAAM,aAAa,GAAG,oBAAoB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEjE,MAAM,WAAW,0BAA0B;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,uFAAuF;IACvF,YAAY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Y,CAAC,GAAG,EAAE,wBAAwB,GAAG,sBAAsB,CAKlF;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,wBAAwB,EAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,IAAI,CAON;AAED,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,wBAAwB,EAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,IAAI,CAIN"}
|
package/dist/recipe/common.js
CHANGED
|
@@ -4,8 +4,6 @@ export const RECIPE_PROTOCOL_SCHEMA_URL = 'https://farmslot.io/schemas/recipe-v1
|
|
|
4
4
|
export const RECIPE_PROTOCOL_SCHEMA_URLS = {
|
|
5
5
|
[RECIPE_PROTOCOL_SCHEMA_VERSION]: RECIPE_PROTOCOL_SCHEMA_URL,
|
|
6
6
|
};
|
|
7
|
-
export const RECIPE_PLAYBACK_SLOW_MS_MIN = 100;
|
|
8
|
-
export const RECIPE_PLAYBACK_SLOW_MS_MAX = 60_000;
|
|
9
7
|
export const OFFICIAL_RECIPE_ACTIONS = [
|
|
10
8
|
'command',
|
|
11
9
|
'wait',
|
|
@@ -40,7 +38,6 @@ export const OFFICIAL_RECIPE_ACTIONS = [
|
|
|
40
38
|
'cdp.trace',
|
|
41
39
|
];
|
|
42
40
|
export const BUILT_IN_UI_OBSERVERS = ['ui.screen', 'ui.visible'];
|
|
43
|
-
export const PLAYBACK_MODES = new Set(['off', 'auto', 'step']);
|
|
44
41
|
export const TERMINAL_STATUSES = new Set(['pass', 'fail', 'unknown']);
|
|
45
42
|
export const ARTIFACT_TYPES = new Set(RECIPE_ARTIFACT_TYPES);
|
|
46
43
|
export const OFFICIAL_ACTION_SET = new Set(OFFICIAL_RECIPE_ACTIONS);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/recipe/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC;AAChD,MAAM,CAAC,MAAM,0BAA0B,GAAG,mDAAmD,CAAC;AAC9F,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,CAAC,8BAA8B,CAAC,EAAE,0BAA0B;CACpD,CAAC;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/recipe/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC;AAChD,MAAM,CAAC,MAAM,0BAA0B,GAAG,mDAAmD,CAAC;AAC9F,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,CAAC,8BAA8B,CAAC,EAAE,0BAA0B;CACpD,CAAC;AAEX,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,SAAS;IACT,MAAM;IACN,aAAa;IACb,aAAa;IACb,kBAAkB;IAClB,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,iBAAiB;IACjB,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,aAAa;IACb,UAAU;IACV,cAAc;IACd,cAAc;IACd,WAAW;IACX,YAAY;IACZ,aAAa;IACb,eAAe;IACf,YAAY;IACZ,eAAe;IACf,SAAS;IACT,WAAW;IACX,YAAY;IACZ,aAAa;IACb,aAAa;IACb,eAAe;IACf,aAAa;IACb,WAAW;CACH,CAAC;AAIX,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,WAAW,EAAE,YAAY,CAAU,CAAC;AA8D1E,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AACtE,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CAAC;AACnG,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,GAA6B,EAC7B,QAAiC,EACjC,KAAa,EACb,IAAY;IAEZ,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI;QAAE,OAAO;IAChE,IAAI,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAAE,OAAO;IAC9C,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,kBAAkB,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI,8BAA8B,CAAC,CAAC;AACnG,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function canonicalRecipeJson(value: unknown): string;
|
|
2
|
+
export declare function digestRecipeDocument(value: unknown): string;
|
|
3
|
+
/** Return the only valid artifact path for an exact resolved Recipe v1 digest. */
|
|
4
|
+
export declare function resolvedRecipeArtifactPath(digest: unknown): string | undefined;
|
|
5
|
+
//# sourceMappingURL=digest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../../src/recipe/digest.ts"],"names":[],"mappings":"AAOA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAU1D;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE3D;AAED,kFAAkF;AAClF,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAG9E"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { sha256 } from '@noble/hashes/sha256';
|
|
2
|
+
import { bytesToHex } from '@noble/hashes/utils';
|
|
3
|
+
import { isRecord } from './common.js';
|
|
4
|
+
const RECIPE_DIGEST_RE = /^sha256:[a-f0-9]{64}$/u;
|
|
5
|
+
export function canonicalRecipeJson(value) {
|
|
6
|
+
if (Array.isArray(value))
|
|
7
|
+
return `[${value.map(canonicalRecipeJson).join(',')}]`;
|
|
8
|
+
if (isRecord(value)) {
|
|
9
|
+
return `{${Object.entries(value)
|
|
10
|
+
.filter(([, entry]) => entry !== undefined)
|
|
11
|
+
.sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))
|
|
12
|
+
.map(([key, entry]) => `${JSON.stringify(key)}:${canonicalRecipeJson(entry)}`)
|
|
13
|
+
.join(',')}}`;
|
|
14
|
+
}
|
|
15
|
+
return JSON.stringify(value) ?? 'null';
|
|
16
|
+
}
|
|
17
|
+
export function digestRecipeDocument(value) {
|
|
18
|
+
return `sha256:${bytesToHex(sha256(new TextEncoder().encode(canonicalRecipeJson(value))))}`;
|
|
19
|
+
}
|
|
20
|
+
/** Return the only valid artifact path for an exact resolved Recipe v1 digest. */
|
|
21
|
+
export function resolvedRecipeArtifactPath(digest) {
|
|
22
|
+
if (typeof digest !== 'string' || !RECIPE_DIGEST_RE.test(digest))
|
|
23
|
+
return undefined;
|
|
24
|
+
return `resolved-recipes/${digest.slice('sha256:'.length)}.recipe.json`;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=digest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.js","sourceRoot":"","sources":["../../src/recipe/digest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AAElD,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IACjF,IAAI,QAAQ,CAAC,KAAK,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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* recipe library sources). `call.ref` values found here are not reported as
|
|
6
|
-
* unresolved even when the recipe has no `uses` catalogs or inline flows.
|
|
7
|
-
*/
|
|
8
|
-
externalFlowIds?: ReadonlySet<string>;
|
|
9
|
-
/** Require the canonical published JSON Schema URL at recipe.$schema. */
|
|
3
|
+
externalRecipeIds?: ReadonlySet<string>;
|
|
4
|
+
/** Retained for callers; Recipe v1 always requires the canonical schema ref. */
|
|
10
5
|
requireSchemaRef?: boolean;
|
|
11
|
-
|
|
12
|
-
* Skip `call.ref` resolution (unresolved_call_ref) against inline flows / uses
|
|
13
|
-
* catalogs / external library flows. Call-shape checks (invalid ref/params) still
|
|
14
|
-
* run. Set when a produced resolved-recipe.json already proves resolution.
|
|
15
|
-
*/
|
|
16
|
-
skipFlowCallResolution?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Whether a declared `uses` catalog counts as resolving `call.ref`s. Defaults to
|
|
19
|
-
* true (authoring/run time, where catalogs are loaded). Set false at
|
|
20
|
-
* artifact-package validation, where the catalogs are not in the package, so a
|
|
21
|
-
* `uses`-only recipe is not self-contained.
|
|
22
|
-
*/
|
|
23
|
-
externalCatalogsResolvable?: boolean;
|
|
6
|
+
skipRecipeCallResolution?: boolean;
|
|
24
7
|
}
|
|
8
|
+
export declare function validateResolvedRecipeActionNode(node: unknown, manifest: unknown): RecipeValidationResult;
|
|
25
9
|
export declare function validateRecipeWithManifest(recipe: unknown, manifest: unknown, options?: RecipeDocumentValidationOptions): RecipeValidationResult;
|
|
26
10
|
export declare function validateRecipeDocument(recipe: unknown, options?: RecipeDocumentValidationOptions): RecipeValidationResult;
|
|
27
11
|
//# sourceMappingURL=document.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/recipe/document.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,sBAAsB,
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/recipe/document.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,sBAAsB,EAG5B,MAAM,aAAa,CAAC;AAuBrB,MAAM,WAAW,+BAA+B;IAC9C,iBAAiB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACxC,gFAAgF;IAChF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,OAAO,GAChB,sBAAsB,CA0BxB;AAOD,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,OAAO,EACjB,OAAO,CAAC,EAAE,+BAA+B,GACxC,sBAAsB,CA+DxB;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,+BAA+B,GACxC,sBAAsB,CA6DxB"}
|
package/dist/recipe/document.js
CHANGED
|
@@ -1,87 +1,69 @@
|
|
|
1
|
-
import { addFinding, createContext, finishResult, hasOwn, isRecord, RECIPE_PROTOCOL_SCHEMA_URL,
|
|
2
|
-
import { getRecipeActionManifestActionNames,
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { addFinding, createContext, finishResult, hasOwn, isNonEmptyString, isRecord, RECIPE_PROTOCOL_SCHEMA_URL, requireStringField, validateOptionalStringField, } from './common.js';
|
|
2
|
+
import { getRecipeActionManifestActionNames, validateRecipeActionManifestDocument, } from './manifest.js';
|
|
3
|
+
import { validateRecipeParams, validateRecipeParamsSchema } from './params.js';
|
|
4
|
+
import { extractWorkflow, getRecipeActionParams, getRecipeWorkflowActionEntries, validateRecipeCalls, validateWorkflowGraph, } from './workflow.js';
|
|
5
|
+
const RECIPE_FIELDS = new Set([
|
|
6
|
+
'$schema',
|
|
7
|
+
'title',
|
|
8
|
+
'description',
|
|
9
|
+
'paramsSchema',
|
|
10
|
+
'proofTargets',
|
|
11
|
+
'workflow',
|
|
12
|
+
]);
|
|
13
|
+
export function validateResolvedRecipeActionNode(node, manifest) {
|
|
5
14
|
const ctx = createContext();
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const declaredActions = new Set(getRecipeActionManifestActionNames(manifest));
|
|
10
|
-
if (declaredActions.size > 0) {
|
|
11
|
-
const actions = getRecipeWorkflowActionEntries(recipe);
|
|
12
|
-
actions.forEach(({ action, path }) => {
|
|
13
|
-
if (!declaredActions.has(action)) {
|
|
14
|
-
addFinding(ctx, 'error', 'recipe.action_not_declared_by_manifest', path, `Recipe action ${action} is not declared by the runner action manifest.`);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
const declaredObservers = new Set();
|
|
19
|
-
if (isRecord(manifest) && Array.isArray(manifest.observers)) {
|
|
20
|
-
for (const observer of manifest.observers) {
|
|
21
|
-
if (isRecord(observer) && typeof observer.ref === 'string') {
|
|
22
|
-
declaredObservers.add(observer.ref);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
for (const entry of collectObservationPolicies(recipe)) {
|
|
27
|
-
if (!Array.isArray(entry.policy))
|
|
28
|
-
continue;
|
|
29
|
-
entry.policy.forEach((ref, index) => {
|
|
30
|
-
if (typeof ref === 'string' && !declaredObservers.has(ref)) {
|
|
31
|
-
addFinding(ctx, 'error', 'recipe.observer_not_declared_by_manifest', `${entry.path}[${index}]`, `Recipe observer ${ref} is not declared by the runner action manifest.`);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
15
|
+
if (!isRecord(node) || !isNonEmptyString(node.action)) {
|
|
16
|
+
addFinding(ctx, 'error', 'recipe.invalid_action_node', 'node', 'Resolved action node is invalid.');
|
|
17
|
+
return finishResult(ctx);
|
|
34
18
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
19
|
+
if (node.action === 'call' || node.action === 'end')
|
|
20
|
+
return finishResult(ctx);
|
|
21
|
+
const contract = manifestActionContracts(manifest).get(node.action);
|
|
22
|
+
if (!contract?.schema) {
|
|
23
|
+
addFinding(ctx, 'error', 'recipe.action_schema_missing', 'node.action', `Action ${node.action} must declare a parameter schema in the runner manifest.`);
|
|
24
|
+
return finishResult(ctx);
|
|
40
25
|
}
|
|
26
|
+
ctx.findings.push(...validateRecipeParams(getRecipeActionParams(node), contract.schema).findings);
|
|
41
27
|
return finishResult(ctx);
|
|
42
28
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
29
|
+
export function validateRecipeWithManifest(recipe, manifest, options) {
|
|
30
|
+
const ctx = createContext();
|
|
31
|
+
ctx.findings.push(...validateRecipeDocument(recipe, options).findings);
|
|
32
|
+
ctx.findings.push(...validateRecipeActionManifestDocument(manifest).findings);
|
|
33
|
+
const declaredActions = new Set(getRecipeActionManifestActionNames(manifest));
|
|
34
|
+
const contracts = manifestActionContracts(manifest);
|
|
35
|
+
for (const { action, node, path } of getRecipeWorkflowActionEntries(recipe)) {
|
|
36
|
+
if (action === 'end' || action === 'call')
|
|
37
|
+
continue;
|
|
38
|
+
if (!declaredActions.has(action)) {
|
|
39
|
+
addFinding(ctx, 'error', 'recipe.action_not_declared_by_manifest', `${path}.action`, `Recipe action ${action} is not declared by the runner action manifest.`);
|
|
40
|
+
continue;
|
|
54
41
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
42
|
+
const contract = contracts.get(action);
|
|
43
|
+
if (!contract?.schema) {
|
|
44
|
+
addFinding(ctx, 'error', 'recipe.action_schema_missing', `${path}.action`, `Action ${action} must declare a parameter schema in the runner manifest.`);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
const paramsResult = validateRecipeParams(getRecipeActionParams(node), contract.schema, {
|
|
48
|
+
allowTemplates: true,
|
|
49
|
+
});
|
|
50
|
+
ctx.findings.push(...paramsResult.findings.map((finding) => rebaseFinding(finding, path)));
|
|
51
|
+
}
|
|
52
|
+
if (isRecord(node.cases)) {
|
|
53
|
+
if (!contract?.resultCases?.length) {
|
|
54
|
+
addFinding(ctx, 'error', 'recipe.action_cases_not_declared', `${path}.cases`, `Action ${action} uses result cases but its manifest declares none.`);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
const allowed = new Set(contract.resultCases);
|
|
58
|
+
for (const caseName of Object.keys(node.cases)) {
|
|
59
|
+
if (!allowed.has(caseName)) {
|
|
60
|
+
addFinding(ctx, 'error', 'recipe.action_case_not_declared', `${path}.cases.${caseName}`, `Case ${caseName} is not declared by action ${action}.`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
65
64
|
}
|
|
66
65
|
}
|
|
67
|
-
|
|
68
|
-
if (!Array.isArray(value[lifecycle]))
|
|
69
|
-
continue;
|
|
70
|
-
value[lifecycle].forEach((node, index) => {
|
|
71
|
-
entries.push(...collectNodeObservationPolicies(node, `${path}.${lifecycle}[${index}]`));
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
return entries;
|
|
75
|
-
}
|
|
76
|
-
function collectNodeObservationPolicies(value, path) {
|
|
77
|
-
if (!isRecord(value) || typeof value.action !== 'string')
|
|
78
|
-
return [];
|
|
79
|
-
const entries = [];
|
|
80
|
-
for (const field of ['observe', 'expect_observations']) {
|
|
81
|
-
if (hasOwn(value, field))
|
|
82
|
-
entries.push({ path: `${path}.${field}`, policy: value[field], field, node: value });
|
|
83
|
-
}
|
|
84
|
-
return entries;
|
|
66
|
+
return finishResult(ctx);
|
|
85
67
|
}
|
|
86
68
|
export function validateRecipeDocument(recipe, options) {
|
|
87
69
|
const ctx = createContext();
|
|
@@ -89,63 +71,118 @@ export function validateRecipeDocument(recipe, options) {
|
|
|
89
71
|
addFinding(ctx, 'error', 'recipe.invalid_document', '$', 'Recipe document must be a JSON object.');
|
|
90
72
|
return finishResult(ctx);
|
|
91
73
|
}
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (options?.requireSchemaRef === true && schemaRef == null) {
|
|
97
|
-
addFinding(ctx, 'error', 'recipe.missing_schema_ref', '$schema', `Recipe must set $schema to ${expectedSchemaRef}.`);
|
|
98
|
-
}
|
|
99
|
-
else if (schemaRef != null && schemaRef !== expectedSchemaRef) {
|
|
100
|
-
addFinding(ctx, 'error', 'recipe.unsupported_schema_ref', '$schema', `Unsupported $schema ${JSON.stringify(schemaRef)} for schema_version ${JSON.stringify(schemaVersion)}; expected ${expectedSchemaRef}.`);
|
|
74
|
+
for (const field of Object.keys(recipe)) {
|
|
75
|
+
if (!RECIPE_FIELDS.has(field)) {
|
|
76
|
+
addFinding(ctx, 'error', 'recipe.unsupported_field', field, `Recipe Protocol v1 does not support top-level field ${field}.`);
|
|
77
|
+
}
|
|
101
78
|
}
|
|
102
|
-
if (!hasOwn(recipe, '
|
|
103
|
-
addFinding(ctx, 'error', 'recipe.
|
|
79
|
+
if (!hasOwn(recipe, '$schema')) {
|
|
80
|
+
addFinding(ctx, 'error', 'recipe.missing_schema_ref', '$schema', `Recipe must set $schema to ${RECIPE_PROTOCOL_SCHEMA_URL}.`);
|
|
104
81
|
}
|
|
105
|
-
else if (
|
|
106
|
-
addFinding(ctx, 'error', 'recipe.
|
|
82
|
+
else if (recipe.$schema !== RECIPE_PROTOCOL_SCHEMA_URL) {
|
|
83
|
+
addFinding(ctx, 'error', 'recipe.unsupported_schema_ref', '$schema', `Recipe $schema must equal ${RECIPE_PROTOCOL_SCHEMA_URL}.`);
|
|
107
84
|
}
|
|
85
|
+
requireStringField(ctx, recipe, 'description', 'description');
|
|
108
86
|
validateOptionalStringField(ctx, recipe, 'title', 'title');
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
87
|
+
if (hasOwn(recipe, 'paramsSchema')) {
|
|
88
|
+
ctx.findings.push(...validateRecipeParamsSchema(recipe.paramsSchema).findings);
|
|
89
|
+
}
|
|
90
|
+
const proofTargetIds = validateProofTargets(ctx, recipe.proofTargets);
|
|
112
91
|
const workflow = extractWorkflow(ctx, recipe);
|
|
113
|
-
if (workflow
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
// controls whether a declared `uses` catalog counts as resolving refs.
|
|
119
|
-
validateFlowCalls(ctx, recipe, workflow, {
|
|
120
|
-
...(options?.externalFlowIds ? { externalFlowIds: options.externalFlowIds } : {}),
|
|
121
|
-
skipResolution: options?.skipFlowCallResolution === true,
|
|
122
|
-
externalCatalogsResolvable: options?.externalCatalogsResolvable !== false,
|
|
92
|
+
if (workflow) {
|
|
93
|
+
validateWorkflowGraph(ctx, workflow);
|
|
94
|
+
validateRecipeCalls(ctx, workflow, {
|
|
95
|
+
...(options?.externalRecipeIds ? { externalRecipeIds: options.externalRecipeIds } : {}),
|
|
96
|
+
skipResolution: options?.skipRecipeCallResolution === true,
|
|
123
97
|
});
|
|
98
|
+
validateProofLinks(ctx, workflow.nodes, proofTargetIds);
|
|
124
99
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
100
|
+
return finishResult(ctx);
|
|
101
|
+
}
|
|
102
|
+
function validateProofTargets(ctx, value) {
|
|
103
|
+
const ids = new Set();
|
|
104
|
+
if (value == null)
|
|
105
|
+
return ids;
|
|
106
|
+
if (!Array.isArray(value)) {
|
|
107
|
+
addFinding(ctx, 'error', 'recipe.invalid_proof_targets', 'proofTargets', 'proofTargets must be an array.');
|
|
108
|
+
return ids;
|
|
109
|
+
}
|
|
110
|
+
value.forEach((target, index) => {
|
|
111
|
+
const path = `proofTargets[${index}]`;
|
|
112
|
+
if (!isRecord(target)) {
|
|
113
|
+
addFinding(ctx, 'error', 'recipe.invalid_proof_target', path, `${path} must be an object.`);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
for (const field of Object.keys(target)) {
|
|
117
|
+
if (field !== 'id' && field !== 'claim') {
|
|
118
|
+
addFinding(ctx, 'error', 'recipe.unsupported_proof_target_field', `${path}.${field}`, `Proof targets do not support ${field}.`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (!isNonEmptyString(target.id)) {
|
|
122
|
+
addFinding(ctx, 'error', 'recipe.invalid_proof_target_id', `${path}.id`, 'Proof target id must be a non-empty string.');
|
|
136
123
|
}
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
entry.policy.length > 0 &&
|
|
140
|
-
entry.node.observe === false) {
|
|
141
|
-
addFinding(ctx, 'error', 'recipe.contradictory_observation_expectation', entry.path, 'expect_observations must be empty when observe is false; the node can never record observations.');
|
|
124
|
+
else if (ids.has(target.id)) {
|
|
125
|
+
addFinding(ctx, 'error', 'recipe.duplicate_proof_target', `${path}.id`, `Proof target ${target.id} is duplicated.`);
|
|
142
126
|
}
|
|
127
|
+
else {
|
|
128
|
+
ids.add(target.id);
|
|
129
|
+
}
|
|
130
|
+
if (!isNonEmptyString(target.claim)) {
|
|
131
|
+
addFinding(ctx, 'error', 'recipe.invalid_proof_target_claim', `${path}.claim`, 'Proof target claim must be a non-empty string.');
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
return ids;
|
|
135
|
+
}
|
|
136
|
+
function validateProofLinks(ctx, nodes, declared) {
|
|
137
|
+
const covered = new Set();
|
|
138
|
+
for (const [nodeId, node] of Object.entries(nodes)) {
|
|
139
|
+
if (!Array.isArray(node.proves))
|
|
140
|
+
continue;
|
|
141
|
+
node.proves.forEach((target, index) => {
|
|
142
|
+
if (!isNonEmptyString(target))
|
|
143
|
+
return;
|
|
144
|
+
if (!declared.has(target)) {
|
|
145
|
+
addFinding(ctx, 'error', 'recipe.undeclared_proof_target', `workflow.nodes.${nodeId}.proves[${index}]`, `Proof target ${target} is not declared by recipe.proofTargets.`);
|
|
146
|
+
}
|
|
147
|
+
covered.add(target);
|
|
148
|
+
});
|
|
143
149
|
}
|
|
144
|
-
|
|
150
|
+
for (const target of declared) {
|
|
151
|
+
if (!covered.has(target)) {
|
|
152
|
+
addFinding(ctx, 'error', 'recipe.uncovered_proof_target', 'proofTargets', `Proof target ${target} is not covered by any workflow node.`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function manifestActionContracts(manifest) {
|
|
157
|
+
const contracts = new Map();
|
|
158
|
+
if (!isRecord(manifest))
|
|
159
|
+
return contracts;
|
|
160
|
+
if (isRecord(manifest.action_metadata)) {
|
|
161
|
+
for (const [name, entry] of Object.entries(manifest.action_metadata)) {
|
|
162
|
+
if (!isRecord(entry))
|
|
163
|
+
continue;
|
|
164
|
+
contracts.set(name, actionContract(entry));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (Array.isArray(manifest.custom_actions)) {
|
|
168
|
+
for (const entry of manifest.custom_actions) {
|
|
169
|
+
if (isRecord(entry) && isNonEmptyString(entry.name)) {
|
|
170
|
+
contracts.set(entry.name, actionContract(entry));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return contracts;
|
|
175
|
+
}
|
|
176
|
+
function actionContract(entry) {
|
|
177
|
+
return {
|
|
178
|
+
...(isRecord(entry.schema) ? { schema: entry.schema } : {}),
|
|
179
|
+
...(Array.isArray(entry.result_cases)
|
|
180
|
+
? { resultCases: entry.result_cases.filter(isNonEmptyString) }
|
|
181
|
+
: {}),
|
|
182
|
+
};
|
|
145
183
|
}
|
|
146
|
-
function
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
new Set(value).size === value.length);
|
|
184
|
+
function rebaseFinding(finding, nodePath) {
|
|
185
|
+
const suffix = finding.path === 'params' ? '' : finding.path.replace(/^params\.?/u, '.');
|
|
186
|
+
return { ...finding, path: `${nodePath}${suffix}` };
|
|
150
187
|
}
|
|
151
188
|
//# sourceMappingURL=document.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../src/recipe/document.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,aAAa,EACb,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,0BAA0B,
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../src/recipe/document.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,aAAa,EACb,YAAY,EACZ,MAAM,EACN,gBAAgB,EAChB,QAAQ,EACR,0BAA0B,EAG1B,kBAAkB,EAClB,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,8BAA8B,EAC9B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,SAAS;IACT,OAAO;IACP,aAAa;IACb,cAAc;IACd,cAAc;IACd,UAAU;CACX,CAAC,CAAC;AASH,MAAM,UAAU,gCAAgC,CAC9C,IAAa,EACb,QAAiB;IAEjB,MAAM,GAAG,GAAG,aAAa,EAAE,CAAC;IAC5B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACtD,UAAU,CACR,GAAG,EACH,OAAO,EACP,4BAA4B,EAC5B,MAAM,EACN,kCAAkC,CACnC,CAAC;QACF,OAAO,YAAY,CAAC,GAAG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AO,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;IACzF,OAAO,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,GAAG,QAAQ,GAAG,MAAM,EAAE,EAAE,CAAC;AACtD,CAAC"}
|
package/dist/recipe/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { mergeRecipeValidationResults, validateArtifactManifestDocument, validateRecipeArtifactPackage, } from './artifact.js';
|
|
2
|
-
export { BUILT_IN_UI_OBSERVERS, type BuiltInUiObserverRef, isRecord, OFFICIAL_RECIPE_ACTIONS, type OfficialActionName,
|
|
2
|
+
export { BUILT_IN_UI_OBSERVERS, type BuiltInUiObserverRef, isRecord, OFFICIAL_RECIPE_ACTIONS, type OfficialActionName, RECIPE_PROTOCOL_SCHEMA_URL, RECIPE_PROTOCOL_SCHEMA_URLS, RECIPE_PROTOCOL_SCHEMA_VERSION, type RecipeActionCatalogEntry, type RecipeActionCatalogExample, type RecipeActionManifestDocument, type RecipeActionName, type RecipeArtifactPackageInput, type RecipeCustomActionDeclaration, type RecipeNativeBindingDeclaration, type RecipeObserverDeclaration, type RecipeResolutionDependency, type RecipeResolutionDocument, type RecipeResolutionEdge, type RecipeRuntimeCapabilityDeclaration, type RecipeValidationFinding, type RecipeValidationResult, type RecipeValidationSeverity, type RecipeValidationStatus, type UiObserverRef, } from './common.js';
|
|
3
3
|
export { recipeProtocolSchemaUrlForVersion } from './common.js';
|
|
4
|
-
export {
|
|
4
|
+
export { canonicalRecipeJson, digestRecipeDocument, resolvedRecipeArtifactPath } from './digest.js';
|
|
5
|
+
export { type RecipeDocumentValidationOptions, validateRecipeDocument, validateRecipeWithManifest, validateResolvedRecipeActionNode, } from './document.js';
|
|
5
6
|
export { getRecipeActionManifestActionNames, validateRecipeActionManifestDocument, } from './manifest.js';
|
|
7
|
+
export { applyRecipeParamDefaults, validateRecipeParams, validateRecipeParamsSchema, } from './params.js';
|
|
6
8
|
export { DEFAULT_UNTRUSTED_RECIPE_BLOCKED_CAPABILITIES, officialRecipeActionCapabilities, RECIPE_EXECUTION_CAPABILITIES, type RecipeExecutionApproval, type RecipeExecutionCapability, type RecipeExecutionPlan, type RecipePlanNode, type RecipeSourceKind, type RecipeSourceProvenance, type RecipeSourceTrust, type RecipeTrustFailure, } from './trust.js';
|
|
7
|
-
export { getRecipeWorkflowActions, getRecipeWorkflowNodeIds,
|
|
9
|
+
export { getRecipeCallRefs, getRecipeWorkflowActions, getRecipeWorkflowNodeIds, isDynamicRecipeRef, normalizeRecipeRef, } from './workflow.js';
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recipe/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EAChC,6BAA6B,GAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,QAAQ,EACR,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recipe/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EAChC,6BAA6B,GAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,QAAQ,EACR,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EACjC,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,kCAAkC,EACvC,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EACL,KAAK,+BAA+B,EACpC,sBAAsB,EACtB,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,6CAA6C,EAC7C,gCAAgC,EAChC,6BAA6B,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,eAAe,CAAC"}
|
package/dist/recipe/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { mergeRecipeValidationResults, validateArtifactManifestDocument, validateRecipeArtifactPackage, } from './artifact.js';
|
|
2
|
-
export { BUILT_IN_UI_OBSERVERS, isRecord, OFFICIAL_RECIPE_ACTIONS,
|
|
2
|
+
export { BUILT_IN_UI_OBSERVERS, isRecord, OFFICIAL_RECIPE_ACTIONS, RECIPE_PROTOCOL_SCHEMA_URL, RECIPE_PROTOCOL_SCHEMA_URLS, RECIPE_PROTOCOL_SCHEMA_VERSION, } from './common.js';
|
|
3
3
|
export { recipeProtocolSchemaUrlForVersion } from './common.js';
|
|
4
|
-
export {
|
|
4
|
+
export { canonicalRecipeJson, digestRecipeDocument, resolvedRecipeArtifactPath } from './digest.js';
|
|
5
|
+
export { validateRecipeDocument, validateRecipeWithManifest, validateResolvedRecipeActionNode, } from './document.js';
|
|
5
6
|
export { getRecipeActionManifestActionNames, validateRecipeActionManifestDocument, } from './manifest.js';
|
|
7
|
+
export { applyRecipeParamDefaults, validateRecipeParams, validateRecipeParamsSchema, } from './params.js';
|
|
6
8
|
export { DEFAULT_UNTRUSTED_RECIPE_BLOCKED_CAPABILITIES, officialRecipeActionCapabilities, RECIPE_EXECUTION_CAPABILITIES, } from './trust.js';
|
|
7
|
-
export { getRecipeWorkflowActions, getRecipeWorkflowNodeIds,
|
|
9
|
+
export { getRecipeCallRefs, getRecipeWorkflowActions, getRecipeWorkflowNodeIds, isDynamicRecipeRef, normalizeRecipeRef, } from './workflow.js';
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
package/dist/recipe/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recipe/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EAChC,6BAA6B,GAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EAErB,QAAQ,EACR,uBAAuB,EAEvB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recipe/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EAChC,6BAA6B,GAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EAErB,QAAQ,EACR,uBAAuB,EAEvB,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,GAkB/B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EAEL,sBAAsB,EACtB,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,6CAA6C,EAC7C,gCAAgC,EAChC,6BAA6B,GAS9B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,eAAe,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type RecipeValidationResult } from './common.js';
|
|
2
2
|
export declare function getRecipeActionManifestActionNames(manifest: unknown): string[];
|
|
3
3
|
export declare function validateRecipeActionManifestDocument(manifest: unknown): RecipeValidationResult;
|
|
4
|
-
export declare function getRecipeActionManifestPreconditionIds(manifest: unknown): string[];
|
|
5
4
|
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/recipe/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,sBAAsB,EAC5B,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/recipe/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,sBAAsB,EAC5B,MAAM,aAAa,CAAC;AAiBrB,wBAAgB,kCAAkC,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,EAAE,CAc9E;AAsLD,wBAAgB,oCAAoC,CAAC,QAAQ,EAAE,OAAO,GAAG,sBAAsB,CAsc9F"}
|