teleton 0.7.5 → 0.8.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 +35 -15
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/{chunk-LCCVZ4D2.js → chunk-3S4GGLLR.js} +28 -26
- package/dist/{chunk-NUGDTPE4.js → chunk-4L66JHQE.js} +2 -1
- package/dist/{chunk-OGMVWDVU.js → chunk-5FNWBZ5K.js} +1826 -4992
- package/dist/{chunk-U7FQYCBQ.js → chunk-7TECSLJ4.js} +2 -2
- package/dist/{chunk-2GLHOJ5C.js → chunk-7U7BOHCL.js} +103 -36
- package/dist/{chunk-DMXTIRUW.js → chunk-AYWEJCDB.js} +20 -39
- package/dist/chunk-CGOXE4WP.js +11315 -0
- package/dist/{chunk-5UVXJMOX.js → chunk-KVXV7EF7.js} +4 -4
- package/dist/{chunk-QOQWUUA4.js → chunk-OJCLKU5Z.js} +68 -2
- package/dist/{chunk-CB2Y45HA.js → chunk-PHSAHTK4.js} +51 -3
- package/dist/{chunk-WIKM24GZ.js → chunk-QBHRXLZS.js} +5 -0
- package/dist/{chunk-OCLG5GKI.js → chunk-QV2GLOTK.js} +14 -3
- package/dist/{chunk-AVDWXYQ7.js → chunk-S6PHGKOC.js} +12 -1
- package/dist/{chunk-YP25WTQK.js → chunk-UP55PXFH.js} +6 -0
- package/dist/cli/index.js +21 -21
- package/dist/{client-O37XDCJB.js → client-MPHPIZB6.js} +4 -4
- package/dist/{get-my-gifts-TPVUGUWT.js → get-my-gifts-CC6HAVWB.js} +2 -2
- package/dist/index.js +14 -15
- package/dist/{memory-KQALFUV3.js → memory-UBHM7ILG.js} +5 -5
- package/dist/{migrate-UV3WEL5D.js → migrate-UBBEJ5BL.js} +5 -5
- package/dist/{multipart-parser-S3YC6NRJ.js → multipart-parser-UFQLJOV2.js} +2 -2
- package/dist/{paths-TMNTEDDD.js → paths-XA2RJH4S.js} +1 -1
- package/dist/{server-BHHJGUDF.js → server-3FHI2SEB.js} +398 -56
- package/dist/{setup-server-G7UG2DI3.js → setup-server-32XGDPE6.js} +161 -11
- package/dist/{store-H4XPNGC2.js → store-M5IMUQCL.js} +6 -6
- package/dist/{task-dependency-resolver-VMEVJRPO.js → task-dependency-resolver-RR2O5S7B.js} +3 -3
- package/dist/{task-executor-WWSPBJ4V.js → task-executor-6W5HRX5C.js} +3 -3
- package/dist/{tasks-QSCWSMPS.js → tasks-WQIKXDX5.js} +2 -2
- package/dist/{tool-adapter-Y3TCEQOC.js → tool-adapter-IH5VGBOO.js} +1 -1
- package/dist/{tool-index-2KH3OB6X.js → tool-index-PMAOXWUA.js} +9 -6
- package/dist/{transcript-UDJZP6NK.js → transcript-NGDPSNIH.js} +2 -2
- package/dist/web/assets/index-BfYCdwLI.js +80 -0
- package/dist/web/assets/{index-BrVqauzj.css → index-DmlyQVhR.css} +1 -1
- package/dist/web/assets/{index.es-Pet5-M13.js → index.es-DitvF-9H.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +12 -5
- package/dist/BigInteger-DQ33LTTE.js +0 -5
- package/dist/chunk-G2LLMJXJ.js +0 -5048
- package/dist/chunk-QGM4M3NI.js +0 -37
- package/dist/chunk-TSKJCWQQ.js +0 -1263
- package/dist/web/assets/index-Bx8JW3gV.js +0 -72
package/README.md
CHANGED
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
<p align="center">Teleton is an autonomous AI agent platform that operates as a real Telegram user account (not a bot). It thinks through an agentic loop with tool calling, remembers conversations across sessions with hybrid RAG, and natively integrates the TON blockchain: send crypto, swap on DEXs, bid on domains, verify payments - all from a chat message. It can schedule tasks to run autonomously at any time. It ships with 125+ built-in tools, supports
|
|
18
|
+
<p align="center">Teleton is an autonomous AI agent platform that operates as a real Telegram user account (not a bot). It thinks through an agentic loop with tool calling, remembers conversations across sessions with hybrid RAG, and natively integrates the TON blockchain: send crypto, swap on DEXs, bid on domains, verify payments - all from a chat message. It can schedule tasks to run autonomously at any time. It ships with 125+ built-in tools, supports 15 LLM providers, and exposes a Plugin SDK so you can build your own tools on top of the platform.</p>
|
|
19
19
|
|
|
20
20
|
### Key Highlights
|
|
21
21
|
|
|
22
22
|
- **Full Telegram access** - Operates as a real user via MTProto (GramJS), not a limited bot
|
|
23
23
|
- **Agentic loop** - Up to 5 iterations of tool calling per message, the agent thinks, acts, observes, and repeats
|
|
24
|
-
- **Multi-Provider LLM** - Anthropic, Claude Code, OpenAI, Google Gemini, xAI Grok, Groq, OpenRouter, Moonshot, Mistral, Cocoon, Local (
|
|
24
|
+
- **Multi-Provider LLM** - Anthropic, Claude Code, OpenAI, Google Gemini, xAI Grok, Groq, OpenRouter, Moonshot, Mistral, Cerebras, ZAI, MiniMax, Hugging Face, Cocoon, Local (15 providers)
|
|
25
25
|
- **TON Blockchain** - Built-in W5R1 wallet, send/receive TON & jettons, swap on STON.fi and DeDust, NFTs, DNS domains
|
|
26
26
|
- **Persistent memory** - Hybrid RAG (sqlite-vec + FTS5), auto-compaction with AI summarization, daily logs
|
|
27
27
|
- **125+ built-in tools** - Messaging, media, blockchain, DEX trading, deals, DNS, exec, journaling, and more
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
| Capability | Description |
|
|
54
54
|
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
55
|
-
| **Multi-Provider LLM** | Switch between Anthropic, Claude Code, OpenAI, Google, xAI, Groq, OpenRouter, Moonshot, Mistral, Cocoon, or Local — Dashboard validates API key before switching |
|
|
55
|
+
| **Multi-Provider LLM** | Switch between Anthropic, Claude Code, OpenAI, Google, xAI, Groq, OpenRouter, Moonshot, Mistral, Cerebras, ZAI, MiniMax, Hugging Face, Cocoon, or Local — Dashboard validates API key before switching |
|
|
56
56
|
| **RAG + Hybrid Search** | Local ONNX embeddings (384d) or Voyage AI (512d/1024d) with FTS5 keyword + sqlite-vec cosine similarity, fused via RRF |
|
|
57
57
|
| **Auto-Compaction** | AI-summarized context management prevents overflow, preserves key information in `memory/*.md` files |
|
|
58
58
|
| **Observation Masking** | Compresses old tool results to one-line summaries, saving ~90% context window |
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
| **Tool RAG** | Semantic tool selection (enabled by default) - sends only the top-K most relevant tools per message (hybrid vector + FTS5, configurable `top_k`, `always_include` patterns) |
|
|
67
67
|
| **MCP Client** | Connect external MCP tool servers (stdio, SSE, or Streamable HTTP) - auto-discovery, namespaced tools, managed via CLI or WebUI |
|
|
68
68
|
| **System Execution** | YOLO mode — 4 system tools (shell, file read/write, process list) with audit logging, configurable timeout, admin-only scope (off by default) |
|
|
69
|
+
| **TON Proxy** | Browse .ton domains via Tonutils-Proxy HTTP proxy, auto-downloads binary from GitHub, PID-based orphan cleanup, configurable port |
|
|
69
70
|
| **Sandboxed Workspace** | Secure file system with recursive URL decoding, symlink detection, and immutable config files |
|
|
70
71
|
|
|
71
72
|
---
|
|
@@ -73,7 +74,7 @@
|
|
|
73
74
|
## Prerequisites
|
|
74
75
|
|
|
75
76
|
- **Node.js 20.0.0+** - [Download](https://nodejs.org/)
|
|
76
|
-
- **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/) — or keyless: Claude Code (auto-detect), Cocoon (TON), Local (Ollama/vLLM)
|
|
77
|
+
- **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: Claude Code (auto-detect), Cocoon (TON), Local (Ollama/vLLM)
|
|
77
78
|
- **Telegram Account** - Dedicated account recommended for security
|
|
78
79
|
- **Telegram API Credentials** - From [my.telegram.org/apps](https://my.telegram.org/apps)
|
|
79
80
|
- **Your Telegram User ID** - Message [@userinfobot](https://t.me/userinfobot)
|
|
@@ -111,7 +112,7 @@ teleton setup
|
|
|
111
112
|
```
|
|
112
113
|
|
|
113
114
|
The wizard will configure:
|
|
114
|
-
- LLM provider selection (
|
|
115
|
+
- LLM provider selection (15 providers: Anthropic, Claude Code, OpenAI, Google, xAI, Groq, OpenRouter, Moonshot, Mistral, Cerebras, ZAI, MiniMax, Hugging Face, Cocoon, Local)
|
|
115
116
|
- Telegram authentication (API credentials, phone, login code)
|
|
116
117
|
- Access policies (DM/group response rules)
|
|
117
118
|
- Admin user ID
|
|
@@ -154,7 +155,7 @@ The `teleton setup` wizard generates a fully configured `~/.teleton/config.yaml`
|
|
|
154
155
|
|
|
155
156
|
```yaml
|
|
156
157
|
agent:
|
|
157
|
-
provider: "anthropic" # anthropic | claude-code | openai | google | xai | groq | openrouter | moonshot | mistral | cocoon | local
|
|
158
|
+
provider: "anthropic" # anthropic | claude-code | openai | google | xai | groq | openrouter | moonshot | mistral | cerebras | zai | minimax | huggingface | cocoon | local
|
|
158
159
|
api_key: "sk-ant-api03-..."
|
|
159
160
|
model: "claude-opus-4-6"
|
|
160
161
|
utility_model: "claude-haiku-4-5-20251001" # for summarization, compaction, vision
|
|
@@ -184,6 +185,11 @@ webui: # Optional: Web dashboard
|
|
|
184
185
|
host: "127.0.0.1" # Localhost only (security)
|
|
185
186
|
# auth_token: "..." # Auto-generated if omitted
|
|
186
187
|
|
|
188
|
+
ton_proxy: # Optional: .ton domain proxy
|
|
189
|
+
enabled: false # Enable Tonutils-Proxy
|
|
190
|
+
port: 8080 # HTTP proxy port
|
|
191
|
+
# binary_path: "..." # Custom binary path (auto-downloaded if omitted)
|
|
192
|
+
|
|
187
193
|
# capabilities: # System execution (YOLO mode, off by default)
|
|
188
194
|
# exec:
|
|
189
195
|
# mode: "off" # off | yolo
|
|
@@ -205,6 +211,10 @@ All models are defined in `src/config/model-catalog.ts` and shared across the CL
|
|
|
205
211
|
| **OpenRouter** | Claude Opus/Sonnet, GPT-5, Gemini, DeepSeek R1/V3, Qwen3 Coder/Max/235B, Nemotron, Sonar Pro, MiniMax, Grok 4 |
|
|
206
212
|
| **Moonshot** | Kimi K2.5, Kimi K2 Thinking |
|
|
207
213
|
| **Mistral** | Devstral Small/Medium, Mistral Large, Magistral Small |
|
|
214
|
+
| **Cerebras** | Qwen 3 235B, GPT OSS 120B, ZAI GLM-4.7, Llama 3.1 8B |
|
|
215
|
+
| **ZAI** | GLM-5, GLM-4.7, GLM-4.7 Flash (free), GLM-4.6, GLM-4.5 Flash (free), GLM-4.5V |
|
|
216
|
+
| **MiniMax** | MiniMax M2.5, MiniMax M2.5 Fast, MiniMax M2.1, MiniMax M2 |
|
|
217
|
+
| **Hugging Face** | DeepSeek V3.2, DeepSeek R1, Qwen3 235B, Qwen3 Coder 480B, Qwen3 Next 80B, Kimi K2.5, GLM-4.7 Flash, GLM-5 |
|
|
208
218
|
| **Cocoon** | Qwen/Qwen3-32B (decentralized, pays in TON) |
|
|
209
219
|
| **Local** | Auto-detected (Ollama, vLLM, LM Studio) |
|
|
210
220
|
|
|
@@ -308,7 +318,7 @@ Teleton includes an **optional web dashboard** for monitoring and configuration.
|
|
|
308
318
|
|
|
309
319
|
### Features
|
|
310
320
|
|
|
311
|
-
- **Dashboard**: System status, uptime, model info, session count, memory stats, live token usage tracking, provider switching with API key validation
|
|
321
|
+
- **Dashboard**: System status, uptime, model info, session count, memory stats, live token usage tracking, provider switching with API key validation, tabbed configuration editor
|
|
312
322
|
- **Tools Management**: View all tools grouped by module, toggle enable/disable, change scope per tool
|
|
313
323
|
- **Plugin Marketplace**: Install, update, and manage plugins from registry with secrets management
|
|
314
324
|
- **Soul Editor**: Edit SOUL.md, SECURITY.md, STRATEGY.md, MEMORY.md with unsaved changes warning
|
|
@@ -316,6 +326,7 @@ Teleton includes an **optional web dashboard** for monitoring and configuration.
|
|
|
316
326
|
- **Live Logs**: Real-time log streaming via Server-Sent Events
|
|
317
327
|
- **Workspace**: File browser with inline text editor
|
|
318
328
|
- **MCP Servers**: Add/remove external tool servers, manage API keys (env vars), view connection status
|
|
329
|
+
- **TON Proxy**: Start/stop Tonutils-Proxy, install/uninstall binary, view status
|
|
319
330
|
- **Tasks**: Scheduled task management with status, dependencies, and bulk actions
|
|
320
331
|
|
|
321
332
|
### Usage
|
|
@@ -411,7 +422,7 @@ All admin commands support `/`, `!`, or `.` prefix:
|
|
|
411
422
|
|
|
412
423
|
| Layer | Technology |
|
|
413
424
|
|-------|------------|
|
|
414
|
-
| LLM | Multi-provider via [pi-ai](https://github.com/mariozechner/pi-ai) (
|
|
425
|
+
| LLM | Multi-provider via [pi-ai](https://github.com/mariozechner/pi-ai) (15 providers: Anthropic, Claude Code, OpenAI, Google, xAI, Groq, OpenRouter, Moonshot, Mistral, Cerebras, ZAI, MiniMax, Hugging Face, Cocoon, Local) |
|
|
415
426
|
| Telegram Userbot | [GramJS](https://gram.js.org/) Layer 222 fork (MTProto) |
|
|
416
427
|
| Inline Bot | [Grammy](https://grammy.dev/) (Bot API, for deals) |
|
|
417
428
|
| Blockchain | [TON SDK](https://github.com/ton-org/ton) (W5R1 wallet) |
|
|
@@ -476,6 +487,10 @@ src/
|
|
|
476
487
|
│ ├── wallet-service.ts # W5R1 wallet, PBKDF2 key caching, encrypted storage
|
|
477
488
|
│ ├── transfer.ts # TON send operations
|
|
478
489
|
│ └── payment-verifier.ts # On-chain payment verification with replay protection
|
|
490
|
+
├── ton-proxy/ # TON Proxy module (Tonutils-Proxy lifecycle)
|
|
491
|
+
│ ├── manager.ts # Binary download, start/stop, PID file, health checks
|
|
492
|
+
│ ├── module.ts # Module lifecycle integration
|
|
493
|
+
│ └── tools.ts # ton_proxy_status tool
|
|
479
494
|
├── sdk/ # Plugin SDK (v1.0.0)
|
|
480
495
|
│ ├── index.ts # SDK factory (createPluginSDK, all objects frozen)
|
|
481
496
|
│ ├── ton.ts # TON service for plugins
|
|
@@ -489,11 +504,11 @@ src/
|
|
|
489
504
|
│ └── loader.ts # 10 sections: soul + security + strategy + memory + context + ...
|
|
490
505
|
├── config/ # Configuration
|
|
491
506
|
│ ├── schema.ts # Zod schemas + validation
|
|
492
|
-
│ ├── providers.ts # Multi-provider LLM registry (
|
|
493
|
-
│ └── model-catalog.ts # Shared model catalog (
|
|
507
|
+
│ ├── providers.ts # Multi-provider LLM registry (15 providers)
|
|
508
|
+
│ └── model-catalog.ts # Shared model catalog (70+ models across all providers)
|
|
494
509
|
├── webui/ # Optional web dashboard
|
|
495
510
|
│ ├── server.ts # Hono server, auth middleware, static serving
|
|
496
|
-
│ └── routes/ #
|
|
511
|
+
│ └── routes/ # 12 API route groups (status, tools, logs, memory, soul, plugins, mcp, tasks, workspace, config, marketplace, ton-proxy)
|
|
497
512
|
├── constants/ # Centralized limits, timeouts, API endpoints
|
|
498
513
|
├── utils/ # Logger, sanitize, retry, fetch
|
|
499
514
|
├── workspace/ # Path validator (anti-traversal, anti-symlink)
|
|
@@ -625,14 +640,18 @@ When `tools` is a function, the SDK provides namespaced access to core services:
|
|
|
625
640
|
|-----------|---------|
|
|
626
641
|
| `sdk.ton` | **Wallet**: `getAddress()`, `getBalance()`, `getPrice()`, `sendTON()`, `getTransactions()`, `verifyPayment()` |
|
|
627
642
|
| | **Jettons**: `getJettonBalances()`, `getJettonInfo()`, `sendJetton()`, `getJettonWalletAddress()` |
|
|
643
|
+
| | **Analytics**: `getJettonPrice()`, `getJettonHolders()`, `getJettonHistory()` |
|
|
628
644
|
| | **NFT**: `getNftItems()`, `getNftInfo()` |
|
|
645
|
+
| | **DEX** (`sdk.ton.dex`): `quote()`, `swap()`, `quoteSTONfi()`, `quoteDeDust()`, `swapSTONfi()`, `swapDeDust()` |
|
|
646
|
+
| | **DNS** (`sdk.ton.dns`): `check()`, `resolve()`, `getAuctions()`, `startAuction()`, `bid()`, `link()`, `unlink()`, `setSiteRecord()` |
|
|
647
|
+
| | **Signed Transfers** (`sdk.ton`): `createTransfer()`, `createJettonTransfer()`, `getPublicKey()`, `getWalletVersion()` |
|
|
629
648
|
| | **Utils**: `toNano()`, `fromNano()`, `validateAddress()` |
|
|
630
|
-
| `sdk.telegram` | **Messages**: `sendMessage()`, `editMessage()`, `deleteMessage()`, `forwardMessage()`, `pinMessage()`, `searchMessages()`, `scheduleMessage()`, `getReplies()` |
|
|
649
|
+
| `sdk.telegram` | **Messages**: `sendMessage()`, `editMessage()`, `deleteMessage()`, `forwardMessage()`, `pinMessage()`, `searchMessages()`, `scheduleMessage()`, `getScheduledMessages()`, `deleteScheduledMessage()`, `sendScheduledNow()`, `getReplies()` |
|
|
631
650
|
| | **Media**: `sendPhoto()`, `sendVideo()`, `sendVoice()`, `sendFile()`, `sendGif()`, `sendSticker()`, `downloadMedia()` |
|
|
632
|
-
| | **Chat & Users**: `getChatInfo()`, `getUserInfo()`, `resolveUsername()`, `getParticipants()` |
|
|
651
|
+
| | **Chat & Users**: `getChatInfo()`, `getUserInfo()`, `resolveUsername()`, `getParticipants()`, `getDialogs()`, `getHistory()` |
|
|
633
652
|
| | **Interactive**: `sendDice()`, `sendReaction()`, `createPoll()`, `createQuiz()` |
|
|
634
|
-
| | **Moderation**: `banUser()`, `unbanUser()`, `muteUser()` |
|
|
635
|
-
| | **Stars & Gifts**: `getStarsBalance()`, `sendGift()`, `getAvailableGifts()`, `getMyGifts()`, `getResaleGifts()`, `buyResaleGift()` |
|
|
653
|
+
| | **Moderation**: `banUser()`, `unbanUser()`, `muteUser()`, `kickUser()` |
|
|
654
|
+
| | **Stars & Gifts**: `getStarsBalance()`, `sendGift()`, `getAvailableGifts()`, `getMyGifts()`, `getResaleGifts()`, `buyResaleGift()`, `getStarsTransactions()`, `transferCollectible()`, `setCollectiblePrice()`, `getCollectibleInfo()`, `getUniqueGift()`, `getUniqueGiftValue()`, `sendGiftOffer()` |
|
|
636
655
|
| | **Advanced**: `getMe()`, `isAvailable()`, `getRawClient()`, `setTyping()`, `sendStory()` |
|
|
637
656
|
| `sdk.secrets` | `get()`, `require()`, `has()` - 3-tier resolution (env var → secrets file → plugin config) |
|
|
638
657
|
| `sdk.storage` | `get()`, `set()`, `delete()`, `has()`, `clear()` - KV store with TTL support |
|
|
@@ -715,6 +734,7 @@ MIT License - See [LICENSE](LICENSE) for details.
|
|
|
715
734
|
- [MCP SDK](https://github.com/modelcontextprotocol/typescript-sdk) - Model Context Protocol client
|
|
716
735
|
- [sqlite-vec](https://github.com/asg017/sqlite-vec) - Vector search for SQLite
|
|
717
736
|
- [Hono](https://hono.dev/) - Lightweight web framework
|
|
737
|
+
- [Tonutils-Proxy](https://github.com/xssnick/Tonutils-Proxy) - TON Proxy for .ton sites
|
|
718
738
|
|
|
719
739
|
---
|
|
720
740
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
__require
|
|
10
|
+
};
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
EMBEDDING_CACHE_MAX_ENTRIES,
|
|
8
8
|
EMBEDDING_CACHE_TTL_DAYS,
|
|
9
9
|
VOYAGE_BATCH_SIZE
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UP55PXFH.js";
|
|
11
11
|
import {
|
|
12
12
|
fetchWithTimeout
|
|
13
13
|
} from "./chunk-XQUHC3JZ.js";
|
|
@@ -138,7 +138,7 @@ var LocalEmbeddingProvider = class {
|
|
|
138
138
|
try {
|
|
139
139
|
await getExtractor(this.model);
|
|
140
140
|
return true;
|
|
141
|
-
} catch
|
|
141
|
+
} catch {
|
|
142
142
|
if (attempt === 1) {
|
|
143
143
|
log.warn(`Embedding model load failed (attempt 1), retrying...`);
|
|
144
144
|
await new Promise((r) => setTimeout(r, 1e3));
|
|
@@ -174,28 +174,8 @@ var LocalEmbeddingProvider = class {
|
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
176
|
|
|
177
|
-
// src/memory/embeddings/
|
|
177
|
+
// src/memory/embeddings/utils.ts
|
|
178
178
|
import { createHash } from "crypto";
|
|
179
|
-
function createEmbeddingProvider(config) {
|
|
180
|
-
switch (config.provider) {
|
|
181
|
-
case "anthropic":
|
|
182
|
-
if (!config.apiKey) {
|
|
183
|
-
throw new Error("API key required for Anthropic embedding provider");
|
|
184
|
-
}
|
|
185
|
-
return new AnthropicEmbeddingProvider({
|
|
186
|
-
apiKey: config.apiKey,
|
|
187
|
-
model: config.model
|
|
188
|
-
});
|
|
189
|
-
case "local":
|
|
190
|
-
return new LocalEmbeddingProvider({
|
|
191
|
-
model: config.model
|
|
192
|
-
});
|
|
193
|
-
case "none":
|
|
194
|
-
return new NoopEmbeddingProvider();
|
|
195
|
-
default:
|
|
196
|
-
throw new Error(`Unknown embedding provider: ${config.provider}`);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
179
|
function hashText(text) {
|
|
200
180
|
return createHash("sha256").update(text).digest("hex");
|
|
201
181
|
}
|
|
@@ -335,13 +315,35 @@ var CachedEmbeddingProvider = class _CachedEmbeddingProvider {
|
|
|
335
315
|
}
|
|
336
316
|
};
|
|
337
317
|
|
|
318
|
+
// src/memory/embeddings/index.ts
|
|
319
|
+
function createEmbeddingProvider(config) {
|
|
320
|
+
switch (config.provider) {
|
|
321
|
+
case "anthropic":
|
|
322
|
+
if (!config.apiKey) {
|
|
323
|
+
throw new Error("API key required for Anthropic embedding provider");
|
|
324
|
+
}
|
|
325
|
+
return new AnthropicEmbeddingProvider({
|
|
326
|
+
apiKey: config.apiKey,
|
|
327
|
+
model: config.model
|
|
328
|
+
});
|
|
329
|
+
case "local":
|
|
330
|
+
return new LocalEmbeddingProvider({
|
|
331
|
+
model: config.model
|
|
332
|
+
});
|
|
333
|
+
case "none":
|
|
334
|
+
return new NoopEmbeddingProvider();
|
|
335
|
+
default:
|
|
336
|
+
throw new Error(`Unknown embedding provider: ${config.provider}`);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
338
340
|
export {
|
|
339
341
|
NoopEmbeddingProvider,
|
|
340
342
|
AnthropicEmbeddingProvider,
|
|
341
343
|
LocalEmbeddingProvider,
|
|
342
|
-
CachedEmbeddingProvider,
|
|
343
|
-
createEmbeddingProvider,
|
|
344
344
|
hashText,
|
|
345
345
|
serializeEmbedding,
|
|
346
|
-
deserializeEmbedding
|
|
346
|
+
deserializeEmbedding,
|
|
347
|
+
CachedEmbeddingProvider,
|
|
348
|
+
createEmbeddingProvider
|
|
347
349
|
};
|
|
@@ -239,6 +239,7 @@ var TaskStore = class {
|
|
|
239
239
|
* Get all parent task results for a dependent task.
|
|
240
240
|
* Uses a single JOIN query instead of N+1 queries.
|
|
241
241
|
*/
|
|
242
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- result is JSON-parsed dynamic data
|
|
242
243
|
getParentResults(taskId) {
|
|
243
244
|
const rows = this.db.prepare(
|
|
244
245
|
`
|
|
@@ -254,7 +255,7 @@ var TaskStore = class {
|
|
|
254
255
|
let parsedResult;
|
|
255
256
|
try {
|
|
256
257
|
parsedResult = JSON.parse(row.result);
|
|
257
|
-
} catch
|
|
258
|
+
} catch {
|
|
258
259
|
parsedResult = row.result;
|
|
259
260
|
}
|
|
260
261
|
return {
|