@markus-global/cli 0.11.3 → 0.12.0-rc.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/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +5 -1
- package/dist/backend.js.map +1 -1
- package/dist/commands/approval-card.d.ts +53 -0
- package/dist/commands/approval-card.d.ts.map +1 -0
- package/dist/commands/approval-card.js +43 -0
- package/dist/commands/approval-card.js.map +1 -0
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +11 -5
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +7 -5
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/model.d.ts.map +1 -1
- package/dist/commands/model.js +6 -4
- package/dist/commands/model.js.map +1 -1
- package/dist/commands/outbound.d.ts +76 -0
- package/dist/commands/outbound.d.ts.map +1 -0
- package/dist/commands/outbound.js +80 -0
- package/dist/commands/outbound.js.map +1 -0
- package/dist/commands/start.d.ts +124 -2
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +718 -82
- package/dist/commands/start.js.map +1 -1
- package/dist/index.js +5 -20
- package/dist/index.js.map +1 -1
- package/dist/markus.mjs +112615 -103125
- package/dist/web-ui/assets/AsyncState-BebkDWbq.js +1 -0
- package/dist/web-ui/assets/{CommentInput-DN3Cichs.js → CommentInput-BRZWIC3U.js} +1 -1
- package/dist/web-ui/assets/{ContentRenderer-CjHOyYgJ.js → ContentRenderer-PGP8H_Zz.js} +2 -2
- package/dist/web-ui/assets/DeliverableShareModal-CcigVYGz.js +1 -0
- package/dist/web-ui/assets/Deliverables-CQwXaCA4.js +3 -0
- package/dist/web-ui/assets/{Notifications-CCsdBfdg.js → Notifications-BvHJCIRG.js} +1 -1
- package/dist/web-ui/assets/Search-BA-aXh7i.js +1 -0
- package/dist/web-ui/assets/SendToChat-CAfyKhpq.js +1 -0
- package/dist/web-ui/assets/Settings-icFp6tNI.js +8 -0
- package/dist/web-ui/assets/{Store-BWi97VP9.js → Store-DKwOcmMu.js} +1 -1
- package/dist/web-ui/assets/Switch-C7lFnHA7.js +1 -0
- package/dist/web-ui/assets/Team-DyqXLZ-X.js +84 -0
- package/dist/web-ui/assets/Work-BXGrda4S.js +12 -0
- package/dist/web-ui/assets/{arc-Cg0-C295.js → arc-Dnk6N-Zc.js} +1 -1
- package/dist/web-ui/assets/{architectureDiagram-3BPJPVTR-BctEHNLp.js → architectureDiagram-3BPJPVTR-CV8JIXXD.js} +1 -1
- package/dist/web-ui/assets/{blockDiagram-GPEHLZMM-hxr2ZwOV.js → blockDiagram-GPEHLZMM-D9pKmrXH.js} +1 -1
- package/dist/web-ui/assets/{c4Diagram-AAUBKEIU-CfIRo1GE.js → c4Diagram-AAUBKEIU-Q26HvIpY.js} +1 -1
- package/dist/web-ui/assets/channel-BZs6ereM.js +1 -0
- package/dist/web-ui/assets/{chunk-2J33WTMH-T0bENsqX.js → chunk-2J33WTMH-BSjFVwnx.js} +1 -1
- package/dist/web-ui/assets/{chunk-4BX2VUAB-ChLLkyYx.js → chunk-4BX2VUAB-BZXv4MQp.js} +1 -1
- package/dist/web-ui/assets/{chunk-55IACEB6-BD3ENYp9.js → chunk-55IACEB6-CeKd3oeJ.js} +1 -1
- package/dist/web-ui/assets/{chunk-727SXJPM-BAes4atE.js → chunk-727SXJPM-DP1tSQo5.js} +1 -1
- package/dist/web-ui/assets/{chunk-AQP2D5EJ-FymM7gfT.js → chunk-AQP2D5EJ-DqEncn7j.js} +1 -1
- package/dist/web-ui/assets/{chunk-FMBD7UC4-N5sRT0m9.js → chunk-FMBD7UC4-tuDUJ9Xx.js} +1 -1
- package/dist/web-ui/assets/{chunk-ND2GUHAM-BSjS3JyS.js → chunk-ND2GUHAM-DoC8aLWB.js} +1 -1
- package/dist/web-ui/assets/{chunk-QZHKN3VN-Dkwitdbr.js → chunk-QZHKN3VN-74zpvcgs.js} +1 -1
- package/dist/web-ui/assets/classDiagram-4FO5ZUOK-C9JIxJeJ.js +1 -0
- package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-C9JIxJeJ.js +1 -0
- package/dist/web-ui/assets/{cose-bilkent-S5V4N54A-BLuYATCK.js → cose-bilkent-S5V4N54A-DjYUalC1.js} +1 -1
- package/dist/web-ui/assets/{dagre-BM42HDAG-DGLiqiH2.js → dagre-BM42HDAG-oSewacE8.js} +1 -1
- package/dist/web-ui/assets/{diagram-2AECGRRQ-Cq_GnNKs.js → diagram-2AECGRRQ-C1fiWe46.js} +1 -1
- package/dist/web-ui/assets/{diagram-5GNKFQAL-CHNz-2dA.js → diagram-5GNKFQAL-9G_q6hCa.js} +1 -1
- package/dist/web-ui/assets/{diagram-KO2AKTUF-D8eKa7jh.js → diagram-KO2AKTUF-CSm-lJp-.js} +1 -1
- package/dist/web-ui/assets/{diagram-LMA3HP47-RkDgQcLr.js → diagram-LMA3HP47-BTAORcHx.js} +1 -1
- package/dist/web-ui/assets/{diagram-OG6HWLK6-LqxQrIwa.js → diagram-OG6HWLK6-DbcCkDfo.js} +1 -1
- package/dist/web-ui/assets/{docx-preview-Be-Qo_ag.js → docx-preview-DjqdA44x.js} +1 -1
- package/dist/web-ui/assets/{erDiagram-TEJ5UH35-BX0zZgYQ.js → erDiagram-TEJ5UH35-DFa-B8-u.js} +1 -1
- package/dist/web-ui/assets/{flowDiagram-I6XJVG4X-DKnfIFA4.js → flowDiagram-I6XJVG4X-WCTnaK9M.js} +1 -1
- package/dist/web-ui/assets/{ganttDiagram-6RSMTGT7-DjBURmY-.js → ganttDiagram-6RSMTGT7-DbW1CoJJ.js} +1 -1
- package/dist/web-ui/assets/{gitGraphDiagram-PVQCEYII-BvSi7SvS.js → gitGraphDiagram-PVQCEYII-1faDfO29.js} +1 -1
- package/dist/web-ui/assets/index-B8h1PPzP.js +883 -0
- package/dist/web-ui/assets/index-DD3NMntN.css +1 -0
- package/dist/web-ui/assets/{infoDiagram-5YYISTIA-CwtIgim2.js → infoDiagram-5YYISTIA-DfXKP4tQ.js} +1 -1
- package/dist/web-ui/assets/{ishikawaDiagram-YF4QCWOH-CWhXJfSa.js → ishikawaDiagram-YF4QCWOH-D6FOsFQ5.js} +1 -1
- package/dist/web-ui/assets/{journeyDiagram-JHISSGLW-DN9rorlL.js → journeyDiagram-JHISSGLW-DXpxntIF.js} +1 -1
- package/dist/web-ui/assets/{kanban-definition-UN3LZRKU-Burf5FE8.js → kanban-definition-UN3LZRKU-Dt7FBCF3.js} +1 -1
- package/dist/web-ui/assets/{mermaid.core-Dx4rzlyC.js → mermaid.core-sTcSUoRD.js} +5 -5
- package/dist/web-ui/assets/{mindmap-definition-RKZ34NQL-DqZ21Siw.js → mindmap-definition-RKZ34NQL-CvOU23ga.js} +1 -1
- package/dist/web-ui/assets/{pieDiagram-4H26LBE5-C_4ksu-T.js → pieDiagram-4H26LBE5-DUedtXVj.js} +1 -1
- package/dist/web-ui/assets/{quadrantDiagram-W4KKPZXB-Dl6Rjg1X.js → quadrantDiagram-W4KKPZXB-CqpHHRca.js} +1 -1
- package/dist/web-ui/assets/{requirementDiagram-4Y6WPE33-CzmWi02d.js → requirementDiagram-4Y6WPE33-CKZYvVDJ.js} +1 -1
- package/dist/web-ui/assets/{sankeyDiagram-5OEKKPKP-D8K7e8we.js → sankeyDiagram-5OEKKPKP-gZ0nzDfs.js} +1 -1
- package/dist/web-ui/assets/{sequenceDiagram-3UESZ5HK-1z9rqtVx.js → sequenceDiagram-3UESZ5HK-DN3XdBkW.js} +1 -1
- package/dist/web-ui/assets/{stateDiagram-AJRCARHV-nneYkkHa.js → stateDiagram-AJRCARHV-BvtafGxO.js} +1 -1
- package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-B2nWDV5R.js +1 -0
- package/dist/web-ui/assets/{timeline-definition-PNZ67QCA-D6GmLlRi.js → timeline-definition-PNZ67QCA-BrR919lp.js} +1 -1
- package/dist/web-ui/assets/{vennDiagram-CIIHVFJN-TVefhiCa.js → vennDiagram-CIIHVFJN-B7CTm4yM.js} +1 -1
- package/dist/web-ui/assets/{wardley-L42UT6IY-BgUuAeiM.js → wardley-L42UT6IY-CyqFngx_.js} +1 -1
- package/dist/web-ui/assets/{wardleyDiagram-YWT4CUSO-CyJ_l94o.js → wardleyDiagram-YWT4CUSO-BCqEPBJ5.js} +1 -1
- package/dist/web-ui/assets/{xychartDiagram-2RQKCTM6-kajbbx7a.js → xychartDiagram-2RQKCTM6-BmT6Cmz-.js} +1 -1
- package/dist/web-ui/index.html +2 -2
- package/docs/README.md +1 -0
- package/docs/architecture/architecture.md +1 -1
- package/docs/architecture/configuration-model.md +156 -0
- package/docs/architecture/messaging-gateway.md +1043 -0
- package/docs/architecture/notification-delivery.md +273 -0
- package/docs/design/remote-access-contract.md +445 -0
- package/docs/guides/development.md +1 -1
- package/docs/guides/guide.md +4 -2
- package/docs/guides/remote-access.md +147 -214
- package/docs/handoff/approval-tri-state-handoff.md +69 -0
- package/docs/handoff/remote-access-handoff.md +160 -0
- package/docs/records/agent-platform-friction-2026-10.md +102 -2
- package/package.json +1 -1
- package/dist/web-ui/assets/DeliverableShareModal-CBSvxB-X.js +0 -1
- package/dist/web-ui/assets/Deliverables-BaAF4-w0.js +0 -3
- package/dist/web-ui/assets/Search-BiBdevAU.js +0 -1
- package/dist/web-ui/assets/Settings-CawBnWuy.js +0 -8
- package/dist/web-ui/assets/Team-CfUDkdc3.js +0 -84
- package/dist/web-ui/assets/Work-DrIXOW-P.js +0 -12
- package/dist/web-ui/assets/channel-DAQ2Rbxq.js +0 -1
- package/dist/web-ui/assets/classDiagram-4FO5ZUOK-BZyCVtJb.js +0 -1
- package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-BZyCVtJb.js +0 -1
- package/dist/web-ui/assets/index-D8vskks7.js +0 -882
- package/dist/web-ui/assets/index-DEN_qReg.css +0 -1
- package/dist/web-ui/assets/modelCapabilities-DDtCBZ6o.js +0 -1
- package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-C-hpzcms.js +0 -1
|
@@ -1,286 +1,219 @@
|
|
|
1
1
|
# Remote Access Guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **Architecture v2 — "bring your own tunnel".** Earlier versions routed all remote
|
|
4
|
+
> traffic through a single Markus-operated VPS (signal server + TURN + in-band
|
|
5
|
+
> HTTP/WS proxy). That is gone. Your tunnel carries the data; Markus Hub only
|
|
6
|
+
> provides the **entry domain**, an **endpoint registry**, and a **login gate**.
|
|
7
|
+
>
|
|
8
|
+
> Normative interface: [`docs/design/remote-access-contract.md`](../design/remote-access-contract.md) (frozen, T1).
|
|
9
|
+
> Shared types: `packages/remote/src/contract.ts`. UI logic: `packages/web-ui/src/lib/remoteAccess.ts`.
|
|
4
10
|
|
|
5
11
|
---
|
|
6
12
|
|
|
7
|
-
##
|
|
13
|
+
## 0. What changed
|
|
8
14
|
|
|
9
|
-
|
|
|
10
|
-
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
+
| | Old (v1) | New (v2) |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| Data path | through our Relay/TURN VPS | **your own tunnel** (Cloudflare / Tailscale / your proxy) |
|
|
18
|
+
| Cost/quality | on us, single choke point | on the tunnel provider's free tier; scales with you |
|
|
19
|
+
| Public address | our relay | a tunnel hostname you own or get for free |
|
|
20
|
+
| Hub's job | signal + relay + proxy | entry domain + endpoint registry + auth gate |
|
|
21
|
+
| Public entry | relay URL | `https://{user}.remote.markus.global` → **302** to your tunnel after login |
|
|
15
22
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
## Option 1: Cloudflare Tunnel (Recommended)
|
|
19
|
-
|
|
20
|
-
Zero-trust tunnel — no open inbound ports, free HTTPS, built-in DDoS protection. Works with WebSocket out of the box.
|
|
21
|
-
|
|
22
|
-
### Prerequisites
|
|
23
|
-
|
|
24
|
-
- A domain name (can use a free one via Cloudflare registrar)
|
|
25
|
-
- A free Cloudflare account
|
|
26
|
-
|
|
27
|
-
### Setup
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
# 1. Install cloudflared
|
|
31
|
-
# macOS
|
|
32
|
-
brew install cloudflared
|
|
33
|
-
# Linux
|
|
34
|
-
curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o /usr/local/bin/cloudflared
|
|
35
|
-
chmod +x /usr/local/bin/cloudflared
|
|
36
|
-
|
|
37
|
-
# 2. Authenticate with Cloudflare
|
|
38
|
-
cloudflared tunnel login
|
|
39
|
-
|
|
40
|
-
# 3. Create a tunnel
|
|
41
|
-
cloudflared tunnel create markus
|
|
42
|
-
|
|
43
|
-
# 4. Route your subdomain to the tunnel
|
|
44
|
-
cloudflared tunnel route dns markus markus.yourdomain.com
|
|
23
|
+
The remote access section of the app is now an **onboarding wizard**: pick a
|
|
24
|
+
method, run (or delegate) the setup, watch six steps, then share a ready link.
|
|
45
25
|
|
|
46
|
-
|
|
47
|
-
mkdir -p ~/.cloudflared
|
|
48
|
-
cat > ~/.cloudflared/config.yml << 'EOF'
|
|
49
|
-
tunnel: markus
|
|
50
|
-
credentials-file: ~/.cloudflared/<TUNNEL_ID>.json
|
|
26
|
+
---
|
|
51
27
|
|
|
52
|
-
|
|
53
|
-
- hostname: markus.yourdomain.com
|
|
54
|
-
service: http://localhost:8056
|
|
55
|
-
- service: http_status:404
|
|
56
|
-
EOF
|
|
28
|
+
## 1. Architecture
|
|
57
29
|
|
|
58
|
-
|
|
59
|
-
|
|
30
|
+
```
|
|
31
|
+
Your phone / laptop
|
|
32
|
+
│ 1. open https://{user}.remote.markus.global
|
|
33
|
+
▼
|
|
34
|
+
Markus Hub ── 2. login gate (Hub session cookie, Domain=.markus.global)
|
|
35
|
+
│
|
|
36
|
+
│ 3. 302 redirect → your registered public URL
|
|
37
|
+
▼
|
|
38
|
+
Your tunnel (cloudflared / tailscale / your proxy)
|
|
39
|
+
│
|
|
40
|
+
▼
|
|
41
|
+
Your local Markus (http://127.0.0.1:8056, the local api-server)
|
|
60
42
|
```
|
|
61
43
|
|
|
62
|
-
|
|
44
|
+
* **No traffic passes through Markus servers.** Hub never proxies the data — it
|
|
45
|
+
answers one request with a `302`.
|
|
46
|
+
* **Hub keeps an endpoint registry** (`remote_endpoints`): which local install
|
|
47
|
+
owns which public URL, health, and a server-side encrypted secret used to
|
|
48
|
+
verify ownership. The local agent registers on startup and on address change.
|
|
49
|
+
* **Ownership is proven** with a challenge–response handshake (the Hub calls your
|
|
50
|
+
tunnel at `verifyPath` and expects the `verifyToken`), with strict SSRF
|
|
51
|
+
protection on the target address.
|
|
63
52
|
|
|
64
|
-
|
|
65
|
-
# Install as a system service so it auto-starts
|
|
66
|
-
sudo cloudflared service install
|
|
67
|
-
```
|
|
53
|
+
---
|
|
68
54
|
|
|
69
|
-
|
|
55
|
+
## 2. Connection methods
|
|
70
56
|
|
|
71
|
-
|
|
57
|
+
The wizard shows every method with **门槛 / 稳定性 / 账号? / 域名?** badges and a
|
|
58
|
+
live **binary-detected ✓** marker (`cloudflared` / `tailscale` found on this
|
|
59
|
+
machine).
|
|
72
60
|
|
|
73
|
-
|
|
61
|
+
| Method | Public address | Account | Domain needed | Setup | Stability |
|
|
62
|
+
|---|---|---|---|---|---|
|
|
63
|
+
| **Cloudflare Quick Tunnel** | random `*.trycloudflare.com` | no | no | easy | address changes on restart |
|
|
64
|
+
| **Cloudflare Named Tunnel** ★ | your own domain | yes | yes | moderate | stable |
|
|
65
|
+
| **Tailscale Funnel** | `*.ts.net` (public) | yes | no | easy | stable |
|
|
66
|
+
| **Tailscale Serve** | tailnet only (not public) | yes | no | easy | stable |
|
|
67
|
+
| **Custom relay / proxy** | whatever you run (frp, ngrok, nginx…) | — | — | advanced | depends on you |
|
|
74
68
|
|
|
75
|
-
|
|
76
|
-
2. Navigate to **Access > Applications > Add an application**
|
|
77
|
-
3. Set the application domain to `markus.yourdomain.com`
|
|
78
|
-
4. Add an authentication policy (e.g., email OTP, Google SSO, GitHub SSO)
|
|
69
|
+
★ **Recommended for long-term use** — a named tunnel gives you a stable address.
|
|
79
70
|
|
|
80
|
-
|
|
71
|
+
> **Mainland China:** Cloudflare and Tailscale free tiers can be unstable.
|
|
72
|
+
> A self-hosted **FRP** relay is usually the better choice there.
|
|
81
73
|
|
|
82
74
|
---
|
|
83
75
|
|
|
84
|
-
##
|
|
76
|
+
## 3. Setup — path A: run it yourself
|
|
85
77
|
|
|
86
|
-
|
|
78
|
+
Choose a method, then copy the commands for your platform (the wizard offers
|
|
79
|
+
macOS / Linux / Windows). When they are running, click **"I've run it"**.
|
|
87
80
|
|
|
88
|
-
###
|
|
81
|
+
### 3.1 Cloudflare Quick Tunnel (fastest to try)
|
|
89
82
|
|
|
90
83
|
```bash
|
|
91
|
-
|
|
92
|
-
#
|
|
93
|
-
|
|
94
|
-
# Linux
|
|
95
|
-
curl -fsSL https://tailscale.com/install.sh | sh
|
|
96
|
-
|
|
97
|
-
# 2. Start and authenticate
|
|
98
|
-
sudo tailscale up
|
|
99
|
-
|
|
100
|
-
# 3. Note your Tailscale IP
|
|
101
|
-
tailscale ip -4
|
|
102
|
-
# e.g., 100.64.x.x
|
|
103
|
-
|
|
104
|
-
# 4. Start Markus normally
|
|
105
|
-
pnpm dev
|
|
84
|
+
brew install cloudflared # macOS
|
|
85
|
+
# or: https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/
|
|
86
|
+
cloudflared tunnel --url http://127.0.0.1:8056
|
|
106
87
|
```
|
|
107
88
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
Each team member installs Tailscale on their device and joins the same Tailnet. Then access:
|
|
89
|
+
`cloudflared` prints an `https://<random>.trycloudflare.com` URL. The wizard
|
|
90
|
+
picks it up, registers it, verifies it, and turns **Ready**.
|
|
111
91
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
http://100.64.x.x:8057 # Web UI (dev mode)
|
|
115
|
-
```
|
|
92
|
+
> The random hostname changes every restart — Markus detects the change and
|
|
93
|
+
> updates the registry automatically (the entry link stays the same).
|
|
116
94
|
|
|
117
|
-
###
|
|
95
|
+
### 3.2 Cloudflare Named Tunnel (stable, recommended)
|
|
118
96
|
|
|
119
97
|
```bash
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
# https://your-machine.tailnet-name.ts.net:8056
|
|
98
|
+
cloudflared tunnel login
|
|
99
|
+
cloudflared tunnel create markus
|
|
100
|
+
cloudflared tunnel route dns markus markus.example.com
|
|
101
|
+
cloudflared tunnel run --url http://127.0.0.1:8056 markus
|
|
125
102
|
```
|
|
126
103
|
|
|
127
|
-
|
|
104
|
+
You now have a **fixed** hostname on your own domain.
|
|
105
|
+
|
|
106
|
+
### 3.3 Tailscale Funnel (public, stable)
|
|
128
107
|
|
|
129
108
|
```bash
|
|
130
|
-
|
|
109
|
+
tailscale up
|
|
131
110
|
tailscale funnel 8056
|
|
111
|
+
# → https://<machine>.<tailnet>.ts.net
|
|
132
112
|
```
|
|
133
113
|
|
|
134
|
-
|
|
114
|
+
### 3.4 Tailscale Serve (private — tailnet only, no public exposure)
|
|
135
115
|
|
|
136
|
-
|
|
116
|
+
```bash
|
|
117
|
+
tailscale serve 8056
|
|
118
|
+
```
|
|
137
119
|
|
|
138
|
-
|
|
120
|
+
Nothing is published to the internet; only your own devices can reach it.
|
|
139
121
|
|
|
140
|
-
|
|
122
|
+
### 3.5 Custom relay (frp / ngrok / nginx)
|
|
141
123
|
|
|
142
|
-
|
|
124
|
+
Run your own reverse proxy pointing at `http://127.0.0.1:8056`, then either let
|
|
125
|
+
the wizard discover it, or use **"Enter address manually"** in the failure state
|
|
126
|
+
and paste the public HTTPS URL. The Hub will verify it the same way.
|
|
143
127
|
|
|
144
|
-
|
|
145
|
-
# Download frps
|
|
146
|
-
wget https://github.com/fatedier/frp/releases/latest/download/frp_0.61.1_linux_amd64.tar.gz
|
|
147
|
-
tar xzf frp_*.tar.gz
|
|
148
|
-
cd frp_*
|
|
149
|
-
|
|
150
|
-
# Create frps config
|
|
151
|
-
cat > frps.toml << 'EOF'
|
|
152
|
-
bindPort = 7000
|
|
153
|
-
auth.token = "your-secret-token-change-me"
|
|
154
|
-
|
|
155
|
-
# Dashboard (optional)
|
|
156
|
-
webServer.addr = "0.0.0.0"
|
|
157
|
-
webServer.port = 7500
|
|
158
|
-
webServer.user = "admin"
|
|
159
|
-
webServer.password = "admin"
|
|
160
|
-
|
|
161
|
-
vhostHTTPPort = 80
|
|
162
|
-
vhostHTTPSPort = 443
|
|
163
|
-
EOF
|
|
164
|
-
|
|
165
|
-
# Run
|
|
166
|
-
./frps -c frps.toml
|
|
167
|
-
```
|
|
128
|
+
---
|
|
168
129
|
|
|
169
|
-
|
|
130
|
+
## 4. Setup — path B: let an Agent do it
|
|
170
131
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
cat > frpc.toml << 'EOF'
|
|
177
|
-
serverAddr = "your-vps-ip"
|
|
178
|
-
serverPort = 7000
|
|
179
|
-
auth.token = "your-secret-token-change-me"
|
|
180
|
-
|
|
181
|
-
[[proxies]]
|
|
182
|
-
name = "markus-api"
|
|
183
|
-
type = "tcp"
|
|
184
|
-
localIP = "127.0.0.1"
|
|
185
|
-
localPort = 8056
|
|
186
|
-
remotePort = 8056
|
|
187
|
-
|
|
188
|
-
[[proxies]]
|
|
189
|
-
name = "markus-web"
|
|
190
|
-
type = "tcp"
|
|
191
|
-
localIP = "127.0.0.1"
|
|
192
|
-
localPort = 8057
|
|
193
|
-
remotePort = 8057
|
|
194
|
-
EOF
|
|
195
|
-
|
|
196
|
-
./frpc -c frpc.toml
|
|
197
|
-
```
|
|
132
|
+
Choose the method, then **"Let an Agent do it"**. An Agent installs the binary,
|
|
133
|
+
starts the tunnel, and reports status back into the same wizard — you watch the
|
|
134
|
+
same six steps. (Agent runtime lands in T10; until then the panel tells you it is
|
|
135
|
+
unavailable and points you at path A.)
|
|
198
136
|
|
|
199
|
-
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 5. The setup wizard (six steps)
|
|
200
140
|
|
|
201
141
|
```
|
|
202
|
-
|
|
203
|
-
http://your-vps-ip:8057 # Web UI
|
|
142
|
+
install → start → resolve address → register → verify → ready
|
|
204
143
|
```
|
|
205
144
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
145
|
+
| Step | What happens |
|
|
146
|
+
|---|---|
|
|
147
|
+
| **Install** | the binary is present (or you installed it) |
|
|
148
|
+
| **Start** | the tunnel process is running |
|
|
149
|
+
| **Resolve address** | the public URL is parsed from the tunnel's output |
|
|
150
|
+
| **Register** | the endpoint is written to the Hub registry |
|
|
151
|
+
| **Verify** | Hub proves ownership (challenge–response) and checks SSRF safety |
|
|
152
|
+
| **Ready** | you can share the link |
|
|
209
153
|
|
|
210
|
-
|
|
154
|
+
Status arrives live over the WebSocket (`remote:status`), so the wizard advances
|
|
155
|
+
without a page refresh.
|
|
211
156
|
|
|
212
|
-
|
|
157
|
+
---
|
|
213
158
|
|
|
214
|
-
|
|
215
|
-
# Install
|
|
216
|
-
brew install ngrok # macOS
|
|
217
|
-
# or: snap install ngrok # Linux
|
|
159
|
+
## 6. Ready panel
|
|
218
160
|
|
|
219
|
-
|
|
220
|
-
ngrok config add-authtoken <your-token>
|
|
161
|
+
Once ready, the panel shows two things — **they are different addresses**:
|
|
221
162
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
163
|
+
* **Share this entry** — `https://{user}.remote.markus.global`
|
|
164
|
+
Give **this** to people. It needs a Hub login and is protected by the auth
|
|
165
|
+
gate. Copy button + QR code included.
|
|
166
|
+
* **Actual tunnel address** — your real tunnel hostname (e.g. `*.trycloudflare.com`).
|
|
167
|
+
This is what the `302` redirects *to*. After login, your browser's address bar
|
|
168
|
+
will show **this** domain, not `remote.markus.global` — that is expected.
|
|
225
169
|
|
|
226
|
-
|
|
170
|
+
Liveness is shown as **● Online / Degraded / ({{ms}} ms latency)**, with three
|
|
171
|
+
actions: **[Restart] [Rotate address] [Turn off]**.
|
|
227
172
|
|
|
228
173
|
---
|
|
229
174
|
|
|
230
|
-
##
|
|
175
|
+
## 7. Abnormal states
|
|
231
176
|
|
|
232
|
-
|
|
177
|
+
The wizard never fails silently.
|
|
233
178
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
179
|
+
| Symptom | What you see | What to do |
|
|
180
|
+
|---|---|---|
|
|
181
|
+
| Tunnel dropped after being ready | **"Reconnecting…"** (auto-retry, page updates on recovery) | wait; or **Restart** |
|
|
182
|
+
| Verification failed | explicit reason + **Retry** + **Enter address manually** | retry, or paste the URL if discovery got it wrong |
|
|
183
|
+
| Address unreachable / blocked | reason `unreachable` + hint | your network may block it — **switch method** |
|
|
184
|
+
| Token mismatch | reason spelled out | the address may belong to someone else — re-run setup |
|
|
185
|
+
| `cloudflared`/`tailscale` missing | badge shows **not found**, commands warn | run the install command first |
|
|
240
186
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
Internet
|
|
245
|
-
│
|
|
246
|
-
▼
|
|
247
|
-
┌─────────────────────────┐
|
|
248
|
-
│ Cloudflare / Tailscale │ ← TLS termination + auth
|
|
249
|
-
│ (Zero-trust tunnel) │
|
|
250
|
-
└────────────┬────────────┘
|
|
251
|
-
│ (localhost only)
|
|
252
|
-
▼
|
|
253
|
-
┌─────────────────────────┐
|
|
254
|
-
│ Markus API (:8056) │ ← HTTP + WebSocket
|
|
255
|
-
│ Markus Web UI (:8057) │ ← Vite dev / static files
|
|
256
|
-
│ Comm Adapter (:8058) │ ← Internal only
|
|
257
|
-
└─────────────────────────┘
|
|
258
|
-
```
|
|
187
|
+
Verification failure reasons surface verbatim from the contract
|
|
188
|
+
(`verifyReasonUnreachable`, `non_https`, `blocked_target`, `too_many_redirects`,
|
|
189
|
+
`response_too_large`, `token_mismatch`, `malformed_response`).
|
|
259
190
|
|
|
260
191
|
---
|
|
261
192
|
|
|
262
|
-
##
|
|
193
|
+
## 8. Security boundary — **read this**
|
|
263
194
|
|
|
264
|
-
|
|
195
|
+
A tunnel exposes your local Markus **directly to the internet**. The entry gate
|
|
196
|
+
protects the *entry domain*; anyone who learns your **tunnel address** reaches
|
|
197
|
+
Markus directly. Treat it as a public server:
|
|
265
198
|
|
|
266
|
-
1.
|
|
267
|
-
2.
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
199
|
+
1. **Always set a password** on your local Markus before exposing it.
|
|
200
|
+
2. **Put an identity layer in front of the tunnel** — strongly recommended:
|
|
201
|
+
* **Cloudflare Access** (Zero Trust) for cloudflared tunnels, or
|
|
202
|
+
* **Tailscale ACLs**, or use **Tailscale Serve** (tailnet-only, not public).
|
|
203
|
+
3. Keep `cloudflared` / `tailscale` updated; rotate the tunnel if you suspect a leak.
|
|
204
|
+
4. The Hub stores only an **encrypted secret** (server-side) to verify you own the
|
|
205
|
+
endpoint — it never receives your traffic or your data.
|
|
271
206
|
|
|
272
207
|
---
|
|
273
208
|
|
|
274
|
-
##
|
|
275
|
-
|
|
276
|
-
**Q: Can I run Markus on a cloud VPS directly?**
|
|
277
|
-
A: Yes. Install with the official one-liner (`curl -fsSL https://markus.global/install.sh | bash`) or the desktop/CLI packages, then put nginx or Caddy in front for HTTPS. No tunnel needed since the VPS already has a public IP.
|
|
278
|
-
|
|
279
|
-
**Q: Which option works best in China?**
|
|
280
|
-
A: FRP with a domestic cloud VPS (Alibaba Cloud / Tencent Cloud). Cloudflare and Tailscale may have connectivity issues behind the GFW.
|
|
209
|
+
## 9. Honest limits
|
|
281
210
|
|
|
282
|
-
**
|
|
283
|
-
|
|
211
|
+
* **The address bar jumps to your tunnel domain** after login. The pretty entry
|
|
212
|
+
link is a front door, not the room.
|
|
213
|
+
* **Free tunnels are rate-limited** and are not meant for heavy traffic.
|
|
214
|
+
* **Quick tunnels change hostname on restart.** We auto-sync the registry, but
|
|
215
|
+
anyone you gave the *tunnel* address (not the entry link) will need the new one.
|
|
216
|
+
* **Mainland China:** Cloudflare/Tailscale free tiers may be unstable — use FRP.
|
|
217
|
+
* The legacy WebRTC relay path is retained only as a migration fallback for
|
|
218
|
+
existing installs; it is not offered for new setups.
|
|
284
219
|
|
|
285
|
-
**Q: Do I need a domain name?**
|
|
286
|
-
A: Only for Cloudflare Tunnel. Tailscale, FRP, and ngrok work without one.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Approval tri-state — handoff & verification
|
|
2
|
+
|
|
3
|
+
**Branch:** `feat/approval-tri-state-e2e` (worktree `/Users/liuqian/mycode/markus-approval-e2e`)
|
|
4
|
+
**Commits:** `a780c09f` (T1 · single execution point) → `e3ad9ad9` (T2/T3 · re-initiation + three-state UI)
|
|
5
|
+
**Base:** `8bc8d4e2` (main). Not pushed, `main` untouched.
|
|
6
|
+
|
|
7
|
+
## 1. What the gate semantics are
|
|
8
|
+
|
|
9
|
+
Every approval is resolved to one of three intents — `approve` / `request_changes` (打回) /
|
|
10
|
+
`reject` — by a **single parser** (`resolveApprovalIntent`, `hitl-service.ts`) from
|
|
11
|
+
`f(subType, selectedOption, approved)`. The boolean is only a legacy fallback for payloads
|
|
12
|
+
with no recognised option token. The intent is then applied by a **single execution point**
|
|
13
|
+
(`ApprovalApplier`, `approval-apply.ts`); no consumer transitions a target inline.
|
|
14
|
+
|
|
15
|
+
| Gate (`details.subType`) | Target | approve | 打回 (request_changes) | reject |
|
|
16
|
+
|---|---|---|---|---|
|
|
17
|
+
| `task` (建卡闸) | task `pending` | → `in_progress` | **stays `pending`** + reviewer comment | → `rejected` |
|
|
18
|
+
| `task_review` (验收闸) | task `review` | → `completed` | → `in_progress` (返工) | → `in_progress` (no terminal reject) |
|
|
19
|
+
| `requirement` / `requirement_resubmit` | requirement `pending` | → `in_progress` | **stays `pending`** + comment + creator notice | → `rejected` |
|
|
20
|
+
|
|
21
|
+
The 打回 loop has three segments and none is optional:
|
|
22
|
+
① the target stays `pending` (zero transition) → ② the reviewer's feedback lands as a comment
|
|
23
|
+
→ ③ the assignee revises and **re-initiates the approval**.
|
|
24
|
+
|
|
25
|
+
## 2. What this branch adds (on top of T1)
|
|
26
|
+
|
|
27
|
+
- **Re-initiation entry (the missing segment ③).** A 打回 consumes the approval entity, so
|
|
28
|
+
the target has no live approval and drops out of `listApprovals('pending')` — an *orphan*
|
|
29
|
+
whose only exit used to be the admin approve endpoint. Now:
|
|
30
|
+
- `TaskService.requestTaskApproval(taskId, actorId?)` and
|
|
31
|
+
`RequirementService.requestRequirementApproval(reqId, actorId?)` re-open the gate.
|
|
32
|
+
- HTTP: `POST /api/tasks/:id/request-approval`, `POST /api/requirements/:id/request-approval`.
|
|
33
|
+
- Agent tool: `task_request_approval`.
|
|
34
|
+
- Guards are actionable errors, never silent no-ops: not-`pending`, already-active
|
|
35
|
+
approval, missing target.
|
|
36
|
+
- **SSOT extraction.** `createTask` and `requestTaskApproval` share one implementation
|
|
37
|
+
(`openCreationGateApproval`); `createRequirement` / `resubmitRequirement` /
|
|
38
|
+
`requestRequirementApproval` share `openRequirementApprovalGate`. No second copy of the
|
|
39
|
+
approval-发起逻辑 can drift.
|
|
40
|
+
- **Explicit three-state UI.** `NotificationBell.tsx` (both the mobile and desktop render
|
|
41
|
+
blocks) now send the canonical token, label `approve` / `request_changes` / `reject`
|
|
42
|
+
distinctly, and no longer fold 打回 into an approval or a rejection. `api.ts` gained the
|
|
43
|
+
`resolveApprovalDirection` closure mirror plus `tasks/requirements.requestApproval`.
|
|
44
|
+
`optionLabels` added for zh-CN / en / es.
|
|
45
|
+
|
|
46
|
+
## 3. Verification (run in the worktree)
|
|
47
|
+
|
|
48
|
+
| Check | Result |
|
|
49
|
+
|---|---|
|
|
50
|
+
| `pnpm --filter @markus/{core,org-manager} build`, `pnpm --filter markus build` (cli) | exit 0 |
|
|
51
|
+
| `tsc --noEmit -p packages/web-ui/tsconfig.json` | clean |
|
|
52
|
+
| `vitest run --project node` | **6028 pass**, 1 fail — pre-existing network flake `commands-start-integration > auto-runs quickInit` (times out at 60 s in isolation too; unrelated to approvals) |
|
|
53
|
+
| `vitest run --project web-ui` | **1006 pass** (after registering `task_request_approval` in `toolCategories.ts`) |
|
|
54
|
+
| `approval-resubmit-entry.test.ts` (new) | 7/7 |
|
|
55
|
+
|
|
56
|
+
The new test locks: the orphan precondition, gate re-opening, re-send-back stays `pending`,
|
|
57
|
+
re-approve proceeds through the same single execution point, and every guardrail rejection.
|
|
58
|
+
|
|
59
|
+
## 4. Residual / not done
|
|
60
|
+
|
|
61
|
+
- **Not merged.** Still on `feat/approval-tri-state-e2e`; the previous plan targeted
|
|
62
|
+
`feat/ui-optimize-1015` (a merge, not a fast-forward — my branch is based on `8bc8d4e2`).
|
|
63
|
+
- **UI resubmit button** for a human reviewer is not wired into a specific screen; the
|
|
64
|
+
re-initiation path today is the agent tool + the two HTTP endpoints. Suggested home: the
|
|
65
|
+
pending-task detail view in `Work.tsx` (show it when `status === 'pending'` and no active
|
|
66
|
+
approval exists).
|
|
67
|
+
- **CLI approval card** does not yet render a distinct `changes_requested` terminal state;
|
|
68
|
+
the decision still applies correctly, only the tapped-card wording is generic.
|
|
69
|
+
- `ToolApprovalModal` (tool execution approval) stays binary by design — not a gate.
|