wherever-dev 0.21.1 → 0.22.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.
Files changed (103) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/assistant-channels.d.ts +242 -0
  3. package/dist/assistant-channels.d.ts.map +1 -0
  4. package/dist/assistant-channels.js +270 -0
  5. package/dist/assistant-channels.js.map +1 -0
  6. package/dist/assistant-controller.d.ts +228 -0
  7. package/dist/assistant-controller.d.ts.map +1 -0
  8. package/dist/assistant-controller.js +314 -0
  9. package/dist/assistant-controller.js.map +1 -0
  10. package/dist/assistant-cron.d.ts +87 -0
  11. package/dist/assistant-cron.d.ts.map +1 -0
  12. package/dist/assistant-cron.js +352 -0
  13. package/dist/assistant-cron.js.map +1 -0
  14. package/dist/assistant-folder.d.ts +161 -0
  15. package/dist/assistant-folder.d.ts.map +1 -0
  16. package/dist/assistant-folder.js +333 -0
  17. package/dist/assistant-folder.js.map +1 -0
  18. package/dist/assistant-schedule.d.ts +236 -0
  19. package/dist/assistant-schedule.d.ts.map +1 -0
  20. package/dist/assistant-schedule.js +454 -0
  21. package/dist/assistant-schedule.js.map +1 -0
  22. package/dist/assistant-scheduler.d.ts +210 -0
  23. package/dist/assistant-scheduler.d.ts.map +1 -0
  24. package/dist/assistant-scheduler.js +472 -0
  25. package/dist/assistant-scheduler.js.map +1 -0
  26. package/dist/assistant-tool-text.d.ts +40 -0
  27. package/dist/assistant-tool-text.d.ts.map +1 -0
  28. package/dist/assistant-tool-text.js +102 -0
  29. package/dist/assistant-tool-text.js.map +1 -0
  30. package/dist/assistant-tools.d.ts +222 -0
  31. package/dist/assistant-tools.d.ts.map +1 -0
  32. package/dist/assistant-tools.js +411 -0
  33. package/dist/assistant-tools.js.map +1 -0
  34. package/dist/cli-requests.d.ts +90 -0
  35. package/dist/cli-requests.d.ts.map +1 -0
  36. package/dist/cli-requests.js +75 -0
  37. package/dist/cli-requests.js.map +1 -0
  38. package/dist/index.js +427 -7
  39. package/dist/index.js.map +1 -1
  40. package/dist/protocol.d.ts +43 -0
  41. package/dist/protocol.d.ts.map +1 -1
  42. package/dist/reply-routing.d.ts +106 -0
  43. package/dist/reply-routing.d.ts.map +1 -0
  44. package/dist/reply-routing.js +174 -0
  45. package/dist/reply-routing.js.map +1 -0
  46. package/dist/session-pool.d.ts +235 -4
  47. package/dist/session-pool.d.ts.map +1 -1
  48. package/dist/session-pool.js +446 -100
  49. package/dist/session-pool.js.map +1 -1
  50. package/dist/telegram-channel.d.ts +275 -0
  51. package/dist/telegram-channel.d.ts.map +1 -0
  52. package/dist/telegram-channel.js +702 -0
  53. package/dist/telegram-channel.js.map +1 -0
  54. package/dist/telegram-files.d.ts +101 -0
  55. package/dist/telegram-files.d.ts.map +1 -0
  56. package/dist/telegram-files.js +145 -0
  57. package/dist/telegram-files.js.map +1 -0
  58. package/dist/telegram-pairing.d.ts +119 -0
  59. package/dist/telegram-pairing.d.ts.map +1 -0
  60. package/dist/telegram-pairing.js +97 -0
  61. package/dist/telegram-pairing.js.map +1 -0
  62. package/dist/telegram-replies.d.ts +140 -0
  63. package/dist/telegram-replies.d.ts.map +1 -0
  64. package/dist/telegram-replies.js +474 -0
  65. package/dist/telegram-replies.js.map +1 -0
  66. package/dist/telegram-token.d.ts +55 -0
  67. package/dist/telegram-token.d.ts.map +1 -0
  68. package/dist/telegram-token.js +86 -0
  69. package/dist/telegram-token.js.map +1 -0
  70. package/dist/web-push.d.ts +167 -0
  71. package/dist/web-push.d.ts.map +1 -0
  72. package/dist/web-push.js +387 -0
  73. package/dist/web-push.js.map +1 -0
  74. package/package.json +1 -1
  75. package/public/_app/immutable/assets/0.hWfYEET-.css +1 -0
  76. package/public/_app/immutable/chunks/Cuh9gHb6.js +2 -0
  77. package/public/_app/immutable/chunks/Cuh9gHb6.js.map +1 -0
  78. package/public/_app/immutable/chunks/DEUwJYqt.js +2 -0
  79. package/public/_app/immutable/chunks/{BQ9B_G4h.js.map → DEUwJYqt.js.map} +1 -1
  80. package/public/_app/immutable/chunks/DSPDB3Gw.js +2 -0
  81. package/public/_app/immutable/chunks/{BUONgvl4.js.map → DSPDB3Gw.js.map} +1 -1
  82. package/public/_app/immutable/entry/{app.BZO7Xckk.js → app.BkV4f8p8.js} +3 -3
  83. package/public/_app/immutable/entry/{app.BZO7Xckk.js.map → app.BkV4f8p8.js.map} +1 -1
  84. package/public/_app/immutable/entry/start.D5TsAoxn.js +2 -0
  85. package/public/_app/immutable/entry/start.D5TsAoxn.js.map +1 -0
  86. package/public/_app/immutable/nodes/{0.Czz2XmZU.js → 0.DR4K9Ylw.js} +3 -3
  87. package/public/_app/immutable/nodes/{0.Czz2XmZU.js.map → 0.DR4K9Ylw.js.map} +1 -1
  88. package/public/_app/immutable/nodes/{1.DDvrriUW.js → 1.DdqkeKC4.js} +2 -2
  89. package/public/_app/immutable/nodes/{1.DDvrriUW.js.map → 1.DdqkeKC4.js.map} +1 -1
  90. package/public/_app/immutable/nodes/2.n5lfdeec.js +122 -0
  91. package/public/_app/immutable/nodes/2.n5lfdeec.js.map +1 -0
  92. package/public/_app/version.json +1 -1
  93. package/public/index.html +11 -11
  94. package/public/service-worker.js +1 -1
  95. package/public/_app/immutable/assets/0.BKJ49K71.css +0 -1
  96. package/public/_app/immutable/chunks/BQ9B_G4h.js +0 -2
  97. package/public/_app/immutable/chunks/BUONgvl4.js +0 -2
  98. package/public/_app/immutable/chunks/DauELski.js +0 -2
  99. package/public/_app/immutable/chunks/DauELski.js.map +0 -1
  100. package/public/_app/immutable/entry/start.DWD60uNu.js +0 -2
  101. package/public/_app/immutable/entry/start.DWD60uNu.js.map +0 -1
  102. package/public/_app/immutable/nodes/2.C7E8EMKX.js +0 -120
  103. package/public/_app/immutable/nodes/2.C7E8EMKX.js.map +0 -1
@@ -0,0 +1,275 @@
1
+ import type { AssistantChannel, ChannelContext, ChannelDroppedReport, ChannelNotification, ChannelNotifyResult, ChannelReply } from './assistant-channels.js';
2
+ import { type TelegramToolCalls } from './telegram-replies.js';
3
+ /**
4
+ * The assistant's TELEGRAM channel: the secure base (task
5
+ * `telegram-token-and-pairing`: token, polling, pairing) and the CONVERSATION
6
+ * (task `telegram-conversation`):
7
+ *
8
+ * - INBOUND, from the paired user only (telegram-pairing.ts): `stop` / `/stop`
9
+ * aborts the running turn; `/new` / `/reset` reset the assistant (the
10
+ * controller's reset, never sent to pi); `!` / `!!` text is refused with an
11
+ * explanation (it never reaches the pool's shell path); anything else,
12
+ * including other `/` text such as `/skill:`, goes to the controller
13
+ * untouched (the origin `telegram` rides the pool's routing queue, never a
14
+ * text prefix). Into a running turn it STEERS (ADR 0003), shown by a
15
+ * `STEER_REACTION` on the user's message, or, when reactions are refused,
16
+ * the short `STEER_NOTE`. Each message is handled once it is DISPATCHED
17
+ * (not when its turn ends), so messages keep their order and polling goes on.
18
+ * - REPLIES: output whose current destination is `telegram` (ADR 0014), from
19
+ * the dispatcher, streamed and split by telegram-replies.ts.
20
+ * - NOTIFY (`assistant_notify`): its OWN message `🔔 <source>: <title>`, the
21
+ * body below, then a link to the target session when `publicUrl` is
22
+ * configured; sent at once, even mid-reply, never folded into a reply.
23
+ * - DROPPED messages (a reset, an aborted settle): reported back as a list.
24
+ * - FILES (task `telegram-files`, telegram-files.ts): a photo or a document
25
+ * (an ALBUM is its messages gathered for `mediaGroupDelayMs`, then handled as
26
+ * one message) is downloaded into the upload dir and reaches the assistant as
27
+ * paths in the text, as a web upload does; its caption is the text. An
28
+ * `attach_file` in a Telegram-routed reply sends the file back.
29
+ *
30
+ * Bot API LONG POLLING (`getUpdates` with a server-side `timeout`), the
31
+ * mechanics ported from the MIT `badlogic/pi-telegram` extension, but NOT its
32
+ * pairing (it pairs whoever sends the first `/start`): pairing is the one-time
33
+ * code of telegram-pairing.ts.
34
+ *
35
+ * State, in the STATE dir (ADR 0006), mode 0600, atomic tmp + rename:
36
+ * - `assistant-telegram-offset.json` `{botId, offset}`: the next `getUpdates`
37
+ * offset, written after EACH handled update, so a restart neither replays
38
+ * (Telegram drops everything below the offset) nor loses an update (a crash
39
+ * between handling and writing replays at most that one). It is bound to the
40
+ * bot id (the token's numeric prefix): update ids are per bot, so an offset
41
+ * left by another bot is ignored rather than used to skip the new bot's updates.
42
+ * - `assistant-telegram-pairing.json`: the paired user (`PairedUser`).
43
+ * The one-time code lives in memory only (a restart issues a new one), so an
44
+ * unpaired channel writes nothing until someone pairs.
45
+ *
46
+ * Built only while the assistant is ACTIVE (configured AND this server holds the
47
+ * folder lock: two servers must never poll the same bot) AND
48
+ * `assistantTelegram.enabled` is true AND a token resolved (telegram-token.ts);
49
+ * see `server/src/index.ts`.
50
+ *
51
+ * Failure handling: a 401 / 404 from the Bot API means the token is wrong; the
52
+ * channel stops polling and reports `error` (a restart with a fixed token is the
53
+ * cure). Any other failure (network, 409 another poller or a webhook, 429, 5xx)
54
+ * is logged and retried with backoff (honouring `retry_after`).
55
+ */
56
+ export declare const TELEGRAM_CHANNEL = "telegram";
57
+ export declare const TELEGRAM_OFFSET_FILE = "assistant-telegram-offset.json";
58
+ export declare const TELEGRAM_PAIRING_FILE = "assistant-telegram-pairing.json";
59
+ export declare const TELEGRAM_API_BASE = "https://api.telegram.org";
60
+ /**
61
+ * The HTTP boundary (the global `fetch` by default; mocked in tests): JSON
62
+ * calls, multipart file sends (a `FormData` body) and file downloads (`GET`).
63
+ */
64
+ export type TelegramFetch = (url: string, init: {
65
+ method: 'POST' | 'GET';
66
+ headers?: Record<string, string>;
67
+ body?: string | FormData;
68
+ signal?: AbortSignal;
69
+ }) => Promise<{
70
+ status: number;
71
+ json(): Promise<unknown>;
72
+ arrayBuffer?(): Promise<ArrayBuffer>;
73
+ }>;
74
+ /** The slice of a Bot API `Update` this channel reads. */
75
+ export interface TelegramUpdate {
76
+ update_id: number;
77
+ message?: TelegramMessage;
78
+ }
79
+ /** The slice of a Bot API `Message` this channel reads. */
80
+ export interface TelegramMessage {
81
+ message_id: number;
82
+ from?: {
83
+ id: number;
84
+ is_bot?: boolean;
85
+ username?: string;
86
+ first_name?: string;
87
+ };
88
+ chat: {
89
+ id: number;
90
+ type: string;
91
+ };
92
+ text?: string;
93
+ caption?: string;
94
+ media_group_id?: string;
95
+ photo?: Array<{
96
+ file_id: string;
97
+ file_size?: number;
98
+ width?: number;
99
+ height?: number;
100
+ }>;
101
+ document?: {
102
+ file_id: string;
103
+ file_name?: string;
104
+ mime_type?: string;
105
+ file_size?: number;
106
+ };
107
+ [k: string]: unknown;
108
+ }
109
+ /** How long an album's messages are gathered before it is handled (pi-telegram's 1200 ms). */
110
+ export declare const MEDIA_GROUP_DELAY_MS = 1200;
111
+ /** What the web shows (`GET /config` `assistant.telegram`, beside `enabled`). */
112
+ export type TelegramChannelStatus = {
113
+ state: 'starting';
114
+ bot: string | null;
115
+ error?: string;
116
+ } | {
117
+ state: 'unpaired';
118
+ code: string | null;
119
+ bot: string | null;
120
+ error?: string;
121
+ } | {
122
+ state: 'paired';
123
+ user: {
124
+ id: string;
125
+ name?: string;
126
+ source: 'config' | 'pairing';
127
+ };
128
+ bot: string | null;
129
+ error?: string;
130
+ } | {
131
+ state: 'error';
132
+ error: string;
133
+ bot: string | null;
134
+ };
135
+ export interface TelegramChannelOptions {
136
+ token: string;
137
+ stateDir: string;
138
+ /** `assistantTelegram.userId`, normalized (wins over a stored pairing). */
139
+ configuredUserId: string | null;
140
+ /** The Bot API base URL (`assistantTelegram.apiBaseUrl`; a local Bot API server, or a mock). */
141
+ apiBaseUrl?: string;
142
+ fetch?: TelegramFetch;
143
+ /** `getUpdates` server-side timeout, seconds (default 30). */
144
+ pollTimeoutSeconds?: number;
145
+ /** Delay before retry number `attempt` (1-based), ms. Default: 1 s doubling to 60 s. */
146
+ retryDelayMs?: (attempt: number) => number;
147
+ /** Called whenever the status changes (paired, re-paired, error). */
148
+ onChange?: () => void;
149
+ newCode?: () => string;
150
+ /** The wherever public URL (`publicUrl`): a notification links to `<publicUrl>/#<sessionId>`. */
151
+ publicUrl?: string;
152
+ /** Reply preview throttle, ms (default 750; tests use 0). */
153
+ replyThrottleMs?: number;
154
+ /** `assistantTelegram.toolCalls`: `off` (default, a tool call sends nothing) or `compact` (one silent line per call). */
155
+ toolCalls?: TelegramToolCalls;
156
+ /**
157
+ * Where a file from Telegram is saved: the upload dir a web upload of the
158
+ * assistant session lands in (index.ts: `resolveUploadDir(config, folder)`).
159
+ * Unset: files are refused with `FILES_UNAVAILABLE_REPLY`.
160
+ */
161
+ uploadDir?: () => string;
162
+ /** The upload size limit (`uploads.maxBytes`); a file over it, or over Telegram's 20 MB, is refused with a note. */
163
+ maxUploadBytes?: () => number;
164
+ /** How long an album is gathered, ms (default `MEDIA_GROUP_DELAY_MS`). */
165
+ mediaGroupDelayMs?: number;
166
+ log?: Pick<Console, 'log' | 'warn' | 'error'>;
167
+ }
168
+ /** The reaction marking a message that STEERED the running turn (one of Telegram's allowed reaction emoji). */
169
+ export declare const STEER_REACTION = "\u270D";
170
+ /** The fallback when the reaction is refused. */
171
+ export declare const STEER_NOTE = "\u21AA\uFE0F Added to the current reply.";
172
+ export declare const SHELL_REFUSAL_REPLY = "Shell commands (\"!\" or \"!!\") cannot be run from Telegram. Ask the assistant in words instead, and it can run what is needed itself.";
173
+ export declare const RESET_REPLY = "\uD83C\uDD95 Started a fresh assistant session. What it wrote down in its folder is kept.";
174
+ export declare const STOPPED_REPLY = "\u23F9 Stopped the current reply.";
175
+ export declare const NOTHING_RUNNING_REPLY = "Nothing is running.";
176
+ /** The `🔔` notification text (an `assistant_notify`), before splitting. */
177
+ export declare function formatTelegramNotification(n: ChannelNotification, publicUrl?: string): string;
178
+ /** `<publicUrl>/#<sessionId>`, or null without a usable http(s) public URL. */
179
+ export declare function sessionLink(publicUrl: string | undefined, sessionId: string): string | null;
180
+ /** The report of messages a reset or an aborted settle dropped, before splitting. */
181
+ export declare function formatDroppedReport(report: ChannelDroppedReport): string;
182
+ export declare class TelegramChannel implements AssistantChannel {
183
+ readonly name = "telegram";
184
+ private readonly token;
185
+ private readonly botId;
186
+ private readonly apiBase;
187
+ private readonly fetchImpl;
188
+ private readonly pollTimeout;
189
+ private readonly retryDelay;
190
+ private readonly offsetPath;
191
+ private readonly pairingPath;
192
+ private readonly newCode;
193
+ private readonly onChange;
194
+ private readonly log;
195
+ private readonly configuredUserId;
196
+ private pairing;
197
+ private offset;
198
+ private bot;
199
+ private fatalError;
200
+ private lastError;
201
+ private started;
202
+ private ctx;
203
+ private abort;
204
+ private loopDone;
205
+ private readonly publicUrl;
206
+ private readonly replies;
207
+ private readonly uploadDir;
208
+ private readonly maxUploadBytes;
209
+ private readonly mediaGroupDelayMs;
210
+ /** Albums being gathered, by `media_group_id`. */
211
+ private readonly groups;
212
+ /** Every inbound message is handled through this one chain (an album's timer and the polling loop never interleave). */
213
+ private inbound;
214
+ constructor(opts: TelegramChannelOptions);
215
+ /** Load the stored pairing and offset, then start polling (not awaited). */
216
+ start(ctx: ChannelContext): void;
217
+ stop(): Promise<void>;
218
+ status(): TelegramChannelStatus;
219
+ /** The paired user's chat (null while unpaired), for `telegram-conversation`. */
220
+ pairedChatId(): string | null;
221
+ /**
222
+ * The web's RE-PAIR: forget the stored pairing (the file is removed) and
223
+ * issue a new code. Refused while the user id comes from the config.
224
+ */
225
+ repair(): {
226
+ ok: true;
227
+ } | {
228
+ ok: false;
229
+ error: string;
230
+ };
231
+ /** Output answering a Telegram message (its destination is `telegram`): streamed to the paired chat. */
232
+ deliverReply(reply: ChannelReply): void;
233
+ /** Resolves once every pending reply preview and send has run (tests). */
234
+ replyIdle(): Promise<void>;
235
+ /** Resolves once every gathered album and inbound message has been handled (tests). */
236
+ inboundIdle(): Promise<void>;
237
+ /** `assistant_notify`: its own `🔔` message, sent now (never waits for, or joins, a reply). */
238
+ notify(n: ChannelNotification): Promise<ChannelNotifyResult>;
239
+ /** Messages from Telegram that a reset or an aborted settle dropped: listed back to the user. */
240
+ reportDropped(report: ChannelDroppedReport): Promise<void>;
241
+ /** One Bot API call; resolves `result`, throws `BotApiError` on `ok: false`. */
242
+ call<T>(method: string, params: Record<string, unknown>, signal?: AbortSignal): Promise<T>;
243
+ /** A multipart Bot API call sending the local `filePath` as `fileField`. */
244
+ callMultipart<T>(method: string, fields: Record<string, string>, fileField: string, filePath: string, fileName: string): Promise<T>;
245
+ private answer;
246
+ private run;
247
+ /** Log a failed call; false = stop polling (fatal), true = retried after the backoff. */
248
+ private failed;
249
+ private handle;
250
+ /** Run `fn` after every inbound message before it has been handled. */
251
+ private serial;
252
+ /** Add an album message; the album is handled `mediaGroupDelayMs` after its LAST message. */
253
+ private gather;
254
+ private flushGroup;
255
+ /**
256
+ * The paired user's message (one, or an album's): a command, a refusal, or a
257
+ * message for the assistant, with its files downloaded into the upload dir.
258
+ */
259
+ private converse;
260
+ /**
261
+ * Fetch one file from Telegram (`getFile`, then its download URL) into `dir`.
262
+ * Refused, with a note for the user, over the upload limit (`maxUploadBytes`,
263
+ * capped at Telegram's 20 MB), before downloading when Telegram announced the
264
+ * size and after it otherwise.
265
+ */
266
+ private download;
267
+ /** Show that a message steered the running turn: a reaction, else a short note replying to it. */
268
+ private markSteer;
269
+ private reply;
270
+ private readOffset;
271
+ private writeOffset;
272
+ private readPairing;
273
+ private writePairing;
274
+ }
275
+ //# sourceMappingURL=telegram-channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telegram-channel.d.ts","sourceRoot":"","sources":["../src/telegram-channel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACb,MAAM,yBAAyB,CAAC;AAYjC,OAAO,EAAsC,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAcnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAC3C,eAAO,MAAM,oBAAoB,mCAAmC,CAAC;AACr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