Project Overview: where-is-kristian


I decided to make this project DB-first on Cloudflare Workers using the Agents SDK, so travel state is written through API endpoints instead of edited in local JSON files. That choice is now the backbone of the system and the main guardrail for future work.

What We Built

  • A Workers-based travel status API starter centered on TravelAgent state, with endpoints for health, plan reads/writes, segment CRUD, and current/next segment resolution.
  • An Agents SDK + Durable Object + SQLite model for travel timeline data, explicitly documented as the source of truth.
  • A parallel background pipeline direction using BackgroundAgent state, with job endpoints and Cloudflare-native generation flow.
  • A small chat surface (/chat + /api/ai/chat) and direct agent route (/agents/TravelAgent/primary/plan) to keep the project usable both by humans and agent tooling.
  • Recent delivery confirms this trajectory: 7d6758a initialized the Workers tracker, and 7f55541 added runtime locale background automation.

Why We Built It

  • I optimized for operational correctness over convenience: DB-backed agent state reduces drift and removes the risk of stale local itinerary files.
  • The docs make the intent explicit: “Do not add or edit local travel JSON files for itinerary state,” which enforces one supported write path through APIs.
  • This structure is designed for iterative expansion (including MCP-oriented usage) without introducing a separate heavy service layer.
  • The result is a practical baseline where state transitions are controlled, inspectable, and easy to automate.

How It Works

  • Local development and deployment are straightforward through Wrangler (dev, deploy), while type/lint checks (build, typecheck, lint) keep the TS Worker surface disciplined.
  • Travel writes happen via POST /api/travel/segments, PUT /api/travel/plan, and related mutation endpoints; reads happen through plan/current/next endpoints with timezone-aware queries.
  • Agent notes define this as the only supported workflow, including copy-paste API patterns for segment updates.
  • Recent changed files (src/worker.ts, src/agents/background-agent.ts, src/backgrounds/*, wrangler.toml, and docs) show active movement in runtime behavior plus operator guidance, not just UI polish.