@happyvertical/smrt-core 0.57.28 → 0.57.30
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/build-knowledge.md +8 -0
- package/agents/generators.md +26 -0
- package/dist/consumer-plugin/index.d.ts.map +1 -1
- package/dist/consumer-plugin/index.js +9 -3
- package/dist/consumer-plugin/index.js.map +1 -1
- package/dist/manifest/static-manifest.js +1 -1
- package/dist/manifest/static-manifest.js.map +1 -1
- package/dist/manifest/store.js +1 -1
- package/dist/manifest.json +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +3 -1
- package/dist/registry.js.map +1 -1
- package/dist/scanner/manifest-generator.d.ts +19 -0
- package/dist/scanner/manifest-generator.d.ts.map +1 -1
- package/dist/scanner/manifest-generator.js +34 -2
- package/dist/scanner/manifest-generator.js.map +1 -1
- package/dist/smrt-knowledge.json +7 -7
- package/dist/vite-plugin/sveltekit-generator.d.ts.map +1 -1
- package/dist/vite-plugin/sveltekit-generator.js +21 -12
- package/dist/vite-plugin/sveltekit-generator.js.map +1 -1
- package/package.json +10 -10
|
@@ -121,6 +121,14 @@ that declares `svelte` anyway only loses an optional context import.
|
|
|
121
121
|
Transitive-only object modules are loaded through `importSmrtDependency()`
|
|
122
122
|
from their provider's context, which needs no root import.
|
|
123
123
|
|
|
124
|
+
Selective SSR compilation compares a JavaScript barrel's `svelte` export target
|
|
125
|
+
against the package instance visible from its actual importer. pnpm may install
|
|
126
|
+
the same version in multiple peer contexts; the app-root package directory is
|
|
127
|
+
not the identity of a transitive import. Read that importer's installed export
|
|
128
|
+
map and root together, preserving exact target matching. Plain server entries
|
|
129
|
+
remain external; do not fix peer-context resolution by deduplicating app
|
|
130
|
+
packages or bundling every server export (#4318).
|
|
131
|
+
|
|
124
132
|
Not covered by contract: a package whose root is a Svelte entry AND whose
|
|
125
133
|
`@smrt()` objects are exported only from that root. The object loop must then
|
|
126
134
|
import the root (it is the only module exporting the constructors) — statically
|
package/agents/generators.md
CHANGED
|
@@ -457,3 +457,29 @@ model-level validation, and regenerate RLS policies when adopting a changed
|
|
|
457
457
|
binding.
|
|
458
458
|
|
|
459
459
|
Custom actions retain the `{ action, result }` response envelope.
|
|
460
|
+
|
|
461
|
+
## Collection-hosted REST factory identity (#4320)
|
|
462
|
+
|
|
463
|
+
Generated collection custom-action handlers resolve their executable collection
|
|
464
|
+
using the declaring resource's exact qualified registration key. Keep that
|
|
465
|
+
factory key separate from the item model's qualified type/policy metadata:
|
|
466
|
+
item collection slugs still govern permissions, and ordinary model routes keep
|
|
467
|
+
their own factory lookup. A resource in another package must neither rebuild
|
|
468
|
+
an item identity under its package nor steal the item's existing package when
|
|
469
|
+
its collection decorator merges configuration. Registration and generated
|
|
470
|
+
factory selection share one identity resolver; never install global aliases to
|
|
471
|
+
repair an inferred or bundled class name.
|
|
472
|
+
|
|
473
|
+
Every collection hosting a generated REST action receives its exact constructor
|
|
474
|
+
binding even with `cli: false` or omitted CLI configuration. This runtime-only
|
|
475
|
+
binding does not add discovery metadata: named HTTP CLI resources keep their
|
|
476
|
+
existing explicit-include eligibility. Constructor-only qualified receivers keep
|
|
477
|
+
their own collection-cache identity while resolving backing item metadata, so
|
|
478
|
+
ordinary model factories cannot reuse a different resource receiver. Neither
|
|
479
|
+
CLI nor MCP discovery gains a resource or default CRUD surface from this binding.
|
|
480
|
+
|
|
481
|
+
When consumer registration owns external packages (`smrtDependencies`), its
|
|
482
|
+
`.smrt/register.js` binds external REST action receivers using the resolved
|
|
483
|
+
canonical/provider-context export. The SvelteKit registration module continues
|
|
484
|
+
to delegate external imports there; external bindings also add no discovery
|
|
485
|
+
metadata and do not depend on CLI inclusion.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/consumer-plugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAa,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9C,O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E,CAAC;IACpB,uCAAuC;IACvC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,6BAA6B,CAAC;IACnD;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,4BAA4B,CAAC;IACnD;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oDAAoD;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4BAA4B;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAmXD;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,MAAM,CA2lBtE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../scanner/types.js";
|
|
2
2
|
import { canonicalSvelteKitPath } from "../vite-plugin/sveltekit-path.js";
|
|
3
|
-
import { clearGeneratedSvelteKitRouteFiles, reconcileSvelteKitRouteGitignore } from "../vite-plugin/sveltekit-generator.js";
|
|
3
|
+
import { clearGeneratedSvelteKitRouteFiles, reconcileSvelteKitRouteGitignore, resolveApiActionSet } from "../vite-plugin/sveltekit-generator.js";
|
|
4
4
|
import { generateWebModule, isCollectionManifestClass, resolveCollectionItemObject } from "../vite-plugin/web-collections.js";
|
|
5
5
|
import { publishArtifactFiles } from "./artifact-publication.js";
|
|
6
6
|
import { resolveFileKnowledgeConfig } from "../knowledge-config.js";
|
|
@@ -523,7 +523,10 @@ function smrtConsumer(options = {}) {
|
|
|
523
523
|
skipSelf: true
|
|
524
524
|
});
|
|
525
525
|
const compile = resolved?.id.endsWith(".svelte") || resolved?.id.endsWith(".css");
|
|
526
|
-
const
|
|
526
|
+
const importerPath = importer?.split("?")[0];
|
|
527
|
+
const packageJsonPath = importerPath && path$1.isAbsolute(importerPath) ? findInstalledPackageJson(packageName, path$1.dirname(importerPath)) : void 0;
|
|
528
|
+
const packageJson = packageJsonPath ? readInstalledPackageJson(packageJsonPath) : selectivePackage.packageJson;
|
|
529
|
+
const compileSvelteBarrel = packageJson && resolvesToSvelteCondition(packageName, packageJson, packageJsonPath ? path$1.dirname(packageJsonPath) : selectivePackage.packageRoot, id, resolved?.id);
|
|
527
530
|
if (!compile && !compileSvelteBarrel) return {
|
|
528
531
|
id,
|
|
529
532
|
external: true
|
|
@@ -953,7 +956,10 @@ async function generateRegistrationFile(manifest, projectRoot) {
|
|
|
953
956
|
itemBinding: exportBinding
|
|
954
957
|
});
|
|
955
958
|
importedEntryCount++;
|
|
956
|
-
if (isCollectionClass(def))
|
|
959
|
+
if (isCollectionClass(def)) {
|
|
960
|
+
if (resolveApiActionSet(def, manifest).size > 0) registrations.push(`if (${exportBinding}) ObjectRegistry.registerCollection(${JSON.stringify(qualifiedName)}, ${exportBinding});`);
|
|
961
|
+
continue;
|
|
962
|
+
}
|
|
957
963
|
const logicalName = def.className || exportName;
|
|
958
964
|
registrationManifests[objectName] = {
|
|
959
965
|
...manifest,
|