@fluentcommerce/fluent-mcp-extn 0.1.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/LICENSE +21 -0
- package/README.md +818 -0
- package/dist/config.js +195 -0
- package/dist/entity-registry.js +418 -0
- package/dist/entity-tools.js +414 -0
- package/dist/environment-tools.js +573 -0
- package/dist/errors.js +150 -0
- package/dist/event-payload.js +22 -0
- package/dist/fluent-client.js +229 -0
- package/dist/index.js +47 -0
- package/dist/resilience.js +52 -0
- package/dist/response-shaper.js +361 -0
- package/dist/sdk-client.js +237 -0
- package/dist/settings-tools.js +348 -0
- package/dist/test-tools.js +388 -0
- package/dist/tools.js +3254 -0
- package/dist/workflow-tools.js +752 -0
- package/docs/CONTRIBUTING.md +100 -0
- package/docs/E2E_TESTING.md +739 -0
- package/docs/HANDOVER_COPILOT_SETUP_STEPS.example.yml +35 -0
- package/docs/HANDOVER_ENV.example +29 -0
- package/docs/HANDOVER_GITHUB_COPILOT.md +165 -0
- package/docs/HANDOVER_GITHUB_REPO_MCP_CONFIG.example.json +31 -0
- package/docs/HANDOVER_VSCODE_MCP_JSON.example.json +10 -0
- package/docs/IMPLEMENTATION_GUIDE.md +299 -0
- package/docs/RUNBOOK.md +312 -0
- package/docs/TOOL_REFERENCE.md +1810 -0
- package/package.json +68 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Contributing Guide
|
|
2
|
+
|
|
3
|
+
This guide defines how to safely change `fluent-mcp-extn` while keeping
|
|
4
|
+
behavior predictable for all clients.
|
|
5
|
+
|
|
6
|
+
## 1) Core principles
|
|
7
|
+
|
|
8
|
+
- Keep the extension **client-agnostic** (no client-specific names in code/docs).
|
|
9
|
+
- Prefer **typed boundaries** and avoid unscoped `any`.
|
|
10
|
+
- Keep tool responses consistent:
|
|
11
|
+
- success: `{ "ok": true, ... }`
|
|
12
|
+
- failure: `{ "ok": false, "error": { ... } }`
|
|
13
|
+
- Route Fluent API calls through `FluentClientAdapter` only.
|
|
14
|
+
|
|
15
|
+
## 2) Local setup
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install
|
|
19
|
+
npm run build
|
|
20
|
+
npm test
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 3) Change workflow
|
|
24
|
+
|
|
25
|
+
1. Make focused changes.
|
|
26
|
+
2. Add or update tests.
|
|
27
|
+
3. Run `npm run build`.
|
|
28
|
+
4. Run `npm test`.
|
|
29
|
+
5. Run `npm run e2e:smoke -- --skip-real-send` when touching tool runtime (requires `FLUENT_BASE_URL` + auth env, or `--profile`).
|
|
30
|
+
6. Update docs if tool behavior/config changed.
|
|
31
|
+
|
|
32
|
+
## 4) Adding a new tool (required checklist)
|
|
33
|
+
|
|
34
|
+
When adding a tool, update all of the following:
|
|
35
|
+
|
|
36
|
+
1. `src/tools.ts`
|
|
37
|
+
- add zod schema
|
|
38
|
+
- add `TOOL_DEFINITIONS` entry
|
|
39
|
+
- add handler branch
|
|
40
|
+
2. `src/index.ts`
|
|
41
|
+
- add tool name to startup log list
|
|
42
|
+
3. tests
|
|
43
|
+
- add/adjust unit tests in `test/`
|
|
44
|
+
4. docs
|
|
45
|
+
- update `docs/TOOL_REFERENCE.md`
|
|
46
|
+
- update `docs/E2E_TESTING.md` if smoke flow changes
|
|
47
|
+
|
|
48
|
+
## 5) Error handling standards
|
|
49
|
+
|
|
50
|
+
- Throw `ToolError` for domain/runtime failures.
|
|
51
|
+
- Do not return raw thrown errors directly.
|
|
52
|
+
- Let `toToolFailure()` convert unknown errors into normalized error payloads.
|
|
53
|
+
- Use specific error codes where possible (`AUTH_ERROR`, `VALIDATION_ERROR`, etc.).
|
|
54
|
+
|
|
55
|
+
## 6) Resilience standards
|
|
56
|
+
|
|
57
|
+
- Keep retry/timeout policy centralized via:
|
|
58
|
+
- `withTimeout()`
|
|
59
|
+
- `withRetry()`
|
|
60
|
+
- Avoid per-tool custom retry loops.
|
|
61
|
+
- Use config-driven values (`FLUENT_REQUEST_TIMEOUT_MS`, retry env vars).
|
|
62
|
+
- Preserve idempotency boundaries:
|
|
63
|
+
- read operations can use retry/backoff
|
|
64
|
+
- non-idempotent write operations must not auto-retry
|
|
65
|
+
- Keep SDK retry disabled and adapter retry as the single control plane.
|
|
66
|
+
|
|
67
|
+
## 7) Security and secrets
|
|
68
|
+
|
|
69
|
+
- Never log secrets or token values.
|
|
70
|
+
- Use redacted summaries via `toSafeConfigSummary()`.
|
|
71
|
+
- Prefer profile, `TOKEN_COMMAND`, or OAuth over static tokens in shared environments.
|
|
72
|
+
|
|
73
|
+
## 8) Documentation standards
|
|
74
|
+
|
|
75
|
+
- Keep docs concise and task-oriented.
|
|
76
|
+
- Include at least one valid request example when changing tool inputs.
|
|
77
|
+
- Update all cross-links in `README.md` when adding new docs.
|
|
78
|
+
- For behavior changes, update all affected docs end-to-end:
|
|
79
|
+
- `README.md`
|
|
80
|
+
- `docs/TOOL_REFERENCE.md`
|
|
81
|
+
- `docs/RUNBOOK.md`
|
|
82
|
+
- `docs/E2E_TESTING.md`
|
|
83
|
+
|
|
84
|
+
## 9) Pull request quality bar
|
|
85
|
+
|
|
86
|
+
A change is ready only if:
|
|
87
|
+
|
|
88
|
+
- build passes
|
|
89
|
+
- tests pass
|
|
90
|
+
- smoke runner passes (or is intentionally skipped with rationale)
|
|
91
|
+
- no lint errors introduced
|
|
92
|
+
- docs updated for behavior/interface changes
|
|
93
|
+
- no client-specific wording added
|
|
94
|
+
|
|
95
|
+
## 10) CI expectations
|
|
96
|
+
|
|
97
|
+
- CI workflow file: `.github/workflows/ci.yml`
|
|
98
|
+
- `build-and-test` must pass for every PR.
|
|
99
|
+
- `e2e-smoke` is manual (`workflow_dispatch`) and requires repository secrets.
|
|
100
|
+
|