@nebutra/document-pipeline 0.1.2 → 0.1.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/CHANGELOG.md +10 -0
- package/package.json +19 -8
- package/.nebutra/debug/content-store.jsonl +0 -54
- package/.nebutra/debug/document-pipeline.jsonl +0 -27
- package/.turbo/turbo-build.log +0 -22
- package/.turbo/turbo-test.log +0 -16
- package/.turbo/turbo-typecheck.log +0 -4
- package/examples/ingest-markdown.ts +0 -15
- package/examples/parse-html.ts +0 -15
- package/examples/sidecar-gate.ts +0 -14
- package/src/cli.ts +0 -31
- package/src/index.test.ts +0 -93
- package/src/index.ts +0 -353
- package/tsconfig.json +0 -12
- package/tsup.config.ts +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @nebutra/document-pipeline
|
|
2
2
|
|
|
3
|
+
## 0.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @nebutra/capability-kit@2.0.0
|
|
9
|
+
- @nebutra/errors@2.0.0
|
|
10
|
+
- @nebutra/sandbox-runtime@2.0.0
|
|
11
|
+
- @nebutra/content-store@0.1.5
|
|
12
|
+
|
|
3
13
|
## 0.1.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nebutra/document-pipeline",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Document parse, chunk, embed-port, and content-store ingestion pipeline",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"nebutra": {
|
|
9
|
+
"graph": "labs",
|
|
9
10
|
"status": "wip",
|
|
10
11
|
"productionReady": false,
|
|
11
12
|
"surface": "execution-capability",
|
|
@@ -22,16 +23,20 @@
|
|
|
22
23
|
"category": "ai",
|
|
23
24
|
"summary": "Parser router, metadata-preserving chunks, content-store ingest, doctor, and debug tools"
|
|
24
25
|
},
|
|
25
|
-
"main": "./
|
|
26
|
-
"types": "./
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
27
28
|
"exports": {
|
|
28
|
-
".":
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.js",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
|
+
}
|
|
29
34
|
},
|
|
30
35
|
"dependencies": {
|
|
31
|
-
"@nebutra/capability-kit": "0.
|
|
32
|
-
"@nebutra/content-store": "0.1.
|
|
33
|
-
"@nebutra/
|
|
34
|
-
"@nebutra/
|
|
36
|
+
"@nebutra/capability-kit": "2.0.0",
|
|
37
|
+
"@nebutra/content-store": "0.1.5",
|
|
38
|
+
"@nebutra/errors": "2.0.0",
|
|
39
|
+
"@nebutra/sandbox-runtime": "2.0.0"
|
|
35
40
|
},
|
|
36
41
|
"devDependencies": {
|
|
37
42
|
"@types/node": "^25.9.1",
|
|
@@ -51,6 +56,12 @@
|
|
|
51
56
|
"publishConfig": {
|
|
52
57
|
"access": "public"
|
|
53
58
|
},
|
|
59
|
+
"files": [
|
|
60
|
+
"dist",
|
|
61
|
+
"README.md",
|
|
62
|
+
"LICENSE",
|
|
63
|
+
"CHANGELOG.md"
|
|
64
|
+
],
|
|
54
65
|
"scripts": {
|
|
55
66
|
"build": "tsup",
|
|
56
67
|
"test": "vitest run",
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
{"at":"2026-05-17T18:28:18.167Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
2
|
-
{"at":"2026-05-17T18:28:18.175Z","type":"write","tenantId":"tenant_a","path":"research/BRAND.md"}
|
|
3
|
-
{"at":"2026-05-17T18:28:18.181Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
4
|
-
{"at":"2026-05-17T18:28:18.188Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
5
|
-
{"at":"2026-05-17T18:28:18.195Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
6
|
-
{"at":"2026-05-17T18:28:18.196Z","type":"write","tenantId":"tenant_a","path":"notes/a.md"}
|
|
7
|
-
{"at":"2026-05-17T18:30:11.005Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
8
|
-
{"at":"2026-05-17T18:30:11.015Z","type":"write","tenantId":"tenant_a","path":"research/BRAND.md"}
|
|
9
|
-
{"at":"2026-05-17T18:30:11.021Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
10
|
-
{"at":"2026-05-17T18:30:11.028Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
11
|
-
{"at":"2026-05-17T18:30:11.033Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
12
|
-
{"at":"2026-05-17T18:30:11.035Z","type":"write","tenantId":"tenant_a","path":"notes/a.md"}
|
|
13
|
-
{"at":"2026-05-17T18:36:14.823Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
14
|
-
{"at":"2026-05-17T18:36:14.831Z","type":"write","tenantId":"tenant_a","path":"research/BRAND.md"}
|
|
15
|
-
{"at":"2026-05-17T18:36:14.836Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
16
|
-
{"at":"2026-05-17T18:36:14.841Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
17
|
-
{"at":"2026-05-17T18:36:14.848Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
18
|
-
{"at":"2026-05-17T18:36:14.849Z","type":"write","tenantId":"tenant_a","path":"notes/a.md"}
|
|
19
|
-
{"at":"2026-05-18T05:20:20.472Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
20
|
-
{"at":"2026-05-18T05:20:20.497Z","type":"write","tenantId":"tenant_a","path":"research/BRAND.md"}
|
|
21
|
-
{"at":"2026-05-18T05:20:20.512Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
22
|
-
{"at":"2026-05-18T05:20:20.544Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
23
|
-
{"at":"2026-05-18T05:20:20.587Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
24
|
-
{"at":"2026-05-18T05:20:20.592Z","type":"write","tenantId":"tenant_a","path":"notes/a.md"}
|
|
25
|
-
{"at":"2026-05-18T05:50:56.502Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
26
|
-
{"at":"2026-05-18T05:50:56.516Z","type":"write","tenantId":"tenant_a","path":"research/BRAND.md"}
|
|
27
|
-
{"at":"2026-05-18T05:50:56.533Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
28
|
-
{"at":"2026-05-18T05:50:56.548Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
29
|
-
{"at":"2026-05-18T05:50:56.559Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
30
|
-
{"at":"2026-05-18T05:50:56.570Z","type":"write","tenantId":"tenant_a","path":"notes/a.md"}
|
|
31
|
-
{"at":"2026-05-19T05:21:58.317Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
32
|
-
{"at":"2026-05-19T05:21:58.328Z","type":"write","tenantId":"tenant_a","path":"research/BRAND.md"}
|
|
33
|
-
{"at":"2026-05-19T05:21:58.335Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
34
|
-
{"at":"2026-05-19T05:21:58.343Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
35
|
-
{"at":"2026-05-19T05:21:58.350Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
36
|
-
{"at":"2026-05-19T05:21:58.352Z","type":"write","tenantId":"tenant_a","path":"notes/a.md"}
|
|
37
|
-
{"at":"2026-05-19T05:25:37.226Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
38
|
-
{"at":"2026-05-19T05:25:37.243Z","type":"write","tenantId":"tenant_a","path":"research/BRAND.md"}
|
|
39
|
-
{"at":"2026-05-19T05:25:37.260Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
40
|
-
{"at":"2026-05-19T05:25:37.278Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
41
|
-
{"at":"2026-05-19T05:25:37.288Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
42
|
-
{"at":"2026-05-19T05:25:37.290Z","type":"write","tenantId":"tenant_a","path":"notes/a.md"}
|
|
43
|
-
{"at":"2026-05-30T21:06:21.590Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
44
|
-
{"at":"2026-05-30T21:06:21.614Z","type":"write","tenantId":"tenant_a","path":"research/BRAND.md"}
|
|
45
|
-
{"at":"2026-05-30T21:06:21.625Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
46
|
-
{"at":"2026-05-30T21:06:21.635Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
47
|
-
{"at":"2026-05-30T21:06:21.644Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
48
|
-
{"at":"2026-05-30T21:06:21.647Z","type":"write","tenantId":"tenant_a","path":"notes/a.md"}
|
|
49
|
-
{"at":"2026-07-01T01:38:44.077Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
50
|
-
{"at":"2026-07-01T01:38:44.115Z","type":"write","tenantId":"tenant_a","path":"research/BRAND.md"}
|
|
51
|
-
{"at":"2026-07-01T01:38:44.134Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
52
|
-
{"at":"2026-07-01T01:38:44.142Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
53
|
-
{"at":"2026-07-01T01:38:44.152Z","type":"reindex","tenantId":"tenant_a","files":0}
|
|
54
|
-
{"at":"2026-07-01T01:38:44.156Z","type":"write","tenantId":"tenant_a","path":"notes/a.md"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{"at":"2026-05-17T18:28:18.168Z","type":"parse","tenantId":"tenant_a","parser":"markdown","path":"research/BRAND.md","chunks":1}
|
|
2
|
-
{"at":"2026-05-17T18:28:18.176Z","type":"ingest","tenantId":"tenant_a","path":"research/BRAND.md","parser":"markdown","chunks":1}
|
|
3
|
-
{"at":"2026-05-17T18:28:18.182Z","type":"parse","tenantId":"tenant_a","parser":"html","path":"page.html","chunks":1}
|
|
4
|
-
{"at":"2026-05-17T18:30:11.007Z","type":"parse","tenantId":"tenant_a","parser":"markdown","path":"research/BRAND.md","chunks":1}
|
|
5
|
-
{"at":"2026-05-17T18:30:11.015Z","type":"ingest","tenantId":"tenant_a","path":"research/BRAND.md","parser":"markdown","chunks":1}
|
|
6
|
-
{"at":"2026-05-17T18:30:11.022Z","type":"parse","tenantId":"tenant_a","parser":"html","path":"page.html","chunks":1}
|
|
7
|
-
{"at":"2026-05-17T18:36:14.824Z","type":"parse","tenantId":"tenant_a","parser":"markdown","path":"research/BRAND.md","chunks":1}
|
|
8
|
-
{"at":"2026-05-17T18:36:14.831Z","type":"ingest","tenantId":"tenant_a","path":"research/BRAND.md","parser":"markdown","chunks":1}
|
|
9
|
-
{"at":"2026-05-17T18:36:14.837Z","type":"parse","tenantId":"tenant_a","parser":"html","path":"page.html","chunks":1}
|
|
10
|
-
{"at":"2026-05-18T05:20:20.478Z","type":"parse","tenantId":"tenant_a","parser":"markdown","path":"research/BRAND.md","chunks":1}
|
|
11
|
-
{"at":"2026-05-18T05:20:20.498Z","type":"ingest","tenantId":"tenant_a","path":"research/BRAND.md","parser":"markdown","chunks":1}
|
|
12
|
-
{"at":"2026-05-18T05:20:20.514Z","type":"parse","tenantId":"tenant_a","parser":"html","path":"page.html","chunks":1}
|
|
13
|
-
{"at":"2026-05-18T05:50:56.504Z","type":"parse","tenantId":"tenant_a","parser":"markdown","path":"research/BRAND.md","chunks":1}
|
|
14
|
-
{"at":"2026-05-18T05:50:56.517Z","type":"ingest","tenantId":"tenant_a","path":"research/BRAND.md","parser":"markdown","chunks":1}
|
|
15
|
-
{"at":"2026-05-18T05:50:56.534Z","type":"parse","tenantId":"tenant_a","parser":"html","path":"page.html","chunks":1}
|
|
16
|
-
{"at":"2026-05-19T05:21:58.319Z","type":"parse","tenantId":"tenant_a","parser":"markdown","path":"research/BRAND.md","chunks":1}
|
|
17
|
-
{"at":"2026-05-19T05:21:58.328Z","type":"ingest","tenantId":"tenant_a","path":"research/BRAND.md","parser":"markdown","chunks":1}
|
|
18
|
-
{"at":"2026-05-19T05:21:58.336Z","type":"parse","tenantId":"tenant_a","parser":"html","path":"page.html","chunks":1}
|
|
19
|
-
{"at":"2026-05-19T05:25:37.228Z","type":"parse","tenantId":"tenant_a","parser":"markdown","path":"research/BRAND.md","chunks":1}
|
|
20
|
-
{"at":"2026-05-19T05:25:37.244Z","type":"ingest","tenantId":"tenant_a","path":"research/BRAND.md","parser":"markdown","chunks":1}
|
|
21
|
-
{"at":"2026-05-19T05:25:37.260Z","type":"parse","tenantId":"tenant_a","parser":"html","path":"page.html","chunks":1}
|
|
22
|
-
{"at":"2026-05-30T21:06:21.593Z","type":"parse","tenantId":"tenant_a","parser":"markdown","path":"research/BRAND.md","chunks":1}
|
|
23
|
-
{"at":"2026-05-30T21:06:21.615Z","type":"ingest","tenantId":"tenant_a","path":"research/BRAND.md","parser":"markdown","chunks":1}
|
|
24
|
-
{"at":"2026-05-30T21:06:21.626Z","type":"parse","tenantId":"tenant_a","parser":"html","path":"page.html","chunks":1}
|
|
25
|
-
{"at":"2026-07-01T01:38:44.083Z","type":"parse","tenantId":"tenant_a","parser":"markdown","path":"research/BRAND.md","chunks":1}
|
|
26
|
-
{"at":"2026-07-01T01:38:44.119Z","type":"ingest","tenantId":"tenant_a","path":"research/BRAND.md","parser":"markdown","chunks":1}
|
|
27
|
-
{"at":"2026-07-01T01:38:44.135Z","type":"parse","tenantId":"tenant_a","parser":"html","path":"page.html","chunks":1}
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @nebutra/document-pipeline@0.1.2 build /Users/tseka_luk/Documents/Nebutra-SaaS-Lab/Nebutra-Sailor/packages/ai/document-pipeline
|
|
3
|
-
> tsup
|
|
4
|
-
|
|
5
|
-
CLI Building entry: src/cli.ts, src/index.ts
|
|
6
|
-
CLI Using tsconfig: tsconfig.json
|
|
7
|
-
CLI tsup v8.5.1
|
|
8
|
-
CLI Using tsup config: /Users/tseka_luk/Documents/Nebutra-SaaS-Lab/Nebutra-Sailor/packages/ai/document-pipeline/tsup.config.ts
|
|
9
|
-
CLI Target: es2022
|
|
10
|
-
CLI Cleaning output folder
|
|
11
|
-
ESM Build start
|
|
12
|
-
ESM dist/cli.js 1.10 KB
|
|
13
|
-
ESM dist/index.js 180.00 B
|
|
14
|
-
ESM dist/chunk-UF5MSWGW.js 7.83 KB
|
|
15
|
-
ESM dist/index.js.map 71.00 B
|
|
16
|
-
ESM dist/cli.js.map 1.93 KB
|
|
17
|
-
ESM dist/chunk-UF5MSWGW.js.map 16.68 KB
|
|
18
|
-
ESM ⚡️ Build success in 58ms
|
|
19
|
-
DTS Build start
|
|
20
|
-
DTS ⚡️ Build success in 2940ms
|
|
21
|
-
DTS dist/cli.d.ts 13.00 B
|
|
22
|
-
DTS dist/index.d.ts 3.44 KB
|
package/.turbo/turbo-test.log
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @nebutra/document-pipeline@0.1.1 test /Users/tseka_luk/Documents/Nebutra-SaaS-Lab/Nebutra-Sailor/packages/ai/document-pipeline
|
|
3
|
-
> vitest run
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
RUN v4.1.4 /Users/tseka_luk/Documents/Nebutra-SaaS-Lab/Nebutra-Sailor/packages/ai/document-pipeline
|
|
7
|
-
|
|
8
|
-
(node:45791) ExperimentalWarning: SQLite is an experimental feature and might change at any time
|
|
9
|
-
(Use `node --trace-warnings ...` to show where the warning was created)
|
|
10
|
-
✓ src/index.test.ts (5 tests) 118ms
|
|
11
|
-
|
|
12
|
-
Test Files 1 passed (1)
|
|
13
|
-
Tests 5 passed (5)
|
|
14
|
-
Start at 09:38:43
|
|
15
|
-
Duration 1.00s (transform 132ms, setup 0ms, import 196ms, tests 118ms, environment 0ms)
|
|
16
|
-
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DocumentPipeline } from "@nebutra/document-pipeline";
|
|
2
|
-
|
|
3
|
-
const pipeline = await DocumentPipeline.open(".nebutra/document-pipeline-example", {
|
|
4
|
-
tenantId: "local",
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
const result = await pipeline.ingest({
|
|
8
|
-
tenantId: "local",
|
|
9
|
-
source: {
|
|
10
|
-
type: "inline",
|
|
11
|
-
path: "research/note.md",
|
|
12
|
-
content: "---\nschema: research_note\n---\nretrieval augmented generation notes",
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
package/examples/parse-html.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DocumentPipeline } from "@nebutra/document-pipeline";
|
|
2
|
-
|
|
3
|
-
const pipeline = await DocumentPipeline.open(".nebutra/document-pipeline-example", {
|
|
4
|
-
tenantId: "local",
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
const result = await pipeline.parse({
|
|
8
|
-
tenantId: "local",
|
|
9
|
-
source: {
|
|
10
|
-
type: "inline",
|
|
11
|
-
path: "landing.html",
|
|
12
|
-
content: "<h1>Launch</h1><p>Clear operator language</p>",
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
package/examples/sidecar-gate.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DocumentPipeline } from "@nebutra/document-pipeline";
|
|
2
|
-
|
|
3
|
-
const pipeline = await DocumentPipeline.open(".nebutra/document-pipeline-example", {
|
|
4
|
-
tenantId: "local",
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
try {
|
|
8
|
-
await pipeline.parse({
|
|
9
|
-
tenantId: "local",
|
|
10
|
-
source: { type: "file", path: "paper.pdf" },
|
|
11
|
-
});
|
|
12
|
-
} catch (error) {
|
|
13
|
-
process.stdout.write(`${JSON.stringify(error, null, 2)}\n`);
|
|
14
|
-
}
|
package/src/cli.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { DocumentPipeline, readDocumentPipelineDebug } from "./index";
|
|
2
|
-
|
|
3
|
-
const command = process.argv[2] ?? "doctor";
|
|
4
|
-
const pipeline = await DocumentPipeline.open(
|
|
5
|
-
process.env.DOCUMENT_PIPELINE_ROOT ?? ".nebutra/document-pipeline",
|
|
6
|
-
{
|
|
7
|
-
tenantId: process.env.NEBUTRA_TENANT_ID ?? "local",
|
|
8
|
-
},
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
if (command === "doctor") {
|
|
12
|
-
process.stdout.write(`${JSON.stringify(await pipeline.doctor(), null, 2)}\n`);
|
|
13
|
-
} else if (command === "ingest") {
|
|
14
|
-
const path = process.argv[3];
|
|
15
|
-
if (!path) {
|
|
16
|
-
process.stderr.write("Usage: pnpm docs:ingest <path>\n");
|
|
17
|
-
process.exitCode = 1;
|
|
18
|
-
} else {
|
|
19
|
-
process.stdout.write(
|
|
20
|
-
`${JSON.stringify({ capability: "document-pipeline", result: await pipeline.ingestFile(path) }, null, 2)}\n`,
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
} else if (command === "inspect" || command === "debug") {
|
|
24
|
-
const entries = await readDocumentPipelineDebug();
|
|
25
|
-
process.stdout.write(
|
|
26
|
-
`${JSON.stringify({ capability: "document-pipeline", entries }, null, 2)}\n`,
|
|
27
|
-
);
|
|
28
|
-
} else {
|
|
29
|
-
process.stderr.write(`Unknown document-pipeline command: ${command}\n`);
|
|
30
|
-
process.exitCode = 1;
|
|
31
|
-
}
|
package/src/index.test.ts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
2
|
-
import { tmpdir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { ContentStore } from "@nebutra/content-store";
|
|
5
|
-
import { afterEach, describe, expect, it } from "vitest";
|
|
6
|
-
import { DocumentPipeline, readDocumentPipelineDebug } from "./index";
|
|
7
|
-
|
|
8
|
-
let root: string | undefined;
|
|
9
|
-
let store: ContentStore | undefined;
|
|
10
|
-
|
|
11
|
-
afterEach(async () => {
|
|
12
|
-
if (store) await store.close();
|
|
13
|
-
if (root) await rm(root, { recursive: true, force: true });
|
|
14
|
-
root = undefined;
|
|
15
|
-
store = undefined;
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
describe("DocumentPipeline", () => {
|
|
19
|
-
it("ingests frontmatter-aware markdown into content-store", async () => {
|
|
20
|
-
root = await mkdtemp(join(tmpdir(), "document-pipeline-"));
|
|
21
|
-
store = await ContentStore.open(join(root, "content"), { tenantId: "tenant_a" });
|
|
22
|
-
const pipeline = new DocumentPipeline({ tenantId: "tenant_a", contentStore: store });
|
|
23
|
-
|
|
24
|
-
const result = await pipeline.ingest({
|
|
25
|
-
tenantId: "tenant_a",
|
|
26
|
-
source: {
|
|
27
|
-
type: "inline",
|
|
28
|
-
path: "research/BRAND.md",
|
|
29
|
-
content: "---\nschema: note\n---\nretrieval note",
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
expect(result).toMatchObject({ path: "research/BRAND.md", chunkCount: 1 });
|
|
34
|
-
await expect(
|
|
35
|
-
store.search().query("retrieval").filter({ schema: "note" }).topK(5),
|
|
36
|
-
).resolves.toHaveLength(1);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it("parses html through the lightweight deterministic parser", async () => {
|
|
40
|
-
root = await mkdtemp(join(tmpdir(), "document-pipeline-"));
|
|
41
|
-
store = await ContentStore.open(join(root, "content"), { tenantId: "tenant_a" });
|
|
42
|
-
const pipeline = new DocumentPipeline({ tenantId: "tenant_a", contentStore: store });
|
|
43
|
-
|
|
44
|
-
const parsed = await pipeline.parse({
|
|
45
|
-
tenantId: "tenant_a",
|
|
46
|
-
source: { type: "inline", path: "page.html", content: "<h1>Title</h1><p>Useful body</p>" },
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
expect(parsed.chunks[0]?.text).toContain("Title");
|
|
50
|
-
expect(parsed.chunks[0]?.metadata.mimeType).toBe("text/html");
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it("routes complex binary formats to parser sidecars with a fix suggestion", async () => {
|
|
54
|
-
root = await mkdtemp(join(tmpdir(), "document-pipeline-"));
|
|
55
|
-
const pdfPath = join(root, "paper.pdf");
|
|
56
|
-
await writeFile(pdfPath, "%PDF-1.7\n", "utf8");
|
|
57
|
-
store = await ContentStore.open(join(root, "content"), { tenantId: "tenant_a" });
|
|
58
|
-
const pipeline = new DocumentPipeline({ tenantId: "tenant_a", contentStore: store });
|
|
59
|
-
|
|
60
|
-
await expect(
|
|
61
|
-
pipeline.parse({ tenantId: "tenant_a", source: { type: "file", path: pdfPath } }),
|
|
62
|
-
).rejects.toMatchObject({
|
|
63
|
-
capability: "document-pipeline",
|
|
64
|
-
suggestion: expect.stringContaining("parser sidecar"),
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it("requires tenant context for persistent ingestion", async () => {
|
|
69
|
-
const pipeline = new DocumentPipeline();
|
|
70
|
-
await expect(
|
|
71
|
-
pipeline.ingest({ source: { type: "inline", path: "note.md", content: "hello" } }),
|
|
72
|
-
).rejects.toMatchObject({
|
|
73
|
-
capability: "document-pipeline",
|
|
74
|
-
suggestion: expect.stringContaining("tenantId"),
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it("writes inspectable debug records", async () => {
|
|
79
|
-
root = await mkdtemp(join(tmpdir(), "document-pipeline-"));
|
|
80
|
-
store = await ContentStore.open(join(root, "content"), { tenantId: "tenant_a" });
|
|
81
|
-
const pipeline = new DocumentPipeline({
|
|
82
|
-
tenantId: "tenant_a",
|
|
83
|
-
contentStore: store,
|
|
84
|
-
debugRoot: root,
|
|
85
|
-
});
|
|
86
|
-
await pipeline.ingest({
|
|
87
|
-
tenantId: "tenant_a",
|
|
88
|
-
source: { type: "inline", path: "notes/a.md", content: "debuggable chunk" },
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
expect(await readDocumentPipelineDebug(root)).toEqual(expect.any(Array));
|
|
92
|
-
});
|
|
93
|
-
});
|
package/src/index.ts
DELETED
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { extname, join } from "node:path";
|
|
3
|
-
import { requireCapabilityTenant } from "@nebutra/capability-kit";
|
|
4
|
-
import { appendCapabilityDebug, readCapabilityDebug } from "@nebutra/capability-kit/debug";
|
|
5
|
-
import {
|
|
6
|
-
ContentStore,
|
|
7
|
-
parseContentFrontmatter,
|
|
8
|
-
serializeContentFrontmatter,
|
|
9
|
-
splitContentParagraphs,
|
|
10
|
-
} from "@nebutra/content-store";
|
|
11
|
-
import { CapabilityError } from "@nebutra/errors";
|
|
12
|
-
|
|
13
|
-
export type ParserChoice = "auto" | "markdown" | "html" | "text" | "sidecar";
|
|
14
|
-
export type ChunkerChoice = "paragraph" | "recursive" | "hierarchical";
|
|
15
|
-
|
|
16
|
-
export interface InlineSource {
|
|
17
|
-
readonly type: "inline";
|
|
18
|
-
readonly path: string;
|
|
19
|
-
readonly content: string;
|
|
20
|
-
readonly mimeType?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface FileSource {
|
|
24
|
-
readonly type: "file";
|
|
25
|
-
readonly path: string;
|
|
26
|
-
readonly mimeType?: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export type DocumentSource = InlineSource | FileSource;
|
|
30
|
-
|
|
31
|
-
export interface IngestRequest {
|
|
32
|
-
readonly tenantId?: string;
|
|
33
|
-
readonly source: DocumentSource;
|
|
34
|
-
readonly parser?: ParserChoice;
|
|
35
|
-
readonly chunker?: ChunkerChoice;
|
|
36
|
-
readonly targetPath?: string;
|
|
37
|
-
readonly metadata?: Record<string, string>;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface ParseRequest {
|
|
41
|
-
readonly tenantId?: string;
|
|
42
|
-
readonly source: DocumentSource;
|
|
43
|
-
readonly parser?: ParserChoice;
|
|
44
|
-
readonly chunker?: ChunkerChoice;
|
|
45
|
-
readonly metadata?: Record<string, string>;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface ParsedChunk {
|
|
49
|
-
readonly id: string;
|
|
50
|
-
readonly text: string;
|
|
51
|
-
readonly metadata: {
|
|
52
|
-
readonly tenantId: string;
|
|
53
|
-
readonly sourcePath: string;
|
|
54
|
-
readonly chunkIndex: number;
|
|
55
|
-
readonly mimeType: string;
|
|
56
|
-
readonly parser: ParserChoice;
|
|
57
|
-
readonly heading?: string;
|
|
58
|
-
} & Record<string, string | number>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface ParsedDocument {
|
|
62
|
-
readonly tenantId: string;
|
|
63
|
-
readonly path: string;
|
|
64
|
-
readonly mimeType: string;
|
|
65
|
-
readonly parser: ParserChoice;
|
|
66
|
-
readonly chunks: readonly ParsedChunk[];
|
|
67
|
-
readonly frontmatter: Record<string, string>;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface IngestResult {
|
|
71
|
-
readonly tenantId: string;
|
|
72
|
-
readonly path: string;
|
|
73
|
-
readonly parser: ParserChoice;
|
|
74
|
-
readonly chunkCount: number;
|
|
75
|
-
readonly contentIndexed: true;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface DocumentPipelineDoctorReport {
|
|
79
|
-
readonly capability: "document-pipeline";
|
|
80
|
-
readonly nativeParsers: readonly ParserChoice[];
|
|
81
|
-
readonly sidecarConfigured: boolean;
|
|
82
|
-
readonly contentStore: Awaited<ReturnType<ContentStore["doctor"]>>;
|
|
83
|
-
readonly suggestion?: string;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface DocumentParser {
|
|
87
|
-
parse(request: RequiredTenant<ParseRequest>): Promise<ParsedDocument>;
|
|
88
|
-
doctor(): Promise<{ readonly ok: boolean; readonly suggestion?: string }>;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export interface DocumentPipelineOptions {
|
|
92
|
-
readonly tenantId?: string;
|
|
93
|
-
readonly root?: string;
|
|
94
|
-
readonly debugRoot?: string;
|
|
95
|
-
readonly contentStore?: ContentStore;
|
|
96
|
-
readonly sidecarParser?: DocumentParser;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
type RequiredTenant<T extends { readonly tenantId?: string }> = Omit<T, "tenantId"> & {
|
|
100
|
-
readonly tenantId: string;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export async function readDocumentPipelineDebug(
|
|
104
|
-
root = process.cwd(),
|
|
105
|
-
limit = 20,
|
|
106
|
-
): Promise<unknown[]> {
|
|
107
|
-
return readCapabilityDebug("document-pipeline", { root, limit });
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export class DocumentPipeline {
|
|
111
|
-
readonly #tenantId: string | undefined;
|
|
112
|
-
readonly #root: string;
|
|
113
|
-
readonly #debugRoot: string;
|
|
114
|
-
readonly #contentStore: ContentStore | undefined;
|
|
115
|
-
readonly #sidecarParser: DocumentParser | undefined;
|
|
116
|
-
|
|
117
|
-
constructor(options: DocumentPipelineOptions = {}) {
|
|
118
|
-
this.#tenantId = options.tenantId;
|
|
119
|
-
this.#root = options.root ?? join(process.cwd(), ".nebutra", "document-pipeline");
|
|
120
|
-
this.#debugRoot = options.debugRoot ?? process.cwd();
|
|
121
|
-
this.#contentStore = options.contentStore;
|
|
122
|
-
this.#sidecarParser = options.sidecarParser;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
static async open(
|
|
126
|
-
root = ".nebutra/document-pipeline",
|
|
127
|
-
options: Omit<DocumentPipelineOptions, "root" | "contentStore"> = {},
|
|
128
|
-
): Promise<DocumentPipeline> {
|
|
129
|
-
const tenantId = options.tenantId ?? "local";
|
|
130
|
-
const contentStore = await ContentStore.open(join(root, "content"), { tenantId });
|
|
131
|
-
return new DocumentPipeline({ ...options, tenantId, root, contentStore });
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
async parse(request: ParseRequest): Promise<ParsedDocument> {
|
|
135
|
-
const tenantId = requireCapabilityTenant({
|
|
136
|
-
explicit: request.tenantId,
|
|
137
|
-
fallback: this.#tenantId,
|
|
138
|
-
onMissing: () =>
|
|
139
|
-
new CapabilityError("document-pipeline", "Document ingestion requires tenant context", {
|
|
140
|
-
suggestion:
|
|
141
|
-
"Pass tenantId on the request or construct DocumentPipeline with a tenantId default.",
|
|
142
|
-
statusCode: 400,
|
|
143
|
-
}),
|
|
144
|
-
});
|
|
145
|
-
const required: RequiredTenant<ParseRequest> = { ...request, tenantId };
|
|
146
|
-
const parser = this.#chooseParser(required);
|
|
147
|
-
if (parser === "sidecar") {
|
|
148
|
-
if (!this.#sidecarParser) {
|
|
149
|
-
throw new CapabilityError("document-pipeline", "Parser sidecar is not configured", {
|
|
150
|
-
suggestion:
|
|
151
|
-
"Configure the parser sidecar for PDFs, office files, OCR, and layout-aware extraction.",
|
|
152
|
-
statusCode: 503,
|
|
153
|
-
metadata: { path: request.source.path },
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
const parsed = await this.#sidecarParser.parse(required);
|
|
157
|
-
await appendCapabilityDebug(
|
|
158
|
-
"document-pipeline",
|
|
159
|
-
{
|
|
160
|
-
type: "parse",
|
|
161
|
-
tenantId,
|
|
162
|
-
parser: "sidecar",
|
|
163
|
-
path: parsed.path,
|
|
164
|
-
},
|
|
165
|
-
{ root: this.#debugRoot },
|
|
166
|
-
);
|
|
167
|
-
return parsed;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
const raw = await readSource(request.source);
|
|
171
|
-
const parsed = parseNativeDocument(required, raw, parser);
|
|
172
|
-
await appendCapabilityDebug(
|
|
173
|
-
"document-pipeline",
|
|
174
|
-
{
|
|
175
|
-
type: "parse",
|
|
176
|
-
tenantId,
|
|
177
|
-
parser,
|
|
178
|
-
path: parsed.path,
|
|
179
|
-
chunks: parsed.chunks.length,
|
|
180
|
-
},
|
|
181
|
-
{ root: this.#debugRoot },
|
|
182
|
-
);
|
|
183
|
-
return parsed;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
async ingest(request: IngestRequest): Promise<IngestResult> {
|
|
187
|
-
const tenantId = requireCapabilityTenant({
|
|
188
|
-
explicit: request.tenantId,
|
|
189
|
-
fallback: this.#tenantId,
|
|
190
|
-
onMissing: () =>
|
|
191
|
-
new CapabilityError("document-pipeline", "Document ingestion requires tenant context", {
|
|
192
|
-
suggestion:
|
|
193
|
-
"Pass tenantId on the request or construct DocumentPipeline with a tenantId default.",
|
|
194
|
-
statusCode: 400,
|
|
195
|
-
}),
|
|
196
|
-
});
|
|
197
|
-
const contentStore = await this.#resolveContentStore(tenantId);
|
|
198
|
-
const parsed = await this.parse({ ...request, tenantId });
|
|
199
|
-
const targetPath = request.targetPath ?? parsed.path;
|
|
200
|
-
const content = serializeForContentStore(parsed, request.metadata);
|
|
201
|
-
await contentStore.write(targetPath, content);
|
|
202
|
-
await appendCapabilityDebug(
|
|
203
|
-
"document-pipeline",
|
|
204
|
-
{
|
|
205
|
-
type: "ingest",
|
|
206
|
-
tenantId,
|
|
207
|
-
path: targetPath,
|
|
208
|
-
parser: parsed.parser,
|
|
209
|
-
chunks: parsed.chunks.length,
|
|
210
|
-
},
|
|
211
|
-
{ root: this.#debugRoot },
|
|
212
|
-
);
|
|
213
|
-
return {
|
|
214
|
-
tenantId,
|
|
215
|
-
path: targetPath,
|
|
216
|
-
parser: parsed.parser,
|
|
217
|
-
chunkCount: parsed.chunks.length,
|
|
218
|
-
contentIndexed: true,
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
async ingestFile(
|
|
223
|
-
path: string,
|
|
224
|
-
options: Omit<IngestRequest, "source"> = {},
|
|
225
|
-
): Promise<IngestResult> {
|
|
226
|
-
return this.ingest({ ...options, source: { type: "file", path } });
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
async doctor(): Promise<DocumentPipelineDoctorReport> {
|
|
230
|
-
const contentStore = await this.#resolveContentStore(this.#tenantId ?? "local");
|
|
231
|
-
const sidecar = this.#sidecarParser ? await this.#sidecarParser.doctor() : { ok: false };
|
|
232
|
-
return {
|
|
233
|
-
capability: "document-pipeline",
|
|
234
|
-
nativeParsers: ["markdown", "html", "text"],
|
|
235
|
-
sidecarConfigured: sidecar.ok,
|
|
236
|
-
contentStore: await contentStore.doctor(),
|
|
237
|
-
...(sidecar.ok
|
|
238
|
-
? {}
|
|
239
|
-
: {
|
|
240
|
-
suggestion:
|
|
241
|
-
"Native parsers are active; configure the parser sidecar before ingesting PDFs, office files, OCR, or complex layout documents.",
|
|
242
|
-
}),
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
#chooseParser(request: RequiredTenant<ParseRequest>): ParserChoice {
|
|
247
|
-
if (request.parser && request.parser !== "auto") return request.parser;
|
|
248
|
-
const mime = request.source.mimeType ?? mimeFromPath(request.source.path);
|
|
249
|
-
if (mime === "text/markdown") return "markdown";
|
|
250
|
-
if (mime === "text/html") return "html";
|
|
251
|
-
if (mime.startsWith("text/")) return "text";
|
|
252
|
-
return "sidecar";
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
async #resolveContentStore(tenantId: string): Promise<ContentStore> {
|
|
256
|
-
if (this.#contentStore) return this.#contentStore;
|
|
257
|
-
return ContentStore.open(join(this.#root, "content"), { tenantId });
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
async function readSource(source: DocumentSource): Promise<string> {
|
|
262
|
-
return source.type === "inline" ? source.content : readFile(source.path, "utf8");
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
function mimeFromPath(path: string): string {
|
|
266
|
-
const extension = extname(path).toLowerCase();
|
|
267
|
-
if (extension === ".md" || extension === ".mdx") return "text/markdown";
|
|
268
|
-
if (extension === ".html" || extension === ".htm") return "text/html";
|
|
269
|
-
if (extension === ".txt" || extension === ".csv" || extension === ".json") return "text/plain";
|
|
270
|
-
if (extension === ".pdf") return "application/pdf";
|
|
271
|
-
if (extension === ".docx")
|
|
272
|
-
return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
273
|
-
if (extension === ".pptx")
|
|
274
|
-
return "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
275
|
-
if (extension === ".png" || extension === ".jpg" || extension === ".jpeg") return "image";
|
|
276
|
-
return "application/octet-stream";
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
function parseNativeDocument(
|
|
280
|
-
request: RequiredTenant<ParseRequest>,
|
|
281
|
-
raw: string,
|
|
282
|
-
parser: ParserChoice,
|
|
283
|
-
): ParsedDocument {
|
|
284
|
-
const mimeType = request.source.mimeType ?? mimeFromPath(request.source.path);
|
|
285
|
-
const { frontmatter, body } =
|
|
286
|
-
parser === "markdown" ? parseContentFrontmatter(raw) : { frontmatter: {}, body: raw };
|
|
287
|
-
const text = parser === "html" ? htmlToText(body) : body;
|
|
288
|
-
const chunks = splitContentParagraphs(text).map((chunk, index) => ({
|
|
289
|
-
id: `${request.tenantId}:${request.source.path}:${index}`,
|
|
290
|
-
text: chunk,
|
|
291
|
-
metadata: {
|
|
292
|
-
tenantId: request.tenantId,
|
|
293
|
-
sourcePath: request.source.path,
|
|
294
|
-
chunkIndex: index,
|
|
295
|
-
mimeType,
|
|
296
|
-
parser,
|
|
297
|
-
...(request.metadata ?? {}),
|
|
298
|
-
},
|
|
299
|
-
}));
|
|
300
|
-
return {
|
|
301
|
-
tenantId: request.tenantId,
|
|
302
|
-
path: request.source.path,
|
|
303
|
-
mimeType,
|
|
304
|
-
parser,
|
|
305
|
-
chunks:
|
|
306
|
-
chunks.length > 0
|
|
307
|
-
? chunks
|
|
308
|
-
: [
|
|
309
|
-
{
|
|
310
|
-
id: `${request.tenantId}:${request.source.path}:0`,
|
|
311
|
-
text,
|
|
312
|
-
metadata: {
|
|
313
|
-
tenantId: request.tenantId,
|
|
314
|
-
sourcePath: request.source.path,
|
|
315
|
-
chunkIndex: 0,
|
|
316
|
-
mimeType,
|
|
317
|
-
parser,
|
|
318
|
-
...(request.metadata ?? {}),
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
],
|
|
322
|
-
frontmatter,
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
function serializeForContentStore(
|
|
327
|
-
parsed: ParsedDocument,
|
|
328
|
-
metadata: Record<string, string> | undefined,
|
|
329
|
-
): string {
|
|
330
|
-
const frontmatter = {
|
|
331
|
-
...parsed.frontmatter,
|
|
332
|
-
...(metadata ?? {}),
|
|
333
|
-
source_mime: parsed.mimeType,
|
|
334
|
-
parser: parsed.parser,
|
|
335
|
-
};
|
|
336
|
-
const body = parsed.chunks.map((chunk) => chunk.text).join("\n\n");
|
|
337
|
-
return serializeContentFrontmatter(frontmatter, body);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
function htmlToText(html: string): string {
|
|
341
|
-
return html
|
|
342
|
-
.replace(/<script[\s\S]{0,200000}?<\/script>/gi, " ")
|
|
343
|
-
.replace(/<style[\s\S]{0,200000}?<\/style>/gi, " ")
|
|
344
|
-
.replace(/<\/(h[1-6]|p|li|tr|div)>/gi, "\n\n")
|
|
345
|
-
.replace(/<[^>]{0,2000}>/g, " ")
|
|
346
|
-
.replace(/ /g, " ")
|
|
347
|
-
.replace(/</g, "<")
|
|
348
|
-
.replace(/>/g, ">")
|
|
349
|
-
.replace(/&/g, "&")
|
|
350
|
-
.replace(/[ \t]+/g, " ")
|
|
351
|
-
.replace(/\n\s+/g, "\n")
|
|
352
|
-
.trim();
|
|
353
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"target": "esnext",
|
|
7
|
-
"types": ["node"],
|
|
8
|
-
"incremental": false
|
|
9
|
-
},
|
|
10
|
-
"include": ["src", "examples"],
|
|
11
|
-
"exclude": ["node_modules", "dist"]
|
|
12
|
-
}
|
package/tsup.config.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "tsup";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
entry: ["src/index.ts", "src/cli.ts"],
|
|
5
|
-
format: ["esm"],
|
|
6
|
-
dts: true,
|
|
7
|
-
sourcemap: true,
|
|
8
|
-
clean: true,
|
|
9
|
-
target: "es2022",
|
|
10
|
-
external: [
|
|
11
|
-
"@nebutra/capability-kit/debug",
|
|
12
|
-
"@nebutra/content-store",
|
|
13
|
-
"@nebutra/errors",
|
|
14
|
-
"@nebutra/sandbox-runtime",
|
|
15
|
-
],
|
|
16
|
-
});
|