This example lives in the monorepo, but it intentionally uses the published npm package:
npm install agent-controlIt demonstrates how an external TypeScript app can consume Agent Control without using local workspace linking.
Use an agent-control npm version compatible with your server version (this example currently pins 0.2.0).
- Node.js 20+
- Agent Control server running (from repo root):
make server-run
- Optional API key (if server auth is enabled). This example creates, updates, and deletes
controls, so it must be an admin key:
export AGENT_CONTROL_API_KEY=your-admin-api-key
If you started the full local stack with the repo-root docker-compose.yml, the default
admin key is 29af8554a1fe4311977b7ce360b20cc3.
cd examples/typescript_sdk
npm install
AGENT_CONTROL_URL=http://localhost:8000 npm run startIf your server requires auth:
AGENT_CONTROL_URL=http://localhost:8000 AGENT_CONTROL_API_KEY=your-admin-api-key npm run startThe script in src/quickstart.ts performs:
- SDK init with server URL and optional admin API key
- health check request
- list controls request
- create control request
- set/get control data requests (regex evaluator example)
- cleanup delete of the created control
npm run typecheck