@horus-a1one/sdk
v0.5.0-intelligence.1
Published
Third-party SDK for the A1ONE AI Intelligence Engine.
Readme
@a1one/sdk
Third-party SDK for the A1ONE AI Intelligence Engine.
Zero runtime dependencies. Works in Node ≥ 18 and modern browsers.
Install
npm install @a1one/sdkQuick start
const { A1oneClient } = require('@a1one/sdk');
const a1 = new A1oneClient({
baseUrl: 'https://your-a1one-host',
apiKey: process.env.A1ONE_API_KEY, // any user-issued key from /api-keys
});
// One-shot reasoning with tool calls
const answer = await a1.reason.ask({
question: 'What is 34.5 * (21 + 7)?',
maxSteps: 4,
});
// Autonomous task (async — Executor picks it up)
const { id } = await a1.tasks.create({
goal: 'Research the top 3 open-source vector databases and write a summary.',
agentId: 'system.researcher',
budgetUsd: 0.20,
});
// Declarative workflow (DAG)
const { id: wfId } = await a1.workflows.define({
name: 'digest',
definition: {
nodes: [
{ id: 'fetch', kind: 'tool', tool: 'now', args: {} },
{ id: 'sum', kind: 'agent', agent: 'system.researcher', input: 'Digest the day using {{fetch.iso}}' },
],
edges: [{ from: 'fetch', to: 'sum' }],
},
});
const run = await a1.workflows.run(wfId, {});API surface
| Namespace | Method | Purpose |
|-------------|------------------------|-------------------------------------------|
| agents | list, create | Manage registered agents |
| tasks | create, get | Autonomous / on-demand goals |
| reason | ask | One-shot reasoning w/ tool calls |
| workflows | define, run | Persistent DAG workflows |
| tools | list, call | Discover + call any registered tool |
| prompts | list, register, render | Prompt templates |
| memory | remember, query, link | Agent memory graph |
| router | candidates, chat | Model router (pick + call) |
| evals | run | Evaluation suites |
| feedback | submit, summary | Human feedback signal |
| schedules | list, create, cancel | Cron + one-shot scheduling |
Full types
Comprehensive TS types ship in index.d.ts.
Auth
All routes require the caller to be authenticated. Two mechanisms:
- Cookie session — works out of the box in browser code hosted on the same origin as the A1ONE server.
- Bearer API key — issue one at
/api-keysin the A1ONE web UI and pass it asapiKeyin the constructor.
