@tanstack/ai-devtools-core 0.3.38 → 0.4.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 (52) 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/store/ai-context.tsx +1165 -159
  29. package/src/store/ai-store.ts +0 -1
  30. package/src/store/hook-registry.ts +815 -0
  31. package/src/store/message-event-utils.ts +60 -0
  32. package/src/styles/use-styles.ts +1558 -99
  33. package/dist/Shell/MRWZEHAJ.js +0 -6225
  34. package/dist/Shell/RRRNZJ5E.js +0 -7560
  35. package/dist/production/Shell/MRWZEHAJ.js +0 -6225
  36. package/dist/production/Shell/RRRNZJ5E.js +0 -7560
  37. package/src/components/ConversationDetails.tsx +0 -216
  38. package/src/components/ConversationsList.tsx +0 -21
  39. package/src/components/conversation/ActivityEventsTab.tsx +0 -57
  40. package/src/components/conversation/ChunkBadges.tsx +0 -51
  41. package/src/components/conversation/ChunkItem.tsx +0 -273
  42. package/src/components/conversation/ChunksCollapsible.tsx +0 -56
  43. package/src/components/conversation/ChunksTab.tsx +0 -87
  44. package/src/components/conversation/ConversationHeader.tsx +0 -106
  45. package/src/components/conversation/ConversationTabs.tsx +0 -205
  46. package/src/components/conversation/MessageCard.tsx +0 -174
  47. package/src/components/conversation/MessageGroup.tsx +0 -101
  48. package/src/components/conversation/MessagesTab.tsx +0 -30
  49. package/src/components/conversation/SummariesTab.tsx +0 -91
  50. package/src/components/conversation/ToolCallDisplay.tsx +0 -99
  51. package/src/components/list/ConversationRow.tsx +0 -85
  52. package/src/components/list/index.ts +0 -1
@@ -1,30 +0,0 @@
1
- import { For, Show } from 'solid-js'
2
- import { useStyles } from '../../styles/use-styles'
3
- import { MessageCard } from './MessageCard'
4
- import type { Component } from 'solid-js'
5
- import type { Message } from '../../store/ai-store'
6
-
7
- interface MessagesTabProps {
8
- messages: Array<Message>
9
- }
10
-
11
- export const MessagesTab: Component<MessagesTabProps> = (props) => {
12
- const styles = useStyles()
13
-
14
- return (
15
- <Show
16
- when={props.messages.length > 0}
17
- fallback={
18
- <div class={styles().conversationDetails.emptyMessages}>
19
- No messages yet. Start a conversation to see messages here.
20
- </div>
21
- }
22
- >
23
- <div class={styles().conversationDetails.messagesList}>
24
- <For each={props.messages}>
25
- {(msg) => <MessageCard message={msg} />}
26
- </For>
27
- </div>
28
- </Show>
29
- )
30
- }
@@ -1,91 +0,0 @@
1
- import { For, Show } from 'solid-js'
2
- import { useStyles } from '../../styles/use-styles'
3
- import { formatDuration } from '../utils'
4
- import type { Component } from 'solid-js'
5
- import type { SummarizeOperation } from '../../store/ai-context'
6
-
7
- interface SummariesTabProps {
8
- summaries: Array<SummarizeOperation>
9
- }
10
-
11
- export const SummariesTab: Component<SummariesTabProps> = (props) => {
12
- const styles = useStyles()
13
-
14
- return (
15
- <Show
16
- when={props.summaries.length > 0}
17
- fallback={
18
- <div class={styles().conversationDetails.emptyMessages}>
19
- No summarize operations yet
20
- </div>
21
- }
22
- >
23
- <div class={styles().conversationDetails.messagesList}>
24
- <For each={props.summaries}>
25
- {(summary) => (
26
- <div class={styles().conversationDetails.operationCard}>
27
- <div class={styles().conversationDetails.operationHeader}>
28
- <div class={styles().conversationDetails.operationIcon}>📝</div>
29
- <div class={styles().conversationDetails.operationTitle}>
30
- Summarize
31
- </div>
32
- <div
33
- class={`${styles().conversationDetails.operationStatus} ${
34
- summary.status === 'completed'
35
- ? styles().conversationDetails.operationStatusCompleted
36
- : styles().conversationDetails.operationStatusPending
37
- }`}
38
- >
39
- {summary.status}
40
- </div>
41
- <Show
42
- when={summary.duration !== undefined && summary.duration > 0}
43
- >
44
- <div class={styles().conversationDetails.durationBadge}>
45
- ⏱️ {formatDuration(summary.duration)}
46
- </div>
47
- </Show>
48
- </div>
49
- <div class={styles().conversationDetails.operationDetails}>
50
- <div class={styles().conversationDetails.operationDetail}>
51
- <span class={styles().conversationDetails.operationLabel}>
52
- Model:
53
- </span>
54
- <span class={styles().conversationDetails.operationValue}>
55
- {summary.model}
56
- </span>
57
- </div>
58
- <div class={styles().conversationDetails.operationDetail}>
59
- <span class={styles().conversationDetails.operationLabel}>
60
- Input:
61
- </span>
62
- <span class={styles().conversationDetails.operationValue}>
63
- {summary.inputLength.toLocaleString()} chars
64
- </span>
65
- </div>
66
- <Show when={summary.outputLength !== undefined}>
67
- <div class={styles().conversationDetails.operationDetail}>
68
- <span class={styles().conversationDetails.operationLabel}>
69
- Output:
70
- </span>
71
- <span class={styles().conversationDetails.operationValue}>
72
- {summary.outputLength?.toLocaleString()} chars
73
- </span>
74
- </div>
75
- </Show>
76
- <div class={styles().conversationDetails.operationDetail}>
77
- <span class={styles().conversationDetails.operationLabel}>
78
- Started:
79
- </span>
80
- <span class={styles().conversationDetails.operationValue}>
81
- {new Date(summary.timestamp).toLocaleTimeString()}
82
- </span>
83
- </div>
84
- </div>
85
- </div>
86
- )}
87
- </For>
88
- </div>
89
- </Show>
90
- )
91
- }
@@ -1,99 +0,0 @@
1
- import { Show } from 'solid-js'
2
- import { JsonTree } from '@tanstack/devtools-ui'
3
- import { useStyles } from '../../styles/use-styles'
4
- import { formatDuration } from '../utils'
5
- import type { Component } from 'solid-js'
6
- import type { ToolCall } from '../../store/ai-context'
7
-
8
- interface ToolCallDisplayProps {
9
- tool: ToolCall
10
- }
11
-
12
- export const ToolCallDisplay: Component<ToolCallDisplayProps> = (props) => {
13
- const styles = useStyles()
14
- const tool = () => props.tool
15
-
16
- // Parse arguments if they're a string
17
- const parsedArguments = () => {
18
- const args = tool().arguments
19
- if (typeof args === 'string') {
20
- try {
21
- return JSON.parse(args)
22
- } catch {
23
- return args
24
- }
25
- }
26
- return args
27
- }
28
-
29
- return (
30
- <details
31
- class={`${styles().conversationDetails.toolCall} ${
32
- tool().approvalRequired
33
- ? styles().conversationDetails.toolCallApproval
34
- : styles().conversationDetails.toolCallNormal
35
- }`}
36
- >
37
- <summary class={styles().conversationDetails.toolCallHeader}>
38
- <div
39
- class={`${styles().conversationDetails.toolCallName} ${
40
- tool().approvalRequired
41
- ? styles().conversationDetails.toolCallNameApproval
42
- : styles().conversationDetails.toolCallNameNormal
43
- }`}
44
- >
45
- {tool().approvalRequired ? '⚠️' : '🔧'} {tool().name}
46
- </div>
47
- <div
48
- class={`${styles().conversationDetails.toolStateBadge} ${
49
- tool().approvalRequired
50
- ? styles().conversationDetails.toolStateBadgeApproval
51
- : styles().conversationDetails.toolStateBadgeNormal
52
- }`}
53
- >
54
- {tool().state}
55
- </div>
56
- <Show when={(tool().duration ?? 0) > 0}>
57
- <div class={styles().conversationDetails.durationBadge}>
58
- ⏱️ {formatDuration(tool().duration)}
59
- </div>
60
- </Show>
61
- <Show when={tool().approvalRequired}>
62
- <div class={styles().conversationDetails.approvalRequiredBadge}>
63
- APPROVAL REQUIRED
64
- </div>
65
- </Show>
66
- </summary>
67
- <div class={styles().conversationDetails.toolCallContent}>
68
- <Show when={tool().arguments}>
69
- <div class={styles().conversationDetails.toolSection}>
70
- <div class={styles().conversationDetails.toolSectionLabel}>
71
- Arguments
72
- </div>
73
- <div class={styles().conversationDetails.toolJsonContainer}>
74
- <JsonTree
75
- value={parsedArguments() as Record<string, unknown>}
76
- defaultExpansionDepth={2}
77
- copyable
78
- />
79
- </div>
80
- </div>
81
- </Show>
82
- <Show when={tool().result !== undefined}>
83
- <div class={styles().conversationDetails.toolSection}>
84
- <div class={styles().conversationDetails.toolSectionLabel}>
85
- Result
86
- </div>
87
- <div class={styles().conversationDetails.toolJsonContainer}>
88
- <JsonTree
89
- value={tool().result as Record<string, unknown>}
90
- defaultExpansionDepth={2}
91
- copyable
92
- />
93
- </div>
94
- </div>
95
- </Show>
96
- </div>
97
- </details>
98
- )
99
- }
@@ -1,85 +0,0 @@
1
- import { Show } from 'solid-js'
2
- import { useStyles } from '../../styles/use-styles'
3
- import { useAIStore } from '../../store/ai-context'
4
- import { getStatusColor, getTypeColor } from '../utils'
5
- import type { Conversation } from '../../store/ai-context'
6
- import type { Component } from 'solid-js'
7
-
8
- interface ConversationRowProps {
9
- conversation: Conversation
10
- }
11
-
12
- export const ConversationRow: Component<ConversationRowProps> = (props) => {
13
- const { state, selectConversation } = useAIStore()
14
- const styles = useStyles()
15
- const conv = () => props.conversation
16
-
17
- const hasToolCalls = () => {
18
- return conv().messages.some(
19
- (msg) => msg.toolCalls && msg.toolCalls.length > 0,
20
- )
21
- }
22
-
23
- const countToolCalls = () => {
24
- return conv().messages.reduce((total, msg) => {
25
- return total + (msg.toolCalls?.length || 0)
26
- }, 0)
27
- }
28
-
29
- // Total raw chunks = sum of all chunkCounts from all chunks
30
- const totalRawChunks = () => {
31
- return conv().chunks.reduce((sum, c) => sum + (c.chunkCount || 1), 0)
32
- }
33
-
34
- return (
35
- <div
36
- class={`${styles().utilRow} ${state.activeConversationId === conv().id ? styles().utilRowSelected : ''}`}
37
- onClick={() => selectConversation(conv().id)}
38
- >
39
- <div class={styles().conversationsList.rowMain}>
40
- <div class={styles().conversationsList.rowTop}>
41
- <div class={styles().conversationsList.rowInfo}>
42
- <div
43
- class={styles().conversationsList.typeDot}
44
- style={{ background: getTypeColor(conv().type) }}
45
- />
46
- <div class={styles().conversationsList.label}>{conv().label}</div>
47
- <Show when={hasToolCalls()}>
48
- <div
49
- class={styles().conversationsList.toolCallsBadge}
50
- title={`${countToolCalls()} tool call${countToolCalls() !== 1 ? 's' : ''}`}
51
- >
52
- 🔧 {countToolCalls()}
53
- </div>
54
- </Show>
55
- </div>
56
- <div class={styles().conversationsList.rowRight}>
57
- <Show when={conv().status === 'active'}>
58
- <div class={styles().conversationsList.loadingIndicator}>⟳</div>
59
- </Show>
60
- <div
61
- class={styles().conversationsList.statusDot}
62
- style={{ background: getStatusColor(conv().status) }}
63
- />
64
- </div>
65
- </div>
66
- <div class={styles().conversationsList.stats}>
67
- <div class={styles().conversationsList.statItem}>
68
- 💬 {conv().messages.length}
69
- </div>
70
- <div class={styles().conversationsList.statItem}>
71
- 📦 {totalRawChunks()}
72
- </div>
73
- <Show when={conv().usage}>
74
- <div
75
- class={styles().conversationsList.tokensBadge}
76
- title={`Prompt: ${conv().usage?.promptTokens || 0} | Completion: ${conv().usage?.completionTokens || 0}`}
77
- >
78
- 🎯 {conv().usage?.totalTokens.toLocaleString() || 0}
79
- </div>
80
- </Show>
81
- </div>
82
- </div>
83
- </div>
84
- )
85
- }
@@ -1 +0,0 @@
1
- export { ConversationRow } from './ConversationRow'