mock-mcp 0.3.0 → 0.5.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.
- package/README.md +217 -128
- package/dist/adapter/index.cjs +712 -0
- package/dist/adapter/index.d.cts +55 -0
- package/dist/adapter/index.d.ts +55 -0
- package/dist/adapter/index.js +672 -0
- package/dist/client/connect.cjs +913 -0
- package/dist/client/connect.d.cts +211 -0
- package/dist/client/connect.d.ts +209 -6
- package/dist/client/connect.js +867 -10
- package/dist/client/index.cjs +914 -0
- package/dist/client/index.d.cts +4 -0
- package/dist/client/index.d.ts +4 -2
- package/dist/client/index.js +873 -2
- package/dist/daemon/index.cjs +667 -0
- package/dist/daemon/index.d.cts +62 -0
- package/dist/daemon/index.d.ts +62 -0
- package/dist/daemon/index.js +628 -0
- package/dist/discovery-Dc2LdF8q.d.cts +105 -0
- package/dist/discovery-Dc2LdF8q.d.ts +105 -0
- package/dist/index.cjs +2238 -0
- package/dist/index.d.cts +472 -0
- package/dist/index.d.ts +472 -10
- package/dist/index.js +2185 -53
- package/dist/protocol-CiwaQFOt.d.ts +239 -0
- package/dist/protocol-xZu-wb0n.d.cts +239 -0
- package/dist/shared/index.cjs +386 -0
- package/dist/shared/index.d.cts +4 -0
- package/dist/shared/index.d.ts +4 -0
- package/dist/shared/index.js +310 -0
- package/dist/types-BKREdsyr.d.cts +32 -0
- package/dist/types-BKREdsyr.d.ts +32 -0
- package/package.json +44 -4
- package/dist/client/batch-mock-collector.d.ts +0 -87
- package/dist/client/batch-mock-collector.js +0 -223
- package/dist/client/util.d.ts +0 -1
- package/dist/client/util.js +0 -3
- package/dist/connect.cjs +0 -299
- package/dist/connect.d.cts +0 -95
- package/dist/server/index.d.ts +0 -1
- package/dist/server/index.js +0 -1
- package/dist/server/test-mock-mcp-server.d.ts +0 -73
- package/dist/server/test-mock-mcp-server.js +0 -392
- package/dist/types.d.ts +0 -42
- package/dist/types.js +0 -2
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { N as GetStatusResult, O as ListRunsResult, I as ClaimNextBatchResult, K as ProvideBatchResult, S as GetBatchResult } from '../protocol-xZu-wb0n.cjs';
|
|
2
|
+
import { a as MockResponseDescriptor } from '../types-BKREdsyr.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* MCP Adapter - The MCP stdio server that bridges AI clients to the Daemon.
|
|
6
|
+
*
|
|
7
|
+
* Each MCP client (Cursor, Claude Desktop, etc.) spawns one Adapter process.
|
|
8
|
+
* The Adapter:
|
|
9
|
+
* - Exposes MCP tools (claim_next_batch, provide_batch_mock_data, get_status)
|
|
10
|
+
* - Connects to the Daemon via IPC
|
|
11
|
+
* - Does NOT bind any ports (avoids conflicts)
|
|
12
|
+
*/
|
|
13
|
+
type Logger = Pick<Console, "log" | "warn" | "error"> & {
|
|
14
|
+
debug?: (...args: unknown[]) => void;
|
|
15
|
+
};
|
|
16
|
+
interface AdapterOptions {
|
|
17
|
+
logger?: Logger;
|
|
18
|
+
version?: string;
|
|
19
|
+
}
|
|
20
|
+
declare function runAdapter(opts?: AdapterOptions): Promise<void>;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Daemon Client - HTTP/JSON-RPC client for communicating with the Daemon.
|
|
24
|
+
*
|
|
25
|
+
* Used by the MCP Adapter to call daemon RPC methods.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
declare class DaemonClient {
|
|
29
|
+
private readonly ipcPath;
|
|
30
|
+
private readonly token;
|
|
31
|
+
private readonly adapterId;
|
|
32
|
+
constructor(ipcPath: string, token: string, adapterId: string);
|
|
33
|
+
getStatus(): Promise<GetStatusResult>;
|
|
34
|
+
listRuns(): Promise<ListRunsResult>;
|
|
35
|
+
claimNextBatch(args: {
|
|
36
|
+
runId?: string;
|
|
37
|
+
leaseMs?: number;
|
|
38
|
+
}): Promise<ClaimNextBatchResult | null>;
|
|
39
|
+
provideBatch(args: {
|
|
40
|
+
batchId: string;
|
|
41
|
+
claimToken: string;
|
|
42
|
+
mocks: MockResponseDescriptor[];
|
|
43
|
+
}): Promise<ProvideBatchResult>;
|
|
44
|
+
releaseBatch(args: {
|
|
45
|
+
batchId: string;
|
|
46
|
+
claimToken: string;
|
|
47
|
+
reason?: string;
|
|
48
|
+
}): Promise<{
|
|
49
|
+
ok: boolean;
|
|
50
|
+
}>;
|
|
51
|
+
getBatch(batchId: string): Promise<GetBatchResult>;
|
|
52
|
+
private rpc;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { type AdapterOptions, DaemonClient, runAdapter };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { N as GetStatusResult, O as ListRunsResult, I as ClaimNextBatchResult, K as ProvideBatchResult, S as GetBatchResult } from '../protocol-CiwaQFOt.js';
|
|
2
|
+
import { a as MockResponseDescriptor } from '../types-BKREdsyr.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* MCP Adapter - The MCP stdio server that bridges AI clients to the Daemon.
|
|
6
|
+
*
|
|
7
|
+
* Each MCP client (Cursor, Claude Desktop, etc.) spawns one Adapter process.
|
|
8
|
+
* The Adapter:
|
|
9
|
+
* - Exposes MCP tools (claim_next_batch, provide_batch_mock_data, get_status)
|
|
10
|
+
* - Connects to the Daemon via IPC
|
|
11
|
+
* - Does NOT bind any ports (avoids conflicts)
|
|
12
|
+
*/
|
|
13
|
+
type Logger = Pick<Console, "log" | "warn" | "error"> & {
|
|
14
|
+
debug?: (...args: unknown[]) => void;
|
|
15
|
+
};
|
|
16
|
+
interface AdapterOptions {
|
|
17
|
+
logger?: Logger;
|
|
18
|
+
version?: string;
|
|
19
|
+
}
|
|
20
|
+
declare function runAdapter(opts?: AdapterOptions): Promise<void>;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Daemon Client - HTTP/JSON-RPC client for communicating with the Daemon.
|
|
24
|
+
*
|
|
25
|
+
* Used by the MCP Adapter to call daemon RPC methods.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
declare class DaemonClient {
|
|
29
|
+
private readonly ipcPath;
|
|
30
|
+
private readonly token;
|
|
31
|
+
private readonly adapterId;
|
|
32
|
+
constructor(ipcPath: string, token: string, adapterId: string);
|
|
33
|
+
getStatus(): Promise<GetStatusResult>;
|
|
34
|
+
listRuns(): Promise<ListRunsResult>;
|
|
35
|
+
claimNextBatch(args: {
|
|
36
|
+
runId?: string;
|
|
37
|
+
leaseMs?: number;
|
|
38
|
+
}): Promise<ClaimNextBatchResult | null>;
|
|
39
|
+
provideBatch(args: {
|
|
40
|
+
batchId: string;
|
|
41
|
+
claimToken: string;
|
|
42
|
+
mocks: MockResponseDescriptor[];
|
|
43
|
+
}): Promise<ProvideBatchResult>;
|
|
44
|
+
releaseBatch(args: {
|
|
45
|
+
batchId: string;
|
|
46
|
+
claimToken: string;
|
|
47
|
+
reason?: string;
|
|
48
|
+
}): Promise<{
|
|
49
|
+
ok: boolean;
|
|
50
|
+
}>;
|
|
51
|
+
getBatch(batchId: string): Promise<GetBatchResult>;
|
|
52
|
+
private rpc;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { type AdapterOptions, DaemonClient, runAdapter };
|