@probelabs/visor 0.1.124 → 0.1.125

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 (165) 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 +475 -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/generated/config-schema.d.ts +7 -7
  107. package/dist/generated/config-schema.d.ts.map +1 -1
  108. package/dist/generated/config-schema.json +7 -7
  109. package/dist/index.js +9946 -7087
  110. package/dist/output/traces/{run-2026-01-28T16-15-24-569Z.ndjson → run-2026-01-30T09-25-36-981Z.ndjson} +84 -84
  111. package/dist/output/traces/{run-2026-01-28T16-16-09-757Z.ndjson → run-2026-01-30T09-26-20-969Z.ndjson} +1026 -1026
  112. package/dist/providers/ai-check-provider.d.ts +9 -2
  113. package/dist/providers/ai-check-provider.d.ts.map +1 -1
  114. package/dist/providers/command-check-provider.d.ts.map +1 -1
  115. package/dist/providers/mcp-custom-sse-server.d.ts +17 -1
  116. package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -1
  117. package/dist/providers/workflow-check-provider.d.ts.map +1 -1
  118. package/dist/providers/workflow-tool-executor.d.ts +68 -0
  119. package/dist/providers/workflow-tool-executor.d.ts.map +1 -0
  120. package/dist/sdk/{check-provider-registry-AQ3JETBG.mjs → check-provider-registry-3KI5RKXT.mjs} +6 -5
  121. package/dist/sdk/{chunk-YLQ4UN62.mjs → chunk-A4PGHURG.mjs} +6838 -6257
  122. package/dist/sdk/chunk-A4PGHURG.mjs.map +1 -0
  123. package/dist/sdk/chunk-EXFGO4FX.mjs +147 -0
  124. package/dist/sdk/chunk-EXFGO4FX.mjs.map +1 -0
  125. package/dist/sdk/{chunk-BHZ4CKUS.mjs → chunk-PXFIALUH.mjs} +77 -8
  126. package/dist/sdk/chunk-PXFIALUH.mjs.map +1 -0
  127. package/dist/sdk/{chunk-PVITVJ6J.mjs → chunk-RTKJXNZS.mjs} +32 -9
  128. package/dist/sdk/chunk-RTKJXNZS.mjs.map +1 -0
  129. package/dist/sdk/{config-RQQPMLRD.mjs → config-6CUVEH7H.mjs} +2 -2
  130. package/dist/sdk/{github-frontend-6Q4BISZX.mjs → github-frontend-BZ4N3BFZ.mjs} +7 -3
  131. package/dist/sdk/github-frontend-BZ4N3BFZ.mjs.map +1 -0
  132. package/dist/sdk/{host-P5NQICP7.mjs → host-NYWXLIFC.mjs} +2 -2
  133. package/dist/sdk/{routing-DEY2AIXM.mjs → routing-7FXPULTO.mjs} +2 -2
  134. package/dist/sdk/sdk.d.mts +1 -1
  135. package/dist/sdk/sdk.d.ts +1 -1
  136. package/dist/sdk/sdk.js +12129 -11321
  137. package/dist/sdk/sdk.js.map +1 -1
  138. package/dist/sdk/sdk.mjs +13 -9
  139. package/dist/sdk/sdk.mjs.map +1 -1
  140. package/dist/sdk/workflow-check-provider-YUNNF4KC.mjs +28 -0
  141. package/dist/sdk/workflow-check-provider-YUNNF4KC.mjs.map +1 -0
  142. package/dist/state-machine/context/workflow-inputs.d.ts +20 -0
  143. package/dist/state-machine/context/workflow-inputs.d.ts.map +1 -0
  144. package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -1
  145. package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -1
  146. package/dist/state-machine/states/level-dispatch.d.ts.map +1 -1
  147. package/dist/state-machine/states/routing.d.ts +2 -1
  148. package/dist/state-machine/states/routing.d.ts.map +1 -1
  149. package/dist/traces/{run-2026-01-28T16-15-24-569Z.ndjson → run-2026-01-30T09-25-36-981Z.ndjson} +84 -84
  150. package/dist/traces/{run-2026-01-28T16-16-09-757Z.ndjson → run-2026-01-30T09-26-20-969Z.ndjson} +1026 -1026
  151. package/dist/types/config.d.ts +1 -1
  152. package/dist/types/config.d.ts.map +1 -1
  153. package/dist/utils/human-id.d.ts +12 -0
  154. package/dist/utils/human-id.d.ts.map +1 -0
  155. package/dist/utils/worktree-manager.d.ts +3 -0
  156. package/dist/utils/worktree-manager.d.ts.map +1 -1
  157. package/package.json +2 -2
  158. package/dist/sdk/chunk-BHZ4CKUS.mjs.map +0 -1
  159. package/dist/sdk/chunk-PVITVJ6J.mjs.map +0 -1
  160. package/dist/sdk/chunk-YLQ4UN62.mjs.map +0 -1
  161. package/dist/sdk/github-frontend-6Q4BISZX.mjs.map +0 -1
  162. /package/dist/sdk/{check-provider-registry-AQ3JETBG.mjs.map → check-provider-registry-3KI5RKXT.mjs.map} +0 -0
  163. /package/dist/sdk/{config-RQQPMLRD.mjs.map → config-6CUVEH7H.mjs.map} +0 -0
  164. /package/dist/sdk/{host-P5NQICP7.mjs.map → host-NYWXLIFC.mjs.map} +0 -0
  165. /package/dist/sdk/{routing-DEY2AIXM.mjs.map → routing-7FXPULTO.mjs.map} +0 -0
@@ -0,0 +1,475 @@
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: rate limiting
121
+ rate_limiting:
122
+ enabled: true
123
+ user:
124
+ requests_per_minute: 10
125
+ requests_per_hour: 100
126
+ channel:
127
+ requests_per_minute: 30
128
+ global:
129
+ concurrent_requests: 5
130
+
131
+ # Optional: conversation fetching
132
+ fetch:
133
+ scope: thread
134
+ max_messages: 40
135
+ cache:
136
+ max_threads: 200
137
+ ttl_seconds: 600
138
+
139
+ # Frontend configuration for posting to Slack
140
+ frontends:
141
+ - name: slack
142
+ config:
143
+ defaultChannel: C12345678
144
+ groupChannels:
145
+ overview: C87654321
146
+ review: C11111111
147
+
148
+ checks:
149
+ # Your workflow checks...
150
+ ```
151
+
152
+ ### Slack Configuration Options
153
+
154
+ | Option | Type | Default | Description |
155
+ |--------|------|---------|-------------|
156
+ | `version` | string | `"v1"` | API version identifier |
157
+ | `mentions` | string | `"direct"` | `"direct"` for @mentions only, `"all"` for DMs too |
158
+ | `threads` | string | `"any"` | `"required"` to only respond in threads |
159
+ | `channel_allowlist` | string[] | `[]` | Limit to specific channels (supports `*` wildcard) |
160
+ | `show_raw_output` | boolean | `false` | Post raw JSON output (for debugging) |
161
+ | `reactions.enabled` | boolean | `true` | Enable reaction management |
162
+ | `reactions.ack` | string | `"eyes"` | Reaction name for acknowledgement |
163
+ | `reactions.done` | string | `"thumbsup"` | Reaction name for completion |
164
+
165
+ ### Rate Limiting Options
166
+
167
+ ```yaml
168
+ slack:
169
+ rate_limiting:
170
+ enabled: true
171
+ bot: # Per-bot limits
172
+ requests_per_minute: 60
173
+ requests_per_hour: 1000
174
+ concurrent_requests: 10
175
+ user: # Per-user limits
176
+ requests_per_minute: 10
177
+ requests_per_hour: 100
178
+ channel: # Per-channel limits
179
+ requests_per_minute: 30
180
+ global: # Global limits
181
+ concurrent_requests: 5
182
+ actions:
183
+ send_ephemeral_message: true
184
+ ephemeral_message: "Rate limit reached. Please wait."
185
+ queue_when_near_limit: false
186
+ queue_threshold: 0.8
187
+ ```
188
+
189
+ ## Features
190
+
191
+ ### Message Posting and Threading
192
+
193
+ The Slack frontend automatically posts AI responses to the originating thread:
194
+
195
+ - AI check outputs with `text` fields are posted as thread replies
196
+ - Messages are formatted using Slack's mrkdwn syntax
197
+ - Markdown links, bold, italic, and headers are converted appropriately
198
+
199
+ ```yaml
200
+ checks:
201
+ reply:
202
+ type: ai
203
+ group: chat
204
+ schema:
205
+ type: object
206
+ properties:
207
+ text:
208
+ type: string
209
+ required: [text]
210
+ prompt: |
211
+ Reply to the user's question.
212
+ ```
213
+
214
+ ### Reaction Management
215
+
216
+ The frontend manages reactions for visual feedback:
217
+
218
+ 1. **Acknowledgement** (eyes emoji): Added when a check is scheduled
219
+ 2. **Completion** (thumbsup emoji): Replaces acknowledgement when workflow completes
220
+
221
+ Configure custom reactions:
222
+
223
+ ```yaml
224
+ slack:
225
+ reactions:
226
+ enabled: true
227
+ ack: hourglass_flowing_sand
228
+ done: white_check_mark
229
+ ```
230
+
231
+ ### Mermaid Diagram Rendering
232
+
233
+ Mermaid diagrams in AI responses are automatically:
234
+
235
+ 1. Detected from ```mermaid code blocks
236
+ 2. Rendered to PNG using @mermaid-js/mermaid-cli
237
+ 3. Uploaded to the Slack thread as images
238
+ 4. Replaced with "_(See diagram above)_" placeholder in text
239
+
240
+ Requirements for diagram rendering:
241
+ - Node.js and npx in PATH
242
+ - Puppeteer/Chromium dependencies
243
+ - On Linux: `apt-get install chromium-browser libatk-bridge2.0-0 libgtk-3-0`
244
+
245
+ Example AI response that includes a diagram:
246
+
247
+ ```yaml
248
+ checks:
249
+ explain-architecture:
250
+ type: ai
251
+ prompt: |
252
+ Explain the system architecture with a diagram.
253
+
254
+ Include a mermaid flowchart showing the data flow.
255
+ ```
256
+
257
+ ### Human Input Prompts
258
+
259
+ The `human-input` check type integrates with Slack for interactive workflows:
260
+
261
+ ```yaml
262
+ checks:
263
+ ask:
264
+ type: human-input
265
+ group: chat
266
+ prompt: |
267
+ What would you like to know?
268
+ ```
269
+
270
+ Behavior in Slack:
271
+ - First message in a thread is consumed as the initial input
272
+ - Subsequent messages resume the workflow from its saved snapshot
273
+ - The prompt text is registered internally but not posted (to avoid spam)
274
+
275
+ ### Conversation Context
276
+
277
+ Access full thread history in your prompts:
278
+
279
+ ```yaml
280
+ checks:
281
+ context-aware-reply:
282
+ type: ai
283
+ prompt: |
284
+ Thread context:
285
+ {% if slack.conversation %}
286
+ {% for m in slack.conversation.messages %}
287
+ - [{{ m.user }}] {{ m.text }}
288
+ {% endfor %}
289
+ {% endif %}
290
+
291
+ Respond based on the conversation above.
292
+ ```
293
+
294
+ Or use the `chat_history` filter for merged history:
295
+
296
+ ```yaml
297
+ checks:
298
+ reply:
299
+ type: ai
300
+ prompt: |
301
+ Conversation so far:
302
+ {% assign history = '' | chat_history: 'ask', 'reply' %}
303
+ {% for m in history %}
304
+ {{ m.role | capitalize }}: {{ m.text }}
305
+ {% endfor %}
306
+
307
+ Latest message: {{ outputs['ask'].text }}
308
+ ```
309
+
310
+ ### Markdown to Slack Conversion
311
+
312
+ The integration automatically converts Markdown to Slack mrkdwn:
313
+
314
+ | Markdown | Slack mrkdwn |
315
+ |----------|--------------|
316
+ | `# Header` | `*Header*` |
317
+ | `**bold**` | `*bold*` |
318
+ | `[label](url)` | `<url\|label>` |
319
+ | `![alt](url)` | `<url\|alt>` |
320
+ | `- item` | `bullet item` |
321
+ | ` ```code``` ` | Preserved as-is |
322
+
323
+ ## Example Workflows
324
+
325
+ ### Simple Chat Assistant
326
+
327
+ See [examples/slack-simple-chat.yaml](../examples/slack-simple-chat.yaml) for a complete example with:
328
+
329
+ - Intent routing (chat, FAQ, project help, thread summary)
330
+ - Nested sub-flows with inner loops
331
+ - Conversation history management
332
+ - External integration mocks
333
+
334
+ Basic chat loop:
335
+
336
+ ```yaml
337
+ version: "1.0"
338
+
339
+ slack:
340
+ mentions: all
341
+ threads: required
342
+
343
+ frontends:
344
+ - name: slack
345
+
346
+ checks:
347
+ ask:
348
+ type: human-input
349
+ group: chat
350
+ prompt: |
351
+ Hi! What can I help you with?
352
+
353
+ reply:
354
+ type: ai
355
+ group: chat
356
+ depends_on: ask
357
+ schema:
358
+ type: object
359
+ properties:
360
+ text:
361
+ type: string
362
+ required: [text]
363
+ ai:
364
+ disableTools: true
365
+ system_prompt: "You are a helpful assistant."
366
+ prompt: |
367
+ Conversation:
368
+ {% assign history = '' | chat_history: 'ask', 'reply' %}
369
+ {% for m in history %}
370
+ {{ m.role | capitalize }}: {{ m.text }}
371
+ {% endfor %}
372
+
373
+ Latest: {{ outputs['ask'].text }}
374
+
375
+ Reply briefly.
376
+ on_success:
377
+ goto: ask
378
+ ```
379
+
380
+ ### Running the Slack Bot
381
+
382
+ ```bash
383
+ # Set environment variables
384
+ export SLACK_APP_TOKEN="xapp-..."
385
+ export SLACK_BOT_TOKEN="xoxb-..."
386
+
387
+ # Optional: enable debug logging
388
+ export VISOR_DEBUG=true
389
+
390
+ # Start the bot
391
+ visor --config examples/slack-simple-chat.yaml --slack
392
+ ```
393
+
394
+ The bot will:
395
+ 1. Connect via Socket Mode
396
+ 2. Listen for @mentions and DMs (depending on `mentions` setting)
397
+ 3. Process messages through your workflow
398
+ 4. Post responses back to the thread
399
+
400
+ ## Troubleshooting
401
+
402
+ ### Connection Issues
403
+
404
+ **"SLACK_APP_TOKEN (xapp-...) is required for Socket Mode"**
405
+ - Ensure `SLACK_APP_TOKEN` environment variable is set
406
+ - Verify the token starts with `xapp-`
407
+
408
+ **"apps.connections.open failed"**
409
+ - Check that Socket Mode is enabled in your Slack app settings
410
+ - Verify the App-Level Token has `connections:write` scope
411
+ - Ensure the token has not been revoked
412
+
413
+ ### Message Handling Issues
414
+
415
+ **Bot not responding to messages**
416
+ - Verify the bot is invited to the channel
417
+ - Check `channel_allowlist` if configured
418
+ - Ensure `mentions` setting matches your use case:
419
+ - Use `mentions: direct` for @mentions only
420
+ - Use `mentions: all` to respond to DMs
421
+
422
+ **Bot responding multiple times**
423
+ - The deduplication system handles this automatically
424
+ - If issues persist, check for multiple bot instances running
425
+
426
+ **Messages not appearing in thread**
427
+ - Verify `SLACK_BOT_TOKEN` has `chat:write` scope
428
+ - Check that the bot is a member of the channel
429
+ - Review logs for API errors
430
+
431
+ ### Diagram Rendering Issues
432
+
433
+ **"Mermaid rendering failed"**
434
+ - Install mermaid-cli: `npm install -g @mermaid-js/mermaid-cli`
435
+ - On Linux, install Chromium dependencies:
436
+ ```bash
437
+ apt-get install chromium-browser libatk-bridge2.0-0 libgtk-3-0
438
+ ```
439
+ - Check that `npx` is available in PATH
440
+
441
+ ### Rate Limiting
442
+
443
+ **"Rate limited" messages in logs**
444
+ - Review and adjust rate limit configuration
445
+ - Consider increasing limits for legitimate high-volume usage
446
+ - Check which dimension is triggering (`bot`, `user`, `channel`, `global`)
447
+
448
+ ### Debug Mode
449
+
450
+ Enable verbose logging for troubleshooting:
451
+
452
+ ```bash
453
+ # Via environment variable
454
+ VISOR_DEBUG=true visor --config workflow.yaml --slack
455
+
456
+ # Or via CLI flag
457
+ visor --config workflow.yaml --slack --debug
458
+ ```
459
+
460
+ Log messages include:
461
+ - `[SlackSocket]` - WebSocket connection and event handling
462
+ - `[slack-frontend]` - Message posting and reactions
463
+ - `[prompt-state]` - Human input state management
464
+
465
+ ## Related Documentation
466
+
467
+ - [Human Input Provider](./human-input-provider.md) - Detailed documentation on the `human-input` check type
468
+ - [Bot Transports RFC](./bot-transports-rfc.md) - Technical design document for Slack integration
469
+ - [Recipes](./recipes.md) - Common workflow patterns including chat loops
470
+ - [Liquid Templates](./liquid-templates.md) - Template syntax for prompts including `chat_history`
471
+ - [Output History](./output-history.md) - Working with workflow output history
472
+
473
+ ## See Also
474
+
475
+ - [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