@optilogic/chat 1.0.0-beta.9 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +43 -0
  2. package/dist/index.cjs +709 -79
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +283 -4
  5. package/dist/index.d.ts +283 -4
  6. package/dist/index.js +674 -53
  7. package/dist/index.js.map +1 -1
  8. package/package.json +3 -3
  9. package/src/components/agent-response/AgentResponse.tsx +59 -13
  10. package/src/components/agent-response/components/MetadataRow.tsx +15 -4
  11. package/src/components/agent-response/components/TruncatedMessage.tsx +52 -0
  12. package/src/components/agent-response/components/index.ts +3 -0
  13. package/src/components/agent-response/hooks/useAgentResponseAccumulator.ts +65 -8
  14. package/src/components/agent-response/index.ts +19 -0
  15. package/src/components/agent-response/types.ts +61 -1
  16. package/src/components/agent-timeline/AgentTimeline.tsx +256 -0
  17. package/src/components/agent-timeline/TimelineAgentBlock.tsx +84 -0
  18. package/src/components/agent-timeline/TimelineItem.tsx +97 -0
  19. package/src/components/agent-timeline/index.ts +14 -0
  20. package/src/components/agent-timeline/types.ts +49 -0
  21. package/src/components/agent-timeline/utils.ts +189 -0
  22. package/src/components/hitl-interactions/HITLQuestionPanel.tsx +35 -21
  23. package/src/components/hitl-interactions/index.ts +1 -1
  24. package/src/components/inline-actions/ActionMarkdownRenderer.tsx +60 -0
  25. package/src/components/inline-actions/index.ts +18 -0
  26. package/src/components/inline-actions/parseResponseSegments.ts +66 -0
  27. package/src/components/inline-actions/prompts.ts +41 -0
  28. package/src/components/inline-actions/types.ts +57 -0
  29. package/src/components/user-prompt-input/UserPromptInput.tsx +13 -8
  30. package/src/components/user-prompt-input/types.ts +4 -0
  31. package/src/index.ts +29 -0
package/README.md CHANGED
@@ -141,6 +141,42 @@ function ChatView() {
141
141
  }
142
142
  ```
143
143
 
144
+ ### AgentResponse with Status Content
145
+
146
+ Display ephemeral status messages in the metadata row during agent processing:
147
+
148
+ ```tsx
149
+ import { AgentResponse, TruncatedMessage } from '@optilogic/chat';
150
+
151
+ function ChatView() {
152
+ const [statusMessage, setStatusMessage] = useState<string>();
153
+
154
+ // Parent controls when to show/clear status content
155
+ // e.g., set during processing, clear on completion
156
+
157
+ return (
158
+ <AgentResponse
159
+ state={state}
160
+ statusContent={
161
+ statusMessage
162
+ ? <TruncatedMessage message={statusMessage} />
163
+ : undefined
164
+ }
165
+ />
166
+ );
167
+ }
168
+ ```
169
+
170
+ ### TruncatedMessage
171
+
172
+ Standalone component that renders a single-line string with CSS-based truncation:
173
+
174
+ ```tsx
175
+ import { TruncatedMessage } from '@optilogic/chat';
176
+
177
+ <TruncatedMessage message="Searching the knowledge base for relevant documents..." />
178
+ ```
179
+
144
180
  ## Components
145
181
 
146
182
  ### AgentResponse
@@ -150,6 +186,7 @@ Main component for displaying AI agent responses with:
150
186
  - Tool call visualization
151
187
  - Copy and feedback actions
152
188
  - Metadata display (tokens, timing)
189
+ - Ephemeral status content slot in metadata row
153
190
  - Optional collapsible HITL interaction history
154
191
 
155
192
  ### UserPrompt
@@ -174,6 +211,12 @@ Read-only display of a completed HITL Q&A interaction with:
174
211
  ### HITLSection
175
212
  Collapsible sub-component for rendering HITL interactions within AgentResponse. Follows the same expand/collapse pattern as ThinkingSection.
176
213
 
214
+ ### TruncatedMessage
215
+ Standalone utility component for single-line text truncation with:
216
+ - CSS-based ellipsis truncation
217
+ - Native title tooltip for full text on hover
218
+ - Designed for use in MetadataRow status slot or anywhere else
219
+
177
220
  ## Hooks
178
221
 
179
222
  ### useAgentResponseAccumulator