@pensar/apex 2.2.0 → 2.3.0-canary.3f6d2a2b
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-2h0w8eta.js} +7 -7
- package/build/agent-95qsypnq.js +19 -0
- package/build/{agent-q5hwjdtb.js → agent-rktf0v3c.js} +9 -9
- package/build/{apps-0es69e2s.js → apps-rehs72t3.js} +17 -17
- package/build/{auth-q73k9bh9.js → auth-h5bjv1dp.js} +51 -40
- package/build/authentication-zqkagnvm.js +19 -0
- package/build/blackboxAgent-b799jbpa.js +19 -0
- package/build/{blackboxPentest-h28nykk5.js → blackboxPentest-gszetqnq.js} +14 -14
- package/build/{cli-s43t5ay0.js → cli-06fq5zym.js} +1 -1
- package/build/{cli-51dkmt5p.js → cli-0qybv29g.js} +1 -1
- package/build/{cli-1cf5vy5m.js → cli-2m8y1rkp.js} +60 -162
- package/build/{cli-6kx46ck0.js → cli-2q3kvbwv.js} +228 -39
- package/build/{cli-1f636vzd.js → cli-3e0jb8k6.js} +1 -1
- package/build/{cli-ptzy9ak5.js → cli-3r7xgtqj.js} +1 -1
- package/build/{cli-xpn9tsw0.js → cli-41h8gh1v.js} +34 -9
- package/build/{cli-1re2kv5v.js → cli-5asc7364.js} +3 -3
- package/build/{cli-knqx15w6.js → cli-7d3h16fw.js} +2 -2
- package/build/{cli-tz9yg4ew.js → cli-abm5bgap.js} +24 -8
- package/build/{cli-4tc6888c.js → cli-dth5et2y.js} +51 -2
- package/build/{cli-7n43wz82.js → cli-khyery65.js} +5 -2
- package/build/{cli-xbdn034b.js → cli-mb680jb3.js} +4517 -120
- package/build/{cli-vgg6h2ax.js → cli-pvf8tyr2.js} +1 -1
- package/build/{cli-7e5ad5js.js → cli-qs2mveb2.js} +2 -2
- package/build/{cli-n114n8mk.js → cli-s8z1mkv5.js} +2 -2
- package/build/{cli-2jn8104w.js → cli-xkv494x1.js} +2 -2
- package/build/{cli-yz80qkzn.js → cli-ycj65kyw.js} +6 -0
- package/build/cli.js +42 -36
- package/build/{config-xcf7rc6x.js → config-hawgse8e.js} +3 -3
- package/build/{doctor-98zperf9.js → doctor-t305mq12.js} +7 -6
- package/build/{fastStrike-9tm6bedh.js → fastStrike-mk0gxtkm.js} +34 -14
- package/build/{fixes-1dry8j61.js → fixes-gxn4cmte.js} +16 -16
- package/build/{index-4hqbyzf5.js → index-98bpwjq9.js} +16 -8
- package/build/{index-pxwwcefn.js → index-a2qb45hc.js} +9 -9
- package/build/{index-f6ttv7np.js → index-cpbhz85w.js} +9 -5
- package/build/{index-6dbym5jy.js → index-fa4xk0fq.js} +29 -12
- package/build/{index-31rwrakh.js → index-qqp08dtj.js} +2 -2
- package/build/{index-0j880wqc.js → index-ra8jmwb2.js} +1154 -909
- package/build/{index-34h2nb6x.js → index-yggyem63.js} +3 -3
- package/build/{issues-wjakj8yy.js → issues-mtbp80dr.js} +44 -16
- package/build/{logs-ewyzcspy.js → logs-0wpqqb3z.js} +16 -16
- package/build/{offesecAgent-7m9smy0t.js → offesecAgent-d5ceedmg.js} +8 -8
- package/build/pentest-2znknvqd.js +29 -0
- package/build/{pentests-1hcqjyk2.js → pentests-gnwwdmac.js} +16 -16
- package/build/{targetedPentest-3x13kqvc.js → targetedPentest-ap7p8j6q.js} +9 -9
- package/build/{targets-nqz8w37e.js → targets-be3c736k.js} +16 -16
- package/build/threatModel-bypv7mjx.js +27 -0
- package/build/{uninstall-p1q5pkx2.js → uninstall-71xttcr0.js} +1 -1
- package/build/{upload-x7etpfp4.js → upload-c7e0bdcn.js} +6 -6
- package/build/{utils-kw6yh5yn.js → utils-ef23ac3j.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
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
init_auth,
|
|
5
5
|
init_constants,
|
|
6
6
|
signGatewayRequest
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-dth5et2y.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-0qybv29g.js";
|
|
91
91
|
import {
|
|
92
92
|
getCurrentVersion,
|
|
93
93
|
init_installation
|
|
94
|
-
} from "./cli-
|
|
94
|
+
} from "./cli-3e0jb8k6.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
|
},
|
|
@@ -46468,6 +46606,11 @@ function toReference(stored) {
|
|
|
46468
46606
|
if (stored.tokens?.customHeaders) {
|
|
46469
46607
|
ref.customHeaderKeys = Object.keys(stored.tokens.customHeaders);
|
|
46470
46608
|
}
|
|
46609
|
+
if (stored.additionalFields) {
|
|
46610
|
+
const keys = Object.keys(stored.additionalFields);
|
|
46611
|
+
if (keys.length > 0)
|
|
46612
|
+
ref.additionalFieldKeys = keys;
|
|
46613
|
+
}
|
|
46471
46614
|
const ctx = stored.metadata?.context;
|
|
46472
46615
|
if (typeof ctx === "string" && ctx)
|
|
46473
46616
|
ref.context = ctx;
|
|
@@ -46478,7 +46621,7 @@ class CredentialManager {
|
|
|
46478
46621
|
store = new Map;
|
|
46479
46622
|
findDuplicate(candidate) {
|
|
46480
46623
|
for (const [id, existing] of this.store) {
|
|
46481
|
-
if (existing.username === candidate.username && existing.password === candidate.password && existing.apiKey === candidate.apiKey && existing.loginUrl === candidate.loginUrl && existing.tokens?.bearerToken === candidate.tokens?.bearerToken && existing.tokens?.cookies === candidate.tokens?.cookies && existing.tokens?.sessionToken === candidate.tokens?.sessionToken && JSON.stringify(existing.tokens?.customHeaders) === JSON.stringify(candidate.tokens?.customHeaders)) {
|
|
46624
|
+
if (existing.username === candidate.username && existing.password === candidate.password && existing.apiKey === candidate.apiKey && existing.loginUrl === candidate.loginUrl && existing.tokens?.bearerToken === candidate.tokens?.bearerToken && existing.tokens?.cookies === candidate.tokens?.cookies && existing.tokens?.sessionToken === candidate.tokens?.sessionToken && JSON.stringify(existing.tokens?.customHeaders) === JSON.stringify(candidate.tokens?.customHeaders) && JSON.stringify(existing.additionalFields) === JSON.stringify(candidate.additionalFields)) {
|
|
46482
46625
|
return id;
|
|
46483
46626
|
}
|
|
46484
46627
|
}
|
|
@@ -46576,6 +46719,9 @@ class CredentialManager {
|
|
|
46576
46719
|
if (ref.customHeaderKeys?.length) {
|
|
46577
46720
|
parts.push(` Header keys: ${ref.customHeaderKeys.join(", ")}`);
|
|
46578
46721
|
}
|
|
46722
|
+
if (ref.additionalFieldKeys?.length) {
|
|
46723
|
+
parts.push(` Additional secret fields: ${ref.additionalFieldKeys.join(", ")}`);
|
|
46724
|
+
}
|
|
46579
46725
|
if (ref.context)
|
|
46580
46726
|
parts.push(` Context: ${ref.context}`);
|
|
46581
46727
|
return parts.join(`
|
|
@@ -46584,6 +46730,9 @@ class CredentialManager {
|
|
|
46584
46730
|
return `<available_credentials>
|
|
46585
46731
|
The following credentials are available. To use a credential, pass its ID to the appropriate tool.
|
|
46586
46732
|
Do NOT ask the user for passwords or secrets — they are resolved automatically from the credential ID.
|
|
46733
|
+
"Additional secret fields" are operator-supplied named secrets: pass the name as "credentialField"
|
|
46734
|
+
to browser_fill, or read the matching environment variable in execute_command. Their values are
|
|
46735
|
+
never shown to you and are redacted from command output.
|
|
46587
46736
|
|
|
46588
46737
|
${lines.join(`
|
|
46589
46738
|
|
|
@@ -47127,7 +47276,7 @@ async function create2(input) {
|
|
|
47127
47276
|
if (normalizedConfig?.headers !== undefined) {
|
|
47128
47277
|
snapshotHeaders = { ...normalizedConfig.headers };
|
|
47129
47278
|
} else {
|
|
47130
|
-
const { config: appConfig } = await import("./index-
|
|
47279
|
+
const { config: appConfig } = await import("./index-yggyem63.js");
|
|
47131
47280
|
const cfg = await appConfig.get();
|
|
47132
47281
|
snapshotHeaders = cfg.defaultHeaders ? { ...cfg.defaultHeaders } : { ...DEFAULT_HEADER_RECORD };
|
|
47133
47282
|
}
|
|
@@ -47238,17 +47387,21 @@ function hasOperatorState(session) {
|
|
|
47238
47387
|
const statePath = path2.join(session.rootPath, "messages.json");
|
|
47239
47388
|
return existsSync(statePath);
|
|
47240
47389
|
}
|
|
47241
|
-
function getResumeMessages(messages, limit =
|
|
47390
|
+
function getResumeMessages(messages, limit = RESUME_MESSAGE_WINDOW) {
|
|
47242
47391
|
if (messages.length <= limit)
|
|
47243
47392
|
return messages;
|
|
47244
|
-
|
|
47393
|
+
const roughCutIndex = messages.length - limit;
|
|
47394
|
+
let cutIndex = roughCutIndex;
|
|
47245
47395
|
while (cutIndex < messages.length) {
|
|
47246
47396
|
if (messages[cutIndex].role === "user")
|
|
47247
47397
|
break;
|
|
47248
47398
|
cutIndex++;
|
|
47249
47399
|
}
|
|
47250
47400
|
if (cutIndex >= messages.length) {
|
|
47251
|
-
cutIndex =
|
|
47401
|
+
cutIndex = roughCutIndex;
|
|
47402
|
+
while (cutIndex > 0 && messages[cutIndex].role !== "user") {
|
|
47403
|
+
cutIndex--;
|
|
47404
|
+
}
|
|
47252
47405
|
}
|
|
47253
47406
|
return messages.slice(cutIndex);
|
|
47254
47407
|
}
|
|
@@ -47303,7 +47456,8 @@ async function updateOperatorSettings(sessionId, settings) {
|
|
|
47303
47456
|
session.config.operatorSettings = {
|
|
47304
47457
|
initialMode: "manual",
|
|
47305
47458
|
requireApproval: true,
|
|
47306
|
-
enableSuggestions: true
|
|
47459
|
+
enableSuggestions: true,
|
|
47460
|
+
strikeMode: false
|
|
47307
47461
|
};
|
|
47308
47462
|
}
|
|
47309
47463
|
if (settings.initialMode !== undefined) {
|
|
@@ -47315,6 +47469,9 @@ async function updateOperatorSettings(sessionId, settings) {
|
|
|
47315
47469
|
if (settings.enableSuggestions !== undefined) {
|
|
47316
47470
|
session.config.operatorSettings.enableSuggestions = settings.enableSuggestions;
|
|
47317
47471
|
}
|
|
47472
|
+
if (settings.strikeMode !== undefined) {
|
|
47473
|
+
session.config.operatorSettings.strikeMode = settings.strikeMode;
|
|
47474
|
+
}
|
|
47318
47475
|
});
|
|
47319
47476
|
}
|
|
47320
47477
|
async function updateSessionHeaders(sessionId, headers) {
|
|
@@ -47344,7 +47501,7 @@ var DEFAULT_OUTCOME_GUIDANCE, EXFIL_OUTCOME_GUIDANCE, DEFAULT_HEADER_RECORD, Aut
|
|
|
47344
47501
|
} catch (e) {
|
|
47345
47502
|
console.error(e);
|
|
47346
47503
|
}
|
|
47347
|
-
}, RemoveMsgInput,
|
|
47504
|
+
}, RemoveMsgInput, RESUME_MESSAGE_WINDOW = 200, sessions;
|
|
47348
47505
|
var init_session = __esm(() => {
|
|
47349
47506
|
init_zod();
|
|
47350
47507
|
init_name();
|
|
@@ -47387,7 +47544,8 @@ var init_session = __esm(() => {
|
|
|
47387
47544
|
OperatorSettingsObject = zod_default.object({
|
|
47388
47545
|
initialMode: zod_default.enum(["plan", "manual", "auto"]).default("manual"),
|
|
47389
47546
|
requireApproval: zod_default.boolean().default(true),
|
|
47390
|
-
enableSuggestions: zod_default.boolean().default(true)
|
|
47547
|
+
enableSuggestions: zod_default.boolean().default(true),
|
|
47548
|
+
strikeMode: zod_default.boolean().optional()
|
|
47391
47549
|
});
|
|
47392
47550
|
EmailInboxConfigObject = zod_default.discriminatedUnion("provider", [
|
|
47393
47551
|
zod_default.object({
|
|
@@ -47422,6 +47580,14 @@ var init_session = __esm(() => {
|
|
|
47422
47580
|
username: zod_default.string(),
|
|
47423
47581
|
password: zod_default.string(),
|
|
47424
47582
|
tls: zod_default.boolean()
|
|
47583
|
+
}),
|
|
47584
|
+
zod_default.object({
|
|
47585
|
+
provider: zod_default.literal("http"),
|
|
47586
|
+
id: zod_default.string(),
|
|
47587
|
+
name: zod_default.string(),
|
|
47588
|
+
emailAddress: zod_default.string(),
|
|
47589
|
+
endpoint: zod_default.string(),
|
|
47590
|
+
token: zod_default.string()
|
|
47425
47591
|
})
|
|
47426
47592
|
]);
|
|
47427
47593
|
EmailIntegrationConfigObject = zod_default.object({
|
|
@@ -47842,6 +48008,24 @@ function hasCacheControl(part) {
|
|
|
47842
48008
|
const opts = part.providerOptions;
|
|
47843
48009
|
return !!opts?.anthropic?.cacheControl;
|
|
47844
48010
|
}
|
|
48011
|
+
function applyCacheControl(message) {
|
|
48012
|
+
if (typeof message.content === "string") {
|
|
48013
|
+
if (message.content === "")
|
|
48014
|
+
return;
|
|
48015
|
+
message.content = [
|
|
48016
|
+
{
|
|
48017
|
+
type: "text",
|
|
48018
|
+
text: message.content,
|
|
48019
|
+
cache_control: EPHEMERAL_CACHE_CONTROL
|
|
48020
|
+
}
|
|
48021
|
+
];
|
|
48022
|
+
return;
|
|
48023
|
+
}
|
|
48024
|
+
const last = message.content[message.content.length - 1];
|
|
48025
|
+
if (!last || last.type === "thinking")
|
|
48026
|
+
return;
|
|
48027
|
+
last.cache_control = EPHEMERAL_CACHE_CONTROL;
|
|
48028
|
+
}
|
|
47845
48029
|
function convertToAnthropicFormat(modelId, options) {
|
|
47846
48030
|
const messages = [];
|
|
47847
48031
|
let systemPrompt;
|
|
@@ -47852,7 +48036,6 @@ function convertToAnthropicFormat(modelId, options) {
|
|
|
47852
48036
|
systemPrompt = part.content;
|
|
47853
48037
|
systemHasCacheControl = hasCacheControl(part);
|
|
47854
48038
|
} else if (part.role === "user") {
|
|
47855
|
-
const partHasCache = hasCacheControl(part);
|
|
47856
48039
|
const text2 = part.content.map((c) => {
|
|
47857
48040
|
if (c.type === "text")
|
|
47858
48041
|
return c.text;
|
|
@@ -47860,16 +48043,7 @@ function convertToAnthropicFormat(modelId, options) {
|
|
|
47860
48043
|
return "[file]";
|
|
47861
48044
|
return "";
|
|
47862
48045
|
}).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
|
-
}
|
|
48046
|
+
messages.push({ role: "user", content: text2 });
|
|
47873
48047
|
} else if (part.role === "assistant") {
|
|
47874
48048
|
const assistantContent = part.content;
|
|
47875
48049
|
const hasStructuredParts = assistantContent.some((c) => c.type === "tool-call" || c.type === "reasoning");
|
|
@@ -47922,6 +48096,10 @@ function convertToAnthropicFormat(modelId, options) {
|
|
|
47922
48096
|
});
|
|
47923
48097
|
messages.push({ role: "user", content: toolResults });
|
|
47924
48098
|
}
|
|
48099
|
+
const pushed = messages[messages.length - 1];
|
|
48100
|
+
if (part.role !== "system" && pushed && hasCacheControl(part)) {
|
|
48101
|
+
applyCacheControl(pushed);
|
|
48102
|
+
}
|
|
47925
48103
|
}
|
|
47926
48104
|
}
|
|
47927
48105
|
if (options.responseFormat?.type === "json") {
|
|
@@ -48821,6 +48999,7 @@ function buildAuthConfig(cfg) {
|
|
|
48821
48999
|
openAiAPIKey: cfg.openAiAPIKey ?? undefined,
|
|
48822
49000
|
googleAPIKey: cfg.googleAPIKey ?? undefined,
|
|
48823
49001
|
openRouterAPIKey: cfg.openRouterAPIKey ?? undefined,
|
|
49002
|
+
concentrateAPIKey: cfg.concentrateAPIKey ?? undefined,
|
|
48824
49003
|
inceptionAPIKey: cfg.inceptionAPIKey ?? undefined,
|
|
48825
49004
|
pensarAPIKey: cfg.pensarAPIKey ?? undefined,
|
|
48826
49005
|
accessToken: cfg.accessToken ?? undefined,
|
|
@@ -48838,6 +49017,7 @@ function getProviderModel(model, authConfig) {
|
|
|
48838
49017
|
const anthropicAPIKey = authConfig?.anthropicAPIKey || process.env.ANTHROPIC_API_KEY;
|
|
48839
49018
|
const googleAPIKey = authConfig?.googleAPIKey || process.env.GOOGLE_GENERATIVE_AI_API_KEY;
|
|
48840
49019
|
const openRouterAPIKey = authConfig?.openRouterAPIKey || process.env.OPENROUTER_API_KEY;
|
|
49020
|
+
const concentrateAPIKey = authConfig?.concentrateAPIKey || process.env.CONCENTRATE_API_KEY;
|
|
48841
49021
|
const bedrockApiKey = authConfig?.bedrock?.apiKey || process.env.BEDROCK_API_KEY;
|
|
48842
49022
|
const bedrockAccessKeyId = authConfig?.bedrock?.accessKeyId || process.env.AWS_ACCESS_KEY_ID;
|
|
48843
49023
|
const bedrockSecretAccessKey = authConfig?.bedrock?.secretAccessKey || process.env.AWS_SECRET_ACCESS_KEY;
|
|
@@ -48861,6 +49041,15 @@ function getProviderModel(model, authConfig) {
|
|
|
48861
49041
|
providerModel = openrouter2(model);
|
|
48862
49042
|
break;
|
|
48863
49043
|
}
|
|
49044
|
+
case "concentrate": {
|
|
49045
|
+
const concentrate = createOpenAICompatible({
|
|
49046
|
+
name: "concentrate",
|
|
49047
|
+
apiKey: concentrateAPIKey,
|
|
49048
|
+
baseURL: "https://api.concentrate.ai/v1"
|
|
49049
|
+
});
|
|
49050
|
+
providerModel = concentrate(model.replace(/^concentrate:/, ""));
|
|
49051
|
+
break;
|
|
49052
|
+
}
|
|
48864
49053
|
case "inception": {
|
|
48865
49054
|
const inception = createOpenAICompatible({
|
|
48866
49055
|
name: "inception",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-mb680jb3.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-06fq5zym.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-2q3kvbwv.js";
|
|
15
15
|
|
|
16
16
|
// src/core/agents/specialized/authenticationAgent/agent.ts
|
|
17
17
|
init_dist();
|
|
@@ -31,7 +31,7 @@ Obtain valid credentials/sessions that other agents can use for authenticated te
|
|
|
31
31
|
# Operating Mode
|
|
32
32
|
|
|
33
33
|
- Fully autonomous — no human intervention
|
|
34
|
-
- If you encounter barriers (CAPTCHA, MFA), report failure with details
|
|
34
|
+
- If you encounter barriers (CAPTCHA, or MFA with no TOTP seed available), report failure with details
|
|
35
35
|
- Call \`complete_authentication\` when done (success or failure)
|
|
36
36
|
|
|
37
37
|
# Available Tools
|
|
@@ -125,6 +125,22 @@ These are the ONLY way downstream agents receive the session credentials.
|
|
|
125
125
|
|
|
126
126
|
**Then**, call the \`response\` tool with your final summary to end the run. This is required — complete_authentication persists the data, response terminates the agent.
|
|
127
127
|
|
|
128
|
+
# MFA / TOTP Codes
|
|
129
|
+
|
|
130
|
+
If the login asks for a 6-digit authenticator code, check whether a TOTP seed was provided for this
|
|
131
|
+
account — it appears as an extra secret field on the credential and as a matching environment variable
|
|
132
|
+
(look for a name containing TOTP, MFA, OTP, or 2FA). If one exists, do NOT report an MFA barrier —
|
|
133
|
+
compute the code yourself:
|
|
134
|
+
|
|
135
|
+
\`\`\`
|
|
136
|
+
python3 -c "import base64,hmac,hashlib,struct,time,os;s=os.environ['<ENV_VAR>'].replace(' ','').upper();k=base64.b32decode(s+'='*(-len(s)%8));d=hmac.new(k,struct.pack('>Q',int(time.time())//30),hashlib.sha1).digest();o=d[-1]&15;print('%06d'%((struct.unpack('>I',d[o:o+4])[0]&0x7fffffff)%1000000))"
|
|
137
|
+
\`\`\`
|
|
138
|
+
|
|
139
|
+
Read the seed from the environment variable — never paste a seed literal into a command. Codes rotate
|
|
140
|
+
every 30 seconds, so run this immediately before filling the field. If the code is rejected, re-run and
|
|
141
|
+
retry once (you may have crossed a period boundary). Only report an MFA barrier if no seed is available
|
|
142
|
+
or two fresh codes are both rejected.
|
|
143
|
+
|
|
128
144
|
# Error Recovery
|
|
129
145
|
|
|
130
146
|
If authentication fails, try these mechanical fixes (they are login mechanics, not credential changes):
|
|
@@ -136,7 +152,8 @@ If authentication fails, try these mechanical fixes (they are login mechanics, n
|
|
|
136
152
|
|
|
137
153
|
If credentials were provided to you, they are already verified and SHARED — do not modify them or their
|
|
138
154
|
account settings. When such provided credentials are genuinely rejected — wrong password, account locked, a
|
|
139
|
-
forced password change is required, MFA is required, or the email is not
|
|
155
|
+
forced password change is required, MFA is required and no TOTP seed was provided, or the email is not
|
|
156
|
+
confirmed — do NOT try to recover by resetting or changing
|
|
140
157
|
the password, modifying MFA/2FA settings, or running any account-recovery flow. Fail fast: call
|
|
141
158
|
\`complete_authentication\` with success=false and a summary naming the reason. Do NOT register a new account
|
|
142
159
|
or self-sign-up to get around a rejected provided credential — that is a different account than the one
|
|
@@ -194,7 +211,7 @@ class AuthenticationAgent extends OffensiveSecurityAgent {
|
|
|
194
211
|
const cm = session.credentialManager;
|
|
195
212
|
super({
|
|
196
213
|
system: detectOSAndEnhancePrompt(AUTH_SUBAGENT_SYSTEM_PROMPT),
|
|
197
|
-
prompt: buildAuthPrompt(target, authHints, cm, context),
|
|
214
|
+
prompt: buildAuthPrompt(target, authHints, cm, context, environmentVariables ? Object.keys(environmentVariables) : undefined),
|
|
198
215
|
model,
|
|
199
216
|
session,
|
|
200
217
|
target,
|
|
@@ -272,7 +289,7 @@ function loadAuthResult(authDataPath) {
|
|
|
272
289
|
};
|
|
273
290
|
}
|
|
274
291
|
}
|
|
275
|
-
function buildAuthPrompt(target, authHints, credentialManager, context) {
|
|
292
|
+
function buildAuthPrompt(target, authHints, credentialManager, context, envVarNames) {
|
|
276
293
|
const parts = [`TARGET: ${target}
|
|
277
294
|
`];
|
|
278
295
|
if (context) {
|
|
@@ -290,6 +307,13 @@ function buildAuthPrompt(target, authHints, credentialManager, context) {
|
|
|
290
307
|
parts.push(`No credentials provided. Probe the target to discover auth requirements.
|
|
291
308
|
`);
|
|
292
309
|
}
|
|
310
|
+
if (envVarNames?.length) {
|
|
311
|
+
parts.push("ENVIRONMENT VARIABLES:");
|
|
312
|
+
parts.push(`These are pre-loaded in your shell and available in every execute_command call. Reference them (e.g. $${envVarNames[0]}) — their values are hidden from you and redacted from command output, so never try to print one.`);
|
|
313
|
+
parts.push(envVarNames.map((n) => `- ${n}`).join(`
|
|
314
|
+
`));
|
|
315
|
+
parts.push("");
|
|
316
|
+
}
|
|
293
317
|
if (authHints) {
|
|
294
318
|
parts.push("AUTH HINTS:");
|
|
295
319
|
if (authHints.authScheme)
|
|
@@ -316,8 +340,9 @@ The credentials above were provided to you and have already been verified — th
|
|
|
316
340
|
do not modify them or their account settings. NEVER change the password, complete a password reset /
|
|
317
341
|
forced-password-change / account-recovery flow, or modify MFA/2FA settings (enrolling, disabling, or
|
|
318
342
|
resetting a second factor) for this account. If they do not authenticate (rejected, locked out, forced
|
|
319
|
-
password change required,
|
|
320
|
-
success=false and a clear summary of why — do not attempt to recover, reset,
|
|
343
|
+
password change required, email not confirmed, or an MFA prompt with no TOTP seed available), call
|
|
344
|
+
complete_authentication with success=false and a clear summary of why — do not attempt to recover, reset,
|
|
345
|
+
or rotate them. When a TOTP seed IS available, generate the code and continue; that is not a barrier. Do NOT
|
|
321
346
|
register a new account or self-sign-up to work around a failed login: that is not the credential under test
|
|
322
347
|
and only pollutes results — fail fast with success=false instead.`);
|
|
323
348
|
} else {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-mb680jb3.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-06fq5zym.js";
|
|
7
7
|
import {
|
|
8
8
|
hasToolCall,
|
|
9
9
|
init_dist,
|
|
10
10
|
stepCountIs
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-2q3kvbwv.js";
|
|
12
12
|
|
|
13
13
|
// src/core/agents/specialized/attackSurface/blackboxAgent.ts
|
|
14
14
|
init_dist();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-mb680jb3.js";
|
|
4
4
|
import {
|
|
5
5
|
init_dist,
|
|
6
6
|
stepCountIs
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-2q3kvbwv.js";
|
|
8
8
|
|
|
9
9
|
// src/core/agents/specialized/codeAgent/agent.ts
|
|
10
10
|
init_dist();
|