@hailer/mcp 0.1.17 → 0.2.2

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 (200) hide show
  1. package/dist/app.js +27 -20
  2. package/dist/core.d.ts +33 -9
  3. package/dist/core.js +279 -147
  4. package/dist/mcp/UserContextCache.js +18 -0
  5. package/dist/mcp/hailer-clients.d.ts +9 -1
  6. package/dist/mcp/hailer-clients.js +13 -3
  7. package/dist/mcp/signal-handler.js +1 -1
  8. package/dist/mcp/tool-registry.d.ts +3 -1
  9. package/dist/mcp/tool-registry.js +4 -1
  10. package/dist/mcp/tools/activity.js +43 -34
  11. package/dist/mcp/tools/bot-config/constants.d.ts +23 -0
  12. package/dist/mcp/tools/bot-config/constants.js +94 -0
  13. package/dist/mcp/tools/{bot-config.d.ts → bot-config/core.d.ts} +6 -6
  14. package/dist/mcp/tools/{bot-config.js → bot-config/core.js} +15 -15
  15. package/dist/mcp/tools/bot-config/index.d.ts +10 -0
  16. package/dist/mcp/tools/bot-config/index.js +59 -0
  17. package/dist/mcp/tools/bot-config/tools.d.ts +7 -0
  18. package/dist/mcp/tools/bot-config/tools.js +15 -0
  19. package/dist/mcp/tools/bot-config/types.d.ts +50 -0
  20. package/dist/mcp/tools/bot-config/types.js +6 -0
  21. package/dist/mcp/tools/bug-fixer-tools.d.ts +21 -0
  22. package/dist/mcp/tools/{giuseppe-tools.js → bug-fixer-tools.js} +61 -61
  23. package/dist/mcp/tools/user.js +10 -29
  24. package/dist/mcp/tools/workflow.js +36 -2
  25. package/dist/mcp/utils/data-transformers.d.ts +0 -8
  26. package/dist/mcp/utils/data-transformers.js +0 -28
  27. package/dist/mcp/utils/index.d.ts +4 -1
  28. package/dist/mcp/utils/index.js +17 -3
  29. package/dist/mcp/utils/pagination.d.ts +40 -0
  30. package/dist/mcp/utils/pagination.js +55 -0
  31. package/dist/mcp/utils/response-builder.d.ts +53 -0
  32. package/dist/mcp/utils/response-builder.js +110 -0
  33. package/dist/mcp/utils/tool-helpers.d.ts +0 -8
  34. package/dist/mcp/utils/tool-helpers.js +0 -24
  35. package/dist/mcp/utils/types.d.ts +1 -33
  36. package/dist/mcp-server.d.ts +2 -2
  37. package/dist/mcp-server.js +161 -139
  38. package/package.json +1 -1
  39. package/REFACTOR_STATUS.md +0 -127
  40. package/dist/agents/bot-manager.d.ts +0 -48
  41. package/dist/agents/bot-manager.js +0 -254
  42. package/dist/agents/factory.d.ts +0 -150
  43. package/dist/agents/factory.js +0 -650
  44. package/dist/agents/giuseppe/ai.d.ts +0 -83
  45. package/dist/agents/giuseppe/ai.js +0 -466
  46. package/dist/agents/giuseppe/bot.d.ts +0 -110
  47. package/dist/agents/giuseppe/bot.js +0 -780
  48. package/dist/agents/giuseppe/config.d.ts +0 -25
  49. package/dist/agents/giuseppe/config.js +0 -227
  50. package/dist/agents/giuseppe/files.d.ts +0 -52
  51. package/dist/agents/giuseppe/files.js +0 -338
  52. package/dist/agents/giuseppe/git.d.ts +0 -48
  53. package/dist/agents/giuseppe/git.js +0 -298
  54. package/dist/agents/giuseppe/index.d.ts +0 -97
  55. package/dist/agents/giuseppe/index.js +0 -258
  56. package/dist/agents/giuseppe/lsp.d.ts +0 -113
  57. package/dist/agents/giuseppe/lsp.js +0 -485
  58. package/dist/agents/giuseppe/monitor.d.ts +0 -118
  59. package/dist/agents/giuseppe/monitor.js +0 -621
  60. package/dist/agents/giuseppe/prompt.d.ts +0 -5
  61. package/dist/agents/giuseppe/prompt.js +0 -94
  62. package/dist/agents/giuseppe/registries/pending-classification.d.ts +0 -28
  63. package/dist/agents/giuseppe/registries/pending-classification.js +0 -50
  64. package/dist/agents/giuseppe/registries/pending-fix.d.ts +0 -30
  65. package/dist/agents/giuseppe/registries/pending-fix.js +0 -42
  66. package/dist/agents/giuseppe/registries/pending.d.ts +0 -27
  67. package/dist/agents/giuseppe/registries/pending.js +0 -49
  68. package/dist/agents/giuseppe/specialist.d.ts +0 -47
  69. package/dist/agents/giuseppe/specialist.js +0 -237
  70. package/dist/agents/giuseppe/types.d.ts +0 -123
  71. package/dist/agents/giuseppe/types.js +0 -9
  72. package/dist/agents/hailer-expert/index.d.ts +0 -8
  73. package/dist/agents/hailer-expert/index.js +0 -14
  74. package/dist/agents/hal/daemon.d.ts +0 -142
  75. package/dist/agents/hal/daemon.js +0 -1103
  76. package/dist/agents/hal/definitions.d.ts +0 -55
  77. package/dist/agents/hal/definitions.js +0 -263
  78. package/dist/agents/hal/index.d.ts +0 -3
  79. package/dist/agents/hal/index.js +0 -8
  80. package/dist/agents/index.d.ts +0 -18
  81. package/dist/agents/index.js +0 -48
  82. package/dist/agents/shared/base.d.ts +0 -216
  83. package/dist/agents/shared/base.js +0 -846
  84. package/dist/agents/shared/services/agent-registry.d.ts +0 -107
  85. package/dist/agents/shared/services/agent-registry.js +0 -629
  86. package/dist/agents/shared/services/conversation-manager.d.ts +0 -50
  87. package/dist/agents/shared/services/conversation-manager.js +0 -136
  88. package/dist/agents/shared/services/mcp-client.d.ts +0 -56
  89. package/dist/agents/shared/services/mcp-client.js +0 -124
  90. package/dist/agents/shared/services/message-classifier.d.ts +0 -37
  91. package/dist/agents/shared/services/message-classifier.js +0 -187
  92. package/dist/agents/shared/services/message-formatter.d.ts +0 -89
  93. package/dist/agents/shared/services/message-formatter.js +0 -371
  94. package/dist/agents/shared/services/session-logger.d.ts +0 -106
  95. package/dist/agents/shared/services/session-logger.js +0 -446
  96. package/dist/agents/shared/services/tool-executor.d.ts +0 -41
  97. package/dist/agents/shared/services/tool-executor.js +0 -169
  98. package/dist/agents/shared/services/workspace-schema-cache.d.ts +0 -125
  99. package/dist/agents/shared/services/workspace-schema-cache.js +0 -578
  100. package/dist/agents/shared/specialist.d.ts +0 -91
  101. package/dist/agents/shared/specialist.js +0 -399
  102. package/dist/agents/shared/tool-schema-loader.d.ts +0 -62
  103. package/dist/agents/shared/tool-schema-loader.js +0 -232
  104. package/dist/agents/shared/types.d.ts +0 -327
  105. package/dist/agents/shared/types.js +0 -121
  106. package/dist/client/agents/base.d.ts +0 -207
  107. package/dist/client/agents/base.js +0 -744
  108. package/dist/client/agents/definitions.d.ts +0 -53
  109. package/dist/client/agents/definitions.js +0 -263
  110. package/dist/client/agents/orchestrator.d.ts +0 -141
  111. package/dist/client/agents/orchestrator.js +0 -1062
  112. package/dist/client/agents/specialist.d.ts +0 -86
  113. package/dist/client/agents/specialist.js +0 -340
  114. package/dist/client/bot-entrypoint.d.ts +0 -7
  115. package/dist/client/bot-entrypoint.js +0 -103
  116. package/dist/client/bot-manager.d.ts +0 -44
  117. package/dist/client/bot-manager.js +0 -173
  118. package/dist/client/bot-runner.d.ts +0 -35
  119. package/dist/client/bot-runner.js +0 -188
  120. package/dist/client/chat-agent-daemon.d.ts +0 -464
  121. package/dist/client/chat-agent-daemon.js +0 -1774
  122. package/dist/client/daemon-factory.d.ts +0 -106
  123. package/dist/client/daemon-factory.js +0 -301
  124. package/dist/client/factory.d.ts +0 -111
  125. package/dist/client/factory.js +0 -314
  126. package/dist/client/index.d.ts +0 -17
  127. package/dist/client/index.js +0 -38
  128. package/dist/client/multi-bot-manager.d.ts +0 -42
  129. package/dist/client/multi-bot-manager.js +0 -161
  130. package/dist/client/orchestrator-daemon.d.ts +0 -87
  131. package/dist/client/orchestrator-daemon.js +0 -444
  132. package/dist/client/server.d.ts +0 -8
  133. package/dist/client/server.js +0 -251
  134. package/dist/client/services/agent-registry.d.ts +0 -108
  135. package/dist/client/services/agent-registry.js +0 -630
  136. package/dist/client/services/conversation-manager.d.ts +0 -50
  137. package/dist/client/services/conversation-manager.js +0 -136
  138. package/dist/client/services/mcp-client.d.ts +0 -48
  139. package/dist/client/services/mcp-client.js +0 -105
  140. package/dist/client/services/message-classifier.d.ts +0 -37
  141. package/dist/client/services/message-classifier.js +0 -187
  142. package/dist/client/services/message-formatter.d.ts +0 -84
  143. package/dist/client/services/message-formatter.js +0 -353
  144. package/dist/client/services/session-logger.d.ts +0 -106
  145. package/dist/client/services/session-logger.js +0 -446
  146. package/dist/client/services/tool-executor.d.ts +0 -41
  147. package/dist/client/services/tool-executor.js +0 -169
  148. package/dist/client/services/workspace-schema-cache.d.ts +0 -149
  149. package/dist/client/services/workspace-schema-cache.js +0 -732
  150. package/dist/client/specialist-daemon.d.ts +0 -77
  151. package/dist/client/specialist-daemon.js +0 -197
  152. package/dist/client/specialists.d.ts +0 -53
  153. package/dist/client/specialists.js +0 -178
  154. package/dist/client/tool-schema-loader.d.ts +0 -62
  155. package/dist/client/tool-schema-loader.js +0 -232
  156. package/dist/client/types.d.ts +0 -327
  157. package/dist/client/types.js +0 -121
  158. package/dist/commands/seed-config.d.ts +0 -9
  159. package/dist/commands/seed-config.js +0 -372
  160. package/dist/lib/context-manager.d.ts +0 -111
  161. package/dist/lib/context-manager.js +0 -431
  162. package/dist/lib/prompt-length-manager.d.ts +0 -81
  163. package/dist/lib/prompt-length-manager.js +0 -457
  164. package/dist/mcp/tools/giuseppe-tools.d.ts +0 -21
  165. package/dist/modules/bug-reports/bug-config.d.ts +0 -25
  166. package/dist/modules/bug-reports/bug-config.js +0 -187
  167. package/dist/modules/bug-reports/bug-monitor.d.ts +0 -108
  168. package/dist/modules/bug-reports/bug-monitor.js +0 -510
  169. package/dist/modules/bug-reports/giuseppe-agent.d.ts +0 -58
  170. package/dist/modules/bug-reports/giuseppe-agent.js +0 -467
  171. package/dist/modules/bug-reports/giuseppe-ai.d.ts +0 -83
  172. package/dist/modules/bug-reports/giuseppe-ai.js +0 -466
  173. package/dist/modules/bug-reports/giuseppe-bot.d.ts +0 -110
  174. package/dist/modules/bug-reports/giuseppe-bot.js +0 -804
  175. package/dist/modules/bug-reports/giuseppe-daemon.d.ts +0 -80
  176. package/dist/modules/bug-reports/giuseppe-daemon.js +0 -617
  177. package/dist/modules/bug-reports/giuseppe-files.d.ts +0 -64
  178. package/dist/modules/bug-reports/giuseppe-files.js +0 -375
  179. package/dist/modules/bug-reports/giuseppe-git.d.ts +0 -48
  180. package/dist/modules/bug-reports/giuseppe-git.js +0 -298
  181. package/dist/modules/bug-reports/giuseppe-lsp.d.ts +0 -113
  182. package/dist/modules/bug-reports/giuseppe-lsp.js +0 -485
  183. package/dist/modules/bug-reports/giuseppe-prompt.d.ts +0 -5
  184. package/dist/modules/bug-reports/giuseppe-prompt.js +0 -94
  185. package/dist/modules/bug-reports/index.d.ts +0 -77
  186. package/dist/modules/bug-reports/index.js +0 -215
  187. package/dist/modules/bug-reports/pending-classification-registry.d.ts +0 -28
  188. package/dist/modules/bug-reports/pending-classification-registry.js +0 -50
  189. package/dist/modules/bug-reports/pending-fix-registry.d.ts +0 -30
  190. package/dist/modules/bug-reports/pending-fix-registry.js +0 -42
  191. package/dist/modules/bug-reports/pending-registry.d.ts +0 -27
  192. package/dist/modules/bug-reports/pending-registry.js +0 -49
  193. package/dist/modules/bug-reports/types.d.ts +0 -123
  194. package/dist/modules/bug-reports/types.js +0 -9
  195. package/dist/routes/agents.d.ts +0 -44
  196. package/dist/routes/agents.js +0 -311
  197. package/dist/services/agent-credential-store.d.ts +0 -73
  198. package/dist/services/agent-credential-store.js +0 -212
  199. package/dist/services/bug-monitor.d.ts +0 -23
  200. package/dist/services/bug-monitor.js +0 -275
@@ -1,232 +0,0 @@
1
- "use strict";
2
- /**
3
- * Tool Schema Loader
4
- *
5
- * Manages MCP tool discovery, schema loading, and filtering.
6
- * Shared between all LLM providers (Anthropic, OpenAI, etc.)
7
- *
8
- * Key Features:
9
- * - Load lightweight tool index from MCP server
10
- * - Filter tools by groups (READ, WRITE, PLAYGROUND)
11
- * - Load full schemas on-demand (token-efficient)
12
- * - Cache loaded schemas
13
- */
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ToolSchemaLoader = void 0;
16
- const logger_1 = require("../lib/logger");
17
- const logger = (0, logger_1.createLogger)({ component: 'ToolSchemaLoader' });
18
- /**
19
- * Recursively add additionalProperties: false to all object schemas
20
- * Required for Anthropic structured outputs (betas: ['structured-outputs-2025-11-13'])
21
- */
22
- function addAdditionalPropertiesFalse(schema) {
23
- if (!schema || typeof schema !== 'object')
24
- return schema;
25
- // Create a shallow copy to avoid mutating the original
26
- const result = { ...schema };
27
- // If this is an object type, ensure additionalProperties is false
28
- if (result.type === 'object') {
29
- result.additionalProperties = false;
30
- // Recursively process properties
31
- if (result.properties && typeof result.properties === 'object') {
32
- result.properties = { ...result.properties };
33
- for (const key of Object.keys(result.properties)) {
34
- result.properties[key] = addAdditionalPropertiesFalse(result.properties[key]);
35
- }
36
- }
37
- // Recursively process patternProperties
38
- if (result.patternProperties && typeof result.patternProperties === 'object') {
39
- result.patternProperties = { ...result.patternProperties };
40
- for (const key of Object.keys(result.patternProperties)) {
41
- result.patternProperties[key] = addAdditionalPropertiesFalse(result.patternProperties[key]);
42
- }
43
- }
44
- }
45
- // Handle array items
46
- if (result.items) {
47
- result.items = addAdditionalPropertiesFalse(result.items);
48
- }
49
- // Handle oneOf, anyOf, allOf
50
- if (result.oneOf) {
51
- result.oneOf = result.oneOf.map((s) => addAdditionalPropertiesFalse(s));
52
- }
53
- if (result.anyOf) {
54
- result.anyOf = result.anyOf.map((s) => addAdditionalPropertiesFalse(s));
55
- }
56
- if (result.allOf) {
57
- result.allOf = result.allOf.map((s) => addAdditionalPropertiesFalse(s));
58
- }
59
- return result;
60
- }
61
- class ToolSchemaLoader {
62
- toolSchemaCache = new Map(); // In-memory cache for tool schemas
63
- /**
64
- * Load tool index with filtering
65
- * Returns lightweight tool list with optional exclusions
66
- */
67
- async loadToolIndex(options) {
68
- const { mcpServerUrl, mcpServerApiKey, allowedGroups, allowedTools, excludeMessageFetchTools } = options;
69
- // Fetch tool index from MCP server with group filtering
70
- let toolIndex = await this.fetchMcpToolIndex(mcpServerUrl, mcpServerApiKey, allowedGroups);
71
- // Filter by explicit whitelist if provided (overrides group filtering)
72
- if (allowedTools && allowedTools.length > 0) {
73
- toolIndex = toolIndex.filter(tool => allowedTools.includes(tool.name));
74
- logger.debug("Filtered tools by whitelist", {
75
- allowedTools,
76
- resultCount: toolIndex.length
77
- });
78
- }
79
- // Optionally exclude message fetch tools if explicitly requested
80
- if (excludeMessageFetchTools) {
81
- const excludedTools = ['fetch_discussion_messages', 'fetch_previous_discussion_messages'];
82
- toolIndex = toolIndex.filter(tool => !excludedTools.includes(tool.name));
83
- logger.debug("Excluded message fetch tools (explicitly requested)", { excludedTools });
84
- }
85
- logger.debug("Loaded tool index", {
86
- toolCount: toolIndex.length,
87
- allowedGroups: allowedGroups.join(', ')
88
- });
89
- return toolIndex;
90
- }
91
- /**
92
- * Load full schema for a specific tool on-demand
93
- */
94
- async loadToolSchema(mcpServerUrl, mcpServerApiKey, toolName) {
95
- // Check cache first
96
- if (this.toolSchemaCache.has(toolName)) {
97
- logger.debug("Using cached tool schema", { toolName });
98
- return this.toolSchemaCache.get(toolName);
99
- }
100
- // Fetch from MCP server
101
- logger.debug("Fetching full schema for tool on-demand", { toolName });
102
- const url = `${mcpServerUrl}${mcpServerUrl.includes("?") ? "&" : "?"}apiKey=${mcpServerApiKey}`;
103
- const response = await fetch(url, {
104
- method: "POST",
105
- headers: {
106
- "Content-Type": "application/json",
107
- Accept: "application/json, text/event-stream",
108
- },
109
- body: JSON.stringify({
110
- jsonrpc: "2.0",
111
- id: 1,
112
- method: "tools/get_schema",
113
- params: { name: toolName },
114
- }),
115
- });
116
- if (!response.ok) {
117
- throw new Error(`MCP server responded with ${response.status}: ${response.statusText}`);
118
- }
119
- // Parse SSE response
120
- const responseText = await response.text();
121
- const lines = responseText.split("\n");
122
- let jsonData = null;
123
- for (const line of lines) {
124
- if (line.startsWith("data: ")) {
125
- try {
126
- jsonData = JSON.parse(line.substring(6));
127
- break;
128
- }
129
- catch (e) {
130
- // Skip non-JSON lines
131
- }
132
- }
133
- }
134
- if (!jsonData) {
135
- throw new Error("Failed to parse MCP server response");
136
- }
137
- if (jsonData.error) {
138
- throw new Error(`MCP server error: ${jsonData.error.message || jsonData.error}`);
139
- }
140
- let schema = jsonData.result;
141
- // Apply additionalProperties: false recursively for Anthropic structured outputs
142
- if (schema.inputSchema) {
143
- schema.inputSchema = addAdditionalPropertiesFalse(schema.inputSchema);
144
- }
145
- // Cache the schema
146
- this.toolSchemaCache.set(toolName, schema);
147
- logger.debug("Cached tool schema", { toolName });
148
- return schema;
149
- }
150
- /**
151
- * Convert tool index to minimal tool definitions (stubs)
152
- * Full schemas will be loaded on-demand when needed
153
- */
154
- toMinimalToolDefinitions(toolIndex) {
155
- return toolIndex.map((tool, index) => {
156
- const toolDef = {
157
- name: tool.name,
158
- description: tool.description,
159
- input_schema: addAdditionalPropertiesFalse({
160
- type: "object",
161
- properties: {},
162
- required: [],
163
- }),
164
- };
165
- // Add cache control to last tool for Anthropic prompt caching
166
- if (index === toolIndex.length - 1) {
167
- toolDef.cache_control = { type: "ephemeral" };
168
- }
169
- return toolDef;
170
- });
171
- }
172
- /**
173
- * Get count of loaded schemas
174
- */
175
- getLoadedSchemaCount() {
176
- return this.toolSchemaCache.size;
177
- }
178
- /**
179
- * Clear schema cache
180
- */
181
- clearCache() {
182
- this.toolSchemaCache.clear();
183
- logger.debug("Tool schema cache cleared");
184
- }
185
- // ===== PRIVATE METHODS =====
186
- /**
187
- * Fetch tool index from MCP server
188
- */
189
- async fetchMcpToolIndex(mcpServerUrl, mcpServerApiKey, allowedGroups) {
190
- const url = `${mcpServerUrl}${mcpServerUrl.includes("?") ? "&" : "?"}apiKey=${mcpServerApiKey}`;
191
- const response = await fetch(url, {
192
- method: "POST",
193
- headers: {
194
- "Content-Type": "application/json",
195
- Accept: "application/json, text/event-stream",
196
- },
197
- body: JSON.stringify({
198
- jsonrpc: "2.0",
199
- id: 1,
200
- method: "tools/list",
201
- params: allowedGroups ? { groups: allowedGroups } : {},
202
- }),
203
- });
204
- if (!response.ok) {
205
- throw new Error(`MCP server responded with ${response.status}: ${response.statusText}`);
206
- }
207
- // Parse SSE response format
208
- const responseText = await response.text();
209
- const lines = responseText.split("\n");
210
- let jsonData = null;
211
- for (const line of lines) {
212
- if (line.startsWith("data: ")) {
213
- try {
214
- jsonData = JSON.parse(line.substring(6));
215
- break;
216
- }
217
- catch (e) {
218
- // Skip non-JSON lines
219
- }
220
- }
221
- }
222
- if (!jsonData) {
223
- throw new Error("Failed to parse MCP server response");
224
- }
225
- if (jsonData.error) {
226
- throw new Error(`MCP server error: ${jsonData.error.message || jsonData.error}`);
227
- }
228
- return jsonData.result.tools;
229
- }
230
- }
231
- exports.ToolSchemaLoader = ToolSchemaLoader;
232
- //# sourceMappingURL=tool-schema-loader.js.map
@@ -1,327 +0,0 @@
1
- /**
2
- * Client Types
3
- * All interfaces and types for the agent system
4
- */
5
- import { BotClient } from "./bot-manager";
6
- export interface BotClientConfig {
7
- email: string;
8
- password: string;
9
- apiBaseUrl: string;
10
- mcpServerApiKey: string;
11
- }
12
- export interface AgentDaemonConfig {
13
- botClient: BotClient;
14
- mcpServerUrl: string;
15
- anthropicApiKey: string;
16
- model?: string;
17
- maxContextMessages?: number;
18
- }
19
- /** JSON Schema definition for tool input schemas */
20
- export interface JsonSchema {
21
- type?: string;
22
- properties?: Record<string, JsonSchema>;
23
- required?: string[];
24
- items?: JsonSchema;
25
- oneOf?: JsonSchema[];
26
- anyOf?: JsonSchema[];
27
- allOf?: JsonSchema[];
28
- additionalProperties?: boolean | JsonSchema;
29
- patternProperties?: Record<string, JsonSchema>;
30
- description?: string;
31
- enum?: Array<string | number | boolean>;
32
- const?: unknown;
33
- default?: unknown;
34
- minimum?: number;
35
- maximum?: number;
36
- minLength?: number;
37
- maxLength?: number;
38
- pattern?: string;
39
- format?: string;
40
- $ref?: string;
41
- $schema?: string;
42
- }
43
- /** Hailer discussion message from API */
44
- export interface HailerMessage {
45
- _id: string;
46
- msg?: string;
47
- content?: string;
48
- uid: string;
49
- userName?: string;
50
- type?: string;
51
- replyTo?: string;
52
- created?: number;
53
- }
54
- /** Hailer discussion data from API */
55
- export interface HailerDiscussion {
56
- _id: string;
57
- name?: string;
58
- participants?: string[];
59
- linked_activity?: string;
60
- }
61
- /** Hailer user from search/workspace cache */
62
- export interface HailerUser {
63
- _id: string;
64
- firstname?: string;
65
- lastname?: string;
66
- fullName?: string;
67
- email?: string;
68
- }
69
- /** MCP tool definition from tool index */
70
- export interface ToolDefinition {
71
- name: string;
72
- description?: string;
73
- inputSchema?: {
74
- type: string;
75
- properties?: Record<string, unknown>;
76
- required?: string[];
77
- };
78
- }
79
- /** MCP tool result from server */
80
- export interface McpToolResult {
81
- content?: Array<{
82
- text?: string;
83
- type?: string;
84
- }>;
85
- }
86
- /** Callback type for MCP tool calls - used by services */
87
- export type McpToolCallback = (name: string, args: ToolInput) => Promise<McpToolResult>;
88
- /** Tool input - all fields optional since different tools use different fields */
89
- export interface ToolInput {
90
- name?: string;
91
- activityId?: string;
92
- discussionId?: string;
93
- insightId?: string;
94
- workflowId?: string;
95
- phaseId?: string;
96
- fields?: Record<string, string | number | boolean> | string[];
97
- search?: string;
98
- query?: string;
99
- limit?: number;
100
- filters?: Record<string, {
101
- operator: string;
102
- value: string;
103
- }>;
104
- sortBy?: string;
105
- sortOrder?: "asc" | "desc";
106
- content?: string;
107
- userIds?: string[];
108
- inviteUserId?: string;
109
- sourceActivityId?: string;
110
- welcomeReason?: string;
111
- compact?: boolean;
112
- teamId?: string;
113
- workspace?: string;
114
- workspaceId?: string;
115
- templateId?: string;
116
- publicOnly?: boolean;
117
- }
118
- export type MessagePriority = "high" | "normal" | "low";
119
- export interface IncomingMessage {
120
- id: string;
121
- discussionId: string;
122
- workspaceId: string;
123
- discussionName?: string;
124
- linkedActivityId?: string;
125
- linkedActivityName?: string;
126
- senderId: string;
127
- senderName: string;
128
- content: string;
129
- timestamp: number;
130
- priority: MessagePriority;
131
- priorityReason: string;
132
- isReplyToBot: boolean;
133
- isMention: boolean;
134
- isDirectMessage: boolean;
135
- }
136
- export type LlmDecision = {
137
- action: "respond";
138
- discussionId: string;
139
- content: string;
140
- } | {
141
- action: "ignore";
142
- reason: string;
143
- } | {
144
- action: "tool_call";
145
- toolName: string;
146
- args: ToolInput;
147
- } | {
148
- action: "thinking";
149
- content: string;
150
- };
151
- /** State returned by getConversationState() */
152
- export interface ConversationState {
153
- discussionCount: number;
154
- currentDiscussion: string | null;
155
- currentMessageCount: number;
156
- queueLength: number;
157
- lastMessages: Array<{
158
- role: string;
159
- preview: string;
160
- }>;
161
- isProcessing: boolean;
162
- }
163
- export interface SessionMetrics {
164
- inputTokens: number;
165
- outputTokens: number;
166
- toolCalls: number;
167
- writeOperations: number;
168
- messagesProcessed: number;
169
- responsesPosted: number;
170
- }
171
- export interface ActivitySession {
172
- activityId: string;
173
- activityName: string;
174
- discussionId: string;
175
- workspaceId: string;
176
- startTime: number;
177
- lastActivityTime: number;
178
- metrics: SessionMetrics;
179
- actions: string[];
180
- previousLogId: string | null;
181
- conversation: string[];
182
- writeDetails: WriteDetail[];
183
- triggerRequest: string | null;
184
- requestedBy: string | null;
185
- requestedById: string | null;
186
- }
187
- /** Detail about a write operation */
188
- export interface WriteDetail {
189
- tool: string;
190
- what: string;
191
- targetId?: string;
192
- }
193
- export declare const AGENT_DIRECTORY: {
194
- readonly workflowId: "694a35b5b8b5c5f8030788e3";
195
- readonly phases: {
196
- readonly agentBuilder: "694a35b5b8b5c5f8030788f7";
197
- readonly deployed: "694a35b5b8b5c5f8030788fb";
198
- readonly retired: "694a35b5b8b5c5f8030788fc";
199
- };
200
- readonly fields: {
201
- readonly firstName: "694a35b5b8b5c5f8030788ea";
202
- readonly lastName: "694a35b5b8b5c5f8030788eb";
203
- readonly description: "694a35b5b8b5c5f8030788f6";
204
- readonly hailerProfile: "694a35b5b8b5c5f8030788f2";
205
- readonly email: "694a35b5b8b5c5f8030788f3";
206
- readonly password: "694a35b5b8b5c5f8030788f4";
207
- readonly team: "694a35b5b8b5c5f8030788e7";
208
- readonly supervisor: "694a35b5b8b5c5f8030788e8";
209
- readonly memory: "694a35b5b8b5c5f8030788f5";
210
- readonly position: "694a35b5b8b5c5f8030788e5";
211
- readonly startDate: "694a35b5b8b5c5f8030788ec";
212
- };
213
- };
214
- export declare const SESSION_LOG: {
215
- readonly workflowId: "694a35b5b8b5c5f803078915";
216
- readonly phases: {
217
- readonly active: "694a35b5b8b5c5f803078941";
218
- readonly archive: "694a35b5b8b5c5f803078942";
219
- };
220
- readonly fields: {
221
- readonly contextSummary: "694a35b5b8b5c5f80307893c";
222
- readonly previousLog: "694a35b5b8b5c5f80307893d";
223
- readonly linkedWork: "694a35b5b8b5c5f80307893e";
224
- readonly cost: "694a35b5b8b5c5f80307893f";
225
- readonly madeBy: "694a35b5b8b5c5f803078940";
226
- };
227
- };
228
- export declare const POSITIONS: {
229
- readonly workflowId: "694a35b5b8b5c5f8030788e4";
230
- readonly phases: {
231
- readonly active: "694a35b5b8b5c5f80307890f";
232
- };
233
- readonly fields: {
234
- readonly purpose: "694a35b5b8b5c5f803078901";
235
- readonly personaTone: "694a35b5b8b5c5f803078903";
236
- readonly coreCapabilities: "694a35b5b8b5c5f803078904";
237
- readonly contextAwareness: "694a35b5b8b5c5f803078905";
238
- readonly taskHandling: "694a35b5b8b5c5f803078906";
239
- readonly infoRetrieval: "694a35b5b8b5c5f803078907";
240
- readonly boundaries: "694a35b5b8b5c5f803078908";
241
- readonly userInteraction: "694a35b5b8b5c5f803078909";
242
- readonly errorHandling: "694a35b5b8b5c5f80307890a";
243
- readonly learning: "694a35b5b8b5c5f80307890b";
244
- readonly escalation: "694a35b5b8b5c5f80307890c";
245
- readonly auditLogging: "694a35b5b8b5c5f80307890d";
246
- readonly agentCount: "694a35b5b8b5c5f803078902";
247
- readonly multiAllowed: "694a35b5b8b5c5f80307890e";
248
- };
249
- };
250
- export declare const TEAMS: {
251
- readonly workflowId: "694a35b5b8b5c5f8030788e6";
252
- readonly phases: {
253
- readonly active: "694a35b5b8b5c5f80307891a";
254
- };
255
- readonly fields: {
256
- readonly info: "694a35b5b8b5c5f803078919";
257
- readonly leader: "694a35b5b8b5c5f8030788e9";
258
- };
259
- };
260
- export declare const TOOL_REGISTRY: {
261
- readonly workflowId: "694a35b5b8b5c5f803078922";
262
- readonly phases: {
263
- readonly active: "694a35b5b8b5c5f803078927";
264
- };
265
- readonly fields: {
266
- readonly baseUrl: "694a35b5b8b5c5f803078923";
267
- readonly protocolVersion: "694a35b5b8b5c5f803078924";
268
- readonly toolRegistry: "694a35b5b8b5c5f803078925";
269
- readonly logEntryBy: "694a35b5b8b5c5f803078926";
270
- };
271
- };
272
- export declare const MCP_CONFIG: {
273
- readonly workflowId: "694a35b5b8b5c5f803078928";
274
- readonly phases: {
275
- readonly active: "694a35b5b8b5c5f80307893b";
276
- };
277
- readonly fields: {
278
- readonly agentName: "694a35b5b8b5c5f803078929";
279
- readonly agentId: "694a35b5b8b5c5f80307892a";
280
- readonly publicKey: "694a35b5b8b5c5f80307892c";
281
- readonly accessTo: "694a35b5b8b5c5f80307892b";
282
- readonly authToken: "694a35b5b8b5c5f80307892d";
283
- readonly apiKey: "694a35b5b8b5c5f80307892e";
284
- readonly workspaceId: "694a35b5b8b5c5f803078934";
285
- readonly permissions: "694a35b5b8b5c5f803078935";
286
- readonly sessionId: "694a35b5b8b5c5f803078936";
287
- readonly resourceLimits: "694a35b5b8b5c5f803078937";
288
- readonly loggingEndpoint: "694a35b5b8b5c5f803078938";
289
- readonly callbackUrl: "694a35b5b8b5c5f803078939";
290
- readonly customContext: "694a35b5b8b5c5f80307893a";
291
- readonly permCreate: "694a35b5b8b5c5f803078930";
292
- readonly permRead: "694a35b5b8b5c5f803078931";
293
- readonly permUpdate: "694a35b5b8b5c5f803078932";
294
- readonly permDelete: "694a35b5b8b5c5f803078933";
295
- };
296
- };
297
- export declare const SESSION_IDLE_TIMEOUT = 60000;
298
- export interface BotDefinition {
299
- id: string;
300
- name: string;
301
- description: string;
302
- icon: string;
303
- }
304
- export { AVAILABLE_BOTS } from '../mcp/tools/bot-config';
305
- export interface WorkspaceConfig {
306
- id: string;
307
- name: string;
308
- apiKey: string;
309
- enabledBots: string[];
310
- registeredAt: string;
311
- lastSeen?: string;
312
- }
313
- export interface WorkspacesState {
314
- workspaces: Record<string, WorkspaceConfig>;
315
- }
316
- export interface WorkspaceStatus {
317
- id: string;
318
- name: string;
319
- registered: boolean;
320
- bots: Array<{
321
- id: string;
322
- name: string;
323
- enabled: boolean;
324
- running: boolean;
325
- }>;
326
- }
327
- //# sourceMappingURL=types.d.ts.map
@@ -1,121 +0,0 @@
1
- "use strict";
2
- /**
3
- * Client Types
4
- * All interfaces and types for the agent system
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.AVAILABLE_BOTS = exports.SESSION_IDLE_TIMEOUT = exports.MCP_CONFIG = exports.TOOL_REGISTRY = exports.TEAMS = exports.POSITIONS = exports.SESSION_LOG = exports.AGENT_DIRECTORY = void 0;
8
- // ===== WORKFLOW CONSTANTS =====
9
- // DEPRECATED: These IDs are for ONE workspace only!
10
- // Use WorkspaceSchemaCacheService for dynamic per-workspace lookup.
11
- // These will be removed in a future version.
12
- exports.AGENT_DIRECTORY = {
13
- workflowId: "694a35b5b8b5c5f8030788e3",
14
- phases: {
15
- agentBuilder: "694a35b5b8b5c5f8030788f7",
16
- deployed: "694a35b5b8b5c5f8030788fb",
17
- retired: "694a35b5b8b5c5f8030788fc",
18
- },
19
- fields: {
20
- firstName: "694a35b5b8b5c5f8030788ea",
21
- lastName: "694a35b5b8b5c5f8030788eb",
22
- description: "694a35b5b8b5c5f8030788f6",
23
- hailerProfile: "694a35b5b8b5c5f8030788f2",
24
- email: "694a35b5b8b5c5f8030788f3",
25
- password: "694a35b5b8b5c5f8030788f4",
26
- team: "694a35b5b8b5c5f8030788e7",
27
- supervisor: "694a35b5b8b5c5f8030788e8",
28
- memory: "694a35b5b8b5c5f8030788f5",
29
- position: "694a35b5b8b5c5f8030788e5",
30
- startDate: "694a35b5b8b5c5f8030788ec",
31
- },
32
- };
33
- exports.SESSION_LOG = {
34
- workflowId: "694a35b5b8b5c5f803078915",
35
- phases: {
36
- active: "694a35b5b8b5c5f803078941",
37
- archive: "694a35b5b8b5c5f803078942",
38
- },
39
- fields: {
40
- contextSummary: "694a35b5b8b5c5f80307893c",
41
- previousLog: "694a35b5b8b5c5f80307893d",
42
- linkedWork: "694a35b5b8b5c5f80307893e",
43
- cost: "694a35b5b8b5c5f80307893f",
44
- madeBy: "694a35b5b8b5c5f803078940",
45
- },
46
- };
47
- exports.POSITIONS = {
48
- workflowId: "694a35b5b8b5c5f8030788e4",
49
- phases: {
50
- active: "694a35b5b8b5c5f80307890f",
51
- },
52
- fields: {
53
- purpose: "694a35b5b8b5c5f803078901",
54
- personaTone: "694a35b5b8b5c5f803078903",
55
- coreCapabilities: "694a35b5b8b5c5f803078904",
56
- contextAwareness: "694a35b5b8b5c5f803078905",
57
- taskHandling: "694a35b5b8b5c5f803078906",
58
- infoRetrieval: "694a35b5b8b5c5f803078907",
59
- boundaries: "694a35b5b8b5c5f803078908",
60
- userInteraction: "694a35b5b8b5c5f803078909",
61
- errorHandling: "694a35b5b8b5c5f80307890a",
62
- learning: "694a35b5b8b5c5f80307890b",
63
- escalation: "694a35b5b8b5c5f80307890c",
64
- auditLogging: "694a35b5b8b5c5f80307890d",
65
- agentCount: "694a35b5b8b5c5f803078902",
66
- multiAllowed: "694a35b5b8b5c5f80307890e",
67
- },
68
- };
69
- exports.TEAMS = {
70
- workflowId: "694a35b5b8b5c5f8030788e6",
71
- phases: {
72
- active: "694a35b5b8b5c5f80307891a",
73
- },
74
- fields: {
75
- info: "694a35b5b8b5c5f803078919",
76
- leader: "694a35b5b8b5c5f8030788e9",
77
- },
78
- };
79
- exports.TOOL_REGISTRY = {
80
- workflowId: "694a35b5b8b5c5f803078922",
81
- phases: {
82
- active: "694a35b5b8b5c5f803078927",
83
- },
84
- fields: {
85
- baseUrl: "694a35b5b8b5c5f803078923",
86
- protocolVersion: "694a35b5b8b5c5f803078924",
87
- toolRegistry: "694a35b5b8b5c5f803078925",
88
- logEntryBy: "694a35b5b8b5c5f803078926",
89
- },
90
- };
91
- exports.MCP_CONFIG = {
92
- workflowId: "694a35b5b8b5c5f803078928",
93
- phases: {
94
- active: "694a35b5b8b5c5f80307893b",
95
- },
96
- fields: {
97
- agentName: "694a35b5b8b5c5f803078929",
98
- agentId: "694a35b5b8b5c5f80307892a",
99
- publicKey: "694a35b5b8b5c5f80307892c",
100
- accessTo: "694a35b5b8b5c5f80307892b",
101
- authToken: "694a35b5b8b5c5f80307892d",
102
- apiKey: "694a35b5b8b5c5f80307892e",
103
- workspaceId: "694a35b5b8b5c5f803078934",
104
- permissions: "694a35b5b8b5c5f803078935",
105
- sessionId: "694a35b5b8b5c5f803078936",
106
- resourceLimits: "694a35b5b8b5c5f803078937",
107
- loggingEndpoint: "694a35b5b8b5c5f803078938",
108
- callbackUrl: "694a35b5b8b5c5f803078939",
109
- customContext: "694a35b5b8b5c5f80307893a",
110
- permCreate: "694a35b5b8b5c5f803078930",
111
- permRead: "694a35b5b8b5c5f803078931",
112
- permUpdate: "694a35b5b8b5c5f803078932",
113
- permDelete: "694a35b5b8b5c5f803078933",
114
- },
115
- };
116
- // ===== CONSTANTS =====
117
- exports.SESSION_IDLE_TIMEOUT = 60_000; // 60 seconds
118
- // Export AVAILABLE_BOTS from bot-config tools (single source of truth)
119
- var bot_config_1 = require("../mcp/tools/bot-config");
120
- Object.defineProperty(exports, "AVAILABLE_BOTS", { enumerable: true, get: function () { return bot_config_1.AVAILABLE_BOTS; } });
121
- //# sourceMappingURL=types.js.map
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env tsx
2
- /**
3
- * Seed Bot Configuration
4
- *
5
- * Connects as master user, discovers Agent Directory workflows across all workspaces,
6
- * and writes bot configuration to .bot-config/{workspaceId}.json
7
- */
8
- export {};
9
- //# sourceMappingURL=seed-config.d.ts.map