@noodleseed/one 0.161.1 → 0.162.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/catalog.d.ts.map +1 -1
- package/dist/commands/catalog.js +1 -0
- package/dist/commands/catalog.js.map +1 -1
- package/dist/commands/solutions-ops.d.ts +7 -0
- package/dist/commands/solutions-ops.d.ts.map +1 -0
- package/dist/commands/solutions-ops.js +283 -0
- package/dist/commands/solutions-ops.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js +4 -0
- package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.js +2 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +3 -3
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +3 -0
- package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +7 -0
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/assistant-gateway/package.json +1 -1
- package/node_modules/@noodle-borg/authoring/dist/index.d.ts +1 -0
- package/node_modules/@noodle-borg/authoring/dist/index.js +1 -0
- package/node_modules/@noodle-borg/authoring/dist/load-authored.js +1 -1
- package/node_modules/@noodle-borg/authoring/dist/managed-collection.d.ts +26 -0
- package/node_modules/@noodle-borg/authoring/dist/managed-collection.js +20 -0
- package/node_modules/@noodle-borg/authoring/dist/server.d.ts +3 -0
- package/node_modules/@noodle-borg/authoring/dist/server.js +2 -0
- package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-tenant-resources.js +241 -0
- package/node_modules/@noodle-borg/compiler/dist/artifact/assemble.js +4 -1
- package/node_modules/@noodle-borg/compiler/dist/artifact/types.d.ts +10 -0
- package/node_modules/@noodle-borg/compiler/dist/artifact/version.d.ts +4 -1
- package/node_modules/@noodle-borg/compiler/dist/artifact/version.js +4 -1
- package/node_modules/@noodle-borg/compiler/dist/compile.js +3 -0
- package/node_modules/@noodle-borg/compiler/dist/errors.d.ts +1 -1
- package/node_modules/@noodle-borg/compiler/dist/index.d.ts +2 -1
- package/node_modules/@noodle-borg/compiler/dist/index.js +1 -0
- package/node_modules/@noodle-borg/compiler/dist/managed-collections.d.ts +25 -0
- package/node_modules/@noodle-borg/compiler/dist/managed-collections.js +184 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +14 -0
- package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +3 -0
- package/node_modules/@noodle-borg/service/dist/business-information/contracts.js +5 -0
- package/node_modules/@noodle-borg/service/dist/business-information/in-memory-store.js +402 -0
- package/node_modules/@noodle-borg/service/dist/business-information/model.js +292 -0
- package/node_modules/@noodle-borg/service/dist/business-information/pagination.js +50 -0
- package/node_modules/@noodle-borg/service/dist/business-information/portable.js +6 -0
- package/node_modules/@noodle-borg/service/dist/business-information/profiles.js +121 -0
- package/node_modules/@noodle-borg/service/dist/business-information/validation.js +200 -0
- package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts +2 -2
- package/node_modules/@noodle-borg/service/dist/routes/business-information-dispatch.js +48 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-paths.js +92 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information-wire.js +117 -0
- package/node_modules/@noodle-borg/service/dist/routes/business-information.js +551 -0
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js +2 -0
- package/node_modules/@noodle-borg/service/dist/service.js +25 -0
- package/node_modules/@noodle-borg/service/package.json +1 -1
- package/node_modules/@noodle-borg/wire-contracts/dist/business-information.d.ts +583 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/business-information.js +205 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/index.d.ts +4 -3
- package/node_modules/@noodle-borg/wire-contracts/dist/index.js +1 -0
- package/node_modules/@noodle-borg/wire-contracts/dist/knowledge.d.ts +3 -3
- package/node_modules/@noodle-borg/wire-contracts/dist/managed-assistant-sponsorship.d.ts +8 -8
- package/node_modules/@noodleseed/assistant/package.json +1 -1
- package/package.json +2 -2
|
@@ -16,17 +16,17 @@ export const BUNDLED_EXAMPLE_NAMES = [
|
|
|
16
16
|
];
|
|
17
17
|
/** Real example sources vendored from `examples/<name>`, written under `examples/` in the skill tree. */
|
|
18
18
|
export const BUNDLED_EXAMPLE_FILES = [
|
|
19
|
-
{ relPath: "examples/acme-bistro/README.md", content: "# Acme Bistro — end-to-end ordering with payment-only handoff\n\nA Noodle MCP App for **Acme Bistro**, a fictional restaurant. It is the flagship for the **end-to-end\ntransaction** pattern: the customer browses the menu and builds the order *in chat*, and the order\ncompletes in chat — only **payment** hands off, via a signed checkout deep link (the card never touches\nthe app). It pairs a view-backed `tool` menu/cart with app-only `tool` cart helpers and a model-visible\n`create_checkout` tool backed by `handoff.allowedDomains`.\n\nCapability slot: **end-to-end in-chat transaction + payment-only handoff**, plus a worked **design-first**\ndeliverable set (`design/` — a UX Document, a single-file HTML wireframe with an embedded OpenAI Apps SDK\ncompliance audit, and a Recommended API contract). It sets the quality bar the `noodle-seed` skill's\n`references/experience-design.md` and `references/app-directory-compliance.md` teach. (Distinct from\n`food-ordering`, which is the broad widget-composition proof; this one owns the design-first end-to-end +\ncompliance exemplar.)\n\n## Design deliverables (the standard to match)\n\n- [`design/UX-Document.md`](design/UX-Document.md) — the house-style UX Document.\n- [`design/wireframe.html`](design/wireframe.html) — the single-file wireframe (open in a browser) with the\n embedded OpenAI Apps SDK compliance audit.\n- [`design/api-contract.md`](design/api-contract.md) — the Recommended API shapes for the partner's kitchen/\n ordering backend.\n\n## Local author loop\n\n```sh\nnoodle validate\nnoodle test\nnoodle dev\n```\n\nIn another terminal:\n\n```sh\nnoodle tools list\nnoodle tools call show_menu --args '{\"customer\":\"Asha\"}'\nnoodle tools call create_checkout --args '{\"customer\":\"Asha\",\"cartToken\":\"cart_1\",\"total\":36}'\nnoodle check --target chatgpt\n```\n\n## Deploy\n\n```sh\nnoodle link --org demo --app acme-bistro\nnoodle deploy --access owner-only\nnoodle open\n```\n\nThis example has no connector secrets and does not include tokens, caller-key mechanisms, or\n`.env.noodle` values. The menu, prices, and URLs are fictional; payment is handled off-app on\n`acme.example`, never in chat.\n" },
|
|
19
|
+
{ relPath: "examples/acme-bistro/README.md", content: "# Acme Bistro — end-to-end ordering with payment-only handoff\n\nA Noodle MCP App for **Acme Bistro**, a fictional restaurant. It is the flagship for the **end-to-end\ntransaction** pattern: the customer browses the menu and builds the order *in chat*, and the order\ncompletes in chat — only **payment** hands off, via a signed checkout deep link (the card never touches\nthe app). It pairs a view-backed `tool` menu/cart with app-only `tool` cart helpers and a model-visible\n`create_checkout` tool backed by `handoff.allowedDomains`.\n\nIt also declares a reusable `guest_requests` managed-collection schema. In this foundation slice the\ndeclaration compiles schema intent only: storage lifecycle, access, and a public submit route are bound by\nthe hosting service separately, and no submit tool is generated.\n\nCapability slot: **end-to-end in-chat transaction + payment-only handoff**, plus a worked **design-first**\ndeliverable set (`design/` — a UX Document, a single-file HTML wireframe with an embedded OpenAI Apps SDK\ncompliance audit, and a Recommended API contract). It sets the quality bar the `noodle-seed` skill's\n`references/experience-design.md` and `references/app-directory-compliance.md` teach. (Distinct from\n`food-ordering`, which is the broad widget-composition proof; this one owns the design-first end-to-end +\ncompliance exemplar.)\n\n## Design deliverables (the standard to match)\n\n- [`design/UX-Document.md`](design/UX-Document.md) — the house-style UX Document.\n- [`design/wireframe.html`](design/wireframe.html) — the single-file wireframe (open in a browser) with the\n embedded OpenAI Apps SDK compliance audit.\n- [`design/api-contract.md`](design/api-contract.md) — the Recommended API shapes for the partner's kitchen/\n ordering backend.\n\n## Local author loop\n\n```sh\nnoodle validate\nnoodle test\nnoodle dev\n```\n\nIn another terminal:\n\n```sh\nnoodle tools list\nnoodle tools call show_menu --args '{\"customer\":\"Asha\"}'\nnoodle tools call create_checkout --args '{\"customer\":\"Asha\",\"cartToken\":\"cart_1\",\"total\":36}'\nnoodle check --target chatgpt\n```\n\n## Deploy\n\n```sh\nnoodle link --org demo --app acme-bistro\nnoodle deploy --access owner-only\nnoodle open\n```\n\nThis example has no connector secrets and does not include tokens, caller-key mechanisms, or\n`.env.noodle` values. The menu, prices, and URLs are fictional; payment is handled off-app on\n`acme.example`, never in chat.\n" },
|
|
20
20
|
{ relPath: "examples/acme-bistro/design/UX-Document.md", content: "# Acme Bistro ChatGPT App — User Flow & Experience Document\n\n**Prepared by:** Noodle Seed\n**Scope:** Diners browse the Acme Bistro menu, build and confirm an order inside ChatGPT, then hand off once to a signed checkout link to pay — the card never touches the app.\n**Status:** Design specification (v1)\n**Funnel boundary:** IN the app — menu, order building, order confirmation, and the checkout hand-off, all in-chat. OFF-app — **payment only**, on Acme Bistro's PCI-scoped checkout at `pay.acme.example`. **No per-user OAuth in this app**; the connector runs on Acme's own service credentials, and the diner authenticates (if at all) only on the payment page.\n\n---\n\n## 0. The One-Paragraph Thesis\n\nA hungry diner opens ChatGPT and types *\"order me two margheritas and a lemon tart from Acme Bistro.\"* Today that intent scatters across a search, a delivery-app download, a menu scroll, and a checkout form. Acme Bistro collapses it into one conversation: the model reads the live menu, parses the order out of plain language, renders a running cart the diner can nudge with a tap or a sentence, and — only when the order is right — mints a **signed, expiring payment link** that opens Acme's own checkout. We own the entire pre-payment experience; Acme owns the money. That split is deliberate and it is the product: the app never sees a card number, so Acme's PCI scope never grows, yet the diner completes a real, paid-intent order without leaving the chat. For a single restaurant, this is the cheapest possible storefront on the fastest-growing surface — one `server.ts`, no app to install, and every order arrives at Acme's checkout already built. If you can convincingly finish this order in a sentence, you have out-competed every tap-driven ordering app on the one axis they cannot copy: language.\n\n---\n\n## 1. Acme Bistro Product Overview (Knowledge Base)\n\n**Acme Bistro is a single fictional neighbourhood restaurant** offering a short, curated menu for pickup ordering. Unlike a marketplace aggregator, there is one kitchen, one menu, and one checkout — which makes the conversational surface tight and the guardrails simple. The ChatGPT App is Acme's storefront on ChatGPT: it shows the menu, builds the order, and passes a ready cart to Acme's payment page.\n\n### 1.1 The Menu (authoritative — the app must know this exactly)\n\n| Item | ID | Price (USD) | Course |\n|------|-----|-------------|--------|\n| Stone-baked Margherita | `stone_pizza` | $14 | Mains |\n| Harvest Roast Bowl | `roast_bowl` | $13 | Mains |\n| House Garden Salad | `house_salad` | $11 | Starters |\n| Lemon Tart | `lemon_tart` | $8 | Desserts |\n| Sparkling Water | `sparkling` | $4 | Drinks |\n\nPrices are whole-dollar and fixed for v1. The **backend owns pricing** — the widget sums line items for display, but the amount that reaches checkout is recomputed and re-validated by Acme at `pay.acme.example`. The menu is small enough to render in a single inline widget with no pagination.\n\n### 1.2 The End-to-End Model (the defining choice)\n\nEvery other decision follows from one line: **the order is built and confirmed in chat; only payment hands off.** There is no in-chat card capture, no wallet, no stored payment method. When the diner is ready, the app calls `create_checkout`, which returns a **signed deep link** carrying a url-safe cart token and the numeric total; ChatGPT opens it, and Acme's checkout takes the card. The MCP server is never in the payment path.\n\n### 1.3 Business Model & Why Acme Wants This\n\nAcme's bottleneck is reach, not kitchen capacity: a neighbourhood restaurant has no realistic way onto a conversational surface without building an app. The ChatGPT App removes that bottleneck for the cost of one authored server. **Attribution is built in** — every checkout link carries `src=chatgpt`, so Acme can measure exactly how much revenue the conversational storefront drives against their existing web orders.\n\n---\n\n## 2. Competitive Landscape — Food Ordering on ChatGPT\n\n| Pattern | Examples | Strength | Gap Acme fills |\n|---------|----------|----------|----------------|\n| **Marketplace aggregators** | Large delivery apps | Vast networks, delivery logistics | Menu markups, no single-restaurant intimacy, heavy handoff to a separate app |\n| **Reservation / discovery** | Booking + reviews apps | Strong discovery inventory | No ordering, no checkout |\n| **Acme Bistro (this app)** | — | One kitchen, honest single-menu pricing, full order built in chat, payment on Acme's own PCI checkout | — |\n\n**Acme's position:** Acme is not trying to be a marketplace. Its advantage inside ChatGPT is **directness** — a diner who already wants Acme's food gets from craving to a paid-ready cart in one conversation, with the restaurant's own prices and the restaurant's own checkout. The single-restaurant scope is a feature: no ranking to game, no cross-restaurant carts, no ambiguity about whose menu the model is grounding on.\n\n---\n\n## 3. Target User Personas\n\n### Persona A — \"The Regular\"\nOrders from Acme every week and knows the menu. Wants the shortest possible path: *\"the usual — two margheritas and a sparkling water.\"* Values speed and an accurate cart over discovery.\n\n### Persona B — \"The Craver\"\nArrives with an appetite, not a specific dish: *\"something light from Acme\"* or *\"what mains do you have?\"* Needs the menu surfaced fast and an opinionated nudge toward the roast bowl or the salad.\n\n### Persona C — \"The Careful Orderer\"\nHas a dietary constraint and asks before adding: *\"is the garden salad vegetarian?\"* Needs honest, non-guessing answers grounded only in what the menu data actually states — and a clear defer-to-restaurant when it doesn't.\n\n### Persona D — \"The Group Coordinator\"\nOrdering for two or three people with a running budget: *\"add a margherita, a roast bowl, a salad, and a lemon tart — what's the total?\"* Needs a live, legible cart total and easy quantity edits before committing to pay.\n\n---\n\n## 4. Conversational User Flow\n\n### 4.1 Entry Points\n\nNatural phrases that should trigger the app:\n\n```\n\"Show me the Acme Bistro menu\"\n\"Order two margheritas and a lemon tart from Acme\"\n\"I want something light from Acme Bistro\"\n\"What mains does Acme have?\"\n\"Add a sparkling water to my Acme order\"\n\"What's my Acme total?\"\n\"Check out and pay for my Acme order\"\n```\n\n### 4.2 Flow Architecture\n\n```\n┌──────────────────────────────────────────────┐\n│ USER ENTERS CHAT │\n│ (natural-language prompt) │\n└───────────────────────┬────────────────────────┘\n │\n ▼\n ┌─────────────────────────────┐\n │ show_menu (widget) │\n │ MenuCart renders: 5 items, │\n │ steppers, live total, CTA │\n └──────────────┬───────────────┘\n │\n ┌───────────────┼────────────────┐\n ▼ ▼ ▼\n┌──────────────┐ ┌──────────────┐ ┌──────────────┐\n│ add_to_cart │ │remove_from_ │ │ taps in │\n│ (NL: \"two │ │cart (NL or │ │ the widget │\n│ margheritas\")│ │ − button) │ │ (+ / −) │\n└──────┬───────┘ └──────┬───────┘ └──────┬───────┘\n └────────────────┼────────────────┘\n ▼\n ┌─────────────────────────────┐\n │ Live cart + running total │\n │ (summed in the widget) │\n └──────────────┬───────────────┘\n │ \"check out & pay\"\n ▼\n ┌─────────────────────────────┐\n │ create_checkout │\n │ → signed, expiring link to │\n │ pay.acme.example │\n └──────────────┬───────────────┘\n ▼ (OFF-APP)\n ┌─────────────────────────────┐\n │ Acme PCI checkout · card │\n │ entered here, never in chat │\n └─────────────────────────────┘\n```\n\n### 4.3 Detailed Conversational Scenarios\n\n#### Scenario 1 — Natural-language order (Persona A/D)\n\n```\nUSER: Order me two margheritas and a lemon tart from Acme Bistro.\n\nAPP: [tool: show_menu {customer:\"Guest\"}] → renders MenuCart\n [tool: add_to_cart {item:\"stone_pizza\", quantity:2}]\n [tool: add_to_cart {item:\"lemon_tart\", quantity:1}]\n\n Here's your Acme Bistro order — two Stone-baked Margheritas\n and a Lemon Tart. That's $36 so far. Want a drink or a side,\n or shall I take you to checkout to pay?\n\n [MenuCart widget]\n ┌────────────────────────────────────────────┐\n │ 🍽 Acme Bistro 2 in cart │\n │ Stone-baked Margherita Mains $14 [−]2[+]│\n │ Harvest Roast Bowl Mains $13 [−]0[+]│\n │ House Garden Salad Starters$11 [−]0[+]│\n │ Lemon Tart Desserts $8 [−]1[+]│\n │ Sparkling Water Drinks $4 [−]0[+]│\n │ ────────────────────────────────────────── │\n │ Total $36 [ 💳 Check out & pay ] │\n │ Payment happens on acme.example — your card │\n │ is never entered in chat. │\n └────────────────────────────────────────────┘\n```\n\n#### Scenario 2 — Add and edit (Persona D)\n\n```\nUSER: Add a sparkling water too.\n\nAPP: [tool: add_to_cart {item:\"sparkling\", quantity:1}]\n Added a Sparkling Water — your total is $40 for four items.\n\nUSER: Actually drop one margherita.\n\nAPP: [tool: remove_from_cart {item:\"stone_pizza\"}]\n Done — one Margherita, one Lemon Tart, one Sparkling Water.\n New total $26. Ready to pay whenever you are.\n```\n\n#### Scenario 3 — Dietary question, honest answer (Persona C)\n\n```\nUSER: Is the garden salad vegetarian?\n\nAPP: The House Garden Salad is on our Starters menu at $11. I can\n tell you what's on the menu, but I can't confirm ingredient-\n level details like preparation or cross-contact — for\n allergy or dietary certainty, please check with Acme Bistro\n directly before ordering. Want me to add it anyway, or show\n you the other starters and mains?\n```\n\n#### Scenario 4 — Checkout handoff (all personas)\n\n```\nUSER: Check out and pay.\n\nAPP: [tool: create_checkout {customer:\"Guest\",\n cartToken:\"stone_pizzax2-lemon_tartx1-sparklingx1\", total:40}]\n\n Your order's ready — two Margheritas, a Lemon Tart, and a\n Sparkling Water, $40 total. I've opened Acme's secure\n checkout to take payment. Your card is entered on\n acme.example, never here in chat.\n\n [opens https://pay.acme.example/checkout?cart=\n stone_pizzax2-lemon_tartx1-sparklingx1&total=40&src=chatgpt]\n```\n\n---\n\n## 5. UI Widget Specifications\n\n> The widget is authored as a Noodle Seed React `view` (`tool` → `MenuCart`), styled with **vanilla CSS cascade layers** so it inherits the host's light/dark theme and adapts to ChatGPT's surface. Compliance is verified with `noodle check --target chatgpt`.\n\n### 5.1 Design System Compliance\n\nAcme authors **one** brand surface through the server `branding` tokens; everything else defers to host-provided semantic tokens (text, background, border, success/warning), so the widget looks native in ChatGPT.\n\n| Category | Source | Value |\n|----------|--------|-------|\n| Text / background / border | Host semantic tokens (via cascade layers) | Host-provided, theme-aware |\n| Brand accent | `branding.accent` | `#B91C1C` (Acme red) — **primary CTA + logo mark only** |\n| Surface (light) | `branding.surface` | `#FEF3F2` |\n| Surface (dark) | `branding.surfaceDark` | `#1A1211` |\n| Radius / density | `branding.radius` / `branding.density` | `lg` / `comfortable` |\n\n**Enforced rules:** system font stack; monochromatic outlined icons (the plate mark, the card glyph); WCAG AA contrast on all text/surface pairs (Acme red is used only as a fill behind light text or as a 1px mark, never as body text on white); no nested scroll (the 5-item menu fits without an inner scroller); brand accent restricted to the primary **Check out & pay** button and the header mark.\n\n### 5.2 Display Mode Strategy\n\n| User intent | Display mode | Rationale |\n|-------------|--------------|-----------|\n| Browse the menu / build an order | **Inline Card** (`MenuCart`) | Five items + steppers + total fit an inline card; no drill-in, no pagination |\n| Confirm total & pay | **Inline Card** (same widget, primary CTA) | The CTA opens the off-app checkout; no in-chat payment surface |\n| Payment | **None (off-app browser)** | Deliberately not a widget — card capture stays on Acme's PCI page |\n\nModes deliberately **not** used: no Carousel (a single flat menu doesn't need one), no Fullscreen (five items don't warrant it), no Picture-in-Picture (there is no live-tracking phase in v1 — fulfilment happens after payment on Acme's side).\n\n### 5.3 Widget Specifications\n\n#### ★ `MenuCart` — Inline Card\n**Purpose:** the entire in-chat experience — menu, order building, live total, and the checkout hand-off — in one widget.\n\n| Spec | Value |\n|------|-------|\n| Header | Plate mark, \"Acme Bistro\" title, status subtitle, cart chip (`N in cart` / `Fullscreen`) |\n| Menu rows | One per item: name, course, price, and a `[− qty +]` stepper |\n| Total | Live subtotal summed in React from the session-local cart |\n| Primary action | **Check out & pay** (brand red) — disabled while the cart is empty or checkout is pending; opens the signed link via `openExternal` |\n| Reassurance | Fine-print note: \"Payment happens on acme.example — your card is never entered in chat.\" |\n| Edge states | Empty cart (CTA disabled), pending checkout (\"Opening checkout…\"), dark theme variant |\n\n**Two-users note:** every row is model-fillable — the model reflects *\"two margheritas\"* into `add_to_cart {item:\"stone_pizza\", quantity:2}`, and the same widget a human taps updates identically.\n\n---\n\n## 6. Tool Definitions (App Backend)\n\n### ★ Tool 1: `show_menu` — `tool`\n**Input:** `{ customer?: string = \"Guest\" }`\n**Output:** `{ status, customer, items[] }` where each item is `{ id, name, price, kind }`.\n**Renders:** the `MenuCart` widget.\n**Annotations:** read-only.\n**Triggers:** any menu / ordering intent (\"show me Acme's menu\", \"order from Acme\").\n\n### Tool 2: `add_to_cart` — `tool`\n**Input:** `{ customer?, item: <menu id> = \"stone_pizza\", quantity?: int ≥1 = 1, notes?: string }`\n**Output:** `{ status, item, quantity, notes }`.\n**Annotations:** local write (non-destructive).\n**Triggers:** natural-language additions (\"add two margheritas\", \"and a lemon tart\"). Widget-facing helper — reflects NL selections into the visible cart.\n\n### Tool 3: `remove_from_cart` — `tool`\n**Input:** `{ customer?, item: <menu id> = \"stone_pizza\" }`\n**Output:** `{ status, item }`.\n**Annotations:** local write (non-destructive).\n**Triggers:** \"drop one margherita\", \"remove the salad\", or the widget's `−` button.\n\n### ★ Tool 4: `create_checkout` — model-visible `tool`\n**Input:** `{ customer?, cartToken: string = \"cart\", total: number ≥0 = 0 }`\n**Output:** `{ status, summary, checkoutUrl }`.\n**Annotations:** open-link (external action).\n**Behaviour:** returns a signed deep link — `https://pay.acme.example/checkout?cart=<cartToken>&total=<total>&src=chatgpt`. The card never reaches this app. `handoff.allowedDomains` includes `pay.acme.example`, so the compiler derives the ChatGPT redirect domain and the link opens without a safe-link warning.\n**Triggers:** \"check out\", \"pay\", \"I'm done\".\n\nTools are atomic and model-friendly: `show_menu` reads, the two cart tools write locally, `create_checkout` opens the one external link. There is no `submit_order` or `capture_payment` tool by design — order fulfilment and payment are Acme's, past the boundary.\n\n---\n\n## 7. Conversation Design Principles\n\n### 7.1 Tone of Voice\nWarm, concise, and restaurant-first — like a counter host who knows the menu. State prices and totals as plain facts (\"that's $36 so far\"), recommend when it helps (\"the roast bowl is the heartier main\"), and never oversell.\n\n### 7.2 Guardrails (non-negotiable)\n- **Never invent menu items or prices.** Ground every dish and amount in the `show_menu` data — only the five items, only their listed prices.\n- **Never confirm allergen or dietary safety.** State what the menu says (course, name, price); for ingredient-level or cross-contact questions, defer to Acme Bistro directly. Never assert \"this is vegetarian/gluten-free\" without a menu flag that says so.\n- **Never take payment in chat.** No card numbers, no CVV, no wallet. Payment is the one off-app step; if a user pastes card details, decline and point them to the checkout link.\n- **Never promise fulfilment the app can't see.** The app builds and hands off the order; pickup timing and order status live on Acme's side after payment.\n- **Always show the honest total before checkout**, and restate that payment happens on `acme.example`.\n\n### 7.3 Memory Strategy\nRemember the diner's in-session cart and name. There is no cross-session account (no per-user auth) — a returning diner starts a fresh order, though the model may recall a prior order *within the same conversation* to speed a reorder.\n\n### 7.4 Multi-Turn Intelligence\nThe model infers item + quantity from language (\"a couple of margheritas\" → `quantity:2`), keeps a running total in view, and asks only when genuinely ambiguous (\"did you mean the margherita or the roast bowl?\"). It never asks for a field it can default.\n\n---\n\n## 8. End-to-End User Journey Map\n\n**Phase 1 — Menu (first 5–10s):** user names Acme or asks for the menu → `show_menu` renders `MenuCart`.\n**Phase 2 — Build (10–40s):** natural-language adds/removes (`add_to_cart` / `remove_from_cart`) and/or widget steppers; the total updates live.\n**Phase 3 — Confirm (5–10s):** the app restates the cart and total in plain language; user says \"pay\".\n**Phase 4 — Hand off (2–5s):** `create_checkout` mints the signed link; ChatGPT opens it.\n**Phase 5 — Pay (off-app):** the diner enters their card on `pay.acme.example`; the app's job is done. Fulfilment is Acme's.\n\n---\n\n## 9. Handoff Architecture (Deep Dive)\n\n**What must be true of the handoff:**\n1. **Context survives the jump.** The cart token encodes every line (`stone_pizzax2-lemon_tartx1-sparklingx1`) plus the total, so Acme's checkout rehydrates the exact order without a second round-trip.\n2. **The link is signed and attributable.** Acme signs the checkout URL server-side and carries `src=chatgpt` for attribution. `handoff.allowedDomains: ['https://pay.acme.example', 'https://acme.example']` lets the compiler emit the redirect domain so the link opens cleanly.\n3. **State is re-validated past the boundary.** Acme recomputes pricing, checks inventory, and enforces the total at checkout — the widget's sum is display-only and never authoritative.\n4. **The link expires.** Checkout URLs carry an `expires_at`; a stale link lands on a \"cart expired — start again\" page rather than charging an out-of-date total.\n\n**URL pattern:** `https://pay.acme.example/checkout?cart={cartToken}&total={total}&src=chatgpt`\n\n**Why payment is the only handoff:** keeping card capture on Acme's PCI-scoped checkout means the MCP server never enters payment scope — no card data, no stored methods, no compliance burden added by the ChatGPT surface. The app is the storefront; Acme is the register.\n\n**Open questions for Acme engineering:**\n- Signing scheme + default expiry window (proposed: 15 minutes)?\n- Should the cart token be opaque (server-minted) instead of the human-readable `idxN-idxN` form, to prevent client-side total tampering before re-validation?\n- Post-payment visibility (webhook / polling) so a later chat turn can confirm \"your order is ready\" — out of scope for v1?\n\n---\n\n## 10. Demo Scope Recommendation\n\n**MVP (build in this order):**\n1. `show_menu` + `MenuCart` — menu renders, steppers work, total sums live.\n2. `add_to_cart` / `remove_from_cart` — natural-language and button edits both reflect in the cart.\n3. `create_checkout` — signed link opens Acme's checkout with the cart pre-loaded.\n\n**2-minute demo script:**\n```\nNARRATOR: \"A diner wants dinner from their neighbourhood spot,\nAcme Bistro, without leaving ChatGPT.\"\n\nUSER: \"Order two margheritas and a lemon tart from Acme Bistro.\"\n[show_menu renders MenuCart; add_to_cart ×2 fills the cart — $36]\n\nUSER: \"Add a sparkling water.\"\n[add_to_cart — total ticks to $40]\n\nUSER: \"What's my total?\"\n[MenuCart shows Total $40, four items]\n\nUSER: \"Check out and pay.\"\n[create_checkout mints the signed link; ChatGPT opens\n pay.acme.example — card entered there, never in chat]\n\nNARRATOR: \"Built and confirmed in one conversation; paid on Acme's\nown secure checkout. The app never saw a card number.\"\n```\n\n---\n\n## 11. Technical Architecture (High Level)\n\n```\n┌───────────────────────────────────────────────┐\n│ ChatGPT Client │\n│ MenuCart widget (Noodle Seed React view) │\n│ cascade-layer CSS · host theme tokens │\n└───────────────────────┬─────────────────────────┘\n │ tool calls\n ▼\n┌───────────────────────────────────────────────┐\n│ Acme Bistro MCP server (Noodle Seed) │\n│ show_menu · add_to_cart · remove_from_cart │\n│ create_checkout │\n│ branding tokens · handoff.allowedDomains │\n│ (static menu data; no per-user auth) │\n└───────────────────────┬─────────────────────────┘\n │ signed checkout link (no card data)\n ▼\n┌───────────────────────────────────────────────┐\n│ Acme Bistro checkout — pay.acme.example │\n│ PCI-scoped card capture · pricing/inventory │\n│ validation · order fulfilment │\n└───────────────────────────────────────────────┘\n```\n\nMenu data is static in v1 (authored in `server.ts`). Session cart state lives in the widget (React). No database, no per-user credentials, no card data in the MCP server — the smallest possible surface for a single-restaurant storefront.\n\n---\n\n## 12. Success Metrics\n\n| Metric | Target | Measurement |\n|--------|--------|-------------|\n| Menu render → first add | 55%+ of `show_menu` sessions add ≥1 item | `add_to_cart` call rate |\n| Cart with ≥1 item → `create_checkout` | 60%+ | Tool-call funnel |\n| Checkout link opened → paid (on Acme) | Acme-side; joined via `src=chatgpt` | Acme checkout analytics |\n| End-to-end (entry → paid order) | 15%+ | Funnel + Acme attribution |\n| Average order value | $30+ | Cart totals at `create_checkout` |\n| Time to checkout hand-off | Under 60s | Session duration |\n\n**Attribution mechanics:** every `create_checkout` link carries `src=chatgpt`, so Acme can attribute paid revenue to the ChatGPT storefront and compare it against their existing web channel.\n\n---\n\n## 13. Future Enhancements (Post-Launch)\n\n- **Item notes at scale** — surface the `notes` field in the widget for per-item requests (\"no basil\").\n- **Modifier groups** — sizes / add-ons if the menu grows beyond flat items (would introduce an item-detail widget).\n- **Live inventory** — mark sold-out items unavailable from Acme's kitchen system.\n- **Post-payment confirmation** — an Acme webhook so a later chat turn can confirm \"your order is ready for pickup.\"\n- **Returning-diner reorder** — opt-in, if Acme later adds per-user accounts (would move this app off the no-auth model deliberately).\n- **Scheduled pickup** — choose a pickup window before the checkout hand-off.\n- **Second location** — a lightweight location picker if Acme opens another kitchen (keeps single-menu simplicity per location).\n\n---\n\n### Appendix A — Funnel Boundary Cheat-Sheet\n\n| User request | Handled in the app? | Where it lands |\n|--------------|---------------------|----------------|\n| \"Show me the menu\" | ✅ In-chat | `show_menu` → `MenuCart` |\n| \"Add two margheritas\" | ✅ In-chat | `add_to_cart` |\n| \"Drop the salad\" | ✅ In-chat | `remove_from_cart` |\n| \"What's my total?\" | ✅ In-chat | Live widget total |\n| \"Check out / pay\" | ✅ In-chat → hand-off | `create_checkout` mints signed link |\n| Enter card & pay | ❌ OFF-APP | `pay.acme.example` (Acme PCI checkout) |\n| Pickup timing / order status | ❌ OFF-APP | Acme's side, post-payment |\n| Account / saved cards | ❌ Not in v1 | No per-user auth by design |\n\n---\n\n*This document is the master spec for the Acme Bistro ChatGPT App. Acme Bistro, its menu, and its domains are illustrative. All tool names, widget names, menu items, and prices match the runnable Noodle Seed app exactly; the checkout link shape and pricing/inventory validation are owned by Acme's backend past the funnel boundary.*\n" },
|
|
21
21
|
{ relPath: "examples/acme-bistro/design/api-contract.md", content: "# Acme Bistro — Recommended API Shapes\n\n**For Acme Bistro Engineering.** Concrete request/response JSON for each tool the ChatGPT App calls, so your backend can implement exactly what the app needs. These are a starting point for the contract, not a final spec — field names and envelopes can shift to match Acme's platform conventions, as long as the semantics below are preserved.\n\n> **The backend owns pricing, inventory, and payment.** The widget sums line items for *display only*; the amount that reaches checkout is recomputed and enforced by Acme at `pay.acme.example`. The MCP server never sees a card number, a CVV, or a stored payment method — payment is the single off-app step. Keep pricing, availability, and the signed checkout link server-side.\n\nThe app maps to four tools:\n\n| Tool | Kind | Job |\n|------|------|-----|\n| `show_menu` | `tool` (read-only) | Return the menu + render the `MenuCart` widget |\n| `add_to_cart` | `tool` (local write) | Reflect a natural-language addition into the visible cart |\n| `remove_from_cart` | `tool` (local write) | Remove one unit of an item |\n| `create_checkout` | model-visible `tool` (open-link) | Mint the signed, expiring payment link |\n\nMenu item IDs are the stable enum: `stone_pizza`, `roast_bowl`, `house_salad`, `lemon_tart`, `sparkling`.\n\n---\n\n## 1. `show_menu` — menu + widget\n\nThe one read. Returns the full menu (small enough to render without pagination) plus a status line the model can speak.\n\n**Request**\n```json\n{\n \"customer\": \"Guest\"\n}\n```\n\n**Response**\n```json\n{\n \"status\": \"Acme Bistro menu is ready for Guest. Build the order here; pay at checkout.\",\n \"customer\": \"Guest\",\n \"items\": [\n { \"id\": \"stone_pizza\", \"name\": \"Stone-baked Margherita\", \"price\": 14, \"kind\": \"Mains\" },\n { \"id\": \"roast_bowl\", \"name\": \"Harvest Roast Bowl\", \"price\": 13, \"kind\": \"Mains\" },\n { \"id\": \"house_salad\", \"name\": \"House Garden Salad\", \"price\": 11, \"kind\": \"Starters\" },\n { \"id\": \"lemon_tart\", \"name\": \"Lemon Tart\", \"price\": 8, \"kind\": \"Desserts\" },\n { \"id\": \"sparkling\", \"name\": \"Sparkling Water\", \"price\": 4, \"kind\": \"Drinks\" }\n ]\n}\n```\n\n**Notes.**\n- `price` is a whole-dollar USD number in v1. If Acme moves to cents or a currency field, keep one canonical numeric price per item so the widget's sum and the checkout total agree.\n- `items[]` is the authoritative menu — the model must not invent dishes or prices outside this list.\n- **Extensibility:** Acme may add fields (`description`, `available`, `dietary_tags`, `image_url`) without breaking the app, as long as `id`, `name`, `price`, and `kind` remain. If `available: false` is added, the widget should disable that row's `+` button.\n\n---\n\n## 2. `add_to_cart` — reflect a natural-language addition\n\nCalled when the diner says *\"add two margheritas\"* — the model fills `item` and `quantity` from language. The cart is session-local in the widget; this tool echoes the resolved selection so the model can speak it back.\n\n**Request**\n```json\n{\n \"customer\": \"Guest\",\n \"item\": \"stone_pizza\",\n \"quantity\": 2,\n \"notes\": \"\"\n}\n```\n\n**Response**\n```json\n{\n \"status\": \"Added 2 × stone_pizza for Guest.\",\n \"item\": \"stone_pizza\",\n \"quantity\": 2,\n \"notes\": \"\"\n}\n```\n\n**Notes.**\n- `quantity` is an integer ≥ 1 (defaults to 1). `item` must be one of the five menu IDs; reject unknown IDs.\n- `notes` is a free-text per-item request (\"no basil\"); optional, defaults to empty.\n- **If Acme makes this server-authoritative** (rather than widget-local), return the updated line and a running subtotal so the frontend can render without a second call — e.g. add `line_total` and `cart_subtotal`. For v1 the widget owns the running total, so the minimal echo above is sufficient.\n\n---\n\n## 3. `remove_from_cart` — remove one unit\n\nCalled by the widget's `−` button or by language (\"drop a margherita\"). Removes one unit of the item.\n\n**Request**\n```json\n{\n \"customer\": \"Guest\",\n \"item\": \"stone_pizza\"\n}\n```\n\n**Response**\n```json\n{\n \"status\": \"Removed stone_pizza for Guest.\",\n \"item\": \"stone_pizza\"\n}\n```\n\n**Notes.**\n- Removing decrements by one; the widget deletes the line when its quantity reaches zero.\n- No error if the item isn't in the cart — the operation is idempotent from the model's view (the widget guards the `−` button when quantity is 0).\n\n---\n\n## 4. `create_checkout` — mint the signed payment link\n\nThe one handoff. The widget computes the total (live React) and passes a url-safe cart token plus the numeric total; the tool returns a **signed, expiring** deep link to Acme's PCI-scoped checkout. **No card data is exchanged here** — the diner enters their card on `pay.acme.example`.\n\n**Request**\n```json\n{\n \"customer\": \"Guest\",\n \"cartToken\": \"stone_pizzax2-lemon_tartx1-sparklingx1\",\n \"total\": 40\n}\n```\n\n**Response**\n```json\n{\n \"status\": \"Ready to pay for Guest's order.\",\n \"summary\": \"Guest's Acme Bistro order · 40 USD\",\n \"checkoutUrl\": \"https://pay.acme.example/checkout?cart=stone_pizzax2-lemon_tartx1-sparklingx1&total=40&src=chatgpt\",\n \"expires_at\": \"2026-07-09T18:15:00-07:00\"\n}\n```\n\n**Notes.**\n- **`checkoutUrl` must be signed server-side.** The `cart` and `total` query params are a convenience for rehydration and display — Acme's checkout must **recompute pricing from the cart token and enforce its own total**, never trusting the client-supplied `total`. Treat the incoming `total` as a display hint to reconcile, not as the charge amount.\n- **`expires_at`** bounds the link (proposed 15-minute window). An expired link should land on a \"cart expired — start again\" page, not charge a stale total. The runnable app returns `status`, `summary`, and `checkoutUrl`; adding `expires_at` is the recommended production extension so the model can tell the diner how long the link is good for.\n- **`src=chatgpt`** is the attribution parameter — carry it through to Acme's order record so ChatGPT-sourced revenue is measurable against the web channel.\n- **Cart token format.** The app emits a human-readable `<id>x<qty>-<id>x<qty>` token. For production, consider an **opaque server-minted token** (the client passes a cart handle; Acme resolves it to the authoritative lines) to remove any incentive to tamper with the token or `total` before re-validation.\n- **`handoff.allowedDomains`** in the server (`https://pay.acme.example`, `https://acme.example`) is what lets the compiler derive the ChatGPT redirect domain, so the link opens without a safe-link warning. Any new payment domain must be added there.\n\n---\n\n## Validation & ownership summary\n\nThe backend must own and enforce:\n\n1. **Pricing** — the authoritative per-item price and the order total; the widget sum is display-only.\n2. **Inventory** — item availability at menu-read and at checkout; a sold-out item should not reach a paid order.\n3. **Payment** — all card capture on `pay.acme.example`, inside Acme's PCI scope. The MCP server is never in the payment path.\n4. **Link integrity** — server-side signing of `checkoutUrl`, an enforced `expires_at`, and recomputation of the total from the cart token before charging.\n\nEverything before payment — menu, cart, total, and minting the link — is the ChatGPT App's job. Everything at and after payment is Acme's.\n\n---\n\n## Open questions for Acme engineering\n\n1. **Cart token shape** — keep the readable `idxN-idxN` form, or move to an opaque server handle to prevent client-side tampering?\n2. **Signing scheme & expiry** — HMAC, JWT, or signed query params, and what default expiry window (proposed 15 min)?\n3. **Currency & precision** — stay whole-dollar USD, or introduce cents / a `currency` field? The widget and checkout total must agree.\n4. **Server-authoritative cart** — should `add_to_cart` / `remove_from_cart` become backend-owned (returning subtotals), or stay widget-local for v1?\n5. **Post-payment visibility** — expose a webhook or polling endpoint so a later chat turn can confirm order status? Out of scope for v1.\n" },
|
|
22
22
|
{ relPath: "examples/acme-bistro/design/wireframe.html", content: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<title>Acme Bistro × ChatGPT — End-to-End Wireframes</title>\n<style>\n @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');\n * { margin: 0; padding: 0; box-sizing: border-box; }\n body { font-family: 'Inter', -apple-system, sans-serif; background: #f4f5f7; color: #1a1211; line-height: 1.55; }\n\n /* ── Acme Bistro brand tokens (from server branding) ── */\n :root {\n --acme-red: #B91C1C;\n --acme-red-deep: #991B1B;\n --acme-red-soft: #FEF3F2;\n --acme-red-border: #FBD5D2;\n --acme-dark: #1A1211;\n --green: #15803D; --green-soft: #F0FDF4; --green-border: #BBF7D0;\n --amber: #B45309; --amber-soft: #FFFBEB; --amber-border: #FDE68A;\n }\n\n /* ── Page Header ── */\n .page-header { background: #fff; border-bottom: 1px solid #e0dddb; padding: 30px 48px; position: sticky; top: 0; z-index: 100; }\n .page-header h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }\n .page-header h1 .brand { color: var(--acme-red); }\n .page-header p { font-size: 13px; color: #8a8580; margin-top: 4px; }\n .page-header .scope { display: inline-block; margin-top: 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; padding: 5px 13px; background: var(--acme-dark); color: #fff; border-radius: 5px; }\n .page-header .scope b { color: var(--acme-red-border); }\n\n /* ── Section Nav ── */\n .section-nav { background: #fff; border-bottom: 1px solid #eee; padding: 11px 48px; display: flex; gap: 22px; font-size: 12px; font-weight: 600; position: sticky; top: 92px; z-index: 99; }\n .section-nav a { color: #8a8580; text-decoration: none; }\n .section-nav a:hover { color: var(--acme-red); }\n\n .container { max-width: 1440px; margin: 0 auto; padding: 36px 48px 80px; }\n\n /* ── Legend ── */\n .vocab { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; padding: 14px 18px; background: #fff; border: 1px solid #e6e3e0; border-radius: 12px; font-size: 12px; color: #555; }\n .vocab-item { display: flex; align-items: center; gap: 8px; }\n .vocab-sw { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.08); }\n .sw-red { background: var(--acme-red); } .sw-green { background: var(--green); }\n .sw-amber { background: var(--amber); } .sw-dark { background: var(--acme-dark); }\n .sw-grey { background: #cfcac5; } .sw-dash { background: repeating-linear-gradient(45deg,#fff,#fff 3px,#cfcac5 3px,#cfcac5 5px); }\n\n /* ── Section ── */\n .section { margin-bottom: 56px; }\n .section-label { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #a39d97; margin-bottom: 8px; display: block; }\n .section-title { font-size: 27px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }\n .section-subtitle { font-size: 14px; color: #6b655f; margin-bottom: 22px; max-width: 820px; }\n\n /* ── Rationale Block ── */\n .rationale { background: #fff; border: 1px solid #e6e3e0; border-left: 3px solid var(--acme-red); border-radius: 10px; padding: 16px 20px; margin-bottom: 22px; max-width: 960px; }\n .rationale h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: #a39d97; margin-bottom: 9px; }\n .rationale p { font-size: 13px; color: #46413c; line-height: 1.65; margin-bottom: 8px; }\n .rationale p:last-child { margin-bottom: 0; }\n .r-tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-right: 4px; letter-spacing: 0.3px; }\n .r-tag.ux { background: #EEF2FF; color: #4338CA; }\n .r-tag.ui { background: #ECFEFF; color: #0E7490; }\n .r-tag.acme { background: var(--acme-red-soft); color: var(--acme-red-deep); }\n .r-tag.trust { background: var(--green-soft); color: var(--green); }\n code { background: #f1efec; padding: 1px 5px; border-radius: 3px; font-size: 11px; font-family: 'JetBrains Mono', monospace; }\n\n /* ── Phone Row ── */\n .phones-row { display: flex; gap: 24px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }\n .phone-step { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }\n .step-label { font-size: 11px; font-weight: 700; color: #8a8580; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 12px; text-align: center; max-width: 300px; }\n .step-label small { display: block; font-weight: 400; letter-spacing: 0; text-transform: none; color: #b0aaa4; margin-top: 3px; }\n .phone { width: 300px; min-height: 600px; background: #fff; border: 2px solid var(--acme-dark); border-radius: 30px; overflow: hidden; display: flex; flex-direction: column; }\n .phone.offapp { border: 2px dashed #b0aaa4; }\n .phone-notch { width: 90px; height: 22px; background: var(--acme-dark); border-radius: 0 0 12px 12px; margin: 0 auto; flex-shrink: 0; }\n .phone.offapp .phone-notch { background: #b0aaa4; }\n .phone-screen { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }\n .step-arrow { display: flex; align-items: center; justify-content: center; flex-shrink: 0; align-self: center; width: 32px; font-size: 22px; color: #cfcac5; padding-top: 260px; }\n\n /* ── Chrome ── */\n .chatgpt-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 9px; border-bottom: 1px solid #eee; }\n .chatgpt-header .model-name { font-size: 13px; font-weight: 600; }\n .chatgpt-header .dots { font-size: 17px; color: #b0aaa4; letter-spacing: 2px; }\n .browser-header { display: flex; align-items: center; gap: 7px; padding: 7px 9px; background: #f1efec; border-radius: 8px; font-size: 10px; color: #6b655f; }\n .browser-header .lock { font-size: 10px; }\n .browser-header .url { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: #46413c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n\n /* ── Messages ── */\n .msg { max-width: 92%; font-size: 12.5px; line-height: 1.55; }\n .msg.user { align-self: flex-end; background: var(--acme-dark); color: #fff; padding: 9px 13px; border-radius: 16px 16px 4px 16px; margin-left: auto; }\n .msg.assistant { color: #1a1211; padding: 2px 0; }\n .msg.assistant strong { font-weight: 600; }\n\n /* ── Tool Call ── */\n .tool-call { display: flex; align-items: center; gap: 8px; padding: 7px 11px; background: #faf8f6; border: 1px solid #e6e3e0; border-radius: 9px; font-size: 10.5px; color: #6b655f; }\n .tool-call .icon { width: 19px; height: 19px; background: var(--acme-red); border-radius: 5px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }\n .tool-call .icon svg { width: 12px; height: 12px; stroke: #fff; fill: none; stroke-width: 2; }\n .tool-call .label { font-weight: 700; color: var(--acme-dark); font-family: 'JetBrains Mono', monospace; font-size: 10px; }\n .tool-call .mono-tool { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: #8a8580; }\n\n /* ── MenuCart widget ── */\n .wcard { border: 1.5px solid var(--acme-red-border); border-radius: 14px; overflow: hidden; background: #fff; }\n .wcard-head { display: flex; align-items: center; gap: 9px; padding: 11px 13px; background: var(--acme-red-soft); border-bottom: 1px solid var(--acme-red-border); }\n .wcard-head .logo { width: 26px; height: 26px; border-radius: 7px; background: var(--acme-red); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }\n .wcard-head .logo svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 1.7; }\n .wc-title { font-size: 13px; font-weight: 800; }\n .wc-status { font-size: 10px; color: #8a8580; margin-top: 1px; line-height: 1.35; }\n .wc-chip { margin-left: auto; font-size: 9.5px; font-weight: 700; padding: 3px 8px; background: #fff; border: 1px solid var(--acme-red-border); color: var(--acme-red-deep); border-radius: 20px; white-space: nowrap; }\n .menu-row { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-bottom: 1px solid #f4f2ef; }\n .mr-main { flex: 1; }\n .mr-name { font-size: 12px; font-weight: 600; }\n .mr-kind { font-size: 9.5px; color: #a39d97; text-transform: uppercase; letter-spacing: 0.4px; }\n .mr-price { font-size: 12px; font-weight: 700; color: #46413c; }\n .mr-qty { display: flex; align-items: center; gap: 7px; }\n .step-btn { width: 20px; height: 20px; border: 1px solid #d8d3ce; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #46413c; background: #fff; }\n .step-btn.on { border-color: var(--acme-red); color: var(--acme-red); }\n .step-btn.dis { opacity: 0.3; }\n .mr-count { font-size: 12px; font-weight: 700; min-width: 12px; text-align: center; }\n .wc-foot { display: flex; align-items: center; gap: 10px; padding: 12px 13px 8px; }\n .wc-total { font-size: 13px; color: #46413c; }\n .wc-total strong { font-size: 16px; font-weight: 800; color: var(--acme-dark); margin-left: 4px; }\n .wc-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; background: var(--acme-red); color: #fff; border: none; border-radius: 10px; font-size: 12px; font-weight: 700; cursor: pointer; }\n .wc-cta svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 2; }\n .wc-cta.dis { opacity: 0.4; }\n .wc-note { padding: 0 13px 12px; font-size: 9.5px; color: #a39d97; line-height: 1.45; }\n .wc-note b { color: var(--green); }\n\n /* ── Handoff card ── */\n .handoff-card { border: 1.5px solid var(--acme-red-border); border-radius: 14px; background: #fff; text-align: center; padding: 16px 15px 13px; }\n .handoff-card .glyph { width: 42px; height: 42px; margin: 0 auto 8px; border-radius: 11px; background: var(--acme-red-soft); display: flex; align-items: center; justify-content: center; }\n .handoff-card .glyph svg { width: 22px; height: 22px; stroke: var(--acme-red); fill: none; stroke-width: 1.6; }\n .handoff-card h4 { font-size: 13.5px; font-weight: 800; margin-bottom: 4px; }\n .handoff-card p { font-size: 11px; color: #6b655f; margin-bottom: 11px; line-height: 1.5; }\n .mini-sum { background: #faf8f6; border: 1px solid #eae7e3; border-radius: 9px; padding: 9px 11px; margin: 0 0 11px; text-align: left; }\n .mini-sum .row { display: flex; justify-content: space-between; font-size: 11px; color: #6b655f; padding: 2px 0; }\n .mini-sum .row.total { font-size: 12.5px; font-weight: 800; color: var(--acme-dark); border-top: 1px solid #eae7e3; margin-top: 4px; padding-top: 5px; }\n .pay-link { font-size: 9px; color: #a39d97; margin-top: 10px; line-height: 1.55; }\n .pay-link code { font-size: 8.5px; }\n .pay-link b { color: var(--acme-dark); }\n\n .cta-primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 10px; background: var(--acme-red); color: #fff; border: none; border-radius: 10px; font-size: 12.5px; font-weight: 700; cursor: pointer; margin-bottom: 6px; }\n .cta-ghost { display: block; width: 100%; padding: 9px; background: transparent; color: var(--acme-dark); border: 1.5px solid #d8d3ce; border-radius: 10px; font-size: 12px; font-weight: 600; cursor: pointer; }\n\n /* ── Off-app checkout body ── */\n .checkout-body { flex: 1; display: flex; flex-direction: column; gap: 9px; padding-top: 4px; }\n .co-brand { font-size: 14px; font-weight: 800; color: var(--acme-red); }\n .co-sub { font-size: 10px; color: #8a8580; }\n .co-field { border: 1px solid #e6e3e0; border-radius: 9px; padding: 9px 11px; }\n .co-field .lbl { font-size: 9px; color: #a39d97; text-transform: uppercase; letter-spacing: 0.5px; }\n .co-field .val { font-size: 12px; color: #46413c; margin-top: 3px; font-family: 'JetBrains Mono', monospace; }\n .co-field.card { background: var(--amber-soft); border-color: var(--amber-border); }\n .co-line { display: flex; justify-content: space-between; font-size: 11px; color: #6b655f; padding: 2px 0; }\n .co-line.total { font-weight: 800; color: var(--acme-dark); font-size: 13px; border-top: 1px solid #eee; padding-top: 5px; margin-top: 3px; }\n .co-pay { padding: 11px; background: var(--acme-red); color: #fff; border: none; border-radius: 10px; font-size: 13px; font-weight: 700; text-align: center; margin-top: auto; }\n .co-secure { font-size: 9.5px; color: #a39d97; text-align: center; margin-top: 7px; }\n\n /* ── Composer ── */\n .composer { margin-top: auto; padding: 9px 0 2px; border-top: 1px solid #eee; }\n .composer-bar { display: flex; align-items: center; background: #f1efec; border-radius: 20px; padding: 8px 12px; font-size: 11.5px; color: #a39d97; }\n .composer-bar .send { width: 24px; height: 24px; background: var(--acme-dark); border-radius: 50%; margin-left: auto; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }\n\n /* ── Widget Gallery ── */\n .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 22px; }\n .sf { }\n .sf-name { font-size: 12px; font-weight: 700; margin-bottom: 8px; color: #46413c; }\n .sf-name span { font-weight: 400; color: #a39d97; }\n\n /* ── API appendix ── */\n .api-panel { background: #fff; border: 1px solid #e6e3e0; border-radius: 12px; overflow: hidden; margin-bottom: 18px; }\n .api-panel-header { background: var(--acme-dark); color: #fff; padding: 12px 18px; font-size: 13px; font-weight: 700; }\n .api-step { padding: 14px 18px; border-bottom: 1px solid #f1efec; }\n .api-step:last-child { border-bottom: none; }\n .api-step-label { font-size: 10.5px; font-weight: 700; color: #a39d97; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 7px; }\n .api-endpoint { background: #faf8f6; border: 1px solid #eae7e3; border-radius: 8px; padding: 9px 12px; margin-bottom: 7px; }\n .api-endpoint .kind { display: inline-block; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 3px; margin-right: 6px; letter-spacing: 0.4px; font-family: 'JetBrains Mono', monospace; }\n .kind.read { background: var(--green-soft); color: var(--green); }\n .kind.write { background: #ECFEFF; color: #0E7490; }\n .kind.link { background: var(--acme-red-soft); color: var(--acme-red-deep); }\n .api-endpoint .path { font-size: 12.5px; font-weight: 700; color: var(--acme-dark); font-family: 'JetBrains Mono', monospace; }\n .api-endpoint .desc { font-size: 11px; color: #8a8580; margin-top: 3px; }\n .api-note { font-size: 11px; color: #5f594f; background: var(--amber-soft); border-left: 3px solid var(--amber-border); padding: 8px 12px; border-radius: 0 6px 6px 0; margin-top: 6px; }\n .api-note strong { color: #46413c; }\n\n /* ── Audit table ── */\n .audit-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 14px; }\n .audit-table th { text-align: left; padding: 9px 13px; background: #faf8f6; font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: #a39d97; border-bottom: 1px solid #e6e3e0; }\n .audit-table td { padding: 9px 13px; border-bottom: 1px solid #f1efec; vertical-align: top; color: #46413c; }\n .audit-table td:first-child { font-weight: 600; color: #2d2825; }\n .audit-pass { color: var(--green); font-weight: 700; white-space: nowrap; }\n .audit-guard td:first-child { color: var(--acme-red-deep); }\n\n .page-divider { border: none; border-top: 2px solid #e6e3e0; margin: 48px 0; }\n .footer { text-align: center; font-size: 11px; color: #b0aaa4; padding: 24px 0 8px; }\n</style>\n</head>\n<body>\n\n<div class=\"page-header\">\n <h1><span class=\"brand\">Acme Bistro</span> × ChatGPT App — End-to-End Wireframes</h1>\n <p>Prepared by Noodle Seed · Browse → Build order → Confirm → Hand off to pay · Single-restaurant storefront</p>\n <span class=\"scope\">FUNNEL BOUNDARY: menu, order & confirmation IN CHATGPT · <b>PAYMENT ONLY OFF-APP</b> (pay.acme.example) · no per-user auth</span>\n</div>\n\n<div class=\"section-nav\">\n <a href=\"#legend\">Legend</a>\n <a href=\"#flow\">End-to-End Flow</a>\n <a href=\"#build\">Build & Total</a>\n <a href=\"#handoff\">Payment Handoff</a>\n <a href=\"#gallery\">Widget Gallery</a>\n <a href=\"#api\">MCP Tools</a>\n <a href=\"#compliance\">Compliance Audit</a>\n</div>\n\n<div class=\"container\">\n\n <!-- ── LEGEND ── -->\n <div class=\"section\" id=\"legend\">\n <div class=\"vocab\">\n <div class=\"vocab-item\"><div class=\"vocab-sw sw-red\"></div><strong>Acme Red</strong> — primary CTA + logo mark only</div>\n <div class=\"vocab-item\"><div class=\"vocab-sw sw-green\"></div><strong>Green</strong> — trust / \"card never in chat\"</div>\n <div class=\"vocab-item\"><div class=\"vocab-sw sw-amber\"></div><strong>Amber</strong> — off-app payment surface</div>\n <div class=\"vocab-item\"><div class=\"vocab-sw sw-dark\"></div><strong>Dark</strong> — text, user bubbles</div>\n <div class=\"vocab-item\"><div class=\"vocab-sw sw-grey\"></div><strong>Grey</strong> — neutral / host UI</div>\n <div class=\"vocab-item\"><div class=\"vocab-sw sw-dash\"></div><strong>Dashed frame</strong> — off-app destination</div>\n </div>\n <div class=\"rationale\">\n <h4>How to read these wireframes</h4>\n <p><span class=\"r-tag ui\">UI</span> <strong>Solid-border phones are the ChatGPT App</strong> (the Noodle Seed <code>MenuCart</code> widget rendered inline). <strong>Dashed-border phones are off-app</strong> — reached only after the payment hand-off, on Acme's own checkout. Every widget is preceded by its <code>tool-call</code> chip so you can see exactly which tool the model invoked.</p>\n <p><span class=\"r-tag trust\">TRUST</span> <strong>The app never guesses and never touches a card.</strong> Menu, prices, and totals are grounded in the <code>show_menu</code> data; the diner's card is entered only on the amber off-app checkout. This is the whole safety story of the app, and it is visible in the pixels.</p>\n </div>\n </div>\n\n <!-- ═══ SECTION 1: END-TO-END FLOW ═══ -->\n <div class=\"section\" id=\"flow\">\n <span class=\"section-label\">The whole journey</span>\n <div class=\"section-title\">One conversation, from craving to a paid-ready cart</div>\n <div class=\"section-subtitle\">A diner names Acme and their order in plain language; the model renders the menu, reflects the order into a live cart, confirms the total, and mints a signed payment link. Only the final step — entering a card — leaves ChatGPT.</div>\n\n <div class=\"phones-row\">\n\n <!-- Step 1: Menu -->\n <div class=\"phone-step\">\n <div class=\"step-label\">1 · Show the menu<small>show_menu → MenuCart</small></div>\n <div class=\"phone\"><div class=\"phone-notch\"></div><div class=\"phone-screen\">\n <div class=\"chatgpt-header\"><span class=\"model-name\">ChatGPT</span><span class=\"dots\">···</span></div>\n <div class=\"msg user\">Order me two margheritas and a lemon tart from Acme Bistro.</div>\n <div class=\"tool-call\"><span class=\"icon\"><svg viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><circle cx=\"12\" cy=\"12\" r=\"4\"/></svg></span><span><span class=\"label\">show_menu</span> <span class=\"mono-tool\">{customer:\"Guest\"}</span></span></div>\n <div class=\"msg assistant\">Here's your Acme Bistro order — building it now:</div>\n <div class=\"wcard\">\n <div class=\"wcard-head\">\n <span class=\"logo\"><svg viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><circle cx=\"12\" cy=\"12\" r=\"4\"/></svg></span>\n <div><div class=\"wc-title\">Acme Bistro</div><div class=\"wc-status\">Menu ready. Build the order here; pay at checkout.</div></div>\n <span class=\"wc-chip\">0 in cart</span>\n </div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Stone-baked Margherita</span> <span class=\"mr-kind\">Mains</span></span><span class=\"mr-price\">$14</span><span class=\"mr-qty\"><span class=\"step-btn dis\">−</span><span class=\"mr-count\">0</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Harvest Roast Bowl</span> <span class=\"mr-kind\">Mains</span></span><span class=\"mr-price\">$13</span><span class=\"mr-qty\"><span class=\"step-btn dis\">−</span><span class=\"mr-count\">0</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">House Garden Salad</span> <span class=\"mr-kind\">Starters</span></span><span class=\"mr-price\">$11</span><span class=\"mr-qty\"><span class=\"step-btn dis\">−</span><span class=\"mr-count\">0</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Lemon Tart</span> <span class=\"mr-kind\">Desserts</span></span><span class=\"mr-price\">$8</span><span class=\"mr-qty\"><span class=\"step-btn dis\">−</span><span class=\"mr-count\">0</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Sparkling Water</span> <span class=\"mr-kind\">Drinks</span></span><span class=\"mr-price\">$4</span><span class=\"mr-qty\"><span class=\"step-btn dis\">−</span><span class=\"mr-count\">0</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"wc-foot\"><span class=\"wc-total\">Total <strong>$0</strong></span><button class=\"wc-cta dis\"><svg viewBox=\"0 0 24 24\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\"/><path d=\"M3 10h18\"/></svg>Check out & pay</button></div>\n <div class=\"wc-note\">Payment happens on acme.example — <b>your card is never entered in chat.</b></div>\n </div>\n <div class=\"composer\"><div class=\"composer-bar\">Message<span class=\"send\">↑</span></div></div>\n </div></div>\n </div>\n <div class=\"step-arrow\">→</div>\n\n <!-- Step 2: NL order reflected -->\n <div class=\"phone-step\">\n <div class=\"step-label\">2 · Parse the order<small>add_to_cart ×2 from language</small></div>\n <div class=\"phone\"><div class=\"phone-notch\"></div><div class=\"phone-screen\">\n <div class=\"chatgpt-header\"><span class=\"model-name\">ChatGPT</span><span class=\"dots\">···</span></div>\n <div class=\"tool-call\"><span class=\"icon\"><svg viewBox=\"0 0 24 24\"><path d=\"M12 5v14M5 12h14\"/></svg></span><span><span class=\"label\">add_to_cart</span> <span class=\"mono-tool\">{item:\"stone_pizza\", quantity:2}</span></span></div>\n <div class=\"tool-call\"><span class=\"icon\"><svg viewBox=\"0 0 24 24\"><path d=\"M12 5v14M5 12h14\"/></svg></span><span><span class=\"label\">add_to_cart</span> <span class=\"mono-tool\">{item:\"lemon_tart\", quantity:1}</span></span></div>\n <div class=\"msg assistant\">Two Stone-baked Margheritas and a Lemon Tart — <strong>$36</strong> so far. Want a drink or a side, or shall I take you to checkout?</div>\n <div class=\"wcard\">\n <div class=\"wcard-head\">\n <span class=\"logo\"><svg viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><circle cx=\"12\" cy=\"12\" r=\"4\"/></svg></span>\n <div><div class=\"wc-title\">Acme Bistro</div><div class=\"wc-status\">Added 2 × Stone-baked Margherita.</div></div>\n <span class=\"wc-chip\">3 in cart</span>\n </div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Stone-baked Margherita</span> <span class=\"mr-kind\">Mains</span></span><span class=\"mr-price\">$14</span><span class=\"mr-qty\"><span class=\"step-btn on\">−</span><span class=\"mr-count\">2</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Harvest Roast Bowl</span> <span class=\"mr-kind\">Mains</span></span><span class=\"mr-price\">$13</span><span class=\"mr-qty\"><span class=\"step-btn dis\">−</span><span class=\"mr-count\">0</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">House Garden Salad</span> <span class=\"mr-kind\">Starters</span></span><span class=\"mr-price\">$11</span><span class=\"mr-qty\"><span class=\"step-btn dis\">−</span><span class=\"mr-count\">0</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Lemon Tart</span> <span class=\"mr-kind\">Desserts</span></span><span class=\"mr-price\">$8</span><span class=\"mr-qty\"><span class=\"step-btn on\">−</span><span class=\"mr-count\">1</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Sparkling Water</span> <span class=\"mr-kind\">Drinks</span></span><span class=\"mr-price\">$4</span><span class=\"mr-qty\"><span class=\"step-btn dis\">−</span><span class=\"mr-count\">0</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"wc-foot\"><span class=\"wc-total\">Total <strong>$36</strong></span><button class=\"wc-cta\"><svg viewBox=\"0 0 24 24\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\"/><path d=\"M3 10h18\"/></svg>Check out & pay</button></div>\n <div class=\"wc-note\">Payment happens on acme.example — <b>your card is never entered in chat.</b></div>\n </div>\n <div class=\"composer\"><div class=\"composer-bar\">\"add a sparkling water\"<span class=\"send\">↑</span></div></div>\n </div></div>\n </div>\n <div class=\"step-arrow\">→</div>\n\n <!-- Step 3: Edit + confirm total -->\n <div class=\"phone-step\">\n <div class=\"step-label\">3 · Edit & confirm total<small>add / remove · live sum</small></div>\n <div class=\"phone\"><div class=\"phone-notch\"></div><div class=\"phone-screen\">\n <div class=\"chatgpt-header\"><span class=\"model-name\">ChatGPT</span><span class=\"dots\">···</span></div>\n <div class=\"msg user\">Add a sparkling water too.</div>\n <div class=\"tool-call\"><span class=\"icon\"><svg viewBox=\"0 0 24 24\"><path d=\"M12 5v14M5 12h14\"/></svg></span><span><span class=\"label\">add_to_cart</span> <span class=\"mono-tool\">{item:\"sparkling\", quantity:1}</span></span></div>\n <div class=\"msg assistant\">Added a Sparkling Water — your total is <strong>$40</strong> for four items. Ready to pay whenever you are.</div>\n <div class=\"wcard\">\n <div class=\"wcard-head\">\n <span class=\"logo\"><svg viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><circle cx=\"12\" cy=\"12\" r=\"4\"/></svg></span>\n <div><div class=\"wc-title\">Acme Bistro</div><div class=\"wc-status\">Added Sparkling Water.</div></div>\n <span class=\"wc-chip\">4 in cart</span>\n </div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Stone-baked Margherita</span> <span class=\"mr-kind\">Mains</span></span><span class=\"mr-price\">$14</span><span class=\"mr-qty\"><span class=\"step-btn on\">−</span><span class=\"mr-count\">2</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Lemon Tart</span> <span class=\"mr-kind\">Desserts</span></span><span class=\"mr-price\">$8</span><span class=\"mr-qty\"><span class=\"step-btn on\">−</span><span class=\"mr-count\">1</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Sparkling Water</span> <span class=\"mr-kind\">Drinks</span></span><span class=\"mr-price\">$4</span><span class=\"mr-qty\"><span class=\"step-btn on\">−</span><span class=\"mr-count\">1</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"wc-foot\"><span class=\"wc-total\">Total <strong>$40</strong></span><button class=\"wc-cta\"><svg viewBox=\"0 0 24 24\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\"/><path d=\"M3 10h18\"/></svg>Check out & pay</button></div>\n <div class=\"wc-note\">Payment happens on acme.example — <b>your card is never entered in chat.</b></div>\n </div>\n <div class=\"composer\"><div class=\"composer-bar\">\"check out and pay\"<span class=\"send\">↑</span></div></div>\n </div></div>\n </div>\n <div class=\"step-arrow\">→</div>\n\n <!-- Step 4: Checkout handoff card -->\n <div class=\"phone-step\">\n <div class=\"step-label\">4 · Mint the payment link<small>create_checkout (in-chat)</small></div>\n <div class=\"phone\"><div class=\"phone-notch\"></div><div class=\"phone-screen\">\n <div class=\"chatgpt-header\"><span class=\"model-name\">ChatGPT</span><span class=\"dots\">···</span></div>\n <div class=\"msg user\">Check out and pay.</div>\n <div class=\"tool-call\"><span class=\"icon\"><svg viewBox=\"0 0 24 24\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\"/><path d=\"M3 10h18\"/></svg></span><span><span class=\"label\">create_checkout</span> <span class=\"mono-tool\">{total:40, cartToken:\"…\"}</span></span></div>\n <div class=\"msg assistant\">Your order's ready — I've opened Acme's secure checkout to take payment:</div>\n <div class=\"handoff-card\">\n <div class=\"glyph\"><svg viewBox=\"0 0 24 24\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\"/><path d=\"M3 10h18\"/></svg></div>\n <h4>Pay on Acme Bistro checkout</h4>\n <p>Your order is staged and ready. Enter your card on <strong>acme.example</strong> — it's never typed in chat.</p>\n <div class=\"mini-sum\">\n <div class=\"row\"><span>2 × Stone-baked Margherita</span><span>$28</span></div>\n <div class=\"row\"><span>1 × Lemon Tart</span><span>$8</span></div>\n <div class=\"row\"><span>1 × Sparkling Water</span><span>$4</span></div>\n <div class=\"row total\"><span>Total</span><span>$40</span></div>\n </div>\n <button class=\"cta-primary\"><svg viewBox=\"0 0 24 24\" style=\"width:14px;height:14px;stroke:#fff;fill:none;stroke-width:2\"><path d=\"M5 12h14M13 6l6 6-6 6\"/></svg>Pay $40 on acme.example ↗</button>\n <button class=\"cta-ghost\">Keep editing</button>\n <div class=\"pay-link\">Opens <code>pay.acme.example/checkout?cart=…&total=40&src=chatgpt</code><br>Signed link · expires in <b>15 min</b> · 🔒 payment handled by Acme</div>\n </div>\n <div class=\"composer\"><div class=\"composer-bar\">Message<span class=\"send\">↑</span></div></div>\n </div></div>\n </div>\n <div class=\"step-arrow\">→</div>\n\n <!-- Step 5: OFF-APP checkout -->\n <div class=\"phone-step\">\n <div class=\"step-label\">5 · Pay (OFF-APP)<small>pay.acme.example · Acme PCI checkout</small></div>\n <div class=\"phone offapp\"><div class=\"phone-notch\"></div><div class=\"phone-screen\">\n <div class=\"browser-header\"><span class=\"lock\">🔒</span><span class=\"url\">pay.acme.example/checkout?cart=…&total=40&src=chatgpt</span></div>\n <div class=\"checkout-body\">\n <div><div class=\"co-brand\">Acme Bistro</div><div class=\"co-sub\">Secure checkout · order from ChatGPT</div></div>\n <div class=\"co-field\"><div class=\"lbl\">Order</div><div class=\"val\" style=\"font-family:'Inter'\">2 Margherita · 1 Lemon Tart · 1 Sparkling</div></div>\n <div class=\"co-field card\"><div class=\"lbl\">Card number</div><div class=\"val\">•••• •••• •••• ____</div></div>\n <div class=\"co-field\"><div class=\"lbl\">Contact (optional)</div><div class=\"val\" style=\"font-family:'Inter'\">name@example.com</div></div>\n <div style=\"padding:2px 2px 0\">\n <div class=\"co-line\"><span>Subtotal</span><span>$40.00</span></div>\n <div class=\"co-line\"><span>Tax (recomputed by Acme)</span><span>$3.30</span></div>\n <div class=\"co-line total\"><span>Total</span><span>$43.30</span></div>\n </div>\n <button class=\"co-pay\">Pay $43.30</button>\n <div class=\"co-secure\">🔒 PCI-scoped · card stays on acme.example · the ChatGPT App never sees it</div>\n </div>\n </div></div>\n </div>\n\n </div>\n </div>\n\n <hr class=\"page-divider\">\n\n <!-- ═══ SECTION 2: BUILD & TOTAL (deep dive) ═══ -->\n <div class=\"section\" id=\"build\">\n <span class=\"section-label\">Capability · Order building</span>\n <div class=\"section-title\">Build the order in language, confirm it in pixels</div>\n <div class=\"section-subtitle\">The whole menu, the cart, the running total, and the pay button live in one inline widget. The diner drives it two ways — by talking to the model or by tapping the steppers — and both land in the same place.</div>\n\n <div class=\"rationale\">\n <h4>Why this approach</h4>\n <p><span class=\"r-tag acme\">ACME</span> <strong>One kitchen, one widget.</strong> A single restaurant with five items doesn't need discovery, carousels, or a fullscreen menu — it needs the fastest path from craving to a confirmed cart. <code>MenuCart</code> collapses menu, cart, and checkout into one card the diner never scrolls out of.</p>\n <p><span class=\"r-tag ux\">UX</span> <strong>Language is the input; the widget is the receipt.</strong> \"Two margheritas and a lemon tart\" parses into two <code>add_to_cart</code> calls — no tapping required — and the widget instantly shows the result so the diner can trust what the model heard. Editing works the same in both directions.</p>\n <p><span class=\"r-tag ui\">UI</span> <strong>Inline Card, brand accent on the CTA only.</strong> Acme red (<code>#B91C1C</code>) appears only on the header mark and the <strong>Check out & pay</strong> button; everything else uses host theme tokens via cascade layers, so the widget is native in ChatGPT light or dark. No nested scroll — five rows fit.</p>\n <p><span class=\"r-tag trust\">TRUST</span> <strong>The total is honest and display-only.</strong> The widget sums line items live, but the amount that charges is recomputed by Acme at checkout. The reassurance line (\"your card is never entered in chat\") is present in every frame, not just the last one.</p>\n </div>\n </div>\n\n <hr class=\"page-divider\">\n\n <!-- ═══ SECTION 3: PAYMENT HANDOFF ═══ -->\n <div class=\"section\" id=\"handoff\">\n <span class=\"section-label\">Capability · The one handoff</span>\n <div class=\"section-title\">Payment is the only step that leaves ChatGPT</div>\n <div class=\"section-subtitle\">When the order is right, <code>create_checkout</code> mints a signed, expiring link carrying the cart token, the total, and an attribution tag. ChatGPT opens Acme's own PCI checkout. The MCP server is never in the payment path.</div>\n\n <div class=\"rationale\">\n <h4>Why this approach</h4>\n <p><span class=\"r-tag trust\">TRUST</span> <strong>The card never touches the app.</strong> No in-chat card field, no wallet, no stored payment method. Keeping capture on <code>pay.acme.example</code> means the ChatGPT surface adds zero PCI scope — the single most important safety property of the design.</p>\n <p><span class=\"r-tag acme\">ACME</span> <strong>The link is signed, expiring, and attributable.</strong> Acme signs the URL server-side, sets an <code>expires_at</code> (proposed 15 min), and carries <code>src=chatgpt</code> so ChatGPT-sourced revenue is measurable. <code>handoff.allowedDomains</code> lists <code>pay.acme.example</code> and <code>acme.example</code> so the compiler derives the redirect domain and the link opens without a safe-link warning.</p>\n <p><span class=\"r-tag ux\">UX</span> <strong>Context survives the jump.</strong> The cart token (<code>stone_pizzax2-lemon_tartx1-sparklingx1</code>) rehydrates the exact order on Acme's checkout — the diner never re-enters what they already told the model. State is re-validated past the boundary: Acme recomputes pricing and tax and enforces its own total.</p>\n </div>\n\n <div class=\"phones-row\">\n <div class=\"phone-step\">\n <div class=\"step-label\">In-chat: the hand-off card<small>CheckoutHandoff · create_checkout</small></div>\n <div class=\"phone\"><div class=\"phone-notch\"></div><div class=\"phone-screen\">\n <div class=\"chatgpt-header\"><span class=\"model-name\">ChatGPT</span><span class=\"dots\">···</span></div>\n <div class=\"msg assistant\">Your $40 order is staged. Tap to pay on Acme's checkout:</div>\n <div class=\"handoff-card\">\n <div class=\"glyph\"><svg viewBox=\"0 0 24 24\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\"/><path d=\"M3 10h18\"/></svg></div>\n <h4>Pay on Acme Bistro checkout</h4>\n <p>Sign in (if you like) and pay with your card on <strong>acme.example</strong>.</p>\n <div class=\"mini-sum\">\n <div class=\"row\"><span>4 items</span><span>$40</span></div>\n <div class=\"row total\"><span>Pay on acme.example</span><span>$40+tax</span></div>\n </div>\n <button class=\"cta-primary\">Pay $40 on acme.example ↗</button>\n <div class=\"pay-link\">Signed · <b>expires 15 min</b> · <code>src=chatgpt</code></div>\n </div>\n <div class=\"composer\"><div class=\"composer-bar\">Message<span class=\"send\">↑</span></div></div>\n </div></div>\n </div>\n <div class=\"step-arrow\">→</div>\n <div class=\"phone-step\">\n <div class=\"step-label\">Off-app: Acme checkout<small>dashed = not our app</small></div>\n <div class=\"phone offapp\"><div class=\"phone-notch\"></div><div class=\"phone-screen\">\n <div class=\"browser-header\"><span class=\"lock\">🔒</span><span class=\"url\">pay.acme.example/checkout?cart=stone_pizzax2-lemon_tartx1-sparklingx1&total=40&src=chatgpt</span></div>\n <div class=\"checkout-body\">\n <div><div class=\"co-brand\">Acme Bistro</div><div class=\"co-sub\">Secure checkout</div></div>\n <div class=\"co-field\"><div class=\"lbl\">Order (rehydrated from token)</div><div class=\"val\" style=\"font-family:'Inter'\">2 Margherita · 1 Lemon Tart · 1 Sparkling</div></div>\n <div class=\"co-field card\"><div class=\"lbl\">Card number · PCI-scoped</div><div class=\"val\">•••• •••• •••• ____</div></div>\n <div style=\"padding:2px 2px 0\">\n <div class=\"co-line\"><span>Subtotal (re-validated)</span><span>$40.00</span></div>\n <div class=\"co-line\"><span>Tax</span><span>$3.30</span></div>\n <div class=\"co-line total\"><span>Total</span><span>$43.30</span></div>\n </div>\n <button class=\"co-pay\">Pay $43.30</button>\n <div class=\"co-secure\">🔒 card never leaves acme.example · app has no post-handoff visibility in v1</div>\n </div>\n </div></div>\n </div>\n </div>\n </div>\n\n <hr class=\"page-divider\">\n\n <!-- ═══ WIDGET GALLERY ═══ -->\n <div class=\"section\" id=\"gallery\">\n <span class=\"section-label\">Specimen grid</span>\n <div class=\"section-title\">Widget Gallery</div>\n <div class=\"section-subtitle\">Every widget state rendered once at rest. One widget ships: <code>MenuCart</code>. This is what engineers screenshot against the build.</div>\n\n <div class=\"gallery\">\n <div class=\"sf\">\n <div class=\"sf-name\">MenuCart <span>· empty (CTA disabled)</span></div>\n <div class=\"wcard\">\n <div class=\"wcard-head\"><span class=\"logo\"><svg viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><circle cx=\"12\" cy=\"12\" r=\"4\"/></svg></span><div><div class=\"wc-title\">Acme Bistro</div><div class=\"wc-status\">Build your order, then check out to pay.</div></div><span class=\"wc-chip\">0 in cart</span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Stone-baked Margherita</span> <span class=\"mr-kind\">Mains</span></span><span class=\"mr-price\">$14</span><span class=\"mr-qty\"><span class=\"step-btn dis\">−</span><span class=\"mr-count\">0</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">House Garden Salad</span> <span class=\"mr-kind\">Starters</span></span><span class=\"mr-price\">$11</span><span class=\"mr-qty\"><span class=\"step-btn dis\">−</span><span class=\"mr-count\">0</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"wc-foot\"><span class=\"wc-total\">Total <strong>$0</strong></span><button class=\"wc-cta dis\"><svg viewBox=\"0 0 24 24\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\"/><path d=\"M3 10h18\"/></svg>Check out & pay</button></div>\n <div class=\"wc-note\">Payment happens on acme.example — <b>your card is never entered in chat.</b></div>\n </div>\n </div>\n\n <div class=\"sf\">\n <div class=\"sf-name\">MenuCart <span>· filled ($40, 4 items)</span></div>\n <div class=\"wcard\">\n <div class=\"wcard-head\"><span class=\"logo\"><svg viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><circle cx=\"12\" cy=\"12\" r=\"4\"/></svg></span><div><div class=\"wc-title\">Acme Bistro</div><div class=\"wc-status\">Added Sparkling Water.</div></div><span class=\"wc-chip\">4 in cart</span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Stone-baked Margherita</span> <span class=\"mr-kind\">Mains</span></span><span class=\"mr-price\">$14</span><span class=\"mr-qty\"><span class=\"step-btn on\">−</span><span class=\"mr-count\">2</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Lemon Tart</span> <span class=\"mr-kind\">Desserts</span></span><span class=\"mr-price\">$8</span><span class=\"mr-qty\"><span class=\"step-btn on\">−</span><span class=\"mr-count\">1</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"menu-row\"><span class=\"mr-main\"><span class=\"mr-name\">Sparkling Water</span> <span class=\"mr-kind\">Drinks</span></span><span class=\"mr-price\">$4</span><span class=\"mr-qty\"><span class=\"step-btn on\">−</span><span class=\"mr-count\">1</span><span class=\"step-btn\">+</span></span></div>\n <div class=\"wc-foot\"><span class=\"wc-total\">Total <strong>$40</strong></span><button class=\"wc-cta\"><svg viewBox=\"0 0 24 24\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\"/><path d=\"M3 10h18\"/></svg>Check out & pay</button></div>\n <div class=\"wc-note\">Payment happens on acme.example — <b>your card is never entered in chat.</b></div>\n </div>\n </div>\n\n <div class=\"sf\">\n <div class=\"sf-name\">CheckoutHandoff <span>· signed link (create_checkout)</span></div>\n <div class=\"handoff-card\">\n <div class=\"glyph\"><svg viewBox=\"0 0 24 24\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\"/><path d=\"M3 10h18\"/></svg></div>\n <h4>Pay on Acme Bistro checkout</h4>\n <p>Your order is staged and ready. Card entered on <strong>acme.example</strong>, never in chat.</p>\n <div class=\"mini-sum\"><div class=\"row\"><span>4 items</span><span>$40</span></div><div class=\"row total\"><span>Total</span><span>$40+tax</span></div></div>\n <button class=\"cta-primary\">Pay $40 on acme.example ↗</button>\n <div class=\"pay-link\">Signed · expires 15 min · <code>src=chatgpt</code></div>\n </div>\n </div>\n </div>\n </div>\n\n <hr class=\"page-divider\">\n\n <!-- ═══ MCP TOOLS APPENDIX ═══ -->\n <div class=\"section\" id=\"api\">\n <span class=\"section-label\">Technical appendix</span>\n <div class=\"section-title\">MCP Tools & Call Sequence</div>\n <div class=\"section-subtitle\">Tool mapping for each wireframe step. Four tools, served by the Noodle Seed–authored <code>acme_bistro</code> server. Concrete request/response JSON lives in <code>api-contract.md</code>.</div>\n\n <div class=\"api-panel\">\n <div class=\"api-panel-header\">Browse & Build (Steps 1–3)</div>\n <div class=\"api-step\">\n <div class=\"api-step-label\">Step 1 — Show the menu</div>\n <div class=\"api-endpoint\"><span class=\"kind read\">READ</span><span class=\"path\">show_menu</span><span class=\"desc\">— tool + view. Returns the 5-item menu and renders MenuCart.</span></div>\n <div class=\"api-note\"><strong>Design intent:</strong> the menu is small and static, so it ships in one read — no pagination, no follow-up call. The <code>items[]</code> array is the model's only source of dish names and prices.</div>\n </div>\n <div class=\"api-step\">\n <div class=\"api-step-label\">Steps 2–3 — Build & edit the cart</div>\n <div class=\"api-endpoint\"><span class=\"kind write\">WRITE</span><span class=\"path\">add_to_cart</span><span class=\"desc\">— tool + app visibility. Reflects a natural-language addition (item + quantity) into the visible cart.</span></div>\n <div class=\"api-endpoint\"><span class=\"kind write\">WRITE</span><span class=\"path\">remove_from_cart</span><span class=\"desc\">— tool + app visibility. Removes one unit; the widget's − button calls the same tool.</span></div>\n <div class=\"api-note\"><strong>Natural-language parsing:</strong> \"two margheritas and a lemon tart\" becomes <code>add_to_cart{item:\"stone_pizza\",quantity:2}</code> + <code>add_to_cart{item:\"lemon_tart\",quantity:1}</code> — the model fills the fields; no UI round-trip. The running total is summed live in the widget (React), not in a tool.</div>\n </div>\n </div>\n\n <div class=\"api-panel\">\n <div class=\"api-panel-header\">Confirm & Hand off (Step 4 → off-app)</div>\n <div class=\"api-step\">\n <div class=\"api-step-label\">Step 4 — Mint the payment link</div>\n <div class=\"api-endpoint\"><span class=\"kind link\">OPEN-LINK</span><span class=\"path\">create_checkout</span><span class=\"desc\">— model-visible tool. Returns a signed deep link + summary; ChatGPT opens it.</span></div>\n <div class=\"api-note\"><strong>No payment in-chat.</strong> The widget passes a url-safe cart token and the numeric total; <code>create_checkout</code> returns <code>checkoutUrl = https://pay.acme.example/checkout?cart=…&total=…&src=chatgpt</code> (production adds a signed <code>expires_at</code>). The app never sees card data. Acme recomputes pricing/tax and enforces the total past the boundary. No <code>submit_order</code> tool exists by design — fulfilment is Acme's.</div>\n </div>\n </div>\n </div>\n\n <hr class=\"page-divider\">\n\n <!-- ═══ COMPLIANCE AUDIT ═══ -->\n <div class=\"section\" id=\"compliance\">\n <span class=\"section-label\">Compliance</span>\n <div class=\"section-title\">OpenAI Apps SDK Compliance Audit</div>\n <div class=\"section-subtitle\">How Acme Bistro maps to OpenAI's published ChatGPT Apps UX Principles and UI Guidelines. Verified in the build with <code>noodle check --target chatgpt</code>.</div>\n\n <div class=\"rationale\" style=\"max-width:100%\">\n <h4>Pre-publishing checklist</h4>\n <table class=\"audit-table\">\n <tr><th style=\"width:32%\">Requirement</th><th>How Acme Bistro addresses it</th><th style=\"width:70px\">Status</th></tr>\n <tr><td>Conversational value — relies on ChatGPT's strengths</td><td>Natural-language ordering (\"two margheritas and a lemon tart\") parses into <code>add_to_cart</code> calls with item + quantity — no tap-driven menu can do this. Editing by sentence (\"drop a margherita\") works the same way.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr><td>Beyond base ChatGPT — new knowledge/actions</td><td>Live single-restaurant menu, a running cart, and a signed checkout hand-off to Acme's real payment page. None available in base ChatGPT.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr><td>Atomic, model-friendly actions</td><td>Four tools with explicit Zod-typed input/output: <code>show_menu</code> (read), <code>add_to_cart</code>/<code>remove_from_cart</code> (local write), <code>create_checkout</code> (open-link). No ambiguity.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr><td>Helpful UI only — would plain text degrade UX?</td><td>Yes for the menu/cart — price rows and steppers are faster to scan than prose, and the running total needs a layout. <strong>No payment widget is built</strong> — card capture is off-platform, so a widget there would be wrong.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr><td>Meaningful task completion in-chat</td><td>The full order — browse, build, edit, confirm total — completes in ChatGPT. The one intentional hand-off is payment, on Acme's checkout.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr><td>Performance & responsiveness</td><td>One read on entry; cart edits are local to the widget; one link mint at checkout. Static menu keeps <code>show_menu</code> well under target latency.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr><td>Discoverability</td><td>Broad natural triggers: \"show me the Acme Bistro menu\", \"order two margheritas from Acme\", \"what's my Acme total?\", \"check out and pay\".</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr><td>Platform fit</td><td>Rich prompts (order + quantity in one sentence), multi-turn cart building, in-session memory of the cart. No per-user auth needed for the pre-payment surface.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n </table>\n </div>\n\n <div class=\"rationale\" style=\"max-width:100%;margin-top:18px\">\n <h4>UI guidelines compliance</h4>\n <table class=\"audit-table\">\n <tr><th style=\"width:32%\">Guideline</th><th>Implementation</th><th style=\"width:70px\">Status</th></tr>\n <tr><td>Colour — system tokens; brand only on accents/CTA</td><td>Text, borders, and surfaces use host semantic tokens via cascade layers. Acme red <code>#B91C1C</code> appears only on the header mark and the primary <strong>Check out & pay</strong> button.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr><td>Typography — inherit system fonts</td><td>System font stack; no custom Acme typeface inside the widget.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr><td>Inline Card — ≤2 actions, no nested scroll, no deep nav</td><td>MenuCart has one primary action (Check out & pay) plus in-card steppers; five rows fit with no inner scroller and no drill-in.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr><td>Icons — monochromatic, outlined</td><td>Outlined plate mark and card glyph; no filled brand logo rendered in the response body.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr><td>Accessibility — WCAG AA, theme-aware</td><td>Acme red used only as a fill behind light text or as a 1px mark, never as body text on white. Widget adapts to host light/dark via <code>branding.surface</code> / <code>surfaceDark</code>.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr><td>Display mode — correct per intent</td><td>Inline Card only. No Carousel/Fullscreen/PiP — a flat 5-item menu doesn't warrant them.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n </table>\n </div>\n\n <div class=\"rationale\" style=\"max-width:100%;margin-top:18px\">\n <h4>Domain guardrails (Acme-specific trust rows)</h4>\n <table class=\"audit-table\">\n <tr><th style=\"width:32%\">Guardrail</th><th>How Acme Bistro enforces it</th><th style=\"width:70px\">Status</th></tr>\n <tr class=\"audit-guard\"><td>No payment in chat</td><td>No card field, wallet, or stored method anywhere in the app. Card capture happens only on <code>pay.acme.example</code> after the hand-off. The MCP server never enters PCI scope. The \"your card is never entered in chat\" note is in every widget frame.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr class=\"audit-guard\"><td>Allergen / dietary honesty</td><td>The model states only what the menu data holds (name, course, price). Ingredient-level or cross-contact questions are deferred to Acme directly — never \"this is vegetarian/gluten-free\" without a menu flag.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr class=\"audit-guard\"><td>No invented items or prices</td><td>Grounded strictly in the <code>show_menu</code> <code>items[]</code> — only the five dishes, only their listed prices. The total is display-only; Acme recomputes the charge.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr class=\"audit-guard\"><td>Signed, expiring, attributable hand-off</td><td>Checkout link is signed server-side, carries <code>src=chatgpt</code>, and expires (proposed 15 min). <code>handoff.allowedDomains</code> whitelists the redirect domains so the link opens without a safe-link warning.</td><td class=\"audit-pass\">✓ Pass</td></tr>\n <tr class=\"audit-guard\"><td>No unseen fulfilment claims</td><td>The app builds and hands off the order; it makes no pickup-time or order-status promise it can't verify (no post-handoff visibility in v1).</td><td class=\"audit-pass\">✓ Pass</td></tr>\n </table>\n </div>\n </div>\n\n <div class=\"footer\">Acme Bistro (illustrative) · Prepared by Noodle Seed · End-to-end wireframes · matches the runnable <code>acme_bistro</code> server</div>\n\n</div>\n</body>\n</html>\n" },
|
|
23
23
|
{ relPath: "examples/acme-bistro/noodle.json", content: "{\n \"entrypoint\": \"src/server.ts\",\n \"name\": \"acme-bistro\",\n \"template\": \"widget\"\n}\n" },
|
|
24
24
|
{ relPath: "examples/acme-bistro/package.json", content: "{\n \"name\": \"acme-bistro\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"test\": \"vitest run\",\n \"validate\": \"noodle validate\",\n \"dev\": \"noodle dev\",\n \"deploy\": \"noodle deploy\"\n },\n \"devDependencies\": {\n \"@vitejs/plugin-react\": \"latest\",\n \"@noodleseed/one\": \"latest\",\n \"react\": \"latest\",\n \"react-dom\": \"latest\",\n \"vite\": \"latest\",\n \"vitest\": \"latest\"\n }\n}\n" },
|
|
25
25
|
{ relPath: "examples/acme-bistro/src/helpers.ts", content: "import type { ServerDefinition } from '@noodleseed/one';\nimport { generateHelpers } from '@noodleseed/one/react';\n\nexport type AppType = ServerDefinition;\n\nexport const { useBranding, useCallTool, useLayout, useOpenExternal, useToolInfo, useViewState } =\n generateHelpers<AppType>();\n" },
|
|
26
|
-
{ relPath: "examples/acme-bistro/src/server.ts", content: "import { annotations, server, tool, z } from '@noodleseed/one';\n\n// Acme Bistro is a fictional restaurant. This app is deliberately END-TO-END: the customer browses the\n// menu and builds the order in chat, and the order completes in chat — only *payment* hands off, via a\n// checkout deep link (the card never touches the app). It is the flagship for the end-to-end pattern.\n//\n// Authoring notes:\n// - A tool `fulfil` is *recorded*, not run as live JS. Inline inputs directly as `${input.x}` into\n// output strings; do not transform them (no arithmetic/encode/filter) or substitution breaks. The\n// cart total is summed in the widget (live React), not in a `fulfil`. The menu below is static data.\n// - Tool inputs stay business-facing. `__noodleIntent` is reserved for Noodle's optional serve-time\n// analytics adapter and is removed before `fulfil`, so applications never declare or handle it.\n\nconst menu = [\n { id: 'stone_pizza', name: 'Stone-baked Margherita', price: 14, kind: 'Mains' },\n { id: 'roast_bowl', name: 'Harvest Roast Bowl', price: 13, kind: 'Mains' },\n { id: 'house_salad', name: 'House Garden Salad', price: 11, kind: 'Starters' },\n { id: 'lemon_tart', name: 'Lemon Tart', price: 8, kind: 'Desserts' },\n { id: 'sparkling', name: 'Sparkling Water', price: 4, kind: 'Drinks' },\n] as const;\n\nconst itemId = z.enum(['stone_pizza', 'roast_bowl', 'house_salad', 'lemon_tart', 'sparkling']);\n\nconst menuItemOutput = z.object({\n id: z.string(),\n name: z.string(),\n price: z.number(),\n kind: z.string(),\n});\n\n// Tool annotations for host planners: the menu read is read-only; cart edits are local writes; checkout\n// opens an external (payment) link.\nconst readOnly = annotations.readOnly();\nconst localWrite = annotations.localAction({ destructive: false, confirm: false });\nconst openLink = annotations.openAction();\n\nexport default server(\n 'acme_bistro',\n {\n title: 'Acme Bistro',\n version: '1.0.0',\n branding: {\n name: 'Acme Bistro',\n accent: '#B91C1C',\n surface: '#FEF3F2',\n surfaceDark: '#1A1211',\n radius: 'lg',\n density: 'comfortable',\n },\n // Payment is the only off-app step; the compiler derives ChatGPT redirect_domains from this so the\n // signed checkout link opens without a safe-link warning. The card never reaches this app.\n handoff: {\n allowedDomains: ['https://pay.acme.example', 'https://acme.example'],\n },\n },\n [\n tool('show_menu', {\n title: 'Show the menu',\n description: 'Show the Acme Bistro menu and render the ordering widget.',\n annotations: readOnly,\n input: z.object({ customer: z.string().default('Guest') }),\n output: z.object({\n status: z.string(),\n customer: z.string(),\n // Bounded list: the menu is a fixed catalog, so the ceiling is declared on the shape rather\n // than taken as a pagination input. `noodle check` reports `tool_design_output_bounds`.\n items: z.array(menuItemOutput).max(50),\n }),\n fulfil: ({ input }) => ({\n status: `Acme Bistro menu is ready for ${input.customer}. Build the order here; pay at checkout.`,\n customer: input.customer,\n items: menu,\n }),\n viewTitle: 'Order at Acme Bistro',\n viewDescription: 'Browse the menu, build an order in chat, and hand off to pay.',\n invoking: 'Loading the menu…',\n invoked: 'Menu ready',\n domain: 'https://order.acme.example',\n view: {\n component: 'menu-cart',\n entry: './views/menu-cart.tsx',\n },\n csp: {\n connectDomains: ['https://acme.example'],\n resourceDomains: ['https://acme.example'],\n frameDomains: ['https://acme.example'],\n },\n }),\n // Widget-only cart edits — the model fills the item from natural language (\"add two margheritas\").\n tool('add_to_cart', {\n visibility: ['app'],\n description: 'Add a menu item to the Acme Bistro order from the widget.',\n annotations: localWrite,\n input: z.object({\n customer: z.string().default('Guest'),\n item: itemId.default('stone_pizza'),\n quantity: z.number().int().min(1).default(1),\n notes: z.string().default(''),\n }),\n output: z.object({\n status: z.string(),\n item: z.string(),\n quantity: z.number(),\n notes: z.string(),\n }),\n fulfil: ({ input }) => ({\n status: `Added ${input.quantity} × ${input.item} for ${input.customer}.`,\n item: input.item,\n quantity: input.quantity,\n notes: input.notes,\n }),\n }),\n tool('remove_from_cart', {\n visibility: ['app'],\n description: 'Remove a menu item from the Acme Bistro order.',\n annotations: localWrite,\n input: z.object({\n customer: z.string().default('Guest'),\n item: itemId.default('stone_pizza'),\n }),\n output: z.object({\n status: z.string(),\n item: z.string(),\n }),\n fulfil: ({ input }) => ({\n status: `Removed ${input.item} for ${input.customer}.`,\n item: input.item,\n }),\n }),\n // The only handoff: payment. The widget computes the total (live React) and passes a url-safe cart\n // token + total; the card is entered on Acme's PCI-scoped checkout, never in chat.\n tool('create_checkout', {\n title: 'Create checkout',\n description:\n 'Create the Acme Bistro payment checkout link for the current order. Pass a url-safe cart token ' +\n 'and the numeric total computed in the widget. Payment happens off-app; the card never reaches this app.',\n annotations: openLink,\n input: z.object({\n customer: z.string().default('Guest'),\n cartToken: z.string().default('cart'),\n total: z.number().min(0).default(0),\n }),\n output: z.object({\n status: z.string(),\n summary: z.string(),\n checkoutUrl: z.string(),\n }),\n // Do not place a literal `$` immediately before a token (`$${input.total}`) — it collides with the\n // `${…}` substitution syntax and leaves the token unresolved. Keep the amount token standalone.\n fulfil: ({ input }) => ({\n status: `Ready to pay for ${input.customer}'s order.`,\n summary: `${input.customer}'s Acme Bistro order · ${input.total} USD`,\n checkoutUrl: `https://pay.acme.example/checkout?cart=${input.cartToken}&total=${input.total}&src=chatgpt`,\n }),\n }),\n ],\n);\n" },
|
|
26
|
+
{ relPath: "examples/acme-bistro/src/server.ts", content: "import { annotations, managedCollection, server, tool, z } from '@noodleseed/one';\n\n// Acme Bistro is a fictional restaurant. This app is deliberately END-TO-END: the customer browses the\n// menu and builds the order in chat, and the order completes in chat — only *payment* hands off, via a\n// checkout deep link (the card never touches the app). It is the flagship for the end-to-end pattern.\n//\n// Authoring notes:\n// - A tool `fulfil` is *recorded*, not run as live JS. Inline inputs directly as `${input.x}` into\n// output strings; do not transform them (no arithmetic/encode/filter) or substitution breaks. The\n// cart total is summed in the widget (live React), not in a `fulfil`. The menu below is static data.\n// - Tool inputs stay business-facing. `__noodleIntent` is reserved for Noodle's optional serve-time\n// analytics adapter and is removed before `fulfil`, so applications never declare or handle it.\n\nconst menu = [\n { id: 'stone_pizza', name: 'Stone-baked Margherita', price: 14, kind: 'Mains' },\n { id: 'roast_bowl', name: 'Harvest Roast Bowl', price: 13, kind: 'Mains' },\n { id: 'house_salad', name: 'House Garden Salad', price: 11, kind: 'Starters' },\n { id: 'lemon_tart', name: 'Lemon Tart', price: 8, kind: 'Desserts' },\n { id: 'sparkling', name: 'Sparkling Water', price: 4, kind: 'Drinks' },\n] as const;\n\nconst itemId = z.enum(['stone_pizza', 'roast_bowl', 'house_salad', 'lemon_tart', 'sparkling']);\n\nconst menuItemOutput = z.object({\n id: z.string(),\n name: z.string(),\n price: z.number(),\n kind: z.string(),\n});\n\nconst guestRequests = managedCollection('guest_requests', {\n title: 'Guest requests',\n description: 'Guest service requests that restaurant staff can review and resolve.',\n schemaVersion: 1,\n record: z.object({\n locationReference: z.string().min(1).max(120),\n requestType: z.enum(['reservation_help', 'accessibility', 'dietary_question', 'other']),\n summary: z.string().min(1).max(1000),\n }),\n});\n\n// Tool annotations for host planners: the menu read is read-only; cart edits are local writes; checkout\n// opens an external (payment) link.\nconst readOnly = annotations.readOnly();\nconst localWrite = annotations.localAction({ destructive: false, confirm: false });\nconst openLink = annotations.openAction();\n\nexport default server(\n 'acme_bistro',\n {\n title: 'Acme Bistro',\n version: '1.0.0',\n branding: {\n name: 'Acme Bistro',\n accent: '#B91C1C',\n surface: '#FEF3F2',\n surfaceDark: '#1A1211',\n radius: 'lg',\n density: 'comfortable',\n },\n // Payment is the only off-app step; the compiler derives ChatGPT redirect_domains from this so the\n // signed checkout link opens without a safe-link warning. The card never reaches this app.\n handoff: {\n allowedDomains: ['https://pay.acme.example', 'https://acme.example'],\n },\n // Reusable business-record intent. Storage, lifecycle, access, and public intake bind separately.\n collections: [guestRequests],\n },\n [\n tool('show_menu', {\n title: 'Show the menu',\n description: 'Show the Acme Bistro menu and render the ordering widget.',\n annotations: readOnly,\n input: z.object({ customer: z.string().default('Guest') }),\n output: z.object({\n status: z.string(),\n customer: z.string(),\n // Bounded list: the menu is a fixed catalog, so the ceiling is declared on the shape rather\n // than taken as a pagination input. `noodle check` reports `tool_design_output_bounds`.\n items: z.array(menuItemOutput).max(50),\n }),\n fulfil: ({ input }) => ({\n status: `Acme Bistro menu is ready for ${input.customer}. Build the order here; pay at checkout.`,\n customer: input.customer,\n items: menu,\n }),\n viewTitle: 'Order at Acme Bistro',\n viewDescription: 'Browse the menu, build an order in chat, and hand off to pay.',\n invoking: 'Loading the menu…',\n invoked: 'Menu ready',\n domain: 'https://order.acme.example',\n view: {\n component: 'menu-cart',\n entry: './views/menu-cart.tsx',\n },\n csp: {\n connectDomains: ['https://acme.example'],\n resourceDomains: ['https://acme.example'],\n frameDomains: ['https://acme.example'],\n },\n }),\n // Widget-only cart edits — the model fills the item from natural language (\"add two margheritas\").\n tool('add_to_cart', {\n visibility: ['app'],\n description: 'Add a menu item to the Acme Bistro order from the widget.',\n annotations: localWrite,\n input: z.object({\n customer: z.string().default('Guest'),\n item: itemId.default('stone_pizza'),\n quantity: z.number().int().min(1).default(1),\n notes: z.string().default(''),\n }),\n output: z.object({\n status: z.string(),\n item: z.string(),\n quantity: z.number(),\n notes: z.string(),\n }),\n fulfil: ({ input }) => ({\n status: `Added ${input.quantity} × ${input.item} for ${input.customer}.`,\n item: input.item,\n quantity: input.quantity,\n notes: input.notes,\n }),\n }),\n tool('remove_from_cart', {\n visibility: ['app'],\n description: 'Remove a menu item from the Acme Bistro order.',\n annotations: localWrite,\n input: z.object({\n customer: z.string().default('Guest'),\n item: itemId.default('stone_pizza'),\n }),\n output: z.object({\n status: z.string(),\n item: z.string(),\n }),\n fulfil: ({ input }) => ({\n status: `Removed ${input.item} for ${input.customer}.`,\n item: input.item,\n }),\n }),\n // The only handoff: payment. The widget computes the total (live React) and passes a url-safe cart\n // token + total; the card is entered on Acme's PCI-scoped checkout, never in chat.\n tool('create_checkout', {\n title: 'Create checkout',\n description:\n 'Create the Acme Bistro payment checkout link for the current order. Pass a url-safe cart token ' +\n 'and the numeric total computed in the widget. Payment happens off-app; the card never reaches this app.',\n annotations: openLink,\n input: z.object({\n customer: z.string().default('Guest'),\n cartToken: z.string().default('cart'),\n total: z.number().min(0).default(0),\n }),\n output: z.object({\n status: z.string(),\n summary: z.string(),\n checkoutUrl: z.string(),\n }),\n // Do not place a literal `$` immediately before a token (`$${input.total}`) — it collides with the\n // `${…}` substitution syntax and leaves the token unresolved. Keep the amount token standalone.\n fulfil: ({ input }) => ({\n status: `Ready to pay for ${input.customer}'s order.`,\n summary: `${input.customer}'s Acme Bistro order · ${input.total} USD`,\n checkoutUrl: `https://pay.acme.example/checkout?cart=${input.cartToken}&total=${input.total}&src=chatgpt`,\n }),\n }),\n ],\n);\n" },
|
|
27
27
|
{ relPath: "examples/acme-bistro/src/views/menu-cart.tsx", content: "import { type CSSProperties, useMemo, useState } from 'react';\nimport {\n useBranding,\n useCallTool,\n useLayout,\n useOpenExternal,\n useToolInfo,\n useViewState,\n} from '../helpers.js';\nimport './widget-style.css';\n\ntype MenuItem = {\n readonly id: string;\n readonly name: string;\n readonly price: number;\n readonly kind: string;\n};\n\nfunction asMenu(value: unknown) {\n return value as\n | { readonly status?: string; readonly customer?: string; readonly items?: readonly MenuItem[] }\n | undefined;\n}\n\nexport default function MenuCart() {\n const { displayMode, theme } = useLayout();\n // Widget CSS is ours, so nothing applies `server.branding` for us. Map the one value this widget\n // cares about onto its own custom property; widget-style.css keeps a default for local dev.\n const branding = useBranding();\n const brandStyle = branding.accent\n ? ({ '--nw-accent': branding.accent } as CSSProperties)\n : undefined;\n const openExternal = useOpenExternal();\n const menuResult = asMenu(useToolInfo('show_menu').structuredContent);\n const addToCart = useCallTool('add_to_cart');\n const removeFromCart = useCallTool('remove_from_cart');\n const checkout = useCallTool('create_checkout');\n\n const items = menuResult?.items ?? [];\n const [customer] = useViewState('customer', menuResult?.customer ?? 'Guest');\n // Cart is session-local (id → quantity); the total is summed here in live React, not in a recorded fulfil.\n const [cart, setCart] = useState<Record<string, number>>({});\n const [status, setStatus] = useState(\n menuResult?.status ?? 'Build your order, then check out to pay.',\n );\n\n const total = useMemo(\n () => items.reduce((sum, item) => sum + item.price * (cart[item.id] ?? 0), 0),\n [items, cart],\n );\n const lineCount = Object.values(cart).reduce((n, q) => n + q, 0);\n\n async function add(item: MenuItem) {\n setCart((current) => ({ ...current, [item.id]: (current[item.id] ?? 0) + 1 }));\n const result = await addToCart.callTool({ customer, item: item.id, quantity: 1 });\n const structured = result.structuredContent as { readonly status?: string } | undefined;\n setStatus(structured?.status ?? `Added ${item.name}.`);\n }\n\n async function remove(item: MenuItem) {\n setCart((current) => {\n const next = { ...current };\n const q = (next[item.id] ?? 0) - 1;\n if (q <= 0) delete next[item.id];\n else next[item.id] = q;\n return next;\n });\n await removeFromCart.callTool({ customer, item: item.id });\n }\n\n async function payNow() {\n if (lineCount === 0) return;\n // The only handoff: payment. A url-safe cart token + the numeric total go to Acme's PCI checkout.\n const cartToken = items\n .filter((item) => cart[item.id])\n .map((item) => `${item.id}x${cart[item.id]}`)\n .join('-');\n const result = await checkout.callTool({ customer, cartToken, total });\n const structured = result.structuredContent as { readonly checkoutUrl?: string } | undefined;\n if (structured?.checkoutUrl) openExternal(structured.checkoutUrl);\n }\n\n return (\n <main\n className={`nw-shell${theme === 'dark' ? ' dark' : ''}`}\n style={brandStyle}\n data-llm={`Acme Bistro order for ${customer}: ${lineCount} item(s), total $${total}`}\n >\n <section className=\"nw-card\">\n <header className=\"nw-header\">\n <span className=\"nw-icon\" aria-hidden=\"true\">\n <PlateIcon />\n </span>\n <div className=\"nw-title-block\">\n <h1 className=\"nw-title\">Acme Bistro</h1>\n <p className=\"nw-subtitle\">{status}</p>\n </div>\n <span className=\"nw-chip\">\n {displayMode === 'fullscreen' ? 'Fullscreen' : `${lineCount} in cart`}\n </span>\n </header>\n\n <ul className=\"nw-menu\">\n {items.map((item) => (\n <li className=\"nw-row\" key={item.id}>\n <span className=\"nw-row-main\">\n <span className=\"nw-name\">{item.name}</span>\n <span className=\"nw-kind\">{item.kind}</span>\n </span>\n <span className=\"nw-price\">${item.price}</span>\n <span className=\"nw-qty\">\n <button\n aria-label={`Remove one ${item.name}`}\n className=\"nw-step\"\n type=\"button\"\n disabled={!cart[item.id]}\n onClick={() => remove(item)}\n >\n −\n </button>\n <span className=\"nw-count\">{cart[item.id] ?? 0}</span>\n <button\n aria-label={`Add one ${item.name}`}\n className=\"nw-step\"\n type=\"button\"\n onClick={() => add(item)}\n >\n +\n </button>\n </span>\n </li>\n ))}\n </ul>\n\n <footer className=\"nw-footer\">\n <span className=\"nw-total\">\n Total <strong>${total}</strong>\n </span>\n <button\n className=\"nw-button nw-button-primary\"\n type=\"button\"\n disabled={lineCount === 0 || checkout.isPending}\n onClick={payNow}\n >\n <CardIcon />\n {checkout.isPending ? 'Opening checkout…' : 'Check out & pay'}\n </button>\n </footer>\n <p className=\"nw-note\">\n Payment happens on acme.example — your card is never entered in chat.\n </p>\n </section>\n </main>\n );\n}\n\nfunction PlateIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n </svg>\n );\n}\n\nfunction CardIcon() {\n return (\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M3 10h18\" />\n </svg>\n );\n}\n" },
|
|
28
28
|
{ relPath: "examples/acme-bistro/src/views/widget-style.css", content: ":root {\n color-scheme: light dark;\n font-family:\n Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n --nw-bg: #ffffff;\n --nw-surface: #fdf4f3;\n --nw-text: #1f1413;\n --nw-muted: #7a5f5c;\n --nw-border: #efd9d6;\n /* Local-dev default. At runtime menu-cart.tsx overrides this from server.branding.accent. */\n --nw-accent: #b91c1c;\n --nw-accent-strong: #991b1b;\n --nw-accent-soft: #fdeae8;\n --nw-radius: 10px;\n --nw-shadow: 0 18px 50px rgb(60 20 20 / 12%);\n}\n\n.dark,\n[data-theme=\"dark\"] {\n --nw-bg: #1a1211;\n --nw-surface: #241816;\n --nw-text: #f8ecea;\n --nw-muted: #c3a29e;\n --nw-border: #43302d;\n --nw-accent: #f87171;\n --nw-accent-strong: #ef4444;\n --nw-accent-soft: #3a1f1d;\n --nw-shadow: 0 18px 50px rgb(0 0 0 / 32%);\n}\n\n* {\n box-sizing: border-box;\n}\n\nbody {\n margin: 0;\n background: var(--nw-bg);\n color: var(--nw-text);\n}\n\nbutton {\n font: inherit;\n}\n\n.nw-shell {\n min-height: 100vh;\n padding: 14px;\n background: var(--nw-bg);\n color: var(--nw-text);\n}\n\n.nw-card {\n max-width: 560px;\n margin: 0 auto;\n background: var(--nw-surface);\n border: 1px solid var(--nw-border);\n border-radius: var(--nw-radius);\n box-shadow: var(--nw-shadow);\n overflow: hidden;\n}\n\n.nw-header {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 16px;\n border-bottom: 1px solid var(--nw-border);\n}\n\n.nw-icon svg {\n width: 24px;\n height: 24px;\n fill: none;\n stroke: var(--nw-accent);\n stroke-width: 1.7;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.nw-title-block {\n flex: 1;\n min-width: 0;\n}\n\n.nw-title {\n margin: 0;\n font-size: 17px;\n font-weight: 700;\n}\n\n.nw-subtitle {\n margin: 2px 0 0;\n font-size: 13px;\n color: var(--nw-muted);\n}\n\n.nw-chip {\n padding: 4px 10px;\n border-radius: 999px;\n background: var(--nw-accent-soft);\n color: var(--nw-accent-strong);\n font-size: 12px;\n font-weight: 600;\n}\n\n.nw-menu {\n list-style: none;\n margin: 0;\n padding: 8px 16px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.nw-row {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 10px 0;\n border-bottom: 1px dashed var(--nw-border);\n}\n\n.nw-row-main {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n}\n\n.nw-name {\n font-weight: 600;\n}\n\n.nw-kind {\n font-size: 12px;\n color: var(--nw-muted);\n}\n\n.nw-price {\n color: var(--nw-accent-strong);\n font-weight: 600;\n font-size: 13px;\n}\n\n.nw-qty {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n}\n\n.nw-step {\n width: 26px;\n height: 26px;\n border: 1px solid var(--nw-border);\n border-radius: 8px;\n background: var(--nw-bg);\n color: var(--nw-text);\n cursor: pointer;\n}\n\n.nw-step:disabled {\n opacity: 0.4;\n cursor: default;\n}\n\n.nw-count {\n min-width: 16px;\n text-align: center;\n font-variant-numeric: tabular-nums;\n}\n\n.nw-footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 12px 16px 4px;\n}\n\n.nw-total {\n font-size: 14px;\n color: var(--nw-muted);\n}\n\n.nw-total strong {\n color: var(--nw-text);\n font-size: 16px;\n}\n\n.nw-button {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 9px 14px;\n border: 1px solid var(--nw-border);\n border-radius: 10px;\n background: var(--nw-bg);\n color: var(--nw-text);\n cursor: pointer;\n}\n\n.nw-button svg {\n width: 16px;\n height: 16px;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.7;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.nw-button-primary {\n background: var(--nw-accent);\n border-color: var(--nw-accent);\n color: #ffffff;\n font-weight: 600;\n}\n\n.nw-button-primary:disabled {\n opacity: 0.6;\n cursor: default;\n}\n\n.nw-note {\n margin: 0;\n padding: 8px 16px 16px;\n font-size: 12px;\n color: var(--nw-muted);\n}\n" },
|
|
29
|
-
{ relPath: "examples/acme-bistro/test/server.test.ts", content: "import { describe, expect, it } from 'vitest';\nimport app from '../src/server.js';\n\ndescribe('acme-bistro example', () => {\n it('exports a Noodle server definition', () => {\n expect(typeof app.toManifest).toBe('function');\n });\n\n it('declares the payment-only handoff domain', async () => {\n // End-to-end: the order completes in chat; only payment hands off to Acme's checkout.\n const text = JSON.stringify(await app.toManifest());\n expect(text).toContain('https://pay.acme.example');\n });\n\n it('exposes the menu widget, cart helpers, and checkout tool', async () => {\n const text = JSON.stringify(await app.toManifest());\n expect(text).toContain('show_menu');\n expect(text).toContain('add_to_cart');\n expect(text).toContain('create_checkout');\n });\n});\n" },
|
|
29
|
+
{ relPath: "examples/acme-bistro/test/server.test.ts", content: "import { describe, expect, it } from 'vitest';\nimport app from '../src/server.js';\n\ndescribe('acme-bistro example', () => {\n it('exports a Noodle server definition', () => {\n expect(typeof app.toManifest).toBe('function');\n });\n\n it('declares the payment-only handoff domain', async () => {\n // End-to-end: the order completes in chat; only payment hands off to Acme's checkout.\n const text = JSON.stringify(await app.toManifest());\n expect(text).toContain('https://pay.acme.example');\n });\n\n it('exposes the menu widget, cart helpers, and checkout tool', async () => {\n const text = JSON.stringify(await app.toManifest());\n expect(text).toContain('show_menu');\n expect(text).toContain('add_to_cart');\n expect(text).toContain('create_checkout');\n });\n\n it('declares reusable guest-request record intent without generating a submit tool', async () => {\n const manifest = await app.toManifest();\n expect(manifest.server.collections).toEqual([\n expect.objectContaining({ name: 'guest_requests', schemaVersion: 1 }),\n ]);\n expect(manifest.tools).not.toContainEqual(\n expect.objectContaining({ name: 'submit_guest_requests' }),\n );\n });\n});\n" },
|
|
30
30
|
{ relPath: "examples/acme-bistro/vitest.config.ts", content: "import { defineConfig } from 'vitest/config';\n\n// Local config so `npm test` (vitest run) discovers this example's own tests instead of inheriting a\n// parent monorepo config's include globs.\nexport default defineConfig({\n test: { include: ['test/**/*.test.ts'] },\n});\n" },
|
|
31
31
|
{ relPath: "examples/acme-discovery/README.md", content: "# Acme Getaways — top-of-funnel discovery → handoff\n\nA Noodle MCP App for **Acme Getaways**, a fictional travel brand. It is the flagship for the\n**top-of-funnel discovery → handoff** pattern: discovery and configuration happen inside ChatGPT; the\nbooking/transaction happens off-app on Acme's own site, reached through a signed, attributable handoff\ndeep link. It pairs a `tool` discovery carousel with a model-visible `create_handoff` tool and\nserver-level `handoff.allowedDomains`.\n\nCapability slots: top-of-funnel funnel discipline, discovery carousel widget, `create_handoff` deep-link\nhandoff with attribution, `handoff.allowedDomains`, the **public website assistant surface** with its\n**WebMCP browser-agent bridge** on a real demo page (`site/index.html`), and a worked\n**design-first** artifact (the UX spec + wireframe below). It shows the \"design the experience, then build\nit\" flow the `noodle-seed` skill's `references/experience-design.md` teaches.\n\n## The same tools on Acme's own website\n\nThe funnel does not only start in ChatGPT. The `assistant` block projects these same tools onto\nAcme's marketing site for a visitor with **no account and no session backend** — as a **mixed**\nsurface, so the visitor can also sign in mid-conversation:\n\n```ts\naccess: [\n publicWebsite({\n origins: ['https://getaways.acme.example'],\n capabilities: [destinations, discoverGetaways, createHandoff, shortlistGetaway, captureLead, myTrips],\n signIn: true, // my_trips reads ${user}; reaching it raises the sign-in card\n instructions:\n 'Be a friendly, consultative travel guide, never pushy. Help visitors narrow a getaway before suggesting the next useful step.',\n }),\n authenticatedWebsite({\n origins: ['https://account.acme.example'],\n capabilities: [destinations, discoverGetaways, createHandoff, myTrips],\n instructions: 'The traveler is signed in. Help them plan from their saved trips.',\n }),\n],\n```\n\nThere is no second tool set and no second app — one `server.ts`, projected onto its front doors.\nThe flagship selects `model: noodleManaged()`, so a billing-attributed hosted deployment needs no customer\nmodel endpoint, name, or key and its artifact remains provider-neutral. The sponsored beta is available by\ndefault with pooled billing-account and platform-wide daily limits; `openAICompatible(...)` remains the BYO\nalternative.\nThe surface `instructions` add only the website-specific voice and goal; shared product truth stays in\n`server.instructions`. This public guidance is injected into that surface's assistant turns, never MCP\n`initialize` or another assistant surface.\n`capabilities` is the entire externally reachable surface per front door, so it stays short enough to\nreview at a glance and closed by default: a tool added to this server later is unreachable from the\nwebsite until someone lists it.\n\n## Sign in mid-conversation, land in the account\n\n`signIn: true` makes the marketing surface **mixed**: `my_trips` stays visible so the assistant can\noffer it, and an anonymous visitor who reaches for it sees a branded card — *Sign in* plus, because\n`labels.signUpAction` is authored, *Create free account*. Both raise `assistant-sign-in-requested`\nwith a single-use `signInTicket`; the detail's `intent` tells the page whether to route its login or\nits registration. Acme's page signs the visitor in exactly as it already does, its backend spends the\nticket with `createAssistantSession({ ..., signInTicket })`, and the **same conversation continues**\non whichever origin the backend designates:\n\n- landing back on `getaways.acme.example` keeps the mixed surface's projection with identity attached;\n- landing on `account.acme.example` rebinds the conversation to the authenticated surface — its\n capabilities and its voice — and the widget repaints the visible transcript and auto-answers the\n intercepted `my_trips` ask under the new identity.\n\nThe ticket spend after account creation is identical to the one after sign-in; the service never\noperates a login of its own.\n\n## Browser agents on Acme's page\n\n`site/index.html` is the marketing page itself: static markup, four listings, and the one line a\ncustomer pastes.\n\n```html\n<script src=\"https://cloud.noodleseed.dev/v1/assistant/embed.js\" data-embed-id=\"pub_…\"></script>\n```\n\nBecause the marketing surface sets `webmcp: { enabled: true }`, that same line does a second job in a\nbrowser that supports WebMCP: the embed registers the session's projected tools with\n`document.modelContext`, so a browser agent — Gemini-in-Chrome, Claude-in-Chrome — can call\n`discover_getaways` or `create_handoff` without a human typing in the panel.\n\nWhat it does **not** do is widen anything. A bridged call carries exactly the embed session's\nauthority: the surface's six-capability allowlist, the same policy and budgets, the same audit trail,\nand the same confirmation card on `capture_lead` — the visitor still approves the lead in the panel,\nbecause a browser agent's consent is not the visitor's. The switch governs *discovery*, not\npermission: it decides whether an agent learns the tools are there. The signed-in account surface\nbelow leaves it off, which is the point of setting it per surface.\n\nBrowsers without `document.modelContext` are unaffected; the page and the panel behave exactly as\nthey did before.\n\nTo run it:\n\n```sh\nnoodle dev # the server, in one terminal\nnpx serve site # the page, in another (any static server works)\n```\n\n`noodle dev` serves the MCP endpoint, not HTML, so the page needs its own server. For a real\nend-to-end run, `noodle deploy` this example, paste the minted `pub_…` id into `site/index.html`, and\nadd the origin you serve the page from to the `publicWebsite` `origins` list — the session exchange\nrefuses any origin that is not listed. WebMCP itself ships behind an origin trial in Chrome 149+, so\na browser without the trial enabled shows the assistant panel and no bridge.\n\n## The consultative sales gateway\n\nWhen a visitor's plans firm up but they would rather not sign up, the assistant may — with explicit\nconfirmation — take their details and deliver them to Acme's own sink. The recipe is a composition of\nexisting primitives, not a platform feature:\n\n- `capture_lead` is an ordinary tool with `annotations.action({ confirm: true })`: the confirmation\n card, showing every field, is the visitor's consent moment.\n- Delivery is a declarative HTTP connector whose endpoint is `variable('LEAD_SINK_URL')` and whose\n credential is `secret('LEAD_SINK_TOKEN')` — the operator supplies values with\n `noodle variables set` / `noodle secrets set`; the example stays credential-free and one authored\n class serves any business.\n- The request mapping sets `source: 'website-assistant'` itself, so Acme's sink can trust the\n attribution; the model never supplies it.\n- The lead rests only in Acme's own system. The platform stores no lead, and a vendor sink is just\n different data: Resend/Postmark are `auth: { kind: 'apiKey', … }`, a HubSpot private app is\n `auth: { kind: 'bearer', … }` — never a named vendor package.\n\n## Design spec (write this before the code)\n\n- **Funnel boundary** — Discover and shortlist a getaway in ChatGPT. Booking, payment, and the account\n live on `acme.example`, reached only after the handoff. No payment or per-user auth in chat.\n- **Personas** — the undecided browser (\"somewhere warm in June?\"), the near-decided planner (has a vibe\n and month, wants options and a fast handoff).\n- **Top-3 prioritized user flows**\n 1. **Discover** — \"warm beach trip in June for 2\" → `discover_getaways` renders the carousel.\n 2. **Shortlist** — pick a destination in the widget → `shortlist_getaway` (widget-only) records it.\n 3. **Handoff** — \"Continue on Acme\" → `create_handoff` emits the deep link → opens off-app.\n- **Tools** — `discover_getaways` (model-visible, renders the widget), `create_handoff` (model-visible,\n emits the deep link), `shortlist_getaway` (widget-only helper, hidden from the model).\n- **Widgets + display modes** — `DiscoveryCarousel` as an inline card that expands to fullscreen for\n browsing. No picture-in-picture (nothing is live/ongoing).\n- **Grounding sources** — the destination catalog in `src/server.ts` is Acme's own data; the widget never\n invents a place, price, or best-month.\n- **Handoff domains** — `https://book.acme.example`, `https://acme.example` (the server\n `handoff.allowedDomains`; the deep link carries `dest`, `month`, `pax`, and `src=chatgpt` for\n attribution).\n\n## Wireframe (one screen, then the off-app destination)\n\nThe carousel screen is in-app (solid frame); the booking screen is off-app (dashed frame) and reached\nonly after the handoff — it is Acme's own page, never wireframed as if it were in chat.\n\n```html\n<div class=\"phone\"> <!-- in-app: solid frame -->\n <div class=\"chatgpt-header\">ChatGPT · Acme Getaways</div>\n <div class=\"msg user\">somewhere warm in June, 2 of us</div>\n <div class=\"tool-call\">discover_getaways { vibe: \"beach\", month: \"June\", travelers: 2 }</div>\n <div class=\"wcard\">\n <div class=\"wcard-head\">DiscoveryCarousel</div> <!-- component name = code + spec -->\n <div class=\"wcard-body\">\n <div class=\"dest\">Coral Bay · from $890 · best May–Sep [Shortlist]</div>\n <div class=\"dest\">Harbor City · from $980 · best Sep–Nov [Shortlist]</div>\n <a class=\"cta\">Continue on Acme · Coral Bay</a> <!-- one primary action -->\n </div>\n </div>\n</div>\n<div class=\"phone offapp\"> <!-- off-app: dashed frame -->\n <div class=\"browser-header\">book.acme.example/plan?dest=coral_bay&month=June&pax=2&src=chatgpt</div>\n <div class=\"offapp-body\">Acme booking — payment & account live here.</div>\n</div>\n```\n\n## Local author loop\n\n```sh\nnoodle validate\nnoodle test\nnoodle dev\n```\n\nIn another terminal:\n\n```sh\nnoodle tools list\nnoodle tools call discover_getaways --args '{\"vibe\":\"beach\",\"month\":\"June\",\"travelers\":2}'\nnoodle tools call create_handoff --args '{\"destination\":\"coral_bay\",\"destinationName\":\"Coral Bay\",\"month\":\"June\",\"travelers\":2}'\nnoodle check --target chatgpt\n```\n\n## Deploy\n\n```sh\nnoodle link --org demo --app acme-discovery\nnoodle deploy --access owner-only\nnoodle open\n```\n\nThis example has no connector or model secrets and does not include tokens, caller-key mechanisms, or\n`.env.noodle` values. Hosted `noodleManaged()` inference is available by default to billing-attributed\ndeployments and remains subject to sponsored daily limits; local validation and tool calls do not use the\nhosted model. All destinations, prices, and URLs are fictional.\n" },
|
|
32
32
|
{ relPath: "examples/acme-discovery/design/UX-Document.md", content: "# Acme Getaways ChatGPT App — User Flow & Experience Document\n\n**Prepared by:** Noodle Seed\n**Scope:** Top-of-funnel destination discovery & trip-shaping inside ChatGPT → signed, attributable handoff to finish booking on Acme's own site\n**Status:** Design specification (v1)\n**Funnel boundary:** Everything up to \"this is the getaway I want and roughly when I'm going.\" Discovery, shortlisting, and shaping the trip (vibe · month · travelers) happen inside ChatGPT; **booking, dates, and payment happen off-app at `book.acme.example`** via a signed deep link that carries the trip. No per-user OAuth in this app.\n\n> The funnel-boundary line above is the contract. Every scope debate resolves against it: **shape the trip in chat, transact on Acme.**\n\n---\n\n## 0. The One-Paragraph Thesis\n\nA traveler deciding *where* to go doesn't start on a booking site — they start with a fuzzy feeling: \"somewhere warm and walkable in June, just the two of us, not too expensive.\" That deliberation increasingly happens in ChatGPT, where they can think out loud and be talked through options. But base ChatGPT can only guess at places and prices; it doesn't know Acme's actual catalog, what a trip *starts from*, or which months are right. The Acme Getaways app brings Acme's **own curated destinations** — Coral Bay, Monte Alto, Old Quarter, Harbor City, each with a real starting price, best-months window, and an honest one-line reason it fits — into that same conversation, rendered as a discovery carousel the traveler can scan, shortlist, and shape. We own the **discovery and configuration** loop; Acme owns the **booking, dates, inventory, and payment** that happen on `book.acme.example`. The handoff *is* the product: the moment the traveler is excited about a specific place, one tap carries the shaped trip to Acme's site with a `src=chatgpt` attribution tag — so Acme measures, and pays for, exactly the demand ChatGPT sent. Acme never has to build or maintain a chat surface; Noodle Seed never has to touch payments.\n\n---\n\n## 1. Acme Getaways Product Overview (Knowledge Base)\n\n### 1.1 What is Acme Getaways?\n\n**Acme Getaways** is a fictional curated-travel brand that sells a small, hand-picked catalog of getaway destinations rather than an infinite metasearch index. Its edge is *curation*: every destination is chosen, described, and priced by Acme, and every trip is booked and fulfilled on Acme's own platform at `acme.example` (booking flow at `book.acme.example`). Because the catalog is small and Acme-owned, it is the ideal thing to ground a ChatGPT app on — the app can be authoritative about every place it shows, because Acme is the source of truth for all of them.\n\n### 1.2 The Catalog (what the app helps discover)\n\nThe curated catalog is **static, Acme-owned data the app returns verbatim** — the app never invents a destination, a price, or a best-months window.\n\n| Destination | Region | Vibe | From (per person) | Best months | Why (Acme's own line) |\n|-------------|--------|------|-------------------|-------------|------------------------|\n| **Coral Bay** | Adriatic coast | beach | **$890** | May–Sep | Calm swimming coves and a walkable old town — easy for a relaxed first trip. |\n| **Monte Alto** | Northern Alps | mountains | **$1,120** | Dec–Mar | Ski-in village with beginner slopes and long groomed runs. |\n| **Old Quarter** | Central Europe | culture | **$640** | Apr–Oct | Dense museum district and food halls, all reachable on foot. |\n| **Harbor City** | Pacific rim | city | **$980** | Sep–Nov | Waterfront nightlife and day-trip islands a short ferry away. |\n\n**\"From\" prices are per-person starting figures**, not quotes — the real, dated price is computed on Acme's site once the traveler picks dates and party size. The app is careful to say \"from $X,\" never \"$X.\"\n\n### 1.3 The Trip Shape (the three inputs the app configures)\n\nDiscovery is parameterized by three model-fillable inputs the traveler expresses in natural language: **vibe** (`beach` · `mountains` · `culture` · `city`), **month** (a calendar month, defaulting to June), and **travelers** (party size, default 2). These are exactly the values that survive the handoff, so the trip a traveler shapes in chat is the trip Acme's site opens to. Nothing else is configured in chat — no dates, no rooms, no payment; those belong to Acme.\n\n### 1.4 The Booking Platform (what lives after the handoff)\n\n`book.acme.example` is Acme's real booking flow: live inventory, exact dates, party pricing, and checkout. It is **off-app by design** — it needs the traveler's account, real availability, and a payment method, none of which belong in a chat surface. The ChatGPT app's job ends the instant the traveler is ready to book; it hands the shaped trip across a signed deep link and never sees a card number.\n\n### 1.5 Business Model / Why Acme Wants This\n\nAcme earns on completed bookings. Its bottleneck is **top-of-funnel demand** — reaching travelers at the \"where should we go?\" moment, before they've defaulted to a metasearch site. That moment now happens in ChatGPT. This app moves Acme **upstream** into the deliberation itself, and — critically — makes the demand **attributable**: every handoff carries `src=chatgpt`, so Acme can measure ChatGPT-sourced sessions, handoffs, and downstream bookings, and Noodle Seed can be paid for the funnel it fills. Acme gets qualified, pre-shaped travelers landing on its booking flow; it does not have to build, staff, or moderate a conversational surface.\n\n---\n\n## 2. Competitive Landscape — Travel Discovery on ChatGPT\n\n### 2.1 What exists today\n\nTravel discovery inside ChatGPT today is **ungrounded**: the model will happily suggest destinations, but it can't tell you what *Acme* actually sells, what a trip starts from, or which months are right for a specific place — and it can't hand you off to book. Travelers bounce out to metasearch tabs, lose the context they built up in chat, and re-explain everything. Generic travel apps that do exist optimize for the *booking* transaction, not the *deliberation* — they assume you already know where you're going.\n\n### 2.2 Acme's unique position in ChatGPT\n\nThe wedge is **\"a fuzzy feeling in, a specific shortlisted getaway out — grounded in a real catalog, ready to book in one tap.\"** Differentiators:\n\n- **Grounded catalog.** Every place, price, best-month, and reason comes from Acme's own data, shown in the carousel — never the model's guess.\n- **Shaped, not just suggested.** The trip carries a vibe, a month, and a party size, so the handoff opens Acme's site to *this* trip, not a blank search.\n- **Honest top-of-funnel.** The app is explicit that booking and payment happen on Acme, never in chat — no fake in-chat checkout, no invented availability.\n- **Attributable by construction.** The `src=chatgpt` tag on the handoff makes the funnel measurable from day one.\n\n---\n\n## 3. Target User Personas (traveler-centric)\n\n**Persona A — \"The Weekend Deliberator.\"** Knows the vibe and the rough month, not the place. \"Somewhere warm and walkable, early June, two of us.\" Wants 3–4 credible options with a reason each, fast. High intent, low patience. Handoff target: **book the shortlisted place on Acme.**\n\n**Persona B — \"The Budget-First Traveler.\"** Starts from a number, not a place. \"What's the cheapest getaway that isn't miserable?\" Scans on the \"from\" price, reads the reason, shortlists. Handoff target: **Acme, once the price/place feels right.**\n\n**Persona C — \"The Season Chaser.\"** Has a fixed window and wants the place that's *right then*. \"Where's good in December?\" Cares most about the best-months fit. Handoff target: **Acme, for the in-season pick.**\n\n**Persona D — \"The Vibe Switcher.\"** Came in for the beach, talks themselves into culture or a city break mid-conversation. Re-runs discovery with a new vibe; the carousel re-renders. Handoff target: **Acme, once the vibe settles.**\n\n**Persona E — \"The Group Coordinator.\"** (Edge.) Shaping a trip for 4–6 people; party size matters for how the trip reads and what carries across. Same loop; the `travelers` value is the one they care about surviving the handoff.\n\n> **The single adaptive behavior:** the app infers vibe · month · travelers from natural language, re-runs discovery when any of them changes, and only ever offers **one deliberate exit — book on Acme.** There is no second track; the handoff is singular.\n\n---\n\n## 4. Conversational User Flow\n\n### 4.1 Entry Points\n\n1. **Vibe + month:** \"Where should we go for a beach trip in June?\"\n2. **Budget-first:** \"Cheapest getaway you'd actually recommend for two?\"\n3. **Season-first:** \"Somewhere good in December?\"\n4. **Named vibe switch:** \"Actually, more of a city break — options?\"\n5. **Party-shaped:** \"A culture trip for four in October.\"\n\n### 4.2 Flow Architecture\n\n```\n ┌─────────────────────────────────────────┐\n │ ENTRY / INTENT │\n │ vibe · month · travelers (from language) │\n └──────────────────────┬────────────────────┘\n │\n discover_getaways ★\n │\n ┌─────────────▼──────────────┐\n │ DiscoveryCarousel │\n │ 4 grounded options: name, │\n │ from-price, best-months, │\n │ region, Acme's \"why\" line │\n └─────────────┬──────────────┘\n │\n ┌──────────────────────────┼──────────────────────────┐\n │ │ │\n shortlist_getaway re-run discovery (browse / narrate)\n (tap a card → mark) (change vibe/month/pax) model explains fit\n │ │ │\n └──────────────────────────┼───────────────────────────┘\n │\n ┌─────────────▼──────────────┐\n │ \"Continue on Acme\" CTA │\n │ create_handoff ★ │\n └─────────────┬──────────────┘\n │\n ┌──────────────────────────▼───────────────────────────┐\n │ HANDOFF (the funnel boundary) │\n │ book.acme.example/plan?dest=…&month=…&pax=…&src=chatgpt│\n │ (dates · inventory · payment happen OFF-APP) │\n └────────────────────────────────────────────────────────┘\n```\n\nThe defining property: **the discovery loop is fast, grounded, and account-free; the handoff is a single deliberate exit to Acme.** Nothing is sold, dated, or paid for inside ChatGPT.\n\n### 4.3 Detailed Conversational Scenarios\n\n#### Scenario 1 — \"Beach trip in June\" (vibe + month → carousel)\n\n> **Traveler:** Where should we go for a beach trip in June? Just the two of us.\n\nApp calls `discover_getaways(vibe=\"beach\", month=\"June\", travelers=2)`.\n\n> **ChatGPT:** Here are Acme's getaways shaped for a beach trip in June, for two —\n> *[renders `DiscoveryCarousel`]*\n> **Coral Bay** stands out for a relaxed June trip: calm swimming coves and a walkable old town, from **$890**, and June sits right in its May–Sep window. Tap **Shortlist** on any you like, and I'll hold it. When you're ready, **Continue on Acme** to pick dates and book.\n\n**Subtlety:** the model *narrates which fit* (Coral Bay for beach), but the carousel shows Acme's full catalog — the tool returns all four; it never filters on the input (that's the honest, grounded behavior, §6). Prices are shown \"from,\" never as quotes.\n\n#### Scenario 2 — \"Cheapest you'd recommend\" (budget-first)\n\n> **Traveler:** Honestly, what's the cheapest one you'd actually recommend for two?\n\nApp calls `discover_getaways(vibe=\"culture\", month=\"June\", travelers=2)` (model maps \"cheapest, recommend\" to browsing the catalog).\n\n> **ChatGPT:** *[renders `DiscoveryCarousel`]*\n> On price, **Old Quarter** starts lowest at **from $640** — a dense museum district and food halls, all walkable, best Apr–Oct so June works well. It's the value pick without feeling like a compromise. Shortlist it, or want me to lean warmer/beachier?\n\n**Subtlety:** the recommendation is tied to Acme's real starting prices ($640 Old Quarter < $890 Coral Bay < $980 Harbor City < $1,120 Monte Alto), stated honestly as \"from,\" and the model offers to re-shape the vibe rather than pretend to filter.\n\n#### Scenario 3 — \"Somewhere good in December\" (season-first)\n\n> **Traveler:** We've got a week in December — where's actually good then?\n\nApp calls `discover_getaways(vibe=\"mountains\", month=\"December\", travelers=2)`.\n\n> **ChatGPT:** *[renders `DiscoveryCarousel`]*\n> December points straight at **Monte Alto** — it's the one destination whose best-months window is **Dec–Mar** (ski-in village, beginner slopes, long groomed runs), from **$1,120**. The others read better in warmer months. Want me to shortlist Monte Alto and get you to Acme to check December dates?\n\n**Subtlety:** the app grounds the seasonal call in the catalog's actual `bestMonths` values; it doesn't invent weather claims. Real availability for December is Acme's to confirm — the app says so.\n\n#### Scenario 4 — \"Shortlist that one\" (widget-only write)\n\n> **Traveler:** Shortlist Coral Bay.\n\nInside the widget, tapping **Shortlist** calls `shortlist_getaway(destination=\"Coral Bay\")`.\n\n> **ChatGPT:** *[carousel updates the card to \"Shortlisted\"; status line reads \"Shortlisted Coral Bay.\"]*\n> Held. Coral Bay's your pick — shortlist another to compare, or **Continue on Acme** when you're ready to book it for June, for two.\n\n**Subtlety:** shortlisting is a **local, non-destructive write** (widget state), not a booking or an account action. It's the \"I like this one\" gesture that sets up the handoff; nothing leaves the app.\n\n#### Scenario 5 — \"Actually, a city break\" (vibe switch → re-run)\n\n> **Traveler:** Hmm, actually more of a city break. What've you got?\n\nApp re-calls `discover_getaways(vibe=\"city\", month=\"June\", travelers=2)`; the carousel re-renders.\n\n> **ChatGPT:** *[renders `DiscoveryCarousel`]*\n> Switching to a city vibe — **Harbor City** is the fit: waterfront nightlife and day-trip islands a short ferry away, from **$980**, best Sep–Nov (so June's shoulder-season, still lively). Shortlist it, or keep exploring?\n\n**Subtlety:** the trip **re-shapes on a natural-language change** — the model updates the `vibe` input and re-invokes discovery. Month and party size persist so the traveler isn't re-asked.\n\n#### Scenario 6 — \"Continue on Acme\" (HANDOFF — the funnel boundary)\n\n> **Traveler:** Let's do Coral Bay. Book it.\n\nInside the widget, **Continue on Acme** calls `create_handoff(destination=\"coral_bay\", destinationName=\"Coral Bay\", month=\"June\", travelers=2)`, then opens the returned URL.\n\n> **ChatGPT:** *[opens `https://book.acme.example/plan?dest=coral_bay&month=June&pax=2&src=chatgpt`]*\n> Opening Acme with Coral Bay, June, two travelers pre-filled — pick your exact dates and finish booking there. Booking and payment happen on Acme, never in chat.\n\n**This is the funnel boundary.** The deep link carries the shaped trip (`dest` · `month` · `pax`) plus the `src=chatgpt` attribution. Acme's site takes it from there: real dates, live inventory, payment. The app's job — turning a fuzzy feeling into a specific, shaped, ready-to-book getaway — is done.\n\n---\n\n## 5. UI Widget Specifications (OpenAI Apps SDK Compliant)\n\n> The app has **one** widget, `DiscoveryCarousel`, authored as a React `view` on the `discover_getaways` `tool`. It follows the OpenAI Apps SDK UI Guidelines (system fonts, monochrome outlined icons, WCAG AA, ≤2 actions per card, no nested scroll). Styling uses Noodle Seed's server-level `branding` tokens and CSS cascade layers — not app-specific global CSS. Acme's accent teal is restricted to the primary CTA, the logo mark, and the \"Shortlisted\" state only.\n\n### 5.1 Design System Compliance\n\nBranding is declared once, server-side, and the runtime injects it into the widget as semantic tokens:\n\n```ts\nbranding: {\n name: 'Acme Getaways',\n accent: '#0EA5A4', // teal — CTAs / logo / \"Shortlisted\" ONLY\n surface: '#F0FDFA', // light surface tint\n surfaceDark: '#0B1B1B', // dark-mode surface\n radius: 'lg',\n density: 'comfortable',\n}\n```\n\n| Category | Source | Notes |\n|----------|--------|-------|\n| Text / background / border | Host system tokens (light + dark) | Neutral ChatGPT surface; the widget reads `theme` from `useLayout()` |\n| Accent | `branding.accent` (`#0EA5A4`) | **Primary CTA + logo mark + \"Shortlisted\" badge ONLY** |\n| Surface | `branding.surface` / `surfaceDark` | Light/dark card tint; no full-bleed brand gradient |\n| Radius / density | `branding.radius: lg` / `density: comfortable` | System scale, comfortable spacing |\n| Icons | Monochrome outlined (compass, external-link) | Inline SVG, single stroke, no fills |\n\n**Rules enforced:** system fonts only; monochrome outlined icons; WCAG AA contrast in light *and* dark; no nested scroll (the carousel is a single horizontal track, no scroll-within-scroll); **≤2 actions per card** (each card has one **Shortlist** toggle; the shell has one **Continue on Acme** primary); prices always shown as **\"from $X\"**, never as a quote; the standing line **\"Booking and payment happen on acme.example — never inside chat.\"** is always visible. Verify all of this with `noodle check --target chatgpt` before submission.\n\n### 5.2 Display Mode Strategy\n\n| User Intent | Display Mode | Compliance Note |\n|-------------|-------------|-----------------|\n| Discover / shortlist getaways | **Inline Carousel** (`DiscoveryCarousel`) | Horizontal track of ≤4 cards; 1 action/card; auto-fit inline |\n| Scan the full catalog at once | **Fullscreen** (same component, `displayMode=\"fullscreen\"`) | The component reads `displayMode` and shows a \"Fullscreen\" chip; same data, roomier layout |\n\n> **No Picture-in-Picture, no in-chat checkout.** There is no live session to pin and no transaction in-app, so PiP is unnecessary and a payment/checkout widget is deliberately **not** built — booking is off-app by design. Fullscreen is the same carousel component, not a second widget.\n\n### 5.3 Widget Specification\n\n#### `DiscoveryCarousel` — Inline Carousel ★ core (the only widget)\n**Purpose:** Turn a shaped trip (vibe · month · travelers) into a scannable set of grounded Acme destinations the traveler can shortlist and then carry to Acme to book.\n\n| Spec | Value |\n|------|-------|\n| Header | Compass logo mark, \"Acme Getaways\" title, status subtitle (e.g. \"Shortlisted Coral Bay.\"), a mode chip (\"Discover\" / \"Fullscreen\") |\n| Per card | Destination **name**, **from $price**, **region · best {months}**, Acme's **\"why\"** line (grounded copy), one **Shortlist** toggle (→ \"Shortlisted\" when active) |\n| Shell action | One primary **Continue on Acme · {selected}** CTA (opens the handoff), disabled while pending (\"Opening Acme…\") |\n| Actions per card | **1** (Shortlist) — well within the ≤2 inline limit |\n| Standing note | \"Booking and payment happen on acme.example — never inside chat.\" (always shown) |\n| Model context | A `data-llm` summary line (\"Acme Getaways discovery: N options for {month}, {travelers} traveler(s); shortlisted {name}\") so the model can narrate accurately |\n| Edge states | Empty catalog → status prompts \"Pick a getaway to continue.\"; pending handoff → CTA shows \"Opening Acme…\"; dark mode → `surfaceDark` tint |\n\n---\n\n## 6. Tool Definitions (App Backend)\n\nThree tools, all thin and deterministic over Acme's **own** catalog data. No tool requires a user credential, and **no tool invents a place, price, or best-month** — the catalog is returned verbatim.\n\n### Tool 1: `discover_getaways` ★ (tool with widget)\n- **In:** `vibe (\"beach\"|\"mountains\"|\"culture\"|\"city\", default \"beach\")`, `month (calendar month, default \"June\")`, `travelers (int ≥1, default 2)`\n- **Out:** `{ status, vibe, month, travelers, options[] }` where each option is `{ id, name, region, vibe, priceFrom, bestMonths, why }`\n- **Behavior:** returns the **full curated catalog** verbatim and renders `DiscoveryCarousel`; the model narrates which options fit the stated vibe. It deliberately does **not** filter on the input — filtering a returned catalog on an input value is connector/flow work, not a tool's job, and returning everything keeps the app honest and lets the traveler switch vibe without a dead end. `read-only` annotation. Host status copy: \"Finding getaways…\" → \"Getaways ready\".\n\n### Tool 2: `shortlist_getaway` (tool for widget)\n- **In:** `destination (string)`, `note (string, default \"\")`\n- **Out:** `{ status, destination, note }`\n- **Behavior:** records the traveler's shortlisted destination from inside the carousel. Widget-only (called by the view, not opened by the model). `local-action`, non-destructive — it's a \"hold this one\" gesture in widget state, not a booking or an account write.\n\n### Tool 3: `create_handoff` ★ (open-link tool)\n- **In:** `destination (url-safe id slug, e.g. \"coral_bay\")`, `destinationName (display name)`, `month (calendar month)`, `travelers (int ≥1)`\n- **Out:** `{ status, destination, summary, handoffUrl }`\n- **Behavior:** builds the signed Acme booking deep link carrying the shaped trip:\n `https://book.acme.example/plan?dest=${destination}&month=${month}&pax=${travelers}&src=chatgpt`\n Every value is already URL-safe (id slug · month enum · integer), so it is substituted directly — the tool never URL-encodes, transforms, or filters an input. `open-action` annotation; the domain is declared in `handoff.allowedDomains` so ChatGPT opens it without a safe-link warning. See §9.\n\n> **No live inventory, no pricing math, no AI in the tool path.** Discovery returns static curated data; the handoff is string substitution. The model does the language and the routing; the tools supply grounded truth and the signed link.\n\n---\n\n## 7. Conversation Design Principles\n\n### 7.1 Tone of Voice\nWarm, concise, and honest — a well-traveled friend who knows Acme's catalog cold. It makes a real recommendation (\"Old Quarter is the value pick\"), names the trade-off, and is candid about what it *can't* do (confirm December dates, quote an exact price) because that's Acme's job. No hype, no invented superlatives.\n\n### 7.2 Guardrails (non-negotiable)\n- **Never invent a destination, price, or best-month.** Only the four catalog entries exist; all values are Acme's, shown verbatim.\n- **Always say \"from $X,\" never \"$X.\"** Starting prices are not quotes; the dated price is computed on Acme.\n- **Never imply an in-chat booking, date, or payment.** The standing note is always visible; the CTA always says \"Continue on Acme.\"\n- **Ground seasonal claims in `bestMonths` only** — no fabricated weather or crowd claims.\n- **Attribution is honest, not hidden.** The `src=chatgpt` tag measures the funnel; it carries no PII.\n\n### 7.3 Memory Strategy\nLightweight, per-conversation: the current trip shape (vibe · month · travelers, so suggestions stay consistent), the shortlisted destination, and rejected vibes. No PII, no account linkage. The `chosen` selection lives in widget view-state so it survives re-renders within the session.\n\n### 7.4 Multi-Turn Intelligence\nDiscovery is iterative. The app holds the trip shape across turns; **re-runs `discover_getaways` when vibe, month, or party size changes**; persists the values the traveler didn't change; and proactively offers the next step (shortlist → continue on Acme). The model routes and phrases; the tools supply the catalog and the link.\n\n---\n\n## 8. End-to-End User Journey Map\n\n**Phase 1 — Frame the feeling (first 10–20s).** Traveler states a fuzzy intent; `discover_getaways` returns four grounded options. *Emotional beat: \"these are real places, with real reasons.\"*\n\n**Phase 2 — Compare & shortlist (20–60s).** Traveler scans on price / best-months / reason, switches vibe if the mood changes, taps **Shortlist**. *Emotional beat: \"this one — I like this one.\"*\n\n**Phase 3 — Decide (10–20s).** The shortlisted getaway, shaped with month and party size, is the thing to act on. *Emotional beat: confidence in the pick.*\n\n**Phase 4 — Handoff (1 tap).** **Continue on Acme** opens the booking flow pre-filled. *Emotional beat: \"and now I just pick dates.\"*\n\n**Phase 5 — Off-app.** Dates, inventory, and payment on `book.acme.example`. **Outside our scope by design.**\n\n**Phase 6 — Return (next trip).** A new conversation re-frames a new feeling; the loop repeats for the next getaway.\n\n---\n\n## 9. Handoff Architecture (Deep Dive) ★\n\nThe handoff *is* the product boundary — and here it is a **single, signed, attributable deep link**, not a two-track decision. Simplicity is the point.\n\n### 9.1 What must be true of the handoff\n\n1. **Zero credentials cross the boundary.** ChatGPT never holds an Acme login or a payment method. The traveler authenticates and pays on Acme.\n2. **The shaped trip is preserved.** `dest` (id slug), `month`, and `pax` (party size) travel in the URL so nothing is re-typed on Acme.\n3. **Attribution is attached.** `src=chatgpt` lets Acme credit the session, the handoff, and the downstream booking to the ChatGPT funnel — the commercial heart of the deal, and it carries no PII.\n4. **The domain is allow-listed.** `book.acme.example` (and `acme.example`) are declared in `handoff.allowedDomains`; the compiler derives ChatGPT's redirect domains from that list, so the link opens without a safe-link interstitial.\n5. **Values are already URL-safe.** The id slug, month enum, and integer party size need no encoding — the tool substitutes them directly (encoding an input would break substitution).\n\n### 9.2 The URL pattern\n\n```\nhttps://book.acme.example/plan?dest=coral_bay&month=June&pax=2&src=chatgpt\n```\n\n`dest` = catalog id slug · `month` = calendar month · `pax` = party size · `src=chatgpt` = attribution. One pattern, every destination.\n\n### 9.3 Recommendation & open questions for Acme\n\nShip against Acme's **existing** `book.acme.example/plan` entry point so nothing blocks launch. In parallel, confirm with Acme:\n\n- The **attribution parameter** name/format (we assume `src=chatgpt`) and whether a finer campaign/session tag is wanted.\n- Whether `book.acme.example/plan` should **pre-select dates** from `month` or just default the month filter (today the app passes the month; Acme owns exact dates).\n- Whether a **deep-linked destination page** (`/plan/coral_bay`) is preferred over a query param — a config change, not a UX rework.\n\n> **Design stance:** `create_handoff` emits a `url` + `summary`. Upgrading the query param to a path, or adding a session tag, is a config change — the unknowns don't block the build.\n\n### 9.4 Edge cases at the boundary\n\n- **Destination sold out / month unavailable:** Acme's site owns this; the app never asserts availability, only \"from\" pricing and best-months.\n- **Mobile:** the deep link opens Acme's site/app; the shaped trip carries regardless.\n- **No shortlist yet:** the CTA continues with the currently-selected (first) card, so the handoff always has a destination.\n\n---\n\n## 10. Demo Scope Recommendation\n\n### 10.1 MVP demo features (priority order)\n1. `discover_getaways` + `DiscoveryCarousel` — fuzzy feeling → four grounded options (the \"these are real\" moment).\n2. `shortlist_getaway` — tap to hold a getaway (the \"this one\" moment).\n3. Re-run discovery on a vibe switch — beach → city, carousel re-renders (the \"it adapts\" moment).\n4. `create_handoff` — Continue on Acme, signed link with `src=chatgpt` (the funnel boundary).\n\n### 10.2 Demo script (≈90 seconds)\n1. \"Beach trip in June, two of us.\" → `DiscoveryCarousel`: Coral Bay leads, from $890, May–Sep fit. *(discovery)*\n2. \"What's the cheapest you'd recommend?\" → model points to Old Quarter, from $640. *(grounded recommendation)*\n3. \"Actually, a city break.\" → carousel re-renders to feature Harbor City. *(vibe switch)*\n4. Tap **Shortlist** on Harbor City → status \"Shortlisted Harbor City.\" *(the pick)*\n5. **Continue on Acme** → opens `book.acme.example/plan?dest=harbor_city&month=June&pax=2&src=chatgpt`. *(the handoff — the whole point)*\n\nThe demo's arc: *a vague mood → four real, priced, reasoned getaways → one shortlisted → one tap to book on Acme.*\n\n---\n\n## 11. Technical Architecture (High Level)\n\n```\nChatGPT ──tool calls──► Noodle Seed runtime (server 'acme_discovery')\n │ app-owned curated catalog (static data)\n ├──► discover_getaways (tool → DiscoveryCarousel)\n ├──► shortlist_getaway (tool, local write)\n ├──► create_handoff (open-link → signed Acme deep link)\n └──► React view bundle (DiscoveryCarousel, branding tokens, CSP)\n │\n (traveler taps Continue) ──► book.acme.example/plan?…&src=chatgpt\n (dates · inventory · payment on Acme)\n```\n\n- **Stateless hot path.** Discovery returns static curated data; the handoff is string substitution. No AI in the tool path.\n- **Grounding discipline.** Every place/price/best-month is Acme's own data, returned verbatim; the model narrates, it never invents.\n- **CSP.** The widget's `connectDomains` / `resourceDomains` / `frameDomains` are scoped to `acme.example`; the handoff domains are declared in `handoff.allowedDomains`.\n- **Attribution.** `src=chatgpt` injected at `create_handoff`, logged (PII-free) for funnel analytics.\n\n---\n\n## 12. Success Metrics\n\n| Metric | What it tells us |\n|--------|------------------|\n| **Discovery rate** (session → carousel rendered) | Top-of-funnel reach |\n| **Shortlists per session** | Engagement with the core gesture |\n| **Vibe re-runs per session** | Depth of deliberation (the loop working) |\n| **Handoff rate** (session → Continue on Acme) | In-app funnel conversion |\n| **`src=chatgpt` bookings on Acme** | The revenue number — bookings attributed to the ChatGPT funnel |\n| **Handoff→booking rate** (Acme-side) | Quality of the shaped demand we send |\n\nThe cleanest experiment: measure **ChatGPT-attributed handoffs → completed Acme bookings** — the conversion that justifies the app and prices the funnel.\n\n---\n\n## 13. Future Enhancements (Post-Launch)\n\n- **Deep-linked destination pages** (`/plan/coral_bay`) if Acme prefers a path over a query param (§9.3).\n- **Month → date pre-selection** on Acme once the booking flow accepts a target window.\n- **Richer shortlist** — hold multiple getaways and compare them side by side before the handoff.\n- **Live catalog feed** — swap the static catalog for an Acme feed so new destinations and \"from\" prices update without a redeploy.\n- **Seasonal nudges** — surface the in-season destination first when the stated month maps cleanly to one `bestMonths` window.\n- **Fullscreen catalog browse** — a roomier grid of the full catalog (same component, `displayMode=\"fullscreen\"`) for \"show me everything.\"\n\n---\n\n## Appendix A — Funnel Boundary Cheat-Sheet\n\n| Stage | Where it happens | Auth needed? |\n|-------|------------------|--------------|\n| Frame the feeling (vibe · month · travelers) | ChatGPT (model) | No |\n| Discover getaways | App → `discover_getaways` | No |\n| Shortlist a getaway | App → `shortlist_getaway` (widget state) | No |\n| Re-shape the trip (change vibe/month/pax) | App → re-run `discover_getaways` | No |\n| **Handoff** | App → `create_handoff` (signed deep link) | No |\n| Pick dates / check availability | **Acme** (`book.acme.example`) | **Yes (at Acme)** |\n| Pay & confirm booking | **Acme** | **Yes (at Acme)** |\n\nEverything above the bold line is ours and runs without a single user credential. Everything below is Acme's. The **Continue on Acme** CTA is the line — and it points one way: *book it on Acme.*\n\n---\n\n## Appendix B — Source Notes (for the build team)\n\nAcme Getaways is a **fictional** brand; the catalog, prices, best-months, and regions in this document are the app's own curated data and are internally consistent with `src/server.ts` and the `DiscoveryCarousel` view. \"From\" prices are per-person starting figures, not quotes — the `create_handoff` deep link exists precisely so exact dates and pricing are always resolved on Acme's own booking flow, never asserted in chat. Tool names (`discover_getaways`, `shortlist_getaway`, `create_handoff`), the widget name (`DiscoveryCarousel`), and the handoff domain (`book.acme.example`) match the implementation exactly; verify Apps SDK compliance with `noodle check --target chatgpt` at build time.\n" },
|
|
@@ -53,6 +53,7 @@ export const CLI_COMMANDS = [
|
|
|
53
53
|
'deployments',
|
|
54
54
|
'distributions',
|
|
55
55
|
'service',
|
|
56
|
+
'solutions',
|
|
56
57
|
'login',
|
|
57
58
|
'logout',
|
|
58
59
|
'whoami',
|
|
@@ -86,6 +87,7 @@ export const SDK_EXPORTS = [
|
|
|
86
87
|
'googleWorkloadIdentity',
|
|
87
88
|
'handoffSession',
|
|
88
89
|
'knowledge',
|
|
90
|
+
'managedCollection',
|
|
89
91
|
'managedSecret',
|
|
90
92
|
'meilisearch',
|
|
91
93
|
'noodleManaged',
|
|
@@ -149,6 +151,7 @@ export const COMPILE_ERROR_CODES = [
|
|
|
149
151
|
'state_secret_field',
|
|
150
152
|
'invalid_knowledge',
|
|
151
153
|
'knowledge_unhashed',
|
|
154
|
+
'invalid_managed_collection',
|
|
152
155
|
'unknown_connector_alias',
|
|
153
156
|
'connector_not_in_catalog',
|
|
154
157
|
'unknown_operation',
|
|
@@ -34,6 +34,7 @@ export function renderAuthoringWorkflowReference() {
|
|
|
34
34
|
'- Tests',
|
|
35
35
|
'- Secrets and variables',
|
|
36
36
|
'- Embedded assistant',
|
|
37
|
+
'- Managed collections',
|
|
37
38
|
'- Boundaries',
|
|
38
39
|
'',
|
|
39
40
|
'## Input paths',
|
|
@@ -253,6 +254,12 @@ export function renderAuthoringWorkflowReference() {
|
|
|
253
254
|
'',
|
|
254
255
|
"The managed crawler and managed index are the defaults and need no configuration. A component may instead bring its own crawler (`crawler: firecrawl({ apiKey: secret('FIRECRAWL_API_KEY') })` or `tavily(...)`) and/or its own index (`index: algolia({ appId: variable('ALGOLIA_APP_ID'), apiKey: secret('ALGOLIA_API_KEY') })` or `meilisearch({ host: variable(...), apiKey: secret(...) })`). The code declares only config names; operators supply values with `noodle secrets set` / `noodle variables set`, and deploy preflight fails closed naming any unset reference.",
|
|
255
256
|
'',
|
|
257
|
+
'## Managed collections',
|
|
258
|
+
'',
|
|
259
|
+
'Use `managedCollection(name, { title, description, schemaVersion, record })` when an application needs reusable typed intent for business records that Noodle may later hold. Pass it through `server(..., { collections: [...] }, definitions)`. `record` is one bounded, closed Zod object; names use lowercase letters, numbers, and underscores. Keep payment-card, credentials, passport/government identity, health, and biometric fields out of this surface.',
|
|
260
|
+
'',
|
|
261
|
+
'This declaration compiles schema metadata only. It does not create a submit tool, grant access, select retention or residency, provision storage, or make records available to MCP or the embedded assistant. Operators bind lifecycle and authority separately. Until the service intake path is shipped, keep live business operations on their existing connector tools.',
|
|
262
|
+
'',
|
|
256
263
|
'## Boundaries',
|
|
257
264
|
'',
|
|
258
265
|
'Import public app authoring only from `@noodleseed/one` (and its documented `/react` or `/platform` subpaths). Packages and subpaths under `@noodle-borg/*` are runtime implementation details, including `/portable` boundaries, and must never appear in customer `server.ts` code. Do not hand-author manifest JSON/YAML, runtime artifacts, connector IR, or hosted asset metadata. Do not read or copy secrets, bearer tokens, refresh tokens, static access keys, `.env`, `.env.noodle`, or `~/.noodle/config.json`. Hosted access is identity-based — do not add static data-plane credential paths.',
|
|
@@ -13,6 +13,7 @@ export type { DistributionImageSource, DistributionMetadataSource, DistributionM
|
|
|
13
13
|
export { gmailConnector } from './gmail.js';
|
|
14
14
|
export { type HandoffPurpose, type HandoffSession, type HandoffStateHandleLink, handoffSession, } from './handoff.js';
|
|
15
15
|
export { algolia, file, firecrawl, type KnowledgeCrawlerDeclaration, type KnowledgeIndexDeclaration, type KnowledgeInput, knowledge, meilisearch, site, tavily, } from './knowledge.js';
|
|
16
|
+
export { type ManagedCollectionDeclaration, type ManagedCollectionInput, managedCollection, } from './managed-collection.js';
|
|
16
17
|
export { noodlePlatform, noodlePlatformCatalog } from './platform.js';
|
|
17
18
|
export { type Cond, type ConnectorClient, type Ref, type SymbolicScope, when, } from './recording.js';
|
|
18
19
|
export { annotations, asset, type BrandThemeTokens, type ElicitationOptions, isServerDefinition, type PromptArgument, type PromptOptions, prompt, type ResourceContext, type ResourceFulfilResult, type ResourceOptions, resource, type ServerComponent, type ServerDefinition, type ServerOptions, server, type ToolAuthorizationOptions, type ToolContext, type ToolOptions, type ToolViewOptions, tool, type WidgetCsp, type WidgetPermissionGrant, type WidgetPermissions, widgetResult, } from './server.js';
|
|
@@ -8,6 +8,7 @@ export { customerEndpoint, } from './customer-endpoint.js';
|
|
|
8
8
|
export { gmailConnector } from './gmail.js';
|
|
9
9
|
export { handoffSession, } from './handoff.js';
|
|
10
10
|
export { algolia, file, firecrawl, knowledge, meilisearch, site, tavily, } from './knowledge.js';
|
|
11
|
+
export { managedCollection, } from './managed-collection.js';
|
|
11
12
|
export { noodlePlatform, noodlePlatformCatalog } from './platform.js';
|
|
12
13
|
export { when, } from './recording.js';
|
|
13
14
|
export { annotations, asset, isServerDefinition, prompt, resource, server, tool, widgetResult, } from './server.js';
|
|
@@ -33,7 +33,7 @@ export function prepareAuthoringRuntimeDir(dir, options) {
|
|
|
33
33
|
'./react': './react.mjs',
|
|
34
34
|
},
|
|
35
35
|
}));
|
|
36
|
-
writeFileSync(join(self, 'index.mjs'), "export { algolia, annotations, asset, authenticatedWebsite, bind, clientCredentials, connector, connection, customerAuth, customerEndpoint, embeddedAssistant, externalExchange, file, firecrawl, gmailConnector, googleWorkloadIdentity, handoffSession, knowledge, managedSecret, meilisearch, noodleManaged, openAICompatible, prompt, publicWebsite, resource, secret, server, site, tavily, tool, variable, when, z } from '@noodle-borg/authoring';\n");
|
|
36
|
+
writeFileSync(join(self, 'index.mjs'), "export { algolia, annotations, asset, authenticatedWebsite, bind, clientCredentials, connector, connection, customerAuth, customerEndpoint, embeddedAssistant, externalExchange, file, firecrawl, gmailConnector, googleWorkloadIdentity, handoffSession, knowledge, managedCollection, managedSecret, meilisearch, noodleManaged, openAICompatible, prompt, publicWebsite, resource, secret, server, site, tavily, tool, variable, when, z } from '@noodle-borg/authoring';\n");
|
|
37
37
|
writeFileSync(join(self, 'platform.mjs'), "export { noodlePlatform, noodlePlatformCatalog } from '@noodle-borg/authoring';\n");
|
|
38
38
|
writeFileSync(join(self, 'react.mjs'), "export * from '@noodle-borg/authoring/react';\n");
|
|
39
39
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { type JsonSchema } from './json-schema.js';
|
|
3
|
+
export interface ManagedCollectionInput {
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly description: string;
|
|
6
|
+
readonly schemaVersion: number;
|
|
7
|
+
readonly record: z.ZodType;
|
|
8
|
+
}
|
|
9
|
+
export interface ManagedCollectionDeclaration extends ManagedCollectionInput {
|
|
10
|
+
readonly kind: 'managedCollection';
|
|
11
|
+
readonly name: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ManifestManagedCollection {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly title: string;
|
|
16
|
+
readonly description: string;
|
|
17
|
+
readonly schemaVersion: number;
|
|
18
|
+
readonly recordSchema: JsonSchema;
|
|
19
|
+
}
|
|
20
|
+
/** Declare one typed collection whose lifecycle is bound later by an authorized operator. */
|
|
21
|
+
export declare function managedCollection(name: string, input: ManagedCollectionInput): ManagedCollectionDeclaration;
|
|
22
|
+
export declare function manifestManagedCollection(declaration: ManagedCollectionDeclaration): ManifestManagedCollection;
|
|
23
|
+
export declare function manifestCollections(declarations: readonly ManagedCollectionDeclaration[] | undefined): {
|
|
24
|
+
readonly collections?: ManifestManagedCollection[];
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=managed-collection.d.ts.map
|