@happyvertical/smrt-core 0.51.11 → 0.51.12
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/schema-paths.md +19 -6
- package/dist/class.d.ts +1 -1
- package/dist/class.d.ts.map +1 -1
- package/dist/class.js +4 -2
- package/dist/class.js.map +1 -1
- package/dist/decorators/index.d.ts +19 -0
- package/dist/decorators/index.d.ts.map +1 -1
- package/dist/decorators/index.js.map +1 -1
- package/dist/index.js +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/migrations/differ.d.ts +64 -5
- package/dist/migrations/differ.d.ts.map +1 -1
- package/dist/migrations/differ.js +270 -37
- package/dist/migrations/differ.js.map +1 -1
- package/dist/migrations/index.d.ts +1 -1
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +2 -2
- package/dist/migrations/sqlite-rebuild.d.ts +41 -0
- package/dist/migrations/sqlite-rebuild.d.ts.map +1 -1
- package/dist/migrations/sqlite-rebuild.js +68 -13
- package/dist/migrations/sqlite-rebuild.js.map +1 -1
- package/dist/migrations.js +2 -2
- package/dist/registry/db-cache-key.d.ts +47 -0
- package/dist/registry/db-cache-key.d.ts.map +1 -0
- package/dist/registry/db-cache-key.js +201 -0
- package/dist/registry/db-cache-key.js.map +1 -0
- package/dist/registry/schema-builder.d.ts.map +1 -1
- package/dist/registry/schema-builder.js +6 -1
- package/dist/registry/schema-builder.js.map +1 -1
- package/dist/registry.d.ts +3 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +5 -6
- package/dist/registry.js.map +1 -1
- package/dist/scanner/types.d.ts +2 -0
- package/dist/scanner/types.d.ts.map +1 -1
- package/dist/scanner/types.js.map +1 -1
- package/dist/schema/backfill.d.ts +16 -0
- package/dist/schema/backfill.d.ts.map +1 -0
- package/dist/schema/backfill.js +26 -0
- package/dist/schema/backfill.js.map +1 -0
- package/dist/schema/generator.d.ts.map +1 -1
- package/dist/schema/generator.js +3 -0
- package/dist/schema/generator.js.map +1 -1
- package/dist/schema/types.d.ts +12 -0
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +5 -5
- package/package.json +10 -10
package/dist/registry.js
CHANGED
|
@@ -18,6 +18,7 @@ import "./utils.js";
|
|
|
18
18
|
import { isFrameworkBaseClass } from "./registry/framework-base-classes.js";
|
|
19
19
|
import { createFieldFromManifest, manifestFieldDiffers, mergeManifestField } from "./registry/manifest-field-merge.js";
|
|
20
20
|
import { ensureTenantScopedField, invalidateInheritanceEntries, register, registerCollection, registerFromManifest } from "./registry/class-registration.js";
|
|
21
|
+
import { resolveCollectionDbCacheKey } from "./registry/db-cache-key.js";
|
|
21
22
|
import { getEmbeddingClasses, getEmbeddingConfig, getProjectEmbeddingConfig, hasEmbeddings, resolveEmbeddingConfig } from "./registry/embedding-manager.js";
|
|
22
23
|
import { getDependencyGraph, getRelationshipMap, resolveRelationshipTarget } from "./registry/relationship-graph.js";
|
|
23
24
|
import { SMRT_COLLECTION_BASE_NAMES, isSmrtCollectionExtendsName } from "./registry/collection-resolution.js";
|
|
@@ -178,6 +179,9 @@ var ObjectRegistry = class ObjectRegistry {
|
|
|
178
179
|
/**
|
|
179
180
|
* WeakMap to assign unique IDs to database instances for cache keys
|
|
180
181
|
* Prevents cache key collisions when different db instances are used
|
|
182
|
+
*
|
|
183
|
+
* Read sites live in `registry/db-cache-key.ts` (via shared-state) since
|
|
184
|
+
* #2306 moved the db-cache-key derivation out of `getCollection()`.
|
|
181
185
|
*/
|
|
182
186
|
static get dbInstanceIds() {
|
|
183
187
|
return getDbInstanceIds();
|
|
@@ -1279,12 +1283,7 @@ var ObjectRegistry = class ObjectRegistry {
|
|
|
1279
1283
|
if (await ObjectRegistry.tryLoadFromExternalPackage(className)) ({canonicalName, registered, collectionConstructor} = ObjectRegistry.resolveCollectionRegistration(className));
|
|
1280
1284
|
if (!registered && !collectionConstructor) throw new Error(`Class ${className} not found in ObjectRegistry. Make sure to register it with @smrt() decorator or ObjectRegistry.register()`);
|
|
1281
1285
|
}
|
|
1282
|
-
|
|
1283
|
-
if (options.db && typeof options.db === "object") {
|
|
1284
|
-
if (!ObjectRegistry.dbInstanceIds.has(options.db)) ObjectRegistry.dbInstanceIds.set(options.db, ObjectRegistry.nextDbId++);
|
|
1285
|
-
const dbId = ObjectRegistry.dbInstanceIds.get(options.db);
|
|
1286
|
-
dbCacheKey = dbId === void 0 ? void 0 : `instance:${dbId}`;
|
|
1287
|
-
} else if (typeof options.db === "string") dbCacheKey = `string:${options.db}`;
|
|
1286
|
+
const dbCacheKey = resolveCollectionDbCacheKey(options.db);
|
|
1288
1287
|
const cacheKey = `${canonicalName}:${JSON.stringify({
|
|
1289
1288
|
persistence: options.persistence,
|
|
1290
1289
|
db: dbCacheKey,
|