@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.
- package/dist/app.js +27 -20
- package/dist/core.d.ts +33 -9
- package/dist/core.js +279 -147
- package/dist/mcp/UserContextCache.js +18 -0
- package/dist/mcp/hailer-clients.d.ts +9 -1
- package/dist/mcp/hailer-clients.js +13 -3
- package/dist/mcp/signal-handler.js +1 -1
- package/dist/mcp/tool-registry.d.ts +3 -1
- package/dist/mcp/tool-registry.js +4 -1
- package/dist/mcp/tools/activity.js +43 -34
- package/dist/mcp/tools/bot-config/constants.d.ts +23 -0
- package/dist/mcp/tools/bot-config/constants.js +94 -0
- package/dist/mcp/tools/{bot-config.d.ts → bot-config/core.d.ts} +6 -6
- package/dist/mcp/tools/{bot-config.js → bot-config/core.js} +15 -15
- package/dist/mcp/tools/bot-config/index.d.ts +10 -0
- package/dist/mcp/tools/bot-config/index.js +59 -0
- package/dist/mcp/tools/bot-config/tools.d.ts +7 -0
- package/dist/mcp/tools/bot-config/tools.js +15 -0
- package/dist/mcp/tools/bot-config/types.d.ts +50 -0
- package/dist/mcp/tools/bot-config/types.js +6 -0
- package/dist/mcp/tools/bug-fixer-tools.d.ts +21 -0
- package/dist/mcp/tools/{giuseppe-tools.js → bug-fixer-tools.js} +61 -61
- package/dist/mcp/tools/user.js +10 -29
- package/dist/mcp/tools/workflow.js +36 -2
- package/dist/mcp/utils/data-transformers.d.ts +0 -8
- package/dist/mcp/utils/data-transformers.js +0 -28
- package/dist/mcp/utils/index.d.ts +4 -1
- package/dist/mcp/utils/index.js +17 -3
- package/dist/mcp/utils/pagination.d.ts +40 -0
- package/dist/mcp/utils/pagination.js +55 -0
- package/dist/mcp/utils/response-builder.d.ts +53 -0
- package/dist/mcp/utils/response-builder.js +110 -0
- package/dist/mcp/utils/tool-helpers.d.ts +0 -8
- package/dist/mcp/utils/tool-helpers.js +0 -24
- package/dist/mcp/utils/types.d.ts +1 -33
- package/dist/mcp-server.d.ts +2 -2
- package/dist/mcp-server.js +161 -139
- package/package.json +1 -1
- package/REFACTOR_STATUS.md +0 -127
- package/dist/agents/bot-manager.d.ts +0 -48
- package/dist/agents/bot-manager.js +0 -254
- package/dist/agents/factory.d.ts +0 -150
- package/dist/agents/factory.js +0 -650
- package/dist/agents/giuseppe/ai.d.ts +0 -83
- package/dist/agents/giuseppe/ai.js +0 -466
- package/dist/agents/giuseppe/bot.d.ts +0 -110
- package/dist/agents/giuseppe/bot.js +0 -780
- package/dist/agents/giuseppe/config.d.ts +0 -25
- package/dist/agents/giuseppe/config.js +0 -227
- package/dist/agents/giuseppe/files.d.ts +0 -52
- package/dist/agents/giuseppe/files.js +0 -338
- package/dist/agents/giuseppe/git.d.ts +0 -48
- package/dist/agents/giuseppe/git.js +0 -298
- package/dist/agents/giuseppe/index.d.ts +0 -97
- package/dist/agents/giuseppe/index.js +0 -258
- package/dist/agents/giuseppe/lsp.d.ts +0 -113
- package/dist/agents/giuseppe/lsp.js +0 -485
- package/dist/agents/giuseppe/monitor.d.ts +0 -118
- package/dist/agents/giuseppe/monitor.js +0 -621
- package/dist/agents/giuseppe/prompt.d.ts +0 -5
- package/dist/agents/giuseppe/prompt.js +0 -94
- package/dist/agents/giuseppe/registries/pending-classification.d.ts +0 -28
- package/dist/agents/giuseppe/registries/pending-classification.js +0 -50
- package/dist/agents/giuseppe/registries/pending-fix.d.ts +0 -30
- package/dist/agents/giuseppe/registries/pending-fix.js +0 -42
- package/dist/agents/giuseppe/registries/pending.d.ts +0 -27
- package/dist/agents/giuseppe/registries/pending.js +0 -49
- package/dist/agents/giuseppe/specialist.d.ts +0 -47
- package/dist/agents/giuseppe/specialist.js +0 -237
- package/dist/agents/giuseppe/types.d.ts +0 -123
- package/dist/agents/giuseppe/types.js +0 -9
- package/dist/agents/hailer-expert/index.d.ts +0 -8
- package/dist/agents/hailer-expert/index.js +0 -14
- package/dist/agents/hal/daemon.d.ts +0 -142
- package/dist/agents/hal/daemon.js +0 -1103
- package/dist/agents/hal/definitions.d.ts +0 -55
- package/dist/agents/hal/definitions.js +0 -263
- package/dist/agents/hal/index.d.ts +0 -3
- package/dist/agents/hal/index.js +0 -8
- package/dist/agents/index.d.ts +0 -18
- package/dist/agents/index.js +0 -48
- package/dist/agents/shared/base.d.ts +0 -216
- package/dist/agents/shared/base.js +0 -846
- package/dist/agents/shared/services/agent-registry.d.ts +0 -107
- package/dist/agents/shared/services/agent-registry.js +0 -629
- package/dist/agents/shared/services/conversation-manager.d.ts +0 -50
- package/dist/agents/shared/services/conversation-manager.js +0 -136
- package/dist/agents/shared/services/mcp-client.d.ts +0 -56
- package/dist/agents/shared/services/mcp-client.js +0 -124
- package/dist/agents/shared/services/message-classifier.d.ts +0 -37
- package/dist/agents/shared/services/message-classifier.js +0 -187
- package/dist/agents/shared/services/message-formatter.d.ts +0 -89
- package/dist/agents/shared/services/message-formatter.js +0 -371
- package/dist/agents/shared/services/session-logger.d.ts +0 -106
- package/dist/agents/shared/services/session-logger.js +0 -446
- package/dist/agents/shared/services/tool-executor.d.ts +0 -41
- package/dist/agents/shared/services/tool-executor.js +0 -169
- package/dist/agents/shared/services/workspace-schema-cache.d.ts +0 -125
- package/dist/agents/shared/services/workspace-schema-cache.js +0 -578
- package/dist/agents/shared/specialist.d.ts +0 -91
- package/dist/agents/shared/specialist.js +0 -399
- package/dist/agents/shared/tool-schema-loader.d.ts +0 -62
- package/dist/agents/shared/tool-schema-loader.js +0 -232
- package/dist/agents/shared/types.d.ts +0 -327
- package/dist/agents/shared/types.js +0 -121
- package/dist/client/agents/base.d.ts +0 -207
- package/dist/client/agents/base.js +0 -744
- package/dist/client/agents/definitions.d.ts +0 -53
- package/dist/client/agents/definitions.js +0 -263
- package/dist/client/agents/orchestrator.d.ts +0 -141
- package/dist/client/agents/orchestrator.js +0 -1062
- package/dist/client/agents/specialist.d.ts +0 -86
- package/dist/client/agents/specialist.js +0 -340
- package/dist/client/bot-entrypoint.d.ts +0 -7
- package/dist/client/bot-entrypoint.js +0 -103
- package/dist/client/bot-manager.d.ts +0 -44
- package/dist/client/bot-manager.js +0 -173
- package/dist/client/bot-runner.d.ts +0 -35
- package/dist/client/bot-runner.js +0 -188
- package/dist/client/chat-agent-daemon.d.ts +0 -464
- package/dist/client/chat-agent-daemon.js +0 -1774
- package/dist/client/daemon-factory.d.ts +0 -106
- package/dist/client/daemon-factory.js +0 -301
- package/dist/client/factory.d.ts +0 -111
- package/dist/client/factory.js +0 -314
- package/dist/client/index.d.ts +0 -17
- package/dist/client/index.js +0 -38
- package/dist/client/multi-bot-manager.d.ts +0 -42
- package/dist/client/multi-bot-manager.js +0 -161
- package/dist/client/orchestrator-daemon.d.ts +0 -87
- package/dist/client/orchestrator-daemon.js +0 -444
- package/dist/client/server.d.ts +0 -8
- package/dist/client/server.js +0 -251
- package/dist/client/services/agent-registry.d.ts +0 -108
- package/dist/client/services/agent-registry.js +0 -630
- package/dist/client/services/conversation-manager.d.ts +0 -50
- package/dist/client/services/conversation-manager.js +0 -136
- package/dist/client/services/mcp-client.d.ts +0 -48
- package/dist/client/services/mcp-client.js +0 -105
- package/dist/client/services/message-classifier.d.ts +0 -37
- package/dist/client/services/message-classifier.js +0 -187
- package/dist/client/services/message-formatter.d.ts +0 -84
- package/dist/client/services/message-formatter.js +0 -353
- package/dist/client/services/session-logger.d.ts +0 -106
- package/dist/client/services/session-logger.js +0 -446
- package/dist/client/services/tool-executor.d.ts +0 -41
- package/dist/client/services/tool-executor.js +0 -169
- package/dist/client/services/workspace-schema-cache.d.ts +0 -149
- package/dist/client/services/workspace-schema-cache.js +0 -732
- package/dist/client/specialist-daemon.d.ts +0 -77
- package/dist/client/specialist-daemon.js +0 -197
- package/dist/client/specialists.d.ts +0 -53
- package/dist/client/specialists.js +0 -178
- package/dist/client/tool-schema-loader.d.ts +0 -62
- package/dist/client/tool-schema-loader.js +0 -232
- package/dist/client/types.d.ts +0 -327
- package/dist/client/types.js +0 -121
- package/dist/commands/seed-config.d.ts +0 -9
- package/dist/commands/seed-config.js +0 -372
- package/dist/lib/context-manager.d.ts +0 -111
- package/dist/lib/context-manager.js +0 -431
- package/dist/lib/prompt-length-manager.d.ts +0 -81
- package/dist/lib/prompt-length-manager.js +0 -457
- package/dist/mcp/tools/giuseppe-tools.d.ts +0 -21
- package/dist/modules/bug-reports/bug-config.d.ts +0 -25
- package/dist/modules/bug-reports/bug-config.js +0 -187
- package/dist/modules/bug-reports/bug-monitor.d.ts +0 -108
- package/dist/modules/bug-reports/bug-monitor.js +0 -510
- package/dist/modules/bug-reports/giuseppe-agent.d.ts +0 -58
- package/dist/modules/bug-reports/giuseppe-agent.js +0 -467
- package/dist/modules/bug-reports/giuseppe-ai.d.ts +0 -83
- package/dist/modules/bug-reports/giuseppe-ai.js +0 -466
- package/dist/modules/bug-reports/giuseppe-bot.d.ts +0 -110
- package/dist/modules/bug-reports/giuseppe-bot.js +0 -804
- package/dist/modules/bug-reports/giuseppe-daemon.d.ts +0 -80
- package/dist/modules/bug-reports/giuseppe-daemon.js +0 -617
- package/dist/modules/bug-reports/giuseppe-files.d.ts +0 -64
- package/dist/modules/bug-reports/giuseppe-files.js +0 -375
- package/dist/modules/bug-reports/giuseppe-git.d.ts +0 -48
- package/dist/modules/bug-reports/giuseppe-git.js +0 -298
- package/dist/modules/bug-reports/giuseppe-lsp.d.ts +0 -113
- package/dist/modules/bug-reports/giuseppe-lsp.js +0 -485
- package/dist/modules/bug-reports/giuseppe-prompt.d.ts +0 -5
- package/dist/modules/bug-reports/giuseppe-prompt.js +0 -94
- package/dist/modules/bug-reports/index.d.ts +0 -77
- package/dist/modules/bug-reports/index.js +0 -215
- package/dist/modules/bug-reports/pending-classification-registry.d.ts +0 -28
- package/dist/modules/bug-reports/pending-classification-registry.js +0 -50
- package/dist/modules/bug-reports/pending-fix-registry.d.ts +0 -30
- package/dist/modules/bug-reports/pending-fix-registry.js +0 -42
- package/dist/modules/bug-reports/pending-registry.d.ts +0 -27
- package/dist/modules/bug-reports/pending-registry.js +0 -49
- package/dist/modules/bug-reports/types.d.ts +0 -123
- package/dist/modules/bug-reports/types.js +0 -9
- package/dist/routes/agents.d.ts +0 -44
- package/dist/routes/agents.js +0 -311
- package/dist/services/agent-credential-store.d.ts +0 -73
- package/dist/services/agent-credential-store.js +0 -212
- package/dist/services/bug-monitor.d.ts +0 -23
- package/dist/services/bug-monitor.js +0 -275
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workspace Schema Cache Service
|
|
3
|
-
*
|
|
4
|
-
* Dynamically discovers and caches workflow schemas per workspace.
|
|
5
|
-
* Replaces hardcoded workflow/field IDs with runtime lookup.
|
|
6
|
-
*
|
|
7
|
-
* WORKSPACE ISOLATION: Each workspace gets its own workflow IDs.
|
|
8
|
-
* Never use hardcoded IDs - always lookup via this cache.
|
|
9
|
-
*
|
|
10
|
-
* CACHING STRATEGY:
|
|
11
|
-
* 1. Check file cache first (~/.hailer-mcp/schema-cache-{workspaceId}.json)
|
|
12
|
-
* 2. If valid cache exists, load from file (0 API calls)
|
|
13
|
-
* 3. If no cache, discover via API and save to file
|
|
14
|
-
* 4. Cache is valid for 7 days (configurable)
|
|
15
|
-
*
|
|
16
|
-
* On bot startup:
|
|
17
|
-
* 1. Check file cache
|
|
18
|
-
* 2. If cache miss: Query list_workflows to find AI Agent workflows by name
|
|
19
|
-
* 3. If missing, install them from marketplace
|
|
20
|
-
* 4. Query get_workflow_schema to get field IDs
|
|
21
|
-
* 5. Save to file cache
|
|
22
|
-
*/
|
|
23
|
-
import { Logger } from "../../lib/logger";
|
|
24
|
-
import { McpToolCallback } from "../types";
|
|
25
|
-
/** Cached workflow schema */
|
|
26
|
-
export interface WorkflowSchema {
|
|
27
|
-
workflowId: string;
|
|
28
|
-
name: string;
|
|
29
|
-
phases: Record<string, string>;
|
|
30
|
-
fields: Record<string, string>;
|
|
31
|
-
}
|
|
32
|
-
/** Per-workspace cache */
|
|
33
|
-
export interface WorkspaceSchemas {
|
|
34
|
-
workspaceId: string;
|
|
35
|
-
sessionLog?: WorkflowSchema;
|
|
36
|
-
agentDirectory?: WorkflowSchema;
|
|
37
|
-
positions?: WorkflowSchema;
|
|
38
|
-
teams?: WorkflowSchema;
|
|
39
|
-
toolRegistry?: WorkflowSchema;
|
|
40
|
-
mcpConfig?: WorkflowSchema;
|
|
41
|
-
initialized: boolean;
|
|
42
|
-
cachedAt?: number;
|
|
43
|
-
}
|
|
44
|
-
export declare class WorkspaceSchemaCacheService {
|
|
45
|
-
private logger;
|
|
46
|
-
private callMcpTool;
|
|
47
|
-
private cache;
|
|
48
|
-
constructor(logger: Logger, callMcpTool: McpToolCallback);
|
|
49
|
-
/**
|
|
50
|
-
* Ensure cache directory exists
|
|
51
|
-
*/
|
|
52
|
-
private ensureCacheDir;
|
|
53
|
-
/**
|
|
54
|
-
* Get cache file path for a workspace
|
|
55
|
-
*/
|
|
56
|
-
private getCacheFilePath;
|
|
57
|
-
/**
|
|
58
|
-
* Load schemas from file cache
|
|
59
|
-
* Returns null if cache doesn't exist or is expired
|
|
60
|
-
*/
|
|
61
|
-
private loadFromFileCache;
|
|
62
|
-
/**
|
|
63
|
-
* Save schemas to file cache
|
|
64
|
-
*/
|
|
65
|
-
private saveToFileCache;
|
|
66
|
-
/**
|
|
67
|
-
* Initialize schema cache for a workspace
|
|
68
|
-
* Call this on bot startup after connecting to Hailer
|
|
69
|
-
*/
|
|
70
|
-
initializeForWorkspace(workspaceId: string): Promise<WorkspaceSchemas>;
|
|
71
|
-
/**
|
|
72
|
-
* Get cached schemas for a workspace
|
|
73
|
-
*/
|
|
74
|
-
getSchemas(workspaceId: string): WorkspaceSchemas | undefined;
|
|
75
|
-
/**
|
|
76
|
-
* Get Session Log schema for a workspace
|
|
77
|
-
*/
|
|
78
|
-
getSessionLogSchema(workspaceId: string): WorkflowSchema | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Get Agent Directory schema for a workspace
|
|
81
|
-
*/
|
|
82
|
-
getAgentDirectorySchema(workspaceId: string): WorkflowSchema | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* Get Positions schema for a workspace
|
|
85
|
-
*/
|
|
86
|
-
getPositionsSchema(workspaceId: string): WorkflowSchema | undefined;
|
|
87
|
-
/**
|
|
88
|
-
* Get Teams schema for a workspace
|
|
89
|
-
*/
|
|
90
|
-
getTeamsSchema(workspaceId: string): WorkflowSchema | undefined;
|
|
91
|
-
/**
|
|
92
|
-
* Get Tool Registry schema for a workspace
|
|
93
|
-
*/
|
|
94
|
-
getToolRegistrySchema(workspaceId: string): WorkflowSchema | undefined;
|
|
95
|
-
/**
|
|
96
|
-
* Get MCP Config schema for a workspace
|
|
97
|
-
*/
|
|
98
|
-
getMcpConfigSchema(workspaceId: string): WorkflowSchema | undefined;
|
|
99
|
-
/**
|
|
100
|
-
* Check if a workspace has the AI Agent template installed
|
|
101
|
-
*/
|
|
102
|
-
hasAgentTemplate(workspaceId: string): boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Check if workflow name matches a pattern (case insensitive, ignores emojis)
|
|
105
|
-
*/
|
|
106
|
-
private matchesPattern;
|
|
107
|
-
/**
|
|
108
|
-
* Map workflow list to schema slots (using pattern matching)
|
|
109
|
-
*/
|
|
110
|
-
private mapWorkflowsToSchemas;
|
|
111
|
-
/**
|
|
112
|
-
* Load detailed schemas (phases, fields) for all found workflows
|
|
113
|
-
*/
|
|
114
|
-
private loadDetailedSchemas;
|
|
115
|
-
/**
|
|
116
|
-
* Install AI Agent template from marketplace
|
|
117
|
-
*/
|
|
118
|
-
private installAgentTemplate;
|
|
119
|
-
/**
|
|
120
|
-
* Parse workflows from list_workflows response
|
|
121
|
-
* Handles both raw JSON and markdown-wrapped JSON responses
|
|
122
|
-
*/
|
|
123
|
-
private parseWorkflows;
|
|
124
|
-
/**
|
|
125
|
-
* Load detailed workflow schema (phases and fields) for an existing schema
|
|
126
|
-
*/
|
|
127
|
-
private loadWorkflowSchemaDetails;
|
|
128
|
-
/**
|
|
129
|
-
* Parse phases from list_workflow_phases response
|
|
130
|
-
* Format: 1. **PhaseName**\n - Phase ID: `phaseId`
|
|
131
|
-
*/
|
|
132
|
-
private parsePhases;
|
|
133
|
-
/**
|
|
134
|
-
* Parse fields from get_workflow_schema response
|
|
135
|
-
* Stores fields by both label and key for flexible lookup
|
|
136
|
-
*/
|
|
137
|
-
private parseFields;
|
|
138
|
-
/**
|
|
139
|
-
* Map field keys to their IDs in the schema
|
|
140
|
-
* Since parseFields now stores by key directly, this is a no-op
|
|
141
|
-
* Kept for backwards compatibility but does nothing
|
|
142
|
-
*/
|
|
143
|
-
private mapFieldLabelsToIds;
|
|
144
|
-
/**
|
|
145
|
-
* Clear cache for a workspace (clears both memory and file cache)
|
|
146
|
-
*/
|
|
147
|
-
clearCache(workspaceId?: string): void;
|
|
148
|
-
}
|
|
149
|
-
//# sourceMappingURL=workspace-schema-cache.d.ts.map
|