@happyvertical/smrt-scanner 0.57.34 → 0.57.36
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/dist/chunks/{scanner-C1rTEfa8.js → scanner-QMkE5DFY.js} +35 -2
- package/dist/chunks/scanner-QMkE5DFY.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/recipes.d.ts +5 -0
- package/dist/recipes.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/chunks/scanner-C1rTEfa8.js.map +0 -1
|
@@ -1515,7 +1515,7 @@ var CORE_SPECIFIER = "@happyvertical/smrt-core";
|
|
|
1515
1515
|
function isCoreSpecifier(source) {
|
|
1516
1516
|
return source === CORE_SPECIFIER || source.startsWith(`${CORE_SPECIFIER}/`);
|
|
1517
1517
|
}
|
|
1518
|
-
var RECIPE_ID_PATTERN = /^[a-z][a-z0-9]*(?:\.[a-z0-9][a-z0-9_-]*)+$/;
|
|
1518
|
+
var RECIPE_ID_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*(?:\.[a-z0-9][a-z0-9_-]*)+$/;
|
|
1519
1519
|
var RECIPE_ID_MAX_LENGTH = 128;
|
|
1520
1520
|
var FIELD_OPTION_KEYS = /* @__PURE__ */ new Set([
|
|
1521
1521
|
"default",
|
|
@@ -1793,6 +1793,7 @@ function extractRecipes(input) {
|
|
|
1793
1793
|
surfaces: null,
|
|
1794
1794
|
providers: null,
|
|
1795
1795
|
runtime: null,
|
|
1796
|
+
exposure: null,
|
|
1796
1797
|
demoSeed: null
|
|
1797
1798
|
};
|
|
1798
1799
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -1850,6 +1851,7 @@ function extractRecipes(input) {
|
|
|
1850
1851
|
case "surfaces":
|
|
1851
1852
|
case "providers":
|
|
1852
1853
|
case "runtime":
|
|
1854
|
+
case "exposure":
|
|
1853
1855
|
case "demoSeed":
|
|
1854
1856
|
recipe[name] = {
|
|
1855
1857
|
value: literalValue(value, `static ${name}`),
|
|
@@ -2302,6 +2304,35 @@ function readRuntime(raw, report) {
|
|
|
2302
2304
|
}
|
|
2303
2305
|
return value;
|
|
2304
2306
|
}
|
|
2307
|
+
function isClosedToGeneratedTransports(model) {
|
|
2308
|
+
const config = model.decoratorConfig;
|
|
2309
|
+
if (!config) return false;
|
|
2310
|
+
return [
|
|
2311
|
+
"api",
|
|
2312
|
+
"mcp",
|
|
2313
|
+
"cli"
|
|
2314
|
+
].every((transport) => {
|
|
2315
|
+
const value = config[transport];
|
|
2316
|
+
if (value === false) return true;
|
|
2317
|
+
if (!value || typeof value !== "object") return false;
|
|
2318
|
+
const include = value.include;
|
|
2319
|
+
return Array.isArray(include) && include.length === 0;
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
function readExposure(raw, models, report) {
|
|
2323
|
+
if (!raw) return void 0;
|
|
2324
|
+
const { value, line } = raw;
|
|
2325
|
+
if (value !== "ui-only") {
|
|
2326
|
+
report("exposure must be 'ui-only' (omit it for any other recipe)", line);
|
|
2327
|
+
return;
|
|
2328
|
+
}
|
|
2329
|
+
const open = models.filter((model) => !isClosedToGeneratedTransports(model));
|
|
2330
|
+
if (open.length > 0) {
|
|
2331
|
+
report(`exposure 'ui-only' needs every model closed to api, mcp and cli (\`{ include: [] }\` on each), but ${open.map((m) => m.className).join(", ")} ${open.length === 1 ? "is" : "are"} exposed`, line);
|
|
2332
|
+
return;
|
|
2333
|
+
}
|
|
2334
|
+
return "ui-only";
|
|
2335
|
+
}
|
|
2305
2336
|
function readDemoSeed(raw, report) {
|
|
2306
2337
|
if (!raw) return void 0;
|
|
2307
2338
|
const { value, line } = raw;
|
|
@@ -2429,6 +2460,7 @@ function resolveRecipes(raws, classes) {
|
|
|
2429
2460
|
const surfaces = readSurfaces(raw.surfaces, report);
|
|
2430
2461
|
const providers = readProviders(raw.providers, report);
|
|
2431
2462
|
const runtime = readRuntime(raw.runtime, report);
|
|
2463
|
+
const exposure = readExposure(raw.exposure, models, report);
|
|
2432
2464
|
const demoSeed = readDemoSeed(raw.demoSeed, report);
|
|
2433
2465
|
const help = raw.help ? attempt(() => readHelp(raw.help, raw), raw.help.line) : void 0;
|
|
2434
2466
|
recipes.push({
|
|
@@ -2448,6 +2480,7 @@ function resolveRecipes(raws, classes) {
|
|
|
2448
2480
|
...surfaces ? { surfaces } : {},
|
|
2449
2481
|
...providers ? { providers } : {},
|
|
2450
2482
|
...runtime ? { runtime } : {},
|
|
2483
|
+
...exposure ? { exposure } : {},
|
|
2451
2484
|
...demoSeed ? { demoSeed } : {}
|
|
2452
2485
|
});
|
|
2453
2486
|
}
|
|
@@ -5025,4 +5058,4 @@ var OxcScanner = class {
|
|
|
5025
5058
|
//#endregion
|
|
5026
5059
|
export { isPrunedAgentSurfacePath as C, sourceMayDeclareAgentSurface as E, isAgentSurfaceSourcePath as S, scanSvelteAgentSurface as T, normalizeGlobSeparators as _, extractSmrtImports as a, emptyAgentSurface as b, parseRecipeFile as c, extractRecipes as d, resolveRecipes as f, discoverSourceFiles as g, resolveEnumValues as h, defaultCollectionName as i, parseSource as l, InheritanceResolver as m, parseUiSelectorsFile as n, parseAgentSurfaceFile as o, sourceMayDeclareRecipe as p, ManifestAdapter as r, parseFile as s, OxcScanner as t, deriveHelpFieldRefs as u, relativeGlobToCwd as v, mergeAgentSurfaces as w, extractAgentSurface as x, checkAgentSurfaceToolNames as y };
|
|
5027
5060
|
|
|
5028
|
-
//# sourceMappingURL=scanner-
|
|
5061
|
+
//# sourceMappingURL=scanner-QMkE5DFY.js.map
|