@tloncorp/tlon-skill 0.2.2 → 0.3.1

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 (2) hide show
  1. package/SKILL.md +55 -14
  2. package/package.json +5 -5
package/SKILL.md CHANGED
@@ -1,21 +1,27 @@
1
1
  ---
2
2
  name: tlon
3
- description: Interact with Tlon/Urbit API. Use for contacts (get/update profiles), listing channels/groups, fetching message history, posting to channels, sending DMs, group management, and exposing content to the clearweb.
3
+ description: Interact with Tlon/Urbit API. Use for reading activity, message history, contacts, channels, and groups. Also for group/channel administration, profile management, and exposing content to the clearweb.
4
4
  ---
5
5
 
6
6
  # Tlon Skill
7
7
 
8
- Use the `tlon` command for all Tlon operations.
8
+ Use the `tlon` command for reading data, managing channels/groups/contacts, and administration.
9
+
10
+ ## OpenClaw
11
+
12
+ When running as an OpenClaw skill, use the built-in `message` tool for sending outbound messages (DMs and channel posts). The `tlon` command is for reading data, administration, and management — not for sending messages. The `message` tool routes through the proper delivery infrastructure (threading, bot profile, rate limiting).
9
13
 
10
14
  ## Installation
11
15
 
12
16
  **npm (Node.js):**
17
+
13
18
  ```bash
14
19
  npm install @tloncorp/tlon-skill
15
20
  tlon channels groups
16
21
  ```
17
22
 
18
23
  **Direct binary (no Node required):**
24
+
19
25
  ```bash
20
26
  curl -L https://registry.npmjs.org/@tloncorp/tlon-skill-darwin-arm64/-/tlon-skill-darwin-arm64-0.1.0.tgz | tar -xz
21
27
  ./package/tlon channels groups
@@ -23,10 +29,10 @@ curl -L https://registry.npmjs.org/@tloncorp/tlon-skill-darwin-arm64/-/tlon-skil
23
29
 
24
30
  Replace `darwin-arm64` with `darwin-x64` or `linux-x64` as needed.
25
31
 
26
-
27
32
  ## Configuration
28
33
 
29
34
  **CLI Flags (highest priority):**
35
+
30
36
  ```bash
31
37
  # Cookie-based auth (fastest - ship parsed from cookie name)
32
38
  tlon --url https://your-ship.tlon.network --cookie "urbauth-~your-ship=0v..." <command>
@@ -39,6 +45,7 @@ tlon --config ~/ships/my-ship.json <command>
39
45
  ```
40
46
 
41
47
  Config file format:
48
+
42
49
  ```json
43
50
  // Cookie-based (ship derived from cookie)
44
51
  {"url": "...", "cookie": "urbauth-~ship=..."}
@@ -48,6 +55,7 @@ Config file format:
48
55
  ```
49
56
 
50
57
  **Environment Variables:**
58
+
51
59
  ```bash
52
60
  # Cookie-based (ship derived from cookie)
53
61
  export URBIT_URL="https://your-ship.tlon.network"
@@ -64,6 +72,7 @@ export URBIT_CODE="sampel-ticlyt-migfun-falmel"
64
72
  **Resolution order:** CLI flags → `TLON_CONFIG_FILE` → `URL + COOKIE` → `URL + SHIP + CODE` → `--ship` with cache → OpenClaw config → cached ships (auto-select if only one)
65
73
 
66
74
  **Cookie vs Code:**
75
+
67
76
  - **Cookie-based:** Uses pre-authenticated session cookie. Ship is parsed from the cookie name (`urbauth-~ship=...`). Fastest option.
68
77
  - **Code-based:** Performs login to get session cookie. Requires URL + ship + code.
69
78
 
@@ -74,6 +83,7 @@ You can provide both cookie and code — cookie is used first, code serves as fa
74
83
  The skill automatically caches auth cookies to `~/.tlon/cache/<ship>.json` after successful authentication. This makes subsequent invocations much faster by skipping the login request.
75
84
 
76
85
  **How it works:**
86
+
77
87
  ```bash
78
88
  # First time - authenticates and caches
79
89
  $ tlon --url https://zod.tlon.network --ship ~zod --code abcd-efgh contacts self
@@ -90,6 +100,7 @@ $ tlon --ship ~bus contacts self
90
100
  ```
91
101
 
92
102
  **Cache behavior:**
103
+
93
104
  - Cached cookies are URL-specific (won't use a cookie for the wrong host)
94
105
  - If only one ship is cached, it's auto-selected (no flags needed)
95
106
  - If multiple ships are cached, you'll be prompted to specify with `--ship`
@@ -97,8 +108,6 @@ $ tlon --ship ~bus contacts self
97
108
 
98
109
  **Clear cache:** `rm ~/.tlon/cache/*.json`
99
110
 
100
-
101
-
102
111
  ## Multi-Ship Usage
103
112
 
104
113
  If you have credentials for multiple ships, you can use this skill to operate on behalf of any of them. This is useful for:
@@ -138,7 +147,6 @@ List and manage channels. DMs and group DMs show nicknames when available.
138
147
 
139
148
  ```bash
140
149
  tlon channels dms # List DM contacts (with nicknames)
141
- tlon channels group-dms # List group DMs (clubs, with nicknames)
142
150
  tlon channels groups # List subscribed groups
143
151
  tlon channels all # List everything
144
152
  tlon channels info chat/~host/slug # Get channel details
@@ -155,6 +163,7 @@ tlon channels del-readers ~host/group chat/~host/slug admin # Open viewing
155
163
  ```
156
164
 
157
165
  Notes on permissions:
166
+
158
167
  - Empty writers list = anyone in the group can post (default for chat)
159
168
  - Empty readers list = anyone in the group can view (default)
160
169
  - Diaries default to admin-only writers
@@ -206,6 +215,19 @@ tlon groups update-role ~host/slug role-id --title "..." # Update a role
206
215
  tlon groups assign-role ~host/slug role-id ~ship1 # Assign role
207
216
  tlon groups remove-role ~host/slug role-id ~ship1 # Remove role
208
217
 
218
+ # Admin
219
+ tlon groups promote ~host/slug ~ship1 [~ship2 ...] # Promote member(s) to admin
220
+ tlon groups demote ~host/slug ~ship1 [~ship2 ...] # Demote member(s) from admin
221
+
222
+ Roles vs Admin:
223
+ - Regular roles are for organizing members and controlling channel read/write permissions.
224
+ - Admin is a special privilege on top of a role. Admins can manage group settings,
225
+ channels, members, and roles.
226
+ - `promote` creates an "admin" role (if one doesn't exist), grants it admin privileges,
227
+ and assigns it to the specified members. `demote` removes that role from them.
228
+ - To grant admin to members who already share a role, use `set-admin` on that role
229
+ via the backend directly (not yet exposed in the Tlon app UI).
230
+
209
231
  # Channels
210
232
  tlon groups add-channel ~host/slug "Name" [--kind chat|diary|heap]
211
233
  ```
@@ -239,18 +261,21 @@ tlon hooks rest 0v1a # Stop cron job
239
261
  ```
240
262
 
241
263
  Notes:
264
+
242
265
  - Hook IDs are @uv format (e.g., `0v1a.2b3c4...`)
243
266
  - Schedules use @dr format: `~h1` (1 hour), `~m30` (30 minutes), `~d1` (1 day)
244
267
  - Hooks run in order when triggered; use `order` to set priority
245
268
  - Use `config` to pass channel-specific settings to a hook instance
246
269
 
247
270
  **Writing Hooks:** See `references/hooks.md` for full documentation on writing hooks, including:
271
+
248
272
  - Event types (`on-post`, `on-reply`, `cron`, `wake`)
249
273
  - Bowl context (channel, group, config access)
250
274
  - Effects (channel actions, group actions, scheduled wakes)
251
275
  - Config handling with clam (`;;`)
252
276
 
253
277
  **Examples:** See `references/hooks-examples/` for starter templates:
278
+
254
279
  - `auto-react.hoon` — React to new posts with emoji
255
280
  - `delete-old-posts.hoon` — Cron job to clean up old messages
256
281
  - `word-filter.hoon` — Block posts containing banned words
@@ -263,19 +288,26 @@ Read and search message history. Authors are shown with nicknames when available
263
288
  tlon messages dm ~sampel --limit 20 # DM history (max 50)
264
289
  tlon messages channel chat/~host/slug --limit 20 # Channel history (max 50)
265
290
  tlon messages search "query" --channel chat/~host/slug # Search messages
291
+ tlon messages context chat/~host/slug 170.141... --limit 5 # Messages around a post
292
+ tlon messages post chat/~host/slug 170.141... # Fetch single post with replies
266
293
  ```
267
294
 
268
295
  Options: `--limit N`, `--resolve-cites`
269
296
 
297
+ The `context` command fetches N messages before and after a given post ID — useful for
298
+ finding surrounding conversation when you have a post from search or activity.
299
+ For DMs, use the ship name as the channel: `tlon messages context ~sampel 170.141...`
300
+
301
+ The `post` command fetches a single post with its replies/thread. For DM posts,
302
+ pass `--author ~ship` (required for DM lookups).
303
+
304
+ **Tip:** Use `search` to find a message, then `context` with its ID to see the surrounding conversation.
305
+
270
306
  ### DMs
271
307
 
272
- Manage direct messages.
308
+ Manage direct messages — reactions, invites, and deletions.
273
309
 
274
310
  ```bash
275
- # Group DMs (clubs)
276
- tlon dms send <club-id> "hello" # Send to group DM
277
- tlon dms reply <club-id> ~author/170.141... "reply" # Reply in group DM
278
-
279
311
  # Management
280
312
  tlon dms react ~sampel ~author/170.141... "👍" # React to a DM
281
313
  tlon dms unreact ~sampel ~author/170.141... # Remove reaction
@@ -297,6 +329,7 @@ tlon expose url diary/~host/blog/170.141... # Get the public URL
297
329
  ```
298
330
 
299
331
  Cite path formats:
332
+
300
333
  - Simplified: `chat/~host/channel/170.141...` (auto-expands)
301
334
  - Full: `/1/chan/chat/~host/channel/msg/170.141...`
302
335
 
@@ -330,13 +363,21 @@ The `--content` file should be Story JSON format (array of verses with headers,
330
363
 
331
364
  ### Upload
332
365
 
333
- Upload images to Tlon storage.
366
+ Upload files to Tlon storage from a URL, local path, or stdin.
334
367
 
335
368
  ```bash
336
- tlon upload https://example.com/image.png # Upload image from URL
369
+ tlon upload https://example.com/image.png # Upload from URL
370
+ tlon upload ./photo.jpg # Upload local file
371
+ tlon upload ~/Pictures/screenshot.png # Upload with absolute path
372
+ tlon upload ./mystery-file -t image/webp # Override content type
373
+ cat image.png | tlon upload --stdin -t image/png # Upload from stdin
337
374
  ```
338
375
 
339
- Returns the uploaded image URL for use in posts, profiles, etc.
376
+ Options: `-t`/`--type` (override MIME type), `--stdin` (read from stdin)
377
+
378
+ Content type is auto-detected from file extension for local files. For stdin, `-t` is recommended (defaults to `application/octet-stream`).
379
+
380
+ Returns the uploaded URL for use in posts, profiles, etc.
340
381
 
341
382
  ### Settings (OpenClaw)
342
383
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tloncorp/tlon-skill",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "description": "Tlon/Urbit skill for OpenClaw agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -21,10 +21,10 @@
21
21
  "postinstall": "node scripts/postinstall.js"
22
22
  },
23
23
  "optionalDependencies": {
24
- "@tloncorp/tlon-skill-darwin-arm64": "0.2.2",
25
- "@tloncorp/tlon-skill-darwin-x64": "0.2.2",
26
- "@tloncorp/tlon-skill-linux-x64": "0.2.2",
27
- "@tloncorp/tlon-skill-linux-arm64": "0.2.2"
24
+ "@tloncorp/tlon-skill-darwin-arm64": "0.3.1",
25
+ "@tloncorp/tlon-skill-darwin-x64": "0.3.1",
26
+ "@tloncorp/tlon-skill-linux-x64": "0.3.1",
27
+ "@tloncorp/tlon-skill-linux-arm64": "0.3.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@tloncorp/api": "git+https://github.com/tloncorp/api-beta.git#c5eb1720d94435b62503605acb294ef42a5440b3",