@aglit-ai/sdk-typescript
v0.1.6
Published
Generated TypeScript client for the Aglit AI APIs
Readme
@aglit-ai/sdk-typescript
TypeScript/JavaScript client package.
- Requires the Aglit AI desktop app/API running locally (set
SERVER_PORT/PORT/AGLIT_DESKTOP_BASE_URL). - Source of truth lives in the parent
@aglit-ai/sdk(custom runtime + examples). - Generated OpenAPI clients (if desired) land in
generated/viapnpm --filter @aglit-ai/sdk run generate:languages -- --langs typescript --run. - Publish target: npm.
Publishing hint:
- Build from the parent:
pnpm --filter @aglit-ai/sdk run build - If using generated clients, ensure
generated/is included infilesbefore publishing.
Install
pnpm add @aglit-ai/sdk-typescript
# or: npm install @aglit-ai/sdk-typescriptExample: create chat (root agent)
import { Configuration, ChatsApi } from './generated/desktop';
const SERVER_PORT = process.env.SERVER_PORT ?? '49217';
const api = new ChatsApi(new Configuration({ basePath: `http://127.0.0.1:${SERVER_PORT}` }));
async function main() {
const res = await api.createChat({
agentId: 'root-agent',
initialText: 'Say hello from @aglit-ai/sdk-typescript',
});
console.log('chat id', res.data?.chat?.id);
}
main().catch(err => console.error(err));