@pensar/apex 2.1.2 → 2.1.3-canary.00ba2e1a
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-3emvpc9t.js +27 -0
- package/build/agent-46nes8ye.js +19 -0
- package/build/{agent-737mxp3v.js → agent-j2jb0h1y.js} +9 -8
- package/build/{apps-j0bwey0w.js → apps-1se8rhkp.js} +17 -16
- package/build/{auth-5stxpmga.js → auth-4069pjj8.js} +17 -16
- package/build/authentication-dv0s47nj.js +19 -0
- package/build/blackboxAgent-k13z3ctn.js +19 -0
- package/build/{blackboxPentest-2edr9rj3.js → blackboxPentest-rjtrc1s9.js} +15 -14
- package/build/{cli-gbkj2has.js → cli-1svb0r8t.js} +5 -3
- package/build/{cli-jd0c0b91.js → cli-2jmzka72.js} +1 -1
- package/build/{cli-f7d23ded.js → cli-3k1x5rn3.js} +936 -1775
- package/build/{cli-xnnkeg5p.js → cli-5ptphzvg.js} +1 -1
- package/build/{cli-yjbkaqvy.js → cli-6abnvkea.js} +79 -23
- package/build/cli-7bgsh6sd.js +195 -0
- package/build/{cli-tw3fe8bj.js → cli-91gb6pzq.js} +2 -2
- package/build/{cli-whtdyc0e.js → cli-ck490gej.js} +6 -4
- package/build/{cli-6vs0mtsb.js → cli-cyd5hb1t.js} +4 -2
- package/build/{cli-6wwpk9d9.js → cli-dvgf3h1w.js} +1 -1
- package/build/{cli-hj3t87r2.js → cli-f22qgya7.js} +1 -1
- package/build/{cli-0gk2x2sc.js → cli-ha4xts0m.js} +18 -18
- package/build/{cli-dqkdnd3c.js → cli-k855rfjy.js} +88 -49
- package/build/{cli-v1aqbv58.js → cli-nhhyvhb8.js} +29267 -25585
- package/build/{cli-9vzc18m5.js → cli-p16xmetx.js} +53 -204
- package/build/{cli-ks60cc3h.js → cli-qc5a4cq4.js} +30 -30
- package/build/{cli-9z6vwf30.js → cli-xaf3mx2a.js} +1 -1
- package/build/{cli-35czfv00.js → cli-z6s0jf9r.js} +70892 -79387
- package/build/cli.js +120 -90
- package/build/{config-s5ryv5ez.js → config-mayxj2yq.js} +3 -3
- package/build/{doctor-f08gegwc.js → doctor-q9y50qba.js} +7 -7
- package/build/fastStrike-x529knb0.js +156 -0
- package/build/{fixes-qf4s92z2.js → fixes-5rm7c8d4.js} +17 -16
- package/build/{index-gakk2t5q.js → index-3px1kvs7.js} +66 -41
- package/build/{index-exvkbve0.js → index-58va5r84.js} +4 -4
- package/build/{index-x4xefngs.js → index-5hmj6wrp.js} +3 -3
- package/build/{index-s8gw83d6.js → index-5t0wdym2.js} +19 -11
- package/build/{index-5h1hjhzw.js → index-9vzkq82c.js} +10 -10
- package/build/{index-mgng15va.js → index-gq9h8j5j.js} +909 -456
- package/build/{index-sqjve2bm.js → index-wpmrzk4s.js} +2 -2
- package/build/{index-c6qz0gve.js → index-y5zqnk2f.js} +7 -7
- package/build/{issues-5anqrh2j.js → issues-fmnznnqe.js} +17 -16
- package/build/{logs-q6ankt6m.js → logs-jz0cfn5e.js} +17 -16
- package/build/{main-3zneyg7p.js → main-3d7dfdvs.js} +17 -93
- package/build/{offesecAgent-hsej0pfc.js → offesecAgent-ds675gxq.js} +9 -9
- package/build/pentest-p2wn60ar.js +29 -0
- package/build/{pentests-hyx3c3qa.js → pentests-b0bhsbpw.js} +17 -16
- package/build/targetedPentest-1v69px88.js +44 -0
- package/build/{targets-9cqrshet.js → targets-vxk2kh7p.js} +17 -16
- package/build/threatModel-b5faeat1.js +27 -0
- package/build/{uninstall-1j469qj7.js → uninstall-qyqnyg25.js} +1 -1
- package/build/{upload-ymvhkyq5.js → upload-my97hbjg.js} +7 -7
- package/build/{utils-d1ed6jzf.js → utils-mr34kxph.js} +6 -6
- package/package.json +30 -30
- package/build/agent-8w9h3tnw.js +0 -19
- package/build/agent-vdrtakz4.js +0 -25
- package/build/authentication-qswvctj4.js +0 -19
- package/build/blackboxAgent-vwm9t3h4.js +0 -19
- package/build/pentest-1e30q7rs.js +0 -28
- package/build/targetedPentest-ws0a7frk.js +0 -36
- package/build/threatModel-z9b213x8.js +0 -26
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-z6s0jf9r.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-dvgf3h1w.js";
|
|
7
7
|
import {
|
|
8
8
|
createLogger,
|
|
9
9
|
hasToolCall,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
init_lazyLogger,
|
|
12
12
|
init_structured,
|
|
13
13
|
scopedLogger
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-nhhyvhb8.js";
|
|
15
15
|
|
|
16
16
|
// src/core/agents/specialized/authenticationAgent/agent.ts
|
|
17
17
|
init_dist();
|
|
@@ -37,9 +37,9 @@ Obtain valid credentials/sessions that other agents can use for authenticated te
|
|
|
37
37
|
# Available Tools
|
|
38
38
|
|
|
39
39
|
## API Authentication
|
|
40
|
-
- \`
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
- \`execute_command\` — Run curl (or other shell commands) to submit credentials via form POST,
|
|
41
|
+
JSON POST, or HTTP Basic auth, and to capture the Set-Cookie / token response. Use this for all
|
|
42
|
+
custom and complex API auth flows.
|
|
43
43
|
|
|
44
44
|
## Browser Authentication
|
|
45
45
|
- \`browser_navigate\` — Navigate to login page
|
|
@@ -77,11 +77,11 @@ Look for:
|
|
|
77
77
|
## Step 2: Authenticate
|
|
78
78
|
|
|
79
79
|
### API path (use when target is an API or has a simple form):
|
|
80
|
-
1.
|
|
81
|
-
- \`
|
|
82
|
-
- \`
|
|
83
|
-
- \`
|
|
84
|
-
2.
|
|
80
|
+
1. Use \`execute_command\` with curl to submit the credentials, matching the target's scheme:
|
|
81
|
+
- \`curl -i -d 'username=...&password=...' <loginUrl>\` for HTML form POST
|
|
82
|
+
- \`curl -i -H 'Content-Type: application/json' -d '{"username":"...","password":"..."}' <loginUrl>\` for JSON APIs
|
|
83
|
+
- \`curl -i -u '<user>:<pass>' <url>\` for HTTP Basic
|
|
84
|
+
2. Inspect the response (\`-i\` shows headers) — capture any \`Set-Cookie\` value or token to use as the session credential.
|
|
85
85
|
|
|
86
86
|
### Browser path (use for SPAs, OAuth, JS-rendered forms):
|
|
87
87
|
1. \`browser_navigate\` to the login URL
|
|
@@ -113,7 +113,7 @@ If both API and browser approaches fail, use \`delegate_to_auth_subagent\` for c
|
|
|
113
113
|
**First**, call \`complete_authentication\` with:
|
|
114
114
|
- \`success\`: whether auth succeeded
|
|
115
115
|
- \`summary\`: what happened and what credentials/cookies were obtained
|
|
116
|
-
- \`exportedCookies\`: the cookie string for downstream HTTP requests (from browser_get_cookies cookieHeader or
|
|
116
|
+
- \`exportedCookies\`: the cookie string for downstream HTTP requests (from browser_get_cookies cookieHeader or the Set-Cookie header in the curl response)
|
|
117
117
|
- \`exportedHeaders\`: auth headers map, e.g. {"Authorization": "Bearer <token>"} (from browser_evaluate localStorage tokens or API response)
|
|
118
118
|
- \`strategy\`: method used ("browser", "form_post", "json_post", "basic_auth", "bearer")
|
|
119
119
|
- \`authBarrier\`: if a barrier was encountered (captcha, mfa, etc.)
|
|
@@ -179,6 +179,7 @@ class AuthenticationAgent extends OffensiveSecurityAgent {
|
|
|
179
179
|
context,
|
|
180
180
|
environmentVariables,
|
|
181
181
|
enableThinking,
|
|
182
|
+
thinkingEffort,
|
|
182
183
|
openAIReasoningEffort
|
|
183
184
|
} = opts;
|
|
184
185
|
const cm = session.credentialManager;
|
|
@@ -195,11 +196,11 @@ class AuthenticationAgent extends OffensiveSecurityAgent {
|
|
|
195
196
|
subagentId,
|
|
196
197
|
environmentVariables,
|
|
197
198
|
enableThinking,
|
|
199
|
+
thinkingEffort,
|
|
198
200
|
openAIReasoningEffort,
|
|
199
201
|
toolChoice: "auto",
|
|
200
202
|
activeTools: [
|
|
201
203
|
"execute_command",
|
|
202
|
-
"authenticate_session",
|
|
203
204
|
"complete_authentication",
|
|
204
205
|
"browser_navigate",
|
|
205
206
|
"browser_snapshot",
|
|
@@ -294,17 +295,16 @@ function buildAuthPrompt(target, authHints, credentialManager, context) {
|
|
|
294
295
|
if (credBlock) {
|
|
295
296
|
parts.push(`INSTRUCTIONS:
|
|
296
297
|
You have credentials available via credential IDs — authenticate immediately.
|
|
297
|
-
1.
|
|
298
|
-
2.
|
|
298
|
+
1. For API/form logins, use execute_command (curl) to submit credentials and capture the Set-Cookie / token response
|
|
299
|
+
2. For browser-based logins, use the browser tools. For browser_fill on password/secret fields,
|
|
299
300
|
pass credentialId + credentialField (e.g. credentialField="password") instead of the raw value —
|
|
300
301
|
the secret is resolved securely at execution time. NEVER type a password directly.
|
|
301
302
|
3. Call complete_authentication with exported cookies/headers to persist credentials and end the run`);
|
|
302
303
|
} else {
|
|
303
304
|
parts.push(`INSTRUCTIONS:
|
|
304
305
|
1. Probe the target with execute_command (curl) to determine the auth mechanism
|
|
305
|
-
2. Attempt authentication with
|
|
306
|
-
3.
|
|
307
|
-
4. Call complete_authentication with exported cookies/headers to persist credentials and end the run`);
|
|
306
|
+
2. Attempt authentication with execute_command (curl) or the browser tools
|
|
307
|
+
3. Call complete_authentication with exported cookies/headers to persist credentials and end the run`);
|
|
308
308
|
}
|
|
309
309
|
return parts.join(`
|
|
310
310
|
`);
|
|
@@ -4,27 +4,27 @@ import {
|
|
|
4
4
|
OffensiveSecurityAgent,
|
|
5
5
|
SKILL_TOOL_NAMES,
|
|
6
6
|
buildBaseSystemPrompt
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-z6s0jf9r.js";
|
|
8
8
|
import {
|
|
9
9
|
init_dist,
|
|
10
10
|
init_session,
|
|
11
11
|
sessions,
|
|
12
12
|
stepCountIs
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-nhhyvhb8.js";
|
|
14
14
|
import {
|
|
15
15
|
ensureValidToken,
|
|
16
16
|
getPensarApiUrl,
|
|
17
17
|
init_auth,
|
|
18
18
|
init_constants
|
|
19
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-f22qgya7.js";
|
|
20
20
|
import {
|
|
21
21
|
exports_external,
|
|
22
22
|
init_zod
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-3k1x5rn3.js";
|
|
24
24
|
import {
|
|
25
25
|
config,
|
|
26
26
|
init_config
|
|
27
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-xaf3mx2a.js";
|
|
28
28
|
import {
|
|
29
29
|
__commonJS,
|
|
30
30
|
__require
|
|
@@ -583,6 +583,8 @@ var require_Alias = __commonJS((exports) => {
|
|
|
583
583
|
});
|
|
584
584
|
}
|
|
585
585
|
resolve(doc, ctx) {
|
|
586
|
+
if (ctx?.maxAliasCount === 0)
|
|
587
|
+
throw new ReferenceError("Alias resolution is disabled");
|
|
586
588
|
let nodes;
|
|
587
589
|
if (ctx?.aliasResolveCache) {
|
|
588
590
|
nodes = ctx.aliasResolveCache;
|
|
@@ -1362,6 +1364,7 @@ var require_stringify = __commonJS((exports) => {
|
|
|
1362
1364
|
nullStr: "null",
|
|
1363
1365
|
simpleKeys: false,
|
|
1364
1366
|
singleQuote: null,
|
|
1367
|
+
trailingComma: false,
|
|
1365
1368
|
trueStr: "true",
|
|
1366
1369
|
verifyAliasOrder: true
|
|
1367
1370
|
}, doc.schema.toStringOptions, options);
|
|
@@ -1631,18 +1634,18 @@ var require_merge = __commonJS((exports) => {
|
|
|
1631
1634
|
};
|
|
1632
1635
|
var isMergeKey = (ctx, key) => (merge.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge.tag && tag.default);
|
|
1633
1636
|
function addMergeToJSMap(ctx, map, value) {
|
|
1634
|
-
|
|
1635
|
-
if (identity.isSeq(
|
|
1636
|
-
for (const it of
|
|
1637
|
+
const source = resolveAliasValue(ctx, value);
|
|
1638
|
+
if (identity.isSeq(source))
|
|
1639
|
+
for (const it of source.items)
|
|
1637
1640
|
mergeValue(ctx, map, it);
|
|
1638
|
-
else if (Array.isArray(
|
|
1639
|
-
for (const it of
|
|
1641
|
+
else if (Array.isArray(source))
|
|
1642
|
+
for (const it of source)
|
|
1640
1643
|
mergeValue(ctx, map, it);
|
|
1641
1644
|
else
|
|
1642
|
-
mergeValue(ctx, map,
|
|
1645
|
+
mergeValue(ctx, map, source);
|
|
1643
1646
|
}
|
|
1644
1647
|
function mergeValue(ctx, map, value) {
|
|
1645
|
-
const source = ctx
|
|
1648
|
+
const source = resolveAliasValue(ctx, value);
|
|
1646
1649
|
if (!identity.isMap(source))
|
|
1647
1650
|
throw new Error("Merge sources must be maps or map aliases");
|
|
1648
1651
|
const srcMap = source.toJSON(null, ctx, Map);
|
|
@@ -1663,6 +1666,9 @@ var require_merge = __commonJS((exports) => {
|
|
|
1663
1666
|
}
|
|
1664
1667
|
return map;
|
|
1665
1668
|
}
|
|
1669
|
+
function resolveAliasValue(ctx, value) {
|
|
1670
|
+
return ctx && identity.isAlias(value) ? value.resolve(ctx.doc, ctx) : value;
|
|
1671
|
+
}
|
|
1666
1672
|
exports.addMergeToJSMap = addMergeToJSMap;
|
|
1667
1673
|
exports.isMergeKey = isMergeKey;
|
|
1668
1674
|
exports.merge = merge;
|
|
@@ -1870,13 +1876,20 @@ ${indent}${line}` : `
|
|
|
1870
1876
|
if (comment)
|
|
1871
1877
|
reqNewline = true;
|
|
1872
1878
|
let str = stringify.stringify(item, itemCtx, () => comment = null);
|
|
1873
|
-
|
|
1879
|
+
reqNewline || (reqNewline = lines.length > linesAtValue || str.includes(`
|
|
1880
|
+
`));
|
|
1881
|
+
if (i < items.length - 1) {
|
|
1874
1882
|
str += ",";
|
|
1883
|
+
} else if (ctx.options.trailingComma) {
|
|
1884
|
+
if (ctx.options.lineWidth > 0) {
|
|
1885
|
+
reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str.length + 2) > ctx.options.lineWidth);
|
|
1886
|
+
}
|
|
1887
|
+
if (reqNewline) {
|
|
1888
|
+
str += ",";
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1875
1891
|
if (comment)
|
|
1876
1892
|
str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
|
|
1877
|
-
if (!reqNewline && (lines.length > linesAtValue || str.includes(`
|
|
1878
|
-
`)))
|
|
1879
|
-
reqNewline = true;
|
|
1880
1893
|
lines.push(str);
|
|
1881
1894
|
linesAtValue = lines.length;
|
|
1882
1895
|
}
|
|
@@ -2231,7 +2244,7 @@ var require_stringifyNumber = __commonJS((exports) => {
|
|
|
2231
2244
|
if (!isFinite(num))
|
|
2232
2245
|
return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
|
|
2233
2246
|
let n = Object.is(value, -0) ? "-0" : JSON.stringify(value);
|
|
2234
|
-
if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") &&
|
|
2247
|
+
if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^-?\d/.test(n) && !n.includes("e")) {
|
|
2235
2248
|
let i = n.indexOf(".");
|
|
2236
2249
|
if (i < 0) {
|
|
2237
2250
|
i = n.length;
|
|
@@ -4456,7 +4469,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4456
4469
|
while (next === " " || next === "\t")
|
|
4457
4470
|
next = source[++i + 1];
|
|
4458
4471
|
} else if (next === "x" || next === "u" || next === "U") {
|
|
4459
|
-
const length =
|
|
4472
|
+
const length = next === "x" ? 2 : next === "u" ? 4 : 8;
|
|
4460
4473
|
res += parseCharCode(source, i + 1, length, onError);
|
|
4461
4474
|
i += length;
|
|
4462
4475
|
} else {
|
|
@@ -4525,12 +4538,13 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4525
4538
|
const cc = source.substr(offset, length);
|
|
4526
4539
|
const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
|
|
4527
4540
|
const code = ok ? parseInt(cc, 16) : NaN;
|
|
4528
|
-
|
|
4541
|
+
try {
|
|
4542
|
+
return String.fromCodePoint(code);
|
|
4543
|
+
} catch {
|
|
4529
4544
|
const raw = source.substr(offset - 2, length + 2);
|
|
4530
4545
|
onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`);
|
|
4531
4546
|
return raw;
|
|
4532
4547
|
}
|
|
4533
|
-
return String.fromCodePoint(code);
|
|
4534
4548
|
}
|
|
4535
4549
|
exports.resolveFlowScalar = resolveFlowScalar;
|
|
4536
4550
|
});
|
|
@@ -4671,17 +4685,22 @@ var require_compose_node = __commonJS((exports) => {
|
|
|
4671
4685
|
case "block-map":
|
|
4672
4686
|
case "block-seq":
|
|
4673
4687
|
case "flow-collection":
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4688
|
+
try {
|
|
4689
|
+
node = composeCollection.composeCollection(CN, ctx, token, props, onError);
|
|
4690
|
+
if (anchor)
|
|
4691
|
+
node.anchor = anchor.source.substring(1);
|
|
4692
|
+
} catch (error) {
|
|
4693
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
4694
|
+
onError(token, "RESOURCE_EXHAUSTION", message);
|
|
4695
|
+
}
|
|
4677
4696
|
break;
|
|
4678
4697
|
default: {
|
|
4679
4698
|
const message = token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`;
|
|
4680
4699
|
onError(token, "UNEXPECTED_TOKEN", message);
|
|
4681
|
-
node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError);
|
|
4682
4700
|
isSrcToken = false;
|
|
4683
4701
|
}
|
|
4684
4702
|
}
|
|
4703
|
+
node ?? (node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError));
|
|
4685
4704
|
if (anchor && node.anchor === "")
|
|
4686
4705
|
onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
|
|
4687
4706
|
if (atKey && ctx.options.stringKeys && (!identity.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) {
|
|
@@ -4864,8 +4883,10 @@ ${cb}` : comment;
|
|
|
4864
4883
|
}
|
|
4865
4884
|
}
|
|
4866
4885
|
if (afterDoc) {
|
|
4867
|
-
|
|
4868
|
-
|
|
4886
|
+
for (let i = 0;i < this.errors.length; ++i)
|
|
4887
|
+
doc.errors.push(this.errors[i]);
|
|
4888
|
+
for (let i = 0;i < this.warnings.length; ++i)
|
|
4889
|
+
doc.warnings.push(this.warnings[i]);
|
|
4869
4890
|
} else {
|
|
4870
4891
|
doc.errors = this.errors;
|
|
4871
4892
|
doc.warnings = this.warnings;
|
|
@@ -5577,7 +5598,7 @@ var require_lexer = __commonJS((exports) => {
|
|
|
5577
5598
|
const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
|
|
5578
5599
|
this.indentNext = this.indentValue + 1;
|
|
5579
5600
|
this.indentValue += n;
|
|
5580
|
-
return
|
|
5601
|
+
return "block-start";
|
|
5581
5602
|
}
|
|
5582
5603
|
return "doc";
|
|
5583
5604
|
}
|
|
@@ -5884,26 +5905,37 @@ var require_lexer = __commonJS((exports) => {
|
|
|
5884
5905
|
return 0;
|
|
5885
5906
|
}
|
|
5886
5907
|
*pushIndicators() {
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5908
|
+
let n = 0;
|
|
5909
|
+
loop:
|
|
5910
|
+
while (true) {
|
|
5911
|
+
switch (this.charAt(0)) {
|
|
5912
|
+
case "!":
|
|
5913
|
+
n += yield* this.pushTag();
|
|
5914
|
+
n += yield* this.pushSpaces(true);
|
|
5915
|
+
continue loop;
|
|
5916
|
+
case "&":
|
|
5917
|
+
n += yield* this.pushUntil(isNotAnchorChar);
|
|
5918
|
+
n += yield* this.pushSpaces(true);
|
|
5919
|
+
continue loop;
|
|
5920
|
+
case "-":
|
|
5921
|
+
case "?":
|
|
5922
|
+
case ":": {
|
|
5923
|
+
const inFlow = this.flowLevel > 0;
|
|
5924
|
+
const ch1 = this.charAt(1);
|
|
5925
|
+
if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
|
|
5926
|
+
if (!inFlow)
|
|
5927
|
+
this.indentNext = this.indentValue + 1;
|
|
5928
|
+
else if (this.flowKey)
|
|
5929
|
+
this.flowKey = false;
|
|
5930
|
+
n += yield* this.pushCount(1);
|
|
5931
|
+
n += yield* this.pushSpaces(true);
|
|
5932
|
+
continue loop;
|
|
5933
|
+
}
|
|
5934
|
+
}
|
|
5903
5935
|
}
|
|
5936
|
+
break loop;
|
|
5904
5937
|
}
|
|
5905
|
-
|
|
5906
|
-
return 0;
|
|
5938
|
+
return n;
|
|
5907
5939
|
}
|
|
5908
5940
|
*pushTag() {
|
|
5909
5941
|
if (this.charAt(1) === "<") {
|
|
@@ -6057,6 +6089,13 @@ var require_parser = __commonJS((exports) => {
|
|
|
6057
6089
|
while (prev[++i]?.type === "space") {}
|
|
6058
6090
|
return prev.splice(i, prev.length);
|
|
6059
6091
|
}
|
|
6092
|
+
function arrayPushArray(target, source) {
|
|
6093
|
+
if (source.length < 1e5)
|
|
6094
|
+
Array.prototype.push.apply(target, source);
|
|
6095
|
+
else
|
|
6096
|
+
for (let i = 0;i < source.length; ++i)
|
|
6097
|
+
target.push(source[i]);
|
|
6098
|
+
}
|
|
6060
6099
|
function fixFlowSeqItems(fc) {
|
|
6061
6100
|
if (fc.start.type === "flow-seq-start") {
|
|
6062
6101
|
for (const it of fc.items) {
|
|
@@ -6066,11 +6105,11 @@ var require_parser = __commonJS((exports) => {
|
|
|
6066
6105
|
delete it.key;
|
|
6067
6106
|
if (isFlowToken(it.value)) {
|
|
6068
6107
|
if (it.value.end)
|
|
6069
|
-
|
|
6108
|
+
arrayPushArray(it.value.end, it.sep);
|
|
6070
6109
|
else
|
|
6071
6110
|
it.value.end = it.sep;
|
|
6072
6111
|
} else
|
|
6073
|
-
|
|
6112
|
+
arrayPushArray(it.start, it.sep);
|
|
6074
6113
|
delete it.sep;
|
|
6075
6114
|
}
|
|
6076
6115
|
}
|
|
@@ -6410,7 +6449,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6410
6449
|
const prev = map.items[map.items.length - 2];
|
|
6411
6450
|
const end = prev?.value?.end;
|
|
6412
6451
|
if (Array.isArray(end)) {
|
|
6413
|
-
|
|
6452
|
+
arrayPushArray(end, it.start);
|
|
6414
6453
|
end.push(this.sourceToken);
|
|
6415
6454
|
map.items.pop();
|
|
6416
6455
|
return;
|
|
@@ -6598,7 +6637,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6598
6637
|
const prev = seq.items[seq.items.length - 2];
|
|
6599
6638
|
const end = prev?.value?.end;
|
|
6600
6639
|
if (Array.isArray(end)) {
|
|
6601
|
-
|
|
6640
|
+
arrayPushArray(end, it.start);
|
|
6602
6641
|
end.push(this.sourceToken);
|
|
6603
6642
|
seq.items.pop();
|
|
6604
6643
|
return;
|