@tiangong-ai/cli 0.0.6 → 0.0.8
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/AGENTS.md +2 -2
- package/README.md +35 -23
- package/dist/cli.js +455 -189
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -15,8 +15,8 @@ checkPaths:
|
|
|
15
15
|
- .docpact/config.yaml
|
|
16
16
|
- docs/agents/**
|
|
17
17
|
- src/**
|
|
18
|
-
lastReviewedAt: 2026-05-
|
|
19
|
-
lastReviewedCommit:
|
|
18
|
+
lastReviewedAt: 2026-05-13
|
|
19
|
+
lastReviewedCommit: ab6eccece7808a07d2eb50922967c25bf356066d
|
|
20
20
|
---
|
|
21
21
|
|
|
22
22
|
# Tiangong AI CLI Contract
|
package/README.md
CHANGED
|
@@ -43,16 +43,25 @@ TIANGONG_KB_DEFAULT_COLLECTION_NAME=
|
|
|
43
43
|
The KB API server defaults to `https://thuenv.tiangong.world:7300` with path
|
|
44
44
|
prefix `/api/v1/kb`.
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Run a resumable sliding-window ingest for one file or a folder:
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
tiangong-ai kb ingest
|
|
49
|
+
tiangong-ai kb ingest bulk /path/to/document.pdf \
|
|
50
|
+
--collection-path /course/thu_humanities \
|
|
51
|
+
--poll-interval 30 \
|
|
52
|
+
--max-polls 120
|
|
50
53
|
```
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
Run a larger folder ingest:
|
|
53
56
|
|
|
54
57
|
```bash
|
|
55
|
-
tiangong-ai kb ingest
|
|
58
|
+
tiangong-ai kb ingest bulk /path/to/folder \
|
|
59
|
+
--collection-path /course/thu_humanities \
|
|
60
|
+
--window-size 100 \
|
|
61
|
+
--top-up-max 50 \
|
|
62
|
+
--upload-concurrency 4 \
|
|
63
|
+
--poll-interval 30 \
|
|
64
|
+
--max-polls 120
|
|
56
65
|
```
|
|
57
66
|
|
|
58
67
|
Bulk scan a large folder and emit a structural JSON summary:
|
|
@@ -79,7 +88,7 @@ tiangong-ai kb ingest metadata dry-run /path/to/folder \
|
|
|
79
88
|
--json
|
|
80
89
|
```
|
|
81
90
|
|
|
82
|
-
Run a resumable sliding-window bulk ingest:
|
|
91
|
+
Run a resumable sliding-window bulk ingest with metadata:
|
|
83
92
|
|
|
84
93
|
```bash
|
|
85
94
|
tiangong-ai kb ingest bulk /path/to/folder \
|
|
@@ -88,7 +97,8 @@ tiangong-ai kb ingest bulk /path/to/folder \
|
|
|
88
97
|
--window-size 100 \
|
|
89
98
|
--top-up-max 50 \
|
|
90
99
|
--upload-concurrency 4 \
|
|
91
|
-
--poll-interval 30
|
|
100
|
+
--poll-interval 30 \
|
|
101
|
+
--max-polls 120
|
|
92
102
|
```
|
|
93
103
|
|
|
94
104
|
`tiangong-ai kb ingest bulk run /path/to/folder` is accepted as an explicit
|
|
@@ -101,17 +111,19 @@ stored under the OS app-data directory:
|
|
|
101
111
|
- Linux: `~/.local/share/tiangong-ai/kb-ingest/jobs/<job-id>.sqlite`
|
|
102
112
|
- Windows: `%APPDATA%/tiangong-ai/kb-ingest/jobs/<job-id>.sqlite`
|
|
103
113
|
|
|
104
|
-
Use `--state /path/to/job.sqlite` to override the checkpoint path.
|
|
105
|
-
|
|
114
|
+
Use `--state /path/to/job.sqlite` to override the checkpoint path. Use
|
|
115
|
+
`--max-polls 0` only for operator runs that should wait without a client-side
|
|
116
|
+
polling limit.
|
|
106
117
|
|
|
107
|
-
Bulk ingest
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
metadata
|
|
118
|
+
Bulk ingest scans and fingerprints files first, then lazily creates derived
|
|
119
|
+
files only when a row enters the active upload window. `.docx` files larger than
|
|
120
|
+
10MiB are uploaded through 300dpi-normalized ingest copies; smaller `.docx`
|
|
121
|
+
files upload directly unless they are empty. Oversized PDFs are split into the
|
|
122
|
+
fewest uploadable PDF parts when they enter the window, and the generated part
|
|
123
|
+
rows are written back to SQLite so resume can reuse them. Derived files stay
|
|
124
|
+
under `.tiangong-kb-ingest-derived` by default, and that directory is excluded
|
|
125
|
+
from future bulk scans. Upload metadata remains the user/business metadata
|
|
126
|
+
produced by the metadata map.
|
|
115
127
|
|
|
116
128
|
Manage bulk jobs:
|
|
117
129
|
|
|
@@ -143,13 +155,13 @@ tiangong-ai kb ingest status <document-id>
|
|
|
143
155
|
## Boundary
|
|
144
156
|
|
|
145
157
|
The CLI is a thin local client. It sends bearer-token requests to the Tiangong
|
|
146
|
-
KB ingest API and records
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
158
|
+
KB ingest API and records SQLite checkpoints for batch recovery. Ingest uses
|
|
159
|
+
the bulk runner and releases sliding-window capacity only when document status
|
|
160
|
+
is `completed` and both `opensearchIndexed` and `pineconeIndexed` are true. If
|
|
161
|
+
the status API does not return those index flags yet, the file remains in
|
|
162
|
+
`waiting_for_index_flags`. The backend owns authorization, collection
|
|
163
|
+
permissions, duplicate detection, NAS raw writes, parse queueing, and status
|
|
164
|
+
transitions.
|
|
153
165
|
|
|
154
166
|
## Validation
|
|
155
167
|
|