@wildo-ai/external-connectors-models 1.1.9 → 1.1.11

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 (59) hide show
  1. package/dist/esm/core/commons.external-connectors-models.schemas.d.ts +130 -0
  2. package/dist/esm/core/commons.external-connectors-models.schemas.d.ts.map +1 -1
  3. package/dist/esm/core/commons.external-connectors-models.schemas.js +193 -0
  4. package/dist/esm/core/commons.external-connectors-models.schemas.js.map +1 -1
  5. package/dist/esm/core/security.external-connectors-models.schemas.d.ts +2 -0
  6. package/dist/esm/core/security.external-connectors-models.schemas.d.ts.map +1 -1
  7. package/dist/esm/core/security.external-connectors-models.schemas.js +10 -4
  8. package/dist/esm/core/security.external-connectors-models.schemas.js.map +1 -1
  9. package/dist/esm/index.d.ts +2 -0
  10. package/dist/esm/index.d.ts.map +1 -1
  11. package/dist/esm/index.js +2 -0
  12. package/dist/esm/index.js.map +1 -1
  13. package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.d.ts +1 -0
  14. package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.d.ts.map +1 -1
  15. package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.js +10 -1
  16. package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.js.map +1 -1
  17. package/dist/esm/protocols/billing.standard-interface.schemas.d.ts +8 -0
  18. package/dist/esm/protocols/billing.standard-interface.schemas.d.ts.map +1 -1
  19. package/dist/esm/protocols/billing.standard-interface.schemas.js +8 -0
  20. package/dist/esm/protocols/billing.standard-interface.schemas.js.map +1 -1
  21. package/dist/esm/protocols/content-safety.external-connectors-models.schemas.d.ts +150 -0
  22. package/dist/esm/protocols/content-safety.external-connectors-models.schemas.d.ts.map +1 -0
  23. package/dist/esm/protocols/content-safety.external-connectors-models.schemas.js +182 -0
  24. package/dist/esm/protocols/content-safety.external-connectors-models.schemas.js.map +1 -0
  25. package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.d.ts +41 -9
  26. package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.d.ts.map +1 -1
  27. package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.js +40 -14
  28. package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.js.map +1 -1
  29. package/dist/esm/protocols/email.standard-interface.schemas.d.ts.map +1 -1
  30. package/dist/esm/protocols/email.standard-interface.schemas.js +4 -0
  31. package/dist/esm/protocols/email.standard-interface.schemas.js.map +1 -1
  32. package/dist/esm/protocols/embeddings.external-connectors-models.schemas.d.ts +37 -4
  33. package/dist/esm/protocols/embeddings.external-connectors-models.schemas.d.ts.map +1 -1
  34. package/dist/esm/protocols/embeddings.external-connectors-models.schemas.js +57 -1
  35. package/dist/esm/protocols/embeddings.external-connectors-models.schemas.js.map +1 -1
  36. package/dist/esm/protocols/file-storage.standard-interface.d.ts +6 -0
  37. package/dist/esm/protocols/file-storage.standard-interface.d.ts.map +1 -1
  38. package/dist/esm/protocols/file-storage.standard-interface.js.map +1 -1
  39. package/dist/esm/protocols/hooks-capability.external-connectors-models.schemas.d.ts +7 -2
  40. package/dist/esm/protocols/hooks-capability.external-connectors-models.schemas.d.ts.map +1 -1
  41. package/dist/esm/protocols/hooks-capability.external-connectors-models.schemas.js.map +1 -1
  42. package/dist/esm/protocols/hooks.external-connectors-models.schemas.d.ts +388 -7
  43. package/dist/esm/protocols/hooks.external-connectors-models.schemas.d.ts.map +1 -1
  44. package/dist/esm/protocols/hooks.external-connectors-models.schemas.js +238 -0
  45. package/dist/esm/protocols/hooks.external-connectors-models.schemas.js.map +1 -1
  46. package/dist/esm/protocols/llm.external-connectors-models.schemas.d.ts +70 -5
  47. package/dist/esm/protocols/llm.external-connectors-models.schemas.d.ts.map +1 -1
  48. package/dist/esm/protocols/llm.external-connectors-models.schemas.js +96 -5
  49. package/dist/esm/protocols/llm.external-connectors-models.schemas.js.map +1 -1
  50. package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.d.ts +446 -5
  51. package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.d.ts.map +1 -1
  52. package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.js +406 -0
  53. package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.js.map +1 -1
  54. package/dist/esm/protocols/subject-erasure-effect.standard-interface.d.ts +133 -0
  55. package/dist/esm/protocols/subject-erasure-effect.standard-interface.d.ts.map +1 -0
  56. package/dist/esm/protocols/subject-erasure-effect.standard-interface.js +61 -0
  57. package/dist/esm/protocols/subject-erasure-effect.standard-interface.js.map +1 -0
  58. package/dist/tsconfig.build.tsbuildinfo +1 -1
  59. package/package.json +2 -2
@@ -648,6 +648,55 @@ export const LLM_MODEL_APPLICABILITY_PREFERENCE = {
648
648
  const LLM_MODEL_APPLICABILITY_REQUIRED_IO = {
649
649
  [LLM_Model_Applicability.VISUAL_JUDGMENT]: [LLM_Model_IO_Capability.MULTIMODAL_VISION],
650
650
  };
651
+ const isDeclarationRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
652
+ const isNonEmptyDeclarationString = (value) => typeof value === "string" && value.trim().length > 0;
653
+ const listsOnlyMembersOf = (value, members) => Array.isArray(value) && value.every((member) => members.has(member));
654
+ /**
655
+ * Why a provider's declared chat models ({@link LLM_ModelDeclaration}) cannot be used, or `undefined` (#2516). Absent is
656
+ * fine: an engine provider has none.
657
+ *
658
+ * A registry provider's module is loaded at runtime, so nothing here compiled its `models`; this is the check that holds
659
+ * them to their shape before resolution reads them. Every vocabulary is checked against its enum, because an unknown
660
+ * applicability would simply never match, and an unknown IO capability would read as evidence it is not.
661
+ */
662
+ export const describeLLMModelDeclarationsDefect = (models) => {
663
+ if (models === undefined)
664
+ return undefined;
665
+ if (!Array.isArray(models))
666
+ return "are not a list";
667
+ const applicabilities = new Set(Object.values(LLM_Model_Applicability));
668
+ const ioCapabilities = new Set(Object.values(LLM_Model_IO_Capability));
669
+ const thinking = new Set(Object.values(LLM_Model_Thinking_Capability));
670
+ const efforts = new Set(Object.values(LLMProvider_ReasoningEffort));
671
+ const seen = new Set();
672
+ for (const [index, declaration] of models.entries()) {
673
+ if (!isDeclarationRecord(declaration) || !isNonEmptyDeclarationString(declaration.model))
674
+ return `have no \`model\` at position ${index}`;
675
+ const model = declaration.model;
676
+ if (seen.has(model))
677
+ return `declare "${model}" twice`;
678
+ seen.add(model);
679
+ if (!listsOnlyMembersOf(declaration.applicabilities, applicabilities))
680
+ return `give "${model}" unknown \`applicabilities\``;
681
+ if (declaration.applicabilities.includes(LLM_Model_Applicability.WORKSPACE_CODING_AGENT)) {
682
+ return `declare "${model}" for workspace coding, which is served over the Agent Client Protocol and never through a chat model`;
683
+ }
684
+ if (declaration.ioCapabilities !== undefined && !listsOnlyMembersOf(declaration.ioCapabilities, ioCapabilities))
685
+ return `give "${model}" unknown \`ioCapabilities\``;
686
+ if (declaration.thinkingCapability !== undefined && !thinking.has(declaration.thinkingCapability))
687
+ return `give "${model}" an unknown \`thinkingCapability\``;
688
+ if (declaration.unsupportedReasoningEfforts !== undefined && !listsOnlyMembersOf(declaration.unsupportedReasoningEfforts, efforts)) {
689
+ return `give "${model}" unknown \`unsupportedReasoningEfforts\``;
690
+ }
691
+ }
692
+ return undefined;
693
+ };
694
+ /**
695
+ * Whether the engine's catalog knows this provider, which decides where its model facts come from (#2516): catalog rows
696
+ * for an engine provider, the provider's own `models` declaration otherwise. One predicate, so the resolver and the agent
697
+ * registration that reads declarations cannot disagree about which side a provider is on.
698
+ */
699
+ export const isLLMCatalogProvider = (providerRef, catalog = LLM_MODEL_CATALOG) => Object.values(catalog).some((entry) => entry.providerRef === providerRef);
651
700
  /** Why {@link resolveModelForApplicability} could not answer — carried into a named CONFIGURATION error. */
652
701
  export var LLM_ModelResolutionFailure;
653
702
  (function (LLM_ModelResolutionFailure) {
@@ -657,6 +706,11 @@ export var LLM_ModelResolutionFailure;
657
706
  LLM_ModelResolutionFailure["NO_RESOLVABLE_AVAILABILITY"] = "no_resolvable_availability";
658
707
  /** Candidates exist and are available, but none evidences the required IO capability. */
659
708
  LLM_ModelResolutionFailure["REQUIRED_IO_CAPABILITY_UNEVIDENCED"] = "required_io_capability_unevidenced";
709
+ /**
710
+ * An engine provider (one the catalog knows) also declares models. Its models are catalog rows; a declaration beside
711
+ * them would be a second, unchecked source of the same facts, so it is refused rather than merged.
712
+ */
713
+ LLM_ModelResolutionFailure["CATALOG_PROVIDER_DECLARES_MODELS"] = "catalog_provider_declares_models";
660
714
  })(LLM_ModelResolutionFailure || (LLM_ModelResolutionFailure = {}));
661
715
  /**
662
716
  * Resolve an applicability to ONE concrete model id for a given provider.
@@ -667,6 +721,13 @@ export var LLM_ModelResolutionFailure;
667
721
  * this layer exists to remove — the author asked for a KIND of model, and
668
722
  * quietly handing them a different kind is worse than refusing.
669
723
  *
724
+ * Two sources, decided by whether the catalog knows the provider (as document extraction decides, #2021):
725
+ * - an ENGINE provider resolves through {@link LLM_MODEL_APPLICABILITY_PREFERENCE} and its catalog rows, every gate
726
+ * below applying, and is refused if it also declares models;
727
+ * - any other provider resolves from its own `declaredModels`, in declared order: the first model declaring the
728
+ * applicability and evidencing the required IO capability. A provider that declares none fails with the same
729
+ * named failure, naming what it considered.
730
+ *
670
731
  * Note this function answers the semantic question only. Whether the resolved
671
732
  * model is reachable over the agent's TRANSPORT (a profile that
672
733
  * declares it) is a separate gate owned by the backend, because the transport
@@ -680,9 +741,26 @@ export var LLM_ModelResolutionFailure;
680
741
  * nothing.
681
742
  */
682
743
  export const resolveModelForApplicability = (input, catalog = LLM_MODEL_CATALOG) => {
744
+ const requiredIo = LLM_MODEL_APPLICABILITY_REQUIRED_IO[input.applicability] ?? [];
745
+ const declared = input.declaredModels ?? [];
746
+ const catalogKnowsProvider = isLLMCatalogProvider(input.providerRef, catalog);
747
+ if (catalogKnowsProvider && declared.length > 0) {
748
+ return { resolved: false, failure: LLM_ModelResolutionFailure.CATALOG_PROVIDER_DECLARES_MODELS, consideredModels: declared.map((entry) => entry.model) };
749
+ }
750
+ if (!catalogKnowsProvider) {
751
+ const applicable = declared.filter((entry) => entry.applicabilities.includes(input.applicability));
752
+ if (applicable.length === 0) {
753
+ return { resolved: false, failure: LLM_ModelResolutionFailure.NO_CANDIDATE_FOR_PROVIDER, consideredModels: declared.map((entry) => entry.model) };
754
+ }
755
+ const capable = applicable.filter((entry) => requiredIo.every((capability) => (entry.ioCapabilities ?? []).includes(capability)));
756
+ if (capable.length === 0) {
757
+ return { resolved: false, failure: LLM_ModelResolutionFailure.REQUIRED_IO_CAPABILITY_UNEVIDENCED, consideredModels: applicable.map((entry) => entry.model) };
758
+ }
759
+ const { model, ...facts } = capable[0];
760
+ return { resolved: true, model, facts, fromOverride: false };
761
+ }
683
762
  const override = input.preferenceOverride?.[input.applicability];
684
763
  const candidates = override ?? LLM_MODEL_APPLICABILITY_PREFERENCE[input.applicability];
685
- const requiredIo = LLM_MODEL_APPLICABILITY_REQUIRED_IO[input.applicability] ?? [];
686
764
  const forProvider = candidates.filter((model) => {
687
765
  const entry = catalog[model];
688
766
  return entry.providerRef === input.providerRef && entry.applicabilities.includes(input.applicability);
@@ -705,7 +783,18 @@ export const resolveModelForApplicability = (input, catalog = LLM_MODEL_CATALOG)
705
783
  return { resolved: false, failure: LLM_ModelResolutionFailure.REQUIRED_IO_CAPABILITY_UNEVIDENCED, consideredModels: available };
706
784
  }
707
785
  const model = capable[0];
708
- return { resolved: true, model, entry: catalog[model], fromOverride: override !== undefined };
786
+ const entry = catalog[model];
787
+ return {
788
+ resolved: true,
789
+ model,
790
+ facts: {
791
+ applicabilities: entry.applicabilities,
792
+ ...(entry.ioCapabilities === undefined ? {} : { ioCapabilities: entry.ioCapabilities }),
793
+ ...(entry.thinkingCapability === undefined ? {} : { thinkingCapability: entry.thinkingCapability }),
794
+ ...(entry.unsupportedReasoningEfforts === undefined ? {} : { unsupportedReasoningEfforts: entry.unsupportedReasoningEfforts }),
795
+ },
796
+ fromOverride: override !== undefined,
797
+ };
709
798
  };
710
799
  /**
711
800
  * Model → thinking capability, DERIVED from {@link LLM_MODEL_CATALOG}.
@@ -754,13 +843,15 @@ export const getModelThinkingCapability = (model) => LLM_MODEL_THINKING_CAPABILI
754
843
  *
755
844
  * @param model The configured model id (free-form; unknown ids pass).
756
845
  * @param effort The configured effort; omit/undefined always passes.
846
+ * @param declared For a model a registry provider declares (#2516), its own thinking facts; they replace the catalog's,
847
+ * which knows nothing of it. Absent facts fail open, exactly as for an unprobed catalog row.
757
848
  * @returns A violation message, or `null` if valid/unjudgeable.
758
849
  */
759
- export const validateReasoningEffortForModel = (model, effort) => {
850
+ export const validateReasoningEffortForModel = (model, effort, declared) => {
760
851
  /** @wildo_source:part:end saas.external-providers.llm.model-configuration */
761
852
  if (effort === undefined)
762
853
  return null;
763
- const capability = getModelThinkingCapability(model);
854
+ const capability = declared !== undefined ? declared.thinkingCapability : getModelThinkingCapability(model);
764
855
  if (capability === undefined)
765
856
  return null;
766
857
  if (capability === LLM_Model_Thinking_Capability.NONE) {
@@ -769,7 +860,7 @@ export const validateReasoningEffortForModel = (model, effort) => {
769
860
  if (capability === LLM_Model_Thinking_Capability.ALWAYS && effort === LLMProvider_ReasoningEffort.NONE) {
770
861
  return `Model "${model}" always reasons — its thinking cannot be disabled, so reasoningEffort "none" is rejected by the provider. Use "low" for the cheapest reasoning, or omit reasoningEffort for the model default.`;
771
862
  }
772
- const unsupported = LLM_MODEL_UNSUPPORTED_REASONING_EFFORTS[model];
863
+ const unsupported = declared !== undefined ? declared.unsupportedReasoningEfforts : LLM_MODEL_UNSUPPORTED_REASONING_EFFORTS[model];
773
864
  if (unsupported?.includes(effort)) {
774
865
  const hint = effort === LLMProvider_ReasoningEffort.PROVIDER_DEFAULT
775
866
  ? 'Omit reasoningEffort entirely to get the model default.'