@lobu/connector-sdk 7.2.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,273 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TarballFileSource — download a remote `.tar.gz`/`.tgz`, extract once,
|
|
3
|
+
* snapshot from the extraction directory.
|
|
4
|
+
*
|
|
5
|
+
* - Download via `undici.request` (Node built-in, no extra dep).
|
|
6
|
+
* - Extract via `tar` (npm `tar`, ~50KB) — streaming, won't buffer the
|
|
7
|
+
* archive in memory.
|
|
8
|
+
* - Atomic install: extract to `${root}/snapshot.tmp.<rand>` and rename
|
|
9
|
+
* over `${root}/snapshot/` once extraction completes. Partial fetches
|
|
10
|
+
* don't corrupt the cache.
|
|
11
|
+
* - `ref` is the canonical manifest hash; identical content → identical
|
|
12
|
+
* `ref` regardless of when/where it was fetched.
|
|
13
|
+
* - `diffSinceRef` re-fetches and compares against the per-ref manifest
|
|
14
|
+
* stored alongside the cache. Full tarballs have no incremental wire
|
|
15
|
+
* support — the gain is "did anything change?" not "send me the delta".
|
|
16
|
+
*/
|
|
17
|
+
import { createHash } from 'node:crypto';
|
|
18
|
+
import { createWriteStream } from 'node:fs';
|
|
19
|
+
import { mkdir, mkdtemp, readFile, readdir, rename, rm, stat } from 'node:fs/promises';
|
|
20
|
+
import { tmpdir } from 'node:os';
|
|
21
|
+
import { join } from 'node:path';
|
|
22
|
+
import { Readable } from 'node:stream';
|
|
23
|
+
import { pipeline } from 'node:stream/promises';
|
|
24
|
+
import { x as tarExtract } from 'tar';
|
|
25
|
+
import { canonicalManifestRef, cachePathsFor, diffManifests, readAndVerifyMeta, readManifest, requireMeta, withSourceLock, writeManifest, writeMeta, } from './cache.js';
|
|
26
|
+
import { walkDirectoryRelative } from './glob.js';
|
|
27
|
+
import { DirectorySnapshot } from './snapshot.js';
|
|
28
|
+
export class TarballFileSource {
|
|
29
|
+
#uri;
|
|
30
|
+
#paths;
|
|
31
|
+
#stripComponents;
|
|
32
|
+
constructor(uri, opts = {}) {
|
|
33
|
+
if (uri.startsWith('http://')) {
|
|
34
|
+
throw new Error('TarballFileSource: plaintext HTTP rejected, use https://');
|
|
35
|
+
}
|
|
36
|
+
if (!uri.startsWith('https://')) {
|
|
37
|
+
throw new Error(`TarballFileSource: expected https:// URI, got ${uri}`);
|
|
38
|
+
}
|
|
39
|
+
const lower = uri.split('?')[0]?.split('#')[0] ?? uri;
|
|
40
|
+
if (!lower.endsWith('.tar.gz') && !lower.endsWith('.tgz')) {
|
|
41
|
+
throw new Error(`TarballFileSource: only .tar.gz / .tgz supported in v1 (${uri})`);
|
|
42
|
+
}
|
|
43
|
+
this.#uri = uri;
|
|
44
|
+
this.#paths = cachePathsFor(uri);
|
|
45
|
+
this.#stripComponents = opts.stripComponents ?? 0;
|
|
46
|
+
}
|
|
47
|
+
fetch() {
|
|
48
|
+
return withSourceLock(this.#uri, () => this.#fetchLocked());
|
|
49
|
+
}
|
|
50
|
+
async #fetchLocked() {
|
|
51
|
+
await mkdir(this.#paths.root, { recursive: true });
|
|
52
|
+
await readAndVerifyMeta(this.#paths.metaPath, this.#uri);
|
|
53
|
+
// 1. Download to temp file (streaming) + extract to a staging dir.
|
|
54
|
+
const tmpDir = await mkdtemp(join(tmpdir(), 'lobu-tarball-'));
|
|
55
|
+
const tarPath = join(tmpDir, 'archive.tar.gz');
|
|
56
|
+
const stagingDir = join(this.#paths.root, `snapshot.tmp.${randomSuffix()}`);
|
|
57
|
+
let stagingMoved = false;
|
|
58
|
+
try {
|
|
59
|
+
const res = await httpsFetchNoDowngrade(this.#uri);
|
|
60
|
+
if (!res.ok) {
|
|
61
|
+
throw new Error(`TarballFileSource: GET ${this.#uri} returned ${res.status}`);
|
|
62
|
+
}
|
|
63
|
+
if (!res.body) {
|
|
64
|
+
throw new Error(`TarballFileSource: GET ${this.#uri} returned an empty body`);
|
|
65
|
+
}
|
|
66
|
+
void res.headers.get('content-type');
|
|
67
|
+
const nodeBody = Readable.fromWeb(res.body);
|
|
68
|
+
await pipeline(nodeBody, createWriteStream(tarPath));
|
|
69
|
+
await mkdir(stagingDir, { recursive: true });
|
|
70
|
+
await tarExtract({
|
|
71
|
+
file: tarPath,
|
|
72
|
+
cwd: stagingDir,
|
|
73
|
+
strip: this.#stripComponents,
|
|
74
|
+
});
|
|
75
|
+
// 2. Compute the content-addressed ref from the extracted files.
|
|
76
|
+
const files = await collectFiles(stagingDir);
|
|
77
|
+
const ref = canonicalManifestRef(files);
|
|
78
|
+
const refDir = perRefSnapshotDir(this.#paths.root, ref);
|
|
79
|
+
// 3. Install into the per-ref dir if it isn't already there. Old refs
|
|
80
|
+
// stay on disk so any Snapshot already handed out keeps reading its
|
|
81
|
+
// pinned bytes. A partial crash leaves the staging dir behind, which
|
|
82
|
+
// is harmless — the next fetch() will simply re-stage.
|
|
83
|
+
const alreadyInstalled = await dirExists(refDir);
|
|
84
|
+
if (alreadyInstalled) {
|
|
85
|
+
// Same content already installed under this ref; drop the staging dir.
|
|
86
|
+
await rm(stagingDir, { recursive: true, force: true });
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
await mkdir(join(this.#paths.root, 'refs'), { recursive: true });
|
|
90
|
+
await rename(stagingDir, refDir);
|
|
91
|
+
}
|
|
92
|
+
stagingMoved = true;
|
|
93
|
+
// 4. Persist manifest + meta + per-ref manifest. (Old per-ref manifests
|
|
94
|
+
// stay so historical diffs still work.)
|
|
95
|
+
const manifest = {
|
|
96
|
+
ref,
|
|
97
|
+
files,
|
|
98
|
+
fetched_at: new Date().toISOString(),
|
|
99
|
+
};
|
|
100
|
+
await writeManifest(this.#paths.manifestPath, manifest);
|
|
101
|
+
await writeMeta(this.#paths.metaPath, { uri: this.#uri, kind: 'tarball' });
|
|
102
|
+
await writePerRefManifest(this.#paths.root, manifest);
|
|
103
|
+
// Keep cache size bounded. We always preserve the freshly-installed
|
|
104
|
+
// ref dir, so the just-returned Snapshot is safe.
|
|
105
|
+
await pruneOldRefDirs(this.#paths.root, MAX_REF_DIRS, refDir);
|
|
106
|
+
// Snapshot reads from the immutable per-ref dir — never overwritten.
|
|
107
|
+
return new DirectorySnapshot(refDir, ref);
|
|
108
|
+
}
|
|
109
|
+
finally {
|
|
110
|
+
if (!stagingMoved) {
|
|
111
|
+
await rm(stagingDir, { recursive: true, force: true }).catch(() => undefined);
|
|
112
|
+
}
|
|
113
|
+
await rm(tmpDir, { recursive: true, force: true });
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
async diffSinceRef(prevRef) {
|
|
117
|
+
// diffSinceRef before fetch() is a caller bug — pin that contract first
|
|
118
|
+
// so a fresh cache throws "source not fetched yet" instead of silently
|
|
119
|
+
// performing a full re-ingest via the implicit fetch() below. Matches
|
|
120
|
+
// the local + git sources.
|
|
121
|
+
await withSourceLock(this.#uri, async () => {
|
|
122
|
+
await requireMeta(this.#paths.metaPath, this.#uri);
|
|
123
|
+
});
|
|
124
|
+
// Re-fetch (no incremental wire support), then diff manifests.
|
|
125
|
+
// fetch() takes the lock itself; nest a separate read step outside it.
|
|
126
|
+
const snapshot = await this.fetch();
|
|
127
|
+
if (snapshot.ref === prevRef)
|
|
128
|
+
return { added: [], modified: [], removed: [] };
|
|
129
|
+
return withSourceLock(this.#uri, async () => {
|
|
130
|
+
await requireMeta(this.#paths.metaPath, this.#uri);
|
|
131
|
+
const prev = await readPerRefManifest(this.#paths.root, prevRef);
|
|
132
|
+
const next = await readManifest(this.#paths.manifestPath);
|
|
133
|
+
if (!next)
|
|
134
|
+
throw new Error('TarballFileSource: manifest disappeared after fetch');
|
|
135
|
+
if (!prev) {
|
|
136
|
+
// We don't have the prior manifest — treat everything as new.
|
|
137
|
+
return { added: next.files.map((f) => f.path), modified: [], removed: [] };
|
|
138
|
+
}
|
|
139
|
+
return diffManifests(prev, next);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
function perRefSnapshotDir(root, ref) {
|
|
144
|
+
return join(root, 'refs', ref);
|
|
145
|
+
}
|
|
146
|
+
async function dirExists(p) {
|
|
147
|
+
const s = await stat(p).catch(() => null);
|
|
148
|
+
return !!s && s.isDirectory();
|
|
149
|
+
}
|
|
150
|
+
async function collectFiles(rootDir) {
|
|
151
|
+
const out = [];
|
|
152
|
+
// Ensure dir exists; a 0-file archive should produce an empty manifest, not throw.
|
|
153
|
+
const s = await stat(rootDir).catch(() => null);
|
|
154
|
+
if (!s)
|
|
155
|
+
return out;
|
|
156
|
+
for await (const rel of walkDirectoryRelative(rootDir)) {
|
|
157
|
+
const abs = join(rootDir, rel);
|
|
158
|
+
const buf = await readFile(abs);
|
|
159
|
+
const sha = createHash('sha256').update(buf).digest('hex');
|
|
160
|
+
out.push({ path: rel, sha256: sha });
|
|
161
|
+
}
|
|
162
|
+
return out;
|
|
163
|
+
}
|
|
164
|
+
function randomSuffix() {
|
|
165
|
+
return Math.random().toString(36).slice(2, 10);
|
|
166
|
+
}
|
|
167
|
+
async function writePerRefManifest(root, manifest) {
|
|
168
|
+
await mkdir(join(root, 'refs'), { recursive: true });
|
|
169
|
+
await writeManifest(join(root, 'refs', `${manifest.ref}.json`), manifest);
|
|
170
|
+
}
|
|
171
|
+
async function readPerRefManifest(root, ref) {
|
|
172
|
+
return readManifest(join(root, 'refs', `${ref}.json`));
|
|
173
|
+
}
|
|
174
|
+
/** Max number of `refs/<hash>` per-ref directories kept on disk. */
|
|
175
|
+
const MAX_REF_DIRS = 3;
|
|
176
|
+
/**
|
|
177
|
+
* Keep at most `keep` per-ref directories under `${root}/refs/`. Sorted by
|
|
178
|
+
* mtime descending; the oldest are rm-rf'd. The current ref (the one we
|
|
179
|
+
* just installed and are about to hand a Snapshot for) is always
|
|
180
|
+
* preserved, even if its mtime happens to be older than another dir's
|
|
181
|
+
* (e.g. a cache-hit branch that didn't touch the dir).
|
|
182
|
+
*
|
|
183
|
+
* Ignores `snapshot.tmp.*` staging dirs and the per-ref manifest JSON
|
|
184
|
+
* files (`<ref>.json`) which are kept indefinitely so historical diffs
|
|
185
|
+
* keep working after a data dir is pruned.
|
|
186
|
+
*/
|
|
187
|
+
async function pruneOldRefDirs(root, keep, protectedRefDir) {
|
|
188
|
+
const refsRoot = join(root, 'refs');
|
|
189
|
+
let entries;
|
|
190
|
+
try {
|
|
191
|
+
entries = await readdir(refsRoot, { withFileTypes: true });
|
|
192
|
+
}
|
|
193
|
+
catch (err) {
|
|
194
|
+
if (err.code === 'ENOENT')
|
|
195
|
+
return;
|
|
196
|
+
throw err;
|
|
197
|
+
}
|
|
198
|
+
const candidates = [];
|
|
199
|
+
for (const ent of entries) {
|
|
200
|
+
if (!ent.isDirectory())
|
|
201
|
+
continue;
|
|
202
|
+
if (ent.name.startsWith('snapshot.tmp.'))
|
|
203
|
+
continue;
|
|
204
|
+
const abs = join(refsRoot, ent.name);
|
|
205
|
+
try {
|
|
206
|
+
const s = await stat(abs);
|
|
207
|
+
candidates.push({
|
|
208
|
+
name: ent.name,
|
|
209
|
+
abs,
|
|
210
|
+
mtimeMs: s.mtimeMs,
|
|
211
|
+
protected: abs === protectedRefDir,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
catch {
|
|
215
|
+
// Skip — concurrent prune from another process is fine.
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (candidates.length <= keep)
|
|
219
|
+
return;
|
|
220
|
+
// Always-keep the protected (current) dir; sort the rest by mtime desc and
|
|
221
|
+
// keep the (keep - 1) most recent.
|
|
222
|
+
const protectedDirs = candidates.filter((c) => c.protected);
|
|
223
|
+
const others = candidates
|
|
224
|
+
.filter((c) => !c.protected)
|
|
225
|
+
.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
226
|
+
const keepers = new Set([
|
|
227
|
+
...protectedDirs.map((c) => c.name),
|
|
228
|
+
...others.slice(0, Math.max(0, keep - protectedDirs.length)).map((c) => c.name),
|
|
229
|
+
]);
|
|
230
|
+
for (const c of candidates) {
|
|
231
|
+
if (keepers.has(c.name))
|
|
232
|
+
continue;
|
|
233
|
+
await rm(c.abs, { recursive: true, force: true }).catch(() => undefined);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
const MAX_REDIRECTS = 5;
|
|
237
|
+
/**
|
|
238
|
+
* fetch() with manual redirect following + an https-only guard on every hop.
|
|
239
|
+
* Rejects with a clear error if any 3xx Location points at a non-https URL,
|
|
240
|
+
* defending against a redirect-based plaintext downgrade.
|
|
241
|
+
*/
|
|
242
|
+
async function httpsFetchNoDowngrade(initialUrl) {
|
|
243
|
+
let url = initialUrl;
|
|
244
|
+
for (let i = 0; i <= MAX_REDIRECTS; i++) {
|
|
245
|
+
if (!url.startsWith('https://')) {
|
|
246
|
+
throw new Error(`TarballFileSource: redirect to plaintext URL rejected: ${url}`);
|
|
247
|
+
}
|
|
248
|
+
const res = await fetch(url, { redirect: 'manual' });
|
|
249
|
+
if (res.status < 300 || res.status >= 400) {
|
|
250
|
+
return res;
|
|
251
|
+
}
|
|
252
|
+
// 3xx — must have a Location header.
|
|
253
|
+
const loc = res.headers.get('location');
|
|
254
|
+
if (!loc)
|
|
255
|
+
return res;
|
|
256
|
+
// Resolve relative URLs against the current URL.
|
|
257
|
+
try {
|
|
258
|
+
url = new URL(loc, url).toString();
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
throw new Error(`TarballFileSource: invalid redirect location: ${loc}`);
|
|
262
|
+
}
|
|
263
|
+
// Drain the body so the socket is reusable.
|
|
264
|
+
try {
|
|
265
|
+
await res.body?.cancel();
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
// ignore
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
throw new Error(`TarballFileSource: too many redirects (>${MAX_REDIRECTS}) for ${initialUrl}`);
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=tarball-file-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tarball-file-source.js","sourceRoot":"","sources":["../../src/sources/tarball-file-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,CAAC,IAAI,UAAU,EAAE,MAAM,KAAK,CAAC;AAGtC,OAAO,EAIL,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAOlD,MAAM,OAAO,iBAAiB;IACnB,IAAI,CAAS;IACb,MAAM,CAAa;IACnB,gBAAgB,CAAS;IAElC,YAAY,GAA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IAAI,CAAC;YACH,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;QACrC,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,iDAAiD,GAAG,EAAE,CAAC,CAAC;QAC1E,CAAC;QACD,4CAA4C;QAC5C,IAAI,CAAC;YACH,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,2CAA2C,aAAa,SAAS,UAAU,EAAE,CAAC,CAAC;AACjG,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,64 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checkpoint data structure for tracking feed sync state
|
|
3
|
-
*/
|
|
4
|
-
export interface Checkpoint {
|
|
5
|
-
last_timestamp?: Date;
|
|
6
|
-
updated_at: Date;
|
|
7
|
-
total_items_processed?: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Sync result containing extracted content and updated checkpoint
|
|
11
|
-
*
|
|
12
|
-
* Note: checkpoint can be null for feeds that use incremental checkpoint
|
|
13
|
-
* updates via updateCheckpointFn during pagination (e.g., Reddit)
|
|
14
|
-
*/
|
|
15
|
-
export interface FeedSyncResult {
|
|
16
|
-
contents: Content[];
|
|
17
|
-
checkpoint: Checkpoint | null;
|
|
18
|
-
metadata?: {
|
|
19
|
-
items_found: number;
|
|
20
|
-
items_skipped: number;
|
|
21
|
-
rate_limit_remaining?: number;
|
|
22
|
-
next_sync_recommended_at?: Date;
|
|
23
|
-
parent_map?: Record<string, string>;
|
|
24
|
-
[key: string]: any;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Auth state to persist after sync (browser cookies, etc.)
|
|
28
|
-
* Will be saved back to the linked auth profile for browser-based connectors.
|
|
29
|
-
*/
|
|
30
|
-
auth_update?: Record<string, any>;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Extracted content from platform
|
|
34
|
-
*/
|
|
35
|
-
export interface Content {
|
|
36
|
-
origin_id: string;
|
|
37
|
-
payload_text: string;
|
|
38
|
-
title?: string;
|
|
39
|
-
author_name?: string;
|
|
40
|
-
source_url: string;
|
|
41
|
-
occurred_at: Date;
|
|
42
|
-
origin_type?: string;
|
|
43
|
-
semantic_type?: string;
|
|
44
|
-
score: number;
|
|
45
|
-
origin_parent_id?: string | null;
|
|
46
|
-
metadata?: Record<string, any>;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Feed options passed from MCP tool
|
|
50
|
-
*/
|
|
51
|
-
export interface FeedOptions {
|
|
52
|
-
/**
|
|
53
|
-
* Number of days to look back when collecting historical data
|
|
54
|
-
* Default: 365 (1 year)
|
|
55
|
-
*/
|
|
56
|
-
lookback_days?: number;
|
|
57
|
-
[key: string]: any;
|
|
58
|
-
}
|
|
59
1
|
/**
|
|
60
2
|
* Consolidated environment bindings used across the platform.
|
|
61
|
-
* This is the single source of truth for environment variable types
|
|
3
|
+
* This is the single source of truth for environment variable types
|
|
4
|
+
* read by the gateway, worker, and connector code.
|
|
62
5
|
*/
|
|
63
6
|
export interface Env {
|
|
64
7
|
ENVIRONMENT: string;
|
|
@@ -67,6 +10,7 @@ export interface Env {
|
|
|
67
10
|
PUBLIC_LOGO_URL?: string;
|
|
68
11
|
PUBLIC_LEGAL_URL?: string;
|
|
69
12
|
FRAME_ANCESTORS?: string;
|
|
13
|
+
LOBU_SINGLE_USER?: string;
|
|
70
14
|
DEFAULT_SYNC_INTERVAL_MS?: string;
|
|
71
15
|
DEFAULT_SYNC_INTERVAL_HOURS?: string;
|
|
72
16
|
DEFAULT_SYNC_INTERVAL_X_MS?: string;
|
|
@@ -107,10 +51,4 @@ export interface Env {
|
|
|
107
51
|
TWILIO_WHATSAPP_NUMBER?: string;
|
|
108
52
|
[key: string]: string | undefined;
|
|
109
53
|
}
|
|
110
|
-
/**
|
|
111
|
-
* Base session state type - feeds define their own specific types
|
|
112
|
-
* Values can come from env vars (defaults) or DB (per-connection overrides)
|
|
113
|
-
* At runtime, DB values override env defaults
|
|
114
|
-
*/
|
|
115
|
-
export type SessionState = Record<string, any>;
|
|
116
54
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,GAAG;IAElB,WAAW,EAAE,MAAM,CAAC;IACpB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAK1B,eAAe,CAAC,EAAE,MAAM,CAAC;IAKzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAG1B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,+BAA+B,CAAC,EAAE,MAAM,CAAC;IAGzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAG/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAG7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAGhC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobu/connector-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Lobu memory SDK — build pluggable connectors for Lobu memory",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -38,9 +38,11 @@
|
|
|
38
38
|
"clean": "rm -rf dist"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@lobu/core": "
|
|
41
|
+
"@lobu/core": "8.0.0",
|
|
42
42
|
"@sinclair/typebox": "^0.34.41",
|
|
43
|
-
"
|
|
43
|
+
"isomorphic-git": "^1.34.0",
|
|
44
|
+
"ky": "^1.14.0",
|
|
45
|
+
"tar": "^7.4.3"
|
|
44
46
|
},
|
|
45
47
|
"peerDependencies": {
|
|
46
48
|
"playwright": "npm:patchright@^1.57.0",
|
|
@@ -56,6 +58,7 @@
|
|
|
56
58
|
},
|
|
57
59
|
"devDependencies": {
|
|
58
60
|
"@types/node": "^20.10.0",
|
|
61
|
+
"@types/tar": "^6.1.13",
|
|
59
62
|
"typescript": "^5.3.3"
|
|
60
63
|
},
|
|
61
64
|
"engines": {
|
package/dist/event-taxonomy.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const SOURCE_NATIVE_EVENT_TYPES: readonly ["article", "ask_hn", "comment", "commit", "discussion", "email", "file", "issue", "issue_comment", "message", "photo", "post", "pr_comment", "pull_request", "reply", "repository", "review", "section", "show_hn", "story", "thread", "tweet", "video"];
|
|
2
|
-
export declare function isSourceNativeEventType(value: string | null | undefined): boolean;
|
|
3
|
-
//# sourceMappingURL=event-taxonomy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-taxonomy.d.ts","sourceRoot":"","sources":["../src/event-taxonomy.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,oQAwB5B,CAAC;AAIX,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEjF"}
|
package/dist/event-taxonomy.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export const SOURCE_NATIVE_EVENT_TYPES = [
|
|
2
|
-
'article',
|
|
3
|
-
'ask_hn',
|
|
4
|
-
'comment',
|
|
5
|
-
'commit',
|
|
6
|
-
'discussion',
|
|
7
|
-
'email',
|
|
8
|
-
'file',
|
|
9
|
-
'issue',
|
|
10
|
-
'issue_comment',
|
|
11
|
-
'message',
|
|
12
|
-
'photo',
|
|
13
|
-
'post',
|
|
14
|
-
'pr_comment',
|
|
15
|
-
'pull_request',
|
|
16
|
-
'reply',
|
|
17
|
-
'repository',
|
|
18
|
-
'review',
|
|
19
|
-
'section',
|
|
20
|
-
'show_hn',
|
|
21
|
-
'story',
|
|
22
|
-
'thread',
|
|
23
|
-
'tweet',
|
|
24
|
-
'video',
|
|
25
|
-
];
|
|
26
|
-
const SOURCE_NATIVE_EVENT_TYPE_SET = new Set(SOURCE_NATIVE_EVENT_TYPES);
|
|
27
|
-
export function isSourceNativeEventType(value) {
|
|
28
|
-
return typeof value === 'string' && SOURCE_NATIVE_EVENT_TYPE_SET.has(value);
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=event-taxonomy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-taxonomy.js","sourceRoot":"","sources":["../src/event-taxonomy.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,SAAS;IACT,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,YAAY;IACZ,OAAO;IACP,MAAM;IACN,OAAO;IACP,eAAe;IACf,SAAS;IACT,OAAO;IACP,MAAM;IACN,YAAY;IACZ,cAAc;IACd,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,SAAS;IACT,OAAO;IACP,QAAQ;IACR,OAAO;IACP,OAAO;CACC,CAAC;AAEX,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAS,yBAAyB,CAAC,CAAC;AAEhF,MAAM,UAAU,uBAAuB,CAAC,KAAgC;IACtE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,4BAA4B,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|