dd04edb420bb3820250259faa2c727276748d76f
Three-layer architecture built on @push.rocks/smartagent: - ts/ — ChatSession wrapping runAgent() with conversation state management - ts_cli/ — ink-based terminal chat TUI (React.createElement, no JSX) - ts_web/ — Lit web components (smartchat-window, smartchat-message, smartchat-input)
Project Readme Hints
Overview
@push.rocks/smartchat v0.0.1 provides interactive chat interfaces for AI agents — CLI TUI and web components, built on @push.rocks/smartagent.
Architecture
ts/— Core:ChatSessionwrapsrunAgent()with in-memory conversation statets_cli/— CLI TUI using ink (React for CLI) withReact.createElement(no JSX/TSX — tsbuild doesn't supportjsxtsconfig option)ts_web/— Web components using Lit (no decorators — tsbuild uses TC39 decorators which are incompatible with Lit's legacy decorators; usestatic propertiesandcustomElements.define()instead)
Key Dependencies
@push.rocks/smartagent ^3.0.1— agentic loop,runAgent()@push.rocks/smartai ^2.0.0— model providers, types (LanguageModelV3,ModelMessage,ToolSet)ink ^6.8.0— React-based terminal UIink-text-input ^6.0.0— text input component for inklit ^3.2.0— web component frameworkreact ^19.0.0— React for ink
Build Notes
- No JSX/TSX: tsbuild crashes with
jsxin tsconfig.json. All React components useReact.createElement(aliased ash). - No Lit decorators: tsbuild uses TC39 standard decorators which are incompatible with Lit's
@property/@customElement. Usestatic propertiesandcustomElements.define(). - No ink-spinner: Dropped due to JSX.Element type incompatibility with React 19. Uses simple text characters instead.
- Types from AI SDK (
ModelMessage,ToolSet) are imported through@push.rocks/smartai(which re-exports them fromai). IAgentRunResult.usageusesinputTokens/outputTokens(notpromptTokens/completionTokens).
Package Exports
.→ Core (ChatSession, interfaces)./cli→ CLI TUI (startChat())./web→ Web components (SmartchatWindow,SmartchatMessage,SmartchatInput)
Description
Languages
TypeScript
100%