Documentation Index
Fetch the complete documentation index at: https://redop.useagents.site/docs/llms.txt
Use this file to discover all available pages before exploring further.
Shape
Fields
| Field | Required | Purpose |
|---|---|---|
name | Yes | Human-readable resource name. |
description | No | Description shown to clients. |
mimeType | No | Resource MIME type. |
subscribe | No | Opt in to resources/subscribe. |
icons | No | Optional icons for supporting clients. |
before | No | Resource-local hook that runs before middleware and the handler. |
after | No | Resource-local hook that runs after a successful result and may replace it. |
afterResponse | No | Resource-local hook that runs after the response is written. Receives either result or error and cannot replace the response. |
middleware | No | Middleware scoped to this resource only. |
handler | Yes | Returns ResourceContents. |
ResourceContents
{ type: "text", text, mimeType? }{ type: "blob", blob, mimeType? }
Template URIs
If the resource URI contains{name} placeholders, Redop matches the concrete URI and passes the extracted values in params.
When you register the resource with a literal template URI, Redop also infers the params type from those placeholders. This means app.resource("users://{id}/profile", ...) gives you params.id: string in the handler, hooks, and resource middleware. Static resources do not get template params, so params is undefined there.
Redop also validates resource registration inputs early:
- the resource URI must be non-empty, trimmed, and free of whitespace
- the resource URI must include a valid scheme such as
file:,app:, orusers: - URI templates must have balanced
{}expressions - duplicate resource URIs are rejected
- the resource
namemust be non-empty and trimmed
Notes
- Use
afterResponsefor non-critical post-response work such as logging, metrics, or audit events. - Use
afterinstead when the logic must still be able to replace the successful resource result.