Creates the provider and wires up a REFRESH_TOKEN_SUCCESS listener so the
worker is restarted whenever the auth token is refreshed.
Timer handle for the main-thread polling interval (worker fires single-shot per tick).
The running web worker instance (util-worker).
Subject that emits the active agent list after each poll cycle.
Filters an assignment list by agent name search string (case-insensitive). Returns the full list unchanged when searchString is empty.
Builds the requestParams array expected by the util-worker directory-polling handler.
Constructs the skill-agents API URL with all required query params and the auth header.
Skill identifier for the query
Array of one request descriptor, or null on failure
Removes the IDB cache entry. Called on stopPolling so the next drill-down starts fresh rather than showing a stale list from a previous skill.
Handles the worker response: fetches the full active list, merges with any existing IDB cache (so polling updates state in-place), writes the full list back to IDB
The Map<id, {status, value}> posted by the worker
Creates a new util-worker web worker and wires its onmessage / onerror handlers.
Does not send any messages — call sendWorkerRequest after this to trigger the first fetch.
Expand the visible page by DEFAULT_PAGE_SIZE, reading the next slice from IDB.
Merges fresh API assignments into the existing IDB list so polling updates agent state
Merged list: all existing agents retained, changed agents updated in-place, new agents appended
Reads the full skill-agent list from IDB.
The stored list, or null if nothing is cached yet.
Restarts the worker when a new auth token is received from the refresh-token flow.
Filter the IDB-cached full list by search string and emit the first page.
Agent name filter string (e.g. 'ab')
Sends a single (non-repeating) directory-polling message to the live worker.
Always re-builds the request params from scratch so updatedSince is fixed at epoch.
Skill identifier to fetch agents for
Start polling for agents assigned to the given skill.
Any currently running poll (and its worker) is stopped first.
Page size starts at DEFAULT_PAGE_SIZE and only grows when loadMore() is called.
The skill identifier to poll agents for
Milliseconds between polls (default 5000)
Initialises the worker, fires an immediate request, then schedules a repeating poll.
Skill identifier to poll
Poll interval in milliseconds
Stop the current polling worker, reset all state, and clear the IDB cache so the next drill-down starts fresh
Reads the IDB agent list, attaches the full AgentStateResponse record as idbAgentData
on each matching assignment, and re-orders assignments to match the IDB sort order
(state-based, then alphabetical). Assignments not found in IDB retain their relative order at the end.
Active skill-agent assignments from the API
Assignments enriched with idbAgentData and IDB-ordered
Clears the main-thread polling timer and terminates the web worker, resetting both references. Safe to call when no polling is active.
Persists the full skill-agent list to IDB.
Generated using TypeDoc
Provider that polls the CMA skill-agents API via a shared
util-workerweb worker and emits paged results viaskillAgentsEvent. Using the worker offloads the HTTP fetch and JSON parsing off the main thread, preventing UI jank when the assigned-agents list is large (hundreds or thousands of agents).