agent-browser 0.15.1 → 0.15.3

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.
@@ -0,0 +1,354 @@
1
+ # Common Slack Tasks & Patterns
2
+
3
+ Reference guide for common automations and data extraction patterns when interacting with Slack.
4
+
5
+ ## Task: Check All Unread Messages
6
+
7
+ ### Goal
8
+ Determine which channels and DMs have unread messages.
9
+
10
+ ### Steps
11
+
12
+ 1. **Connect to Slack**
13
+ ```bash
14
+ agent-browser connect 9222
15
+ ```
16
+
17
+ 2. **Check Activity Tab**
18
+ - Take snapshot: `agent-browser snapshot -i`
19
+ - Look for Activity tab ref (usually `@e14`)
20
+ - Click: `agent-browser click @e14`
21
+ - Wait: `agent-browser wait 1000`
22
+ - If you see "You've read all the unreads", you have no unread messages
23
+ - Screenshot: `agent-browser screenshot activity.png`
24
+
25
+ 3. **Check DMs**
26
+ - Click DMs tab ref (usually `@e13`)
27
+ - Look for "Unreads" toggle/badge
28
+ - Count visible conversations with indicators
29
+
30
+ 4. **Check Channels**
31
+ - Look for "More unreads" button (usually in sidebar)
32
+ - Click it to expand list of channels with unreads
33
+ - Screenshot the expanded view
34
+ - Parse channel names from snapshot
35
+
36
+ 5. **Summary**
37
+ - Activity + DMs + Channels = complete unread picture
38
+
39
+ ### Evidence Capture
40
+ - Screenshot of Activity tab
41
+ - Screenshot of DMs
42
+ - Screenshot of expanded unreads sidebar
43
+
44
+ ---
45
+
46
+ ## Task: Find All Channels in Workspace
47
+
48
+ ### Goal
49
+ Get a complete list of all channels you have access to.
50
+
51
+ ### Steps
52
+
53
+ 1. **Navigate to Channels section**
54
+ ```bash
55
+ agent-browser connect 9222
56
+ agent-browser snapshot -i
57
+ ```
58
+
59
+ 2. **Look for "Channels" treeitem**
60
+ - This is usually a collapsed section header
61
+ - Click to expand if collapsed
62
+ - Screenshot: `agent-browser screenshot all-channels.png`
63
+
64
+ 3. **Scroll through sidebar**
65
+ ```bash
66
+ # If the list is long, scroll within the sidebar
67
+ agent-browser scroll down 500 --selector ".p-sidebar"
68
+ agent-browser screenshot channels-page-2.png
69
+ ```
70
+
71
+ 4. **Parse snapshot for channel list**
72
+ ```bash
73
+ agent-browser snapshot --json > channels.json
74
+ # Search JSON for treeitem elements with level=2 under "Channels" section
75
+ ```
76
+
77
+ ### Evidence
78
+ - JSON snapshot with all channel refs
79
+ - Screenshots of channel list
80
+ - Count of total channels
81
+
82
+ ---
83
+
84
+ ## Task: Search for Messages Containing Keywords
85
+
86
+ ### Goal
87
+ Find all messages/threads mentioning specific terms.
88
+
89
+ ### Steps
90
+
91
+ 1. **Open search**
92
+ ```bash
93
+ agent-browser snapshot -i
94
+ # Find Search button ref (usually @e5)
95
+ agent-browser click @e5
96
+ agent-browser wait 500
97
+ ```
98
+
99
+ 2. **Enter search term**
100
+ ```bash
101
+ # Identify search input ref from snapshot
102
+ agent-browser fill @e_search_input "your keyword"
103
+ agent-browser press Enter
104
+ agent-browser wait --load networkidle
105
+ ```
106
+
107
+ 3. **Capture results**
108
+ ```bash
109
+ agent-browser screenshot search-results.png
110
+ agent-browser snapshot -i > search-snapshot.txt
111
+ ```
112
+
113
+ 4. **Parse results**
114
+ - Look for result items in snapshot
115
+ - Extract message content, sender, channel, timestamp
116
+ - Follow links to view full context
117
+
118
+ ### Filters
119
+ Slack search supports filters:
120
+ - `in:channel-name` - Search in specific channel
121
+ - `from:@user` - Messages from specific user
122
+ - `before:2026-02-25` - Messages before date
123
+ - `after:2026-02-20` - Messages after date
124
+ - `has:file` - Messages with files
125
+ - `has:emoji` - Messages with reactions
126
+
127
+ Example search: `"bug report" in:engineering from:@alice after:2026-02-20`
128
+
129
+ ---
130
+
131
+ ## Task: Monitor a Specific Channel for Activity
132
+
133
+ ### Goal
134
+ Watch a channel and capture new messages/engagement.
135
+
136
+ ### Steps
137
+
138
+ 1. **Navigate to channel**
139
+ ```bash
140
+ agent-browser connect 9222
141
+ agent-browser snapshot -i
142
+ # Find channel ref from sidebar
143
+ agent-browser click @e_channel_ref
144
+ agent-browser wait --load networkidle
145
+ ```
146
+
147
+ 2. **Check channel info**
148
+ - Screenshot channel details: `agent-browser screenshot channel-header.png`
149
+ - Look for member count, description, topic
150
+
151
+ 3. **View messages**
152
+ ```bash
153
+ # Jump to recent/unread
154
+ agent-browser press j # Jump to unread in Slack
155
+ agent-browser wait 500
156
+ agent-browser screenshot recent-messages.png
157
+ ```
158
+
159
+ 4. **Scroll to see more**
160
+ ```bash
161
+ agent-browser scroll down 500
162
+ agent-browser screenshot more-messages.png
163
+ ```
164
+
165
+ 5. **Check threads**
166
+ - Click on messages with thread indicators
167
+ - View replies in thread view
168
+ - Screenshot: `agent-browser screenshot thread.png`
169
+
170
+ ### Evidence
171
+ - Channel info screenshot
172
+ - Message history screenshots
173
+ - Thread examples
174
+
175
+ ---
176
+
177
+ ## Task: Extract User Information from a Conversation
178
+
179
+ ### Goal
180
+ Find who said what, when, and in what context.
181
+
182
+ ### Steps
183
+
184
+ 1. **Navigate to relevant channel or DM**
185
+ ```bash
186
+ agent-browser click @e_conversation_ref
187
+ agent-browser wait 1000
188
+ ```
189
+
190
+ 2. **Take snapshot with context**
191
+ ```bash
192
+ agent-browser snapshot --json > conversation.json
193
+ ```
194
+
195
+ 3. **Find message blocks**
196
+ - In JSON, look for document/listitem elements
197
+ - These contain: user name (button), timestamp (link), message text, reactions
198
+
199
+ 4. **Extract structured data**
200
+ - User: Found in button element with username
201
+ - Time: Found in link with timestamp
202
+ - Content: Text content of message
203
+ - Reactions: Buttons showing emoji counts
204
+
205
+ 5. **Screenshot key messages**
206
+ ```bash
207
+ agent-browser screenshot important-message.png
208
+ agent-browser screenshot --annotate annotated-message.png
209
+ ```
210
+
211
+ ---
212
+
213
+ ## Task: Track Reactions to a Message
214
+
215
+ ### Goal
216
+ See who reacted to a message and with what emoji.
217
+
218
+ ### Steps
219
+
220
+ 1. **Find message with reactions**
221
+ ```bash
222
+ agent-browser snapshot -i
223
+ # Look for "N reaction(s)" buttons in messages
224
+ ```
225
+
226
+ 2. **Click reaction button to expand**
227
+ ```bash
228
+ agent-browser click @e_reaction_button
229
+ agent-browser wait 500
230
+ ```
231
+
232
+ 3. **Capture reaction details**
233
+ ```bash
234
+ agent-browser screenshot reactions.png
235
+ # You'll see emoji, count, and list of users who reacted
236
+ ```
237
+
238
+ 4. **Extract data**
239
+ - Emoji used
240
+ - Number of people who reacted
241
+ - User names (if visible in popup)
242
+
243
+ ---
244
+
245
+ ## Task: Find and Review Pinned Messages
246
+
247
+ ### Goal
248
+ See messages that have been pinned in a channel.
249
+
250
+ ### Steps
251
+
252
+ 1. **Open a channel**
253
+ ```bash
254
+ agent-browser click @e_channel_ref
255
+ agent-browser wait 1000
256
+ agent-browser snapshot -i
257
+ ```
258
+
259
+ 2. **Click Pins tab**
260
+ - In channel view, look for "Pins" tab ref (usually near Messages, Files tabs)
261
+ - Click it: `agent-browser click @e_pins_tab`
262
+ - Wait: `agent-browser wait 500`
263
+
264
+ 3. **View pinned messages**
265
+ ```bash
266
+ agent-browser screenshot pins.png
267
+ agent-browser snapshot -i > pins-snapshot.txt
268
+ ```
269
+
270
+ 4. **Review each pin**
271
+ - Click pin to see context
272
+ - Note who pinned it, when, and why
273
+ - Screenshot: `agent-browser screenshot pin-detail.png`
274
+
275
+ ---
276
+
277
+ ## Pattern: Extract Timestamp from Link
278
+
279
+ In Slack snapshot, message timestamps appear as links. Example:
280
+ ```
281
+ - link "Feb 25th at 10:26:22 AM" [ref=e151]
282
+ - /url: https://vercel.slack.com/archives/C0A5RTN0856/p1772036782543189
283
+ ```
284
+
285
+ The URL contains the timestamp in the fragment (`p1772036782543189`). This is a Slack message ID that uniquely identifies the message.
286
+
287
+ ---
288
+
289
+ ## Pattern: Understanding Channel/Thread Structure
290
+
291
+ ```
292
+ - treeitem "channel-name" [ref=e94] [level=2]
293
+ - group: (contains channel metadata or sub-items)
294
+ ```
295
+
296
+ - **level=1**: Section headers (External connections, Starred, Channels, etc.)
297
+ - **level=2**: Individual channels/items within sections
298
+ - **level=3+**: Nested sub-items (rare in sidebar)
299
+
300
+ ---
301
+
302
+ ## Common Ref Patterns (Session-Dependent)
303
+
304
+ These refs vary per session, but follow patterns:
305
+
306
+ | Element | Typical Ref Range | How to Find |
307
+ |---------|------------------|------------|
308
+ | Home tab | e10-e20 | `snapshot -i \| grep "Home"` |
309
+ | DMs tab | e10-e20 | `snapshot -i \| grep "DMs"` |
310
+ | Activity tab | e10-e20 | `snapshot -i \| grep "Activity"` |
311
+ | Search | e5-e10 | `snapshot -i \| grep "Search"` |
312
+ | More unreads | e20-e30 | `snapshot -i \| grep "More unreads"` |
313
+ | Channel refs | e30+ | `snapshot -i \| grep "treeitem"` |
314
+
315
+ **Always take a fresh snapshot** to find current refs for the current session.
316
+
317
+ ---
318
+
319
+ ## Debugging: Element Not Found
320
+
321
+ If you can't find an element:
322
+
323
+ 1. **Check it's visible**
324
+ ```bash
325
+ # Is the element on screen or off-screen?
326
+ agent-browser screenshot current-state.png
327
+ # Compare screenshot to what you expected
328
+ ```
329
+
330
+ 2. **Try expanding/scrolling**
331
+ ```bash
332
+ # Sidebar might need scrolling
333
+ agent-browser scroll down 300 --selector ".p-sidebar"
334
+ agent-browser snapshot -i
335
+ ```
336
+
337
+ 3. **Try snapshot with extended range**
338
+ ```bash
339
+ # Include cursor-interactive elements (divs with onclick handlers)
340
+ agent-browser snapshot -i -C
341
+ ```
342
+
343
+ 4. **Check current URL**
344
+ ```bash
345
+ agent-browser get url
346
+ # Verify you're in the right section
347
+ ```
348
+
349
+ 5. **Wait for page to load**
350
+ ```bash
351
+ agent-browser wait --load networkidle
352
+ agent-browser wait 1000
353
+ agent-browser snapshot -i
354
+ ```
@@ -0,0 +1,163 @@
1
+ # Slack Analysis Report
2
+
3
+ **Date**: [DATE]
4
+ **Workspace**: [WORKSPACE_NAME]
5
+ **Analyst**: [YOUR_NAME]
6
+ **Scope**: [WHAT_YOU_ANALYZED]
7
+
8
+ ## Summary
9
+
10
+ ### Unread Counts
11
+ - **Activity**: [NUMBER] unreads
12
+ - **Direct Messages**: [NUMBER] unreads
13
+ - **Channels**: [NUMBER] channels with unreads
14
+
15
+ ### Key Findings
16
+ - [FINDING 1]
17
+ - [FINDING 2]
18
+ - [FINDING 3]
19
+
20
+ ---
21
+
22
+ ## Unread Channels
23
+
24
+ List of channels with unread messages:
25
+
26
+ | Channel | Unread Count | Last Activity | Notes |
27
+ |---------|-------------|---------------|-------|
28
+ | #engineering | 12 | Today 2:45 PM | Active discussion thread |
29
+ | #announcements | 3 | Yesterday 5:30 PM | Team updates |
30
+ | #random | 5 | Today 11:20 AM | Various topics |
31
+
32
+ ---
33
+
34
+ ## Unread Direct Messages
35
+
36
+ | User/Group | Message Count | Last Message | Preview |
37
+ |------------|--------------|--------------|---------|
38
+ | @alice | 2 | Today 3:15 PM | "Are you free to..." |
39
+ | @product-team | 5 | Today 2:00 PM | Sync scheduled for... |
40
+
41
+ ---
42
+
43
+ ## Channel Snapshot
44
+
45
+ ### Total Channels Accessible
46
+ - **Public Channels**: [NUMBER]
47
+ - **Private Channels**: [NUMBER]
48
+ - **Group DMs**: [NUMBER]
49
+
50
+ ### Channel Categories
51
+ - **External Connections**: [COUNT] channels
52
+ - **Starred**: [COUNT] channels
53
+ - **Main Channels**: [COUNT] channels
54
+
55
+ ---
56
+
57
+ ## Most Active Channels (by recent activity)
58
+
59
+ | Rank | Channel | Activity | Participants |
60
+ |------|---------|----------|--------------|
61
+ | 1 | #engineering | High | 15+ active |
62
+ | 2 | #general | High | 10+ active |
63
+ | 3 | #product-design | Medium | 8+ active |
64
+
65
+ ---
66
+
67
+ ## Key Conversations
68
+
69
+ ### [TOPIC 1]: Channel #engineering
70
+ - **Status**: Ongoing discussion
71
+ - **Participants**: @alice, @bob, @charlie
72
+ - **Latest Update**: [TIME]
73
+ - **Thread Count**: 5 threads
74
+ - **Files Shared**: 2 documents
75
+ - **Screenshots**: See `engineering-thread.png`
76
+
77
+ **Notes**: [Additional context about the conversation]
78
+
79
+ ### [TOPIC 2]: DM with @alice
80
+ - **Unread Messages**: 2
81
+ - **Last Message**: [TIME]
82
+ - **Summary**: [Brief summary of conversation]
83
+ - **Action Items**: [Any TODOs mentioned]
84
+
85
+ ---
86
+
87
+ ## Search Results
88
+
89
+ ### Query: "[SEARCH_TERM]"
90
+ - **Results**: [NUMBER] messages
91
+ - **Date Range**: [FROM] to [TO]
92
+ - **Top Channels**: [LIST]
93
+ - **Key Themes**: [PATTERNS OBSERVED]
94
+
95
+ #### Sample Results
96
+ 1. **[Date/Time]** in #[channel]: [Message snippet]
97
+ 2. **[Date/Time]** in #[channel]: [Message snippet]
98
+ 3. **[Date/Time]** in #[channel]: [Message snippet]
99
+
100
+ ---
101
+
102
+ ## Reactions & Engagement
103
+
104
+ ### Most Reacted-To Messages
105
+ | Message | Emoji | Count | Channel |
106
+ |---------|-------|-------|---------|
107
+ | "Shipped to production" | 🎉 | 8 | #engineering |
108
+ | "FYI the site is down" | 🚨 | 12 | #incidents |
109
+
110
+ ---
111
+
112
+ ## Team Insights
113
+
114
+ ### Most Active Users (by message volume)
115
+ 1. @alice - [COUNT] messages
116
+ 2. @bob - [COUNT] messages
117
+ 3. @charlie - [COUNT] messages
118
+
119
+ ### Most Active Times
120
+ - Peak hour: [TIME]
121
+ - Peak day: [DAY]
122
+ - Average messages per hour: [NUMBER]
123
+
124
+ ---
125
+
126
+ ## Issues / Observations
127
+
128
+ ### [ISSUE 1]: [Title]
129
+ **Severity**: [Critical/High/Medium/Low]
130
+ **Description**: [What was observed]
131
+ **Evidence**: See `issue-1-screenshot.png`
132
+ **Recommendation**: [Suggested action]
133
+
134
+ ---
135
+
136
+ ## Screenshots
137
+
138
+ | File | Description |
139
+ |------|-------------|
140
+ | `activity-tab.png` | Activity tab showing unreads |
141
+ | `dms-overview.png` | DM list with unread indicators |
142
+ | `channels-full-list.png` | Complete channel list |
143
+ | `engineering-thread.png` | Active engineering thread |
144
+
145
+ ---
146
+
147
+ ## Appendix: Raw Data
148
+
149
+ ### Snapshot Output
150
+ ```
151
+ [Paste snapshot -i output here]
152
+ ```
153
+
154
+ ### JSON Snapshot (for parsing)
155
+ ```json
156
+ [Paste snapshot --json output here]
157
+ ```
158
+
159
+ ---
160
+
161
+ **Report Generated**: [DATE/TIME]
162
+ **Analysis Duration**: [TIME]
163
+ **Next Steps**: [TODO]