@wrongstack/tools 1.0.8 → 1.0.10
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/dist/_win32-resolve.d.ts +5 -0
- package/dist/audit.js +5 -5
- package/dist/bash-kill-guard.d.ts +6 -4
- package/dist/bash.js +2 -2
- package/dist/browser/index.js +1 -1
- package/dist/builtin.js +41 -41
- package/dist/{chunk-N3OTTQNC.js → chunk-2OCAAFAT.js} +44 -25
- package/dist/{chunk-5MP76C72.js → chunk-2UVAIS5O.js} +24 -29
- package/dist/{chunk-SIIOHBNY.js → chunk-3RRK33YM.js} +2 -2
- package/dist/{chunk-M2W36JT7.js → chunk-4CE3RKEP.js} +6 -3
- package/dist/{chunk-QJARSK2G.js → chunk-4SUGLJLO.js} +11 -3
- package/dist/{chunk-AH7J5HWL.js → chunk-5RBUYFRV.js} +15 -7
- package/dist/{chunk-GNLHBDFO.js → chunk-6I6RXQFG.js} +127 -196
- package/dist/{chunk-WKLUOXR4.js → chunk-7GOE2ZTZ.js} +2 -2
- package/dist/{chunk-O6AGFJBO.js → chunk-7V33PHT6.js} +49 -77
- package/dist/{chunk-CAF4L6KN.js → chunk-C3WP6ZOT.js} +36 -48
- package/dist/{chunk-KMXPP32M.js → chunk-C6ZOXNXV.js} +13 -3
- package/dist/{chunk-EGT5QLCB.js → chunk-D6RQZMZS.js} +123 -255
- package/dist/{chunk-S6CGSFLX.js → chunk-DBG7UQGK.js} +10 -3
- package/dist/{chunk-FI6SOIVE.js → chunk-DLZCOEVG.js} +21 -3
- package/dist/{chunk-NL45OWEO.js → chunk-DOAHONOS.js} +7 -12
- package/dist/{chunk-3LQJXJDM.js → chunk-E7A4SLKR.js} +2 -2
- package/dist/{chunk-JB5JLY7V.js → chunk-ENE22I5W.js} +387 -394
- package/dist/{chunk-5KRKL3WD.js → chunk-FCSUBTUJ.js} +112 -119
- package/dist/{chunk-YUK3WLHJ.js → chunk-FVSMTEO3.js} +2 -2
- package/dist/{chunk-SEONDNLN.js → chunk-G7CYW5EP.js} +2 -2
- package/dist/{chunk-TU6UVATU.js → chunk-HYHE4VNA.js} +3 -3
- package/dist/{chunk-HIRVCXLP.js → chunk-IE4KDAOB.js} +3 -3
- package/dist/{chunk-YA2ZYCJY.js → chunk-JPK2HHBK.js} +1 -1
- package/dist/{chunk-7E55DAFW.js → chunk-KHUCKLOR.js} +12 -7
- package/dist/{chunk-R3HIZVFS.js → chunk-KPDCKSN5.js} +23 -3
- package/dist/{chunk-B3MGJBFI.js → chunk-KS2OEZWV.js} +23 -47
- package/dist/{chunk-UI3ZJIG3.js → chunk-LKLIQUCW.js} +14 -8
- package/dist/{chunk-62OAECEQ.js → chunk-LLSFOUZF.js} +8 -8
- package/dist/{chunk-YZQSUL5G.js → chunk-M4ZHHCCW.js} +14 -6
- package/dist/{chunk-IXIS7RSG.js → chunk-MRXWOOOR.js} +29 -47
- package/dist/{chunk-C4DSQBTT.js → chunk-NEYUPZL6.js} +3 -3
- package/dist/{chunk-6XYFYLN7.js → chunk-O2MHULBO.js} +13 -8
- package/dist/{chunk-B62LKMWQ.js → chunk-OKZJJDOG.js} +86 -188
- package/dist/{chunk-HOFVYIPI.js → chunk-ON6ET5ER.js} +16 -1
- package/dist/{chunk-KF7GMVNU.js → chunk-OUERRFEM.js} +32 -11
- package/dist/{chunk-GF4JHLCO.js → chunk-PWZUHZP7.js} +2 -2
- package/dist/{chunk-OGQMPX3J.js → chunk-QAWI3RSK.js} +37 -81
- package/dist/{chunk-ZMCV3XOV.js → chunk-SPNXDTCJ.js} +29 -63
- package/dist/{chunk-H2VB7GCR.js → chunk-ULI2J6TX.js} +27 -14
- package/dist/{chunk-EMA2XENR.js → chunk-UVYRQKPZ.js} +4 -3
- package/dist/{chunk-MF6ZUBI7.js → chunk-V25Q6TQ7.js} +3 -3
- package/dist/{chunk-2NTHMZV3.js → chunk-VMJY6FYJ.js} +693 -276
- package/dist/{chunk-ZOUG3KKS.js → chunk-XPVYZ2S6.js} +2 -2
- package/dist/{chunk-5U5ULQX2.js → chunk-XZLVJD56.js} +5 -1
- package/dist/{chunk-HCPSVK7J.js → chunk-YKSOSI2N.js} +47 -31
- package/dist/codebase-index/codebase-ast-replace-tool.d.ts +5 -6
- package/dist/codebase-index/codebase-context-tool.d.ts +4 -6
- package/dist/codebase-index/codebase-impact-analysis-tool.d.ts +1 -2
- package/dist/codebase-index/codebase-incoming-calls-tool.d.ts +0 -2
- package/dist/codebase-index/codebase-index-tool.d.ts +0 -2
- package/dist/codebase-index/codebase-invariant-check-tool.d.ts +1 -2
- package/dist/codebase-index/codebase-outgoing-calls-tool.d.ts +0 -2
- package/dist/codebase-index/codebase-repo-map-tool.d.ts +1 -2
- package/dist/codebase-index/codebase-search-tool.d.ts +1 -1
- package/dist/codebase-index/codebase-targeted-test-tool.d.ts +1 -2
- package/dist/codebase-index/index.js +8 -8
- package/dist/codebase-index/parser-worker-script.js +3 -3
- package/dist/codebase-index/project-server.js +5 -5
- package/dist/codebase-index/worker.js +4 -4
- package/dist/design.js +1 -1
- package/dist/diff.js +1 -1
- package/dist/edit.js +7 -7
- package/dist/exec.d.ts +7 -7
- package/dist/exec.js +2 -2
- package/dist/format.js +5 -5
- package/dist/git.js +1 -1
- package/dist/glob.js +1 -1
- package/dist/{go-parser-VDPRQEGM.js → go-parser-Z4H6SR3R.js} +6 -3
- package/dist/grep.js +1 -1
- package/dist/index.js +45 -45
- package/dist/install.js +5 -5
- package/dist/json.d.ts +0 -1
- package/dist/json.js +1 -1
- package/dist/kanban-presence.d.ts +6 -0
- package/dist/kanban-serializer.d.ts +9 -1
- package/dist/kanban-split-task-handler.d.ts +1 -1
- package/dist/kanban-tool-results.d.ts +57 -2
- package/dist/kanban-tool-types.d.ts +16 -5
- package/dist/kanban.d.ts +14 -0
- package/dist/kanban.js +9 -1
- package/dist/languages/index.js +3 -3
- package/dist/{legacy-bridge-4T4OTSQP.js → legacy-bridge-BPT2S2F4.js} +5 -5
- package/dist/lint.js +5 -5
- package/dist/logs.js +1 -1
- package/dist/mode.d.ts +3 -2
- package/dist/mode.js +1 -1
- package/dist/outdated.js +2 -2
- package/dist/pack.js +42 -42
- package/dist/{parser-dispatch-4E2SDQUO.js → parser-dispatch-WG4DNBHH.js} +4 -4
- package/dist/patch.js +7 -7
- package/dist/plan.d.ts +2 -1
- package/dist/plan.js +3 -3
- package/dist/{py-parser-MAW6DHFE.js → py-parser-4PFZYAJ7.js} +3 -3
- package/dist/read.js +7 -7
- package/dist/replace.js +7 -7
- package/dist/search.d.ts +0 -6
- package/dist/search.js +1 -1
- package/dist/security-ast-scan-tool.d.ts +1 -2
- package/dist/session-shell.js +2 -2
- package/dist/task.d.ts +2 -1
- package/dist/task.js +3 -3
- package/dist/test.d.ts +8 -1
- package/dist/test.js +5 -5
- package/dist/todo.js +2 -2
- package/dist/tool-search.d.ts +2 -0
- package/dist/tool-search.js +1 -1
- package/dist/tool-tier.js +43 -43
- package/dist/tool-use.d.ts +2 -2
- package/dist/tool-use.js +1 -1
- package/dist/tree.js +1 -1
- package/dist/typecheck.js +5 -5
- package/dist/wasm/bash/tree-sitter-bash.wasm +0 -0
- package/dist/wasm/c/tree-sitter-c.wasm +0 -0
- package/dist/wasm/c_sharp/tree-sitter-c_sharp.wasm +0 -0
- package/dist/wasm/checksums.json +16 -0
- package/dist/wasm/cpp/tree-sitter-cpp.wasm +0 -0
- package/dist/wasm/elixir/tree-sitter-elixir.wasm +0 -0
- package/dist/wasm/go/tree-sitter-go.wasm +0 -0
- package/dist/wasm/java/tree-sitter-java.wasm +0 -0
- package/dist/wasm/kotlin/tree-sitter-kotlin.wasm +0 -0
- package/dist/wasm/php/tree-sitter-php.wasm +0 -0
- package/dist/wasm/python/tree-sitter-python.wasm +0 -0
- package/dist/wasm/ruby/tree-sitter-ruby.wasm +0 -0
- package/dist/wasm/rust/tree-sitter-rust.wasm +0 -0
- package/dist/wasm/swift/tree-sitter-swift.wasm +0 -0
- package/dist/wasm/tree-sitter-runtime.wasm +0 -0
- package/dist/win32.d.ts +1 -1
- package/dist/win32.js +3 -1
- package/dist/write.js +7 -7
- package/package.json +10 -10
|
@@ -150,14 +150,15 @@ var searchTool = {
|
|
|
150
150
|
engineError = fallback.error;
|
|
151
151
|
effectiveSource = "duckduckgo";
|
|
152
152
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
cache.set(cacheKey, { results: ranked, source: effectiveSource, timestamp: Date.now() });
|
|
156
|
-
pruneCacheEntries();
|
|
153
|
+
if (engineError) {
|
|
154
|
+
throw new Error(`search: ${engineError}`);
|
|
157
155
|
}
|
|
156
|
+
const finalResults = ranked.slice(0, num);
|
|
157
|
+
cache.set(cacheKey, { results: ranked, source: effectiveSource, timestamp: Date.now() });
|
|
158
|
+
pruneCacheEntries();
|
|
158
159
|
yield {
|
|
159
160
|
type: "partial_output",
|
|
160
|
-
text:
|
|
161
|
+
text: `${finalResults.length} results from ${effectiveSource}`,
|
|
161
162
|
data: { count: finalResults.length, cached: false, source: effectiveSource }
|
|
162
163
|
};
|
|
163
164
|
yield {
|
|
@@ -171,8 +172,7 @@ var searchTool = {
|
|
|
171
172
|
})),
|
|
172
173
|
source: effectiveSource,
|
|
173
174
|
truncated: ranked.length > num,
|
|
174
|
-
cached: false
|
|
175
|
-
...engineError ? { error: engineError } : {}
|
|
175
|
+
cached: false
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
178
|
}
|
|
@@ -469,4 +469,4 @@ export {
|
|
|
469
469
|
__setSearchCacheForTest,
|
|
470
470
|
__getSearchCacheSizeForTest
|
|
471
471
|
};
|
|
472
|
-
//# sourceMappingURL=chunk-
|
|
472
|
+
//# sourceMappingURL=chunk-LLSFOUZF.js.map
|
|
@@ -5,7 +5,12 @@ import {
|
|
|
5
5
|
// src/tree.ts
|
|
6
6
|
import * as fs from "node:fs/promises";
|
|
7
7
|
import * as path from "node:path";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
compileGlob,
|
|
10
|
+
DEFAULT_WALK_IGNORE_DIRS,
|
|
11
|
+
expectDefined,
|
|
12
|
+
toErrorMessage
|
|
13
|
+
} from "@wrongstack/core/utils";
|
|
9
14
|
var DEFAULT_IGNORE = /* @__PURE__ */ new Set([
|
|
10
15
|
...DEFAULT_WALK_IGNORE_DIRS,
|
|
11
16
|
".wrongstack",
|
|
@@ -88,9 +93,7 @@ var treeTool = {
|
|
|
88
93
|
const rawExclude = Array.isArray(input.exclude) ? input.exclude : typeof input.exclude === "string" ? [input.exclude] : [];
|
|
89
94
|
const exclude = /* @__PURE__ */ new Set([
|
|
90
95
|
...DEFAULT_IGNORE,
|
|
91
|
-
...rawExclude.filter((s) => typeof s === "string").map(
|
|
92
|
-
(s) => s.trim().replace(/\\/g, "/").replace(/\/+$/, "").replace(/^\.\//, "")
|
|
93
|
-
).filter(Boolean)
|
|
96
|
+
...rawExclude.filter((s) => typeof s === "string").map((s) => s.trim().replace(/\\/g, "/").replace(/\/+$/, "").replace(/^\.\//, "")).filter(Boolean)
|
|
94
97
|
]);
|
|
95
98
|
const globRe = input.glob ? compileGlob(input.glob) : void 0;
|
|
96
99
|
const maxEntries = typeof input.max_entries === "number" && Number.isFinite(input.max_entries) && input.max_entries > 0 ? Math.floor(input.max_entries) : DEFAULT_MAX_ENTRIES;
|
|
@@ -184,7 +187,12 @@ function matchesTreeGlob(globRe, fileName, absPath, basePath) {
|
|
|
184
187
|
async function walkDir(dir, depth, opts) {
|
|
185
188
|
opts.signal.throwIfAborted();
|
|
186
189
|
if (opts.retention.truncated) return;
|
|
187
|
-
const entries = await fs.readdir(dir, { withFileTypes: true }).catch(() =>
|
|
190
|
+
const entries = await fs.readdir(dir, { withFileTypes: true }).catch((err) => {
|
|
191
|
+
if (depth === 0) {
|
|
192
|
+
throw new Error(`tree: cannot list "${dir}": ${toErrorMessage(err)}`, { cause: err });
|
|
193
|
+
}
|
|
194
|
+
return [];
|
|
195
|
+
});
|
|
188
196
|
const filtered = entries.filter((e) => {
|
|
189
197
|
if (!opts.showHidden && e.name.startsWith(".")) return false;
|
|
190
198
|
if (opts.exclude.has(e.name)) return false;
|
|
@@ -248,4 +256,4 @@ export {
|
|
|
248
256
|
MAX_TREE_OUTPUT_BYTES,
|
|
249
257
|
treeTool
|
|
250
258
|
};
|
|
251
|
-
//# sourceMappingURL=chunk-
|
|
259
|
+
//# sourceMappingURL=chunk-M4ZHHCCW.js.map
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
} from "@wrongstack/core/design";
|
|
17
17
|
import { ToolValidationError } from "@wrongstack/core/types";
|
|
18
18
|
import { atomicWrite } from "@wrongstack/core/utils";
|
|
19
|
+
var NO_ACTIVE_KIT = 'design: no active kit. Pick one first: `design {action:"use", kit:"<id>"}`.';
|
|
19
20
|
async function resolveReal(p) {
|
|
20
21
|
const resolved = path.resolve(p);
|
|
21
22
|
let probe = resolved;
|
|
@@ -139,16 +140,22 @@ var designTool = {
|
|
|
139
140
|
const kitId = input.kit?.trim();
|
|
140
141
|
if (!kitId) {
|
|
141
142
|
const menu2 = await loader.menuText();
|
|
142
|
-
|
|
143
|
+
throw new ToolValidationError({
|
|
144
|
+
message: `design: "use" requires a kit id.
|
|
143
145
|
|
|
144
|
-
${menu2}
|
|
146
|
+
${menu2}`,
|
|
147
|
+
field: "kit"
|
|
148
|
+
});
|
|
145
149
|
}
|
|
146
150
|
const manifest = await loader.find(kitId);
|
|
147
151
|
if (!manifest) {
|
|
148
152
|
const menu2 = await loader.menuText();
|
|
149
|
-
|
|
153
|
+
throw new ToolValidationError({
|
|
154
|
+
message: `design: kit "${kitId}" not found.
|
|
150
155
|
|
|
151
|
-
${menu2}
|
|
156
|
+
${menu2}`,
|
|
157
|
+
field: "kit"
|
|
158
|
+
});
|
|
152
159
|
}
|
|
153
160
|
const resolvedStack = stack ?? manifest.stacks[0] ?? "web";
|
|
154
161
|
const body = await loader.readBody(manifest.id, resolvedStack);
|
|
@@ -192,15 +199,13 @@ ${body}`
|
|
|
192
199
|
if (action === "set") {
|
|
193
200
|
const patch = normalizeOverrides(input.set);
|
|
194
201
|
if (Object.keys(patch).length === 0) {
|
|
195
|
-
|
|
202
|
+
throw new ToolValidationError({
|
|
203
|
+
message: 'design: no overrides given. Pass set:{ "primary": "oklch(\u2026)" }.',
|
|
204
|
+
field: "set"
|
|
205
|
+
});
|
|
196
206
|
}
|
|
197
207
|
const merged = await recordOverrides(ctx.projectRoot, patch, (/* @__PURE__ */ new Date()).toISOString());
|
|
198
|
-
if (!merged)
|
|
199
|
-
return {
|
|
200
|
-
action,
|
|
201
|
-
output: 'No active kit. Pick one first: `design {action:"use", kit:"<id>"}`.'
|
|
202
|
-
};
|
|
203
|
-
}
|
|
208
|
+
if (!merged) throw new Error(NO_ACTIVE_KIT);
|
|
204
209
|
setDesignOverrides(ctx, merged);
|
|
205
210
|
return {
|
|
206
211
|
action,
|
|
@@ -211,18 +216,13 @@ These win over kit tokens. Run \`design {action:"materialize"}\` to write them t
|
|
|
211
216
|
if (action === "tune") {
|
|
212
217
|
const patch = resolveSemanticTune(input.tune ?? {});
|
|
213
218
|
if (Object.keys(patch).length === 0) {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
};
|
|
219
|
+
throw new ToolValidationError({
|
|
220
|
+
message: 'design: no recognized knobs. Pass tune:{ radius:"lg", density:"compact", font:"\u2026", motion:"snappy" }.',
|
|
221
|
+
field: "tune"
|
|
222
|
+
});
|
|
218
223
|
}
|
|
219
224
|
const merged = await recordOverrides(ctx.projectRoot, patch, (/* @__PURE__ */ new Date()).toISOString());
|
|
220
|
-
if (!merged)
|
|
221
|
-
return {
|
|
222
|
-
action,
|
|
223
|
-
output: 'No active kit. Pick one first: `design {action:"use", kit:"<id>"}`.'
|
|
224
|
-
};
|
|
225
|
-
}
|
|
225
|
+
if (!merged) throw new Error(NO_ACTIVE_KIT);
|
|
226
226
|
setDesignOverrides(ctx, merged);
|
|
227
227
|
return {
|
|
228
228
|
action,
|
|
@@ -232,17 +232,10 @@ Run \`design {action:"materialize"}\` to write the tuned tokens to your theme fi
|
|
|
232
232
|
}
|
|
233
233
|
if (action === "materialize") {
|
|
234
234
|
const active = await loadActiveKit(ctx.projectRoot);
|
|
235
|
-
if (!active)
|
|
236
|
-
return {
|
|
237
|
-
action,
|
|
238
|
-
output: 'No active kit. Pick one first: `design {action:"use", kit:"<id>"}`.'
|
|
239
|
-
};
|
|
240
|
-
}
|
|
235
|
+
if (!active) throw new Error(NO_ACTIVE_KIT);
|
|
241
236
|
const resolvedStack = stack ?? (active.stack && isDesignStack(active.stack) ? active.stack : "web");
|
|
242
237
|
const rawTokens = await loader.readTokens(active.kit);
|
|
243
|
-
if (!rawTokens) {
|
|
244
|
-
return { action, kit: active.kit, output: `Kit "${active.kit}" has no tokens.json.` };
|
|
245
|
-
}
|
|
238
|
+
if (!rawTokens) throw new Error(`design: kit "${active.kit}" has no tokens.json.`);
|
|
246
239
|
const tokens = applyTokenOverrides(rawTokens, active.overrides);
|
|
247
240
|
const result = materializeTokens({
|
|
248
241
|
tokens,
|
|
@@ -268,17 +261,13 @@ Run \`design {action:"materialize"}\` to write the tuned tokens to your theme fi
|
|
|
268
261
|
} catch {
|
|
269
262
|
}
|
|
270
263
|
if (exists && !input.force) {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
kit: active.kit,
|
|
274
|
-
stack: resolvedStack,
|
|
275
|
-
path: result.path,
|
|
276
|
-
output: `${result.path} already exists. Re-run with force:true to overwrite, or write this ${result.format} yourself:
|
|
264
|
+
throw new Error(
|
|
265
|
+
`design: ${result.path} already exists \u2014 nothing was written. Re-run with force:true to overwrite, or write this ${result.format} yourself:
|
|
277
266
|
|
|
278
267
|
\`\`\`
|
|
279
268
|
${result.content}
|
|
280
269
|
\`\`\``
|
|
281
|
-
|
|
270
|
+
);
|
|
282
271
|
}
|
|
283
272
|
await fs.mkdir(path.dirname(abs), { recursive: true });
|
|
284
273
|
await atomicWrite(abs, result.content);
|
|
@@ -293,17 +282,10 @@ ${result.content}
|
|
|
293
282
|
if (action === "verify") {
|
|
294
283
|
signal?.throwIfAborted();
|
|
295
284
|
const active = await loadActiveKit(ctx.projectRoot);
|
|
296
|
-
if (!active)
|
|
297
|
-
return {
|
|
298
|
-
action,
|
|
299
|
-
output: 'No active kit to verify against. Pick one: `design {action:"use", kit:"<id>"}`.'
|
|
300
|
-
};
|
|
301
|
-
}
|
|
285
|
+
if (!active) throw new Error(NO_ACTIVE_KIT);
|
|
302
286
|
signal?.throwIfAborted();
|
|
303
287
|
const rawTokens = await loader.readTokens(active.kit);
|
|
304
|
-
if (!rawTokens) {
|
|
305
|
-
return { action, kit: active.kit, output: `Kit "${active.kit}" has no tokens.json.` };
|
|
306
|
-
}
|
|
288
|
+
if (!rawTokens) throw new Error(`design: kit "${active.kit}" has no tokens.json.`);
|
|
307
289
|
signal?.throwIfAborted();
|
|
308
290
|
const tokens = applyTokenOverrides(rawTokens, active.overrides);
|
|
309
291
|
const normalizedFiles = input.files ? (Array.isArray(input.files) ? input.files : String(input.files).split(",")).filter((f) => typeof f === "string").map((f) => f.trim().replace(/\\/g, "/")).filter(Boolean) : void 0;
|
|
@@ -334,4 +316,4 @@ Replace off-palette colors with kit tokens (or the materialized CSS vars / token
|
|
|
334
316
|
export {
|
|
335
317
|
designTool
|
|
336
318
|
};
|
|
337
|
-
//# sourceMappingURL=chunk-
|
|
319
|
+
//# sourceMappingURL=chunk-MRXWOOOR.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseFilesContent
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KHUCKLOR.js";
|
|
4
4
|
import {
|
|
5
5
|
recordFilesystemRead
|
|
6
6
|
} from "./chunk-ZKC5UNGD.js";
|
|
@@ -4993,7 +4993,7 @@ var ParserWorkerPool = class {
|
|
|
4993
4993
|
*/
|
|
4994
4994
|
async reparseInline(batch, orphaned, workerId) {
|
|
4995
4995
|
try {
|
|
4996
|
-
const { parseFileContent } = await import("./parser-dispatch-
|
|
4996
|
+
const { parseFileContent } = await import("./parser-dispatch-WG4DNBHH.js");
|
|
4997
4997
|
for (const item of orphaned) {
|
|
4998
4998
|
if (batch.settled) return;
|
|
4999
4999
|
try {
|
|
@@ -5856,4 +5856,4 @@ export {
|
|
|
5856
5856
|
incomingCallsService,
|
|
5857
5857
|
outgoingCallsService
|
|
5858
5858
|
};
|
|
5859
|
-
//# sourceMappingURL=chunk-
|
|
5859
|
+
//# sourceMappingURL=chunk-NEYUPZL6.js.map
|
|
@@ -133,6 +133,10 @@ async function assertBrowserUrlAllowed(rawUrl, opts) {
|
|
|
133
133
|
const url = parseBrowserUrl(rawUrl, opts.navigation ?? true);
|
|
134
134
|
if (!opts.navigation && SAFE_SUBRESOURCE_PROTOCOLS.has(url.protocol)) return url;
|
|
135
135
|
if (!opts.allowPrivateHosts && !isAllowedPrivateOrigin(url, opts.allowedPrivateOrigins)) {
|
|
136
|
+
const normalizedHost = unbracket(url.hostname).replace(/\.+$/, "").toLowerCase();
|
|
137
|
+
if (normalizedHost === "localhost" || normalizedHost.endsWith(".localhost")) {
|
|
138
|
+
throw new Error("browser: blocked localhost target");
|
|
139
|
+
}
|
|
136
140
|
await assertNotPrivateHost(url.hostname);
|
|
137
141
|
}
|
|
138
142
|
return url;
|
|
@@ -148,7 +152,8 @@ async function resolvePinnedBrowserTarget(rawUrl, opts = {}) {
|
|
|
148
152
|
}
|
|
149
153
|
return { url, address: hostname, family: literalFamily };
|
|
150
154
|
}
|
|
151
|
-
|
|
155
|
+
const normalizedHost = hostname.replace(/\.+$/, "").toLowerCase();
|
|
156
|
+
if ((normalizedHost === "localhost" || normalizedHost.endsWith(".localhost")) && !allowPrivate) {
|
|
152
157
|
throw new Error("browser: blocked localhost target");
|
|
153
158
|
}
|
|
154
159
|
const lookup2 = opts.lookup ?? ((host) => dns.lookup(host, { all: true }));
|
|
@@ -225,12 +230,12 @@ function safeBrowserUrl(rawUrl) {
|
|
|
225
230
|
}
|
|
226
231
|
}
|
|
227
232
|
function redactBrowserText(text) {
|
|
228
|
-
return text.replace(/\
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
233
|
+
return text.replace(/\bBearer\s+[A-Za-z0-9._~+/-]+=*/gi, "Bearer [REDACTED]").replace(
|
|
234
|
+
/(["']?)\b(authorization|set[-_ ]?cookie|cookie|api[-_ ]?key|private[-_ ]?key|client[-_ ]?secret|access[-_ ]?token|refresh[-_ ]?token|session[-_ ]?token|auth[-_ ]?token|token|password|secret)\b\1(\s*[:=]\s*)((?:"[^"\r\n]*"|'[^'\r\n]*'|(?:Basic|Bearer)\s+[^\s,;]+|[^\s,;]+))/gi,
|
|
235
|
+
(_match, q1, key, sep, val) => {
|
|
236
|
+
const quote = val.startsWith('"') ? '"' : val.startsWith("'") ? "'" : "";
|
|
237
|
+
return `${q1}${key}${q1}${sep}${quote}[REDACTED]${quote}`;
|
|
238
|
+
}
|
|
234
239
|
);
|
|
235
240
|
}
|
|
236
241
|
|
|
@@ -1420,4 +1425,4 @@ export {
|
|
|
1420
1425
|
isBrowserSuiteEnabled,
|
|
1421
1426
|
shutdownBrowserTools
|
|
1422
1427
|
};
|
|
1423
|
-
//# sourceMappingURL=chunk-
|
|
1428
|
+
//# sourceMappingURL=chunk-O2MHULBO.js.map
|