Developer Guide

CLI Tools (Internal)

Reference for the monorepo build and publish shell scripts — internal tools for built-in apps.

Note: These scripts are internal convenience tools used within the AssistMe monorepo for building and publishing built-in apps. External developers do not need these scripts — you can build your Agent App with any tooling and publish via the API.

Build Script

agent-app-build.sh

Builds a built-in sub-app (from agent-apps/native-{slug}/ in the monorepo) as a web bundle for dynamic loading.

./scripts/agent-app-build.sh <app-slug>

Example:

./scripts/agent-app-build.sh note

Process:

  1. Validates the agent-apps/native-{slug}/ directory exists in the monorepo
  2. Reads the version from package.json
  3. Installs dependencies if node_modules/ is missing
  4. Runs npx expo export --platform web
  5. Packages all JS and CSS into a single self-contained index.html (all assets inlined)
  6. Cleans up intermediate build artifacts
  7. Reports output size and SHA256 hash

Output:

agent-apps/native-{slug}/dist-bundle/index.html

Adapting for Your Own Project

The core bundling logic is straightforward and can be replicated in any CI/CD pipeline:

# 1. Export as web
npx expo export --platform web --output-dir .expo-web-build

# 2. Find JS/CSS files
JS_FILES=$(find .expo-web-build -name "*.js" -path "*/static/js/*" | sort)
CSS_FILES=$(find .expo-web-build -name "*.css" | sort)

# 3. Inline into a single index.html
# (write HTML head, inline CSS with <style> tags, write body, inline JS with <script> tags)

# 4. Compute hash
sha256sum dist/index.html

Publish Script

agent-app-publish.sh

Publishes a built-in sub-app version to the Agent App registry. This is a convenience wrapper around the agent-app-publish edge function.

./scripts/agent-app-publish.sh <app-slug> [--build-bundle]

Required environment variables:

VariableDescription
SUPABASE_URLYour Supabase project URL
AUTH_TOKENA valid authentication token for the developer

Process (with --build-bundle):

  1. Validates the agent-apps/native-{slug}/ directory in the monorepo
  2. Reads the version from package.json
  3. Builds the web bundle via agent-app-build.sh
  4. Uploads the bundle to Supabase Storage
  5. Calls the agent-app-publish edge function

For external developers, you can skip this script entirely and call the API directly:

curl -X POST "${SUPABASE_URL}/functions/v1/agent-app-publish" \
  -H "Authorization: Bearer ${AUTH_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "my-app",
    "version": "1.0.0",
    "changelog": "Initial release",
    "bundle_url": "https://your-cdn.com/bundle.html",
    "bundle_hash": "<sha256>",
    "bundle_size": 12345
  }'

See Submitting for Review for the full API reference.