ticlawk 0.1.15-dev.6 → 0.1.16-dev.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.
package/README.md CHANGED
@@ -2,125 +2,45 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/ticlawk)](https://www.npmjs.com/package/ticlawk)
4
4
 
5
- **Connect any agent harness to any mobile client.**
5
+ **The local connector that lets the Ticlawk mobile app drive your agent harnesses.**
6
6
 
7
- *M agent harnesses × N mobile clients used to be M×N integrations. ticlawk makes it M+N.*
8
-
9
- You run the harness locally Claude Code, Codex, OpenClaw, whatever you're
10
- testing this week. `ticlawk` is the layer that lets any of them talk
11
- through any mobile/web client you like to use (Telegram,
12
- [ticlawk](https://ticlawk.com), more to come).
13
-
14
- <p align="center">
15
- <img src="assets/ticlawk-concept.svg" alt="ticlawk connects any client to any agent" width="860">
16
- </p>
17
-
18
- Left side: any agent harness that runs on your machine.
19
- Middle: `ticlawk`.
20
- Right side: any mobile or web app you like to use to manage your agent.
7
+ You run the agent harness on your machine Claude Code, Codex, OpenClaw,
8
+ opencode, or pi. `ticlawk` is the daemon that connects those local harnesses
9
+ to the [Ticlawk mobile app](https://ticlawk.com) so you can chat with them
10
+ from your phone.
21
11
 
22
12
  ---
23
13
 
24
- ## Quickstart — Telegram in 5 minutes
14
+ ## Quickstart — 2 minutes
25
15
 
26
- This is the fastest way to see it work. You need a Telegram bot token from
27
- [@BotFather](https://t.me/BotFather) and a project directory on this machine
28
- where Claude Code can run.
16
+ You need a project directory on this machine where Claude Code (or another
17
+ supported runtime) can run, and the Ticlawk app installed on your phone.
29
18
 
30
19
  ```bash
31
20
  # 1. install
32
21
  curl -fsSL https://raw.githubusercontent.com/darthjaja6/ticlawk/main/install.sh | bash
33
22
 
34
- # 2. choose Telegram as the active adapter
35
- ticlawk config set adapter telegram
36
-
37
- # 3. store Telegram auth locally
38
- ticlawk auth telegram --bot-token <your-bot-token>
39
-
40
- # 4. restart the daemon so it starts polling the bot
41
- # Linux
42
- systemctl --user restart ticlawk
43
-
44
- # macOS
45
- launchctl kickstart -k gui/$(id -u)/ticlawk
46
-
47
- # 5. connect that bot to a Claude Code project
48
- ticlawk connect --adapter telegram --workdir /path/to/project
49
-
50
- # optional: if you want to resume an existing Claude Code session instead,
51
- # add --session-id <claude-session-id>
52
-
53
- # 6. say hi to your bot on Telegram — the first DM becomes the bot's only chat
54
- ```
55
-
56
- `--workdir` is the important part. `ticlawk` binds the adapter to a local
57
- project directory and runtime. `--session-id` is optional: use it only when you
58
- want to resume an existing Claude Code or Codex conversation instead of letting
59
- the next message create a fresh session automatically.
60
-
61
- **Finding `<claude-session-id>`** — if you want to resume, use the filename
62
- (without `.jsonl`) of the transcript under `~/.claude/projects/**/`. Pick the
63
- one whose working directory matches the project you want the bot to work on.
64
-
65
- If `hello` in Telegram comes back as a reply from that Claude Code session,
66
- you're done. Everything below is for when you want ticlawk, Codex, OpenClaw,
67
- or more control.
68
-
69
- > ⚠️ **Single user, by design.** The Telegram bot binds to the **first** private
70
- > DM that messages it, and refuses everyone else. This is not a bug — it's the
71
- > security boundary. The bot can run shell commands and edit files in your
72
- > project; locking it to one chat keeps that capability where you intended.
73
- > Don't add the bot to groups, and don't share its token.
74
-
75
- ---
76
-
77
- ## Using ticlawk instead of Telegram
78
-
79
- If you want the [ticlawk mobile app](https://ticlawk.com) instead, connect from
80
- the project directory and scan the QR code with ticlawk. `ticlawk` will
81
- detect local runtimes in that directory, and ticlawk will ask you which one to
82
- connect:
83
-
84
- ```bash
23
+ # 2. connect this machine to your Ticlawk account by scanning the QR code
85
24
  cd /path/to/project
86
25
  ticlawk connect
87
26
  ```
88
27
 
89
- Full walkthrough: [docs/clients/ticlawk.md](docs/clients/ticlawk.md).
90
- Telegram details: [docs/clients/telegram.md](docs/clients/telegram.md).
28
+ `ticlawk connect` auto-detects every supported runtime in that project
29
+ directory (Codex, Claude Code, opencode, pi) and lets you pick one inside the
30
+ app once pairing completes. Run `ticlawk connect` again from a different
31
+ directory when you want to bind a new project.
91
32
 
92
- ---
93
-
94
- ## Using Codex, OpenClaw, or opencode instead of Claude Code
95
-
96
- Keep the same two-step adapter flow:
97
-
98
- 1. `ticlawk auth <adapter> ...`
99
- 2. `ticlawk connect --adapter <adapter> ...`
100
-
101
- Then swap the runtime locator with `--type`:
102
-
103
- ```bash
104
- # Telegram + Codex
105
- ticlawk connect --adapter telegram --type codex --workdir /path/to/project
106
-
107
- # ticlawk + Codex, when you want to bypass mobile runtime selection
108
- ticlawk connect --adapter ticlawk --type codex --workdir /path/to/project
109
-
110
- # Telegram + OpenClaw
111
- ticlawk connect --adapter telegram --type openclaw --agent-id main
112
-
113
- # ticlawk + OpenClaw
114
- ticlawk connect --adapter ticlawk --type openclaw --agent-id main
33
+ > ⚠️ **Single user, by design.** The connector binds to your Ticlawk account;
34
+ > agents run with your local user's permissions and can edit files / run
35
+ > commands inside the bound `--workdir`. Don't share your connector API key
36
+ > and don't connect a workdir you wouldn't trust a shell to touch.
115
37
 
116
- # Telegram + opencode
117
- ticlawk connect --adapter telegram --type opencode --workdir /path/to/project
38
+ ---
118
39
 
119
- # ticlawk + opencode, when you want to bypass mobile runtime selection
120
- ticlawk connect --adapter ticlawk --type opencode --workdir /path/to/project
121
- ```
40
+ ## Resuming an existing runtime session
122
41
 
123
- Runtime locators at a glance:
42
+ By default each new chat creates a fresh runtime session. To resume an
43
+ existing Claude Code or Codex transcript, point at it explicitly:
124
44
 
125
45
  | Runtime | Required | Optional resume handle | Where to find it |
126
46
  |-------------|----------------|------------------------|---------------------------------------------------------------|
@@ -132,9 +52,6 @@ Runtime locators at a glance:
132
52
  [OpenClaw](https://github.com/openclaw/openclaw) is an open-source local-first
133
53
  agent runtime; skip this row if you don't use it.
134
54
 
135
- OpenClaw has built-in channels; use `ticlawk` only if you want a single
136
- chat surface across Claude Code, Codex, OpenClaw, and opencode.
137
-
138
55
  [opencode](https://opencode.ai) is provider-agnostic — it doesn't carry its own
139
56
  account system. Before connecting through `ticlawk`, install the CLI
140
57
  (`npm i -g opencode-ai`) and authenticate it once against the LLM provider
@@ -143,50 +60,25 @@ Google / OpenRouter / etc. and paste the corresponding API key). Model
143
60
  selection lives in opencode's own config (`opencode.json` in the project
144
61
  root, or user-level config) — `ticlawk` does not pass `--model`.
145
62
 
146
- `ticlawk` spawns opencode with `--dangerously-skip-permissions`
147
- (matching how Codex is wired), so chat messages can drive shell commands and
148
- file edits in the bound `--workdir` without further confirmation prompts.
149
- This is the same security boundary documented above; only connect a workdir
150
- you trust to a chat you control.
151
-
152
- ---
153
-
154
- ## `auth` vs `connect`
155
-
156
- You only need to know this once:
157
-
158
- - **`auth`** — store adapter-specific setup input locally.
159
- Telegram takes `--bot-token`. ticlawk uses QR pairing from `connect`.
160
- - **`connect`** — connect the selected adapter to a local runtime.
161
- For ticlawk, `ticlawk connect` auto-detects local runtimes and
162
- lets you pick in the mobile app. Use `--workdir` for Telegram or explicit
163
- ticlawk runtime selection, optionally add `--session-id` to resume, or use
164
- `--agent-id` for OpenClaw.
165
-
166
- `auth` is adapter-specific by subcommand shape:
167
- - `ticlawk auth telegram --bot-token ...`
168
-
169
- That keeps adapter auth flags scoped to the adapter without making users learn
170
- the `--` passthrough convention.
63
+ `ticlawk` spawns opencode and codex with `--dangerously-skip-permissions`-style
64
+ flags so chat messages can drive shell commands and file edits in the bound
65
+ workdir without further confirmation prompts. Only connect a workdir you
66
+ trust to a chat you control.
171
67
 
172
68
  ---
173
69
 
174
70
  ## Daily use
175
71
 
176
- After setup, the usual workflow is simple:
72
+ After setup:
177
73
 
178
74
  - Keep `ticlawk` running as a user service. If Linux prints an
179
75
  `Action required` message during install or connect, run the command it
180
76
  shows so the daemon keeps running after logout and reboot.
181
- - Keep using the same Telegram chat or ticlawk channel. The adapter auth and
182
- channel binding stay on disk until you change them.
183
- - If you want to have the work done just like tiktoking, run
184
- `ticlawk connect ...` again with the new `--workdir`.
185
- - If you want to resume an existing Claude Code or Codex conversation, add
186
- `--session-id`; otherwise the next message creates a fresh session.
187
- - If an OpenClaw agent changes, reconnect with the new `--agent-id`.
188
- - If replies stop because the local runtime session ended, run `connect` again
189
- or reset the session from the client UI.
77
+ - Bind to a new project: run `ticlawk connect` from the new directory.
78
+ - Resume an existing transcript: add `--session-id` (Claude Code / Codex /
79
+ opencode) or `--agent-id` (OpenClaw) to the `connect` call.
80
+ - If replies stop because the local runtime session ended, run `connect`
81
+ again or reset the session from the app.
190
82
  - `ticlawk health` is the first thing to check when something feels off.
191
83
 
192
84
  ---
@@ -197,16 +89,12 @@ After setup, the usual workflow is simple:
197
89
  ticlawk health
198
90
  ```
199
91
 
200
- - `ok: true` and the adapter-specific fields populated → you're good.
92
+ - `ok: true` and `apiKey: true` → you're good.
201
93
  - Can't reach `127.0.0.1:8741` → the daemon isn't running. Start it with
202
94
  `systemctl --user restart ticlawk`,
203
95
  `launchctl kickstart -k gui/$(id -u)/ticlawk`, or `ticlawk start`.
204
- - Telegram shows `runtimeConnected: true` and `connectedChat: false`
205
- send the first DM to the bot to claim its only chat.
206
- - Telegram shows `botConfigured: false` → rerun
207
- `ticlawk auth telegram --bot-token ...`, then restart the daemon.
208
- - ticlawk shows `apiKey: false` → rerun `ticlawk connect`
209
- from the project directory and scan the QR code.
96
+ - `apiKey: false` rerun `ticlawk connect` from the project directory and
97
+ scan the QR code with the Ticlawk app.
210
98
 
211
99
  Logs:
212
100
 
@@ -253,9 +141,8 @@ ticlawk connect
253
141
  systemd linger is off, it prints the same `Action required` message shown by
254
142
  the installer.
255
143
 
256
- Update with `ticlawk update`. To remove the service and managed
257
- install files while keeping `~/.ticlawk` config, bindings, profiles, and
258
- logs:
144
+ Update with `ticlawk update`. To remove the service and managed install
145
+ files while keeping `~/.ticlawk` config, bindings, profiles, and logs:
259
146
 
260
147
  ```bash
261
148
  ticlawk uninstall
@@ -268,22 +155,19 @@ That removes:
268
155
  - `~/.config/systemd/user/ticlawk.service` (Linux)
269
156
  - `~/Library/LaunchAgents/ticlawk.plist` (macOS)
270
157
 
271
- `~/.ticlawk` is preserved. Use `npm uninstall -g ticlawk` to remove
272
- the npm package itself.
158
+ `~/.ticlawk` is preserved. Use `npm uninstall -g ticlawk` to remove the npm
159
+ package itself.
273
160
 
274
161
  ---
275
162
 
276
163
  ## Config
277
164
 
278
- Config lives in `~/.ticlawk/.config`. Most people only need to set
279
- `adapter`, then use `auth` for adapter-specific setup. The dotted
280
- credential keys below still exist for manual or advanced setups.
165
+ Config lives in `~/.ticlawk/.config`. Most users never edit it directly —
166
+ `ticlawk connect` writes the connector API key for you. The keys below exist
167
+ for advanced/manual setups.
281
168
 
282
169
  ```bash
283
170
  ticlawk config # show current config
284
- ticlawk config set adapter telegram # or: ticlawk
285
- ticlawk auth telegram --bot-token <t>
286
- ticlawk config set telegram.bot-token <t> # advanced/manual override
287
171
  ticlawk config set ticlawk.connector-api-key <k> # advanced/manual override
288
172
  ticlawk config set ticlawk.connector-ws-url <url> # advanced/manual override
289
173
  ticlawk config set streaming off # disable streaming output globally
@@ -293,13 +177,11 @@ ticlawk config set streaming.codex default # clear the codex override; inherit
293
177
 
294
178
  Key mapping (for anyone editing the file directly):
295
179
 
296
- | Config key | Env var |
297
- |-----------------------|----------------------|
298
- | `adapter` | `AF_ADAPTER` |
299
- | `telegram.bot-token` | `TELEGRAM_BOT_TOKEN` |
300
- | `ticlawk.connector-api-key` | `TICLAWK_CONNECTOR_API_KEY` |
301
- | `ticlawk.api-url` | `TICLAWK_API_URL` |
302
- | `ticlawk.connector-ws-url` | `TICLAWK_CONNECTOR_WS_URL` |
180
+ | Config key | Env var |
181
+ |-----------------------------|-------------------------------|
182
+ | `ticlawk.connector-api-key` | `TICLAWK_CONNECTOR_API_KEY` |
183
+ | `ticlawk.api-url` | `TICLAWK_API_URL` |
184
+ | `ticlawk.connector-ws-url` | `TICLAWK_CONNECTOR_WS_URL` |
303
185
 
304
186
  Streaming defaults to on. Full CLI reference: `ticlawk help`.
305
187
 
@@ -317,9 +199,9 @@ Usage:
317
199
  ticlawk start
318
200
  ticlawk health
319
201
  ticlawk config
320
- ticlawk config get <adapter|streaming...|runtimes.claude_code.path|runtimes.codex.path|runtimes.opencode.path|runtimes.pi.path|telegram.bot-token|ticlawk.connector-api-key|ticlawk.api-url|ticlawk.connector-ws-url>
321
- ticlawk config set <adapter|streaming...|runtimes.claude_code.path|runtimes.codex.path|runtimes.opencode.path|runtimes.pi.path|telegram.bot-token|ticlawk.connector-api-key|ticlawk.api-url|ticlawk.connector-ws-url> <value>
322
- ticlawk auth <adapter> [adapter-auth-args...]
202
+ ticlawk config get <streaming...|runtimes.claude_code.path|runtimes.codex.path|runtimes.opencode.path|runtimes.pi.path|ticlawk.connector-api-key|ticlawk.api-url|ticlawk.connector-ws-url>
203
+ ticlawk config set <streaming...|runtimes.claude_code.path|runtimes.codex.path|runtimes.opencode.path|runtimes.pi.path|ticlawk.connector-api-key|ticlawk.api-url|ticlawk.connector-ws-url> <value>
204
+ ticlawk auth --code <6-digit-code> [--api-url <url>]
323
205
  ticlawk connect
324
206
  ticlawk profile list
325
207
  ticlawk profile current
@@ -330,31 +212,27 @@ Usage:
330
212
  ticlawk version
331
213
 
332
214
  Commands:
333
- auth store adapter-specific auth/setup input locally
334
- connect connect the selected adapter to a local runtime
215
+ auth store the ticlawk app pairing code locally
216
+ connect connect ticlawk to a local runtime
335
217
  profile list or switch saved local identities
336
218
  install-daemon install or refresh the background daemon
337
219
  update update the npm package and refresh the daemon
338
220
  uninstall remove service and managed install files, preserving ~/.ticlawk
339
221
 
340
222
  Config examples:
341
- ticlawk config get adapter
342
- ticlawk config set adapter telegram
343
- ticlawk config set adapter ticlawk
344
223
  ticlawk config set streaming off # turn streaming off for all runtimes
345
224
  ticlawk config set streaming.codex default # clear the codex-specific override and inherit the global streaming setting
346
225
  ticlawk config set runtimes.claude_code.path /path/to/claude_code # advanced/manual
347
226
  ticlawk config set runtimes.codex.path /path/to/codex # advanced/manual
348
227
  ticlawk config set runtimes.opencode.path /path/to/opencode # advanced/manual
349
228
  ticlawk config set runtimes.pi.path /path/to/pi # advanced/manual
350
- ticlawk config set telegram.bot-token <bot-token> # advanced/manual
351
229
  ticlawk config set ticlawk.connector-api-key <key> # advanced/manual
352
230
  ticlawk config set ticlawk.api-url <api-url> # advanced/manual
353
231
  ticlawk config set ticlawk.connector-ws-url <url> # advanced/manual
354
232
 
355
233
  Examples:
356
234
  ticlawk connect
357
- ticlawk auth telegram --bot-token <bot-token>
235
+ ticlawk auth --code <6-digit-code>
358
236
  ```
359
237
  <!-- usage:end -->
360
238
 
@@ -362,51 +240,44 @@ Examples:
362
240
 
363
241
  ## Security model
364
242
 
365
- This is the part to read before you set anything up.
366
-
367
- - **The bot can run code on your machine.** Whatever Claude Code / Codex /
368
- OpenClaw can do in the bound `--workdir`, the chat client can ask it to do.
369
- Treat the chat as you'd treat a shell.
370
- - **Single chat, single user.** The Telegram adapter binds to the first private
371
- DM and rejects all others. The ticlawk adapter binds to one channel per
372
- connect. Don't share bot tokens or connector credentials.
373
- - **Secrets stay local.** Bot tokens, ticlawk API keys, and binding metadata
374
- live in `~/.ticlawk/.config` (mode `0600`) and never leave your
375
- machine. The daemon listens on `127.0.0.1:8741` only — it does not bind to
376
- any external interface.
377
- - **Token leak = remote shell.** If your Telegram bot token leaks, anyone with
378
- it can take over the bot and start a chat as the first DM. Rotate via
379
- [@BotFather](https://t.me/BotFather) immediately. Same applies to a leaked
380
- ticlawk connector API key — revoke it from the ticlawk app.
243
+ - **Agents can run code on your machine.** Whatever Claude Code / Codex /
244
+ OpenClaw / opencode / pi can do in the bound workdir, the Ticlawk app can
245
+ ask it to do. Treat the chat as you'd treat a shell.
246
+ - **Single user.** The connector binds to one Ticlawk account. Don't share
247
+ your connector API key.
248
+ - **Secrets stay local.** Connector API keys and binding metadata live in
249
+ `~/.ticlawk/.config` (mode `0600`) and never leave your machine. The
250
+ daemon listens on `127.0.0.1:8741` only it does not bind to any external
251
+ interface.
252
+ - **Token leak = remote shell.** If your Ticlawk connector API key leaks,
253
+ revoke it from the Ticlawk app immediately.
381
254
  - **No telemetry.** `ticlawk` does not send analytics or usage data
382
- anywhere. The only outbound traffic is to Telegram (when the telegram
383
- adapter is active) or to your configured ticlawk API URL (default
384
- `ticlawk.com`, when the ticlawk adapter is active).
255
+ anywhere. The only outbound traffic is to your configured Ticlawk API URL
256
+ (default `ticlawk.com`).
385
257
 
386
258
  ---
387
259
 
388
260
  ## How it works
389
261
 
390
- 1. You send a message in Telegram or ticlawk.
391
- 2. The adapter delivers it to the local `ticlawk` daemon.
392
- 3. The daemon routes it into the bound Claude Code / Codex / OpenClaw session
393
- on your machine.
394
- 4. The runtime replies; `ticlawk` captures the output (including
395
- streaming tokens and supported artifacts).
396
- 5. The reply goes back through the adapter to the same chat.
397
-
398
- For ticlawk inbound delivery, `ticlawk` keeps a WebSocket connection to
399
- the ticlawk connector wake endpoint. Wake events such as `jobs.available` and
400
- `bindings.changed` do not include message text, media, or task payloads. On wake,
401
- the local daemon uses the existing HTTP APIs to claim pending jobs and refresh
402
- channel bindings. The durable queue and `claim-pending` API remain the only
403
- ownership boundary. By default the wake endpoint is
262
+ 1. You send a message in the Ticlawk app.
263
+ 2. The Ticlawk backend enqueues a delivery for the bound agent.
264
+ 3. The local `ticlawk` daemon receives a wake event, claims the delivery,
265
+ and routes the message into the bound Claude Code / Codex / OpenClaw /
266
+ opencode / pi session on your machine.
267
+ 4. The runtime processes the turn; the agent uses the `ticlawk message send`
268
+ CLI to push chat replies back through the daemon to the app.
269
+
270
+ `ticlawk` keeps a WebSocket connection to the Ticlawk connector wake
271
+ endpoint. Wake events (`jobs.available`, `bindings.changed`) do not include
272
+ message text or media. On wake, the local daemon uses HTTP APIs to claim
273
+ pending work and refresh bindings. The durable queue and claim API remain
274
+ the only ownership boundary. By default the wake endpoint is
404
275
  `wss://edge.ticlawk.com/functions/v1/connector-wake`; override it with
405
276
  `ticlawk.connector-ws-url` only for local development or advanced setups.
406
- Low-frequency recovery audits still run so a missed wake or reconnect window
407
- does not strand durable jobs; they stay slow and do not speed up when the wake
277
+ Low-frequency recovery audits run so a missed wake or reconnect window does
278
+ not strand durable jobs; they stay slow and do not speed up when the wake
408
279
  connection is disconnected.
409
280
 
410
- The daemon owns the binding — which adapter target talks to which local
411
- runtime, and the metadata needed to resume that runtime later. Adapters own
412
- their own authentication. That's the whole architecture.
281
+ The daemon owns the binding — which Ticlawk conversation talks to which
282
+ local runtime, and the metadata needed to resume that runtime later. That's
283
+ the whole architecture.