.do
Api

RPC

Semantic remote procedure calls

Execute any function using semantic patterns.

Pattern

POST /:ns/$.Subject.action.Object
POST /:ns/:function

Examples

$.AI.generate.LeanCanvas
$.Business.analyze.competitors
$.Email.send.Message
$.User.invite.Team
$.Agent.execute.Workflow

Usage

POST https://apis.do/acme.com/ai.generateLeanCanvas
{
  "businessIdea": "AI scheduling assistant",
  "targetMarket": "Small businesses"
}

Response:

{
  "leanCanvas": {
    "problem": ["Manual scheduling", "Double bookings"],
    "solution": ["AI scheduling", "Conflict resolution"],
    "uniqueValueProposition": "Never miss a meeting",
    "customerSegments": ["Small businesses", "Consultants"],
    "keyMetrics": ["Meetings scheduled", "Time saved"],
    "channels": ["Web app", "Mobile app", "Calendar integrations"],
    "costStructure": ["Development", "Infrastructure"],
    "revenueStreams": ["Subscription fees"]
  }
}

SDK

import { $ } from 'sdk.do'

const client = $('acme.com')

// Semantic pattern
const canvas = await client.$.AI.generate.LeanCanvas({
  businessIdea: 'AI scheduling assistant',
  targetMarket: 'Small businesses'
})

// Function call
const result = await client.rpc('ai.generateLeanCanvas', {
  businessIdea: 'AI scheduling assistant'
})

Common Functions

AI Operations

// Generate
await client.$.AI.generate.LeanCanvas(input)
await client.$.AI.generate.BusinessPlan(input)
await client.$.AI.generate.MarketingCopy(input)

// Analyze
await client.$.AI.analyze.Competitors(input)
await client.$.AI.analyze.Sentiment(input)
await client.$.AI.analyze.Financials(input)

// Summarize
await client.$.AI.summarize.Document(input)
await client.$.AI.summarize.Meeting(input)

Business Operations

await client.$.Business.create.Subsidiary(input)
await client.$.Business.analyze.Market(input)
await client.$.Business.generate.Report(input)
await client.$.Business.calculate.Metrics(input)

Email Operations

await client.$.Email.send.Message(input)
await client.$.Email.send.Bulk(input)
await client.$.Email.schedule.Message(input)

User Operations

await client.$.User.invite.Team(input)
await client.$.User.reset.Password(input)
await client.$.User.verify.Email(input)

Custom Functions

Define your own:

// workers/rpc/src/index.ts
export default {
  async fetch(request: Request, env: Env) {
    const url = new URL(request.url)
    const fn = url.pathname.slice(1)

    if (fn === '$.Custom.analyze.data') {
      const input = await request.json()
      const result = await analyzeData(input, env)
      return Response.json(result)
    }
  }
}

Use it:

await client.$.Custom.analyze.data({ data: [...] })