@0xmaxma/claude-gateway 1.3.23 → 1.3.25
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 +125 -49
- package/dist/api/line-pending-senders.d.ts +7 -2
- package/dist/api/line-pending-senders.d.ts.map +1 -1
- package/dist/api/line-pending-senders.js +7 -2
- package/dist/api/line-pending-senders.js.map +1 -1
- package/dist/api/packages.d.ts.map +1 -1
- package/dist/api/packages.js +92 -16
- package/dist/api/packages.js.map +1 -1
- package/dist/api/router.d.ts.map +1 -1
- package/dist/api/router.js +563 -172
- package/dist/api/router.js.map +1 -1
- package/dist/api/wizard-state.d.ts +1 -4
- package/dist/api/wizard-state.d.ts.map +1 -1
- package/dist/api/wizard-state.js.map +1 -1
- package/dist/discord/receiver.d.ts +1 -0
- package/dist/discord/receiver.d.ts.map +1 -1
- package/dist/discord/receiver.js +24 -6
- package/dist/discord/receiver.js.map +1 -1
- package/dist/telegram/receiver.d.ts +1 -0
- package/dist/telegram/receiver.d.ts.map +1 -1
- package/dist/telegram/receiver.js +18 -6
- package/dist/telegram/receiver.js.map +1 -1
- package/mcp/tools/discord/access.ts +136 -20
- package/mcp/tools/discord/client.ts +3 -1
- package/mcp/tools/discord/module.ts +75 -4
- package/mcp/tools/discord/skills/access/SKILL.md +66 -8
- package/mcp/tools/discord/skills/configure/SKILL.md +11 -1
- package/mcp/tools/discord/types.ts +21 -2
- package/mcp/tools/telegram/dedup.ts +4 -1
- package/mcp/tools/telegram/module.ts +5 -14
- package/mcp/tools/telegram/pure.ts +169 -31
- package/mcp/tools/telegram/receiver-server.ts +108 -78
- package/mcp/tools/telegram/skills/access/SKILL.md +93 -23
- package/mcp/tools/telegram/skills/configure/SKILL.md +31 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -733,20 +733,28 @@ When the config schema changes (new fields added in `config.template.json`), the
|
|
|
733
733
|
|
|
734
734
|
## Pairing New Users
|
|
735
735
|
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
2.
|
|
741
|
-
3. Approve it:
|
|
736
|
+
New agents default to `dmPolicy: "allowlist"` with the orthogonal `pairing`
|
|
737
|
+
toggle **on**, so pairing works out of the box — no setup needed.
|
|
738
|
+
|
|
739
|
+
1. Ask the user to DM the bot — they receive a 6-character pairing code
|
|
740
|
+
2. Approve it:
|
|
742
741
|
```bash
|
|
743
|
-
npm run pair -- --agent=alfred --code=abc123
|
|
742
|
+
npm run pair -- --agent=alfred --code=abc123 --channel=discord
|
|
744
743
|
```
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
744
|
+
(omit `--channel` or use `--channel=telegram` for Telegram)
|
|
745
|
+
3. The bot confirms pairing within 5 seconds
|
|
746
|
+
4. Lock down after everyone is paired (optional) — turn the pairing toggle off
|
|
747
|
+
so unknown senders are dropped silently (the base policy is already
|
|
748
|
+
`allowlist`):
|
|
749
749
|
```
|
|
750
|
+
/gateway:discord-access dm-pairing off # Discord
|
|
751
|
+
/telegram:access pairing off # Telegram
|
|
752
|
+
```
|
|
753
|
+
|
|
754
|
+
`pairing` is an **orthogonal on/off toggle**, not a `dmPolicy` value: the base
|
|
755
|
+
policy stays `open` | `allowlist` | `disabled`, and pairing layers on top of
|
|
756
|
+
`allowlist`. A legacy `access.json` with `"dmPolicy": "pairing"` is migrated
|
|
757
|
+
automatically on read to `{ dmPolicy: "allowlist", pairing: true }`.
|
|
750
758
|
|
|
751
759
|
To manage channels (add/remove Telegram or Discord) on an existing agent:
|
|
752
760
|
```bash
|
|
@@ -755,78 +763,135 @@ make update-agent # choose "Manage channels"
|
|
|
755
763
|
|
|
756
764
|
---
|
|
757
765
|
|
|
766
|
+
## Channel Conditions & Limitations
|
|
767
|
+
|
|
768
|
+
Each channel gates inbound messages in two tiers — **DM/1:1** and **group** — and
|
|
769
|
+
each has platform-level conditions that must be met *before* the gateway ever
|
|
770
|
+
sees a message. If those aren't met the bot looks online but stays silent.
|
|
771
|
+
|
|
772
|
+
| Channel | Scope | Message reaches the bot when… | Access gate | Answers in group when… |
|
|
773
|
+
|---------|-------|-------------------------------|-------------|------------------------|
|
|
774
|
+
| **Telegram** | DM | always (long-polling) | `dmPolicy` + `pairing` → `allowFrom` | — |
|
|
775
|
+
| | Group | bot is **Admin**, or **Privacy Mode is OFF** + re-added; otherwise only `/cmd`, @mentions, replies | `groupPolicy` + `groupAllowlist` | `requireMention` false, or @mentioned/replied |
|
|
776
|
+
| **Discord** | DM | **Message Content Intent** enabled | `dmPolicy` + `pairing` → `allowFrom` | — |
|
|
777
|
+
| | Guild | **Message Content Intent** + **View Channel** + **Read Message History** | `groupPolicy` + `guildAllowlist` (+ optional `channelAllowlist`/`roleAllowlist`) | `requireMention` false, or @mentioned/replied |
|
|
778
|
+
| **LINE** | 1:1 | webhook delivered (valid signature) | `dmPolicy` | — |
|
|
779
|
+
| | Group/Room | webhook delivered + bot is a member | `groupPolicy` + `groupAllowlist` | `requireMention` false, or **native** @mention |
|
|
780
|
+
|
|
781
|
+
**Telegram limits**
|
|
782
|
+
- Exactly one process may poll a bot token — a second poller causes `409 Conflict`.
|
|
783
|
+
- Bot **commands are DM-only**; in groups they're silently dropped.
|
|
784
|
+
- Group **Privacy Mode is ON by default** — see [Telegram Groups](#telegram-groups). Admin status bypasses it; a Privacy-Mode change only applies after the bot is removed and re-added.
|
|
785
|
+
- Pairing codes: DM knocks reply the code privately; group knocks post the code in the group (needs a message that actually reaches the bot, i.e. Admin/Privacy-off).
|
|
786
|
+
|
|
787
|
+
**Discord limits**
|
|
788
|
+
- **MESSAGE CONTENT INTENT** is a privileged intent — without it message text arrives empty, so the bot can neither answer nor pair. Enable it in the Developer Portal.
|
|
789
|
+
- The bot needs channel permissions **View Channel**, **Read Message History**, **Send Messages** (+ **Create Public Threads** / **Send Messages in Threads** if `DISCORD_AUTO_THREAD=true`).
|
|
790
|
+
- `channelAllowlist` / `roleAllowlist` are backend-only filters (no web UI) applied after the guild gate.
|
|
791
|
+
|
|
792
|
+
**LINE limits**
|
|
793
|
+
- Inbound arrives via the Express **webhook**, not polling; the signature is verified over the **exact raw bytes**. Front it with the bun CORS proxy (see `/tunnel`) — never point cloudflared straight at the gateway, or chunked bodies break the signature and webhooks are dropped.
|
|
794
|
+
- Group/room `requireMention` uses LINE's **native mention** only (`mention.mentionees[].isSelf`). Typing the bot's name as plain text does **not** count, and `@All` does **not** count as a bot mention.
|
|
795
|
+
- Delivery is **reply-token-first (free) → push fallback (metered)**. The single-use reply token lives only ~1 min; after that, replies consume the OA's monthly push quota.
|
|
796
|
+
- Max **5 message objects** per reply/push request (the gateway auto-chunks to fit).
|
|
797
|
+
|
|
798
|
+
---
|
|
799
|
+
|
|
758
800
|
## Telegram Groups
|
|
759
801
|
|
|
760
|
-
The bot can respond in Telegram groups and supergroups.
|
|
802
|
+
The bot can respond in Telegram groups and supergroups. A group must be in the
|
|
803
|
+
agent's `groupAllowlist` before the bot will answer there.
|
|
804
|
+
|
|
805
|
+
### Delivery gotcha: Privacy Mode (read this first)
|
|
806
|
+
|
|
807
|
+
Telegram bots ship with **Privacy Mode ON** (`getMe` returns
|
|
808
|
+
`can_read_all_group_messages: false`). A privacy-mode bot only *receives*, inside
|
|
809
|
+
a group:
|
|
810
|
+
|
|
811
|
+
- messages that start with `/` (commands),
|
|
812
|
+
- messages that @mention the bot's username, and
|
|
813
|
+
- replies to the bot's own messages.
|
|
761
814
|
|
|
762
|
-
|
|
815
|
+
Everything else is filtered by Telegram **before it reaches the gateway** — the
|
|
816
|
+
bot looks online but never sees the message, so it can neither answer nor mint a
|
|
817
|
+
pairing code. On top of that, bot commands (`/start`, `/status`, …) are
|
|
818
|
+
**DM-only**: the receiver silently drops them in groups so pairing codes can't
|
|
819
|
+
leak to other members. Net effect in a default-privacy group: a plain message is
|
|
820
|
+
invisible and a command is dropped, so nothing happens.
|
|
763
821
|
|
|
764
|
-
|
|
822
|
+
Do one of these so the bot actually receives group messages:
|
|
765
823
|
|
|
766
|
-
|
|
824
|
+
- **Promote the bot to Admin in the group (easiest).** An admin bot receives
|
|
825
|
+
every message regardless of Privacy Mode — no BotFather change, no re-add. Any
|
|
826
|
+
admin role works, even the most restricted.
|
|
827
|
+
- **Disable Privacy Mode**, then **remove and re-add the bot** to the group (the
|
|
828
|
+
new setting only applies on re-join): [@BotFather](https://t.me/BotFather) →
|
|
829
|
+
`/setprivacy` → pick the bot → **Disable**.
|
|
767
830
|
|
|
768
|
-
|
|
831
|
+
### Register the group
|
|
769
832
|
|
|
770
|
-
|
|
833
|
+
Once the bot can receive group messages, add the group to `groupAllowlist` one of
|
|
834
|
+
two ways.
|
|
835
|
+
|
|
836
|
+
**Option A — pairing code (recommended).** With `groupPolicy: "allowlist"` and
|
|
837
|
+
`pairing: true` (both defaults), send any message in the group. The bot replies
|
|
838
|
+
with a 6-character code. Approve it from a gateway agent session:
|
|
771
839
|
|
|
772
|
-
Alternatively, send a message in the group and visit:
|
|
773
840
|
```
|
|
774
|
-
|
|
841
|
+
/telegram:access pair <code>
|
|
775
842
|
```
|
|
776
|
-
Look for `"chat":{"id": ...}` in the result.
|
|
777
843
|
|
|
778
|
-
|
|
844
|
+
That adds the group id to `groupAllowlist` (the code also lands in the agent's
|
|
845
|
+
`pending` as a `"kind": "group"` entry).
|
|
779
846
|
|
|
780
|
-
|
|
847
|
+
**Option B — edit `access.json` directly.** Get the group id by forwarding any
|
|
848
|
+
group message to [@userinfobot](https://t.me/userinfobot) — a negative number
|
|
849
|
+
like `-1001234567890` — then edit:
|
|
781
850
|
|
|
782
851
|
```
|
|
783
852
|
~/.claude-gateway/agents/<your-agent-id>/workspace/.telegram-state/access.json
|
|
784
853
|
```
|
|
785
854
|
|
|
786
|
-
Add the group under `"groups"`:
|
|
787
|
-
|
|
788
855
|
```json
|
|
789
856
|
{
|
|
790
857
|
"dmPolicy": "allowlist",
|
|
858
|
+
"pairing": true,
|
|
791
859
|
"allowFrom": ["..."],
|
|
792
|
-
"
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
"allowFrom": []
|
|
796
|
-
}
|
|
797
|
-
}
|
|
860
|
+
"groupPolicy": "allowlist",
|
|
861
|
+
"groupAllowlist": ["-1001234567890"],
|
|
862
|
+
"requireMention": true
|
|
798
863
|
}
|
|
799
864
|
```
|
|
800
865
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
**Step 4 — Start chatting**
|
|
866
|
+
`access.json` is re-read on every inbound message — changes take effect
|
|
867
|
+
immediately, no restart.
|
|
805
868
|
|
|
806
|
-
|
|
869
|
+
### Mention gate
|
|
807
870
|
|
|
808
|
-
|
|
871
|
+
`requireMention` is a single top-level boolean (default `true`):
|
|
809
872
|
|
|
810
|
-
|
|
873
|
+
- `true` — the bot answers in an allowlisted group only when @mentioned or
|
|
874
|
+
replied to. This relies on Telegram delivering the @mention; if the bot ignores
|
|
875
|
+
mentions, make it an Admin (see above).
|
|
876
|
+
- `false` — the bot answers **every** message in an allowlisted group. This only
|
|
877
|
+
does anything if the bot can *see* every message, i.e. you also promoted it to
|
|
878
|
+
Admin or disabled Privacy Mode.
|
|
811
879
|
|
|
812
|
-
|
|
880
|
+
Toggle it with `/telegram:access group mention <on|off>`.
|
|
813
881
|
|
|
814
|
-
**
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
2. Send `/setprivacy`
|
|
820
|
-
3. Select your bot
|
|
821
|
-
4. Choose **Disable**
|
|
822
|
-
|
|
823
|
-
This is a bot-level setting — it applies to all groups the bot joins. If @mention-only is fine, skip this step and keep `"requireMention": true`.
|
|
882
|
+
> **Legacy schema note:** older docs showed a per-group `"groups": { "<id>": {…} }`
|
|
883
|
+
> map. That form is still accepted and auto-migrated on read to the flat
|
|
884
|
+
> `groupAllowlist` + top-level `requireMention` shown above, but new setups should
|
|
885
|
+
> use the flat schema. A per-group member restriction from the old schema is
|
|
886
|
+
> preserved under `legacyGroupAllowFrom`; there is no command to edit it.
|
|
824
887
|
|
|
825
888
|
---
|
|
826
889
|
|
|
827
890
|
## Telegram Commands
|
|
828
891
|
|
|
829
|
-
|
|
892
|
+
Bot commands are **DM-only** — sent in a group they are silently ignored (this
|
|
893
|
+
keeps pairing codes and session state from leaking to other members). Once
|
|
894
|
+
paired, the following commands are available in a private chat:
|
|
830
895
|
|
|
831
896
|
**Session management**
|
|
832
897
|
|
|
@@ -905,6 +970,17 @@ npm run typecheck
|
|
|
905
970
|
- Ensure no other process is polling the same bot token (causes 409 Conflict)
|
|
906
971
|
- Only `TelegramReceiver` polls Telegram — MCP session subprocesses run in `SEND_ONLY` mode (no polling)
|
|
907
972
|
|
|
973
|
+
**Bot silent in a Telegram group**
|
|
974
|
+
- The group must be in `groupAllowlist` — see [Telegram Groups](#telegram-groups). An empty `pending` after messaging usually means the message never reached the bot.
|
|
975
|
+
- Most common cause: **Privacy Mode** (default ON). A non-admin bot only receives commands, @mentions, and replies in groups — a plain message needed to mint the pairing code is filtered by Telegram. Promote the bot to Admin, or disable Privacy Mode in BotFather and re-add it.
|
|
976
|
+
- `/start` and other commands are dropped in groups by design — use a normal message (or an @mention) to trigger the pairing code.
|
|
977
|
+
- If `requireMention: true`, the bot only answers when @mentioned or replied to.
|
|
978
|
+
|
|
979
|
+
**Bot silent in a Discord server (guild)**
|
|
980
|
+
- Enable the **MESSAGE CONTENT INTENT** in the Discord Developer Portal (Bot settings) — without it the bot receives events but empty message text, so it can't respond or pair.
|
|
981
|
+
- The guild must be in `guildAllowlist` (`groupPolicy: allowlist`), and the bot needs **View Channel** + **Read Message History** in that channel.
|
|
982
|
+
- If `requireMention: true`, the bot only answers when @mentioned or replied to.
|
|
983
|
+
|
|
908
984
|
**Session loses memory after restart**
|
|
909
985
|
- History is persisted in `~/.claude-gateway/agents/<id>/sessions/<chat_id>.jsonl`
|
|
910
986
|
- If the file is missing, the session starts fresh (no error)
|
|
@@ -17,8 +17,13 @@ export interface PendingSender {
|
|
|
17
17
|
}
|
|
18
18
|
/** Mint a short visual-match pairing code (6 uppercase hex). */
|
|
19
19
|
export declare function generatePairingCode(): string;
|
|
20
|
-
/**
|
|
21
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Max distinct senders retained per agent (oldest evicted first). Kept at 5 to
|
|
22
|
+
* match the per-kind pending cap in the Telegram/Discord gate (countPending ⇒ 5
|
|
23
|
+
* for each of DM and group), so every channel bounds unapproved knocks the same
|
|
24
|
+
* way and a flood can't exhaust memory.
|
|
25
|
+
*/
|
|
26
|
+
export declare const MAX_PENDING_PER_AGENT = 5;
|
|
22
27
|
/**
|
|
23
28
|
* Record a denied 1:1 DM sender (Tier 1 discovery). Returns true on first
|
|
24
29
|
* contact (entry newly created).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-pending-senders.d.ts","sourceRoot":"","sources":["../../src/api/line-pending-senders.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,gEAAgE;AAChE,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED
|
|
1
|
+
{"version":3,"file":"line-pending-senders.d.ts","sourceRoot":"","sources":["../../src/api/line-pending-senders.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,gEAAgE;AAChE,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAuDvC;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,EACpB,GAAG,GAAE,MAAmB,EACxB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,IAAI,CAAC,EAAE,MAAM,EACb,GAAG,GAAE,MAAmB,EACxB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAET;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,EAAE,CAIlE;AAED,qFAAqF;AACrF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEvF;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAEpE;AAED,2DAA2D;AAC3D,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
|
|
@@ -24,8 +24,13 @@ const crypto_1 = require("crypto");
|
|
|
24
24
|
function generatePairingCode() {
|
|
25
25
|
return (0, crypto_1.randomBytes)(3).toString('hex').toUpperCase();
|
|
26
26
|
}
|
|
27
|
-
/**
|
|
28
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Max distinct senders retained per agent (oldest evicted first). Kept at 5 to
|
|
29
|
+
* match the per-kind pending cap in the Telegram/Discord gate (countPending ⇒ 5
|
|
30
|
+
* for each of DM and group), so every channel bounds unapproved knocks the same
|
|
31
|
+
* way and a flood can't exhaust memory.
|
|
32
|
+
*/
|
|
33
|
+
exports.MAX_PENDING_PER_AGENT = 5;
|
|
29
34
|
// agentId -> (id -> entry) (id = userId | groupId | roomId)
|
|
30
35
|
const store = new Map();
|
|
31
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-pending-senders.js","sourceRoot":"","sources":["../../src/api/line-pending-senders.ts"],"names":[],"mappings":";;;AAgCA,kDAEC;
|
|
1
|
+
{"version":3,"file":"line-pending-senders.js","sourceRoot":"","sources":["../../src/api/line-pending-senders.ts"],"names":[],"mappings":";;;AAgCA,kDAEC;AAmED,gDAQC;AAMD,4DASC;AAGD,8CAIC;AAGD,4CAEC;AAGD,gDAEC;AAGD,oDAEC;AAlJD;;;;;;;;;;GAUG;AACH,mCAAqC;AAoBrC,gEAAgE;AAChE,SAAgB,mBAAmB;IACjC,OAAO,IAAA,oBAAW,EAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AACtD,CAAC;AAED;;;;;GAKG;AACU,QAAA,qBAAqB,GAAG,CAAC,CAAC;AAEvC,6DAA6D;AAC7D,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsC,CAAC;AAE5D;;;;;;;;;GASG;AACH,SAAS,YAAY,CACnB,OAAe,EACf,EAAU,EACV,IAA+B,EAC/B,WAA+B,EAC/B,GAAW,EACX,IAAa;IAEb,IAAI,CAAC,OAAO,IAAI,CAAC,EAAE;QAAE,OAAO,KAAK,CAAC;IAClC,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC9B,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,IAAI,GAAG,IAAI,GAAG,EAAyB,CAAC;QACxC,KAAK,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AM,EAAqB,MAAM,SAAS,CAAC;AAIpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"packages.d.ts","sourceRoot":"","sources":["../../src/api/packages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,SAAS,CAAC;AAIpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAsDlC,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED,wBAAgB,UAAU,IAAI,IAAI,CAEjC;AAED,wBAAgB,QAAQ,IAAI,IAAI,CAE/B;AA4HD,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CA0L/D"}
|
package/dist/api/packages.js
CHANGED
|
@@ -9,10 +9,19 @@ const child_process_1 = require("child_process");
|
|
|
9
9
|
const fs_1 = require("fs");
|
|
10
10
|
const path_1 = require("path");
|
|
11
11
|
const auth_1 = require("./auth");
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const migrator_1 = require("../config/migrator");
|
|
13
|
+
// URL param "name" → package config.
|
|
14
|
+
// claude-gateway is a genuine npm global — keep npm detect/update.
|
|
15
|
+
// claude-code ships via the native installer (no longer an npm global), so
|
|
16
|
+
// detect from the `claude` binary and update via its native updater.
|
|
17
|
+
const PACKAGES = {
|
|
18
|
+
'claude-gateway': { npm: '@0xmaxma/claude-gateway', detect: 'npm', update: 'npm' },
|
|
19
|
+
'claude-code': {
|
|
20
|
+
npm: '@anthropic-ai/claude-code',
|
|
21
|
+
detect: 'binary',
|
|
22
|
+
bin: 'claude',
|
|
23
|
+
update: 'native',
|
|
24
|
+
},
|
|
16
25
|
};
|
|
17
26
|
const CACHE_TTL_MS = 5 * 60 * 1000;
|
|
18
27
|
let versionCache = null;
|
|
@@ -40,6 +49,42 @@ function getNpmListVersion(packageName) {
|
|
|
40
49
|
return null;
|
|
41
50
|
}
|
|
42
51
|
}
|
|
52
|
+
// Resolve the installed version by shelling out to the binary on PATH
|
|
53
|
+
// (e.g. `claude --version` → "2.1.207 (Claude Code)"). Parses the leading
|
|
54
|
+
// semver (with optional prerelease) and returns null on any failure —
|
|
55
|
+
// binary missing, non-zero exit, or unparseable output. `bin` is always a
|
|
56
|
+
// trusted constant from PACKAGES, never request-derived.
|
|
57
|
+
function getBinaryVersion(bin) {
|
|
58
|
+
try {
|
|
59
|
+
const output = (0, child_process_1.execSync)(`${bin} --version`, {
|
|
60
|
+
encoding: 'utf-8',
|
|
61
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
62
|
+
timeout: 10000,
|
|
63
|
+
});
|
|
64
|
+
// `claude --version` prints the version first (e.g. "2.1.207 (Claude Code)").
|
|
65
|
+
// Anchor to the start of the trimmed output so a version-like token later in
|
|
66
|
+
// the line can never be mistaken for the installed version.
|
|
67
|
+
const match = output.trim().match(/^(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)/);
|
|
68
|
+
return match ? match[1] : null;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Resolve the currently-installed version per the package's detect strategy.
|
|
75
|
+
function resolveCurrent(config) {
|
|
76
|
+
if (config.detect === 'binary' && config.bin) {
|
|
77
|
+
return getBinaryVersion(config.bin);
|
|
78
|
+
}
|
|
79
|
+
return getNpmListVersion(config.npm);
|
|
80
|
+
}
|
|
81
|
+
// An update is available only when `latest` is strictly newer than `current`.
|
|
82
|
+
// Using semver ordering (not `current !== latest`) avoids a false "update
|
|
83
|
+
// available" when the installed version is *ahead* of the npm-registry latest
|
|
84
|
+
// — e.g. a native-installer channel that leads the npm dist-tag.
|
|
85
|
+
function updateAvailable(current, latest) {
|
|
86
|
+
return !!(current && latest && (0, migrator_1.compareSemver)(latest, current) > 0);
|
|
87
|
+
}
|
|
43
88
|
async function getLatestVersion(packageName) {
|
|
44
89
|
const encodedName = packageName.replace('/', '%2F');
|
|
45
90
|
const res = await fetch(`https://registry.npmjs.org/${encodedName}/latest`);
|
|
@@ -49,17 +94,17 @@ async function getLatestVersion(packageName) {
|
|
|
49
94
|
return data.version ?? null;
|
|
50
95
|
}
|
|
51
96
|
async function fetchAllPackageVersions() {
|
|
52
|
-
const
|
|
53
|
-
// Run all synchronous
|
|
54
|
-
const currents =
|
|
55
|
-
return Promise.all(
|
|
97
|
+
const configs = Object.values(PACKAGES);
|
|
98
|
+
// Run all synchronous current-version lookups before entering async Promise.all
|
|
99
|
+
const currents = configs.map(resolveCurrent);
|
|
100
|
+
return Promise.all(configs.map(async (config, i) => {
|
|
56
101
|
const current = currents[i];
|
|
57
|
-
const latest = await getLatestVersion(
|
|
102
|
+
const latest = await getLatestVersion(config.npm);
|
|
58
103
|
return {
|
|
59
|
-
package:
|
|
104
|
+
package: config.npm,
|
|
60
105
|
current,
|
|
61
106
|
latest,
|
|
62
|
-
hasUpdate:
|
|
107
|
+
hasUpdate: updateAvailable(current, latest),
|
|
63
108
|
};
|
|
64
109
|
}));
|
|
65
110
|
}
|
|
@@ -146,12 +191,13 @@ function createPackagesRouter(apiKeys) {
|
|
|
146
191
|
}
|
|
147
192
|
}
|
|
148
193
|
const { name } = req.params;
|
|
149
|
-
const
|
|
150
|
-
if (!
|
|
194
|
+
const config = PACKAGES[name];
|
|
195
|
+
if (!config) {
|
|
151
196
|
res.status(404).json({ error: `unknown package: ${name}` });
|
|
152
197
|
return;
|
|
153
198
|
}
|
|
154
|
-
const
|
|
199
|
+
const packageName = config.npm;
|
|
200
|
+
const from = resolveCurrent(config);
|
|
155
201
|
let latest;
|
|
156
202
|
try {
|
|
157
203
|
latest = await getLatestVersion(packageName);
|
|
@@ -164,8 +210,8 @@ function createPackagesRouter(apiKeys) {
|
|
|
164
210
|
res.status(503).json({ error: 'registry unavailable' });
|
|
165
211
|
return;
|
|
166
212
|
}
|
|
167
|
-
// Already on latest — no install needed
|
|
168
|
-
if (from
|
|
213
|
+
// Already on latest (or ahead of it) — no install needed
|
|
214
|
+
if (from && !updateAvailable(from, latest)) {
|
|
169
215
|
res.json({ package: packageName, from, to: from, updated: false, warning: null });
|
|
170
216
|
return;
|
|
171
217
|
}
|
|
@@ -176,6 +222,36 @@ function createPackagesRouter(apiKeys) {
|
|
|
176
222
|
}
|
|
177
223
|
isUpdating = true;
|
|
178
224
|
try {
|
|
225
|
+
// Native-installer packages (e.g. claude-code) update the binary on PATH
|
|
226
|
+
// via their own updater. npm install -g would write a separate npm copy
|
|
227
|
+
// that isn't the running binary, so it must not be used here.
|
|
228
|
+
if (config.update === 'native' && config.bin) {
|
|
229
|
+
let updateErr = null;
|
|
230
|
+
try {
|
|
231
|
+
(0, child_process_1.execSync)(`${config.bin} update`, {
|
|
232
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
233
|
+
timeout: 300000,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
catch (err) {
|
|
237
|
+
updateErr = err;
|
|
238
|
+
}
|
|
239
|
+
if (updateErr !== null) {
|
|
240
|
+
const stderr = updateErr.stderr?.toString() ??
|
|
241
|
+
updateErr.message ??
|
|
242
|
+
'update failed';
|
|
243
|
+
res.status(500).json({ error: stderr });
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
// Invalidate version cache and re-read the actual binary version.
|
|
247
|
+
// The native updater may legitimately be a no-op (already newest on its
|
|
248
|
+
// own channel), so report `updated` from whether the version changed.
|
|
249
|
+
versionCache = null;
|
|
250
|
+
const to = resolveCurrent(config);
|
|
251
|
+
res.json({ package: packageName, from, to, updated: to !== from, warning: null });
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
// npm-global packages (e.g. claude-gateway) update via npm install -g.
|
|
179
255
|
// Resolve npm global root for temp dir cleanup
|
|
180
256
|
let npmRoot = '';
|
|
181
257
|
try {
|
package/dist/api/packages.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packages.js","sourceRoot":"","sources":["../../src/api/packages.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"packages.js","sourceRoot":"","sources":["../../src/api/packages.ts"],"names":[],"mappings":";;AA0DA,kCAEC;AAED,gCAEC;AAED,4BAEC;AA4HD,oDA0LC;AA1XD,qCAAoD;AACpD,iDAAyC;AACzC,2BAAyC;AACzC,+BAA4B;AAE5B,iCAA0D;AAC1D,iDAAmD;AAqBnD,qCAAqC;AACrC,mEAAmE;AACnE,2EAA2E;AAC3E,qEAAqE;AACrE,MAAM,QAAQ,GAAkC;IAC9C,gBAAgB,EAAE,EAAE,GAAG,EAAE,yBAAyB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;IAClF,aAAa,EAAE;QACb,GAAG,EAAE,2BAA2B;QAChC,MAAM,EAAE,QAAQ;QAChB,GAAG,EAAE,QAAQ;QACb,MAAM,EAAE,QAAQ;KACjB;CACF,CAAC;AAcF,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnC,IAAI,YAAY,GAAsB,IAAI,CAAC;AAC3C,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB,SAAgB,WAAW;IACzB,YAAY,GAAG,IAAI,CAAC;AACtB,CAAC;AAED,SAAgB,UAAU;IACxB,UAAU,GAAG,KAAK,CAAC;AACrB,CAAC;AAED,SAAgB,QAAQ;IACtB,UAAU,GAAG,IAAI,CAAC;AACpB,CAAC;AAED,SAAS,iBAAiB,CAAC,WAAmB;IAC5C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,eAAe,WAAW,mBAAmB,EAAE;YACrE,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;YAC/B,OAAO,EAAE,KAAM;SAChB,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAA2D,CAAC;QAC5F,OAAO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C;gBAEH,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,CAAC;YAC9D,CAAC;iBAAM,CAAC;gBACN,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YAC7E,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,UAAU,GAAG,KAAK,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/api/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/api/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,SAAS,CAAC;AAOpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAe,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/api/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,SAAS,CAAC;AAOpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAe,MAAM,UAAU,CAAC;AAmJzE,wBAAgB,eAAe,CAC7B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EACtC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EACtC,OAAO,EAAE,MAAM,EAAE,EACjB,UAAU,CAAC,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,WAAW,EAAE,GACrB,MAAM,CAipFR"}
|