You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5bdda6b
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: packages/sbot/prompts/tools/channel/list.txt
+12-7Lines changed: 12 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,25 @@
1
1
Discover channels, sessions, and users known to this bot. Reads from the bot's local config / database — no platform API permission required.
2
2
3
-
- type="channel": list all configured channels (id, type, name, caps). channel_id is ignored.
4
-
- type="session": list sessions in channel_id; defaults to all channels.
5
-
- type="user": list users in channel_id; defaults to all channels.
6
-
- type="session_and_user": list both sessions and users (under the same channel_id / name_pattern filter) in a single call. Use when you don't yet know whether to address a session or a user.
3
+
Always returns ALL configured channels nested as <channels><channel>...</channel></channels>. The `type` parameter controls which children are emitted directly under each <channel>:
7
4
8
-
current="1" on a <session>/<user> means the entry lives on the same channel that THIS conversation is happening on — e.g. if the user is talking to you via Lark right now, every Lark session/user gets current="1". When the user mentions a name without specifying which channel and the name exists on multiple channels, prefer the current="1" entry — it's almost always what they meant.
5
+
- type="channel": no children — channel metadata only.
6
+
- type="session": <session> rows under each <channel>.
7
+
- type="user": <user> rows under each <channel>.
8
+
- type="session_and_user": both. Use when you don't yet know whether to address a session or a user.
9
9
10
-
caps (only on <channel>) is a comma-separated capability set. Tokens:
10
+
A <channel> with no matching children is rendered self-closing.
11
+
12
+
current="1" on a <channel> marks the channel that THIS conversation is happening on. When the user mentions a session/user name without specifying which channel and the name exists on multiple channels, prefer the entry under current="1" — it's almost always what they meant.
13
+
14
+
Each <session>/<user> exposes only `id` and `name`. Pass that `id` directly to channel_send_message / channel_send_file — it is globally unique across channels. The owning channel (and its caps) is whichever <channel> the row sits under.
15
+
16
+
caps (on <channel>) is a comma-separated capability set. Tokens:
11
17
text — channel_send_message works on sessions of this channel
12
18
file — channel_send_file works on sessions of this channel
13
19
text_user — direct text to a user is supported on this channel
14
20
file_user — direct file to a user is supported on this channel
15
21
A token NOT listed means the corresponding call will fail; do not attempt it.
16
22
Empty caps usually means the channel is configured but not currently running.
17
-
A <session>/<user> inherits caps from its channel — list type="channel" first when you need to verify capability.
18
23
19
24
Note: sessions/users only include those the bot has actually interacted with (or that an admin has manually registered).
type: z.enum(ChannelListType).describe('What to list. "channel" ignores channel_id; "session_and_user" emits both blocks under the same filter.'),
54
-
channel_id: z.string().optional().describe('Channel scope for type=session/user/session_and_user. Omit to query across all channels.'),
55
-
name_pattern: z.string().optional().describe('JavaScript regex (case-insensitive) matched against the entry name. Omit to list all.'),
33
+
type: z.enum(ChannelListType).describe('What to include under each <channel>: "channel" → no children; "session" → <session> rows; "user" → <user> rows; "session_and_user" → both.'),
0 commit comments