@tiangong-ai/cli 0.0.18 → 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 (47) hide show
  1. package/AGENTS.md +8 -2
  2. package/README.md +81 -12
  3. package/dist/cli.js +3 -1
  4. package/dist/cli.js.map +1 -1
  5. package/dist/research/commands.js +13 -5
  6. package/dist/research/commands.js.map +1 -1
  7. package/dist/research/config.d.ts +1 -0
  8. package/dist/research/config.js +18 -1
  9. package/dist/research/config.js.map +1 -1
  10. package/dist/research/orchestration.d.ts +3 -0
  11. package/dist/research/orchestration.js +236 -0
  12. package/dist/research/orchestration.js.map +1 -0
  13. package/dist/research/types.d.ts +1 -1
  14. package/dist/research/workspace/broker.d.ts +5 -0
  15. package/dist/research/workspace/broker.js +353 -0
  16. package/dist/research/workspace/broker.js.map +1 -0
  17. package/dist/research/workspace/capabilities.d.ts +10 -0
  18. package/dist/research/workspace/capabilities.js +291 -0
  19. package/dist/research/workspace/capabilities.js.map +1 -0
  20. package/dist/research/workspace/constants.d.ts +8 -0
  21. package/dist/research/workspace/constants.js +37 -0
  22. package/dist/research/workspace/constants.js.map +1 -0
  23. package/dist/research/workspace/context.d.ts +3 -0
  24. package/dist/research/workspace/context.js +77 -0
  25. package/dist/research/workspace/context.js.map +1 -0
  26. package/dist/research/workspace/executor.d.ts +12 -0
  27. package/dist/research/workspace/executor.js +353 -0
  28. package/dist/research/workspace/executor.js.map +1 -0
  29. package/dist/research/workspace/journal.d.ts +7 -0
  30. package/dist/research/workspace/journal.js +104 -0
  31. package/dist/research/workspace/journal.js.map +1 -0
  32. package/dist/research/workspace/projects.d.ts +9 -0
  33. package/dist/research/workspace/projects.js +230 -0
  34. package/dist/research/workspace/projects.js.map +1 -0
  35. package/dist/research/workspace/runtime.d.ts +27 -0
  36. package/dist/research/workspace/runtime.js +519 -0
  37. package/dist/research/workspace/runtime.js.map +1 -0
  38. package/dist/research/workspace/storage.d.ts +25 -0
  39. package/dist/research/workspace/storage.js +218 -0
  40. package/dist/research/workspace/storage.js.map +1 -0
  41. package/dist/research/workspace/types.d.ts +181 -0
  42. package/dist/research/workspace/types.js +2 -0
  43. package/dist/research/workspace/types.js.map +1 -0
  44. package/dist/research/workspace/workspace.d.ts +12 -0
  45. package/dist/research/workspace/workspace.js +340 -0
  46. package/dist/research/workspace/workspace.js.map +1 -0
  47. 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-15
19
- lastReviewedCommit: 98e9c2cf94413968689934901f0629684ba418fa
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,9 +175,72 @@ 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
- Forward research-oriented search requests to SCI, report, and patent edge
243
+ Forward research-oriented search requests to SCI, report, patent, and ESG edge
181
244
  search sources:
182
245
 
183
246
  ```bash
@@ -202,13 +265,14 @@ For quick calls, `--query <text>` builds a minimal body with `query` plus
202
265
  optional `--top-k`, `--ext-k`, and `--get-meta`.
203
266
 
204
267
  `--sources` accepts concrete IDs and presets. `default` expands to `sci`; `all`
205
- expands to `sci,report,patent`. Use source-specific endpoint or credential
206
- overrides with `--sci-url`, `--report-url`, `--patent-url`,
207
- `--sci-api-key`, `--report-api-key`, and `--patent-api-key`. When source URLs
208
- are not provided, `--api-base-url` or `TIANGONG_AI_API_BASE_URL` may be a
209
- Supabase project root, `/functions/v1`, or `/rest/v1`; the CLI derives the
210
- Functions base URL and appends `sci_search`, `report_search`, or
211
- `patent_search`.
268
+ expands to `sci,report,patent,esg`. Use source-specific endpoint or credential
269
+ overrides with `--sci-url`, `--report-url`, `--patent-url`, `--esg-url`,
270
+ `--sci-api-key`, `--report-api-key`, `--patent-api-key`, and `--esg-api-key`.
271
+ The equivalent ESG environment variables are `TIANGONG_ESG_SEARCH_URL` and
272
+ `TIANGONG_ESG_APIKEY`. When source URLs are not provided, `--api-base-url` or
273
+ `TIANGONG_AI_API_BASE_URL` may be a Supabase project root, `/functions/v1`, or
274
+ `/rest/v1`; the CLI derives the Functions base URL and appends `sci_search`,
275
+ `report_search`, `patent_search`, or `esg_search`.
212
276
 
213
277
  ## Education Search
214
278
 
@@ -234,8 +298,13 @@ appends `course_search`, `edu_search`, or `textbook_search`.
234
298
 
235
299
  ## Boundary
236
300
 
237
- The CLI is a thin local client. It sends bearer-token requests to the Tiangong
238
- 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
239
308
  the bulk runner and releases sliding-window capacity only when document status
240
309
  is `completed` and both `opensearchIndexed` and `pineconeIndexed` are true. If
241
310
  the status API does not return those index flags yet, the file remains in
package/dist/cli.js CHANGED
@@ -2694,7 +2694,9 @@ 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 search --input <request.json>|--query <query> [--sources default|all|sci|report|patent]
2697
+ tiangong-ai research workspace init <absolute-path>
2698
+ tiangong-ai research run [--workspace <absolute-path>] [--max-parallel 1]
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
 
2700
2702
  Run "tiangong-ai kb --help" for KB options.