|
| 1 | +# Mercury Composable for Node.js — consumer starting point |
| 2 | + |
| 3 | +> **Contributors working in this repository:** follow the root [AGENTS.md](../AGENTS.md) |
| 4 | +> (the agent-memory protocol) first — this file does not replace it. This scoped guide |
| 5 | +> serves AI tools that **consume the Node.js wrapper as a dependency** and need the fastest |
| 6 | +> correct starting point. It lives at the same path as the engine repos' consumer guide |
| 7 | +> (`system/AGENTS.md`), so one tool convention finds every Mercury repo. |
| 8 | +
|
| 9 | +## What this package is |
| 10 | + |
| 11 | +`mercury-nodejs` is a lightweight Event-over-HTTP function host: write decoupled functions |
| 12 | +in JavaScript/TypeScript and let Mercury Composable engines (Java, Rust) orchestrate them |
| 13 | +from Event Script flows and MiniGraph knowledge graphs. Orchestration stays in the engines; |
| 14 | +this package contributes functions plus the engines' operational conventions (configuration, |
| 15 | +logging, trace, actuators). |
| 16 | + |
| 17 | +## Starting point for consumer AI tools |
| 18 | + |
| 19 | +The quickest path to a working function: |
| 20 | + |
| 21 | +1. **`docs/llms.txt`** — the machine-readable map of this documentation site. |
| 22 | +2. **AI Agent Guide** (`docs/guides/ai-agent-guide.md`) — the complete authoring grammar |
| 23 | + on one page: contract, registration, composition, config keys, error rules. |
| 24 | +3. **Getting Started** (`docs/guides/getting-started.md`) — a running function in five |
| 25 | + minutes, called from an engine flow. |
| 26 | + |
| 27 | +For Mercury engine questions (Event Script flows, Knowledge Graph models, REST automation, |
| 28 | +Kafka integration), use the engine's `docs/llms.txt` or ai-contract-provider skill — this |
| 29 | +wrapper's docs cover only the Node.js function surface. |
| 30 | + |
| 31 | +## What lives in this repo |
| 32 | + |
| 33 | +| Path | Role | |
| 34 | +|------|------| |
| 35 | +| `src/` | the `mercury-composable` package — `Platform`, `PostOffice`, `EventEnvelope`, actuator routes | |
| 36 | +| `examples/` | runnable reference functions | |
| 37 | +| `docs/` | the MkDocs guide site source | |
| 38 | +| `test/` | unit and integration tests | |
| 39 | + |
| 40 | +## Key references (repo-relative) |
| 41 | + |
| 42 | +- `docs/llms.txt` — machine-readable documentation map; start here for keyword lookup |
| 43 | +- `docs/guides/ai-agent-guide.md` — AI agent authoring grammar (the authoritative contract) |
| 44 | +- `docs/guides/function-patterns.md` — (headers, body) contract, async, never-block-the-loop |
| 45 | +- `docs/guides/join-event-script.md` — `yaml.event.over.http`, what the function sees |
| 46 | +- `docs/guides/join-knowledge-graph.md` — `graph.task` to a Node.js target |
| 47 | +- `docs/guides/configuration-reference.md` — every well-known config key |
| 48 | +- `docs/guides/http-surface-reference.md` — `/api/event` protocol, actuator shapes |
| 49 | + |
| 50 | +## Efficient lookup |
| 51 | + |
| 52 | +**For "how do I write / configure X" questions, start with the guide — not the source.** |
| 53 | +`docs/llms.txt` maps every guide page. Find the right page there first; read only the |
| 54 | +relevant section. Fall back to source only when the guide is genuinely silent on the |
| 55 | +specific behavior or you need to verify a subtle invariant. Guide-first costs 3–5× fewer |
| 56 | +tokens than source discovery. |
| 57 | + |
| 58 | +When source reveals a genuine gap, raise an issue or PR against the upstream OSS project: |
| 59 | +- **Wrapper docs:** github.com/Accenture/mercury-nodejs |
| 60 | +- **Engine guides:** github.com/Accenture/mercury-composable |
0 commit comments