assurgent 0.2.0 → 0.2.2
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 +80 -100
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
# assurgent
|
|
1
|
+
# assurgent
|
|
2
2
|
|
|
3
|
-
A lightweight
|
|
3
|
+
A lightweight bridge between any **chat platform** and any **coding agent** — talk to your AI coding agent from anywhere.
|
|
4
4
|
|
|
5
|
-
>
|
|
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 (
|
|
10
|
+
You (Chat) → assurgent → Coding Agent → Response → You (Chat)
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
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
|
|
27
|
+
- A Telegram bot token from [@BotFather](https://t.me/BotFather)
|
|
20
28
|
|
|
21
|
-
### Install
|
|
29
|
+
### Install & Configure
|
|
22
30
|
|
|
23
31
|
```bash
|
|
24
|
-
|
|
25
|
-
bun install
|
|
32
|
+
bunx assurgent init
|
|
26
33
|
```
|
|
27
34
|
|
|
28
|
-
|
|
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/
|
|
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
|
-
>
|
|
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
|
-
|
|
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
|
|
80
|
-
|
|
81
|
-
| `/new`
|
|
82
|
-
| `/extend [N]`
|
|
83
|
-
| `/model [opus\|sonnet\|haiku\|default]` | Show or change model for current session
|
|
84
|
-
| `/session list`
|
|
85
|
-
| `/session info`
|
|
86
|
-
| `/session resume <name>`
|
|
87
|
-
| `/session rename <name>`
|
|
88
|
-
| `/help`
|
|
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
|
|
96
|
+
Any other text is forwarded to the coding agent in the current session.
|
|
91
97
|
|
|
92
98
|
## Sessions
|
|
93
99
|
|
|
94
|
-
Sessions
|
|
100
|
+
Sessions resume automatically until you start a new one with `/new`.
|
|
95
101
|
|
|
96
|
-
When
|
|
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
|
-
|
|
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
|
|
109
|
-
|
|
110
|
-
| `chat.adapter`
|
|
111
|
-
| `chat.telegram.botToken`
|
|
112
|
-
| `chat.telegram.allowedUserIds`
|
|
113
|
-
| `chat.telegram.placeholder.enabled` | Show
|
|
114
|
-
| `chat.telegram.placeholder.text`
|
|
115
|
-
| `agent.adapter`
|
|
116
|
-
| `agent.claude-code.model`
|
|
117
|
-
| `agent.claude-code.maxTurns`
|
|
118
|
-
| `agent.claude-code.flags`
|
|
119
|
-
| `agent.claude-code.claudePath`
|
|
120
|
-
| `session.turnLimit`
|
|
121
|
-
| `workspacePath`
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
bun
|
|
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 #
|
|
139
|
-
bun run lint:fix # Auto-fix
|
|
137
|
+
bun run lint # Biome check
|
|
138
|
+
bun run lint:fix # Auto-fix
|
|
140
139
|
```
|
|
141
140
|
|
|
142
|
-
|
|
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)
|
|
146
|
-
|
|
147
|
-
|
|
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
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"assurgent": "./cli.ts"
|
|
7
7
|
},
|
|
8
|
-
"files": [
|
|
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
|
}
|