@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 +25 -6
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +95 -8991
- package/dist/cli.js +181 -9094
- package/dist/index.d.ts +1 -1
- package/dist/index.js +77 -9027
- package/dist/pynect.js +6 -2
- package/dist/validation.d.ts +30 -1
- package/package.json +4 -7
- package/src/_generated/channels.ts +38 -0
- package/src/_generated/index.ts +6 -0
- package/src/_generated/json-schema.ts +3 -0
- package/src/_generated/published.ts +7 -0
- package/src/_generated/schemas.ts +408 -0
- package/src/browser.ts +64 -0
- package/src/catalog-index.ts +94 -0
- package/src/cli.ts +102 -0
- package/src/filter.ts +47 -0
- package/src/identity.ts +79 -0
- package/src/index.ts +114 -0
- package/src/local-client.ts +51 -0
- package/src/pynect.ts +68 -0
- package/src/search.ts +534 -0
- package/src/types.ts +19 -0
- package/src/validation.ts +94 -0
- package/dist/browser.js.map +0 -38
- package/dist/catalog.json +0 -1
- package/dist/cli.js.map +0 -40
- package/dist/index.js.map +0 -39
- package/dist/pynect.js.map +0 -15
- package/dist/search-index.json +0 -1
- package/dist/snapshot.d.ts +0 -7
- package/dist/snapshot.js +0 -9495
- package/dist/snapshot.js.map +0 -36
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
|
-
|
|
40
|
-
|
|
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
|
-
|
|
60
|
+
loadModelCatalogIndex,
|
|
61
|
+
} from "@dbx-tools/dbx-model-catalog/browser";
|
|
62
|
+
|
|
63
|
+
const modelCatalogIndex = await loadModelCatalogIndex();
|
|
47
64
|
|
|
48
65
|
const enriched = enrichLiveModels(
|
|
49
|
-
|
|
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";
|