@atoms-agent/core
v0.7.1
Published
Agent loop, tool runtime, event stream, context strategy, limits and cancellation
Maintainers
Readme
@atoms-agent/core
Agent loop, tool runtime, event stream, context strategy, limits, and
cancellation for atoms_agent.
This package depends on @atoms-agent/llm for model adapters and canonical
message types. It does not depend on concrete business tools, MCP, coding
toolkits, or host UI.
Install
npm install @atoms-agent/[email protected] @atoms-agent/[email protected]Local tarball (publish-ready verification):
npm install ./atoms-agent-llm-0.7.1.tgz ./atoms-agent-core-0.7.1.tgzUsage
import { createAgent, defineTool } from "@atoms-agent/core";
import { openai } from "@atoms-agent/llm";
const agent = createAgent({
model: openai({
model: "gpt-5",
apiKey: process.env.OPENAI_API_KEY!,
}),
systemPrompt: "You are a helpful assistant.",
tools: [
defineTool({
name: "ping",
description: "Return pong",
inputSchema: {
type: "object",
properties: {},
additionalProperties: false,
},
sideEffect: "none",
execute: async () => ({ ok: true }),
}),
],
});
for await (const event of agent.run("hello")) {
if (event.type === "message_delta") {
process.stdout.write(event.delta);
}
}Only import from the package root. Subpath / deep imports are not supported.
Requirements
- Node.js >= 22.13
- ESM
License
MIT
