pentesting 0.1.4 → 0.1.6
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/dist/index.js +159 -364
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,8 @@ import { Command } from "commander";
|
|
|
6
6
|
|
|
7
7
|
// src/cli/app.tsx
|
|
8
8
|
import { useState, useEffect, useCallback } from "react";
|
|
9
|
-
import { Box, Text,
|
|
9
|
+
import { Box, Text, useInput, useApp, Static } from "ink";
|
|
10
|
+
import TextInput from "ink-text-input";
|
|
10
11
|
import Spinner from "ink-spinner";
|
|
11
12
|
|
|
12
13
|
// src/core/agent/autonomous-agent.ts
|
|
@@ -2608,397 +2609,191 @@ var ASCII_BANNER = `
|
|
|
2608
2609
|
\u2551 \u25C8 PENTESTING - Autonomous Penetration Testing Agent \u2551
|
|
2609
2610
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
2610
2611
|
`;
|
|
2611
|
-
var ICONS = {
|
|
2612
|
-
// Status
|
|
2613
|
-
success: "\u2713",
|
|
2614
|
-
error: "\u2717",
|
|
2615
|
-
warning: "\u26A0",
|
|
2616
|
-
info: "\u2139",
|
|
2617
|
-
running: "\u25C9",
|
|
2618
|
-
thinking: "\u25D0",
|
|
2619
|
-
// Actions (pentesting-specific)
|
|
2620
|
-
target: "\u25C8",
|
|
2621
|
-
// Diamond for target
|
|
2622
|
-
scan: "\u25CE",
|
|
2623
|
-
exploit: "\u26A1",
|
|
2624
|
-
shell: "\u276F",
|
|
2625
|
-
// Progress
|
|
2626
|
-
pending: "\u25CB",
|
|
2627
|
-
completed: "\u25CF",
|
|
2628
|
-
skipped: "\u25CC",
|
|
2629
|
-
// Findings (severity)
|
|
2630
|
-
critical: "\u25BC",
|
|
2631
|
-
high: "\u25BD",
|
|
2632
|
-
medium: "\u25C7",
|
|
2633
|
-
low: "\u25E6",
|
|
2634
|
-
// Security
|
|
2635
|
-
lock: "\u{1F512}",
|
|
2636
|
-
unlock: "\u{1F513}",
|
|
2637
|
-
key: "\u{1F511}",
|
|
2638
|
-
flag: "\u2691",
|
|
2639
|
-
// Simple flag
|
|
2640
|
-
pwned: "\u25C8"
|
|
2641
|
-
// Compromised
|
|
2642
|
-
};
|
|
2643
2612
|
|
|
2644
2613
|
// src/cli/app.tsx
|
|
2645
2614
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2646
|
-
var App = ({
|
|
2647
|
-
apiKey,
|
|
2648
|
-
target: initialTarget,
|
|
2649
|
-
autoStart = false,
|
|
2650
|
-
autoApprove = false,
|
|
2651
|
-
objective: initialObjective,
|
|
2652
|
-
maxIterations = 200
|
|
2653
|
-
}) => {
|
|
2615
|
+
var App = ({ autoApprove = false, target }) => {
|
|
2654
2616
|
const { exit } = useApp();
|
|
2655
|
-
const [
|
|
2656
|
-
const [appState, setAppState] = useState({
|
|
2657
|
-
status: "idle",
|
|
2658
|
-
target: initialTarget || "",
|
|
2659
|
-
currentPhase: "recon",
|
|
2660
|
-
iteration: 0,
|
|
2661
|
-
maxIterations,
|
|
2662
|
-
findings: 0,
|
|
2663
|
-
compromised: [],
|
|
2664
|
-
credentials: 0,
|
|
2665
|
-
services: 0
|
|
2666
|
-
});
|
|
2667
|
-
const [phases, setPhases] = useState([]);
|
|
2668
|
-
const [thoughts, setThoughts] = useState([]);
|
|
2669
|
-
const [logs, setLogs] = useState([]);
|
|
2617
|
+
const [messages, setMessages] = useState([]);
|
|
2670
2618
|
const [input, setInput] = useState("");
|
|
2671
|
-
const [
|
|
2672
|
-
const [
|
|
2673
|
-
const
|
|
2674
|
-
|
|
2675
|
-
id:
|
|
2619
|
+
const [isProcessing, setIsProcessing] = useState(false);
|
|
2620
|
+
const [agent] = useState(() => new AutonomousHackingAgent(void 0, { autoApprove }));
|
|
2621
|
+
const addMessage = useCallback((type, content) => {
|
|
2622
|
+
setMessages((prev) => [...prev, {
|
|
2623
|
+
id: `${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
2676
2624
|
type,
|
|
2677
|
-
|
|
2625
|
+
content,
|
|
2678
2626
|
timestamp: /* @__PURE__ */ new Date()
|
|
2679
|
-
};
|
|
2680
|
-
setLogs((prev) => [...prev.slice(-50), entry]);
|
|
2627
|
+
}]);
|
|
2681
2628
|
}, []);
|
|
2682
2629
|
useEffect(() => {
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
iteration: current,
|
|
2691
|
-
maxIterations: max,
|
|
2692
|
-
currentPhase: phase,
|
|
2693
|
-
status: "running"
|
|
2694
|
-
}));
|
|
2695
|
-
setIsThinking(true);
|
|
2630
|
+
addMessage("system", "Pentesting Agent ready. Type a message or use /help for commands.");
|
|
2631
|
+
if (target) {
|
|
2632
|
+
agent.setTarget(target);
|
|
2633
|
+
addMessage("system", `Target set: ${target}`);
|
|
2634
|
+
}
|
|
2635
|
+
agent.on("thought", (type, content) => {
|
|
2636
|
+
addMessage("assistant", `[${type}] ${content}`);
|
|
2696
2637
|
});
|
|
2697
|
-
agent.on("
|
|
2698
|
-
|
|
2699
|
-
|
|
2638
|
+
agent.on("tool_call", (data) => {
|
|
2639
|
+
const inputStr = Object.entries(data.input).map(([k, v]) => `${k}=${typeof v === "string" ? v : JSON.stringify(v)}`).join(" ");
|
|
2640
|
+
addMessage("tool", `\u25B6 ${data.name} ${inputStr}`);
|
|
2700
2641
|
});
|
|
2701
|
-
agent.on("
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
if (result.success) {
|
|
2706
|
-
addLog("success", `[+] ${name} completed (${result.duration}ms)`);
|
|
2707
|
-
} else {
|
|
2708
|
-
addLog("error", `[-] ${name} failed: ${result.error}`);
|
|
2709
|
-
}
|
|
2642
|
+
agent.on("tool_result", (data) => {
|
|
2643
|
+
const status = data.result.success ? "\u2713" : "\u2717";
|
|
2644
|
+
const output = data.result.output?.slice(0, 200) || "";
|
|
2645
|
+
addMessage("tool", `${status} ${data.name}: ${output}`);
|
|
2710
2646
|
});
|
|
2711
2647
|
agent.on("finding", (finding) => {
|
|
2712
|
-
|
|
2713
|
-
setAppState((prev) => ({ ...prev, findings: prev.findings + 1 }));
|
|
2714
|
-
});
|
|
2715
|
-
agent.on("credential", (cred) => {
|
|
2716
|
-
addLog("success", `[cred] ${cred.type} - ${cred.username || "unknown"}`);
|
|
2717
|
-
setAppState((prev) => ({ ...prev, credentials: prev.credentials + 1 }));
|
|
2718
|
-
});
|
|
2719
|
-
agent.on("compromised", (host) => {
|
|
2720
|
-
addLog("success", `[pwned] ${host}`);
|
|
2721
|
-
setAppState((prev) => ({
|
|
2722
|
-
...prev,
|
|
2723
|
-
compromised: [...prev.compromised, host]
|
|
2724
|
-
}));
|
|
2725
|
-
});
|
|
2726
|
-
agent.on("complete", (summary) => {
|
|
2727
|
-
setAppState((prev) => ({ ...prev, status: "completed" }));
|
|
2728
|
-
addLog("success", `[done] Assessment complete: ${JSON.stringify(summary)}`);
|
|
2648
|
+
addMessage("system", `\u{1F3AF} Finding: [${finding.severity.toUpperCase()}] ${finding.title}`);
|
|
2729
2649
|
});
|
|
2730
2650
|
agent.on("error", (error) => {
|
|
2731
|
-
|
|
2732
|
-
});
|
|
2733
|
-
agent.on("report", (report) => {
|
|
2734
|
-
addLog("info", `[report] Generated (${report.length} chars)`);
|
|
2651
|
+
addMessage("error", `Error: ${error.message}`);
|
|
2735
2652
|
});
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2653
|
+
}, [agent, target, addMessage]);
|
|
2654
|
+
const handleSubmit = useCallback(async (value) => {
|
|
2655
|
+
const trimmed = value.trim();
|
|
2656
|
+
if (!trimmed || isProcessing) return;
|
|
2657
|
+
setInput("");
|
|
2658
|
+
addMessage("user", trimmed);
|
|
2659
|
+
if (trimmed.startsWith("/")) {
|
|
2660
|
+
const [cmd, ...args] = trimmed.slice(1).split(" ");
|
|
2661
|
+
switch (cmd) {
|
|
2662
|
+
case "help":
|
|
2663
|
+
addMessage("system", `Commands:
|
|
2664
|
+
/target <ip> Set target
|
|
2665
|
+
/start Start autonomous mode
|
|
2666
|
+
/stop Stop current operation
|
|
2667
|
+
/findings Show findings
|
|
2668
|
+
/clear Clear messages
|
|
2669
|
+
/exit Exit`);
|
|
2670
|
+
return;
|
|
2671
|
+
case "target":
|
|
2672
|
+
if (args[0]) {
|
|
2673
|
+
agent.setTarget(args[0]);
|
|
2674
|
+
addMessage("system", `Target set: ${args[0]}`);
|
|
2675
|
+
} else {
|
|
2676
|
+
addMessage("error", "Usage: /target <ip or domain>");
|
|
2677
|
+
}
|
|
2678
|
+
return;
|
|
2679
|
+
case "start":
|
|
2680
|
+
const objective = args.join(" ") || "Perform comprehensive penetration test";
|
|
2681
|
+
setIsProcessing(true);
|
|
2682
|
+
addMessage("system", `Starting: ${objective}`);
|
|
2683
|
+
try {
|
|
2684
|
+
await agent.run(objective);
|
|
2685
|
+
} catch (e) {
|
|
2686
|
+
addMessage("error", `Failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
2687
|
+
}
|
|
2688
|
+
setIsProcessing(false);
|
|
2689
|
+
return;
|
|
2690
|
+
case "stop":
|
|
2691
|
+
agent.stop();
|
|
2692
|
+
addMessage("system", "Stopped.");
|
|
2693
|
+
setIsProcessing(false);
|
|
2694
|
+
return;
|
|
2695
|
+
case "findings":
|
|
2696
|
+
const findings = agent.getState().findings;
|
|
2697
|
+
if (findings.length === 0) {
|
|
2698
|
+
addMessage("system", "No findings yet.");
|
|
2699
|
+
} else {
|
|
2700
|
+
findings.forEach((f) => {
|
|
2701
|
+
addMessage("system", `[${f.severity.toUpperCase()}] ${f.title}`);
|
|
2702
|
+
});
|
|
2703
|
+
}
|
|
2704
|
+
return;
|
|
2705
|
+
case "clear":
|
|
2706
|
+
setMessages([]);
|
|
2707
|
+
addMessage("system", "Cleared.");
|
|
2708
|
+
return;
|
|
2709
|
+
case "exit":
|
|
2710
|
+
case "quit":
|
|
2711
|
+
exit();
|
|
2712
|
+
return;
|
|
2713
|
+
default:
|
|
2714
|
+
addMessage("error", `Unknown command: ${cmd}. Type /help`);
|
|
2715
|
+
return;
|
|
2716
|
+
}
|
|
2772
2717
|
}
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2718
|
+
setIsProcessing(true);
|
|
2719
|
+
try {
|
|
2720
|
+
await agent.chat(trimmed);
|
|
2721
|
+
} catch (e) {
|
|
2722
|
+
addMessage("error", `Error: ${e instanceof Error ? e.message : String(e)}`);
|
|
2723
|
+
}
|
|
2724
|
+
setIsProcessing(false);
|
|
2725
|
+
}, [agent, isProcessing, addMessage, exit]);
|
|
2726
|
+
useInput((input2, key) => {
|
|
2727
|
+
if (key.ctrl && input2 === "c") {
|
|
2728
|
+
if (isProcessing) {
|
|
2729
|
+
agent.stop();
|
|
2730
|
+
setIsProcessing(false);
|
|
2731
|
+
addMessage("system", "Interrupted.");
|
|
2732
|
+
} else {
|
|
2733
|
+
exit();
|
|
2734
|
+
}
|
|
2776
2735
|
}
|
|
2777
2736
|
});
|
|
2778
|
-
const
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
case "/start":
|
|
2791
|
-
case "/auto":
|
|
2792
|
-
if (appState.target) {
|
|
2793
|
-
const objective = args || void 0;
|
|
2794
|
-
addLog("info", `[*] Starting autonomous hacking...`);
|
|
2795
|
-
agent.runAutonomous(objective);
|
|
2796
|
-
} else {
|
|
2797
|
-
addLog("error", "No target set. Use /target <ip> first.");
|
|
2798
|
-
}
|
|
2799
|
-
break;
|
|
2800
|
-
case "/hint":
|
|
2801
|
-
if (args && appState.status === "running") {
|
|
2802
|
-
agent.processUserHint(args);
|
|
2803
|
-
addLog("info", `[hint] Sent to agent`);
|
|
2804
|
-
}
|
|
2805
|
-
break;
|
|
2806
|
-
case "/pause":
|
|
2807
|
-
agent.pause();
|
|
2808
|
-
setAppState((prev) => ({ ...prev, status: "paused" }));
|
|
2809
|
-
break;
|
|
2810
|
-
case "/resume":
|
|
2811
|
-
agent.resume();
|
|
2812
|
-
break;
|
|
2813
|
-
case "/reset":
|
|
2814
|
-
agent.reset();
|
|
2815
|
-
setAppState({
|
|
2816
|
-
status: "idle",
|
|
2817
|
-
target: "",
|
|
2818
|
-
currentPhase: "recon",
|
|
2819
|
-
iteration: 0,
|
|
2820
|
-
maxIterations,
|
|
2821
|
-
findings: 0,
|
|
2822
|
-
compromised: [],
|
|
2823
|
-
credentials: 0,
|
|
2824
|
-
services: 0
|
|
2825
|
-
});
|
|
2826
|
-
setThoughts([]);
|
|
2827
|
-
setLogs([]);
|
|
2828
|
-
addLog("info", "Session reset");
|
|
2829
|
-
break;
|
|
2830
|
-
case "/findings":
|
|
2831
|
-
const state = agent.getState();
|
|
2832
|
-
state.findings.forEach((f) => {
|
|
2833
|
-
addLog("finding", `[${f.severity}] ${f.title}: ${f.description.slice(0, 100)}`);
|
|
2834
|
-
});
|
|
2835
|
-
break;
|
|
2836
|
-
case "/help":
|
|
2837
|
-
addLog("info", "Commands: /target <ip>, /start [objective], /hint <hint>, /pause, /resume, /reset, /findings, /help");
|
|
2838
|
-
addLog("info", "Keys: [T] Toggle thoughts, [P] Pause, [R] Resume, Ctrl+C Exit");
|
|
2839
|
-
break;
|
|
2737
|
+
const getColor = (type) => {
|
|
2738
|
+
switch (type) {
|
|
2739
|
+
case "user":
|
|
2740
|
+
return THEME.text.accent;
|
|
2741
|
+
case "assistant":
|
|
2742
|
+
return THEME.text.primary;
|
|
2743
|
+
case "tool":
|
|
2744
|
+
return THEME.status.info;
|
|
2745
|
+
case "error":
|
|
2746
|
+
return THEME.status.error;
|
|
2747
|
+
case "system":
|
|
2748
|
+
return THEME.text.muted;
|
|
2840
2749
|
default:
|
|
2841
|
-
|
|
2842
|
-
agent.processUserHint(cmd);
|
|
2843
|
-
addLog("info", `[hint] ${cmd}`);
|
|
2844
|
-
}
|
|
2750
|
+
return THEME.text.primary;
|
|
2845
2751
|
}
|
|
2846
|
-
setInput("");
|
|
2847
|
-
}, [agent, appState, addLog, maxIterations]);
|
|
2848
|
-
const getThoughtStyle = (type) => {
|
|
2849
|
-
const styles = {
|
|
2850
|
-
observation: { prefix: "[observe]", color: THEME.text.accent },
|
|
2851
|
-
hypothesis: { prefix: "[hypothesis]", color: THEME.status.warning },
|
|
2852
|
-
plan: { prefix: "[plan]", color: THEME.status.running },
|
|
2853
|
-
action: { prefix: "[action]", color: THEME.status.success },
|
|
2854
|
-
result: { prefix: "[result]", color: THEME.text.primary },
|
|
2855
|
-
reflection: { prefix: "[reflect]", color: THEME.semantic.high },
|
|
2856
|
-
stuck: { prefix: "[stuck]", color: THEME.status.error },
|
|
2857
|
-
breakthrough: { prefix: "[breakthrough]", color: "#00ff00" }
|
|
2858
|
-
};
|
|
2859
|
-
return styles[type] || { prefix: "[info]", color: THEME.text.muted };
|
|
2860
2752
|
};
|
|
2861
|
-
const
|
|
2862
|
-
switch (
|
|
2863
|
-
case "
|
|
2864
|
-
return "
|
|
2865
|
-
case "
|
|
2866
|
-
return "
|
|
2867
|
-
case "
|
|
2868
|
-
return "
|
|
2869
|
-
case "
|
|
2870
|
-
return "
|
|
2753
|
+
const getPrefix = (type) => {
|
|
2754
|
+
switch (type) {
|
|
2755
|
+
case "user":
|
|
2756
|
+
return "\u276F";
|
|
2757
|
+
case "assistant":
|
|
2758
|
+
return "\u25C8";
|
|
2759
|
+
case "tool":
|
|
2760
|
+
return "\u2699";
|
|
2761
|
+
case "error":
|
|
2762
|
+
return "\u2717";
|
|
2763
|
+
case "system":
|
|
2764
|
+
return "\u2022";
|
|
2871
2765
|
default:
|
|
2872
|
-
return "
|
|
2766
|
+
return " ";
|
|
2873
2767
|
}
|
|
2874
2768
|
};
|
|
2875
2769
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", padding: 1, children: [
|
|
2876
|
-
/* @__PURE__ */
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
/* @__PURE__ */ jsxs(Text, { color: THEME.text.muted, children: [
|
|
2889
|
-
"Iteration: ",
|
|
2890
|
-
/* @__PURE__ */ jsxs(Text, { color: THEME.text.accent, children: [
|
|
2891
|
-
appState.iteration,
|
|
2892
|
-
"/",
|
|
2893
|
-
appState.maxIterations
|
|
2894
|
-
] })
|
|
2895
|
-
] })
|
|
2896
|
-
] })
|
|
2897
|
-
] }),
|
|
2898
|
-
/* @__PURE__ */ jsxs(Box, { borderStyle: "single", borderColor: THEME.status.running, paddingX: 1, children: [
|
|
2899
|
-
/* @__PURE__ */ jsx(Text, { color: THEME.text.muted, children: "Services: " }),
|
|
2900
|
-
/* @__PURE__ */ jsx(Text, { color: THEME.status.success, children: appState.services }),
|
|
2901
|
-
/* @__PURE__ */ jsx(Text, { children: " | " }),
|
|
2902
|
-
/* @__PURE__ */ jsx(Text, { color: THEME.text.muted, children: "Creds: " }),
|
|
2903
|
-
/* @__PURE__ */ jsx(Text, { color: THEME.status.warning, children: appState.credentials }),
|
|
2904
|
-
/* @__PURE__ */ jsx(Text, { children: " | " }),
|
|
2905
|
-
/* @__PURE__ */ jsx(Text, { color: THEME.text.muted, children: "Pwned: " }),
|
|
2906
|
-
/* @__PURE__ */ jsx(Text, { color: appState.compromised.length > 0 ? THEME.status.success : THEME.text.muted, children: appState.compromised.length > 0 ? appState.compromised.join(", ") : "0" }),
|
|
2907
|
-
/* @__PURE__ */ jsx(Text, { children: " | " }),
|
|
2908
|
-
/* @__PURE__ */ jsx(Text, { color: THEME.text.muted, children: "Findings: " }),
|
|
2909
|
-
/* @__PURE__ */ jsx(Text, { color: THEME.semantic.high, children: appState.findings })
|
|
2910
|
-
] }),
|
|
2911
|
-
/* @__PURE__ */ jsxs(Box, { borderStyle: "single", borderColor: THEME.text.accent, paddingX: 1, marginTop: 1, children: [
|
|
2912
|
-
/* @__PURE__ */ jsx(Text, { color: THEME.text.accent, bold: true, children: "[phases] " }),
|
|
2913
|
-
phases.map((phase) => /* @__PURE__ */ jsx(Box, { marginRight: 1, children: /* @__PURE__ */ jsxs(
|
|
2914
|
-
Text,
|
|
2770
|
+
/* @__PURE__ */ jsx(Box, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsx(Static, { items: messages.slice(-30), children: (msg) => /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text, { color: getColor(msg.type), children: [
|
|
2771
|
+
getPrefix(msg.type),
|
|
2772
|
+
" ",
|
|
2773
|
+
msg.content
|
|
2774
|
+
] }) }, msg.id) }) }),
|
|
2775
|
+
/* @__PURE__ */ jsx(Box, { children: isProcessing ? /* @__PURE__ */ jsxs(Text, { color: THEME.status.running, children: [
|
|
2776
|
+
/* @__PURE__ */ jsx(Spinner, { type: "dots" }),
|
|
2777
|
+
" Processing..."
|
|
2778
|
+
] }) : /* @__PURE__ */ jsxs(Box, { children: [
|
|
2779
|
+
/* @__PURE__ */ jsx(Text, { color: THEME.status.success, children: "\u276F " }),
|
|
2780
|
+
/* @__PURE__ */ jsx(
|
|
2781
|
+
TextInput,
|
|
2915
2782
|
{
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
phase.name,
|
|
2921
|
-
phase.attempts > 0 && /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
2922
|
-
"(",
|
|
2923
|
-
phase.attempts,
|
|
2924
|
-
")"
|
|
2925
|
-
] })
|
|
2926
|
-
]
|
|
2783
|
+
value: input,
|
|
2784
|
+
onChange: setInput,
|
|
2785
|
+
onSubmit: handleSubmit,
|
|
2786
|
+
placeholder: "Type a message or /help..."
|
|
2927
2787
|
}
|
|
2928
|
-
)
|
|
2929
|
-
] }),
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
height: 10,
|
|
2938
|
-
marginTop: 1,
|
|
2939
|
-
children: [
|
|
2940
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
2941
|
-
/* @__PURE__ */ jsx(Text, { color: THEME.status.running, bold: true, children: "[agent thoughts]" }),
|
|
2942
|
-
isThinking && /* @__PURE__ */ jsxs(Box, { marginLeft: 2, children: [
|
|
2943
|
-
/* @__PURE__ */ jsx(Text, { color: THEME.status.warning, children: /* @__PURE__ */ jsx(Spinner, { type: "dots" }) }),
|
|
2944
|
-
/* @__PURE__ */ jsx(Text, { color: THEME.status.warning, children: " Thinking..." })
|
|
2945
|
-
] })
|
|
2946
|
-
] }),
|
|
2947
|
-
/* @__PURE__ */ jsx(Static, { items: thoughts.slice(-6), children: (thought) => {
|
|
2948
|
-
const style = getThoughtStyle(thought.type);
|
|
2949
|
-
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
2950
|
-
/* @__PURE__ */ jsxs(Text, { color: THEME.text.muted, dimColor: true, children: [
|
|
2951
|
-
"[",
|
|
2952
|
-
thought.timestamp.toLocaleTimeString(),
|
|
2953
|
-
"]"
|
|
2954
|
-
] }),
|
|
2955
|
-
/* @__PURE__ */ jsxs(Text, { color: style.color, children: [
|
|
2956
|
-
" ",
|
|
2957
|
-
style.prefix,
|
|
2958
|
-
" ",
|
|
2959
|
-
thought.content.slice(0, 120),
|
|
2960
|
-
thought.content.length > 120 && "..."
|
|
2961
|
-
] })
|
|
2962
|
-
] }, thought.id);
|
|
2963
|
-
} })
|
|
2964
|
-
]
|
|
2965
|
-
}
|
|
2966
|
-
),
|
|
2967
|
-
/* @__PURE__ */ jsxs(
|
|
2968
|
-
Box,
|
|
2969
|
-
{
|
|
2970
|
-
flexDirection: "column",
|
|
2971
|
-
borderStyle: "single",
|
|
2972
|
-
borderColor: THEME.status.success,
|
|
2973
|
-
paddingX: 1,
|
|
2974
|
-
height: 12,
|
|
2975
|
-
marginTop: 1,
|
|
2976
|
-
children: [
|
|
2977
|
-
/* @__PURE__ */ jsx(Text, { color: THEME.status.success, bold: true, children: "[activity log]" }),
|
|
2978
|
-
/* @__PURE__ */ jsx(Static, { items: logs.slice(-10), children: (log) => /* @__PURE__ */ jsxs(Box, { children: [
|
|
2979
|
-
/* @__PURE__ */ jsxs(Text, { color: THEME.text.muted, dimColor: true, children: [
|
|
2980
|
-
"[",
|
|
2981
|
-
log.timestamp.toLocaleTimeString(),
|
|
2982
|
-
"]"
|
|
2983
|
-
] }),
|
|
2984
|
-
/* @__PURE__ */ jsxs(Text, { color: log.type === "success" ? THEME.status.success : log.type === "error" ? THEME.status.error : log.type === "warning" ? THEME.status.warning : log.type === "finding" ? THEME.semantic.high : log.type === "tool" ? THEME.text.accent : THEME.text.primary, children: [
|
|
2985
|
-
" ",
|
|
2986
|
-
log.message
|
|
2987
|
-
] })
|
|
2988
|
-
] }, log.id) })
|
|
2989
|
-
]
|
|
2990
|
-
}
|
|
2991
|
-
),
|
|
2992
|
-
/* @__PURE__ */ jsxs(Box, { marginTop: 1, children: [
|
|
2993
|
-
/* @__PURE__ */ jsxs(Text, { color: THEME.status.success, bold: true, children: [
|
|
2994
|
-
"pentesting ",
|
|
2995
|
-
">",
|
|
2996
|
-
" "
|
|
2997
|
-
] }),
|
|
2998
|
-
/* @__PURE__ */ jsx(Text, { color: THEME.text.primary, children: input }),
|
|
2999
|
-
/* @__PURE__ */ jsx(Text, { color: THEME.status.success, children: "_" })
|
|
3000
|
-
] }),
|
|
3001
|
-
/* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(Text, { color: THEME.text.muted, dimColor: true, children: "[T] Toggle thoughts | [P] Pause | [R] Resume | Type command or hint" }) })
|
|
2788
|
+
)
|
|
2789
|
+
] }) }),
|
|
2790
|
+
/* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsxs(Text, { color: THEME.text.muted, dimColor: true, children: [
|
|
2791
|
+
agent.getState().target ? `Target: ${agent.getState().target}` : "No target",
|
|
2792
|
+
" | Findings: ",
|
|
2793
|
+
agent.getState().findings.length,
|
|
2794
|
+
" | Ctrl+C to ",
|
|
2795
|
+
isProcessing ? "stop" : "exit"
|
|
2796
|
+
] }) })
|
|
3002
2797
|
] });
|
|
3003
2798
|
};
|
|
3004
2799
|
var app_default = App;
|