Read Slack Messages
Fetch and present message history from a channel or DM
1
Check
Connection Profiles for cached channels and contacts. Match the user's target to find the channel ID. For channel names, fuzzy match (e.g. '#eng' matches '#engineering'). For people, match on display or real name. If ambiguous or not found, ask the user to clarify.
3
Present the conversation in a readable format. Lead with recent messages. For long threads, summarize rather than dumping everything. Note any reactions or thread replies that seem important.
To run this task you must have the following required information:
Conversation target (channel name like #engineering, or person name for DM), optional message count (default 30)
If you don't have all of this information, exit here and respond asking for any extra information you require, and instructions to run this task again with ALL required information.
You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple read steps in a row, read them all at once (in parallel).
Add all steps to your todo list now and begin executing.
## Steps
1. Check `./documents/connections/[service-name].md` for cached channels and contacts. Match the user's target to find the channel ID. For channel names, fuzzy match (e.g. '#eng' matches '#engineering'). For people, match on display or real name. If ambiguous or not found, ask the user to clarify.
2. [Gather Arguments: Fetch Slack History] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `channelId`: Channel ID resolved from workspace cache or user input
- `limit` (default: "50"): Message count from requirements, default 30
- `outputPath`: session/slack-history-{channelId}.json
3. [Run Code: Fetch Slack History]: Call `run_script` with:
```json
{
"file": {
"path": https://sk.ills.app/code/slack.workspace.history/preview,
"args": [
"channelId",
"limit",
"outputPath"
]
},
"packages": null
}
```
4. Present the conversation in a readable format. Lead with recent messages. For long threads, summarize rather than dumping everything. Note any reactions or thread replies that seem important.