Skip to content

Commit e842680

Browse files
authored
Merge pull request #23 from TONresistor/dev
Release 0.9.0: native gocoon provider + withdraw/unstake fix + reset
2 parents 0dee104 + d969bee commit e842680

103 files changed

Lines changed: 3099 additions & 2367 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ jobs:
199199
echo "$LOG" >> "$GITHUB_OUTPUT"
200200
echo "EOF" >> "$GITHUB_OUTPUT"
201201
202+
- name: Lowercase image path for the install snippet
203+
id: meta
204+
run: echo "repo=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
205+
202206
- name: Create GitHub Release
203207
if: steps.check.outputs.exists == 'false'
204208
uses: softprops/action-gh-release@v2
@@ -214,7 +218,7 @@ jobs:
214218
215219
**Docker:**
216220
```bash
217-
docker run -it -v ~/.teleton:/data ghcr.io/${{ github.repository }}:latest setup
221+
docker run -it -v ~/.teleton:/data ghcr.io/${{ steps.meta.outputs.repo }}:latest setup
218222
```
219223
220224
## Changes

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.9.0] - 2026-06-19
11+
12+
### Added
13+
14+
- **Native `gocoon` provider**: an OpenAI-compatible, pure-Go COCOON client ([gocoon](https://github.com/TONresistor/gocoon)). Turnkey lifecycle — auto-install and integrity-verify the runner binary, supervise it, and set up / top-up / withdraw the TON payment channel from the CLI (`teleton gocoon`) or the WebUI Gocoon page. Runner pinned to v0.2.0, default model `Qwen/Qwen3-32B`.
15+
- **WebUI Gocoon page**: channel status (including the fund address), top-up, withdraw, unstake, and wallet reset.
16+
- **Codex** in the WebUI provider selector.
17+
18+
### Changed
19+
20+
- **Replaced the `cocoon` provider with `gocoon`** (**Breaking**). Tool-calling now uses the model's native `tools`/`tool_calls` instead of the old XML-injection shim, which has been removed (`src/cocoon/` deleted). Set `agent.provider: gocoon` and rename the `cocoon:` config block to `gocoon:` (`gocoon.port`, default `10000`); legacy `cocoon` configs are auto-migrated on load.
21+
- **ToolSearch mode enabled by default.**
22+
- **Local SSE proxy** fronts the gocoon runner — fixes the pi-ai "empty response / zero tokens" issue and surfaces runner errors to the client.
23+
- **Auto-start is non-fatal**: an unfunded channel keeps the agent and WebUI running so it can be funded from the Gocoon page (requires ≥2 TON free in the fund wallet).
24+
- Re-verify the runner binary integrity on every launch, not only on install.
25+
26+
### Fixed
27+
28+
- **Unstake / withdraw**: `withdrawAll` scanned the owner wallet instead of the fund wallet, so the channel close was skipped and the staked TON stayed locked while only the liquid balance was swept. Now scans the fund address and reads channel state.
29+
- Harden withdraw against transient errors and re-runs (idempotent, re-broadcast-safe).
30+
- Hold the wallet tx-lock during the agent-wallet sweep to prevent a concurrent send from stealing the seqno.
31+
- Gate top-up on a running runner; show the fund address in status.
32+
- CI: lowercase the ghcr.io path in the release-notes Docker step.
33+
34+
### Removed
35+
36+
- The `cocoon` provider and its XML tool-adapter (`src/cocoon/`).
37+
- Dead code: `events/bus`, `memory/agent/sessions`, `telegram/callbacks/*`, web `SearchInput`, `lib/a11y`, and assorted unused helpers.
38+
1039
## [0.8.1] - 2026-03-05
1140

1241
### Added

GETTING_STARTED.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Configuration is in `~/.teleton/config.yaml`. The setup wizard generates everyth
113113

114114
```yaml
115115
agent:
116-
provider: "anthropic" # anthropic | openai | google | xai | groq | openrouter | moonshot | mistral | cerebras | zai | minimax | huggingface | cocoon | local
116+
provider: "anthropic" # anthropic | openai | google | xai | groq | openrouter | moonshot | mistral | cerebras | zai | minimax | huggingface | gocoon | local
117117
model: "claude-opus-4-5-20251101"
118118
max_tokens: 4096
119119
temperature: 0.7
@@ -142,7 +142,7 @@ agent:
142142
model: "gpt-4o"
143143
```
144144
145-
Supported: `anthropic`, `openai`, `google`, `xai`, `groq`, `openrouter`, `moonshot`, `mistral`, `cerebras`, `zai`, `minimax`, `huggingface`, `cocoon`, `local`
145+
Supported: `anthropic`, `openai`, `google`, `xai`, `groq`, `openrouter`, `moonshot`, `mistral`, `cerebras`, `zai`, `minimax`, `huggingface`, `gocoon`, `local`
146146

147147
---
148148

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
## Prerequisites
8686

8787
- **Node.js 20.0.0+** - [Download](https://nodejs.org/)
88-
- **LLM API Key** - One of: [Anthropic](https://console.anthropic.com/) (recommended), [OpenAI](https://platform.openai.com/), [Google](https://aistudio.google.com/), [xAI](https://console.x.ai/), [Groq](https://console.groq.com/), [OpenRouter](https://openrouter.ai/), [Moonshot](https://platform.moonshot.ai/), [Mistral](https://console.mistral.ai/), [Cerebras](https://cloud.cerebras.ai/), [ZAI](https://open.bigmodel.cn/), [MiniMax](https://platform.minimaxi.com/), [Hugging Face](https://huggingface.co/settings/tokens) — or keyless: Codex (auto-detect), Cocoon (TON), Local (Ollama/vLLM)
88+
- **LLM API Key** - One of: [Anthropic](https://console.anthropic.com/) (recommended), [OpenAI](https://platform.openai.com/), [Google](https://aistudio.google.com/), [xAI](https://console.x.ai/), [Groq](https://console.groq.com/), [OpenRouter](https://openrouter.ai/), [Moonshot](https://platform.moonshot.ai/), [Mistral](https://console.mistral.ai/), [Cerebras](https://cloud.cerebras.ai/), [ZAI](https://open.bigmodel.cn/), [MiniMax](https://platform.minimaxi.com/), [Hugging Face](https://huggingface.co/settings/tokens) — or keyless: Codex (auto-detect), Gocoon (TON), Local (Ollama/vLLM)
8989
- **Telegram Account** - Dedicated account recommended for security
9090
- **Telegram API Credentials** - From [my.telegram.org/apps](https://my.telegram.org/apps)
9191
- **Your Telegram User ID** - Message [@userinfobot](https://t.me/userinfobot)
@@ -172,7 +172,7 @@ The `teleton setup` wizard generates a fully configured `~/.teleton/config.yaml`
172172

173173
```yaml
174174
agent:
175-
provider: "anthropic" # anthropic | openai | google | xai | groq | openrouter | moonshot | mistral | cerebras | zai | minimax | huggingface | cocoon | local
175+
provider: "anthropic" # anthropic | openai | google | xai | groq | openrouter | moonshot | mistral | cerebras | zai | minimax | huggingface | gocoon | local
176176
api_key: "sk-ant-api03-..."
177177
model: "claude-haiku-4-5-20251001"
178178
utility_model: "claude-haiku-4-5-20251001" # for summarization, compaction, vision
@@ -235,7 +235,7 @@ ton_proxy: # Optional: .ton domain proxy
235235
<td align="center"><br><b>ZAI</b><br>GLM-5<br><br></td>
236236
<td align="center"><br><b>MiniMax</b><br>M2.5<br><br></td>
237237
<td align="center"><br><b>Hugging Face</b><br>DeepSeek V3.2<br><br></td>
238-
<td align="center"><br><b>Cocoon</b><br>Decentralized (TON)<br><br></td>
238+
<td align="center"><br><b>Gocoon</b><br>Decentralized (TON)<br><br></td>
239239
<td align="center"><br><b>Local</b><br>Ollama, vLLM, LM Studio<br><br></td>
240240
</tr>
241241
</table>
@@ -475,7 +475,7 @@ The SDK provides namespaced access to core services:
475475

476476
| Layer | Technology |
477477
|-------|------------|
478-
| LLM | Multi-provider via [pi-ai](https://github.com/mariozechner/pi-ai) (15 providers: Anthropic, Codex, OpenAI, Google, xAI, Groq, OpenRouter, Moonshot, Mistral, Cerebras, ZAI, MiniMax, Hugging Face, Cocoon, Local) |
478+
| LLM | Multi-provider via [pi-ai](https://github.com/mariozechner/pi-ai) (15 providers: Anthropic, Codex, OpenAI, Google, xAI, Groq, OpenRouter, Moonshot, Mistral, Cerebras, ZAI, MiniMax, Hugging Face, Gocoon, Local) |
479479
| Telegram Userbot | [GramJS](https://gram.js.org/) Layer 223 fork (MTProto) |
480480
| Inline Bot | [Grammy](https://grammy.dev/) (Bot API, for deals) |
481481
| Blockchain | [TON SDK](https://github.com/ton-org/ton) (W5R1 wallet) |
@@ -593,7 +593,7 @@ packages/sdk/ # Published @teleton-agent/sdk
593593
| **Payment security** | `INSERT OR IGNORE` on tx hashes prevents double-spend, atomic status transitions prevent race conditions |
594594
| **Exec audit** | All YOLO mode commands logged to `exec_audit` table with user, command, output, and timestamps |
595595
| **Pino redaction** | Structured logging with automatic redaction of apiKey, password, secret, token, mnemonic fields |
596-
| **Tool scoping** | Financial tools DM-only, moderation group-only, admin-only policies, per-chat permissions configurable at runtime |
596+
| **Tool access control** | Per-tool access level (all, allow-list, admin, off), DM vs group gated by global policies, per-group module permissions, all runtime-configurable |
597597

598598
### Reporting Vulnerabilities
599599

docs/configuration.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Run `teleton setup` to generate a config file interactively, or copy `config.exa
2323
- [plugins](#plugins)
2424
- [ton_proxy](#ton_proxy)
2525
- [api](#api)
26-
- [cocoon](#cocoon)
26+
- [gocoon](#gocoon)
2727
- [tonapi_key](#tonapi_key)
2828
- [toncenter_api_key](#toncenter_api_key)
2929
- [tavily_api_key](#tavily_api_key)
@@ -38,7 +38,7 @@ LLM provider and agentic loop configuration.
3838

3939
| Key | Type | Default | Description |
4040
|-----|------|---------|-------------|
41-
| `agent.provider` | `enum` | `"anthropic"` | LLM provider. One of: `anthropic`, `codex`, `openai`, `google`, `xai`, `groq`, `openrouter`, `moonshot`, `mistral`, `cerebras`, `zai`, `minimax`, `huggingface`, `cocoon`, `local`. |
41+
| `agent.provider` | `enum` | `"anthropic"` | LLM provider. One of: `anthropic`, `codex`, `openai`, `google`, `xai`, `groq`, `openrouter`, `moonshot`, `mistral`, `cerebras`, `zai`, `minimax`, `huggingface`, `gocoon`, `local`. |
4242
| `agent.api_key` | `string` | `""` | API key for the chosen provider. Can be overridden with `TELETON_API_KEY` env var. |
4343
| `agent.model` | `string` | `"claude-haiku-4-5-20251001"` | Primary model ID. Auto-detected from provider if not set (only for non-Anthropic providers). |
4444
| `agent.utility_model` | `string` | *auto-detected* | Cheap/fast model used for summarization and compaction. If omitted, the platform selects one based on the provider (e.g., `claude-haiku-4-5-20251001` for Anthropic, `gpt-4o-mini` for OpenAI). |
@@ -96,7 +96,7 @@ When you change the `provider` and omit `model`, the platform auto-selects:
9696
| `zai` | `glm-5.1` | `glm-4.5-air` |
9797
| `minimax` | `MiniMax-M2.7` | `MiniMax-M2.7` |
9898
| `huggingface` | `deepseek-ai/DeepSeek-V3.2` | `Qwen/Qwen3-Next-80B-A3B-Instruct` |
99-
| `cocoon` | `Qwen/Qwen3-32B` | `Qwen/Qwen3-32B` |
99+
| `gocoon` | `Qwen/Qwen3-32B` | `Qwen/Qwen3-32B` |
100100
| `local` | `auto` | `auto` |
101101

102102
---
@@ -485,20 +485,20 @@ api:
485485

486486
---
487487

488-
## cocoon
488+
## gocoon
489489

490-
Cocoon Network configuration. The Cocoon provider is a decentralized LLM proxy that pays in TON. It requires an external `cocoon-cli` process running on the specified port.
490+
Gocoon configuration. Gocoon is a pure-Go COCOON client: a decentralized LLM that pays in TON. It exposes a native OpenAI-compatible API (with function calling) and requires the `gocoon-runner` process running on the specified port.
491491

492492
| Key | Type | Default | Description |
493493
|-----|------|---------|-------------|
494-
| `cocoon.port` | `number` | `10000` | HTTP port of the `cocoon-cli` proxy (1-65535). |
494+
| `gocoon.port` | `number` | `10000` | HTTP port of the `gocoon-runner` OpenAI-compatible API (1-65535). |
495495

496-
The `cocoon` section is optional. Only needed when `agent.provider` is set to `"cocoon"`.
496+
The `gocoon` section is optional. Only needed when `agent.provider` is set to `"gocoon"`.
497497

498498
### Example
499499

500500
```yaml
501-
cocoon:
501+
gocoon:
502502
port: 10000
503503
```
504504

docs/deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Before deploying, make sure you have:
2727
1. **Node.js 20+** (required by the `engines` field in `package.json`)
2828
2. **npm** (ships with Node.js)
2929
3. **Telegram API credentials** -- obtain `api_id` and `api_hash` from [my.telegram.org/apps](https://my.telegram.org/apps)
30-
4. **LLM API key** -- from your chosen provider (Anthropic, OpenAI, Google, xAI, Groq, OpenRouter, Moonshot, Mistral, Cerebras, ZAI, MiniMax, Hugging Face, or Cocoon)
30+
4. **LLM API key** -- from your chosen provider (Anthropic, OpenAI, Google, xAI, Groq, OpenRouter, Moonshot, Mistral, Cerebras, ZAI, MiniMax, Hugging Face, or Gocoon)
3131
5. **Build tools** (only for source/Docker builds) -- `python3`, `make`, `g++` for native modules (`better-sqlite3`)
3232

3333
---

knip.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"src/webui/**/*.ts",
88
"src/agent/index.ts",
99
"src/telegram/index.ts",
10-
"src/telegram/callbacks/index.ts",
1110
"src/sdk/hooks/index.ts",
1211
"src/constants/index.ts",
1312
"src/api/**/*.ts"

0 commit comments

Comments
 (0)