Skip to content

docs(station-login): add AI documentation - AGENTS.md and ARCHITECTURE.md#575

Merged
Shreyas281299 merged 10 commits intowebex:nextfrom
ciscoRankush:docs/ai-docs-station-login
Feb 4, 2026
Merged

docs(station-login): add AI documentation - AGENTS.md and ARCHITECTURE.md#575
Shreyas281299 merged 10 commits intowebex:nextfrom
ciscoRankush:docs/ai-docs-station-login

Conversation

@ciscoRankush
Copy link
Contributor

@ciscoRankush ciscoRankush commented Dec 11, 2025

COMPLETES N/A - Documentation Enhancement

This pull request addresses

Adding AI-optimized documentation for the station-login widget to help AI assistants understand the agent login workflow with team and device selection.

by making the following changes

  • Added packages/contact-center/station-login/ai-docs/AGENTS.md - Usage documentation, props, and examples
  • Added packages/contact-center/station-login/ai-docs/ARCHITECTURE.md - Technical implementation and component flow

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

Screenshot 2026-02-04 at 11 14 50 AM Screenshot 2026-02-04 at 11 15 29 AM Screenshot 2026-02-04 at 11 25 18 AM Screenshot 2026-02-04 at 11 25 31 AM Screenshot 2026-02-04 at 11 25 49 AM Screenshot 2026-02-04 at 11 25 58 AM
  • The testing is done with the amplify link

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify: Cursor AI
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

Checklist before merging

  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the testing document
  • I have tested the functionality with amplify link

Make sure to have followed the contributing guidelines before submitting.

@aws-amplify-us-east-2
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-575.d1b38q61t1z947.amplifyapp.com

Copy link
Contributor

@rarajes2 rarajes2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have reviewed AGENTS.md only. Will do a 2nd round of review for ARCHITECTURE.md file


## Overview

The Station Login widget provides a user interface for contact center agents to log in and out of their station. It handles device type selection (Extension, Mobile, Browser), team selection, and agent profile management. The widget integrates with the Webex Contact Center SDK and follows the standard three-layer architecture pattern (Widget → Hook → Component → Store).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Text could be improved and some fixes are required on the type of station login. Please refer this.

Also let's use StationLogin as a single word everywhere in this file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

The Station Login widget enables contact center agents to:
- **Login to their station** with appropriate device settings
- **Select their team** from available teams
- **Choose device type** (Extension, Agent DN, Browser-based)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. For device type we use Desktop instead of Browser

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

- **Login to their station** with appropriate device settings
- **Select their team** from available teams
- **Choose device type** (Extension, Agent DN, Browser-based)
- **Logout from their station** when ending their shift
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when ending their shift can be removed or improved with more info such as "to login to another voice mode"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, we can improve this

- **Choose device type** (Extension, Agent DN, Browser-based)
- **Logout from their station** when ending their shift
- **Update their profile settings** while logged in (profile mode)
- **Handle multiple login scenarios** with continuation prompts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think this is possible

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

- **Select their team** from available teams
- **Choose device type** (Extension, Agent DN, Browser-based)
- **Logout from their station** when ending their shift
- **Update their profile settings** while logged in (profile mode)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update their profile settings --> change station login mode.

This handles logout and login to another mode implicitly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Comment on lines 226 to 228
import { StationLogin } from '@webex/cc-station-login';
import { observer } from 'mobx-react-lite';
import store from '@webex/cc-store';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

const { isAgentLoggedIn, teams, deviceType } = store;

if (isAgentLoggedIn) {
return <AgentDesktop />;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is <AgentDesktop /> ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect, will fix this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated sample code

Comment on lines 295 to 304
| Prop | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `profileMode` | `boolean` | Yes | - | Shows save button (true) or login/logout (false) |
| `onLogin` | `() => void` | No | - | Callback when login succeeds |
| `onLogout` | `() => void` | No | - | Callback when logout succeeds |
| `onCCSignOut` | `() => void` | No | - | Callback when CC sign out is triggered |
| `onSaveStart` | `() => void` | No | - | Callback when profile save starts |
| `onSaveEnd` | `(success: boolean) => void` | No | - | Callback when profile save ends |
| `teamId` | `string` | No | - | Default team ID |
| `doStationLogout` | `boolean` | No | `true` | Perform station logout on CC sign out |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the default values where required

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated only profileMode was missing


```bash
# Install as part of contact center widgets
yarn add @webex/cc-station-login
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think we are allowing individual widgets to be installed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do this. Yes there are pre-requisite to this, but this is possible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but will we ever use it this way ? if we document it like this Agent will write code referencing this so, please see if want to keep it like this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

yarn add @webex/cc-station-login

# Or install the entire widgets bundle
yarn add @webex/cc-widgets
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also mention npm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated


```typescript
// Check if store has CC instance
import store from '@webex/cc-store';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be import from @webex/cc-widgets

Comment on lines 404 to 405
const cc = await ContactCenter.init({ token, region });
store.setCC(cc);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be fixed

console.log('Logger:', store.logger); // Should be defined

// Enable detailed logging
store.logger.setLevel('debug');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Store doesnt have this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing logger is not a possible cause

│ └── station-login/
│ └── index.tsx # Widget tests
├── ai-docs/
│ ├── agent.md # Overview, examples, usage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be agents.md


## Component Overview

The Station Login widget follows the three-layer architecture pattern: **Widget → Hook → Component → Store → SDK**. This architecture separates concerns between state management, business logic, and presentation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Station Login" --> "StationLogin"

Applicable everywhere in this file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


## Component Overview

The Station Login widget follows the three-layer architecture pattern: **Widget → Hook → Component → Store → SDK**. This architecture separates concerns between state management, business logic, and presentation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

three-layer architecture pattern: Widget → Hook → Component → Store → SDK.

This sentence is bit confusing. We should improve and make it easy to understand.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check now


| Layer | Component | File | Config/Props | State | Callbacks | Events | Tests |
|-------|-----------|------|--------------|-------|-----------|--------|-------|
| **Widget** | `StationLogin` | `src/station-login/index.tsx` | `StationLoginProps` | N/A (passes through) | `onLogin`, `onLogout`, `onCCSignOut`, `onSaveStart`, `onSaveEnd` | SDK events (via store) | `tests/station-login/index.tsx` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Values for the config/props are case sensitive. I think the values are populated with the types instead of the actual props names. Please check all the values once

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, Ive updated this


| Component | SDK Methods Used | SDK Events Subscribed | Store Methods Used |
|-----------|------------------|----------------------|-------------------|
| **useStationLogin Hook** | `stationLogin()`, `stationLogout()`, `updateAgentProfile()`, `deregister()` | `AGENT_STATION_LOGIN_SUCCESS`, `AGENT_LOGOUT_SUCCESS` | `setCCCallback()`, `removeCCCallback()`, `setShowMultipleLoginAlert()`, `registerCC()` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Hook" can be changed to "hook" and moved out of bold marker

| Component | SDK Methods Used | SDK Events Subscribed | Store Methods Used |
|-----------|------------------|----------------------|-------------------|
| **useStationLogin Hook** | `stationLogin()`, `stationLogout()`, `updateAgentProfile()`, `deregister()` | `AGENT_STATION_LOGIN_SUCCESS`, `AGENT_LOGOUT_SUCCESS` | `setCCCallback()`, `removeCCCallback()`, `setShowMultipleLoginAlert()`, `registerCC()` |
| **Store** | All SDK methods | All SDK events | N/A |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update with more specific details ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we would want the Store methods to be looked up in the store/ai-docs/agents.md, Thats the the reference is there. So we are consciously avoiding to add SDK methods and events here

Comment on lines 44 to 48
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript config
├── webpack.config.js # Webpack build config
├── jest.config.js # Jest test config
└── eslint.config.mjs # ESLint config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also have babel.config.js file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

Comment on lines +59 to +74
```mermaid
graph TB
subgraph "Presentation Layer"
Widget[StationLogin Widget]
Component[StationLoginComponent]
end

subgraph "Business Logic Layer"
Hook[useStationLogin Hook<br/>helper.ts]
end

subgraph "State Management Layer"
Store[Store Singleton]
end

subgraph "SDK Layer"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a screenshot of this flow in the PR description

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

Comment on lines +145 to +156
```mermaid
sequenceDiagram
actor User
participant Widget as StationLogin Widget
participant Hook as useStationLogin Hook
participant Component as StationLoginComponent
participant Store
participant SDK

User->>Widget: Load widget
activate Widget
Widget->>Hook: useStationLogin()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, we can add the screenshot in the PR description.

Applicable for all the mermaid sequence diagrams

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


---

## Troubleshooting Guide
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep this inside the architecture file ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have kept all the troubleshooting in the architecture. This is just as a POC, if we find that troubleshooting is not working in architecture.md then we will move it somewhere else, but for now we have made a decision to put it in the architecture.md

@Shreyas281299 Shreyas281299 added the validated Indicates that the PR is ready for actions label Feb 2, 2026
Copy link
Contributor

@rarajes2 rarajes2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Shreyas281299 Shreyas281299 merged commit c69f2e5 into webex:next Feb 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated Indicates that the PR is ready for actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants