tachibot-mcp 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 (214) hide show
  1. package/.env.example +260 -0
  2. package/CHANGELOG.md +54 -0
  3. package/CODE_OF_CONDUCT.md +56 -0
  4. package/CONTRIBUTING.md +54 -0
  5. package/Dockerfile +36 -0
  6. package/LICENSE +644 -0
  7. package/README.md +201 -0
  8. package/SECURITY.md +95 -0
  9. package/dist/personality/komaai-expressions.js +12 -0
  10. package/dist/profiles/balanced.json +33 -0
  11. package/dist/profiles/code_focus.json +33 -0
  12. package/dist/profiles/full.json +33 -0
  13. package/dist/profiles/minimal.json +33 -0
  14. package/dist/profiles/research_power.json +33 -0
  15. package/dist/scripts/build-profiles.js +46 -0
  16. package/dist/src/application/services/focus/FocusModeRegistry.js +46 -0
  17. package/dist/src/application/services/focus/FocusTool.service.js +109 -0
  18. package/dist/src/application/services/focus/ModeRegistry.js +46 -0
  19. package/dist/src/application/services/focus/modes/focus-deep.mode.js +27 -0
  20. package/dist/src/application/services/focus/modes/status.mode.js +50 -0
  21. package/dist/src/application/services/focus/modes/tachibot-status.mode.js +50 -0
  22. package/dist/src/collaborative-orchestrator.js +391 -0
  23. package/dist/src/config/model-constants.js +188 -0
  24. package/dist/src/config/model-defaults.js +57 -0
  25. package/dist/src/config/model-preferences.js +382 -0
  26. package/dist/src/config/timeout-config.js +130 -0
  27. package/dist/src/config.js +173 -0
  28. package/dist/src/domain/interfaces/IFocusMode.js +5 -0
  29. package/dist/src/domain/interfaces/IProvider.js +6 -0
  30. package/dist/src/domain/interfaces/ITool.js +5 -0
  31. package/dist/src/focus-deep.js +245 -0
  32. package/dist/src/infrastructure/ascii/art/robots.ascii.js +16 -0
  33. package/dist/src/mcp-client.js +90 -0
  34. package/dist/src/memory/index.js +17 -0
  35. package/dist/src/memory/memory-config.js +135 -0
  36. package/dist/src/memory/memory-interface.js +174 -0
  37. package/dist/src/memory/memory-manager.js +383 -0
  38. package/dist/src/memory/providers/devlog-provider.js +385 -0
  39. package/dist/src/memory/providers/hybrid-provider.js +399 -0
  40. package/dist/src/memory/providers/local-provider.js +388 -0
  41. package/dist/src/memory/providers/mem0-provider.js +337 -0
  42. package/dist/src/modes/architect.js +477 -0
  43. package/dist/src/modes/auditor.js +362 -0
  44. package/dist/src/modes/challenger.js +841 -0
  45. package/dist/src/modes/code-reviewer.js +382 -0
  46. package/dist/src/modes/commit-guardian.js +424 -0
  47. package/dist/src/modes/documentation-writer.js +572 -0
  48. package/dist/src/modes/scout.js +587 -0
  49. package/dist/src/modes/shared/helpers/challenger-helpers.js +454 -0
  50. package/dist/src/modes/shared/helpers/index.js +17 -0
  51. package/dist/src/modes/shared/helpers/scout-helpers.js +270 -0
  52. package/dist/src/modes/shared/helpers/verifier-helpers.js +332 -0
  53. package/dist/src/modes/test-architect.js +767 -0
  54. package/dist/src/modes/verifier.js +378 -0
  55. package/dist/src/monitoring/performance-monitor.js +435 -0
  56. package/dist/src/optimization/batch-executor.js +121 -0
  57. package/dist/src/optimization/context-pruner.js +196 -0
  58. package/dist/src/optimization/cost-monitor.js +338 -0
  59. package/dist/src/optimization/index.js +65 -0
  60. package/dist/src/optimization/model-router.js +264 -0
  61. package/dist/src/optimization/result-cache.js +114 -0
  62. package/dist/src/optimization/token-optimizer.js +257 -0
  63. package/dist/src/optimization/token-tracker.js +118 -0
  64. package/dist/src/orchestrator-instructions.js +128 -0
  65. package/dist/src/orchestrator-lite.js +139 -0
  66. package/dist/src/orchestrator.js +191 -0
  67. package/dist/src/orchestrators/collaborative/interfaces/IToolExecutionEngine.js +1 -0
  68. package/dist/src/orchestrators/collaborative/interfaces/IToolExecutionStrategy.js +5 -0
  69. package/dist/src/orchestrators/collaborative/interfaces/IVisualizationRenderer.js +1 -0
  70. package/dist/src/orchestrators/collaborative/registries/ModelProviderRegistry.js +95 -0
  71. package/dist/src/orchestrators/collaborative/registries/ToolAdapterRegistry.js +64 -0
  72. package/dist/src/orchestrators/collaborative/services/tool-execution/ToolExecutionService.js +502 -0
  73. package/dist/src/orchestrators/collaborative/services/visualization/VisualizationService.js +206 -0
  74. package/dist/src/orchestrators/collaborative/types/session-types.js +5 -0
  75. package/dist/src/profiles/balanced.js +37 -0
  76. package/dist/src/profiles/code_focus.js +37 -0
  77. package/dist/src/profiles/debug_intensive.js +59 -0
  78. package/dist/src/profiles/full.js +37 -0
  79. package/dist/src/profiles/minimal.js +37 -0
  80. package/dist/src/profiles/research_code.js +59 -0
  81. package/dist/src/profiles/research_power.js +37 -0
  82. package/dist/src/profiles/types.js +5 -0
  83. package/dist/src/profiles/workflow_builder.js +53 -0
  84. package/dist/src/prompt-engineer-lite.js +78 -0
  85. package/dist/src/prompt-engineer.js +399 -0
  86. package/dist/src/reasoning-chain.js +508 -0
  87. package/dist/src/sequential-thinking.js +291 -0
  88. package/dist/src/server-diagnostic.js +74 -0
  89. package/dist/src/server-raw.js +158 -0
  90. package/dist/src/server-simple.js +58 -0
  91. package/dist/src/server.js +514 -0
  92. package/dist/src/session/session-logger.js +617 -0
  93. package/dist/src/session/session-manager.js +571 -0
  94. package/dist/src/session/session-tools.js +400 -0
  95. package/dist/src/tools/advanced-modes.js +200 -0
  96. package/dist/src/tools/claude-integration.js +356 -0
  97. package/dist/src/tools/consolidated/ai-router.js +174 -0
  98. package/dist/src/tools/consolidated/ai-tool.js +48 -0
  99. package/dist/src/tools/consolidated/brainstorm-tool.js +87 -0
  100. package/dist/src/tools/consolidated/environment-detector.js +80 -0
  101. package/dist/src/tools/consolidated/index.js +50 -0
  102. package/dist/src/tools/consolidated/search-tool.js +110 -0
  103. package/dist/src/tools/consolidated/workflow-tool.js +238 -0
  104. package/dist/src/tools/gemini-tools.js +329 -0
  105. package/dist/src/tools/grok-enhanced.js +376 -0
  106. package/dist/src/tools/grok-tools.js +299 -0
  107. package/dist/src/tools/lmstudio-tools.js +223 -0
  108. package/dist/src/tools/openai-tools.js +498 -0
  109. package/dist/src/tools/openrouter-tools.js +317 -0
  110. package/dist/src/tools/optimized-wrapper.js +204 -0
  111. package/dist/src/tools/perplexity-tools.js +294 -0
  112. package/dist/src/tools/pingpong-tool.js +343 -0
  113. package/dist/src/tools/qwen-wrapper.js +74 -0
  114. package/dist/src/tools/tool-router.js +444 -0
  115. package/dist/src/tools/unified-ai-provider.js +260 -0
  116. package/dist/src/tools/workflow-runner.js +425 -0
  117. package/dist/src/tools/workflow-validator-tool.js +107 -0
  118. package/dist/src/types.js +23 -0
  119. package/dist/src/utils/input-validator.js +130 -0
  120. package/dist/src/utils/model-router.js +91 -0
  121. package/dist/src/utils/progress-stream.js +255 -0
  122. package/dist/src/utils/provider-router.js +88 -0
  123. package/dist/src/utils/smart-api-client.js +146 -0
  124. package/dist/src/utils/table-builder.js +218 -0
  125. package/dist/src/utils/timestamp-formatter.js +134 -0
  126. package/dist/src/utils/tool-compressor.js +257 -0
  127. package/dist/src/utils/tool-config.js +201 -0
  128. package/dist/src/validators/dependency-graph-validator.js +147 -0
  129. package/dist/src/validators/interpolation-validator.js +222 -0
  130. package/dist/src/validators/output-usage-validator.js +151 -0
  131. package/dist/src/validators/syntax-validator.js +102 -0
  132. package/dist/src/validators/tool-registry-validator.js +123 -0
  133. package/dist/src/validators/tool-types.js +97 -0
  134. package/dist/src/validators/types.js +8 -0
  135. package/dist/src/validators/workflow-validator.js +134 -0
  136. package/dist/src/visualizer-lite.js +42 -0
  137. package/dist/src/visualizer.js +179 -0
  138. package/dist/src/workflows/circuit-breaker.js +199 -0
  139. package/dist/src/workflows/custom-workflows.js +451 -0
  140. package/dist/src/workflows/engine/AutoSynthesizer.js +97 -0
  141. package/dist/src/workflows/engine/StepParameterResolver.js +74 -0
  142. package/dist/src/workflows/engine/VariableInterpolator.js +123 -0
  143. package/dist/src/workflows/engine/WorkflowDiscovery.js +125 -0
  144. package/dist/src/workflows/engine/WorkflowExecutionEngine.js +485 -0
  145. package/dist/src/workflows/engine/WorkflowExecutor.js +113 -0
  146. package/dist/src/workflows/engine/WorkflowFileManager.js +244 -0
  147. package/dist/src/workflows/engine/WorkflowHelpers.js +114 -0
  148. package/dist/src/workflows/engine/WorkflowOutputFormatter.js +83 -0
  149. package/dist/src/workflows/engine/events/WorkflowEventBus.js +132 -0
  150. package/dist/src/workflows/engine/events/interfaces/IEventBus.js +5 -0
  151. package/dist/src/workflows/engine/handlers/ErrorRecoveryHandler.js +162 -0
  152. package/dist/src/workflows/engine/handlers/PromptEnhancementHandler.js +115 -0
  153. package/dist/src/workflows/engine/handlers/SessionPersistenceHandler.js +167 -0
  154. package/dist/src/workflows/engine/handlers/StepExecutionHandler.js +231 -0
  155. package/dist/src/workflows/engine/handlers/ToolInvocationHandler.js +46 -0
  156. package/dist/src/workflows/engine/interfaces/IAutoSynthesizer.js +5 -0
  157. package/dist/src/workflows/engine/interfaces/IStepParameterResolver.js +5 -0
  158. package/dist/src/workflows/engine/interfaces/IVariableInterpolator.js +5 -0
  159. package/dist/src/workflows/engine/interfaces/IWorkflowDiscovery.js +4 -0
  160. package/dist/src/workflows/engine/interfaces/IWorkflowFileManager.js +5 -0
  161. package/dist/src/workflows/engine/interfaces/IWorkflowOutputFormatter.js +5 -0
  162. package/dist/src/workflows/engine/state/WorkflowStateMachine.js +194 -0
  163. package/dist/src/workflows/engine/state/interfaces/IStateMachine.js +17 -0
  164. package/dist/src/workflows/fallback-strategies.js +373 -0
  165. package/dist/src/workflows/message-queue.js +455 -0
  166. package/dist/src/workflows/model-router.js +189 -0
  167. package/dist/src/workflows/orchestrator-examples.js +174 -0
  168. package/dist/src/workflows/orchestrator-integration.js +200 -0
  169. package/dist/src/workflows/self-healing.js +524 -0
  170. package/dist/src/workflows/tool-mapper.js +407 -0
  171. package/dist/src/workflows/tool-orchestrator.js +796 -0
  172. package/dist/src/workflows/workflow-engine.js +573 -0
  173. package/dist/src/workflows/workflow-parser.js +283 -0
  174. package/dist/src/workflows/workflow-types.js +95 -0
  175. package/dist/src/workflows.js +568 -0
  176. package/dist/test-workflow-file-output.js +93 -0
  177. package/docs/API_KEYS.md +570 -0
  178. package/docs/CLAUDE_CODE_SETUP.md +181 -0
  179. package/docs/CLAUDE_DESKTOP_MANUAL.md +127 -0
  180. package/docs/CONFIGURATION.md +745 -0
  181. package/docs/FOCUS_MODES.md +240 -0
  182. package/docs/INSTALLATION_BOTH.md +145 -0
  183. package/docs/TERMS.md +352 -0
  184. package/docs/TOOLS_REFERENCE.md +1622 -0
  185. package/docs/TOOL_PARAMETERS.md +496 -0
  186. package/docs/TOOL_PROFILES.md +236 -0
  187. package/docs/WORKFLOWS.md +987 -0
  188. package/docs/WORKFLOW_OUTPUT.md +198 -0
  189. package/docs/WORKFLOW_PROGRESS_TRACKING.md +305 -0
  190. package/docs/workflows/design-brainstorm.md +335 -0
  191. package/package.json +97 -0
  192. package/profiles/balanced.json +37 -0
  193. package/profiles/code_focus.json +37 -0
  194. package/profiles/debug_intensive.json +34 -0
  195. package/profiles/full.json +37 -0
  196. package/profiles/minimal.json +37 -0
  197. package/profiles/research_power.json +37 -0
  198. package/profiles/workflow_builder.json +37 -0
  199. package/smithery.yaml +66 -0
  200. package/start.sh +8 -0
  201. package/tools.config.json +81 -0
  202. package/tsconfig.json +18 -0
  203. package/workflows/accessibility-code-audit.yaml +92 -0
  204. package/workflows/code-architecture-review.yaml +202 -0
  205. package/workflows/code-review.yaml +142 -0
  206. package/workflows/core/iterative-problem-solver.yaml +283 -0
  207. package/workflows/creative-brainstorm-yaml.yaml +215 -0
  208. package/workflows/pingpong.yaml +141 -0
  209. package/workflows/system/README.md +412 -0
  210. package/workflows/system/challenger.yaml +175 -0
  211. package/workflows/system/scout.yaml +164 -0
  212. package/workflows/system/verifier.yaml +133 -0
  213. package/workflows/ultra-creative-brainstorm.yaml +318 -0
  214. package/workflows/ux-research-flow.yaml +92 -0
@@ -0,0 +1,198 @@
1
+ # Workflow Output Configuration
2
+
3
+ Control how workflow step outputs are displayed.
4
+
5
+ ## Quick Reference
6
+
7
+ ### YAML Configuration
8
+ ```yaml
9
+ output:
10
+ format: detailed
11
+ truncateSteps: false # Show full output (no truncation)
12
+ maxStepTokens: 2500 # Only applies if truncateSteps=true
13
+ ```
14
+
15
+ ### Runtime Override
16
+ ```bash
17
+ # Use workflow defaults
18
+ workflow --name code-review --query "..."
19
+
20
+ # Show full output (override workflow settings)
21
+ workflow --name code-review --query "..." --truncateSteps false
22
+
23
+ # Custom token limit
24
+ workflow --name code-review --query "..." --maxStepTokens 5000
25
+ ```
26
+
27
+ ---
28
+
29
+ ## Configuration Options
30
+
31
+ ### `truncateSteps` (boolean)
32
+ **Default:** `true`
33
+
34
+ Controls whether step outputs are truncated.
35
+
36
+ - `true` - Truncate at `maxStepTokens` limit (better readability)
37
+ - `false` - Show complete output (no truncation, full context)
38
+
39
+ **When to use false:**
40
+ - Comprehensive analysis workflows (code review, UX research)
41
+ - Debugging workflow outputs
42
+ - When you need full context from each step
43
+
44
+ **When to use true:**
45
+ - Quick iterative development
46
+ - When outputs are very large (>10k tokens)
47
+ - To reduce visual clutter in terminal
48
+
49
+ ### `maxStepTokens` (number)
50
+ **Default:** `2500` tokens (~10,000 characters)
51
+
52
+ Maximum tokens per step output when `truncateSteps=true`.
53
+
54
+ **Token Reference:**
55
+ - 500 tokens ≈ 2,000 chars ≈ 1 paragraph
56
+ - 2,500 tokens ≈ 10,000 chars ≈ 2-3 pages (default)
57
+ - 5,000 tokens ≈ 20,000 chars ≈ 5-6 pages
58
+ - 10,000 tokens ≈ 40,000 chars ≈ 10-12 pages
59
+
60
+ **Recommended settings by workflow type:**
61
+
62
+ | Workflow Type | truncateSteps | maxStepTokens | Reason |
63
+ |--------------|---------------|---------------|---------|
64
+ | Quick brainstorm | `true` | `1000` | Fast iteration |
65
+ | Code review | `false` | - | Need full analysis |
66
+ | Research | `false` | - | Comprehensive findings |
67
+ | UX analysis | `false` | - | Full user journey |
68
+ | Debug workflow | `true` | `5000` | Balance detail/readability |
69
+ | Multi-step pipeline | `true` | `2500` | Standard default |
70
+
71
+ ---
72
+
73
+ ## Examples
74
+
75
+ ### Example 1: Code Review (Show Everything)
76
+ ```yaml
77
+ name: comprehensive-code-review
78
+ output:
79
+ format: detailed
80
+ truncateSteps: false # Need full review details
81
+ ```
82
+
83
+ **Result:** All step outputs shown in full - analysis, architecture review, security findings, etc.
84
+
85
+ ### Example 2: Research Pipeline (Custom Limit)
86
+ ```yaml
87
+ name: research-pipeline
88
+ output:
89
+ format: detailed
90
+ truncateSteps: true
91
+ maxStepTokens: 5000 # Larger limit for research
92
+ ```
93
+
94
+ **Result:** Each step truncated at ~5000 tokens (~20k characters), good balance for research workflows.
95
+
96
+ ### Example 3: Quick Brainstorm (Default)
97
+ ```yaml
98
+ name: quick-brainstorm
99
+ output:
100
+ format: detailed
101
+ # Uses defaults: truncateSteps=true, maxStepTokens=2500
102
+ ```
103
+
104
+ **Result:** Concise output, easier to scan quickly.
105
+
106
+ ### Example 4: Runtime Override
107
+ ```bash
108
+ # Workflow has truncateSteps=true, but override to see full output
109
+ workflow --name quick-brainstorm --query "..." --truncateSteps false
110
+
111
+ # Use different token limit
112
+ workflow --name research --query "..." --maxStepTokens 10000
113
+ ```
114
+
115
+ ---
116
+
117
+ ## Understanding Truncation Messages
118
+
119
+ When output is truncated, you'll see:
120
+ ```
121
+ ...(output truncated: ~3420 tokens, limit: 2500 tokens. Set truncateSteps=false for full output)...
122
+ ```
123
+
124
+ This tells you:
125
+ - **Actual size:** ~3420 tokens
126
+ - **Limit applied:** 2500 tokens
127
+ - **How to see full output:** Set `truncateSteps=false`
128
+
129
+ ---
130
+
131
+ ## Migration from Old API
132
+
133
+ ### ❌ Old (deprecated)
134
+ ```yaml
135
+ output:
136
+ maxStepOutputLength: -1 # Magic number, unclear
137
+ maxStepOutputLength: 10000 # Characters, hard to estimate
138
+ ```
139
+
140
+ ### ✅ New (recommended)
141
+ ```yaml
142
+ output:
143
+ truncateSteps: false # Clear intent
144
+ maxStepTokens: 2500 # Meaningful for AI context
145
+ ```
146
+
147
+ ---
148
+
149
+ ## Best Practices
150
+
151
+ 1. **Start with defaults** (`truncateSteps=true`, `maxStepTokens=2500`)
152
+ 2. **Set `truncateSteps=false` for:**
153
+ - Complex analysis workflows
154
+ - When step outputs feed into each other
155
+ - Production-critical workflows
156
+ 3. **Increase `maxStepTokens` for:**
157
+ - Research-heavy workflows
158
+ - Multi-perspective analysis
159
+ - Detailed technical reports
160
+ 4. **Use runtime overrides** when testing:
161
+ - `--truncateSteps false` to debug
162
+ - `--maxStepTokens 10000` for one-off deep dives
163
+
164
+ ---
165
+
166
+ ## Token vs Character Conversion
167
+
168
+ Internally, the system converts tokens to approximate characters using:
169
+ - **1 token ≈ 4 characters** (for English text)
170
+
171
+ | Tokens | Characters | Typical Content |
172
+ |--------|-----------|-----------------|
173
+ | 500 | ~2,000 | Short summary |
174
+ | 1,000 | ~4,000 | 1 page report |
175
+ | 2,500 | ~10,000 | 2-3 pages (default) |
176
+ | 5,000 | ~20,000 | 5-6 pages |
177
+ | 10,000 | ~40,000 | 10-12 pages |
178
+
179
+ For code, JSON, or special characters, the ratio may vary (typically 2-3 chars/token).
180
+
181
+ ---
182
+
183
+ ## FAQ
184
+
185
+ ### Why tokens instead of characters?
186
+ Tokens are more meaningful for AI systems and give better estimates of context window usage.
187
+
188
+ ### Can I set different limits per step?
189
+ Not yet, but it's on the roadmap. Current settings apply to all steps in a workflow.
190
+
191
+ ### Does this affect model output?
192
+ No! This only controls **display** truncation. Model responses are controlled by `maxTokens` in the step configuration.
193
+
194
+ ### What if I want unlimited output?
195
+ Set `truncateSteps: false`
196
+
197
+ ### Can runtime parameters override workflow settings?
198
+ Yes! Runtime parameters take precedence over workflow YAML settings.
@@ -0,0 +1,305 @@
1
+ # Workflow Progress Tracking - Live Session Logging
2
+
3
+ ## Problem Solved
4
+
5
+ Long-running workflows (5-10 minutes with 7+ steps) previously showed no progress until completion. Users saw only "Tool ran without output or errors" during execution.
6
+
7
+ ## Solution: SessionLogger Integration
8
+
9
+ We integrated the existing `SessionLogger` class into the workflow system to provide:
10
+ - **Real-time progress files** - Monitor workflow execution live
11
+ - **Persistent session logs** - Full markdown reports saved after completion
12
+ - **Step-by-step tracking** - Each step logs immediately after completion
13
+ - **Verbose console output** - Detailed progress in server logs
14
+
15
+ ## How It Works
16
+
17
+ ### 1. Automatic Session Logging
18
+
19
+ When you run any workflow, the system now:
20
+
21
+ 1. **Creates a session** at workflow start:
22
+ ```
23
+ 📝 Session log: .workflow-sessions/session-2025-10-18-02-15-30-workflow-creative-brainstorm-yaml.md
24
+ To monitor progress: tail -f .workflow-sessions/session-2025-10-18-02-15-30-workflow-creative-brainstorm-yaml.md
25
+ ```
26
+
27
+ 2. **Logs each step** immediately after completion:
28
+ - Step number and name
29
+ - Tool used
30
+ - Full input and output
31
+ - Execution time
32
+ - Metadata (workflow name, progress)
33
+
34
+ 3. **Saves final report** when workflow completes:
35
+ ```
36
+ ✅ Workflow complete! Full session saved to: .workflow-sessions/session-2025-10-18-02-15-30-workflow-creative-brainstorm-yaml.md
37
+ ```
38
+
39
+ ### 2. Session File Format
40
+
41
+ Each session creates a markdown file with:
42
+
43
+ ```markdown
44
+ # Focus MCP workflow-creative-brainstorm-yaml Session
45
+
46
+ ## Metadata
47
+ - **Session ID**: session-2025-10-18-02-15-30-workflow-creative-brainstorm-yaml
48
+ - **Date**: 2025-10-18T02:15:30.000Z
49
+ - **Mode**: workflow-creative-brainstorm-yaml
50
+ - **Models Used**: gemini_brainstorm (workflow), openai_brainstorm (workflow), ...
51
+ - **Total Duration**: 285.3s
52
+ - **Query**: "Analysis of personality/komaai-expressions.ts..."
53
+
54
+ ---
55
+
56
+ ## Step 1: Step 1/7
57
+
58
+ **Model**: gemini_brainstorm
59
+ **Provider**: workflow
60
+ **Duration**: 12.5s
61
+
62
+ ### Prompt:
63
+ ```
64
+ Generate creative ideas for: Analysis of personality/komaai-expressions.ts...
65
+ ```
66
+
67
+ ### Response:
68
+ [Full step output here...]
69
+
70
+ ---
71
+
72
+ ## Step 2: Step 2/7
73
+ ...
74
+ ```
75
+
76
+ ### 3. Monitoring Live Progress
77
+
78
+ **Option 1: Tail the session file** (recommended)
79
+ ```bash
80
+ # Get the session file path from console output, then:
81
+ tail -f .workflow-sessions/session-*.md
82
+ ```
83
+
84
+ **Option 2: Watch the directory**
85
+ ```bash
86
+ watch -n 2 'ls -lth .workflow-sessions | head -10'
87
+ ```
88
+
89
+ **Option 3: Server console logs**
90
+ The server stderr shows verbose progress:
91
+ ```
92
+ 🚀 STARTING STEP 1/7: initial-ideas (gemini_brainstorm)
93
+ ...
94
+ ✅ STEP 1/7 COMPLETE: initial-ideas
95
+ [Step output displayed]
96
+
97
+ 📍 Step 1: STEP 1/7
98
+ Model: gemini_brainstorm (workflow)
99
+ Duration: 12500ms
100
+ 🤖 Response:
101
+ [Output preview...]
102
+ ```
103
+
104
+ ## Usage Examples
105
+
106
+ ### Running a Workflow with Progress Tracking
107
+
108
+ ```typescript
109
+ // Via MCP tool
110
+ mcp__tachibot-mcp__workflow({
111
+ name: "creative-brainstorm-yaml",
112
+ query: "Your topic here",
113
+ truncateSteps: false, // Get full output
114
+ maxStepTokens: 5000 // Control detail level
115
+ })
116
+ ```
117
+
118
+ While it runs, in another terminal:
119
+ ```bash
120
+ # Monitor progress live
121
+ tail -f .workflow-sessions/session-*.md
122
+
123
+ # Or watch for updates
124
+ watch -n 1 'tail -20 .workflow-sessions/session-*.md'
125
+ ```
126
+
127
+ ### Session File Location
128
+
129
+ - **Directory**: `./.workflow-sessions/` (in project root)
130
+ - **Format**: `session-YYYY-MM-DD-HH-MM-SS-workflow-{name}.md`
131
+ - **Auto-save**: After every step completion
132
+
133
+ ## Configuration
134
+
135
+ The SessionLogger is configured in `src/workflows/custom-workflows.ts`:
136
+
137
+ ```typescript
138
+ this.sessionLogger = new SessionLogger({
139
+ saveSession: true, // Save to file
140
+ verbose: true, // Console output
141
+ autoSave: true, // Save after each step
142
+ outputFormat: "markdown",
143
+ sessionDir: "./.workflow-sessions",
144
+ });
145
+ ```
146
+
147
+ ### Customization Options
148
+
149
+ You can modify settings in the constructor:
150
+
151
+ - `saveSession: boolean` - Enable/disable file saving
152
+ - `verbose: boolean` - Show detailed console logs
153
+ - `autoSave: boolean` - Save after each step (vs. only at end)
154
+ - `outputFormat: "markdown" | "json" | "html"` - Output format
155
+ - `sessionDir: string` - Where to save sessions
156
+
157
+ ## File Management
158
+
159
+ ### Viewing Past Sessions
160
+
161
+ ```bash
162
+ # List all sessions
163
+ ls -lt .workflow-sessions/
164
+
165
+ # Search by workflow name
166
+ ls .workflow-sessions/*creative-brainstorm*
167
+
168
+ # View a session
169
+ cat .workflow-sessions/session-2025-10-18-02-15-30-workflow-creative-brainstorm-yaml.md
170
+ ```
171
+
172
+ ### Cleaning Old Sessions
173
+
174
+ The SessionLogger includes a cleanup utility:
175
+
176
+ ```typescript
177
+ // In code (if needed):
178
+ await sessionLogger.clearOldSessions(30); // Keep last 30 days
179
+ ```
180
+
181
+ Or manually:
182
+ ```bash
183
+ # Remove sessions older than 7 days
184
+ find .workflow-sessions -name "*.md" -mtime +7 -delete
185
+ ```
186
+
187
+ ## Benefits
188
+
189
+ 1. **No More Black Box** - See exactly what's happening at each step
190
+ 2. **Debugging** - Full logs for troubleshooting workflow issues
191
+ 3. **Monitoring** - Watch progress in real-time with `tail -f`
192
+ 4. **Persistence** - Complete session history for review
193
+ 5. **Transparency** - See input/output of every step
194
+
195
+ ## Architecture
196
+
197
+ ### Code Changes Made
198
+
199
+ 1. **`src/workflows/custom-workflows.ts`**:
200
+ - Added `SessionLogger` import
201
+ - Created `sessionLogger` instance in constructor
202
+ - Added `startSession()` at workflow start
203
+ - Added `logStep()` after each step completion
204
+ - Added `endSession()` on completion/error
205
+
206
+ 2. **Session Flow**:
207
+ ```
208
+ Workflow Start
209
+
210
+ sessionLogger.startSession() → Creates .md file
211
+
212
+ For each step:
213
+ Execute step
214
+
215
+ sessionLogger.logStep() → Appends to .md file
216
+
217
+ All steps complete
218
+
219
+ sessionLogger.endSession() → Saves final summary
220
+ ```
221
+
222
+ ## Next Steps After Restart
223
+
224
+ 1. **Restart Claude Code** - Pick up the new server with SessionLogger
225
+ 2. **Run a test workflow**:
226
+ ```
227
+ workflow test-brainstorm-mini "test topic"
228
+ ```
229
+ 3. **Open a new terminal** and run:
230
+ ```bash
231
+ tail -f .workflow-sessions/session-*.md
232
+ ```
233
+ 4. **Watch the magic** - See steps appear in real-time!
234
+
235
+ ## Advanced: Programmatic Access
236
+
237
+ The SessionLogger can be used programmatically:
238
+
239
+ ```typescript
240
+ import { SessionLogger } from "./session/session-logger.js";
241
+
242
+ const logger = new SessionLogger({
243
+ saveSession: true,
244
+ verbose: true,
245
+ sessionDir: "./my-sessions"
246
+ });
247
+
248
+ // Start session
249
+ const sessionId = await logger.startSession("my-mode", "my query");
250
+
251
+ // Log steps
252
+ await logger.logStep(
253
+ "gpt-5",
254
+ "openai",
255
+ "brainstorm",
256
+ "Generate ideas about...",
257
+ "Here are 5 ideas...",
258
+ { custom: "metadata" }
259
+ );
260
+
261
+ // End and save
262
+ await logger.endSession(true);
263
+ ```
264
+
265
+ ## Troubleshooting
266
+
267
+ ### Session Directory Not Created
268
+
269
+ If `.workflow-sessions/` doesn't exist:
270
+ ```bash
271
+ # Check permissions
272
+ ls -la . | grep workflow-sessions
273
+
274
+ # Create manually if needed
275
+ mkdir -p .workflow-sessions
276
+ chmod 755 .workflow-sessions
277
+ ```
278
+
279
+ ### No Output During Workflow
280
+
281
+ 1. Check server logs: `tail -f /tmp/server-debug.log`
282
+ 2. Verify rebuild: `npm run build`
283
+ 3. Restart server: Kill old processes and reconnect MCP
284
+
285
+ ### Verbose Mode Too Noisy
286
+
287
+ Set `verbose: false` in SessionLogger constructor to reduce console output while keeping file logging.
288
+
289
+ ## Summary
290
+
291
+ **Before**: Workflows run for minutes with no feedback
292
+ **After**: Live progress files + verbose logs + persistent session history
293
+
294
+ **Key Command**:
295
+ ```bash
296
+ tail -f .workflow-sessions/session-*.md # Watch your workflow run!
297
+ ```
298
+
299
+ ---
300
+
301
+ **Implementation Status**: ✅ Complete
302
+ **Testing Status**: ⏳ Pending server restart
303
+ **Documentation**: ✅ This file
304
+
305
+ Run `npm run build` and restart Claude Code to enable this feature!