@inkeep/agents-manage-ui 0.1.1 → 0.1.3

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 (101) hide show
  1. package/.env.example +10 -0
  2. package/.turbo/turbo-build.log +48 -54
  3. package/.turbo/turbo-test.log +7 -7
  4. package/.turbo/turbo-typecheck.log +1 -1
  5. package/LICENSE.md +22 -17
  6. package/README.md +3 -3
  7. package/biome.json +3 -0
  8. package/package.json +10 -9
  9. package/src/app/api/signoz/conversations/[conversationId]/route.ts +95 -34
  10. package/src/app/api/signoz/route.ts +8 -6
  11. package/src/components/api-keys/form/api-key-form.tsx +2 -0
  12. package/src/components/api-keys/form/validation.ts +1 -1
  13. package/src/components/artifact-components/form/artifact-component-form.tsx +20 -6
  14. package/src/components/artifact-components/form/validation.ts +3 -3
  15. package/src/components/credentials/views/credential-form-validation.ts +1 -1
  16. package/src/components/credentials/views/credential-form.tsx +2 -0
  17. package/src/components/credentials/views/edit-credential-form.tsx +1 -1
  18. package/src/components/credentials/views/generic-auth-form.tsx +1 -1
  19. package/src/components/data-components/form/data-component-form.tsx +19 -1
  20. package/src/components/data-components/form/validation.ts +3 -2
  21. package/src/components/form/expandable-field.tsx +6 -1
  22. package/src/components/form/form-field-wrapper.tsx +3 -1
  23. package/src/components/form/generic-combo-box.tsx +3 -1
  24. package/src/components/form/generic-input.tsx +9 -1
  25. package/src/components/form/generic-select.tsx +3 -1
  26. package/src/components/form/generic-textarea.tsx +3 -1
  27. package/src/components/form/json-schema-input.tsx +9 -1
  28. package/src/components/graph/configuration/node-types.tsx +2 -4
  29. package/src/components/graph/graph.tsx +4 -26
  30. package/src/components/graph/nodes/agent-node.tsx +1 -1
  31. package/src/components/graph/nodes/external-agent-node.tsx +1 -1
  32. package/src/components/graph/playground/chat-widget.tsx +31 -2
  33. package/src/components/graph/playground/ikp-message.tsx +16 -16
  34. package/src/components/graph/playground/playground.tsx +12 -6
  35. package/src/components/graph/sidepane/metadata/metadata-editor.tsx +62 -45
  36. package/src/components/graph/sidepane/nodes/agent-node-editor.tsx +56 -27
  37. package/src/components/graph/sidepane/nodes/expandable-text-area.tsx +3 -1
  38. package/src/components/graph/sidepane/nodes/external-agent-node-editor.tsx +31 -11
  39. package/src/components/graph/sidepane/nodes/form-fields.tsx +10 -1
  40. package/src/components/graph/sidepane/nodes/mcp-node-editor.tsx +4 -9
  41. package/src/components/graph/sidepane/nodes/model-section.tsx +1 -1
  42. package/src/components/graph/toolbar/toolbar.tsx +1 -1
  43. package/src/components/mcp-servers/form/active-tools-selector.tsx +4 -2
  44. package/src/components/mcp-servers/form/mcp-server-form.tsx +8 -1
  45. package/src/components/mcp-servers/form/validation.ts +1 -1
  46. package/src/components/projects/edit-project-dialog.tsx +1 -1
  47. package/src/components/projects/form/project-form.tsx +20 -8
  48. package/src/components/projects/form/project-models-section.tsx +51 -23
  49. package/src/components/projects/form/project-stopwhen-section.tsx +25 -11
  50. package/src/components/projects/form/validation.ts +14 -10
  51. package/src/components/projects/new-project-dialog.tsx +1 -1
  52. package/src/components/traces/ai-calls-breakdown.tsx +1 -1
  53. package/src/components/traces/charts/area-chart-card.tsx +2 -2
  54. package/src/components/traces/charts/area-chart.tsx +2 -2
  55. package/src/components/traces/charts/chart-card.tsx +4 -4
  56. package/src/components/traces/conversation-detail.tsx +10 -8
  57. package/src/components/traces/conversation-stats/conversation-list-item.tsx +48 -37
  58. package/src/components/traces/conversation-stats/conversation-stats-card.tsx +1 -1
  59. package/src/components/traces/filters/date-picker.tsx +6 -6
  60. package/src/components/traces/filters/filter-trigger.tsx +1 -1
  61. package/src/components/traces/filters/graph-filter.tsx +3 -3
  62. package/src/components/traces/timeline/activity-details-sidepane.tsx +1 -1
  63. package/src/components/traces/timeline/activity-timeline.tsx +1 -1
  64. package/src/components/traces/timeline/blocks.tsx +2 -2
  65. package/src/components/traces/timeline/render-panel-content.tsx +11 -11
  66. package/src/components/traces/timeline/timeline-item.tsx +36 -22
  67. package/src/components/traces/timeline/timeline-wrapper.tsx +125 -37
  68. package/src/components/traces/traces-overview.tsx +3 -3
  69. package/src/components/ui/alert.tsx +60 -0
  70. package/src/components/ui/calendar.tsx +3 -4
  71. package/src/components/ui/external-link.tsx +2 -2
  72. package/src/components/ui/form.tsx +11 -4
  73. package/src/components/ui/inheritance-indicator.tsx +20 -17
  74. package/src/components/ui/resizable.tsx +13 -18
  75. package/src/constants/page-descriptions.tsx +2 -5
  76. package/src/constants/signoz.ts +15 -18
  77. package/src/features/graph/domain/__tests__/roundtrip.test.ts +5 -5
  78. package/src/features/graph/domain/serialize.ts +8 -9
  79. package/src/hooks/use-auto-prefill-id-zustand.ts +68 -0
  80. package/src/hooks/use-auto-prefill-id.ts +36 -0
  81. package/src/hooks/use-chat-activities-polling.ts +45 -12
  82. package/src/hooks/use-graph-errors.ts +2 -1
  83. package/src/hooks/use-project-data.ts +2 -2
  84. package/src/lib/actions/graph-full.ts +6 -2
  85. package/src/lib/actions/projects.ts +1 -1
  86. package/src/lib/api/api-config.ts +6 -6
  87. package/src/lib/api/api-keys.ts +4 -1
  88. package/src/lib/api/credentials.ts +1 -1
  89. package/src/lib/api/data-components.ts +1 -1
  90. package/src/lib/api/graph-full-client.ts +6 -3
  91. package/src/lib/api/projects.ts +1 -1
  92. package/src/lib/api/signoz-sql.ts +1 -1
  93. package/src/lib/api/signoz-stats.ts +958 -304
  94. package/src/lib/index.ts +1 -1
  95. package/src/lib/logger.ts +1 -2
  96. package/src/lib/types/graph-full.ts +1 -1
  97. package/src/lib/utils/generate-id.ts +14 -0
  98. package/src/lib/validation.ts +1 -1
  99. package/tsconfig.json +2 -2
  100. package/.env.sample +0 -5
  101. package/eslint.config.mjs +0 -14
package/.env.example ADDED
@@ -0,0 +1,10 @@
1
+ NEXT_PUBLIC_TENANT_ID="inkeep"
2
+ NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL="http://localhost:3002" # URL where agents-manage-api is running
3
+ NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL="http://localhost:3003" # URL where agents-run-api is running
4
+ NEXT_PUBLIC_INKEEP_AUTH_TOKEN=""
5
+ NEXT_PUBLIC_DOCS_BASE_URL=""
6
+ NANGO_SECRET_KEY=
7
+ NEXT_PUBLIC_NANGO_HOST="http://localhost:3050"
8
+ NEXT_PUBLIC_NANGO_CONNECT_BASE_URL="http://localhost:3051"
9
+ SIGNOZ_URL=http://localhost:3080
10
+ SIGNOZ_API_KEY=
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @inkeep/agents-manage-ui@0.1.0 build /Users/mileskaming-thanassi/agents/agents-manage-ui
3
+ > @inkeep/agents-manage-ui@0.1.2 build /Users/mileskaming-thanassi/agents/agents-manage-ui
4
4
  > next build
5
5
 
6
6
  ⚠ Warning: Found multiple lockfiles. Selecting /Users/mileskaming-thanassi/package-lock.json.
@@ -12,72 +12,66 @@
12
12
    Creating an optimized production build ...
13
13
  ✓ Compiled successfully in 8.0s
14
14
    Skipping linting
15
- [?25l   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...[?25h   Checking validity of types
16
15
  ✓ Checking validity of types
17
- [?25l   Collecting page data .   Collecting page data ..NEXT_PUBLIC_INKEEP_MANAGEMENT_API_URL is not set, falling back to: http://localhost:3002
18
- NEXT_PUBLIC_INKEEP_EXECUTION_API_URL is not set, falling back to: http://localhost:3003
19
- NEXT_PUBLIC_INKEEP_MANAGEMENT_API_URL is not set, falling back to: http://localhost:3002
20
- NEXT_PUBLIC_INKEEP_EXECUTION_API_URL is not set, falling back to: http://localhost:3003
21
- NEXT_PUBLIC_INKEEP_MANAGEMENT_API_URL is not set, falling back to: http://localhost:3002
22
- NEXT_PUBLIC_INKEEP_EXECUTION_API_URL is not set, falling back to: http://localhost:3003
23
- NEXT_PUBLIC_INKEEP_MANAGEMENT_API_URL is not set, falling back to: http://localhost:3002
24
- NEXT_PUBLIC_INKEEP_EXECUTION_API_URL is not set, falling back to: http://localhost:3003
25
- NEXT_PUBLIC_INKEEP_MANAGEMENT_API_URL is not set, falling back to: http://localhost:3002
26
- NEXT_PUBLIC_INKEEP_EXECUTION_API_URL is not set, falling back to: http://localhost:3003
27
- NEXT_PUBLIC_INKEEP_MANAGEMENT_API_URL is not set, falling back to: http://localhost:3002
28
- NEXT_PUBLIC_INKEEP_EXECUTION_API_URL is not set, falling back to: http://localhost:3003
29
- NEXT_PUBLIC_INKEEP_MANAGEMENT_API_URL is not set, falling back to: http://localhost:3002
30
- NEXT_PUBLIC_INKEEP_EXECUTION_API_URL is not set, falling back to: http://localhost:3003
31
- NEXT_PUBLIC_INKEEP_MANAGEMENT_API_URL is not set, falling back to: http://localhost:3002
32
- NEXT_PUBLIC_INKEEP_EXECUTION_API_URL is not set, falling back to: http://localhost:3003
33
- NEXT_PUBLIC_INKEEP_MANAGEMENT_API_URL is not set, falling back to: http://localhost:3002
34
- NEXT_PUBLIC_INKEEP_EXECUTION_API_URL is not set, falling back to: http://localhost:3003
35
- NEXT_PUBLIC_INKEEP_MANAGEMENT_API_URL is not set, falling back to: http://localhost:3002
36
- NEXT_PUBLIC_INKEEP_EXECUTION_API_URL is not set, falling back to: http://localhost:3003
16
+ [?25l   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...   Checking validity of types .   Checking validity of types ..   Checking validity of types ...[?25h   Checking validity of types
37
17
  ✓ Checking validity of types
18
+ [?25l   Collecting page data .   Collecting page data ..NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL is not set, falling back to: http://localhost:3002
19
+ NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL is not set, falling back to: http://localhost:3003
20
+ NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL is not set, falling back to: http://localhost:3002
21
+ NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL is not set, falling back to: http://localhost:3003
22
+ NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL is not set, falling back to: http://localhost:3002
23
+ NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL is not set, falling back to: http://localhost:3003
24
+ NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL is not set, falling back to: http://localhost:3002
25
+ NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL is not set, falling back to: http://localhost:3003
26
+ NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL is not set, falling back to: http://localhost:3002
27
+ NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL is not set, falling back to: http://localhost:3003
28
+ NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL is not set, falling back to: http://localhost:3002
29
+ NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL is not set, falling back to: http://localhost:3003
30
+ NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL is not set, falling back to: http://localhost:3002
31
+ NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL is not set, falling back to: http://localhost:3003
32
+ NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL is not set, falling back to: http://localhost:3002
33
+ NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL is not set, falling back to: http://localhost:3003
34
+ NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL is not set, falling back to: http://localhost:3002
35
+ NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL is not set, falling back to: http://localhost:3003
36
+ NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL is not set, falling back to: http://localhost:3002
37
+ NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL is not set, falling back to: http://localhost:3003
38
+ NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL is not set, falling back to: http://localhost:3002
39
+ NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL is not set, falling back to: http://localhost:3003
38
40
  [?25h   Collecting page data
39
41
  ✓ Collecting page data
40
- [?25l   Generating static pages (0/7) [ ]   Generating static pages (0/7) [= ]   Generating static pages (1/7) [== ][?25hNEXT_PUBLIC_INKEEP_MANAGEMENT_API_URL is not set, falling back to: http://localhost:3002
41
- NEXT_PUBLIC_INKEEP_EXECUTION_API_URL is not set, falling back to: http://localhost:3003
42
+ [?25l   Generating static pages (0/7) [ ]   Generating static pages (0/7) [= ]   Generating static pages (0/7) [== ][?25hNEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL is not set, falling back to: http://localhost:3002
43
+ NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL is not set, falling back to: http://localhost:3003
42
44
  NEXT_PUBLIC_TENANT_ID is not set, using default tenantId: default
43
- Error fetching projects, redirecting to projects page: Error [ApiError]: fetch failed
44
- at g (.next/server/app/page.js:2:8538)
45
- at async g (.next/server/app/page.js:2:9977)
46
- at async g (.next/server/app/page.js:2:8871)
47
- at async f (.next/server/app/page.js:1:959) {
48
- error: [Object],
49
- status: 500
50
- }
51
45
  [?25h ✓ Generating static pages (7/7)
52
- [?25l   Finalizing page optimization .[?25l   Collecting build traces .   Finalizing page optimization ..   Collecting build traces ..   Finalizing page optimization ...   Collecting build traces ...   Finalizing page optimization .   Collecting build traces .   Finalizing page optimization ..   Collecting build traces ..   Finalizing page optimization ...   Collecting build traces ...   Finalizing page optimization .   Collecting build traces .   Finalizing page optimization ..   Collecting build traces ..   Finalizing page optimization ...   Collecting build traces ...   Finalizing page optimization .   Collecting build traces .   Finalizing page optimization ..   Collecting build traces ..[?25h   Collecting build traces
53
46
  ✓ Collecting build traces
47
+ [?25l   Finalizing page optimization .[?25l   Collecting build traces .   Finalizing page optimization ..   Collecting build traces ..   Finalizing page optimization ...   Collecting build traces ...   Finalizing page optimization .   Collecting build traces .   Finalizing page optimization ..   Collecting build traces ..   Finalizing page optimization ...   Collecting build traces ...   Finalizing page optimization .   Collecting build traces .   Finalizing page optimization ..   Collecting build traces ..   Finalizing page optimization ...   Collecting build traces ...   Finalizing page optimization .   Collecting build traces .   Finalizing page optimization ..   Collecting build traces ..   Finalizing page optimization ...   Collecting build traces ...[?25h   Collecting build traces
54
48
  ✓ Collecting build traces
55
49
  [?25h   Finalizing page optimization
56
50
  ✓ Finalizing page optimization
57
51
 
58
52
  Route (app) Size First Load JS  
59
53
  ┌ ○ / 142 B 105 kB
60
54
  ├ ○ /_not-found 1 kB 106 kB
61
55
  ├ ƒ /[tenantId] 142 B 105 kB
62
- ├ ƒ /[tenantId]/projects 2.68 kB 345 kB
56
+ ├ ƒ /[tenantId]/projects 2.68 kB 343 kB
63
57
  ├ ƒ /[tenantId]/projects/[projectId] 142 B 105 kB
64
- ├ ƒ /[tenantId]/projects/[projectId]/api-keys 8.66 kB 216 kB
65
- ├ ƒ /[tenantId]/projects/[projectId]/artifact-components 1.18 kB 168 kB
66
- ├ ƒ /[tenantId]/projects/[projectId]/artifact-components/[artifactComponentId] 1.52 kB 343 kB
67
- ├ ƒ /[tenantId]/projects/[projectId]/artifact-components/new 1.52 kB 343 kB
68
- ├ ƒ /[tenantId]/projects/[projectId]/credentials 1.64 kB 174 kB
69
- ├ ƒ /[tenantId]/projects/[projectId]/credentials/[credentialId] 3.86 kB 186 kB
58
+ ├ ƒ /[tenantId]/projects/[projectId]/api-keys 8.73 kB 213 kB
59
+ ├ ƒ /[tenantId]/projects/[projectId]/artifact-components 1.31 kB 168 kB
60
+ ├ ƒ /[tenantId]/projects/[projectId]/artifact-components/[artifactComponentId] 1.59 kB 341 kB
61
+ ├ ƒ /[tenantId]/projects/[projectId]/artifact-components/new 1.59 kB 341 kB
62
+ ├ ƒ /[tenantId]/projects/[projectId]/credentials 1.77 kB 174 kB
63
+ ├ ƒ /[tenantId]/projects/[projectId]/credentials/[credentialId] 3.92 kB 184 kB
70
64
  ├ ƒ /[tenantId]/projects/[projectId]/credentials/new 206 B 147 kB
71
- ├ ƒ /[tenantId]/projects/[projectId]/credentials/new/bearer 7.55 kB 198 kB
65
+ ├ ƒ /[tenantId]/projects/[projectId]/credentials/new/bearer 7.57 kB 212 kB
72
66
  ├ ƒ /[tenantId]/projects/[projectId]/credentials/new/providers 3.15 kB 155 kB
73
- ├ ƒ /[tenantId]/projects/[projectId]/credentials/new/providers/[providerId] 10.6 kB 198 kB
74
- ├ ƒ /[tenantId]/projects/[projectId]/data-components 1.17 kB 168 kB
75
- ├ ƒ /[tenantId]/projects/[projectId]/data-components/[dataComponentId] 1.44 kB 343 kB
76
- ├ ƒ /[tenantId]/projects/[projectId]/data-components/new 1.44 kB 343 kB
77
- ├ ƒ /[tenantId]/projects/[projectId]/graphs 1.15 kB 168 kB
78
- ├ ƒ /[tenantId]/projects/[projectId]/graphs/[graphId] 196 B 979 kB
79
- ├ ƒ /[tenantId]/projects/[projectId]/graphs/new 199 B 979 kB
80
- ├ ƒ /[tenantId]/projects/[projectId]/mcp-servers 3.8 kB 176 kB
67
+ ├ ƒ /[tenantId]/projects/[projectId]/credentials/new/providers/[providerId] 10.7 kB 212 kB
68
+ ├ ƒ /[tenantId]/projects/[projectId]/data-components 1.31 kB 168 kB
69
+ ├ ƒ /[tenantId]/projects/[projectId]/data-components/[dataComponentId] 1.5 kB 341 kB
70
+ ├ ƒ /[tenantId]/projects/[projectId]/data-components/new 1.5 kB 341 kB
71
+ ├ ƒ /[tenantId]/projects/[projectId]/graphs 1.29 kB 168 kB
72
+ ├ ƒ /[tenantId]/projects/[projectId]/graphs/[graphId] 199 B 984 kB
73
+ ├ ƒ /[tenantId]/projects/[projectId]/graphs/new 199 B 984 kB
74
+ ├ ƒ /[tenantId]/projects/[projectId]/mcp-servers 3.94 kB 176 kB
81
75
  ├ ƒ /[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId] 5.23 kB 157 kB
82
- ├ ƒ /[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit 219 B 196 kB
83
- ├ ƒ /[tenantId]/projects/[projectId]/mcp-servers/new 1.41 kB 184 kB
84
- ├ ƒ /[tenantId]/projects/[projectId]/traces 208 kB 433 kB
85
- ├ ƒ /[tenantId]/projects/[projectId]/traces/ai-calls 3.59 kB 211 kB
86
- ├ ƒ /[tenantId]/projects/[projectId]/traces/conversations/[conversationId] 4.2 kB 376 kB
76
+ ├ ƒ /[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit 216 B 194 kB
77
+ ├ ƒ /[tenantId]/projects/[projectId]/mcp-servers/new 1.41 kB 182 kB
78
+ ├ ƒ /[tenantId]/projects/[projectId]/traces 208 kB 431 kB
79
+ ├ ƒ /[tenantId]/projects/[projectId]/traces/ai-calls 3.59 kB 209 kB
80
+ ├ ƒ /[tenantId]/projects/[projectId]/traces/conversations/[conversationId] 4.04 kB 390 kB
87
81
  ├ ƒ /api/signoz 142 B 105 kB
88
82
  ├ ƒ /api/signoz/conversations/[conversationId] 142 B 105 kB
89
83
  └ ○ /icon.svg 0 B 0 B
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @inkeep/agents-manage-ui@0.1.0 test /Users/mileskaming-thanassi/agents/agents-manage-ui
3
+ > @inkeep/agents-manage-ui@0.1.2 test /Users/mileskaming-thanassi/agents/agents-manage-ui
4
4
  > vitest --run
5
5
 
6
6
  [?25l
@@ -11,8 +11,8 @@
11
11
 
12
12
   Test Files 0 passed (3)
13
13
   Tests 0 passed (0)
14
-  Start at 12:08:03
15
-  Duration 101ms
14
+  Start at 16:07:15
15
+  Duration 106ms
16
16
  [?2026l[?2026h ✓ src/app/utils/__tests__/format-date.test.ts (22 tests) 13ms
17
17
 
18
18
   ❯ src/features/graph/domain/__tests__/roundtrip.test.ts 0/1
@@ -20,14 +20,14 @@
20
20
 
21
21
   Test Files 1 passed (3)
22
22
   Tests 22 passed (23)
23
-  Start at 12:08:03
24
-  Duration 302ms
23
+  Start at 16:07:15
24
+  Duration 307ms
25
25
  [?2026l ✓ src/features/graph/domain/__tests__/serialize.test.ts (7 tests) 3ms
26
26
  ✓ src/features/graph/domain/__tests__/roundtrip.test.ts (1 test) 8ms
27
27
 
28
28
   Test Files  3 passed (3)
29
29
   Tests  30 passed (30)
30
-  Start at  12:08:03
31
-  Duration  423ms (transform 105ms, setup 0ms, collect 495ms, tests 23ms, environment 0ms, prepare 136ms)
30
+  Start at  16:07:15
31
+  Duration  431ms (transform 100ms, setup 0ms, collect 482ms, tests 23ms, environment 0ms, prepare 134ms)
32
32
 
33
33
  [?25h
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @inkeep/agents-manage-ui@0.1.0 typecheck /Users/mileskaming-thanassi/agents/agents-manage-ui
3
+ > @inkeep/agents-manage-ui@0.1.2 typecheck /Users/mileskaming-thanassi/agents/agents-manage-ui
4
4
  > tsc --noEmit
5
5
 
package/LICENSE.md CHANGED
@@ -1,44 +1,49 @@
1
- Elastic License
2
- Acceptance
1
+ # Inkeep SDK – Elastic License 2.0 with Supplemental Terms
2
+
3
+ NOTE: The Inkeep SDK is licensed under the Elastic License 2.0 (ELv2), subject to Supplemental Terms included in [SUPPLEMENTAL_TERMS.md](SUPPLEMENTAL_TERMS.md). In the event of conflict, the Supplemental Terms control.
4
+
5
+ # Elastic License 2.0
6
+
7
+ ## Acceptance
3
8
  By using the software, you agree to all of the terms and conditions below.
4
9
 
5
- Copyright License
10
+ ## Copyright License
6
11
  The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below.
7
12
 
8
- Limitations
13
+ ## Limitations
9
14
  You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
10
15
 
11
16
  You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
12
17
 
13
18
  You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
14
19
 
15
- Patents
20
+ ## Patents
16
21
  The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
17
22
 
18
- Notices
23
+ ## Notices
19
24
  You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
20
25
 
21
26
  If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
22
27
 
23
- No Other Rights
28
+ ## No Other Rights
24
29
  These terms do not imply any licenses other than those expressly granted in these terms.
25
30
 
26
- Termination
31
+ ## Termination
27
32
  If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
28
33
 
29
- No Liability
30
- As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
34
+ ## No Liability
35
+ ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
31
36
 
32
- Definitions
33
- The licensor is the entity offering these terms, and the software is the software the licensor makes available under these terms, including any portion of it.
37
+ ## Definitions
38
+ The **licensor** is the entity offering these terms, and the **software** is the software the licensor makes available under these terms, including any portion of it.
34
39
 
35
- you refers to the individual or entity agreeing to these terms.
40
+ **you** refers to the individual or entity agreeing to these terms.
36
41
 
37
- your company is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. control means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
42
+ **your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
38
43
 
39
- your licenses are all the licenses granted to you for the software under these terms.
44
+ **your licenses** are all the licenses granted to you for the software under these terms.
40
45
 
41
- use means anything you do with the software requiring one of your licenses.
46
+ **use** means anything you do with the software requiring one of your licenses.
42
47
 
43
- trademark means trademarks, service marks, and similar rights.
48
+ **trademark** means trademarks, service marks, and similar rights.
44
49
 
package/README.md CHANGED
@@ -2,7 +2,7 @@ This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-
2
2
 
3
3
  ## Agent Builder
4
4
 
5
- This application provides a UI for building and managing agent graphs. It integrates with the inkeep-management-api and inkeep-execution-api backend services to provide full CRUD operations for agent graph management and real-time chat execution.
5
+ This application provides a UI for building and managing agent graphs. It integrates with the agents-manage-api and agents-run-api backend services to provide full CRUD operations for agent graph management and real-time chat execution.
6
6
 
7
7
  ### Features
8
8
 
@@ -48,8 +48,8 @@ Create a `.env.local` file with the following configuration:
48
48
  ```bash
49
49
  # Inkeep Configuration
50
50
  NEXT_PUBLIC_TENANT_ID="inkeep"
51
- NEXT_PUBLIC_INKEEP_MANAGEMENT_API_URL="http://localhost:3002" # URL where inkeep-management-api is running
52
- NEXT_PUBLIC_INKEEP_EXECUTION_API_URL="http://localhost:3003" # URL where inkeep-execution-api is running
51
+ NEXT_PUBLIC_INKEEP_AGENTS_MANAGE_API_URL="http://localhost:3002" # URL where agents-manage-api is running
52
+ NEXT_PUBLIC_INKEEP_AGENTS_RUN_API_URL="http://localhost:3003" # URL where agents-run-api is running
53
53
  NEXT_PUBLIC_INKEEP_AUTH_TOKEN=""
54
54
 
55
55
  # SigNoz Configuration (for Traces feature)
package/biome.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": ["../biome.json"]
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-manage-ui",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "dependencies": {
6
6
  "@ai-sdk/react": "2.0.11",
@@ -55,15 +55,14 @@
55
55
  "streamdown": "^1.0.12",
56
56
  "tailwind-merge": "^3.3.1",
57
57
  "use-stick-to-bottom": "^1.1.1",
58
- "zod": "^4.1.5",
58
+ "zod": "^3.25.76",
59
59
  "zustand": "^5.0.7",
60
- "@inkeep/agents-manage-api": "0.1.1",
61
- "@inkeep/agents-run-api": "0.1.1",
62
- "@inkeep/agents-core": "0.1.0"
60
+ "@inkeep/agents-manage-api": "^0.1.2",
61
+ "@inkeep/agents-core": "^0.1.4",
62
+ "@inkeep/agents-run-api": "^0.1.3"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@biomejs/biome": "2.1.4",
66
- "@eslint/eslintrc": "^3",
67
66
  "@tailwindcss/postcss": "^4",
68
67
  "@testing-library/jest-dom": "^6.8.0",
69
68
  "@testing-library/react": "^16.3.0",
@@ -72,8 +71,6 @@
72
71
  "@types/react": "^19",
73
72
  "@types/react-dom": "^19",
74
73
  "@vitest/coverage-v8": "^3.2.4",
75
- "eslint": "^9",
76
- "eslint-config-next": "15.5.2",
77
74
  "jsdom": "^26.1.0",
78
75
  "tailwind-scrollbar": "^4.0.2",
79
76
  "tailwindcss": "^4",
@@ -81,11 +78,15 @@
81
78
  "typescript": "^5",
82
79
  "vitest": "^3.2.4"
83
80
  },
81
+ "engines": {
82
+ "node": ">=22.0.0"
83
+ },
84
84
  "scripts": {
85
85
  "dev": "next dev -p 3000",
86
86
  "build": "next build",
87
87
  "start": "next start",
88
- "lint": "next lint",
88
+ "lint": "biome check",
89
+ "format": "biome check --write",
89
90
  "typecheck": "tsc --noEmit",
90
91
  "test": "vitest --run",
91
92
  "test:coverage": "vitest --run --coverage"
@@ -1,14 +1,33 @@
1
- import { type NextRequest, NextResponse } from 'next/server';
2
- import { fetchAllSpanAttributes_SQL } from '@/lib/api/signoz-sql';
3
1
  import axios from 'axios';
4
2
  import axiosRetry from 'axios-retry';
5
- import { SPAN_NAMES, AI_OPERATIONS, SPAN_KEYS, QUERY_FIELD_CONFIGS, UNKNOWN_VALUE, OPERATORS, QUERY_EXPRESSIONS, DATA_SOURCES, PANEL_TYPES, QUERY_TYPES, AGGREGATE_OPERATORS, ORDER_DIRECTIONS, QUERY_DEFAULTS, ACTIVITY_TYPES, ACTIVITY_STATUS, AGENT_IDS, ACTIVITY_NAMES, TOOL_NAMES } from '@/constants/signoz';
3
+ import { type NextRequest, NextResponse } from 'next/server';
4
+ import {
5
+ ACTIVITY_NAMES,
6
+ ACTIVITY_STATUS,
7
+ ACTIVITY_TYPES,
8
+ AGENT_IDS,
9
+ AGGREGATE_OPERATORS,
10
+ AI_OPERATIONS,
11
+ DATA_SOURCES,
12
+ OPERATORS,
13
+ ORDER_DIRECTIONS,
14
+ PANEL_TYPES,
15
+ QUERY_DEFAULTS,
16
+ QUERY_EXPRESSIONS,
17
+ QUERY_FIELD_CONFIGS,
18
+ QUERY_TYPES,
19
+ SPAN_KEYS,
20
+ SPAN_NAMES,
21
+ TOOL_NAMES,
22
+ UNKNOWN_VALUE,
23
+ } from '@/constants/signoz';
24
+ import { fetchAllSpanAttributes_SQL } from '@/lib/api/signoz-sql';
6
25
  import { getLogger } from '@/lib/logger';
7
26
 
8
27
  // Configure axios retry
9
- axiosRetry(axios, {
28
+ axiosRetry(axios, {
10
29
  retries: 3,
11
- retryDelay: axiosRetry.exponentialDelay
30
+ retryDelay: axiosRetry.exponentialDelay,
12
31
  });
13
32
 
14
33
  export const dynamic = 'force-dynamic';
@@ -16,8 +35,6 @@ export const dynamic = 'force-dynamic';
16
35
  const SIGNOZ_URL = process.env.SIGNOZ_URL || 'http://localhost:3080';
17
36
  const SIGNOZ_API_KEY = process.env.SIGNOZ_API_KEY || '';
18
37
 
19
-
20
-
21
38
  // ---------- Types
22
39
 
23
40
  type SigNozListItem = { data?: Record<string, any>; [k: string]: any };
@@ -27,8 +44,6 @@ type SigNozResp = {
27
44
 
28
45
  const START_2020_MS = new Date('2020-01-01T00:00:00Z').getTime();
29
46
 
30
-
31
-
32
47
  function getField(span: SigNozListItem, key: string) {
33
48
  const d = span?.data ?? span;
34
49
  return d?.[key] ?? span?.[key];
@@ -45,7 +60,7 @@ function getNumber(span: SigNozListItem, key: string, fallback = 0): number {
45
60
  return Number.isFinite(n) ? n : fallback;
46
61
  }
47
62
 
48
- async function signozQuery(payload: any): Promise<SigNozResp | null> {
63
+ async function signozQuery(payload: any): Promise<SigNozResp> {
49
64
  const logger = getLogger('signoz-query');
50
65
  try {
51
66
  logger.info({ payload }, 'SigNoz payload');
@@ -58,16 +73,39 @@ async function signozQuery(payload: any): Promise<SigNozResp | null> {
58
73
  timeout: 30000,
59
74
  });
60
75
  const json = response.data as SigNozResp;
61
- const responseData = json?.data?.result?.map((r) => ({ queryName: r.queryName, count: r.list?.length }));
76
+ const responseData = json?.data?.result?.map((r) => ({
77
+ queryName: r.queryName,
78
+ count: r.list?.length,
79
+ }));
62
80
  logger.info({ responseData }, 'SigNoz response (truncated)');
63
81
  return json;
64
82
  } catch (e) {
65
83
  logger.error({ error: e }, 'SigNoz query error');
66
- return null;
84
+
85
+ // Re-throw the error with more context for proper error handling
86
+ if (axios.isAxiosError(e)) {
87
+ if (e.code === 'ECONNREFUSED' || e.code === 'ENOTFOUND' || e.code === 'ETIMEDOUT') {
88
+ throw new Error(`SigNoz service unavailable: ${e.message}`);
89
+ }
90
+ if (e.response?.status === 401 || e.response?.status === 403) {
91
+ throw new Error(`SigNoz authentication failed: ${e.response.statusText}`);
92
+ }
93
+ if (e.response?.status === 400) {
94
+ throw new Error(`Invalid SigNoz query: ${e.response.statusText}`);
95
+ }
96
+ if (e.response?.status === 429) {
97
+ throw new Error(`SigNoz rate limit exceeded: ${e.response.statusText}`);
98
+ }
99
+ if (e.response?.status && e.response.status >= 500) {
100
+ throw new Error(`SigNoz server error: ${e.response.statusText}`);
101
+ }
102
+ throw new Error(`SigNoz request failed: ${e.message}`);
103
+ }
104
+ throw new Error(`SigNoz query failed: ${e instanceof Error ? e.message : 'Unknown error'}`);
67
105
  }
68
106
  }
69
107
 
70
- function parseList(resp: SigNozResp | null, name: string): SigNozListItem[] {
108
+ function parseList(resp: SigNozResp, name: string): SigNozListItem[] {
71
109
  const list = resp?.data?.result?.find((r) => r?.queryName === name)?.list ?? [];
72
110
  return Array.isArray(list) ? list : [];
73
111
  }
@@ -213,7 +251,7 @@ function buildConversationListPayload(
213
251
  key: { key: SPAN_KEYS.HAS_ERROR, ...QUERY_FIELD_CONFIGS.BOOL_TAG_COLUMN },
214
252
  op: OPERATORS.EQUALS,
215
253
  value: true,
216
- },
254
+ },
217
255
  ],
218
256
  [
219
257
  { key: SPAN_KEYS.SPAN_ID, ...QUERY_FIELD_CONFIGS.STRING_TAG_COLUMN },
@@ -234,7 +272,7 @@ function buildConversationListPayload(
234
272
  key: { key: SPAN_KEYS.HAS_ERROR, ...QUERY_FIELD_CONFIGS.BOOL_TAG_COLUMN },
235
273
  op: OPERATORS.EQUALS,
236
274
  value: true,
237
- },
275
+ },
238
276
  ],
239
277
  [
240
278
  { key: SPAN_KEYS.SPAN_ID, ...QUERY_FIELD_CONFIGS.STRING_TAG_COLUMN },
@@ -362,10 +400,9 @@ function buildConversationListPayload(
362
400
  ]
363
401
  ),
364
402
 
365
-
366
403
  durationSpans: listQuery(
367
404
  QUERY_EXPRESSIONS.DURATION_SPANS,
368
- [],
405
+ [],
369
406
  [
370
407
  { key: SPAN_KEYS.TRACE_ID, ...QUERY_FIELD_CONFIGS.STRING_TAG_COLUMN },
371
408
  { key: SPAN_KEYS.PARENT_SPAN_ID, ...QUERY_FIELD_CONFIGS.STRING_TAG_COLUMN },
@@ -566,7 +603,8 @@ export async function GET(
566
603
  for (const span of contextResolutionSpans) {
567
604
  const hasError = getField(span, SPAN_KEYS.HAS_ERROR) === true;
568
605
  const statusMessage =
569
- getString(span, SPAN_KEYS.STATUS_MESSAGE) || getString(span, SPAN_KEYS.OTEL_STATUS_DESCRIPTION, '');
606
+ getString(span, SPAN_KEYS.STATUS_MESSAGE) ||
607
+ getString(span, SPAN_KEYS.OTEL_STATUS_DESCRIPTION, '');
570
608
 
571
609
  // context keys maybe JSON
572
610
  let keys: string[] | undefined;
@@ -595,7 +633,8 @@ export async function GET(
595
633
  for (const span of contextHandleSpans) {
596
634
  const hasError = getField(span, SPAN_KEYS.HAS_ERROR) === true;
597
635
  const statusMessage =
598
- getString(span, SPAN_KEYS.STATUS_MESSAGE) || getString(span, SPAN_KEYS.OTEL_STATUS_DESCRIPTION, '');
636
+ getString(span, SPAN_KEYS.STATUS_MESSAGE) ||
637
+ getString(span, SPAN_KEYS.OTEL_STATUS_DESCRIPTION, '');
599
638
 
600
639
  // context keys maybe JSON
601
640
  let keys: string[] | undefined;
@@ -667,7 +706,7 @@ export async function GET(
667
706
  type: ACTIVITY_TYPES.AI_ASSISTANT_MESSAGE,
668
707
  name: ACTIVITY_NAMES.AI_ASSISTANT_MESSAGE,
669
708
  description: 'AI Assistant responded',
670
- timestamp:getString(span, SPAN_KEYS.AI_RESPONSE_TIMESTAMP),
709
+ timestamp: getString(span, SPAN_KEYS.AI_RESPONSE_TIMESTAMP),
671
710
  status: hasError ? ACTIVITY_STATUS.ERROR : ACTIVITY_STATUS.SUCCESS,
672
711
  agentId: AGENT_IDS.AI_ASSISTANT,
673
712
  agentName: getString(span, SPAN_KEYS.AI_AGENT_NAME_ALT, ACTIVITY_NAMES.UNKNOWN_AGENT),
@@ -688,7 +727,7 @@ export async function GET(
688
727
  type: ACTIVITY_TYPES.AI_GENERATION,
689
728
  name: ACTIVITY_NAMES.AI_TEXT_GENERATION,
690
729
  description: 'AI model generating text response',
691
- timestamp:span.timestamp,
730
+ timestamp: span.timestamp,
692
731
  status: hasError ? ACTIVITY_STATUS.ERROR : ACTIVITY_STATUS.SUCCESS,
693
732
  agentId: getString(span, SPAN_KEYS.AGENT_ID, '') || undefined,
694
733
  agentName: getString(span, SPAN_KEYS.AI_TELEMETRY_FUNCTION_ID, '') || undefined,
@@ -727,7 +766,6 @@ export async function GET(
727
766
 
728
767
  // context fetchers
729
768
  for (const span of contextFetcherSpans) {
730
-
731
769
  const hasError = getField(span, SPAN_KEYS.HAS_ERROR) === true;
732
770
  activities.push({
733
771
  id: getString(span, SPAN_KEYS.SPAN_ID, ''),
@@ -738,7 +776,9 @@ export async function GET(
738
776
  status: hasError ? ACTIVITY_STATUS.ERROR : ACTIVITY_STATUS.SUCCESS,
739
777
  agentId: UNKNOWN_VALUE,
740
778
  agentName: 'Context Fetcher',
741
- result: hasError ? 'Context fetch failed' : getString(span, SPAN_KEYS.HTTP_URL, 'Unknown URL'),
779
+ result: hasError
780
+ ? 'Context fetch failed'
781
+ : getString(span, SPAN_KEYS.HTTP_URL, 'Unknown URL'),
742
782
  });
743
783
  }
744
784
 
@@ -776,13 +816,15 @@ export async function GET(
776
816
  let totalOutputTokens = 0;
777
817
  for (const activity of activities) {
778
818
  if (
779
- (activity.type === ACTIVITY_TYPES.AI_GENERATION || activity.type === ACTIVITY_TYPES.AI_MODEL_STREAMED_TEXT) &&
819
+ (activity.type === ACTIVITY_TYPES.AI_GENERATION ||
820
+ activity.type === ACTIVITY_TYPES.AI_MODEL_STREAMED_TEXT) &&
780
821
  typeof activity.inputTokens === 'number'
781
822
  ) {
782
823
  totalInputTokens += activity.inputTokens;
783
824
  }
784
825
  if (
785
- (activity.type === ACTIVITY_TYPES.AI_GENERATION || activity.type === ACTIVITY_TYPES.AI_MODEL_STREAMED_TEXT) &&
826
+ (activity.type === ACTIVITY_TYPES.AI_GENERATION ||
827
+ activity.type === ACTIVITY_TYPES.AI_MODEL_STREAMED_TEXT) &&
786
828
  typeof activity.outputTokens === 'number'
787
829
  ) {
788
830
  totalOutputTokens += activity.outputTokens;
@@ -791,10 +833,6 @@ export async function GET(
791
833
 
792
834
  const openAICallsCount = aiGenerationSpans.length;
793
835
 
794
-
795
-
796
-
797
-
798
836
  let allSpanAttributes: Array<{
799
837
  spanId: string;
800
838
  traceId: string;
@@ -812,7 +850,6 @@ export async function GET(
812
850
  logger.error({ error: e }, 'allSpanAttributes SQL fetch skipped/failed');
813
851
  }
814
852
 
815
-
816
853
  const conversation = {
817
854
  conversationId,
818
855
  startTime: conversationStartTime ? conversationStartTime : null,
@@ -821,11 +858,15 @@ export async function GET(
821
858
  totalMessages: (() => {
822
859
  let count = 0;
823
860
  for (const a of activities) {
824
- if (a.type === ACTIVITY_TYPES.USER_MESSAGE || a.type === ACTIVITY_TYPES.AI_ASSISTANT_MESSAGE) count++;
861
+ if (
862
+ a.type === ACTIVITY_TYPES.USER_MESSAGE ||
863
+ a.type === ACTIVITY_TYPES.AI_ASSISTANT_MESSAGE
864
+ )
865
+ count++;
825
866
  }
826
867
  return count;
827
868
  })(),
828
- totalToolCalls: activities.filter(a => a.type === ACTIVITY_TYPES.TOOL_CALL).length,
869
+ totalToolCalls: activities.filter((a) => a.type === ACTIVITY_TYPES.TOOL_CALL).length,
829
870
  totalErrors: errorCount,
830
871
  totalOpenAICalls: openAICallsCount,
831
872
  };
@@ -848,7 +889,7 @@ export async function GET(
848
889
  conversationDuration: conversationDurationMs,
849
890
  totalInputTokens,
850
891
  totalOutputTokens,
851
- mcpToolErrors: [],
892
+ mcpToolErrors: [],
852
893
  contextErrors,
853
894
  agentGenerationErrors,
854
895
  graphId,
@@ -858,6 +899,26 @@ export async function GET(
858
899
  } catch (error) {
859
900
  const logger = getLogger('conversation-details');
860
901
  logger.error({ error }, 'Error fetching conversation details');
861
- return NextResponse.json({ error: 'Failed to fetch conversation details' }, { status: 500 });
902
+
903
+ // Provide more specific error responses based on the error type
904
+ const errorMessage =
905
+ error instanceof Error ? error.message : 'Failed to fetch conversation details';
906
+
907
+ if (errorMessage.includes('SigNoz service unavailable')) {
908
+ return NextResponse.json({ error: errorMessage }, { status: 503 });
909
+ }
910
+ if (errorMessage.includes('SigNoz authentication failed')) {
911
+ return NextResponse.json({ error: errorMessage }, { status: 502 });
912
+ }
913
+ if (errorMessage.includes('Invalid SigNoz query')) {
914
+ return NextResponse.json({ error: errorMessage }, { status: 400 });
915
+ }
916
+ if (errorMessage.includes('SigNoz rate limit exceeded')) {
917
+ return NextResponse.json({ error: errorMessage }, { status: 429 });
918
+ }
919
+ if (errorMessage.includes('SigNoz server error')) {
920
+ return NextResponse.json({ error: errorMessage }, { status: 502 });
921
+ }
922
+ return NextResponse.json({ error: errorMessage }, { status: 500 });
862
923
  }
863
924
  }