Skip to content

feat: eve demos runnable via Watt and @platformatic/eve - #3

Merged
mcollina merged 1 commit into
mainfrom
demos/watt-eve-examples
Jul 11, 2026
Merged

feat: eve demos runnable via Watt and @platformatic/eve#3
mcollina merged 1 commit into
mainfrom
demos/watt-eve-examples

Conversation

@mcollina

@mcollina mcollina commented Jul 9, 2026

Copy link
Copy Markdown
Member

What

Adds a demos/ directory with two example eve agents, wired to boot under Platformatic Watt through the @platformatic/eve capability instead of on Vercel.

Demo What it shows
weather-assistant The eve quickstart — one agent, one typed get_weather tool. Smallest thing that proves the Watt + capability wiring end to end. Adapted from upstream vercel/eve apps/fixtures/weather-agent.
real-estate-agent A sales assistant with tools for searching listings, booking viewings, and reviewing a client's schedule, over a shared in-memory store, plus a cron daily_viewings_digest schedule. Original reconstruction of the scenario from Vercel's launch blog.

Each demo is a Watt app (watt.jsonmodule: @platformatic/eve) authored against the real eve@0.20.0 API (defineAgent, defineTool, defineSchedule, eveChannel).

How it's wired

  • Workspace members, file: link. The demos are registered under packages: demos/* in the root pnpm-workspace.yaml, so one pnpm install at the repo root installs them. They depend on @platformatic/eve via "file:../.." (not workspace:*).
  • pnpm-workspace.yaml marker. In wattpm dev, eve snapshots its "source root" (nearest ancestor with .git/pnpm-workspace.yaml). Because the demos live inside this repo, each carries its own pnpm-workspace.yaml to pin eve's source root to the demo — without it, eve roots at the repo and cp-fails copying the tree into <demo>/.eve/. pnpm also treats that nested file as a root when you run pnpm from the demo dir, which is exactly why the capability is linked via file: and not workspace:* (the latter would be unresolvable in that rooting). The marker also carries allowBuilds so the install doesn't fail on ignored native build scripts. Recorded as a landmine in AGENTS.md.
  • Model resolution. AI Gateway key → gateway string; else ANTHROPIC_API_KEY/OPENAI_API_KEY → that provider directly (lazy @ai-sdk/* import); else mockModel() from eve/evals. So the demos run offline with zero credentials and upgrade to a real model when a key is set. Vercel AI Gateway is not required.

Run

# once, at the repo root — installs the workspace (incl. demos) and builds the capability
pnpm install && npm run build

# then per demo
cd demos/weather-assistant     # or demos/real-estate-agent
pnpm dev
curl -i -X POST http://127.0.0.1:3042/eve/v1/session \
  -H 'content-type: application/json' \
  -d '{"message":"What is the weather in Brooklyn?"}'

Verified

Both demos were booted under Watt via pnpm dev and driven end to end:

  • Weather: get_weather{city:"Brooklyn"}"It's Windy and about 60°F in Brooklyn right now."
  • Real estate: "listings in Park Slope under 1.5 million"search_listings{neighborhood, maxPriceUSD:1500000} → the matching listing; "viewings today?"list_client_viewings → the seeded schedule.

Capability typecheck and both demo typechecks are clean. No changes to the capability's src/.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Axq9LHWsGVYphZvWeqhJmp

@mcollina
mcollina force-pushed the demos/watt-eve-examples branch 2 times, most recently from ef6ba09 to 4f76e11 Compare July 9, 2026 13:46
Add demos/ with two example eve agents wired to boot under Platformatic
Watt through the @platformatic/eve capability:

- weather-assistant: the eve quickstart (one agent, one get_weather tool),
  adapted from vercel/eve's apps/fixtures/weather-agent.
- real-estate-agent: a sales assistant with listing/booking tools over a
  shared in-memory store and a cron "viewings today" digest schedule.

The demos are pnpm workspace members (packages: demos/*) but link the
capability via file:../.. (not workspace:*): each carries a pnpm-workspace.yaml
that pins eve's dev-runtime source root to the demo, which also roots pnpm when
run from the demo dir, so a workspace: spec would not resolve there. The root
pnpm-lock.yaml is the single source of truth; demo-level lockfiles are
gitignored. Models resolve to AI Gateway or a direct provider when a key is
present, and fall back to eve's mockModel() so the demos run offline.

The demos are standalone example apps, so they are excluded from the library
ESLint config (alongside external/ and eve-old/). Also fixes a pre-existing
prettier error in src/capability.ts that was already failing CI on main.

Documented in demos/README.md and each demo README; CLAUDE.md and AGENTS.md
capture the build/run flow and the source-root marker landmine.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Axq9LHWsGVYphZvWeqhJmp
@mcollina
mcollina force-pushed the demos/watt-eve-examples branch from 4f76e11 to d39adea Compare July 9, 2026 14:03
@mcollina
mcollina requested a review from ShogunPanda July 10, 2026 09:38
@mcollina
mcollina merged commit 34d80b3 into main Jul 11, 2026
2 checks passed
@mcollina
mcollina deleted the demos/watt-eve-examples branch July 11, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants