@tloncorp/tlon-skill 0.1.0

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.
package/README.md ADDED
@@ -0,0 +1,74 @@
1
+ # Tlon Skill
2
+
3
+ A CLI tool for interacting with Tlon/Urbit APIs.
4
+
5
+ ## Installation
6
+
7
+ **npm:**
8
+ ```bash
9
+ npm install @tloncorp/tlon-skill
10
+ ```
11
+
12
+ **Direct download (no Node required):**
13
+ ```bash
14
+ # macOS ARM64
15
+ curl -L https://registry.npmjs.org/@tloncorp/tlon-skill-darwin-arm64/-/tlon-skill-darwin-arm64-0.1.0.tgz | tar -xz
16
+ mv package/tlon /usr/local/bin/
17
+
18
+ # macOS x64
19
+ curl -L https://registry.npmjs.org/@tloncorp/tlon-skill-darwin-x64/-/tlon-skill-darwin-x64-0.1.0.tgz | tar -xz
20
+
21
+ # Linux x64
22
+ curl -L https://registry.npmjs.org/@tloncorp/tlon-skill-linux-x64/-/tlon-skill-linux-x64-0.1.0.tgz | tar -xz
23
+ ```
24
+
25
+ ## Configuration
26
+
27
+ ```bash
28
+ export URBIT_URL="https://your-ship.tlon.network"
29
+ export URBIT_SHIP="~your-ship"
30
+ export URBIT_CODE="sampel-ticlyt-migfun-falmel"
31
+ ```
32
+
33
+ ## Usage
34
+
35
+ ```bash
36
+ # List your groups
37
+ tlon channels groups
38
+
39
+ # Get recent mentions
40
+ tlon activity mentions --limit 10
41
+
42
+ # Fetch DM history
43
+ tlon messages dm ~sampel-palnet --limit 20
44
+
45
+ # Update your profile
46
+ tlon contacts update-profile --nickname "My Name"
47
+
48
+ # Create a group
49
+ tlon groups create "My Group" --description "A cool group"
50
+ ```
51
+
52
+ ## Features
53
+
54
+ - **Activity**: Mentions, replies, unreads
55
+ - **Channels**: List DMs, group DMs, subscribed groups
56
+ - **Contacts**: List, get, update profiles
57
+ - **Groups**: Create, join, invite, roles, privacy
58
+ - **Messages**: History, search
59
+ - **DMs**: Send, react, accept/decline
60
+ - **Posts**: React, delete
61
+ - **Notebook**: Post to diary channels
62
+ - **Settings**: Hot-reload plugin config via settings-store
63
+
64
+ ## Documentation
65
+
66
+ See [SKILL.md](SKILL.md) for full command reference.
67
+
68
+ ## For Hosted Deployments
69
+
70
+ If you're running this in a hosted/K8s environment with additional features (workspace files, settings-store, click commands), see [@tloncorp/tlonbot](https://github.com/tloncorp/tlonbot).
71
+
72
+ ## License
73
+
74
+ MIT
package/SKILL.md ADDED
@@ -0,0 +1,197 @@
1
+ ---
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, and group management.
4
+ ---
5
+
6
+ # Tlon Skill
7
+
8
+ Use the `tlon` command for all Tlon operations.
9
+
10
+ ## Installation
11
+
12
+ **npm (Node.js):**
13
+ ```bash
14
+ npm install @tloncorp/tlon-skill
15
+ tlon channels groups
16
+ ```
17
+
18
+ **Direct binary (no Node required):**
19
+ ```bash
20
+ curl -L https://registry.npmjs.org/@tloncorp/tlon-skill-darwin-arm64/-/tlon-skill-darwin-arm64-0.1.0.tgz | tar -xz
21
+ ./package/tlon channels groups
22
+ ```
23
+
24
+ Replace `darwin-arm64` with `darwin-x64` or `linux-x64` as needed.
25
+
26
+ ## Configuration
27
+
28
+ Set environment variables:
29
+ ```bash
30
+ export URBIT_URL="https://your-ship.tlon.network"
31
+ export URBIT_SHIP="~your-ship"
32
+ export URBIT_CODE="sampel-ticlyt-migfun-falmel"
33
+ ```
34
+
35
+ ## Commands
36
+
37
+ ### Activity
38
+
39
+ Check recent notifications and unread counts.
40
+
41
+ ```bash
42
+ tlon activity mentions --limit 10 # Recent mentions (max 25)
43
+ tlon activity replies --limit 10 # Recent replies (max 25)
44
+ tlon activity all --limit 10 # All recent activity (max 25)
45
+ tlon activity unreads # Unread counts per channel
46
+ ```
47
+
48
+ ### Channels
49
+
50
+ List and manage channels.
51
+
52
+ ```bash
53
+ tlon channels dms # List DM contacts
54
+ tlon channels group-dms # List group DMs (clubs)
55
+ tlon channels groups # List subscribed groups
56
+ tlon channels all # List everything
57
+ tlon channels info chat/~host/slug # Get channel details
58
+ tlon channels update chat/~host/slug --title "New Title" # Update metadata
59
+ tlon channels delete chat/~host/slug # Delete a channel
60
+ ```
61
+
62
+ ### Contacts
63
+
64
+ Manage contacts and profiles.
65
+
66
+ ```bash
67
+ tlon contacts list # List all contacts
68
+ tlon contacts self # Get your own profile
69
+ tlon contacts get ~sampel # Get a contact's profile
70
+ tlon contacts sync ~ship1 ~ship2 # Fetch/sync profiles
71
+ tlon contacts add ~sampel # Add a contact
72
+ tlon contacts remove ~sampel # Remove a contact
73
+ tlon contacts update-profile --nickname "My Name" # Update your profile
74
+ ```
75
+
76
+ Options: `--nickname`, `--bio`, `--status`, `--avatar`, `--cover`
77
+
78
+ ### Groups
79
+
80
+ Full group management.
81
+
82
+ ```bash
83
+ # Basics
84
+ tlon groups list # List your groups
85
+ tlon groups info ~host/slug # Get group details
86
+ tlon groups create "Name" [--description "..."] # Create a group
87
+ tlon groups join ~host/slug # Join a group
88
+ tlon groups leave ~host/slug # Leave a group
89
+ tlon groups delete ~host/slug # Delete (host only)
90
+ tlon groups update ~host/slug --title "..." [--description "..."]
91
+
92
+ # Members
93
+ tlon groups invite ~host/slug ~ship1 ~ship2 # Invite members
94
+ tlon groups kick ~host/slug ~ship1 # Kick members
95
+ tlon groups ban ~host/slug ~ship1 # Ban members
96
+ tlon groups unban ~host/slug ~ship1 # Unban members
97
+ tlon groups accept-join ~host/slug ~ship1 # Accept join request
98
+ tlon groups reject-join ~host/slug ~ship1 # Reject join request
99
+ tlon groups set-privacy ~host/slug public|private|secret # Set privacy
100
+
101
+ # Roles
102
+ tlon groups add-role ~host/slug role-id --title "..." # Create a role
103
+ tlon groups delete-role ~host/slug role-id # Delete a role
104
+ tlon groups update-role ~host/slug role-id --title "..." # Update a role
105
+ tlon groups assign-role ~host/slug role-id ~ship1 # Assign role
106
+ tlon groups remove-role ~host/slug role-id ~ship1 # Remove role
107
+
108
+ # Channels
109
+ tlon groups add-channel ~host/slug "Name" [--kind chat|diary|heap]
110
+ ```
111
+
112
+ Group format: `~host-ship/group-slug`
113
+
114
+ ### Messages
115
+
116
+ Read and search message history.
117
+
118
+ ```bash
119
+ tlon messages dm ~sampel --limit 20 # DM history (max 50)
120
+ tlon messages channel chat/~host/slug --limit 20 # Channel history (max 50)
121
+ tlon messages search "query" --channel chat/~host/slug # Search messages
122
+ ```
123
+
124
+ Options: `--limit N`, `--resolve-cites`
125
+
126
+ ### DMs
127
+
128
+ Manage direct messages.
129
+
130
+ ```bash
131
+ # Group DMs (clubs)
132
+ tlon dms send <club-id> "hello" # Send to group DM
133
+ tlon dms reply <club-id> ~author/170.141... "reply" # Reply in group DM
134
+
135
+ # Management
136
+ tlon dms react ~sampel ~author/170.141... "👍" # React to a DM
137
+ tlon dms unreact ~sampel ~author/170.141... # Remove reaction
138
+ tlon dms delete ~sampel ~author/170.141... # Delete a DM
139
+ tlon dms accept ~sampel # Accept DM invite
140
+ tlon dms decline ~sampel # Decline DM invite
141
+ ```
142
+
143
+ ### Posts
144
+
145
+ Manage channel posts.
146
+
147
+ ```bash
148
+ tlon posts react chat/~host/slug 170.141... "👍" # React to a post
149
+ tlon posts unreact chat/~host/slug 170.141... # Remove reaction
150
+ tlon posts delete chat/~host/slug 170.141... # Delete a post
151
+ ```
152
+
153
+ ### Notebook
154
+
155
+ Post to diary/notebook channels.
156
+
157
+ ```bash
158
+ tlon notebook diary/~host/slug "Title" # Post with no body
159
+ tlon notebook diary/~host/slug "Title" --content file.md # Post from file
160
+ tlon notebook diary/~host/slug "Title" --image <url> # Post with image
161
+ ```
162
+
163
+ ### Settings (OpenClaw)
164
+
165
+ Manage OpenClaw's Tlon plugin config via Urbit settings-store. Changes apply immediately without gateway restart.
166
+
167
+ ```bash
168
+ tlon settings get # Show all settings
169
+ tlon settings set <key> <json-value> # Set a value
170
+ tlon settings delete <key> # Delete a setting
171
+
172
+ # DM allowlist
173
+ tlon settings allow-dm ~ship # Add to DM allowlist
174
+ tlon settings remove-dm ~ship # Remove from allowlist
175
+
176
+ # Channel controls
177
+ tlon settings allow-channel chat/~host/slug # Add to watch list
178
+ tlon settings remove-channel chat/~host/slug # Remove from watch list
179
+ tlon settings open-channel chat/~host/slug # Set channel to open
180
+ tlon settings restrict-channel chat/~host/slug [~ship1] # Set restricted
181
+
182
+ # Authorization
183
+ tlon settings authorize-ship ~ship # Add to default auth
184
+ tlon settings deauthorize-ship ~ship # Remove from auth
185
+ ```
186
+
187
+ ## Notes
188
+
189
+ - Ship names should include `~` prefix
190
+ - Post IDs are @ud format with dots (e.g. `170.141.184.507...`)
191
+ - DM post IDs include author prefix (`~ship/170.141...`)
192
+ - Channel nests: `<kind>/~<host>/<name>` (chat, diary, or heap)
193
+
194
+ ## Limits
195
+
196
+ - Activity: max 25 items
197
+ - Messages: max 50 items
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawnSync } from "node:child_process";
4
+ import { existsSync } from "node:fs";
5
+ import { createRequire } from "node:module";
6
+ import { dirname, join } from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+
9
+ const __dirname = dirname(fileURLToPath(import.meta.url));
10
+ const require = createRequire(import.meta.url);
11
+
12
+ // Map of platform+arch to package name
13
+ const PLATFORMS = {
14
+ "darwin-arm64": "@tloncorp/tlon-skill-darwin-arm64",
15
+ "darwin-x64": "@tloncorp/tlon-skill-darwin-x64",
16
+ "linux-x64": "@tloncorp/tlon-skill-linux-x64",
17
+ };
18
+
19
+ function getBinaryPath() {
20
+ const platform = process.platform;
21
+ const arch = process.arch;
22
+ const key = `${platform}-${arch}`;
23
+
24
+ // Check for local binary (dev mode)
25
+ const localBinary = join(__dirname, "tlon");
26
+ if (existsSync(localBinary)) {
27
+ return localBinary;
28
+ }
29
+
30
+ const packageName = PLATFORMS[key];
31
+ if (!packageName) {
32
+ console.error(`Unsupported platform: ${platform}-${arch}`);
33
+ console.error(`Supported platforms: ${Object.keys(PLATFORMS).join(", ")}`);
34
+ process.exit(1);
35
+ }
36
+
37
+ try {
38
+ // Try to resolve the platform-specific package
39
+ const packagePath = require.resolve(`${packageName}/package.json`);
40
+ const binaryPath = join(dirname(packagePath), "tlon-run");
41
+
42
+ if (!existsSync(binaryPath)) {
43
+ throw new Error(`Binary not found at ${binaryPath}`);
44
+ }
45
+
46
+ return binaryPath;
47
+ } catch (err) {
48
+ console.error(`Failed to find binary for ${platform}-${arch}`);
49
+ console.error(`Package ${packageName} may not be installed.`);
50
+ console.error(`Try: npm install ${packageName}`);
51
+ process.exit(1);
52
+ }
53
+ }
54
+
55
+ const binaryPath = getBinaryPath();
56
+ const args = process.argv.slice(2);
57
+
58
+ const result = spawnSync(binaryPath, args, {
59
+ stdio: "inherit",
60
+ env: process.env,
61
+ });
62
+
63
+ if (result.error) {
64
+ console.error(`Failed to run binary: ${result.error.message}`);
65
+ process.exit(1);
66
+ }
67
+
68
+ process.exit(result.status ?? 1);
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@tloncorp/tlon-skill",
3
+ "version": "0.1.0",
4
+ "description": "Tlon/Urbit skill for OpenClaw agents",
5
+ "type": "module",
6
+ "bin": {
7
+ "tlon-run": "./bin/tlon-run.js"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "SKILL.md"
12
+ ],
13
+ "scripts": {
14
+ "build": "bun build scripts/main.ts --compile --outfile dist/tlon-run",
15
+ "build:all": "node scripts/build-all.js",
16
+ "dev:link": "bun run build:all && cp \"npm/$(node -e 'console.log(process.platform + \"-\" + process.arch)')/tlon\" bin/",
17
+ "test": "bun test"
18
+ },
19
+ "optionalDependencies": {
20
+ "@tloncorp/tlon-skill-darwin-arm64": "0.1.0",
21
+ "@tloncorp/tlon-skill-darwin-x64": "0.1.0",
22
+ "@tloncorp/tlon-skill-linux-x64": "0.1.0"
23
+ },
24
+ "dependencies": {
25
+ "@tloncorp/api": "git+https://github.com/tloncorp/api-beta.git#main",
26
+ "@urbit/aura": "^3.0.0"
27
+ },
28
+ "devDependencies": {
29
+ "@types/node": "^22.0.0",
30
+ "typescript": "^5.9.3"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/tloncorp/tlon-skill.git"
35
+ },
36
+ "license": "MIT"
37
+ }