Execution Contexts
The .as domain system for URL-based polymorphism
Execution Contexts
Core Insight: The .as domains provide execution contexts that determine HOW an entity renders.
{context}.as/{$id}The .as literally means "as a" - rendering the entity as that type.
URL Polymorphism
The same entity renders differently based on context:
stripe.com # Stripe's own site
site.as/stripe.com # Stripe as generic Site
docs.as/stripe.com # Stripe as DocsSite
agent.as/stripe.com # Stripe's Agent interface
saas.as/stripe.com # Stripe as SaaSApp
marketplace.as/stripe.com # Stripe as MarketplaceSite
sdk.as/stripe.com # Stripe's SDK documentationThe pattern:
{how}.as/{what}
docs.as/my-startup.com = "my-startup.com AS docs"
agent.as/my-startup.com = "my-startup.com AS agent"
saas.as/my-startup.com = "my-startup.com AS saas"Context Domains
Site Contexts
| Domain | Context Type | Renders Entity As |
|---|---|---|
site.as | Site | Generic site |
page.as | Page | Single page |
pages.as | Pages | Multi-page site |
blogs.as | BlogSite | Blog with posts |
docs.as | DocsSite | Documentation |
wiki.as | WikiSite | Wiki/knowledge base |
directories.as | DirectorySite | Directory listing |
marketplace.as | MarketplaceSite | Marketplace |
videos.as | VideoSite | Video content |
waitlist.as | WaitlistPage | Waitlist/signup |
forms.as | FormPage | Form/survey |
App Contexts
| Domain | Context Type | Renders Entity As |
|---|---|---|
apps.as | App | Generic app |
saas.as | SaaSApp | SaaS dashboard |
database.as | AdminApp | Database editor |
functions.as | FunctionsApp | Serverless functions |
workflows.as | WorkflowApp | Workflow automation |
webhooks.as | WebhooksApp | Webhook management |
queue.as | QueueApp | Task queue |
AI/Agent Contexts
| Domain | Context Type | Renders Entity As |
|---|---|---|
agent.as | AgentSite | Agent interface |
agi.as | AGISite | AGI agent |
gpts.as | GPTSite | GPT agent |
assistant.as | AssistantApp | Assistant UI |
task.as | TaskApp | Task execution |
Development Contexts
| Domain | Context Type | Renders Entity As |
|---|---|---|
sdk.as | SDKSite | SDK documentation |
mdx.as | MDXRenderer | Raw MDX rendering |
src.as | SourceView | Source code viewer |
proxy.as | ProxyService | Proxy/API gateway |
Meta Contexts
| Domain | Context Type | Renders Entity As |
|---|---|---|
ctx.as | Context | Context provider (meta) |
ing.as | Activity | Activity/gerund view |
The Activity Context (ing.as)
The ing.as domain renders the activity view of any action. Remember the Verb grammar:
| Verb Property | Example |
|---|---|
activity | creating, approving, deploying |
So ing.as shows live activity/progress:
ing.as/creating/mystartup.com # "Creating mystartup.com" - live progress
ing.as/deploying/my-api # "Deploying my-api" - deployment status
ing.as/approving/invoice-123 # "Approving invoice-123" - approval flowThis renders the gerund form of any action being performed on an entity.
Studios vs Contexts vs Management
The domain system has three layers:
Studios (.studio) - Create & Manage
Where you create and manage businesses:
| Studio | Domain | Purpose |
|---|---|---|
| Startups.Studio | startups.studio | Venture studio - portfolio of startups |
| SaaS.Studio | saas.studio | SaaS builder - create SaaS products |
| Services.Studio | services.studio | Services builder - create service businesses |
| Management.Studio | management.studio | Business ops - manage any business |
Contexts (.as) - Render As
How entities render in different contexts:
# Same entity, different contexts
site.as/acme.com # Acme as a Site
docs.as/acme.com # Acme as Docs
agent.as/acme.com # Acme as Agent
saas.as/acme.com # Acme as SaaS AppManagement (.management) - Operate At Scale
Platforms for operating at scale:
| Platform | Domain | Purpose |
|---|---|---|
| API.Management | api.management | Manage APIs across products |
| Agents.Management | agents.management | Manage AI agent fleets |
Architecture Diagram
┌─────────────────────────────────────────────────────────────┐
│ STUDIOS (.studio) - Create & Manage │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Startups │ │ SaaS │ │ Services │ │
│ │ .Studio │ │ .Studio │ │ .Studio │ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │ │
│ └───────────────┼───────────────┘ │
│ ▼ │
│ ┌─────────────────────┐ │
│ │ Business ($id) │ │
│ │ e.g. acme.com │ │
│ └──────────┬──────────┘ │
└─────────────────────────┼───────────────────────────────────┘
│
┌─────────────────────────┼───────────────────────────────────┐
│ CONTEXTS (.as) - Render As │
│ ▼ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ site.as/acme.com → Site │ │
│ │ docs.as/acme.com → DocsSite │ │
│ │ blogs.as/acme.com → BlogSite │ │
│ │ agent.as/acme.com → AgentSite │ │
│ │ saas.as/acme.com → SaaSApp │ │
│ │ apps.as/acme.com → App │ │
│ │ sdk.as/acme.com → SDKSite │ │
│ │ workflows.as/acme.com → WorkflowApp │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
┌─────────────────────────┼───────────────────────────────────┐
│ MANAGEMENT (.management) - Operate At Scale │
│ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ API │ │ Agents │ │ Management │ │
│ │ .Management │ │ .Management │ │ .Studio │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘The Complete URL Architecture
A single business exists across all domain patterns:
acme.com (the business $id)
│
├── STUDIOS (where you build/configure)
│ {entity}.{studio}.studio
│ ├── acme.startups.studio → Startup lifecycle
│ ├── acme.saas.studio → Product builder
│ ├── acme.services.studio → Service builder
│ └── acme.management.studio → Operations
│
├── CONTEXTS (where users experience)
│ {context}.as/{$id}
│ ├── site.as/acme.com → Marketing site
│ ├── docs.as/acme.com → Documentation
│ ├── agent.as/acme.com → Agent interface
│ ├── saas.as/acme.com → SaaS app
│ └── sdk.as/acme.com → SDK docs
│
├── ACTIVITIES (where work happens)
│ {object}.{verb}.ing.as/{context}/{role}
│ ├── ticket.triag.ing.as/acme/support
│ ├── invoice.approv.ing.as/acme/finance
│ └── code.review.ing.as/acme/developer
│
└── MANAGEMENT (where you operate at scale)
{domain}.management.studio/{entity}
├── apis.management.studio/acme
└── agents.management.studio/acmePattern Summary
| Layer | Pattern | Example |
|---|---|---|
| Studios | {entity}.{studio}.studio | acme.saas.studio |
| Contexts | {context}.as/{$id} | docs.as/acme.com |
| Activities | {object}.{verb}.ing.as/{context}/{role} | invoice.approv.ing.as/acme/manager |
| Management | {domain}.management.studio/{entity} | apis.management.studio/acme |
Implementation
When a request comes to {context}.as/{$id}:
- Resolve the entity - Fetch the MDXLD document for
$id - Determine the context - Map the
.asdomain to a Site/App type - Render with context - Use the appropriate components for that type
// Pseudocode
async function handleRequest(url: URL) {
const context = getContextFromDomain(url.host) // docs.as → DocsSite
const entityId = url.pathname.slice(1) // /stripe.com → stripe.com
const entity = await fetchEntity(entityId) // Fetch MDXLD
return render(entity, { context }) // Render as DocsSite
}
function getContextFromDomain(host: string): ContextType {
const contextMap = {
'site.as': 'Site',
'docs.as': 'DocsSite',
'blogs.as': 'BlogSite',
'agent.as': 'AgentSite',
'saas.as': 'SaaSApp',
'apps.as': 'App',
// ...
}
return contextMap[host] || 'Site'
}Context Inheritance
Contexts follow the same inheritance pattern as components:
// DocsSite inherits from Site
interface DocsSiteProps extends SiteProps {
// Adds docs-specific props
tree: DocTree
search: SearchConfig
}
// When rendering docs.as/acme.com:
// 1. Load acme.com entity
// 2. Apply DocsSite context (adds tree, search defaults)
// 3. Render with DocsSite componentsComposing Contexts
Some entities naturally span multiple contexts:
# acme.com MDXLD
$type: Business
$id: https://acme.com
name: Acme Corp
# This entity has:
site: https://acme.com # Marketing site
docs: https://docs.acme.com # Documentation
app: https://app.acme.com # SaaS app
api: https://api.acme.com # API
agent: https://agent.acme.com # Agent interfaceThe .as domains let you access any of these views for ANY entity:
# Direct URLs (entity-controlled)
acme.com # Entity's own site
docs.acme.com # Entity's own docs subdomain
# Context URLs (platform-controlled)
site.as/acme.com # Platform renders entity as Site
docs.as/acme.com # Platform renders entity as DocsThis enables:
- Discovery - Find any entity's docs at
docs.as/{entity} - Consistency - Same UI patterns across all entities
- Fallbacks - If entity doesn't have docs, platform generates them