@contractspec/example.agent-console 3.7.6 → 3.7.7

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 (175) hide show
  1. package/.turbo/turbo-build.log +18 -18
  2. package/AGENTS.md +50 -31
  3. package/README.md +69 -77
  4. package/dist/agent/agent.event.js +1 -1
  5. package/dist/agent/agent.operation.js +1 -1
  6. package/dist/agent/index.d.ts +5 -5
  7. package/dist/agent/index.js +1 -1
  8. package/dist/browser/agent/agent.event.js +1 -1
  9. package/dist/browser/agent/agent.operation.js +1 -1
  10. package/dist/browser/agent/index.js +1 -1
  11. package/dist/browser/index.js +2145 -2145
  12. package/dist/browser/presentations/index.js +4 -4
  13. package/dist/browser/run/index.js +536 -536
  14. package/dist/browser/run/run.event.js +2 -2
  15. package/dist/browser/run/run.presentation.js +2 -2
  16. package/dist/browser/tool/index.js +260 -260
  17. package/dist/browser/tool/tool.event.js +1 -1
  18. package/dist/browser/tool/tool.presentation.js +2 -2
  19. package/dist/browser/ui/AgentDashboard.js +956 -956
  20. package/dist/browser/ui/AgentRunList.js +16 -16
  21. package/dist/browser/ui/AgentToolRegistry.js +9 -9
  22. package/dist/browser/ui/hooks/index.js +153 -153
  23. package/dist/browser/ui/hooks/useAgentList.js +1 -1
  24. package/dist/browser/ui/hooks/useAgentMutations.js +1 -1
  25. package/dist/browser/ui/hooks/useRunList.js +1 -1
  26. package/dist/browser/ui/hooks/useToolList.js +1 -1
  27. package/dist/browser/ui/index.js +1222 -1222
  28. package/dist/browser/ui/modals/AgentActionsModal.js +13 -13
  29. package/dist/browser/ui/modals/CreateAgentModal.js +15 -15
  30. package/dist/browser/ui/modals/index.js +297 -297
  31. package/dist/browser/ui/renderers/agent-list.renderer.js +7 -7
  32. package/dist/browser/ui/renderers/index.js +157 -157
  33. package/dist/browser/ui/views/AgentListView.js +7 -7
  34. package/dist/browser/ui/views/RunListView.js +16 -16
  35. package/dist/browser/ui/views/ToolRegistryView.js +9 -9
  36. package/dist/browser/ui/views/index.js +97 -97
  37. package/dist/handlers/index.d.ts +1 -1
  38. package/dist/index.d.ts +4 -4
  39. package/dist/index.js +2145 -2145
  40. package/dist/node/agent/agent.event.js +1 -1
  41. package/dist/node/agent/agent.operation.js +1 -1
  42. package/dist/node/agent/index.js +1 -1
  43. package/dist/node/index.js +2145 -2145
  44. package/dist/node/presentations/index.js +4 -4
  45. package/dist/node/run/index.js +536 -536
  46. package/dist/node/run/run.event.js +2 -2
  47. package/dist/node/run/run.presentation.js +2 -2
  48. package/dist/node/tool/index.js +260 -260
  49. package/dist/node/tool/tool.event.js +1 -1
  50. package/dist/node/tool/tool.presentation.js +2 -2
  51. package/dist/node/ui/AgentDashboard.js +956 -956
  52. package/dist/node/ui/AgentRunList.js +16 -16
  53. package/dist/node/ui/AgentToolRegistry.js +9 -9
  54. package/dist/node/ui/hooks/index.js +153 -153
  55. package/dist/node/ui/hooks/useAgentList.js +1 -1
  56. package/dist/node/ui/hooks/useAgentMutations.js +1 -1
  57. package/dist/node/ui/hooks/useRunList.js +1 -1
  58. package/dist/node/ui/hooks/useToolList.js +1 -1
  59. package/dist/node/ui/index.js +1222 -1222
  60. package/dist/node/ui/modals/AgentActionsModal.js +13 -13
  61. package/dist/node/ui/modals/CreateAgentModal.js +15 -15
  62. package/dist/node/ui/modals/index.js +297 -297
  63. package/dist/node/ui/renderers/agent-list.renderer.js +7 -7
  64. package/dist/node/ui/renderers/index.js +157 -157
  65. package/dist/node/ui/views/AgentListView.js +7 -7
  66. package/dist/node/ui/views/RunListView.js +16 -16
  67. package/dist/node/ui/views/ToolRegistryView.js +9 -9
  68. package/dist/node/ui/views/index.js +97 -97
  69. package/dist/presentations/index.d.ts +3 -5
  70. package/dist/presentations/index.js +4 -4
  71. package/dist/run/index.d.ts +7 -7
  72. package/dist/run/index.js +536 -536
  73. package/dist/run/run.event.js +2 -2
  74. package/dist/run/run.handler.d.ts +3 -0
  75. package/dist/run/run.presentation.js +2 -2
  76. package/dist/shared/index.d.ts +1 -1
  77. package/dist/tool/index.d.ts +7 -7
  78. package/dist/tool/index.js +260 -260
  79. package/dist/tool/tool.event.js +1 -1
  80. package/dist/tool/tool.handler.d.ts +1 -1
  81. package/dist/tool/tool.presentation.js +2 -2
  82. package/dist/ui/AgentDashboard.js +956 -956
  83. package/dist/ui/AgentRunList.js +16 -16
  84. package/dist/ui/AgentToolRegistry.js +9 -9
  85. package/dist/ui/hooks/index.d.ts +4 -4
  86. package/dist/ui/hooks/index.js +153 -153
  87. package/dist/ui/hooks/useAgentList.d.ts +5 -0
  88. package/dist/ui/hooks/useAgentList.js +1 -1
  89. package/dist/ui/hooks/useAgentMutations.d.ts +9 -2
  90. package/dist/ui/hooks/useAgentMutations.js +1 -1
  91. package/dist/ui/hooks/useRunList.d.ts +5 -0
  92. package/dist/ui/hooks/useRunList.js +1 -1
  93. package/dist/ui/hooks/useToolList.d.ts +5 -0
  94. package/dist/ui/hooks/useToolList.js +1 -1
  95. package/dist/ui/index.d.ts +3 -3
  96. package/dist/ui/index.js +1222 -1222
  97. package/dist/ui/modals/AgentActionsModal.js +13 -13
  98. package/dist/ui/modals/CreateAgentModal.js +15 -15
  99. package/dist/ui/modals/index.d.ts +1 -1
  100. package/dist/ui/modals/index.js +297 -297
  101. package/dist/ui/renderers/agent-list.markdown.d.ts +5 -0
  102. package/dist/ui/renderers/agent-list.renderer.js +7 -7
  103. package/dist/ui/renderers/dashboard.markdown.d.ts +5 -0
  104. package/dist/ui/renderers/index.d.ts +2 -2
  105. package/dist/ui/renderers/index.js +157 -157
  106. package/dist/ui/renderers/run-list.markdown.d.ts +5 -0
  107. package/dist/ui/renderers/tool-registry.markdown.d.ts +5 -0
  108. package/dist/ui/views/AgentListView.js +7 -7
  109. package/dist/ui/views/RunListView.js +16 -16
  110. package/dist/ui/views/ToolRegistryView.js +9 -9
  111. package/dist/ui/views/index.js +97 -97
  112. package/package.json +6 -6
  113. package/src/agent/agent.entity.ts +111 -111
  114. package/src/agent/agent.enum.ts +12 -12
  115. package/src/agent/agent.event.ts +91 -91
  116. package/src/agent/agent.handler.ts +123 -123
  117. package/src/agent/agent.operation.ts +400 -400
  118. package/src/agent/agent.presentation.ts +62 -62
  119. package/src/agent/agent.schema.ts +175 -175
  120. package/src/agent/agent.test-spec.ts +48 -48
  121. package/src/agent/index.ts +46 -51
  122. package/src/agent.capability.ts +11 -11
  123. package/src/agent.feature.ts +131 -131
  124. package/src/docs/agent-console.docblock.ts +42 -42
  125. package/src/example.ts +35 -35
  126. package/src/handlers/agent.handlers.ts +522 -521
  127. package/src/handlers/index.ts +12 -12
  128. package/src/index.ts +8 -9
  129. package/src/presentations/index.ts +11 -13
  130. package/src/run/index.ts +49 -54
  131. package/src/run/run.entity.ts +137 -137
  132. package/src/run/run.enum.ts +18 -18
  133. package/src/run/run.event.ts +174 -174
  134. package/src/run/run.handler.ts +92 -91
  135. package/src/run/run.operation.ts +474 -474
  136. package/src/run/run.presentation.ts +42 -42
  137. package/src/run/run.schema.ts +126 -126
  138. package/src/run/run.test-spec.ts +48 -48
  139. package/src/seeders/index.ts +21 -21
  140. package/src/shared/index.ts +1 -1
  141. package/src/shared/mock-agents.ts +76 -76
  142. package/src/shared/mock-runs.ts +102 -102
  143. package/src/shared/mock-tools.ts +140 -140
  144. package/src/shared/overlay-types.ts +23 -23
  145. package/src/tool/index.ts +39 -44
  146. package/src/tool/tool.entity.ts +73 -73
  147. package/src/tool/tool.enum.ts +13 -13
  148. package/src/tool/tool.event.ts +80 -80
  149. package/src/tool/tool.handler.ts +102 -102
  150. package/src/tool/tool.operation.ts +328 -328
  151. package/src/tool/tool.presentation.ts +43 -43
  152. package/src/tool/tool.schema.ts +106 -106
  153. package/src/tool/tool.test-spec.ts +48 -48
  154. package/src/ui/AgentDashboard.tsx +348 -348
  155. package/src/ui/hooks/index.ts +7 -7
  156. package/src/ui/hooks/useAgentList.ts +57 -56
  157. package/src/ui/hooks/useAgentMutations.ts +160 -159
  158. package/src/ui/hooks/useRunList.ts +58 -57
  159. package/src/ui/hooks/useToolList.ts +102 -101
  160. package/src/ui/index.ts +6 -9
  161. package/src/ui/modals/AgentActionsModal.tsx +262 -262
  162. package/src/ui/modals/CreateAgentModal.tsx +232 -232
  163. package/src/ui/modals/index.ts +1 -1
  164. package/src/ui/overlays/demo-overlays.ts +52 -52
  165. package/src/ui/renderers/agent-list.markdown.ts +61 -60
  166. package/src/ui/renderers/agent-list.renderer.tsx +14 -14
  167. package/src/ui/renderers/dashboard.markdown.ts +140 -139
  168. package/src/ui/renderers/index.ts +3 -4
  169. package/src/ui/renderers/run-list.markdown.ts +48 -47
  170. package/src/ui/renderers/tool-registry.markdown.ts +66 -65
  171. package/src/ui/views/AgentListView.tsx +90 -90
  172. package/src/ui/views/RunListView.tsx +141 -141
  173. package/src/ui/views/ToolRegistryView.tsx +113 -113
  174. package/tsconfig.json +7 -8
  175. package/tsdown.config.js +7 -3
@@ -2,80 +2,80 @@
2
2
  * Mock agent data for testing and demos.
3
3
  */
4
4
  export const MOCK_AGENTS = [
5
- {
6
- id: 'agent-1',
7
- organizationId: 'demo-org',
8
- name: 'Customer Support Bot',
9
- slug: 'customer-support-bot',
10
- description: 'Handles tier-1 customer inquiries and routes complex issues.',
11
- status: 'ACTIVE' as const,
12
- modelProvider: 'OPENAI' as const,
13
- modelName: 'gpt-4o-mini',
14
- modelConfig: { temperature: 0.7 },
15
- systemPrompt: 'You are a helpful customer support assistant.',
16
- toolChoice: 'auto' as const,
17
- maxIterations: 10,
18
- timeoutMs: 120000,
19
- version: '1.0.0',
20
- tags: ['support', 'tier-1'],
21
- createdAt: new Date('2024-01-15T10:00:00Z'),
22
- updatedAt: new Date('2024-03-20T14:30:00Z'),
23
- },
24
- {
25
- id: 'agent-2',
26
- organizationId: 'demo-org',
27
- name: 'Code Review Assistant',
28
- slug: 'code-review-assistant',
29
- description: 'Reviews pull requests and provides actionable feedback.',
30
- status: 'ACTIVE' as const,
31
- modelProvider: 'ANTHROPIC' as const,
32
- modelName: 'claude-sonnet-4-20250514',
33
- modelConfig: { temperature: 0.3 },
34
- systemPrompt: 'You are a code review expert.',
35
- toolChoice: 'auto' as const,
36
- maxIterations: 15,
37
- timeoutMs: 180000,
38
- version: '2.1.0',
39
- tags: ['code', 'review', 'dev'],
40
- createdAt: new Date('2024-02-10T09:00:00Z'),
41
- updatedAt: new Date('2024-04-05T11:15:00Z'),
42
- },
43
- {
44
- id: 'agent-3',
45
- organizationId: 'demo-org',
46
- name: 'Data Analyst',
47
- slug: 'data-analyst',
48
- description: 'Queries databases and generates insights from data.',
49
- status: 'PAUSED' as const,
50
- modelProvider: 'OPENAI' as const,
51
- modelName: 'gpt-4o',
52
- modelConfig: { temperature: 0.5 },
53
- systemPrompt: 'You are a data analyst expert in SQL and analytics.',
54
- toolChoice: 'required' as const,
55
- maxIterations: 20,
56
- timeoutMs: 300000,
57
- version: '1.2.0',
58
- tags: ['data', 'analytics', 'sql'],
59
- createdAt: new Date('2024-03-01T08:00:00Z'),
60
- updatedAt: new Date('2024-04-10T16:45:00Z'),
61
- },
62
- {
63
- id: 'agent-4',
64
- organizationId: 'demo-org',
65
- name: 'Meeting Scheduler',
66
- slug: 'meeting-scheduler',
67
- description: 'Schedules meetings and manages calendar conflicts.',
68
- status: 'DRAFT' as const,
69
- modelProvider: 'GOOGLE' as const,
70
- modelName: 'gemini-2.0-flash',
71
- modelConfig: { temperature: 0.2 },
72
- systemPrompt: 'You help schedule and organize meetings efficiently.',
73
- toolChoice: 'auto' as const,
74
- maxIterations: 5,
75
- timeoutMs: 60000,
76
- version: '0.1.0',
77
- tags: ['calendar', 'scheduling'],
78
- createdAt: new Date('2024-04-01T12:00:00Z'),
79
- updatedAt: new Date('2024-04-01T12:00:00Z'),
80
- },
5
+ {
6
+ id: 'agent-1',
7
+ organizationId: 'demo-org',
8
+ name: 'Customer Support Bot',
9
+ slug: 'customer-support-bot',
10
+ description: 'Handles tier-1 customer inquiries and routes complex issues.',
11
+ status: 'ACTIVE' as const,
12
+ modelProvider: 'OPENAI' as const,
13
+ modelName: 'gpt-4o-mini',
14
+ modelConfig: { temperature: 0.7 },
15
+ systemPrompt: 'You are a helpful customer support assistant.',
16
+ toolChoice: 'auto' as const,
17
+ maxIterations: 10,
18
+ timeoutMs: 120000,
19
+ version: '1.0.0',
20
+ tags: ['support', 'tier-1'],
21
+ createdAt: new Date('2024-01-15T10:00:00Z'),
22
+ updatedAt: new Date('2024-03-20T14:30:00Z'),
23
+ },
24
+ {
25
+ id: 'agent-2',
26
+ organizationId: 'demo-org',
27
+ name: 'Code Review Assistant',
28
+ slug: 'code-review-assistant',
29
+ description: 'Reviews pull requests and provides actionable feedback.',
30
+ status: 'ACTIVE' as const,
31
+ modelProvider: 'ANTHROPIC' as const,
32
+ modelName: 'claude-sonnet-4-20250514',
33
+ modelConfig: { temperature: 0.3 },
34
+ systemPrompt: 'You are a code review expert.',
35
+ toolChoice: 'auto' as const,
36
+ maxIterations: 15,
37
+ timeoutMs: 180000,
38
+ version: '2.1.0',
39
+ tags: ['code', 'review', 'dev'],
40
+ createdAt: new Date('2024-02-10T09:00:00Z'),
41
+ updatedAt: new Date('2024-04-05T11:15:00Z'),
42
+ },
43
+ {
44
+ id: 'agent-3',
45
+ organizationId: 'demo-org',
46
+ name: 'Data Analyst',
47
+ slug: 'data-analyst',
48
+ description: 'Queries databases and generates insights from data.',
49
+ status: 'PAUSED' as const,
50
+ modelProvider: 'OPENAI' as const,
51
+ modelName: 'gpt-4o',
52
+ modelConfig: { temperature: 0.5 },
53
+ systemPrompt: 'You are a data analyst expert in SQL and analytics.',
54
+ toolChoice: 'required' as const,
55
+ maxIterations: 20,
56
+ timeoutMs: 300000,
57
+ version: '1.2.0',
58
+ tags: ['data', 'analytics', 'sql'],
59
+ createdAt: new Date('2024-03-01T08:00:00Z'),
60
+ updatedAt: new Date('2024-04-10T16:45:00Z'),
61
+ },
62
+ {
63
+ id: 'agent-4',
64
+ organizationId: 'demo-org',
65
+ name: 'Meeting Scheduler',
66
+ slug: 'meeting-scheduler',
67
+ description: 'Schedules meetings and manages calendar conflicts.',
68
+ status: 'DRAFT' as const,
69
+ modelProvider: 'GOOGLE' as const,
70
+ modelName: 'gemini-2.0-flash',
71
+ modelConfig: { temperature: 0.2 },
72
+ systemPrompt: 'You help schedule and organize meetings efficiently.',
73
+ toolChoice: 'auto' as const,
74
+ maxIterations: 5,
75
+ timeoutMs: 60000,
76
+ version: '0.1.0',
77
+ tags: ['calendar', 'scheduling'],
78
+ createdAt: new Date('2024-04-01T12:00:00Z'),
79
+ updatedAt: new Date('2024-04-01T12:00:00Z'),
80
+ },
81
81
  ];
@@ -2,106 +2,106 @@
2
2
  * Mock run data for testing and demos.
3
3
  */
4
4
  export const MOCK_RUNS = [
5
- {
6
- id: 'run-1',
7
- organizationId: 'demo-org',
8
- agentId: 'agent-1',
9
- agentName: 'Customer Support Bot',
10
- userId: 'user-1',
11
- sessionId: 'session-1',
12
- input: { message: 'How do I reset my password?', context: {} },
13
- output: { response: 'You can reset your password by clicking...' },
14
- status: 'COMPLETED' as const,
15
- totalTokens: 1250,
16
- promptTokens: 800,
17
- completionTokens: 450,
18
- totalIterations: 3,
19
- durationMs: 4500,
20
- estimatedCostUsd: 0.0025,
21
- queuedAt: new Date('2024-04-15T10:00:00Z'),
22
- startedAt: new Date('2024-04-15T10:00:01Z'),
23
- completedAt: new Date('2024-04-15T10:00:05Z'),
24
- steps: [],
25
- logs: [],
26
- },
27
- {
28
- id: 'run-2',
29
- organizationId: 'demo-org',
30
- agentId: 'agent-2',
31
- agentName: 'Code Review Assistant',
32
- userId: 'user-2',
33
- input: { message: 'Review PR #123', context: { prNumber: 123 } },
34
- status: 'IN_PROGRESS' as const,
35
- totalTokens: 3500,
36
- promptTokens: 3000,
37
- completionTokens: 500,
38
- totalIterations: 5,
39
- queuedAt: new Date('2024-04-15T10:30:00Z'),
40
- startedAt: new Date('2024-04-15T10:30:02Z'),
41
- steps: [],
42
- logs: [],
43
- },
44
- {
45
- id: 'run-3',
46
- organizationId: 'demo-org',
47
- agentId: 'agent-1',
48
- agentName: 'Customer Support Bot',
49
- userId: 'user-1',
50
- input: { message: 'What are your business hours?' },
51
- output: { response: 'Our business hours are 9 AM to 5 PM EST...' },
52
- status: 'COMPLETED' as const,
53
- totalTokens: 800,
54
- promptTokens: 500,
55
- completionTokens: 300,
56
- totalIterations: 2,
57
- durationMs: 2100,
58
- estimatedCostUsd: 0.0012,
59
- queuedAt: new Date('2024-04-15T09:00:00Z'),
60
- startedAt: new Date('2024-04-15T09:00:01Z'),
61
- completedAt: new Date('2024-04-15T09:00:03Z'),
62
- steps: [],
63
- logs: [],
64
- },
65
- {
66
- id: 'run-4',
67
- organizationId: 'demo-org',
68
- agentId: 'agent-3',
69
- agentName: 'Data Analyst',
70
- userId: 'user-3',
71
- input: { message: 'Generate sales report for Q1' },
72
- status: 'FAILED' as const,
73
- errorMessage: 'Database connection timeout',
74
- errorCode: 'DB_TIMEOUT',
75
- totalTokens: 2000,
76
- promptTokens: 1500,
77
- completionTokens: 500,
78
- totalIterations: 8,
79
- durationMs: 45000,
80
- queuedAt: new Date('2024-04-14T15:00:00Z'),
81
- startedAt: new Date('2024-04-14T15:00:05Z'),
82
- completedAt: new Date('2024-04-14T15:00:50Z'),
83
- steps: [],
84
- logs: [],
85
- },
86
- {
87
- id: 'run-5',
88
- organizationId: 'demo-org',
89
- agentId: 'agent-2',
90
- agentName: 'Code Review Assistant',
91
- userId: 'user-2',
92
- input: { message: 'Review PR #120' },
93
- output: { response: 'Code review complete. 3 suggestions...' },
94
- status: 'COMPLETED' as const,
95
- totalTokens: 5200,
96
- promptTokens: 4000,
97
- completionTokens: 1200,
98
- totalIterations: 7,
99
- durationMs: 15000,
100
- estimatedCostUsd: 0.0156,
101
- queuedAt: new Date('2024-04-14T11:00:00Z'),
102
- startedAt: new Date('2024-04-14T11:00:03Z'),
103
- completedAt: new Date('2024-04-14T11:00:18Z'),
104
- steps: [],
105
- logs: [],
106
- },
5
+ {
6
+ id: 'run-1',
7
+ organizationId: 'demo-org',
8
+ agentId: 'agent-1',
9
+ agentName: 'Customer Support Bot',
10
+ userId: 'user-1',
11
+ sessionId: 'session-1',
12
+ input: { message: 'How do I reset my password?', context: {} },
13
+ output: { response: 'You can reset your password by clicking...' },
14
+ status: 'COMPLETED' as const,
15
+ totalTokens: 1250,
16
+ promptTokens: 800,
17
+ completionTokens: 450,
18
+ totalIterations: 3,
19
+ durationMs: 4500,
20
+ estimatedCostUsd: 0.0025,
21
+ queuedAt: new Date('2024-04-15T10:00:00Z'),
22
+ startedAt: new Date('2024-04-15T10:00:01Z'),
23
+ completedAt: new Date('2024-04-15T10:00:05Z'),
24
+ steps: [],
25
+ logs: [],
26
+ },
27
+ {
28
+ id: 'run-2',
29
+ organizationId: 'demo-org',
30
+ agentId: 'agent-2',
31
+ agentName: 'Code Review Assistant',
32
+ userId: 'user-2',
33
+ input: { message: 'Review PR #123', context: { prNumber: 123 } },
34
+ status: 'IN_PROGRESS' as const,
35
+ totalTokens: 3500,
36
+ promptTokens: 3000,
37
+ completionTokens: 500,
38
+ totalIterations: 5,
39
+ queuedAt: new Date('2024-04-15T10:30:00Z'),
40
+ startedAt: new Date('2024-04-15T10:30:02Z'),
41
+ steps: [],
42
+ logs: [],
43
+ },
44
+ {
45
+ id: 'run-3',
46
+ organizationId: 'demo-org',
47
+ agentId: 'agent-1',
48
+ agentName: 'Customer Support Bot',
49
+ userId: 'user-1',
50
+ input: { message: 'What are your business hours?' },
51
+ output: { response: 'Our business hours are 9 AM to 5 PM EST...' },
52
+ status: 'COMPLETED' as const,
53
+ totalTokens: 800,
54
+ promptTokens: 500,
55
+ completionTokens: 300,
56
+ totalIterations: 2,
57
+ durationMs: 2100,
58
+ estimatedCostUsd: 0.0012,
59
+ queuedAt: new Date('2024-04-15T09:00:00Z'),
60
+ startedAt: new Date('2024-04-15T09:00:01Z'),
61
+ completedAt: new Date('2024-04-15T09:00:03Z'),
62
+ steps: [],
63
+ logs: [],
64
+ },
65
+ {
66
+ id: 'run-4',
67
+ organizationId: 'demo-org',
68
+ agentId: 'agent-3',
69
+ agentName: 'Data Analyst',
70
+ userId: 'user-3',
71
+ input: { message: 'Generate sales report for Q1' },
72
+ status: 'FAILED' as const,
73
+ errorMessage: 'Database connection timeout',
74
+ errorCode: 'DB_TIMEOUT',
75
+ totalTokens: 2000,
76
+ promptTokens: 1500,
77
+ completionTokens: 500,
78
+ totalIterations: 8,
79
+ durationMs: 45000,
80
+ queuedAt: new Date('2024-04-14T15:00:00Z'),
81
+ startedAt: new Date('2024-04-14T15:00:05Z'),
82
+ completedAt: new Date('2024-04-14T15:00:50Z'),
83
+ steps: [],
84
+ logs: [],
85
+ },
86
+ {
87
+ id: 'run-5',
88
+ organizationId: 'demo-org',
89
+ agentId: 'agent-2',
90
+ agentName: 'Code Review Assistant',
91
+ userId: 'user-2',
92
+ input: { message: 'Review PR #120' },
93
+ output: { response: 'Code review complete. 3 suggestions...' },
94
+ status: 'COMPLETED' as const,
95
+ totalTokens: 5200,
96
+ promptTokens: 4000,
97
+ completionTokens: 1200,
98
+ totalIterations: 7,
99
+ durationMs: 15000,
100
+ estimatedCostUsd: 0.0156,
101
+ queuedAt: new Date('2024-04-14T11:00:00Z'),
102
+ startedAt: new Date('2024-04-14T11:00:03Z'),
103
+ completedAt: new Date('2024-04-14T11:00:18Z'),
104
+ steps: [],
105
+ logs: [],
106
+ },
107
107
  ];
@@ -2,144 +2,144 @@
2
2
  * Mock tool data for testing and demos.
3
3
  */
4
4
  export const MOCK_TOOLS = [
5
- {
6
- id: 'tool-1',
7
- organizationId: 'demo-org',
8
- name: 'Web Search',
9
- slug: 'web-search',
10
- description: 'Search the web for real-time information using Brave API.',
11
- category: 'RETRIEVAL' as const,
12
- status: 'ACTIVE' as const,
13
- parametersSchema: {
14
- type: 'object',
15
- properties: {
16
- query: { type: 'string', description: 'Search query' },
17
- numResults: { type: 'number', default: 10 },
18
- },
19
- required: ['query'],
20
- },
21
- outputSchema: { type: 'array', items: { type: 'object' } },
22
- implementationType: 'http' as const,
23
- implementationConfig: {
24
- url: 'https://api.brave.com/search',
25
- method: 'GET',
26
- },
27
- maxInvocationsPerMinute: 60,
28
- timeoutMs: 30000,
29
- version: '1.0.0',
30
- tags: ['search', 'web'],
31
- createdAt: new Date('2024-01-01T00:00:00Z'),
32
- updatedAt: new Date('2024-02-15T10:00:00Z'),
33
- },
34
- {
35
- id: 'tool-2',
36
- organizationId: 'demo-org',
37
- name: 'SQL Query',
38
- slug: 'sql-query',
39
- description: 'Execute read-only SQL queries against the data warehouse.',
40
- category: 'RETRIEVAL' as const,
41
- status: 'ACTIVE' as const,
42
- parametersSchema: {
43
- type: 'object',
44
- properties: {
45
- query: { type: 'string', description: 'SQL query' },
46
- maxRows: { type: 'number', default: 100 },
47
- },
48
- required: ['query'],
49
- },
50
- outputSchema: { type: 'object' },
51
- implementationType: 'function' as const,
52
- implementationConfig: { handler: 'executeSqlQuery' },
53
- maxInvocationsPerMinute: 30,
54
- timeoutMs: 60000,
55
- version: '1.1.0',
56
- tags: ['sql', 'database'],
57
- createdAt: new Date('2024-01-05T00:00:00Z'),
58
- updatedAt: new Date('2024-03-10T14:00:00Z'),
59
- },
60
- {
61
- id: 'tool-3',
62
- organizationId: 'demo-org',
63
- name: 'Email Sender',
64
- slug: 'email-sender',
65
- description: 'Send emails via SMTP or API.',
66
- category: 'COMMUNICATION' as const,
67
- status: 'ACTIVE' as const,
68
- parametersSchema: {
69
- type: 'object',
70
- properties: {
71
- to: { type: 'string' },
72
- subject: { type: 'string' },
73
- body: { type: 'string' },
74
- },
75
- required: ['to', 'subject', 'body'],
76
- },
77
- implementationType: 'http' as const,
78
- implementationConfig: { url: '/api/send-email', method: 'POST' },
79
- maxInvocationsPerMinute: 10,
80
- timeoutMs: 30000,
81
- version: '1.0.0',
82
- tags: ['email', 'communication'],
83
- createdAt: new Date('2024-02-01T00:00:00Z'),
84
- updatedAt: new Date('2024-02-01T00:00:00Z'),
85
- },
86
- {
87
- id: 'tool-4',
88
- organizationId: 'demo-org',
89
- name: 'GitHub Integration',
90
- slug: 'github-integration',
91
- description: 'Interact with GitHub repositories, PRs, and issues.',
92
- category: 'INTEGRATION' as const,
93
- status: 'ACTIVE' as const,
94
- parametersSchema: {
95
- type: 'object',
96
- properties: {
97
- action: {
98
- type: 'string',
99
- enum: ['list_prs', 'get_pr', 'create_comment'],
100
- },
101
- repo: { type: 'string' },
102
- params: { type: 'object' },
103
- },
104
- required: ['action', 'repo'],
105
- },
106
- implementationType: 'http' as const,
107
- implementationConfig: { url: 'https://api.github.com', auth: 'token' },
108
- maxInvocationsPerMinute: 100,
109
- timeoutMs: 15000,
110
- version: '2.0.0',
111
- tags: ['github', 'integration', 'code'],
112
- createdAt: new Date('2024-02-20T00:00:00Z'),
113
- updatedAt: new Date('2024-04-01T09:00:00Z'),
114
- },
115
- {
116
- id: 'tool-5',
117
- organizationId: 'demo-org',
118
- name: 'Calculator',
119
- slug: 'calculator',
120
- description: 'Perform mathematical calculations.',
121
- category: 'COMPUTATION' as const,
122
- status: 'ACTIVE' as const,
123
- parametersSchema: {
124
- type: 'object',
125
- properties: {
126
- expression: {
127
- type: 'string',
128
- description: 'Math expression to evaluate',
129
- },
130
- },
131
- required: ['expression'],
132
- },
133
- outputSchema: {
134
- type: 'object',
135
- properties: { result: { type: 'number' } },
136
- },
137
- implementationType: 'function' as const,
138
- implementationConfig: { handler: 'evaluateMath' },
139
- timeoutMs: 5000,
140
- version: '1.0.0',
141
- tags: ['math', 'utility'],
142
- createdAt: new Date('2024-01-10T00:00:00Z'),
143
- updatedAt: new Date('2024-01-10T00:00:00Z'),
144
- },
5
+ {
6
+ id: 'tool-1',
7
+ organizationId: 'demo-org',
8
+ name: 'Web Search',
9
+ slug: 'web-search',
10
+ description: 'Search the web for real-time information using Brave API.',
11
+ category: 'RETRIEVAL' as const,
12
+ status: 'ACTIVE' as const,
13
+ parametersSchema: {
14
+ type: 'object',
15
+ properties: {
16
+ query: { type: 'string', description: 'Search query' },
17
+ numResults: { type: 'number', default: 10 },
18
+ },
19
+ required: ['query'],
20
+ },
21
+ outputSchema: { type: 'array', items: { type: 'object' } },
22
+ implementationType: 'http' as const,
23
+ implementationConfig: {
24
+ url: 'https://api.brave.com/search',
25
+ method: 'GET',
26
+ },
27
+ maxInvocationsPerMinute: 60,
28
+ timeoutMs: 30000,
29
+ version: '1.0.0',
30
+ tags: ['search', 'web'],
31
+ createdAt: new Date('2024-01-01T00:00:00Z'),
32
+ updatedAt: new Date('2024-02-15T10:00:00Z'),
33
+ },
34
+ {
35
+ id: 'tool-2',
36
+ organizationId: 'demo-org',
37
+ name: 'SQL Query',
38
+ slug: 'sql-query',
39
+ description: 'Execute read-only SQL queries against the data warehouse.',
40
+ category: 'RETRIEVAL' as const,
41
+ status: 'ACTIVE' as const,
42
+ parametersSchema: {
43
+ type: 'object',
44
+ properties: {
45
+ query: { type: 'string', description: 'SQL query' },
46
+ maxRows: { type: 'number', default: 100 },
47
+ },
48
+ required: ['query'],
49
+ },
50
+ outputSchema: { type: 'object' },
51
+ implementationType: 'function' as const,
52
+ implementationConfig: { handler: 'executeSqlQuery' },
53
+ maxInvocationsPerMinute: 30,
54
+ timeoutMs: 60000,
55
+ version: '1.1.0',
56
+ tags: ['sql', 'database'],
57
+ createdAt: new Date('2024-01-05T00:00:00Z'),
58
+ updatedAt: new Date('2024-03-10T14:00:00Z'),
59
+ },
60
+ {
61
+ id: 'tool-3',
62
+ organizationId: 'demo-org',
63
+ name: 'Email Sender',
64
+ slug: 'email-sender',
65
+ description: 'Send emails via SMTP or API.',
66
+ category: 'COMMUNICATION' as const,
67
+ status: 'ACTIVE' as const,
68
+ parametersSchema: {
69
+ type: 'object',
70
+ properties: {
71
+ to: { type: 'string' },
72
+ subject: { type: 'string' },
73
+ body: { type: 'string' },
74
+ },
75
+ required: ['to', 'subject', 'body'],
76
+ },
77
+ implementationType: 'http' as const,
78
+ implementationConfig: { url: '/api/send-email', method: 'POST' },
79
+ maxInvocationsPerMinute: 10,
80
+ timeoutMs: 30000,
81
+ version: '1.0.0',
82
+ tags: ['email', 'communication'],
83
+ createdAt: new Date('2024-02-01T00:00:00Z'),
84
+ updatedAt: new Date('2024-02-01T00:00:00Z'),
85
+ },
86
+ {
87
+ id: 'tool-4',
88
+ organizationId: 'demo-org',
89
+ name: 'GitHub Integration',
90
+ slug: 'github-integration',
91
+ description: 'Interact with GitHub repositories, PRs, and issues.',
92
+ category: 'INTEGRATION' as const,
93
+ status: 'ACTIVE' as const,
94
+ parametersSchema: {
95
+ type: 'object',
96
+ properties: {
97
+ action: {
98
+ type: 'string',
99
+ enum: ['list_prs', 'get_pr', 'create_comment'],
100
+ },
101
+ repo: { type: 'string' },
102
+ params: { type: 'object' },
103
+ },
104
+ required: ['action', 'repo'],
105
+ },
106
+ implementationType: 'http' as const,
107
+ implementationConfig: { url: 'https://api.github.com', auth: 'token' },
108
+ maxInvocationsPerMinute: 100,
109
+ timeoutMs: 15000,
110
+ version: '2.0.0',
111
+ tags: ['github', 'integration', 'code'],
112
+ createdAt: new Date('2024-02-20T00:00:00Z'),
113
+ updatedAt: new Date('2024-04-01T09:00:00Z'),
114
+ },
115
+ {
116
+ id: 'tool-5',
117
+ organizationId: 'demo-org',
118
+ name: 'Calculator',
119
+ slug: 'calculator',
120
+ description: 'Perform mathematical calculations.',
121
+ category: 'COMPUTATION' as const,
122
+ status: 'ACTIVE' as const,
123
+ parametersSchema: {
124
+ type: 'object',
125
+ properties: {
126
+ expression: {
127
+ type: 'string',
128
+ description: 'Math expression to evaluate',
129
+ },
130
+ },
131
+ required: ['expression'],
132
+ },
133
+ outputSchema: {
134
+ type: 'object',
135
+ properties: { result: { type: 'number' } },
136
+ },
137
+ implementationType: 'function' as const,
138
+ implementationConfig: { handler: 'evaluateMath' },
139
+ timeoutMs: 5000,
140
+ version: '1.0.0',
141
+ tags: ['math', 'utility'],
142
+ createdAt: new Date('2024-01-10T00:00:00Z'),
143
+ updatedAt: new Date('2024-01-10T00:00:00Z'),
144
+ },
145
145
  ];