@happyvertical/smrt-scanner 0.55.1 → 0.55.2

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/AGENTS.md CHANGED
@@ -15,6 +15,23 @@ executes the source.
15
15
  - `ManifestAdapter` — converts resolved classes into the SMRT manifest shape
16
16
  (`toManifest()`); owns field-type inference (the `0` vs `0.0` integer/decimal
17
17
  heuristic, decorator interpretation, union/alias resolution).
18
+ - Enum values (#3598): a field typed as a TS `enum` / `const enum` or a
19
+ string/number literal union (through aliases, imports within the scanned
20
+ project, `| null`, and unions that nest an alias) emits `enum: [...]` on its
21
+ manifest entry — declaration order, values not member names. `enum-values.ts`
22
+ (`resolveEnumValues`) flattens the alias map; `extractTypeAliases` renders
23
+ enums with static string/number/negative/template initializers and
24
+ auto-increment (mixed or computed enums yield no alias, never a partial list).
25
+ `enum` is emitted only when the final column type is `text`/`integer`/
26
+ `decimal` and agrees with the value kind. **Column-type effect:** numeric
27
+ enums and unions that nest an alias (`Base | 'extra'`) previously fell to
28
+ `json` and now infer `integer`/`text`/`decimal` (a schema change for a
29
+ consumer that declares such a field; `@field({ type: 'json' })` keeps the old
30
+ column and drops `enum`); an enum with a computed member now yields `json`
31
+ instead of a partial string alias. The alias map is project-wide by
32
+ bare name, so two same-named types in one package collide (last file wins).
33
+ String enum values retain their decoded quotes, backslashes, whitespace
34
+ escapes, and Unicode exactly through alias resolution and manifest emission.
18
35
  - `parseFile` / `parseSource` — parse a single file or a source string to a
19
36
  `FileScanResult` (classes, errors, type aliases, SMRT imports). Each class
20
37
  carries the parser's `bodyStart` offset; core's library build inserts its
@@ -49,6 +66,18 @@ executes the source.
49
66
  `FieldTypeInference`, `AgentSurface`, `AgentSurfaceIntent`,
50
67
  `AgentSurfacePlaybook`, `AgentSurfaceDiagnostic`.
51
68
 
69
+ ## The recipe matcher (#3590)
70
+
71
+ `src/recipes.ts` finds classes extending `SmrtRecipe` (import-binding aware,
72
+ aliases and namespaces included), reads their statics structurally, and
73
+ resolves `models` class references through imports. `resolve()` fills
74
+ `ScanResults.recipes` and appends validation errors to `results.errors`; pass
75
+ `recipes` to `ManifestAdapter.toManifest` to emit the qualified `recipes` array.
76
+ `static help` names a Markdown file beside the recipe; `resolve()` reads it and
77
+ emits `help: { markdown, fieldRefs }` (`deriveHelpFieldRefs`, mirrored by core's
78
+ `extractFieldRefs` and re-checked at manifest generation). Contract and rules:
79
+ core's [agents/recipes.md](../core/agents/recipes.md).
80
+
52
81
  ## The agent-surface matcher (#2591)
53
82
 
54
83
  `@smrt()` classes are found by matching DECORATORS. A view intent (#2588) and a
@@ -232,6 +261,8 @@ place, `toKnowledgeAgentSurface` in `vite-plugin/index.ts`.
232
261
  - `src/agent-surface.ts` — the `defineIntent` / `definePlaybook` matcher, its
233
262
  diagnostics, `mergeAgentSurfaces` (#2591), and `checkAgentSurfaceToolNames`
234
263
  (#2725).
264
+ - `src/recipes.ts` — the `SmrtRecipe` matcher, class-reference resolution,
265
+ and recipe validation (#3590).
235
266
  - `src/source-location.ts` — `getLineColumn`, split out so `agent-surface.ts`
236
267
  can resolve a diagnostic's position without importing `oxc-parser.ts`, which
237
268
  imports it back.