@heretek-ai/epistemic-swarm 0.7.24 → 1.0.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 (350) hide show
  1. package/index.ts +1 -0
  2. package/package.json +63 -139
  3. package/rpc.ts +1 -0
  4. package/server.ts +1 -0
  5. package/src/agents.ts +69 -0
  6. package/src/continue.ts +40 -0
  7. package/src/hooks.ts +283 -0
  8. package/src/panels.tsx +220 -0
  9. package/src/policy.ts +221 -0
  10. package/src/pr.ts +37 -0
  11. package/src/research.ts +63 -0
  12. package/src/rpc-def.ts +136 -0
  13. package/src/rpc.ts +331 -0
  14. package/src/runtime.ts +112 -0
  15. package/src/server.ts +311 -0
  16. package/src/session.ts +61 -0
  17. package/src/tools.ts +61 -0
  18. package/src/tui.tsx +206 -0
  19. package/tui.tsx +1 -0
  20. package/.agents/skills/brainstorming/SKILL.md +0 -19
  21. package/.agents/skills/code_audit/SKILL.md +0 -19
  22. package/.agents/skills/darkharvest/SKILL.md +0 -19
  23. package/.agents/skills/epistemic_search/SKILL.md +0 -19
  24. package/.agents/skills/factory/SKILL.md +0 -19
  25. package/.agents/skills/grilling/SKILL.md +0 -19
  26. package/.agents/skills/oss_scout/SKILL.md +0 -19
  27. package/.agents/skills/research_cache/SKILL.md +0 -19
  28. package/.agents/skills/swarm_config/SKILL.md +0 -19
  29. package/.claude-plugin/marketplace.json +0 -61
  30. package/.claude-plugin/plugin.json +0 -76
  31. package/.omp/README.md +0 -39
  32. package/.omp/SYSTEM.md +0 -17
  33. package/.omp/commands/audit.md +0 -10
  34. package/.omp/commands/brainstorming.md +0 -12
  35. package/.omp/commands/darkharvest.md +0 -11
  36. package/.omp/commands/domainexpansion.md +0 -9
  37. package/.omp/commands/factory.md +0 -9
  38. package/.omp/commands/grill.md +0 -9
  39. package/.omp/commands/scout.md +0 -10
  40. package/.omp/commands/swarm-config.md +0 -10
  41. package/.omp/commands/swarm.md +0 -9
  42. package/.omp/hooks/post/epistemic-audit.ts +0 -16
  43. package/.omp/hooks/pre/epistemic-redirect.ts +0 -21
  44. package/.omp/prompts/brainstorming.md +0 -8
  45. package/.omp/prompts/swarm.md +0 -8
  46. package/LICENSE +0 -126
  47. package/MARKETPLACE.md +0 -130
  48. package/README.md +0 -403
  49. package/bin/cli.js +0 -297
  50. package/config/claude-settings-patch.json +0 -10
  51. package/config/docker-compose.infra.yml +0 -23
  52. package/config/domain_packs/biopharma.json +0 -23
  53. package/config/domain_packs/legal.json +0 -19
  54. package/config/domain_packs/quant.json +0 -19
  55. package/config/mcp-research-servers.json +0 -33
  56. package/config/mcp_launcher.py +0 -153
  57. package/config/opencode-snippet.json +0 -156
  58. package/config/searxng_mcp.py +0 -92
  59. package/extensions/pi/index.js +0 -357
  60. package/hooks/hooks.json +0 -45
  61. package/install.sh +0 -473
  62. package/plugins/antigravity/README.md +0 -72
  63. package/plugins/antigravity/agents/alpha-thesis.md +0 -36
  64. package/plugins/antigravity/agents/beta-antithesis.md +0 -35
  65. package/plugins/antigravity/agents/brainstormer.md +0 -27
  66. package/plugins/antigravity/agents/code-auditor.md +0 -28
  67. package/plugins/antigravity/agents/darkharvester.md +0 -30
  68. package/plugins/antigravity/agents/epistemic-auditor.md +0 -28
  69. package/plugins/antigravity/agents/manager.md +0 -26
  70. package/plugins/antigravity/agents/oss-scout.md +0 -27
  71. package/plugins/antigravity/agents/programmer.md +0 -25
  72. package/plugins/antigravity/agents/qa-a.md +0 -22
  73. package/plugins/antigravity/agents/qa-b.md +0 -22
  74. package/plugins/antigravity/antigravity_hooks.py +0 -265
  75. package/plugins/antigravity/commands/audit.md +0 -11
  76. package/plugins/antigravity/commands/brainstorm.md +0 -9
  77. package/plugins/antigravity/commands/brainstorming.md +0 -10
  78. package/plugins/antigravity/commands/darkharvest.md +0 -12
  79. package/plugins/antigravity/commands/domainexpansion.md +0 -12
  80. package/plugins/antigravity/commands/factory.md +0 -14
  81. package/plugins/antigravity/commands/grill.md +0 -10
  82. package/plugins/antigravity/commands/scout.md +0 -11
  83. package/plugins/antigravity/commands/swarm-config.md +0 -9
  84. package/plugins/antigravity/commands/swarm.md +0 -12
  85. package/plugins/antigravity/hook_bus_bridge.js +0 -352
  86. package/plugins/antigravity/hooks.json +0 -44
  87. package/plugins/antigravity/mcp_config.json +0 -33
  88. package/plugins/antigravity/mcp_launcher.py +0 -58
  89. package/plugins/antigravity/plugin.json +0 -13
  90. package/plugins/antigravity/rules/AGENTS.md +0 -127
  91. package/plugins/antigravity/rules/epistemic-integrity.md +0 -16
  92. package/plugins/antigravity/skills/brainstorming/SKILL.md +0 -19
  93. package/plugins/antigravity/skills/code_audit/SKILL.md +0 -19
  94. package/plugins/antigravity/skills/darkharvest/SKILL.md +0 -19
  95. package/plugins/antigravity/skills/epistemic_search/SKILL.md +0 -19
  96. package/plugins/antigravity/skills/factory/SKILL.md +0 -19
  97. package/plugins/antigravity/skills/grilling/SKILL.md +0 -19
  98. package/plugins/antigravity/skills/oss_scout/SKILL.md +0 -19
  99. package/plugins/antigravity/skills/research_cache/SKILL.md +0 -19
  100. package/plugins/antigravity/skills/swarm_config/SKILL.md +0 -19
  101. package/plugins/codex/AGENTS.md.snippet +0 -10
  102. package/plugins/codex/README.md +0 -37
  103. package/plugins/codex/config.toml.snippet +0 -28
  104. package/plugins/codex/openai.yaml +0 -24
  105. package/plugins/codex/skills/brainstorming/SKILL.md +0 -19
  106. package/plugins/codex/skills/code_audit/SKILL.md +0 -19
  107. package/plugins/codex/skills/darkharvest/SKILL.md +0 -19
  108. package/plugins/codex/skills/epistemic_search/SKILL.md +0 -19
  109. package/plugins/codex/skills/factory/SKILL.md +0 -19
  110. package/plugins/codex/skills/grilling/SKILL.md +0 -19
  111. package/plugins/codex/skills/oss_scout/SKILL.md +0 -19
  112. package/plugins/codex/skills/research_cache/SKILL.md +0 -19
  113. package/plugins/codex/skills/swarm_config/SKILL.md +0 -19
  114. package/plugins/darkharvest/.claude-plugin/plugin.json +0 -15
  115. package/plugins/darkharvest/agents/harvest-proponent.md +0 -22
  116. package/plugins/darkharvest/agents/harvest-redteam.md +0 -20
  117. package/plugins/darkharvest/evals/teardown-verdict/graders/license-line.md +0 -6
  118. package/plugins/darkharvest/evals/teardown-verdict/graders/skill-fired.md +0 -5
  119. package/plugins/darkharvest/evals/teardown-verdict/prompt.md +0 -6
  120. package/plugins/darkharvest/skills/darkharvest/SKILL.md +0 -70
  121. package/plugins/darkharvest/skills/darkharvest/scripts/harvest.py +0 -289
  122. package/plugins/factory/.claude-plugin/plugin.json +0 -15
  123. package/plugins/factory/agents/factory-manager.md +0 -22
  124. package/plugins/factory/agents/programmer.md +0 -16
  125. package/plugins/factory/agents/qa-adversarial.md +0 -17
  126. package/plugins/factory/agents/qa-functional.md +0 -17
  127. package/plugins/factory/evals/gate-halt/graders/gates-first.md +0 -6
  128. package/plugins/factory/evals/gate-halt/graders/skill-fired.md +0 -5
  129. package/plugins/factory/evals/gate-halt/prompt.md +0 -6
  130. package/plugins/factory/skills/factory/SKILL.md +0 -61
  131. package/plugins/factory/skills/factory/scripts/factory.py +0 -300
  132. package/plugins/gemini/GEMINI.md +0 -16
  133. package/plugins/gemini/README.md +0 -20
  134. package/plugins/gemini/commands/audit.toml +0 -6
  135. package/plugins/gemini/commands/brainstorming.toml +0 -10
  136. package/plugins/gemini/commands/darkharvest.toml +0 -8
  137. package/plugins/gemini/commands/domainexpansion.toml +0 -7
  138. package/plugins/gemini/commands/factory.toml +0 -8
  139. package/plugins/gemini/commands/grill.toml +0 -6
  140. package/plugins/gemini/commands/scout.toml +0 -7
  141. package/plugins/gemini/commands/swarm-config.toml +0 -7
  142. package/plugins/gemini/commands/swarm.toml +0 -8
  143. package/plugins/gemini/gemini-extension.json +0 -38
  144. package/plugins/gemini/hooks/hooks.json +0 -11
  145. package/plugins/gemini/skills/brainstorming/SKILL.md +0 -19
  146. package/plugins/gemini/skills/code_audit/SKILL.md +0 -19
  147. package/plugins/gemini/skills/darkharvest/SKILL.md +0 -19
  148. package/plugins/gemini/skills/epistemic_search/SKILL.md +0 -19
  149. package/plugins/gemini/skills/factory/SKILL.md +0 -19
  150. package/plugins/gemini/skills/grilling/SKILL.md +0 -19
  151. package/plugins/gemini/skills/oss_scout/SKILL.md +0 -19
  152. package/plugins/gemini/skills/research_cache/SKILL.md +0 -19
  153. package/plugins/gemini/skills/swarm_config/SKILL.md +0 -19
  154. package/plugins/opencode/analysis-bridge.js +0 -620
  155. package/plugins/opencode/config-io.js +0 -1651
  156. package/plugins/opencode/dep-health.js +0 -1039
  157. package/plugins/opencode/hook-bus.js +0 -496
  158. package/plugins/opencode/index.js +0 -2992
  159. package/plugins/opencode/tui.js +0 -1551
  160. package/plugins/opencode/weight-baseline.json +0 -16
  161. package/plugins/opencode/weight-signals.js +0 -769
  162. package/plugins/research-cache/.claude-plugin/plugin.json +0 -15
  163. package/plugins/research-cache/skills/research_cache/SKILL.md +0 -36
  164. package/plugins/research-cache/skills/research_cache/__init__.py +0 -0
  165. package/plugins/research-cache/skills/research_cache/hasher.py +0 -302
  166. package/plugins/socratic-grilling/.claude-plugin/plugin.json +0 -15
  167. package/plugins/socratic-grilling/skills/grilling/SKILL.md +0 -61
  168. package/plugins/socratic-grilling/skills/grilling/__init__.py +0 -0
  169. package/plugins/socratic-grilling/skills/grilling/socratic_tree.py +0 -363
  170. package/prompts/agent_alpha_thesis.md +0 -70
  171. package/prompts/agent_beta_antithesis.md +0 -78
  172. package/prompts/agent_brainstormer.md +0 -143
  173. package/prompts/agent_code_auditor.md +0 -88
  174. package/prompts/agent_darkharvest.md +0 -140
  175. package/prompts/agent_oss_scout.md +0 -78
  176. package/prompts/antigravity_repo_factcheck.md +0 -143
  177. package/prompts/base_epistemic_system.md +0 -50
  178. package/prompts/epistemic_auditor.md +0 -74
  179. package/prompts/orchestrator.md +0 -70
  180. package/runner/__init__.py +0 -0
  181. package/runner/__pycache__/__init__.cpython-311.pyc +0 -0
  182. package/runner/__pycache__/auctioneer.cpython-311.pyc +0 -0
  183. package/runner/__pycache__/auditor_engine.cpython-311.pyc +0 -0
  184. package/runner/__pycache__/claim_store.cpython-311.pyc +0 -0
  185. package/runner/__pycache__/claim_witness.cpython-311.pyc +0 -0
  186. package/runner/__pycache__/darkharvest_claims.cpython-311.pyc +0 -0
  187. package/runner/__pycache__/errors.cpython-311.pyc +0 -0
  188. package/runner/__pycache__/living_dossiers.cpython-311.pyc +0 -0
  189. package/runner/__pycache__/mcp_protocol.cpython-311.pyc +0 -0
  190. package/runner/__pycache__/mcp_server.cpython-311.pyc +0 -0
  191. package/runner/__pycache__/path_safety.cpython-311.pyc +0 -0
  192. package/runner/__pycache__/pcrb.cpython-311.pyc +0 -0
  193. package/runner/__pycache__/pcrb_verify.cpython-311.pyc +0 -0
  194. package/runner/__pycache__/preflight.cpython-311.pyc +0 -0
  195. package/runner/__pycache__/refinement.cpython-311.pyc +0 -0
  196. package/runner/__pycache__/research_swarm.cpython-311.pyc +0 -0
  197. package/runner/__pycache__/retrieval_log.cpython-311.pyc +0 -0
  198. package/runner/__pycache__/schema_validate.cpython-311.pyc +0 -0
  199. package/runner/__pycache__/schemas.cpython-311.pyc +0 -0
  200. package/runner/__pycache__/state_machine.cpython-311.pyc +0 -0
  201. package/runner/antigravity_hooks.py +0 -265
  202. package/runner/auctioneer.py +0 -169
  203. package/runner/auditor_engine.py +0 -711
  204. package/runner/claim_store.py +0 -417
  205. package/runner/claim_witness.py +0 -412
  206. package/runner/darkharvest_claims.py +0 -358
  207. package/runner/errors.py +0 -51
  208. package/runner/living_dossiers.py +0 -395
  209. package/runner/mcp_protocol.py +0 -188
  210. package/runner/mcp_server.py +0 -1447
  211. package/runner/path_safety.py +0 -62
  212. package/runner/pcrb.py +0 -290
  213. package/runner/pcrb_verify.py +0 -267
  214. package/runner/preflight.py +0 -1011
  215. package/runner/refinement.py +0 -580
  216. package/runner/research_swarm.py +0 -1848
  217. package/runner/retrieval_log.py +0 -90
  218. package/runner/schema_validate.py +0 -193
  219. package/runner/schemas.py +0 -630
  220. package/runner/state_machine.py +0 -463
  221. package/runner/tests/__pycache__/test_analysis_bridge.cpython-311.pyc +0 -0
  222. package/runner/tests/__pycache__/test_antigravity_plugin.cpython-311.pyc +0 -0
  223. package/runner/tests/__pycache__/test_auction_order.cpython-311.pyc +0 -0
  224. package/runner/tests/__pycache__/test_backends.cpython-311.pyc +0 -0
  225. package/runner/tests/__pycache__/test_bet1_spike.cpython-311.pyc +0 -0
  226. package/runner/tests/__pycache__/test_claim_store.cpython-311.pyc +0 -0
  227. package/runner/tests/__pycache__/test_claim_witness.cpython-311.pyc +0 -0
  228. package/runner/tests/__pycache__/test_claude_plugin.cpython-311.pyc +0 -0
  229. package/runner/tests/__pycache__/test_config_schema.cpython-311.pyc +0 -0
  230. package/runner/tests/__pycache__/test_contract_tooling.cpython-311.pyc +0 -0
  231. package/runner/tests/__pycache__/test_darkharvest_audit.cpython-311.pyc +0 -0
  232. package/runner/tests/__pycache__/test_dep_health.cpython-311.pyc +0 -0
  233. package/runner/tests/__pycache__/test_domain_packs.cpython-311.pyc +0 -0
  234. package/runner/tests/__pycache__/test_dossier_contract.cpython-311.pyc +0 -0
  235. package/runner/tests/__pycache__/test_factory.cpython-311.pyc +0 -0
  236. package/runner/tests/__pycache__/test_fleet_seam.cpython-311.pyc +0 -0
  237. package/runner/tests/__pycache__/test_frontier_concurrency.cpython-311.pyc +0 -0
  238. package/runner/tests/__pycache__/test_frontier_mirror_standalone.cpython-311.pyc +0 -0
  239. package/runner/tests/__pycache__/test_grounding.cpython-311.pyc +0 -0
  240. package/runner/tests/__pycache__/test_hardening_contract.cpython-311.pyc +0 -0
  241. package/runner/tests/__pycache__/test_hook_bus.cpython-311.pyc +0 -0
  242. package/runner/tests/__pycache__/test_living_dossiers.cpython-311.pyc +0 -0
  243. package/runner/tests/__pycache__/test_manifest_concurrency.cpython-311.pyc +0 -0
  244. package/runner/tests/__pycache__/test_mcp_server.cpython-311.pyc +0 -0
  245. package/runner/tests/__pycache__/test_nk_hardening.cpython-311.pyc +0 -0
  246. package/runner/tests/__pycache__/test_opencode_ux.cpython-311.pyc +0 -0
  247. package/runner/tests/__pycache__/test_opencode_v2_registrars.cpython-311.pyc +0 -0
  248. package/runner/tests/__pycache__/test_pcrb.cpython-311.pyc +0 -0
  249. package/runner/tests/__pycache__/test_phase08_waiver_reopens.cpython-311.pyc +0 -0
  250. package/runner/tests/__pycache__/test_refinement.cpython-311.pyc +0 -0
  251. package/runner/tests/__pycache__/test_search_anomaly.cpython-311.pyc +0 -0
  252. package/runner/tests/__pycache__/test_search_provider.cpython-311.pyc +0 -0
  253. package/runner/tests/__pycache__/test_search_provider_plugin.cpython-311.pyc +0 -0
  254. package/runner/tests/__pycache__/test_swarm.cpython-311.pyc +0 -0
  255. package/runner/tests/__pycache__/test_swarm_config.cpython-311.pyc +0 -0
  256. package/runner/tests/__pycache__/test_sweep_regressions.cpython-311.pyc +0 -0
  257. package/runner/tests/__pycache__/test_webcache.cpython-311.pyc +0 -0
  258. package/runner/tests/__pycache__/test_weight_signals.cpython-311.pyc +0 -0
  259. package/runner/tests/fixtures/auction_objective.json +0 -35
  260. package/runner/tests/fixtures/borderline_claims.json +0 -27
  261. package/runner/tests/fixtures/config_validation_cases.json +0 -276
  262. package/runner/tests/fixtures/ddg_anomaly_page.html +0 -176
  263. package/runner/tests/fixtures/ddg_results_page.html +0 -28
  264. package/runner/tests/fixtures/divergence_objectives.json +0 -31
  265. package/runner/tests/test_analysis_bridge.py +0 -450
  266. package/runner/tests/test_antigravity_plugin.py +0 -361
  267. package/runner/tests/test_auction_order.py +0 -173
  268. package/runner/tests/test_backends.py +0 -457
  269. package/runner/tests/test_bet1_spike.py +0 -95
  270. package/runner/tests/test_claim_store.py +0 -162
  271. package/runner/tests/test_claim_witness.py +0 -186
  272. package/runner/tests/test_claude_plugin.py +0 -170
  273. package/runner/tests/test_config_schema.py +0 -879
  274. package/runner/tests/test_contract_tooling.py +0 -312
  275. package/runner/tests/test_darkharvest_audit.py +0 -395
  276. package/runner/tests/test_dep_health.py +0 -595
  277. package/runner/tests/test_domain_packs.py +0 -217
  278. package/runner/tests/test_dossier_contract.py +0 -196
  279. package/runner/tests/test_factory.py +0 -258
  280. package/runner/tests/test_fleet_seam.py +0 -113
  281. package/runner/tests/test_frontier_concurrency.py +0 -288
  282. package/runner/tests/test_frontier_mirror_standalone.py +0 -156
  283. package/runner/tests/test_grounding.py +0 -183
  284. package/runner/tests/test_hardening_contract.py +0 -391
  285. package/runner/tests/test_hook_bus.py +0 -956
  286. package/runner/tests/test_living_dossiers.py +0 -204
  287. package/runner/tests/test_manifest_concurrency.py +0 -187
  288. package/runner/tests/test_mcp_server.py +0 -257
  289. package/runner/tests/test_nk_hardening.py +0 -1046
  290. package/runner/tests/test_opencode_ux.py +0 -2438
  291. package/runner/tests/test_opencode_v2_registrars.py +0 -2157
  292. package/runner/tests/test_pcrb.py +0 -240
  293. package/runner/tests/test_phase08_waiver_reopens.py +0 -539
  294. package/runner/tests/test_refinement.py +0 -255
  295. package/runner/tests/test_search_anomaly.py +0 -342
  296. package/runner/tests/test_search_provider.py +0 -1534
  297. package/runner/tests/test_search_provider_plugin.py +0 -401
  298. package/runner/tests/test_swarm.py +0 -444
  299. package/runner/tests/test_swarm_config.py +0 -520
  300. package/runner/tests/test_sweep_regressions.py +0 -453
  301. package/runner/tests/test_webcache.py +0 -271
  302. package/runner/tests/test_weight_signals.py +0 -401
  303. package/schemas/alpha_dossier.schema.json +0 -204
  304. package/schemas/audit_report.schema.json +0 -79
  305. package/schemas/beta_dossier.schema.json +0 -214
  306. package/schemas/config.schema.json +0 -311
  307. package/schemas/frontier.schema.json +0 -61
  308. package/schemas/manifest.schema.json +0 -49
  309. package/schemas/scope_manifest.schema.json +0 -47
  310. package/scripts/__pycache__/bet1_advisory_spike.cpython-311.pyc +0 -0
  311. package/scripts/__pycache__/build_adapters.cpython-311.pyc +0 -0
  312. package/scripts/__pycache__/check_docs.cpython-311.pyc +0 -0
  313. package/scripts/__pycache__/divergence_experiment.cpython-311.pyc +0 -0
  314. package/scripts/__pycache__/gen_schemas.cpython-311.pyc +0 -0
  315. package/scripts/auction_experiment.py +0 -188
  316. package/scripts/bet1_advisory_spike.py +0 -442
  317. package/scripts/build_adapters.py +0 -417
  318. package/scripts/check_docs.py +0 -66
  319. package/scripts/divergence_experiment.py +0 -214
  320. package/scripts/gen_schemas.py +0 -69
  321. package/skills/brainstorming/SKILL.md +0 -106
  322. package/skills/brainstorming/__init__.py +0 -1
  323. package/skills/brainstorming/scripts/brainstorm.py +0 -201
  324. package/skills/code_audit/SKILL.md +0 -45
  325. package/skills/darkharvest/SKILL.md +0 -70
  326. package/skills/darkharvest/scripts/harvest.py +0 -289
  327. package/skills/epistemic_search/SKILL.md +0 -67
  328. package/skills/epistemic_search/__init__.py +0 -1
  329. package/skills/epistemic_search/scripts/__pycache__/search.cpython-311.pyc +0 -0
  330. package/skills/epistemic_search/scripts/fetch.py +0 -156
  331. package/skills/epistemic_search/scripts/search.py +0 -551
  332. package/skills/epistemic_search/scripts/webcache.py +0 -339
  333. package/skills/factory/SKILL.md +0 -61
  334. package/skills/factory/scripts/factory.py +0 -300
  335. package/skills/grilling/SKILL.md +0 -61
  336. package/skills/grilling/__init__.py +0 -0
  337. package/skills/grilling/__pycache__/__init__.cpython-311.pyc +0 -0
  338. package/skills/grilling/__pycache__/socratic_tree.cpython-311.pyc +0 -0
  339. package/skills/grilling/socratic_tree.py +0 -363
  340. package/skills/oss_scout/SKILL.md +0 -49
  341. package/skills/research_cache/SKILL.md +0 -36
  342. package/skills/research_cache/__init__.py +0 -0
  343. package/skills/research_cache/__pycache__/__init__.cpython-311.pyc +0 -0
  344. package/skills/research_cache/__pycache__/hasher.cpython-311.pyc +0 -0
  345. package/skills/research_cache/hasher.py +0 -302
  346. package/skills/swarm_config/SKILL.md +0 -178
  347. package/skills/swarm_config/__init__.py +0 -35
  348. package/skills/swarm_config/__pycache__/__init__.cpython-311.pyc +0 -0
  349. package/skills/swarm_config/__pycache__/configure.cpython-311.pyc +0 -0
  350. package/skills/swarm_config/configure.py +0 -1002
package/bin/cli.js DELETED
@@ -1,297 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * IUMBTEMS CLI: I Use My Brain To Express My Self
5
- * High-Integrity Dialectic Research Harness for Claude Code, Pi, OMP, OpenCode V2, Gemini CLI, Codex CLI, AntiGravity.
6
- */
7
-
8
- const { spawnSync } = require('node:child_process');
9
- const path = require('node:path');
10
- const fs = require('node:fs');
11
-
12
- function resolveBinary(name) {
13
- const pathDirs = (process.env.PATH || '').split(path.delimiter);
14
- for (const dir of pathDirs) {
15
- if (!dir || dir === '.' || dir.startsWith('./') || dir.startsWith('../')) continue;
16
- const full = path.join(dir, name);
17
- try {
18
- // Match Node's own PATH search: skip non-files and non-executables so a
19
- // directory or a non-executable named `python3` earlier on PATH cannot
20
- // shadow the real binary.
21
- if (!fs.statSync(full).isFile()) continue;
22
- fs.accessSync(full, fs.constants.X_OK);
23
- return fs.realpathSync(full);
24
- } catch {
25
- /* not present, not a file, or not executable — keep searching */
26
- }
27
- }
28
- return name;
29
- }
30
-
31
- const PKG_ROOT = path.resolve(__dirname, '..');
32
- const args = process.argv.slice(2);
33
- const command = args[0] || 'help';
34
-
35
- function printHelp() {
36
- console.log(`
37
- 🧠 IUMBTEMS: I Use My Brain To Express My Self
38
- 🌟 Epistemic Swarm: High-Integrity Research Harness
39
- Platforms: Claude Code | Pi (pi.dev) | OMP (oh-my-pi) | OpenCode V2 | Gemini CLI | Codex CLI | AntiGravity
40
- Organization: @heretek-ai | Repository: Heretek-AI/IUMBTEMS
41
-
42
- Usage:
43
- iumbtems <command> [options]
44
- npx @heretek-ai/epistemic-swarm <command> [options]
45
-
46
- Commands:
47
- config [options] Inspect or modify swarm parameters (engine, depth, mode)
48
- audit "<target>" Run dialectic codebase architectural & security audit
49
- scout "<feature>" Scout open-source software, libraries & clean-room blueprints
50
- run "<objective>" Run the dialectic multi-agent research swarm
51
- brainstorm "<prompt>" Run lateral brainstorming (feature vectors + spikes)
52
- darkharvest "<arena>" Product competitor teardown with harvest verdicts
53
- factory <subcommand> Factory run-state helper (init, phase-add, qa-record, expansion, stop, gate)
54
- grill Launch interactive Socratic decision tree framing
55
- adapters Rebuild harness adapter mirrors (skills -> plugins/*, .agents)
56
- install Install skills & MCP servers into ~/.claude/
57
- marketplace Show Claude Code marketplace catalog & install commands
58
- test Run test suite for hashing, state machine & auditor
59
- doctor Check environment requirements (Claude Code, Pi, OpenCode)
60
- help Show this help message
61
-
62
- Platform Extensions:
63
- Pi (pi.dev): pi install npm:@heretek-ai/epistemic-swarm
64
- OMP (oh-my-pi): omp install npm:@heretek-ai/epistemic-swarm
65
- OpenCode V2: add "@heretek-ai/epistemic-swarm" to opencode.json plugins
66
- Gemini CLI: gemini extensions install https://github.com/Heretek-AI/IUMBTEMS --path plugins/gemini
67
- Codex CLI: copy plugins/codex/skills/* into .agents/skills/
68
- AntiGravity: agy plugin install https://github.com/Heretek-AI/IUMBTEMS --path plugins/antigravity
69
- Claude Code: npx @heretek-ai/epistemic-swarm install
70
-
71
- Options:
72
- --mock-claude Run swarm with synthetic mock responses (zero API cost)
73
- --frontier <file> Path to settled frontier.json from Socratic grilling
74
- --mode <mode> Operating mode (research, audit, scout, hybrid, brainstorm)
75
- --engine <engine> Search engine (duckduckgo, brave, firecrawl, searxng)
76
- --depth <n> Max dialectic iterations (1-4)
77
- --backend <b> Agent runtime: auto (host-native), claude, opencode
78
- --dir <path> Path to .research workspace directory (default: .research)
79
-
80
- Examples:
81
- iumbtems config --engine duckduckgo --depth 3
82
- iumbtems audit "runner/ and skills/ concurrency & security"
83
- iumbtems scout "Zero-dependency Raft consensus in Rust"
84
- iumbtems run "Verify sub-millisecond ZK prover latency"
85
- iumbtems brainstorm "Where do we go from here?"
86
- iumbtems darkharvest "Paseo-class agent harness competitor" --seeds https://github.com/a/b,https://github.com/c/d --max-repos 6 --mock-claude
87
- iumbtems factory init --run arena && iumbtems factory phase-add --run arena --phase 01-x --goal "..." --accept "a;b"
88
- iumbtems grill --objective "Rollup architecture trade-offs"
89
- iumbtems doctor
90
- `);
91
- }
92
-
93
- function runPython(scriptRelPath, extraArgs = []) {
94
- let finalArgs = [];
95
- if (scriptRelPath === '-m') {
96
- finalArgs = ['-m', ...extraArgs];
97
- } else {
98
- const scriptPath = path.join(PKG_ROOT, scriptRelPath);
99
- finalArgs = [scriptPath, ...extraArgs];
100
- }
101
- const result = spawnSync(resolveBinary('python3'), finalArgs, {
102
- stdio: 'inherit',
103
- cwd: process.cwd(),
104
- env: { ...process.env, PYTHONPATH: PKG_ROOT }
105
- });
106
- process.exit(result.status !== null ? result.status : 1);
107
- }
108
-
109
- function runBash(scriptRelPath, extraArgs = []) {
110
- const scriptPath = path.join(PKG_ROOT, scriptRelPath);
111
- const result = spawnSync(resolveBinary('bash'), [scriptPath, ...extraArgs], {
112
- stdio: 'inherit',
113
- cwd: process.cwd()
114
- });
115
- process.exit(result.status !== null ? result.status : 1);
116
- }
117
-
118
- switch (command) {
119
- case 'config': {
120
- runPython('skills/swarm_config/configure.py', args.slice(1));
121
- break;
122
- }
123
-
124
- case 'audit': {
125
- const targetObj = args[1] && !args[1].startsWith('--') ? args[1] : 'Full codebase architectural and security audit';
126
- const restArgs = args[1] && !args[1].startsWith('--') ? args.slice(2) : args.slice(1);
127
- const forwardArgs = ['--mode', 'audit', '--objective', targetObj, ...restArgs];
128
- runPython('runner/research_swarm.py', forwardArgs);
129
- break;
130
- }
131
-
132
- case 'scout': {
133
- const objective = args[1];
134
- if (!objective || objective.startsWith('--')) {
135
- console.error('Error: Please provide a feature or library to scout.');
136
- console.error('Example: npx @heretek-ai/epistemic-swarm scout "Zero-dependency Raft in Rust"');
137
- process.exit(1);
138
- }
139
- const forwardArgs = ['--mode', 'scout', '--objective', objective, ...args.slice(2)];
140
- runPython('runner/research_swarm.py', forwardArgs);
141
- break;
142
- }
143
-
144
- case 'run': {
145
- const objective = args[1];
146
- if (!objective || objective.startsWith('--')) {
147
- console.error('Error: Please provide a research objective string.');
148
- console.error('Example: npx @heretek-ai/epistemic-swarm run "Evaluate FPGA prover latency"');
149
- process.exit(1);
150
- }
151
- const forwardArgs = ['--objective', objective, ...args.slice(2)];
152
- runPython('runner/research_swarm.py', forwardArgs);
153
- break;
154
- }
155
-
156
- case 'brainstorm': {
157
- const objective = args[1];
158
- if (!objective || objective.startsWith('--')) {
159
- console.error('Error: Please provide a brainstorm prompt.');
160
- console.error('Example: npx @heretek-ai/epistemic-swarm brainstorm "Where do we go from here?"');
161
- process.exit(1);
162
- }
163
- const forwardArgs = ['--mode', 'brainstorm', '--objective', objective, ...args.slice(2)];
164
- runPython('runner/research_swarm.py', forwardArgs);
165
- break;
166
- }
167
-
168
- case 'darkharvest': {
169
- const objective = args[1];
170
- if (!objective || objective.startsWith('--')) {
171
- console.error('Error: Please provide a product arena to tear down.');
172
- console.error('Example: npx @heretek-ai/epistemic-swarm darkharvest "Paseo-class harness" --seeds https://github.com/a/b --max-repos 6');
173
- process.exit(1);
174
- }
175
- const forwardArgs = ['--mode', 'darkharvest', '--objective', objective, ...args.slice(2)];
176
- runPython('runner/research_swarm.py', forwardArgs);
177
- break;
178
- }
179
-
180
- case 'factory': {
181
- // Factory run-state helper: forward subcommands to skills/factory/scripts/factory.py
182
- // e.g. iumbtems factory init --run arena
183
- // iumbtems factory qa-record --run arena --phase 01-x --seat qa-a --verdict pass
184
- if (args[1] === '--help' || !args[1]) {
185
- console.log([
186
- 'Usage: iumbtems factory <init|phase-add|qa-record|expansion|stop|gate> [options]',
187
- ' init --run <name>',
188
- ' phase-add --run <name> --phase <id> --goal "<goal>" --accept "a;b"',
189
- ' qa-record --run <name> --phase <id> --seat <qa-a|qa-b> --verdict <pass|fail|conditional> [--reason "..."]',
190
- ' expansion --run <name> --loops <n> [--max-loops 10]',
191
- ' stop --run <name> (writes .factory/STOP kill-file)',
192
- ' gate --run <name> --phase <id> --action <open|settle|approve|waive|escalate|count> [--reason "..."]',
193
- ].join('\n'));
194
- break;
195
- }
196
- runPython('skills/factory/scripts/factory.py', args.slice(1));
197
- break;
198
- }
199
-
200
- case 'grill': {
201
- runPython('skills/grilling/socratic_tree.py', args.slice(1));
202
- break;
203
- }
204
-
205
- case 'adapters': {
206
- runPython('scripts/build_adapters.py', args.slice(1));
207
- break;
208
- }
209
-
210
- case 'install': {
211
- runBash('install.sh', args.slice(1));
212
- break;
213
- }
214
-
215
- case 'marketplace': {
216
- const mktPath = path.join(PKG_ROOT, '.claude-plugin', 'marketplace.json');
217
- if (!fs.existsSync(mktPath)) {
218
- console.error('Marketplace manifest not found.');
219
- process.exit(1);
220
- }
221
- const mkt = JSON.parse(fs.readFileSync(mktPath, 'utf8'));
222
- console.log(`\n🏪 CLAUDE CODE MARKETPLACE: ${mkt.name.toUpperCase()}`);
223
- console.log(`================================================`);
224
- console.log(`Owner: ${mkt.owner ? mkt.owner.name : 'Unknown'} <${mkt.owner ? mkt.owner.email : ''}>`);
225
- console.log(`Description: ${mkt.description}\n`);
226
- console.log(`🚀 Add this marketplace to Claude Code:`);
227
- console.log(` claude plugin marketplace add Heretek-AI/IUMBTEMS\n`);
228
- console.log(`📦 Available Plugins in Marketplace:`);
229
- (mkt.plugins || []).forEach((p, idx) => {
230
- console.log(` ${idx + 1}. ${p.name} [${p.category || 'plugin'}]`);
231
- console.log(` Description: ${p.description}`);
232
- console.log(` Install: claude plugin install ${p.name}@${mkt.name}`);
233
- console.log(` Configure: claude plugin configure ${p.name}@${mkt.name}\n`);
234
- });
235
- break;
236
- }
237
-
238
- case 'test': {
239
- runPython('-m', ['unittest', 'discover', '-s', 'runner/tests']);
240
- break;
241
- }
242
-
243
- case 'doctor': {
244
- console.log('🔍 Checking Epistemic Swarm Environment:\n');
245
-
246
- let pkgVersion = 'unknown';
247
- try {
248
- pkgVersion = JSON.parse(fs.readFileSync(path.join(PKG_ROOT, 'package.json'), 'utf8')).version || 'unknown';
249
- } catch { /* keep 'unknown' */ }
250
- console.log(`✅ epistemic-swarm: ${pkgVersion}`);
251
-
252
- const claudeCheck = spawnSync(resolveBinary('claude'), ['--version'], { encoding: 'utf-8' });
253
- if (claudeCheck.status === 0) {
254
- console.log(`✅ Claude Code: ${claudeCheck.stdout.trim()}`);
255
- } else {
256
- console.log('⚠️ Claude Code CLI not found in PATH (Install via npm i -g @anthropic-ai/claude-code)');
257
- }
258
-
259
- const pyCheck = spawnSync(resolveBinary('python3'), ['--version'], { encoding: 'utf-8' });
260
- console.log(`✅ Python: ${pyCheck.stdout ? pyCheck.stdout.trim() : 'python3 missing'}`);
261
-
262
- console.log(`✅ Node.js: ${process.version}`);
263
- console.log(`📁 Package Root: ${PKG_ROOT}`);
264
-
265
- // opencode resolves this package as `@latest` into a per-fetch cache and
266
- // keeps every generation. A session started against an old generation keeps
267
- // running the old code until it is refreshed, so report what is cached.
268
- try {
269
- const cacheRoot = path.join(process.env.HOME || '', '.cache', 'opencode', 'npm', '@heretek-ai');
270
- const pkgDir = path.join(cacheRoot, 'epistemic-swarm@latest');
271
- if (fs.existsSync(pkgDir)) {
272
- const generations = fs.readdirSync(pkgDir).filter((d) => /^\d+$/.test(d)).sort();
273
- const newest = generations[generations.length - 1];
274
- console.log(`\n🧩 OpenCode plugin cache: ${generations.length} generation(s) in ${pkgDir}`);
275
- for (const g of generations.slice(-5)) {
276
- const marker = g === newest ? ' <- newest' : '';
277
- console.log(` - ${g}${marker}`);
278
- }
279
- if (generations.length > 1) {
280
- console.log(' ⚠️ Multiple generations cached. If slash commands vanish or the plugin');
281
- console.log(' misbehaves, the running session may hold an older one — refresh with');
282
- console.log(' `opencode plugin update` (or clear the cache dir) and relaunch.');
283
- }
284
- } else {
285
- console.log('\n🧩 OpenCode plugin cache: not present (plugin not yet fetched)');
286
- }
287
- } catch (err) {
288
- console.log(`\n🧩 OpenCode plugin cache: could not inspect (${err.message})`);
289
- }
290
- break;
291
- }
292
-
293
- case 'help':
294
- default:
295
- printHelp();
296
- break;
297
- }
@@ -1,10 +0,0 @@
1
- {
2
- "env": {
3
- "SEARXNG_URL": "http://localhost:8080",
4
- "FIRECRAWL_API_URL": "http://localhost:3002",
5
- "FIRECRAWL_API_KEY": ""
6
- },
7
- "enabledPlugins": {
8
- "epistemic-swarm@heretek-official": true
9
- }
10
- }
@@ -1,23 +0,0 @@
1
- version: '3.8'
2
-
3
- services:
4
- searxng:
5
- image: docker.io/searxng/searxng:latest
6
- container_name: epistemic-searxng
7
- ports:
8
- - "8080:8080"
9
- volumes:
10
- - ./searxng-data:/etc/searxng:rw
11
- environment:
12
- - SEARXNG_BASE_URL=http://localhost:8080/
13
- restart: unless-stopped
14
-
15
- firecrawl:
16
- image: mendableai/firecrawl:latest
17
- container_name: epistemic-firecrawl
18
- ports:
19
- - "3002:3002"
20
- environment:
21
- - PORT=3002
22
- - NUM_WORKERS=4
23
- restart: unless-stopped
@@ -1,23 +0,0 @@
1
- {
2
- "pack_id": "biopharma",
3
- "description": "Biopharma regulatory research constitution: preprints heavily downweighted, retracted findings zero-tolerance, predatory/mirror domains banned. For FDA-facing dossiers and clinical evidence reviews.",
4
- "tier_weights": {
5
- "__default__": 1.0,
6
- "PEER_REVIEWED": 1.0,
7
- "TECHNICAL_DOCUMENTATION": 0.8,
8
- "PRIMARY_PRESS": 0.7,
9
- "PREPRINT": 0.3,
10
- "SECONDARY_MEDIA": 0.2
11
- },
12
- "neg_bonus": 0.5,
13
- "reject_penalty": 2.5,
14
- "accept_threshold": 0.7,
15
- "banned_domains": [
16
- "predatory-journal.example",
17
- "retracted-mirror.example",
18
- "banned-preprint-mirror.example"
19
- ],
20
- "mandatory_tags": ["VERIFIED", "INFERRED", "HYPOTHESIS", "NEGATIVE_KNOWLEDGE"],
21
- "retraction_policy": "zero_tolerance",
22
- "export_template": "regulatory"
23
- }
@@ -1,19 +0,0 @@
1
- {
2
- "pack_id": "legal",
3
- "description": "Legal research constitution: primary sources (statutes, filings, opinions) weighted above commentary; unverified secondary reporting heavily penalized.",
4
- "tier_weights": {
5
- "__default__": 1.0,
6
- "PEER_REVIEWED": 0.8,
7
- "TECHNICAL_DOCUMENTATION": 0.7,
8
- "PRIMARY_PRESS": 1.0,
9
- "PREPRINT": 0.2,
10
- "SECONDARY_MEDIA": 0.3
11
- },
12
- "neg_bonus": 0.5,
13
- "reject_penalty": 2.5,
14
- "accept_threshold": 0.65,
15
- "banned_domains": ["undisclosed-sponsored-content.example"],
16
- "mandatory_tags": ["VERIFIED", "INFERRED", "HYPOTHESIS", "NEGATIVE_KNOWLEDGE"],
17
- "retraction_policy": "standard",
18
- "export_template": "regulatory"
19
- }
@@ -1,19 +0,0 @@
1
- {
2
- "pack_id": "quant",
3
- "description": "Quantitative finance constitution: backtest claims must be reproducible; vendor marketing downweighted; live-trading failure postmortems valued as negative knowledge.",
4
- "tier_weights": {
5
- "__default__": 1.0,
6
- "PEER_REVIEWED": 0.9,
7
- "TECHNICAL_DOCUMENTATION": 1.0,
8
- "PRIMARY_PRESS": 0.6,
9
- "PREPRINT": 0.5,
10
- "SECONDARY_MEDIA": 0.2
11
- },
12
- "neg_bonus": 0.75,
13
- "reject_penalty": 3.0,
14
- "accept_threshold": 0.7,
15
- "banned_domains": ["vendor-whitepaper-mirror.example"],
16
- "mandatory_tags": ["VERIFIED", "INFERRED", "HYPOTHESIS", "NEGATIVE_KNOWLEDGE"],
17
- "retraction_policy": "standard",
18
- "export_template": "regulatory"
19
- }
@@ -1,33 +0,0 @@
1
- {
2
- "mcpServers": {
3
- "iumbtems": {
4
- "command": "python3",
5
- "args": ["runner/mcp_server.py"],
6
- "env": {
7
- "PYTHONPATH": "${IUMBTEMS_ROOT}"
8
- }
9
- },
10
- "brave-search": {
11
- "command": "npx",
12
- "args": ["-y", "@modelcontextprotocol/server-brave-search"],
13
- "env": {
14
- "BRAVE_SEARCH_API_KEY": "${BRAVE_SEARCH_API_KEY}"
15
- }
16
- },
17
- "searxng": {
18
- "command": "python3",
19
- "args": ["config/searxng_mcp.py"],
20
- "env": {
21
- "SEARXNG_URL": "${SEARXNG_URL:-http://localhost:8080}"
22
- }
23
- },
24
- "firecrawl": {
25
- "command": "npx",
26
- "args": ["-y", "firecrawl-mcp"],
27
- "env": {
28
- "FIRECRAWL_API_KEY": "${FIRECRAWL_API_KEY}",
29
- "FIRECRAWL_API_URL": "${FIRECRAWL_API_URL:-http://localhost:3002}"
30
- }
31
- }
32
- }
33
- }
@@ -1,153 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Intelligent MCP Server Launcher & Epistemic Fallback Proxy for IUMBTEMS.
4
- Safely detects API keys and endpoints:
5
- - If keys are present (via env or userConfig): launches the official MCP server.
6
- - If keys are absent: smoothly provides a zero-key JSON-RPC fallback MCP server
7
- backed by DuckDuckGo Lite search and content-addressed SHA256 caching.
8
- Prevents startup crashes and missing environment variable errors in Claude Code.
9
- """
10
-
11
- import json
12
- import os
13
- import shutil
14
- import sys
15
- from typing import Any, Dict, List, Optional
16
-
17
- # Add parent dir to path for imports
18
- SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
19
- PROJECT_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, ".."))
20
- if PROJECT_ROOT not in sys.path:
21
- sys.path.insert(0, PROJECT_ROOT)
22
-
23
-
24
- def get_config_val(key: str, default: str = "") -> str:
25
- """Retrieve config from env, userConfig, or defaults."""
26
- env_val = os.environ.get(key)
27
- if env_val:
28
- return env_val
29
- user_cfg_val = os.environ.get(f"CLAUDE_PLUGIN_OPTION_{key.upper()}")
30
- if user_cfg_val:
31
- return user_cfg_val
32
- return default
33
-
34
-
35
- def _build_brave_tools() -> list:
36
- from runner.mcp_protocol import ToolSpec
37
- from skills.epistemic_search.scripts.search import search_duckduckgo
38
-
39
- def handle_brave_search(args: Dict[str, Any]) -> str:
40
- results = search_duckduckgo(
41
- query=args.get("query", ""), max_results=args.get("count", 10)
42
- )
43
- return json.dumps(results, indent=2)
44
-
45
- return [
46
- ToolSpec(
47
- name="brave_web_search",
48
- description="Web search with DuckDuckGo fallback (zero API key required). Returns verifiable search results with titles, URLs, and snippets.",
49
- input_schema={
50
- "type": "object",
51
- "properties": {
52
- "query": {"type": "string", "description": "The search query terms"},
53
- "count": {"type": "number", "description": "Number of results (1-20)", "default": 10},
54
- },
55
- "required": ["query"],
56
- },
57
- handler=handle_brave_search,
58
- aliases=("search",),
59
- )
60
- ]
61
-
62
-
63
- def _build_firecrawl_tools() -> list:
64
- from runner.mcp_protocol import ToolSpec
65
- from skills.epistemic_search.scripts.fetch import fetch_and_cache
66
-
67
- def handle_firecrawl_scrape(args: Dict[str, Any]) -> str:
68
- return fetch_and_cache(url=args.get("url", ""))
69
-
70
- return [
71
- ToolSpec(
72
- name="firecrawl_scrape",
73
- description="Scrape and extract clean markdown with automatic content-addressed SHA-256 caching into .research/sources/.",
74
- input_schema={
75
- "type": "object",
76
- "properties": {
77
- "url": {"type": "string", "description": "URL to scrape and cache"},
78
- },
79
- "required": ["url"],
80
- },
81
- handler=handle_firecrawl_scrape,
82
- aliases=("scrape", "fetch"),
83
- )
84
- ]
85
-
86
-
87
- def run_zero_key_mcp_server(service: str):
88
- """Run lightweight JSON-RPC MCP server handling search and fetch without API keys."""
89
- from runner.mcp_protocol import StdioJsonRpcServer
90
-
91
- if service == "brave-search":
92
- tools = _build_brave_tools()
93
- elif service == "firecrawl":
94
- tools = _build_firecrawl_tools()
95
- else:
96
- tools = []
97
-
98
- server = StdioJsonRpcServer(
99
- server_name=f"epistemic-{service}-fallback",
100
- version="0.2.1",
101
- tools=tools,
102
- log_prefix="[mcp-launcher]",
103
- )
104
- server.serve_forever()
105
-
106
-
107
- def _launch_brave(npx_bin: Optional[str]) -> None:
108
- api_key = get_config_val("BRAVE_SEARCH_API_KEY")
109
- if api_key and npx_bin:
110
- os.environ["BRAVE_SEARCH_API_KEY"] = api_key
111
- os.execvp(npx_bin, [npx_bin, "-y", "@modelcontextprotocol/server-brave-search"])
112
- else:
113
- run_zero_key_mcp_server("brave-search")
114
-
115
-
116
- def _launch_firecrawl(npx_bin: Optional[str]) -> None:
117
- api_key = get_config_val("FIRECRAWL_API_KEY")
118
- api_url = get_config_val("FIRECRAWL_API_URL", "https://api.firecrawl.dev")
119
- if api_key and npx_bin:
120
- os.environ["FIRECRAWL_API_KEY"] = api_key
121
- os.environ["FIRECRAWL_API_URL"] = api_url
122
- os.execvp(npx_bin, [npx_bin, "-y", "firecrawl-mcp"])
123
- else:
124
- run_zero_key_mcp_server("firecrawl")
125
-
126
-
127
- def _launch_searxng() -> None:
128
- searxng_url = get_config_val("SEARXNG_URL", "http://localhost:8080")
129
- searxng_script = os.path.join(SCRIPT_DIR, "searxng_mcp.py")
130
- if os.path.exists(searxng_script):
131
- os.environ["SEARXNG_URL"] = searxng_url
132
- os.execvp("python3", ["python3", searxng_script])
133
- else:
134
- run_zero_key_mcp_server("searxng")
135
-
136
-
137
- def main():
138
- service = sys.argv[1] if len(sys.argv) > 1 else "brave-search"
139
- npx_bin = shutil.which("npx")
140
-
141
- if service == "brave-search":
142
- _launch_brave(npx_bin)
143
- elif service == "firecrawl":
144
- _launch_firecrawl(npx_bin)
145
- elif service == "searxng":
146
- _launch_searxng()
147
- else:
148
- sys.stderr.write(f"Unknown service: {service}\n")
149
- sys.exit(1)
150
-
151
-
152
- if __name__ == "__main__":
153
- main()