@jaypie/testkit 1.2.4 → 1.2.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.
- package/dist/mock/dynamodb.d.ts +134 -0
- package/dist/mock/index.d.ts +213 -2
- package/dist/mock/index.js +208 -34
- package/dist/mock/index.js.map +1 -1
- package/dist/mock/mock/dynamodb.d.ts +134 -0
- package/dist/mock/mock/index.d.ts +1 -0
- package/dist/mock/mock/vocabulary.d.ts +76 -0
- package/dist/mock/vocabulary.d.ts +76 -0
- package/package.json +6 -1
|
@@ -1,4 +1,19 @@
|
|
|
1
|
+
export declare const STATUS_VALUES: readonly ["canceled", "complete", "error", "pending", "processing", "queued", "sending"];
|
|
2
|
+
export type Status = (typeof STATUS_VALUES)[number];
|
|
3
|
+
export declare const StatusType: ("canceled" | "complete" | "error" | "pending" | "processing" | "queued" | "sending")[];
|
|
4
|
+
export declare function isStatus(value: unknown): value is Status;
|
|
1
5
|
type ServiceHandlerFunction = (input?: Record<string, unknown> | string) => Promise<unknown>;
|
|
6
|
+
interface ServiceHandlerFunctionWithMetadata extends ServiceHandlerFunction {
|
|
7
|
+
alias?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
input?: Record<string, InputFieldDefinition>;
|
|
10
|
+
}
|
|
11
|
+
interface InputFieldDefinition {
|
|
12
|
+
default?: unknown;
|
|
13
|
+
description?: string;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
type: unknown;
|
|
16
|
+
}
|
|
2
17
|
interface LambdaServiceHandlerOptions {
|
|
3
18
|
chaos?: string;
|
|
4
19
|
name?: string;
|
|
@@ -20,4 +35,65 @@ type HandlerFunction = (...args: unknown[]) => unknown;
|
|
|
20
35
|
export declare const lambdaServiceHandler: ((handlerOrConfig: ServiceHandlerFunction | LambdaServiceHandlerConfig, options?: LambdaServiceHandlerOptions) => HandlerFunction) & {
|
|
21
36
|
mock: any;
|
|
22
37
|
};
|
|
38
|
+
interface LlmTool {
|
|
39
|
+
call: (args?: Record<string, unknown>) => Promise<unknown> | unknown;
|
|
40
|
+
description: string;
|
|
41
|
+
message?: string | ((args?: Record<string, unknown>, context?: {
|
|
42
|
+
name: string;
|
|
43
|
+
}) => Promise<string> | string);
|
|
44
|
+
name: string;
|
|
45
|
+
parameters: Record<string, unknown>;
|
|
46
|
+
type: "function" | string;
|
|
47
|
+
}
|
|
48
|
+
interface CreateLlmToolConfig {
|
|
49
|
+
description?: string;
|
|
50
|
+
exclude?: string[];
|
|
51
|
+
handler: ServiceHandlerFunctionWithMetadata;
|
|
52
|
+
message?: string | ((args?: Record<string, unknown>) => string);
|
|
53
|
+
name?: string;
|
|
54
|
+
}
|
|
55
|
+
interface CreateLlmToolResult {
|
|
56
|
+
tool: LlmTool;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Mock implementation of createLlmTool
|
|
60
|
+
* Creates an LLM tool from a vocabulary service handler
|
|
61
|
+
*/
|
|
62
|
+
export declare const createLlmTool: ((config: CreateLlmToolConfig) => CreateLlmToolResult) & {
|
|
63
|
+
mock: any;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Mock implementation of inputToJsonSchema
|
|
67
|
+
* Converts vocabulary input definitions to JSON Schema
|
|
68
|
+
*/
|
|
69
|
+
export declare const inputToJsonSchema: ((input?: Record<string, InputFieldDefinition>, options?: {
|
|
70
|
+
exclude?: string[];
|
|
71
|
+
}) => Record<string, unknown>) & {
|
|
72
|
+
mock: any;
|
|
73
|
+
};
|
|
74
|
+
interface McpToolResponse {
|
|
75
|
+
content: Array<{
|
|
76
|
+
text: string;
|
|
77
|
+
type: "text";
|
|
78
|
+
}>;
|
|
79
|
+
}
|
|
80
|
+
interface McpServer {
|
|
81
|
+
tool: (name: string, description: string, schema: Record<string, unknown>, handler: (args: Record<string, unknown>) => Promise<McpToolResponse>) => void;
|
|
82
|
+
}
|
|
83
|
+
interface RegisterMcpToolConfig {
|
|
84
|
+
description?: string;
|
|
85
|
+
handler: ServiceHandlerFunctionWithMetadata;
|
|
86
|
+
name?: string;
|
|
87
|
+
server: McpServer;
|
|
88
|
+
}
|
|
89
|
+
interface RegisterMcpToolResult {
|
|
90
|
+
name: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Mock implementation of registerMcpTool
|
|
94
|
+
* Registers a vocabulary service handler as an MCP tool
|
|
95
|
+
*/
|
|
96
|
+
export declare const registerMcpTool: ((config: RegisterMcpToolConfig) => RegisterMcpToolResult) & {
|
|
97
|
+
mock: any;
|
|
98
|
+
};
|
|
23
99
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaypie/testkit",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/finlaysonstudio/jaypie.git"
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"uuid": "^11.0.5"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
+
"@jaypie/dynamodb": "*",
|
|
42
43
|
"@jaypie/types": "*",
|
|
43
44
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
44
45
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -55,12 +56,16 @@
|
|
|
55
56
|
"vitest": "^3.0.5"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
59
|
+
"@jaypie/dynamodb": ">=0.1.0",
|
|
58
60
|
"@jaypie/errors": "^1.2.1",
|
|
59
61
|
"@jaypie/kit": "^1.2.1",
|
|
60
62
|
"@jaypie/logger": "^1.2.1",
|
|
61
63
|
"vitest": ">=1.0.0"
|
|
62
64
|
},
|
|
63
65
|
"peerDependenciesMeta": {
|
|
66
|
+
"@jaypie/dynamodb": {
|
|
67
|
+
"optional": true
|
|
68
|
+
},
|
|
64
69
|
"@jaypie/errors": {
|
|
65
70
|
"optional": true
|
|
66
71
|
},
|