@tanstack/ai-devtools-core 0.3.38 → 0.4.1

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 (53) hide show
  1. package/dist/Shell/DKCFIT6H.js +12142 -0
  2. package/dist/Shell/SLOX2TPU.js +12119 -0
  3. package/dist/Shell/Z6HLJOVZ.js +10170 -0
  4. package/dist/dev.js +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/production/Shell/DKCFIT6H.js +12142 -0
  7. package/dist/production/Shell/SLOX2TPU.js +12119 -0
  8. package/dist/production/Shell/Z6HLJOVZ.js +10170 -0
  9. package/dist/production/dev.js +1 -1
  10. package/dist/production/index.js +1 -1
  11. package/dist/production/server.js +1 -1
  12. package/dist/server.js +1 -1
  13. package/package.json +4 -4
  14. package/src/components/Shell.tsx +74 -30
  15. package/src/components/conversation/IterationCard.tsx +261 -12
  16. package/src/components/conversation/IterationTimeline.tsx +66 -16
  17. package/src/components/conversation/index.ts +0 -9
  18. package/src/components/hooks/FixtureNamePopover.tsx +69 -0
  19. package/src/components/hooks/GenerationPanel.tsx +847 -0
  20. package/src/components/hooks/HookDashboard.tsx +292 -0
  21. package/src/components/hooks/HookDetails.tsx +1757 -0
  22. package/src/components/hooks/ToolFixtureForm.tsx +347 -0
  23. package/src/components/hooks/hook-dashboard-model.ts +134 -0
  24. package/src/components/hooks/index.ts +4 -0
  25. package/src/components/hooks/preview-messages.ts +117 -0
  26. package/src/components/hooks/preview-model.ts +195 -0
  27. package/src/components/utils/format.ts +0 -58
  28. package/src/env.d.ts +5 -0
  29. package/src/store/ai-context.tsx +1165 -159
  30. package/src/store/ai-store.ts +0 -1
  31. package/src/store/hook-registry.ts +815 -0
  32. package/src/store/message-event-utils.ts +60 -0
  33. package/src/styles/use-styles.ts +1558 -99
  34. package/dist/Shell/MRWZEHAJ.js +0 -6225
  35. package/dist/Shell/RRRNZJ5E.js +0 -7560
  36. package/dist/production/Shell/MRWZEHAJ.js +0 -6225
  37. package/dist/production/Shell/RRRNZJ5E.js +0 -7560
  38. package/src/components/ConversationDetails.tsx +0 -216
  39. package/src/components/ConversationsList.tsx +0 -21
  40. package/src/components/conversation/ActivityEventsTab.tsx +0 -57
  41. package/src/components/conversation/ChunkBadges.tsx +0 -51
  42. package/src/components/conversation/ChunkItem.tsx +0 -273
  43. package/src/components/conversation/ChunksCollapsible.tsx +0 -56
  44. package/src/components/conversation/ChunksTab.tsx +0 -87
  45. package/src/components/conversation/ConversationHeader.tsx +0 -106
  46. package/src/components/conversation/ConversationTabs.tsx +0 -205
  47. package/src/components/conversation/MessageCard.tsx +0 -174
  48. package/src/components/conversation/MessageGroup.tsx +0 -101
  49. package/src/components/conversation/MessagesTab.tsx +0 -30
  50. package/src/components/conversation/SummariesTab.tsx +0 -91
  51. package/src/components/conversation/ToolCallDisplay.tsx +0 -99
  52. package/src/components/list/ConversationRow.tsx +0 -85
  53. package/src/components/list/index.ts +0 -1
@@ -0,0 +1,60 @@
1
+ export interface ClientAssistantPlaceholderInput {
2
+ role: string
3
+ source: 'client' | 'server'
4
+ content?: string
5
+ toolCalls?: Array<unknown>
6
+ parts?: Array<unknown>
7
+ }
8
+
9
+ export interface ClientToolCallMessageInput {
10
+ messageId: string
11
+ toolCallId: string
12
+ toolName: string
13
+ arguments: string
14
+ state: string
15
+ timestamp: number
16
+ source: 'client' | 'server'
17
+ requestId?: string
18
+ approvalRequired?: boolean
19
+ approvalId?: string
20
+ approvalApproved?: boolean
21
+ }
22
+
23
+ export function createClientToolCallMessage(input: ClientToolCallMessageInput) {
24
+ return {
25
+ id: input.messageId,
26
+ role: 'assistant' as const,
27
+ content: '',
28
+ timestamp: input.timestamp,
29
+ parts: [],
30
+ toolCalls: [
31
+ {
32
+ id: input.toolCallId,
33
+ name: input.toolName,
34
+ arguments: input.arguments,
35
+ state: input.state,
36
+ ...(input.approvalRequired !== undefined
37
+ ? { approvalRequired: input.approvalRequired }
38
+ : {}),
39
+ ...(input.approvalId ? { approvalId: input.approvalId } : {}),
40
+ ...(input.approvalApproved !== undefined
41
+ ? { approvalApproved: input.approvalApproved }
42
+ : {}),
43
+ },
44
+ ],
45
+ source: input.source,
46
+ ...(input.requestId ? { requestId: input.requestId } : {}),
47
+ }
48
+ }
49
+
50
+ export function shouldSkipClientAssistantPlaceholder(
51
+ message: ClientAssistantPlaceholderInput,
52
+ ): boolean {
53
+ return (
54
+ message.role === 'assistant' &&
55
+ message.source === 'client' &&
56
+ !message.content &&
57
+ (!message.toolCalls || message.toolCalls.length === 0) &&
58
+ (!message.parts || message.parts.length === 0)
59
+ )
60
+ }