@liwenkai/deepcode 0.4.19 → 0.4.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 (2) hide show
  1. package/README.md +33 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -18,6 +18,39 @@ its SHA-256 checksum. Then run:
18
18
  deepcode
19
19
  ```
20
20
 
21
+ ## Use it from your code
22
+
23
+ `deepcode -p "<instruction>"` runs one full turn without a terminal and prints the answer on
24
+ stdout — everything diagnostic goes to stderr, so it pipes cleanly. `--output-format json` turns
25
+ stdout into exactly one object to branch on:
26
+
27
+ | field | type | notes |
28
+ | --- | --- | --- |
29
+ | `status` | string | `finished` / `cancelled` / `timeout` / `error` — branch on this |
30
+ | `result` | string | the answer; empty unless `status` is `finished` |
31
+ | `reasoning` | string | the turn's reasoning text, empty when the model emitted none |
32
+ | `error` | string (optional) | present exactly when `status` is not `finished` |
33
+ | `session_id` | string (optional) | persist it to continue this thread |
34
+ | `denied_approvals` | number | tool calls auto-denied because nobody was there to approve |
35
+ | `duration_ms` | number | wall clock for the turn |
36
+ | `cost` | object (optional) | `{ usd, cny }` |
37
+ | `usage` | object (optional) | token counts |
38
+
39
+ - **Fields are added, never renamed or repurposed**; nothing documented here changes meaning
40
+ without a bump of this contract's version, which is `1`.
41
+ - **Decide by `status`, not the exit code**: a cancelled turn exits `1`, not `124`.
42
+ - **Never use `-c` in a wrapper** — it means "the latest session in this workspace" and races.
43
+ Start with `--new` (the default), keep `session_id`, continue with `--resume <id>`.
44
+ - **`denied_approvals > 0` is not a bad answer**: a tool was refused because no human was there
45
+ to approve it, and a retry fails the same way.
46
+ - **Close stdin when spawning**: an inherited idle pipe costs 2 s on macOS/Linux and hangs on
47
+ Windows, and `--timeout` does not cover that read.
48
+
49
+ Exit codes: `0` finished / `1` error / `2` usage / `124` timeout / `130` Ctrl-C.
50
+
51
+ Full contract, flags and approval posture: [README](https://github.com/liwenka1/deep-code#driving-it-from-another-program)
52
+ (`deepcode --help` lists the flags for the exact version you installed).
53
+
21
54
  ## Supported platforms
22
55
 
23
56
  | OS | Arch |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liwenkai/deepcode",
3
- "version": "0.4.19",
3
+ "version": "0.4.20",
4
4
  "description": "AI coding assistant in your terminal — powered by DeepSeek",
5
5
  "bin": {
6
6
  "deepcode": "bin/deepcode"