llm-strings 1.0.1 → 1.1.1

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 (50) hide show
  1. package/README.md +95 -14
  2. package/dist/chunk-FCEV23OT.js +37 -0
  3. package/dist/chunk-FCEV23OT.js.map +1 -0
  4. package/dist/chunk-MGWGNZDJ.cjs +116 -0
  5. package/dist/chunk-MGWGNZDJ.cjs.map +1 -0
  6. package/dist/chunk-MPIHGH6L.js +116 -0
  7. package/dist/chunk-MPIHGH6L.js.map +1 -0
  8. package/dist/chunk-N6NVBE43.cjs +37 -0
  9. package/dist/chunk-N6NVBE43.cjs.map +1 -0
  10. package/dist/chunk-NSCBY4VD.cjs +370 -0
  11. package/dist/chunk-NSCBY4VD.cjs.map +1 -0
  12. package/dist/chunk-RSUXM42X.cjs +180 -0
  13. package/dist/chunk-RSUXM42X.cjs.map +1 -0
  14. package/dist/chunk-UYMVUTLV.js +180 -0
  15. package/dist/chunk-UYMVUTLV.js.map +1 -0
  16. package/dist/chunk-XID353H7.js +370 -0
  17. package/dist/chunk-XID353H7.js.map +1 -0
  18. package/dist/index.cjs +12 -806
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +4 -80
  21. package/dist/index.d.ts +4 -80
  22. package/dist/index.js +11 -764
  23. package/dist/index.js.map +1 -1
  24. package/dist/normalize.cjs +8 -0
  25. package/dist/normalize.cjs.map +1 -0
  26. package/dist/normalize.d.cts +33 -0
  27. package/dist/normalize.d.ts +33 -0
  28. package/dist/normalize.js +8 -0
  29. package/dist/normalize.js.map +1 -0
  30. package/dist/parse.cjs +9 -0
  31. package/dist/parse.cjs.map +1 -0
  32. package/dist/parse.d.cts +32 -0
  33. package/dist/parse.d.ts +32 -0
  34. package/dist/parse.js +9 -0
  35. package/dist/parse.js.map +1 -0
  36. package/dist/provider-core-DinpG40u.d.cts +53 -0
  37. package/dist/provider-core-DinpG40u.d.ts +53 -0
  38. package/dist/providers.cjs +37 -392
  39. package/dist/providers.cjs.map +1 -1
  40. package/dist/providers.d.cts +4 -42
  41. package/dist/providers.d.ts +4 -42
  42. package/dist/providers.js +20 -336
  43. package/dist/providers.js.map +1 -1
  44. package/dist/validate.cjs +10 -0
  45. package/dist/validate.cjs.map +1 -0
  46. package/dist/validate.d.cts +21 -0
  47. package/dist/validate.d.ts +21 -0
  48. package/dist/validate.js +10 -0
  49. package/dist/validate.js.map +1 -0
  50. package/package.json +33 -1
@@ -0,0 +1,21 @@
1
+ interface ValidationIssue {
2
+ param: string;
3
+ value: string;
4
+ message: string;
5
+ severity: "error" | "warning";
6
+ }
7
+ interface ValidateOptions {
8
+ /** Promote warnings (unknown provider, unknown params) to errors. */
9
+ strict?: boolean;
10
+ }
11
+ /**
12
+ * Validate an LLM connection string.
13
+ *
14
+ * Parses and normalizes the string, then checks params against provider specs.
15
+ * For gateway providers (OpenRouter, Vercel), detects the sub-provider from the
16
+ * model prefix and validates against the sub-provider's rules when known.
17
+ * Returns a list of issues found. An empty array means all params look valid.
18
+ */
19
+ declare function validate(connectionString: string, options?: ValidateOptions): ValidationIssue[];
20
+
21
+ export { type ValidateOptions, type ValidationIssue, validate };
@@ -0,0 +1,21 @@
1
+ interface ValidationIssue {
2
+ param: string;
3
+ value: string;
4
+ message: string;
5
+ severity: "error" | "warning";
6
+ }
7
+ interface ValidateOptions {
8
+ /** Promote warnings (unknown provider, unknown params) to errors. */
9
+ strict?: boolean;
10
+ }
11
+ /**
12
+ * Validate an LLM connection string.
13
+ *
14
+ * Parses and normalizes the string, then checks params against provider specs.
15
+ * For gateway providers (OpenRouter, Vercel), detects the sub-provider from the
16
+ * model prefix and validates against the sub-provider's rules when known.
17
+ * Returns a list of issues found. An empty array means all params look valid.
18
+ */
19
+ declare function validate(connectionString: string, options?: ValidateOptions): ValidationIssue[];
20
+
21
+ export { type ValidateOptions, type ValidationIssue, validate };
@@ -0,0 +1,10 @@
1
+ import {
2
+ validate
3
+ } from "./chunk-UYMVUTLV.js";
4
+ import "./chunk-MPIHGH6L.js";
5
+ import "./chunk-FCEV23OT.js";
6
+ import "./chunk-XID353H7.js";
7
+ export {
8
+ validate
9
+ };
10
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "llm-strings",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "Parse and build LLM connection strings — like database URLs, but for LLM APIs",
5
5
  "type": "module",
6
+ "sideEffects": false,
6
7
  "main": "./dist/index.cjs",
7
8
  "module": "./dist/index.js",
8
9
  "types": "./dist/index.d.ts",
@@ -17,6 +18,36 @@
17
18
  "default": "./dist/index.cjs"
18
19
  }
19
20
  },
21
+ "./parse": {
22
+ "import": {
23
+ "types": "./dist/parse.d.ts",
24
+ "default": "./dist/parse.js"
25
+ },
26
+ "require": {
27
+ "types": "./dist/parse.d.cts",
28
+ "default": "./dist/parse.cjs"
29
+ }
30
+ },
31
+ "./normalize": {
32
+ "import": {
33
+ "types": "./dist/normalize.d.ts",
34
+ "default": "./dist/normalize.js"
35
+ },
36
+ "require": {
37
+ "types": "./dist/normalize.d.cts",
38
+ "default": "./dist/normalize.cjs"
39
+ }
40
+ },
41
+ "./validate": {
42
+ "import": {
43
+ "types": "./dist/validate.d.ts",
44
+ "default": "./dist/validate.js"
45
+ },
46
+ "require": {
47
+ "types": "./dist/validate.d.cts",
48
+ "default": "./dist/validate.cjs"
49
+ }
50
+ },
20
51
  "./providers": {
21
52
  "import": {
22
53
  "types": "./dist/providers.d.ts",
@@ -58,6 +89,7 @@
58
89
  },
59
90
  "devDependencies": {
60
91
  "@eslint/js": "^10.0.1",
92
+ "@vitest/coverage-v8": "^4.0.18",
61
93
  "eslint": "^10.0.0",
62
94
  "prettier": "^3.0.0",
63
95
  "tsup": "^8.0.0",