@fluentcommerce/fluent-mcp-extn 0.1.0 → 0.2.0
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/README.md +0 -14
- package/docs/E2E_TESTING.md +8 -318
- package/docs/RUNBOOK.md +11 -90
- package/docs/TOOL_REFERENCE.md +35 -689
- package/package.json +1 -5
- package/docs/IMPLEMENTATION_GUIDE.md +0 -299
package/README.md
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
# @fluentcommerce/fluent-mcp-extn
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@fluentcommerce/fluent-mcp-extn)
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](https://nodejs.org/)
|
|
6
|
-
|
|
7
3
|
> **Alpha** — This package is under active development. APIs, tool signatures, and configuration may change between releases without notice. Use in non-production environments and pin to a specific version if stability matters.
|
|
8
4
|
|
|
9
5
|
MCP ([Model Context Protocol](https://modelcontextprotocol.io)) extension server for [Fluent Commerce](https://fluentcommerce.com).
|
|
@@ -408,16 +404,6 @@ Plus at least one auth method below.
|
|
|
408
404
|
| `FLUENT_RETRY_MAX_DELAY_MS` | `5000` | Max backoff delay |
|
|
409
405
|
| `FLUENT_RETRY_FACTOR` | `2` | Backoff multiplier |
|
|
410
406
|
|
|
411
|
-
### Response Shaping
|
|
412
|
-
|
|
413
|
-
Controls how large responses are handled before returning to the AI. When a response exceeds the budget, arrays are auto-summarized (not truncated) with record counts, field inventory, value distributions, and sample records — giving the AI a complete analytical picture instead of cut-off data.
|
|
414
|
-
|
|
415
|
-
| Variable | Default | Description |
|
|
416
|
-
|---|---|---|
|
|
417
|
-
| `FLUENT_RESPONSE_BUDGET_CHARS` | `50000` | Max serialized response size (~12.5k tokens). `0` disables (unlimited). |
|
|
418
|
-
| `FLUENT_RESPONSE_MAX_ARRAY` | `50` | Arrays exceeding this size are auto-summarized. Only active when budget > 0. |
|
|
419
|
-
| `FLUENT_RESPONSE_SAMPLE_SIZE` | `3` | Number of sample records included in array summaries. |
|
|
420
|
-
|
|
421
407
|
## Tools (36)
|
|
422
408
|
|
|
423
409
|
### Diagnostics
|
package/docs/E2E_TESTING.md
CHANGED
|
@@ -3,23 +3,6 @@
|
|
|
3
3
|
This guide walks through full validation of `fluent-mcp-extn` from startup to
|
|
4
4
|
real Fluent API operations.
|
|
5
5
|
|
|
6
|
-
## Script inventory
|
|
7
|
-
|
|
8
|
-
| Script | Type | Purpose |
|
|
9
|
-
|--------|------|---------|
|
|
10
|
-
| `e2e-smoke.ts` | E2E | Full MCP smoke cycle: tool discovery, config, health, events, GraphQL |
|
|
11
|
-
| `e2e-negative.ts` | E2E | Validation error and malformed input handling |
|
|
12
|
-
| `e2e-profile-test.mjs` | E2E | Quick FLUENT_PROFILE integration check |
|
|
13
|
-
| `e2e-full-order.ts` | E2E | Single order lifecycle: create, validate, fulfil, ship, deliver |
|
|
14
|
-
| `e2e-full-multi.ts` | E2E | ORDER::MULTI lifecycle with discovery and fulfilment event sequence |
|
|
15
|
-
| `e2e-agentic.ts` | E2E | All 11 agentic tools: entity CRUD, workflow, settings, environment |
|
|
16
|
-
| `e2e-response-shaping.ts` | E2E | Response budget enforcement and auto-summarization proof |
|
|
17
|
-
| `run-flow-inspect.ts` | Utility | FlowInspect forensics with local analysis, LLM packet, and drilldowns |
|
|
18
|
-
| `order-event-inspect.ts` | Utility | Order-specific event deep dive with audit trail extraction |
|
|
19
|
-
| `check-event-status.ts` | Utility | Event status polling by ID, name, or entity ref |
|
|
20
|
-
|
|
21
|
-
All scripts require a built server (`npm run build`) and valid Fluent credentials.
|
|
22
|
-
|
|
23
6
|
## 1) Test levels
|
|
24
7
|
|
|
25
8
|
- **Level 1: local quality gate** (no network)
|
|
@@ -70,7 +53,7 @@ Use this as a baseline:
|
|
|
70
53
|
}
|
|
71
54
|
```
|
|
72
55
|
|
|
73
|
-
After editing `.mcp.json`, reload
|
|
56
|
+
After editing `.mcp.json`, reload Cursor so MCP servers restart with new env.
|
|
74
57
|
|
|
75
58
|
Profile-first setup via AI Skills:
|
|
76
59
|
|
|
@@ -142,301 +125,7 @@ only when non-skipped steps fail.
|
|
|
142
125
|
| `SKIP` | Step was intentionally not executed (for example, no candidate order in `--all-retailers` mode). | Verify preconditions only if you expected execution. |
|
|
143
126
|
| `FAIL` | Step executed and returned an error or unexpected result. | Investigate payload/error details and fix before relying on run output. |
|
|
144
127
|
|
|
145
|
-
## 5)
|
|
146
|
-
|
|
147
|
-
### `e2e-smoke.ts`
|
|
148
|
-
|
|
149
|
-
Full MCP client smoke cycle that exercises the core tool chain end to end.
|
|
150
|
-
|
|
151
|
-
**What it tests:** tool discovery, `config.validate`, `health.ping`, `event.build`,
|
|
152
|
-
`event.send` (dry-run and real), `graphql.query`, `graphql.queryAll`, order lookup,
|
|
153
|
-
`event.get` by ID.
|
|
154
|
-
|
|
155
|
-
**How to run:**
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
npm run e2e:smoke
|
|
159
|
-
npm run e2e:smoke -- --profile HMDEV
|
|
160
|
-
npm run e2e:smoke -- --profile HMDEV --retailer HM_TEST
|
|
161
|
-
npm run e2e:smoke -- --profile HMDEV --all-retailers
|
|
162
|
-
npm run e2e:smoke -- --skip-real-send
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
**Environment:** requires `FLUENT_BASE_URL` + auth env vars, or `--profile`.
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
### `e2e-negative.ts`
|
|
170
|
-
|
|
171
|
-
Validates that the server returns correct error envelopes for invalid inputs.
|
|
172
|
-
|
|
173
|
-
**What it tests:**
|
|
174
|
-
- `event.send` with missing required `entityRef` field
|
|
175
|
-
- `graphql.query` with malformed GraphQL syntax
|
|
176
|
-
- `event.get` with a nonexistent event ID
|
|
177
|
-
- `graphql.introspect` with a nonexistent mutation name
|
|
178
|
-
- `webhook.validate` with an invalid signature and public key
|
|
179
|
-
|
|
180
|
-
Each test case asserts: `ok: false`, standard error envelope shape
|
|
181
|
-
(`code` + `message` + `retryable`), and expected error code where applicable
|
|
182
|
-
(e.g., `VALIDATION_ERROR`).
|
|
183
|
-
|
|
184
|
-
**How to run:**
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
npx tsx scripts/e2e-negative.ts
|
|
188
|
-
npx tsx scripts/e2e-negative.ts --profile HMDEV
|
|
189
|
-
npx tsx scripts/e2e-negative.ts --profile HMDEV --retailer HM_TEST
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
**Environment:** requires `FLUENT_BASE_URL` + auth env vars, or `--profile`.
|
|
193
|
-
|
|
194
|
-
---
|
|
195
|
-
|
|
196
|
-
### `e2e-profile-test.mjs`
|
|
197
|
-
|
|
198
|
-
Minimal FLUENT_PROFILE integration check. Loads config, creates SDK client, and
|
|
199
|
-
runs four quick API calls to verify profile-based auth works end to end.
|
|
200
|
-
|
|
201
|
-
**What it tests:**
|
|
202
|
-
1. Config loads correctly with profile auth strategy
|
|
203
|
-
2. GraphQL `me` query returns user and retailer info
|
|
204
|
-
3. `getEvents` returns event results
|
|
205
|
-
4. `getPlugins` returns the plugin registry
|
|
206
|
-
5. `getTransitions` returns user actions for ORDER::HD at CREATED status
|
|
207
|
-
|
|
208
|
-
**How to run:**
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
FLUENT_PROFILE=HMDEV FLUENT_PROFILE_RETAILER=HM_TEST node scripts/e2e-profile-test.mjs
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
**Environment:** requires `FLUENT_PROFILE` and optionally `FLUENT_PROFILE_RETAILER`
|
|
215
|
-
set as env vars. Uses compiled `dist/` output directly (not MCP stdio transport).
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
### `e2e-full-order.ts`
|
|
220
|
-
|
|
221
|
-
Discovery-first single order lifecycle test. Creates an order with
|
|
222
|
-
`sourcingLocationRef`, then drives it through the full fulfilment workflow.
|
|
223
|
-
|
|
224
|
-
**What it tests:**
|
|
225
|
-
1. Config validation
|
|
226
|
-
2. Discovery: locations, catalogues, products, customers, settings
|
|
227
|
-
3. `createOrder` mutation with sourcing attributes
|
|
228
|
-
4. `ConfirmValidation` event on order
|
|
229
|
-
5. Query order + fulfilments post-validation
|
|
230
|
-
6. Fulfilment events: `ConfirmAllocation`, `CreateInvoice`, `ConfirmPick`,
|
|
231
|
-
`ConfirmShipment`, `ConfirmDelivery`
|
|
232
|
-
7. Final order/fulfilment state verification
|
|
233
|
-
8. Event trace: counts SUCCESS vs FAILED events for the order
|
|
234
|
-
|
|
235
|
-
**How to run:**
|
|
236
|
-
|
|
237
|
-
```bash
|
|
238
|
-
npx tsx scripts/e2e-full-order.ts --profile SAGIRISH --retailer 2
|
|
239
|
-
FLUENT_PROFILE=SAGIRISH FLUENT_RETAILER_ID=2 npx tsx scripts/e2e-full-order.ts
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
**Environment:** requires `FLUENT_PROFILE` + `FLUENT_RETAILER_ID`, or `--profile`
|
|
243
|
-
and `--retailer` flags. Environment must have warehouse locations, product
|
|
244
|
-
catalogue with active products, and at least one customer entity.
|
|
245
|
-
|
|
246
|
-
**Note:** this script creates real orders and fires real events. Use a sandbox.
|
|
247
|
-
|
|
248
|
-
---
|
|
249
|
-
|
|
250
|
-
### `e2e-full-multi.ts`
|
|
251
|
-
|
|
252
|
-
ORDER::MULTI lifecycle test. Similar to `e2e-full-order.ts` but targets the
|
|
253
|
-
MULTI order type workflow and includes workflow transition discovery.
|
|
254
|
-
|
|
255
|
-
**What it tests:**
|
|
256
|
-
1. Config validation
|
|
257
|
-
2. Discovery: retailer, locations, catalogues, products, customers, settings
|
|
258
|
-
3. `workflow.transitions` for ORDER::MULTI at ON_VALIDATION status
|
|
259
|
-
4. `createOrder` mutation with MULTI type
|
|
260
|
-
5. `ConfirmValidation` event
|
|
261
|
-
6. Fulfilment creation verification
|
|
262
|
-
7. Fulfilment event sequence: `ConfirmAllocation`, `CreateInvoice`,
|
|
263
|
-
`ConfirmPick`, `ConfirmShipment`, `ConfirmDelivery`
|
|
264
|
-
8. Event trace on failure
|
|
265
|
-
|
|
266
|
-
**How to run:**
|
|
267
|
-
|
|
268
|
-
```bash
|
|
269
|
-
npx tsx scripts/e2e-full-multi.ts
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
**Environment:** defaults to `FLUENT_BASE_URL=https://sagirish.test.api.fluentretail.com`
|
|
273
|
-
and `FLUENT_RETAILER_ID=2`. Override with env vars. Requires OAuth or profile
|
|
274
|
-
credentials.
|
|
275
|
-
|
|
276
|
-
**Note:** creates real orders and fires real events. Use a sandbox.
|
|
277
|
-
|
|
278
|
-
---
|
|
279
|
-
|
|
280
|
-
### `e2e-agentic.ts`
|
|
281
|
-
|
|
282
|
-
Comprehensive smoke test for all 11 agentic tools against a live environment.
|
|
283
|
-
|
|
284
|
-
**What it tests:**
|
|
285
|
-
- `environment.discover` (retailer + locations, catalogues)
|
|
286
|
-
- `environment.validate` (auth, retailer, locations checks)
|
|
287
|
-
- `entity.create` (dryRun validation, required field rejection, live creation)
|
|
288
|
-
- `entity.get` (by ID, by ref, nonexistent ref)
|
|
289
|
-
- `entity.update` (attribute update)
|
|
290
|
-
- `test.assert` (status match, status mismatch)
|
|
291
|
-
- `setting.upsert` (create new, update existing with previous value)
|
|
292
|
-
- `workflow.diff` (summary format, mermaid format)
|
|
293
|
-
- `workflow.simulate` (status matching, custom rule confidence, no-match)
|
|
294
|
-
- `workflow.upload` (dryRun structure validation)
|
|
295
|
-
|
|
296
|
-
**How to run:**
|
|
297
|
-
|
|
298
|
-
```bash
|
|
299
|
-
npx tsx scripts/e2e-agentic.ts --profile SAGIRISH
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
**Environment:** requires `FLUENT_PROFILE` or `--profile` flag. Defaults to
|
|
303
|
-
`FLUENT_RETAILER_ID=2`.
|
|
304
|
-
|
|
305
|
-
**Note:** creates real orders and settings. Use a sandbox.
|
|
306
|
-
|
|
307
|
-
---
|
|
308
|
-
|
|
309
|
-
### `e2e-response-shaping.ts`
|
|
310
|
-
|
|
311
|
-
Proves that response shaping (auto-summarization) works correctly on real API
|
|
312
|
-
responses.
|
|
313
|
-
|
|
314
|
-
**What it proves:**
|
|
315
|
-
1. `event.flowInspect` compact response stays within budget (50k chars)
|
|
316
|
-
2. `event.flowInspect` full mode (`compact: false`) gets auto-summarized, not truncated
|
|
317
|
-
3. `plugin.list` (unfiltered, 500+ rules) gets shaped when large
|
|
318
|
-
4. `event.list` (500 events) gets shaped when large
|
|
319
|
-
5. `_responseMeta` appears with accurate stats (originalChars, shapedChars, reductionPercent)
|
|
320
|
-
6. No `_truncated` markers anywhere (replaced by `_summarized`)
|
|
321
|
-
|
|
322
|
-
**How to run:**
|
|
323
|
-
|
|
324
|
-
```bash
|
|
325
|
-
npx tsx scripts/e2e-response-shaping.ts --profile SAGIRISH
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
**Environment:** requires `FLUENT_PROFILE` or `--profile`. Uses default budget
|
|
329
|
-
(50k chars). The environment must have enough events and plugins to exceed the
|
|
330
|
-
budget threshold.
|
|
331
|
-
|
|
332
|
-
---
|
|
333
|
-
|
|
334
|
-
### `run-flow-inspect.ts`
|
|
335
|
-
|
|
336
|
-
Advanced FlowInspect forensics runner. Calls `event.flowInspect`, then performs
|
|
337
|
-
local analysis: risk scoring, finding extraction, evidence ranking, and optional
|
|
338
|
-
per-event drilldowns via `event.get`.
|
|
339
|
-
|
|
340
|
-
**Outputs:**
|
|
341
|
-
- Raw JSON: full flowInspect response
|
|
342
|
-
- Summary JSON: risk score, status/entity distributions, anomaly counts, webhook
|
|
343
|
-
failure breakdown, exception classes, slow rulesets, mismatch reasons
|
|
344
|
-
- LLM packet (Markdown): compact handoff document for AI consumption
|
|
345
|
-
- Drilldown JSON: classified event details (webhook, mutation, sendEvent, mismatch)
|
|
346
|
-
|
|
347
|
-
**How to run:**
|
|
348
|
-
|
|
349
|
-
```bash
|
|
350
|
-
npx tsx scripts/run-flow-inspect.ts <ROOT_ENTITY_REF> --profile SAGIRISH
|
|
351
|
-
npx tsx scripts/run-flow-inspect.ts HD-001 --root-type ORDER --profile HMDEV
|
|
352
|
-
npx tsx scripts/run-flow-inspect.ts HD-001 --root-id 12345 --light --no-drilldown
|
|
353
|
-
npx tsx scripts/run-flow-inspect.ts HD-001 --drilldown-classes webhook,mutation --drilldown-limit 20
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
**Options:**
|
|
357
|
-
|
|
358
|
-
| Flag | Default | Description |
|
|
359
|
-
|------|---------|-------------|
|
|
360
|
-
| `--profile <name>` | `SAGIRISH` | Fluent CLI profile |
|
|
361
|
-
| `--root-type <type>` | any | Root entity type (ORDER, FULFILMENT, etc.) |
|
|
362
|
-
| `--root-id <id>` | - | Root entity ID for disambiguation |
|
|
363
|
-
| `--out <path>` | `accounts/<profile>/analysis/EVENT_FLOW_INSPECT_<ref>.json` | Raw output path |
|
|
364
|
-
| `--summary-out <path>` | `<base>.summary.json` | Summary output path |
|
|
365
|
-
| `--packet-out <path>` | `<base>.llm-packet.md` | LLM packet output path |
|
|
366
|
-
| `--drilldown-out <path>` | `<base>.drilldown.json` | Drilldown output path |
|
|
367
|
-
| `--light` | false | Compact mode (fewer audit details) |
|
|
368
|
-
| `--no-drilldown` | false | Skip per-event drilldowns |
|
|
369
|
-
| `--drilldown-limit <n>` | 15 | Max events to drill into |
|
|
370
|
-
| `--drilldown-classes <list>` | all | Comma-separated: webhook,mutation,sendEvent,mismatch,exception,scheduled,slow,status |
|
|
371
|
-
| `--top-n <n>` | 10 | Top-N items per section |
|
|
372
|
-
| `--evidence-limit <n>` | 20 | Max evidence event IDs |
|
|
373
|
-
| `--truncate <n>` | 220 | Max chars for text fields |
|
|
374
|
-
| `--max-pages <n>` | 10 | Max 500-event pages to fetch |
|
|
375
|
-
| `--no-llm-pack` | false | Skip LLM packet generation |
|
|
376
|
-
|
|
377
|
-
**Environment:** requires `FLUENT_PROFILE` or env vars.
|
|
378
|
-
|
|
379
|
-
---
|
|
380
|
-
|
|
381
|
-
### `order-event-inspect.ts`
|
|
382
|
-
|
|
383
|
-
Order-specific event deep dive. Looks up an order by ref, then fetches all
|
|
384
|
-
ORCHESTRATION and ORCHESTRATION_AUDIT events, classifying them into webhooks,
|
|
385
|
-
mutations, sendEvent actions, scheduled actions, and ruleset durations.
|
|
386
|
-
|
|
387
|
-
**Outputs:** a single JSON file with:
|
|
388
|
-
- Order entity details (status, attributes, fulfilment choices)
|
|
389
|
-
- Orchestration events (status counts, entity type counts, top event names)
|
|
390
|
-
- Audit trail (webhook actions, mutation actions, sendEvent actions, scheduled
|
|
391
|
-
actions, ruleset durations, exceptions)
|
|
392
|
-
- Drilldown details for NO_MATCH and PENDING events
|
|
393
|
-
|
|
394
|
-
**How to run:**
|
|
395
|
-
|
|
396
|
-
```bash
|
|
397
|
-
npx tsx scripts/order-event-inspect.ts <ORDER_REF> --profile SAGIRISH
|
|
398
|
-
npx tsx scripts/order-event-inspect.ts HD-001 --profile HMDEV --out /tmp/inspect.json
|
|
399
|
-
```
|
|
400
|
-
|
|
401
|
-
**Environment:** requires `FLUENT_PROFILE` or env vars.
|
|
402
|
-
|
|
403
|
-
---
|
|
404
|
-
|
|
405
|
-
### `check-event-status.ts`
|
|
406
|
-
|
|
407
|
-
Lightweight event status checker. Fetches events by ID or lists events by name
|
|
408
|
-
and entity ref.
|
|
409
|
-
|
|
410
|
-
**How to run:**
|
|
411
|
-
|
|
412
|
-
```bash
|
|
413
|
-
# Fetch specific events by ID
|
|
414
|
-
npx tsx scripts/check-event-status.ts --event-id <uuid> --profile SAGIRISH
|
|
415
|
-
|
|
416
|
-
# List events by name
|
|
417
|
-
npx tsx scripts/check-event-status.ts --event-name ConfirmValidation --profile SAGIRISH
|
|
418
|
-
|
|
419
|
-
# List events by entity ref
|
|
420
|
-
npx tsx scripts/check-event-status.ts --entity-ref HD-001 --profile SAGIRISH
|
|
421
|
-
|
|
422
|
-
# Combine filters
|
|
423
|
-
npx tsx scripts/check-event-status.ts --event-name ConfirmValidation --entity-ref HD-001 --count 20 --profile SAGIRISH
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
**Options:**
|
|
427
|
-
|
|
428
|
-
| Flag | Default | Description |
|
|
429
|
-
|------|---------|-------------|
|
|
430
|
-
| `--profile <name>` | - | Fluent CLI profile |
|
|
431
|
-
| `--retailer <id\|ref>` | from profile/env | Retailer filter |
|
|
432
|
-
| `--event-id <uuid>` | - | Fetch specific event (repeatable) |
|
|
433
|
-
| `--event-name <name>` | - | Event name filter for list |
|
|
434
|
-
| `--entity-ref <ref>` | - | Entity ref filter for list |
|
|
435
|
-
| `--count <n>` | 10 | Max list size (max 500) |
|
|
436
|
-
|
|
437
|
-
**Environment:** requires `FLUENT_BASE_URL` + auth, or `--profile`.
|
|
438
|
-
|
|
439
|
-
## 6) MCP smoke sequence in your IDE
|
|
128
|
+
## 5) MCP smoke sequence in Cursor
|
|
440
129
|
|
|
441
130
|
Run these tools in order from the assistant:
|
|
442
131
|
|
|
@@ -635,7 +324,7 @@ Expected:
|
|
|
635
324
|
- `mutations` array returned
|
|
636
325
|
- `count` reflects available mutations in the schema
|
|
637
326
|
|
|
638
|
-
##
|
|
327
|
+
## 6) Optional webhook signature validation
|
|
639
328
|
|
|
640
329
|
Use this when validating webhook integration cryptography:
|
|
641
330
|
|
|
@@ -657,7 +346,7 @@ Expected:
|
|
|
657
346
|
- `ok: true` when payload and signature are valid
|
|
658
347
|
- `signatureValidation.payloadSource` confirms whether `rawBody` was used
|
|
659
348
|
|
|
660
|
-
##
|
|
349
|
+
## 7) Optional batch E2E
|
|
661
350
|
|
|
662
351
|
### `batch.create`
|
|
663
352
|
|
|
@@ -698,7 +387,7 @@ Expected:
|
|
|
698
387
|
}
|
|
699
388
|
```
|
|
700
389
|
|
|
701
|
-
##
|
|
390
|
+
## 8) Failure triage quick map
|
|
702
391
|
|
|
703
392
|
- `CONFIG_ERROR`: missing env values -> run `config.validate`
|
|
704
393
|
- `AUTH_ERROR`: invalid creds/token -> verify OAuth or `TOKEN_COMMAND`
|
|
@@ -706,7 +395,7 @@ Expected:
|
|
|
706
395
|
- `TIMEOUT_ERROR` / `NETWORK_ERROR`: tune timeout/retry; verify connectivity
|
|
707
396
|
- `RATE_LIMIT` / `UPSTREAM_UNAVAILABLE`: retry later (built-in retries are applied for read operations; write retries are manual by design)
|
|
708
397
|
|
|
709
|
-
##
|
|
398
|
+
## 9) Exit criteria for successful E2E
|
|
710
399
|
|
|
711
400
|
Mark E2E successful only when:
|
|
712
401
|
|
|
@@ -719,7 +408,7 @@ Mark E2E successful only when:
|
|
|
719
408
|
- (optional) `graphql.introspect` schema access confirmed
|
|
720
409
|
- (optional) batch cycle completed
|
|
721
410
|
|
|
722
|
-
##
|
|
411
|
+
## 10) CI-triggered smoke (GitHub Actions)
|
|
723
412
|
|
|
724
413
|
Workflow: `.github/workflows/ci.yml`
|
|
725
414
|
|
|
@@ -737,3 +426,4 @@ Set repository or environment secrets before running `e2e-smoke`:
|
|
|
737
426
|
|
|
738
427
|
CI smoke runs are typically env-driven (no `--profile` required). For profile-based runs in CI, pass explicit flags (`--profile <name> --retailer <id|ref>` or `--profile <name> --all-retailers`).
|
|
739
428
|
If real event side effects are not desired, run with `--skip-real-send`.
|
|
429
|
+
|
package/docs/RUNBOOK.md
CHANGED
|
@@ -34,9 +34,7 @@ Notes:
|
|
|
34
34
|
|
|
35
35
|
## 3) MCP registration
|
|
36
36
|
|
|
37
|
-
Add server in your workspace `.mcp.json
|
|
38
|
-
|
|
39
|
-
### OAuth / Token Command mode
|
|
37
|
+
Add server in your workspace `.mcp.json`:
|
|
40
38
|
|
|
41
39
|
```json
|
|
42
40
|
{
|
|
@@ -55,29 +53,7 @@ Add server in your workspace `.mcp.json`.
|
|
|
55
53
|
}
|
|
56
54
|
```
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
```json
|
|
61
|
-
{
|
|
62
|
-
"mcpServers": {
|
|
63
|
-
"fluent-mcp-extn": {
|
|
64
|
-
"type": "stdio",
|
|
65
|
-
"command": "node",
|
|
66
|
-
"args": ["fluent-mcp-extn/dist/index.js"],
|
|
67
|
-
"env": {
|
|
68
|
-
"FLUENT_PROFILE": "HMDEV",
|
|
69
|
-
"FLUENT_PROFILE_RETAILER": "HM_TEST"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Profile mode reads credentials from `~/.fluentcommerce/<profile>/` and
|
|
77
|
-
auto-resolves the retailer ID from the retailer ref. No base URL, client ID,
|
|
78
|
-
or secrets are needed in `.mcp.json`.
|
|
79
|
-
|
|
80
|
-
Reload your IDE after editing `.mcp.json`.
|
|
56
|
+
Reload Cursor after editing `.mcp.json`.
|
|
81
57
|
|
|
82
58
|
## 4) Startup verification checklist
|
|
83
59
|
|
|
@@ -91,13 +67,10 @@ Run tools in this order:
|
|
|
91
67
|
6. `event.send` with `dryRun: false`
|
|
92
68
|
7. `event.get` using ID returned by send
|
|
93
69
|
8. `graphql.query` simple read
|
|
94
|
-
9. `
|
|
95
|
-
10. `
|
|
96
|
-
11. `graphql.
|
|
97
|
-
12. `graphql.
|
|
98
|
-
13. `environment.discover` with `include: ["retailer", "locations"]` — verify environment snapshot
|
|
99
|
-
14. `environment.validate` with `checks: ["auth", "retailer", "locations"]` — verify pre-flight checks
|
|
100
|
-
15. (optional) `graphql.query` synchronous fulfilment options call
|
|
70
|
+
9. `workflow.transitions` (optional) — verify User Action API access for a known trigger
|
|
71
|
+
10. `graphql.queryAll` — verify auto-pagination and run-level timeout
|
|
72
|
+
11. `graphql.introspect` with `listMutations: true` — verify schema access
|
|
73
|
+
12. (optional) `graphql.query` synchronous fulfilment options call
|
|
101
74
|
(`createFulfilmentOption` with `executionMode: AWAIT_ORCHESTRATION`)
|
|
102
75
|
for live checkout readiness checks
|
|
103
76
|
|
|
@@ -107,43 +80,7 @@ Write-safety note:
|
|
|
107
80
|
- non-idempotent write tools do not auto-retry
|
|
108
81
|
- callers should confirm failures before manual re-submission
|
|
109
82
|
|
|
110
|
-
## 5)
|
|
111
|
-
|
|
112
|
-
Response shaping controls how large API responses are processed before being
|
|
113
|
-
returned to the LLM. When a response exceeds the budget, arrays are
|
|
114
|
-
auto-summarized (not truncated) with record counts, field inventories, value
|
|
115
|
-
distributions, and sample records.
|
|
116
|
-
|
|
117
|
-
| Env var | Default | Description |
|
|
118
|
-
|---------|---------|-------------|
|
|
119
|
-
| `FLUENT_RESPONSE_BUDGET_CHARS` | `50000` (~12.5k tokens) | Max serialized response size. Set to `0` to disable (unlimited). |
|
|
120
|
-
| `FLUENT_RESPONSE_MAX_ARRAY` | `50` | Arrays exceeding this size are auto-summarized. Only active when budget > 0. |
|
|
121
|
-
| `FLUENT_RESPONSE_SAMPLE_SIZE` | `3` | Number of sample records included in array summaries. |
|
|
122
|
-
|
|
123
|
-
Set these in the `env` block of your `.mcp.json`:
|
|
124
|
-
|
|
125
|
-
```json
|
|
126
|
-
{
|
|
127
|
-
"mcpServers": {
|
|
128
|
-
"fluent-mcp-extn": {
|
|
129
|
-
"type": "stdio",
|
|
130
|
-
"command": "node",
|
|
131
|
-
"args": ["fluent-mcp-extn/dist/index.js"],
|
|
132
|
-
"env": {
|
|
133
|
-
"FLUENT_PROFILE": "HMDEV",
|
|
134
|
-
"FLUENT_RESPONSE_BUDGET_CHARS": "80000",
|
|
135
|
-
"FLUENT_RESPONSE_MAX_ARRAY": "100",
|
|
136
|
-
"FLUENT_RESPONSE_SAMPLE_SIZE": "5"
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
When shaping is active, responses include a `_responseMeta` object with
|
|
144
|
-
`originalChars`, `shapedChars`, `reductionPercent`, and `summarizedArrays`.
|
|
145
|
-
|
|
146
|
-
## 6) Troubleshooting by symptom
|
|
83
|
+
## 5) Troubleshooting by symptom
|
|
147
84
|
|
|
148
85
|
### `sdk adapter: not configured`
|
|
149
86
|
|
|
@@ -158,7 +95,7 @@ Actions:
|
|
|
158
95
|
1. call `config.validate`
|
|
159
96
|
2. inspect `errors` and `warnings`
|
|
160
97
|
3. verify env vars in `.mcp.json`
|
|
161
|
-
4. reload
|
|
98
|
+
4. reload Cursor MCP process
|
|
162
99
|
|
|
163
100
|
### `AUTH_ERROR`
|
|
164
101
|
|
|
@@ -260,24 +197,7 @@ Actions:
|
|
|
260
197
|
3. re-run mutation with matching `retailerId`, `type`, and `orderType`
|
|
261
198
|
4. verify synchronous response includes `plans`/`fulfilments`
|
|
262
199
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
Likely causes:
|
|
266
|
-
|
|
267
|
-
- `FLUENT_RESPONSE_BUDGET_CHARS` is set too low for the query
|
|
268
|
-
- large arrays are being auto-summarized (check for `_responseMeta` in response)
|
|
269
|
-
|
|
270
|
-
Actions:
|
|
271
|
-
|
|
272
|
-
1. check the `_responseMeta` object — if `reductionPercent` is high, the budget
|
|
273
|
-
is actively shaping the response
|
|
274
|
-
2. increase `FLUENT_RESPONSE_BUDGET_CHARS` (e.g., `80000` or `100000`)
|
|
275
|
-
3. increase `FLUENT_RESPONSE_MAX_ARRAY` if specific arrays are being summarized
|
|
276
|
-
4. set `FLUENT_RESPONSE_BUDGET_CHARS=0` to disable shaping entirely
|
|
277
|
-
5. for `event.flowInspect`, use `compact: true` (default) to get a pre-analyzed
|
|
278
|
-
summary instead of raw arrays
|
|
279
|
-
|
|
280
|
-
## 7) Reliability tuning guidance
|
|
200
|
+
## 6) Reliability tuning guidance
|
|
281
201
|
|
|
282
202
|
Start with defaults and adjust only when needed.
|
|
283
203
|
|
|
@@ -299,7 +219,7 @@ Example:
|
|
|
299
219
|
}
|
|
300
220
|
```
|
|
301
221
|
|
|
302
|
-
##
|
|
222
|
+
## 7) Safe extension workflow
|
|
303
223
|
|
|
304
224
|
When adding or changing a tool:
|
|
305
225
|
|
|
@@ -310,3 +230,4 @@ When adding or changing a tool:
|
|
|
310
230
|
5. run:
|
|
311
231
|
- `npm run build`
|
|
312
232
|
- `npm test`
|
|
233
|
+
|