@hailer/mcp 1.0.29 ā 1.1.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/.claude/.session-checked +1 -0
- package/.claude/agents/agent-ada-skill-builder.md +10 -2
- package/.claude/agents/agent-alejandro-function-fields.md +104 -37
- package/.claude/agents/agent-bjorn-config-audit.md +41 -21
- package/.claude/agents/agent-builder-agent-creator.md +13 -3
- package/.claude/agents/agent-code-simplifier.md +53 -0
- package/.claude/agents/agent-dmitri-activity-crud.md +126 -11
- package/.claude/agents/agent-giuseppe-app-builder.md +212 -22
- package/.claude/agents/agent-gunther-mcp-tools.md +7 -36
- package/.claude/agents/agent-helga-workflow-config.md +75 -10
- package/.claude/agents/agent-igor-activity-mover-automation.md +125 -0
- package/.claude/agents/agent-ingrid-doc-templates.md +164 -36
- package/.claude/agents/agent-ivan-monolith.md +154 -0
- package/.claude/agents/agent-kenji-data-reader.md +15 -8
- package/.claude/agents/agent-lars-code-inspector.md +56 -8
- package/.claude/agents/agent-marco-mockup-builder.md +110 -0
- package/.claude/agents/agent-marcus-api-documenter.md +323 -0
- package/.claude/agents/agent-marketplace-publisher.md +232 -72
- package/.claude/agents/agent-marketplace-reviewer.md +255 -79
- package/.claude/agents/agent-permissions-handler.md +208 -0
- package/.claude/agents/agent-simple-writer.md +48 -0
- package/.claude/agents/agent-svetlana-code-review.md +127 -14
- package/.claude/agents/agent-tanya-test-runner.md +333 -0
- package/.claude/agents/agent-ui-designer.md +100 -0
- package/.claude/agents/agent-viktor-sql-insights.md +19 -6
- package/.claude/agents/agent-web-search.md +55 -0
- package/.claude/agents/agent-yevgeni-discussions.md +7 -1
- package/.claude/agents/agent-zara-zapier.md +159 -0
- package/.claude/commands/app-squad.md +135 -0
- package/.claude/commands/audit-squad.md +158 -0
- package/.claude/commands/autoplan.md +563 -0
- package/.claude/commands/cleanup-squad.md +98 -0
- package/.claude/commands/config-squad.md +106 -0
- package/.claude/commands/crud-squad.md +87 -0
- package/.claude/commands/data-squad.md +97 -0
- package/.claude/commands/debug-squad.md +303 -0
- package/.claude/commands/doc-squad.md +65 -0
- package/.claude/commands/handoff.md +137 -0
- package/.claude/commands/health.md +49 -0
- package/.claude/commands/help.md +2 -1
- package/.claude/commands/help:agents.md +96 -16
- package/.claude/commands/help:commands.md +55 -11
- package/.claude/commands/help:faq.md +16 -1
- package/.claude/commands/help:skills.md +93 -0
- package/.claude/commands/hotfix-squad.md +112 -0
- package/.claude/commands/integration-squad.md +82 -0
- package/.claude/commands/janitor-squad.md +167 -0
- package/.claude/commands/learn-auto.md +120 -0
- package/.claude/commands/learn.md +120 -0
- package/.claude/commands/mcp-list.md +27 -0
- package/.claude/commands/onboard-squad.md +140 -0
- package/.claude/commands/plan-workspace.md +732 -0
- package/.claude/commands/prd.md +131 -0
- package/.claude/commands/project-status.md +82 -0
- package/.claude/commands/publish.md +138 -0
- package/.claude/commands/recap.md +69 -0
- package/.claude/commands/restore.md +64 -0
- package/.claude/commands/review-squad.md +152 -0
- package/.claude/commands/save.md +24 -0
- package/.claude/commands/stats.md +19 -0
- package/.claude/commands/swarm.md +210 -0
- package/.claude/commands/tool-builder.md +3 -1
- package/.claude/commands/ws-pull.md +1 -1
- package/.claude/commands/yolo-off.md +17 -0
- package/.claude/commands/yolo.md +82 -0
- package/.claude/hooks/_shared-memory.cjs +305 -0
- package/.claude/hooks/_utils.cjs +134 -0
- package/.claude/hooks/agent-failure-detector.cjs +164 -79
- package/.claude/hooks/agent-usage-logger.cjs +204 -0
- package/.claude/hooks/app-edit-guard.cjs +20 -4
- package/.claude/hooks/auto-learn.cjs +316 -0
- package/.claude/hooks/bash-guard.cjs +282 -0
- package/.claude/hooks/builder-mode-manager.cjs +183 -54
- package/.claude/hooks/bulk-activity-guard.cjs +283 -0
- package/.claude/hooks/context-watchdog.cjs +292 -0
- package/.claude/hooks/delegation-reminder.cjs +478 -0
- package/.claude/hooks/design-system-lint.cjs +283 -0
- package/.claude/hooks/post-scaffold-hook.cjs +16 -3
- package/.claude/hooks/prompt-guard.cjs +366 -0
- package/.claude/hooks/publish-template-guard.cjs +16 -0
- package/.claude/hooks/session-start.cjs +35 -0
- package/.claude/hooks/shared-memory-writer.cjs +147 -0
- package/.claude/hooks/skill-injector.cjs +140 -0
- package/.claude/hooks/skill-usage-logger.cjs +258 -0
- package/.claude/hooks/src-edit-guard.cjs +16 -1
- package/.claude/hooks/sync-marketplace-agents.cjs +53 -8
- package/.claude/scripts/yolo-toggle.cjs +142 -0
- package/.claude/settings.json +141 -14
- package/.claude/skills/SDK-activity-patterns/SKILL.md +428 -0
- package/.claude/skills/SDK-document-templates/SKILL.md +1033 -0
- package/.claude/skills/SDK-function-fields/SKILL.md +542 -0
- package/.claude/skills/SDK-generate-skill/SKILL.md +92 -0
- package/.claude/skills/SDK-init-skill/SKILL.md +127 -0
- package/.claude/skills/SDK-insight-queries/SKILL.md +787 -0
- package/.claude/skills/SDK-ws-config-skill/SKILL.md +1139 -0
- package/.claude/skills/agent-structure/SKILL.md +98 -0
- package/.claude/skills/api-documentation-patterns/SKILL.md +474 -0
- package/.claude/skills/chrome-mcp-reference/SKILL.md +370 -0
- package/.claude/skills/delegation-routing/SKILL.md +202 -0
- package/.claude/skills/frontend-design/SKILL.md +254 -0
- package/.claude/skills/hailer-activity-mover/SKILL.md +213 -0
- package/.claude/skills/hailer-api-client/SKILL.md +518 -0
- package/.claude/skills/hailer-app-builder/SKILL.md +939 -11
- package/.claude/skills/hailer-apps-pictures/SKILL.md +269 -0
- package/.claude/skills/hailer-design-system/SKILL.md +235 -0
- package/.claude/skills/hailer-monolith-automations/SKILL.md +686 -0
- package/.claude/skills/hailer-permissions-system/SKILL.md +121 -0
- package/.claude/skills/hailer-project-protocol/SKILL.md +488 -0
- package/.claude/skills/hailer-rest-api/SKILL.md +61 -0
- package/.claude/skills/hailer-rest-api/hailer-activities.md +184 -0
- package/.claude/skills/hailer-rest-api/hailer-admin.md +473 -0
- package/.claude/skills/hailer-rest-api/hailer-calendar.md +256 -0
- package/.claude/skills/hailer-rest-api/hailer-feed.md +249 -0
- package/.claude/skills/hailer-rest-api/hailer-insights.md +195 -0
- package/.claude/skills/hailer-rest-api/hailer-messaging.md +276 -0
- package/.claude/skills/hailer-rest-api/hailer-workflows.md +283 -0
- package/.claude/skills/insight-join-patterns/SKILL.md +3 -0
- package/.claude/skills/integration-patterns/SKILL.md +421 -0
- package/.claude/skills/json-only-output/SKILL.md +52 -12
- package/.claude/skills/lsp-setup/SKILL.md +160 -0
- package/.claude/skills/mcp-direct-tools/SKILL.md +153 -0
- package/.claude/skills/optional-parameters/SKILL.md +32 -23
- package/.claude/skills/publish-hailer-app/SKILL.md +76 -12
- package/.claude/skills/testing-patterns/SKILL.md +630 -0
- package/.claude/skills/tool-builder/SKILL.md +250 -0
- package/.claude/skills/tool-parameter-usage/SKILL.md +59 -45
- package/.claude/skills/tool-response-verification/SKILL.md +82 -48
- package/.claude/skills/zapier-hailer-patterns/SKILL.md +581 -0
- package/.env.example +26 -7
- package/CLAUDE.md +290 -224
- package/dist/CLAUDE.md +370 -0
- package/dist/app.d.ts +1 -1
- package/dist/app.js +101 -101
- package/dist/bot/bot-config.d.ts +26 -0
- package/dist/bot/bot-config.js +135 -0
- package/dist/bot/bot-manager.d.ts +40 -0
- package/dist/bot/bot-manager.js +137 -0
- package/dist/bot/bot.d.ts +127 -0
- package/dist/bot/bot.js +1328 -0
- package/dist/bot/operation-logger.d.ts +28 -0
- package/dist/bot/operation-logger.js +132 -0
- package/dist/bot/services/conversation-manager.d.ts +60 -0
- package/dist/bot/services/conversation-manager.js +246 -0
- package/dist/bot/services/index.d.ts +9 -0
- package/dist/bot/services/index.js +18 -0
- package/dist/bot/services/message-classifier.d.ts +42 -0
- package/dist/bot/services/message-classifier.js +228 -0
- package/dist/bot/services/message-formatter.d.ts +88 -0
- package/dist/bot/services/message-formatter.js +411 -0
- package/dist/bot/services/session-logger.d.ts +162 -0
- package/dist/bot/services/session-logger.js +724 -0
- package/dist/bot/services/token-billing.d.ts +78 -0
- package/dist/bot/services/token-billing.js +233 -0
- package/dist/bot/services/types.d.ts +169 -0
- package/dist/bot/services/types.js +12 -0
- package/dist/bot/services/typing-indicator.d.ts +23 -0
- package/dist/bot/services/typing-indicator.js +60 -0
- package/dist/bot/services/workspace-schema-cache.d.ts +122 -0
- package/dist/bot/services/workspace-schema-cache.js +506 -0
- package/dist/bot/tool-executor.d.ts +28 -0
- package/dist/bot/tool-executor.js +48 -0
- package/dist/bot/workspace-overview.d.ts +12 -0
- package/dist/bot/workspace-overview.js +94 -0
- package/dist/cli.d.ts +1 -8
- package/dist/cli.js +1 -253
- package/dist/config.d.ts +96 -3
- package/dist/config.js +148 -37
- package/dist/core.d.ts +5 -0
- package/dist/core.js +61 -8
- package/dist/lib/discussion-lock.d.ts +42 -0
- package/dist/lib/discussion-lock.js +110 -0
- package/dist/lib/logger.d.ts +0 -1
- package/dist/lib/logger.js +39 -23
- package/dist/lib/request-logger.d.ts +77 -0
- package/dist/lib/request-logger.js +147 -0
- package/dist/mcp/UserContextCache.js +16 -13
- package/dist/mcp/hailer-clients.js +18 -17
- package/dist/mcp/signal-handler.js +29 -13
- package/dist/mcp/tool-registry.d.ts +4 -15
- package/dist/mcp/tool-registry.js +94 -32
- package/dist/mcp/tools/activity.js +28 -69
- package/dist/mcp/tools/app-core.js +9 -4
- package/dist/mcp/tools/app-marketplace.js +22 -12
- package/dist/mcp/tools/app-member.js +5 -2
- package/dist/mcp/tools/app-scaffold.js +32 -18
- 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/core.d.ts +253 -0
- package/dist/mcp/tools/bot-config/core.js +2456 -0
- 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/discussion.js +107 -77
- package/dist/mcp/tools/document.d.ts +11 -0
- package/dist/mcp/tools/document.js +741 -0
- package/dist/mcp/tools/file.js +5 -2
- package/dist/mcp/tools/insight.js +36 -12
- package/dist/mcp/tools/investigate.d.ts +9 -0
- package/dist/mcp/tools/investigate.js +254 -0
- package/dist/mcp/tools/user.d.ts +2 -4
- package/dist/mcp/tools/user.js +9 -50
- package/dist/mcp/tools/workflow.d.ts +1 -0
- package/dist/mcp/tools/workflow.js +164 -52
- package/dist/mcp/utils/hailer-api-client.js +26 -17
- package/dist/mcp/webhook-handler.d.ts +64 -3
- package/dist/mcp/webhook-handler.js +219 -9
- package/dist/mcp-server.d.ts +4 -0
- package/dist/mcp-server.js +237 -25
- package/dist/plugins/bug-fixer/index.d.ts +2 -0
- package/dist/plugins/bug-fixer/index.js +18 -0
- package/dist/plugins/bug-fixer/tools.d.ts +45 -0
- package/dist/plugins/bug-fixer/tools.js +1096 -0
- package/package.json +10 -10
- package/scripts/test-hal-tools.ts +154 -0
- package/.claude/agents/agent-nora-name-functions.md +0 -123
- package/.claude/assistant-knowledge.md +0 -23
- package/.claude/commands/install-plugin.md +0 -261
- package/.claude/commands/list-plugins.md +0 -42
- package/.claude/commands/marketplace-setup.md +0 -33
- package/.claude/commands/publish-plugin.md +0 -55
- package/.claude/commands/uninstall-plugin.md +0 -87
- package/.claude/hooks/interactive-mode.cjs +0 -87
- package/.claude/hooks/mcp-server-guard.cjs +0 -108
- package/.claude/skills/marketplace-publishing.md +0 -155
- package/dist/bot/chat-bot.d.ts +0 -31
- package/dist/bot/chat-bot.js +0 -357
- package/dist/mcp/tools/metrics.d.ts +0 -13
- package/dist/mcp/tools/metrics.js +0 -546
- package/dist/stdio-server.d.ts +0 -14
- package/dist/stdio-server.js +0 -114
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bot Configuration Module
|
|
3
|
+
*
|
|
4
|
+
* Modular structure for bot configuration management.
|
|
5
|
+
* Re-exports all public APIs for backwards compatibility.
|
|
6
|
+
*/
|
|
7
|
+
export type { SchemaConfig, BotStateEntry, BotStateMap, BotInfo, BotCredentials, ActivitySchemaConfig, LocalCredentials } from './types';
|
|
8
|
+
export { AVAILABLE_BOTS, LEGACY_AGENT_ACTIVITY_IDS } from './constants';
|
|
9
|
+
export { getWorkspaceByWorkflowId, getAllConfiguredWorkspaces, setActiveWorkspace, getActiveWorkspace, getWorkspaceSchema, setWorkspaceSchema, getAgentDirectoryWorkflowId, getPhaseIds, getOrchestratorUserId, setOrchestratorUserId, onBotStateChange, onBotCredentialsChange, onDaemonRestartNeeded, cleanupBotConfig, getBotState, getBotUserId, getBotType, getEnabledBotsWithTypes, setBotUserId, setBotEnabled, handleActivityPhaseChange, reloadConfigFromHailer, initBotConfigPersistence, initWorkspaceSchema, isPersistenceInitialized, getBotCredentials, updateBotCredentials, getLocalBotCredentials, getAllLocalBotCredentials, getPersistenceStatus, listBotsConfigTool, enableBotTool, disableBotTool, checkSpecialistStatusTool, botConfigTools } from './core';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Bot Configuration Module
|
|
4
|
+
*
|
|
5
|
+
* Modular structure for bot configuration management.
|
|
6
|
+
* Re-exports all public APIs for backwards compatibility.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.botConfigTools = exports.checkSpecialistStatusTool = exports.disableBotTool = exports.enableBotTool = exports.listBotsConfigTool = exports.getPersistenceStatus = exports.getAllLocalBotCredentials = exports.getLocalBotCredentials = exports.updateBotCredentials = exports.getBotCredentials = exports.isPersistenceInitialized = exports.initWorkspaceSchema = exports.initBotConfigPersistence = exports.reloadConfigFromHailer = exports.handleActivityPhaseChange = exports.setBotEnabled = exports.setBotUserId = exports.getEnabledBotsWithTypes = exports.getBotType = exports.getBotUserId = exports.getBotState = exports.cleanupBotConfig = exports.onDaemonRestartNeeded = exports.onBotCredentialsChange = exports.onBotStateChange = exports.setOrchestratorUserId = exports.getOrchestratorUserId = exports.getPhaseIds = exports.getAgentDirectoryWorkflowId = exports.setWorkspaceSchema = exports.getWorkspaceSchema = exports.getActiveWorkspace = exports.setActiveWorkspace = exports.getAllConfiguredWorkspaces = exports.getWorkspaceByWorkflowId = exports.LEGACY_AGENT_ACTIVITY_IDS = exports.AVAILABLE_BOTS = void 0;
|
|
10
|
+
// Constants
|
|
11
|
+
var constants_1 = require("./constants");
|
|
12
|
+
Object.defineProperty(exports, "AVAILABLE_BOTS", { enumerable: true, get: function () { return constants_1.AVAILABLE_BOTS; } });
|
|
13
|
+
Object.defineProperty(exports, "LEGACY_AGENT_ACTIVITY_IDS", { enumerable: true, get: function () { return constants_1.LEGACY_AGENT_ACTIVITY_IDS; } });
|
|
14
|
+
// Core functionality - all exports from core.ts
|
|
15
|
+
var core_1 = require("./core");
|
|
16
|
+
// Schema management
|
|
17
|
+
Object.defineProperty(exports, "getWorkspaceByWorkflowId", { enumerable: true, get: function () { return core_1.getWorkspaceByWorkflowId; } });
|
|
18
|
+
Object.defineProperty(exports, "getAllConfiguredWorkspaces", { enumerable: true, get: function () { return core_1.getAllConfiguredWorkspaces; } });
|
|
19
|
+
Object.defineProperty(exports, "setActiveWorkspace", { enumerable: true, get: function () { return core_1.setActiveWorkspace; } });
|
|
20
|
+
Object.defineProperty(exports, "getActiveWorkspace", { enumerable: true, get: function () { return core_1.getActiveWorkspace; } });
|
|
21
|
+
Object.defineProperty(exports, "getWorkspaceSchema", { enumerable: true, get: function () { return core_1.getWorkspaceSchema; } });
|
|
22
|
+
Object.defineProperty(exports, "setWorkspaceSchema", { enumerable: true, get: function () { return core_1.setWorkspaceSchema; } });
|
|
23
|
+
Object.defineProperty(exports, "getAgentDirectoryWorkflowId", { enumerable: true, get: function () { return core_1.getAgentDirectoryWorkflowId; } });
|
|
24
|
+
Object.defineProperty(exports, "getPhaseIds", { enumerable: true, get: function () { return core_1.getPhaseIds; } });
|
|
25
|
+
// Orchestrator tracking
|
|
26
|
+
Object.defineProperty(exports, "getOrchestratorUserId", { enumerable: true, get: function () { return core_1.getOrchestratorUserId; } });
|
|
27
|
+
Object.defineProperty(exports, "setOrchestratorUserId", { enumerable: true, get: function () { return core_1.setOrchestratorUserId; } });
|
|
28
|
+
// Callbacks
|
|
29
|
+
Object.defineProperty(exports, "onBotStateChange", { enumerable: true, get: function () { return core_1.onBotStateChange; } });
|
|
30
|
+
Object.defineProperty(exports, "onBotCredentialsChange", { enumerable: true, get: function () { return core_1.onBotCredentialsChange; } });
|
|
31
|
+
Object.defineProperty(exports, "onDaemonRestartNeeded", { enumerable: true, get: function () { return core_1.onDaemonRestartNeeded; } });
|
|
32
|
+
Object.defineProperty(exports, "cleanupBotConfig", { enumerable: true, get: function () { return core_1.cleanupBotConfig; } });
|
|
33
|
+
// Bot state
|
|
34
|
+
Object.defineProperty(exports, "getBotState", { enumerable: true, get: function () { return core_1.getBotState; } });
|
|
35
|
+
Object.defineProperty(exports, "getBotUserId", { enumerable: true, get: function () { return core_1.getBotUserId; } });
|
|
36
|
+
Object.defineProperty(exports, "getBotType", { enumerable: true, get: function () { return core_1.getBotType; } });
|
|
37
|
+
Object.defineProperty(exports, "getEnabledBotsWithTypes", { enumerable: true, get: function () { return core_1.getEnabledBotsWithTypes; } });
|
|
38
|
+
Object.defineProperty(exports, "setBotUserId", { enumerable: true, get: function () { return core_1.setBotUserId; } });
|
|
39
|
+
Object.defineProperty(exports, "setBotEnabled", { enumerable: true, get: function () { return core_1.setBotEnabled; } });
|
|
40
|
+
// Activity handling
|
|
41
|
+
Object.defineProperty(exports, "handleActivityPhaseChange", { enumerable: true, get: function () { return core_1.handleActivityPhaseChange; } });
|
|
42
|
+
Object.defineProperty(exports, "reloadConfigFromHailer", { enumerable: true, get: function () { return core_1.reloadConfigFromHailer; } });
|
|
43
|
+
// Persistence
|
|
44
|
+
Object.defineProperty(exports, "initBotConfigPersistence", { enumerable: true, get: function () { return core_1.initBotConfigPersistence; } });
|
|
45
|
+
Object.defineProperty(exports, "initWorkspaceSchema", { enumerable: true, get: function () { return core_1.initWorkspaceSchema; } });
|
|
46
|
+
Object.defineProperty(exports, "isPersistenceInitialized", { enumerable: true, get: function () { return core_1.isPersistenceInitialized; } });
|
|
47
|
+
// Credentials
|
|
48
|
+
Object.defineProperty(exports, "getBotCredentials", { enumerable: true, get: function () { return core_1.getBotCredentials; } });
|
|
49
|
+
Object.defineProperty(exports, "updateBotCredentials", { enumerable: true, get: function () { return core_1.updateBotCredentials; } });
|
|
50
|
+
Object.defineProperty(exports, "getLocalBotCredentials", { enumerable: true, get: function () { return core_1.getLocalBotCredentials; } });
|
|
51
|
+
Object.defineProperty(exports, "getAllLocalBotCredentials", { enumerable: true, get: function () { return core_1.getAllLocalBotCredentials; } });
|
|
52
|
+
Object.defineProperty(exports, "getPersistenceStatus", { enumerable: true, get: function () { return core_1.getPersistenceStatus; } });
|
|
53
|
+
// MCP Tools
|
|
54
|
+
Object.defineProperty(exports, "listBotsConfigTool", { enumerable: true, get: function () { return core_1.listBotsConfigTool; } });
|
|
55
|
+
Object.defineProperty(exports, "enableBotTool", { enumerable: true, get: function () { return core_1.enableBotTool; } });
|
|
56
|
+
Object.defineProperty(exports, "disableBotTool", { enumerable: true, get: function () { return core_1.disableBotTool; } });
|
|
57
|
+
Object.defineProperty(exports, "checkSpecialistStatusTool", { enumerable: true, get: function () { return core_1.checkSpecialistStatusTool; } });
|
|
58
|
+
Object.defineProperty(exports, "botConfigTools", { enumerable: true, get: function () { return core_1.botConfigTools; } });
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Bot Configuration MCP Tools
|
|
4
|
+
*
|
|
5
|
+
* Re-exported from core.ts for modular structure.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.botConfigTools = exports.checkSpecialistStatusTool = exports.disableBotTool = exports.enableBotTool = exports.listBotsConfigTool = void 0;
|
|
9
|
+
var core_1 = require("./core");
|
|
10
|
+
Object.defineProperty(exports, "listBotsConfigTool", { enumerable: true, get: function () { return core_1.listBotsConfigTool; } });
|
|
11
|
+
Object.defineProperty(exports, "enableBotTool", { enumerable: true, get: function () { return core_1.enableBotTool; } });
|
|
12
|
+
Object.defineProperty(exports, "disableBotTool", { enumerable: true, get: function () { return core_1.disableBotTool; } });
|
|
13
|
+
Object.defineProperty(exports, "checkSpecialistStatusTool", { enumerable: true, get: function () { return core_1.checkSpecialistStatusTool; } });
|
|
14
|
+
Object.defineProperty(exports, "botConfigTools", { enumerable: true, get: function () { return core_1.botConfigTools; } });
|
|
15
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bot Configuration Types
|
|
3
|
+
*/
|
|
4
|
+
export interface SchemaConfig {
|
|
5
|
+
agentDirectoryWorkflowId: string | null;
|
|
6
|
+
deployedPhaseId: string | null;
|
|
7
|
+
retiredPhaseId: string | null;
|
|
8
|
+
hailerProfileFieldId: string | null;
|
|
9
|
+
emailFieldId: string | null;
|
|
10
|
+
passwordFieldId: string | null;
|
|
11
|
+
botTypeFieldId: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface BotStateEntry {
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
userId: string | null;
|
|
16
|
+
botType: string | null;
|
|
17
|
+
}
|
|
18
|
+
export type BotStateMap = {
|
|
19
|
+
[userIdOrBotId: string]: BotStateEntry;
|
|
20
|
+
};
|
|
21
|
+
export interface BotInfo {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
icon: string;
|
|
26
|
+
}
|
|
27
|
+
export interface BotCredentials {
|
|
28
|
+
email?: string;
|
|
29
|
+
password?: string;
|
|
30
|
+
displayName?: string;
|
|
31
|
+
workspaceId?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ActivitySchemaConfig {
|
|
34
|
+
agentDirectoryWorkflowId?: string;
|
|
35
|
+
deployedPhaseId?: string;
|
|
36
|
+
retiredPhaseId?: string;
|
|
37
|
+
hailerProfileFieldId?: string;
|
|
38
|
+
emailFieldId?: string;
|
|
39
|
+
passwordFieldId?: string;
|
|
40
|
+
botTypeFieldId?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface LocalCredentials {
|
|
43
|
+
[userId: string]: {
|
|
44
|
+
email: string;
|
|
45
|
+
password: string;
|
|
46
|
+
displayName?: string;
|
|
47
|
+
workspaceId?: string;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -14,6 +14,8 @@ const zod_1 = require("zod");
|
|
|
14
14
|
const tool_registry_1 = require("../tool-registry");
|
|
15
15
|
const index_1 = require("../utils/index");
|
|
16
16
|
const workspace_cache_1 = require("../workspace-cache");
|
|
17
|
+
const hailer_clients_1 = require("../hailer-clients");
|
|
18
|
+
const request_logger_1 = require("../../lib/request-logger");
|
|
17
19
|
const logger = (0, index_1.createLogger)({ component: 'discussion-tools' });
|
|
18
20
|
// ============================================================================
|
|
19
21
|
// HELPER FUNCTIONS
|
|
@@ -221,7 +223,8 @@ exports.listMyDiscussionsTool = {
|
|
|
221
223
|
};
|
|
222
224
|
}
|
|
223
225
|
catch (error) {
|
|
224
|
-
|
|
226
|
+
if (!request_logger_1.RequestLogger.getCurrent())
|
|
227
|
+
logger.error("Failed to list discussions", error);
|
|
225
228
|
return {
|
|
226
229
|
content: [
|
|
227
230
|
{
|
|
@@ -279,7 +282,7 @@ exports.fetchDiscussionMessagesTool = {
|
|
|
279
282
|
try {
|
|
280
283
|
const activity = await context.hailer.fetchActivityById(discussionId);
|
|
281
284
|
if (activity?.discussion) {
|
|
282
|
-
logger.
|
|
285
|
+
logger.debug('Auto-converted activity ID to discussion ID', {
|
|
283
286
|
activityId: discussionId,
|
|
284
287
|
discussionId: activity.discussion,
|
|
285
288
|
activityName: activity.name
|
|
@@ -363,7 +366,8 @@ exports.fetchDiscussionMessagesTool = {
|
|
|
363
366
|
};
|
|
364
367
|
}
|
|
365
368
|
catch (error) {
|
|
366
|
-
|
|
369
|
+
if (!request_logger_1.RequestLogger.getCurrent())
|
|
370
|
+
logger.error("Error fetching discussion messages", error);
|
|
367
371
|
const errorMessage = error instanceof Error
|
|
368
372
|
? error.message
|
|
369
373
|
: (typeof error === 'object' && error !== null)
|
|
@@ -490,7 +494,8 @@ exports.fetchPreviousDiscussionMessagesTool = {
|
|
|
490
494
|
};
|
|
491
495
|
}
|
|
492
496
|
catch (error) {
|
|
493
|
-
|
|
497
|
+
if (!request_logger_1.RequestLogger.getCurrent())
|
|
498
|
+
logger.error("Error fetching previous discussion messages", error);
|
|
494
499
|
return {
|
|
495
500
|
content: [
|
|
496
501
|
{
|
|
@@ -596,7 +601,7 @@ exports.joinDiscussionTool = {
|
|
|
596
601
|
discussionId = activity.discussion;
|
|
597
602
|
activityName = activity.name;
|
|
598
603
|
resolvedActivityId = args.discussionId;
|
|
599
|
-
logger.
|
|
604
|
+
logger.debug('Auto-resolved activity ID to discussion', {
|
|
600
605
|
activityId: args.discussionId,
|
|
601
606
|
discussionId,
|
|
602
607
|
activityName
|
|
@@ -665,59 +670,61 @@ exports.joinDiscussionTool = {
|
|
|
665
670
|
userName: invitedUserName
|
|
666
671
|
});
|
|
667
672
|
}
|
|
668
|
-
//
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
try {
|
|
683
|
-
const sourceActivity = await context.hailer.fetchActivityById(validSourceId);
|
|
684
|
-
const sourceActivityName = sourceActivity?.name || 'Unknown';
|
|
685
|
-
sourceTag = `${ZWNBSP}[hailerTag|${sourceActivityName}](${validSourceId})${ZWNBSP}`;
|
|
686
|
-
}
|
|
687
|
-
catch {
|
|
688
|
-
sourceTag = `activity ${validSourceId}`;
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
// Build welcome message - focus on WHERE they came from
|
|
692
|
-
let welcomeMsg;
|
|
693
|
-
if (sourceTag) {
|
|
694
|
-
welcomeMsg = `š ${userTag} joined from ${sourceTag}\n\n**Context:** ${args.welcomeReason}`;
|
|
695
|
-
}
|
|
696
|
-
else {
|
|
697
|
-
welcomeMsg = `š ${userTag} was added to this discussion.\n\n**Context:** ${args.welcomeReason}`;
|
|
698
|
-
}
|
|
699
|
-
// Build links metadata for tags
|
|
700
|
-
const links = [
|
|
701
|
-
{ target: args.inviteUserId, targetType: 'user', type: 'linked-to' }
|
|
702
|
-
];
|
|
703
|
-
if (args.activityId) {
|
|
704
|
-
links.push({ target: args.activityId, targetType: 'activity', type: 'linked-to' });
|
|
673
|
+
// Always post welcome message when a user is invited
|
|
674
|
+
try {
|
|
675
|
+
const ZWNBSP = '\uFEFF';
|
|
676
|
+
const userTag = `${ZWNBSP}[hailerTag|${invitedUserName}](${args.inviteUserId})${ZWNBSP}`;
|
|
677
|
+
// Build wormhole - clickable link back to source activity (if from activity discussion)
|
|
678
|
+
let sourceTag = '';
|
|
679
|
+
const validSourceId = args.sourceActivityId && args.sourceActivityId !== args.activityId
|
|
680
|
+
? args.sourceActivityId
|
|
681
|
+
: null;
|
|
682
|
+
if (validSourceId) {
|
|
683
|
+
try {
|
|
684
|
+
const sourceActivity = await context.hailer.fetchActivityById(validSourceId);
|
|
685
|
+
const sourceActivityName = sourceActivity?.name || 'Unknown';
|
|
686
|
+
sourceTag = `${ZWNBSP}[hailerTag|${sourceActivityName}](${validSourceId})${ZWNBSP}`;
|
|
705
687
|
}
|
|
706
|
-
|
|
707
|
-
|
|
688
|
+
catch {
|
|
689
|
+
sourceTag = `activity ${validSourceId}`;
|
|
708
690
|
}
|
|
709
|
-
await context.hailer.request('messenger.send', [
|
|
710
|
-
{ msg: welcomeMsg, links },
|
|
711
|
-
discussionId
|
|
712
|
-
]);
|
|
713
|
-
logger.debug('Welcome message posted', { discussionId, hadTags: true, hasWormhole: !!validSourceId });
|
|
714
691
|
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
}
|
|
692
|
+
// Build welcome message
|
|
693
|
+
let welcomeMsg;
|
|
694
|
+
const context_reason = args.welcomeReason || '';
|
|
695
|
+
if (sourceTag && context_reason) {
|
|
696
|
+
welcomeMsg = `${userTag} joined from ${sourceTag}\n\n**Context:** ${context_reason}`;
|
|
697
|
+
}
|
|
698
|
+
else if (sourceTag) {
|
|
699
|
+
welcomeMsg = `${userTag} joined from ${sourceTag}`;
|
|
720
700
|
}
|
|
701
|
+
else if (context_reason) {
|
|
702
|
+
welcomeMsg = `${userTag} was added to this discussion.\n\n**Context:** ${context_reason}`;
|
|
703
|
+
}
|
|
704
|
+
else {
|
|
705
|
+
welcomeMsg = `${userTag} was added to this discussion.`;
|
|
706
|
+
}
|
|
707
|
+
// Build links metadata for tags
|
|
708
|
+
const links = [
|
|
709
|
+
{ target: args.inviteUserId, targetType: 'user', type: 'linked-to' }
|
|
710
|
+
];
|
|
711
|
+
if (args.activityId) {
|
|
712
|
+
links.push({ target: args.activityId, targetType: 'activity', type: 'linked-to' });
|
|
713
|
+
}
|
|
714
|
+
if (validSourceId) {
|
|
715
|
+
links.push({ target: validSourceId, targetType: 'activity', type: 'linked-to' });
|
|
716
|
+
}
|
|
717
|
+
await context.hailer.request('messenger.send', [
|
|
718
|
+
{ msg: welcomeMsg, links },
|
|
719
|
+
discussionId
|
|
720
|
+
]);
|
|
721
|
+
logger.debug('Welcome message posted', { discussionId, hasWormhole: !!validSourceId, hasContext: !!context_reason });
|
|
722
|
+
}
|
|
723
|
+
catch (welcomeError) {
|
|
724
|
+
logger.warn('Failed to post welcome message', {
|
|
725
|
+
discussionId,
|
|
726
|
+
error: welcomeError instanceof Error ? welcomeError.message : String(welcomeError)
|
|
727
|
+
});
|
|
721
728
|
}
|
|
722
729
|
}
|
|
723
730
|
catch (inviteError) {
|
|
@@ -728,27 +735,18 @@ exports.joinDiscussionTool = {
|
|
|
728
735
|
});
|
|
729
736
|
}
|
|
730
737
|
}
|
|
731
|
-
// Build response
|
|
732
|
-
let responseText =
|
|
733
|
-
if (activityName) {
|
|
734
|
-
responseText +=
|
|
738
|
+
// Build response - clean, no URLs (bot formatter handles hailerTags)
|
|
739
|
+
let responseText = 'Joined discussion.\n';
|
|
740
|
+
if (activityName && resolvedActivityId) {
|
|
741
|
+
responseText += `Activity: ${activityName} (${resolvedActivityId})\n`;
|
|
735
742
|
}
|
|
736
|
-
responseText +=
|
|
743
|
+
responseText += `Discussion: ${discussionId}\n`;
|
|
737
744
|
if (userInvited) {
|
|
738
|
-
responseText +=
|
|
745
|
+
responseText += `Invited: ${invitedUserName}\n`;
|
|
739
746
|
}
|
|
740
747
|
else if (userAlreadyMember) {
|
|
741
|
-
responseText +=
|
|
742
|
-
}
|
|
743
|
-
responseText += `\nš You can now:\n`;
|
|
744
|
-
responseText += `- Read messages with: fetch_discussion_messages(discussionId: "${discussionId}")\n`;
|
|
745
|
-
responseText += `- Post messages with: add_discussion_message(discussionId: "${discussionId}", content: "your message")\n`;
|
|
746
|
-
if (resolvedActivityId) {
|
|
747
|
-
responseText += `- Leave with: leave_discussion(activityId: "${resolvedActivityId}")\n`;
|
|
748
|
-
responseText += `\nš **Direct Links:**\n`;
|
|
749
|
-
responseText += `- Activity: https://app.hailer.com/#/activities/${resolvedActivityId}\n`;
|
|
748
|
+
responseText += `${invitedUserName} was already a member.\n`;
|
|
750
749
|
}
|
|
751
|
-
responseText += `- Discussion: https://app.hailer.com/#/discussions/${discussionId}`;
|
|
752
750
|
return {
|
|
753
751
|
content: [{
|
|
754
752
|
type: "text",
|
|
@@ -757,7 +755,8 @@ exports.joinDiscussionTool = {
|
|
|
757
755
|
};
|
|
758
756
|
}
|
|
759
757
|
catch (error) {
|
|
760
|
-
|
|
758
|
+
if (!request_logger_1.RequestLogger.getCurrent())
|
|
759
|
+
logger.error("Error joining discussion", error);
|
|
761
760
|
const errorMessage = error instanceof Error
|
|
762
761
|
? error.message
|
|
763
762
|
: (typeof error === 'object' && error !== null)
|
|
@@ -817,7 +816,7 @@ exports.leaveDiscussionTool = {
|
|
|
817
816
|
}),
|
|
818
817
|
async execute(args, context) {
|
|
819
818
|
// DEBUG: Log raw input to diagnose LLM tool calling issues
|
|
820
|
-
logger.
|
|
819
|
+
logger.debug("leave_discussion called", {
|
|
821
820
|
hasActivityId: !!args.activityId,
|
|
822
821
|
hasDiscussionId: !!args.discussionId,
|
|
823
822
|
activityId: args.activityId || '(not provided)',
|
|
@@ -876,7 +875,8 @@ exports.leaveDiscussionTool = {
|
|
|
876
875
|
};
|
|
877
876
|
}
|
|
878
877
|
catch (error) {
|
|
879
|
-
|
|
878
|
+
if (!request_logger_1.RequestLogger.getCurrent())
|
|
879
|
+
logger.error("Error leaving discussion", error);
|
|
880
880
|
const errorMessage = error instanceof Error
|
|
881
881
|
? error.message
|
|
882
882
|
: (typeof error === 'object' && error !== null)
|
|
@@ -975,8 +975,12 @@ exports.inviteDiscussionMembersTool = {
|
|
|
975
975
|
[args.discussionId]
|
|
976
976
|
]);
|
|
977
977
|
const discussion = syncResponse?.[args.discussionId];
|
|
978
|
-
// Block invites to private chats - this breaks Hailer
|
|
979
|
-
|
|
978
|
+
// Block invites to private/DM chats - this breaks Hailer
|
|
979
|
+
// Check both `private` flag and participant count as fallback
|
|
980
|
+
// (Hailer API may not always return the `private` field)
|
|
981
|
+
const participants = discussion?.participants || [];
|
|
982
|
+
const isDm = discussion?.private === true || participants.length === 2;
|
|
983
|
+
if (isDm) {
|
|
980
984
|
return {
|
|
981
985
|
content: [{
|
|
982
986
|
type: "text",
|
|
@@ -987,6 +991,30 @@ exports.inviteDiscussionMembersTool = {
|
|
|
987
991
|
};
|
|
988
992
|
}
|
|
989
993
|
const existingMembers = new Set(discussion?.participants || []);
|
|
994
|
+
// Ensure the bot is a member before inviting others
|
|
995
|
+
// This allows the bot to post messages after inviting users
|
|
996
|
+
try {
|
|
997
|
+
const botUserId = await (0, hailer_clients_1.getCurrentUserId)(context.client);
|
|
998
|
+
if (botUserId && !existingMembers.has(botUserId)) {
|
|
999
|
+
try {
|
|
1000
|
+
await context.hailer.joinDiscussion(args.discussionId);
|
|
1001
|
+
logger.debug('Bot joined discussion before inviting', { discussionId: args.discussionId });
|
|
1002
|
+
}
|
|
1003
|
+
catch (joinError) {
|
|
1004
|
+
// Non-fatal: bot might not be able to join some discussion types
|
|
1005
|
+
logger.debug('Bot join before invite failed (non-fatal)', {
|
|
1006
|
+
discussionId: args.discussionId,
|
|
1007
|
+
error: joinError instanceof Error ? joinError.message : String(joinError)
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
catch (userIdError) {
|
|
1013
|
+
// Non-fatal: if we can't get the bot's user ID, continue with the invite
|
|
1014
|
+
logger.debug('Could not get bot user ID (non-fatal)', {
|
|
1015
|
+
error: userIdError instanceof Error ? userIdError.message : String(userIdError)
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
990
1018
|
// Filter out users who are already members
|
|
991
1019
|
const alreadyMembers = [];
|
|
992
1020
|
const newUsers = [];
|
|
@@ -1050,7 +1078,8 @@ exports.inviteDiscussionMembersTool = {
|
|
|
1050
1078
|
};
|
|
1051
1079
|
}
|
|
1052
1080
|
catch (error) {
|
|
1053
|
-
|
|
1081
|
+
if (!request_logger_1.RequestLogger.getCurrent())
|
|
1082
|
+
logger.error("Error inviting discussion members", error);
|
|
1054
1083
|
const errorMessage = error instanceof Error
|
|
1055
1084
|
? error.message
|
|
1056
1085
|
: (typeof error === 'object' && error !== null)
|
|
@@ -1219,7 +1248,8 @@ exports.getActivityFromDiscussionTool = {
|
|
|
1219
1248
|
};
|
|
1220
1249
|
}
|
|
1221
1250
|
catch (error) {
|
|
1222
|
-
|
|
1251
|
+
if (!request_logger_1.RequestLogger.getCurrent())
|
|
1252
|
+
logger.error("Error getting activity from discussion", error);
|
|
1223
1253
|
const errorMessage = error instanceof Error
|
|
1224
1254
|
? error.message
|
|
1225
1255
|
: (typeof error === 'object' && error !== null)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document Tools - PDF/CSV Generation
|
|
3
|
+
*
|
|
4
|
+
* Tools for generating documents from templates:
|
|
5
|
+
* - List document templates (READ)
|
|
6
|
+
* - Generate PDF documents from activities (WRITE)
|
|
7
|
+
*/
|
|
8
|
+
import { Tool } from '../tool-registry';
|
|
9
|
+
export declare const listDocumentTemplatesTool: Tool;
|
|
10
|
+
export declare const generateDocumentTool: Tool;
|
|
11
|
+
//# sourceMappingURL=document.d.ts.map
|