Skip to content

AxmeAI/axme-sdk-typescript

axme-sdk-typescript

TypeScript SDK for AXME - send intents, listen for deliveries, resume workflows. Fully typed, Promise-based, works in Node.js and edge runtimes.

Alpha npm License

Quick Start · Docs · Examples


Install

npm install @axme/axme

Requires Node.js 20+.


Quick Start

import { AxmeClient } from "@axme/axme";

const client = new AxmeClient({ apiKey: "axme_sa_..." });

// Send an intent - survives crashes, retries, timeouts
const intent = await client.createIntent(
  {
    intent_type: "order.fulfillment.v1",
    to_agent: "agent://myorg/production/fulfillment-service",
    payload: { order_id: "ord_123" },
  },
  { idempotencyKey: "fulfill-ord-123-001" }
);

// Wait for resolution
const result = await client.waitFor(intent.intent_id);
console.log(result.status);

Connect an Agent

for await (const delivery of client.listen("agent://myorg/production/my-agent")) {
  const intent = await client.getIntent(delivery.intent_id);
  const result = await process(intent.payload);
  await client.resumeIntent(delivery.intent_id, result);
}

Human Approvals

const intent = await client.createIntent({
  intent_type: "intent.budget.approval.v1",
  to_agent: "agent://myorg/prod/agent_core",
  payload: { amount: 32000 },
  human_task: {
    task_type: "approval",
    notify_email: "approver@example.com",
    allowed_outcomes: ["approved", "rejected"],
  },
});
const result = await client.waitFor(intent.intent_id);  // waits until human acts

8 task types: approval, confirmation, review, assignment, form, clarification, manual_action, override. Full reference: axme-docs.


Observe Lifecycle Events

for await (const event of client.observe(intent.intent_id)) {
  console.log(event.event_type, event.status);
  if (["RESOLVED", "CANCELLED", "EXPIRED"].includes(event.status)) break;
}

Examples

export AXME_API_KEY="axme_sa_..."
npx tsx examples/basic-submit.ts

More: axme-examples


Development

npm install
npm test

Related

axme-docs API reference and integration guides
axme-examples Runnable examples
axp-spec Protocol specification
axme-cli CLI tool
axme-conformance Conformance suite

hello@axme.ai · Security · License

About

TypeScript SDK for AXME — send intents, listen for deliveries, resume workflows. npm install @axme/axme

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors