@pensar/apex 0.0.100 → 0.0.101-canary.54d3fa9e
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 +16 -0
- package/build/auth.js +1 -1
- package/build/index.js +51 -43
- package/package.json +1 -1
package/bin/pensar.js
CHANGED
|
@@ -66,6 +66,13 @@ if (command === "benchmark") {
|
|
|
66
66
|
|
|
67
67
|
// Import and run auth
|
|
68
68
|
await import(authPath);
|
|
69
|
+
} else if (command === "uninstall") {
|
|
70
|
+
// Run uninstall CLI
|
|
71
|
+
const uninstallPath = join(__dirname, "..", "build", "uninstall.js");
|
|
72
|
+
|
|
73
|
+
process.argv = [process.argv[0], uninstallPath, ...args.slice(1)];
|
|
74
|
+
|
|
75
|
+
await import(uninstallPath);
|
|
69
76
|
} else if (command === "upgrade" || command === "update") {
|
|
70
77
|
const currentVersion = getCurrentVersion();
|
|
71
78
|
console.log(`Current version: v${currentVersion}`);
|
|
@@ -89,6 +96,7 @@ if (command === "benchmark") {
|
|
|
89
96
|
console.log();
|
|
90
97
|
console.log("Usage:");
|
|
91
98
|
console.log(" pensar Launch the TUI (Terminal User Interface)");
|
|
99
|
+
console.log(" pensar uninstall Uninstall Pensar (keeps sessions, memories, skills)");
|
|
92
100
|
console.log(" pensar upgrade Update pensar to the latest version");
|
|
93
101
|
console.log(" pensar help Show this help message");
|
|
94
102
|
console.log(" pensar version Show version number");
|
|
@@ -181,6 +189,14 @@ if (command === "benchmark") {
|
|
|
181
189
|
console.log(" pensar auth logout Disconnect from Pensar Console");
|
|
182
190
|
console.log(" pensar auth status Show connection status");
|
|
183
191
|
console.log();
|
|
192
|
+
console.log("Uninstall Usage:");
|
|
193
|
+
console.log(
|
|
194
|
+
" pensar uninstall Fully uninstall Pensar"
|
|
195
|
+
);
|
|
196
|
+
console.log(
|
|
197
|
+
" pensar uninstall --force Skip confirmation prompt"
|
|
198
|
+
);
|
|
199
|
+
console.log();
|
|
184
200
|
console.log("Header Modes (for quicktest, pentest, swarm):");
|
|
185
201
|
console.log(" none No custom headers added to requests");
|
|
186
202
|
console.log(
|
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.101-canary.54d3fa9e",
|
|
12
12
|
description: "AI-powered penetration testing CLI tool with terminal UI",
|
|
13
13
|
module: "src/tui/index.tsx",
|
|
14
14
|
main: "build/index.js",
|
package/build/index.js
CHANGED
|
@@ -31880,12 +31880,6 @@ var init_openrouter = __esm(() => {
|
|
|
31880
31880
|
var PENSAR_MODELS;
|
|
31881
31881
|
var init_pensar = __esm(() => {
|
|
31882
31882
|
PENSAR_MODELS = [
|
|
31883
|
-
{
|
|
31884
|
-
id: "pensar:anthropic.claude-opus-4-6-v1",
|
|
31885
|
-
name: "Claude Opus 4.6 (Pensar)",
|
|
31886
|
-
provider: "pensar",
|
|
31887
|
-
contextLength: 200000
|
|
31888
|
-
},
|
|
31889
31883
|
{
|
|
31890
31884
|
id: "pensar:anthropic.claude-sonnet-4-5-20250929-v1:0",
|
|
31891
31885
|
name: "Claude Sonnet 4.5 (Pensar)",
|
|
@@ -31977,7 +31971,7 @@ var package_default2;
|
|
|
31977
31971
|
var init_package = __esm(() => {
|
|
31978
31972
|
package_default2 = {
|
|
31979
31973
|
name: "@pensar/apex",
|
|
31980
|
-
version: "0.0.
|
|
31974
|
+
version: "0.0.101-canary.54d3fa9e",
|
|
31981
31975
|
description: "AI-powered penetration testing CLI tool with terminal UI",
|
|
31982
31976
|
module: "src/tui/index.tsx",
|
|
31983
31977
|
main: "build/index.js",
|
|
@@ -193797,6 +193791,19 @@ COMMON SEARCH PATTERNS:
|
|
|
193797
193791
|
execute: async ({ query }) => {
|
|
193798
193792
|
try {
|
|
193799
193793
|
const cfg = await config2.get();
|
|
193794
|
+
const apiUrl = getPensarApiUrl();
|
|
193795
|
+
const body = JSON.stringify({ query });
|
|
193796
|
+
if (cfg.pensarAPIKey && !cfg.accessToken) {
|
|
193797
|
+
const response2 = await fetch(`${apiUrl}/agents/web_search`, {
|
|
193798
|
+
method: "POST",
|
|
193799
|
+
headers: {
|
|
193800
|
+
"Content-Type": "application/json",
|
|
193801
|
+
"x-api-key": cfg.pensarAPIKey
|
|
193802
|
+
},
|
|
193803
|
+
body
|
|
193804
|
+
});
|
|
193805
|
+
return handleSearchResponse(response2);
|
|
193806
|
+
}
|
|
193800
193807
|
const tokenResult = await ensureValidToken({
|
|
193801
193808
|
accessToken: cfg.accessToken,
|
|
193802
193809
|
refreshToken: cfg.refreshToken,
|
|
@@ -193823,8 +193830,6 @@ COMMON SEARCH PATTERNS:
|
|
|
193823
193830
|
error: "Web search requires authentication. Please sign in again to your Pensar account."
|
|
193824
193831
|
};
|
|
193825
193832
|
}
|
|
193826
|
-
const apiUrl = getPensarApiUrl();
|
|
193827
|
-
const body = JSON.stringify({ query });
|
|
193828
193833
|
const { signature, timestamp, nonce } = signGatewayRequest(cfg.gatewaySigningKey, "web_search", body);
|
|
193829
193834
|
const response = await fetch(`${apiUrl}/agents/web_search`, {
|
|
193830
193835
|
method: "POST",
|
|
@@ -193838,40 +193843,7 @@ COMMON SEARCH PATTERNS:
|
|
|
193838
193843
|
},
|
|
193839
193844
|
body
|
|
193840
193845
|
});
|
|
193841
|
-
|
|
193842
|
-
if (response.status === 401) {
|
|
193843
|
-
return {
|
|
193844
|
-
success: false,
|
|
193845
|
-
results: [],
|
|
193846
|
-
error: "Authentication failed. Please sign in again to your Pensar account."
|
|
193847
|
-
};
|
|
193848
|
-
}
|
|
193849
|
-
if (response.status === 429) {
|
|
193850
|
-
return {
|
|
193851
|
-
success: false,
|
|
193852
|
-
results: [],
|
|
193853
|
-
error: "Rate limit exceeded. Please wait a moment before searching again."
|
|
193854
|
-
};
|
|
193855
|
-
}
|
|
193856
|
-
const errorText = await response.text().catch(() => "Unknown error");
|
|
193857
|
-
return {
|
|
193858
|
-
success: false,
|
|
193859
|
-
results: [],
|
|
193860
|
-
error: `Web search failed: ${response.status} ${response.statusText}. ${errorText}`
|
|
193861
|
-
};
|
|
193862
|
-
}
|
|
193863
|
-
const data = await response.json();
|
|
193864
|
-
if (data.error) {
|
|
193865
|
-
return {
|
|
193866
|
-
success: false,
|
|
193867
|
-
results: [],
|
|
193868
|
-
error: data.error
|
|
193869
|
-
};
|
|
193870
|
-
}
|
|
193871
|
-
return {
|
|
193872
|
-
success: true,
|
|
193873
|
-
results: data.results || []
|
|
193874
|
-
};
|
|
193846
|
+
return handleSearchResponse(response);
|
|
193875
193847
|
} catch (error40) {
|
|
193876
193848
|
const errorMsg = error40 instanceof Error ? error40.message : String(error40);
|
|
193877
193849
|
return {
|
|
@@ -193883,6 +193855,42 @@ COMMON SEARCH PATTERNS:
|
|
|
193883
193855
|
}
|
|
193884
193856
|
});
|
|
193885
193857
|
}
|
|
193858
|
+
async function handleSearchResponse(response) {
|
|
193859
|
+
if (!response.ok) {
|
|
193860
|
+
if (response.status === 401) {
|
|
193861
|
+
return {
|
|
193862
|
+
success: false,
|
|
193863
|
+
results: [],
|
|
193864
|
+
error: "Authentication failed. Please sign in again to your Pensar account."
|
|
193865
|
+
};
|
|
193866
|
+
}
|
|
193867
|
+
if (response.status === 429) {
|
|
193868
|
+
return {
|
|
193869
|
+
success: false,
|
|
193870
|
+
results: [],
|
|
193871
|
+
error: "Rate limit exceeded. Please wait a moment before searching again."
|
|
193872
|
+
};
|
|
193873
|
+
}
|
|
193874
|
+
const errorText = await response.text().catch(() => "Unknown error");
|
|
193875
|
+
return {
|
|
193876
|
+
success: false,
|
|
193877
|
+
results: [],
|
|
193878
|
+
error: `Web search failed: ${response.status} ${response.statusText}. ${errorText}`
|
|
193879
|
+
};
|
|
193880
|
+
}
|
|
193881
|
+
const data = await response.json();
|
|
193882
|
+
if (data.error) {
|
|
193883
|
+
return {
|
|
193884
|
+
success: false,
|
|
193885
|
+
results: [],
|
|
193886
|
+
error: data.error
|
|
193887
|
+
};
|
|
193888
|
+
}
|
|
193889
|
+
return {
|
|
193890
|
+
success: true,
|
|
193891
|
+
results: data.results || []
|
|
193892
|
+
};
|
|
193893
|
+
}
|
|
193886
193894
|
var webSearchInputSchema2;
|
|
193887
193895
|
var init_webSearch = __esm(() => {
|
|
193888
193896
|
init_dist5();
|