@probelabs/visor 0.1.124 → 0.1.126

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 (195) hide show
  1. package/dist/config.d.ts.map +1 -1
  2. package/dist/docs/DEPLOYMENT.md +117 -11
  3. package/dist/docs/GITHUB_CHECKS.md +18 -4
  4. package/dist/docs/NPM_USAGE.md +112 -39
  5. package/dist/docs/action-reference.md +63 -9
  6. package/dist/docs/advanced-ai.md +58 -51
  7. package/dist/docs/ai-configuration.md +99 -11
  8. package/dist/docs/ai-custom-tools-usage.md +70 -33
  9. package/dist/docs/ai-custom-tools.md +50 -27
  10. package/dist/docs/architecture.md +1232 -0
  11. package/dist/docs/bot-transports-rfc.md +13 -3
  12. package/dist/docs/ci-cli-mode.md +116 -8
  13. package/dist/docs/claude-code.md +111 -41
  14. package/dist/docs/command-provider.md +37 -15
  15. package/dist/docs/commands.md +252 -6
  16. package/dist/docs/configuration.md +138 -4
  17. package/dist/docs/contributing.md +737 -0
  18. package/dist/docs/custom-tools.md +39 -8
  19. package/dist/docs/dashboards/README.md +33 -19
  20. package/dist/docs/debug-visualizer-progress.md +14 -13
  21. package/dist/docs/debug-visualizer-rfc.md +14 -13
  22. package/dist/docs/debug-visualizer.md +30 -5
  23. package/dist/docs/debugging.md +73 -8
  24. package/dist/docs/default-output-schema.md +24 -20
  25. package/dist/docs/dependencies.md +75 -21
  26. package/dist/docs/dev-playbook.md +85 -9
  27. package/dist/docs/engine-pause-resume-rfc.md +11 -11
  28. package/dist/docs/engine-state-machine-plan.md +10 -3
  29. package/dist/docs/event-driven-github-integration-rfc.md +20 -11
  30. package/dist/docs/event-triggers.md +95 -6
  31. package/dist/docs/execution-statistics-rfc.md +16 -4
  32. package/dist/docs/fact-validator-gap-analysis.md +12 -1
  33. package/dist/docs/fact-validator-implementation-plan.md +19 -11
  34. package/dist/docs/fail-if.md +116 -11
  35. package/dist/docs/failure-conditions-implementation.md +40 -6
  36. package/dist/docs/failure-conditions-schema.md +243 -87
  37. package/dist/docs/failure-routing-rfc.md +43 -18
  38. package/dist/docs/failure-routing.md +80 -23
  39. package/dist/docs/faq.md +836 -0
  40. package/dist/docs/foreach-dependency-propagation.md +32 -15
  41. package/dist/docs/github-ops.md +6 -5
  42. package/dist/docs/glossary.md +322 -0
  43. package/dist/docs/goto-forward-run-plan.md +23 -10
  44. package/dist/docs/guides/criticality-modes.md +15 -13
  45. package/dist/docs/guides/fault-management-and-contracts.md +8 -5
  46. package/dist/docs/guides/workflow-style-guide.md +17 -8
  47. package/dist/docs/http.md +102 -3
  48. package/dist/docs/human-input-provider.md +20 -36
  49. package/dist/docs/index.md +206 -0
  50. package/dist/docs/lifecycle-hooks.md +322 -2
  51. package/dist/docs/limits.md +20 -5
  52. package/dist/docs/liquid-templates.md +86 -14
  53. package/dist/docs/loop-routing-refactor.md +4 -2
  54. package/dist/docs/mcp-provider.md +53 -19
  55. package/dist/docs/mcp.md +27 -1
  56. package/dist/docs/memory.md +7 -2
  57. package/dist/docs/migration.md +596 -0
  58. package/dist/docs/observability.md +227 -6
  59. package/dist/docs/output-formats.md +388 -9
  60. package/dist/docs/output-history.md +36 -6
  61. package/dist/docs/performance.md +510 -4
  62. package/dist/docs/pluggable.md +95 -4
  63. package/dist/docs/proposals/snapshot-scope-execution.md +6 -5
  64. package/dist/docs/providers/git-checkout.md +16 -14
  65. package/dist/docs/providers/noop.md +696 -0
  66. package/dist/docs/recipes.md +8 -9
  67. package/dist/docs/rfc/git-checkout-step.md +3 -1
  68. package/dist/docs/rfc/on_init-hook.md +18 -5
  69. package/dist/docs/rfc/workspace-isolation.md +16 -0
  70. package/dist/docs/roadmap/criticality-implementation-tasks.md +27 -27
  71. package/dist/docs/router-patterns.md +155 -43
  72. package/dist/docs/schema-templates.md +51 -15
  73. package/dist/docs/script.md +162 -13
  74. package/dist/docs/sdk.md +46 -12
  75. package/dist/docs/security.md +464 -5
  76. package/dist/docs/slack-integration.md +481 -0
  77. package/dist/docs/tag-filtering.md +60 -20
  78. package/dist/docs/telemetry-setup.md +157 -46
  79. package/dist/docs/test-framework-rfc.md +37 -36
  80. package/dist/docs/testing/assertions.md +92 -4
  81. package/dist/docs/testing/ci.md +56 -7
  82. package/dist/docs/testing/cli.md +57 -15
  83. package/dist/docs/testing/cookbook.md +53 -20
  84. package/dist/docs/testing/dsl-reference.md +110 -9
  85. package/dist/docs/testing/fixtures-and-mocks.md +28 -3
  86. package/dist/docs/testing/flows.md +59 -4
  87. package/dist/docs/testing/getting-started.md +14 -13
  88. package/dist/docs/testing/troubleshooting.md +39 -2
  89. package/dist/docs/timeouts.md +174 -18
  90. package/dist/docs/troubleshooting.md +176 -6
  91. package/dist/docs/workflow-creation-guide.md +101 -3
  92. package/dist/docs/workflows.md +138 -41
  93. package/dist/examples/README.md +169 -4
  94. package/dist/examples/ai-custom-tools-simple.yaml +2 -3
  95. package/dist/examples/cron-webhook-config.yaml +15 -0
  96. package/dist/examples/forEach-example.yaml +6 -0
  97. package/dist/examples/git-checkout-basic.yaml +4 -0
  98. package/dist/examples/git-checkout-compare.yaml +6 -0
  99. package/dist/examples/git-checkout-cross-repo.yaml +7 -0
  100. package/dist/examples/http-integration-config.yaml +30 -0
  101. package/dist/examples/https-server-config.yaml +15 -0
  102. package/dist/examples/mcp-provider-example.yaml +10 -10
  103. package/dist/examples/transform-example.yaml +3 -0
  104. package/dist/examples/webhook-pipeline-config.yaml +18 -0
  105. package/dist/examples/workflows/workflow-composition-example.yaml +4 -0
  106. package/dist/frontends/slack-frontend.d.ts +2 -0
  107. package/dist/frontends/slack-frontend.d.ts.map +1 -1
  108. package/dist/generated/config-schema.d.ts +11 -7
  109. package/dist/generated/config-schema.d.ts.map +1 -1
  110. package/dist/generated/config-schema.json +11 -7
  111. package/dist/index.js +3127 -974
  112. package/dist/output/traces/{run-2026-01-28T16-15-24-569Z.ndjson → run-2026-01-31T16-37-22-321Z.ndjson} +84 -84
  113. package/dist/output/traces/{run-2026-01-28T16-16-09-757Z.ndjson → run-2026-01-31T16-38-06-031Z.ndjson} +1013 -1013
  114. package/dist/providers/ai-check-provider.d.ts +9 -2
  115. package/dist/providers/ai-check-provider.d.ts.map +1 -1
  116. package/dist/providers/command-check-provider.d.ts.map +1 -1
  117. package/dist/providers/mcp-custom-sse-server.d.ts +17 -1
  118. package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -1
  119. package/dist/providers/workflow-check-provider.d.ts.map +1 -1
  120. package/dist/providers/workflow-tool-executor.d.ts +68 -0
  121. package/dist/providers/workflow-tool-executor.d.ts.map +1 -0
  122. package/dist/sdk/{check-provider-registry-AQ3JETBG.mjs → check-provider-registry-3KI5RKXT.mjs} +6 -5
  123. package/dist/sdk/check-provider-registry-IYILYY35.mjs +28 -0
  124. package/dist/sdk/chunk-2CPMMNIX.mjs +1459 -0
  125. package/dist/sdk/chunk-2CPMMNIX.mjs.map +1 -0
  126. package/dist/sdk/chunk-5LI6T4O3.mjs +3600 -0
  127. package/dist/sdk/chunk-5LI6T4O3.mjs.map +1 -0
  128. package/dist/sdk/{chunk-YLQ4UN62.mjs → chunk-A4PGHURG.mjs} +6838 -6257
  129. package/dist/sdk/chunk-A4PGHURG.mjs.map +1 -0
  130. package/dist/sdk/chunk-EXFGO4FX.mjs +147 -0
  131. package/dist/sdk/chunk-EXFGO4FX.mjs.map +1 -0
  132. package/dist/sdk/chunk-PJ7K5UFC.mjs +17732 -0
  133. package/dist/sdk/chunk-PJ7K5UFC.mjs.map +1 -0
  134. package/dist/sdk/{chunk-BHZ4CKUS.mjs → chunk-PXFIALUH.mjs} +77 -8
  135. package/dist/sdk/chunk-PXFIALUH.mjs.map +1 -0
  136. package/dist/sdk/{chunk-PVITVJ6J.mjs → chunk-RTKJXNZS.mjs} +32 -9
  137. package/dist/sdk/chunk-RTKJXNZS.mjs.map +1 -0
  138. package/dist/sdk/chunk-VW2GBXQT.mjs +606 -0
  139. package/dist/sdk/chunk-VW2GBXQT.mjs.map +1 -0
  140. package/dist/sdk/{config-RQQPMLRD.mjs → config-5AUYQFHE.mjs} +2 -2
  141. package/dist/sdk/config-6CUVEH7H.mjs +16 -0
  142. package/dist/sdk/config-6CUVEH7H.mjs.map +1 -0
  143. package/dist/sdk/{github-frontend-6Q4BISZX.mjs → github-frontend-BZ4N3BFZ.mjs} +7 -3
  144. package/dist/sdk/github-frontend-BZ4N3BFZ.mjs.map +1 -0
  145. package/dist/sdk/host-4MT3EW2I.mjs +52 -0
  146. package/dist/sdk/{host-P5NQICP7.mjs → host-NYWXLIFC.mjs} +2 -2
  147. package/dist/sdk/host-NYWXLIFC.mjs.map +1 -0
  148. package/dist/sdk/{routing-DEY2AIXM.mjs → routing-6R42GXUO.mjs} +2 -2
  149. package/dist/sdk/routing-6R42GXUO.mjs.map +1 -0
  150. package/dist/sdk/routing-7FXPULTO.mjs +24 -0
  151. package/dist/sdk/routing-7FXPULTO.mjs.map +1 -0
  152. package/dist/sdk/sdk.d.mts +3 -1
  153. package/dist/sdk/sdk.d.ts +3 -1
  154. package/dist/sdk/sdk.js +12163 -11204
  155. package/dist/sdk/sdk.js.map +1 -1
  156. package/dist/sdk/sdk.mjs +14 -10
  157. package/dist/sdk/sdk.mjs.map +1 -1
  158. package/dist/sdk/slack-frontend-JUT3TYVC.mjs +821 -0
  159. package/dist/sdk/slack-frontend-JUT3TYVC.mjs.map +1 -0
  160. package/dist/sdk/workflow-check-provider-H3CUOLUD.mjs +28 -0
  161. package/dist/sdk/workflow-check-provider-H3CUOLUD.mjs.map +1 -0
  162. package/dist/sdk/workflow-check-provider-YUNNF4KC.mjs +28 -0
  163. package/dist/sdk/workflow-check-provider-YUNNF4KC.mjs.map +1 -0
  164. package/dist/sdk/workflow-registry-KFWSDSLM.mjs +12 -0
  165. package/dist/sdk/workflow-registry-KFWSDSLM.mjs.map +1 -0
  166. package/dist/slack/socket-runner.d.ts +2 -0
  167. package/dist/slack/socket-runner.d.ts.map +1 -1
  168. package/dist/state-machine/context/workflow-inputs.d.ts +20 -0
  169. package/dist/state-machine/context/workflow-inputs.d.ts.map +1 -0
  170. package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -1
  171. package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -1
  172. package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -1
  173. package/dist/state-machine/states/level-dispatch.d.ts.map +1 -1
  174. package/dist/state-machine/states/routing.d.ts +2 -1
  175. package/dist/state-machine/states/routing.d.ts.map +1 -1
  176. package/dist/traces/{run-2026-01-28T16-15-24-569Z.ndjson → run-2026-01-31T16-37-22-321Z.ndjson} +84 -84
  177. package/dist/traces/{run-2026-01-28T16-16-09-757Z.ndjson → run-2026-01-31T16-38-06-031Z.ndjson} +1013 -1013
  178. package/dist/types/config.d.ts +3 -1
  179. package/dist/types/config.d.ts.map +1 -1
  180. package/dist/utils/human-id.d.ts +12 -0
  181. package/dist/utils/human-id.d.ts.map +1 -0
  182. package/dist/utils/worktree-manager.d.ts +3 -0
  183. package/dist/utils/worktree-manager.d.ts.map +1 -1
  184. package/dist/workflow-executor.d.ts.map +1 -1
  185. package/dist/workflow-registry.d.ts +1 -0
  186. package/dist/workflow-registry.d.ts.map +1 -1
  187. package/package.json +2 -2
  188. package/dist/sdk/chunk-BHZ4CKUS.mjs.map +0 -1
  189. package/dist/sdk/chunk-PVITVJ6J.mjs.map +0 -1
  190. package/dist/sdk/chunk-YLQ4UN62.mjs.map +0 -1
  191. package/dist/sdk/github-frontend-6Q4BISZX.mjs.map +0 -1
  192. /package/dist/sdk/{check-provider-registry-AQ3JETBG.mjs.map → check-provider-registry-3KI5RKXT.mjs.map} +0 -0
  193. /package/dist/sdk/{config-RQQPMLRD.mjs.map → check-provider-registry-IYILYY35.mjs.map} +0 -0
  194. /package/dist/sdk/{routing-DEY2AIXM.mjs.map → config-5AUYQFHE.mjs.map} +0 -0
  195. /package/dist/sdk/{host-P5NQICP7.mjs.map → host-4MT3EW2I.mjs.map} +0 -0
@@ -0,0 +1,481 @@
1
+ # Slack Integration
2
+
3
+ Visor provides bidirectional Slack integration through Socket Mode, enabling interactive workflows, human input collection, real-time notifications, and AI-powered chat assistants directly in Slack threads.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Overview](#overview)
8
+ - [Prerequisites](#prerequisites)
9
+ - [Configuration](#configuration)
10
+ - [Features](#features)
11
+ - [Example Workflows](#example-workflows)
12
+ - [Troubleshooting](#troubleshooting)
13
+ - [Related Documentation](#related-documentation)
14
+
15
+ ## Overview
16
+
17
+ The Slack integration enables:
18
+
19
+ - **Bidirectional Communication**: Receive messages from Slack threads and post AI-generated responses back
20
+ - **Human Input Collection**: Pause workflows to wait for user input via Slack messages
21
+ - **Conversation Context**: Access full thread history for context-aware AI responses
22
+ - **Mermaid Diagram Rendering**: Automatically render mermaid diagrams to PNG and upload to Slack
23
+ - **Reaction Management**: Visual acknowledgement (eyes) and completion (thumbsup) reactions
24
+ - **Rate Limiting**: Protect against abuse with configurable rate limits per user, channel, or globally
25
+ - **Thread Caching**: Efficient conversation history retrieval with TTL-based caching
26
+
27
+ ## Prerequisites
28
+
29
+ ### Slack App Setup
30
+
31
+ 1. **Create a Slack App** at https://api.slack.com/apps
32
+
33
+ 2. **Enable Socket Mode**:
34
+ - Navigate to "Socket Mode" in the sidebar
35
+ - Toggle "Enable Socket Mode" to On
36
+ - Generate an App-Level Token with `connections:write` scope
37
+ - Save the token (starts with `xapp-`)
38
+
39
+ 3. **Configure Bot Token Scopes** under "OAuth & Permissions":
40
+ ```
41
+ app_mentions:read - Receive @mentions
42
+ channels:history - Read messages in public channels
43
+ channels:read - View basic channel info
44
+ chat:write - Send messages
45
+ files:write - Upload diagram images
46
+ groups:history - Read messages in private channels
47
+ groups:read - View basic private channel info
48
+ im:history - Read DM messages
49
+ im:read - View basic DM info
50
+ mpim:history - Read group DM messages
51
+ mpim:read - View basic group DM info
52
+ reactions:read - View reactions
53
+ reactions:write - Add/remove reactions
54
+ users:read - View user info
55
+ ```
56
+
57
+ 4. **Enable Event Subscriptions**:
58
+ - Navigate to "Event Subscriptions"
59
+ - Toggle "Enable Events" to On
60
+ - Subscribe to bot events:
61
+ - `app_mention` - When someone mentions your bot
62
+ - `message.channels` - Messages in public channels (optional)
63
+ - `message.groups` - Messages in private channels (optional)
64
+ - `message.im` - Direct messages (optional)
65
+ - `message.mpim` - Group DMs (optional)
66
+
67
+ 5. **Install to Workspace**:
68
+ - Navigate to "Install App"
69
+ - Click "Install to Workspace"
70
+ - Save the Bot User OAuth Token (starts with `xoxb-`)
71
+
72
+ ### Environment Variables
73
+
74
+ ```bash
75
+ # Required for Socket Mode
76
+ export SLACK_APP_TOKEN="xapp-..." # App-level token for Socket Mode
77
+ export SLACK_BOT_TOKEN="xoxb-..." # Bot user OAuth token
78
+ ```
79
+
80
+ ## Configuration
81
+
82
+ ### CLI Flag
83
+
84
+ Enable Slack Socket Mode runner with the `--slack` flag:
85
+
86
+ ```bash
87
+ visor --config workflow.yaml --slack
88
+ ```
89
+
90
+ ### Environment Variables
91
+
92
+ | Variable | Description | Required |
93
+ |----------|-------------|----------|
94
+ | `SLACK_APP_TOKEN` | App-level token for Socket Mode (xapp-...) | Yes |
95
+ | `SLACK_BOT_TOKEN` | Bot user OAuth token (xoxb-...) | Yes |
96
+
97
+ ### Configuration File
98
+
99
+ Add Slack-specific configuration in your workflow YAML:
100
+
101
+ ```yaml
102
+ version: "1.0"
103
+
104
+ # Slack runtime configuration
105
+ slack:
106
+ version: "v1"
107
+ mentions: all # 'direct' (only @mentions) or 'all' (DMs too)
108
+ threads: required # 'required' or 'any'
109
+ channel_allowlist: # Optional: limit to specific channels
110
+ - C12345678
111
+ - CENG* # Wildcard prefix matching
112
+ show_raw_output: false # Set true to post raw JSON (debugging)
113
+
114
+ # Optional: customize reaction names
115
+ reactions:
116
+ enabled: true
117
+ ack: eyes # Acknowledgement reaction
118
+ done: thumbsup # Completion reaction
119
+
120
+ # Optional: allow bot_message events (default: false)
121
+ # When true, messages posted by other bots can trigger runs (still subject
122
+ # to mention/threads/channel allowlist gating).
123
+ allow_bot_messages: false
124
+
125
+ # Optional: rate limiting
126
+ rate_limiting:
127
+ enabled: true
128
+ user:
129
+ requests_per_minute: 10
130
+ requests_per_hour: 100
131
+ channel:
132
+ requests_per_minute: 30
133
+ global:
134
+ concurrent_requests: 5
135
+
136
+ # Optional: conversation fetching
137
+ fetch:
138
+ scope: thread
139
+ max_messages: 40
140
+ cache:
141
+ max_threads: 200
142
+ ttl_seconds: 600
143
+
144
+ # Frontend configuration for posting to Slack
145
+ frontends:
146
+ - name: slack
147
+ config:
148
+ defaultChannel: C12345678
149
+ groupChannels:
150
+ overview: C87654321
151
+ review: C11111111
152
+
153
+ checks:
154
+ # Your workflow checks...
155
+ ```
156
+
157
+ ### Slack Configuration Options
158
+
159
+ | Option | Type | Default | Description |
160
+ |--------|------|---------|-------------|
161
+ | `version` | string | `"v1"` | API version identifier |
162
+ | `mentions` | string | `"direct"` | `"direct"` for @mentions only, `"all"` for DMs too |
163
+ | `threads` | string | `"any"` | `"required"` to only respond in threads |
164
+ | `channel_allowlist` | string[] | `[]` | Limit to specific channels (supports `*` wildcard) |
165
+ | `allow_bot_messages` | boolean | `false` | Allow `bot_message` events to trigger runs |
166
+ | `show_raw_output` | boolean | `false` | Post raw JSON output (for debugging) |
167
+ | `reactions.enabled` | boolean | `true` | Enable reaction management |
168
+ | `reactions.ack` | string | `"eyes"` | Reaction name for acknowledgement |
169
+ | `reactions.done` | string | `"thumbsup"` | Reaction name for completion |
170
+
171
+ ### Rate Limiting Options
172
+
173
+ ```yaml
174
+ slack:
175
+ rate_limiting:
176
+ enabled: true
177
+ bot: # Per-bot limits
178
+ requests_per_minute: 60
179
+ requests_per_hour: 1000
180
+ concurrent_requests: 10
181
+ user: # Per-user limits
182
+ requests_per_minute: 10
183
+ requests_per_hour: 100
184
+ channel: # Per-channel limits
185
+ requests_per_minute: 30
186
+ global: # Global limits
187
+ concurrent_requests: 5
188
+ actions:
189
+ send_ephemeral_message: true
190
+ ephemeral_message: "Rate limit reached. Please wait."
191
+ queue_when_near_limit: false
192
+ queue_threshold: 0.8
193
+ ```
194
+
195
+ ## Features
196
+
197
+ ### Message Posting and Threading
198
+
199
+ The Slack frontend automatically posts AI responses to the originating thread:
200
+
201
+ - AI check outputs with `text` fields are posted as thread replies
202
+ - Messages are formatted using Slack's mrkdwn syntax
203
+ - Markdown links, bold, italic, and headers are converted appropriately
204
+
205
+ ```yaml
206
+ checks:
207
+ reply:
208
+ type: ai
209
+ group: chat
210
+ schema:
211
+ type: object
212
+ properties:
213
+ text:
214
+ type: string
215
+ required: [text]
216
+ prompt: |
217
+ Reply to the user's question.
218
+ ```
219
+
220
+ ### Reaction Management
221
+
222
+ The frontend manages reactions for visual feedback:
223
+
224
+ 1. **Acknowledgement** (eyes emoji): Added when a check is scheduled
225
+ 2. **Completion** (thumbsup emoji): Replaces acknowledgement when workflow completes
226
+
227
+ Configure custom reactions:
228
+
229
+ ```yaml
230
+ slack:
231
+ reactions:
232
+ enabled: true
233
+ ack: hourglass_flowing_sand
234
+ done: white_check_mark
235
+ ```
236
+
237
+ ### Mermaid Diagram Rendering
238
+
239
+ Mermaid diagrams in AI responses are automatically:
240
+
241
+ 1. Detected from ```mermaid code blocks
242
+ 2. Rendered to PNG using @mermaid-js/mermaid-cli
243
+ 3. Uploaded to the Slack thread as images
244
+ 4. Replaced with "_(See diagram above)_" placeholder in text
245
+
246
+ Requirements for diagram rendering:
247
+ - Node.js and npx in PATH
248
+ - Puppeteer/Chromium dependencies
249
+ - On Linux: `apt-get install chromium-browser libatk-bridge2.0-0 libgtk-3-0`
250
+
251
+ Example AI response that includes a diagram:
252
+
253
+ ```yaml
254
+ checks:
255
+ explain-architecture:
256
+ type: ai
257
+ prompt: |
258
+ Explain the system architecture with a diagram.
259
+
260
+ Include a mermaid flowchart showing the data flow.
261
+ ```
262
+
263
+ ### Human Input Prompts
264
+
265
+ The `human-input` check type integrates with Slack for interactive workflows:
266
+
267
+ ```yaml
268
+ checks:
269
+ ask:
270
+ type: human-input
271
+ group: chat
272
+ prompt: |
273
+ What would you like to know?
274
+ ```
275
+
276
+ Behavior in Slack:
277
+ - First message in a thread is consumed as the initial input
278
+ - Subsequent messages resume the workflow from its saved snapshot
279
+ - The prompt text is registered internally but not posted (to avoid spam)
280
+
281
+ ### Conversation Context
282
+
283
+ Access full thread history in your prompts:
284
+
285
+ ```yaml
286
+ checks:
287
+ context-aware-reply:
288
+ type: ai
289
+ prompt: |
290
+ Thread context:
291
+ {% if slack.conversation %}
292
+ {% for m in slack.conversation.messages %}
293
+ - [{{ m.user }}] {{ m.text }}
294
+ {% endfor %}
295
+ {% endif %}
296
+
297
+ Respond based on the conversation above.
298
+ ```
299
+
300
+ Or use the `chat_history` filter for merged history:
301
+
302
+ ```yaml
303
+ checks:
304
+ reply:
305
+ type: ai
306
+ prompt: |
307
+ Conversation so far:
308
+ {% assign history = '' | chat_history: 'ask', 'reply' %}
309
+ {% for m in history %}
310
+ {{ m.role | capitalize }}: {{ m.text }}
311
+ {% endfor %}
312
+
313
+ Latest message: {{ outputs['ask'].text }}
314
+ ```
315
+
316
+ ### Markdown to Slack Conversion
317
+
318
+ The integration automatically converts Markdown to Slack mrkdwn:
319
+
320
+ | Markdown | Slack mrkdwn |
321
+ |----------|--------------|
322
+ | `# Header` | `*Header*` |
323
+ | `**bold**` | `*bold*` |
324
+ | `[label](url)` | `<url\|label>` |
325
+ | `![alt](url)` | `<url\|alt>` |
326
+ | `- item` | `bullet item` |
327
+ | ` ```code``` ` | Preserved as-is |
328
+
329
+ ## Example Workflows
330
+
331
+ ### Simple Chat Assistant
332
+
333
+ See [examples/slack-simple-chat.yaml](../examples/slack-simple-chat.yaml) for a complete example with:
334
+
335
+ - Intent routing (chat, FAQ, project help, thread summary)
336
+ - Nested sub-flows with inner loops
337
+ - Conversation history management
338
+ - External integration mocks
339
+
340
+ Basic chat loop:
341
+
342
+ ```yaml
343
+ version: "1.0"
344
+
345
+ slack:
346
+ mentions: all
347
+ threads: required
348
+
349
+ frontends:
350
+ - name: slack
351
+
352
+ checks:
353
+ ask:
354
+ type: human-input
355
+ group: chat
356
+ prompt: |
357
+ Hi! What can I help you with?
358
+
359
+ reply:
360
+ type: ai
361
+ group: chat
362
+ depends_on: ask
363
+ schema:
364
+ type: object
365
+ properties:
366
+ text:
367
+ type: string
368
+ required: [text]
369
+ ai:
370
+ disableTools: true
371
+ system_prompt: "You are a helpful assistant."
372
+ prompt: |
373
+ Conversation:
374
+ {% assign history = '' | chat_history: 'ask', 'reply' %}
375
+ {% for m in history %}
376
+ {{ m.role | capitalize }}: {{ m.text }}
377
+ {% endfor %}
378
+
379
+ Latest: {{ outputs['ask'].text }}
380
+
381
+ Reply briefly.
382
+ on_success:
383
+ goto: ask
384
+ ```
385
+
386
+ ### Running the Slack Bot
387
+
388
+ ```bash
389
+ # Set environment variables
390
+ export SLACK_APP_TOKEN="xapp-..."
391
+ export SLACK_BOT_TOKEN="xoxb-..."
392
+
393
+ # Optional: enable debug logging
394
+ export VISOR_DEBUG=true
395
+
396
+ # Start the bot
397
+ visor --config examples/slack-simple-chat.yaml --slack
398
+ ```
399
+
400
+ The bot will:
401
+ 1. Connect via Socket Mode
402
+ 2. Listen for @mentions and DMs (depending on `mentions` setting)
403
+ 3. Process messages through your workflow
404
+ 4. Post responses back to the thread
405
+
406
+ ## Troubleshooting
407
+
408
+ ### Connection Issues
409
+
410
+ **"SLACK_APP_TOKEN (xapp-...) is required for Socket Mode"**
411
+ - Ensure `SLACK_APP_TOKEN` environment variable is set
412
+ - Verify the token starts with `xapp-`
413
+
414
+ **"apps.connections.open failed"**
415
+ - Check that Socket Mode is enabled in your Slack app settings
416
+ - Verify the App-Level Token has `connections:write` scope
417
+ - Ensure the token has not been revoked
418
+
419
+ ### Message Handling Issues
420
+
421
+ **Bot not responding to messages**
422
+ - Verify the bot is invited to the channel
423
+ - Check `channel_allowlist` if configured
424
+ - Ensure `mentions` setting matches your use case:
425
+ - Use `mentions: direct` for @mentions only
426
+ - Use `mentions: all` to respond to DMs
427
+
428
+ **Bot responding multiple times**
429
+ - The deduplication system handles this automatically
430
+ - If issues persist, check for multiple bot instances running
431
+
432
+ **Messages not appearing in thread**
433
+ - Verify `SLACK_BOT_TOKEN` has `chat:write` scope
434
+ - Check that the bot is a member of the channel
435
+ - Review logs for API errors
436
+
437
+ ### Diagram Rendering Issues
438
+
439
+ **"Mermaid rendering failed"**
440
+ - Install mermaid-cli: `npm install -g @mermaid-js/mermaid-cli`
441
+ - On Linux, install Chromium dependencies:
442
+ ```bash
443
+ apt-get install chromium-browser libatk-bridge2.0-0 libgtk-3-0
444
+ ```
445
+ - Check that `npx` is available in PATH
446
+
447
+ ### Rate Limiting
448
+
449
+ **"Rate limited" messages in logs**
450
+ - Review and adjust rate limit configuration
451
+ - Consider increasing limits for legitimate high-volume usage
452
+ - Check which dimension is triggering (`bot`, `user`, `channel`, `global`)
453
+
454
+ ### Debug Mode
455
+
456
+ Enable verbose logging for troubleshooting:
457
+
458
+ ```bash
459
+ # Via environment variable
460
+ VISOR_DEBUG=true visor --config workflow.yaml --slack
461
+
462
+ # Or via CLI flag
463
+ visor --config workflow.yaml --slack --debug
464
+ ```
465
+
466
+ Log messages include:
467
+ - `[SlackSocket]` - WebSocket connection and event handling
468
+ - `[slack-frontend]` - Message posting and reactions
469
+ - `[prompt-state]` - Human input state management
470
+
471
+ ## Related Documentation
472
+
473
+ - [Human Input Provider](./human-input-provider.md) - Detailed documentation on the `human-input` check type
474
+ - [Bot Transports RFC](./bot-transports-rfc.md) - Technical design document for Slack integration
475
+ - [Recipes](./recipes.md) - Common workflow patterns including chat loops
476
+ - [Liquid Templates](./liquid-templates.md) - Template syntax for prompts including `chat_history`
477
+ - [Output History](./output-history.md) - Working with workflow output history
478
+
479
+ ## See Also
480
+
481
+ - [examples/slack-simple-chat.yaml](../examples/slack-simple-chat.yaml) - Complete Slack chat assistant example
@@ -144,7 +144,7 @@ visor --tags github
144
144
  visor --tags github,security
145
145
  ```
146
146
 
147
- In the test runner, you can mirror this behavior with the tests DSL:
147
+ In the test runner, you can mirror this behavior with the tests DSL (see [Testing DSL Reference](./testing/dsl-reference.md)):
148
148
 
149
149
  ```yaml
150
150
  # defaults/.visor.tests.yaml
@@ -156,26 +156,40 @@ tests:
156
156
 
157
157
  #### Environment-Specific Execution
158
158
 
159
+ Create separate config files for each environment:
160
+
161
+ ```yaml
162
+ # .visor.dev.yaml - Development environment (fast feedback)
163
+ version: "1.0"
164
+ extends: .visor.yaml
165
+ tag_filter:
166
+ include: ["local", "fast"]
167
+ exclude: ["experimental"]
168
+ ```
169
+
159
170
  ```yaml
160
- # Development environment - fast feedback
161
- development:
162
- extends: .visor.yaml
163
- tag_filter:
164
- include: ["local", "fast"]
165
- exclude: ["experimental"]
166
-
167
- # Staging environment - balanced
168
- staging:
169
- extends: .visor.yaml
170
- tag_filter:
171
- include: ["remote", "security", "performance"]
172
- exclude: ["experimental"]
173
-
174
- # Production environment - comprehensive
175
- production:
176
- extends: .visor.yaml
177
- tag_filter:
178
- include: ["remote", "comprehensive", "critical"]
171
+ # .visor.staging.yaml - Staging environment (balanced)
172
+ version: "1.0"
173
+ extends: .visor.yaml
174
+ tag_filter:
175
+ include: ["remote", "security", "performance"]
176
+ exclude: ["experimental"]
177
+ ```
178
+
179
+ ```yaml
180
+ # .visor.prod.yaml - Production environment (comprehensive)
181
+ version: "1.0"
182
+ extends: .visor.yaml
183
+ tag_filter:
184
+ include: ["remote", "comprehensive", "critical"]
185
+ ```
186
+
187
+ Then use the appropriate config file:
188
+
189
+ ```bash
190
+ visor --config .visor.dev.yaml # Development
191
+ visor --config .visor.staging.yaml # Staging
192
+ visor --config .visor.prod.yaml # Production
179
193
  ```
180
194
 
181
195
  #### Multi-Stage Pipeline
@@ -248,6 +262,24 @@ steps:
248
262
  - Examples: `local`, `test-env`, `feature_flag`, `v2`
249
263
  - Invalid: `-invalid`, `@special`, `tag with spaces`
250
264
 
265
+ ### SDK Usage
266
+
267
+ Tag filtering is also available when using Visor programmatically via the SDK:
268
+
269
+ ```typescript
270
+ import { run } from '@probelabs/visor';
271
+
272
+ const result = await run({
273
+ config: './visor.yaml',
274
+ tagFilter: {
275
+ include: ['local', 'fast'],
276
+ exclude: ['experimental']
277
+ }
278
+ });
279
+ ```
280
+
281
+ See [SDK Documentation](./sdk.md) for complete API reference.
282
+
251
283
  ### Best Practices
252
284
 
253
285
  1. Use consistent naming conventions across your organization
@@ -256,3 +288,11 @@ steps:
256
288
  4. Avoid over-tagging to reduce confusion
257
289
  5. Use tag combinations for fine-grained control
258
290
  6. Test tag filters before deploying broadly
291
+
292
+ ### Related Documentation
293
+
294
+ - [Configuration](./configuration.md) - Full configuration reference
295
+ - [CLI Commands](./commands.md) - CLI flag reference including `--tags` and `--exclude-tags`
296
+ - [GitHub Action Reference](./action-reference.md) - GitHub Action inputs for tag filtering
297
+ - [Testing DSL Reference](./testing/dsl-reference.md) - Tag filtering in test suites
298
+ - [SDK Documentation](./sdk.md) - Programmatic tag filtering