llm-switcher 1.1.11 → 1.2.2

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 (61) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +202 -257
  3. package/README.vi.md +200 -256
  4. package/blindfold/blindfold.mjs +200 -53
  5. package/blindfold/make-certs.sh +26 -7
  6. package/catalog.mjs +246 -0
  7. package/classifier.mjs +238 -0
  8. package/config.example.json +12 -34
  9. package/docs/codex-blindfold.md +28 -17
  10. package/docs/cross-platform.md +16 -7
  11. package/docs/diagrams/ir-healer-pipeline.mmd +16 -0
  12. package/docs/diagrams/ir-healer-pipeline.png +0 -0
  13. package/docs/diagrams/ir-healer-pipeline.svg +90 -0
  14. package/docs/diagrams/ir-translation-pipeline.html +14925 -0
  15. package/docs/diagrams/ir-translation-pipeline.sequence.json +31 -0
  16. package/docs/diagrams/ir-translation-pipeline.svg +5128 -0
  17. package/docs/diagrams/system-architecture.architecture.json +76 -0
  18. package/docs/diagrams/system-architecture.html +14978 -0
  19. package/docs/diagrams/system-architecture.svg +5147 -0
  20. package/docs/diagrams/system-topology.mmd +30 -0
  21. package/docs/diagrams/system-topology.png +0 -0
  22. package/docs/diagrams/system-topology.svg +125 -0
  23. package/ensure-ca-bundle.mjs +28 -0
  24. package/formats.mjs +43 -156
  25. package/icons/antigravity.png +0 -0
  26. package/icons/claude.png +0 -0
  27. package/icons/codex.png +0 -0
  28. package/icons/deepseek.png +0 -0
  29. package/icons/gemini.png +0 -0
  30. package/icons/github.png +0 -0
  31. package/icons/groq.png +0 -0
  32. package/icons/intact.svg +1 -0
  33. package/icons/ollama.png +0 -0
  34. package/icons/openai.png +0 -0
  35. package/icons/openrouter.png +0 -0
  36. package/icons/qwen.png +0 -0
  37. package/icons/vertex.png +0 -0
  38. package/mcp.mjs +39 -11
  39. package/package.json +1 -1
  40. package/proxy.mjs +114 -37
  41. package/shim.mjs +200 -57
  42. package/skills/llm-switcher/SKILL.md +15 -10
  43. package/state.mjs +1100 -191
  44. package/switch.cmd +2 -2
  45. package/switch.mjs +228 -53
  46. package/tests/blindfold-e2e.test.mjs +380 -0
  47. package/tests/blindfold-task5.test.mjs +429 -0
  48. package/tests/blindfold.task3.test.mjs +700 -0
  49. package/tests/blindfold.test.mjs +10 -5
  50. package/tests/catalog.test.mjs +147 -0
  51. package/tests/classifier.test.mjs +210 -0
  52. package/tests/contract-lab.test.mjs +22 -7
  53. package/tests/formats.test.mjs +63 -46
  54. package/tests/gateway.e2e.test.mjs +136 -36
  55. package/tests/lifecycle.test.mjs +16 -10
  56. package/tests/mcp.test.mjs +78 -2
  57. package/tests/real-user-sim.test.mjs +464 -0
  58. package/tests/shim.test.mjs +159 -66
  59. package/tests/state.test.mjs +975 -193
  60. package/tests/switch.test.mjs +446 -2
  61. package/ui.html +1710 -1726
@@ -0,0 +1,76 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "architecture",
4
+ "meta": {
5
+ "title": "LLM Switcher System Topology & Edge Architecture",
6
+ "output": "docs/diagrams/system-architecture.html",
7
+ "quality_profile": "showcase",
8
+ "viewBox": [1200, 560]
9
+ },
10
+ "components": [
11
+ { "id": "claude-cli", "type": "frontend", "label": "Claude Code CLI", "sublabel": "/v1/messages", "pos": [50, 140], "size": [160, 60] },
12
+ { "id": "codex-cli", "type": "frontend", "label": "OpenAI Codex CLI", "sublabel": "/v1/responses (WS)", "pos": [50, 320], "size": [160, 60] },
13
+ { "id": "opt", "type": "backend", "label": "Token Optimizer", "sublabel": "Headroom / RTK", "pos": [280, 230], "size": [160, 60], "tag": "Optional" },
14
+ { "id": "router", "type": "security", "label": "Edge Router", "sublabel": "localhost:3456", "pos": [510, 230], "size": [160, 60], "tag": "Zero-Dependency" },
15
+ { "id": "healer", "type": "backend", "label": "Healer Engine", "sublabel": "Auto-Repair Schemas", "pos": [740, 140], "size": [160, 60] },
16
+ { "id": "ir", "type": "backend", "label": "Bi-Directional IR", "sublabel": "Event Stream Synth", "pos": [740, 320], "size": [160, 60] },
17
+ { "id": "intact", "type": "cloud", "label": "intact Gateway", "sublabel": "Credential Proxy & Lab", "pos": [980, 140], "size": [170, 60], "tag": "Recommended" },
18
+ { "id": "upstream-providers", "type": "cloud", "label": "Other Upstreams", "sublabel": "9Router / OpenRouter / Vertex", "pos": [980, 320], "size": [170, 60] }
19
+ ],
20
+ "boundaries": [
21
+ {
22
+ "kind": "region",
23
+ "label": "Local Developer Workstation (localhost)",
24
+ "wraps": ["claude-cli", "codex-cli", "opt", "router", "healer", "ir"]
25
+ },
26
+ {
27
+ "kind": "security-group",
28
+ "label": "LLM Switcher Edge Gateway (:3456)",
29
+ "wraps": ["router", "healer", "ir"]
30
+ },
31
+ {
32
+ "kind": "region",
33
+ "label": "Server & Provider Infrastructure",
34
+ "wraps": ["intact", "upstream-providers"]
35
+ }
36
+ ],
37
+ "connections": [
38
+ { "id": "claude-to-router", "from": "claude-cli", "to": "router", "label": "direct /v1/messages", "variant": "emphasis" },
39
+ { "id": "codex-to-router", "from": "codex-cli", "to": "router", "label": "direct /v1/responses", "variant": "emphasis" },
40
+ { "id": "opt-to-router", "from": "opt", "to": "router" },
41
+ { "id": "router-to-healer", "from": "router", "to": "healer" },
42
+ { "id": "healer-to-ir", "from": "healer", "to": "ir" },
43
+ { "id": "router-to-ir", "from": "router", "to": "ir", "variant": "dashed" },
44
+ { "id": "ir-to-intact", "from": "ir", "to": "intact", "label": "contract & pool", "variant": "emphasis" },
45
+ { "id": "ir-to-providers", "from": "ir", "to": "upstream-providers" }
46
+ ],
47
+ "cards": [
48
+ {
49
+ "dot": "cyan",
50
+ "title": "Zero-Mutation Interceptor",
51
+ "items": [
52
+ "Never modifies ~/.claude/settings.json or ~/.codex/config.toml",
53
+ "Injects local environment dynamically via shims into HTTPS_PROXY",
54
+ "No provider warning banner, 100% genuine official experience"
55
+ ]
56
+ },
57
+ {
58
+ "dot": "emerald",
59
+ "title": "Self-Healing Protocol Bridge",
60
+ "items": [
61
+ "Heals broken tool_result orphans and empty schemas ({})",
62
+ "Restores reasoning thinking_delta blocks and budget tokens",
63
+ "Seamless WebSocket continuation for Codex via previous_response_id"
64
+ ]
65
+ },
66
+ {
67
+ "dot": "amber",
68
+ "title": "Server Upstream Synergy",
69
+ "items": [
70
+ "Pairs with intact for multi-account pooling and contract lab",
71
+ "Supports 9Router, OpenRouter, Vertex, and custom backends",
72
+ "Instant failover with zero client interruption"
73
+ ]
74
+ }
75
+ ]
76
+ }