@pensar/apex 2.6.1 → 2.7.0-canary.1572d9a4

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 (328) hide show
  1. package/build/{agent-ayreaj6z.js → agent-3g1b578v.js} +6 -5
  2. package/build/{agent-yby11zaq.js → agent-p8cezgbb.js} +7 -6
  3. package/build/{agent-runs-g37vkrjr.js → agent-runs-f86emmgg.js} +23 -20
  4. package/build/agent-vaq31je6.js +14 -0
  5. package/build/agent-vvdqga09.js +14 -0
  6. package/build/{apps-xn6km9yn.js → apps-3stwnmen.js} +16 -13
  7. package/build/{auth-d105wc64.js → auth-7md9kwda.js} +16 -13
  8. package/build/blackboxAgent-ct8bejef.js +14 -0
  9. package/build/{blackboxPentest-ps78v3w7.js → blackboxPentest-w2nr4md3.js} +21 -15
  10. package/build/{cli-c05y640n.js → cli-1j28cbhy.js} +1 -1
  11. package/build/{cli-d37a42dc.js → cli-2jz2jz06.js} +206 -90
  12. package/build/{cli-az3xq70v.js → cli-4a8dsz2k.js} +4 -4
  13. package/build/{cli-qgz1q9g5.js → cli-58781vcf.js} +1192 -1473
  14. package/build/{cli-gx71jcke.js → cli-7067zzeb.js} +1 -1
  15. package/build/{cli-3sp6nd8d.js → cli-81smmd5w.js} +5 -5
  16. package/build/{cli-k2nwxta0.js → cli-8b25dhky.js} +2 -2
  17. package/build/{cli-fy6vh2a7.js → cli-8sw5zpqz.js} +1 -1
  18. package/build/{cli-709rvekb.js → cli-cg3ypx5n.js} +14 -7
  19. package/build/{cli-dpsw2fe6.js → cli-e9v6zg6h.js} +40941 -40172
  20. package/build/cli-fjxmphg1.js +36 -0
  21. package/build/{cli-7eea4e2y.js → cli-gzb6qrzh.js} +31 -60
  22. package/build/{cli-65g6rcat.js → cli-khnf5xrf.js} +2 -1
  23. package/build/{cli-1ve18npr.js → cli-mdzt2e8j.js} +4 -2
  24. package/build/{cli-n2en7j5b.js → cli-n8mmw4c4.js} +1 -1
  25. package/build/cli-pndb7mh9.js +1193 -0
  26. package/build/cli-px6ehzqx.js +54 -0
  27. package/build/{cli-xtc2t6me.js → cli-qs4msn6x.js} +111 -47
  28. package/build/{cli-kb21qhvm.js → cli-rvybdhgn.js} +4 -3
  29. package/build/{cli-ae8jqxqr.js → cli-v739h7hb.js} +2 -2
  30. package/build/{cli-ngq9dr8n.js → cli-wm8ech0x.js} +3 -3
  31. package/build/cli.js +170 -51
  32. package/build/{config-zpqkd5cz.js → config-e5v1bkh1.js} +1 -1
  33. package/build/{fastStrike-mcjdvwez.js → fastStrike-efp0rjs3.js} +74 -17
  34. package/build/{fixes-kytx5dmj.js → fixes-926cw1ej.js} +16 -13
  35. package/build/{index-n65z6v7b.js → index-3t41p258.js} +7 -6
  36. package/build/{index-qv4cc65p.js → index-bv09af6g.js} +19 -15
  37. package/build/{index-je6hcsqr.js → index-bv6dtwse.js} +1 -1
  38. package/build/{index-4vqdgb42.js → index-jt52ffgn.js} +1657 -1400
  39. package/build/{index-ns4m4s01.js → index-np405b9e.js} +11 -7
  40. package/build/{index-r9yjkfrv.js → index-qys178kp.js} +5 -4
  41. package/build/{index-wqetp6gq.js → index-tpyzq2wq.js} +42 -11
  42. package/build/{index-fv64eb32.js → index-vrcdyebh.js} +2 -2
  43. package/build/{index-dr3tg1w3.js → index-z1g8vbtm.js} +1 -1
  44. package/build/{issues-eb3q9d3a.js → issues-sncyqh14.js} +16 -13
  45. package/build/{knowledge-fqsvtx0f.js → knowledge-esgvy5ws.js} +16 -13
  46. package/build/lance-sacfgs1z.js +232 -0
  47. package/build/lib/{chunk-9yksqgzr.js → chunk-4aevegnc.js} +77 -45
  48. package/build/lib/{chunk-9tt2021m.js → chunk-4kf4a15q.js} +13 -13
  49. package/build/lib/{chunk-fy3bbbqy.js → chunk-5avnedwm.js} +7 -1
  50. package/build/lib/{chunk-bb0ekhkw.js → chunk-5nz5tk3p.js} +76 -22
  51. package/build/lib/{chunk-4hwzqthr.js → chunk-7s8e5wrd.js} +3 -2
  52. package/build/lib/{chunk-yrnrbjes.js → chunk-85kpxwzs.js} +4 -2
  53. package/build/lib/{chunk-mg03jdmt.js → chunk-9jkzk9nc.js} +1 -1
  54. package/build/lib/{chunk-r4j8ybn9.js → chunk-9wwts6r6.js} +824 -77
  55. package/build/lib/{chunk-nhfax4gb.js → chunk-bxznzxdy.js} +5 -1
  56. package/build/lib/{chunk-r2dkp4tb.js → chunk-cqxm95md.js} +1 -1
  57. package/build/lib/{chunk-w66ce82a.js → chunk-e3agqspc.js} +12 -4
  58. package/build/lib/{chunk-ba41jh41.js → chunk-eh5yw385.js} +1137 -333
  59. package/build/lib/{chunk-1azdancq.js → chunk-ewc9r84m.js} +5 -1
  60. package/build/lib/{chunk-2njv7wz3.js → chunk-hbyxyxdc.js} +4 -0
  61. package/build/lib/{chunk-e8yy2k73.js → chunk-jhhwts6w.js} +28 -2
  62. package/build/lib/{chunk-1jvwqnem.js → chunk-kbxbd1kn.js} +108 -44
  63. package/build/lib/{chunk-7pwa92rn.js → chunk-mph5fvk7.js} +1 -1
  64. package/build/lib/chunk-psc23epq.js +107 -0
  65. package/build/lib/{chunk-acgbyf5h.js → chunk-qxad7qjd.js} +4 -2
  66. package/build/lib/{chunk-3c00n0cy.js → chunk-r0v3vvgm.js} +54 -33
  67. package/build/lib/{chunk-1yct6cra.js → chunk-rt13120a.js} +1 -1
  68. package/build/lib/{chunk-v3dk9j7k.js → chunk-sgya016v.js} +93 -22
  69. package/build/lib/{chunk-1fy8azee.js → chunk-txef92hq.js} +1 -1
  70. package/build/lib/{chunk-2qsq76xq.js → chunk-vcd90qrn.js} +189 -90
  71. package/build/lib/{chunk-7gjdygcx.js → chunk-vwr9w3ab.js} +2 -0
  72. package/build/lib/{chunk-z137x08b.js → chunk-wf6ak0m3.js} +92 -70
  73. package/build/lib/{chunk-xhdpgpkm.js → chunk-xft0ms9j.js} +2 -2
  74. package/build/lib/core/agents/agentRuntime.d.ts +3 -1
  75. package/build/lib/core/agents/defineAgent.d.ts +3 -2
  76. package/build/lib/core/agents/lance.d.ts +153 -0
  77. package/build/lib/core/agents/lanceJudge.d.ts +3 -0
  78. package/build/lib/core/agents/offSecAgent/index.d.ts +3 -1
  79. package/build/lib/core/agents/offSecAgent/index.js +16 -14
  80. package/build/lib/core/agents/offSecAgent/offensiveSecurityAgent.d.ts +4 -0
  81. package/build/lib/core/agents/offSecAgent/prompt.d.ts +3 -1
  82. package/build/lib/core/agents/offSecAgent/subagentSpawner.d.ts +18 -2
  83. package/build/lib/core/agents/offSecAgent/subagentSpawner.js +10 -8
  84. package/build/lib/core/agents/offSecAgent/toolExecutionContext.d.ts +3 -0
  85. package/build/lib/core/agents/offSecAgent/toolLifecycle.d.ts +1 -0
  86. package/build/lib/core/agents/offSecAgent/tools/index.js +10 -6
  87. package/build/lib/core/agents/offSecAgent/tools/listMemories.d.ts +11 -1
  88. package/build/lib/core/agents/offSecAgent/tools/reportError.d.ts +2 -1
  89. package/build/lib/core/agents/offSecAgent/tools/runPentestWorkflow.d.ts +20 -1
  90. package/build/lib/core/agents/offSecAgent/tools/spawnPentestAgent.d.ts +4 -7
  91. package/build/lib/core/agents/offSecAgent/tools/spawnPentestSwarm.d.ts +7 -1
  92. package/build/lib/core/agents/offSecAgent/tools/types.d.ts +6 -3
  93. package/build/lib/core/agents/offSecAgent/tools/whiteboxCandidates.d.ts +2 -2
  94. package/build/lib/core/agents/offSecAgent/types.d.ts +19 -3
  95. package/build/lib/core/agents/specialized/attackSurface/blackboxAgent.js +13 -13
  96. package/build/lib/core/agents/specialized/attackSurface/schemas.js +12 -12
  97. package/build/lib/core/agents/specialized/authenticationAgent/index.js +14 -14
  98. package/build/lib/core/agents/specialized/codeAgent/agent.js +13 -13
  99. package/build/lib/core/agents/specialized/codeAgent/prompts.d.ts +1 -0
  100. package/build/lib/core/agents/specialized/cvssScorer/index.d.ts +2 -1
  101. package/build/lib/core/agents/specialized/findingJudge/agent.js +11 -11
  102. package/build/lib/core/agents/specialized/findingJudge/index.d.ts +2 -1
  103. package/build/lib/core/agents/specialized/findingJudge/index.js +4 -4
  104. package/build/lib/core/agents/specialized/patching/index.js +14 -14
  105. package/build/lib/core/agents/specialized/pentest/agent.d.ts +18 -4
  106. package/build/lib/core/agents/specialized/pentest/agent.js +15 -13
  107. package/build/lib/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.d.ts +2 -1
  108. package/build/lib/core/agents/specialized/whiteboxAttackSurface/index.js +13 -13
  109. package/build/lib/core/ai/ai.d.ts +29 -70
  110. package/build/lib/core/ai/ai.js +5 -3
  111. package/build/lib/core/ai/index.d.ts +1 -0
  112. package/build/lib/core/ai/index.js +16 -4
  113. package/build/lib/core/ai/models/claude-capabilities.d.ts +3 -2
  114. package/build/lib/core/ai/models/concentrate.d.ts +1 -0
  115. package/build/lib/core/ai/models/index.d.ts +1 -1
  116. package/build/lib/core/ai/providers/concentrate.d.ts +1 -0
  117. package/build/lib/core/ai/reasoning.d.ts +44 -0
  118. package/build/lib/core/ai/utils.d.ts +2 -0
  119. package/build/lib/core/ai/utils.js +5 -3
  120. package/build/lib/core/api/index.d.ts +6 -0
  121. package/build/lib/core/api/index.js +32 -23
  122. package/build/lib/core/api/lance.d.ts +6 -0
  123. package/build/lib/core/api/offesecAgent.d.ts +1 -0
  124. package/build/lib/core/api/reasoning.d.ts +12 -0
  125. package/build/lib/core/api/targetedPentest.d.ts +1 -0
  126. package/build/lib/core/api/targetedPentest.js +14 -14
  127. package/build/lib/core/cli/reasoning.d.ts +4 -0
  128. package/build/lib/core/config/config.d.ts +10 -2
  129. package/build/lib/core/config/customProviders.d.ts +11 -0
  130. package/build/lib/core/config/index.js +1 -1
  131. package/build/lib/core/eventBus.js +1 -1
  132. package/build/lib/core/findings/registry.d.ts +3 -1
  133. package/build/lib/core/findings/registry.js +4 -4
  134. package/build/lib/core/observability/index.js +1 -1
  135. package/build/lib/core/observability/telemetry.d.ts +4 -0
  136. package/build/lib/core/session/index.d.ts +47 -0
  137. package/build/lib/core/session/index.js +6 -4
  138. package/build/lib/core/session/persistence.d.ts +7 -0
  139. package/build/lib/core/session/persistence.js +8 -4
  140. package/build/lib/core/tools/backends/index.js +1 -1
  141. package/build/lib/core/tools/backends/resolve.d.ts +1 -0
  142. package/build/lib/core/workflows/fastStrike.d.ts +3 -1
  143. package/build/lib/core/workflows/pentest.d.ts +12 -2
  144. package/build/lib/core/workflows/pentest.js +19 -19
  145. package/build/lib/core/workflows/seams.js +5 -5
  146. package/build/lib/core/workflows/threatModel.d.ts +1 -0
  147. package/build/lib/core/workflows/whiteboxAttackSurface.d.ts +6 -4
  148. package/build/lib/core/workflows/whiteboxAttackSurface.js +15 -15
  149. package/build/lib/index.js +25 -25
  150. package/build/{logs-x62b7hk1.js → logs-bcbjpjp6.js} +16 -13
  151. package/build/{native-rollout-evidence-c9yhfqcs.js → native-rollout-evidence-rph1774m.js} +5 -5
  152. package/build/offesecAgent-81h1p6ee.js +32 -0
  153. package/build/pentest-2q20q6n1.js +23 -0
  154. package/build/{pentests-e0f32aqx.js → pentests-jgw031mc.js} +16 -13
  155. package/build/recordedRunClient-6axj6fba.js +11 -0
  156. package/build/subagentSpawner-a861gvt0.js +12 -0
  157. package/build/targetedPentest-6yxznt7s.js +91 -0
  158. package/build/{targets-xj9g3q0z.js → targets-bjah19dp.js} +16 -13
  159. package/build/threatModel-739kpexm.js +24 -0
  160. package/build/{uninstall-7s784q4a.js → uninstall-yxrn9edt.js} +1 -1
  161. package/build/{upload-4gvhwmvr.js → upload-34ewrjp5.js} +4 -4
  162. package/build/{utils-cjrz64pc.js → utils-fzm66efw.js} +5 -5
  163. package/package.json +2 -1
  164. package/src/cli/issues.test.ts +17 -1
  165. package/src/cli/lance-verifier.test.ts +57 -0
  166. package/src/cli/lance-verifier.ts +73 -0
  167. package/src/cli/lance.test.ts +71 -0
  168. package/src/cli/lance.ts +48 -0
  169. package/src/cli.ts +109 -19
  170. package/src/core/agents/agentRuntime.test.ts +42 -0
  171. package/src/core/agents/agentRuntime.ts +7 -2
  172. package/src/core/agents/defineAgent.ts +3 -1
  173. package/src/core/agents/lance.test.ts +421 -0
  174. package/src/core/agents/lance.ts +701 -0
  175. package/src/core/agents/lanceJudge.test.ts +166 -0
  176. package/src/core/agents/lanceJudge.ts +115 -0
  177. package/src/core/agents/offSecAgent/index.ts +3 -0
  178. package/src/core/agents/offSecAgent/interruptedStepFinalization.test.ts +51 -0
  179. package/src/core/agents/offSecAgent/lance.test.ts +188 -0
  180. package/src/core/agents/offSecAgent/offensiveSecurityAgent.test.ts +92 -5
  181. package/src/core/agents/offSecAgent/offensiveSecurityAgent.ts +244 -41
  182. package/src/core/agents/offSecAgent/prompt.test.ts +46 -0
  183. package/src/core/agents/offSecAgent/prompt.ts +52 -8
  184. package/src/core/agents/offSecAgent/selectiveConstruction.publicPath.test.ts +38 -0
  185. package/src/core/agents/offSecAgent/selectiveConstruction.test.ts +64 -0
  186. package/src/core/agents/offSecAgent/subagentSpawner.hooks.test.ts +11 -3
  187. package/src/core/agents/offSecAgent/subagentSpawner.reasoning.test.ts +167 -0
  188. package/src/core/agents/offSecAgent/subagentSpawner.ts +82 -28
  189. package/src/core/agents/offSecAgent/toolExecutionContext.test.ts +230 -0
  190. package/src/core/agents/offSecAgent/toolExecutionContext.ts +56 -0
  191. package/src/core/agents/offSecAgent/toolLifecycle.ts +2 -0
  192. package/src/core/agents/offSecAgent/tools/delegateAuth.ts +4 -2
  193. package/src/core/agents/offSecAgent/tools/documentFinding.test.ts +9 -4
  194. package/src/core/agents/offSecAgent/tools/documentFinding.ts +10 -9
  195. package/src/core/agents/offSecAgent/tools/listMemories.test.ts +230 -0
  196. package/src/core/agents/offSecAgent/tools/listMemories.ts +73 -6
  197. package/src/core/agents/offSecAgent/tools/reportError.test.ts +6 -0
  198. package/src/core/agents/offSecAgent/tools/reportError.ts +10 -2
  199. package/src/core/agents/offSecAgent/tools/runAttackSurface.ts +7 -4
  200. package/src/core/agents/offSecAgent/tools/runPentestWorkflow.test.ts +57 -0
  201. package/src/core/agents/offSecAgent/tools/runPentestWorkflow.ts +21 -1
  202. package/src/core/agents/offSecAgent/tools/runWhiteboxScan.ts +5 -2
  203. package/src/core/agents/offSecAgent/tools/spawnCodingAgent.ts +50 -67
  204. package/src/core/agents/offSecAgent/tools/spawnPentestAgent.test.ts +79 -3
  205. package/src/core/agents/offSecAgent/tools/spawnPentestAgent.ts +36 -16
  206. package/src/core/agents/offSecAgent/tools/spawnPentestSwarm.ts +28 -5
  207. package/src/core/agents/offSecAgent/tools/threatModelGenerator.ts +4 -3
  208. package/src/core/agents/offSecAgent/tools/types.ts +12 -2
  209. package/src/core/agents/offSecAgent/tools/updateTask.ts +5 -1
  210. package/src/core/agents/offSecAgent/tools/whiteboxCandidates.ts +11 -4
  211. package/src/core/agents/offSecAgent/types.ts +22 -1
  212. package/src/core/agents/specialized/codeAgent/agent.test.ts +7 -0
  213. package/src/core/agents/specialized/codeAgent/agent.ts +9 -2
  214. package/src/core/agents/specialized/codeAgent/prompts.ts +6 -0
  215. package/src/core/agents/specialized/cvssScorer/index.test.ts +2 -1
  216. package/src/core/agents/specialized/cvssScorer/index.ts +3 -0
  217. package/src/core/agents/specialized/findingJudge/index.ts +6 -0
  218. package/src/core/agents/specialized/pentest/agent.test.ts +155 -0
  219. package/src/core/agents/specialized/pentest/agent.ts +181 -52
  220. package/src/core/agents/specialized/pentest/results.test.ts +59 -4
  221. package/src/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.concurrency.test.ts +59 -2
  222. package/src/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.hooks.test.ts +127 -0
  223. package/src/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.ts +74 -68
  224. package/src/core/ai/ai.durability-hooks.test.ts +25 -7
  225. package/src/core/ai/ai.lance.test.ts +581 -0
  226. package/src/core/ai/ai.operator-context.bench.test.ts +1390 -0
  227. package/src/core/ai/ai.recorded-context.test.ts +89 -8
  228. package/src/core/ai/ai.test.ts +81 -59
  229. package/src/core/ai/ai.ts +453 -327
  230. package/src/core/ai/compactionTelemetry.test.ts +69 -17
  231. package/src/core/ai/index.ts +11 -0
  232. package/src/core/ai/models/anthropic.ts +6 -0
  233. package/src/core/ai/models/bedrock.ts +18 -0
  234. package/src/core/ai/models/claude-capabilities.ts +29 -8
  235. package/src/core/ai/models/concentrate.ts +52 -0
  236. package/src/core/ai/models/index.ts +25 -4
  237. package/src/core/ai/models/models.test.ts +179 -7
  238. package/src/core/ai/models/openrouter-reasoning.json +219 -0
  239. package/src/core/ai/models/openrouter.ts +43 -1
  240. package/src/core/ai/providers/anthropic-models.test.ts +60 -1
  241. package/src/core/ai/providers/bedrock-models.test.ts +81 -0
  242. package/src/core/ai/providers/concentrate.test.ts +31 -0
  243. package/src/core/ai/providers/concentrate.ts +11 -0
  244. package/src/core/ai/providers/custom.test.ts +74 -0
  245. package/src/core/ai/providers/custom.ts +3 -1
  246. package/src/core/ai/providers/gateway-models.test.ts +16 -6
  247. package/src/core/ai/providers/pensarFormatters.ts +8 -1
  248. package/src/core/ai/reasoning.test.ts +313 -0
  249. package/src/core/ai/reasoning.ts +500 -0
  250. package/src/core/ai/streamIdleTimeout.test.ts +21 -0
  251. package/src/core/ai/utils.native-rollout-evidence.test.ts +21 -8
  252. package/src/core/ai/utils.ts +269 -163
  253. package/src/core/api/attackSurface.ts +1 -0
  254. package/src/core/api/blackboxPentest.ts +9 -1
  255. package/src/core/api/index.ts +17 -0
  256. package/src/core/api/lance.ts +23 -0
  257. package/src/core/api/offesecAgent.test.ts +51 -0
  258. package/src/core/api/offesecAgent.ts +15 -1
  259. package/src/core/api/reasoning.test.ts +213 -0
  260. package/src/core/api/reasoning.ts +44 -0
  261. package/src/core/api/recordedRun.loop.test.ts +5 -1
  262. package/src/core/api/targetedPentest.test.ts +14 -2
  263. package/src/core/api/targetedPentest.ts +52 -5
  264. package/src/core/cli/reasoning.test.ts +149 -0
  265. package/src/core/cli/reasoning.ts +95 -0
  266. package/src/core/config/config.test.ts +35 -0
  267. package/src/core/config/config.ts +11 -0
  268. package/src/core/config/customProviders.ts +21 -2
  269. package/src/core/eventBus.ts +1 -0
  270. package/src/core/findings/registry.test.ts +9 -1
  271. package/src/core/findings/registry.ts +6 -0
  272. package/src/core/observability/telemetry.test.ts +131 -79
  273. package/src/core/observability/telemetry.ts +5 -0
  274. package/src/core/runtime/sqliteRunObservation.test.ts +1 -1
  275. package/src/core/session/index.ts +38 -0
  276. package/src/core/session/persistence.test.ts +62 -0
  277. package/src/core/session/persistence.ts +56 -0
  278. package/src/core/tools/backends/resolve.ts +7 -0
  279. package/src/core/tools/backends/whiteboxJobs.test.ts +9 -8
  280. package/src/core/workflows/fastStrike.seams.test.ts +149 -0
  281. package/src/core/workflows/fastStrike.test.ts +18 -1
  282. package/src/core/workflows/fastStrike.ts +106 -11
  283. package/src/core/workflows/pentest.test.ts +104 -0
  284. package/src/core/workflows/pentest.ts +128 -7
  285. package/src/core/workflows/seams.test.ts +13 -0
  286. package/src/core/workflows/seams.ts +5 -1
  287. package/src/core/workflows/threatModel.ts +2 -0
  288. package/src/core/workflows/whiteboxAttackSurface.test.ts +74 -2
  289. package/src/core/workflows/whiteboxAttackSurface.ts +102 -73
  290. package/src/tui/command-registry.test.ts +12 -0
  291. package/src/tui/command-registry.ts +10 -0
  292. package/src/tui/components/chat/config-view.tsx +6 -10
  293. package/src/tui/components/chat/home-view.tsx +2 -2
  294. package/src/tui/components/chat/input-area.tsx +2 -2
  295. package/src/tui/components/chat/loading-indicator.tsx +20 -4
  296. package/src/tui/components/chat/message-list.tsx +1 -0
  297. package/src/tui/components/commands/__tests__/advanced-settings-lifecycle.tsx +164 -0
  298. package/src/tui/components/commands/advanced-settings.test.ts +34 -0
  299. package/src/tui/components/commands/advanced-settings.tsx +220 -31
  300. package/src/tui/components/commands/models-display.tsx +7 -1
  301. package/src/tui/components/model-picker/ModelPicker.tsx +65 -103
  302. package/src/tui/components/model-picker/ModelPickerDialog.tsx +8 -14
  303. package/src/tui/components/model-picker/__tests__/reasoning-control.tsx +162 -0
  304. package/src/tui/components/model-picker/reasoning-control.test.ts +15 -0
  305. package/src/tui/components/operator-dashboard/index.tsx +166 -50
  306. package/src/tui/components/operator-dashboard/logic.test.ts +144 -2
  307. package/src/tui/components/operator-dashboard/logic.ts +54 -3
  308. package/src/tui/components/operator-dashboard/run-events.test.ts +3 -1
  309. package/src/tui/components/shared/__tests__/tool-renderer-lifecycle.tsx +18 -0
  310. package/src/tui/components/shared/action-label.test.ts +9 -0
  311. package/src/tui/components/shared/compacting-icon.tsx +18 -0
  312. package/src/tui/components/shared/index.ts +1 -0
  313. package/src/tui/components/shared/tool-registry.ts +1 -0
  314. package/src/tui/components/shared/tool-renderer.tsx +21 -7
  315. package/src/tui/context/agent.tsx +32 -79
  316. package/src/tui/context/route.tsx +2 -0
  317. package/src/tui/index.tsx +1 -0
  318. package/src/tui/keybindings/registry.ts +2 -0
  319. package/build/agent-6w7egcf1.js +0 -13
  320. package/build/agent-9zx75feh.js +0 -13
  321. package/build/blackboxAgent-s56sgx9b.js +0 -13
  322. package/build/cli-g06s7edq.js +0 -11
  323. package/build/lib/chunk-z96pbjhd.js +0 -56
  324. package/build/offesecAgent-5whnpeta.js +0 -22
  325. package/build/pentest-e61hc38s.js +0 -22
  326. package/build/recordedRunClient-dp032c32.js +0 -11
  327. package/build/targetedPentest-rcbs4nvp.js +0 -57
  328. package/build/threatModel-jkxfa40s.js +0 -21
@@ -1,18 +1,18 @@
1
- import"../../../../chunk-7gjdygcx.js";
2
- import"../../../../chunk-w66ce82a.js";
1
+ import"../../../../chunk-vwr9w3ab.js";
2
+ import"../../../../chunk-e3agqspc.js";
3
3
  import"../../../../chunk-jdjagvgr.js";
4
- import"../../../../chunk-2njv7wz3.js";
5
- import"../../../../chunk-ba41jh41.js";
4
+ import"../../../../chunk-hbyxyxdc.js";
5
+ import"../../../../chunk-eh5yw385.js";
6
6
  import"../../../../chunk-8vhr65w3.js";
7
- import"../../../../chunk-r4j8ybn9.js";
8
- import"../../../../chunk-fy3bbbqy.js";
7
+ import"../../../../chunk-9wwts6r6.js";
8
+ import"../../../../chunk-5avnedwm.js";
9
9
  import"../../../../chunk-mv74mq5n.js";
10
- import"../../../../chunk-yrnrbjes.js";
10
+ import"../../../../chunk-85kpxwzs.js";
11
11
  import"../../../../chunk-b8eq85d2.js";
12
- import"../../../../chunk-1azdancq.js";
13
- import"../../../../chunk-3c00n0cy.js";
12
+ import"../../../../chunk-ewc9r84m.js";
13
+ import"../../../../chunk-r0v3vvgm.js";
14
14
  import"../../../../chunk-t5bt5vn1.js";
15
- import"../../../../chunk-2qsq76xq.js";
15
+ import"../../../../chunk-vcd90qrn.js";
16
16
  import"../../../../chunk-eb4h4k1f.js";
17
17
  import"../../../../chunk-vx228eeq.js";
18
18
  import"../../../../chunk-bx94rwt5.js";
@@ -23,7 +23,7 @@ import"../../../../chunk-q5e23acz.js";
23
23
  import {
24
24
  AgentRuntime,
25
25
  defineAgent
26
- } from "../../../../chunk-acgbyf5h.js";
26
+ } from "../../../../chunk-qxad7qjd.js";
27
27
 
28
28
  // src/core/agents/specialized/findingJudge/agent.ts
29
29
  import { stepCountIs } from "ai";
@@ -9,7 +9,7 @@ import type { AIModel } from "../../../ai";
9
9
  import type { ToolContext } from "../../offSecAgent/tools";
10
10
  import type { FindingJudgeInput, FindingJudgeResult } from "./types";
11
11
  export type { FindingJudgeAgentOutput, FindingJudgeInput, FindingJudgeResult, FindingType, } from "./types";
12
- export type FindingJudgeRuntimeContext = Pick<ToolContext, "session" | "authConfig" | "abortSignal" | "eventBus" | "sandbox" | "backends" | "target" | "enableThinking" | "thinkingEffort" | "openAIReasoningEffort" | "languageModelMiddleware" | "usageRecorder" | "streamIdFactory"> & {
12
+ export type FindingJudgeRuntimeContext = Pick<ToolContext, "session" | "authConfig" | "abortSignal" | "eventBus" | "sandbox" | "backends" | "target" | "enableThinking" | "thinkingEffort" | "openAIReasoningEffort" | "reasoning" | "languageModelMiddleware" | "usageRecorder" | "streamIdFactory" | "toolExecutionContext"> & {
13
13
  model: AIModel;
14
14
  /**
15
15
  * Subagent id used to tag the judge's own stream events. Callers that
@@ -20,6 +20,7 @@ export type FindingJudgeRuntimeContext = Pick<ToolContext, "session" | "authConf
20
20
  subagentId?: string;
21
21
  /** Human-readable label for readable OTel span names. Defaults to "Finding Judge". */
22
22
  subagentName?: string;
23
+ waitForDrain?: boolean;
23
24
  };
24
25
  /**
25
26
  * Validate a vulnerability finding by running a bounded verifier agent.
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  judgeFinding2,
3
3
  createJudgeFailureResult2
4
- } from "../../../../chunk-nhfax4gb.js";
5
- import"../../../../chunk-ba41jh41.js";
4
+ } from "../../../../chunk-bxznzxdy.js";
5
+ import"../../../../chunk-eh5yw385.js";
6
6
  import"../../../../chunk-8vhr65w3.js";
7
- import"../../../../chunk-2njv7wz3.js";
7
+ import"../../../../chunk-hbyxyxdc.js";
8
8
  import"../../../../chunk-jdjagvgr.js";
9
- import"../../../../chunk-w66ce82a.js";
9
+ import"../../../../chunk-e3agqspc.js";
10
10
  export {
11
11
  createJudgeFailureResult2 as createJudgeFailureResult,
12
12
  judgeFinding2 as judgeFinding
@@ -1,4 +1,4 @@
1
- import"../../../../chunk-mg03jdmt.js";
1
+ import"../../../../chunk-9jkzk9nc.js";
2
2
  import {
3
3
  buildSystemPrompt2,
4
4
  PATCHING_SYSTEM_PROMPT2,
@@ -8,26 +8,26 @@ import {
8
8
  PATCHING_ACTIVE_TOOLS2,
9
9
  readAgentsMd2,
10
10
  PatchingAgent2
11
- } from "../../../../chunk-1yct6cra.js";
12
- import"../../../../chunk-acgbyf5h.js";
13
- import"../../../../chunk-r4j8ybn9.js";
14
- import"../../../../chunk-3c00n0cy.js";
15
- import"../../../../chunk-yrnrbjes.js";
16
- import"../../../../chunk-7gjdygcx.js";
17
- import"../../../../chunk-b8eq85d2.js";
18
- import"../../../../chunk-2qsq76xq.js";
11
+ } from "../../../../chunk-rt13120a.js";
12
+ import"../../../../chunk-qxad7qjd.js";
13
+ import"../../../../chunk-9wwts6r6.js";
14
+ import"../../../../chunk-vcd90qrn.js";
19
15
  import"../../../../chunk-ja7j565c.js";
20
16
  import"../../../../chunk-3q89v4xv.js";
21
- import"../../../../chunk-fy3bbbqy.js";
22
- import"../../../../chunk-1azdancq.js";
17
+ import"../../../../chunk-r0v3vvgm.js";
18
+ import"../../../../chunk-5avnedwm.js";
19
+ import"../../../../chunk-85kpxwzs.js";
20
+ import"../../../../chunk-ewc9r84m.js";
21
+ import"../../../../chunk-vwr9w3ab.js";
23
22
  import"../../../../chunk-t5bt5vn1.js";
24
23
  import"../../../../chunk-eb4h4k1f.js";
24
+ import"../../../../chunk-b8eq85d2.js";
25
25
  import"../../../../chunk-vx228eeq.js";
26
- import"../../../../chunk-ba41jh41.js";
26
+ import"../../../../chunk-eh5yw385.js";
27
27
  import"../../../../chunk-8vhr65w3.js";
28
- import"../../../../chunk-2njv7wz3.js";
28
+ import"../../../../chunk-hbyxyxdc.js";
29
29
  import"../../../../chunk-jdjagvgr.js";
30
- import"../../../../chunk-w66ce82a.js";
30
+ import"../../../../chunk-e3agqspc.js";
31
31
  import"../../../../chunk-zrbqn62x.js";
32
32
  import"../../../../chunk-mv74mq5n.js";
33
33
  import"../../../../chunk-q5e23acz.js";
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import type { FindingsRegistry } from "../../../findings/registry";
3
3
  import { AgentRuntime } from "../../agentRuntime";
4
- import { type AgentMode, type Finding, type ReportedError, type SpecializedAgentInput, type SystemPentestScope } from "../../offSecAgent";
4
+ import { type AgentMode, type Finding, type FindingPolicy, type ReportedError, type SpecializedAgentInput, type SystemPentestScope } from "../../offSecAgent";
5
5
  import type { GrpcPentestContext } from "../attackSurface/grpcSchema";
6
6
  /**
7
7
  * Operating role for a {@link TargetedPentestAgent} instance.
@@ -73,6 +73,8 @@ export interface PentestAgentInput extends SpecializedAgentInput {
73
73
  export interface PentestResult {
74
74
  /** All findings discovered during the run */
75
75
  findings: Finding[];
76
+ /** Concise findings handed to an external evaluator, without native judging. */
77
+ reportedFindings?: string[];
76
78
  /** Absolute path to the session's findings directory */
77
79
  findingsPath: string;
78
80
  /** Absolute path to the session's POC scripts directory */
@@ -100,6 +102,18 @@ export declare const PentestResponseSchema: z.ZodObject<{
100
102
  newObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
101
103
  noFindingsReason: z.ZodOptional<z.ZodString>;
102
104
  }, z.core.$strip>;
105
+ export declare const PentestExternalResponseSchema: z.ZodObject<{
106
+ summary: z.ZodString;
107
+ objectivesCovered: z.ZodArray<z.ZodString>;
108
+ newObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
109
+ objectiveResults: z.ZodArray<z.ZodObject<{
110
+ objective: z.ZodString;
111
+ completed: z.ZodBoolean;
112
+ result: z.ZodOptional<z.ZodString>;
113
+ }, z.core.$strip>>;
114
+ reportedFindings: z.ZodArray<z.ZodString>;
115
+ noFindingsReason: z.ZodOptional<z.ZodString>;
116
+ }, z.core.$strip>;
103
117
  /** Per-construction scratch state: the resolved role/mode (defaulted once)
104
118
  * and the terminal blocking-error escape hatch shared between `extraTools`'
105
119
  * `report_error` callback and `resolveResult`. */
@@ -155,7 +169,7 @@ export declare function buildPentestSystemPrompt(session: {
155
169
  allowRateLimitTesting?: boolean;
156
170
  codebasePath?: string;
157
171
  };
158
- }, role?: PentestAgentRole, mode?: TargetedPentestMode, systemScope?: SystemPentestScope, helperWorkspaceRoot?: string): string;
172
+ }, role?: PentestAgentRole, mode?: TargetedPentestMode, systemScope?: SystemPentestScope, helperWorkspaceRoot?: string, findingPolicy?: FindingPolicy): string;
159
173
  export declare function buildPentestPrompt(target: string, objectives: string[], session: {
160
174
  rootPath: string;
161
175
  config?: {
@@ -163,10 +177,10 @@ export declare function buildPentestPrompt(target: string, objectives: string[],
163
177
  outcomeGuidance?: string;
164
178
  taskDriven?: boolean;
165
179
  };
166
- }, findingsRegistry?: FindingsRegistry, context?: string, envVarNames?: string[], subagentId?: string, role?: PentestAgentRole, credentialContext?: string, grpc?: GrpcPentestContext, mode?: TargetedPentestMode): string;
180
+ }, findingsRegistry?: FindingsRegistry, context?: string, envVarNames?: string[], subagentId?: string, role?: PentestAgentRole, credentialContext?: string, grpc?: GrpcPentestContext, mode?: TargetedPentestMode, findingPolicy?: FindingPolicy): string;
167
181
  export declare function buildPentestActiveTools(role: PentestAgentRole, session: {
168
182
  config?: {
169
183
  taskDriven?: boolean;
170
184
  promptInjectionLibrarySource?: string;
171
185
  };
172
- }): string[];
186
+ }, findingPolicy?: FindingPolicy): string[];
@@ -1,37 +1,39 @@
1
1
  import {
2
2
  resolvePentestAgentRole2,
3
3
  PentestResponseSchema2,
4
+ PentestExternalResponseSchema2,
4
5
  resolvePentestBrowserEngine2,
5
6
  targetedPentestWorker2,
6
7
  TargetedPentestAgent2,
7
8
  buildPentestSystemPrompt2,
8
9
  buildPentestPrompt2,
9
10
  buildPentestActiveTools2
10
- } from "../../../../chunk-1jvwqnem.js";
11
- import"../../../../chunk-acgbyf5h.js";
12
- import"../../../../chunk-r4j8ybn9.js";
13
- import"../../../../chunk-3c00n0cy.js";
14
- import"../../../../chunk-yrnrbjes.js";
15
- import"../../../../chunk-7gjdygcx.js";
16
- import"../../../../chunk-b8eq85d2.js";
17
- import"../../../../chunk-2qsq76xq.js";
11
+ } from "../../../../chunk-kbxbd1kn.js";
12
+ import"../../../../chunk-qxad7qjd.js";
13
+ import"../../../../chunk-9wwts6r6.js";
14
+ import"../../../../chunk-vcd90qrn.js";
18
15
  import"../../../../chunk-ja7j565c.js";
19
16
  import"../../../../chunk-3q89v4xv.js";
20
- import"../../../../chunk-fy3bbbqy.js";
21
- import"../../../../chunk-1azdancq.js";
17
+ import"../../../../chunk-r0v3vvgm.js";
18
+ import"../../../../chunk-5avnedwm.js";
19
+ import"../../../../chunk-85kpxwzs.js";
20
+ import"../../../../chunk-ewc9r84m.js";
21
+ import"../../../../chunk-vwr9w3ab.js";
22
22
  import"../../../../chunk-t5bt5vn1.js";
23
23
  import"../../../../chunk-eb4h4k1f.js";
24
+ import"../../../../chunk-b8eq85d2.js";
24
25
  import"../../../../chunk-vx228eeq.js";
25
- import"../../../../chunk-ba41jh41.js";
26
+ import"../../../../chunk-eh5yw385.js";
26
27
  import"../../../../chunk-8vhr65w3.js";
27
- import"../../../../chunk-2njv7wz3.js";
28
+ import"../../../../chunk-hbyxyxdc.js";
28
29
  import"../../../../chunk-jdjagvgr.js";
29
- import"../../../../chunk-w66ce82a.js";
30
+ import"../../../../chunk-e3agqspc.js";
30
31
  import"../../../../chunk-zrbqn62x.js";
31
32
  import"../../../../chunk-mv74mq5n.js";
32
33
  import"../../../../chunk-q5e23acz.js";
33
34
  import"../../../../chunk-bx94rwt5.js";
34
35
  export {
36
+ PentestExternalResponseSchema2 as PentestExternalResponseSchema,
35
37
  PentestResponseSchema2 as PentestResponseSchema,
36
38
  TargetedPentestAgent2 as TargetedPentestAgent,
37
39
  buildPentestActiveTools2 as buildPentestActiveTools,
@@ -1,5 +1,5 @@
1
1
  import type { StreamTextOnStepFinishCallback, ToolSet } from "ai";
2
- import type { AIModel, CacheMetrics, OpenAIReasoningEffort, ThinkingEffort } from "../../../ai";
2
+ import type { AIModel, CacheMetrics, OpenAIReasoningEffort, ReasoningSetting, ThinkingEffort } from "../../../ai";
3
3
  import type { AIAuthConfig } from "../../../ai/utils";
4
4
  import type { AgentEventBus } from "../../../eventBus";
5
5
  import type { AttackSurfaceRegistry } from "../../../findings/attackSurfaceRegistry";
@@ -26,6 +26,7 @@ interface SharedAgentOptions {
26
26
  onStepFinish?: StreamTextOnStepFinishCallback<ToolSet>;
27
27
  onCacheMetrics?: (metrics: CacheMetrics) => void;
28
28
  openAIReasoningEffort?: OpenAIReasoningEffort | null;
29
+ reasoning?: ReasoningSetting;
29
30
  enableThinking?: boolean;
30
31
  thinkingEffort?: ThinkingEffort | null;
31
32
  projectThreatModel?: string;
@@ -2,7 +2,7 @@ import {
2
2
  WHITEBOX_APPS_DISCOVERY_SYSTEM_PROMPT2,
3
3
  WHITEBOX_DISCOVERY_SYSTEM_PROMPT2,
4
4
  WhiteboxAttackSurfaceAgent2
5
- } from "../../../../chunk-r2dkp4tb.js";
5
+ } from "../../../../chunk-cqxm95md.js";
6
6
  import {
7
7
  RiskScoreBreakdownSchema2,
8
8
  RiskScoreSchema2,
@@ -11,25 +11,25 @@ import {
11
11
  AppsDiscoveryResultSchema2,
12
12
  DiscoverySummarySchema2
13
13
  } from "../../../../chunk-xpfg2fbk.js";
14
- import"../../../../chunk-acgbyf5h.js";
15
- import"../../../../chunk-r4j8ybn9.js";
16
- import"../../../../chunk-3c00n0cy.js";
17
- import"../../../../chunk-yrnrbjes.js";
18
- import"../../../../chunk-7gjdygcx.js";
19
- import"../../../../chunk-b8eq85d2.js";
20
- import"../../../../chunk-2qsq76xq.js";
14
+ import"../../../../chunk-qxad7qjd.js";
15
+ import"../../../../chunk-9wwts6r6.js";
16
+ import"../../../../chunk-vcd90qrn.js";
21
17
  import"../../../../chunk-ja7j565c.js";
22
18
  import"../../../../chunk-3q89v4xv.js";
23
- import"../../../../chunk-fy3bbbqy.js";
24
- import"../../../../chunk-1azdancq.js";
19
+ import"../../../../chunk-r0v3vvgm.js";
20
+ import"../../../../chunk-5avnedwm.js";
21
+ import"../../../../chunk-85kpxwzs.js";
22
+ import"../../../../chunk-ewc9r84m.js";
23
+ import"../../../../chunk-vwr9w3ab.js";
25
24
  import"../../../../chunk-t5bt5vn1.js";
26
25
  import"../../../../chunk-eb4h4k1f.js";
26
+ import"../../../../chunk-b8eq85d2.js";
27
27
  import"../../../../chunk-vx228eeq.js";
28
- import"../../../../chunk-ba41jh41.js";
28
+ import"../../../../chunk-eh5yw385.js";
29
29
  import"../../../../chunk-8vhr65w3.js";
30
- import"../../../../chunk-2njv7wz3.js";
30
+ import"../../../../chunk-hbyxyxdc.js";
31
31
  import"../../../../chunk-jdjagvgr.js";
32
- import"../../../../chunk-w66ce82a.js";
32
+ import"../../../../chunk-e3agqspc.js";
33
33
  import"../../../../chunk-zrbqn62x.js";
34
34
  import"../../../../chunk-mv74mq5n.js";
35
35
  import"../../../../chunk-q5e23acz.js";
@@ -1,5 +1,4 @@
1
1
  import type { AnthropicMessagesModelId } from "@ai-sdk/anthropic/internal";
2
- import type { OpenAIResponsesProviderOptions } from "@ai-sdk/openai";
3
2
  import type { OpenAIChatModelId } from "@ai-sdk/openai/internal";
4
3
  import { type LanguageModelMiddleware, type ModelMessage, type StopCondition, type StreamTextOnFinishCallback, type StreamTextOnStepFinishCallback, type StreamTextResult, type ToolChoice, type ToolSet } from "ai";
5
4
  import type { z } from "zod";
@@ -9,6 +8,8 @@ import { type AiTelemetryOperation } from "../observability";
9
8
  import type { RunContextRecorder } from "../runtime/runContext";
10
9
  import { type CompactionLink, type CompactionTrigger } from "./compactionTelemetry";
11
10
  import { type InferenceRecorder } from "./inference-attempt";
11
+ import { type ClaudeThinkingEffort } from "./models";
12
+ import { type ReasoningProviderOptions, type ReasoningSetting } from "./reasoning";
12
13
  import { type AIAuthConfig } from "./utils";
13
14
  /**
14
15
  * Whether tool-call repair must fail closed (no argument synthesis) for a tool.
@@ -16,15 +17,15 @@ import { type AIAuthConfig } from "./utils";
16
17
  */
17
18
  export declare function isRepairFailClosedTool(toolName: string): boolean;
18
19
  export type AIModel = AnthropicMessagesModelId | OpenAIChatModelId | string;
19
- export type OpenAIReasoningEffort = "none" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
20
+ export type OpenAIReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
20
21
  export declare const DEFAULT_OPENAI_REASONING_EFFORT: OpenAIReasoningEffort;
21
22
  /**
22
23
  * Anthropic adaptive-thinking effort hint. Soft guidance for how much the model
23
- * reasons (see AWS "adaptive thinking"): `low` minimizes thinking, `max`
24
- * reasons hardest (`high` is the model default). Only meaningful for models that
25
- * support adaptive thinking (Claude Opus/Sonnet 4.6+); ignored elsewhere.
24
+ * reasons (see AWS "adaptive thinking"): `low` minimizes thinking while
25
+ * `xhigh` and `max` allow progressively deeper work. Only meaningful for
26
+ * models that support adaptive thinking; ignored elsewhere.
26
27
  */
27
- export type ThinkingEffort = "low" | "medium" | "high" | "xhigh" | "max";
28
+ export type ThinkingEffort = ClaudeThinkingEffort;
28
29
  /** Per-step billing context attached to a usage report, attributing cost to a specific `(sessionId, stepSeq)`. */
29
30
  export interface UsageStepContext {
30
31
  sessionId?: string;
@@ -126,6 +127,7 @@ declare function createToolExecutionGate(): {
126
127
  type: string;
127
128
  toolCallId?: string;
128
129
  toolName?: string;
130
+ preliminary?: boolean;
129
131
  }) => void;
130
132
  };
131
133
  export interface ModelInfo {
@@ -135,61 +137,14 @@ export interface ModelInfo {
135
137
  contextLength?: number;
136
138
  }
137
139
  export declare function modelRequiresThinking(modelId: string): boolean;
138
- /**
139
- * Check whether a model supports extended thinking based on its ID.
140
- *
141
- * Thinking is available on Claude 3.7 Sonnet and all Claude 4.x+ models
142
- * (Sonnet, Opus, Haiku 4.5). Works for Anthropic direct, Bedrock, and
143
- * Pensar provider IDs.
144
- */
145
140
  export declare function modelSupportsThinking(modelId: string): boolean;
146
- /**
147
- * Whether a model accepts the `adaptive` thinking type — Claude Opus 4.6+ and
148
- * Sonnet 4.6+. Pre-4.6 models (Opus 4.0–4.5, Sonnet 4.5, Haiku 4.5) support
149
- * extended thinking but reject `adaptive`, so we don't request thinking for
150
- * them at all.
151
- */
152
141
  export declare function modelSupportsAdaptiveThinking(modelId: string): boolean;
153
142
  export declare function modelSupportsOpenAIReasoning(modelId: string): boolean;
154
143
  export declare function modelRequiresReasoning(modelId: string): boolean;
155
144
  export declare function getOpenAIReasoningEfforts(modelId: string): OpenAIReasoningEffort[];
156
145
  export declare function normalizeOpenAIReasoningEffort(modelId: string, effort?: OpenAIReasoningEffort | null): OpenAIReasoningEffort | undefined;
157
- /**
158
- * Provider-specific options passed to `streamText` to request reasoning /
159
- * extended thinking. Each provider reads only its own namespace:
160
- * - `anthropic.thinking` — direct Anthropic provider AND the Pensar gateway
161
- * (the gateway formatter maps it to the Bedrock `thinking` field).
162
- * - `bedrock.reasoningConfig` — the AWS Bedrock provider; it ignores the
163
- * `anthropic` namespace entirely, so Anthropic-on-Bedrock thinking is only
164
- * requested when this key is present. `display: 'summarized'` makes the
165
- * model actually return reasoning text (adaptive can otherwise omit it).
166
- * - `openai.reasoningEffort` — OpenAI/o-series reasoning models.
167
- */
168
- export type ReasoningProviderOptions = {
169
- openrouter?: {
170
- reasoning: {
171
- effort: OpenAIReasoningEffort;
172
- enabled?: boolean;
173
- };
174
- };
175
- anthropic?: {
176
- thinking: {
177
- type: "adaptive";
178
- display?: "summarized";
179
- } | {
180
- type: "disabled";
181
- };
182
- effort?: ThinkingEffort;
183
- };
184
- bedrock?: {
185
- reasoningConfig: {
186
- type: "adaptive";
187
- display: "summarized";
188
- maxReasoningEffort?: ThinkingEffort;
189
- };
190
- };
191
- openai?: OpenAIResponsesProviderOptions;
192
- };
146
+ export type { ReasoningProviderOptions } from "./reasoning";
147
+ export declare function mergeProviderOptions(...options: Array<ReasoningProviderOptions | undefined>): ReasoningProviderOptions | undefined;
193
148
  export type OpenRouterProviderOptions = {
194
149
  openrouter?: {
195
150
  provider: {
@@ -210,25 +165,13 @@ export declare function buildOpenRouterProviderOptions(model: AIModel): OpenRout
210
165
  * endpoint that enforces it rather than silently returning unparseable output.
211
166
  */
212
167
  export declare function buildOpenRouterStructuredProviderOptions(model: AIModel): OpenRouterProviderOptions | undefined;
213
- /**
214
- * Build the `providerOptions` for a request based on the model and reasoning
215
- * settings. Returns `undefined` when no reasoning/thinking is requested.
216
- *
217
- * When thinking is enabled for an Anthropic-family model we set BOTH the
218
- * `anthropic` and `bedrock` keys: the resolved provider (direct Anthropic,
219
- * Pensar gateway, or Bedrock) reads only its own namespace and ignores the
220
- * other, so this is safe across all three and avoids brittle provider
221
- * branching here.
222
- */
223
168
  export declare function buildReasoningProviderOptions(model: AIModel, opts: {
169
+ reasoning?: ReasoningSetting;
224
170
  enableThinking?: boolean;
225
- /**
226
- * Adaptive-thinking effort hint for Anthropic models that support it
227
- * (Opus/Sonnet 4.6+). Ignored on models without adaptive support. When
228
- * omitted the model uses its own default (`high`).
229
- */
230
171
  thinkingEffort?: ThinkingEffort | null;
231
172
  openAIReasoningEffort?: OpenAIReasoningEffort | null;
173
+ customProviders?: import("../config/customProviders").CustomProviders;
174
+ maxOutputTokens?: number;
232
175
  }): ReasoningProviderOptions | undefined;
233
176
  /** Cache token metrics extracted from Anthropic providerMetadata */
234
177
  export interface CacheMetrics {
@@ -236,6 +179,12 @@ export interface CacheMetrics {
236
179
  cacheCreationInputTokens: number;
237
180
  }
238
181
  export interface StreamResponseOpts {
182
+ /** Disables model repair and general recovery; compaction requires explicit admission. */
183
+ primaryModelOnly?: boolean;
184
+ runContextCompaction?: <T>(work: () => Promise<T>) => Promise<T>;
185
+ /** Session-local working state restored after compaction. */
186
+ getContinuationContext?: () => string;
187
+ onInvalidToolCall?: (name: string) => void;
239
188
  prompt: string;
240
189
  system?: string;
241
190
  model: AIModel;
@@ -262,6 +211,11 @@ export interface StreamResponseOpts {
262
211
  * new messages (not the full pre-summarization history).
263
212
  */
264
213
  onSummarized?: (summary: string) => void;
214
+ /** The fitted context and prior generated-message count for transcript writers. */
215
+ onContextPrepared?: (context: {
216
+ messages: ModelMessage[];
217
+ responseMessageOffset: number;
218
+ }) => void;
265
219
  /**
266
220
  * Deprecated host shim: fires only when a cache counter is `> 0`.
267
221
  * Apex internals read cache from {@link normalizeStepUsage} on the step.
@@ -276,6 +230,7 @@ export interface StreamResponseOpts {
276
230
  thinkingEffort?: ThinkingEffort | null;
277
231
  /** OpenAI reasoning effort for GPT/o-series reasoning models. */
278
232
  openAIReasoningEffort?: OpenAIReasoningEffort | null;
233
+ reasoning?: ReasoningSetting;
279
234
  /** Session root path — used by context management layers to persist truncated tool results */
280
235
  sessionPath?: string;
281
236
  /** Session id (`ses_…`) of the agent making this call; stamped onto AI-span telemetry so traces are filterable by session. */
@@ -296,6 +251,9 @@ export interface StreamResponseOpts {
296
251
  last?: CompactionLink;
297
252
  };
298
253
  _compactionTrigger?: CompactionTrigger;
254
+ _proactiveSummaryMayFit?: boolean;
255
+ _proactiveSummaryFailures?: number;
256
+ _initialPrompt?: string;
299
257
  }
300
258
  export declare function streamResponse(opts: StreamResponseOpts): StreamTextResult<ToolSet, never>;
301
259
  export interface GenerateObjectOpts<T extends z.ZodType> {
@@ -306,6 +264,7 @@ export interface GenerateObjectOpts<T extends z.ZodType> {
306
264
  maxTokens?: number;
307
265
  temperature?: number;
308
266
  openAIReasoningEffort?: OpenAIReasoningEffort | null;
267
+ reasoning?: ReasoningSetting;
309
268
  authConfig?: AIAuthConfig;
310
269
  abortSignal?: AbortSignal;
311
270
  onTokenUsage?: (inputTokens: number, outputTokens: number) => void;
@@ -23,17 +23,18 @@ import {
23
23
  modelRequiresReasoning2,
24
24
  getOpenAIReasoningEfforts2,
25
25
  normalizeOpenAIReasoningEffort2,
26
+ mergeProviderOptions2,
26
27
  buildOpenRouterProviderOptions2,
27
28
  buildOpenRouterStructuredProviderOptions2,
28
29
  buildReasoningProviderOptions2,
29
30
  streamResponse2,
30
31
  generateObjectResponse2,
31
32
  ContextLengthExhaustedError2
32
- } from "../../chunk-ba41jh41.js";
33
+ } from "../../chunk-eh5yw385.js";
33
34
  import"../../chunk-8vhr65w3.js";
34
- import"../../chunk-2njv7wz3.js";
35
+ import"../../chunk-hbyxyxdc.js";
35
36
  import"../../chunk-jdjagvgr.js";
36
- import"../../chunk-w66ce82a.js";
37
+ import"../../chunk-e3agqspc.js";
37
38
  export {
38
39
  ContextLengthExhaustedError2 as ContextLengthExhaustedError,
39
40
  DEFAULT_OPENAI_REASONING_EFFORT2 as DEFAULT_OPENAI_REASONING_EFFORT,
@@ -49,6 +50,7 @@ export {
49
50
  getOpenAIReasoningEfforts2 as getOpenAIReasoningEfforts,
50
51
  getStreamIdleTimeoutMs2 as getStreamIdleTimeoutMs,
51
52
  isRepairFailClosedTool2 as isRepairFailClosedTool,
53
+ mergeProviderOptions2 as mergeProviderOptions,
52
54
  modelRequiresReasoning2 as modelRequiresReasoning,
53
55
  modelRequiresThinking2 as modelRequiresThinking,
54
56
  modelSupportsAdaptiveThinking2 as modelSupportsAdaptiveThinking,
@@ -6,5 +6,6 @@ export { addRecentModelId, getRecentModels, MAX_RECENT_MODELS, } from "./model-h
6
6
  export { AVAILABLE_MODELS, getClaudeCapabilities, getModelInfo, } from "./models";
7
7
  export type { CreateNativeRolloutEvidenceCaptureInput, NativeRolloutCaptureLimits, NativeRolloutCaptureReportV1, NativeRolloutEvidenceCapture, NativeRolloutEvidenceEnvelopeV1, NativeRolloutEvidenceSink, NativeRolloutModelContext, } from "./native-rollout-evidence";
8
8
  export { createNativeRolloutEvidenceCapture, DEFAULT_NATIVE_ROLLOUT_CAPTURE_LIMITS, runWithNativeRolloutSession, serializeNativeRolloutEvidence, stringifyCanonicalJson, toJsonValue, } from "./native-rollout-evidence";
9
+ export { getModelSettings, getReasoningCapabilities, getReasoningChoices, REASONING_SETTINGS, type ReasoningCapabilities, type ReasoningEffort, type ReasoningSetting, resolveReasoningSetting, validateReasoningSetting, } from "./reasoning";
9
10
  export type { AIAuthConfig } from "./utils";
10
11
  export { buildAuthConfig } from "./utils";
@@ -12,6 +12,12 @@ import {
12
12
  DEFAULT_NATIVE_ROLLOUT_CAPTURE_LIMITS2,
13
13
  createNativeRolloutEvidenceCapture2,
14
14
  runWithNativeRolloutSession2,
15
+ REASONING_SETTINGS2,
16
+ resolveReasoningSetting2,
17
+ getModelSettings2,
18
+ getReasoningCapabilities2,
19
+ getReasoningChoices2,
20
+ validateReasoningSetting2,
15
21
  buildAuthConfig2,
16
22
  DEFAULT_OPENAI_REASONING_EFFORT2,
17
23
  onUsage2,
@@ -31,17 +37,18 @@ import {
31
37
  MAX_RECENT_MODELS2,
32
38
  addRecentModelId2,
33
39
  getRecentModels2
34
- } from "../../chunk-ba41jh41.js";
40
+ } from "../../chunk-eh5yw385.js";
35
41
  import"../../chunk-8vhr65w3.js";
36
- import"../../chunk-2njv7wz3.js";
42
+ import"../../chunk-hbyxyxdc.js";
37
43
  import"../../chunk-jdjagvgr.js";
38
- import"../../chunk-w66ce82a.js";
44
+ import"../../chunk-e3agqspc.js";
39
45
  export {
40
46
  AVAILABLE_MODELS2 as AVAILABLE_MODELS,
41
47
  DEFAULT_NATIVE_ROLLOUT_CAPTURE_LIMITS2 as DEFAULT_NATIVE_ROLLOUT_CAPTURE_LIMITS,
42
48
  DEFAULT_OPENAI_REASONING_EFFORT2 as DEFAULT_OPENAI_REASONING_EFFORT,
43
49
  InferenceAttemptSchema2 as InferenceAttemptSchema,
44
50
  MAX_RECENT_MODELS2 as MAX_RECENT_MODELS,
51
+ REASONING_SETTINGS2 as REASONING_SETTINGS,
45
52
  addRecentModelId2 as addRecentModelId,
46
53
  buildAuthConfig2 as buildAuthConfig,
47
54
  buildReasoningProviderOptions2 as buildReasoningProviderOptions,
@@ -51,7 +58,10 @@ export {
51
58
  getContextWindow2 as getContextWindow,
52
59
  getInferenceRecorder2 as getInferenceRecorder,
53
60
  getModelInfo2 as getModelInfo,
61
+ getModelSettings2 as getModelSettings,
54
62
  getOpenAIReasoningEfforts2 as getOpenAIReasoningEfforts,
63
+ getReasoningCapabilities2 as getReasoningCapabilities,
64
+ getReasoningChoices2 as getReasoningChoices,
55
65
  getRecentModels2 as getRecentModels,
56
66
  modelRequiresReasoning2 as modelRequiresReasoning,
57
67
  modelRequiresThinking2 as modelRequiresThinking,
@@ -62,11 +72,13 @@ export {
62
72
  normalizeStepUsage2 as normalizeStepUsage,
63
73
  onUsage2 as onUsage,
64
74
  parseInferenceAttempt2 as parseInferenceAttempt,
75
+ resolveReasoningSetting2 as resolveReasoningSetting,
65
76
  runWithInferenceRecorder2 as runWithInferenceRecorder,
66
77
  runWithNativeRolloutSession2 as runWithNativeRolloutSession,
67
78
  runWithStepContext2 as runWithStepContext,
68
79
  serializeNativeRolloutEvidence2 as serializeNativeRolloutEvidence,
69
80
  streamResponse2 as streamResponse,
70
81
  stringifyCanonicalJson2 as stringifyCanonicalJson,
71
- toJsonValue2 as toJsonValue
82
+ toJsonValue2 as toJsonValue,
83
+ validateReasoningSetting2 as validateReasoningSetting
72
84
  };
@@ -1,6 +1,7 @@
1
- type ClaudeCapabilities = {
1
+ export type ClaudeThinkingEffort = "low" | "medium" | "high" | "xhigh" | "max";
2
+ export type ClaudeCapabilities = {
2
3
  alwaysOnThinking: boolean;
3
4
  bindsThinking?: boolean;
5
+ defaultEffort: ClaudeThinkingEffort;
4
6
  };
5
7
  export declare function getClaudeCapabilities(modelId: string): ClaudeCapabilities | undefined;
6
- export {};
@@ -1,2 +1,3 @@
1
1
  import type { ModelInfo } from "../ai";
2
+ export declare const CONCENTRATE_MAX_OUTPUT_TOKENS: Readonly<Record<string, number>>;
2
3
  export declare const CONCENTRATE_MODELS: ModelInfo[];
@@ -1,7 +1,7 @@
1
1
  import { type CustomProviders } from "../../config/customProviders";
2
2
  import { type HoonifyModel } from "../../hoonify";
3
3
  import type { AIModel, ModelInfo } from "../ai";
4
- export { getClaudeCapabilities } from "./claude-capabilities";
4
+ export { type ClaudeThinkingEffort, getClaudeCapabilities, } from "./claude-capabilities";
5
5
  export declare const AVAILABLE_MODELS: ModelInfo[];
6
6
  export declare function getModelInfo(model: AIModel): ModelInfo;
7
7
  /**
@@ -1,6 +1,7 @@
1
1
  import { type LanguageModelV3 } from "@ai-sdk/provider";
2
2
  export declare const CONCENTRATE_BASE_URL = "https://api.concentrate.ai/v1";
3
3
  export declare const CONCENTRATE_GLM_5_3_MODEL_ID = "concentrate:glm-5.3";
4
+ export declare const CONCENTRATE_REASONING_MODEL_IDS: ReadonlySet<string>;
4
5
  export type ConcentrateFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
5
6
  export declare function createConcentrateFetch(fetchFn?: ConcentrateFetch): ConcentrateFetch;
6
7
  export declare function createConcentrateModel(modelId: string, options: {