← Receivers

pages:add-block

pages family

Insert ONE block into a page at a position (default: append). Every other block is preserved verbatim — the targeted alternative to pages:edit's full-page rewrite.

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
member
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
no
Not safe to blind-retry — dedupe on the envelope idempotencyKey.

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/pages:add-block \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "slug": <string>, "page": <string>, "section": <object> }}'

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.

  • slug string required The WORKSPACE slug. Names which workspace; it never authorizes one — the caller clears `pagesDenyReason`'s attested walk.
  • page string required The page's own slug.
  • section object required
  • atIndex number optional 0-based insert position. Omitted = append at the end.

Response

What comes back from the call.

  • ok boolean
  • slug string
  • title string
  • url string
  • status string
  • blocks number How many blocks the page holds AFTER the insert.
  • updatedAt number The write's timestamp, epoch ms.
  • unknownBlocks string[] PRESENT ⟺ the name is one the renderer CANNOT DRAW. The block was still stored and will paint nothing; repair with `pages:update-block`. An ALIASED or collapsed family name (HeroCentered, Wallet) is NOT listed — the render path rewrites it.
  • expandedFrom string Present ⟺ `section.component` was a TENANT block; this is the name that was sent.
  • expandedInto string[] The registry block names the tenant block expanded into, in order. Expansion is a SNAPSHOT: editing the composition later does not rewrite this page.
  • error string

Traffic

Every call to pages:add-block, 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 pages:add-block, 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

UI 5
  • one.ie/web/src/components/chat/BlockFrame.tsx:118
  • one.ie/web/src/components/live-edit/LiveEditSheet.tsx:79
  • one.ie/web/src/components/live-edit/LiveEditShell.tsx:231
  • one.ie/web/src/components/puck/AddToPage.tsx:14
  • one.ie/web/src/pages/components.astro:17
API route 4
  • one.ie/web/src/lib/puck/known-blocks.ts:5
  • one.ie/web/src/lib/puck/tenant-blocks.ts:26
  • one.ie/web/src/lib/receiver-index.generated.ts:207
  • one.ie/web/src/lib/resolvers/pages.ts:396
Agent runtime 1
  • channels/src/tools/pages.ts:329
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "slug": {
      "type": "string",
      "description": "The WORKSPACE slug. Names which workspace; it never authorizes one — the caller clears `pagesDenyReason`'s attested walk."
    },
    "page": {
      "type": "string",
      "description": "The page's own slug."
    },
    "section": {
      "type": "object",
      "properties": {
        "component": {
          "type": "string",
          "description": "A block name. Letters and digits, starting with a letter — anything else is refused as `invalid section`. Any of the registry blocks, not only the CRO subset `pages:edit` allowlists, plus any tenant block `blocks:declare` named."
        },
        "props": {
          "description": "The block's props, sent VERBATIM — the server runs `normalizeBlockProps` and does not fill defaults for you. Omitted is treated as `{}` by the handler.",
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        }
      },
      "required": [
        "component"
      ]
    },
    "atIndex": {
      "description": "0-based insert position. Omitted = append at the end.",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "slug",
    "page",
    "section"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "slug": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "blocks": {
      "description": "How many blocks the page holds AFTER the insert.",
      "type": "number"
    },
    "updatedAt": {
      "description": "The write's timestamp, epoch ms.",
      "type": "number"
    },
    "unknownBlocks": {
      "description": "PRESENT ⟺ the name is one the renderer CANNOT DRAW. The block was still stored and will paint nothing; repair with `pages:update-block`. An ALIASED or collapsed family name (HeroCentered, Wallet) is NOT listed — the render path rewrites it.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "expandedFrom": {
      "description": "Present ⟺ `section.component` was a TENANT block; this is the name that was sent.",
      "type": "string"
    },
    "expandedInto": {
      "description": "The registry block names the tenant block expanded into, in order. Expansion is a SNAPSHOT: editing the composition later does not rewrite this page.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "error": {
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}