npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@daydreamsai/deploy

v0.3.22

Published

Deploy Daydreams agents to Google Cloud with custom domains

Readme

@daydreamsai/deploy

Deploy Daydreams agents to Google Cloud Run with custom domains.

Installation

pnpm add @daydreamsai/deploy

CLI Usage

The package provides a CLI tool for deploying agents:

# Deploy an agent
daydreams-deploy deploy --name my-agent --project my-gcp-project

# List all deployed agents
daydreams-deploy list --project my-gcp-project

# View logs
daydreams-deploy logs my-agent --project my-gcp-project

# Delete an agent
daydreams-deploy delete my-agent --project my-gcp-project

Deploy Command Options

  • --name <name> - Agent name (becomes subdomain)
  • --file <path> - Entry file (default: server.ts)
  • --project <id> - GCP project ID
  • --region <region> - GCP region (default: us-central1)
  • --env <file> - Environment variables file
  • --memory <size> - Memory allocation (default: 256Mi)
  • --max-instances <n> - Max scaling (default: 100)
  • --min-instances <n> - Min scaling (default: 0)
  • --port <port> - Container port (default: 8080)
  • --timeout <seconds> - Request timeout (default: 60)
  • --domain <domain> - Custom domain (default: agent.daydreams.systems)
  • --no-build - Skip building, use existing image
  • --dry-run - Show what would be deployed without deploying

Prerequisites

  1. Google Cloud Project with billing enabled

  2. Enable required APIs:

    gcloud services enable \
      run.googleapis.com \
      cloudbuild.googleapis.com \
      containerregistry.googleapis.com \
      dns.googleapis.com
  3. Authenticate with Google Cloud:

    gcloud auth application-default login
  4. Configure DNS for wildcard domain:

    • Add wildcard A/AAAA records for *.agent.daydreams.systems
    • Point to Google Cloud Load Balancer IP

Example Agent

// server.ts
import { createDreams, context } from "@daydreamsai/core";
import { Hono } from "hono";
import { serve } from "@hono/node-server";

const agent = createDreams({
  // ... agent configuration
});

const app = new Hono();

app.post("/chat", async (c) => {
  const { message } = await c.req.json();
  const result = await agent.send({
    input: { type: "text", data: message },
  });
  return c.json({ response: result });
});

serve({ fetch: app.fetch, port: 8080 });

Deploy with:

daydreams-deploy deploy --name my-bot --project my-project

Your agent will be available at:

  • https://my-bot.agent.daydreams.systems

Architecture

The deployment process:

  1. Build Phase

    • Generates optimized Dockerfile
    • Detects package manager (npm/pnpm/bun/yarn)
    • Creates production-ready container image
  2. Deploy Phase

    • Pushes image to Google Container Registry
    • Deploys to Cloud Run with auto-scaling
    • Configures custom domain mapping
  3. DNS Setup

    • Maps subdomain to Cloud Run service
    • Automatic SSL certificate provisioning
    • Global load balancing

Programmatic API

import { deployCommand } from "@daydreamsai/deploy";

await deployCommand({
  name: "my-agent",
  project: "my-gcp-project",
  file: "server.ts",
  region: "us-central1",
  memory: "512Mi",
  maxInstances: "50",
});

Environment Variables

Create .env.production file:

OPENAI_API_KEY=sk-...
DATABASE_URL=postgresql://...

Deploy with:

daydreams-deploy deploy --name my-agent --env .env.production

Monitoring

View real-time logs:

daydreams-deploy logs my-agent --follow

View metrics in Google Cloud Console:

  • CPU usage
  • Memory usage
  • Request count
  • Latency percentiles
  • Error rate

Cost Optimization

Cloud Run pricing:

  • Pay only for actual usage
  • Free tier: 2 million requests/month
  • Auto-scales to zero when idle
  • Configurable min/max instances

Security

  • Each agent runs in isolated container
  • Automatic HTTPS with managed certificates
  • Environment variables stored securely
  • Service account with minimal permissions

Troubleshooting

Domain not accessible

  • DNS propagation can take up to 48 hours
  • Verify wildcard DNS records are configured
  • Check Cloud Run domain mapping status

Build failures

  • Ensure Dockerfile.daydreams is valid
  • Check Cloud Build logs for errors
  • Verify all dependencies are installable

Authentication errors

  • Run gcloud auth application-default login
  • Verify project has billing enabled
  • Check required APIs are enabled

gcloud dns managed-zones create daydreams-labs-staging
--dns-name="agent.daydreams.systems."
--description="Zone for Daydreams agent deployments"

gcloud compute addresses create daydreams-labs-staging \
--global \
--ip-version=IPV4

gcloud compute addresses describe daydreams-labs-staging --global

gcloud dns record-sets create "*.agent.daydreams.systems."
--zone="daydreams-labs-staging"
--type="A"
--ttl="300"
--rrdatas="34.160.205.45"

NAME TYPE TTL DATA *.agent.daydreams.systems. A 300 34.160.205.45

gcloud dns managed-zones describe daydreams-labs-staging

dnsName: agent.daydreams.systems. id: '3963925729438153797' kind: dns#managedZone name: daydreams-labs-staging nameServers:

  • ns-cloud-d1.googledomains.com.
  • ns-cloud-d2.googledomains.com.
  • ns-cloud-d3.googledomains.com.
  • ns-cloud-d4.googledomains.com.