@hailer/mcp 0.1.8 → 0.1.9

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 (135) hide show
  1. package/.claude/agents/agent-dmitri-activity-crud.md +3 -1
  2. package/.claude/agents/agent-giuseppe-app-builder.md +11 -12
  3. package/.claude/agents/agent-kenji-data-reader.md +5 -3
  4. package/.claude/skills/hailer-app-builder/SKILL.md +506 -0
  5. package/.claude/skills/publish-hailer-app/SKILL.md +169 -0
  6. package/.claude/skills/tool-parameter-usage/SKILL.md +112 -0
  7. package/CLAUDE.md +6 -2
  8. package/REFACTOR_STATUS.md +127 -0
  9. package/dist/cli.js +0 -0
  10. package/dist/client/agents/base.d.ts +202 -0
  11. package/dist/client/agents/base.js +737 -0
  12. package/dist/client/agents/definitions.d.ts +53 -0
  13. package/dist/client/agents/definitions.js +178 -0
  14. package/dist/client/agents/orchestrator.d.ts +119 -0
  15. package/dist/client/agents/orchestrator.js +760 -0
  16. package/dist/client/agents/specialist.d.ts +86 -0
  17. package/dist/client/agents/specialist.js +340 -0
  18. package/dist/client/bot-manager.d.ts +44 -0
  19. package/dist/client/bot-manager.js +173 -0
  20. package/dist/client/chat-agent-daemon.d.ts +464 -0
  21. package/dist/client/chat-agent-daemon.js +1774 -0
  22. package/dist/client/daemon-factory.d.ts +106 -0
  23. package/dist/client/daemon-factory.js +301 -0
  24. package/dist/client/factory.d.ts +107 -0
  25. package/dist/client/factory.js +304 -0
  26. package/dist/client/index.d.ts +17 -0
  27. package/dist/client/index.js +38 -0
  28. package/dist/client/multi-bot-manager.d.ts +18 -0
  29. package/dist/client/multi-bot-manager.js +88 -1
  30. package/dist/client/orchestrator-daemon.d.ts +87 -0
  31. package/dist/client/orchestrator-daemon.js +444 -0
  32. package/dist/client/services/agent-registry.d.ts +108 -0
  33. package/dist/client/services/agent-registry.js +630 -0
  34. package/dist/client/services/conversation-manager.d.ts +50 -0
  35. package/dist/client/services/conversation-manager.js +136 -0
  36. package/dist/client/services/mcp-client.d.ts +48 -0
  37. package/dist/client/services/mcp-client.js +105 -0
  38. package/dist/client/services/message-classifier.d.ts +37 -0
  39. package/dist/client/services/message-classifier.js +187 -0
  40. package/dist/client/services/message-formatter.d.ts +84 -0
  41. package/dist/client/services/message-formatter.js +353 -0
  42. package/dist/client/services/session-logger.d.ts +106 -0
  43. package/dist/client/services/session-logger.js +446 -0
  44. package/dist/client/services/tool-executor.d.ts +41 -0
  45. package/dist/client/services/tool-executor.js +169 -0
  46. package/dist/client/services/workspace-schema-cache.d.ts +149 -0
  47. package/dist/client/services/workspace-schema-cache.js +732 -0
  48. package/dist/client/specialist-daemon.d.ts +77 -0
  49. package/dist/client/specialist-daemon.js +197 -0
  50. package/dist/client/specialists.d.ts +53 -0
  51. package/dist/client/specialists.js +178 -0
  52. package/dist/client/tool-schema-loader.d.ts +4 -3
  53. package/dist/client/tool-schema-loader.js +54 -8
  54. package/dist/client/types.d.ts +283 -55
  55. package/dist/client/types.js +113 -2
  56. package/dist/config.d.ts +1 -1
  57. package/dist/config.js +1 -1
  58. package/dist/core.d.ts +10 -2
  59. package/dist/core.js +43 -27
  60. package/dist/lib/logger.js +15 -3
  61. package/dist/mcp/UserContextCache.js +2 -2
  62. package/dist/mcp/hailer-clients.js +5 -5
  63. package/dist/mcp/signal-handler.js +27 -5
  64. package/dist/mcp/tools/activity.js +137 -65
  65. package/dist/mcp/tools/app-core.js +4 -140
  66. package/dist/mcp/tools/app-marketplace.js +15 -260
  67. package/dist/mcp/tools/app-member.js +2 -73
  68. package/dist/mcp/tools/app-scaffold.js +146 -87
  69. package/dist/mcp/tools/discussion.js +348 -73
  70. package/dist/mcp/tools/insight.js +74 -190
  71. package/dist/mcp/tools/workflow.js +20 -94
  72. package/dist/mcp/utils/hailer-api-client.d.ts +4 -2
  73. package/dist/mcp/utils/hailer-api-client.js +24 -10
  74. package/dist/mcp-server.d.ts +4 -0
  75. package/dist/mcp-server.js +24 -4
  76. package/dist/routes/agents.d.ts +44 -0
  77. package/dist/routes/agents.js +311 -0
  78. package/dist/services/agent-credential-store.d.ts +73 -0
  79. package/dist/services/agent-credential-store.js +212 -0
  80. package/lineup-manager/dist/assets/index-8ce6041d.css +1 -0
  81. package/lineup-manager/dist/assets/index-e168f265.js +600 -0
  82. package/lineup-manager/dist/index.html +15 -0
  83. package/lineup-manager/dist/manifest.json +17 -0
  84. package/lineup-manager/dist/vite.svg +1 -0
  85. package/package.json +1 -1
  86. package/dist/client/adaptive-documentation-bot.d.ts +0 -106
  87. package/dist/client/adaptive-documentation-bot.js +0 -464
  88. package/dist/client/adaptive-documentation-types.d.ts +0 -66
  89. package/dist/client/adaptive-documentation-types.js +0 -9
  90. package/dist/client/agent-activity-bot.d.ts +0 -51
  91. package/dist/client/agent-activity-bot.js +0 -166
  92. package/dist/client/agent-tracker.d.ts +0 -499
  93. package/dist/client/agent-tracker.js +0 -659
  94. package/dist/client/description-updater.d.ts +0 -56
  95. package/dist/client/description-updater.js +0 -259
  96. package/dist/client/log-parser.d.ts +0 -72
  97. package/dist/client/log-parser.js +0 -387
  98. package/dist/client/mcp-assistant.d.ts +0 -21
  99. package/dist/client/mcp-assistant.js +0 -58
  100. package/dist/client/mcp-client.d.ts +0 -50
  101. package/dist/client/mcp-client.js +0 -538
  102. package/dist/client/message-processor.d.ts +0 -35
  103. package/dist/client/message-processor.js +0 -357
  104. package/dist/client/providers/anthropic-provider.d.ts +0 -19
  105. package/dist/client/providers/anthropic-provider.js +0 -645
  106. package/dist/client/providers/assistant-provider.d.ts +0 -17
  107. package/dist/client/providers/assistant-provider.js +0 -51
  108. package/dist/client/providers/llm-provider.d.ts +0 -47
  109. package/dist/client/providers/llm-provider.js +0 -367
  110. package/dist/client/providers/openai-provider.d.ts +0 -23
  111. package/dist/client/providers/openai-provider.js +0 -630
  112. package/dist/client/simple-llm-caller.d.ts +0 -19
  113. package/dist/client/simple-llm-caller.js +0 -100
  114. package/dist/client/skill-generator.d.ts +0 -81
  115. package/dist/client/skill-generator.js +0 -386
  116. package/dist/client/test-adaptive-bot.d.ts +0 -9
  117. package/dist/client/test-adaptive-bot.js +0 -82
  118. package/dist/client/token-pricing.d.ts +0 -38
  119. package/dist/client/token-pricing.js +0 -127
  120. package/dist/client/token-tracker.d.ts +0 -232
  121. package/dist/client/token-tracker.js +0 -457
  122. package/dist/client/token-usage-bot.d.ts +0 -53
  123. package/dist/client/token-usage-bot.js +0 -153
  124. package/dist/client/tool-executor.d.ts +0 -69
  125. package/dist/client/tool-executor.js +0 -159
  126. package/dist/lib/materialize.d.ts +0 -3
  127. package/dist/lib/materialize.js +0 -101
  128. package/dist/lib/normalizedName.d.ts +0 -7
  129. package/dist/lib/normalizedName.js +0 -48
  130. package/dist/lib/terminal-prompt.d.ts +0 -9
  131. package/dist/lib/terminal-prompt.js +0 -108
  132. package/dist/mcp/tools/skill.d.ts +0 -10
  133. package/dist/mcp/tools/skill.js +0 -279
  134. package/dist/mcp/tools/workflow-template.d.ts +0 -19
  135. package/dist/mcp/tools/workflow-template.js +0 -822
@@ -0,0 +1,464 @@
1
+ /**
2
+ * Chat Agent Daemon
3
+ *
4
+ * A persistent LLM conversation that monitors all workspace chats.
5
+ * The LLM maintains context across messages and decides what to respond to.
6
+ *
7
+ * Architecture:
8
+ * - One daemon per bot client
9
+ * - Subscribes to ALL messenger.new signals (not filtered)
10
+ * - LLM sees every message with priority markers
11
+ * - LLM decides: RESPOND / IGNORE / ACTION
12
+ */
13
+ import Anthropic from "@anthropic-ai/sdk";
14
+ import { BotClient } from "./bot-manager";
15
+ import { HailerSignal } from "../mcp/signal-handler";
16
+ import { Logger } from "../lib/logger";
17
+ import { ToolSchemaLoader } from "./tool-schema-loader";
18
+ /** Agent Directory workflow - registry of all bot agents */
19
+ export declare const AGENT_DIRECTORY: {
20
+ readonly workflowId: "694a35b5b8b5c5f8030788e3";
21
+ readonly phases: {
22
+ readonly agentBuilder: "694a35b5b8b5c5f8030788f7";
23
+ readonly deployed: "694a35b5b8b5c5f8030788fb";
24
+ readonly retired: "694a35b5b8b5c5f8030788fc";
25
+ };
26
+ readonly fields: {
27
+ readonly firstName: "694a35b5b8b5c5f8030788ea";
28
+ readonly lastName: "694a35b5b8b5c5f8030788eb";
29
+ readonly description: "694a35b5b8b5c5f8030788f6";
30
+ readonly hailerProfile: "694a35b5b8b5c5f8030788f2";
31
+ readonly email: "694a35b5b8b5c5f8030788f3";
32
+ readonly password: "694a35b5b8b5c5f8030788f4";
33
+ readonly team: "694a35b5b8b5c5f8030788e7";
34
+ readonly supervisor: "694a35b5b8b5c5f8030788e8";
35
+ readonly memory: "694a35b5b8b5c5f8030788f5";
36
+ readonly position: "694a35b5b8b5c5f8030788e5";
37
+ readonly startDate: "694a35b5b8b5c5f8030788ec";
38
+ };
39
+ };
40
+ /** Session Log workflow - tracks agent actions */
41
+ export declare const SESSION_LOG: {
42
+ readonly workflowId: "694a35b5b8b5c5f803078915";
43
+ readonly phases: {
44
+ readonly active: "694a35b5b8b5c5f803078941";
45
+ readonly archive: "694a35b5b8b5c5f803078942";
46
+ };
47
+ readonly fields: {
48
+ readonly contextSummary: "694a35b5b8b5c5f80307893c";
49
+ readonly previousLog: "694a35b5b8b5c5f80307893d";
50
+ readonly linkedWork: "694a35b5b8b5c5f80307893e";
51
+ readonly cost: "694a35b5b8b5c5f80307893f";
52
+ readonly madeBy: "694a35b5b8b5c5f803078940";
53
+ };
54
+ };
55
+ /** Positions workflow - job descriptions/roles for agents */
56
+ export declare const POSITIONS: {
57
+ readonly workflowId: "694a35b5b8b5c5f8030788e4";
58
+ readonly phases: {
59
+ readonly active: "694a35b5b8b5c5f80307890f";
60
+ };
61
+ readonly fields: {
62
+ readonly purpose: "694a35b5b8b5c5f803078901";
63
+ readonly personaTone: "694a35b5b8b5c5f803078903";
64
+ readonly coreCapabilities: "694a35b5b8b5c5f803078904";
65
+ readonly contextAwareness: "694a35b5b8b5c5f803078905";
66
+ readonly taskHandling: "694a35b5b8b5c5f803078906";
67
+ readonly infoRetrieval: "694a35b5b8b5c5f803078907";
68
+ readonly boundaries: "694a35b5b8b5c5f803078908";
69
+ readonly userInteraction: "694a35b5b8b5c5f803078909";
70
+ readonly errorHandling: "694a35b5b8b5c5f80307890a";
71
+ readonly learning: "694a35b5b8b5c5f80307890b";
72
+ readonly escalation: "694a35b5b8b5c5f80307890c";
73
+ readonly auditLogging: "694a35b5b8b5c5f80307890d";
74
+ readonly agentCount: "694a35b5b8b5c5f803078902";
75
+ readonly multiAllowed: "694a35b5b8b5c5f80307890e";
76
+ };
77
+ };
78
+ /** Teams workflow - groups of agents */
79
+ export declare const TEAMS: {
80
+ readonly workflowId: "694a35b5b8b5c5f8030788e6";
81
+ readonly phases: {
82
+ readonly active: "694a35b5b8b5c5f80307891a";
83
+ };
84
+ readonly fields: {
85
+ readonly info: "694a35b5b8b5c5f803078919";
86
+ readonly leader: "694a35b5b8b5c5f8030788e9";
87
+ };
88
+ };
89
+ /** Tool Registry workflow - MCP server configurations */
90
+ export declare const TOOL_REGISTRY: {
91
+ readonly workflowId: "694a35b5b8b5c5f803078922";
92
+ readonly phases: {
93
+ readonly active: "694a35b5b8b5c5f803078927";
94
+ };
95
+ readonly fields: {
96
+ readonly baseUrl: "694a35b5b8b5c5f803078923";
97
+ readonly protocolVersion: "694a35b5b8b5c5f803078924";
98
+ readonly toolRegistry: "694a35b5b8b5c5f803078925";
99
+ readonly logEntryBy: "694a35b5b8b5c5f803078926";
100
+ };
101
+ };
102
+ /** MCP Config workflow - per-agent MCP configuration */
103
+ export declare const MCP_CONFIG: {
104
+ readonly workflowId: "694a35b5b8b5c5f803078928";
105
+ readonly phases: {
106
+ readonly active: "694a35b5b8b5c5f80307893b";
107
+ };
108
+ readonly fields: {
109
+ readonly agentName: "694a35b5b8b5c5f803078929";
110
+ readonly agentId: "694a35b5b8b5c5f80307892a";
111
+ readonly publicKey: "694a35b5b8b5c5f80307892c";
112
+ readonly accessTo: "694a35b5b8b5c5f80307892b";
113
+ readonly authToken: "694a35b5b8b5c5f80307892d";
114
+ readonly apiKey: "694a35b5b8b5c5f80307892e";
115
+ readonly workspaceId: "694a35b5b8b5c5f803078934";
116
+ readonly permissions: "694a35b5b8b5c5f803078935";
117
+ readonly sessionId: "694a35b5b8b5c5f803078936";
118
+ readonly resourceLimits: "694a35b5b8b5c5f803078937";
119
+ readonly loggingEndpoint: "694a35b5b8b5c5f803078938";
120
+ readonly callbackUrl: "694a35b5b8b5c5f803078939";
121
+ readonly customContext: "694a35b5b8b5c5f80307893a";
122
+ readonly permCreate: "694a35b5b8b5c5f803078930";
123
+ readonly permRead: "694a35b5b8b5c5f803078931";
124
+ readonly permUpdate: "694a35b5b8b5c5f803078932";
125
+ readonly permDelete: "694a35b5b8b5c5f803078933";
126
+ };
127
+ };
128
+ /** Session usage metrics */
129
+ export interface SessionMetrics {
130
+ inputTokens: number;
131
+ outputTokens: number;
132
+ toolCalls: number;
133
+ messagesProcessed: number;
134
+ responsesPosted: number;
135
+ }
136
+ /** Per-activity session tracking */
137
+ export interface ActivitySession {
138
+ activityId: string;
139
+ activityName: string;
140
+ discussionId: string;
141
+ startTime: number;
142
+ lastActivityTime: number;
143
+ metrics: SessionMetrics;
144
+ actions: string[];
145
+ previousLogId: string | null;
146
+ /** Compact conversation log: "User: ...", "Bot: ..." */
147
+ conversation: string[];
148
+ }
149
+ export type MessagePriority = "high" | "normal" | "low";
150
+ export interface IncomingMessage {
151
+ id: string;
152
+ discussionId: string;
153
+ discussionName?: string;
154
+ linkedActivityId?: string;
155
+ linkedActivityName?: string;
156
+ senderId: string;
157
+ senderName: string;
158
+ content: string;
159
+ timestamp: number;
160
+ priority: MessagePriority;
161
+ priorityReason: string;
162
+ isReplyToBot: boolean;
163
+ isMention: boolean;
164
+ isDirectMessage: boolean;
165
+ }
166
+ export type LlmDecision = {
167
+ action: "respond";
168
+ discussionId: string;
169
+ content: string;
170
+ } | {
171
+ action: "ignore";
172
+ reason: string;
173
+ } | {
174
+ action: "tool_call";
175
+ toolName: string;
176
+ args: any;
177
+ } | {
178
+ action: "thinking";
179
+ content: string;
180
+ };
181
+ interface ConversationMessage {
182
+ role: "user" | "assistant";
183
+ content: string | any[];
184
+ }
185
+ export interface ChatAgentDaemonConfig {
186
+ botClient: BotClient;
187
+ mcpServerUrl: string;
188
+ anthropicApiKey: string;
189
+ model?: string;
190
+ maxContextMessages?: number;
191
+ }
192
+ export declare class ChatAgentDaemon {
193
+ protected logger: Logger;
194
+ protected client: Anthropic;
195
+ protected botClient: BotClient;
196
+ protected config: ChatAgentDaemonConfig;
197
+ protected toolSchemaLoader: ToolSchemaLoader;
198
+ protected conversationMessages: ConversationMessage[];
199
+ protected isProcessing: boolean;
200
+ protected messageQueue: IncomingMessage[];
201
+ protected processedMessageIds: Set<string>;
202
+ protected toolIndex: any[];
203
+ protected minimalTools: any[];
204
+ protected loadedToolSchemas: Map<string, any>;
205
+ /** This agent's activity ID in the Agent Directory */
206
+ protected agentDirectoryId: string | null;
207
+ /** This agent's Position activity ID */
208
+ protected positionId: string | null;
209
+ /** Shared Team activity ID for AI agents */
210
+ protected teamId: string | null;
211
+ /** MCP Server Tool Registry activity ID (shared) */
212
+ protected toolRegistryId: string | null;
213
+ /** This agent's MCP Config activity ID */
214
+ protected mcpConfigId: string | null;
215
+ /** Per-activity session tracking (activityId -> session) */
216
+ protected activitySessions: Map<string, ActivitySession>;
217
+ /** Global session log chain ID (for overall continuity) */
218
+ protected lastGlobalLogId: string | null;
219
+ /** Timer for checking idle sessions */
220
+ protected idleCheckTimer: NodeJS.Timeout | null;
221
+ /** Current discussion context for tracking */
222
+ protected currentDiscussionId: string | null;
223
+ protected currentLinkedActivityId: string | null;
224
+ constructor(config: ChatAgentDaemonConfig);
225
+ /**
226
+ * Initialize the daemon - load tools and subscribe to signals
227
+ */
228
+ initialize(): Promise<void>;
229
+ /**
230
+ * Handle incoming signal from Hailer
231
+ */
232
+ private handleSignal;
233
+ /**
234
+ * Extract and classify incoming message from signal
235
+ * Override in subclasses to customize message filtering
236
+ */
237
+ protected extractIncomingMessage(signal: HailerSignal): Promise<IncomingMessage | null>;
238
+ /**
239
+ * Check if message mentions this bot
240
+ */
241
+ private checkMention;
242
+ /**
243
+ * Check if message is a reply to one of our messages
244
+ */
245
+ private checkReplyToBot;
246
+ /**
247
+ * Check if this is a 1:1 DM with the bot
248
+ */
249
+ private checkDirectMessage;
250
+ /**
251
+ * Get user's display name from workspace cache
252
+ */
253
+ private getUserDisplayName;
254
+ /**
255
+ * Format a Hailer tag for mentioning a user or activity
256
+ * Hailer requires ZWNBSP (U+FEFF) around the tag
257
+ */
258
+ private formatHailerTag;
259
+ /**
260
+ * Extract link metadata from hailerTag formatted content
261
+ * Returns array of links for the messenger.send API
262
+ */
263
+ private extractTagLinks;
264
+ /**
265
+ * Look up user by ID and create a Hailer tag
266
+ */
267
+ private createUserTagById;
268
+ /**
269
+ * Look up user by name and create a Hailer tag
270
+ */
271
+ private createUserTagByName;
272
+ /**
273
+ * Convert @mentions and #activity tags in response to Hailer tags
274
+ * Supports:
275
+ * - @userId (24-char hex MongoDB ID) → user tag
276
+ * - @"Full Name" (quoted name lookup) → user tag
277
+ * - @FirstName (single word name lookup) → user tag
278
+ * - #activityId (24-char hex) → activity tag
279
+ * - #"Activity Name" (quoted) → activity tag (requires lookup)
280
+ */
281
+ private convertMentionsToTags;
282
+ /**
283
+ * Resolve user tags - look up names for IDs via API when not in cache
284
+ * Handles @userId (24-char hex) format
285
+ */
286
+ private resolveUserTags;
287
+ /**
288
+ * Resolve activity tags - look up names for IDs and IDs for names
289
+ * Handles both #activityId and #"Activity Name" formats
290
+ */
291
+ private resolveActivityTags;
292
+ /**
293
+ * Process queued messages through the LLM
294
+ */
295
+ private processQueue;
296
+ /**
297
+ * Process a single message through the persistent LLM conversation
298
+ */
299
+ private processMessage;
300
+ /**
301
+ * Format incoming message for LLM consumption
302
+ */
303
+ private formatIncomingMessage;
304
+ /**
305
+ * Execute tool calls and continue the conversation
306
+ * Simple passthrough - just execute tools and return results to LLM
307
+ */
308
+ protected executeToolsAndContinue(toolUseBlocks: Anthropic.ToolUseBlock[], originalMessage: IncomingMessage): Promise<void>;
309
+ /**
310
+ * Handle LLM response
311
+ * Override in subclasses to customize response handling
312
+ */
313
+ protected handleLlmResponse(response: Anthropic.Message, originalMessage: IncomingMessage): Promise<void>;
314
+ /**
315
+ * Post a response to a discussion
316
+ * Automatically converts @mentions and #activity tags to Hailer tags
317
+ * Includes links metadata required for tags to work
318
+ */
319
+ protected postResponse(discussionId: string, content: string): Promise<void>;
320
+ /**
321
+ * Manage conversation context size - summarize if too large
322
+ */
323
+ private manageContextSize;
324
+ /**
325
+ * Get the system prompt for the daemon
326
+ * MUST be overridden in subclasses
327
+ */
328
+ protected getSystemPrompt(): string;
329
+ /**
330
+ * Fetch tool schema from MCP server
331
+ */
332
+ private fetchToolSchema;
333
+ /**
334
+ * Call MCP tool
335
+ */
336
+ protected callMcpTool(name: string, args: any): Promise<any>;
337
+ /**
338
+ * Stop the daemon
339
+ * Flushes all pending activity sessions before stopping
340
+ */
341
+ stop(): Promise<void>;
342
+ /**
343
+ * Get current conversation state (for debugging)
344
+ */
345
+ getConversationState(): {
346
+ messageCount: number;
347
+ queueLength: number;
348
+ lastMessages: Array<{
349
+ role: string;
350
+ preview: string;
351
+ timestamp?: string;
352
+ }>;
353
+ isProcessing: boolean;
354
+ };
355
+ /**
356
+ * Get full conversation for deep debugging
357
+ */
358
+ getFullConversation(): ConversationMessage[];
359
+ /**
360
+ * Get agent's display name (override in subclass for custom names)
361
+ */
362
+ protected getAgentName(): {
363
+ firstName: string;
364
+ lastName: string;
365
+ };
366
+ /**
367
+ * Get agent's description/system prompt (override in subclass)
368
+ */
369
+ protected getAgentDescription(): string;
370
+ /**
371
+ * Get default team ID from workspace cache
372
+ * Returns the first available team, or undefined if no teams exist
373
+ *
374
+ * Teams structure in init is: { teams: { workspaceId: { teamId: teamData, ... } } }
375
+ */
376
+ protected getDefaultTeamId(): string | undefined;
377
+ /**
378
+ * Register this agent in the Agent Directory
379
+ * Called during initialize() - finds existing entry or creates new one
380
+ */
381
+ protected registerAgentInDirectory(): Promise<void>;
382
+ /**
383
+ * Find existing agent entry by email
384
+ */
385
+ private findAgentByEmail;
386
+ /**
387
+ * Update agent's Hailer profile reference
388
+ */
389
+ private updateAgentProfile;
390
+ /**
391
+ * Register all agent data across all workflows
392
+ * Orchestrates: Agent Directory, Position, Team, Tool Registry, MCP Config
393
+ */
394
+ protected registerAllAgentData(): Promise<void>;
395
+ /**
396
+ * Get agent's Position details (override in subclass for custom positions)
397
+ */
398
+ protected getPositionDetails(): {
399
+ name: string;
400
+ purpose: string;
401
+ personaTone: string;
402
+ coreCapabilities: string;
403
+ boundaries: string;
404
+ };
405
+ /**
406
+ * Register/find shared Team for AI agents
407
+ */
408
+ protected registerTeam(): Promise<void>;
409
+ /**
410
+ * Register MCP server in Tool Registry
411
+ */
412
+ protected registerToolRegistry(): Promise<void>;
413
+ /**
414
+ * Register Position for this agent
415
+ */
416
+ protected registerPosition(): Promise<void>;
417
+ /**
418
+ * Register MCP Config for this agent
419
+ */
420
+ protected registerMcpConfig(): Promise<void>;
421
+ /**
422
+ * Link Agent Directory entry to Position and Team
423
+ */
424
+ protected linkAgentToPositionAndTeam(): Promise<void>;
425
+ /**
426
+ * Extract activity ID from MCP tool response text
427
+ */
428
+ private extractActivityId;
429
+ /**
430
+ * Get or create an activity session for tracking
431
+ */
432
+ protected getOrCreateActivitySession(message: IncomingMessage): ActivitySession;
433
+ /**
434
+ * Check for idle sessions and flush them
435
+ * Called periodically by timer
436
+ */
437
+ protected checkAndFlushIdleSessions(): Promise<void>;
438
+ /**
439
+ * Flush a single activity session to the session log
440
+ */
441
+ protected flushActivitySession(key: string, session: ActivitySession): Promise<void>;
442
+ /**
443
+ * Flush all active sessions (called on shutdown)
444
+ */
445
+ protected flushAllSessions(): Promise<void>;
446
+ /**
447
+ * Build summary for an activity session
448
+ */
449
+ private buildActivitySessionSummary;
450
+ /**
451
+ * Generate brief summary from session actions
452
+ */
453
+ private generateBriefSummaryFromActions;
454
+ /**
455
+ * Get all active session metrics (for monitoring)
456
+ */
457
+ getActiveSessions(): Map<string, ActivitySession>;
458
+ /**
459
+ * Get agent directory ID
460
+ */
461
+ getAgentDirectoryId(): string | null;
462
+ }
463
+ export {};
464
+ //# sourceMappingURL=chat-agent-daemon.d.ts.map