@achieveai/hitl-mcp-server 2.2.0 → 2.2.1
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/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/git-context.d.ts +1 -1
- package/dist/git-context.d.ts.map +1 -1
- package/dist/ntfy-transport.d.ts +1 -1
- package/dist/ntfy-transport.d.ts.map +1 -1
- package/dist/types.d.ts +90 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/package.json +1 -2
package/dist/config.d.ts
CHANGED
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAM7C;;;GAGG;AACH,wBAAgB,UAAU,IAAI,UAAU,CAsBvC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,UAAU,CAOlD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAGnD;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
package/dist/config.js
CHANGED
|
@@ -2,7 +2,7 @@ import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs';
|
|
|
2
2
|
import { homedir, hostname } from 'os';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { v4 as uuidv4 } from 'uuid';
|
|
5
|
-
import { DEFAULT_NTFY_URL } from '
|
|
5
|
+
import { DEFAULT_NTFY_URL } from './types.js';
|
|
6
6
|
const CONFIG_DIR = path.join(homedir(), '.hitl');
|
|
7
7
|
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
8
8
|
/**
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACvC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACvC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AAEzD;;;GAGG;AACH,MAAM,UAAU,UAAU;IACxB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CACb,4BAA4B,WAAW,IAAI;YAC3C,oEAAoE;YACpE,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,CAAC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AAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"git-context.d.ts","sourceRoot":"","sources":["../src/git-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAwBlE"}
|
package/dist/ntfy-transport.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ntfy-transport.d.ts","sourceRoot":"","sources":["../src/ntfy-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAe,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ntfy-transport.d.ts","sourceRoot":"","sources":["../src/ntfy-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAe,UAAU,EAAE,MAAM,YAAY,CAAC;AAE1F;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,eAAe,CAAgC;gBAE3C,MAAM,EAAE,UAAU;IAI9B,mCAAmC;IACnC,OAAO,KAAK,QAAQ,GAGnB;IAED;;OAEG;IACG,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAY1D;;;;;;;OAOG;IACG,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAuCjF;;OAEG;IACG,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAYtD;;;OAGG;YACW,gBAAgB;IAyD9B;;OAEG;IACH,KAAK,IAAI,IAAI;CAId"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/** A selectable option presented to the human. */
|
|
2
|
+
export interface DialogOption {
|
|
3
|
+
/** Display label for the option */
|
|
4
|
+
label: string;
|
|
5
|
+
/** Machine-readable value returned on selection */
|
|
6
|
+
value: string;
|
|
7
|
+
/** Optional longer description shown below the label */
|
|
8
|
+
description?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Git repository context auto-detected by the MCP server. */
|
|
11
|
+
export interface RepoContext {
|
|
12
|
+
/** Repository root directory name */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Current branch */
|
|
15
|
+
branch: string;
|
|
16
|
+
/** Remote origin URL (if available) */
|
|
17
|
+
remoteUrl?: string;
|
|
18
|
+
}
|
|
19
|
+
/** Base fields present on every message over the ntfy channel. */
|
|
20
|
+
interface BaseMessage {
|
|
21
|
+
/** Discriminated union tag */
|
|
22
|
+
type: string;
|
|
23
|
+
/** Unique ID for this message */
|
|
24
|
+
messageId: string;
|
|
25
|
+
/** Unix-epoch millis when the message was created */
|
|
26
|
+
timestamp: number;
|
|
27
|
+
}
|
|
28
|
+
/** Published by MCP server when the LLM calls ask_human. */
|
|
29
|
+
export interface QuestionMessage extends BaseMessage {
|
|
30
|
+
type: 'question';
|
|
31
|
+
/** Auto-detected git repo context */
|
|
32
|
+
repo: RepoContext | null;
|
|
33
|
+
/** LLM-provided description of what project/work is being done */
|
|
34
|
+
context: string;
|
|
35
|
+
/** The question to ask the human */
|
|
36
|
+
question: string;
|
|
37
|
+
/** Selectable options */
|
|
38
|
+
options: DialogOption[];
|
|
39
|
+
/** Whether multiple options can be selected */
|
|
40
|
+
allowMultiple: boolean;
|
|
41
|
+
/** Whether a free-text "additional context" field is shown */
|
|
42
|
+
allowOther: boolean;
|
|
43
|
+
/** Timeout in milliseconds (0 = no timeout) */
|
|
44
|
+
timeout?: number;
|
|
45
|
+
}
|
|
46
|
+
/** Published by a client app when the human responds. */
|
|
47
|
+
export interface AnswerMessage extends BaseMessage {
|
|
48
|
+
type: 'answer';
|
|
49
|
+
/** The messageId of the original QuestionMessage */
|
|
50
|
+
questionId: string;
|
|
51
|
+
/** Hostname / device name of the machine that answered */
|
|
52
|
+
respondedFrom: string;
|
|
53
|
+
/** Selected option value(s) */
|
|
54
|
+
selectedValues: string[];
|
|
55
|
+
/** Free-text provided by the user */
|
|
56
|
+
otherText?: string;
|
|
57
|
+
/** Whether the user explicitly skipped */
|
|
58
|
+
skipped: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** Union type for all messages over the ntfy channel. */
|
|
61
|
+
export type HitlMessage = QuestionMessage | AnswerMessage;
|
|
62
|
+
export interface HitlConfig {
|
|
63
|
+
/** ntfy topic ID — a UUID used as the shared channel */
|
|
64
|
+
topicId: string;
|
|
65
|
+
/** ntfy server URL (default: https://ntfy.sh) */
|
|
66
|
+
ntfyUrl: string;
|
|
67
|
+
/** Human-readable name for this device */
|
|
68
|
+
deviceName: string;
|
|
69
|
+
/** Whether to play notification sounds */
|
|
70
|
+
soundEnabled: boolean;
|
|
71
|
+
}
|
|
72
|
+
export declare const DEFAULT_NTFY_URL = "https://ntfy.sh";
|
|
73
|
+
export declare const DEFAULT_CONFIG: Omit<HitlConfig, 'topicId'>;
|
|
74
|
+
export interface HitlToolResponse {
|
|
75
|
+
success: boolean;
|
|
76
|
+
timestamp: number;
|
|
77
|
+
selectedValues?: string | string[];
|
|
78
|
+
context?: string;
|
|
79
|
+
skipped?: boolean;
|
|
80
|
+
response?: string;
|
|
81
|
+
responseType: 'selection' | 'selection_with_context' | 'context_only' | 'skipped' | 'none';
|
|
82
|
+
respondedFrom?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface HitlToolError {
|
|
85
|
+
success: false;
|
|
86
|
+
error: string;
|
|
87
|
+
message: string;
|
|
88
|
+
}
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,kDAAkD;AAClD,MAAM,WAAW,Y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O,EAAE,OAAO,CAAC;CAClB;AAED,yDAAyD;AACzD,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,aAAa,CAAC;AAM1D,MAAM,WAAW,UAAU;IACzB,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,CAItD,CAAC;AAMF,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,WAAW,GAAG,wBAAwB,GAAG,cAAc,GAAG,SAAS,GAAG,MAAM,CAAC;IAC3F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// @hitl/shared — Protocol types for HITL MCP cross-machine messaging
|
|
3
|
+
// ============================================================
|
|
4
|
+
export const DEFAULT_NTFY_URL = 'https://ntfy.sh';
|
|
5
|
+
export const DEFAULT_CONFIG = {
|
|
6
|
+
ntfyUrl: DEFAULT_NTFY_URL,
|
|
7
|
+
deviceName: '',
|
|
8
|
+
soundEnabled: true,
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,qEAAqE;AACrE,+DAA+D;AAwF/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAElD,MAAM,CAAC,MAAM,cAAc,GAAgC;IACzD,OAAO,EAAE,gBAAgB;IACzB,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,IAAI;CACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@achieveai/hitl-mcp-server",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Human-in-the-Loop MCP Server — enables LLM agents to ask questions across all your devices via ntfy.sh",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/mcp-server.js",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"prepublishOnly": "npm run build"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@hitl/shared": "*",
|
|
46
45
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
47
46
|
"eventsource": "^2.0.2",
|
|
48
47
|
"uuid": "^9.0.0"
|