@llblab/pi-telegram 0.27.11 → 0.28.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/AGENTS.md +150 -258
- package/BACKLOG.md +1 -169
- package/CHANGELOG.md +396 -441
- package/README.md +9 -6
- package/api/updates.ts +5 -0
- package/docs/architecture.md +71 -26
- package/docs/multi-instance-bus.md +23 -5
- package/docs/public-api.md +7 -6
- package/docs/ui-style.md +6 -6
- package/docs/updates.md +29 -11
- package/index.ts +356 -246
- package/lib/activity-verbosity.ts +26 -0
- package/lib/bindings.ts +240 -2
- package/lib/bus-follower.ts +436 -238
- package/lib/bus-leader.ts +395 -42
- package/lib/bus.ts +994 -153
- package/lib/commands.ts +184 -30
- package/lib/config.ts +23 -2
- package/lib/journal.ts +3140 -0
- package/lib/lifecycle.ts +4 -0
- package/lib/locks.ts +21 -21
- package/lib/media.ts +71 -32
- package/lib/menu-queue.ts +31 -17
- package/lib/menu.ts +5 -3
- package/lib/model.ts +51 -24
- package/lib/ownership.ts +42 -7
- package/lib/paths.ts +35 -0
- package/lib/polling.ts +591 -106
- package/lib/prompts.ts +17 -0
- package/lib/queue.ts +732 -143
- package/lib/routing.ts +291 -64
- package/lib/runtime.ts +26 -10
- package/lib/status.ts +257 -18
- package/lib/sync.ts +131 -5
- package/lib/telegram-api.ts +41 -11
- package/lib/text-groups.ts +75 -35
- package/lib/threads.ts +112 -4
- package/lib/turns.ts +79 -14
- package/lib/updates.ts +3771 -223
- package/package.json +3 -3
- package/scripts/check-downgrade.mjs +435 -0
package/lib/paths.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* from environment and runtime identity. It does not read config, manage
|
|
8
8
|
* state, or import broader Telegram domains.
|
|
9
9
|
*/
|
|
10
|
+
import { createHash } from "node:crypto";
|
|
10
11
|
import { homedir } from "node:os";
|
|
11
12
|
import { join, resolve } from "node:path";
|
|
12
13
|
|
|
@@ -86,6 +87,40 @@ export function getTelegramDiagnosticsDisplayPaths(profileName?: string): {
|
|
|
86
87
|
};
|
|
87
88
|
}
|
|
88
89
|
|
|
90
|
+
/** Durable inbound update journal (<agentDir>/tmp/telegram/inbox[.<profile>].json). */
|
|
91
|
+
export function resolveTelegramUpdateJournalPath(
|
|
92
|
+
agentDir = resolveAgentDir(),
|
|
93
|
+
profileName?: string,
|
|
94
|
+
): string {
|
|
95
|
+
return resolveTelegramProfileTempFilePath(
|
|
96
|
+
"inbox",
|
|
97
|
+
"json",
|
|
98
|
+
agentDir,
|
|
99
|
+
profileName,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Durable follower delivery journal, isolated by stable recipient binding. */
|
|
104
|
+
export function resolveTelegramFollowerJournalPath(
|
|
105
|
+
recipientBindingKey: string,
|
|
106
|
+
agentDir = resolveAgentDir(),
|
|
107
|
+
profileName?: string,
|
|
108
|
+
): string {
|
|
109
|
+
if (!recipientBindingKey) {
|
|
110
|
+
throw new Error("Telegram follower journal binding key is required.");
|
|
111
|
+
}
|
|
112
|
+
const bindingHash = createHash("sha256")
|
|
113
|
+
.update(recipientBindingKey)
|
|
114
|
+
.digest("hex")
|
|
115
|
+
.slice(0, 16);
|
|
116
|
+
return resolveTelegramProfileTempFilePath(
|
|
117
|
+
`follower-inbox-${bindingHash}`,
|
|
118
|
+
"json",
|
|
119
|
+
agentDir,
|
|
120
|
+
profileName,
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
89
124
|
/** Runtime event log (<agentDir>/tmp/telegram/logs.jsonl). */
|
|
90
125
|
export function resolveTelegramRuntimeLogPath(): string {
|
|
91
126
|
return resolveTelegramProfileTempFilePath("logs", "jsonl");
|