@happyvertical/smrt-core 0.45.3 → 0.47.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.
Files changed (106) hide show
  1. package/AGENTS.md +39 -0
  2. package/agents/generators.md +0 -1
  3. package/dist/browser.d.ts +2 -1
  4. package/dist/browser.d.ts.map +1 -1
  5. package/dist/decorators/compatibility.d.ts +46 -0
  6. package/dist/decorators/compatibility.d.ts.map +1 -1
  7. package/dist/decorators/compatibility.js +48 -5
  8. package/dist/decorators/compatibility.js.map +1 -1
  9. package/dist/decorators/index.d.ts +119 -1
  10. package/dist/decorators/index.d.ts.map +1 -1
  11. package/dist/decorators/index.js +52 -8
  12. package/dist/decorators/index.js.map +1 -1
  13. package/dist/embedded-write-queue.d.ts.map +1 -1
  14. package/dist/embedded-write-queue.js +20 -1
  15. package/dist/embedded-write-queue.js.map +1 -1
  16. package/dist/generators/custom-action.d.ts +450 -41
  17. package/dist/generators/custom-action.d.ts.map +1 -1
  18. package/dist/generators/custom-action.js +765 -56
  19. package/dist/generators/custom-action.js.map +1 -1
  20. package/dist/generators/index.d.ts +1 -3
  21. package/dist/generators/index.d.ts.map +1 -1
  22. package/dist/generators/index.js +3 -4
  23. package/dist/generators/mcp.d.ts.map +1 -1
  24. package/dist/generators/mcp.js +1 -1
  25. package/dist/generators/mcp.js.map +1 -1
  26. package/dist/generators/preflight-route.d.ts +12 -10
  27. package/dist/generators/preflight-route.d.ts.map +1 -1
  28. package/dist/generators/preflight-route.js +46 -14
  29. package/dist/generators/preflight-route.js.map +1 -1
  30. package/dist/generators/rest.d.ts +44 -0
  31. package/dist/generators/rest.d.ts.map +1 -1
  32. package/dist/generators/rest.js +84 -9
  33. package/dist/generators/rest.js.map +1 -1
  34. package/dist/generators/tenant-gate.d.ts +33 -9
  35. package/dist/generators/tenant-gate.d.ts.map +1 -1
  36. package/dist/generators/tenant-gate.js +2 -1
  37. package/dist/generators/tenant-gate.js.map +1 -1
  38. package/dist/generators.js +3 -4
  39. package/dist/index.d.ts +5 -3
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +6 -6
  42. package/dist/knowledge.d.ts.map +1 -1
  43. package/dist/knowledge.js +87 -31
  44. package/dist/knowledge.js.map +1 -1
  45. package/dist/manifest/static-manifest.d.ts.map +1 -1
  46. package/dist/manifest/static-manifest.js +125 -53
  47. package/dist/manifest/static-manifest.js.map +1 -1
  48. package/dist/manifest/store.js +1 -1
  49. package/dist/manifest/store.js.map +1 -1
  50. package/dist/manifest.json +184 -53
  51. package/dist/migrations/framework-base-tables.d.ts +148 -0
  52. package/dist/migrations/framework-base-tables.d.ts.map +1 -0
  53. package/dist/migrations/framework-base-tables.js +419 -0
  54. package/dist/migrations/framework-base-tables.js.map +1 -0
  55. package/dist/migrations/index.d.ts +1 -0
  56. package/dist/migrations/index.d.ts.map +1 -1
  57. package/dist/migrations/index.js +2 -1
  58. package/dist/migrations.js +2 -1
  59. package/dist/postgres-permissions.d.ts +45 -0
  60. package/dist/postgres-permissions.d.ts.map +1 -0
  61. package/dist/postgres-permissions.js +424 -0
  62. package/dist/postgres-permissions.js.map +1 -0
  63. package/dist/registry/framework-base-classes.d.ts.map +1 -1
  64. package/dist/registry/framework-base-classes.js +4 -1
  65. package/dist/registry/framework-base-classes.js.map +1 -1
  66. package/dist/registry/index.d.ts +1 -1
  67. package/dist/registry/index.d.ts.map +1 -1
  68. package/dist/registry/shared-state.d.ts +19 -0
  69. package/dist/registry/shared-state.d.ts.map +1 -1
  70. package/dist/registry/shared-state.js +16 -1
  71. package/dist/registry/shared-state.js.map +1 -1
  72. package/dist/registry.d.ts +136 -1
  73. package/dist/registry.d.ts.map +1 -1
  74. package/dist/registry.js +231 -1
  75. package/dist/registry.js.map +1 -1
  76. package/dist/scanner/manifest-generator.d.ts.map +1 -1
  77. package/dist/scanner/manifest-generator.js +18 -16
  78. package/dist/scanner/manifest-generator.js.map +1 -1
  79. package/dist/scanner/types.d.ts +59 -6
  80. package/dist/scanner/types.d.ts.map +1 -1
  81. package/dist/scanner/types.js.map +1 -1
  82. package/dist/scripts/create-wrappers.js +0 -5
  83. package/dist/smrt-knowledge.json +35 -35
  84. package/dist/testing/database.d.ts +6 -1
  85. package/dist/testing/database.d.ts.map +1 -1
  86. package/dist/testing/database.js +9 -1
  87. package/dist/testing/database.js.map +1 -1
  88. package/dist/vite-plugin/api-client-entries.d.ts.map +1 -1
  89. package/dist/vite-plugin/api-client-entries.js +23 -19
  90. package/dist/vite-plugin/api-client-entries.js.map +1 -1
  91. package/dist/vite-plugin/index.d.ts.map +1 -1
  92. package/dist/vite-plugin/index.js +3 -167
  93. package/dist/vite-plugin/index.js.map +1 -1
  94. package/dist/vite-plugin/sveltekit-generator.d.ts +31 -4
  95. package/dist/vite-plugin/sveltekit-generator.d.ts.map +1 -1
  96. package/dist/vite-plugin/sveltekit-generator.js +137 -71
  97. package/dist/vite-plugin/sveltekit-generator.js.map +1 -1
  98. package/dist/vite-plugin/templates/default-ui.ts +22 -1
  99. package/dist/vite-plugin/web-collections.d.ts.map +1 -1
  100. package/dist/vite-plugin/web-collections.js +1 -1
  101. package/dist/vite-plugin/web-collections.js.map +1 -1
  102. package/package.json +10 -10
  103. package/dist/generators/cli.d.ts +0 -155
  104. package/dist/generators/cli.d.ts.map +0 -1
  105. package/dist/generators/cli.js +0 -473
  106. package/dist/generators/cli.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { ToolEffect } from '../registry/types.js';
2
- import { MethodDefinition } from '../scanner/types.js';
1
+ import { ApiHttpMethod, ToolEffect } from '../registry/types.js';
2
+ import { MethodDefinition, SmartObjectManifest } from '../scanner/types.js';
3
3
  export type CustomActionScope = 'item' | 'collection';
4
4
  export type { ToolEffect } from '../registry/types.js';
5
5
  /**
@@ -15,8 +15,8 @@ export type { ToolEffect } from '../registry/types.js';
15
15
  * even when a subclass declares its own override (e.g. `User.save()` at
16
16
  * `packages/users/src/models/User.ts`). An override is still the same
17
17
  * lifecycle operation, not a new one (#2638). `delete` itself is a CRUD verb
18
- * `CLIGenerator`/`MCPGenerator` already special-case, so it is not repeated
19
- * here.
18
+ * `packages/cli/src/cli-generator.ts`'s `CLIGenerator`/`MCPGenerator` already
19
+ * special-case, so it is not repeated here.
20
20
  *
21
21
  * Scope is deliberately narrower than "every public method on
22
22
  * SmrtObject/SmrtClass/SmrtCollection":
@@ -24,11 +24,13 @@ export type { ToolEffect } from '../registry/types.js';
24
24
  * - AI operations `is()`/`do()`/`describe()` are declared on `SmrtObject`
25
25
  * but are explicitly designed to be overridden with domain-specific
26
26
  * behavior and exposed as a distinct action -- confirmed by existing,
27
- * intentional coverage (`generators/cli-commands.spec.ts`'s
28
- * `describe()` custom-action fixture,
29
- * `vite-plugin/generated-client-integration.test.ts`'s `ArtCollection.
27
+ * intentional coverage
28
+ * (`vite-plugin/generated-client-integration.test.ts`'s `ArtCollection.
30
29
  * describe(tone)` with its own declared API route). Excluding them here
31
- * would regress real, working behavior.
30
+ * would regress real, working behavior. (The sibling
31
+ * `generators/cli-commands.spec.ts` fixture that used to cover the same
32
+ * `describe()` custom action was retired with core's `CLIGenerator`,
33
+ * #2664; this remaining fixture still exercises the behavior.)
32
34
  * - Relationship loading (`loadRelated`/`loadRelatedMany`/`getRelated`/
33
35
  * `isRelatedLoaded`), memory (`remember`/`recall`/`recallAll`/`forget`/
34
36
  * `forgetScope`), embeddings (`generateEmbeddings`/`getEmbedding`/
@@ -89,29 +91,28 @@ export interface ResolvableMethod {
89
91
  * for an object, given its transport config's `include`/`exclude` and its
90
92
  * method map: every public method, minus CRUD verbs, minus framework
91
93
  * lifecycle methods, restricted to `include` when present and always minus
92
- * `exclude`. Reused by three callers, so they agree with each other and
93
- * with what `listCommands()` advertises:
94
+ * `exclude`. Its sole caller as of #2664 (`CLIGenerator` and the
95
+ * `generateCLIModule()` virtual module were retired):
94
96
  *
95
- * - `CLIGenerator.listCommands()` (over the live `ObjectRegistry`).
96
97
  * - `findCliApiCoherenceViolations`'s bare-`cli: true`/`cli: {}` branch
97
98
  * (over the static manifest, no explicit `include`) -- see
98
99
  * `resolveCliActionSet` in `vite-plugin/sveltekit-generator.ts`.
99
- * - `generateCLIModule()` in `vite-plugin/index.ts`, which generates the
100
- * `smrt:cli` virtual module's static command metadata. It layers one
101
- * additional filter on top of this function's result: a leading `_` on
102
- * the method name, because the manifest's `isPublic` is unreliable there
103
- * (see that call site's own comment) and this function has no other
104
- * signal to exclude an internal-by-convention method.
105
100
  *
106
101
  * NOT the one universal resolution, and deliberately not reused by every
107
102
  * caller that resolves a CLI command set:
108
103
  *
109
- * - `CLIGenerator.assertCommandExposed()` does not call this for its custom-
110
- * method branch — it checks `isFrameworkLifecycleMethod()` directly plus
111
- * its own inline public/include/exclude logic, so it can give a distinct
112
- * error message per failure reason (unknown vs. not public vs. not
113
- * enabled vs. lifecycle method) rather than a single boolean membership
114
- * test.
104
+ * - Core's now-retired `CLIGenerator.assertCommandExposed()` (#2664) did not
105
+ * call this for its custom-method branch — it checked
106
+ * `isFrameworkLifecycleMethod()` directly plus its own inline
107
+ * public/include/exclude logic, so it could give a distinct error message
108
+ * per failure reason (unknown vs. not public vs. not enabled vs. lifecycle
109
+ * method) rather than a single boolean membership test. The shipped local
110
+ * CLI's `generateObjectCommands()` (`packages/cli/src/cli-generator.ts`)
111
+ * has no equivalent of that gate at all today — it filters on reserved-CRUD
112
+ * name collision, `isPublic`, and `exclude`/`include`, but never
113
+ * `isFrameworkLifecycleMethod()`, so a locally overridden lifecycle method
114
+ * IS a reachable command there (see `knowledge.ts`'s `configuredOperations()`
115
+ * docblock for the same caveat).
115
116
  * - `findCliApiCoherenceViolations`'s EXPLICIT-`cli.include` branch
116
117
  * deliberately bypasses this function too: an `include` entry naming a
117
118
  * typo, a getter, or a private/protected method must still surface as
@@ -121,12 +122,15 @@ export interface ResolvableMethod {
121
122
  * `resolveCliActionSet` in `vite-plugin/sveltekit-generator.ts` for the
122
123
  * full rationale; do not "simplify" that branch onto this function.
123
124
  *
124
- * `crudActionNames` stays a parameter because the callers do not agree on one
125
- * list. `CLIGenerator` now passes {@link CRUD_OPERATIONS}, which #2646 moved
126
- * into this module — so for that caller the argument is a round trip and could
127
- * be defaulted. The SvelteKit generator still passes its own
128
- * `STANDARD_API_ACTIONS` and `vite-plugin/index.ts` an inline literal, so the
129
- * parameter cannot be removed until those copies are retired (#2665).
125
+ * `crudActionNames` stays a parameter even though every caller now passes
126
+ * {@link CRUD_OPERATIONS} (#2665 retired the last of the inline copies at
127
+ * `vite-plugin/sveltekit-generator.ts`, following `CLIGenerator`'s #2646
128
+ * switch; `vite-plugin/index.ts`'s copy backed the `generateCLIModule()`
129
+ * emitter #2664 later retired, so `index.ts` no longer calls this function
130
+ * or imports `CRUD_OPERATIONS` at all). Removing the parameter is a separate,
131
+ * unevidenced call this fix does not make -- it would foreclose a caller
132
+ * that legitimately needs a different verb set, and no such need has been
133
+ * demonstrated either way.
130
134
  */
131
135
  export declare function resolveCustomActionNames(methods: Iterable<[string, ResolvableMethod]>, config: {
132
136
  include?: string[];
@@ -144,11 +148,25 @@ export declare function resolveCustomActionNames(methods: Iterable<[string, Reso
144
148
  * What a collision means differs by EMITTER, so consult the one you are
145
149
  * changing rather than assuming a single rule. The reservation lives at each
146
150
  * emission site, not here, and several emitters still keep their own inline
147
- * verb array — find them with:
151
+ * verb array — find them with a multi-line-tolerant search (#2665 turned the
152
+ * single-line form of this grep blind to a wrapped literal like
153
+ * `templates/default-ui.ts`'s `CRUD_OPERATIONS_FOR_BROWSER_TEMPLATE`):
148
154
  *
149
- * grep -rn "'update', 'delete'" packages --include='*.ts' | grep -v include:
155
+ * rg -U "'list',\s*'get',\s*'create',\s*'update',\s*'delete'" packages --type ts | grep -v include:
150
156
  *
151
- * (the `include:` filter drops decorator config, which names the same verbs)
157
+ * This is a STARTING POINT, not a closed inventory: the `include:` filter
158
+ * only drops a single-line `include: [...]` block, so a wrapped one (e.g.
159
+ * `packages/content/src/content.ts`) still surfaces, and the pattern also
160
+ * matches non-decorator uses of the same five-word literal that have nothing
161
+ * to do with this collision rule (e.g. `packages/smrt-workbench/src/
162
+ * discovery.ts`'s `CRUD_ACTIONS`, `packages/smrt-dev-mcp/.../
163
+ * introspect-project.ts`'s `DEFAULT_MCP_OPERATIONS`). Triage each hit rather
164
+ * than trusting the raw list. Within `packages/core/src/vite-plugin/`
165
+ * specifically, the emitter-relevant survivors as of #2665 are
166
+ * `generated-client.ts` and `templates/default-ui.ts` (the latter
167
+ * deliberate, value-pinned by `issue-2665-crud-verb-consolidation.spec.ts`);
168
+ * `scanner/manifest-generator.ts` and `packages/users/src/sveltekit/
169
+ * resource-list-handler.ts` are outside this PR's scope.
152
170
  *
153
171
  * The sites this rule was audited against (#2646), NOT an exhaustive
154
172
  * inventory:
@@ -158,10 +176,6 @@ export declare function resolveCustomActionNames(methods: Iterable<[string, Reso
158
176
  * built-in list whichever branch emitted it: the class's method could never
159
177
  * run, and emitting one would hand the caller an operation `include` never
160
178
  * named.
161
- * - `generators/cli.ts` (`CLIGenerator`) — unconditional, exact.
162
- * `assertCommandExposed` returns inside its `isCrud` branch, so a CRUD-named
163
- * action never reaches custom-method resolution, and `listCommands` skips
164
- * those names outright.
165
179
  * - `packages/cli/src/cli-generator.ts`, behind the shipped `smrt` object
166
180
  * commands — reserves only where the CRUD command is actually emitted, and
167
181
  * reserves the command NAMES AND THEIR ALIASES (`ls`, `show`, `new`, `edit`,
@@ -170,8 +184,9 @@ export declare function resolveCustomActionNames(methods: Iterable<[string, Reso
170
184
  * command carries its own handler invoking the class's method, so with
171
185
  * `cli: { include: ['list', 'get'] }` neither a public `create()` nor an
172
186
  * `edit()` collides with anything and both stay reachable.
173
- * - `vite-plugin/sveltekit-generator.ts` — unconditional, exact, from its own
174
- * `STANDARD_API_ACTIONS` copy.
187
+ * - `vite-plugin/sveltekit-generator.ts` — unconditional, exact, via
188
+ * {@link isCrudOperation} (#2665; previously its own `STANDARD_API_ACTIONS`
189
+ * copy).
175
190
  * - `vite-plugin/web-collections.ts` + `tool-schema.ts` — case-folded (ids are
176
191
  * lowercased whole like MCP's), CONDITIONAL, and scoped PER COLLECTION.
177
192
  * Applied in both of `selectWebMcpToolEntries`' loops and at the shared
@@ -194,9 +209,26 @@ export declare function resolveCustomActionNames(methods: Iterable<[string, Reso
194
209
  * `resolveApiActionSet` stays exact-match: REST routes keep declared casing,
195
210
  * so `/products/List` is genuinely distinct from `/products`.
196
211
  *
197
- * Still carrying their own verb copies, tracked on #2665:
198
- * `vite-plugin/api-client-entries.ts`, `vite-plugin/index.ts` and
199
- * `vite-plugin/templates/default-ui.ts`.
212
+ * `vite-plugin/api-client-entries.ts` and `vite-plugin/sveltekit-generator.ts`
213
+ * now import {@link CRUD_OPERATIONS} (or {@link isCrudOperation} where a bare
214
+ * `.includes()` on the readonly tuple failed the stricter
215
+ * `tsconfig.typecheck.json`) rather than keeping their own verb copies
216
+ * (#2665). `vite-plugin/index.ts`'s copy backed `generateCLIModule()`, which
217
+ * #2664 retired along with the rest of the unused `smrt-virt-cli` module, so
218
+ * `index.ts` no longer imports anything from this module at all.
219
+ * `vite-plugin/templates/default-ui.ts` keeps its
220
+ * verb list as a local literal deliberately: `src/vite-plugin/templates/**`
221
+ * is excluded from both tsconfigs and the vite-dts build graph, and the
222
+ * package build copies that directory to `dist/` verbatim rather than
223
+ * compiling it -- see the module's own comment. Its `.ts` source is never
224
+ * resolved or bundled by anything in this package, so a static import of the
225
+ * Node-side `isCrudOperation`/`CRUD_OPERATIONS` (which pull in
226
+ * `tools/tool-generator.js`) would never be satisfied there. The
227
+ * consolidation test instead asserts the literal's *value* matches
228
+ * {@link CRUD_OPERATIONS} rather than assuming it imports it. Consolidating
229
+ * the lists did not change any of the
230
+ * per-emitter RULES documented above -- each site still decides case-folding
231
+ * and conditionality for itself.
200
232
  *
201
233
  * Read the list through {@link isCrudOperation} or {@link isCrudToolAction}
202
234
  * rather than re-declaring it; the two differ only in case folding, because the
@@ -247,6 +279,11 @@ export interface ResolveCustomActionMetadataOptions {
247
279
  method?: {
248
280
  isStatic?: boolean;
249
281
  parameters?: MethodDefinition['parameters'];
282
+ /**
283
+ * The method's `@method()` config, whose options win field by field over
284
+ * the class-level `api.routes` entry for the same action (#2686).
285
+ */
286
+ decoratorConfig?: Record<string, unknown>;
250
287
  };
251
288
  apiConfig?: unknown;
252
289
  /** Collection-class actions have a collection receiver even when non-static. */
@@ -260,6 +297,23 @@ type ToolArgs = Record<string, unknown>;
260
297
  * schema; runtime callers may still provide their legacy collection fallback.
261
298
  */
262
299
  export declare function resolveCustomActionMetadata(options: ResolveCustomActionMetadataOptions): ResolvedCustomActionMetadata;
300
+ /**
301
+ * The declared scope, when it contradicts the receiver the method actually
302
+ * has; `undefined` when there is no declaration or it agrees.
303
+ *
304
+ * A scope is a DECLARATION about a method, not a relocation of it: nothing in
305
+ * a config can move an instance method onto the class. Silently ignoring a
306
+ * contradiction leaves an author believing a route exists at a collection URL
307
+ * that was never written, so the generators report this at build time
308
+ * (#2686).
309
+ */
310
+ export declare function resolveDeclaredScopeMismatch(options: {
311
+ actionName: string;
312
+ method?: ExposableMethod;
313
+ apiConfig?: unknown;
314
+ /** The receiver-derived scope, as the emitter computed it. */
315
+ effectiveScope: CustomActionScope;
316
+ }): CustomActionScope | undefined;
263
317
  /** Build the custom-action portion of an MCP/WebMCP JSON Schema. */
264
318
  export declare function buildCustomActionInputSchema(metadata: CustomActionMetadata): JsonSchema;
265
319
  /**
@@ -290,4 +344,359 @@ export declare const SMRT_CUSTOM_ACTION_ERROR_METADATA_KEY = "io.happyvertical/s
290
344
  * REST callers receive non-2xx semantics even when an adapter omits it.
291
345
  */
292
346
  export declare function normalizeCustomActionFailure(value: unknown): CustomActionFailure | undefined;
347
+ /**
348
+ * The `@method()` decorator's options, as they reach a consumer.
349
+ *
350
+ * Narrowed from the manifest's untyped `MethodDefinition.decoratorConfig` by
351
+ * {@link readMethodDecoratorConfig}. The authoring type is `MethodOptions` in
352
+ * `decorators/index.ts`; this is the read side, and it is deliberately
353
+ * defensive — every field is validated, and a malformed one is dropped rather
354
+ * than trusted, the same stance `readConfiguredToolMetadata` takes for a
355
+ * scanned `api.routes` entry.
356
+ */
357
+ export interface MethodDecoratorConfig {
358
+ /**
359
+ * `false` withholds a method the wire-ability heuristic accepted; `true`
360
+ * exposes one it rejected.
361
+ *
362
+ * `true` bypasses the HEURISTIC only. It cannot manufacture a receiver, undo
363
+ * `api: false`, escape an `include`/`exclude` boundary, reach a non-public
364
+ * method, or claim a CRUD verb the generated operation already owns — and it
365
+ * does not hydrate a parameter the transport cannot build (a model instance
366
+ * still arrives as whatever JSON the caller sent).
367
+ */
368
+ expose?: boolean;
369
+ /** Why the method is withheld. Reported by the knowledge artifact. */
370
+ reason?: string;
371
+ /** HTTP verb for the generated route. Migrates from `api.routes[m].method`. */
372
+ httpMethod?: ApiHttpMethod;
373
+ /** Route path segment(s). Migrates from `api.routes[m].path`. */
374
+ path?: string;
375
+ /**
376
+ * Declared receiver scope. Migrates from `api.routes[m].scope`.
377
+ *
378
+ * DECLARATIVE, not relocating: the executable receiver decides (an instance
379
+ * method is item-scoped, a static or collection-class method is
380
+ * collection-scoped), exactly as `api.routes[m].scope` already behaves. A
381
+ * mismatch keeps the receiver and reports a diagnostic.
382
+ */
383
+ scope?: CustomActionScope;
384
+ /** Browser/agent-visible effect. Migrates from `api.routes[m].effect`. */
385
+ effect?: ToolEffect;
386
+ /** Whether repeating the action with the same arguments is safe. */
387
+ idempotent?: boolean;
388
+ /** Whether the action may interact outside the SMRT application. */
389
+ openWorld?: boolean;
390
+ /** AI/tool description. Migrates from `ai.descriptions[m]`. */
391
+ description?: string;
392
+ }
393
+ /**
394
+ * The only parameter facts the wire-ability test reads.
395
+ *
396
+ * Deliberately looser than the manifest's `MethodParameterDefinition`: callers
397
+ * outside the vite plugin hold their own structural view of a registered
398
+ * method (`@happyvertical/smrt-users`' `MethodLike`, for one) and must be able
399
+ * to ask this question without first widening their type to the manifest's.
400
+ */
401
+ export interface WireableParameter {
402
+ name: string;
403
+ type?: string | undefined;
404
+ /** See `MethodParameterDefinition.typeUnresolved`. */
405
+ typeUnresolved?: boolean | undefined;
406
+ /** See `MethodParameterDefinition.memberTypes`. */
407
+ memberTypes?: readonly string[] | undefined;
408
+ /**
409
+ * See `MethodParameterDefinition.unionBranches`. Preferred over
410
+ * `memberTypes` when present: it keeps each union branch's members attached
411
+ * to that branch instead of flattening them together (#2686).
412
+ */
413
+ unionBranches?: readonly {
414
+ type: string;
415
+ memberTypes?: readonly string[] | undefined;
416
+ }[] | undefined;
417
+ }
418
+ /** Minimal method shape the exposure resolver reads. */
419
+ export interface ExposableMethod {
420
+ isPublic?: boolean;
421
+ isStatic?: boolean;
422
+ parameters?: readonly WireableParameter[] | undefined;
423
+ decoratorConfig?: Record<string, unknown>;
424
+ }
425
+ /**
426
+ * Read and validate the `@method()` config the scanner put on a manifest
427
+ * method. Returns `undefined` for an undecorated method.
428
+ */
429
+ export declare function readMethodDecoratorConfig(method: ExposableMethod | undefined): MethodDecoratorConfig | undefined;
430
+ /** Options that let the wire-ability test consult the surrounding manifest. */
431
+ export interface WireabilityOptions {
432
+ /**
433
+ * True when `name` identifies a class the manifest knows about — a model,
434
+ * collection, or junction. Such a parameter wants a live instance with
435
+ * methods and a database binding; JSON cannot produce one.
436
+ *
437
+ * OPTIONAL, and its absence is a documented widening: without a class
438
+ * inventory the test cannot distinguish `Asset` from `AssetOptions`, so it
439
+ * accepts both — and because every OTHER rejection still applies, the caller
440
+ * then disagrees with the emitters on exactly the largest group of withheld
441
+ * methods. Build it with {@link createManifestClassNamePredicate} from a
442
+ * manifest, or {@link createClassNamePredicate} from a live registry's class
443
+ * names. The parameter stays optional only because `resolveApiActionSet`'s
444
+ * arguments are public API and optional there.
445
+ */
446
+ isModelClassName?: (name: string) => boolean;
447
+ }
448
+ /** Result of testing one method (or one parameter) for wire-ability. */
449
+ export interface WireabilityVerdict {
450
+ wireable: boolean;
451
+ /** Present only when `wireable` is false. */
452
+ reason?: string;
453
+ }
454
+ /**
455
+ * Build the `isModelClassName` predicate {@link classifyMethodWireability}
456
+ * needs, from a manifest.
457
+ *
458
+ * Both the SIMPLE and QUALIFIED name of every manifest class are registered: a
459
+ * parameter is annotated with the simple name in source, but a qualified name
460
+ * can reach the predicate through a `TSQualifiedName` annotation.
461
+ *
462
+ * Returns `undefined` for a missing manifest, which widens the gate — see
463
+ * {@link WireabilityOptions.isModelClassName}.
464
+ */
465
+ export declare function createManifestClassNamePredicate(manifest: SmartObjectManifest | undefined): ((name: string) => boolean) | undefined;
466
+ /**
467
+ * The same predicate from a bare name list, for a caller whose class inventory
468
+ * is the live `ObjectRegistry` rather than a manifest — notably
469
+ * `@happyvertical/smrt-users`' CLI resource listing, which iterates
470
+ * `ObjectRegistry.getAllClasses()` and has no manifest to hand.
471
+ *
472
+ * Exported so that caller does not grow its own copy: without a predicate the
473
+ * gate half-applies (every rejection EXCEPT model instances), which is worse
474
+ * than either extreme because the consumer then disagrees with the emitters on
475
+ * exactly the largest group of withheld methods.
476
+ */
477
+ export declare function createClassNamePredicate(names: Iterable<string>): (name: string) => boolean;
478
+ /**
479
+ * Whether one declared parameter can be built from a JSON request body or
480
+ * query string.
481
+ */
482
+ export declare function classifyParameterWireability(parameter: WireableParameter, options?: WireabilityOptions): WireabilityVerdict;
483
+ /**
484
+ * Whether every declared parameter of a method can be built from a JSON
485
+ * request body or query string.
486
+ *
487
+ * A method with NO manifest parameter metadata is wire-able: that is the
488
+ * legacy options-bag contract every transport already supports, and absent
489
+ * metadata is not evidence of a hostile signature.
490
+ */
491
+ export declare function classifyMethodWireability(method: Pick<ExposableMethod, 'parameters'>, options?: WireabilityOptions): WireabilityVerdict;
492
+ /**
493
+ * Why a public method is not reachable as a generated API action.
494
+ *
495
+ * Machine-readable so callers can react differently per cause: the route
496
+ * emitters warn on `no-receiver` (a configuration mistake worth shouting
497
+ * about) and stay quiet on the rest, while the knowledge artifact reports the
498
+ * accompanying `reason` text for every one of them (#2686).
499
+ */
500
+ export type ApiMethodRejectionCode = 'api-disabled' | 'crud-reserved' | 'not-public' | 'lifecycle-method' | 'excluded' | 'not-included' | 'withheld' | 'not-wireable' | 'no-receiver';
501
+ /** Verdict of {@link resolveApiMethodExposure}. */
502
+ export interface ApiMethodExposure {
503
+ exposed: boolean;
504
+ /** Present only when `exposed` is false. */
505
+ code?: ApiMethodRejectionCode;
506
+ /** Human-readable explanation, present only when `exposed` is false. */
507
+ reason?: string;
508
+ }
509
+ export interface ResolveApiMethodExposureOptions extends WireabilityOptions {
510
+ actionName: string;
511
+ method: ExposableMethod;
512
+ /** The class's scanned `api` config (`decoratorConfig.api`). */
513
+ apiConfig?: unknown;
514
+ /**
515
+ * True when the HOST is a collection class, which emits only
516
+ * collection-scoped routes. Drives the receiver check.
517
+ */
518
+ isCollectionClass?: boolean;
519
+ }
520
+ /**
521
+ * The single decision every generated-API consumer asks: is this method
522
+ * reachable as a custom REST action, and if not, why?
523
+ *
524
+ * ONE resolver, four consumers — both SvelteKit route emitters
525
+ * (`generateRoutesForObject`, `generateCollectionRoutesForObject`), the
526
+ * cli↔api coherence resolver (`resolveApiActionSet`), and the knowledge
527
+ * artifact's API projection. They previously each re-derived a subset: the
528
+ * emitters filtered on `shouldIncludeInApi` plus their own receiver skip,
529
+ * `resolveApiActionSet` mirrored both, and `knowledge.ts` mirrored the
530
+ * receiver half a third time. A gate added to only one of them would report a
531
+ * method as unavailable while still writing its route file, which is the exact
532
+ * incoherence this issue exists to close (#2686).
533
+ *
534
+ * Order matters, and is the tested precedence contract:
535
+ *
536
+ * 1. `api: false` — the class has no REST surface at all.
537
+ * 2. A CRUD verb — the generated operation already owns the name (#2646).
538
+ * 3. Non-public — never a surface.
539
+ * 4. A framework lifecycle method (`save`, `initialize`, `toJSON`, ...) — the
540
+ * mechanism behind generated CRUD, not a distinct operation, even when a
541
+ * subclass declares its own override. `CLIGenerator` and `MCPGenerator`
542
+ * already gate on this; REST did not, and this is where it joins them
543
+ * (#2638, #2657).
544
+ * 5. `api.exclude` — an explicit withdrawal.
545
+ * 6. `api.include` — an explicit allowlist boundary.
546
+ * 7. `@method({ expose: false })` — an explicit withdrawal that outranks every
547
+ * remaining rule, including a legacy `api.routes` entry for the same
548
+ * method. This is why the decorator is `@method()` and not `@action()`:
549
+ * declaring something an action in order to say it is not one contradicts
550
+ * itself.
551
+ * 8. Explicit legacy exposure — a name listed in `api.include` or carrying an
552
+ * `api.routes` entry is a DECLARATION that this method is a route, made
553
+ * before the heuristic existed. It bypasses the heuristic. This is the
554
+ * documented compatibility exception that makes "nothing breaks" true for
555
+ * the 42 existing route entries; without it, migrating a class to the new
556
+ * gate could silently drop a route its author had spelled out.
557
+ * 9. `@method({ expose: true })` — bypasses the heuristic, and NOTHING else.
558
+ * It cannot manufacture a receiver (step 10 still applies), reach a
559
+ * non-public method, or hydrate a parameter the transport cannot build.
560
+ * 10. Wire-ability — every parameter must be constructible from JSON.
561
+ * 11. Receiver — a collection class emits only collection-scoped routes, and a
562
+ * model class cannot host a collection-scoped instance method.
563
+ */
564
+ export declare function resolveApiMethodExposure(options: ResolveApiMethodExposureOptions): ApiMethodExposure;
565
+ /**
566
+ * The effective route/tool metadata for one custom action, with `@method()`
567
+ * winning FIELD BY FIELD over the class-level `api.routes` map and
568
+ * `ai.descriptions`.
569
+ *
570
+ * Field-by-field, not wholesale: `@method({ description: '...' })` on a class
571
+ * that already declares `routes: { runReview: { method: 'POST', path:
572
+ * 'reviews' } }` must not silently reset that verb and path to their defaults.
573
+ * Only options the decorator actually supplies override their legacy
574
+ * counterparts (#2686).
575
+ */
576
+ export interface EffectiveActionMetadata {
577
+ httpMethod?: ApiHttpMethod;
578
+ path?: string;
579
+ scope?: CustomActionScope;
580
+ effect?: ToolEffect;
581
+ idempotent?: boolean;
582
+ openWorld?: boolean;
583
+ description?: string;
584
+ }
585
+ export declare function resolveEffectiveActionMetadata(options: {
586
+ actionName: string;
587
+ method?: ExposableMethod;
588
+ apiConfig?: unknown;
589
+ aiConfig?: unknown;
590
+ }): EffectiveActionMetadata;
591
+ /**
592
+ * Whether a method's `@method()` declaration is also a RUNTIME REST route
593
+ * declaration, the way an `api.routes[m]` entry is.
594
+ *
595
+ * The runtime `APIGenerator` transport is deliberately declaration-gated: it
596
+ * serves a custom collection action only where one was declared, because its URL
597
+ * shape supports a single segment and an undeclared public method has never had
598
+ * a route there. `dispatchCustomCollectionAction` and the `isRestActionRoutable`
599
+ * preflight prediction must agree on that gate exactly, so both read this (#2686).
600
+ *
601
+ * True for any option that migrates from `ApiCustomRouteConfig` — its complete
602
+ * field set is `scope`, `method`, `path`, `effect`, `idempotent`, `openWorld` —
603
+ * because a legacy `routes: { m: { effect: 'write' } }` entry with no path or
604
+ * verb already dispatches at `POST /<collection>/m`, and migrating it onto the
605
+ * method must not silently delete that endpoint. Also true for an explicit
606
+ * `expose: true`, which is a stronger statement that the method is an action
607
+ * than an empty route entry is.
608
+ *
609
+ * FALSE for a bare `@method()` and for a `description`-only one. Neither
610
+ * migrates from a route entry — `description` migrates from `ai.descriptions`,
611
+ * and a bare decorator is a review marker — so counting them would hand the
612
+ * runtime transport endpoints it never served.
613
+ */
614
+ export declare function declaresRuntimeRestRoute(method: ExposableMethod | undefined): boolean;
615
+ /**
616
+ * Whether the author WROTE a runtime REST route declaration on this method,
617
+ * ignoring whether they then withheld it.
618
+ *
619
+ * Deliberately distinct from {@link declaresRuntimeRestRoute}: the dispatcher
620
+ * must still SEE a withheld declaration in order to refuse it explicitly. This
621
+ * router resolves `POST /<collection>/<segment>` to `create` when nothing
622
+ * claims the segment, so dropping a withheld action from the candidate set
623
+ * would turn a request aimed at an explicitly withheld operation into a silent
624
+ * row insert. The candidate set reads this; the preflight PREDICTION reads
625
+ * {@link declaresRuntimeRestRoute}, which adds the `expose: false` veto —
626
+ * "there is a declaration here" and "it is reachable" are different questions.
627
+ */
628
+ export declare function declaresRuntimeRestRouteShape(method: ExposableMethod | undefined): boolean;
629
+ /**
630
+ * Coerce one transport-supplied argument into the runtime value the declared
631
+ * parameter type needs.
632
+ *
633
+ * Today that means exactly one conversion: a `Date` parameter, which the
634
+ * wire-ability heuristic accepts as JSON-shaped. JSON has no date type, so a
635
+ * caller can only send an ISO string (or an epoch number) and the receiving
636
+ * method — which calls `getTime()`, or hands the value to a query builder that
637
+ * expects a `Date` — would otherwise get a string. Accepting `Date` as
638
+ * wire-able and NOT hydrating it here would generate a route that 500s, so the
639
+ * two are one decision (#2686).
640
+ *
641
+ * Deliberately narrow:
642
+ * - Only a TOP-LEVEL declared parameter is converted. A `Date` nested inside a
643
+ * named options bag is invisible to the manifest (the bag is accepted
644
+ * heuristically, its members unresolved), so it is not hydrated and the
645
+ * method must accept the string itself.
646
+ * - An already-`Date` value, and anything that is not a string or finite
647
+ * number, passes through untouched, so a runtime caller invoking the same
648
+ * helper is never degraded.
649
+ * - An unparseable string passes through as-is rather than becoming an
650
+ * `Invalid Date`, leaving the method's own validation in charge of the error
651
+ * message.
652
+ */
653
+ export declare function coerceCustomActionArgument(value: unknown, declaredType: string | undefined): unknown;
654
+ /**
655
+ * The `Date` half of {@link coerceCustomActionArgument}, exported on its own
656
+ * because generated SvelteKit route code calls it directly: the generator
657
+ * already knows at build time which parameters are `Date`-typed, so the
658
+ * emitted handler names the conversion rather than re-deriving it from a type
659
+ * string at runtime. Both paths share this one implementation so the two
660
+ * transports cannot drift.
661
+ */
662
+ export declare function toCustomActionDate(value: unknown): unknown;
663
+ /**
664
+ * Decode a `number`-typed action argument that arrived over a QUERY STRING.
665
+ *
666
+ * A GET handler builds its options from `URLSearchParams`, so every value is a
667
+ * string: `limit: number` reached the method as `'2'` and any arithmetic on it
668
+ * silently produced string concatenation or `NaN` (#2686). A JSON body needs no
669
+ * such repair, which is why this is emitted only on GET routes.
670
+ *
671
+ * Leaves anything it cannot decode alone, so a malformed value reaches the
672
+ * method's own validation rather than becoming a silent `NaN`.
673
+ */
674
+ export declare function toCustomActionNumber(value: unknown): unknown;
675
+ /**
676
+ * The `boolean` counterpart to {@link toCustomActionNumber}. A query string
677
+ * carries `?active=false`, and the bare string `'false'` is TRUTHY — the most
678
+ * dangerous of these coercions, since it inverts a guard rather than degrading
679
+ * it. Only the four canonical spellings decode; anything else is left for the
680
+ * method's own validation.
681
+ */
682
+ export declare function toCustomActionBoolean(value: unknown): unknown;
683
+ /**
684
+ * The query-string decoder a GET route should apply to one parameter, or
685
+ * `undefined` when the value passes through untouched.
686
+ *
687
+ * Mirrors {@link declaredTypeAcceptsDate}: a nullish branch does not change the
688
+ * representation, but a genuine alternative (`number | string`) means the
689
+ * method already accepts what the query string sends, so nothing is decoded.
690
+ */
691
+ export declare function queryStringDecoderFor(declaredType: string | undefined): 'toCustomActionDate' | 'toCustomActionNumber' | 'toCustomActionBoolean' | undefined;
692
+ /**
693
+ * True when the declared type is a `Date` and nothing else.
694
+ *
695
+ * `Date | null` and `Date | undefined` qualify — a nullish branch is not an
696
+ * alternative representation. `Date | string` deliberately does NOT: that
697
+ * signature already accepts the string a JSON caller sends, so the method's
698
+ * own handling is authoritative and converting behind its back would change
699
+ * which branch it takes.
700
+ */
701
+ export declare function declaredTypeAcceptsDate(declaredType: string): boolean;
293
702
  //# sourceMappingURL=custom-action.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-action.d.ts","sourceRoot":"","sources":["../../src/generators/custom-action.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,YAAY,CAAC;AACtD,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,eAAO,MAAM,gCAAgC,EAAE,WAAW,CAAC,MAAM,CAuB/D,CAAC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