Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.2.3] - 2026-09-XX
Fixed
- PKCE popup authentication —
PKCEAuthStrategyomitsnextRouteand OAuthstatewhenauthSchemeispopup, matching legacy cc-widgetauth.tsbehavior. Preventsauth-redirect.htmlfrom bouncing the MSAL popup to the app URL and triggering MSALblock_nested_popupsduring cc-widget bootstrap. Redirect flow is unchanged (statestill carries the return URL). - Auth token propagation — new
finishAuthenticationcallback syncs the access token from the active auth strategy viaAuthenticationService.getToken()beforeonAuthComplete, fixing cases where strategy callbacks supplied tokens that were not cached inAuthenticationService(e.g. anonymous → PKCE switch, anonymous agents, andrestartPortalInitializer())
Changed
HookContract.getMsalAccessToken()— returns only the cached token synchronously; removed fire-and-forgetgetToken()side effect (usegetAccessToken()when a fresh token is required)
[0.2.2] - 2026-08-21
Added
- Session creation with context —
ApiHelper.getAiAgentSession()usesPOST .../sessionwith an optional{ context }body (falls back toGETon 403/404/405);AiAgentpasses stored context when creating or restarting sessions, includingegain_portal_idfrom the last selected portal when present contextValidationagent event — emitted when the platform returns a non-terminal system message for rejected context attributes (without ending the session)ContextValidationHandlerand exported typeContextValidationIssuefor custom message pipelinesMessageData.escalationData— optionalliveDomainandentrypointUrlon inbound escalation payloads (Advisor Desktop chat transfer)
Changed
setContext()— merges into cached context;sendImmediatelysends only attribute values that changed since the last stored contextrestartConnection()— new sessions receive context via the session POST; WebSocketsendStoredContext()runs only when the caller supplies an existingsessionId(compatibility path)cache.enabled: false— disables deployment-info static cache, portal pipeline profile cache (pipelineCache), and uses a memory-only context adapter (no session/local persistence)
Fixed
pipelineCacheandgetDeploymentInfonow honorcache.enabled: falseinstead of still reading or writing cached deployment info and profile lists- Customer
getPortalsfailures — portal-trained self-service agents (userType: customerwith configuredportals) now rejectinitialize()withInitializationPipelineError(PORTAL_FETCH_FAILED) when the portalmgr API fails, matching thegetMyPortalspath so hosts can surface errors instead of staying in a loading state - Session ID validation —
getSessionId(),getWsEndpoint(), andApiHelper.getAiAgentSession()reject placeholder or missing session ids (undefined,null, blank strings) before constructing the chat WebSocket URL; the query parameter is set viaURLSearchParamsinstead of string interpolation
[0.2.1] - 2026-07-30
Fixed
- Profile auto-select on recovery — when multiple profiles are available,
egain_personalization_profile_idin initialization context now wins overisLastUsedInPortalon the profile list - Stale profile list caches —
ApiHelper.selectUserProfileinvalidates cachedgetUserProfilesresponses after a successful PUT;AiAgent.updateUserProfileclears the portal pipeline profile cache (eg_profiles_*) and invalidatesgetUserProfilesso the next pipeline run refetches freshisLastUsedInPortalflags
Documentation
- Portal initialization, context management, and caching guides: profile auto-select priority and profile-list cache invalidation on select /
updateUserProfile
[0.2.0] - 2026-07-29
Added
AiAgent.initialize(options?)— optional{ context }merged withAiAgentConfig.context; stored viasetContextfor reconnect- Portal/profile auto-select during
PortalInitializerwhen initialization context includesegain_portal_idand/oregain_personalization_profile_id(eGain attribute{ value }or plain string values) - Exported type
AiAgentInitializeOptions ApiHelper.getPortals()— customer self-service portal list (GET .../portalmgr/v3/portals) with Flow A intersection againstagentDetails.portals(replaces synthetic-only customer portal lists)- Data masking — when
agentDetails.enableDataMaskingis true and the deployment version supports it, loads chat masking patterns during init and masks outboundcustomer/humanmessages insend();AiAgent.maskContent()for UI/escalation semverdependency for platform version gating (cc-widget parity)
Changed
- Customer agents with configured KB portals use tenant portal catalog + bot intersection (same rules as CC Flow A) instead of placeholder portal names only
Documentation
- Portal initialization and context management guides: initialization context and auto-select behavior
- Message flow guide: data masking (
maskContent, outboundsend()behavior)
[0.1.5] - 2026-07-27
Added
InitializationPipelineErrorandInitializationPipelineErrorCode(AUTH_TOKEN_REQUIRED,NO_PORTALS,PORTAL_FETCH_FAILED,PORTAL_DETAILS_FAILED,PROFILE_FETCH_FAILED,PROFILE_PERSIST_FAILED,NO_AGENTS_FOR_PORTAL,DEPARTMENT_ID_REQUIRED,INVALID_SELECTION) — thrown when the CC portal pipeline fails; catch viainstanceof InitializationPipelineErrorand branch onpipelineCode/error.codeInitializationPipelineStageon thrown errors (stageproperty) plus optionalportal/agentcontext
Fixed
- CC pipeline failures after
start()or afterselectPortal()/selectAgent()/selectUserProfile()were logged internally but not surfaced to consumers; hosts canawaitthose calls and catchInitializationPipelineErrorinstead of staying in a loading state
Changed
selectPortal(),selectAgent(), andselectUserProfile()returnPromise<void>and reject withInitializationPipelineErroron pipeline failureAiAgentawaitsportalInitializer.start()during CC init so auto-select failures rejectinitialize()when the pipeline fails before the first user gategetPortalDetailsAPI failures throwPORTAL_DETAILS_FAILEDinstead of being swallowed
[0.1.4] - 2026-07-20
Added
HookContract.getAccessToken()— async method that returns a fresh token, refreshing if expired. Connectors that need a guaranteed valid token for API calls should prefer this over the syncgetMsalAccessToken()
Changed
- Platform connector script loads for any set
initParams.platformwhenagentTypeiscontact-center, includingstandaloneandtest(cc-widget parity).testresolves to the standalone connector URL HookContract.getMsalAccessToken()is synchronous and returns the cached auth token (AuthenticationService.getCachedToken()), matching cc-widget connectors that do notawaitHookContract.getUserId()returns the authenticated user/customer detailsid(fromgetUserDetails/getCustomerDetails), notinitParams.userid
Fixed
- Skip fetching user/customer details when the agent is not authenticated (
agentDetails.isAuthenticatedis false), avoiding unnecessarygetUserDetails/getCustomerDetailsAPI calls
[0.1.3] - 2026-07-14
Added
HookContract.getQueryParams()— legacy alias forgetInitParams(), restoring compatibility with platform connectors (e.g. Genesys) that still callgetQueryParams()after the queryParam → initParam rename
[0.1.2] - 2026-06-04
Documentation
- Added instructions for generating an access token (PKCE flow) as a prerequisite for the pre-auth authentication option, including required OAuth scopes (
core.aiservices.read,knowledge.portalmgr.manage,core.customermgr.read) - Updated README, Quick Start guide, and Authentication guide
[0.1.0] - 2026-04-30 & [0.1.1] - 2026-05-01
First beta release of the AI Agent SDK
[0.0.13] & [0.0.14] - 2026-04-XX
Changed
- README documentation links
[0.0.12] - 2026-04-XX
Added
- Contact center (CC) portal initialization flow: chained REST pipeline (portals → optional agents → user profiles) before WebSocket connect, aligned with cc-widget behavior
- Platform script loading for CC connectors (e.g. Genesys, Amazon Connect): loads connector script and wires
PlatformComponentService/HookContract - New
AiAgentmethods:selectPortal(),selectAgent(),selectUserProfile(),getInitParams(),getIsInitialized(),restartPortalInitializer(),updateUserProfile(),getUserDetails(),getCallTranscript(),getCallerInfo(),getConversationId(),clearCallTranscript() - New
ApiHelpermethods:getMyPortals(),getAgentsByPortal(),getUserProfiles(),selectUserProfile(),getUserDetails(),getCustomerDetails() getTokencallback onApiHelperConfigso API calls can omit per-methodauthTokenwhen a token provider is configured- New
AiAgentConfigoptions:initParams,scopes,platformScriptUrl,authScheme(popup|redirectfor auto-built PKCE) - New events:
initialized(expanded payload),portalsAvailable,agentsAvailable,profilesAvailable,callTranscriptUpdate,callerInfoUpdate,conversationIdUpdate,userContextUpdate,filterTagsUpdate - Exported types for CC and connectors:
Portal,UserProfile,AgentListItem,UserDetails,HookContract,CallerInfo,CallTranscriptEntry,PlatformComponentService, and newGet*/Select*API option types
Changed
- PKCE:
localLoginonPKCEAuthConfig, improved redirect/popup behavior,domain_hint/localLoginextra query parameters, and MSAL options aligned with CC flows - Several
ApiHelperoption types now allow optionalauthTokenwhengetTokenis set onApiHelperConfig
Deprecated
restartCcWidgetInitializer()— userestartPortalInitializer()instead
[0.0.11] - 2025-01-XX
Added
- Browser UMD build support with
./browserexport - Browser build script (
build:browser) for standalone browser bundle - MSAL copy script for browser compatibility
- Comprehensive build pipeline with
build:allcommand - Documentation generation scripts (
docs:api,docs:build,docs:dev) - Publishing scripts for GitHub Packages
Changed
- Updated build process to include browser bundle generation
- Enhanced package exports to support both Node.js and browser environments
- Improved build scripts organization
[0.0.10] - 2025-01-XX
Added
- Browser build configuration
- Rollup bundler integration for browser builds
- Browser-specific exports in package.json
Changed
- Build process now generates both Node.js and browser bundles
[0.0.9] - 2025-01-09
Added
transcriptUpdateevent - emitted whenever the transcript is updated (message sent or received)- Provides
TranscriptEntrywith message, direction, timestamp, sessionId, and agentId - Useful for tracking all message activity in real-time
- Provides
- GitHub Actions workflow for automated SDK documentation deployment
Changed
- Improved VitePress documentation site structure
- Moved docs folder for better organization
[0.0.8] - 2025-01-08
Changed
- Removed empty content attribute from message payload
- Added 5ms delay in queue flushing for improved reliability
- Cached anonymous token for better performance
- Added partial initialization when agent details are fetched before init
Fixed
- Fixed test browser UMD build
[0.0.7] - 2025-01-08
Added
- VitePress documentation site
- Enhanced JSDoc comments throughout the codebase
- TypeDoc configuration for API reference generation
- Context persistence with automatic restoration on reconnect
- Custom cache adapter support
tokenExpiringevent for proactive token refreshupdateAccessToken()method for runtime token updates
Changed
- Improved error messages for better debugging
- Enhanced TypeScript type definitions
- Updated documentation to use
pre-authinstead of deprecatedtokenauth type
Fixed
- Various bug fixes and stability improvements
[0.0.6] - 2025-01-06
Added
restartConnection()method for fresh sessions- Automatic context caching and restoration
getContext()andremoveContext()methods- Transcript filtering options
Changed
- Improved reconnection logic with exponential backoff
[0.0.5] - 2025-01-03
Added
ApiHelperclass for REST API interactions- Caching for API responses
getAgentDetails()andgetDeploymentInfo()methods
Changed
- Refactored authentication to use
AuthenticationService
[0.0.4] - 2024-12-20
Added
- Multiple authentication strategies (Anonymous, PKCE, Pre-Auth, Client Credentials)
- Message type helpers (
createContextMessage,createFeedbackMessage, etc.) - Transcript management with filtering
[0.0.3] - 2024-12-15
Added
- Message queuing when offline
- Automatic queue flushing on reconnect
queueFlushedevent
[0.0.2] - 2024-12-10
Added
- WebSocket connection management
- Automatic reconnection with exponential backoff
- Event-driven architecture
- TypeScript type definitions
[0.0.1] - 2024-12-01
Added
- Initial release
- Basic WebSocket communication
- Pre-auth token authentication
- Message sending and receiving