foundry-sandbox 0.13.0__tar.gz

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 (303) hide show
  1. foundry_sandbox-0.13.0/.env.example +35 -0
  2. foundry_sandbox-0.13.0/.foundry-mcp.toml +651 -0
  3. foundry_sandbox-0.13.0/.github/workflows/orchestration-tests.yml +90 -0
  4. foundry_sandbox-0.13.0/.github/workflows/performance-tests.yml +41 -0
  5. foundry_sandbox-0.13.0/.github/workflows/proxy-drift-check.yml +56 -0
  6. foundry_sandbox-0.13.0/.github/workflows/redteam-tests.yml +97 -0
  7. foundry_sandbox-0.13.0/.github/workflows/release.yml +81 -0
  8. foundry_sandbox-0.13.0/.github/workflows/test.yml +184 -0
  9. foundry_sandbox-0.13.0/.gitignore +22 -0
  10. foundry_sandbox-0.13.0/.gitleaks.toml +38 -0
  11. foundry_sandbox-0.13.0/.pre-commit-config.yaml +5 -0
  12. foundry_sandbox-0.13.0/AGENTS.md +27 -0
  13. foundry_sandbox-0.13.0/CHANGELOG.md +602 -0
  14. foundry_sandbox-0.13.0/CLAUDE.md +38 -0
  15. foundry_sandbox-0.13.0/Dockerfile +172 -0
  16. foundry_sandbox-0.13.0/LICENSE +21 -0
  17. foundry_sandbox-0.13.0/PKG-INFO +197 -0
  18. foundry_sandbox-0.13.0/README.md +153 -0
  19. foundry_sandbox-0.13.0/completion.bash +61 -0
  20. foundry_sandbox-0.13.0/config/allowlist.yaml +256 -0
  21. foundry_sandbox-0.13.0/config/policy.yaml.example +65 -0
  22. foundry_sandbox-0.13.0/docker-compose.credential-isolation.yml +281 -0
  23. foundry_sandbox-0.13.0/docker-compose.yml +75 -0
  24. foundry_sandbox-0.13.0/docs/README.md +86 -0
  25. foundry_sandbox-0.13.0/docs/adr/000-template.md +37 -0
  26. foundry_sandbox-0.13.0/docs/adr/001-consolidation.md +122 -0
  27. foundry_sandbox-0.13.0/docs/adr/002-container-identity.md +307 -0
  28. foundry_sandbox-0.13.0/docs/adr/003-policy-engine.md +474 -0
  29. foundry_sandbox-0.13.0/docs/adr/004-dns-integration.md +190 -0
  30. foundry_sandbox-0.13.0/docs/adr/005-failure-modes.md +321 -0
  31. foundry_sandbox-0.13.0/docs/adr/006-legacy-bridge-sunset.md +94 -0
  32. foundry_sandbox-0.13.0/docs/adr/007-container-config-deprecation.md +62 -0
  33. foundry_sandbox-0.13.0/docs/architecture.md +432 -0
  34. foundry_sandbox-0.13.0/docs/certificates.md +199 -0
  35. foundry_sandbox-0.13.0/docs/configuration.md +111 -0
  36. foundry_sandbox-0.13.0/docs/development/contributing.md +237 -0
  37. foundry_sandbox-0.13.0/docs/getting-started.md +191 -0
  38. foundry_sandbox-0.13.0/docs/observability.md +295 -0
  39. foundry_sandbox-0.13.0/docs/operations.md +541 -0
  40. foundry_sandbox-0.13.0/docs/parity-diffs.md +675 -0
  41. foundry_sandbox-0.13.0/docs/security/credential-isolation.md +470 -0
  42. foundry_sandbox-0.13.0/docs/security/index.md +152 -0
  43. foundry_sandbox-0.13.0/docs/security/network-isolation.md +194 -0
  44. foundry_sandbox-0.13.0/docs/security/sandbox-threats.md +453 -0
  45. foundry_sandbox-0.13.0/docs/security/security-architecture.md +294 -0
  46. foundry_sandbox-0.13.0/docs/usage/commands.md +770 -0
  47. foundry_sandbox-0.13.0/docs/usage/workflows.md +498 -0
  48. foundry_sandbox-0.13.0/entrypoint-root.sh +43 -0
  49. foundry_sandbox-0.13.0/entrypoint.sh +312 -0
  50. foundry_sandbox-0.13.0/foundry_sandbox/__init__.py +8 -0
  51. foundry_sandbox-0.13.0/foundry_sandbox/api_keys.py +367 -0
  52. foundry_sandbox-0.13.0/foundry_sandbox/atomic_io.py +93 -0
  53. foundry_sandbox-0.13.0/foundry_sandbox/claude_settings.py +48 -0
  54. foundry_sandbox-0.13.0/foundry_sandbox/cli.py +219 -0
  55. foundry_sandbox-0.13.0/foundry_sandbox/commands/__init__.py +5 -0
  56. foundry_sandbox-0.13.0/foundry_sandbox/commands/_helpers.py +138 -0
  57. foundry_sandbox-0.13.0/foundry_sandbox/commands/attach.py +316 -0
  58. foundry_sandbox-0.13.0/foundry_sandbox/commands/build.py +46 -0
  59. foundry_sandbox-0.13.0/foundry_sandbox/commands/config.py +113 -0
  60. foundry_sandbox-0.13.0/foundry_sandbox/commands/destroy.py +196 -0
  61. foundry_sandbox-0.13.0/foundry_sandbox/commands/destroy_all.py +232 -0
  62. foundry_sandbox-0.13.0/foundry_sandbox/commands/help_cmd.py +73 -0
  63. foundry_sandbox-0.13.0/foundry_sandbox/commands/info.py +65 -0
  64. foundry_sandbox-0.13.0/foundry_sandbox/commands/list_cmd.py +187 -0
  65. foundry_sandbox-0.13.0/foundry_sandbox/commands/new.py +687 -0
  66. foundry_sandbox-0.13.0/foundry_sandbox/commands/new_resolver.py +140 -0
  67. foundry_sandbox-0.13.0/foundry_sandbox/commands/new_setup.py +346 -0
  68. foundry_sandbox-0.13.0/foundry_sandbox/commands/new_validation.py +99 -0
  69. foundry_sandbox-0.13.0/foundry_sandbox/commands/new_wizard.py +351 -0
  70. foundry_sandbox-0.13.0/foundry_sandbox/commands/preset.py +105 -0
  71. foundry_sandbox-0.13.0/foundry_sandbox/commands/prune.py +290 -0
  72. foundry_sandbox-0.13.0/foundry_sandbox/commands/refresh_creds.py +165 -0
  73. foundry_sandbox-0.13.0/foundry_sandbox/commands/start.py +506 -0
  74. foundry_sandbox-0.13.0/foundry_sandbox/commands/status.py +144 -0
  75. foundry_sandbox-0.13.0/foundry_sandbox/commands/stop.py +59 -0
  76. foundry_sandbox-0.13.0/foundry_sandbox/commands/upgrade.py +58 -0
  77. foundry_sandbox-0.13.0/foundry_sandbox/compose.py +83 -0
  78. foundry_sandbox-0.13.0/foundry_sandbox/config.py +142 -0
  79. foundry_sandbox-0.13.0/foundry_sandbox/constants.py +271 -0
  80. foundry_sandbox-0.13.0/foundry_sandbox/container_configurator.py +169 -0
  81. foundry_sandbox-0.13.0/foundry_sandbox/container_io.py +518 -0
  82. foundry_sandbox-0.13.0/foundry_sandbox/container_setup.py +281 -0
  83. foundry_sandbox-0.13.0/foundry_sandbox/credential_setup.py +760 -0
  84. foundry_sandbox-0.13.0/foundry_sandbox/docker.py +992 -0
  85. foundry_sandbox-0.13.0/foundry_sandbox/errors.py +30 -0
  86. foundry_sandbox-0.13.0/foundry_sandbox/foundry_plugin.py +659 -0
  87. foundry_sandbox-0.13.0/foundry_sandbox/git.py +240 -0
  88. foundry_sandbox-0.13.0/foundry_sandbox/git_path_fixer.py +177 -0
  89. foundry_sandbox-0.13.0/foundry_sandbox/git_worktree.py +477 -0
  90. foundry_sandbox-0.13.0/foundry_sandbox/ide.py +154 -0
  91. foundry_sandbox-0.13.0/foundry_sandbox/image.py +66 -0
  92. foundry_sandbox-0.13.0/foundry_sandbox/models.py +150 -0
  93. foundry_sandbox-0.13.0/foundry_sandbox/network.py +450 -0
  94. foundry_sandbox-0.13.0/foundry_sandbox/opencode_sync.py +228 -0
  95. foundry_sandbox-0.13.0/foundry_sandbox/paths.py +423 -0
  96. foundry_sandbox-0.13.0/foundry_sandbox/permissions.py +154 -0
  97. foundry_sandbox-0.13.0/foundry_sandbox/proxy.py +412 -0
  98. foundry_sandbox-0.13.0/foundry_sandbox/settings_merge.py +113 -0
  99. foundry_sandbox-0.13.0/foundry_sandbox/state.py +642 -0
  100. foundry_sandbox-0.13.0/foundry_sandbox/stub_manager.py +199 -0
  101. foundry_sandbox-0.13.0/foundry_sandbox/tmux.py +146 -0
  102. foundry_sandbox-0.13.0/foundry_sandbox/tool_configs.py +600 -0
  103. foundry_sandbox-0.13.0/foundry_sandbox/tui.py +296 -0
  104. foundry_sandbox-0.13.0/foundry_sandbox/utils.py +198 -0
  105. foundry_sandbox-0.13.0/foundry_sandbox/validate.py +512 -0
  106. foundry_sandbox-0.13.0/install.sh +497 -0
  107. foundry_sandbox-0.13.0/lib/python/ensure_claude_foundry_mcp.py +131 -0
  108. foundry_sandbox-0.13.0/lib/python/ensure_claude_onboarding.py +61 -0
  109. foundry_sandbox-0.13.0/lib/python/ensure_claude_statusline.py +52 -0
  110. foundry_sandbox-0.13.0/lib/python/ensure_codex_config.py +123 -0
  111. foundry_sandbox-0.13.0/lib/python/ensure_gemini_settings.py +81 -0
  112. foundry_sandbox-0.13.0/lib/python/ensure_opencode_default_model.py +35 -0
  113. foundry_sandbox-0.13.0/lib/python/ensure_opencode_settings.py +35 -0
  114. foundry_sandbox-0.13.0/lib/python/ensure_opencode_tavily.py +39 -0
  115. foundry_sandbox-0.13.0/lib/python/json_config.py +95 -0
  116. foundry_sandbox-0.13.0/lib/python/merge_claude_settings.py +62 -0
  117. foundry_sandbox-0.13.0/lib/python/prefetch_opencode_plugins.py +127 -0
  118. foundry_sandbox-0.13.0/lib/python/sync_opencode_foundry.py +186 -0
  119. foundry_sandbox-0.13.0/pyproject.toml +95 -0
  120. foundry_sandbox-0.13.0/requirements.txt +33 -0
  121. foundry_sandbox-0.13.0/safety/credential-redaction.sh +151 -0
  122. foundry_sandbox-0.13.0/safety/gateway-credential-helper +40 -0
  123. foundry_sandbox-0.13.0/safety/gateway-gitconfig +9 -0
  124. foundry_sandbox-0.13.0/safety/network-firewall.sh +561 -0
  125. foundry_sandbox-0.13.0/safety/network-mode +448 -0
  126. foundry_sandbox-0.13.0/safety/operator-approve +29 -0
  127. foundry_sandbox-0.13.0/safety/sandbox-completions.bash +26 -0
  128. foundry_sandbox-0.13.0/safety/sudoers-allowlist +36 -0
  129. foundry_sandbox-0.13.0/specs/active/infrastructure-hardening-2026-02-08-001.json +1550 -0
  130. foundry_sandbox-0.13.0/specs/active/python-rewrite-and-test-suite-2026-02-09-001.json +3823 -0
  131. foundry_sandbox-0.13.0/statusline.conf +15 -0
  132. foundry_sandbox-0.13.0/stubs/AGENTS.md +108 -0
  133. foundry_sandbox-0.13.0/stubs/CLAUDE.md +108 -0
  134. foundry_sandbox-0.13.0/stubs/git-wrapper.sh +385 -0
  135. foundry_sandbox-0.13.0/tests/README.md +302 -0
  136. foundry_sandbox-0.13.0/tests/__init__.py +0 -0
  137. foundry_sandbox-0.13.0/tests/conftest.py +86 -0
  138. foundry_sandbox-0.13.0/tests/docker-compose.test.yml +90 -0
  139. foundry_sandbox-0.13.0/tests/integration/.gitkeep +0 -0
  140. foundry_sandbox-0.13.0/tests/integration/README.md +32 -0
  141. foundry_sandbox-0.13.0/tests/integration/__init__.py +0 -0
  142. foundry_sandbox-0.13.0/tests/integration/conftest.py +38 -0
  143. foundry_sandbox-0.13.0/tests/integration/test_addon_chain.py +218 -0
  144. foundry_sandbox-0.13.0/tests/integration/test_api_proxy.py +230 -0
  145. foundry_sandbox-0.13.0/tests/integration/test_branch_isolation_flow.py +254 -0
  146. foundry_sandbox-0.13.0/tests/integration/test_container_lifecycle.py +453 -0
  147. foundry_sandbox-0.13.0/tests/integration/test_git_operations.py +630 -0
  148. foundry_sandbox-0.13.0/tests/integration/test_git_push_flow.py +486 -0
  149. foundry_sandbox-0.13.0/tests/integration/test_registration_dns_flow.py +101 -0
  150. foundry_sandbox-0.13.0/tests/mocks.py +231 -0
  151. foundry_sandbox-0.13.0/tests/orchestration/__init__.py +0 -0
  152. foundry_sandbox-0.13.0/tests/orchestration/conftest.py +59 -0
  153. foundry_sandbox-0.13.0/tests/orchestration/test_exit_codes.py +635 -0
  154. foundry_sandbox-0.13.0/tests/orchestration/test_git_worktree.py +124 -0
  155. foundry_sandbox-0.13.0/tests/orchestration/test_lifecycle.py +187 -0
  156. foundry_sandbox-0.13.0/tests/orchestration/test_network_modes.py +157 -0
  157. foundry_sandbox-0.13.0/tests/orchestration/test_state.py +110 -0
  158. foundry_sandbox-0.13.0/tests/performance/.gitkeep +0 -0
  159. foundry_sandbox-0.13.0/tests/performance/README.md +30 -0
  160. foundry_sandbox-0.13.0/tests/performance/__init__.py +0 -0
  161. foundry_sandbox-0.13.0/tests/performance/test_latency.py +783 -0
  162. foundry_sandbox-0.13.0/tests/performance/test_throughput.py +648 -0
  163. foundry_sandbox-0.13.0/tests/redteam/harness.sh +165 -0
  164. foundry_sandbox-0.13.0/tests/redteam/modules/01-credentials-env.sh +40 -0
  165. foundry_sandbox-0.13.0/tests/redteam/modules/02-credentials-files.sh +55 -0
  166. foundry_sandbox-0.13.0/tests/redteam/modules/03-dns-filtering.sh +35 -0
  167. foundry_sandbox-0.13.0/tests/redteam/modules/04-network-isolation.sh +38 -0
  168. foundry_sandbox-0.13.0/tests/redteam/modules/05-proxy-egress.sh +27 -0
  169. foundry_sandbox-0.13.0/tests/redteam/modules/06-direct-ip-egress.sh +30 -0
  170. foundry_sandbox-0.13.0/tests/redteam/modules/07-proxy-admin.sh +26 -0
  171. foundry_sandbox-0.13.0/tests/redteam/modules/08-credential-injection.sh +28 -0
  172. foundry_sandbox-0.13.0/tests/redteam/modules/09-git-security.sh +314 -0
  173. foundry_sandbox-0.13.0/tests/redteam/modules/10-container-escape.sh +112 -0
  174. foundry_sandbox-0.13.0/tests/redteam/modules/11-github-api.sh +144 -0
  175. foundry_sandbox-0.13.0/tests/redteam/modules/12-tls-filesystem.sh +174 -0
  176. foundry_sandbox-0.13.0/tests/redteam/modules/13-credential-patterns.sh +56 -0
  177. foundry_sandbox-0.13.0/tests/redteam/modules/14-network-bypass.sh +146 -0
  178. foundry_sandbox-0.13.0/tests/redteam/modules/15-self-merge.sh +120 -0
  179. foundry_sandbox-0.13.0/tests/redteam/modules/16-readonly-fs.sh +88 -0
  180. foundry_sandbox-0.13.0/tests/redteam/modules/17-workflow-push.sh +98 -0
  181. foundry_sandbox-0.13.0/tests/redteam/results/.gitkeep +0 -0
  182. foundry_sandbox-0.13.0/tests/redteam/runner.sh +113 -0
  183. foundry_sandbox-0.13.0/tests/redteam-sandbox.sh +4 -0
  184. foundry_sandbox-0.13.0/tests/run.sh +36 -0
  185. foundry_sandbox-0.13.0/tests/security/.gitkeep +0 -0
  186. foundry_sandbox-0.13.0/tests/security/README.md +27 -0
  187. foundry_sandbox-0.13.0/tests/security/__init__.py +0 -0
  188. foundry_sandbox-0.13.0/tests/security/conftest.py +173 -0
  189. foundry_sandbox-0.13.0/tests/security/test_credential_isolation.py +131 -0
  190. foundry_sandbox-0.13.0/tests/security/test_filesystem_readonly.py +125 -0
  191. foundry_sandbox-0.13.0/tests/security/test_fuzzing.py +1208 -0
  192. foundry_sandbox-0.13.0/tests/security/test_git_branch_isolation.py +173 -0
  193. foundry_sandbox-0.13.0/tests/security/test_git_policy.py +774 -0
  194. foundry_sandbox-0.13.0/tests/security/test_git_security_invariants.py +1339 -0
  195. foundry_sandbox-0.13.0/tests/security/test_network_isolation.py +97 -0
  196. foundry_sandbox-0.13.0/tests/security/test_self_merge_blocked.py +203 -0
  197. foundry_sandbox-0.13.0/tests/unit/.gitkeep +0 -0
  198. foundry_sandbox-0.13.0/tests/unit/README.md +26 -0
  199. foundry_sandbox-0.13.0/tests/unit/conftest.py +38 -0
  200. foundry_sandbox-0.13.0/tests/unit/test_api_keys.py +271 -0
  201. foundry_sandbox-0.13.0/tests/unit/test_atomic_io.py +178 -0
  202. foundry_sandbox-0.13.0/tests/unit/test_attach_command.py +212 -0
  203. foundry_sandbox-0.13.0/tests/unit/test_canonical_imports.py +136 -0
  204. foundry_sandbox-0.13.0/tests/unit/test_circuit_breaker.py +713 -0
  205. foundry_sandbox-0.13.0/tests/unit/test_cli.py +278 -0
  206. foundry_sandbox-0.13.0/tests/unit/test_compose.py +139 -0
  207. foundry_sandbox-0.13.0/tests/unit/test_container_identity.py +608 -0
  208. foundry_sandbox-0.13.0/tests/unit/test_container_io.py +464 -0
  209. foundry_sandbox-0.13.0/tests/unit/test_container_setup.py +171 -0
  210. foundry_sandbox-0.13.0/tests/unit/test_credential_injector.py +261 -0
  211. foundry_sandbox-0.13.0/tests/unit/test_credential_setup.py +817 -0
  212. foundry_sandbox-0.13.0/tests/unit/test_destroy_command.py +377 -0
  213. foundry_sandbox-0.13.0/tests/unit/test_dns_filter.py +566 -0
  214. foundry_sandbox-0.13.0/tests/unit/test_docker.py +430 -0
  215. foundry_sandbox-0.13.0/tests/unit/test_dual_layer_consistency.py +438 -0
  216. foundry_sandbox-0.13.0/tests/unit/test_errors.py +88 -0
  217. foundry_sandbox-0.13.0/tests/unit/test_foundation.py +612 -0
  218. foundry_sandbox-0.13.0/tests/unit/test_foundry_plugin.py +318 -0
  219. foundry_sandbox-0.13.0/tests/unit/test_git.py +520 -0
  220. foundry_sandbox-0.13.0/tests/unit/test_git_operations.py +1775 -0
  221. foundry_sandbox-0.13.0/tests/unit/test_git_path_fixer.py +434 -0
  222. foundry_sandbox-0.13.0/tests/unit/test_git_proxy.py +1202 -0
  223. foundry_sandbox-0.13.0/tests/unit/test_git_wrapper.py +384 -0
  224. foundry_sandbox-0.13.0/tests/unit/test_github_api_filter.py +561 -0
  225. foundry_sandbox-0.13.0/tests/unit/test_import_latency.py +118 -0
  226. foundry_sandbox-0.13.0/tests/unit/test_import_layering.py +226 -0
  227. foundry_sandbox-0.13.0/tests/unit/test_imports.py +224 -0
  228. foundry_sandbox-0.13.0/tests/unit/test_models.py +279 -0
  229. foundry_sandbox-0.13.0/tests/unit/test_network.py +1124 -0
  230. foundry_sandbox-0.13.0/tests/unit/test_new_command.py +117 -0
  231. foundry_sandbox-0.13.0/tests/unit/test_permissions.py +196 -0
  232. foundry_sandbox-0.13.0/tests/unit/test_pktline.py +434 -0
  233. foundry_sandbox-0.13.0/tests/unit/test_policy_engine.py +1946 -0
  234. foundry_sandbox-0.13.0/tests/unit/test_proxy_validation.py +114 -0
  235. foundry_sandbox-0.13.0/tests/unit/test_prune_command.py +215 -0
  236. foundry_sandbox-0.13.0/tests/unit/test_python_config.py +223 -0
  237. foundry_sandbox-0.13.0/tests/unit/test_rate_limiter.py +781 -0
  238. foundry_sandbox-0.13.0/tests/unit/test_registry.py +427 -0
  239. foundry_sandbox-0.13.0/tests/unit/test_remaining_commands.py +511 -0
  240. foundry_sandbox-0.13.0/tests/unit/test_settings_merge.py +153 -0
  241. foundry_sandbox-0.13.0/tests/unit/test_start_command.py +38 -0
  242. foundry_sandbox-0.13.0/tests/unit/test_state.py +864 -0
  243. foundry_sandbox-0.13.0/tests/unit/test_stub_manager.py +247 -0
  244. foundry_sandbox-0.13.0/tests/unit/test_tmux.py +208 -0
  245. foundry_sandbox-0.13.0/tests/unit/test_tool_configs.py +509 -0
  246. foundry_sandbox-0.13.0/tests/unit/test_validate.py +1092 -0
  247. foundry_sandbox-0.13.0/unified-proxy/Dockerfile +95 -0
  248. foundry_sandbox-0.13.0/unified-proxy/__init__.py +34 -0
  249. foundry_sandbox-0.13.0/unified-proxy/addons/__init__.py +1 -0
  250. foundry_sandbox-0.13.0/unified-proxy/addons/circuit_breaker.py +525 -0
  251. foundry_sandbox-0.13.0/unified-proxy/addons/container_identity.py +246 -0
  252. foundry_sandbox-0.13.0/unified-proxy/addons/credential_injector.py +627 -0
  253. foundry_sandbox-0.13.0/unified-proxy/addons/dns_filter.py +327 -0
  254. foundry_sandbox-0.13.0/unified-proxy/addons/git_proxy.py +676 -0
  255. foundry_sandbox-0.13.0/unified-proxy/addons/metrics.py +318 -0
  256. foundry_sandbox-0.13.0/unified-proxy/addons/oauth_managers/__init__.py +7 -0
  257. foundry_sandbox-0.13.0/unified-proxy/addons/oauth_managers/codex.py +259 -0
  258. foundry_sandbox-0.13.0/unified-proxy/addons/oauth_managers/gemini.py +146 -0
  259. foundry_sandbox-0.13.0/unified-proxy/addons/oauth_managers/opencode.py +79 -0
  260. foundry_sandbox-0.13.0/unified-proxy/addons/policy_engine.py +680 -0
  261. foundry_sandbox-0.13.0/unified-proxy/addons/rate_limiter.py +304 -0
  262. foundry_sandbox-0.13.0/unified-proxy/branch_isolation.py +1062 -0
  263. foundry_sandbox-0.13.0/unified-proxy/branch_output_filter.py +625 -0
  264. foundry_sandbox-0.13.0/unified-proxy/branch_types.py +289 -0
  265. foundry_sandbox-0.13.0/unified-proxy/codex-token-manager.py +239 -0
  266. foundry_sandbox-0.13.0/unified-proxy/config.py +590 -0
  267. foundry_sandbox-0.13.0/unified-proxy/entrypoint.sh +608 -0
  268. foundry_sandbox-0.13.0/unified-proxy/gemini-token-manager.py +127 -0
  269. foundry_sandbox-0.13.0/unified-proxy/git_api.py +604 -0
  270. foundry_sandbox-0.13.0/unified-proxy/git_command_validation.py +862 -0
  271. foundry_sandbox-0.13.0/unified-proxy/git_operations.py +922 -0
  272. foundry_sandbox-0.13.0/unified-proxy/git_policies.py +159 -0
  273. foundry_sandbox-0.13.0/unified-proxy/git_subprocess.py +319 -0
  274. foundry_sandbox-0.13.0/unified-proxy/github-api-filter.py +414 -0
  275. foundry_sandbox-0.13.0/unified-proxy/github_config.py +22 -0
  276. foundry_sandbox-0.13.0/unified-proxy/internal_api.py +575 -0
  277. foundry_sandbox-0.13.0/unified-proxy/logging_config.py +458 -0
  278. foundry_sandbox-0.13.0/unified-proxy/opencode-token-manager.py +79 -0
  279. foundry_sandbox-0.13.0/unified-proxy/pktline.py +226 -0
  280. foundry_sandbox-0.13.0/unified-proxy/pytest.ini +11 -0
  281. foundry_sandbox-0.13.0/unified-proxy/registry.py +440 -0
  282. foundry_sandbox-0.13.0/unified-proxy/requirements.txt +16 -0
  283. foundry_sandbox-0.13.0/unified-proxy/stub-auth-codex.json +11 -0
  284. foundry_sandbox-0.13.0/unified-proxy/stub-auth-gemini.json +9 -0
  285. foundry_sandbox-0.13.0/unified-proxy/stub-auth-opencode.json +6 -0
  286. foundry_sandbox-0.13.0/unified-proxy/stub-gemini-accounts.json +4 -0
  287. foundry_sandbox-0.13.0/unified-proxy/stub-gemini-mcp-tokens.json +1 -0
  288. foundry_sandbox-0.13.0/unified-proxy/stub-gemini-settings.json +13 -0
  289. foundry_sandbox-0.13.0/unified-proxy/stub-gh-hosts.yml +5 -0
  290. foundry_sandbox-0.13.0/unified-proxy/stub-opencode-config.json +5 -0
  291. foundry_sandbox-0.13.0/unified-proxy/tests/__init__.py +1 -0
  292. foundry_sandbox-0.13.0/unified-proxy/tests/conftest.py +30 -0
  293. foundry_sandbox-0.13.0/unified-proxy/tests/unit/__init__.py +1 -0
  294. foundry_sandbox-0.13.0/unified-proxy/tests/unit/test_branch_isolation.py +1565 -0
  295. foundry_sandbox-0.13.0/unified-proxy/tests/unit/test_credential_injector.py +511 -0
  296. foundry_sandbox-0.13.0/unified-proxy/tests/unit/test_git_api.py +264 -0
  297. foundry_sandbox-0.13.0/unified-proxy/tests/unit/test_git_command_validation.py +369 -0
  298. foundry_sandbox-0.13.0/unified-proxy/tests/unit/test_git_policies.py +239 -0
  299. foundry_sandbox-0.13.0/unified-proxy/tests/unit/test_git_proxy.py +57 -0
  300. foundry_sandbox-0.13.0/unified-proxy/tests/unit/test_github_api_filter_coverage.py +282 -0
  301. foundry_sandbox-0.13.0/unified-proxy/tests/unit/test_metrics.py +547 -0
  302. foundry_sandbox-0.13.0/unified-proxy/tests/unit/test_policy_engine.py +119 -0
  303. foundry_sandbox-0.13.0/uninstall.sh +110 -0
@@ -0,0 +1,35 @@
1
+ # Foundry Sandbox API Keys Configuration
2
+ # Copy this file to .env and fill in your keys, or export them in your shell profile.
3
+ #
4
+ # Keys are passed to containers via docker-compose environment section.
5
+
6
+ # =============================================================================
7
+ # AI Provider Keys (at least one required)
8
+ # =============================================================================
9
+
10
+ # Claude Code - Get via: claude setup-token
11
+ # CLAUDE_CODE_OAUTH_TOKEN=
12
+
13
+ # OpenAI/Codex API
14
+ # OPENAI_API_KEY=
15
+
16
+ # Cursor Agent
17
+ # CURSOR_API_KEY=
18
+
19
+ # Note: Gemini CLI uses OAuth credentials stored in ~/.gemini/oauth_creds.json
20
+ # Run `gemini auth` to authenticate (no environment variable needed)
21
+
22
+ # =============================================================================
23
+ # Search Provider Keys (optional - for deep research features)
24
+ # =============================================================================
25
+
26
+ # Tavily Search API - https://tavily.com/
27
+ # TAVILY_API_KEY=
28
+
29
+ # Perplexity API - https://perplexity.ai/
30
+ # PERPLEXITY_API_KEY=
31
+
32
+ # Search provider override (comma-separated)
33
+ # Available: tavily, perplexity, semantic_scholar
34
+ # If set, overrides auto-detection. If unset, providers are auto-detected from API keys.
35
+ # FOUNDRY_SEARCH_PROVIDERS=tavily,perplexity
@@ -0,0 +1,651 @@
1
+ # foundry-mcp configuration
2
+ #
3
+ # Configuration Priority (highest to lowest):
4
+ # 1. Environment variables (runtime overrides)
5
+ # 2. Project config (./foundry-mcp.toml or ./.foundry-mcp.toml)
6
+ # 3. User config (~/.foundry-mcp.toml)
7
+ # 4. XDG config (~/.config/foundry-mcp/config.toml)
8
+ # 5. Built-in defaults
9
+
10
+ # =============================================================================
11
+ # Workspace Configuration
12
+ # =============================================================================
13
+
14
+ [workspace]
15
+ # Where your specs live (auto-detected if not set).
16
+ # Good default: keep specs in ./specs.
17
+ specs_dir = "./specs"
18
+
19
+ # Notes inbox (defaults to specs_dir/.notes)
20
+ # Env var: FOUNDRY_MCP_NOTES_DIR
21
+ notes_dir = "./specs/.notes"
22
+
23
+ # Directory for storing research artifacts
24
+ research_dir = "./specs/.research"
25
+
26
+ # =============================================================================
27
+ # Logging Configuration
28
+ # =============================================================================
29
+
30
+ [logging]
31
+ # Log level: DEBUG, INFO, WARNING, ERROR
32
+ level = "INFO"
33
+
34
+ # JSON logs are easier to ingest; set false for human-readable logs.
35
+ structured = true
36
+
37
+ # =============================================================================
38
+ # Tools Configuration
39
+ # =============================================================================
40
+
41
+ [tools]
42
+ # Disable specific tools to reduce prompt size.
43
+ # Tool descriptions are loaded into the model's context on each message.
44
+ # Good default: disable setup-only tools you do not use day-to-day.
45
+ #
46
+ # Available tools:
47
+ # health - Liveness/readiness checks (used by setup)
48
+ # plan - Plan creation and review workflows
49
+ # pr - Pull request creation
50
+ # error - Error collection and querying
51
+ # journal - Implementation journals
52
+ # authoring - Spec authoring operations
53
+ # review - Fidelity and code reviews
54
+ # spec - Spec management
55
+ # task - Task management
56
+ # provider - AI provider status
57
+ # environment - Environment setup and detection
58
+ # lifecycle - Spec lifecycle transitions
59
+ # verification - Verification workflows
60
+ # server - Server introspection
61
+ # test - Test runner integration
62
+ # research - Research workflows (chat, consensus, thinkdeep, ideate, deep)
63
+ #
64
+ # Default: disable tools not needed, or only needed during setup
65
+ disabled_tools = ["health", "error"]
66
+
67
+ # Environment variable alternative: FOUNDRY_MCP_DISABLED_TOOLS (comma-separated)
68
+ # Example: FOUNDRY_MCP_DISABLED_TOOLS=error,research
69
+
70
+ # =============================================================================
71
+ # Observability Configuration
72
+ # =============================================================================
73
+ #
74
+ # Requires optional dependencies:
75
+ # - For OpenTelemetry: pip install foundry-mcp[tracing]
76
+ # - For Prometheus: pip install foundry-mcp[metrics]
77
+ # - For both: pip install foundry-mcp[observability]
78
+
79
+ [observability]
80
+ # Master switch for all observability features
81
+ # Set to true to enable, then configure individual providers below
82
+ enabled = false
83
+
84
+ # =============================================================================
85
+ # Health Checks Configuration
86
+ # =============================================================================
87
+
88
+ [health]
89
+ # Health probes for liveness/readiness.
90
+ enabled = false
91
+
92
+ # =============================================================================
93
+ # Error Collection Configuration
94
+ # =============================================================================
95
+ #
96
+ # Stores error logs for observability and debugging.
97
+ # Errors are stored in append-only JSONL format with automatic cleanup.
98
+
99
+ [error_collection]
100
+ # Enable error collection
101
+ enabled = true
102
+
103
+ # =============================================================================
104
+ # Metrics Persistence Configuration
105
+ # =============================================================================
106
+ #
107
+ # Persist time-series metrics to disk so they survive restarts.
108
+
109
+ [metrics_persistence]
110
+ # Enable metrics persistence (default: false)
111
+ enabled = false
112
+
113
+ # =============================================================================
114
+ # Implement Command Configuration
115
+ # =============================================================================
116
+ #
117
+ # Default flags for the /implement command. These can be overridden via CLI flags.
118
+
119
+ [implement]
120
+
121
+ # Use subagent(s) for implementation (on by default)
122
+ delegate = true
123
+
124
+ # Run subagents concurrently for independent tasks (implies delegate=true)
125
+ parallel = true
126
+
127
+ # =============================================================================
128
+ # Git Workflow Configuration
129
+ # =============================================================================
130
+
131
+ [git]
132
+ # Enable git-aware workflows (automatic commit prompts, commit cadence, etc.)
133
+ enabled = true
134
+
135
+ # Determine when to offer automatic commits: "manual", "task", or "phase"
136
+ commit_cadence = "phase"
137
+
138
+ # Control automated behaviors
139
+ auto_commit = true
140
+ auto_push = true
141
+ auto_pr = false
142
+
143
+ # Show staged file preview before committing (recommended)
144
+ show_before_commit = false
145
+
146
+ # =============================================================================
147
+ # Workflow Configuration
148
+ # =============================================================================
149
+
150
+ [workflow]
151
+ # Execution mode:
152
+ # "single" - One task at a time with user approval
153
+ # "autonomous" - Complete all phase tasks automatically
154
+ # "batch" - Execute batch_size tasks, then pause
155
+ mode = "autonomous"
156
+
157
+ # Auto-compact setting (matches Claude Code's autoCompactEnabled)
158
+ # When false, context window is 200k; when true (default), it's 155k
159
+ # Sandboxes disable auto-compact for more predictable context management
160
+ auto_compact = false
161
+
162
+ # Automatically run validation after task completion
163
+ auto_validate = true
164
+
165
+ # Enable journaling of task completions
166
+ journal_enabled = true
167
+
168
+ # Number of tasks to execute in batch mode
169
+ batch_size = 5
170
+
171
+ # Context usage threshold (%) to trigger automatic pause
172
+ # When context reaches this threshold, autonomous/batch mode pauses
173
+ context_threshold = 85
174
+
175
+ # =============================================================================
176
+ # AI Consultation Configuration
177
+ # =============================================================================
178
+
179
+ [consultation]
180
+ # Default timeout for AI provider calls in seconds
181
+ default_timeout = 600
182
+
183
+ # Number of retry attempts per provider for transient failures
184
+ max_retries = 2
185
+
186
+ # Delay between retry attempts in seconds
187
+ retry_delay = 5.0
188
+
189
+ # Enable fallback to next available provider when one fails
190
+ fallback_enabled = true
191
+
192
+ # Cache time-to-live in seconds for consultation results
193
+ cache_ttl = 3600
194
+
195
+ # Provider priority list - first available provider wins
196
+ # Update order to match your preferred providers/models.
197
+ priority = [
198
+ "[cli]codex:gpt-5.2-codex",
199
+ "[cli]gemini:pro",
200
+ "[cli]claude:opus",
201
+ "[cli]opencode:zai-coding-plan/glm-4.7",
202
+ "[cli]claude-zai:opus"
203
+ ]
204
+
205
+ # Per-provider overrides (optional)
206
+ # [consultation.overrides]
207
+ # "[cli]opencode:openai/gpt-5.2-codex" = { timeout = 600 }
208
+
209
+ # Per-workflow overrides
210
+ [consultation.workflows.fidelity_review]
211
+ # Good default: 2 models for consensus
212
+ min_models = 2
213
+ timeout_override = 600.0
214
+ default_review_type = "full"
215
+
216
+ [consultation.workflows.plan_review]
217
+ # Good default: 2 models for consensus
218
+ min_models = 2
219
+ default_review_type = "full"
220
+
221
+ [consultation.workflows.markdown_plan_review]
222
+ # Good default: 2 models
223
+ min_models = 2
224
+ timeout_override = 600.0
225
+ default_review_type = "full"
226
+
227
+ # =============================================================================
228
+ # Research Workflow Configuration
229
+ # =============================================================================
230
+
231
+ [research]
232
+ # Enable research tools (chat, consensus, thinkdeep, ideate, deep-research)
233
+ enabled = true
234
+
235
+ # Default LLM provider for research workflows
236
+ # Supports ProviderSpec format: "[cli]gemini:pro" or simple: "gemini"
237
+ default_provider = "[cli]gemini:pro"
238
+
239
+ # Providers for CONSENSUS workflow (multi-model consultation)
240
+ # Use the providers you have installed.
241
+ consensus_providers = [
242
+ "[cli]gemini:pro",
243
+ "[cli]codex:gpt-5.2-codex",
244
+ "[cli]claude:opus",
245
+ "[cli]opencode:zai-coding-plan/glm-4.7",
246
+ "[cli]claude-zai:opus"
247
+ ]
248
+
249
+ # State TTL in hours before cleanup
250
+ ttl_hours = 24
251
+
252
+ # Maximum messages per conversation thread
253
+ max_messages_per_thread = 100
254
+
255
+ # Default timeout for provider calls in seconds
256
+ # Minimum recommended: 600s for AI CLI providers
257
+ default_timeout = 600.0
258
+
259
+ # Maximum investigation depth for THINKDEEP workflow
260
+ thinkdeep_max_depth = 5
261
+
262
+ # Perspectives for IDEATE brainstorming
263
+ ideate_perspectives = ["technical", "creative", "practical", "visionary"]
264
+
265
+ # -----------------------------------------------------------------------------
266
+ # Deep Research Settings
267
+ # -----------------------------------------------------------------------------
268
+
269
+ # Maximum refinement iterations
270
+ deep_research_max_iterations = 3
271
+
272
+ # Maximum sub-queries per decomposition
273
+ deep_research_max_sub_queries = 5
274
+
275
+ # Maximum sources per sub-query
276
+ deep_research_max_sources = 10
277
+
278
+ # Follow and extract content from URLs
279
+ deep_research_follow_links = true
280
+
281
+ # Whole workflow timeout in seconds (recommended: 600s)
282
+ deep_research_timeout = 600.0
283
+
284
+ # Maximum parallel operations
285
+ deep_research_max_concurrent = 3
286
+
287
+ # Write audit artifacts for debugging
288
+ deep_research_audit_artifacts = true
289
+
290
+ # Research mode: controls source prioritization
291
+ # - "general" : No domain preferences (default)
292
+ # - "academic" : Prioritizes journals, publishers, preprints
293
+ # - "technical" : Prioritizes official docs, arxiv, Stack Overflow
294
+ deep_research_mode = "technical"
295
+
296
+ # Search providers (in priority order)
297
+ # Available: tavily, perplexity, google, semantic_scholar
298
+ deep_research_providers = [
299
+ "semantic_scholar"
300
+ ]
301
+
302
+ # -----------------------------------------------------------------------------
303
+ # Per-Phase Timeouts (override deep_research_timeout)
304
+ # Minimum recommended: 600s per operation for AI CLI providers
305
+ # -----------------------------------------------------------------------------
306
+
307
+ deep_research_planning_timeout = 600.0 # Query decomposition
308
+ deep_research_analysis_timeout = 600.0 # Finding extraction
309
+ deep_research_synthesis_timeout = 600.0 # Report generation (may take longer)
310
+ deep_research_refinement_timeout = 600.0 # Gap identification
311
+
312
+ # -----------------------------------------------------------------------------
313
+ # Per-Phase Providers (override default_provider)
314
+ # -----------------------------------------------------------------------------
315
+ # Supports ProviderSpec format for model selection:
316
+ # "[cli]gemini:pro"
317
+ # "[cli]claude:opus"
318
+ # "[cli]opencode:openai/gpt-5.2-codex"
319
+ # "[cli]codex:gpt-5.2-codex"
320
+
321
+ deep_research_planning_provider = "[cli]gemini:flash"
322
+ deep_research_analysis_provider = "[cli]gemini:pro"
323
+ deep_research_synthesis_provider = "[cli]gemini:pro"
324
+ deep_research_refinement_provider = "[cli]gemini:pro"
325
+
326
+ # -----------------------------------------------------------------------------
327
+ # Per-Phase Fallback Provider Lists (Retry & Resilience)
328
+ # -----------------------------------------------------------------------------
329
+ # Each phase can have an ordered list of fallback providers.
330
+ # On failure/timeout, the workflow retries with backoff, then tries
331
+ # the next provider in the list until success or exhaustion.
332
+ # Empty list = no fallback (use only the primary provider)
333
+
334
+ # Planning phase: query decomposition (can use faster/cheaper models)
335
+ deep_research_planning_providers = [
336
+ "[cli]gemini:flash",
337
+ "[cli]codex:gpt-5.1-codex-mini",
338
+ "[cli]claude:sonnet",
339
+ "[cli]opencode:zai-coding-plan/glm-4.7",
340
+ "[cli]claude-zai:sonnet"
341
+ ]
342
+
343
+ # Analysis phase: finding extraction
344
+ deep_research_analysis_providers = [
345
+ "[cli]gemini:pro",
346
+ "[cli]codex:gpt-4.1",
347
+ "[cli]claude:opus",
348
+ "[cli]opencode:zai-coding-plan/glm-4.7",
349
+ "[cli]claude-zai:opus"
350
+ ]
351
+
352
+ # Synthesis phase: report generation (may benefit from stronger models)
353
+ deep_research_synthesis_providers = [
354
+ "[cli]gemini:pro",
355
+ "[cli]codex:gpt-5.2-codex",
356
+ "[cli]claude:opus",
357
+ "[cli]opencode:zai-coding-plan/glm-4.7",
358
+ "[cli]claude-zai:opus"
359
+ ]
360
+
361
+ # Refinement phase: gap identification
362
+ deep_research_refinement_providers = [
363
+ "[cli]gemini:pro",
364
+ "[cli]codex:gpt-5.2-codex",
365
+ "[cli]claude:opus",
366
+ "[cli]opencode:zai-coding-plan/glm-4.7",
367
+ "[cli]claude-zai:opus"
368
+ ]
369
+
370
+ deep_research_max_retries = 2
371
+ deep_research_retry_delay = 5.0
372
+
373
+ # -----------------------------------------------------------------------------
374
+ # Search Rate Limiting
375
+ # -----------------------------------------------------------------------------
376
+
377
+ search_rate_limit = 60 # Requests per minute (global)
378
+ max_concurrent_searches = 3 # Concurrent search requests
379
+
380
+ [research.per_provider_rate_limits]
381
+ tavily = 60
382
+ perplexity = 60
383
+ semantic_scholar = 100
384
+
385
+ # -----------------------------------------------------------------------------
386
+ # Tavily Search Provider Configuration
387
+ # -----------------------------------------------------------------------------
388
+ # Tavily is optimized for AI applications. Get API key at https://tavily.com/
389
+
390
+ # Search depth: affects result quality and API credit cost
391
+ # - "basic" : Standard search (default, 1x credits)
392
+ # - "advanced" : Deeper analysis with more content (2x credits)
393
+ # - "fast" : Reduced latency
394
+ # - "ultra_fast" : Minimal latency
395
+ tavily_search_depth = "advanced"
396
+
397
+ # Search topic: "general" or "news"
398
+ tavily_topic = "general"
399
+
400
+ # Days limit for news search (1-365, only when topic="news")
401
+ # tavily_news_days = 7
402
+
403
+ # Include image results
404
+ tavily_include_images = false
405
+
406
+ # ISO 3166-1 alpha-2 country code to boost results (e.g., "US", "GB", "DE")
407
+ tavily_country = "US"
408
+
409
+ # Chunks per source for advanced search (1-5)
410
+ tavily_chunks_per_source = 3
411
+
412
+ # Let Tavily auto-configure parameters based on query intent
413
+ tavily_auto_parameters = false
414
+
415
+ # -----------------------------------------------------------------------------
416
+ # Tavily Extract Provider Configuration
417
+ # -----------------------------------------------------------------------------
418
+ # Extract structured content from URLs for deeper analysis
419
+
420
+ # Extract depth: "basic" or "advanced"
421
+ tavily_extract_depth = "advanced"
422
+
423
+ # Include images in extracted content
424
+ tavily_extract_include_images = false
425
+
426
+ # Enable extract as follow-up step in deep research workflow
427
+ # When true, deep research will extract full content from top search results
428
+ tavily_extract_in_deep_research = true
429
+
430
+ # Maximum URLs to extract per deep research run
431
+ tavily_extract_max_urls = 5
432
+
433
+
434
+
435
+ # -----------------------------------------------------------------------------
436
+ # Document Digest Configuration
437
+ # -----------------------------------------------------------------------------
438
+ # Controls automatic content compression for large research sources.
439
+ # When enabled, lengthy content is summarized into structured digests
440
+ # with key findings and evidence snippets, reducing token usage while
441
+ # preserving essential information.
442
+
443
+ # Digest policy: controls when digestion is applied
444
+ # - "off" : Never digest content (preserve raw text)
445
+ # - "auto" : Digest when content exceeds min_chars threshold (default)
446
+ # - "always" : Always digest eligible sources regardless of size
447
+ deep_research_digest_policy = "auto"
448
+
449
+ # Minimum character count before digest is applied (auto mode only)
450
+ deep_research_digest_min_chars = 10000
451
+
452
+ # Maximum sources to digest per batch
453
+ deep_research_digest_max_sources = 8
454
+
455
+ # Timeout per digest operation in seconds
456
+ deep_research_digest_timeout = 180.0
457
+
458
+ # Maximum concurrent digest operations
459
+ deep_research_digest_max_concurrent = 3
460
+
461
+ # Include evidence snippets (direct quotes) in digests
462
+ deep_research_digest_include_evidence = true
463
+
464
+ # Maximum characters per evidence snippet
465
+ deep_research_digest_evidence_max_chars = 600
466
+
467
+ # Maximum evidence snippets per digest
468
+ deep_research_digest_max_evidence_snippets = 5
469
+
470
+ # Fetch and extract PDF content from URLs
471
+ # When true, PDFs are downloaded, text extracted, and digested
472
+ # Requires additional processing time; disabled by default
473
+ deep_research_digest_fetch_pdfs = true
474
+
475
+ # Archive canonical text for digested sources
476
+ # When true, original full text is saved to disk before digesting
477
+ deep_research_archive_content = true
478
+
479
+ # Days to retain archived digest content (0 = keep indefinitely)
480
+ deep_research_archive_retention_days = 30
481
+
482
+ # Primary LLM provider for digest operations
483
+ # Uses analysis provider if not set
484
+ deep_research_digest_provider = "[cli]gemini:flash"
485
+
486
+ # Fallback providers for digest (tried in order if primary fails)
487
+ deep_research_digest_providers = [
488
+ "[cli]gemini:flash",
489
+ "[cli]codex:gpt-5.1-codex-mini",
490
+ "[cli]claude:haiku",
491
+ "[cli]opencode:zai-coding-plan/glm-4.7",
492
+ "[cli]claude-zai:sonnet"
493
+ ]
494
+
495
+ # -----------------------------------------------------------------------------
496
+ # Perplexity Search Provider Configuration
497
+ # -----------------------------------------------------------------------------
498
+ # Perplexity provides AI-powered search with citations.
499
+ # Get API key at https://www.perplexity.ai/settings/api
500
+
501
+ # Search context size: affects result depth and API cost
502
+ # - "low" : Minimal context, fastest responses
503
+ # - "medium" : Balanced context (default)
504
+ # - "high" : Maximum context, most comprehensive
505
+ perplexity_search_context_size = "medium"
506
+
507
+ # Maximum tokens for response
508
+ perplexity_max_tokens = 50000
509
+
510
+ # Maximum tokens per page
511
+ perplexity_max_tokens_per_page = 2048
512
+
513
+ # Time filter for results: "day", "week", "month", "year"
514
+ # perplexity_recency_filter = "week"
515
+
516
+ # ISO 3166-1 alpha-2 country code to boost results (e.g., "US", "GB", "DE")
517
+ perplexity_country = "US"
518
+
519
+ # -----------------------------------------------------------------------------
520
+ # Semantic Scholar Search Provider Configuration
521
+ # -----------------------------------------------------------------------------
522
+ # Semantic Scholar provides academic paper search with TLDR summaries.
523
+ # API key is optional but recommended for higher rate limits.
524
+
525
+ # Filter by publication types (list of types)
526
+ # Valid types: Review, JournalArticle, Conference, CaseReport, ClinicalTrial,
527
+ # Dataset, Editorial, LettersAndComments, MetaAnalysis, News,
528
+ # Study, Book, BookSection
529
+ semantic_scholar_publication_types = ["JournalArticle", "Conference", "Review", "MetaAnalysis", "Study"]
530
+
531
+ # Sort results by field: citationCount, publicationDate, paperId
532
+ semantic_scholar_sort_by = "citationCount"
533
+
534
+ # Sort direction: asc or desc (default: desc)
535
+ semantic_scholar_sort_order = "desc"
536
+
537
+ # Include TLDR and extended metadata (default: true)
538
+ # Set to false for faster responses with less metadata
539
+ semantic_scholar_use_extended_fields = true
540
+
541
+ # -----------------------------------------------------------------------------
542
+ # Search Provider Credentials (optional, prefer env vars)
543
+ # -----------------------------------------------------------------------------
544
+ # API keys can be set here or via environment variables (preferred):
545
+ # TAVILY_API_KEY, PERPLEXITY_API_KEY, SEMANTIC_SCHOLAR_API_KEY
546
+ #
547
+ # tavily_api_key = "tvly-..."
548
+ # perplexity_api_key = "pplx-..."
549
+ # semantic_scholar_api_key = "..."
550
+
551
+ # -----------------------------------------------------------------------------
552
+ # Token Management Configuration
553
+ # -----------------------------------------------------------------------------
554
+ # Controls token budget management for deep research workflows.
555
+ # When enabled, content is intelligently compressed or archived to fit
556
+ # within model context limits.
557
+
558
+ # Master switch for token management features
559
+ # When disabled, all token budget calculations are skipped
560
+ token_management_enabled = true
561
+
562
+ # Safety margin: fraction of budget reserved as buffer (0.0 - 1.0)
563
+ # Higher values provide more headroom but reduce usable context
564
+ # Default: 0.15 (15% buffer)
565
+ token_safety_margin = 0.15
566
+
567
+ # Runtime overhead: tokens reserved for CLI/IDE runtime context
568
+ # This accounts for system prompts, conversation history, and tool schemas
569
+ # that consume context before your research content.
570
+ #
571
+ # Recommended values by environment:
572
+ # Claude Code: 60000 (default, ~60K for system + tools + history)
573
+ # Codex/OpenCode: 30000 (minimal IDE integration overhead)
574
+ # Gemini CLI: 20000 (lightweight CLI)
575
+ # Direct API: 10000 (minimal overhead)
576
+ #
577
+ # Tip: If you see "context exceeded" errors, increase this value.
578
+ # If content is being dropped unnecessarily, decrease it.
579
+ runtime_overhead = 60000
580
+
581
+ # -----------------------------------------------------------------------------
582
+ # Summarization Configuration
583
+ # -----------------------------------------------------------------------------
584
+ # When content exceeds budget, summarization compresses it to fit.
585
+ # Uses LLM providers to generate condensed versions while preserving
586
+ # key information.
587
+
588
+ # Primary provider for summarization (uses default_provider if not set)
589
+ summarization_provider = "[cli]gemini:flash"
590
+
591
+ # Fallback providers for summarization (tried in order if primary fails)
592
+ summarization_providers = [
593
+ "[cli]gemini:flash",
594
+ "[cli]claude:haiku",
595
+ "[cli]codex:gpt-5.1-codex-mini",
596
+ "[cli]claude-zai:opus",
597
+ "[cli]opencode:zai-coding-plan/glm-4.7"
598
+ ]
599
+
600
+ # Timeout per summarization request in seconds
601
+ summarization_timeout = 60.0
602
+
603
+ # Cache summarization results to avoid redundant API calls
604
+ # Caches by content hash + summarization level + provider
605
+ summarization_cache_enabled = true
606
+
607
+ # -----------------------------------------------------------------------------
608
+ # Content Dropping & Archive Configuration
609
+ # -----------------------------------------------------------------------------
610
+ # When budget is exhausted and summarization isn't sufficient,
611
+ # low-priority content can be dropped. Optionally archive dropped
612
+ # content to disk for later retrieval.
613
+
614
+ # Allow dropping low-priority content when budget is exhausted
615
+ # When false: workflow may fail if content exceeds budget
616
+ # When true: drops lowest-priority items to fit budget
617
+ allow_content_dropping = true
618
+
619
+ # Archive dropped/compressed content to disk
620
+ # Enables potential future restoration and audit trail
621
+ content_archive_enabled = true
622
+
623
+ # TTL for archived content in hours (default: 168 = 7 days)
624
+ # Older content is automatically cleaned up
625
+ content_archive_ttl_hours = 168
626
+
627
+ # Directory for content archive storage
628
+ # Default: research_dir/.archive (e.g., specs/.research/.archive)
629
+ # research_archive_dir = "~/.foundry-mcp/research-archive"
630
+
631
+ # =============================================================================
632
+ # Test Runner Configuration
633
+ # =============================================================================
634
+ #
635
+ # Configure which test runner to use and customize runner settings.
636
+ # The foundry-setup command can auto-detect and configure this section.
637
+ #
638
+ # Supported runners (built-in defaults): pytest, go, npm, jest, make
639
+ # Custom runners can be defined in [test.runners.*] sections.
640
+
641
+ [test]
642
+ # Default runner to use when running tests
643
+ # Valid values: pytest, go, npm, jest, make, or any custom runner name
644
+ default_runner = "pytest"
645
+
646
+ # Example custom runner:
647
+ # [test.runners.go]
648
+ # command = ["go", "test"]
649
+ # run_args = ["./..."]
650
+ # pattern = "*_test.go"
651
+ # timeout = 300