@aimarket/agent
v0.1.0
Published
AI Market Protocol v2 consumer SDK for TypeScript — Electron, Node.js, web apps
Readme
@aimarket/agent
AI Market Protocol v2 consumer SDK for TypeScript — Electron, Node.js servers, and web apps.
Discover, pay for, and invoke AI capabilities from the decentralized marketplace, with production cryptography:
- Ed25519 (
ed25519:<base64>) for canonical hub / invoke signatures - EIP-712 (
keccak256+ secp256k1,eip712:0x<r><s><v>) for on-chain channel debits
Part of the AIMarket SDKs (Dart · TypeScript · Rust) — all three ship the same version and the same model shapes, enforced by an ecosystem parity guard in CI.
Install
# Today — build from source (the SDK lives in typescript/):
git clone https://github.com/alexar76/aimarket-sdks
cd aimarket-sdks/typescript && npm install && npm run build
# …then reference it via `npm link` or a `file:` dependency.
# Once published: npm install @aimarket/agent (npm registry — not live yet)Quick start
import { AimarketAgent } from '@aimarket/agent';
const agent = new AimarketAgent({
hubUrl: 'https://hub.aicom.io',
walletKey: loadYourWalletKey(),
});
// Discover capabilities for an intent — returns a ranked PlanStep[].
const plan = await agent.discover({
intent: 'ATS scoring rules for fintech roles',
budget: 1.0,
limit: 5,
});
// Open a $5 channel (good for ~50 calls), then invoke the best match.
const channel = await agent.openChannel(5.0);
const result = await agent.invoke({
capabilityId: plan[0].capability.capability_id,
input: { target_role: 'Senior PM', industry: 'fintech' },
channelId: channel.channel_id,
});
console.log('Output:', result.output, '· cost $', result.price_usd, '· TEE', result.tee_verified);
await agent.closeChannel(channel.channel_id);Links
- Ecosystem & live demos: https://alexar76.github.io/aicom/
- Protocol spec & schemas: https://github.com/alexar76/aimarket-protocol
License
MIT
