← Receivers

book:chapter

book family

Read one chapter of a book as its author has it now (the draft if there is one) — markdown, for the writing room's chat

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
manage_things
The class of authority the caller must already hold, decided from the attested context with no round trip.
Cost
free
What one call costs, so you can budget before acting.
Reversible
yes
The effect can be undone by a later call.
Idempotent
yes
Safe to retry as-is.

Send it with your agent

One click hands your coding agent a prompt that registers the substrate, reads this contract, and makes the call. Launch opens the app; the others copy the prompt.

Claude Code
Codex
Cursor
Gemini CLI
Claude Desktop
ChatGPT
curl -X POST https://one.ie/api/ask/book:chapter \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "book": <string>, "chapter": <string> }}'

The key is never in a link. npx -y @oneie/cli login writes it to ~/.config/oneie/key on your machine.

Request

Validated before dispatch — an invalid payload is refused with the fix, never half-applied.

  • book string required The book's slug, e.g. 100-million-years-ahead.
  • chapter string required The chapter: its number ("3"), slug, file or title.
  • slug string optional The workspace the call is made in (channels nominates it; it is not who may edit).

Response

What comes back from the call.

  • ok boolean
  • book string
  • chapter object
  • draft object | null
  • words number
  • body string The chapter's markdown (its title block is not part of it). At most 60,000 characters; `truncated` says when it was cut.
  • truncated boolean
  • error string Named refusal: not_found · forbidden (no person, or not an author) · unavailable (roles or storage could not answer; retry).

Traffic

Every call to book:chapter, counted where it is dispatched — over HTTP or in-process alike. Aggregate only — no actor, no payload, no workspace.

Counting…

Wiring

Every place in the open source that names book:chapter, and the file that answers it. Read from the tree at build time — a receiver is reached by NAME through one door, so there is no import edge to follow and a grep is the honest shape of the question. Structure, not volume — the count is in Traffic above.

Called from

API route 2
  • one.ie/web/src/lib/receiver-index.generated.ts:53
  • one.ie/web/src/lib/resolvers/books.ts:2
Agent runtime 1
  • channels/src/tools/books.ts:40
→

Answered by

book:chapter one.ie/web/src/lib/resolvers/books.ts:134 Dispatched through POST /api/ask/book:chapter, after the envelope validates the payload.

book family · 2 more

JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "book": {
      "type": "string",
      "minLength": 1,
      "description": "The book's slug, e.g. 100-million-years-ahead."
    },
    "chapter": {
      "type": "string",
      "minLength": 1,
      "description": "The chapter: its number (\"3\"), slug, file or title."
    },
    "slug": {
      "description": "The workspace the call is made in (channels nominates it; it is not who may edit).",
      "type": "string"
    }
  },
  "required": [
    "book",
    "chapter"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "book": {
      "type": "string"
    },
    "chapter": {
      "type": "object",
      "properties": {
        "file": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "number": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "title": {
          "type": "string"
        }
      },
      "required": [
        "file",
        "slug",
        "number",
        "title"
      ]
    },
    "draft": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "savedAt": {
              "type": "string"
            }
          },
          "required": [
            "savedAt"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "words": {
      "type": "number"
    },
    "body": {
      "description": "The chapter's markdown (its title block is not part of it). At most 60,000 characters; `truncated` says when it was cut.",
      "type": "string"
    },
    "truncated": {
      "type": "boolean"
    },
    "error": {
      "description": "Named refusal: not_found · forbidden (no person, or not an author) · unavailable (roles or storage could not answer; retry).",
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}