@lexq/cli 0.1.42 → 0.1.44
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.
- package/AGENTS.md +26 -5
- package/package.json +1 -2
package/AGENTS.md
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
LexQ CLI (`@lexq/cli`, binary: `lexq`) manages a policy execution engine. Policies are business rules (if-then) that
|
|
8
8
|
evaluate input facts and produce actions (discounts, blocks, notifications, etc.).
|
|
9
9
|
|
|
10
|
-
The CLI also doubles as an **MCP server** — run `lexq serve --mcp` to expose
|
|
10
|
+
The CLI also doubles as an **MCP server** — run `lexq serve --mcp` to expose the full command inventory as MCP tools to
|
|
11
|
+
any MCP-compatible AI client.
|
|
11
12
|
|
|
12
13
|
This file tells you how to use the CLI as an AI agent.
|
|
13
14
|
|
|
@@ -128,8 +129,8 @@ Place this file in the project root. The IDE will auto-discover it.
|
|
|
128
129
|
|
|
129
130
|
### Claude Code
|
|
130
131
|
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
Reads this file via the root `CLAUDE.md` pointer. No separate context file — this document and `skills/` are the whole
|
|
133
|
+
guide.
|
|
133
134
|
|
|
134
135
|
### Gemini CLI
|
|
135
136
|
|
|
@@ -142,7 +143,17 @@ Connect via:
|
|
|
142
143
|
- **Cloud:** `https://mcp.lexq.io` (OAuth 2.1)
|
|
143
144
|
- **Local stdio:** `npx @lexq/cli serve --mcp`
|
|
144
145
|
|
|
145
|
-
|
|
146
|
+
The MCP toolset mirrors the CLI command inventory one-to-one.
|
|
147
|
+
|
|
148
|
+
## API Shape
|
|
149
|
+
|
|
150
|
+
- Base URL `https://api.lexq.io/api/v1/partners`, auth via the `X-API-KEY` header.
|
|
151
|
+
- Every response is an envelope: the success branch carries `data`; the failure branch carries `errorCode` +
|
|
152
|
+
`message`. Surface both — never a bare "request failed".
|
|
153
|
+
- Pagination is asymmetric: requests send `page`/`size`, responses return `pageNo`/`pageSize`. Pages are 0-indexed.
|
|
154
|
+
- Fact keys are `snake_case` and case-sensitive.
|
|
155
|
+
- Actions never call external systems. The engine mutates facts and records the decision — read the response and
|
|
156
|
+
act on it yourself. Deployment lifecycle webhooks (`lexq webhook-subscriptions`) are the one push channel.
|
|
146
157
|
|
|
147
158
|
## Troubleshooting
|
|
148
159
|
|
|
@@ -156,4 +167,14 @@ Connect via:
|
|
|
156
167
|
| `WH-` error on subscription | Webhook URL must be HTTPS and return 2xx for a POST |
|
|
157
168
|
| Network error | Check `lexq status` for API health |
|
|
158
169
|
|
|
159
|
-
`errorCode` is of the form `<domain>-<number>` (`P-002`, `ACT-016`). See `lexq-shared/SKILL.md` for the prefix table.
|
|
170
|
+
`errorCode` is of the form `<domain>-<number>` (`P-002`, `ACT-016`). See `lexq-shared/SKILL.md` for the prefix table.
|
|
171
|
+
|
|
172
|
+
## Contributing in This Repo (coding agents)
|
|
173
|
+
|
|
174
|
+
- CLI commands and MCP tools stay in lock-step — a new command lands with its MCP tool in the same PR, sharing
|
|
175
|
+
the single api-client layer.
|
|
176
|
+
- The hosted MCP server consumes this package from npm. Publish (`v*` tag) **before** redeploying it — CI cannot
|
|
177
|
+
catch that ordering.
|
|
178
|
+
- Gates before commit: `pnpm typecheck` (zero errors), `pnpm lint` (zero warnings), `bash tests/e2e.sh`.
|
|
179
|
+
- Multi-line CLI help and MCP tool descriptions use `dedent` — template-literal indentation leaks into LLM context.
|
|
180
|
+
- Types mirror engine DTOs exactly; never invent response shapes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lexq/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.44",
|
|
4
4
|
"description": "LexQ CLI — manage policies, simulate rules, and deploy from the terminal. Built for humans and AI agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"dist",
|
|
18
|
-
"schemas",
|
|
19
18
|
"skills",
|
|
20
19
|
"AGENTS.md",
|
|
21
20
|
"CONTEXT.md"
|