assurgent 0.2.0 → 0.2.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/README.md +80 -100
  2. package/package.json +12 -3
package/README.md CHANGED
@@ -1,14 +1,22 @@
1
- # assurgent Chat Wrapper
1
+ # assurgent
2
2
 
3
- A lightweight wrapper that connects chat (e.g. **Telegram**) to Agent (e.g. **Claude Code CLI**), so you can talk to Claude from your phone with your entire assurgent workspace as context.
3
+ A lightweight bridge between any **chat platform** and any **coding agent** talk to your AI coding agent from anywhere.
4
4
 
5
- > Experimental project, early alpha. Expect bugs and breaking changes, use at your own risk.
5
+ > **Warning:** This project is under active development. APIs may introduce breaking changes at any time. Use at your own risk.
6
+
7
+ > The name *assurgent* carries two meanings: a botanical term for a branch that grows upward (like this project, still growing), and a nod to *agent* hiding in plain sight — **assur·gent**.
6
8
 
7
9
  ```
8
- You (Telegram) --> Wrapper --> Claude Code CLI --> Response --> You (Telegram)
10
+ You (Chat) assurgent Coding Agent Response You (Chat)
9
11
  ```
10
12
 
11
- It is not an agent itself. It's a bridge between Telegram and the Claude Code CLI, with automatic session management.
13
+ Not an agent itself. A thin bridge with automatic session management, pluggable on both sides.
14
+
15
+ ### Currently Supported
16
+
17
+ | Chat Platform | Coding Agent |
18
+ |---|---|
19
+ | Telegram | Claude Code CLI |
12
20
 
13
21
  ## Quick Start
14
22
 
@@ -16,22 +24,15 @@ It is not an agent itself. It's a bridge between Telegram and the Claude Code CL
16
24
 
17
25
  - [Bun](https://bun.sh) runtime
18
26
  - [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated
19
- - A Telegram bot token (from [@BotFather](https://t.me/BotFather))
27
+ - A Telegram bot token from [@BotFather](https://t.me/BotFather)
20
28
 
21
- ### Install
29
+ ### Install & Configure
22
30
 
23
31
  ```bash
24
- cd app
25
- bun install
32
+ bunx assurgent init
26
33
  ```
27
34
 
28
- ### Configure
29
-
30
- ```bash
31
- cp config.example.json config.json
32
- ```
33
-
34
- Edit `config.json`:
35
+ This creates `~/.assurgent/config.json` from the bundled template. Edit it:
35
36
 
36
37
  ```json
37
38
  {
@@ -39,11 +40,7 @@ Edit `config.json`:
39
40
  "adapter": "telegram",
40
41
  "telegram": {
41
42
  "botToken": "YOUR_BOT_TOKEN_HERE",
42
- "allowedUserIds": ["YOUR_TELEGRAM_USER_ID"],
43
- "placeholder": {
44
- "enabled": true,
45
- "text": "thinking..."
46
- }
43
+ "allowedUserIds": ["YOUR_TELEGRAM_USER_ID"]
47
44
  }
48
45
  },
49
46
  "agent": {
@@ -51,125 +48,108 @@ Edit `config.json`:
51
48
  "claude-code": {
52
49
  "model": "sonnet",
53
50
  "maxTurns": 10,
54
- "flags": ["--dangerously-skip-permissions"],
55
- "claudePath": "claude"
51
+ "flags": ["--dangerously-skip-permissions"]
56
52
  }
57
53
  },
58
54
  "session": {
59
55
  "turnLimit": 20
60
56
  },
61
- "workspacePath": "/path/to/assurgent"
57
+ "workspacePath": "/path/to/your/workspace"
62
58
  }
63
59
  ```
64
60
 
65
61
  To find your Telegram user ID, message [@userinfobot](https://t.me/userinfobot).
66
62
 
67
- > **Note:** If `claude` is not in your shell's PATH (common on servers where PATH is set in `.bashrc`), set `claudePath` to the full path, e.g. `/home/user/.local/bin/claude`.
63
+ > If `claude` is not in your PATH (common on servers), set `claudePath` to the full path, e.g. `/home/user/.local/bin/claude`.
68
64
 
69
65
  ### Run
70
66
 
71
67
  ```bash
72
- bun run dev
68
+ bunx assurgent
73
69
  ```
74
70
 
75
71
  Then message your bot on Telegram.
76
72
 
73
+ ### Custom Config Location
74
+
75
+ Set `ASSURGENT_HOME` to use a different config directory:
76
+
77
+ ```bash
78
+ ASSURGENT_HOME=/custom/path bunx assurgent
79
+ ```
80
+
81
+ Default: `~/.assurgent/`
82
+
77
83
  ## Bot Commands
78
84
 
79
- | Command | Description |
80
- | --------------------------------------- | ---------------------------------------------- |
81
- | `/new` | Archive current session, start fresh |
82
- | `/extend [N]` | Extend session by N turns (default: turnLimit) |
83
- | `/model [opus\|sonnet\|haiku\|default]` | Show or change model for current session |
84
- | `/session list` | List all sessions with turn usage |
85
- | `/session info` | Show current session details |
86
- | `/session resume <name>` | Resume a session by name |
87
- | `/session rename <name>` | Rename current session |
88
- | `/help` | Show all commands |
85
+ | Command | Description |
86
+ |---|---|
87
+ | `/new` | Archive current session, start fresh |
88
+ | `/extend [N]` | Extend session by N turns (default: turnLimit) |
89
+ | `/model [opus\|sonnet\|haiku\|default]` | Show or change model for current session |
90
+ | `/session list` | List all sessions with turn usage |
91
+ | `/session info` | Show current session details |
92
+ | `/session resume <name>` | Resume a session by name |
93
+ | `/session rename <name>` | Rename current session |
94
+ | `/help` | Show all commands |
89
95
 
90
- Any other text message is forwarded to Claude Code in the current session.
96
+ Any other text is forwarded to the coding agent in the current session.
91
97
 
92
98
  ## Sessions
93
99
 
94
- Sessions always resume the active session until you explicitly start a new one with `/new`.
100
+ Sessions resume automatically until you start a new one with `/new`.
95
101
 
96
- When the turn count reaches the configured `turnLimit` (default: 20), the bot pauses and asks you to decide:
97
- - `/extend 20` to add more turns and keep the same session
98
- - `/new` to archive and start fresh
102
+ When turns reach the configured `turnLimit`, the bot pauses and asks you to `/extend` or `/new`.
99
103
 
100
- Session names are auto-generated from the date and first message (e.g. `2026-03-27-fix-bug`).
104
+ Session names are auto-generated from the date and first message (e.g. `2026-03-27-fix-bug`). Override the model per-session with `/model opus` — persists until reset or new session.
101
105
 
102
- You can override the model per-session with `/model sonnet` — this persists until you reset with `/model default` or start a new session.
103
-
104
- Sessions persist across restarts via `state/sessions.json` (relative to `workspacePath`).
106
+ Sessions persist across restarts in `~/.assurgent/state/sessions.json`.
105
107
 
106
108
  ## Config Reference
107
109
 
108
- | Field | Description |
109
- | ----------------------------------- | ----------------------------------------------------------- |
110
- | `chat.adapter` | Chat platform (`"telegram"`) |
111
- | `chat.telegram.botToken` | Telegram bot token |
112
- | `chat.telegram.allowedUserIds` | Array of allowed Telegram user IDs |
113
- | `chat.telegram.placeholder.enabled` | Show a placeholder message while agent thinks |
114
- | `chat.telegram.placeholder.text` | Placeholder text |
115
- | `agent.adapter` | Agent CLI (`"claude-code"`) |
116
- | `agent.claude-code.model` | Default model (e.g. `"opus"`, `"sonnet"`) |
117
- | `agent.claude-code.maxTurns` | Max agent turns per invocation |
118
- | `agent.claude-code.flags` | Extra CLI flags (e.g. `["--dangerously-skip-permissions"]`) |
119
- | `agent.claude-code.claudePath` | Path to `claude` binary (default: `"claude"`) |
120
- | `session.turnLimit` | Pause session after N turns, ask user to /extend or /new |
121
- | `workspacePath` | Absolute path to the assurgent repo root |
122
-
123
- ## Environment Variables Passed to Agent
124
-
125
- The wrapper sets these env vars on every Claude Code invocation:
126
-
127
- | Variable | Description |
128
- | ------------------ | ---------------------------------------------------- |
129
- | `AGENT_SESSION_ID` | The Claude Code session UUID for the current session |
110
+ | Field | Description |
111
+ |---|---|
112
+ | `chat.adapter` | Chat platform (`"telegram"`) |
113
+ | `chat.telegram.botToken` | Telegram bot token |
114
+ | `chat.telegram.allowedUserIds` | Array of allowed Telegram user IDs |
115
+ | `chat.telegram.placeholder.enabled` | Show placeholder while agent thinks |
116
+ | `chat.telegram.placeholder.text` | Placeholder text (default: `"thinking..."`) |
117
+ | `agent.adapter` | Agent backend (`"claude-code"`) |
118
+ | `agent.claude-code.model` | Default model (`"opus"`, `"sonnet"`, `"haiku"`) |
119
+ | `agent.claude-code.maxTurns` | Max agent turns per invocation |
120
+ | `agent.claude-code.flags` | Extra CLI flags |
121
+ | `agent.claude-code.claudePath` | Path to `claude` binary (default: `"claude"`) |
122
+ | `session.turnLimit` | Pause after N turns, ask to extend or start new |
123
+ | `workspacePath` | Absolute path to workspace for Claude Code |
130
124
 
131
125
  ## Development
132
126
 
133
127
  ```bash
134
- bun install # Install dependencies
135
- bun run dev # Run the wrapper
136
- bun run typecheck # Type check (tsc --noEmit)
128
+ git clone https://github.com/thaitype/assurgent.git
129
+ cd assurgent
130
+ bun install
131
+ ```
132
+
133
+ ```bash
134
+ bun run dev # Start with --watch
135
+ bun run typecheck # tsc --noEmit
137
136
  bun test # Run tests
138
- bun run lint # Lint (biome)
139
- bun run lint:fix # Auto-fix lint issues
137
+ bun run lint # Biome check
138
+ bun run lint:fix # Auto-fix
140
139
  ```
141
140
 
142
- ## Architecture
141
+ For local development, config is read from `~/.assurgent/config.json` (same as production). Use `ASSURGENT_HOME` to point to a dev-specific config.
142
+
143
+ ### Architecture
143
144
 
144
145
  ```
145
- ChatAdapter (Telegram) --> Wrapper Core --> AgentAdapter (Claude Code CLI)
146
- |
147
- Session Manager
148
- (name <-> UUID)
146
+ ChatAdapter (e.g. Telegram) Wrapper Core AgentAdapter (e.g. Claude Code CLI)
147
+
148
+ Session Manager
149
149
  ```
150
150
 
151
- Both the chat side and agent side are pluggable interfaces. The design supports adding other chat platforms or agent backends later without touching the core.
151
+ Both sides are pluggable interfaces. Adding a new chat platform or coding agent is just implementing an adapter — no changes to the core.
152
152
 
153
- ### Directory Structure
153
+ ## License
154
154
 
155
- ```
156
- app/
157
- ├── src/
158
- │ ├── index.ts # Entry point
159
- │ ├── config.ts # Config loader + validation
160
- │ ├── core/
161
- │ │ ├── wrapper.ts # Core orchestrator
162
- │ │ └── session-manager.ts
163
- │ ├── interfaces/
164
- │ │ ├── chat-adapter.ts
165
- │ │ └── agent-adapter.ts
166
- │ ├── chat/
167
- │ │ └── telegram.ts # Telegram adapter (grammy)
168
- │ └── agent/
169
- │ └── claude-code.ts # Claude Code adapter (execa)
170
- ├── config.json # Runtime config (gitignored)
171
- ├── config.example.json # Committed template
172
- ├── package.json
173
- ├── tsconfig.json
174
- └── biome.json
175
- ```
155
+ MIT
package/package.json CHANGED
@@ -1,11 +1,16 @@
1
1
  {
2
2
  "name": "assurgent",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "assurgent": "./cli.ts"
7
7
  },
8
- "files": ["cli.ts", "src", "config.example.json", "README.md"],
8
+ "files": [
9
+ "cli.ts",
10
+ "src",
11
+ "config.example.json",
12
+ "README.md"
13
+ ],
9
14
  "publishConfig": {
10
15
  "access": "public"
11
16
  },
@@ -14,7 +19,10 @@
14
19
  "typecheck": "tsc --noEmit",
15
20
  "test": "bun test",
16
21
  "lint": "biome check .",
17
- "lint:fix": "biome check . --fix"
22
+ "lint:fix": "biome check . --fix",
23
+ "release:patch": "release-it patch",
24
+ "release:minor": "release-it minor",
25
+ "release:major": "release-it major"
18
26
  },
19
27
  "dependencies": {
20
28
  "execa": "^9.5.2",
@@ -23,6 +31,7 @@
23
31
  "devDependencies": {
24
32
  "@biomejs/biome": "^1.9.4",
25
33
  "@types/bun": "latest",
34
+ "release-it": "^19.2.4",
26
35
  "typescript": "^5.8.2"
27
36
  }
28
37
  }