@exellix/ai-services-common
v0.3.0
Published
Shared AI-services/v1 protocol types and Fastify route plugin for Exellix AI-services
Readme
@exellix/ai-services-common
Shared AI-services/v1 protocol types, Fastify route registration, and FR invoke helpers (mapFrInvokeToRunFields for B1 input / B3 modelSelection) for Exellix AI-services (FR-AIS-1…8).
Used by:
@exellix/ai-skills-service@exellix/ai-tasks-service
import Fastify from "fastify";
import { registerAiServicesV1Routes, type AiServiceV1Adapter } from "@exellix/ai-services-common";
const adapter: AiServiceV1Adapter = {
getDescriptor: () => ({ /* …, capabilities: { itemMutation: true, … } */ }),
listItems: async () => ({ items: [] }),
getItem: async (id) => ({ id, title: id }),
invoke: async () => ({ ok: true, itemId: "", output: null }),
// optional FR-AIS-6:
// createItem, updateItem, deleteItem, runItemAction, …
};
const app = Fastify();
registerAiServicesV1Routes(app, adapter);Routes
| Method | Path | Required |
|--------|------|----------|
| GET | /ai-services/v1/descriptor | yes |
| GET | /ai-services/v1/items | yes |
| GET | /ai-services/v1/items/:id | yes |
| POST | /ai-services/v1/invoke | yes |
| POST/PATCH/DELETE | /ai-services/v1/items… | when mutation methods present |
| POST | /ai-services/v1/items/:id/actions/:action | when runItemAction present |
| subresources / export / import | see FR | when corresponding methods present |
