@ours.network/tg-connector 0.5.0 → 0.5.1-nightly.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 +55 -145
- package/dist/cli.js +91 -117
- package/dist/connector.js +1518 -2566
- package/docs/voice-message-contract.md +8 -2
- package/package.json +4 -5
- package/dist/mufl_code/ED9CAFA60E1A0884E2CBC8E71BA8A137488A14763C57587D25AEC4BAD7F58C81.muflo +0 -0
- package/dist/mufl_code/actor.mu +0 -1937
- package/dist/mufl_code/config.mufl +0 -27
- package/dist/mufl_code/core/COMMERCIAL-LICENCE.md +0 -25
- package/dist/mufl_code/core/COMPATIBILITY.md +0 -221
- package/dist/mufl_code/core/CONTRIBUTING.md +0 -37
- package/dist/mufl_code/core/LICENSE +0 -98
- package/dist/mufl_code/core/NOTIFICATIONS_CONTRACT.md +0 -290
- package/dist/mufl_code/core/README.md +0 -91
- package/dist/mufl_code/core/SECURITY.md +0 -40
- package/dist/mufl_code/core/TRADEMARKS.md +0 -24
- package/dist/mufl_code/core/a2a_capabilities.mm +0 -449
- package/dist/mufl_code/core/a2a_cluster.mm +0 -601
- package/dist/mufl_code/core/a2a_control.mm +0 -90
- package/dist/mufl_code/core/a2a_messaging.mm +0 -4817
- package/dist/mufl_code/core/a2a_monitoring.mm +0 -94
- package/dist/mufl_code/core/a2a_notification_integration.mm +0 -144
- package/dist/mufl_code/core/a2a_notifications.mm +0 -1127
- package/dist/mufl_code/core/a2a_protocol.mm +0 -246
- package/dist/mufl_code/core/a2a_versions.mm +0 -801
- package/dist/mufl_code/core/config.mufl +0 -29
- package/dist/mufl_code/core/docs/.vitepress/config.mts +0 -58
- package/dist/mufl_code/core/docs/citations.json +0 -688
- package/dist/mufl_code/core/docs/guide/01-vendor-the-core.md +0 -50
- package/dist/mufl_code/core/docs/guide/02-configure-and-compile.md +0 -100
- package/dist/mufl_code/core/docs/guide/03-wire-the-host.md +0 -154
- package/dist/mufl_code/core/docs/guide/04-connect-and-message.md +0 -156
- package/dist/mufl_code/core/docs/guide/05-test-your-app.md +0 -75
- package/dist/mufl_code/core/docs/guide/index.md +0 -63
- package/dist/mufl_code/core/docs/how-it-works/capabilities-and-control.md +0 -77
- package/dist/mufl_code/core/docs/how-it-works/cluster.md +0 -65
- package/dist/mufl_code/core/docs/how-it-works/identity.md +0 -56
- package/dist/mufl_code/core/docs/how-it-works/invites-and-contacts.md +0 -76
- package/dist/mufl_code/core/docs/how-it-works/messaging.md +0 -55
- package/dist/mufl_code/core/docs/how-it-works/monitoring-and-config.md +0 -72
- package/dist/mufl_code/core/docs/how-it-works/overview.md +0 -45
- package/dist/mufl_code/core/docs/how-it-works/versioning.md +0 -116
- package/dist/mufl_code/core/docs/index.md +0 -27
- package/dist/mufl_code/core/docs/package-lock.json +0 -3467
- package/dist/mufl_code/core/docs/package.json +0 -15
- package/dist/mufl_code/core/docs/reference/contributing.md +0 -26
- package/dist/mufl_code/core/docs/reference/glossary.md +0 -108
- package/dist/mufl_code/core/docs/reference/implementations.md +0 -23
- package/dist/mufl_code/core/docs/reference/modules.md +0 -19
- package/dist/mufl_code/core/docs/scripts/check-citations.mjs +0 -36
- package/dist/mufl_code/core/docs/scripts/check-denylist.mjs +0 -30
- package/dist/mufl_code/core/docs/scripts/gen-llms.mjs +0 -32
- package/dist/mufl_code/core/docs/workflows/cluster.md +0 -89
- package/dist/mufl_code/core/docs/workflows/contact-exchange.md +0 -60
- package/dist/mufl_code/core/docs/workflows/contact-restore.md +0 -60
- package/dist/mufl_code/core/docs/workflows/control-verbs.md +0 -70
- package/dist/mufl_code/core/docs/workflows/index.md +0 -57
- package/dist/mufl_code/core/docs/workflows/introductions.md +0 -60
- package/dist/mufl_code/core/docs/workflows/messaging.md +0 -75
- package/dist/mufl_code/core/docs/workflows/monitoring.md +0 -84
- package/dist/mufl_code/core/docs/workflows/notifications.md +0 -109
- package/dist/mufl_code/core/release-notes/0.1.md +0 -60
- package/dist/mufl_code/core/release-notes/0.3.md +0 -22
- package/dist/mufl_code/core/release-notes/0.4.md +0 -97
- package/dist/mufl_code/core/tests/README.md +0 -83
- package/dist/mufl_code/core/tests/compat/README.md +0 -82
- package/dist/mufl_code/core/tests/compat/compat.mjs +0 -245
- package/dist/mufl_code/core/tests/compat/compat_peer.mjs +0 -146
- package/dist/mufl_code/core/tests/compat/run_compat.sh +0 -96
- package/dist/mufl_code/core/tests/corpus.mjs +0 -139
- package/dist/mufl_code/core/tests/corpus_actor.mu +0 -242
- package/dist/mufl_code/core/tests/fatcompile_actor.mu +0 -52
- package/dist/mufl_code/core/tests/mig.mjs +0 -805
- package/dist/mufl_code/core/tests/mig_actor.mu +0 -518
- package/dist/mufl_code/core/tests/migapp.mjs +0 -431
- package/dist/mufl_code/core/tests/migapp_actor.mu +0 -294
- package/dist/mufl_code/core/tests/mufl_semantics/run.sh +0 -69
- package/dist/mufl_code/core/tests/mufl_semantics/t11_three_version.mufl +0 -47
- package/dist/mufl_code/core/tests/mufl_semantics/t2_extra_fields.mufl +0 -11
- package/dist/mufl_code/core/tests/mufl_semantics/t7_runtime.mufl +0 -30
- package/dist/mufl_code/core/tests/mufl_semantics/t9_passthrough.mufl +0 -19
- package/dist/mufl_code/core/tests/mufl_semantics/t_str_order.mufl +0 -19
- package/dist/mufl_code/core/tests/notif.mjs +0 -755
- package/dist/mufl_code/core/tests/notif_actor.mu +0 -450
- package/dist/mufl_code/core/tests/protocol_container.mm +0 -18
- package/dist/mufl_code/core/tests/run.sh +0 -65
- package/dist/mufl_code/core/tests/run_corpus.sh +0 -51
- package/dist/mufl_code/core/tests/run_fatcompile.sh +0 -40
- package/dist/mufl_code/core/tests/run_mig.sh +0 -51
- package/dist/mufl_code/core/tests/run_migapp.sh +0 -51
- package/dist/mufl_code/core/tests/run_notif.sh +0 -57
- package/dist/mufl_code/core/tests/test.mjs +0 -750
- package/dist/mufl_code/core/tests/test_actor.mu +0 -564
- package/dist/mufl_code/core/tests/test_common.mjs +0 -93
- package/dist/mufl_code/core/version.mm +0 -24
- package/dist/mufl_code/protocol_container.mm +0 -18
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ loop.
|
|
|
12
12
|
chat B ─┤ Telegram │ (demux by chat-key) │
|
|
13
13
|
topic#7 ┘ └──┬──────────┬──────────┬───────┘
|
|
14
14
|
▼ ▼ ▼
|
|
15
|
-
identity A identity B identity C ←
|
|
15
|
+
identity A identity B identity C ← daemon identity per chat-key
|
|
16
16
|
│ │ │ send_message
|
|
17
17
|
▼ ▼ ▼
|
|
18
18
|
Agent X Agent X Agent Y ← same agent can serve many
|
|
@@ -24,7 +24,7 @@ Two layers:
|
|
|
24
24
|
(`add_bot`). One token == one `getUpdates` poll loop (Telegram allows only one
|
|
25
25
|
consumer per token). The loop demultiplexes each update to a route by **chat-key**
|
|
26
26
|
(`chatId`, or `chatId:threadId` for a forum topic).
|
|
27
|
-
- **Route** — one
|
|
27
|
+
- **Route** — one ours identity in the shared daemon pinned to one chat-key,
|
|
28
28
|
bridged to one proxy agent. A route **references its bot by name**, so the token
|
|
29
29
|
lives in exactly one place; many routes share a bot. The invite a route emits is
|
|
30
30
|
byte-compatible with the ours `add_contact` tool.
|
|
@@ -47,7 +47,7 @@ customers; escalate refunds to a human").
|
|
|
47
47
|
context). The connector mints a fresh identity, sets its name + bio, and prints
|
|
48
48
|
an **invite blob**.
|
|
49
49
|
3. You paste that blob into your proxy agent via its `add_contact`. The connector
|
|
50
|
-
|
|
50
|
+
route identity — already live through the daemon — completes the encrypted-channel handshake.
|
|
51
51
|
4. From then on:
|
|
52
52
|
- every message in that chat/topic is forwarded to its agent as a JSON
|
|
53
53
|
**message envelope** (sender + chat metadata, reply/forward context, and any
|
|
@@ -67,11 +67,13 @@ both modes; Telegram voice notes retain the protocol MIME marker
|
|
|
67
67
|
`audio/ogg; x-ours-kind=voice-message`, allowing the receiving daemon to invoke
|
|
68
68
|
its native voice-transcription path even when no companion text is sent.
|
|
69
69
|
|
|
70
|
-
Messages are end-to-end encrypted between the connector
|
|
70
|
+
Messages are end-to-end encrypted between the connector's route identity and the agent (ADAPT
|
|
71
71
|
encrypted channels). The connector never persists message bodies to disk — only the
|
|
72
|
-
bot registry (`bot name`, `token`, `@username`)
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
bot registry (`bot name`, `token`, `@username`) and route metadata (`bot name`,
|
|
73
|
+
`chat id`, `thread id`, `bio`, `peer cid`, and stable daemon lease). Those
|
|
74
|
+
persisted route names are also the connector's simple list of identities it
|
|
75
|
+
created. The list is organizational bookkeeping, not an authorization or
|
|
76
|
+
provenance boundary; identity keys and packet state stay in the shared daemon.
|
|
75
77
|
|
|
76
78
|
### Routing rules
|
|
77
79
|
|
|
@@ -109,102 +111,6 @@ In a **privacy-mode** group only the `/id@<bot_username>` form is delivered (see
|
|
|
109
111
|
note above); in DMs and privacy-off groups bare `/id` works too. In a group with
|
|
110
112
|
several bots, only the one named in `/id@<bot_username>` answers.
|
|
111
113
|
|
|
112
|
-
### Reply threading
|
|
113
|
-
|
|
114
|
-
An agent's answer can arrive in Telegram **as a reply to the message that prompted
|
|
115
|
-
it**, so a busy group chat stays readable. The mechanism is one mapping:
|
|
116
|
-
|
|
117
|
-
1. an inbound Telegram message is sent to the agent as ours `wire_id` **W**, and the
|
|
118
|
-
route records `W → (chat id, message id)` in `messages.json` in its state dir;
|
|
119
|
-
2. the agent answers with `reply_to_wire_id = W` (the `send_message` tool already
|
|
120
|
-
supports it);
|
|
121
|
-
3. the connector resolves **W** back to that Telegram message and sends with
|
|
122
|
-
`reply_parameters.message_id`.
|
|
123
|
-
|
|
124
|
-
**It only works when the agent fills `reply_to_wire_id`.** An agent that does not
|
|
125
|
-
gets ordinary un-threaded messages — that is a property of the sender, not a
|
|
126
|
-
connector fault, so it is worth putting in the persona of any role that writes to
|
|
127
|
-
Telegram. If a pointer resolves to nothing (never mapped, or older than the 30-day
|
|
128
|
-
retention below) the message is delivered **plain**; a "similar" or most-recent
|
|
129
|
-
message is never substituted.
|
|
130
|
-
|
|
131
|
-
The map is persistent (it survives a daemon restart), holds **no message content** —
|
|
132
|
-
only chat/message ids, the contact id and the receipt state — and is pruned at
|
|
133
|
-
**30 days** / 2000 rows per route, oldest first.
|
|
134
|
-
|
|
135
|
-
### Delivery & read receipts as reactions
|
|
136
|
-
|
|
137
|
-
When the agent's node confirms a message, the connector puts a **reaction** on the
|
|
138
|
-
originating Telegram message: 👀 when it was **delivered**, then 👌 once the agent
|
|
139
|
-
has **read** it (its `get` path). Because a bot may hold **at most one reaction per
|
|
140
|
-
message**, read *replaces* delivered rather than sitting beside it.
|
|
141
|
-
|
|
142
|
-
The confirmations themselves are core 0.7.0 receipts, not something the connector
|
|
143
|
-
invents: emission is gated on both sides' `core.receipts.*` capabilities (the
|
|
144
|
-
connector declares `emit` and `receive`), and application is **monotonic** per
|
|
145
|
-
(peer, message) over `unknown < sent < delivered < read` — a duplicate or
|
|
146
|
-
out-of-order receipt changes nothing. Receipts are **best-effort UX**: a missing
|
|
147
|
-
reaction does **not** mean the message failed to arrive, and a Telegram refusal on a
|
|
148
|
-
reaction (reactions disabled in the chat, message deleted) is logged and never
|
|
149
|
-
affects message delivery.
|
|
150
|
-
|
|
151
|
-
> **The agent side has to emit them.** A peer only sends receipts if *it* advertises
|
|
152
|
-
> `core.receipts.emit`. Against an agent node that does not, the reactions simply
|
|
153
|
-
> never appear — everything else keeps working.
|
|
154
|
-
|
|
155
|
-
Per **connection** (not per bot — `/receipts off` on one route leaves the others
|
|
156
|
-
alone), in the route's own chat:
|
|
157
|
-
|
|
158
|
-
```
|
|
159
|
-
/receipts on # turn delivery/read reactions on for this connection
|
|
160
|
-
/receipts off # …and off
|
|
161
|
-
/receipts status # show the current setting and emoji
|
|
162
|
-
/emoji delivered <e> # set the "delivered" reaction
|
|
163
|
-
/emoji read <e> # set the "read" reaction
|
|
164
|
-
/emoji reset # back to 👀 / 👌
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
Commands are parsed **in connector code**, never passed to the agent, and are
|
|
168
|
-
answered in the chat. An emoji is validated against Telegram's fixed
|
|
169
|
-
bot-reaction list **before** it is saved, with the valid set in the error —
|
|
170
|
-
note that ✅ is *not* on that list, which is why the `read` default is 👌.
|
|
171
|
-
|
|
172
|
-
### `/help` and the slash menu
|
|
173
|
-
|
|
174
|
-
**`/help`** is answered by the connector itself: it lists the commands the
|
|
175
|
-
connector owns (`/help`, `/id`, `/receipts`, `/emoji`) and the current receipt
|
|
176
|
-
settings for that connection. It works in a chat with no route yet too — you get
|
|
177
|
-
the command list and a pointer to `/id`.
|
|
178
|
-
|
|
179
|
-
The same list is registered with Telegram via `setMyCommands` at **default
|
|
180
|
-
scope** when a bot starts polling, so a client offers the commands in its slash
|
|
181
|
-
menu as you type. Registration is cosmetic and best-effort: if it fails it is
|
|
182
|
-
logged, and every command still works when typed by hand.
|
|
183
|
-
|
|
184
|
-
> **Only these four commands are intercepted.** Everything else you send is
|
|
185
|
-
> relayed to the agent exactly as typed, *including* text that starts with a
|
|
186
|
-
> slash — `/deploy prod` reaches the agent, and so does `/help me write the
|
|
187
|
-
> release note`, because only a **bare** `/help` is treated as the command.
|
|
188
|
-
|
|
189
|
-
### Message formatting
|
|
190
|
-
|
|
191
|
-
Formatting is preserved **in both directions**.
|
|
192
|
-
|
|
193
|
-
- **Telegram → agent.** A message's `entities` / `caption_entities` (bold, italic,
|
|
194
|
-
underline, strikethrough, spoiler, code, `pre` with its language, blockquote,
|
|
195
|
-
links and mentions) are folded into **Markdown** in the message text, so the
|
|
196
|
-
agent reads the formatting instead of losing it. Offsets are UTF-16 code units
|
|
197
|
-
and are treated as such. A `custom_emoji` is premium-only and degrades to the
|
|
198
|
-
stand-in glyph Telegram already put in the text. A message with no entities is
|
|
199
|
-
passed through byte-for-byte.
|
|
200
|
-
- **Agent → Telegram.** The agent's Markdown is rendered as `MarkdownV2`, escaping
|
|
201
|
-
the **text leaves only** (all 18 reserved characters — one unescaped `.` would
|
|
202
|
-
fail the whole send). Emphasis is deliberately conservative: `foo_bar_baz` and
|
|
203
|
-
`2*3*4` stay literal. The 4096-character limit is applied to the **escaped**
|
|
204
|
-
text. **If Telegram rejects the markup, the same text is resent with no
|
|
205
|
-
`parse_mode`** and the original refusal is logged — the message always wins over
|
|
206
|
-
its styling.
|
|
207
|
-
|
|
208
114
|
### Message envelope
|
|
209
115
|
|
|
210
116
|
Each inbound Telegram message is forwarded to the agent as a single **JSON
|
|
@@ -259,7 +165,7 @@ distinct from `send_message`, so files and text are always separate messages.
|
|
|
259
165
|
read files from the file channel and correlate by `attachment.wire_id`** — an
|
|
260
166
|
agent that still expects inline base64 will not see the bytes.
|
|
261
167
|
- **Outbound (agent → Telegram).** A file the agent sends arrives via
|
|
262
|
-
`receive_file`, is stored in the
|
|
168
|
+
`receive_file`, is stored in the daemon identity's file inbox (same unread → processed →
|
|
263
169
|
gc lifecycle as messages, bytes included), and is delivered to the chat (and
|
|
264
170
|
forum topic, if pinned) with Telegram **`sendDocument`** — preserving the
|
|
265
171
|
original filename. Agent → Telegram file sending was previously unsupported.
|
|
@@ -296,8 +202,15 @@ added for provenance:
|
|
|
296
202
|
}
|
|
297
203
|
```
|
|
298
204
|
|
|
299
|
-
- **Opt-in
|
|
300
|
-
|
|
205
|
+
- **Opt-in, and it covers THIS PROCESS ONLY.** Off by default
|
|
206
|
+
(`sttEnabled:false`), which means *the connector* sends no audio to a
|
|
207
|
+
speech-to-text provider. It does **not** mean the audio is never transcribed:
|
|
208
|
+
the connector is a client of an ours daemon, and **the daemon runs its own
|
|
209
|
+
speech-to-text** when the receiving side pulls a voice note — under
|
|
210
|
+
configuration this connector's operator does not control and may not know
|
|
211
|
+
exists. When the connector was its own host, `sttEnabled:false` did cover the
|
|
212
|
+
whole path; attached, it no longer can. Turn it on and supply a key to
|
|
213
|
+
transcribe here as well (see [Configuration](#configuration)).
|
|
301
214
|
- **No transcoding.** Telegram voice is **OGG/Opus**, which OpenAI-compatible
|
|
302
215
|
transcription endpoints accept directly — the connector adds **no ffmpeg** and no
|
|
303
216
|
new dependency (just built-in `fetch`).
|
|
@@ -351,9 +264,11 @@ npm install
|
|
|
351
264
|
npm run build
|
|
352
265
|
```
|
|
353
266
|
|
|
354
|
-
Requires Node ≥ 20
|
|
355
|
-
|
|
356
|
-
|
|
267
|
+
Requires Node ≥ 20, and **an ours daemon already running on this box** — the
|
|
268
|
+
connector attaches to it over `/api/v1` and drives it through
|
|
269
|
+
[`@ours.network/sdk`](https://www.npmjs.com/package/@ours.network/sdk). It runs
|
|
270
|
+
no engine of its own: there is no native ADAPT SDK and no MUFL packet here, so
|
|
271
|
+
nothing beyond `npm install` is resolved at runtime.
|
|
357
272
|
|
|
358
273
|
## Usage
|
|
359
274
|
|
|
@@ -366,7 +281,8 @@ ours-tg-connector add_bot supportbot 123456:ABC...
|
|
|
366
281
|
|
|
367
282
|
ours-tg-connector list_bots # name, @username, masked token, route count
|
|
368
283
|
|
|
369
|
-
# 2. create a route on that bot (auto-starts the
|
|
284
|
+
# 2. create a route on that bot (auto-starts the connector process if needed;
|
|
285
|
+
# the shared ours daemon must already be running) and print an invite
|
|
370
286
|
ours-tg-connector add_new_connection \
|
|
371
287
|
--name support \
|
|
372
288
|
--bot supportbot \
|
|
@@ -383,10 +299,10 @@ ours-tg-connector add_new_connection \
|
|
|
383
299
|
--bio "ACME forum, #billing topic"
|
|
384
300
|
|
|
385
301
|
ours-tg-connector list_connections # routes grouped by bot
|
|
386
|
-
ours-tg-connector remove_connection sales
|
|
302
|
+
ours-tg-connector remove_connection sales # removes the route and its name-listed daemon identity
|
|
387
303
|
ours-tg-connector remove_bot supportbot # refused while any route still uses it
|
|
388
304
|
|
|
389
|
-
#
|
|
305
|
+
# connector-process lifecycle (never starts or stops the shared ours daemon)
|
|
390
306
|
ours-tg-connector start | stop | restart | status
|
|
391
307
|
ours-tg-connector serve # foreground (debugging)
|
|
392
308
|
|
|
@@ -394,9 +310,6 @@ ours-tg-connector serve # foreground (debugging)
|
|
|
394
310
|
ours-tg-connector install-service # systemd (Linux) / launchd (macOS)
|
|
395
311
|
ours-tg-connector uninstall-service
|
|
396
312
|
|
|
397
|
-
# manage a bridge from the ours messenger control plane
|
|
398
|
-
ours-tg-connector cp_invite supportbot # invite to add the messenger as a contact
|
|
399
|
-
ours-tg-connector bind_proxy supportbot <contact> # start binding it (prints a 6-digit code)
|
|
400
313
|
```
|
|
401
314
|
|
|
402
315
|
`install-service` registers a **user-level** service running `serve`, bakes the
|
|
@@ -419,6 +332,13 @@ topic within that chat. `--bio` is the context the agent reads about this chat
|
|
|
419
332
|
route for any chat the bot sees that no other route claims. Reuse the same `--bot`
|
|
420
333
|
across routes to multiplex one bot over many chats/topics.
|
|
421
334
|
|
|
335
|
+
`remove_connection` releases that route's daemon lease, then removes the daemon
|
|
336
|
+
identity by its recorded route name and deletes the local route record. Because
|
|
337
|
+
the ownership list is intentionally name-only, an operator who manually removes
|
|
338
|
+
and recreates a same-name identity has deliberately replaced it; removing the
|
|
339
|
+
route can remove that replacement too. Use the `ours` operator CLI to repair
|
|
340
|
+
orphaned or deliberately replaced identities.
|
|
341
|
+
|
|
422
342
|
## Configuration
|
|
423
343
|
|
|
424
344
|
Precedence per field: **env var > `config.json` > default**. The config file is
|
|
@@ -426,7 +346,8 @@ Precedence per field: **env var > `config.json` > default**. The config file is
|
|
|
426
346
|
|
|
427
347
|
| field | env var | default |
|
|
428
348
|
|----------------|---------------------------|-------------------------------------------------|
|
|
429
|
-
|
|
|
349
|
+
| daemon URL | `OURS_TG_DAEMON_URL` | `''` (the SDK's own default selection) |
|
|
350
|
+
| daemon state dir | `OURS_TG_DAEMON_STATE_DIR` | `''` (the SDK's own default selection) |
|
|
430
351
|
| control port | `OURS_TG_CONTROL_PORT` | `3051` (localhost only) |
|
|
431
352
|
| state dir | `OURS_TG_STATE_DIR` | `~/.ours-telegram` |
|
|
432
353
|
| poll timeout | `OURS_TG_POLL_TIMEOUT` | `30` (seconds, Telegram long-poll) |
|
|
@@ -436,7 +357,7 @@ Precedence per field: **env var > `config.json` > default**. The config file is
|
|
|
436
357
|
| retry backoff | `OURS_TG_FETCH_RETRY_BASE_MS` | `300` (base delay between those retries; grows exponentially with jitter) |
|
|
437
358
|
| attachment cap | `OURS_TG_ATTACHMENT_MAX_BYTES` | `10485760` (10 MB; larger inbound media forwarded as a metadata-only stub) |
|
|
438
359
|
| outbound file cap | `OURS_TG_OUTBOUND_FILE_MAX_BYTES` | `52428800` (50 MB; a larger file from a contact is skipped + logged — Telegram's `sendDocument` limit) |
|
|
439
|
-
| STT enabled | `OURS_TG_STT_ENABLED` | `false` (
|
|
360
|
+
| STT enabled | `OURS_TG_STT_ENABLED` | `false` (whether **this connector** transcribes voice; the attached daemon runs its own STT regardless — see [Voice](#voice-messages--speech-to-text)) |
|
|
440
361
|
| STT API key | `OURS_TG_STT_API_KEY` | `''` (secret; env preferred — masked if placed in `config.json`, never logged) |
|
|
441
362
|
| STT base URL | `OURS_TG_STT_BASE_URL` | `https://api.openai.com/v1` (OpenAI-compatible endpoint root; e.g. `https://api.groq.com/openai/v1` or a self-hosted whisper server) |
|
|
442
363
|
| STT model | `OURS_TG_STT_MODEL` | `whisper-1` (e.g. `whisper-large-v3-turbo` on Groq) |
|
|
@@ -446,39 +367,28 @@ Precedence per field: **env var > `config.json` > default**. The config file is
|
|
|
446
367
|
| STT timeout | `OURS_TG_STT_TIMEOUT_MS` | `60000` (per-transcription abort deadline, ms) |
|
|
447
368
|
| forward voice audio | `OURS_TG_FORWARD_VOICE_AUDIO` | `false` (also `send_file` the `.ogg` alongside a successful transcript) |
|
|
448
369
|
|
|
370
|
+
`OURS_TG_DAEMON_URL` and `OURS_TG_DAEMON_STATE_DIR` are a coherent pair: set
|
|
371
|
+
both or neither. SDK 2 refuses an explicitly selected endpoint without its state
|
|
372
|
+
directory before reading a daemon token. Legacy `OURS_INSTANCE` is rejected, and
|
|
373
|
+
`OURS_AUTOSTART`/`autoStart` are ignored. This connector never embeds or starts an
|
|
374
|
+
ours daemon; operate the shared daemon separately with `ours daemon start` or
|
|
375
|
+
`ours daemon install-service`.
|
|
376
|
+
|
|
449
377
|
The control API is bound to `127.0.0.1` and unauthenticated — it manages bot
|
|
450
378
|
tokens, so do not expose the control port off-host.
|
|
451
379
|
|
|
452
|
-
## Control plane (
|
|
453
|
-
|
|
454
|
-
Each bridge is a self-sovereign ours node that can be **managed from the
|
|
455
|
-
ours messenger control plane** over the encrypted a2a_control
|
|
456
|
-
channel — no extra ports. The connector advertises an app manifest
|
|
457
|
-
(`network.ours.telegram-connector`) with a `core.configuration` capability, so the
|
|
458
|
-
messenger renders its generic config form for it. Two fields are configurable
|
|
459
|
-
live (no restart):
|
|
460
|
-
|
|
461
|
-
- **Allowed chat ID** — only this chat is proxied to the agent.
|
|
462
|
-
- **Denial message** — what any other chat is told.
|
|
380
|
+
## Control plane (removed)
|
|
463
381
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
# 1. add the messenger as a contact of the bridge node
|
|
471
|
-
ours-tg-connector cp_invite supportbot
|
|
472
|
-
# → paste the invite into the messenger (add contact / add node)
|
|
473
|
-
|
|
474
|
-
# 2. start the bind ceremony for that contact; read out the 6-digit code
|
|
475
|
-
ours-tg-connector bind_proxy supportbot <messenger-contact-name-or-cid>
|
|
476
|
-
# → enter the code in the messenger Control Panel (out-of-band, 5 min, 3 tries)
|
|
477
|
-
```
|
|
382
|
+
The connector used to be a **managed node**: it advertised an app manifest
|
|
383
|
+
(`network.ours.telegram-connector`) and the ours messenger could bind to it over
|
|
384
|
+
the a2a_control channel and edit the allowed chat id and denial message live.
|
|
385
|
+
That is gone — messenger manageability was removed by ruling, and with it the
|
|
386
|
+
`cp_invite` and `bind_proxy` commands, the `get_manifest` / `get_config` /
|
|
387
|
+
`set_config` verbs, and the bind ceremony.
|
|
478
388
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
389
|
+
A route is configured when it is created (`add_new_connection`) and changed by
|
|
390
|
+
removing it and adding it back. There is no live reconfiguration path, and
|
|
391
|
+
nothing to bind.
|
|
482
392
|
|
|
483
393
|
## Learn more
|
|
484
394
|
|