@tiangong-ai/cli 0.0.19 → 0.0.20

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.
Files changed (43) hide show
  1. package/AGENTS.md +8 -2
  2. package/README.md +72 -4
  3. package/dist/cli.js +2 -0
  4. package/dist/cli.js.map +1 -1
  5. package/dist/research/commands.js +6 -0
  6. package/dist/research/commands.js.map +1 -1
  7. package/dist/research/orchestration.d.ts +3 -0
  8. package/dist/research/orchestration.js +236 -0
  9. package/dist/research/orchestration.js.map +1 -0
  10. package/dist/research/workspace/broker.d.ts +5 -0
  11. package/dist/research/workspace/broker.js +353 -0
  12. package/dist/research/workspace/broker.js.map +1 -0
  13. package/dist/research/workspace/capabilities.d.ts +10 -0
  14. package/dist/research/workspace/capabilities.js +291 -0
  15. package/dist/research/workspace/capabilities.js.map +1 -0
  16. package/dist/research/workspace/constants.d.ts +8 -0
  17. package/dist/research/workspace/constants.js +37 -0
  18. package/dist/research/workspace/constants.js.map +1 -0
  19. package/dist/research/workspace/context.d.ts +3 -0
  20. package/dist/research/workspace/context.js +77 -0
  21. package/dist/research/workspace/context.js.map +1 -0
  22. package/dist/research/workspace/executor.d.ts +12 -0
  23. package/dist/research/workspace/executor.js +353 -0
  24. package/dist/research/workspace/executor.js.map +1 -0
  25. package/dist/research/workspace/journal.d.ts +7 -0
  26. package/dist/research/workspace/journal.js +104 -0
  27. package/dist/research/workspace/journal.js.map +1 -0
  28. package/dist/research/workspace/projects.d.ts +9 -0
  29. package/dist/research/workspace/projects.js +230 -0
  30. package/dist/research/workspace/projects.js.map +1 -0
  31. package/dist/research/workspace/runtime.d.ts +27 -0
  32. package/dist/research/workspace/runtime.js +519 -0
  33. package/dist/research/workspace/runtime.js.map +1 -0
  34. package/dist/research/workspace/storage.d.ts +25 -0
  35. package/dist/research/workspace/storage.js +218 -0
  36. package/dist/research/workspace/storage.js.map +1 -0
  37. package/dist/research/workspace/types.d.ts +181 -0
  38. package/dist/research/workspace/types.js +2 -0
  39. package/dist/research/workspace/types.js.map +1 -0
  40. package/dist/research/workspace/workspace.d.ts +12 -0
  41. package/dist/research/workspace/workspace.js +340 -0
  42. package/dist/research/workspace/workspace.js.map +1 -0
  43. package/package.json +3 -2
package/AGENTS.md CHANGED
@@ -15,8 +15,8 @@ checkPaths:
15
15
  - .docpact/config.yaml
16
16
  - docs/agents/**
17
17
  - src/**
18
- lastReviewedAt: 2026-07-22
19
- lastReviewedCommit: 2a1945321c66b1a2215b515e4d2b477572a3d6ac
18
+ lastReviewedAt: 2026-08-04
19
+ lastReviewedCommit: 7429c2ab92509920a2728dc38685ad5c4f2c8f13
20
20
  ---
21
21
 
22
22
  # Tiangong AI CLI Contract
@@ -44,6 +44,12 @@ This repository owns the Tiangong AI command-line interface.
44
44
  - `tiangong-ai kb ingest export`
45
45
  - `tiangong-ai kb collections`
46
46
  - `tiangong-ai kb status`
47
+ - `tiangong-ai research context`
48
+ - `tiangong-ai research workspace`
49
+ - `tiangong-ai research capability`
50
+ - `tiangong-ai research project`
51
+ - `tiangong-ai research status`
52
+ - `tiangong-ai research run`
47
53
  - `tiangong-ai research search`
48
54
  - `tiangong-ai education search`
49
55
 
package/README.md CHANGED
@@ -12,8 +12,8 @@ checkPaths:
12
12
  - package.json
13
13
  - bin/**
14
14
  - src/**
15
- lastReviewedAt: 2026-06-01
16
- lastReviewedCommit: 09572bea5a50c07a5a8e023a2b7e180cbd037d75
15
+ lastReviewedAt: 2026-08-04
16
+ lastReviewedCommit: 7429c2ab92509920a2728dc38685ad5c4f2c8f13
17
17
  ---
18
18
 
19
19
  # Tiangong AI CLI
@@ -175,6 +175,69 @@ region are resolved by the AWS SDK, including `AWS_ACCESS_KEY_ID`,
175
175
  `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`, `AWS_PROFILE`, `AWS_REGION`, and
176
176
  `AWS_DEFAULT_REGION`.
177
177
 
178
+ ## Research Workspaces
179
+
180
+ Create a bounded research workspace and register a question:
181
+
182
+ ```bash
183
+ tiangong-ai research workspace init /absolute/path/to/workspace
184
+ tiangong-ai research project init gpu-resource-impact \
185
+ --workspace /absolute/path/to/workspace \
186
+ --question "How do advanced GPU process nodes change environmental resource burdens?"
187
+ ```
188
+
189
+ The workspace stores its current protocol state under `.tiangong-research/`.
190
+ Each project follows five ordered stages: evidence discovery, analysis,
191
+ synthesis, independent review, and mechanical closure. Producer work defaults
192
+ to Codex, independent review defaults to Claude, and a run is blocked when both
193
+ routes use the same agent family.
194
+
195
+ Research execution requires `/usr/bin/sandbox-exec` on macOS or Bubblewrap
196
+ (`bwrap`) on Linux. Windows can inspect and configure workspaces but does not
197
+ execute research packages.
198
+
199
+ Add immutable local evidence, verify the workspace, and execute ready work:
200
+
201
+ ```bash
202
+ tiangong-ai research project input add gpu-resource-impact \
203
+ --workspace /absolute/path/to/workspace \
204
+ --path /absolute/path/to/inventory.csv \
205
+ --role primary
206
+ tiangong-ai research workspace doctor --workspace /absolute/path/to/workspace
207
+ tiangong-ai research run --workspace /absolute/path/to/workspace --max-parallel 2
208
+ tiangong-ai research status --workspace /absolute/path/to/workspace --json
209
+ ```
210
+
211
+ Inputs are admitted by SHA-256. Agent work runs in an ephemeral platform
212
+ sandbox, only declared outputs are imported, and the workspace journal is a
213
+ hash chain. Token, reported-cost, wall-time, output-count, output-size, and retry
214
+ limits are hard budgets in `.tiangong-research/config.json`.
215
+
216
+ Every evidence source must resolve to an admitted input or a completed broker
217
+ receipt. Findings may reference only admitted source IDs. Independent review
218
+ binds a runtime-generated packet containing the question, inputs, and artifact
219
+ hashes before mechanical closure can succeed.
220
+
221
+ Method skills are declared in `.tiangong-research/capabilities.json` with
222
+ absolute skill paths and explicit permissions, then frozen before execution:
223
+
224
+ ```bash
225
+ tiangong-ai research capability lock --workspace /absolute/path/to/workspace
226
+ tiangong-ai research capability verify --workspace /absolute/path/to/workspace
227
+ ```
228
+
229
+ A capability using `brokered-network` must declare exact `allowedHosts`.
230
+ Optional credentials declare logical IDs, exact host scopes, header names, and
231
+ prefixes. Put only the logical value map in `.tiangong-research/.env`:
232
+
233
+ ```bash
234
+ TIANGONG_RESEARCH_CAPABILITY_CREDENTIALS_JSON={"source.example.api":"owner-provided-value"}
235
+ ```
236
+
237
+ The broker injects declared credentials only for admitted HTTPS hosts. Agent
238
+ processes do not receive this variable. Keep the file owner-only (`chmod 600`)
239
+ and use `research workspace doctor` before a run.
240
+
178
241
  ## Research Search
179
242
 
180
243
  Forward research-oriented search requests to SCI, report, patent, and ESG edge
@@ -235,8 +298,13 @@ appends `course_search`, `edu_search`, or `textbook_search`.
235
298
 
236
299
  ## Boundary
237
300
 
238
- The CLI is a thin local client. It sends bearer-token requests to the Tiangong
239
- KB ingest API and records SQLite checkpoints for batch recovery. Ingest uses
301
+ The CLI owns local operator workflows. Research workspaces keep bounded local
302
+ state, capability locks, isolated agent runs, usage accounting, provenance,
303
+ independent review, and deterministic closure. Research capability credentials
304
+ remain in the workspace broker and are not forwarded to agent processes.
305
+
306
+ For KB operations, the CLI sends bearer-token requests to the Tiangong KB
307
+ ingest API and records SQLite checkpoints for batch recovery. Ingest uses
240
308
  the bulk runner and releases sliding-window capacity only when document status
241
309
  is `completed` and both `opensearchIndexed` and `pineconeIndexed` are true. If
242
310
  the status API does not return those index flags yet, the file remains in
package/dist/cli.js CHANGED
@@ -2694,6 +2694,8 @@ Usage:
2694
2694
  tiangong-ai kb ingest status <document-id>
2695
2695
  tiangong-ai kb collections list [--capability upload]
2696
2696
  tiangong-ai kb course fulltext --document-id <id> --tags <tag>
2697
+ tiangong-ai research workspace init <absolute-path>
2698
+ tiangong-ai research run [--workspace <absolute-path>] [--max-parallel 1]
2697
2699
  tiangong-ai research search --input <request.json>|--query <query> [--sources default|all|sci|report|patent|esg]
2698
2700
  tiangong-ai education search --input <request.json>|--query <query> [--sources default|all|course|edu|textbook]
2699
2701