@cmssy/ai-tools
v0.26.0
Published
Transport-neutral AI tool-core shared by Cmssy Spotlight and cmssy-mcp
Readme
@cmssy/ai-tools
Transport-neutral AI tool-core shared by Cmssy Spotlight (in-process admin
assistant) and @cmssy/mcp-server (public MCP server).
Each tool is defined once - name, description, inputSchema,
requiredPermissions, and an execute(input, ops) that runs against the
abstract WorkspaceOps capability port. Each consumer supplies its own
WorkspaceOps adapter (Spotlight: in-process repositories/services; MCP: the
public GraphQL API via cs_* token) and a thin binder for its framework and
return shape.
See the RFC docs/rfc/spotlight-mcp-shared-tools.md in the cmssy repo.
Install
npm install @cmssy/ai-tools zodzod is a peer dependency.
Usage
import { AI_TOOLS, type WorkspaceOps } from "@cmssy/ai-tools";
const ops: WorkspaceOps = /* your adapter */;
for (const tool of AI_TOOLS) {
// bind tool.name / tool.description / tool.inputSchema into your framework,
// calling tool.execute(input, ops) and shaping the result for your transport.
}Contract
- Always shared:
name,description,inputSchema,requiredPermissions, and theexecuteorchestration againstWorkspaceOps. - Read/list outputs are transport-neutral domain summaries; each binder presents its own shape.
- Write/action outputs are small identity DTOs that converge across surfaces.
requiredPermissionsis enforced by Spotlight (admin session) and advisory for MCP (the public API is the gate).
