services-as-software
AI-powered services that operate as software
npm install services-as-softwarePrimitives for building AI-powered services that cross business boundaries with pricing, SLAs, and autonomous delivery.
import { Service, POST, Client } from 'services-as-software'
const translationService = Service({
name: 'translation-service',
version: '1.0.0',
pricing: {
model: 'per-use',
pricePerUnit: 0.01,
currency: 'USD',
},
endpoints: [
POST({
name: 'translate',
path: '/translate',
handler: async (input) => ({
translatedText: `Translated: ${input.text}`,
confidence: 0.95,
}),
}),
],
})
// Use the service
const result = await translationService.call('translate', {
text: 'Hello, world!',
to: 'es',
})Core Primitives
Service()— Define services with endpoints, pricing, and business logicClient()— Connect to remote servicesProvider()— Manage multiple servicesPOST(),GET(),PUT(),DELETE()— HTTP method helpers
Service Operations
ask(),do(),generate()— Execute tasksquote(),order(),subscribe()— Commerce operationson(),every()— Events and schedulingkpis(),okrs(),entitlements()— Business metrics
Entity Definitions (Nouns)
Comprehensive entities for AI-delivered productized services:
| Category | Entities |
|---|---|
| Services | ProductizedService, ServiceOffering, ServicePlan, ServiceInstance, ServiceExecution |
| Delivery | AgentDelivery, AutonomyLevel, EscalationRule, ConfidenceThreshold, HumanHandoff, QualityGate |
| Billing | ServiceQuote, ServiceOrder, ServiceSubscription, Usage, Invoice, Payment |
| Operations | SLA, SLO, ServiceIncident, SupportTicket, ServiceFeedback, ServiceMetric |
| Customers | ServiceCustomer, ServiceEntitlement, CustomerUsage, CustomerSegment |
| Orchestration | ServiceWorkflow, WorkflowStep, ServiceTask, ServiceQueue, ServiceWorker |
import { AgentDelivery, ProductizedService } from 'services-as-software'
console.log(AgentDelivery.properties.autonomyLevel)
// { type: 'string', examples: ['full', 'supervised', 'assisted', 'advisory'] }Related
- Service Primitive — Full documentation
- ai-workflows — Service implementations
- business-as-code — Business integration
- digital-workers — Worker primitives
Was this page helpful?