@pensar/apex 2.4.0 → 2.5.0-canary.0af37eb0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/agent-2edb792c.js +12 -0
- package/build/agent-317v8mmz.js +12 -0
- package/build/agent-vzqc5vtn.js +14 -0
- package/build/{agent-5ejt5vpz.js → agent-y85zsera.js} +42 -42
- package/build/{apps-17wvz1d7.js → apps-qf8jww9t.js} +74 -43
- package/build/{auth-z3h9859n.js → auth-wf1r533f.js} +57 -61
- package/build/blackboxAgent-cb4na30e.js +12 -0
- package/build/blackboxPentest-bf7b9m36.js +58 -0
- package/build/{cli-9rhzhgx2.js → cli-079enner.js} +5 -5
- package/build/cli-4ptm7wgt.js +12188 -0
- package/build/{cli-tznv8pf1.js → cli-6hrf9z35.js} +4 -4
- package/build/{cli-mavved45.js → cli-80mx747a.js} +89 -96
- package/build/cli-8w8k4dph.js +15 -0
- package/build/{cli-2cbwdk78.js → cli-a4v5vwfw.js} +4 -4
- package/build/cli-ag6jtndp.js +32 -0
- package/build/cli-bb02pjt0.js +1485 -0
- package/build/{cli-k71t434r.js → cli-ec2hwkv3.js} +34 -76
- package/build/{cli-k8kc47pq.js → cli-f3sg3e9x.js} +118 -115
- package/build/{cli-bc05qbss.js → cli-h6y3bt60.js} +13 -21
- package/build/{cli-xshasbwe.js → cli-jzcsaygf.js} +31 -52
- package/build/{cli-vnynf0js.js → cli-k8hgxz61.js} +11 -5
- package/build/{cli-32z0017y.js → cli-kn55pk78.js} +36 -60
- package/build/{cli-tkc598ey.js → cli-q8pr0zqg.js} +10042 -7665
- package/build/{cli-j54qa6tm.js → cli-qktcyj48.js} +1 -1
- package/build/cli-retw3rw5.js +12 -0
- package/build/{cli-b1adytsy.js → cli-s2y86fd5.js} +67 -39
- package/build/{cli-vq52kp7j.js → cli-t6mngnwd.js} +150 -128
- package/build/cli-tjm77pmx.js +12075 -0
- package/build/{cli-dm0fc0bm.js → cli-v1sarr4y.js} +5 -9
- package/build/cli-wpmm960k.js +22 -0
- package/build/{cli-5k33webc.js → cli-x069hfr2.js} +355 -332
- package/build/{cli-ee3axgts.js → cli-xbhr5khz.js} +1 -1
- package/build/{cli-repbyhkk.js → cli-y212s0r8.js} +26315 -25555
- package/build/cli-z82n3qk1.js +6 -0
- package/build/{cli-gq40s5b3.js → cli-zky875st.js} +33 -46
- package/build/cli.js +696 -132
- package/build/{config-f1mj4nhd.js → config-g93k0986.js} +29 -29
- package/build/{doctor-ekneewa3.js → doctor-4fcx7g0h.js} +4 -9
- package/build/{fastStrike-8zka43xs.js → fastStrike-af31ggmt.js} +26 -28
- package/build/{fixes-b89s5haw.js → fixes-6kxes4g7.js} +22 -27
- package/build/getMachineId-bsd-zr67nd9p.js +36 -0
- package/build/getMachineId-darwin-fd1d562d.js +36 -0
- package/build/getMachineId-linux-kjmg243j.js +29 -0
- package/build/getMachineId-unsupported-n4r58vke.js +19 -0
- package/build/getMachineId-win-yzgpfsrb.js +38 -0
- package/build/{index-sf16jm0m.js → index-3dpcjj6e.js} +137 -162
- package/build/index-4b9nc9e8.js +36 -0
- package/build/index-9f0xagac.js +22 -0
- package/build/index-9y2bjhh2.js +100 -0
- package/build/index-a1bg29j1.js +1559 -0
- package/build/{index-cbwn03kz.js → index-a2xycbjs.js} +12 -31
- package/build/index-k1mb1edx.js +12 -0
- package/build/{index-psqjpw5m.js → index-nweqptgs.js} +7 -7
- package/build/{index-6d22pyxt.js → index-r8554acn.js} +3000 -2435
- package/build/index-rjmmakbh.js +17 -0
- package/build/index-yfcbhfc1.js +9 -0
- package/build/{issues-xx5bs4md.js → issues-vgfdw93j.js} +81 -35
- package/build/{logs-qtxe51w2.js → logs-czxxx0n0.js} +20 -25
- package/build/{multipart-parser-g2xxkezz.js → multipart-parser-vjjdbpd1.js} +10 -10
- package/build/{offesecAgent-b9e2xm6v.js → offesecAgent-jwnbnsqm.js} +6 -13
- package/build/{parse-rtccymzn.js → parse-cqecqrc5.js} +0 -4
- package/build/pentest-hbwbfw9w.js +21 -0
- package/build/{pentests-6ks3szc4.js → pentests-6pp1j1w5.js} +23 -28
- package/build/{targetedPentest-s1ptvq8e.js → targetedPentest-34zhke7a.js} +16 -20
- package/build/{targets-sxygyj87.js → targets-yvh0d0fr.js} +22 -27
- package/build/threatModel-r96hed1d.js +19 -0
- package/build/{token-3bbp59y6.js → token-n0tmq8n5.js} +2 -2
- package/build/{token-util-6xjme11b.js → token-util-bv80pj47.js} +1 -2
- package/build/{uninstall-tvsh81v8.js → uninstall-qdzsynrt.js} +7 -4
- package/build/{upload-7wdyyqmr.js → upload-twg8pvy7.js} +7 -13
- package/build/{utils-7fwdkqk6.js → utils-cnv9jj0h.js} +7 -29
- package/package.json +8 -2
- package/build/agent-mvpgvgks.js +0 -19
- package/build/agent-nhs1w5w0.js +0 -29
- package/build/authentication-3s97cpk4.js +0 -19
- package/build/blackboxAgent-gw0a1ca4.js +0 -19
- package/build/blackboxPentest-44333zss.js +0 -37
- package/build/cli-0n4r54hq.js +0 -414
- package/build/cli-72cvcqhg.js +0 -22
- package/build/cli-qqt4gj1w.js +0 -53
- package/build/cli-swpbx60z.js +0 -24441
- package/build/index-4ad3sdwk.js +0 -39
- package/build/index-ghwf5z3v.js +0 -12
- package/build/index-hqjdg6fg.js +0 -205
- package/build/index-mtq7kmxz.js +0 -12856
- package/build/index-rbzhk712.js +0 -33
- package/build/index-y5w6n3tb.js +0 -19
- package/build/main-mmjp338j.js +0 -324
- package/build/pentest-xtc1sjdw.js +0 -29
- package/build/threatModel-xsm6fwk5.js +0 -27
- /package/build/{cli-c8131c4q.js → cli-0wsh8j2t.js} +0 -0
- /package/build/{cli-e08r86zk.js → cli-b3dvxjgk.js} +0 -0
- /package/build/{cli-fw5r7pfj.js → cli-q126f6ef.js} +0 -0
- /package/build/{cli-9fsre5pt.js → cli-qba2x69h.js} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CodeAgent2
|
|
3
|
+
} from "./cli-kn55pk78.js";
|
|
4
|
+
import"./cli-qba2x69h.js";
|
|
5
|
+
import"./cli-y212s0r8.js";
|
|
6
|
+
import"./cli-6hrf9z35.js";
|
|
7
|
+
import"./cli-q8pr0zqg.js";
|
|
8
|
+
import"./cli-qktcyj48.js";
|
|
9
|
+
import"./cli-wpmm960k.js";
|
|
10
|
+
export {
|
|
11
|
+
CodeAgent2 as CodeAgent
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runAuthenticationAgent2
|
|
3
|
+
} from "./cli-jzcsaygf.js";
|
|
4
|
+
import"./cli-qba2x69h.js";
|
|
5
|
+
import"./cli-y212s0r8.js";
|
|
6
|
+
import"./cli-6hrf9z35.js";
|
|
7
|
+
import"./cli-q8pr0zqg.js";
|
|
8
|
+
import"./cli-qktcyj48.js";
|
|
9
|
+
import"./cli-wpmm960k.js";
|
|
10
|
+
export {
|
|
11
|
+
runAuthenticationAgent2 as runAuthenticationAgent
|
|
12
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TargetedPentestAgent2,
|
|
3
|
+
buildPentestSystemPrompt2
|
|
4
|
+
} from "./cli-80mx747a.js";
|
|
5
|
+
import"./cli-qba2x69h.js";
|
|
6
|
+
import"./cli-y212s0r8.js";
|
|
7
|
+
import"./cli-6hrf9z35.js";
|
|
8
|
+
import"./cli-q8pr0zqg.js";
|
|
9
|
+
import"./cli-qktcyj48.js";
|
|
10
|
+
import"./cli-wpmm960k.js";
|
|
11
|
+
export {
|
|
12
|
+
TargetedPentestAgent2 as TargetedPentestAgent,
|
|
13
|
+
buildPentestSystemPrompt2 as buildPentestSystemPrompt
|
|
14
|
+
};
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-y212s0r8.js";
|
|
4
|
+
import"./cli-wpmm960k.js";
|
|
4
5
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
init_zod,
|
|
7
|
+
stepCountIs2,
|
|
8
|
+
init_dist
|
|
9
|
+
} from "./cli-q8pr0zqg.js";
|
|
8
10
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import"./cli-0n4r54hq.js";
|
|
11
|
+
detectOSAndEnhancePrompt
|
|
12
|
+
} from "./cli-6hrf9z35.js";
|
|
13
|
+
import"./cli-qba2x69h.js";
|
|
13
14
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import"./cli-
|
|
15
|
+
string,
|
|
16
|
+
number,
|
|
17
|
+
boolean,
|
|
18
|
+
array,
|
|
19
|
+
object,
|
|
20
|
+
_enum
|
|
21
|
+
} from "./cli-tjm77pmx.js";
|
|
22
|
+
import"./cli-qktcyj48.js";
|
|
22
23
|
|
|
23
24
|
// src/core/agents/specialized/findingJudge/agent.ts
|
|
24
25
|
init_dist();
|
|
@@ -168,17 +169,17 @@ var FINDING_TYPES = [
|
|
|
168
169
|
"informational",
|
|
169
170
|
"expected-behavior"
|
|
170
171
|
];
|
|
171
|
-
var FindingJudgeOutputSchema =
|
|
172
|
-
valid:
|
|
173
|
-
findingType:
|
|
174
|
-
confidence:
|
|
175
|
-
reasoning:
|
|
176
|
-
concerns:
|
|
177
|
-
verificationSteps:
|
|
178
|
-
toolEvidence:
|
|
179
|
-
reproducedPoc:
|
|
180
|
-
webResearchUsed:
|
|
181
|
-
limitations:
|
|
172
|
+
var FindingJudgeOutputSchema = object({
|
|
173
|
+
valid: boolean().describe("Whether the POC demonstrates a currently exploitable vulnerability that should be persisted"),
|
|
174
|
+
findingType: _enum(FINDING_TYPES).describe("Classification: 'vulnerability' for genuine security issues, 'informational' for low-risk observations worth noting, 'expected-behavior' for findings that describe intentional design decisions"),
|
|
175
|
+
confidence: number().min(0).max(1).describe("Confidence in the judgment, a decimal between 0.0 (no confidence) and 1.0 (certain)"),
|
|
176
|
+
reasoning: string().describe("Brief explanation of the key tool observations and analysis that led to this judgment"),
|
|
177
|
+
concerns: array(string()).describe("Specific concerns identified. Empty array only when the finding is a valid high-confidence vulnerability."),
|
|
178
|
+
verificationSteps: array(string()).describe("Concrete verification actions performed before deciding."),
|
|
179
|
+
toolEvidence: array(string()).describe("Specific observations from tool output or provided artifacts."),
|
|
180
|
+
reproducedPoc: boolean().describe("Whether the judge reran or independently reproduced the POC."),
|
|
181
|
+
webResearchUsed: boolean().describe("Whether web_search/get_page materially informed the judgment."),
|
|
182
|
+
limitations: array(string()).describe("Remaining verification gaps or environmental limitations.")
|
|
182
183
|
});
|
|
183
184
|
|
|
184
185
|
// src/core/agents/specialized/findingJudge/agent.ts
|
|
@@ -195,25 +196,24 @@ var FINDING_JUDGE_ACTIVE_TOOLS = [
|
|
|
195
196
|
|
|
196
197
|
class FindingJudgeAgent extends OffensiveSecurityAgent {
|
|
197
198
|
constructor(opts) {
|
|
198
|
-
const
|
|
199
|
+
const {
|
|
200
|
+
finding,
|
|
201
|
+
target: targetOpt,
|
|
202
|
+
subagentId,
|
|
203
|
+
subagentName,
|
|
204
|
+
...base
|
|
205
|
+
} = opts;
|
|
206
|
+
const target = finding.target ?? targetOpt ?? base.session.targets[0];
|
|
199
207
|
super({
|
|
208
|
+
...base,
|
|
200
209
|
system: detectOSAndEnhancePrompt(FINDING_JUDGE_SYSTEM_PROMPT),
|
|
201
|
-
prompt: buildFindingJudgePrompt({ ...opts.finding, target }),
|
|
202
|
-
model: opts.model,
|
|
203
|
-
session: opts.session,
|
|
204
|
-
target,
|
|
205
|
-
authConfig: opts.authConfig,
|
|
206
|
-
abortSignal: opts.abortSignal,
|
|
207
|
-
eventBus: opts.eventBus,
|
|
208
|
-
sandbox: opts.sandbox,
|
|
209
|
-
enableThinking: opts.enableThinking,
|
|
210
|
-
thinkingEffort: opts.thinkingEffort,
|
|
211
|
-
openAIReasoningEffort: opts.openAIReasoningEffort,
|
|
212
|
-
subagentId: opts.subagentId ?? "finding-judge",
|
|
213
|
-
subagentName: opts.subagentName ?? "Finding Judge",
|
|
214
210
|
activeTools: [...FINDING_JUDGE_ACTIVE_TOOLS],
|
|
215
211
|
responseSchema: FindingJudgeOutputSchema,
|
|
216
|
-
stopWhen:
|
|
212
|
+
stopWhen: stepCountIs2(60),
|
|
213
|
+
target,
|
|
214
|
+
prompt: buildFindingJudgePrompt({ ...finding, target }),
|
|
215
|
+
subagentId: subagentId ?? "finding-judge",
|
|
216
|
+
subagentName: subagentName ?? "Finding Judge"
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
}
|
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import"./cli-
|
|
3
|
-
import"./cli-
|
|
4
|
-
import"./cli-gq40s5b3.js";
|
|
5
|
-
import"./cli-b1adytsy.js";
|
|
6
|
-
import"./cli-mavved45.js";
|
|
7
|
-
import"./cli-xshasbwe.js";
|
|
8
|
-
import"./cli-32z0017y.js";
|
|
9
|
-
import"./cli-k8kc47pq.js";
|
|
10
|
-
import"./cli-9fsre5pt.js";
|
|
11
|
-
import"./cli-qqt4gj1w.js";
|
|
2
|
+
import"./cli-wpmm960k.js";
|
|
3
|
+
import"./cli-q8pr0zqg.js";
|
|
12
4
|
import {
|
|
5
|
+
ENDPOINT_TRANSPORTS,
|
|
6
|
+
listApps,
|
|
7
|
+
getApp,
|
|
13
8
|
createApp,
|
|
14
|
-
|
|
9
|
+
updateApp,
|
|
15
10
|
deleteApp,
|
|
16
|
-
deleteEndpoint,
|
|
17
|
-
getApp,
|
|
18
|
-
getEndpoint,
|
|
19
|
-
listApps,
|
|
20
11
|
listEndpoints,
|
|
12
|
+
getEndpoint,
|
|
13
|
+
createEndpoint,
|
|
14
|
+
updateEndpoint,
|
|
15
|
+
deleteEndpoint,
|
|
21
16
|
searchApps,
|
|
22
17
|
searchEndpoints,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} from "./cli-
|
|
26
|
-
import"./cli-
|
|
27
|
-
import"./cli-
|
|
28
|
-
import"./cli-
|
|
29
|
-
import"./cli-
|
|
30
|
-
import"./cli-
|
|
31
|
-
import"./cli-
|
|
32
|
-
import"./cli-
|
|
33
|
-
import"./cli-
|
|
34
|
-
import"./cli-
|
|
35
|
-
import
|
|
36
|
-
|
|
18
|
+
listDomains,
|
|
19
|
+
createDomain
|
|
20
|
+
} from "./cli-y212s0r8.js";
|
|
21
|
+
import"./cli-6hrf9z35.js";
|
|
22
|
+
import"./cli-zky875st.js";
|
|
23
|
+
import"./cli-kn55pk78.js";
|
|
24
|
+
import"./cli-f3sg3e9x.js";
|
|
25
|
+
import"./cli-x069hfr2.js";
|
|
26
|
+
import"./cli-jzcsaygf.js";
|
|
27
|
+
import"./cli-80mx747a.js";
|
|
28
|
+
import"./cli-s2y86fd5.js";
|
|
29
|
+
import"./cli-t6mngnwd.js";
|
|
30
|
+
import {
|
|
31
|
+
markCommandFailed
|
|
32
|
+
} from "./cli-z82n3qk1.js";
|
|
33
|
+
import"./cli-qba2x69h.js";
|
|
34
|
+
import"./cli-qktcyj48.js";
|
|
37
35
|
|
|
38
36
|
// src/cli/apps.ts
|
|
39
37
|
var APPLICATION_TYPES = [
|
|
@@ -88,6 +86,14 @@ function parseEndpointType(value) {
|
|
|
88
86
|
}
|
|
89
87
|
return value;
|
|
90
88
|
}
|
|
89
|
+
function parseTransport(value) {
|
|
90
|
+
if (value === undefined)
|
|
91
|
+
return;
|
|
92
|
+
if (!ENDPOINT_TRANSPORTS.includes(value)) {
|
|
93
|
+
throw new Error(`Invalid --transport "${value}". Must be one of: ${ENDPOINT_TRANSPORTS.join(", ")}`);
|
|
94
|
+
}
|
|
95
|
+
return value;
|
|
96
|
+
}
|
|
91
97
|
function parseInteger(flag, value) {
|
|
92
98
|
if (value === undefined)
|
|
93
99
|
return;
|
|
@@ -117,6 +123,8 @@ Usage:
|
|
|
117
123
|
pensar apps create [options] Create an app
|
|
118
124
|
pensar apps update <appId> [options] Update an app
|
|
119
125
|
pensar apps delete <appId> Delete an app
|
|
126
|
+
pensar apps domains List workspace domains
|
|
127
|
+
pensar apps domain-create <domain> Create/resolve a domain
|
|
120
128
|
pensar apps endpoints <appId> [filters] List endpoints
|
|
121
129
|
pensar apps endpoint <endpointId> Show endpoint details
|
|
122
130
|
pensar apps endpoint-create <appId> [options] Create an endpoint
|
|
@@ -130,9 +138,13 @@ App fields (create requires --name and --description):
|
|
|
130
138
|
--description <text> Application description
|
|
131
139
|
--type <type> One of: ${APPLICATION_TYPES.join(", ")}
|
|
132
140
|
--framework <text> Framework / runtime hint
|
|
133
|
-
--domain <id> Linked domain UUID
|
|
141
|
+
--domain <id> Linked domain UUID (see "apps domains")
|
|
134
142
|
--disallowed-actions <text> Free-form disallowed actions notes
|
|
135
143
|
|
|
144
|
+
Domains:
|
|
145
|
+
API-created domains are canonicalized and created idempotently by Console.
|
|
146
|
+
They stay unverified and do not start reconnaissance.
|
|
147
|
+
|
|
136
148
|
List pagination (for "apps" and "endpoints <appId>"):
|
|
137
149
|
--limit <n> Page size (default 100, max 200)
|
|
138
150
|
--offset <n> Page offset (default 0)
|
|
@@ -158,6 +170,8 @@ Endpoint fields (create requires --endpoint and --description):
|
|
|
158
170
|
--endpoint <text> Endpoint path / URL / route
|
|
159
171
|
--description <text> Endpoint description
|
|
160
172
|
--type <type> One of: ${ENDPOINT_TYPES.join(", ")}
|
|
173
|
+
--transport <transport> One of: ${ENDPOINT_TRANSPORTS.join(", ")}
|
|
174
|
+
(defaults to http when omitted)
|
|
161
175
|
--location <text> Source file (whitebox)
|
|
162
176
|
--start-line <n> Start line number
|
|
163
177
|
--end-line <n> End line number
|
|
@@ -235,6 +249,7 @@ function parseEndpointCreateOptions(argv) {
|
|
|
235
249
|
if (description === undefined)
|
|
236
250
|
throw new Error("--description is required");
|
|
237
251
|
const type = parseEndpointType(getFlag("--type", argv));
|
|
252
|
+
const transport = parseTransport(getFlag("--transport", argv));
|
|
238
253
|
const location = getFlag("--location", argv);
|
|
239
254
|
const startLineNumber = parseInteger("--start-line", getFlag("--start-line", argv));
|
|
240
255
|
const endLineNumber = parseInteger("--end-line", getFlag("--end-line", argv));
|
|
@@ -246,6 +261,7 @@ function parseEndpointCreateOptions(argv) {
|
|
|
246
261
|
endpoint,
|
|
247
262
|
description,
|
|
248
263
|
...type !== undefined ? { type } : {},
|
|
264
|
+
...transport !== undefined ? { transport } : {},
|
|
249
265
|
...location !== undefined ? { location } : {},
|
|
250
266
|
...startLineNumber !== undefined ? { startLineNumber } : {},
|
|
251
267
|
...endLineNumber !== undefined ? { endLineNumber } : {},
|
|
@@ -269,6 +285,9 @@ function parseEndpointUpdateOptions(argv) {
|
|
|
269
285
|
const type = parseEndpointType(getFlag("--type", argv));
|
|
270
286
|
if (type !== undefined)
|
|
271
287
|
update.type = type;
|
|
288
|
+
const transport = parseTransport(getFlag("--transport", argv));
|
|
289
|
+
if (transport !== undefined)
|
|
290
|
+
update.transport = transport;
|
|
272
291
|
const location = getFlag("--location", argv);
|
|
273
292
|
if (location !== undefined)
|
|
274
293
|
update.location = location;
|
|
@@ -305,7 +324,7 @@ async function main() {
|
|
|
305
324
|
if (!appId) {
|
|
306
325
|
console.error("Error: app ID is required");
|
|
307
326
|
console.error("Usage: pensar apps get <appId>");
|
|
308
|
-
|
|
327
|
+
return markCommandFailed();
|
|
309
328
|
}
|
|
310
329
|
const app = await getApp(appId);
|
|
311
330
|
console.log(JSON.stringify(app, null, 2));
|
|
@@ -318,7 +337,7 @@ async function main() {
|
|
|
318
337
|
if (!appId) {
|
|
319
338
|
console.error("Error: app ID is required");
|
|
320
339
|
console.error("Usage: pensar apps update <appId> [options]");
|
|
321
|
-
|
|
340
|
+
return markCommandFailed();
|
|
322
341
|
}
|
|
323
342
|
const opts = parseAppUpdateOptions(args);
|
|
324
343
|
const result = await updateApp(appId, opts);
|
|
@@ -328,16 +347,28 @@ async function main() {
|
|
|
328
347
|
if (!appId) {
|
|
329
348
|
console.error("Error: app ID is required");
|
|
330
349
|
console.error("Usage: pensar apps delete <appId>");
|
|
331
|
-
|
|
350
|
+
return markCommandFailed();
|
|
332
351
|
}
|
|
333
352
|
const result = await deleteApp(appId);
|
|
334
353
|
console.log(JSON.stringify(result, null, 2));
|
|
354
|
+
} else if (sub === "domains") {
|
|
355
|
+
const result = await listDomains();
|
|
356
|
+
console.log(JSON.stringify(result, null, 2));
|
|
357
|
+
} else if (sub === "domain-create") {
|
|
358
|
+
const url = args[1];
|
|
359
|
+
if (!url) {
|
|
360
|
+
console.error("Error: domain is required");
|
|
361
|
+
console.error("Usage: pensar apps domain-create <domain>");
|
|
362
|
+
return markCommandFailed();
|
|
363
|
+
}
|
|
364
|
+
const result = await createDomain({ url });
|
|
365
|
+
console.log(JSON.stringify(result, null, 2));
|
|
335
366
|
} else if (sub === "endpoints") {
|
|
336
367
|
const appId = args[1];
|
|
337
368
|
if (!appId) {
|
|
338
369
|
console.error("Error: app ID is required");
|
|
339
370
|
console.error("Usage: pensar apps endpoints <appId> [filters]");
|
|
340
|
-
|
|
371
|
+
return markCommandFailed();
|
|
341
372
|
}
|
|
342
373
|
const type = parseEndpointType(getFlag("--type", args));
|
|
343
374
|
const minRiskScore = parseNumber("--min-risk", getFlag("--min-risk", args));
|
|
@@ -356,7 +387,7 @@ async function main() {
|
|
|
356
387
|
if (!endpointId) {
|
|
357
388
|
console.error("Error: endpoint ID is required");
|
|
358
389
|
console.error("Usage: pensar apps endpoint <endpointId>");
|
|
359
|
-
|
|
390
|
+
return markCommandFailed();
|
|
360
391
|
}
|
|
361
392
|
const result = await getEndpoint(endpointId);
|
|
362
393
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -365,7 +396,7 @@ async function main() {
|
|
|
365
396
|
if (!appId) {
|
|
366
397
|
console.error("Error: app ID is required");
|
|
367
398
|
console.error("Usage: pensar apps endpoint-create <appId> --endpoint E --description D");
|
|
368
|
-
|
|
399
|
+
return markCommandFailed();
|
|
369
400
|
}
|
|
370
401
|
const opts = parseEndpointCreateOptions(args);
|
|
371
402
|
const result = await createEndpoint(appId, opts);
|
|
@@ -375,7 +406,7 @@ async function main() {
|
|
|
375
406
|
if (!endpointId) {
|
|
376
407
|
console.error("Error: endpoint ID is required");
|
|
377
408
|
console.error("Usage: pensar apps endpoint-update <endpointId> [options]");
|
|
378
|
-
|
|
409
|
+
return markCommandFailed();
|
|
379
410
|
}
|
|
380
411
|
const opts = parseEndpointUpdateOptions(args);
|
|
381
412
|
const result = await updateEndpoint(endpointId, opts);
|
|
@@ -385,7 +416,7 @@ async function main() {
|
|
|
385
416
|
if (!endpointId) {
|
|
386
417
|
console.error("Error: endpoint ID is required");
|
|
387
418
|
console.error("Usage: pensar apps endpoint-delete <endpointId>");
|
|
388
|
-
|
|
419
|
+
return markCommandFailed();
|
|
389
420
|
}
|
|
390
421
|
const result = await deleteEndpoint(endpointId);
|
|
391
422
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -394,7 +425,7 @@ async function main() {
|
|
|
394
425
|
if (!query || query.startsWith("--")) {
|
|
395
426
|
console.error("Error: search query is required");
|
|
396
427
|
console.error("Usage: pensar apps search <query> [options]");
|
|
397
|
-
|
|
428
|
+
return markCommandFailed();
|
|
398
429
|
}
|
|
399
430
|
const type = parseAppType(getFlag("--type", args));
|
|
400
431
|
const limit = parseInteger("--limit", getFlag("--limit", args));
|
|
@@ -410,7 +441,7 @@ async function main() {
|
|
|
410
441
|
if (!query || query.startsWith("--")) {
|
|
411
442
|
console.error("Error: search query is required");
|
|
412
443
|
console.error("Usage: pensar apps search-endpoints <query> [options]");
|
|
413
|
-
|
|
444
|
+
return markCommandFailed();
|
|
414
445
|
}
|
|
415
446
|
const applicationId = getFlag("--app", args);
|
|
416
447
|
const type = parseEndpointType(getFlag("--type", args));
|
|
@@ -438,12 +469,12 @@ async function main() {
|
|
|
438
469
|
} else {
|
|
439
470
|
console.error(`Error: Unknown subcommand "${sub}"`);
|
|
440
471
|
showHelp();
|
|
441
|
-
|
|
472
|
+
return markCommandFailed();
|
|
442
473
|
}
|
|
443
474
|
} catch (err) {
|
|
444
475
|
console.error(`
|
|
445
476
|
Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
446
|
-
|
|
477
|
+
return markCommandFailed();
|
|
447
478
|
}
|
|
448
479
|
}
|
|
449
|
-
main();
|
|
480
|
+
await main();
|
|
@@ -1,46 +1,42 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import"./cli-vq52kp7j.js";
|
|
3
|
-
import"./cli-5k33webc.js";
|
|
4
|
-
import"./cli-gq40s5b3.js";
|
|
5
|
-
import"./cli-b1adytsy.js";
|
|
6
|
-
import"./cli-mavved45.js";
|
|
7
|
-
import"./cli-xshasbwe.js";
|
|
8
|
-
import"./cli-32z0017y.js";
|
|
9
|
-
import"./cli-k8kc47pq.js";
|
|
10
|
-
import"./cli-9fsre5pt.js";
|
|
11
|
-
import"./cli-qqt4gj1w.js";
|
|
12
|
-
import"./cli-repbyhkk.js";
|
|
13
|
-
import"./cli-tznv8pf1.js";
|
|
14
|
-
import"./cli-fw5r7pfj.js";
|
|
15
|
-
import"./cli-c8131c4q.js";
|
|
16
|
-
import"./cli-tkc598ey.js";
|
|
17
2
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
config2,
|
|
4
|
+
init_config
|
|
5
|
+
} from "./cli-wpmm960k.js";
|
|
6
|
+
import {
|
|
22
7
|
getPensarApiUrl,
|
|
23
8
|
getPensarConsoleUrl,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
9
|
+
isConnected2,
|
|
10
|
+
disconnect2,
|
|
11
|
+
startDeviceFlow2,
|
|
12
|
+
pollWorkOSToken2,
|
|
13
|
+
pollLegacyToken2,
|
|
14
|
+
ensureValidToken2,
|
|
15
|
+
fetchWorkspaces2,
|
|
16
|
+
pollForWorkspaceCreation2,
|
|
17
|
+
selectWorkspace2,
|
|
18
|
+
createWorkspaceSelection2,
|
|
19
|
+
pollWorkspaceSelection2,
|
|
20
|
+
init_auth
|
|
21
|
+
} from "./cli-q8pr0zqg.js";
|
|
22
|
+
import"./cli-y212s0r8.js";
|
|
23
|
+
import"./cli-6hrf9z35.js";
|
|
24
|
+
import"./cli-zky875st.js";
|
|
25
|
+
import"./cli-kn55pk78.js";
|
|
26
|
+
import"./cli-f3sg3e9x.js";
|
|
27
|
+
import"./cli-x069hfr2.js";
|
|
28
|
+
import"./cli-jzcsaygf.js";
|
|
29
|
+
import"./cli-80mx747a.js";
|
|
30
|
+
import"./cli-s2y86fd5.js";
|
|
31
|
+
import"./cli-t6mngnwd.js";
|
|
35
32
|
import {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
import"./cli-
|
|
40
|
-
import"./cli-vnynf0js.js";
|
|
33
|
+
markCommandFailed
|
|
34
|
+
} from "./cli-z82n3qk1.js";
|
|
35
|
+
import"./cli-qba2x69h.js";
|
|
36
|
+
import"./cli-qktcyj48.js";
|
|
41
37
|
import {
|
|
42
38
|
__require
|
|
43
|
-
} from "./cli-
|
|
39
|
+
} from "./cli-h6y3bt60.js";
|
|
44
40
|
|
|
45
41
|
// src/cli/auth.ts
|
|
46
42
|
import * as readline from "node:readline";
|
|
@@ -74,7 +70,7 @@ function prompt(question) {
|
|
|
74
70
|
});
|
|
75
71
|
}
|
|
76
72
|
async function selectWorkspaceInBrowser(apiUrl, accessToken) {
|
|
77
|
-
const selection = await
|
|
73
|
+
const selection = await createWorkspaceSelection2(apiUrl, accessToken);
|
|
78
74
|
openUrl(selection.selectionUrl);
|
|
79
75
|
console.log(`
|
|
80
76
|
You have multiple workspaces. Choose one in your browser to continue.
|
|
@@ -82,12 +78,12 @@ If the browser didn't open, visit:
|
|
|
82
78
|
${selection.selectionUrl}
|
|
83
79
|
|
|
84
80
|
Waiting for workspace selection...`);
|
|
85
|
-
return
|
|
81
|
+
return pollWorkspaceSelection2(apiUrl, accessToken, selection.selectionId);
|
|
86
82
|
}
|
|
87
83
|
async function login() {
|
|
88
|
-
const appConfig = await
|
|
89
|
-
const hasStoredCredentials =
|
|
90
|
-
const validToken = hasStoredCredentials ? await
|
|
84
|
+
const appConfig = await config2.get();
|
|
85
|
+
const hasStoredCredentials = isConnected2(appConfig);
|
|
86
|
+
const validToken = hasStoredCredentials ? await ensureValidToken2({
|
|
91
87
|
accessToken: appConfig.accessToken,
|
|
92
88
|
refreshToken: appConfig.refreshToken,
|
|
93
89
|
pensarAPIKey: appConfig.pensarAPIKey
|
|
@@ -110,7 +106,7 @@ Pensar Console — Managed Inference
|
|
|
110
106
|
Connect for usage-based AI inference. No API keys needed.
|
|
111
107
|
`);
|
|
112
108
|
const apiUrl = getPensarApiUrl();
|
|
113
|
-
const flowInfo = await
|
|
109
|
+
const flowInfo = await startDeviceFlow2(apiUrl);
|
|
114
110
|
if (flowInfo.mode === "workos") {
|
|
115
111
|
const { clientId, deviceInfo } = flowInfo;
|
|
116
112
|
openUrl(deviceInfo.verification_uri_complete);
|
|
@@ -121,13 +117,13 @@ If not, open this URL:
|
|
|
121
117
|
Your code: ${deviceInfo.user_code}
|
|
122
118
|
|
|
123
119
|
Waiting for browser authorization...`);
|
|
124
|
-
const tokens = await
|
|
120
|
+
const tokens = await pollWorkOSToken2({
|
|
125
121
|
clientId,
|
|
126
122
|
deviceCode: deviceInfo.device_code,
|
|
127
123
|
interval: deviceInfo.interval,
|
|
128
124
|
expiresIn: deviceInfo.expires_in
|
|
129
125
|
});
|
|
130
|
-
await
|
|
126
|
+
await config2.update({
|
|
131
127
|
accessToken: tokens.accessToken,
|
|
132
128
|
refreshToken: tokens.refreshToken
|
|
133
129
|
});
|
|
@@ -144,7 +140,7 @@ If not, open this URL:
|
|
|
144
140
|
Your code: ${deviceInfo.userCode}
|
|
145
141
|
|
|
146
142
|
Waiting for browser authorization...`);
|
|
147
|
-
const data = await
|
|
143
|
+
const data = await pollLegacyToken2({
|
|
148
144
|
apiUrl,
|
|
149
145
|
deviceCode: deviceInfo.deviceCode,
|
|
150
146
|
interval: deviceInfo.interval,
|
|
@@ -155,12 +151,12 @@ Waiting for browser authorization...`);
|
|
|
155
151
|
if (!apiKey) {
|
|
156
152
|
throw new Error("Pensar Console did not return an API key");
|
|
157
153
|
}
|
|
158
|
-
await
|
|
154
|
+
await config2.update({
|
|
159
155
|
pensarAPIKey: apiKey,
|
|
160
156
|
gatewaySigningKey: data.signingKey ?? null
|
|
161
157
|
});
|
|
162
158
|
if (data.workspace) {
|
|
163
|
-
await
|
|
159
|
+
await config2.update({
|
|
164
160
|
workspaceId: data.workspace.id,
|
|
165
161
|
workspaceSlug: data.workspace.slug
|
|
166
162
|
});
|
|
@@ -176,7 +172,7 @@ Waiting for browser authorization...`);
|
|
|
176
172
|
}
|
|
177
173
|
}
|
|
178
174
|
async function handleWorkspaces(apiUrl, accessToken) {
|
|
179
|
-
const wsResult = await
|
|
175
|
+
const wsResult = await fetchWorkspaces2(apiUrl, accessToken);
|
|
180
176
|
let workspaces = wsResult.workspaces;
|
|
181
177
|
const consoleUrl = wsResult.consoleUrl ?? getPensarConsoleUrl();
|
|
182
178
|
if (workspaces.length === 0) {
|
|
@@ -186,7 +182,7 @@ If the browser didn't open, visit: ${consoleUrl}/create-workspace?redirect=/cred
|
|
|
186
182
|
`);
|
|
187
183
|
openUrl(`${consoleUrl}/create-workspace?redirect=/credits`);
|
|
188
184
|
console.log("Waiting for workspace creation...");
|
|
189
|
-
workspaces = await
|
|
185
|
+
workspaces = await pollForWorkspaceCreation2(apiUrl, accessToken);
|
|
190
186
|
}
|
|
191
187
|
let workspaceId;
|
|
192
188
|
if (workspaces.length === 1) {
|
|
@@ -198,9 +194,9 @@ If the browser didn't open, visit: ${consoleUrl}/create-workspace?redirect=/cred
|
|
|
198
194
|
} else {
|
|
199
195
|
workspaceId = await selectWorkspaceInBrowser(apiUrl, accessToken);
|
|
200
196
|
}
|
|
201
|
-
const result = await
|
|
197
|
+
const result = await selectWorkspace2(apiUrl, accessToken, workspaceId);
|
|
202
198
|
const workspace = result.workspace;
|
|
203
|
-
await
|
|
199
|
+
await config2.update({
|
|
204
200
|
workspaceId: workspace.id,
|
|
205
201
|
workspaceSlug: workspace.slug,
|
|
206
202
|
gatewaySigningKey: result.signingKey ?? null
|
|
@@ -223,21 +219,21 @@ If the browser didn't open, visit: ${consoleUrl}/create-workspace?redirect=/cred
|
|
|
223
219
|
console.log("\nPensar models are now available. Run `pensar` to get started.");
|
|
224
220
|
}
|
|
225
221
|
async function logout() {
|
|
226
|
-
const appConfig = await
|
|
227
|
-
if (!
|
|
222
|
+
const appConfig = await config2.get();
|
|
223
|
+
if (!isConnected2(appConfig)) {
|
|
228
224
|
console.log("Not currently connected to Pensar Console.");
|
|
229
225
|
return;
|
|
230
226
|
}
|
|
231
|
-
await
|
|
227
|
+
await disconnect2();
|
|
232
228
|
console.log("✓ Disconnected from Pensar Console.");
|
|
233
229
|
}
|
|
234
230
|
async function status() {
|
|
235
|
-
const appConfig = await
|
|
236
|
-
if (!
|
|
231
|
+
const appConfig = await config2.get();
|
|
232
|
+
if (!isConnected2(appConfig)) {
|
|
237
233
|
console.log("Not connected to Pensar Console.\n\nRun `pensar login` to connect.");
|
|
238
234
|
return;
|
|
239
235
|
}
|
|
240
|
-
const validToken = await
|
|
236
|
+
const validToken = await ensureValidToken2({
|
|
241
237
|
accessToken: appConfig.accessToken,
|
|
242
238
|
refreshToken: appConfig.refreshToken,
|
|
243
239
|
pensarAPIKey: appConfig.pensarAPIKey
|
|
@@ -255,7 +251,7 @@ async function status() {
|
|
|
255
251
|
if (res.ok) {
|
|
256
252
|
const data = await res.json();
|
|
257
253
|
if (data.workspace) {
|
|
258
|
-
await
|
|
254
|
+
await config2.update({
|
|
259
255
|
workspaceId: data.workspace.id,
|
|
260
256
|
workspaceSlug: data.workspace.slug
|
|
261
257
|
});
|
|
@@ -300,12 +296,12 @@ async function main() {
|
|
|
300
296
|
} else {
|
|
301
297
|
console.error(`Unknown auth subcommand: ${subcommand}`);
|
|
302
298
|
console.error("Run 'pensar login --help' for usage information");
|
|
303
|
-
|
|
299
|
+
return markCommandFailed();
|
|
304
300
|
}
|
|
305
301
|
} catch (err) {
|
|
306
302
|
console.error(`
|
|
307
303
|
Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
308
|
-
|
|
304
|
+
return markCommandFailed();
|
|
309
305
|
}
|
|
310
306
|
}
|
|
311
|
-
main();
|
|
307
|
+
await main();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlackboxAttackSurfaceAgent2
|
|
3
|
+
} from "./cli-zky875st.js";
|
|
4
|
+
import"./cli-qba2x69h.js";
|
|
5
|
+
import"./cli-y212s0r8.js";
|
|
6
|
+
import"./cli-6hrf9z35.js";
|
|
7
|
+
import"./cli-q8pr0zqg.js";
|
|
8
|
+
import"./cli-qktcyj48.js";
|
|
9
|
+
import"./cli-wpmm960k.js";
|
|
10
|
+
export {
|
|
11
|
+
BlackboxAttackSurfaceAgent2 as BlackboxAttackSurfaceAgent
|
|
12
|
+
};
|