llm-switcher 1.1.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/.gitattributes +16 -0
  2. package/LICENSE +21 -0
  3. package/README.md +587 -0
  4. package/README.vi.md +585 -0
  5. package/blindfold/blindfold.mjs +633 -0
  6. package/blindfold/make-certs.sh +88 -0
  7. package/blindfold/wsframe.mjs +176 -0
  8. package/codex-catalog-template.json +1 -0
  9. package/config.example.json +84 -0
  10. package/contract-exclusions.json +41 -0
  11. package/contract.mjs +561 -0
  12. package/docs/LLM-RESPONSE-MATRIX.md +165 -0
  13. package/docs/TOKEN-OPTIMIZER-INTEROP.md +110 -0
  14. package/docs/codex-blindfold.md +214 -0
  15. package/docs/cross-platform.md +136 -0
  16. package/docs/diagrams/blindfold-request-routing.html +14972 -0
  17. package/docs/diagrams/blindfold-request-routing.sequence.json +175 -0
  18. package/docs/diagrams/blindfold-switch-lifecycle.html +14958 -0
  19. package/docs/diagrams/blindfold-switch-lifecycle.lifecycle.json +159 -0
  20. package/docs/diagrams/codex-model-name-resolution.html +15005 -0
  21. package/docs/diagrams/codex-model-name-resolution.workflow.json +71 -0
  22. package/docs/response-matrix.json +1131 -0
  23. package/formats.mjs +2308 -0
  24. package/mcp.mjs +340 -0
  25. package/package.json +36 -0
  26. package/proxy.mjs +1743 -0
  27. package/service.mjs +132 -0
  28. package/shim.mjs +292 -0
  29. package/skills/llm-switcher/SKILL.md +88 -0
  30. package/state.mjs +978 -0
  31. package/switch +5 -0
  32. package/switch.cmd +2 -0
  33. package/switch.mjs +930 -0
  34. package/tests/blindfold.test.mjs +307 -0
  35. package/tests/blindfold.wire.test.mjs +170 -0
  36. package/tests/contract/run.test.mjs +214 -0
  37. package/tests/contract-check.test.mjs +458 -0
  38. package/tests/contract-lab.test.mjs +755 -0
  39. package/tests/datadir.test.mjs +37 -0
  40. package/tests/formats.test.mjs +794 -0
  41. package/tests/gateway.e2e.test.mjs +999 -0
  42. package/tests/helpers.mjs +24 -0
  43. package/tests/lifecycle.test.mjs +416 -0
  44. package/tests/live-optimizer-interop.mjs +205 -0
  45. package/tests/mcp.test.mjs +91 -0
  46. package/tests/service.test.mjs +69 -0
  47. package/tests/shim.test.mjs +228 -0
  48. package/tests/state.test.mjs +675 -0
  49. package/tests/switch.test.mjs +156 -0
  50. package/tests/wsframe.test.mjs +154 -0
  51. package/ui.html +2234 -0
@@ -0,0 +1,159 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "lifecycle",
4
+ "meta": {
5
+ "title": "Blindfold Lifecycle Under switch",
6
+ "output": "docs/diagrams/blindfold-switch-lifecycle.html",
7
+ "viewBox": [
8
+ 1080,
9
+ 566
10
+ ],
11
+ "quality_profile": "showcase"
12
+ },
13
+ "lanes": [
14
+ {
15
+ "id": "main",
16
+ "label": "Activation rail"
17
+ },
18
+ {
19
+ "id": "branch",
20
+ "label": "Branch and exit"
21
+ }
22
+ ],
23
+ "states": [
24
+ {
25
+ "id": "off",
26
+ "type": "start",
27
+ "label": "Off",
28
+ "sublabel": "official endpoints",
29
+ "lane": "main",
30
+ "col": 0,
31
+ "step": "01",
32
+ "tag": "idle"
33
+ },
34
+ {
35
+ "id": "requested",
36
+ "type": "active",
37
+ "label": "switch codex",
38
+ "sublabel": "profile selected",
39
+ "lane": "main",
40
+ "col": 1,
41
+ "step": "02",
42
+ "tag": "running"
43
+ },
44
+ {
45
+ "id": "validate",
46
+ "type": "decision",
47
+ "label": "CA present?",
48
+ "sublabel": "checked before any write",
49
+ "lane": "main",
50
+ "col": 2,
51
+ "step": "03",
52
+ "tag": "gate"
53
+ },
54
+ {
55
+ "id": "starting",
56
+ "type": "active",
57
+ "label": "Applying",
58
+ "sublabel": "env, catalog, shims",
59
+ "lane": "main",
60
+ "col": 3,
61
+ "step": "04",
62
+ "tag": "running"
63
+ },
64
+ {
65
+ "id": "active",
66
+ "type": "success",
67
+ "label": "Active",
68
+ "sublabel": "Codex routed and blinded",
69
+ "lane": "main",
70
+ "col": 4,
71
+ "step": "05",
72
+ "tag": "success"
73
+ },
74
+ {
75
+ "id": "refused",
76
+ "type": "failure",
77
+ "label": "Refused",
78
+ "sublabel": "no file written",
79
+ "lane": "branch",
80
+ "col": 0,
81
+ "tag": "recoverable"
82
+ },
83
+ {
84
+ "id": "interceptor",
85
+ "type": "active",
86
+ "label": "Interceptor",
87
+ "sublabel": "port 3457",
88
+ "lane": "branch",
89
+ "col": 1,
90
+ "tag": "spawned"
91
+ },
92
+ {
93
+ "id": "stopped",
94
+ "type": "success",
95
+ "label": "Stopped",
96
+ "sublabel": "switch off",
97
+ "lane": "branch",
98
+ "col": 2,
99
+ "tag": "terminal"
100
+ }
101
+ ],
102
+ "transitions": [
103
+ {
104
+ "from": "validate",
105
+ "to": "refused",
106
+ "variant": "security",
107
+ "route": "straight",
108
+ "fromSide": "bottom",
109
+ "toSide": "top"
110
+ },
111
+ {
112
+ "from": "refused",
113
+ "to": "requested",
114
+ "variant": "dashed"
115
+ },
116
+ {
117
+ "from": "starting",
118
+ "to": "interceptor",
119
+ "variant": "emphasis",
120
+ "route": "straight",
121
+ "fromSide": "bottom",
122
+ "toSide": "top"
123
+ },
124
+ {
125
+ "from": "active",
126
+ "to": "stopped",
127
+ "variant": "dashed",
128
+ "route": "straight",
129
+ "fromSide": "bottom",
130
+ "toSide": "top"
131
+ }
132
+ ],
133
+ "cards": [
134
+ {
135
+ "dot": "cyan",
136
+ "title": "One command owns both",
137
+ "items": [
138
+ "switch starts the gateway and the interceptor together",
139
+ "switch off stops both and clears the generated files"
140
+ ]
141
+ },
142
+ {
143
+ "dot": "rose",
144
+ "title": "Refuse before writing",
145
+ "items": [
146
+ "Blindfold replaces the base URL override with HTTPS_PROXY",
147
+ "A missing CA stops activation before the first file is written"
148
+ ]
149
+ },
150
+ {
151
+ "dot": "amber",
152
+ "title": "How to recover",
153
+ "items": [
154
+ "Run bash blindfold/make-certs.sh chatgpt.com",
155
+ "Then run switch codex again"
156
+ ]
157
+ }
158
+ ]
159
+ }