@justfortytwo/telegram 0.1.1 → 0.1.2

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 (2) hide show
  1. package/README.md +14 -5
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -39,6 +39,10 @@ channel side: /login <code> -> verify(chatId, code) -> bindin
39
39
  owner chat reach the bridge before any binding exists; it is not required once
40
40
  bindings exist.
41
41
 
42
+ Pending challenges are **persisted in the binding store** (not in process
43
+ memory), so a code minted by one process — e.g. the `fortytwo pair` CLI — is
44
+ redeemable by the separately-running bridge. They are single-use and short-TTL.
45
+
42
46
  The contract is intentionally **channel-agnostic** (`ChannelAdapter` in
43
47
  `src/adapter.ts`) so a future Slack / email / SMS adapter implements the same
44
48
  `issueChallenge` / `verify` shape.
@@ -49,8 +53,9 @@ Authorization must work **even when the memory package is absent**, so the
49
53
  binding store is **self-owned** and does not assume the `@justfortytwo/memory`
50
54
  sqlite db exists:
51
55
 
52
- - `SqliteBindingStore` — default; a tiny `better-sqlite3` table in its own db
53
- file (`state/telegram-bindings.db` by default).
56
+ - `SqliteBindingStore` — default; a tiny `better-sqlite3` db in its own file
57
+ (`state/telegram-bindings.db` by default) holding **bindings + pending
58
+ challenges**, so a CLI-issued pairing code reaches the bridge.
54
59
  - `MemoryBindingStore` — in-process Map, for tests / ephemeral use.
55
60
  - `BindingStore` — the injectable interface. Supply a memory-backed
56
61
  implementation later without touching the login flow.
@@ -75,9 +80,13 @@ Install them alongside this package:
75
80
  npm install @justfortytwo/telegram @justfortytwo/memory @justfortytwo/gate
76
81
  ```
77
82
 
78
- The seams where these peers are wired are marked with `// TODO(wire):` in
79
- `src/bridge.ts`, `src/attachments.ts`, and `src/adapters-config.ts`. Until they
80
- are wired, the bridge runs **channel-only** (no memory/jobs) via no-op shims.
83
+ The **memory** data path is wired: the bridge opens + migrates the memory DB at
84
+ startup and **persists each channel event** to `@justfortytwo/memory`; recall
85
+ happens inside the headless `claude` turn via the Memory MCP tools. If the memory
86
+ peer is absent, the bridge degrades to **channel-only** (messages relay but are
87
+ not persisted) rather than refusing to start. The **gate** "Allow _N_h" path
88
+ still uses a local bash-allowlist fallback; wiring it to `@justfortytwo/gate`'s
89
+ exact-command allowlist is the remaining seam.
81
90
 
82
91
  ## Environment
83
92
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justfortytwo/telegram",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Telegram channel adapter for fortytwo: a long-polling bridge that drives a headless `claude` turn loop per chat, surfaces gate approvals as inline keyboards, and gates inbound access behind a login/pairing binding flow.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "type": "module",
16
16
  "engines": {
17
- "node": ">=18"
17
+ "node": ">=20"
18
18
  },
19
19
  "main": "./dist/index.js",
20
20
  "types": "./dist/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "./bridge": "./dist/bridge.js"
27
27
  },
28
28
  "bin": {
29
- "fortytwo-telegram-bridge": "./dist/bridge.js"
29
+ "fortytwo-telegram-bridge": "dist/bridge.js"
30
30
  },
31
31
  "files": [
32
32
  "dist",
@@ -61,7 +61,7 @@
61
61
  }
62
62
  },
63
63
  "dependencies": {
64
- "better-sqlite3": "^11.0.0"
64
+ "better-sqlite3": "^12.0.0"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@types/better-sqlite3": "^7.6.0",