@easbot/codebase 0.3.13 → 0.3.16

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 (50) hide show
  1. package/README.en.md +42 -0
  2. package/README.md +38 -0
  3. package/dist/chunks/{chunk-DMRAZKIP.cjs → chunk-6CD6Y4F7.cjs} +22 -22
  4. package/dist/chunks/chunk-6ENRFRCH.cjs +34 -0
  5. package/dist/chunks/{chunk-U5G7MP3K.cjs → chunk-BEQN3CKO.cjs} +1 -1
  6. package/dist/chunks/{chunk-PLRTEGLZ.mjs → chunk-BUHCT5PM.mjs} +23 -23
  7. package/dist/chunks/{chunk-P566CDI2.mjs → chunk-CS4EBN3N.mjs} +1 -1
  8. package/dist/chunks/{chunk-4KHRTABC.cjs → chunk-K5CRL5DC.cjs} +6 -6
  9. package/dist/chunks/{chunk-W25T3SKH.mjs → chunk-LFH3RTD3.mjs} +2 -2
  10. package/dist/chunks/{chunk-Z4Y3VCYS.mjs → chunk-P6QT72IP.mjs} +1 -1
  11. package/dist/chunks/{chunk-RLZHDTHY.cjs → chunk-UTPNELRD.cjs} +2 -2
  12. package/dist/chunks/chunk-W2JWBAHR.mjs +34 -0
  13. package/dist/chunks/{chunk-7PW7HWOC.cjs → chunk-WSFETZ24.cjs} +1 -1
  14. package/dist/chunks/{chunk-7ZBQQZOA.mjs → chunk-WXWENWCY.mjs} +1 -1
  15. package/dist/chunks/cli-handler-IDMIMEKA.cjs +1 -0
  16. package/dist/chunks/cli-handler-ZLJJGHMV.mjs +1 -0
  17. package/dist/chunks/{code-base-MC4K4ST4.mjs → code-base-2TXG4VK3.mjs} +1 -1
  18. package/dist/chunks/code-base-32T6G2FF.cjs +1 -0
  19. package/dist/chunks/database-manager-YEWLT7QF.mjs +1 -0
  20. package/dist/chunks/database-manager-YNQZSUVP.cjs +1 -0
  21. package/dist/chunks/file-watcher-GHRFHOQF.cjs +1 -0
  22. package/dist/chunks/file-watcher-OORREWFV.mjs +1 -0
  23. package/dist/chunks/{interfaces-KGAFAHKZ.mjs → interfaces-5HZADUYB.mjs} +1 -1
  24. package/dist/chunks/{interfaces-4KLR5CPG.cjs → interfaces-ORRCH4XV.cjs} +1 -1
  25. package/dist/chunks/stdio-server-EQGSXAMO.cjs +47 -0
  26. package/dist/chunks/stdio-server-OFN76NZA.mjs +47 -0
  27. package/dist/chunks/sync-6CALMRLC.mjs +1 -0
  28. package/dist/chunks/sync-TICACY4G.cjs +1 -0
  29. package/dist/cli.cjs +1 -1
  30. package/dist/cli.mjs +1 -1
  31. package/dist/index.cjs +1 -1
  32. package/dist/index.d.cts +43 -7
  33. package/dist/index.d.ts +43 -7
  34. package/dist/index.mjs +1 -1
  35. package/package.json +16 -15
  36. package/dist/chunks/chunk-RPRDGNXG.cjs +0 -34
  37. package/dist/chunks/chunk-XQID3NKI.mjs +0 -34
  38. package/dist/chunks/cli-handler-47R23IC3.cjs +0 -1
  39. package/dist/chunks/cli-handler-KSSK773Z.mjs +0 -1
  40. package/dist/chunks/code-base-HBPZXJQZ.cjs +0 -1
  41. package/dist/chunks/database-manager-DRLNOQ6C.cjs +0 -1
  42. package/dist/chunks/database-manager-WOYUSWKD.mjs +0 -1
  43. package/dist/chunks/file-watcher-EASGLNDX.mjs +0 -1
  44. package/dist/chunks/file-watcher-P3ACFOV5.cjs +0 -1
  45. package/dist/chunks/stdio-server-C7OYLX4I.mjs +0 -47
  46. package/dist/chunks/stdio-server-UDX3QZNZ.cjs +0 -47
  47. package/dist/chunks/sync-6VAWF5IL.mjs +0 -1
  48. package/dist/chunks/sync-OSAGPUO2.cjs +0 -1
  49. /package/dist/chunks/{chunk-TS4OAYIJ.cjs → chunk-NVGACA7W.cjs} +0 -0
  50. /package/dist/chunks/{chunk-G3IYU6TZ.mjs → chunk-TMICZT3L.mjs} +0 -0
package/README.en.md CHANGED
@@ -48,6 +48,48 @@ const callGraph = await graph.queryCallGraph('ts:src/service.ts:function_declara
48
48
  await graph.close();
49
49
  ```
50
50
 
51
+ ## CLI / MCP / Installer
52
+
53
+ `packages/codebase` is also exposed as a standalone CLI `easbot-codebase` (and via the main `easbot` CLI as `easbot codebase ...`). It provides 25+ subcommands covering the full lifecycle (init / index / sync / status / doctor / config / upgrade / embed / recreate / clear / watch / stop) and graph queries (query / node / context / impact / callers / callees / explore / dead-code / circular / path / config get|set).
54
+
55
+ ### `--json` Protocol (decision 0051 / spec v1.3)
56
+
57
+ All CLI commands support `--json` for machine-readable output. Unified through [`@easbot/terminal`](file:///e:/work/apps/eas/easbot/packages/terminal/README.md) using `emitJsonOk(data, meta?)` / `emitJsonError(code, message)`:
58
+
59
+ ```bash
60
+ # Success response schema
61
+ easbot-codebase status --json
62
+ # {
63
+ # "ok": true,
64
+ # "data": { "rootDir": "...", "configExists": true, "dbExists": true, ... },
65
+ # "meta": { "scope": "all" }
66
+ # }
67
+
68
+ # init path (added in decision 0051)
69
+ easbot-codebase init --json
70
+ # {
71
+ # "ok": true,
72
+ # "data": {
73
+ # "configPath": "<worktree>/.easbot/codebase.json",
74
+ # "backend": "better-sqlite3",
75
+ # "schemaVersion": 1,
76
+ # "created": true,
77
+ # "skipped": false,
78
+ # "initialSync": { "filesAdded": 0, "filesUpdated": 0, ... }
79
+ # },
80
+ # "meta": { "action": "created" }
81
+ # }
82
+
83
+ # Error response schema
84
+ easbot-codebase path <missing> --json
85
+ # {
86
+ # "ok": false,
87
+ # "error": { "code": "E_NOT_FOUND", "message": "..." }
88
+ # }
89
+ ```
90
+
91
+ **Exemptions**: `watch` (service-mode) / `mcp` (JSON-RPC). See [decision 0051](file:///e:/work/apps/eas/easbot/docs/decisions/0051-cli-human-output-unify.md) and [CLI Output Spec v1.3](file:///e:/work/apps/eas/easbot/docs/spec/cli-output-spec.md).
92
+
51
93
  ## API Documentation
52
94
 
53
95
  ### CodeKnowledgeGraph
package/README.md CHANGED
@@ -42,6 +42,44 @@
42
42
 
43
43
  `packages/codebase` **当前未暴露独立 CLI**;调用方通过 `createCodebase()` API 集成,或通过 `easbot` 主 CLI([H-M1 阶段落地后](file:///e:/work/apps/eas/easbot/.easbot/knowledge/tasks/codebase-refactor-plan/findings.md))以二级命令 `easbot codebase ...` 形式调用。
44
44
 
45
+ ### `--json` 协议(决策 0051 / 规范 v1.3)
46
+
47
+ 所有 CLI 命令支持 `--json` 输出机器可读 JSON。统一走 [`@easbot/terminal`](file:///e:/work/apps/eas/easbot/packages/terminal/README.md) 的 `emitJsonOk(data, meta?)` / `emitJsonError(code, message)`:
48
+
49
+ ```bash
50
+ # 成功响应 schema
51
+ easbot codebase status --json
52
+ # {
53
+ # "ok": true,
54
+ # "data": { "rootDir": "...", "configExists": true, "dbExists": true, ... },
55
+ # "meta": { "scope": "all" }
56
+ # }
57
+
58
+ # init 路径(决策 0051 新增)
59
+ easbot codebase init --json
60
+ # {
61
+ # "ok": true,
62
+ # "data": {
63
+ # "configPath": "<worktree>/.easbot/codebase.json",
64
+ # "backend": "better-sqlite3",
65
+ # "schemaVersion": 1,
66
+ # "created": true,
67
+ # "skipped": false,
68
+ # "initialSync": { "filesAdded": 0, "filesUpdated": 0, ... }
69
+ # },
70
+ # "meta": { "action": "created" }
71
+ # }
72
+
73
+ # 错误响应 schema
74
+ easbot codebase path <missing> --json
75
+ # {
76
+ # "ok": false,
77
+ # "error": { "code": "E_NOT_FOUND", "message": "..." }
78
+ # }
79
+ ```
80
+
81
+ **豁免清单**:`watch`(服务型启动)/ `mcp`(JSON-RPC 协议)。详见 [决策 0051](file:///e:/work/apps/eas/easbot/docs/decisions/0051-cli-human-output-unify.md) + [CLI 输出规范 v1.3](file:///e:/work/apps/eas/easbot/docs/spec/cli-output-spec.md)。
82
+
45
83
  ## 安装
46
84
 
47
85
  ```bash