@aglit-ai/sdk-javascript
v0.1.6
Published
Generated JavaScript client for the Aglit AI APIs
Downloads
376
Readme
@aglit-ai/sdk-javascript
JavaScript client package generated from the Aglit AI OpenAPI specs.
- Generated code is under
generated/(desktop + tools APIs). - Publish target: npm.
- Requires the Aglit AI desktop app/API running locally (set
SERVER_PORT/PORT/AGLIT_DESKTOP_BASE_URL).
Notes:
- Code is generated via
pnpm --filter @aglit-ai/sdk run generate:languages -- --langs javascript --run. - This package ships the generated JS source; no build step required beyond generation.
Install
npm install @aglit-ai/sdk-javascript
# or: pnpm add @aglit-ai/sdk-javascriptExample: create chat (root agent)
import { Configuration, ChatsApi } from './generated/desktop/index.js';
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: 'Hello from @aglit-ai/sdk-javascript',
});
console.log('chat id', res.data?.chat?.id);
}
main().catch(err => console.error(err));