@mattkotsenas/uplink 0.1.0 → 0.1.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/LICENSE +21 -21
- package/README.md +211 -211
- package/dist/bin/cli.js +23 -15
- package/dist/client/assets/icon-192-gctgYdH5.png +0 -0
- package/dist/client/assets/icon-B_iz-Vtl.svg +6 -0
- package/dist/client/assets/index-Bq1PyAIX.js +4 -0
- package/dist/client/assets/{index-DcXxbHMt.css → index-Dh-Dgu1S.css} +1 -1
- package/dist/client/assets/{manifest-CRQOoeuO.json → manifest-CyBn0dX4.json} +27 -27
- package/dist/client/index.html +45 -32
- package/dist/client/sw.js +33 -33
- package/dist/src/server/index.js +134 -5
- package/dist/src/server/sessions.js +50 -0
- package/package.json +45 -41
- package/dist/client/assets/icon-192-DObIHtoR.png +0 -0
- package/dist/client/assets/icon-BcpYpzAR.svg +0 -4
- package/dist/client/assets/index-NrSomGMo.js +0 -4
- package/dist/client/assets/index-vccpSOnT.js +0 -4
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Copilot Uplink Contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Copilot Uplink Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,211 +1,211 @@
|
|
|
1
|
-
# ⬆ Copilot Uplink
|
|
2
|
-
|
|
3
|
-
**Remote control for GitHub Copilot CLI from your phone or any browser.**
|
|
4
|
-
|
|
5
|
-
[](https://github.com/MattKotsenas/uplink/actions)
|
|
6
|
-
[](https://www.npmjs.com/package/@mattkotsenas/uplink)
|
|
7
|
-
[](LICENSE)
|
|
8
|
-
|
|
9
|
-
## What Is This?
|
|
10
|
-
|
|
11
|
-
Copilot Uplink gives you a full chat interface to GitHub Copilot CLI — from
|
|
12
|
-
your phone, a tablet, or any browser. Think of it like Claude Code's
|
|
13
|
-
"Remote Control", but for Copilot CLI.
|
|
14
|
-
|
|
15
|
-
A lightweight Node.js bridge spawns `copilot --acp --stdio` as a child
|
|
16
|
-
process, translates between WebSocket and NDJSON (the ACP wire format), and
|
|
17
|
-
serves a Progressive Web App that renders streaming responses, tool calls,
|
|
18
|
-
permissions, and agent plans. Add a Microsoft Dev Tunnel and the whole thing
|
|
19
|
-
is reachable from anywhere.
|
|
20
|
-
|
|
21
|
-
```mermaid
|
|
22
|
-
graph LR
|
|
23
|
-
PWA["PWA Client<br/>(browser)"] <-->|"HTTPS / WSS<br/>via devtunnel"| Bridge["Bridge Server<br/>(Node.js)"]
|
|
24
|
-
Bridge <-->|"stdio / NDJSON<br/>child process"| Copilot["copilot --acp<br/>--stdio"]
|
|
25
|
-
Bridge -.-|"Serves PWA static files<br/>+ WebSocket endpoint"| PWA
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Quick Start
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npx @mattkotsenas/uplink
|
|
32
|
-
|
|
33
|
-
# With remote access via devtunnel
|
|
34
|
-
npx @mattkotsenas/uplink --tunnel
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## How It Works
|
|
38
|
-
|
|
39
|
-
1. **Copilot CLI** runs locally in ACP mode (`copilot --acp --stdio`),
|
|
40
|
-
speaking newline-delimited JSON-RPC over stdin/stdout.
|
|
41
|
-
2. **Bridge server** spawns the CLI as a child process and bridges messages
|
|
42
|
-
between its stdin/stdout and a WebSocket endpoint — acting as a dumb pipe
|
|
43
|
-
that never interprets ACP messages.
|
|
44
|
-
3. **PWA** connects over WebSocket, drives the full ACP lifecycle
|
|
45
|
-
(`initialize` → `session/new` → `session/prompt`), and renders the
|
|
46
|
-
streaming response.
|
|
47
|
-
4. **Dev Tunnel** (optional) exposes the bridge server over HTTPS so you can
|
|
48
|
-
reach it from your phone or any remote browser.
|
|
49
|
-
|
|
50
|
-
### Message Flow
|
|
51
|
-
|
|
52
|
-
```mermaid
|
|
53
|
-
sequenceDiagram
|
|
54
|
-
participant PWA
|
|
55
|
-
participant Bridge
|
|
56
|
-
participant Copilot as Copilot (stdio)
|
|
57
|
-
|
|
58
|
-
PWA->>Bridge: WS connect
|
|
59
|
-
Bridge->>Copilot: spawn copilot --acp --stdio
|
|
60
|
-
|
|
61
|
-
PWA->>Bridge: WS: initialize
|
|
62
|
-
Bridge->>Copilot: stdin: initialize\n
|
|
63
|
-
Copilot->>Bridge: stdout: result\n
|
|
64
|
-
Bridge->>PWA: WS: result
|
|
65
|
-
|
|
66
|
-
PWA->>Bridge: WS: session/prompt
|
|
67
|
-
Bridge->>Copilot: stdin: session/prompt\n
|
|
68
|
-
loop Streaming
|
|
69
|
-
Copilot->>Bridge: stdout: session/update\n
|
|
70
|
-
Bridge->>PWA: WS: session/update
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
Copilot->>Bridge: stdout: request_permission\n
|
|
74
|
-
Bridge->>PWA: WS: request_permission
|
|
75
|
-
PWA->>Bridge: WS: permission response
|
|
76
|
-
Bridge->>Copilot: stdin: permission response\n
|
|
77
|
-
|
|
78
|
-
Copilot->>Bridge: stdout: result\n
|
|
79
|
-
Bridge->>PWA: WS: prompt result
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Features
|
|
83
|
-
|
|
84
|
-
- 💬 **Chat** with streaming responses
|
|
85
|
-
- 🔧 **Tool call visibility** — see reads, edits, executes, and more with kind icons and status
|
|
86
|
-
- 🔐 **Permission approve / deny** — surface permission requests with option buttons
|
|
87
|
-
- 📋 **Agent plan tracking** — view plan entries with priority and status
|
|
88
|
-
- 📱 **PWA** — installable on your phone's home screen
|
|
89
|
-
- 🌐 **Remote access** via Microsoft Dev Tunnel
|
|
90
|
-
- 🔄 **Auto-reconnect** with exponential backoff (1 s → 30 s max)
|
|
91
|
-
- 🌙 **Dark / light theme**
|
|
92
|
-
|
|
93
|
-
## Installing Dev Tunnels
|
|
94
|
-
|
|
95
|
-
Dev Tunnels are required for remote access (`--tunnel`). Install for your platform:
|
|
96
|
-
|
|
97
|
-
**macOS:**
|
|
98
|
-
```bash
|
|
99
|
-
brew install --cask devtunnel
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
**Linux:**
|
|
103
|
-
```bash
|
|
104
|
-
curl -sL https://aka.ms/DevTunnelCliInstall | bash
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
**Windows:**
|
|
108
|
-
```powershell
|
|
109
|
-
winget install Microsoft.devtunnel
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
After installing, authenticate once:
|
|
113
|
-
```bash
|
|
114
|
-
devtunnel user login
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Getting the PWA on Your Phone
|
|
118
|
-
|
|
119
|
-
1. **Start with tunnel:**
|
|
120
|
-
```bash
|
|
121
|
-
npx @mattkotsenas/uplink --tunnel
|
|
122
|
-
```
|
|
123
|
-
2. **Scan the QR code**printed in your terminal with your phone's camera.
|
|
124
|
-
3. **Add to Home Screen** — your browser will offer an "Install" or
|
|
125
|
-
"Add to Home Screen" prompt because the app ships a Web App Manifest and
|
|
126
|
-
Service Worker.
|
|
127
|
-
4. **(Optional) Use a persistent tunnel** so the URL stays the same across
|
|
128
|
-
restarts:
|
|
129
|
-
```bash
|
|
130
|
-
# One-time setup
|
|
131
|
-
devtunnel create my-uplink
|
|
132
|
-
devtunnel port create my-uplink -p 3000
|
|
133
|
-
|
|
134
|
-
# Reuse every time
|
|
135
|
-
npx @mattkotsenas/uplink --tunnel-id my-uplink
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
With a persistent tunnel the installed PWA always connects to the same URL.
|
|
139
|
-
If the bridge is offline the cached app shell still opens instantly; it shows
|
|
140
|
-
a reconnection banner and retries automatically.
|
|
141
|
-
|
|
142
|
-
## CLI Reference
|
|
143
|
-
|
|
144
|
-
```
|
|
145
|
-
npx @mattkotsenas/uplink [options]
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
| Flag | Description | Default |
|
|
149
|
-
|---|---|---|
|
|
150
|
-
| `--port <n>` | Port for the bridge server | `3000` |
|
|
151
|
-
| `--tunnel` | Start a devtunnel for remote access | off |
|
|
152
|
-
| `--no-tunnel` | Explicitly disable tunnel | — |
|
|
153
|
-
| `--tunnel-id <name>` | Use a persistent devtunnel (implies `--tunnel`) | — |
|
|
154
|
-
| `--cwd <path>` | Working directory for the Copilot subprocess | current dir |
|
|
155
|
-
| `--help` | Show help and exit | — |
|
|
156
|
-
|
|
157
|
-
## Contributing
|
|
158
|
-
|
|
159
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, build, and testing instructions.
|
|
160
|
-
|
|
161
|
-
## Architecture Deep Dive
|
|
162
|
-
|
|
163
|
-
### The Bridge (Dumb Pipe)
|
|
164
|
-
|
|
165
|
-
The bridge **intentionally does not parse ACP messages**. It reads
|
|
166
|
-
newline-delimited JSON from the subprocess stdout and sends each line as a
|
|
167
|
-
WebSocket text message; in the other direction it writes incoming WebSocket
|
|
168
|
-
messages to stdin with a trailing `\n`.
|
|
169
|
-
|
|
170
|
-
Benefits:
|
|
171
|
-
|
|
172
|
-
- **Simple** — the bridge is ~100 lines of logic, easy to audit.
|
|
173
|
-
- **Testable** — you can verify framing without any ACP knowledge.
|
|
174
|
-
- **Protocol-agnostic** — if ACP evolves, only the PWA client needs updating.
|
|
175
|
-
|
|
176
|
-
### ACP Protocol
|
|
177
|
-
|
|
178
|
-
The [Agent Client Protocol](https://agentclientprotocol.com) defines how
|
|
179
|
-
AI-powered tools communicate with host applications. The wire format is
|
|
180
|
-
JSON-RPC 2.0 delimited by newlines (NDJSON).
|
|
181
|
-
|
|
182
|
-
Key message types the PWA handles:
|
|
183
|
-
|
|
184
|
-
| Method | Direction | Purpose |
|
|
185
|
-
|---|---|---|
|
|
186
|
-
| `initialize` | Client → Agent | Negotiate capabilities |
|
|
187
|
-
| `session/new` | Client → Agent | Create a conversation session |
|
|
188
|
-
| `session/prompt` | Client → Agent | Send a user prompt |
|
|
189
|
-
| `session/update` | Agent → Client | Streaming chunks, tool calls, plan updates |
|
|
190
|
-
| `session/request_permission` | Agent → Client | Ask user to approve a tool action |
|
|
191
|
-
| `session/cancel` | Client → Agent | Cancel a running prompt |
|
|
192
|
-
|
|
193
|
-
## Limitations (v1)
|
|
194
|
-
|
|
195
|
-
- **Single session only** — one browser client at a time.
|
|
196
|
-
- **No session resume** across bridge restarts.
|
|
197
|
-
- **No file system / terminal proxying** — the PWA does not provide
|
|
198
|
-
client-side FS or terminal capabilities back to the agent.
|
|
199
|
-
- **No authentication** beyond devtunnel's built-in defaults.
|
|
200
|
-
|
|
201
|
-
## Roadmap Ideas
|
|
202
|
-
|
|
203
|
-
- Session persistence and resume across restarts
|
|
204
|
-
- Multi-session support (multiple browser tabs / devices)
|
|
205
|
-
- File explorer integration
|
|
206
|
-
- Push notifications for long-running tasks
|
|
207
|
-
- Syntax-highlighted diffs in tool call output
|
|
208
|
-
|
|
209
|
-
## License
|
|
210
|
-
|
|
211
|
-
[MIT](LICENSE)
|
|
1
|
+
# ⬆ Copilot Uplink
|
|
2
|
+
|
|
3
|
+
**Remote control for GitHub Copilot CLI from your phone or any browser.**
|
|
4
|
+
|
|
5
|
+
[](https://github.com/MattKotsenas/uplink/actions)
|
|
6
|
+
[](https://www.npmjs.com/package/@mattkotsenas/uplink)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
## What Is This?
|
|
10
|
+
|
|
11
|
+
Copilot Uplink gives you a full chat interface to GitHub Copilot CLI — from
|
|
12
|
+
your phone, a tablet, or any browser. Think of it like Claude Code's
|
|
13
|
+
"Remote Control", but for Copilot CLI.
|
|
14
|
+
|
|
15
|
+
A lightweight Node.js bridge spawns `copilot --acp --stdio` as a child
|
|
16
|
+
process, translates between WebSocket and NDJSON (the ACP wire format), and
|
|
17
|
+
serves a Progressive Web App that renders streaming responses, tool calls,
|
|
18
|
+
permissions, and agent plans. Add a Microsoft Dev Tunnel and the whole thing
|
|
19
|
+
is reachable from anywhere.
|
|
20
|
+
|
|
21
|
+
```mermaid
|
|
22
|
+
graph LR
|
|
23
|
+
PWA["PWA Client<br/>(browser)"] <-->|"HTTPS / WSS<br/>via devtunnel"| Bridge["Bridge Server<br/>(Node.js)"]
|
|
24
|
+
Bridge <-->|"stdio / NDJSON<br/>child process"| Copilot["copilot --acp<br/>--stdio"]
|
|
25
|
+
Bridge -.-|"Serves PWA static files<br/>+ WebSocket endpoint"| PWA
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx @mattkotsenas/uplink
|
|
32
|
+
|
|
33
|
+
# With remote access via devtunnel
|
|
34
|
+
npx @mattkotsenas/uplink --tunnel
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## How It Works
|
|
38
|
+
|
|
39
|
+
1. **Copilot CLI** runs locally in ACP mode (`copilot --acp --stdio`),
|
|
40
|
+
speaking newline-delimited JSON-RPC over stdin/stdout.
|
|
41
|
+
2. **Bridge server** spawns the CLI as a child process and bridges messages
|
|
42
|
+
between its stdin/stdout and a WebSocket endpoint — acting as a dumb pipe
|
|
43
|
+
that never interprets ACP messages.
|
|
44
|
+
3. **PWA** connects over WebSocket, drives the full ACP lifecycle
|
|
45
|
+
(`initialize` → `session/new` → `session/prompt`), and renders the
|
|
46
|
+
streaming response.
|
|
47
|
+
4. **Dev Tunnel** (optional) exposes the bridge server over HTTPS so you can
|
|
48
|
+
reach it from your phone or any remote browser.
|
|
49
|
+
|
|
50
|
+
### Message Flow
|
|
51
|
+
|
|
52
|
+
```mermaid
|
|
53
|
+
sequenceDiagram
|
|
54
|
+
participant PWA
|
|
55
|
+
participant Bridge
|
|
56
|
+
participant Copilot as Copilot (stdio)
|
|
57
|
+
|
|
58
|
+
PWA->>Bridge: WS connect
|
|
59
|
+
Bridge->>Copilot: spawn copilot --acp --stdio
|
|
60
|
+
|
|
61
|
+
PWA->>Bridge: WS: initialize
|
|
62
|
+
Bridge->>Copilot: stdin: initialize\n
|
|
63
|
+
Copilot->>Bridge: stdout: result\n
|
|
64
|
+
Bridge->>PWA: WS: result
|
|
65
|
+
|
|
66
|
+
PWA->>Bridge: WS: session/prompt
|
|
67
|
+
Bridge->>Copilot: stdin: session/prompt\n
|
|
68
|
+
loop Streaming
|
|
69
|
+
Copilot->>Bridge: stdout: session/update\n
|
|
70
|
+
Bridge->>PWA: WS: session/update
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
Copilot->>Bridge: stdout: request_permission\n
|
|
74
|
+
Bridge->>PWA: WS: request_permission
|
|
75
|
+
PWA->>Bridge: WS: permission response
|
|
76
|
+
Bridge->>Copilot: stdin: permission response\n
|
|
77
|
+
|
|
78
|
+
Copilot->>Bridge: stdout: result\n
|
|
79
|
+
Bridge->>PWA: WS: prompt result
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Features
|
|
83
|
+
|
|
84
|
+
- 💬 **Chat** with streaming responses
|
|
85
|
+
- 🔧 **Tool call visibility** — see reads, edits, executes, and more with kind icons and status
|
|
86
|
+
- 🔐 **Permission approve / deny** — surface permission requests with option buttons
|
|
87
|
+
- 📋 **Agent plan tracking** — view plan entries with priority and status
|
|
88
|
+
- 📱 **PWA** — installable on your phone's home screen
|
|
89
|
+
- 🌐 **Remote access** via Microsoft Dev Tunnel
|
|
90
|
+
- 🔄 **Auto-reconnect** with exponential backoff (1 s → 30 s max)
|
|
91
|
+
- 🌙 **Dark / light theme**
|
|
92
|
+
|
|
93
|
+
## Installing Dev Tunnels
|
|
94
|
+
|
|
95
|
+
Dev Tunnels are required for remote access (`--tunnel`). Install for your platform:
|
|
96
|
+
|
|
97
|
+
**macOS:**
|
|
98
|
+
```bash
|
|
99
|
+
brew install --cask devtunnel
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Linux:**
|
|
103
|
+
```bash
|
|
104
|
+
curl -sL https://aka.ms/DevTunnelCliInstall | bash
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Windows:**
|
|
108
|
+
```powershell
|
|
109
|
+
winget install Microsoft.devtunnel
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
After installing, authenticate once:
|
|
113
|
+
```bash
|
|
114
|
+
devtunnel user login
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Getting the PWA on Your Phone
|
|
118
|
+
|
|
119
|
+
1. **Start with tunnel:**
|
|
120
|
+
```bash
|
|
121
|
+
npx @mattkotsenas/uplink --tunnel
|
|
122
|
+
```
|
|
123
|
+
2. **Scan the QR code**printed in your terminal with your phone's camera.
|
|
124
|
+
3. **Add to Home Screen** — your browser will offer an "Install" or
|
|
125
|
+
"Add to Home Screen" prompt because the app ships a Web App Manifest and
|
|
126
|
+
Service Worker.
|
|
127
|
+
4. **(Optional) Use a persistent tunnel** so the URL stays the same across
|
|
128
|
+
restarts:
|
|
129
|
+
```bash
|
|
130
|
+
# One-time setup
|
|
131
|
+
devtunnel create my-uplink
|
|
132
|
+
devtunnel port create my-uplink -p 3000
|
|
133
|
+
|
|
134
|
+
# Reuse every time
|
|
135
|
+
npx @mattkotsenas/uplink --tunnel-id my-uplink
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
With a persistent tunnel the installed PWA always connects to the same URL.
|
|
139
|
+
If the bridge is offline the cached app shell still opens instantly; it shows
|
|
140
|
+
a reconnection banner and retries automatically.
|
|
141
|
+
|
|
142
|
+
## CLI Reference
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
npx @mattkotsenas/uplink [options]
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
| Flag | Description | Default |
|
|
149
|
+
|---|---|---|
|
|
150
|
+
| `--port <n>` | Port for the bridge server | `3000` |
|
|
151
|
+
| `--tunnel` | Start a devtunnel for remote access | off |
|
|
152
|
+
| `--no-tunnel` | Explicitly disable tunnel | — |
|
|
153
|
+
| `--tunnel-id <name>` | Use a persistent devtunnel (implies `--tunnel`) | — |
|
|
154
|
+
| `--cwd <path>` | Working directory for the Copilot subprocess | current dir |
|
|
155
|
+
| `--help` | Show help and exit | — |
|
|
156
|
+
|
|
157
|
+
## Contributing
|
|
158
|
+
|
|
159
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, build, and testing instructions.
|
|
160
|
+
|
|
161
|
+
## Architecture Deep Dive
|
|
162
|
+
|
|
163
|
+
### The Bridge (Dumb Pipe)
|
|
164
|
+
|
|
165
|
+
The bridge **intentionally does not parse ACP messages**. It reads
|
|
166
|
+
newline-delimited JSON from the subprocess stdout and sends each line as a
|
|
167
|
+
WebSocket text message; in the other direction it writes incoming WebSocket
|
|
168
|
+
messages to stdin with a trailing `\n`.
|
|
169
|
+
|
|
170
|
+
Benefits:
|
|
171
|
+
|
|
172
|
+
- **Simple** — the bridge is ~100 lines of logic, easy to audit.
|
|
173
|
+
- **Testable** — you can verify framing without any ACP knowledge.
|
|
174
|
+
- **Protocol-agnostic** — if ACP evolves, only the PWA client needs updating.
|
|
175
|
+
|
|
176
|
+
### ACP Protocol
|
|
177
|
+
|
|
178
|
+
The [Agent Client Protocol](https://agentclientprotocol.com) defines how
|
|
179
|
+
AI-powered tools communicate with host applications. The wire format is
|
|
180
|
+
JSON-RPC 2.0 delimited by newlines (NDJSON).
|
|
181
|
+
|
|
182
|
+
Key message types the PWA handles:
|
|
183
|
+
|
|
184
|
+
| Method | Direction | Purpose |
|
|
185
|
+
|---|---|---|
|
|
186
|
+
| `initialize` | Client → Agent | Negotiate capabilities |
|
|
187
|
+
| `session/new` | Client → Agent | Create a conversation session |
|
|
188
|
+
| `session/prompt` | Client → Agent | Send a user prompt |
|
|
189
|
+
| `session/update` | Agent → Client | Streaming chunks, tool calls, plan updates |
|
|
190
|
+
| `session/request_permission` | Agent → Client | Ask user to approve a tool action |
|
|
191
|
+
| `session/cancel` | Client → Agent | Cancel a running prompt |
|
|
192
|
+
|
|
193
|
+
## Limitations (v1)
|
|
194
|
+
|
|
195
|
+
- **Single session only** — one browser client at a time.
|
|
196
|
+
- **No session resume** across bridge restarts.
|
|
197
|
+
- **No file system / terminal proxying** — the PWA does not provide
|
|
198
|
+
client-side FS or terminal capabilities back to the agent.
|
|
199
|
+
- **No authentication** beyond devtunnel's built-in defaults.
|
|
200
|
+
|
|
201
|
+
## Roadmap Ideas
|
|
202
|
+
|
|
203
|
+
- Session persistence and resume across restarts
|
|
204
|
+
- Multi-session support (multiple browser tabs / devices)
|
|
205
|
+
- File explorer integration
|
|
206
|
+
- Push notifications for long-running tasks
|
|
207
|
+
- Syntax-highlighted diffs in tool call output
|
|
208
|
+
|
|
209
|
+
## License
|
|
210
|
+
|
|
211
|
+
[MIT](LICENSE)
|
package/dist/bin/cli.js
CHANGED
|
@@ -18,25 +18,27 @@ function hasFlag(name) {
|
|
|
18
18
|
return args.includes(`--${name}`);
|
|
19
19
|
}
|
|
20
20
|
const port = parseInt(getArg('port') ?? '3000', 10);
|
|
21
|
+
// TODO: Pass --model flag through to the bridge server when CLI gains a --model option.
|
|
22
|
+
// Currently, model selection is handled client-side via localStorage and the WS URL parameter.
|
|
21
23
|
const tunnelId = getArg('tunnel-id');
|
|
22
24
|
const useTunnel = hasFlag('tunnel') || !!tunnelId;
|
|
23
25
|
const noTunnel = hasFlag('no-tunnel');
|
|
24
26
|
const allowAnonymous = hasFlag('allow-anonymous');
|
|
25
27
|
const cwd = getArg('cwd') ?? process.cwd();
|
|
26
28
|
if (hasFlag('help')) {
|
|
27
|
-
console.log(`
|
|
28
|
-
Copilot Uplink — Remote control for GitHub Copilot CLI
|
|
29
|
-
|
|
30
|
-
Usage: uplink [options]
|
|
31
|
-
|
|
32
|
-
Options:
|
|
33
|
-
--port <n> Port for bridge server (default: 3000)
|
|
34
|
-
--tunnel Start a devtunnel for remote access
|
|
35
|
-
--no-tunnel Don't start a devtunnel
|
|
36
|
-
--tunnel-id <name> Use a persistent devtunnel
|
|
37
|
-
--allow-anonymous Allow anonymous tunnel access (no GitHub auth)
|
|
38
|
-
--cwd <path> Working directory for Copilot
|
|
39
|
-
--help Show this help
|
|
29
|
+
console.log(`
|
|
30
|
+
Copilot Uplink — Remote control for GitHub Copilot CLI
|
|
31
|
+
|
|
32
|
+
Usage: uplink [options]
|
|
33
|
+
|
|
34
|
+
Options:
|
|
35
|
+
--port <n> Port for bridge server (default: 3000)
|
|
36
|
+
--tunnel Start a devtunnel for remote access
|
|
37
|
+
--no-tunnel Don't start a devtunnel
|
|
38
|
+
--tunnel-id <name> Use a persistent devtunnel
|
|
39
|
+
--allow-anonymous Allow anonymous tunnel access (no GitHub auth)
|
|
40
|
+
--cwd <path> Working directory for Copilot
|
|
41
|
+
--help Show this help
|
|
40
42
|
`);
|
|
41
43
|
process.exit(0);
|
|
42
44
|
}
|
|
@@ -59,7 +61,7 @@ async function listen(server, desiredPort) {
|
|
|
59
61
|
});
|
|
60
62
|
}
|
|
61
63
|
async function main() {
|
|
62
|
-
console.log('
|
|
64
|
+
console.log('🛰 Copilot Uplink starting...');
|
|
63
65
|
console.log();
|
|
64
66
|
const staticDir = resolveStaticDir();
|
|
65
67
|
const { server, close } = startServer({
|
|
@@ -115,7 +117,13 @@ async function main() {
|
|
|
115
117
|
});
|
|
116
118
|
setTimeout(() => process.exit(1), 5000);
|
|
117
119
|
};
|
|
118
|
-
process.on('SIGINT',
|
|
120
|
+
process.on('SIGINT', () => {
|
|
121
|
+
shutdown();
|
|
122
|
+
// Exit after synchronous cleanup to avoid "Terminate batch job?" on Windows.
|
|
123
|
+
// The shutdown() call above synchronously kills child processes and sends
|
|
124
|
+
// WS close frames; the async server.close() callback is best-effort.
|
|
125
|
+
setImmediate(() => process.exit(0));
|
|
126
|
+
});
|
|
119
127
|
process.on('SIGTERM', shutdown);
|
|
120
128
|
}
|
|
121
129
|
main().catch((err) => {
|
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
2
|
+
<rect width="512" height="512" rx="64" fill="#6366f1" />
|
|
3
|
+
<g transform="translate(56, 456) scale(0.4167)" fill="#ffffff">
|
|
4
|
+
<path d="M240-100q-58 0-99-41t-41-99q0-58 41-99t99-41q58 0 99 41t41 99q0 22-6.5 42.5T354-159v-27q30 13 62 19.5t64 6.5q134 0 227-93t93-227h80q0 83-31.5 156T763-197q-54 54-127 85.5T480-80q-45 0-88-9.5T309-118q-16 9-33.5 13.5T240-100Zm42.5-97.5Q300-215 300-240t-17.5-42.5Q265-300 240-300t-42.5 17.5Q180-265 180-240t17.5 42.5Q215-180 240-180t42.5-17.5ZM480-340q-58 0-99-41t-41-99q0-58 41-99t99-41q58 0 99 41t41 99q0 58-41 99t-99 41ZM80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q45 0 88 9.5t83 28.5q16-9 33.5-13.5T720-860q58 0 99 41t41 99q0 58-41 99t-99 41q-58 0-99-41t-41-99q0-22 6.5-42.5T606-801v27q-30-13-62-19.5t-64-6.5q-134 0-227 93t-93 227H80Zm640-180q25 0 42.5-17.5T780-720q0-25-17.5-42.5T720-780q-25 0-42.5 17.5T660-720q0 25 17.5 42.5T720-660ZM240-240Zm480-480Z"/>
|
|
5
|
+
</g>
|
|
6
|
+
</svg>
|