llm-switcher 1.1.11 → 1.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 (51) hide show
  1. package/CHANGELOG.md +51 -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/config.example.json +12 -34
  8. package/docs/TOKEN-OPTIMIZER-INTEROP.md +110 -110
  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/docs/response-matrix.json +1130 -1130
  24. package/ensure-ca-bundle.mjs +28 -0
  25. package/formats.mjs +13 -155
  26. package/mcp.mjs +39 -11
  27. package/package.json +1 -1
  28. package/proxy.mjs +92 -27
  29. package/shim.mjs +200 -57
  30. package/skills/llm-switcher/SKILL.md +93 -88
  31. package/state.mjs +1100 -191
  32. package/switch +0 -0
  33. package/switch.cmd +2 -2
  34. package/switch.mjs +228 -53
  35. package/tests/blindfold-e2e.test.mjs +380 -0
  36. package/tests/blindfold-task5.test.mjs +429 -0
  37. package/tests/blindfold.task3.test.mjs +700 -0
  38. package/tests/blindfold.test.mjs +10 -5
  39. package/tests/catalog.test.mjs +147 -0
  40. package/tests/contract-lab.test.mjs +22 -7
  41. package/tests/formats.test.mjs +33 -46
  42. package/tests/gateway.e2e.test.mjs +136 -36
  43. package/tests/helpers.mjs +24 -24
  44. package/tests/lifecycle.test.mjs +16 -10
  45. package/tests/live-optimizer-interop.mjs +205 -205
  46. package/tests/mcp.test.mjs +78 -2
  47. package/tests/real-user-sim.test.mjs +464 -0
  48. package/tests/shim.test.mjs +159 -66
  49. package/tests/state.test.mjs +975 -193
  50. package/tests/switch.test.mjs +446 -2
  51. package/ui.html +61 -154
@@ -0,0 +1,31 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "sequence",
4
+ "meta": {
5
+ "title": "Bi-Directional IR Translation & Self-Healing Pipeline",
6
+ "output": "docs/diagrams/ir-translation-pipeline.html",
7
+ "viewBox": [1080, 560],
8
+ "column_fit": "spread",
9
+ "quality_profile": "showcase"
10
+ },
11
+ "participants": [
12
+ { "id": "client", "type": "external", "label": "Client Agent", "sublabel": "Claude Code / Codex" },
13
+ { "id": "gateway", "type": "backend", "label": "Edge Gateway", "sublabel": "localhost:3456" },
14
+ { "id": "healer", "type": "security", "label": "Healer & IR Engine", "sublabel": "Self-Healing Normalize" },
15
+ { "id": "upstream", "type": "cloud", "label": "Upstream API", "sublabel": "intact / 9Router / Vertex" }
16
+ ],
17
+ "segments": [
18
+ { "from": 150, "to": 260, "label": "Inbound Normalization & Healing" },
19
+ { "from": 270, "to": 440, "label": "Outbound Streaming & Return Synthesis" }
20
+ ],
21
+ "messages": [
22
+ { "id": "m1", "from": "client", "to": "gateway", "y": 165, "label": "POST /v1/messages or /v1/responses", "variant": "emphasis" },
23
+ { "id": "m2", "from": "gateway", "to": "healer", "y": 200, "label": "parseToIR(clientFormat, payload)" },
24
+ { "id": "m3", "from": "healer", "to": "gateway", "y": 235, "label": "emitUpstreamBody(outFormat, healedIR)", "variant": "return" },
25
+ { "id": "m4", "from": "gateway", "to": "upstream", "y": 285, "label": "POST upstream endpoint (with AbortSignal)", "variant": "emphasis" },
26
+ { "id": "m5", "from": "upstream", "to": "gateway", "y": 325, "label": "Raw stream chunks (OpenAI / Vertex / Anthropic)", "variant": "return" },
27
+ { "id": "m6", "from": "gateway", "to": "healer", "y": 365, "label": "normalizeUpstream(chunk) & parse reasoning" },
28
+ { "id": "m7", "from": "healer", "to": "gateway", "y": 395, "label": "Native client event stream chunks", "variant": "return" },
29
+ { "id": "m8", "from": "gateway", "to": "client", "y": 425, "label": "Synthesized genuine SSE (thinking_delta + text)", "variant": "emphasis" }
30
+ ]
31
+ }