@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.
- package/build/{agent-ayreaj6z.js → agent-3g1b578v.js} +6 -5
- package/build/{agent-yby11zaq.js → agent-p8cezgbb.js} +7 -6
- package/build/{agent-runs-g37vkrjr.js → agent-runs-f86emmgg.js} +23 -20
- package/build/agent-vaq31je6.js +14 -0
- package/build/agent-vvdqga09.js +14 -0
- package/build/{apps-xn6km9yn.js → apps-3stwnmen.js} +16 -13
- package/build/{auth-d105wc64.js → auth-7md9kwda.js} +16 -13
- package/build/blackboxAgent-ct8bejef.js +14 -0
- package/build/{blackboxPentest-ps78v3w7.js → blackboxPentest-w2nr4md3.js} +21 -15
- package/build/{cli-c05y640n.js → cli-1j28cbhy.js} +1 -1
- package/build/{cli-d37a42dc.js → cli-2jz2jz06.js} +206 -90
- package/build/{cli-az3xq70v.js → cli-4a8dsz2k.js} +4 -4
- package/build/{cli-qgz1q9g5.js → cli-58781vcf.js} +1192 -1473
- package/build/{cli-gx71jcke.js → cli-7067zzeb.js} +1 -1
- package/build/{cli-3sp6nd8d.js → cli-81smmd5w.js} +5 -5
- package/build/{cli-k2nwxta0.js → cli-8b25dhky.js} +2 -2
- package/build/{cli-fy6vh2a7.js → cli-8sw5zpqz.js} +1 -1
- package/build/{cli-709rvekb.js → cli-cg3ypx5n.js} +14 -7
- package/build/{cli-dpsw2fe6.js → cli-e9v6zg6h.js} +40941 -40172
- package/build/cli-fjxmphg1.js +36 -0
- package/build/{cli-7eea4e2y.js → cli-gzb6qrzh.js} +31 -60
- package/build/{cli-65g6rcat.js → cli-khnf5xrf.js} +2 -1
- package/build/{cli-1ve18npr.js → cli-mdzt2e8j.js} +4 -2
- package/build/{cli-n2en7j5b.js → cli-n8mmw4c4.js} +1 -1
- package/build/cli-pndb7mh9.js +1193 -0
- package/build/cli-px6ehzqx.js +54 -0
- package/build/{cli-xtc2t6me.js → cli-qs4msn6x.js} +111 -47
- package/build/{cli-kb21qhvm.js → cli-rvybdhgn.js} +4 -3
- package/build/{cli-ae8jqxqr.js → cli-v739h7hb.js} +2 -2
- package/build/{cli-ngq9dr8n.js → cli-wm8ech0x.js} +3 -3
- package/build/cli.js +170 -51
- package/build/{config-zpqkd5cz.js → config-e5v1bkh1.js} +1 -1
- package/build/{fastStrike-mcjdvwez.js → fastStrike-efp0rjs3.js} +74 -17
- package/build/{fixes-kytx5dmj.js → fixes-926cw1ej.js} +16 -13
- package/build/{index-n65z6v7b.js → index-3t41p258.js} +7 -6
- package/build/{index-qv4cc65p.js → index-bv09af6g.js} +19 -15
- package/build/{index-je6hcsqr.js → index-bv6dtwse.js} +1 -1
- package/build/{index-4vqdgb42.js → index-jt52ffgn.js} +1657 -1400
- package/build/{index-ns4m4s01.js → index-np405b9e.js} +11 -7
- package/build/{index-r9yjkfrv.js → index-qys178kp.js} +5 -4
- package/build/{index-wqetp6gq.js → index-tpyzq2wq.js} +42 -11
- package/build/{index-fv64eb32.js → index-vrcdyebh.js} +2 -2
- package/build/{index-dr3tg1w3.js → index-z1g8vbtm.js} +1 -1
- package/build/{issues-eb3q9d3a.js → issues-sncyqh14.js} +16 -13
- package/build/{knowledge-fqsvtx0f.js → knowledge-esgvy5ws.js} +16 -13
- package/build/lance-sacfgs1z.js +232 -0
- package/build/lib/{chunk-9yksqgzr.js → chunk-4aevegnc.js} +77 -45
- package/build/lib/{chunk-9tt2021m.js → chunk-4kf4a15q.js} +13 -13
- package/build/lib/{chunk-fy3bbbqy.js → chunk-5avnedwm.js} +7 -1
- package/build/lib/{chunk-bb0ekhkw.js → chunk-5nz5tk3p.js} +76 -22
- package/build/lib/{chunk-4hwzqthr.js → chunk-7s8e5wrd.js} +3 -2
- package/build/lib/{chunk-yrnrbjes.js → chunk-85kpxwzs.js} +4 -2
- package/build/lib/{chunk-mg03jdmt.js → chunk-9jkzk9nc.js} +1 -1
- package/build/lib/{chunk-r4j8ybn9.js → chunk-9wwts6r6.js} +824 -77
- package/build/lib/{chunk-nhfax4gb.js → chunk-bxznzxdy.js} +5 -1
- package/build/lib/{chunk-r2dkp4tb.js → chunk-cqxm95md.js} +1 -1
- package/build/lib/{chunk-w66ce82a.js → chunk-e3agqspc.js} +12 -4
- package/build/lib/{chunk-ba41jh41.js → chunk-eh5yw385.js} +1137 -333
- package/build/lib/{chunk-1azdancq.js → chunk-ewc9r84m.js} +5 -1
- package/build/lib/{chunk-2njv7wz3.js → chunk-hbyxyxdc.js} +4 -0
- package/build/lib/{chunk-e8yy2k73.js → chunk-jhhwts6w.js} +28 -2
- package/build/lib/{chunk-1jvwqnem.js → chunk-kbxbd1kn.js} +108 -44
- package/build/lib/{chunk-7pwa92rn.js → chunk-mph5fvk7.js} +1 -1
- package/build/lib/chunk-psc23epq.js +107 -0
- package/build/lib/{chunk-acgbyf5h.js → chunk-qxad7qjd.js} +4 -2
- package/build/lib/{chunk-3c00n0cy.js → chunk-r0v3vvgm.js} +54 -33
- package/build/lib/{chunk-1yct6cra.js → chunk-rt13120a.js} +1 -1
- package/build/lib/{chunk-v3dk9j7k.js → chunk-sgya016v.js} +93 -22
- package/build/lib/{chunk-1fy8azee.js → chunk-txef92hq.js} +1 -1
- package/build/lib/{chunk-2qsq76xq.js → chunk-vcd90qrn.js} +189 -90
- package/build/lib/{chunk-7gjdygcx.js → chunk-vwr9w3ab.js} +2 -0
- package/build/lib/{chunk-z137x08b.js → chunk-wf6ak0m3.js} +92 -70
- package/build/lib/{chunk-xhdpgpkm.js → chunk-xft0ms9j.js} +2 -2
- package/build/lib/core/agents/agentRuntime.d.ts +3 -1
- package/build/lib/core/agents/defineAgent.d.ts +3 -2
- package/build/lib/core/agents/lance.d.ts +153 -0
- package/build/lib/core/agents/lanceJudge.d.ts +3 -0
- package/build/lib/core/agents/offSecAgent/index.d.ts +3 -1
- package/build/lib/core/agents/offSecAgent/index.js +16 -14
- package/build/lib/core/agents/offSecAgent/offensiveSecurityAgent.d.ts +4 -0
- package/build/lib/core/agents/offSecAgent/prompt.d.ts +3 -1
- package/build/lib/core/agents/offSecAgent/subagentSpawner.d.ts +18 -2
- package/build/lib/core/agents/offSecAgent/subagentSpawner.js +10 -8
- package/build/lib/core/agents/offSecAgent/toolExecutionContext.d.ts +3 -0
- package/build/lib/core/agents/offSecAgent/toolLifecycle.d.ts +1 -0
- package/build/lib/core/agents/offSecAgent/tools/index.js +10 -6
- package/build/lib/core/agents/offSecAgent/tools/listMemories.d.ts +11 -1
- package/build/lib/core/agents/offSecAgent/tools/reportError.d.ts +2 -1
- package/build/lib/core/agents/offSecAgent/tools/runPentestWorkflow.d.ts +20 -1
- package/build/lib/core/agents/offSecAgent/tools/spawnPentestAgent.d.ts +4 -7
- package/build/lib/core/agents/offSecAgent/tools/spawnPentestSwarm.d.ts +7 -1
- package/build/lib/core/agents/offSecAgent/tools/types.d.ts +6 -3
- package/build/lib/core/agents/offSecAgent/tools/whiteboxCandidates.d.ts +2 -2
- package/build/lib/core/agents/offSecAgent/types.d.ts +19 -3
- package/build/lib/core/agents/specialized/attackSurface/blackboxAgent.js +13 -13
- package/build/lib/core/agents/specialized/attackSurface/schemas.js +12 -12
- package/build/lib/core/agents/specialized/authenticationAgent/index.js +14 -14
- package/build/lib/core/agents/specialized/codeAgent/agent.js +13 -13
- package/build/lib/core/agents/specialized/codeAgent/prompts.d.ts +1 -0
- package/build/lib/core/agents/specialized/cvssScorer/index.d.ts +2 -1
- package/build/lib/core/agents/specialized/findingJudge/agent.js +11 -11
- package/build/lib/core/agents/specialized/findingJudge/index.d.ts +2 -1
- package/build/lib/core/agents/specialized/findingJudge/index.js +4 -4
- package/build/lib/core/agents/specialized/patching/index.js +14 -14
- package/build/lib/core/agents/specialized/pentest/agent.d.ts +18 -4
- package/build/lib/core/agents/specialized/pentest/agent.js +15 -13
- package/build/lib/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.d.ts +2 -1
- package/build/lib/core/agents/specialized/whiteboxAttackSurface/index.js +13 -13
- package/build/lib/core/ai/ai.d.ts +29 -70
- package/build/lib/core/ai/ai.js +5 -3
- package/build/lib/core/ai/index.d.ts +1 -0
- package/build/lib/core/ai/index.js +16 -4
- package/build/lib/core/ai/models/claude-capabilities.d.ts +3 -2
- package/build/lib/core/ai/models/concentrate.d.ts +1 -0
- package/build/lib/core/ai/models/index.d.ts +1 -1
- package/build/lib/core/ai/providers/concentrate.d.ts +1 -0
- package/build/lib/core/ai/reasoning.d.ts +44 -0
- package/build/lib/core/ai/utils.d.ts +2 -0
- package/build/lib/core/ai/utils.js +5 -3
- package/build/lib/core/api/index.d.ts +6 -0
- package/build/lib/core/api/index.js +32 -23
- package/build/lib/core/api/lance.d.ts +6 -0
- package/build/lib/core/api/offesecAgent.d.ts +1 -0
- package/build/lib/core/api/reasoning.d.ts +12 -0
- package/build/lib/core/api/targetedPentest.d.ts +1 -0
- package/build/lib/core/api/targetedPentest.js +14 -14
- package/build/lib/core/cli/reasoning.d.ts +4 -0
- package/build/lib/core/config/config.d.ts +10 -2
- package/build/lib/core/config/customProviders.d.ts +11 -0
- package/build/lib/core/config/index.js +1 -1
- package/build/lib/core/eventBus.js +1 -1
- package/build/lib/core/findings/registry.d.ts +3 -1
- package/build/lib/core/findings/registry.js +4 -4
- package/build/lib/core/observability/index.js +1 -1
- package/build/lib/core/observability/telemetry.d.ts +4 -0
- package/build/lib/core/session/index.d.ts +47 -0
- package/build/lib/core/session/index.js +6 -4
- package/build/lib/core/session/persistence.d.ts +7 -0
- package/build/lib/core/session/persistence.js +8 -4
- package/build/lib/core/tools/backends/index.js +1 -1
- package/build/lib/core/tools/backends/resolve.d.ts +1 -0
- package/build/lib/core/workflows/fastStrike.d.ts +3 -1
- package/build/lib/core/workflows/pentest.d.ts +12 -2
- package/build/lib/core/workflows/pentest.js +19 -19
- package/build/lib/core/workflows/seams.js +5 -5
- package/build/lib/core/workflows/threatModel.d.ts +1 -0
- package/build/lib/core/workflows/whiteboxAttackSurface.d.ts +6 -4
- package/build/lib/core/workflows/whiteboxAttackSurface.js +15 -15
- package/build/lib/index.js +25 -25
- package/build/{logs-x62b7hk1.js → logs-bcbjpjp6.js} +16 -13
- package/build/{native-rollout-evidence-c9yhfqcs.js → native-rollout-evidence-rph1774m.js} +5 -5
- package/build/offesecAgent-81h1p6ee.js +32 -0
- package/build/pentest-2q20q6n1.js +23 -0
- package/build/{pentests-e0f32aqx.js → pentests-jgw031mc.js} +16 -13
- package/build/recordedRunClient-6axj6fba.js +11 -0
- package/build/subagentSpawner-a861gvt0.js +12 -0
- package/build/targetedPentest-6yxznt7s.js +91 -0
- package/build/{targets-xj9g3q0z.js → targets-bjah19dp.js} +16 -13
- package/build/threatModel-739kpexm.js +24 -0
- package/build/{uninstall-7s784q4a.js → uninstall-yxrn9edt.js} +1 -1
- package/build/{upload-4gvhwmvr.js → upload-34ewrjp5.js} +4 -4
- package/build/{utils-cjrz64pc.js → utils-fzm66efw.js} +5 -5
- package/package.json +2 -1
- package/src/cli/issues.test.ts +17 -1
- package/src/cli/lance-verifier.test.ts +57 -0
- package/src/cli/lance-verifier.ts +73 -0
- package/src/cli/lance.test.ts +71 -0
- package/src/cli/lance.ts +48 -0
- package/src/cli.ts +109 -19
- package/src/core/agents/agentRuntime.test.ts +42 -0
- package/src/core/agents/agentRuntime.ts +7 -2
- package/src/core/agents/defineAgent.ts +3 -1
- package/src/core/agents/lance.test.ts +421 -0
- package/src/core/agents/lance.ts +701 -0
- package/src/core/agents/lanceJudge.test.ts +166 -0
- package/src/core/agents/lanceJudge.ts +115 -0
- package/src/core/agents/offSecAgent/index.ts +3 -0
- package/src/core/agents/offSecAgent/interruptedStepFinalization.test.ts +51 -0
- package/src/core/agents/offSecAgent/lance.test.ts +188 -0
- package/src/core/agents/offSecAgent/offensiveSecurityAgent.test.ts +92 -5
- package/src/core/agents/offSecAgent/offensiveSecurityAgent.ts +244 -41
- package/src/core/agents/offSecAgent/prompt.test.ts +46 -0
- package/src/core/agents/offSecAgent/prompt.ts +52 -8
- package/src/core/agents/offSecAgent/selectiveConstruction.publicPath.test.ts +38 -0
- package/src/core/agents/offSecAgent/selectiveConstruction.test.ts +64 -0
- package/src/core/agents/offSecAgent/subagentSpawner.hooks.test.ts +11 -3
- package/src/core/agents/offSecAgent/subagentSpawner.reasoning.test.ts +167 -0
- package/src/core/agents/offSecAgent/subagentSpawner.ts +82 -28
- package/src/core/agents/offSecAgent/toolExecutionContext.test.ts +230 -0
- package/src/core/agents/offSecAgent/toolExecutionContext.ts +56 -0
- package/src/core/agents/offSecAgent/toolLifecycle.ts +2 -0
- package/src/core/agents/offSecAgent/tools/delegateAuth.ts +4 -2
- package/src/core/agents/offSecAgent/tools/documentFinding.test.ts +9 -4
- package/src/core/agents/offSecAgent/tools/documentFinding.ts +10 -9
- package/src/core/agents/offSecAgent/tools/listMemories.test.ts +230 -0
- package/src/core/agents/offSecAgent/tools/listMemories.ts +73 -6
- package/src/core/agents/offSecAgent/tools/reportError.test.ts +6 -0
- package/src/core/agents/offSecAgent/tools/reportError.ts +10 -2
- package/src/core/agents/offSecAgent/tools/runAttackSurface.ts +7 -4
- package/src/core/agents/offSecAgent/tools/runPentestWorkflow.test.ts +57 -0
- package/src/core/agents/offSecAgent/tools/runPentestWorkflow.ts +21 -1
- package/src/core/agents/offSecAgent/tools/runWhiteboxScan.ts +5 -2
- package/src/core/agents/offSecAgent/tools/spawnCodingAgent.ts +50 -67
- package/src/core/agents/offSecAgent/tools/spawnPentestAgent.test.ts +79 -3
- package/src/core/agents/offSecAgent/tools/spawnPentestAgent.ts +36 -16
- package/src/core/agents/offSecAgent/tools/spawnPentestSwarm.ts +28 -5
- package/src/core/agents/offSecAgent/tools/threatModelGenerator.ts +4 -3
- package/src/core/agents/offSecAgent/tools/types.ts +12 -2
- package/src/core/agents/offSecAgent/tools/updateTask.ts +5 -1
- package/src/core/agents/offSecAgent/tools/whiteboxCandidates.ts +11 -4
- package/src/core/agents/offSecAgent/types.ts +22 -1
- package/src/core/agents/specialized/codeAgent/agent.test.ts +7 -0
- package/src/core/agents/specialized/codeAgent/agent.ts +9 -2
- package/src/core/agents/specialized/codeAgent/prompts.ts +6 -0
- package/src/core/agents/specialized/cvssScorer/index.test.ts +2 -1
- package/src/core/agents/specialized/cvssScorer/index.ts +3 -0
- package/src/core/agents/specialized/findingJudge/index.ts +6 -0
- package/src/core/agents/specialized/pentest/agent.test.ts +155 -0
- package/src/core/agents/specialized/pentest/agent.ts +181 -52
- package/src/core/agents/specialized/pentest/results.test.ts +59 -4
- package/src/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.concurrency.test.ts +59 -2
- package/src/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.hooks.test.ts +127 -0
- package/src/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.ts +74 -68
- package/src/core/ai/ai.durability-hooks.test.ts +25 -7
- package/src/core/ai/ai.lance.test.ts +581 -0
- package/src/core/ai/ai.operator-context.bench.test.ts +1390 -0
- package/src/core/ai/ai.recorded-context.test.ts +89 -8
- package/src/core/ai/ai.test.ts +81 -59
- package/src/core/ai/ai.ts +453 -327
- package/src/core/ai/compactionTelemetry.test.ts +69 -17
- package/src/core/ai/index.ts +11 -0
- package/src/core/ai/models/anthropic.ts +6 -0
- package/src/core/ai/models/bedrock.ts +18 -0
- package/src/core/ai/models/claude-capabilities.ts +29 -8
- package/src/core/ai/models/concentrate.ts +52 -0
- package/src/core/ai/models/index.ts +25 -4
- package/src/core/ai/models/models.test.ts +179 -7
- package/src/core/ai/models/openrouter-reasoning.json +219 -0
- package/src/core/ai/models/openrouter.ts +43 -1
- package/src/core/ai/providers/anthropic-models.test.ts +60 -1
- package/src/core/ai/providers/bedrock-models.test.ts +81 -0
- package/src/core/ai/providers/concentrate.test.ts +31 -0
- package/src/core/ai/providers/concentrate.ts +11 -0
- package/src/core/ai/providers/custom.test.ts +74 -0
- package/src/core/ai/providers/custom.ts +3 -1
- package/src/core/ai/providers/gateway-models.test.ts +16 -6
- package/src/core/ai/providers/pensarFormatters.ts +8 -1
- package/src/core/ai/reasoning.test.ts +313 -0
- package/src/core/ai/reasoning.ts +500 -0
- package/src/core/ai/streamIdleTimeout.test.ts +21 -0
- package/src/core/ai/utils.native-rollout-evidence.test.ts +21 -8
- package/src/core/ai/utils.ts +269 -163
- package/src/core/api/attackSurface.ts +1 -0
- package/src/core/api/blackboxPentest.ts +9 -1
- package/src/core/api/index.ts +17 -0
- package/src/core/api/lance.ts +23 -0
- package/src/core/api/offesecAgent.test.ts +51 -0
- package/src/core/api/offesecAgent.ts +15 -1
- package/src/core/api/reasoning.test.ts +213 -0
- package/src/core/api/reasoning.ts +44 -0
- package/src/core/api/recordedRun.loop.test.ts +5 -1
- package/src/core/api/targetedPentest.test.ts +14 -2
- package/src/core/api/targetedPentest.ts +52 -5
- package/src/core/cli/reasoning.test.ts +149 -0
- package/src/core/cli/reasoning.ts +95 -0
- package/src/core/config/config.test.ts +35 -0
- package/src/core/config/config.ts +11 -0
- package/src/core/config/customProviders.ts +21 -2
- package/src/core/eventBus.ts +1 -0
- package/src/core/findings/registry.test.ts +9 -1
- package/src/core/findings/registry.ts +6 -0
- package/src/core/observability/telemetry.test.ts +131 -79
- package/src/core/observability/telemetry.ts +5 -0
- package/src/core/runtime/sqliteRunObservation.test.ts +1 -1
- package/src/core/session/index.ts +38 -0
- package/src/core/session/persistence.test.ts +62 -0
- package/src/core/session/persistence.ts +56 -0
- package/src/core/tools/backends/resolve.ts +7 -0
- package/src/core/tools/backends/whiteboxJobs.test.ts +9 -8
- package/src/core/workflows/fastStrike.seams.test.ts +149 -0
- package/src/core/workflows/fastStrike.test.ts +18 -1
- package/src/core/workflows/fastStrike.ts +106 -11
- package/src/core/workflows/pentest.test.ts +104 -0
- package/src/core/workflows/pentest.ts +128 -7
- package/src/core/workflows/seams.test.ts +13 -0
- package/src/core/workflows/seams.ts +5 -1
- package/src/core/workflows/threatModel.ts +2 -0
- package/src/core/workflows/whiteboxAttackSurface.test.ts +74 -2
- package/src/core/workflows/whiteboxAttackSurface.ts +102 -73
- package/src/tui/command-registry.test.ts +12 -0
- package/src/tui/command-registry.ts +10 -0
- package/src/tui/components/chat/config-view.tsx +6 -10
- package/src/tui/components/chat/home-view.tsx +2 -2
- package/src/tui/components/chat/input-area.tsx +2 -2
- package/src/tui/components/chat/loading-indicator.tsx +20 -4
- package/src/tui/components/chat/message-list.tsx +1 -0
- package/src/tui/components/commands/__tests__/advanced-settings-lifecycle.tsx +164 -0
- package/src/tui/components/commands/advanced-settings.test.ts +34 -0
- package/src/tui/components/commands/advanced-settings.tsx +220 -31
- package/src/tui/components/commands/models-display.tsx +7 -1
- package/src/tui/components/model-picker/ModelPicker.tsx +65 -103
- package/src/tui/components/model-picker/ModelPickerDialog.tsx +8 -14
- package/src/tui/components/model-picker/__tests__/reasoning-control.tsx +162 -0
- package/src/tui/components/model-picker/reasoning-control.test.ts +15 -0
- package/src/tui/components/operator-dashboard/index.tsx +166 -50
- package/src/tui/components/operator-dashboard/logic.test.ts +144 -2
- package/src/tui/components/operator-dashboard/logic.ts +54 -3
- package/src/tui/components/operator-dashboard/run-events.test.ts +3 -1
- package/src/tui/components/shared/__tests__/tool-renderer-lifecycle.tsx +18 -0
- package/src/tui/components/shared/action-label.test.ts +9 -0
- package/src/tui/components/shared/compacting-icon.tsx +18 -0
- package/src/tui/components/shared/index.ts +1 -0
- package/src/tui/components/shared/tool-registry.ts +1 -0
- package/src/tui/components/shared/tool-renderer.tsx +21 -7
- package/src/tui/context/agent.tsx +32 -79
- package/src/tui/context/route.tsx +2 -0
- package/src/tui/index.tsx +1 -0
- package/src/tui/keybindings/registry.ts +2 -0
- package/build/agent-6w7egcf1.js +0 -13
- package/build/agent-9zx75feh.js +0 -13
- package/build/blackboxAgent-s56sgx9b.js +0 -13
- package/build/cli-g06s7edq.js +0 -11
- package/build/lib/chunk-z96pbjhd.js +0 -56
- package/build/offesecAgent-5whnpeta.js +0 -22
- package/build/pentest-e61hc38s.js +0 -22
- package/build/recordedRunClient-dp032c32.js +0 -11
- package/build/targetedPentest-rcbs4nvp.js +0 -57
- package/build/threatModel-jkxfa40s.js +0 -21
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
import {
|
|
2
|
-
collectCommand,
|
|
3
2
|
FindingsRegistry,
|
|
4
3
|
inMemoryRegistryProvider,
|
|
5
4
|
withFindingPersistedHook,
|
|
6
5
|
assertDepth,
|
|
7
6
|
inProcessSeams,
|
|
8
7
|
resolveItemHooks,
|
|
8
|
+
spawnBatch2,
|
|
9
|
+
inProcessSubagentSpawner2
|
|
10
|
+
} from "./cli-pndb7mh9.js";
|
|
11
|
+
import {
|
|
12
|
+
collectCommand,
|
|
9
13
|
toGrpcPentestContext,
|
|
10
14
|
grpcAuthorityTarget,
|
|
11
|
-
inProcessSubagentSpawner,
|
|
12
15
|
pLimit,
|
|
13
16
|
PLAN_MODE_TOOL_NAMES,
|
|
14
17
|
OffensiveSecurityAgent
|
|
15
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-58781vcf.js";
|
|
16
19
|
import {
|
|
17
20
|
BlackboxAttackSurfaceAgent2
|
|
18
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-8b25dhky.js";
|
|
19
22
|
import {
|
|
20
23
|
TargetedPentestAgent2,
|
|
21
24
|
buildPentestSystemPrompt2
|
|
22
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-qs4msn6x.js";
|
|
23
26
|
import {
|
|
24
27
|
buildPentestReport,
|
|
25
28
|
renderJson,
|
|
26
29
|
renderMarkdown,
|
|
27
30
|
REPORT_FILENAME_MD,
|
|
28
31
|
REPORT_FILENAME_JSON
|
|
29
|
-
} from "./cli-
|
|
32
|
+
} from "./cli-n8mmw4c4.js";
|
|
30
33
|
import {
|
|
31
34
|
CodeAgent2
|
|
32
|
-
} from "./cli-
|
|
35
|
+
} from "./cli-rvybdhgn.js";
|
|
33
36
|
import {
|
|
34
37
|
WHITEBOX_APPS_DISCOVERY_SYSTEM_PROMPT2,
|
|
35
38
|
WHITEBOX_ENDPOINT_DOCUMENTATION_SYSTEM_PROMPT,
|
|
@@ -38,19 +41,19 @@ import {
|
|
|
38
41
|
AppInfoSchema2,
|
|
39
42
|
AppsDiscoveryResultSchema2,
|
|
40
43
|
DiscoverySummarySchema2
|
|
41
|
-
} from "./cli-
|
|
44
|
+
} from "./cli-wm8ech0x.js";
|
|
42
45
|
import {
|
|
43
46
|
createThreatModelPrompt
|
|
44
47
|
} from "./cli-q126f6ef.js";
|
|
45
48
|
import {
|
|
46
49
|
hasToolCall,
|
|
47
50
|
init_dist,
|
|
48
|
-
scopedLogger,
|
|
49
|
-
init_lazyLogger,
|
|
50
51
|
init_session,
|
|
51
52
|
createLogger,
|
|
52
|
-
init_structured
|
|
53
|
-
|
|
53
|
+
init_structured,
|
|
54
|
+
scopedLogger,
|
|
55
|
+
init_lazyLogger
|
|
56
|
+
} from "./cli-e9v6zg6h.js";
|
|
54
57
|
import {
|
|
55
58
|
newSessionId,
|
|
56
59
|
init_id
|
|
@@ -262,6 +265,28 @@ function loadSubagentMessages(session, key) {
|
|
|
262
265
|
return [];
|
|
263
266
|
}
|
|
264
267
|
}
|
|
268
|
+
function loadSubagentReportedFindings(session, key) {
|
|
269
|
+
const snapshotPath = join2(session.rootPath, SUBAGENTS_DIR, `${key}.json`);
|
|
270
|
+
if (!existsSync2(snapshotPath))
|
|
271
|
+
return null;
|
|
272
|
+
try {
|
|
273
|
+
const data = JSON.parse(readFileSync2(snapshotPath, "utf-8"));
|
|
274
|
+
return data.status === "completed" && Array.isArray(data.reportedFindings) && data.reportedFindings.every((finding) => typeof finding === "string") ? data.reportedFindings : null;
|
|
275
|
+
} catch {
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function loadSubagentObjectiveResults(session, key) {
|
|
280
|
+
const snapshotPath = join2(session.rootPath, SUBAGENTS_DIR, `${key}.json`);
|
|
281
|
+
if (!existsSync2(snapshotPath))
|
|
282
|
+
return null;
|
|
283
|
+
try {
|
|
284
|
+
const data = JSON.parse(readFileSync2(snapshotPath, "utf-8"));
|
|
285
|
+
return data.status === "completed" && Array.isArray(data.objectiveResults) && data.objectiveResults.every((result) => result !== null && typeof result === "object" && typeof result.objective === "string" && typeof result.completed === "boolean" && (result.result === undefined || typeof result.result === "string")) ? data.objectiveResults : null;
|
|
286
|
+
} catch {
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
265
290
|
function saveSubagentData(session, data) {
|
|
266
291
|
const subagentsDir = join2(session.rootPath, SUBAGENTS_DIR);
|
|
267
292
|
mkdirSync(subagentsDir, { recursive: true });
|
|
@@ -287,6 +312,8 @@ function saveSubagentData(session, data) {
|
|
|
287
312
|
toolCallCount,
|
|
288
313
|
stepCount,
|
|
289
314
|
findingsCount: data.findingsCount ?? 0,
|
|
315
|
+
reportedFindings: data.reportedFindings,
|
|
316
|
+
objectiveResults: data.objectiveResults,
|
|
290
317
|
status: data.status,
|
|
291
318
|
error: data.error,
|
|
292
319
|
messages: data.messages,
|
|
@@ -734,7 +761,7 @@ This agent is responsible for **exactly one** endpoint. Do not document other en
|
|
|
734
761
|
4. Call \`response\` with \`{ endpointsDocumented: 1, summary: "<one-line summary>" }\`.
|
|
735
762
|
`;
|
|
736
763
|
}
|
|
737
|
-
|
|
764
|
+
function endpointDocumentationSpawnOptions(opts) {
|
|
738
765
|
const {
|
|
739
766
|
codebasePath,
|
|
740
767
|
app,
|
|
@@ -749,12 +776,11 @@ async function runEndpointDocumentationAgent(opts) {
|
|
|
749
776
|
onStepFinish,
|
|
750
777
|
onCacheMetrics,
|
|
751
778
|
openAIReasoningEffort,
|
|
779
|
+
reasoning,
|
|
752
780
|
enableThinking,
|
|
753
781
|
thinkingEffort,
|
|
754
782
|
projectThreatModel,
|
|
755
783
|
parentSubagentId,
|
|
756
|
-
agentLimiter,
|
|
757
|
-
subagentSpawner,
|
|
758
784
|
hooks,
|
|
759
785
|
mintChildId
|
|
760
786
|
} = opts;
|
|
@@ -767,8 +793,7 @@ async function runEndpointDocumentationAgent(opts) {
|
|
|
767
793
|
endpoint,
|
|
768
794
|
frameworks
|
|
769
795
|
});
|
|
770
|
-
|
|
771
|
-
const spawnChild = () => spawner.spawn({
|
|
796
|
+
return {
|
|
772
797
|
spec: {
|
|
773
798
|
type: "code",
|
|
774
799
|
codebasePath,
|
|
@@ -780,6 +805,7 @@ async function runEndpointDocumentationAgent(opts) {
|
|
|
780
805
|
attackSurfaceRegistry
|
|
781
806
|
},
|
|
782
807
|
runtime: {
|
|
808
|
+
findingPolicy: hooks?.findingPolicy,
|
|
783
809
|
model,
|
|
784
810
|
session,
|
|
785
811
|
authConfig,
|
|
@@ -787,12 +813,14 @@ async function runEndpointDocumentationAgent(opts) {
|
|
|
787
813
|
enableThinking,
|
|
788
814
|
thinkingEffort,
|
|
789
815
|
openAIReasoningEffort,
|
|
816
|
+
reasoning,
|
|
790
817
|
onStepFinish,
|
|
791
818
|
onCacheMetrics,
|
|
792
819
|
backends: hooks?.backends,
|
|
793
820
|
sandbox: hooks?.sandbox,
|
|
794
821
|
languageModelMiddleware: hooks?.languageModelMiddleware,
|
|
795
822
|
usageRecorder: hooks?.usageRecorder,
|
|
823
|
+
toolExecutionContext: hooks?.toolExecutionContext,
|
|
796
824
|
streamIdFactory: hooks?.streamIdFactory
|
|
797
825
|
},
|
|
798
826
|
subagentId,
|
|
@@ -805,26 +833,25 @@ async function runEndpointDocumentationAgent(opts) {
|
|
|
805
833
|
method: displayMethod,
|
|
806
834
|
path: endpoint.path
|
|
807
835
|
}
|
|
808
|
-
}
|
|
809
|
-
try {
|
|
810
|
-
await (agentLimiter ? agentLimiter(spawnChild) : spawnChild());
|
|
811
|
-
return true;
|
|
812
|
-
} catch (error) {
|
|
813
|
-
log3.error(`"${subagentId}" FAILED`, error instanceof Error ? error : undefined, { error: String(error) });
|
|
814
|
-
return false;
|
|
815
|
-
}
|
|
836
|
+
};
|
|
816
837
|
}
|
|
817
838
|
async function runAppEndpointDocumentation(opts) {
|
|
818
839
|
const { endpoints, ...shared } = opts;
|
|
819
840
|
if (endpoints.length === 0)
|
|
820
841
|
return;
|
|
821
|
-
const spawner = opts.subagentSpawner ??
|
|
842
|
+
const spawner = opts.subagentSpawner ?? inProcessSubagentSpawner2;
|
|
843
|
+
const requests = endpoints.map((endpoint) => endpointDocumentationSpawnOptions({ ...shared, endpoint }));
|
|
844
|
+
const results = await spawnBatch2(spawner, requests, {
|
|
845
|
+
concurrency: ENDPOINT_DOCUMENTATION_CONCURRENCY,
|
|
846
|
+
abortSignal: opts.abortSignal
|
|
847
|
+
}, opts.agentLimiter);
|
|
822
848
|
let anyFailed = false;
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
if (!ok)
|
|
849
|
+
for (const [index, result] of results.entries()) {
|
|
850
|
+
if (result.status === "rejected") {
|
|
826
851
|
anyFailed = true;
|
|
827
|
-
|
|
852
|
+
log3.error(`"${requests[index].subagentId}" FAILED`, result.reason instanceof Error ? result.reason : undefined, { error: String(result.reason) });
|
|
853
|
+
}
|
|
854
|
+
}
|
|
828
855
|
if (anyFailed) {
|
|
829
856
|
throw new Error(`One or more endpoint documentation agents failed for app ${opts.app.name}`);
|
|
830
857
|
}
|
|
@@ -7046,6 +7073,7 @@ async function runWhiteboxAttackSurfaceApp(app, appIndex, input) {
|
|
|
7046
7073
|
onStepFinish,
|
|
7047
7074
|
onCacheMetrics,
|
|
7048
7075
|
openAIReasoningEffort,
|
|
7076
|
+
reasoning,
|
|
7049
7077
|
enableThinking,
|
|
7050
7078
|
thinkingEffort,
|
|
7051
7079
|
projectThreatModel,
|
|
@@ -7062,59 +7090,73 @@ async function runWhiteboxAttackSurfaceApp(app, appIndex, input) {
|
|
|
7062
7090
|
const appNodeId = `app:${sanitizeName(app.name)}`;
|
|
7063
7091
|
const hooksForApp = resolveItemHooks(sharedHooks, seams, app, appIndex);
|
|
7064
7092
|
let failed = false;
|
|
7065
|
-
const
|
|
7093
|
+
const discoveryRequest = (type, objective) => {
|
|
7066
7094
|
const subagentId = mintChildId(TASK_TYPE_LABELS[type]);
|
|
7067
7095
|
log4.debug(`Phase 2: spawning agent id="${subagentId}" parent="${appNodeId}" (app="${app.name}", type=${type}, appType=${app.type})`);
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
}
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7096
|
+
return {
|
|
7097
|
+
spec: {
|
|
7098
|
+
type: "code",
|
|
7099
|
+
codebasePath,
|
|
7100
|
+
objective,
|
|
7101
|
+
system: WHITEBOX_DISCOVERY_SYSTEM_PROMPT2,
|
|
7102
|
+
excludeTools: ["document_app"],
|
|
7103
|
+
responseSchema: DiscoverySummarySchema2,
|
|
7104
|
+
projectThreatModel,
|
|
7105
|
+
attackSurfaceRegistry
|
|
7106
|
+
},
|
|
7107
|
+
runtime: {
|
|
7108
|
+
findingPolicy: hooksForApp.findingPolicy,
|
|
7109
|
+
model,
|
|
7110
|
+
session,
|
|
7111
|
+
authConfig,
|
|
7112
|
+
abortSignal,
|
|
7113
|
+
enableThinking,
|
|
7114
|
+
thinkingEffort,
|
|
7115
|
+
openAIReasoningEffort,
|
|
7116
|
+
reasoning,
|
|
7117
|
+
onStepFinish,
|
|
7118
|
+
onCacheMetrics,
|
|
7119
|
+
backends: hooksForApp.backends,
|
|
7120
|
+
sandbox: hooksForApp.sandbox,
|
|
7121
|
+
languageModelMiddleware: hooksForApp.languageModelMiddleware,
|
|
7122
|
+
usageRecorder: hooksForApp.usageRecorder,
|
|
7123
|
+
toolExecutionContext: hooksForApp.toolExecutionContext,
|
|
7124
|
+
streamIdFactory: hooksForApp.streamIdFactory
|
|
7125
|
+
},
|
|
7126
|
+
subagentId,
|
|
7127
|
+
subagentName: TASK_TYPE_LABELS[type],
|
|
7128
|
+
parentBus: eventBus,
|
|
7129
|
+
parentSubagentId: appNodeId,
|
|
7130
|
+
lifecycleInput: { app: app.name, type }
|
|
7131
|
+
};
|
|
7132
|
+
};
|
|
7133
|
+
const spawnDiscoveryAgents = async (requests) => {
|
|
7134
|
+
const results = await spawnBatch2(subagentSpawner ?? inProcessSubagentSpawner2, requests, {
|
|
7135
|
+
concurrency: requests.length,
|
|
7136
|
+
abortSignal
|
|
7137
|
+
}, agentLimiter);
|
|
7138
|
+
for (const [index, result] of results.entries()) {
|
|
7139
|
+
const subagentId = requests[index].subagentId;
|
|
7140
|
+
if (result.status === "rejected") {
|
|
7141
|
+
failed = true;
|
|
7142
|
+
log4.error(`Phase 2: agent "${subagentId}" FAILED`, result.reason instanceof Error ? result.reason : undefined, { error: String(result.reason) });
|
|
7143
|
+
} else {
|
|
7144
|
+
log4.debug(`Phase 2: agent "${subagentId}" completed`);
|
|
7145
|
+
}
|
|
7107
7146
|
}
|
|
7108
7147
|
};
|
|
7109
|
-
const
|
|
7110
|
-
|
|
7111
|
-
|
|
7148
|
+
const discoverPagesAndApi = () => spawnDiscoveryAgents([
|
|
7149
|
+
discoveryRequest("pages", buildPagesDiscoveryObjective(codebasePath, app)),
|
|
7150
|
+
discoveryRequest("apiEndpoints", buildApiEndpointsDiscoveryObjective(codebasePath, app))
|
|
7151
|
+
]);
|
|
7112
7152
|
try {
|
|
7113
7153
|
if (NON_SERVICE_TYPES.includes(app.type)) {
|
|
7114
|
-
await
|
|
7154
|
+
await spawnDiscoveryAgents([
|
|
7155
|
+
discoveryRequest("cloudResourceEndpoints", buildCloudResourceEndpointsObjective(codebasePath, app, environments))
|
|
7156
|
+
]);
|
|
7115
7157
|
} else if (!surfaceIntegrationEnabled) {
|
|
7116
7158
|
log4.debug(`${app.name}: legacy (surfaceIntegrationEnabled=false)`);
|
|
7117
|
-
await
|
|
7159
|
+
await discoverPagesAndApi();
|
|
7118
7160
|
} else {
|
|
7119
7161
|
const surfaceResult = mapAppWithSurface(join16(codebasePath, app.location), codebasePath, { isSingleAppRepo });
|
|
7120
7162
|
if (surfaceResult.mode === "surface") {
|
|
@@ -7133,6 +7175,7 @@ async function runWhiteboxAttackSurfaceApp(app, appIndex, input) {
|
|
|
7133
7175
|
onStepFinish,
|
|
7134
7176
|
onCacheMetrics,
|
|
7135
7177
|
openAIReasoningEffort,
|
|
7178
|
+
reasoning,
|
|
7136
7179
|
enableThinking,
|
|
7137
7180
|
thinkingEffort,
|
|
7138
7181
|
projectThreatModel,
|
|
@@ -7144,11 +7187,12 @@ async function runWhiteboxAttackSurfaceApp(app, appIndex, input) {
|
|
|
7144
7187
|
});
|
|
7145
7188
|
} else {
|
|
7146
7189
|
log4.debug(`${app.name}: fallback (${surfaceResult.reason})`);
|
|
7147
|
-
await
|
|
7190
|
+
await discoverPagesAndApi();
|
|
7148
7191
|
}
|
|
7149
7192
|
}
|
|
7150
|
-
} catch {
|
|
7193
|
+
} catch (error) {
|
|
7151
7194
|
failed = true;
|
|
7195
|
+
log4.error(`Phase 2: app "${app.name}" FAILED`, error instanceof Error ? error : undefined, { error: String(error), app: app.name });
|
|
7152
7196
|
}
|
|
7153
7197
|
eventBus?.emit("subagent-complete", {
|
|
7154
7198
|
subagentId: appNodeId,
|
|
@@ -7169,6 +7213,7 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
7169
7213
|
onStepFinish,
|
|
7170
7214
|
onCacheMetrics,
|
|
7171
7215
|
openAIReasoningEffort,
|
|
7216
|
+
reasoning,
|
|
7172
7217
|
enableThinking,
|
|
7173
7218
|
thinkingEffort,
|
|
7174
7219
|
domains,
|
|
@@ -7204,6 +7249,7 @@ Trace changed shared libraries, deleted files, and root/build/deployment configu
|
|
|
7204
7249
|
onStepFinish: (event) => onStepFinish?.(event),
|
|
7205
7250
|
onCacheMetrics,
|
|
7206
7251
|
openAIReasoningEffort,
|
|
7252
|
+
reasoning,
|
|
7207
7253
|
enableThinking,
|
|
7208
7254
|
thinkingEffort,
|
|
7209
7255
|
responseSchema: input.incremental ? IncrementalReconResultSchema : AppsDiscoveryResultSchema2,
|
|
@@ -7289,6 +7335,7 @@ Trace changed shared libraries, deleted files, and root/build/deployment configu
|
|
|
7289
7335
|
onStepFinish,
|
|
7290
7336
|
onCacheMetrics,
|
|
7291
7337
|
openAIReasoningEffort,
|
|
7338
|
+
reasoning,
|
|
7292
7339
|
enableThinking,
|
|
7293
7340
|
thinkingEffort,
|
|
7294
7341
|
projectThreatModel,
|
|
@@ -7927,6 +7974,7 @@ async function runPentestSwarmTarget(target, index, input) {
|
|
|
7927
7974
|
enableThinking,
|
|
7928
7975
|
thinkingEffort,
|
|
7929
7976
|
openAIReasoningEffort,
|
|
7977
|
+
reasoning,
|
|
7930
7978
|
display,
|
|
7931
7979
|
onError,
|
|
7932
7980
|
hooks: sharedHooks,
|
|
@@ -7937,8 +7985,22 @@ async function runPentestSwarmTarget(target, index, input) {
|
|
|
7937
7985
|
const entry = manifestEntries[index];
|
|
7938
7986
|
const subagentId = entry.id;
|
|
7939
7987
|
const subagentName = target.name ?? entry.name;
|
|
7940
|
-
if (completedIds.has(subagentId))
|
|
7941
|
-
|
|
7988
|
+
if (completedIds.has(subagentId)) {
|
|
7989
|
+
if (sharedHooks.findingPolicy !== "external")
|
|
7990
|
+
return null;
|
|
7991
|
+
const reportedFindings = loadSubagentReportedFindings(session, subagentId);
|
|
7992
|
+
const objectiveResults = loadSubagentObjectiveResults(session, subagentId);
|
|
7993
|
+
if (!reportedFindings || !objectiveResults) {
|
|
7994
|
+
throw new Error(`Cannot resume externally graded pentest: findings or objective results for completed agent ${subagentId} are unavailable`);
|
|
7995
|
+
}
|
|
7996
|
+
return {
|
|
7997
|
+
findings: [],
|
|
7998
|
+
reportedFindings,
|
|
7999
|
+
objectiveResults,
|
|
8000
|
+
findingsPath: session.findingsPath,
|
|
8001
|
+
pocsPath: session.pocsPath
|
|
8002
|
+
};
|
|
8003
|
+
}
|
|
7942
8004
|
const itemHooks = resolveItemHooks(sharedHooks, seams, target, index);
|
|
7943
8005
|
const childSignal = abortSignal && itemHooks.abortSignal ? AbortSignal.any([abortSignal, itemHooks.abortSignal]) : abortSignal ?? itemHooks.abortSignal;
|
|
7944
8006
|
const previousMessages = loadSubagentMessages(session, subagentId);
|
|
@@ -7990,6 +8052,7 @@ async function runPentestSwarmTarget(target, index, input) {
|
|
|
7990
8052
|
enableThinking,
|
|
7991
8053
|
thinkingEffort,
|
|
7992
8054
|
openAIReasoningEffort,
|
|
8055
|
+
reasoning,
|
|
7993
8056
|
display,
|
|
7994
8057
|
...itemHooks,
|
|
7995
8058
|
abortSignal: childSignal
|
|
@@ -8030,19 +8093,27 @@ async function runPentestSwarmTarget(target, index, input) {
|
|
|
8030
8093
|
enableThinking,
|
|
8031
8094
|
thinkingEffort,
|
|
8032
8095
|
openAIReasoningEffort,
|
|
8096
|
+
reasoning,
|
|
8033
8097
|
display,
|
|
8034
8098
|
...itemHooks,
|
|
8035
8099
|
abortSignal: childSignal
|
|
8036
8100
|
});
|
|
8037
8101
|
const result = await agent.consume();
|
|
8102
|
+
if (itemHooks.findingPolicy === "external" && (!Array.isArray(result.reportedFindings) || !Array.isArray(result.objectiveResults))) {
|
|
8103
|
+
throw new Error(`Externally graded pentest worker ${subagentId} ended without structured findings and objective results`);
|
|
8104
|
+
}
|
|
8038
8105
|
saveSubagentData(session, {
|
|
8039
8106
|
agentName: subagentId,
|
|
8040
8107
|
target: target.target,
|
|
8041
8108
|
objective: objectiveStr,
|
|
8042
8109
|
status: "completed",
|
|
8043
|
-
findingsCount: result.findings.length,
|
|
8110
|
+
findingsCount: result.reportedFindings?.length ?? result.findings.length,
|
|
8111
|
+
...itemHooks.findingPolicy === "external" ? {
|
|
8112
|
+
reportedFindings: result.reportedFindings,
|
|
8113
|
+
objectiveResults: result.objectiveResults
|
|
8114
|
+
} : {},
|
|
8044
8115
|
messages: [...previousMessages, ...lastMessages],
|
|
8045
|
-
systemPrompt: buildPentestSystemPrompt2(session),
|
|
8116
|
+
systemPrompt: buildPentestSystemPrompt2(session, "orchestrator", "default", undefined, undefined, itemHooks.findingPolicy),
|
|
8046
8117
|
userPrompt: agent.userPrompt
|
|
8047
8118
|
});
|
|
8048
8119
|
updateManifestEntryStatus(session, subagentId, "completed");
|
|
@@ -8060,7 +8131,7 @@ async function runPentestSwarmTarget(target, index, input) {
|
|
|
8060
8131
|
status: "failed",
|
|
8061
8132
|
error: error instanceof Error ? error.message : String(error),
|
|
8062
8133
|
messages: [...previousMessages, ...lastMessages],
|
|
8063
|
-
systemPrompt: buildPentestSystemPrompt2(session),
|
|
8134
|
+
systemPrompt: buildPentestSystemPrompt2(session, "orchestrator", "default", undefined, undefined, itemHooks.findingPolicy),
|
|
8064
8135
|
userPrompt: agent?.userPrompt ?? ""
|
|
8065
8136
|
});
|
|
8066
8137
|
updateManifestEntryStatus(session, subagentId, "failed");
|
|
@@ -8090,6 +8161,7 @@ async function runPentestSwarm2(input) {
|
|
|
8090
8161
|
enableThinking,
|
|
8091
8162
|
thinkingEffort,
|
|
8092
8163
|
openAIReasoningEffort,
|
|
8164
|
+
reasoning,
|
|
8093
8165
|
display,
|
|
8094
8166
|
subagentSpawner,
|
|
8095
8167
|
languageModelMiddleware,
|
|
@@ -8100,13 +8172,14 @@ async function runPentestSwarm2(input) {
|
|
|
8100
8172
|
} = input;
|
|
8101
8173
|
const seams = inputSeams ?? inProcessSeams({ fanOut: hooks?.subagentSpawner ?? subagentSpawner });
|
|
8102
8174
|
assertDepth(1, seams.limits);
|
|
8103
|
-
const spawner = subagentSpawner ??
|
|
8175
|
+
const spawner = subagentSpawner ?? inProcessSubagentSpawner2;
|
|
8104
8176
|
const sharedHooks = {
|
|
8105
8177
|
subagentSpawner: spawner,
|
|
8106
8178
|
languageModelMiddleware,
|
|
8107
8179
|
usageRecorder,
|
|
8108
8180
|
streamIdFactory,
|
|
8109
|
-
...hooks
|
|
8181
|
+
...hooks,
|
|
8182
|
+
findingPolicy: hooks?.findingPolicy ?? input.findingPolicy
|
|
8110
8183
|
};
|
|
8111
8184
|
const findingsRegistry = withFindingPersistedHook(rawFindingsRegistry, seams.hooks.onFindingPersisted);
|
|
8112
8185
|
const completedIds = getCompletedAgentIds(session);
|
|
@@ -8126,6 +8199,7 @@ async function runPentestSwarm2(input) {
|
|
|
8126
8199
|
enableThinking,
|
|
8127
8200
|
thinkingEffort,
|
|
8128
8201
|
openAIReasoningEffort,
|
|
8202
|
+
reasoning,
|
|
8129
8203
|
display,
|
|
8130
8204
|
onError,
|
|
8131
8205
|
hooks: sharedHooks,
|
|
@@ -8135,11 +8209,14 @@ async function runPentestSwarm2(input) {
|
|
|
8135
8209
|
};
|
|
8136
8210
|
const results = await seams.fanOut.spawnMany(targets, (target, index) => runPentestSwarmTarget(target, index, targetInput), { concurrency, abortSignal });
|
|
8137
8211
|
finalizeManifest(session, manifestEntries, results);
|
|
8212
|
+
if (sharedHooks.findingPolicy === "external" && results.some((result) => result === null)) {
|
|
8213
|
+
throw new Error("Externally graded pentest has an incomplete swarm target; findings cannot be aggregated");
|
|
8214
|
+
}
|
|
8138
8215
|
return results;
|
|
8139
8216
|
}
|
|
8140
8217
|
async function runPentestWorkflow2(input) {
|
|
8141
8218
|
if (input.fastStrike) {
|
|
8142
|
-
const { runFastStrike } = await import("./fastStrike-
|
|
8219
|
+
const { runFastStrike } = await import("./fastStrike-efp0rjs3.js");
|
|
8143
8220
|
return runFastStrike(input);
|
|
8144
8221
|
}
|
|
8145
8222
|
const {
|
|
@@ -8155,15 +8232,18 @@ async function runPentestWorkflow2(input) {
|
|
|
8155
8232
|
enableThinking,
|
|
8156
8233
|
thinkingEffort,
|
|
8157
8234
|
openAIReasoningEffort,
|
|
8235
|
+
reasoning,
|
|
8158
8236
|
prompt,
|
|
8159
8237
|
threatModel,
|
|
8160
8238
|
surfaceIntegrationEnabled
|
|
8161
8239
|
} = input;
|
|
8240
|
+
const findingPolicy = input.hooks?.findingPolicy ?? input.findingPolicy;
|
|
8162
8241
|
const seams = input.seams ?? inProcessSeams({
|
|
8163
8242
|
fanOut: input.hooks?.subagentSpawner ?? input.subagentSpawner,
|
|
8164
8243
|
registries: {
|
|
8165
8244
|
findings: () => FindingsRegistry.fromDirectory(session.findingsPath, {
|
|
8166
8245
|
model,
|
|
8246
|
+
reasoning,
|
|
8167
8247
|
authConfig,
|
|
8168
8248
|
abortSignal,
|
|
8169
8249
|
sessionId: session.id
|
|
@@ -8227,6 +8307,7 @@ ${combined}` : combined;
|
|
|
8227
8307
|
onStepFinish,
|
|
8228
8308
|
onCacheMetrics,
|
|
8229
8309
|
openAIReasoningEffort,
|
|
8310
|
+
reasoning,
|
|
8230
8311
|
surfaceIntegrationEnabled,
|
|
8231
8312
|
subagentSpawner: input.subagentSpawner,
|
|
8232
8313
|
hooks: {
|
|
@@ -8234,7 +8315,8 @@ ${combined}` : combined;
|
|
|
8234
8315
|
languageModelMiddleware: input.languageModelMiddleware,
|
|
8235
8316
|
usageRecorder: input.usageRecorder,
|
|
8236
8317
|
streamIdFactory: input.streamIdFactory,
|
|
8237
|
-
...input.hooks
|
|
8318
|
+
...input.hooks,
|
|
8319
|
+
findingPolicy
|
|
8238
8320
|
},
|
|
8239
8321
|
seams
|
|
8240
8322
|
});
|
|
@@ -8249,12 +8331,14 @@ ${combined}` : combined;
|
|
|
8249
8331
|
onStepFinish,
|
|
8250
8332
|
onCacheMetrics,
|
|
8251
8333
|
openAIReasoningEffort,
|
|
8334
|
+
reasoning,
|
|
8252
8335
|
hooks: {
|
|
8253
8336
|
subagentSpawner: input.subagentSpawner,
|
|
8254
8337
|
languageModelMiddleware: input.languageModelMiddleware,
|
|
8255
8338
|
usageRecorder: input.usageRecorder,
|
|
8256
8339
|
streamIdFactory: input.streamIdFactory,
|
|
8257
|
-
...input.hooks
|
|
8340
|
+
...input.hooks,
|
|
8341
|
+
findingPolicy
|
|
8258
8342
|
}
|
|
8259
8343
|
});
|
|
8260
8344
|
}
|
|
@@ -8270,6 +8354,16 @@ ${combined}` : combined;
|
|
|
8270
8354
|
throw new DOMException("Pentest aborted by user", "AbortError");
|
|
8271
8355
|
}
|
|
8272
8356
|
if (swarmTargets.length === 0) {
|
|
8357
|
+
if (findingPolicy === "external") {
|
|
8358
|
+
return {
|
|
8359
|
+
findings: [],
|
|
8360
|
+
reportedFindings: [],
|
|
8361
|
+
objectiveResults: [],
|
|
8362
|
+
findingsPath: session.findingsPath,
|
|
8363
|
+
pocsPath: session.pocsPath,
|
|
8364
|
+
reportPath: null
|
|
8365
|
+
};
|
|
8366
|
+
}
|
|
8273
8367
|
const report = buildPentestReport([], {
|
|
8274
8368
|
target,
|
|
8275
8369
|
model,
|
|
@@ -8293,9 +8387,12 @@ ${combined}` : combined;
|
|
|
8293
8387
|
});
|
|
8294
8388
|
const findingsRegistry = seams.registries.findings();
|
|
8295
8389
|
const completedCount = getCompletedAgentIds(session).size;
|
|
8296
|
-
|
|
8297
|
-
|
|
8390
|
+
let externalReportedFindings = [];
|
|
8391
|
+
let externalObjectiveResults = [];
|
|
8392
|
+
if (findingPolicy === "external" || completedCount < swarmTargets.length) {
|
|
8393
|
+
const swarmResults = await runPentestSwarm2({
|
|
8298
8394
|
targets: swarmTargets,
|
|
8395
|
+
findingPolicy,
|
|
8299
8396
|
model,
|
|
8300
8397
|
session,
|
|
8301
8398
|
authConfig,
|
|
@@ -8307,6 +8404,7 @@ ${combined}` : combined;
|
|
|
8307
8404
|
enableThinking,
|
|
8308
8405
|
thinkingEffort,
|
|
8309
8406
|
openAIReasoningEffort,
|
|
8407
|
+
reasoning,
|
|
8310
8408
|
subagentSpawner: input.subagentSpawner,
|
|
8311
8409
|
languageModelMiddleware: input.languageModelMiddleware,
|
|
8312
8410
|
usageRecorder: input.usageRecorder,
|
|
@@ -8314,10 +8412,26 @@ ${combined}` : combined;
|
|
|
8314
8412
|
hooks: input.hooks,
|
|
8315
8413
|
seams
|
|
8316
8414
|
});
|
|
8415
|
+
externalReportedFindings = swarmResults.flatMap((result) => result?.reportedFindings ?? []);
|
|
8416
|
+
externalObjectiveResults = swarmResults.flatMap((result) => result?.objectiveResults ?? []);
|
|
8317
8417
|
}
|
|
8318
8418
|
if (abortSignal?.aborted) {
|
|
8319
8419
|
throw new DOMException("Pentest aborted by user", "AbortError");
|
|
8320
8420
|
}
|
|
8421
|
+
if (findingPolicy === "external") {
|
|
8422
|
+
eventBus?.emit("workflow-phase-complete", {
|
|
8423
|
+
phase: "pentesting",
|
|
8424
|
+
summary: { findingsCount: externalReportedFindings.length }
|
|
8425
|
+
});
|
|
8426
|
+
return {
|
|
8427
|
+
findings: [],
|
|
8428
|
+
reportedFindings: externalReportedFindings,
|
|
8429
|
+
objectiveResults: externalObjectiveResults,
|
|
8430
|
+
findingsPath: session.findingsPath,
|
|
8431
|
+
pocsPath: session.pocsPath,
|
|
8432
|
+
reportPath: null
|
|
8433
|
+
};
|
|
8434
|
+
}
|
|
8321
8435
|
eventBus?.emit("workflow-phase-start", {
|
|
8322
8436
|
phase: "reporting",
|
|
8323
8437
|
label: "Report Generation"
|
|
@@ -8372,6 +8486,7 @@ async function runWhiteboxPhase(opts) {
|
|
|
8372
8486
|
onStepFinish: opts.onStepFinish,
|
|
8373
8487
|
onCacheMetrics: opts.onCacheMetrics,
|
|
8374
8488
|
openAIReasoningEffort: opts.openAIReasoningEffort,
|
|
8489
|
+
reasoning: opts.reasoning,
|
|
8375
8490
|
surfaceIntegrationEnabled: opts.surfaceIntegrationEnabled,
|
|
8376
8491
|
subagentSpawner: opts.subagentSpawner,
|
|
8377
8492
|
hooks: opts.hooks,
|
|
@@ -8405,7 +8520,8 @@ async function runBlackboxPhase(opts) {
|
|
|
8405
8520
|
opts.onStepFinish?.(e);
|
|
8406
8521
|
},
|
|
8407
8522
|
onCacheMetrics: opts.onCacheMetrics,
|
|
8408
|
-
openAIReasoningEffort: opts.openAIReasoningEffort
|
|
8523
|
+
openAIReasoningEffort: opts.openAIReasoningEffort,
|
|
8524
|
+
reasoning: opts.reasoning
|
|
8409
8525
|
};
|
|
8410
8526
|
const agent = new BlackboxAttackSurfaceAgent2(agentInput);
|
|
8411
8527
|
opts.eventBus?.emit("subagent-spawn", {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
scopedLogger,
|
|
3
|
-
init_lazyLogger,
|
|
4
2
|
createLogger,
|
|
5
|
-
init_structured
|
|
6
|
-
|
|
3
|
+
init_structured,
|
|
4
|
+
scopedLogger,
|
|
5
|
+
init_lazyLogger
|
|
6
|
+
} from "./cli-e9v6zg6h.js";
|
|
7
7
|
|
|
8
8
|
// src/core/integrations/wandb/client.ts
|
|
9
9
|
init_structured();
|