grok-telegram-bot 2.4.0 → 2.5.0
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/.env.example +38 -2
- package/CHANGELOG.md +119 -1
- package/README.md +58 -15
- package/docs/GROUP.md +225 -0
- package/docs/INSTALL.md +3 -0
- package/package.json +1 -1
- package/src/app/lifetime-flag.ts +20 -0
- package/src/app/settings-store.ts +47 -8
- package/src/app/types.ts +12 -1
- package/src/app/updater.ts +24 -3
- package/src/bot/auth.ts +96 -15
- package/src/bot/bot.ts +122 -15
- package/src/bot/chat-controller.ts +52 -18
- package/src/bot/commands.ts +69 -29
- package/src/bot/deps.ts +3 -0
- package/src/bot/group-memory.ts +159 -0
- package/src/bot/handlers/accounts.ts +7 -0
- package/src/bot/handlers/control.ts +85 -32
- package/src/bot/handlers/document.ts +31 -4
- package/src/bot/handlers/forum.ts +207 -0
- package/src/bot/handlers/menu.ts +86 -24
- package/src/bot/handlers/message.ts +101 -21
- package/src/bot/handlers/photo.ts +123 -16
- package/src/bot/handlers/running.ts +150 -24
- package/src/bot/handlers/session-card.ts +13 -5
- package/src/bot/handlers/sessions.ts +68 -18
- package/src/bot/handlers/voice.ts +52 -7
- package/src/bot/image-return.ts +8 -5
- package/src/bot/menu/ephemeral.ts +13 -3
- package/src/bot/menu/keyboard.ts +53 -14
- package/src/bot/menu/refresh.ts +3 -1
- package/src/bot/menu/status-panel.ts +12 -6
- package/src/bot/permission-service.ts +19 -0
- package/src/bot/prompt-anchor.ts +300 -0
- package/src/bot/prompt-content.ts +3 -0
- package/src/bot/registry.ts +94 -1
- package/src/bot/scope.ts +94 -0
- package/src/bot/session-runtime.ts +647 -158
- package/src/bot/suggestions.ts +91 -31
- package/src/bot/telegram-actions.ts +440 -0
- package/src/bot/telegram-bots.ts +495 -0
- package/src/bot/telegram-io.ts +94 -10
- package/src/cli.ts +2 -0
- package/src/config.ts +201 -2
- package/src/forum/bind-path.ts +146 -0
- package/src/forum/manager.ts +651 -0
- package/src/forum/project-icon.ts +142 -0
- package/src/forum/thread.ts +16 -0
- package/src/forum/topic-store.ts +114 -0
- package/src/forum/types.ts +29 -0
- package/src/grok/client.ts +130 -28
- package/src/index.ts +205 -75
- package/src/projects/manager.ts +16 -3
- package/src/render/chunk.ts +17 -10
- package/src/render/hashtags.ts +5 -1
- package/src/render/session-comment.ts +64 -7
- package/src/render/telegram-bridge.ts +360 -0
- package/src/render/tool-call.ts +56 -37
- package/src/service/platform.ts +44 -7
- package/src/service/windows.ts +16 -4
- package/src/sessions/history.ts +50 -9
- package/src/sessions/process.ts +7 -0
- package/src/sessions/types.ts +2 -2
- package/src/stream/streamer.ts +17 -6
- package/scripts/analyze-jsonl.ts +0 -33
- package/scripts/delayed-restart.ps1 +0 -29
- package/scripts/probe-exit-response-shape.py +0 -77
- package/scripts/probe-plan-exit.py +0 -60
- package/scripts/probe-plan-exit2.py +0 -48
- package/scripts/probe-plan-fields.py +0 -41
- package/scripts/probe-plan-fields2.py +0 -58
- package/scripts/probe-plan-response-path.py +0 -48
- package/scripts/sample-claude-tooluse.ts +0 -21
- package/scripts/sample-kiro-events.ts +0 -31
- package/scripts/smoke-exit-plan.ts +0 -274
- package/scripts/smoke-exit-shapes.ts +0 -252
- package/scripts/smoke-import.mjs +0 -82
- package/scripts/smoke-import.ts +0 -73
package/scripts/smoke-import.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdtempSync, readFileSync, readdirSync, rmSync } from "node:fs";
|
|
2
|
-
import { homedir, tmpdir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { buildImportPackage } from "../src/import/build-import.js";
|
|
5
|
-
import { readForeignHistory } from "../src/import/history-readers.js";
|
|
6
|
-
import { listRunningFromSource } from "../src/import/list-running.js";
|
|
7
|
-
import { getImportSource, IMPORT_SOURCES } from "../src/import/sources.js";
|
|
8
|
-
|
|
9
|
-
for (const src of IMPORT_SOURCES) {
|
|
10
|
-
const running = listRunningFromSource(src);
|
|
11
|
-
console.log("===", src.id, "running:", running.length);
|
|
12
|
-
for (const s of running.slice(0, 3)) {
|
|
13
|
-
const hist = readForeignHistory(src.format, src.sessionsRoot, s.sessionId);
|
|
14
|
-
console.log(
|
|
15
|
-
" -",
|
|
16
|
-
s.sessionId.slice(0, 18),
|
|
17
|
-
"entries=",
|
|
18
|
-
hist.length,
|
|
19
|
-
"bytes=",
|
|
20
|
-
s.historyBytes,
|
|
21
|
-
"cwd=",
|
|
22
|
-
(s.cwd || "").slice(0, 48),
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const kiro = getImportSource("kiro")!;
|
|
28
|
-
const kRunning = listRunningFromSource(kiro);
|
|
29
|
-
const withHist = kRunning.find((s) => s.historyBytes > 1000) || kRunning[0];
|
|
30
|
-
if (withHist) {
|
|
31
|
-
const dir = mkdtempSync(join(tmpdir(), "grok-imp-"));
|
|
32
|
-
const pkg = buildImportPackage(kiro, withHist, dir);
|
|
33
|
-
console.log("KIRO IMPORT", {
|
|
34
|
-
entries: pkg.entryCount,
|
|
35
|
-
chars: pkg.transcriptChars,
|
|
36
|
-
truncated: pkg.truncatedInline,
|
|
37
|
-
});
|
|
38
|
-
console.log("file size", readFileSync(pkg.transcriptPath, "utf8").length);
|
|
39
|
-
console.log("priming includes path", pkg.priming.includes(pkg.transcriptPath));
|
|
40
|
-
rmSync(dir, { recursive: true, force: true });
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const codex = getImportSource("codex")!;
|
|
44
|
-
const cRunning = listRunningFromSource(codex);
|
|
45
|
-
if (cRunning[0]) {
|
|
46
|
-
const h = readForeignHistory(codex.format, codex.sessionsRoot, cRunning[0].sessionId);
|
|
47
|
-
console.log("codex first", cRunning[0].sessionId, "entries", h.length);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const claude = getImportSource("claude")!;
|
|
51
|
-
const files = existsSync(claude.sessionsRoot)
|
|
52
|
-
? readdirSync(claude.sessionsRoot).filter((f) => f.endsWith(".jsonl")).slice(0, 1)
|
|
53
|
-
: [];
|
|
54
|
-
if (files[0]) {
|
|
55
|
-
const id = files[0]!.replace(/\.jsonl$/, "");
|
|
56
|
-
const h = readForeignHistory(claude.format, claude.sessionsRoot, id);
|
|
57
|
-
console.log("claude sample", id, "entries", h.length);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const msgRoot = join(homedir(), ".local", "share", "opencode", "storage", "message");
|
|
61
|
-
if (existsSync(msgRoot)) {
|
|
62
|
-
const dirs = readdirSync(msgRoot).filter((d) => d.startsWith("ses_")).slice(0, 3);
|
|
63
|
-
for (const d of dirs) {
|
|
64
|
-
const h = readForeignHistory(
|
|
65
|
-
"opencode-storage",
|
|
66
|
-
join(homedir(), ".local", "share", "opencode"),
|
|
67
|
-
d,
|
|
68
|
-
);
|
|
69
|
-
console.log("opencode", d.slice(0, 24), "entries", h.length, h[0]?.role);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
console.log("OK");
|