Black Friday

Your first month is free. On any plan.

Start on Builder, Pro or Partner and pay $0 for your first month. Cancel anytime. Ends Cyber Monday, November 30.

Claim your free month
Hedy Assist developer docs

Hedy Assist core concepts

Plain-language definitions for the objects you work with through the Hedy Assist MCP server.

Companies & projectsHosted appsEnvironments & revisionsFunctions & ctx
On this page

This page defines the terms used across the Hedy Assist developer docs. Every tool page uses them the same way.

Companies (workspaces)

A company is the workspace that owns projects, members and company secrets. A company can be personal or a team. You manage members with hedy_invite (roles: viewer, editor, admin). Company-wide credentials live in hedy_company_secrets.

Projects

A project is the unit of work. It belongs to one company and is addressed by a projectId. A project holds planning content (pages, items, scope, decisions, discussions, assets) and can hold a hosted app. To find which project serves a URL, call hedy_project with operation: "lookup-host".

Pages and items

A page is a section of the project workspace. An item is a unit on a page, such as a task-board work item. Manage them with hedy_page, hedy_item and hedy_apply_action, which applies structured page, section and item actions. See pages, items, scope and decisions.

Hosted apps

A hosted app is a live, data-backed web app inside a project. It has app files, behavior routes, server-side functions, project-isolated data, optional end-user sign-in, push notifications, realtime channels, deployment history and operational logs.

  • Files are stored and served by browser path, for example /index.html. Public binaries are served from https://cdn.hedyassist.com.
  • Routes are for behavior only: functions, redirects, auth gates and fallbacks. Don't create a route to serve a file. Paths accept :name or {name} segments and a trailing whole-segment *. An app can have 400 routes by default.
  • Default host: each app gets an address of the form project--workspace.apps.hedyassist.com. Custom domains are managed with hedy_app_domains.

Environments and branches

An environment is a separately configured copy of a hosted app. Every app has prod and can add up to two more from dev, staging, test, preview and qa. Each environment has its own configuration, deployed definitions, app data, project secrets, end users, schedules, logs, analytics, domains and default host. Revisions, deployment history, file storage and company secrets are shared across environments.

The environment argument defaults to prod, so pass it explicitly when you don't mean production. Edit in a sandbox or dev. staging and prod take promoted revisions. A branch is an isolated line of chat edits. Manage branches with hedy_app_deployments (branch-create, branch-merge, branch-archive).

Revisions and deployments

A revision is a versioned manifest of an app's files and definitions. A deployment makes a revision live in an environment. With hedy_app_deployments you can create, compare, deploy, promote and rollback revisions and read status and logs. A patch with dryRun: true validates a manifest change without saving anything. A deploy, rollback or promote that's too big for one request must be retried with background: true.

hedy_app_sync and full revision creation replace the whole manifest. Definitions missing from the manifest are removed. hedy_app_sync is a dry run by default, so review the plan before you apply it.

Functions and modules

A function is server-side code that runs when a function route matches. Functions run JavaScript (runtime: "js", the default) or Python v1 (runtime: "python"). A module is shared code that functions import, managed with hedy_app_modules.

  • Default wall time is 10 seconds, up to 30 seconds on a route (timeoutSeconds 1–30). CPU time is 5 seconds.
  • A function can be up to 256 KiB. Requests can be up to 5 MB, responses up to 4 MB and a single data item up to 380 KB.
  • TypeScript types are published as the MCP resource hedy://docs/app-types/javascript.
JavaScript function
async function handler(ctx) {
  const r = await ctx.data.list('todos', { limit: 50 });
  return { status: 200, body: r };
}

The ctx runtime API

Each function receives one argument, ctx. It's a capped object that gives the function its request, identity and platform services. The surfaces are:

SurfaceWhat it is for
ctx.requestThe incoming request, including the matched route { id, method, path }.
ctx.dataProject-isolated data: get, getWithMeta, list, put (with ifNotExists, ifVersion, ttlSeconds) and delete.
ctx.askaiBuilt-in AI: ask, streamResponse, structured, withTools, retrieve, embed, models.
ctx.streamStreaming responses.
ctx.http.fetchOutbound HTTP to allowed hosts, within the limits set by hedy_app_outbound.
ctx.user, ctx.principalThe caller. ctx.user is null for anonymous requests. Otherwise it's the app's own end user: id, email, name, role, roles, metadata, disabled, createdAt.
ctx.secrets.getReads secrets declared in the manifest's requiredSecrets.
ctx.email.sendSends outbound email.
ctx.files, ctx.assets, ctx.modulesApp files, project assets and shared modules.
ctx.jobs, ctx.scheduleBackground jobs and schedules.
ctx.push, ctx.realtimeWeb Push and realtime channels.
ctx.track, ctx.audit.writeProduct analytics events and audit records.
ctx.crypto, ctx.environment, ctx.inboundWebhookCrypto helpers, the current environment, and inbound webhook context.

For exact shapes and limits, read the matching topic with hedy_app_docs, for example topic: "data" or topic: "auth".

Safe concurrent edits

Other people can be editing the same app. Guard every write: pass ifMatchSha256 on files, functions, modules and routes ("none" for a new path), or the editBaseToken returned by a read. If a write returns conflict or remote_changed, read again and merge. Don't overwrite. Secret values never go through the conversation: declare a name, then use hedy_app_secret_provisioning.

JSON-RPC: guarded file write
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "hedy_app_file",
    "arguments": {
      "operation": "put-small",
      "projectId": "proj_...",
      "environment": "dev",
      "path": "/about/index.html",
      "contentType": "text/html",
      "content": "<!doctype html>...",
      "ifMatchSha256": "none"
    }
  }
}
Next step

Put the concepts to work.

Every one of the 52 tools is documented by group, with operations, key parameters and a JSON-RPC example.

For AI agents: a plain-text index of these docs is at /llms.txt.