@pensar/apex 0.0.99 → 0.0.100-canary.c40b1a25
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/auth.js +1 -1
- package/build/index.js +67 -16
- package/package.json +1 -1
package/build/auth.js
CHANGED
|
@@ -8,7 +8,7 @@ import fs from "fs/promises";
|
|
|
8
8
|
// package.json
|
|
9
9
|
var package_default = {
|
|
10
10
|
name: "@pensar/apex",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.100-canary.c40b1a25",
|
|
12
12
|
description: "AI-powered penetration testing CLI tool with terminal UI",
|
|
13
13
|
module: "src/tui/index.tsx",
|
|
14
14
|
main: "build/index.js",
|
package/build/index.js
CHANGED
|
@@ -31880,12 +31880,6 @@ var init_openrouter = __esm(() => {
|
|
|
31880
31880
|
var PENSAR_MODELS;
|
|
31881
31881
|
var init_pensar = __esm(() => {
|
|
31882
31882
|
PENSAR_MODELS = [
|
|
31883
|
-
{
|
|
31884
|
-
id: "pensar:anthropic.claude-opus-4-6-v1",
|
|
31885
|
-
name: "Claude Opus 4.6 (Pensar)",
|
|
31886
|
-
provider: "pensar",
|
|
31887
|
-
contextLength: 200000
|
|
31888
|
-
},
|
|
31889
31883
|
{
|
|
31890
31884
|
id: "pensar:anthropic.claude-sonnet-4-5-20250929-v1:0",
|
|
31891
31885
|
name: "Claude Sonnet 4.5 (Pensar)",
|
|
@@ -31977,7 +31971,7 @@ var package_default2;
|
|
|
31977
31971
|
var init_package = __esm(() => {
|
|
31978
31972
|
package_default2 = {
|
|
31979
31973
|
name: "@pensar/apex",
|
|
31980
|
-
version: "0.0.
|
|
31974
|
+
version: "0.0.100-canary.c40b1a25",
|
|
31981
31975
|
description: "AI-powered penetration testing CLI tool with terminal UI",
|
|
31982
31976
|
module: "src/tui/index.tsx",
|
|
31983
31977
|
main: "build/index.js",
|
|
@@ -194042,7 +194036,7 @@ function createAllTools(ctx4) {
|
|
|
194042
194036
|
get_page: getPage(ctx4)
|
|
194043
194037
|
};
|
|
194044
194038
|
}
|
|
194045
|
-
var ALL_TOOL_NAMES;
|
|
194039
|
+
var ALL_TOOL_NAMES, PLAN_MODE_TOOL_NAMES;
|
|
194046
194040
|
var init_tools = __esm(() => {
|
|
194047
194041
|
init_browserTools();
|
|
194048
194042
|
init_sandboxPlaywright();
|
|
@@ -194151,6 +194145,40 @@ var init_tools = __esm(() => {
|
|
|
194151
194145
|
"web_search",
|
|
194152
194146
|
"get_page"
|
|
194153
194147
|
];
|
|
194148
|
+
PLAN_MODE_TOOL_NAMES = [
|
|
194149
|
+
"browser_navigate",
|
|
194150
|
+
"browser_snapshot",
|
|
194151
|
+
"browser_screenshot",
|
|
194152
|
+
"browser_click",
|
|
194153
|
+
"browser_fill",
|
|
194154
|
+
"browser_evaluate",
|
|
194155
|
+
"browser_console",
|
|
194156
|
+
"browser_get_cookies",
|
|
194157
|
+
"execute_command",
|
|
194158
|
+
"http_request",
|
|
194159
|
+
"read_file",
|
|
194160
|
+
"list_files",
|
|
194161
|
+
"grep",
|
|
194162
|
+
"authenticate_session",
|
|
194163
|
+
"delegate_to_auth_subagent",
|
|
194164
|
+
"create_attack_surface_report",
|
|
194165
|
+
"complete_authentication",
|
|
194166
|
+
"run_attack_surface",
|
|
194167
|
+
"spawn_pentest_swarm",
|
|
194168
|
+
"spawn_coding_agent",
|
|
194169
|
+
"provide_comparison_results",
|
|
194170
|
+
"add_memory",
|
|
194171
|
+
"list_memories",
|
|
194172
|
+
"get_memory",
|
|
194173
|
+
"email_list_inboxes",
|
|
194174
|
+
"email_list_messages",
|
|
194175
|
+
"email_get_message",
|
|
194176
|
+
"email_search_messages",
|
|
194177
|
+
"email_get_attachments",
|
|
194178
|
+
"email_mark_read",
|
|
194179
|
+
"web_search",
|
|
194180
|
+
"get_page"
|
|
194181
|
+
];
|
|
194154
194182
|
});
|
|
194155
194183
|
|
|
194156
194184
|
// src/core/agents/offSecAgent/tools/response.ts
|
|
@@ -194892,7 +194920,11 @@ var init_offensiveSecurityAgent = __esm(() => {
|
|
|
194892
194920
|
}
|
|
194893
194921
|
const hasEmail = (input.session.config?.emailIntegration?.inboxes?.length ?? 0) > 0;
|
|
194894
194922
|
const emailToolSet = new Set(EMAIL_TOOL_NAMES);
|
|
194895
|
-
|
|
194923
|
+
let activeTools = hasEmail ? input.activeTools : input.activeTools.filter((t3) => !emailToolSet.has(t3));
|
|
194924
|
+
if (input.mode === "plan") {
|
|
194925
|
+
const planSet = new Set(PLAN_MODE_TOOL_NAMES);
|
|
194926
|
+
activeTools = activeTools.filter((t3) => planSet.has(t3));
|
|
194927
|
+
}
|
|
194896
194928
|
const messagesDir = input.messagesDir ?? input.session.rootPath;
|
|
194897
194929
|
if (!existsSync21(messagesDir)) {
|
|
194898
194930
|
mkdirSync10(messagesDir, { recursive: true });
|
|
@@ -286458,8 +286490,10 @@ function resolveKeyboardShortcut(key, status, inputValue, hasPendingApprovals, d
|
|
|
286458
286490
|
return { type: "toggle-verbose" };
|
|
286459
286491
|
if (key.ctrl && key.name === "l")
|
|
286460
286492
|
return { type: "toggle-expanded-logs" };
|
|
286461
|
-
if (key.name === "tab" && key.shift)
|
|
286493
|
+
if (key.name === "tab" && key.shift && key.meta)
|
|
286462
286494
|
return { type: "toggle-approval" };
|
|
286495
|
+
if (key.name === "tab" && key.shift)
|
|
286496
|
+
return { type: "toggle-mode" };
|
|
286463
286497
|
if (status === "waiting" && hasPendingApprovals && (key.name === "y" || key.raw === "Y")) {
|
|
286464
286498
|
return { type: "approve" };
|
|
286465
286499
|
}
|
|
@@ -286474,7 +286508,9 @@ function resolveAbortAction(commandCancelled, cancelCommand) {
|
|
|
286474
286508
|
}
|
|
286475
286509
|
return { type: "kill-agent" };
|
|
286476
286510
|
}
|
|
286477
|
-
function buildOperatorSystemPrompt(target, operatorState) {
|
|
286511
|
+
function buildOperatorSystemPrompt(target, operatorState, agentMode) {
|
|
286512
|
+
const modeNote = agentMode === "plan" ? `
|
|
286513
|
+
Agent mode: PLAN — read-only tools only, no mutations allowed` : "";
|
|
286478
286514
|
return `${BASE_SYSTEM_PROMPT}
|
|
286479
286515
|
|
|
286480
286516
|
# Operator Mode
|
|
@@ -286483,7 +286519,7 @@ You are operating in interactive operator mode. The human operator will guide yo
|
|
|
286483
286519
|
|
|
286484
286520
|
Target: ${target || "unknown"}
|
|
286485
286521
|
Stage: ${operatorState.currentStage}
|
|
286486
|
-
Command approval: ${operatorState.requireApproval ? "enabled — the operator will approve each tool call" : "disabled — tool calls execute automatically"}`;
|
|
286522
|
+
Command approval: ${operatorState.requireApproval ? "enabled — the operator will approve each tool call" : "disabled — tool calls execute automatically"}${modeNote}`;
|
|
286487
286523
|
}
|
|
286488
286524
|
function resolveInputFocused(status, dialogStackLength, externalDialogOpen) {
|
|
286489
286525
|
return status !== "running" && dialogStackLength === 0 && !externalDialogOpen;
|
|
@@ -286653,6 +286689,7 @@ function OperatorDashboard({
|
|
|
286653
286689
|
const [lastApprovedAction, setLastApprovedAction] = import_react79.useState(null);
|
|
286654
286690
|
const [verboseMode, setVerboseMode] = import_react79.useState(false);
|
|
286655
286691
|
const [expandedLogs, setExpandedLogs] = import_react79.useState(false);
|
|
286692
|
+
const [agentMode, setAgentMode] = import_react79.useState("default");
|
|
286656
286693
|
const tokenUsageRef = import_react79.useRef(tokenUsage);
|
|
286657
286694
|
import_react79.useEffect(() => {
|
|
286658
286695
|
tokenUsageRef.current = tokenUsage;
|
|
@@ -287095,7 +287132,10 @@ function OperatorDashboard({
|
|
|
287095
287132
|
messages: nextMessages,
|
|
287096
287133
|
stopWhen: [stepCountIs(1e4)],
|
|
287097
287134
|
target: initialConfig?.target,
|
|
287098
|
-
activeTools: [
|
|
287135
|
+
activeTools: [
|
|
287136
|
+
...agentMode === "plan" ? PLAN_MODE_TOOL_NAMES : ALL_TOOL_NAMES
|
|
287137
|
+
],
|
|
287138
|
+
mode: agentMode,
|
|
287099
287139
|
abortSignal: controller.signal,
|
|
287100
287140
|
authConfig: buildAuthConfig(config3.data),
|
|
287101
287141
|
approvalGate: approvalGateRef.current,
|
|
@@ -287111,7 +287151,7 @@ function OperatorDashboard({
|
|
|
287111
287151
|
if (session) {
|
|
287112
287152
|
agentResult = await runOffensiveSecurityAgent({
|
|
287113
287153
|
...commonInput,
|
|
287114
|
-
system: buildOperatorSystemPrompt(initialConfig?.target, operatorState),
|
|
287154
|
+
system: buildOperatorSystemPrompt(initialConfig?.target, operatorState, agentMode),
|
|
287115
287155
|
session
|
|
287116
287156
|
});
|
|
287117
287157
|
} else {
|
|
@@ -287127,7 +287167,7 @@ function OperatorDashboard({
|
|
|
287127
287167
|
};
|
|
287128
287168
|
agentResult = await runOffensiveSecurityAgent({
|
|
287129
287169
|
...commonInput,
|
|
287130
|
-
system: buildOperatorSystemPrompt(initialConfig?.target, operatorState),
|
|
287170
|
+
system: buildOperatorSystemPrompt(initialConfig?.target, operatorState, agentMode),
|
|
287131
287171
|
sessionConfig,
|
|
287132
287172
|
onNameGenerated: (name26) => {
|
|
287133
287173
|
pendingNameRef.current = name26;
|
|
@@ -287192,6 +287232,7 @@ function OperatorDashboard({
|
|
|
287192
287232
|
model.id,
|
|
287193
287233
|
config3.data,
|
|
287194
287234
|
operatorState,
|
|
287235
|
+
agentMode,
|
|
287195
287236
|
addTokenUsage,
|
|
287196
287237
|
appendText,
|
|
287197
287238
|
addStreamingToolCall,
|
|
@@ -287382,6 +287423,9 @@ function OperatorDashboard({
|
|
|
287382
287423
|
return { ...prev, requireApproval: newVal };
|
|
287383
287424
|
});
|
|
287384
287425
|
}, []);
|
|
287426
|
+
const toggleMode = import_react79.useCallback(() => {
|
|
287427
|
+
setAgentMode((prev) => prev === "default" ? "plan" : "default");
|
|
287428
|
+
}, []);
|
|
287385
287429
|
useKeyboard((key) => {
|
|
287386
287430
|
if (status === "running" && queuedMessages.length > 0 && !inputValue.trim()) {
|
|
287387
287431
|
if (key.name === "up") {
|
|
@@ -287453,6 +287497,9 @@ function OperatorDashboard({
|
|
|
287453
287497
|
case "toggle-approval":
|
|
287454
287498
|
toggleApproval();
|
|
287455
287499
|
return;
|
|
287500
|
+
case "toggle-mode":
|
|
287501
|
+
toggleMode();
|
|
287502
|
+
return;
|
|
287456
287503
|
case "approve":
|
|
287457
287504
|
handleApprove();
|
|
287458
287505
|
return;
|
|
@@ -287548,6 +287595,10 @@ function OperatorDashboard({
|
|
|
287548
287595
|
flexDirection: "row",
|
|
287549
287596
|
gap: 2,
|
|
287550
287597
|
children: [
|
|
287598
|
+
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
287599
|
+
fg: agentMode === "plan" ? colors2.warning : colors2.primary,
|
|
287600
|
+
children: agentMode === "plan" ? "PLAN" : "DEFAULT"
|
|
287601
|
+
}, undefined, false, undefined, this),
|
|
287551
287602
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
287552
287603
|
fg: operatorState.requireApproval ? colors2.warning : colors2.primary,
|
|
287553
287604
|
children: operatorState.requireApproval ? "APPROVAL ON" : "APPROVAL OFF"
|
|
@@ -287591,7 +287642,7 @@ function OperatorDashboard({
|
|
|
287591
287642
|
focused: status === "running" ? selectedQueueIndex < 0 : resolveInputFocused(status, stack.length, externalDialogOpen),
|
|
287592
287643
|
status: status === "waiting" ? "running" : status,
|
|
287593
287644
|
mode: "operator",
|
|
287594
|
-
operatorMode: operatorState.mode,
|
|
287645
|
+
operatorMode: agentMode === "plan" ? "plan" : operatorState.mode,
|
|
287595
287646
|
verboseMode,
|
|
287596
287647
|
expandedLogs,
|
|
287597
287648
|
pendingApproval: currentPending,
|