docs(store): add AI documentation - AGENTS.md and ARCHITECTURE.md#592
docs(store): add AI documentation - AGENTS.md and ARCHITECTURE.md#592Shreyas281299 merged 6 commits intowebex:nextfrom
Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
|
|
||
| ## Overview | ||
|
|
||
| `@webex/cc-store` is the shared, singleton MobX store for all Contact Center widgets. It holds global agent,session and task state, proxies SDK events, and exposes convenience APIs for fetching lists (queues, entry points, address book), task lifecycle handling, and common mutations. |
There was a problem hiding this comment.
How does it understand what SDK here is and how SDK is consumed in the Contact Center widgets ? We should add that as well before directly mentioning that it proxies SDK events.
With this text: exposes convenience APIs for fetching lists (queues, entry points, address book), are we talking about what APIs we expose from widgtes or the APIs we are using from SDK ?
There was a problem hiding this comment.
Discussed with Priya, we will be creating a knowledgbase that will provide all this information to the agent.
|
|
||
| // Option B: Let the store initialize Webex for you, best for new apps | ||
| await store.init({ | ||
| webexConfig: {/* sdk config */}, |
There was a problem hiding this comment.
Instead of saying sdk config here in bracket, can we not provide reference to dev portal documentation where it talks about what webex config looks like ? Can it read from the links attached ? And if not that then maybe we should add that information locally either here or in separate .md file
There was a problem hiding this comment.
This config would be provided in the knowledge base so Im not changing anything here. If we find that agent is unable to use this then we will re-visit this and make changes
|
|
||
| // Option A: If you already have a Webex instance, best for existing webex enabled apps | ||
| await store.init({ | ||
| webex: someWebexInstance, // must include cc |
There was a problem hiding this comment.
Same comment here, how will it understand what 'must include cc' means ? There should be a reference for what webex instance looks like
| end | ||
| Store->>SDK: register() | ||
| SDK-->>Store: Profile | ||
| Store->>Store: populate observables, feature flags |
There was a problem hiding this comment.
What do we mean by populate observable here ? I have seen the same text even in above tables. What observables are these from SDK ?
There was a problem hiding this comment.
The observable are from the mobx store which are proxied in storeEventsWrapper
| Store->>SDK: Webex.init() | ||
| SDK-->>Store: ready | ||
| Store->>Store: setupEventListeners(webex.cc) | ||
| Store->>Store: registerCC(webex) |
There was a problem hiding this comment.
Why are there multiple invocations of registerCC and register in initialization flow ?
There was a problem hiding this comment.
So we have talked about two cases here
- App pass webexInstance, here we just setup eventListeners and call registerCC
- App passes access_token, here we do webex.init, wait for ready then setup eventListeners and call registerCC.
After calling register CC, we get the agentProfile and we resolve
There was a problem hiding this comment.
There was 1 extra 'register' that ive removed
| store.refreshTaskList(); | ||
| ``` | ||
|
|
||
| ### Address Book Empty |
There was a problem hiding this comment.
Is this put as an example for one of the errors or if we are putting specific errors then complete list should be given else general guidelines for troubleshooting would be better
There was a problem hiding this comment.
Its just an example, the whole list is supposed to be provided by the SDK so it will live in the knowledge base
Kesari3008
left a comment
There was a problem hiding this comment.
Approving it but I still feel some of the context in terms ow how and what widgets is supposed to consume from SDK but it can be done later maybe.
| - **Data-fetching helpers** - Async methods that fetch domain data from SDK APIs (buddy agents, queues, entry points, address book, access token) | ||
| - **State management methods** - Setters and mutators for store observables (device type, dial number, team ID, current task, etc.) | ||
| - **Error propagation** via `setOnError` | ||
| - **Feature flags** parsing from SDK profile |
There was a problem hiding this comment.
It should say parsing from Agent's profile received from SDK
COMPLETES N/A - Documentation Enhancement
This pull request addresses
Adding AI-optimized documentation for the MobX store package to help AI assistants understand the centralized state management patterns.
by making the following changes
packages/contact-center/store/ai-docs/AGENTS.md- Usage documentation and API referencepackages/contact-center/store/ai-docs/ARCHITECTURE.md- Technical implementation details and data flowsChange Type
The following scenarios were tested
The GAI Coding Policy And Copyright Annotation Best Practices
Checklist before merging
Make sure to have followed the contributing guidelines before submitting.