@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
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BlackboxAttackSurfaceAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-5asc7364.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-xkv494x1.js";
|
|
11
11
|
import {
|
|
12
12
|
TargetedPentestAgent,
|
|
13
13
|
buildPentestSystemPrompt
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-s8z1mkv5.js";
|
|
15
15
|
import {
|
|
16
16
|
CodeAgent
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-7d3h16fw.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-qs2mveb2.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-mb680jb3.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-2q3kvbwv.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-mk0gxtkm.js");
|
|
7790
7806
|
return runFastStrike(input);
|
|
7791
7807
|
}
|
|
7792
7808
|
const {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
config,
|
|
3
3
|
init_config
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-0qybv29g.js";
|
|
5
5
|
import {
|
|
6
6
|
__esm
|
|
7
7
|
} from "./cli-8rxa073f.js";
|
|
@@ -350,6 +350,55 @@ async function selectWorkspace(apiUrl, accessToken, workspaceId) {
|
|
|
350
350
|
}
|
|
351
351
|
return await response.json();
|
|
352
352
|
}
|
|
353
|
+
async function createWorkspaceSelection(apiUrl, accessToken) {
|
|
354
|
+
const response = await fetch(`${apiUrl}/api/cli/workspace-selection`, {
|
|
355
|
+
method: "POST",
|
|
356
|
+
headers: {
|
|
357
|
+
"Content-Type": "application/json",
|
|
358
|
+
Authorization: `Bearer ${accessToken}`
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
if (!response.ok) {
|
|
362
|
+
throw new Error("Failed to start workspace selection");
|
|
363
|
+
}
|
|
364
|
+
return await response.json();
|
|
365
|
+
}
|
|
366
|
+
async function pollWorkspaceSelection(apiUrl, accessToken, selectionId, signal) {
|
|
367
|
+
const POLL_INTERVAL = 3000;
|
|
368
|
+
const TIMEOUT = 10 * 60 * 1000;
|
|
369
|
+
const deadline = Date.now() + TIMEOUT;
|
|
370
|
+
while (Date.now() < deadline) {
|
|
371
|
+
if (signal?.aborted)
|
|
372
|
+
throw new Error("Cancelled");
|
|
373
|
+
await sleep2(POLL_INTERVAL);
|
|
374
|
+
if (signal?.aborted)
|
|
375
|
+
throw new Error("Cancelled");
|
|
376
|
+
try {
|
|
377
|
+
const response = await fetch(`${apiUrl}/api/cli/workspace-selection?id=${encodeURIComponent(selectionId)}`, {
|
|
378
|
+
headers: { Authorization: `Bearer ${accessToken}` }
|
|
379
|
+
});
|
|
380
|
+
if (!response.ok)
|
|
381
|
+
continue;
|
|
382
|
+
const data = await response.json();
|
|
383
|
+
if (data.status === "complete" && data.workspaceId) {
|
|
384
|
+
return data.workspaceId;
|
|
385
|
+
}
|
|
386
|
+
if (data.status === "expired") {
|
|
387
|
+
throw new Error("Workspace selection expired. Please run `pensar login` again.");
|
|
388
|
+
}
|
|
389
|
+
} catch (err) {
|
|
390
|
+
if (signal?.aborted)
|
|
391
|
+
throw new Error("Cancelled");
|
|
392
|
+
if (err instanceof Error && err.message.includes("Please try again")) {
|
|
393
|
+
throw err;
|
|
394
|
+
}
|
|
395
|
+
if (err instanceof Error && err.message.includes("expired")) {
|
|
396
|
+
throw err;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
throw new Error("Workspace selection timed out. Please try again.");
|
|
401
|
+
}
|
|
353
402
|
var init_workspaces = () => {};
|
|
354
403
|
|
|
355
404
|
// src/core/auth/index.ts
|
|
@@ -362,4 +411,4 @@ var init_auth = __esm(() => {
|
|
|
362
411
|
init_workspaces();
|
|
363
412
|
});
|
|
364
413
|
|
|
365
|
-
export { getPensarApiUrl, getPensarGatewayUrl, getPensarConsoleUrl, init_constants, isConnected, disconnect, startDeviceFlow, pollWorkOSToken, pollLegacyToken, isTokenExpired, ensureValidToken, validateGateway, signGatewayRequest, fetchWorkspaces, pollForWorkspaceCreation, selectWorkspace, init_auth };
|
|
414
|
+
export { getPensarApiUrl, getPensarGatewayUrl, getPensarConsoleUrl, init_constants, isConnected, disconnect, startDeviceFlow, pollWorkOSToken, pollLegacyToken, isTokenExpired, ensureValidToken, validateGateway, signGatewayRequest, fetchWorkspaces, pollForWorkspaceCreation, selectWorkspace, createWorkspaceSelection, pollWorkspaceSelection, init_auth };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCurrentVersion,
|
|
3
3
|
init_installation
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-3e0jb8k6.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
|
|