@achieveai/hitl-mcp-server 1.1.0 → 2.0.0

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 (55) hide show
  1. package/dist/cli.d.ts +3 -0
  2. package/dist/cli.d.ts.map +1 -0
  3. package/dist/cli.js +131 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/config.d.ts +19 -0
  6. package/dist/config.d.ts.map +1 -0
  7. package/dist/config.js +54 -0
  8. package/dist/config.js.map +1 -0
  9. package/dist/git-context.d.ts +7 -0
  10. package/dist/git-context.d.ts.map +1 -0
  11. package/dist/git-context.js +29 -0
  12. package/dist/git-context.js.map +1 -0
  13. package/dist/mcp-server.d.ts +3 -0
  14. package/dist/mcp-server.d.ts.map +1 -0
  15. package/dist/{index.js → mcp-server.js} +124 -113
  16. package/dist/mcp-server.js.map +1 -0
  17. package/dist/ntfy-transport.d.ts +41 -0
  18. package/dist/ntfy-transport.d.ts.map +1 -0
  19. package/dist/ntfy-transport.js +150 -0
  20. package/dist/ntfy-transport.js.map +1 -0
  21. package/dist/setup.d.ts +38 -0
  22. package/dist/setup.d.ts.map +1 -0
  23. package/dist/setup.js +130 -0
  24. package/dist/setup.js.map +1 -0
  25. package/package.json +58 -62
  26. package/LICENSE +0 -20
  27. package/README.md +0 -422
  28. package/config/claude-desktop.json +0 -11
  29. package/config/cursor-mcp.json +0 -17
  30. package/config/vscode-mcp.json +0 -17
  31. package/dist/__tests__/dialog-manager.test.d.ts +0 -2
  32. package/dist/__tests__/dialog-manager.test.d.ts.map +0 -1
  33. package/dist/__tests__/dialog-manager.test.js +0 -140
  34. package/dist/__tests__/dialog-manager.test.js.map +0 -1
  35. package/dist/dialog-manager.d.ts +0 -36
  36. package/dist/dialog-manager.d.ts.map +0 -1
  37. package/dist/dialog-manager.js +0 -529
  38. package/dist/dialog-manager.js.map +0 -1
  39. package/dist/dialog-manager.test.d.ts +0 -2
  40. package/dist/dialog-manager.test.d.ts.map +0 -1
  41. package/dist/dialog-manager.test.js +0 -156
  42. package/dist/dialog-manager.test.js.map +0 -1
  43. package/dist/index.d.ts +0 -3
  44. package/dist/index.d.ts.map +0 -1
  45. package/dist/index.js.map +0 -1
  46. package/dist/test-client.d.ts +0 -3
  47. package/dist/test-client.d.ts.map +0 -1
  48. package/dist/test-client.js +0 -111
  49. package/dist/test-client.js.map +0 -1
  50. package/dist/test-dialog-manager.d.ts +0 -2
  51. package/dist/test-dialog-manager.d.ts.map +0 -1
  52. package/dist/test-dialog-manager.js +0 -156
  53. package/dist/test-dialog-manager.js.map +0 -1
  54. package/example-usage.md +0 -223
  55. package/mcp.json +0 -152
package/example-usage.md DELETED
@@ -1,223 +0,0 @@
1
- # Example Usage Scenarios
2
-
3
- ## 1. Ambiguous File Selection
4
-
5
- ```json
6
- {
7
- "tool": "ask_human",
8
- "arguments": {
9
- "question": "I found multiple index files. Which one should I modify?",
10
- "options": [
11
- {
12
- "label": "src/index.ts",
13
- "value": "src/index.ts",
14
- "description": "Main TypeScript entry point"
15
- },
16
- {
17
- "label": "public/index.html",
18
- "value": "public/index.html",
19
- "description": "HTML template file"
20
- },
21
- {
22
- "label": "dist/index.js",
23
- "value": "dist/index.js",
24
- "description": "Compiled JavaScript (build output)"
25
- }
26
- ],
27
- "allowMultiple": false,
28
- "allowOther": true,
29
- "context": "User asked to 'update the index file' but didn't specify which one"
30
- }
31
- }
32
- ```
33
-
34
- ## 2. Deployment Confirmation
35
-
36
- ```json
37
- {
38
- "tool": "ask_human",
39
- "arguments": {
40
- "question": "Ready to deploy to production. Should I proceed?",
41
- "options": [
42
- {
43
- "label": "Yes, deploy now",
44
- "value": "deploy",
45
- "description": "Deploy immediately to production"
46
- },
47
- {
48
- "label": "Run tests first",
49
- "value": "test-first",
50
- "description": "Run the test suite before deploying"
51
- },
52
- {
53
- "label": "Deploy to staging",
54
- "value": "staging",
55
- "description": "Deploy to staging environment instead"
56
- },
57
- {
58
- "label": "Cancel deployment",
59
- "value": "cancel",
60
- "description": "Do not deploy at this time"
61
- }
62
- ],
63
- "allowMultiple": false,
64
- "allowOther": false,
65
- "context": "All tests passed, build successful, last deployment was 3 days ago",
66
- "timeout": 60000
67
- }
68
- }
69
- ```
70
-
71
- ## 3. Code Style Preference
72
-
73
- ```json
74
- {
75
- "tool": "ask_human",
76
- "arguments": {
77
- "question": "Which naming convention should I use for the new API endpoints?",
78
- "options": [
79
- {
80
- "label": "camelCase",
81
- "value": "camelCase",
82
- "description": "getUserData, createNewPost"
83
- },
84
- {
85
- "label": "kebab-case",
86
- "value": "kebab-case",
87
- "description": "get-user-data, create-new-post"
88
- },
89
- {
90
- "label": "snake_case",
91
- "value": "snake_case",
92
- "description": "get_user_data, create_new_post"
93
- }
94
- ],
95
- "allowMultiple": false,
96
- "allowOther": true,
97
- "context": "Creating REST API endpoints for the user service"
98
- }
99
- }
100
- ```
101
-
102
- ## 4. Multiple File Selection
103
-
104
- ```json
105
- {
106
- "tool": "ask_human",
107
- "arguments": {
108
- "question": "Which test files should I run?",
109
- "options": [
110
- {
111
- "label": "Unit tests",
112
- "value": "unit",
113
- "description": "src/__tests__/*.test.ts"
114
- },
115
- {
116
- "label": "Integration tests",
117
- "value": "integration",
118
- "description": "tests/integration/*.spec.ts"
119
- },
120
- {
121
- "label": "E2E tests",
122
- "value": "e2e",
123
- "description": "tests/e2e/*.test.ts"
124
- },
125
- {
126
- "label": "Performance tests",
127
- "value": "performance",
128
- "description": "tests/performance/*.bench.ts"
129
- }
130
- ],
131
- "allowMultiple": true,
132
- "allowOther": false,
133
- "context": "Preparing for release, multiple test suites available"
134
- }
135
- }
136
- ```
137
-
138
- ## 5. Error Resolution Strategy
139
-
140
- ```json
141
- {
142
- "tool": "ask_human",
143
- "arguments": {
144
- "question": "TypeScript compilation failed with 15 errors. How should I proceed?",
145
- "options": [
146
- {
147
- "label": "Fix all errors now",
148
- "value": "fix-all",
149
- "description": "Attempt to fix all TypeScript errors"
150
- },
151
- {
152
- "label": "Fix critical errors only",
153
- "value": "fix-critical",
154
- "description": "Fix only errors that prevent compilation"
155
- },
156
- {
157
- "label": "Add @ts-ignore comments",
158
- "value": "ignore",
159
- "description": "Suppress errors with ignore comments"
160
- },
161
- {
162
- "label": "Show me the errors",
163
- "value": "show",
164
- "description": "Display all errors for review"
165
- }
166
- ],
167
- "allowMultiple": false,
168
- "allowOther": true,
169
- "context": "Errors are mostly related to type mismatches and missing type definitions"
170
- }
171
- }
172
- ```
173
-
174
- ## Response Examples
175
-
176
- ### Successful Selection Response
177
- ```json
178
- {
179
- "success": true,
180
- "timestamp": 1703001234567,
181
- "response": "src/index.ts",
182
- "responseType": "selection"
183
- }
184
- ```
185
-
186
- ### Multiple Selection Response
187
- ```json
188
- {
189
- "success": true,
190
- "timestamp": 1703001234567,
191
- "response": ["unit", "integration"],
192
- "responseType": "selection"
193
- }
194
- ```
195
-
196
- ### Custom Input Response
197
- ```json
198
- {
199
- "success": true,
200
- "timestamp": 1703001234567,
201
- "response": "Use PascalCase for classes and camelCase for methods",
202
- "responseType": "custom"
203
- }
204
- ```
205
-
206
- ### Skipped Response
207
- ```json
208
- {
209
- "success": true,
210
- "timestamp": 1703001234567,
211
- "skipped": true,
212
- "response": "User skipped this question"
213
- }
214
- ```
215
-
216
- ### Timeout Response
217
- ```json
218
- {
219
- "success": false,
220
- "error": "timeout",
221
- "message": "The user did not respond within the timeout period"
222
- }
223
- ```
package/mcp.json DELETED
@@ -1,152 +0,0 @@
1
- {
2
- "name": "@hitl/mcp-server",
3
- "version": "1.0.0",
4
- "description": "Human In The Loop MCP Server - Enables LLM agents to ask questions and get user feedback through interactive dialogs",
5
- "author": "",
6
- "license": "MIT",
7
- "keywords": [
8
- "mcp",
9
- "llm",
10
- "human-in-the-loop",
11
- "dialog",
12
- "interactive",
13
- "feedback",
14
- "decision-making"
15
- ],
16
- "runtime": "node",
17
- "tools": [
18
- {
19
- "name": "ask_human",
20
- "description": "Get human input for decisions, clarifications, and guidance through an interactive dialog",
21
- "inputSchema": {
22
- "type": "object",
23
- "properties": {
24
- "question": {
25
- "type": "string",
26
- "description": "The question or decision you need help with"
27
- },
28
- "options": {
29
- "type": "array",
30
- "description": "Array of possible choices",
31
- "items": {
32
- "type": "object",
33
- "properties": {
34
- "label": {
35
- "type": "string"
36
- },
37
- "value": {
38
- "type": "string"
39
- },
40
- "description": {
41
- "type": "string"
42
- }
43
- },
44
- "required": ["label", "value"]
45
- }
46
- },
47
- "allowMultiple": {
48
- "type": "boolean",
49
- "default": false
50
- },
51
- "allowOther": {
52
- "type": "boolean",
53
- "default": true
54
- },
55
- "context": {
56
- "type": "string"
57
- },
58
- "timeout": {
59
- "type": "number"
60
- }
61
- },
62
- "required": ["question", "options"]
63
- }
64
- }
65
- ],
66
- "config": {
67
- "port": {
68
- "type": "number",
69
- "description": "Port for the dialog server (0 for auto-assign)",
70
- "default": 0
71
- },
72
- "browserPath": {
73
- "type": "string",
74
- "description": "Path to browser executable (optional)",
75
- "required": false
76
- },
77
- "autoOpen": {
78
- "type": "boolean",
79
- "description": "Automatically open browser for dialogs",
80
- "default": true
81
- }
82
- },
83
- "commands": {
84
- "start": "node dist/index.js",
85
- "dev": "tsx src/index.ts",
86
- "build": "tsc",
87
- "test": "tsx src/dialog-manager.test.ts",
88
- "inspector": "npx @modelcontextprotocol/inspector node dist/index.js"
89
- },
90
- "transports": ["stdio"],
91
- "capabilities": {
92
- "tools": true,
93
- "resources": false,
94
- "prompts": false,
95
- "sampling": false
96
- },
97
- "requirements": {
98
- "node": ">=18.0.0",
99
- "npm": ">=8.0.0"
100
- },
101
- "examples": [
102
- {
103
- "name": "Simple Yes/No Question",
104
- "tool": "ask_human",
105
- "arguments": {
106
- "question": "Should I proceed with this action?",
107
- "options": [
108
- {"label": "Yes", "value": "yes"},
109
- {"label": "No", "value": "no"}
110
- ],
111
- "allowMultiple": false,
112
- "allowOther": false
113
- }
114
- },
115
- {
116
- "name": "File Selection",
117
- "tool": "ask_human",
118
- "arguments": {
119
- "question": "Which file should I modify?",
120
- "options": [
121
- {
122
- "label": "index.ts",
123
- "value": "src/index.ts",
124
- "description": "Main entry point"
125
- },
126
- {
127
- "label": "config.json",
128
- "value": "config.json",
129
- "description": "Configuration file"
130
- }
131
- ],
132
- "allowMultiple": false,
133
- "allowOther": true,
134
- "context": "Multiple files match the search criteria"
135
- }
136
- },
137
- {
138
- "name": "Multiple Selection",
139
- "tool": "ask_human",
140
- "arguments": {
141
- "question": "Which tests should I run?",
142
- "options": [
143
- {"label": "Unit tests", "value": "unit"},
144
- {"label": "Integration tests", "value": "integration"},
145
- {"label": "E2E tests", "value": "e2e"}
146
- ],
147
- "allowMultiple": true,
148
- "allowOther": false
149
- }
150
- }
151
- ]
152
- }