@nforma.ai/nforma 0.2.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 (215) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +1024 -0
  3. package/agents/qgsd-codebase-mapper.md +764 -0
  4. package/agents/qgsd-debugger.md +1201 -0
  5. package/agents/qgsd-executor.md +472 -0
  6. package/agents/qgsd-integration-checker.md +443 -0
  7. package/agents/qgsd-phase-researcher.md +502 -0
  8. package/agents/qgsd-plan-checker.md +643 -0
  9. package/agents/qgsd-planner.md +1182 -0
  10. package/agents/qgsd-project-researcher.md +621 -0
  11. package/agents/qgsd-quorum-orchestrator.md +628 -0
  12. package/agents/qgsd-quorum-slot-worker.md +41 -0
  13. package/agents/qgsd-quorum-synthesizer.md +133 -0
  14. package/agents/qgsd-quorum-test-worker.md +37 -0
  15. package/agents/qgsd-quorum-worker.md +161 -0
  16. package/agents/qgsd-research-synthesizer.md +239 -0
  17. package/agents/qgsd-roadmapper.md +660 -0
  18. package/agents/qgsd-verifier.md +628 -0
  19. package/bin/accept-debug-invariant.cjs +165 -0
  20. package/bin/account-manager.cjs +719 -0
  21. package/bin/aggregate-requirements.cjs +466 -0
  22. package/bin/analyze-assumptions.cjs +757 -0
  23. package/bin/analyze-state-space.cjs +921 -0
  24. package/bin/attribute-trace-divergence.cjs +150 -0
  25. package/bin/auth-drivers/gh-cli.cjs +93 -0
  26. package/bin/auth-drivers/index.cjs +46 -0
  27. package/bin/auth-drivers/pool.cjs +67 -0
  28. package/bin/auth-drivers/simple.cjs +95 -0
  29. package/bin/autoClosePtoF.cjs +110 -0
  30. package/bin/blessed-terminal.cjs +350 -0
  31. package/bin/build-phase-index.cjs +472 -0
  32. package/bin/call-quorum-slot.cjs +541 -0
  33. package/bin/ccr-secure-config.cjs +99 -0
  34. package/bin/ccr-secure-start.cjs +83 -0
  35. package/bin/check-bundled-sdks.cjs +177 -0
  36. package/bin/check-coverage-guard.cjs +112 -0
  37. package/bin/check-liveness-fairness.cjs +95 -0
  38. package/bin/check-mcp-health.cjs +123 -0
  39. package/bin/check-provider-health.cjs +395 -0
  40. package/bin/check-results-exit.cjs +24 -0
  41. package/bin/check-spec-sync.cjs +360 -0
  42. package/bin/check-trace-redaction.cjs +271 -0
  43. package/bin/check-trace-schema-drift.cjs +99 -0
  44. package/bin/compareDrift.cjs +21 -0
  45. package/bin/conformance-schema.cjs +12 -0
  46. package/bin/count-scenarios.cjs +420 -0
  47. package/bin/debt-dedup.cjs +144 -0
  48. package/bin/debt-ledger.cjs +61 -0
  49. package/bin/debt-retention.cjs +76 -0
  50. package/bin/debt-state-machine.cjs +80 -0
  51. package/bin/detect-coverage-gaps.cjs +204 -0
  52. package/bin/detect-project-intent.cjs +362 -0
  53. package/bin/export-prism-constants.cjs +164 -0
  54. package/bin/extract-annotations.cjs +633 -0
  55. package/bin/extractFormalExpected.cjs +104 -0
  56. package/bin/fingerprint-drift.cjs +24 -0
  57. package/bin/fingerprint-issue.cjs +46 -0
  58. package/bin/formal-core.cjs +519 -0
  59. package/bin/formal-ref-linker.cjs +141 -0
  60. package/bin/formal-test-sync.cjs +788 -0
  61. package/bin/generate-formal-specs.cjs +588 -0
  62. package/bin/generate-petri-net.cjs +397 -0
  63. package/bin/generate-phase-spec.cjs +249 -0
  64. package/bin/generate-proposed-changes.cjs +194 -0
  65. package/bin/generate-tla-cfg.cjs +122 -0
  66. package/bin/generate-traceability-matrix.cjs +701 -0
  67. package/bin/generate-triage-bundle.cjs +300 -0
  68. package/bin/gh-account-rotate.cjs +34 -0
  69. package/bin/initialize-model-registry.cjs +105 -0
  70. package/bin/install-formal-tools.cjs +382 -0
  71. package/bin/install.js +2424 -0
  72. package/bin/isNumericThreshold.cjs +34 -0
  73. package/bin/issue-classifier.cjs +151 -0
  74. package/bin/levenshtein.cjs +74 -0
  75. package/bin/lint-formal-models.cjs +580 -0
  76. package/bin/load-baseline-requirements.cjs +275 -0
  77. package/bin/manage-agents-core.cjs +815 -0
  78. package/bin/migrate-formal-dir.cjs +172 -0
  79. package/bin/migrate-planning.cjs +206 -0
  80. package/bin/migrate-to-slots.cjs +255 -0
  81. package/bin/nForma.cjs +2726 -0
  82. package/bin/observe-config.cjs +353 -0
  83. package/bin/observe-debt-writer.cjs +140 -0
  84. package/bin/observe-handler-grafana.cjs +128 -0
  85. package/bin/observe-handler-internal.cjs +301 -0
  86. package/bin/observe-handler-logstash.cjs +153 -0
  87. package/bin/observe-handler-prometheus.cjs +185 -0
  88. package/bin/observe-handlers.cjs +436 -0
  89. package/bin/observe-registry.cjs +131 -0
  90. package/bin/observe-render.cjs +168 -0
  91. package/bin/planning-paths.cjs +167 -0
  92. package/bin/polyrepo.cjs +560 -0
  93. package/bin/prism-priority.cjs +153 -0
  94. package/bin/probe-quorum-slots.cjs +167 -0
  95. package/bin/promote-model.cjs +225 -0
  96. package/bin/propose-debug-invariants.cjs +165 -0
  97. package/bin/providers.json +392 -0
  98. package/bin/pty-proxy.py +129 -0
  99. package/bin/qgsd-solve.cjs +2477 -0
  100. package/bin/quorum-consensus-gate.cjs +238 -0
  101. package/bin/quorum-formal-context.cjs +183 -0
  102. package/bin/quorum-slot-dispatch.cjs +934 -0
  103. package/bin/read-policy.cjs +60 -0
  104. package/bin/requirement-map.cjs +63 -0
  105. package/bin/requirements-core.cjs +247 -0
  106. package/bin/resolve-cli.cjs +101 -0
  107. package/bin/review-mcp-logs.cjs +294 -0
  108. package/bin/run-account-manager-tlc.cjs +188 -0
  109. package/bin/run-account-pool-alloy.cjs +158 -0
  110. package/bin/run-alloy.cjs +153 -0
  111. package/bin/run-audit-alloy.cjs +187 -0
  112. package/bin/run-breaker-tlc.cjs +181 -0
  113. package/bin/run-formal-check.cjs +395 -0
  114. package/bin/run-formal-verify.cjs +701 -0
  115. package/bin/run-installer-alloy.cjs +188 -0
  116. package/bin/run-oauth-rotation-prism.cjs +132 -0
  117. package/bin/run-oscillation-tlc.cjs +202 -0
  118. package/bin/run-phase-tlc.cjs +228 -0
  119. package/bin/run-prism.cjs +446 -0
  120. package/bin/run-protocol-tlc.cjs +201 -0
  121. package/bin/run-quorum-composition-alloy.cjs +155 -0
  122. package/bin/run-sensitivity-sweep.cjs +231 -0
  123. package/bin/run-stop-hook-tlc.cjs +188 -0
  124. package/bin/run-tlc.cjs +467 -0
  125. package/bin/run-transcript-alloy.cjs +173 -0
  126. package/bin/run-uppaal.cjs +264 -0
  127. package/bin/secrets.cjs +134 -0
  128. package/bin/sensitivity-report.cjs +219 -0
  129. package/bin/sensitivity-sweep-feedback.cjs +194 -0
  130. package/bin/set-secret.cjs +29 -0
  131. package/bin/setup-telemetry-cron.sh +36 -0
  132. package/bin/sweepPtoF.cjs +63 -0
  133. package/bin/sync-baseline-requirements.cjs +290 -0
  134. package/bin/task-envelope.cjs +360 -0
  135. package/bin/telemetry-collector.cjs +229 -0
  136. package/bin/unified-mcp-server.mjs +735 -0
  137. package/bin/update-agents.cjs +369 -0
  138. package/bin/update-scoreboard.cjs +1134 -0
  139. package/bin/validate-debt-entry.cjs +207 -0
  140. package/bin/validate-invariant.cjs +419 -0
  141. package/bin/validate-memory.cjs +389 -0
  142. package/bin/validate-requirements-haiku.cjs +435 -0
  143. package/bin/validate-traces.cjs +438 -0
  144. package/bin/verify-formal-results.cjs +124 -0
  145. package/bin/verify-quorum-health.cjs +273 -0
  146. package/bin/write-check-result.cjs +106 -0
  147. package/bin/xstate-to-tla.cjs +483 -0
  148. package/bin/xstate-trace-walker.cjs +205 -0
  149. package/commands/qgsd/add-phase.md +43 -0
  150. package/commands/qgsd/add-requirement.md +24 -0
  151. package/commands/qgsd/add-todo.md +47 -0
  152. package/commands/qgsd/audit-milestone.md +37 -0
  153. package/commands/qgsd/check-todos.md +45 -0
  154. package/commands/qgsd/cleanup.md +18 -0
  155. package/commands/qgsd/close-formal-gaps.md +33 -0
  156. package/commands/qgsd/complete-milestone.md +136 -0
  157. package/commands/qgsd/debug.md +166 -0
  158. package/commands/qgsd/discuss-phase.md +83 -0
  159. package/commands/qgsd/execute-phase.md +117 -0
  160. package/commands/qgsd/fix-tests.md +27 -0
  161. package/commands/qgsd/formal-test-sync.md +32 -0
  162. package/commands/qgsd/health.md +22 -0
  163. package/commands/qgsd/help.md +22 -0
  164. package/commands/qgsd/insert-phase.md +32 -0
  165. package/commands/qgsd/join-discord.md +18 -0
  166. package/commands/qgsd/list-phase-assumptions.md +46 -0
  167. package/commands/qgsd/map-codebase.md +71 -0
  168. package/commands/qgsd/map-requirements.md +20 -0
  169. package/commands/qgsd/mcp-restart.md +176 -0
  170. package/commands/qgsd/mcp-set-model.md +134 -0
  171. package/commands/qgsd/mcp-setup.md +1371 -0
  172. package/commands/qgsd/mcp-status.md +274 -0
  173. package/commands/qgsd/mcp-update.md +238 -0
  174. package/commands/qgsd/new-milestone.md +44 -0
  175. package/commands/qgsd/new-project.md +42 -0
  176. package/commands/qgsd/observe.md +260 -0
  177. package/commands/qgsd/pause-work.md +38 -0
  178. package/commands/qgsd/plan-milestone-gaps.md +34 -0
  179. package/commands/qgsd/plan-phase.md +44 -0
  180. package/commands/qgsd/polyrepo.md +50 -0
  181. package/commands/qgsd/progress.md +24 -0
  182. package/commands/qgsd/queue.md +54 -0
  183. package/commands/qgsd/quick.md +133 -0
  184. package/commands/qgsd/quorum-test.md +275 -0
  185. package/commands/qgsd/quorum.md +707 -0
  186. package/commands/qgsd/reapply-patches.md +110 -0
  187. package/commands/qgsd/remove-phase.md +31 -0
  188. package/commands/qgsd/research-phase.md +189 -0
  189. package/commands/qgsd/resume-work.md +40 -0
  190. package/commands/qgsd/set-profile.md +34 -0
  191. package/commands/qgsd/settings.md +39 -0
  192. package/commands/qgsd/solve.md +565 -0
  193. package/commands/qgsd/sync-baselines.md +119 -0
  194. package/commands/qgsd/triage.md +233 -0
  195. package/commands/qgsd/update.md +37 -0
  196. package/commands/qgsd/verify-work.md +38 -0
  197. package/hooks/dist/config-loader.js +297 -0
  198. package/hooks/dist/conformance-schema.cjs +12 -0
  199. package/hooks/dist/gsd-context-monitor.js +64 -0
  200. package/hooks/dist/qgsd-check-update.js +62 -0
  201. package/hooks/dist/qgsd-circuit-breaker.js +682 -0
  202. package/hooks/dist/qgsd-precompact.js +156 -0
  203. package/hooks/dist/qgsd-prompt.js +653 -0
  204. package/hooks/dist/qgsd-session-start.js +122 -0
  205. package/hooks/dist/qgsd-slot-correlator.js +58 -0
  206. package/hooks/dist/qgsd-spec-regen.js +86 -0
  207. package/hooks/dist/qgsd-statusline.js +91 -0
  208. package/hooks/dist/qgsd-stop.js +553 -0
  209. package/hooks/dist/qgsd-token-collector.js +133 -0
  210. package/hooks/dist/unified-mcp-server.mjs +669 -0
  211. package/package.json +95 -0
  212. package/scripts/build-hooks.js +46 -0
  213. package/scripts/postinstall.js +48 -0
  214. package/scripts/secret-audit.sh +45 -0
  215. package/templates/qgsd.json +49 -0
@@ -0,0 +1,392 @@
1
+ {
2
+ "providers": [
3
+ {
4
+ "name": "codex-1",
5
+ "provider": "openai",
6
+ "type": "subprocess",
7
+ "has_file_access": true,
8
+ "description": "Execute Codex CLI agent non-interactively (slot 1)",
9
+ "mainTool": "codex",
10
+ "model": "gpt-5.3-codex",
11
+ "model_detect": {
12
+ "file": "~/.codex/config.toml",
13
+ "pattern": "^model = \"([^\"]+)\""
14
+ },
15
+ "health_check_args": [
16
+ "--version"
17
+ ],
18
+ "display_provider": "OpenAI",
19
+ "cli": "/opt/homebrew/bin/codex",
20
+ "args_template": [
21
+ "exec",
22
+ "{prompt}"
23
+ ],
24
+ "helpArgs": [
25
+ "--help"
26
+ ],
27
+ "extraTools": [
28
+ {
29
+ "name": "review",
30
+ "description": "Run a code review against the current repository using Codex CLI",
31
+ "args_template": [
32
+ "review",
33
+ "{prompt}"
34
+ ]
35
+ }
36
+ ],
37
+ "timeout_ms": 300000,
38
+ "quorum_timeout_ms": 30000,
39
+ "env": {},
40
+ "display_type": "codex-cli"
41
+ },
42
+ {
43
+ "name": "codex-2",
44
+ "provider": "openai",
45
+ "type": "subprocess",
46
+ "has_file_access": true,
47
+ "description": "Execute Codex CLI agent non-interactively (slot 2)",
48
+ "mainTool": "codex",
49
+ "model": "gpt-5.3-codex",
50
+ "model_detect": {
51
+ "file": "~/.codex/config.toml",
52
+ "pattern": "^model = \"([^\"]+)\""
53
+ },
54
+ "health_check_args": [
55
+ "--version"
56
+ ],
57
+ "display_provider": "OpenAI",
58
+ "cli": "/opt/homebrew/bin/codex",
59
+ "args_template": [
60
+ "exec",
61
+ "{prompt}"
62
+ ],
63
+ "helpArgs": [
64
+ "--help"
65
+ ],
66
+ "extraTools": [
67
+ {
68
+ "name": "review",
69
+ "description": "Run a code review against the current repository using Codex CLI",
70
+ "args_template": [
71
+ "review",
72
+ "{prompt}"
73
+ ]
74
+ }
75
+ ],
76
+ "timeout_ms": 300000,
77
+ "quorum_timeout_ms": 30000,
78
+ "env": {}
79
+ },
80
+ {
81
+ "name": "gemini-1",
82
+ "provider": "google",
83
+ "type": "subprocess",
84
+ "has_file_access": true,
85
+ "description": "Query Gemini CLI agent non-interactively (slot 1)",
86
+ "mainTool": "gemini",
87
+ "model": "gemini-3-pro-preview",
88
+ "health_check_args": [
89
+ "--version"
90
+ ],
91
+ "display_provider": "Google",
92
+ "cli": "/opt/homebrew/bin/gemini",
93
+ "args_template": [
94
+ "-m",
95
+ "gemini-3-pro-preview",
96
+ "-p",
97
+ "{prompt}"
98
+ ],
99
+ "helpArgs": [
100
+ "--help"
101
+ ],
102
+ "extraTools": [],
103
+ "timeout_ms": 300000,
104
+ "quorum_timeout_ms": 30000,
105
+ "env": {},
106
+ "display_type": "gemini-cli"
107
+ },
108
+ {
109
+ "name": "gemini-2",
110
+ "provider": "google",
111
+ "type": "subprocess",
112
+ "has_file_access": true,
113
+ "description": "Query Gemini CLI agent non-interactively (slot 2)",
114
+ "mainTool": "gemini",
115
+ "model": "gemini-3-pro-preview",
116
+ "health_check_args": [
117
+ "--version"
118
+ ],
119
+ "display_provider": "Google",
120
+ "cli": "/opt/homebrew/bin/gemini",
121
+ "args_template": [
122
+ "-m",
123
+ "gemini-3-pro-preview",
124
+ "-p",
125
+ "{prompt}"
126
+ ],
127
+ "helpArgs": [
128
+ "--help"
129
+ ],
130
+ "extraTools": [],
131
+ "timeout_ms": 300000,
132
+ "quorum_timeout_ms": 30000,
133
+ "env": {}
134
+ },
135
+ {
136
+ "name": "opencode-1",
137
+ "provider": "xai",
138
+ "type": "subprocess",
139
+ "has_file_access": true,
140
+ "description": "Run OpenCode agent non-interactively with a message",
141
+ "mainTool": "opencode",
142
+ "model": "grok-code-fast-1",
143
+ "model_detect": {
144
+ "file": "~/.local/state/opencode/model.json",
145
+ "pattern": "\"recent\":\\[{\"providerID\":\"[^\"]*\",\"modelID\":\"([^\"]+)\""
146
+ },
147
+ "health_check_args": [
148
+ "--version"
149
+ ],
150
+ "display_provider": "OpenCode",
151
+ "cli": "/opt/homebrew/bin/opencode",
152
+ "args_template": [
153
+ "run",
154
+ "{prompt}"
155
+ ],
156
+ "helpArgs": [
157
+ "--help"
158
+ ],
159
+ "extraTools": [
160
+ {
161
+ "name": "opencode_check_update",
162
+ "description": "Check whether a newer version of OpenCode is available on npm. Returns current version, latest version, and whether an update is available.",
163
+ "checkUpdate": true
164
+ }
165
+ ],
166
+ "timeout_ms": 300000,
167
+ "quorum_timeout_ms": 30000,
168
+ "env": {},
169
+ "display_type": "opencode-cli"
170
+ },
171
+ {
172
+ "name": "copilot-1",
173
+ "provider": "github",
174
+ "type": "subprocess",
175
+ "has_file_access": true,
176
+ "description": "Execute GitHub Copilot CLI non-interactively",
177
+ "mainTool": "ask",
178
+ "model": "gpt-4.1",
179
+ "health_check_args": [
180
+ "--version"
181
+ ],
182
+ "display_provider": "GitHub",
183
+ "cli": "/opt/homebrew/bin/copilot",
184
+ "args_template": [
185
+ "-p",
186
+ "{prompt}",
187
+ "--allow-all-tools",
188
+ "--no-color",
189
+ "-s"
190
+ ],
191
+ "helpArgs": [
192
+ "--help"
193
+ ],
194
+ "extraTools": [
195
+ {
196
+ "name": "suggest",
197
+ "description": "Ask GitHub Copilot to suggest a shell, git, or gh CLI command for a given task.",
198
+ "args_template": [
199
+ "-p",
200
+ "Suggest a shell command for the following task: {prompt}",
201
+ "--allow-all-tools",
202
+ "--no-color",
203
+ "-s"
204
+ ]
205
+ },
206
+ {
207
+ "name": "explain",
208
+ "description": "Ask GitHub Copilot to explain what a shell command does in plain language.",
209
+ "args_template": [
210
+ "-p",
211
+ "Explain what the following shell command does: {prompt}",
212
+ "--allow-all-tools",
213
+ "--no-color",
214
+ "-s"
215
+ ]
216
+ }
217
+ ],
218
+ "timeout_ms": 300000,
219
+ "quorum_timeout_ms": 30000,
220
+ "env": {},
221
+ "display_type": "copilot-cli"
222
+ },
223
+ {
224
+ "name": "claude-1",
225
+ "provider": "akashml",
226
+ "type": "subprocess",
227
+ "has_file_access": true,
228
+ "description": "DeepSeek-V3.2 via AkashML — real Claude Code CLI via ccr",
229
+ "mainTool": "claude",
230
+ "model": "deepseek-ai/DeepSeek-V3.2",
231
+ "display_provider": "AkashML",
232
+ "cli": "/opt/homebrew/bin/ccr",
233
+ "args_template": [
234
+ "claude-1",
235
+ "-p",
236
+ "{prompt}",
237
+ "--dangerously-skip-permissions"
238
+ ],
239
+ "health_check_args": [
240
+ "-v"
241
+ ],
242
+ "helpArgs": [
243
+ "--help"
244
+ ],
245
+ "extraTools": [],
246
+ "timeout_ms": 300000,
247
+ "quorum_timeout_ms": 20000,
248
+ "env": {},
249
+ "display_type": "claude-code-router"
250
+ },
251
+ {
252
+ "name": "claude-2",
253
+ "provider": "akashml",
254
+ "type": "subprocess",
255
+ "has_file_access": true,
256
+ "description": "MiniMax-M2.5 via AkashML — real Claude Code CLI via ccr",
257
+ "mainTool": "claude",
258
+ "model": "MiniMaxAI/MiniMax-M2.5",
259
+ "display_provider": "AkashML",
260
+ "cli": "/opt/homebrew/bin/ccr",
261
+ "args_template": [
262
+ "claude-2",
263
+ "-p",
264
+ "{prompt}",
265
+ "--dangerously-skip-permissions"
266
+ ],
267
+ "health_check_args": [
268
+ "-v"
269
+ ],
270
+ "helpArgs": [
271
+ "--help"
272
+ ],
273
+ "extraTools": [],
274
+ "timeout_ms": 300000,
275
+ "quorum_timeout_ms": 20000,
276
+ "env": {},
277
+ "display_type": "claude-code-router"
278
+ },
279
+ {
280
+ "name": "claude-3",
281
+ "provider": "together-xyz",
282
+ "type": "subprocess",
283
+ "has_file_access": true,
284
+ "description": "Qwen3-Coder-480B via Together.xyz — real Claude Code CLI via ccr",
285
+ "mainTool": "claude",
286
+ "model": "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8",
287
+ "display_provider": "Together.xyz",
288
+ "cli": "/opt/homebrew/bin/ccr",
289
+ "args_template": [
290
+ "claude-3",
291
+ "-p",
292
+ "{prompt}",
293
+ "--dangerously-skip-permissions"
294
+ ],
295
+ "health_check_args": [
296
+ "-v"
297
+ ],
298
+ "helpArgs": [
299
+ "--help"
300
+ ],
301
+ "extraTools": [],
302
+ "timeout_ms": 300000,
303
+ "quorum_timeout_ms": 30000,
304
+ "env": {},
305
+ "display_type": "claude-code-router"
306
+ },
307
+ {
308
+ "name": "claude-4",
309
+ "provider": "fireworks",
310
+ "type": "subprocess",
311
+ "has_file_access": true,
312
+ "description": "Kimi-K2 via Fireworks — real Claude Code CLI via ccr",
313
+ "mainTool": "claude",
314
+ "model": "accounts/fireworks/models/kimi-k2p5",
315
+ "display_provider": "Fireworks",
316
+ "cli": "/opt/homebrew/bin/ccr",
317
+ "args_template": [
318
+ "claude-4",
319
+ "-p",
320
+ "{prompt}",
321
+ "--dangerously-skip-permissions"
322
+ ],
323
+ "health_check_args": [
324
+ "-v"
325
+ ],
326
+ "helpArgs": [
327
+ "--help"
328
+ ],
329
+ "extraTools": [],
330
+ "timeout_ms": 300000,
331
+ "quorum_timeout_ms": 30000,
332
+ "env": {},
333
+ "display_type": "claude-code-router"
334
+ },
335
+ {
336
+ "name": "claude-5",
337
+ "provider": "together-xyz",
338
+ "type": "subprocess",
339
+ "has_file_access": true,
340
+ "description": "Llama-4-Maverick-17B via Together.xyz — real Claude Code CLI via ccr",
341
+ "mainTool": "claude",
342
+ "model": "meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",
343
+ "display_provider": "Together.xyz",
344
+ "cli": "/opt/homebrew/bin/ccr",
345
+ "args_template": [
346
+ "claude-5",
347
+ "-p",
348
+ "{prompt}",
349
+ "--dangerously-skip-permissions"
350
+ ],
351
+ "health_check_args": [
352
+ "-v"
353
+ ],
354
+ "helpArgs": [
355
+ "--help"
356
+ ],
357
+ "extraTools": [],
358
+ "timeout_ms": 300000,
359
+ "quorum_timeout_ms": 10000,
360
+ "env": {},
361
+ "display_type": "claude-code-router"
362
+ },
363
+ {
364
+ "name": "claude-6",
365
+ "provider": "fireworks",
366
+ "type": "subprocess",
367
+ "has_file_access": true,
368
+ "description": "GLM-5 via Fireworks — real Claude Code CLI via ccr",
369
+ "mainTool": "claude",
370
+ "model": "accounts/fireworks/models/glm-5",
371
+ "display_provider": "Fireworks",
372
+ "cli": "/opt/homebrew/bin/ccr",
373
+ "args_template": [
374
+ "claude-6",
375
+ "-p",
376
+ "{prompt}",
377
+ "--dangerously-skip-permissions"
378
+ ],
379
+ "health_check_args": [
380
+ "-v"
381
+ ],
382
+ "helpArgs": [
383
+ "--help"
384
+ ],
385
+ "extraTools": [],
386
+ "timeout_ms": 300000,
387
+ "quorum_timeout_ms": 8000,
388
+ "env": {},
389
+ "display_type": "claude-code-router"
390
+ }
391
+ ]
392
+ }
@@ -0,0 +1,129 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ pty-proxy.py — zero-dependency PTY allocator for nForma's embedded terminal.
4
+
5
+ Spawns a command inside a real pseudo-terminal so interactive CLIs (like claude)
6
+ see isTTY=true on stdin/stdout/stderr. Proxies data between the parent's piped
7
+ stdio and the PTY master fd.
8
+
9
+ Usage: python3 pty-proxy.py <cols> <rows> <command> [args...]
10
+
11
+ Works on macOS and Linux without any native Node.js addons.
12
+ """
13
+
14
+ import pty, os, sys, select, signal, struct, fcntl, termios, errno
15
+
16
+ def set_winsize(fd, rows, cols):
17
+ """Set the terminal window size on a PTY fd."""
18
+ try:
19
+ winsize = struct.pack('HHHH', rows, cols, 0, 0)
20
+ fcntl.ioctl(fd, termios.TIOCSWINSZ, winsize)
21
+ except Exception:
22
+ pass
23
+
24
+ def main():
25
+ if len(sys.argv) < 4:
26
+ sys.stderr.write('Usage: pty-proxy.py <cols> <rows> <command> [args...]\n')
27
+ sys.exit(1)
28
+
29
+ cols = int(sys.argv[1])
30
+ rows = int(sys.argv[2])
31
+ cmd = sys.argv[3]
32
+ args = sys.argv[3:] # argv[0] for the child = cmd
33
+
34
+ # Create PTY pair
35
+ master_fd, slave_fd = pty.openpty()
36
+ set_winsize(master_fd, rows, cols)
37
+
38
+ pid = os.fork()
39
+ if pid == 0:
40
+ # ── Child process ──
41
+ os.close(master_fd)
42
+ os.setsid()
43
+
44
+ # Set slave as controlling terminal
45
+ fcntl.ioctl(slave_fd, termios.TIOCSCTTY, 0)
46
+
47
+ # Redirect stdio to slave PTY
48
+ os.dup2(slave_fd, 0)
49
+ os.dup2(slave_fd, 1)
50
+ os.dup2(slave_fd, 2)
51
+ if slave_fd > 2:
52
+ os.close(slave_fd)
53
+
54
+ os.execvp(cmd, args)
55
+ # If exec fails
56
+ os._exit(127)
57
+ else:
58
+ # ── Parent process ──
59
+ os.close(slave_fd)
60
+
61
+ # Forward SIGWINCH to child (nForma sends this on resize)
62
+ def on_winch(signum, frame):
63
+ try:
64
+ os.kill(pid, signal.SIGWINCH)
65
+ except Exception:
66
+ pass
67
+ signal.signal(signal.SIGWINCH, on_winch)
68
+
69
+ # Make stdin non-blocking
70
+ stdin_fd = sys.stdin.fileno()
71
+ stdout_fd = sys.stdout.fileno()
72
+
73
+ # Set stdin to non-blocking
74
+ old_flags = fcntl.fcntl(stdin_fd, fcntl.F_GETFL)
75
+ fcntl.fcntl(stdin_fd, fcntl.F_SETFL, old_flags | os.O_NONBLOCK)
76
+
77
+ # Proxy loop: stdin → master, master → stdout
78
+ try:
79
+ while True:
80
+ try:
81
+ rfds, _, _ = select.select([stdin_fd, master_fd], [], [], 0.1)
82
+ except select.error:
83
+ break
84
+
85
+ if stdin_fd in rfds:
86
+ try:
87
+ data = os.read(stdin_fd, 4096)
88
+ if not data:
89
+ # stdin closed — send EOF to child
90
+ os.close(master_fd)
91
+ break
92
+ os.write(master_fd, data)
93
+ except OSError as e:
94
+ if e.errno not in (errno.EAGAIN, errno.EWOULDBLOCK):
95
+ break
96
+
97
+ if master_fd in rfds:
98
+ try:
99
+ data = os.read(master_fd, 4096)
100
+ if not data:
101
+ break
102
+ os.write(stdout_fd, data)
103
+ sys.stdout.flush()
104
+ except OSError as e:
105
+ if e.errno == errno.EIO:
106
+ # Child exited — PTY closed
107
+ break
108
+ if e.errno not in (errno.EAGAIN, errno.EWOULDBLOCK):
109
+ break
110
+ except KeyboardInterrupt:
111
+ pass
112
+ finally:
113
+ # Restore stdin flags
114
+ try:
115
+ fcntl.fcntl(stdin_fd, fcntl.F_SETFL, old_flags)
116
+ except Exception:
117
+ pass
118
+
119
+ # Wait for child and exit with its status
120
+ try:
121
+ _, status = os.waitpid(pid, 0)
122
+ if os.WIFEXITED(status):
123
+ sys.exit(os.WEXITSTATUS(status))
124
+ sys.exit(1)
125
+ except ChildProcessError:
126
+ sys.exit(0)
127
+
128
+ if __name__ == '__main__':
129
+ main()