@lssm/example.agent-console 0.0.0-canary-20251206160926

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 +202 -0
  2. package/CHANGELOG.md +13 -0
  3. package/README.md +83 -0
  4. package/dist/contracts/agent.d.ts +886 -0
  5. package/dist/contracts/agent.js +1 -0
  6. package/dist/contracts/index.d.ts +4 -0
  7. package/dist/contracts/index.js +1 -0
  8. package/dist/contracts/run.d.ts +1106 -0
  9. package/dist/contracts/run.js +1 -0
  10. package/dist/contracts/tool.d.ts +607 -0
  11. package/dist/contracts/tool.js +1 -0
  12. package/dist/entities/agent.d.ts +54 -0
  13. package/dist/entities/agent.js +1 -0
  14. package/dist/entities/index.d.ts +4 -0
  15. package/dist/entities/index.js +1 -0
  16. package/dist/entities/log.d.ts +31 -0
  17. package/dist/entities/log.js +1 -0
  18. package/dist/entities/run.d.ts +85 -0
  19. package/dist/entities/run.js +1 -0
  20. package/dist/entities/tool.d.ts +36 -0
  21. package/dist/entities/tool.js +1 -0
  22. package/dist/events.d.ts +965 -0
  23. package/dist/events.js +1 -0
  24. package/dist/feature.d.ts +11 -0
  25. package/dist/feature.js +1 -0
  26. package/dist/handlers/agent.handlers.d.ts +99 -0
  27. package/dist/handlers/agent.handlers.js +1 -0
  28. package/dist/handlers/index.d.ts +5 -0
  29. package/dist/handlers/index.js +1 -0
  30. package/dist/handlers/mock-data.d.ts +533 -0
  31. package/dist/handlers/mock-data.js +1 -0
  32. package/dist/handlers/run.handlers.d.ts +145 -0
  33. package/dist/handlers/run.handlers.js +1 -0
  34. package/dist/handlers/tool.handlers.d.ts +86 -0
  35. package/dist/handlers/tool.handlers.js +1 -0
  36. package/dist/index.d.ts +18 -0
  37. package/dist/index.js +1 -0
  38. package/dist/libs/contracts/dist/capabilities/openbanking.js +1 -0
  39. package/dist/libs/contracts/dist/client/index.js +1 -0
  40. package/dist/libs/contracts/dist/client/react/feature-render.js +1 -0
  41. package/dist/libs/contracts/dist/client/react/form-render.js +1 -0
  42. package/dist/libs/contracts/dist/client/react/index.js +1 -0
  43. package/dist/libs/contracts/dist/events.js +1 -0
  44. package/dist/libs/contracts/dist/experiments/evaluator.js +1 -0
  45. package/dist/libs/contracts/dist/graphql-federation/dist/index.js +1 -0
  46. package/dist/libs/contracts/dist/index.js +1 -0
  47. package/dist/libs/contracts/dist/install.js +1 -0
  48. package/dist/libs/contracts/dist/integrations/contracts.js +1 -0
  49. package/dist/libs/contracts/dist/integrations/index.js +1 -0
  50. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +1 -0
  51. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +1 -0
  52. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +1 -0
  53. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +1 -0
  54. package/dist/libs/contracts/dist/integrations/openbanking/models.js +1 -0
  55. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +1 -0
  56. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +1 -0
  57. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +1 -0
  58. package/dist/libs/contracts/dist/integrations/providers/gmail.js +1 -0
  59. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +1 -0
  60. package/dist/libs/contracts/dist/integrations/providers/impls/elevenlabs-voice.js +1 -0
  61. package/dist/libs/contracts/dist/integrations/providers/impls/gcs-storage.js +1 -0
  62. package/dist/libs/contracts/dist/integrations/providers/impls/gmail-inbound.js +1 -0
  63. package/dist/libs/contracts/dist/integrations/providers/impls/gmail-outbound.js +1 -0
  64. package/dist/libs/contracts/dist/integrations/providers/impls/google-calendar.js +1 -0
  65. package/dist/libs/contracts/dist/integrations/providers/impls/index.js +1 -0
  66. package/dist/libs/contracts/dist/integrations/providers/impls/mistral-embedding.js +1 -0
  67. package/dist/libs/contracts/dist/integrations/providers/impls/mistral-llm.js +1 -0
  68. package/dist/libs/contracts/dist/integrations/providers/impls/postmark-email.js +1 -0
  69. package/dist/libs/contracts/dist/integrations/providers/impls/powens-client.js +1 -0
  70. package/dist/libs/contracts/dist/integrations/providers/impls/powens-openbanking.js +1 -0
  71. package/dist/libs/contracts/dist/integrations/providers/impls/provider-factory.js +1 -0
  72. package/dist/libs/contracts/dist/integrations/providers/impls/qdrant-vector.js +1 -0
  73. package/dist/libs/contracts/dist/integrations/providers/impls/stripe-payments.js +1 -0
  74. package/dist/libs/contracts/dist/integrations/providers/impls/twilio-sms.js +1 -0
  75. package/dist/libs/contracts/dist/integrations/providers/index.js +1 -0
  76. package/dist/libs/contracts/dist/integrations/providers/mistral.js +1 -0
  77. package/dist/libs/contracts/dist/integrations/providers/postmark.js +1 -0
  78. package/dist/libs/contracts/dist/integrations/providers/powens.js +1 -0
  79. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +1 -0
  80. package/dist/libs/contracts/dist/integrations/providers/stripe.js +1 -0
  81. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +1 -0
  82. package/dist/libs/contracts/dist/integrations/runtime.js +1 -0
  83. package/dist/libs/contracts/dist/integrations/secrets/env-secret-provider.js +1 -0
  84. package/dist/libs/contracts/dist/integrations/secrets/gcp-secret-manager.js +1 -0
  85. package/dist/libs/contracts/dist/integrations/secrets/index.js +1 -0
  86. package/dist/libs/contracts/dist/integrations/secrets/manager.js +1 -0
  87. package/dist/libs/contracts/dist/integrations/secrets/provider.js +1 -0
  88. package/dist/libs/contracts/dist/jsonschema.js +1 -0
  89. package/dist/libs/contracts/dist/knowledge/contracts.js +1 -0
  90. package/dist/libs/contracts/dist/knowledge/index.js +1 -0
  91. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +1 -0
  92. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +1 -0
  93. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +1 -0
  94. package/dist/libs/contracts/dist/knowledge/spaces/index.js +1 -0
  95. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +1 -0
  96. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +1 -0
  97. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +1 -0
  98. package/dist/libs/contracts/dist/onboarding-base.js +1 -0
  99. package/dist/libs/contracts/dist/ownership.js +1 -0
  100. package/dist/libs/contracts/dist/presentations.js +1 -0
  101. package/dist/libs/contracts/dist/presentations.v2.js +1 -0
  102. package/dist/libs/contracts/dist/prompt.js +1 -0
  103. package/dist/libs/contracts/dist/promptRegistry.js +1 -0
  104. package/dist/libs/contracts/dist/regenerator/index.js +1 -0
  105. package/dist/libs/contracts/dist/regenerator/service.js +1 -0
  106. package/dist/libs/contracts/dist/registry.js +1 -0
  107. package/dist/libs/contracts/dist/resources.js +1 -0
  108. package/dist/libs/contracts/dist/schema/dist/EnumType.js +1 -0
  109. package/dist/libs/contracts/dist/schema/dist/FieldType.js +1 -0
  110. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +1 -0
  111. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +1 -0
  112. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -0
  113. package/dist/libs/contracts/dist/schema/dist/entity/index.js +1 -0
  114. package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -0
  115. package/dist/libs/contracts/dist/schema/dist/index.js +1 -0
  116. package/dist/libs/contracts/dist/server/graphql-pothos.js +1 -0
  117. package/dist/libs/contracts/dist/server/graphql-schema-export.js +1 -0
  118. package/dist/libs/contracts/dist/server/index.js +1 -0
  119. package/dist/libs/contracts/dist/server/provider-mcp.js +1 -0
  120. package/dist/libs/contracts/dist/server/rest-elysia.js +1 -0
  121. package/dist/libs/contracts/dist/server/rest-express.js +1 -0
  122. package/dist/libs/contracts/dist/server/rest-generic.js +1 -0
  123. package/dist/libs/contracts/dist/server/rest-next-app.js +1 -0
  124. package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -0
  125. package/dist/libs/contracts/dist/spec.js +1 -0
  126. package/dist/libs/contracts/dist/telemetry/index.js +1 -0
  127. package/dist/libs/contracts/dist/telemetry/tracker.js +1 -0
  128. package/dist/libs/contracts/dist/tests/index.js +1 -0
  129. package/dist/libs/contracts/dist/tests/runner.js +1 -0
  130. package/dist/libs/contracts/dist/workflow/index.js +1 -0
  131. package/dist/libs/contracts/dist/workflow/runner.js +1 -0
  132. package/dist/libs/schema/dist/EnumType.js +1 -0
  133. package/dist/libs/schema/dist/FieldType.js +1 -0
  134. package/dist/libs/schema/dist/ScalarTypeEnum.js +1 -0
  135. package/dist/libs/schema/dist/SchemaModel.js +1 -0
  136. package/dist/libs/schema/dist/entity/defineEntity.js +1 -0
  137. package/dist/libs/schema/dist/entity/index.js +1 -0
  138. package/dist/libs/schema/dist/entity/types.js +1 -0
  139. package/dist/libs/schema/dist/index.js +1 -0
  140. package/dist/presentations/agent-list.d.ts +15 -0
  141. package/dist/presentations/agent-list.js +1 -0
  142. package/dist/presentations/dashboard.d.ts +11 -0
  143. package/dist/presentations/dashboard.js +1 -0
  144. package/dist/presentations/index.d.ts +11 -0
  145. package/dist/presentations/index.js +1 -0
  146. package/dist/presentations/run-list.d.ts +18 -0
  147. package/dist/presentations/run-list.js +1 -0
  148. package/dist/presentations/tool-registry.d.ts +14 -0
  149. package/dist/presentations/tool-registry.js +1 -0
  150. package/package.json +86 -0
  151. package/src/contracts/agent.ts +501 -0
  152. package/src/contracts/index.ts +29 -0
  153. package/src/contracts/run.ts +561 -0
  154. package/src/contracts/tool.ts +392 -0
  155. package/src/entities/agent.ts +151 -0
  156. package/src/entities/index.ts +20 -0
  157. package/src/entities/log.ts +76 -0
  158. package/src/entities/run.ts +240 -0
  159. package/src/entities/tool.ts +105 -0
  160. package/src/events.ts +419 -0
  161. package/src/feature.ts +144 -0
  162. package/src/handlers/agent.handlers.ts +203 -0
  163. package/src/handlers/index.ts +55 -0
  164. package/src/handlers/mock-data.ts +413 -0
  165. package/src/handlers/run.handlers.ts +331 -0
  166. package/src/handlers/tool.handlers.ts +188 -0
  167. package/src/index.ts +34 -0
  168. package/src/presentations/agent-list.ts +55 -0
  169. package/src/presentations/dashboard.ts +29 -0
  170. package/src/presentations/index.ts +48 -0
  171. package/src/presentations/run-list.ts +76 -0
  172. package/src/presentations/tool-registry.ts +52 -0
  173. package/tsconfig.json +10 -0
  174. package/tsconfig.tsbuildinfo +1 -0
  175. package/tsdown.config.js +7 -0
@@ -0,0 +1,203 @@
1
+ /**
2
+ * Mock handlers for Agent contracts
3
+ */
4
+ import { MOCK_AGENTS, MOCK_TOOLS } from './mock-data';
5
+
6
+ // Types inferred from contract schemas
7
+ export interface ListAgentsInput {
8
+ organizationId: string;
9
+ status?: 'DRAFT' | 'ACTIVE' | 'PAUSED' | 'ARCHIVED';
10
+ modelProvider?: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'MISTRAL' | 'CUSTOM';
11
+ search?: string;
12
+ limit?: number;
13
+ offset?: number;
14
+ }
15
+
16
+ export interface AgentSummary {
17
+ id: string;
18
+ name: string;
19
+ slug: string;
20
+ description?: string;
21
+ status: 'DRAFT' | 'ACTIVE' | 'PAUSED' | 'ARCHIVED';
22
+ modelProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'MISTRAL' | 'CUSTOM';
23
+ modelName: string;
24
+ version: string;
25
+ createdAt: Date;
26
+ }
27
+
28
+ export interface ListAgentsOutput {
29
+ items: AgentSummary[];
30
+ total: number;
31
+ hasMore: boolean;
32
+ }
33
+
34
+ export interface GetAgentInput {
35
+ agentId: string;
36
+ includeTools?: boolean;
37
+ }
38
+
39
+ export interface AgentToolRef {
40
+ id: string;
41
+ name: string;
42
+ slug: string;
43
+ description: string;
44
+ category: string;
45
+ }
46
+
47
+ export interface AgentWithTools {
48
+ id: string;
49
+ organizationId: string;
50
+ name: string;
51
+ slug: string;
52
+ description?: string;
53
+ status: 'DRAFT' | 'ACTIVE' | 'PAUSED' | 'ARCHIVED';
54
+ modelProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'MISTRAL' | 'CUSTOM';
55
+ modelName: string;
56
+ modelConfig?: Record<string, unknown>;
57
+ systemPrompt: string;
58
+ userPromptTemplate?: string;
59
+ toolIds?: string[];
60
+ toolChoice: 'auto' | 'required' | 'none';
61
+ maxIterations: number;
62
+ maxTokensPerRun?: number;
63
+ timeoutMs: number;
64
+ version: string;
65
+ tags?: string[];
66
+ createdAt: Date;
67
+ updatedAt: Date;
68
+ tools?: AgentToolRef[];
69
+ }
70
+
71
+ /**
72
+ * Mock handler for ListAgentsQuery
73
+ */
74
+ export async function mockListAgentsHandler(
75
+ input: ListAgentsInput
76
+ ): Promise<ListAgentsOutput> {
77
+ const {
78
+ organizationId,
79
+ status,
80
+ modelProvider,
81
+ search,
82
+ limit = 20,
83
+ offset = 0,
84
+ } = input;
85
+
86
+ let filtered = MOCK_AGENTS.filter((a) => a.organizationId === organizationId);
87
+
88
+ if (status) {
89
+ filtered = filtered.filter((a) => a.status === status);
90
+ }
91
+
92
+ if (modelProvider) {
93
+ filtered = filtered.filter((a) => a.modelProvider === modelProvider);
94
+ }
95
+
96
+ if (search) {
97
+ const q = search.toLowerCase();
98
+ filtered = filtered.filter(
99
+ (a) =>
100
+ a.name.toLowerCase().includes(q) ||
101
+ a.description?.toLowerCase().includes(q) ||
102
+ a.tags?.some((t) => t.toLowerCase().includes(q))
103
+ );
104
+ }
105
+
106
+ const total = filtered.length;
107
+ const items = filtered.slice(offset, offset + limit).map((a) => ({
108
+ id: a.id,
109
+ name: a.name,
110
+ slug: a.slug,
111
+ description: a.description,
112
+ status: a.status,
113
+ modelProvider: a.modelProvider,
114
+ modelName: a.modelName,
115
+ version: a.version,
116
+ createdAt: a.createdAt,
117
+ }));
118
+
119
+ return {
120
+ items,
121
+ total,
122
+ hasMore: offset + limit < total,
123
+ };
124
+ }
125
+
126
+ /**
127
+ * Mock handler for GetAgentQuery
128
+ */
129
+ export async function mockGetAgentHandler(
130
+ input: GetAgentInput
131
+ ): Promise<AgentWithTools> {
132
+ const agent = MOCK_AGENTS.find((a) => a.id === input.agentId);
133
+
134
+ if (!agent) {
135
+ throw new Error('AGENT_NOT_FOUND');
136
+ }
137
+
138
+ const result: AgentWithTools = {
139
+ ...agent,
140
+ toolIds: ['tool-1', 'tool-2'],
141
+ };
142
+
143
+ if (input.includeTools) {
144
+ result.tools = MOCK_TOOLS.slice(0, 2).map((t) => ({
145
+ id: t.id,
146
+ name: t.name,
147
+ slug: t.slug,
148
+ description: t.description,
149
+ category: t.category,
150
+ }));
151
+ }
152
+
153
+ return result;
154
+ }
155
+
156
+ /**
157
+ * Mock handler for CreateAgentCommand
158
+ */
159
+ export async function mockCreateAgentHandler(input: {
160
+ organizationId: string;
161
+ name: string;
162
+ slug: string;
163
+ description?: string;
164
+ modelProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'MISTRAL' | 'CUSTOM';
165
+ modelName: string;
166
+ systemPrompt: string;
167
+ }) {
168
+ // Simulate slug collision check
169
+ const exists = MOCK_AGENTS.some(
170
+ (a) => a.organizationId === input.organizationId && a.slug === input.slug
171
+ );
172
+ if (exists) {
173
+ throw new Error('SLUG_EXISTS');
174
+ }
175
+
176
+ return {
177
+ id: `agent-${Date.now()}`,
178
+ name: input.name,
179
+ slug: input.slug,
180
+ status: 'DRAFT' as const,
181
+ };
182
+ }
183
+
184
+ /**
185
+ * Mock handler for UpdateAgentCommand
186
+ */
187
+ export async function mockUpdateAgentHandler(input: {
188
+ agentId: string;
189
+ name?: string;
190
+ status?: 'DRAFT' | 'ACTIVE' | 'PAUSED' | 'ARCHIVED';
191
+ }) {
192
+ const agent = MOCK_AGENTS.find((a) => a.id === input.agentId);
193
+ if (!agent) {
194
+ throw new Error('AGENT_NOT_FOUND');
195
+ }
196
+
197
+ return {
198
+ id: agent.id,
199
+ name: input.name ?? agent.name,
200
+ status: input.status ?? agent.status,
201
+ updatedAt: new Date(),
202
+ };
203
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Mock handlers for agent-console example
3
+ *
4
+ * These handlers provide mock implementations of all contracts
5
+ * for use in demos, tests, and the sandbox environment.
6
+ */
7
+
8
+ // Mock data
9
+ export * from './mock-data';
10
+
11
+ // Agent handlers
12
+ export {
13
+ mockListAgentsHandler,
14
+ mockGetAgentHandler,
15
+ mockCreateAgentHandler,
16
+ mockUpdateAgentHandler,
17
+ type ListAgentsInput,
18
+ type ListAgentsOutput,
19
+ type AgentSummary,
20
+ type GetAgentInput,
21
+ type AgentWithTools,
22
+ type AgentToolRef,
23
+ } from './agent.handlers';
24
+
25
+ // Tool handlers
26
+ export {
27
+ mockListToolsHandler,
28
+ mockGetToolHandler,
29
+ mockCreateToolHandler,
30
+ mockTestToolHandler,
31
+ type ListToolsInput,
32
+ type ListToolsOutput,
33
+ type ToolSummary,
34
+ type GetToolInput,
35
+ type Tool,
36
+ } from './tool.handlers';
37
+
38
+ // Run handlers
39
+ export {
40
+ mockListRunsHandler,
41
+ mockGetRunHandler,
42
+ mockGetRunMetricsHandler,
43
+ mockExecuteAgentHandler,
44
+ mockCancelRunHandler,
45
+ type ListRunsInput,
46
+ type ListRunsOutput,
47
+ type RunSummary,
48
+ type GetRunInput,
49
+ type Run,
50
+ type RunStep,
51
+ type RunLog,
52
+ type GetRunMetricsInput,
53
+ type RunMetrics,
54
+ type TimelineDataPoint,
55
+ } from './run.handlers';
@@ -0,0 +1,413 @@
1
+ /**
2
+ * Mock data for agent-console handlers
3
+ */
4
+
5
+ // ============ Agent Mock Data ============
6
+
7
+ export const MOCK_AGENTS = [
8
+ {
9
+ id: 'agent-1',
10
+ organizationId: 'demo-org',
11
+ name: 'Customer Support Bot',
12
+ slug: 'customer-support-bot',
13
+ description: 'Handles tier-1 customer inquiries and routes complex issues.',
14
+ status: 'ACTIVE' as const,
15
+ modelProvider: 'OPENAI' as const,
16
+ modelName: 'gpt-4o-mini',
17
+ modelConfig: { temperature: 0.7 },
18
+ systemPrompt: 'You are a helpful customer support assistant.',
19
+ toolChoice: 'auto' as const,
20
+ maxIterations: 10,
21
+ timeoutMs: 120000,
22
+ version: '1.0.0',
23
+ tags: ['support', 'tier-1'],
24
+ createdAt: new Date('2024-01-15T10:00:00Z'),
25
+ updatedAt: new Date('2024-03-20T14:30:00Z'),
26
+ },
27
+ {
28
+ id: 'agent-2',
29
+ organizationId: 'demo-org',
30
+ name: 'Code Review Assistant',
31
+ slug: 'code-review-assistant',
32
+ description: 'Reviews pull requests and provides actionable feedback.',
33
+ status: 'ACTIVE' as const,
34
+ modelProvider: 'ANTHROPIC' as const,
35
+ modelName: 'claude-sonnet-4-20250514',
36
+ modelConfig: { temperature: 0.3 },
37
+ systemPrompt: 'You are a code review expert.',
38
+ toolChoice: 'auto' as const,
39
+ maxIterations: 15,
40
+ timeoutMs: 180000,
41
+ version: '2.1.0',
42
+ tags: ['code', 'review', 'dev'],
43
+ createdAt: new Date('2024-02-10T09:00:00Z'),
44
+ updatedAt: new Date('2024-04-05T11:15:00Z'),
45
+ },
46
+ {
47
+ id: 'agent-3',
48
+ organizationId: 'demo-org',
49
+ name: 'Data Analyst',
50
+ slug: 'data-analyst',
51
+ description: 'Queries databases and generates insights from data.',
52
+ status: 'PAUSED' as const,
53
+ modelProvider: 'OPENAI' as const,
54
+ modelName: 'gpt-4o',
55
+ modelConfig: { temperature: 0.5 },
56
+ systemPrompt: 'You are a data analyst expert in SQL and analytics.',
57
+ toolChoice: 'required' as const,
58
+ maxIterations: 20,
59
+ timeoutMs: 300000,
60
+ version: '1.2.0',
61
+ tags: ['data', 'analytics', 'sql'],
62
+ createdAt: new Date('2024-03-01T08:00:00Z'),
63
+ updatedAt: new Date('2024-04-10T16:45:00Z'),
64
+ },
65
+ {
66
+ id: 'agent-4',
67
+ organizationId: 'demo-org',
68
+ name: 'Meeting Scheduler',
69
+ slug: 'meeting-scheduler',
70
+ description: 'Schedules meetings and manages calendar conflicts.',
71
+ status: 'DRAFT' as const,
72
+ modelProvider: 'GOOGLE' as const,
73
+ modelName: 'gemini-2.0-flash',
74
+ modelConfig: { temperature: 0.2 },
75
+ systemPrompt: 'You help schedule and organize meetings efficiently.',
76
+ toolChoice: 'auto' as const,
77
+ maxIterations: 5,
78
+ timeoutMs: 60000,
79
+ version: '0.1.0',
80
+ tags: ['calendar', 'scheduling'],
81
+ createdAt: new Date('2024-04-01T12:00:00Z'),
82
+ updatedAt: new Date('2024-04-01T12:00:00Z'),
83
+ },
84
+ ];
85
+
86
+ // ============ Tool Mock Data ============
87
+
88
+ export const MOCK_TOOLS = [
89
+ {
90
+ id: 'tool-1',
91
+ organizationId: 'demo-org',
92
+ name: 'Web Search',
93
+ slug: 'web-search',
94
+ description: 'Search the web for real-time information using Brave API.',
95
+ category: 'RETRIEVAL' as const,
96
+ status: 'ACTIVE' as const,
97
+ parametersSchema: {
98
+ type: 'object',
99
+ properties: {
100
+ query: { type: 'string', description: 'Search query' },
101
+ numResults: { type: 'number', default: 10 },
102
+ },
103
+ required: ['query'],
104
+ },
105
+ outputSchema: { type: 'array', items: { type: 'object' } },
106
+ implementationType: 'http' as const,
107
+ implementationConfig: {
108
+ url: 'https://api.brave.com/search',
109
+ method: 'GET',
110
+ },
111
+ maxInvocationsPerMinute: 60,
112
+ timeoutMs: 30000,
113
+ version: '1.0.0',
114
+ tags: ['search', 'web'],
115
+ createdAt: new Date('2024-01-01T00:00:00Z'),
116
+ updatedAt: new Date('2024-02-15T10:00:00Z'),
117
+ },
118
+ {
119
+ id: 'tool-2',
120
+ organizationId: 'demo-org',
121
+ name: 'SQL Query',
122
+ slug: 'sql-query',
123
+ description: 'Execute read-only SQL queries against the data warehouse.',
124
+ category: 'RETRIEVAL' as const,
125
+ status: 'ACTIVE' as const,
126
+ parametersSchema: {
127
+ type: 'object',
128
+ properties: {
129
+ query: { type: 'string', description: 'SQL query' },
130
+ maxRows: { type: 'number', default: 100 },
131
+ },
132
+ required: ['query'],
133
+ },
134
+ outputSchema: { type: 'object' },
135
+ implementationType: 'function' as const,
136
+ implementationConfig: { handler: 'executeSqlQuery' },
137
+ maxInvocationsPerMinute: 30,
138
+ timeoutMs: 60000,
139
+ version: '1.1.0',
140
+ tags: ['sql', 'database'],
141
+ createdAt: new Date('2024-01-05T00:00:00Z'),
142
+ updatedAt: new Date('2024-03-10T14:00:00Z'),
143
+ },
144
+ {
145
+ id: 'tool-3',
146
+ organizationId: 'demo-org',
147
+ name: 'Email Sender',
148
+ slug: 'email-sender',
149
+ description: 'Send emails via SMTP or API.',
150
+ category: 'COMMUNICATION' as const,
151
+ status: 'ACTIVE' as const,
152
+ parametersSchema: {
153
+ type: 'object',
154
+ properties: {
155
+ to: { type: 'string' },
156
+ subject: { type: 'string' },
157
+ body: { type: 'string' },
158
+ },
159
+ required: ['to', 'subject', 'body'],
160
+ },
161
+ implementationType: 'http' as const,
162
+ implementationConfig: { url: '/api/send-email', method: 'POST' },
163
+ maxInvocationsPerMinute: 10,
164
+ timeoutMs: 30000,
165
+ version: '1.0.0',
166
+ tags: ['email', 'communication'],
167
+ createdAt: new Date('2024-02-01T00:00:00Z'),
168
+ updatedAt: new Date('2024-02-01T00:00:00Z'),
169
+ },
170
+ {
171
+ id: 'tool-4',
172
+ organizationId: 'demo-org',
173
+ name: 'GitHub Integration',
174
+ slug: 'github-integration',
175
+ description: 'Interact with GitHub repositories, PRs, and issues.',
176
+ category: 'INTEGRATION' as const,
177
+ status: 'ACTIVE' as const,
178
+ parametersSchema: {
179
+ type: 'object',
180
+ properties: {
181
+ action: {
182
+ type: 'string',
183
+ enum: ['list_prs', 'get_pr', 'create_comment'],
184
+ },
185
+ repo: { type: 'string' },
186
+ params: { type: 'object' },
187
+ },
188
+ required: ['action', 'repo'],
189
+ },
190
+ implementationType: 'http' as const,
191
+ implementationConfig: { url: 'https://api.github.com', auth: 'token' },
192
+ maxInvocationsPerMinute: 100,
193
+ timeoutMs: 15000,
194
+ version: '2.0.0',
195
+ tags: ['github', 'integration', 'code'],
196
+ createdAt: new Date('2024-02-20T00:00:00Z'),
197
+ updatedAt: new Date('2024-04-01T09:00:00Z'),
198
+ },
199
+ {
200
+ id: 'tool-5',
201
+ organizationId: 'demo-org',
202
+ name: 'Calculator',
203
+ slug: 'calculator',
204
+ description: 'Perform mathematical calculations.',
205
+ category: 'COMPUTATION' as const,
206
+ status: 'ACTIVE' as const,
207
+ parametersSchema: {
208
+ type: 'object',
209
+ properties: {
210
+ expression: {
211
+ type: 'string',
212
+ description: 'Math expression to evaluate',
213
+ },
214
+ },
215
+ required: ['expression'],
216
+ },
217
+ outputSchema: {
218
+ type: 'object',
219
+ properties: { result: { type: 'number' } },
220
+ },
221
+ implementationType: 'function' as const,
222
+ implementationConfig: { handler: 'evaluateMath' },
223
+ timeoutMs: 5000,
224
+ version: '1.0.0',
225
+ tags: ['math', 'utility'],
226
+ createdAt: new Date('2024-01-10T00:00:00Z'),
227
+ updatedAt: new Date('2024-01-10T00:00:00Z'),
228
+ },
229
+ ];
230
+
231
+ // ============ Run Mock Data ============
232
+
233
+ export const MOCK_RUNS = [
234
+ {
235
+ id: 'run-1',
236
+ organizationId: 'demo-org',
237
+ agentId: 'agent-1',
238
+ agentName: 'Customer Support Bot',
239
+ userId: 'user-1',
240
+ sessionId: 'session-1',
241
+ input: { message: 'How do I reset my password?', context: {} },
242
+ output: { response: 'You can reset your password by clicking...' },
243
+ status: 'COMPLETED' as const,
244
+ totalTokens: 1250,
245
+ promptTokens: 800,
246
+ completionTokens: 450,
247
+ totalIterations: 3,
248
+ durationMs: 4500,
249
+ estimatedCostUsd: 0.0025,
250
+ queuedAt: new Date('2024-04-15T10:00:00Z'),
251
+ startedAt: new Date('2024-04-15T10:00:01Z'),
252
+ completedAt: new Date('2024-04-15T10:00:05Z'),
253
+ },
254
+ {
255
+ id: 'run-2',
256
+ organizationId: 'demo-org',
257
+ agentId: 'agent-2',
258
+ agentName: 'Code Review Assistant',
259
+ userId: 'user-2',
260
+ input: { message: 'Review PR #123', context: { prNumber: 123 } },
261
+ status: 'IN_PROGRESS' as const,
262
+ totalTokens: 3500,
263
+ promptTokens: 3000,
264
+ completionTokens: 500,
265
+ totalIterations: 5,
266
+ queuedAt: new Date('2024-04-15T10:30:00Z'),
267
+ startedAt: new Date('2024-04-15T10:30:02Z'),
268
+ },
269
+ {
270
+ id: 'run-3',
271
+ organizationId: 'demo-org',
272
+ agentId: 'agent-1',
273
+ agentName: 'Customer Support Bot',
274
+ userId: 'user-1',
275
+ input: { message: 'What are your business hours?' },
276
+ output: { response: 'Our business hours are 9 AM to 5 PM EST...' },
277
+ status: 'COMPLETED' as const,
278
+ totalTokens: 800,
279
+ promptTokens: 500,
280
+ completionTokens: 300,
281
+ totalIterations: 2,
282
+ durationMs: 2100,
283
+ estimatedCostUsd: 0.0012,
284
+ queuedAt: new Date('2024-04-15T09:00:00Z'),
285
+ startedAt: new Date('2024-04-15T09:00:01Z'),
286
+ completedAt: new Date('2024-04-15T09:00:03Z'),
287
+ },
288
+ {
289
+ id: 'run-4',
290
+ organizationId: 'demo-org',
291
+ agentId: 'agent-3',
292
+ agentName: 'Data Analyst',
293
+ userId: 'user-3',
294
+ input: { message: 'Generate sales report for Q1' },
295
+ status: 'FAILED' as const,
296
+ errorMessage: 'Database connection timeout',
297
+ errorCode: 'DB_TIMEOUT',
298
+ totalTokens: 2000,
299
+ promptTokens: 1500,
300
+ completionTokens: 500,
301
+ totalIterations: 8,
302
+ durationMs: 45000,
303
+ queuedAt: new Date('2024-04-14T15:00:00Z'),
304
+ startedAt: new Date('2024-04-14T15:00:05Z'),
305
+ completedAt: new Date('2024-04-14T15:00:50Z'),
306
+ },
307
+ {
308
+ id: 'run-5',
309
+ organizationId: 'demo-org',
310
+ agentId: 'agent-2',
311
+ agentName: 'Code Review Assistant',
312
+ userId: 'user-2',
313
+ input: { message: 'Review PR #120' },
314
+ output: { response: 'Code review complete. 3 suggestions...' },
315
+ status: 'COMPLETED' as const,
316
+ totalTokens: 5200,
317
+ promptTokens: 4000,
318
+ completionTokens: 1200,
319
+ totalIterations: 7,
320
+ durationMs: 15000,
321
+ estimatedCostUsd: 0.0156,
322
+ queuedAt: new Date('2024-04-14T11:00:00Z'),
323
+ startedAt: new Date('2024-04-14T11:00:03Z'),
324
+ completedAt: new Date('2024-04-14T11:00:18Z'),
325
+ },
326
+ ];
327
+
328
+ // ============ Run Steps Mock Data ============
329
+
330
+ export const MOCK_RUN_STEPS = [
331
+ {
332
+ id: 'step-1',
333
+ runId: 'run-1',
334
+ stepNumber: 1,
335
+ type: 'MESSAGE_CREATION' as const,
336
+ input: { message: 'How do I reset my password?' },
337
+ output: { parsed: true },
338
+ status: 'COMPLETED' as const,
339
+ tokensUsed: 200,
340
+ durationMs: 500,
341
+ startedAt: new Date('2024-04-15T10:00:01Z'),
342
+ completedAt: new Date('2024-04-15T10:00:01Z'),
343
+ },
344
+ {
345
+ id: 'step-2',
346
+ runId: 'run-1',
347
+ stepNumber: 2,
348
+ type: 'TOOL_CALL' as const,
349
+ toolId: 'tool-1',
350
+ toolName: 'Web Search',
351
+ input: { query: 'password reset documentation' },
352
+ output: { results: [] },
353
+ status: 'COMPLETED' as const,
354
+ tokensUsed: 500,
355
+ durationMs: 2000,
356
+ startedAt: new Date('2024-04-15T10:00:02Z'),
357
+ completedAt: new Date('2024-04-15T10:00:04Z'),
358
+ },
359
+ {
360
+ id: 'step-3',
361
+ runId: 'run-1',
362
+ stepNumber: 3,
363
+ type: 'MESSAGE_CREATION' as const,
364
+ output: { response: 'You can reset your password by clicking...' },
365
+ status: 'COMPLETED' as const,
366
+ tokensUsed: 550,
367
+ durationMs: 2000,
368
+ startedAt: new Date('2024-04-15T10:00:04Z'),
369
+ completedAt: new Date('2024-04-15T10:00:05Z'),
370
+ },
371
+ ];
372
+
373
+ // ============ Run Logs Mock Data ============
374
+
375
+ export const MOCK_RUN_LOGS = [
376
+ {
377
+ id: 'log-1',
378
+ runId: 'run-1',
379
+ stepId: 'step-1',
380
+ level: 'INFO' as const,
381
+ message: 'Run started',
382
+ timestamp: new Date('2024-04-15T10:00:01Z'),
383
+ source: 'orchestrator',
384
+ },
385
+ {
386
+ id: 'log-2',
387
+ runId: 'run-1',
388
+ stepId: 'step-2',
389
+ level: 'DEBUG' as const,
390
+ message: 'Calling tool: Web Search',
391
+ data: { toolId: 'tool-1' },
392
+ timestamp: new Date('2024-04-15T10:00:02Z'),
393
+ source: 'tool-executor',
394
+ },
395
+ {
396
+ id: 'log-3',
397
+ runId: 'run-1',
398
+ stepId: 'step-2',
399
+ level: 'INFO' as const,
400
+ message: 'Tool execution completed',
401
+ data: { duration: 2000 },
402
+ timestamp: new Date('2024-04-15T10:00:04Z'),
403
+ source: 'tool-executor',
404
+ },
405
+ {
406
+ id: 'log-4',
407
+ runId: 'run-1',
408
+ level: 'INFO' as const,
409
+ message: 'Run completed successfully',
410
+ timestamp: new Date('2024-04-15T10:00:05Z'),
411
+ source: 'orchestrator',
412
+ },
413
+ ];