Building an Agent
The Agents Marketplace is coming soon. This describes the planned agent format.
Agents use the Open Function Standard (OFS) format — a portable function contract that declares inputs, outputs, and dependencies. An agent is an OFS function with an AI component.
Agent structure
my-summarizer/
├── aerostack.json # OFS manifest
├── src/
│ └── index.ts # Agent logic
└── package.jsonOFS manifest
{
"name": "summarize-document",
"version": "1.0.0",
"description": "Summarize long-form text into bullets and key points",
"runtime": "workers",
"inputs": {
"text": { "type": "string", "required": true },
"maxBullets": { "type": "number", "default": 5 }
},
"outputs": {
"summary": { "type": "string" },
"bullets": { "type": "array", "items": { "type": "string" } }
},
"requires": ["ai"]
}Agent logic
// src/index.ts
export default async function({ text, maxBullets }, { sdk }) {
const result = await sdk.ai.complete({
model: 'gpt-4o-mini',
system: `Summarize documents. Return JSON with "summary" (1 sentence) and "bullets" (${maxBullets} key points).`,
prompt: text,
maxTokens: 512,
})
// Parse the JSON response
const parsed = JSON.parse(result.text)
return {
summary: parsed.summary,
bullets: parsed.bullets.slice(0, maxBullets),
}
}Publishing
# Login
aerostack login
# Publish to the marketplace
aerostack agents publish
# Your agent is available as:
# sdk.agents.run('your-username/summarize-document', { text })Versioning
# Publish a specific version
aerostack agents publish --version 1.1.0
# Users can pin to a version
aerostack agents add [email protected]Revenue share
When your agent is used by other projects, you earn revenue share based on invocation count. Configure pricing in the marketplace dashboard after publishing.