@boringos/module-sdk
v1.0.0
Published
Module SDK — types for the Skills + Tools + Modules architecture.
Downloads
159
Readme
@boringos/module-sdk
Public type surface for v2 Modules. Every connector, capability,
hybrid app, and built-in subsystem in v2 is shaped as a Module
declared with these types.
What's in this package
Module— the universal manifest shapeTool,ToolContext,ToolResult,ToolError— callable operationsSkill,SkillSource,SkillApplicabilityEvent— markdown teaching loaded into the agent's promptRoutine,RoutineTrigger— scheduled tool callsWebhook,WebhookRequest— inbound HTTPOAuthConfig— connector OAuth danceMigration,ModuleDb— Module-owned DDLModuleUI,ScreenDef,PanelDef— browser-facing surfaceModuleLifecycle,ModuleContext— install / uninstall hooksModuleFactory,ModuleFactoryDeps— factory shape for service-aware ModulesWorkflowSeed,WorkflowBlock,WorkflowEdge— default workflows seeded on installAgentSeed— default agents seeded on installz— re-export of Zod for input/output schemas
This package exports types only (plus the Zod re-export).
Registries, dispatch, and prompt assembly live in
@boringos/agent and @boringos/core.
Conventions third-party authors must follow
The types here permit many shapes; the framework's runtime expects
some choices to be made consistently so every module composes with
the Shell, Copilot, workflow templating ({{blockName.field}}),
and other modules' tools.
- Tool result payload shape. Successful results follow a
single rule: list-style tools return a named-key object keyed
by the plural resource (
{ result: { messages } },{ result: { events } },{ result: { deals } }); singular tools return the value directly ({ result: message }). SeeTOOLS.md→ Result payload convention for the full rule and rationale. - Error shape. Expected failures always return
{ ok: false, error: ToolError }; unhandled bugs throw and the dispatcher converts tocode: "internal". SeeToolError/ToolErrorCodeabove. tenantIdis inToolContext, never in inputs. Handlers read it from context for DB scoping and audit; clients can't forge it.
Imported by
Every v2 Module — built-in (@boringos/core/src/v2-modules/*)
and third-party.
Minimal usage
import { z } from "@boringos/module-sdk";
import type { Module } from "@boringos/module-sdk";
export const helloModule: Module = {
id: "hello",
name: "Hello",
version: "0.1.0",
description: "Demo module — one tool, one skill",
skills: [
{
id: "hello",
source: "module",
body: "Use `hello.greet` to say hi to someone by name.",
},
],
tools: [
{
name: "greet",
description: "Greet someone by name",
inputs: z.object({ name: z.string() }),
async handler({ name }) {
return { ok: true, result: { message: `Hello, ${name}!` } };
},
},
],
};Register it on the host:
import { BoringOS } from "@boringos/core";
import { helloModule } from "./hello.js";
const app = new BoringOS({ /* config */ });
app.module(helloModule);
await app.listen(3000);See also
MODULES.md— full Module specTOOLS.md— Tool spec, error model, auditSKILLS.md— Skill spec, priorities, overridesBUILD-A-MODULE.md— step-by-step guide
