Depends on #1487 ## Summary - Introduce `packages/core-agent` — a new pure-runtime package that extracts zero-Vue/Pinia algorithmic logic from `@proj-airi/stage-ui`, following a "compatible facade + core sinking" strategy - Migrate shared chat types, LLM streaming types, chat hook registry, session message merge logic, context registry algorithm, and LLM service utilities into `core-agent` - `stage-ui` files are preserved as re-exports / thin wrappers — all external imports, store IDs, and public APIs remain unchanged ## Motivation `stage-ui` currently mixes pure agent runtime logic (algorithms, type definitions, stateless utilities) with Vue/Pinia state management and browser-specific adapters. This coupling makes it hard to: - Test agent logic in isolation - Reuse agent algorithms outside of Vue contexts (e.g., server-side, CLI, other frameworks) - Reason about the boundary between "what the agent does" vs "how the UI manages state" --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by-agent: Unknown <unknown@example.com>
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
export type { AgentContextPort } from './contracts/context-port'
|
|
|
|
export type { ChatHookRegistry } from './contracts/hook-types'
|
|
|
|
export type { AgentLLMPort } from './contracts/llm-port'
|
|
export type { AgentSessionPort } from './contracts/session-port'
|
|
export type { AgentForegroundStreamPort } from './contracts/stream-port'
|
|
export { createChatHooks } from './runtime/agent-hooks'
|
|
export type { ContextHistoryEntry, ContextRegistry } from './runtime/context-registry'
|
|
|
|
export { createContextRegistry } from './runtime/context-registry'
|
|
export {
|
|
isToolRelatedError,
|
|
modelKey,
|
|
sanitizeMessages,
|
|
streamFrom,
|
|
streamOptionsToolsCompatibilityOk,
|
|
} from './runtime/llm-service'
|
|
export { mergeLoadedSessionMessages } from './session/merge-loaded-session-messages'
|
|
export type {
|
|
ChatAssistantMessage,
|
|
ChatHistoryItem,
|
|
ChatMessage,
|
|
ChatSlices,
|
|
ChatSlicesText,
|
|
ChatSlicesToolCall,
|
|
ChatSlicesToolCallResult,
|
|
ChatStreamEvent,
|
|
ChatStreamEventContext,
|
|
ContextMessage,
|
|
ErrorMessage,
|
|
StreamingAssistantMessage,
|
|
} from './types/chat'
|
|
|
|
export type {
|
|
BuiltinToolsResolver,
|
|
StreamEvent,
|
|
StreamFromOptions,
|
|
StreamOptions,
|
|
} from './types/llm'
|