@x12i/ai-profiles 4.1.1 → 4.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 +15 -5
- package/dist/data/models-catalog.json +2183 -264
- package/dist/data/models-profiles.json +8 -63
- package/dist/data/models-registry.json +1 -1
- package/dist/deriveModelTags.d.ts +18 -0
- package/dist/deriveModelTags.d.ts.map +1 -0
- package/dist/deriveModelTags.js +148 -0
- package/dist/deriveModelTags.js.map +1 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/listAICatalogModels.d.ts +30 -0
- package/dist/listAICatalogModels.d.ts.map +1 -0
- package/dist/listAICatalogModels.js +157 -0
- package/dist/listAICatalogModels.js.map +1 -0
- package/dist/listAIProfiles.d.ts.map +1 -1
- package/dist/listAIProfiles.js +8 -4
- package/dist/listAIProfiles.js.map +1 -1
- package/dist/modelsCatalog.d.ts.map +1 -1
- package/dist/modelsCatalog.js +5 -0
- package/dist/modelsCatalog.js.map +1 -1
- package/dist/profileDiscovery.d.ts +38 -6
- package/dist/profileDiscovery.d.ts.map +1 -1
- package/dist/profileDiscovery.js +70 -22
- package/dist/profileDiscovery.js.map +1 -1
- package/dist/profileTags.d.ts +5 -0
- package/dist/profileTags.d.ts.map +1 -1
- package/dist/profileTags.js +26 -0
- package/dist/profileTags.js.map +1 -1
- package/dist/resolveAIProfileByTags.d.ts +10 -2
- package/dist/resolveAIProfileByTags.d.ts.map +1 -1
- package/dist/resolveAIProfileByTags.js +21 -5
- package/dist/resolveAIProfileByTags.js.map +1 -1
- package/dist/resolveCatalogModelByTags.d.ts +39 -0
- package/dist/resolveCatalogModelByTags.d.ts.map +1 -0
- package/dist/resolveCatalogModelByTags.js +112 -0
- package/dist/resolveCatalogModelByTags.js.map +1 -0
- package/dist/types.d.ts +11 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/validation/validateModelsCatalog.d.ts.map +1 -1
- package/dist/validation/validateModelsCatalog.js +11 -0
- package/dist/validation/validateModelsCatalog.js.map +1 -1
- package/dist/validation/validateModelsProfilesJson.d.ts +5 -1
- package/dist/validation/validateModelsProfilesJson.d.ts.map +1 -1
- package/dist/validation/validateModelsProfilesJson.js +6 -13
- package/dist/validation/validateModelsProfilesJson.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -271,8 +271,10 @@ npm install @x12i/ai-profiles
|
|
|
271
271
|
| `resolveSecondaryModel(input, options?)` | No (async) | Resolve primary choice + optional companion `secondary` from profile `secondary` refs |
|
|
272
272
|
| `getSecondaryForResolvedProfile(resolved, registry, catalog?)` | Yes | Secondary for an already-resolved primary (no extra I/O when catalog is passed) |
|
|
273
273
|
| `listProfileSecondaries(profileKey, registry)` | Yes | List per-choice `secondary` declarations on a profile |
|
|
274
|
-
| `resolveAIProfileByTags(tags, options?)` | No (async) | Pick best profile by
|
|
275
|
-
| `
|
|
274
|
+
| `resolveAIProfileByTags(tags, options?)` | No (async) | Pick best profile by weighted tags (`tagMatch`, excludes discovery by default), then resolve |
|
|
275
|
+
| `listAICatalogModels(options?)` | No (async) | Filter/rank catalog models by tags; attaches intent `profileChoices` |
|
|
276
|
+
| `resolveCatalogModelByTags(tags, options?)` | No (async) | Best catalog model by weighted tags (+ optional profile branch map) |
|
|
277
|
+
| `scoreProfileTags` / `rankProfilesByTags` | Yes | Weighted tag scoring for discovery and custom UIs |
|
|
276
278
|
| `AIProfilesError` / `AIProfilesErrorCode` | — | Typed errors (`UNKNOWN_PROFILE`, `INVOKE_MODEL_ALIAS_AT_GATEWAY`, `INVOKE_MODEL_SHAPE_INVALID`, …) |
|
|
277
279
|
|
|
278
280
|
### Model identity (vendor + model strings)
|
|
@@ -455,7 +457,7 @@ Resolution accepts exactly **four** input forms:
|
|
|
455
457
|
|
|
456
458
|
**Not supported:** shortcuts (`cheapest`), bare profiles (`cheap`), aliases (`cost-sensitive`). Use discovery to pick a profile, then resolve an explicit `profile/choice`.
|
|
457
459
|
|
|
458
|
-
**Tags exist to filter.** Short codes on profiles (`cyb`, `eco`, `cod`, `oai`, …). Get the tag list, then filter
|
|
460
|
+
**Tags exist to filter.** Short codes on profiles and catalog models (`cyb`, `eco`, `cod`, `oai`, …). Get the tag list, then filter:
|
|
459
461
|
|
|
460
462
|
```ts
|
|
461
463
|
import {
|
|
@@ -463,6 +465,8 @@ import {
|
|
|
463
465
|
listUsedAIProfileTags, // tags present in the loaded registry
|
|
464
466
|
listAIProfiles, // filter profiles by tags
|
|
465
467
|
resolveAIProfileByTags, // pick best matching profile → resolve it
|
|
468
|
+
listAICatalogModels, // filter catalog models by tags
|
|
469
|
+
resolveCatalogModelByTags, // pick best matching model (+ optional profile branch)
|
|
466
470
|
} from "@x12i/ai-profiles";
|
|
467
471
|
|
|
468
472
|
listAIProfileTags(); // glossary for pickers
|
|
@@ -474,9 +478,15 @@ await listAIProfiles({ tags: ["cyb", "sec"], tagMatch: "all" }); // all of
|
|
|
474
478
|
|
|
475
479
|
// Filter + resolve in one step
|
|
476
480
|
await resolveAIProfileByTags(["cyb", "eco", "ds"], { catalogLane: "text" });
|
|
481
|
+
|
|
482
|
+
// Catalog models (tags are derived + inherited during registry:finish)
|
|
483
|
+
await listAICatalogModels({ tags: ["cod", "eco"], tagMatch: "all" });
|
|
484
|
+
await resolveCatalogModelByTags(["cod", "eco"], { catalogLane: "text" });
|
|
477
485
|
```
|
|
478
486
|
|
|
479
|
-
`tagMatch: "any"` (default) = match if any requested tag is present. `"all"` = every requested tag must be present. Results are ranked by
|
|
487
|
+
`tagMatch: "any"` (default) = match if any requested tag is present. `"all"` = every requested tag must be present. Results are ranked by **weighted** tag score (domain/task 3, capability 2, tier/vendor 1, `wf` 0.25), then coverage ratio, then fewer tags.
|
|
488
|
+
|
|
489
|
+
**Discovery exclusion:** by default, tag list/resolve pools skip `vendorFamily` and `category: "discovery"` profiles (`catalog`, `claude`, `grok`, …). Pass `includeDiscovery: true`, or include the `vnd` tag, to include them.
|
|
480
490
|
|
|
481
491
|
Input is normalized (trimmed, lowercased) before matching. Composite keys accept **`/` or `\`** as the separator (`cyber\default` → `cyber/default`). **Profile and choice segment names treat `-` and `_` as equivalent** (`cheap/google-floor` → `cheap/google_floor`).
|
|
482
492
|
|
|
@@ -1014,7 +1024,7 @@ Workflow YAML is in [`docs/github-workflows/`](docs/github-workflows/). Copy int
|
|
|
1014
1024
|
Consumers install with:
|
|
1015
1025
|
|
|
1016
1026
|
```bash
|
|
1017
|
-
npm install @x12i/ai-profiles@^4.
|
|
1027
|
+
npm install @x12i/ai-profiles@^4.2.0
|
|
1018
1028
|
```
|
|
1019
1029
|
|
|
1020
1030
|
Peer dependency for downstream repos (graphs-studio, graph-engine, ai-tasks):
|