@x12i/ai-profiles 4.1.0 → 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.
Files changed (53) hide show
  1. package/README.md +35 -4
  2. package/dist/data/models-catalog.json +2183 -264
  3. package/dist/data/models-profiles.json +57 -20
  4. package/dist/data/models-registry.json +1 -1
  5. package/dist/deriveModelTags.d.ts +18 -0
  6. package/dist/deriveModelTags.d.ts.map +1 -0
  7. package/dist/deriveModelTags.js +148 -0
  8. package/dist/deriveModelTags.js.map +1 -0
  9. package/dist/index.d.ts +12 -3
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +6 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/listAICatalogModels.d.ts +30 -0
  14. package/dist/listAICatalogModels.d.ts.map +1 -0
  15. package/dist/listAICatalogModels.js +157 -0
  16. package/dist/listAICatalogModels.js.map +1 -0
  17. package/dist/listAIProfiles.d.ts +2 -4
  18. package/dist/listAIProfiles.d.ts.map +1 -1
  19. package/dist/listAIProfiles.js +13 -10
  20. package/dist/listAIProfiles.js.map +1 -1
  21. package/dist/listUsedAIProfileTags.d.ts +13 -0
  22. package/dist/listUsedAIProfileTags.d.ts.map +1 -0
  23. package/dist/listUsedAIProfileTags.js +52 -0
  24. package/dist/listUsedAIProfileTags.js.map +1 -0
  25. package/dist/modelsCatalog.d.ts.map +1 -1
  26. package/dist/modelsCatalog.js +5 -0
  27. package/dist/modelsCatalog.js.map +1 -1
  28. package/dist/profileDiscovery.d.ts +38 -6
  29. package/dist/profileDiscovery.d.ts.map +1 -1
  30. package/dist/profileDiscovery.js +78 -22
  31. package/dist/profileDiscovery.js.map +1 -1
  32. package/dist/profileTags.d.ts +43 -0
  33. package/dist/profileTags.d.ts.map +1 -0
  34. package/dist/profileTags.js +355 -0
  35. package/dist/profileTags.js.map +1 -0
  36. package/dist/resolveAIProfileByTags.d.ts +13 -3
  37. package/dist/resolveAIProfileByTags.d.ts.map +1 -1
  38. package/dist/resolveAIProfileByTags.js +26 -7
  39. package/dist/resolveAIProfileByTags.js.map +1 -1
  40. package/dist/resolveCatalogModelByTags.d.ts +39 -0
  41. package/dist/resolveCatalogModelByTags.d.ts.map +1 -0
  42. package/dist/resolveCatalogModelByTags.js +112 -0
  43. package/dist/resolveCatalogModelByTags.js.map +1 -0
  44. package/dist/types.d.ts +30 -4
  45. package/dist/types.d.ts.map +1 -1
  46. package/dist/validation/validateModelsCatalog.d.ts.map +1 -1
  47. package/dist/validation/validateModelsCatalog.js +11 -0
  48. package/dist/validation/validateModelsCatalog.js.map +1 -1
  49. package/dist/validation/validateModelsProfilesJson.d.ts +5 -1
  50. package/dist/validation/validateModelsProfilesJson.d.ts.map +1 -1
  51. package/dist/validation/validateModelsProfilesJson.js +10 -13
  52. package/dist/validation/validateModelsProfilesJson.js.map +1 -1
  53. 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 tag overlap (partial match OK), then resolve |
275
- | `scoreProfileTags` / `rankProfilesByTags` | Yes | Tag overlap scoring for discovery and custom UIs |
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,36 @@ 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** are short (2–4 chars), many per profile (`cyb`, `eco`, `ds`, …). Use `listAIProfiles({ tags })` or `resolveAIProfileByTags(['cyb', 'eco'])` for discovery — partial overlap is OK; the profile with the most matching tags wins, then an explicit choice is resolved.
460
+ **Tags exist to filter.** Short codes on profiles and catalog models (`cyb`, `eco`, `cod`, `oai`, …). Get the tag list, then filter:
461
+
462
+ ```ts
463
+ import {
464
+ listAIProfileTags, // all allowed tags (+ labels)
465
+ listUsedAIProfileTags, // tags present in the loaded registry
466
+ listAIProfiles, // filter profiles by tags
467
+ resolveAIProfileByTags, // pick best matching profile → resolve it
468
+ listAICatalogModels, // filter catalog models by tags
469
+ resolveCatalogModelByTags, // pick best matching model (+ optional profile branch)
470
+ } from "@x12i/ai-profiles";
471
+
472
+ listAIProfileTags(); // glossary for pickers
473
+ await listUsedAIProfileTags({ source: "bundled" }); // what's actually used
474
+
475
+ // Filter: keep profiles that have these tags
476
+ await listAIProfiles({ tags: ["cyb", "eco"], tagMatch: "any" }); // any of
477
+ await listAIProfiles({ tags: ["cyb", "sec"], tagMatch: "all" }); // all of
478
+
479
+ // Filter + resolve in one step
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" });
485
+ ```
486
+
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.
459
490
 
460
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`).
461
492
 
@@ -993,7 +1024,7 @@ Workflow YAML is in [`docs/github-workflows/`](docs/github-workflows/). Copy int
993
1024
  Consumers install with:
994
1025
 
995
1026
  ```bash
996
- npm install @x12i/ai-profiles@^4.1.0
1027
+ npm install @x12i/ai-profiles@^4.2.0
997
1028
  ```
998
1029
 
999
1030
  Peer dependency for downstream repos (graphs-studio, graph-engine, ai-tasks):