workday-studio-mcp-server 2.0.0 → 2.0.2

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 (54) hide show
  1. package/README.md +258 -258
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +22 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/tools/add-assembly-step.d.ts +7 -0
  7. package/dist/tools/add-assembly-step.d.ts.map +1 -0
  8. package/dist/tools/add-assembly-step.js +130 -0
  9. package/dist/tools/add-assembly-step.js.map +1 -0
  10. package/dist/tools/create-project.d.ts +3 -0
  11. package/dist/tools/create-project.d.ts.map +1 -0
  12. package/dist/tools/create-project.js +262 -0
  13. package/dist/tools/create-project.js.map +1 -0
  14. package/dist/tools/create-xsl-transform.d.ts +6 -0
  15. package/dist/tools/create-xsl-transform.d.ts.map +1 -0
  16. package/dist/tools/create-xsl-transform.js +103 -0
  17. package/dist/tools/create-xsl-transform.js.map +1 -0
  18. package/dist/tools/get-step-type-reference.d.ts +6 -0
  19. package/dist/tools/get-step-type-reference.d.ts.map +1 -0
  20. package/dist/tools/get-step-type-reference.js +387 -0
  21. package/dist/tools/get-step-type-reference.js.map +1 -0
  22. package/dist/tools/log-learning.d.ts +6 -0
  23. package/dist/tools/log-learning.d.ts.map +1 -0
  24. package/dist/tools/log-learning.js +77 -0
  25. package/dist/tools/log-learning.js.map +1 -0
  26. package/dist/tools/lookup-soap-operations.d.ts +6 -0
  27. package/dist/tools/lookup-soap-operations.d.ts.map +1 -0
  28. package/dist/tools/lookup-soap-operations.js +343 -0
  29. package/dist/tools/lookup-soap-operations.js.map +1 -0
  30. package/dist/tools/parse-server-log.d.ts +6 -0
  31. package/dist/tools/parse-server-log.d.ts.map +1 -0
  32. package/dist/tools/parse-server-log.js +252 -0
  33. package/dist/tools/parse-server-log.js.map +1 -0
  34. package/dist/tools/plan-integration.d.ts +9 -0
  35. package/dist/tools/plan-integration.d.ts.map +1 -0
  36. package/dist/tools/plan-integration.js +550 -0
  37. package/dist/tools/plan-integration.js.map +1 -0
  38. package/dist/tools/update-sub-flow.d.ts +7 -0
  39. package/dist/tools/update-sub-flow.d.ts.map +1 -0
  40. package/dist/tools/update-sub-flow.js +185 -0
  41. package/dist/tools/update-sub-flow.js.map +1 -0
  42. package/dist/tools/validate-assembly.d.ts +6 -0
  43. package/dist/tools/validate-assembly.d.ts.map +1 -0
  44. package/dist/tools/validate-assembly.js +94 -0
  45. package/dist/tools/validate-assembly.js.map +1 -0
  46. package/dist/utils/assembly-validator.d.ts +18 -0
  47. package/dist/utils/assembly-validator.d.ts.map +1 -0
  48. package/dist/utils/assembly-validator.js +202 -0
  49. package/dist/utils/assembly-validator.js.map +1 -0
  50. package/dist/utils/fs.d.ts +6 -1
  51. package/dist/utils/fs.d.ts.map +1 -1
  52. package/dist/utils/fs.js +16 -1
  53. package/dist/utils/fs.js.map +1 -1
  54. package/package.json +72 -66
@@ -0,0 +1,130 @@
1
+ /**
2
+ * add_assembly_step — insert a new step into assembly.xml using a built-in step builder.
3
+ * Ported from the reference implementation (add-assembly-step.mjs).
4
+ */
5
+ import { z } from 'zod';
6
+ import { readFile, writeFile, copyFile } from 'fs/promises';
7
+ import { existsSync } from 'fs';
8
+ import { resolve } from 'path';
9
+ import { getConfig } from '../config.js';
10
+ import { errorResponse } from '../utils/errors.js';
11
+ import { validateXml } from '../utils/xml.js';
12
+ const STEP_TYPE_SCHEMAS = {
13
+ 'transform': (id, routesTo, opts) => `\n\t\t<cc:transform id="${id}" routes-to="${routesTo}">\n\t\t\t<cc:xslt href="${opts['xsl_file'] ?? id + '.xsl'}"/>\n\t\t</cc:transform>`,
14
+ 'xslt-plus': (id, routesTo, opts) => `\n\t\t<cc:xslt-plus id="${id}" routes-to="${routesTo}" output-mimetype="${opts['output_mimetype'] ?? 'text/xml'}" url="${opts['xsl_file'] ?? id + '.xsl'}"/>`,
15
+ 'http-out': (id, routesTo, opts) => `\n\t\t<cc:http-out id="${id}" routes-response-to="${routesTo}">\n\t\t\t<cc:url>${opts['url'] ?? 'https://example.com/api'}</cc:url>\n\t\t\t<cc:method>${opts['method'] ?? 'POST'}</cc:method>\n\t\t</cc:http-out>`,
16
+ 'local-out': (id, routesTo, opts) => {
17
+ const fileNameBlock = opts['file_name']
18
+ ? `\n\t\t\t<cc:set name="is.document.file.name" value="'${opts['file_name']}'"/>\n\t\t\t<cc:set name="is.document.deliverable" value="'true'"/>`
19
+ : '';
20
+ return `\n\t\t<cc:local-out id="${id}" store-message="none" routes-response-to="${routesTo}" endpoint="${opts['endpoint'] ?? 'vm://ENDPOINT'}">${fileNameBlock}\n\t\t</cc:local-out>`;
21
+ },
22
+ 'local-in': (id, routesTo, _opts) => `\n\t\t<cc:local-in id="${id}" routes-to="${routesTo}"/>`,
23
+ 'workday-out-rest': (id, routesTo, opts) => `\n\t\t<cc:workday-out-rest id="${id}" routes-response-to="${routesTo}" extra-path="${opts['extra_path'] ?? ''}"/>`,
24
+ 'workday-out-soap': (id, routesTo, opts) => `\n\t\t<cc:workday-out-soap id="${id}" routes-response-to="${routesTo}" application="${opts['application'] ?? 'Human_Resources'}" version="${opts['version'] ?? 'v46.1'}"/>`,
25
+ 'async-mediation': (id, routesTo, _opts) => `\n\t\t<cc:async-mediation id="${id}" routes-to="${routesTo}"/>`,
26
+ 'decision': (id, _routesTo, opts) => {
27
+ const branches = opts['branches'] ?? [{ condition: '/* condition */', routes_to: 'NextStep' }];
28
+ const routes = branches.map(b => b.condition
29
+ ? `\n\t\t\t\t<cc:route condition="${b.condition}" routes-to="${b.routes_to}"/>`
30
+ : `\n\t\t\t\t<cc:route routes-to="${b.routes_to}"/>`).join('');
31
+ return `\n\t\t<cc:decision id="${id}">\n\t\t\t<cc:routes>${routes}\n\t\t\t</cc:routes>\n\t\t</cc:decision>`;
32
+ },
33
+ 'splitter': (id, routesTo, opts) => `\n\t\t<cc:splitter id="${id}" no-split-message-error="false">\n\t\t\t<cc:sub-route name="SubRoute" routes-to="${routesTo}"/>\n\t\t\t<cc:xpath-splitter xpath="${opts['xpath'] ?? 'wd:Report_Data/wd:Report_Entry'}"/>\n\t\t</cc:splitter>`,
34
+ 'sub-assembly': (id, routesTo, opts) => `\n\t\t<cc:sub-assembly id="${id}" routes-to="${routesTo}" href="${opts['href'] ?? 'sub-assembly.xml'}"/>`,
35
+ 'workday-report': (id, routesTo, opts) => `\n\t\t<cc:workday-out-rest id="${id}" routes-response-to="${routesTo}" extra-path="${opts['extra_path'] ?? ''}"/>`,
36
+ 'note': (id, _routesTo, opts) => `\n\t\t<cc:note id="${id}">\n\t\t\t<cc:description>${opts['description'] ?? 'TODO'}</cc:description>\n\t\t</cc:note>`,
37
+ 'send-error': (id, routesTo, opts) => `\n\t\t<cc:send-error id="${id}" routes-to="${routesTo}" rethrow-error="${opts['rethrow_error'] ?? 'false'}"/>`,
38
+ 'log-error': (id, _routesTo, opts) => `\n\t\t<cc:log-error id="${id}" level="${opts['level'] ?? 'error'}" rethrow-error="${opts['rethrow_error'] ?? 'false'}"/>`,
39
+ 'xml-to-csv': (id, _routesTo, opts) => `\n\t\t<cc:xml-to-csv id="${id}" separator="${opts['separator'] ?? ','}" line-separator="${opts['line_separator'] ?? 'LF'}" writeHeaderLine="${opts['write_header_line'] ?? 'true'}" format="${opts['format'] ?? 'rfc4180'}"/>`,
40
+ 'csv-to-xml': (id, _routesTo, opts) => `\n\t\t<cc:csv-to-xml id="${id}" separator="${opts['separator'] ?? ','}" useFirstLineAsHeader="${opts['use_first_line_as_header'] ?? 'true'}" rootName="${opts['root_name'] ?? 'Root'}" rowName="${opts['row_name'] ?? 'Row'}" format="${opts['format'] ?? 'rfc4180'}"/>`,
41
+ };
42
+ // ─── Tool registration ────────────────────────────────────────────────────────
43
+ export function register(server) {
44
+ server.tool('add_assembly_step', 'Insert a new step into assembly.xml. Optionally wire it after an existing step (updates the predecessor\'s routes-to automatically). The new step inherits the predecessor\'s original routes-to as its own routes-to.', {
45
+ project_name: z.string().describe('The Studio project name'),
46
+ step_id: z.string().describe('Unique ID for the new step (e.g. "TransformWorkerData")'),
47
+ step_type: z.enum([
48
+ 'transform', 'xslt-plus', 'http-out', 'local-out', 'local-in',
49
+ 'workday-out-rest', 'workday-out-soap', 'async-mediation', 'decision', 'splitter',
50
+ 'sub-assembly', 'workday-report', 'note', 'send-error', 'log-error',
51
+ 'xml-to-csv', 'csv-to-xml',
52
+ ]).describe('The cc: step type to add'),
53
+ after_step_id: z.string().optional().describe('Insert after this existing step and rewire its routes-to. Omit to append before </cc:assembly>.'),
54
+ routes_to: z.string().optional().describe("Override what this step routes to. If after_step_id is set, defaults to the predecessor's current routes-to."),
55
+ options: z.record(z.unknown()).optional().describe('Step-specific options. Common: xsl_file, url, method, xpath, href, endpoint, description, output_mimetype, extra_path, branches (array of {condition?, routes_to}). ' +
56
+ 'workday-out-soap: application, version. ' +
57
+ 'send-error/log-error: rethrow_error, level. ' +
58
+ 'xml-to-csv: separator, line_separator, write_header_line, format. ' +
59
+ 'csv-to-xml: separator, use_first_line_as_header, root_name, row_name, format.'),
60
+ }, async ({ project_name, step_id, step_type, after_step_id, routes_to, options = {} }) => {
61
+ const cfg = getConfig();
62
+ const assemblyPath = resolve(cfg.workspacePath, project_name, 'ws', 'WSAR-INF', 'assembly.xml');
63
+ if (!existsSync(assemblyPath)) {
64
+ return errorResponse('FILE_NOT_FOUND', `No assembly.xml found in project '${project_name}'.`, 'Check the project name with list_studio_projects.');
65
+ }
66
+ let xml;
67
+ try {
68
+ xml = await readFile(assemblyPath, 'utf8');
69
+ }
70
+ catch (e) {
71
+ return errorResponse('READ_ERROR', e.message, null);
72
+ }
73
+ // Check for duplicate ID
74
+ if (new RegExp(`id="${step_id}"`).test(xml)) {
75
+ return errorResponse('DUPLICATE_ID', `A step with id="${step_id}" already exists in the assembly.`, 'Choose a different step ID.');
76
+ }
77
+ let effectiveRoutesTo = routes_to ?? 'End';
78
+ // Wire after predecessor
79
+ if (after_step_id) {
80
+ const predecessorRouteMatch = xml.match(new RegExp(`(<cc:[\\w-]+[^>]*id="${after_step_id}"[^>]*?)(routes-to|routes-response-to)="([^"]+)"`));
81
+ if (!predecessorRouteMatch) {
82
+ return errorResponse('STEP_NOT_FOUND', `Step with id="${after_step_id}" not found or has no routes-to attribute.`, 'Use list_assembly_steps to see valid step IDs.');
83
+ }
84
+ const routingAttr = predecessorRouteMatch[2];
85
+ effectiveRoutesTo = routes_to ?? predecessorRouteMatch[3];
86
+ // Rewire predecessor to point to new step
87
+ xml = xml.replace(new RegExp(`(id="${after_step_id}"[^>]*?)${routingAttr}="[^"]+"`), `$1${routingAttr}="${step_id}"`);
88
+ }
89
+ // Generate new step XML
90
+ const builder = STEP_TYPE_SCHEMAS[step_type];
91
+ if (!builder) {
92
+ return errorResponse('UNKNOWN_STEP_TYPE', `Unknown step type: ${step_type}.`, null);
93
+ }
94
+ const newStepXml = builder(step_id, effectiveRoutesTo, options);
95
+ // Insert before closing </cc:assembly>
96
+ if (!xml.includes('</cc:assembly>')) {
97
+ return errorResponse('INVALID_XML', 'assembly.xml does not contain </cc:assembly>.', 'Ensure the file is a valid Studio assembly.');
98
+ }
99
+ xml = xml.replace('</cc:assembly>', `${newStepXml}\n\t</cc:assembly>`);
100
+ // Validate before writing
101
+ const validation = validateXml(xml);
102
+ if (!validation.valid) {
103
+ return errorResponse('INVALID_XML', 'Generated assembly XML failed validation.', null, { xml_errors: validation.errors });
104
+ }
105
+ // Backup and write
106
+ if (cfg.backupOnWrite) {
107
+ try {
108
+ await copyFile(assemblyPath, assemblyPath + '.bak');
109
+ }
110
+ catch { /* non-fatal */ }
111
+ }
112
+ try {
113
+ await writeFile(assemblyPath, xml, 'utf8');
114
+ }
115
+ catch (e) {
116
+ return errorResponse('WRITE_FAILED', e.message, null);
117
+ }
118
+ return {
119
+ content: [{
120
+ type: 'text',
121
+ text: JSON.stringify({
122
+ success: true,
123
+ step_added: { id: step_id, type: `cc:${step_type}`, routes_to: effectiveRoutesTo },
124
+ predecessor_rewired: after_step_id ?? null,
125
+ }, null, 2),
126
+ }],
127
+ };
128
+ });
129
+ }
130
+ //# sourceMappingURL=add-assembly-step.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-assembly-step.js","sourceRoot":"","sources":["../../src/tools/add-assembly-step.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAQ9C,MAAM,iBAAiB,GAAgF;IACrG,WAAW,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAClC,2BAA2B,EAAE,gBAAgB,QAAQ,4BAA4B,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,MAAM,0BAA0B;IAE5I,WAAW,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAClC,2BAA2B,EAAE,gBAAgB,QAAQ,sBAAsB,IAAI,CAAC,iBAAiB,CAAC,IAAI,UAAU,UAAU,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,MAAM,KAAK;IAEhK,UAAU,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CACjC,0BAA0B,EAAE,yBAAyB,QAAQ,qBAAqB,IAAI,CAAC,KAAK,CAAC,IAAI,yBAAyB,+BAA+B,IAAI,CAAC,QAAQ,CAAC,IAAI,MAAM,kCAAkC;IAErN,WAAW,EAAE,CAAC,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AU,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;QAC5H,CAAC;QAED,mBAAmB;QACnB,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC;YACtB,IAAI,CAAC;gBAAC,MAAM,QAAQ,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC;QACxF,CAAC;QAED,IAAI,CAAC;YACH,MAAM,SAAS,CAAC,YAAY,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,CAAU,EAAE,CAAC;YACpB,OAAO,aAAa,CAAC,cAAc,EAAG,CAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACnE,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,OAAO,EAAE,IAAI;wBACb,UAAU,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE;wBAClF,mBAAmB,EAAE,aAAa,IAAI,IAAI;qBAC3C,EAAE,IAAI,EAAE,CAAC,CAAC;iBACZ,CAAC;SACH,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function register(server: McpServer): void;
3
+ //# sourceMappingURL=create-project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-project.d.ts","sourceRoot":"","sources":["../../src/tools/create-project.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA6ChD"}
@@ -0,0 +1,262 @@
1
+ import { z } from 'zod';
2
+ import { mkdir, writeFile } from 'fs/promises';
3
+ import { join, resolve } from 'path';
4
+ import { existsSync } from 'fs';
5
+ import { getConfig } from '../config.js';
6
+ import { errorResponse } from '../utils/errors.js';
7
+ export function register(server) {
8
+ server.tool('create_studio_project', 'Scaffold a new empty Workday Studio integration project in the Eclipse workspace. Creates the full project directory structure (.project, .classpath, .settings/, ws/WSAR-INF/) with a blank assembly.xml ready to open in Studio.', {
9
+ project_name: z.string().describe('The project name (e.g. INT145_My_New_Integration). Used as the Eclipse project name and integration system name.'),
10
+ }, async ({ project_name }) => {
11
+ const cfg = getConfig();
12
+ const projectPath = resolve(cfg.workspacePath, project_name);
13
+ if (existsSync(projectPath)) {
14
+ return errorResponse('PROJECT_EXISTS', `Project '${project_name}' already exists.`, 'Choose a different name or use list_studio_projects to see existing projects.');
15
+ }
16
+ try {
17
+ await createProjectScaffold(projectPath, project_name);
18
+ return {
19
+ content: [{
20
+ type: 'text',
21
+ text: JSON.stringify({
22
+ success: true,
23
+ project_name,
24
+ path: projectPath,
25
+ files_created: [
26
+ '.project',
27
+ '.classpath',
28
+ '.settings/cc.facet.assembly.xml',
29
+ '.settings/cc.ws.cloud.assembly.xml',
30
+ '.settings/org.eclipse.core.resources.prefs',
31
+ '.settings/org.eclipse.jdt.core.prefs',
32
+ '.settings/org.eclipse.wst.common.component',
33
+ '.settings/org.eclipse.wst.common.project.facet.core.xml',
34
+ 'ws/WSAR-INF/assembly.xml',
35
+ 'ws/WSAR-INF/assembly-diagram.xml',
36
+ ],
37
+ next_steps: 'Import into Eclipse: File → Import → Existing Projects into Workspace. The assembly includes a scaffolded GlobalErrorHandler (routes to DeliverError). Studio renders it automatically as a floating indicator — no diagram entry needed.',
38
+ }, null, 2),
39
+ }],
40
+ };
41
+ }
42
+ catch (e) {
43
+ return errorResponse('CREATE_FAILED', e.message, null);
44
+ }
45
+ });
46
+ }
47
+ async function createProjectScaffold(projectPath, projectName) {
48
+ await mkdir(join(projectPath, '.settings'), { recursive: true });
49
+ await mkdir(join(projectPath, 'build', 'classes'), { recursive: true });
50
+ await mkdir(join(projectPath, 'src', 'main', 'java'), { recursive: true });
51
+ await mkdir(join(projectPath, 'ws', 'WSAR-INF'), { recursive: true });
52
+ await writeFile(join(projectPath, '.project'), dotProject(projectName));
53
+ await writeFile(join(projectPath, '.classpath'), CLASSPATH);
54
+ await writeFile(join(projectPath, '.settings', 'cc.facet.assembly.xml'), CC_FACET_ASSEMBLY);
55
+ await writeFile(join(projectPath, '.settings', 'cc.ws.cloud.assembly.xml'), ccWsCloudAssembly(projectName));
56
+ await writeFile(join(projectPath, '.settings', 'org.eclipse.core.resources.prefs'), CORE_RESOURCES_PREFS);
57
+ await writeFile(join(projectPath, '.settings', 'org.eclipse.jdt.core.prefs'), JDT_CORE_PREFS);
58
+ await writeFile(join(projectPath, '.settings', 'org.eclipse.wst.common.component'), wstCommonComponent(projectName));
59
+ await writeFile(join(projectPath, '.settings', 'org.eclipse.wst.common.project.facet.core.xml'), FACET_CORE);
60
+ await writeFile(join(projectPath, 'ws', 'WSAR-INF', 'assembly.xml'), assemblyXml(projectName));
61
+ await writeFile(join(projectPath, 'ws', 'WSAR-INF', 'assembly-diagram.xml'), ASSEMBLY_DIAGRAM);
62
+ }
63
+ // --- templates ---
64
+ function dotProject(name) {
65
+ return `<?xml version="1.0" encoding="UTF-8"?>
66
+ <projectDescription>
67
+ \t<name>${name}</name>
68
+ \t<comment></comment>
69
+ \t<projects>
70
+ \t</projects>
71
+ \t<buildSpec>
72
+ \t\t<buildCommand>
73
+ \t\t\t<name>com.capeclear.wtp.facet.assembly.builder</name>
74
+ \t\t\t<arguments>
75
+ \t\t\t</arguments>
76
+ \t\t</buildCommand>
77
+ \t\t<buildCommand>
78
+ \t\t\t<name>org.eclipse.jdt.core.javabuilder</name>
79
+ \t\t\t<arguments>
80
+ \t\t\t</arguments>
81
+ \t\t</buildCommand>
82
+ \t\t<buildCommand>
83
+ \t\t\t<name>com.workday.wtp.ws.cloud.assembly.builder</name>
84
+ \t\t\t<arguments>
85
+ \t\t\t</arguments>
86
+ \t\t</buildCommand>
87
+ \t\t<buildCommand>
88
+ \t\t\t<name>org.eclipse.wst.common.project.facet.core.builder</name>
89
+ \t\t\t<arguments>
90
+ \t\t\t</arguments>
91
+ \t\t</buildCommand>
92
+ \t\t<buildCommand>
93
+ \t\t\t<name>org.eclipse.wst.validation.validationbuilder</name>
94
+ \t\t\t<arguments>
95
+ \t\t\t</arguments>
96
+ \t\t</buildCommand>
97
+ \t</buildSpec>
98
+ \t<natures>
99
+ \t\t<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
100
+ \t\t<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
101
+ \t\t<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
102
+ \t\t<nature>com.workday.wtp.ws.cloud.assembly.nature</nature>
103
+ \t\t<nature>org.eclipse.jdt.core.javanature</nature>
104
+ \t\t<nature>com.capeclear.wtp.facet.assembly.nature</nature>
105
+ \t</natures>
106
+ </projectDescription>`;
107
+ }
108
+ const CLASSPATH = `<?xml version="1.0" encoding="UTF-8"?>
109
+ <classpath>
110
+ \t<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
111
+ \t<classpathentry kind="src" path="src/main/java"/>
112
+ \t<classpathentry kind="con" path="com.capeclear.wtp.ws.container">
113
+ \t\t<attributes>
114
+ \t\t\t<attribute name="org.eclipse.jst.component.nondependency" value=""/>
115
+ \t\t</attributes>
116
+ \t</classpathentry>
117
+ \t<classpathentry kind="con" path="org.eclipse.jst.server.core.container/com.workday.cloud.jst.server.runtimeTarget.wdscl/Workday Runtime">
118
+ \t\t<attributes>
119
+ \t\t\t<attribute name="owner.project.facets" value="cc.ws.cloud.assembly"/>
120
+ \t\t</attributes>
121
+ \t</classpathentry>
122
+ \t<classpathentry kind="output" path="build/classes"/>
123
+ </classpath>`;
124
+ const CC_FACET_ASSEMBLY = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
125
+ <model modelId="com.capeclear.wtp.facet.assembly.facet.AssemblyFacetInstallDataModelProvider">
126
+ <map key="IAssemblyFacetInstallDataModelProperties.LINK_URI_LIST"/>
127
+ <list key="ICcFacetInstallDataModelProperties.EXCLUDE_FROM_DEPLOY_SRC"/>
128
+ <value class="java.lang.Boolean" key="ICcFacetInstallDataModelProperties.MARK_GENERATED_DERIVED">true</value>
129
+ <value class="java.lang.Boolean" key="ICcFacetInstallDataModelProperties.USE_CLASSPATH_DEPENDENCY_FOR_PARENT_SERVICE">true</value>
130
+ <value class="java.lang.String" key="ICcFacetInstallDataModelProperties.WS_FOLDER">ws</value>
131
+ <value class="java.lang.Boolean" key="ICcFacetInstallDataModelProperties.COPY_WSDL_FILES_ON_DEPLOY">true</value>
132
+ <value class="java.lang.String" key="IAssemblyFacetInstallDataModelProperties.ASSEMBLY_TEMPLATE_ID">assembly</value>
133
+ <value class="java.lang.Boolean" key="ICcFacetInstallDataModelProperties.EXPORT_REFERENCED_WEBSERVICE_PROJECT_CLASSPATH">false</value>
134
+ </model>`;
135
+ function ccWsCloudAssembly(name) {
136
+ return `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
137
+ <model modelId="com.workday.wtp.ws.cloud.assembly.facet.WsCloudAssemblyFacetInstallDataModelProvider">
138
+ <value class="java.lang.String" key="ICcFacetInstallDataModelProperties.MODULE_SERVICE_TOKENIZED_NAME">@PROJECT_NAME@</value>
139
+ <list key="ICcFacetInstallDataModelProperties.EXCLUDE_FROM_DEPLOY_SRC"/>
140
+ <value class="java.lang.String" key="IWsCloudAssemblyFacetInstallDataModelProperties.WD_INTEGRATION_TYPE">regular.e2</value>
141
+ <value class="java.lang.Boolean" key="ICcFacetInstallDataModelProperties.MARK_GENERATED_DERIVED">true</value>
142
+ <value class="java.lang.Boolean" key="ICcFacetInstallDataModelProperties.MODULE_SERVICE_NAME_PROJECT">true</value>
143
+ <value class="java.lang.Boolean" key="ICcFacetInstallDataModelProperties.USE_CLASSPATH_DEPENDENCY_FOR_PARENT_SERVICE">true</value>
144
+ <value class="java.lang.String" key="ICcFacetInstallDataModelProperties.MODULE_SERVICE_NAME"/>
145
+ <value class="java.lang.String" key="ICcFacetInstallDataModelProperties.WS_FOLDER">ws</value>
146
+ <value class="java.lang.Boolean" key="ICcFacetInstallDataModelProperties.COPY_WSDL_FILES_ON_DEPLOY">true</value>
147
+ <value class="java.lang.Boolean" key="ICcFacetInstallDataModelProperties.MODULE_SERVICE_NAME_CUSTOM">false</value>
148
+ <list key="IWsCloudAssemblyFacetInstallDataModelProperties.MEMBER_OF_CLOUD_COLLECTIONS">
149
+ <value class="java.lang.String">${name}</value>
150
+ </list>
151
+ <value class="java.lang.Boolean" key="ICcFacetInstallDataModelProperties.MODULE_SERVICE_NAME_VERSION">false</value>
152
+ <value class="java.lang.Boolean" key="ICcFacetInstallDataModelProperties.EXPORT_REFERENCED_WEBSERVICE_PROJECT_CLASSPATH">false</value>
153
+ </model>`;
154
+ }
155
+ const CORE_RESOURCES_PREFS = `eclipse.preferences.version=1
156
+ encoding/<project>=UTF-8`;
157
+ const JDT_CORE_PREFS = `eclipse.preferences.version=1
158
+ org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
159
+ org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
160
+ org.eclipse.jdt.core.compiler.compliance=1.8
161
+ org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
162
+ org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
163
+ org.eclipse.jdt.core.compiler.source=1.8`;
164
+ function wstCommonComponent(name) {
165
+ return `<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
166
+
167
+ <wb-module deploy-name="${name}">
168
+
169
+ <wb-resource deploy-path="/" source-path="/ws"/>
170
+
171
+ </wb-module>
172
+
173
+ </project-modules>`;
174
+ }
175
+ const FACET_CORE = `<?xml version="1.0" encoding="UTF-8"?>
176
+ <faceted-project>
177
+ <runtime name="Workday Runtime"/>
178
+ <fixed facet="java"/>
179
+ <fixed facet="cc.facet.assembly"/>
180
+ <fixed facet="cc.ws.cloud.assembly"/>
181
+ <installed facet="cc.ws.cloud.assembly" version="1.0"/>
182
+ <installed facet="java" version="1.8"/>
183
+ <installed facet="cc.facet.assembly" version="1.0"/>
184
+ </faceted-project>`;
185
+ function assemblyXml(name) {
186
+ return `<?xml version="1.0" encoding="UTF-8"?>
187
+ <beans
188
+ xmlns="http://www.springframework.org/schema/beans"
189
+ xmlns:beans="http://www.springframework.org/schema/beans"
190
+ xmlns:atom="http://www.w3.org/2005/Atom"
191
+ xmlns:cc="http://www.capeclear.com/assembly/10"
192
+ xmlns:cloud="urn:com.workday/esb/cloud/10.0"
193
+ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
194
+ xmlns:pi="urn:com.workday/picof"
195
+ xmlns:wd="urn:com.workday/bsvc"
196
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
197
+
198
+ \t<cc:assembly id="WorkdayAssembly" version="2024.37">
199
+
200
+ \t\t<cc:workday-in id="StartHere" routes-to="End">
201
+ \t\t\t<cc:integration-system name="${name}">
202
+ \t\t\t</cc:integration-system>
203
+ \t\t</cc:workday-in>
204
+
205
+ \t\t<cc:send-error id="GlobalErrorHandler" routes-to="DeliverError" rethrow-error="false"/>
206
+
207
+ \t\t<cc:local-out id="DeliverError" store-message="none" endpoint="vm://wcc/PutIntegrationMessage">
208
+ \t\t\t<cc:set name="is.message.severity" value="'ERROR'"/>
209
+ \t\t\t<cc:set name="is.message.summary" value="'${name} failed: ' + context.errorMessage"/>
210
+ \t\t\t<cc:set name="is.document.deliverable" value="'false'"/>
211
+ \t\t</cc:local-out>
212
+
213
+ \t\t<cc:async-mediation id="End">
214
+ \t\t\t<cc:steps>
215
+ \t\t\t\t<cc:log id="IntegrationComplete">
216
+ \t\t\t\t\t<cc:log-message><cc:text>Integration complete.</cc:text></cc:log-message>
217
+ \t\t\t\t</cc:log>
218
+ \t\t\t</cc:steps>
219
+ \t\t</cc:async-mediation>
220
+
221
+ \t</cc:assembly>
222
+
223
+ </beans>`;
224
+ }
225
+ const ASSEMBLY_DIAGRAM = `<?xml version="1.0" encoding="UTF-8"?>
226
+ <wdnm:Diagram xmlns:wdnm="http://workday.com/studio/editors/notation">
227
+ <element href="assembly.xml#WorkdayAssembly"/>
228
+
229
+ <visualProperties x="80" y="200">
230
+ <element href="assembly.xml#StartHere"/>
231
+ </visualProperties>
232
+ <visualProperties x="300" y="200">
233
+ <element href="assembly.xml#End"/>
234
+ </visualProperties>
235
+ <visualProperties>
236
+ <element href="assembly.xml#//@beans/@mixed.1/@mixed.3"/>
237
+ </visualProperties>
238
+ <visualProperties x="300" y="80">
239
+ <element href="assembly.xml#DeliverError"/>
240
+ </visualProperties>
241
+
242
+ <connections type="routesTo">
243
+ <source href="assembly.xml#StartHere"/>
244
+ <target href="assembly.xml#End"/>
245
+ </connections>
246
+ <connections type="routesTo">
247
+ <source href="assembly.xml#//@beans/@mixed.1/@mixed.3"/>
248
+ <target href="assembly.xml#DeliverError"/>
249
+ </connections>
250
+
251
+ <swimlanes x="30" y="140" name="Integration Flow" alignment="END" labelAlignment="LEFT">
252
+ <elements href="assembly.xml#StartHere"/>
253
+ <elements href="assembly.xml#End"/>
254
+ </swimlanes>
255
+
256
+ <swimlanes x="30" y="30" name="Error Handler" alignment="END" labelAlignment="LEFT">
257
+ <elements href="assembly.xml#//@beans/@mixed.1/@mixed.3"/>
258
+ <elements href="assembly.xml#DeliverError"/>
259
+ </swimlanes>
260
+
261
+ </wdnm:Diagram>`;
262
+ //# sourceMappingURL=create-project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-project.js","sourceRoot":"","sources":["../../src/tools/create-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAA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D,CAAC;AACV,CAAC;AAED,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAoCT,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * create_xsl_transform — create a new XSL transform stub in a project's WSAR-INF folder.
3
+ */
4
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
5
+ export declare function register(server: McpServer): void;
6
+ //# sourceMappingURL=create-xsl-transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-xsl-transform.d.ts","sourceRoot":"","sources":["../../src/tools/create-xsl-transform.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAyDhD"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * create_xsl_transform — create a new XSL transform stub in a project's WSAR-INF folder.
3
+ */
4
+ import { z } from 'zod';
5
+ import { writeFile } from 'fs/promises';
6
+ import { join, resolve } from 'path';
7
+ import { existsSync } from 'fs';
8
+ import { getConfig } from '../config.js';
9
+ import { errorResponse } from '../utils/errors.js';
10
+ export function register(server) {
11
+ server.tool('create_xsl_transform', [
12
+ 'Create a new XSL transform stub in a project\'s WSAR-INF directory.',
13
+ '',
14
+ 'Creates a ready-to-edit .xsl file pre-populated with the correct Studio',
15
+ 'namespace declarations and a root template. The stub is immediately valid',
16
+ 'XML — Studio can parse and reference it via cc:xslt-plus url= right away.',
17
+ '',
18
+ 'For output_type="json" the output method is set to text; for "csv" it is',
19
+ 'also text with a CSV comment; for "xml" it uses xml method.',
20
+ ].join('\n'), {
21
+ project_name: z.string().describe('Studio project name (must exist in workspace).'),
22
+ file_name: z.string().describe('XSL file name including extension, e.g. WorkersToCSV.xsl'),
23
+ output_type: z.enum(['xml', 'json', 'csv', 'text']).optional().describe('Output type — controls xsl:output method (default: xml).'),
24
+ description: z.string().optional().describe('One-line description added as a comment at the top of the file.'),
25
+ }, async ({ project_name, file_name, output_type = 'xml', description }) => {
26
+ const cfg = getConfig();
27
+ if (!file_name.match(/^[a-zA-Z0-9_\-. ]+\.(xsl|xslt)$/)) {
28
+ return errorResponse('INVALID_FILE_NAME', `Invalid XSL file name: '${file_name}'. Must end with .xsl or .xslt.`, null);
29
+ }
30
+ const wsarInfPath = resolve(cfg.workspacePath, project_name, 'ws', 'WSAR-INF');
31
+ if (!existsSync(wsarInfPath)) {
32
+ return errorResponse('PROJECT_NOT_FOUND', `Project '${project_name}' not found or has no ws/WSAR-INF directory.`, 'Run create_studio_project first or check the project name.');
33
+ }
34
+ const filePath = join(wsarInfPath, file_name);
35
+ if (existsSync(filePath)) {
36
+ return errorResponse('FILE_EXISTS', `File '${file_name}' already exists in ${project_name}/ws/WSAR-INF.`, 'Use write_integration_file to overwrite an existing file.');
37
+ }
38
+ const content = buildXslStub(file_name, output_type, description);
39
+ try {
40
+ await writeFile(filePath, content, 'utf8');
41
+ return {
42
+ content: [{
43
+ type: 'text',
44
+ text: JSON.stringify({
45
+ success: true,
46
+ file: `ws/WSAR-INF/${file_name}`,
47
+ project: project_name,
48
+ output_type,
49
+ message: `XSL stub created. Reference it in assembly.xml as: url="${file_name}"`,
50
+ }, null, 2),
51
+ }],
52
+ };
53
+ }
54
+ catch (e) {
55
+ return errorResponse('WRITE_FAILED', e.message, null);
56
+ }
57
+ });
58
+ }
59
+ function buildXslStub(fileName, outputType, description) {
60
+ const outputMethod = outputType === 'xml' ? 'xml' : 'text';
61
+ const omitDecl = outputType !== 'xml' ? '\n omit-xml-declaration="yes"' : '';
62
+ const descComment = description ? `\n ${description}\n` : ` ${fileName} `;
63
+ const jsonHint = outputType === 'json' ? `
64
+
65
+ <!-- Build JSON output from xsl:params (passed automatically from props by Studio).
66
+ Use xsl:value-of and xsl:if to construct the JSON string.
67
+ NOTE: xsl:param names cannot contain dots — use underscores instead.
68
+ Example:
69
+ <xsl:param name="Worker_ID" select="''"/>
70
+ <xsl:param name="Full_Name" select="''"/>
71
+ -->` : '';
72
+ const csvHint = outputType === 'csv' ? `
73
+
74
+ <!-- Build CSV output. Declare xsl:params matching props keys (underscores, no dots).
75
+ Write header row first, then iterate over records.
76
+ Use separator="," and line-separator="LF" on cc:xml-to-csv for streaming.
77
+ -->` : '';
78
+ return `<?xml version="1.0" encoding="UTF-8"?>
79
+ <!--${descComment}-->
80
+ <xsl:stylesheet version="3.0"
81
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
82
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
83
+ xmlns:wd="urn:com.workday/bsvc"
84
+ expand-text="yes">
85
+
86
+ <xsl:output method="${outputMethod}" encoding="UTF-8"${omitDecl}/>
87
+
88
+ <!-- Streaming mode for large Workday report payloads -->
89
+ <xsl:mode streamable="yes" on-no-match="shallow-skip"/>
90
+ <xsl:mode name="in-memory" streamable="no" on-no-match="shallow-skip"/>
91
+
92
+ <!-- Props passed automatically by Studio as xsl:params.
93
+ Names must use underscores — dots are not valid XML NCNames. -->
94
+ <!-- <xsl:param name="Employee_ID" select="''"/> -->
95
+ ${jsonHint}${csvHint}
96
+
97
+ <xsl:template match="/">
98
+ <!-- TODO: implement transformation -->
99
+ </xsl:template>
100
+
101
+ </xsl:stylesheet>`;
102
+ }
103
+ //# sourceMappingURL=create-xsl-transform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-xsl-transform.js","sourceRoot":"","sources":["../../src/tools/create-xsl-transform.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,O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AC;IAE3E,MAAM,QAAQ,GAAG,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC;;;;;;;;MAQrC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEV,MAAM,OAAO,GAAG,UAAU,KAAK,KAAK,CAAC,CAAC,CAAC;;;;;MAKnC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEV,OAAO;MACH,WAAW;;;;;;;wBAOO,YAAY,qBAAqB,QAAQ;;;;;;;;;EAS/D,QAAQ,GAAG,OAAO;;;;;;kBAMF,CAAC;AACnB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * get_step_type_reference — confirmed step type docs with production XML examples.
3
+ */
4
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
5
+ export declare function register(server: McpServer): void;
6
+ //# sourceMappingURL=get-step-type-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-step-type-reference.d.ts","sourceRoot":"","sources":["../../src/tools/get-step-type-reference.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAwDhD"}