Simplify install with one-click scripts; honor HTTP(S)_PROXY for Telegram.

Add install.ps1/install.sh, shrink README to script-first flow, register bot commands, and route API calls through undici EnvHttpProxyAgent when a proxy is set (v0.2.2).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
owo
2026-08-14 17:46:01 +08:00
co-authored by Cursor
parent 8ef1622822
commit a83af2f33c
15 changed files with 1255 additions and 204 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ test('apply without token does not throw and does not start effect', () => {
effects.push(name)
return () => {}
},
logger: { error() {}, warn() {} },
logger: { info() {}, error() {}, warn() {} },
agents: {},
} as any
const prev = process.env.DSH_TELEGRAM_TOKEN
+7 -6
View File
@@ -26,6 +26,7 @@ function fakeClient(
},
sendChatAction: async () => true,
answerCallbackQuery: async () => true,
setMyCommands: async () => true,
...overrides,
}
}
@@ -56,7 +57,7 @@ function makeAgent(id: string, followups: UserMessage[]) {
test('unauthorized user gets denied', async () => {
const sent: SentMessage[] = []
const ctx = {
logger: { warn() {}, error() {} },
logger: { info() {}, warn() {}, error() {} },
agents: { list: () => [], roots: () => [], get: () => undefined },
on() { return () => {} },
}
@@ -75,7 +76,7 @@ test('plain text without bind prompts NEED_BIND and does not create', async () =
const sent: SentMessage[] = []
let createCalled = false
const ctx = {
logger: { warn() {}, error() {} },
logger: { info() {}, warn() {}, error() {} },
agents: {
list: () => [],
roots: () => [],
@@ -99,7 +100,7 @@ test('plain text without bind prompts NEED_BIND and does not create', async () =
test('/sessions with no live agents shows NO_LIVE', async () => {
const sent: SentMessage[] = []
const ctx = {
logger: { warn() {}, error() {} },
logger: { info() {}, warn() {}, error() {} },
agents: { list: () => [], roots: () => [], get: () => undefined },
on() { return () => {} },
}
@@ -119,7 +120,7 @@ test('/sessions lists live agents with bind callbacks', async () => {
const followups: UserMessage[] = []
const agent = makeAgent('live-aaa', followups)
const ctx = {
logger: { warn() {}, error() {} },
logger: { info() {}, warn() {}, error() {} },
agents: {
list: () => [agent],
roots: () => [agent],
@@ -145,7 +146,7 @@ test('callback bind then plain text followups live agent; mirror assistant to ch
const agent = makeAgent('live-bbb', followups)
let sessionListener: ((session: { id: ReturnType<typeof SessionId> }, event: unknown) => void) | undefined
const ctx = {
logger: { warn() {}, error() {} },
logger: { info() {}, warn() {}, error() {} },
agents: {
list: () => [agent],
roots: () => [agent],
@@ -202,7 +203,7 @@ test('/unbind clears binding without needing create/dispose', async () => {
const followups: UserMessage[] = []
const agent = makeAgent('live-ccc', followups)
const ctx = {
logger: { warn() {}, error() {} },
logger: { info() {}, warn() {}, error() {} },
agents: {
list: () => [agent],
roots: () => [agent],