AI-focused documentation for the
@webex/contact-centerpackage to enable LLM agents to effectively create, modify, and fix SDK code.
The @webex/contact-center package is a Webex SDK plugin that provides a TypeScript/JavaScript API for building Contact Center agent applications. It enables:
- Agent Session Management: Register, login, logout, state changes
- Task Handling: Inbound/outbound calls, chat, transfers, conferences
- Real-time Events: WebSocket-based notifications for agent and task events
- Browser-based Calling: WebRTC integration for browser softphone
- Metrics & Diagnostics: Built-in telemetry and log upload
| Technology | Purpose |
|---|---|
| TypeScript | Primary language with strict mode |
| WebexPlugin | Base class from @webex/webex-core |
| EventEmitter | Event handling for real-time updates |
| WebSocket | Real-time communication with Contact Center |
| WebRTC | Browser-based calling (via WebCalling) |
| Jest | Unit testing framework |
| Document | Purpose |
|---|---|
| AGENTS.md | Start here - Main AI agent orchestrator (at package root) |
| RULES.md | Coding standards and conventions |
| patterns/ | Pattern documentation |
| templates/ | Code generation templates |
Start with the root AGENTS.md — it contains the full Quick Start Workflow, task classification decision tree, and critical rules.
packages/@webex/contact-center/
├── AGENTS.md # Main orchestrator (start here — at package root)
└── ai-docs/
├── README.md # This file
├── RULES.md # Coding standards
├── patterns/ # Pattern documentation
│ ├── typescript-patterns.md
│ ├── testing-patterns.md
│ └── event-driven-patterns.md
└── templates/ # Code generation templates
├── README.md
├── new-service/ # Creating new services
├── new-method/ # Adding methods
├── existing-service/ # Bug fixes, features
└── documentation/ # Doc generation
# Build
yarn workspace @webex/contact-center build:src
# Test unit tests
yarn workspace @webex/contact-center test:unit
# Test specific file
yarn workspace @webex/contact-center test:unit -- <path_of_test_file>
# Lint
yarn workspace @webex/contact-center test:stylesContactCenter (cc.ts)
└── Services (singleton)
├── agent/ → Agent operations (login, logout, state)
├── task/ → Task operations (hold, transfer, wrapup)
│ └── TaskManager → Task lifecycle
├── config/ → Configuration fetching
├── core/ → WebSocket, HTTP, utilities
├── AddressBook → Address book entries
├── EntryPoint → Entry points
└── Queue → Queues
Each service folder contains its own ai-docs/ with:
AGENTS.md- Usage examples, API reference, quick startARCHITECTURE.md- Technical details, sequence diagrams, data flow
When adding new features:
- Update the relevant service's docs (use the table above to find the right file):
- Service
AGENTS.md— if usage/API surface changed - Service
ARCHITECTURE.md— if data flow or architecture changed
- Service
- Add new patterns to
patterns/if introducing new patterns - Update
templates/if the workflow changes - Update the root
AGENTS.mdif task routing or critical rules changed