{"_id":"@ai-chat-ui/core","_rev":"4-8ccee24bf3a8d0eff232a853d7663ed5","name":"@ai-chat-ui/core","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.2":{"name":"@ai-chat-ui/core","version":"0.0.2","keywords":["ai","chat","ui","react","typescript"],"author":{"name":"Your Name"},"license":"MIT","_id":"@ai-chat-ui/core@0.0.2","maintainers":[{"name":"ricalla","email":"pallaororm@gmail.com"}],"homepage":"https://ai-chat-ui.dev","bugs":{"url":"https://github.com/yourusername/ai-chat-ui/issues"},"dist":{"shasum":"74784aa98ed50b5f058f4b78ad536cc8e9f069bf","tarball":"https://registry.npmjs.org/@ai-chat-ui/core/-/core-0.0.2.tgz","fileCount":1,"integrity":"sha512-j6E4jtFwPlEjxUKZryoVf+sFaXqZuwxUfUlnsZTGc9R6z1QwJtLFzsRG14o6w4WzOeyLxy7CiLxqGdSaggehSQ==","signatures":[{"sig":"MEUCIDjTUZ2uF/yjGa4xlyRR9BCuZC2gpfkSVol8WG7/8HrWAiEAifVg9eAj+VIeANJ/Os2Xlnf9a//SA1v1WJQ5gVmssEg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1121},"main":"./dist/index.js","_from":"file:ai-chat-ui-core-0.0.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts"},"_npmUser":{"name":"ricalla","email":"pallaororm@gmail.com"},"_resolved":"/private/var/folders/rm/zw_l79s525b3_wvjdn7jsfg00000gn/T/448c5af33034fe55c303673552c878bd/ai-chat-ui-core-0.0.2.tgz","_integrity":"sha512-j6E4jtFwPlEjxUKZryoVf+sFaXqZuwxUfUlnsZTGc9R6z1QwJtLFzsRG14o6w4WzOeyLxy7CiLxqGdSaggehSQ==","repository":{"url":"git+https://github.com/yourusername/ai-chat-ui.git","type":"git","directory":"packages/core"},"_npmVersion":"10.8.2","description":"Core runtime for AI Chat UI","directories":{},"_nodeVersion":"20.19.5","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^1.0.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/core_0.0.2_1761946636241_0.7138488042979896","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@ai-chat-ui/core","version":"0.0.3","keywords":["ai","chat","ui","react","typescript","ag-ui"],"author":{"name":"Your Name"},"license":"MIT","_id":"@ai-chat-ui/core@0.0.3","maintainers":[{"name":"ricalla","email":"pallaororm@gmail.com"}],"homepage":"https://ai-chat-ui.dev","bugs":{"url":"https://github.com/yourusername/ai-chat-ui/issues"},"dist":{"shasum":"c44f6933b142dad00ec30d79bc2449254575d219","tarball":"https://registry.npmjs.org/@ai-chat-ui/core/-/core-0.0.3.tgz","fileCount":6,"integrity":"sha512-Z+4jkDYKSLLBCItgx3UWWXCO3oSFPq8hUtjHI5bTTztaBjx337bZUjAbDOidH+IYLGy1M/q8a8pfk4g8gtWElA==","signatures":[{"sig":"MEUCIQCWnSFRDv4Eout4HpC9U28R+ag5JO+WtEpkDiPa4rE3owIgSuOowbmXvBqrEsXUl5XGTZ0M3oyeJyWoY38gmnzE7zs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17020},"main":"./dist/index.js","_from":"file:ai-chat-ui-core-0.0.3.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src","test":"vitest","build":"tsup src/index.ts --format cjs,esm --dts"},"_npmUser":{"name":"ricalla","email":"pallaororm@gmail.com"},"_resolved":"/private/var/folders/rm/zw_l79s525b3_wvjdn7jsfg00000gn/T/c6caec8430da86a8dd7e57b757dcc835/ai-chat-ui-core-0.0.3.tgz","_integrity":"sha512-Z+4jkDYKSLLBCItgx3UWWXCO3oSFPq8hUtjHI5bTTztaBjx337bZUjAbDOidH+IYLGy1M/q8a8pfk4g8gtWElA==","repository":{"url":"git+https://github.com/yourusername/ai-chat-ui.git","type":"git","directory":"packages/core"},"_npmVersion":"10.8.2","description":"Core runtime for AI Chat UI","directories":{},"_nodeVersion":"20.19.5","dependencies":{"zod":"^3.22.4","@ag-ui/core":"^0.0.39"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^1.0.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/core_0.0.3_1762195800580_0.273687601903017","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-10-31T21:37:16.142Z","modified":"2026-04-10T18:38:27.764Z","0.0.2":"2025-10-31T21:37:16.431Z","0.0.3":"2025-11-03T18:50:00.776Z"},"bugs":{"url":"https://github.com/yourusername/ai-chat-ui/issues"},"author":{"name":"Your Name"},"license":"MIT","homepage":"https://ai-chat-ui.dev","keywords":["ai","chat","ui","react","typescript","ag-ui"],"repository":{"url":"git+https://github.com/yourusername/ai-chat-ui.git","type":"git","directory":"packages/core"},"description":"Core runtime for AI Chat UI","maintainers":[{"email":"pallaororm+npm@gmail.com","name":"pallaoro"}],"readme":"# @ai-chat-ui/core\n\nCore runtime for AI Chat UI built on top of the [AG-UI protocol](https://www.npmjs.com/package/@ag-ui/core).\n\n## Installation\n\n```bash\nnpm install @ai-chat-ui/core\n# or\npnpm add @ai-chat-ui/core\n# or\nyarn add @ai-chat-ui/core\n```\n\n## Overview\n\nThis package provides:\n\n- **Type Re-exports**: All core types and events from `@ag-ui/core`\n- **UI Utilities**: Helper functions for working with messages and events\n- **Type Safety**: Full TypeScript support with inferred types\n\n## Usage\n\n### Type Imports\n\n```typescript\nimport type {\n  // Messages\n  Message,\n  UserMessage,\n  AssistantMessage,\n\n  // Events\n  Event,\n  EventType,\n  TextMessageStartEvent,\n  ToolCallStartEvent,\n\n  // Core types\n  RunAgentInput,\n  Tool,\n  Context,\n} from \"@ai-chat-ui/core\";\n```\n\n### Utility Functions\n\n```typescript\nimport {\n  isUserMessage,\n  isAssistantMessage,\n  getMessageContent,\n  filterMessagesByRole,\n  createMessageId,\n  createThreadId,\n  isTextMessageEvent,\n  isToolCallEvent,\n} from '@ai-chat-ui/core';\n\n// Check message types\nconst messages: Message[] = [...];\nconst userMessages = messages.filter(isUserMessage);\n\n// Get message content\nconst content = getMessageContent(message);\n\n// Filter by role\nconst assistantMessages = filterMessagesByRole(messages, 'assistant');\n\n// Create IDs\nconst messageId = createMessageId();\nconst threadId = createThreadId();\n\n// Check event types\nif (isTextMessageEvent(event)) {\n  // Handle text message events\n}\n```\n\n## API Reference\n\n### Message Utilities\n\n- `isUserMessage(message)` - Check if message is from user\n- `isAssistantMessage(message)` - Check if message is from assistant\n- `isToolMessage(message)` - Check if message is from a tool\n- `isSystemMessage(message)` - Check if message is a system message\n- `getMessageContent(message)` - Extract text content from message\n- `filterMessagesByRole(messages, role)` - Filter messages by role\n- `getLastMessage(messages)` - Get the last message\n- `getLastUserMessage(messages)` - Get the last user message\n\n### Event Utilities\n\n- `isTextMessageEvent(event)` - Check if event is a text message event\n- `isToolCallEvent(event)` - Check if event is a tool call event\n- `isLifecycleEvent(event)` - Check if event is a lifecycle event\n\n### ID Generators\n\n- `createMessageId()` - Generate unique message ID\n- `createToolCallId()` - Generate unique tool call ID\n- `createThreadId()` - Generate unique thread ID\n- `createRunId()` - Generate unique run ID\n\n## Type Exports\n\nAll types from `@ag-ui/core` are re-exported for convenience:\n\n- Message types: `Message`, `UserMessage`, `AssistantMessage`, `ToolMessage`, `SystemMessage`, `DeveloperMessage`\n- Event types: `Event`, `EventType`, and all specific event types\n- Core types: `RunAgentInput`, `Tool`, `Context`, `State`, `ToolCall`, `FunctionCall`\n\n## License\n\nMIT\n","readmeFilename":"README.md"}