@wrongstack/tools 0.306.3 → 0.307.0
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/audit.js +50 -9
- package/dist/auto-proceed-loop-guard.js +8 -2
- package/dist/bash.js +57 -22
- package/dist/builtin.d.ts +6 -6
- package/dist/builtin.js +11315 -9317
- package/dist/clarify.d.ts +32 -0
- package/dist/codebase-index/ast-invariant-engine.d.ts +102 -0
- package/dist/codebase-index/ast-symbol-mutator.d.ts +28 -0
- package/dist/codebase-index/background-indexer.d.ts +9 -0
- package/dist/codebase-index/codebase-ast-replace-tool.d.ts +31 -0
- package/dist/codebase-index/codebase-impact-analysis-tool.d.ts +40 -0
- package/dist/codebase-index/codebase-invariant-check-tool.d.ts +23 -0
- package/dist/codebase-index/codebase-repo-map-tool.d.ts +22 -0
- package/dist/codebase-index/codebase-skeleton-tool.d.ts +36 -0
- package/dist/codebase-index/codebase-targeted-test-tool.d.ts +30 -0
- package/dist/codebase-index/index.d.ts +11 -1
- package/dist/codebase-index/index.js +4141 -1479
- package/dist/codebase-index/project-server-client-state.d.ts +79 -0
- package/dist/codebase-index/project-server-client.d.ts +3 -71
- package/dist/codebase-index/project-server-protocol.d.ts +1 -0
- package/dist/codebase-index/project-server.js +751 -909
- package/dist/codebase-index/repo-map.d.ts +20 -0
- package/dist/codebase-index/skeleton-extractor.d.ts +64 -0
- package/dist/codebase-index/tree-sitter-parser.d.ts +11 -0
- package/dist/codebase-index/worker.js +723 -891
- package/dist/codebase-index/writer-mutations.d.ts +26 -0
- package/dist/codebase-index/writer-refs.d.ts +50 -0
- package/dist/codebase-index/writer-search.d.ts +30 -0
- package/dist/codebase-index/writer.d.ts +2 -320
- package/dist/diff.js +3 -2
- package/dist/document.js +37 -2
- package/dist/e2e.js +3 -2
- package/dist/edit.js +8558 -348
- package/dist/exec.js +76 -22
- package/dist/fetch.js +11 -9
- package/dist/format.js +50 -9
- package/dist/glob.js +8 -3
- package/dist/grep.js +22 -10
- package/dist/index.d.ts +3 -1
- package/dist/index.js +11411 -9440
- package/dist/install.js +50 -9
- package/dist/json.js +91 -17
- package/dist/kanban-board-actions.d.ts +4 -0
- package/dist/kanban-lifecycle-actions.d.ts +4 -0
- package/dist/kanban-serializer.d.ts +21 -0
- package/dist/kanban.js +985 -1034
- package/dist/languages/index.js +17 -10
- package/dist/lint.js +50 -9
- package/dist/logs.js +17 -6
- package/dist/next-steps.d.ts +8 -0
- package/dist/next-steps.js +18 -0
- package/dist/outdated.js +18 -11
- package/dist/pack.js +11308 -9317
- package/dist/patch.js +8301 -77
- package/dist/plan.js +1231 -1281
- package/dist/process-registry.js +14 -8
- package/dist/ps-slash.js +65 -30
- package/dist/read.js +754 -912
- package/dist/replace.js +8456 -195
- package/dist/scaffold.js +36 -1
- package/dist/search.js +21 -15
- package/dist/security-ast-scan-tool.d.ts +43 -0
- package/dist/session-kanban-graph.d.ts +9 -0
- package/dist/session-kanban-sync.d.ts +31 -0
- package/dist/session-kanban.d.ts +5 -141
- package/dist/session-kanban.js +367 -360
- package/dist/task.js +1157 -1207
- package/dist/test.js +50 -9
- package/dist/todo.js +2187 -2237
- package/dist/tool-diff.js +6 -1
- package/dist/tool-summary.js +4 -2
- package/dist/tool-tier.js +11315 -9317
- package/dist/tree.js +36 -1
- package/dist/typecheck.js +51 -10
- package/dist/write.js +8374 -152
- package/package.json +7 -7
package/dist/test.js
CHANGED
|
@@ -425,13 +425,16 @@ function killWin32Tree(pid, opts = {}) {
|
|
|
425
425
|
};
|
|
426
426
|
child.on("error", settle);
|
|
427
427
|
child.on("close", settle);
|
|
428
|
-
timeout = setTimeout(
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
428
|
+
timeout = setTimeout(
|
|
429
|
+
() => {
|
|
430
|
+
try {
|
|
431
|
+
child.kill();
|
|
432
|
+
} catch {
|
|
433
|
+
}
|
|
434
|
+
settle();
|
|
435
|
+
},
|
|
436
|
+
Math.max(1, opts.timeoutMs ?? WIN32_TASKKILL_TIMEOUT_MS)
|
|
437
|
+
);
|
|
435
438
|
timeout.unref?.();
|
|
436
439
|
child.unref();
|
|
437
440
|
return true;
|
|
@@ -605,7 +608,10 @@ var ProcessRegistryImpl = class {
|
|
|
605
608
|
getBreakerCountdown() {
|
|
606
609
|
if (this.autoKillArmedAt === null || this.autoKillResetMs <= 0) return null;
|
|
607
610
|
const elapsed = Date.now() - this.autoKillArmedAt;
|
|
608
|
-
return {
|
|
611
|
+
return {
|
|
612
|
+
remainingMs: Math.max(0, this.autoKillResetMs - elapsed),
|
|
613
|
+
totalMs: this.autoKillResetMs
|
|
614
|
+
};
|
|
609
615
|
}
|
|
610
616
|
/**
|
|
611
617
|
* Subscribe to countdown arm/cancel events. Returns an unsubscribe function.
|
|
@@ -1044,6 +1050,7 @@ function utf8Prefix(text, maxBytes) {
|
|
|
1044
1050
|
}
|
|
1045
1051
|
|
|
1046
1052
|
// src/_util.ts
|
|
1053
|
+
import * as fsp2 from "node:fs/promises";
|
|
1047
1054
|
import * as path3 from "node:path";
|
|
1048
1055
|
import * as Core from "@wrongstack/core/utils";
|
|
1049
1056
|
function resolvePath(input, ctx) {
|
|
@@ -1067,6 +1074,40 @@ function ensureInsideRoot(absPath, ctx) {
|
|
|
1067
1074
|
function safeResolve(input, ctx) {
|
|
1068
1075
|
return ensureInsideRoot(resolvePath(input, ctx), ctx);
|
|
1069
1076
|
}
|
|
1077
|
+
async function resolveRealInsideRoot(absPath, ctx) {
|
|
1078
|
+
if (ctx.allowOutsideProjectRoot) return absPath;
|
|
1079
|
+
const realRoots = await Promise.all(
|
|
1080
|
+
allowedRoots(ctx).map((r) => fsp2.realpath(r).catch(() => path3.resolve(r)))
|
|
1081
|
+
);
|
|
1082
|
+
let probe = absPath;
|
|
1083
|
+
const pendingTail = [];
|
|
1084
|
+
for (; ; ) {
|
|
1085
|
+
let real;
|
|
1086
|
+
try {
|
|
1087
|
+
real = await fsp2.realpath(probe);
|
|
1088
|
+
} catch (err) {
|
|
1089
|
+
if (err.code === "ENOENT") {
|
|
1090
|
+
const parent = path3.dirname(probe);
|
|
1091
|
+
if (parent === probe) return absPath;
|
|
1092
|
+
pendingTail.unshift(path3.basename(probe));
|
|
1093
|
+
probe = parent;
|
|
1094
|
+
continue;
|
|
1095
|
+
}
|
|
1096
|
+
throw err;
|
|
1097
|
+
}
|
|
1098
|
+
const candidate = pendingTail.length > 0 ? path3.join(real, ...pendingTail) : real;
|
|
1099
|
+
if (isInsideAny(candidate, realRoots)) {
|
|
1100
|
+
return candidate;
|
|
1101
|
+
}
|
|
1102
|
+
throw new Error(
|
|
1103
|
+
`Path "${absPath}" resolves through a symlink outside project root "${realRoots[0]}"`
|
|
1104
|
+
);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
async function safeResolveReal(input, ctx) {
|
|
1108
|
+
const abs = safeResolve(input, ctx);
|
|
1109
|
+
return await resolveRealInsideRoot(abs, ctx);
|
|
1110
|
+
}
|
|
1070
1111
|
var COMMAND_OUTPUT_MAX_BYTES = 32768;
|
|
1071
1112
|
var REPEAT_RUN_THRESHOLD = 3;
|
|
1072
1113
|
function collapseCarriageReturns(text) {
|
|
@@ -3594,7 +3635,7 @@ var testTool = {
|
|
|
3594
3635
|
return final;
|
|
3595
3636
|
},
|
|
3596
3637
|
async *executeStream(input, ctx, opts) {
|
|
3597
|
-
const cwd = input.cwd ?
|
|
3638
|
+
const cwd = input.cwd ? await safeResolveReal(input.cwd, ctx) : ctx.cwd;
|
|
3598
3639
|
const runner = input.runner ?? "auto";
|
|
3599
3640
|
if (runner === "auto") {
|
|
3600
3641
|
const bridge = await tryLegacyCodeOperation("test", {
|