mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
5508b163d3
Port the React useThreads hook to an Angular signal-based service.
injectThreadStore() returns a ThreadStoreSignal exposing reactive
signals (threads, isLoading, error, hasMoreThreads,
isFetchingMoreThreads) plus mutation methods (renameThread,
archiveThread, deleteThread, fetchMoreThreads). Wires the same
ɵcreateThreadStore from @copilotkit/core that React uses, registers
with CopilotKitCore so threads stay scoped per agentId, and waits for
runtimeConnectionStatus=Connected before dispatching context to avoid
a redundant fetch.
Behavioral tests mirror the React suite (initial fetch + WebSocket
subscribe, fetch failure surfaces in error, runtimeUrl=undefined
short-circuits, realtime metadata events update local state, mutation
contracts, pagination, store registration, pre-Connected isLoading
synthesis, agentId signal switching).
Adds phoenix + @types/phoenix as devDependencies and inlines
@copilotkit/* in vitest server.deps so vi.mock("phoenix") intercepts
the bundled core imports (mirrors react-core's vitest config).
https://claude.ai/code/session_01B1zJ4kMRgLuN1r5T3iiGbZ