@exaudeus/workrail 0.8.0 → 0.8.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 (28) hide show
  1. package/dist/application/app.d.ts +0 -1
  2. package/dist/application/app.js +0 -6
  3. package/dist/application/services/workflow-service.js +56 -4
  4. package/dist/mcp-server.js +0 -35
  5. package/package.json +1 -1
  6. package/workflows/bug-investigation.agentic.json +112 -0
  7. package/workflows/document-creation-workflow.json +1 -1
  8. package/workflows/documentation-update-workflow.json +1 -1
  9. package/workflows/routines/plan-analysis.json +139 -0
  10. package/workflows/scoped-documentation-workflow.json +252 -0
  11. package/workflows/workflow-diagnose-environment.json +24 -0
  12. package/spec/mcp-compliance-summary.md +0 -211
  13. package/spec/mcp-protocol-handshake.md +0 -604
  14. package/web/DESIGN_SYSTEM_INTEGRATION.md +0 -305
  15. package/web/assets/images/favicon-amber-16.png +0 -0
  16. package/web/assets/images/favicon-amber-32.png +0 -0
  17. package/web/assets/images/favicon-white-16-clean.png +0 -0
  18. package/web/assets/images/favicon-white-32-clean.png +0 -0
  19. package/web/assets/images/icon-amber-192.png +0 -0
  20. package/web/assets/images/icon-amber-512.png +0 -0
  21. package/web/assets/images/icon-amber.svg +0 -27
  22. package/web/assets/images/icon-white-192-clean.png +0 -0
  23. package/web/assets/images/icon-white-512-clean.png +0 -0
  24. package/web/assets/images/icon-white.svg +0 -27
  25. package/web/examples/BEFORE_AFTER.md +0 -691
  26. package/workflows/IMPROVEMENTS-simplified.md +0 -122
  27. package/workflows/systematic-bug-investigation-simplified.backup-20251106-155300.json +0 -117
  28. package/workflows/systematic-bug-investigation-with-loops.backup-20251106-162241.json +0 -731
@@ -1,604 +0,0 @@
1
- # MCP Protocol Handshake Specification
2
-
3
- > 🤝 **Specification for the MCP protocol handshake**
4
-
5
- [![Status](https://img.shields.io/badge/status-specification-orange.svg)](https://github.com/EtienneBBeaulac/mcp)
6
- [![Spec Version](https://img.shields.io/badge/spec-1.0.0-blue.svg)](specs/)
7
- [![MCP Version](https://img.shields.io/badge/MCP-2024--11--05-blue.svg)](https://modelcontextprotocol.org)
8
- [![Protocol](https://img.shields.io/badge/protocol-JSON--RPC%202.0-green.svg)](https://www.jsonrpc.org/specification)
9
-
10
- ---
11
-
12
- ## Purpose & Scope
13
-
14
- This specification defines the MCP (Model Context Protocol) handshake and initialization protocol for the Workflow Orchestration System's `workflowlookup` server. It covers server initialization, tool discovery, error handling, communication framing, and lifecycle requirements for MCP-compliant servers and clients.
15
-
16
- This document is normative for all implementations of the workflowlookup MCP server and any client wishing to interoperate with it.
17
-
18
- ## Normative Language
19
-
20
- The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://datatracker.ietf.org/doc/html/rfc2119).
21
-
22
- ---
23
-
24
- ## Overview
25
-
26
- This document specifies the MCP (Model Context Protocol) implementation for the workflowlookup server. The server follows the MCP standard for server initialization, tool discovery, and communication.
27
-
28
- **Protocol Version**: `2024-11-05`
29
- **Base Protocol**: JSON-RPC 2.0
30
- **Transport**: stdio (standard input/output)
31
- **Encoding**: UTF-8
32
- **Framing**: Newline-delimited JSON messages (one message per line)
33
-
34
- ## Server Initialization
35
-
36
- ### Initialize Request
37
-
38
- The client must send an `initialize` request to establish the connection:
39
-
40
- ```json
41
- {
42
- "jsonrpc": "2.0",
43
- "id": 1,
44
- "method": "initialize",
45
- "params": {
46
- "protocolVersion": "2024-11-05",
47
- "capabilities": {
48
- "tools": {}
49
- },
50
- "clientInfo": {
51
- "name": "claude-desktop",
52
- "version": "1.0.0"
53
- }
54
- }
55
- }
56
- ```
57
-
58
- **Parameters:**
59
- - `protocolVersion` (required): MCP protocol version being used
60
- - `capabilities` (required): Client capabilities object
61
- - `clientInfo` (optional): Client information
62
- - `name`: Client name (e.g., "claude-desktop", "firebender")
63
- - `version`: Client version string
64
-
65
- ### Initialize Response
66
-
67
- The server responds with its capabilities and information:
68
-
69
- ```json
70
- {
71
- "jsonrpc": "2.0",
72
- "id": 1,
73
- "result": {
74
- "protocolVersion": "2024-11-05",
75
- "capabilities": {
76
- "tools": {
77
- "listChanged": false,
78
- "notifyProgress": false
79
- },
80
- "resources": {
81
- "listChanged": false
82
- }
83
- },
84
- "serverInfo": {
85
- "name": "workflowlookup",
86
- "version": "1.0.0",
87
- "description": "Workflow Orchestration System MCP Server"
88
- }
89
- }
90
- }
91
- ```
92
-
93
- **Response Fields:**
94
- - `protocolVersion`: Confirms the protocol version being used
95
- - `capabilities`: Server capabilities
96
- - `tools.listChanged`: Whether server supports tool list change notifications
97
- - `tools.notifyProgress`: Whether server supports progress notifications
98
- - `resources.listChanged`: Whether server supports resource list change notifications
99
- - `serverInfo`: Information about the server
100
- - `name`: Server name identifier
101
- - `version`: Server version following semantic versioning
102
- - `description`: Human-readable server description
103
-
104
- ### Initialize Error Cases
105
-
106
- ```json
107
- // Unsupported protocol version
108
- {
109
- "jsonrpc": "2.0",
110
- "id": 1,
111
- "error": {
112
- "code": -32000,
113
- "message": "Unsupported protocol version",
114
- "data": {
115
- "supportedVersions": ["2024-11-05"],
116
- "requestedVersion": "2024-10-01"
117
- }
118
- }
119
- }
120
-
121
- // Invalid initialization parameters
122
- {
123
- "jsonrpc": "2.0",
124
- "id": 1,
125
- "error": {
126
- "code": -32602,
127
- "message": "Invalid params",
128
- "data": {
129
- "details": "protocolVersion is required"
130
- }
131
- }
132
- }
133
- ```
134
-
135
- ## Tool Discovery
136
-
137
- ### Tools List Request
138
-
139
- After successful initialization, the client requests available tools:
140
-
141
- ```json
142
- {
143
- "jsonrpc": "2.0",
144
- "id": 2,
145
- "method": "tools/list",
146
- "params": {}
147
- }
148
- ```
149
-
150
- ### Tools List Response
151
-
152
- The server responds with all available tools, their schemas, and metadata:
153
-
154
- ```json
155
- {
156
- "jsonrpc": "2.0",
157
- "id": 2,
158
- "result": {
159
- "tools": [
160
- {
161
- "name": "workflow_list",
162
- "description": "Lists all available workflows",
163
- "inputSchema": {
164
- "type": "object",
165
- "properties": {},
166
- "required": [],
167
- "additionalProperties": false
168
- },
169
- "outputSchema": {
170
- "type": "object",
171
- "properties": {
172
- "workflows": {
173
- "type": "array",
174
- "items": {
175
- "type": "object",
176
- "properties": {
177
- "id": {"type": "string"},
178
- "name": {"type": "string"},
179
- "description": {"type": "string"},
180
- "category": {"type": "string"},
181
- "version": {"type": "string"}
182
- },
183
- "required": ["id", "name", "description", "category", "version"]
184
- }
185
- }
186
- },
187
- "required": ["workflows"]
188
- },
189
- "examples": {
190
- "request": {"method": "workflow_list", "params": {}},
191
- "response": {"workflows": [{"id": "ai-task-implementation", "name": "AI Task Prompt Workflow", "description": "Guides through task understanding → planning → implementation → verification", "category": "development", "version": "1.0.0"}]}
192
- }
193
- },
194
- {
195
- "name": "workflow_get",
196
- "description": "Retrieves a specific workflow by ID",
197
- "inputSchema": {
198
- "type": "object",
199
- "properties": {
200
- "id": {
201
- "type": "string",
202
- "description": "The workflow ID to retrieve",
203
- "pattern": "^[a-z0-9-]+$",
204
- "minLength": 3,
205
- "maxLength": 64
206
- }
207
- },
208
- "required": ["id"],
209
- "additionalProperties": false
210
- },
211
- "outputSchema": {
212
- "$ref": "workflow.schema.json"
213
- },
214
- "examples": {
215
- "request": {"method": "workflow_get", "params": {"id": "ai-task-implementation"}},
216
- "response": {"id": "ai-task-implementation", "name": "AI Task Prompt Workflow", "description": "Complete task implementation with verification", "preconditions": ["Task description is clear and complete"], "steps": [{"id": "understand", "title": "Deep understanding of task and codebase", "prompt": "Analyze the task description...", "requireConfirmation": true}]}
217
- }
218
- },
219
- {
220
- "name": "workflow_next",
221
- "description": "Gets the next step guidance based on workflow state",
222
- "inputSchema": {
223
- "type": "object",
224
- "properties": {
225
- "workflowId": {
226
- "type": "string",
227
- "description": "The workflow ID",
228
- "pattern": "^[a-z0-9-]+$",
229
- "minLength": 3,
230
- "maxLength": 64
231
- },
232
- "currentStep": {
233
- "type": "string",
234
- "description": "Current step ID (optional)",
235
- "pattern": "^[a-z0-9-]+$",
236
- "minLength": 3,
237
- "maxLength": 64
238
- },
239
- "completedSteps": {
240
- "type": "array",
241
- "description": "Array of completed step IDs",
242
- "items": {"type": "string", "pattern": "^[a-z0-9-]+$"},
243
- "uniqueItems": true
244
- },
245
- "context": {
246
- "type": "object",
247
- "description": "Optional execution context for evaluating step conditions. Can contain variables like taskScope, userExpertise, complexity, etc.",
248
- "additionalProperties": true
249
- }
250
- },
251
- "required": ["workflowId", "completedSteps"],
252
- "additionalProperties": false
253
- },
254
- "outputSchema": {
255
- "type": "object",
256
- "properties": {
257
- "step": {"type": "object"},
258
- "guidance": {"type": "object"},
259
- "isComplete": {"type": "boolean"}
260
- },
261
- "required": ["step", "guidance", "isComplete"]
262
- },
263
- "examples": {
264
- "request": {"method": "workflow_next", "params": {"workflowId": "ai-task-implementation", "completedSteps": [], "context": {"taskId": "TASK-123"}}},
265
- "response": {"step": {"id": "understand", "title": "Understand the task", "prompt": "Analyze the requirements..."}, "guidance": {"prompt": "PREP: ... IMPLEMENT: ... VERIFY: ..."}, "isComplete": false}
266
- }
267
- },
268
- {
269
- "name": "workflow_validate",
270
- "description": "Validates step output against workflow requirements",
271
- "inputSchema": {
272
- "type": "object",
273
- "properties": {
274
- "workflowId": {
275
- "type": "string",
276
- "description": "The workflow ID",
277
- "pattern": "^[a-z0-9-]+$",
278
- "minLength": 3,
279
- "maxLength": 64
280
- },
281
- "stepId": {
282
- "type": "string",
283
- "description": "The step ID to validate",
284
- "pattern": "^[a-z0-9-]+$",
285
- "minLength": 3,
286
- "maxLength": 64
287
- },
288
- "output": {
289
- "type": "string",
290
- "description": "The step output to validate",
291
- "minLength": 1
292
- }
293
- },
294
- "required": ["workflowId", "stepId", "output"],
295
- "additionalProperties": false
296
- },
297
- "outputSchema": {
298
- "type": "object",
299
- "properties": {
300
- "valid": {"type": "boolean"},
301
- "issues": {"type": "array", "items": {"type": "string"}},
302
- "suggestions": {"type": "array", "items": {"type": "string"}}
303
- },
304
- "required": ["valid"]
305
- },
306
- "examples": {
307
- "request": {"method": "workflow_validate", "params": {"workflowId": "ai-task-implementation", "stepId": "understand", "output": "I have analyzed the requirements."}},
308
- "response": {"valid": true, "issues": [], "suggestions": []}
309
- }
310
- }
311
- ]
312
- }
313
- }
314
- ```
315
-
316
- ## Error Handling
317
-
318
- ### MCP Standard Error Codes
319
-
320
- | Code | Message | Description |
321
- |------|---------|-------------|
322
- | -32700 | Parse error | Invalid JSON was received |
323
- | -32600 | Invalid Request | The JSON sent is not a valid Request object |
324
- | -32601 | Method not found | The method does not exist |
325
- | -32602 | Invalid params | Invalid method parameter(s) |
326
- | -32603 | Internal error | Internal JSON-RPC error |
327
- | -32000 | Server error | Server-specific error |
328
- | -32001 | Workflow not found | The specified workflow ID does not exist |
329
- | -32002 | Invalid workflow | The workflow file is malformed or invalid |
330
- | -32003 | Step not found | The specified step ID does not exist |
331
-
332
- ### Error Response Format
333
-
334
- ```json
335
- {
336
- "jsonrpc": "2.0",
337
- "id": number | string | null,
338
- "error": {
339
- "code": number,
340
- "message": string,
341
- "data": any
342
- }
343
- }
344
- ```
345
-
346
- ### Error Response Examples
347
-
348
- ```json
349
- // Parse error
350
- {
351
- "jsonrpc": "2.0",
352
- "id": null,
353
- "error": {
354
- "code": -32700,
355
- "message": "Parse error",
356
- "data": {"details": "Unexpected token in JSON"}
357
- }
358
- }
359
-
360
- // Method not found
361
- {
362
- "jsonrpc": "2.0",
363
- "id": 3,
364
- "error": {
365
- "code": -32601,
366
- "message": "Method not found",
367
- "data": {"method": "non_existent_tool"}
368
- }
369
- }
370
-
371
- // Invalid params
372
- {
373
- "jsonrpc": "2.0",
374
- "id": 4,
375
- "error": {
376
- "code": -32602,
377
- "message": "Invalid params",
378
- "data": {"details": "workflowId is required"}
379
- }
380
- }
381
-
382
- // Workflow not found
383
- {
384
- "jsonrpc": "2.0",
385
- "id": 5,
386
- "error": {
387
- "code": -32001,
388
- "message": "Workflow not found",
389
- "data": {"workflowId": "nonexistent-workflow"}
390
- }
391
- }
392
-
393
- // Step not found
394
- {
395
- "jsonrpc": "2.0",
396
- "id": 6,
397
- "error": {
398
- "code": -32003,
399
- "message": "Step not found",
400
- "data": {"stepId": "nonexistent-step"}
401
- }
402
- }
403
- ```
404
-
405
- ## Communication Protocol
406
-
407
- - **Encoding**: UTF-8
408
- - **Framing**: One JSON-RPC message per line (newline-delimited)
409
- - **Transport**: stdio (stdin/stdout)
410
- - **Buffering**: Each message must be a single line, no embedded newlines
411
- - **Order**: Messages must be processed in the order received
412
-
413
- ## Server Lifecycle
414
-
415
- ### Startup
416
- - Server starts and waits for `initialize` request
417
- - No tool calls are processed before initialization
418
-
419
- ### Shutdown
420
- - Server should implement a `shutdown` method:
421
-
422
- ```json
423
- {
424
- "jsonrpc": "2.0",
425
- "id": 99,
426
- "method": "shutdown",
427
- "params": {}
428
- }
429
- ```
430
-
431
- - Server responds with:
432
-
433
- ```json
434
- {
435
- "jsonrpc": "2.0",
436
- "id": 99,
437
- "result": null
438
- }
439
- ```
440
-
441
- - After responding, the server should exit gracefully
442
-
443
- ### Keepalive/Heartbeat
444
- - Not required for stdio transport, but server should handle long periods of inactivity gracefully
445
-
446
- ### Error Recovery
447
- - On fatal error, server should emit an error response and exit with nonzero status
448
- - On recoverable error, server should emit an error response and continue processing
449
-
450
- ## Complete Handshake Example
451
-
452
- ```json
453
- // 1. Client sends initialize request
454
- {
455
- "jsonrpc": "2.0",
456
- "id": 1,
457
- "method": "initialize",
458
- "params": {
459
- "protocolVersion": "2024-11-05",
460
- "capabilities": {"tools": {}},
461
- "clientInfo": {"name": "claude-desktop", "version": "1.0.0"}
462
- }
463
- }
464
-
465
- // 2. Server responds with capabilities
466
- {
467
- "jsonrpc": "2.0",
468
- "id": 1,
469
- "result": {
470
- "protocolVersion": "2024-11-05",
471
- "capabilities": {"tools": {"listChanged": false, "notifyProgress": false}, "resources": {"listChanged": false}},
472
- "serverInfo": {"name": "workflowlookup", "version": "1.0.0", "description": "Workflow Orchestration System MCP Server"}
473
- }
474
- }
475
-
476
- // 3. Client requests tool list
477
- {
478
- "jsonrpc": "2.0",
479
- "id": 2,
480
- "method": "tools/list",
481
- "params": {}
482
- }
483
-
484
- // 4. Server provides tool schemas (all tools shown)
485
- {
486
- "jsonrpc": "2.0",
487
- "id": 2,
488
- "result": {
489
- "tools": [
490
- {"name": "workflow_list", ...},
491
- {"name": "workflow_get", ...},
492
- {"name": "workflow_next", ...},
493
- {"name": "workflow_validate", ...}
494
- ]
495
- }
496
- }
497
-
498
- // 5. Client can now call tools
499
- {
500
- "jsonrpc": "2.0",
501
- "id": 3,
502
- "method": "workflow_list",
503
- "params": {}
504
- }
505
-
506
- // 6. Server responds with tool result
507
- {
508
- "jsonrpc": "2.0",
509
- "id": 3,
510
- "result": {
511
- "workflows": [
512
- {"id": "ai-task-implementation", "name": "AI Task Prompt Workflow", "description": "Guides through task understanding → planning → implementation → verification", "category": "development", "version": "1.0.0"}
513
- ]
514
- }
515
- }
516
- ```
517
-
518
- ## Implementation Requirements
519
-
520
- ### Server Implementation Checklist
521
-
522
- - [ ] **Protocol Compliance**
523
- - Implement JSON-RPC 2.0 message handling
524
- - Support MCP protocol version `2024-11-05`
525
- - Handle stdio communication correctly
526
-
527
- - [ ] **Initialization**
528
- - Respond to `initialize` requests
529
- - Provide server capabilities
530
- - Validate protocol version compatibility
531
-
532
- - [ ] **Tool Discovery**
533
- - Implement `tools/list` method
534
- - Provide complete tool schemas (input/output)
535
- - Validate tool input parameters
536
-
537
- - [ ] **Error Handling**
538
- - Use standard MCP error codes
539
- - Provide meaningful error messages
540
- - Include error context in data field
541
-
542
- ### Testing Requirements
543
-
544
- - [ ] **Protocol Tests**
545
- - Test initialization handshake
546
- - Test tool discovery
547
- - Test error handling
548
-
549
- - [ ] **Schema Tests**
550
- - Validate tool input/output schemas
551
- - Test parameter validation
552
- - Test error responses
553
-
554
- ## Versioning & Compatibility
555
-
556
- - **Protocol Version**: `2024-11-05`
557
- - **Specification Version**: 1.0.0
558
- - The server MUST reject initialization requests with unsupported protocol versions.
559
- - Backward-incompatible changes will increment the protocol version.
560
- - Workflows and clients SHOULD specify the minimum compatible server version if applicable.
561
-
562
- ---
563
-
564
- ## Conformance
565
-
566
- An implementation is conformant if it:
567
- - Implements all required request/response structures as specified
568
- - Handles all error cases as described
569
- - Follows the communication, encoding, and framing requirements
570
- - Passes all protocol and schema tests outlined in this document
571
-
572
- Non-conformant implementations MUST NOT claim MCP compatibility.
573
-
574
- ---
575
-
576
- ## Glossary
577
-
578
- - **MCP**: Model Context Protocol
579
- - **Stdio**: Standard input/output (process communication channel)
580
- - **Tool**: An API method exposed by the MCP server
581
- - **Handshake**: The initialization exchange between client and server
582
- - **Capabilities**: Features supported by the client or server, exchanged during initialization
583
-
584
- ---
585
-
586
- ## Changelog
587
-
588
- - **2024-11-05**: Initial version, complete handshake, tool discovery, error handling, and lifecycle specification.
589
-
590
- ---
591
-
592
- ## References
593
-
594
- - [Model Context Protocol](https://modelcontextprotocol.org)
595
- - [JSON-RPC 2.0 Specification](https://www.jsonrpc.org/specification)
596
- - [MCP Server Implementation Guide](https://modelcontextprotocol.io/docs/server-implementation)
597
- - [Workflow API Specification](mcp-api-v1.0.md)
598
- - [Workflow Schema](workflow.schema.json)
599
-
600
- ---
601
-
602
- **Last Updated**: 2024-01-15
603
- **Specification Version**: 1.0.0
604
- **MCP Protocol Version**: 2024-11-05