@pensar/apex 0.0.64 → 0.0.65-canary.02a1e44a
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/README.md +1 -1
- package/build/index.js +558 -351
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -49473,19 +49473,19 @@ var require_token_io = __commonJS((exports, module2) => {
|
|
|
49473
49473
|
getUserDataDir: () => getUserDataDir
|
|
49474
49474
|
});
|
|
49475
49475
|
module2.exports = __toCommonJS2(token_io_exports);
|
|
49476
|
-
var
|
|
49477
|
-
var
|
|
49478
|
-
var
|
|
49476
|
+
var import_path11 = __toESM2(__require("path"));
|
|
49477
|
+
var import_fs10 = __toESM2(__require("fs"));
|
|
49478
|
+
var import_os7 = __toESM2(__require("os"));
|
|
49479
49479
|
var import_token_error = require_token_error();
|
|
49480
49480
|
function findRootDir() {
|
|
49481
49481
|
try {
|
|
49482
49482
|
let dir = process.cwd();
|
|
49483
|
-
while (dir !==
|
|
49484
|
-
const pkgPath =
|
|
49485
|
-
if (
|
|
49483
|
+
while (dir !== import_path11.default.dirname(dir)) {
|
|
49484
|
+
const pkgPath = import_path11.default.join(dir, ".vercel");
|
|
49485
|
+
if (import_fs10.default.existsSync(pkgPath)) {
|
|
49486
49486
|
return dir;
|
|
49487
49487
|
}
|
|
49488
|
-
dir =
|
|
49488
|
+
dir = import_path11.default.dirname(dir);
|
|
49489
49489
|
}
|
|
49490
49490
|
} catch (e) {
|
|
49491
49491
|
throw new import_token_error.VercelOidcTokenError("Token refresh only supported in node server environments");
|
|
@@ -49496,11 +49496,11 @@ var require_token_io = __commonJS((exports, module2) => {
|
|
|
49496
49496
|
if (process.env.XDG_DATA_HOME) {
|
|
49497
49497
|
return process.env.XDG_DATA_HOME;
|
|
49498
49498
|
}
|
|
49499
|
-
switch (
|
|
49499
|
+
switch (import_os7.default.platform()) {
|
|
49500
49500
|
case "darwin":
|
|
49501
|
-
return
|
|
49501
|
+
return import_path11.default.join(import_os7.default.homedir(), "Library/Application Support");
|
|
49502
49502
|
case "linux":
|
|
49503
|
-
return
|
|
49503
|
+
return import_path11.default.join(import_os7.default.homedir(), ".local/share");
|
|
49504
49504
|
case "win32":
|
|
49505
49505
|
if (process.env.LOCALAPPDATA) {
|
|
49506
49506
|
return process.env.LOCALAPPDATA;
|
|
@@ -49609,10 +49609,10 @@ var require_oauth = __commonJS((exports, module2) => {
|
|
|
49609
49609
|
refreshTokenRequest: () => refreshTokenRequest
|
|
49610
49610
|
});
|
|
49611
49611
|
module2.exports = __toCommonJS2(oauth_exports);
|
|
49612
|
-
var
|
|
49612
|
+
var import_os7 = __require("os");
|
|
49613
49613
|
var VERCEL_ISSUER = "https://vercel.com";
|
|
49614
49614
|
var VERCEL_CLI_CLIENT_ID = "cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp";
|
|
49615
|
-
var userAgent = `@vercel/oidc node-${process.version} ${(0,
|
|
49615
|
+
var userAgent = `@vercel/oidc node-${process.version} ${(0, import_os7.platform)()} (${(0, import_os7.arch)()}) ${(0, import_os7.hostname)()}`;
|
|
49616
49616
|
var _tokenEndpoint = null;
|
|
49617
49617
|
async function getTokenEndpoint() {
|
|
49618
49618
|
if (_tokenEndpoint) {
|
|
@@ -61019,11 +61019,11 @@ Submit the final structured report. Call this ONCE at the very end with complete
|
|
|
61019
61019
|
If resuming from a previous run, review the assets already in the session assets folder and continue where you left off.`;
|
|
61020
61020
|
|
|
61021
61021
|
// src/core/agents/specialized/utils.ts
|
|
61022
|
-
import { readFileSync as
|
|
61022
|
+
import { readFileSync as readFileSync3, existsSync as existsSync9 } from "fs";
|
|
61023
61023
|
import { execSync } from "child_process";
|
|
61024
61024
|
function readOsRelease() {
|
|
61025
61025
|
try {
|
|
61026
|
-
const content =
|
|
61026
|
+
const content = readFileSync3("/etc/os-release", "utf8");
|
|
61027
61027
|
const lines = content.split(/\r?\n/);
|
|
61028
61028
|
const map2 = {};
|
|
61029
61029
|
for (const line of lines) {
|
|
@@ -61044,11 +61044,11 @@ function readOsRelease() {
|
|
|
61044
61044
|
}
|
|
61045
61045
|
function detectDocker() {
|
|
61046
61046
|
try {
|
|
61047
|
-
if (
|
|
61047
|
+
if (existsSync9("/.dockerenv"))
|
|
61048
61048
|
return true;
|
|
61049
61049
|
} catch {}
|
|
61050
61050
|
try {
|
|
61051
|
-
const cgroup =
|
|
61051
|
+
const cgroup = readFileSync3("/proc/1/cgroup", "utf8");
|
|
61052
61052
|
if (/docker|containerd|kubepods/i.test(cgroup))
|
|
61053
61053
|
return true;
|
|
61054
61054
|
} catch {}
|
|
@@ -61128,9 +61128,9 @@ ${prompt}`;
|
|
|
61128
61128
|
var init_utils = () => {};
|
|
61129
61129
|
|
|
61130
61130
|
// src/core/agents/specialized/attackSurface/types.ts
|
|
61131
|
-
import { readFileSync as
|
|
61131
|
+
import { readFileSync as readFileSync4 } from "fs";
|
|
61132
61132
|
function loadAttackSurfaceResults(resultsPath) {
|
|
61133
|
-
const data =
|
|
61133
|
+
const data = readFileSync4(resultsPath, "utf-8");
|
|
61134
61134
|
return JSON.parse(data);
|
|
61135
61135
|
}
|
|
61136
61136
|
var init_types2 = () => {};
|
|
@@ -104156,7 +104156,7 @@ var init_stdio2 = __esm(() => {
|
|
|
104156
104156
|
});
|
|
104157
104157
|
|
|
104158
104158
|
// src/core/agents/offSecAgent/tools/playwrightMcp.ts
|
|
104159
|
-
import { writeFileSync as
|
|
104159
|
+
import { writeFileSync as writeFileSync3, mkdirSync as mkdirSync2, existsSync as existsSync10 } from "fs";
|
|
104160
104160
|
import { join as join3, dirname as dirname2 } from "path";
|
|
104161
104161
|
async function initializeMcpClient() {
|
|
104162
104162
|
if (mcpClient) {
|
|
@@ -104239,8 +104239,8 @@ function createBrowserTools(targetUrl, evidenceDir, mode = "pentest", logger, ab
|
|
|
104239
104239
|
abortSignal?.addEventListener("abort", () => {
|
|
104240
104240
|
disconnectMcpClient().catch(() => {});
|
|
104241
104241
|
});
|
|
104242
|
-
if (!
|
|
104243
|
-
|
|
104242
|
+
if (!existsSync10(evidenceDir)) {
|
|
104243
|
+
mkdirSync2(evidenceDir, { recursive: true });
|
|
104244
104244
|
}
|
|
104245
104245
|
const descriptions = mode === "pentest" ? PENTEST_DESCRIPTIONS : mode === "auth" ? AUTH_DESCRIPTIONS : OPERATOR_DESCRIPTIONS;
|
|
104246
104246
|
const browser_navigate = tool2({
|
|
@@ -104280,10 +104280,10 @@ Target base URL: ${targetUrl}`,
|
|
|
104280
104280
|
const screenshotFilename = `${filename}_${timestamp}.png`;
|
|
104281
104281
|
const screenshotPath = join3(evidenceDir, screenshotFilename);
|
|
104282
104282
|
const dir = dirname2(screenshotPath);
|
|
104283
|
-
if (!
|
|
104284
|
-
|
|
104283
|
+
if (!existsSync10(dir)) {
|
|
104284
|
+
mkdirSync2(dir, { recursive: true });
|
|
104285
104285
|
}
|
|
104286
|
-
|
|
104286
|
+
writeFileSync3(screenshotPath, Buffer.from(result.data, "base64"));
|
|
104287
104287
|
return {
|
|
104288
104288
|
success: true,
|
|
104289
104289
|
path: screenshotPath,
|
|
@@ -104916,7 +104916,7 @@ var init_httpRequest = __esm(() => {
|
|
|
104916
104916
|
|
|
104917
104917
|
// src/core/agents/offSecAgent/tools/documentFinding.ts
|
|
104918
104918
|
import { join as join5 } from "path";
|
|
104919
|
-
import { writeFileSync as
|
|
104919
|
+
import { writeFileSync as writeFileSync4, appendFileSync as appendFileSync2 } from "fs";
|
|
104920
104920
|
function documentFinding(ctx4) {
|
|
104921
104921
|
const { session } = ctx4;
|
|
104922
104922
|
return tool2({
|
|
@@ -104952,7 +104952,7 @@ FINDING STRUCTURE:
|
|
|
104952
104952
|
const jsonPath = join5(session.findingsPath, jsonFilename);
|
|
104953
104953
|
const mdFilename = `${findingId}.md`;
|
|
104954
104954
|
const mdPath = join5(session.findingsPath, mdFilename);
|
|
104955
|
-
|
|
104955
|
+
writeFileSync4(jsonPath, JSON.stringify(findingWithMeta, null, 2));
|
|
104956
104956
|
const markdown = `# ${finding.title}
|
|
104957
104957
|
|
|
104958
104958
|
**Severity:** ${finding.severity}
|
|
@@ -104991,12 +104991,12 @@ ${finding.references}` : ""}
|
|
|
104991
104991
|
|
|
104992
104992
|
*This finding was automatically documented by the Pensar penetration testing agent.*
|
|
104993
104993
|
`;
|
|
104994
|
-
|
|
104994
|
+
writeFileSync4(mdPath, markdown);
|
|
104995
104995
|
const summaryPath = join5(session.rootPath, "findings-summary.md");
|
|
104996
104996
|
const summaryEntry = `- [${finding.severity}] ${finding.title} - \`findings/${mdFilename}\`
|
|
104997
104997
|
`;
|
|
104998
104998
|
try {
|
|
104999
|
-
|
|
104999
|
+
appendFileSync2(summaryPath, summaryEntry);
|
|
105000
105000
|
} catch {
|
|
105001
105001
|
const header = `# Findings Summary
|
|
105002
105002
|
|
|
@@ -105006,7 +105006,7 @@ ${finding.references}` : ""}
|
|
|
105006
105006
|
## All Findings
|
|
105007
105007
|
|
|
105008
105008
|
`;
|
|
105009
|
-
|
|
105009
|
+
writeFileSync4(summaryPath, header + summaryEntry);
|
|
105010
105010
|
}
|
|
105011
105011
|
return {
|
|
105012
105012
|
success: true,
|
|
@@ -105047,11 +105047,11 @@ var init_documentFinding = __esm(() => {
|
|
|
105047
105047
|
import { join as join6 } from "path";
|
|
105048
105048
|
import { spawn as spawn3 } from "child_process";
|
|
105049
105049
|
import {
|
|
105050
|
-
existsSync as
|
|
105051
|
-
writeFileSync as
|
|
105050
|
+
existsSync as existsSync11,
|
|
105051
|
+
writeFileSync as writeFileSync5,
|
|
105052
105052
|
chmodSync,
|
|
105053
105053
|
unlinkSync,
|
|
105054
|
-
mkdirSync as
|
|
105054
|
+
mkdirSync as mkdirSync3
|
|
105055
105055
|
} from "fs";
|
|
105056
105056
|
function sanitizeFilename(str) {
|
|
105057
105057
|
return str.toLowerCase().replace(/[^a-z0-9_-]/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").substring(0, 50);
|
|
@@ -105092,8 +105092,8 @@ Max ${MAX_POC_ATTEMPTS} attempts per approach before pivoting.`,
|
|
|
105092
105092
|
}
|
|
105093
105093
|
try {
|
|
105094
105094
|
const pocsPath = ctx4.session.pocsPath;
|
|
105095
|
-
if (!
|
|
105096
|
-
|
|
105095
|
+
if (!existsSync11(pocsPath)) {
|
|
105096
|
+
mkdirSync3(pocsPath, { recursive: true });
|
|
105097
105097
|
}
|
|
105098
105098
|
const extension = poc.pocType === "bash" ? ".sh" : poc.pocType === "python" ? ".py" : ".js";
|
|
105099
105099
|
const sanitizedName = sanitizeFilename(poc.pocName);
|
|
@@ -105123,7 +105123,7 @@ ${commentChar} Attempt: ${currentAttempts}/${MAX_POC_ATTEMPTS}
|
|
|
105123
105123
|
`;
|
|
105124
105124
|
const afterShebang = pocContent.replace(/^#!.*\n/, (match) => match + header);
|
|
105125
105125
|
pocContent = afterShebang;
|
|
105126
|
-
|
|
105126
|
+
writeFileSync5(pocPath, pocContent);
|
|
105127
105127
|
chmodSync(pocPath, 493);
|
|
105128
105128
|
const runner = poc.pocType === "bash" ? "bash" : poc.pocType === "python" ? "python3" : "node";
|
|
105129
105129
|
const { stdout, stderr, exitCode } = await runScript(runner, pocPath, 60000, ctx4.abortSignal);
|
|
@@ -105447,7 +105447,7 @@ var init_grep = __esm(() => {
|
|
|
105447
105447
|
|
|
105448
105448
|
// src/core/agents/offSecAgent/tools/documentAsset.ts
|
|
105449
105449
|
import { join as join8 } from "path";
|
|
105450
|
-
import { writeFileSync as
|
|
105450
|
+
import { writeFileSync as writeFileSync6, mkdirSync as mkdirSync4, existsSync as existsSync12 } from "fs";
|
|
105451
105451
|
function documentAsset(ctx4) {
|
|
105452
105452
|
const assetsPath = join8(ctx4.session.rootPath, "assets");
|
|
105453
105453
|
return tool2({
|
|
@@ -105514,8 +105514,8 @@ Each asset creates a JSON file in the assets directory for tracking and analysis
|
|
|
105514
105514
|
toolCallDescription: exports_external.string().describe("A concise, human-readable description of what this tool call is doing")
|
|
105515
105515
|
}),
|
|
105516
105516
|
execute: async (asset) => {
|
|
105517
|
-
if (!
|
|
105518
|
-
|
|
105517
|
+
if (!existsSync12(assetsPath)) {
|
|
105518
|
+
mkdirSync4(assetsPath, { recursive: true });
|
|
105519
105519
|
}
|
|
105520
105520
|
const sanitizedName = asset.assetName.toLowerCase().replace(/[^a-z0-9-_.]/g, "_");
|
|
105521
105521
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
@@ -105527,7 +105527,7 @@ Each asset creates a JSON file in the assets directory for tracking and analysis
|
|
|
105527
105527
|
sessionId: ctx4.session.id,
|
|
105528
105528
|
target: ctx4.session.targets[0]
|
|
105529
105529
|
};
|
|
105530
|
-
|
|
105530
|
+
writeFileSync6(filepath, JSON.stringify(assetRecord, null, 2));
|
|
105531
105531
|
return {
|
|
105532
105532
|
success: true,
|
|
105533
105533
|
assetName: asset.assetName,
|
|
@@ -105546,7 +105546,7 @@ var init_documentAsset = __esm(() => {
|
|
|
105546
105546
|
|
|
105547
105547
|
// src/core/agents/offSecAgent/tools/authenticateSession.ts
|
|
105548
105548
|
import { join as join9 } from "path";
|
|
105549
|
-
import { writeFileSync as
|
|
105549
|
+
import { writeFileSync as writeFileSync7 } from "fs";
|
|
105550
105550
|
function authenticateSession(ctx4) {
|
|
105551
105551
|
return tool2({
|
|
105552
105552
|
description: `Authenticate with credentials and obtain a session cookie for subsequent authenticated requests.
|
|
@@ -105611,7 +105611,7 @@ Use this to:
|
|
|
105611
105611
|
loginUrl,
|
|
105612
105612
|
timestamp: new Date().toISOString()
|
|
105613
105613
|
};
|
|
105614
|
-
|
|
105614
|
+
writeFileSync7(sessionInfoPath, JSON.stringify(sessionInfo, null, 2));
|
|
105615
105615
|
return {
|
|
105616
105616
|
success: authenticated,
|
|
105617
105617
|
authenticated,
|
|
@@ -105923,7 +105923,7 @@ var init_authentication = __esm(() => {
|
|
|
105923
105923
|
|
|
105924
105924
|
// src/core/agents/offSecAgent/tools/delegateAuth.ts
|
|
105925
105925
|
import { join as join10 } from "path";
|
|
105926
|
-
import { writeFileSync as
|
|
105926
|
+
import { writeFileSync as writeFileSync8 } from "fs";
|
|
105927
105927
|
function mergeAuthCredentials(sessionCreds, explicit) {
|
|
105928
105928
|
const hasExplicit = explicit.username || explicit.password || explicit.apiKey || explicit.tokens;
|
|
105929
105929
|
const hasSession = sessionCreds && (sessionCreds.username || sessionCreds.password || sessionCreds.apiKey || sessionCreds.tokens);
|
|
@@ -106084,7 +106084,7 @@ When to use delegate_to_auth_subagent vs authenticate_session:
|
|
|
106084
106084
|
timestamp: new Date().toISOString(),
|
|
106085
106085
|
delegatedToSubagent: true
|
|
106086
106086
|
};
|
|
106087
|
-
|
|
106087
|
+
writeFileSync8(sessionInfoPath, JSON.stringify(sessionInfo, null, 2));
|
|
106088
106088
|
}
|
|
106089
106089
|
const hasHeaders = result.exportedHeaders && Object.keys(result.exportedHeaders).length > 0;
|
|
106090
106090
|
const hasCookies = result.exportedCookies && result.exportedCookies.length > 0;
|
|
@@ -106489,7 +106489,7 @@ var init_validateDiscovery = __esm(() => {
|
|
|
106489
106489
|
|
|
106490
106490
|
// src/core/agents/offSecAgent/tools/createAttackSurfaceReport.ts
|
|
106491
106491
|
import { join as join11 } from "path";
|
|
106492
|
-
import { writeFileSync as
|
|
106492
|
+
import { writeFileSync as writeFileSync9 } from "fs";
|
|
106493
106493
|
function createAttackSurfaceReport(ctx4) {
|
|
106494
106494
|
return tool2({
|
|
106495
106495
|
description: `Provide attack surface analysis results to the orchestrator agent.
|
|
@@ -106516,7 +106516,7 @@ Call this at the END of your analysis with:
|
|
|
106516
106516
|
}),
|
|
106517
106517
|
execute: async (results) => {
|
|
106518
106518
|
const resultsPath = join11(ctx4.session.rootPath, "attack-surface-results.json");
|
|
106519
|
-
|
|
106519
|
+
writeFileSync9(resultsPath, JSON.stringify(results, null, 2));
|
|
106520
106520
|
return {
|
|
106521
106521
|
success: true,
|
|
106522
106522
|
resultsPath,
|
|
@@ -106533,7 +106533,7 @@ var init_createAttackSurfaceReport = __esm(() => {
|
|
|
106533
106533
|
|
|
106534
106534
|
// src/core/agents/offSecAgent/tools/completeAuthentication.ts
|
|
106535
106535
|
import { join as join12 } from "path";
|
|
106536
|
-
import { existsSync as
|
|
106536
|
+
import { existsSync as existsSync13, mkdirSync as mkdirSync5, writeFileSync as writeFileSync10 } from "fs";
|
|
106537
106537
|
function completeAuthentication(ctx4) {
|
|
106538
106538
|
return tool2({
|
|
106539
106539
|
description: `Signal that the authentication process is complete.
|
|
@@ -106576,8 +106576,8 @@ This tool marks the end of the authentication flow.`,
|
|
|
106576
106576
|
if (result.success && (result.exportedCookies || result.exportedHeaders)) {
|
|
106577
106577
|
try {
|
|
106578
106578
|
const authDir = join12(ctx4.session.rootPath, AUTH_DIR);
|
|
106579
|
-
if (!
|
|
106580
|
-
|
|
106579
|
+
if (!existsSync13(authDir)) {
|
|
106580
|
+
mkdirSync5(authDir, { recursive: true });
|
|
106581
106581
|
}
|
|
106582
106582
|
authDataPath = join12(authDir, AUTH_DATA_FILENAME);
|
|
106583
106583
|
const authData = {
|
|
@@ -106589,7 +106589,7 @@ This tool marks the end of the authentication flow.`,
|
|
|
106589
106589
|
target: ctx4.target || "",
|
|
106590
106590
|
timestamp: new Date().toISOString()
|
|
106591
106591
|
};
|
|
106592
|
-
|
|
106592
|
+
writeFileSync10(authDataPath, JSON.stringify(authData, null, 2));
|
|
106593
106593
|
console.log(`Auth data persisted to ${authDataPath}`);
|
|
106594
106594
|
} catch (err) {
|
|
106595
106595
|
console.error(`Failed to persist auth data: ${err}`);
|
|
@@ -107299,16 +107299,16 @@ __export(exports_agent2, {
|
|
|
107299
107299
|
runPentestAgent: () => runPentestAgent,
|
|
107300
107300
|
TargetedPentestAgent: () => TargetedPentestAgent
|
|
107301
107301
|
});
|
|
107302
|
-
import { existsSync as
|
|
107302
|
+
import { existsSync as existsSync14, readdirSync as readdirSync2, readFileSync as readFileSync5 } from "fs";
|
|
107303
107303
|
import { join as join13 } from "path";
|
|
107304
107304
|
function buildPrompt2(target, objectives, sessionRootPath) {
|
|
107305
107305
|
const objectiveList = objectives.map((o, i) => `${i + 1}. ${o}`).join(`
|
|
107306
107306
|
`);
|
|
107307
107307
|
let authSection = "";
|
|
107308
107308
|
const authDataPath = join13(sessionRootPath, "auth", "auth-data.json");
|
|
107309
|
-
if (
|
|
107309
|
+
if (existsSync14(authDataPath)) {
|
|
107310
107310
|
try {
|
|
107311
|
-
const raw =
|
|
107311
|
+
const raw = readFileSync5(authDataPath, "utf-8");
|
|
107312
107312
|
const authData = JSON.parse(raw);
|
|
107313
107313
|
if (authData.authenticated) {
|
|
107314
107314
|
const parts = [
|
|
@@ -107354,12 +107354,12 @@ ${objectiveList}
|
|
|
107354
107354
|
Do NOT discover or enumerate other endpoints or services. Focus exclusively on the target and objectives above.`;
|
|
107355
107355
|
}
|
|
107356
107356
|
function loadFindings(findingsPath) {
|
|
107357
|
-
if (!
|
|
107357
|
+
if (!existsSync14(findingsPath)) {
|
|
107358
107358
|
return [];
|
|
107359
107359
|
}
|
|
107360
107360
|
return readdirSync2(findingsPath).filter((f) => f.endsWith(".json")).map((f) => {
|
|
107361
107361
|
try {
|
|
107362
|
-
const content =
|
|
107362
|
+
const content = readFileSync5(join13(findingsPath, f), "utf-8");
|
|
107363
107363
|
return JSON.parse(content);
|
|
107364
107364
|
} catch {
|
|
107365
107365
|
return null;
|
|
@@ -107809,7 +107809,7 @@ var init_spawnCodingAgent = __esm(() => {
|
|
|
107809
107809
|
|
|
107810
107810
|
// src/core/agents/offSecAgent/tools/provideComparisonResults.ts
|
|
107811
107811
|
import { join as join14 } from "path";
|
|
107812
|
-
import { writeFileSync as
|
|
107812
|
+
import { writeFileSync as writeFileSync11 } from "fs";
|
|
107813
107813
|
function provideComparisonResults(ctx4) {
|
|
107814
107814
|
return tool2({
|
|
107815
107815
|
description: `Provide the final comparison results with matched, missed, and extra findings.
|
|
@@ -107856,7 +107856,7 @@ Results will be saved to: comparison-results.json in the session directory.`,
|
|
|
107856
107856
|
precision
|
|
107857
107857
|
};
|
|
107858
107858
|
const resultsPath = join14(ctx4.session.rootPath, "comparison-results.json");
|
|
107859
|
-
|
|
107859
|
+
writeFileSync11(resultsPath, JSON.stringify(result, null, 2));
|
|
107860
107860
|
return {
|
|
107861
107861
|
success: true,
|
|
107862
107862
|
resultsPath,
|
|
@@ -108191,7 +108191,7 @@ __export(exports_blackboxAgent, {
|
|
|
108191
108191
|
BlackboxAttackSurfaceAgent: () => BlackboxAttackSurfaceAgent
|
|
108192
108192
|
});
|
|
108193
108193
|
import { join as join15 } from "path";
|
|
108194
|
-
import { existsSync as
|
|
108194
|
+
import { existsSync as existsSync15, mkdirSync as mkdirSync6, writeFileSync as writeFileSync12 } from "fs";
|
|
108195
108195
|
function buildPrompt4(target, session) {
|
|
108196
108196
|
const scopeConstraints = session.config?.scopeConstraints;
|
|
108197
108197
|
const authenticationInstructions = session.config?.authenticationInstructions;
|
|
@@ -108285,8 +108285,8 @@ var init_blackboxAgent = __esm(() => {
|
|
|
108285
108285
|
const resultsPath = join15(session.rootPath, "attack-surface-results.json");
|
|
108286
108286
|
const assetsPath = join15(session.rootPath, "assets");
|
|
108287
108287
|
const subagentFolder = join15(session.rootPath, "subagents", "attack-surface-agent");
|
|
108288
|
-
if (!
|
|
108289
|
-
|
|
108288
|
+
if (!existsSync15(subagentFolder)) {
|
|
108289
|
+
mkdirSync6(subagentFolder, { recursive: true });
|
|
108290
108290
|
}
|
|
108291
108291
|
super({
|
|
108292
108292
|
system: detectOSAndEnhancePrompt(SYSTEM),
|
|
@@ -108299,7 +108299,7 @@ var init_blackboxAgent = __esm(() => {
|
|
|
108299
108299
|
onStepFinish?.(e);
|
|
108300
108300
|
const messages = e.response.messages;
|
|
108301
108301
|
if (messages !== undefined) {
|
|
108302
|
-
|
|
108302
|
+
writeFileSync12(join15(subagentFolder, "attack-surface-agent.log"), JSON.stringify(messages, null, 2));
|
|
108303
108303
|
}
|
|
108304
108304
|
},
|
|
108305
108305
|
abortSignal,
|
|
@@ -108324,7 +108324,7 @@ var init_blackboxAgent = __esm(() => {
|
|
|
108324
108324
|
resolveResult: () => {
|
|
108325
108325
|
let results = null;
|
|
108326
108326
|
let targets = [];
|
|
108327
|
-
if (
|
|
108327
|
+
if (existsSync15(resultsPath)) {
|
|
108328
108328
|
try {
|
|
108329
108329
|
results = loadAttackSurfaceResults(resultsPath);
|
|
108330
108330
|
targets = results.targets || [];
|
|
@@ -135125,7 +135125,7 @@ var useTerminalDimensions = () => {
|
|
|
135125
135125
|
};
|
|
135126
135126
|
|
|
135127
135127
|
// src/tui/index.tsx
|
|
135128
|
-
var
|
|
135128
|
+
var import_react83 = __toESM(require_react(), 1);
|
|
135129
135129
|
|
|
135130
135130
|
// src/tui/components/footer.tsx
|
|
135131
135131
|
import os5 from "os";
|
|
@@ -135479,7 +135479,9 @@ var colors = {
|
|
|
135479
135479
|
linkColor: RGBA.fromInts(100, 200, 255, 255),
|
|
135480
135480
|
borderDark: RGBA.fromInts(30, 30, 30, 255),
|
|
135481
135481
|
backgroundDark: RGBA.fromInts(40, 40, 40, 255),
|
|
135482
|
-
backgroundDarker: RGBA.fromInts(10, 10, 10, 255)
|
|
135482
|
+
backgroundDarker: RGBA.fromInts(10, 10, 10, 255),
|
|
135483
|
+
backgroundElement: RGBA.fromInts(40, 40, 40, 255),
|
|
135484
|
+
modalOverlay: RGBA.fromInts(0, 0, 0, 150)
|
|
135483
135485
|
};
|
|
135484
135486
|
// src/tui/theme/index.ts
|
|
135485
135487
|
function getTierColor(colorsOrTier, maybeTier) {
|
|
@@ -136480,11 +136482,11 @@ function Footer({
|
|
|
136480
136482
|
}, undefined, false, undefined, this),
|
|
136481
136483
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(AgentStatus, {}, undefined, false, undefined, this),
|
|
136482
136484
|
route.data.type === "pentest" && session.active && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
136483
|
-
fg:
|
|
136485
|
+
fg: colors2.text,
|
|
136484
136486
|
children: [
|
|
136485
136487
|
"Session: ",
|
|
136486
136488
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
136487
|
-
fg:
|
|
136489
|
+
fg: colors2.textMuted,
|
|
136488
136490
|
children: session.active.name
|
|
136489
136491
|
}, undefined, false, undefined, this)
|
|
136490
136492
|
]
|
|
@@ -137331,7 +137333,7 @@ function Dialog({ size = "medium", onClose, children }) {
|
|
|
137331
137333
|
paddingTop: dimensions.height / 4,
|
|
137332
137334
|
left: 0,
|
|
137333
137335
|
top: 0,
|
|
137334
|
-
backgroundColor:
|
|
137336
|
+
backgroundColor: colors.modalOverlay,
|
|
137335
137337
|
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
137336
137338
|
onMouseUp: async (e) => {
|
|
137337
137339
|
if (renderer.getSelection())
|
|
@@ -137340,7 +137342,7 @@ function Dialog({ size = "medium", onClose, children }) {
|
|
|
137340
137342
|
},
|
|
137341
137343
|
width: size === "large" ? 80 : 60,
|
|
137342
137344
|
maxWidth: dimensions.width - 2,
|
|
137343
|
-
backgroundColor:
|
|
137345
|
+
backgroundColor: colors.backgroundElement,
|
|
137344
137346
|
paddingTop: 1,
|
|
137345
137347
|
children
|
|
137346
137348
|
}, undefined, false, undefined, this)
|
|
@@ -138561,13 +138563,7 @@ var providerNames = {
|
|
|
138561
138563
|
bedrock: "Bedrock",
|
|
138562
138564
|
local: "Local LLM"
|
|
138563
138565
|
};
|
|
138564
|
-
var providerOrder = [
|
|
138565
|
-
"anthropic",
|
|
138566
|
-
"openai",
|
|
138567
|
-
"openrouter",
|
|
138568
|
-
"bedrock",
|
|
138569
|
-
"local"
|
|
138570
|
-
];
|
|
138566
|
+
var providerOrder = ["anthropic", "openai", "openrouter", "bedrock", "local"];
|
|
138571
138567
|
function ModelPicker({
|
|
138572
138568
|
config: config2,
|
|
138573
138569
|
selectedModel,
|
|
@@ -138809,7 +138805,7 @@ function ModelPicker({
|
|
|
138809
138805
|
children: [
|
|
138810
138806
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
138811
138807
|
fg: colors2.primary,
|
|
138812
|
-
children: "
|
|
138808
|
+
children: " URL: "
|
|
138813
138809
|
}, undefined, false, undefined, this),
|
|
138814
138810
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("input", {
|
|
138815
138811
|
focused: true,
|
|
@@ -138840,7 +138836,7 @@ function ModelPicker({
|
|
|
138840
138836
|
children: [
|
|
138841
138837
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
138842
138838
|
fg: colors2.primary,
|
|
138843
|
-
children: "
|
|
138839
|
+
children: " Model: "
|
|
138844
138840
|
}, undefined, false, undefined, this),
|
|
138845
138841
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("input", {
|
|
138846
138842
|
focused: true,
|
|
@@ -139293,6 +139289,8 @@ var Input = import_react38.forwardRef(function Input2(opts, ref) {
|
|
|
139293
139289
|
backgroundColor: "transparent",
|
|
139294
139290
|
focused,
|
|
139295
139291
|
cursorColor: colors2.textMuted,
|
|
139292
|
+
textColor: colors2.text,
|
|
139293
|
+
focusedTextColor: colors2.text,
|
|
139296
139294
|
...inputProps
|
|
139297
139295
|
}, undefined, false, undefined, this)
|
|
139298
139296
|
]
|
|
@@ -142372,6 +142370,206 @@ function ResponsibleUseDisclosure({
|
|
|
142372
142370
|
}, undefined, true, undefined, this);
|
|
142373
142371
|
}
|
|
142374
142372
|
|
|
142373
|
+
// src/tui/context/toast.tsx
|
|
142374
|
+
var import_react53 = __toESM(require_react(), 1);
|
|
142375
|
+
var ToastContext = import_react53.createContext(null);
|
|
142376
|
+
var nextId = 0;
|
|
142377
|
+
var DEFAULT_DURATION = {
|
|
142378
|
+
default: 3000,
|
|
142379
|
+
warn: 4000,
|
|
142380
|
+
error: 5000
|
|
142381
|
+
};
|
|
142382
|
+
function ToastProvider({ children }) {
|
|
142383
|
+
const [toasts, setToasts] = import_react53.useState([]);
|
|
142384
|
+
const dismiss = import_react53.useCallback((id) => {
|
|
142385
|
+
setToasts((prev) => prev.filter((t2) => t2.id !== id));
|
|
142386
|
+
}, []);
|
|
142387
|
+
const toast = import_react53.useCallback((message, variant = "default", duration) => {
|
|
142388
|
+
const id = nextId++;
|
|
142389
|
+
const ms = duration ?? DEFAULT_DURATION[variant];
|
|
142390
|
+
setToasts((prev) => [...prev, { id, message, variant, duration: ms }]);
|
|
142391
|
+
setTimeout(() => dismiss(id), ms);
|
|
142392
|
+
}, [dismiss]);
|
|
142393
|
+
const value = import_react53.useMemo(() => ({ toasts, toast, dismiss }), [toasts, toast, dismiss]);
|
|
142394
|
+
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ToastContext.Provider, {
|
|
142395
|
+
value,
|
|
142396
|
+
children
|
|
142397
|
+
}, undefined, false, undefined, this);
|
|
142398
|
+
}
|
|
142399
|
+
function useToast() {
|
|
142400
|
+
const ctx4 = import_react53.useContext(ToastContext);
|
|
142401
|
+
if (!ctx4)
|
|
142402
|
+
throw new Error("useToast() must be used within <ToastProvider>");
|
|
142403
|
+
return ctx4;
|
|
142404
|
+
}
|
|
142405
|
+
|
|
142406
|
+
// src/tui/components/toast.tsx
|
|
142407
|
+
var VARIANT_ICONS = {
|
|
142408
|
+
default: "●",
|
|
142409
|
+
error: "✖",
|
|
142410
|
+
warn: "⚠"
|
|
142411
|
+
};
|
|
142412
|
+
function variantColor(variant, colors2) {
|
|
142413
|
+
switch (variant) {
|
|
142414
|
+
case "error":
|
|
142415
|
+
return colors2.error;
|
|
142416
|
+
case "warn":
|
|
142417
|
+
return colors2.warning;
|
|
142418
|
+
default:
|
|
142419
|
+
return colors2.info;
|
|
142420
|
+
}
|
|
142421
|
+
}
|
|
142422
|
+
function ToastItem({
|
|
142423
|
+
message,
|
|
142424
|
+
variant,
|
|
142425
|
+
onDismiss
|
|
142426
|
+
}) {
|
|
142427
|
+
const { colors: colors2 } = useTheme();
|
|
142428
|
+
const accent = variantColor(variant, colors2);
|
|
142429
|
+
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
142430
|
+
flexDirection: "row",
|
|
142431
|
+
gap: 1,
|
|
142432
|
+
paddingLeft: 1,
|
|
142433
|
+
paddingRight: 1,
|
|
142434
|
+
border: ["left"],
|
|
142435
|
+
borderColor: accent,
|
|
142436
|
+
backgroundColor: colors2.backgroundPanel,
|
|
142437
|
+
onMouseUp: () => onDismiss(),
|
|
142438
|
+
children: [
|
|
142439
|
+
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
142440
|
+
fg: accent,
|
|
142441
|
+
children: VARIANT_ICONS[variant]
|
|
142442
|
+
}, undefined, false, undefined, this),
|
|
142443
|
+
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
142444
|
+
fg: colors2.text,
|
|
142445
|
+
children: message
|
|
142446
|
+
}, undefined, false, undefined, this)
|
|
142447
|
+
]
|
|
142448
|
+
}, undefined, true, undefined, this);
|
|
142449
|
+
}
|
|
142450
|
+
function ToastContainer() {
|
|
142451
|
+
const { toasts, dismiss } = useToast();
|
|
142452
|
+
const dims = useTerminalDimensions();
|
|
142453
|
+
if (toasts.length === 0)
|
|
142454
|
+
return null;
|
|
142455
|
+
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
142456
|
+
position: "absolute",
|
|
142457
|
+
right: 1,
|
|
142458
|
+
top: 0,
|
|
142459
|
+
flexDirection: "column",
|
|
142460
|
+
gap: 0,
|
|
142461
|
+
alignItems: "flex-end",
|
|
142462
|
+
maxWidth: Math.min(60, dims.width - 4),
|
|
142463
|
+
zIndex: 9999,
|
|
142464
|
+
children: toasts.map((t2) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ToastItem, {
|
|
142465
|
+
message: t2.message,
|
|
142466
|
+
variant: t2.variant,
|
|
142467
|
+
onDismiss: () => dismiss(t2.id)
|
|
142468
|
+
}, t2.id, false, undefined, this))
|
|
142469
|
+
}, undefined, false, undefined, this);
|
|
142470
|
+
}
|
|
142471
|
+
|
|
142472
|
+
// src/tui/components/error-boundary.tsx
|
|
142473
|
+
var import_react55 = __toESM(require_react(), 1);
|
|
142474
|
+
|
|
142475
|
+
// src/core/logger/index.ts
|
|
142476
|
+
import {
|
|
142477
|
+
appendFileSync,
|
|
142478
|
+
existsSync as existsSync8,
|
|
142479
|
+
mkdirSync,
|
|
142480
|
+
readFileSync as readFileSync2,
|
|
142481
|
+
writeFileSync as writeFileSync2
|
|
142482
|
+
} from "fs";
|
|
142483
|
+
import os6 from "os";
|
|
142484
|
+
import path7 from "path";
|
|
142485
|
+
var ERROR_LOG_PATH = path7.join(os6.homedir(), ".pensar", "error.log");
|
|
142486
|
+
var RETENTION_DAYS = 7;
|
|
142487
|
+
var TIMESTAMP_RE = /^(\d{4}-\d{2}-\d{2}T[\d:.]+Z) - /;
|
|
142488
|
+
var hasPruned = false;
|
|
142489
|
+
function pruneErrorLog() {
|
|
142490
|
+
if (hasPruned)
|
|
142491
|
+
return;
|
|
142492
|
+
hasPruned = true;
|
|
142493
|
+
try {
|
|
142494
|
+
if (!existsSync8(ERROR_LOG_PATH))
|
|
142495
|
+
return;
|
|
142496
|
+
const cutoff = Date.now() - RETENTION_DAYS * 86400000;
|
|
142497
|
+
const raw = readFileSync2(ERROR_LOG_PATH, "utf8");
|
|
142498
|
+
const lines = raw.split(`
|
|
142499
|
+
`);
|
|
142500
|
+
const kept = [];
|
|
142501
|
+
let keeping = true;
|
|
142502
|
+
for (const line of lines) {
|
|
142503
|
+
const match = TIMESTAMP_RE.exec(line);
|
|
142504
|
+
if (match) {
|
|
142505
|
+
keeping = new Date(match[1]).getTime() >= cutoff;
|
|
142506
|
+
}
|
|
142507
|
+
if (keeping) {
|
|
142508
|
+
kept.push(line);
|
|
142509
|
+
}
|
|
142510
|
+
}
|
|
142511
|
+
writeFileSync2(ERROR_LOG_PATH, kept.join(`
|
|
142512
|
+
`), "utf8");
|
|
142513
|
+
} catch {}
|
|
142514
|
+
}
|
|
142515
|
+
function writeErrorLog(error, source) {
|
|
142516
|
+
try {
|
|
142517
|
+
pruneErrorLog();
|
|
142518
|
+
const dir = path7.dirname(ERROR_LOG_PATH);
|
|
142519
|
+
if (!existsSync8(dir)) {
|
|
142520
|
+
mkdirSync(dir, { recursive: true });
|
|
142521
|
+
}
|
|
142522
|
+
const timestamp = new Date().toISOString();
|
|
142523
|
+
const tag = source ? `[${source}] ` : "";
|
|
142524
|
+
const message = error instanceof Error ? `${error.message}
|
|
142525
|
+
${error.stack ?? ""}` : String(error);
|
|
142526
|
+
const entry = `${timestamp} - [ERROR] ${tag}${message}
|
|
142527
|
+
`;
|
|
142528
|
+
appendFileSync(ERROR_LOG_PATH, entry, "utf8");
|
|
142529
|
+
} catch {}
|
|
142530
|
+
}
|
|
142531
|
+
|
|
142532
|
+
// src/tui/components/error-boundary.tsx
|
|
142533
|
+
var MAX_ERRORS = 3;
|
|
142534
|
+
var ERROR_WINDOW_MS = 5000;
|
|
142535
|
+
|
|
142536
|
+
class ErrorBoundaryInner extends import_react55.default.Component {
|
|
142537
|
+
state = {
|
|
142538
|
+
hasError: false,
|
|
142539
|
+
errorTimestamps: [],
|
|
142540
|
+
halted: false
|
|
142541
|
+
};
|
|
142542
|
+
static getDerivedStateFromError() {
|
|
142543
|
+
return { hasError: true };
|
|
142544
|
+
}
|
|
142545
|
+
componentDidCatch(error) {
|
|
142546
|
+
console.error("[ErrorBoundary]", error);
|
|
142547
|
+
writeErrorLog(error, "TUI");
|
|
142548
|
+
this.props.onError(error.message);
|
|
142549
|
+
const now = Date.now();
|
|
142550
|
+
const recent = [...this.state.errorTimestamps, now].filter((t2) => now - t2 < ERROR_WINDOW_MS);
|
|
142551
|
+
if (recent.length >= MAX_ERRORS) {
|
|
142552
|
+
this.props.onError("Too many errors in quick succession — UI recovery halted.");
|
|
142553
|
+
this.setState({ halted: true, hasError: false, errorTimestamps: recent });
|
|
142554
|
+
return;
|
|
142555
|
+
}
|
|
142556
|
+
this.setState({ hasError: false, errorTimestamps: recent });
|
|
142557
|
+
}
|
|
142558
|
+
render() {
|
|
142559
|
+
if (this.state.halted) {
|
|
142560
|
+
return null;
|
|
142561
|
+
}
|
|
142562
|
+
return this.props.children;
|
|
142563
|
+
}
|
|
142564
|
+
}
|
|
142565
|
+
function ErrorBoundary2({ children }) {
|
|
142566
|
+
const { toast } = useToast();
|
|
142567
|
+
const handleError = import_react55.useCallback((message) => {
|
|
142568
|
+
toast(message, "error");
|
|
142569
|
+
}, [toast]);
|
|
142570
|
+
return import_react55.default.createElement(ErrorBoundaryInner, { onError: handleError }, children);
|
|
142571
|
+
}
|
|
142572
|
+
|
|
142375
142573
|
// src/tui/keybindings-registry.ts
|
|
142376
142574
|
var keybindings = [
|
|
142377
142575
|
{
|
|
@@ -142477,16 +142675,16 @@ function ShortcutsDialog({
|
|
|
142477
142675
|
}
|
|
142478
142676
|
|
|
142479
142677
|
// src/tui/components/commands/help-dialog.tsx
|
|
142480
|
-
var
|
|
142678
|
+
var import_react57 = __toESM(require_react(), 1);
|
|
142481
142679
|
function HelpDialog() {
|
|
142482
142680
|
const { colors: colors2 } = useTheme();
|
|
142483
142681
|
const { commands: commands2 } = useCommand();
|
|
142484
142682
|
const route = useRoute();
|
|
142485
142683
|
const dimensions = useTerminalDimensions();
|
|
142486
|
-
const [selectedIndex, setSelectedIndex] =
|
|
142487
|
-
const [showDetail, setShowDetail] =
|
|
142488
|
-
const scrollboxRef =
|
|
142489
|
-
const commandsByCategory =
|
|
142684
|
+
const [selectedIndex, setSelectedIndex] = import_react57.useState(0);
|
|
142685
|
+
const [showDetail, setShowDetail] = import_react57.useState(false);
|
|
142686
|
+
const scrollboxRef = import_react57.useRef(null);
|
|
142687
|
+
const commandsByCategory = import_react57.useMemo(() => {
|
|
142490
142688
|
const grouped = {};
|
|
142491
142689
|
for (const cmd of commands2) {
|
|
142492
142690
|
const category = cmd.category || "Other";
|
|
@@ -142497,15 +142695,15 @@ function HelpDialog() {
|
|
|
142497
142695
|
}
|
|
142498
142696
|
return grouped;
|
|
142499
142697
|
}, [commands2]);
|
|
142500
|
-
const flatCommands =
|
|
142698
|
+
const flatCommands = import_react57.useMemo(() => {
|
|
142501
142699
|
return commands2;
|
|
142502
142700
|
}, [commands2]);
|
|
142503
|
-
|
|
142701
|
+
import_react57.useEffect(() => {
|
|
142504
142702
|
if (selectedIndex >= flatCommands.length) {
|
|
142505
142703
|
setSelectedIndex(Math.max(0, flatCommands.length - 1));
|
|
142506
142704
|
}
|
|
142507
142705
|
}, [flatCommands.length, selectedIndex]);
|
|
142508
|
-
|
|
142706
|
+
import_react57.useEffect(() => {
|
|
142509
142707
|
scrollToIndex(scrollboxRef.current, selectedIndex, flatCommands, (cmd) => cmd.name);
|
|
142510
142708
|
}, [selectedIndex, flatCommands]);
|
|
142511
142709
|
const handleClose = () => {
|
|
@@ -142940,10 +143138,10 @@ function ModelsDisplay() {
|
|
|
142940
143138
|
}
|
|
142941
143139
|
|
|
142942
143140
|
// src/tui/context/keybinding.tsx
|
|
142943
|
-
var
|
|
143141
|
+
var import_react64 = __toESM(require_react(), 1);
|
|
142944
143142
|
|
|
142945
143143
|
// src/tui/keybindings/keybind.tsx
|
|
142946
|
-
var
|
|
143144
|
+
var import_react60 = __toESM(require_react(), 1);
|
|
142947
143145
|
|
|
142948
143146
|
// src/tui/keybindings/actions.ts
|
|
142949
143147
|
var movementActions = [
|
|
@@ -143195,7 +143393,7 @@ var allActions = [
|
|
|
143195
143393
|
var actionsByKey = new Map(allActions.map((action) => [action.key, action]));
|
|
143196
143394
|
var actionsById = new Map(allActions.map((action) => [action.id, action]));
|
|
143197
143395
|
// src/tui/keybindings/keybind.tsx
|
|
143198
|
-
var LeaderKeyContext =
|
|
143396
|
+
var LeaderKeyContext = import_react60.createContext(null);
|
|
143199
143397
|
// src/tui/keybindings/registry.ts
|
|
143200
143398
|
function createKeybindings(deps) {
|
|
143201
143399
|
const {
|
|
@@ -143401,7 +143599,7 @@ var Keybind;
|
|
|
143401
143599
|
})(Keybind ||= {});
|
|
143402
143600
|
|
|
143403
143601
|
// src/tui/context/keybinding.tsx
|
|
143404
|
-
var KeybindingContext =
|
|
143602
|
+
var KeybindingContext = import_react64.createContext(undefined);
|
|
143405
143603
|
function KeybindingProvider({
|
|
143406
143604
|
children,
|
|
143407
143605
|
deps
|
|
@@ -143440,15 +143638,15 @@ function KeybindingProvider({
|
|
|
143440
143638
|
}
|
|
143441
143639
|
|
|
143442
143640
|
// src/tui/components/pentest/pentest.tsx
|
|
143443
|
-
var
|
|
143444
|
-
import { existsSync as
|
|
143641
|
+
var import_react73 = __toESM(require_react(), 1);
|
|
143642
|
+
import { existsSync as existsSync17, readdirSync as readdirSync4, readFileSync as readFileSync7 } from "fs";
|
|
143445
143643
|
import { join as join17 } from "path";
|
|
143446
143644
|
import { exec as exec3 } from "child_process";
|
|
143447
143645
|
|
|
143448
143646
|
// src/core/workflows/pentest.ts
|
|
143449
143647
|
init_blackboxAgent();
|
|
143450
143648
|
init_agent3();
|
|
143451
|
-
import { existsSync as
|
|
143649
|
+
import { existsSync as existsSync16, readdirSync as readdirSync3, readFileSync as readFileSync6 } from "fs";
|
|
143452
143650
|
import { join as join16 } from "path";
|
|
143453
143651
|
|
|
143454
143652
|
// src/core/workflows/whiteboxAttackSurface.ts
|
|
@@ -143887,7 +144085,7 @@ async function runPentestWorkflow(input) {
|
|
|
143887
144085
|
findings,
|
|
143888
144086
|
findingsPath: session.findingsPath,
|
|
143889
144087
|
pocsPath: session.pocsPath,
|
|
143890
|
-
reportPath:
|
|
144088
|
+
reportPath: existsSync16(reportPath) ? reportPath : null
|
|
143891
144089
|
};
|
|
143892
144090
|
}
|
|
143893
144091
|
async function runWhiteboxPhase(opts) {
|
|
@@ -143957,12 +144155,12 @@ async function runWithBoundedConcurrency2(items, concurrency, fn) {
|
|
|
143957
144155
|
return results;
|
|
143958
144156
|
}
|
|
143959
144157
|
function loadFindings2(findingsPath) {
|
|
143960
|
-
if (!
|
|
144158
|
+
if (!existsSync16(findingsPath)) {
|
|
143961
144159
|
return [];
|
|
143962
144160
|
}
|
|
143963
144161
|
return readdirSync3(findingsPath).filter((f) => f.endsWith(".json")).map((f) => {
|
|
143964
144162
|
try {
|
|
143965
|
-
const content =
|
|
144163
|
+
const content = readFileSync6(join16(findingsPath, f), "utf-8");
|
|
143966
144164
|
return JSON.parse(content);
|
|
143967
144165
|
} catch {
|
|
143968
144166
|
return null;
|
|
@@ -143991,7 +144189,7 @@ Found ${findings.length} vulnerabilities`);
|
|
|
143991
144189
|
}
|
|
143992
144190
|
|
|
143993
144191
|
// src/tui/components/agent-display.tsx
|
|
143994
|
-
var
|
|
144192
|
+
var import_react71 = __toESM(require_react(), 1);
|
|
143995
144193
|
|
|
143996
144194
|
// node_modules/marked/lib/marked.esm.js
|
|
143997
144195
|
function L2() {
|
|
@@ -145757,14 +145955,14 @@ function getResultSummary(result, toolName) {
|
|
|
145757
145955
|
return null;
|
|
145758
145956
|
}
|
|
145759
145957
|
// src/tui/components/shared/ascii-spinner.tsx
|
|
145760
|
-
var
|
|
145958
|
+
var import_react65 = __toESM(require_react(), 1);
|
|
145761
145959
|
var SPINNER_FRAMES = ["/", "-", "\\", "|"];
|
|
145762
145960
|
var SPINNER_INTERVAL = 100;
|
|
145763
145961
|
function AsciiSpinner({ label, fg: fg2 }) {
|
|
145764
145962
|
const { colors: colors2 } = useTheme();
|
|
145765
145963
|
const spinnerColor = fg2 ?? colors2.info;
|
|
145766
|
-
const [frame, setFrame] =
|
|
145767
|
-
|
|
145964
|
+
const [frame, setFrame] = import_react65.useState(0);
|
|
145965
|
+
import_react65.useEffect(() => {
|
|
145768
145966
|
const interval = setInterval(() => {
|
|
145769
145967
|
setFrame((f) => (f + 1) % SPINNER_FRAMES.length);
|
|
145770
145968
|
}, SPINNER_INTERVAL);
|
|
@@ -145776,14 +145974,14 @@ function AsciiSpinner({ label, fg: fg2 }) {
|
|
|
145776
145974
|
}, undefined, false, undefined, this);
|
|
145777
145975
|
}
|
|
145778
145976
|
// src/tui/components/shared/tool-renderer.tsx
|
|
145779
|
-
var
|
|
145780
|
-
var ToolRenderer =
|
|
145977
|
+
var import_react66 = __toESM(require_react(), 1);
|
|
145978
|
+
var ToolRenderer = import_react66.memo(function ToolRenderer2({
|
|
145781
145979
|
message,
|
|
145782
145980
|
verbose = false,
|
|
145783
145981
|
expandedLogs = false
|
|
145784
145982
|
}) {
|
|
145785
145983
|
const { colors: colors2 } = useTheme();
|
|
145786
|
-
const [showOutput, setShowOutput] =
|
|
145984
|
+
const [showOutput, setShowOutput] = import_react66.useState(false);
|
|
145787
145985
|
if (!isToolMessage(message)) {
|
|
145788
145986
|
return null;
|
|
145789
145987
|
}
|
|
@@ -145880,8 +146078,8 @@ var ToolRenderer = import_react63.memo(function ToolRenderer2({
|
|
|
145880
146078
|
}, undefined, true, undefined, this);
|
|
145881
146079
|
});
|
|
145882
146080
|
// src/tui/components/shared/message-renderer.tsx
|
|
145883
|
-
var
|
|
145884
|
-
var MessageRenderer =
|
|
146081
|
+
var import_react67 = __toESM(require_react(), 1);
|
|
146082
|
+
var MessageRenderer = import_react67.memo(function MessageRenderer2({
|
|
145885
146083
|
message,
|
|
145886
146084
|
isStreaming = false,
|
|
145887
146085
|
verbose = false,
|
|
@@ -145891,7 +146089,7 @@ var MessageRenderer = import_react64.memo(function MessageRenderer2({
|
|
|
145891
146089
|
}) {
|
|
145892
146090
|
const { colors: colors2 } = useTheme();
|
|
145893
146091
|
const content = typeof message.content === "string" ? message.content : JSON.stringify(message.content);
|
|
145894
|
-
const displayContent =
|
|
146092
|
+
const displayContent = import_react67.useMemo(() => message.role === "assistant" ? markdownToStyledText(content, colors2) : content, [content, message.role, colors2]);
|
|
145895
146093
|
if (isToolMessage(message)) {
|
|
145896
146094
|
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ToolRenderer, {
|
|
145897
146095
|
message,
|
|
@@ -146003,9 +146201,9 @@ var MessageRenderer = import_react64.memo(function MessageRenderer2({
|
|
|
146003
146201
|
}, undefined, false, undefined, this);
|
|
146004
146202
|
});
|
|
146005
146203
|
// src/tui/components/shared/approval-prompt.tsx
|
|
146006
|
-
var
|
|
146204
|
+
var import_react68 = __toESM(require_react(), 1);
|
|
146007
146205
|
// src/tui/components/shared/message-reducer.ts
|
|
146008
|
-
var
|
|
146206
|
+
var import_react70 = __toESM(require_react(), 1);
|
|
146009
146207
|
// src/tui/components/agent-display.tsx
|
|
146010
146208
|
function getStableKey(item, contextId = "root") {
|
|
146011
146209
|
if ("messages" in item) {
|
|
@@ -146081,11 +146279,11 @@ function AgentDisplay({
|
|
|
146081
146279
|
]
|
|
146082
146280
|
}, undefined, true, undefined, this);
|
|
146083
146281
|
}
|
|
146084
|
-
var SubAgentDisplay =
|
|
146282
|
+
var SubAgentDisplay = import_react71.memo(function SubAgentDisplay2({
|
|
146085
146283
|
subagent
|
|
146086
146284
|
}) {
|
|
146087
146285
|
const { colors: colors2 } = useTheme();
|
|
146088
|
-
const [open, setOpen] =
|
|
146286
|
+
const [open, setOpen] = import_react71.useState(false);
|
|
146089
146287
|
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
146090
146288
|
height: open ? 40 : "auto",
|
|
146091
146289
|
onMouseDown: () => setOpen(!open),
|
|
@@ -146140,7 +146338,7 @@ var SubAgentDisplay = import_react68.memo(function SubAgentDisplay2({
|
|
|
146140
146338
|
]
|
|
146141
146339
|
}, undefined, true, undefined, this);
|
|
146142
146340
|
});
|
|
146143
|
-
var AgentMessage =
|
|
146341
|
+
var AgentMessage = import_react71.memo(function AgentMessage2({
|
|
146144
146342
|
message
|
|
146145
146343
|
}) {
|
|
146146
146344
|
const { colors: colors2 } = useTheme();
|
|
@@ -146253,8 +146451,8 @@ var AgentMessage = import_react68.memo(function AgentMessage2({
|
|
|
146253
146451
|
});
|
|
146254
146452
|
function ToolDetails({ message }) {
|
|
146255
146453
|
const { colors: colors2 } = useTheme();
|
|
146256
|
-
const [showArgs, setShowArgs] =
|
|
146257
|
-
const [showResult, setShowResult] =
|
|
146454
|
+
const [showArgs, setShowArgs] = import_react71.useState(false);
|
|
146455
|
+
const [showResult, setShowResult] = import_react71.useState(false);
|
|
146258
146456
|
if (message.role !== "tool") {
|
|
146259
146457
|
return null;
|
|
146260
146458
|
}
|
|
@@ -146326,32 +146524,29 @@ function ToolDetails({ message }) {
|
|
|
146326
146524
|
}
|
|
146327
146525
|
|
|
146328
146526
|
// src/tui/components/pentest/pentest.tsx
|
|
146329
|
-
var green2 = colors.greenAccent;
|
|
146330
|
-
var cream = colors.creamText;
|
|
146331
|
-
var dim2 = colors.dimText;
|
|
146332
|
-
var dark = colors.backgroundDarker;
|
|
146333
146527
|
function Pentest({ sessionId }) {
|
|
146528
|
+
const { colors: colors2 } = useTheme();
|
|
146334
146529
|
const route = useRoute();
|
|
146335
146530
|
const { model, setThinking, setIsExecuting, isExecuting } = useAgent();
|
|
146336
146531
|
const { stack, externalDialogOpen } = useDialog();
|
|
146337
|
-
const [session, setSession] =
|
|
146338
|
-
const [error41, setError] =
|
|
146339
|
-
const [phase, setPhase] =
|
|
146340
|
-
const [abortController, setAbortController] =
|
|
146341
|
-
const [panelMessages, setPanelMessages] =
|
|
146342
|
-
const panelTextRef =
|
|
146343
|
-
const panelSourceRef =
|
|
146344
|
-
const [pentestAgents, setPentestAgents] =
|
|
146345
|
-
const pentestTextRefs =
|
|
146346
|
-
const [assets, setAssets] =
|
|
146347
|
-
const [viewMode, setViewMode] =
|
|
146348
|
-
const [selectedAgentId, setSelectedAgentId] =
|
|
146349
|
-
const [focusedIndex, setFocusedIndex] =
|
|
146350
|
-
const [showOrchestratorPanel, setShowOrchestratorPanel] =
|
|
146351
|
-
const [startTime, setStartTime] =
|
|
146352
|
-
const pentestAgentList =
|
|
146353
|
-
const selectedAgent =
|
|
146354
|
-
|
|
146532
|
+
const [session, setSession] = import_react73.useState(null);
|
|
146533
|
+
const [error41, setError] = import_react73.useState(null);
|
|
146534
|
+
const [phase, setPhase] = import_react73.useState("loading");
|
|
146535
|
+
const [abortController, setAbortController] = import_react73.useState(null);
|
|
146536
|
+
const [panelMessages, setPanelMessages] = import_react73.useState([]);
|
|
146537
|
+
const panelTextRef = import_react73.useRef("");
|
|
146538
|
+
const panelSourceRef = import_react73.useRef(null);
|
|
146539
|
+
const [pentestAgents, setPentestAgents] = import_react73.useState({});
|
|
146540
|
+
const pentestTextRefs = import_react73.useRef({});
|
|
146541
|
+
const [assets, setAssets] = import_react73.useState([]);
|
|
146542
|
+
const [viewMode, setViewMode] = import_react73.useState("overview");
|
|
146543
|
+
const [selectedAgentId, setSelectedAgentId] = import_react73.useState(null);
|
|
146544
|
+
const [focusedIndex, setFocusedIndex] = import_react73.useState(0);
|
|
146545
|
+
const [showOrchestratorPanel, setShowOrchestratorPanel] = import_react73.useState(false);
|
|
146546
|
+
const [startTime, setStartTime] = import_react73.useState(null);
|
|
146547
|
+
const pentestAgentList = import_react73.useMemo(() => Object.values(pentestAgents).sort((a, b3) => a.createdAt.getTime() - b3.createdAt.getTime()), [pentestAgents]);
|
|
146548
|
+
const selectedAgent = import_react73.useMemo(() => selectedAgentId ? pentestAgents[selectedAgentId] ?? null : null, [pentestAgents, selectedAgentId]);
|
|
146549
|
+
import_react73.useEffect(() => {
|
|
146355
146550
|
async function load() {
|
|
146356
146551
|
try {
|
|
146357
146552
|
const s = await sessions.get(sessionId);
|
|
@@ -146368,19 +146563,19 @@ function Pentest({ sessionId }) {
|
|
|
146368
146563
|
}
|
|
146369
146564
|
load();
|
|
146370
146565
|
}, [sessionId]);
|
|
146371
|
-
|
|
146566
|
+
import_react73.useEffect(() => {
|
|
146372
146567
|
if (!session)
|
|
146373
146568
|
return;
|
|
146374
146569
|
const assetsPath = join17(session.rootPath, "assets");
|
|
146375
146570
|
function readAssets() {
|
|
146376
|
-
if (!
|
|
146571
|
+
if (!existsSync17(assetsPath))
|
|
146377
146572
|
return;
|
|
146378
146573
|
try {
|
|
146379
146574
|
const files = readdirSync4(assetsPath).filter((f) => f.endsWith(".json"));
|
|
146380
146575
|
const loaded = [];
|
|
146381
146576
|
for (const file2 of files) {
|
|
146382
146577
|
try {
|
|
146383
|
-
const content =
|
|
146578
|
+
const content = readFileSync7(join17(assetsPath, file2), "utf-8");
|
|
146384
146579
|
loaded.push(JSON.parse(content));
|
|
146385
146580
|
} catch {}
|
|
146386
146581
|
}
|
|
@@ -146391,12 +146586,12 @@ function Pentest({ sessionId }) {
|
|
|
146391
146586
|
const interval = setInterval(readAssets, 2000);
|
|
146392
146587
|
return () => clearInterval(interval);
|
|
146393
146588
|
}, [session]);
|
|
146394
|
-
|
|
146589
|
+
import_react73.useEffect(() => {
|
|
146395
146590
|
return () => {
|
|
146396
146591
|
abortController?.abort();
|
|
146397
146592
|
};
|
|
146398
146593
|
}, [abortController]);
|
|
146399
|
-
const ensurePentestAgent =
|
|
146594
|
+
const ensurePentestAgent = import_react73.useCallback((subagentId) => {
|
|
146400
146595
|
setPentestAgents((prev) => {
|
|
146401
146596
|
if (prev[subagentId])
|
|
146402
146597
|
return prev;
|
|
@@ -146413,7 +146608,7 @@ function Pentest({ sessionId }) {
|
|
|
146413
146608
|
};
|
|
146414
146609
|
});
|
|
146415
146610
|
}, []);
|
|
146416
|
-
const handleSubagentSpawn =
|
|
146611
|
+
const handleSubagentSpawn = import_react73.useCallback(({
|
|
146417
146612
|
subagentId,
|
|
146418
146613
|
input
|
|
146419
146614
|
}) => {
|
|
@@ -146433,7 +146628,7 @@ function Pentest({ sessionId }) {
|
|
|
146433
146628
|
}
|
|
146434
146629
|
}));
|
|
146435
146630
|
}, []);
|
|
146436
|
-
const handleSubagentComplete =
|
|
146631
|
+
const handleSubagentComplete = import_react73.useCallback(({ subagentId, status }) => {
|
|
146437
146632
|
if (!subagentId.startsWith("pentest-agent-"))
|
|
146438
146633
|
return;
|
|
146439
146634
|
setPentestAgents((prev) => {
|
|
@@ -146446,7 +146641,7 @@ function Pentest({ sessionId }) {
|
|
|
146446
146641
|
};
|
|
146447
146642
|
});
|
|
146448
146643
|
}, []);
|
|
146449
|
-
const appendPanelText =
|
|
146644
|
+
const appendPanelText = import_react73.useCallback((source, text2) => {
|
|
146450
146645
|
if (panelSourceRef.current !== source) {
|
|
146451
146646
|
panelTextRef.current = "";
|
|
146452
146647
|
panelSourceRef.current = source;
|
|
@@ -146471,7 +146666,7 @@ function Pentest({ sessionId }) {
|
|
|
146471
146666
|
];
|
|
146472
146667
|
});
|
|
146473
146668
|
}, []);
|
|
146474
|
-
const appendPentestText =
|
|
146669
|
+
const appendPentestText = import_react73.useCallback((subagentId, text2) => {
|
|
146475
146670
|
ensurePentestAgent(subagentId);
|
|
146476
146671
|
if (!pentestTextRefs.current[subagentId]) {
|
|
146477
146672
|
pentestTextRefs.current[subagentId] = "";
|
|
@@ -146504,7 +146699,7 @@ function Pentest({ sessionId }) {
|
|
|
146504
146699
|
};
|
|
146505
146700
|
});
|
|
146506
146701
|
}, [ensurePentestAgent]);
|
|
146507
|
-
const addPanelToolCall =
|
|
146702
|
+
const addPanelToolCall = import_react73.useCallback((toolCallId, toolName, args) => {
|
|
146508
146703
|
panelTextRef.current = "";
|
|
146509
146704
|
panelSourceRef.current = null;
|
|
146510
146705
|
const description = typeof args?.toolCallDescription === "string" ? args.toolCallDescription : toolName;
|
|
@@ -146523,7 +146718,7 @@ function Pentest({ sessionId }) {
|
|
|
146523
146718
|
return [...prev, msg];
|
|
146524
146719
|
});
|
|
146525
146720
|
}, []);
|
|
146526
|
-
const addPentestToolCall =
|
|
146721
|
+
const addPentestToolCall = import_react73.useCallback((subagentId, toolCallId, toolName, args) => {
|
|
146527
146722
|
pentestTextRefs.current[subagentId] = "";
|
|
146528
146723
|
ensurePentestAgent(subagentId);
|
|
146529
146724
|
const description = typeof args?.toolCallDescription === "string" ? args.toolCallDescription : toolName;
|
|
@@ -146568,12 +146763,12 @@ function Pentest({ sessionId }) {
|
|
|
146568
146763
|
}
|
|
146569
146764
|
];
|
|
146570
146765
|
};
|
|
146571
|
-
const updatePanelToolResult =
|
|
146766
|
+
const updatePanelToolResult = import_react73.useCallback((toolCallId, toolName, result) => {
|
|
146572
146767
|
panelTextRef.current = "";
|
|
146573
146768
|
panelSourceRef.current = null;
|
|
146574
146769
|
setPanelMessages((prev) => toolResultUpdater(prev, toolCallId, toolName, result));
|
|
146575
146770
|
}, []);
|
|
146576
|
-
const updatePentestToolResult =
|
|
146771
|
+
const updatePentestToolResult = import_react73.useCallback((subagentId, toolCallId, toolName, result) => {
|
|
146577
146772
|
pentestTextRefs.current[subagentId] = "";
|
|
146578
146773
|
setPentestAgents((prev) => {
|
|
146579
146774
|
const agent = prev[subagentId];
|
|
@@ -146588,7 +146783,7 @@ function Pentest({ sessionId }) {
|
|
|
146588
146783
|
};
|
|
146589
146784
|
});
|
|
146590
146785
|
}, []);
|
|
146591
|
-
const startPentest =
|
|
146786
|
+
const startPentest = import_react73.useCallback(async (s) => {
|
|
146592
146787
|
setPhase("discovery");
|
|
146593
146788
|
setStartTime(new Date);
|
|
146594
146789
|
setIsExecuting(true);
|
|
@@ -146684,7 +146879,7 @@ function Pentest({ sessionId }) {
|
|
|
146684
146879
|
handleSubagentSpawn,
|
|
146685
146880
|
handleSubagentComplete
|
|
146686
146881
|
]);
|
|
146687
|
-
|
|
146882
|
+
import_react73.useEffect(() => {
|
|
146688
146883
|
if (session && phase === "loading") {
|
|
146689
146884
|
startPentest(session);
|
|
146690
146885
|
}
|
|
@@ -146746,11 +146941,11 @@ function Pentest({ sessionId }) {
|
|
|
146746
146941
|
}
|
|
146747
146942
|
}
|
|
146748
146943
|
});
|
|
146749
|
-
const openReport =
|
|
146944
|
+
const openReport = import_react73.useCallback(() => {
|
|
146750
146945
|
if (!session)
|
|
146751
146946
|
return;
|
|
146752
146947
|
const reportPath = join17(session.rootPath, "pentest-report.md");
|
|
146753
|
-
if (
|
|
146948
|
+
if (existsSync17(reportPath)) {
|
|
146754
146949
|
exec3(`open "${reportPath}"`);
|
|
146755
146950
|
} else {
|
|
146756
146951
|
exec3(`open "${session.rootPath}"`);
|
|
@@ -146766,7 +146961,7 @@ function Pentest({ sessionId }) {
|
|
|
146766
146961
|
flexGrow: 1,
|
|
146767
146962
|
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(SpinnerDots, {
|
|
146768
146963
|
label: "Loading session...",
|
|
146769
|
-
fg:
|
|
146964
|
+
fg: colors2.primary
|
|
146770
146965
|
}, undefined, false, undefined, this)
|
|
146771
146966
|
}, undefined, false, undefined, this);
|
|
146772
146967
|
}
|
|
@@ -146781,14 +146976,14 @@ function Pentest({ sessionId }) {
|
|
|
146781
146976
|
gap: 2,
|
|
146782
146977
|
children: [
|
|
146783
146978
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
146784
|
-
fg:
|
|
146979
|
+
fg: colors2.error,
|
|
146785
146980
|
children: [
|
|
146786
146981
|
"Error: ",
|
|
146787
|
-
error41
|
|
146982
|
+
error41 ?? "Session not found"
|
|
146788
146983
|
]
|
|
146789
146984
|
}, undefined, true, undefined, this),
|
|
146790
146985
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
146791
|
-
fg:
|
|
146986
|
+
fg: colors2.textMuted,
|
|
146792
146987
|
children: "Press ESC to return home"
|
|
146793
146988
|
}, undefined, false, undefined, this)
|
|
146794
146989
|
]
|
|
@@ -146831,8 +147026,8 @@ function Pentest({ sessionId }) {
|
|
|
146831
147026
|
alignItems: "center",
|
|
146832
147027
|
justifyContent: "center",
|
|
146833
147028
|
border: true,
|
|
146834
|
-
borderColor:
|
|
146835
|
-
backgroundColor:
|
|
147029
|
+
borderColor: colors2.borderSubtle,
|
|
147030
|
+
backgroundColor: colors2.backgroundElement,
|
|
146836
147031
|
padding: 2,
|
|
146837
147032
|
children: phase === "discovery" ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
146838
147033
|
flexDirection: "column",
|
|
@@ -146841,18 +147036,18 @@ function Pentest({ sessionId }) {
|
|
|
146841
147036
|
children: [
|
|
146842
147037
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(SpinnerDots, {
|
|
146843
147038
|
label: "Discovering attack surface...",
|
|
146844
|
-
fg:
|
|
147039
|
+
fg: colors2.primary
|
|
146845
147040
|
}, undefined, false, undefined, this),
|
|
146846
147041
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
146847
|
-
fg:
|
|
147042
|
+
fg: colors2.textMuted,
|
|
146848
147043
|
children: "Press [D] to view orchestrator logs"
|
|
146849
147044
|
}, undefined, false, undefined, this)
|
|
146850
147045
|
]
|
|
146851
147046
|
}, undefined, true, undefined, this) : phase === "reporting" ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(SpinnerDots, {
|
|
146852
147047
|
label: "Generating report...",
|
|
146853
|
-
fg:
|
|
147048
|
+
fg: colors2.primary
|
|
146854
147049
|
}, undefined, false, undefined, this) : /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
146855
|
-
fg:
|
|
147050
|
+
fg: colors2.textMuted,
|
|
146856
147051
|
children: "No pentest agents spawned yet"
|
|
146857
147052
|
}, undefined, false, undefined, this)
|
|
146858
147053
|
}, undefined, false, undefined, this) : /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(AgentCardGrid, {
|
|
@@ -146869,19 +147064,19 @@ function Pentest({ sessionId }) {
|
|
|
146869
147064
|
phase === "completed" && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
146870
147065
|
width: "100%",
|
|
146871
147066
|
padding: 1,
|
|
146872
|
-
backgroundColor:
|
|
147067
|
+
backgroundColor: colors2.backgroundElement,
|
|
146873
147068
|
border: true,
|
|
146874
|
-
borderColor:
|
|
147069
|
+
borderColor: colors2.primary,
|
|
146875
147070
|
flexDirection: "column",
|
|
146876
147071
|
alignItems: "center",
|
|
146877
147072
|
gap: 1,
|
|
146878
147073
|
children: [
|
|
146879
147074
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
146880
|
-
fg:
|
|
147075
|
+
fg: colors2.primary,
|
|
146881
147076
|
children: "Pentest Completed"
|
|
146882
147077
|
}, undefined, false, undefined, this),
|
|
146883
147078
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
146884
|
-
fg:
|
|
147079
|
+
fg: colors2.textMuted,
|
|
146885
147080
|
children: [
|
|
146886
147081
|
session.rootPath,
|
|
146887
147082
|
"/pentest-report.md"
|
|
@@ -146894,11 +147089,11 @@ function Pentest({ sessionId }) {
|
|
|
146894
147089
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
146895
147090
|
children: [
|
|
146896
147091
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
146897
|
-
fg:
|
|
147092
|
+
fg: colors2.primary,
|
|
146898
147093
|
children: "[Enter]"
|
|
146899
147094
|
}, undefined, false, undefined, this),
|
|
146900
147095
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
146901
|
-
fg:
|
|
147096
|
+
fg: colors2.textMuted,
|
|
146902
147097
|
children: " View Report"
|
|
146903
147098
|
}, undefined, false, undefined, this)
|
|
146904
147099
|
]
|
|
@@ -146906,11 +147101,11 @@ function Pentest({ sessionId }) {
|
|
|
146906
147101
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
146907
147102
|
children: [
|
|
146908
147103
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
146909
|
-
fg:
|
|
147104
|
+
fg: colors2.primary,
|
|
146910
147105
|
children: "[ESC]"
|
|
146911
147106
|
}, undefined, false, undefined, this),
|
|
146912
147107
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
146913
|
-
fg:
|
|
147108
|
+
fg: colors2.textMuted,
|
|
146914
147109
|
children: " Close"
|
|
146915
147110
|
}, undefined, false, undefined, this)
|
|
146916
147111
|
]
|
|
@@ -146936,8 +147131,9 @@ function OrchestratorPanel({
|
|
|
146936
147131
|
expanded,
|
|
146937
147132
|
onToggle
|
|
146938
147133
|
}) {
|
|
147134
|
+
const { colors: colors2 } = useTheme();
|
|
146939
147135
|
const isRunning = phase !== "loading" && phase !== "completed" && phase !== "error";
|
|
146940
|
-
const assetSummary =
|
|
147136
|
+
const assetSummary = import_react73.useMemo(() => {
|
|
146941
147137
|
const byType = {};
|
|
146942
147138
|
for (const a of assets) {
|
|
146943
147139
|
const key = a.assetType;
|
|
@@ -146970,8 +147166,8 @@ function OrchestratorPanel({
|
|
|
146970
147166
|
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
146971
147167
|
flexGrow: 1,
|
|
146972
147168
|
border: true,
|
|
146973
|
-
borderColor:
|
|
146974
|
-
backgroundColor:
|
|
147169
|
+
borderColor: colors2.primary,
|
|
147170
|
+
backgroundColor: colors2.backgroundElement,
|
|
146975
147171
|
flexDirection: "column",
|
|
146976
147172
|
children: [
|
|
146977
147173
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
@@ -146979,7 +147175,7 @@ function OrchestratorPanel({
|
|
|
146979
147175
|
alignItems: "center",
|
|
146980
147176
|
justifyContent: "space-between",
|
|
146981
147177
|
padding: 1,
|
|
146982
|
-
borderColor:
|
|
147178
|
+
borderColor: colors2.borderSubtle,
|
|
146983
147179
|
border: ["bottom"],
|
|
146984
147180
|
children: [
|
|
146985
147181
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
@@ -146987,9 +147183,9 @@ function OrchestratorPanel({
|
|
|
146987
147183
|
gap: 1,
|
|
146988
147184
|
children: isRunning ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(SpinnerDots, {
|
|
146989
147185
|
label: `Orchestrator — ${phaseLabel}`,
|
|
146990
|
-
fg:
|
|
147186
|
+
fg: colors2.primary
|
|
146991
147187
|
}, undefined, false, undefined, this) : /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
146992
|
-
fg: phase === "completed" ?
|
|
147188
|
+
fg: phase === "completed" ? colors2.primary : phase === "error" ? colors2.error : colors2.textMuted,
|
|
146993
147189
|
children: [
|
|
146994
147190
|
phase === "completed" ? "✓" : phase === "error" ? "✗" : "●",
|
|
146995
147191
|
" ",
|
|
@@ -146999,19 +147195,19 @@ function OrchestratorPanel({
|
|
|
146999
147195
|
}, undefined, true, undefined, this)
|
|
147000
147196
|
}, undefined, false, undefined, this),
|
|
147001
147197
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147002
|
-
fg:
|
|
147198
|
+
fg: colors2.textMuted,
|
|
147003
147199
|
children: [
|
|
147004
147200
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147005
|
-
fg:
|
|
147201
|
+
fg: colors2.primary,
|
|
147006
147202
|
children: "[D]"
|
|
147007
147203
|
}, undefined, false, undefined, this),
|
|
147008
|
-
" collapse |
|
|
147204
|
+
" collapse |",
|
|
147205
|
+
" ",
|
|
147009
147206
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147010
|
-
fg:
|
|
147207
|
+
fg: colors2.primary,
|
|
147011
147208
|
children: "[ESC]"
|
|
147012
147209
|
}, undefined, false, undefined, this),
|
|
147013
|
-
" "
|
|
147014
|
-
"close"
|
|
147210
|
+
" close"
|
|
147015
147211
|
]
|
|
147016
147212
|
}, undefined, true, undefined, this)
|
|
147017
147213
|
]
|
|
@@ -147028,18 +147224,18 @@ function OrchestratorPanel({
|
|
|
147028
147224
|
flexDirection: "row",
|
|
147029
147225
|
justifyContent: "space-between",
|
|
147030
147226
|
padding: 1,
|
|
147031
|
-
borderColor:
|
|
147227
|
+
borderColor: colors2.borderSubtle,
|
|
147032
147228
|
border: ["top"],
|
|
147033
147229
|
children: [
|
|
147034
147230
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147035
|
-
fg:
|
|
147231
|
+
fg: colors2.textMuted,
|
|
147036
147232
|
children: [
|
|
147037
147233
|
messages.length,
|
|
147038
147234
|
" messages"
|
|
147039
147235
|
]
|
|
147040
147236
|
}, undefined, true, undefined, this),
|
|
147041
147237
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147042
|
-
fg:
|
|
147238
|
+
fg: colors2.textMuted,
|
|
147043
147239
|
children: [
|
|
147044
147240
|
assets.length,
|
|
147045
147241
|
" assets found"
|
|
@@ -147053,8 +147249,8 @@ function OrchestratorPanel({
|
|
|
147053
147249
|
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
147054
147250
|
width: 32,
|
|
147055
147251
|
border: true,
|
|
147056
|
-
borderColor: isRunning ?
|
|
147057
|
-
backgroundColor:
|
|
147252
|
+
borderColor: isRunning ? colors2.primary : colors2.textMuted,
|
|
147253
|
+
backgroundColor: colors2.backgroundElement,
|
|
147058
147254
|
flexDirection: "column",
|
|
147059
147255
|
onMouseDown: onToggle,
|
|
147060
147256
|
children: [
|
|
@@ -147063,7 +147259,7 @@ function OrchestratorPanel({
|
|
|
147063
147259
|
alignItems: "center",
|
|
147064
147260
|
justifyContent: "space-between",
|
|
147065
147261
|
padding: 1,
|
|
147066
|
-
borderColor:
|
|
147262
|
+
borderColor: colors2.borderSubtle,
|
|
147067
147263
|
border: ["bottom"],
|
|
147068
147264
|
children: [
|
|
147069
147265
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
@@ -147071,9 +147267,9 @@ function OrchestratorPanel({
|
|
|
147071
147267
|
gap: 1,
|
|
147072
147268
|
children: isRunning ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(SpinnerDots, {
|
|
147073
147269
|
label: phaseLabel,
|
|
147074
|
-
fg:
|
|
147270
|
+
fg: colors2.primary
|
|
147075
147271
|
}, undefined, false, undefined, this) : /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147076
|
-
fg: phase === "completed" ?
|
|
147272
|
+
fg: phase === "completed" ? colors2.primary : colors2.textMuted,
|
|
147077
147273
|
children: [
|
|
147078
147274
|
phase === "completed" ? "✓" : "●",
|
|
147079
147275
|
" ",
|
|
@@ -147082,7 +147278,7 @@ function OrchestratorPanel({
|
|
|
147082
147278
|
}, undefined, true, undefined, this)
|
|
147083
147279
|
}, undefined, false, undefined, this),
|
|
147084
147280
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147085
|
-
fg:
|
|
147281
|
+
fg: colors2.textMuted,
|
|
147086
147282
|
children: "[D]"
|
|
147087
147283
|
}, undefined, false, undefined, this)
|
|
147088
147284
|
]
|
|
@@ -147095,11 +147291,11 @@ function OrchestratorPanel({
|
|
|
147095
147291
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147096
147292
|
children: [
|
|
147097
147293
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147098
|
-
fg:
|
|
147294
|
+
fg: colors2.textMuted,
|
|
147099
147295
|
children: "Phase: "
|
|
147100
147296
|
}, undefined, false, undefined, this),
|
|
147101
147297
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147102
|
-
fg: isRunning ?
|
|
147298
|
+
fg: isRunning ? colors2.primary : colors2.text,
|
|
147103
147299
|
children: phaseLabel
|
|
147104
147300
|
}, undefined, false, undefined, this)
|
|
147105
147301
|
]
|
|
@@ -147107,11 +147303,11 @@ function OrchestratorPanel({
|
|
|
147107
147303
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147108
147304
|
children: [
|
|
147109
147305
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147110
|
-
fg:
|
|
147306
|
+
fg: colors2.textMuted,
|
|
147111
147307
|
children: "Assets: "
|
|
147112
147308
|
}, undefined, false, undefined, this),
|
|
147113
147309
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147114
|
-
fg:
|
|
147310
|
+
fg: colors2.text,
|
|
147115
147311
|
children: assets.length
|
|
147116
147312
|
}, undefined, false, undefined, this)
|
|
147117
147313
|
]
|
|
@@ -147119,11 +147315,11 @@ function OrchestratorPanel({
|
|
|
147119
147315
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147120
147316
|
children: [
|
|
147121
147317
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147122
|
-
fg:
|
|
147318
|
+
fg: colors2.textMuted,
|
|
147123
147319
|
children: "Messages: "
|
|
147124
147320
|
}, undefined, false, undefined, this),
|
|
147125
147321
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147126
|
-
fg:
|
|
147322
|
+
fg: colors2.text,
|
|
147127
147323
|
children: messages.length
|
|
147128
147324
|
}, undefined, false, undefined, this)
|
|
147129
147325
|
]
|
|
@@ -147141,7 +147337,7 @@ function OrchestratorPanel({
|
|
|
147141
147337
|
flexDirection: "column",
|
|
147142
147338
|
children: [
|
|
147143
147339
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147144
|
-
fg:
|
|
147340
|
+
fg: colors2.textMuted,
|
|
147145
147341
|
children: [
|
|
147146
147342
|
assetTypeLabels[type] ?? type,
|
|
147147
147343
|
" (",
|
|
@@ -147152,10 +147348,10 @@ function OrchestratorPanel({
|
|
|
147152
147348
|
items.map((a, i) => {
|
|
147153
147349
|
const label = a.assetName;
|
|
147154
147350
|
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147155
|
-
fg:
|
|
147351
|
+
fg: colors2.textMuted,
|
|
147156
147352
|
children: [
|
|
147157
147353
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147158
|
-
fg: riskColor(a.riskLevel),
|
|
147354
|
+
fg: riskColor(colors2, a.riskLevel),
|
|
147159
147355
|
children: "• "
|
|
147160
147356
|
}, undefined, false, undefined, this),
|
|
147161
147357
|
label.length > 26 ? label.slice(0, 26) + "…" : label
|
|
@@ -147168,16 +147364,16 @@ function OrchestratorPanel({
|
|
|
147168
147364
|
]
|
|
147169
147365
|
}, undefined, true, undefined, this);
|
|
147170
147366
|
}
|
|
147171
|
-
function riskColor(level) {
|
|
147367
|
+
function riskColor(colors2, level) {
|
|
147172
147368
|
switch (level) {
|
|
147173
147369
|
case "CRITICAL":
|
|
147174
|
-
return
|
|
147370
|
+
return colors2.error;
|
|
147175
147371
|
case "HIGH":
|
|
147176
|
-
return
|
|
147372
|
+
return colors2.warning;
|
|
147177
147373
|
case "MEDIUM":
|
|
147178
|
-
return
|
|
147374
|
+
return colors2.warning;
|
|
147179
147375
|
default:
|
|
147180
|
-
return
|
|
147376
|
+
return colors2.success;
|
|
147181
147377
|
}
|
|
147182
147378
|
}
|
|
147183
147379
|
function AgentCardGrid({
|
|
@@ -147185,7 +147381,8 @@ function AgentCardGrid({
|
|
|
147185
147381
|
focusedIndex,
|
|
147186
147382
|
onSelectAgent
|
|
147187
147383
|
}) {
|
|
147188
|
-
const
|
|
147384
|
+
const { colors: colors2 } = useTheme();
|
|
147385
|
+
const rows = import_react73.useMemo(() => {
|
|
147189
147386
|
const result = [];
|
|
147190
147387
|
for (let i = 0;i < agents.length; i += 2) {
|
|
147191
147388
|
result.push(agents.slice(i, i + 2));
|
|
@@ -147226,27 +147423,28 @@ function AgentCard({
|
|
|
147226
147423
|
focused,
|
|
147227
147424
|
onSelect
|
|
147228
147425
|
}) {
|
|
147426
|
+
const { colors: colors2 } = useTheme();
|
|
147229
147427
|
const statusIcon = { pending: "◐", completed: "✓", failed: "✗" }[agent.status];
|
|
147230
147428
|
const statusColor = {
|
|
147231
|
-
pending:
|
|
147232
|
-
completed:
|
|
147233
|
-
failed:
|
|
147429
|
+
pending: colors2.primary,
|
|
147430
|
+
completed: colors2.primary,
|
|
147431
|
+
failed: colors2.error
|
|
147234
147432
|
}[agent.status];
|
|
147235
|
-
const lastActivity =
|
|
147433
|
+
const lastActivity = import_react73.useMemo(() => {
|
|
147236
147434
|
const last = agent.messages[agent.messages.length - 1];
|
|
147237
147435
|
if (!last)
|
|
147238
147436
|
return "Starting...";
|
|
147239
147437
|
const text2 = typeof last.content === "string" ? last.content.replace(/\n/g, " ").trim() : "Working...";
|
|
147240
147438
|
return text2.length > 50 ? text2.substring(0, 47) + "..." : text2;
|
|
147241
147439
|
}, [agent.messages]);
|
|
147242
|
-
const toolCalls =
|
|
147440
|
+
const toolCalls = import_react73.useMemo(() => agent.messages.filter((m3) => m3.role === "tool").length, [agent.messages]);
|
|
147243
147441
|
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
147244
147442
|
flexGrow: 1,
|
|
147245
147443
|
flexBasis: 0,
|
|
147246
147444
|
minWidth: 40,
|
|
147247
147445
|
border: true,
|
|
147248
|
-
borderColor: focused ?
|
|
147249
|
-
backgroundColor:
|
|
147446
|
+
borderColor: focused ? colors2.primary : colors2.textMuted,
|
|
147447
|
+
backgroundColor: colors2.backgroundElement,
|
|
147250
147448
|
flexDirection: "column",
|
|
147251
147449
|
padding: 1,
|
|
147252
147450
|
rowGap: 1,
|
|
@@ -147263,13 +147461,13 @@ function AgentCard({
|
|
|
147263
147461
|
children: statusIcon
|
|
147264
147462
|
}, undefined, false, undefined, this),
|
|
147265
147463
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147266
|
-
fg: focused ?
|
|
147464
|
+
fg: focused ? colors2.text : colors2.textMuted,
|
|
147267
147465
|
children: agent.target || agent.name
|
|
147268
147466
|
}, undefined, false, undefined, this)
|
|
147269
147467
|
]
|
|
147270
147468
|
}, undefined, true, undefined, this),
|
|
147271
147469
|
agent.target && agent.name !== agent.target && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147272
|
-
fg:
|
|
147470
|
+
fg: colors2.textMuted,
|
|
147273
147471
|
children: agent.name
|
|
147274
147472
|
}, undefined, false, undefined, this),
|
|
147275
147473
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
@@ -147278,20 +147476,20 @@ function AgentCard({
|
|
|
147278
147476
|
marginTop: 1,
|
|
147279
147477
|
children: [
|
|
147280
147478
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147281
|
-
fg:
|
|
147479
|
+
fg: colors2.textMuted,
|
|
147282
147480
|
children: [
|
|
147283
147481
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147284
|
-
fg:
|
|
147482
|
+
fg: colors2.primary,
|
|
147285
147483
|
children: toolCalls
|
|
147286
147484
|
}, undefined, false, undefined, this),
|
|
147287
147485
|
" calls"
|
|
147288
147486
|
]
|
|
147289
147487
|
}, undefined, true, undefined, this),
|
|
147290
147488
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147291
|
-
fg:
|
|
147489
|
+
fg: colors2.textMuted,
|
|
147292
147490
|
children: [
|
|
147293
147491
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147294
|
-
fg:
|
|
147492
|
+
fg: colors2.primary,
|
|
147295
147493
|
children: agent.messages.length
|
|
147296
147494
|
}, undefined, false, undefined, this),
|
|
147297
147495
|
" msgs"
|
|
@@ -147304,9 +147502,9 @@ function AgentCard({
|
|
|
147304
147502
|
overflow: "hidden",
|
|
147305
147503
|
children: agent.status === "pending" ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(SpinnerDots, {
|
|
147306
147504
|
label: lastActivity,
|
|
147307
|
-
fg:
|
|
147505
|
+
fg: colors2.primary
|
|
147308
147506
|
}, undefined, false, undefined, this) : /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147309
|
-
fg: agent.status === "completed" ?
|
|
147507
|
+
fg: agent.status === "completed" ? colors2.primary : colors2.textMuted,
|
|
147310
147508
|
children: agent.status === "completed" ? "✓ Complete" : lastActivity
|
|
147311
147509
|
}, undefined, false, undefined, this)
|
|
147312
147510
|
}, undefined, false, undefined, this)
|
|
@@ -147317,10 +147515,11 @@ function AgentDetailView({
|
|
|
147317
147515
|
agent,
|
|
147318
147516
|
onBack
|
|
147319
147517
|
}) {
|
|
147518
|
+
const { colors: colors2 } = useTheme();
|
|
147320
147519
|
const statusColor = {
|
|
147321
|
-
pending:
|
|
147322
|
-
completed:
|
|
147323
|
-
failed:
|
|
147520
|
+
pending: colors2.primary,
|
|
147521
|
+
completed: colors2.primary,
|
|
147522
|
+
failed: colors2.error
|
|
147324
147523
|
}[agent.status];
|
|
147325
147524
|
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
147326
147525
|
flexDirection: "column",
|
|
@@ -147331,7 +147530,7 @@ function AgentDetailView({
|
|
|
147331
147530
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
147332
147531
|
width: "100%",
|
|
147333
147532
|
border: ["bottom"],
|
|
147334
|
-
borderColor:
|
|
147533
|
+
borderColor: colors2.primary,
|
|
147335
147534
|
flexDirection: "row",
|
|
147336
147535
|
justifyContent: "space-between",
|
|
147337
147536
|
padding: 1,
|
|
@@ -147341,10 +147540,10 @@ function AgentDetailView({
|
|
|
147341
147540
|
gap: 1,
|
|
147342
147541
|
children: [
|
|
147343
147542
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147344
|
-
fg:
|
|
147543
|
+
fg: colors2.textMuted
|
|
147345
147544
|
}, undefined, false, undefined, this),
|
|
147346
147545
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147347
|
-
fg:
|
|
147546
|
+
fg: colors2.text,
|
|
147348
147547
|
children: agent.name
|
|
147349
147548
|
}, undefined, false, undefined, this)
|
|
147350
147549
|
]
|
|
@@ -147356,11 +147555,11 @@ function AgentDetailView({
|
|
|
147356
147555
|
agent.target && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147357
147556
|
children: [
|
|
147358
147557
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147359
|
-
fg:
|
|
147558
|
+
fg: colors2.textMuted,
|
|
147360
147559
|
children: "Target: "
|
|
147361
147560
|
}, undefined, false, undefined, this),
|
|
147362
147561
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147363
|
-
fg:
|
|
147562
|
+
fg: colors2.text,
|
|
147364
147563
|
children: agent.target
|
|
147365
147564
|
}, undefined, false, undefined, this)
|
|
147366
147565
|
]
|
|
@@ -147386,11 +147585,11 @@ function AgentDetailView({
|
|
|
147386
147585
|
flexDirection: "row",
|
|
147387
147586
|
justifyContent: "space-between",
|
|
147388
147587
|
border: ["top"],
|
|
147389
|
-
borderColor:
|
|
147588
|
+
borderColor: colors2.primary,
|
|
147390
147589
|
padding: 1,
|
|
147391
147590
|
children: [
|
|
147392
147591
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147393
|
-
fg:
|
|
147592
|
+
fg: colors2.textMuted,
|
|
147394
147593
|
children: [
|
|
147395
147594
|
agent.messages.length,
|
|
147396
147595
|
" messages"
|
|
@@ -147402,11 +147601,11 @@ function AgentDetailView({
|
|
|
147402
147601
|
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147403
147602
|
children: [
|
|
147404
147603
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147405
|
-
fg:
|
|
147604
|
+
fg: colors2.primary,
|
|
147406
147605
|
children: "[ESC]"
|
|
147407
147606
|
}, undefined, false, undefined, this),
|
|
147408
147607
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147409
|
-
fg:
|
|
147608
|
+
fg: colors2.textMuted,
|
|
147410
147609
|
children: " Back to overview"
|
|
147411
147610
|
}, undefined, false, undefined, this)
|
|
147412
147611
|
]
|
|
@@ -147424,8 +147623,9 @@ function MetricsBar({
|
|
|
147424
147623
|
startTime,
|
|
147425
147624
|
isExecuting
|
|
147426
147625
|
}) {
|
|
147427
|
-
const
|
|
147428
|
-
|
|
147626
|
+
const { colors: colors2 } = useTheme();
|
|
147627
|
+
const [now2, setNow] = import_react73.useState(Date.now());
|
|
147628
|
+
import_react73.useEffect(() => {
|
|
147429
147629
|
if (!isExecuting)
|
|
147430
147630
|
return;
|
|
147431
147631
|
const interval = setInterval(() => setNow(Date.now()), 1000);
|
|
@@ -147449,7 +147649,7 @@ function MetricsBar({
|
|
|
147449
147649
|
width: "100%",
|
|
147450
147650
|
flexDirection: "row",
|
|
147451
147651
|
justifyContent: "space-between",
|
|
147452
|
-
borderColor:
|
|
147652
|
+
borderColor: colors2.primary,
|
|
147453
147653
|
border: ["top"],
|
|
147454
147654
|
padding: 1,
|
|
147455
147655
|
children: [
|
|
@@ -147459,38 +147659,38 @@ function MetricsBar({
|
|
|
147459
147659
|
children: [
|
|
147460
147660
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147461
147661
|
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147462
|
-
fg: isExecuting ?
|
|
147662
|
+
fg: isExecuting ? colors2.primary : colors2.textMuted,
|
|
147463
147663
|
children: phaseLabel
|
|
147464
147664
|
}, undefined, false, undefined, this)
|
|
147465
147665
|
}, undefined, false, undefined, this),
|
|
147466
147666
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147467
|
-
fg:
|
|
147667
|
+
fg: colors2.textMuted,
|
|
147468
147668
|
children: "|"
|
|
147469
147669
|
}, undefined, false, undefined, this),
|
|
147470
147670
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147471
147671
|
children: [
|
|
147472
147672
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147473
|
-
fg:
|
|
147673
|
+
fg: colors2.primary,
|
|
147474
147674
|
children: assets.length
|
|
147475
147675
|
}, undefined, false, undefined, this),
|
|
147476
147676
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147477
|
-
fg:
|
|
147677
|
+
fg: colors2.textMuted,
|
|
147478
147678
|
children: " assets"
|
|
147479
147679
|
}, undefined, false, undefined, this)
|
|
147480
147680
|
]
|
|
147481
147681
|
}, undefined, true, undefined, this),
|
|
147482
147682
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147483
|
-
fg:
|
|
147683
|
+
fg: colors2.textMuted,
|
|
147484
147684
|
children: "|"
|
|
147485
147685
|
}, undefined, false, undefined, this),
|
|
147486
147686
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147487
147687
|
children: [
|
|
147488
147688
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147489
|
-
fg: isExecuting ?
|
|
147689
|
+
fg: isExecuting ? colors2.primary : colors2.textMuted,
|
|
147490
147690
|
children: active
|
|
147491
147691
|
}, undefined, false, undefined, this),
|
|
147492
147692
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147493
|
-
fg:
|
|
147693
|
+
fg: colors2.textMuted,
|
|
147494
147694
|
children: [
|
|
147495
147695
|
"/",
|
|
147496
147696
|
total,
|
|
@@ -147500,11 +147700,11 @@ function MetricsBar({
|
|
|
147500
147700
|
]
|
|
147501
147701
|
}, undefined, true, undefined, this),
|
|
147502
147702
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147503
|
-
fg:
|
|
147703
|
+
fg: colors2.textMuted,
|
|
147504
147704
|
children: "|"
|
|
147505
147705
|
}, undefined, false, undefined, this),
|
|
147506
147706
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147507
|
-
fg:
|
|
147707
|
+
fg: colors2.textMuted,
|
|
147508
147708
|
children: formattedDuration
|
|
147509
147709
|
}, undefined, false, undefined, this)
|
|
147510
147710
|
]
|
|
@@ -147516,11 +147716,11 @@ function MetricsBar({
|
|
|
147516
147716
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147517
147717
|
children: [
|
|
147518
147718
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147519
|
-
fg:
|
|
147719
|
+
fg: colors2.primary,
|
|
147520
147720
|
children: "[D]"
|
|
147521
147721
|
}, undefined, false, undefined, this),
|
|
147522
147722
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147523
|
-
fg:
|
|
147723
|
+
fg: colors2.textMuted,
|
|
147524
147724
|
children: " Orchestrator"
|
|
147525
147725
|
}, undefined, false, undefined, this)
|
|
147526
147726
|
]
|
|
@@ -147528,11 +147728,11 @@ function MetricsBar({
|
|
|
147528
147728
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147529
147729
|
children: [
|
|
147530
147730
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147531
|
-
fg:
|
|
147731
|
+
fg: colors2.primary,
|
|
147532
147732
|
children: "[Tab]"
|
|
147533
147733
|
}, undefined, false, undefined, this),
|
|
147534
147734
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147535
|
-
fg:
|
|
147735
|
+
fg: colors2.textMuted,
|
|
147536
147736
|
children: " Navigate"
|
|
147537
147737
|
}, undefined, false, undefined, this)
|
|
147538
147738
|
]
|
|
@@ -147540,11 +147740,11 @@ function MetricsBar({
|
|
|
147540
147740
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147541
147741
|
children: [
|
|
147542
147742
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147543
|
-
fg:
|
|
147743
|
+
fg: colors2.primary,
|
|
147544
147744
|
children: "[Enter]"
|
|
147545
147745
|
}, undefined, false, undefined, this),
|
|
147546
147746
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147547
|
-
fg:
|
|
147747
|
+
fg: colors2.textMuted,
|
|
147548
147748
|
children: " View"
|
|
147549
147749
|
}, undefined, false, undefined, this)
|
|
147550
147750
|
]
|
|
@@ -147552,11 +147752,11 @@ function MetricsBar({
|
|
|
147552
147752
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
147553
147753
|
children: [
|
|
147554
147754
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147555
|
-
fg:
|
|
147755
|
+
fg: colors2.primary,
|
|
147556
147756
|
children: "[ESC]"
|
|
147557
147757
|
}, undefined, false, undefined, this),
|
|
147558
147758
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
147559
|
-
fg:
|
|
147759
|
+
fg: colors2.textMuted,
|
|
147560
147760
|
children: " Back"
|
|
147561
147761
|
}, undefined, false, undefined, this)
|
|
147562
147762
|
]
|
|
@@ -147568,7 +147768,7 @@ function MetricsBar({
|
|
|
147568
147768
|
}
|
|
147569
147769
|
|
|
147570
147770
|
// src/tui/components/operator-dashboard/index.tsx
|
|
147571
|
-
var
|
|
147771
|
+
var import_react78 = __toESM(require_react(), 1);
|
|
147572
147772
|
|
|
147573
147773
|
// src/core/api/offesecAgent.ts
|
|
147574
147774
|
init_offensiveSecurityAgent();
|
|
@@ -147665,7 +147865,7 @@ function InlineApprovalPrompt2({ approval }) {
|
|
|
147665
147865
|
}
|
|
147666
147866
|
|
|
147667
147867
|
// src/tui/components/chat/loading-indicator.tsx
|
|
147668
|
-
var
|
|
147868
|
+
var import_react75 = __toESM(require_react(), 1);
|
|
147669
147869
|
var SPINNER_FRAMES2 = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
147670
147870
|
var SPINNER_INTERVAL2 = 80;
|
|
147671
147871
|
var DOTS_FRAMES = ["", ".", "..", "..."];
|
|
@@ -147676,15 +147876,15 @@ function LoadingIndicator({
|
|
|
147676
147876
|
toolName
|
|
147677
147877
|
}) {
|
|
147678
147878
|
const { colors: colors2 } = useTheme();
|
|
147679
|
-
const [spinnerFrame, setSpinnerFrame] =
|
|
147680
|
-
const [dotsFrame, setDotsFrame] =
|
|
147681
|
-
|
|
147879
|
+
const [spinnerFrame, setSpinnerFrame] = import_react75.useState(0);
|
|
147880
|
+
const [dotsFrame, setDotsFrame] = import_react75.useState(0);
|
|
147881
|
+
import_react75.useEffect(() => {
|
|
147682
147882
|
const interval = setInterval(() => {
|
|
147683
147883
|
setSpinnerFrame((f) => (f + 1) % SPINNER_FRAMES2.length);
|
|
147684
147884
|
}, SPINNER_INTERVAL2);
|
|
147685
147885
|
return () => clearInterval(interval);
|
|
147686
147886
|
}, []);
|
|
147687
|
-
|
|
147887
|
+
import_react75.useEffect(() => {
|
|
147688
147888
|
const interval = setInterval(() => {
|
|
147689
147889
|
setDotsFrame((f) => (f + 1) % DOTS_FRAMES.length);
|
|
147690
147890
|
}, DOTS_INTERVAL);
|
|
@@ -147954,7 +148154,7 @@ function MessageList({
|
|
|
147954
148154
|
}
|
|
147955
148155
|
|
|
147956
148156
|
// src/tui/components/chat/input-area.tsx
|
|
147957
|
-
var
|
|
148157
|
+
var import_react76 = __toESM(require_react(), 1);
|
|
147958
148158
|
function NormalInputAreaInner({
|
|
147959
148159
|
value,
|
|
147960
148160
|
onChange,
|
|
@@ -147969,17 +148169,17 @@ function NormalInputAreaInner({
|
|
|
147969
148169
|
}) {
|
|
147970
148170
|
const { colors: colors2 } = useTheme();
|
|
147971
148171
|
const { inputValue, setInputValue } = useInput();
|
|
147972
|
-
const promptRef =
|
|
147973
|
-
const isExternalUpdate =
|
|
148172
|
+
const promptRef = import_react76.useRef(null);
|
|
148173
|
+
const isExternalUpdate = import_react76.useRef(false);
|
|
147974
148174
|
const isDisabled = status === "running";
|
|
147975
|
-
|
|
148175
|
+
import_react76.useEffect(() => {
|
|
147976
148176
|
if (value !== inputValue) {
|
|
147977
148177
|
isExternalUpdate.current = true;
|
|
147978
148178
|
setInputValue(value);
|
|
147979
148179
|
promptRef.current?.setValue(value);
|
|
147980
148180
|
}
|
|
147981
148181
|
}, [value]);
|
|
147982
|
-
|
|
148182
|
+
import_react76.useEffect(() => {
|
|
147983
148183
|
if (isExternalUpdate.current) {
|
|
147984
148184
|
isExternalUpdate.current = false;
|
|
147985
148185
|
return;
|
|
@@ -148129,7 +148329,7 @@ function ApprovalInputArea2({
|
|
|
148129
148329
|
lastDeclineNote
|
|
148130
148330
|
}) {
|
|
148131
148331
|
const { colors: colors2 } = useTheme();
|
|
148132
|
-
const [focusedElement, setFocusedElement] =
|
|
148332
|
+
const [focusedElement, setFocusedElement] = import_react76.useState(0);
|
|
148133
148333
|
const tierColor = getTierColor(colors2, approval.tier);
|
|
148134
148334
|
useKeyboard((key) => {
|
|
148135
148335
|
if (key.name === "up") {
|
|
@@ -148247,23 +148447,24 @@ function OperatorDashboard({
|
|
|
148247
148447
|
sessionId,
|
|
148248
148448
|
isResume = false
|
|
148249
148449
|
}) {
|
|
148450
|
+
const { colors: colors2 } = useTheme();
|
|
148250
148451
|
const route = useRoute();
|
|
148251
148452
|
const config4 = useConfig();
|
|
148252
148453
|
const { model, setThinking, setIsExecuting } = useAgent();
|
|
148253
|
-
const [session, setSession] =
|
|
148254
|
-
const [loading, setLoading] =
|
|
148255
|
-
const [error41, setError] =
|
|
148256
|
-
const [status, setStatus] =
|
|
148257
|
-
const abortControllerRef =
|
|
148258
|
-
const [messages, setMessages] =
|
|
148259
|
-
const textRef =
|
|
148260
|
-
const [inputValue, setInputValue] =
|
|
148261
|
-
const [operatorState, setOperatorState] =
|
|
148262
|
-
const [pendingApprovals] =
|
|
148263
|
-
const [lastApprovedAction] =
|
|
148264
|
-
const [verboseMode, setVerboseMode] =
|
|
148265
|
-
const [expandedLogs, setExpandedLogs] =
|
|
148266
|
-
|
|
148454
|
+
const [session, setSession] = import_react78.useState(null);
|
|
148455
|
+
const [loading, setLoading] = import_react78.useState(true);
|
|
148456
|
+
const [error41, setError] = import_react78.useState(null);
|
|
148457
|
+
const [status, setStatus] = import_react78.useState("idle");
|
|
148458
|
+
const abortControllerRef = import_react78.useRef(null);
|
|
148459
|
+
const [messages, setMessages] = import_react78.useState([]);
|
|
148460
|
+
const textRef = import_react78.useRef("");
|
|
148461
|
+
const [inputValue, setInputValue] = import_react78.useState("");
|
|
148462
|
+
const [operatorState, setOperatorState] = import_react78.useState(() => createInitialOperatorState("manual", 2));
|
|
148463
|
+
const [pendingApprovals] = import_react78.useState([]);
|
|
148464
|
+
const [lastApprovedAction] = import_react78.useState(null);
|
|
148465
|
+
const [verboseMode, setVerboseMode] = import_react78.useState(false);
|
|
148466
|
+
const [expandedLogs, setExpandedLogs] = import_react78.useState(false);
|
|
148467
|
+
import_react78.useEffect(() => {
|
|
148267
148468
|
async function loadSession() {
|
|
148268
148469
|
try {
|
|
148269
148470
|
const s = await sessions.get(sessionId);
|
|
@@ -148295,7 +148496,7 @@ function OperatorDashboard({
|
|
|
148295
148496
|
}
|
|
148296
148497
|
loadSession();
|
|
148297
148498
|
}, [sessionId, isResume]);
|
|
148298
|
-
const appendText =
|
|
148499
|
+
const appendText = import_react78.useCallback((text2) => {
|
|
148299
148500
|
textRef.current += text2;
|
|
148300
148501
|
const accumulated = textRef.current;
|
|
148301
148502
|
setMessages((prev) => {
|
|
@@ -148311,7 +148512,7 @@ function OperatorDashboard({
|
|
|
148311
148512
|
];
|
|
148312
148513
|
});
|
|
148313
148514
|
}, []);
|
|
148314
|
-
const addToolCall =
|
|
148515
|
+
const addToolCall = import_react78.useCallback((toolCallId, toolName, args) => {
|
|
148315
148516
|
textRef.current = "";
|
|
148316
148517
|
setMessages((prev) => [
|
|
148317
148518
|
...prev,
|
|
@@ -148326,7 +148527,7 @@ function OperatorDashboard({
|
|
|
148326
148527
|
}
|
|
148327
148528
|
]);
|
|
148328
148529
|
}, []);
|
|
148329
|
-
const updateToolResult =
|
|
148530
|
+
const updateToolResult = import_react78.useCallback((toolCallId, _toolName, result) => {
|
|
148330
148531
|
textRef.current = "";
|
|
148331
148532
|
setMessages((prev) => {
|
|
148332
148533
|
const idx = prev.findIndex((m3) => isToolMessage(m3) && m3.toolCallId === toolCallId);
|
|
@@ -148337,7 +148538,7 @@ function OperatorDashboard({
|
|
|
148337
148538
|
return updated;
|
|
148338
148539
|
});
|
|
148339
148540
|
}, []);
|
|
148340
|
-
const runAgent =
|
|
148541
|
+
const runAgent = import_react78.useCallback(async (prompt) => {
|
|
148341
148542
|
if (!session)
|
|
148342
148543
|
return;
|
|
148343
148544
|
setStatus("running");
|
|
@@ -148416,13 +148617,13 @@ function OperatorDashboard({
|
|
|
148416
148617
|
setThinking,
|
|
148417
148618
|
setIsExecuting
|
|
148418
148619
|
]);
|
|
148419
|
-
const handleSubmit =
|
|
148620
|
+
const handleSubmit = import_react78.useCallback((value) => {
|
|
148420
148621
|
if (!value.trim() || status === "running")
|
|
148421
148622
|
return;
|
|
148422
148623
|
setInputValue("");
|
|
148423
148624
|
runAgent(value.trim());
|
|
148424
148625
|
}, [status, runAgent]);
|
|
148425
|
-
const handleAbort =
|
|
148626
|
+
const handleAbort = import_react78.useCallback(() => {
|
|
148426
148627
|
if (abortControllerRef.current) {
|
|
148427
148628
|
abortControllerRef.current.abort();
|
|
148428
148629
|
abortControllerRef.current = null;
|
|
@@ -148478,7 +148679,7 @@ function OperatorDashboard({
|
|
|
148478
148679
|
alignItems: "center",
|
|
148479
148680
|
justifyContent: "center",
|
|
148480
148681
|
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
148481
|
-
fg:
|
|
148682
|
+
fg: colors2.textMuted,
|
|
148482
148683
|
children: "Loading session..."
|
|
148483
148684
|
}, undefined, false, undefined, this)
|
|
148484
148685
|
}, undefined, false, undefined, this);
|
|
@@ -148493,15 +148694,15 @@ function OperatorDashboard({
|
|
|
148493
148694
|
gap: 1,
|
|
148494
148695
|
children: [
|
|
148495
148696
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
148496
|
-
fg:
|
|
148697
|
+
fg: colors2.error,
|
|
148497
148698
|
children: "Failed to load session"
|
|
148498
148699
|
}, undefined, false, undefined, this),
|
|
148499
148700
|
error41 && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
148500
|
-
fg:
|
|
148701
|
+
fg: colors2.textMuted,
|
|
148501
148702
|
children: error41
|
|
148502
148703
|
}, undefined, false, undefined, this),
|
|
148503
148704
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
148504
|
-
fg:
|
|
148705
|
+
fg: colors2.textMuted,
|
|
148505
148706
|
children: "Press ESC to go back"
|
|
148506
148707
|
}, undefined, false, undefined, this)
|
|
148507
148708
|
]
|
|
@@ -148527,25 +148728,25 @@ function OperatorDashboard({
|
|
|
148527
148728
|
gap: 2,
|
|
148528
148729
|
children: [
|
|
148529
148730
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
148530
|
-
fg:
|
|
148731
|
+
fg: colors2.primary,
|
|
148531
148732
|
children: "Operator"
|
|
148532
148733
|
}, undefined, false, undefined, this),
|
|
148533
148734
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
148534
|
-
fg:
|
|
148735
|
+
fg: colors2.textMuted,
|
|
148535
148736
|
children: "•"
|
|
148536
148737
|
}, undefined, false, undefined, this),
|
|
148537
148738
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
148538
|
-
fg:
|
|
148739
|
+
fg: colors2.text,
|
|
148539
148740
|
children: session.name
|
|
148540
148741
|
}, undefined, false, undefined, this),
|
|
148541
148742
|
session.targets[0] && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
|
|
148542
148743
|
children: [
|
|
148543
148744
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
148544
|
-
fg:
|
|
148745
|
+
fg: colors2.textMuted,
|
|
148545
148746
|
children: "•"
|
|
148546
148747
|
}, undefined, false, undefined, this),
|
|
148547
148748
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
148548
|
-
fg:
|
|
148749
|
+
fg: colors2.textMuted,
|
|
148549
148750
|
children: session.targets[0]
|
|
148550
148751
|
}, undefined, false, undefined, this)
|
|
148551
148752
|
]
|
|
@@ -148557,11 +148758,11 @@ function OperatorDashboard({
|
|
|
148557
148758
|
gap: 2,
|
|
148558
148759
|
children: [
|
|
148559
148760
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
148560
|
-
fg: operatorState.mode === "auto" ?
|
|
148761
|
+
fg: operatorState.mode === "auto" ? colors2.primary : operatorState.mode === "plan" ? colors2.warning : colors2.info,
|
|
148561
148762
|
children: operatorState.mode.toUpperCase()
|
|
148562
148763
|
}, undefined, false, undefined, this),
|
|
148563
148764
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
148564
|
-
fg:
|
|
148765
|
+
fg: colors2.textMuted,
|
|
148565
148766
|
children: model.name
|
|
148566
148767
|
}, undefined, false, undefined, this)
|
|
148567
148768
|
]
|
|
@@ -148573,7 +148774,7 @@ function OperatorDashboard({
|
|
|
148573
148774
|
paddingRight: 2,
|
|
148574
148775
|
flexShrink: 0,
|
|
148575
148776
|
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
148576
|
-
fg:
|
|
148777
|
+
fg: colors2.error,
|
|
148577
148778
|
children: error41
|
|
148578
148779
|
}, undefined, false, undefined, this)
|
|
148579
148780
|
}, undefined, false, undefined, this),
|
|
@@ -148633,7 +148834,7 @@ Session paths:
|
|
|
148633
148834
|
}
|
|
148634
148835
|
|
|
148635
148836
|
// src/tui/components/commands/theme-picker.tsx
|
|
148636
|
-
var
|
|
148837
|
+
var import_react80 = __toESM(require_react(), 1);
|
|
148637
148838
|
function ThemePicker() {
|
|
148638
148839
|
const dimensions = useTerminalDimensions();
|
|
148639
148840
|
const route = useRoute();
|
|
@@ -148646,15 +148847,15 @@ function ThemePicker() {
|
|
|
148646
148847
|
toggleMode,
|
|
148647
148848
|
setMode
|
|
148648
148849
|
} = useTheme();
|
|
148649
|
-
const [selectedIndex, setSelectedIndex] =
|
|
148650
|
-
const originalThemeRef =
|
|
148651
|
-
const originalModeRef =
|
|
148652
|
-
const handleClose =
|
|
148850
|
+
const [selectedIndex, setSelectedIndex] = import_react80.useState(() => Math.max(0, availableThemes.indexOf(theme.name)));
|
|
148851
|
+
const originalThemeRef = import_react80.useRef(theme.name);
|
|
148852
|
+
const originalModeRef = import_react80.useRef(mode);
|
|
148853
|
+
const handleClose = import_react80.useCallback(() => {
|
|
148653
148854
|
setTheme(originalThemeRef.current);
|
|
148654
148855
|
setMode(originalModeRef.current);
|
|
148655
148856
|
route.navigate({ type: "base", path: "home" });
|
|
148656
148857
|
}, [setTheme, setMode, route]);
|
|
148657
|
-
const handleConfirm =
|
|
148858
|
+
const handleConfirm = import_react80.useCallback(async () => {
|
|
148658
148859
|
const currentThemeName = availableThemes[selectedIndex];
|
|
148659
148860
|
if (currentThemeName) {
|
|
148660
148861
|
await config.update({ theme: currentThemeName });
|
|
@@ -151181,52 +151382,47 @@ async function detectTerminalMode(timeoutMs = 1000) {
|
|
|
151181
151382
|
}
|
|
151182
151383
|
|
|
151183
151384
|
// src/tui/index.tsx
|
|
151184
|
-
function App(
|
|
151185
|
-
const
|
|
151186
|
-
const [
|
|
151187
|
-
const [
|
|
151188
|
-
const [
|
|
151189
|
-
const [
|
|
151190
|
-
const [
|
|
151191
|
-
const [
|
|
151192
|
-
const [showShortcutsDialog, setShowShortcutsDialog] = import_react80.useState(false);
|
|
151385
|
+
function App({ appConfig }) {
|
|
151386
|
+
const [focusIndex, setFocusIndex] = import_react83.useState(0);
|
|
151387
|
+
const [cwd, setCwd] = import_react83.useState(process.cwd());
|
|
151388
|
+
const [ctrlCPressTime, setCtrlCPressTime] = import_react83.useState(null);
|
|
151389
|
+
const [showExitWarning, setShowExitWarning] = import_react83.useState(false);
|
|
151390
|
+
const [inputKey, setInputKey] = import_react83.useState(0);
|
|
151391
|
+
const [showSessionsDialog, setShowSessionsDialog] = import_react83.useState(false);
|
|
151392
|
+
const [showShortcutsDialog, setShowShortcutsDialog] = import_react83.useState(false);
|
|
151193
151393
|
const navigableItems = ["command-input"];
|
|
151194
|
-
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(
|
|
151195
|
-
|
|
151196
|
-
|
|
151197
|
-
|
|
151198
|
-
|
|
151199
|
-
|
|
151200
|
-
|
|
151201
|
-
|
|
151202
|
-
|
|
151203
|
-
|
|
151204
|
-
|
|
151205
|
-
|
|
151206
|
-
|
|
151207
|
-
|
|
151208
|
-
|
|
151209
|
-
|
|
151210
|
-
|
|
151211
|
-
|
|
151212
|
-
|
|
151213
|
-
|
|
151214
|
-
|
|
151215
|
-
|
|
151216
|
-
|
|
151217
|
-
|
|
151218
|
-
|
|
151219
|
-
|
|
151220
|
-
|
|
151221
|
-
|
|
151222
|
-
|
|
151223
|
-
|
|
151224
|
-
|
|
151225
|
-
|
|
151226
|
-
setShowExitWarning,
|
|
151227
|
-
inputKey,
|
|
151228
|
-
setInputKey
|
|
151229
|
-
}, undefined, false, undefined, this)
|
|
151394
|
+
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ConfigProvider, {
|
|
151395
|
+
config: appConfig,
|
|
151396
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(SessionProvider, {
|
|
151397
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(RouteProvider, {
|
|
151398
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(FocusProvider, {
|
|
151399
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(InputProvider, {
|
|
151400
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(DialogProvider, {
|
|
151401
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(AgentProvider, {
|
|
151402
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(CommandProvider, {
|
|
151403
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(KeybindingProvider, {
|
|
151404
|
+
deps: {
|
|
151405
|
+
ctrlCPressTime,
|
|
151406
|
+
setCtrlCPressTime,
|
|
151407
|
+
setShowExitWarning,
|
|
151408
|
+
setInputKey,
|
|
151409
|
+
setShowSessionsDialog,
|
|
151410
|
+
setShowShortcutsDialog,
|
|
151411
|
+
setFocusIndex,
|
|
151412
|
+
navigableItems
|
|
151413
|
+
},
|
|
151414
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(AppContent, {
|
|
151415
|
+
focusIndex,
|
|
151416
|
+
showSessionsDialog,
|
|
151417
|
+
setShowSessionsDialog,
|
|
151418
|
+
showShortcutsDialog,
|
|
151419
|
+
setShowShortcutsDialog,
|
|
151420
|
+
cwd,
|
|
151421
|
+
setCtrlCPressTime,
|
|
151422
|
+
showExitWarning,
|
|
151423
|
+
setShowExitWarning,
|
|
151424
|
+
inputKey,
|
|
151425
|
+
setInputKey
|
|
151230
151426
|
}, undefined, false, undefined, this)
|
|
151231
151427
|
}, undefined, false, undefined, this)
|
|
151232
151428
|
}, undefined, false, undefined, this)
|
|
@@ -151256,7 +151452,7 @@ function AppContent({
|
|
|
151256
151452
|
const { colors: colors2 } = useTheme();
|
|
151257
151453
|
const { refocusPrompt } = useFocus();
|
|
151258
151454
|
const { setExternalDialogOpen } = useDialog();
|
|
151259
|
-
|
|
151455
|
+
import_react83.useEffect(() => {
|
|
151260
151456
|
if (route.data.type !== "base")
|
|
151261
151457
|
return;
|
|
151262
151458
|
if (!config4.data.responsibleUseAccepted && route.data.path !== "disclosure") {
|
|
@@ -151265,7 +151461,7 @@ function AppContent({
|
|
|
151265
151461
|
route.navigate({ type: "base", path: "providers" });
|
|
151266
151462
|
}
|
|
151267
151463
|
}, [config4.data.responsibleUseAccepted, route.data]);
|
|
151268
|
-
|
|
151464
|
+
import_react83.useEffect(() => {
|
|
151269
151465
|
if (showExitWarning) {
|
|
151270
151466
|
const timer = setTimeout(() => {
|
|
151271
151467
|
setShowExitWarning(false);
|
|
@@ -151448,17 +151644,28 @@ async function main2() {
|
|
|
151448
151644
|
process.on("uncaughtException", (err) => {
|
|
151449
151645
|
renderer.destroy();
|
|
151450
151646
|
console.error("Uncaught exception:", err);
|
|
151647
|
+
writeErrorLog(err, "UNCAUGHT");
|
|
151451
151648
|
process.exit(1);
|
|
151452
151649
|
});
|
|
151453
151650
|
process.on("unhandledRejection", (reason) => {
|
|
151454
151651
|
renderer.destroy();
|
|
151455
151652
|
console.error("Unhandled rejection:", reason);
|
|
151653
|
+
writeErrorLog(reason, "UNHANDLED_REJECTION");
|
|
151456
151654
|
process.exit(1);
|
|
151457
151655
|
});
|
|
151458
|
-
createRoot(renderer).render(/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(
|
|
151459
|
-
appConfig,
|
|
151656
|
+
createRoot(renderer).render(/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ThemeProvider, {
|
|
151460
151657
|
initialTheme: themeName,
|
|
151461
|
-
initialMode: mode
|
|
151658
|
+
initialMode: mode,
|
|
151659
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ToastProvider, {
|
|
151660
|
+
children: [
|
|
151661
|
+
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ErrorBoundary2, {
|
|
151662
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(App, {
|
|
151663
|
+
appConfig
|
|
151664
|
+
}, undefined, false, undefined, this)
|
|
151665
|
+
}, undefined, false, undefined, this),
|
|
151666
|
+
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ToastContainer, {}, undefined, false, undefined, this)
|
|
151667
|
+
]
|
|
151668
|
+
}, undefined, true, undefined, this)
|
|
151462
151669
|
}, undefined, false, undefined, this));
|
|
151463
151670
|
}
|
|
151464
151671
|
main2();
|