@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
@@ -1,69 +0,0 @@
1
- /**
2
- * Tool Executor
3
- *
4
- * Handles MCP tool call execution and result processing.
5
- * Shared between all LLM providers (Anthropic, OpenAI, etc.)
6
- *
7
- * Key Features:
8
- * - Execute tool calls via MCP server
9
- * - Handle tool call iterations and loops
10
- * - Process and format tool results
11
- * - Track tool execution metrics
12
- */
13
- export interface ToolCall {
14
- id: string;
15
- name: string;
16
- arguments: any;
17
- }
18
- export interface ToolResult {
19
- tool_use_id: string;
20
- content: string;
21
- isError?: boolean;
22
- }
23
- export interface ExecuteToolOptions {
24
- mcpServerUrl: string;
25
- mcpServerApiKey: string;
26
- toolCall: ToolCall;
27
- }
28
- export interface ToolExecutionMetrics {
29
- toolName: string;
30
- success: boolean;
31
- duration: number;
32
- error?: string;
33
- }
34
- export declare class ToolExecutor {
35
- private executionMetrics;
36
- /**
37
- * Execute a tool call via MCP server
38
- */
39
- executeTool(options: ExecuteToolOptions): Promise<ToolResult>;
40
- /**
41
- * Execute multiple tool calls in parallel
42
- */
43
- executeToolsParallel(options: Omit<ExecuteToolOptions, 'toolCall'>, toolCalls: ToolCall[]): Promise<ToolResult[]>;
44
- /**
45
- * Get execution metrics
46
- */
47
- getMetrics(): ToolExecutionMetrics[];
48
- /**
49
- * Get successful tool call count
50
- */
51
- getSuccessCount(): number;
52
- /**
53
- * Get total tool call count
54
- */
55
- getTotalCount(): number;
56
- /**
57
- * Clear metrics
58
- */
59
- clearMetrics(): void;
60
- /**
61
- * Get list of tool names called
62
- */
63
- getToolNamesCalled(): string[];
64
- /**
65
- * Call MCP tool via JSON-RPC
66
- */
67
- private callMcpTool;
68
- }
69
- //# sourceMappingURL=tool-executor.d.ts.map
@@ -1,159 +0,0 @@
1
- "use strict";
2
- /**
3
- * Tool Executor
4
- *
5
- * Handles MCP tool call execution and result processing.
6
- * Shared between all LLM providers (Anthropic, OpenAI, etc.)
7
- *
8
- * Key Features:
9
- * - Execute tool calls via MCP server
10
- * - Handle tool call iterations and loops
11
- * - Process and format tool results
12
- * - Track tool execution metrics
13
- */
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ToolExecutor = void 0;
16
- const logger_1 = require("../lib/logger");
17
- const logger = (0, logger_1.createLogger)({ component: 'ToolExecutor' });
18
- class ToolExecutor {
19
- executionMetrics = [];
20
- /**
21
- * Execute a tool call via MCP server
22
- */
23
- async executeTool(options) {
24
- const { mcpServerUrl, mcpServerApiKey, toolCall } = options;
25
- const startTime = Date.now();
26
- try {
27
- logger.debug("[tool_call] Tool call", {
28
- toolName: toolCall.name,
29
- arguments: toolCall.arguments
30
- });
31
- const result = await this.callMcpTool(mcpServerUrl, mcpServerApiKey, toolCall.name, toolCall.arguments);
32
- const duration = Date.now() - startTime;
33
- logger.debug("[tool_call] Tool call", {
34
- toolName: toolCall.name,
35
- arguments: toolCall.arguments,
36
- duration
37
- });
38
- // Track metrics
39
- this.executionMetrics.push({
40
- toolName: toolCall.name,
41
- success: true,
42
- duration
43
- });
44
- return {
45
- tool_use_id: toolCall.id,
46
- content: JSON.stringify(result),
47
- isError: false
48
- };
49
- }
50
- catch (error) {
51
- const duration = Date.now() - startTime;
52
- const errorMessage = error instanceof Error ? error.message : String(error);
53
- logger.error("[tool_call] Tool call failed", {
54
- toolName: toolCall.name,
55
- error: errorMessage,
56
- duration
57
- });
58
- // Track error metrics
59
- this.executionMetrics.push({
60
- toolName: toolCall.name,
61
- success: false,
62
- duration,
63
- error: errorMessage
64
- });
65
- return {
66
- tool_use_id: toolCall.id,
67
- content: `Error executing tool: ${errorMessage}`,
68
- isError: true
69
- };
70
- }
71
- }
72
- /**
73
- * Execute multiple tool calls in parallel
74
- */
75
- async executeToolsParallel(options, toolCalls) {
76
- const promises = toolCalls.map(toolCall => this.executeTool({ ...options, toolCall }));
77
- return Promise.all(promises);
78
- }
79
- /**
80
- * Get execution metrics
81
- */
82
- getMetrics() {
83
- return [...this.executionMetrics];
84
- }
85
- /**
86
- * Get successful tool call count
87
- */
88
- getSuccessCount() {
89
- return this.executionMetrics.filter(m => m.success).length;
90
- }
91
- /**
92
- * Get total tool call count
93
- */
94
- getTotalCount() {
95
- return this.executionMetrics.length;
96
- }
97
- /**
98
- * Clear metrics
99
- */
100
- clearMetrics() {
101
- this.executionMetrics = [];
102
- }
103
- /**
104
- * Get list of tool names called
105
- */
106
- getToolNamesCalled() {
107
- return this.executionMetrics.map(m => m.toolName);
108
- }
109
- // ===== PRIVATE METHODS =====
110
- /**
111
- * Call MCP tool via JSON-RPC
112
- */
113
- async callMcpTool(mcpServerUrl, mcpServerApiKey, toolName, args) {
114
- const url = `${mcpServerUrl}${mcpServerUrl.includes("?") ? "&" : "?"}apiKey=${mcpServerApiKey}`;
115
- const response = await fetch(url, {
116
- method: "POST",
117
- headers: {
118
- "Content-Type": "application/json",
119
- Accept: "application/json, text/event-stream",
120
- },
121
- body: JSON.stringify({
122
- jsonrpc: "2.0",
123
- id: Date.now(),
124
- method: "tools/call",
125
- params: {
126
- name: toolName,
127
- arguments: args,
128
- },
129
- }),
130
- });
131
- if (!response.ok) {
132
- throw new Error(`MCP tool call failed with ${response.status}: ${response.statusText}`);
133
- }
134
- // Parse SSE response
135
- const responseText = await response.text();
136
- const lines = responseText.split("\n");
137
- let jsonData = null;
138
- for (const line of lines) {
139
- if (line.startsWith("data: ")) {
140
- try {
141
- jsonData = JSON.parse(line.substring(6));
142
- break;
143
- }
144
- catch (e) {
145
- // Skip non-JSON lines
146
- }
147
- }
148
- }
149
- if (!jsonData) {
150
- throw new Error("Failed to parse MCP server response");
151
- }
152
- if (jsonData.error) {
153
- throw new Error(`MCP server error: ${jsonData.error.message || jsonData.error}`);
154
- }
155
- return jsonData.result;
156
- }
157
- }
158
- exports.ToolExecutor = ToolExecutor;
159
- //# sourceMappingURL=tool-executor.js.map
@@ -1,3 +0,0 @@
1
- import { HailerV2CoreInitResponse } from "../mcp/utils";
2
- export declare const materialize: (hailerResponse: any, init: HailerV2CoreInitResponse, authToken: string) => Promise<unknown>;
3
- //# sourceMappingURL=materialize.d.ts.map
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.materialize = void 0;
4
- const getMaterializedProcess = (init, value) => {
5
- const process = init.processes.find((process) => process._id === value);
6
- if (!process)
7
- return value;
8
- return {
9
- _id: process?._id,
10
- name: process.name,
11
- phases: process?.phasesOrder
12
- .filter((phaseId) => !process.phasesRemoved.includes(phaseId))
13
- .map((phaseId) => {
14
- const phase = process.phases[phaseId];
15
- return {
16
- _id: process._id,
17
- name: phase.name,
18
- ...(phase.description ? { description: phase.description } : {}),
19
- };
20
- }),
21
- };
22
- };
23
- const getMaterializedCurrentPhase = (init, value) => {
24
- const phase = init.processes
25
- .flatMap((process) => Object.values(process.phases))
26
- .find((phase) => phase._id === value);
27
- if (!phase)
28
- return value;
29
- return {
30
- _id: phase._id,
31
- name: phase.name,
32
- ...(phase.description ? { description: phase.description } : {}),
33
- };
34
- };
35
- const getMaterializedUID = (init, value) => {
36
- const user = init.users[value];
37
- if (!user)
38
- return value;
39
- return {
40
- _id: user._id,
41
- name: `${user.firstname} ${user.lastname}`,
42
- };
43
- };
44
- const getMaterializedTime = (epoch) => ({
45
- epoch,
46
- humanReadable: new Intl.DateTimeFormat("en-GB", {
47
- day: "numeric",
48
- month: "short",
49
- year: "numeric",
50
- hour: "2-digit",
51
- minute: "2-digit",
52
- second: "2-digit",
53
- hour12: false,
54
- }).format(new Date(epoch)),
55
- });
56
- const getMaterializedValue = (key, value, init) => {
57
- if (key === "process" && typeof value === "string") {
58
- return getMaterializedProcess(init, value);
59
- }
60
- if (key === "currentPhase" && typeof value === "string") {
61
- return getMaterializedCurrentPhase(init, value);
62
- }
63
- if (key === "uid" && typeof value === "string") {
64
- return getMaterializedUID(init, value);
65
- }
66
- if ((key === "created" || key === "updated") && typeof value === "number") {
67
- return getMaterializedTime(value);
68
- }
69
- return value;
70
- };
71
- const mergeResponseWithDependencies = (rootNode, init) => {
72
- const traverse = (node) => {
73
- if (Array.isArray(node)) {
74
- return node.map(traverse);
75
- }
76
- if (node !== null && typeof node === "object") {
77
- return Object.entries(node).reduce((acc, [key, value]) => {
78
- const traversedValue = traverse(value);
79
- if ((typeof value === "string" && value.trim() === "") ||
80
- (Array.isArray(value) && value.length === 0)) {
81
- return acc;
82
- }
83
- return {
84
- ...acc,
85
- [key]: getMaterializedValue(key, traversedValue, init),
86
- };
87
- }, {});
88
- }
89
- return node;
90
- };
91
- return traverse(rootNode);
92
- };
93
- const materialize = async (hailerResponse, init, authToken) => {
94
- // TODO:
95
- // const { activityIds } = findDependencies();
96
- // const { activities } = loadDependencies(authToken);
97
- const hailerResponseWithDependencies = mergeResponseWithDependencies(hailerResponse, init);
98
- return hailerResponseWithDependencies;
99
- };
100
- exports.materialize = materialize;
101
- //# sourceMappingURL=materialize.js.map
@@ -1,7 +0,0 @@
1
- export declare const getNormalizedName: (name: string) => string;
2
- export declare const getNormalizedNames: (names: string[]) => string[];
3
- export declare const getIdByNormalizedName: (name: string | undefined, options: {
4
- name: string;
5
- _id: string;
6
- }[]) => string | undefined;
7
- //# sourceMappingURL=normalizedName.d.ts.map
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getIdByNormalizedName = exports.getNormalizedNames = exports.getNormalizedName = void 0;
4
- const logger_1 = require("./logger");
5
- const logger = (0, logger_1.createLogger)({ component: 'normalizedName' });
6
- const getNormalizedName = (name) => {
7
- if (!name || typeof name !== "string") {
8
- logger.warn("getNormalizedName called with invalid name", { name });
9
- return "";
10
- }
11
- return name
12
- .toLowerCase()
13
- .normalize("NFKD")
14
- .replace(/[\u0300-\u036f]/g, "")
15
- .replace(/[^a-z0-9]+/g, "_")
16
- .replace(/^_+|_+$/g, "");
17
- };
18
- exports.getNormalizedName = getNormalizedName;
19
- const getNormalizedNames = (names) => names
20
- .filter((name) => name && typeof name === "string")
21
- .reduce((normalizedNames, name) => {
22
- const normalizedName = (0, exports.getNormalizedName)(name);
23
- if (normalizedNames.includes(normalizedName)) {
24
- logger.error("Duplicate normalized name detected", { normalizedName, originalName: name });
25
- return normalizedNames;
26
- }
27
- return [...normalizedNames, normalizedName];
28
- }, []);
29
- exports.getNormalizedNames = getNormalizedNames;
30
- const getIdByNormalizedName = (name, options) => {
31
- if (!name) {
32
- logger.warn("getIdByNormalizedName called with invalid name", { name });
33
- return undefined;
34
- }
35
- const idByNormalizedName = options.reduce((acc, { name: optionName, _id }) => {
36
- const normalizedName = (0, exports.getNormalizedName)(optionName);
37
- if (acc[normalizedName]) {
38
- logger.error("Duplicate normalized name in options", { normalizedName, optionName, _id });
39
- return acc;
40
- }
41
- return { ...acc, [normalizedName]: _id };
42
- }, {});
43
- const normalizedInputName = (0, exports.getNormalizedName)(name);
44
- const id = idByNormalizedName[normalizedInputName];
45
- return id;
46
- };
47
- exports.getIdByNormalizedName = getIdByNormalizedName;
48
- //# sourceMappingURL=normalizedName.js.map
@@ -1,9 +0,0 @@
1
- export interface TerminalPrompts {
2
- email: string;
3
- password: string;
4
- }
5
- /**
6
- * Prompts user for email and password in terminal
7
- */
8
- export declare function promptForCredentials(): Promise<TerminalPrompts>;
9
- //# sourceMappingURL=terminal-prompt.d.ts.map
@@ -1,108 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.promptForCredentials = promptForCredentials;
37
- const readline = __importStar(require("readline"));
38
- const logger_1 = require("./logger");
39
- const logger = (0, logger_1.createLogger)({ component: 'terminal-prompt' });
40
- /**
41
- * Prompts user for email and password in terminal
42
- */
43
- function promptForCredentials() {
44
- return new Promise((resolve, reject) => {
45
- const rl = readline.createInterface({
46
- input: process.stdin,
47
- output: process.stdout
48
- });
49
- logger.info('Prompting for Hailer credentials in Claude Code mode');
50
- console.log(`\nšŸ” Please enter bot's or your own Hailer credentials. The Claude Code will use the account to access production data on Hailer.`);
51
- rl.question('Email: ', (email) => {
52
- if (!email.trim()) {
53
- logger.error('Email validation failed: empty email provided');
54
- console.log('āŒ Email cannot be empty');
55
- rl.close();
56
- reject(new Error('Email cannot be empty'));
57
- return;
58
- }
59
- // Use a simple approach - just hide the password completely during input
60
- rl.close();
61
- process.stdout.write('Password: ');
62
- // Disable echo temporarily
63
- if (process.stdin.setRawMode) {
64
- process.stdin.setRawMode(true);
65
- }
66
- process.stdin.resume();
67
- process.stdin.setEncoding('utf8');
68
- let password = '';
69
- const cleanup = () => {
70
- if (process.stdin.setRawMode) {
71
- process.stdin.setRawMode(false);
72
- }
73
- process.stdin.pause();
74
- };
75
- process.stdin.on('data', function onData(char) {
76
- const byte = char.charCodeAt(0);
77
- if (byte === 3) { // Ctrl-C
78
- cleanup();
79
- process.stdin.removeListener('data', onData);
80
- reject(new Error('Password input cancelled'));
81
- return;
82
- }
83
- if (byte === 13 || byte === 10) { // Enter
84
- cleanup();
85
- process.stdin.removeListener('data', onData);
86
- resolve({
87
- email: email.trim(),
88
- password: password.trim()
89
- });
90
- return;
91
- }
92
- if (byte === 127 || byte === 8) { // Backspace
93
- if (password.length > 0) {
94
- password = password.slice(0, -1);
95
- process.stdout.write('\b \b'); // Move back, write space, move back again
96
- }
97
- return;
98
- }
99
- // Add character to password and show asterisk
100
- if (byte >= 32) {
101
- password += char;
102
- process.stdout.write('*');
103
- }
104
- });
105
- });
106
- });
107
- }
108
- //# sourceMappingURL=terminal-prompt.js.map
@@ -1,10 +0,0 @@
1
- /**
2
- * Skill Management Tools - Clean Architecture
3
- *
4
- * Tools for discovering and loading skill documentation.
5
- * Skills are comprehensive documentation files with examples and best practices.
6
- */
7
- import { Tool } from '../tool-registry';
8
- export declare const listSkillsTool: Tool;
9
- export declare const getSkillTool: Tool;
10
- //# sourceMappingURL=skill.d.ts.map