@pensar/apex 2.0.1 → 2.0.2-canary.1de5ff5b
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-x7n47c84.js → agent-0xj95pts.js} +10 -10
- package/build/{agent-6nhperp2.js → agent-e7a8ecyn.js} +12 -10
- package/build/agent-tcrb50te.js +19 -0
- package/build/{apps-2ac4vt09.js → apps-p91cynx1.js} +21 -16
- package/build/{auth-bmt98hz0.js → auth-snffaqnn.js} +16 -16
- package/build/authentication-8q9a1cpf.js +19 -0
- package/build/blackboxAgent-mwbcawfn.js +19 -0
- package/build/{blackboxPentest-xngbtdxb.js → blackboxPentest-2v0856w0.js} +14 -14
- package/build/{cli-hk03x6fq.js → cli-4x7k2s16.js} +4 -3
- package/build/{cli-w2st266h.js → cli-5c0rvt4t.js} +35 -6
- package/build/{cli-1f5zzrxj.js → cli-bcd6032f.js} +1 -1
- package/build/{cli-z1dapp7v.js → cli-bxtz3bdv.js} +78 -41
- package/build/{cli-fa7nrded.js → cli-cbhsy5x3.js} +5 -5
- package/build/{cli-zpdmnz8c.js → cli-d5vz4kyn.js} +6267 -1978
- package/build/{cli-e6rgwtpb.js → cli-f7d23ded.js} +6317 -3211
- package/build/{cli-88bhxzr1.js → cli-hkegr688.js} +4 -4
- package/build/{cli-mfzkhttr.js → cli-jzkfbrnx.js} +30 -22
- package/build/{cli-eptabm2j.js → cli-kn9tst6t.js} +1 -1
- package/build/{cli-ddtmgbqv.js → cli-mep0ck1r.js} +4 -4
- package/build/{cli-cc13ydyx.js → cli-p4aht9hv.js} +9 -9
- package/build/{cli-pyzw545d.js → cli-pevzp7nj.js} +78 -13
- package/build/{cli-8xknm7d9.js → cli-q24twygk.js} +1 -1
- package/build/{cli-fxtbkw2f.js → cli-r9v48v8g.js} +6 -6
- package/build/{cli-0yptvbbm.js → cli-w55v1bht.js} +11 -10
- package/build/{cli-f93g10xk.js → cli-wgqxjhky.js} +2 -2
- package/build/{cli-8g5cwvbm.js → cli-zgpj2mv1.js} +2 -2
- package/build/cli.js +67 -50
- package/build/{config-j0gfjhrm.js → config-rb760dgz.js} +4 -4
- package/build/{doctor-zn8ms7gs.js → doctor-2m2xy88h.js} +9 -9
- package/build/{fixes-d8ytvyzn.js → fixes-y8qx2ps5.js} +16 -16
- package/build/{index-2t2cg8x0.js → index-27fhky9b.js} +9 -9
- package/build/{index-528cyewc.js → index-5eb4pewb.js} +117 -71
- package/build/{index-hjvqqkem.js → index-cnd7y4g5.js} +4 -4
- package/build/{index-a1sy2zak.js → index-cwtb1k9c.js} +2 -2
- package/build/{index-9d2es97h.js → index-jhrbdyka.js} +3 -3
- package/build/{index-vc29b21w.js → index-mgng15va.js} +1 -1
- package/build/{index-3cbcjqw1.js → index-n04xcmzx.js} +10 -10
- package/build/{index-k6ttkac6.js → index-pkq9jjgj.js} +14 -13
- package/build/{issues-17kdjtdg.js → issues-hzqc762k.js} +16 -16
- package/build/{logs-r4rjar4m.js → logs-wmqhnyfa.js} +16 -16
- package/build/{offesecAgent-azd8ahkm.js → offesecAgent-6m7300st.js} +9 -9
- package/build/{parse-15kqmy2v.js → parse-7djk9jyf.js} +1 -1
- package/build/pentest-8b0ttsjk.js +28 -0
- package/build/{pentests-npjb5q1h.js → pentests-y3gqyam1.js} +16 -16
- package/build/{targetedPentest-m24wvscc.js → targetedPentest-yrs8xwvg.js} +10 -10
- package/build/targets-439kemyk.js +113 -0
- package/build/threatModel-zr6dmn2t.js +26 -0
- package/build/{uninstall-7pm6zcah.js → uninstall-p8d3kg6p.js} +9 -9
- package/build/{upload-wg0vxmk0.js → upload-5e7pkj1n.js} +7 -7
- package/build/{utils-gd1y4t26.js → utils-amj862q8.js} +6 -6
- package/package.json +10 -9
- package/build/agent-4g69jwmq.js +0 -19
- package/build/authentication-c0aj9zaz.js +0 -19
- package/build/blackboxAgent-sgph70e4.js +0 -19
- package/build/pentest-2vsjf0j8.js +0 -28
- package/build/threatModel-7akmfzzm.js +0 -26
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
init_auth,
|
|
5
5
|
init_constants,
|
|
6
6
|
signGatewayRequest
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-zgpj2mv1.js";
|
|
8
8
|
import {
|
|
9
9
|
AISDKError,
|
|
10
10
|
APICallError,
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
delay,
|
|
33
33
|
executeTool,
|
|
34
34
|
exports_external,
|
|
35
|
-
exports_external1 as exports_external2,
|
|
36
35
|
gateway,
|
|
37
36
|
getErrorMessage,
|
|
38
37
|
getErrorMessage1 as getErrorMessage2,
|
|
@@ -59,15 +58,15 @@ import {
|
|
|
59
58
|
withUserAgentSuffix,
|
|
60
59
|
zodSchema,
|
|
61
60
|
zod_default
|
|
62
|
-
} from "./cli-
|
|
61
|
+
} from "./cli-f7d23ded.js";
|
|
63
62
|
import {
|
|
64
63
|
config,
|
|
65
64
|
init_config
|
|
66
|
-
} from "./cli-
|
|
65
|
+
} from "./cli-kn9tst6t.js";
|
|
67
66
|
import {
|
|
68
67
|
getCurrentVersion,
|
|
69
68
|
init_installation
|
|
70
|
-
} from "./cli-
|
|
69
|
+
} from "./cli-w55v1bht.js";
|
|
71
70
|
import {
|
|
72
71
|
__callDispose,
|
|
73
72
|
__commonJS,
|
|
@@ -7747,6 +7746,24 @@ var init_bedrock = __esm(() => {
|
|
|
7747
7746
|
provider: "bedrock",
|
|
7748
7747
|
contextLength: 64000
|
|
7749
7748
|
},
|
|
7749
|
+
{
|
|
7750
|
+
id: "deepseek.v3-v1:0",
|
|
7751
|
+
name: "DeepSeek V3.1 (Bedrock)",
|
|
7752
|
+
provider: "bedrock",
|
|
7753
|
+
contextLength: 128000
|
|
7754
|
+
},
|
|
7755
|
+
{
|
|
7756
|
+
id: "qwen.qwen3-coder-480b-a35b-v1:0",
|
|
7757
|
+
name: "Qwen3 Coder 480B A35B Instruct (Bedrock)",
|
|
7758
|
+
provider: "bedrock",
|
|
7759
|
+
contextLength: 131072
|
|
7760
|
+
},
|
|
7761
|
+
{
|
|
7762
|
+
id: "zai.glm-5",
|
|
7763
|
+
name: "Z.AI GLM 5 (Bedrock)",
|
|
7764
|
+
provider: "bedrock",
|
|
7765
|
+
contextLength: 200000
|
|
7766
|
+
},
|
|
7750
7767
|
{
|
|
7751
7768
|
id: "us.mistral.pixtral-large-2502-v1:0",
|
|
7752
7769
|
name: "Pixtral Large-2502 (US)",
|
|
@@ -8696,6 +8713,9 @@ function getModelInfo(model) {
|
|
|
8696
8713
|
provider: "local"
|
|
8697
8714
|
};
|
|
8698
8715
|
}
|
|
8716
|
+
function prefersSequentialToolCalls(model) {
|
|
8717
|
+
return /(^|[./:-])deepseek([./:-]|$)/i.test(model);
|
|
8718
|
+
}
|
|
8699
8719
|
function getMaxOutputTokens(modelId) {
|
|
8700
8720
|
const fromPattern = lookupOutputBudgetByPattern(modelId);
|
|
8701
8721
|
const ctx = AVAILABLE_MODELS.find((m) => m.id === modelId)?.contextLength;
|
|
@@ -8760,9 +8780,15 @@ function lookupOutputBudgetByPattern(modelId) {
|
|
|
8760
8780
|
if (modelId.includes("minimax-m3")) {
|
|
8761
8781
|
return 128000;
|
|
8762
8782
|
}
|
|
8763
|
-
if (modelId.includes("glm-5
|
|
8783
|
+
if (modelId.includes("glm-5")) {
|
|
8764
8784
|
return 131072;
|
|
8765
8785
|
}
|
|
8786
|
+
if (modelId.includes("deepseek")) {
|
|
8787
|
+
return 8192;
|
|
8788
|
+
}
|
|
8789
|
+
if (modelId.includes("qwen")) {
|
|
8790
|
+
return 16000;
|
|
8791
|
+
}
|
|
8766
8792
|
return 4096;
|
|
8767
8793
|
}
|
|
8768
8794
|
var AVAILABLE_MODELS;
|
|
@@ -42064,8 +42090,8 @@ var init_caching = __esm(() => {
|
|
|
42064
42090
|
});
|
|
42065
42091
|
|
|
42066
42092
|
// src/core/ai/contextManagement.ts
|
|
42067
|
-
import { mkdirSync, writeFileSync } from "fs";
|
|
42068
|
-
import { join } from "path";
|
|
42093
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
42094
|
+
import { join } from "node:path";
|
|
42069
42095
|
function truncateWithMarker(text2, max, label) {
|
|
42070
42096
|
if (text2.length <= max)
|
|
42071
42097
|
return text2;
|
|
@@ -42112,7 +42138,7 @@ function applyToolResultBudget(messages, opts) {
|
|
|
42112
42138
|
[... truncated ${originalLength - preview.length} chars — full output saved to ${filePath}]`;
|
|
42113
42139
|
if (newValue.length >= text2.length)
|
|
42114
42140
|
return part;
|
|
42115
|
-
if (!persistedIds
|
|
42141
|
+
if (!persistedIds?.has(toolCallId)) {
|
|
42116
42142
|
if (!tailMatch) {
|
|
42117
42143
|
if (!dirCreated) {
|
|
42118
42144
|
mkdirSync(resultsDir, { recursive: true });
|
|
@@ -42144,7 +42170,7 @@ function snipOldSteps(messages, opts) {
|
|
|
42144
42170
|
let stepCount = 0;
|
|
42145
42171
|
let cutoffIdx = 0;
|
|
42146
42172
|
for (let i = messages.length - 1;i >= 0; i--) {
|
|
42147
|
-
if (messages[i]
|
|
42173
|
+
if (messages[i]?.role === "assistant") {
|
|
42148
42174
|
stepCount++;
|
|
42149
42175
|
if (stepCount === keepRecent) {
|
|
42150
42176
|
cutoffIdx = i;
|
|
@@ -42375,6 +42401,14 @@ function checkIfRateLimitError(error) {
|
|
|
42375
42401
|
const errorString = errorMessage || errorName ? "" : String(error).toLowerCase();
|
|
42376
42402
|
return errorMessage.includes("too many tokens") || errorMessage.includes("rate limit") || errorMessage.includes("request rate") || errorMessage.includes("throttl") || errorMessage.includes("overloaded") || errorMessage.includes("too many requests") || errorMessage.includes("please wait") || errorMessage.includes("service unavailable") || errorName.includes("throttl") || errorName.includes("toomanyrequests") || errorName.includes("serviceunavailable") || errorCode === "rate_limit_exceeded" || errorCode === "throttling" || errorCode === "429" || httpStatus === 429 || httpStatus === 529 || httpStatus === 503 || errorString.includes("throttl") || errorString.includes("too many") || errorString.includes("request rate");
|
|
42377
42403
|
}
|
|
42404
|
+
function applySequentialToolCallPolicy(system, tools, model) {
|
|
42405
|
+
if (tools && Object.keys(tools).length > 0 && prefersSequentialToolCalls(model)) {
|
|
42406
|
+
return `${system ? `${system}
|
|
42407
|
+
|
|
42408
|
+
` : ""}${SEQUENTIAL_TOOL_CALL_INSTRUCTION}`;
|
|
42409
|
+
}
|
|
42410
|
+
return system;
|
|
42411
|
+
}
|
|
42378
42412
|
async function* withIdleTimeout(stream, idleMs, isIdleTimerActive) {
|
|
42379
42413
|
const iterator = stream[Symbol.asyncIterator]();
|
|
42380
42414
|
try {
|
|
@@ -42438,7 +42472,7 @@ function createToolExecutionGate() {
|
|
|
42438
42472
|
function wrapStreamWithErrorHandler(originalStream, messagesContainer, opts, model, silent, rateLimitRetryCount = 0, idleResumeCount = 0) {
|
|
42439
42473
|
let wrappedStream = null;
|
|
42440
42474
|
const handler = {
|
|
42441
|
-
get(
|
|
42475
|
+
get(_target, prop) {
|
|
42442
42476
|
if (prop === "fullStream") {
|
|
42443
42477
|
if (!wrappedStream) {
|
|
42444
42478
|
const toolGate = createToolExecutionGate();
|
|
@@ -42497,7 +42531,7 @@ function wrapStreamWithErrorHandler(originalStream, messagesContainer, opts, mod
|
|
|
42497
42531
|
const fitted = fitMessagesToContext(currentMessages, {
|
|
42498
42532
|
contextWindow: getContextWindow(opts.model),
|
|
42499
42533
|
maxOutputTokens: getMaxOutputTokens(opts.model),
|
|
42500
|
-
system: opts.system,
|
|
42534
|
+
system: applySequentialToolCallPolicy(opts.system, opts.tools, opts.model),
|
|
42501
42535
|
tools: opts.tools,
|
|
42502
42536
|
sessionPath: opts.sessionPath
|
|
42503
42537
|
});
|
|
@@ -42632,13 +42666,14 @@ function streamResponse(opts) {
|
|
|
42632
42666
|
};
|
|
42633
42667
|
const providerModel = getProviderModel(model, authConfig);
|
|
42634
42668
|
const useAnthropicCaching = isAnthropicProvider(model);
|
|
42669
|
+
const systemWithToolPolicy = applySequentialToolCallPolicy(system, tools, model);
|
|
42635
42670
|
let fittedMessages = messages;
|
|
42636
42671
|
let proactiveFitFailed = false;
|
|
42637
42672
|
if (messages && messages.length > 0) {
|
|
42638
42673
|
const fitted = fitMessagesToContext(messages, {
|
|
42639
42674
|
contextWindow: getContextWindow(model),
|
|
42640
42675
|
maxOutputTokens: getMaxOutputTokens(model),
|
|
42641
|
-
system,
|
|
42676
|
+
system: systemWithToolPolicy,
|
|
42642
42677
|
tools,
|
|
42643
42678
|
sessionPath: opts.sessionPath
|
|
42644
42679
|
});
|
|
@@ -42655,13 +42690,13 @@ function streamResponse(opts) {
|
|
|
42655
42690
|
}
|
|
42656
42691
|
return wrapStreamWithErrorHandler(createSummarizationStream(fittedMessages, opts, providerModel), messagesContainer, opts, providerModel, silent);
|
|
42657
42692
|
}
|
|
42658
|
-
let effectiveSystem =
|
|
42693
|
+
let effectiveSystem = systemWithToolPolicy;
|
|
42659
42694
|
let effectiveMessages = fittedMessages;
|
|
42660
|
-
if (useAnthropicCaching &&
|
|
42695
|
+
if (useAnthropicCaching && systemWithToolPolicy) {
|
|
42661
42696
|
const baseMessages = fittedMessages ?? [
|
|
42662
42697
|
{ role: "user", content: prompt }
|
|
42663
42698
|
];
|
|
42664
|
-
effectiveMessages = withCachedSystemPrompt(
|
|
42699
|
+
effectiveMessages = withCachedSystemPrompt(systemWithToolPolicy, baseMessages);
|
|
42665
42700
|
effectiveSystem = undefined;
|
|
42666
42701
|
}
|
|
42667
42702
|
const useThinking = enableThinking && isAnthropicProvider(model) && modelSupportsThinking(model);
|
|
@@ -42752,7 +42787,7 @@ function streamResponse(opts) {
|
|
|
42752
42787
|
}
|
|
42753
42788
|
}
|
|
42754
42789
|
const tool6 = tools2[toolCall.toolName];
|
|
42755
|
-
if (!tool6
|
|
42790
|
+
if (!tool6?.inputSchema) {
|
|
42756
42791
|
if (!silent) {
|
|
42757
42792
|
log.warn(`Cannot repair tool call: ${toolCall.toolName} not found or has no schema`);
|
|
42758
42793
|
}
|
|
@@ -42920,7 +42955,7 @@ async function generateObjectResponse(opts) {
|
|
|
42920
42955
|
}
|
|
42921
42956
|
throw lastError;
|
|
42922
42957
|
}
|
|
42923
|
-
var log, DEFAULT_OPENAI_REASONING_EFFORT = "medium", OPENAI_REASONING_MODEL_IDS, _usageCallback = null, MAX_RATE_LIMIT_RETRIES = 20, MAX_IDLE_RESUME_RETRIES = 3, STREAM_IDLE_TIMEOUT_MS, StreamIdleTimeoutError, MAX_OBJECT_RATE_LIMIT_RETRIES = 8, ContextLengthError, ContextLengthExhaustedError, MAX_RESTART_DEPTH = 3, MAX_TOOL_INPUT_CHARS = 8000, MAX_SCHEMA_CHARS = 6000, MINIMAL_RESTART_PROMPT = "Continue the previous task. Earlier context was discarded due to repeated context-length errors.";
|
|
42958
|
+
var log, DEFAULT_OPENAI_REASONING_EFFORT = "medium", OPENAI_REASONING_MODEL_IDS, _usageCallback = null, SEQUENTIAL_TOOL_CALL_INSTRUCTION, MAX_RATE_LIMIT_RETRIES = 20, MAX_IDLE_RESUME_RETRIES = 3, STREAM_IDLE_TIMEOUT_MS, StreamIdleTimeoutError, MAX_OBJECT_RATE_LIMIT_RETRIES = 8, ContextLengthError, ContextLengthExhaustedError, MAX_RESTART_DEPTH = 3, MAX_TOOL_INPUT_CHARS = 8000, MAX_SCHEMA_CHARS = 6000, MINIMAL_RESTART_PROMPT = "Continue the previous task. Earlier context was discarded due to repeated context-length errors.";
|
|
42924
42959
|
var init_ai = __esm(() => {
|
|
42925
42960
|
init_dist4();
|
|
42926
42961
|
init_structured();
|
|
@@ -42947,6 +42982,7 @@ var init_ai = __esm(() => {
|
|
|
42947
42982
|
"gpt-5.5",
|
|
42948
42983
|
"gpt-5.5-2026-04-23"
|
|
42949
42984
|
]);
|
|
42985
|
+
SEQUENTIAL_TOOL_CALL_INSTRUCTION = "CRITICAL TOOL-CALLING RULE: Emit EXACTLY ONE tool call per response. " + "Never emit more than one tool call in a single turn. After each tool call, " + "wait for its result before making the next one. Emitting multiple tool " + "calls in one turn corrupts their arguments.";
|
|
42950
42986
|
STREAM_IDLE_TIMEOUT_MS = 5 * 60 * 1000;
|
|
42951
42987
|
StreamIdleTimeoutError = class StreamIdleTimeoutError extends Error {
|
|
42952
42988
|
constructor(idleMs) {
|
|
@@ -43089,13 +43125,13 @@ var init_name = __esm(() => {
|
|
|
43089
43125
|
"surge",
|
|
43090
43126
|
"flux"
|
|
43091
43127
|
];
|
|
43092
|
-
sessionNameSchema =
|
|
43093
|
-
name:
|
|
43128
|
+
sessionNameSchema = exports_external.object({
|
|
43129
|
+
name: exports_external.string().describe("A short, descriptive session name (2-4 words, lowercase, hyphenated)")
|
|
43094
43130
|
});
|
|
43095
43131
|
});
|
|
43096
43132
|
|
|
43097
43133
|
// src/core/credentials/manager.ts
|
|
43098
|
-
import { randomBytes } from "crypto";
|
|
43134
|
+
import { randomBytes } from "node:crypto";
|
|
43099
43135
|
function generateCredentialId() {
|
|
43100
43136
|
return `cred_${randomBytes(8).toString("hex")}`;
|
|
43101
43137
|
}
|
|
@@ -43267,7 +43303,7 @@ var init_credentials = __esm(() => {
|
|
|
43267
43303
|
});
|
|
43268
43304
|
|
|
43269
43305
|
// src/core/id/id.ts
|
|
43270
|
-
import { randomBytes as randomBytes2 } from "crypto";
|
|
43306
|
+
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
43271
43307
|
function schema(prefix) {
|
|
43272
43308
|
return zod_default.string().startsWith(prefixes[prefix]);
|
|
43273
43309
|
}
|
|
@@ -43504,9 +43540,9 @@ var init_lock = __esm(() => {
|
|
|
43504
43540
|
});
|
|
43505
43541
|
|
|
43506
43542
|
// src/core/storage/index.ts
|
|
43507
|
-
import fs, { readdir } from "fs/promises";
|
|
43508
|
-
import os from "os";
|
|
43509
|
-
import path from "path";
|
|
43543
|
+
import fs, { readdir } from "node:fs/promises";
|
|
43544
|
+
import os from "node:os";
|
|
43545
|
+
import path from "node:path";
|
|
43510
43546
|
function getBaseDir() {
|
|
43511
43547
|
return process.env.PENSAR_DATA_DIR ?? path.join(os.homedir(), ".pensar");
|
|
43512
43548
|
}
|
|
@@ -43649,17 +43685,17 @@ var init_storage = __esm(() => {
|
|
|
43649
43685
|
var ToolsetStateSchema;
|
|
43650
43686
|
var init_toolset = __esm(() => {
|
|
43651
43687
|
init_zod();
|
|
43652
|
-
ToolsetStateSchema =
|
|
43653
|
-
baseToolsetId:
|
|
43654
|
-
enabledTools:
|
|
43655
|
-
lastModified:
|
|
43688
|
+
ToolsetStateSchema = exports_external.object({
|
|
43689
|
+
baseToolsetId: exports_external.string(),
|
|
43690
|
+
enabledTools: exports_external.record(exports_external.string(), exports_external.boolean()),
|
|
43691
|
+
lastModified: exports_external.number()
|
|
43656
43692
|
});
|
|
43657
43693
|
});
|
|
43658
43694
|
|
|
43659
43695
|
// src/core/session/index.ts
|
|
43660
|
-
import { existsSync, readFileSync } from "fs";
|
|
43661
|
-
import os2 from "os";
|
|
43662
|
-
import path2 from "path";
|
|
43696
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
43697
|
+
import os2 from "node:os";
|
|
43698
|
+
import path2 from "node:path";
|
|
43663
43699
|
function resolveSmtpConfig(explicit) {
|
|
43664
43700
|
if (explicit)
|
|
43665
43701
|
return explicit;
|
|
@@ -43797,7 +43833,7 @@ async function create2(input) {
|
|
|
43797
43833
|
if (normalizedConfig?.headers !== undefined) {
|
|
43798
43834
|
snapshotHeaders = { ...normalizedConfig.headers };
|
|
43799
43835
|
} else {
|
|
43800
|
-
const { config: appConfig } = await import("./index-
|
|
43836
|
+
const { config: appConfig } = await import("./index-jhrbdyka.js");
|
|
43801
43837
|
const cfg = await appConfig.get();
|
|
43802
43838
|
snapshotHeaders = cfg.defaultHeaders ? { ...cfg.defaultHeaders } : { ...DEFAULT_HEADER_RECORD };
|
|
43803
43839
|
}
|
|
@@ -43857,7 +43893,7 @@ async function* list2() {
|
|
|
43857
43893
|
const sessionsDir = getSessionsDir();
|
|
43858
43894
|
let entries;
|
|
43859
43895
|
try {
|
|
43860
|
-
entries = await import("fs/promises").then((fsp) => fsp.readdir(sessionsDir, { withFileTypes: true }));
|
|
43896
|
+
entries = await import("node:fs/promises").then((fsp) => fsp.readdir(sessionsDir, { withFileTypes: true }));
|
|
43861
43897
|
} catch {
|
|
43862
43898
|
return;
|
|
43863
43899
|
}
|
|
@@ -44009,7 +44045,7 @@ var DEFAULT_OUTCOME_GUIDANCE, EXFIL_OUTCOME_GUIDANCE, DEFAULT_HEADER_RECORD, Aut
|
|
|
44009
44045
|
}, RemoveInput, remove2 = async (input) => {
|
|
44010
44046
|
try {
|
|
44011
44047
|
const sessionDir = getSessionRoot(input.sessionId);
|
|
44012
|
-
const fsp = await import("fs/promises");
|
|
44048
|
+
const fsp = await import("node:fs/promises");
|
|
44013
44049
|
await fsp.rm(sessionDir, { recursive: true, force: true });
|
|
44014
44050
|
} catch (e) {
|
|
44015
44051
|
console.error(e);
|
|
@@ -44125,7 +44161,8 @@ var init_session = __esm(() => {
|
|
|
44125
44161
|
agentCwd: zod_default.string().optional(),
|
|
44126
44162
|
prompt: zod_default.string().optional(),
|
|
44127
44163
|
taskDriven: zod_default.boolean().optional(),
|
|
44128
|
-
requirePlan: zod_default.boolean().optional()
|
|
44164
|
+
requirePlan: zod_default.boolean().optional(),
|
|
44165
|
+
promptInjectionLibrarySource: zod_default.string().optional()
|
|
44129
44166
|
});
|
|
44130
44167
|
SessionInfoObject = zod_default.object({
|
|
44131
44168
|
id: schema("session"),
|
|
@@ -44171,9 +44208,9 @@ import {
|
|
|
44171
44208
|
mkdirSync as mkdirSync2,
|
|
44172
44209
|
readFileSync as readFileSync2,
|
|
44173
44210
|
writeFileSync as writeFileSync2
|
|
44174
|
-
} from "fs";
|
|
44175
|
-
import os3 from "os";
|
|
44176
|
-
import path3 from "path";
|
|
44211
|
+
} from "node:fs";
|
|
44212
|
+
import os3 from "node:os";
|
|
44213
|
+
import path3 from "node:path";
|
|
44177
44214
|
function pruneErrorLog() {
|
|
44178
44215
|
if (hasPruned)
|
|
44179
44216
|
return;
|
|
@@ -45237,8 +45274,8 @@ async function summarizeConversation(messages, opts, model) {
|
|
|
45237
45274
|
};
|
|
45238
45275
|
};
|
|
45239
45276
|
let slicedMessages;
|
|
45240
|
-
if (cleanMessages.length === 1 && typeof cleanMessages[0]
|
|
45241
|
-
const content = cleanMessages[0]
|
|
45277
|
+
if (cleanMessages.length === 1 && typeof cleanMessages[0]?.content === "string") {
|
|
45278
|
+
const content = cleanMessages[0]?.content;
|
|
45242
45279
|
const lines = content.split(`
|
|
45243
45280
|
`);
|
|
45244
45281
|
const truncatedContent = lines.slice(-50).join(`
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-d5vz4kyn.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-p4aht9hv.js";
|
|
7
7
|
import {
|
|
8
8
|
createLogger,
|
|
9
9
|
hasToolCall,
|
|
@@ -11,14 +11,14 @@ import {
|
|
|
11
11
|
init_lazyLogger,
|
|
12
12
|
init_structured,
|
|
13
13
|
scopedLogger
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-bxtz3bdv.js";
|
|
15
15
|
|
|
16
16
|
// src/core/agents/specialized/authenticationAgent/agent.ts
|
|
17
17
|
init_dist();
|
|
18
18
|
init_structured();
|
|
19
19
|
init_lazyLogger();
|
|
20
|
-
import { existsSync, readFileSync } from "fs";
|
|
21
|
-
import { join } from "path";
|
|
20
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
21
|
+
import { join } from "node:path";
|
|
22
22
|
|
|
23
23
|
// src/core/agents/specialized/authenticationAgent/prompts.ts
|
|
24
24
|
var AUTH_SUBAGENT_SYSTEM_PROMPT = `You are an authentication specialist for autonomous penetration testing.
|