@moxxy/core is the moxxy runtime. It depends on @moxxy/sdk and @moxxy/tools-builtin — nothing else internal. Plugins are loaded dynamically; core never imports them statically.
What's exported
Session
Session is the top-level container. Holds the event log, the registries (tools, providers, modes, compactors, skills), the permission engine and resolver, the hook dispatcher, and the plugin host.
ts
import { Session, autoAllowResolver } from '@moxxy/core';
const session = new Session({
cwd: process.cwd(),
permissionResolver: autoAllowResolver,
});Loop driver
ts
import { runTurn, collectTurn } from '@moxxy/core';
// Async iterable over every emitted event:
for await (const event of runTurn(session, 'do thing')) {
console.log(event.type);
}
// Or collect them all:
const events = await collectTurn(session, 'do thing');Selectors
Pure folds over the event log:
selectMessages(log, opts?)— projected provider message history (honors compactions)selectPendingToolCalls(log)— unresolved tool callsselectCurrentTurn(log)— the latest turn idselectLoadedPlugins(log)— registered plugin recordsselectActiveSkillIds(log)— skills invoked this sessionestimateTokens(messages)— rough char/4 token estimateisToolCallResolved(callId, log)— has the call been answered?findEvent(log, type, predicate)— search by type + predicate
Skills
discoverSkills(opts)— walk project/user/plugin/builtin directoriesSkillRouter— match a prompt against loaded skillssynthesizeSkill(session, intent, scope, opts)— agent-driven skill creationbuildSynthesizeSkillPlugin(session)— registerssynthesize_skill+reload_skillstools
Plugin host
PluginHost— register plugins statically or via discovery; hot-reloadcreatePluginLoader({cwd})— jiti-backed loader (loads.tsplugin entries directly in dev)discoverPlugins(opts)— scanpackage.json#moxxy.pluginacrossnode_modulesand parent dirs
Permissions
PermissionEngine— file-policy-backed allow/deny checker (~/.moxxy/permissions.json)autoAllowResolver,denyByDefaultResolver,createAllowListResolver,createCallbackResolver— pre-built resolvers
