@wrongstack/tools 0.287.0 → 0.289.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/_fetch-guard.d.ts.map +1 -1
- package/dist/_redact-command.d.ts.map +1 -1
- package/dist/_spawn-stream.d.ts.map +1 -1
- package/dist/audit.js +61 -14
- package/dist/audit.js.map +3 -3
- package/dist/bash.d.ts +1 -1
- package/dist/bash.d.ts.map +1 -1
- package/dist/bash.js +97 -19
- package/dist/bash.js.map +3 -3
- package/dist/builtin.d.ts +12 -10
- package/dist/builtin.d.ts.map +1 -1
- package/dist/builtin.js +1620 -803
- package/dist/builtin.js.map +3 -3
- package/dist/codebase-index/background-indexer.d.ts.map +1 -1
- package/dist/codebase-index/bm25.d.ts +1 -2
- package/dist/codebase-index/bm25.d.ts.map +1 -1
- package/dist/codebase-index/codebase-index-tool.d.ts.map +1 -1
- package/dist/codebase-index/codebase-search-tool.d.ts.map +1 -1
- package/dist/codebase-index/codebase-stats-tool.d.ts +7 -0
- package/dist/codebase-index/codebase-stats-tool.d.ts.map +1 -1
- package/dist/codebase-index/index-service.d.ts +11 -1
- package/dist/codebase-index/index-service.d.ts.map +1 -1
- package/dist/codebase-index/index.d.ts +2 -1
- package/dist/codebase-index/index.d.ts.map +1 -1
- package/dist/codebase-index/index.js +749 -192
- package/dist/codebase-index/index.js.map +3 -3
- package/dist/codebase-index/indexer.d.ts.map +1 -1
- package/dist/codebase-index/schema.d.ts +43 -1
- package/dist/codebase-index/schema.d.ts.map +1 -1
- package/dist/codebase-index/ts-parser.d.ts.map +1 -1
- package/dist/codebase-index/worker-protocol.d.ts +1 -0
- package/dist/codebase-index/worker-protocol.d.ts.map +1 -1
- package/dist/codebase-index/worker.js +610 -152
- package/dist/codebase-index/worker.js.map +3 -3
- package/dist/codebase-index/writer.d.ts +27 -1
- package/dist/codebase-index/writer.d.ts.map +1 -1
- package/dist/e2e.js +477 -0
- package/dist/e2e.js.map +7 -0
- package/dist/exec.d.ts +1 -1
- package/dist/exec.d.ts.map +1 -1
- package/dist/exec.js +60 -5
- package/dist/exec.js.map +3 -3
- package/dist/fetch.js +2 -2
- package/dist/fetch.js.map +2 -2
- package/dist/format.js +61 -14
- package/dist/format.js.map +3 -3
- package/dist/glob.js +2 -2
- package/dist/glob.js.map +1 -1
- package/dist/grep.d.ts.map +1 -1
- package/dist/grep.js +2 -2
- package/dist/grep.js.map +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1786 -809
- package/dist/index.js.map +3 -3
- package/dist/install.js +61 -14
- package/dist/install.js.map +3 -3
- package/dist/kanban.d.ts +11 -2
- package/dist/kanban.d.ts.map +1 -1
- package/dist/kanban.js +695 -571
- package/dist/kanban.js.map +3 -3
- package/dist/languages/detect.d.ts.map +1 -1
- package/dist/languages/index.js +61 -14
- package/dist/languages/index.js.map +3 -3
- package/dist/languages/types.d.ts +7 -0
- package/dist/languages/types.d.ts.map +1 -1
- package/dist/lint.js +61 -14
- package/dist/lint.js.map +3 -3
- package/dist/outdated.js +61 -14
- package/dist/outdated.js.map +3 -3
- package/dist/pack.js +1617 -800
- package/dist/pack.js.map +3 -3
- package/dist/plan.js +4 -0
- package/dist/plan.js.map +2 -2
- package/dist/process-registry.js +12 -5
- package/dist/process-registry.js.map +2 -2
- package/dist/search.js +2 -2
- package/dist/search.js.map +2 -2
- package/dist/session-kanban.d.ts +9 -0
- package/dist/session-kanban.d.ts.map +1 -1
- package/dist/session-kanban.js +137 -0
- package/dist/session-kanban.js.map +2 -2
- package/dist/task.js +4 -0
- package/dist/task.js.map +2 -2
- package/dist/test.js +61 -14
- package/dist/test.js.map +3 -3
- package/dist/todo.js +4 -0
- package/dist/todo.js.map +2 -2
- package/dist/tree.js +2 -2
- package/dist/tree.js.map +1 -1
- package/dist/typecheck.js +61 -14
- package/dist/typecheck.js.map +3 -3
- package/package.json +7 -3
package/dist/outdated.js
CHANGED
|
@@ -1577,13 +1577,14 @@ async function detectLanguageWorkspaces(options) {
|
|
|
1577
1577
|
const target = options.target ? await canonicalInside(resolveFrom(cwd, options.target), projectRoot, "target") : void 0;
|
|
1578
1578
|
const profiles = (options.profiles ?? languageProfileRegistry.list()).filter((profile) => !options.language || profile.id === options.language).slice().sort((a, b) => a.id.localeCompare(b.id));
|
|
1579
1579
|
const limits = normalizeLimits(options.limits);
|
|
1580
|
+
const extraIgnores = new Set(options.ignoredDirectories ?? []);
|
|
1580
1581
|
const state = {
|
|
1581
1582
|
entries: 0,
|
|
1582
1583
|
truncated: false,
|
|
1583
1584
|
sourcePaths: /* @__PURE__ */ new Map(),
|
|
1584
1585
|
candidates: /* @__PURE__ */ new Map()
|
|
1585
1586
|
};
|
|
1586
|
-
await scanDirectory(projectRoot, 0, profiles, limits, state, options.signal);
|
|
1587
|
+
await scanDirectory(projectRoot, 0, profiles, limits, state, extraIgnores, options.signal);
|
|
1587
1588
|
addSourceFallbacks(projectRoot, profiles, state);
|
|
1588
1589
|
if (target) addTargetEvidence(target, projectRoot, profiles, state);
|
|
1589
1590
|
const workspaces = await Promise.all(
|
|
@@ -1597,7 +1598,7 @@ async function detectLanguageWorkspaces(options) {
|
|
|
1597
1598
|
workspaces
|
|
1598
1599
|
};
|
|
1599
1600
|
}
|
|
1600
|
-
async function scanDirectory(directory, depth, profiles, limits, state, signal) {
|
|
1601
|
+
async function scanDirectory(directory, depth, profiles, limits, state, extraIgnores, signal) {
|
|
1601
1602
|
signal?.throwIfAborted();
|
|
1602
1603
|
if (depth > limits.maxDepth || state.entries >= limits.maxEntries) {
|
|
1603
1604
|
state.truncated = true;
|
|
@@ -1620,12 +1621,12 @@ async function scanDirectory(directory, depth, profiles, limits, state, signal)
|
|
|
1620
1621
|
const fullPath = path3.join(directory, entry.name);
|
|
1621
1622
|
if (entry.isSymbolicLink()) continue;
|
|
1622
1623
|
if (entry.isDirectory()) {
|
|
1623
|
-
if (shouldIgnoreDirectory(entry.name, profiles)) continue;
|
|
1624
|
+
if (shouldIgnoreDirectory(entry.name, profiles, extraIgnores)) continue;
|
|
1624
1625
|
if (depth >= limits.maxDepth) {
|
|
1625
1626
|
state.truncated = true;
|
|
1626
1627
|
continue;
|
|
1627
1628
|
}
|
|
1628
|
-
await scanDirectory(fullPath, depth + 1, profiles, limits, state, signal);
|
|
1629
|
+
await scanDirectory(fullPath, depth + 1, profiles, limits, state, extraIgnores, signal);
|
|
1629
1630
|
continue;
|
|
1630
1631
|
}
|
|
1631
1632
|
if (!entry.isFile()) continue;
|
|
@@ -1754,8 +1755,8 @@ function getCandidate(state, profile, root) {
|
|
|
1754
1755
|
}
|
|
1755
1756
|
return candidate;
|
|
1756
1757
|
}
|
|
1757
|
-
function shouldIgnoreDirectory(name, profiles) {
|
|
1758
|
-
if (GLOBAL_IGNORES.has(name) || name.startsWith(".")) return true;
|
|
1758
|
+
function shouldIgnoreDirectory(name, profiles, extraIgnores) {
|
|
1759
|
+
if (GLOBAL_IGNORES.has(name) || extraIgnores.has(name) || name.startsWith(".")) return true;
|
|
1759
1760
|
return profiles.some((profile) => profile.ignoredDirectories.includes(name));
|
|
1760
1761
|
}
|
|
1761
1762
|
function normalizeLimits(input) {
|
|
@@ -2648,8 +2649,10 @@ function redactCommand(cmd) {
|
|
|
2648
2649
|
const flag = match.slice(0, match.indexOf(expectDefined(delim)) + 1);
|
|
2649
2650
|
return `${flag}[REDACTED]`;
|
|
2650
2651
|
}
|
|
2651
|
-
|
|
2652
|
-
|
|
2652
|
+
if (match.startsWith("--")) {
|
|
2653
|
+
return match;
|
|
2654
|
+
}
|
|
2655
|
+
return `${match.slice(0, 2)}[REDACTED]`;
|
|
2653
2656
|
});
|
|
2654
2657
|
}
|
|
2655
2658
|
return result;
|
|
@@ -2661,9 +2664,14 @@ var init_redact_command = __esm({
|
|
|
2661
2664
|
SENSITIVE_FLAG_PATTERNS = [
|
|
2662
2665
|
// --flag=value or --flag "value" (value captured up to next space or comma)
|
|
2663
2666
|
/--(?:token|password|passwd|pwd|secret|api[-_]?key|api[-_]?secret|auth|credential|private[-_]?key|access[-_]?key|github[-_]?token|gh[-_]?token|bearer|jwt|oauth|pin|pincode|passphrase|access[-_]?token)(?:[=\s,][^\s]*)?/gi,
|
|
2664
|
-
// -
|
|
2665
|
-
|
|
2666
|
-
/
|
|
2667
|
+
// -t short flag (token): attached (-tVALUE), separated (-t VALUE), or -t=VALUE.
|
|
2668
|
+
// (?<![-\w]) anchors to a token start so we don't match the `-t` inside `--token`.
|
|
2669
|
+
// NOTE: synced with @wrongstack/core observability/redact-command.ts.
|
|
2670
|
+
/(?<![-\w])-t(?:[=\s]+)?[^\s,-]+/,
|
|
2671
|
+
// -p|-password|-a (redis auth) short flags: attached + separated + =value.
|
|
2672
|
+
// Same token-start anchor; over-redaction is an accepted tradeoff for a
|
|
2673
|
+
// redaction function. Synced with core copy.
|
|
2674
|
+
/(?<![-\w])-(?:password|p|a)(?:[=\s]+)?[^\s,-]+/gi,
|
|
2667
2675
|
// env var–style secrets: TOKEN=x, API_KEY=y, etc.
|
|
2668
2676
|
/(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
|
|
2669
2677
|
// Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
|
|
@@ -3043,7 +3051,12 @@ var init_process_registry = __esm({
|
|
|
3043
3051
|
|
|
3044
3052
|
// src/_spawn-stream.ts
|
|
3045
3053
|
import { spawn as spawn2 } from "node:child_process";
|
|
3046
|
-
import {
|
|
3054
|
+
import {
|
|
3055
|
+
buildChildEnv,
|
|
3056
|
+
emitProcessCompleted,
|
|
3057
|
+
emitProcessOutput,
|
|
3058
|
+
emitProcessStarted
|
|
3059
|
+
} from "@wrongstack/core";
|
|
3047
3060
|
async function* spawnStream(opts) {
|
|
3048
3061
|
const max = opts.maxBytes ?? 2e5;
|
|
3049
3062
|
const flushAt = opts.flushBytes ?? 4 * 1024;
|
|
@@ -3068,6 +3081,19 @@ async function* spawnStream(opts) {
|
|
|
3068
3081
|
});
|
|
3069
3082
|
const registry = getProcessRegistry();
|
|
3070
3083
|
const pid = child.pid;
|
|
3084
|
+
const processStartedAt = Date.now();
|
|
3085
|
+
let stdoutBytes = 0;
|
|
3086
|
+
let stderrBytes = 0;
|
|
3087
|
+
let telemetryCompleted = false;
|
|
3088
|
+
emitProcessStarted({
|
|
3089
|
+
...pid !== void 0 ? { pid } : {},
|
|
3090
|
+
parentPid: process.pid,
|
|
3091
|
+
command: redactCommand(`${opts.cmd} ${opts.args.join(" ")}`),
|
|
3092
|
+
args: redactCommand(opts.args.join(" ")).split(" ").filter(Boolean),
|
|
3093
|
+
cwd: opts.cwd,
|
|
3094
|
+
background: false,
|
|
3095
|
+
startedAt: new Date(processStartedAt).toISOString()
|
|
3096
|
+
});
|
|
3071
3097
|
if (typeof pid === "number") {
|
|
3072
3098
|
registry.register({
|
|
3073
3099
|
pid,
|
|
@@ -3096,6 +3122,8 @@ async function* spawnStream(opts) {
|
|
|
3096
3122
|
};
|
|
3097
3123
|
const onOut = (c) => {
|
|
3098
3124
|
const s = c.toString();
|
|
3125
|
+
stdoutBytes += c.byteLength;
|
|
3126
|
+
emitProcessOutput({ pid, stream: "stdout", chunk: c });
|
|
3099
3127
|
if (stdout.length < max) stdout += s;
|
|
3100
3128
|
spool.write(s);
|
|
3101
3129
|
queue.push({ kind: "out", data: s });
|
|
@@ -3108,6 +3136,8 @@ async function* spawnStream(opts) {
|
|
|
3108
3136
|
};
|
|
3109
3137
|
const onErr = (c) => {
|
|
3110
3138
|
const s = c.toString();
|
|
3139
|
+
stderrBytes += c.byteLength;
|
|
3140
|
+
emitProcessOutput({ pid, stream: "stderr", chunk: c });
|
|
3111
3141
|
if (stderr.length < max) stderr += s;
|
|
3112
3142
|
spool.write(s);
|
|
3113
3143
|
queue.push({ kind: "err", data: s });
|
|
@@ -3125,9 +3155,25 @@ async function* spawnStream(opts) {
|
|
|
3125
3155
|
queue.push({ kind: "error", data: e.message });
|
|
3126
3156
|
wake();
|
|
3127
3157
|
});
|
|
3128
|
-
|
|
3158
|
+
const completeTelemetry = (code, signal, timedOut = false) => {
|
|
3159
|
+
if (telemetryCompleted) return;
|
|
3160
|
+
telemetryCompleted = true;
|
|
3161
|
+
emitProcessCompleted({
|
|
3162
|
+
...pid !== void 0 ? { pid } : {},
|
|
3163
|
+
exitCode: code,
|
|
3164
|
+
...signal ? { signal } : {},
|
|
3165
|
+
durationMs: Date.now() - processStartedAt,
|
|
3166
|
+
stdoutBytes,
|
|
3167
|
+
stderrBytes,
|
|
3168
|
+
timedOut,
|
|
3169
|
+
endedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3170
|
+
});
|
|
3171
|
+
};
|
|
3172
|
+
child.on("close", (code, signal) => {
|
|
3129
3173
|
if (typeof pid === "number") registry.unregister(pid);
|
|
3130
|
-
|
|
3174
|
+
const exitCode2 = code ?? (signal ? 1 : 0);
|
|
3175
|
+
completeTelemetry(exitCode2, signal ?? void 0);
|
|
3176
|
+
queue.push({ kind: "close", data: "", code: exitCode2, ...signal ? { signal } : {} });
|
|
3131
3177
|
wake();
|
|
3132
3178
|
});
|
|
3133
3179
|
const onAbort = () => {
|
|
@@ -3140,6 +3186,7 @@ async function* spawnStream(opts) {
|
|
|
3140
3186
|
}
|
|
3141
3187
|
}
|
|
3142
3188
|
queue.push({ kind: "close", data: "", code: 124 });
|
|
3189
|
+
completeTelemetry(124, "SIGKILL", true);
|
|
3143
3190
|
wake();
|
|
3144
3191
|
};
|
|
3145
3192
|
if (isWin) {
|