@pensar/apex 2.2.0 → 2.3.0-canary.15ec17ea
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-yayy5x2a.js → agent-00rjnxth.js} +7 -7
- package/build/agent-65jzj95h.js +19 -0
- package/build/{agent-q5hwjdtb.js → agent-q3yvg7qp.js} +9 -9
- package/build/{apps-0es69e2s.js → apps-f3snzs8b.js} +16 -16
- package/build/{auth-q73k9bh9.js → auth-5pqmq5x9.js} +32 -39
- package/build/authentication-cx4fr1jm.js +19 -0
- package/build/blackboxAgent-t4kd841t.js +19 -0
- package/build/{blackboxPentest-h28nykk5.js → blackboxPentest-bwj95jra.js} +14 -14
- package/build/{cli-51dkmt5p.js → cli-3b5rh4nn.js} +1 -1
- package/build/{cli-xbdn034b.js → cli-3q27f7wb.js} +4158 -102
- package/build/{cli-2jn8104w.js → cli-b27w98bz.js} +2 -2
- package/build/{cli-6kx46ck0.js → cli-ef2c0sm6.js} +216 -38
- package/build/{cli-1re2kv5v.js → cli-fkkkkf49.js} +3 -3
- package/build/{cli-tz9yg4ew.js → cli-nsc30rcx.js} +24 -8
- package/build/{cli-vgg6h2ax.js → cli-q7123drf.js} +1 -1
- package/build/{cli-7n43wz82.js → cli-sf878p6j.js} +5 -2
- package/build/{cli-xpn9tsw0.js → cli-v8q0djvy.js} +3 -3
- package/build/{cli-ptzy9ak5.js → cli-vbz5qm07.js} +1 -1
- package/build/{cli-s43t5ay0.js → cli-vfsxxnmr.js} +1 -1
- package/build/{cli-n114n8mk.js → cli-wp59e6eq.js} +2 -2
- package/build/{cli-7e5ad5js.js → cli-x5gd8b11.js} +2 -2
- package/build/{cli-1cf5vy5m.js → cli-x7tqybza.js} +60 -28
- package/build/{cli-4tc6888c.js → cli-xw6xh0c2.js} +51 -2
- package/build/{cli-yz80qkzn.js → cli-ycj65kyw.js} +6 -0
- package/build/{cli-knqx15w6.js → cli-ztk7j1rd.js} +2 -2
- package/build/{cli-1f636vzd.js → cli-ztvkmav5.js} +1 -1
- package/build/cli.js +42 -36
- package/build/{config-xcf7rc6x.js → config-4bxc6cvx.js} +3 -3
- package/build/{doctor-98zperf9.js → doctor-njjx9pc4.js} +7 -6
- package/build/{fastStrike-9tm6bedh.js → fastStrike-zcyrev2c.js} +34 -14
- package/build/{fixes-1dry8j61.js → fixes-4gsx59zz.js} +16 -16
- package/build/{index-f6ttv7np.js → index-05cb7ddj.js} +9 -5
- package/build/{index-34h2nb6x.js → index-0kd686e2.js} +3 -3
- package/build/{index-pxwwcefn.js → index-1swzf5ha.js} +9 -9
- package/build/{index-31rwrakh.js → index-kamp2pwf.js} +2 -2
- package/build/{index-6dbym5jy.js → index-nwx21gnf.js} +29 -12
- package/build/{index-0j880wqc.js → index-tesn1wem.js} +1106 -901
- package/build/{index-4hqbyzf5.js → index-vgp133kt.js} +8 -8
- package/build/{issues-wjakj8yy.js → issues-fdqzva1g.js} +44 -16
- package/build/{logs-ewyzcspy.js → logs-hy3kvx1m.js} +16 -16
- package/build/{offesecAgent-7m9smy0t.js → offesecAgent-x1ap18zc.js} +8 -8
- package/build/pentest-v886reb6.js +29 -0
- package/build/{pentests-1hcqjyk2.js → pentests-38363a42.js} +16 -16
- package/build/{targetedPentest-3x13kqvc.js → targetedPentest-td5hts5a.js} +9 -9
- package/build/{targets-nqz8w37e.js → targets-ys9ezcjn.js} +16 -16
- package/build/threatModel-8ygdfkqx.js +27 -0
- package/build/{uninstall-p1q5pkx2.js → uninstall-pszt5mdd.js} +1 -1
- package/build/{upload-x7etpfp4.js → upload-61bcszx8.js} +6 -6
- package/build/{utils-kw6yh5yn.js → utils-fhqds1ws.js} +11 -7
- package/package.json +1 -1
- package/build/agent-3cdfwxcd.js +0 -19
- package/build/authentication-tqx2brcv.js +0 -19
- package/build/blackboxAgent-d0smgqt7.js +0 -19
- package/build/pentest-1cb5t0dt.js +0 -29
- package/build/threatModel-7f02av7y.js +0 -27
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EvidenceFileEntrySchema
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-vbz5qm07.js";
|
|
4
4
|
import {
|
|
5
5
|
CweEntrySchema,
|
|
6
6
|
ValidatedCweEntrySchema,
|
|
7
7
|
hasCanonicalName
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-3q27f7wb.js";
|
|
9
9
|
import {
|
|
10
10
|
exports_external,
|
|
11
11
|
init_zod
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
init_auth,
|
|
5
5
|
init_constants,
|
|
6
6
|
signGatewayRequest
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-xw6xh0c2.js";
|
|
8
8
|
import {
|
|
9
9
|
AISDKError,
|
|
10
10
|
APICallError,
|
|
@@ -87,11 +87,11 @@ import {
|
|
|
87
87
|
import {
|
|
88
88
|
config,
|
|
89
89
|
init_config
|
|
90
|
-
} from "./cli-
|
|
90
|
+
} from "./cli-3b5rh4nn.js";
|
|
91
91
|
import {
|
|
92
92
|
getCurrentVersion,
|
|
93
93
|
init_installation
|
|
94
|
-
} from "./cli-
|
|
94
|
+
} from "./cli-ztvkmav5.js";
|
|
95
95
|
import {
|
|
96
96
|
__callDispose,
|
|
97
97
|
__commonJS,
|
|
@@ -8382,6 +8382,121 @@ var init_bedrock = __esm(() => {
|
|
|
8382
8382
|
];
|
|
8383
8383
|
});
|
|
8384
8384
|
|
|
8385
|
+
// src/core/ai/models/concentrate.ts
|
|
8386
|
+
var CONCENTRATE_MODELS;
|
|
8387
|
+
var init_concentrate = __esm(() => {
|
|
8388
|
+
CONCENTRATE_MODELS = [
|
|
8389
|
+
{
|
|
8390
|
+
id: "concentrate:claude-opus-4-6",
|
|
8391
|
+
name: "Claude Opus 4.6",
|
|
8392
|
+
provider: "concentrate",
|
|
8393
|
+
contextLength: 200000
|
|
8394
|
+
},
|
|
8395
|
+
{
|
|
8396
|
+
id: "concentrate:claude-sonnet-4-6",
|
|
8397
|
+
name: "Claude Sonnet 4.6",
|
|
8398
|
+
provider: "concentrate",
|
|
8399
|
+
contextLength: 200000
|
|
8400
|
+
},
|
|
8401
|
+
{
|
|
8402
|
+
id: "concentrate:claude-sonnet-4-5",
|
|
8403
|
+
name: "Claude Sonnet 4.5",
|
|
8404
|
+
provider: "concentrate",
|
|
8405
|
+
contextLength: 200000
|
|
8406
|
+
},
|
|
8407
|
+
{
|
|
8408
|
+
id: "concentrate:claude-haiku-4-5",
|
|
8409
|
+
name: "Claude Haiku 4.5",
|
|
8410
|
+
provider: "concentrate",
|
|
8411
|
+
contextLength: 200000
|
|
8412
|
+
},
|
|
8413
|
+
{
|
|
8414
|
+
id: "concentrate:gpt-5.6-sol",
|
|
8415
|
+
name: "GPT 5.6 Sol",
|
|
8416
|
+
provider: "concentrate",
|
|
8417
|
+
contextLength: 1050000
|
|
8418
|
+
},
|
|
8419
|
+
{
|
|
8420
|
+
id: "concentrate:gpt-5.6-terra",
|
|
8421
|
+
name: "GPT 5.6 Terra",
|
|
8422
|
+
provider: "concentrate",
|
|
8423
|
+
contextLength: 1050000
|
|
8424
|
+
},
|
|
8425
|
+
{
|
|
8426
|
+
id: "concentrate:gpt-5.6-luna",
|
|
8427
|
+
name: "GPT 5.6 Luna",
|
|
8428
|
+
provider: "concentrate",
|
|
8429
|
+
contextLength: 1050000
|
|
8430
|
+
},
|
|
8431
|
+
{
|
|
8432
|
+
id: "concentrate:gpt-5.5",
|
|
8433
|
+
name: "GPT 5.5",
|
|
8434
|
+
provider: "concentrate",
|
|
8435
|
+
contextLength: 1050000
|
|
8436
|
+
},
|
|
8437
|
+
{
|
|
8438
|
+
id: "concentrate:gpt-5.4",
|
|
8439
|
+
name: "GPT 5.4",
|
|
8440
|
+
provider: "concentrate",
|
|
8441
|
+
contextLength: 1050000
|
|
8442
|
+
},
|
|
8443
|
+
{
|
|
8444
|
+
id: "concentrate:gpt-5.3-codex",
|
|
8445
|
+
name: "GPT 5.3 Codex",
|
|
8446
|
+
provider: "concentrate",
|
|
8447
|
+
contextLength: 400000
|
|
8448
|
+
},
|
|
8449
|
+
{
|
|
8450
|
+
id: "concentrate:gemini-3.6-flash",
|
|
8451
|
+
name: "Gemini 3.6 Flash",
|
|
8452
|
+
provider: "concentrate",
|
|
8453
|
+
contextLength: 1048576
|
|
8454
|
+
},
|
|
8455
|
+
{
|
|
8456
|
+
id: "concentrate:gemini-3.1-pro-preview",
|
|
8457
|
+
name: "Gemini 3.1 Pro Preview",
|
|
8458
|
+
provider: "concentrate",
|
|
8459
|
+
contextLength: 1e6
|
|
8460
|
+
},
|
|
8461
|
+
{
|
|
8462
|
+
id: "concentrate:gemini-2.5-pro",
|
|
8463
|
+
name: "Gemini 2.5 Pro",
|
|
8464
|
+
provider: "concentrate",
|
|
8465
|
+
contextLength: 1e6
|
|
8466
|
+
},
|
|
8467
|
+
{
|
|
8468
|
+
id: "concentrate:deepseek-v3-2",
|
|
8469
|
+
name: "DeepSeek V3.2",
|
|
8470
|
+
provider: "concentrate",
|
|
8471
|
+
contextLength: 163840
|
|
8472
|
+
},
|
|
8473
|
+
{
|
|
8474
|
+
id: "concentrate:mistral-large-3",
|
|
8475
|
+
name: "Mistral Large 3",
|
|
8476
|
+
provider: "concentrate",
|
|
8477
|
+
contextLength: 256000
|
|
8478
|
+
},
|
|
8479
|
+
{
|
|
8480
|
+
id: "concentrate:kimi-k2-thinking",
|
|
8481
|
+
name: "Kimi K2 Thinking",
|
|
8482
|
+
provider: "concentrate",
|
|
8483
|
+
contextLength: 262144
|
|
8484
|
+
},
|
|
8485
|
+
{
|
|
8486
|
+
id: "concentrate:minimax-m2-7",
|
|
8487
|
+
name: "MiniMax M2.7",
|
|
8488
|
+
provider: "concentrate",
|
|
8489
|
+
contextLength: 204800
|
|
8490
|
+
},
|
|
8491
|
+
{
|
|
8492
|
+
id: "concentrate:glm-5",
|
|
8493
|
+
name: "GLM-5",
|
|
8494
|
+
provider: "concentrate",
|
|
8495
|
+
contextLength: 202800
|
|
8496
|
+
}
|
|
8497
|
+
];
|
|
8498
|
+
});
|
|
8499
|
+
|
|
8385
8500
|
// src/core/ai/models/google.ts
|
|
8386
8501
|
var GOOGLE_MODELS;
|
|
8387
8502
|
var init_google = __esm(() => {
|
|
@@ -9314,6 +9429,7 @@ var AVAILABLE_MODELS;
|
|
|
9314
9429
|
var init_models = __esm(() => {
|
|
9315
9430
|
init_anthropic();
|
|
9316
9431
|
init_bedrock();
|
|
9432
|
+
init_concentrate();
|
|
9317
9433
|
init_google();
|
|
9318
9434
|
init_inception();
|
|
9319
9435
|
init_mantle2();
|
|
@@ -9327,6 +9443,7 @@ var init_models = __esm(() => {
|
|
|
9327
9443
|
...BEDROCK_MODELS,
|
|
9328
9444
|
...MANTLE_MODELS,
|
|
9329
9445
|
...OPENROUTER_MODELS,
|
|
9446
|
+
...CONCENTRATE_MODELS,
|
|
9330
9447
|
...PENSAR_MODELS,
|
|
9331
9448
|
...INCEPTION_MODELS
|
|
9332
9449
|
];
|
|
@@ -45218,37 +45335,56 @@ var init_observability = __esm(() => {
|
|
|
45218
45335
|
});
|
|
45219
45336
|
|
|
45220
45337
|
// src/core/ai/caching.ts
|
|
45221
|
-
function
|
|
45338
|
+
function bedrockSupportsCachePoint(modelId) {
|
|
45339
|
+
const base = modelId.replace(/^(?:[a-z]{2,6}\.)?anthropic\./, "");
|
|
45340
|
+
return base.startsWith("claude-") && !BEDROCK_UNCACHEABLE_CLAUDE.test(base);
|
|
45341
|
+
}
|
|
45342
|
+
function cacheBreakpointFor(model) {
|
|
45343
|
+
const { provider } = getModelInfo(model);
|
|
45344
|
+
switch (provider) {
|
|
45345
|
+
case "anthropic":
|
|
45346
|
+
case "pensar":
|
|
45347
|
+
return ANTHROPIC_CACHE_CONTROL;
|
|
45348
|
+
case "bedrock":
|
|
45349
|
+
return bedrockSupportsCachePoint(model) ? BEDROCK_CACHE_POINT : undefined;
|
|
45350
|
+
default:
|
|
45351
|
+
return;
|
|
45352
|
+
}
|
|
45353
|
+
}
|
|
45354
|
+
function withCachedSystemPrompt(system, messages, breakpoint) {
|
|
45222
45355
|
return [
|
|
45223
45356
|
{
|
|
45224
45357
|
role: "system",
|
|
45225
45358
|
content: system,
|
|
45226
|
-
providerOptions:
|
|
45359
|
+
...breakpoint ? { providerOptions: breakpoint } : {}
|
|
45227
45360
|
},
|
|
45228
45361
|
...messages
|
|
45229
45362
|
];
|
|
45230
45363
|
}
|
|
45231
|
-
function withCachedLastMessage(messages) {
|
|
45232
|
-
if (messages.length === 0)
|
|
45364
|
+
function withCachedLastMessage(messages, breakpoint) {
|
|
45365
|
+
if (messages.length === 0 || !breakpoint)
|
|
45233
45366
|
return messages;
|
|
45234
45367
|
return messages.map((msg, i) => {
|
|
45235
45368
|
if (i === messages.length - 1) {
|
|
45236
|
-
|
|
45237
|
-
|
|
45238
|
-
|
|
45239
|
-
|
|
45240
|
-
|
|
45241
|
-
}
|
|
45242
|
-
};
|
|
45369
|
+
const merged = { ...msg.providerOptions };
|
|
45370
|
+
for (const [provider, options] of Object.entries(breakpoint)) {
|
|
45371
|
+
merged[provider] = { ...merged[provider], ...options };
|
|
45372
|
+
}
|
|
45373
|
+
return { ...msg, providerOptions: merged };
|
|
45243
45374
|
}
|
|
45244
45375
|
return msg;
|
|
45245
45376
|
});
|
|
45246
45377
|
}
|
|
45247
|
-
var ANTHROPIC_CACHE_CONTROL;
|
|
45378
|
+
var ANTHROPIC_CACHE_CONTROL, BEDROCK_CACHE_POINT, BEDROCK_UNCACHEABLE_CLAUDE;
|
|
45248
45379
|
var init_caching = __esm(() => {
|
|
45380
|
+
init_models();
|
|
45249
45381
|
ANTHROPIC_CACHE_CONTROL = {
|
|
45250
45382
|
anthropic: { cacheControl: { type: "ephemeral" } }
|
|
45251
45383
|
};
|
|
45384
|
+
BEDROCK_CACHE_POINT = {
|
|
45385
|
+
bedrock: { cachePoint: { type: "default" } }
|
|
45386
|
+
};
|
|
45387
|
+
BEDROCK_UNCACHEABLE_CLAUDE = /^claude-(?:v2|instant|3[-.])/;
|
|
45252
45388
|
});
|
|
45253
45389
|
|
|
45254
45390
|
// src/core/ai/contextManagement.ts
|
|
@@ -45953,7 +46089,7 @@ function streamResponse(opts) {
|
|
|
45953
46089
|
}
|
|
45954
46090
|
};
|
|
45955
46091
|
const providerModel = getProviderModel(model, authConfig);
|
|
45956
|
-
const
|
|
46092
|
+
const cacheBreakpoint = cacheBreakpointFor(model);
|
|
45957
46093
|
const systemWithToolPolicy = applySequentialToolCallPolicy(system, tools, model);
|
|
45958
46094
|
let fittedMessages = messages;
|
|
45959
46095
|
let proactiveFitFailed = false;
|
|
@@ -45980,11 +46116,11 @@ function streamResponse(opts) {
|
|
|
45980
46116
|
}
|
|
45981
46117
|
let effectiveSystem = systemWithToolPolicy;
|
|
45982
46118
|
let effectiveMessages = fittedMessages;
|
|
45983
|
-
if (
|
|
46119
|
+
if (cacheBreakpoint && systemWithToolPolicy) {
|
|
45984
46120
|
const baseMessages = fittedMessages ?? [
|
|
45985
46121
|
{ role: "user", content: prompt }
|
|
45986
46122
|
];
|
|
45987
|
-
effectiveMessages = withCachedSystemPrompt(systemWithToolPolicy, baseMessages);
|
|
46123
|
+
effectiveMessages = withCachedSystemPrompt(systemWithToolPolicy, baseMessages, cacheBreakpoint);
|
|
45988
46124
|
effectiveSystem = undefined;
|
|
45989
46125
|
}
|
|
45990
46126
|
const providerOptions = buildReasoningProviderOptions(model, {
|
|
@@ -46014,8 +46150,10 @@ function streamResponse(opts) {
|
|
|
46014
46150
|
maxOutputTokens: getMaxOutputTokens(model),
|
|
46015
46151
|
prepareStep: (opts2) => {
|
|
46016
46152
|
messagesContainer.current = opts2.messages;
|
|
46017
|
-
if (
|
|
46018
|
-
return {
|
|
46153
|
+
if (cacheBreakpoint) {
|
|
46154
|
+
return {
|
|
46155
|
+
messages: withCachedLastMessage(opts2.messages, cacheBreakpoint)
|
|
46156
|
+
};
|
|
46019
46157
|
}
|
|
46020
46158
|
return;
|
|
46021
46159
|
},
|
|
@@ -47127,7 +47265,7 @@ async function create2(input) {
|
|
|
47127
47265
|
if (normalizedConfig?.headers !== undefined) {
|
|
47128
47266
|
snapshotHeaders = { ...normalizedConfig.headers };
|
|
47129
47267
|
} else {
|
|
47130
|
-
const { config: appConfig } = await import("./index-
|
|
47268
|
+
const { config: appConfig } = await import("./index-0kd686e2.js");
|
|
47131
47269
|
const cfg = await appConfig.get();
|
|
47132
47270
|
snapshotHeaders = cfg.defaultHeaders ? { ...cfg.defaultHeaders } : { ...DEFAULT_HEADER_RECORD };
|
|
47133
47271
|
}
|
|
@@ -47238,17 +47376,21 @@ function hasOperatorState(session) {
|
|
|
47238
47376
|
const statePath = path2.join(session.rootPath, "messages.json");
|
|
47239
47377
|
return existsSync(statePath);
|
|
47240
47378
|
}
|
|
47241
|
-
function getResumeMessages(messages, limit =
|
|
47379
|
+
function getResumeMessages(messages, limit = RESUME_MESSAGE_WINDOW) {
|
|
47242
47380
|
if (messages.length <= limit)
|
|
47243
47381
|
return messages;
|
|
47244
|
-
|
|
47382
|
+
const roughCutIndex = messages.length - limit;
|
|
47383
|
+
let cutIndex = roughCutIndex;
|
|
47245
47384
|
while (cutIndex < messages.length) {
|
|
47246
47385
|
if (messages[cutIndex].role === "user")
|
|
47247
47386
|
break;
|
|
47248
47387
|
cutIndex++;
|
|
47249
47388
|
}
|
|
47250
47389
|
if (cutIndex >= messages.length) {
|
|
47251
|
-
cutIndex =
|
|
47390
|
+
cutIndex = roughCutIndex;
|
|
47391
|
+
while (cutIndex > 0 && messages[cutIndex].role !== "user") {
|
|
47392
|
+
cutIndex--;
|
|
47393
|
+
}
|
|
47252
47394
|
}
|
|
47253
47395
|
return messages.slice(cutIndex);
|
|
47254
47396
|
}
|
|
@@ -47303,7 +47445,8 @@ async function updateOperatorSettings(sessionId, settings) {
|
|
|
47303
47445
|
session.config.operatorSettings = {
|
|
47304
47446
|
initialMode: "manual",
|
|
47305
47447
|
requireApproval: true,
|
|
47306
|
-
enableSuggestions: true
|
|
47448
|
+
enableSuggestions: true,
|
|
47449
|
+
strikeMode: false
|
|
47307
47450
|
};
|
|
47308
47451
|
}
|
|
47309
47452
|
if (settings.initialMode !== undefined) {
|
|
@@ -47315,6 +47458,9 @@ async function updateOperatorSettings(sessionId, settings) {
|
|
|
47315
47458
|
if (settings.enableSuggestions !== undefined) {
|
|
47316
47459
|
session.config.operatorSettings.enableSuggestions = settings.enableSuggestions;
|
|
47317
47460
|
}
|
|
47461
|
+
if (settings.strikeMode !== undefined) {
|
|
47462
|
+
session.config.operatorSettings.strikeMode = settings.strikeMode;
|
|
47463
|
+
}
|
|
47318
47464
|
});
|
|
47319
47465
|
}
|
|
47320
47466
|
async function updateSessionHeaders(sessionId, headers) {
|
|
@@ -47344,7 +47490,7 @@ var DEFAULT_OUTCOME_GUIDANCE, EXFIL_OUTCOME_GUIDANCE, DEFAULT_HEADER_RECORD, Aut
|
|
|
47344
47490
|
} catch (e) {
|
|
47345
47491
|
console.error(e);
|
|
47346
47492
|
}
|
|
47347
|
-
}, RemoveMsgInput,
|
|
47493
|
+
}, RemoveMsgInput, RESUME_MESSAGE_WINDOW = 200, sessions;
|
|
47348
47494
|
var init_session = __esm(() => {
|
|
47349
47495
|
init_zod();
|
|
47350
47496
|
init_name();
|
|
@@ -47387,7 +47533,8 @@ var init_session = __esm(() => {
|
|
|
47387
47533
|
OperatorSettingsObject = zod_default.object({
|
|
47388
47534
|
initialMode: zod_default.enum(["plan", "manual", "auto"]).default("manual"),
|
|
47389
47535
|
requireApproval: zod_default.boolean().default(true),
|
|
47390
|
-
enableSuggestions: zod_default.boolean().default(true)
|
|
47536
|
+
enableSuggestions: zod_default.boolean().default(true),
|
|
47537
|
+
strikeMode: zod_default.boolean().optional()
|
|
47391
47538
|
});
|
|
47392
47539
|
EmailInboxConfigObject = zod_default.discriminatedUnion("provider", [
|
|
47393
47540
|
zod_default.object({
|
|
@@ -47422,6 +47569,14 @@ var init_session = __esm(() => {
|
|
|
47422
47569
|
username: zod_default.string(),
|
|
47423
47570
|
password: zod_default.string(),
|
|
47424
47571
|
tls: zod_default.boolean()
|
|
47572
|
+
}),
|
|
47573
|
+
zod_default.object({
|
|
47574
|
+
provider: zod_default.literal("http"),
|
|
47575
|
+
id: zod_default.string(),
|
|
47576
|
+
name: zod_default.string(),
|
|
47577
|
+
emailAddress: zod_default.string(),
|
|
47578
|
+
endpoint: zod_default.string(),
|
|
47579
|
+
token: zod_default.string()
|
|
47425
47580
|
})
|
|
47426
47581
|
]);
|
|
47427
47582
|
EmailIntegrationConfigObject = zod_default.object({
|
|
@@ -47842,6 +47997,24 @@ function hasCacheControl(part) {
|
|
|
47842
47997
|
const opts = part.providerOptions;
|
|
47843
47998
|
return !!opts?.anthropic?.cacheControl;
|
|
47844
47999
|
}
|
|
48000
|
+
function applyCacheControl(message) {
|
|
48001
|
+
if (typeof message.content === "string") {
|
|
48002
|
+
if (message.content === "")
|
|
48003
|
+
return;
|
|
48004
|
+
message.content = [
|
|
48005
|
+
{
|
|
48006
|
+
type: "text",
|
|
48007
|
+
text: message.content,
|
|
48008
|
+
cache_control: EPHEMERAL_CACHE_CONTROL
|
|
48009
|
+
}
|
|
48010
|
+
];
|
|
48011
|
+
return;
|
|
48012
|
+
}
|
|
48013
|
+
const last = message.content[message.content.length - 1];
|
|
48014
|
+
if (!last || last.type === "thinking")
|
|
48015
|
+
return;
|
|
48016
|
+
last.cache_control = EPHEMERAL_CACHE_CONTROL;
|
|
48017
|
+
}
|
|
47845
48018
|
function convertToAnthropicFormat(modelId, options) {
|
|
47846
48019
|
const messages = [];
|
|
47847
48020
|
let systemPrompt;
|
|
@@ -47852,7 +48025,6 @@ function convertToAnthropicFormat(modelId, options) {
|
|
|
47852
48025
|
systemPrompt = part.content;
|
|
47853
48026
|
systemHasCacheControl = hasCacheControl(part);
|
|
47854
48027
|
} else if (part.role === "user") {
|
|
47855
|
-
const partHasCache = hasCacheControl(part);
|
|
47856
48028
|
const text2 = part.content.map((c) => {
|
|
47857
48029
|
if (c.type === "text")
|
|
47858
48030
|
return c.text;
|
|
@@ -47860,16 +48032,7 @@ function convertToAnthropicFormat(modelId, options) {
|
|
|
47860
48032
|
return "[file]";
|
|
47861
48033
|
return "";
|
|
47862
48034
|
}).join("");
|
|
47863
|
-
|
|
47864
|
-
messages.push({
|
|
47865
|
-
role: "user",
|
|
47866
|
-
content: [
|
|
47867
|
-
{ type: "text", text: text2, cache_control: EPHEMERAL_CACHE_CONTROL }
|
|
47868
|
-
]
|
|
47869
|
-
});
|
|
47870
|
-
} else {
|
|
47871
|
-
messages.push({ role: "user", content: text2 });
|
|
47872
|
-
}
|
|
48035
|
+
messages.push({ role: "user", content: text2 });
|
|
47873
48036
|
} else if (part.role === "assistant") {
|
|
47874
48037
|
const assistantContent = part.content;
|
|
47875
48038
|
const hasStructuredParts = assistantContent.some((c) => c.type === "tool-call" || c.type === "reasoning");
|
|
@@ -47922,6 +48085,10 @@ function convertToAnthropicFormat(modelId, options) {
|
|
|
47922
48085
|
});
|
|
47923
48086
|
messages.push({ role: "user", content: toolResults });
|
|
47924
48087
|
}
|
|
48088
|
+
const pushed = messages[messages.length - 1];
|
|
48089
|
+
if (part.role !== "system" && pushed && hasCacheControl(part)) {
|
|
48090
|
+
applyCacheControl(pushed);
|
|
48091
|
+
}
|
|
47925
48092
|
}
|
|
47926
48093
|
}
|
|
47927
48094
|
if (options.responseFormat?.type === "json") {
|
|
@@ -48821,6 +48988,7 @@ function buildAuthConfig(cfg) {
|
|
|
48821
48988
|
openAiAPIKey: cfg.openAiAPIKey ?? undefined,
|
|
48822
48989
|
googleAPIKey: cfg.googleAPIKey ?? undefined,
|
|
48823
48990
|
openRouterAPIKey: cfg.openRouterAPIKey ?? undefined,
|
|
48991
|
+
concentrateAPIKey: cfg.concentrateAPIKey ?? undefined,
|
|
48824
48992
|
inceptionAPIKey: cfg.inceptionAPIKey ?? undefined,
|
|
48825
48993
|
pensarAPIKey: cfg.pensarAPIKey ?? undefined,
|
|
48826
48994
|
accessToken: cfg.accessToken ?? undefined,
|
|
@@ -48838,6 +49006,7 @@ function getProviderModel(model, authConfig) {
|
|
|
48838
49006
|
const anthropicAPIKey = authConfig?.anthropicAPIKey || process.env.ANTHROPIC_API_KEY;
|
|
48839
49007
|
const googleAPIKey = authConfig?.googleAPIKey || process.env.GOOGLE_GENERATIVE_AI_API_KEY;
|
|
48840
49008
|
const openRouterAPIKey = authConfig?.openRouterAPIKey || process.env.OPENROUTER_API_KEY;
|
|
49009
|
+
const concentrateAPIKey = authConfig?.concentrateAPIKey || process.env.CONCENTRATE_API_KEY;
|
|
48841
49010
|
const bedrockApiKey = authConfig?.bedrock?.apiKey || process.env.BEDROCK_API_KEY;
|
|
48842
49011
|
const bedrockAccessKeyId = authConfig?.bedrock?.accessKeyId || process.env.AWS_ACCESS_KEY_ID;
|
|
48843
49012
|
const bedrockSecretAccessKey = authConfig?.bedrock?.secretAccessKey || process.env.AWS_SECRET_ACCESS_KEY;
|
|
@@ -48861,6 +49030,15 @@ function getProviderModel(model, authConfig) {
|
|
|
48861
49030
|
providerModel = openrouter2(model);
|
|
48862
49031
|
break;
|
|
48863
49032
|
}
|
|
49033
|
+
case "concentrate": {
|
|
49034
|
+
const concentrate = createOpenAICompatible({
|
|
49035
|
+
name: "concentrate",
|
|
49036
|
+
apiKey: concentrateAPIKey,
|
|
49037
|
+
baseURL: "https://api.concentrate.ai/v1"
|
|
49038
|
+
});
|
|
49039
|
+
providerModel = concentrate(model.replace(/^concentrate:/, ""));
|
|
49040
|
+
break;
|
|
49041
|
+
}
|
|
48864
49042
|
case "inception": {
|
|
48865
49043
|
const inception = createOpenAICompatible({
|
|
48866
49044
|
name: "inception",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-3q27f7wb.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-vfsxxnmr.js";
|
|
7
7
|
import {
|
|
8
8
|
hasToolCall,
|
|
9
9
|
init_dist,
|
|
10
10
|
stepCountIs
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-ef2c0sm6.js";
|
|
12
12
|
|
|
13
13
|
// src/core/agents/specialized/attackSurface/blackboxAgent.ts
|
|
14
14
|
init_dist();
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BlackboxAttackSurfaceAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-fkkkkf49.js";
|
|
4
4
|
import {
|
|
5
5
|
REPORT_FILENAME_JSON,
|
|
6
6
|
REPORT_FILENAME_MD,
|
|
7
7
|
buildPentestReport,
|
|
8
8
|
renderJson,
|
|
9
9
|
renderMarkdown
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-b27w98bz.js";
|
|
11
11
|
import {
|
|
12
12
|
TargetedPentestAgent,
|
|
13
13
|
buildPentestSystemPrompt
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-wp59e6eq.js";
|
|
15
15
|
import {
|
|
16
16
|
CodeAgent
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-ztk7j1rd.js";
|
|
18
18
|
import {
|
|
19
19
|
AppsDiscoveryResultSchema,
|
|
20
20
|
DiscoverySummarySchema,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
WHITEBOX_APPS_DISCOVERY_SYSTEM_PROMPT,
|
|
23
23
|
WHITEBOX_DISCOVERY_SYSTEM_PROMPT,
|
|
24
24
|
WHITEBOX_ENDPOINT_DOCUMENTATION_SYSTEM_PROMPT
|
|
25
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-x5gd8b11.js";
|
|
26
26
|
import {
|
|
27
27
|
FindingsRegistry,
|
|
28
28
|
OffensiveSecurityAgent,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
pLimit,
|
|
32
32
|
runWithBoundedConcurrency,
|
|
33
33
|
toGrpcPentestContext
|
|
34
|
-
} from "./cli-
|
|
34
|
+
} from "./cli-3q27f7wb.js";
|
|
35
35
|
import {
|
|
36
36
|
createThreatModelPrompt
|
|
37
37
|
} from "./cli-fw5r7pfj.js";
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
init_structured,
|
|
46
46
|
newSessionId,
|
|
47
47
|
scopedLogger
|
|
48
|
-
} from "./cli-
|
|
48
|
+
} from "./cli-ef2c0sm6.js";
|
|
49
49
|
import {
|
|
50
50
|
__require
|
|
51
51
|
} from "./cli-8rxa073f.js";
|
|
@@ -7692,6 +7692,12 @@ async function runPentestSwarm(input) {
|
|
|
7692
7692
|
});
|
|
7693
7693
|
if (session.config?.requirePlan && session.config?.taskDriven && previousMessages.length === 0) {
|
|
7694
7694
|
try {
|
|
7695
|
+
eventBus?.emit("subagent-spawn", {
|
|
7696
|
+
subagentId: `${subagentId}-plan`,
|
|
7697
|
+
name: `${subagentName} (plan)`,
|
|
7698
|
+
input: { target: target.target, objectives: target.objectives },
|
|
7699
|
+
parentSubagentId: subagentId
|
|
7700
|
+
});
|
|
7695
7701
|
const executionTasksDir = join18(session.rootPath, "subagents", `${subagentId}-tasks`);
|
|
7696
7702
|
const planAgent = new OffensiveSecurityAgent({
|
|
7697
7703
|
system: PLAN_PHASE_SYSTEM_PROMPT,
|
|
@@ -7717,7 +7723,17 @@ async function runPentestSwarm(input) {
|
|
|
7717
7723
|
display
|
|
7718
7724
|
});
|
|
7719
7725
|
await planAgent.consume();
|
|
7726
|
+
eventBus?.emit("subagent-complete", {
|
|
7727
|
+
subagentId: `${subagentId}-plan`,
|
|
7728
|
+
status: "completed",
|
|
7729
|
+
parentSubagentId: subagentId
|
|
7730
|
+
});
|
|
7720
7731
|
} catch (planErr) {
|
|
7732
|
+
eventBus?.emit("subagent-complete", {
|
|
7733
|
+
subagentId: `${subagentId}-plan`,
|
|
7734
|
+
status: "failed",
|
|
7735
|
+
parentSubagentId: subagentId
|
|
7736
|
+
});
|
|
7721
7737
|
log5.warn(`Plan phase failed for ${subagentId}: ${planErr}`);
|
|
7722
7738
|
}
|
|
7723
7739
|
}
|
|
@@ -7786,7 +7802,7 @@ async function runPentestSwarm(input) {
|
|
|
7786
7802
|
}
|
|
7787
7803
|
async function runPentestWorkflow(input) {
|
|
7788
7804
|
if (input.fastStrike) {
|
|
7789
|
-
const { runFastStrike } = await import("./fastStrike-
|
|
7805
|
+
const { runFastStrike } = await import("./fastStrike-zcyrev2c.js");
|
|
7790
7806
|
return runFastStrike(input);
|
|
7791
7807
|
}
|
|
7792
7808
|
const {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCurrentVersion,
|
|
3
3
|
init_installation
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-ztvkmav5.js";
|
|
5
5
|
import {
|
|
6
6
|
__esm
|
|
7
7
|
} from "./cli-8rxa073f.js";
|
|
@@ -38,12 +38,14 @@ function applyEnvFallbacks(parsedConfig) {
|
|
|
38
38
|
...parsedConfig,
|
|
39
39
|
responsibleUseAccepted: parsedConfig.responsibleUseAccepted ?? false,
|
|
40
40
|
defaultHeaders: parsedConfig.defaultHeaders ?? DEFAULT_CONFIG.defaultHeaders,
|
|
41
|
+
strikeMode: parsedConfig.strikeMode ?? DEFAULT_CONFIG.strikeMode,
|
|
41
42
|
surfaceIntegrationEnabled: parsedConfig.surfaceIntegrationEnabled ?? parseBoolEnv(process.env.PENSAR_SURFACE_INTEGRATION),
|
|
42
43
|
version,
|
|
43
44
|
openAiAPIKey: parsedConfig.openAiAPIKey ?? process.env.OPENAI_API_KEY,
|
|
44
45
|
anthropicAPIKey: parsedConfig.anthropicAPIKey ?? process.env.ANTHROPIC_API_KEY,
|
|
45
46
|
googleAPIKey: parsedConfig.googleAPIKey ?? process.env.GOOGLE_GENERATIVE_AI_API_KEY,
|
|
46
47
|
openRouterAPIKey: parsedConfig.openRouterAPIKey ?? process.env.OPENROUTER_API_KEY,
|
|
48
|
+
concentrateAPIKey: parsedConfig.concentrateAPIKey ?? process.env.CONCENTRATE_API_KEY,
|
|
47
49
|
inceptionAPIKey: parsedConfig.inceptionAPIKey ?? process.env.INCEPTION_API_KEY,
|
|
48
50
|
bedrockAPIKey: parsedConfig.bedrockAPIKey ?? process.env.BEDROCK_API_KEY,
|
|
49
51
|
pensarAPIKey: parsedConfig.pensarAPIKey ?? process.env.PENSAR_API_KEY,
|
|
@@ -78,7 +80,8 @@ var init_config = __esm(() => {
|
|
|
78
80
|
init_installation();
|
|
79
81
|
DEFAULT_CONFIG = {
|
|
80
82
|
responsibleUseAccepted: false,
|
|
81
|
-
defaultHeaders: { "User-Agent": "pensar-apex" }
|
|
83
|
+
defaultHeaders: { "User-Agent": "pensar-apex" },
|
|
84
|
+
strikeMode: false
|
|
82
85
|
};
|
|
83
86
|
});
|
|
84
87
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-3q27f7wb.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-vfsxxnmr.js";
|
|
7
7
|
import {
|
|
8
8
|
createLogger,
|
|
9
9
|
hasToolCall,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
init_lazyLogger,
|
|
12
12
|
init_structured,
|
|
13
13
|
scopedLogger
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-ef2c0sm6.js";
|
|
15
15
|
|
|
16
16
|
// src/core/agents/specialized/authenticationAgent/agent.ts
|
|
17
17
|
init_dist();
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
createReportErrorTool,
|
|
6
6
|
isMemoryEnabled,
|
|
7
7
|
readPlan
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-3q27f7wb.js";
|
|
9
9
|
import {
|
|
10
10
|
createLogger,
|
|
11
11
|
hasToolCall,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
init_lazyLogger,
|
|
14
14
|
init_structured,
|
|
15
15
|
scopedLogger
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-ef2c0sm6.js";
|
|
17
17
|
import {
|
|
18
18
|
exports_external,
|
|
19
19
|
init_zod
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
EndpointTransportEnum,
|
|
3
3
|
GrpcEndpointMetadataSchema,
|
|
4
4
|
OffensiveSecurityAgent
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-3q27f7wb.js";
|
|
6
6
|
import {
|
|
7
7
|
hasToolCall,
|
|
8
8
|
init_dist
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-ef2c0sm6.js";
|
|
10
10
|
import {
|
|
11
11
|
exports_external,
|
|
12
12
|
init_zod,
|