Skip to content

@makaio/contracts

Shared type contracts, Zod schemas, and bus subject namespaces for the Makaio framework. Every service domain — sessions, agents, tools, providers, and more — is defined here so consumers get a single, authoritative import path.

This is a private workspace package. Add it to a consuming workspace package with the workspace protocol:

{
"dependencies": {
"@makaio/contracts": "workspace:*"
}
}

Import domain schemas and bus subjects by domain. Most consumers use the root barrel, but granular sub-paths are available for selective imports.

import {
MakaioSessionSchema,
SessionSubjects,
AdapterSubjects,
type IMakaioSession,
} from '@makaio/contracts';
import { MakaioBus } from '@makaio/bus-core';
// Listen for session lifecycle events
MakaioBus.on(SessionSubjects.created, ({ payload }) => {
const session: IMakaioSession = MakaioSessionSchema.parse(payload);
console.log('Session created:', session.id);
});
// Parse incoming data against the canonical schema
const session = MakaioSessionSchema.parse(rawData);

Sub-path exports are also available for contract domains:

import { SessionSubjects } from '@makaio/contracts/session';
import { ConfigSubjects } from '@makaio/contracts/config';

Boot progress subjects are runtime-owned:

import { BootSubjects, BootNamespace } from '@makaio/kernel';
ExportDescription
SessionSubjects / SessionNamespaceBus subjects for session lifecycle RPCs and events
MakaioSessionSchemaZod schema for the canonical session object
AdapterSubjects / AdapterNamespaceBus subjects for adapter lifecycle (startAgent, initialized, …)
AgentSubjects / AgentNamespaceBus subjects for agent events plus RPCs such as sendMessage, toolApprove, getCapabilities, cwd.change, credential.change, model.change, and validateModelChange
ToolSubjectsBus subjects for tool approval and execution lifecycle
ConfigSubjects / ConfigSchemaBus subjects and schema for runtime config access
type IMakaioSessionCore session interface
type SessionContextContextual data attached to a running session
type Turn / TurnSchemaMessage-level turn model with usage metrics
SessionMessageSchemaNormalized stored-message model
type AgentRole / AgentRoleSchemaAgent role enumeration (lead, member)
MessageBlockSchematext, image, document, attachment, reasoning, tool_call, and tool_output block schemas
SubagentSubjectsBus subjects for subagent spawning and communication