← Receivers

pages:instantiate-shop-pack

pages family

Seed the whole storefront anatomy as twelve draft pages in one call, each stamped with the job it does. Idempotent by the DATABASE, not by this call: a partial unique index on (workspace, shop_role) holds the at-most-one, so a second call creates nothing and a renamed page is still recognised.

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
no
This cannot be undone. Dry-run it first where the contract allows.
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/pages:instantiate-shop-pack \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "slug": <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.

  • slug string optional which workspace. NOT an authority claim — the caller is authorized by the attested ctx through the same callerControlsWorkspace walk every pages:* receiver uses. Absent = the caller's own workspace.

Response

What comes back from the call.

  • ok boolean Describes THE CALL. `false` with a named `error` is the only refusal shape; a partial seed answers false AND carries the pages it managed.
  • pages object[] One entry per pack page, in pack order — present even on a partial failure, so a caller can see how far the seed got.
  • created number How many rows this call inserted. 0 on every call after the first.
  • existing number pages.length - created — the rows that were already there.
  • slug string The `home` role page's slug, kept because the live Stripe-Connect caller predates the per-page rows.
  • url string The `home` role page's url.
  • error string `missing slug`, `no_db`, `no_pack`, `seed_failed:<role>`, or the authority walk's own reason.

Traffic

Every call to pages:instantiate-shop-pack, 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:instantiate-shop-pack, 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 1
  • one.ie/web/src/components/studio/ShopBuilder.tsx:4
API route 5
  • one.ie/web/src/lib/puck/packs/shop/home.ts:25
  • one.ie/web/src/lib/puck/packs/shop/index.ts:25
  • one.ie/web/src/lib/puck/seed-pack.ts:39
  • one.ie/web/src/lib/puck/templates-commerce.ts:174
  • one.ie/web/src/pages/api/billing/stripe/connect/status.ts:119
CLI 2
  • packages/cli/src/lib/shop-init.ts:9
  • packages/cli/src/shop.ts:12

Answered by

pages:instantiate-shop-pack one.ie/web/src/lib/resolvers/pages.ts:498 Dispatched through POST /api/ask/pages:instantiate-shop-pack, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "slug": {
      "description": "which workspace. NOT an authority claim — the caller is authorized by the attested ctx through the same callerControlsWorkspace walk every pages:* receiver uses. Absent = the caller's own workspace.",
      "type": "string"
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "description": "Describes THE CALL. `false` with a named `error` is the only refusal shape; a partial seed answers false AND carries the pages it managed.",
      "type": "boolean"
    },
    "pages": {
      "description": "One entry per pack page, in pack order — present even on a partial failure, so a caller can see how far the seed got.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "pageSlug": {
            "type": "string",
            "description": "The pack's own id for the page — the proposal, not the stored row."
          },
          "slug": {
            "type": "string",
            "description": "The slug the row ACTUALLY carries, read back from the table. On a second call this is the existing `home`, never the `home-2` the minter proposed."
          },
          "shopRole": {
            "type": "string",
            "description": "What the page IS (`home`, `faq`, `terms` …). The title is what it is called this week; the role is the identity the index is unique on."
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "description": "`/p/<slug>`, built from the read-back slug."
          },
          "created": {
            "type": "boolean",
            "description": "TRUE only when THIS call inserted the row. False = it was already there."
          }
        },
        "required": [
          "pageSlug",
          "slug",
          "shopRole",
          "title",
          "url",
          "created"
        ]
      }
    },
    "created": {
      "description": "How many rows this call inserted. 0 on every call after the first.",
      "type": "number"
    },
    "existing": {
      "description": "pages.length - created — the rows that were already there.",
      "type": "number"
    },
    "slug": {
      "description": "The `home` role page's slug, kept because the live Stripe-Connect caller predates the per-page rows.",
      "type": "string"
    },
    "url": {
      "description": "The `home` role page's url.",
      "type": "string"
    },
    "error": {
      "description": "`missing slug`, `no_db`, `no_pack`, `seed_failed:<role>`, or the authority walk's own reason.",
      "type": "string"
    }
  }
}