wopee-mcp 1.4.0 → 1.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.
@@ -1,26 +1,14 @@
1
+ import { wopeeFetchFile } from "./wopee_fetch_file/index.js";
1
2
  import { wopeeUpdateFile } from "./wopee_update_file/index.js";
3
+ import { wopeeGenerateFile } from "./wopee_generate_file/index.js";
2
4
  import { wopeeDispatchAgent } from "./wopee_dispatch_agent/index.js";
3
- import { wopeeFetchTestCases } from "./wopee_fetch_test_cases/index.js";
4
- import { wopeeFetchAppContext } from "./wopee_fetch_app_context/index.js";
5
5
  import { wopeeDispatchAnalysis } from "./wopee_dispatch_analysis/index.js";
6
- import { wopeeFetchUserStories } from "./wopee_fetch_user_stories/index.js";
7
- import { wopeeGenerateTestCases } from "./wopee_generate_test_cases/index.js";
8
- import { wopeeGenerateAppContext } from "./wopee_generate_app_context/index.js";
9
6
  import { wopeeFetchAnalysisSuites } from "./wopee_fetch_analysis_suites/index.js";
10
- import { wopeeGenerateUserStories } from "./wopee_generate_user_stories/index.js";
11
- import { wopeeFetchGeneralUserStories } from "./wopee_fetch_general_user_stories/index.js";
12
- import { wopeeGenerateGeneralUserStories } from "./wopee_generate_general_user_stories/index.js";
13
7
  export const TOOLS = [
8
+ wopeeFetchAnalysisSuites,
14
9
  wopeeDispatchAnalysis,
15
10
  wopeeDispatchAgent,
16
- wopeeGenerateAppContext,
17
- wopeeGenerateGeneralUserStories,
18
- wopeeGenerateUserStories,
19
- wopeeGenerateTestCases,
20
- wopeeFetchAnalysisSuites,
21
- wopeeFetchAppContext,
22
- wopeeFetchGeneralUserStories,
23
- wopeeFetchUserStories,
24
- wopeeFetchTestCases,
11
+ wopeeFetchFile,
25
12
  wopeeUpdateFile,
13
+ wopeeGenerateFile,
26
14
  ];
@@ -38,6 +38,6 @@ export const createUpdateFileInput = (input) => {
38
38
  bucket: input.bucket,
39
39
  projectUuid: WOPEE_PROJECT_UUID,
40
40
  suiteUuid: input.suiteUuid,
41
- [input.type === "markdown" ? "code" : "json"]: input.fileContent,
41
+ [input.outputType === "markdown" ? "code" : "json"]: input.fileContent,
42
42
  };
43
43
  };
@@ -28,7 +28,7 @@ function parseFileType(type) {
28
28
  query: GenerateAppContext,
29
29
  dataKey: "generateAppContext",
30
30
  bucket: Bucket.APP_CONTEXT,
31
- type: "markdown",
31
+ outputType: "markdown",
32
32
  description: "application's context markdown file for selected suite",
33
33
  };
34
34
  case FileType.GENERAL_USER_STORIES:
@@ -36,7 +36,7 @@ function parseFileType(type) {
36
36
  query: GenerateGeneralUserStories,
37
37
  dataKey: "generateGeneralUserStories",
38
38
  bucket: Bucket.GENERAL_USER_STORIES,
39
- type: "markdown",
39
+ outputType: "markdown",
40
40
  description: "general user stories markdown file for selected suite",
41
41
  };
42
42
  case FileType.USER_STORIES:
@@ -44,7 +44,7 @@ function parseFileType(type) {
44
44
  query: GenerateUserStories,
45
45
  dataKey: "generateUserStories",
46
46
  bucket: Bucket.USER_STORIES,
47
- type: "json",
47
+ outputType: "json",
48
48
  description: "user stories JSON file for selected suite",
49
49
  };
50
50
  case FileType.TEST_CASES:
@@ -52,7 +52,7 @@ function parseFileType(type) {
52
52
  query: GenerateTestCases,
53
53
  dataKey: "generateTestCases",
54
54
  bucket: Bucket.USER_STORIES,
55
- type: "json",
55
+ outputType: "json",
56
56
  description: "test cases for selected suite",
57
57
  };
58
58
  default:
@@ -60,14 +60,27 @@ function parseFileType(type) {
60
60
  query: null,
61
61
  dataKey: null,
62
62
  bucket: null,
63
- type: null,
63
+ outputType: null,
64
64
  description: null,
65
65
  };
66
66
  }
67
67
  }
68
68
  export async function fetchFile(input) {
69
69
  try {
70
- const fetchFileInput = createFetchFileInput(input);
70
+ const { bucket, description } = parseFileType(input.fileType);
71
+ if (!bucket || !description)
72
+ return {
73
+ content: [
74
+ {
75
+ type: "text",
76
+ text: "Failed to parse file type",
77
+ },
78
+ ],
79
+ };
80
+ const fetchFileInput = createFetchFileInput({
81
+ bucket,
82
+ suiteUuid: input.suiteUuid,
83
+ });
71
84
  const parsedInput = FetchFileInputSchema.parse(fetchFileInput);
72
85
  const result = await requestClient(FetchFile, parsedInput);
73
86
  if (!result || !result.fetchFile)
@@ -92,8 +105,8 @@ export async function fetchFile(input) {
92
105
  return parseError(error);
93
106
  }
94
107
  }
95
- export async function generateAIDataFile(type, input) {
96
- const { query, dataKey, bucket, description } = parseFileType(type);
108
+ export async function generateAIDataFile(input) {
109
+ const { query, dataKey, bucket, description } = parseFileType(input.fileType);
97
110
  if (!query || !dataKey || !description || !bucket)
98
111
  return {
99
112
  content: [
@@ -120,7 +133,7 @@ export async function generateAIDataFile(type, input) {
120
133
  };
121
134
  return await fetchFile({
122
135
  suiteUuid: parsedInput.suiteUuid,
123
- bucket,
136
+ fileType: input.fileType,
124
137
  });
125
138
  }
126
139
  catch (error) {
@@ -129,8 +142,8 @@ export async function generateAIDataFile(type, input) {
129
142
  }
130
143
  export async function updateFile(input) {
131
144
  try {
132
- const { bucket, type } = parseFileType(input.fileType);
133
- if (!bucket || !type)
145
+ const { bucket, outputType } = parseFileType(input.fileType);
146
+ if (!bucket || !outputType)
134
147
  return {
135
148
  content: [
136
149
  {
@@ -140,8 +153,8 @@ export async function updateFile(input) {
140
153
  ],
141
154
  };
142
155
  const updateFileInput = createUpdateFileInput({
143
- type,
144
156
  bucket,
157
+ outputType,
145
158
  suiteUuid: input.suiteUuid,
146
159
  fileContent: input.fileContent,
147
160
  });
@@ -15,8 +15,11 @@ export const SuiteAnalysisConfigSchema = z.object({
15
15
  additionalVariables: z.string().nullable().default(null),
16
16
  });
17
17
  export const GenerateAIDataHandlerInputSchema = z.object({
18
+ fileType: z.nativeEnum(FileType, {
19
+ description: "Chosen type of file(artifact) to generate",
20
+ }),
18
21
  suiteUuid: z
19
- .string({ description: "UUID of the suite to generate AI data for" })
22
+ .string({ description: "UUID of the suite to generate file(artifact) for" })
20
23
  .min(1, "Suite UUID is required"),
21
24
  });
22
25
  export const GenerateAIDataInputSchema = z.object({
@@ -29,6 +32,9 @@ export const GenerateAIDataInputSchema = z.object({
29
32
  continueGeneration: z.boolean().nullish().default(false),
30
33
  });
31
34
  export const FetchFileHandlerInputSchema = z.object({
35
+ fileType: z.nativeEnum(FileType, {
36
+ description: "Chosen file(artifact) to fetch",
37
+ }),
32
38
  suiteUuid: z
33
39
  .string({ description: "UUID of the suite to fetch the file from" })
34
40
  .min(1, "Suite UUID is required"),
@@ -44,10 +50,10 @@ export const FetchFileInputSchema = z.object({
44
50
  });
45
51
  export const UpdateFileHandlerInputSchema = z.object({
46
52
  fileType: z.nativeEnum(FileType, {
47
- description: "Chosen file/artifact to update",
53
+ description: "Chosen file(artifact) to update",
48
54
  }),
49
55
  fileContent: z.string({
50
- description: "Content of the file/artifact to update",
56
+ description: "Content of the file(artifact) to update",
51
57
  }),
52
58
  suiteUuid: z
53
59
  .string({ description: "UUID of the suite to update the file for" })
@@ -57,7 +63,7 @@ export const UpdateFileFactoryInputSchema = z.object({
57
63
  bucket: z.nativeEnum(Bucket),
58
64
  suiteUuid: z.string().min(1, "Suite UUID is required"),
59
65
  fileContent: z.string(),
60
- type: z.enum(["markdown", "json"]),
66
+ outputType: z.enum(["markdown", "json"]),
61
67
  });
62
68
  export const UpdateFileInputSchema = z.object({
63
69
  projectUuid: z.string().min(1, "Project UUID is required"),
@@ -1,17 +1,11 @@
1
1
  export var ToolName;
2
2
  (function (ToolName) {
3
+ ToolName["WOPEE_FETCH_ANALYSIS_SUITES"] = "wopee_fetch_analysis_suites";
3
4
  ToolName["WOPEE_DISPATCH_ANALYSIS"] = "wopee_dispatch_analysis";
4
5
  ToolName["WOPEE_DISPATCH_AGENT"] = "wopee_dispatch_agent";
5
- ToolName["WOPEE_FETCH_ANALYSIS_SUITES"] = "wopee_fetch_analysis_suites";
6
- ToolName["WOPEE_FETCH_APP_CONTEXT"] = "wopee_fetch_app_context";
7
- ToolName["WOPEE_FETCH_GENERAL_USER_STORIES"] = "wopee_fetch_general_user_stories";
8
- ToolName["WOPEE_FETCH_USER_STORIES"] = "wopee_fetch_user_stories";
9
- ToolName["WOPEE_FETCH_TEST_CASES"] = "wopee_fetch_test_cases";
10
- ToolName["WOPEE_GENERATE_APP_CONTEXT"] = "wopee_generate_app_context";
11
- ToolName["WOPEE_GENERATE_GENERAL_USER_STORIES"] = "wopee_generate_general_user_stories";
12
- ToolName["WOPEE_GENERATE_USER_STORIES"] = "wopee_generate_user_stories";
13
- ToolName["WOPEE_GENERATE_TEST_CASES"] = "wopee_generate_test_cases";
6
+ ToolName["WOPEE_FETCH_FILE"] = "wopee_fetch_file";
14
7
  ToolName["WOPEE_UPDATE_FILE"] = "wopee_update_file";
8
+ ToolName["WOPEE_GENERATE_FILE"] = "wopee_generate_file";
15
9
  })(ToolName || (ToolName = {}));
16
10
  export const Bucket = {
17
11
  APP_CONTEXT: "project-suite-app-context",
@@ -0,0 +1,12 @@
1
+ import { FetchFileHandlerInputSchema, } from "../shared/schemas.js";
2
+ import { ToolName } from "../shared/types.js";
3
+ import { fetchFile } from "../shared/handlers.js";
4
+ export const wopeeFetchFile = {
5
+ name: ToolName.WOPEE_FETCH_FILE,
6
+ config: {
7
+ title: "Fetch file(artifact)",
8
+ description: "Fetch suite's file(artifact) for selected project",
9
+ inputSchema: FetchFileHandlerInputSchema.shape,
10
+ },
11
+ handler: async (input) => await fetchFile(input),
12
+ };
@@ -0,0 +1,12 @@
1
+ import { GenerateAIDataHandlerInputSchema, } from "../shared/schemas.js";
2
+ import { ToolName } from "../shared/types.js";
3
+ import { generateAIDataFile } from "../shared/handlers.js";
4
+ export const wopeeGenerateFile = {
5
+ name: ToolName.WOPEE_GENERATE_FILE,
6
+ config: {
7
+ title: "Generate file(artifact)",
8
+ description: "Generate AI data file for selected suite",
9
+ inputSchema: GenerateAIDataHandlerInputSchema.shape,
10
+ },
11
+ handler: async (input) => await generateAIDataFile(input),
12
+ };
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "bin": {
5
5
  "wopee-mcp": "./build/index.js"
6
6
  },
7
- "version": "1.4.0",
7
+ "version": "1.5.0",
8
8
  "description": "Wopee.io MCP server",
9
9
  "main": "./build/index.js",
10
10
  "scripts": {
@@ -1,15 +0,0 @@
1
- import { FetchFileHandlerInputSchema, } from "../shared/schemas.js";
2
- import { fetchFile } from "../shared/handlers.js";
3
- import { Bucket, ToolName } from "../shared/types.js";
4
- export const wopeeFetchAppContext = {
5
- name: ToolName.WOPEE_FETCH_APP_CONTEXT,
6
- config: {
7
- title: "Fetch app context",
8
- description: "Fetch suite's application context markdown file for selected project",
9
- inputSchema: FetchFileHandlerInputSchema.shape,
10
- },
11
- handler: async (input) => await fetchFile({
12
- ...input,
13
- bucket: Bucket.APP_CONTEXT,
14
- }),
15
- };
@@ -1,15 +0,0 @@
1
- import { FetchFileHandlerInputSchema, } from "../shared/schemas.js";
2
- import { fetchFile } from "../shared/handlers.js";
3
- import { Bucket, ToolName } from "../shared/types.js";
4
- export const wopeeFetchGeneralUserStories = {
5
- name: ToolName.WOPEE_FETCH_GENERAL_USER_STORIES,
6
- config: {
7
- title: "Fetch general user stories",
8
- description: "Fetch suite's general user stories markdown file for selected project",
9
- inputSchema: FetchFileHandlerInputSchema.shape,
10
- },
11
- handler: async (input) => await fetchFile({
12
- ...input,
13
- bucket: Bucket.GENERAL_USER_STORIES,
14
- }),
15
- };
@@ -1,15 +0,0 @@
1
- import { FetchFileHandlerInputSchema, } from "../shared/schemas.js";
2
- import { fetchFile } from "../shared/handlers.js";
3
- import { Bucket, ToolName } from "../shared/types.js";
4
- export const wopeeFetchTestCases = {
5
- name: ToolName.WOPEE_FETCH_TEST_CASES,
6
- config: {
7
- title: "Fetch test cases",
8
- description: "Fetch suite's test cases JSON file for selected project",
9
- inputSchema: FetchFileHandlerInputSchema.shape,
10
- },
11
- handler: async (input) => await fetchFile({
12
- ...input,
13
- bucket: Bucket.USER_STORIES,
14
- }),
15
- };
@@ -1,15 +0,0 @@
1
- import { FetchFileHandlerInputSchema, } from "../shared/schemas.js";
2
- import { fetchFile } from "../shared/handlers.js";
3
- import { Bucket, ToolName } from "../shared/types.js";
4
- export const wopeeFetchUserStories = {
5
- name: ToolName.WOPEE_FETCH_USER_STORIES,
6
- config: {
7
- title: "Fetch user stories",
8
- description: "Fetch suite's user stories JSON file for selected project",
9
- inputSchema: FetchFileHandlerInputSchema.shape,
10
- },
11
- handler: async (input) => await fetchFile({
12
- ...input,
13
- bucket: Bucket.USER_STORIES,
14
- }),
15
- };
@@ -1,12 +0,0 @@
1
- import { GenerateAIDataHandlerInputSchema, } from "../shared/schemas.js";
2
- import { FileType, ToolName } from "../shared/types.js";
3
- import { generateAIDataFile } from "../shared/handlers.js";
4
- export const wopeeGenerateAppContext = {
5
- name: ToolName.WOPEE_GENERATE_APP_CONTEXT,
6
- config: {
7
- title: "Generate app context",
8
- description: "Generate application's context markdown file for selected suite",
9
- inputSchema: GenerateAIDataHandlerInputSchema.shape,
10
- },
11
- handler: async (input) => await generateAIDataFile(FileType.APP_CONTEXT, input),
12
- };
@@ -1,12 +0,0 @@
1
- import { GenerateAIDataHandlerInputSchema, } from "../shared/schemas.js";
2
- import { FileType, ToolName } from "../shared/types.js";
3
- import { generateAIDataFile } from "../shared/handlers.js";
4
- export const wopeeGenerateGeneralUserStories = {
5
- name: ToolName.WOPEE_GENERATE_GENERAL_USER_STORIES,
6
- config: {
7
- title: "Generate general user stories",
8
- description: "Generate general user stories markdown file for selected suite",
9
- inputSchema: GenerateAIDataHandlerInputSchema.shape,
10
- },
11
- handler: async (input) => await generateAIDataFile(FileType.GENERAL_USER_STORIES, input),
12
- };
@@ -1,12 +0,0 @@
1
- import { GenerateAIDataHandlerInputSchema, } from "../shared/schemas.js";
2
- import { FileType, ToolName } from "../shared/types.js";
3
- import { generateAIDataFile } from "../shared/handlers.js";
4
- export const wopeeGenerateTestCases = {
5
- name: ToolName.WOPEE_GENERATE_TEST_CASES,
6
- config: {
7
- title: "Generate test cases",
8
- description: "Generate test cases for selected suite",
9
- inputSchema: GenerateAIDataHandlerInputSchema.shape,
10
- },
11
- handler: async (input) => await generateAIDataFile(FileType.TEST_CASES, input),
12
- };
@@ -1,12 +0,0 @@
1
- import { GenerateAIDataHandlerInputSchema, } from "../shared/schemas.js";
2
- import { FileType, ToolName } from "../shared/types.js";
3
- import { generateAIDataFile } from "../shared/handlers.js";
4
- export const wopeeGenerateUserStories = {
5
- name: ToolName.WOPEE_GENERATE_USER_STORIES,
6
- config: {
7
- title: "Generate user stories",
8
- description: "Generate user stories JSON file for selected suite",
9
- inputSchema: GenerateAIDataHandlerInputSchema.shape,
10
- },
11
- handler: async (input) => await generateAIDataFile(FileType.USER_STORIES, input),
12
- };