@animica/agent-core
v0.1.11
Published
Core library for the Animica Coding Agent: config, RPC, patches, repo and miner adapters.
Maintainers
Readme
@animica/agent-core
Core library that backs the animica-agent CLI and
@animica/agent-sdk SDK.
Highlights
safe-json: BigInt-safe stringify/parse, hex emit option, key-aware redactconfig: layered defaults / env / user / project / animica-node discoveryrpc: minimal RPC client withchainId,blockNumber,syncing,clientVersionhelpersrepo: read-only tree walk + grep + summarypatches: structuredPatchmodel + apply + rollback + sensitive-file guardminer: env-driven identity, metrics probe, eligibility, resource planwallet: identity, balance, ANM formatter/parser, pluggableSignerbilling: pricing, budgets, allowances, signed receipts, settlement backendsuseful-work: jobs / submissions / rewards / leaderboard / adapters
Usage
import { loadConfig, BillingEngine, OfflineSettlement } from "@animica/agent-core";
const { config, paths } = loadConfig();
const engine = new BillingEngine(paths.stateDir, config, undefined, new OfflineSettlement());
const est = engine.authorize({ kind: "code-task", premium: true });
const receipt = await engine.charge({ kind: "code-task", estimate: est, status: "estimated" });License
Apache-2.0.
