@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.
- package/.env.example +10 -0
- package/.turbo/turbo-build.log +48 -54
- package/.turbo/turbo-test.log +7 -7
- package/.turbo/turbo-typecheck.log +1 -1
- package/LICENSE.md +22 -17
- package/README.md +3 -3
- package/biome.json +3 -0
- package/package.json +10 -9
- package/src/app/api/signoz/conversations/[conversationId]/route.ts +95 -34
- package/src/app/api/signoz/route.ts +8 -6
- package/src/components/api-keys/form/api-key-form.tsx +2 -0
- package/src/components/api-keys/form/validation.ts +1 -1
- package/src/components/artifact-components/form/artifact-component-form.tsx +20 -6
- package/src/components/artifact-components/form/validation.ts +3 -3
- package/src/components/credentials/views/credential-form-validation.ts +1 -1
- package/src/components/credentials/views/credential-form.tsx +2 -0
- package/src/components/credentials/views/edit-credential-form.tsx +1 -1
- package/src/components/credentials/views/generic-auth-form.tsx +1 -1
- package/src/components/data-components/form/data-component-form.tsx +19 -1
- package/src/components/data-components/form/validation.ts +3 -2
- package/src/components/form/expandable-field.tsx +6 -1
- package/src/components/form/form-field-wrapper.tsx +3 -1
- package/src/components/form/generic-combo-box.tsx +3 -1
- package/src/components/form/generic-input.tsx +9 -1
- package/src/components/form/generic-select.tsx +3 -1
- package/src/components/form/generic-textarea.tsx +3 -1
- package/src/components/form/json-schema-input.tsx +9 -1
- package/src/components/graph/configuration/node-types.tsx +2 -4
- package/src/components/graph/graph.tsx +4 -26
- package/src/components/graph/nodes/agent-node.tsx +1 -1
- package/src/components/graph/nodes/external-agent-node.tsx +1 -1
- package/src/components/graph/playground/chat-widget.tsx +31 -2
- package/src/components/graph/playground/ikp-message.tsx +16 -16
- package/src/components/graph/playground/playground.tsx +12 -6
- package/src/components/graph/sidepane/metadata/metadata-editor.tsx +62 -45
- package/src/components/graph/sidepane/nodes/agent-node-editor.tsx +56 -27
- package/src/components/graph/sidepane/nodes/expandable-text-area.tsx +3 -1
- package/src/components/graph/sidepane/nodes/external-agent-node-editor.tsx +31 -11
- package/src/components/graph/sidepane/nodes/form-fields.tsx +10 -1
- package/src/components/graph/sidepane/nodes/mcp-node-editor.tsx +4 -9
- package/src/components/graph/sidepane/nodes/model-section.tsx +1 -1
- package/src/components/graph/toolbar/toolbar.tsx +1 -1
- package/src/components/mcp-servers/form/active-tools-selector.tsx +4 -2
- package/src/components/mcp-servers/form/mcp-server-form.tsx +8 -1
- package/src/components/mcp-servers/form/validation.ts +1 -1
- package/src/components/projects/edit-project-dialog.tsx +1 -1
- package/src/components/projects/form/project-form.tsx +20 -8
- package/src/components/projects/form/project-models-section.tsx +51 -23
- package/src/components/projects/form/project-stopwhen-section.tsx +25 -11
- package/src/components/projects/form/validation.ts +14 -10
- package/src/components/projects/new-project-dialog.tsx +1 -1
- package/src/components/traces/ai-calls-breakdown.tsx +1 -1
- package/src/components/traces/charts/area-chart-card.tsx +2 -2
- package/src/components/traces/charts/area-chart.tsx +2 -2
- package/src/components/traces/charts/chart-card.tsx +4 -4
- package/src/components/traces/conversation-detail.tsx +10 -8
- package/src/components/traces/conversation-stats/conversation-list-item.tsx +48 -37
- package/src/components/traces/conversation-stats/conversation-stats-card.tsx +1 -1
- package/src/components/traces/filters/date-picker.tsx +6 -6
- package/src/components/traces/filters/filter-trigger.tsx +1 -1
- package/src/components/traces/filters/graph-filter.tsx +3 -3
- package/src/components/traces/timeline/activity-details-sidepane.tsx +1 -1
- package/src/components/traces/timeline/activity-timeline.tsx +1 -1
- package/src/components/traces/timeline/blocks.tsx +2 -2
- package/src/components/traces/timeline/render-panel-content.tsx +11 -11
- package/src/components/traces/timeline/timeline-item.tsx +36 -22
- package/src/components/traces/timeline/timeline-wrapper.tsx +125 -37
- package/src/components/traces/traces-overview.tsx +3 -3
- package/src/components/ui/alert.tsx +60 -0
- package/src/components/ui/calendar.tsx +3 -4
- package/src/components/ui/external-link.tsx +2 -2
- package/src/components/ui/form.tsx +11 -4
- package/src/components/ui/inheritance-indicator.tsx +20 -17
- package/src/components/ui/resizable.tsx +13 -18
- package/src/constants/page-descriptions.tsx +2 -5
- package/src/constants/signoz.ts +15 -18
- package/src/features/graph/domain/__tests__/roundtrip.test.ts +5 -5
- package/src/features/graph/domain/serialize.ts +8 -9
- package/src/hooks/use-auto-prefill-id-zustand.ts +68 -0
- package/src/hooks/use-auto-prefill-id.ts +36 -0
- package/src/hooks/use-chat-activities-polling.ts +45 -12
- package/src/hooks/use-graph-errors.ts +2 -1
- package/src/hooks/use-project-data.ts +2 -2
- package/src/lib/actions/graph-full.ts +6 -2
- package/src/lib/actions/projects.ts +1 -1
- package/src/lib/api/api-config.ts +6 -6
- package/src/lib/api/api-keys.ts +4 -1
- package/src/lib/api/credentials.ts +1 -1
- package/src/lib/api/data-components.ts +1 -1
- package/src/lib/api/graph-full-client.ts +6 -3
- package/src/lib/api/projects.ts +1 -1
- package/src/lib/api/signoz-sql.ts +1 -1
- package/src/lib/api/signoz-stats.ts +958 -304
- package/src/lib/index.ts +1 -1
- package/src/lib/logger.ts +1 -2
- package/src/lib/types/graph-full.ts +1 -1
- package/src/lib/utils/generate-id.ts +14 -0
- package/src/lib/validation.ts +1 -1
- package/tsconfig.json +2 -2
- package/.env.sample +0 -5
- 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=
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @inkeep/agents-manage-ui@0.1.
|
|
3
|
+
> @inkeep/agents-manage-ui@0.1.2 build /Users/mileskaming-thanassi/agents/agents-manage-ui
|
|
4
4
|
> next build
|
|
5
5
|
|
|
6
6
|
[33m[1m⚠[22m[39m Warning: Found multiple lockfiles. Selecting /Users/mileskaming-thanassi/package-lock.json.
|
|
@@ -12,72 +12,66 @@
|
|
|
12
12
|
[37m[1m [22m[39m Creating an optimized production build ...
|
|
13
13
|
[32m[1m✓[22m[39m Compiled successfully in 8.0s
|
|
14
14
|
[37m[1m [22m[39m Skipping linting
|
|
15
|
-
[?25l [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G[?25h [37m[1m [22m[39m Checking validity of types
|
|
16
15
|
[32m[1m✓[22m[39m Checking validity of types
|
|
17
|
-
[?25l [37m[1m [22m[39m
|
|
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 [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m.[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m..[39m[2K[1G [37m[1m [22m[39m Checking validity of types [36m...[39m[2K[1G[?25h [37m[1m [22m[39m Checking validity of types
|
|
37
17
|
[32m[1m✓[22m[39m Checking validity of types
|
|
18
|
+
[?25l [37m[1m [22m[39m Collecting page data [36m.[39m[2K[1G [37m[1m [22m[39m Collecting page data [36m..[39mNEXT_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
|
[2K[1G[?25h [37m[1m [22m[39m Collecting page data
|
|
39
41
|
[32m[1m✓[22m[39m Collecting page data
|
|
40
|
-
[?25l [37m[1m [22m[39m Generating static pages (0/7) [36m[ ][39m[2K[1G [37m[1m [22m[39m Generating static pages (0/7) [36m[= ][39m[2K[1G [37m[1m [22m[39m Generating static pages (
|
|
41
|
-
|
|
42
|
+
[?25l [37m[1m [22m[39m Generating static pages (0/7) [36m[ ][39m[2K[1G [37m[1m [22m[39m Generating static pages (0/7) [36m[= ][39m[2K[1G [37m[1m [22m[39m Generating static pages (0/7) [36m[== ][39m[2K[1G[?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 [32m[1m✓[22m[39m Generating static pages (7/7)
|
|
52
|
-
[?25l [37m[1m [22m[39m Finalizing page optimization [36m.[39m[?25l [37m[1m [22m[39m Collecting build traces [36m.[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m..[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m..[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m...[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m...[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m.[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m.[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m..[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m..[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m...[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m...[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m.[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m.[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m..[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m..[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m...[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m...[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m.[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m.[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m..[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m..[39m[2K[1G[?25h [37m[1m [22m[39m Collecting build traces
|
|
53
46
|
[32m[1m✓[22m[39m Collecting build traces
|
|
47
|
+
[?25l [37m[1m [22m[39m Finalizing page optimization [36m.[39m[?25l [37m[1m [22m[39m Collecting build traces [36m.[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m..[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m..[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m...[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m...[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m.[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m.[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m..[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m..[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m...[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m...[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m.[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m.[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m..[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m..[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m...[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m...[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m.[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m.[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m..[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m..[39m[2K[1G [37m[1m [22m[39m Finalizing page optimization [36m...[39m[2K[1G [37m[1m [22m[39m Collecting build traces [36m...[39m[2K[1G[?25h [37m[1m [22m[39m Collecting build traces
|
|
54
48
|
[32m[1m✓[22m[39m Collecting build traces
|
|
55
49
|
[2K[1G[?25h [37m[1m [22m[39m Finalizing page optimization
|
|
56
50
|
[32m[1m✓[22m[39m Finalizing page optimization
|
|
57
51
|
|
|
58
52
|
[4mRoute (app)[24m [4mSize[24m [4mFirst Load JS[24m [4m[24m [4m[24m
|
|
59
53
|
┌ ○ / 142 B [37m[1m105 kB[22m[39m
|
|
60
54
|
├ ○ /_not-found 1 kB [37m[1m106 kB[22m[39m
|
|
61
55
|
├ ƒ /[tenantId] 142 B [37m[1m105 kB[22m[39m
|
|
62
|
-
├ ƒ /[tenantId]/projects 2.68 kB [37m[
|
|
56
|
+
├ ƒ /[tenantId]/projects 2.68 kB [37m[1m343 kB[22m[39m
|
|
63
57
|
├ ƒ /[tenantId]/projects/[projectId] 142 B [37m[1m105 kB[22m[39m
|
|
64
|
-
├ ƒ /[tenantId]/projects/[projectId]/api-keys 8.
|
|
65
|
-
├ ƒ /[tenantId]/projects/[projectId]/artifact-components 1.
|
|
66
|
-
├ ƒ /[tenantId]/projects/[projectId]/artifact-components/[artifactComponentId] 1.
|
|
67
|
-
├ ƒ /[tenantId]/projects/[projectId]/artifact-components/new 1.
|
|
68
|
-
├ ƒ /[tenantId]/projects/[projectId]/credentials 1.
|
|
69
|
-
├ ƒ /[tenantId]/projects/[projectId]/credentials/[credentialId] 3.
|
|
58
|
+
├ ƒ /[tenantId]/projects/[projectId]/api-keys 8.73 kB [37m[1m213 kB[22m[39m
|
|
59
|
+
├ ƒ /[tenantId]/projects/[projectId]/artifact-components 1.31 kB [37m[1m168 kB[22m[39m
|
|
60
|
+
├ ƒ /[tenantId]/projects/[projectId]/artifact-components/[artifactComponentId] 1.59 kB [37m[1m341 kB[22m[39m
|
|
61
|
+
├ ƒ /[tenantId]/projects/[projectId]/artifact-components/new 1.59 kB [37m[1m341 kB[22m[39m
|
|
62
|
+
├ ƒ /[tenantId]/projects/[projectId]/credentials 1.77 kB [37m[1m174 kB[22m[39m
|
|
63
|
+
├ ƒ /[tenantId]/projects/[projectId]/credentials/[credentialId] 3.92 kB [37m[1m184 kB[22m[39m
|
|
70
64
|
├ ƒ /[tenantId]/projects/[projectId]/credentials/new 206 B [37m[1m147 kB[22m[39m
|
|
71
|
-
├ ƒ /[tenantId]/projects/[projectId]/credentials/new/bearer 7.
|
|
65
|
+
├ ƒ /[tenantId]/projects/[projectId]/credentials/new/bearer 7.57 kB [37m[1m212 kB[22m[39m
|
|
72
66
|
├ ƒ /[tenantId]/projects/[projectId]/credentials/new/providers 3.15 kB [37m[1m155 kB[22m[39m
|
|
73
|
-
├ ƒ /[tenantId]/projects/[projectId]/credentials/new/providers/[providerId] 10.
|
|
74
|
-
├ ƒ /[tenantId]/projects/[projectId]/data-components 1.
|
|
75
|
-
├ ƒ /[tenantId]/projects/[projectId]/data-components/[dataComponentId]
|
|
76
|
-
├ ƒ /[tenantId]/projects/[projectId]/data-components/new
|
|
77
|
-
├ ƒ /[tenantId]/projects/[projectId]/graphs 1.
|
|
78
|
-
├ ƒ /[tenantId]/projects/[projectId]/graphs/[graphId]
|
|
79
|
-
├ ƒ /[tenantId]/projects/[projectId]/graphs/new 199 B [37m[
|
|
80
|
-
├ ƒ /[tenantId]/projects/[projectId]/mcp-servers
|
|
67
|
+
├ ƒ /[tenantId]/projects/[projectId]/credentials/new/providers/[providerId] 10.7 kB [37m[1m212 kB[22m[39m
|
|
68
|
+
├ ƒ /[tenantId]/projects/[projectId]/data-components 1.31 kB [37m[1m168 kB[22m[39m
|
|
69
|
+
├ ƒ /[tenantId]/projects/[projectId]/data-components/[dataComponentId] 1.5 kB [37m[1m341 kB[22m[39m
|
|
70
|
+
├ ƒ /[tenantId]/projects/[projectId]/data-components/new 1.5 kB [37m[1m341 kB[22m[39m
|
|
71
|
+
├ ƒ /[tenantId]/projects/[projectId]/graphs 1.29 kB [37m[1m168 kB[22m[39m
|
|
72
|
+
├ ƒ /[tenantId]/projects/[projectId]/graphs/[graphId] 199 B [37m[1m984 kB[22m[39m
|
|
73
|
+
├ ƒ /[tenantId]/projects/[projectId]/graphs/new 199 B [37m[1m984 kB[22m[39m
|
|
74
|
+
├ ƒ /[tenantId]/projects/[projectId]/mcp-servers 3.94 kB [37m[1m176 kB[22m[39m
|
|
81
75
|
├ ƒ /[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId] 5.23 kB [37m[1m157 kB[22m[39m
|
|
82
|
-
├ ƒ /[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit
|
|
83
|
-
├ ƒ /[tenantId]/projects/[projectId]/mcp-servers/new 1.41 kB [37m[
|
|
84
|
-
├ ƒ /[tenantId]/projects/[projectId]/traces 208 kB [37m[
|
|
85
|
-
├ ƒ /[tenantId]/projects/[projectId]/traces/ai-calls 3.59 kB [37m[
|
|
86
|
-
├ ƒ /[tenantId]/projects/[projectId]/traces/conversations/[conversationId]
|
|
76
|
+
├ ƒ /[tenantId]/projects/[projectId]/mcp-servers/[mcpServerId]/edit 216 B [37m[1m194 kB[22m[39m
|
|
77
|
+
├ ƒ /[tenantId]/projects/[projectId]/mcp-servers/new 1.41 kB [37m[1m182 kB[22m[39m
|
|
78
|
+
├ ƒ /[tenantId]/projects/[projectId]/traces 208 kB [37m[1m431 kB[22m[39m
|
|
79
|
+
├ ƒ /[tenantId]/projects/[projectId]/traces/ai-calls 3.59 kB [37m[1m209 kB[22m[39m
|
|
80
|
+
├ ƒ /[tenantId]/projects/[projectId]/traces/conversations/[conversationId] 4.04 kB [37m[1m390 kB[22m[39m
|
|
87
81
|
├ ƒ /api/signoz 142 B [37m[1m105 kB[22m[39m
|
|
88
82
|
├ ƒ /api/signoz/conversations/[conversationId] 142 B [37m[1m105 kB[22m[39m
|
|
89
83
|
└ ○ /icon.svg 0 B [37m[1m0 B[22m[39m
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @inkeep/agents-manage-ui@0.1.
|
|
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
|
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (3)[39m
|
|
13
13
|
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (0)[39m
|
|
14
|
-
[2m Start at [
|
|
15
|
-
[2m Duration [
|
|
14
|
+
[2m Start at [22m16:07:15
|
|
15
|
+
[2m Duration [22m106ms
|
|
16
16
|
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K [32m✓[39m src/app/utils/__tests__/format-date.test.ts [2m([22m[2m22 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
17
17
|
|
|
18
18
|
[1m[33m ❯ [39m[22msrc/features/graph/domain/__tests__/roundtrip.test.ts[2m 0/1[22m
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
|
|
21
21
|
[2m Test Files [22m[1m[32m1 passed[39m[22m[90m (3)[39m
|
|
22
22
|
[2m Tests [22m[1m[32m22 passed[39m[22m[90m (23)[39m
|
|
23
|
-
[2m Start at [
|
|
24
|
-
[2m Duration [
|
|
23
|
+
[2m Start at [22m16:07:15
|
|
24
|
+
[2m Duration [22m307ms
|
|
25
25
|
[?2026l[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K [32m✓[39m src/features/graph/domain/__tests__/serialize.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
26
26
|
[32m✓[39m src/features/graph/domain/__tests__/roundtrip.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
27
27
|
|
|
28
28
|
[2m Test Files [22m [1m[32m3 passed[39m[22m[90m (3)[39m
|
|
29
29
|
[2m Tests [22m [1m[32m30 passed[39m[22m[90m (30)[39m
|
|
30
|
-
[2m Start at [22m
|
|
31
|
-
[2m Duration [22m
|
|
30
|
+
[2m Start at [22m 16:07:15
|
|
31
|
+
[2m Duration [22m 431ms[2m (transform 100ms, setup 0ms, collect 482ms, tests 23ms, environment 0ms, prepare 134ms)[22m
|
|
32
32
|
|
|
33
33
|
[?25h
|
package/LICENSE.md
CHANGED
|
@@ -1,44 +1,49 @@
|
|
|
1
|
-
Elastic License
|
|
2
|
-
|
|
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
|
|
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
|
-
|
|
52
|
-
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-manage-ui",
|
|
3
|
-
"version": "0.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": "^
|
|
58
|
+
"zod": "^3.25.76",
|
|
59
59
|
"zustand": "^5.0.7",
|
|
60
|
-
"@inkeep/agents-manage-api": "0.1.
|
|
61
|
-
"@inkeep/agents-
|
|
62
|
-
"@inkeep/agents-
|
|
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": "
|
|
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 {
|
|
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
|
|
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) => ({
|
|
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
|
-
|
|
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
|
|
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) ||
|
|
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) ||
|
|
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
|
|
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 ||
|
|
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 ||
|
|
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 (
|
|
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
|
-
|
|
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
|
}
|