workday-studio-mcp-server 2.0.1 → 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 (51) hide show
  1. package/dist/index.js +21 -1
  2. package/dist/index.js.map +1 -1
  3. package/dist/tools/add-assembly-step.d.ts +7 -0
  4. package/dist/tools/add-assembly-step.d.ts.map +1 -0
  5. package/dist/tools/add-assembly-step.js +130 -0
  6. package/dist/tools/add-assembly-step.js.map +1 -0
  7. package/dist/tools/create-project.d.ts +3 -0
  8. package/dist/tools/create-project.d.ts.map +1 -0
  9. package/dist/tools/create-project.js +262 -0
  10. package/dist/tools/create-project.js.map +1 -0
  11. package/dist/tools/create-xsl-transform.d.ts +6 -0
  12. package/dist/tools/create-xsl-transform.d.ts.map +1 -0
  13. package/dist/tools/create-xsl-transform.js +103 -0
  14. package/dist/tools/create-xsl-transform.js.map +1 -0
  15. package/dist/tools/get-step-type-reference.d.ts +6 -0
  16. package/dist/tools/get-step-type-reference.d.ts.map +1 -0
  17. package/dist/tools/get-step-type-reference.js +387 -0
  18. package/dist/tools/get-step-type-reference.js.map +1 -0
  19. package/dist/tools/log-learning.d.ts +6 -0
  20. package/dist/tools/log-learning.d.ts.map +1 -0
  21. package/dist/tools/log-learning.js +77 -0
  22. package/dist/tools/log-learning.js.map +1 -0
  23. package/dist/tools/lookup-soap-operations.d.ts +6 -0
  24. package/dist/tools/lookup-soap-operations.d.ts.map +1 -0
  25. package/dist/tools/lookup-soap-operations.js +343 -0
  26. package/dist/tools/lookup-soap-operations.js.map +1 -0
  27. package/dist/tools/parse-server-log.d.ts +6 -0
  28. package/dist/tools/parse-server-log.d.ts.map +1 -0
  29. package/dist/tools/parse-server-log.js +252 -0
  30. package/dist/tools/parse-server-log.js.map +1 -0
  31. package/dist/tools/plan-integration.d.ts +9 -0
  32. package/dist/tools/plan-integration.d.ts.map +1 -0
  33. package/dist/tools/plan-integration.js +550 -0
  34. package/dist/tools/plan-integration.js.map +1 -0
  35. package/dist/tools/update-sub-flow.d.ts +7 -0
  36. package/dist/tools/update-sub-flow.d.ts.map +1 -0
  37. package/dist/tools/update-sub-flow.js +185 -0
  38. package/dist/tools/update-sub-flow.js.map +1 -0
  39. package/dist/tools/validate-assembly.d.ts +6 -0
  40. package/dist/tools/validate-assembly.d.ts.map +1 -0
  41. package/dist/tools/validate-assembly.js +94 -0
  42. package/dist/tools/validate-assembly.js.map +1 -0
  43. package/dist/utils/assembly-validator.d.ts +18 -0
  44. package/dist/utils/assembly-validator.d.ts.map +1 -0
  45. package/dist/utils/assembly-validator.js +202 -0
  46. package/dist/utils/assembly-validator.js.map +1 -0
  47. package/dist/utils/fs.d.ts +6 -1
  48. package/dist/utils/fs.d.ts.map +1 -1
  49. package/dist/utils/fs.js +16 -1
  50. package/dist/utils/fs.js.map +1 -1
  51. package/package.json +1 -1
@@ -0,0 +1,550 @@
1
+ /**
2
+ * plan_integration — design elicitation + assembly skeleton generator.
3
+ * Ported from the reference implementation (plan-integration.mjs).
4
+ *
5
+ * Writes assembly.xml + assembly-diagram.xml into the project directory.
6
+ */
7
+ import { z } from 'zod';
8
+ import { writeFile } from 'fs/promises';
9
+ import { join, resolve } from 'path';
10
+ import { existsSync } from 'fs';
11
+ import { getConfig } from '../config.js';
12
+ import { errorResponse } from '../utils/errors.js';
13
+ // ─── Design brief schema ──────────────────────────────────────────────────────
14
+ const DesignBriefSchema = z.object({
15
+ data_source: z.enum(['raas', 'soap-get', 'inbound-file', 'webhook', 'external-rest', 'multiple'])
16
+ .describe('raas=Workday custom report; soap-get=Workday SOAP Get_*; inbound-file=user uploads a file; webhook=Workday event listener; external-rest=third-party API GET; multiple=more than one type'),
17
+ data_destination: z.enum(['workday-soap-write', 'workday-rest-write', 'external-rest', 'file-delivery', 'email-only', 'multiple'])
18
+ .describe('workday-soap-write=SOAP Put_*/Change_*/Hire_*; workday-rest-write=Workday REST custom objects; external-rest=third-party API; file-delivery=output file; email-only=send email'),
19
+ trigger: z.enum(['scheduled', 'event-driven', 'launch-params-manual', 'inbound-file'])
20
+ .describe('scheduled=Workday scheduler; event-driven=Workday business event (hire/terminate/etc); launch-params-manual=manually launched; inbound-file=triggered by file upload'),
21
+ record_volume: z.enum(['single', 'small', 'large'])
22
+ .describe('single=always 1 record (no splitter needed); small=under 100 records (xpath-splitter ok); large=over 100 records (MUST use xml-stream-splitter)'),
23
+ external_auth: z.enum(['none', 'oauth2', 'basic', 'api-key']).optional()
24
+ .describe('none=no external system; oauth2=token refresh flow; basic=username+password; api-key=static API key'),
25
+ error_handling: z.array(z.enum(['integration-messages', 'email-notification', 'rethrow']))
26
+ .describe('integration-messages=always minimum; email-notification=send on failure (adds Email sub-flow); rethrow=stop integration on error'),
27
+ raas_reports: z.array(z.object({
28
+ alias: z.string().describe('Alias name for cloud:report-alias name= attribute — must match exactly'),
29
+ description: z.string().describe('What data this report returns'),
30
+ filter_params: z.array(z.string()).optional()
31
+ .describe('Prompt filter params e.g. ["Worker!WID", "Effective_Date", "format=simplexml"]'),
32
+ has_reference_wid: z.boolean().optional()
33
+ .describe('True if the report WID is known — enables cloud:report-reference binding'),
34
+ })).optional().describe('Required when data_source is raas or multiple. One entry per RAAS report.'),
35
+ soap_operations: z.array(z.object({
36
+ application: z.string().describe('Workday module e.g. Human_Resources, Staffing, Talent'),
37
+ operation: z.string().describe('SOAP operation e.g. Get_Workers, Put_Applicant'),
38
+ version: z.string().describe('API version e.g. 38.2'),
39
+ direction: z.enum(['get', 'write']).describe('get=reading from Workday; write=updating Workday'),
40
+ })).optional().describe('Required when SOAP is used for reading or writing.'),
41
+ integration_attributes: z.array(z.object({
42
+ name: z.string().describe('Attribute display name in Workday UI, e.g. "API URL", "Client Secret"'),
43
+ is_password: z.boolean().optional().describe('True for secrets/keys (masked in Workday UI)'),
44
+ required: z.boolean().optional().describe('True to require this field before launch'),
45
+ })).optional().describe('Credentials and config stored in Workday integration system attributes.'),
46
+ conditional_logic: z.string().optional()
47
+ .describe('Free-text: any routing conditions, e.g. "route by worker type: Employee vs Contractor"'),
48
+ notes: z.string().optional()
49
+ .describe('Other design notes: rate limits, special namespaces, downstream dependencies'),
50
+ });
51
+ // ─── Public tool registration ─────────────────────────────────────────────────
52
+ export function register(server) {
53
+ server.tool('plan_integration', [
54
+ '⚠️ DO NOT CALL THIS TOOL without first gathering ALL design decisions from the user.',
55
+ '',
56
+ 'Design questions you MUST ask before calling:',
57
+ '',
58
+ '1. DATA SOURCE — How does data enter the integration?',
59
+ ' raas → Workday custom report (most common for scheduled/outbound)',
60
+ ' soap-get → Workday SOAP Get_* (when RAAS is not available)',
61
+ ' inbound-file → User uploads a file on the integration event',
62
+ ' webhook → Workday event listener fires (listener-service)',
63
+ ' external-rest → Fetch data from a third-party REST API',
64
+ '',
65
+ '2. DATA DESTINATION — Where does processed data go?',
66
+ ' workday-soap-write → Workday SOAP Put_*/Change_*/Hire_* etc.',
67
+ ' workday-rest-write → Workday REST custom objects PUT/POST/DELETE',
68
+ ' external-rest → POST/PATCH to a third-party API',
69
+ ' file-delivery → Output file delivered on the integration event',
70
+ ' email-only → Send email notification (no system update)',
71
+ '',
72
+ '3. TRIGGER — What launches this integration?',
73
+ ' scheduled → Workday scheduler (daily, hourly, etc.)',
74
+ ' event-driven → Workday business event (hire, terminate, etc.)',
75
+ ' launch-params-manual → Manually launched, optional filter params',
76
+ ' inbound-file → Triggered by file upload on the integration event',
77
+ '',
78
+ '4. RECORD VOLUME — How many records does the integration process?',
79
+ ' single → Always exactly 1 record (no splitter needed)',
80
+ ' small → Under 100 records (xpath-splitter loads all into memory)',
81
+ ' large → Over 100 records (MUST use xml-stream-splitter for streaming)',
82
+ '',
83
+ '5. EXTERNAL AUTH — What auth does the external system require?',
84
+ ' none → No external system involved',
85
+ ' oauth2 → OAuth2 token refresh flow (adds GetToken sub-flow)',
86
+ ' basic → Username + password (Base64 encoded)',
87
+ ' api-key → Static API key',
88
+ '',
89
+ '6. ERROR HANDLING:',
90
+ ' integration-messages → Log to Workday event log (always minimum)',
91
+ ' email-notification → Send failure email (adds Email sub-flow)',
92
+ ' rethrow → Stop integration and propagate the error',
93
+ '',
94
+ '7. RAAS REPORTS (if data_source = raas or multiple):',
95
+ ' For each report: alias name, what data it returns, any filter params.',
96
+ ' Filter param syntax: "Worker!WID" for object refs, "Effective_Date" for text,',
97
+ ' "format=simplexml" to strip wd: namespaces from response.',
98
+ ' Example: alias="INT145_Get_Workers", filters=["Worker!WID", "format=simplexml"]',
99
+ '',
100
+ '8. SOAP OPERATIONS (if soap-get or workday-soap-write):',
101
+ ' For each: application (e.g. Human_Resources), operation (e.g. Get_Workers), version.',
102
+ '',
103
+ '9. INTEGRATION ATTRIBUTES:',
104
+ ' Any credentials or config stored in Workday? (API keys, URLs, OAuth credentials)',
105
+ ' Note: oauth2/basic/api-key auth types auto-generate the standard attributes.',
106
+ '',
107
+ '10. CONDITIONAL LOGIC:',
108
+ ' Any routing decisions? e.g. "employee vs contractor", "new hire vs rehire", "active only"',
109
+ '',
110
+ 'Once you have all answers, call with project_name + sub_flows + design_brief.',
111
+ 'The tool writes assembly.xml + assembly-diagram.xml with correct declarations pre-populated.',
112
+ ].join('\n'), {
113
+ project_name: z.string()
114
+ .describe('Existing project name (e.g. "INT145_My_Integration"). Must already exist in the workspace.'),
115
+ sub_flows: z.array(z.object({
116
+ id: z.string().describe('Identifier for XML ids (no spaces, e.g. "GetWorkers", "PostToTarget")'),
117
+ description: z.string().describe('One sentence: what this sub-flow produces'),
118
+ reads_props: z.array(z.string()).optional(),
119
+ writes_props: z.array(z.string()).optional(),
120
+ })).min(1).describe('Ordered list of sub-flows. Order = execution order in the main flow chain.'),
121
+ design_brief: DesignBriefSchema,
122
+ }, async ({ project_name, sub_flows, design_brief }) => {
123
+ const cfg = getConfig();
124
+ const projectPath = resolve(cfg.workspacePath, project_name);
125
+ const wsDir = join(projectPath, 'ws', 'WSAR-INF');
126
+ if (!existsSync(projectPath)) {
127
+ return errorResponse('PROJECT_NOT_FOUND', `Project '${project_name}' does not exist.`, 'Run create_studio_project first, or check the project name with list_studio_projects.');
128
+ }
129
+ const assemblyXml = buildAssemblyXml(project_name, sub_flows, design_brief);
130
+ const diagramXml = buildDiagramXml(project_name, sub_flows);
131
+ const plan = buildPlanDocument(project_name, sub_flows, design_brief);
132
+ try {
133
+ await writeFile(join(wsDir, 'assembly.xml'), assemblyXml, 'utf-8');
134
+ await writeFile(join(wsDir, 'assembly-diagram.xml'), diagramXml, 'utf-8');
135
+ }
136
+ catch (e) {
137
+ return errorResponse('WRITE_FAILED', e.message, 'Check that the ws/WSAR-INF directory exists inside the project folder.');
138
+ }
139
+ return {
140
+ content: [{
141
+ type: 'text',
142
+ text: JSON.stringify({
143
+ success: true,
144
+ files_written: ['ws/WSAR-INF/assembly.xml', 'ws/WSAR-INF/assembly-diagram.xml'],
145
+ plan,
146
+ }, null, 2),
147
+ }],
148
+ };
149
+ });
150
+ }
151
+ // ─── workday-in declaration generation ───────────────────────────────────────
152
+ function buildWorkdayInDeclarations(projectName, designBrief) {
153
+ const parts = [];
154
+ // 1. RAAS report service
155
+ if (designBrief.data_source === 'raas' || designBrief.data_source === 'multiple') {
156
+ const reports = designBrief.raas_reports ?? [];
157
+ parts.push(`\t\t\t<cloud:report-service name="${projectName}_Reports">`);
158
+ if (reports.length === 0) {
159
+ parts.push(`\t\t\t\t<cloud:report-alias description="TODO: Add report description" name="TODO_REPORT_ALIAS"/>`);
160
+ }
161
+ else {
162
+ for (const r of reports) {
163
+ if (r.has_reference_wid) {
164
+ parts.push(`\t\t\t\t<cloud:report-alias description="${r.description}" name="${r.alias}">`);
165
+ parts.push(`\t\t\t\t\t<cloud:report-reference description="${r.description}" type="WID">TODO_REPLACE_WITH_REPORT_WID</cloud:report-reference>`);
166
+ parts.push(`\t\t\t\t</cloud:report-alias>`);
167
+ }
168
+ else {
169
+ parts.push(`\t\t\t\t<cloud:report-alias description="${r.description}" name="${r.alias}"/>`);
170
+ }
171
+ }
172
+ }
173
+ parts.push(`\t\t\t</cloud:report-service>`);
174
+ }
175
+ // 2. Retrieval service for inbound file integrations
176
+ if (designBrief.data_source === 'inbound-file') {
177
+ parts.push(`\t\t\t<cloud:retrieval-service name="${projectName}_Retrieval"/>`);
178
+ }
179
+ // 3. Listener service for webhook/event-driven integrations
180
+ if (designBrief.data_source === 'webhook') {
181
+ parts.push(`\t\t\t<cloud:listener-service name="${projectName}_Listener"/>`);
182
+ }
183
+ // 4. Integration attributes (credentials + config)
184
+ const attrs = resolveAttributes(designBrief);
185
+ if (attrs.length > 0) {
186
+ parts.push(`\t\t\t<cloud:attribute-map-service name="${projectName}_Attributes">`);
187
+ for (const attr of attrs) {
188
+ parts.push(`\t\t\t\t<cloud:attribute name="${attr.name}">`);
189
+ parts.push(`\t\t\t\t\t<cloud:type><cloud:simple-type>text</cloud:simple-type></cloud:type>`);
190
+ if (attr.is_password)
191
+ parts.push(`\t\t\t\t\t<cloud:display-option>display-as-password</cloud:display-option>`);
192
+ if (attr.required)
193
+ parts.push(`\t\t\t\t\t<cloud:display-option>required-for-launch</cloud:display-option>`);
194
+ parts.push(`\t\t\t\t</cloud:attribute>`);
195
+ }
196
+ parts.push(`\t\t\t</cloud:attribute-map-service>`);
197
+ }
198
+ // 5. Launch params (from RAAS filter params when trigger is manual)
199
+ if (designBrief.trigger === 'launch-params-manual') {
200
+ const paramStubs = buildLaunchParamStubs(designBrief.raas_reports ?? []);
201
+ parts.push(...paramStubs);
202
+ }
203
+ return parts.join('\n');
204
+ }
205
+ function resolveAttributes(designBrief) {
206
+ const attrs = [];
207
+ const seen = new Set();
208
+ const add = (name, is_password = false, required = false) => {
209
+ if (!seen.has(name)) {
210
+ seen.add(name);
211
+ attrs.push({ name, is_password, required });
212
+ }
213
+ };
214
+ if (designBrief.external_auth === 'oauth2') {
215
+ add('Token URL', false, true);
216
+ add('Client ID', false, true);
217
+ add('Client Secret', true, true);
218
+ add('Refresh Token', true, true);
219
+ }
220
+ if (designBrief.external_auth === 'basic') {
221
+ add('API Username', false, true);
222
+ add('API Password', true, true);
223
+ }
224
+ if (designBrief.external_auth === 'api-key') {
225
+ add('API Key', true, true);
226
+ }
227
+ const needsUrl = designBrief.data_destination === 'external-rest'
228
+ || designBrief.data_source === 'external-rest'
229
+ || designBrief.data_destination === 'multiple';
230
+ if (needsUrl)
231
+ add('API URL', false, true);
232
+ for (const a of designBrief.integration_attributes ?? []) {
233
+ add(a.name, a.is_password ?? false, a.required ?? false);
234
+ }
235
+ return attrs;
236
+ }
237
+ function buildLaunchParamStubs(raasReports) {
238
+ const parts = [];
239
+ const seen = new Set();
240
+ for (const r of raasReports) {
241
+ for (const fp of r.filter_params ?? []) {
242
+ if (fp.startsWith('format='))
243
+ continue;
244
+ const key = fp.replace(/!.+$/, '');
245
+ if (seen.has(key))
246
+ continue;
247
+ seen.add(key);
248
+ const displayName = key.replace(/_/g, ' ');
249
+ const isRef = fp.includes('!');
250
+ parts.push(`\t\t\t<cloud:param name="${displayName}">`);
251
+ if (isRef) {
252
+ parts.push(`\t\t\t\t<cloud:type>`);
253
+ parts.push(`\t\t\t\t\t<cloud:class-report-field description="${displayName}" type="WID" singular="true">TODO_OBJECT_TYPE_WID</cloud:class-report-field>`);
254
+ parts.push(`\t\t\t\t</cloud:type>`);
255
+ }
256
+ else {
257
+ parts.push(`\t\t\t\t<cloud:type><cloud:simple-type>text</cloud:simple-type></cloud:type>`);
258
+ }
259
+ parts.push(`\t\t\t</cloud:param>`);
260
+ }
261
+ }
262
+ return parts;
263
+ }
264
+ // ─── assembly.xml skeleton ────────────────────────────────────────────────────
265
+ function buildAssemblyXml(projectName, subFlows, designBrief) {
266
+ const n = subFlows.length;
267
+ const lines = [];
268
+ lines.push(`<?xml version="1.0" encoding="UTF-8"?>
269
+ <beans
270
+ xmlns="http://www.springframework.org/schema/beans"
271
+ xmlns:beans="http://www.springframework.org/schema/beans"
272
+ xmlns:atom="http://www.w3.org/2005/Atom"
273
+ xmlns:cc="http://www.capeclear.com/assembly/10"
274
+ xmlns:cloud="urn:com.workday/esb/cloud/10.0"
275
+ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
276
+ xmlns:pi="urn:com.workday/picof"
277
+ xmlns:wd="urn:com.workday/bsvc"
278
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
279
+
280
+ \t<cc:assembly id="WorkdayAssembly" version="2024.37">`);
281
+ const firstTarget = n > 0 ? `Call${subFlows[0].id}` : 'End';
282
+ const declarations = buildWorkdayInDeclarations(projectName, designBrief);
283
+ const intSysBody = declarations ? `\n${declarations}\n\t\t\t` : '';
284
+ lines.push(`
285
+ \t\t<cc:workday-in id="StartHere" routes-to="${firstTarget}">
286
+ \t\t\t<cc:integration-system name="${projectName}">${intSysBody}</cc:integration-system>
287
+ \t\t</cc:workday-in>`);
288
+ // Sequential local-out chain
289
+ for (let i = 0; i < n; i++) {
290
+ const sf = subFlows[i];
291
+ const next = subFlows[i + 1];
292
+ const rrt = next ? `\n\t\t\troutes-response-to="Call${next.id}"` : '';
293
+ lines.push(`
294
+ \t\t<cc:local-out id="Call${sf.id}" store-message="none"${rrt}
295
+ \t\t\tendpoint="vm://${projectName}/${sf.id}"/>`);
296
+ }
297
+ // Sub-flow stubs
298
+ for (const sf of subFlows) {
299
+ lines.push(`
300
+ \t\t<cc:local-in id="${sf.id}" routes-to="Do${sf.id}"/>
301
+ \t\t<cc:async-mediation id="Do${sf.id}" handle-downstream-errors="true">
302
+ \t\t\t<cc:steps>
303
+ \t\t\t\t<cc:log id="TODO_${sf.id}">
304
+ \t\t\t\t\t<cc:log-message><cc:text>TODO: ${sf.description}</cc:text></cc:log-message>
305
+ \t\t\t\t</cc:log>
306
+ \t\t\t</cc:steps>
307
+ \t\t\t<cc:send-error id="${sf.id}Error" rethrow-error="false" routes-to="Put${sf.id}Error"/>
308
+ \t\t</cc:async-mediation>`);
309
+ }
310
+ // Global error handler
311
+ lines.push(`
312
+ \t\t<cc:send-error id="GlobalErrorHandler" rethrow-error="false" routes-to="DeliverError"/>
313
+ \t\t<cc:local-out id="DeliverError" store-message="none" endpoint="vm://wcc/PutIntegrationMessage">
314
+ \t\t\t<cc:set name="is.message.severity" value="'CRITICAL'"/>
315
+ \t\t\t<cc:set name="is.message.summary" value="'${projectName} failed: ' + context.errorMessage"/>
316
+ \t\t\t<cc:set name="is.document.deliverable" value="'false'"/>
317
+ \t\t</cc:local-out>`);
318
+ for (const sf of subFlows) {
319
+ lines.push(`
320
+ \t\t<cc:local-out id="Put${sf.id}Error" endpoint="vm://wcc/PutIntegrationMessage">
321
+ \t\t\t<cc:set name="is.message.severity" value="'ERROR'"/>
322
+ \t\t\t<cc:set name="is.message.summary" value="'${sf.id} failed'"/>
323
+ \t\t\t<cc:set name="is.message.detail" value="context.errorMessage"/>
324
+ \t\t</cc:local-out>`);
325
+ }
326
+ lines.push(`
327
+ \t</cc:assembly>
328
+
329
+ </beans>`);
330
+ return lines.join('');
331
+ }
332
+ // ─── EMF @mixed index helpers ─────────────────────────────────────────────────
333
+ //
334
+ // assembly.xml has NO XML comments (by design), so every element is at an odd
335
+ // @mixed index: element at 1-based position P → @mixed.(2P-1)
336
+ //
337
+ // Direct children of cc:assembly in generation order:
338
+ // P=1 workday-in StartHere
339
+ // P=2..1+N local-out Call{SF[0..N-1]}
340
+ // P=2+N+3*i local-in SF[i]
341
+ // P=3+N+3*i async-med Do{SF[i]}
342
+ // P=4+N+3*i note End{SF[i]} (actually send-error inside async-med)
343
+ // P=2+4N send-error GlobalErrorHandler
344
+ // P=3+4N local-out DeliverError
345
+ // P=4+4N+i local-out Put{SF[i]}Error
346
+ function mixedIdx(p) { return 2 * p - 1; }
347
+ function globalErrorPosition(n) { return 2 + 4 * n; }
348
+ function doSubFlowPosition(n, i) { return 3 + n + 3 * i; }
349
+ function globalErrorPath(n) { return `assembly.xml#//@beans/@mixed.1/@mixed.${mixedIdx(globalErrorPosition(n))}`; }
350
+ function sendErrorInsideDoSubFlow(n, i) {
351
+ return `assembly.xml#//@beans/@mixed.1/@mixed.${mixedIdx(doSubFlowPosition(n, i))}/@mixed.3`;
352
+ }
353
+ // ─── assembly-diagram.xml skeleton ───────────────────────────────────────────
354
+ function buildDiagramXml(projectName, subFlows) {
355
+ const n = subFlows.length;
356
+ const lines = [];
357
+ lines.push(`<?xml version="1.0" encoding="UTF-8"?>
358
+ <wdnm:Diagram xmlns:wdnm="http://workday.com/studio/editors/notation">
359
+ <element href="assembly.xml#WorkdayAssembly"/>`);
360
+ lines.push(vp(60, 200, 'StartHere'));
361
+ for (let i = 0; i < n; i++)
362
+ lines.push(vp(320 + i * 150, 200, `Call${subFlows[i].id}`));
363
+ lines.push(` <visualProperties>\n <element href="${globalErrorPath(n)}"/>\n </visualProperties>`);
364
+ lines.push(vp(450, 65, 'DeliverError'));
365
+ for (let i = 0; i < n; i++) {
366
+ const yBase = 360 + i * 180;
367
+ lines.push(vp(60, yBase, subFlows[i].id));
368
+ lines.push(vp(350, yBase, `Put${subFlows[i].id}Error`));
369
+ lines.push(vp(170, yBase + 55, `Do${subFlows[i].id}`));
370
+ }
371
+ lines.push(conn('routesTo', 'StartHere', `Call${subFlows[0].id}`));
372
+ for (let i = 0; i < n - 1; i++) {
373
+ lines.push(conn('routesResponseTo', `Call${subFlows[i].id}`, `Call${subFlows[i + 1].id}`));
374
+ }
375
+ for (const sf of subFlows) {
376
+ lines.push(conn('routesTo', sf.id, `Do${sf.id}`));
377
+ }
378
+ for (let i = 0; i < n; i++)
379
+ lines.push(conn('routesTo', `Call${subFlows[i].id}`, subFlows[i].id));
380
+ lines.push(` <connections type="routesTo">\n <source href="${globalErrorPath(n)}"/>\n <target href="assembly.xml#DeliverError"/>\n </connections>`);
381
+ for (let i = 0; i < n; i++) {
382
+ lines.push(` <connections type="routesTo">\n <source href="${sendErrorInsideDoSubFlow(n, i)}"/>\n <target href="assembly.xml#Put${subFlows[i].id}Error"/>\n </connections>`);
383
+ }
384
+ const mainElems = ['StartHere', ...subFlows.map(sf => `Call${sf.id}`)];
385
+ lines.push(swimlane(30, 140, 'Main Flow', 'MIDDLE', mainElems));
386
+ lines.push(swimlane(30, 20, 'Error Handler', 'END', [{ emf: globalErrorPath(n) }, 'DeliverError']));
387
+ for (let i = 0; i < n; i++) {
388
+ const sf = subFlows[i];
389
+ const yH = 340 + i * 180;
390
+ const vIdx = 3 + 2 * i;
391
+ lines.push(swimlane(30, yH, `${sf.id} Sub-flow`, 'MIDDLE', [sf.id, { nested: vIdx }, `Put${sf.id}Error`]));
392
+ lines.push(swimlaneVertical(170, yH + 15, `Do${sf.id}`, `Put${sf.id}Error`));
393
+ }
394
+ lines.push(`\n</wdnm:Diagram>`);
395
+ return lines.join('\n');
396
+ }
397
+ function vp(x, y, id) {
398
+ return ` <visualProperties x="${x}" y="${y}">\n <element href="assembly.xml#${id}"/>\n </visualProperties>`;
399
+ }
400
+ function conn(type, src, tgt) {
401
+ return ` <connections type="${type}">\n <source href="assembly.xml#${src}"/>\n <target href="assembly.xml#${tgt}"/>\n </connections>`;
402
+ }
403
+ function swimlane(x, y, name, alignment, elements) {
404
+ const elemsXml = elements.map(e => {
405
+ if (typeof e === 'string')
406
+ return ` <elements href="assembly.xml#${e}"/>`;
407
+ if ('emf' in e)
408
+ return ` <elements href="${e.emf}"/>`;
409
+ if ('nested' in e)
410
+ return ` <elements href="#//@swimlanes.${e.nested}"/>`;
411
+ return '';
412
+ }).join('\n');
413
+ return ` <swimlanes x="${x}" y="${y}" name="${name}" alignment="${alignment}" labelAlignment="LEFT">\n${elemsXml}\n </swimlanes>`;
414
+ }
415
+ function swimlaneVertical(x, y, asyncMedId, errorLocalOutId) {
416
+ return ` <swimlanes x="${x}" y="${y}" name="Swimlane" orientation="VERTICAL">
417
+ <elements href="assembly.xml#${asyncMedId}"/>
418
+ <elements href="assembly.xml#${errorLocalOutId}"/>
419
+ </swimlanes>`;
420
+ }
421
+ // ─── Planning document ────────────────────────────────────────────────────────
422
+ function buildPlanDocument(projectName, subFlows, designBrief) {
423
+ const n = subFlows.length;
424
+ const chain = subFlows.map((sf, i) => {
425
+ const next = subFlows[i + 1];
426
+ return `Call${sf.id}${next ? ` →(routes-response-to)→ Call${next.id}` : ' (final)'}`;
427
+ }).join('\n ');
428
+ const contract = subFlows.map(sf => ({
429
+ sub_flow: sf.id,
430
+ description: sf.description,
431
+ reads_props: sf.reads_props ?? ['(define before building)'],
432
+ writes_props: sf.writes_props ?? ['(define before building)'],
433
+ error_handler: `Put${sf.id}Error`,
434
+ }));
435
+ const emfSummary = {
436
+ GlobalErrorHandler: `@mixed.${mixedIdx(globalErrorPosition(n))}`,
437
+ ...Object.fromEntries(subFlows.map((sf, i) => [
438
+ `${sf.id}Error (send-error inside Do${sf.id})`,
439
+ `//@beans/@mixed.1/@mixed.${mixedIdx(doSubFlowPosition(n, i))}/@mixed.3`,
440
+ ])),
441
+ };
442
+ const attrs = resolveAttributes(designBrief);
443
+ const autoGenerated = [];
444
+ if (designBrief.data_source === 'raas' || designBrief.data_source === 'multiple') {
445
+ const count = designBrief.raas_reports?.length ?? 0;
446
+ autoGenerated.push(`cloud:report-service "${projectName}_Reports" with ${count} alias${count !== 1 ? 'es' : ''}`);
447
+ }
448
+ if (designBrief.data_source === 'inbound-file')
449
+ autoGenerated.push(`cloud:retrieval-service "${projectName}_Retrieval"`);
450
+ if (designBrief.data_source === 'webhook')
451
+ autoGenerated.push(`cloud:listener-service "${projectName}_Listener"`);
452
+ if (attrs.length > 0) {
453
+ autoGenerated.push(`cloud:attribute-map-service "${projectName}_Attributes": ${attrs.map(a => a.name).join(', ')}`);
454
+ }
455
+ const gaps = buildGaps(designBrief, subFlows);
456
+ return {
457
+ integration: projectName,
458
+ design_brief: {
459
+ data_source: designBrief.data_source,
460
+ data_destination: designBrief.data_destination,
461
+ trigger: designBrief.trigger,
462
+ record_volume: designBrief.record_volume,
463
+ external_auth: designBrief.external_auth ?? 'none',
464
+ error_handling: designBrief.error_handling,
465
+ raas_reports: designBrief.raas_reports?.map(r => r.alias) ?? [],
466
+ soap_operations: designBrief.soap_operations?.map(s => `${s.application}.${s.operation} v${s.version} (${s.direction})`) ?? [],
467
+ conditional_logic: designBrief.conditional_logic ?? 'none',
468
+ },
469
+ auto_generated_in_workday_in: autoGenerated.length ? autoGenerated : ['none — no special declarations needed'],
470
+ gaps_to_fill: gaps,
471
+ sub_flow_count: n,
472
+ execution_chain: chain,
473
+ props_contract: contract,
474
+ swimlane_layout: subFlows.map((sf, i) => ({
475
+ [`swimlanes.${2 + 2 * i}`]: `${sf.id} Sub-flow (horizontal)`,
476
+ [`swimlanes.${3 + 2 * i}`]: `Do${sf.id} VERTICAL (nested inside above)`,
477
+ })),
478
+ emf_xpath_summary: emfSummary,
479
+ build_order: buildBuildOrder(subFlows, designBrief),
480
+ warnings: [
481
+ 'Do NOT add XML comments to assembly.xml — they shift @mixed indices and break all diagram connections',
482
+ 'Props keys with dots (e.g. my.prop.name) are fine in MVEL but MUST use underscores as xsl:param names',
483
+ 'xml-stream-splitter streams records one at a time — parts[0] inside async-mediation has ONE entry',
484
+ 'xpath-splitter loads all records into memory — only use for small datasets (<100 records)',
485
+ ],
486
+ };
487
+ }
488
+ function buildGaps(designBrief, subFlows) {
489
+ const gaps = [];
490
+ if (designBrief.data_source === 'raas' && !(designBrief.raas_reports?.length)) {
491
+ gaps.push('RAAS reports not specified — add cloud:report-alias entries after creating reports in Workday UI');
492
+ }
493
+ if (designBrief.raas_reports?.some(r => r.has_reference_wid)) {
494
+ gaps.push('Replace TODO_REPLACE_WITH_REPORT_WID placeholders with actual report WIDs from Workday tenant');
495
+ }
496
+ if (designBrief.trigger === 'launch-params-manual' &&
497
+ designBrief.raas_reports?.some(r => r.filter_params?.some(fp => fp.includes('!')))) {
498
+ gaps.push('Replace TODO_OBJECT_TYPE_WID in cloud:class-report-field with correct Workday object type descriptor WIDs');
499
+ }
500
+ if (designBrief.soap_operations?.length) {
501
+ const ops = designBrief.soap_operations.map(s => `${s.application}.${s.operation}`).join(', ');
502
+ gaps.push(`SOAP XSL transforms not generated — create one XSL per operation using create_xsl_transform: ${ops}`);
503
+ gaps.push(`ISU domain permissions required for ${ops} — user/admin configures this in the Workday tenant`);
504
+ }
505
+ if (designBrief.conditional_logic) {
506
+ gaps.push(`Conditional logic not scaffolded: "${designBrief.conditional_logic}" — add cc:route steps or execute-when attributes manually`);
507
+ }
508
+ if (designBrief.error_handling.includes('email-notification')) {
509
+ gaps.push('Email-notification error handling selected — add email-out step inside error handlers with recipient and template');
510
+ }
511
+ if (designBrief.external_auth === 'oauth2') {
512
+ gaps.push('OAuth2 GetToken sub-flow not generated — add cc:http-out POST to Token URL, extract access_token from response');
513
+ }
514
+ return gaps.length ? gaps : ['No critical gaps — all required declarations were generated'];
515
+ }
516
+ function buildBuildOrder(subFlows, designBrief) {
517
+ const n = subFlows.length;
518
+ const steps = ['1. Open assembly-diagram.xml in Studio — verify all swimlanes render correctly'];
519
+ let i = 2;
520
+ if (designBrief.data_source === 'raas') {
521
+ steps.push(`${i++}. Verify RAAS reports exist in Workday tenant; confirm alias names match cloud:report-alias`);
522
+ if (designBrief.raas_reports?.some(r => r.has_reference_wid)) {
523
+ steps.push(`${i++}. Replace TODO_REPLACE_WITH_REPORT_WID with actual WIDs from the Workday report URL`);
524
+ }
525
+ }
526
+ if (designBrief.data_source === 'soap-get' || designBrief.data_destination === 'workday-soap-write') {
527
+ steps.push(`${i++}. Create XSL transforms for SOAP operations using create_xsl_transform`);
528
+ steps.push(`${i++}. Verify ISU has the required domain security permissions for each SOAP call`);
529
+ }
530
+ if (designBrief.external_auth === 'oauth2') {
531
+ steps.push(`${i++}. Build and test GetToken sub-flow (cc:http-out POST → extract access_token) before other sub-flows`);
532
+ }
533
+ if (designBrief.external_auth !== 'none' && designBrief.external_auth !== undefined) {
534
+ steps.push(`${i++}. Configure integration attributes in Workday UI (${designBrief.external_auth} credentials)`);
535
+ }
536
+ for (let j = 0; j < n; j++) {
537
+ steps.push(`${i++}. Fill in Do${subFlows[j].id}: ${subFlows[j].description}`);
538
+ }
539
+ if (designBrief.record_volume === 'large') {
540
+ steps.push(`${i++}. IMPORTANT: Replace xpath-splitter stubs with xml-stream-splitter — large volume requires streaming`);
541
+ }
542
+ if (designBrief.error_handling.includes('email-notification')) {
543
+ steps.push(`${i++}. Add email-out step in error handlers for failure notification`);
544
+ }
545
+ steps.push(`${i++}. For each RAAS-consuming sub-flow: ask user for a sample report XML response to derive accurate XPath mappings`);
546
+ steps.push(`${i++}. Test each sub-flow independently before running end-to-end`);
547
+ steps.push(`${i++}. Run full integration test on Workday Implementation tenant before deploying to Production`);
548
+ return steps;
549
+ }
550
+ //# sourceMappingURL=plan-integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-integration.js","sourceRoot":"","sources":["../../src/tools/plan-integration.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;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,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,iFAAiF;AAEjF,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;SAC9F,QAAQ,CAAC,2LAA2L,CAAC;IAExM,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,oBAAoB,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;SAC/H,QAAQ,CAAC,gLAAgL,CAAC;IAE7L,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC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B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,eAAe,QAAQ,CAAC,CAAC,CAAE,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,IAAI,WAAW,CAAC,aAAa,KAAK,OAAO,EAAE,CAAC;QAC1C,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,sGAAsG,CAAC,CAAC;IAC3H,CAAC;IACD,IAAI,WAAW,CAAC,cAAc,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC9D,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,iEAAiE,CAAC,CAAC;IACtF,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,iHAAiH,CAAC,CAAC;IACpI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,8DAA8D,CAAC,CAAC;IACjF,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,6FAA6F,CAAC,CAAC;IAEhH,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * update_sub_flow — replace the <cc:steps> body of a named sub-flow in assembly.xml.
3
+ * Ported from the reference implementation (update-sub-flow.mjs).
4
+ */
5
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
+ export declare function register(server: McpServer): void;
7
+ //# sourceMappingURL=update-sub-flow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-sub-flow.d.ts","sourceRoot":"","sources":["../../src/tools/update-sub-flow.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA0IhD"}