@vibe-agent-toolkit/utils 0.2.0-rc.2 → 0.2.0-rc.4
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/README.md +26 -15
- package/dist/compare-code-units.d.ts +28 -0
- package/dist/compare-code-units.d.ts.map +1 -0
- package/dist/compare-code-units.js +33 -0
- package/dist/compare-code-units.js.map +1 -0
- package/dist/crawl-timing.d.ts +657 -0
- package/dist/crawl-timing.d.ts.map +1 -0
- package/dist/crawl-timing.js +765 -0
- package/dist/crawl-timing.js.map +1 -0
- package/dist/crawl.d.ts +2 -4
- package/dist/crawl.d.ts.map +1 -1
- package/dist/crawl.js +2 -4
- package/dist/crawl.js.map +1 -1
- package/dist/file-crawler.d.ts +22 -0
- package/dist/file-crawler.d.ts.map +1 -1
- package/dist/file-crawler.js +31 -7
- package/dist/file-crawler.js.map +1 -1
- package/dist/fs-utils.d.ts +17 -0
- package/dist/fs-utils.d.ts.map +1 -1
- package/dist/fs-utils.js +69 -0
- package/dist/fs-utils.js.map +1 -1
- package/dist/fs.d.ts +3 -1
- package/dist/fs.d.ts.map +1 -1
- package/dist/fs.js +5 -1
- package/dist/fs.js.map +1 -1
- package/dist/git-run.d.ts +167 -0
- package/dist/git-run.d.ts.map +1 -0
- package/dist/git-run.js +154 -0
- package/dist/git-run.js.map +1 -0
- package/dist/git-snapshot.d.ts +181 -0
- package/dist/git-snapshot.d.ts.map +1 -0
- package/dist/git-snapshot.js +232 -0
- package/dist/git-snapshot.js.map +1 -0
- package/dist/git-tracker.d.ts +94 -1
- package/dist/git-tracker.d.ts.map +1 -1
- package/dist/git-tracker.js +135 -3
- package/dist/git-tracker.js.map +1 -1
- package/dist/git-utils.d.ts +38 -0
- package/dist/git-utils.d.ts.map +1 -1
- package/dist/git-utils.js +103 -80
- package/dist/git-utils.js.map +1 -1
- package/dist/git.d.ts +12 -4
- package/dist/git.d.ts.map +1 -1
- package/dist/git.js +12 -4
- package/dist/git.js.map +1 -1
- package/dist/gitignore-checker.d.ts.map +1 -1
- package/dist/gitignore-checker.js +6 -3
- package/dist/gitignore-checker.js.map +1 -1
- package/dist/index.d.ts +24 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -30
- package/dist/index.js.map +1 -1
- package/dist/path-core.d.ts +1 -1
- package/dist/path-core.js +1 -1
- package/dist/project-utils.d.ts.map +1 -1
- package/dist/project-utils.js +6 -3
- package/dist/project-utils.js.map +1 -1
- package/dist/project.d.ts +7 -5
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +7 -5
- package/dist/project.js.map +1 -1
- package/dist/safe-exec.d.ts +38 -10
- package/dist/safe-exec.d.ts.map +1 -1
- package/dist/safe-exec.js +88 -19
- package/dist/safe-exec.js.map +1 -1
- package/dist/skill-test/index.d.ts +1 -1
- package/dist/skill-test/index.d.ts.map +1 -1
- package/dist/skill-test/index.js +1 -1
- package/dist/skill-test/index.js.map +1 -1
- package/dist/skill-test/spawn-claude.d.ts +28 -0
- package/dist/skill-test/spawn-claude.d.ts.map +1 -1
- package/dist/skill-test/spawn-claude.js +51 -2
- package/dist/skill-test/spawn-claude.js.map +1 -1
- package/dist/skill-test/transcript.d.ts +41 -2
- package/dist/skill-test/transcript.d.ts.map +1 -1
- package/dist/skill-test/transcript.js +47 -3
- package/dist/skill-test/transcript.js.map +1 -1
- package/dist/test-helpers.d.ts +185 -13
- package/dist/test-helpers.d.ts.map +1 -1
- package/dist/test-helpers.js +274 -27
- package/dist/test-helpers.js.map +1 -1
- package/dist/testing.d.ts +73 -3
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +93 -3
- package/dist/testing.js.map +1 -1
- package/dist/text-content.d.ts +197 -0
- package/dist/text-content.d.ts.map +1 -0
- package/dist/text-content.js +348 -0
- package/dist/text-content.js.map +1 -0
- package/dist/text-file.d.ts +45 -0
- package/dist/text-file.d.ts.map +1 -0
- package/dist/text-file.js +53 -0
- package/dist/text-file.js.map +1 -0
- package/dist/text.d.ts +16 -0
- package/dist/text.d.ts.map +1 -0
- package/dist/text.js +16 -0
- package/dist/text.js.map +1 -0
- package/dist/timing-dump.d.ts +136 -0
- package/dist/timing-dump.d.ts.map +1 -0
- package/dist/timing-dump.js +230 -0
- package/dist/timing-dump.js.map +1 -0
- package/eslint/README.md +105 -3
- package/eslint/index.cjs +50 -0
- package/eslint/index.d.cts +14 -4
- package/eslint/rules/no-bare-symlink-in-tests.cjs +200 -0
- package/eslint/rules/no-process-exit-in-phase.cjs +117 -0
- package/eslint/rules/no-raw-text-decode.cjs +296 -0
- package/eslint/rules/no-self-package-import.cjs +157 -0
- package/package.json +13 -8
- package/dist/link-auth/build-headers.d.ts +0 -34
- package/dist/link-auth/build-headers.d.ts.map +0 -1
- package/dist/link-auth/build-headers.js +0 -58
- package/dist/link-auth/build-headers.js.map +0 -1
- package/dist/link-auth/expand-macro.d.ts +0 -38
- package/dist/link-auth/expand-macro.d.ts.map +0 -1
- package/dist/link-auth/expand-macro.js +0 -133
- package/dist/link-auth/expand-macro.js.map +0 -1
- package/dist/link-auth/macros.yaml +0 -50
- package/dist/link-auth/resolve-token.d.ts +0 -83
- package/dist/link-auth/resolve-token.d.ts.map +0 -1
- package/dist/link-auth/resolve-token.js +0 -101
- package/dist/link-auth/resolve-token.js.map +0 -1
- package/dist/link-auth/resolve.d.ts +0 -102
- package/dist/link-auth/resolve.d.ts.map +0 -1
- package/dist/link-auth/resolve.js +0 -66
- package/dist/link-auth/resolve.js.map +0 -1
- package/dist/link-auth/rewrite.d.ts +0 -52
- package/dist/link-auth/rewrite.d.ts.map +0 -1
- package/dist/link-auth/rewrite.js +0 -102
- package/dist/link-auth/rewrite.js.map +0 -1
- package/dist/link-auth/select-provider.d.ts +0 -30
- package/dist/link-auth/select-provider.d.ts.map +0 -1
- package/dist/link-auth/select-provider.js +0 -55
- package/dist/link-auth/select-provider.js.map +0 -1
- package/dist/link-auth/template.d.ts +0 -40
- package/dist/link-auth/template.d.ts.map +0 -1
- package/dist/link-auth/template.js +0 -89
- package/dist/link-auth/template.js.map +0 -1
- package/dist/link-auth/transforms.d.ts +0 -46
- package/dist/link-auth/transforms.d.ts.map +0 -1
- package/dist/link-auth/transforms.js +0 -52
- package/dist/link-auth/transforms.js.map +0 -1
- package/dist/template-entry.d.ts +0 -10
- package/dist/template-entry.d.ts.map +0 -1
- package/dist/template-entry.js +0 -10
- package/dist/template-entry.js.map +0 -1
- package/dist/template.d.ts +0 -7
- package/dist/template.d.ts.map +0 -1
- package/dist/template.js +0 -18
- package/dist/template.js.map +0 -1
package/dist/git-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-utils.js","sourceRoot":"","sources":["../src/git-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"git-utils.js","sourceRoot":"","sources":["../src/git-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,IAAI,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;IACpC,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,OAAO,UAAU,KAAK,IAAI,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,QAAQ,KAAK,SAA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;YACD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/git.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @vibe-agent-toolkit/utils/git
|
|
3
3
|
*
|
|
4
|
-
* Git primitives for build guards and gates: root discovery,
|
|
5
|
-
* enumeration, gitignore evaluation, and git URL
|
|
6
|
-
* shells out to `git` and reads the filesystem.
|
|
4
|
+
* Git primitives for build guards and gates: command execution, root discovery,
|
|
5
|
+
* tracked-file enumeration, tree snapshots, gitignore evaluation, and git URL
|
|
6
|
+
* parsing. Node-only — shells out to `git` and reads the filesystem.
|
|
7
|
+
*
|
|
8
|
+
* This is the ONLY published route to `runGit`. `safeExecSync`/`safeExecResult`
|
|
9
|
+
* on `./process` refuse the `git` binary outright and point here, so a caller
|
|
10
|
+
* that wants git gets the scrubbed environment rather than the ambient one by
|
|
11
|
+
* construction. The scrub itself, and dirty-corrected tree snapshots, come from
|
|
12
|
+
* `@vibe-validate/git`.
|
|
7
13
|
*
|
|
8
14
|
* The re-exports below are explicit rather than `export *` on purpose. A
|
|
9
15
|
* blanket re-export surfaced TWO root finders under two names — `gitFindRoot`
|
|
@@ -16,7 +22,9 @@
|
|
|
16
22
|
* old code rather than maintain two APIs). `gitFindRoot` is the only root
|
|
17
23
|
* finder in the package.
|
|
18
24
|
*/
|
|
19
|
-
export {
|
|
25
|
+
export { runGit, runGitOrThrow, type GitRunOptions, type GitRunResult, } from './git-run.js';
|
|
26
|
+
export { gitFindRoot, gitLsFiles, gitLsOthers, isGitIgnored } from './git-utils.js';
|
|
27
|
+
export { gitTreeSnapshot, peekGitTreeSnapshot, withGitSnapshotCache, type GitSnapshotEntry, type GitTreeSnapshot, } from './git-snapshot.js';
|
|
20
28
|
export { loadGitignoreRules } from './gitignore-checker.js';
|
|
21
29
|
export { GitTracker, type GitTrackerInitOptions } from './git-tracker.js';
|
|
22
30
|
export { isGitUrl, nonInteractiveGitOverrides, parseGitUrl, type NonInteractiveGitOverrides, type ParsedGitUrl, } from './git-url.js';
|
package/dist/git.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACL,MAAM,EACN,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,WAAW,EACX,KAAK,0BAA0B,EAC/B,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC"}
|
package/dist/git.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @vibe-agent-toolkit/utils/git
|
|
3
3
|
*
|
|
4
|
-
* Git primitives for build guards and gates: root discovery,
|
|
5
|
-
* enumeration, gitignore evaluation, and git URL
|
|
6
|
-
* shells out to `git` and reads the filesystem.
|
|
4
|
+
* Git primitives for build guards and gates: command execution, root discovery,
|
|
5
|
+
* tracked-file enumeration, tree snapshots, gitignore evaluation, and git URL
|
|
6
|
+
* parsing. Node-only — shells out to `git` and reads the filesystem.
|
|
7
|
+
*
|
|
8
|
+
* This is the ONLY published route to `runGit`. `safeExecSync`/`safeExecResult`
|
|
9
|
+
* on `./process` refuse the `git` binary outright and point here, so a caller
|
|
10
|
+
* that wants git gets the scrubbed environment rather than the ambient one by
|
|
11
|
+
* construction. The scrub itself, and dirty-corrected tree snapshots, come from
|
|
12
|
+
* `@vibe-validate/git`.
|
|
7
13
|
*
|
|
8
14
|
* The re-exports below are explicit rather than `export *` on purpose. A
|
|
9
15
|
* blanket re-export surfaced TWO root finders under two names — `gitFindRoot`
|
|
@@ -16,7 +22,9 @@
|
|
|
16
22
|
* old code rather than maintain two APIs). `gitFindRoot` is the only root
|
|
17
23
|
* finder in the package.
|
|
18
24
|
*/
|
|
19
|
-
export {
|
|
25
|
+
export { runGit, runGitOrThrow, } from './git-run.js';
|
|
26
|
+
export { gitFindRoot, gitLsFiles, gitLsOthers, isGitIgnored } from './git-utils.js';
|
|
27
|
+
export { gitTreeSnapshot, peekGitTreeSnapshot, withGitSnapshotCache, } from './git-snapshot.js';
|
|
20
28
|
export { loadGitignoreRules } from './gitignore-checker.js';
|
|
21
29
|
export { GitTracker } from './git-tracker.js';
|
|
22
30
|
export { isGitUrl, nonInteractiveGitOverrides, parseGitUrl, } from './git-url.js';
|
package/dist/git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACL,MAAM,EACN,aAAa,GAGd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,GAGrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAA8B,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,WAAW,GAGZ,MAAM,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitignore-checker.d.ts","sourceRoot":"","sources":["../src/gitignore-checker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAe,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"gitignore-checker.d.ts","sourceRoot":"","sources":["../src/gitignore-checker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAe,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAK7C;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA0CnF"}
|
|
@@ -9,6 +9,7 @@ import fs from 'node:fs';
|
|
|
9
9
|
import path from 'node:path';
|
|
10
10
|
import ignore from 'ignore';
|
|
11
11
|
import { safePath, toForwardSlash } from './path-utils.js';
|
|
12
|
+
import { readTextContentSync } from './text-file.js';
|
|
12
13
|
/**
|
|
13
14
|
* Load and parse .gitignore files from git root to baseDir.
|
|
14
15
|
* Returns an ignore instance configured with all applicable .gitignore rules.
|
|
@@ -42,9 +43,11 @@ export function loadGitignoreRules(gitRoot, baseDir) {
|
|
|
42
43
|
// eslint-disable-next-line security/detect-non-literal-fs-filename -- constructed from validated gitRoot and baseDir
|
|
43
44
|
if (fs.existsSync(gitignorePath)) {
|
|
44
45
|
try {
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
// Through the decoding seam. A `.gitignore` written by PowerShell's `>`
|
|
47
|
+
// is UTF-16LE, and `readFileSync(p, 'utf-8')` would hand `ignore` a
|
|
48
|
+
// string of NUL-interleaved garbage — every pattern silently wrong, with
|
|
49
|
+
// no error anywhere.
|
|
50
|
+
ig.add(readTextContentSync(gitignorePath).text);
|
|
48
51
|
}
|
|
49
52
|
catch {
|
|
50
53
|
// Skip gitignore files we can't read
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitignore-checker.js","sourceRoot":"","sources":["../src/gitignore-checker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,MAAuB,MAAM,QAAQ,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAG,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"gitignore-checker.js","sourceRoot":"","sources":["../src/gitignore-checker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,MAAuB,MAAM,QAAQ,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAG,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe,EAAE,OAAgB;IAClE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IACpB,IAAI,QAAQ,GAAG,KAAK,CAAC;IAErB,+BAA+B;IAC/B,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACf,QAAQ,GAAG,IAAI,CAAC;IAEhB,kDAAkD;IAClD,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,IAAI,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC;IACtD,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAElD,+CAA+C;IAC/C,MAAM,iBAAiB,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;IAE1D,OAAO,cAAc,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAChE,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAChC,IAAI,UAAU,KAAK,eAAe,EAAE,CAAC;YACnC,MAAM;QACR,CAAC;QACD,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED,sDAAsD;IACtD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC9B,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QACvD,qHAAqH;QACrH,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC;gBACH,wEAAwE;gBACxE,oEAAoE;gBACpE,yEAAyE;gBACzE,qBAAqB;gBACrB,EAAE,CAAC,GAAG,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC;YAClD,CAAC;YAAC,MAAM,CAAC;gBACP,qCAAqC;YACvC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,33 +3,39 @@
|
|
|
3
3
|
* Core shared utilities with no dependencies on other packages
|
|
4
4
|
*
|
|
5
5
|
* Utilities are added as needed by other packages, not speculatively.
|
|
6
|
+
*
|
|
7
|
+
* **A module that brings a third-party dependency belongs on a subpath, not
|
|
8
|
+
* here.** This entry has ~245 in-repo importers plus published adopters, and
|
|
9
|
+
* every one of them pays for the whole graph reachable from it — a bundler that
|
|
10
|
+
* cannot tree-shake a dependency (a CJS package, or one reached through
|
|
11
|
+
* `new URL(..., import.meta.url)`) inlines it into every consumer that touched
|
|
12
|
+
* a path helper. The domains that carry weight each have their own entry:
|
|
13
|
+
* `./crawl`, `./git`, `./process`, `./skill-test`, `./template`, `./yaml`.
|
|
14
|
+
* `./skill-test` is there for a *transitive* reason rather than a direct one —
|
|
15
|
+
* it declares no dependency itself, but spawning a headless agent goes through
|
|
16
|
+
* `./process`, which reaches `which` and (because `safeExecSync` refuses `git`
|
|
17
|
+
* and delegates) `@vibe-validate/git`. Reachability is the criterion, not the
|
|
18
|
+
* import a module happens to write.
|
|
19
|
+
*
|
|
20
|
+
* The rule is enforced, not merely stated: `test/subpath-purity.test.ts` asserts
|
|
21
|
+
* this entry's reachable third-party set by equality, so a dependency arriving
|
|
22
|
+
* here — directly or transitively, through any module below — turns that row red
|
|
23
|
+
* and has to be an argued edit rather than an unnoticed one.
|
|
6
24
|
*/
|
|
7
|
-
export * from './safe-exec.js';
|
|
8
|
-
export * from './windows-shell.js';
|
|
9
|
-
export * from './spawn-hardened.js';
|
|
10
25
|
export * from './path-utils.js';
|
|
11
|
-
export * from './
|
|
26
|
+
export * from './text-content.js';
|
|
27
|
+
export * from './text-file.js';
|
|
12
28
|
export * from './asset-reference.js';
|
|
13
|
-
export { classifyFilenameCaseFrom, copyDirectory, fillRealpaths, fillSiblingNames, FsLookupCache, realpathFrom, } from './fs-utils.js';
|
|
29
|
+
export { classifyFilenameCaseFrom, copyDirectory, fillRealpaths, fillSiblingNames, FsLookupCache, isFilesystemAccessError, realpathFrom, } from './fs-utils.js';
|
|
14
30
|
export type { FilenameCaseVerdict, FilenameMatch, PathProbe, PathProbeStats, RealpathTable, SiblingNamesTable, } from './fs-utils.js';
|
|
15
|
-
export * from './file-crawler.js';
|
|
16
|
-
export * from './gitignore-checker.js';
|
|
17
|
-
export * from './git-url.js';
|
|
18
|
-
export * from './git-utils.js';
|
|
19
31
|
export * from './project-utils.js';
|
|
20
|
-
export * from './git-tracker.js';
|
|
21
32
|
export * from './test-helpers.js';
|
|
22
33
|
export * from './zod-introspection.js';
|
|
23
|
-
export * from './template.js';
|
|
24
34
|
export * from './skill-targets.js';
|
|
25
|
-
export { type LinkAuthConfig, type Provider, type ProviderAuth, type ProviderCheck, resolveAuthenticatedUrl, type ResolveOutcome, } from './link-auth/resolve.js';
|
|
26
|
-
export type { ProviderMatch } from './link-auth/select-provider.js';
|
|
27
|
-
export type { RewriteRule } from './link-auth/rewrite.js';
|
|
28
|
-
export { defaultRunCommand, type TokenSource } from './link-auth/resolve-token.js';
|
|
29
|
-
export { expandMacro, UnknownMacroError } from './link-auth/expand-macro.js';
|
|
30
|
-
export * from './skill-test/index.js';
|
|
31
35
|
export * from './glob/glob-pattern.js';
|
|
32
36
|
export * from './fs/file-hash.js';
|
|
33
|
-
export * from './yaml/surgical-yaml.js';
|
|
34
37
|
export { parseWholeNumberAtLeast } from './numeric-args.js';
|
|
38
|
+
export { compareCodeUnits } from './compare-code-units.js';
|
|
39
|
+
export { CRAWL_BLOB_POPULATE_ID, CRAWL_CLOSURE_CONTRIBUTE_ID, CRAWL_CLOSURE_RESOLVE_ID, CRAWL_PASS_INSIDE, CRAWL_REGISTRY_ADMIT_ID, CRAWL_REGISTRY_ENUMERATE_ID, CRAWL_REGISTRY_ID_PREFIX, CRAWL_REGISTRY_RESOLVE_LINKS_ID, CRAWL_SHARED_GIT_TRACKER_ID, CRAWL_STORE_READ_ID, CRAWL_STORE_WRITE_ID, CRAWL_STRATA, CRAWL_WALKER_GITIGNORE_ID, CRAWL_WALKER_ID, crawlTimingStart, recordContributorInvocation, recordCrawlPass, recordRegistryPass, recordSharedPass, withContributorStratum, withOuterBracket, type CrawlDriverStratum, type CrawlStratum, type CrawlTimingDump, type CrawlTimingEntry, type CrawlTimingProcess, __readCrawlTimingSnapshot, __setCrawlTimingForTest, __writeCrawlTimingDumpForTest, } from './crawl-timing.js';
|
|
40
|
+
export { ensureTimingDirectory, normalizeTimingDirectory, readTimingProcess, type TimingProcess, writeTimingDump, } from './timing-dump.js';
|
|
35
41
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,cAAc,iBAAiB,CAAC;AAShC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAG/B,cAAc,sBAAsB,CAAC;AAqCrC,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,uBAAuB,EACvB,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EACb,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAIvB,cAAc,oBAAoB,CAAC;AAGnC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAgB3D,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,uBAAuB,EACvB,2BAA2B,EAC3B,wBAAwB,EACxB,+BAA+B,EAC/B,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,KAAK,aAAa,EAClB,eAAe,GAChB,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,17 +3,36 @@
|
|
|
3
3
|
* Core shared utilities with no dependencies on other packages
|
|
4
4
|
*
|
|
5
5
|
* Utilities are added as needed by other packages, not speculatively.
|
|
6
|
+
*
|
|
7
|
+
* **A module that brings a third-party dependency belongs on a subpath, not
|
|
8
|
+
* here.** This entry has ~245 in-repo importers plus published adopters, and
|
|
9
|
+
* every one of them pays for the whole graph reachable from it — a bundler that
|
|
10
|
+
* cannot tree-shake a dependency (a CJS package, or one reached through
|
|
11
|
+
* `new URL(..., import.meta.url)`) inlines it into every consumer that touched
|
|
12
|
+
* a path helper. The domains that carry weight each have their own entry:
|
|
13
|
+
* `./crawl`, `./git`, `./process`, `./skill-test`, `./template`, `./yaml`.
|
|
14
|
+
* `./skill-test` is there for a *transitive* reason rather than a direct one —
|
|
15
|
+
* it declares no dependency itself, but spawning a headless agent goes through
|
|
16
|
+
* `./process`, which reaches `which` and (because `safeExecSync` refuses `git`
|
|
17
|
+
* and delegates) `@vibe-validate/git`. Reachability is the criterion, not the
|
|
18
|
+
* import a module happens to write.
|
|
19
|
+
*
|
|
20
|
+
* The rule is enforced, not merely stated: `test/subpath-purity.test.ts` asserts
|
|
21
|
+
* this entry's reachable third-party set by equality, so a dependency arriving
|
|
22
|
+
* here — directly or transitively, through any module below — turns that row red
|
|
23
|
+
* and has to be an argued edit rather than an unnoticed one.
|
|
6
24
|
*/
|
|
7
|
-
// Safe command execution (cross-platform, no shell injection)
|
|
8
|
-
export * from './safe-exec.js';
|
|
9
|
-
// Windows shell-invocation helpers (.cmd/.bat/.ps1 handling), shared by every spawn wrapper
|
|
10
|
-
export * from './windows-shell.js';
|
|
11
|
-
// Hardened async spawn (streaming stdio + correct Windows .cmd/.bat launching)
|
|
12
|
-
export * from './spawn-hardened.js';
|
|
13
25
|
// Cross-platform path utilities
|
|
14
26
|
export * from './path-utils.js';
|
|
15
|
-
//
|
|
16
|
-
|
|
27
|
+
// THE content-decoding seam: bytes to text, in one place. `decodeTextContent` is
|
|
28
|
+
// pure and also reachable from the dependency-free `./text` entry; the two
|
|
29
|
+
// file-reading wrappers need `node:fs` and are also on `./fs`. Other routes from
|
|
30
|
+
// bytes to text — `buf.toString('utf-8')`, `new TextDecoder()`,
|
|
31
|
+
// `readFile(p, 'utf-8')` — are a lint error under `local/no-raw-text-decode`
|
|
32
|
+
// WHERE IT IS REGISTERED (this package's `src` and `resources`' `src`); the rest
|
|
33
|
+
// of the repo is a migration ledger in `eslint.config.js`, not a covered claim.
|
|
34
|
+
export * from './text-content.js';
|
|
35
|
+
export * from './text-file.js';
|
|
17
36
|
// Asset reference resolution (paths + npm bare specifiers)
|
|
18
37
|
export * from './asset-reference.js';
|
|
19
38
|
// Filesystem utilities.
|
|
@@ -51,40 +70,40 @@ export * from './asset-reference.js';
|
|
|
51
70
|
// `barrel-exports.test.ts` pins runtime names only, so nothing will fail. The
|
|
52
71
|
// symptom is a type that cannot be imported, which surfaces the first time
|
|
53
72
|
// someone tries — not a silent break in existing code.
|
|
54
|
-
export { classifyFilenameCaseFrom, copyDirectory, fillRealpaths, fillSiblingNames, FsLookupCache, realpathFrom, } from './fs-utils.js';
|
|
55
|
-
// Directory crawling with glob patterns
|
|
56
|
-
export * from './file-crawler.js';
|
|
57
|
-
// Git ignore checking
|
|
58
|
-
export * from './gitignore-checker.js';
|
|
59
|
-
// Git URL parsing (parse/detect git URLs, GitHub shorthand, SSH forms)
|
|
60
|
-
export * from './git-url.js';
|
|
61
|
-
// Git utilities (using git commands directly)
|
|
62
|
-
export * from './git-utils.js';
|
|
73
|
+
export { classifyFilenameCaseFrom, copyDirectory, fillRealpaths, fillSiblingNames, FsLookupCache, isFilesystemAccessError, realpathFrom, } from './fs-utils.js';
|
|
63
74
|
// Project root discovery (canonical: config → git → null).
|
|
64
75
|
// CLI-boundary use only — see docs/concepts/roots-and-config.md.
|
|
65
76
|
export * from './project-utils.js';
|
|
66
|
-
// Git tracking cache (for efficient git-ignore checking)
|
|
67
|
-
export * from './git-tracker.js';
|
|
68
77
|
// Test helpers for isolated test output directories
|
|
69
78
|
export * from './test-helpers.js';
|
|
70
79
|
// Zod type introspection (version-agnostic)
|
|
71
80
|
export * from './zod-introspection.js';
|
|
72
|
-
// Handlebars template rendering (cached, no HTML escaping)
|
|
73
|
-
export * from './template.js';
|
|
74
81
|
// Skill target resolution (cross-platform flat skill install paths)
|
|
75
82
|
export * from './skill-targets.js';
|
|
76
|
-
// linkAuth pure engine — public API only (issue #113).
|
|
77
|
-
// Internal helpers (rewrite, build-headers, etc.) stay module-private.
|
|
78
|
-
export { resolveAuthenticatedUrl, } from './link-auth/resolve.js';
|
|
79
|
-
export { defaultRunCommand } from './link-auth/resolve-token.js';
|
|
80
|
-
export { expandMacro, UnknownMacroError } from './link-auth/expand-macro.js';
|
|
81
|
-
// Skill testing utilities (environment management for headless agent runs)
|
|
82
|
-
export * from './skill-test/index.js';
|
|
83
83
|
// Glob pattern helpers (isGlob, staticGlobBase, globMagicRemainder)
|
|
84
84
|
export * from './glob/glob-pattern.js';
|
|
85
85
|
// Filesystem hashing (sha256 of raw file bytes)
|
|
86
86
|
export * from './fs/file-hash.js';
|
|
87
|
-
// Byte-surgical YAML value updater (replace/insert without reflowing the doc)
|
|
88
|
-
export * from './yaml/surgical-yaml.js';
|
|
89
87
|
export { parseWholeNumberAtLeast } from './numeric-args.js';
|
|
88
|
+
// Machine-independent string ordering for hashed/serialized output — never `localeCompare`.
|
|
89
|
+
export { compareCodeUnits } from './compare-code-units.js';
|
|
90
|
+
// The crawl-timing seam: which contributor, stratum and fixpoint pass owns the
|
|
91
|
+
// time it takes to FIND documents.
|
|
92
|
+
//
|
|
93
|
+
// It lives HERE, at the bottom of the graph, because the work it measures is
|
|
94
|
+
// spread across four packages above this one — `resources` builds the registry,
|
|
95
|
+
// `agent-skills` walks the link graph, `claude-marketplace` enumerates an
|
|
96
|
+
// inventory, and `utils` itself initializes the `GitTracker` both crawlers
|
|
97
|
+
// consume. Both arms must record through ONE recorder or the two are not
|
|
98
|
+
// comparable, and only `utils` is beneath all of them. See the module header.
|
|
99
|
+
//
|
|
100
|
+
// Named rather than `export *`: the accumulator internals (`addEntry`,
|
|
101
|
+
// `keyOf`, `recordInheritedPass`) are not surface, and `timing-dump.ts` is
|
|
102
|
+
// plumbing shared with `resources`' package-internal `parse-timing.ts` — a star
|
|
103
|
+
// re-export would publish both the moment either grew a symbol.
|
|
104
|
+
export { CRAWL_BLOB_POPULATE_ID, CRAWL_CLOSURE_CONTRIBUTE_ID, CRAWL_CLOSURE_RESOLVE_ID, CRAWL_PASS_INSIDE, CRAWL_REGISTRY_ADMIT_ID, CRAWL_REGISTRY_ENUMERATE_ID, CRAWL_REGISTRY_ID_PREFIX, CRAWL_REGISTRY_RESOLVE_LINKS_ID, CRAWL_SHARED_GIT_TRACKER_ID, CRAWL_STORE_READ_ID, CRAWL_STORE_WRITE_ID, CRAWL_STRATA, CRAWL_WALKER_GITIGNORE_ID, CRAWL_WALKER_ID, crawlTimingStart, recordContributorInvocation, recordCrawlPass, recordRegistryPass, recordSharedPass, withContributorStratum, withOuterBracket, __readCrawlTimingSnapshot, __setCrawlTimingForTest, __writeCrawlTimingDumpForTest, } from './crawl-timing.js';
|
|
105
|
+
// The on-disk plumbing both timing seams share. Exported because
|
|
106
|
+
// `resources`' `parse-timing.ts` is the other consumer and now sits a package
|
|
107
|
+
// away; nothing else should reach for it.
|
|
108
|
+
export { ensureTimingDirectory, normalizeTimingDirectory, readTimingProcess, writeTimingDump, } from './timing-dump.js';
|
|
90
109
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,gCAAgC;AAChC,cAAc,iBAAiB,CAAC;AAEhC,iFAAiF;AACjF,2EAA2E;AAC3E,iFAAiF;AACjF,gEAAgE;AAChE,6EAA6E;AAC7E,iFAAiF;AACjF,gFAAgF;AAChF,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAE/B,2DAA2D;AAC3D,cAAc,sBAAsB,CAAC;AAErC,wBAAwB;AACxB,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,8EAA8E;AAC9E,iFAAiF;AACjF,+EAA+E;AAC/E,oEAAoE;AACpE,EAAE;AACF,6EAA6E;AAC7E,EAAE;AACF,8EAA8E;AAC9E,iFAAiF;AACjF,iFAAiF;AACjF,wEAAwE;AACxE,gFAAgF;AAChF,kFAAkF;AAClF,yDAAyD;AACzD,EAAE;AACF,iFAAiF;AACjF,kFAAkF;AAClF,yBAAyB;AACzB,EAAE;AACF,kFAAkF;AAClF,gFAAgF;AAChF,iFAAiF;AACjF,+EAA+E;AAC/E,+EAA+E;AAC/E,8BAA8B;AAC9B,EAAE;AACF,gFAAgF;AAChF,kEAAkE;AAClE,8EAA8E;AAC9E,2EAA2E;AAC3E,uDAAuD;AACvD,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,uBAAuB,EACvB,YAAY,GACb,MAAM,eAAe,CAAC;AAUvB,2DAA2D;AAC3D,iEAAiE;AACjE,cAAc,oBAAoB,CAAC;AAEnC,oDAAoD;AACpD,cAAc,mBAAmB,CAAC;AAElC,4CAA4C;AAC5C,cAAc,wBAAwB,CAAC;AAEvC,oEAAoE;AACpE,cAAc,oBAAoB,CAAC;AAEnC,oEAAoE;AACpE,cAAc,wBAAwB,CAAC;AAEvC,gDAAgD;AAChD,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,4FAA4F;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,+EAA+E;AAC/E,mCAAmC;AACnC,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,0EAA0E;AAC1E,2EAA2E;AAC3E,yEAAyE;AACzE,8EAA8E;AAC9E,EAAE;AACF,uEAAuE;AACvE,2EAA2E;AAC3E,gFAAgF;AAChF,gEAAgE;AAChE,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,uBAAuB,EACvB,2BAA2B,EAC3B,wBAAwB,EACxB,+BAA+B,EAC/B,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAMhB,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,mBAAmB,CAAC;AAE3B,iEAAiE;AACjE,8EAA8E;AAC9E,0CAA0C;AAC1C,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EAEjB,eAAe,GAChB,MAAM,kBAAkB,CAAC"}
|
package/dist/path-core.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export declare function hasParentTraversalSegment(p: string): boolean;
|
|
|
62
62
|
*
|
|
63
63
|
* This is the ONE relativizer every VAT validation lane uses. `location` is
|
|
64
64
|
* contractually project-relative (see `ValidationIssue` in
|
|
65
|
-
* `@vibe-agent-toolkit/
|
|
65
|
+
* `@vibe-agent-toolkit/schema`), so producers must route through here
|
|
66
66
|
* rather than emitting `skillPath` directly — absolute locations leak the
|
|
67
67
|
* developer's home directory into CI logs and make `validation.allow` globs,
|
|
68
68
|
* which match against `location`, unwritable.
|
package/dist/path-core.js
CHANGED
|
@@ -69,7 +69,7 @@ export function hasParentTraversalSegment(p) {
|
|
|
69
69
|
*
|
|
70
70
|
* This is the ONE relativizer every VAT validation lane uses. `location` is
|
|
71
71
|
* contractually project-relative (see `ValidationIssue` in
|
|
72
|
-
* `@vibe-agent-toolkit/
|
|
72
|
+
* `@vibe-agent-toolkit/schema`), so producers must route through here
|
|
73
73
|
* rather than emitting `skillPath` directly — absolute locations leak the
|
|
74
74
|
* developer's home directory into CI logs and make `validation.allow` globs,
|
|
75
75
|
* which match against `location`, unwritable.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-utils.d.ts","sourceRoot":"","sources":["../src/project-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"project-utils.d.ts","sourceRoot":"","sources":["../src/project-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAY9D;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqBrE;AAgBD;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAG7C;AAoED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK/D"}
|
package/dist/project-utils.js
CHANGED
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
* fallbacks — a caller with no root must decide one rather than silently
|
|
7
7
|
* falling back to an absolute path.
|
|
8
8
|
*/
|
|
9
|
-
import { existsSync
|
|
9
|
+
import { existsSync } from 'node:fs';
|
|
10
10
|
import { dirname, parse } from 'node:path';
|
|
11
11
|
import { resetGitRootCache } from './git-root-cache.js';
|
|
12
12
|
import { safePath } from './path-utils.js';
|
|
13
|
+
import { readTextContentSync } from './text-file.js';
|
|
13
14
|
const CONFIG_FILENAME = 'vibe-agent-toolkit.config.yaml';
|
|
14
15
|
const PACKAGE_JSON_FILENAME = 'package.json';
|
|
15
16
|
/**
|
|
@@ -54,8 +55,10 @@ export function findNodeWorkspaceRoot(startDir) {
|
|
|
54
55
|
// eslint-disable-next-line security/detect-non-literal-fs-filename -- walk-up is intentional
|
|
55
56
|
if (existsSync(pkgPath)) {
|
|
56
57
|
try {
|
|
57
|
-
//
|
|
58
|
-
|
|
58
|
+
// Through the decoding seam: this is the ADOPTER's manifest, not ours,
|
|
59
|
+
// and a UTF-8 BOM in front of `{` makes `JSON.parse` throw — which the
|
|
60
|
+
// `catch` below would silently report as "not the workspace root".
|
|
61
|
+
const parsed = JSON.parse(readTextContentSync(pkgPath).text);
|
|
59
62
|
if (typeof parsed === 'object' && parsed !== null && 'workspaces' in parsed) {
|
|
60
63
|
return current;
|
|
61
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-utils.js","sourceRoot":"","sources":["../src/project-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"project-utils.js","sourceRoot":"","sources":["../src/project-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,eAAe,GA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,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC"}
|
package/dist/project.d.ts
CHANGED
|
@@ -14,11 +14,13 @@
|
|
|
14
14
|
* they largely are not, for the reasons documented on the guard test in
|
|
15
15
|
* `test/package-exports.test.ts`. But the question that decides whether an entry
|
|
16
16
|
* should exist is "how heavy is the only remaining door?" With `./project` gone,
|
|
17
|
-
* the sole route to these functions was the `.` barrel, which
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
17
|
+
* the sole route to these functions was the `.` barrel, which at the time reached
|
|
18
|
+
* five third-party packages. A consumer that avoids the barrel on graph-weight
|
|
19
|
+
* grounds — which is the entire premise of this package's subpath layout — could
|
|
20
|
+
* no longer reach a capability whose own code imports nothing but `node:fs` and
|
|
21
|
+
* `node:path`. The barrel is dependency-free today, which generalizes the
|
|
22
|
+
* argument rather than retiring it: every domain that carries weight is its own
|
|
23
|
+
* entry, and reaching a pure one must not cost a neighbour's graph.
|
|
22
24
|
*
|
|
23
25
|
* The functions remain VAT-shaped and are documented as such in README.md: they
|
|
24
26
|
* look for `vibe-agent-toolkit.config.yaml`, then `.git/`. If your notion of a
|
package/dist/project.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,sBAAsB,GACvB,MAAM,oBAAoB,CAAC"}
|
package/dist/project.js
CHANGED
|
@@ -14,11 +14,13 @@
|
|
|
14
14
|
* they largely are not, for the reasons documented on the guard test in
|
|
15
15
|
* `test/package-exports.test.ts`. But the question that decides whether an entry
|
|
16
16
|
* should exist is "how heavy is the only remaining door?" With `./project` gone,
|
|
17
|
-
* the sole route to these functions was the `.` barrel, which
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
17
|
+
* the sole route to these functions was the `.` barrel, which at the time reached
|
|
18
|
+
* five third-party packages. A consumer that avoids the barrel on graph-weight
|
|
19
|
+
* grounds — which is the entire premise of this package's subpath layout — could
|
|
20
|
+
* no longer reach a capability whose own code imports nothing but `node:fs` and
|
|
21
|
+
* `node:path`. The barrel is dependency-free today, which generalizes the
|
|
22
|
+
* argument rather than retiring it: every domain that carries weight is its own
|
|
23
|
+
* entry, and reaching a pure one must not cost a neighbour's graph.
|
|
22
24
|
*
|
|
23
25
|
* The functions remain VAT-shaped and are documented as such in README.md: they
|
|
24
26
|
* look for `vibe-agent-toolkit.config.yaml`, then `.git/`. If your notion of a
|
package/dist/project.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,sBAAsB,GACvB,MAAM,oBAAoB,CAAC"}
|
package/dist/safe-exec.d.ts
CHANGED
|
@@ -6,7 +6,12 @@ export interface SafeExecOptions {
|
|
|
6
6
|
encoding?: BufferEncoding;
|
|
7
7
|
/** Standard I/O configuration */
|
|
8
8
|
stdio?: 'pipe' | 'ignore' | 'inherit' | Array<'pipe' | 'ignore' | 'inherit'>;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* The child's complete environment. It **replaces** `process.env` rather than
|
|
11
|
+
* merging with it, so a partial object is a partial environment — build one
|
|
12
|
+
* by spreading (`{ ...process.env, ... }`). A `git` child cannot get here at
|
|
13
|
+
* all — `runGit()` owns that, and this function refuses it.
|
|
14
|
+
*/
|
|
10
15
|
env?: NodeJS.ProcessEnv;
|
|
11
16
|
/** Working directory */
|
|
12
17
|
cwd?: string;
|
|
@@ -14,6 +19,24 @@ export interface SafeExecOptions {
|
|
|
14
19
|
maxBuffer?: number;
|
|
15
20
|
/** Timeout in milliseconds */
|
|
16
21
|
timeout?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Run `git` here instead of refusing it — for an argv the **operator supplied**
|
|
24
|
+
* rather than one VAT composed.
|
|
25
|
+
*
|
|
26
|
+
* {@link refuseGit} exists because only the caller knows whether a git command
|
|
27
|
+
* means the path it was handed or the repository it stands in, and VAT's own
|
|
28
|
+
* call sites must say. That reasoning does not reach a command a user
|
|
29
|
+
* configured: VAT neither composed it nor knows what it means, and refusing it
|
|
30
|
+
* blocks a legitimate configuration rather than preventing a mistake.
|
|
31
|
+
*
|
|
32
|
+
* ⚠️ Setting this makes the git environment **your** problem. The one caller
|
|
33
|
+
* that does — `link-auth`'s `defaultRunCommand` — strips every `GIT_*` key
|
|
34
|
+
* case-insensitively before spawning, which is stricter than {@link runGit}'s
|
|
35
|
+
* targeted scrub, not looser. Do not set it to silence the error.
|
|
36
|
+
*
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
allowGit?: boolean;
|
|
17
40
|
}
|
|
18
41
|
/**
|
|
19
42
|
* Result of a safe command execution
|
|
@@ -46,7 +69,11 @@ export declare class CommandExecutionError extends Error {
|
|
|
46
69
|
* - Resolves PATH once using pure Node.js (which package)
|
|
47
70
|
* - Executes with absolute path and shell: false
|
|
48
71
|
* - No shell interpreter = no command injection risk
|
|
49
|
-
* - Supports custom env vars
|
|
72
|
+
* - Supports custom env vars
|
|
73
|
+
*
|
|
74
|
+
* ⛔ **Not for `git`** — it throws. "Safe" here means shell-injection-safe and
|
|
75
|
+
* says nothing about `GIT_DIR`/`GIT_INDEX_FILE`, which silently decide which
|
|
76
|
+
* repository a git command answers about. Use `runGit()`.
|
|
50
77
|
*
|
|
51
78
|
* @param command - Command name (e.g., 'git', 'gitleaks', 'node')
|
|
52
79
|
* @param args - Array of arguments
|
|
@@ -59,14 +86,11 @@ export declare class CommandExecutionError extends Error {
|
|
|
59
86
|
* safeExecSync('gitleaks', ['--version'], { stdio: 'ignore' });
|
|
60
87
|
*
|
|
61
88
|
* @example
|
|
62
|
-
* // Git with custom env
|
|
63
|
-
* safeExecSync('git', ['add', '--all'], {
|
|
64
|
-
* env: { ...process.env, GIT_INDEX_FILE: tempFile }
|
|
65
|
-
* });
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
89
|
* // Get output as string
|
|
69
90
|
* const version = safeExecSync('node', ['--version'], { encoding: 'utf8' });
|
|
91
|
+
*
|
|
92
|
+
* @throws {Error} When `command` is git — use `runGit()` instead, which owns the
|
|
93
|
+
* inherited-environment problem this helper cannot see
|
|
70
94
|
*/
|
|
71
95
|
export declare function safeExecSync(command: string, args?: string[], options?: SafeExecOptions): Buffer | string;
|
|
72
96
|
/**
|
|
@@ -81,12 +105,14 @@ export declare function safeExecSync(command: string, args?: string[], options?:
|
|
|
81
105
|
* @returns Detailed execution result
|
|
82
106
|
*
|
|
83
107
|
* @example
|
|
84
|
-
* const result = safeExecResult('
|
|
108
|
+
* const result = safeExecResult('gh', ['pr', 'list']);
|
|
85
109
|
* if (result.success) {
|
|
86
110
|
* console.log(result.stdout.toString());
|
|
87
111
|
* } else {
|
|
88
112
|
* console.error(`Failed: ${result.stderr.toString()}`);
|
|
89
113
|
* }
|
|
114
|
+
*
|
|
115
|
+
* @throws {Error} When `command` is git — use `runGit()` instead
|
|
90
116
|
*/
|
|
91
117
|
export declare function safeExecResult(command: string, args?: string[], options?: SafeExecOptions): SafeExecResult;
|
|
92
118
|
/**
|
|
@@ -183,9 +209,11 @@ export declare function hasShellSyntax(commandString: string): {
|
|
|
183
209
|
* @example
|
|
184
210
|
* ```typescript
|
|
185
211
|
* // ✅ Simple commands (these work)
|
|
186
|
-
* safeExecFromString('git status');
|
|
187
212
|
* safeExecFromString('pnpm test --watch');
|
|
188
213
|
* safeExecFromString('gh pr view 123');
|
|
214
|
+
*
|
|
215
|
+
* // ❌ git is refused here too — the string form is not a back door around
|
|
216
|
+
* // the chokepoint. Use runGit(['status'], { cwd }).
|
|
189
217
|
* ```
|
|
190
218
|
*
|
|
191
219
|
* @example
|
package/dist/safe-exec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-exec.d.ts","sourceRoot":"","sources":["../src/safe-exec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"safe-exec.d.ts","sourceRoot":"","sources":["../src/safe-exec.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC,CAAC;IAC7E;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,wBAAwB;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,OAAO,EAAE,OAAO,CAAC;IACjB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,qBAAqB;IACrB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,KAAK,CA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