@lobu/connector-sdk 7.1.0 → 8.0.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/connector-runtime.d.ts +10 -2
- package/dist/connector-runtime.d.ts.map +1 -1
- package/dist/connector-runtime.js +21 -1
- package/dist/connector-runtime.js.map +1 -1
- package/dist/connector-types.d.ts +0 -6
- package/dist/connector-types.d.ts.map +1 -1
- package/dist/connector-types.js +0 -7
- package/dist/connector-types.js.map +1 -1
- package/dist/file-source.d.ts +112 -0
- package/dist/file-source.d.ts.map +1 -0
- package/dist/file-source.js +40 -0
- package/dist/file-source.js.map +1 -0
- package/dist/index.d.ts +12 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/sources/cache.d.ts +82 -0
- package/dist/sources/cache.d.ts.map +1 -0
- package/dist/sources/cache.js +169 -0
- package/dist/sources/cache.js.map +1 -0
- package/dist/sources/git-file-source.d.ts +33 -0
- package/dist/sources/git-file-source.d.ts.map +1 -0
- package/dist/sources/git-file-source.js +207 -0
- package/dist/sources/git-file-source.js.map +1 -0
- package/dist/sources/git-http.d.ts +48 -0
- package/dist/sources/git-http.d.ts.map +1 -0
- package/dist/sources/git-http.js +179 -0
- package/dist/sources/git-http.js.map +1 -0
- package/dist/sources/git-snapshot.d.ts +14 -0
- package/dist/sources/git-snapshot.d.ts.map +1 -0
- package/dist/sources/git-snapshot.js +96 -0
- package/dist/sources/git-snapshot.js.map +1 -0
- package/dist/sources/glob.d.ts +31 -0
- package/dist/sources/glob.d.ts.map +1 -0
- package/dist/sources/glob.js +129 -0
- package/dist/sources/glob.js.map +1 -0
- package/dist/sources/local-file-source.d.ts +29 -0
- package/dist/sources/local-file-source.d.ts.map +1 -0
- package/dist/sources/local-file-source.js +343 -0
- package/dist/sources/local-file-source.js.map +1 -0
- package/dist/sources/resolver.d.ts +6 -0
- package/dist/sources/resolver.d.ts.map +1 -0
- package/dist/sources/resolver.js +47 -0
- package/dist/sources/resolver.js.map +1 -0
- package/dist/sources/snapshot.d.ts +19 -0
- package/dist/sources/snapshot.d.ts.map +1 -0
- package/dist/sources/snapshot.js +91 -0
- package/dist/sources/snapshot.js.map +1 -0
- package/dist/sources/tarball-file-source.d.ts +28 -0
- package/dist/sources/tarball-file-source.d.ts.map +1 -0
- package/dist/sources/tarball-file-source.js +273 -0
- package/dist/sources/tarball-file-source.js.map +1 -0
- package/dist/types.d.ts +3 -65
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -3
- package/dist/event-taxonomy.d.ts +0 -3
- package/dist/event-taxonomy.d.ts.map +0 -1
- package/dist/event-taxonomy.js +0 -30
- package/dist/event-taxonomy.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-http.js","sourceRoot":"","sources":["../../src/sources/git-http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAkBvC,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB,KAAK,UAAU,YAAY,CACzB,IAAiE;IAEjE,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,IAAI,YAAY,UAAU;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CA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;QACnE,iDAAiD;QACjD,IAAI,UAAU,GAAG,GAAG,CAAC,MAAM,IAAI,KAAK,CAAC;QACrC,IAAI,QAAQ,GAAuB,YAAY,CAAC;QAChD,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;YACvD,IAAI,UAAU,KAAK,KAAK,IAAI,UAAU,KAAK,MAAM,EAAE,CAAC;gBAClD,UAAU,GAAG,KAAK,CAAC;gBACnB,QAAQ,GAAG,SAAS,CAAC;YACvB,CAAC;QACH,CAAC;QACD,GAAG,GAAG;YACJ,GAAG,EAAE,OAAO;YACZ,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE;YACnC,IAAI,EAAE,QAAQ;SACf,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,uCAAuC,aAAa,SAAS,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;AAC1F,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;AAE9D,yEAAyE;AACzE,qEAAqE;AACrE,KAAK,QAAQ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type nodeFsType from 'node:fs';
|
|
2
|
+
import type { Snapshot } from '../file-source.js';
|
|
3
|
+
export interface GitSnapshotOptions {
|
|
4
|
+
exclude?: (relativePath: string) => boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare class GitSnapshot implements Snapshot {
|
|
7
|
+
#private;
|
|
8
|
+
readonly ref: string;
|
|
9
|
+
constructor(dir: string, ref: string, fs: typeof nodeFsType, options?: GitSnapshotOptions);
|
|
10
|
+
walkFiles(glob: string): AsyncIterable<string>;
|
|
11
|
+
readFile(relativePath: string): Promise<Buffer>;
|
|
12
|
+
readText(relativePath: string): Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=git-snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-snapshot.d.ts","sourceRoot":"","sources":["../../src/sources/git-snapshot.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,UAAU,MAAM,SAAS,CAAC;AAEtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC;CAC7C;AAED,qBAAa,WAAY,YAAW,QAAQ;;IAC1C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;gBAMnB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,OAAO,UAAU,EACrB,OAAO,GAAE,kBAAuB;IAQ3B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;IAsB/C,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAW/C,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAuBtD"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitSnapshot — Snapshot backed by an immutable git commit OID.
|
|
3
|
+
*
|
|
4
|
+
* Unlike `DirectorySnapshot`, this snapshot reads file contents via
|
|
5
|
+
* `git.readBlob({oid, filepath})` against the captured commit, NOT from
|
|
6
|
+
* the on-disk working tree. That gives us true immutability: a later
|
|
7
|
+
* `fetch()` may move HEAD or rewrite the working tree, but blob OIDs for
|
|
8
|
+
* the captured commit stay reachable in the shallow clone's object DB.
|
|
9
|
+
*
|
|
10
|
+
* Caveats:
|
|
11
|
+
* - `walkFiles` walks the captured commit's tree (`git.walk` with a single
|
|
12
|
+
* `TREE({ref})`). Result: files-as-they-existed-at-the-commit, not
|
|
13
|
+
* files-as-they-are-on-disk-right-now.
|
|
14
|
+
* - `readFile` / `readText` extract blob bytes from the object DB.
|
|
15
|
+
* - Path-security primitives mirror `DirectorySnapshot` lexically (absolute
|
|
16
|
+
* paths rejected, `..` escapes rejected, exclude predicate enforced).
|
|
17
|
+
* - No realpath/symlink defense — git's object model has no symlinks-as-
|
|
18
|
+
* filesystem-pointers. A blob with mode 120000 IS the link contents, not
|
|
19
|
+
* a follow-able pointer.
|
|
20
|
+
*/
|
|
21
|
+
import * as git from 'isomorphic-git';
|
|
22
|
+
import { isAbsolute, join, normalize, relative, sep } from 'node:path';
|
|
23
|
+
import { matchesGlob } from './glob.js';
|
|
24
|
+
export class GitSnapshot {
|
|
25
|
+
ref;
|
|
26
|
+
#dir;
|
|
27
|
+
#fs;
|
|
28
|
+
#exclude;
|
|
29
|
+
constructor(dir, ref, fs, options = {}) {
|
|
30
|
+
this.#dir = dir;
|
|
31
|
+
this.ref = ref;
|
|
32
|
+
this.#fs = fs;
|
|
33
|
+
this.#exclude = options.exclude ?? (() => false);
|
|
34
|
+
}
|
|
35
|
+
async *walkFiles(glob) {
|
|
36
|
+
const collected = [];
|
|
37
|
+
await git.walk({
|
|
38
|
+
fs: this.#fs,
|
|
39
|
+
dir: this.#dir,
|
|
40
|
+
trees: [git.TREE({ ref: this.ref })],
|
|
41
|
+
map: async (filepath, entries) => {
|
|
42
|
+
if (filepath === '.')
|
|
43
|
+
return undefined;
|
|
44
|
+
if (!entries)
|
|
45
|
+
return undefined;
|
|
46
|
+
const [entry] = entries;
|
|
47
|
+
if (!entry)
|
|
48
|
+
return undefined;
|
|
49
|
+
const type = await entry.type();
|
|
50
|
+
if (type !== 'blob')
|
|
51
|
+
return undefined;
|
|
52
|
+
const posix = filepath.split(sep).join('/');
|
|
53
|
+
if (this.#exclude(posix))
|
|
54
|
+
return undefined;
|
|
55
|
+
if (matchesGlob(posix, glob))
|
|
56
|
+
collected.push(posix);
|
|
57
|
+
return undefined;
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
for (const p of collected)
|
|
61
|
+
yield p;
|
|
62
|
+
}
|
|
63
|
+
async readFile(relativePath) {
|
|
64
|
+
const posix = this.#validateRel(relativePath);
|
|
65
|
+
const { blob } = await git.readBlob({
|
|
66
|
+
fs: this.#fs,
|
|
67
|
+
dir: this.#dir,
|
|
68
|
+
oid: this.ref,
|
|
69
|
+
filepath: posix,
|
|
70
|
+
});
|
|
71
|
+
return Buffer.from(blob);
|
|
72
|
+
}
|
|
73
|
+
async readText(relativePath) {
|
|
74
|
+
const buf = await this.readFile(relativePath);
|
|
75
|
+
return buf.toString('utf8');
|
|
76
|
+
}
|
|
77
|
+
#validateRel(relativePath) {
|
|
78
|
+
if (isAbsolute(relativePath)) {
|
|
79
|
+
throw new Error(`Snapshot.readFile: absolute paths are not allowed (${relativePath})`);
|
|
80
|
+
}
|
|
81
|
+
// Use a virtual root so `normalize`/`relative` behave consistently across
|
|
82
|
+
// platforms without touching the real fs.
|
|
83
|
+
const virtualRoot = '/__snap__';
|
|
84
|
+
const joined = normalize(join(virtualRoot, relativePath));
|
|
85
|
+
const rel = relative(virtualRoot, joined);
|
|
86
|
+
if (rel.startsWith('..') || isAbsolute(rel) || rel.split(sep).includes('..')) {
|
|
87
|
+
throw new Error(`Snapshot.readFile: path escapes snapshot root (${relativePath})`);
|
|
88
|
+
}
|
|
89
|
+
const posix = sep === '/' ? rel : rel.split(sep).join('/');
|
|
90
|
+
if (this.#exclude(posix)) {
|
|
91
|
+
throw new Error(`Snapshot.readFile: path is excluded from the snapshot (${relativePath})`);
|
|
92
|
+
}
|
|
93
|
+
return posix;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=git-snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-snapshot.js","sourceRoot":"","sources":["../../src/sources/git-snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,GAAG,MAAM,gBAA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W,EAAE,YAAY,CAAC,CAAC,CAAC;QAC1D,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,kDAAkD,YAAY,GAAG,CAAC,CAAC;QACrF,CAAC;QACD,MAAM,KAAK,GAAG,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3D,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,0DAA0D,YAAY,GAAG,CAAC,CAAC;QAC7F,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal glob matcher + recursive directory walk.
|
|
3
|
+
*
|
|
4
|
+
* Supports the subset of glob syntax connectors actually need:
|
|
5
|
+
* - `*` matches any run of characters except `/`
|
|
6
|
+
* - `**` matches any run of characters including `/`
|
|
7
|
+
* - `?` matches exactly one character except `/`
|
|
8
|
+
* - Literal `.` `/` `_` `-` segments
|
|
9
|
+
*
|
|
10
|
+
* No brace-expansion, no `!` negation, no `[ ]` character classes. If a
|
|
11
|
+
* connector needs more, it can iterate `walkFiles("**\/*")` and filter in
|
|
12
|
+
* its own code — keeping the SDK surface small.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Recursive walk yielding POSIX-style relative paths (forward-slash).
|
|
16
|
+
* Skips dot-directories of the cache itself (`.lobu-cache`) but otherwise
|
|
17
|
+
* includes hidden files — git's `.git/` is excluded by callers that need
|
|
18
|
+
* to (git source uses a separate snapshot dir without `.git`).
|
|
19
|
+
*/
|
|
20
|
+
export declare function walkDirectoryRelative(root: string): AsyncIterable<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Compile a glob to a RegExp. Anchored on both ends.
|
|
23
|
+
*
|
|
24
|
+
* Implementation note: we walk the glob char-by-char rather than splitting on
|
|
25
|
+
* `*` so we can distinguish `*` from `**` without ambiguity, and so literal
|
|
26
|
+
* regex metacharacters get escaped exactly once.
|
|
27
|
+
*/
|
|
28
|
+
export declare function globToRegExp(glob: string): RegExp;
|
|
29
|
+
/** Test a POSIX-style relative path against `glob`. */
|
|
30
|
+
export declare function matchesGlob(relativePath: string, glob: string): boolean;
|
|
31
|
+
//# sourceMappingURL=glob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/sources/glob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH;;;;;GAKG;AACH,wBAAuB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAwBhF;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkDjD;AAYD,uDAAuD;AACvD,wBAAgB,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAKvE"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal glob matcher + recursive directory walk.
|
|
3
|
+
*
|
|
4
|
+
* Supports the subset of glob syntax connectors actually need:
|
|
5
|
+
* - `*` matches any run of characters except `/`
|
|
6
|
+
* - `**` matches any run of characters including `/`
|
|
7
|
+
* - `?` matches exactly one character except `/`
|
|
8
|
+
* - Literal `.` `/` `_` `-` segments
|
|
9
|
+
*
|
|
10
|
+
* No brace-expansion, no `!` negation, no `[ ]` character classes. If a
|
|
11
|
+
* connector needs more, it can iterate `walkFiles("**\/*")` and filter in
|
|
12
|
+
* its own code — keeping the SDK surface small.
|
|
13
|
+
*/
|
|
14
|
+
import { readdir } from 'node:fs/promises';
|
|
15
|
+
import { join, posix, sep } from 'node:path';
|
|
16
|
+
/**
|
|
17
|
+
* Recursive walk yielding POSIX-style relative paths (forward-slash).
|
|
18
|
+
* Skips dot-directories of the cache itself (`.lobu-cache`) but otherwise
|
|
19
|
+
* includes hidden files — git's `.git/` is excluded by callers that need
|
|
20
|
+
* to (git source uses a separate snapshot dir without `.git`).
|
|
21
|
+
*/
|
|
22
|
+
export async function* walkDirectoryRelative(root) {
|
|
23
|
+
async function* walk(dir, prefix) {
|
|
24
|
+
let entries;
|
|
25
|
+
try {
|
|
26
|
+
entries = await readdir(dir, { withFileTypes: true });
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
if (err.code === 'ENOENT')
|
|
30
|
+
return;
|
|
31
|
+
throw err;
|
|
32
|
+
}
|
|
33
|
+
// Stable order — deterministic walk for tests + manifests.
|
|
34
|
+
entries.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
35
|
+
for (const entry of entries) {
|
|
36
|
+
const childPosix = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
37
|
+
const childAbs = join(dir, entry.name);
|
|
38
|
+
if (entry.isDirectory()) {
|
|
39
|
+
yield* walk(childAbs, childPosix);
|
|
40
|
+
}
|
|
41
|
+
else if (entry.isFile()) {
|
|
42
|
+
yield childPosix;
|
|
43
|
+
}
|
|
44
|
+
// Symlinks/sockets/etc. are skipped on purpose — connectors don't
|
|
45
|
+
// need them and they're a common attack vector through extracted tarballs.
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
yield* walk(root, '');
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Compile a glob to a RegExp. Anchored on both ends.
|
|
52
|
+
*
|
|
53
|
+
* Implementation note: we walk the glob char-by-char rather than splitting on
|
|
54
|
+
* `*` so we can distinguish `*` from `**` without ambiguity, and so literal
|
|
55
|
+
* regex metacharacters get escaped exactly once.
|
|
56
|
+
*/
|
|
57
|
+
export function globToRegExp(glob) {
|
|
58
|
+
let re = '^';
|
|
59
|
+
for (let i = 0; i < glob.length; i++) {
|
|
60
|
+
const c = glob[i];
|
|
61
|
+
if (c === '*') {
|
|
62
|
+
if (glob[i + 1] === '*') {
|
|
63
|
+
// `**` — match any run (including `/`). When followed by `/`, the
|
|
64
|
+
// whole `**/` consumes zero or more directory segments so e.g.
|
|
65
|
+
// `**/*.md` matches `foo.md` AND `a/b/foo.md`. Same on the trailing
|
|
66
|
+
// boundary so `foo/**` matches `foo` itself.
|
|
67
|
+
if (glob[i + 2] === '/') {
|
|
68
|
+
re += '(?:.*/)?';
|
|
69
|
+
i += 2; // skip `**` and the slash
|
|
70
|
+
}
|
|
71
|
+
else if (i === 0 && glob[i + 2] === undefined) {
|
|
72
|
+
// bare `**` — match anything (including empty).
|
|
73
|
+
re += '.*';
|
|
74
|
+
i++;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
re += '.*';
|
|
78
|
+
i++;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
// `*` — match any run not containing `/`.
|
|
83
|
+
re += '[^/]*';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else if (c === '?') {
|
|
87
|
+
re += '[^/]';
|
|
88
|
+
}
|
|
89
|
+
else if (c === '/') {
|
|
90
|
+
re += '/';
|
|
91
|
+
}
|
|
92
|
+
else if (c === '.' ||
|
|
93
|
+
c === '(' ||
|
|
94
|
+
c === ')' ||
|
|
95
|
+
c === '+' ||
|
|
96
|
+
c === '|' ||
|
|
97
|
+
c === '^' ||
|
|
98
|
+
c === '$' ||
|
|
99
|
+
c === '{' ||
|
|
100
|
+
c === '}' ||
|
|
101
|
+
c === '[' ||
|
|
102
|
+
c === ']' ||
|
|
103
|
+
c === '\\') {
|
|
104
|
+
re += `\\${c}`;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
re += c;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
re += '$';
|
|
111
|
+
return new RegExp(re);
|
|
112
|
+
}
|
|
113
|
+
const _globCache = new Map();
|
|
114
|
+
function compileCached(glob) {
|
|
115
|
+
let r = _globCache.get(glob);
|
|
116
|
+
if (!r) {
|
|
117
|
+
r = globToRegExp(glob);
|
|
118
|
+
_globCache.set(glob, r);
|
|
119
|
+
}
|
|
120
|
+
return r;
|
|
121
|
+
}
|
|
122
|
+
/** Test a POSIX-style relative path against `glob`. */
|
|
123
|
+
export function matchesGlob(relativePath, glob) {
|
|
124
|
+
// Normalize windows separators if any leaked in. Callers should pass
|
|
125
|
+
// POSIX already (walkDirectoryRelative emits POSIX) but defensively:
|
|
126
|
+
const norm = sep === posix.sep ? relativePath : relativePath.split(sep).join(posix.sep);
|
|
127
|
+
return compileCached(glob).test(norm);
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=glob.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/sources/glob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,qBAAqB,CAAC,IAAY;IACvD,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,GAAW,EAAE,MAAc;QAC9C,IAAI,OAAmC,CAAC;QACxC,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QACxD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;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IAAI,CAAC,CAAC;QACV,CAAC;IACH,CAAC;IACD,EAAE,IAAI,GAAG,CAAC;IACV,OAAO,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;AAC7C,SAAS,aAAa,CAAC,IAAY;IACjC,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QACvB,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,WAAW,CAAC,YAAoB,EAAE,IAAY;IAC5D,qEAAqE;IACrE,qEAAqE;IACrE,MAAM,IAAI,GAAG,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACxF,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LocalFileSource — adapter over a local directory.
|
|
3
|
+
*
|
|
4
|
+
* URI shape: `file:///absolute/path/`
|
|
5
|
+
*
|
|
6
|
+
* - `fetch()` stream-copies the source tree into a per-ref cache dir
|
|
7
|
+
* (`${WORKSPACE_DIR}/.lobu-cache/sources/<uri-hash>/refs/<ref>/`),
|
|
8
|
+
* sealing each file's sha256 during the copy so the manifest's hashes
|
|
9
|
+
* record exactly the bytes that landed in the cache. The Snapshot
|
|
10
|
+
* reads from that per-ref dir — never the live source — so
|
|
11
|
+
* `snapshot.ref` matches `sha256(snapshot.readFile(path))` for the
|
|
12
|
+
* bytes captured at fetch time, even under concurrent writes against
|
|
13
|
+
* the source. See `Snapshot` in `file-source.ts` for the honest
|
|
14
|
+
* same-UID mutability contract.
|
|
15
|
+
* - `ref` is the canonical manifest hash (sha256 of sorted `(path, sha256)`
|
|
16
|
+
* pairs).
|
|
17
|
+
* - `diffSinceRef(prevRef)`: re-walks the live directory, builds a fresh
|
|
18
|
+
* manifest, and diffs it against the stored per-ref manifest that
|
|
19
|
+
* matches `prevRef`. If no stored manifest matches (cache was cleared
|
|
20
|
+
* between runs), the diff treats every current file as `added`.
|
|
21
|
+
*/
|
|
22
|
+
import type { FileDelta, FileSystemSource, Snapshot } from '../file-source.js';
|
|
23
|
+
export declare class LocalFileSource implements FileSystemSource {
|
|
24
|
+
#private;
|
|
25
|
+
constructor(uri: string);
|
|
26
|
+
fetch(): Promise<Snapshot>;
|
|
27
|
+
diffSinceRef(prevRef: string): Promise<FileDelta>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=local-file-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-file-source.d.ts","sourceRoot":"","sources":["../../src/sources/local-file-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAgBH,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAmB/E,qBAAa,eAAgB,YAAW,gBAAgB;;gBAkB1C,GAAG,EAAE,MAAM;IASvB,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC;IAwF1B,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CAoBlD"}
|