@pensar/apex 0.0.103 → 0.0.104-canary.4b0e689e
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/bin/pensar.js +43 -0
- package/build/auth.js +23 -6
- package/build/index.js +424 -301
- package/package.json +1 -1
package/bin/pensar.js
CHANGED
|
@@ -73,6 +73,26 @@ if (command === "benchmark") {
|
|
|
73
73
|
process.argv = [process.argv[0], uninstallPath, ...args.slice(1)];
|
|
74
74
|
|
|
75
75
|
await import(uninstallPath);
|
|
76
|
+
} else if (command === "projects") {
|
|
77
|
+
const p = join(__dirname, "..", "build", "projects.js");
|
|
78
|
+
process.argv = [process.argv[0], p, ...args.slice(1)];
|
|
79
|
+
await import(p);
|
|
80
|
+
} else if (command === "pentests") {
|
|
81
|
+
const p = join(__dirname, "..", "build", "pentests.js");
|
|
82
|
+
process.argv = [process.argv[0], p, ...args.slice(1)];
|
|
83
|
+
await import(p);
|
|
84
|
+
} else if (command === "issues") {
|
|
85
|
+
const p = join(__dirname, "..", "build", "issues.js");
|
|
86
|
+
process.argv = [process.argv[0], p, ...args.slice(1)];
|
|
87
|
+
await import(p);
|
|
88
|
+
} else if (command === "fixes") {
|
|
89
|
+
const p = join(__dirname, "..", "build", "fixes.js");
|
|
90
|
+
process.argv = [process.argv[0], p, ...args.slice(1)];
|
|
91
|
+
await import(p);
|
|
92
|
+
} else if (command === "logs") {
|
|
93
|
+
const p = join(__dirname, "..", "build", "logs.js");
|
|
94
|
+
process.argv = [process.argv[0], p, ...args.slice(1)];
|
|
95
|
+
await import(p);
|
|
76
96
|
} else if (command === "upgrade" || command === "update") {
|
|
77
97
|
const currentVersion = getCurrentVersion();
|
|
78
98
|
console.log(`Current version: v${currentVersion}`);
|
|
@@ -109,6 +129,21 @@ if (command === "benchmark") {
|
|
|
109
129
|
console.log(
|
|
110
130
|
" pensar auth Connect to Pensar Console for managed inference"
|
|
111
131
|
);
|
|
132
|
+
console.log(
|
|
133
|
+
" pensar projects List workspace projects"
|
|
134
|
+
);
|
|
135
|
+
console.log(
|
|
136
|
+
" pensar pentests List and manage pentests"
|
|
137
|
+
);
|
|
138
|
+
console.log(
|
|
139
|
+
" pensar issues List and manage security issues"
|
|
140
|
+
);
|
|
141
|
+
console.log(
|
|
142
|
+
" pensar fixes View security fixes"
|
|
143
|
+
);
|
|
144
|
+
console.log(
|
|
145
|
+
" pensar logs View agent execution logs"
|
|
146
|
+
);
|
|
112
147
|
console.log();
|
|
113
148
|
console.log("Options:");
|
|
114
149
|
console.log(" -h, --help Show this help message");
|
|
@@ -226,6 +261,14 @@ if (command === "benchmark") {
|
|
|
226
261
|
console.log(" pensar auth");
|
|
227
262
|
console.log(" pensar auth status");
|
|
228
263
|
console.log(" pensar auth logout");
|
|
264
|
+
console.log();
|
|
265
|
+
console.log("Console API:");
|
|
266
|
+
console.log(" pensar projects");
|
|
267
|
+
console.log(" pensar pentests <projectId>");
|
|
268
|
+
console.log(" pensar issues <projectId>");
|
|
269
|
+
console.log(" pensar issues get <issueId>");
|
|
270
|
+
console.log(" pensar fixes <issueId>");
|
|
271
|
+
console.log(" pensar logs <issueId>");
|
|
229
272
|
} else if (args.length === 0) {
|
|
230
273
|
// No command specified, run the TUI
|
|
231
274
|
const appPath = join(__dirname, "..", "build", "index.js");
|
package/build/auth.js
CHANGED
|
@@ -8,7 +8,7 @@ import fs from "fs/promises";
|
|
|
8
8
|
// package.json
|
|
9
9
|
var package_default = {
|
|
10
10
|
name: "@pensar/apex",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.104-canary.4b0e689e",
|
|
12
12
|
description: "AI-powered penetration testing CLI tool with terminal UI",
|
|
13
13
|
module: "src/tui/index.tsx",
|
|
14
14
|
main: "build/index.js",
|
|
@@ -557,14 +557,31 @@ async function status() {
|
|
|
557
557
|
console.log("\nRun `pensar auth login` to connect.");
|
|
558
558
|
return;
|
|
559
559
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
560
|
+
if (!appConfig.accessToken && appConfig.pensarAPIKey && !appConfig.workspaceSlug) {
|
|
561
|
+
try {
|
|
562
|
+
const apiUrl = getPensarApiUrl();
|
|
563
|
+
const res = await fetch(`${apiUrl}/auth/validate`, {
|
|
564
|
+
headers: { Authorization: `Bearer ${appConfig.pensarAPIKey}` }
|
|
565
|
+
});
|
|
566
|
+
if (res.ok) {
|
|
567
|
+
const data = await res.json();
|
|
568
|
+
if (data.workspace) {
|
|
569
|
+
await config.update({
|
|
570
|
+
workspaceId: data.workspace.id,
|
|
571
|
+
workspaceSlug: data.workspace.slug
|
|
572
|
+
});
|
|
573
|
+
appConfig.workspaceId = data.workspace.id;
|
|
574
|
+
appConfig.workspaceSlug = data.workspace.slug;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
} catch {}
|
|
563
578
|
}
|
|
579
|
+
console.log("\u2713 Connected to Pensar Console");
|
|
580
|
+
console.log(` Workspace: ${appConfig.workspaceSlug ?? "not set"}`);
|
|
564
581
|
if (appConfig.accessToken) {
|
|
565
|
-
console.log(" Auth: WorkOS
|
|
582
|
+
console.log(" Auth: WorkOS");
|
|
566
583
|
} else {
|
|
567
|
-
console.log(" Auth: API key
|
|
584
|
+
console.log(" Auth: API key");
|
|
568
585
|
}
|
|
569
586
|
}
|
|
570
587
|
function showHelp() {
|