@anmezing/lce-cloud 1.2.3 → 1.3.1

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 (3) hide show
  1. package/README.md +99 -3
  2. package/lce-cloud.cjs +241 -78
  3. package/package.json +2 -1
package/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # @anmezing/lce-cloud
2
2
 
3
3
  LCE Cloud Mode client. Runs as a local stdio MCP server inside your IDE, keeps your
4
- project index in sync with the LCE cloud, and proxies retrieval / symbol-graph queries.
4
+ project index in sync with the LCE cloud, and augments cloud retrieval with optional
5
+ repository-contained Graphify and OKF knowledge.
5
6
 
6
7
  ## Usage
7
8
 
@@ -12,7 +13,7 @@ Add to your MCP configuration (Cursor / Claude Code):
12
13
  "mcpServers": {
13
14
  "lce": {
14
15
  "command": "npx",
15
- "args": ["-y", "@anmezing/lce-cloud@latest", "--key", "sk-xxxxxxxx"]
16
+ "args": ["-y", "@anmezing/lce-cloud@latest", "--key", "lce_xxxxxxxx"]
16
17
  }
17
18
  }
18
19
  }
@@ -23,10 +24,102 @@ Codex (`config.toml`):
23
24
  ```toml
24
25
  [mcp_servers.lce]
25
26
  command = "npx"
26
- args = ["-y", "@anmezing/lce-cloud@latest", "--key", "sk-xxxxxxxx"]
27
+ args = ["-y", "@anmezing/lce-cloud@latest", "--key", "lce_xxxxxxxx"]
27
28
  ```
28
29
 
29
30
  Get your API key from the LCE console. No other installation step is required.
31
+ `npx` downloads and runs the npm client automatically, so a global npm install is
32
+ not required.
33
+
34
+ ## Exposed tools
35
+
36
+ The npm client exposes five tools to the coding agent. Three use the tenant-safe
37
+ server index, while two run against the local Git checkout:
38
+
39
+ | Tool | Runs in | Function |
40
+ | --- | --- | --- |
41
+ | `codebase-retrieval` | LCE server + local npm client | Semantic retrieval, coarse ranking, and reranking, complemented by local Graphify/OKF evidence when present |
42
+ | `codebase_symbol_graph` | LCE server | Symbol definitions, references, call chains, dependencies, and change impact |
43
+ | `codebase_enhance_prompt` | LCE server | Convert a natural-language task into a code-grounded implementation brief |
44
+ | `codebase_git_context` | Local npm client | Git status, diffs, history, blame, and branch context from the current checkout |
45
+ | `codebase_review_changes` | Local npm client | Build a review range, identify risks, and produce retrieval and test plans |
46
+
47
+ The relay's Streamable HTTP endpoint remains the transport used by this client and
48
+ by relay-to-LCE service calls. Directly configuring an IDE against that endpoint is
49
+ not the recommended user flow: it omits the npm client's local Git tools, file
50
+ watcher, automatic incremental synchronization, and branch-view tracking. The
51
+ console therefore generates the complete npx configuration only.
52
+
53
+ ## Graphify and OKF enhancement
54
+
55
+ No extra LCE request option is required. When `graphify-out/graph.json` or `.okf/`
56
+ exists in the current repository, `codebase-retrieval` automatically adds matching
57
+ local evidence after the server has completed semantic recall and reranking.
58
+
59
+ - Graphify contributes extracted relationships. A declared source range is included
60
+ only when it is inside the repository file and contains the referenced symbol. A
61
+ broad graph match may support a file already returned by LCE; introducing a new
62
+ Graphify file requires a match in `technical_terms`.
63
+ - OKF contributes curated concepts and repository-contained `repo://path#Lx-Ly` source references whose ranges are in bounds.
64
+ Deprecated, stale, malformed, out-of-repository, and invalid-line references are
65
+ excluded or conservatively downgraded.
66
+ - These artifacts remain local. They are not indexed, synchronized, or uploaded to
67
+ Relay. Missing artifacts leave the Relay response unchanged; malformed artifacts
68
+ cannot make a valid cloud retrieval fail.
69
+
70
+ Generate the Graphify artifact with Graphify itself. LCE only reads it:
71
+
72
+ ```bash
73
+ graphify extract . --code-only --no-cluster
74
+ graphify cluster-only . --no-viz --no-label
75
+ ```
76
+
77
+ The default artifact paths can be changed with `--graphify-root` and `--okf-root`.
78
+ Use `--local-knowledge off` to disable local fusion.
79
+
80
+ ## Recommended coding-agent rules
81
+
82
+ Adding an MCP server does not guarantee that an agent will use it. Add the following
83
+ to the project's `AGENTS.md`, `CLAUDE.md`, or `.cursor/rules` file:
84
+
85
+ ```markdown
86
+ ## LCE tool usage
87
+
88
+ - The default npx configuration downloads and runs the npm client automatically; no global install is required.
89
+ - (Server-provided) Use `codebase-retrieval` first to find, understand, or locate code with a natural-language request.
90
+ - (Server-provided) Use `codebase_symbol_graph` for definitions, references, call chains, dependencies, and change impact.
91
+ - (Server-provided) Use `codebase_enhance_prompt` to turn a task into a code-grounded implementation brief.
92
+ - (Local npm client) Use `codebase_git_context` for Git status, diffs, history, blame, and branch context.
93
+ - (Local npm client) Use `codebase_review_changes` for change-review risks, retrieval plans, and test plans.
94
+ - Fall back to local text search only when LCE is unavailable or exact regex/literal matching is required.
95
+ ```
96
+
97
+ The `codebase_enhance_prompt` tool accepts a natural-language coding task and returns
98
+ a structured task grounded in the current branch index. The original request remains
99
+ authoritative, and file/line references are derived from retrieved chunks. An
100
+ administrator must configure and enable a prompt-enhancement model before this tool
101
+ can complete a request.
102
+
103
+ ### How to use prompt enhancement
104
+
105
+ Prompt enhancement is an explicit MCP tool call, not an automatic prompt interceptor.
106
+ Ask the coding agent to call it before implementation when you want the request refined:
107
+
108
+ > Call `codebase_enhance_prompt` first, show me the enhanced result, and then implement
109
+ > it while keeping my original requirements authoritative: fix authentication timeout
110
+ > handling and add regression tests. Known identifiers: `AuthService`, `sessionTTL`.
111
+
112
+ The agent should pass the complete request as `prompt`, put known symbols, file names,
113
+ or error codes in `technical_terms`, and normally leave `root_id` unset so the npm
114
+ client uses the current branch view. `output_language` accepts `auto`, `zh-CN`, or
115
+ `en`. The result contains the original request, goals, implementation requirements,
116
+ constraints, verified code references, verification steps, and open questions. It is
117
+ supplemental context, not permission to drop or rewrite the user's requirements.
118
+
119
+ The cloud administrator can configure prompt enhancement with an OpenAI-compatible
120
+ chat endpoint, Anthropic Messages, or Google Gemini. The console discovers models from
121
+ the selected provider and sends only the retrieved repository context required for the
122
+ enhancement request.
30
123
 
31
124
  ## Options
32
125
 
@@ -34,4 +127,7 @@ Get your API key from the LCE console. No other installation step is required.
34
127
  | --- | --- |
35
128
  | `--key, -k` | API key (required) |
36
129
  | `--cloud` | Relay URL override |
130
+ | `--local-knowledge` | Local Graphify/OKF fusion: `auto` (default) or `off` |
131
+ | `--graphify-root` | Repository-contained Graphify graph path (default: `graphify-out/graph.json`) |
132
+ | `--okf-root` | Repository-contained OKF bundle path (default: `.okf`) |
37
133
  | `--version, -v` | Print client version |