@hasna/bridge 0.1.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/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ Copyright 2026 Hasna
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,94 @@
1
+ # bridge
2
+
3
+ `bridge` connects local coding agents to external messaging channels. The local
4
+ folder is `open-bridge`; the public package is `@hasna/bridge`; the CLI is
5
+ `bridge`.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ bun install -g @hasna/bridge
11
+ ```
12
+
13
+ ## Commands
14
+
15
+ ```sh
16
+ bridge init
17
+ bridge doctor
18
+ bridge channels add-telegram telegram-main --token-env TELEGRAM_BOT_TOKEN --allowed-chat-ids 123456789
19
+ bridge profiles add codewith-main --agent-kind codewith --auth-profile account001 --cwd /Users/hasna
20
+ bridge agents add codewith --kind codewith --profile codewith-main
21
+ bridge routes add telegram-codewith --from telegram-main --to codewith --chat-ids 123456789
22
+ bridge serve
23
+ ```
24
+
25
+ Useful inspection commands:
26
+
27
+ ```sh
28
+ bridge config path
29
+ bridge config show
30
+ bridge channels list
31
+ bridge profiles list
32
+ bridge agents list
33
+ bridge routes list
34
+ ```
35
+
36
+ Direct operations:
37
+
38
+ ```sh
39
+ bridge send telegram-main 123456789 "hello"
40
+ bridge ask codewith "summarize this repo"
41
+ bridge route-message --channel telegram-main --chat-id 123456789 --text "status" --json
42
+ ```
43
+
44
+ ## Profiles
45
+
46
+ Profiles let one bridge process route messages to multiple accounts without
47
+ changing global agent login state.
48
+
49
+ Codewith:
50
+
51
+ ```sh
52
+ bridge profiles add cw-account001 --agent-kind codewith --auth-profile account001 --cwd /repo
53
+ bridge agents add codewith-main --kind codewith --profile cw-account001
54
+ ```
55
+
56
+ Claude:
57
+
58
+ ```sh
59
+ bridge profiles add claude-account001 --agent-kind claude --home ~/.hasna/accounts/profiles/claude/account001
60
+ bridge agents add claude-main --kind claude --profile claude-account001
61
+ ```
62
+
63
+ AIcopilot:
64
+
65
+ ```sh
66
+ bridge profiles add aicopilot-main --agent-kind aicopilot --cwd /repo
67
+ bridge agents add aicopilot-main --kind aicopilot --profile aicopilot-main
68
+ ```
69
+
70
+ ## MCP
71
+
72
+ `bridge-mcp` exposes:
73
+
74
+ - `bridge_status`
75
+ - `bridge_config`
76
+ - `bridge_route_message`
77
+
78
+ ## State
79
+
80
+ Default config path:
81
+
82
+ ```sh
83
+ ~/.hasna/bridge/config.json
84
+ ```
85
+
86
+ Override with `BRIDGE_HOME` or `BRIDGE_CONFIG`.
87
+
88
+ `bridge` stores configuration and runtime state with private file permissions.
89
+ Telegram bot tokens should stay in environment variables; config stores the env
90
+ var name, not the token value. Telegram channels fail closed unless
91
+ `allowedChatIds` are set or `allowAllChats` is explicitly enabled.
92
+ Channel-level `allowedChatIds` are enforced before route matching, and long-poll
93
+ offsets are persisted in `~/.hasna/bridge/state.json` so restarts do not replay
94
+ already-seen updates.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}