agent-quest
agent-quest
Section titled “agent-quest”A Kadi agent that runs a two-part client/server app and connects to the Kadi broker.
Overview
Section titled “Overview”agent-quest is a kadi-agent packaged project that contains a client (Vite) and a server (TypeScript) portion. The agent is described by agent.json and expects to connect to a Kadi broker (default: ws://localhost:8080/kadi). The repository provides scripts for development, build, and packaging for the AGENTS / Kadi orchestration platform.
Quick Start
Section titled “Quick Start”- Install dependencies locally
npm install- Register the agent with your Kadi environment
kadi install(kadi install reads agent.json and registers the agent with the platform/broker)
- Start the agent via Kadi
kadi run startUseful local commands
# Preflight checks (verifies node_modules exists)npm run preflight
# Install all workspace dependencies and build everythingnpm run setup
# Run both client and server in dev mode (hot reload)npm run dev
# Build client and server for productionnpm run build
# Start server only (server start script is configured under server/)npm run start
# Run tests and linters for client/servernpm run testnpm run lintnpm run type-check| Tool | Description |
|---|---|
| npm | Package manager used to install dependencies and run scripts (project uses root, client/, server/). |
| concurrently (^9.1.2) | Development helper to run client and server dev processes in parallel (used by npm run dev). |
| Vite | Client development server / build tool (invoked in client via npm run dev:client and build:client). |
| tsx | TypeScript runtime used to run server in dev mode (server dev: tsx watch src/index.ts). |
| tsc | TypeScript compiler (used in build steps and type-check script). |
| kadi | AGENTS / Kadi CLI used to install and run the agent on the orchestration platform (kadi install, kadi run start). |
Configuration
Section titled “Configuration”Primary configuration lives in agent.json at the project root. Key fields used by the agent-quest package:
- name: “agent-quest” — agent identifier
- version: “0.1.0”
- scripts: npm script shortcuts used for development and CI. Important scripts:
- preflight — verifies node_modules exists
- setup — installs all workspace dependencies and runs build
- dev / dev:client / dev:server — local development (concurrently, vite, tsx)
- build / build:client / build:server — production build steps
- start — runs server start script (prefixed to server/)
- install:all — installs root, client, and server dependencies
- build.default:
- from: “node:20-alpine” — base image used by the Kadi build container
- cli: “latest”
- run: [ “npm ci —include=dev”, “npx tsc”, “npm prune —omit=dev” ] — commands executed during image build
- env: { “NODE_ENV”: “production” } — build-time environment
- brokers:
- default: “ws://localhost:8080/kadi” — default WebSocket broker URL the agent will use to connect to Kadi
Files and paths of interest:
- agent.json (root) — agent manifest and configuration
- client/ — front-end application (Vite project)
- server/ — back-end agent runtime (TypeScript)
- server/src/index.ts — server entrypoint used by dev script (npm run dev:server uses tsx watch src/index.ts)
Architecture
Section titled “Architecture”High-level data flow and key components:
-
Client (client/):
- Built with Vite.
- Serves the browser UI, connects to the server portion or to Kadi as required by your application logic.
- Development: run via
npx vite(npm run dev:client). - Build output is produced by
npm run build --prefix client.
-
Server (server/):
- TypeScript-based agent runtime. Entry: server/src/index.ts.
- In development, server runs with tsx in watch mode (npm run dev:server).
- In production, server is built via tsc and executed from the packaged image.
-
Kadi Broker:
- agent-quest expects a Kadi broker at the websocket URL configured in agent.json (brokers.default).
- When the agent runs under the Kadi runtime, it connects to the broker and participates in messaging/orchestration.
-
Build and Deployment:
- The build section in agent.json defines a reproducible container build based on node:20-alpine.
- Build steps run npm ci (including dev dependencies), run npx tsc to compile TypeScript, and prune devDependencies before finalizing the image.
- The built artifact is intended to be deployed by the Kadi platform; kadi install registers the agent and kadi run start executes it.
Data flow summary:
- Kadi platform launches the agent image on an orchestrated node.
- Server connects to the broker at ws://localhost:8080/kadi and registers its presence/handlers.
- Client (if served by the server or hosted separately) interacts with server or broker as designed by the agent logic.
- Messages between agents and services flow via the Kadi broker channels.
Development
Section titled “Development”Local development workflow and notes:
- Install dependencies
npm run install:all# ornpm installnpm install --prefix clientnpm install --prefix server- Run preflight checks
npm run preflight- Start development servers (client + server)
npm run dev# runs concurrently:# - npm run dev:client -> cd client && npx vite# - npm run dev:server -> cd server && npx tsx watch src/index.ts- Build for production
npm run build# builds client and server artifacts:# - npm run build:client -> npm run build --prefix client# - npm run build:server -> npm run build --prefix server- Start server (production style)
npm run start# executes start script within server/ via npm run start --prefix server- Linting, testing, type checking
npm run lint # runs lint in client and server projectsnpm run test # runs tests in client and server projectsnpm run type-check # npx tsc --noEmit in client and serverBuild/CI specifics
- The build image defined in agent.json uses:
- from: node:20-alpine
- run:
- npm ci —include=dev
- npx tsc
- npm prune —omit=dev
- NODE_ENV=production is set during the build.
- Ensure your CI environment has Docker or the Kadi build runner to use this configuration.
Notes and tips
- Keep agent.json in sync with any changes to the broker URL or build steps.
- The dev workflow depends on concurrently and tsx for hot reloading; if you change those entrypoints, update the scripts in agent.json.
- If Kadi CLI is not available, ask your platform operator for the correct kadi client binary or path.
License and contact
Section titled “License and contact”Refer to the repository root for license and maintainer contact information. If you need to integrate with a specific Kadi broker endpoint, update brokers.default in agent.json before running kadi install.
Quick Start
Section titled “Quick Start”cd agent-questnpm installkadi installkadi run startConfiguration
Section titled “Configuration”agent.json
Section titled “agent.json”| Field | Value |
|---|---|
| Version | 0.1.0 |
| Type | N/A |
Brokers
Section titled “Brokers”- default:
ws://localhost:8080/kadi
Architecture
Section titled “Architecture”Development
Section titled “Development”npm installnpm run buildkadi run start