@dbx-tools/dbx-model-catalog 0.1.8 → 0.2.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.
package/README.md CHANGED
@@ -19,6 +19,21 @@ Set `DBX_MODEL_CATALOG_PATH` to load a local catalog. The client loads
19
19
  `search-index.json` from the same directory unless `searchIndexPath` is set.
20
20
  Generated catalog types are re-exported from the package.
21
21
 
22
+ The browser-safe entry point also exports the catalog-owned Zod schemas. Use
23
+ these schemas directly in downstream wire contracts instead of recreating the
24
+ catalog fields:
25
+
26
+ ```ts
27
+ import {
28
+ CatalogModelRecordSchema,
29
+ CatalogStatusSchema,
30
+ type CatalogModelRecord,
31
+ } from "@dbx-tools/dbx-model-catalog/browser";
32
+
33
+ const model: CatalogModelRecord = CatalogModelRecordSchema.parse(value);
34
+ const status = CatalogStatusSchema.parse(model.status);
35
+ ```
36
+
22
37
  For direct public ingestion without the service client, use the exported URL
23
38
  for the schema this package was generated against:
24
39
 
@@ -36,24 +51,28 @@ The `/browser` entry point exports `loadModelCatalog()` and
36
51
  `createModelCatalogClient()` for browser and worker use. Both use the same
37
52
  TypeScript filtering and ranked-search implementation as the Node entry point.
38
53
 
39
- Use the bundled snapshot for synchronous matching and enrichment of endpoints
40
- that another client already discovered:
54
+ Load the public catalog remotely when matching and enriching endpoints that
55
+ another client already discovered:
41
56
 
42
57
  ```ts
43
58
  import {
44
- bundledModelCatalogIndex,
45
59
  enrichLiveModels,
46
- } from "@dbx-tools/dbx-model-catalog/snapshot";
60
+ loadModelCatalogIndex,
61
+ } from "@dbx-tools/dbx-model-catalog/browser";
62
+
63
+ const modelCatalogIndex = await loadModelCatalogIndex();
47
64
 
48
65
  const enriched = enrichLiveModels(
49
- bundledModelCatalogIndex,
66
+ modelCatalogIndex,
50
67
  liveEndpoints,
51
68
  endpoint => [endpoint.name, endpoint.modelServiceName].filter(Boolean),
52
69
  );
53
70
  ```
54
71
 
55
72
  The join preserves live records that have no public catalog match. Workspace
56
- discovery remains authoritative when documentation lags.
73
+ discovery remains authoritative when documentation lags. The npm package does
74
+ not embed a catalog snapshot; catalog and search data are fetched from the
75
+ published schema URL.
57
76
 
58
77
  The local explorer demo uses the explicit Pynect adapter to connect to the
59
78
  Python server:
package/dist/browser.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { CatalogClient } from "./types.js";
2
+ import { type ModelCatalogIndex } from "./catalog-index.js";
2
3
  export type * from "./_generated/schemas.js";
3
4
  export type * from "./types.js";
4
5
  export { PUBLISHED_CATALOG_DATABASE_URL, PUBLISHED_CATALOG_INDEX_URL, PUBLISHED_CATALOG_ROOT_URL, PUBLISHED_CATALOG_SCHEMA_URL, PUBLISHED_CATALOG_SCHEMA_VERSION, PUBLISHED_CATALOG_SEARCH_INDEX_URL, PUBLISHED_CATALOG_URL, } from "./_generated/published.js";
@@ -8,6 +9,7 @@ export interface LoadModelCatalogOptions {
8
9
  searchIndexUrl?: string;
9
10
  }
10
11
  export declare function loadModelCatalog(options?: LoadModelCatalogOptions): Promise<CatalogClient>;
12
+ export declare function loadModelCatalogIndex(options?: LoadModelCatalogOptions): Promise<ModelCatalogIndex>;
11
13
  export * from "./catalog-index.js";
12
14
  export * from "./identity.js";
13
15
  export * from "./validation.js";