@achieveai/hitl-mcp-server 1.2.0 → 2.1.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 (58) 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/mcp-server.js +237 -0
  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 +43 -0
  22. package/dist/setup.d.ts.map +1 -0
  23. package/dist/setup.js +184 -0
  24. package/dist/setup.js.map +1 -0
  25. package/package.json +61 -63
  26. package/scripts/postinstall.js +33 -0
  27. package/LICENSE +0 -20
  28. package/README.md +0 -422
  29. package/config/claude-desktop.json +0 -11
  30. package/config/cursor-mcp.json +0 -17
  31. package/config/vscode-mcp.json +0 -17
  32. package/dist/__tests__/dialog-manager.test.d.ts +0 -2
  33. package/dist/__tests__/dialog-manager.test.d.ts.map +0 -1
  34. package/dist/__tests__/dialog-manager.test.js +0 -140
  35. package/dist/__tests__/dialog-manager.test.js.map +0 -1
  36. package/dist/dialog-manager.d.ts +0 -37
  37. package/dist/dialog-manager.d.ts.map +0 -1
  38. package/dist/dialog-manager.js +0 -644
  39. package/dist/dialog-manager.js.map +0 -1
  40. package/dist/dialog-manager.test.d.ts +0 -2
  41. package/dist/dialog-manager.test.d.ts.map +0 -1
  42. package/dist/dialog-manager.test.js +0 -156
  43. package/dist/dialog-manager.test.js.map +0 -1
  44. package/dist/index.d.ts +0 -3
  45. package/dist/index.d.ts.map +0 -1
  46. package/dist/index.js +0 -222
  47. package/dist/index.js.map +0 -1
  48. package/dist/test-client.d.ts +0 -3
  49. package/dist/test-client.d.ts.map +0 -1
  50. package/dist/test-client.js +0 -125
  51. package/dist/test-client.js.map +0 -1
  52. package/dist/test-dialog-manager.d.ts +0 -2
  53. package/dist/test-dialog-manager.d.ts.map +0 -1
  54. package/dist/test-dialog-manager.js +0 -156
  55. package/dist/test-dialog-manager.js.map +0 -1
  56. package/example-usage.md +0 -223
  57. package/mcp.json +0 -152
  58. package/sounds/notification.wav +0 -0
@@ -1,156 +0,0 @@
1
- // Simple test to verify the dialog manager works
2
- import { DialogManager } from './dialog-manager.js';
3
- async function runTests() {
4
- console.log('Starting DialogManager tests...\n');
5
- const manager = new DialogManager();
6
- let testsPassed = 0;
7
- let testsFailed = 0;
8
- // Test 1: Initialization
9
- try {
10
- const port = await manager.initialize();
11
- console.log('✓ Test 1 - Initialization: Server started on port', port);
12
- testsPassed++;
13
- }
14
- catch (error) {
15
- console.error('✗ Test 1 - Initialization failed:', error);
16
- testsFailed++;
17
- }
18
- // Test 2: HTML generation with XSS protection
19
- try {
20
- const html = manager.generateDialogHTML({
21
- id: 'test',
22
- question: '<script>alert("XSS")</script>',
23
- options: [
24
- {
25
- label: '<b>Bold</b>',
26
- value: 'test',
27
- description: '"Quotes" & \'apostrophes\''
28
- }
29
- ],
30
- allowMultiple: false,
31
- allowOther: true
32
- });
33
- if (html.includes('<script>alert') || html.includes('<b>Bold</b>')) {
34
- throw new Error('XSS protection failed');
35
- }
36
- if (!html.includes('&lt;script&gt;') || !html.includes('&lt;b&gt;')) {
37
- throw new Error('HTML should be escaped');
38
- }
39
- console.log('✓ Test 2 - XSS Protection: HTML properly escaped');
40
- testsPassed++;
41
- }
42
- catch (error) {
43
- console.error('✗ Test 2 - XSS Protection failed:', error);
44
- testsFailed++;
45
- }
46
- // Test 3: Radio vs Checkbox rendering
47
- try {
48
- const radioHtml = manager.generateDialogHTML({
49
- id: 'test',
50
- question: 'Choose one',
51
- options: [
52
- { label: 'A', value: 'a' },
53
- { label: 'B', value: 'b' }
54
- ],
55
- allowMultiple: false,
56
- allowOther: false
57
- });
58
- const checkboxHtml = manager.generateDialogHTML({
59
- id: 'test',
60
- question: 'Choose many',
61
- options: [
62
- { label: 'A', value: 'a' },
63
- { label: 'B', value: 'b' }
64
- ],
65
- allowMultiple: true,
66
- allowOther: false
67
- });
68
- if (!radioHtml.includes('type="radio"') || radioHtml.includes('type="checkbox"')) {
69
- throw new Error('Single choice should use radio buttons');
70
- }
71
- if (!checkboxHtml.includes('type="checkbox"') || checkboxHtml.includes('type="radio"')) {
72
- throw new Error('Multiple choice should use checkboxes');
73
- }
74
- console.log('✓ Test 3 - Input Types: Correct radio/checkbox rendering');
75
- testsPassed++;
76
- }
77
- catch (error) {
78
- console.error('✗ Test 3 - Input Types failed:', error);
79
- testsFailed++;
80
- }
81
- // Test 4: Other field inclusion
82
- try {
83
- const withOther = manager.generateDialogHTML({
84
- id: 'test',
85
- question: 'Choose',
86
- options: [{ label: 'A', value: 'a' }],
87
- allowMultiple: false,
88
- allowOther: true
89
- });
90
- const withoutOther = manager.generateDialogHTML({
91
- id: 'test',
92
- question: 'Choose',
93
- options: [{ label: 'A', value: 'a' }],
94
- allowMultiple: false,
95
- allowOther: false
96
- });
97
- if (!withOther.includes('other-input')) {
98
- throw new Error('Should include other field when allowed');
99
- }
100
- if (withoutOther.includes('Other (please specify)')) {
101
- throw new Error('Should not include other field when not allowed');
102
- }
103
- console.log('✓ Test 4 - Other Field: Correctly included/excluded');
104
- testsPassed++;
105
- }
106
- catch (error) {
107
- console.error('✗ Test 4 - Other Field failed:', error);
108
- testsFailed++;
109
- }
110
- // Test 5: Context inclusion
111
- try {
112
- const withContext = manager.generateDialogHTML({
113
- id: 'test',
114
- question: 'Test question',
115
- options: [{ label: 'Option 1', value: 'opt1' }],
116
- allowMultiple: false,
117
- allowOther: false,
118
- context: 'Important context information'
119
- });
120
- const withoutContext = manager.generateDialogHTML({
121
- id: 'test',
122
- question: 'Test question',
123
- options: [{ label: 'Option 1', value: 'opt1' }],
124
- allowMultiple: false,
125
- allowOther: false
126
- });
127
- if (!withContext.includes('Important context information')) {
128
- throw new Error('Should include context when provided');
129
- }
130
- if (withoutContext.includes('Context:')) {
131
- throw new Error('Should not include context section when not provided');
132
- }
133
- console.log('✓ Test 5 - Context: Correctly included/excluded');
134
- testsPassed++;
135
- }
136
- catch (error) {
137
- console.error('✗ Test 5 - Context failed:', error);
138
- testsFailed++;
139
- }
140
- // Cleanup
141
- await manager.close();
142
- // Summary
143
- console.log(`\n========== Test Summary ==========`);
144
- console.log(`Passed: ${testsPassed}`);
145
- console.log(`Failed: ${testsFailed}`);
146
- console.log(`Total: ${testsPassed + testsFailed}`);
147
- if (testsFailed > 0) {
148
- process.exit(1);
149
- }
150
- }
151
- // Run tests
152
- runTests().catch(error => {
153
- console.error('Test suite failed:', error);
154
- process.exit(1);
155
- });
156
- //# sourceMappingURL=test-dialog-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-dialog-manager.js","sourceRoot":"","sources":["../src/test-dialog-manager.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,KAAK,UAAU,QAAQ;IACrB,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IAEjD,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;IACpC,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAI,WAAW,GAAG,CAAC,CAAC;IAEpB,yBAAyB;IACzB,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,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CAAC,CAAC,CAAC"}
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
- }
Binary file