@dzapio/ai
v0.0.1
Published
DZap SDK and CLI for agent execution and wallet-aware prompts.
Readme
DZapAI SDK and CLI
This repository exposes:
- A reusable SDK for TypeScript and JavaScript apps.
- A
dzapCLI for command-line workflows. - An optional Express server wrapper.
Build
npm run buildPrivate Tester Distribution (No Repo Access)
Create a distributable package that includes only compiled artifacts:
npm run pack:testerThis generates dzapai-<version>.tgz.
Tester install commands:
# CLI (global)
npm install -g ./dzapai-<version>.tgz
dzap
# SDK (inside tester project)
npm install ./dzapai-<version>.tgzNote: API keys should be provided via environment variables in tester machines.
SDK Usage
import { DZapSDK } from "dzapai";
const sdk = new DZapSDK();
await sdk.initialize({
startupPassword: "alohomora",
initializeRetrieval: true,
syncProviders: false
});
const result = await sdk.ask({
userQuery: "Show my balances",
metadata: {
accountInfo: [
{ blockchain: "evm", chain: "1", user_account: "0xabc..." }
]
}
});
console.log(result.finalText);You can also set DZAP_STARTUP_PASSWORD=alohomora and omit startupPassword in initialize(...).
SDK Tool Access
const tools = sdk.listTools();
console.log(tools.map((tool) => tool.name));
const priceTool = sdk.getTool("PriceTool");
const priceResult = await priceTool.execute({
tokenAddresses: "0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
chainId: 1
});
console.log(priceResult);CLI Usage
DzapAIOn startup it first asks for a password (alohomora), then runs the profile phase (wallet/chain/blockchain), saves the profile, and opens the interactive shell.
Use normal text for AI prompts and slash commands for actions:
>> what are top pools on chain 1?
>> /tools
>> /tool PriceTool {"tokenAddresses":"0xA0...","chainId":1}
>> /set wallet 0xabc...
>> /set chain 1
>> /session history
>> /exitServer Usage
npm run dev
npm startSet DZAP_STARTUP_PASSWORD=alohomora in your environment (or .env) before starting the server.
Server entrypoint: src/server/index.ts.
