Skip to content

Epic: Publishable, monetizable agents for non-technical creators #79

Description

@duyet

Epic: Publishable, monetizable agents for non-technical creators

Turn OMA from a developer/operator platform into one where a non-technical creator can build an agent (e.g. "duyetbot"), publish it to a public URL, let anyone log in and chat, charge money, give it memory + proactive notify-back + hooks, and (infra) let the Cloudflare deployment run sandboxes on k8s.

What already exists (do not rebuild)

Exploration of the current codebase found the platform layer is further along than it looks:

  • Multi-tenancy: tenant-centric data model, memberships + roles (owner/admin/member); every signup gets its own tenant (apps/main/src/auth-config.tsensureTenant()).
  • Auth: better-auth email-OTP for Console; per-tenant/user API keys (packages/http-routes/src/api-keys/).
  • Usage metering: per-tenant sandbox/browser seconds in usage_events (packages/db-schema/src/cf-auth/usage.ts), plus quotas (packages/quotas). Billing credits/Stripe are deliberately out-of-tree (hosted worker behind BILLING_INTERNAL_SECRET).
  • Console: polished React/Vite admin console with a working chat playground + agent-create-from-template.
  • Memory + notify-back: memory stores (R2+D1); notify-dispatch posts to Slack/GitHub/Matrix on session end.
  • Scheduler: cron infra (system jobs only).
  • Sandbox: a Node-only k8s adapter exists; boxrun proves the "CF Worker drives a remote sandbox over plain fetch" pattern.

Design constraint (from the maintainer)

Multi-tenancy stays on a single shared D1 with row-level tenant_id isolation — no per-tenant shard DBs. Every new table below carries tenant_id and lives in the existing control-plane D1 (env.ROUTER_DB ?? env.MAIN_DB).

The 7 gaps → child issues

Product critical path (dependency order):

Enhancers (parallelizable once #72 lands):

Infra track (independent — can start immediately):

Suggested sequencing for a handoff agent

  1. Cloudflare Worker → remote k8s sandbox via HTTP gateway #78 in parallel from day one (infra, no product deps).
  2. Published agents + public end-user chat surface #72 first on the product track — everything else needs the publication primitive.
  3. End-user (consumer) accounts, distinct from tenant owners #73Per-end-user metering + paywall (credits/Stripe) for published agents #74 (identity then money), then No-code agent builder + one-click publish (Console) #75 (the UI that ties publish + pricing together).
  4. Generic outbound webhooks + agent hooks (pre/post-tool, lifecycle) #76User-facing scheduled / proactive agent runs #77 last (proactive/hook polish).

Each child issue is self-contained with concrete file:line seams, the single-D1 constraint, and acceptance criteria, so it can be picked up without re-deriving context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-taskAutonomous agent pickupenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions